From 3511b88b71c1a571a54867c057c4452ad17f7d43 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Thu, 4 Nov 2021 17:07:42 +0100 Subject: [PATCH] Built motion from commit b31e0cc2.|2.5.37 --- 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.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/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/safe-template.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/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1154 files changed, 1154 insertions(+), 1154 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3b04a21..00a2c65 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-11-04T15:48:49.362Z", + "time": "2021-11-04T15:58:39.573Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 28a7a78..4132b1e 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-04T15:48:49.362Z", + "time": "2021-11-04T15:58:39.573Z", "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 87ce64d..9588a54 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 _0x08a9=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x4bea95,_0x2026cb){var _0x52aa29=function(_0x333759){while(--_0x333759){_0x4bea95['push'](_0x4bea95['shift']());}};_0x52aa29(++_0x2026cb);}(_0x08a9,0x147));var _0x908a=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x08a9[_0x673722];return _0x21249c;};'use strict';var Sequelize=require('sequelize');module[_0x908a('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x39774b){return this[_0x908a('0x1')](_0x908a('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x908a('0x3'),_0x908a('0x4'),_0x908a('0x5'),_0x908a('0x6'),_0x908a('0x7'),_0x908a('0x8'),'bot',_0x908a('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x908a('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x908a('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x908a('0xc')},'data4':{'type':Sequelize[_0x908a('0xa')](0x1000),'comments':_0x908a('0xd')},'data5':{'type':Sequelize[_0x908a('0xa')](0x1000),'comments':_0x908a('0xe')},'data6':{'type':Sequelize[_0x908a('0xa')],'comments':_0x908a('0xf')},'data7':{'type':Sequelize[_0x908a('0x10')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xa61b=['getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL'];(function(_0xc8069a,_0x2968fc){var _0x16bc69=function(_0x4e8a44){while(--_0x4e8a44){_0xc8069a['push'](_0xc8069a['shift']());}};_0x16bc69(++_0x2968fc);}(_0xa61b,0x7b));var _0xba61=function(_0x2d4664,_0xe3a407){_0x2d4664=_0x2d4664-0x0;var _0x1360e8=_0xa61b[_0x2d4664];return _0x1360e8;};'use strict';var Sequelize=require(_0xba61('0x0'));module[_0xba61('0x1')]={'name':{'type':Sequelize[_0xba61('0x2')],'get':function(_0x376527){return this[_0xba61('0x3')](_0xba61('0x4'));}},'action':{'type':Sequelize[_0xba61('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xba61('0x6'),_0xba61('0x7'),_0xba61('0x8'),'jscripty',_0xba61('0x9'),_0xba61('0xa'),_0xba61('0xb'),'script']],'msg':_0xba61('0xc')}},'comment':_0xba61('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xba61('0xd')},'data2':{'type':Sequelize[_0xba61('0x5')](0x1000),'comment':_0xba61('0xe')},'data3':{'type':Sequelize[_0xba61('0x5')](0x1000),'comment':_0xba61('0xf')},'data4':{'type':Sequelize[_0xba61('0x5')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xba61('0x5')](0x1000),'comments':_0xba61('0x10')},'data6':{'type':Sequelize[_0xba61('0x5')],'comments':_0xba61('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8426c4e..5e06c1d 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 _0xccde=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','body','Action','find','params','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xccde,0x83));var _0xeccd=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0xccde[_0x2731f0];return _0x36a180;};'use strict';var emlformat=require(_0xeccd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeccd('0x1'));var rp=require(_0xeccd('0x2'));var moment=require(_0xeccd('0x3'));var BPromise=require(_0xeccd('0x4'));var Mustache=require(_0xeccd('0x5'));var util=require(_0xeccd('0x6'));var path=require(_0xeccd('0x7'));var sox=require(_0xeccd('0x8'));var csv=require(_0xeccd('0x9'));var ejs=require(_0xeccd('0xa'));var fs=require('fs');var fs_extra=require(_0xeccd('0xb'));var _=require(_0xeccd('0xc'));var squel=require('squel');var crypto=require(_0xeccd('0xd'));var jsforce=require(_0xeccd('0xe'));var deskjs=require(_0xeccd('0xf'));var toCsv=require(_0xeccd('0x9'));var querystring=require(_0xeccd('0x10'));var Papa=require(_0xeccd('0x11'));var Redis=require(_0xeccd('0x12'));var authService=require(_0xeccd('0x13'));var qs=require(_0xeccd('0x14'));var as=require(_0xeccd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeccd('0x16'))(_0xeccd('0x17'));var utils=require(_0xeccd('0x18'));var config=require(_0xeccd('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293712,_0x20cd4e){_0x20cd4e=_0x20cd4e||0xcc;return function(_0x1bc2e8){if(_0x1bc2e8){return _0x293712[_0xeccd('0x1a')](_0x20cd4e);}return _0x293712[_0xeccd('0x1b')](_0x20cd4e)[_0xeccd('0x1c')]();};}function respondWithResult(_0x5c039d,_0x258beb){_0x258beb=_0x258beb||0xc8;return function(_0x59778c){if(_0x59778c){return _0x5c039d['status'](_0x258beb)['json'](_0x59778c);}};}function respondWithFilteredResult(_0x54909c,_0x31e630){return function(_0x4c904b){if(_0x4c904b){var _0x355fc9=typeof _0x31e630['offset']===_0xeccd('0x1d')&&typeof _0x31e630[_0xeccd('0x1e')]==='undefined';var _0x4cb0d9=_0x4c904b['count'];var _0x222ad8=_0x355fc9?0x0:_0x31e630[_0xeccd('0x1f')];var _0x3af8b6=_0x355fc9?_0x4c904b[_0xeccd('0x20')]:_0x31e630[_0xeccd('0x1f')]+_0x31e630[_0xeccd('0x1e')];var _0x5e6ca2;if(_0x3af8b6>=_0x4cb0d9){_0x3af8b6=_0x4cb0d9;_0x5e6ca2=0xc8;}else{_0x5e6ca2=0xce;}_0x54909c[_0xeccd('0x1b')](_0x5e6ca2);return _0x54909c[_0xeccd('0x21')](_0xeccd('0x22'),_0x222ad8+'-'+_0x3af8b6+'/'+_0x4cb0d9)['json'](_0x4c904b);}return null;};}function patchUpdates(_0x4f4255){return function(_0x5f1da2){try{jsonpatch[_0xeccd('0x23')](_0x5f1da2,_0x4f4255,!![]);}catch(_0x407613){return BPromise[_0xeccd('0x24')](_0x407613);}return _0x5f1da2['save']();};}function saveUpdates(_0x16009d,_0x4e3a0e){return function(_0x38ef5b){if(_0x38ef5b){return _0x38ef5b[_0xeccd('0x25')](_0x16009d)['then'](function(_0x406745){return _0x406745;});}return null;};}function removeEntity(_0x3b5267,_0x58fc14){return function(_0x2a1237){if(_0x2a1237){return _0x2a1237['destroy']()[_0xeccd('0x26')](function(){_0x3b5267[_0xeccd('0x1b')](0xcc)[_0xeccd('0x1c')]();});}};}function handleEntityNotFound(_0x177dcd,_0x4ce11e){return function(_0x258d84){if(!_0x258d84){_0x177dcd[_0xeccd('0x1a')](0x194);}return _0x258d84;};}function handleError(_0x290ace,_0x251447){_0x251447=_0x251447||0x1f4;return function(_0x57941d){logger[_0xeccd('0x27')](_0x57941d[_0xeccd('0x28')]);if(_0x57941d[_0xeccd('0x29')]){delete _0x57941d['name'];}_0x290ace[_0xeccd('0x1b')](_0x251447)['send'](_0x57941d);};}exports[_0xeccd('0x25')]=function(_0x2f934e,_0x2e59f3){if(_0x2f934e['body']['id']){delete _0x2f934e[_0xeccd('0x2a')]['id'];}return db[_0xeccd('0x2b')][_0xeccd('0x2c')]({'where':{'id':_0x2f934e['params']['id']}})[_0xeccd('0x26')](handleEntityNotFound(_0x2e59f3,null))['then'](saveUpdates(_0x2f934e[_0xeccd('0x2a')],null))[_0xeccd('0x26')](respondWithResult(_0x2e59f3,null))['catch'](handleError(_0x2e59f3,null));};exports['destroy']=function(_0x49f8a1,_0x6b542d){return db['Action'][_0xeccd('0x2c')]({'where':{'id':_0x49f8a1[_0xeccd('0x2d')]['id']}})[_0xeccd('0x26')](handleEntityNotFound(_0x6b542d,null))[_0xeccd('0x26')](removeEntity(_0x6b542d,null))[_0xeccd('0x2e')](handleError(_0x6b542d,null));}; \ No newline at end of file +var _0xacc0=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','offset','status','apply','reject','save','update','then','stack','name','body','Action','find','catch','destroy','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacc0,0x1c1));var _0x0acc=function(_0x458c0d,_0x4d6aa1){_0x458c0d=_0x458c0d-0x0;var _0x151ccc=_0xacc0[_0x458c0d];return _0x151ccc;};'use strict';var emlformat=require(_0x0acc('0x0'));var rimraf=require(_0x0acc('0x1'));var zipdir=require(_0x0acc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0acc('0x3'));var moment=require(_0x0acc('0x4'));var BPromise=require(_0x0acc('0x5'));var Mustache=require(_0x0acc('0x6'));var util=require(_0x0acc('0x7'));var path=require(_0x0acc('0x8'));var sox=require(_0x0acc('0x9'));var csv=require(_0x0acc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0acc('0xb'));var squel=require(_0x0acc('0xc'));var crypto=require(_0x0acc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0acc('0xe'));var toCsv=require(_0x0acc('0xa'));var querystring=require(_0x0acc('0xf'));var Papa=require(_0x0acc('0x10'));var Redis=require(_0x0acc('0x11'));var authService=require(_0x0acc('0x12'));var qs=require(_0x0acc('0x13'));var as=require(_0x0acc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0acc('0x15'))(_0x0acc('0x16'));var utils=require('../../config/utils');var config=require(_0x0acc('0x17'));var licenseUtil=require(_0x0acc('0x18'));var db=require(_0x0acc('0x19'))['db'];function respondWithStatusCode(_0x10d966,_0x34602b){_0x34602b=_0x34602b||0xcc;return function(_0x3ce327){if(_0x3ce327){return _0x10d966[_0x0acc('0x1a')](_0x34602b);}return _0x10d966['status'](_0x34602b)[_0x0acc('0x1b')]();};}function respondWithResult(_0x2fd7ff,_0x5983da){_0x5983da=_0x5983da||0xc8;return function(_0x5bf9c8){if(_0x5bf9c8){return _0x2fd7ff['status'](_0x5983da)[_0x0acc('0x1c')](_0x5bf9c8);}};}function respondWithFilteredResult(_0x1e98a9,_0x2a5fa1){return function(_0x4fe84e){if(_0x4fe84e){var _0x1812c5=typeof _0x2a5fa1['offset']==='undefined'&&typeof _0x2a5fa1[_0x0acc('0x1d')]===_0x0acc('0x1e');var _0x4ca14c=_0x4fe84e['count'];var _0x1be9aa=_0x1812c5?0x0:_0x2a5fa1['offset'];var _0x332493=_0x1812c5?_0x4fe84e['count']:_0x2a5fa1[_0x0acc('0x1f')]+_0x2a5fa1[_0x0acc('0x1d')];var _0x1c6f40;if(_0x332493>=_0x4ca14c){_0x332493=_0x4ca14c;_0x1c6f40=0xc8;}else{_0x1c6f40=0xce;}_0x1e98a9[_0x0acc('0x20')](_0x1c6f40);return _0x1e98a9['set']('Content-Range',_0x1be9aa+'-'+_0x332493+'/'+_0x4ca14c)[_0x0acc('0x1c')](_0x4fe84e);}return null;};}function patchUpdates(_0x33eecf){return function(_0x55ef55){try{jsonpatch[_0x0acc('0x21')](_0x55ef55,_0x33eecf,!![]);}catch(_0x3522ee){return BPromise[_0x0acc('0x22')](_0x3522ee);}return _0x55ef55[_0x0acc('0x23')]();};}function saveUpdates(_0x2ba5ae,_0x144ff8){return function(_0x306fda){if(_0x306fda){return _0x306fda[_0x0acc('0x24')](_0x2ba5ae)['then'](function(_0x5246a8){return _0x5246a8;});}return null;};}function removeEntity(_0x38f331,_0x3b0cb7){return function(_0x28cdc0){if(_0x28cdc0){return _0x28cdc0['destroy']()[_0x0acc('0x25')](function(){_0x38f331[_0x0acc('0x20')](0xcc)[_0x0acc('0x1b')]();});}};}function handleEntityNotFound(_0x439481,_0x56cd45){return function(_0x2d47f9){if(!_0x2d47f9){_0x439481['sendStatus'](0x194);}return _0x2d47f9;};}function handleError(_0x4aa594,_0x9907cd){_0x9907cd=_0x9907cd||0x1f4;return function(_0x4c7434){logger['error'](_0x4c7434[_0x0acc('0x26')]);if(_0x4c7434[_0x0acc('0x27')]){delete _0x4c7434['name'];}_0x4aa594[_0x0acc('0x20')](_0x9907cd)['send'](_0x4c7434);};}exports[_0x0acc('0x24')]=function(_0x169b55,_0x221e0d){if(_0x169b55[_0x0acc('0x28')]['id']){delete _0x169b55[_0x0acc('0x28')]['id'];}return db[_0x0acc('0x29')][_0x0acc('0x2a')]({'where':{'id':_0x169b55['params']['id']}})['then'](handleEntityNotFound(_0x221e0d,null))[_0x0acc('0x25')](saveUpdates(_0x169b55[_0x0acc('0x28')],null))['then'](respondWithResult(_0x221e0d,null))[_0x0acc('0x2b')](handleError(_0x221e0d,null));};exports[_0x0acc('0x2c')]=function(_0x36b028,_0xbed0e0){return db[_0x0acc('0x29')]['find']({'where':{'id':_0x36b028[_0x0acc('0x2d')]['id']}})[_0x0acc('0x25')](handleEntityNotFound(_0xbed0e0,null))[_0x0acc('0x25')](removeEntity(_0xbed0e0,null))['catch'](handleError(_0xbed0e0,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8bac696..0b62de2 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 _0x3acc=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x3f70b4,_0x3d3d4b){var _0x8a55bd=function(_0x97c419){while(--_0x97c419){_0x3f70b4['push'](_0x3f70b4['shift']());}};_0x8a55bd(++_0x3d3d4b);}(_0x3acc,0x13f));var _0xc3ac=function(_0x2a534d,_0xa45332){_0x2a534d=_0x2a534d-0x0;var _0x5890e9=_0x3acc[_0x2a534d];return _0x5890e9;};'use strict';var _=require(_0xc3ac('0x0'));var util=require(_0xc3ac('0x1'));var logger=require(_0xc3ac('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3ac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3ac('0x4'));var rimraf=require(_0xc3ac('0x5'));var config=require(_0xc3ac('0x6'));var attributes=require(_0xc3ac('0x7'));module[_0xc3ac('0x8')]=function(_0x18928d,_0xa811df){return _0x18928d[_0xc3ac('0x9')](_0xc3ac('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb78e=['Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x2f2d3d,_0x356ffa){var _0x5bf78a=function(_0x5f25f3){while(--_0x5f25f3){_0x2f2d3d['push'](_0x2f2d3d['shift']());}};_0x5bf78a(++_0x356ffa);}(_0xb78e,0x1c9));var _0xeb78=function(_0x7cfa25,_0x8b59d5){_0x7cfa25=_0x7cfa25-0x0;var _0x481972=_0xb78e[_0x7cfa25];return _0x481972;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index fe36c5a..259fb3a 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x509da7,_0x49c1d0){var _0x2dcbc1=function(_0x2bf2ea){while(--_0x2bf2ea){_0x509da7['push'](_0x509da7['shift']());}};_0x2dcbc1(++_0x49c1d0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2cb7ef,_0x4dd339){_0x2cb7ef=_0x2cb7ef-0x0;var _0x5ce2e6=_0x7fbe[_0x2cb7ef];return _0x5ce2e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x53ec,0x192));var _0xc53e=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x53ec[_0x318840];return _0x223da4;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f19f15b..c2545ac 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 _0x4535=['update','delete','isAuthenticated','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x16e601,_0x3afff1){var _0x52d161=function(_0x48f786){while(--_0x48f786){_0x16e601['push'](_0x16e601['shift']());}};_0x52d161(++_0x3afff1);}(_0x4535,0x1d4));var _0x5453=function(_0x876ec0,_0x22c3d7){_0x876ec0=_0x876ec0-0x0;var _0x12a539=_0x4535[_0x876ec0];return _0x12a539;};'use strict';var multer=require(_0x5453('0x0'));var util=require('util');var path=require(_0x5453('0x1'));var timeout=require(_0x5453('0x2'));var express=require(_0x5453('0x3'));var router=express[_0x5453('0x4')]();var fs_extra=require(_0x5453('0x5'));var auth=require(_0x5453('0x6'));var interaction=require(_0x5453('0x7'));var config=require(_0x5453('0x8'));var controller=require(_0x5453('0x9'));router[_0x5453('0xa')](_0x5453('0xb'),auth['isAuthenticated'](),controller[_0x5453('0xc')]);router[_0x5453('0xd')](_0x5453('0xb'),auth[_0x5453('0xe')](),controller[_0x5453('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8ad3=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x468bc8,_0x552cfc){var _0xe1c86b=function(_0x154ced){while(--_0x154ced){_0x468bc8['push'](_0x468bc8['shift']());}};_0xe1c86b(++_0x552cfc);}(_0x8ad3,0x181));var _0x38ad=function(_0x420bf8,_0x1351a4){_0x420bf8=_0x420bf8-0x0;var _0x1fd7e2=_0x8ad3[_0x420bf8];return _0x1fd7e2;};'use strict';var multer=require(_0x38ad('0x0'));var util=require('util');var path=require(_0x38ad('0x1'));var timeout=require(_0x38ad('0x2'));var express=require(_0x38ad('0x3'));var router=express[_0x38ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x38ad('0x5'));var interaction=require(_0x38ad('0x6'));var config=require(_0x38ad('0x7'));var controller=require(_0x38ad('0x8'));router[_0x38ad('0x9')](_0x38ad('0xa'),auth[_0x38ad('0xb')](),controller[_0x38ad('0xc')]);router[_0x38ad('0xd')](_0x38ad('0xa'),auth[_0x38ad('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8a8a150..28a6ba3 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 _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x52935d,_0xca418d){var _0x3aa520=function(_0x19fd18){while(--_0x19fd18){_0x52935d['push'](_0x52935d['shift']());}};_0x3aa520(++_0xca418d);}(_0xb138,0x1dd));var _0x8b13=function(_0x4db013,_0xc6dd89){_0x4db013=_0x4db013-0x0;var _0x105821=_0xb138[_0x4db013];return _0x105821;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x2d39b2,_0x23bd7e){var _0x44e183=function(_0x43e474){while(--_0x43e474){_0x2d39b2['push'](_0x2d39b2['shift']());}};_0x44e183(++_0x23bd7e);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1697a3,_0x6e243c){_0x1697a3=_0x1697a3-0x0;var _0x1ec940=_0x3eea[_0x1697a3];return _0x1ec940;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 078ba54..8fd87cf 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 _0x446f=['IS\x20NOT\x20NULL','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','count','offset','limit','set','apply','reject','save','update','destroy','get','CustomReports','UserProfileResource','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','operator','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','run','runReport','HOUR(%s)'];(function(_0x9affab,_0x5e6290){var _0x2a23d9=function(_0x51441a){while(--_0x51441a){_0x9affab['push'](_0x9affab['shift']());}};_0x2a23d9(++_0x5e6290);}(_0x446f,0x154));var _0xf446=function(_0x1c2079,_0x379b35){_0x1c2079=_0x1c2079-0x0;var _0x1e4ed=_0x446f[_0x1c2079];return _0x1e4ed;};'use strict';var emlformat=require(_0xf446('0x0'));var rimraf=require(_0xf446('0x1'));var zipdir=require(_0xf446('0x2'));var jsonpatch=require(_0xf446('0x3'));var rp=require(_0xf446('0x4'));var moment=require('moment');var BPromise=require(_0xf446('0x5'));var Mustache=require(_0xf446('0x6'));var util=require(_0xf446('0x7'));var path=require('path');var sox=require(_0xf446('0x8'));var csv=require(_0xf446('0x9'));var ejs=require(_0xf446('0xa'));var fs=require('fs');var fs_extra=require(_0xf446('0xb'));var _=require(_0xf446('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf446('0xd'));var deskjs=require(_0xf446('0xe'));var toCsv=require(_0xf446('0x9'));var querystring=require(_0xf446('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf446('0x10'));var as=require(_0xf446('0x11'));var hardwareService=require(_0xf446('0x12'));var logger=require(_0xf446('0x13'))(_0xf446('0x14'));var utils=require(_0xf446('0x15'));var config=require(_0xf446('0x16'));var licenseUtil=require(_0xf446('0x17'));var db=require(_0xf446('0x18'))['db'];var dbH=require(_0xf446('0x18'))[_0xf446('0x19')];function respondWithStatusCode(_0x291ecc,_0x308b87){_0x308b87=_0x308b87||0xcc;return function(_0x5e8ef2){if(_0x5e8ef2){return _0x291ecc[_0xf446('0x1a')](_0x308b87);}return _0x291ecc[_0xf446('0x1b')](_0x308b87)[_0xf446('0x1c')]();};}function respondWithResult(_0x1ef13b,_0x196b42){_0x196b42=_0x196b42||0xc8;return function(_0x4a5ee1){if(_0x4a5ee1){return _0x1ef13b[_0xf446('0x1b')](_0x196b42)['json'](_0x4a5ee1);}};}function respondWithFilteredResult(_0x528e5c,_0x496776){return function(_0x3a5e7b){if(_0x3a5e7b){var _0x211890=typeof _0x496776['offset']===_0xf446('0x1d')&&typeof _0x496776['limit']===_0xf446('0x1d');var _0x18b078=_0x3a5e7b[_0xf446('0x1e')];var _0x597e17=_0x211890?0x0:_0x496776['offset'];var _0x565df6=_0x211890?_0x3a5e7b[_0xf446('0x1e')]:_0x496776[_0xf446('0x1f')]+_0x496776[_0xf446('0x20')];var _0x5d62e2;if(_0x565df6>=_0x18b078){_0x565df6=_0x18b078;_0x5d62e2=0xc8;}else{_0x5d62e2=0xce;}_0x528e5c[_0xf446('0x1b')](_0x5d62e2);return _0x528e5c[_0xf446('0x21')]('Content-Range',_0x597e17+'-'+_0x565df6+'/'+_0x18b078)['json'](_0x3a5e7b);}return null;};}function patchUpdates(_0x1f8f07){return function(_0x3ccbde){try{jsonpatch[_0xf446('0x22')](_0x3ccbde,_0x1f8f07,!![]);}catch(_0x5b48df){return BPromise[_0xf446('0x23')](_0x5b48df);}return _0x3ccbde[_0xf446('0x24')]();};}function saveUpdates(_0x26692c,_0x38a6f7){return function(_0x15d30e){if(_0x15d30e){return _0x15d30e[_0xf446('0x25')](_0x26692c)['then'](function(_0x150ca1){return _0x150ca1;});}return null;};}function removeEntity(_0x431cfa,_0xea87c7){return function(_0x2afb60){if(_0x2afb60){return _0x2afb60[_0xf446('0x26')]()['then'](function(){var _0x327d7c=_0x2afb60[_0xf446('0x27')]({'plain':!![]});var _0x4a8c8a=_0xf446('0x28');return db[_0xf446('0x29')][_0xf446('0x26')]({'where':{'type':_0x4a8c8a,'resourceId':_0x327d7c['id']}})[_0xf446('0x2a')](function(){return _0x2afb60;});})['then'](function(){_0x431cfa[_0xf446('0x1b')](0xcc)[_0xf446('0x1c')]();});}};}function handleEntityNotFound(_0x496426,_0x464071){return function(_0x3520a1){if(!_0x3520a1){_0x496426[_0xf446('0x1a')](0x194);}return _0x3520a1;};}function handleError(_0x43fec0,_0x3bfb49){_0x3bfb49=_0x3bfb49||0x1f4;return function(_0x2c8b11){logger[_0xf446('0x2b')](_0x2c8b11[_0xf446('0x2c')]);if(_0x2c8b11[_0xf446('0x2d')]){delete _0x2c8b11[_0xf446('0x2d')];}_0x43fec0[_0xf446('0x1b')](_0x3bfb49)[_0xf446('0x2e')](_0x2c8b11);};}exports['index']=function(_0x1a9d23,_0x1c9f1b){var _0x3a43e1={},_0x83d071={},_0x236462={'count':0x0,'rows':[]};var _0x21880f=_[_0xf446('0x2f')](db[_0xf446('0x30')][_0xf446('0x31')],function(_0x3a153b){return{'name':_0x3a153b[_0xf446('0x32')],'type':_0x3a153b[_0xf446('0x33')][_0xf446('0x34')]};});_0x83d071['model']=_[_0xf446('0x2f')](_0x21880f,'name');_0x83d071['query']=_[_0xf446('0x35')](_0x1a9d23[_0xf446('0x36')]);_0x83d071[_0xf446('0x37')]=_[_0xf446('0x38')](_0x83d071[_0xf446('0x39')],_0x83d071[_0xf446('0x36')]);_0x3a43e1[_0xf446('0x3a')]=_[_0xf446('0x38')](_0x83d071['model'],qs['fields'](_0x1a9d23[_0xf446('0x36')][_0xf446('0x3b')]));_0x3a43e1['attributes']=_0x3a43e1['attributes'][_0xf446('0x3c')]?_0x3a43e1['attributes']:_0x83d071[_0xf446('0x39')];if(!_0x1a9d23[_0xf446('0x36')][_0xf446('0x3d')](_0xf446('0x3e'))){_0x3a43e1[_0xf446('0x20')]=qs[_0xf446('0x20')](_0x1a9d23[_0xf446('0x36')][_0xf446('0x20')]);_0x3a43e1[_0xf446('0x1f')]=qs[_0xf446('0x1f')](_0x1a9d23['query']['offset']);}_0x3a43e1[_0xf446('0x3f')]=qs['sort'](_0x1a9d23[_0xf446('0x36')][_0xf446('0x40')]);_0x3a43e1[_0xf446('0x41')]=qs[_0xf446('0x37')](_[_0xf446('0x42')](_0x1a9d23['query'],_0x83d071[_0xf446('0x37')]),_0x21880f);if(_0x1a9d23[_0xf446('0x36')][_0xf446('0x43')]){_0x3a43e1[_0xf446('0x41')]=_[_0xf446('0x44')](_0x3a43e1[_0xf446('0x41')],{'$or':_[_0xf446('0x2f')](_0x21880f,function(_0x247abc){if(_0x247abc[_0xf446('0x33')]!==_0xf446('0x45')){var _0x5fdc97={};_0x5fdc97[_0x247abc[_0xf446('0x2d')]]={'$like':'%'+_0x1a9d23['query'][_0xf446('0x43')]+'%'};return _0x5fdc97;}})});}_0x3a43e1=_[_0xf446('0x44')]({},_0x3a43e1,_0x1a9d23[_0xf446('0x46')]);var _0x1eb6a0={'where':_0x3a43e1[_0xf446('0x41')]};return db[_0xf446('0x30')][_0xf446('0x1e')](_0x1eb6a0)[_0xf446('0x2a')](function(_0x418a67){_0x236462[_0xf446('0x1e')]=_0x418a67;if(_0x1a9d23[_0xf446('0x36')][_0xf446('0x47')]){_0x3a43e1['include']=[{'all':!![]}];}return db[_0xf446('0x30')][_0xf446('0x48')](_0x3a43e1);})[_0xf446('0x2a')](function(_0xa5be7e){_0x236462[_0xf446('0x49')]=_0xa5be7e;return _0x236462;})[_0xf446('0x2a')](respondWithFilteredResult(_0x1c9f1b,_0x3a43e1))['catch'](handleError(_0x1c9f1b,null));};exports[_0xf446('0x4a')]=function(_0x3579ca,_0x276ca7){var _0x383056={'raw':![],'where':{'id':_0x3579ca[_0xf446('0x4b')]['id']}},_0x40b247={};_0x40b247[_0xf446('0x39')]=_[_0xf446('0x35')](db['AnalyticCustomReport']['rawAttributes']);_0x40b247[_0xf446('0x36')]=_[_0xf446('0x35')](_0x3579ca[_0xf446('0x36')]);_0x40b247[_0xf446('0x37')]=_[_0xf446('0x38')](_0x40b247['model'],_0x40b247['query']);_0x383056[_0xf446('0x3a')]=_[_0xf446('0x38')](_0x40b247[_0xf446('0x39')],qs[_0xf446('0x3b')](_0x3579ca[_0xf446('0x36')][_0xf446('0x3b')]));_0x383056[_0xf446('0x3a')]=_0x383056[_0xf446('0x3a')][_0xf446('0x3c')]?_0x383056['attributes']:_0x40b247['model'];if(_0x3579ca['query'][_0xf446('0x47')]){_0x383056['include']=[{'all':!![]}];}_0x383056=_[_0xf446('0x44')]({},_0x383056,_0x3579ca[_0xf446('0x46')]);return db[_0xf446('0x30')][_0xf446('0x4c')](_0x383056)['then'](handleEntityNotFound(_0x276ca7,null))[_0xf446('0x2a')](respondWithResult(_0x276ca7,null))[_0xf446('0x4d')](handleError(_0x276ca7,null));};exports['create']=function(_0x52efd4,_0x3c5cb0){return db[_0xf446('0x30')][_0xf446('0x4e')](_0x52efd4[_0xf446('0x4f')],{})[_0xf446('0x2a')](function(_0x32559d){var _0x201603=_0x52efd4[_0xf446('0x50')]['get']({'plain':!![]});if(!_0x201603)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x201603[_0xf446('0x51')]===_0xf446('0x50')){var _0x503f27=_0x32559d['get']({'plain':!![]});var _0x37e77a='Reports';return db[_0xf446('0x52')][_0xf446('0x4c')]({'where':{'name':_0x37e77a,'userProfileId':_0x201603[_0xf446('0x53')]},'raw':!![]})[_0xf446('0x2a')](function(_0x2e78a6){if(_0x2e78a6&&_0x2e78a6[_0xf446('0x54')]===0x0){return db[_0xf446('0x29')]['create']({'name':_0x503f27['name'],'resourceId':_0x503f27['id'],'type':_0xf446('0x28'),'sectionId':_0x2e78a6['id']},{})[_0xf446('0x2a')](function(){return _0x32559d;});}else{return _0x32559d;}})[_0xf446('0x4d')](function(_0x56c613){logger[_0xf446('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56c613);throw _0x56c613;});}return _0x32559d;})[_0xf446('0x2a')](respondWithResult(_0x3c5cb0,0xc9))[_0xf446('0x4d')](handleError(_0x3c5cb0,null));};exports[_0xf446('0x25')]=function(_0x362d71,_0x36137d){if(_0x362d71[_0xf446('0x4f')]['id']){delete _0x362d71[_0xf446('0x4f')]['id'];}return db['AnalyticCustomReport'][_0xf446('0x4c')]({'where':{'id':_0x362d71['params']['id']}})[_0xf446('0x2a')](handleEntityNotFound(_0x36137d,null))[_0xf446('0x2a')](saveUpdates(_0x362d71['body'],null))[_0xf446('0x2a')](respondWithResult(_0x36137d,null))[_0xf446('0x4d')](handleError(_0x36137d,null));};exports[_0xf446('0x26')]=function(_0x166a35,_0x131f39){return db[_0xf446('0x30')]['find']({'where':{'id':_0x166a35[_0xf446('0x4b')]['id']}})[_0xf446('0x2a')](handleEntityNotFound(_0x131f39,null))['then'](removeEntity(_0x131f39,null))[_0xf446('0x4d')](handleError(_0x131f39,null));};exports[_0xf446('0x55')]=function(_0xb97f64,_0x4eebf4){var _0x23c1b0=0xa;var _0x36df7d=[_0xf446('0x56'),_0xf446('0x57'),_0xf446('0x58'),_0xf446('0x59')];var _0x7ea649={'SUM':'SUM(%s)','COUNT':_0xf446('0x5a'),'COUNT DISTINCT':_0xf446('0x5b'),'MAX':'MAX(%s)','MIN':_0xf446('0x5c'),'AVG':_0xf446('0x5d'),'GROUP_CONCAT':_0xf446('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf446('0x5f')};var _0x52543d={'SEC_TO_TIME':_0xf446('0x60'),'DATE':_0xf446('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xf446('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5f554e=function(_0x45d4f1){return!_[_0xf446('0x63')]([_0xf446('0x64'),'IS\x20NOT\x20NULL',_0xf446('0x65'),_0xf446('0x66')],_0x45d4f1);};var _0x3b520a=function(_0xc2b5c2){if(!_0xc2b5c2||!_0xc2b5c2['rules'][_0xf446('0x3c')]){return'';}for(var _0x5bf6ca='(',_0x3eaa92=0x0;_0x3eaa92<_0xc2b5c2['rules'][_0xf446('0x3c')];_0x3eaa92+=0x1){_0x3eaa92>0x0&&(_0x5bf6ca+='\x20'+_0xc2b5c2['operator']+'\x20');_0x5bf6ca+=_0xc2b5c2[_0xf446('0x67')][_0x3eaa92][_0xf446('0x68')]?_0x3b520a(_0xc2b5c2[_0xf446('0x67')][_0x3eaa92]['group']):_0xc2b5c2[_0xf446('0x67')][_0x3eaa92]['field']+'\x20'+_0xc2b5c2[_0xf446('0x67')][_0x3eaa92][_0xf446('0x69')]+(_0x5f554e(_0xc2b5c2[_0xf446('0x67')][_0x3eaa92][_0xf446('0x69')])?'\x20'+_0xc2b5c2[_0xf446('0x67')][_0x3eaa92]['value']:'');}return _0x5bf6ca+')';};var _0x570969={'where':{'id':_0xb97f64[_0xf446('0x4b')]['id']}},_0x3b316c,_0x41f910,_0xe22852,_0x303c4c,_0x1c8c98;_0x570969=_[_0xf446('0x44')]({},_0x570969,_0xb97f64[_0xf446('0x46')]);return db[_0xf446('0x30')][_0xf446('0x4c')](_0x570969)[_0xf446('0x2a')](function(_0x724115){if(_0x724115){_0x3b316c=_0x724115;return _0x724115[_0xf446('0x6a')]();}return null;})[_0xf446('0x2a')](function(_0x5ab2d5){if(_0x5ab2d5){if(!_0x5ab2d5['length']){throw new db[(_0xf446('0x6b'))][(_0xf446('0x6c'))](_0xf446('0x6d'),0x193);}_0x41f910=_0x5ab2d5;return db[_0xf446('0x6e')][_0xf446('0x48')]({'raw':!![]});}return null;})[_0xf446('0x2a')](function(_0x1006e3){if(_0x1006e3){_0xe22852=_[_0xf446('0x6f')](_0x1006e3,'id');var _0x28f316;var _0x52f253=squel[_0xf446('0x70')]();_0x52f253[_0xf446('0x71')](_0x3b316c[_0xf446('0x72')]);for(var _0xe99b32=0x0;_0xe99b32<_0x41f910[_0xf446('0x3c')];_0xe99b32+=0x1){_0x28f316=_0x41f910[_0xe99b32]['MetricId']?_0xe22852[_0x41f910[_0xe99b32][_0xf446('0x73')]][_0xf446('0x74')]:_0x41f910[_0xe99b32]['field'];_0x28f316=_0x41f910[_0xe99b32][_0xf446('0x75')]?_[_0xf446('0x76')](_0x7ea649[_0x41f910[_0xe99b32]['function']],'%s',_0x28f316):_0x28f316;_0x28f316=_0x41f910[_0xe99b32]['format']?_[_0xf446('0x76')](_0x52543d[_0x41f910[_0xe99b32][_0xf446('0x77')]],'%s',_0x28f316):_0x28f316;if(_0x41f910[_0xe99b32][_0xf446('0x78')]){_0x52f253[_0xf446('0x68')](_0x28f316);}_0x41f910[_0xe99b32][_0xf446('0x79')]&&_0x52f253[_0xf446('0x3f')](_0x28f316,_0x41f910[_0xe99b32]['orderBy']===_0xf446('0x7a')?![]:!![]);_0x52f253[_0xf446('0x7b')](_0x28f316,_0x41f910[_0xe99b32][_0xf446('0x7c')]||_0x28f316);}if(_0x3b316c[_0xf446('0x7d')]){_0x3b316c[_0xf446('0x7d')]=JSON['parse'](_0x3b316c[_0xf446('0x7d')]);for(var _0x3e7ba8=0x0;_0x3e7ba8<_0x3b316c['joins'][_0xf446('0x3c')];_0x3e7ba8+=0x1){if(_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x33')]&&_[_0xf446('0x63')](_0x36df7d,_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x33')])&&_0x3b316c['joins'][_0x3e7ba8][_0xf446('0x7e')]&&_0x3b316c[_0xf446('0x7d')][_0x3e7ba8]['foreignTable']&&_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x7f')]){_0x52f253[_0x3b316c[_0xf446('0x7d')][_0x3e7ba8]['type']](_0x3b316c['joins'][_0x3e7ba8][_0xf446('0x80')],null,util[_0xf446('0x77')](_0xf446('0x81'),_0x3b316c[_0xf446('0x72')],_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x7e')],_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x80')],_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x7f')]));}}}if(_0x3b316c[_0xf446('0x82')]){_0x3b316c['conditions']=JSON[_0xf446('0x83')](_0x3b316c[_0xf446('0x82')]);_0x52f253[_0xf446('0x41')](_0x3b520a(_0x3b316c[_0xf446('0x82')][_0xf446('0x68')]));}_0x1c8c98=_0x52f253[_0xf446('0x84')]();_0x52f253['limit'](_0x23c1b0);_0x52f253[_0xf446('0x1f')](0x0);logger[_0xf446('0x85')](_0xf446('0x86'),_0x52f253[_0xf446('0x87')]());return dbH['sequelize'][_0xf446('0x36')](_0x52f253[_0xf446('0x87')](),{'type':dbH['sequelize'][_0xf446('0x88')][_0xf446('0x89')]});}})[_0xf446('0x2a')](respondWithResult(_0x4eebf4,null))[_0xf446('0x4d')](handleError(_0x4eebf4,null));};function runReport(_0x36f101,_0x47b2f7,_0x5388f7){var _0xbaf2b2=_0x47b2f7[_0xf446('0x2d')];var _0x5e0483=0xa;var _0x3e3462=[_0xf446('0x56'),_0xf446('0x57'),_0xf446('0x58'),_0xf446('0x59')];var _0x2340e8={'SUM':_0xf446('0x8a'),'COUNT':_0xf446('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf446('0x8b'),'MIN':_0xf446('0x5c'),'AVG':_0xf446('0x5d'),'GROUP_CONCAT':_0xf446('0x5e'),'GROUP_CONCAT ASC':_0xf446('0x8c'),'GROUP_CONCAT DESC':_0xf446('0x5f')};var _0x12caf4={'SEC_TO_TIME':_0xf446('0x60'),'DATE':_0xf446('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xf446('0x62'),'UNIX_TIMESTAMP':_0xf446('0x8d')};var _0x1a964a=function(_0x444c78){return!_[_0xf446('0x63')]([_0xf446('0x64'),'IS\x20NOT\x20NULL',_0xf446('0x65'),_0xf446('0x66')],_0x444c78);};var _0x10d31f=function(_0x5949db){if(!_0x5949db||!_0x5949db[_0xf446('0x67')][_0xf446('0x3c')]){return'';}for(var _0x23328e='(',_0x4f6c4e=0x0;_0x4f6c4e<_0x5949db[_0xf446('0x67')][_0xf446('0x3c')];_0x4f6c4e+=0x1){_0x4f6c4e>0x0&&(_0x23328e+='\x20'+_0x5949db[_0xf446('0x8e')]+'\x20');_0x23328e+=_0x5949db['rules'][_0x4f6c4e]['group']?_0x10d31f(_0x5949db['rules'][_0x4f6c4e][_0xf446('0x68')]):_0x5949db[_0xf446('0x67')][_0x4f6c4e]['field']+'\x20'+_0x5949db['rules'][_0x4f6c4e][_0xf446('0x69')]+(_0x1a964a(_0x5949db['rules'][_0x4f6c4e][_0xf446('0x69')])?'\x20'+_0x5949db[_0xf446('0x67')][_0x4f6c4e]['value']:'');}return _0x23328e+')';};var _0x20efd8={'where':{'id':_0x36f101['id']}},_0x2ab0c5,_0xaf4964,_0x3071e5,_0xf10ffe,_0x44405f;_0x20efd8=_[_0xf446('0x44')]({},_0x20efd8,_0x5388f7);return db[_0xf446('0x30')][_0xf446('0x4c')](_0x20efd8)[_0xf446('0x2a')](function(_0x568cbc){if(_0x568cbc){_0x2ab0c5=_0x568cbc;return _0x568cbc[_0xf446('0x6a')]();}return null;})[_0xf446('0x2a')](function(_0x1c685e){if(_0x1c685e){if(!_0x1c685e['length']){throw new db[(_0xf446('0x6b'))][(_0xf446('0x6c'))](_0xf446('0x6d'),0x193);}_0xaf4964=_0x1c685e;return db[_0xf446('0x6e')][_0xf446('0x48')]({'raw':!![]});}return null;})['then'](function(_0x558771){if(_0x558771){_0x3071e5=_[_0xf446('0x6f')](_0x558771,'id');var _0x379243;var _0x415b32=squel['select']();_0x415b32['from'](_0x2ab0c5['table']);for(var _0x294ba9=0x0;_0x294ba9<_0xaf4964[_0xf446('0x3c')];_0x294ba9+=0x1){_0x379243=_0xaf4964[_0x294ba9][_0xf446('0x73')]?_0x3071e5[_0xaf4964[_0x294ba9]['MetricId']][_0xf446('0x74')]:_0xaf4964[_0x294ba9]['field'];_0x379243=_0xaf4964[_0x294ba9]['function']?_['replace'](_0x2340e8[_0xaf4964[_0x294ba9][_0xf446('0x75')]],'%s',_0x379243):_0x379243;_0x379243=_0xaf4964[_0x294ba9]['format']?_[_0xf446('0x76')](_0x12caf4[_0xaf4964[_0x294ba9][_0xf446('0x77')]],'%s',_0x379243):_0x379243;if(_0xaf4964[_0x294ba9][_0xf446('0x78')]){_0x415b32['group'](_0x379243);}_0xaf4964[_0x294ba9]['orderBy']&&_0x415b32['order'](_0x379243,_0xaf4964[_0x294ba9][_0xf446('0x79')]===_0xf446('0x7a')?![]:!![]);_0x415b32[_0xf446('0x7b')](_0x379243,_0xaf4964[_0x294ba9]['alias']||_0x379243);}if(_0x2ab0c5[_0xf446('0x7d')]){_0x2ab0c5['joins']=JSON[_0xf446('0x83')](_0x2ab0c5[_0xf446('0x7d')]);for(var _0x41c660=0x0;_0x41c660<_0x2ab0c5[_0xf446('0x7d')][_0xf446('0x3c')];_0x41c660+=0x1){if(_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x33')]&&_['includes'](_0x3e3462,_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x33')])&&_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x7e')]&&_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x80')]&&_0x2ab0c5[_0xf446('0x7d')][_0x41c660]['foreignKey']){_0x415b32[_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x33')]](_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x80')],null,util[_0xf446('0x77')](_0xf446('0x81'),_0x2ab0c5[_0xf446('0x72')],_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x7e')],_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x80')],_0x2ab0c5[_0xf446('0x7d')][_0x41c660]['foreignKey']));}}}if(_0x2ab0c5['conditions']){_0x2ab0c5[_0xf446('0x82')]=JSON[_0xf446('0x83')](_0x2ab0c5['conditions']);_0x415b32[_0xf446('0x41')](_0x10d31f(_0x2ab0c5[_0xf446('0x82')]['group']));}_0x44405f=_0x415b32[_0xf446('0x84')]();_0x415b32['limit'](_0x5e0483);_0x415b32[_0xf446('0x1f')](0x0);return;}})[_0xf446('0x2a')](function(){if(_0x47b2f7[_0xf446('0x8f')]===_0xf446('0x90')){return null;}var _0xc66c0f=_[_0xf446('0x44')](_0x47b2f7,{'name':_0x47b2f7[_0xf446('0x91')]||_0x47b2f7[_0xf446('0x2d')]||_0x2ab0c5[_0xf446('0x2d')],'basename':_0xbaf2b2,'savename':util['format'](_0xf446('0x92'),_0x47b2f7[_0xf446('0x2d')]||_0x2ab0c5['name'],require(_0xf446('0x93'))[_0xf446('0x94')](0x4),_0x47b2f7[_0xf446('0x8f')]||_0xf446('0x95')),'reportId':_0x2ab0c5['id'],'reportType':'custom'});return db[_0xf446('0x96')]['create'](_0xc66c0f,{'raw':!![]});})[_0xf446('0x2a')](function(_0x2c0fba){if(_0x2ab0c5[_0xf446('0x72')]==='cdr'){_0x44405f[_0xf446('0x41')](_0x2ab0c5['table']+_0xf446('0x97'),_0x47b2f7['startDate'],_0x47b2f7[_0xf446('0x98')]);}else{_0x44405f['where'](_0x2ab0c5[_0xf446('0x72')]+_0xf446('0x99'),_0x47b2f7[_0xf446('0x9a')],_0x47b2f7[_0xf446('0x98')]);}if(_0x2c0fba){logger[_0xf446('0x9b')]('Run\x20Query:',_0x44405f['toString']());require(_0xf446('0x9c'))[_0xf446('0x9d')](path[_0xf446('0x56')](__dirname,_0xf446('0x9e'),_0x2c0fba[_0xf446('0x8f')]),[_0x2c0fba['id'],_0x44405f[_0xf446('0x87')](),path[_0xf446('0x56')](__dirname,_0xf446('0x9f'),_0x2c0fba[_0xf446('0xa0')]),_0xbaf2b2]);return _0x2c0fba;}else{var _0x4606b3=squel[_0xf446('0x70')]();_0x4606b3[_0xf446('0x71')]('('+_0x44405f[_0xf446('0x87')]()+')',_0xf446('0xa1'));_0x4606b3[_0xf446('0x7b')](_0xf446('0xa2'),_0xf446('0x1e'));_0x44405f[_0xf446('0x20')](_0x47b2f7['limit']||_0x5e0483);_0x44405f['offset'](_0x47b2f7[_0xf446('0x1f')]||0x0);return dbH['sequelize']['query'](_0x4606b3[_0xf446('0x87')](),{'type':dbH[_0xf446('0xa3')][_0xf446('0x88')][_0xf446('0x89')]})[_0xf446('0x2a')](function(_0x5236aa){if(!_0x5236aa[_0xf446('0x3c')]){_0xf10ffe=0x0;}else{_0xf10ffe=_0x5236aa[0x0]['count']||0x0;}return dbH[_0xf446('0xa3')][_0xf446('0x36')](_0x44405f[_0xf446('0x87')](),{'type':dbH[_0xf446('0xa3')][_0xf446('0x88')][_0xf446('0x89')]});})[_0xf446('0x2a')](function(_0x2f18c9){return{'rows':_0x2f18c9||[],'count':_0xf10ffe};});}});}exports[_0xf446('0xa4')]=function(_0x19eee4,_0x1e90b4){return runReport(_0x19eee4[_0xf446('0x4b')],_0x19eee4[_0xf446('0x36')],_0x19eee4[_0xf446('0x46')])[_0xf446('0x2a')](respondWithResult(_0x1e90b4,null))[_0xf446('0x4d')](handleError(_0x1e90b4,null));};exports[_0xf446('0xa5')]=runReport;exports['query']=function(_0x1ad807,_0x15eaca){var _0x4874d5=0xa;var _0x3463f6=['join',_0xf446('0x57'),_0xf446('0x58'),_0xf446('0x59')];var _0x500dcc={'SUM':_0xf446('0x8a'),'COUNT':_0xf446('0x5a'),'COUNT DISTINCT':_0xf446('0x5b'),'MAX':_0xf446('0x8b'),'MIN':_0xf446('0x5c'),'AVG':_0xf446('0x5d'),'GROUP_CONCAT':_0xf446('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf446('0x5f')};var _0x498f8b={'SEC_TO_TIME':_0xf446('0x60'),'DATE':'DATE(%s)','HOUR':_0xf446('0xa6'),'ROUND':_0xf446('0x62'),'UNIX_TIMESTAMP':_0xf446('0x8d')};var _0x40a3b3=function(_0x38ea4b){return!_[_0xf446('0x63')]([_0xf446('0x64'),_0xf446('0xa7'),'IS\x20EMPTY',_0xf446('0x66')],_0x38ea4b);};var _0x4dd4c9=function(_0x39822a){if(!_0x39822a||!_0x39822a[_0xf446('0x67')][_0xf446('0x3c')]){return'';}for(var _0x586657='(',_0x7a704f=0x0;_0x7a704f<_0x39822a['rules'][_0xf446('0x3c')];_0x7a704f+=0x1){_0x7a704f>0x0&&(_0x586657+='\x20'+_0x39822a[_0xf446('0x8e')]+'\x20');_0x586657+=_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0x68')]?_0x4dd4c9(_0x39822a[_0xf446('0x67')][_0x7a704f]['group']):_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0x7b')]+'\x20'+_0x39822a[_0xf446('0x67')][_0x7a704f]['condition']+(_0x40a3b3(_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0x69')])?'\x20'+_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0xa8')]:'');}return _0x586657+')';};var _0x14dc5b={'where':{'id':_0x1ad807[_0xf446('0x4b')]['id']}},_0x1845de,_0x1deeb0,_0xedfd0d,_0x16ef36,_0x1c065a;_0x14dc5b=_[_0xf446('0x44')]({},_0x14dc5b,_0x1ad807[_0xf446('0x46')]);return db['AnalyticCustomReport'][_0xf446('0x4c')](_0x14dc5b)[_0xf446('0x2a')](function(_0x4e9a60){if(_0x4e9a60){_0x1845de=_0x4e9a60;return _0x4e9a60[_0xf446('0x6a')]();}return null;})[_0xf446('0x2a')](function(_0x274573){if(_0x274573){if(!_0x274573[_0xf446('0x3c')]){throw new db[(_0xf446('0x6b'))][(_0xf446('0x6c'))](_0xf446('0x6d'),0x193);}_0x1deeb0=_0x274573;return db[_0xf446('0x6e')][_0xf446('0x48')]({'raw':!![]});}return null;})['then'](function(_0x4ce92a){if(_0x4ce92a){_0xedfd0d=_[_0xf446('0x6f')](_0x4ce92a,'id');var _0x5d0e08;var _0x23de6a=squel['select']();_0x23de6a[_0xf446('0x71')](_0x1845de[_0xf446('0x72')]);for(var _0x2edf6a=0x0;_0x2edf6a<_0x1deeb0['length'];_0x2edf6a+=0x1){_0x5d0e08=_0x1deeb0[_0x2edf6a][_0xf446('0x73')]?_0xedfd0d[_0x1deeb0[_0x2edf6a][_0xf446('0x73')]][_0xf446('0x74')]:_0x1deeb0[_0x2edf6a][_0xf446('0x7b')];_0x5d0e08=_0x1deeb0[_0x2edf6a][_0xf446('0x75')]?_[_0xf446('0x76')](_0x500dcc[_0x1deeb0[_0x2edf6a][_0xf446('0x75')]],'%s',_0x5d0e08):_0x5d0e08;_0x5d0e08=_0x1deeb0[_0x2edf6a][_0xf446('0x77')]?_[_0xf446('0x76')](_0x498f8b[_0x1deeb0[_0x2edf6a][_0xf446('0x77')]],'%s',_0x5d0e08):_0x5d0e08;if(_0x1deeb0[_0x2edf6a][_0xf446('0x78')]){_0x23de6a[_0xf446('0x68')](_0x5d0e08);}_0x1deeb0[_0x2edf6a][_0xf446('0x79')]&&_0x23de6a['order'](_0x5d0e08,_0x1deeb0[_0x2edf6a][_0xf446('0x79')]===_0xf446('0x7a')?![]:!![]);_0x23de6a[_0xf446('0x7b')](_0x5d0e08,_0x1deeb0[_0x2edf6a][_0xf446('0x7c')]||_0x5d0e08);}if(_0x1845de['joins']){_0x1845de['joins']=JSON['parse'](_0x1845de['joins']);for(var _0x39f805=0x0;_0x39f805<_0x1845de['joins'][_0xf446('0x3c')];_0x39f805+=0x1){if(_0x1845de[_0xf446('0x7d')][_0x39f805]['type']&&_['includes'](_0x3463f6,_0x1845de[_0xf446('0x7d')][_0x39f805]['type'])&&_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x7e')]&&_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x80')]&&_0x1845de['joins'][_0x39f805][_0xf446('0x7f')]){_0x23de6a[_0x1845de[_0xf446('0x7d')][_0x39f805]['type']](_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x80')],null,util[_0xf446('0x77')](_0xf446('0x81'),_0x1845de[_0xf446('0x72')],_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x7e')],_0x1845de[_0xf446('0x7d')][_0x39f805]['foreignTable'],_0x1845de['joins'][_0x39f805][_0xf446('0x7f')]));}}}if(_0x1845de[_0xf446('0x82')]){_0x1845de[_0xf446('0x82')]=JSON['parse'](_0x1845de[_0xf446('0x82')]);_0x23de6a[_0xf446('0x41')](_0x4dd4c9(_0x1845de[_0xf446('0x82')][_0xf446('0x68')]));}_0x1c065a=_0x23de6a['clone']();_0x23de6a[_0xf446('0x20')](_0x4874d5);_0x23de6a[_0xf446('0x1f')](0x0);logger['debug'](_0xf446('0x86'),_0x23de6a[_0xf446('0x87')]());return dbH['sequelize']['query'](_0x23de6a[_0xf446('0x87')](),{'type':dbH['sequelize'][_0xf446('0x88')][_0xf446('0x89')]});}})[_0xf446('0x2a')](function(){return{'sql':_0x1c065a[_0xf446('0x87')]()};})[_0xf446('0x2a')](respondWithResult(_0x15eaca,null))[_0xf446('0x4d')](handleError(_0x15eaca,null));}; \ No newline at end of file +var _0x4148=['index','AnalyticCustomReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','DATE(%s)','condition','ValidationErrorItem','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','runReport','right_join','UNIX_TIMESTAMP(%s)','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','get','CustomReports','UserProfileResource','destroy','then','error','stack','name','send'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4148,0x75));var _0x8414=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x4148[_0x133277];return _0x5b4a22;};'use strict';var emlformat=require(_0x8414('0x0'));var rimraf=require(_0x8414('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8414('0x2'));var moment=require(_0x8414('0x3'));var BPromise=require(_0x8414('0x4'));var Mustache=require(_0x8414('0x5'));var util=require(_0x8414('0x6'));var path=require('path');var sox=require(_0x8414('0x7'));var csv=require(_0x8414('0x8'));var ejs=require(_0x8414('0x9'));var fs=require('fs');var fs_extra=require(_0x8414('0xa'));var _=require(_0x8414('0xb'));var squel=require(_0x8414('0xc'));var crypto=require('crypto');var jsforce=require(_0x8414('0xd'));var deskjs=require(_0x8414('0xe'));var toCsv=require(_0x8414('0x8'));var querystring=require(_0x8414('0xf'));var Papa=require('papaparse');var Redis=require(_0x8414('0x10'));var authService=require(_0x8414('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8414('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8414('0x13'))(_0x8414('0x14'));var utils=require('../../config/utils');var config=require(_0x8414('0x15'));var licenseUtil=require(_0x8414('0x16'));var db=require(_0x8414('0x17'))['db'];var dbH=require(_0x8414('0x17'))[_0x8414('0x18')];function respondWithStatusCode(_0x1b82bf,_0x1efc91){_0x1efc91=_0x1efc91||0xcc;return function(_0xc1d07b){if(_0xc1d07b){return _0x1b82bf[_0x8414('0x19')](_0x1efc91);}return _0x1b82bf['status'](_0x1efc91)[_0x8414('0x1a')]();};}function respondWithResult(_0x4df682,_0x135483){_0x135483=_0x135483||0xc8;return function(_0x3f1bba){if(_0x3f1bba){return _0x4df682[_0x8414('0x1b')](_0x135483)['json'](_0x3f1bba);}};}function respondWithFilteredResult(_0x209da9,_0x9aa9bd){return function(_0x2daf8d){if(_0x2daf8d){var _0x2e2752=typeof _0x9aa9bd['offset']==='undefined'&&typeof _0x9aa9bd[_0x8414('0x1c')]===_0x8414('0x1d');var _0x3d0165=_0x2daf8d['count'];var _0x43051b=_0x2e2752?0x0:_0x9aa9bd[_0x8414('0x1e')];var _0x5a0fec=_0x2e2752?_0x2daf8d[_0x8414('0x1f')]:_0x9aa9bd['offset']+_0x9aa9bd[_0x8414('0x1c')];var _0x235b65;if(_0x5a0fec>=_0x3d0165){_0x5a0fec=_0x3d0165;_0x235b65=0xc8;}else{_0x235b65=0xce;}_0x209da9[_0x8414('0x1b')](_0x235b65);return _0x209da9[_0x8414('0x20')](_0x8414('0x21'),_0x43051b+'-'+_0x5a0fec+'/'+_0x3d0165)[_0x8414('0x22')](_0x2daf8d);}return null;};}function patchUpdates(_0x1294ab){return function(_0x44cbe6){try{jsonpatch[_0x8414('0x23')](_0x44cbe6,_0x1294ab,!![]);}catch(_0x1c838c){return BPromise[_0x8414('0x24')](_0x1c838c);}return _0x44cbe6[_0x8414('0x25')]();};}function saveUpdates(_0x11eaa8,_0x20b71a){return function(_0x4ad4d8){if(_0x4ad4d8){return _0x4ad4d8[_0x8414('0x26')](_0x11eaa8)['then'](function(_0x1d2b61){return _0x1d2b61;});}return null;};}function removeEntity(_0x36df01,_0xbff4b5){return function(_0x23fd31){if(_0x23fd31){return _0x23fd31['destroy']()['then'](function(){var _0x503b55=_0x23fd31[_0x8414('0x27')]({'plain':!![]});var _0x43ffcb=_0x8414('0x28');return db[_0x8414('0x29')][_0x8414('0x2a')]({'where':{'type':_0x43ffcb,'resourceId':_0x503b55['id']}})[_0x8414('0x2b')](function(){return _0x23fd31;});})[_0x8414('0x2b')](function(){_0x36df01['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0a9d,_0x111824){return function(_0x4b4700){if(!_0x4b4700){_0x5c0a9d[_0x8414('0x19')](0x194);}return _0x4b4700;};}function handleError(_0x57701d,_0x398295){_0x398295=_0x398295||0x1f4;return function(_0x23eee1){logger[_0x8414('0x2c')](_0x23eee1[_0x8414('0x2d')]);if(_0x23eee1[_0x8414('0x2e')]){delete _0x23eee1[_0x8414('0x2e')];}_0x57701d[_0x8414('0x1b')](_0x398295)[_0x8414('0x2f')](_0x23eee1);};}exports[_0x8414('0x30')]=function(_0x25d62f,_0xe75fc7){var _0x439ea5={},_0x2d9990={},_0x5bc946={'count':0x0,'rows':[]};var _0x53ac6a=_['map'](db[_0x8414('0x31')][_0x8414('0x32')],function(_0xdc3dce){return{'name':_0xdc3dce[_0x8414('0x33')],'type':_0xdc3dce['type'][_0x8414('0x34')]};});_0x2d9990[_0x8414('0x35')]=_[_0x8414('0x36')](_0x53ac6a,_0x8414('0x2e'));_0x2d9990[_0x8414('0x37')]=_['keys'](_0x25d62f[_0x8414('0x37')]);_0x2d9990[_0x8414('0x38')]=_[_0x8414('0x39')](_0x2d9990['model'],_0x2d9990[_0x8414('0x37')]);_0x439ea5[_0x8414('0x3a')]=_[_0x8414('0x39')](_0x2d9990[_0x8414('0x35')],qs[_0x8414('0x3b')](_0x25d62f[_0x8414('0x37')]['fields']));_0x439ea5[_0x8414('0x3a')]=_0x439ea5[_0x8414('0x3a')]['length']?_0x439ea5[_0x8414('0x3a')]:_0x2d9990['model'];if(!_0x25d62f[_0x8414('0x37')][_0x8414('0x3c')]('nolimit')){_0x439ea5[_0x8414('0x1c')]=qs[_0x8414('0x1c')](_0x25d62f[_0x8414('0x37')]['limit']);_0x439ea5[_0x8414('0x1e')]=qs[_0x8414('0x1e')](_0x25d62f[_0x8414('0x37')]['offset']);}_0x439ea5[_0x8414('0x3d')]=qs[_0x8414('0x3e')](_0x25d62f['query'][_0x8414('0x3e')]);_0x439ea5[_0x8414('0x3f')]=qs['filters'](_['pick'](_0x25d62f['query'],_0x2d9990['filters']),_0x53ac6a);if(_0x25d62f[_0x8414('0x37')][_0x8414('0x40')]){_0x439ea5[_0x8414('0x3f')]=_['merge'](_0x439ea5['where'],{'$or':_['map'](_0x53ac6a,function(_0x3338c5){if(_0x3338c5[_0x8414('0x41')]!==_0x8414('0x42')){var _0x2b3154={};_0x2b3154[_0x3338c5[_0x8414('0x2e')]]={'$like':'%'+_0x25d62f[_0x8414('0x37')][_0x8414('0x40')]+'%'};return _0x2b3154;}})});}_0x439ea5=_['merge']({},_0x439ea5,_0x25d62f[_0x8414('0x43')]);var _0x2a611c={'where':_0x439ea5[_0x8414('0x3f')]};return db[_0x8414('0x31')]['count'](_0x2a611c)[_0x8414('0x2b')](function(_0x510f33){_0x5bc946[_0x8414('0x1f')]=_0x510f33;if(_0x25d62f[_0x8414('0x37')][_0x8414('0x44')]){_0x439ea5[_0x8414('0x45')]=[{'all':!![]}];}return db[_0x8414('0x31')][_0x8414('0x46')](_0x439ea5);})[_0x8414('0x2b')](function(_0x3b1b7d){_0x5bc946[_0x8414('0x47')]=_0x3b1b7d;return _0x5bc946;})[_0x8414('0x2b')](respondWithFilteredResult(_0xe75fc7,_0x439ea5))[_0x8414('0x48')](handleError(_0xe75fc7,null));};exports['show']=function(_0x13682c,_0xe956bf){var _0x2555e6={'raw':![],'where':{'id':_0x13682c[_0x8414('0x49')]['id']}},_0x21082e={};_0x21082e[_0x8414('0x35')]=_[_0x8414('0x4a')](db['AnalyticCustomReport'][_0x8414('0x32')]);_0x21082e[_0x8414('0x37')]=_[_0x8414('0x4a')](_0x13682c[_0x8414('0x37')]);_0x21082e['filters']=_[_0x8414('0x39')](_0x21082e[_0x8414('0x35')],_0x21082e['query']);_0x2555e6['attributes']=_[_0x8414('0x39')](_0x21082e[_0x8414('0x35')],qs[_0x8414('0x3b')](_0x13682c[_0x8414('0x37')]['fields']));_0x2555e6['attributes']=_0x2555e6[_0x8414('0x3a')][_0x8414('0x4b')]?_0x2555e6['attributes']:_0x21082e[_0x8414('0x35')];if(_0x13682c['query'][_0x8414('0x44')]){_0x2555e6[_0x8414('0x45')]=[{'all':!![]}];}_0x2555e6=_[_0x8414('0x4c')]({},_0x2555e6,_0x13682c[_0x8414('0x43')]);return db[_0x8414('0x31')]['find'](_0x2555e6)[_0x8414('0x2b')](handleEntityNotFound(_0xe956bf,null))[_0x8414('0x2b')](respondWithResult(_0xe956bf,null))[_0x8414('0x48')](handleError(_0xe956bf,null));};exports['create']=function(_0x1da558,_0x3beeed){return db['AnalyticCustomReport'][_0x8414('0x4d')](_0x1da558[_0x8414('0x4e')],{})[_0x8414('0x2b')](function(_0x11ee2d){var _0x2e5512=_0x1da558[_0x8414('0x4f')][_0x8414('0x27')]({'plain':!![]});if(!_0x2e5512)throw new Error(_0x8414('0x50'));if(_0x2e5512['role']===_0x8414('0x4f')){var _0x804410=_0x11ee2d[_0x8414('0x27')]({'plain':!![]});var _0x487ae6=_0x8414('0x51');return db[_0x8414('0x52')][_0x8414('0x53')]({'where':{'name':_0x487ae6,'userProfileId':_0x2e5512[_0x8414('0x54')]},'raw':!![]})['then'](function(_0x1d6e7f){if(_0x1d6e7f&&_0x1d6e7f[_0x8414('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x804410[_0x8414('0x2e')],'resourceId':_0x804410['id'],'type':_0x8414('0x28'),'sectionId':_0x1d6e7f['id']},{})['then'](function(){return _0x11ee2d;});}else{return _0x11ee2d;}})[_0x8414('0x48')](function(_0x1264d5){logger[_0x8414('0x2c')](_0x8414('0x56'),_0x1264d5);throw _0x1264d5;});}return _0x11ee2d;})[_0x8414('0x2b')](respondWithResult(_0x3beeed,0xc9))[_0x8414('0x48')](handleError(_0x3beeed,null));};exports[_0x8414('0x26')]=function(_0xe8cb55,_0x1d0f00){if(_0xe8cb55['body']['id']){delete _0xe8cb55[_0x8414('0x4e')]['id'];}return db[_0x8414('0x31')][_0x8414('0x53')]({'where':{'id':_0xe8cb55[_0x8414('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d0f00,null))[_0x8414('0x2b')](saveUpdates(_0xe8cb55['body'],null))['then'](respondWithResult(_0x1d0f00,null))[_0x8414('0x48')](handleError(_0x1d0f00,null));};exports[_0x8414('0x2a')]=function(_0x398a41,_0x20e9e){return db[_0x8414('0x31')][_0x8414('0x53')]({'where':{'id':_0x398a41[_0x8414('0x49')]['id']}})['then'](handleEntityNotFound(_0x20e9e,null))[_0x8414('0x2b')](removeEntity(_0x20e9e,null))[_0x8414('0x48')](handleError(_0x20e9e,null));};exports[_0x8414('0x57')]=function(_0xa28eb4,_0x1a59f5){var _0x17de1c=0xa;var _0x44dc33=[_0x8414('0x58'),_0x8414('0x59'),'right_join',_0x8414('0x5a')];var _0x159cba={'SUM':_0x8414('0x5b'),'COUNT':_0x8414('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8414('0x5d'),'MIN':_0x8414('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8414('0x5f'),'GROUP_CONCAT ASC':_0x8414('0x60'),'GROUP_CONCAT DESC':_0x8414('0x61')};var _0x2adc12={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x8414('0x62'),'ROUND':_0x8414('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8e2584=function(_0x104238){return!_['includes']([_0x8414('0x64'),_0x8414('0x65'),_0x8414('0x66'),_0x8414('0x67')],_0x104238);};var _0x28cae8=function(_0x1acd2c){if(!_0x1acd2c||!_0x1acd2c[_0x8414('0x68')][_0x8414('0x4b')]){return'';}for(var _0x47121d='(',_0x5d8036=0x0;_0x5d8036<_0x1acd2c[_0x8414('0x68')]['length'];_0x5d8036+=0x1){_0x5d8036>0x0&&(_0x47121d+='\x20'+_0x1acd2c['operator']+'\x20');_0x47121d+=_0x1acd2c['rules'][_0x5d8036]['group']?_0x28cae8(_0x1acd2c[_0x8414('0x68')][_0x5d8036][_0x8414('0x69')]):_0x1acd2c[_0x8414('0x68')][_0x5d8036]['field']+'\x20'+_0x1acd2c[_0x8414('0x68')][_0x5d8036]['condition']+(_0x8e2584(_0x1acd2c[_0x8414('0x68')][_0x5d8036]['condition'])?'\x20'+_0x1acd2c[_0x8414('0x68')][_0x5d8036][_0x8414('0x6a')]:'');}return _0x47121d+')';};var _0x17393f={'where':{'id':_0xa28eb4[_0x8414('0x49')]['id']}},_0x2a30ea,_0x188cc6,_0x51c461,_0x38842f,_0xa7039f;_0x17393f=_[_0x8414('0x4c')]({},_0x17393f,_0xa28eb4['options']);return db[_0x8414('0x31')][_0x8414('0x53')](_0x17393f)[_0x8414('0x2b')](function(_0x3ada5e){if(_0x3ada5e){_0x2a30ea=_0x3ada5e;return _0x3ada5e[_0x8414('0x6b')]();}return null;})[_0x8414('0x2b')](function(_0x543003){if(_0x543003){if(!_0x543003[_0x8414('0x4b')]){throw new db[(_0x8414('0x6c'))]['ValidationErrorItem'](_0x8414('0x6d'),0x193);}_0x188cc6=_0x543003;return db['AnalyticMetric'][_0x8414('0x46')]({'raw':!![]});}return null;})[_0x8414('0x2b')](function(_0x4e1048){if(_0x4e1048){_0x51c461=_[_0x8414('0x6e')](_0x4e1048,'id');var _0x328750;var _0x27011b=squel[_0x8414('0x6f')]();_0x27011b[_0x8414('0x70')](_0x2a30ea[_0x8414('0x71')]);for(var _0x2f9322=0x0;_0x2f9322<_0x188cc6[_0x8414('0x4b')];_0x2f9322+=0x1){_0x328750=_0x188cc6[_0x2f9322][_0x8414('0x72')]?_0x51c461[_0x188cc6[_0x2f9322][_0x8414('0x72')]][_0x8414('0x73')]:_0x188cc6[_0x2f9322]['field'];_0x328750=_0x188cc6[_0x2f9322][_0x8414('0x74')]?_[_0x8414('0x75')](_0x159cba[_0x188cc6[_0x2f9322]['function']],'%s',_0x328750):_0x328750;_0x328750=_0x188cc6[_0x2f9322][_0x8414('0x76')]?_['replace'](_0x2adc12[_0x188cc6[_0x2f9322][_0x8414('0x76')]],'%s',_0x328750):_0x328750;if(_0x188cc6[_0x2f9322][_0x8414('0x77')]){_0x27011b[_0x8414('0x69')](_0x328750);}_0x188cc6[_0x2f9322][_0x8414('0x78')]&&_0x27011b[_0x8414('0x3d')](_0x328750,_0x188cc6[_0x2f9322][_0x8414('0x78')]===_0x8414('0x79')?![]:!![]);_0x27011b[_0x8414('0x7a')](_0x328750,_0x188cc6[_0x2f9322][_0x8414('0x7b')]||_0x328750);}if(_0x2a30ea[_0x8414('0x7c')]){_0x2a30ea['joins']=JSON[_0x8414('0x7d')](_0x2a30ea[_0x8414('0x7c')]);for(var _0x59e789=0x0;_0x59e789<_0x2a30ea[_0x8414('0x7c')][_0x8414('0x4b')];_0x59e789+=0x1){if(_0x2a30ea['joins'][_0x59e789][_0x8414('0x41')]&&_[_0x8414('0x7e')](_0x44dc33,_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x41')])&&_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x7f')]&&_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x80')]&&_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x81')]){_0x27011b[_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x41')]](_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x80')],null,util['format'](_0x8414('0x82'),_0x2a30ea[_0x8414('0x71')],_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x7f')],_0x2a30ea[_0x8414('0x7c')][_0x59e789]['foreignTable'],_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x81')]));}}}if(_0x2a30ea[_0x8414('0x83')]){_0x2a30ea['conditions']=JSON[_0x8414('0x7d')](_0x2a30ea['conditions']);_0x27011b[_0x8414('0x3f')](_0x28cae8(_0x2a30ea[_0x8414('0x83')][_0x8414('0x69')]));}_0xa7039f=_0x27011b['clone']();_0x27011b[_0x8414('0x1c')](_0x17de1c);_0x27011b[_0x8414('0x1e')](0x0);logger[_0x8414('0x84')](_0x8414('0x85'),_0x27011b['toString']());return dbH['sequelize'][_0x8414('0x37')](_0x27011b[_0x8414('0x86')](),{'type':dbH[_0x8414('0x87')]['QueryTypes'][_0x8414('0x88')]});}})[_0x8414('0x2b')](respondWithResult(_0x1a59f5,null))['catch'](handleError(_0x1a59f5,null));};function runReport(_0x4b4b36,_0x446c16,_0x5e4303){var _0x22b1b6=_0x446c16[_0x8414('0x2e')];var _0x30a451=0xa;var _0x4c35b2=[_0x8414('0x58'),_0x8414('0x59'),'right_join','cross_join'];var _0x2ea3dc={'SUM':_0x8414('0x5b'),'COUNT':_0x8414('0x5c'),'COUNT DISTINCT':_0x8414('0x89'),'MAX':'MAX(%s)','MIN':_0x8414('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8414('0x60'),'GROUP_CONCAT DESC':_0x8414('0x61')};var _0x1b920c={'SEC_TO_TIME':_0x8414('0x8a'),'DATE':_0x8414('0x8b'),'HOUR':_0x8414('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x491e8=function(_0x31bb9a){return!_[_0x8414('0x7e')]([_0x8414('0x64'),'IS\x20NOT\x20NULL',_0x8414('0x66'),_0x8414('0x67')],_0x31bb9a);};var _0x5ab4b8=function(_0xd95612){if(!_0xd95612||!_0xd95612['rules']['length']){return'';}for(var _0x3a0ca1='(',_0x86d216=0x0;_0x86d216<_0xd95612[_0x8414('0x68')]['length'];_0x86d216+=0x1){_0x86d216>0x0&&(_0x3a0ca1+='\x20'+_0xd95612['operator']+'\x20');_0x3a0ca1+=_0xd95612['rules'][_0x86d216][_0x8414('0x69')]?_0x5ab4b8(_0xd95612[_0x8414('0x68')][_0x86d216]['group']):_0xd95612[_0x8414('0x68')][_0x86d216]['field']+'\x20'+_0xd95612[_0x8414('0x68')][_0x86d216][_0x8414('0x8c')]+(_0x491e8(_0xd95612['rules'][_0x86d216][_0x8414('0x8c')])?'\x20'+_0xd95612[_0x8414('0x68')][_0x86d216]['value']:'');}return _0x3a0ca1+')';};var _0x5294ec={'where':{'id':_0x4b4b36['id']}},_0x5d7409,_0x316bdb,_0x462525,_0x263cfe,_0x59b12f;_0x5294ec=_[_0x8414('0x4c')]({},_0x5294ec,_0x5e4303);return db['AnalyticCustomReport'][_0x8414('0x53')](_0x5294ec)[_0x8414('0x2b')](function(_0x3effc1){if(_0x3effc1){_0x5d7409=_0x3effc1;return _0x3effc1[_0x8414('0x6b')]();}return null;})[_0x8414('0x2b')](function(_0xb507f1){if(_0xb507f1){if(!_0xb507f1['length']){throw new db['Sequelize'][(_0x8414('0x8d'))](_0x8414('0x6d'),0x193);}_0x316bdb=_0xb507f1;return db[_0x8414('0x8e')]['findAll']({'raw':!![]});}return null;})[_0x8414('0x2b')](function(_0x5a7593){if(_0x5a7593){_0x462525=_['keyBy'](_0x5a7593,'id');var _0x2d3950;var _0x5eb2fa=squel['select']();_0x5eb2fa['from'](_0x5d7409['table']);for(var _0x14e69e=0x0;_0x14e69e<_0x316bdb[_0x8414('0x4b')];_0x14e69e+=0x1){_0x2d3950=_0x316bdb[_0x14e69e][_0x8414('0x72')]?_0x462525[_0x316bdb[_0x14e69e][_0x8414('0x72')]]['metric']:_0x316bdb[_0x14e69e][_0x8414('0x7a')];_0x2d3950=_0x316bdb[_0x14e69e][_0x8414('0x74')]?_[_0x8414('0x75')](_0x2ea3dc[_0x316bdb[_0x14e69e][_0x8414('0x74')]],'%s',_0x2d3950):_0x2d3950;_0x2d3950=_0x316bdb[_0x14e69e][_0x8414('0x76')]?_[_0x8414('0x75')](_0x1b920c[_0x316bdb[_0x14e69e][_0x8414('0x76')]],'%s',_0x2d3950):_0x2d3950;if(_0x316bdb[_0x14e69e][_0x8414('0x77')]){_0x5eb2fa[_0x8414('0x69')](_0x2d3950);}_0x316bdb[_0x14e69e][_0x8414('0x78')]&&_0x5eb2fa[_0x8414('0x3d')](_0x2d3950,_0x316bdb[_0x14e69e]['orderBy']===_0x8414('0x79')?![]:!![]);_0x5eb2fa[_0x8414('0x7a')](_0x2d3950,_0x316bdb[_0x14e69e]['alias']||_0x2d3950);}if(_0x5d7409[_0x8414('0x7c')]){_0x5d7409[_0x8414('0x7c')]=JSON['parse'](_0x5d7409[_0x8414('0x7c')]);for(var _0x51dd4d=0x0;_0x51dd4d<_0x5d7409['joins']['length'];_0x51dd4d+=0x1){if(_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x41')]&&_[_0x8414('0x7e')](_0x4c35b2,_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x41')])&&_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x7f')]&&_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x80')]&&_0x5d7409['joins'][_0x51dd4d][_0x8414('0x81')]){_0x5eb2fa[_0x5d7409['joins'][_0x51dd4d][_0x8414('0x41')]](_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x80')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5d7409['table'],_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x7f')],_0x5d7409[_0x8414('0x7c')][_0x51dd4d]['foreignTable'],_0x5d7409['joins'][_0x51dd4d][_0x8414('0x81')]));}}}if(_0x5d7409['conditions']){_0x5d7409[_0x8414('0x83')]=JSON[_0x8414('0x7d')](_0x5d7409['conditions']);_0x5eb2fa[_0x8414('0x3f')](_0x5ab4b8(_0x5d7409[_0x8414('0x83')]['group']));}_0x59b12f=_0x5eb2fa[_0x8414('0x8f')]();_0x5eb2fa[_0x8414('0x1c')](_0x30a451);_0x5eb2fa[_0x8414('0x1e')](0x0);return;}})[_0x8414('0x2b')](function(){if(_0x446c16['output']===_0x8414('0x90')){return null;}var _0x44fb4c=_[_0x8414('0x4c')](_0x446c16,{'name':_0x446c16[_0x8414('0x91')]||_0x446c16[_0x8414('0x2e')]||_0x5d7409[_0x8414('0x2e')],'basename':_0x22b1b6,'savename':util['format'](_0x8414('0x92'),_0x446c16['name']||_0x5d7409[_0x8414('0x2e')],require(_0x8414('0x93'))['generate'](0x4),_0x446c16[_0x8414('0x94')]||_0x8414('0x95')),'reportId':_0x5d7409['id'],'reportType':_0x8414('0x96')});return db[_0x8414('0x97')][_0x8414('0x4d')](_0x44fb4c,{'raw':!![]});})[_0x8414('0x2b')](function(_0x3b78cc){if(_0x5d7409['table']==='cdr'){_0x59b12f['where'](_0x5d7409[_0x8414('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x446c16[_0x8414('0x98')],_0x446c16[_0x8414('0x99')]);}else{_0x59b12f[_0x8414('0x3f')](_0x5d7409[_0x8414('0x71')]+_0x8414('0x9a'),_0x446c16[_0x8414('0x98')],_0x446c16[_0x8414('0x99')]);}if(_0x3b78cc){logger['info']('Run\x20Query:',_0x59b12f['toString']());require(_0x8414('0x9b'))[_0x8414('0x9c')](path[_0x8414('0x58')](__dirname,_0x8414('0x9d'),_0x3b78cc[_0x8414('0x94')]),[_0x3b78cc['id'],_0x59b12f[_0x8414('0x86')](),path['join'](__dirname,'../../files/reports',_0x3b78cc[_0x8414('0x9e')]),_0x22b1b6]);return _0x3b78cc;}else{var _0x4f65a8=squel['select']();_0x4f65a8[_0x8414('0x70')]('('+_0x59b12f[_0x8414('0x86')]()+')',_0x8414('0x9f'));_0x4f65a8[_0x8414('0x7a')](_0x8414('0xa0'),_0x8414('0x1f'));_0x59b12f[_0x8414('0x1c')](_0x446c16[_0x8414('0x1c')]||_0x30a451);_0x59b12f[_0x8414('0x1e')](_0x446c16[_0x8414('0x1e')]||0x0);return dbH[_0x8414('0x87')][_0x8414('0x37')](_0x4f65a8[_0x8414('0x86')](),{'type':dbH[_0x8414('0x87')][_0x8414('0xa1')][_0x8414('0x88')]})[_0x8414('0x2b')](function(_0x12e107){if(!_0x12e107[_0x8414('0x4b')]){_0x263cfe=0x0;}else{_0x263cfe=_0x12e107[0x0][_0x8414('0x1f')]||0x0;}return dbH[_0x8414('0x87')][_0x8414('0x37')](_0x59b12f[_0x8414('0x86')](),{'type':dbH['sequelize'][_0x8414('0xa1')][_0x8414('0x88')]});})[_0x8414('0x2b')](function(_0x196f76){return{'rows':_0x196f76||[],'count':_0x263cfe};});}});}exports['run']=function(_0x5971df,_0x9a77d5){return runReport(_0x5971df[_0x8414('0x49')],_0x5971df[_0x8414('0x37')],_0x5971df['options'])[_0x8414('0x2b')](respondWithResult(_0x9a77d5,null))[_0x8414('0x48')](handleError(_0x9a77d5,null));};exports[_0x8414('0xa2')]=runReport;exports[_0x8414('0x37')]=function(_0x3c8d61,_0x4e3642){var _0x3c6e2e=0xa;var _0x32553b=[_0x8414('0x58'),'left_join',_0x8414('0xa3'),'cross_join'];var _0xdeac3c={'SUM':'SUM(%s)','COUNT':_0x8414('0x5c'),'COUNT DISTINCT':_0x8414('0x89'),'MAX':_0x8414('0x5d'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8414('0x5f'),'GROUP_CONCAT ASC':_0x8414('0x60'),'GROUP_CONCAT DESC':_0x8414('0x61')};var _0x1549a9={'SEC_TO_TIME':_0x8414('0x8a'),'DATE':_0x8414('0x8b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8414('0xa4')};var _0x18b130=function(_0x43424f){return!_['includes']([_0x8414('0x64'),'IS\x20NOT\x20NULL',_0x8414('0x66'),_0x8414('0x67')],_0x43424f);};var _0x568f51=function(_0x5d05dd){if(!_0x5d05dd||!_0x5d05dd[_0x8414('0x68')]['length']){return'';}for(var _0x5ce81a='(',_0x2b9db2=0x0;_0x2b9db2<_0x5d05dd[_0x8414('0x68')][_0x8414('0x4b')];_0x2b9db2+=0x1){_0x2b9db2>0x0&&(_0x5ce81a+='\x20'+_0x5d05dd['operator']+'\x20');_0x5ce81a+=_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x69')]?_0x568f51(_0x5d05dd['rules'][_0x2b9db2][_0x8414('0x69')]):_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x7a')]+'\x20'+_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x8c')]+(_0x18b130(_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x8c')])?'\x20'+_0x5d05dd['rules'][_0x2b9db2][_0x8414('0x6a')]:'');}return _0x5ce81a+')';};var _0x214703={'where':{'id':_0x3c8d61[_0x8414('0x49')]['id']}},_0xc0c6e2,_0x4783c3,_0x1b046d,_0x8ef1a6,_0x4d7fc1;_0x214703=_[_0x8414('0x4c')]({},_0x214703,_0x3c8d61[_0x8414('0x43')]);return db[_0x8414('0x31')][_0x8414('0x53')](_0x214703)[_0x8414('0x2b')](function(_0x1c960b){if(_0x1c960b){_0xc0c6e2=_0x1c960b;return _0x1c960b[_0x8414('0x6b')]();}return null;})[_0x8414('0x2b')](function(_0x5f2345){if(_0x5f2345){if(!_0x5f2345[_0x8414('0x4b')]){throw new db[(_0x8414('0x6c'))][(_0x8414('0x8d'))](_0x8414('0x6d'),0x193);}_0x4783c3=_0x5f2345;return db['AnalyticMetric'][_0x8414('0x46')]({'raw':!![]});}return null;})[_0x8414('0x2b')](function(_0x3e835f){if(_0x3e835f){_0x1b046d=_[_0x8414('0x6e')](_0x3e835f,'id');var _0x185fe0;var _0x5d2c98=squel[_0x8414('0x6f')]();_0x5d2c98['from'](_0xc0c6e2[_0x8414('0x71')]);for(var _0x3f8f11=0x0;_0x3f8f11<_0x4783c3[_0x8414('0x4b')];_0x3f8f11+=0x1){_0x185fe0=_0x4783c3[_0x3f8f11][_0x8414('0x72')]?_0x1b046d[_0x4783c3[_0x3f8f11][_0x8414('0x72')]][_0x8414('0x73')]:_0x4783c3[_0x3f8f11][_0x8414('0x7a')];_0x185fe0=_0x4783c3[_0x3f8f11][_0x8414('0x74')]?_[_0x8414('0x75')](_0xdeac3c[_0x4783c3[_0x3f8f11]['function']],'%s',_0x185fe0):_0x185fe0;_0x185fe0=_0x4783c3[_0x3f8f11][_0x8414('0x76')]?_[_0x8414('0x75')](_0x1549a9[_0x4783c3[_0x3f8f11][_0x8414('0x76')]],'%s',_0x185fe0):_0x185fe0;if(_0x4783c3[_0x3f8f11][_0x8414('0x77')]){_0x5d2c98['group'](_0x185fe0);}_0x4783c3[_0x3f8f11]['orderBy']&&_0x5d2c98[_0x8414('0x3d')](_0x185fe0,_0x4783c3[_0x3f8f11][_0x8414('0x78')]===_0x8414('0x79')?![]:!![]);_0x5d2c98[_0x8414('0x7a')](_0x185fe0,_0x4783c3[_0x3f8f11]['alias']||_0x185fe0);}if(_0xc0c6e2[_0x8414('0x7c')]){_0xc0c6e2['joins']=JSON[_0x8414('0x7d')](_0xc0c6e2[_0x8414('0x7c')]);for(var _0x56ba71=0x0;_0x56ba71<_0xc0c6e2[_0x8414('0x7c')][_0x8414('0x4b')];_0x56ba71+=0x1){if(_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x41')]&&_['includes'](_0x32553b,_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x41')])&&_0xc0c6e2['joins'][_0x56ba71][_0x8414('0x7f')]&&_0xc0c6e2['joins'][_0x56ba71][_0x8414('0x80')]&&_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x81')]){_0x5d2c98[_0xc0c6e2[_0x8414('0x7c')][_0x56ba71]['type']](_0xc0c6e2['joins'][_0x56ba71][_0x8414('0x80')],null,util[_0x8414('0x76')]('%s.%s\x20=\x20%s.%s',_0xc0c6e2['table'],_0xc0c6e2[_0x8414('0x7c')][_0x56ba71]['parentKey'],_0xc0c6e2['joins'][_0x56ba71]['foreignTable'],_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x81')]));}}}if(_0xc0c6e2[_0x8414('0x83')]){_0xc0c6e2[_0x8414('0x83')]=JSON[_0x8414('0x7d')](_0xc0c6e2[_0x8414('0x83')]);_0x5d2c98[_0x8414('0x3f')](_0x568f51(_0xc0c6e2[_0x8414('0x83')][_0x8414('0x69')]));}_0x4d7fc1=_0x5d2c98[_0x8414('0x8f')]();_0x5d2c98['limit'](_0x3c6e2e);_0x5d2c98['offset'](0x0);logger['debug'](_0x8414('0x85'),_0x5d2c98['toString']());return dbH[_0x8414('0x87')][_0x8414('0x37')](_0x5d2c98['toString'](),{'type':dbH[_0x8414('0x87')][_0x8414('0xa1')][_0x8414('0x88')]});}})[_0x8414('0x2b')](function(){return{'sql':_0x4d7fc1[_0x8414('0x86')]()};})[_0x8414('0x2b')](respondWithResult(_0x4e3642,null))[_0x8414('0x48')](handleError(_0x4e3642,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3d2caa9..e87a342 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 _0x98c2=['request-promise','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5aaf48,_0x597553){var _0x7e9e64=function(_0x29ccbc){while(--_0x29ccbc){_0x5aaf48['push'](_0x5aaf48['shift']());}};_0x7e9e64(++_0x597553);}(_0x98c2,0x8b));var _0x298c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x98c2[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x298c('0x0'));var util=require('util');var logger=require(_0x298c('0x1'))(_0x298c('0x2'));var moment=require(_0x298c('0x3'));var BPromise=require(_0x298c('0x4'));var rp=require(_0x298c('0x5'));var fs=require('fs');var path=require(_0x298c('0x6'));var rimraf=require(_0x298c('0x7'));var config=require('../../config/environment');var attributes=require(_0x298c('0x8'));module[_0x298c('0x9')]=function(_0xf4d9ca,_0x1ae27f){return _0xf4d9ca['define'](_0x298c('0xa'),attributes,{'tableName':_0x298c('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ac5=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ac5,0x17b));var _0x58ac=function(_0x1b4245,_0x1a8f35){_0x1b4245=_0x1b4245-0x0;var _0x17ca9a=_0x8ac5[_0x1b4245];return _0x17ca9a;};'use strict';var _=require(_0x58ac('0x0'));var util=require(_0x58ac('0x1'));var logger=require(_0x58ac('0x2'))(_0x58ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ac('0x4'));var fs=require('fs');var path=require(_0x58ac('0x5'));var rimraf=require(_0x58ac('0x6'));var config=require(_0x58ac('0x7'));var attributes=require(_0x58ac('0x8'));module[_0x58ac('0x9')]=function(_0x22d06f,_0x4daeb1){return _0x22d06f[_0x58ac('0xa')](_0x58ac('0xb'),attributes,{'tableName':_0x58ac('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index be9e05c..1e058f7 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 _0xa23b=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ff82d,_0xa36a7){var _0x303127=function(_0x4a25ce){while(--_0x4a25ce){_0x2ff82d['push'](_0x2ff82d['shift']());}};_0x303127(++_0xa36a7);}(_0xa23b,0x150));var _0xba23=function(_0x4469e3,_0x3ee822){_0x4469e3=_0x4469e3-0x0;var _0x2cf73a=_0xa23b[_0x4469e3];return _0x2cf73a;};'use strict';var _=require(_0xba23('0x0'));var util=require('util');var moment=require(_0xba23('0x1'));var BPromise=require(_0xba23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba23('0x3'));var db=require(_0xba23('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba23('0x5'))(_0xba23('0x6'));var config=require(_0xba23('0x7'));var jayson=require(_0xba23('0x8'));var client=jayson[_0xba23('0x9')][_0xba23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a5eed,_0x1deb09,_0x3ca941){return new BPromise(function(_0x23ed0d,_0x20c3d5){return client[_0xba23('0xb')](_0x1a5eed,_0x3ca941)['then'](function(_0x2a2f51){logger[_0xba23('0xc')](_0xba23('0xd'),_0x1deb09,_0xba23('0xe'));logger[_0xba23('0xf')](_0xba23('0x10'),_0x1deb09,_0xba23('0xe'),JSON[_0xba23('0x11')](_0x2a2f51));if(_0x2a2f51['error']){if(_0x2a2f51[_0xba23('0x12')][_0xba23('0x13')]===0x1f4){logger[_0xba23('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1deb09,_0x2a2f51[_0xba23('0x12')]['message']);return _0x20c3d5(_0x2a2f51[_0xba23('0x12')][_0xba23('0x14')]);}logger['error'](_0xba23('0xd'),_0x1deb09,_0x2a2f51[_0xba23('0x12')]['message']);return _0x23ed0d(_0x2a2f51[_0xba23('0x12')][_0xba23('0x14')]);}else{logger[_0xba23('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1deb09,_0xba23('0xe'));_0x23ed0d(_0x2a2f51[_0xba23('0x15')]['message']);}})['catch'](function(_0x55186f){logger['error'](_0xba23('0xd'),_0x1deb09,_0x55186f);_0x20c3d5(_0x55186f);});});} \ No newline at end of file +var _0xbac9=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x1cb5e3,_0x12944e){var _0x5a32ad=function(_0x53857b){while(--_0x53857b){_0x1cb5e3['push'](_0x1cb5e3['shift']());}};_0x5a32ad(++_0x12944e);}(_0xbac9,0x121));var _0x9bac=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0xbac9[_0x25b4a4];return _0x707267;};'use strict';var _=require(_0x9bac('0x0'));var util=require(_0x9bac('0x1'));var moment=require(_0x9bac('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bac('0x4'))['db'];var utils=require(_0x9bac('0x5'));var logger=require(_0x9bac('0x6'))(_0x9bac('0x7'));var config=require(_0x9bac('0x8'));var jayson=require(_0x9bac('0x9'));var client=jayson[_0x9bac('0xa')][_0x9bac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b1149,_0x1137b0,_0x50e496){return new BPromise(function(_0x126691,_0x1f13d6){return client[_0x9bac('0xc')](_0x1b1149,_0x50e496)[_0x9bac('0xd')](function(_0x218f69){logger['info'](_0x9bac('0xe'),_0x1137b0,_0x9bac('0xf'));logger[_0x9bac('0x10')](_0x9bac('0x11'),_0x1137b0,_0x9bac('0xf'),JSON[_0x9bac('0x12')](_0x218f69));if(_0x218f69[_0x9bac('0x13')]){if(_0x218f69[_0x9bac('0x13')]['code']===0x1f4){logger[_0x9bac('0x13')](_0x9bac('0xe'),_0x1137b0,_0x218f69[_0x9bac('0x13')][_0x9bac('0x14')]);return _0x1f13d6(_0x218f69[_0x9bac('0x13')][_0x9bac('0x14')]);}logger[_0x9bac('0x13')](_0x9bac('0xe'),_0x1137b0,_0x218f69[_0x9bac('0x13')]['message']);return _0x126691(_0x218f69[_0x9bac('0x13')]['message']);}else{logger[_0x9bac('0x15')](_0x9bac('0xe'),_0x1137b0,_0x9bac('0xf'));_0x126691(_0x218f69[_0x9bac('0x16')][_0x9bac('0x14')]);}})[_0x9bac('0x17')](function(_0x38f526){logger[_0x9bac('0x13')](_0x9bac('0xe'),_0x1137b0,_0x38f526);_0x1f13d6(_0x38f526);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a2bbdb3..ab4c196 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 _0x0a7e=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','path'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0x0a7e,0x149));var _0xe0a7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0a7e[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe0a7('0x0'));var timeout=require(_0xe0a7('0x1'));var express=require('express');var router=express[_0xe0a7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe0a7('0x3'));var config=require(_0xe0a7('0x4'));var controller=require(_0xe0a7('0x5'));router[_0xe0a7('0x6')]('/',auth['isAuthenticated'](),controller[_0xe0a7('0x7')]);router[_0xe0a7('0x6')](_0xe0a7('0x8'),auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xa')]);router[_0xe0a7('0x6')](_0xe0a7('0xb'),auth[_0xe0a7('0x9')](),controller['preview']);router[_0xe0a7('0x6')](_0xe0a7('0xc'),auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xd')]);router[_0xe0a7('0x6')](_0xe0a7('0xe'),auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xf')]);router[_0xe0a7('0x10')]('/',auth[_0xe0a7('0x9')](),controller[_0xe0a7('0x11')]);router[_0xe0a7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe0a7('0x13')]);router['delete']('/:id',auth[_0xe0a7('0x9')](),controller[_0xe0a7('0x14')]);module[_0xe0a7('0x15')]=router; \ No newline at end of file +var _0x26d2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','/:id','update','destroy','exports'];(function(_0x2c9913,_0x541ece){var _0x12c13a=function(_0x35e281){while(--_0x35e281){_0x2c9913['push'](_0x2c9913['shift']());}};_0x12c13a(++_0x541ece);}(_0x26d2,0x180));var _0x226d=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x26d2[_0x4c445a];return _0x2f611c;};'use strict';var multer=require(_0x226d('0x0'));var util=require(_0x226d('0x1'));var path=require(_0x226d('0x2'));var timeout=require(_0x226d('0x3'));var express=require(_0x226d('0x4'));var router=express[_0x226d('0x5')]();var fs_extra=require(_0x226d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x226d('0x7'));var config=require(_0x226d('0x8'));var controller=require(_0x226d('0x9'));router[_0x226d('0xa')]('/',auth[_0x226d('0xb')](),controller['index']);router[_0x226d('0xa')]('/:id',auth[_0x226d('0xb')](),controller[_0x226d('0xc')]);router[_0x226d('0xa')](_0x226d('0xd'),auth[_0x226d('0xb')](),controller['preview']);router['get'](_0x226d('0xe'),auth[_0x226d('0xb')](),controller[_0x226d('0xf')]);router[_0x226d('0xa')](_0x226d('0x10'),auth['isAuthenticated'](),controller[_0x226d('0x11')]);router[_0x226d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x226d('0x13')](_0x226d('0x14'),auth['isAuthenticated'](),controller[_0x226d('0x15')]);router['delete'](_0x226d('0x14'),auth[_0x226d('0xb')](),controller[_0x226d('0x16')]);module[_0x226d('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 4aabcee..f730ee3 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0xfdbd[_0x368e09];return _0x14b7df;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0x71ab=['TEXT','exports','STRING'];(function(_0xb281ec,_0x8342fa){var _0x91ed4e=function(_0x12a9a9){while(--_0x12a9a9){_0xb281ec['push'](_0xb281ec['shift']());}};_0x91ed4e(++_0x8342fa);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index ad68d4b..e86a3aa 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x47d7aa,_0x1cde3f){var _0x4941fb=function(_0x19987a){while(--_0x19987a){_0x47d7aa['push'](_0x47d7aa['shift']());}};_0x4941fb(++_0x1cde3f);}(_0x31f0,0xb7));var _0x031f=function(_0x4f58a6,_0x58874d){_0x4f58a6=_0x4f58a6-0x0;var _0x982f87=_0x31f0[_0x4f58a6];return _0x982f87;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x26133e,_0x37f1d5){var _0x347b6a=function(_0x41eaeb){while(--_0x41eaeb){_0x26133e['push'](_0x26133e['shift']());}};_0x347b6a(++_0x37f1d5);}(_0x1261,0x144));var _0x1126=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x1261[_0x45ee03];return _0x13d535;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 6ba1fa6..91387dc 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 _0x7142=['bluebird','request-promise','rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7142,0xbb));var _0x2714=function(_0x5b8132,_0x242dce){_0x5b8132=_0x5b8132-0x0;var _0x3d84cc=_0x7142[_0x5b8132];return _0x3d84cc;};'use strict';var _=require('lodash');var util=require(_0x2714('0x0'));var logger=require(_0x2714('0x1'))('api');var moment=require(_0x2714('0x2'));var BPromise=require(_0x2714('0x3'));var rp=require(_0x2714('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2714('0x5'));var config=require('../../config/environment');var attributes=require(_0x2714('0x6'));module[_0x2714('0x7')]=function(_0x468600,_0x45f58d){return _0x468600['define'](_0x2714('0x8'),attributes,{'tableName':_0x2714('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41ce=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1195ed,_0x4d4af3){var _0x466010=function(_0x1c830f){while(--_0x1c830f){_0x1195ed['push'](_0x1195ed['shift']());}};_0x466010(++_0x4d4af3);}(_0x41ce,0x1ae));var _0xe41c=function(_0x430e31,_0x54d176){_0x430e31=_0x430e31-0x0;var _0x592dd1=_0x41ce[_0x430e31];return _0x592dd1;};'use strict';var _=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var logger=require(_0xe41c('0x2'))(_0xe41c('0x3'));var moment=require('moment');var BPromise=require(_0xe41c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe41c('0x5'));var rimraf=require(_0xe41c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xe41c('0x7')]=function(_0x816c0b,_0x3b0cb9){return _0x816c0b['define'](_0xe41c('0x8'),attributes,{'tableName':_0xe41c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 9841fa0..a7bc362 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 _0xbb83=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3d41ba,_0x4fce49){var _0x375cfd=function(_0x329929){while(--_0x329929){_0x3d41ba['push'](_0x3d41ba['shift']());}};_0x375cfd(++_0x4fce49);}(_0xbb83,0x17c));var _0x3bb8=function(_0xbeea1c,_0x541820){_0xbeea1c=_0xbeea1c-0x0;var _0x294011=_0xbb83[_0xbeea1c];return _0x294011;};'use strict';var _=require(_0x3bb8('0x0'));var util=require(_0x3bb8('0x1'));var moment=require(_0x3bb8('0x2'));var BPromise=require(_0x3bb8('0x3'));var rs=require(_0x3bb8('0x4'));var fs=require('fs');var Redis=require(_0x3bb8('0x5'));var db=require(_0x3bb8('0x6'))['db'];var utils=require(_0x3bb8('0x7'));var logger=require(_0x3bb8('0x8'))(_0x3bb8('0x9'));var config=require(_0x3bb8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3bb8('0xb')][_0x3bb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x380885,_0x16f226,_0x2c5c01){return new BPromise(function(_0xc2c0b,_0x20a51c){return client[_0x3bb8('0xd')](_0x380885,_0x2c5c01)[_0x3bb8('0xe')](function(_0x2fd999){logger[_0x3bb8('0xf')](_0x3bb8('0x10'),_0x16f226,_0x3bb8('0x11'));logger['debug'](_0x3bb8('0x12'),_0x16f226,_0x3bb8('0x11'),JSON['stringify'](_0x2fd999));if(_0x2fd999[_0x3bb8('0x13')]){if(_0x2fd999[_0x3bb8('0x13')][_0x3bb8('0x14')]===0x1f4){logger[_0x3bb8('0x13')](_0x3bb8('0x10'),_0x16f226,_0x2fd999[_0x3bb8('0x13')][_0x3bb8('0x15')]);return _0x20a51c(_0x2fd999[_0x3bb8('0x13')][_0x3bb8('0x15')]);}logger[_0x3bb8('0x13')](_0x3bb8('0x10'),_0x16f226,_0x2fd999['error']['message']);return _0xc2c0b(_0x2fd999[_0x3bb8('0x13')]['message']);}else{logger[_0x3bb8('0xf')](_0x3bb8('0x10'),_0x16f226,_0x3bb8('0x11'));_0xc2c0b(_0x2fd999[_0x3bb8('0x16')][_0x3bb8('0x15')]);}})[_0x3bb8('0x17')](function(_0x30c992){logger[_0x3bb8('0x13')](_0x3bb8('0x10'),_0x16f226,_0x30c992);_0x20a51c(_0x30c992);});});} \ No newline at end of file +var _0xe214=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x2deaf8,_0x27b02a){var _0x2f9dad=function(_0x4b42ba){while(--_0x4b42ba){_0x2deaf8['push'](_0x2deaf8['shift']());}};_0x2f9dad(++_0x27b02a);}(_0xe214,0x131));var _0x4e21=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe214[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4e21('0x0'));var util=require(_0x4e21('0x1'));var moment=require(_0x4e21('0x2'));var BPromise=require(_0x4e21('0x3'));var rs=require(_0x4e21('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e21('0x5'));var logger=require(_0x4e21('0x6'))(_0x4e21('0x7'));var config=require(_0x4e21('0x8'));var jayson=require(_0x4e21('0x9'));var client=jayson[_0x4e21('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3ddd,_0x31508f,_0x4ae216){return new BPromise(function(_0x310db2,_0x2b033c){return client[_0x4e21('0xb')](_0x1b3ddd,_0x4ae216)[_0x4e21('0xc')](function(_0x3af735){logger[_0x4e21('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,'request\x20sent');logger['debug'](_0x4e21('0xe'),_0x31508f,_0x4e21('0xf'),JSON[_0x4e21('0x10')](_0x3af735));if(_0x3af735[_0x4e21('0x11')]){if(_0x3af735[_0x4e21('0x11')][_0x4e21('0x12')]===0x1f4){logger[_0x4e21('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,_0x3af735[_0x4e21('0x11')][_0x4e21('0x13')]);return _0x2b033c(_0x3af735[_0x4e21('0x11')][_0x4e21('0x13')]);}logger[_0x4e21('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,_0x3af735[_0x4e21('0x11')]['message']);return _0x310db2(_0x3af735[_0x4e21('0x11')][_0x4e21('0x13')]);}else{logger[_0x4e21('0xd')](_0x4e21('0x14'),_0x31508f,_0x4e21('0xf'));_0x310db2(_0x3af735['result'][_0x4e21('0x13')]);}})[_0x4e21('0x15')](function(_0x5a8ff9){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,_0x5a8ff9);_0x2b033c(_0x5a8ff9);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 8663f93..a90995c 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 _0xebba=['index','get','/:id','isAuthenticated','preview','/:id/run','run','/:id/query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./analyticDefaultReport.controller'];(function(_0x5bfedc,_0x24a222){var _0x3b041c=function(_0x467ad2){while(--_0x467ad2){_0x5bfedc['push'](_0x5bfedc['shift']());}};_0x3b041c(++_0x24a222);}(_0xebba,0x1b2));var _0xaebb=function(_0x3cb957,_0xaddd8a){_0x3cb957=_0x3cb957-0x0;var _0xf51734=_0xebba[_0x3cb957];return _0xf51734;};'use strict';var multer=require('multer');var util=require(_0xaebb('0x0'));var path=require(_0xaebb('0x1'));var timeout=require(_0xaebb('0x2'));var express=require(_0xaebb('0x3'));var router=express[_0xaebb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaebb('0x5'));var controller=require(_0xaebb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xaebb('0x7')]);router[_0xaebb('0x8')](_0xaebb('0x9'),auth[_0xaebb('0xa')](),controller['show']);router['get']('/:id/preview',auth[_0xaebb('0xa')](),controller[_0xaebb('0xb')]);router[_0xaebb('0x8')](_0xaebb('0xc'),auth['isAuthenticated'](),controller[_0xaebb('0xd')]);router[_0xaebb('0x8')](_0xaebb('0xe'),auth['isAuthenticated'](),controller['query']);router[_0xaebb('0xf')]('/',auth[_0xaebb('0xa')](),controller[_0xaebb('0x10')]);router[_0xaebb('0x11')]('/:id',auth[_0xaebb('0xa')](),controller['update']);router[_0xaebb('0x12')](_0xaebb('0x9'),auth['isAuthenticated'](),controller[_0xaebb('0x13')]);module[_0xaebb('0x14')]=router; \ No newline at end of file +var _0x6851=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','show','/:id/preview','preview','run','/:id/query','query','put','/:id','update','delete','destroy','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6851,0x1a2));var _0x1685=function(_0x408d13,_0x294bd0){_0x408d13=_0x408d13-0x0;var _0x260a99=_0x6851[_0x408d13];return _0x260a99;};'use strict';var multer=require('multer');var util=require(_0x1685('0x0'));var path=require(_0x1685('0x1'));var timeout=require('connect-timeout');var express=require(_0x1685('0x2'));var router=express['Router']();var fs_extra=require(_0x1685('0x3'));var auth=require(_0x1685('0x4'));var interaction=require(_0x1685('0x5'));var config=require(_0x1685('0x6'));var controller=require(_0x1685('0x7'));router['get']('/',auth[_0x1685('0x8')](),controller['index']);router[_0x1685('0x9')]('/:id',auth[_0x1685('0x8')](),controller[_0x1685('0xa')]);router[_0x1685('0x9')](_0x1685('0xb'),auth[_0x1685('0x8')](),controller[_0x1685('0xc')]);router[_0x1685('0x9')]('/:id/run',auth[_0x1685('0x8')](),controller[_0x1685('0xd')]);router['get'](_0x1685('0xe'),auth['isAuthenticated'](),controller[_0x1685('0xf')]);router['post']('/',auth[_0x1685('0x8')](),controller['create']);router[_0x1685('0x10')](_0x1685('0x11'),auth[_0x1685('0x8')](),controller[_0x1685('0x12')]);router[_0x1685('0x13')]('/:id',auth[_0x1685('0x8')](),controller[_0x1685('0x14')]);module[_0x1685('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 f553c51..b0f327e 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 _0x1748=['exports','STRING','ENUM','csv','pdf','Loading','manual','INTEGER','sequelize','moment'];(function(_0x43b1f3,_0x3840cd){var _0x4bd021=function(_0x2c06c0){while(--_0x2c06c0){_0x43b1f3['push'](_0x43b1f3['shift']());}};_0x4bd021(++_0x3840cd);}(_0x1748,0xc6));var _0x8174=function(_0x52008d,_0x12b374){_0x52008d=_0x52008d-0x0;var _0x2058bf=_0x1748[_0x52008d];return _0x2058bf;};'use strict';var Sequelize=require(_0x8174('0x0'));var moment=require(_0x8174('0x1'));module[_0x8174('0x2')]={'name':{'type':Sequelize[_0x8174('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8174('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8174('0x4')](_0x8174('0x5'),_0x8174('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x8174('0x5')},'savename':{'type':Sequelize[_0x8174('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8174('0x3')],'defaultValue':_0x8174('0x7')},'type':{'type':Sequelize['ENUM'](_0x8174('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x8174('0x8')},'reportId':{'type':Sequelize[_0x8174('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8174('0x3')]}}; \ No newline at end of file +var _0x0c2a=['xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0xd81ba,_0x3f8c8a){var _0x13459c=function(_0x5e0821){while(--_0x5e0821){_0xd81ba['push'](_0xd81ba['shift']());}};_0x13459c(++_0x3f8c8a);}(_0x0c2a,0x1a6));var _0xa0c2=function(_0x3945b8,_0x4c5537){_0x3945b8=_0x3945b8-0x0;var _0x29acdb=_0x0c2a[_0x3945b8];return _0x29acdb;};'use strict';var Sequelize=require(_0xa0c2('0x0'));var moment=require(_0xa0c2('0x1'));module[_0xa0c2('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xa0c2('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa0c2('0x4')](_0xa0c2('0x5'),_0xa0c2('0x6'),_0xa0c2('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xa0c2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa0c2('0x8')]},'endDate':{'type':Sequelize[_0xa0c2('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xa0c2('0x9')},'type':{'type':Sequelize['ENUM'](_0xa0c2('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xa0c2('0xa')},'reportId':{'type':Sequelize[_0xa0c2('0xb')](0xb)[_0xa0c2('0xc')]},'reportType':{'type':Sequelize[_0xa0c2('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1a3b2ca..fd77d46 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 _0x6f69=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','basename','savename','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f69,0x16e));var _0x96f6=function(_0x424466,_0x31297b){_0x424466=_0x424466-0x0;var _0x9f0e18=_0x6f69[_0x424466];return _0x9f0e18;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96f6('0x1'));var jsonpatch=require(_0x96f6('0x2'));var rp=require(_0x96f6('0x3'));var moment=require('moment');var BPromise=require(_0x96f6('0x4'));var Mustache=require(_0x96f6('0x5'));var util=require(_0x96f6('0x6'));var path=require(_0x96f6('0x7'));var sox=require('sox');var csv=require(_0x96f6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f6('0x9'));var _=require(_0x96f6('0xa'));var squel=require('squel');var crypto=require(_0x96f6('0xb'));var jsforce=require(_0x96f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96f6('0xd'));var Redis=require('ioredis');var authService=require(_0x96f6('0xe'));var qs=require(_0x96f6('0xf'));var as=require(_0x96f6('0x10'));var hardwareService=require(_0x96f6('0x11'));var logger=require('../../config/logger')(_0x96f6('0x12'));var utils=require(_0x96f6('0x13'));var config=require(_0x96f6('0x14'));var licenseUtil=require(_0x96f6('0x15'));var db=require(_0x96f6('0x16'))['db'];function respondWithStatusCode(_0x4279f9,_0x5d000f){_0x5d000f=_0x5d000f||0xcc;return function(_0x16f993){if(_0x16f993){return _0x4279f9['sendStatus'](_0x5d000f);}return _0x4279f9[_0x96f6('0x17')](_0x5d000f)['end']();};}function respondWithResult(_0x29b734,_0x4f59d8){_0x4f59d8=_0x4f59d8||0xc8;return function(_0x32ddc4){if(_0x32ddc4){return _0x29b734[_0x96f6('0x17')](_0x4f59d8)[_0x96f6('0x18')](_0x32ddc4);}};}function respondWithFilteredResult(_0x56e99f,_0x5a67f9){return function(_0x208fd6){if(_0x208fd6){var _0x153aab=typeof _0x5a67f9[_0x96f6('0x19')]===_0x96f6('0x1a')&&typeof _0x5a67f9[_0x96f6('0x1b')]===_0x96f6('0x1a');var _0x51e19c=_0x208fd6[_0x96f6('0x1c')];var _0x3d038f=_0x153aab?0x0:_0x5a67f9['offset'];var _0xc97afa=_0x153aab?_0x208fd6[_0x96f6('0x1c')]:_0x5a67f9[_0x96f6('0x19')]+_0x5a67f9[_0x96f6('0x1b')];var _0x1f6cf4;if(_0xc97afa>=_0x51e19c){_0xc97afa=_0x51e19c;_0x1f6cf4=0xc8;}else{_0x1f6cf4=0xce;}_0x56e99f[_0x96f6('0x17')](_0x1f6cf4);return _0x56e99f[_0x96f6('0x1d')](_0x96f6('0x1e'),_0x3d038f+'-'+_0xc97afa+'/'+_0x51e19c)['json'](_0x208fd6);}return null;};}function patchUpdates(_0x2b91cc){return function(_0x189617){try{jsonpatch[_0x96f6('0x1f')](_0x189617,_0x2b91cc,!![]);}catch(_0x331a64){return BPromise[_0x96f6('0x20')](_0x331a64);}return _0x189617['save']();};}function saveUpdates(_0x59017d,_0xae1d94){return function(_0x5b2ac1){if(_0x5b2ac1){return _0x5b2ac1[_0x96f6('0x21')](_0x59017d)[_0x96f6('0x22')](function(_0x500063){return _0x500063;});}return null;};}function removeEntity(_0x50cd4d,_0x2de468){return function(_0x4c3d97){if(_0x4c3d97){return _0x4c3d97[_0x96f6('0x23')]()[_0x96f6('0x22')](function(){var _0x2b2e63=_0x4c3d97[_0x96f6('0x24')]({'plain':!![]});var _0x1821e5=_0x96f6('0x25');return db[_0x96f6('0x26')][_0x96f6('0x23')]({'where':{'type':_0x1821e5,'resourceId':_0x2b2e63['id']}})[_0x96f6('0x22')](function(){return _0x4c3d97;});})[_0x96f6('0x22')](function(){_0x50cd4d[_0x96f6('0x17')](0xcc)[_0x96f6('0x27')]();});}};}function handleEntityNotFound(_0x26f3e9,_0x58498c){return function(_0x54fe91){if(!_0x54fe91){_0x26f3e9[_0x96f6('0x28')](0x194);}return _0x54fe91;};}function handleError(_0x272078,_0x480ac7){_0x480ac7=_0x480ac7||0x1f4;return function(_0x3b5d3b){logger[_0x96f6('0x29')](_0x3b5d3b[_0x96f6('0x2a')]);if(_0x3b5d3b['name']){delete _0x3b5d3b[_0x96f6('0x2b')];}_0x272078['status'](_0x480ac7)[_0x96f6('0x2c')](_0x3b5d3b);};}exports[_0x96f6('0x2d')]=function(_0x325f3f,_0x46d506){var _0x181435={},_0x2b5e70={},_0x1b9898={'count':0x0,'rows':[]};var _0x20eed4=_[_0x96f6('0x2e')](db[_0x96f6('0x2f')][_0x96f6('0x30')],function(_0x490112){return{'name':_0x490112[_0x96f6('0x31')],'type':_0x490112['type'][_0x96f6('0x32')]};});_0x2b5e70[_0x96f6('0x33')]=_[_0x96f6('0x2e')](_0x20eed4,_0x96f6('0x2b'));_0x2b5e70[_0x96f6('0x34')]=_['keys'](_0x325f3f[_0x96f6('0x34')]);_0x2b5e70['filters']=_[_0x96f6('0x35')](_0x2b5e70[_0x96f6('0x33')],_0x2b5e70['query']);_0x181435['attributes']=_[_0x96f6('0x35')](_0x2b5e70[_0x96f6('0x33')],qs[_0x96f6('0x36')](_0x325f3f['query'][_0x96f6('0x36')]));_0x181435[_0x96f6('0x37')]=_0x181435[_0x96f6('0x37')][_0x96f6('0x38')]?_0x181435[_0x96f6('0x37')]:_0x2b5e70[_0x96f6('0x33')];if(!_0x325f3f[_0x96f6('0x34')][_0x96f6('0x39')]('nolimit')){_0x181435[_0x96f6('0x1b')]=qs[_0x96f6('0x1b')](_0x325f3f[_0x96f6('0x34')]['limit']);_0x181435[_0x96f6('0x19')]=qs['offset'](_0x325f3f[_0x96f6('0x34')][_0x96f6('0x19')]);}_0x181435[_0x96f6('0x3a')]=qs[_0x96f6('0x3b')](_0x325f3f[_0x96f6('0x34')][_0x96f6('0x3b')]);_0x181435[_0x96f6('0x3c')]=qs['filters'](_[_0x96f6('0x3d')](_0x325f3f[_0x96f6('0x34')],_0x2b5e70[_0x96f6('0x3e')]),_0x20eed4);if(_0x325f3f[_0x96f6('0x34')][_0x96f6('0x3f')]){_0x181435[_0x96f6('0x3c')]=_[_0x96f6('0x40')](_0x181435['where'],{'$or':_[_0x96f6('0x2e')](_0x20eed4,function(_0xd530dd){if(_0xd530dd[_0x96f6('0x41')]!==_0x96f6('0x42')){var _0x3be25b={};_0x3be25b[_0xd530dd[_0x96f6('0x2b')]]={'$like':'%'+_0x325f3f[_0x96f6('0x34')][_0x96f6('0x3f')]+'%'};return _0x3be25b;}})});}_0x181435=_[_0x96f6('0x40')]({},_0x181435,_0x325f3f[_0x96f6('0x43')]);var _0x598f1f={'where':_0x181435['where']};return db['AnalyticExtractedReport'][_0x96f6('0x1c')](_0x598f1f)[_0x96f6('0x22')](function(_0x13d288){_0x1b9898['count']=_0x13d288;if(_0x325f3f[_0x96f6('0x34')][_0x96f6('0x44')]){_0x181435[_0x96f6('0x45')]=[{'all':!![]}];}return db[_0x96f6('0x2f')][_0x96f6('0x46')](_0x181435);})['then'](function(_0x47f19b){_0x1b9898[_0x96f6('0x47')]=_0x47f19b;return _0x1b9898;})[_0x96f6('0x22')](respondWithFilteredResult(_0x46d506,_0x181435))[_0x96f6('0x48')](handleError(_0x46d506,null));};exports['show']=function(_0x4588ee,_0x18ecda){var _0x2da745={'raw':!![],'where':{'id':_0x4588ee['params']['id']}},_0x4ab955={};_0x4ab955[_0x96f6('0x33')]=_['keys'](db[_0x96f6('0x2f')][_0x96f6('0x30')]);_0x4ab955[_0x96f6('0x34')]=_[_0x96f6('0x49')](_0x4588ee[_0x96f6('0x34')]);_0x4ab955[_0x96f6('0x3e')]=_['intersection'](_0x4ab955[_0x96f6('0x33')],_0x4ab955[_0x96f6('0x34')]);_0x2da745[_0x96f6('0x37')]=_[_0x96f6('0x35')](_0x4ab955[_0x96f6('0x33')],qs[_0x96f6('0x36')](_0x4588ee[_0x96f6('0x34')]['fields']));_0x2da745[_0x96f6('0x37')]=_0x2da745[_0x96f6('0x37')][_0x96f6('0x38')]?_0x2da745['attributes']:_0x4ab955[_0x96f6('0x33')];if(_0x4588ee[_0x96f6('0x34')][_0x96f6('0x44')]){_0x2da745[_0x96f6('0x45')]=[{'all':!![]}];}_0x2da745=_[_0x96f6('0x40')]({},_0x2da745,_0x4588ee['options']);return db['AnalyticExtractedReport'][_0x96f6('0x4a')](_0x2da745)[_0x96f6('0x22')](handleEntityNotFound(_0x18ecda,null))['then'](respondWithResult(_0x18ecda,null))[_0x96f6('0x48')](handleError(_0x18ecda,null));};exports[_0x96f6('0x4b')]=function(_0x9dee7e,_0x37d26c){return db['AnalyticExtractedReport'][_0x96f6('0x4b')](_0x9dee7e['body'],{})[_0x96f6('0x22')](function(_0x44b225){var _0x533dff=_0x9dee7e[_0x96f6('0x4c')][_0x96f6('0x24')]({'plain':!![]});if(!_0x533dff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x533dff['role']===_0x96f6('0x4c')){var _0x238c12=_0x44b225[_0x96f6('0x24')]({'plain':!![]});var _0x388dac='ExtractedReports';return db[_0x96f6('0x4d')]['find']({'where':{'name':_0x388dac,'userProfileId':_0x533dff[_0x96f6('0x4e')]},'raw':!![]})[_0x96f6('0x22')](function(_0x369a83){if(_0x369a83&&_0x369a83['autoAssociation']===0x0){return db['UserProfileResource'][_0x96f6('0x4b')]({'name':_0x238c12[_0x96f6('0x2b')],'resourceId':_0x238c12['id'],'type':_0x369a83[_0x96f6('0x2b')],'sectionId':_0x369a83['id']},{})['then'](function(){return _0x44b225;});}else{return _0x44b225;}})[_0x96f6('0x48')](function(_0x435495){logger[_0x96f6('0x29')](_0x96f6('0x4f'),_0x435495);throw _0x435495;});}return _0x44b225;})[_0x96f6('0x22')](respondWithResult(_0x37d26c,0xc9))[_0x96f6('0x48')](handleError(_0x37d26c,null));};exports[_0x96f6('0x21')]=function(_0x3aa64f,_0xb35f17){if(_0x3aa64f['body']['id']){delete _0x3aa64f['body']['id'];}return db[_0x96f6('0x2f')][_0x96f6('0x4a')]({'where':{'id':_0x3aa64f[_0x96f6('0x50')]['id']}})[_0x96f6('0x22')](handleEntityNotFound(_0xb35f17,null))[_0x96f6('0x22')](saveUpdates(_0x3aa64f[_0x96f6('0x51')],null))['then'](respondWithResult(_0xb35f17,null))[_0x96f6('0x48')](handleError(_0xb35f17,null));};exports[_0x96f6('0x23')]=function(_0xd5a624,_0x2e7bfb){return db[_0x96f6('0x2f')][_0x96f6('0x4a')]({'where':{'id':_0xd5a624[_0x96f6('0x50')]['id']}})[_0x96f6('0x22')](handleEntityNotFound(_0x2e7bfb,null))[_0x96f6('0x22')](removeEntity(_0x2e7bfb,null))[_0x96f6('0x48')](handleError(_0x2e7bfb,null));};exports['download']=function(_0x2b69a2,_0x3e8e3d,_0x5ae554){return db[_0x96f6('0x2f')][_0x96f6('0x4a')]({'where':{'id':_0x2b69a2[_0x96f6('0x50')]['id']},'attributes':[_0x96f6('0x2b'),_0x96f6('0x52'),_0x96f6('0x53'),'output'],'raw':!![]})[_0x96f6('0x22')](handleEntityNotFound(_0x3e8e3d,null))[_0x96f6('0x22')](function(_0x5cd8d2){if(_0x5cd8d2){if(!fs[_0x96f6('0x54')](path[_0x96f6('0x55')](config[_0x96f6('0x56')],_0x96f6('0x57'),_0x5cd8d2[_0x96f6('0x53')]))){throw new db['Sequelize'][(_0x96f6('0x58'))](_0x96f6('0x59'));}if(_0x2b69a2['query'][_0x96f6('0x5a')]){return _0x3e8e3d['sendStatus'](0xc8);}return _0x3e8e3d[_0x96f6('0x5b')](path['join'](config[_0x96f6('0x56')],'server/files/reports',_0x5cd8d2[_0x96f6('0x53')]),util['format'](_0x96f6('0x5c'),_0x5cd8d2[_0x96f6('0x52')]||_0x5cd8d2[_0x96f6('0x2b')],_0x5cd8d2[_0x96f6('0x5d')][_0x96f6('0x5e')]()));}})[_0x96f6('0x48')](handleError(_0x3e8e3d,null));}; \ No newline at end of file +var _0x665a=['catch','download','savename','output','existsSync','join','root','server/files/reports','ValidationError','sendStatus','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','limit','offset','count','status','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x665a,0x192));var _0xa665=function(_0x3bb966,_0x12f2ce){_0x3bb966=_0x3bb966-0x0;var _0xa1257d=_0x665a[_0x3bb966];return _0xa1257d;};'use strict';var emlformat=require(_0xa665('0x0'));var rimraf=require(_0xa665('0x1'));var zipdir=require(_0xa665('0x2'));var jsonpatch=require(_0xa665('0x3'));var rp=require(_0xa665('0x4'));var moment=require(_0xa665('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa665('0x6'));var util=require(_0xa665('0x7'));var path=require(_0xa665('0x8'));var sox=require(_0xa665('0x9'));var csv=require(_0xa665('0xa'));var ejs=require(_0xa665('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa665('0xc'));var squel=require(_0xa665('0xd'));var crypto=require(_0xa665('0xe'));var jsforce=require(_0xa665('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa665('0xa'));var querystring=require(_0xa665('0x10'));var Papa=require(_0xa665('0x11'));var Redis=require(_0xa665('0x12'));var authService=require(_0xa665('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa665('0x14'));var logger=require(_0xa665('0x15'))(_0xa665('0x16'));var utils=require(_0xa665('0x17'));var config=require(_0xa665('0x18'));var licenseUtil=require(_0xa665('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb487e2,_0x26aedb){_0x26aedb=_0x26aedb||0xcc;return function(_0x3bb993){if(_0x3bb993){return _0xb487e2['sendStatus'](_0x26aedb);}return _0xb487e2['status'](_0x26aedb)[_0xa665('0x1a')]();};}function respondWithResult(_0x2fb156,_0x54e0f1){_0x54e0f1=_0x54e0f1||0xc8;return function(_0xf78ed3){if(_0xf78ed3){return _0x2fb156['status'](_0x54e0f1)[_0xa665('0x1b')](_0xf78ed3);}};}function respondWithFilteredResult(_0x3f2124,_0x471b42){return function(_0x375ff2){if(_0x375ff2){var _0x29df7b=typeof _0x471b42['offset']===_0xa665('0x1c')&&typeof _0x471b42[_0xa665('0x1d')]===_0xa665('0x1c');var _0x48e36c=_0x375ff2['count'];var _0x34e7a9=_0x29df7b?0x0:_0x471b42[_0xa665('0x1e')];var _0xaccf6e=_0x29df7b?_0x375ff2[_0xa665('0x1f')]:_0x471b42[_0xa665('0x1e')]+_0x471b42[_0xa665('0x1d')];var _0x24a171;if(_0xaccf6e>=_0x48e36c){_0xaccf6e=_0x48e36c;_0x24a171=0xc8;}else{_0x24a171=0xce;}_0x3f2124[_0xa665('0x20')](_0x24a171);return _0x3f2124[_0xa665('0x21')]('Content-Range',_0x34e7a9+'-'+_0xaccf6e+'/'+_0x48e36c)['json'](_0x375ff2);}return null;};}function patchUpdates(_0x4ff19b){return function(_0x4b54df){try{jsonpatch[_0xa665('0x22')](_0x4b54df,_0x4ff19b,!![]);}catch(_0xc5aa17){return BPromise['reject'](_0xc5aa17);}return _0x4b54df[_0xa665('0x23')]();};}function saveUpdates(_0x4a4383,_0x55780e){return function(_0x547ec8){if(_0x547ec8){return _0x547ec8[_0xa665('0x24')](_0x4a4383)[_0xa665('0x25')](function(_0x1daba5){return _0x1daba5;});}return null;};}function removeEntity(_0xade328,_0x5d3a3e){return function(_0x51c474){if(_0x51c474){return _0x51c474[_0xa665('0x26')]()[_0xa665('0x25')](function(){var _0x15d668=_0x51c474['get']({'plain':!![]});var _0x46018b=_0xa665('0x27');return db[_0xa665('0x28')][_0xa665('0x26')]({'where':{'type':_0x46018b,'resourceId':_0x15d668['id']}})[_0xa665('0x25')](function(){return _0x51c474;});})[_0xa665('0x25')](function(){_0xade328[_0xa665('0x20')](0xcc)[_0xa665('0x1a')]();});}};}function handleEntityNotFound(_0xa39eec,_0x2effad){return function(_0x23743e){if(!_0x23743e){_0xa39eec['sendStatus'](0x194);}return _0x23743e;};}function handleError(_0x5a9345,_0x544fc2){_0x544fc2=_0x544fc2||0x1f4;return function(_0x5371cf){logger[_0xa665('0x29')](_0x5371cf[_0xa665('0x2a')]);if(_0x5371cf[_0xa665('0x2b')]){delete _0x5371cf[_0xa665('0x2b')];}_0x5a9345['status'](_0x544fc2)[_0xa665('0x2c')](_0x5371cf);};}exports[_0xa665('0x2d')]=function(_0x15a3bf,_0x5b754b){var _0x1f6e6f={},_0x2bfbdb={},_0x56049f={'count':0x0,'rows':[]};var _0xe350a9=_[_0xa665('0x2e')](db[_0xa665('0x2f')]['rawAttributes'],function(_0x18ff99){return{'name':_0x18ff99[_0xa665('0x30')],'type':_0x18ff99[_0xa665('0x31')][_0xa665('0x32')]};});_0x2bfbdb['model']=_[_0xa665('0x2e')](_0xe350a9,_0xa665('0x2b'));_0x2bfbdb[_0xa665('0x33')]=_[_0xa665('0x34')](_0x15a3bf[_0xa665('0x33')]);_0x2bfbdb[_0xa665('0x35')]=_[_0xa665('0x36')](_0x2bfbdb[_0xa665('0x37')],_0x2bfbdb[_0xa665('0x33')]);_0x1f6e6f[_0xa665('0x38')]=_[_0xa665('0x36')](_0x2bfbdb[_0xa665('0x37')],qs['fields'](_0x15a3bf[_0xa665('0x33')][_0xa665('0x39')]));_0x1f6e6f[_0xa665('0x38')]=_0x1f6e6f[_0xa665('0x38')][_0xa665('0x3a')]?_0x1f6e6f[_0xa665('0x38')]:_0x2bfbdb[_0xa665('0x37')];if(!_0x15a3bf[_0xa665('0x33')][_0xa665('0x3b')]('nolimit')){_0x1f6e6f[_0xa665('0x1d')]=qs['limit'](_0x15a3bf['query']['limit']);_0x1f6e6f['offset']=qs['offset'](_0x15a3bf[_0xa665('0x33')][_0xa665('0x1e')]);}_0x1f6e6f[_0xa665('0x3c')]=qs[_0xa665('0x3d')](_0x15a3bf[_0xa665('0x33')]['sort']);_0x1f6e6f[_0xa665('0x3e')]=qs['filters'](_['pick'](_0x15a3bf[_0xa665('0x33')],_0x2bfbdb[_0xa665('0x35')]),_0xe350a9);if(_0x15a3bf['query'][_0xa665('0x3f')]){_0x1f6e6f[_0xa665('0x3e')]=_[_0xa665('0x40')](_0x1f6e6f[_0xa665('0x3e')],{'$or':_[_0xa665('0x2e')](_0xe350a9,function(_0x4a6e30){if(_0x4a6e30[_0xa665('0x31')]!==_0xa665('0x41')){var _0x444013={};_0x444013[_0x4a6e30[_0xa665('0x2b')]]={'$like':'%'+_0x15a3bf['query'][_0xa665('0x3f')]+'%'};return _0x444013;}})});}_0x1f6e6f=_[_0xa665('0x40')]({},_0x1f6e6f,_0x15a3bf[_0xa665('0x42')]);var _0x1651ac={'where':_0x1f6e6f['where']};return db['AnalyticExtractedReport'][_0xa665('0x1f')](_0x1651ac)[_0xa665('0x25')](function(_0x58cb78){_0x56049f[_0xa665('0x1f')]=_0x58cb78;if(_0x15a3bf[_0xa665('0x33')]['includeAll']){_0x1f6e6f[_0xa665('0x43')]=[{'all':!![]}];}return db[_0xa665('0x2f')][_0xa665('0x44')](_0x1f6e6f);})[_0xa665('0x25')](function(_0x1903bc){_0x56049f[_0xa665('0x45')]=_0x1903bc;return _0x56049f;})[_0xa665('0x25')](respondWithFilteredResult(_0x5b754b,_0x1f6e6f))['catch'](handleError(_0x5b754b,null));};exports[_0xa665('0x46')]=function(_0x6cb437,_0x27f36e){var _0x1047a9={'raw':!![],'where':{'id':_0x6cb437[_0xa665('0x47')]['id']}},_0x15a340={};_0x15a340[_0xa665('0x37')]=_['keys'](db['AnalyticExtractedReport'][_0xa665('0x48')]);_0x15a340[_0xa665('0x33')]=_[_0xa665('0x34')](_0x6cb437[_0xa665('0x33')]);_0x15a340[_0xa665('0x35')]=_[_0xa665('0x36')](_0x15a340[_0xa665('0x37')],_0x15a340[_0xa665('0x33')]);_0x1047a9[_0xa665('0x38')]=_[_0xa665('0x36')](_0x15a340[_0xa665('0x37')],qs[_0xa665('0x39')](_0x6cb437[_0xa665('0x33')][_0xa665('0x39')]));_0x1047a9[_0xa665('0x38')]=_0x1047a9['attributes'][_0xa665('0x3a')]?_0x1047a9['attributes']:_0x15a340['model'];if(_0x6cb437[_0xa665('0x33')][_0xa665('0x49')]){_0x1047a9[_0xa665('0x43')]=[{'all':!![]}];}_0x1047a9=_['merge']({},_0x1047a9,_0x6cb437['options']);return db['AnalyticExtractedReport']['find'](_0x1047a9)['then'](handleEntityNotFound(_0x27f36e,null))[_0xa665('0x25')](respondWithResult(_0x27f36e,null))['catch'](handleError(_0x27f36e,null));};exports[_0xa665('0x4a')]=function(_0x2e308c,_0x3c867b){return db[_0xa665('0x2f')][_0xa665('0x4a')](_0x2e308c[_0xa665('0x4b')],{})[_0xa665('0x25')](function(_0x53c077){var _0xe0cd62=_0x2e308c['user']['get']({'plain':!![]});if(!_0xe0cd62)throw new Error(_0xa665('0x4c'));if(_0xe0cd62[_0xa665('0x4d')]==='user'){var _0x1b6545=_0x53c077[_0xa665('0x4e')]({'plain':!![]});var _0x517533=_0xa665('0x27');return db['UserProfileSection'][_0xa665('0x4f')]({'where':{'name':_0x517533,'userProfileId':_0xe0cd62[_0xa665('0x50')]},'raw':!![]})['then'](function(_0xe7a7c7){if(_0xe7a7c7&&_0xe7a7c7[_0xa665('0x51')]===0x0){return db[_0xa665('0x28')][_0xa665('0x4a')]({'name':_0x1b6545[_0xa665('0x2b')],'resourceId':_0x1b6545['id'],'type':_0xe7a7c7[_0xa665('0x2b')],'sectionId':_0xe7a7c7['id']},{})[_0xa665('0x25')](function(){return _0x53c077;});}else{return _0x53c077;}})['catch'](function(_0x5c0683){logger[_0xa665('0x29')](_0xa665('0x52'),_0x5c0683);throw _0x5c0683;});}return _0x53c077;})[_0xa665('0x25')](respondWithResult(_0x3c867b,0xc9))[_0xa665('0x53')](handleError(_0x3c867b,null));};exports['update']=function(_0x33710c,_0x49eec8){if(_0x33710c[_0xa665('0x4b')]['id']){delete _0x33710c[_0xa665('0x4b')]['id'];}return db[_0xa665('0x2f')][_0xa665('0x4f')]({'where':{'id':_0x33710c[_0xa665('0x47')]['id']}})[_0xa665('0x25')](handleEntityNotFound(_0x49eec8,null))[_0xa665('0x25')](saveUpdates(_0x33710c[_0xa665('0x4b')],null))[_0xa665('0x25')](respondWithResult(_0x49eec8,null))['catch'](handleError(_0x49eec8,null));};exports[_0xa665('0x26')]=function(_0x1da593,_0x242842){return db[_0xa665('0x2f')][_0xa665('0x4f')]({'where':{'id':_0x1da593[_0xa665('0x47')]['id']}})['then'](handleEntityNotFound(_0x242842,null))[_0xa665('0x25')](removeEntity(_0x242842,null))[_0xa665('0x53')](handleError(_0x242842,null));};exports[_0xa665('0x54')]=function(_0x37dfee,_0x2663c0,_0x5ef77d){return db['AnalyticExtractedReport'][_0xa665('0x4f')]({'where':{'id':_0x37dfee[_0xa665('0x47')]['id']},'attributes':[_0xa665('0x2b'),'basename',_0xa665('0x55'),_0xa665('0x56')],'raw':!![]})[_0xa665('0x25')](handleEntityNotFound(_0x2663c0,null))[_0xa665('0x25')](function(_0x2e2c52){if(_0x2e2c52){if(!fs[_0xa665('0x57')](path[_0xa665('0x58')](config[_0xa665('0x59')],_0xa665('0x5a'),_0x2e2c52[_0xa665('0x55')]))){throw new db['Sequelize'][(_0xa665('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x37dfee[_0xa665('0x33')]['exists']){return _0x2663c0[_0xa665('0x5c')](0xc8);}return _0x2663c0['download'](path[_0xa665('0x58')](config['root'],_0xa665('0x5a'),_0x2e2c52[_0xa665('0x55')]),util[_0xa665('0x5d')](_0xa665('0x5e'),_0x2e2c52[_0xa665('0x5f')]||_0x2e2c52[_0xa665('0x2b')],_0x2e2c52[_0xa665('0x56')][_0xa665('0x60')]()));}})[_0xa665('0x53')](handleError(_0x2663c0,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 007e855..5f68cd4 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 _0xe441=['api','moment','request-promise','path','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x84d96e,_0x57c507){var _0x4a5548=function(_0x4556c6){while(--_0x4556c6){_0x84d96e['push'](_0x84d96e['shift']());}};_0x4a5548(++_0x57c507);}(_0xe441,0xa2));var _0x1e44=function(_0x223e04,_0x15a0df){_0x223e04=_0x223e04-0x0;var _0xa0df60=_0xe441[_0x223e04];return _0xa0df60;};'use strict';var _=require(_0x1e44('0x0'));var util=require(_0x1e44('0x1'));var logger=require(_0x1e44('0x2'))(_0x1e44('0x3'));var moment=require(_0x1e44('0x4'));var BPromise=require('bluebird');var rp=require(_0x1e44('0x5'));var fs=require('fs');var path=require(_0x1e44('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1e44('0x7'));module[_0x1e44('0x8')]=function(_0x10f225,_0x69ab10){return _0x10f225[_0x1e44('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x1e44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb43=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise'];(function(_0x29feb2,_0x596cc4){var _0x93af00=function(_0x3f7cf2){while(--_0x3f7cf2){_0x29feb2['push'](_0x29feb2['shift']());}};_0x93af00(++_0x596cc4);}(_0xdb43,0x70));var _0x3db4=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xdb43[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0x3db4('0x0'));var logger=require(_0x3db4('0x1'))(_0x3db4('0x2'));var moment=require('moment');var BPromise=require(_0x3db4('0x3'));var rp=require(_0x3db4('0x4'));var fs=require('fs');var path=require(_0x3db4('0x5'));var rimraf=require(_0x3db4('0x6'));var config=require(_0x3db4('0x7'));var attributes=require(_0x3db4('0x8'));module[_0x3db4('0x9')]=function(_0x109be2,_0x5e5159){return _0x109be2[_0x3db4('0xa')](_0x3db4('0xb'),attributes,{'tableName':_0x3db4('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 93dd51d..2357db1 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 _0x0fa8=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x36fc1f,_0x479482){var _0x377e9e=function(_0x11e197){while(--_0x11e197){_0x36fc1f['push'](_0x36fc1f['shift']());}};_0x377e9e(++_0x479482);}(_0x0fa8,0x8c));var _0x80fa=function(_0x4fa92b,_0x7d972){_0x4fa92b=_0x4fa92b-0x0;var _0x2a6579=_0x0fa8[_0x4fa92b];return _0x2a6579;};'use strict';var _=require('lodash');var util=require(_0x80fa('0x0'));var moment=require(_0x80fa('0x1'));var BPromise=require(_0x80fa('0x2'));var rs=require(_0x80fa('0x3'));var fs=require('fs');var Redis=require(_0x80fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x80fa('0x5'));var logger=require(_0x80fa('0x6'))(_0x80fa('0x7'));var config=require('../../config/environment');var jayson=require(_0x80fa('0x8'));var client=jayson[_0x80fa('0x9')][_0x80fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ad7b2,_0x2f4739,_0x90e54e){return new BPromise(function(_0x1c9ea0,_0x3de2f5){return client[_0x80fa('0xb')](_0x1ad7b2,_0x90e54e)[_0x80fa('0xc')](function(_0x5341e6){logger[_0x80fa('0xd')](_0x80fa('0xe'),_0x2f4739,_0x80fa('0xf'));logger[_0x80fa('0x10')](_0x80fa('0x11'),_0x2f4739,_0x80fa('0xf'),JSON['stringify'](_0x5341e6));if(_0x5341e6['error']){if(_0x5341e6[_0x80fa('0x12')][_0x80fa('0x13')]===0x1f4){logger[_0x80fa('0x12')](_0x80fa('0xe'),_0x2f4739,_0x5341e6[_0x80fa('0x12')]['message']);return _0x3de2f5(_0x5341e6[_0x80fa('0x12')][_0x80fa('0x14')]);}logger[_0x80fa('0x12')](_0x80fa('0xe'),_0x2f4739,_0x5341e6[_0x80fa('0x12')][_0x80fa('0x14')]);return _0x1c9ea0(_0x5341e6[_0x80fa('0x12')]['message']);}else{logger[_0x80fa('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f4739,'request\x20sent');_0x1c9ea0(_0x5341e6[_0x80fa('0x15')][_0x80fa('0x14')]);}})[_0x80fa('0x16')](function(_0x2fff1b){logger['error'](_0x80fa('0xe'),_0x2f4739,_0x2fff1b);_0x3de2f5(_0x2fff1b);});});} \ No newline at end of file +var _0x609c=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cc8ff,_0x1c8a33){var _0x47e5e1=function(_0x3b9552){while(--_0x3b9552){_0x5cc8ff['push'](_0x5cc8ff['shift']());}};_0x47e5e1(++_0x1c8a33);}(_0x609c,0x18f));var _0xc609=function(_0x60bd64,_0x2d29a2){_0x60bd64=_0x60bd64-0x0;var _0x54673a=_0x609c[_0x60bd64];return _0x54673a;};'use strict';var _=require(_0xc609('0x0'));var util=require(_0xc609('0x1'));var moment=require(_0xc609('0x2'));var BPromise=require(_0xc609('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc609('0x4'));var db=require(_0xc609('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc609('0x6'))(_0xc609('0x7'));var config=require(_0xc609('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc609('0x9')][_0xc609('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1472e7,_0x29a5a6,_0xb95a){return new BPromise(function(_0x2f9282,_0x5c2351){return client[_0xc609('0xb')](_0x1472e7,_0xb95a)[_0xc609('0xc')](function(_0x170449){logger[_0xc609('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x29a5a6,'request\x20sent');logger[_0xc609('0xe')](_0xc609('0xf'),_0x29a5a6,'request\x20sent',JSON[_0xc609('0x10')](_0x170449));if(_0x170449[_0xc609('0x11')]){if(_0x170449['error'][_0xc609('0x12')]===0x1f4){logger[_0xc609('0x11')](_0xc609('0x13'),_0x29a5a6,_0x170449[_0xc609('0x11')][_0xc609('0x14')]);return _0x5c2351(_0x170449[_0xc609('0x11')][_0xc609('0x14')]);}logger[_0xc609('0x11')](_0xc609('0x13'),_0x29a5a6,_0x170449['error'][_0xc609('0x14')]);return _0x2f9282(_0x170449[_0xc609('0x11')][_0xc609('0x14')]);}else{logger['info'](_0xc609('0x13'),_0x29a5a6,'request\x20sent');_0x2f9282(_0x170449['result'][_0xc609('0x14')]);}})[_0xc609('0x15')](function(_0x2aa08a){logger[_0xc609('0x11')](_0xc609('0x13'),_0x29a5a6,_0x2aa08a);_0x5c2351(_0x2aa08a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ff14afe..5cdf092 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 _0xb6ba=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x73a84b,_0x23d3bb){var _0x9e2a66=function(_0x2153dc){while(--_0x2153dc){_0x73a84b['push'](_0x73a84b['shift']());}};_0x9e2a66(++_0x23d3bb);}(_0xb6ba,0xe0));var _0xab6b=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xb6ba[_0x3cea78];return _0x33b66b;};'use strict';var multer=require('multer');var util=require(_0xab6b('0x0'));var path=require(_0xab6b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab6b('0x2'));var interaction=require(_0xab6b('0x3'));var config=require(_0xab6b('0x4'));var controller=require(_0xab6b('0x5'));router[_0xab6b('0x6')]('/',auth[_0xab6b('0x7')](),controller[_0xab6b('0x8')]);router['get'](_0xab6b('0x9'),auth[_0xab6b('0x7')](),controller[_0xab6b('0xa')]);router[_0xab6b('0x6')](_0xab6b('0xb'),auth[_0xab6b('0x7')](),controller[_0xab6b('0xc')]);router[_0xab6b('0xd')]('/',auth['isAuthenticated'](),controller[_0xab6b('0xe')]);router[_0xab6b('0xf')](_0xab6b('0x9'),auth[_0xab6b('0x7')](),controller[_0xab6b('0x10')]);router['delete'](_0xab6b('0x9'),auth[_0xab6b('0x7')](),controller[_0xab6b('0x11')]);module[_0xab6b('0x12')]=router; \ No newline at end of file +var _0x2f2d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x2f2d,0x10d));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd2f2('0x0'));var util=require(_0xd2f2('0x1'));var path=require(_0xd2f2('0x2'));var timeout=require(_0xd2f2('0x3'));var express=require(_0xd2f2('0x4'));var router=express[_0xd2f2('0x5')]();var fs_extra=require(_0xd2f2('0x6'));var auth=require(_0xd2f2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd2f2('0x8'));var controller=require(_0xd2f2('0x9'));router[_0xd2f2('0xa')]('/',auth[_0xd2f2('0xb')](),controller['index']);router['get']('/:id',auth[_0xd2f2('0xb')](),controller[_0xd2f2('0xc')]);router[_0xd2f2('0xa')](_0xd2f2('0xd'),auth[_0xd2f2('0xb')](),controller['download']);router[_0xd2f2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd2f2('0xf')](_0xd2f2('0x10'),auth[_0xd2f2('0xb')](),controller[_0xd2f2('0x11')]);router[_0xd2f2('0x12')](_0xd2f2('0x10'),auth[_0xd2f2('0xb')](),controller[_0xd2f2('0x13')]);module[_0xd2f2('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 3b84fa1..9e302c0 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 _0x80e0=['sequelize','exports','STRING','BOOLEAN'];(function(_0x308109,_0x4347f0){var _0x29d4b=function(_0x3277e5){while(--_0x3277e5){_0x308109['push'](_0x308109['shift']());}};_0x29d4b(++_0x4347f0);}(_0x80e0,0x98));var _0x080e=function(_0x5a2b9a,_0x4359c9){_0x5a2b9a=_0x5a2b9a-0x0;var _0x100c09=_0x80e0[_0x5a2b9a];return _0x100c09;};'use strict';var Sequelize=require(_0x080e('0x0'));module[_0x080e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x080e('0x2')]},'format':{'type':Sequelize[_0x080e('0x2')]},'groupBy':{'type':Sequelize[_0x080e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x080e('0x2')]},'custom':{'type':Sequelize[_0x080e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0bb0=['STRING','BOOLEAN','exports','TEXT'];(function(_0x2a7898,_0x21cb4a){var _0x57e7f0=function(_0x583a12){while(--_0x583a12){_0x2a7898['push'](_0x2a7898['shift']());}};_0x57e7f0(++_0x21cb4a);}(_0x0bb0,0x142));var _0x00bb=function(_0x2c9513,_0x545a12){_0x2c9513=_0x2c9513-0x0;var _0x28802b=_0x0bb0[_0x2c9513];return _0x28802b;};'use strict';var Sequelize=require('sequelize');module[_0x00bb('0x0')]={'field':{'type':Sequelize[_0x00bb('0x1')]},'alias':{'type':Sequelize[_0x00bb('0x2')]},'function':{'type':Sequelize[_0x00bb('0x2')]},'format':{'type':Sequelize[_0x00bb('0x2')]},'groupBy':{'type':Sequelize[_0x00bb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x00bb('0x2')]},'custom':{'type':Sequelize[_0x00bb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 3caa5e2..0a4b8b7 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 _0xc43b=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','options','create','body','catch','bulkCreate','find','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','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'];(function(_0x3a834c,_0x475e51){var _0x689233=function(_0x2005f2){while(--_0x2005f2){_0x3a834c['push'](_0x3a834c['shift']());}};_0x689233(++_0x475e51);}(_0xc43b,0x1e3));var _0xbc43=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc43b[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xbc43('0x0'));var rimraf=require(_0xbc43('0x1'));var zipdir=require(_0xbc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbc43('0x3'));var BPromise=require(_0xbc43('0x4'));var Mustache=require(_0xbc43('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbc43('0x6'));var csv=require(_0xbc43('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc43('0x8'));var _=require(_0xbc43('0x9'));var squel=require(_0xbc43('0xa'));var crypto=require(_0xbc43('0xb'));var jsforce=require(_0xbc43('0xc'));var deskjs=require(_0xbc43('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbc43('0xe'));var Papa=require(_0xbc43('0xf'));var Redis=require(_0xbc43('0x10'));var authService=require(_0xbc43('0x11'));var qs=require(_0xbc43('0x12'));var as=require(_0xbc43('0x13'));var hardwareService=require(_0xbc43('0x14'));var logger=require(_0xbc43('0x15'))(_0xbc43('0x16'));var utils=require('../../config/utils');var config=require(_0xbc43('0x17'));var licenseUtil=require(_0xbc43('0x18'));var db=require(_0xbc43('0x19'))['db'];function respondWithStatusCode(_0x5f322c,_0x26e243){_0x26e243=_0x26e243||0xcc;return function(_0x174639){if(_0x174639){return _0x5f322c[_0xbc43('0x1a')](_0x26e243);}return _0x5f322c[_0xbc43('0x1b')](_0x26e243)[_0xbc43('0x1c')]();};}function respondWithResult(_0x1588ac,_0x199c8e){_0x199c8e=_0x199c8e||0xc8;return function(_0x16838b){if(_0x16838b){return _0x1588ac[_0xbc43('0x1b')](_0x199c8e)[_0xbc43('0x1d')](_0x16838b);}};}function respondWithFilteredResult(_0x582c67,_0x2e1401){return function(_0x37bce){if(_0x37bce){var _0x2dd04f=typeof _0x2e1401[_0xbc43('0x1e')]==='undefined'&&typeof _0x2e1401[_0xbc43('0x1f')]===_0xbc43('0x20');var _0x30c93c=_0x37bce[_0xbc43('0x21')];var _0x43602e=_0x2dd04f?0x0:_0x2e1401['offset'];var _0x32e6ee=_0x2dd04f?_0x37bce[_0xbc43('0x21')]:_0x2e1401[_0xbc43('0x1e')]+_0x2e1401['limit'];var _0x5a829a;if(_0x32e6ee>=_0x30c93c){_0x32e6ee=_0x30c93c;_0x5a829a=0xc8;}else{_0x5a829a=0xce;}_0x582c67[_0xbc43('0x1b')](_0x5a829a);return _0x582c67[_0xbc43('0x22')]('Content-Range',_0x43602e+'-'+_0x32e6ee+'/'+_0x30c93c)[_0xbc43('0x1d')](_0x37bce);}return null;};}function patchUpdates(_0x4dbb6e){return function(_0x81b435){try{jsonpatch[_0xbc43('0x23')](_0x81b435,_0x4dbb6e,!![]);}catch(_0x3a29ff){return BPromise['reject'](_0x3a29ff);}return _0x81b435[_0xbc43('0x24')]();};}function saveUpdates(_0x46192f,_0x3c2b52){return function(_0x3eb797){if(_0x3eb797){return _0x3eb797[_0xbc43('0x25')](_0x46192f)[_0xbc43('0x26')](function(_0x16dc30){return _0x16dc30;});}return null;};}function removeEntity(_0x3972c8,_0x301a7a){return function(_0x6a9c9){if(_0x6a9c9){return _0x6a9c9[_0xbc43('0x27')]()[_0xbc43('0x26')](function(){_0x3972c8[_0xbc43('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x268407,_0x492e98){return function(_0x34073c){if(!_0x34073c){_0x268407[_0xbc43('0x1a')](0x194);}return _0x34073c;};}function handleError(_0x172ef9,_0x1f9f17){_0x1f9f17=_0x1f9f17||0x1f4;return function(_0x4a026b){logger[_0xbc43('0x28')](_0x4a026b[_0xbc43('0x29')]);if(_0x4a026b['name']){delete _0x4a026b[_0xbc43('0x2a')];}_0x172ef9[_0xbc43('0x1b')](_0x1f9f17)[_0xbc43('0x2b')](_0x4a026b);};}exports[_0xbc43('0x2c')]=function(_0x25a37b,_0x6d6d92){var _0x12b59e={},_0x5103ca={},_0x16d8b9={'count':0x0,'rows':[]};var _0x1eefad=_[_0xbc43('0x2d')](db[_0xbc43('0x2e')][_0xbc43('0x2f')],function(_0xb16b17){return{'name':_0xb16b17[_0xbc43('0x30')],'type':_0xb16b17[_0xbc43('0x31')]['key']};});_0x5103ca[_0xbc43('0x32')]=_[_0xbc43('0x2d')](_0x1eefad,_0xbc43('0x2a'));_0x5103ca[_0xbc43('0x33')]=_['keys'](_0x25a37b[_0xbc43('0x33')]);_0x5103ca['filters']=_[_0xbc43('0x34')](_0x5103ca[_0xbc43('0x32')],_0x5103ca[_0xbc43('0x33')]);_0x12b59e['attributes']=_[_0xbc43('0x34')](_0x5103ca[_0xbc43('0x32')],qs[_0xbc43('0x35')](_0x25a37b[_0xbc43('0x33')][_0xbc43('0x35')]));_0x12b59e['attributes']=_0x12b59e[_0xbc43('0x36')]['length']?_0x12b59e[_0xbc43('0x36')]:_0x5103ca[_0xbc43('0x32')];if(!_0x25a37b[_0xbc43('0x33')][_0xbc43('0x37')](_0xbc43('0x38'))){_0x12b59e[_0xbc43('0x1f')]=qs[_0xbc43('0x1f')](_0x25a37b['query'][_0xbc43('0x1f')]);_0x12b59e['offset']=qs[_0xbc43('0x1e')](_0x25a37b['query'][_0xbc43('0x1e')]);}_0x12b59e['order']=qs[_0xbc43('0x39')](_0x25a37b['query'][_0xbc43('0x39')]);_0x12b59e[_0xbc43('0x3a')]=qs[_0xbc43('0x3b')](_[_0xbc43('0x3c')](_0x25a37b[_0xbc43('0x33')],_0x5103ca['filters']),_0x1eefad);if(_0x25a37b[_0xbc43('0x33')][_0xbc43('0x3d')]){_0x12b59e['where']=_[_0xbc43('0x3e')](_0x12b59e[_0xbc43('0x3a')],{'$or':_[_0xbc43('0x2d')](_0x1eefad,function(_0x1de208){if(_0x1de208[_0xbc43('0x31')]!==_0xbc43('0x3f')){var _0x35364e={};_0x35364e[_0x1de208[_0xbc43('0x2a')]]={'$like':'%'+_0x25a37b['query'][_0xbc43('0x3d')]+'%'};return _0x35364e;}})});}_0x12b59e=_[_0xbc43('0x3e')]({},_0x12b59e,_0x25a37b['options']);var _0x3c32e0={'where':_0x12b59e[_0xbc43('0x3a')]};return db[_0xbc43('0x2e')][_0xbc43('0x21')](_0x3c32e0)['then'](function(_0x597664){_0x16d8b9[_0xbc43('0x21')]=_0x597664;if(_0x25a37b[_0xbc43('0x33')][_0xbc43('0x40')]){_0x12b59e[_0xbc43('0x41')]=[{'all':!![]}];}return db[_0xbc43('0x2e')][_0xbc43('0x42')](_0x12b59e);})[_0xbc43('0x26')](function(_0x2a2a89){_0x16d8b9[_0xbc43('0x43')]=_0x2a2a89;return _0x16d8b9;})['then'](respondWithFilteredResult(_0x6d6d92,_0x12b59e))['catch'](handleError(_0x6d6d92,null));};exports[_0xbc43('0x44')]=function(_0x633fb1,_0x18ed6f){var _0x30e56e={'raw':![],'where':{'id':_0x633fb1[_0xbc43('0x45')]['id']}},_0x344ed4={};_0x344ed4['model']=_[_0xbc43('0x46')](db[_0xbc43('0x2e')][_0xbc43('0x2f')]);_0x344ed4[_0xbc43('0x33')]=_[_0xbc43('0x46')](_0x633fb1[_0xbc43('0x33')]);_0x344ed4[_0xbc43('0x3b')]=_[_0xbc43('0x34')](_0x344ed4[_0xbc43('0x32')],_0x344ed4['query']);_0x30e56e[_0xbc43('0x36')]=_['intersection'](_0x344ed4[_0xbc43('0x32')],qs[_0xbc43('0x35')](_0x633fb1['query'][_0xbc43('0x35')]));_0x30e56e[_0xbc43('0x36')]=_0x30e56e[_0xbc43('0x36')][_0xbc43('0x47')]?_0x30e56e[_0xbc43('0x36')]:_0x344ed4[_0xbc43('0x32')];if(_0x633fb1[_0xbc43('0x33')][_0xbc43('0x40')]){_0x30e56e[_0xbc43('0x41')]=[{'all':!![]}];}_0x30e56e=_[_0xbc43('0x3e')]({},_0x30e56e,_0x633fb1[_0xbc43('0x48')]);return db['AnalyticFieldReport']['find'](_0x30e56e)[_0xbc43('0x26')](handleEntityNotFound(_0x18ed6f,null))[_0xbc43('0x26')](respondWithResult(_0x18ed6f,null))['catch'](handleError(_0x18ed6f,null));};exports[_0xbc43('0x49')]=function(_0x51d257,_0x4493ff){return db[_0xbc43('0x2e')][_0xbc43('0x49')](_0x51d257[_0xbc43('0x4a')],{})[_0xbc43('0x26')](respondWithResult(_0x4493ff,0xc9))[_0xbc43('0x4b')](handleError(_0x4493ff,null));};exports[_0xbc43('0x4c')]=function(_0x161404,_0x364433){return db[_0xbc43('0x2e')][_0xbc43('0x4c')](_0x161404[_0xbc43('0x4a')],{'raw':![],'individualHooks':!![]})[_0xbc43('0x26')](respondWithResult(_0x364433,0xc9))[_0xbc43('0x4b')](handleError(_0x364433,null));};exports[_0xbc43('0x25')]=function(_0x326e7c,_0x4daa76){if(_0x326e7c['body']['id']){delete _0x326e7c[_0xbc43('0x4a')]['id'];}return db['AnalyticFieldReport'][_0xbc43('0x4d')]({'where':{'id':_0x326e7c[_0xbc43('0x45')]['id']}})[_0xbc43('0x26')](handleEntityNotFound(_0x4daa76,null))[_0xbc43('0x26')](saveUpdates(_0x326e7c[_0xbc43('0x4a')],null))[_0xbc43('0x26')](respondWithResult(_0x4daa76,null))[_0xbc43('0x4b')](handleError(_0x4daa76,null));};exports[_0xbc43('0x27')]=function(_0x335691,_0x38c91d){return db[_0xbc43('0x2e')][_0xbc43('0x4d')]({'where':{'id':_0x335691[_0xbc43('0x45')]['id']}})[_0xbc43('0x26')](handleEntityNotFound(_0x38c91d,null))[_0xbc43('0x26')](removeEntity(_0x38c91d,null))['catch'](handleError(_0x38c91d,null));};exports[_0xbc43('0x4e')]=function(_0x50571c,_0x225f11){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x50571c[_0xbc43('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xbc43('0x26')](respondWithResult(_0x225f11,0xcc))[_0xbc43('0x4b')](handleError(_0x225f11,null));};exports['addFields']=function(_0x514c96,_0x3a2961,_0x3db5d8){return db[_0xbc43('0x4f')][_0xbc43('0x50')]({'where':{'id':_0x514c96[_0xbc43('0x45')]['id']}})[_0xbc43('0x26')](handleEntityNotFound(_0x3a2961,null))[_0xbc43('0x26')](function(_0x935864){if(_0x935864){return db[_0xbc43('0x51')][_0xbc43('0x52')](function(_0x1a9996){return db[_0xbc43('0x2e')][_0xbc43('0x27')]({'where':{'CustomReportId':_0x514c96[_0xbc43('0x45')]['id']},'transaction':_0x1a9996})[_0xbc43('0x26')](function(_0x19d69d){var _0x1d58ce=_[_0xbc43('0x2d')](_0x514c96[_0xbc43('0x4a')],function(_0x1a0d97){delete _0x1a0d97['id'];_0x1a0d97[_0xbc43('0x53')]=_0x514c96[_0xbc43('0x45')]['id'];return _0x1a0d97;});return db[_0xbc43('0x2e')][_0xbc43('0x4c')](_0x1d58ce,{'transaction':_0x1a9996});});})[_0xbc43('0x26')](function(){return db[_0xbc43('0x2e')][_0xbc43('0x42')]({'where':{'CustomReportId':_0x514c96[_0xbc43('0x45')]['id']}});});}})[_0xbc43('0x26')](respondWithResult(_0x3a2961,null))[_0xbc43('0x4b')](handleError(_0x3a2961,null));}; \ No newline at end of file +var _0xbe5d=['update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x2be1f,_0x548fd4){var _0x2d1372=function(_0x570d87){while(--_0x570d87){_0x2be1f['push'](_0x2be1f['shift']());}};_0x2d1372(++_0x548fd4);}(_0xbe5d,0x12a));var _0xdbe5=function(_0x2d46a3,_0x28457a){_0x2d46a3=_0x2d46a3-0x0;var _0x169497=_0xbe5d[_0x2d46a3];return _0x169497;};'use strict';var emlformat=require(_0xdbe5('0x0'));var rimraf=require(_0xdbe5('0x1'));var zipdir=require(_0xdbe5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbe5('0x3'));var moment=require(_0xdbe5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdbe5('0x5'));var sox=require(_0xdbe5('0x6'));var csv=require('to-csv');var ejs=require(_0xdbe5('0x7'));var fs=require('fs');var fs_extra=require(_0xdbe5('0x8'));var _=require(_0xdbe5('0x9'));var squel=require('squel');var crypto=require(_0xdbe5('0xa'));var jsforce=require(_0xdbe5('0xb'));var deskjs=require(_0xdbe5('0xc'));var toCsv=require(_0xdbe5('0xd'));var querystring=require('querystring');var Papa=require(_0xdbe5('0xe'));var Redis=require(_0xdbe5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdbe5('0x10'));var as=require(_0xdbe5('0x11'));var hardwareService=require(_0xdbe5('0x12'));var logger=require(_0xdbe5('0x13'))(_0xdbe5('0x14'));var utils=require(_0xdbe5('0x15'));var config=require(_0xdbe5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbe5('0x17'))['db'];function respondWithStatusCode(_0x2cbc2b,_0x36ec48){_0x36ec48=_0x36ec48||0xcc;return function(_0x2661df){if(_0x2661df){return _0x2cbc2b['sendStatus'](_0x36ec48);}return _0x2cbc2b[_0xdbe5('0x18')](_0x36ec48)[_0xdbe5('0x19')]();};}function respondWithResult(_0x4f1a7d,_0x6e05d2){_0x6e05d2=_0x6e05d2||0xc8;return function(_0x290e2a){if(_0x290e2a){return _0x4f1a7d[_0xdbe5('0x18')](_0x6e05d2)[_0xdbe5('0x1a')](_0x290e2a);}};}function respondWithFilteredResult(_0x39a50b,_0x1238fe){return function(_0x1c8b67){if(_0x1c8b67){var _0x20b59e=typeof _0x1238fe['offset']===_0xdbe5('0x1b')&&typeof _0x1238fe[_0xdbe5('0x1c')]===_0xdbe5('0x1b');var _0x364a5f=_0x1c8b67[_0xdbe5('0x1d')];var _0x4dfca9=_0x20b59e?0x0:_0x1238fe[_0xdbe5('0x1e')];var _0x14c017=_0x20b59e?_0x1c8b67[_0xdbe5('0x1d')]:_0x1238fe[_0xdbe5('0x1e')]+_0x1238fe[_0xdbe5('0x1c')];var _0x52bdf5;if(_0x14c017>=_0x364a5f){_0x14c017=_0x364a5f;_0x52bdf5=0xc8;}else{_0x52bdf5=0xce;}_0x39a50b[_0xdbe5('0x18')](_0x52bdf5);return _0x39a50b[_0xdbe5('0x1f')](_0xdbe5('0x20'),_0x4dfca9+'-'+_0x14c017+'/'+_0x364a5f)[_0xdbe5('0x1a')](_0x1c8b67);}return null;};}function patchUpdates(_0x363d0d){return function(_0x46d492){try{jsonpatch[_0xdbe5('0x21')](_0x46d492,_0x363d0d,!![]);}catch(_0x2589a9){return BPromise['reject'](_0x2589a9);}return _0x46d492['save']();};}function saveUpdates(_0x294a95,_0x4a4957){return function(_0x2a8604){if(_0x2a8604){return _0x2a8604[_0xdbe5('0x22')](_0x294a95)[_0xdbe5('0x23')](function(_0x573c3e){return _0x573c3e;});}return null;};}function removeEntity(_0x130a36,_0x2125ae){return function(_0x5b0004){if(_0x5b0004){return _0x5b0004['destroy']()['then'](function(){_0x130a36[_0xdbe5('0x18')](0xcc)[_0xdbe5('0x19')]();});}};}function handleEntityNotFound(_0x3624c2,_0x187b7d){return function(_0x4590da){if(!_0x4590da){_0x3624c2[_0xdbe5('0x24')](0x194);}return _0x4590da;};}function handleError(_0xe871e2,_0x390c1d){_0x390c1d=_0x390c1d||0x1f4;return function(_0x5a9907){logger[_0xdbe5('0x25')](_0x5a9907['stack']);if(_0x5a9907[_0xdbe5('0x26')]){delete _0x5a9907[_0xdbe5('0x26')];}_0xe871e2['status'](_0x390c1d)[_0xdbe5('0x27')](_0x5a9907);};}exports[_0xdbe5('0x28')]=function(_0x59dac0,_0x266f77){var _0x2bb63d={},_0xe48d45={},_0x22ef03={'count':0x0,'rows':[]};var _0x3b891e=_[_0xdbe5('0x29')](db['AnalyticFieldReport'][_0xdbe5('0x2a')],function(_0x192445){return{'name':_0x192445[_0xdbe5('0x2b')],'type':_0x192445['type'][_0xdbe5('0x2c')]};});_0xe48d45[_0xdbe5('0x2d')]=_[_0xdbe5('0x29')](_0x3b891e,_0xdbe5('0x26'));_0xe48d45[_0xdbe5('0x2e')]=_[_0xdbe5('0x2f')](_0x59dac0['query']);_0xe48d45[_0xdbe5('0x30')]=_[_0xdbe5('0x31')](_0xe48d45['model'],_0xe48d45['query']);_0x2bb63d['attributes']=_[_0xdbe5('0x31')](_0xe48d45['model'],qs[_0xdbe5('0x32')](_0x59dac0['query']['fields']));_0x2bb63d[_0xdbe5('0x33')]=_0x2bb63d[_0xdbe5('0x33')][_0xdbe5('0x34')]?_0x2bb63d['attributes']:_0xe48d45[_0xdbe5('0x2d')];if(!_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x35')]('nolimit')){_0x2bb63d[_0xdbe5('0x1c')]=qs[_0xdbe5('0x1c')](_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x1c')]);_0x2bb63d[_0xdbe5('0x1e')]=qs[_0xdbe5('0x1e')](_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x1e')]);}_0x2bb63d[_0xdbe5('0x36')]=qs[_0xdbe5('0x37')](_0x59dac0[_0xdbe5('0x2e')]['sort']);_0x2bb63d[_0xdbe5('0x38')]=qs[_0xdbe5('0x30')](_[_0xdbe5('0x39')](_0x59dac0['query'],_0xe48d45[_0xdbe5('0x30')]),_0x3b891e);if(_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x3a')]){_0x2bb63d[_0xdbe5('0x38')]=_[_0xdbe5('0x3b')](_0x2bb63d[_0xdbe5('0x38')],{'$or':_[_0xdbe5('0x29')](_0x3b891e,function(_0x28d976){if(_0x28d976[_0xdbe5('0x3c')]!==_0xdbe5('0x3d')){var _0x4f16b7={};_0x4f16b7[_0x28d976[_0xdbe5('0x26')]]={'$like':'%'+_0x59dac0[_0xdbe5('0x2e')]['filter']+'%'};return _0x4f16b7;}})});}_0x2bb63d=_[_0xdbe5('0x3b')]({},_0x2bb63d,_0x59dac0[_0xdbe5('0x3e')]);var _0x1c59d8={'where':_0x2bb63d[_0xdbe5('0x38')]};return db[_0xdbe5('0x3f')][_0xdbe5('0x1d')](_0x1c59d8)[_0xdbe5('0x23')](function(_0x50543d){_0x22ef03[_0xdbe5('0x1d')]=_0x50543d;if(_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x40')]){_0x2bb63d[_0xdbe5('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xdbe5('0x42')](_0x2bb63d);})[_0xdbe5('0x23')](function(_0x557187){_0x22ef03[_0xdbe5('0x43')]=_0x557187;return _0x22ef03;})[_0xdbe5('0x23')](respondWithFilteredResult(_0x266f77,_0x2bb63d))[_0xdbe5('0x44')](handleError(_0x266f77,null));};exports[_0xdbe5('0x45')]=function(_0x258ebe,_0x38c59c){var _0x5f19d0={'raw':![],'where':{'id':_0x258ebe['params']['id']}},_0x557b75={};_0x557b75[_0xdbe5('0x2d')]=_[_0xdbe5('0x2f')](db['AnalyticFieldReport'][_0xdbe5('0x2a')]);_0x557b75[_0xdbe5('0x2e')]=_[_0xdbe5('0x2f')](_0x258ebe[_0xdbe5('0x2e')]);_0x557b75[_0xdbe5('0x30')]=_[_0xdbe5('0x31')](_0x557b75['model'],_0x557b75[_0xdbe5('0x2e')]);_0x5f19d0[_0xdbe5('0x33')]=_['intersection'](_0x557b75[_0xdbe5('0x2d')],qs['fields'](_0x258ebe[_0xdbe5('0x2e')]['fields']));_0x5f19d0['attributes']=_0x5f19d0[_0xdbe5('0x33')][_0xdbe5('0x34')]?_0x5f19d0[_0xdbe5('0x33')]:_0x557b75[_0xdbe5('0x2d')];if(_0x258ebe['query'][_0xdbe5('0x40')]){_0x5f19d0[_0xdbe5('0x41')]=[{'all':!![]}];}_0x5f19d0=_[_0xdbe5('0x3b')]({},_0x5f19d0,_0x258ebe[_0xdbe5('0x3e')]);return db[_0xdbe5('0x3f')][_0xdbe5('0x46')](_0x5f19d0)[_0xdbe5('0x23')](handleEntityNotFound(_0x38c59c,null))[_0xdbe5('0x23')](respondWithResult(_0x38c59c,null))[_0xdbe5('0x44')](handleError(_0x38c59c,null));};exports[_0xdbe5('0x47')]=function(_0x5d9a4f,_0x441434){return db['AnalyticFieldReport'][_0xdbe5('0x47')](_0x5d9a4f[_0xdbe5('0x48')],{})[_0xdbe5('0x23')](respondWithResult(_0x441434,0xc9))['catch'](handleError(_0x441434,null));};exports['bulkCreate']=function(_0xf3c3ab,_0x42817a){return db[_0xdbe5('0x3f')]['bulkCreate'](_0xf3c3ab[_0xdbe5('0x48')],{'raw':![],'individualHooks':!![]})[_0xdbe5('0x23')](respondWithResult(_0x42817a,0xc9))[_0xdbe5('0x44')](handleError(_0x42817a,null));};exports[_0xdbe5('0x22')]=function(_0x2a6e1b,_0x486923){if(_0x2a6e1b[_0xdbe5('0x48')]['id']){delete _0x2a6e1b[_0xdbe5('0x48')]['id'];}return db[_0xdbe5('0x3f')][_0xdbe5('0x46')]({'where':{'id':_0x2a6e1b[_0xdbe5('0x49')]['id']}})[_0xdbe5('0x23')](handleEntityNotFound(_0x486923,null))['then'](saveUpdates(_0x2a6e1b[_0xdbe5('0x48')],null))[_0xdbe5('0x23')](respondWithResult(_0x486923,null))[_0xdbe5('0x44')](handleError(_0x486923,null));};exports[_0xdbe5('0x4a')]=function(_0x4c0085,_0x2325c0){return db[_0xdbe5('0x3f')][_0xdbe5('0x46')]({'where':{'id':_0x4c0085[_0xdbe5('0x49')]['id']}})[_0xdbe5('0x23')](handleEntityNotFound(_0x2325c0,null))[_0xdbe5('0x23')](removeEntity(_0x2325c0,null))['catch'](handleError(_0x2325c0,null));};exports['bulkDestroy']=function(_0x441216,_0x49ee01){return db[_0xdbe5('0x3f')][_0xdbe5('0x4a')]({'where':{'id':_0x441216[_0xdbe5('0x2e')][_0xdbe5('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xdbe5('0x23')](respondWithResult(_0x49ee01,0xcc))[_0xdbe5('0x44')](handleError(_0x49ee01,null));};exports[_0xdbe5('0x4c')]=function(_0x18f508,_0x52080f,_0x18050f){return db[_0xdbe5('0x4d')][_0xdbe5('0x4e')]({'where':{'id':_0x18f508[_0xdbe5('0x49')]['id']}})[_0xdbe5('0x23')](handleEntityNotFound(_0x52080f,null))['then'](function(_0x3257b1){if(_0x3257b1){return db[_0xdbe5('0x4f')][_0xdbe5('0x50')](function(_0x56e9b3){return db[_0xdbe5('0x3f')][_0xdbe5('0x4a')]({'where':{'CustomReportId':_0x18f508[_0xdbe5('0x49')]['id']},'transaction':_0x56e9b3})[_0xdbe5('0x23')](function(_0x18f993){var _0x7e0db8=_['map'](_0x18f508[_0xdbe5('0x48')],function(_0x11d584){delete _0x11d584['id'];_0x11d584[_0xdbe5('0x51')]=_0x18f508['params']['id'];return _0x11d584;});return db[_0xdbe5('0x3f')][_0xdbe5('0x52')](_0x7e0db8,{'transaction':_0x56e9b3});});})[_0xdbe5('0x23')](function(){return db[_0xdbe5('0x3f')][_0xdbe5('0x42')]({'where':{'CustomReportId':_0x18f508[_0xdbe5('0x49')]['id']}});});}})['then'](respondWithResult(_0x52080f,null))[_0xdbe5('0x44')](handleError(_0x52080f,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 77b618a..c63f500 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 _0x8bf5=['api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x6a4fb0,_0x34915b){var _0x478350=function(_0x138fc3){while(--_0x138fc3){_0x6a4fb0['push'](_0x6a4fb0['shift']());}};_0x478350(++_0x34915b);}(_0x8bf5,0x19d));var _0x58bf=function(_0x909734,_0x16d6c2){_0x909734=_0x909734-0x0;var _0x1063eb=_0x8bf5[_0x909734];return _0x1063eb;};'use strict';var _=require(_0x58bf('0x0'));var util=require(_0x58bf('0x1'));var logger=require(_0x58bf('0x2'))(_0x58bf('0x3'));var moment=require('moment');var BPromise=require(_0x58bf('0x4'));var rp=require(_0x58bf('0x5'));var fs=require('fs');var path=require(_0x58bf('0x6'));var rimraf=require('rimraf');var config=require(_0x58bf('0x7'));var attributes=require(_0x58bf('0x8'));module[_0x58bf('0x9')]=function(_0x45c691,_0x21e95c){return _0x45c691[_0x58bf('0xa')](_0x58bf('0xb'),attributes,{'tableName':_0x58bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9903=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','../../config/logger','api'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x9903,0x1a1));var _0x3990=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9903[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3990('0x0'));var logger=require(_0x3990('0x1'))(_0x3990('0x2'));var moment=require('moment');var BPromise=require(_0x3990('0x3'));var rp=require(_0x3990('0x4'));var fs=require('fs');var path=require(_0x3990('0x5'));var rimraf=require(_0x3990('0x6'));var config=require(_0x3990('0x7'));var attributes=require(_0x3990('0x8'));module[_0x3990('0x9')]=function(_0x1e15f9,_0x696267){return _0x1e15f9[_0x3990('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x3990('0xb'),'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 344c523..95d7576 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 _0xf819=['request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d3c89,_0x51bf87){var _0x181dd1=function(_0x21ac73){while(--_0x21ac73){_0x3d3c89['push'](_0x3d3c89['shift']());}};_0x181dd1(++_0x51bf87);}(_0xf819,0x9d));var _0x9f81=function(_0x2a66df,_0x4e9b7b){_0x2a66df=_0x2a66df-0x0;var _0x3186b2=_0xf819[_0x2a66df];return _0x3186b2;};'use strict';var _=require(_0x9f81('0x0'));var util=require(_0x9f81('0x1'));var moment=require('moment');var BPromise=require(_0x9f81('0x2'));var rs=require(_0x9f81('0x3'));var fs=require('fs');var Redis=require(_0x9f81('0x4'));var db=require(_0x9f81('0x5'))['db'];var utils=require(_0x9f81('0x6'));var logger=require('../../config/logger')(_0x9f81('0x7'));var config=require('../../config/environment');var jayson=require(_0x9f81('0x8'));var client=jayson[_0x9f81('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42629a,_0x5976cd,_0x64195e){return new BPromise(function(_0x38ba13,_0x5a45fe){return client[_0x9f81('0xa')](_0x42629a,_0x64195e)[_0x9f81('0xb')](function(_0x320736){logger['info'](_0x9f81('0xc'),_0x5976cd,'request\x20sent');logger[_0x9f81('0xd')](_0x9f81('0xe'),_0x5976cd,'request\x20sent',JSON[_0x9f81('0xf')](_0x320736));if(_0x320736['error']){if(_0x320736[_0x9f81('0x10')][_0x9f81('0x11')]===0x1f4){logger[_0x9f81('0x10')](_0x9f81('0xc'),_0x5976cd,_0x320736[_0x9f81('0x10')][_0x9f81('0x12')]);return _0x5a45fe(_0x320736[_0x9f81('0x10')][_0x9f81('0x12')]);}logger[_0x9f81('0x10')](_0x9f81('0xc'),_0x5976cd,_0x320736[_0x9f81('0x10')]['message']);return _0x38ba13(_0x320736[_0x9f81('0x10')][_0x9f81('0x12')]);}else{logger['info'](_0x9f81('0xc'),_0x5976cd,_0x9f81('0x13'));_0x38ba13(_0x320736[_0x9f81('0x14')][_0x9f81('0x12')]);}})[_0x9f81('0x15')](function(_0x576e76){logger[_0x9f81('0x10')](_0x9f81('0xc'),_0x5976cd,_0x576e76);_0x5a45fe(_0x576e76);});});} \ No newline at end of file +var _0x81b8=['rpc','../../config/environment','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4bdc88,_0x58297c){var _0x2b7173=function(_0x7f679f){while(--_0x7f679f){_0x4bdc88['push'](_0x4bdc88['shift']());}};_0x2b7173(++_0x58297c);}(_0x81b8,0xb1));var _0x881b=function(_0x3dc852,_0x4d908f){_0x3dc852=_0x3dc852-0x0;var _0x42921d=_0x81b8[_0x3dc852];return _0x42921d;};'use strict';var _=require(_0x881b('0x0'));var util=require('util');var moment=require(_0x881b('0x1'));var BPromise=require(_0x881b('0x2'));var rs=require(_0x881b('0x3'));var fs=require('fs');var Redis=require(_0x881b('0x4'));var db=require(_0x881b('0x5'))['db'];var utils=require(_0x881b('0x6'));var logger=require('../../config/logger')(_0x881b('0x7'));var config=require(_0x881b('0x8'));var jayson=require(_0x881b('0x9'));var client=jayson[_0x881b('0xa')][_0x881b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54cc7b,_0x13bd3f,_0x41a2af){return new BPromise(function(_0x38cda9,_0x30318e){return client['request'](_0x54cc7b,_0x41a2af)['then'](function(_0x3b8108){logger[_0x881b('0xc')](_0x881b('0xd'),_0x13bd3f,_0x881b('0xe'));logger[_0x881b('0xf')](_0x881b('0x10'),_0x13bd3f,_0x881b('0xe'),JSON[_0x881b('0x11')](_0x3b8108));if(_0x3b8108['error']){if(_0x3b8108[_0x881b('0x12')][_0x881b('0x13')]===0x1f4){logger[_0x881b('0x12')](_0x881b('0xd'),_0x13bd3f,_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);return _0x30318e(_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);}logger[_0x881b('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13bd3f,_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);return _0x38cda9(_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);}else{logger[_0x881b('0xc')](_0x881b('0xd'),_0x13bd3f,_0x881b('0xe'));_0x38cda9(_0x3b8108[_0x881b('0x15')]['message']);}})[_0x881b('0x16')](function(_0x539dad){logger[_0x881b('0x12')](_0x881b('0xd'),_0x13bd3f,_0x539dad);_0x30318e(_0x539dad);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1f6ba10..1dd9cb3 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(_0x50e993,_0x138e4b){var _0x5ce15c=function(_0x556cba){while(--_0x556cba){_0x50e993['push'](_0x50e993['shift']());}};_0x5ce15c(++_0x138e4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x278240,_0x5d5406){var _0x3ccabf=function(_0xf0814e){while(--_0xf0814e){_0x278240['push'](_0x278240['shift']());}};_0x3ccabf(++_0x5d5406);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 d11f7cf..5f470b1 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 _0x803f=['sequelize','STRING','name','TEXT'];(function(_0xa2e8d9,_0x53a7be){var _0x3eb404=function(_0x79422c){while(--_0x79422c){_0xa2e8d9['push'](_0xa2e8d9['shift']());}};_0x3eb404(++_0x53a7be);}(_0x803f,0x64));var _0xf803=function(_0x33b5d7,_0x3794b2){_0x33b5d7=_0x33b5d7-0x0;var _0x145f1a=_0x803f[_0x33b5d7];return _0x145f1a;};'use strict';var Sequelize=require(_0xf803('0x0'));module['exports']={'name':{'type':Sequelize[_0xf803('0x1')],'allowNull':![],'unique':_0xf803('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf803('0x3')]},'description':{'type':Sequelize[_0xf803('0x1')]}}; \ No newline at end of file +var _0x682e=['name','TEXT','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x682e,0x1ce));var _0xe682=function(_0x255c76,_0x20b1db){_0x255c76=_0x255c76-0x0;var _0x1ccbfb=_0x682e[_0x255c76];return _0x1ccbfb;};'use strict';var Sequelize=require(_0xe682('0x0'));module[_0xe682('0x1')]={'name':{'type':Sequelize[_0xe682('0x2')],'allowNull':![],'unique':_0xe682('0x3')},'table':{'type':Sequelize[_0xe682('0x2')]},'metric':{'type':Sequelize[_0xe682('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 8a78400..094bd90 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x3b3f2c,_0x5c5189){var _0x238d96=function(_0x43732d){while(--_0x43732d){_0x3b3f2c['push'](_0x3b3f2c['shift']());}};_0x238d96(++_0x5c5189);}(_0xe14b,0x93));var _0xbe14=function(_0x5f675a,_0x23937b){_0x5f675a=_0x5f675a-0x0;var _0x30c035=_0xe14b[_0x5f675a];return _0x30c035;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file +var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x559f13,_0x58733b){var _0x4a7320=function(_0x43a77f){while(--_0x43a77f){_0x559f13['push'](_0x559f13['shift']());}};_0x4a7320(++_0x58733b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x20b0bd,_0x26e296){_0x20b0bd=_0x20b0bd-0x0;var _0x2051c8=_0xe5b3[_0x20b0bd];return _0x2051c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 1e0c874..39ebe0e 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 _0x5aaa=['define','AnalyticMetric','analytics_metrics','lodash','request-promise','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x73ba1f,_0x588ccb){var _0x2e2725=function(_0x145578){while(--_0x145578){_0x73ba1f['push'](_0x73ba1f['shift']());}};_0x2e2725(++_0x588ccb);}(_0x5aaa,0xff));var _0xa5aa=function(_0x404922,_0x4ae8c2){_0x404922=_0x404922-0x0;var _0x58f609=_0x5aaa[_0x404922];return _0x58f609;};'use strict';var _=require(_0xa5aa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5aa('0x1'));var fs=require('fs');var path=require(_0xa5aa('0x2'));var rimraf=require(_0xa5aa('0x3'));var config=require('../../config/environment');var attributes=require(_0xa5aa('0x4'));module[_0xa5aa('0x5')]=function(_0x5e1865,_0x21d216){return _0x5e1865[_0xa5aa('0x6')](_0xa5aa('0x7'),attributes,{'tableName':_0xa5aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1115=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','AnalyticMetric','analytics_metrics','util','../../config/logger'];(function(_0x44b5c8,_0x18f16b){var _0x555974=function(_0x2a5603){while(--_0x2a5603){_0x44b5c8['push'](_0x44b5c8['shift']());}};_0x555974(++_0x18f16b);}(_0x1115,0x1b6));var _0x5111=function(_0x21c613,_0x4fa837){_0x21c613=_0x21c613-0x0;var _0x2551bc=_0x1115[_0x21c613];return _0x2551bc;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var logger=require(_0x5111('0x1'))(_0x5111('0x2'));var moment=require(_0x5111('0x3'));var BPromise=require(_0x5111('0x4'));var rp=require(_0x5111('0x5'));var fs=require('fs');var path=require(_0x5111('0x6'));var rimraf=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x467c3a,_0x115ba7){return _0x467c3a['define'](_0x5111('0x9'),attributes,{'tableName':_0x5111('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 500e67f..859608d 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 _0x9454=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x3ccc28,_0x5036d5){var _0x47dd45=function(_0xd86e79){while(--_0xd86e79){_0x3ccc28['push'](_0x3ccc28['shift']());}};_0x47dd45(++_0x5036d5);}(_0x9454,0x104));var _0x4945=function(_0x44f63c,_0x34b07d){_0x44f63c=_0x44f63c-0x0;var _0x68ae76=_0x9454[_0x44f63c];return _0x68ae76;};'use strict';var _=require(_0x4945('0x0'));var util=require(_0x4945('0x1'));var moment=require(_0x4945('0x2'));var BPromise=require(_0x4945('0x3'));var rs=require(_0x4945('0x4'));var fs=require('fs');var Redis=require(_0x4945('0x5'));var db=require(_0x4945('0x6'))['db'];var utils=require(_0x4945('0x7'));var logger=require(_0x4945('0x8'))('rpc');var config=require(_0x4945('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4945('0xa')][_0x4945('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ef4ca,_0xc619b0,_0xcc48af){return new BPromise(function(_0xcd16a7,_0x29f5e5){return client[_0x4945('0xc')](_0x2ef4ca,_0xcc48af)[_0x4945('0xd')](function(_0x4dbc10){logger[_0x4945('0xe')](_0x4945('0xf'),_0xc619b0,_0x4945('0x10'));logger[_0x4945('0x11')](_0x4945('0x12'),_0xc619b0,_0x4945('0x10'),JSON[_0x4945('0x13')](_0x4dbc10));if(_0x4dbc10[_0x4945('0x14')]){if(_0x4dbc10['error'][_0x4945('0x15')]===0x1f4){logger[_0x4945('0x14')](_0x4945('0xf'),_0xc619b0,_0x4dbc10[_0x4945('0x14')]['message']);return _0x29f5e5(_0x4dbc10[_0x4945('0x14')][_0x4945('0x16')]);}logger[_0x4945('0x14')](_0x4945('0xf'),_0xc619b0,_0x4dbc10[_0x4945('0x14')][_0x4945('0x16')]);return _0xcd16a7(_0x4dbc10[_0x4945('0x14')][_0x4945('0x16')]);}else{logger[_0x4945('0xe')](_0x4945('0xf'),_0xc619b0,'request\x20sent');_0xcd16a7(_0x4dbc10[_0x4945('0x17')][_0x4945('0x16')]);}})[_0x4945('0x18')](function(_0x579501){logger[_0x4945('0x14')](_0x4945('0xf'),_0xc619b0,_0x579501);_0x29f5e5(_0x579501);});});} \ No newline at end of file +var _0x6cc5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0x361a82,_0x627320){var _0x2270ec=function(_0x53219f){while(--_0x53219f){_0x361a82['push'](_0x361a82['shift']());}};_0x2270ec(++_0x627320);}(_0x6cc5,0x104));var _0x56cc=function(_0x46e781,_0x2ed644){_0x46e781=_0x46e781-0x0;var _0xd1644f=_0x6cc5[_0x46e781];return _0xd1644f;};'use strict';var _=require(_0x56cc('0x0'));var util=require(_0x56cc('0x1'));var moment=require('moment');var BPromise=require(_0x56cc('0x2'));var rs=require(_0x56cc('0x3'));var fs=require('fs');var Redis=require(_0x56cc('0x4'));var db=require(_0x56cc('0x5'))['db'];var utils=require(_0x56cc('0x6'));var logger=require(_0x56cc('0x7'))('rpc');var config=require(_0x56cc('0x8'));var jayson=require(_0x56cc('0x9'));var client=jayson[_0x56cc('0xa')][_0x56cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ade30,_0x1cacb7,_0x7f66e0){return new BPromise(function(_0x49f21d,_0x30ebed){return client[_0x56cc('0xc')](_0x2ade30,_0x7f66e0)[_0x56cc('0xd')](function(_0x9376d7){logger[_0x56cc('0xe')](_0x56cc('0xf'),_0x1cacb7,'request\x20sent');logger[_0x56cc('0x10')](_0x56cc('0x11'),_0x1cacb7,'request\x20sent',JSON[_0x56cc('0x12')](_0x9376d7));if(_0x9376d7[_0x56cc('0x13')]){if(_0x9376d7[_0x56cc('0x13')][_0x56cc('0x14')]===0x1f4){logger[_0x56cc('0x13')](_0x56cc('0xf'),_0x1cacb7,_0x9376d7['error']['message']);return _0x30ebed(_0x9376d7[_0x56cc('0x13')][_0x56cc('0x15')]);}logger['error'](_0x56cc('0xf'),_0x1cacb7,_0x9376d7[_0x56cc('0x13')]['message']);return _0x49f21d(_0x9376d7[_0x56cc('0x13')]['message']);}else{logger[_0x56cc('0xe')](_0x56cc('0xf'),_0x1cacb7,_0x56cc('0x16'));_0x49f21d(_0x9376d7[_0x56cc('0x17')]['message']);}})['catch'](function(_0x25cc4c){logger[_0x56cc('0x13')](_0x56cc('0xf'),_0x1cacb7,_0x25cc4c);_0x30ebed(_0x25cc4c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index dccbcf9..6a2a5de 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 _0x24ca=['/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x2147eb,_0x440352){var _0x3c6434=function(_0x11c174){while(--_0x11c174){_0x2147eb['push'](_0x2147eb['shift']());}};_0x3c6434(++_0x440352);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x24ca[_0x3816c2];return _0x144669;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xb')]);router[_0xa24c('0x9')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller['show']);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xe')]);router['put'](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller[_0xa24c('0x11')]);module[_0xa24c('0x12')]=router; \ No newline at end of file +var _0x95f4=['exports','multer','util','path','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated','update','destroy'];(function(_0x495337,_0x48e1c1){var _0x1594c3=function(_0x1c6be9){while(--_0x1c6be9){_0x495337['push'](_0x495337['shift']());}};_0x1594c3(++_0x48e1c1);}(_0x95f4,0xf1));var _0x495f=function(_0x1bf684,_0x1d461c){_0x1bf684=_0x1bf684-0x0;var _0x39b7aa=_0x95f4[_0x1bf684];return _0x39b7aa;};'use strict';var multer=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var path=require(_0x495f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x495f('0x3')]();var fs_extra=require(_0x495f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x495f('0x5'));var controller=require(_0x495f('0x6'));router[_0x495f('0x7')]('/',auth['isAuthenticated'](),controller[_0x495f('0x8')]);router[_0x495f('0x7')](_0x495f('0x9'),auth['isAuthenticated'](),controller[_0x495f('0xa')]);router[_0x495f('0xb')]('/',auth[_0x495f('0xc')](),controller['create']);router['put'](_0x495f('0x9'),auth['isAuthenticated'](),controller[_0x495f('0xd')]);router['delete'](_0x495f('0x9'),auth[_0x495f('0xc')](),controller[_0x495f('0xe')]);module[_0x495f('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 8450d69..9df2db8 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 _0x53b5=['exports','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53b5,0xd3));var _0x553b=function(_0xec6f95,_0x3e82b6){_0xec6f95=_0xec6f95-0x0;var _0x63904f=_0x53b5[_0xec6f95];return _0x63904f;};'use strict';var Sequelize=require(_0x553b('0x0'));module[_0x553b('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x6c38=['exports','TEXT','sequelize'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x6c38,0x8f));var _0x86c3=function(_0x3704d2,_0x180599){_0x3704d2=_0x3704d2-0x0;var _0x47301a=_0x6c38[_0x3704d2];return _0x47301a;};'use strict';var Sequelize=require(_0x86c3('0x0'));module[_0x86c3('0x1')]={'tree':{'type':Sequelize[_0x86c3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 86139f3..49b3096 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 _0x6b21=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6b21,0x1db));var _0x16b2=function(_0x1e3d48,_0x4f4593){_0x1e3d48=_0x1e3d48-0x0;var _0x19b49d=_0x6b21[_0x1e3d48];return _0x19b49d;};'use strict';var emlformat=require(_0x16b2('0x0'));var rimraf=require(_0x16b2('0x1'));var zipdir=require(_0x16b2('0x2'));var jsonpatch=require(_0x16b2('0x3'));var rp=require(_0x16b2('0x4'));var moment=require('moment');var BPromise=require(_0x16b2('0x5'));var Mustache=require(_0x16b2('0x6'));var util=require(_0x16b2('0x7'));var path=require(_0x16b2('0x8'));var sox=require('sox');var csv=require(_0x16b2('0x9'));var ejs=require(_0x16b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16b2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x16b2('0xc'));var toCsv=require(_0x16b2('0x9'));var querystring=require(_0x16b2('0xd'));var Papa=require(_0x16b2('0xe'));var Redis=require(_0x16b2('0xf'));var authService=require(_0x16b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16b2('0x11'));var logger=require(_0x16b2('0x12'))('api');var utils=require(_0x16b2('0x13'));var config=require(_0x16b2('0x14'));var licenseUtil=require(_0x16b2('0x15'));var db=require(_0x16b2('0x16'))['db'];function respondWithStatusCode(_0x21b6a9,_0xa99bd5){_0xa99bd5=_0xa99bd5||0xcc;return function(_0x32819f){if(_0x32819f){return _0x21b6a9['sendStatus'](_0xa99bd5);}return _0x21b6a9['status'](_0xa99bd5)[_0x16b2('0x17')]();};}function respondWithResult(_0x4fdc4,_0x1606fc){_0x1606fc=_0x1606fc||0xc8;return function(_0x5acda2){if(_0x5acda2){return _0x4fdc4[_0x16b2('0x18')](_0x1606fc)[_0x16b2('0x19')](_0x5acda2);}};}function respondWithFilteredResult(_0x480104,_0xc8e1){return function(_0x4ee53a){if(_0x4ee53a){var _0x252a08=typeof _0xc8e1[_0x16b2('0x1a')]===_0x16b2('0x1b')&&typeof _0xc8e1['limit']===_0x16b2('0x1b');var _0x583259=_0x4ee53a[_0x16b2('0x1c')];var _0x2bf706=_0x252a08?0x0:_0xc8e1['offset'];var _0x2c91d9=_0x252a08?_0x4ee53a[_0x16b2('0x1c')]:_0xc8e1[_0x16b2('0x1a')]+_0xc8e1[_0x16b2('0x1d')];var _0x837d4b;if(_0x2c91d9>=_0x583259){_0x2c91d9=_0x583259;_0x837d4b=0xc8;}else{_0x837d4b=0xce;}_0x480104[_0x16b2('0x18')](_0x837d4b);return _0x480104['set'](_0x16b2('0x1e'),_0x2bf706+'-'+_0x2c91d9+'/'+_0x583259)[_0x16b2('0x19')](_0x4ee53a);}return null;};}function patchUpdates(_0x504cae){return function(_0x3b95dc){try{jsonpatch[_0x16b2('0x1f')](_0x3b95dc,_0x504cae,!![]);}catch(_0x16ae64){return BPromise[_0x16b2('0x20')](_0x16ae64);}return _0x3b95dc[_0x16b2('0x21')]();};}function saveUpdates(_0x333530,_0x4a2a8c){return function(_0xbdb1fd){if(_0xbdb1fd){return _0xbdb1fd[_0x16b2('0x22')](_0x333530)['then'](function(_0x28c06b){return _0x28c06b;});}return null;};}function removeEntity(_0x1b3829,_0x40fe27){return function(_0x57aa5a){if(_0x57aa5a){return _0x57aa5a[_0x16b2('0x23')]()[_0x16b2('0x24')](function(){_0x1b3829[_0x16b2('0x18')](0xcc)[_0x16b2('0x17')]();});}};}function handleEntityNotFound(_0x28a879,_0x35eec1){return function(_0x579dec){if(!_0x579dec){_0x28a879[_0x16b2('0x25')](0x194);}return _0x579dec;};}function handleError(_0x54257d,_0x4b24a0){_0x4b24a0=_0x4b24a0||0x1f4;return function(_0x11b293){logger[_0x16b2('0x26')](_0x11b293['stack']);if(_0x11b293[_0x16b2('0x27')]){delete _0x11b293[_0x16b2('0x27')];}_0x54257d[_0x16b2('0x18')](_0x4b24a0)[_0x16b2('0x28')](_0x11b293);};}exports[_0x16b2('0x29')]=function(_0x38c184,_0x2d5b42){var _0x72a8c0={},_0x5e1eee={},_0x436f0b={'count':0x0,'rows':[]};var _0x1a25fd=_[_0x16b2('0x2a')](db[_0x16b2('0x2b')][_0x16b2('0x2c')],function(_0x3b99b8){return{'name':_0x3b99b8['fieldName'],'type':_0x3b99b8[_0x16b2('0x2d')][_0x16b2('0x2e')]};});_0x5e1eee[_0x16b2('0x2f')]=_[_0x16b2('0x2a')](_0x1a25fd,_0x16b2('0x27'));_0x5e1eee[_0x16b2('0x30')]=_[_0x16b2('0x31')](_0x38c184['query']);_0x5e1eee['filters']=_['intersection'](_0x5e1eee['model'],_0x5e1eee[_0x16b2('0x30')]);_0x72a8c0[_0x16b2('0x32')]=_[_0x16b2('0x33')](_0x5e1eee[_0x16b2('0x2f')],qs[_0x16b2('0x34')](_0x38c184[_0x16b2('0x30')][_0x16b2('0x34')]));_0x72a8c0[_0x16b2('0x32')]=_0x72a8c0[_0x16b2('0x32')]['length']?_0x72a8c0[_0x16b2('0x32')]:_0x5e1eee[_0x16b2('0x2f')];if(!_0x38c184[_0x16b2('0x30')][_0x16b2('0x35')](_0x16b2('0x36'))){_0x72a8c0[_0x16b2('0x1d')]=qs[_0x16b2('0x1d')](_0x38c184[_0x16b2('0x30')][_0x16b2('0x1d')]);_0x72a8c0[_0x16b2('0x1a')]=qs['offset'](_0x38c184[_0x16b2('0x30')][_0x16b2('0x1a')]);}_0x72a8c0['order']=qs[_0x16b2('0x37')](_0x38c184['query'][_0x16b2('0x37')]);_0x72a8c0[_0x16b2('0x38')]=qs[_0x16b2('0x39')](_['pick'](_0x38c184[_0x16b2('0x30')],_0x5e1eee[_0x16b2('0x39')]),_0x1a25fd);if(_0x38c184['query'][_0x16b2('0x3a')]){_0x72a8c0[_0x16b2('0x38')]=_[_0x16b2('0x3b')](_0x72a8c0[_0x16b2('0x38')],{'$or':_[_0x16b2('0x2a')](_0x1a25fd,function(_0x49325f){if(_0x49325f[_0x16b2('0x2d')]!==_0x16b2('0x3c')){var _0x16b3d7={};_0x16b3d7[_0x49325f[_0x16b2('0x27')]]={'$like':'%'+_0x38c184['query'][_0x16b2('0x3a')]+'%'};return _0x16b3d7;}})});}_0x72a8c0=_[_0x16b2('0x3b')]({},_0x72a8c0,_0x38c184[_0x16b2('0x3d')]);var _0xf6304d={'where':_0x72a8c0['where']};return db[_0x16b2('0x2b')][_0x16b2('0x1c')](_0xf6304d)[_0x16b2('0x24')](function(_0x5a9fcd){_0x436f0b[_0x16b2('0x1c')]=_0x5a9fcd;if(_0x38c184[_0x16b2('0x30')][_0x16b2('0x3e')]){_0x72a8c0[_0x16b2('0x3f')]=[{'all':!![]}];}return db[_0x16b2('0x2b')][_0x16b2('0x40')](_0x72a8c0);})[_0x16b2('0x24')](function(_0x19f507){_0x436f0b['rows']=_0x19f507;return _0x436f0b;})['then'](respondWithFilteredResult(_0x2d5b42,_0x72a8c0))['catch'](handleError(_0x2d5b42,null));};exports[_0x16b2('0x41')]=function(_0xedbb18,_0x1dbd5a){var _0x172058={'raw':!![],'where':{'id':_0xedbb18[_0x16b2('0x42')]['id']}},_0x2bdaed={};_0x2bdaed[_0x16b2('0x2f')]=_[_0x16b2('0x31')](db[_0x16b2('0x2b')][_0x16b2('0x2c')]);_0x2bdaed[_0x16b2('0x30')]=_[_0x16b2('0x31')](_0xedbb18[_0x16b2('0x30')]);_0x2bdaed['filters']=_['intersection'](_0x2bdaed[_0x16b2('0x2f')],_0x2bdaed[_0x16b2('0x30')]);_0x172058['attributes']=_[_0x16b2('0x33')](_0x2bdaed['model'],qs[_0x16b2('0x34')](_0xedbb18['query'][_0x16b2('0x34')]));_0x172058[_0x16b2('0x32')]=_0x172058[_0x16b2('0x32')]['length']?_0x172058[_0x16b2('0x32')]:_0x2bdaed[_0x16b2('0x2f')];if(_0xedbb18[_0x16b2('0x30')][_0x16b2('0x3e')]){_0x172058[_0x16b2('0x3f')]=[{'all':!![]}];}_0x172058=_[_0x16b2('0x3b')]({},_0x172058,_0xedbb18['options']);return db[_0x16b2('0x2b')][_0x16b2('0x43')](_0x172058)[_0x16b2('0x24')](handleEntityNotFound(_0x1dbd5a,null))[_0x16b2('0x24')](respondWithResult(_0x1dbd5a,null))[_0x16b2('0x44')](handleError(_0x1dbd5a,null));};exports['create']=function(_0x193d00,_0x414298){return db[_0x16b2('0x2b')]['create'](_0x193d00['body'],{})[_0x16b2('0x24')](respondWithResult(_0x414298,0xc9))[_0x16b2('0x44')](handleError(_0x414298,null));};exports[_0x16b2('0x22')]=function(_0x5826fe,_0x34edab){if(_0x5826fe[_0x16b2('0x45')]['id']){delete _0x5826fe[_0x16b2('0x45')]['id'];}return db[_0x16b2('0x2b')][_0x16b2('0x43')]({'where':{'id':_0x5826fe['params']['id']}})[_0x16b2('0x24')](handleEntityNotFound(_0x34edab,null))[_0x16b2('0x24')](saveUpdates(_0x5826fe[_0x16b2('0x45')],null))['then'](respondWithResult(_0x34edab,null))[_0x16b2('0x44')](handleError(_0x34edab,null));};exports[_0x16b2('0x23')]=function(_0x32999d,_0x107815){return db[_0x16b2('0x2b')]['find']({'where':{'id':_0x32999d[_0x16b2('0x42')]['id']}})[_0x16b2('0x24')](handleEntityNotFound(_0x107815,null))[_0x16b2('0x24')](removeEntity(_0x107815,null))['catch'](handleError(_0x107815,null));}; \ No newline at end of file +var _0xe207=['body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create'];(function(_0x49d57a,_0x2fc11f){var _0x5316a0=function(_0x5ed573){while(--_0x5ed573){_0x49d57a['push'](_0x49d57a['shift']());}};_0x5316a0(++_0x2fc11f);}(_0xe207,0x1dc));var _0x7e20=function(_0x3e5766,_0x42ef6e){_0x3e5766=_0x3e5766-0x0;var _0x2fa83a=_0xe207[_0x3e5766];return _0x2fa83a;};'use strict';var emlformat=require(_0x7e20('0x0'));var rimraf=require(_0x7e20('0x1'));var zipdir=require(_0x7e20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e20('0x3'));var moment=require(_0x7e20('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e20('0x5'));var util=require(_0x7e20('0x6'));var path=require(_0x7e20('0x7'));var sox=require(_0x7e20('0x8'));var csv=require(_0x7e20('0x9'));var ejs=require(_0x7e20('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e20('0xb'));var crypto=require(_0x7e20('0xc'));var jsforce=require(_0x7e20('0xd'));var deskjs=require(_0x7e20('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7e20('0xf'));var Papa=require(_0x7e20('0x10'));var Redis=require(_0x7e20('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7e20('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e20('0x13'));var logger=require(_0x7e20('0x14'))(_0x7e20('0x15'));var utils=require(_0x7e20('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e20('0x17'));var db=require(_0x7e20('0x18'))['db'];function respondWithStatusCode(_0x6e72ba,_0x38084a){_0x38084a=_0x38084a||0xcc;return function(_0x433cb3){if(_0x433cb3){return _0x6e72ba[_0x7e20('0x19')](_0x38084a);}return _0x6e72ba[_0x7e20('0x1a')](_0x38084a)[_0x7e20('0x1b')]();};}function respondWithResult(_0x3390a3,_0x481075){_0x481075=_0x481075||0xc8;return function(_0xa9e3f3){if(_0xa9e3f3){return _0x3390a3[_0x7e20('0x1a')](_0x481075)[_0x7e20('0x1c')](_0xa9e3f3);}};}function respondWithFilteredResult(_0x44f508,_0x2f841a){return function(_0x2853a3){if(_0x2853a3){var _0x29bbf0=typeof _0x2f841a['offset']==='undefined'&&typeof _0x2f841a[_0x7e20('0x1d')]===_0x7e20('0x1e');var _0x3dd019=_0x2853a3[_0x7e20('0x1f')];var _0x28d754=_0x29bbf0?0x0:_0x2f841a[_0x7e20('0x20')];var _0x5dfe5d=_0x29bbf0?_0x2853a3[_0x7e20('0x1f')]:_0x2f841a['offset']+_0x2f841a[_0x7e20('0x1d')];var _0x395dc0;if(_0x5dfe5d>=_0x3dd019){_0x5dfe5d=_0x3dd019;_0x395dc0=0xc8;}else{_0x395dc0=0xce;}_0x44f508[_0x7e20('0x1a')](_0x395dc0);return _0x44f508[_0x7e20('0x21')](_0x7e20('0x22'),_0x28d754+'-'+_0x5dfe5d+'/'+_0x3dd019)[_0x7e20('0x1c')](_0x2853a3);}return null;};}function patchUpdates(_0x58b69d){return function(_0x165abb){try{jsonpatch[_0x7e20('0x23')](_0x165abb,_0x58b69d,!![]);}catch(_0x40df1f){return BPromise['reject'](_0x40df1f);}return _0x165abb[_0x7e20('0x24')]();};}function saveUpdates(_0x338a30,_0x1cb7b1){return function(_0x2a0e21){if(_0x2a0e21){return _0x2a0e21[_0x7e20('0x25')](_0x338a30)[_0x7e20('0x26')](function(_0xf61170){return _0xf61170;});}return null;};}function removeEntity(_0x1c3820,_0x28574e){return function(_0x4aff0f){if(_0x4aff0f){return _0x4aff0f['destroy']()['then'](function(){_0x1c3820[_0x7e20('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x472cf5,_0x1e93f0){return function(_0x4bff3a){if(!_0x4bff3a){_0x472cf5[_0x7e20('0x19')](0x194);}return _0x4bff3a;};}function handleError(_0x1760ff,_0x5e2aa0){_0x5e2aa0=_0x5e2aa0||0x1f4;return function(_0xe808d1){logger[_0x7e20('0x27')](_0xe808d1[_0x7e20('0x28')]);if(_0xe808d1[_0x7e20('0x29')]){delete _0xe808d1['name'];}_0x1760ff[_0x7e20('0x1a')](_0x5e2aa0)[_0x7e20('0x2a')](_0xe808d1);};}exports[_0x7e20('0x2b')]=function(_0x4266e7,_0x4a8a4c){var _0x5c6783={},_0x2887e1={},_0x2a18f0={'count':0x0,'rows':[]};var _0xaa3b1b=_[_0x7e20('0x2c')](db[_0x7e20('0x2d')][_0x7e20('0x2e')],function(_0x5cf032){return{'name':_0x5cf032[_0x7e20('0x2f')],'type':_0x5cf032[_0x7e20('0x30')][_0x7e20('0x31')]};});_0x2887e1[_0x7e20('0x32')]=_[_0x7e20('0x2c')](_0xaa3b1b,'name');_0x2887e1[_0x7e20('0x33')]=_[_0x7e20('0x34')](_0x4266e7[_0x7e20('0x33')]);_0x2887e1[_0x7e20('0x35')]=_[_0x7e20('0x36')](_0x2887e1[_0x7e20('0x32')],_0x2887e1[_0x7e20('0x33')]);_0x5c6783[_0x7e20('0x37')]=_[_0x7e20('0x36')](_0x2887e1['model'],qs['fields'](_0x4266e7['query']['fields']));_0x5c6783[_0x7e20('0x37')]=_0x5c6783[_0x7e20('0x37')][_0x7e20('0x38')]?_0x5c6783[_0x7e20('0x37')]:_0x2887e1[_0x7e20('0x32')];if(!_0x4266e7[_0x7e20('0x33')][_0x7e20('0x39')](_0x7e20('0x3a'))){_0x5c6783[_0x7e20('0x1d')]=qs[_0x7e20('0x1d')](_0x4266e7[_0x7e20('0x33')]['limit']);_0x5c6783['offset']=qs[_0x7e20('0x20')](_0x4266e7[_0x7e20('0x33')][_0x7e20('0x20')]);}_0x5c6783[_0x7e20('0x3b')]=qs[_0x7e20('0x3c')](_0x4266e7[_0x7e20('0x33')]['sort']);_0x5c6783[_0x7e20('0x3d')]=qs[_0x7e20('0x35')](_[_0x7e20('0x3e')](_0x4266e7[_0x7e20('0x33')],_0x2887e1[_0x7e20('0x35')]),_0xaa3b1b);if(_0x4266e7['query'][_0x7e20('0x3f')]){_0x5c6783[_0x7e20('0x3d')]=_['merge'](_0x5c6783[_0x7e20('0x3d')],{'$or':_[_0x7e20('0x2c')](_0xaa3b1b,function(_0x4e04ec){if(_0x4e04ec[_0x7e20('0x30')]!==_0x7e20('0x40')){var _0x5d96d9={};_0x5d96d9[_0x4e04ec[_0x7e20('0x29')]]={'$like':'%'+_0x4266e7[_0x7e20('0x33')]['filter']+'%'};return _0x5d96d9;}})});}_0x5c6783=_[_0x7e20('0x41')]({},_0x5c6783,_0x4266e7[_0x7e20('0x42')]);var _0x15a82b={'where':_0x5c6783[_0x7e20('0x3d')]};return db['AnalyticTreeReport']['count'](_0x15a82b)[_0x7e20('0x26')](function(_0x15dcc2){_0x2a18f0[_0x7e20('0x1f')]=_0x15dcc2;if(_0x4266e7[_0x7e20('0x33')][_0x7e20('0x43')]){_0x5c6783[_0x7e20('0x44')]=[{'all':!![]}];}return db[_0x7e20('0x2d')][_0x7e20('0x45')](_0x5c6783);})[_0x7e20('0x26')](function(_0x3e4979){_0x2a18f0[_0x7e20('0x46')]=_0x3e4979;return _0x2a18f0;})[_0x7e20('0x26')](respondWithFilteredResult(_0x4a8a4c,_0x5c6783))[_0x7e20('0x47')](handleError(_0x4a8a4c,null));};exports[_0x7e20('0x48')]=function(_0x35826c,_0x3c585a){var _0xe8be2d={'raw':!![],'where':{'id':_0x35826c[_0x7e20('0x49')]['id']}},_0x2d2dd9={};_0x2d2dd9[_0x7e20('0x32')]=_[_0x7e20('0x34')](db[_0x7e20('0x2d')][_0x7e20('0x2e')]);_0x2d2dd9[_0x7e20('0x33')]=_[_0x7e20('0x34')](_0x35826c[_0x7e20('0x33')]);_0x2d2dd9['filters']=_[_0x7e20('0x36')](_0x2d2dd9[_0x7e20('0x32')],_0x2d2dd9['query']);_0xe8be2d['attributes']=_[_0x7e20('0x36')](_0x2d2dd9['model'],qs[_0x7e20('0x4a')](_0x35826c[_0x7e20('0x33')][_0x7e20('0x4a')]));_0xe8be2d[_0x7e20('0x37')]=_0xe8be2d[_0x7e20('0x37')]['length']?_0xe8be2d[_0x7e20('0x37')]:_0x2d2dd9[_0x7e20('0x32')];if(_0x35826c['query']['includeAll']){_0xe8be2d[_0x7e20('0x44')]=[{'all':!![]}];}_0xe8be2d=_[_0x7e20('0x41')]({},_0xe8be2d,_0x35826c[_0x7e20('0x42')]);return db[_0x7e20('0x2d')][_0x7e20('0x4b')](_0xe8be2d)[_0x7e20('0x26')](handleEntityNotFound(_0x3c585a,null))[_0x7e20('0x26')](respondWithResult(_0x3c585a,null))[_0x7e20('0x47')](handleError(_0x3c585a,null));};exports[_0x7e20('0x4c')]=function(_0x563371,_0x4ff191){return db[_0x7e20('0x2d')][_0x7e20('0x4c')](_0x563371[_0x7e20('0x4d')],{})[_0x7e20('0x26')](respondWithResult(_0x4ff191,0xc9))[_0x7e20('0x47')](handleError(_0x4ff191,null));};exports['update']=function(_0x3ce02d,_0x3debcd){if(_0x3ce02d[_0x7e20('0x4d')]['id']){delete _0x3ce02d[_0x7e20('0x4d')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x3ce02d['params']['id']}})[_0x7e20('0x26')](handleEntityNotFound(_0x3debcd,null))[_0x7e20('0x26')](saveUpdates(_0x3ce02d[_0x7e20('0x4d')],null))['then'](respondWithResult(_0x3debcd,null))[_0x7e20('0x47')](handleError(_0x3debcd,null));};exports[_0x7e20('0x4e')]=function(_0x58e434,_0x1ef13){return db['AnalyticTreeReport'][_0x7e20('0x4b')]({'where':{'id':_0x58e434[_0x7e20('0x49')]['id']}})[_0x7e20('0x26')](handleEntityNotFound(_0x1ef13,null))[_0x7e20('0x26')](removeEntity(_0x1ef13,null))[_0x7e20('0x47')](handleError(_0x1ef13,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 6318d6c..69960a1 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 _0x2207=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x2207,0x1c1));var _0x7220=function(_0x3806e2,_0x31b0b4){_0x3806e2=_0x3806e2-0x0;var _0x13fcaf=_0x2207[_0x3806e2];return _0x13fcaf;};'use strict';var _=require(_0x7220('0x0'));var util=require('util');var logger=require(_0x7220('0x1'))(_0x7220('0x2'));var moment=require(_0x7220('0x3'));var BPromise=require(_0x7220('0x4'));var rp=require(_0x7220('0x5'));var fs=require('fs');var path=require(_0x7220('0x6'));var rimraf=require(_0x7220('0x7'));var config=require(_0x7220('0x8'));var attributes=require(_0x7220('0x9'));module[_0x7220('0xa')]=function(_0x4e1111,_0x491eab){return _0x4e1111[_0x7220('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x7220('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6426=['exports','analytics_report_trees','lodash','moment','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x1f40ab,_0x453500){var _0x14ae0e=function(_0x41904a){while(--_0x41904a){_0x1f40ab['push'](_0x1f40ab['shift']());}};_0x14ae0e(++_0x453500);}(_0x6426,0x13d));var _0x6642=function(_0x34b3cf,_0x56b2b4){_0x34b3cf=_0x34b3cf-0x0;var _0x14e21=_0x6426[_0x34b3cf];return _0x14e21;};'use strict';var _=require(_0x6642('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6642('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6642('0x2'));var config=require(_0x6642('0x3'));var attributes=require(_0x6642('0x4'));module[_0x6642('0x5')]=function(_0x4a834a,_0x511282){return _0x4a834a['define']('AnalyticTreeReport',attributes,{'tableName':_0x6642('0x6'),'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 b619158..42cbdbd 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xadb5,0xad));var _0x5adb=function(_0x4c19ae,_0x48126f){_0x4c19ae=_0x4c19ae-0x0;var _0x694a18=_0xadb5[_0x4c19ae];return _0x694a18;};'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']('AnalyticTreeReport,\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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x555583,_0x58df45){_0x555583=_0x555583-0x0;var _0x12b553=_0x7a54[_0x555583];return _0x12b553;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index fae0261..6cad0e8 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 _0x1f5f=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id'];(function(_0x5bb206,_0xcf25a1){var _0x353569=function(_0xd16135){while(--_0xd16135){_0x5bb206['push'](_0x5bb206['shift']());}};_0x353569(++_0xcf25a1);}(_0x1f5f,0x182));var _0xf1f5=function(_0x525148,_0x5d34c0){_0x525148=_0x525148-0x0;var _0x497d88=_0x1f5f[_0x525148];return _0x497d88;};'use strict';var multer=require(_0xf1f5('0x0'));var util=require(_0xf1f5('0x1'));var path=require(_0xf1f5('0x2'));var timeout=require(_0xf1f5('0x3'));var express=require(_0xf1f5('0x4'));var router=express[_0xf1f5('0x5')]();var fs_extra=require(_0xf1f5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf1f5('0x7'));var config=require(_0xf1f5('0x8'));var controller=require(_0xf1f5('0x9'));router[_0xf1f5('0xa')]('/',auth[_0xf1f5('0xb')](),controller['index']);router[_0xf1f5('0xa')](_0xf1f5('0xc'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0xd')]);router[_0xf1f5('0xe')]('/',auth['isAuthenticated'](),controller[_0xf1f5('0xf')]);router[_0xf1f5('0x10')](_0xf1f5('0xc'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0x11')]);router[_0xf1f5('0x12')]('/:id',auth[_0xf1f5('0xb')](),controller[_0xf1f5('0x13')]);module[_0xf1f5('0x14')]=router; \ No newline at end of file +var _0x044e=['destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','create','put','update','delete'];(function(_0x206c64,_0x484424){var _0x4651a6=function(_0x1710a4){while(--_0x1710a4){_0x206c64['push'](_0x206c64['shift']());}};_0x4651a6(++_0x484424);}(_0x044e,0x1a1));var _0xe044=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x044e[_0x329437];return _0x3789d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe044('0x0'));var timeout=require(_0xe044('0x1'));var express=require(_0xe044('0x2'));var router=express['Router']();var fs_extra=require(_0xe044('0x3'));var auth=require(_0xe044('0x4'));var interaction=require(_0xe044('0x5'));var config=require(_0xe044('0x6'));var controller=require(_0xe044('0x7'));router[_0xe044('0x8')]('/',auth[_0xe044('0x9')](),controller['index']);router[_0xe044('0x8')](_0xe044('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe044('0x9')](),controller[_0xe044('0xb')]);router[_0xe044('0xc')](_0xe044('0xa'),auth['isAuthenticated'](),controller[_0xe044('0xd')]);router[_0xe044('0xe')](_0xe044('0xa'),auth[_0xe044('0x9')](),controller[_0xe044('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 9156b67..31b37c1 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 _0x19ea=['sequelize','STRING'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x19ea,0xfe));var _0xa19e=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x19ea[_0x34bc6c];return _0x168820;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa19e('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x12c9=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12c9,0x1c9));var _0x912c=function(_0x36af4a,_0x207d0a){_0x36af4a=_0x36af4a-0x0;var _0x2d54d4=_0x12c9[_0x36af4a];return _0x2d54d4;};'use strict';var Sequelize=require(_0x912c('0x0'));module[_0x912c('0x1')]={'name':{'type':Sequelize[_0x912c('0x2')]},'basename':{'type':Sequelize[_0x912c('0x2')]},'type':{'type':Sequelize[_0x912c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 5fa4464..efef7a7 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 _0xef51=['ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','error','stack','send','index','map','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','Attachment','findAll','rows','catch','keys','find','params','rawAttributes','include','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','findOne'];(function(_0x89be1c,_0x1bfcaa){var _0x567694=function(_0x45b733){while(--_0x45b733){_0x89be1c['push'](_0x89be1c['shift']());}};_0x567694(++_0x1bfcaa);}(_0xef51,0x155));var _0x1ef5=function(_0x110479,_0x492d7b){_0x110479=_0x110479-0x0;var _0x55335=_0xef51[_0x110479];return _0x55335;};'use strict';var emlformat=require(_0x1ef5('0x0'));var rimraf=require(_0x1ef5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ef5('0x2'));var rp=require('request-promise');var moment=require(_0x1ef5('0x3'));var BPromise=require(_0x1ef5('0x4'));var Mustache=require(_0x1ef5('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1ef5('0x6'));var csv=require(_0x1ef5('0x7'));var ejs=require(_0x1ef5('0x8'));var fs=require('fs');var fs_extra=require(_0x1ef5('0x9'));var _=require(_0x1ef5('0xa'));var squel=require(_0x1ef5('0xb'));var crypto=require('crypto');var jsforce=require(_0x1ef5('0xc'));var deskjs=require(_0x1ef5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1ef5('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ef5('0xf'));var authService=require(_0x1ef5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1ef5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ef5('0x12'))(_0x1ef5('0x13'));var utils=require(_0x1ef5('0x14'));var config=require(_0x1ef5('0x15'));var licenseUtil=require(_0x1ef5('0x16'));var db=require(_0x1ef5('0x17'))['db'];function respondWithStatusCode(_0x439c07,_0x160ba9){_0x160ba9=_0x160ba9||0xcc;return function(_0x4c27d6){if(_0x4c27d6){return _0x439c07['sendStatus'](_0x160ba9);}return _0x439c07[_0x1ef5('0x18')](_0x160ba9)['end']();};}function respondWithResult(_0xc2020b,_0x77ed0c){_0x77ed0c=_0x77ed0c||0xc8;return function(_0xec40d0){if(_0xec40d0){return _0xc2020b['status'](_0x77ed0c)['json'](_0xec40d0);}};}function respondWithFilteredResult(_0x4fcf42,_0x33fe85){return function(_0x272955){if(_0x272955){var _0x27414b=typeof _0x33fe85[_0x1ef5('0x19')]===_0x1ef5('0x1a')&&typeof _0x33fe85[_0x1ef5('0x1b')]==='undefined';var _0x3b4908=_0x272955[_0x1ef5('0x1c')];var _0x4cc974=_0x27414b?0x0:_0x33fe85[_0x1ef5('0x19')];var _0x563b61=_0x27414b?_0x272955['count']:_0x33fe85[_0x1ef5('0x19')]+_0x33fe85['limit'];var _0xd5b977;if(_0x563b61>=_0x3b4908){_0x563b61=_0x3b4908;_0xd5b977=0xc8;}else{_0xd5b977=0xce;}_0x4fcf42['status'](_0xd5b977);return _0x4fcf42[_0x1ef5('0x1d')](_0x1ef5('0x1e'),_0x4cc974+'-'+_0x563b61+'/'+_0x3b4908)[_0x1ef5('0x1f')](_0x272955);}return null;};}function patchUpdates(_0x39bcb5){return function(_0x96e4d6){try{jsonpatch[_0x1ef5('0x20')](_0x96e4d6,_0x39bcb5,!![]);}catch(_0x5698a2){return BPromise[_0x1ef5('0x21')](_0x5698a2);}return _0x96e4d6['save']();};}function saveUpdates(_0x2d8b58,_0x13310d){return function(_0x49e163){if(_0x49e163){return _0x49e163['update'](_0x2d8b58)['then'](function(_0x2caf33){return _0x2caf33;});}return null;};}function removeEntity(_0x4d4fdf,_0x11549e){return function(_0x32d774){if(_0x32d774){return _0x32d774['destroy']()[_0x1ef5('0x22')](function(){_0x4d4fdf[_0x1ef5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x140f6c,_0x167915){return function(_0x1c26c2){if(!_0x1c26c2){_0x140f6c['sendStatus'](0x194);}return _0x1c26c2;};}function handleError(_0x5a77e5,_0xc18885){_0xc18885=_0xc18885||0x1f4;return function(_0x40d715){logger[_0x1ef5('0x23')](_0x40d715[_0x1ef5('0x24')]);if(_0x40d715['name']){delete _0x40d715['name'];}_0x5a77e5[_0x1ef5('0x18')](_0xc18885)[_0x1ef5('0x25')](_0x40d715);};}exports[_0x1ef5('0x26')]=function(_0x370496,_0x2fc73a){var _0x41145b={},_0x433989={},_0x212870={'count':0x0,'rows':[]};var _0x2b6bd=_[_0x1ef5('0x27')](db['Attachment']['rawAttributes'],function(_0x26f6af){return{'name':_0x26f6af[_0x1ef5('0x28')],'type':_0x26f6af[_0x1ef5('0x29')]['key']};});_0x433989[_0x1ef5('0x2a')]=_[_0x1ef5('0x27')](_0x2b6bd,_0x1ef5('0x2b'));_0x433989[_0x1ef5('0x2c')]=_['keys'](_0x370496[_0x1ef5('0x2c')]);_0x433989[_0x1ef5('0x2d')]=_[_0x1ef5('0x2e')](_0x433989[_0x1ef5('0x2a')],_0x433989[_0x1ef5('0x2c')]);_0x41145b[_0x1ef5('0x2f')]=_[_0x1ef5('0x2e')](_0x433989['model'],qs[_0x1ef5('0x30')](_0x370496['query'][_0x1ef5('0x30')]));_0x41145b[_0x1ef5('0x2f')]=_0x41145b[_0x1ef5('0x2f')][_0x1ef5('0x31')]?_0x41145b[_0x1ef5('0x2f')]:_0x433989['model'];if(!_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x32')](_0x1ef5('0x33'))){_0x41145b[_0x1ef5('0x1b')]=qs[_0x1ef5('0x1b')](_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x1b')]);_0x41145b[_0x1ef5('0x19')]=qs['offset'](_0x370496['query']['offset']);}_0x41145b['order']=qs[_0x1ef5('0x34')](_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x34')]);_0x41145b[_0x1ef5('0x35')]=qs[_0x1ef5('0x2d')](_[_0x1ef5('0x36')](_0x370496['query'],_0x433989[_0x1ef5('0x2d')]),_0x2b6bd);if(_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x37')]){_0x41145b['where']=_[_0x1ef5('0x38')](_0x41145b[_0x1ef5('0x35')],{'$or':_['map'](_0x2b6bd,function(_0x18c809){if(_0x18c809['type']!==_0x1ef5('0x39')){var _0x327db4={};_0x327db4[_0x18c809[_0x1ef5('0x2b')]]={'$like':'%'+_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x37')]+'%'};return _0x327db4;}})});}_0x41145b=_['merge']({},_0x41145b,_0x370496['options']);var _0x31881e={'where':_0x41145b['where']};return db['Attachment'][_0x1ef5('0x1c')](_0x31881e)[_0x1ef5('0x22')](function(_0x1ac7b5){_0x212870['count']=_0x1ac7b5;if(_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x3a')]){_0x41145b['include']=[{'all':!![]}];}return db[_0x1ef5('0x3b')][_0x1ef5('0x3c')](_0x41145b);})[_0x1ef5('0x22')](function(_0x1d7f34){_0x212870[_0x1ef5('0x3d')]=_0x1d7f34;return _0x212870;})['then'](respondWithFilteredResult(_0x2fc73a,_0x41145b))[_0x1ef5('0x3e')](handleError(_0x2fc73a,null));};exports['show']=function(_0x1170ea,_0x6bda44){var _0x42889f={'raw':!![],'where':{'id':_0x1170ea['params']['id']}},_0x1c539a={};_0x1c539a[_0x1ef5('0x2a')]=_['keys'](db[_0x1ef5('0x3b')]['rawAttributes']);_0x1c539a[_0x1ef5('0x2c')]=_[_0x1ef5('0x3f')](_0x1170ea[_0x1ef5('0x2c')]);_0x1c539a[_0x1ef5('0x2d')]=_['intersection'](_0x1c539a[_0x1ef5('0x2a')],_0x1c539a['query']);_0x42889f[_0x1ef5('0x2f')]=_[_0x1ef5('0x2e')](_0x1c539a[_0x1ef5('0x2a')],qs[_0x1ef5('0x30')](_0x1170ea[_0x1ef5('0x2c')]['fields']));_0x42889f[_0x1ef5('0x2f')]=_0x42889f['attributes']['length']?_0x42889f[_0x1ef5('0x2f')]:_0x1c539a['model'];if(_0x1170ea['query'][_0x1ef5('0x3a')]){_0x42889f['include']=[{'all':!![]}];}_0x42889f=_[_0x1ef5('0x38')]({},_0x42889f,_0x1170ea['options']);return db['Attachment'][_0x1ef5('0x40')](_0x42889f)[_0x1ef5('0x22')](handleEntityNotFound(_0x6bda44,null))[_0x1ef5('0x22')](respondWithResult(_0x6bda44,null))[_0x1ef5('0x3e')](handleError(_0x6bda44,null));};exports['clone']=function(_0x51c3c2,_0x2f219b){var _0x4127af={'where':{'id':_0x51c3c2[_0x1ef5('0x41')]['id']}},_0x5ed429={};_0x5ed429[_0x1ef5('0x2a')]=_[_0x1ef5('0x3f')](db[_0x1ef5('0x3b')][_0x1ef5('0x42')]);_0x4127af[_0x1ef5('0x2f')]=_[_0x1ef5('0x2e')](_0x5ed429['model'],qs[_0x1ef5('0x30')](_0x51c3c2[_0x1ef5('0x2c')][_0x1ef5('0x30')]));_0x4127af['attributes']=_0x4127af[_0x1ef5('0x2f')]['length']?_0x4127af[_0x1ef5('0x2f')]:_0x5ed429['model'];if(_0x51c3c2[_0x1ef5('0x2c')][_0x1ef5('0x3a')]){_0x4127af[_0x1ef5('0x43')]=[{'all':!![]}];}_0x4127af=_[_0x1ef5('0x38')]({},_0x4127af,_0x51c3c2['options']);return db[_0x1ef5('0x3b')]['find'](_0x4127af)[_0x1ef5('0x22')](handleEntityNotFound(_0x2f219b,null))[_0x1ef5('0x22')](function(_0x2912ef){if(_0x2912ef){var _0x526516=_0x2912ef[_0x1ef5('0x44')]({'plain':!![]});_0x526516=qs[_0x1ef5('0x45')](_0x526516,['id',_0x1ef5('0x46'),_0x1ef5('0x47')]);_0x51c3c2[_0x1ef5('0x48')]=_[_0x1ef5('0x45')](_0x51c3c2[_0x1ef5('0x48')],['id',_0x1ef5('0x46'),_0x1ef5('0x47')]);return db[_0x1ef5('0x3b')][_0x1ef5('0x49')](_[_0x1ef5('0x38')](_0x526516,_0x51c3c2['body']),{'include':_0x51c3c2[_0x1ef5('0x2c')][_0x1ef5('0x3a')]?[{'all':!![]}]:undefined});}})[_0x1ef5('0x22')](respondWithResult(_0x2f219b,0xc9))[_0x1ef5('0x3e')](handleError(_0x2f219b,null));};exports['update']=function(_0x597bc8,_0x4be03a){if(_0x597bc8[_0x1ef5('0x48')]['id']){delete _0x597bc8[_0x1ef5('0x48')]['id'];}return db[_0x1ef5('0x3b')][_0x1ef5('0x40')]({'where':{'id':_0x597bc8['params']['id']}})[_0x1ef5('0x22')](handleEntityNotFound(_0x4be03a,null))[_0x1ef5('0x22')](saveUpdates(_0x597bc8[_0x1ef5('0x48')],null))[_0x1ef5('0x22')](respondWithResult(_0x4be03a,null))[_0x1ef5('0x3e')](handleError(_0x4be03a,null));};exports['destroy']=function(_0x2344d3,_0x24a894){return db[_0x1ef5('0x3b')]['find']({'where':{'id':_0x2344d3[_0x1ef5('0x41')]['id']}})[_0x1ef5('0x22')](handleEntityNotFound(_0x24a894,null))[_0x1ef5('0x22')](removeEntity(_0x24a894,null))[_0x1ef5('0x3e')](handleError(_0x24a894,null));};exports[_0x1ef5('0x49')]=function(_0x363ec5,_0x279eae,_0x3d23d6){_0x363ec5[_0x1ef5('0x48')][_0x1ef5('0x2b')]=_0x363ec5[_0x1ef5('0x4a')]['originalname'];_0x363ec5[_0x1ef5('0x48')][_0x1ef5('0x4b')]=_0x363ec5[_0x1ef5('0x4a')][_0x1ef5('0x4c')];_0x363ec5[_0x1ef5('0x48')][_0x1ef5('0x29')]=_0x363ec5['file'][_0x1ef5('0x4d')];return db[_0x1ef5('0x3b')][_0x1ef5('0x49')](_0x363ec5[_0x1ef5('0x48')])[_0x1ef5('0x22')](respondWithResult(_0x279eae,0xc9))[_0x1ef5('0x3e')](handleError(_0x279eae,null));};exports['download']=function(_0x4f41db,_0x22bcee,_0x242f60){return db[_0x1ef5('0x3b')][_0x1ef5('0x4e')]({'where':{'id':_0x4f41db['params']['id']},'raw':!![]})[_0x1ef5('0x22')](handleEntityNotFound(_0x22bcee,null))[_0x1ef5('0x22')](function(_0x39bde9){if(_0x39bde9){var _0x4b03e4=_0x39bde9[_0x1ef5('0x4f')]!==null;var _0x508987=path[_0x1ef5('0x50')](config[_0x1ef5('0x51')],_0x1ef5('0x52'));if(_0x4b03e4){_0x508987=path[_0x1ef5('0x50')](_0x508987,_0x1ef5('0x53'));}var _0x37c9cf=path[_0x1ef5('0x50')](_0x508987,_0x39bde9[_0x1ef5('0x4b')]);return _0x22bcee['download'](_0x37c9cf);}})['catch'](handleError(_0x22bcee,null));}; \ No newline at end of file +var _0xd4a5=['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','undefined','offset','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','clone','get','omit','createdAt','body','updatedAt','create','update','file','originalname','basename','mimetype','download','findOne','join','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x547b2d,_0xfe6417){var _0xaecf99=function(_0x2a6e11){while(--_0x2a6e11){_0x547b2d['push'](_0x547b2d['shift']());}};_0xaecf99(++_0xfe6417);}(_0xd4a5,0x166));var _0x5d4a=function(_0x23fb54,_0x585c9e){_0x23fb54=_0x23fb54-0x0;var _0x3372d4=_0xd4a5[_0x23fb54];return _0x3372d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d4a('0x0'));var zipdir=require(_0x5d4a('0x1'));var jsonpatch=require(_0x5d4a('0x2'));var rp=require(_0x5d4a('0x3'));var moment=require('moment');var BPromise=require(_0x5d4a('0x4'));var Mustache=require('mustache');var util=require(_0x5d4a('0x5'));var path=require(_0x5d4a('0x6'));var sox=require(_0x5d4a('0x7'));var csv=require(_0x5d4a('0x8'));var ejs=require(_0x5d4a('0x9'));var fs=require('fs');var fs_extra=require(_0x5d4a('0xa'));var _=require(_0x5d4a('0xb'));var squel=require(_0x5d4a('0xc'));var crypto=require(_0x5d4a('0xd'));var jsforce=require(_0x5d4a('0xe'));var deskjs=require(_0x5d4a('0xf'));var toCsv=require(_0x5d4a('0x8'));var querystring=require(_0x5d4a('0x10'));var Papa=require(_0x5d4a('0x11'));var Redis=require(_0x5d4a('0x12'));var authService=require(_0x5d4a('0x13'));var qs=require(_0x5d4a('0x14'));var as=require(_0x5d4a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d4a('0x16'))(_0x5d4a('0x17'));var utils=require(_0x5d4a('0x18'));var config=require(_0x5d4a('0x19'));var licenseUtil=require(_0x5d4a('0x1a'));var db=require(_0x5d4a('0x1b'))['db'];function respondWithStatusCode(_0x5ae7c7,_0x59ae48){_0x59ae48=_0x59ae48||0xcc;return function(_0x2f26ce){if(_0x2f26ce){return _0x5ae7c7[_0x5d4a('0x1c')](_0x59ae48);}return _0x5ae7c7[_0x5d4a('0x1d')](_0x59ae48)[_0x5d4a('0x1e')]();};}function respondWithResult(_0x408ba3,_0x2cbe99){_0x2cbe99=_0x2cbe99||0xc8;return function(_0x246d10){if(_0x246d10){return _0x408ba3['status'](_0x2cbe99)[_0x5d4a('0x1f')](_0x246d10);}};}function respondWithFilteredResult(_0x432213,_0x1671a0){return function(_0x1770d0){if(_0x1770d0){var _0x35460c=typeof _0x1671a0['offset']==='undefined'&&typeof _0x1671a0['limit']===_0x5d4a('0x20');var _0x32d209=_0x1770d0['count'];var _0x51da13=_0x35460c?0x0:_0x1671a0[_0x5d4a('0x21')];var _0xae9138=_0x35460c?_0x1770d0[_0x5d4a('0x22')]:_0x1671a0[_0x5d4a('0x21')]+_0x1671a0[_0x5d4a('0x23')];var _0x2f7116;if(_0xae9138>=_0x32d209){_0xae9138=_0x32d209;_0x2f7116=0xc8;}else{_0x2f7116=0xce;}_0x432213[_0x5d4a('0x1d')](_0x2f7116);return _0x432213[_0x5d4a('0x24')](_0x5d4a('0x25'),_0x51da13+'-'+_0xae9138+'/'+_0x32d209)[_0x5d4a('0x1f')](_0x1770d0);}return null;};}function patchUpdates(_0x44ac23){return function(_0x556ab4){try{jsonpatch[_0x5d4a('0x26')](_0x556ab4,_0x44ac23,!![]);}catch(_0x119ba9){return BPromise[_0x5d4a('0x27')](_0x119ba9);}return _0x556ab4['save']();};}function saveUpdates(_0x1a35d6,_0x4aadce){return function(_0x8be507){if(_0x8be507){return _0x8be507['update'](_0x1a35d6)[_0x5d4a('0x28')](function(_0x1fd289){return _0x1fd289;});}return null;};}function removeEntity(_0x4aef08,_0x205a4e){return function(_0x50d714){if(_0x50d714){return _0x50d714[_0x5d4a('0x29')]()[_0x5d4a('0x28')](function(){_0x4aef08['status'](0xcc)[_0x5d4a('0x1e')]();});}};}function handleEntityNotFound(_0xa1bdeb,_0x1c8482){return function(_0x4c66cc){if(!_0x4c66cc){_0xa1bdeb[_0x5d4a('0x1c')](0x194);}return _0x4c66cc;};}function handleError(_0x4ff3a6,_0x2b7b81){_0x2b7b81=_0x2b7b81||0x1f4;return function(_0x25e032){logger[_0x5d4a('0x2a')](_0x25e032[_0x5d4a('0x2b')]);if(_0x25e032[_0x5d4a('0x2c')]){delete _0x25e032['name'];}_0x4ff3a6[_0x5d4a('0x1d')](_0x2b7b81)['send'](_0x25e032);};}exports[_0x5d4a('0x2d')]=function(_0x5ecaae,_0x4e94db){var _0x466468={},_0xd76df4={},_0x462a4b={'count':0x0,'rows':[]};var _0xb52c4a=_[_0x5d4a('0x2e')](db[_0x5d4a('0x2f')][_0x5d4a('0x30')],function(_0x1a12f7){return{'name':_0x1a12f7[_0x5d4a('0x31')],'type':_0x1a12f7[_0x5d4a('0x32')][_0x5d4a('0x33')]};});_0xd76df4['model']=_[_0x5d4a('0x2e')](_0xb52c4a,_0x5d4a('0x2c'));_0xd76df4[_0x5d4a('0x34')]=_[_0x5d4a('0x35')](_0x5ecaae[_0x5d4a('0x34')]);_0xd76df4[_0x5d4a('0x36')]=_[_0x5d4a('0x37')](_0xd76df4[_0x5d4a('0x38')],_0xd76df4[_0x5d4a('0x34')]);_0x466468[_0x5d4a('0x39')]=_['intersection'](_0xd76df4[_0x5d4a('0x38')],qs[_0x5d4a('0x3a')](_0x5ecaae['query'][_0x5d4a('0x3a')]));_0x466468[_0x5d4a('0x39')]=_0x466468['attributes'][_0x5d4a('0x3b')]?_0x466468[_0x5d4a('0x39')]:_0xd76df4[_0x5d4a('0x38')];if(!_0x5ecaae[_0x5d4a('0x34')][_0x5d4a('0x3c')](_0x5d4a('0x3d'))){_0x466468[_0x5d4a('0x23')]=qs[_0x5d4a('0x23')](_0x5ecaae['query'][_0x5d4a('0x23')]);_0x466468[_0x5d4a('0x21')]=qs[_0x5d4a('0x21')](_0x5ecaae['query'][_0x5d4a('0x21')]);}_0x466468[_0x5d4a('0x3e')]=qs[_0x5d4a('0x3f')](_0x5ecaae[_0x5d4a('0x34')][_0x5d4a('0x3f')]);_0x466468[_0x5d4a('0x40')]=qs[_0x5d4a('0x36')](_[_0x5d4a('0x41')](_0x5ecaae['query'],_0xd76df4[_0x5d4a('0x36')]),_0xb52c4a);if(_0x5ecaae[_0x5d4a('0x34')]['filter']){_0x466468[_0x5d4a('0x40')]=_['merge'](_0x466468['where'],{'$or':_[_0x5d4a('0x2e')](_0xb52c4a,function(_0x1abc99){if(_0x1abc99[_0x5d4a('0x32')]!==_0x5d4a('0x42')){var _0x1fc764={};_0x1fc764[_0x1abc99[_0x5d4a('0x2c')]]={'$like':'%'+_0x5ecaae[_0x5d4a('0x34')]['filter']+'%'};return _0x1fc764;}})});}_0x466468=_[_0x5d4a('0x43')]({},_0x466468,_0x5ecaae[_0x5d4a('0x44')]);var _0x252e15={'where':_0x466468['where']};return db[_0x5d4a('0x2f')][_0x5d4a('0x22')](_0x252e15)[_0x5d4a('0x28')](function(_0x52bd9e){_0x462a4b[_0x5d4a('0x22')]=_0x52bd9e;if(_0x5ecaae[_0x5d4a('0x34')]['includeAll']){_0x466468[_0x5d4a('0x45')]=[{'all':!![]}];}return db[_0x5d4a('0x2f')][_0x5d4a('0x46')](_0x466468);})[_0x5d4a('0x28')](function(_0x4f9b53){_0x462a4b[_0x5d4a('0x47')]=_0x4f9b53;return _0x462a4b;})[_0x5d4a('0x28')](respondWithFilteredResult(_0x4e94db,_0x466468))[_0x5d4a('0x48')](handleError(_0x4e94db,null));};exports[_0x5d4a('0x49')]=function(_0x5b09a0,_0x40a1ac){var _0x14d561={'raw':!![],'where':{'id':_0x5b09a0[_0x5d4a('0x4a')]['id']}},_0x4a6acb={};_0x4a6acb[_0x5d4a('0x38')]=_['keys'](db[_0x5d4a('0x2f')][_0x5d4a('0x30')]);_0x4a6acb[_0x5d4a('0x34')]=_[_0x5d4a('0x35')](_0x5b09a0[_0x5d4a('0x34')]);_0x4a6acb[_0x5d4a('0x36')]=_['intersection'](_0x4a6acb[_0x5d4a('0x38')],_0x4a6acb['query']);_0x14d561['attributes']=_['intersection'](_0x4a6acb[_0x5d4a('0x38')],qs[_0x5d4a('0x3a')](_0x5b09a0[_0x5d4a('0x34')][_0x5d4a('0x3a')]));_0x14d561[_0x5d4a('0x39')]=_0x14d561[_0x5d4a('0x39')][_0x5d4a('0x3b')]?_0x14d561[_0x5d4a('0x39')]:_0x4a6acb['model'];if(_0x5b09a0[_0x5d4a('0x34')][_0x5d4a('0x4b')]){_0x14d561['include']=[{'all':!![]}];}_0x14d561=_[_0x5d4a('0x43')]({},_0x14d561,_0x5b09a0[_0x5d4a('0x44')]);return db[_0x5d4a('0x2f')][_0x5d4a('0x4c')](_0x14d561)['then'](handleEntityNotFound(_0x40a1ac,null))['then'](respondWithResult(_0x40a1ac,null))['catch'](handleError(_0x40a1ac,null));};exports[_0x5d4a('0x4d')]=function(_0x5aa765,_0x1d8e30){var _0x3ca03a={'where':{'id':_0x5aa765['params']['id']}},_0x2c8ce7={};_0x2c8ce7[_0x5d4a('0x38')]=_[_0x5d4a('0x35')](db['Attachment'][_0x5d4a('0x30')]);_0x3ca03a['attributes']=_[_0x5d4a('0x37')](_0x2c8ce7[_0x5d4a('0x38')],qs[_0x5d4a('0x3a')](_0x5aa765[_0x5d4a('0x34')][_0x5d4a('0x3a')]));_0x3ca03a[_0x5d4a('0x39')]=_0x3ca03a[_0x5d4a('0x39')][_0x5d4a('0x3b')]?_0x3ca03a[_0x5d4a('0x39')]:_0x2c8ce7[_0x5d4a('0x38')];if(_0x5aa765[_0x5d4a('0x34')][_0x5d4a('0x4b')]){_0x3ca03a[_0x5d4a('0x45')]=[{'all':!![]}];}_0x3ca03a=_[_0x5d4a('0x43')]({},_0x3ca03a,_0x5aa765['options']);return db[_0x5d4a('0x2f')][_0x5d4a('0x4c')](_0x3ca03a)[_0x5d4a('0x28')](handleEntityNotFound(_0x1d8e30,null))[_0x5d4a('0x28')](function(_0x3ddf13){if(_0x3ddf13){var _0x1406c8=_0x3ddf13[_0x5d4a('0x4e')]({'plain':!![]});_0x1406c8=qs[_0x5d4a('0x4f')](_0x1406c8,['id',_0x5d4a('0x50'),'updatedAt']);_0x5aa765[_0x5d4a('0x51')]=_[_0x5d4a('0x4f')](_0x5aa765[_0x5d4a('0x51')],['id',_0x5d4a('0x50'),_0x5d4a('0x52')]);return db['Attachment'][_0x5d4a('0x53')](_[_0x5d4a('0x43')](_0x1406c8,_0x5aa765[_0x5d4a('0x51')]),{'include':_0x5aa765[_0x5d4a('0x34')][_0x5d4a('0x4b')]?[{'all':!![]}]:undefined});}})[_0x5d4a('0x28')](respondWithResult(_0x1d8e30,0xc9))[_0x5d4a('0x48')](handleError(_0x1d8e30,null));};exports[_0x5d4a('0x54')]=function(_0x13a2c6,_0x1292ce){if(_0x13a2c6[_0x5d4a('0x51')]['id']){delete _0x13a2c6[_0x5d4a('0x51')]['id'];}return db[_0x5d4a('0x2f')]['find']({'where':{'id':_0x13a2c6[_0x5d4a('0x4a')]['id']}})[_0x5d4a('0x28')](handleEntityNotFound(_0x1292ce,null))[_0x5d4a('0x28')](saveUpdates(_0x13a2c6['body'],null))[_0x5d4a('0x28')](respondWithResult(_0x1292ce,null))[_0x5d4a('0x48')](handleError(_0x1292ce,null));};exports[_0x5d4a('0x29')]=function(_0xd5a25,_0x49b730){return db[_0x5d4a('0x2f')]['find']({'where':{'id':_0xd5a25[_0x5d4a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49b730,null))['then'](removeEntity(_0x49b730,null))[_0x5d4a('0x48')](handleError(_0x49b730,null));};exports[_0x5d4a('0x53')]=function(_0x3baadf,_0x38a2ab,_0xcea70c){_0x3baadf[_0x5d4a('0x51')][_0x5d4a('0x2c')]=_0x3baadf[_0x5d4a('0x55')][_0x5d4a('0x56')];_0x3baadf[_0x5d4a('0x51')][_0x5d4a('0x57')]=_0x3baadf[_0x5d4a('0x55')]['filename'];_0x3baadf['body'][_0x5d4a('0x32')]=_0x3baadf[_0x5d4a('0x55')][_0x5d4a('0x58')];return db[_0x5d4a('0x2f')]['create'](_0x3baadf[_0x5d4a('0x51')])[_0x5d4a('0x28')](respondWithResult(_0x38a2ab,0xc9))[_0x5d4a('0x48')](handleError(_0x38a2ab,null));};exports[_0x5d4a('0x59')]=function(_0x273142,_0x43aa92,_0x38a901){return db['Attachment'][_0x5d4a('0x5a')]({'where':{'id':_0x273142[_0x5d4a('0x4a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43aa92,null))[_0x5d4a('0x28')](function(_0x340ea0){if(_0x340ea0){var _0x1313ce=_0x340ea0['ChatOfflineMessageId']!==null;var _0x4a8472=path[_0x5d4a('0x5b')](config['root'],_0x5d4a('0x5c'));if(_0x1313ce){_0x4a8472=path[_0x5d4a('0x5b')](_0x4a8472,_0x5d4a('0x5d'));}var _0x195fdd=path['join'](_0x4a8472,_0x340ea0[_0x5d4a('0x57')]);return _0x43aa92[_0x5d4a('0x59')](_0x195fdd);}})['catch'](handleError(_0x43aa92,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index af0b4de..1525858 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 _0x88f1=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x3b3700,_0x340bfb){var _0x20874c=function(_0x1d0d4d){while(--_0x1d0d4d){_0x3b3700['push'](_0x3b3700['shift']());}};_0x20874c(++_0x340bfb);}(_0x88f1,0x68));var _0x188f=function(_0xb9b680,_0x48d725){_0xb9b680=_0xb9b680-0x0;var _0x2382e9=_0x88f1[_0xb9b680];return _0x2382e9;};'use strict';var _=require(_0x188f('0x0'));var util=require(_0x188f('0x1'));var logger=require(_0x188f('0x2'))(_0x188f('0x3'));var moment=require(_0x188f('0x4'));var BPromise=require(_0x188f('0x5'));var rp=require(_0x188f('0x6'));var fs=require('fs');var path=require(_0x188f('0x7'));var rimraf=require(_0x188f('0x8'));var config=require(_0x188f('0x9'));var attributes=require(_0x188f('0xa'));module[_0x188f('0xb')]=function(_0x544e5a,_0x17be24){return _0x544e5a[_0x188f('0xc')](_0x188f('0xd'),attributes,{'tableName':_0x188f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd41d=['moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','attachments','lodash','../../config/logger','api'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xd41d,0x131));var _0xdd41=function(_0x9acccd,_0x187b12){_0x9acccd=_0x9acccd-0x0;var _0x14f79b=_0xd41d[_0x9acccd];return _0x14f79b;};'use strict';var _=require(_0xdd41('0x0'));var util=require('util');var logger=require(_0xdd41('0x1'))(_0xdd41('0x2'));var moment=require(_0xdd41('0x3'));var BPromise=require(_0xdd41('0x4'));var rp=require(_0xdd41('0x5'));var fs=require('fs');var path=require(_0xdd41('0x6'));var rimraf=require(_0xdd41('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd41('0x8'));module[_0xdd41('0x9')]=function(_0x2bffa0,_0x46310d){return _0x2bffa0['define']('Attachment',attributes,{'tableName':_0xdd41('0xa'),'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 f0c0745..af94d9a 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 _0x94dc=['raw','CreateAttachment','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x94dc,0xb1));var _0xc94d=function(_0x14bf17,_0x10082d){_0x14bf17=_0x14bf17-0x0;var _0x49ceed=_0x94dc[_0x14bf17];return _0x49ceed;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Attachment,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Attachment,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['CreateAttachment']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Attachment'][_0xc94d('0x17')](_0x48b879[_0xc94d('0x18')],{'raw':_0x48b879['options']?_0x48b879[_0xc94d('0x19')][_0xc94d('0x1a')]===undefined?!![]:![]:!![]})[_0xc94d('0xc')](function(_0xb5c1fd){logger[_0xc94d('0xd')](_0xc94d('0x1b'),_0x48b879);logger[_0xc94d('0x10')](_0xc94d('0x1b'),_0x48b879,JSON[_0xc94d('0x1c')](_0xb5c1fd));_0x4784a2(_0xb5c1fd);})[_0xc94d('0x16')](function(_0x5f2820){logger[_0xc94d('0x12')](_0xc94d('0x1b'),_0x5f2820[_0xc94d('0x14')],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x5f2820[_0xc94d('0x14')]));});});}; \ No newline at end of file +var _0x1ba2=['http','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1a9a95,_0x211379){var _0x32ff9c=function(_0x29c219){while(--_0x29c219){_0x1a9a95['push'](_0x1a9a95['shift']());}};_0x32ff9c(++_0x211379);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x21ba('0x0'));var util=require('util');var moment=require(_0x21ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x21ba('0x2'));var fs=require('fs');var Redis=require(_0x21ba('0x3'));var db=require(_0x21ba('0x4'))['db'];var utils=require(_0x21ba('0x5'));var logger=require(_0x21ba('0x6'))('rpc');var config=require(_0x21ba('0x7'));var jayson=require(_0x21ba('0x8'));var client=jayson['client'][_0x21ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53b3e0,_0x44eb71,_0x23c3b7){return new BPromise(function(_0x5c50aa,_0x17755a){return client['request'](_0x53b3e0,_0x23c3b7)[_0x21ba('0xa')](function(_0x261a15){logger['info'](_0x21ba('0xb'),_0x44eb71,_0x21ba('0xc'));logger[_0x21ba('0xd')](_0x21ba('0xe'),_0x44eb71,_0x21ba('0xc'),JSON[_0x21ba('0xf')](_0x261a15));if(_0x261a15[_0x21ba('0x10')]){if(_0x261a15[_0x21ba('0x10')][_0x21ba('0x11')]===0x1f4){logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15[_0x21ba('0x10')]['message']);return _0x17755a(_0x261a15['error'][_0x21ba('0x12')]);}logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15['error']['message']);return _0x5c50aa(_0x261a15[_0x21ba('0x10')]['message']);}else{logger[_0x21ba('0x13')]('Attachment,\x20%s,\x20%s',_0x44eb71,_0x21ba('0xc'));_0x5c50aa(_0x261a15[_0x21ba('0x14')][_0x21ba('0x12')]);}})[_0x21ba('0x15')](function(_0x10b9e6){logger['error'](_0x21ba('0xb'),_0x44eb71,_0x10b9e6);_0x17755a(_0x10b9e6);});});}exports['CreateAttachment']=function(_0xc995ee){var _0xa1022=this;return new Promise(function(_0x1f2f48,_0x154ef4){return db[_0x21ba('0x16')][_0x21ba('0x17')](_0xc995ee[_0x21ba('0x18')],{'raw':_0xc995ee[_0x21ba('0x19')]?_0xc995ee['options'][_0x21ba('0x1a')]===undefined?!![]:![]:!![]})[_0x21ba('0xa')](function(_0x58ba99){logger[_0x21ba('0x13')]('CreateAttachment',_0xc995ee);logger[_0x21ba('0xd')]('CreateAttachment',_0xc995ee,JSON[_0x21ba('0xf')](_0x58ba99));_0x1f2f48(_0x58ba99);})[_0x21ba('0x15')](function(_0x30ac7a){logger[_0x21ba('0x10')]('CreateAttachment',_0x30ac7a['message'],_0xc995ee);_0x154ef4(_0xa1022['error'](0x1f4,_0x30ac7a['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 47ddecb..3ab9898 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5acaec,_0x3fe55a){var _0x2800c0=function(_0x553508){while(--_0x553508){_0x5acaec['push'](_0x5acaec['shift']());}};_0x2800c0(++_0x3fe55a);}(_0x2032,0xd9));var _0x2203=function(_0x42f8b9,_0x110025){_0x42f8b9=_0x42f8b9-0x0;var _0x1dfa39=_0x2032[_0x42f8b9];return _0x1dfa39;};'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('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index fe55bb4..dbb495c 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 _0x7062=['../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb'];(function(_0x4d26a7,_0x101ad2){var _0x53eab5=function(_0x58d5ee){while(--_0x58d5ee){_0x4d26a7['push'](_0x4d26a7['shift']());}};_0x53eab5(++_0x101ad2);}(_0x7062,0x17b));var _0x2706=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7062[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2706('0x0'));var passport=require(_0x2706('0x1'));var GoogleStrategy=require(_0x2706('0x2'))[_0x2706('0x3')];var moment=require(_0x2706('0x4'));var db=require(_0x2706('0x5'))['db'];var config=require(_0x2706('0x6'));var signToken=require(_0x2706('0x7'))[_0x2706('0x8')];var utils=require(_0x2706('0x9'));exports[_0x2706('0xa')]=passport[_0x2706('0xb')](_0x2706('0xc'),{'failureRedirect':_0x2706('0xd'),'scope':[_0x2706('0xe'),_0x2706('0xf')],'session':![]});exports[_0x2706('0x10')]=passport['authenticate']('google',{'failureRedirect':_0x2706('0xd'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x2706('0xc')]?config[_0x2706('0xc')][_0x2706('0x11')]:'id','clientSecret':config[_0x2706('0xc')]?config[_0x2706('0xc')]['clientSecret']:_0x2706('0x12'),'callbackURL':config[_0x2706('0xc')]?config[_0x2706('0xc')][_0x2706('0x13')]:''},function(_0x29d55c,_0x312f86,_0x134622,_0x4ac778){var _0x4ebce0,_0x2be654;return db[_0x2706('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x2706('0x15'),_0x2706('0x16')],'raw':!![]})['then'](function(_0x310a91){_0x4ebce0=_0x310a91;return db['User']['find']({'where':{'email':_[_0x2706('0x17')](_0x134622[_0x2706('0x18')],_0x2706('0x19')),'role':{'$or':[_0x2706('0x1a'),_0x2706('0x1b'),'agent']}}});})[_0x2706('0x1c')](function(_0x3dcbbf){_0x2be654=_0x3dcbbf;if(_0x2be654){if(_0x2be654[_0x2706('0x1d')]){return _0x4ac778(_0x2706('0x1e'));}else if(_0x4ebce0['blockDuration']>0x0){if(_0x2be654['blocked']){if(moment(_0x2be654['blockedAt'])[_0x2706('0x1f')](_0x4ebce0['blockDuration'],_0x2706('0x20'))>moment()){return _0x4ac778(_0x2706('0x1e'));}else{return utils['clearBlockUser'](_0x2be654,0x0,![],null)[_0x2706('0x1c')](function(){return utils[_0x2706('0x21')](_0x2be654);})[_0x2706('0x1c')](function(){return _0x4ac778(null,_0x2be654);});}}else{return utils[_0x2706('0x21')](_0x2be654)['then'](function(){return _0x4ac778(null,_0x2be654);});}}else{return utils[_0x2706('0x21')](_0x2be654)[_0x2706('0x1c')](function(){return _0x4ac778(null,_0x2be654);});}}return _0x4ac778('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x2706('0x22')](function(_0x104125){_0x4ac778(_0x104125);});})); \ No newline at end of file +var _0x3831=['passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','/login','profile','email','callback','google','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','value','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','blockDuration','getLicense','passport'];(function(_0x40b17f,_0x2945ab){var _0x53d4b0=function(_0x1a53de){while(--_0x1a53de){_0x40b17f['push'](_0x40b17f['shift']());}};_0x53d4b0(++_0x2945ab);}(_0x3831,0x131));var _0x1383=function(_0x17e0ff,_0x4dbd1e){_0x17e0ff=_0x17e0ff-0x0;var _0x357979=_0x3831[_0x17e0ff];return _0x357979;};'use strict';var _=require('lodash');var passport=require(_0x1383('0x0'));var GoogleStrategy=require(_0x1383('0x1'))[_0x1383('0x2')];var moment=require(_0x1383('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x1383('0x4'));var signToken=require(_0x1383('0x5'))[_0x1383('0x6')];var utils=require(_0x1383('0x7'));exports[_0x1383('0x8')]=passport[_0x1383('0x9')]('google',{'failureRedirect':_0x1383('0xa'),'scope':[_0x1383('0xb'),_0x1383('0xc')],'session':![]});exports[_0x1383('0xd')]=passport[_0x1383('0x9')](_0x1383('0xe'),{'failureRedirect':_0x1383('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x1383('0xe')]?config[_0x1383('0xe')]['clientID']:'id','clientSecret':config[_0x1383('0xe')]?config[_0x1383('0xe')][_0x1383('0xf')]:_0x1383('0x10'),'callbackURL':config[_0x1383('0xe')]?config[_0x1383('0xe')][_0x1383('0x11')]:''},function(_0x4e36e2,_0x538c86,_0x568569,_0x7e9be3){var _0x2ee13f,_0x2249c4;return db[_0x1383('0x12')][_0x1383('0x13')]({'where':{'id':0x1},'attributes':[_0x1383('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x466d28){_0x2ee13f=_0x466d28;return db[_0x1383('0x15')][_0x1383('0x16')]({'where':{'email':_[_0x1383('0x17')](_0x568569['emails'],_0x1383('0x18')),'role':{'$or':[_0x1383('0x19'),_0x1383('0x1a'),'agent']}}});})[_0x1383('0x1b')](function(_0x21f5b1){_0x2249c4=_0x21f5b1;if(_0x2249c4){if(_0x2249c4['disabled']){return _0x7e9be3(_0x1383('0x1c'));}else if(_0x2ee13f['blockDuration']>0x0){if(_0x2249c4[_0x1383('0x1d')]){if(moment(_0x2249c4[_0x1383('0x1e')])[_0x1383('0x1f')](_0x2ee13f[_0x1383('0x20')],'minutes')>moment()){return _0x7e9be3(_0x1383('0x1c'));}else{return utils['clearBlockUser'](_0x2249c4,0x0,![],null)[_0x1383('0x1b')](function(){return utils[_0x1383('0x21')](_0x2249c4);})[_0x1383('0x1b')](function(){return _0x7e9be3(null,_0x2249c4);});}}else{return utils[_0x1383('0x21')](_0x2249c4)[_0x1383('0x1b')](function(){return _0x7e9be3(null,_0x2249c4);});}}else{return utils[_0x1383('0x21')](_0x2249c4)[_0x1383('0x1b')](function(){return _0x7e9be3(null,_0x2249c4);});}}return _0x7e9be3(_0x1383('0x1c'));})['catch'](function(_0x3e3e9b){_0x7e9be3(_0x3e3e9b);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3c8996a..b0001e4 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 _0xd289=['../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','exports','passport','./authGoogle.controller'];(function(_0x39f4e3,_0x392558){var _0x1ebdcb=function(_0x103643){while(--_0x103643){_0x39f4e3['push'](_0x39f4e3['shift']());}};_0x1ebdcb(++_0x392558);}(_0xd289,0xf6));var _0x9d28=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xd289[_0x1dbaf7];return _0x593f05;};'use strict';var express=require('express');var passport=require(_0x9d28('0x0'));var router=express['Router']();var controller=require(_0x9d28('0x1'));var userController=require(_0x9d28('0x2'));var authService=require(_0x9d28('0x3'));router[_0x9d28('0x4')]('/',controller['login']);router['get']('/callback',controller[_0x9d28('0x5')],authService[_0x9d28('0x6')],userController['login'],authService['setTokenCookie']);module[_0x9d28('0x7')]=router; \ No newline at end of file +var _0xad36=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','passport','Router'];(function(_0x243890,_0xa7ab52){var _0xcb3344=function(_0x40b70a){while(--_0x40b70a){_0x243890['push'](_0x243890['shift']());}};_0xcb3344(++_0xa7ab52);}(_0xad36,0x11c));var _0x6ad3=function(_0x4212d8,_0x4d6025){_0x4212d8=_0x4212d8-0x0;var _0x1d5f6d=_0xad36[_0x4212d8];return _0x1d5f6d;};'use strict';var express=require('express');var passport=require(_0x6ad3('0x0'));var router=express[_0x6ad3('0x1')]();var controller=require(_0x6ad3('0x2'));var userController=require(_0x6ad3('0x3'));var authService=require(_0x6ad3('0x4'));router[_0x6ad3('0x5')]('/',controller[_0x6ad3('0x6')]);router[_0x6ad3('0x5')](_0x6ad3('0x7'),controller['callback'],authService[_0x6ad3('0x8')],userController[_0x6ad3('0x6')],authService[_0x6ad3('0x9')]);module[_0x6ad3('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 56e60cc..25446f8 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 _0x0bff=['save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x237b12,_0x52e59a){var _0xcd4f97=function(_0x39adfc){while(--_0x39adfc){_0x237b12['push'](_0x237b12['shift']());}};_0xcd4f97(++_0x52e59a);}(_0x0bff,0x1ce));var _0xf0bf=function(_0xf4dbb,_0x49876b){_0xf4dbb=_0xf4dbb-0x0;var _0x246307=_0x0bff[_0xf4dbb];return _0x246307;};'use strict';var util=require(_0xf0bf('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf0bf('0x1'))['Strategy'];var jayson=require(_0xf0bf('0x2'));var _=require('lodash');var rs=require(_0xf0bf('0x3'));var moment=require(_0xf0bf('0x4'));var db=require(_0xf0bf('0x5'))['db'];var authService=require(_0xf0bf('0x6'));var utils=require(_0xf0bf('0x7'));var client=jayson[_0xf0bf('0x8')][_0xf0bf('0x9')]({'port':0x232b});function localAuthenticate(_0x4310cc,_0x20f08b,_0x502b3c,_0x2df76d){var _0x42483e,_0x288d9c;return db[_0xf0bf('0xa')][_0xf0bf('0xb')]({'where':{'id':0x1},'attributes':[_0xf0bf('0xc'),_0xf0bf('0xd')],'raw':!![]})[_0xf0bf('0xe')](function(_0x5ce30f){_0x42483e=_0x5ce30f;return _0x4310cc[_0xf0bf('0xb')]({'attributes':['id',_0xf0bf('0xf'),'password',_0xf0bf('0x10'),_0xf0bf('0x11'),_0xf0bf('0x12'),'blocked',_0xf0bf('0x13'),_0xf0bf('0x14')],'where':{'name':_0x20f08b,'role':{'$or':[_0xf0bf('0x15'),'user',_0xf0bf('0x16')]}}});})[_0xf0bf('0xe')](function(_0x267924){if(!_0x267924||_0x267924&&_0x267924[_0xf0bf('0xf')]!==_0x20f08b){throw new Error(_0xf0bf('0x17'));}else{_0x288d9c=_0x267924;return _0x288d9c;}})[_0xf0bf('0xe')](function(){_0x288d9c[_0xf0bf('0x18')](_0x502b3c,function(_0x72e9d4,_0x1e1fce){var _0x199e4f=_0x288d9c[_0xf0bf('0x14')]+0x1;if(_0x72e9d4){return _0x2df76d(_0x72e9d4);}else if(!_0x1e1fce){if(_0x288d9c['disabled']){return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}else if(_0x42483e['allowedLoginAttempts']>0x0){if(_0x288d9c[_0xf0bf('0x19')]){if(_0x42483e['blockDuration']>0x0){if(moment(_0x288d9c[_0xf0bf('0x13')])[_0xf0bf('0x1a')](_0x42483e[_0xf0bf('0xd')],_0xf0bf('0x1b'))>moment()){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf0bf('0x1c')](_0x288d9c,_0x199e4f,![],null)[_0xf0bf('0xe')](function(){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x199e4f>=_0x42483e['allowedLoginAttempts']){return utils[_0xf0bf('0x1c')](_0x288d9c,0x0,!![],moment())[_0xf0bf('0xe')](function(){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf0bf('0x1c')](_0x288d9c,_0x199e4f,![],null)[_0xf0bf('0xe')](function(){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x288d9c[_0xf0bf('0x12')]){return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}else if(_0x42483e['allowedLoginAttempts']>0x0){if(_0x288d9c[_0xf0bf('0x19')]){if(_0x42483e['blockDuration']>0x0){if(moment(_0x288d9c['blockedAt'])['add'](_0x42483e[_0xf0bf('0xd')],_0xf0bf('0x1b'))>moment()){return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}else{return utils[_0xf0bf('0x1c')](_0x288d9c,0x0,![],null)[_0xf0bf('0xe')](function(){return utils[_0xf0bf('0x1d')](_0x288d9c);})[_0xf0bf('0xe')](function(){return _0x2df76d(null,_0x288d9c);});}}else{return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}}else{return utils[_0xf0bf('0x1c')](_0x288d9c,0x0,![],null)[_0xf0bf('0xe')](function(){return utils['getLicense'](_0x288d9c);})[_0xf0bf('0xe')](function(){return _0x2df76d(null,_0x288d9c);})[_0xf0bf('0x1e')](function(_0x42e922){return _0x2df76d(null,![],_0x42e922);});}}else{if(_0x288d9c[_0xf0bf('0x19')]){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf0bf('0x1d')](_0x288d9c)[_0xf0bf('0xe')](function(){return _0x2df76d(null,_0x288d9c);});}}}});})[_0xf0bf('0x1e')](function(_0x553942){return _0x2df76d(null,![],_0x553942);});}function sendServiceMail(_0x48b8d6){return db[_0xf0bf('0x1f')][_0xf0bf('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xf0bf('0x21')],'include':[{'model':db[_0xf0bf('0x22')],'as':_0xf0bf('0x23')}]})['then'](function(_0x254859){if(!_0x254859){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3f4dbd={'tls':{'rejectUnauthorized':![]}};if(_0x254859[_0xf0bf('0x23')][_0xf0bf('0x24')]){_0x3f4dbd[_0xf0bf('0x24')]=_0x254859[_0xf0bf('0x23')][_0xf0bf('0x24')];}else{_0x3f4dbd[_0xf0bf('0x25')]=_0x254859[_0xf0bf('0x23')]['host'];_0x3f4dbd[_0xf0bf('0x26')]=_0x254859[_0xf0bf('0x23')][_0xf0bf('0x26')];_0x3f4dbd[_0xf0bf('0x27')]=_0x254859[_0xf0bf('0x23')][_0xf0bf('0x27')];}if(_0x254859[_0xf0bf('0x23')][_0xf0bf('0x28')]){_0x3f4dbd[_0xf0bf('0x29')]={'user':_0x254859['Smtp'][_0xf0bf('0x2a')],'pass':_0x254859[_0xf0bf('0x23')][_0xf0bf('0x2b')]};}var _0x14f1e1={'account':_0x3f4dbd,'message':_[_0xf0bf('0x2c')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x254859['name'],_0x254859[_0xf0bf('0x21')]||_0x254859[_0xf0bf('0x23')][_0xf0bf('0x2a')])},_0x48b8d6)};return client[_0xf0bf('0x2d')]('SendMail',_0x14f1e1);})['then'](function(_0x55bb3b){if(_0x55bb3b[_0xf0bf('0x2e')]){throw new Error(util[_0xf0bf('0x2f')](_0xf0bf('0x30'),_0x55bb3b[_0xf0bf('0x2e')][_0xf0bf('0x31')]||JSON[_0xf0bf('0x32')](_0x55bb3b['error'])));}return!![];});}function handleError(_0xd1f7a0,_0x321eff,_0x4d339){return _0xd1f7a0[_0xf0bf('0x33')](_0x321eff||0x1f4)[_0xf0bf('0x34')]({'message':_0x4d339?_0x4d339['message']||_0x4d339:''});}exports[_0xf0bf('0x35')]=function(_0x75bdb8,_0xe452c7,_0x3f4d2f){passport[_0xf0bf('0x18')](_0xf0bf('0x36'),function(_0x369263,_0x322a86,_0x56c430){var _0x2756e8=_0x369263||_0x56c430;if(_0x2756e8){return handleError(_0xe452c7,0x191,_0x2756e8);}if(!_0x322a86){return handleError(_0xe452c7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x139727={'payload':{'id':_0x322a86['id'],'role':_0x322a86['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x139727)[_0xf0bf('0xe')](function(_0x346bf7){_0xe452c7[_0xf0bf('0x37')]({'id':_0x322a86['id'],'token':_0x346bf7,'statusCall':'','isAlreadyLogged':_0x322a86['online']});});}})(_0x75bdb8,_0xe452c7,_0x3f4d2f);};exports['forgot']=function(_0x1978f7,_0x4133d6,_0x40e44a){if(!_0x1978f7[_0xf0bf('0x38')][_0xf0bf('0x21')]){return handleError(_0x4133d6,0x1f4,{'message':_0xf0bf('0x39')});}var _0xf828a6=rs[_0xf0bf('0x3a')]();_0x1978f7[_0xf0bf('0x38')][_0xf0bf('0x21')]=_0x1978f7['body'][_0xf0bf('0x21')][_0xf0bf('0x3b')]()[_0xf0bf('0x3c')]();var _0x31d6c4;return db[_0xf0bf('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf0bf('0xc'),_0xf0bf('0xd')],'raw':!![]})[_0xf0bf('0xe')](function(_0x315212){_0x31d6c4=_0x315212;return db[_0xf0bf('0x3d')]['find']({'where':{'email':_0x1978f7[_0xf0bf('0x38')][_0xf0bf('0x21')]}});})[_0xf0bf('0xe')](function(_0x383775){if(!_0x383775){throw new Error(_0xf0bf('0x3e'));}if(_0x383775[_0xf0bf('0x12')]){throw new Error(_0xf0bf('0x3f'));}if(_0x383775[_0xf0bf('0x19')]){if(moment(_0x383775[_0xf0bf('0x13')])[_0xf0bf('0x1a')](_0x31d6c4[_0xf0bf('0xd')],_0xf0bf('0x1b'))>moment()){throw new Error(_0xf0bf('0x40'));}else{_0x383775[_0xf0bf('0x19')]=![];_0x383775[_0xf0bf('0x13')]=null;}}_0x383775[_0xf0bf('0x41')]=_0xf828a6;_0x383775['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x383775[_0xf0bf('0x42')]();})[_0xf0bf('0xe')](function(){return sendServiceMail({'to':_0x1978f7['body'][_0xf0bf('0x21')],'subject':_0xf0bf('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf0bf('0x44')+_0xf0bf('0x45')+_0x1978f7['headers'][_0xf0bf('0x25')]+_0xf0bf('0x46')+_0xf828a6+'\x0a\x0a'+_0xf0bf('0x47')});})[_0xf0bf('0xe')](function(){_0x4133d6[_0xf0bf('0x33')](0xc8)['send']({'message':_0xf0bf('0x48')});})[_0xf0bf('0x1e')](function(_0x1d9536){return handleError(_0x4133d6,0x1f4,_0x1d9536);});};exports[_0xf0bf('0x49')]=function(_0xd22ac4,_0x5c8d60,_0x8ffe67){return db[_0xf0bf('0x3d')][_0xf0bf('0x20')]({'where':{'resetPasswordToken':_0xd22ac4[_0xf0bf('0x4a')][_0xf0bf('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xf0bf('0x4c')]()}}})['then'](function(_0x5797ee){if(!_0x5797ee){throw new Error(_0xf0bf('0x4d'));}return db[_0xf0bf('0xa')]['findOne']({'attributes':['id',_0xf0bf('0x4e'),_0xf0bf('0x4f'),_0xf0bf('0x50')]})[_0xf0bf('0xe')](function(_0x28075a){if(_0x28075a['securePassword'])authService[_0xf0bf('0x51')](_0xd22ac4[_0xf0bf('0x38')][_0xf0bf('0x52')]);if(!_0x28075a[_0xf0bf('0x4f')]||!_0x5797ee[_0xf0bf('0x53')])return _0x5797ee;authService[_0xf0bf('0x54')](_0xd22ac4[_0xf0bf('0x38')]['password'],_0x5797ee[_0xf0bf('0x53')],_0x28075a[_0xf0bf('0x50')]);return _0x5797ee;})[_0xf0bf('0xe')](function(){_0x5797ee[_0xf0bf('0x52')]=_0xd22ac4[_0xf0bf('0x38')]['password'];_0x5797ee['resetPasswordToken']=null;_0x5797ee[_0xf0bf('0x55')]=null;return _0x5797ee[_0xf0bf('0x42')]();});})[_0xf0bf('0xe')](function(){_0x5c8d60[_0xf0bf('0x33')](0xc8)[_0xf0bf('0x34')]({'message':_0xf0bf('0x56')});})[_0xf0bf('0x1e')](function(_0x7467e5){return handleError(_0x5c8d60,0x1f4,_0x7467e5);});};passport[_0xf0bf('0x57')](new LocalStrategy({'usernameField':_0xf0bf('0xf'),'passwordField':_0xf0bf('0x52')},function(_0x45444f,_0x408e37,_0x58cd64){return localAuthenticate(db[_0xf0bf('0x3d')],_0x45444f,_0x408e37,_0x58cd64);})); \ No newline at end of file +var _0x52c0=['catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','SendMail','error','format','message','status','send','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','body','generate','trim','toLowerCase','findOne','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense'];(function(_0x1632e3,_0x2bf4e4){var _0x120eeb=function(_0x549bf6){while(--_0x549bf6){_0x1632e3['push'](_0x1632e3['shift']());}};_0x120eeb(++_0x2bf4e4);}(_0x52c0,0xe6));var _0x052c=function(_0x4754b7,_0x4a0b9e){_0x4754b7=_0x4754b7-0x0;var _0x425f5e=_0x52c0[_0x4754b7];return _0x425f5e;};'use strict';var util=require(_0x052c('0x0'));var passport=require(_0x052c('0x1'));var LocalStrategy=require(_0x052c('0x2'))['Strategy'];var jayson=require(_0x052c('0x3'));var _=require(_0x052c('0x4'));var rs=require(_0x052c('0x5'));var moment=require(_0x052c('0x6'));var db=require(_0x052c('0x7'))['db'];var authService=require(_0x052c('0x8'));var utils=require(_0x052c('0x9'));var client=jayson[_0x052c('0xa')][_0x052c('0xb')]({'port':0x232b});function localAuthenticate(_0x3c4f45,_0x3f2d3d,_0x34afd5,_0x190372){var _0x12c915,_0x4f889b;return db[_0x052c('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x052c('0xd'),_0x052c('0xe')],'raw':!![]})[_0x052c('0xf')](function(_0x571b52){_0x12c915=_0x571b52;return _0x3c4f45['findOne']({'attributes':['id',_0x052c('0x10'),_0x052c('0x11'),_0x052c('0x12'),'role',_0x052c('0x13'),_0x052c('0x14'),_0x052c('0x15'),_0x052c('0x16')],'where':{'name':_0x3f2d3d,'role':{'$or':[_0x052c('0x17'),_0x052c('0x18'),_0x052c('0x19')]}}});})[_0x052c('0xf')](function(_0x345ae0){if(!_0x345ae0||_0x345ae0&&_0x345ae0[_0x052c('0x10')]!==_0x3f2d3d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4f889b=_0x345ae0;return _0x4f889b;}})[_0x052c('0xf')](function(){_0x4f889b['authenticate'](_0x34afd5,function(_0x58797f,_0x529021){var _0x5a1244=_0x4f889b[_0x052c('0x16')]+0x1;if(_0x58797f){return _0x190372(_0x58797f);}else if(!_0x529021){if(_0x4f889b[_0x052c('0x13')]){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else if(_0x12c915[_0x052c('0xd')]>0x0){if(_0x4f889b['blocked']){if(_0x12c915[_0x052c('0xe')]>0x0){if(moment(_0x4f889b['blockedAt'])[_0x052c('0x1b')](_0x12c915[_0x052c('0xe')],'minutes')>moment()){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else{return utils[_0x052c('0x1c')](_0x4f889b,_0x5a1244,![],null)['then'](function(){return _0x190372(null,![],{'message':_0x052c('0x1a')});});}}else{return _0x190372(null,![],{'message':_0x052c('0x1a')});}}else{if(_0x5a1244>=_0x12c915[_0x052c('0xd')]){return utils[_0x052c('0x1c')](_0x4f889b,0x0,!![],moment())[_0x052c('0xf')](function(){return _0x190372(null,![],{'message':_0x052c('0x1a')});});}else{return utils[_0x052c('0x1c')](_0x4f889b,_0x5a1244,![],null)[_0x052c('0xf')](function(){return _0x190372(null,![],{'message':_0x052c('0x1a')});});}}}else{return _0x190372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4f889b[_0x052c('0x13')]){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else if(_0x12c915[_0x052c('0xd')]>0x0){if(_0x4f889b[_0x052c('0x14')]){if(_0x12c915['blockDuration']>0x0){if(moment(_0x4f889b['blockedAt'])[_0x052c('0x1b')](_0x12c915['blockDuration'],_0x052c('0x1d'))>moment()){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else{return utils[_0x052c('0x1c')](_0x4f889b,0x0,![],null)[_0x052c('0xf')](function(){return utils[_0x052c('0x1e')](_0x4f889b);})['then'](function(){return _0x190372(null,_0x4f889b);});}}else{return _0x190372(null,![],{'message':_0x052c('0x1a')});}}else{return utils[_0x052c('0x1c')](_0x4f889b,0x0,![],null)['then'](function(){return utils[_0x052c('0x1e')](_0x4f889b);})['then'](function(){return _0x190372(null,_0x4f889b);})[_0x052c('0x1f')](function(_0xfa0e4c){return _0x190372(null,![],_0xfa0e4c);});}}else{if(_0x4f889b[_0x052c('0x14')]){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else{return utils[_0x052c('0x1e')](_0x4f889b)['then'](function(){return _0x190372(null,_0x4f889b);});}}}});})['catch'](function(_0x428c79){return _0x190372(null,![],_0x428c79);});}function sendServiceMail(_0x267c43){return db[_0x052c('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x052c('0x10'),_0x052c('0x21')],'include':[{'model':db[_0x052c('0x22')],'as':_0x052c('0x23')}]})[_0x052c('0xf')](function(_0xbe51e2){if(!_0xbe51e2){throw new Error(_0x052c('0x24'));}var _0xae1250={'tls':{'rejectUnauthorized':![]}};if(_0xbe51e2[_0x052c('0x23')][_0x052c('0x25')]){_0xae1250[_0x052c('0x25')]=_0xbe51e2[_0x052c('0x23')][_0x052c('0x25')];}else{_0xae1250['host']=_0xbe51e2[_0x052c('0x23')][_0x052c('0x26')];_0xae1250[_0x052c('0x27')]=_0xbe51e2['Smtp'][_0x052c('0x27')];_0xae1250[_0x052c('0x28')]=_0xbe51e2[_0x052c('0x23')][_0x052c('0x28')];}if(_0xbe51e2[_0x052c('0x23')][_0x052c('0x29')]){_0xae1250['auth']={'user':_0xbe51e2[_0x052c('0x23')]['user'],'pass':_0xbe51e2[_0x052c('0x23')][_0x052c('0x2a')]};}var _0x5d09c0={'account':_0xae1250,'message':_['merge']({'from':util['format'](_0x052c('0x2b'),_0xbe51e2[_0x052c('0x10')],_0xbe51e2[_0x052c('0x21')]||_0xbe51e2[_0x052c('0x23')]['user'])},_0x267c43)};return client['request'](_0x052c('0x2c'),_0x5d09c0);})['then'](function(_0x5aad17){if(_0x5aad17[_0x052c('0x2d')]){throw new Error(util[_0x052c('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5aad17[_0x052c('0x2d')][_0x052c('0x2f')]||JSON['stringify'](_0x5aad17[_0x052c('0x2d')])));}return!![];});}function handleError(_0x2cfe08,_0x2e4cd5,_0x4d5a3b){return _0x2cfe08[_0x052c('0x30')](_0x2e4cd5||0x1f4)[_0x052c('0x31')]({'message':_0x4d5a3b?_0x4d5a3b[_0x052c('0x2f')]||_0x4d5a3b:''});}exports['login']=function(_0x4ed2c9,_0xcdd981,_0x3dab10){passport[_0x052c('0x32')](_0x052c('0x33'),function(_0x5bb68e,_0x234e51,_0x408088){var _0x2e0ab7=_0x5bb68e||_0x408088;if(_0x2e0ab7){return handleError(_0xcdd981,0x191,_0x2e0ab7);}if(!_0x234e51){return handleError(_0xcdd981,0x194,{'message':_0x052c('0x34')});}else{var _0x3bd9e8={'payload':{'id':_0x234e51['id'],'role':_0x234e51[_0x052c('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0x052c('0x36')](_0x3bd9e8)[_0x052c('0xf')](function(_0x200b51){_0xcdd981[_0x052c('0x37')]({'id':_0x234e51['id'],'token':_0x200b51,'statusCall':'','isAlreadyLogged':_0x234e51['online']});});}})(_0x4ed2c9,_0xcdd981,_0x3dab10);};exports[_0x052c('0x38')]=function(_0x4064d8,_0x468c13,_0xbbcf87){if(!_0x4064d8[_0x052c('0x39')]['email']){return handleError(_0x468c13,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x57a985=rs[_0x052c('0x3a')]();_0x4064d8[_0x052c('0x39')]['email']=_0x4064d8['body'][_0x052c('0x21')][_0x052c('0x3b')]()[_0x052c('0x3c')]();var _0x45dd90;return db['Setting'][_0x052c('0x3d')]({'where':{'id':0x1},'attributes':[_0x052c('0xd'),_0x052c('0xe')],'raw':!![]})[_0x052c('0xf')](function(_0x105294){_0x45dd90=_0x105294;return db['User'][_0x052c('0x3e')]({'where':{'email':_0x4064d8[_0x052c('0x39')][_0x052c('0x21')]}});})[_0x052c('0xf')](function(_0x506a87){if(!_0x506a87){throw new Error(_0x052c('0x3f'));}if(_0x506a87[_0x052c('0x13')]){throw new Error(_0x052c('0x40'));}if(_0x506a87[_0x052c('0x14')]){if(moment(_0x506a87[_0x052c('0x15')])['add'](_0x45dd90['blockDuration'],'minutes')>moment()){throw new Error(_0x052c('0x41'));}else{_0x506a87[_0x052c('0x14')]=![];_0x506a87['blockedAt']=null;}}_0x506a87[_0x052c('0x42')]=_0x57a985;_0x506a87[_0x052c('0x43')]=Date[_0x052c('0x44')]()+0x36ee80;return _0x506a87['save']();})[_0x052c('0xf')](function(){return sendServiceMail({'to':_0x4064d8['body'][_0x052c('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x052c('0x45')+_0x052c('0x46')+_0x052c('0x47')+_0x4064d8['headers'][_0x052c('0x26')]+_0x052c('0x48')+_0x57a985+'\x0a\x0a'+_0x052c('0x49')});})[_0x052c('0xf')](function(){_0x468c13['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x143025){return handleError(_0x468c13,0x1f4,_0x143025);});};exports[_0x052c('0x4a')]=function(_0xaa538c,_0x271990,_0x1e5970){return db[_0x052c('0x4b')]['find']({'where':{'resetPasswordToken':_0xaa538c[_0x052c('0x4c')][_0x052c('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x052c('0x44')]()}}})[_0x052c('0xf')](function(_0x28507d){if(!_0x28507d){throw new Error(_0x052c('0x4e'));}return db[_0x052c('0xc')][_0x052c('0x3d')]({'attributes':['id',_0x052c('0x4f'),_0x052c('0x50'),_0x052c('0x51')]})[_0x052c('0xf')](function(_0x5b17c9){if(_0x5b17c9['securePassword'])authService[_0x052c('0x52')](_0xaa538c[_0x052c('0x39')]['password']);if(!_0x5b17c9[_0x052c('0x50')]||!_0x28507d['previousPasswords'])return _0x28507d;authService['validatePasswordHistory'](_0xaa538c[_0x052c('0x39')][_0x052c('0x11')],_0x28507d[_0x052c('0x53')],_0x5b17c9[_0x052c('0x51')]);return _0x28507d;})[_0x052c('0xf')](function(){_0x28507d[_0x052c('0x11')]=_0xaa538c[_0x052c('0x39')][_0x052c('0x11')];_0x28507d[_0x052c('0x42')]=null;_0x28507d[_0x052c('0x43')]=null;return _0x28507d[_0x052c('0x54')]();});})[_0x052c('0xf')](function(){_0x271990[_0x052c('0x30')](0xc8)[_0x052c('0x31')]({'message':_0x052c('0x55')});})[_0x052c('0x1f')](function(_0x59e81b){return handleError(_0x271990,0x1f4,_0x59e81b);});};passport[_0x052c('0x56')](new LocalStrategy({'usernameField':_0x052c('0x10'),'passwordField':_0x052c('0x11')},function(_0x37df22,_0x4b05a3,_0x3881d6){return localAuthenticate(db[_0x052c('0x4b')],_0x37df22,_0x4b05a3,_0x3881d6);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index edb08ba..363ed6d 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 _0x71bd=['exports','express','Router','post','login','forgot','reset'];(function(_0x10d157,_0x1014f7){var _0x3fa120=function(_0x1842bf){while(--_0x1842bf){_0x10d157['push'](_0x10d157['shift']());}};_0x3fa120(++_0x1014f7);}(_0x71bd,0x112));var _0xd71b=function(_0x5e1b5f,_0x4b472b){_0x5e1b5f=_0x5e1b5f-0x0;var _0x421700=_0x71bd[_0x5e1b5f];return _0x421700;};'use strict';var express=require(_0xd71b('0x0'));var router=express[_0xd71b('0x1')]();var controller=require('./authLocal.controller');router[_0xd71b('0x2')]('/',controller[_0xd71b('0x3')]);router[_0xd71b('0x2')]('/forgot',controller[_0xd71b('0x4')]);router[_0xd71b('0x2')]('/reset/:token',controller[_0xd71b('0x5')]);module[_0xd71b('0x6')]=router; \ No newline at end of file +var _0x28b2=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','login','post'];(function(_0x3eb87c,_0x4e53e7){var _0x1f9c20=function(_0x52b24c){while(--_0x52b24c){_0x3eb87c['push'](_0x3eb87c['shift']());}};_0x1f9c20(++_0x4e53e7);}(_0x28b2,0xf7));var _0x228b=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x28b2[_0x2f45ea];return _0x485a84;};'use strict';var express=require(_0x228b('0x0'));var router=express[_0x228b('0x1')]();var controller=require(_0x228b('0x2'));router['post']('/',controller[_0x228b('0x3')]);router[_0x228b('0x4')](_0x228b('0x5'),controller[_0x228b('0x6')]);router['post'](_0x228b('0x7'),controller['reset']);module[_0x228b('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 5641d6b..d3843e0 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 _0xd19a=['sequelize','STRING','INTEGER'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0xd19a,0x147));var _0xad19=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd19a[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xad19('0x0'));module['exports']={'name':{'type':Sequelize[_0xad19('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xad19('0x1')]},'description':{'type':Sequelize[_0xad19('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xad19('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xf1c5=['INTEGER','sequelize','exports','STRING'];(function(_0x5e5e77,_0x290ee4){var _0x2d7c62=function(_0x5e6cf3){while(--_0x5e6cf3){_0x5e5e77['push'](_0x5e5e77['shift']());}};_0x2d7c62(++_0x290ee4);}(_0xf1c5,0x81));var _0x5f1c=function(_0x321be3,_0xdf3108){_0x321be3=_0x321be3-0x0;var _0xb0a8e6=_0xf1c5[_0x321be3];return _0xb0a8e6;};'use strict';var Sequelize=require(_0x5f1c('0x0'));module[_0x5f1c('0x1')]={'name':{'type':Sequelize[_0x5f1c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5f1c('0x2')]},'description':{'type':Sequelize[_0x5f1c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5f1c('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 95ea9bc..a931c1b 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 _0x004d=['getConditions','findOne','length','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','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','status','end','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','addConditions','Condition','ids','omit'];(function(_0x20f9bc,_0x1057f0){var _0x2060a4=function(_0x3e3e89){while(--_0x3e3e89){_0x20f9bc['push'](_0x20f9bc['shift']());}};_0x2060a4(++_0x1057f0);}(_0x004d,0xb7));var _0xd004=function(_0x5592a9,_0x352349){_0x5592a9=_0x5592a9-0x0;var _0xa0795=_0x004d[_0x5592a9];return _0xa0795;};'use strict';var emlformat=require(_0xd004('0x0'));var rimraf=require(_0xd004('0x1'));var zipdir=require(_0xd004('0x2'));var jsonpatch=require(_0xd004('0x3'));var rp=require(_0xd004('0x4'));var moment=require(_0xd004('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd004('0x6'));var util=require('util');var path=require(_0xd004('0x7'));var sox=require(_0xd004('0x8'));var csv=require(_0xd004('0x9'));var ejs=require(_0xd004('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd004('0xb'));var squel=require(_0xd004('0xc'));var crypto=require(_0xd004('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd004('0xe'));var toCsv=require(_0xd004('0x9'));var querystring=require(_0xd004('0xf'));var Papa=require(_0xd004('0x10'));var Redis=require(_0xd004('0x11'));var authService=require(_0xd004('0x12'));var qs=require(_0xd004('0x13'));var as=require(_0xd004('0x14'));var hardwareService=require(_0xd004('0x15'));var logger=require('../../config/logger')(_0xd004('0x16'));var utils=require(_0xd004('0x17'));var config=require(_0xd004('0x18'));var licenseUtil=require(_0xd004('0x19'));var db=require(_0xd004('0x1a'))['db'];function respondWithStatusCode(_0x545e7b,_0x1d88d6){_0x1d88d6=_0x1d88d6||0xcc;return function(_0x1b90a7){if(_0x1b90a7){return _0x545e7b['sendStatus'](_0x1d88d6);}return _0x545e7b[_0xd004('0x1b')](_0x1d88d6)[_0xd004('0x1c')]();};}function respondWithResult(_0x203c03,_0x454734){_0x454734=_0x454734||0xc8;return function(_0x2a28f5){if(_0x2a28f5){return _0x203c03[_0xd004('0x1b')](_0x454734)['json'](_0x2a28f5);}};}function respondWithFilteredResult(_0x4fde0a,_0x1e818f){return function(_0x199d68){if(_0x199d68){var _0x2a2582=typeof _0x1e818f['offset']===_0xd004('0x1d')&&typeof _0x1e818f[_0xd004('0x1e')]===_0xd004('0x1d');var _0x28c317=_0x199d68['count'];var _0x4f42fa=_0x2a2582?0x0:_0x1e818f[_0xd004('0x1f')];var _0x5d0447=_0x2a2582?_0x199d68['count']:_0x1e818f[_0xd004('0x1f')]+_0x1e818f['limit'];var _0x2014e2;if(_0x5d0447>=_0x28c317){_0x5d0447=_0x28c317;_0x2014e2=0xc8;}else{_0x2014e2=0xce;}_0x4fde0a['status'](_0x2014e2);return _0x4fde0a[_0xd004('0x20')](_0xd004('0x21'),_0x4f42fa+'-'+_0x5d0447+'/'+_0x28c317)['json'](_0x199d68);}return null;};}function patchUpdates(_0x1aee8a){return function(_0x48a120){try{jsonpatch['apply'](_0x48a120,_0x1aee8a,!![]);}catch(_0x63eb92){return BPromise[_0xd004('0x22')](_0x63eb92);}return _0x48a120[_0xd004('0x23')]();};}function saveUpdates(_0x3b1cd5,_0x1f5b1a){return function(_0x518d7d){if(_0x518d7d){return _0x518d7d[_0xd004('0x24')](_0x3b1cd5)['then'](function(_0x52e965){return _0x52e965;});}return null;};}function removeEntity(_0x20a9e3,_0x5c4225){return function(_0xc3d2c8){if(_0xc3d2c8){return _0xc3d2c8[_0xd004('0x25')]()['then'](function(){_0x20a9e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50121b,_0x3a2ed6){return function(_0x1dfea3){if(!_0x1dfea3){_0x50121b[_0xd004('0x26')](0x194);}return _0x1dfea3;};}function handleError(_0x245a88,_0x290c6d){_0x290c6d=_0x290c6d||0x1f4;return function(_0x2ad8bd){logger[_0xd004('0x27')](_0x2ad8bd[_0xd004('0x28')]);if(_0x2ad8bd[_0xd004('0x29')]){delete _0x2ad8bd[_0xd004('0x29')];}_0x245a88[_0xd004('0x1b')](_0x290c6d)[_0xd004('0x2a')](_0x2ad8bd);};}exports[_0xd004('0x2b')]=function(_0x53185c,_0x1e9744){var _0x37ac46={},_0xf409aa={},_0x581db1={'count':0x0,'rows':[]};var _0x3b1236=_['map'](db[_0xd004('0x2c')][_0xd004('0x2d')],function(_0x5d0326){return{'name':_0x5d0326[_0xd004('0x2e')],'type':_0x5d0326[_0xd004('0x2f')][_0xd004('0x30')]};});_0xf409aa[_0xd004('0x31')]=_[_0xd004('0x32')](_0x3b1236,_0xd004('0x29'));_0xf409aa[_0xd004('0x33')]=_[_0xd004('0x34')](_0x53185c[_0xd004('0x33')]);_0xf409aa['filters']=_[_0xd004('0x35')](_0xf409aa[_0xd004('0x31')],_0xf409aa['query']);_0x37ac46['attributes']=_[_0xd004('0x35')](_0xf409aa[_0xd004('0x31')],qs[_0xd004('0x36')](_0x53185c['query'][_0xd004('0x36')]));_0x37ac46[_0xd004('0x37')]=_0x37ac46['attributes']['length']?_0x37ac46[_0xd004('0x37')]:_0xf409aa[_0xd004('0x31')];if(!_0x53185c['query']['hasOwnProperty'](_0xd004('0x38'))){_0x37ac46[_0xd004('0x1e')]=qs[_0xd004('0x1e')](_0x53185c['query']['limit']);_0x37ac46['offset']=qs[_0xd004('0x1f')](_0x53185c[_0xd004('0x33')][_0xd004('0x1f')]);}_0x37ac46['order']=qs[_0xd004('0x39')](_0x53185c[_0xd004('0x33')][_0xd004('0x39')]);_0x37ac46[_0xd004('0x3a')]=qs['filters'](_[_0xd004('0x3b')](_0x53185c[_0xd004('0x33')],_0xf409aa[_0xd004('0x3c')]),_0x3b1236);if(_0x53185c[_0xd004('0x33')][_0xd004('0x3d')]){_0x37ac46[_0xd004('0x3a')]=_[_0xd004('0x3e')](_0x37ac46[_0xd004('0x3a')],{'$or':_[_0xd004('0x32')](_0x3b1236,function(_0x2bb8f1){if(_0x2bb8f1[_0xd004('0x2f')]!==_0xd004('0x3f')){var _0x32a9ec={};_0x32a9ec[_0x2bb8f1['name']]={'$like':'%'+_0x53185c[_0xd004('0x33')][_0xd004('0x3d')]+'%'};return _0x32a9ec;}})});}_0x37ac46=_[_0xd004('0x3e')]({},_0x37ac46,_0x53185c[_0xd004('0x40')]);var _0x5e625b={'where':_0x37ac46[_0xd004('0x3a')]};return db[_0xd004('0x2c')]['count'](_0x5e625b)[_0xd004('0x41')](function(_0x466823){_0x581db1[_0xd004('0x42')]=_0x466823;if(_0x53185c[_0xd004('0x33')][_0xd004('0x43')]){_0x37ac46['include']=[{'all':!![]}];}return db[_0xd004('0x2c')][_0xd004('0x44')](_0x37ac46);})['then'](function(_0x575ae9){_0x581db1[_0xd004('0x45')]=_0x575ae9;return _0x581db1;})[_0xd004('0x41')](respondWithFilteredResult(_0x1e9744,_0x37ac46))[_0xd004('0x46')](handleError(_0x1e9744,null));};exports[_0xd004('0x47')]=function(_0x472210,_0x268694){var _0x228a2d={'raw':![],'where':{'id':_0x472210['params']['id']}},_0xf7f6e7={};_0xf7f6e7[_0xd004('0x31')]=_[_0xd004('0x34')](db[_0xd004('0x2c')][_0xd004('0x2d')]);_0xf7f6e7[_0xd004('0x33')]=_['keys'](_0x472210[_0xd004('0x33')]);_0xf7f6e7[_0xd004('0x3c')]=_[_0xd004('0x35')](_0xf7f6e7[_0xd004('0x31')],_0xf7f6e7[_0xd004('0x33')]);_0x228a2d['attributes']=_[_0xd004('0x35')](_0xf7f6e7[_0xd004('0x31')],qs[_0xd004('0x36')](_0x472210[_0xd004('0x33')][_0xd004('0x36')]));_0x228a2d[_0xd004('0x37')]=_0x228a2d[_0xd004('0x37')]['length']?_0x228a2d['attributes']:_0xf7f6e7[_0xd004('0x31')];if(_0x472210[_0xd004('0x33')][_0xd004('0x43')]){_0x228a2d[_0xd004('0x48')]=[{'all':!![]}];}_0x228a2d=_[_0xd004('0x3e')]({},_0x228a2d,_0x472210['options']);return db['Automation'][_0xd004('0x49')](_0x228a2d)[_0xd004('0x41')](handleEntityNotFound(_0x268694,null))[_0xd004('0x41')](respondWithResult(_0x268694,null))[_0xd004('0x46')](handleError(_0x268694,null));};exports['create']=function(_0x432040,_0x1d9f3c){return db[_0xd004('0x2c')][_0xd004('0x4a')](_0x432040[_0xd004('0x4b')],{})[_0xd004('0x41')](respondWithResult(_0x1d9f3c,0xc9))['catch'](handleError(_0x1d9f3c,null));};exports[_0xd004('0x24')]=function(_0x278de1,_0x2e3f35){if(_0x278de1['body']['id']){delete _0x278de1[_0xd004('0x4b')]['id'];}return db['Automation'][_0xd004('0x49')]({'where':{'id':_0x278de1[_0xd004('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e3f35,null))[_0xd004('0x41')](saveUpdates(_0x278de1[_0xd004('0x4b')],null))[_0xd004('0x41')](respondWithResult(_0x2e3f35,null))[_0xd004('0x46')](handleError(_0x2e3f35,null));};exports[_0xd004('0x25')]=function(_0x179ca6,_0x53ae76){return db[_0xd004('0x2c')][_0xd004('0x49')]({'where':{'id':_0x179ca6[_0xd004('0x4c')]['id']}})[_0xd004('0x41')](handleEntityNotFound(_0x53ae76,null))[_0xd004('0x41')](removeEntity(_0x53ae76,null))['catch'](handleError(_0x53ae76,null));};exports[_0xd004('0x4d')]=function(_0x48b50c,_0x4957c8,_0x5c0517){return db[_0xd004('0x4e')][_0xd004('0x49')]({'where':{'id':_0x48b50c[_0xd004('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4957c8,null))['then'](function(_0x2f3346){if(_0x2f3346){return _0x2f3346[_0xd004('0x4d')](_0x48b50c[_0xd004('0x4b')][_0xd004('0x4f')],_[_0xd004('0x50')](_0x48b50c[_0xd004('0x4b')],[_0xd004('0x4f'),'id'])||{});}})[_0xd004('0x41')](respondWithResult(_0x4957c8,null))['catch'](handleError(_0x4957c8,null));};exports[_0xd004('0x51')]=function(_0x584d25,_0x2b946a,_0x5d9046){var _0x1424f1={};var _0x3d23cf={};var _0x88ad3b;var _0x2b2b5d;return db[_0xd004('0x2c')][_0xd004('0x52')]({'where':{'id':_0x584d25[_0xd004('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b946a,null))[_0xd004('0x41')](function(_0x9ff447){if(_0x9ff447){_0x88ad3b=_0x9ff447;_0x3d23cf[_0xd004('0x31')]=_['keys'](db[_0xd004('0x4e')][_0xd004('0x2d')]);_0x3d23cf[_0xd004('0x33')]=_[_0xd004('0x34')](_0x584d25['query']);_0x3d23cf[_0xd004('0x3c')]=_[_0xd004('0x35')](_0x3d23cf['model'],_0x3d23cf['query']);_0x1424f1[_0xd004('0x37')]=_[_0xd004('0x35')](_0x3d23cf['model'],qs[_0xd004('0x36')](_0x584d25[_0xd004('0x33')][_0xd004('0x36')]));_0x1424f1['attributes']=_0x1424f1[_0xd004('0x37')][_0xd004('0x53')]?_0x1424f1[_0xd004('0x37')]:_0x3d23cf['model'];_0x1424f1['order']=qs['sort'](_0x584d25['query'][_0xd004('0x39')]);_0x1424f1[_0xd004('0x3a')]=qs[_0xd004('0x3c')](_['pick'](_0x584d25['query'],_0x3d23cf['filters']));if(_0x584d25[_0xd004('0x33')][_0xd004('0x3d')]){_0x1424f1[_0xd004('0x3a')]=_['merge'](_0x1424f1[_0xd004('0x3a')],{'$or':_['map'](_0x1424f1[_0xd004('0x37')],function(_0x2924d1){var _0x39eb9b={};_0x39eb9b[_0x2924d1]={'$like':'%'+_0x584d25[_0xd004('0x33')][_0xd004('0x3d')]+'%'};return _0x39eb9b;})});}_0x1424f1=_['merge']({},_0x1424f1,_0x584d25[_0xd004('0x40')]);return _0x88ad3b[_0xd004('0x51')](_0x1424f1);}})[_0xd004('0x41')](function(_0x3bcc82){if(_0x3bcc82){_0x2b2b5d=_0x3bcc82[_0xd004('0x53')];if(!_0x584d25[_0xd004('0x33')][_0xd004('0x54')]('nolimit')){_0x1424f1[_0xd004('0x1e')]=qs[_0xd004('0x1e')](_0x584d25['query'][_0xd004('0x1e')]);_0x1424f1[_0xd004('0x1f')]=qs[_0xd004('0x1f')](_0x584d25[_0xd004('0x33')][_0xd004('0x1f')]);}return _0x88ad3b['getConditions'](_0x1424f1);}})[_0xd004('0x41')](function(_0x3850a8){if(_0x3850a8){return _0x3850a8?{'count':_0x2b2b5d,'rows':_0x3850a8}:null;}})[_0xd004('0x41')](respondWithResult(_0x2b946a,null))['catch'](handleError(_0x2b946a,null));};exports[_0xd004('0x55')]=function(_0x2a296c,_0x279329,_0x31de28){return db[_0xd004('0x56')][_0xd004('0x49')]({'where':{'id':_0x2a296c['params']['id']}})[_0xd004('0x41')](handleEntityNotFound(_0x279329,null))['then'](function(_0x353cd5){if(_0x353cd5){return _0x353cd5[_0xd004('0x55')](_0x2a296c['body'][_0xd004('0x4f')],_[_0xd004('0x50')](_0x2a296c[_0xd004('0x4b')],[_0xd004('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x279329,null))[_0xd004('0x46')](handleError(_0x279329,null));};exports[_0xd004('0x57')]=function(_0x4e1763,_0x38a195,_0x192e18){var _0x136cc6={};var _0x2170cc={};var _0x2d412b;var _0x4c90be;return db['Automation'][_0xd004('0x52')]({'where':{'id':_0x4e1763[_0xd004('0x4c')]['id']}})[_0xd004('0x41')](handleEntityNotFound(_0x38a195,null))['then'](function(_0x253baf){if(_0x253baf){_0x2d412b=_0x253baf;_0x2170cc[_0xd004('0x31')]=_[_0xd004('0x34')](db['Action']['rawAttributes']);_0x2170cc[_0xd004('0x33')]=_[_0xd004('0x34')](_0x4e1763['query']);_0x2170cc[_0xd004('0x3c')]=_[_0xd004('0x35')](_0x2170cc[_0xd004('0x31')],_0x2170cc[_0xd004('0x33')]);_0x136cc6[_0xd004('0x37')]=_[_0xd004('0x35')](_0x2170cc[_0xd004('0x31')],qs[_0xd004('0x36')](_0x4e1763['query'][_0xd004('0x36')]));_0x136cc6['attributes']=_0x136cc6[_0xd004('0x37')][_0xd004('0x53')]?_0x136cc6['attributes']:_0x2170cc['model'];_0x136cc6['order']=qs[_0xd004('0x39')](_0x4e1763['query']['sort']);_0x136cc6[_0xd004('0x3a')]=qs[_0xd004('0x3c')](_[_0xd004('0x3b')](_0x4e1763[_0xd004('0x33')],_0x2170cc[_0xd004('0x3c')]));if(_0x4e1763[_0xd004('0x33')][_0xd004('0x3d')]){_0x136cc6['where']=_[_0xd004('0x3e')](_0x136cc6[_0xd004('0x3a')],{'$or':_[_0xd004('0x32')](_0x136cc6[_0xd004('0x37')],function(_0x19db0c){var _0x18a133={};_0x18a133[_0x19db0c]={'$like':'%'+_0x4e1763['query'][_0xd004('0x3d')]+'%'};return _0x18a133;})});}_0x136cc6=_['merge']({},_0x136cc6,_0x4e1763[_0xd004('0x40')]);return _0x2d412b['getActions'](_0x136cc6);}})[_0xd004('0x41')](function(_0x2338c9){if(_0x2338c9){_0x4c90be=_0x2338c9[_0xd004('0x53')];if(!_0x4e1763[_0xd004('0x33')][_0xd004('0x54')](_0xd004('0x38'))){_0x136cc6[_0xd004('0x1e')]=qs[_0xd004('0x1e')](_0x4e1763['query'][_0xd004('0x1e')]);_0x136cc6[_0xd004('0x1f')]=qs['offset'](_0x4e1763[_0xd004('0x33')][_0xd004('0x1f')]);}return _0x2d412b[_0xd004('0x57')](_0x136cc6);}})[_0xd004('0x41')](function(_0x4aedff){if(_0x4aedff){return _0x4aedff?{'count':_0x4c90be,'rows':_0x4aedff}:null;}})[_0xd004('0x41')](respondWithResult(_0x38a195,null))['catch'](handleError(_0x38a195,null));}; \ No newline at end of file +var _0x0eb2=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','includeAll','options','create','body','find','addConditions','getConditions','Condition','nolimit','addActions','ids','omit','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/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','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields'];(function(_0xc448c3,_0x455089){var _0x1f332d=function(_0x3703e9){while(--_0x3703e9){_0xc448c3['push'](_0xc448c3['shift']());}};_0x1f332d(++_0x455089);}(_0x0eb2,0x16b));var _0x20eb=function(_0x5e6141,_0x259edc){_0x5e6141=_0x5e6141-0x0;var _0x42340f=_0x0eb2[_0x5e6141];return _0x42340f;};'use strict';var emlformat=require(_0x20eb('0x0'));var rimraf=require(_0x20eb('0x1'));var zipdir=require(_0x20eb('0x2'));var jsonpatch=require(_0x20eb('0x3'));var rp=require(_0x20eb('0x4'));var moment=require(_0x20eb('0x5'));var BPromise=require(_0x20eb('0x6'));var Mustache=require(_0x20eb('0x7'));var util=require(_0x20eb('0x8'));var path=require(_0x20eb('0x9'));var sox=require(_0x20eb('0xa'));var csv=require(_0x20eb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20eb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20eb('0xd'));var jsforce=require(_0x20eb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x20eb('0xf'));var Redis=require(_0x20eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x20eb('0x11'));var as=require(_0x20eb('0x12'));var hardwareService=require(_0x20eb('0x13'));var logger=require(_0x20eb('0x14'))('api');var utils=require(_0x20eb('0x15'));var config=require(_0x20eb('0x16'));var licenseUtil=require(_0x20eb('0x17'));var db=require(_0x20eb('0x18'))['db'];function respondWithStatusCode(_0x2798c9,_0x490533){_0x490533=_0x490533||0xcc;return function(_0x364df7){if(_0x364df7){return _0x2798c9[_0x20eb('0x19')](_0x490533);}return _0x2798c9[_0x20eb('0x1a')](_0x490533)[_0x20eb('0x1b')]();};}function respondWithResult(_0x474bf4,_0x2530b1){_0x2530b1=_0x2530b1||0xc8;return function(_0x5c77f7){if(_0x5c77f7){return _0x474bf4['status'](_0x2530b1)[_0x20eb('0x1c')](_0x5c77f7);}};}function respondWithFilteredResult(_0x3c7d84,_0x4a6386){return function(_0x2987d1){if(_0x2987d1){var _0x4e15b0=typeof _0x4a6386[_0x20eb('0x1d')]===_0x20eb('0x1e')&&typeof _0x4a6386['limit']===_0x20eb('0x1e');var _0x5e4eb8=_0x2987d1[_0x20eb('0x1f')];var _0x395e16=_0x4e15b0?0x0:_0x4a6386[_0x20eb('0x1d')];var _0x519812=_0x4e15b0?_0x2987d1['count']:_0x4a6386[_0x20eb('0x1d')]+_0x4a6386[_0x20eb('0x20')];var _0x3ecc6;if(_0x519812>=_0x5e4eb8){_0x519812=_0x5e4eb8;_0x3ecc6=0xc8;}else{_0x3ecc6=0xce;}_0x3c7d84[_0x20eb('0x1a')](_0x3ecc6);return _0x3c7d84[_0x20eb('0x21')](_0x20eb('0x22'),_0x395e16+'-'+_0x519812+'/'+_0x5e4eb8)[_0x20eb('0x1c')](_0x2987d1);}return null;};}function patchUpdates(_0x3ad27d){return function(_0x2c8327){try{jsonpatch[_0x20eb('0x23')](_0x2c8327,_0x3ad27d,!![]);}catch(_0x18fc4e){return BPromise[_0x20eb('0x24')](_0x18fc4e);}return _0x2c8327['save']();};}function saveUpdates(_0x415eb1,_0x534469){return function(_0x9c9785){if(_0x9c9785){return _0x9c9785[_0x20eb('0x25')](_0x415eb1)[_0x20eb('0x26')](function(_0x37db07){return _0x37db07;});}return null;};}function removeEntity(_0x54ad17,_0x4a2015){return function(_0x5815ff){if(_0x5815ff){return _0x5815ff[_0x20eb('0x27')]()['then'](function(){_0x54ad17[_0x20eb('0x1a')](0xcc)[_0x20eb('0x1b')]();});}};}function handleEntityNotFound(_0x566669,_0x2494b6){return function(_0x4a99d5){if(!_0x4a99d5){_0x566669['sendStatus'](0x194);}return _0x4a99d5;};}function handleError(_0xa2099b,_0x1da478){_0x1da478=_0x1da478||0x1f4;return function(_0x21896f){logger[_0x20eb('0x28')](_0x21896f[_0x20eb('0x29')]);if(_0x21896f[_0x20eb('0x2a')]){delete _0x21896f[_0x20eb('0x2a')];}_0xa2099b[_0x20eb('0x1a')](_0x1da478)[_0x20eb('0x2b')](_0x21896f);};}exports['index']=function(_0x299a73,_0x4f2eb8){var _0xf94d0b={},_0x15b893={},_0x5eec61={'count':0x0,'rows':[]};var _0x38c2b4=_['map'](db[_0x20eb('0x2c')][_0x20eb('0x2d')],function(_0x32494e){return{'name':_0x32494e[_0x20eb('0x2e')],'type':_0x32494e[_0x20eb('0x2f')][_0x20eb('0x30')]};});_0x15b893['model']=_[_0x20eb('0x31')](_0x38c2b4,_0x20eb('0x2a'));_0x15b893[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x299a73[_0x20eb('0x32')]);_0x15b893[_0x20eb('0x34')]=_['intersection'](_0x15b893[_0x20eb('0x35')],_0x15b893[_0x20eb('0x32')]);_0xf94d0b[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0x15b893[_0x20eb('0x35')],qs[_0x20eb('0x38')](_0x299a73[_0x20eb('0x32')]['fields']));_0xf94d0b[_0x20eb('0x36')]=_0xf94d0b[_0x20eb('0x36')][_0x20eb('0x39')]?_0xf94d0b[_0x20eb('0x36')]:_0x15b893[_0x20eb('0x35')];if(!_0x299a73['query'][_0x20eb('0x3a')]('nolimit')){_0xf94d0b['limit']=qs[_0x20eb('0x20')](_0x299a73[_0x20eb('0x32')][_0x20eb('0x20')]);_0xf94d0b['offset']=qs[_0x20eb('0x1d')](_0x299a73[_0x20eb('0x32')][_0x20eb('0x1d')]);}_0xf94d0b[_0x20eb('0x3b')]=qs['sort'](_0x299a73[_0x20eb('0x32')][_0x20eb('0x3c')]);_0xf94d0b[_0x20eb('0x3d')]=qs['filters'](_[_0x20eb('0x3e')](_0x299a73[_0x20eb('0x32')],_0x15b893[_0x20eb('0x34')]),_0x38c2b4);if(_0x299a73[_0x20eb('0x32')][_0x20eb('0x3f')]){_0xf94d0b[_0x20eb('0x3d')]=_[_0x20eb('0x40')](_0xf94d0b[_0x20eb('0x3d')],{'$or':_[_0x20eb('0x31')](_0x38c2b4,function(_0x298726){if(_0x298726[_0x20eb('0x2f')]!==_0x20eb('0x41')){var _0x2acea8={};_0x2acea8[_0x298726[_0x20eb('0x2a')]]={'$like':'%'+_0x299a73[_0x20eb('0x32')][_0x20eb('0x3f')]+'%'};return _0x2acea8;}})});}_0xf94d0b=_['merge']({},_0xf94d0b,_0x299a73['options']);var _0x35c02e={'where':_0xf94d0b['where']};return db[_0x20eb('0x2c')][_0x20eb('0x1f')](_0x35c02e)['then'](function(_0xc041be){_0x5eec61['count']=_0xc041be;if(_0x299a73[_0x20eb('0x32')]['includeAll']){_0xf94d0b[_0x20eb('0x42')]=[{'all':!![]}];}return db['Automation']['findAll'](_0xf94d0b);})[_0x20eb('0x26')](function(_0x285697){_0x5eec61['rows']=_0x285697;return _0x5eec61;})['then'](respondWithFilteredResult(_0x4f2eb8,_0xf94d0b))[_0x20eb('0x43')](handleError(_0x4f2eb8,null));};exports[_0x20eb('0x44')]=function(_0x1c2819,_0x13fd3a){var _0x4a520a={'raw':![],'where':{'id':_0x1c2819[_0x20eb('0x45')]['id']}},_0x44ec76={};_0x44ec76[_0x20eb('0x35')]=_[_0x20eb('0x33')](db['Automation'][_0x20eb('0x2d')]);_0x44ec76[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x1c2819[_0x20eb('0x32')]);_0x44ec76[_0x20eb('0x34')]=_[_0x20eb('0x37')](_0x44ec76[_0x20eb('0x35')],_0x44ec76['query']);_0x4a520a[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0x44ec76['model'],qs[_0x20eb('0x38')](_0x1c2819['query'][_0x20eb('0x38')]));_0x4a520a[_0x20eb('0x36')]=_0x4a520a[_0x20eb('0x36')][_0x20eb('0x39')]?_0x4a520a[_0x20eb('0x36')]:_0x44ec76['model'];if(_0x1c2819['query'][_0x20eb('0x46')]){_0x4a520a[_0x20eb('0x42')]=[{'all':!![]}];}_0x4a520a=_['merge']({},_0x4a520a,_0x1c2819[_0x20eb('0x47')]);return db['Automation']['find'](_0x4a520a)[_0x20eb('0x26')](handleEntityNotFound(_0x13fd3a,null))[_0x20eb('0x26')](respondWithResult(_0x13fd3a,null))['catch'](handleError(_0x13fd3a,null));};exports[_0x20eb('0x48')]=function(_0x3da55b,_0x3acbf6){return db['Automation'][_0x20eb('0x48')](_0x3da55b[_0x20eb('0x49')],{})[_0x20eb('0x26')](respondWithResult(_0x3acbf6,0xc9))[_0x20eb('0x43')](handleError(_0x3acbf6,null));};exports[_0x20eb('0x25')]=function(_0x58ef4a,_0x12b41f){if(_0x58ef4a[_0x20eb('0x49')]['id']){delete _0x58ef4a[_0x20eb('0x49')]['id'];}return db[_0x20eb('0x2c')][_0x20eb('0x4a')]({'where':{'id':_0x58ef4a[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x12b41f,null))['then'](saveUpdates(_0x58ef4a[_0x20eb('0x49')],null))[_0x20eb('0x26')](respondWithResult(_0x12b41f,null))[_0x20eb('0x43')](handleError(_0x12b41f,null));};exports[_0x20eb('0x27')]=function(_0x4ec7f6,_0x415df6){return db['Automation'][_0x20eb('0x4a')]({'where':{'id':_0x4ec7f6[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x415df6,null))['then'](removeEntity(_0x415df6,null))[_0x20eb('0x43')](handleError(_0x415df6,null));};exports['addConditions']=function(_0xa229e9,_0x44f947,_0x2e2492){return db['Condition'][_0x20eb('0x4a')]({'where':{'id':_0xa229e9['params']['id']}})['then'](handleEntityNotFound(_0x44f947,null))['then'](function(_0xe3e781){if(_0xe3e781){return _0xe3e781[_0x20eb('0x4b')](_0xa229e9[_0x20eb('0x49')]['ids'],_['omit'](_0xa229e9['body'],['ids','id'])||{});}})[_0x20eb('0x26')](respondWithResult(_0x44f947,null))[_0x20eb('0x43')](handleError(_0x44f947,null));};exports[_0x20eb('0x4c')]=function(_0x45a5da,_0x50281e,_0x2daf22){var _0x1ab050={};var _0xdcf18={};var _0x3e2ab9;var _0x1d382f;return db['Automation']['findOne']({'where':{'id':_0x45a5da['params']['id']}})['then'](handleEntityNotFound(_0x50281e,null))[_0x20eb('0x26')](function(_0x54f7af){if(_0x54f7af){_0x3e2ab9=_0x54f7af;_0xdcf18[_0x20eb('0x35')]=_[_0x20eb('0x33')](db[_0x20eb('0x4d')]['rawAttributes']);_0xdcf18[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x45a5da[_0x20eb('0x32')]);_0xdcf18[_0x20eb('0x34')]=_['intersection'](_0xdcf18[_0x20eb('0x35')],_0xdcf18['query']);_0x1ab050[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0xdcf18[_0x20eb('0x35')],qs[_0x20eb('0x38')](_0x45a5da[_0x20eb('0x32')][_0x20eb('0x38')]));_0x1ab050['attributes']=_0x1ab050[_0x20eb('0x36')]['length']?_0x1ab050['attributes']:_0xdcf18['model'];_0x1ab050[_0x20eb('0x3b')]=qs['sort'](_0x45a5da[_0x20eb('0x32')][_0x20eb('0x3c')]);_0x1ab050['where']=qs[_0x20eb('0x34')](_[_0x20eb('0x3e')](_0x45a5da['query'],_0xdcf18['filters']));if(_0x45a5da['query'][_0x20eb('0x3f')]){_0x1ab050[_0x20eb('0x3d')]=_[_0x20eb('0x40')](_0x1ab050[_0x20eb('0x3d')],{'$or':_['map'](_0x1ab050['attributes'],function(_0x1d9880){var _0x29879a={};_0x29879a[_0x1d9880]={'$like':'%'+_0x45a5da[_0x20eb('0x32')]['filter']+'%'};return _0x29879a;})});}_0x1ab050=_[_0x20eb('0x40')]({},_0x1ab050,_0x45a5da[_0x20eb('0x47')]);return _0x3e2ab9['getConditions'](_0x1ab050);}})['then'](function(_0x2d892e){if(_0x2d892e){_0x1d382f=_0x2d892e[_0x20eb('0x39')];if(!_0x45a5da['query'][_0x20eb('0x3a')](_0x20eb('0x4e'))){_0x1ab050[_0x20eb('0x20')]=qs[_0x20eb('0x20')](_0x45a5da[_0x20eb('0x32')]['limit']);_0x1ab050['offset']=qs[_0x20eb('0x1d')](_0x45a5da[_0x20eb('0x32')][_0x20eb('0x1d')]);}return _0x3e2ab9[_0x20eb('0x4c')](_0x1ab050);}})[_0x20eb('0x26')](function(_0x3b52b7){if(_0x3b52b7){return _0x3b52b7?{'count':_0x1d382f,'rows':_0x3b52b7}:null;}})[_0x20eb('0x26')](respondWithResult(_0x50281e,null))[_0x20eb('0x43')](handleError(_0x50281e,null));};exports[_0x20eb('0x4f')]=function(_0x5c7793,_0x249b75,_0x3b879f){return db['Action'][_0x20eb('0x4a')]({'where':{'id':_0x5c7793[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x249b75,null))['then'](function(_0xb1ffe1){if(_0xb1ffe1){return _0xb1ffe1[_0x20eb('0x4f')](_0x5c7793[_0x20eb('0x49')][_0x20eb('0x50')],_[_0x20eb('0x51')](_0x5c7793['body'],[_0x20eb('0x50'),'id'])||{});}})[_0x20eb('0x26')](respondWithResult(_0x249b75,null))[_0x20eb('0x43')](handleError(_0x249b75,null));};exports[_0x20eb('0x52')]=function(_0x46cc50,_0x4c925e,_0x2d97f6){var _0x1be866={};var _0x1c901f={};var _0x27a2a1;var _0x39213a;return db[_0x20eb('0x2c')][_0x20eb('0x53')]({'where':{'id':_0x46cc50[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x4c925e,null))['then'](function(_0x5680f7){if(_0x5680f7){_0x27a2a1=_0x5680f7;_0x1c901f[_0x20eb('0x35')]=_[_0x20eb('0x33')](db['Action'][_0x20eb('0x2d')]);_0x1c901f[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x46cc50[_0x20eb('0x32')]);_0x1c901f[_0x20eb('0x34')]=_['intersection'](_0x1c901f['model'],_0x1c901f[_0x20eb('0x32')]);_0x1be866[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0x1c901f[_0x20eb('0x35')],qs[_0x20eb('0x38')](_0x46cc50[_0x20eb('0x32')][_0x20eb('0x38')]));_0x1be866['attributes']=_0x1be866['attributes'][_0x20eb('0x39')]?_0x1be866[_0x20eb('0x36')]:_0x1c901f[_0x20eb('0x35')];_0x1be866[_0x20eb('0x3b')]=qs[_0x20eb('0x3c')](_0x46cc50['query'][_0x20eb('0x3c')]);_0x1be866[_0x20eb('0x3d')]=qs[_0x20eb('0x34')](_[_0x20eb('0x3e')](_0x46cc50[_0x20eb('0x32')],_0x1c901f[_0x20eb('0x34')]));if(_0x46cc50[_0x20eb('0x32')][_0x20eb('0x3f')]){_0x1be866[_0x20eb('0x3d')]=_[_0x20eb('0x40')](_0x1be866[_0x20eb('0x3d')],{'$or':_['map'](_0x1be866[_0x20eb('0x36')],function(_0x42f6fb){var _0x661d72={};_0x661d72[_0x42f6fb]={'$like':'%'+_0x46cc50[_0x20eb('0x32')][_0x20eb('0x3f')]+'%'};return _0x661d72;})});}_0x1be866=_[_0x20eb('0x40')]({},_0x1be866,_0x46cc50[_0x20eb('0x47')]);return _0x27a2a1[_0x20eb('0x52')](_0x1be866);}})['then'](function(_0xd500ec){if(_0xd500ec){_0x39213a=_0xd500ec[_0x20eb('0x39')];if(!_0x46cc50[_0x20eb('0x32')][_0x20eb('0x3a')](_0x20eb('0x4e'))){_0x1be866[_0x20eb('0x20')]=qs['limit'](_0x46cc50[_0x20eb('0x32')][_0x20eb('0x20')]);_0x1be866[_0x20eb('0x1d')]=qs[_0x20eb('0x1d')](_0x46cc50[_0x20eb('0x32')][_0x20eb('0x1d')]);}return _0x27a2a1[_0x20eb('0x52')](_0x1be866);}})[_0x20eb('0x26')](function(_0x2ae184){if(_0x2ae184){return _0x2ae184?{'count':_0x39213a,'rows':_0x2ae184}:null;}})['then'](respondWithResult(_0x4c925e,null))[_0x20eb('0x43')](handleError(_0x4c925e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 77e038a..95db704 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 _0x6fb5=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x5809ee,_0x562615){var _0x4c2578=function(_0x3cdc4a){while(--_0x3cdc4a){_0x5809ee['push'](_0x5809ee['shift']());}};_0x4c2578(++_0x562615);}(_0x6fb5,0x151));var _0x56fb=function(_0x3f04c7,_0x551468){_0x3f04c7=_0x3f04c7-0x0;var _0x48569a=_0x6fb5[_0x3f04c7];return _0x48569a;};'use strict';var _=require(_0x56fb('0x0'));var util=require('util');var logger=require(_0x56fb('0x1'))(_0x56fb('0x2'));var moment=require(_0x56fb('0x3'));var BPromise=require(_0x56fb('0x4'));var rp=require(_0x56fb('0x5'));var fs=require('fs');var path=require(_0x56fb('0x6'));var rimraf=require('rimraf');var config=require(_0x56fb('0x7'));var attributes=require(_0x56fb('0x8'));module[_0x56fb('0x9')]=function(_0x887fd3,_0x1a8a6c){return _0x887fd3[_0x56fb('0xa')](_0x56fb('0xb'),attributes,{'tableName':_0x56fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cae=['../../config/environment','define','../../config/logger','api','moment','path','rimraf'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x3cae,0x160));var _0xe3ca=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x3cae[_0x1b828b];return _0x98da1a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3ca('0x0'))(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3ca('0x3'));var rimraf=require(_0xe3ca('0x4'));var config=require(_0xe3ca('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x4de347,_0x54de10){return _0x4de347[_0xe3ca('0x6')]('Automation',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 ddced8d..74a02b9 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 _0x793b=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x793b,0x189));var _0xb793=function(_0x3febe5,_0x394164){_0x3febe5=_0x3febe5-0x0;var _0x19f600=_0x793b[_0x3febe5];return _0x19f600;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});} \ No newline at end of file +var _0xf846=['http','request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x37d57e,_0x20ee57){var _0x2a820a=function(_0x3dc5ab){while(--_0x3dc5ab){_0x37d57e['push'](_0x37d57e['shift']());}};_0x2a820a(++_0x20ee57);}(_0xf846,0x85));var _0x6f84=function(_0x436fc4,_0x27e86b){_0x436fc4=_0x436fc4-0x0;var _0x4186a1=_0xf846[_0x436fc4];return _0x4186a1;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var moment=require(_0x6f84('0x2'));var BPromise=require(_0x6f84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f84('0x4'));var db=require(_0x6f84('0x5'))['db'];var utils=require(_0x6f84('0x6'));var logger=require(_0x6f84('0x7'))('rpc');var config=require(_0x6f84('0x8'));var jayson=require(_0x6f84('0x9'));var client=jayson[_0x6f84('0xa')][_0x6f84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162a59,_0x45dd2b,_0x4dcf04){return new BPromise(function(_0x196c7a,_0x2da435){return client[_0x6f84('0xc')](_0x162a59,_0x4dcf04)['then'](function(_0x156032){logger[_0x6f84('0xd')]('Automation,\x20%s,\x20%s',_0x45dd2b,_0x6f84('0xe'));logger[_0x6f84('0xf')](_0x6f84('0x10'),_0x45dd2b,_0x6f84('0xe'),JSON[_0x6f84('0x11')](_0x156032));if(_0x156032[_0x6f84('0x12')]){if(_0x156032[_0x6f84('0x12')][_0x6f84('0x13')]===0x1f4){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032[_0x6f84('0x12')]['message']);return _0x2da435(_0x156032[_0x6f84('0x12')]['message']);}logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032['error'][_0x6f84('0x15')]);return _0x196c7a(_0x156032['error'][_0x6f84('0x15')]);}else{logger['info'](_0x6f84('0x14'),_0x45dd2b,'request\x20sent');_0x196c7a(_0x156032[_0x6f84('0x16')]['message']);}})[_0x6f84('0x17')](function(_0x27bc7d){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x27bc7d);_0x2da435(_0x27bc7d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c25e5ae..4967a8c 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 _0xfd28=['isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get'];(function(_0x76075d,_0x5d1b3e){var _0x531f01=function(_0x250585){while(--_0x250585){_0x76075d['push'](_0x76075d['shift']());}};_0x531f01(++_0x5d1b3e);}(_0xfd28,0x148));var _0x8fd2=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xfd28[_0x53abe5];return _0xc1c37e;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['get'](_0x8fd2('0xd'),auth['isAuthenticated'](),controller[_0x8fd2('0xe')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xf')]('/:id/conditions',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x10')]);router[_0x8fd2('0xf')](_0x8fd2('0xd'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x11')]);router[_0x8fd2('0x12')](_0x8fd2('0x13'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x14')]);router[_0x8fd2('0x15')](_0x8fd2('0x13'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x16')]);module[_0x8fd2('0x17')]=router; \ No newline at end of file +var _0xbeff=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','destroy','exports','util','path'];(function(_0x3401ee,_0x19476c){var _0x383615=function(_0x43ff06){while(--_0x43ff06){_0x3401ee['push'](_0x3401ee['shift']());}};_0x383615(++_0x19476c);}(_0xbeff,0x8e));var _0xfbef=function(_0x15d376,_0x474400){_0x15d376=_0x15d376-0x0;var _0x125fa1=_0xbeff[_0x15d376];return _0x125fa1;};'use strict';var multer=require('multer');var util=require(_0xfbef('0x0'));var path=require(_0xfbef('0x1'));var timeout=require(_0xfbef('0x2'));var express=require(_0xfbef('0x3'));var router=express[_0xfbef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfbef('0x5'));var config=require(_0xfbef('0x6'));var controller=require(_0xfbef('0x7'));router[_0xfbef('0x8')]('/',auth['isAuthenticated'](),controller[_0xfbef('0x9')]);router[_0xfbef('0x8')]('/:id',auth[_0xfbef('0xa')](),controller[_0xfbef('0xb')]);router['get'](_0xfbef('0xc'),auth['isAuthenticated'](),controller[_0xfbef('0xd')]);router['get'](_0xfbef('0xe'),auth[_0xfbef('0xa')](),controller[_0xfbef('0xf')]);router[_0xfbef('0x10')]('/',auth[_0xfbef('0xa')](),controller[_0xfbef('0x11')]);router[_0xfbef('0x10')](_0xfbef('0xc'),auth['isAuthenticated'](),controller[_0xfbef('0x12')]);router[_0xfbef('0x10')](_0xfbef('0xe'),auth[_0xfbef('0xa')](),controller[_0xfbef('0x13')]);router[_0xfbef('0x14')](_0xfbef('0x15'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xfbef('0xa')](),controller[_0xfbef('0x16')]);module[_0xfbef('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index be9cac4..9e2edeb 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 _0xd615=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xee6027,_0x2f2baf){var _0x95d4d6=function(_0x2b3165){while(--_0x2b3165){_0xee6027['push'](_0xee6027['shift']());}};_0x95d4d6(++_0x2f2baf);}(_0xd615,0x132));var _0x5d61=function(_0x4a11b3,_0x3b563a){_0x4a11b3=_0x4a11b3-0x0;var _0x49c4a1=_0xd615[_0x4a11b3];return _0x49c4a1;};'use strict';var Sequelize=require(_0x5d61('0x0'));module[_0x5d61('0x1')]={'name':{'type':Sequelize[_0x5d61('0x2')],'unique':_0x5d61('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5d61('0x4')](_0x5d61('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5d61('0x6')},'limitCalls':{'type':Sequelize[_0x5d61('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5d61('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d61('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5d61('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5d61('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'comment':_0x5d61('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x5d61('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d61('0x2')],'defaultValue':_0x5d61('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x5d61('0x4')](_0x5d61('0x11'),_0x5d61('0x12'),'onlyIfOpen'),'defaultValue':_0x5d61('0x11')},'dialAMDActive':{'type':Sequelize[_0x5d61('0x13')],'defaultValue':0x0,'comment':_0x5d61('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5d61('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5d61('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d61('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5d61('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5d61('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5d61('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5d61('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5d61('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d61('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5d61('0x4')](_0x5d61('0x1c'),_0x5d61('0x1d')),'defaultValue':_0x5d61('0x1c')},'dialPrefix':{'type':Sequelize[_0x5d61('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d61('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x25')}}; \ No newline at end of file +var _0xf34b=['DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#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'];(function(_0x3abd20,_0x205c3d){var _0xe2f3af=function(_0x373102){while(--_0x373102){_0x3abd20['push'](_0x3abd20['shift']());}};_0xe2f3af(++_0x205c3d);}(_0xf34b,0x10e));var _0xbf34=function(_0x36831e,_0x14f9de){_0x36831e=_0x36831e-0x0;var _0x508c65=_0xf34b[_0x36831e];return _0x508c65;};'use strict';var Sequelize=require(_0xbf34('0x0'));module[_0xbf34('0x1')]={'name':{'type':Sequelize[_0xbf34('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbf34('0x3')](_0xbf34('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbf34('0x5')},'limitCalls':{'type':Sequelize[_0xbf34('0x6')](0x4)[_0xbf34('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbf34('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbf34('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xbf34('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbf34('0x2')],'defaultValue':_0xbf34('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xbf34('0xe'),_0xbf34('0xf'),_0xbf34('0x10')),'defaultValue':_0xbf34('0xe')},'dialAMDActive':{'type':Sequelize[_0xbf34('0x11')],'defaultValue':0x0,'comment':_0xbf34('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbf34('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbf34('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf34('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbf34('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbf34('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbf34('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbf34('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbf34('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbf34('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf34('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbf34('0x3')](_0xbf34('0x1a'),_0xbf34('0x1b')),'defaultValue':_0xbf34('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf34('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf34('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index eea5906..9851568 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 _0x501d=['Campaign','includeAll','findAll','rows','catch','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','params','omit','updatedAt','createdAt','userProfileId','update','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','where','merge','options'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x501d,0x15c));var _0xd501=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x501d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd501('0x0'));var zipdir=require(_0xd501('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd501('0x2'));var moment=require(_0xd501('0x3'));var BPromise=require(_0xd501('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd501('0x5'));var sox=require(_0xd501('0x6'));var csv=require(_0xd501('0x7'));var ejs=require(_0xd501('0x8'));var fs=require('fs');var fs_extra=require(_0xd501('0x9'));var _=require(_0xd501('0xa'));var squel=require(_0xd501('0xb'));var crypto=require(_0xd501('0xc'));var jsforce=require(_0xd501('0xd'));var deskjs=require(_0xd501('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd501('0xf'));var Papa=require(_0xd501('0x10'));var Redis=require(_0xd501('0x11'));var authService=require(_0xd501('0x12'));var qs=require(_0xd501('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd501('0x14'));var logger=require(_0xd501('0x15'))(_0xd501('0x16'));var utils=require('../../config/utils');var config=require(_0xd501('0x17'));var licenseUtil=require(_0xd501('0x18'));var db=require(_0xd501('0x19'))['db'];function respondWithStatusCode(_0x4d8c08,_0x316274){_0x316274=_0x316274||0xcc;return function(_0x3317d2){if(_0x3317d2){return _0x4d8c08[_0xd501('0x1a')](_0x316274);}return _0x4d8c08[_0xd501('0x1b')](_0x316274)[_0xd501('0x1c')]();};}function respondWithResult(_0x51ee5d,_0x5b1b2d){_0x5b1b2d=_0x5b1b2d||0xc8;return function(_0x3a6a7a){if(_0x3a6a7a){return _0x51ee5d[_0xd501('0x1b')](_0x5b1b2d)[_0xd501('0x1d')](_0x3a6a7a);}};}function respondWithFilteredResult(_0x204260,_0x40dbd1){return function(_0x81b380){if(_0x81b380){var _0x5bb88b=typeof _0x40dbd1[_0xd501('0x1e')]===_0xd501('0x1f')&&typeof _0x40dbd1[_0xd501('0x20')]===_0xd501('0x1f');var _0xea725d=_0x81b380[_0xd501('0x21')];var _0x6950a0=_0x5bb88b?0x0:_0x40dbd1[_0xd501('0x1e')];var _0x3e542f=_0x5bb88b?_0x81b380[_0xd501('0x21')]:_0x40dbd1[_0xd501('0x1e')]+_0x40dbd1['limit'];var _0x217415;if(_0x3e542f>=_0xea725d){_0x3e542f=_0xea725d;_0x217415=0xc8;}else{_0x217415=0xce;}_0x204260['status'](_0x217415);return _0x204260[_0xd501('0x22')](_0xd501('0x23'),_0x6950a0+'-'+_0x3e542f+'/'+_0xea725d)[_0xd501('0x1d')](_0x81b380);}return null;};}function patchUpdates(_0x56e883){return function(_0x21d5f2){try{jsonpatch[_0xd501('0x24')](_0x21d5f2,_0x56e883,!![]);}catch(_0x30b216){return BPromise[_0xd501('0x25')](_0x30b216);}return _0x21d5f2[_0xd501('0x26')]();};}function saveUpdates(_0xe41c4f,_0x2d64ae){return function(_0x2391be){if(_0x2391be){return _0x2391be['update'](_0xe41c4f)['then'](function(_0x5f0900){return _0x5f0900;});}return null;};}function removeEntity(_0x34d4dc,_0x51ab8d){return function(_0x53c2ac){if(_0x53c2ac){return _0x53c2ac[_0xd501('0x27')]()['then'](function(){var _0x466b4f=_0x53c2ac[_0xd501('0x28')]({'plain':!![]});var _0x347c87=_0xd501('0x29');return db[_0xd501('0x2a')][_0xd501('0x27')]({'where':{'type':_0x347c87,'resourceId':_0x466b4f['id']}})[_0xd501('0x2b')](function(){return _0x53c2ac;});})['then'](function(){_0x34d4dc[_0xd501('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542676,_0x582224){return function(_0x38767f){if(!_0x38767f){_0x542676[_0xd501('0x1a')](0x194);}return _0x38767f;};}function handleError(_0x5eaee3,_0xc304b9){_0xc304b9=_0xc304b9||0x1f4;return function(_0x48d169){logger[_0xd501('0x2c')](_0x48d169[_0xd501('0x2d')]);if(_0x48d169['name']){delete _0x48d169[_0xd501('0x2e')];}_0x5eaee3['status'](_0xc304b9)[_0xd501('0x2f')](_0x48d169);};}exports[_0xd501('0x30')]=function(_0x2907d1,_0x2d7723){var _0x14f535={},_0x3393f5={},_0x5ea9b6={'count':0x0,'rows':[]};var _0xd5009=_[_0xd501('0x31')](db['Campaign'][_0xd501('0x32')],function(_0x362d27){return{'name':_0x362d27[_0xd501('0x33')],'type':_0x362d27[_0xd501('0x34')][_0xd501('0x35')]};});_0x3393f5[_0xd501('0x36')]=_[_0xd501('0x31')](_0xd5009,_0xd501('0x2e'));_0x3393f5[_0xd501('0x37')]=_[_0xd501('0x38')](_0x2907d1[_0xd501('0x37')]);_0x3393f5['filters']=_['intersection'](_0x3393f5[_0xd501('0x36')],_0x3393f5['query']);_0x14f535[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x3393f5[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x2907d1[_0xd501('0x37')][_0xd501('0x3b')]));_0x14f535[_0xd501('0x39')]=_0x14f535[_0xd501('0x39')]['length']?_0x14f535['attributes']:_0x3393f5['model'];if(!_0x2907d1[_0xd501('0x37')]['hasOwnProperty'](_0xd501('0x3c'))){_0x14f535['limit']=qs['limit'](_0x2907d1[_0xd501('0x37')][_0xd501('0x20')]);_0x14f535['offset']=qs['offset'](_0x2907d1[_0xd501('0x37')][_0xd501('0x1e')]);}_0x14f535[_0xd501('0x3d')]=qs['sort'](_0x2907d1['query'][_0xd501('0x3e')]);_0x14f535['where']=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0x2907d1[_0xd501('0x37')],_0x3393f5['filters']),_0xd5009);if(_0x2907d1['query'][_0xd501('0x41')]){_0x14f535[_0xd501('0x42')]=_['merge'](_0x14f535[_0xd501('0x42')],{'$or':_['map'](_0xd5009,function(_0x395dd4){if(_0x395dd4[_0xd501('0x34')]!=='VIRTUAL'){var _0x54de9d={};_0x54de9d[_0x395dd4[_0xd501('0x2e')]]={'$like':'%'+_0x2907d1[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x54de9d;}})});}_0x14f535=_[_0xd501('0x43')]({},_0x14f535,_0x2907d1[_0xd501('0x44')]);var _0x23d698={'where':_0x14f535[_0xd501('0x42')]};return db[_0xd501('0x45')][_0xd501('0x21')](_0x23d698)[_0xd501('0x2b')](function(_0x551727){_0x5ea9b6['count']=_0x551727;if(_0x2907d1['query'][_0xd501('0x46')]){_0x14f535['include']=[{'all':!![]}];}return db['Campaign'][_0xd501('0x47')](_0x14f535);})[_0xd501('0x2b')](function(_0x1f26b2){_0x5ea9b6[_0xd501('0x48')]=_0x1f26b2;return _0x5ea9b6;})['then'](respondWithFilteredResult(_0x2d7723,_0x14f535))[_0xd501('0x49')](handleError(_0x2d7723,null));};exports[_0xd501('0x4a')]=function(_0x901bfc,_0xec443e){var _0x2a1e3a={'raw':![],'where':{'id':_0x901bfc['params']['id']}},_0x2b93b6={};_0x2b93b6['model']=_[_0xd501('0x38')](db['Campaign'][_0xd501('0x32')]);_0x2b93b6[_0xd501('0x37')]=_[_0xd501('0x38')](_0x901bfc[_0xd501('0x37')]);_0x2b93b6['filters']=_['intersection'](_0x2b93b6[_0xd501('0x36')],_0x2b93b6[_0xd501('0x37')]);_0x2a1e3a[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x2b93b6[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x901bfc[_0xd501('0x37')][_0xd501('0x3b')]));_0x2a1e3a[_0xd501('0x39')]=_0x2a1e3a['attributes'][_0xd501('0x4b')]?_0x2a1e3a['attributes']:_0x2b93b6['model'];if(_0x901bfc[_0xd501('0x37')][_0xd501('0x46')]){_0x2a1e3a[_0xd501('0x4c')]=[{'all':!![]}];}_0x2a1e3a=_['merge']({},_0x2a1e3a,_0x901bfc[_0xd501('0x44')]);return db[_0xd501('0x45')][_0xd501('0x4d')](_0x2a1e3a)[_0xd501('0x2b')](handleEntityNotFound(_0xec443e,null))['then'](respondWithResult(_0xec443e,null))['catch'](handleError(_0xec443e,null));};exports['create']=function(_0x409e84,_0x5d07cf){return db[_0xd501('0x45')][_0xd501('0x4e')](_0x409e84[_0xd501('0x4f')],{})['then'](function(_0x4fd03f){var _0x26bd32=_0x409e84[_0xd501('0x50')][_0xd501('0x28')]({'plain':!![]});if(!_0x26bd32)throw new Error(_0xd501('0x51'));if(_0x26bd32[_0xd501('0x52')]==='user'){var _0x4be9c8=_0x4fd03f[_0xd501('0x28')]({'plain':!![]});var _0x310727='IvrCampaigns';return db[_0xd501('0x53')][_0xd501('0x4d')]({'where':{'name':_0x310727,'userProfileId':_0x26bd32['userProfileId']},'raw':!![]})[_0xd501('0x2b')](function(_0x4d67fa){if(_0x4d67fa&&_0x4d67fa[_0xd501('0x54')]===0x0){return db['UserProfileResource'][_0xd501('0x4e')]({'name':_0x4be9c8[_0xd501('0x2e')],'resourceId':_0x4be9c8['id'],'type':_0x4d67fa[_0xd501('0x2e')],'sectionId':_0x4d67fa['id']},{})[_0xd501('0x2b')](function(){return _0x4fd03f;});}else{return _0x4fd03f;}})[_0xd501('0x49')](function(_0x1659f3){logger[_0xd501('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1659f3);throw _0x1659f3;});}return _0x4fd03f;})[_0xd501('0x2b')](respondWithResult(_0x5d07cf,0xc9))[_0xd501('0x49')](handleError(_0x5d07cf,null));};exports[_0xd501('0x55')]=function(_0x30c39b,_0x2c9579){var _0x495034={'where':{'id':_0x30c39b[_0xd501('0x56')]['id']}},_0x5573d8={};_0x5573d8[_0xd501('0x36')]=_[_0xd501('0x38')](db['Campaign'][_0xd501('0x32')]);_0x495034[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x5573d8[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x30c39b[_0xd501('0x37')][_0xd501('0x3b')]));_0x495034[_0xd501('0x39')]=_0x495034[_0xd501('0x39')][_0xd501('0x4b')]?_0x495034['attributes']:_0x5573d8[_0xd501('0x36')];if(_0x30c39b[_0xd501('0x37')][_0xd501('0x46')]){_0x495034[_0xd501('0x4c')]=[{'all':!![]}];}_0x495034=_['merge']({},_0x495034,_0x30c39b['options']);return db[_0xd501('0x45')][_0xd501('0x4d')](_0x495034)[_0xd501('0x2b')](handleEntityNotFound(_0x2c9579,null))[_0xd501('0x2b')](function(_0x3abbd2){if(_0x3abbd2){var _0x21a742=_0x3abbd2[_0xd501('0x28')]({'plain':!![]});_0x21a742=qs[_0xd501('0x57')](_0x21a742,['id','createdAt',_0xd501('0x58')]);_0x30c39b['body']=_[_0xd501('0x57')](_0x30c39b[_0xd501('0x4f')],['id',_0xd501('0x59'),'updatedAt']);return db[_0xd501('0x45')][_0xd501('0x4e')](_[_0xd501('0x43')](_0x21a742,_0x30c39b[_0xd501('0x4f')]),{'include':_0x30c39b[_0xd501('0x37')][_0xd501('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x252a8d){var _0x4ff99e=_0x30c39b['user'][_0xd501('0x28')]({'plain':!![]});if(!_0x4ff99e)throw new Error(_0xd501('0x51'));if(_0x4ff99e[_0xd501('0x52')]===_0xd501('0x50')){var _0x364543=_0x252a8d[_0xd501('0x28')]({'plain':!![]});var _0xfb3614=_0xd501('0x29');return db['UserProfileSection'][_0xd501('0x4d')]({'where':{'name':_0xfb3614,'userProfileId':_0x4ff99e[_0xd501('0x5a')]},'raw':!![]})[_0xd501('0x2b')](function(_0x231f3f){if(_0x231f3f&&_0x231f3f[_0xd501('0x54')]===0x0){return db[_0xd501('0x2a')][_0xd501('0x4e')]({'name':_0x364543[_0xd501('0x2e')],'resourceId':_0x364543['id'],'type':_0x231f3f[_0xd501('0x2e')],'sectionId':_0x231f3f['id']},{})['then'](function(){return _0x252a8d;});}else{return _0x252a8d;}})[_0xd501('0x49')](function(_0x44fb55){logger[_0xd501('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fb55);throw _0x44fb55;});}return _0x252a8d;});}})[_0xd501('0x2b')](respondWithResult(_0x2c9579,0xc9))[_0xd501('0x49')](handleError(_0x2c9579,null));};exports[_0xd501('0x5b')]=function(_0xb63ac3,_0x313d2b){if(_0xb63ac3[_0xd501('0x4f')]['id']){delete _0xb63ac3[_0xd501('0x4f')]['id'];}return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0xb63ac3[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x313d2b,null))[_0xd501('0x2b')](saveUpdates(_0xb63ac3[_0xd501('0x4f')],null))[_0xd501('0x2b')](respondWithResult(_0x313d2b,null))['catch'](handleError(_0x313d2b,null));};exports[_0xd501('0x27')]=function(_0x5aafc8,_0x387f33){return db[_0xd501('0x45')]['find']({'where':{'id':_0x5aafc8[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x387f33,null))[_0xd501('0x2b')](removeEntity(_0x387f33,null))[_0xd501('0x49')](handleError(_0x387f33,null));};exports[_0xd501('0x5c')]=function(_0x5c3e92,_0x224a02,_0x53e572){var _0x3d7146={'raw':!![],'where':{}};var _0x2a62d3={};var _0x518048={'count':0x0,'rows':[]};return db[_0xd501('0x45')][_0xd501('0x5d')]({'where':{'id':_0x5c3e92[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x224a02,null))[_0xd501('0x2b')](function(_0x103895){if(_0x103895){_0x2a62d3[_0xd501('0x36')]=_['keys'](db[_0xd501('0x5e')]['rawAttributes']);_0x2a62d3['query']=_[_0xd501('0x38')](_0x5c3e92['query']);_0x2a62d3[_0xd501('0x3f')]=_[_0xd501('0x3a')](_0x2a62d3[_0xd501('0x36')],_0x2a62d3['query']);_0x3d7146['attributes']=_['intersection'](_0x2a62d3[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x5c3e92[_0xd501('0x37')]['fields']));_0x3d7146[_0xd501('0x39')]=_0x3d7146[_0xd501('0x39')]['length']?_0x3d7146['attributes']:_0x2a62d3[_0xd501('0x36')];if(!_0x5c3e92[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x3d7146[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x5c3e92[_0xd501('0x37')][_0xd501('0x20')]);_0x3d7146[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x5c3e92[_0xd501('0x37')]['offset']);}_0x3d7146[_0xd501('0x3d')]=qs['sort'](_0x5c3e92['query'][_0xd501('0x3e')]);_0x3d7146['where']=qs[_0xd501('0x3f')](_['pick'](_0x5c3e92[_0xd501('0x37')],_0x2a62d3[_0xd501('0x3f')]));_0x3d7146[_0xd501('0x42')][_0xd501('0x60')]=_0x103895['id'];if(_0x5c3e92[_0xd501('0x37')][_0xd501('0x41')]){_0x3d7146[_0xd501('0x42')]=_[_0xd501('0x43')](_0x3d7146['where'],{'$or':_[_0xd501('0x31')](_0x3d7146[_0xd501('0x39')],function(_0x2a92cd){var _0x42bed8={};_0x42bed8[_0x2a92cd]={'$like':'%'+_0x5c3e92[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x42bed8;})});}_0x3d7146=_[_0xd501('0x43')]({},_0x3d7146,_0x5c3e92[_0xd501('0x44')]);return db[_0xd501('0x5e')][_0xd501('0x21')]({'where':_0x3d7146[_0xd501('0x42')]})[_0xd501('0x2b')](function(_0x523d97){_0x518048[_0xd501('0x21')]=_0x523d97;if(_0x5c3e92['query']['includeAll']){_0x3d7146[_0xd501('0x4c')]=[{'all':!![]}];}return db[_0xd501('0x5e')][_0xd501('0x47')](_0x3d7146);})['then'](function(_0x43c05f){_0x518048[_0xd501('0x48')]=_0x43c05f;return _0x518048;});}})[_0xd501('0x2b')](respondWithFilteredResult(_0x224a02,_0x3d7146))[_0xd501('0x49')](handleError(_0x224a02,null));};exports[_0xd501('0x61')]=function(_0xc5c8e4,_0x5a2bbd,_0x5ec760){var _0x4de2a2={'raw':!![],'where':{}};var _0x27ecaa={};var _0x19cb24={'count':0x0,'rows':[]};return db[_0xd501('0x45')][_0xd501('0x5d')]({'where':{'id':_0xc5c8e4['params']['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x5a2bbd,null))[_0xd501('0x2b')](function(_0xf0ab1c){if(_0xf0ab1c){_0x27ecaa[_0xd501('0x36')]=_[_0xd501('0x38')](db[_0xd501('0x62')][_0xd501('0x32')]);_0x27ecaa['query']=_[_0xd501('0x38')](_0xc5c8e4[_0xd501('0x37')]);_0x27ecaa[_0xd501('0x3f')]=_[_0xd501('0x3a')](_0x27ecaa[_0xd501('0x36')],_0x27ecaa['query']);_0x4de2a2[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x27ecaa['model'],qs[_0xd501('0x3b')](_0xc5c8e4[_0xd501('0x37')][_0xd501('0x3b')]));_0x4de2a2[_0xd501('0x39')]=_0x4de2a2[_0xd501('0x39')][_0xd501('0x4b')]?_0x4de2a2[_0xd501('0x39')]:_0x27ecaa[_0xd501('0x36')];if(!_0xc5c8e4[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x4de2a2[_0xd501('0x20')]=qs[_0xd501('0x20')](_0xc5c8e4[_0xd501('0x37')][_0xd501('0x20')]);_0x4de2a2['offset']=qs[_0xd501('0x1e')](_0xc5c8e4[_0xd501('0x37')][_0xd501('0x1e')]);}_0x4de2a2[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0xc5c8e4['query'][_0xd501('0x3e')]);_0x4de2a2[_0xd501('0x42')]=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0xc5c8e4['query'],_0x27ecaa[_0xd501('0x3f')]));_0x4de2a2[_0xd501('0x42')][_0xd501('0x60')]=_0xf0ab1c['id'];if(_0xc5c8e4[_0xd501('0x37')]['filter']){_0x4de2a2[_0xd501('0x42')]=_['merge'](_0x4de2a2[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x4de2a2[_0xd501('0x39')],function(_0x1b85e9){var _0xd93f96={};_0xd93f96[_0x1b85e9]={'$like':'%'+_0xc5c8e4['query'][_0xd501('0x41')]+'%'};return _0xd93f96;})});}_0x4de2a2=_[_0xd501('0x43')]({},_0x4de2a2,_0xc5c8e4['options']);return db[_0xd501('0x62')][_0xd501('0x21')]({'where':_0x4de2a2[_0xd501('0x42')]})[_0xd501('0x2b')](function(_0xaffa3e){_0x19cb24[_0xd501('0x21')]=_0xaffa3e;if(_0xc5c8e4[_0xd501('0x37')][_0xd501('0x46')]){_0x4de2a2[_0xd501('0x4c')]=[{'all':!![]}];}return db[_0xd501('0x62')]['findAll'](_0x4de2a2);})[_0xd501('0x2b')](function(_0xbf4389){_0x19cb24[_0xd501('0x48')]=_0xbf4389;return _0x19cb24;});}})['then'](respondWithFilteredResult(_0x5a2bbd,_0x4de2a2))[_0xd501('0x49')](handleError(_0x5a2bbd,null));};exports[_0xd501('0x63')]=function(_0x4f51e5,_0x7fb30e,_0x1987eb){var _0x331c4f={'raw':!![],'where':{}};var _0x340191={};var _0x868cc6={'count':0x0,'rows':[]};return db[_0xd501('0x45')][_0xd501('0x5d')]({'where':{'id':_0x4f51e5[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x7fb30e,null))[_0xd501('0x2b')](function(_0x1c0753){if(_0x1c0753){_0x340191[_0xd501('0x36')]=_['keys'](db[_0xd501('0x64')][_0xd501('0x32')]);_0x340191[_0xd501('0x37')]=_[_0xd501('0x38')](_0x4f51e5[_0xd501('0x37')]);_0x340191['filters']=_[_0xd501('0x3a')](_0x340191[_0xd501('0x36')],_0x340191['query']);_0x331c4f[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x340191[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x4f51e5['query']['fields']));_0x331c4f[_0xd501('0x39')]=_0x331c4f[_0xd501('0x39')][_0xd501('0x4b')]?_0x331c4f[_0xd501('0x39')]:_0x340191['model'];if(!_0x4f51e5[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x331c4f[_0xd501('0x20')]=qs['limit'](_0x4f51e5[_0xd501('0x37')][_0xd501('0x20')]);_0x331c4f[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x4f51e5[_0xd501('0x37')][_0xd501('0x1e')]);}_0x331c4f[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0x4f51e5[_0xd501('0x37')][_0xd501('0x3e')]);_0x331c4f[_0xd501('0x42')]=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0x4f51e5[_0xd501('0x37')],_0x340191[_0xd501('0x3f')]));_0x331c4f[_0xd501('0x42')][_0xd501('0x60')]=_0x1c0753['id'];if(_0x4f51e5[_0xd501('0x37')]['filter']){_0x331c4f[_0xd501('0x42')]=_[_0xd501('0x43')](_0x331c4f[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x331c4f[_0xd501('0x39')],function(_0x2352a6){var _0x238e13={};_0x238e13[_0x2352a6]={'$like':'%'+_0x4f51e5[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x238e13;})});}_0x331c4f=_[_0xd501('0x43')]({},_0x331c4f,_0x4f51e5[_0xd501('0x44')]);return db['CmHopperFinal'][_0xd501('0x21')]({'where':_0x331c4f[_0xd501('0x42')]})[_0xd501('0x2b')](function(_0x6d5158){_0x868cc6[_0xd501('0x21')]=_0x6d5158;if(_0x4f51e5[_0xd501('0x37')][_0xd501('0x46')]){_0x331c4f[_0xd501('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x331c4f);})[_0xd501('0x2b')](function(_0x7a70df){_0x868cc6[_0xd501('0x48')]=_0x7a70df;return _0x868cc6;});}})['then'](respondWithFilteredResult(_0x7fb30e,_0x331c4f))['catch'](handleError(_0x7fb30e,null));};exports['getHopperBlacks']=function(_0x6402f9,_0x45b203,_0x451ca9){var _0x5e5c9f={'raw':!![],'where':{}};var _0x57e332={};var _0x7d6196={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x6402f9[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x45b203,null))[_0xd501('0x2b')](function(_0x1654c1){if(_0x1654c1){_0x57e332[_0xd501('0x36')]=_[_0xd501('0x38')](db[_0xd501('0x65')][_0xd501('0x32')]);_0x57e332[_0xd501('0x37')]=_[_0xd501('0x38')](_0x6402f9[_0xd501('0x37')]);_0x57e332[_0xd501('0x3f')]=_[_0xd501('0x3a')](_0x57e332['model'],_0x57e332[_0xd501('0x37')]);_0x5e5c9f[_0xd501('0x39')]=_['intersection'](_0x57e332[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x6402f9[_0xd501('0x37')][_0xd501('0x3b')]));_0x5e5c9f[_0xd501('0x39')]=_0x5e5c9f[_0xd501('0x39')][_0xd501('0x4b')]?_0x5e5c9f[_0xd501('0x39')]:_0x57e332[_0xd501('0x36')];if(!_0x6402f9[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x5e5c9f[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x6402f9[_0xd501('0x37')][_0xd501('0x20')]);_0x5e5c9f[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x6402f9[_0xd501('0x37')]['offset']);}_0x5e5c9f[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0x6402f9[_0xd501('0x37')]['sort']);_0x5e5c9f[_0xd501('0x42')]=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0x6402f9[_0xd501('0x37')],_0x57e332[_0xd501('0x3f')]));_0x5e5c9f[_0xd501('0x42')][_0xd501('0x60')]=_0x1654c1['id'];if(_0x6402f9['query'][_0xd501('0x41')]){_0x5e5c9f[_0xd501('0x42')]=_[_0xd501('0x43')](_0x5e5c9f[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x5e5c9f[_0xd501('0x39')],function(_0x1c38fc){var _0xeaf7bc={};_0xeaf7bc[_0x1c38fc]={'$like':'%'+_0x6402f9['query'][_0xd501('0x41')]+'%'};return _0xeaf7bc;})});}_0x5e5c9f=_[_0xd501('0x43')]({},_0x5e5c9f,_0x6402f9[_0xd501('0x44')]);return db[_0xd501('0x65')][_0xd501('0x21')]({'where':_0x5e5c9f[_0xd501('0x42')]})['then'](function(_0x1f6f83){_0x7d6196['count']=_0x1f6f83;if(_0x6402f9['query'][_0xd501('0x46')]){_0x5e5c9f[_0xd501('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd501('0x47')](_0x5e5c9f);})[_0xd501('0x2b')](function(_0xf0339b){_0x7d6196[_0xd501('0x48')]=_0xf0339b;return _0x7d6196;});}})[_0xd501('0x2b')](respondWithFilteredResult(_0x45b203,_0x5e5c9f))[_0xd501('0x49')](handleError(_0x45b203,null));};exports['getLists']=function(_0x54cfa3,_0x4c4e90,_0x15b1d2){var _0x12c83f={};var _0x10b9dd={};var _0x2c7de6;var _0x5a9335;return db['Campaign'][_0xd501('0x5d')]({'where':{'id':_0x54cfa3['params']['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x4c4e90,null))[_0xd501('0x2b')](function(_0x1e7a19){if(_0x1e7a19){_0x2c7de6=_0x1e7a19;_0x10b9dd[_0xd501('0x36')]=_[_0xd501('0x38')](db['CmList'][_0xd501('0x32')]);_0x10b9dd[_0xd501('0x37')]=_[_0xd501('0x38')](_0x54cfa3[_0xd501('0x37')]);_0x10b9dd[_0xd501('0x3f')]=_['intersection'](_0x10b9dd['model'],_0x10b9dd[_0xd501('0x37')]);_0x12c83f['attributes']=_[_0xd501('0x3a')](_0x10b9dd[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x54cfa3['query'][_0xd501('0x3b')]));_0x12c83f['attributes']=_0x12c83f[_0xd501('0x39')]['length']?_0x12c83f['attributes']:_0x10b9dd['model'];_0x12c83f['order']=qs[_0xd501('0x3e')](_0x54cfa3[_0xd501('0x37')][_0xd501('0x3e')]);_0x12c83f[_0xd501('0x42')]=qs[_0xd501('0x3f')](_['pick'](_0x54cfa3[_0xd501('0x37')],_0x10b9dd[_0xd501('0x3f')]));if(_0x54cfa3[_0xd501('0x37')][_0xd501('0x41')]){_0x12c83f[_0xd501('0x42')]=_[_0xd501('0x43')](_0x12c83f[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x12c83f[_0xd501('0x39')],function(_0x246d98){var _0x47365d={};_0x47365d[_0x246d98]={'$like':'%'+_0x54cfa3['query'][_0xd501('0x41')]+'%'};return _0x47365d;})});}_0x12c83f=_[_0xd501('0x43')]({},_0x12c83f,_0x54cfa3[_0xd501('0x44')]);return _0x2c7de6['getLists'](_0x12c83f);}})['then'](function(_0x1c5854){if(_0x1c5854){_0x5a9335=_0x1c5854[_0xd501('0x4b')];if(!_0x54cfa3[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x12c83f[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x54cfa3[_0xd501('0x37')]['limit']);_0x12c83f[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x54cfa3['query'][_0xd501('0x1e')]);}return _0x2c7de6[_0xd501('0x66')](_0x12c83f);}})[_0xd501('0x2b')](function(_0x5a4752){if(_0x5a4752){return _0x5a4752?{'count':_0x5a9335,'rows':_0x5a4752}:null;}})[_0xd501('0x2b')](respondWithResult(_0x4c4e90,null))[_0xd501('0x49')](handleError(_0x4c4e90,null));};exports[_0xd501('0x67')]=function(_0x427fc3,_0x10582a,_0x3a0e35){var _0x4cff1c,_0x48df21;return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0x427fc3[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x10582a,null))[_0xd501('0x2b')](function(_0x51f42e){if(_0x51f42e){_0x48df21=_0x51f42e;return _0x51f42e[_0xd501('0x67')](_0x427fc3['body'][_0xd501('0x68')],_[_0xd501('0x57')](_0x427fc3[_0xd501('0x4f')],[_0xd501('0x68'),'id'])||{});}return null;})[_0xd501('0x69')](function(_0x22c91d){var _0x4a97e7;_0x4cff1c=_0x22c91d||[];var _0x7cb549=[];if(_0x22c91d){for(var _0x27ae0d=0x0;_0x27ae0d<_0x22c91d[_0xd501('0x4b')];_0x27ae0d+=0x1){var _0x9c4537=_0x22c91d[_0x27ae0d][_0xd501('0x28')]({'plain':!![]});_0x48df21[_0xd501('0x6a')]=_0x427fc3[_0xd501('0x4f')][_0xd501('0x6a')]?_0x427fc3[_0xd501('0x4f')][_0xd501('0x6a')]:_0x48df21[_0xd501('0x6a')];switch(_0x48df21['dialCheckDuplicateType']){case _0xd501('0x6b'):_0x4a97e7=squel['insert']()[_0xd501('0x6c')](_0xd501('0x6d'))[_0xd501('0x6e')]([_0xd501('0x6f'),_0xd501('0x70'),_0xd501('0x71'),'ListId',_0xd501('0x60'),'createdAt',_0xd501('0x58')],squel[_0xd501('0x72')]()[_0xd501('0x73')]('phone','phone')[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x70'))['field']('id',_0xd501('0x71'))[_0xd501('0x73')](_0x9c4537[_0xd501('0x75')][_0xd501('0x76')](),'ListId')[_0xd501('0x73')](_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')](),_0xd501('0x60'))[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x59'))[_0xd501('0x73')](_0xd501('0x74'),'updatedAt')[_0xd501('0x77')](_0xd501('0x78'))[_0xd501('0x42')](_0xd501('0x79'))['where'](_0xd501('0x7a'),_0x9c4537[_0xd501('0x75')][_0xd501('0x76')]())[_0xd501('0x42')](_0xd501('0x7b'))['where'](_0xd501('0x7c'),squel[_0xd501('0x72')]()[_0xd501('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0xd501('0x77')](_0xd501('0x7d'))[_0xd501('0x42')](_0xd501('0x7e'),_0x427fc3['params']['id'][_0xd501('0x76')]()))[_0xd501('0x42')](_0xd501('0x7c'),squel[_0xd501('0x72')]()['field'](_0xd501('0x7f'))[_0xd501('0x77')](_0xd501('0x6d'))[_0xd501('0x42')](_0xd501('0x7e'),_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')]())))[_0xd501('0x76')]();break;case _0xd501('0x80'):_0x4a97e7=squel[_0xd501('0x81')]()[_0xd501('0x6c')](_0xd501('0x6d'))[_0xd501('0x6e')]([_0xd501('0x6f'),_0xd501('0x70'),_0xd501('0x71'),_0xd501('0x82'),'CampaignId',_0xd501('0x59'),_0xd501('0x58')],squel[_0xd501('0x72')]()[_0xd501('0x73')](_0xd501('0x6f'),_0xd501('0x6f'))[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x70'))[_0xd501('0x73')]('id',_0xd501('0x71'))[_0xd501('0x73')](_0x9c4537[_0xd501('0x75')]['toString'](),_0xd501('0x82'))[_0xd501('0x73')](_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')](),'CampaignId')[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x59'))['field'](_0xd501('0x74'),_0xd501('0x58'))[_0xd501('0x77')](_0xd501('0x78'))[_0xd501('0x42')](_0xd501('0x79'))['where'](_0xd501('0x7a'),_0x9c4537[_0xd501('0x75')]['toString']())[_0xd501('0x42')](_0xd501('0x7b'))[_0xd501('0x42')](_0xd501('0x7c'),squel[_0xd501('0x72')]()[_0xd501('0x73')]('COALESCE(phone,\x27\x27)')[_0xd501('0x77')](_0xd501('0x6d'))[_0xd501('0x42')](_0xd501('0x7e'),_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')]())))['toString']();break;default:_0x4a97e7=squel[_0xd501('0x81')]()[_0xd501('0x6c')]('cm_hopper')[_0xd501('0x6e')]([_0xd501('0x6f'),_0xd501('0x70'),'ContactId',_0xd501('0x82'),_0xd501('0x60'),_0xd501('0x59'),'updatedAt'],squel[_0xd501('0x72')]()['field'](_0xd501('0x6f'),'phone')[_0xd501('0x73')]('NOW()',_0xd501('0x70'))[_0xd501('0x73')]('id',_0xd501('0x71'))[_0xd501('0x73')](_0x9c4537[_0xd501('0x75')]['toString'](),_0xd501('0x82'))[_0xd501('0x73')](_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')](),_0xd501('0x60'))[_0xd501('0x73')]('NOW()','createdAt')[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x58'))['from'](_0xd501('0x78'))[_0xd501('0x42')](_0xd501('0x79'))[_0xd501('0x42')](_0xd501('0x7a'),_0x9c4537[_0xd501('0x75')]['toString']())[_0xd501('0x42')](_0xd501('0x7b')))['toString']();}_0x7cb549[_0xd501('0x83')](db['sequelize'][_0xd501('0x37')](_0x4a97e7));}return BPromise[_0xd501('0x84')](_0x7cb549);}})[_0xd501('0x2b')](function(){return _0x4cff1c;})[_0xd501('0x2b')](respondWithResult(_0x10582a,null))[_0xd501('0x49')](handleError(_0x10582a,null));};exports['removeLists']=function(_0xa86acb,_0x84af1a,_0xea966f){return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0xa86acb[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x84af1a,null))['then'](function(_0x5c4aa3){if(_0x5c4aa3){return _0x5c4aa3[_0xd501('0x85')](_0xa86acb[_0xd501('0x37')][_0xd501('0x68')]);}})[_0xd501('0x2b')](function(_0x1fdc25){if(_0x1fdc25){return db[_0xd501('0x5e')][_0xd501('0x27')]({'where':{'ListId':_0xa86acb[_0xd501('0x37')]['ids'],'CampaignId':_0xa86acb[_0xd501('0x56')]['id']}})['then'](function(){return _0x1fdc25;});}})[_0xd501('0x2b')](respondWithStatusCode(_0x84af1a,null))['catch'](handleError(_0x84af1a,null));};exports['getBlackLists']=function(_0x127f6c,_0x454a2c,_0x4faf2c){var _0x43e81c={};var _0x58ccab={};var _0x47dc26;var _0x49b5e4;return db[_0xd501('0x45')]['findOne']({'where':{'id':_0x127f6c[_0xd501('0x56')]['id']}})['then'](handleEntityNotFound(_0x454a2c,null))[_0xd501('0x2b')](function(_0x25fb40){if(_0x25fb40){_0x47dc26=_0x25fb40;_0x58ccab[_0xd501('0x36')]=_[_0xd501('0x38')](db['CmList'][_0xd501('0x32')]);_0x58ccab[_0xd501('0x37')]=_[_0xd501('0x38')](_0x127f6c[_0xd501('0x37')]);_0x58ccab[_0xd501('0x3f')]=_['intersection'](_0x58ccab[_0xd501('0x36')],_0x58ccab[_0xd501('0x37')]);_0x43e81c[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x58ccab[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x127f6c['query'][_0xd501('0x3b')]));_0x43e81c[_0xd501('0x39')]=_0x43e81c[_0xd501('0x39')][_0xd501('0x4b')]?_0x43e81c['attributes']:_0x58ccab['model'];_0x43e81c[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0x127f6c[_0xd501('0x37')][_0xd501('0x3e')]);_0x43e81c[_0xd501('0x42')]=qs['filters'](_[_0xd501('0x40')](_0x127f6c[_0xd501('0x37')],_0x58ccab[_0xd501('0x3f')]));if(_0x127f6c[_0xd501('0x37')]['filter']){_0x43e81c[_0xd501('0x42')]=_[_0xd501('0x43')](_0x43e81c[_0xd501('0x42')],{'$or':_['map'](_0x43e81c[_0xd501('0x39')],function(_0xd22fc8){var _0x9b1e4f={};_0x9b1e4f[_0xd22fc8]={'$like':'%'+_0x127f6c[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x9b1e4f;})});}_0x43e81c=_['merge']({},_0x43e81c,_0x127f6c[_0xd501('0x44')]);return _0x47dc26[_0xd501('0x86')](_0x43e81c);}})[_0xd501('0x2b')](function(_0x20bbf8){if(_0x20bbf8){_0x49b5e4=_0x20bbf8[_0xd501('0x4b')];if(!_0x127f6c[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x43e81c[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x127f6c[_0xd501('0x37')][_0xd501('0x20')]);_0x43e81c[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x127f6c[_0xd501('0x37')]['offset']);}return _0x47dc26[_0xd501('0x86')](_0x43e81c);}})[_0xd501('0x2b')](function(_0x28718f){if(_0x28718f){return _0x28718f?{'count':_0x49b5e4,'rows':_0x28718f}:null;}})[_0xd501('0x2b')](respondWithResult(_0x454a2c,null))[_0xd501('0x49')](handleError(_0x454a2c,null));};exports[_0xd501('0x87')]=function(_0x5c4f92,_0x15c5c,_0x34d140){var _0x123b1e,_0x44b12f;return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0x5c4f92[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x15c5c,null))[_0xd501('0x2b')](function(_0x4b69e9){if(_0x4b69e9){_0x44b12f=_0x4b69e9;return _0x4b69e9[_0xd501('0x87')](_0x5c4f92[_0xd501('0x4f')][_0xd501('0x68')],_[_0xd501('0x57')](_0x5c4f92[_0xd501('0x4f')],[_0xd501('0x68'),'id'])||{});}return null;})[_0xd501('0x69')](function(_0x2c0a3f){var _0x1ba522;_0x123b1e=_0x2c0a3f||[];var _0x6c592d=[];if(_0x2c0a3f){for(var _0x2837dd=0x0;_0x2837dd<_0x2c0a3f['length'];_0x2837dd+=0x1){var _0x4ab8c4=_0x2c0a3f[_0x2837dd][_0xd501('0x28')]({'plain':!![]});_0x1ba522=squel[_0xd501('0x81')]()['into'](_0xd501('0x88'))[_0xd501('0x6e')]([_0xd501('0x6f'),'ContactId','ListId',_0xd501('0x60'),'createdAt',_0xd501('0x58')],squel[_0xd501('0x72')]()[_0xd501('0x73')](_0xd501('0x6f'),_0xd501('0x6f'))[_0xd501('0x73')]('id','ContactId')[_0xd501('0x73')](_0x4ab8c4[_0xd501('0x75')][_0xd501('0x76')](),_0xd501('0x82'))['field'](_0x5c4f92[_0xd501('0x56')]['id'][_0xd501('0x76')](),_0xd501('0x60'))[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x59'))['field']('NOW()',_0xd501('0x58'))[_0xd501('0x77')]('cm_contacts')[_0xd501('0x42')](_0xd501('0x79'))[_0xd501('0x42')]('ListId\x20=\x20?',_0x4ab8c4[_0xd501('0x75')][_0xd501('0x76')]())['where'](_0xd501('0x7b')))[_0xd501('0x76')]();_0x6c592d['push'](db[_0xd501('0x89')][_0xd501('0x37')](_0x1ba522));}return BPromise[_0xd501('0x84')](_0x6c592d);}})['then'](function(){return _0x123b1e;})[_0xd501('0x2b')](respondWithResult(_0x15c5c,null))['catch'](handleError(_0x15c5c,null));};exports[_0xd501('0x8a')]=function(_0xaa9fec,_0x3135fe,_0x7fdbed){return db['Campaign'][_0xd501('0x4d')]({'where':{'id':_0xaa9fec[_0xd501('0x56')]['id']}})['then'](handleEntityNotFound(_0x3135fe,null))['then'](function(_0x511a7a){if(_0x511a7a){return _0x511a7a[_0xd501('0x8a')](_0xaa9fec['query']['ids']);}})[_0xd501('0x2b')](function(_0x1cceb4){if(_0x1cceb4){return db[_0xd501('0x65')][_0xd501('0x27')]({'where':{'ListId':_0xaa9fec[_0xd501('0x37')][_0xd501('0x68')],'CampaignId':_0xaa9fec['params']['id']}})[_0xd501('0x2b')](function(){return _0x1cceb4;});}})[_0xd501('0x2b')](respondWithStatusCode(_0x3135fe,null))[_0xd501('0x49')](handleError(_0x3135fe,null));}; \ No newline at end of file +var _0x92fd=['options','includeAll','include','rows','show','params','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','IvrCampaigns','destroy','getHoppers','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','findOne','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','pick','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','ListId','select','field','phone','NOW()','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','ContactId','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x92fd,0x1ec));var _0xd92f=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0x92fd[_0x57d740];return _0x6607ef;};'use strict';var emlformat=require(_0xd92f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd92f('0x1'));var jsonpatch=require(_0xd92f('0x2'));var rp=require(_0xd92f('0x3'));var moment=require(_0xd92f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd92f('0x5'));var util=require(_0xd92f('0x6'));var path=require(_0xd92f('0x7'));var sox=require(_0xd92f('0x8'));var csv=require(_0xd92f('0x9'));var ejs=require(_0xd92f('0xa'));var fs=require('fs');var fs_extra=require(_0xd92f('0xb'));var _=require(_0xd92f('0xc'));var squel=require(_0xd92f('0xd'));var crypto=require('crypto');var jsforce=require(_0xd92f('0xe'));var deskjs=require(_0xd92f('0xf'));var toCsv=require(_0xd92f('0x9'));var querystring=require(_0xd92f('0x10'));var Papa=require(_0xd92f('0x11'));var Redis=require(_0xd92f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd92f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd92f('0x14'));var utils=require(_0xd92f('0x15'));var config=require(_0xd92f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd92f('0x17'))['db'];function respondWithStatusCode(_0x7f8f5,_0x3ad70f){_0x3ad70f=_0x3ad70f||0xcc;return function(_0x317b6c){if(_0x317b6c){return _0x7f8f5[_0xd92f('0x18')](_0x3ad70f);}return _0x7f8f5['status'](_0x3ad70f)[_0xd92f('0x19')]();};}function respondWithResult(_0x5f156f,_0x4c1c78){_0x4c1c78=_0x4c1c78||0xc8;return function(_0x1f4e7f){if(_0x1f4e7f){return _0x5f156f[_0xd92f('0x1a')](_0x4c1c78)[_0xd92f('0x1b')](_0x1f4e7f);}};}function respondWithFilteredResult(_0x5cde6f,_0x568290){return function(_0x1acea3){if(_0x1acea3){var _0x115a81=typeof _0x568290[_0xd92f('0x1c')]===_0xd92f('0x1d')&&typeof _0x568290[_0xd92f('0x1e')]===_0xd92f('0x1d');var _0x2f548b=_0x1acea3[_0xd92f('0x1f')];var _0x1e696a=_0x115a81?0x0:_0x568290[_0xd92f('0x1c')];var _0xdd6b89=_0x115a81?_0x1acea3[_0xd92f('0x1f')]:_0x568290['offset']+_0x568290[_0xd92f('0x1e')];var _0x393a5f;if(_0xdd6b89>=_0x2f548b){_0xdd6b89=_0x2f548b;_0x393a5f=0xc8;}else{_0x393a5f=0xce;}_0x5cde6f[_0xd92f('0x1a')](_0x393a5f);return _0x5cde6f[_0xd92f('0x20')](_0xd92f('0x21'),_0x1e696a+'-'+_0xdd6b89+'/'+_0x2f548b)[_0xd92f('0x1b')](_0x1acea3);}return null;};}function patchUpdates(_0x274ede){return function(_0x3f0ec0){try{jsonpatch[_0xd92f('0x22')](_0x3f0ec0,_0x274ede,!![]);}catch(_0x4b88f4){return BPromise[_0xd92f('0x23')](_0x4b88f4);}return _0x3f0ec0[_0xd92f('0x24')]();};}function saveUpdates(_0x3bb3a3,_0x38d4ff){return function(_0xc6f90d){if(_0xc6f90d){return _0xc6f90d[_0xd92f('0x25')](_0x3bb3a3)['then'](function(_0x4a9657){return _0x4a9657;});}return null;};}function removeEntity(_0x21f432,_0x18ed44){return function(_0x404c61){if(_0x404c61){return _0x404c61['destroy']()[_0xd92f('0x26')](function(){var _0x55f3e6=_0x404c61[_0xd92f('0x27')]({'plain':!![]});var _0x15fe64='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x15fe64,'resourceId':_0x55f3e6['id']}})[_0xd92f('0x26')](function(){return _0x404c61;});})[_0xd92f('0x26')](function(){_0x21f432[_0xd92f('0x1a')](0xcc)[_0xd92f('0x19')]();});}};}function handleEntityNotFound(_0x57f05,_0x590edb){return function(_0x43a6ed){if(!_0x43a6ed){_0x57f05['sendStatus'](0x194);}return _0x43a6ed;};}function handleError(_0x161dd8,_0x5588c7){_0x5588c7=_0x5588c7||0x1f4;return function(_0x44d09e){logger['error'](_0x44d09e[_0xd92f('0x28')]);if(_0x44d09e[_0xd92f('0x29')]){delete _0x44d09e[_0xd92f('0x29')];}_0x161dd8['status'](_0x5588c7)[_0xd92f('0x2a')](_0x44d09e);};}exports[_0xd92f('0x2b')]=function(_0x5c9e92,_0x111d84){var _0x2e6e6f={},_0x3c81de={},_0x29cf67={'count':0x0,'rows':[]};var _0x1684a1=_[_0xd92f('0x2c')](db[_0xd92f('0x2d')][_0xd92f('0x2e')],function(_0x330551){return{'name':_0x330551[_0xd92f('0x2f')],'type':_0x330551[_0xd92f('0x30')][_0xd92f('0x31')]};});_0x3c81de[_0xd92f('0x32')]=_[_0xd92f('0x2c')](_0x1684a1,_0xd92f('0x29'));_0x3c81de['query']=_[_0xd92f('0x33')](_0x5c9e92[_0xd92f('0x34')]);_0x3c81de[_0xd92f('0x35')]=_['intersection'](_0x3c81de[_0xd92f('0x32')],_0x3c81de[_0xd92f('0x34')]);_0x2e6e6f[_0xd92f('0x36')]=_['intersection'](_0x3c81de[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x37')]));_0x2e6e6f[_0xd92f('0x36')]=_0x2e6e6f['attributes'][_0xd92f('0x38')]?_0x2e6e6f['attributes']:_0x3c81de[_0xd92f('0x32')];if(!_0x5c9e92[_0xd92f('0x34')]['hasOwnProperty'](_0xd92f('0x39'))){_0x2e6e6f[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x2e6e6f[_0xd92f('0x1c')]=qs['offset'](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x2e6e6f[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x2e6e6f[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x5c9e92[_0xd92f('0x34')],_0x3c81de[_0xd92f('0x35')]),_0x1684a1);if(_0x5c9e92['query'][_0xd92f('0x3d')]){_0x2e6e6f['where']=_[_0xd92f('0x3e')](_0x2e6e6f[_0xd92f('0x3c')],{'$or':_['map'](_0x1684a1,function(_0x408950){if(_0x408950['type']!==_0xd92f('0x3f')){var _0x45e5e7={};_0x45e5e7[_0x408950['name']]={'$like':'%'+_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x3d')]+'%'};return _0x45e5e7;}})});}_0x2e6e6f=_[_0xd92f('0x3e')]({},_0x2e6e6f,_0x5c9e92[_0xd92f('0x40')]);var _0x3f6b52={'where':_0x2e6e6f['where']};return db[_0xd92f('0x2d')][_0xd92f('0x1f')](_0x3f6b52)['then'](function(_0x59adaf){_0x29cf67[_0xd92f('0x1f')]=_0x59adaf;if(_0x5c9e92['query'][_0xd92f('0x41')]){_0x2e6e6f[_0xd92f('0x42')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x2e6e6f);})[_0xd92f('0x26')](function(_0x54f89f){_0x29cf67[_0xd92f('0x43')]=_0x54f89f;return _0x29cf67;})[_0xd92f('0x26')](respondWithFilteredResult(_0x111d84,_0x2e6e6f))['catch'](handleError(_0x111d84,null));};exports[_0xd92f('0x44')]=function(_0x420358,_0x3a03b6){var _0x429f54={'raw':![],'where':{'id':_0x420358[_0xd92f('0x45')]['id']}},_0x26b037={};_0x26b037[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x2d')]['rawAttributes']);_0x26b037[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x420358[_0xd92f('0x34')]);_0x26b037[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x26b037['model'],_0x26b037[_0xd92f('0x34')]);_0x429f54[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x26b037[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x420358['query'][_0xd92f('0x37')]));_0x429f54['attributes']=_0x429f54['attributes'][_0xd92f('0x38')]?_0x429f54['attributes']:_0x26b037['model'];if(_0x420358[_0xd92f('0x34')][_0xd92f('0x41')]){_0x429f54['include']=[{'all':!![]}];}_0x429f54=_[_0xd92f('0x3e')]({},_0x429f54,_0x420358[_0xd92f('0x40')]);return db[_0xd92f('0x2d')][_0xd92f('0x47')](_0x429f54)[_0xd92f('0x26')](handleEntityNotFound(_0x3a03b6,null))['then'](respondWithResult(_0x3a03b6,null))[_0xd92f('0x48')](handleError(_0x3a03b6,null));};exports[_0xd92f('0x49')]=function(_0x870ab4,_0x6f3592){return db[_0xd92f('0x2d')][_0xd92f('0x49')](_0x870ab4[_0xd92f('0x4a')],{})[_0xd92f('0x26')](function(_0x218650){var _0x39c49f=_0x870ab4[_0xd92f('0x4b')]['get']({'plain':!![]});if(!_0x39c49f)throw new Error(_0xd92f('0x4c'));if(_0x39c49f[_0xd92f('0x4d')]===_0xd92f('0x4b')){var _0x35983b=_0x218650[_0xd92f('0x27')]({'plain':!![]});var _0x4255ac='IvrCampaigns';return db[_0xd92f('0x4e')]['find']({'where':{'name':_0x4255ac,'userProfileId':_0x39c49f[_0xd92f('0x4f')]},'raw':!![]})[_0xd92f('0x26')](function(_0x31878b){if(_0x31878b&&_0x31878b[_0xd92f('0x50')]===0x0){return db[_0xd92f('0x51')]['create']({'name':_0x35983b['name'],'resourceId':_0x35983b['id'],'type':_0x31878b['name'],'sectionId':_0x31878b['id']},{})[_0xd92f('0x26')](function(){return _0x218650;});}else{return _0x218650;}})[_0xd92f('0x48')](function(_0x24d0b2){logger[_0xd92f('0x52')](_0xd92f('0x53'),_0x24d0b2);throw _0x24d0b2;});}return _0x218650;})[_0xd92f('0x26')](respondWithResult(_0x6f3592,0xc9))[_0xd92f('0x48')](handleError(_0x6f3592,null));};exports[_0xd92f('0x54')]=function(_0x353396,_0x805096){var _0x4f4a47={'where':{'id':_0x353396[_0xd92f('0x45')]['id']}},_0x439990={};_0x439990[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x2d')][_0xd92f('0x2e')]);_0x4f4a47['attributes']=_[_0xd92f('0x46')](_0x439990[_0xd92f('0x32')],qs['fields'](_0x353396[_0xd92f('0x34')]['fields']));_0x4f4a47[_0xd92f('0x36')]=_0x4f4a47[_0xd92f('0x36')][_0xd92f('0x38')]?_0x4f4a47[_0xd92f('0x36')]:_0x439990['model'];if(_0x353396[_0xd92f('0x34')]['includeAll']){_0x4f4a47[_0xd92f('0x42')]=[{'all':!![]}];}_0x4f4a47=_[_0xd92f('0x3e')]({},_0x4f4a47,_0x353396[_0xd92f('0x40')]);return db[_0xd92f('0x2d')]['find'](_0x4f4a47)[_0xd92f('0x26')](handleEntityNotFound(_0x805096,null))[_0xd92f('0x26')](function(_0x4ef13d){if(_0x4ef13d){var _0x4088c9=_0x4ef13d[_0xd92f('0x27')]({'plain':!![]});_0x4088c9=qs['omit'](_0x4088c9,['id',_0xd92f('0x55'),_0xd92f('0x56')]);_0x353396[_0xd92f('0x4a')]=_[_0xd92f('0x57')](_0x353396[_0xd92f('0x4a')],['id','createdAt','updatedAt']);return db[_0xd92f('0x2d')]['create'](_[_0xd92f('0x3e')](_0x4088c9,_0x353396[_0xd92f('0x4a')]),{'include':_0x353396[_0xd92f('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2bb9d5){var _0x523f43=_0x353396[_0xd92f('0x4b')][_0xd92f('0x27')]({'plain':!![]});if(!_0x523f43)throw new Error(_0xd92f('0x4c'));if(_0x523f43[_0xd92f('0x4d')]===_0xd92f('0x4b')){var _0x330975=_0x2bb9d5[_0xd92f('0x27')]({'plain':!![]});var _0x2a790c=_0xd92f('0x58');return db[_0xd92f('0x4e')]['find']({'where':{'name':_0x2a790c,'userProfileId':_0x523f43[_0xd92f('0x4f')]},'raw':!![]})[_0xd92f('0x26')](function(_0x306948){if(_0x306948&&_0x306948[_0xd92f('0x50')]===0x0){return db['UserProfileResource'][_0xd92f('0x49')]({'name':_0x330975['name'],'resourceId':_0x330975['id'],'type':_0x306948['name'],'sectionId':_0x306948['id']},{})[_0xd92f('0x26')](function(){return _0x2bb9d5;});}else{return _0x2bb9d5;}})[_0xd92f('0x48')](function(_0x5cada3){logger[_0xd92f('0x52')](_0xd92f('0x53'),_0x5cada3);throw _0x5cada3;});}return _0x2bb9d5;});}})[_0xd92f('0x26')](respondWithResult(_0x805096,0xc9))[_0xd92f('0x48')](handleError(_0x805096,null));};exports[_0xd92f('0x25')]=function(_0x111795,_0x2d895e){if(_0x111795[_0xd92f('0x4a')]['id']){delete _0x111795[_0xd92f('0x4a')]['id'];}return db['Campaign'][_0xd92f('0x47')]({'where':{'id':_0x111795[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x2d895e,null))['then'](saveUpdates(_0x111795[_0xd92f('0x4a')],null))['then'](respondWithResult(_0x2d895e,null))['catch'](handleError(_0x2d895e,null));};exports[_0xd92f('0x59')]=function(_0x2bc74a,_0xdacaa4){return db['Campaign'][_0xd92f('0x47')]({'where':{'id':_0x2bc74a[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0xdacaa4,null))[_0xd92f('0x26')](removeEntity(_0xdacaa4,null))[_0xd92f('0x48')](handleError(_0xdacaa4,null));};exports[_0xd92f('0x5a')]=function(_0x3a4759,_0x1b7bfb,_0x3813e4){var _0x15f93e={'raw':!![],'where':{}};var _0x2924b6={};var _0x3d26a6={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')]['findOne']({'where':{'id':_0x3a4759[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x1b7bfb,null))['then'](function(_0x312f89){if(_0x312f89){_0x2924b6[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x5b')][_0xd92f('0x2e')]);_0x2924b6[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x3a4759[_0xd92f('0x34')]);_0x2924b6[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x2924b6['model'],_0x2924b6[_0xd92f('0x34')]);_0x15f93e['attributes']=_['intersection'](_0x2924b6[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x3a4759['query'][_0xd92f('0x37')]));_0x15f93e['attributes']=_0x15f93e[_0xd92f('0x36')][_0xd92f('0x38')]?_0x15f93e[_0xd92f('0x36')]:_0x2924b6[_0xd92f('0x32')];if(!_0x3a4759[_0xd92f('0x34')][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x15f93e[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x3a4759['query'][_0xd92f('0x1e')]);_0x15f93e[_0xd92f('0x1c')]=qs['offset'](_0x3a4759[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x15f93e[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x3a4759[_0xd92f('0x34')]['sort']);_0x15f93e[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x3a4759[_0xd92f('0x34')],_0x2924b6['filters']));_0x15f93e[_0xd92f('0x3c')][_0xd92f('0x5d')]=_0x312f89['id'];if(_0x3a4759['query']['filter']){_0x15f93e[_0xd92f('0x3c')]=_['merge'](_0x15f93e['where'],{'$or':_['map'](_0x15f93e[_0xd92f('0x36')],function(_0x274f1a){var _0x24220f={};_0x24220f[_0x274f1a]={'$like':'%'+_0x3a4759[_0xd92f('0x34')]['filter']+'%'};return _0x24220f;})});}_0x15f93e=_[_0xd92f('0x3e')]({},_0x15f93e,_0x3a4759[_0xd92f('0x40')]);return db[_0xd92f('0x5b')][_0xd92f('0x1f')]({'where':_0x15f93e[_0xd92f('0x3c')]})[_0xd92f('0x26')](function(_0x1ca876){_0x3d26a6[_0xd92f('0x1f')]=_0x1ca876;if(_0x3a4759[_0xd92f('0x34')]['includeAll']){_0x15f93e[_0xd92f('0x42')]=[{'all':!![]}];}return db[_0xd92f('0x5b')]['findAll'](_0x15f93e);})[_0xd92f('0x26')](function(_0x17f8fc){_0x3d26a6[_0xd92f('0x43')]=_0x17f8fc;return _0x3d26a6;});}})[_0xd92f('0x26')](respondWithFilteredResult(_0x1b7bfb,_0x15f93e))[_0xd92f('0x48')](handleError(_0x1b7bfb,null));};exports[_0xd92f('0x5e')]=function(_0x9589fc,_0x183976,_0x8242cb){var _0x52becf={'raw':!![],'where':{}};var _0x5d475c={};var _0x26b921={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x9589fc['params']['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x183976,null))['then'](function(_0x33f123){if(_0x33f123){_0x5d475c[_0xd92f('0x32')]=_[_0xd92f('0x33')](db['CmHopperHistory'][_0xd92f('0x2e')]);_0x5d475c[_0xd92f('0x34')]=_['keys'](_0x9589fc[_0xd92f('0x34')]);_0x5d475c[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x5d475c[_0xd92f('0x32')],_0x5d475c[_0xd92f('0x34')]);_0x52becf['attributes']=_['intersection'](_0x5d475c[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x37')]));_0x52becf[_0xd92f('0x36')]=_0x52becf['attributes'][_0xd92f('0x38')]?_0x52becf[_0xd92f('0x36')]:_0x5d475c[_0xd92f('0x32')];if(!_0x9589fc['query'][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x52becf[_0xd92f('0x1e')]=qs['limit'](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x52becf[_0xd92f('0x1c')]=qs['offset'](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x52becf[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x52becf[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x9589fc[_0xd92f('0x34')],_0x5d475c[_0xd92f('0x35')]));_0x52becf['where'][_0xd92f('0x5d')]=_0x33f123['id'];if(_0x9589fc[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x52becf['where']=_[_0xd92f('0x3e')](_0x52becf[_0xd92f('0x3c')],{'$or':_[_0xd92f('0x2c')](_0x52becf[_0xd92f('0x36')],function(_0x24a966){var _0xa29929={};_0xa29929[_0x24a966]={'$like':'%'+_0x9589fc[_0xd92f('0x34')]['filter']+'%'};return _0xa29929;})});}_0x52becf=_[_0xd92f('0x3e')]({},_0x52becf,_0x9589fc['options']);return db['CmHopperHistory']['count']({'where':_0x52becf[_0xd92f('0x3c')]})[_0xd92f('0x26')](function(_0x2e5fc2){_0x26b921[_0xd92f('0x1f')]=_0x2e5fc2;if(_0x9589fc[_0xd92f('0x34')][_0xd92f('0x41')]){_0x52becf[_0xd92f('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd92f('0x60')](_0x52becf);})[_0xd92f('0x26')](function(_0x3c8be4){_0x26b921[_0xd92f('0x43')]=_0x3c8be4;return _0x26b921;});}})['then'](respondWithFilteredResult(_0x183976,_0x52becf))[_0xd92f('0x48')](handleError(_0x183976,null));};exports[_0xd92f('0x61')]=function(_0x3e7386,_0x19f35d,_0x31b96e){var _0x59c26d={'raw':!![],'where':{}};var _0x123045={};var _0x5de838={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x3e7386[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0x19f35d,null))[_0xd92f('0x26')](function(_0x47227d){if(_0x47227d){_0x123045[_0xd92f('0x32')]=_['keys'](db['CmHopperFinal'][_0xd92f('0x2e')]);_0x123045[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x3e7386[_0xd92f('0x34')]);_0x123045[_0xd92f('0x35')]=_['intersection'](_0x123045[_0xd92f('0x32')],_0x123045[_0xd92f('0x34')]);_0x59c26d[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x123045['model'],qs[_0xd92f('0x37')](_0x3e7386[_0xd92f('0x34')][_0xd92f('0x37')]));_0x59c26d['attributes']=_0x59c26d['attributes'][_0xd92f('0x38')]?_0x59c26d[_0xd92f('0x36')]:_0x123045[_0xd92f('0x32')];if(!_0x3e7386[_0xd92f('0x34')]['hasOwnProperty'](_0xd92f('0x39'))){_0x59c26d[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x3e7386[_0xd92f('0x34')]['limit']);_0x59c26d[_0xd92f('0x1c')]=qs[_0xd92f('0x1c')](_0x3e7386[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x59c26d[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x3e7386[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x59c26d[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x3e7386[_0xd92f('0x34')],_0x123045[_0xd92f('0x35')]));_0x59c26d[_0xd92f('0x3c')][_0xd92f('0x5d')]=_0x47227d['id'];if(_0x3e7386[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x59c26d[_0xd92f('0x3c')]=_[_0xd92f('0x3e')](_0x59c26d[_0xd92f('0x3c')],{'$or':_[_0xd92f('0x2c')](_0x59c26d['attributes'],function(_0x338bee){var _0x31bdb2={};_0x31bdb2[_0x338bee]={'$like':'%'+_0x3e7386['query']['filter']+'%'};return _0x31bdb2;})});}_0x59c26d=_[_0xd92f('0x3e')]({},_0x59c26d,_0x3e7386[_0xd92f('0x40')]);return db[_0xd92f('0x62')]['count']({'where':_0x59c26d[_0xd92f('0x3c')]})['then'](function(_0x37facb){_0x5de838[_0xd92f('0x1f')]=_0x37facb;if(_0x3e7386[_0xd92f('0x34')][_0xd92f('0x41')]){_0x59c26d[_0xd92f('0x42')]=[{'all':!![]}];}return db[_0xd92f('0x62')]['findAll'](_0x59c26d);})['then'](function(_0x41da6f){_0x5de838[_0xd92f('0x43')]=_0x41da6f;return _0x5de838;});}})[_0xd92f('0x26')](respondWithFilteredResult(_0x19f35d,_0x59c26d))[_0xd92f('0x48')](handleError(_0x19f35d,null));};exports[_0xd92f('0x63')]=function(_0x3c1aad,_0x80595a,_0x47c0b4){var _0x2c6183={'raw':!![],'where':{}};var _0xfbbee3={};var _0x288ad9={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x3c1aad[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x80595a,null))[_0xd92f('0x26')](function(_0x1dbbe6){if(_0x1dbbe6){_0xfbbee3[_0xd92f('0x32')]=_[_0xd92f('0x33')](db['CmHopperBlack'][_0xd92f('0x2e')]);_0xfbbee3[_0xd92f('0x34')]=_['keys'](_0x3c1aad[_0xd92f('0x34')]);_0xfbbee3[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0xfbbee3[_0xd92f('0x32')],_0xfbbee3['query']);_0x2c6183[_0xd92f('0x36')]=_['intersection'](_0xfbbee3[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x3c1aad[_0xd92f('0x34')]['fields']));_0x2c6183['attributes']=_0x2c6183[_0xd92f('0x36')]['length']?_0x2c6183['attributes']:_0xfbbee3[_0xd92f('0x32')];if(!_0x3c1aad['query'][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x2c6183[_0xd92f('0x1e')]=qs['limit'](_0x3c1aad[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x2c6183[_0xd92f('0x1c')]=qs['offset'](_0x3c1aad['query'][_0xd92f('0x1c')]);}_0x2c6183[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x3c1aad[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x2c6183[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_[_0xd92f('0x64')](_0x3c1aad[_0xd92f('0x34')],_0xfbbee3[_0xd92f('0x35')]));_0x2c6183[_0xd92f('0x3c')][_0xd92f('0x5d')]=_0x1dbbe6['id'];if(_0x3c1aad['query'][_0xd92f('0x3d')]){_0x2c6183[_0xd92f('0x3c')]=_[_0xd92f('0x3e')](_0x2c6183[_0xd92f('0x3c')],{'$or':_['map'](_0x2c6183[_0xd92f('0x36')],function(_0x511f56){var _0x533f86={};_0x533f86[_0x511f56]={'$like':'%'+_0x3c1aad['query']['filter']+'%'};return _0x533f86;})});}_0x2c6183=_[_0xd92f('0x3e')]({},_0x2c6183,_0x3c1aad[_0xd92f('0x40')]);return db[_0xd92f('0x65')][_0xd92f('0x1f')]({'where':_0x2c6183[_0xd92f('0x3c')]})[_0xd92f('0x26')](function(_0x1dcc4d){_0x288ad9['count']=_0x1dcc4d;if(_0x3c1aad['query']['includeAll']){_0x2c6183[_0xd92f('0x42')]=[{'all':!![]}];}return db[_0xd92f('0x65')][_0xd92f('0x60')](_0x2c6183);})[_0xd92f('0x26')](function(_0x54f33b){_0x288ad9[_0xd92f('0x43')]=_0x54f33b;return _0x288ad9;});}})['then'](respondWithFilteredResult(_0x80595a,_0x2c6183))['catch'](handleError(_0x80595a,null));};exports[_0xd92f('0x66')]=function(_0x2350aa,_0x43c167,_0x201c11){var _0x48c19a={};var _0x702421={};var _0x463303;var _0xb180e0;return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x2350aa[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0x43c167,null))[_0xd92f('0x26')](function(_0x2c20d3){if(_0x2c20d3){_0x463303=_0x2c20d3;_0x702421[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x67')][_0xd92f('0x2e')]);_0x702421[_0xd92f('0x34')]=_['keys'](_0x2350aa[_0xd92f('0x34')]);_0x702421[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x702421['model'],_0x702421['query']);_0x48c19a[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x702421[_0xd92f('0x32')],qs['fields'](_0x2350aa['query'][_0xd92f('0x37')]));_0x48c19a['attributes']=_0x48c19a[_0xd92f('0x36')][_0xd92f('0x38')]?_0x48c19a[_0xd92f('0x36')]:_0x702421[_0xd92f('0x32')];_0x48c19a[_0xd92f('0x3a')]=qs['sort'](_0x2350aa[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x48c19a[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_[_0xd92f('0x64')](_0x2350aa[_0xd92f('0x34')],_0x702421[_0xd92f('0x35')]));if(_0x2350aa[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x48c19a[_0xd92f('0x3c')]=_['merge'](_0x48c19a['where'],{'$or':_[_0xd92f('0x2c')](_0x48c19a['attributes'],function(_0x5f3d9f){var _0x45c8ca={};_0x45c8ca[_0x5f3d9f]={'$like':'%'+_0x2350aa[_0xd92f('0x34')][_0xd92f('0x3d')]+'%'};return _0x45c8ca;})});}_0x48c19a=_[_0xd92f('0x3e')]({},_0x48c19a,_0x2350aa['options']);return _0x463303['getLists'](_0x48c19a);}})[_0xd92f('0x26')](function(_0x3fc3b9){if(_0x3fc3b9){_0xb180e0=_0x3fc3b9[_0xd92f('0x38')];if(!_0x2350aa[_0xd92f('0x34')][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x48c19a[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x2350aa[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x48c19a[_0xd92f('0x1c')]=qs[_0xd92f('0x1c')](_0x2350aa['query']['offset']);}return _0x463303[_0xd92f('0x66')](_0x48c19a);}})[_0xd92f('0x26')](function(_0x10e7b1){if(_0x10e7b1){return _0x10e7b1?{'count':_0xb180e0,'rows':_0x10e7b1}:null;}})[_0xd92f('0x26')](respondWithResult(_0x43c167,null))[_0xd92f('0x48')](handleError(_0x43c167,null));};exports[_0xd92f('0x68')]=function(_0x342015,_0x19f756,_0x157882){var _0x5c96e1,_0x59d92b;return db[_0xd92f('0x2d')]['find']({'where':{'id':_0x342015['params']['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x19f756,null))['then'](function(_0x1a27c5){if(_0x1a27c5){_0x59d92b=_0x1a27c5;return _0x1a27c5[_0xd92f('0x68')](_0x342015[_0xd92f('0x4a')]['ids'],_[_0xd92f('0x57')](_0x342015[_0xd92f('0x4a')],[_0xd92f('0x69'),'id'])||{});}return null;})[_0xd92f('0x6a')](function(_0xd3cf29){var _0x5acb44;_0x5c96e1=_0xd3cf29||[];var _0x3c6cae=[];if(_0xd3cf29){for(var _0x30b856=0x0;_0x30b856<_0xd3cf29[_0xd92f('0x38')];_0x30b856+=0x1){var _0x769214=_0xd3cf29[_0x30b856][_0xd92f('0x27')]({'plain':!![]});_0x59d92b[_0xd92f('0x6b')]=_0x342015[_0xd92f('0x4a')][_0xd92f('0x6b')]?_0x342015[_0xd92f('0x4a')][_0xd92f('0x6b')]:_0x59d92b[_0xd92f('0x6b')];switch(_0x59d92b[_0xd92f('0x6b')]){case _0xd92f('0x6c'):_0x5acb44=squel[_0xd92f('0x6d')]()[_0xd92f('0x6e')](_0xd92f('0x6f'))['fromQuery'](['phone','scheduledAt','ContactId',_0xd92f('0x70'),_0xd92f('0x5d'),_0xd92f('0x55'),_0xd92f('0x56')],squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x73'),'phone')[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x75'))[_0xd92f('0x72')]('id','ContactId')[_0xd92f('0x72')](_0x769214[_0xd92f('0x76')]['toString'](),_0xd92f('0x70'))[_0xd92f('0x72')](_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),_0xd92f('0x5d'))['field'](_0xd92f('0x74'),_0xd92f('0x55'))[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x56'))['from'](_0xd92f('0x78'))['where'](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x769214[_0xd92f('0x76')][_0xd92f('0x77')]())[_0xd92f('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd92f('0x7b'),squel[_0xd92f('0x71')]()['field'](_0xd92f('0x7c'))[_0xd92f('0x7d')](_0xd92f('0x7e'))['where']('CampaignId\x20=\x20?',_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')]()))[_0xd92f('0x3c')](_0xd92f('0x7b'),squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x7f'))[_0xd92f('0x7d')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')]())))[_0xd92f('0x77')]();break;case _0xd92f('0x80'):_0x5acb44=squel[_0xd92f('0x6d')]()[_0xd92f('0x6e')]('cm_hopper')[_0xd92f('0x81')]([_0xd92f('0x73'),_0xd92f('0x75'),_0xd92f('0x82'),_0xd92f('0x70'),'CampaignId',_0xd92f('0x55'),_0xd92f('0x56')],squel['select']()['field'](_0xd92f('0x73'),_0xd92f('0x73'))[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x75'))['field']('id',_0xd92f('0x82'))[_0xd92f('0x72')](_0x769214[_0xd92f('0x76')]['toString'](),'ListId')[_0xd92f('0x72')](_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),_0xd92f('0x5d'))[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x55'))[_0xd92f('0x72')]('NOW()','updatedAt')[_0xd92f('0x7d')](_0xd92f('0x78'))[_0xd92f('0x3c')](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x769214[_0xd92f('0x76')][_0xd92f('0x77')]())['where'](_0xd92f('0x83'))[_0xd92f('0x3c')](_0xd92f('0x7b'),squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x7f'))[_0xd92f('0x7d')](_0xd92f('0x6f'))[_0xd92f('0x3c')](_0xd92f('0x84'),_0x342015['params']['id'][_0xd92f('0x77')]())))[_0xd92f('0x77')]();break;default:_0x5acb44=squel['insert']()[_0xd92f('0x6e')](_0xd92f('0x6f'))['fromQuery']([_0xd92f('0x73'),_0xd92f('0x75'),'ContactId',_0xd92f('0x70'),'CampaignId',_0xd92f('0x55'),_0xd92f('0x56')],squel['select']()[_0xd92f('0x72')](_0xd92f('0x73'),_0xd92f('0x73'))['field']('NOW()',_0xd92f('0x75'))[_0xd92f('0x72')]('id',_0xd92f('0x82'))[_0xd92f('0x72')](_0x769214[_0xd92f('0x76')][_0xd92f('0x77')](),_0xd92f('0x70'))[_0xd92f('0x72')](_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),_0xd92f('0x5d'))['field']('NOW()','createdAt')['field'](_0xd92f('0x74'),'updatedAt')[_0xd92f('0x7d')]('cm_contacts')['where'](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x769214[_0xd92f('0x76')][_0xd92f('0x77')]())[_0xd92f('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xd92f('0x77')]();}_0x3c6cae[_0xd92f('0x85')](db[_0xd92f('0x86')][_0xd92f('0x34')](_0x5acb44));}return BPromise['all'](_0x3c6cae);}})[_0xd92f('0x26')](function(){return _0x5c96e1;})['then'](respondWithResult(_0x19f756,null))[_0xd92f('0x48')](handleError(_0x19f756,null));};exports[_0xd92f('0x87')]=function(_0x4230ed,_0x362f5d,_0x539258){return db['Campaign'][_0xd92f('0x47')]({'where':{'id':_0x4230ed[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x362f5d,null))[_0xd92f('0x26')](function(_0x4514bc){if(_0x4514bc){return _0x4514bc[_0xd92f('0x87')](_0x4230ed['query'][_0xd92f('0x69')]);}})['then'](function(_0x34f34b){if(_0x34f34b){return db[_0xd92f('0x5b')]['destroy']({'where':{'ListId':_0x4230ed[_0xd92f('0x34')]['ids'],'CampaignId':_0x4230ed[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](function(){return _0x34f34b;});}})[_0xd92f('0x26')](respondWithStatusCode(_0x362f5d,null))[_0xd92f('0x48')](handleError(_0x362f5d,null));};exports[_0xd92f('0x88')]=function(_0x4e2357,_0x1f08e8,_0x43c40b){var _0x5b9c40={};var _0x2ff474={};var _0x201673;var _0xe0f392;return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x4e2357[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f08e8,null))[_0xd92f('0x26')](function(_0x4e17b9){if(_0x4e17b9){_0x201673=_0x4e17b9;_0x2ff474['model']=_[_0xd92f('0x33')](db[_0xd92f('0x67')]['rawAttributes']);_0x2ff474[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x4e2357[_0xd92f('0x34')]);_0x2ff474[_0xd92f('0x35')]=_['intersection'](_0x2ff474[_0xd92f('0x32')],_0x2ff474[_0xd92f('0x34')]);_0x5b9c40[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x2ff474['model'],qs[_0xd92f('0x37')](_0x4e2357[_0xd92f('0x34')][_0xd92f('0x37')]));_0x5b9c40[_0xd92f('0x36')]=_0x5b9c40[_0xd92f('0x36')][_0xd92f('0x38')]?_0x5b9c40[_0xd92f('0x36')]:_0x2ff474[_0xd92f('0x32')];_0x5b9c40[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x4e2357[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x5b9c40[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x4e2357[_0xd92f('0x34')],_0x2ff474[_0xd92f('0x35')]));if(_0x4e2357[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x5b9c40['where']=_[_0xd92f('0x3e')](_0x5b9c40[_0xd92f('0x3c')],{'$or':_[_0xd92f('0x2c')](_0x5b9c40[_0xd92f('0x36')],function(_0x1dd228){var _0x20f68d={};_0x20f68d[_0x1dd228]={'$like':'%'+_0x4e2357[_0xd92f('0x34')]['filter']+'%'};return _0x20f68d;})});}_0x5b9c40=_[_0xd92f('0x3e')]({},_0x5b9c40,_0x4e2357[_0xd92f('0x40')]);return _0x201673[_0xd92f('0x88')](_0x5b9c40);}})['then'](function(_0x4cc193){if(_0x4cc193){_0xe0f392=_0x4cc193[_0xd92f('0x38')];if(!_0x4e2357[_0xd92f('0x34')][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x5b9c40[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x4e2357[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x5b9c40[_0xd92f('0x1c')]=qs['offset'](_0x4e2357[_0xd92f('0x34')]['offset']);}return _0x201673[_0xd92f('0x88')](_0x5b9c40);}})[_0xd92f('0x26')](function(_0x39cc86){if(_0x39cc86){return _0x39cc86?{'count':_0xe0f392,'rows':_0x39cc86}:null;}})['then'](respondWithResult(_0x1f08e8,null))[_0xd92f('0x48')](handleError(_0x1f08e8,null));};exports[_0xd92f('0x89')]=function(_0x2f119d,_0x333a5b,_0x358234){var _0x573b38,_0x152506;return db[_0xd92f('0x2d')][_0xd92f('0x47')]({'where':{'id':_0x2f119d['params']['id']}})['then'](handleEntityNotFound(_0x333a5b,null))['then'](function(_0x58de62){if(_0x58de62){_0x152506=_0x58de62;return _0x58de62[_0xd92f('0x89')](_0x2f119d[_0xd92f('0x4a')][_0xd92f('0x69')],_[_0xd92f('0x57')](_0x2f119d[_0xd92f('0x4a')],[_0xd92f('0x69'),'id'])||{});}return null;})[_0xd92f('0x6a')](function(_0x2a316a){var _0x5694d6;_0x573b38=_0x2a316a||[];var _0x11de7b=[];if(_0x2a316a){for(var _0x9e92f9=0x0;_0x9e92f9<_0x2a316a[_0xd92f('0x38')];_0x9e92f9+=0x1){var _0x9e228a=_0x2a316a[_0x9e92f9]['get']({'plain':!![]});_0x5694d6=squel[_0xd92f('0x6d')]()[_0xd92f('0x6e')]('cm_hopper_black')[_0xd92f('0x81')]([_0xd92f('0x73'),'ContactId',_0xd92f('0x70'),'CampaignId',_0xd92f('0x55'),'updatedAt'],squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x73'),_0xd92f('0x73'))['field']('id',_0xd92f('0x82'))[_0xd92f('0x72')](_0x9e228a['CmListId'][_0xd92f('0x77')](),'ListId')[_0xd92f('0x72')](_0x2f119d[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),'CampaignId')['field'](_0xd92f('0x74'),_0xd92f('0x55'))['field']('NOW()',_0xd92f('0x56'))['from']('cm_contacts')[_0xd92f('0x3c')](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x9e228a[_0xd92f('0x76')][_0xd92f('0x77')]())[_0xd92f('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xd92f('0x77')]();_0x11de7b[_0xd92f('0x85')](db[_0xd92f('0x86')][_0xd92f('0x34')](_0x5694d6));}return BPromise['all'](_0x11de7b);}})[_0xd92f('0x26')](function(){return _0x573b38;})[_0xd92f('0x26')](respondWithResult(_0x333a5b,null))[_0xd92f('0x48')](handleError(_0x333a5b,null));};exports[_0xd92f('0x8a')]=function(_0x2d4f48,_0x6efb41,_0x3bc395){return db[_0xd92f('0x2d')]['find']({'where':{'id':_0x2d4f48[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x6efb41,null))[_0xd92f('0x26')](function(_0x507c75){if(_0x507c75){return _0x507c75['removeBlackLists'](_0x2d4f48[_0xd92f('0x34')][_0xd92f('0x69')]);}})[_0xd92f('0x26')](function(_0xbc3a04){if(_0xbc3a04){return db[_0xd92f('0x65')][_0xd92f('0x59')]({'where':{'ListId':_0x2d4f48[_0xd92f('0x34')]['ids'],'CampaignId':_0x2d4f48[_0xd92f('0x45')]['id']}})['then'](function(){return _0xbc3a04;});}})[_0xd92f('0x26')](respondWithStatusCode(_0x6efb41,null))[_0xd92f('0x48')](handleError(_0x6efb41,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 119c4b6..26e74da 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(_0x25a18e,_0x22efae){var _0x31bd81=function(_0x24ed2f){while(--_0x24ed2f){_0x25a18e['push'](_0x25a18e['shift']());}};_0x31bd81(++_0x22efae);}(_0x7a54,0x106));var _0x47a5=function(_0x1aaa9f,_0x1abd55){_0x1aaa9f=_0x1aaa9f-0x0;var _0x5e8a4f=_0x7a54[_0x1aaa9f];return _0x5e8a4f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x7a54,0x106));var _0x47a5=function(_0x351b19,_0x431911){_0x351b19=_0x351b19-0x0;var _0x22ce54=_0x7a54[_0x351b19];return _0x22ce54;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index f64accc..3f77e07 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 _0x777f=['../../config/environment','request','then','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','info','result','catch','GetCampaign','findAll','options','include','map','attributes','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5a5bff,_0x350844){var _0x2ffe98=function(_0x285d45){while(--_0x285d45){_0x5a5bff['push'](_0x5a5bff['shift']());}};_0x2ffe98(++_0x350844);}(_0x777f,0x9f));var _0xf777=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x777f[_0x2f71f6];return _0x2b23ea;};'use strict';var _=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var moment=require(_0xf777('0x2'));var BPromise=require(_0xf777('0x3'));var rs=require(_0xf777('0x4'));var fs=require('fs');var Redis=require(_0xf777('0x5'));var db=require(_0xf777('0x6'))['db'];var utils=require(_0xf777('0x7'));var logger=require('../../config/logger')(_0xf777('0x8'));var config=require(_0xf777('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa78a3,_0x6d105c,_0x3cbcaa){return new BPromise(function(_0x4582bd,_0x50a918){return client[_0xf777('0xa')](_0xa78a3,_0x3cbcaa)[_0xf777('0xb')](function(_0x1d4d64){logger['info']('Campaign,\x20%s,\x20%s',_0x6d105c,'request\x20sent');logger[_0xf777('0xc')](_0xf777('0xd'),_0x6d105c,'request\x20sent',JSON[_0xf777('0xe')](_0x1d4d64));if(_0x1d4d64[_0xf777('0xf')]){if(_0x1d4d64[_0xf777('0xf')]['code']===0x1f4){logger[_0xf777('0xf')](_0xf777('0x10'),_0x6d105c,_0x1d4d64[_0xf777('0xf')][_0xf777('0x11')]);return _0x50a918(_0x1d4d64[_0xf777('0xf')][_0xf777('0x11')]);}logger[_0xf777('0xf')]('Campaign,\x20%s,\x20%s',_0x6d105c,_0x1d4d64['error'][_0xf777('0x11')]);return _0x4582bd(_0x1d4d64['error'][_0xf777('0x11')]);}else{logger[_0xf777('0x12')](_0xf777('0x10'),_0x6d105c,'request\x20sent');_0x4582bd(_0x1d4d64[_0xf777('0x13')][_0xf777('0x11')]);}})[_0xf777('0x14')](function(_0x426a3a){logger[_0xf777('0xf')](_0xf777('0x10'),_0x6d105c,_0x426a3a);_0x50a918(_0x426a3a);});});}exports[_0xf777('0x15')]=function(_0x3e0ba3){var _0x36a88f=this;return new Promise(function(_0x126f72,_0xcd34fe){return db['Campaign'][_0xf777('0x16')]({'raw':_0x3e0ba3['options']?_0x3e0ba3[_0xf777('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e0ba3[_0xf777('0x17')]?_0x3e0ba3['options']['where']||null:null,'attributes':_0x3e0ba3[_0xf777('0x17')]?_0x3e0ba3[_0xf777('0x17')]['attributes']||null:null,'limit':_0x3e0ba3[_0xf777('0x17')]?_0x3e0ba3[_0xf777('0x17')]['limit']||null:null,'include':_0x3e0ba3['options']?_0x3e0ba3['options'][_0xf777('0x18')]?_[_0xf777('0x19')](_0x3e0ba3['options']['include'],function(_0x43384d){return{'model':db[_0x43384d['model']],'as':_0x43384d['as'],'attributes':_0x43384d[_0xf777('0x1a')],'include':_0x43384d['include']?_[_0xf777('0x19')](_0x43384d['include'],function(_0x4fd176){return{'model':db[_0x4fd176[_0xf777('0x1b')]],'as':_0x4fd176['as'],'attributes':_0x4fd176['attributes'],'include':_0x4fd176[_0xf777('0x18')]?_['map'](_0x4fd176[_0xf777('0x18')],function(_0x1a1d74){return{'model':db[_0x1a1d74[_0xf777('0x1b')]],'as':_0x1a1d74['as'],'attributes':_0x1a1d74[_0xf777('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf777('0xb')](function(_0x232b3c){logger['info'](_0xf777('0x15'),_0x3e0ba3);logger[_0xf777('0xc')](_0xf777('0x15'),_0x3e0ba3,JSON['stringify'](_0x232b3c));_0x126f72(_0x232b3c);})['catch'](function(_0x451e21){logger['error'](_0xf777('0x15'),_0x451e21['message'],_0x3e0ba3);_0xcd34fe(_0x36a88f[_0xf777('0xf')](0x1f4,_0x451e21['message']));});});}; \ No newline at end of file +var _0x149c=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','map','include','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b2ffe,_0x10a462){var _0x2e9295=function(_0x274489){while(--_0x274489){_0x3b2ffe['push'](_0x3b2ffe['shift']());}};_0x2e9295(++_0x10a462);}(_0x149c,0x143));var _0xc149=function(_0x4fd3d3,_0xc1fc2a){_0x4fd3d3=_0x4fd3d3-0x0;var _0x5cab0e=_0x149c[_0x4fd3d3];return _0x5cab0e;};'use strict';var _=require(_0xc149('0x0'));var util=require('util');var moment=require(_0xc149('0x1'));var BPromise=require(_0xc149('0x2'));var rs=require(_0xc149('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc149('0x4'))['db'];var utils=require(_0xc149('0x5'));var logger=require(_0xc149('0x6'))(_0xc149('0x7'));var config=require(_0xc149('0x8'));var jayson=require(_0xc149('0x9'));var client=jayson[_0xc149('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x578cec,_0x351b75,_0x34710e){return new BPromise(function(_0x3a1739,_0x1d9eca){return client[_0xc149('0xb')](_0x578cec,_0x34710e)[_0xc149('0xc')](function(_0x25fb58){logger[_0xc149('0xd')](_0xc149('0xe'),_0x351b75,_0xc149('0xf'));logger[_0xc149('0x10')](_0xc149('0x11'),_0x351b75,_0xc149('0xf'),JSON[_0xc149('0x12')](_0x25fb58));if(_0x25fb58[_0xc149('0x13')]){if(_0x25fb58[_0xc149('0x13')][_0xc149('0x14')]===0x1f4){logger[_0xc149('0x13')]('Campaign,\x20%s,\x20%s',_0x351b75,_0x25fb58[_0xc149('0x13')]['message']);return _0x1d9eca(_0x25fb58[_0xc149('0x13')]['message']);}logger[_0xc149('0x13')](_0xc149('0xe'),_0x351b75,_0x25fb58['error']['message']);return _0x3a1739(_0x25fb58[_0xc149('0x13')][_0xc149('0x15')]);}else{logger[_0xc149('0xd')](_0xc149('0xe'),_0x351b75,_0xc149('0xf'));_0x3a1739(_0x25fb58[_0xc149('0x16')]['message']);}})[_0xc149('0x17')](function(_0x44dcb2){logger[_0xc149('0x13')](_0xc149('0xe'),_0x351b75,_0x44dcb2);_0x1d9eca(_0x44dcb2);});});}exports[_0xc149('0x18')]=function(_0x503124){var _0x2286f1=this;return new Promise(function(_0x32c339,_0x11ca5f){return db[_0xc149('0x19')][_0xc149('0x1a')]({'raw':_0x503124[_0xc149('0x1b')]?_0x503124['options'][_0xc149('0x1c')]===undefined?!![]:![]:!![],'where':_0x503124[_0xc149('0x1b')]?_0x503124['options']['where']||null:null,'attributes':_0x503124[_0xc149('0x1b')]?_0x503124[_0xc149('0x1b')][_0xc149('0x1d')]||null:null,'limit':_0x503124[_0xc149('0x1b')]?_0x503124[_0xc149('0x1b')][_0xc149('0x1e')]||null:null,'include':_0x503124[_0xc149('0x1b')]?_0x503124['options']['include']?_[_0xc149('0x1f')](_0x503124['options']['include'],function(_0xb4ea4f){return{'model':db[_0xb4ea4f['model']],'as':_0xb4ea4f['as'],'attributes':_0xb4ea4f[_0xc149('0x1d')],'include':_0xb4ea4f['include']?_[_0xc149('0x1f')](_0xb4ea4f[_0xc149('0x20')],function(_0x1e08e3){return{'model':db[_0x1e08e3[_0xc149('0x21')]],'as':_0x1e08e3['as'],'attributes':_0x1e08e3[_0xc149('0x1d')],'include':_0x1e08e3[_0xc149('0x20')]?_[_0xc149('0x1f')](_0x1e08e3['include'],function(_0x2d2700){return{'model':db[_0x2d2700['model']],'as':_0x2d2700['as'],'attributes':_0x2d2700[_0xc149('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc149('0xc')](function(_0x43e5e5){logger[_0xc149('0xd')](_0xc149('0x18'),_0x503124);logger[_0xc149('0x10')](_0xc149('0x18'),_0x503124,JSON[_0xc149('0x12')](_0x43e5e5));_0x32c339(_0x43e5e5);})[_0xc149('0x17')](function(_0x34ffd9){logger[_0xc149('0x13')]('GetCampaign',_0x34ffd9[_0xc149('0x15')],_0x503124);_0x11ca5f(_0x2286f1[_0xc149('0x13')](0x1f4,_0x34ffd9['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b7bed35..7b064c2 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 _0x362d=['../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','put','/:id','update','delete','destroy','removeBlackLists','exports','path','connect-timeout','express'];(function(_0x5a3162,_0x55e981){var _0x557ae0=function(_0x13a4d0){while(--_0x13a4d0){_0x5a3162['push'](_0x5a3162['shift']());}};_0x557ae0(++_0x55e981);}(_0x362d,0xbd));var _0xd362=function(_0x40d507,_0x3ddd3f){_0x40d507=_0x40d507-0x0;var _0x5028e8=_0x362d[_0x40d507];return _0x5028e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd362('0x0'));var timeout=require(_0xd362('0x1'));var express=require(_0xd362('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd362('0x3'));var interaction=require(_0xd362('0x4'));var config=require('../../config/environment');var controller=require(_0xd362('0x5'));router['get']('/',auth[_0xd362('0x6')](),controller['index']);router[_0xd362('0x7')]('/:id',auth[_0xd362('0x6')](),controller[_0xd362('0x8')]);router[_0xd362('0x7')](_0xd362('0x9'),auth[_0xd362('0x6')](),controller[_0xd362('0xa')]);router['get'](_0xd362('0xb'),auth[_0xd362('0x6')](),controller[_0xd362('0xc')]);router['get'](_0xd362('0xd'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xd362('0x7')](_0xd362('0xe'),auth[_0xd362('0x6')](),controller[_0xd362('0xf')]);router[_0xd362('0x7')](_0xd362('0x10'),auth[_0xd362('0x6')](),controller[_0xd362('0x11')]);router['get'](_0xd362('0x12'),auth[_0xd362('0x6')](),controller[_0xd362('0x13')]);router['post']('/',auth[_0xd362('0x6')](),controller[_0xd362('0x14')]);router[_0xd362('0x15')](_0xd362('0x16'),auth[_0xd362('0x6')](),controller[_0xd362('0x17')]);router['post'](_0xd362('0x10'),auth['isAuthenticated'](),controller[_0xd362('0x18')]);router[_0xd362('0x15')]('/:id/blacklists',auth[_0xd362('0x6')](),controller['addBlackLists']);router[_0xd362('0x19')](_0xd362('0x1a'),auth['isAuthenticated'](),controller[_0xd362('0x1b')]);router[_0xd362('0x1c')](_0xd362('0x1a'),auth[_0xd362('0x6')](),controller[_0xd362('0x1d')]);router[_0xd362('0x1c')](_0xd362('0x10'),auth[_0xd362('0x6')](),controller['removeLists']);router[_0xd362('0x1c')](_0xd362('0x12'),auth[_0xd362('0x6')](),controller[_0xd362('0x1e')]);module[_0xd362('0x1f')]=router; \ No newline at end of file +var _0x26e5=['removeLists','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','update','destroy','delete'];(function(_0x433ab5,_0x16e711){var _0x315911=function(_0x2d24a2){while(--_0x2d24a2){_0x433ab5['push'](_0x433ab5['shift']());}};_0x315911(++_0x16e711);}(_0x26e5,0x102));var _0x526e=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x26e5[_0x478c8a];return _0x3b6b3e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x526e('0x0'));var timeout=require(_0x526e('0x1'));var express=require(_0x526e('0x2'));var router=express['Router']();var fs_extra=require(_0x526e('0x3'));var auth=require(_0x526e('0x4'));var interaction=require(_0x526e('0x5'));var config=require(_0x526e('0x6'));var controller=require(_0x526e('0x7'));router[_0x526e('0x8')]('/',auth[_0x526e('0x9')](),controller['index']);router[_0x526e('0x8')](_0x526e('0xa'),auth[_0x526e('0x9')](),controller[_0x526e('0xb')]);router[_0x526e('0x8')](_0x526e('0xc'),auth[_0x526e('0x9')](),controller['getHoppers']);router['get'](_0x526e('0xd'),auth[_0x526e('0x9')](),controller[_0x526e('0xe')]);router[_0x526e('0x8')](_0x526e('0xf'),auth[_0x526e('0x9')](),controller[_0x526e('0x10')]);router[_0x526e('0x8')]('/:id/hopper_black',auth[_0x526e('0x9')](),controller[_0x526e('0x11')]);router[_0x526e('0x8')](_0x526e('0x12'),auth[_0x526e('0x9')](),controller['getLists']);router[_0x526e('0x8')]('/:id/blacklists',auth[_0x526e('0x9')](),controller[_0x526e('0x13')]);router[_0x526e('0x14')]('/',auth['isAuthenticated'](),controller[_0x526e('0x15')]);router[_0x526e('0x14')](_0x526e('0x16'),auth['isAuthenticated'](),controller[_0x526e('0x17')]);router[_0x526e('0x14')]('/:id/lists',auth[_0x526e('0x9')](),controller[_0x526e('0x18')]);router['post'](_0x526e('0x19'),auth[_0x526e('0x9')](),controller[_0x526e('0x1a')]);router['put']('/:id',auth[_0x526e('0x9')](),controller[_0x526e('0x1b')]);router['delete']('/:id',auth[_0x526e('0x9')](),controller[_0x526e('0x1c')]);router[_0x526e('0x1d')]('/:id/lists',auth[_0x526e('0x9')](),controller[_0x526e('0x1e')]);router[_0x526e('0x1d')](_0x526e('0x19'),auth[_0x526e('0x9')](),controller['removeBlackLists']);module[_0x526e('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f28dd01..84ac913 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 _0xd4a1=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xd4a1,0x11d));var _0x1d4a=function(_0x21d83a,_0x387685){_0x21d83a=_0x21d83a-0x0;var _0x3a4e39=_0xd4a1[_0x21d83a];return _0x3a4e39;};'use strict';var Sequelize=require(_0x1d4a('0x0'));module[_0x1d4a('0x1')]={'key':{'type':Sequelize[_0x1d4a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1d4a('0x2')]},'name':{'type':Sequelize[_0x1d4a('0x3')],'get':function(){return this[_0x1d4a('0x4')](_0x1d4a('0x5'));}}}; \ No newline at end of file +var _0x9174=['sequelize','exports','TEXT','VIRTUAL','getDataValue','key'];(function(_0x365e74,_0x595298){var _0x505d5c=function(_0x24cf57){while(--_0x24cf57){_0x365e74['push'](_0x365e74['shift']());}};_0x505d5c(++_0x595298);}(_0x9174,0xba));var _0x4917=function(_0x142857,_0x18b628){_0x142857=_0x142857-0x0;var _0x422131=_0x9174[_0x142857];return _0x422131;};'use strict';var Sequelize=require(_0x4917('0x0'));module[_0x4917('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4917('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4917('0x3')],'get':function(){return this[_0x4917('0x4')](_0x4917('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7d56004..72051d2 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 _0x3a81=['stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','filter','findAll','catch','show','params','includeAll','include','options','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','reject','save','update','then','CannedAnswers','UserProfileResource'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x3a81,0x1c6));var _0x13a8=function(_0x388da2,_0x571cad){_0x388da2=_0x388da2-0x0;var _0x2b1a45=_0x3a81[_0x388da2];return _0x2b1a45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13a8('0x0'));var zipdir=require(_0x13a8('0x1'));var jsonpatch=require(_0x13a8('0x2'));var rp=require(_0x13a8('0x3'));var moment=require('moment');var BPromise=require(_0x13a8('0x4'));var Mustache=require(_0x13a8('0x5'));var util=require(_0x13a8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x13a8('0x7'));var ejs=require(_0x13a8('0x8'));var fs=require('fs');var fs_extra=require(_0x13a8('0x9'));var _=require('lodash');var squel=require(_0x13a8('0xa'));var crypto=require(_0x13a8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x13a8('0xc'));var toCsv=require(_0x13a8('0x7'));var querystring=require(_0x13a8('0xd'));var Papa=require(_0x13a8('0xe'));var Redis=require(_0x13a8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x13a8('0x10'));var as=require(_0x13a8('0x11'));var hardwareService=require(_0x13a8('0x12'));var logger=require(_0x13a8('0x13'))('api');var utils=require(_0x13a8('0x14'));var config=require(_0x13a8('0x15'));var licenseUtil=require(_0x13a8('0x16'));var db=require(_0x13a8('0x17'))['db'];function respondWithStatusCode(_0x23fab7,_0x4f2fcf){_0x4f2fcf=_0x4f2fcf||0xcc;return function(_0x586da0){if(_0x586da0){return _0x23fab7[_0x13a8('0x18')](_0x4f2fcf);}return _0x23fab7[_0x13a8('0x19')](_0x4f2fcf)[_0x13a8('0x1a')]();};}function respondWithResult(_0x4e9f2a,_0x3af602){_0x3af602=_0x3af602||0xc8;return function(_0x86dfe3){if(_0x86dfe3){return _0x4e9f2a['status'](_0x3af602)['json'](_0x86dfe3);}};}function respondWithFilteredResult(_0x381750,_0x249952){return function(_0x1b179d){if(_0x1b179d){var _0xe0f4d4=typeof _0x249952[_0x13a8('0x1b')]==='undefined'&&typeof _0x249952[_0x13a8('0x1c')]===_0x13a8('0x1d');var _0x5e19ae=_0x1b179d[_0x13a8('0x1e')];var _0x5b088c=_0xe0f4d4?0x0:_0x249952[_0x13a8('0x1b')];var _0x510dd1=_0xe0f4d4?_0x1b179d['count']:_0x249952[_0x13a8('0x1b')]+_0x249952[_0x13a8('0x1c')];var _0x13941c;if(_0x510dd1>=_0x5e19ae){_0x510dd1=_0x5e19ae;_0x13941c=0xc8;}else{_0x13941c=0xce;}_0x381750[_0x13a8('0x19')](_0x13941c);return _0x381750['set'](_0x13a8('0x1f'),_0x5b088c+'-'+_0x510dd1+'/'+_0x5e19ae)['json'](_0x1b179d);}return null;};}function patchUpdates(_0x554973){return function(_0x3fa563){try{jsonpatch['apply'](_0x3fa563,_0x554973,!![]);}catch(_0x33aa56){return BPromise[_0x13a8('0x20')](_0x33aa56);}return _0x3fa563[_0x13a8('0x21')]();};}function saveUpdates(_0x27afcc,_0x28ad3f){return function(_0x1b8949){if(_0x1b8949){return _0x1b8949[_0x13a8('0x22')](_0x27afcc)[_0x13a8('0x23')](function(_0x5f21b3){return _0x5f21b3;});}return null;};}function removeEntity(_0x179778,_0x5320de){return function(_0x402da1){if(_0x402da1){return _0x402da1['destroy']()[_0x13a8('0x23')](function(){var _0x4f0d26=_0x402da1['get']({'plain':!![]});var _0x28907e=_0x13a8('0x24');return db[_0x13a8('0x25')]['destroy']({'where':{'type':_0x28907e,'resourceId':_0x4f0d26['id']}})[_0x13a8('0x23')](function(){return _0x402da1;});})[_0x13a8('0x23')](function(){_0x179778[_0x13a8('0x19')](0xcc)[_0x13a8('0x1a')]();});}};}function handleEntityNotFound(_0x534581,_0x4f881d){return function(_0x361b20){if(!_0x361b20){_0x534581['sendStatus'](0x194);}return _0x361b20;};}function handleError(_0x103ad9,_0x5c6ae2){_0x5c6ae2=_0x5c6ae2||0x1f4;return function(_0x556aa8){logger['error'](_0x556aa8[_0x13a8('0x26')]);if(_0x556aa8[_0x13a8('0x27')]){delete _0x556aa8[_0x13a8('0x27')];}_0x103ad9['status'](_0x5c6ae2)['send'](_0x556aa8);};}exports[_0x13a8('0x28')]=function(_0x4c7808,_0x598b23){var _0x3149c6={},_0x1206b8={},_0x2a210c={'count':0x0,'rows':[]};var _0x2d8ad9=_['map'](db[_0x13a8('0x29')][_0x13a8('0x2a')],function(_0x595aad){return{'name':_0x595aad[_0x13a8('0x2b')],'type':_0x595aad[_0x13a8('0x2c')][_0x13a8('0x2d')]};});_0x1206b8[_0x13a8('0x2e')]=_[_0x13a8('0x2f')](_0x2d8ad9,_0x13a8('0x27'));_0x1206b8[_0x13a8('0x30')]=_[_0x13a8('0x31')](_0x4c7808[_0x13a8('0x30')]);_0x1206b8[_0x13a8('0x32')]=_[_0x13a8('0x33')](_0x1206b8['model'],_0x1206b8['query']);_0x3149c6[_0x13a8('0x34')]=_[_0x13a8('0x33')](_0x1206b8[_0x13a8('0x2e')],qs[_0x13a8('0x35')](_0x4c7808[_0x13a8('0x30')]['fields']));_0x3149c6[_0x13a8('0x34')]=_0x3149c6[_0x13a8('0x34')]['length']?_0x3149c6['attributes']:_0x1206b8[_0x13a8('0x2e')];if(!_0x4c7808[_0x13a8('0x30')][_0x13a8('0x36')]('nolimit')){_0x3149c6['limit']=qs[_0x13a8('0x1c')](_0x4c7808[_0x13a8('0x30')][_0x13a8('0x1c')]);_0x3149c6[_0x13a8('0x1b')]=qs[_0x13a8('0x1b')](_0x4c7808[_0x13a8('0x30')]['offset']);}_0x3149c6['order']=qs[_0x13a8('0x37')](_0x4c7808['query'][_0x13a8('0x37')]);_0x3149c6[_0x13a8('0x38')]=qs[_0x13a8('0x32')](_['pick'](_0x4c7808[_0x13a8('0x30')],_0x1206b8[_0x13a8('0x32')]),_0x2d8ad9);if(_0x4c7808[_0x13a8('0x30')]['filter']){_0x3149c6[_0x13a8('0x38')]=_[_0x13a8('0x39')](_0x3149c6[_0x13a8('0x38')],{'$or':[{'key':{'$like':'%'+_0x4c7808[_0x13a8('0x30')][_0x13a8('0x3a')]+'%'}},{'value':{'$like':'%'+_0x4c7808[_0x13a8('0x30')][_0x13a8('0x3a')]+'%'}}]});}_0x3149c6=_['merge']({},_0x3149c6,_0x4c7808['options']);var _0x55368d={'where':_0x3149c6[_0x13a8('0x38')]};return db[_0x13a8('0x29')]['count'](_0x55368d)[_0x13a8('0x23')](function(_0x58bc19){_0x2a210c[_0x13a8('0x1e')]=_0x58bc19;if(_0x4c7808[_0x13a8('0x30')]['includeAll']){_0x3149c6['include']=[{'all':!![]}];}return db[_0x13a8('0x29')][_0x13a8('0x3b')](_0x3149c6);})['then'](function(_0x49cdcd){_0x2a210c['rows']=_0x49cdcd;return _0x2a210c;})['then'](respondWithFilteredResult(_0x598b23,_0x3149c6))[_0x13a8('0x3c')](handleError(_0x598b23,null));};exports[_0x13a8('0x3d')]=function(_0x3234c8,_0x27eeca){var _0x538f14={'raw':!![],'where':{'id':_0x3234c8[_0x13a8('0x3e')]['id']}},_0x3dbc94={};_0x3dbc94[_0x13a8('0x2e')]=_[_0x13a8('0x31')](db[_0x13a8('0x29')][_0x13a8('0x2a')]);_0x3dbc94[_0x13a8('0x30')]=_['keys'](_0x3234c8[_0x13a8('0x30')]);_0x3dbc94[_0x13a8('0x32')]=_[_0x13a8('0x33')](_0x3dbc94['model'],_0x3dbc94[_0x13a8('0x30')]);_0x538f14[_0x13a8('0x34')]=_[_0x13a8('0x33')](_0x3dbc94[_0x13a8('0x2e')],qs[_0x13a8('0x35')](_0x3234c8[_0x13a8('0x30')][_0x13a8('0x35')]));_0x538f14[_0x13a8('0x34')]=_0x538f14[_0x13a8('0x34')]['length']?_0x538f14[_0x13a8('0x34')]:_0x3dbc94['model'];if(_0x3234c8[_0x13a8('0x30')][_0x13a8('0x3f')]){_0x538f14[_0x13a8('0x40')]=[{'all':!![]}];}_0x538f14=_[_0x13a8('0x39')]({},_0x538f14,_0x3234c8[_0x13a8('0x41')]);return db[_0x13a8('0x29')][_0x13a8('0x42')](_0x538f14)[_0x13a8('0x23')](handleEntityNotFound(_0x27eeca,null))[_0x13a8('0x23')](respondWithResult(_0x27eeca,null))[_0x13a8('0x3c')](handleError(_0x27eeca,null));};exports[_0x13a8('0x22')]=function(_0x2e7bb3,_0x1eaa10){if(_0x2e7bb3[_0x13a8('0x43')]['id']){delete _0x2e7bb3['body']['id'];}return db[_0x13a8('0x29')][_0x13a8('0x42')]({'where':{'id':_0x2e7bb3[_0x13a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1eaa10,null))[_0x13a8('0x23')](saveUpdates(_0x2e7bb3[_0x13a8('0x43')],null))['then'](respondWithResult(_0x1eaa10,null))[_0x13a8('0x3c')](handleError(_0x1eaa10,null));};exports[_0x13a8('0x44')]=function(_0x412cd4,_0x147254){return db[_0x13a8('0x29')][_0x13a8('0x42')]({'where':{'id':_0x412cd4[_0x13a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x147254,null))[_0x13a8('0x23')](removeEntity(_0x147254,null))[_0x13a8('0x3c')](handleError(_0x147254,null));};exports[_0x13a8('0x45')]=function(_0x3f4428,_0x1411cb){var _0x52f34f={'key':_0x3f4428[_0x13a8('0x43')][_0x13a8('0x2d')]};if(_0x3f4428['body'][_0x13a8('0x46')]){_0x52f34f[_0x13a8('0x46')]=_0x3f4428[_0x13a8('0x43')][_0x13a8('0x46')];}else if(_0x3f4428['body'][_0x13a8('0x47')]){_0x52f34f[_0x13a8('0x47')]=_0x3f4428[_0x13a8('0x43')][_0x13a8('0x47')];}else if(_0x3f4428[_0x13a8('0x43')]['OpenchannelAccountId']){_0x52f34f[_0x13a8('0x48')]=_0x3f4428[_0x13a8('0x43')]['OpenchannelAccountId'];}else if(_0x3f4428[_0x13a8('0x43')]['ChatWebsiteId']){_0x52f34f[_0x13a8('0x49')]=_0x3f4428[_0x13a8('0x43')][_0x13a8('0x49')];}return db[_0x13a8('0x29')][_0x13a8('0x42')]({'where':_0x52f34f})[_0x13a8('0x23')](function(_0x5a2630){if(_0x5a2630){throw new db['Sequelize'][(_0x13a8('0x4a'))](_0x13a8('0x4b'));}return db['CannedAnswer']['create'](_0x3f4428['body']);})[_0x13a8('0x23')](function(_0x42cba3){var _0x848419=_0x3f4428[_0x13a8('0x4c')][_0x13a8('0x4d')]({'plain':!![]});if(!_0x848419)throw new Error(_0x13a8('0x4e'));if(_0x848419['role']===_0x13a8('0x4c')){var _0x423d6b=_0x42cba3['get']({'plain':!![]});return db['UserProfileSection'][_0x13a8('0x42')]({'where':{'name':_0x13a8('0x24'),'userProfileId':_0x848419[_0x13a8('0x4f')]},'raw':!![]})[_0x13a8('0x23')](function(_0x283733){if(_0x283733&&_0x283733[_0x13a8('0x50')]===0x0){return db[_0x13a8('0x25')]['create']({'name':_0x423d6b[_0x13a8('0x27')],'resourceId':_0x423d6b['id'],'type':_0x283733[_0x13a8('0x27')],'sectionId':_0x283733['id']},{})['then'](function(){return _0x42cba3;});}else{return _0x42cba3;}})[_0x13a8('0x3c')](function(_0x3cd117){logger['error'](_0x13a8('0x51'),_0x3cd117);throw _0x3cd117;});}return _0x42cba3;})['then'](respondWithResult(_0x1411cb,0xc9))[_0x13a8('0x3c')](handleError(_0x1411cb,null));}; \ No newline at end of file +var _0x0e2a=['send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','keys','filters','attributes','intersection','fields','query','length','order','sort','where','filter','merge','options','findAll','catch','params','includeAll','include','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','UserProfileResource','error','stack','name'];(function(_0x25b3ad,_0x27d0e3){var _0x2c58b3=function(_0x21dee9){while(--_0x21dee9){_0x25b3ad['push'](_0x25b3ad['shift']());}};_0x2c58b3(++_0x27d0e3);}(_0x0e2a,0xd9));var _0xa0e2=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x0e2a[_0x1304c6];return _0x2e6654;};'use strict';var emlformat=require(_0xa0e2('0x0'));var rimraf=require(_0xa0e2('0x1'));var zipdir=require(_0xa0e2('0x2'));var jsonpatch=require(_0xa0e2('0x3'));var rp=require(_0xa0e2('0x4'));var moment=require(_0xa0e2('0x5'));var BPromise=require(_0xa0e2('0x6'));var Mustache=require(_0xa0e2('0x7'));var util=require(_0xa0e2('0x8'));var path=require(_0xa0e2('0x9'));var sox=require(_0xa0e2('0xa'));var csv=require(_0xa0e2('0xb'));var ejs=require(_0xa0e2('0xc'));var fs=require('fs');var fs_extra=require(_0xa0e2('0xd'));var _=require(_0xa0e2('0xe'));var squel=require(_0xa0e2('0xf'));var crypto=require(_0xa0e2('0x10'));var jsforce=require(_0xa0e2('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xa0e2('0xb'));var querystring=require(_0xa0e2('0x12'));var Papa=require('papaparse');var Redis=require(_0xa0e2('0x13'));var authService=require(_0xa0e2('0x14'));var qs=require(_0xa0e2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0e2('0x16'));var logger=require(_0xa0e2('0x17'))('api');var utils=require(_0xa0e2('0x18'));var config=require(_0xa0e2('0x19'));var licenseUtil=require(_0xa0e2('0x1a'));var db=require(_0xa0e2('0x1b'))['db'];function respondWithStatusCode(_0x42352d,_0x55bfdd){_0x55bfdd=_0x55bfdd||0xcc;return function(_0x4f54d4){if(_0x4f54d4){return _0x42352d[_0xa0e2('0x1c')](_0x55bfdd);}return _0x42352d[_0xa0e2('0x1d')](_0x55bfdd)[_0xa0e2('0x1e')]();};}function respondWithResult(_0x2e1c7f,_0x1eb6a8){_0x1eb6a8=_0x1eb6a8||0xc8;return function(_0x4dcad0){if(_0x4dcad0){return _0x2e1c7f[_0xa0e2('0x1d')](_0x1eb6a8)[_0xa0e2('0x1f')](_0x4dcad0);}};}function respondWithFilteredResult(_0x53674a,_0x30b180){return function(_0x187dc9){if(_0x187dc9){var _0x4c2e3c=typeof _0x30b180['offset']===_0xa0e2('0x20')&&typeof _0x30b180[_0xa0e2('0x21')]===_0xa0e2('0x20');var _0x53150f=_0x187dc9[_0xa0e2('0x22')];var _0x7f0b3=_0x4c2e3c?0x0:_0x30b180[_0xa0e2('0x23')];var _0x2c26b7=_0x4c2e3c?_0x187dc9[_0xa0e2('0x22')]:_0x30b180[_0xa0e2('0x23')]+_0x30b180[_0xa0e2('0x21')];var _0x18b95;if(_0x2c26b7>=_0x53150f){_0x2c26b7=_0x53150f;_0x18b95=0xc8;}else{_0x18b95=0xce;}_0x53674a[_0xa0e2('0x1d')](_0x18b95);return _0x53674a[_0xa0e2('0x24')](_0xa0e2('0x25'),_0x7f0b3+'-'+_0x2c26b7+'/'+_0x53150f)[_0xa0e2('0x1f')](_0x187dc9);}return null;};}function patchUpdates(_0x23a6a3){return function(_0x41e933){try{jsonpatch['apply'](_0x41e933,_0x23a6a3,!![]);}catch(_0x332771){return BPromise[_0xa0e2('0x26')](_0x332771);}return _0x41e933[_0xa0e2('0x27')]();};}function saveUpdates(_0x557153,_0x325c05){return function(_0x55f9f2){if(_0x55f9f2){return _0x55f9f2[_0xa0e2('0x28')](_0x557153)['then'](function(_0x5c4ad8){return _0x5c4ad8;});}return null;};}function removeEntity(_0x17effd,_0x24aa9a){return function(_0x7dcea1){if(_0x7dcea1){return _0x7dcea1['destroy']()[_0xa0e2('0x29')](function(){var _0x255fc9=_0x7dcea1[_0xa0e2('0x2a')]({'plain':!![]});var _0x559b77='CannedAnswers';return db[_0xa0e2('0x2b')]['destroy']({'where':{'type':_0x559b77,'resourceId':_0x255fc9['id']}})['then'](function(){return _0x7dcea1;});})['then'](function(){_0x17effd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bfe1a,_0x3d6197){return function(_0x425943){if(!_0x425943){_0x4bfe1a[_0xa0e2('0x1c')](0x194);}return _0x425943;};}function handleError(_0x3afba0,_0x254a99){_0x254a99=_0x254a99||0x1f4;return function(_0x407fda){logger[_0xa0e2('0x2c')](_0x407fda[_0xa0e2('0x2d')]);if(_0x407fda[_0xa0e2('0x2e')]){delete _0x407fda['name'];}_0x3afba0[_0xa0e2('0x1d')](_0x254a99)[_0xa0e2('0x2f')](_0x407fda);};}exports[_0xa0e2('0x30')]=function(_0x2497dc,_0x4d2714){var _0x2cf19d={},_0x404522={},_0x172030={'count':0x0,'rows':[]};var _0x2dcd5f=_[_0xa0e2('0x31')](db[_0xa0e2('0x32')][_0xa0e2('0x33')],function(_0x3cb1c1){return{'name':_0x3cb1c1[_0xa0e2('0x34')],'type':_0x3cb1c1['type'][_0xa0e2('0x35')]};});_0x404522[_0xa0e2('0x36')]=_[_0xa0e2('0x31')](_0x2dcd5f,_0xa0e2('0x2e'));_0x404522['query']=_[_0xa0e2('0x37')](_0x2497dc['query']);_0x404522[_0xa0e2('0x38')]=_['intersection'](_0x404522[_0xa0e2('0x36')],_0x404522['query']);_0x2cf19d[_0xa0e2('0x39')]=_[_0xa0e2('0x3a')](_0x404522[_0xa0e2('0x36')],qs[_0xa0e2('0x3b')](_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x3b')]));_0x2cf19d[_0xa0e2('0x39')]=_0x2cf19d[_0xa0e2('0x39')][_0xa0e2('0x3d')]?_0x2cf19d[_0xa0e2('0x39')]:_0x404522[_0xa0e2('0x36')];if(!_0x2497dc['query']['hasOwnProperty']('nolimit')){_0x2cf19d[_0xa0e2('0x21')]=qs[_0xa0e2('0x21')](_0x2497dc[_0xa0e2('0x3c')]['limit']);_0x2cf19d[_0xa0e2('0x23')]=qs[_0xa0e2('0x23')](_0x2497dc['query']['offset']);}_0x2cf19d[_0xa0e2('0x3e')]=qs['sort'](_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x3f')]);_0x2cf19d[_0xa0e2('0x40')]=qs[_0xa0e2('0x38')](_['pick'](_0x2497dc[_0xa0e2('0x3c')],_0x404522[_0xa0e2('0x38')]),_0x2dcd5f);if(_0x2497dc[_0xa0e2('0x3c')]['filter']){_0x2cf19d['where']=_['merge'](_0x2cf19d[_0xa0e2('0x40')],{'$or':[{'key':{'$like':'%'+_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x41')]+'%'}},{'value':{'$like':'%'+_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x41')]+'%'}}]});}_0x2cf19d=_[_0xa0e2('0x42')]({},_0x2cf19d,_0x2497dc[_0xa0e2('0x43')]);var _0x4547fd={'where':_0x2cf19d['where']};return db[_0xa0e2('0x32')][_0xa0e2('0x22')](_0x4547fd)[_0xa0e2('0x29')](function(_0xea3fc8){_0x172030[_0xa0e2('0x22')]=_0xea3fc8;if(_0x2497dc[_0xa0e2('0x3c')]['includeAll']){_0x2cf19d['include']=[{'all':!![]}];}return db[_0xa0e2('0x32')][_0xa0e2('0x44')](_0x2cf19d);})[_0xa0e2('0x29')](function(_0x58356e){_0x172030['rows']=_0x58356e;return _0x172030;})['then'](respondWithFilteredResult(_0x4d2714,_0x2cf19d))[_0xa0e2('0x45')](handleError(_0x4d2714,null));};exports['show']=function(_0x120183,_0x49e6ef){var _0x4c21dd={'raw':!![],'where':{'id':_0x120183[_0xa0e2('0x46')]['id']}},_0x27fc9a={};_0x27fc9a[_0xa0e2('0x36')]=_[_0xa0e2('0x37')](db['CannedAnswer'][_0xa0e2('0x33')]);_0x27fc9a[_0xa0e2('0x3c')]=_['keys'](_0x120183[_0xa0e2('0x3c')]);_0x27fc9a[_0xa0e2('0x38')]=_[_0xa0e2('0x3a')](_0x27fc9a[_0xa0e2('0x36')],_0x27fc9a[_0xa0e2('0x3c')]);_0x4c21dd['attributes']=_['intersection'](_0x27fc9a[_0xa0e2('0x36')],qs[_0xa0e2('0x3b')](_0x120183[_0xa0e2('0x3c')][_0xa0e2('0x3b')]));_0x4c21dd[_0xa0e2('0x39')]=_0x4c21dd[_0xa0e2('0x39')][_0xa0e2('0x3d')]?_0x4c21dd['attributes']:_0x27fc9a[_0xa0e2('0x36')];if(_0x120183['query'][_0xa0e2('0x47')]){_0x4c21dd[_0xa0e2('0x48')]=[{'all':!![]}];}_0x4c21dd=_[_0xa0e2('0x42')]({},_0x4c21dd,_0x120183[_0xa0e2('0x43')]);return db['CannedAnswer'][_0xa0e2('0x49')](_0x4c21dd)[_0xa0e2('0x29')](handleEntityNotFound(_0x49e6ef,null))[_0xa0e2('0x29')](respondWithResult(_0x49e6ef,null))['catch'](handleError(_0x49e6ef,null));};exports['update']=function(_0x49c402,_0x272b24){if(_0x49c402['body']['id']){delete _0x49c402[_0xa0e2('0x4a')]['id'];}return db[_0xa0e2('0x32')][_0xa0e2('0x49')]({'where':{'id':_0x49c402[_0xa0e2('0x46')]['id']}})[_0xa0e2('0x29')](handleEntityNotFound(_0x272b24,null))[_0xa0e2('0x29')](saveUpdates(_0x49c402['body'],null))['then'](respondWithResult(_0x272b24,null))['catch'](handleError(_0x272b24,null));};exports[_0xa0e2('0x4b')]=function(_0x271c64,_0x48fd13){return db[_0xa0e2('0x32')][_0xa0e2('0x49')]({'where':{'id':_0x271c64['params']['id']}})['then'](handleEntityNotFound(_0x48fd13,null))[_0xa0e2('0x29')](removeEntity(_0x48fd13,null))['catch'](handleError(_0x48fd13,null));};exports[_0xa0e2('0x4c')]=function(_0x4f008e,_0x5780d1){var _0x4b4ef5={'key':_0x4f008e['body'][_0xa0e2('0x35')]};if(_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4d')]){_0x4b4ef5['MailAccountId']=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4d')];}else if(_0x4f008e['body'][_0xa0e2('0x4e')]){_0x4b4ef5[_0xa0e2('0x4e')]=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4e')];}else if(_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4f')]){_0x4b4ef5['OpenchannelAccountId']=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4f')];}else if(_0x4f008e[_0xa0e2('0x4a')]['ChatWebsiteId']){_0x4b4ef5['ChatWebsiteId']=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x50')];}return db[_0xa0e2('0x32')][_0xa0e2('0x49')]({'where':_0x4b4ef5})[_0xa0e2('0x29')](function(_0x410430){if(_0x410430){throw new db['Sequelize']['ValidationError'](_0xa0e2('0x51'));}return db[_0xa0e2('0x32')]['create'](_0x4f008e[_0xa0e2('0x4a')]);})[_0xa0e2('0x29')](function(_0x486fa5){var _0x2f8977=_0x4f008e[_0xa0e2('0x52')][_0xa0e2('0x2a')]({'plain':!![]});if(!_0x2f8977)throw new Error(_0xa0e2('0x53'));if(_0x2f8977[_0xa0e2('0x54')]===_0xa0e2('0x52')){var _0x416365=_0x486fa5[_0xa0e2('0x2a')]({'plain':!![]});return db[_0xa0e2('0x55')][_0xa0e2('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x2f8977[_0xa0e2('0x56')]},'raw':!![]})[_0xa0e2('0x29')](function(_0x5b726c){if(_0x5b726c&&_0x5b726c['autoAssociation']===0x0){return db[_0xa0e2('0x2b')]['create']({'name':_0x416365['name'],'resourceId':_0x416365['id'],'type':_0x5b726c[_0xa0e2('0x2e')],'sectionId':_0x5b726c['id']},{})[_0xa0e2('0x29')](function(){return _0x486fa5;});}else{return _0x486fa5;}})[_0xa0e2('0x45')](function(_0x1086de){logger[_0xa0e2('0x2c')](_0xa0e2('0x57'),_0x1086de);throw _0x1086de;});}return _0x486fa5;})['then'](respondWithResult(_0x5780d1,0xc9))[_0xa0e2('0x45')](handleError(_0x5780d1,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 0e95fc9..2d9c55c 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 _0xb76d=['../../config/environment','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','path','rimraf'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_0xb76d,0x19f));var _0xdb76=function(_0x3e319e,_0x40be91){_0x3e319e=_0x3e319e-0x0;var _0x1a80be=_0xb76d[_0x3e319e];return _0x1a80be;};'use strict';var _=require(_0xdb76('0x0'));var util=require(_0xdb76('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdb76('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb76('0x3'));var rimraf=require(_0xdb76('0x4'));var config=require(_0xdb76('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x3ab524,_0x2c516d){return _0x3ab524[_0xdb76('0x6')]('CannedAnswer',attributes,{'tableName':_0xdb76('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb76('0x8'),'collate':_0xdb76('0x9')});}; \ No newline at end of file +var _0xf151=['CannedAnswer','tools_canned_answers','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf151,0xab));var _0x1f15=function(_0x273a0d,_0x45885f){_0x273a0d=_0x273a0d-0x0;var _0x2ebc5d=_0xf151[_0x273a0d];return _0x2ebc5d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f15('0x0'))(_0x1f15('0x1'));var moment=require(_0x1f15('0x2'));var BPromise=require(_0x1f15('0x3'));var rp=require(_0x1f15('0x4'));var fs=require('fs');var path=require(_0x1f15('0x5'));var rimraf=require(_0x1f15('0x6'));var config=require(_0x1f15('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x1f15('0x8')]=function(_0x5548bb,_0x4cfc7b){return _0x5548bb['define'](_0x1f15('0x9'),attributes,{'tableName':_0x1f15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f15('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index b62ecec..1c6f6bd 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(_0x330298,_0x2392c9){var _0x763a55=function(_0x2a0f33){while(--_0x2a0f33){_0x330298['push'](_0x330298['shift']());}};_0x763a55(++_0x2392c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x406f90,_0x1481d4){var _0x5b6871=function(_0x103e25){while(--_0x103e25){_0x406f90['push'](_0x406f90['shift']());}};_0x5b6871(++_0x1481d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 8efea39..7bcf7cd 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 _0x8bfb=['get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x46d97c,_0x4f2b6b){var _0x5a21af=function(_0x25cb69){while(--_0x25cb69){_0x46d97c['push'](_0x46d97c['shift']());}};_0x5a21af(++_0x4f2b6b);}(_0x8bfb,0xab));var _0xb8bf=function(_0x433bf1,_0x5e342d){_0x433bf1=_0x433bf1-0x0;var _0x1b32f4=_0x8bfb[_0x433bf1];return _0x1b32f4;};'use strict';var multer=require(_0xb8bf('0x0'));var util=require(_0xb8bf('0x1'));var path=require(_0xb8bf('0x2'));var timeout=require(_0xb8bf('0x3'));var express=require('express');var router=express[_0xb8bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb8bf('0x5'));var interaction=require(_0xb8bf('0x6'));var config=require(_0xb8bf('0x7'));var controller=require(_0xb8bf('0x8'));router[_0xb8bf('0x9')]('/',auth[_0xb8bf('0xa')](),controller[_0xb8bf('0xb')]);router[_0xb8bf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb8bf('0xc')]);router[_0xb8bf('0xd')]('/',auth['isAuthenticated'](),controller[_0xb8bf('0xe')]);router[_0xb8bf('0xf')](_0xb8bf('0x10'),auth[_0xb8bf('0xa')](),controller[_0xb8bf('0x11')]);router['delete'](_0xb8bf('0x10'),auth['isAuthenticated'](),controller[_0xb8bf('0x12')]);module[_0xb8bf('0x13')]=router; \ No newline at end of file +var _0x5688=['fs-extra','../../components/auth/service','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x76247a,_0x519d32){var _0x5603cc=function(_0x1b7858){while(--_0x1b7858){_0x76247a['push'](_0x76247a['shift']());}};_0x5603cc(++_0x519d32);}(_0x5688,0x108));var _0x8568=function(_0x188cb8,_0x3b12b3){_0x188cb8=_0x188cb8-0x0;var _0x25eb9b=_0x5688[_0x188cb8];return _0x25eb9b;};'use strict';var multer=require(_0x8568('0x0'));var util=require(_0x8568('0x1'));var path=require(_0x8568('0x2'));var timeout=require(_0x8568('0x3'));var express=require(_0x8568('0x4'));var router=express[_0x8568('0x5')]();var fs_extra=require(_0x8568('0x6'));var auth=require(_0x8568('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8568('0x8'));router[_0x8568('0x9')]('/',auth['isAuthenticated'](),controller[_0x8568('0xa')]);router[_0x8568('0x9')](_0x8568('0xb'),auth[_0x8568('0xc')](),controller[_0x8568('0xd')]);router[_0x8568('0xe')]('/',auth[_0x8568('0xc')](),controller['create']);router[_0x8568('0xf')](_0x8568('0xb'),auth[_0x8568('0xc')](),controller[_0x8568('0x10')]);router['delete'](_0x8568('0xb'),auth[_0x8568('0xc')](),controller[_0x8568('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 5474b0f..bbfaea1 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 _0x98e5=['1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0x98e5,0x8a));var _0x598e=function(_0x8df78,_0xdfee63){_0x8df78=_0x8df78-0x0;var _0xde4b55=_0x98e5[_0x8df78];return _0xde4b55;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x598e('0x0')},'clid':{'type':Sequelize[_0x598e('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x598e('0x1')]},'dcontext':{'type':Sequelize[_0x598e('0x1')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x598e('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x598e('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x598e('0x1')]},'amaflags':{'type':Sequelize[_0x598e('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x598e('0x1')]},'userfield':{'type':Sequelize[_0x598e('0x1')]},'uniqueid':{'type':Sequelize[_0x598e('0x1')]},'linkedid':{'type':Sequelize[_0x598e('0x1')]},'sequence':{'type':Sequelize[_0x598e('0x1')]},'peeraccount':{'type':Sequelize[_0x598e('0x1')]},'type':{'type':Sequelize[_0x598e('0x1')]},'tag':{'type':Sequelize[_0x598e('0x1')]}}; \ No newline at end of file +var _0x2dae=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x2dae,0xc3));var _0xe2da=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x2dae[_0x14363e];return _0x17c56d;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![],'defaultValue':_0xe2da('0x2')},'clid':{'type':Sequelize[_0xe2da('0x3')]},'src':{'type':Sequelize[_0xe2da('0x3')]},'dst':{'type':Sequelize[_0xe2da('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe2da('0x3')]},'dstchannel':{'type':Sequelize[_0xe2da('0x3')]},'lastapp':{'type':Sequelize[_0xe2da('0x3')]},'lastdata':{'type':Sequelize[_0xe2da('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe2da('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe2da('0x3')]},'amaflags':{'type':Sequelize[_0xe2da('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe2da('0x3')]},'userfield':{'type':Sequelize[_0xe2da('0x3')]},'uniqueid':{'type':Sequelize[_0xe2da('0x3')]},'linkedid':{'type':Sequelize[_0xe2da('0x3')]},'sequence':{'type':Sequelize[_0xe2da('0x3')]},'peeraccount':{'type':Sequelize[_0xe2da('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xe2da('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c3a0ad7..8105ad7 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 _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xf767,0x76));var _0x7f76=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xf767[_0x466247];return _0x4b352e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));}; \ No newline at end of file +var _0x6075=['end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','Cdr','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x3a81db,_0x435f22){var _0x1e6b98=function(_0x54997e){while(--_0x54997e){_0x3a81db['push'](_0x3a81db['shift']());}};_0x1e6b98(++_0x435f22);}(_0x6075,0x191));var _0x5607=function(_0x17fc2a,_0x1a3f70){_0x17fc2a=_0x17fc2a-0x0;var _0x5bf7dc=_0x6075[_0x17fc2a];return _0x5bf7dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5607('0x0'));var zipdir=require(_0x5607('0x1'));var jsonpatch=require(_0x5607('0x2'));var rp=require(_0x5607('0x3'));var moment=require(_0x5607('0x4'));var BPromise=require(_0x5607('0x5'));var Mustache=require(_0x5607('0x6'));var util=require(_0x5607('0x7'));var path=require(_0x5607('0x8'));var sox=require('sox');var csv=require(_0x5607('0x9'));var ejs=require(_0x5607('0xa'));var fs=require('fs');var fs_extra=require(_0x5607('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5607('0xc'));var jsforce=require(_0x5607('0xd'));var deskjs=require(_0x5607('0xe'));var toCsv=require(_0x5607('0x9'));var querystring=require(_0x5607('0xf'));var Papa=require('papaparse');var Redis=require(_0x5607('0x10'));var authService=require(_0x5607('0x11'));var qs=require(_0x5607('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5607('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5607('0x14'));var config=require(_0x5607('0x15'));var licenseUtil=require(_0x5607('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c8013,_0x42a405){_0x42a405=_0x42a405||0xcc;return function(_0xc534bd){if(_0xc534bd){return _0x2c8013[_0x5607('0x17')](_0x42a405);}return _0x2c8013[_0x5607('0x18')](_0x42a405)[_0x5607('0x19')]();};}function respondWithResult(_0x138d74,_0x1c8cbc){_0x1c8cbc=_0x1c8cbc||0xc8;return function(_0x2daf4c){if(_0x2daf4c){return _0x138d74['status'](_0x1c8cbc)[_0x5607('0x1a')](_0x2daf4c);}};}function respondWithFilteredResult(_0x275c5d,_0xe3e004){return function(_0x505b12){if(_0x505b12){var _0x556397=typeof _0xe3e004[_0x5607('0x1b')]==='undefined'&&typeof _0xe3e004[_0x5607('0x1c')]===_0x5607('0x1d');var _0x1fa238=_0x505b12[_0x5607('0x1e')];var _0x3eaaa0=_0x556397?0x0:_0xe3e004[_0x5607('0x1b')];var _0x55689e=_0x556397?_0x505b12[_0x5607('0x1e')]:_0xe3e004['offset']+_0xe3e004[_0x5607('0x1c')];var _0x3e071b;if(_0x55689e>=_0x1fa238){_0x55689e=_0x1fa238;_0x3e071b=0xc8;}else{_0x3e071b=0xce;}_0x275c5d[_0x5607('0x18')](_0x3e071b);return _0x275c5d['set'](_0x5607('0x1f'),_0x3eaaa0+'-'+_0x55689e+'/'+_0x1fa238)[_0x5607('0x1a')](_0x505b12);}return null;};}function patchUpdates(_0x303089){return function(_0x4e66f0){try{jsonpatch[_0x5607('0x20')](_0x4e66f0,_0x303089,!![]);}catch(_0x2fdc13){return BPromise[_0x5607('0x21')](_0x2fdc13);}return _0x4e66f0['save']();};}function saveUpdates(_0x44f7a2,_0x4feb1c){return function(_0x49f918){if(_0x49f918){return _0x49f918[_0x5607('0x22')](_0x44f7a2)[_0x5607('0x23')](function(_0x32d30a){return _0x32d30a;});}return null;};}function removeEntity(_0x2d983f,_0x351c32){return function(_0x34df69){if(_0x34df69){return _0x34df69[_0x5607('0x24')]()[_0x5607('0x23')](function(){_0x2d983f[_0x5607('0x18')](0xcc)[_0x5607('0x19')]();});}};}function handleEntityNotFound(_0x593df7,_0x20ae60){return function(_0x27e144){if(!_0x27e144){_0x593df7['sendStatus'](0x194);}return _0x27e144;};}function handleError(_0xa83081,_0x14dd08){_0x14dd08=_0x14dd08||0x1f4;return function(_0xdb07c8){logger[_0x5607('0x25')](_0xdb07c8[_0x5607('0x26')]);if(_0xdb07c8[_0x5607('0x27')]){delete _0xdb07c8[_0x5607('0x27')];}_0xa83081[_0x5607('0x18')](_0x14dd08)['send'](_0xdb07c8);};}exports[_0x5607('0x28')]=function(_0x309ede,_0x51b7d5){var _0x5932ae={},_0x12f58f={},_0x40f20e={'count':0x0,'rows':[]};var _0xe8788=_[_0x5607('0x29')](db[_0x5607('0x2a')]['rawAttributes'],function(_0x2575c3){return{'name':_0x2575c3['fieldName'],'type':_0x2575c3[_0x5607('0x2b')][_0x5607('0x2c')]};});_0x12f58f[_0x5607('0x2d')]=_['map'](_0xe8788,_0x5607('0x27'));_0x12f58f['query']=_[_0x5607('0x2e')](_0x309ede[_0x5607('0x2f')]);_0x12f58f[_0x5607('0x30')]=_[_0x5607('0x31')](_0x12f58f[_0x5607('0x2d')],_0x12f58f['query']);_0x5932ae[_0x5607('0x32')]=_['intersection'](_0x12f58f[_0x5607('0x2d')],qs[_0x5607('0x33')](_0x309ede['query'][_0x5607('0x33')]));_0x5932ae[_0x5607('0x32')]=_0x5932ae[_0x5607('0x32')]['length']?_0x5932ae[_0x5607('0x32')]:_0x12f58f[_0x5607('0x2d')];if(!_0x309ede[_0x5607('0x2f')][_0x5607('0x34')]('nolimit')){_0x5932ae[_0x5607('0x1c')]=qs[_0x5607('0x1c')](_0x309ede['query'][_0x5607('0x1c')]);_0x5932ae[_0x5607('0x1b')]=qs[_0x5607('0x1b')](_0x309ede['query'][_0x5607('0x1b')]);}_0x5932ae['order']=qs[_0x5607('0x35')](_0x309ede[_0x5607('0x2f')][_0x5607('0x35')]);_0x5932ae['where']=qs['filters'](_['pick'](_0x309ede[_0x5607('0x2f')],_0x12f58f[_0x5607('0x30')]),_0xe8788);if(_0x309ede[_0x5607('0x2f')][_0x5607('0x36')]){_0x5932ae[_0x5607('0x37')]=_[_0x5607('0x38')](_0x5932ae[_0x5607('0x37')],{'$or':_[_0x5607('0x29')](_0xe8788,function(_0x54cc53){if(_0x54cc53[_0x5607('0x2b')]!==_0x5607('0x39')){var _0x1671f0={};_0x1671f0[_0x54cc53[_0x5607('0x27')]]={'$like':'%'+_0x309ede['query'][_0x5607('0x36')]+'%'};return _0x1671f0;}})});}_0x5932ae=_[_0x5607('0x38')]({},_0x5932ae,_0x309ede['options']);var _0x4a5cef={'where':_0x5932ae[_0x5607('0x37')]};return db[_0x5607('0x2a')][_0x5607('0x1e')](_0x4a5cef)['then'](function(_0x562fa6){_0x40f20e['count']=_0x562fa6;if(_0x309ede[_0x5607('0x2f')][_0x5607('0x3a')]){_0x5932ae[_0x5607('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x5607('0x3c')](_0x5932ae);})[_0x5607('0x23')](function(_0x458e15){_0x40f20e[_0x5607('0x3d')]=_0x458e15;return _0x40f20e;})[_0x5607('0x23')](respondWithFilteredResult(_0x51b7d5,_0x5932ae))[_0x5607('0x3e')](handleError(_0x51b7d5,null));};exports[_0x5607('0x3f')]=function(_0x5058b5,_0x57be05){var _0x2b34b4={'raw':!![],'where':{'id':_0x5058b5[_0x5607('0x40')]['id']}},_0x3b8397={};_0x3b8397['model']=_[_0x5607('0x2e')](db[_0x5607('0x2a')]['rawAttributes']);_0x3b8397[_0x5607('0x2f')]=_[_0x5607('0x2e')](_0x5058b5['query']);_0x3b8397['filters']=_[_0x5607('0x31')](_0x3b8397[_0x5607('0x2d')],_0x3b8397[_0x5607('0x2f')]);_0x2b34b4['attributes']=_[_0x5607('0x31')](_0x3b8397[_0x5607('0x2d')],qs['fields'](_0x5058b5[_0x5607('0x2f')][_0x5607('0x33')]));_0x2b34b4['attributes']=_0x2b34b4[_0x5607('0x32')][_0x5607('0x41')]?_0x2b34b4[_0x5607('0x32')]:_0x3b8397['model'];if(_0x5058b5[_0x5607('0x2f')][_0x5607('0x3a')]){_0x2b34b4[_0x5607('0x3b')]=[{'all':!![]}];}_0x2b34b4=_[_0x5607('0x38')]({},_0x2b34b4,_0x5058b5[_0x5607('0x42')]);return db['Cdr'][_0x5607('0x43')](_0x2b34b4)[_0x5607('0x23')](handleEntityNotFound(_0x57be05,null))[_0x5607('0x23')](respondWithResult(_0x57be05,null))[_0x5607('0x3e')](handleError(_0x57be05,null));};exports[_0x5607('0x44')]=function(_0x51c1fc,_0x1a5483){return db['Cdr'][_0x5607('0x44')](_0x51c1fc[_0x5607('0x45')],{})[_0x5607('0x23')](respondWithResult(_0x1a5483,0xc9))[_0x5607('0x3e')](handleError(_0x1a5483,null));};exports[_0x5607('0x22')]=function(_0x416060,_0x4a904b){if(_0x416060['body']['id']){delete _0x416060['body']['id'];}return db[_0x5607('0x2a')][_0x5607('0x43')]({'where':{'id':_0x416060['params']['id']}})[_0x5607('0x23')](handleEntityNotFound(_0x4a904b,null))[_0x5607('0x23')](saveUpdates(_0x416060[_0x5607('0x45')],null))[_0x5607('0x23')](respondWithResult(_0x4a904b,null))[_0x5607('0x3e')](handleError(_0x4a904b,null));};exports[_0x5607('0x24')]=function(_0xccd4f5,_0xf554a0){return db[_0x5607('0x2a')][_0x5607('0x43')]({'where':{'id':_0xccd4f5[_0x5607('0x40')]['id']}})[_0x5607('0x23')](handleEntityNotFound(_0xf554a0,null))[_0x5607('0x23')](removeEntity(_0xf554a0,null))[_0x5607('0x3e')](handleError(_0xf554a0,null));};exports[_0x5607('0x46')]=function(_0x3edc1d,_0x2955e8){return db['Cdr'][_0x5607('0x46')]()['then'](respondWithResult(_0x2955e8,null))[_0x5607('0x3e')](handleError(_0x2955e8,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 5cb8a08..c41932f 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x16401d,_0x23b846){var _0x32dbd0=function(_0x2db0f2){while(--_0x2db0f2){_0x16401d['push'](_0x16401d['shift']());}};_0x32dbd0(++_0x23b846);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3257bb,_0x4119a2){var _0x31127d=function(_0x5b15d8){while(--_0x5b15d8){_0x3257bb['push'](_0x3257bb['shift']());}};_0x31127d(++_0x4119a2);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 2d8eaa3..f4c4b57 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 _0x4f18=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch'];(function(_0x747391,_0x1244cd){var _0x5ea224=function(_0x32d937){while(--_0x32d937){_0x747391['push'](_0x747391['shift']());}};_0x5ea224(++_0x1244cd);}(_0x4f18,0x187));var _0x84f1=function(_0x5e2491,_0x3065dd){_0x5e2491=_0x5e2491-0x0;var _0xe394a=_0x4f18[_0x5e2491];return _0xe394a;};'use strict';var _=require('lodash');var util=require(_0x84f1('0x0'));var moment=require(_0x84f1('0x1'));var BPromise=require(_0x84f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84f1('0x3'));var db=require(_0x84f1('0x4'))['db'];var utils=require(_0x84f1('0x5'));var logger=require(_0x84f1('0x6'))(_0x84f1('0x7'));var config=require(_0x84f1('0x8'));var jayson=require(_0x84f1('0x9'));var client=jayson['client'][_0x84f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3504cb,_0xe0e361,_0x8bd8dd){return new BPromise(function(_0xf1e91a,_0x2b5366){return client[_0x84f1('0xb')](_0x3504cb,_0x8bd8dd)[_0x84f1('0xc')](function(_0x1fc54a){logger[_0x84f1('0xd')]('Cdr,\x20%s,\x20%s',_0xe0e361,_0x84f1('0xe'));logger['debug'](_0x84f1('0xf'),_0xe0e361,_0x84f1('0xe'),JSON[_0x84f1('0x10')](_0x1fc54a));if(_0x1fc54a[_0x84f1('0x11')]){if(_0x1fc54a['error'][_0x84f1('0x12')]===0x1f4){logger[_0x84f1('0x11')](_0x84f1('0x13'),_0xe0e361,_0x1fc54a[_0x84f1('0x11')][_0x84f1('0x14')]);return _0x2b5366(_0x1fc54a['error'][_0x84f1('0x14')]);}logger[_0x84f1('0x11')](_0x84f1('0x13'),_0xe0e361,_0x1fc54a[_0x84f1('0x11')][_0x84f1('0x14')]);return _0xf1e91a(_0x1fc54a['error'][_0x84f1('0x14')]);}else{logger[_0x84f1('0xd')](_0x84f1('0x13'),_0xe0e361,_0x84f1('0xe'));_0xf1e91a(_0x1fc54a[_0x84f1('0x15')][_0x84f1('0x14')]);}})[_0x84f1('0x16')](function(_0x43711b){logger[_0x84f1('0x11')]('Cdr,\x20%s,\x20%s',_0xe0e361,_0x43711b);_0x2b5366(_0x43711b);});});} \ No newline at end of file +var _0x96c7=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x96c7,0xe8));var _0x796c=function(_0x2c7d37,_0x1b995c){_0x2c7d37=_0x2c7d37-0x0;var _0x4c6830=_0x96c7[_0x2c7d37];return _0x4c6830;};'use strict';var _=require(_0x796c('0x0'));var util=require('util');var moment=require(_0x796c('0x1'));var BPromise=require(_0x796c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796c('0x3'));var db=require(_0x796c('0x4'))['db'];var utils=require(_0x796c('0x5'));var logger=require('../../config/logger')(_0x796c('0x6'));var config=require(_0x796c('0x7'));var jayson=require(_0x796c('0x8'));var client=jayson['client'][_0x796c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b0ad4,_0x41332b,_0x2e29e){return new BPromise(function(_0x491a51,_0x114e2d){return client[_0x796c('0xa')](_0x5b0ad4,_0x2e29e)[_0x796c('0xb')](function(_0x3e49c5){logger[_0x796c('0xc')](_0x796c('0xd'),_0x41332b,_0x796c('0xe'));logger[_0x796c('0xf')](_0x796c('0x10'),_0x41332b,'request\x20sent',JSON[_0x796c('0x11')](_0x3e49c5));if(_0x3e49c5['error']){if(_0x3e49c5['error'][_0x796c('0x12')]===0x1f4){logger[_0x796c('0x13')](_0x796c('0xd'),_0x41332b,_0x3e49c5[_0x796c('0x13')][_0x796c('0x14')]);return _0x114e2d(_0x3e49c5['error'][_0x796c('0x14')]);}logger[_0x796c('0x13')](_0x796c('0xd'),_0x41332b,_0x3e49c5['error'][_0x796c('0x14')]);return _0x491a51(_0x3e49c5['error'][_0x796c('0x14')]);}else{logger[_0x796c('0xc')](_0x796c('0xd'),_0x41332b,_0x796c('0xe'));_0x491a51(_0x3e49c5[_0x796c('0x15')][_0x796c('0x14')]);}})['catch'](function(_0x5a27b7){logger[_0x796c('0x13')](_0x796c('0xd'),_0x41332b,_0x5a27b7);_0x114e2d(_0x5a27b7);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3de15be..51a2d89 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +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(_0xbd4254,_0x31c08b){var _0x46c0f3=function(_0xd0dce7){while(--_0xd0dce7){_0xbd4254['push'](_0xbd4254['shift']());}};_0x46c0f3(++_0x31c08b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 54e7f18..a2bbce2 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 _0x1a9b=['STRING','noop','TEXT','INTEGER'];(function(_0xe09d0,_0x1e55d0){var _0x44ad05=function(_0x5095b0){while(--_0x5095b0){_0xe09d0['push'](_0xe09d0['shift']());}};_0x44ad05(++_0x1e55d0);}(_0x1a9b,0x1c3));var _0xb1a9=function(_0xc775ea,_0x5e5895){_0xc775ea=_0xc775ea-0x0;var _0x5b5e4b=_0x1a9b[_0xc775ea];return _0x5b5e4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb1a9('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb1a9('0x1')],'allowNull':![],'defaultValue':_0xb1a9('0x2')},'appdata':{'type':Sequelize[_0xb1a9('0x3')]()},'description':{'type':Sequelize[_0xb1a9('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x62a2=['STRING','TEXT','sequelize','exports','INTEGER'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x62a2,0x13d));var _0x262a=function(_0x301b64,_0x19a3f0){_0x301b64=_0x301b64-0x0;var _0x2b30ca=_0x62a2[_0x301b64];return _0x2b30ca;};'use strict';var Sequelize=require(_0x262a('0x0'));module[_0x262a('0x1')]={'priority':{'type':Sequelize[_0x262a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x262a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x262a('0x4')]()},'description':{'type':Sequelize[_0x262a('0x3')]},'interval':{'type':Sequelize[_0x262a('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index f9edead..1cb538c 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 _0x80ed=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','name','send','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x33b09b,_0x4321c2){var _0x1c0901=function(_0x266f61){while(--_0x266f61){_0x33b09b['push'](_0x33b09b['shift']());}};_0x1c0901(++_0x4321c2);}(_0x80ed,0x11c));var _0xd80e=function(_0x309e3b,_0x5397fc){_0x309e3b=_0x309e3b-0x0;var _0x21351c=_0x80ed[_0x309e3b];return _0x21351c;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];function respondWithStatusCode(_0x118f53,_0x1d3fcf){_0x1d3fcf=_0x1d3fcf||0xcc;return function(_0x4fb01c){if(_0x4fb01c){return _0x118f53['sendStatus'](_0x1d3fcf);}return _0x118f53['status'](_0x1d3fcf)['end']();};}function respondWithResult(_0x145766,_0x3d233b){_0x3d233b=_0x3d233b||0xc8;return function(_0x3096ae){if(_0x3096ae){return _0x145766[_0xd80e('0x1b')](_0x3d233b)[_0xd80e('0x1c')](_0x3096ae);}};}function respondWithFilteredResult(_0x58a17e,_0x595683){return function(_0x2c8c61){if(_0x2c8c61){var _0x3124e8=typeof _0x595683[_0xd80e('0x1d')]===_0xd80e('0x1e')&&typeof _0x595683[_0xd80e('0x1f')]===_0xd80e('0x1e');var _0x22ab67=_0x2c8c61['count'];var _0x21ceec=_0x3124e8?0x0:_0x595683[_0xd80e('0x1d')];var _0x3b543d=_0x3124e8?_0x2c8c61[_0xd80e('0x20')]:_0x595683['offset']+_0x595683[_0xd80e('0x1f')];var _0x175c67;if(_0x3b543d>=_0x22ab67){_0x3b543d=_0x22ab67;_0x175c67=0xc8;}else{_0x175c67=0xce;}_0x58a17e[_0xd80e('0x1b')](_0x175c67);return _0x58a17e['set'](_0xd80e('0x21'),_0x21ceec+'-'+_0x3b543d+'/'+_0x22ab67)[_0xd80e('0x1c')](_0x2c8c61);}return null;};}function patchUpdates(_0x2765ea){return function(_0x147134){try{jsonpatch[_0xd80e('0x22')](_0x147134,_0x2765ea,!![]);}catch(_0x5509d4){return BPromise['reject'](_0x5509d4);}return _0x147134[_0xd80e('0x23')]();};}function saveUpdates(_0x3fa159,_0x3b39bf){return function(_0x2d46e7){if(_0x2d46e7){return _0x2d46e7[_0xd80e('0x24')](_0x3fa159)[_0xd80e('0x25')](function(_0x43152c){return _0x43152c;});}return null;};}function removeEntity(_0x5430b6,_0x1fbf8a){return function(_0x57d70){if(_0x57d70){return _0x57d70[_0xd80e('0x26')]()['then'](function(){_0x5430b6[_0xd80e('0x1b')](0xcc)[_0xd80e('0x27')]();});}};}function handleEntityNotFound(_0xe9bb59,_0x482779){return function(_0x521aa4){if(!_0x521aa4){_0xe9bb59['sendStatus'](0x194);}return _0x521aa4;};}function handleError(_0x31ff9d,_0x4b8291){_0x4b8291=_0x4b8291||0x1f4;return function(_0x9f9287){logger[_0xd80e('0x28')](_0x9f9287['stack']);if(_0x9f9287[_0xd80e('0x29')]){delete _0x9f9287[_0xd80e('0x29')];}_0x31ff9d[_0xd80e('0x1b')](_0x4b8291)[_0xd80e('0x2a')](_0x9f9287);};}exports['show']=function(_0x15f317,_0x1ad3bc){var _0x845451={'raw':!![],'where':{'id':_0x15f317[_0xd80e('0x2b')]['id']}},_0x39088b={};_0x39088b[_0xd80e('0x2c')]=_[_0xd80e('0x2d')](db[_0xd80e('0x2e')]['rawAttributes']);_0x39088b['query']=_[_0xd80e('0x2d')](_0x15f317[_0xd80e('0x2f')]);_0x39088b[_0xd80e('0x30')]=_[_0xd80e('0x31')](_0x39088b[_0xd80e('0x2c')],_0x39088b[_0xd80e('0x2f')]);_0x845451['attributes']=_['intersection'](_0x39088b[_0xd80e('0x2c')],qs[_0xd80e('0x32')](_0x15f317[_0xd80e('0x2f')][_0xd80e('0x32')]));_0x845451[_0xd80e('0x33')]=_0x845451[_0xd80e('0x33')][_0xd80e('0x34')]?_0x845451[_0xd80e('0x33')]:_0x39088b['model'];if(_0x15f317['query'][_0xd80e('0x35')]){_0x845451[_0xd80e('0x36')]=[{'all':!![]}];}_0x845451=_[_0xd80e('0x37')]({},_0x845451,_0x15f317[_0xd80e('0x38')]);return db[_0xd80e('0x2e')][_0xd80e('0x39')](_0x845451)[_0xd80e('0x25')](handleEntityNotFound(_0x1ad3bc,null))[_0xd80e('0x25')](respondWithResult(_0x1ad3bc,null))[_0xd80e('0x3a')](handleError(_0x1ad3bc,null));};exports[_0xd80e('0x24')]=function(_0x503dc8,_0x36efc2){if(_0x503dc8['body']['id']){delete _0x503dc8[_0xd80e('0x3b')]['id'];}return db[_0xd80e('0x2e')][_0xd80e('0x39')]({'where':{'id':_0x503dc8[_0xd80e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x36efc2,null))[_0xd80e('0x25')](saveUpdates(_0x503dc8['body'],null))[_0xd80e('0x25')](respondWithResult(_0x36efc2,null))['catch'](handleError(_0x36efc2,null));};exports[_0xd80e('0x26')]=function(_0x3da220,_0x4b7f32){return db[_0xd80e('0x2e')][_0xd80e('0x39')]({'where':{'id':_0x3da220[_0xd80e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4b7f32,null))[_0xd80e('0x25')](removeEntity(_0x4b7f32,null))[_0xd80e('0x3a')](handleError(_0x4b7f32,null));}; \ No newline at end of file +var _0xce3a=['../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x28243a,_0x4b90be){var _0x210e51=function(_0xb857e9){while(--_0xb857e9){_0x28243a['push'](_0x28243a['shift']());}};_0x210e51(++_0x4b90be);}(_0xce3a,0x194));var _0xace3=function(_0xc659ec,_0x33b9b1){_0xc659ec=_0xc659ec-0x0;var _0x15a1bb=_0xce3a[_0xc659ec];return _0x15a1bb;};'use strict';var emlformat=require(_0xace3('0x0'));var rimraf=require(_0xace3('0x1'));var zipdir=require(_0xace3('0x2'));var jsonpatch=require(_0xace3('0x3'));var rp=require(_0xace3('0x4'));var moment=require(_0xace3('0x5'));var BPromise=require(_0xace3('0x6'));var Mustache=require(_0xace3('0x7'));var util=require(_0xace3('0x8'));var path=require(_0xace3('0x9'));var sox=require(_0xace3('0xa'));var csv=require(_0xace3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xace3('0xc'));var _=require(_0xace3('0xd'));var squel=require(_0xace3('0xe'));var crypto=require(_0xace3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xace3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xace3('0x11'));var Papa=require(_0xace3('0x12'));var Redis=require(_0xace3('0x13'));var authService=require(_0xace3('0x14'));var qs=require(_0xace3('0x15'));var as=require(_0xace3('0x16'));var hardwareService=require(_0xace3('0x17'));var logger=require(_0xace3('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be1f1,_0x3566ad){_0x3566ad=_0x3566ad||0xcc;return function(_0x5ac505){if(_0x5ac505){return _0x4be1f1[_0xace3('0x1a')](_0x3566ad);}return _0x4be1f1['status'](_0x3566ad)[_0xace3('0x1b')]();};}function respondWithResult(_0x19dc11,_0x16ef3e){_0x16ef3e=_0x16ef3e||0xc8;return function(_0x5983b9){if(_0x5983b9){return _0x19dc11[_0xace3('0x1c')](_0x16ef3e)[_0xace3('0x1d')](_0x5983b9);}};}function respondWithFilteredResult(_0x1cfa39,_0x54ec35){return function(_0x51ed6c){if(_0x51ed6c){var _0x1ad5c0=typeof _0x54ec35[_0xace3('0x1e')]===_0xace3('0x1f')&&typeof _0x54ec35[_0xace3('0x20')]==='undefined';var _0x3debc2=_0x51ed6c[_0xace3('0x21')];var _0x39536d=_0x1ad5c0?0x0:_0x54ec35[_0xace3('0x1e')];var _0x2ef370=_0x1ad5c0?_0x51ed6c[_0xace3('0x21')]:_0x54ec35['offset']+_0x54ec35['limit'];var _0x2ee18d;if(_0x2ef370>=_0x3debc2){_0x2ef370=_0x3debc2;_0x2ee18d=0xc8;}else{_0x2ee18d=0xce;}_0x1cfa39['status'](_0x2ee18d);return _0x1cfa39[_0xace3('0x22')](_0xace3('0x23'),_0x39536d+'-'+_0x2ef370+'/'+_0x3debc2)['json'](_0x51ed6c);}return null;};}function patchUpdates(_0xab91f7){return function(_0x16f406){try{jsonpatch['apply'](_0x16f406,_0xab91f7,!![]);}catch(_0x4b90c9){return BPromise['reject'](_0x4b90c9);}return _0x16f406[_0xace3('0x24')]();};}function saveUpdates(_0x1ed5fe,_0x3bbe41){return function(_0x34a7a5){if(_0x34a7a5){return _0x34a7a5[_0xace3('0x25')](_0x1ed5fe)[_0xace3('0x26')](function(_0xa9b5ed){return _0xa9b5ed;});}return null;};}function removeEntity(_0x3c0a56,_0x5a4c02){return function(_0x5980fe){if(_0x5980fe){return _0x5980fe['destroy']()['then'](function(){_0x3c0a56[_0xace3('0x1c')](0xcc)[_0xace3('0x1b')]();});}};}function handleEntityNotFound(_0x2c137d,_0xf42f4){return function(_0x4b287c){if(!_0x4b287c){_0x2c137d[_0xace3('0x1a')](0x194);}return _0x4b287c;};}function handleError(_0x3b4cb5,_0x144f86){_0x144f86=_0x144f86||0x1f4;return function(_0x32e39d){logger[_0xace3('0x27')](_0x32e39d[_0xace3('0x28')]);if(_0x32e39d[_0xace3('0x29')]){delete _0x32e39d['name'];}_0x3b4cb5[_0xace3('0x1c')](_0x144f86)[_0xace3('0x2a')](_0x32e39d);};}exports[_0xace3('0x2b')]=function(_0x3aa28a,_0x599e73){var _0x56efae={'raw':!![],'where':{'id':_0x3aa28a[_0xace3('0x2c')]['id']}},_0x3b1ad1={};_0x3b1ad1[_0xace3('0x2d')]=_[_0xace3('0x2e')](db['ChatApplication'][_0xace3('0x2f')]);_0x3b1ad1[_0xace3('0x30')]=_[_0xace3('0x2e')](_0x3aa28a[_0xace3('0x30')]);_0x3b1ad1[_0xace3('0x31')]=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],_0x3b1ad1['query']);_0x56efae['attributes']=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],qs[_0xace3('0x33')](_0x3aa28a[_0xace3('0x30')][_0xace3('0x33')]));_0x56efae[_0xace3('0x34')]=_0x56efae[_0xace3('0x34')][_0xace3('0x35')]?_0x56efae[_0xace3('0x34')]:_0x3b1ad1[_0xace3('0x2d')];if(_0x3aa28a[_0xace3('0x30')][_0xace3('0x36')]){_0x56efae[_0xace3('0x37')]=[{'all':!![]}];}_0x56efae=_[_0xace3('0x38')]({},_0x56efae,_0x3aa28a[_0xace3('0x39')]);return db[_0xace3('0x3a')]['find'](_0x56efae)[_0xace3('0x26')](handleEntityNotFound(_0x599e73,null))[_0xace3('0x26')](respondWithResult(_0x599e73,null))[_0xace3('0x3b')](handleError(_0x599e73,null));};exports[_0xace3('0x25')]=function(_0x39a447,_0xe0243b){if(_0x39a447[_0xace3('0x3c')]['id']){delete _0x39a447[_0xace3('0x3c')]['id'];}return db[_0xace3('0x3a')]['find']({'where':{'id':_0x39a447[_0xace3('0x2c')]['id']}})[_0xace3('0x26')](handleEntityNotFound(_0xe0243b,null))[_0xace3('0x26')](saveUpdates(_0x39a447[_0xace3('0x3c')],null))['then'](respondWithResult(_0xe0243b,null))['catch'](handleError(_0xe0243b,null));};exports['destroy']=function(_0x541d51,_0x181d79){return db[_0xace3('0x3a')]['find']({'where':{'id':_0x541d51[_0xace3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x181d79,null))['then'](removeEntity(_0x181d79,null))[_0xace3('0x3b')](handleError(_0x181d79,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 8cd655b..8f45e03 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 _0x6dcc=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4'];(function(_0x1da21d,_0x2cdf5e){var _0x1418a6=function(_0x5e0c18){while(--_0x5e0c18){_0x1da21d['push'](_0x1da21d['shift']());}};_0x1418a6(++_0x2cdf5e);}(_0x6dcc,0xa6));var _0xc6dc=function(_0x3569d0,_0x2def24){_0x3569d0=_0x3569d0-0x0;var _0xe3d161=_0x6dcc[_0x3569d0];return _0xe3d161;};'use strict';var _=require(_0xc6dc('0x0'));var util=require(_0xc6dc('0x1'));var logger=require(_0xc6dc('0x2'))(_0xc6dc('0x3'));var moment=require(_0xc6dc('0x4'));var BPromise=require(_0xc6dc('0x5'));var rp=require(_0xc6dc('0x6'));var fs=require('fs');var path=require(_0xc6dc('0x7'));var rimraf=require(_0xc6dc('0x8'));var config=require('../../config/environment');var attributes=require(_0xc6dc('0x9'));module[_0xc6dc('0xa')]=function(_0x4abca8,_0x33c249){return _0x4abca8['define'](_0xc6dc('0xb'),attributes,{'tableName':_0xc6dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6dc('0xd'),'collate':_0xc6dc('0xe')});}; \ No newline at end of file +var _0xa3d4=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x5ba887,_0x331d3d){var _0x66d887=function(_0x30b14d){while(--_0x30b14d){_0x5ba887['push'](_0x5ba887['shift']());}};_0x66d887(++_0x331d3d);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa3d4[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x4a3d('0x0'));var logger=require(_0x4a3d('0x1'))(_0x4a3d('0x2'));var moment=require('moment');var BPromise=require(_0x4a3d('0x3'));var rp=require(_0x4a3d('0x4'));var fs=require('fs');var path=require(_0x4a3d('0x5'));var rimraf=require(_0x4a3d('0x6'));var config=require(_0x4a3d('0x7'));var attributes=require(_0x4a3d('0x8'));module[_0x4a3d('0x9')]=function(_0x5bb9d0,_0x486c9b){return _0x5bb9d0[_0x4a3d('0xa')](_0x4a3d('0xb'),attributes,{'tableName':_0x4a3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a3d('0xd'),'collate':_0x4a3d('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index fafb595..f134cbe 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 _0x0911=['util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x49d5a6,_0x3a1f12){var _0x56d4fa=function(_0x1faeb8){while(--_0x1faeb8){_0x49d5a6['push'](_0x49d5a6['shift']());}};_0x56d4fa(++_0x3a1f12);}(_0x0911,0x1b8));var _0x1091=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0911[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x1091('0x0'));var util=require(_0x1091('0x1'));var moment=require('moment');var BPromise=require(_0x1091('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1091('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1091('0x4'));var logger=require(_0x1091('0x5'))(_0x1091('0x6'));var config=require(_0x1091('0x7'));var jayson=require(_0x1091('0x8'));var client=jayson[_0x1091('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526c0e,_0x193e63,_0x1a4d12){return new BPromise(function(_0x2ddfc4,_0x29f3a7){return client[_0x1091('0xa')](_0x526c0e,_0x1a4d12)[_0x1091('0xb')](function(_0x141301){logger[_0x1091('0xc')](_0x1091('0xd'),_0x193e63,'request\x20sent');logger[_0x1091('0xe')](_0x1091('0xf'),_0x193e63,_0x1091('0x10'),JSON[_0x1091('0x11')](_0x141301));if(_0x141301[_0x1091('0x12')]){if(_0x141301[_0x1091('0x12')]['code']===0x1f4){logger[_0x1091('0x12')](_0x1091('0xd'),_0x193e63,_0x141301[_0x1091('0x12')][_0x1091('0x13')]);return _0x29f3a7(_0x141301[_0x1091('0x12')][_0x1091('0x13')]);}logger['error'](_0x1091('0xd'),_0x193e63,_0x141301[_0x1091('0x12')]['message']);return _0x2ddfc4(_0x141301[_0x1091('0x12')][_0x1091('0x13')]);}else{logger[_0x1091('0xc')](_0x1091('0xd'),_0x193e63,_0x1091('0x10'));_0x2ddfc4(_0x141301['result'][_0x1091('0x13')]);}})[_0x1091('0x14')](function(_0x122d67){logger[_0x1091('0x12')]('ChatApplication,\x20%s,\x20%s',_0x193e63,_0x122d67);_0x29f3a7(_0x122d67);});});} \ No newline at end of file +var _0x9c81=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c81,0x112));var _0x19c8=function(_0x37dc98,_0x5ad75a){_0x37dc98=_0x37dc98-0x0;var _0x2dc963=_0x9c81[_0x37dc98];return _0x2dc963;};'use strict';var _=require(_0x19c8('0x0'));var util=require(_0x19c8('0x1'));var moment=require(_0x19c8('0x2'));var BPromise=require(_0x19c8('0x3'));var rs=require(_0x19c8('0x4'));var fs=require('fs');var Redis=require(_0x19c8('0x5'));var db=require(_0x19c8('0x6'))['db'];var utils=require(_0x19c8('0x7'));var logger=require(_0x19c8('0x8'))('rpc');var config=require(_0x19c8('0x9'));var jayson=require(_0x19c8('0xa'));var client=jayson[_0x19c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f14db,_0x297f7d,_0x2f125d){return new BPromise(function(_0x277db5,_0x314d35){return client[_0x19c8('0xc')](_0x2f14db,_0x2f125d)[_0x19c8('0xd')](function(_0x132dcb){logger[_0x19c8('0xe')](_0x19c8('0xf'),_0x297f7d,'request\x20sent');logger[_0x19c8('0x10')](_0x19c8('0x11'),_0x297f7d,'request\x20sent',JSON[_0x19c8('0x12')](_0x132dcb));if(_0x132dcb[_0x19c8('0x13')]){if(_0x132dcb['error'][_0x19c8('0x14')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x297f7d,_0x132dcb['error'][_0x19c8('0x15')]);return _0x314d35(_0x132dcb[_0x19c8('0x13')][_0x19c8('0x15')]);}logger[_0x19c8('0x13')](_0x19c8('0xf'),_0x297f7d,_0x132dcb[_0x19c8('0x13')][_0x19c8('0x15')]);return _0x277db5(_0x132dcb[_0x19c8('0x13')][_0x19c8('0x15')]);}else{logger[_0x19c8('0xe')](_0x19c8('0xf'),_0x297f7d,_0x19c8('0x16'));_0x277db5(_0x132dcb[_0x19c8('0x17')][_0x19c8('0x15')]);}})[_0x19c8('0x18')](function(_0x5ea467){logger[_0x19c8('0x13')](_0x19c8('0xf'),_0x297f7d,_0x5ea467);_0x314d35(_0x5ea467);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c74623d..f898bf4 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 _0x93a7=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x34a434,_0x19fb02){var _0x5ca262=function(_0x5ccd59){while(--_0x5ccd59){_0x34a434['push'](_0x34a434['shift']());}};_0x5ca262(++_0x19fb02);}(_0x93a7,0x1d1));var _0x793a=function(_0x599776,_0x2e740f){_0x599776=_0x599776-0x0;var _0x3db1cc=_0x93a7[_0x599776];return _0x3db1cc;};'use strict';var multer=require(_0x793a('0x0'));var util=require('util');var path=require(_0x793a('0x1'));var timeout=require(_0x793a('0x2'));var express=require(_0x793a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x793a('0x4'));var interaction=require(_0x793a('0x5'));var config=require(_0x793a('0x6'));var controller=require(_0x793a('0x7'));router[_0x793a('0x8')]('/:id',auth[_0x793a('0x9')](),controller['show']);router[_0x793a('0xa')](_0x793a('0xb'),auth[_0x793a('0x9')](),controller[_0x793a('0xc')]);router[_0x793a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x793a('0xe')]);module[_0x793a('0xf')]=router; \ No newline at end of file +var _0xe254=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x18175b,_0x4d7376){var _0x210d45=function(_0x24f924){while(--_0x24f924){_0x18175b['push'](_0x18175b['shift']());}};_0x210d45(++_0x4d7376);}(_0xe254,0xa7));var _0x4e25=function(_0x4583cb,_0x4fff10){_0x4583cb=_0x4583cb-0x0;var _0x204e0c=_0xe254[_0x4583cb];return _0x204e0c;};'use strict';var multer=require(_0x4e25('0x0'));var util=require(_0x4e25('0x1'));var path=require(_0x4e25('0x2'));var timeout=require(_0x4e25('0x3'));var express=require(_0x4e25('0x4'));var router=express[_0x4e25('0x5')]();var fs_extra=require(_0x4e25('0x6'));var auth=require(_0x4e25('0x7'));var interaction=require(_0x4e25('0x8'));var config=require(_0x4e25('0x9'));var controller=require(_0x4e25('0xa'));router[_0x4e25('0xb')](_0x4e25('0xc'),auth[_0x4e25('0xd')](),controller[_0x4e25('0xe')]);router[_0x4e25('0xf')](_0x4e25('0xc'),auth[_0x4e25('0xd')](),controller[_0x4e25('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4e25('0x11')]);module[_0x4e25('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6f11f2c..3d3220b 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 _0xfe8f=['BOOLEAN','STRING'];(function(_0x43412a,_0x5cb519){var _0xc0e6aa=function(_0x3de05b){while(--_0x3de05b){_0x43412a['push'](_0x43412a['shift']());}};_0xc0e6aa(++_0x5cb519);}(_0xfe8f,0xdb));var _0xffe8=function(_0x147813,_0x4239d2){_0x147813=_0x147813-0x0;var _0x56648f=_0xfe8f[_0x147813];return _0x56648f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xffe8('0x0')]},'write':{'type':Sequelize[_0xffe8('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x04e7=['exports','STRING','sequelize'];(function(_0x5815cc,_0x22ac53){var _0x6a8e=function(_0x2ceec6){while(--_0x2ceec6){_0x5815cc['push'](_0x5815cc['shift']());}};_0x6a8e(++_0x22ac53);}(_0x04e7,0x1ca));var _0x704e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x04e7[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x704e('0x0'));module[_0x704e('0x1')]={'name':{'type':Sequelize[_0x704e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x704e('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 2b8da3a..c833aa0 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 _0x9bff=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','length','includeAll','find','body','describe','getUnread','user','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','create','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x3df1e9,_0x3cd30e){var _0xd6b371=function(_0x4b5457){while(--_0x4b5457){_0x3df1e9['push'](_0x3df1e9['shift']());}};_0xd6b371(++_0x3cd30e);}(_0x9bff,0xf3));var _0xf9bf=function(_0x2aca66,_0x2cf8d6){_0x2aca66=_0x2aca66-0x0;var _0x569919=_0x9bff[_0x2aca66];return _0x569919;};'use strict';var emlformat=require(_0xf9bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9bf('0x2'));var moment=require(_0xf9bf('0x3'));var BPromise=require(_0xf9bf('0x4'));var Mustache=require(_0xf9bf('0x5'));var util=require('util');var path=require(_0xf9bf('0x6'));var sox=require(_0xf9bf('0x7'));var csv=require(_0xf9bf('0x8'));var ejs=require(_0xf9bf('0x9'));var fs=require('fs');var fs_extra=require(_0xf9bf('0xa'));var _=require(_0xf9bf('0xb'));var squel=require('squel');var crypto=require(_0xf9bf('0xc'));var jsforce=require(_0xf9bf('0xd'));var deskjs=require(_0xf9bf('0xe'));var toCsv=require(_0xf9bf('0x8'));var querystring=require('querystring');var Papa=require(_0xf9bf('0xf'));var Redis=require(_0xf9bf('0x10'));var authService=require(_0xf9bf('0x11'));var qs=require(_0xf9bf('0x12'));var as=require(_0xf9bf('0x13'));var hardwareService=require(_0xf9bf('0x14'));var logger=require(_0xf9bf('0x15'))(_0xf9bf('0x16'));var utils=require(_0xf9bf('0x17'));var config=require(_0xf9bf('0x18'));var licenseUtil=require(_0xf9bf('0x19'));var db=require(_0xf9bf('0x1a'))['db'];config[_0xf9bf('0x1b')]=_[_0xf9bf('0x1c')](config[_0xf9bf('0x1b')],{'host':_0xf9bf('0x1d'),'port':0x18eb});var socket=require(_0xf9bf('0x1e'))(new Redis(config[_0xf9bf('0x1b')]));require('./chatGroup.socket')[_0xf9bf('0x1f')](socket);function respondWithStatusCode(_0x4847b1,_0x19f7ab){_0x19f7ab=_0x19f7ab||0xcc;return function(_0x3000b6){if(_0x3000b6){return _0x4847b1[_0xf9bf('0x20')](_0x19f7ab);}return _0x4847b1[_0xf9bf('0x21')](_0x19f7ab)[_0xf9bf('0x22')]();};}function respondWithResult(_0x4fa35a,_0x1dbb45){_0x1dbb45=_0x1dbb45||0xc8;return function(_0x360c06){if(_0x360c06){return _0x4fa35a[_0xf9bf('0x21')](_0x1dbb45)[_0xf9bf('0x23')](_0x360c06);}};}function respondWithFilteredResult(_0x304a07,_0x128997){return function(_0x2167f9){if(_0x2167f9){var _0x56ed29=typeof _0x128997[_0xf9bf('0x24')]===_0xf9bf('0x25')&&typeof _0x128997[_0xf9bf('0x26')]===_0xf9bf('0x25');var _0x210aff=_0x2167f9[_0xf9bf('0x27')];var _0x42f558=_0x56ed29?0x0:_0x128997[_0xf9bf('0x24')];var _0x5c55fb=_0x56ed29?_0x2167f9[_0xf9bf('0x27')]:_0x128997[_0xf9bf('0x24')]+_0x128997['limit'];var _0xca782c;if(_0x5c55fb>=_0x210aff){_0x5c55fb=_0x210aff;_0xca782c=0xc8;}else{_0xca782c=0xce;}_0x304a07[_0xf9bf('0x21')](_0xca782c);return _0x304a07[_0xf9bf('0x28')](_0xf9bf('0x29'),_0x42f558+'-'+_0x5c55fb+'/'+_0x210aff)[_0xf9bf('0x23')](_0x2167f9);}return null;};}function patchUpdates(_0x3f4d2b){return function(_0x439891){try{jsonpatch[_0xf9bf('0x2a')](_0x439891,_0x3f4d2b,!![]);}catch(_0x41edcc){return BPromise[_0xf9bf('0x2b')](_0x41edcc);}return _0x439891[_0xf9bf('0x2c')]();};}function saveUpdates(_0x1cde77,_0x1761b3){return function(_0x4f1441){if(_0x4f1441){return _0x4f1441[_0xf9bf('0x2d')](_0x1cde77)['then'](function(_0x1054e6){return _0x1054e6;});}return null;};}function removeEntity(_0x2de5b6,_0x58fc49){return function(_0xbdac47){if(_0xbdac47){return _0xbdac47[_0xf9bf('0x2e')]()[_0xf9bf('0x2f')](function(){_0x2de5b6[_0xf9bf('0x21')](0xcc)[_0xf9bf('0x22')]();});}};}function handleEntityNotFound(_0x6e429f,_0x3f8312){return function(_0x4bdb47){if(!_0x4bdb47){_0x6e429f['sendStatus'](0x194);}return _0x4bdb47;};}function handleError(_0x42141b,_0x2bc01c){_0x2bc01c=_0x2bc01c||0x1f4;return function(_0x15b1d6){logger[_0xf9bf('0x30')](_0x15b1d6['stack']);if(_0x15b1d6[_0xf9bf('0x31')]){delete _0x15b1d6[_0xf9bf('0x31')];}_0x42141b[_0xf9bf('0x21')](_0x2bc01c)[_0xf9bf('0x32')](_0x15b1d6);};}exports[_0xf9bf('0x33')]=function(_0x499c7e,_0xc99246){var _0x41897c={},_0x1d51cb={},_0x2471db={'count':0x0,'rows':[]};var _0x429e96=_[_0xf9bf('0x34')](db[_0xf9bf('0x35')][_0xf9bf('0x36')],function(_0x3e18fb){return{'name':_0x3e18fb[_0xf9bf('0x37')],'type':_0x3e18fb[_0xf9bf('0x38')][_0xf9bf('0x39')]};});_0x1d51cb[_0xf9bf('0x3a')]=_['map'](_0x429e96,_0xf9bf('0x31'));_0x1d51cb[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x499c7e[_0xf9bf('0x3b')]);_0x1d51cb[_0xf9bf('0x3d')]=_[_0xf9bf('0x3e')](_0x1d51cb[_0xf9bf('0x3a')],_0x1d51cb[_0xf9bf('0x3b')]);_0x41897c[_0xf9bf('0x3f')]=_[_0xf9bf('0x3e')](_0x1d51cb['model'],qs['fields'](_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x40')]));_0x41897c[_0xf9bf('0x3f')]=_0x41897c[_0xf9bf('0x3f')]['length']?_0x41897c[_0xf9bf('0x3f')]:_0x1d51cb[_0xf9bf('0x3a')];if(!_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x41')](_0xf9bf('0x42'))){_0x41897c['limit']=qs[_0xf9bf('0x26')](_0x499c7e['query'][_0xf9bf('0x26')]);_0x41897c[_0xf9bf('0x24')]=qs[_0xf9bf('0x24')](_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x24')]);}_0x41897c[_0xf9bf('0x43')]=qs[_0xf9bf('0x44')](_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x44')]);_0x41897c[_0xf9bf('0x45')]=qs[_0xf9bf('0x3d')](_[_0xf9bf('0x46')](_0x499c7e['query'],_0x1d51cb[_0xf9bf('0x3d')]),_0x429e96);if(_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x47')]){_0x41897c[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x41897c[_0xf9bf('0x45')],{'$or':_[_0xf9bf('0x34')](_0x429e96,function(_0x1f66be){if(_0x1f66be['type']!==_0xf9bf('0x49')){var _0x57697b={};_0x57697b[_0x1f66be[_0xf9bf('0x31')]]={'$like':'%'+_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x47')]+'%'};return _0x57697b;}})});}_0x41897c=_['merge']({},_0x41897c,_0x499c7e['options']);var _0x26a95f={'where':_0x41897c[_0xf9bf('0x45')]};return db[_0xf9bf('0x35')][_0xf9bf('0x27')](_0x26a95f)['then'](function(_0x2065f3){_0x2471db[_0xf9bf('0x27')]=_0x2065f3;if(_0x499c7e[_0xf9bf('0x3b')]['includeAll']){_0x41897c[_0xf9bf('0x4a')]=[{'all':!![]}];}return db['ChatGroup'][_0xf9bf('0x4b')](_0x41897c);})[_0xf9bf('0x2f')](function(_0x37f7ec){_0x2471db['rows']=_0x37f7ec;return _0x2471db;})[_0xf9bf('0x2f')](respondWithFilteredResult(_0xc99246,_0x41897c))[_0xf9bf('0x4c')](handleError(_0xc99246,null));};exports[_0xf9bf('0x4d')]=function(_0x55010d,_0x5918b2){var _0x43e6bc={'raw':!![],'where':{'id':_0x55010d[_0xf9bf('0x4e')]['id']}},_0x26f076={};_0x26f076[_0xf9bf('0x3a')]=_[_0xf9bf('0x3c')](db[_0xf9bf('0x35')][_0xf9bf('0x36')]);_0x26f076[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x55010d[_0xf9bf('0x3b')]);_0x26f076['filters']=_[_0xf9bf('0x3e')](_0x26f076['model'],_0x26f076[_0xf9bf('0x3b')]);_0x43e6bc['attributes']=_[_0xf9bf('0x3e')](_0x26f076['model'],qs['fields'](_0x55010d[_0xf9bf('0x3b')][_0xf9bf('0x40')]));_0x43e6bc['attributes']=_0x43e6bc[_0xf9bf('0x3f')][_0xf9bf('0x4f')]?_0x43e6bc['attributes']:_0x26f076[_0xf9bf('0x3a')];if(_0x55010d[_0xf9bf('0x3b')][_0xf9bf('0x50')]){_0x43e6bc[_0xf9bf('0x4a')]=[{'all':!![]}];}_0x43e6bc=_[_0xf9bf('0x48')]({},_0x43e6bc,_0x55010d['options']);return db[_0xf9bf('0x35')][_0xf9bf('0x51')](_0x43e6bc)['then'](handleEntityNotFound(_0x5918b2,null))['then'](respondWithResult(_0x5918b2,null))[_0xf9bf('0x4c')](handleError(_0x5918b2,null));};exports['create']=function(_0x42a22e,_0x45450d){return db['ChatGroup']['create'](_0x42a22e[_0xf9bf('0x52')],{})[_0xf9bf('0x2f')](respondWithResult(_0x45450d,0xc9))[_0xf9bf('0x4c')](handleError(_0x45450d,null));};exports[_0xf9bf('0x2d')]=function(_0x445d1c,_0xf697ad){if(_0x445d1c[_0xf9bf('0x52')]['id']){delete _0x445d1c['body']['id'];}return db['ChatGroup'][_0xf9bf('0x51')]({'where':{'id':_0x445d1c[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0xf697ad,null))[_0xf9bf('0x2f')](saveUpdates(_0x445d1c[_0xf9bf('0x52')],null))[_0xf9bf('0x2f')](respondWithResult(_0xf697ad,null))[_0xf9bf('0x4c')](handleError(_0xf697ad,null));};exports[_0xf9bf('0x2e')]=function(_0x1c4412,_0xf74fe4){return db['ChatGroup']['find']({'where':{'id':_0x1c4412[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0xf74fe4,null))[_0xf9bf('0x2f')](removeEntity(_0xf74fe4,null))[_0xf9bf('0x4c')](handleError(_0xf74fe4,null));};exports[_0xf9bf('0x53')]=function(_0x4f0333,_0x1fc492){return db[_0xf9bf('0x35')][_0xf9bf('0x53')]()[_0xf9bf('0x2f')](respondWithResult(_0x1fc492,null))[_0xf9bf('0x4c')](handleError(_0x1fc492,null));};exports[_0xf9bf('0x54')]=function(_0x336120,_0x36890b,_0x1a63ee){return db['ChatInternalMessage'][_0xf9bf('0x27')]({'where':{'ChatGroupId':_0x336120['params']['id'],'ToId':_0x336120[_0xf9bf('0x55')]['id'],'read':![]}})[_0xf9bf('0x2f')](function(_0x1fba9b){return{'id':_['toInteger'](_0x336120['params']['id']),'count':_0x1fba9b};})['then'](respondWithResult(_0x36890b,null))[_0xf9bf('0x4c')](handleError(_0x36890b,null));};exports[_0xf9bf('0x56')]=function(_0x29559b,_0x544b1,_0x2f652f){return db[_0xf9bf('0x35')][_0xf9bf('0x51')]({'where':{'id':_0x29559b[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x544b1,null))[_0xf9bf('0x2f')](function(_0x15968b){if(_0x15968b){return _0x15968b[_0xf9bf('0x56')](_0x29559b[_0xf9bf('0x52')][_0xf9bf('0x57')],_[_0xf9bf('0x58')](_0x29559b[_0xf9bf('0x52')],['ids','id'])||{});}})[_0xf9bf('0x2f')](respondWithResult(_0x544b1,null))[_0xf9bf('0x4c')](handleError(_0x544b1,null));};exports[_0xf9bf('0x59')]=function(_0x4c8e08,_0x173a26,_0x2b5335){var _0x339e93={};var _0x270357={};var _0x2c10a8;var _0x19d323;return db[_0xf9bf('0x35')]['findOne']({'where':{'id':_0x4c8e08[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x173a26,null))['then'](function(_0x3760c3){if(_0x3760c3){_0x2c10a8=_0x3760c3;_0x270357[_0xf9bf('0x3a')]=_[_0xf9bf('0x3c')](db['User']['rawAttributes']);_0x270357[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x4c8e08[_0xf9bf('0x3b')]);_0x270357['filters']=_[_0xf9bf('0x3e')](_0x270357[_0xf9bf('0x3a')],_0x270357['query']);_0x339e93[_0xf9bf('0x3f')]=_[_0xf9bf('0x3e')](_0x270357[_0xf9bf('0x3a')],qs[_0xf9bf('0x40')](_0x4c8e08[_0xf9bf('0x3b')]['fields']));_0x339e93['attributes']=_0x339e93[_0xf9bf('0x3f')][_0xf9bf('0x4f')]?_0x339e93[_0xf9bf('0x3f')]:_0x270357['model'];_0x339e93[_0xf9bf('0x43')]=qs[_0xf9bf('0x44')](_0x4c8e08['query'][_0xf9bf('0x44')]);_0x339e93[_0xf9bf('0x45')]=qs[_0xf9bf('0x3d')](_[_0xf9bf('0x46')](_0x4c8e08[_0xf9bf('0x3b')],_0x270357[_0xf9bf('0x3d')]));if(_0x4c8e08['query'][_0xf9bf('0x47')]){_0x339e93[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x339e93[_0xf9bf('0x45')],{'$or':_[_0xf9bf('0x34')](_0x339e93[_0xf9bf('0x3f')],function(_0x5c77f7){var _0x2d22c0={};_0x2d22c0[_0x5c77f7]={'$like':'%'+_0x4c8e08[_0xf9bf('0x3b')][_0xf9bf('0x47')]+'%'};return _0x2d22c0;})});}_0x339e93=_[_0xf9bf('0x48')]({},_0x339e93,_0x4c8e08['options']);return _0x2c10a8[_0xf9bf('0x59')](_0x339e93);}})[_0xf9bf('0x2f')](function(_0x6ef2e1){if(_0x6ef2e1){_0x19d323=_0x6ef2e1[_0xf9bf('0x4f')];if(!_0x4c8e08[_0xf9bf('0x3b')]['hasOwnProperty'](_0xf9bf('0x42'))){_0x339e93[_0xf9bf('0x26')]=qs[_0xf9bf('0x26')](_0x4c8e08['query'][_0xf9bf('0x26')]);_0x339e93[_0xf9bf('0x24')]=qs[_0xf9bf('0x24')](_0x4c8e08[_0xf9bf('0x3b')]['offset']);}return _0x2c10a8[_0xf9bf('0x59')](_0x339e93);}})[_0xf9bf('0x2f')](function(_0xc0bf71){if(_0xc0bf71){return _0xc0bf71?{'count':_0x19d323,'rows':_0xc0bf71}:null;}})[_0xf9bf('0x2f')](respondWithResult(_0x173a26,null))[_0xf9bf('0x4c')](handleError(_0x173a26,null));};exports[_0xf9bf('0x5a')]=function(_0x287592,_0x9ed10d,_0x14ee8b){return db['ChatGroup'][_0xf9bf('0x51')]({'where':{'id':_0x287592[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x9ed10d,null))['then'](function(_0x53e87c){if(_0x53e87c){return _0x53e87c['removeMembers'](_0x287592['query'][_0xf9bf('0x57')]);}})['then'](respondWithStatusCode(_0x9ed10d,null))[_0xf9bf('0x4c')](handleError(_0x9ed10d,null));};exports[_0xf9bf('0x5b')]=function(_0xc3358e,_0x132077,_0x4804ee){if(_0xc3358e['body']['id']){delete _0xc3358e[_0xf9bf('0x52')]['id'];}return db[_0xf9bf('0x35')][_0xf9bf('0x51')]({'where':{'id':_0xc3358e[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x132077,null))[_0xf9bf('0x2f')](function(_0x2e8761){if(_0x2e8761){_0xc3358e[_0xf9bf('0x52')][_0xf9bf('0x5c')]=_0x2e8761['id'];return db[_0xf9bf('0x5d')][_0xf9bf('0x5e')](_0xc3358e[_0xf9bf('0x52')]);}})['then'](respondWithResult(_0x132077,null))[_0xf9bf('0x4c')](handleError(_0x132077,null));};exports[_0xf9bf('0x5f')]=function(_0x36d4f7,_0x3a30ed,_0x196cfd){var _0x26816e={};var _0x2d8418={};var _0x373803;var _0x264ada;return db[_0xf9bf('0x35')][_0xf9bf('0x60')]({'where':{'id':_0x36d4f7['params']['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x3a30ed,null))['then'](function(_0x5d1b51){if(_0x5d1b51){_0x373803=_0x5d1b51;_0x2d8418['model']=_[_0xf9bf('0x3c')](db['ChatInternalMessage']['rawAttributes']);_0x2d8418[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x36d4f7[_0xf9bf('0x3b')]);_0x2d8418[_0xf9bf('0x3d')]=_['intersection'](_0x2d8418[_0xf9bf('0x3a')],_0x2d8418[_0xf9bf('0x3b')]);_0x26816e[_0xf9bf('0x3f')]=_[_0xf9bf('0x3e')](_0x2d8418[_0xf9bf('0x3a')],qs[_0xf9bf('0x40')](_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x40')]));_0x26816e['attributes']=_0x26816e[_0xf9bf('0x3f')][_0xf9bf('0x4f')]?_0x26816e[_0xf9bf('0x3f')]:_0x2d8418['model'];_0x26816e['order']=qs[_0xf9bf('0x44')](_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x44')]);_0x26816e[_0xf9bf('0x45')]=qs[_0xf9bf('0x3d')](_[_0xf9bf('0x46')](_0x36d4f7[_0xf9bf('0x3b')],_0x2d8418[_0xf9bf('0x3d')]));if(_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x47')]){_0x26816e[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x26816e[_0xf9bf('0x45')],{'$or':_['map'](_0x26816e[_0xf9bf('0x3f')],function(_0x43c07c){var _0x22aaba={};_0x22aaba[_0x43c07c]={'$like':'%'+_0x36d4f7['query']['filter']+'%'};return _0x22aaba;})});}if(_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x61')]){var _0x54a59a=_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x61')][_0xf9bf('0x62')](',');var _0x5b38a1={};_0x5b38a1[_0x54a59a[0x0]]={'$gte':moment(_0x54a59a[0x1])[_0xf9bf('0x63')](_0xf9bf('0x64'))};_0x26816e[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x26816e[_0xf9bf('0x45')],_0x5b38a1);}_0x26816e=_[_0xf9bf('0x48')]({},_0x26816e,_0x36d4f7[_0xf9bf('0x65')]);return _0x373803[_0xf9bf('0x5f')](_0x26816e);}})[_0xf9bf('0x2f')](function(_0x5c23cd){if(_0x5c23cd){_0x264ada=_0x5c23cd[_0xf9bf('0x4f')];if(!_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x41')](_0xf9bf('0x42'))){_0x26816e[_0xf9bf('0x26')]=qs[_0xf9bf('0x26')](_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x26')]);_0x26816e[_0xf9bf('0x24')]=qs[_0xf9bf('0x24')](_0x36d4f7['query'][_0xf9bf('0x24')]);}return _0x373803['getMessages'](_0x26816e);}})[_0xf9bf('0x2f')](function(_0x341b01){if(_0x341b01){return _0x341b01?{'count':_0x264ada,'rows':_0x341b01}:null;}})[_0xf9bf('0x2f')](respondWithResult(_0x3a30ed,null))['catch'](handleError(_0x3a30ed,null));}; \ No newline at end of file +var _0xdf38=['order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','find','catch','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','create','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','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/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x23ca3a,_0xe44c43){var _0x5c1aab=function(_0x29bcdd){while(--_0x29bcdd){_0x23ca3a['push'](_0x23ca3a['shift']());}};_0x5c1aab(++_0xe44c43);}(_0xdf38,0x1a8));var _0x8df3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdf38[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x8df3('0x0'));var rimraf=require(_0x8df3('0x1'));var zipdir=require(_0x8df3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8df3('0x3'));var moment=require(_0x8df3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8df3('0x5'));var util=require(_0x8df3('0x6'));var path=require(_0x8df3('0x7'));var sox=require(_0x8df3('0x8'));var csv=require(_0x8df3('0x9'));var ejs=require(_0x8df3('0xa'));var fs=require('fs');var fs_extra=require(_0x8df3('0xb'));var _=require(_0x8df3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8df3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8df3('0xe'));var Papa=require(_0x8df3('0xf'));var Redis=require(_0x8df3('0x10'));var authService=require(_0x8df3('0x11'));var qs=require(_0x8df3('0x12'));var as=require(_0x8df3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8df3('0x14'))(_0x8df3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8df3('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8df3('0x17')](config[_0x8df3('0x18')],{'host':_0x8df3('0x19'),'port':0x18eb});var socket=require(_0x8df3('0x1a'))(new Redis(config[_0x8df3('0x18')]));require(_0x8df3('0x1b'))[_0x8df3('0x1c')](socket);function respondWithStatusCode(_0x351dc0,_0x32c4c8){_0x32c4c8=_0x32c4c8||0xcc;return function(_0x1212bf){if(_0x1212bf){return _0x351dc0[_0x8df3('0x1d')](_0x32c4c8);}return _0x351dc0['status'](_0x32c4c8)['end']();};}function respondWithResult(_0x202c90,_0x4502b7){_0x4502b7=_0x4502b7||0xc8;return function(_0x32c7ff){if(_0x32c7ff){return _0x202c90[_0x8df3('0x1e')](_0x4502b7)[_0x8df3('0x1f')](_0x32c7ff);}};}function respondWithFilteredResult(_0x5eb673,_0x3e83a3){return function(_0x245df9){if(_0x245df9){var _0x5cbada=typeof _0x3e83a3[_0x8df3('0x20')]===_0x8df3('0x21')&&typeof _0x3e83a3[_0x8df3('0x22')]===_0x8df3('0x21');var _0x4383b4=_0x245df9[_0x8df3('0x23')];var _0x169c03=_0x5cbada?0x0:_0x3e83a3[_0x8df3('0x20')];var _0x4b9dd5=_0x5cbada?_0x245df9[_0x8df3('0x23')]:_0x3e83a3['offset']+_0x3e83a3[_0x8df3('0x22')];var _0x1709f2;if(_0x4b9dd5>=_0x4383b4){_0x4b9dd5=_0x4383b4;_0x1709f2=0xc8;}else{_0x1709f2=0xce;}_0x5eb673['status'](_0x1709f2);return _0x5eb673[_0x8df3('0x24')](_0x8df3('0x25'),_0x169c03+'-'+_0x4b9dd5+'/'+_0x4383b4)[_0x8df3('0x1f')](_0x245df9);}return null;};}function patchUpdates(_0x7cfe0b){return function(_0x407620){try{jsonpatch[_0x8df3('0x26')](_0x407620,_0x7cfe0b,!![]);}catch(_0x13ccc8){return BPromise[_0x8df3('0x27')](_0x13ccc8);}return _0x407620[_0x8df3('0x28')]();};}function saveUpdates(_0x31a5e9,_0x4d9097){return function(_0x391cc8){if(_0x391cc8){return _0x391cc8[_0x8df3('0x29')](_0x31a5e9)[_0x8df3('0x2a')](function(_0xa7d8d8){return _0xa7d8d8;});}return null;};}function removeEntity(_0x41383b,_0x3ac5c5){return function(_0x4ab044){if(_0x4ab044){return _0x4ab044[_0x8df3('0x2b')]()[_0x8df3('0x2a')](function(){_0x41383b[_0x8df3('0x1e')](0xcc)[_0x8df3('0x2c')]();});}};}function handleEntityNotFound(_0x2f6aaa,_0x31638c){return function(_0x296fbf){if(!_0x296fbf){_0x2f6aaa[_0x8df3('0x1d')](0x194);}return _0x296fbf;};}function handleError(_0x4683fc,_0x2c71f9){_0x2c71f9=_0x2c71f9||0x1f4;return function(_0x3daad2){logger[_0x8df3('0x2d')](_0x3daad2[_0x8df3('0x2e')]);if(_0x3daad2[_0x8df3('0x2f')]){delete _0x3daad2['name'];}_0x4683fc[_0x8df3('0x1e')](_0x2c71f9)[_0x8df3('0x30')](_0x3daad2);};}exports[_0x8df3('0x31')]=function(_0x2f786b,_0x11d0a1){var _0x4dead0={},_0x5ec0b6={},_0x3b49d8={'count':0x0,'rows':[]};var _0x137060=_[_0x8df3('0x32')](db[_0x8df3('0x33')][_0x8df3('0x34')],function(_0xeb1e15){return{'name':_0xeb1e15[_0x8df3('0x35')],'type':_0xeb1e15[_0x8df3('0x36')][_0x8df3('0x37')]};});_0x5ec0b6[_0x8df3('0x38')]=_[_0x8df3('0x32')](_0x137060,'name');_0x5ec0b6[_0x8df3('0x39')]=_[_0x8df3('0x3a')](_0x2f786b[_0x8df3('0x39')]);_0x5ec0b6[_0x8df3('0x3b')]=_['intersection'](_0x5ec0b6['model'],_0x5ec0b6[_0x8df3('0x39')]);_0x4dead0['attributes']=_[_0x8df3('0x3c')](_0x5ec0b6[_0x8df3('0x38')],qs[_0x8df3('0x3d')](_0x2f786b[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x4dead0['attributes']=_0x4dead0[_0x8df3('0x3e')][_0x8df3('0x3f')]?_0x4dead0[_0x8df3('0x3e')]:_0x5ec0b6[_0x8df3('0x38')];if(!_0x2f786b['query'][_0x8df3('0x40')](_0x8df3('0x41'))){_0x4dead0[_0x8df3('0x22')]=qs['limit'](_0x2f786b['query']['limit']);_0x4dead0[_0x8df3('0x20')]=qs[_0x8df3('0x20')](_0x2f786b['query'][_0x8df3('0x20')]);}_0x4dead0[_0x8df3('0x42')]=qs[_0x8df3('0x43')](_0x2f786b[_0x8df3('0x39')][_0x8df3('0x43')]);_0x4dead0['where']=qs[_0x8df3('0x3b')](_[_0x8df3('0x44')](_0x2f786b[_0x8df3('0x39')],_0x5ec0b6[_0x8df3('0x3b')]),_0x137060);if(_0x2f786b[_0x8df3('0x39')]['filter']){_0x4dead0['where']=_[_0x8df3('0x45')](_0x4dead0['where'],{'$or':_[_0x8df3('0x32')](_0x137060,function(_0x88b63c){if(_0x88b63c[_0x8df3('0x36')]!==_0x8df3('0x46')){var _0x5e6d0d={};_0x5e6d0d[_0x88b63c['name']]={'$like':'%'+_0x2f786b[_0x8df3('0x39')][_0x8df3('0x47')]+'%'};return _0x5e6d0d;}})});}_0x4dead0=_['merge']({},_0x4dead0,_0x2f786b[_0x8df3('0x48')]);var _0x4561cc={'where':_0x4dead0[_0x8df3('0x49')]};return db[_0x8df3('0x33')][_0x8df3('0x23')](_0x4561cc)[_0x8df3('0x2a')](function(_0xc6d18c){_0x3b49d8[_0x8df3('0x23')]=_0xc6d18c;if(_0x2f786b[_0x8df3('0x39')][_0x8df3('0x4a')]){_0x4dead0[_0x8df3('0x4b')]=[{'all':!![]}];}return db[_0x8df3('0x33')][_0x8df3('0x4c')](_0x4dead0);})[_0x8df3('0x2a')](function(_0x4478c6){_0x3b49d8['rows']=_0x4478c6;return _0x3b49d8;})[_0x8df3('0x2a')](respondWithFilteredResult(_0x11d0a1,_0x4dead0))['catch'](handleError(_0x11d0a1,null));};exports['show']=function(_0x3a47ca,_0x5344d2){var _0x35c8c6={'raw':!![],'where':{'id':_0x3a47ca['params']['id']}},_0x1a6e1b={};_0x1a6e1b[_0x8df3('0x38')]=_['keys'](db[_0x8df3('0x33')][_0x8df3('0x34')]);_0x1a6e1b[_0x8df3('0x39')]=_[_0x8df3('0x3a')](_0x3a47ca[_0x8df3('0x39')]);_0x1a6e1b[_0x8df3('0x3b')]=_['intersection'](_0x1a6e1b[_0x8df3('0x38')],_0x1a6e1b[_0x8df3('0x39')]);_0x35c8c6[_0x8df3('0x3e')]=_[_0x8df3('0x3c')](_0x1a6e1b[_0x8df3('0x38')],qs[_0x8df3('0x3d')](_0x3a47ca[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x35c8c6[_0x8df3('0x3e')]=_0x35c8c6[_0x8df3('0x3e')]['length']?_0x35c8c6[_0x8df3('0x3e')]:_0x1a6e1b[_0x8df3('0x38')];if(_0x3a47ca[_0x8df3('0x39')][_0x8df3('0x4a')]){_0x35c8c6[_0x8df3('0x4b')]=[{'all':!![]}];}_0x35c8c6=_[_0x8df3('0x45')]({},_0x35c8c6,_0x3a47ca[_0x8df3('0x48')]);return db['ChatGroup'][_0x8df3('0x4d')](_0x35c8c6)[_0x8df3('0x2a')](handleEntityNotFound(_0x5344d2,null))[_0x8df3('0x2a')](respondWithResult(_0x5344d2,null))[_0x8df3('0x4e')](handleError(_0x5344d2,null));};exports['create']=function(_0xcfb8d5,_0x26ffcf){return db[_0x8df3('0x33')]['create'](_0xcfb8d5[_0x8df3('0x4f')],{})[_0x8df3('0x2a')](respondWithResult(_0x26ffcf,0xc9))[_0x8df3('0x4e')](handleError(_0x26ffcf,null));};exports[_0x8df3('0x29')]=function(_0x3fadc0,_0x40dd34){if(_0x3fadc0[_0x8df3('0x4f')]['id']){delete _0x3fadc0[_0x8df3('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3fadc0[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x40dd34,null))[_0x8df3('0x2a')](saveUpdates(_0x3fadc0[_0x8df3('0x4f')],null))[_0x8df3('0x2a')](respondWithResult(_0x40dd34,null))[_0x8df3('0x4e')](handleError(_0x40dd34,null));};exports[_0x8df3('0x2b')]=function(_0x5c0ace,_0x12942f){return db[_0x8df3('0x33')][_0x8df3('0x4d')]({'where':{'id':_0x5c0ace[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x12942f,null))[_0x8df3('0x2a')](removeEntity(_0x12942f,null))[_0x8df3('0x4e')](handleError(_0x12942f,null));};exports[_0x8df3('0x51')]=function(_0x4dbe0e,_0x30f288){return db[_0x8df3('0x33')]['describe']()[_0x8df3('0x2a')](respondWithResult(_0x30f288,null))[_0x8df3('0x4e')](handleError(_0x30f288,null));};exports[_0x8df3('0x52')]=function(_0x7e94bd,_0x581207,_0x41f2a7){return db[_0x8df3('0x53')][_0x8df3('0x23')]({'where':{'ChatGroupId':_0x7e94bd[_0x8df3('0x50')]['id'],'ToId':_0x7e94bd['user']['id'],'read':![]}})['then'](function(_0x655c33){return{'id':_[_0x8df3('0x54')](_0x7e94bd[_0x8df3('0x50')]['id']),'count':_0x655c33};})[_0x8df3('0x2a')](respondWithResult(_0x581207,null))[_0x8df3('0x4e')](handleError(_0x581207,null));};exports['addMembers']=function(_0x3618d3,_0xaa5928,_0x2750b2){return db['ChatGroup'][_0x8df3('0x4d')]({'where':{'id':_0x3618d3[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0xaa5928,null))[_0x8df3('0x2a')](function(_0x536d38){if(_0x536d38){return _0x536d38[_0x8df3('0x55')](_0x3618d3[_0x8df3('0x4f')][_0x8df3('0x56')],_[_0x8df3('0x57')](_0x3618d3[_0x8df3('0x4f')],[_0x8df3('0x56'),'id'])||{});}})[_0x8df3('0x2a')](respondWithResult(_0xaa5928,null))[_0x8df3('0x4e')](handleError(_0xaa5928,null));};exports['getMembers']=function(_0x1bd16e,_0x77859f,_0x1dfb32){var _0x113513={};var _0x44b29a={};var _0x3b5393;var _0x5453f9;return db['ChatGroup'][_0x8df3('0x58')]({'where':{'id':_0x1bd16e['params']['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x77859f,null))[_0x8df3('0x2a')](function(_0x31f2d9){if(_0x31f2d9){_0x3b5393=_0x31f2d9;_0x44b29a['model']=_[_0x8df3('0x3a')](db[_0x8df3('0x59')]['rawAttributes']);_0x44b29a[_0x8df3('0x39')]=_['keys'](_0x1bd16e[_0x8df3('0x39')]);_0x44b29a[_0x8df3('0x3b')]=_['intersection'](_0x44b29a[_0x8df3('0x38')],_0x44b29a[_0x8df3('0x39')]);_0x113513[_0x8df3('0x3e')]=_[_0x8df3('0x3c')](_0x44b29a['model'],qs[_0x8df3('0x3d')](_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x113513[_0x8df3('0x3e')]=_0x113513[_0x8df3('0x3e')]['length']?_0x113513[_0x8df3('0x3e')]:_0x44b29a[_0x8df3('0x38')];_0x113513['order']=qs['sort'](_0x1bd16e[_0x8df3('0x39')]['sort']);_0x113513['where']=qs[_0x8df3('0x3b')](_[_0x8df3('0x44')](_0x1bd16e[_0x8df3('0x39')],_0x44b29a[_0x8df3('0x3b')]));if(_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x47')]){_0x113513[_0x8df3('0x49')]=_['merge'](_0x113513['where'],{'$or':_['map'](_0x113513[_0x8df3('0x3e')],function(_0x52af0e){var _0x2b0b2b={};_0x2b0b2b[_0x52af0e]={'$like':'%'+_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x47')]+'%'};return _0x2b0b2b;})});}_0x113513=_[_0x8df3('0x45')]({},_0x113513,_0x1bd16e[_0x8df3('0x48')]);return _0x3b5393[_0x8df3('0x5a')](_0x113513);}})[_0x8df3('0x2a')](function(_0x1c79c5){if(_0x1c79c5){_0x5453f9=_0x1c79c5[_0x8df3('0x3f')];if(!_0x1bd16e['query']['hasOwnProperty'](_0x8df3('0x41'))){_0x113513[_0x8df3('0x22')]=qs['limit'](_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x22')]);_0x113513[_0x8df3('0x20')]=qs['offset'](_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x20')]);}return _0x3b5393[_0x8df3('0x5a')](_0x113513);}})[_0x8df3('0x2a')](function(_0x2033d9){if(_0x2033d9){return _0x2033d9?{'count':_0x5453f9,'rows':_0x2033d9}:null;}})[_0x8df3('0x2a')](respondWithResult(_0x77859f,null))[_0x8df3('0x4e')](handleError(_0x77859f,null));};exports[_0x8df3('0x5b')]=function(_0x208bfa,_0xc42ca5,_0x572e02){return db[_0x8df3('0x33')][_0x8df3('0x4d')]({'where':{'id':_0x208bfa['params']['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0xc42ca5,null))[_0x8df3('0x2a')](function(_0x44152d){if(_0x44152d){return _0x44152d[_0x8df3('0x5b')](_0x208bfa[_0x8df3('0x39')][_0x8df3('0x56')]);}})[_0x8df3('0x2a')](respondWithStatusCode(_0xc42ca5,null))[_0x8df3('0x4e')](handleError(_0xc42ca5,null));};exports['addMessage']=function(_0x16fd0f,_0x5cfc1a,_0x16e727){if(_0x16fd0f[_0x8df3('0x4f')]['id']){delete _0x16fd0f[_0x8df3('0x4f')]['id'];}return db[_0x8df3('0x33')][_0x8df3('0x4d')]({'where':{'id':_0x16fd0f[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x5cfc1a,null))[_0x8df3('0x2a')](function(_0x4d30fb){if(_0x4d30fb){_0x16fd0f[_0x8df3('0x4f')][_0x8df3('0x5c')]=_0x4d30fb['id'];return db['ChatInternalMessage'][_0x8df3('0x5d')](_0x16fd0f[_0x8df3('0x4f')]);}})['then'](respondWithResult(_0x5cfc1a,null))[_0x8df3('0x4e')](handleError(_0x5cfc1a,null));};exports[_0x8df3('0x5e')]=function(_0x18b8ed,_0x946680,_0x115407){var _0x2e2cd2={};var _0x14d04c={};var _0x4d6958;var _0x1702c6;return db['ChatGroup']['findOne']({'where':{'id':_0x18b8ed[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x946680,null))['then'](function(_0x16b19f){if(_0x16b19f){_0x4d6958=_0x16b19f;_0x14d04c[_0x8df3('0x38')]=_[_0x8df3('0x3a')](db[_0x8df3('0x53')][_0x8df3('0x34')]);_0x14d04c['query']=_['keys'](_0x18b8ed['query']);_0x14d04c['filters']=_[_0x8df3('0x3c')](_0x14d04c['model'],_0x14d04c[_0x8df3('0x39')]);_0x2e2cd2[_0x8df3('0x3e')]=_[_0x8df3('0x3c')](_0x14d04c[_0x8df3('0x38')],qs[_0x8df3('0x3d')](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x2e2cd2[_0x8df3('0x3e')]=_0x2e2cd2['attributes'][_0x8df3('0x3f')]?_0x2e2cd2['attributes']:_0x14d04c[_0x8df3('0x38')];_0x2e2cd2['order']=qs[_0x8df3('0x43')](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x43')]);_0x2e2cd2[_0x8df3('0x49')]=qs[_0x8df3('0x3b')](_[_0x8df3('0x44')](_0x18b8ed[_0x8df3('0x39')],_0x14d04c['filters']));if(_0x18b8ed[_0x8df3('0x39')]['filter']){_0x2e2cd2[_0x8df3('0x49')]=_[_0x8df3('0x45')](_0x2e2cd2[_0x8df3('0x49')],{'$or':_[_0x8df3('0x32')](_0x2e2cd2[_0x8df3('0x3e')],function(_0x392968){var _0x355eff={};_0x355eff[_0x392968]={'$like':'%'+_0x18b8ed[_0x8df3('0x39')]['filter']+'%'};return _0x355eff;})});}if(_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x5f')]){var _0x5d2992=_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x5f')][_0x8df3('0x60')](',');var _0xc544db={};_0xc544db[_0x5d2992[0x0]]={'$gte':moment(_0x5d2992[0x1])[_0x8df3('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2e2cd2[_0x8df3('0x49')]=_['merge'](_0x2e2cd2[_0x8df3('0x49')],_0xc544db);}_0x2e2cd2=_[_0x8df3('0x45')]({},_0x2e2cd2,_0x18b8ed['options']);return _0x4d6958['getMessages'](_0x2e2cd2);}})['then'](function(_0x67f8f){if(_0x67f8f){_0x1702c6=_0x67f8f['length'];if(!_0x18b8ed[_0x8df3('0x39')]['hasOwnProperty']('nolimit')){_0x2e2cd2[_0x8df3('0x22')]=qs['limit'](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x22')]);_0x2e2cd2[_0x8df3('0x20')]=qs[_0x8df3('0x20')](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x20')]);}return _0x4d6958[_0x8df3('0x5e')](_0x2e2cd2);}})[_0x8df3('0x2a')](function(_0x564f66){if(_0x564f66){return _0x564f66?{'count':_0x1702c6,'rows':_0x564f66}:null;}})[_0x8df3('0x2a')](respondWithResult(_0x946680,null))[_0x8df3('0x4e')](handleError(_0x946680,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 545ad33..4bad489 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 _0x83d4=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0xf312c4,_0x5d81ca){var _0x3b3ca1=function(_0x315c81){while(--_0x315c81){_0xf312c4['push'](_0xf312c4['shift']());}};_0x3b3ca1(++_0x5d81ca);}(_0x83d4,0xf1));var _0x483d=function(_0x13404e,_0x3a20c1){_0x13404e=_0x13404e-0x0;var _0x259fa3=_0x83d4[_0x13404e];return _0x259fa3;};'use strict';var EventEmitter=require(_0x483d('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x483d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x483d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x838b4c){return function(_0x447f73,_0x224829,_0x1e1c37){ChatGroupEvents[_0x483d('0x3')](_0x838b4c+':'+_0x447f73['id'],_0x447f73);ChatGroupEvents['emit'](_0x838b4c,_0x447f73);_0x1e1c37(null);};}for(var e in events){if(events[_0x483d('0x4')](e)){var event=events[e];ChatGroup[_0x483d('0x5')](e,emitEvent(event));}}module[_0x483d('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x9c4a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2a78c5,_0x4bd133){var _0x4c0fcb=function(_0x4441da){while(--_0x4441da){_0x2a78c5['push'](_0x2a78c5['shift']());}};_0x4c0fcb(++_0x4bd133);}(_0x9c4a,0x1dd));var _0xa9c4=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x9c4a[_0x4dc7b9];return _0x3ab114;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xa9c4('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa9c4('0x1')](0x0);var events={'afterCreate':_0xa9c4('0x2'),'afterUpdate':'update','afterDestroy':_0xa9c4('0x3')};function emitEvent(_0x58635b){return function(_0x25bba6,_0x34730e,_0x115c75){ChatGroupEvents[_0xa9c4('0x4')](_0x58635b+':'+_0x25bba6['id'],_0x25bba6);ChatGroupEvents[_0xa9c4('0x4')](_0x58635b,_0x25bba6);_0x115c75(null);};}for(var e in events){if(events[_0xa9c4('0x5')](e)){var event=events[e];ChatGroup[_0xa9c4('0x6')](e,emitEvent(event));}}module[_0xa9c4('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0db81ec..2295d85 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 _0x2919=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x28d79e,_0x55bf08){var _0x54337=function(_0x59b8b4){while(--_0x59b8b4){_0x28d79e['push'](_0x28d79e['shift']());}};_0x54337(++_0x55bf08);}(_0x2919,0x71));var _0x9291=function(_0x252991,_0x498d8a){_0x252991=_0x252991-0x0;var _0x2c4d9b=_0x2919[_0x252991];return _0x2c4d9b;};'use strict';var _=require('lodash');var util=require(_0x9291('0x0'));var logger=require(_0x9291('0x1'))('api');var moment=require(_0x9291('0x2'));var BPromise=require('bluebird');var rp=require(_0x9291('0x3'));var fs=require('fs');var path=require(_0x9291('0x4'));var rimraf=require(_0x9291('0x5'));var config=require(_0x9291('0x6'));var attributes=require(_0x9291('0x7'));module[_0x9291('0x8')]=function(_0x5426fd,_0x4d92af){return _0x5426fd[_0x9291('0x9')](_0x9291('0xa'),attributes,{'tableName':_0x9291('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ec0=['../../config/logger','api','moment','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0x1b3287,_0x15c015){var _0x10b1bc=function(_0x104798){while(--_0x104798){_0x1b3287['push'](_0x1b3287['shift']());}};_0x10b1bc(++_0x15c015);}(_0x4ec0,0x1d8));var _0x04ec=function(_0x5171e0,_0x52c013){_0x5171e0=_0x5171e0-0x0;var _0x5da691=_0x4ec0[_0x5171e0];return _0x5da691;};'use strict';var _=require(_0x04ec('0x0'));var util=require('util');var logger=require(_0x04ec('0x1'))(_0x04ec('0x2'));var moment=require(_0x04ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x04ec('0x4'));var fs=require('fs');var path=require(_0x04ec('0x5'));var rimraf=require('rimraf');var config=require(_0x04ec('0x6'));var attributes=require(_0x04ec('0x7'));module[_0x04ec('0x8')]=function(_0x2d4dcf,_0x542c42){return _0x2d4dcf[_0x04ec('0x9')]('ChatGroup',attributes,{'tableName':_0x04ec('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 32f0158..31d02a5 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 _0x7f42=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x2aa23c,_0x10a438){var _0x2ce3a5=function(_0xfc2baa){while(--_0xfc2baa){_0x2aa23c['push'](_0x2aa23c['shift']());}};_0x2ce3a5(++_0x10a438);}(_0x7f42,0x1dd));var _0x27f4=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7f42[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var moment=require(_0x27f4('0x1'));var BPromise=require(_0x27f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27f4('0x4'));var logger=require('../../config/logger')(_0x27f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x27f4('0x6'));var client=jayson['client'][_0x27f4('0x7')]({'port':0x232a});config[_0x27f4('0x8')]=_[_0x27f4('0x9')](config[_0x27f4('0x8')],{'host':_0x27f4('0xa'),'port':0x18eb});var socket=require(_0x27f4('0xb'))(new Redis(config[_0x27f4('0x8')]));require(_0x27f4('0xc'))[_0x27f4('0xd')](socket);function respondWithRpcPromise(_0x453565,_0x3bbb54,_0x21eab6){return new BPromise(function(_0x2fc74a,_0x247c47){return client[_0x27f4('0xe')](_0x453565,_0x21eab6)[_0x27f4('0xf')](function(_0x1ddc75){logger[_0x27f4('0x10')]('ChatGroup,\x20%s,\x20%s',_0x3bbb54,'request\x20sent');logger[_0x27f4('0x11')](_0x27f4('0x12'),_0x3bbb54,_0x27f4('0x13'),JSON[_0x27f4('0x14')](_0x1ddc75));if(_0x1ddc75[_0x27f4('0x15')]){if(_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x16')]===0x1f4){logger[_0x27f4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3bbb54,_0x1ddc75['error'][_0x27f4('0x17')]);return _0x247c47(_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x17')]);}logger[_0x27f4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3bbb54,_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x17')]);return _0x2fc74a(_0x1ddc75[_0x27f4('0x15')]['message']);}else{logger[_0x27f4('0x10')](_0x27f4('0x18'),_0x3bbb54,_0x27f4('0x13'));_0x2fc74a(_0x1ddc75['result'][_0x27f4('0x17')]);}})[_0x27f4('0x19')](function(_0x5091e0){logger['error'](_0x27f4('0x18'),_0x3bbb54,_0x5091e0);_0x247c47(_0x5091e0);});});} \ No newline at end of file +var _0xde9c=['../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x402565,_0x431efa){var _0x2ed987=function(_0x3d1fff){while(--_0x3d1fff){_0x402565['push'](_0x402565['shift']());}};_0x2ed987(++_0x431efa);}(_0xde9c,0xa9));var _0xcde9=function(_0x42718d,_0x1d114d){_0x42718d=_0x42718d-0x0;var _0x381084=_0xde9c[_0x42718d];return _0x381084;};'use strict';var _=require(_0xcde9('0x0'));var util=require(_0xcde9('0x1'));var moment=require('moment');var BPromise=require(_0xcde9('0x2'));var rs=require(_0xcde9('0x3'));var fs=require('fs');var Redis=require(_0xcde9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcde9('0x5'));var logger=require(_0xcde9('0x6'))(_0xcde9('0x7'));var config=require(_0xcde9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcde9('0x9')]({'port':0x232a});config[_0xcde9('0xa')]=_[_0xcde9('0xb')](config['redis'],{'host':_0xcde9('0xc'),'port':0x18eb});var socket=require(_0xcde9('0xd'))(new Redis(config[_0xcde9('0xa')]));require(_0xcde9('0xe'))[_0xcde9('0xf')](socket);function respondWithRpcPromise(_0x9fba8e,_0x187b6e,_0x38c601){return new BPromise(function(_0xbefa80,_0xbce3f9){return client[_0xcde9('0x10')](_0x9fba8e,_0x38c601)['then'](function(_0x1ba1cd){logger[_0xcde9('0x11')]('ChatGroup,\x20%s,\x20%s',_0x187b6e,'request\x20sent');logger[_0xcde9('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x187b6e,'request\x20sent',JSON[_0xcde9('0x13')](_0x1ba1cd));if(_0x1ba1cd[_0xcde9('0x14')]){if(_0x1ba1cd[_0xcde9('0x14')][_0xcde9('0x15')]===0x1f4){logger[_0xcde9('0x14')](_0xcde9('0x16'),_0x187b6e,_0x1ba1cd[_0xcde9('0x14')][_0xcde9('0x17')]);return _0xbce3f9(_0x1ba1cd[_0xcde9('0x14')][_0xcde9('0x17')]);}logger[_0xcde9('0x14')](_0xcde9('0x16'),_0x187b6e,_0x1ba1cd['error'][_0xcde9('0x17')]);return _0xbefa80(_0x1ba1cd['error'][_0xcde9('0x17')]);}else{logger[_0xcde9('0x11')]('ChatGroup,\x20%s,\x20%s',_0x187b6e,'request\x20sent');_0xbefa80(_0x1ba1cd[_0xcde9('0x18')][_0xcde9('0x17')]);}})['catch'](function(_0x1bfd79){logger[_0xcde9('0x14')](_0xcde9('0x16'),_0x187b6e,_0x1bfd79);_0xbce3f9(_0x1bfd79);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 047cd5f..55d6880 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 _0x889a=['length','chatGroup:','./chatGroup.events','save','update'];(function(_0x50773f,_0x4daeda){var _0x2f80ba=function(_0x328009){while(--_0x328009){_0x50773f['push'](_0x50773f['shift']());}};_0x2f80ba(++_0x4daeda);}(_0x889a,0xf2));var _0xa889=function(_0x25dbb2,_0x60818f){_0x25dbb2=_0x25dbb2-0x0;var _0x267cbe=_0x889a[_0x25dbb2];return _0x267cbe;};'use strict';var ChatGroupEvents=require(_0xa889('0x0'));var events=[_0xa889('0x1'),'remove',_0xa889('0x2')];function createListener(_0x2eae85,_0xfc4976){return function(_0x5a9ca1){_0xfc4976['emit'](_0x2eae85,_0x5a9ca1);};}function removeListener(_0x257540,_0x5021a0){return function(){ChatGroupEvents['removeListener'](_0x257540,_0x5021a0);};}exports['register']=function(_0x1f72f5){for(var _0x10b06a=0x0,_0x46224a=events[_0xa889('0x3')];_0x10b06a<_0x46224a;_0x10b06a++){var _0x3ee41f=events[_0x10b06a];var _0x582bc5=createListener(_0xa889('0x4')+_0x3ee41f,_0x1f72f5);ChatGroupEvents['on'](_0x3ee41f,_0x582bc5);}}; \ No newline at end of file +var _0x4edb=['save','remove','update','removeListener','register','./chatGroup.events'];(function(_0x1c7ed2,_0x4ef1c8){var _0x2469fa=function(_0x424cb5){while(--_0x424cb5){_0x1c7ed2['push'](_0x1c7ed2['shift']());}};_0x2469fa(++_0x4ef1c8);}(_0x4edb,0x107));var _0xb4ed=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x4edb[_0x39fd11];return _0x302799;};'use strict';var ChatGroupEvents=require(_0xb4ed('0x0'));var events=[_0xb4ed('0x1'),_0xb4ed('0x2'),_0xb4ed('0x3')];function createListener(_0xc88137,_0x49caf2){return function(_0x24e982){_0x49caf2['emit'](_0xc88137,_0x24e982);};}function removeListener(_0x24ca7b,_0x2173af){return function(){ChatGroupEvents[_0xb4ed('0x4')](_0x24ca7b,_0x2173af);};}exports[_0xb4ed('0x5')]=function(_0x1df5f8){for(var _0x2dd51b=0x0,_0x1c6c2b=events['length'];_0x2dd51b<_0x1c6c2b;_0x2dd51b++){var _0x599a79=events[_0x2dd51b];var _0x39710d=createListener('chatGroup:'+_0x599a79,_0x1df5f8);ChatGroupEvents['on'](_0x599a79,_0x39710d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 974c418..77974aa 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 _0x262f=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer'];(function(_0x18b20e,_0x46903c){var _0xadd3a9=function(_0x477ece){while(--_0x477ece){_0x18b20e['push'](_0x18b20e['shift']());}};_0xadd3a9(++_0x46903c);}(_0x262f,0xb3));var _0xf262=function(_0x84d960,_0x3dc95f){_0x84d960=_0x84d960-0x0;var _0x493ee0=_0x262f[_0x84d960];return _0x493ee0;};'use strict';var multer=require(_0xf262('0x0'));var util=require(_0xf262('0x1'));var path=require(_0xf262('0x2'));var timeout=require(_0xf262('0x3'));var express=require(_0xf262('0x4'));var router=express[_0xf262('0x5')]();var fs_extra=require(_0xf262('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf262('0x7'));var config=require(_0xf262('0x8'));var controller=require('./chatGroup.controller');router[_0xf262('0x9')]('/',auth['isAuthenticated'](),controller[_0xf262('0xa')]);router['get'](_0xf262('0xb'),auth[_0xf262('0xc')](),controller[_0xf262('0xd')]);router['get']('/:id',auth[_0xf262('0xc')](),controller[_0xf262('0xe')]);router[_0xf262('0x9')](_0xf262('0xf'),auth['isAuthenticated'](),controller[_0xf262('0x10')]);router[_0xf262('0x9')](_0xf262('0x11'),auth['isAuthenticated'](),controller[_0xf262('0x12')]);router[_0xf262('0x9')](_0xf262('0x13'),auth[_0xf262('0xc')](),controller[_0xf262('0x14')]);router['post']('/',auth[_0xf262('0xc')](),controller[_0xf262('0x15')]);router[_0xf262('0x16')](_0xf262('0x11'),auth['isAuthenticated'](),controller[_0xf262('0x17')]);router['post']('/:id/messages',auth[_0xf262('0xc')](),controller[_0xf262('0x18')]);router[_0xf262('0x19')]('/:id',auth[_0xf262('0xc')](),controller[_0xf262('0x1a')]);router['delete']('/:id',auth[_0xf262('0xc')](),controller[_0xf262('0x1b')]);router[_0xf262('0x1c')](_0xf262('0x11'),auth[_0xf262('0xc')](),controller[_0xf262('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x3586=['index','/describe','describe','/:id','show','/:id/unread','getMembers','/:id/messages','post','/:id/members','addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x17f716,_0x4a06c7){var _0x31f0de=function(_0x5476e4){while(--_0x5476e4){_0x17f716['push'](_0x17f716['shift']());}};_0x31f0de(++_0x4a06c7);}(_0x3586,0x11f));var _0x6358=function(_0x2c39c3,_0x3d9848){_0x2c39c3=_0x2c39c3-0x0;var _0x74f703=_0x3586[_0x2c39c3];return _0x74f703;};'use strict';var multer=require(_0x6358('0x0'));var util=require(_0x6358('0x1'));var path=require(_0x6358('0x2'));var timeout=require(_0x6358('0x3'));var express=require(_0x6358('0x4'));var router=express[_0x6358('0x5')]();var fs_extra=require(_0x6358('0x6'));var auth=require(_0x6358('0x7'));var interaction=require(_0x6358('0x8'));var config=require(_0x6358('0x9'));var controller=require(_0x6358('0xa'));router[_0x6358('0xb')]('/',auth[_0x6358('0xc')](),controller[_0x6358('0xd')]);router['get'](_0x6358('0xe'),auth[_0x6358('0xc')](),controller[_0x6358('0xf')]);router['get'](_0x6358('0x10'),auth['isAuthenticated'](),controller[_0x6358('0x11')]);router[_0x6358('0xb')](_0x6358('0x12'),auth['isAuthenticated'](),controller['getUnread']);router[_0x6358('0xb')]('/:id/members',auth[_0x6358('0xc')](),controller[_0x6358('0x13')]);router[_0x6358('0xb')](_0x6358('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0x6358('0x15')]('/',auth[_0x6358('0xc')](),controller['create']);router['post'](_0x6358('0x16'),auth[_0x6358('0xc')](),controller[_0x6358('0x17')]);router[_0x6358('0x15')](_0x6358('0x14'),auth[_0x6358('0xc')](),controller[_0x6358('0x18')]);router[_0x6358('0x19')](_0x6358('0x10'),auth[_0x6358('0xc')](),controller['update']);router[_0x6358('0x1a')]('/:id',auth[_0x6358('0xc')](),controller[_0x6358('0x1b')]);router['delete']('/:id/members',auth[_0x6358('0xc')](),controller[_0x6358('0x1c')]);module[_0x6358('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index cbc8fc0..1783f65 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 _0xcbe1=['long','out','exports','thumb','star','TEXT','DATE','STRING'];(function(_0x33cfe6,_0x3e215c){var _0x34b6cf=function(_0x4ce4c5){while(--_0x4ce4c5){_0x33cfe6['push'](_0x33cfe6['shift']());}};_0x34b6cf(++_0x3e215c);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x78db5e,_0x3b9804){_0x78db5e=_0x78db5e-0x0;var _0x250b88=_0xcbe1[_0x78db5e];return _0x250b88;};'use strict';var Sequelize=require('sequelize');module[_0x1cbe('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x1cbe('0x1')),'defaultValue':_0x1cbe('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x1cbe('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1cbe('0x4')]},'disposition':{'type':Sequelize[_0x1cbe('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1cbe('0x5')]},'note':{'type':Sequelize[_0x1cbe('0x5')]},'browserName':{'type':Sequelize[_0x1cbe('0x5')]},'browserVersion':{'type':Sequelize[_0x1cbe('0x5')]},'osName':{'type':Sequelize[_0x1cbe('0x5')]},'osVersion':{'type':Sequelize[_0x1cbe('0x5')]},'deviceModel':{'type':Sequelize[_0x1cbe('0x5')]},'deviceVendor':{'type':Sequelize[_0x1cbe('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1cbe('0x3')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x1cbe('0x3')](_0x1cbe('0x6'))},'read1stAt':{'type':Sequelize[_0x1cbe('0x4')]},'lastMsgAt':{'type':Sequelize[_0x1cbe('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cbe('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x1cbe('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x1cbe('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5ba3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','ENUM','out'];(function(_0x397013,_0x2e6917){var _0x52516f=function(_0x303d6e){while(--_0x303d6e){_0x397013['push'](_0x397013['shift']());}};_0x52516f(++_0x2e6917);}(_0x5ba3,0x140));var _0x35ba=function(_0x3f4ef1,_0x2e5db7){_0x3f4ef1=_0x3f4ef1-0x0;var _0x5af5bc=_0x5ba3[_0x3f4ef1];return _0x5af5bc;};'use strict';var Sequelize=require(_0x35ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x35ba('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x35ba('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x35ba('0x3'),_0x35ba('0x4')),'defaultValue':_0x35ba('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x35ba('0x5')]},'mailTranscript':{'type':Sequelize[_0x35ba('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x35ba('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x35ba('0x6')]},'note':{'type':Sequelize[_0x35ba('0x6')]},'browserName':{'type':Sequelize[_0x35ba('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x35ba('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x35ba('0x6')]},'deviceVendor':{'type':Sequelize[_0x35ba('0x6')]},'deviceType':{'type':Sequelize[_0x35ba('0x6')]},'referer':{'type':Sequelize[_0x35ba('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x35ba('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x35ba('0x8')]('in',_0x35ba('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x35ba('0x6')]},'customerPort':{'type':Sequelize[_0x35ba('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x35ba('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x35ba('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2bf3668..3aef4c8 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 _0x896e=['group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','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','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','show','params','rawAttributes','include','options','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','metadata','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','System','Visitor','website_alias','agentAlias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','includeAll','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','download','server','files','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','closedAt','disposition','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','name','render','merge','body','contact','account','fullname','TagIds','Tags','split','forEach','push','catch','map','ChatInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x1f721d,_0x3f9cdf){var _0x476355=function(_0x537ffb){while(--_0x537ffb){_0x1f721d['push'](_0x1f721d['shift']());}};_0x476355(++_0x3f9cdf);}(_0x896e,0x1e9));var _0xe896=function(_0xc708f2,_0x10b2dc){_0xc708f2=_0xc708f2-0x0;var _0x416158=_0x896e[_0xc708f2];return _0x416158;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe896('0x15'));var logger=require(_0xe896('0x16'))(_0xe896('0x17'));var utils=require('../../config/utils');var config=require(_0xe896('0x18'));var licenseUtil=require(_0xe896('0x19'));var db=require(_0xe896('0x1a'))['db'];config['redis']=_[_0xe896('0x1b')](config[_0xe896('0x1c')],{'host':_0xe896('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0x1c')]));require(_0xe896('0x1e'))[_0xe896('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe896('0x20')]({'port':0x232b});var client9004=jayson[_0xe896('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5e78d6,_0x11f41c,_0x16e272,_0x57f04b){return new BPromise(function(_0x50d224,_0x4e062a){var _0x41cbd7=_0x57f04b||client;return _0x41cbd7[_0xe896('0x22')](_0x5e78d6,_0x16e272)[_0xe896('0x23')](function(_0x5dc89d){logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));logger[_0xe896('0x27')](_0xe896('0x28'),_0x11f41c,_0xe896('0x26'),JSON[_0xe896('0x29')](_0x5dc89d));if(_0x5dc89d[_0xe896('0x2a')]){if(_0x5dc89d['error'][_0xe896('0x2b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x11f41c,_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);return _0x4e062a(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}logger['error'](_0xe896('0x25'),_0x11f41c,_0x5dc89d['error']['message']);return _0x50d224(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}else{logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));_0x50d224(_0x5dc89d[_0xe896('0x2d')][_0xe896('0x2c')]);}})['catch'](function(_0x390128){logger[_0xe896('0x2a')](_0xe896('0x25'),_0x11f41c,_0x390128);_0x4e062a(_0x390128);});});}function respondWithStatusCode(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0xcc;return function(_0xd50fe2){if(_0xd50fe2){return _0x569d5f[_0xe896('0x2e')](_0x26635e);}return _0x569d5f[_0xe896('0x2f')](_0x26635e)[_0xe896('0x30')]();};}function respondWithResult(_0x3f8ceb,_0x498341){_0x498341=_0x498341||0xc8;return function(_0x10adad){if(_0x10adad){return _0x3f8ceb[_0xe896('0x2f')](_0x498341)[_0xe896('0x31')](_0x10adad);}};}function respondWithFilteredResult(_0xbfb15b,_0xace03f){return function(_0x5e0d9b){if(_0x5e0d9b){var _0x47c268=typeof _0xace03f['offset']==='undefined'&&typeof _0xace03f['limit']===_0xe896('0x32');var _0x29a18e=_0x5e0d9b[_0xe896('0x33')];var _0x76c781=_0x47c268?0x0:_0xace03f[_0xe896('0x34')];var _0x1a6090=_0x47c268?_0x5e0d9b[_0xe896('0x33')]:_0xace03f[_0xe896('0x34')]+_0xace03f['limit'];var _0x4ce052;if(_0x1a6090>=_0x29a18e){_0x1a6090=_0x29a18e;_0x4ce052=0xc8;}else{_0x4ce052=0xce;}_0xbfb15b[_0xe896('0x2f')](_0x4ce052);return _0xbfb15b[_0xe896('0x35')](_0xe896('0x36'),_0x76c781+'-'+_0x1a6090+'/'+_0x29a18e)[_0xe896('0x31')](_0x5e0d9b);}return null;};}function patchUpdates(_0x4ddeb6){return function(_0x14ad7a){try{jsonpatch['apply'](_0x14ad7a,_0x4ddeb6,!![]);}catch(_0x57c6e8){return BPromise[_0xe896('0x37')](_0x57c6e8);}return _0x14ad7a[_0xe896('0x38')]();};}function saveUpdates(_0x266c0e,_0x4a1115){return function(_0x4d8092){if(_0x4d8092){return _0x4d8092['update'](_0x266c0e)[_0xe896('0x23')](function(_0x1493b8){return _0x1493b8;});}return null;};}function removeEntity(_0x10fa64,_0x13e8fa){return function(_0x36d2d7){if(_0x36d2d7){return _0x36d2d7['destroy']()[_0xe896('0x23')](function(){_0x10fa64[_0xe896('0x2f')](0xcc)[_0xe896('0x30')]();});}};}function handleEntityNotFound(_0x28e09c,_0x1366d0){return function(_0x2cce09){if(!_0x2cce09){_0x28e09c[_0xe896('0x2e')](0x194);}return _0x2cce09;};}function handleError(_0x3e28f0,_0x5ea3ce){_0x5ea3ce=_0x5ea3ce||0x1f4;return function(_0x42f3fb){logger[_0xe896('0x2a')](_0x42f3fb['stack']);if(_0x42f3fb[_0xe896('0x39')]){delete _0x42f3fb['name'];}_0x3e28f0[_0xe896('0x2f')](_0x5ea3ce)['send'](_0x42f3fb);};}function getMustacheRender(_0x42f445,_0x5ba71e){return Mustache[_0xe896('0x3a')](_0x42f445,_[_0xe896('0x3b')](_0x5ba71e[_0xe896('0x3c')],{'contact':_0x5ba71e[_0xe896('0x3d')],'message':_0x5ba71e[_0xe896('0x2c')],'agent':_0x5ba71e['agent'],'interaction':_0x5ba71e['interaction'],'account':_0x5ba71e[_0xe896('0x3e')]}))||'';}function getInteractionUsers(_0x2ea387,_0x387cc6){return new BPromise(function(_0x15b6c5,_0x2ff489){try{if(_0x387cc6[_0x2ea387['id']]){_0x2ea387['Users']=_['map'](_0x387cc6[_0x2ea387['id']],function(_0x127a6f){return{'id':_0x127a6f['id'],'fullname':_0x127a6f[_0xe896('0x3f')]};});}}catch(_0x5890b1){_0x2ff489(_0x5890b1);}_0x15b6c5(_0x2ea387);});}function getInteractionTags(_0x57e194,_0x19d2fd){return new BPromise(function(_0x3b1de8,_0x911adb){try{if(_0x57e194[_0xe896('0x40')]){_0x57e194[_0xe896('0x41')]=[];_0x57e194[_0xe896('0x40')][_0xe896('0x42')](',')[_0xe896('0x43')](function(_0x372c71){_0x57e194[_0xe896('0x41')][_0xe896('0x44')](_0x19d2fd[_0x372c71]);});}delete _0x57e194[_0xe896('0x40')];}catch(_0x5c00c6){_0x911adb(_0x5c00c6);}_0x3b1de8(_0x57e194);});}function updateChatInteraction(_0x1e5434,_0x143ad4,_0x59b97f){return new BPromise(function(_0x57366b,_0x5cd5a3){return getInteractionUsers(_0x1e5434,_0x59b97f)[_0xe896('0x23')](function(_0x2a354f){return getInteractionTags(_0x2a354f,_0x143ad4);})[_0xe896('0x23')](function(_0x5d1a19){_0x57366b(_0x5d1a19);})[_0xe896('0x45')](function(_0x22189c){_0x5cd5a3(_0x22189c);});});}exports['index']=function(_0x4c05ce,_0x489254){var _0x22c628={},_0x2b0273={},_0x16927a={'count':0x0,'rows':[]};var _0x402aef=_[_0xe896('0x46')](db[_0xe896('0x47')]['rawAttributes'],function(_0x125fbc){return{'name':_0x125fbc[_0xe896('0x48')],'type':_0x125fbc['type'][_0xe896('0x49')]};});_0x2b0273[_0xe896('0x4a')]=_[_0xe896('0x46')](_0x402aef,_0xe896('0x39'));_0x2b0273['query']=_[_0xe896('0x4b')](_0x4c05ce[_0xe896('0x4c')]);_0x2b0273[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x2b0273[_0xe896('0x4a')],_0x2b0273[_0xe896('0x4c')]);_0x22c628['attributes']=_[_0xe896('0x4e')](_0x2b0273['model'],qs[_0xe896('0x4f')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]));_0x22c628[_0xe896('0x50')]=_0x22c628[_0xe896('0x50')][_0xe896('0x51')]?_0x22c628['attributes']:_0x2b0273[_0xe896('0x4a')];if(!_0x4c05ce[_0xe896('0x4c')]['hasOwnProperty'](_0xe896('0x52'))){_0x22c628[_0xe896('0x53')]=qs['limit'](_0x4c05ce[_0xe896('0x4c')]['limit']);_0x22c628[_0xe896('0x34')]=qs[_0xe896('0x34')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x34')]);}_0x22c628[_0xe896('0x54')]=qs['sort'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x55')]);_0x22c628[_0xe896('0x56')]=qs['filters'](_[_0xe896('0x57')](_0x4c05ce['query'],_0x2b0273['filters']),_0x402aef);var _0x388375=[];var _0x20fe4f=squel['select']()[_0xe896('0x58')]('id')[_0xe896('0x58')]('name')['field'](_0xe896('0x59'))[_0xe896('0x5a')]('tools_tags');var _0x1d18f6=squel[_0xe896('0x5b')]()[_0xe896('0x58')](_0xe896('0x5c'))[_0xe896('0x58')](_0xe896('0x5d'))[_0xe896('0x58')](_0xe896('0x5e'))[_0xe896('0x5a')](_0xe896('0x5f'),'ui')[_0xe896('0x60')]('users','u',_0xe896('0x61'));var _0x2a23a2=squel[_0xe896('0x5b')]()[_0xe896('0x5a')](_0xe896('0x62'),'i')[_0xe896('0x60')](_0xe896('0x63'),'c',_0xe896('0x64'))[_0xe896('0x60')](_0xe896('0x65'),'o',_0xe896('0x66'))[_0xe896('0x60')]('chat_websites','a',_0xe896('0x67'))[_0xe896('0x60')](_0xe896('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0xe896('0x69'))[_0xe896('0x60')](_0xe896('0x6a'),'t',_0xe896('0x6b'));var _0x50c910=squel[_0xe896('0x6c')]();var _0x28396c=[];var _0x57ed84=squel[_0xe896('0x6c')]();var _0x5d6c1c;if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]){_0x5d6c1c=as['parseSearch'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]);var _0x568d89=_0x5d6c1c['sqlOperator'];for(var _0x2a5e68=0x0;_0x2a5e68<_0x5d6c1c[_0xe896('0x6e')][_0xe896('0x51')];_0x2a5e68++){var _0x11291a=_0x5d6c1c[_0xe896('0x6e')][_0x2a5e68];var _0x4e4092='i';var _0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0x11291a[_0xe896('0x58')]]);if(!_0xdadb92){switch(_0x11291a['field']){case'unreadMessages':if(_0x11291a[_0xe896('0x70')]==0x1){_0x2a23a2[_0xe896('0x71')]('`'+_0x11291a['field']+_0xe896('0x72'));}else{_0x2a23a2['having']('`'+_0x11291a[_0xe896('0x58')]+_0xe896('0x73'));}break;case _0xe896('0x74'):if(_0x11291a[_0xe896('0x75')]===_0xe896('0x76')){if(_0x11291a[_0xe896('0x70')][_0xe896('0x42')]('\x20')[_0xe896('0x51')]>0x1){_0x50c910[_0x568d89](_0xe896('0x77'),qs[_0xe896('0x78')](_0x11291a[_0xe896('0x70')]),null);}else{var _0x3248e6='%'+_0x11291a[_0xe896('0x70')]+'%';_0x50c910[_0x568d89](_0xe896('0x79'),_0x3248e6,_0x3248e6,_0x3248e6);}}else{_0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0xe896('0x7a')]);_0x11291a[_0xe896('0x58')]=_0xe896('0x7a');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value']['start'],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}break;case'Tag':var _0x1165ad=_0x11291a[_0xe896('0x70')][_0xe896('0x42')](',')[_0xe896('0x46')](function(_0x19781b){return Number(_0x19781b);});_0x1165ad[_0xe896('0x43')](function(_0x475459){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x475459+',%');});_0x28396c=_[_0xe896('0x7f')](_0x28396c,_0x1165ad);break;case _0xe896('0x80'):if(_0x11291a[_0xe896('0x75')]==='$substring'){_0x50c910[_0x568d89](_0xe896('0x81'),'%'+_0x11291a[_0xe896('0x70')]+'%',null);}else{_0xdadb92=_['find'](_0x402aef,[_0xe896('0x39'),'UserId']);_0x11291a['field']=_0xe896('0x82');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92['type'],_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')]['start'],_0x1c118e['value'][_0xe896('0x30')]);}break;case _0xe896('0x3c'):_0x1c118e=as[_0xe896('0x7b')]('me',null,_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')]['end']);break;}}else{var _0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value'][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}}}else{var _0x4fcd37=_(_0x4c05ce['query'])[_0xe896('0x4b')]()[_0xe896('0x46')](function(_0x4c5091){return _[_0xe896('0x84')](_0x402aef,[_0xe896('0x39'),_0x4c5091])?_0x4c5091:undefined;})[_0xe896('0x85')]()[_0xe896('0x70')]();if(!_['isEmpty'](_0x4fcd37)){_0x4fcd37[_0xe896('0x43')](function(_0x234a3a){if(_0x234a3a===_0xe896('0x86')){_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),[][_0xe896('0x88')](_0x4c05ce['query'][_0x234a3a]));}else if(_0x234a3a==='createdAt'){var _0x48b523=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8a')];var _0x270121=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8b')];_0x2a23a2['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x48b523,_0x270121);}else{if(_0x4c05ce[_0xe896('0x4c')][_0x234a3a]==='null'){_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20IS\x20NULL');}else{_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20=\x20?',_0x4c05ce[_0xe896('0x4c')][_0x234a3a]);}}});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]==0x1){_0x2a23a2['having'](_0xe896('0x8d'));}else{_0x2a23a2[_0xe896('0x71')](_0xe896('0x8e'));}}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]){_0x28396c=_[_0xe896('0x90')](_0x4c05ce[_0xe896('0x4c')]['tag'])?_0x4c05ce[_0xe896('0x4c')]['tag']:new Array(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]);_0x28396c[_0xe896('0x43')](function(_0x503131){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x503131+',%');});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')]){var _0x1913b2=_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')][_0xe896('0x92')]('\x5c','\x5c\x5c')[_0xe896('0x92')](/'/g,'\x27\x27');if(qs[_0xe896('0x93')](_0x1913b2)){_0x50c910['or'](_0xe896('0x94'),_0x1913b2+'%');}else{_0x50c910['or'](_0xe896('0x95'),qs['getFullTextValue'](_0x1913b2))['or'](_0xe896('0x96'),_0x1913b2+'%');}}}_0x2a23a2[_0xe896('0x56')](_0x50c910);_0x2a23a2[_0xe896('0x97')](_0xe896('0x98'));var _0x48885e={'type':db[_0xe896('0x99')][_0xe896('0x9a')][_0xe896('0x9b')],'raw':!![]};var _0x779db6=_0x2a23a2[_0xe896('0x9c')]();_0x779db6[_0xe896('0x58')](_0xe896('0x98'));_0x779db6[_0xe896('0x58')](_0xe896('0x9d'),_0xe896('0x9e'));if(_0x22c628[_0xe896('0x54')]){_0x22c628[_0xe896('0x54')]['forEach'](function(_0x2bd061){var _0x1d1364=_0x2bd061[0x0]===_0xe896('0x9f')?_0x2bd061[0x0]:'i.'+_0x2bd061[0x0];_0x2a23a2['order'](_0x1d1364,_0x2bd061[0x1]===_0xe896('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x28396c)){_0x2a23a2['having'](_0x57ed84);_0x779db6[_0xe896('0x56')](_0xe896('0xa1'),_0x28396c);}BPromise[_0xe896('0xa2')]()['then'](function(){if(!_0x5d6c1c){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return;_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa3'));return;}if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]!==_0xe896('0xa6'))return;return _0x4c05ce[_0xe896('0xa4')][_0xe896('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x544d2d){if(_[_0xe896('0xa8')](_0x544d2d)){_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa9'));}else{_0x779db6[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));}});})[_0xe896('0x23')](function(){if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]===_0xe896('0xa6')&&!_0x5d6c1c&&!_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x779db6[_0xe896('0xab')](),_0x48885e);})[_0xe896('0x23')](function(_0x16ff5e){_0x16927a[_0xe896('0x33')]=_0x16ff5e[_0xe896('0x51')];if(_0x16927a['count']===0x0)return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x20fe4f[_0xe896('0xab')](),_0x48885e)[_0xe896('0x23')](function(_0x229150){_0x388375=_[_0xe896('0xac')](_0x229150,'id');_0x48885e=_[_0xe896('0x3b')](_0x48885e,{'model':db[_0xe896('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]){_0x22c628['attributes']['forEach'](function(_0x41e6c4){_0x2a23a2[_0xe896('0x58')]('i.'+_0x41e6c4);});}else{_0x2a23a2[_0xe896('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe896('0x9e'));_0x2a23a2[_0xe896('0x58')]('a.key',_0xe896('0xad'));_0x2a23a2[_0xe896('0x58')]('a.mandatoryDisposition',_0xe896('0xae'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xaf'),_0xe896('0x9f'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb0'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb1'),'Contact.firstName');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb2'),_0xe896('0xb3'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb4'),'Contact.email');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb5'),_0xe896('0xb6'));_0x2a23a2['field'](_0xe896('0xb7'),_0xe896('0xb8'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb9'),_0xe896('0xba'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xbb'),_0xe896('0xbc'));_0x2a23a2[_0xe896('0x58')]('o.internal',_0xe896('0xbd'));_0x2a23a2['field'](_0xe896('0xbe'),_0xe896('0x40'));}if(_0x22c628[_0xe896('0x53')])_0x2a23a2[_0xe896('0x53')](_0x22c628['limit']);if(_0x22c628[_0xe896('0x34')])_0x2a23a2[_0xe896('0x34')](_0x22c628['offset']);return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x2a23a2[_0xe896('0xab')](),_0x48885e);})['then'](function(_0xadc81f){if(_0xadc81f['length']>0x0)_0x1d18f6['where'](_0xe896('0xbf'),_[_0xe896('0x46')](_0xadc81f,'id'));return db['sequelize'][_0xe896('0x4c')](_0x1d18f6[_0xe896('0xab')](),_0x48885e)['then'](function(_0x529df2){var _0x5b4e01=_['groupBy'](_0x529df2,_0xe896('0xc0'));var _0x237cae=[];_0xadc81f[_0xe896('0x43')](function(_0xc0fa84){_0x237cae[_0xe896('0x44')](updateChatInteraction(_0xc0fa84,_0x388375,_0x5b4e01));});return BPromise[_0xe896('0xc1')](_0x237cae);});});})[_0xe896('0x23')](function(_0x2dbfd3){_0x16927a['rows']=_0x2dbfd3;return _0x16927a;})[_0xe896('0x23')](respondWithFilteredResult(_0x489254,_0x22c628))[_0xe896('0x45')](handleError(_0x489254,null));};exports[_0xe896('0xc2')]=function(_0x2a1d41,_0x5a254b){var _0x4f4d26={'raw':![],'where':{'id':_0x2a1d41[_0xe896('0xc3')]['id']}},_0x2f30a9={};_0x2f30a9['model']=_['keys'](db[_0xe896('0x47')][_0xe896('0xc4')]);_0x2f30a9[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x2a1d41[_0xe896('0x4c')]);_0x2f30a9['filters']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],_0x2f30a9[_0xe896('0x4c')]);_0x4f4d26['attributes']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x2a1d41[_0xe896('0x4c')][_0xe896('0x4f')]));_0x4f4d26['attributes']=_0x4f4d26[_0xe896('0x50')][_0xe896('0x51')]?_0x4f4d26[_0xe896('0x50')]:_0x2f30a9['model'];if(_0x2a1d41[_0xe896('0x4c')]['includeAll']){_0x4f4d26[_0xe896('0xc5')]=[{'all':!![]}];}_0x4f4d26=_[_0xe896('0x3b')]({},_0x4f4d26,_0x2a1d41[_0xe896('0xc6')]);return db[_0xe896('0x47')][_0xe896('0x6f')](_0x4f4d26)[_0xe896('0x23')](handleEntityNotFound(_0x5a254b,null))['then'](respondWithResult(_0x5a254b,null))['catch'](handleError(_0x5a254b,null));};exports[_0xe896('0xc7')]=function(_0x54c61f,_0x15af0e){return db[_0xe896('0x47')]['create'](_0x54c61f[_0xe896('0x3c')],{})[_0xe896('0x23')](respondWithResult(_0x15af0e,0xc9))['catch'](handleError(_0x15af0e,null));};exports[_0xe896('0xc8')]=function(_0x4bcd8c,_0x326c67){if(_0x4bcd8c[_0xe896('0x3c')]['id']){delete _0x4bcd8c[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')]['find']({'where':{'id':_0x4bcd8c[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x326c67,null))[_0xe896('0x23')](saveUpdates(_0x4bcd8c[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x326c67,null))[_0xe896('0x45')](handleError(_0x326c67,null));};exports[_0xe896('0xc9')]=function(_0x3c8951,_0x41b162){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x3c8951[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x41b162,null))[_0xe896('0x23')](removeEntity(_0x41b162,null))[_0xe896('0x45')](handleError(_0x41b162,null));};exports[_0xe896('0xca')]=function(_0x16b398,_0x4edeaf){return db[_0xe896('0x47')][_0xe896('0xca')]()['then'](respondWithResult(_0x4edeaf,null))['catch'](handleError(_0x4edeaf,null));};exports[_0xe896('0xcb')]=function(_0xdd4767,_0x3df01d){var _0xf6563d=_0xdd4767[_0xe896('0xc3')]['id'];var _0x21e7a2;var _0x43b9e0;var _0x46a4f0;return db['ChatInteraction'][_0xe896('0xcc')]({'where':{'id':_0xf6563d}})[_0xe896('0x23')](function(_0x2ee264){_0x21e7a2=_0x2ee264;return db[_0xe896('0xcd')]['findOne']({'where':{'id':_0x2ee264[_0xe896('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe896('0xce'),_0xe896('0xcf'),_0xe896('0xd0')],'raw':!![]});})[_0xe896('0x23')](function(_0x3e55b7){if(_0x3e55b7&&_0x3e55b7[_0xe896('0xd1')]&&_0x3e55b7[_0xe896('0xd2')]){_0x43b9e0=_0x3e55b7;var _0x49293e={'interaction':{'id':_0xf6563d},'agent':{'id':_0xdd4767[_0xe896('0xa4')]['id'],'name':_0xdd4767[_0xe896('0xa4')][_0xe896('0x39')],'fullname':_0xdd4767[_0xe896('0xa4')][_0xe896('0x3f')],'email':_0xdd4767[_0xe896('0xa4')][_0xe896('0xd3')]},'contact':_0xdd4767[_0xe896('0x3c')][_0xe896('0x3d')],'account':_0xdd4767['body'][_0xe896('0x3e')]};var _0x13c2fb={'rejectUnauthorized':![],'method':'POST','url':_0xe896('0xd4'),'headers':{'X-APIKEY':_0x3e55b7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xdd4767['user'][_0xe896('0xd3')]],'buttons':null,'topic':_0x43b9e0['vidaooTopic'],'note':_['isNull'](_0x43b9e0[_0xe896('0xcf')])?null:getMustacheRender(_0x43b9e0[_0xe896('0xcf')],_0x49293e),'metadata':null},'redirect':_0xe896('0xd5'),'json':!![]};try{if(!_['isNull'](_0x43b9e0[_0xe896('0xd0')])){var _0x55be9b=getMustacheRender(_0x43b9e0[_0xe896('0xd0')],_0x49293e);var _0x1406c2=JSON['parse'](_0x55be9b);_0x13c2fb[_0xe896('0x3c')][_0xe896('0xd6')]=_0x1406c2;}}catch(_0x53cebb){throw new db[(_0xe896('0x99'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x13c2fb);}else{throw new db['Sequelize'][(_0xe896('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe896('0x23')](function(_0x30c8f4){_0x46a4f0=_0x30c8f4;if(_0x46a4f0['id']){var _0x386f5a={'body':_0x46a4f0[_0xe896('0xd8')],'ChatWebsiteId':_0x43b9e0['id'],'ChatInteractionId':_0x21e7a2['id'],'direction':'out','UserId':_0xdd4767[_0xe896('0xa4')]['id']};return db[_0xe896('0xd9')][_0xe896('0xc7')](_0x386f5a,{});}else{throw new db[(_0xe896('0x99'))]['ValidationError'](_0xe896('0xda'));}})['then'](function(){return _0x21e7a2[_0xe896('0xdb')]({'vidaooSessionId':_0x46a4f0['id']});})[_0xe896('0x23')](respondWithResult(_0x3df01d,null))[_0xe896('0x45')](handleError(_0x3df01d,null));};exports[_0xe896('0xdc')]=function(_0x5a5336,_0x42ab19){if(_0x5a5336['body']['id']){delete _0x5a5336[_0xe896('0x3c')]['id'];}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x5a5336[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xdd')],'as':'Contact'}]})[_0xe896('0x23')](handleEntityNotFound(_0x42ab19,null))['then'](saveUpdates(_0x5a5336[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x42ab19,null))['catch'](handleError(_0x42ab19,null));};exports[_0xe896('0xde')]=function(_0x384116,_0x5949f1,_0x432775){if(_0x384116[_0xe896('0x3c')]['id']){delete _0x384116[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x384116[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](function(_0x5da1fa){if(!_0x5da1fa){logger[_0xe896('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xe896('0xdf'));_0x5949f1[_0xe896('0x2e')](0x194);}else{if(_0x5da1fa['UserId']){throw new db[(_0xe896('0x99'))][(_0xe896('0xd7'))]('Interaction\x20already\x20assigned');}}return _0x5da1fa;})['then'](function(_0x24c6bc){if(_0x24c6bc){return _0x24c6bc[_0xe896('0xc8')]({'closed':_0x384116['body'][_0xe896('0xe0')],'disposition':_0x384116[_0xe896('0x3c')]['disposition']})[_0xe896('0x23')](function(_0x54219c){return _0x54219c;});}})[_0xe896('0x23')](function(_0x577d5a){return respondWithRpcPromise(_0xe896('0xe1'),_0xe896('0xde'),_0x384116['body'],client9004);})[_0xe896('0x23')](respondWithResult(_0x5949f1,null))[_0xe896('0x45')](handleError(_0x5949f1,null));};exports[_0xe896('0xe2')]=function(_0x32f30e,_0x265206,_0x90a856){_0x32f30e[_0xe896('0x3c')][_0xe896('0x39')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe4')];_0x32f30e[_0xe896('0x3c')][_0xe896('0xe5')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe6')];_0x32f30e['body'][_0xe896('0x7c')]=_0x32f30e['file'][_0xe896('0xe7')];return db[_0xe896('0xe8')]['create'](_0x32f30e[_0xe896('0x3c')])[_0xe896('0x23')](respondWithResult(_0x265206,0xc9))[_0xe896('0x45')](handleError(_0x265206,null));};exports['attachmentDownload']=function(_0x28deef,_0x3f32f7,_0x2b1427){return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x28deef[_0xe896('0xc3')]['id']},'raw':!![]})[_0xe896('0x23')](handleEntityNotFound(_0x3f32f7,null))[_0xe896('0x23')](function(_0xdd5dbf){if(_0xdd5dbf){if(_0xdd5dbf['closed']){return _0x3f32f7['status'](0x193)['json']({'status':0x193,'message':_0xe896('0xe9')});}return db['Attachment']['findOne']({'where':{'id':_0x28deef[_0xe896('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3f32f7,null));}})['then'](function(_0x348cd5){if(_0x348cd5){var _0x4a5f7f=_0x348cd5[_0xe896('0xea')]!==null;var _0x222029=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server/files/attachments/');if(_0x4a5f7f){_0x222029=path[_0xe896('0xeb')](_0x222029,_0xe896('0xed'));}var _0x36c394=path[_0xe896('0xeb')](_0x222029,_0x348cd5[_0xe896('0xe5')]);return _0x3f32f7['download'](_0x36c394);}})['catch'](handleError(_0x3f32f7,null));};exports[_0xe896('0xee')]=function(_0x1a5056,_0x57aa1b){var _0x21b078=null;var _0x17edcd=null;var _0x71d912=null;var _0x22a63d=null;if(_0x1a5056[_0xe896('0x3c')]['id']){delete _0x1a5056[_0xe896('0x3c')]['id'];}if(_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')]){_0x22a63d=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0xf0'),util[_0xe896('0xf1')](_0xe896('0xf2'),Date['now']()));_0x1a5056[_0xe896('0x3c')][_0xe896('0xf3')]=_0x22a63d;}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x1a5056[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'include':[{'model':db[_0xe896('0x80')],'as':_0xe896('0x80')}]}]})[_0xe896('0x23')](handleEntityNotFound(_0x57aa1b,null))[_0xe896('0x23')](saveUpdates(_0x1a5056[_0xe896('0x3c')],null))[_0xe896('0x23')](function(_0x5487f0){if(_0x5487f0){_0x21b078=_0x5487f0;return db[_0xe896('0xcd')]['find']({'where':{'id':_0x21b078[_0xe896('0x86')]}});}})[_0xe896('0x23')](function(_0xb528ff){if(_0xb528ff){_0x71d912=_0xb528ff;return db[_0xe896('0xdd')][_0xe896('0x6f')]({'where':{'id':_0x21b078[_0xe896('0x7a')]}});}})[_0xe896('0x23')](function(_0x6e53ae){if(_0x6e53ae){_0x17edcd=_0x6e53ae;if(_0x22a63d){var _0x52337e=null;for(var _0x1d6003=0x1;_0x1d6003<_0x21b078[_0xe896('0xf4')][_0xe896('0x51')];++_0x1d6003){_0x52337e=_0x21b078[_0xe896('0xf4')][_0x1d6003];var _0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912['agentAlias'],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');var _0x27743a=_0x1a5056['body']['customer']||util[_0xe896('0xf1')](_0xe896('0xf5'),_0xe896('0xf7'),_0x52337e['ContactId']);switch(_0x71d912['agentIdentifier']){case _0xe896('0xf8'):_0x882a0e=_0x52337e[_0xe896('0x82')]?util['format'](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');break;case _0xe896('0xfa'):_0x882a0e=_0x52337e[_0xe896('0x82')]?_0x52337e['User'][_0xe896('0xfb')]||_0x52337e[_0xe896('0x80')]['fullname']:_0xe896('0xf6');break;case _0xe896('0xfc'):_0x882a0e=_0x52337e['UserId']?_0x52337e['User']['fullname']:'System';break;default:_0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');}var _0x58fcf9=util[_0xe896('0xf1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x52337e[_0xe896('0xfd')])['format'](_0xe896('0xfe')),_0x52337e[_0xe896('0xff')]==='in'?_0x27743a:_0x882a0e,_0x52337e['body']);if(!_0x52337e['secret']){fs[_0xe896('0x100')](_0x22a63d,_0x58fcf9);}}return db[_0xe896('0x101')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe896('0x102'),'raw':!![]}]});}}})[_0xe896('0x23')](function(_0xbee8fa){if(_0xbee8fa&&_0xbee8fa[_0xe896('0x102')]&&_0x1a5056[_0xe896('0x3c')]){var _0x1a50c3={'tls':{'rejectUnauthorized':![]}};if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')]){_0x1a50c3[_0xe896('0x103')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')];}else{_0x1a50c3[_0xe896('0x104')]=_0xbee8fa[_0xe896('0x102')]['host'];_0x1a50c3['port']=_0xbee8fa[_0xe896('0x102')][_0xe896('0x105')];_0x1a50c3[_0xe896('0x106')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x106')];}if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x107')]){_0x1a50c3[_0xe896('0x108')]={'user':_0xbee8fa[_0xe896('0x102')][_0xe896('0xa4')],'pass':_0xbee8fa[_0xe896('0x102')][_0xe896('0x109')]};}return respondWithRpcPromise(_0xe896('0x10a'),_0xe896('0x10b'),{'account':_0x1a50c3,'message':{'from':util[_0xe896('0xf1')](_0xe896('0x10c'),_0xbee8fa['name'],_0xbee8fa['email']||_0xbee8fa['Smtp'][_0xe896('0xa4')]),'to':_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')],'subject':_0xe896('0x10d'),'text':util[_0xe896('0xf1')](_0xe896('0x10e'),_0x1a5056[_0xe896('0x3c')]['mailTranscript']),'attachments':[{'path':_0x22a63d}]}})['then'](function(){return _0x21b078;})[_0xe896('0x45')](function(_0x550c55){console['error'](_0x550c55);});}else{return _0x21b078;}})['then'](respondWithStatusCode(_0x57aa1b,0xc8))[_0xe896('0x45')](handleError(_0x57aa1b,null));};exports[_0xe896('0x10f')]=function(_0x14da55,_0x5656d0,_0x31ca0b){return db[_0xe896('0xd9')][_0xe896('0x6f')]({'where':{'id':_0x14da55[_0xe896('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5656d0,null))['then'](function(_0x518847){if(_0x518847){return _0x518847[_0xe896('0x10f')](_0x14da55[_0xe896('0x3c')]['ids'],_[_0xe896('0x110')](_0x14da55[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{});}})[_0xe896('0x23')](respondWithResult(_0x5656d0,null))['catch'](handleError(_0x5656d0,null));};exports[_0xe896('0x112')]=function(_0xf78ce2,_0x3f8ea0,_0x254420){var _0x1196d4={'raw':![],'where':{}};var _0x1ee26e={};var _0x1bd649={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0xf78ce2[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f8ea0,null))[_0xe896('0x23')](function(_0x2e5c38){if(_0x2e5c38){_0x1ee26e[_0xe896('0x4a')]=_['keys'](db[_0xe896('0xd9')]['rawAttributes']);_0x1ee26e[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0xf78ce2['query']);_0x1ee26e['filters']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],_0x1ee26e[_0xe896('0x4c')]);_0x1196d4['attributes']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0xf78ce2['query'][_0xe896('0x4f')]));_0x1196d4[_0xe896('0x50')]=_0x1196d4[_0xe896('0x50')]['length']?_0x1196d4['attributes']:_0x1ee26e[_0xe896('0x4a')];if(!_0xf78ce2['query'][_0xe896('0x113')](_0xe896('0x52'))){_0x1196d4[_0xe896('0x53')]=qs[_0xe896('0x53')](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x53')]);_0x1196d4[_0xe896('0x34')]=qs['offset'](_0xf78ce2['query'][_0xe896('0x34')]);}_0x1196d4[_0xe896('0x54')]=qs['sort'](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x55')]);_0x1196d4['where']=qs['filters'](_['pick'](_0xf78ce2['query'],_0x1ee26e['filters']));_0x1196d4['where'][_0xe896('0xc0')]=_0x2e5c38['id'];if(_0xf78ce2['query'][_0xe896('0x91')]){_0x1196d4[_0xe896('0x56')]=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],{'$or':_['map'](_0x1196d4[_0xe896('0x50')],function(_0x646354){var _0x3d751c={};_0x3d751c[_0x646354]={'$like':'%'+_0xf78ce2['query'][_0xe896('0x91')]+'%'};return _0x3d751c;})});}if(_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')]){var _0x42bf84=_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')][_0xe896('0x42')](',');var _0x115450={};_0x115450[_0x42bf84[0x0]]={'$gte':moment(_0x42bf84[0x1])[_0xe896('0xf1')](_0xe896('0x114'))};_0x1196d4['where']=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],_0x115450);}_0x1196d4=_[_0xe896('0x3b')]({},_0x1196d4,_0xf78ce2[_0xe896('0xc6')]);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x1196d4[_0xe896('0x56')]})[_0xe896('0x23')](function(_0x3bee56){_0x1bd649[_0xe896('0x33')]=_0x3bee56;if(_0xf78ce2[_0xe896('0x4c')]['includeAll']){_0x1196d4['include']=[{'all':!![]}];}return db[_0xe896('0xd9')]['findAll'](_0x1196d4);})['then'](function(_0x1d3083){_0x1bd649[_0xe896('0x115')]=_0x1d3083;return _0x1bd649;});}})[_0xe896('0x23')](respondWithFilteredResult(_0x3f8ea0,_0x1196d4))['catch'](handleError(_0x3f8ea0,null));};exports[_0xe896('0x116')]=function(_0x4ddfde,_0xc1bdcf,_0xdea91f){var _0x5c2af6={'where':{}},_0x306757={},_0x31f4e1={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x4ddfde['params']['id']}})[_0xe896('0x23')](handleEntityNotFound(_0xc1bdcf,null))['then'](function(_0x186b58){if(_0x186b58){_0x306757[_0xe896('0x4a')]=_[_0xe896('0x4b')](db['ChatMessage']['rawAttributes']);_0x306757[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x4ddfde[_0xe896('0x4c')]);_0x306757[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x306757[_0xe896('0x4a')],_0x306757[_0xe896('0x4c')]);_0x5c2af6[_0xe896('0x50')]=_['intersection'](_0x306757[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x4ddfde['query'][_0xe896('0x4f')]));_0x5c2af6['attributes']=_0x5c2af6['attributes'][_0xe896('0x51')]?_0x5c2af6[_0xe896('0x50')]:_0x306757[_0xe896('0x4a')];if(!_0x4ddfde[_0xe896('0x4c')][_0xe896('0x113')]('nolimit')){_0x5c2af6[_0xe896('0x53')]=qs[_0xe896('0x53')](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x53')]);_0x5c2af6[_0xe896('0x34')]=qs['offset'](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x34')]);}_0x5c2af6[_0xe896('0x54')]=qs[_0xe896('0x55')](_0x4ddfde['query'][_0xe896('0x55')]);_0x5c2af6[_0xe896('0x56')]=qs[_0xe896('0x4d')](_[_0xe896('0x57')](_0x4ddfde['query'],_0x306757[_0xe896('0x4d')]));_0x5c2af6[_0xe896('0x56')][_0xe896('0xc0')]=_0x186b58['id'];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]){_0x5c2af6['where']=_[_0xe896('0x3b')](_0x5c2af6[_0xe896('0x56')],{'$or':_['map'](_0x5c2af6['attributes'],function(_0x42490d){var _0x2dba2f={};_0x2dba2f[_0x42490d]={'$like':'%'+_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]+'%'};return _0x2dba2f;})});}_0x5c2af6['where'][_0xe896('0x117')]=![];if(_0x4ddfde[_0xe896('0x4c')]['id']){_0x5c2af6[_0xe896('0x56')]['id']={'$gt':_0x4ddfde[_0xe896('0x4c')]['id']};}_0x5c2af6=_['merge']({},_0x5c2af6,_0x4ddfde['options']);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x5c2af6[_0xe896('0x56')]})[_0xe896('0x23')](function(_0xabf68b){_0x31f4e1[_0xe896('0x33')]=_0xabf68b;_0x5c2af6['include']=[];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x118')]){_0x5c2af6['include'][_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id','fullname',_0xe896('0xfb')]});}if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x119')]){_0x5c2af6[_0xe896('0xc5')]=[{'all':!![]}];}return db[_0xe896('0xd9')][_0xe896('0x11a')](_0x5c2af6);})['then'](function(_0xbf5fec){_0x31f4e1[_0xe896('0x115')]=_0xbf5fec;return _0x31f4e1;});}})['then'](respondWithFilteredResult(_0xc1bdcf,_0x5c2af6))[_0xe896('0x45')](handleError(_0xc1bdcf,null));};exports[_0xe896('0x11b')]=function(_0x50e9f6,_0x3f7f9b,_0x45fbfd){return db['ChatInteraction']['find']({'where':{'id':_0x50e9f6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f7f9b,null))['then'](function(_0xd7222b){if(_0xd7222b){return _0xd7222b[_0xe896('0x11c')](_0x50e9f6['body'][_0xe896('0x111')],_[_0xe896('0x110')](_0x50e9f6[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{})[_0xe896('0x11d')](function(){return db[_0xe896('0x11e')][_0xe896('0x11a')]({'attributes':['id',_0xe896('0x39'),_0xe896('0x59')],'where':{'id':_0x50e9f6[_0xe896('0x3c')]['ids']}});})[_0xe896('0x23')](function(_0x4b7dda){socket['emit'](_0xe896('0x11f'),{'id':Number(_0x50e9f6[_0xe896('0xc3')]['id']),'tags':_0x4b7dda||[]});return{'id':Number(_0x50e9f6['params']['id']),'tags':_0x4b7dda||[]};});}})['then'](respondWithResult(_0x3f7f9b,null))[_0xe896('0x45')](handleError(_0x3f7f9b,null));};exports[_0xe896('0x120')]=function(_0x40efd6,_0x513fbe,_0x17b841){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x40efd6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x513fbe,null))['then'](function(_0x704996){if(_0x704996){return _0x704996[_0xe896('0x120')](_0x40efd6[_0xe896('0x4c')]['ids']);}})[_0xe896('0x23')](respondWithStatusCode(_0x513fbe,null))[_0xe896('0x45')](handleError(_0x513fbe,null));};exports[_0xe896('0x121')]=function(_0x99a090,_0x15c4f9){var _0x4b1785=moment()['unix']()[_0xe896('0xab')]();var _0x5bc230=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0x122'),_0xe896('0x123'),'tmp');var _0x2d2654=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x123'),_0xe896('0x124'));var _0x5bbc65=path[_0xe896('0xeb')](_0x5bc230,_0x4b1785);var _0x194003=util[_0xe896('0xf1')](_0xe896('0x125'),_0x99a090[_0xe896('0xc3')]['id'],_0x4b1785);var _0x2a3489=path[_0xe896('0xeb')](_0x5bc230,_0x194003);var _0x54df80=[];_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id',_0xe896('0x3f')],'raw':!![]});_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0xdd')],'as':_0xe896('0x74'),'attributes':['id',_0xe896('0x126'),'lastName'],'raw':!![]});if(_0x99a090[_0xe896('0x4c')][_0xe896('0x124')]){_0x54df80[_0xe896('0x44')]({'model':db['Attachment'],'as':_0xe896('0xe8'),'raw':!![]});}var _0x2279c9=[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'attributes':['id','body',_0xe896('0xfd'),_0xe896('0xff'),_0xe896('0x117'),_0xe896('0x8c')],'include':_0x54df80}];_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0xcd')],'as':_0xe896('0x127'),'attributes':['id',_0xe896('0x39')]});_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x128'),'attributes':['id',_0xe896('0x3f')]});return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x99a090[_0xe896('0xc3')]['id']},'include':_0x2279c9})['then'](handleEntityNotFound(_0x15c4f9,null))['then'](function(_0x5cd4ff){if(_0x5cd4ff){var _0x81d8be=_0x5cd4ff[_0xe896('0x129')]({'plain':!![]});fs[_0xe896('0x12a')](_0x5bbc65);var _0x132625={'channel':_0xe896('0x12b'),'account':_0x81d8be[_0xe896('0x127')][_0xe896('0x39')],'agent':_0x81d8be[_0xe896('0x128')]?_0x81d8be[_0xe896('0x128')][_0xe896('0x3f')]:'N.A.','createdAt':moment(_0x81d8be[_0xe896('0xfd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')](),'closedAt':_0x81d8be[_0xe896('0xe0')]?moment(_0x81d8be[_0xe896('0x12c')])[_0xe896('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')]():'','disposition':_0x81d8be[_0xe896('0x12d')],'chatInfo':{'browser':_0x81d8be['browserName'],'os':_0x81d8be[_0xe896('0x12e')],'referer':_0x81d8be[_0xe896('0x12f')],'customerIp':_0x81d8be[_0xe896('0x130')],'customerPort':_0x81d8be[_0xe896('0x131')]?_0x81d8be['customerPort']:_0xe896('0x132')},'messages':_(_0x81d8be['Messages'])[_0xe896('0x133')]()[_0xe896('0x91')]({'secret':![]})[_0xe896('0x46')](function(_0x374e2f){if(_0x374e2f[_0xe896('0xe8')]){var _0x328e2b=path['join'](_0x2d2654,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]);if(fs[_0xe896('0x134')](_0x328e2b)){fs[_0xe896('0x135')](_0x328e2b)['pipe'](fs[_0xe896('0x136')](path[_0xe896('0xeb')](_0x5bbc65,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')])));}}return{'date':moment(_0x374e2f['createdAt'])[_0xe896('0xf1')](_0xe896('0x114'))[_0xe896('0xab')](),'sender':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?_0x374e2f[_0xe896('0x80')]?_0x374e2f[_0xe896('0x80')][_0xe896('0x3f')]:'System':_0x374e2f['Contact'][_0xe896('0x126')]+(_0x374e2f[_0xe896('0x74')][_0xe896('0x138')]?'\x20'+_0x374e2f[_0xe896('0x74')]['lastName']:''),'body':_0x374e2f[_0xe896('0xe8')]?_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]:_0x374e2f[_0xe896('0x3c')],'direction':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?'A':'C','secret':_0x374e2f[_0xe896('0x117')],'read':_0x374e2f['read'],'attachment':_0x374e2f[_0xe896('0xe8')]};})[_0xe896('0x70')]()};return ejs[_0xe896('0x139')](path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x13a'),'downloadInteraction.ejs'),{'interaction':_0x132625})[_0xe896('0x23')](function(_0x50d56b){var _0x5d05a4=path[_0xe896('0xeb')](_0x5bbc65,_0xe896('0x13b')+_0x81d8be['id']+'-'+_0x4b1785+_0xe896('0x13c'));var _0x9223f={'path':_0x5d05a4,'channel':_0xe896('0x12b'),'interactionId':_0x81d8be['id']};return pdf[_0xe896('0x13d')](_0x50d56b,_0x9223f);})[_0xe896('0x23')](function(){return new BPromise(function(_0x399827,_0x2a2fa5){zipdir(_0x5bbc65,{'saveTo':_0x2a3489},function(_0x21d235,_0x3d7f5f){if(_0x21d235)return _0x2a2fa5(_0x21d235);return _0x399827(_0x3d7f5f);});})[_0xe896('0x23')](function(){return new BPromise(function(_0x313eb0,_0x54a741){rimraf(_0x5bbc65,function(_0x3edee9){if(_0x3edee9)_0x54a741(_0x3edee9);return _0x313eb0();});});})[_0xe896('0x23')](function(){return _0x15c4f9['download'](_0x2a3489,_0x194003,function(_0x42163c){if(_0x42163c){console[_0xe896('0x13e')]('err',_0x42163c);}else{fs[_0xe896('0x13f')](_0x2a3489);}});});});}else{return _0x15c4f9[_0xe896('0x2e')](0xc8);}})[_0xe896('0x45')](handleError(_0x15c4f9,null));}; \ No newline at end of file +var _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x3d2ebf,_0x492745){var _0x3ec55c=function(_0x17f9d9){while(--_0x17f9d9){_0x3d2ebf['push'](_0x3d2ebf['shift']());}};_0x3ec55c(++_0x492745);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 88cb8dd..92156c6 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 _0x37fc=['setMaxListeners','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x5dc606,_0x17e9bf){var _0x5c4706=function(_0x10c4a4){while(--_0x10c4a4){_0x5dc606['push'](_0x5dc606['shift']());}};_0x5c4706(++_0x17e9bf);}(_0x37fc,0x7a));var _0xc37f=function(_0x7f4f24,_0x483077){_0x7f4f24=_0x7f4f24-0x0;var _0x295488=_0x37fc[_0x7f4f24];return _0x295488;};'use strict';var EventEmitter=require(_0xc37f('0x0'));var ChatInteraction=require(_0xc37f('0x1'))['db'][_0xc37f('0x2')];var ChatMessage=require(_0xc37f('0x1'))['db'][_0xc37f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc37f('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc37f('0x5')};function emitEvent(_0x569f0f){return function(_0x498bd4,_0x5a4931,_0x5b7ad1){_0x498bd4[_0xc37f('0x6')]({'attributes':['id'],'raw':!![]})[_0xc37f('0x7')](function(_0x1959f2){_0x498bd4[_0xc37f('0x8')]('Users',_0x1959f2[_0xc37f('0x9')](function(_0xd19813){return{'id':_0xd19813['id']};}));return ChatMessage[_0xc37f('0xa')]({'where':{'ChatInteractionId':_0x498bd4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc37f('0x7')](function(_0x59f403){_0x498bd4[_0xc37f('0x8')](_0xc37f('0xb'),_0x59f403[_0xc37f('0xc')]);ChatInteractionEvents[_0xc37f('0xd')](_0x569f0f+':'+_0x498bd4['id'],_0x498bd4);ChatInteractionEvents['emit'](_0x569f0f,_0x498bd4);_0x5b7ad1(null);})[_0xc37f('0xe')](_0x5b7ad1(null));};}for(var e in events){if(events[_0xc37f('0xf')](e)){var event=events[e];ChatInteraction[_0xc37f('0x10')](e,emitEvent(event));}}module[_0xc37f('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x3032=['Users','findAll','unreadMessages','length','emit','catch','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x4fa0e6,_0x2c483c){var _0x15f33b=function(_0x2163d0){while(--_0x2163d0){_0x4fa0e6['push'](_0x4fa0e6['shift']());}};_0x15f33b(++_0x2c483c);}(_0x3032,0x15f));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2303('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x2303('0x1'))['db'][_0x2303('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2303('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2303('0x4'),'afterDestroy':_0x2303('0x5')};function emitEvent(_0x21339d){return function(_0x42e00b,_0x1741e5,_0x178f8e){_0x42e00b[_0x2303('0x6')]({'attributes':['id'],'raw':!![]})[_0x2303('0x7')](function(_0x5f4467){_0x42e00b[_0x2303('0x8')](_0x2303('0x9'),_0x5f4467['map'](function(_0x56e98e){return{'id':_0x56e98e['id']};}));return ChatMessage[_0x2303('0xa')]({'where':{'ChatInteractionId':_0x42e00b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2303('0x7')](function(_0x154df6){_0x42e00b[_0x2303('0x8')](_0x2303('0xb'),_0x154df6[_0x2303('0xc')]);ChatInteractionEvents[_0x2303('0xd')](_0x21339d+':'+_0x42e00b['id'],_0x42e00b);ChatInteractionEvents['emit'](_0x21339d,_0x42e00b);_0x178f8e(null);})[_0x2303('0xe')](_0x178f8e(null));};}for(var e in events){if(events['hasOwnProperty'](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 476bf8b..86d6af6 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 _0x2085=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x568257,_0x12ae64){var _0x5ca887=function(_0x398b93){while(--_0x398b93){_0x568257['push'](_0x568257['shift']());}};_0x5ca887(++_0x12ae64);}(_0x2085,0x135));var _0x5208=function(_0x1639be,_0x4ac980){_0x1639be=_0x1639be-0x0;var _0x4af3e1=_0x2085[_0x1639be];return _0x4af3e1;};'use strict';var _=require('lodash');var util=require(_0x5208('0x0'));var logger=require(_0x5208('0x1'))('api');var moment=require(_0x5208('0x2'));var BPromise=require(_0x5208('0x3'));var rp=require(_0x5208('0x4'));var fs=require('fs');var path=require(_0x5208('0x5'));var rimraf=require(_0x5208('0x6'));var config=require(_0x5208('0x7'));var attributes=require(_0x5208('0x8'));module[_0x5208('0x9')]=function(_0x3d1541,_0x4bf9c0){return _0x3d1541[_0x5208('0xa')](_0x5208('0xb'),attributes,{'tableName':_0x5208('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f60aa,_0x58fd6e,_0x2dff06){if(_0x2f60aa[_0x5208('0xd')](_0x5208('0xe'))){_0x2f60aa['closedAt']=moment()[_0x5208('0xf')](_0x5208('0x10'));}_0x2dff06(null,_0x2f60aa);}},'charset':_0x5208('0x11'),'collate':_0x5208('0x12')});}; \ No newline at end of file +var _0x1114=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x1114,0x104));var _0x4111=function(_0x4b075e,_0x57874c){_0x4b075e=_0x4b075e-0x0;var _0x31385c=_0x1114[_0x4b075e];return _0x31385c;};'use strict';var _=require(_0x4111('0x0'));var util=require('util');var logger=require(_0x4111('0x1'))(_0x4111('0x2'));var moment=require(_0x4111('0x3'));var BPromise=require(_0x4111('0x4'));var rp=require(_0x4111('0x5'));var fs=require('fs');var path=require(_0x4111('0x6'));var rimraf=require(_0x4111('0x7'));var config=require(_0x4111('0x8'));var attributes=require(_0x4111('0x9'));module[_0x4111('0xa')]=function(_0x11c13c,_0x1961c2){return _0x11c13c['define'](_0x4111('0xb'),attributes,{'tableName':_0x4111('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a5744,_0x256b7a,_0x3f4712){if(_0x1a5744['changed'](_0x4111('0xd'))){_0x1a5744[_0x4111('0xe')]=moment()[_0x4111('0xf')](_0x4111('0x10'));}_0x3f4712(null,_0x1a5744);}},'charset':_0x4111('0x11'),'collate':_0x4111('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 0284c7b..1f35b83 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 _0xc365=['redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x225838,_0x29b914){var _0x1da96b=function(_0x3e54b3){while(--_0x3e54b3){_0x225838['push'](_0x225838['shift']());}};_0x1da96b(++_0x29b914);}(_0xc365,0xa0));var _0x5c36=function(_0x20f043,_0xfe363e){_0x20f043=_0x20f043-0x0;var _0x110e4b=_0xc365[_0x20f043];return _0x110e4b;};'use strict';var _=require(_0x5c36('0x0'));var util=require('util');var moment=require(_0x5c36('0x1'));var BPromise=require(_0x5c36('0x2'));var rs=require(_0x5c36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c36('0x4'))['db'];var utils=require(_0x5c36('0x5'));var logger=require(_0x5c36('0x6'))(_0x5c36('0x7'));var config=require(_0x5c36('0x8'));var jayson=require(_0x5c36('0x9'));var client=jayson[_0x5c36('0xa')][_0x5c36('0xb')]({'port':0x232a});config[_0x5c36('0xc')]=_[_0x5c36('0xd')](config[_0x5c36('0xc')],{'host':_0x5c36('0xe'),'port':0x18eb});var socket=require(_0x5c36('0xf'))(new Redis(config[_0x5c36('0xc')]));require('./chatInteraction.socket')[_0x5c36('0x10')](socket);function respondWithRpcPromise(_0x2ed42d,_0x2cd804,_0x5330b3){return new BPromise(function(_0x25c3e9,_0x2f5ca1){return client['request'](_0x2ed42d,_0x5330b3)[_0x5c36('0x11')](function(_0x8fd662){logger[_0x5c36('0x12')](_0x5c36('0x13'),_0x2cd804,_0x5c36('0x14'));logger['debug'](_0x5c36('0x15'),_0x2cd804,_0x5c36('0x14'),JSON[_0x5c36('0x16')](_0x8fd662));if(_0x8fd662[_0x5c36('0x17')]){if(_0x8fd662[_0x5c36('0x17')][_0x5c36('0x18')]===0x1f4){logger['error'](_0x5c36('0x13'),_0x2cd804,_0x8fd662[_0x5c36('0x17')][_0x5c36('0x19')]);return _0x2f5ca1(_0x8fd662[_0x5c36('0x17')][_0x5c36('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2cd804,_0x8fd662[_0x5c36('0x17')][_0x5c36('0x19')]);return _0x25c3e9(_0x8fd662[_0x5c36('0x17')]['message']);}else{logger[_0x5c36('0x12')](_0x5c36('0x13'),_0x2cd804,'request\x20sent');_0x25c3e9(_0x8fd662[_0x5c36('0x1a')][_0x5c36('0x19')]);}})['catch'](function(_0x6d6cd3){logger[_0x5c36('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2cd804,_0x6d6cd3);_0x2f5ca1(_0x6d6cd3);});});}exports[_0x5c36('0x1b')]=function(_0x3f2ca0){var _0x4033c0=this;return new Promise(function(_0x418c5f,_0x15766f){return db[_0x5c36('0x1c')]['update'](_0x3f2ca0[_0x5c36('0x1d')],{'raw':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x20')]||null:null,'attributes':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x21')]||null:null,'limit':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x22')]||null:null})[_0x5c36('0x11')](function(_0x40c105){logger[_0x5c36('0x12')](_0x5c36('0x1b'),_0x3f2ca0);logger[_0x5c36('0x23')](_0x5c36('0x1b'),_0x3f2ca0,JSON[_0x5c36('0x16')](_0x40c105));_0x418c5f(_0x40c105);})[_0x5c36('0x24')](function(_0x2bd581){logger[_0x5c36('0x17')]('UpdateChatInteraction',_0x2bd581[_0x5c36('0x19')],_0x3f2ca0);_0x15766f(_0x4033c0[_0x5c36('0x17')](0x1f4,_0x2bd581[_0x5c36('0x19')]));});});};exports[_0x5c36('0x25')]=function(_0x236c48){return new Promise(function(_0x3561db,_0x3cfb39){return db[_0x5c36('0x1c')][_0x5c36('0x26')]({'where':_0x236c48[_0x5c36('0x1e')]?_0x236c48['options']['where']||null:null})[_0x5c36('0x11')](function(_0x85e625){if(_0x85e625){return _0x85e625[_0x5c36('0x27')](_0x236c48['body'][_0x5c36('0x28')],_[_0x5c36('0x29')](_0x236c48[_0x5c36('0x1d')],['ids','id'])||{});}})['spread'](function(_0x46d46e){logger[_0x5c36('0x12')](_0x5c36('0x2a'),_0x236c48);logger[_0x5c36('0x23')]('AddTags',_0x236c48,JSON[_0x5c36('0x16')](_0x46d46e));_0x3561db(_0x46d46e);})[_0x5c36('0x24')](function(_0x39ffd4){logger[_0x5c36('0x17')](_0x5c36('0x2a'),_0x39ffd4['message'],_0x236c48);_0x3cfb39(_this[_0x5c36('0x17')](0x1f4,_0x39ffd4[_0x5c36('0x19')]));});});}; \ No newline at end of file +var _0x2030=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','redis','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','body','AddTags','lodash','util'];(function(_0x368056,_0x3817b7){var _0x586fb6=function(_0x48f3ce){while(--_0x48f3ce){_0x368056['push'](_0x368056['shift']());}};_0x586fb6(++_0x3817b7);}(_0x2030,0x1c1));var _0x0203=function(_0x429d19,_0x17710b){_0x429d19=_0x429d19-0x0;var _0x2c90db=_0x2030[_0x429d19];return _0x2c90db;};'use strict';var _=require(_0x0203('0x0'));var util=require(_0x0203('0x1'));var moment=require(_0x0203('0x2'));var BPromise=require(_0x0203('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0203('0x4'));var db=require(_0x0203('0x5'))['db'];var utils=require(_0x0203('0x6'));var logger=require('../../config/logger')(_0x0203('0x7'));var config=require(_0x0203('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0203('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0203('0xa')](config[_0x0203('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0203('0xc'))(new Redis(config[_0x0203('0xb')]));require('./chatInteraction.socket')[_0x0203('0xd')](socket);function respondWithRpcPromise(_0x35d892,_0x463da4,_0x59d175){return new BPromise(function(_0x4c68c0,_0x21b7e9){return client[_0x0203('0xe')](_0x35d892,_0x59d175)[_0x0203('0xf')](function(_0x5923ab){logger['info'](_0x0203('0x10'),_0x463da4,'request\x20sent');logger[_0x0203('0x11')](_0x0203('0x12'),_0x463da4,'request\x20sent',JSON[_0x0203('0x13')](_0x5923ab));if(_0x5923ab[_0x0203('0x14')]){if(_0x5923ab['error']['code']===0x1f4){logger[_0x0203('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x463da4,_0x5923ab[_0x0203('0x14')][_0x0203('0x15')]);return _0x21b7e9(_0x5923ab[_0x0203('0x14')][_0x0203('0x15')]);}logger['error'](_0x0203('0x10'),_0x463da4,_0x5923ab['error'][_0x0203('0x15')]);return _0x4c68c0(_0x5923ab['error'][_0x0203('0x15')]);}else{logger[_0x0203('0x16')](_0x0203('0x10'),_0x463da4,_0x0203('0x17'));_0x4c68c0(_0x5923ab[_0x0203('0x18')][_0x0203('0x15')]);}})[_0x0203('0x19')](function(_0x9af66){logger[_0x0203('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x463da4,_0x9af66);_0x21b7e9(_0x9af66);});});}exports['UpdateChatInteraction']=function(_0x4edc56){var _0x24f928=this;return new Promise(function(_0x57bb80,_0x1bd228){return db[_0x0203('0x1a')][_0x0203('0x1b')](_0x4edc56['body'],{'raw':_0x4edc56[_0x0203('0x1c')]?_0x4edc56[_0x0203('0x1c')][_0x0203('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4edc56[_0x0203('0x1c')]?_0x4edc56[_0x0203('0x1c')][_0x0203('0x1e')]||null:null,'attributes':_0x4edc56[_0x0203('0x1c')]?_0x4edc56[_0x0203('0x1c')][_0x0203('0x1f')]||null:null,'limit':_0x4edc56['options']?_0x4edc56[_0x0203('0x1c')][_0x0203('0x20')]||null:null})[_0x0203('0xf')](function(_0x612b34){logger[_0x0203('0x16')]('UpdateChatInteraction',_0x4edc56);logger['debug'](_0x0203('0x21'),_0x4edc56,JSON[_0x0203('0x13')](_0x612b34));_0x57bb80(_0x612b34);})[_0x0203('0x19')](function(_0x4ca18a){logger['error'](_0x0203('0x21'),_0x4ca18a[_0x0203('0x15')],_0x4edc56);_0x1bd228(_0x24f928[_0x0203('0x14')](0x1f4,_0x4ca18a[_0x0203('0x15')]));});});};exports[_0x0203('0x22')]=function(_0x3216bc){return new Promise(function(_0x3ebcbf,_0x1f2989){return db[_0x0203('0x1a')][_0x0203('0x23')]({'where':_0x3216bc[_0x0203('0x1c')]?_0x3216bc[_0x0203('0x1c')][_0x0203('0x1e')]||null:null})[_0x0203('0xf')](function(_0x90234){if(_0x90234){return _0x90234[_0x0203('0x24')](_0x3216bc['body'][_0x0203('0x25')],_[_0x0203('0x26')](_0x3216bc[_0x0203('0x27')],[_0x0203('0x25'),'id'])||{});}})['spread'](function(_0x5862a4){logger[_0x0203('0x16')](_0x0203('0x28'),_0x3216bc);logger['debug'](_0x0203('0x28'),_0x3216bc,JSON[_0x0203('0x13')](_0x5862a4));_0x3ebcbf(_0x5862a4);})[_0x0203('0x19')](function(_0x3d215d){logger['error'](_0x0203('0x28'),_0x3d215d[_0x0203('0x15')],_0x3216bc);_0x1f2989(_this[_0x0203('0x14')](0x1f4,_0x3d215d[_0x0203('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 26a2c47..cf3581c 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 _0x61df=['emit','removeListener','register','chatInteraction:','update'];(function(_0x28489b,_0x3c80ff){var _0x3948c6=function(_0xa82239){while(--_0xa82239){_0x28489b['push'](_0x28489b['shift']());}};_0x3948c6(++_0x3c80ff);}(_0x61df,0xbd));var _0xf61d=function(_0x3e5fc9,_0x2105b1){_0x3e5fc9=_0x3e5fc9-0x0;var _0x15799d=_0x61df[_0x3e5fc9];return _0x15799d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xf61d('0x0')];function createListener(_0x449fc,_0x5d85f0){return function(_0x40127d){_0x5d85f0[_0xf61d('0x1')](_0x449fc,_0x40127d);};}function removeListener(_0x485a55,_0x3170e7){return function(){ChatInteractionEvents[_0xf61d('0x2')](_0x485a55,_0x3170e7);};}exports[_0xf61d('0x3')]=function(_0x458eb9){for(var _0x2d0791=0x0,_0x3ac0ec=events['length'];_0x2d0791<_0x3ac0ec;_0x2d0791++){var _0x42b382=events[_0x2d0791];var _0x49523e=createListener(_0xf61d('0x4')+_0x42b382,_0x458eb9);ChatInteractionEvents['on'](_0x42b382,_0x49523e);}}; \ No newline at end of file +var _0x372b=['length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener','register'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x372b,0x18a));var _0xb372=function(_0x4d7708,_0x33a2ad){_0x4d7708=_0x4d7708-0x0;var _0x5466a7=_0x372b[_0x4d7708];return _0x5466a7;};'use strict';var ChatInteractionEvents=require(_0xb372('0x0'));var events=[_0xb372('0x1'),'remove',_0xb372('0x2')];function createListener(_0x41734c,_0x4706d0){return function(_0xbd4c2b){_0x4706d0[_0xb372('0x3')](_0x41734c,_0xbd4c2b);};}function removeListener(_0x458bf9,_0x4fe3cb){return function(){ChatInteractionEvents[_0xb372('0x4')](_0x458bf9,_0x4fe3cb);};}exports[_0xb372('0x5')]=function(_0xa1eefa){for(var _0x5c8510=0x0,_0x39c4ac=events[_0xb372('0x6')];_0x5c8510<_0x39c4ac;_0x5c8510++){var _0x1a6925=events[_0x5c8510];var _0x6a7a15=createListener(_0xb372('0x7')+_0x1a6925,_0xa1eefa);ChatInteractionEvents['on'](_0x1a6925,_0x6a7a15);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ab7d23b..fc45254 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 _0xb718=['multer','util','path','connect-timeout','express','Router','./chatInteraction.controller','get','index','isAuthenticated','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports'];(function(_0x247b2c,_0x52354c){var _0x14986e=function(_0xe60b3d){while(--_0xe60b3d){_0x247b2c['push'](_0x247b2c['shift']());}};_0x14986e(++_0x52354c);}(_0xb718,0xff));var _0x8b71=function(_0x3cc6bb,_0x363a56){_0x3cc6bb=_0x3cc6bb-0x0;var _0x47337b=_0xb718[_0x3cc6bb];return _0x47337b;};'use strict';var multer=require(_0x8b71('0x0'));var util=require(_0x8b71('0x1'));var path=require(_0x8b71('0x2'));var timeout=require(_0x8b71('0x3'));var express=require(_0x8b71('0x4'));var router=express[_0x8b71('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(_0x8b71('0x6'));router[_0x8b71('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b71('0x8')]);router[_0x8b71('0x7')]('/describe',auth[_0x8b71('0x9')](),controller['describe']);router[_0x8b71('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x8b71('0xa')]);router[_0x8b71('0x7')](_0x8b71('0xb'),auth[_0x8b71('0xc')](),controller[_0x8b71('0xd')]);router[_0x8b71('0x7')](_0x8b71('0xe'),auth['isAuthenticated'](),controller[_0x8b71('0xf')]);router[_0x8b71('0x7')](_0x8b71('0x10'),auth[_0x8b71('0xc')](),controller[_0x8b71('0x11')]);router['get'](_0x8b71('0x12'),auth[_0x8b71('0x9')](),controller[_0x8b71('0x13')]);router[_0x8b71('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8b71('0x14')](_0x8b71('0x15'),auth[_0x8b71('0x9')](),controller[_0x8b71('0x16')]);var upload=multer({'storage':multer[_0x8b71('0x17')]({'destination':function(_0x4746b7,_0x424189,_0x2356f9){_0x2356f9(null,path[_0x8b71('0x18')](config[_0x8b71('0x19')],_0x8b71('0x1a')));},'filename':function(_0x2854be,_0x20b342,_0x219704){_0x219704(null,util[_0x8b71('0x1b')]('%s-%s',Date[_0x8b71('0x1c')](),_0x20b342[_0x8b71('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x8b71('0x1e'),upload[_0x8b71('0x1f')](_0x8b71('0x20')),controller[_0x8b71('0x21')]);router[_0x8b71('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x8b71('0x22')]);router['post'](_0x8b71('0x23'),auth['isAuthenticated'](),interaction[_0x8b71('0x24')](_0x8b71('0x25'),_0x8b71('0x26')),controller['addTags']);router[_0x8b71('0x27')]('/:id',auth[_0x8b71('0x9')](),interaction['tracked'](_0x8b71('0x25'),_0x8b71('0x28')),controller[_0x8b71('0x29')]);router[_0x8b71('0x27')](_0x8b71('0x2a'),controller[_0x8b71('0x2b')]);router['put'](_0x8b71('0x2c'),auth[_0x8b71('0xc')](),controller['abandon']);router['put'](_0x8b71('0x2d'),controller[_0x8b71('0x2e')]);router['delete']('/:id',auth[_0x8b71('0x9')](),interaction['tracked'](_0x8b71('0x25'),_0x8b71('0x2f')),controller['destroy']);router[_0x8b71('0x30')](_0x8b71('0x23'),auth[_0x8b71('0x9')](),controller[_0x8b71('0x31')]);module[_0x8b71('0x32')]=router; \ No newline at end of file +var _0xd9f8=['destroy','/:id/tags','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','/:id','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy'];(function(_0x209e4b,_0x1400ea){var _0x25d7d9=function(_0x84faa5){while(--_0x84faa5){_0x209e4b['push'](_0x209e4b['shift']());}};_0x25d7d9(++_0x1400ea);}(_0xd9f8,0x101));var _0x8d9f=function(_0x55c288,_0x52d730){_0x55c288=_0x55c288-0x0;var _0x1ecaea=_0xd9f8[_0x55c288];return _0x1ecaea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d9f('0x0'));var timeout=require(_0x8d9f('0x1'));var express=require('express');var router=express[_0x8d9f('0x2')]();var fs_extra=require(_0x8d9f('0x3'));var auth=require(_0x8d9f('0x4'));var interaction=require(_0x8d9f('0x5'));var config=require('../../config/environment');var controller=require(_0x8d9f('0x6'));router[_0x8d9f('0x7')]('/',auth[_0x8d9f('0x8')](),controller[_0x8d9f('0x9')]);router['get'](_0x8d9f('0xa'),auth[_0x8d9f('0x8')](),controller['describe']);router[_0x8d9f('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x8d9f('0xb')]);router[_0x8d9f('0x7')](_0x8d9f('0xc'),auth[_0x8d9f('0xd')](),controller[_0x8d9f('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x8d9f('0xf')]);router[_0x8d9f('0x7')](_0x8d9f('0x10'),auth[_0x8d9f('0xd')](),controller[_0x8d9f('0x11')]);router[_0x8d9f('0x7')]('/:id/download',auth[_0x8d9f('0x8')](),controller[_0x8d9f('0x12')]);router[_0x8d9f('0x13')]('/',auth['isAuthenticated'](),controller[_0x8d9f('0x14')]);router[_0x8d9f('0x13')]('/:id/vidaoo',auth[_0x8d9f('0x8')](),controller[_0x8d9f('0x15')]);var upload=multer({'storage':multer[_0x8d9f('0x16')]({'destination':function(_0x15178c,_0x3efcf7,_0x1f6b22){_0x1f6b22(null,path['join'](config[_0x8d9f('0x17')],_0x8d9f('0x18')));},'filename':function(_0x3777e7,_0x5038c3,_0x51d802){_0x51d802(null,util[_0x8d9f('0x19')](_0x8d9f('0x1a'),Date[_0x8d9f('0x1b')](),_0x5038c3[_0x8d9f('0x1c')][_0x8d9f('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8d9f('0x13')]('/:id/attachment_upload',upload[_0x8d9f('0x1e')]('file'),controller[_0x8d9f('0x1f')]);router[_0x8d9f('0x13')](_0x8d9f('0x20'),auth[_0x8d9f('0xd')](),controller[_0x8d9f('0x21')]);router[_0x8d9f('0x13')]('/:id/tags',auth[_0x8d9f('0x8')](),interaction[_0x8d9f('0x22')](_0x8d9f('0x23'),_0x8d9f('0x24')),controller['addTags']);router['put'](_0x8d9f('0x25'),auth[_0x8d9f('0x8')](),interaction[_0x8d9f('0x22')](_0x8d9f('0x23'),_0x8d9f('0x26')),controller[_0x8d9f('0x27')]);router[_0x8d9f('0x28')](_0x8d9f('0x29'),controller[_0x8d9f('0x2a')]);router[_0x8d9f('0x28')](_0x8d9f('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x8d9f('0x2c')]);router[_0x8d9f('0x28')](_0x8d9f('0x2d'),controller[_0x8d9f('0x2e')]);router[_0x8d9f('0x2f')](_0x8d9f('0x25'),auth[_0x8d9f('0x8')](),interaction[_0x8d9f('0x22')](_0x8d9f('0x23'),_0x8d9f('0x30')),controller[_0x8d9f('0x31')]);router[_0x8d9f('0x2f')](_0x8d9f('0x32'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 2e2dfc5..b52b88e 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 _0x417d=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0xa4ae32,_0x289050){var _0x506fb8=function(_0x129488){while(--_0x129488){_0xa4ae32['push'](_0xa4ae32['shift']());}};_0x506fb8(++_0x289050);}(_0x417d,0x141));var _0xd417=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x417d[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xd417('0x0'));module[_0xd417('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd417('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd417('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd417('0x4')]}}; \ No newline at end of file +var _0xf609=['exports','medium','BOOLEAN','INTEGER'];(function(_0x1d93b1,_0x2fedaf){var _0x248a7a=function(_0x26a6be){while(--_0x26a6be){_0x1d93b1['push'](_0x1d93b1['shift']());}};_0x248a7a(++_0x2fedaf);}(_0xf609,0x150));var _0x9f60=function(_0x46ccd2,_0xf04613){_0x46ccd2=_0x46ccd2-0x0;var _0x1d5c6f=_0xf609[_0x46ccd2];return _0x1d5c6f;};'use strict';var Sequelize=require('sequelize');module[_0x9f60('0x0')]={'body':{'type':Sequelize['TEXT'](_0x9f60('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9f60('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9f60('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4f299bc..ba8ed05 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 _0x1aaf=['resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','user','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x1aaf,0x74));var _0xf1aa=function(_0x3b1474,_0x48a3b8){_0x3b1474=_0x3b1474-0x0;var _0x5060b9=_0x1aaf[_0x3b1474];return _0x5060b9;};'use strict';var emlformat=require(_0xf1aa('0x0'));var rimraf=require(_0xf1aa('0x1'));var zipdir=require(_0xf1aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf1aa('0x4'));var util=require(_0xf1aa('0x5'));var path=require(_0xf1aa('0x6'));var sox=require(_0xf1aa('0x7'));var csv=require(_0xf1aa('0x8'));var ejs=require(_0xf1aa('0x9'));var fs=require('fs');var fs_extra=require(_0xf1aa('0xa'));var _=require(_0xf1aa('0xb'));var squel=require(_0xf1aa('0xc'));var crypto=require(_0xf1aa('0xd'));var jsforce=require(_0xf1aa('0xe'));var deskjs=require(_0xf1aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf1aa('0x10'));var Papa=require('papaparse');var Redis=require(_0xf1aa('0x11'));var authService=require(_0xf1aa('0x12'));var qs=require(_0xf1aa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1aa('0x14'));var logger=require(_0xf1aa('0x15'))(_0xf1aa('0x16'));var utils=require(_0xf1aa('0x17'));var config=require(_0xf1aa('0x18'));var licenseUtil=require(_0xf1aa('0x19'));var db=require(_0xf1aa('0x1a'))['db'];config[_0xf1aa('0x1b')]=_[_0xf1aa('0x1c')](config[_0xf1aa('0x1b')],{'host':_0xf1aa('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf1aa('0x1e'))[_0xf1aa('0x1f')](socket);function respondWithStatusCode(_0x250626,_0x58b77b){_0x58b77b=_0x58b77b||0xcc;return function(_0x28f44d){if(_0x28f44d){return _0x250626[_0xf1aa('0x20')](_0x58b77b);}return _0x250626[_0xf1aa('0x21')](_0x58b77b)[_0xf1aa('0x22')]();};}function respondWithResult(_0x2d80ef,_0x3a07db){_0x3a07db=_0x3a07db||0xc8;return function(_0x7a475f){if(_0x7a475f){return _0x2d80ef[_0xf1aa('0x21')](_0x3a07db)['json'](_0x7a475f);}};}function respondWithFilteredResult(_0x560b0d,_0x28aa11){return function(_0x250a29){if(_0x250a29){var _0x2d3571=typeof _0x28aa11[_0xf1aa('0x23')]===_0xf1aa('0x24')&&typeof _0x28aa11[_0xf1aa('0x25')]===_0xf1aa('0x24');var _0x271e61=_0x250a29[_0xf1aa('0x26')];var _0x258cab=_0x2d3571?0x0:_0x28aa11[_0xf1aa('0x23')];var _0x1334b6=_0x2d3571?_0x250a29[_0xf1aa('0x26')]:_0x28aa11[_0xf1aa('0x23')]+_0x28aa11[_0xf1aa('0x25')];var _0x1f1700;if(_0x1334b6>=_0x271e61){_0x1334b6=_0x271e61;_0x1f1700=0xc8;}else{_0x1f1700=0xce;}_0x560b0d[_0xf1aa('0x21')](_0x1f1700);return _0x560b0d[_0xf1aa('0x27')]('Content-Range',_0x258cab+'-'+_0x1334b6+'/'+_0x271e61)[_0xf1aa('0x28')](_0x250a29);}return null;};}function patchUpdates(_0x5c0ec3){return function(_0x2e6295){try{jsonpatch['apply'](_0x2e6295,_0x5c0ec3,!![]);}catch(_0x12ca48){return BPromise[_0xf1aa('0x29')](_0x12ca48);}return _0x2e6295[_0xf1aa('0x2a')]();};}function saveUpdates(_0x464c33,_0x4226b6){return function(_0x46a409){if(_0x46a409){return _0x46a409[_0xf1aa('0x2b')](_0x464c33)['then'](function(_0x4c8202){return _0x4c8202;});}return null;};}function removeEntity(_0xf18db2,_0xfbdf1e){return function(_0x52dce9){if(_0x52dce9){return _0x52dce9[_0xf1aa('0x2c')]()[_0xf1aa('0x2d')](function(){_0xf18db2[_0xf1aa('0x21')](0xcc)[_0xf1aa('0x22')]();});}};}function handleEntityNotFound(_0x501f93,_0x910148){return function(_0x55c095){if(!_0x55c095){_0x501f93['sendStatus'](0x194);}return _0x55c095;};}function handleError(_0x3efecb,_0x45cdc5){_0x45cdc5=_0x45cdc5||0x1f4;return function(_0x3907bc){logger['error'](_0x3907bc['stack']);if(_0x3907bc[_0xf1aa('0x2e')]){delete _0x3907bc[_0xf1aa('0x2e')];}_0x3efecb['status'](_0x45cdc5)[_0xf1aa('0x2f')](_0x3907bc);};}exports[_0xf1aa('0x30')]=function(_0x3e93c3,_0x55d734){var _0x2f10ee={},_0x50d82a={},_0x3e27ba={'count':0x0,'rows':[]};var _0x4178a=_[_0xf1aa('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x15189d){return{'name':_0x15189d[_0xf1aa('0x32')],'type':_0x15189d[_0xf1aa('0x33')]['key']};});_0x50d82a[_0xf1aa('0x34')]=_['map'](_0x4178a,_0xf1aa('0x2e'));_0x50d82a[_0xf1aa('0x35')]=_[_0xf1aa('0x36')](_0x3e93c3[_0xf1aa('0x35')]);_0x50d82a['filters']=_[_0xf1aa('0x37')](_0x50d82a[_0xf1aa('0x34')],_0x50d82a['query']);_0x2f10ee[_0xf1aa('0x38')]=_[_0xf1aa('0x37')](_0x50d82a[_0xf1aa('0x34')],qs[_0xf1aa('0x39')](_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x39')]));_0x2f10ee['attributes']=_0x2f10ee[_0xf1aa('0x38')][_0xf1aa('0x3a')]?_0x2f10ee[_0xf1aa('0x38')]:_0x50d82a['model'];if(!_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x3b')]('nolimit')){_0x2f10ee[_0xf1aa('0x25')]=qs[_0xf1aa('0x25')](_0x3e93c3['query'][_0xf1aa('0x25')]);_0x2f10ee[_0xf1aa('0x23')]=qs[_0xf1aa('0x23')](_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x23')]);}_0x2f10ee['order']=qs[_0xf1aa('0x3c')](_0x3e93c3['query'][_0xf1aa('0x3c')]);_0x2f10ee[_0xf1aa('0x3d')]=qs[_0xf1aa('0x3e')](_['pick'](_0x3e93c3[_0xf1aa('0x35')],_0x50d82a[_0xf1aa('0x3e')]),_0x4178a);if(_0x3e93c3['query'][_0xf1aa('0x3f')]){_0x2f10ee['where']=_['merge'](_0x2f10ee[_0xf1aa('0x3d')],{'$or':_[_0xf1aa('0x31')](_0x4178a,function(_0xfccab){if(_0xfccab[_0xf1aa('0x33')]!==_0xf1aa('0x40')){var _0x18ef4a={};_0x18ef4a[_0xfccab[_0xf1aa('0x2e')]]={'$like':'%'+_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x3f')]+'%'};return _0x18ef4a;}})});}_0x2f10ee=_['merge']({},_0x2f10ee,_0x3e93c3[_0xf1aa('0x41')]);var _0x28f5e8={'where':_0x2f10ee[_0xf1aa('0x3d')]};return db[_0xf1aa('0x42')][_0xf1aa('0x26')](_0x28f5e8)[_0xf1aa('0x2d')](function(_0x17235b){_0x3e27ba[_0xf1aa('0x26')]=_0x17235b;if(_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x43')]){_0x2f10ee[_0xf1aa('0x44')]=[{'all':!![]}];}return db[_0xf1aa('0x42')][_0xf1aa('0x45')](_0x2f10ee);})[_0xf1aa('0x2d')](function(_0x5c7686){_0x3e27ba[_0xf1aa('0x46')]=_0x5c7686;return _0x3e27ba;})['then'](respondWithFilteredResult(_0x55d734,_0x2f10ee))['catch'](handleError(_0x55d734,null));};exports[_0xf1aa('0x47')]=function(_0x19341f,_0x4d926f){var _0x5cf65a={'raw':!![],'where':{'id':_0x19341f[_0xf1aa('0x48')]['id']}},_0xd87fa9={};_0xd87fa9['model']=_[_0xf1aa('0x36')](db[_0xf1aa('0x42')][_0xf1aa('0x49')]);_0xd87fa9[_0xf1aa('0x35')]=_[_0xf1aa('0x36')](_0x19341f[_0xf1aa('0x35')]);_0xd87fa9[_0xf1aa('0x3e')]=_[_0xf1aa('0x37')](_0xd87fa9[_0xf1aa('0x34')],_0xd87fa9[_0xf1aa('0x35')]);_0x5cf65a[_0xf1aa('0x38')]=_[_0xf1aa('0x37')](_0xd87fa9[_0xf1aa('0x34')],qs[_0xf1aa('0x39')](_0x19341f[_0xf1aa('0x35')]['fields']));_0x5cf65a['attributes']=_0x5cf65a[_0xf1aa('0x38')]['length']?_0x5cf65a[_0xf1aa('0x38')]:_0xd87fa9[_0xf1aa('0x34')];if(_0x19341f['query'][_0xf1aa('0x43')]){_0x5cf65a[_0xf1aa('0x44')]=[{'all':!![]}];}_0x5cf65a=_[_0xf1aa('0x4a')]({},_0x5cf65a,_0x19341f[_0xf1aa('0x41')]);return db[_0xf1aa('0x42')][_0xf1aa('0x4b')](_0x5cf65a)[_0xf1aa('0x2d')](handleEntityNotFound(_0x4d926f,null))['then'](respondWithResult(_0x4d926f,null))[_0xf1aa('0x4c')](handleError(_0x4d926f,null));};exports[_0xf1aa('0x4d')]=function(_0x13772e,_0x4519fd){return db[_0xf1aa('0x42')][_0xf1aa('0x4d')](_0x13772e[_0xf1aa('0x4e')],{})['then'](respondWithResult(_0x4519fd,0xc9))[_0xf1aa('0x4c')](handleError(_0x4519fd,null));};exports[_0xf1aa('0x2b')]=function(_0xe17d83,_0x575653){if(_0xe17d83[_0xf1aa('0x4e')]['id']){delete _0xe17d83[_0xf1aa('0x4e')]['id'];}return db['ChatInternalMessage'][_0xf1aa('0x4b')]({'where':{'id':_0xe17d83[_0xf1aa('0x48')]['id']}})[_0xf1aa('0x2d')](handleEntityNotFound(_0x575653,null))[_0xf1aa('0x2d')](saveUpdates(_0xe17d83[_0xf1aa('0x4e')],null))['then'](respondWithResult(_0x575653,null))[_0xf1aa('0x4c')](handleError(_0x575653,null));};exports[_0xf1aa('0x2c')]=function(_0x515b7c,_0x234d01){return db[_0xf1aa('0x42')][_0xf1aa('0x4b')]({'where':{'id':_0x515b7c[_0xf1aa('0x48')]['id']}})['then'](handleEntityNotFound(_0x234d01,null))[_0xf1aa('0x2d')](removeEntity(_0x234d01,null))[_0xf1aa('0x4c')](handleError(_0x234d01,null));};exports['describe']=function(_0x37d379,_0x1364c0){return db[_0xf1aa('0x42')][_0xf1aa('0x4f')]()[_0xf1aa('0x2d')](respondWithResult(_0x1364c0,null))['catch'](handleError(_0x1364c0,null));};function wrapUser(_0x213918){return function(_0x40c76f){var _0x5d1b43=_0x213918[_0xf1aa('0x50')]({'plain':!![]});_0x5d1b43[_0xf1aa('0x51')]=[];if(_0x40c76f){_0x5d1b43[_0xf1aa('0x52')]=_0x40c76f[_0xf1aa('0x53')];_0x5d1b43[_0xf1aa('0x54')]=_0x40c76f;}else{_0x5d1b43[_0xf1aa('0x52')]=moment(0x0)[_0xf1aa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d1b43[_0xf1aa('0x54')]={};}return _0x5d1b43;};}exports['getUsers']=function(_0x20c533,_0x3844e6,_0x355374){var _0x135ae8=[];return db[_0xf1aa('0x56')][_0xf1aa('0x45')]({'where':{'role':[_0xf1aa('0x57'),'admin',_0xf1aa('0x58')]},'attributes':['id',_0xf1aa('0x59'),_0xf1aa('0x2e'),'role','userpic',_0xf1aa('0x5a'),_0xf1aa('0x5b'),_0xf1aa('0x5c'),_0xf1aa('0x5d'),_0xf1aa('0x5e')],'order':qs['sort'](_0xf1aa('0x5f')),'include':[{'model':db[_0xf1aa('0x60')],'as':_0xf1aa('0x61'),'attributes':['id',_0xf1aa('0x2e'),_0xf1aa('0x33')],'through':{'attributes':[]}}]})[_0xf1aa('0x2d')](function(_0x444c66){if(_0x444c66){var _0x30f95d=_0x20c533[_0xf1aa('0x58')][_0xf1aa('0x50')]({'plain':!![]});if(!_0x30f95d)throw new Error(_0xf1aa('0x62'));if(_0x30f95d[_0xf1aa('0x63')]===_0xf1aa('0x58')){return db[_0xf1aa('0x64')]['find']({'where':{'name':_0xf1aa('0x65'),'userProfileId':_0x30f95d[_0xf1aa('0x66')]},'raw':!![]})[_0xf1aa('0x2d')](function(_0x66eaa4){if(_0x66eaa4){if(_0x66eaa4[_0xf1aa('0x67')]===0x0){return db[_0xf1aa('0x68')][_0xf1aa('0x45')]({'where':{'sectionId':_0x66eaa4['id']},'raw':!![]})['then'](function(_0x18413b){var _0x28905b=[];if(_[_0xf1aa('0x69')](_0x18413b)){_0x28905b=_[_0xf1aa('0x3f')](_0x444c66,function(_0x2c5294){if(_0x2c5294[_0xf1aa('0x63')]!==_0xf1aa('0x57')){return _0x2c5294;}});return _0x28905b;}else{for(var _0x5d097b=0x0;_0x5d097b<_0x444c66[_0xf1aa('0x3a')];_0x5d097b++){var _0x28b0e8=_0x444c66[_0x5d097b];if(_0x28b0e8[_0xf1aa('0x63')]===_0xf1aa('0x57')){var _0x38d04a=_[_0xf1aa('0x4b')](_0x18413b,function(_0x229e2c){return _0x229e2c[_0xf1aa('0x6a')]===_0x28b0e8['id'];});if(_0x38d04a)_0x28905b[_0xf1aa('0x6b')](_0x28b0e8);}else{_0x28905b[_0xf1aa('0x6b')](_0x28b0e8);}}return _0x28905b;}});}else{return _0x444c66;}}else{var _0x164741=_[_0xf1aa('0x3f')](_0x444c66,function(_0x273dec){if(_0x273dec[_0xf1aa('0x63')]!==_0xf1aa('0x57')){return _0x273dec;}});return _0x164741;}});}else{return _0x444c66;}}})[_0xf1aa('0x2d')](function(_0x534a14){var _0x51311b=[];if(_0x534a14){_0x135ae8=_0x534a14;for(var _0xa4d8f=0x0;_0xa4d8f<_0x534a14[_0xf1aa('0x3a')];_0xa4d8f+=0x1){_0x135ae8[_0xa4d8f]['messages']=[];_0x51311b[_0xf1aa('0x6b')](db['ChatInternalMessage'][_0xf1aa('0x4b')]({'where':{'FromId':[_0x20c533[_0xf1aa('0x58')]['id'],_0x534a14[_0xa4d8f]['id']],'ToId':[_0x20c533[_0xf1aa('0x58')]['id'],_0x534a14[_0xa4d8f]['id']],'ChatGroupId':null},'attributes':['id',_0xf1aa('0x53'),'FromId',_0xf1aa('0x6c'),_0xf1aa('0x6d'),'body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf1aa('0x2d')](wrapUser(_0x534a14[_0xa4d8f])));}return BPromise[_0xf1aa('0x6e')](_0x51311b);}return[];})[_0xf1aa('0x2d')](function(_0x4b8b5d){return{'rows':_0x4b8b5d,'count':_0x4b8b5d[_0xf1aa('0x3a')]};})[_0xf1aa('0x2d')](respondWithResult(_0x3844e6,null))['catch'](handleError(_0x3844e6,null));}; \ No newline at end of file +var _0x7202=['resourceId','push','user','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','findAll','agent','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','isEmpty'];(function(_0x353be4,_0x45221b){var _0x2449e3=function(_0x5058cb){while(--_0x5058cb){_0x353be4['push'](_0x353be4['shift']());}};_0x2449e3(++_0x45221b);}(_0x7202,0x75));var _0x2720=function(_0x35cc40,_0x48be67){_0x35cc40=_0x35cc40-0x0;var _0x4a4444=_0x7202[_0x35cc40];return _0x4a4444;};'use strict';var emlformat=require(_0x2720('0x0'));var rimraf=require(_0x2720('0x1'));var zipdir=require(_0x2720('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2720('0x3'));var moment=require(_0x2720('0x4'));var BPromise=require(_0x2720('0x5'));var Mustache=require(_0x2720('0x6'));var util=require(_0x2720('0x7'));var path=require(_0x2720('0x8'));var sox=require(_0x2720('0x9'));var csv=require(_0x2720('0xa'));var ejs=require(_0x2720('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2720('0xc'));var squel=require(_0x2720('0xd'));var crypto=require(_0x2720('0xe'));var jsforce=require(_0x2720('0xf'));var deskjs=require(_0x2720('0x10'));var toCsv=require(_0x2720('0xa'));var querystring=require('querystring');var Papa=require(_0x2720('0x11'));var Redis=require('ioredis');var authService=require(_0x2720('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2720('0x13'));var hardwareService=require(_0x2720('0x14'));var logger=require(_0x2720('0x15'))(_0x2720('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2720('0x17'))['db'];config[_0x2720('0x18')]=_[_0x2720('0x19')](config[_0x2720('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2720('0x18')]));require('./chatInternalMessage.socket')[_0x2720('0x1a')](socket);function respondWithStatusCode(_0x3fc74b,_0x386752){_0x386752=_0x386752||0xcc;return function(_0xa4996e){if(_0xa4996e){return _0x3fc74b[_0x2720('0x1b')](_0x386752);}return _0x3fc74b[_0x2720('0x1c')](_0x386752)[_0x2720('0x1d')]();};}function respondWithResult(_0x29ed7d,_0x5e9361){_0x5e9361=_0x5e9361||0xc8;return function(_0x499670){if(_0x499670){return _0x29ed7d['status'](_0x5e9361)[_0x2720('0x1e')](_0x499670);}};}function respondWithFilteredResult(_0x326199,_0x13839c){return function(_0x136ffe){if(_0x136ffe){var _0x264bce=typeof _0x13839c[_0x2720('0x1f')]===_0x2720('0x20')&&typeof _0x13839c[_0x2720('0x21')]===_0x2720('0x20');var _0x9f5b43=_0x136ffe[_0x2720('0x22')];var _0x116340=_0x264bce?0x0:_0x13839c['offset'];var _0x4438ce=_0x264bce?_0x136ffe['count']:_0x13839c[_0x2720('0x1f')]+_0x13839c[_0x2720('0x21')];var _0x2135b6;if(_0x4438ce>=_0x9f5b43){_0x4438ce=_0x9f5b43;_0x2135b6=0xc8;}else{_0x2135b6=0xce;}_0x326199[_0x2720('0x1c')](_0x2135b6);return _0x326199[_0x2720('0x23')]('Content-Range',_0x116340+'-'+_0x4438ce+'/'+_0x9f5b43)[_0x2720('0x1e')](_0x136ffe);}return null;};}function patchUpdates(_0x21f526){return function(_0x25ab7b){try{jsonpatch[_0x2720('0x24')](_0x25ab7b,_0x21f526,!![]);}catch(_0x21d306){return BPromise['reject'](_0x21d306);}return _0x25ab7b[_0x2720('0x25')]();};}function saveUpdates(_0x30787e,_0x21d86e){return function(_0x2532fb){if(_0x2532fb){return _0x2532fb['update'](_0x30787e)[_0x2720('0x26')](function(_0x5591f7){return _0x5591f7;});}return null;};}function removeEntity(_0x535622,_0x21b4a2){return function(_0x3615db){if(_0x3615db){return _0x3615db['destroy']()[_0x2720('0x26')](function(){_0x535622[_0x2720('0x1c')](0xcc)[_0x2720('0x1d')]();});}};}function handleEntityNotFound(_0x22c01a,_0x100e57){return function(_0x2bde20){if(!_0x2bde20){_0x22c01a['sendStatus'](0x194);}return _0x2bde20;};}function handleError(_0x1fbdfe,_0x744439){_0x744439=_0x744439||0x1f4;return function(_0x4b0041){logger['error'](_0x4b0041['stack']);if(_0x4b0041[_0x2720('0x27')]){delete _0x4b0041[_0x2720('0x27')];}_0x1fbdfe['status'](_0x744439)[_0x2720('0x28')](_0x4b0041);};}exports[_0x2720('0x29')]=function(_0x1d6523,_0x5ae55c){var _0x6bef9d={},_0x53358c={},_0x14c91a={'count':0x0,'rows':[]};var _0x97b549=_[_0x2720('0x2a')](db[_0x2720('0x2b')][_0x2720('0x2c')],function(_0x530954){return{'name':_0x530954[_0x2720('0x2d')],'type':_0x530954[_0x2720('0x2e')]['key']};});_0x53358c[_0x2720('0x2f')]=_[_0x2720('0x2a')](_0x97b549,_0x2720('0x27'));_0x53358c[_0x2720('0x30')]=_[_0x2720('0x31')](_0x1d6523[_0x2720('0x30')]);_0x53358c[_0x2720('0x32')]=_[_0x2720('0x33')](_0x53358c['model'],_0x53358c[_0x2720('0x30')]);_0x6bef9d[_0x2720('0x34')]=_[_0x2720('0x33')](_0x53358c['model'],qs[_0x2720('0x35')](_0x1d6523['query'][_0x2720('0x35')]));_0x6bef9d['attributes']=_0x6bef9d[_0x2720('0x34')][_0x2720('0x36')]?_0x6bef9d['attributes']:_0x53358c[_0x2720('0x2f')];if(!_0x1d6523[_0x2720('0x30')][_0x2720('0x37')](_0x2720('0x38'))){_0x6bef9d[_0x2720('0x21')]=qs['limit'](_0x1d6523[_0x2720('0x30')]['limit']);_0x6bef9d[_0x2720('0x1f')]=qs[_0x2720('0x1f')](_0x1d6523['query'][_0x2720('0x1f')]);}_0x6bef9d[_0x2720('0x39')]=qs[_0x2720('0x3a')](_0x1d6523['query'][_0x2720('0x3a')]);_0x6bef9d[_0x2720('0x3b')]=qs[_0x2720('0x32')](_[_0x2720('0x3c')](_0x1d6523[_0x2720('0x30')],_0x53358c[_0x2720('0x32')]),_0x97b549);if(_0x1d6523[_0x2720('0x30')][_0x2720('0x3d')]){_0x6bef9d[_0x2720('0x3b')]=_[_0x2720('0x3e')](_0x6bef9d[_0x2720('0x3b')],{'$or':_[_0x2720('0x2a')](_0x97b549,function(_0x4b898f){if(_0x4b898f['type']!==_0x2720('0x3f')){var _0xbc062c={};_0xbc062c[_0x4b898f[_0x2720('0x27')]]={'$like':'%'+_0x1d6523[_0x2720('0x30')]['filter']+'%'};return _0xbc062c;}})});}_0x6bef9d=_[_0x2720('0x3e')]({},_0x6bef9d,_0x1d6523[_0x2720('0x40')]);var _0x4fbc0c={'where':_0x6bef9d[_0x2720('0x3b')]};return db[_0x2720('0x2b')][_0x2720('0x22')](_0x4fbc0c)[_0x2720('0x26')](function(_0x5e9ba9){_0x14c91a[_0x2720('0x22')]=_0x5e9ba9;if(_0x1d6523['query'][_0x2720('0x41')]){_0x6bef9d[_0x2720('0x42')]=[{'all':!![]}];}return db[_0x2720('0x2b')]['findAll'](_0x6bef9d);})[_0x2720('0x26')](function(_0x324832){_0x14c91a['rows']=_0x324832;return _0x14c91a;})['then'](respondWithFilteredResult(_0x5ae55c,_0x6bef9d))[_0x2720('0x43')](handleError(_0x5ae55c,null));};exports[_0x2720('0x44')]=function(_0x173ab6,_0x10bcf4){var _0x5d9b82={'raw':!![],'where':{'id':_0x173ab6[_0x2720('0x45')]['id']}},_0x2740bf={};_0x2740bf['model']=_[_0x2720('0x31')](db[_0x2720('0x2b')][_0x2720('0x2c')]);_0x2740bf[_0x2720('0x30')]=_[_0x2720('0x31')](_0x173ab6[_0x2720('0x30')]);_0x2740bf[_0x2720('0x32')]=_[_0x2720('0x33')](_0x2740bf[_0x2720('0x2f')],_0x2740bf[_0x2720('0x30')]);_0x5d9b82[_0x2720('0x34')]=_[_0x2720('0x33')](_0x2740bf[_0x2720('0x2f')],qs['fields'](_0x173ab6[_0x2720('0x30')][_0x2720('0x35')]));_0x5d9b82[_0x2720('0x34')]=_0x5d9b82['attributes']['length']?_0x5d9b82[_0x2720('0x34')]:_0x2740bf[_0x2720('0x2f')];if(_0x173ab6[_0x2720('0x30')][_0x2720('0x41')]){_0x5d9b82[_0x2720('0x42')]=[{'all':!![]}];}_0x5d9b82=_[_0x2720('0x3e')]({},_0x5d9b82,_0x173ab6[_0x2720('0x40')]);return db[_0x2720('0x2b')][_0x2720('0x46')](_0x5d9b82)[_0x2720('0x26')](handleEntityNotFound(_0x10bcf4,null))[_0x2720('0x26')](respondWithResult(_0x10bcf4,null))[_0x2720('0x43')](handleError(_0x10bcf4,null));};exports[_0x2720('0x47')]=function(_0x511e8c,_0x2b9816){return db[_0x2720('0x2b')][_0x2720('0x47')](_0x511e8c[_0x2720('0x48')],{})['then'](respondWithResult(_0x2b9816,0xc9))[_0x2720('0x43')](handleError(_0x2b9816,null));};exports[_0x2720('0x49')]=function(_0x1127ad,_0xcd490b){if(_0x1127ad[_0x2720('0x48')]['id']){delete _0x1127ad['body']['id'];}return db['ChatInternalMessage'][_0x2720('0x46')]({'where':{'id':_0x1127ad[_0x2720('0x45')]['id']}})[_0x2720('0x26')](handleEntityNotFound(_0xcd490b,null))[_0x2720('0x26')](saveUpdates(_0x1127ad[_0x2720('0x48')],null))[_0x2720('0x26')](respondWithResult(_0xcd490b,null))['catch'](handleError(_0xcd490b,null));};exports[_0x2720('0x4a')]=function(_0x60f6c5,_0x49c5fe){return db[_0x2720('0x2b')][_0x2720('0x46')]({'where':{'id':_0x60f6c5['params']['id']}})[_0x2720('0x26')](handleEntityNotFound(_0x49c5fe,null))[_0x2720('0x26')](removeEntity(_0x49c5fe,null))[_0x2720('0x43')](handleError(_0x49c5fe,null));};exports[_0x2720('0x4b')]=function(_0x3d1335,_0x313002){return db['ChatInternalMessage'][_0x2720('0x4b')]()[_0x2720('0x26')](respondWithResult(_0x313002,null))[_0x2720('0x43')](handleError(_0x313002,null));};function wrapUser(_0x347e11){return function(_0x3394e1){var _0x10eb98=_0x347e11['get']({'plain':!![]});_0x10eb98[_0x2720('0x4c')]=[];if(_0x3394e1){_0x10eb98[_0x2720('0x4d')]=_0x3394e1[_0x2720('0x4e')];_0x10eb98['lastMessage']=_0x3394e1;}else{_0x10eb98[_0x2720('0x4d')]=moment(0x0)[_0x2720('0x4f')](_0x2720('0x50'));_0x10eb98[_0x2720('0x51')]={};}return _0x10eb98;};}exports[_0x2720('0x52')]=function(_0x207ffb,_0x4bacd3,_0x597485){var _0x19bb3e=[];return db['User'][_0x2720('0x53')]({'where':{'role':[_0x2720('0x54'),_0x2720('0x55'),'user']},'attributes':['id',_0x2720('0x56'),_0x2720('0x27'),_0x2720('0x57'),'userpic',_0x2720('0x58'),_0x2720('0x59'),_0x2720('0x5a'),_0x2720('0x5b'),_0x2720('0x5c')],'order':qs[_0x2720('0x3a')](_0x2720('0x5d')),'include':[{'model':db[_0x2720('0x5e')],'as':_0x2720('0x5f'),'attributes':['id',_0x2720('0x27'),'type'],'through':{'attributes':[]}}]})[_0x2720('0x26')](function(_0x3945a4){if(_0x3945a4){var _0x1b560a=_0x207ffb['user']['get']({'plain':!![]});if(!_0x1b560a)throw new Error(_0x2720('0x60'));if(_0x1b560a['role']==='user'){return db[_0x2720('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x1b560a[_0x2720('0x62')]},'raw':!![]})[_0x2720('0x26')](function(_0x27155d){if(_0x27155d){if(_0x27155d['autoAssociation']===0x0){return db[_0x2720('0x63')][_0x2720('0x53')]({'where':{'sectionId':_0x27155d['id']},'raw':!![]})[_0x2720('0x26')](function(_0x2ea83c){var _0x5d32fb=[];if(_[_0x2720('0x64')](_0x2ea83c)){_0x5d32fb=_['filter'](_0x3945a4,function(_0x547560){if(_0x547560[_0x2720('0x57')]!==_0x2720('0x54')){return _0x547560;}});return _0x5d32fb;}else{for(var _0x56dd98=0x0;_0x56dd98<_0x3945a4[_0x2720('0x36')];_0x56dd98++){var _0x5c5b38=_0x3945a4[_0x56dd98];if(_0x5c5b38[_0x2720('0x57')]===_0x2720('0x54')){var _0x47a73d=_[_0x2720('0x46')](_0x2ea83c,function(_0x1e482e){return _0x1e482e[_0x2720('0x65')]===_0x5c5b38['id'];});if(_0x47a73d)_0x5d32fb[_0x2720('0x66')](_0x5c5b38);}else{_0x5d32fb[_0x2720('0x66')](_0x5c5b38);}}return _0x5d32fb;}});}else{return _0x3945a4;}}else{var _0x5c6093=_['filter'](_0x3945a4,function(_0x48a17f){if(_0x48a17f['role']!=='agent'){return _0x48a17f;}});return _0x5c6093;}});}else{return _0x3945a4;}}})[_0x2720('0x26')](function(_0xb87ed0){var _0x413fa8=[];if(_0xb87ed0){_0x19bb3e=_0xb87ed0;for(var _0x484877=0x0;_0x484877<_0xb87ed0[_0x2720('0x36')];_0x484877+=0x1){_0x19bb3e[_0x484877][_0x2720('0x4c')]=[];_0x413fa8[_0x2720('0x66')](db[_0x2720('0x2b')][_0x2720('0x46')]({'where':{'FromId':[_0x207ffb[_0x2720('0x67')]['id'],_0xb87ed0[_0x484877]['id']],'ToId':[_0x207ffb[_0x2720('0x67')]['id'],_0xb87ed0[_0x484877]['id']],'ChatGroupId':null},'attributes':['id',_0x2720('0x4e'),_0x2720('0x68'),_0x2720('0x69'),_0x2720('0x6a'),_0x2720('0x48')],'order':qs[_0x2720('0x3a')](_0x2720('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2720('0x26')](wrapUser(_0xb87ed0[_0x484877])));}return BPromise[_0x2720('0x6c')](_0x413fa8);}return[];})['then'](function(_0x3d5e80){return{'rows':_0x3d5e80,'count':_0x3d5e80[_0x2720('0x36')]};})[_0x2720('0x26')](respondWithResult(_0x4bacd3,null))[_0x2720('0x43')](handleError(_0x4bacd3,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2127b9f..4600c2b 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 _0x1819=['emit','hook','exports','events','setMaxListeners','save','remove'];(function(_0x880a74,_0x2eb30b){var _0x19d1c4=function(_0x277b3b){while(--_0x277b3b){_0x880a74['push'](_0x880a74['shift']());}};_0x19d1c4(++_0x2eb30b);}(_0x1819,0x81));var _0x9181=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x1819[_0x15fc7a];return _0x3aa9f4;};'use strict';var EventEmitter=require(_0x9181('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9181('0x1')](0x0);var events={'afterCreate':_0x9181('0x2'),'afterUpdate':'update','afterDestroy':_0x9181('0x3')};function emitEvent(_0x543c56){return function(_0x5432a6,_0x142cdb,_0x41eeec){ChatInternalMessageEvents['emit'](_0x543c56+':'+_0x5432a6['id'],_0x5432a6);ChatInternalMessageEvents[_0x9181('0x4')](_0x543c56,_0x5432a6);_0x41eeec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9181('0x5')](e,emitEvent(event));}}module[_0x9181('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa19b=['events','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x7c4f17,_0x2e3597){var _0x203c92=function(_0x55f70a){while(--_0x55f70a){_0x7c4f17['push'](_0x7c4f17['shift']());}};_0x203c92(++_0x2e3597);}(_0xa19b,0x90));var _0xba19=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa19b[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xba19('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xba19('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba19('0x2'),'afterDestroy':'remove'};function emitEvent(_0x10983b){return function(_0x3bee83,_0x3cb92a,_0x31a55b){ChatInternalMessageEvents[_0xba19('0x3')](_0x10983b+':'+_0x3bee83['id'],_0x3bee83);ChatInternalMessageEvents['emit'](_0x10983b,_0x3bee83);_0x31a55b(null);};}for(var e in events){if(events[_0xba19('0x4')](e)){var event=events[e];ChatInternalMessage[_0xba19('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 31100c1..f902a61 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 _0x25da=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x25da,0x120));var _0xa25d=function(_0x15eb71,_0x3e975d){_0x15eb71=_0x15eb71-0x0;var _0x844dd1=_0x25da[_0x15eb71];return _0x844dd1;};'use strict';var _=require(_0xa25d('0x0'));var util=require(_0xa25d('0x1'));var logger=require(_0xa25d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa25d('0x3'));var rimraf=require(_0xa25d('0x4'));var config=require(_0xa25d('0x5'));var attributes=require(_0xa25d('0x6'));module[_0xa25d('0x7')]=function(_0x36c616,_0x84d43){return _0x36c616[_0xa25d('0x8')](_0xa25d('0x9'),attributes,{'tableName':_0xa25d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa25d('0xb'),'collate':_0xa25d('0xc')});}; \ No newline at end of file +var _0x163a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30728f,_0x82fb00){var _0x2af5df=function(_0x171ed){while(--_0x171ed){_0x30728f['push'](_0x30728f['shift']());}};_0x2af5df(++_0x82fb00);}(_0x163a,0x186));var _0xa163=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0x163a[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0xa163('0x0'));var util=require(_0xa163('0x1'));var logger=require(_0xa163('0x2'))(_0xa163('0x3'));var moment=require(_0xa163('0x4'));var BPromise=require(_0xa163('0x5'));var rp=require(_0xa163('0x6'));var fs=require('fs');var path=require(_0xa163('0x7'));var rimraf=require(_0xa163('0x8'));var config=require(_0xa163('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0xa163('0xa')]=function(_0x388115,_0x73b724){return _0x388115['define'](_0xa163('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa163('0xc'),'collate':_0xa163('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 4edd1a6..a686282 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 _0xb42c=['randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb42c,0x165));var _0xcb42=function(_0x2a3929,_0x2c871a){_0x2a3929=_0x2a3929-0x0;var _0x478eac=_0xb42c[_0x2a3929];return _0x478eac;};'use strict';var _=require(_0xcb42('0x0'));var util=require(_0xcb42('0x1'));var moment=require('moment');var BPromise=require(_0xcb42('0x2'));var rs=require(_0xcb42('0x3'));var fs=require('fs');var Redis=require(_0xcb42('0x4'));var db=require(_0xcb42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb42('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcb42('0x7'));var client=jayson['client'][_0xcb42('0x8')]({'port':0x232a});config[_0xcb42('0x9')]=_['defaults'](config[_0xcb42('0x9')],{'host':_0xcb42('0xa'),'port':0x18eb});var socket=require(_0xcb42('0xb'))(new Redis(config[_0xcb42('0x9')]));require(_0xcb42('0xc'))[_0xcb42('0xd')](socket);function respondWithRpcPromise(_0x424bb7,_0x489eed,_0x59219a){return new BPromise(function(_0x5310e2,_0x40f688){return client['request'](_0x424bb7,_0x59219a)[_0xcb42('0xe')](function(_0x21f8d1){logger[_0xcb42('0xf')](_0xcb42('0x10'),_0x489eed,'request\x20sent');logger['debug'](_0xcb42('0x11'),_0x489eed,_0xcb42('0x12'),JSON[_0xcb42('0x13')](_0x21f8d1));if(_0x21f8d1[_0xcb42('0x14')]){if(_0x21f8d1[_0xcb42('0x14')][_0xcb42('0x15')]===0x1f4){logger[_0xcb42('0x14')](_0xcb42('0x10'),_0x489eed,_0x21f8d1[_0xcb42('0x14')]['message']);return _0x40f688(_0x21f8d1[_0xcb42('0x14')][_0xcb42('0x16')]);}logger[_0xcb42('0x14')](_0xcb42('0x10'),_0x489eed,_0x21f8d1[_0xcb42('0x14')]['message']);return _0x5310e2(_0x21f8d1[_0xcb42('0x14')][_0xcb42('0x16')]);}else{logger[_0xcb42('0xf')](_0xcb42('0x10'),_0x489eed,_0xcb42('0x12'));_0x5310e2(_0x21f8d1[_0xcb42('0x17')]['message']);}})['catch'](function(_0x70a75c){logger[_0xcb42('0x14')](_0xcb42('0x10'),_0x489eed,_0x70a75c);_0x40f688(_0x70a75c);});});} \ No newline at end of file +var _0xd143=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3626ad,_0xae31a9){var _0x2d9b1c=function(_0x3a68fd){while(--_0x3a68fd){_0x3626ad['push'](_0x3626ad['shift']());}};_0x2d9b1c(++_0xae31a9);}(_0xd143,0xbc));var _0x3d14=function(_0x318842,_0x2daebb){_0x318842=_0x318842-0x0;var _0x3bace5=_0xd143[_0x318842];return _0x3bace5;};'use strict';var _=require(_0x3d14('0x0'));var util=require('util');var moment=require(_0x3d14('0x1'));var BPromise=require(_0x3d14('0x2'));var rs=require(_0x3d14('0x3'));var fs=require('fs');var Redis=require(_0x3d14('0x4'));var db=require(_0x3d14('0x5'))['db'];var utils=require(_0x3d14('0x6'));var logger=require(_0x3d14('0x7'))(_0x3d14('0x8'));var config=require('../../config/environment');var jayson=require(_0x3d14('0x9'));var client=jayson['client'][_0x3d14('0xa')]({'port':0x232a});config[_0x3d14('0xb')]=_[_0x3d14('0xc')](config[_0x3d14('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d14('0xd'))(new Redis(config[_0x3d14('0xb')]));require('./chatInternalMessage.socket')[_0x3d14('0xe')](socket);function respondWithRpcPromise(_0x19cd97,_0x1b4bfd,_0x2a8c09){return new BPromise(function(_0x314e99,_0x3df8d2){return client[_0x3d14('0xf')](_0x19cd97,_0x2a8c09)[_0x3d14('0x10')](function(_0x51de26){logger[_0x3d14('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b4bfd,_0x3d14('0x12'));logger[_0x3d14('0x13')](_0x3d14('0x14'),_0x1b4bfd,_0x3d14('0x12'),JSON['stringify'](_0x51de26));if(_0x51de26[_0x3d14('0x15')]){if(_0x51de26[_0x3d14('0x15')][_0x3d14('0x16')]===0x1f4){logger[_0x3d14('0x15')](_0x3d14('0x17'),_0x1b4bfd,_0x51de26['error'][_0x3d14('0x18')]);return _0x3df8d2(_0x51de26[_0x3d14('0x15')][_0x3d14('0x18')]);}logger[_0x3d14('0x15')](_0x3d14('0x17'),_0x1b4bfd,_0x51de26[_0x3d14('0x15')]['message']);return _0x314e99(_0x51de26[_0x3d14('0x15')][_0x3d14('0x18')]);}else{logger[_0x3d14('0x11')](_0x3d14('0x17'),_0x1b4bfd,_0x3d14('0x12'));_0x314e99(_0x51de26[_0x3d14('0x19')][_0x3d14('0x18')]);}})[_0x3d14('0x1a')](function(_0x341e9e){logger[_0x3d14('0x15')](_0x3d14('0x17'),_0x1b4bfd,_0x341e9e);_0x3df8d2(_0x341e9e);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index fe4e04f..cfdc886 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 _0xda31=['update','removeListener','register','./chatInternalMessage.events','save','remove'];(function(_0x57bb74,_0x39ee1a){var _0x133ce6=function(_0x13ad3c){while(--_0x13ad3c){_0x57bb74['push'](_0x57bb74['shift']());}};_0x133ce6(++_0x39ee1a);}(_0xda31,0x1c5));var _0x1da3=function(_0x1731a9,_0x4fb551){_0x1731a9=_0x1731a9-0x0;var _0x22b9a5=_0xda31[_0x1731a9];return _0x22b9a5;};'use strict';var ChatInternalMessageEvents=require(_0x1da3('0x0'));var events=[_0x1da3('0x1'),_0x1da3('0x2'),_0x1da3('0x3')];function createListener(_0x572a7c,_0x2d31c5){return function(_0x34e237){_0x2d31c5['emit'](_0x572a7c,_0x34e237);};}function removeListener(_0x3d02c0,_0x535125){return function(){ChatInternalMessageEvents[_0x1da3('0x4')](_0x3d02c0,_0x535125);};}exports[_0x1da3('0x5')]=function(_0x5eb90f){for(var _0x464108=0x0,_0x17d1be=events['length'];_0x464108<_0x17d1be;_0x464108++){var _0xbbc9c=events[_0x464108];var _0x46c455=createListener('chatInternalMessage:'+_0xbbc9c,_0x5eb90f);ChatInternalMessageEvents['on'](_0xbbc9c,_0x46c455);}}; \ No newline at end of file +var _0x3fef=['update','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0xfc0cc7,_0x22bec6){var _0x2cf404=function(_0x5e086f){while(--_0x5e086f){_0xfc0cc7['push'](_0xfc0cc7['shift']());}};_0x2cf404(++_0x22bec6);}(_0x3fef,0x115));var _0xf3fe=function(_0x6b50d5,_0x31ea25){_0x6b50d5=_0x6b50d5-0x0;var _0x185cb1=_0x3fef[_0x6b50d5];return _0x185cb1;};'use strict';var ChatInternalMessageEvents=require(_0xf3fe('0x0'));var events=[_0xf3fe('0x1'),_0xf3fe('0x2'),_0xf3fe('0x3')];function createListener(_0xe18591,_0x47b2c6){return function(_0x253fef){_0x47b2c6['emit'](_0xe18591,_0x253fef);};}function removeListener(_0x4ef52e,_0x43e642){return function(){ChatInternalMessageEvents['removeListener'](_0x4ef52e,_0x43e642);};}exports[_0xf3fe('0x4')]=function(_0x2d5b75){for(var _0x13100f=0x0,_0x529180=events[_0xf3fe('0x5')];_0x13100f<_0x529180;_0x13100f++){var _0x7b4a4b=events[_0x13100f];var _0x1c1f82=createListener(_0xf3fe('0x6')+_0x7b4a4b,_0x2d5b75);ChatInternalMessageEvents['on'](_0x7b4a4b,_0x1c1f82);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 87e8ea2..cec2048 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 _0x6b7f=['post','create','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','getUsers','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b7f,0x124));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf6b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf6b7('0x1'));var express=require(_0xf6b7('0x2'));var router=express[_0xf6b7('0x3')]();var fs_extra=require(_0xf6b7('0x4'));var auth=require(_0xf6b7('0x5'));var interaction=require(_0xf6b7('0x6'));var config=require('../../config/environment');var controller=require(_0xf6b7('0x7'));router[_0xf6b7('0x8')]('/',auth[_0xf6b7('0x9')](),controller[_0xf6b7('0xa')]);router['get'](_0xf6b7('0xb'),auth[_0xf6b7('0x9')](),controller['describe']);router['get']('/users',auth[_0xf6b7('0x9')](),controller[_0xf6b7('0xc')]);router[_0xf6b7('0x8')](_0xf6b7('0xd'),auth[_0xf6b7('0x9')](),controller['show']);router[_0xf6b7('0xe')]('/',auth['isAuthenticated'](),controller[_0xf6b7('0xf')]);router['put'](_0xf6b7('0xd'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf6b7('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb6b4=['put','/:id','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','show','post','create'];(function(_0xf8e45b,_0x336e08){var _0xb38c41=function(_0x51f9d8){while(--_0x51f9d8){_0xf8e45b['push'](_0xf8e45b['shift']());}};_0xb38c41(++_0x336e08);}(_0xb6b4,0x1bd));var _0x4b6b=function(_0x90506d,_0x14f930){_0x90506d=_0x90506d-0x0;var _0x49dc84=_0xb6b4[_0x90506d];return _0x49dc84;};'use strict';var multer=require(_0x4b6b('0x0'));var util=require(_0x4b6b('0x1'));var path=require(_0x4b6b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4b6b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b6b('0x4'));var config=require(_0x4b6b('0x5'));var controller=require(_0x4b6b('0x6'));router['get']('/',auth[_0x4b6b('0x7')](),controller[_0x4b6b('0x8')]);router[_0x4b6b('0x9')](_0x4b6b('0xa'),auth[_0x4b6b('0x7')](),controller[_0x4b6b('0xb')]);router[_0x4b6b('0x9')](_0x4b6b('0xc'),auth[_0x4b6b('0x7')](),controller[_0x4b6b('0xd')]);router[_0x4b6b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4b6b('0xe')]);router[_0x4b6b('0xf')]('/',auth[_0x4b6b('0x7')](),controller[_0x4b6b('0x10')]);router[_0x4b6b('0x11')](_0x4b6b('0x12'),controller[_0x4b6b('0x13')]);router[_0x4b6b('0x14')](_0x4b6b('0x12'),auth['isAuthenticated'](),controller[_0x4b6b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 0872386..8aeb08e 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9158,0x16e));var _0x8915=function(_0x58d739,_0x356647){_0x58d739=_0x58d739-0x0;var _0x1efeb0=_0x9158[_0x58d739];return _0x1efeb0;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}}; \ No newline at end of file +var _0xee4f=['BOOLEAN','out','DATE','sequelize','medium'];(function(_0x271250,_0x3ca034){var _0x48a33f=function(_0x1df635){while(--_0x1df635){_0x271250['push'](_0x271250['shift']());}};_0x48a33f(++_0x3ca034);}(_0xee4f,0xad));var _0xfee4=function(_0x853463,_0x2c8db3){_0x853463=_0x853463-0x0;var _0x1e96f2=_0xee4f[_0x853463];return _0x1e96f2;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xfee4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfee4('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfee4('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 261a2c1..894cf10 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 _0x3d27=['get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat','params','ChatInteractionId','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','show','includeAll','options','create','body','find','describe','chat-interactions','accept','UserId','user','agent'];(function(_0x28dfe3,_0x4403f1){var _0x44b339=function(_0x534d8f){while(--_0x534d8f){_0x28dfe3['push'](_0x28dfe3['shift']());}};_0x44b339(++_0x4403f1);}(_0x3d27,0x11d));var _0x73d2=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0x3d27[_0x1e7345];return _0x33017c;};'use strict';var emlformat=require(_0x73d2('0x0'));var rimraf=require(_0x73d2('0x1'));var zipdir=require(_0x73d2('0x2'));var jsonpatch=require(_0x73d2('0x3'));var rp=require(_0x73d2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x73d2('0x5'));var path=require(_0x73d2('0x6'));var sox=require('sox');var csv=require(_0x73d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73d2('0x8'));var squel=require(_0x73d2('0x9'));var crypto=require(_0x73d2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x73d2('0xb'));var toCsv=require(_0x73d2('0x7'));var querystring=require(_0x73d2('0xc'));var Papa=require(_0x73d2('0xd'));var Redis=require('ioredis');var authService=require(_0x73d2('0xe'));var qs=require(_0x73d2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73d2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x73d2('0x11'));var config=require(_0x73d2('0x12'));var licenseUtil=require(_0x73d2('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x73d2('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x73d2('0x15'))(new Redis(config[_0x73d2('0x16')]));require(_0x73d2('0x17'))['register'](socket);var jayson=require(_0x73d2('0x18'));var client=jayson[_0x73d2('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x73d2('0x19')][_0x73d2('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1a65d9,_0x9d2b5c,_0x394985,_0x3103be){return new BPromise(function(_0xac79cc,_0x311bf2){var _0x278787=_0x3103be||client;return _0x278787[_0x73d2('0x1b')](_0x1a65d9,_0x394985)[_0x73d2('0x1c')](function(_0x576cc2){logger[_0x73d2('0x1d')](_0x73d2('0x1e'),_0x9d2b5c,_0x73d2('0x1f'));logger[_0x73d2('0x20')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x9d2b5c,_0x73d2('0x1f'),JSON[_0x73d2('0x21')](_0x576cc2));if(_0x576cc2[_0x73d2('0x22')]){if(_0x576cc2['error'][_0x73d2('0x23')]===0x1f4){logger[_0x73d2('0x22')](_0x73d2('0x1e'),_0x9d2b5c,_0x576cc2[_0x73d2('0x22')][_0x73d2('0x24')]);return _0x311bf2(_0x576cc2[_0x73d2('0x22')][_0x73d2('0x24')]);}logger[_0x73d2('0x22')]('ChatMessage,\x20%s,\x20%s',_0x9d2b5c,_0x576cc2[_0x73d2('0x22')][_0x73d2('0x24')]);return _0xac79cc(_0x576cc2['error'][_0x73d2('0x24')]);}else{logger['info'](_0x73d2('0x1e'),_0x9d2b5c,_0x73d2('0x1f'));_0xac79cc(_0x576cc2[_0x73d2('0x25')]['message']);}})[_0x73d2('0x26')](function(_0x4d64d9){logger[_0x73d2('0x22')](_0x73d2('0x1e'),_0x9d2b5c,_0x4d64d9);_0x311bf2(_0x4d64d9);});});}function respondWithStatusCode(_0x5ce915,_0x66f3d3){_0x66f3d3=_0x66f3d3||0xcc;return function(_0x3222ea){if(_0x3222ea){return _0x5ce915['sendStatus'](_0x66f3d3);}return _0x5ce915['status'](_0x66f3d3)['end']();};}function respondWithResult(_0xa76414,_0x3041bd){_0x3041bd=_0x3041bd||0xc8;return function(_0x2180f9){if(_0x2180f9){return _0xa76414[_0x73d2('0x27')](_0x3041bd)['json'](_0x2180f9);}};}function respondWithFilteredResult(_0x18ef38,_0x46b1bc){return function(_0x14cd7e){if(_0x14cd7e){var _0xe840=typeof _0x46b1bc[_0x73d2('0x28')]===_0x73d2('0x29')&&typeof _0x46b1bc[_0x73d2('0x2a')]===_0x73d2('0x29');var _0x1200f6=_0x14cd7e[_0x73d2('0x2b')];var _0x5af699=_0xe840?0x0:_0x46b1bc[_0x73d2('0x28')];var _0x45cfd7=_0xe840?_0x14cd7e[_0x73d2('0x2b')]:_0x46b1bc[_0x73d2('0x28')]+_0x46b1bc['limit'];var _0x3081d5;if(_0x45cfd7>=_0x1200f6){_0x45cfd7=_0x1200f6;_0x3081d5=0xc8;}else{_0x3081d5=0xce;}_0x18ef38['status'](_0x3081d5);return _0x18ef38[_0x73d2('0x2c')](_0x73d2('0x2d'),_0x5af699+'-'+_0x45cfd7+'/'+_0x1200f6)[_0x73d2('0x2e')](_0x14cd7e);}return null;};}function patchUpdates(_0x545977){return function(_0x462726){try{jsonpatch[_0x73d2('0x2f')](_0x462726,_0x545977,!![]);}catch(_0x1cf69a){return BPromise[_0x73d2('0x30')](_0x1cf69a);}return _0x462726[_0x73d2('0x31')]();};}function saveUpdates(_0x46bd2f,_0x534bdc){return function(_0x2f8cf8){if(_0x2f8cf8){return _0x2f8cf8[_0x73d2('0x32')](_0x46bd2f)['then'](function(_0x870c2d){return _0x870c2d;});}return null;};}function removeEntity(_0x5355f2,_0x530b24){return function(_0x1a201e){if(_0x1a201e){return _0x1a201e[_0x73d2('0x33')]()['then'](function(){_0x5355f2['status'](0xcc)[_0x73d2('0x34')]();});}};}function handleEntityNotFound(_0x37f5ed,_0x4f7fe1){return function(_0x3f797f){if(!_0x3f797f){_0x37f5ed[_0x73d2('0x35')](0x194);}return _0x3f797f;};}function handleError(_0x179911,_0x99f06c){_0x99f06c=_0x99f06c||0x1f4;return function(_0x1b9505){logger[_0x73d2('0x22')](_0x1b9505['stack']);if(_0x1b9505[_0x73d2('0x36')]){delete _0x1b9505[_0x73d2('0x36')];}_0x179911[_0x73d2('0x27')](_0x99f06c)[_0x73d2('0x37')](_0x1b9505);};}exports['index']=function(_0x45e0b6,_0x3afc7e){var _0x430f35={},_0x48aed7={},_0x10e0bd={'count':0x0,'rows':[]};var _0x155d72=_[_0x73d2('0x38')](db[_0x73d2('0x39')][_0x73d2('0x3a')],function(_0x123b5a){return{'name':_0x123b5a[_0x73d2('0x3b')],'type':_0x123b5a[_0x73d2('0x3c')][_0x73d2('0x3d')]};});_0x48aed7[_0x73d2('0x3e')]=_[_0x73d2('0x38')](_0x155d72,_0x73d2('0x36'));_0x48aed7['query']=_[_0x73d2('0x3f')](_0x45e0b6['query']);_0x48aed7[_0x73d2('0x40')]=_[_0x73d2('0x41')](_0x48aed7[_0x73d2('0x3e')],_0x48aed7[_0x73d2('0x42')]);_0x430f35['attributes']=_['intersection'](_0x48aed7[_0x73d2('0x3e')],qs[_0x73d2('0x43')](_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x43')]));_0x430f35[_0x73d2('0x44')]=_0x430f35[_0x73d2('0x44')][_0x73d2('0x45')]?_0x430f35[_0x73d2('0x44')]:_0x48aed7[_0x73d2('0x3e')];if(!_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x46')](_0x73d2('0x47'))){_0x430f35[_0x73d2('0x2a')]=qs['limit'](_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x2a')]);_0x430f35[_0x73d2('0x28')]=qs[_0x73d2('0x28')](_0x45e0b6['query'][_0x73d2('0x28')]);}_0x430f35[_0x73d2('0x48')]=qs[_0x73d2('0x49')](_0x45e0b6['query']['sort']);_0x430f35[_0x73d2('0x4a')]=qs[_0x73d2('0x40')](_[_0x73d2('0x4b')](_0x45e0b6[_0x73d2('0x42')],_0x48aed7[_0x73d2('0x40')]),_0x155d72);if(_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x4c')]){_0x430f35['where']=_['merge'](_0x430f35[_0x73d2('0x4a')],{'$or':_[_0x73d2('0x38')](_0x155d72,function(_0x4281b2){if(_0x4281b2[_0x73d2('0x3c')]!==_0x73d2('0x4d')){var _0x2dccca={};_0x2dccca[_0x4281b2['name']]={'$like':'%'+_0x45e0b6['query'][_0x73d2('0x4c')]+'%'};return _0x2dccca;}})});}_0x430f35=_[_0x73d2('0x4e')]({},_0x430f35,_0x45e0b6['options']);var _0xeb5e9d={'where':_0x430f35[_0x73d2('0x4a')]};return db[_0x73d2('0x39')]['count'](_0xeb5e9d)['then'](function(_0x29b1a5){_0x10e0bd[_0x73d2('0x2b')]=_0x29b1a5;if(_0x45e0b6['query']['includeAll']){_0x430f35['include']=[{'all':!![]}];}return db[_0x73d2('0x39')][_0x73d2('0x4f')](_0x430f35);})[_0x73d2('0x1c')](function(_0x32aa59){_0x10e0bd[_0x73d2('0x50')]=_0x32aa59;return _0x10e0bd;})['then'](respondWithFilteredResult(_0x3afc7e,_0x430f35))[_0x73d2('0x26')](handleError(_0x3afc7e,null));};exports[_0x73d2('0x51')]=function(_0x282cd4,_0x31c521){var _0x2b5ec0={'raw':!![],'where':{'id':_0x282cd4['params']['id']}},_0x4dabdc={};_0x4dabdc[_0x73d2('0x3e')]=_[_0x73d2('0x3f')](db[_0x73d2('0x39')][_0x73d2('0x3a')]);_0x4dabdc[_0x73d2('0x42')]=_['keys'](_0x282cd4[_0x73d2('0x42')]);_0x4dabdc[_0x73d2('0x40')]=_[_0x73d2('0x41')](_0x4dabdc[_0x73d2('0x3e')],_0x4dabdc[_0x73d2('0x42')]);_0x2b5ec0[_0x73d2('0x44')]=_[_0x73d2('0x41')](_0x4dabdc[_0x73d2('0x3e')],qs[_0x73d2('0x43')](_0x282cd4['query']['fields']));_0x2b5ec0[_0x73d2('0x44')]=_0x2b5ec0[_0x73d2('0x44')][_0x73d2('0x45')]?_0x2b5ec0['attributes']:_0x4dabdc['model'];if(_0x282cd4[_0x73d2('0x42')][_0x73d2('0x52')]){_0x2b5ec0['include']=[{'all':!![]}];}_0x2b5ec0=_['merge']({},_0x2b5ec0,_0x282cd4[_0x73d2('0x53')]);return db['ChatMessage']['find'](_0x2b5ec0)['then'](handleEntityNotFound(_0x31c521,null))[_0x73d2('0x1c')](respondWithResult(_0x31c521,null))['catch'](handleError(_0x31c521,null));};exports[_0x73d2('0x54')]=function(_0x5730a7,_0x2f6199){return db['ChatMessage'][_0x73d2('0x54')](_0x5730a7['body'],{})[_0x73d2('0x1c')](respondWithResult(_0x2f6199,0xc9))[_0x73d2('0x26')](handleError(_0x2f6199,null));};exports[_0x73d2('0x32')]=function(_0x592692,_0x5d673f){if(_0x592692[_0x73d2('0x55')]['id']){delete _0x592692[_0x73d2('0x55')]['id'];}return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x592692['params']['id']}})[_0x73d2('0x1c')](handleEntityNotFound(_0x5d673f,null))['then'](saveUpdates(_0x592692[_0x73d2('0x55')],null))[_0x73d2('0x1c')](respondWithResult(_0x5d673f,null))[_0x73d2('0x26')](handleError(_0x5d673f,null));};exports['destroy']=function(_0x4959b2,_0x10348f){return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x4959b2['params']['id']}})['then'](handleEntityNotFound(_0x10348f,null))['then'](removeEntity(_0x10348f,null))[_0x73d2('0x26')](handleError(_0x10348f,null));};exports[_0x73d2('0x57')]=function(_0x348fd5,_0x3738ea){return db[_0x73d2('0x39')]['describe']()['then'](respondWithResult(_0x3738ea,null))[_0x73d2('0x26')](handleError(_0x3738ea,null));};var interaction_log=require('../../config/logger')(_0x73d2('0x58'));exports[_0x73d2('0x59')]=function(_0x19091c,_0x49699f,_0x27f637){var _0x210100={'agent':{},'channel':'chat'};if(_0x19091c[_0x73d2('0x55')]['id']){delete _0x19091c[_0x73d2('0x55')]['id'];}_0x19091c[_0x73d2('0x55')]['read']=!![];_0x19091c[_0x73d2('0x55')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19091c[_0x73d2('0x55')][_0x73d2('0x5a')]=_0x19091c['body'][_0x73d2('0x5a')]||_0x19091c[_0x73d2('0x5b')]['id'];_0x210100[_0x73d2('0x5c')]['id']=_0x19091c[_0x73d2('0x55')]['UserId'];return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x19091c['params']['id'],'UserId':null}})[_0x73d2('0x1c')](handleEntityNotFound(_0x49699f,null))[_0x73d2('0x1c')](saveUpdates(_0x19091c[_0x73d2('0x55')],null))[_0x73d2('0x1c')](function(_0x55f05e){if(_0x55f05e){_0x210100[_0x73d2('0x24')]=_0x55f05e[_0x73d2('0x5d')]({'plain':!![]});return db[_0x73d2('0x5e')][_0x73d2('0x56')]({'where':{'id':_0x55f05e['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x49699f,null))[_0x73d2('0x1c')](function(_0xf695a4){if(_0xf695a4){return _0xf695a4[_0x73d2('0x32')]({'UserId':_0x19091c[_0x73d2('0x55')][_0x73d2('0x5a')],'read1stAt':_[_0x73d2('0x5f')](_0xf695a4[_0x73d2('0x60')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x10c060){if(_0x10c060){_0x210100[_0x73d2('0x61')]=_0x10c060[_0x73d2('0x5d')]({'plain':!![]});interaction_log[_0x73d2('0x1d')](_0x73d2('0x62'),_0x19091c[_0x73d2('0x5b')]['id'],_0x19091c['user']['name'],_0x19091c['user'][_0x73d2('0x63')],_0x210100[_0x73d2('0x61')]['id'],_0x19091c[_0x73d2('0x55')]?JSON[_0x73d2('0x21')](_0x19091c[_0x73d2('0x55')]):_0x73d2('0x64'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x210100);}return null;})['then'](function(_0x4e32eb){var _0x1193e4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e32eb[_0x73d2('0x24')][_0x73d2('0x65')];return db['sequelize'][_0x73d2('0x42')](_0x1193e4,{'type':db[_0x73d2('0x66')][_0x73d2('0x67')][_0x73d2('0x68')],'raw':!![]})[_0x73d2('0x1c')](function(_0x5078a4){return _0x5078a4;});})[_0x73d2('0x1c')](function(_0x1d85e1){if(_0x1d85e1){_0x210100[_0x73d2('0x24')][_0x73d2('0x69')]=_0x1d85e1[0x0];if(!_0x19091c['body']['UserId'])return;return db[_0x73d2('0x6a')]['find']({'where':{'id':_0x19091c['body'][_0x73d2('0x5a')],'role':_0x73d2('0x5c')},'attributes':['id',_0x73d2('0x36'),_0x73d2('0x6b'),_0x73d2('0x6c'),_0x73d2('0x6d')],'raw':!![]});}return null;})[_0x73d2('0x1c')](function(_0x55860b){if(!_0x55860b)return null;_0x210100[_0x73d2('0x24')][_0x73d2('0x5c')]=_0x55860b;return _0x210100;})[_0x73d2('0x1c')](function(_0x52143d){if(_0x52143d){if(_0x19091c[_0x73d2('0x55')]['manual']){_0x210100[_0x73d2('0x24')][_0x73d2('0x6e')]=util[_0x73d2('0x6f')](_0x73d2('0x70'),_0x19091c[_0x73d2('0x5b')][_0x73d2('0x36')]);_0x210100[_0x73d2('0x24')][_0x73d2('0x71')]=_0x210100[_0x73d2('0x71')];_0x210100[_0x73d2('0x24')][_0x73d2('0x72')]=_0x210100['channel'];_0x210100['message']['event']=_0x73d2('0x59');return respondWithRpcPromise(_0x73d2('0x73'),_0x73d2('0x73'),{'event':_0x73d2('0x74'),'message':_[_0x73d2('0x4e')](_0x210100[_0x73d2('0x24')],JSON[_0x73d2('0x75')](_0x210100[_0x73d2('0x61')][_0x73d2('0x76')]))},client9002)[_0x73d2('0x1c')](function(){return _0x210100;});}return _0x210100;}return null;})[_0x73d2('0x1c')](respondWithResult(_0x49699f,null))[_0x73d2('0x26')](handleError(_0x49699f,null));};var interaction_log=require('../../config/logger')(_0x73d2('0x58'));exports[_0x73d2('0x30')]=function(_0x25d802,_0x366efc,_0x47d07e){var _0x47e87f={'agent':{},'channel':_0x73d2('0x77')};if(_0x25d802[_0x73d2('0x55')]['id']){delete _0x25d802[_0x73d2('0x55')]['id'];}_0x25d802[_0x73d2('0x55')]['UserId']=_0x25d802[_0x73d2('0x55')]['UserId']||_0x25d802[_0x73d2('0x5b')]['id'];_0x47e87f[_0x73d2('0x5c')]['id']=_0x25d802['body'][_0x73d2('0x5a')];return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x25d802[_0x73d2('0x78')]['id'],'UserId':null}})[_0x73d2('0x1c')](handleEntityNotFound(_0x366efc,null))[_0x73d2('0x1c')](function(_0x8b5b70){if(_0x8b5b70){_0x47e87f[_0x73d2('0x24')]=_0x8b5b70[_0x73d2('0x5d')]({'plain':!![]});return db[_0x73d2('0x5e')][_0x73d2('0x56')]({'where':{'id':_0x8b5b70[_0x73d2('0x79')]}});}return null;})[_0x73d2('0x1c')](handleEntityNotFound(_0x366efc,null))[_0x73d2('0x1c')](function(_0x208406){if(_0x208406){_0x47e87f[_0x73d2('0x61')]=_0x208406[_0x73d2('0x5d')]({'plain':!![]});interaction_log[_0x73d2('0x1d')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25d802[_0x73d2('0x5b')]['id'],_0x25d802[_0x73d2('0x5b')]['name'],_0x25d802['user'][_0x73d2('0x63')],_0x47e87f[_0x73d2('0x61')]['id'],_0x25d802[_0x73d2('0x55')]?JSON[_0x73d2('0x21')](_0x25d802[_0x73d2('0x55')]):_0x73d2('0x64'));return respondWithRpcPromise('RejectMessage',_0x73d2('0x7a'),_0x47e87f);}return null;})['then'](function(_0x20d993){var _0x1248f8=_0x73d2('0x7b')+_0x20d993[_0x73d2('0x24')]['ContactId'];return db[_0x73d2('0x7c')][_0x73d2('0x42')](_0x1248f8,{'type':db['Sequelize'][_0x73d2('0x67')][_0x73d2('0x68')],'raw':!![]})['then'](function(_0x334d8e){return _0x334d8e;});})[_0x73d2('0x1c')](function(_0x4b66ca){if(_0x4b66ca){_0x47e87f[_0x73d2('0x24')][_0x73d2('0x69')]=_0x4b66ca[0x0];if(!_0x25d802[_0x73d2('0x55')]['UserId'])return;return db[_0x73d2('0x6a')][_0x73d2('0x56')]({'where':{'id':_0x25d802[_0x73d2('0x55')][_0x73d2('0x5a')],'role':'agent'},'attributes':['id','name',_0x73d2('0x6b'),_0x73d2('0x6c'),_0x73d2('0x6d')],'raw':!![]});}return null;})[_0x73d2('0x1c')](function(_0x112c9b){if(!_0x112c9b)return null;_0x47e87f[_0x73d2('0x24')]['agent']=_0x112c9b;return _0x47e87f;})[_0x73d2('0x1c')](function(_0x44915f){if(_0x44915f){_0x44915f[_0x73d2('0x24')][_0x73d2('0x6e')]=util['format'](_0x73d2('0x70'),_0x25d802[_0x73d2('0x5b')][_0x73d2('0x36')]);_0x44915f[_0x73d2('0x24')][_0x73d2('0x71')]=_0x47e87f[_0x73d2('0x71')];_0x44915f['message']['motionChannel']=_0x47e87f[_0x73d2('0x71')];_0x44915f['message'][_0x73d2('0x7d')]=_0x73d2('0x30');respondWithRpcPromise(_0x73d2('0x73'),_0x73d2('0x73'),{'event':'rejectmessage','message':_[_0x73d2('0x4e')](_0x47e87f['message'],JSON[_0x73d2('0x75')](_0x47e87f['interaction'][_0x73d2('0x76')]))},client9002);return _0x47e87f;}return null;})['then'](respondWithResult(_0x366efc,null))[_0x73d2('0x26')](handleError(_0x366efc,null));}; \ No newline at end of file +var _0xa4ce=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','http','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ChatMessage','includeAll','include','findAll','show','params','find','create','update','body','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','isNil','read1stAt','interaction','get','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','internal','formData','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2abd7c,_0x4b708b){var _0xdad63b=function(_0x54d522){while(--_0x54d522){_0x2abd7c['push'](_0x2abd7c['shift']());}};_0xdad63b(++_0x4b708b);}(_0xa4ce,0x1ea));var _0xea4c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa4ce[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xea4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea4c('0x1'));var jsonpatch=require(_0xea4c('0x2'));var rp=require(_0xea4c('0x3'));var moment=require(_0xea4c('0x4'));var BPromise=require(_0xea4c('0x5'));var Mustache=require('mustache');var util=require(_0xea4c('0x6'));var path=require('path');var sox=require(_0xea4c('0x7'));var csv=require(_0xea4c('0x8'));var ejs=require(_0xea4c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea4c('0xa'));var squel=require(_0xea4c('0xb'));var crypto=require(_0xea4c('0xc'));var jsforce=require(_0xea4c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xea4c('0x8'));var querystring=require(_0xea4c('0xe'));var Papa=require(_0xea4c('0xf'));var Redis=require(_0xea4c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea4c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea4c('0x12'))(_0xea4c('0x13'));var utils=require(_0xea4c('0x14'));var config=require(_0xea4c('0x15'));var licenseUtil=require(_0xea4c('0x16'));var db=require('../../mysqldb')['db'];config[_0xea4c('0x17')]=_[_0xea4c('0x18')](config[_0xea4c('0x17')],{'host':_0xea4c('0x19'),'port':0x18eb});var socket=require(_0xea4c('0x1a'))(new Redis(config[_0xea4c('0x17')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xea4c('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xea4c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5b844a,_0x5c300e,_0xeb6aad,_0xe01e1d){return new BPromise(function(_0x13b51b,_0x4d8978){var _0x8a34f9=_0xe01e1d||client;return _0x8a34f9[_0xea4c('0x1c')](_0x5b844a,_0xeb6aad)[_0xea4c('0x1d')](function(_0x32462f){logger[_0xea4c('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5c300e,'request\x20sent');logger[_0xea4c('0x1f')](_0xea4c('0x20'),_0x5c300e,_0xea4c('0x21'),JSON[_0xea4c('0x22')](_0x32462f));if(_0x32462f[_0xea4c('0x23')]){if(_0x32462f[_0xea4c('0x23')][_0xea4c('0x24')]===0x1f4){logger['error'](_0xea4c('0x25'),_0x5c300e,_0x32462f['error'][_0xea4c('0x26')]);return _0x4d8978(_0x32462f['error']['message']);}logger['error'](_0xea4c('0x25'),_0x5c300e,_0x32462f['error']['message']);return _0x13b51b(_0x32462f[_0xea4c('0x23')]['message']);}else{logger[_0xea4c('0x1e')](_0xea4c('0x25'),_0x5c300e,_0xea4c('0x21'));_0x13b51b(_0x32462f[_0xea4c('0x27')]['message']);}})[_0xea4c('0x28')](function(_0x2c4ea3){logger[_0xea4c('0x23')](_0xea4c('0x25'),_0x5c300e,_0x2c4ea3);_0x4d8978(_0x2c4ea3);});});}function respondWithStatusCode(_0x210422,_0x3479de){_0x3479de=_0x3479de||0xcc;return function(_0x4bcd9b){if(_0x4bcd9b){return _0x210422[_0xea4c('0x29')](_0x3479de);}return _0x210422[_0xea4c('0x2a')](_0x3479de)[_0xea4c('0x2b')]();};}function respondWithResult(_0x270935,_0x329262){_0x329262=_0x329262||0xc8;return function(_0x2d0aa9){if(_0x2d0aa9){return _0x270935['status'](_0x329262)[_0xea4c('0x2c')](_0x2d0aa9);}};}function respondWithFilteredResult(_0x5687b6,_0x3f4492){return function(_0x5042e0){if(_0x5042e0){var _0x18b593=typeof _0x3f4492[_0xea4c('0x2d')]===_0xea4c('0x2e')&&typeof _0x3f4492[_0xea4c('0x2f')]===_0xea4c('0x2e');var _0x465cb6=_0x5042e0[_0xea4c('0x30')];var _0x48b794=_0x18b593?0x0:_0x3f4492[_0xea4c('0x2d')];var _0x5c3c18=_0x18b593?_0x5042e0['count']:_0x3f4492[_0xea4c('0x2d')]+_0x3f4492[_0xea4c('0x2f')];var _0x597271;if(_0x5c3c18>=_0x465cb6){_0x5c3c18=_0x465cb6;_0x597271=0xc8;}else{_0x597271=0xce;}_0x5687b6[_0xea4c('0x2a')](_0x597271);return _0x5687b6['set'](_0xea4c('0x31'),_0x48b794+'-'+_0x5c3c18+'/'+_0x465cb6)['json'](_0x5042e0);}return null;};}function patchUpdates(_0xcd152a){return function(_0x8ad86f){try{jsonpatch[_0xea4c('0x32')](_0x8ad86f,_0xcd152a,!![]);}catch(_0x2a611a){return BPromise[_0xea4c('0x33')](_0x2a611a);}return _0x8ad86f[_0xea4c('0x34')]();};}function saveUpdates(_0x50e8a6,_0x144863){return function(_0x44956a){if(_0x44956a){return _0x44956a['update'](_0x50e8a6)[_0xea4c('0x1d')](function(_0x251a95){return _0x251a95;});}return null;};}function removeEntity(_0x1b1321,_0x170a50){return function(_0x2a4105){if(_0x2a4105){return _0x2a4105[_0xea4c('0x35')]()[_0xea4c('0x1d')](function(){_0x1b1321[_0xea4c('0x2a')](0xcc)[_0xea4c('0x2b')]();});}};}function handleEntityNotFound(_0x150316,_0x39844a){return function(_0x4bdb0d){if(!_0x4bdb0d){_0x150316[_0xea4c('0x29')](0x194);}return _0x4bdb0d;};}function handleError(_0x3c8d1,_0xf44f08){_0xf44f08=_0xf44f08||0x1f4;return function(_0x2b87e6){logger[_0xea4c('0x23')](_0x2b87e6[_0xea4c('0x36')]);if(_0x2b87e6['name']){delete _0x2b87e6[_0xea4c('0x37')];}_0x3c8d1[_0xea4c('0x2a')](_0xf44f08)[_0xea4c('0x38')](_0x2b87e6);};}exports['index']=function(_0x2ecd42,_0x2a2812){var _0x422b8d={},_0x4c3d43={},_0x16c262={'count':0x0,'rows':[]};var _0x7f4b21=_[_0xea4c('0x39')](db['ChatMessage'][_0xea4c('0x3a')],function(_0x28104a){return{'name':_0x28104a[_0xea4c('0x3b')],'type':_0x28104a[_0xea4c('0x3c')][_0xea4c('0x3d')]};});_0x4c3d43[_0xea4c('0x3e')]=_[_0xea4c('0x39')](_0x7f4b21,_0xea4c('0x37'));_0x4c3d43[_0xea4c('0x3f')]=_[_0xea4c('0x40')](_0x2ecd42[_0xea4c('0x3f')]);_0x4c3d43[_0xea4c('0x41')]=_[_0xea4c('0x42')](_0x4c3d43[_0xea4c('0x3e')],_0x4c3d43['query']);_0x422b8d[_0xea4c('0x43')]=_['intersection'](_0x4c3d43[_0xea4c('0x3e')],qs[_0xea4c('0x44')](_0x2ecd42[_0xea4c('0x3f')][_0xea4c('0x44')]));_0x422b8d[_0xea4c('0x43')]=_0x422b8d[_0xea4c('0x43')][_0xea4c('0x45')]?_0x422b8d[_0xea4c('0x43')]:_0x4c3d43[_0xea4c('0x3e')];if(!_0x2ecd42['query'][_0xea4c('0x46')]('nolimit')){_0x422b8d[_0xea4c('0x2f')]=qs[_0xea4c('0x2f')](_0x2ecd42['query'][_0xea4c('0x2f')]);_0x422b8d[_0xea4c('0x2d')]=qs[_0xea4c('0x2d')](_0x2ecd42['query']['offset']);}_0x422b8d[_0xea4c('0x47')]=qs[_0xea4c('0x48')](_0x2ecd42[_0xea4c('0x3f')]['sort']);_0x422b8d[_0xea4c('0x49')]=qs[_0xea4c('0x41')](_[_0xea4c('0x4a')](_0x2ecd42[_0xea4c('0x3f')],_0x4c3d43[_0xea4c('0x41')]),_0x7f4b21);if(_0x2ecd42[_0xea4c('0x3f')][_0xea4c('0x4b')]){_0x422b8d[_0xea4c('0x49')]=_[_0xea4c('0x4c')](_0x422b8d[_0xea4c('0x49')],{'$or':_['map'](_0x7f4b21,function(_0x8a96ad){if(_0x8a96ad[_0xea4c('0x3c')]!=='VIRTUAL'){var _0x2c2b51={};_0x2c2b51[_0x8a96ad[_0xea4c('0x37')]]={'$like':'%'+_0x2ecd42[_0xea4c('0x3f')]['filter']+'%'};return _0x2c2b51;}})});}_0x422b8d=_[_0xea4c('0x4c')]({},_0x422b8d,_0x2ecd42[_0xea4c('0x4d')]);var _0x595735={'where':_0x422b8d[_0xea4c('0x49')]};return db[_0xea4c('0x4e')][_0xea4c('0x30')](_0x595735)[_0xea4c('0x1d')](function(_0x14c3ab){_0x16c262[_0xea4c('0x30')]=_0x14c3ab;if(_0x2ecd42[_0xea4c('0x3f')][_0xea4c('0x4f')]){_0x422b8d[_0xea4c('0x50')]=[{'all':!![]}];}return db[_0xea4c('0x4e')][_0xea4c('0x51')](_0x422b8d);})['then'](function(_0x433b19){_0x16c262['rows']=_0x433b19;return _0x16c262;})[_0xea4c('0x1d')](respondWithFilteredResult(_0x2a2812,_0x422b8d))[_0xea4c('0x28')](handleError(_0x2a2812,null));};exports[_0xea4c('0x52')]=function(_0x4e1bbe,_0x2dc148){var _0x235960={'raw':!![],'where':{'id':_0x4e1bbe[_0xea4c('0x53')]['id']}},_0x3468d1={};_0x3468d1[_0xea4c('0x3e')]=_[_0xea4c('0x40')](db[_0xea4c('0x4e')][_0xea4c('0x3a')]);_0x3468d1[_0xea4c('0x3f')]=_['keys'](_0x4e1bbe[_0xea4c('0x3f')]);_0x3468d1[_0xea4c('0x41')]=_['intersection'](_0x3468d1[_0xea4c('0x3e')],_0x3468d1[_0xea4c('0x3f')]);_0x235960[_0xea4c('0x43')]=_[_0xea4c('0x42')](_0x3468d1[_0xea4c('0x3e')],qs[_0xea4c('0x44')](_0x4e1bbe[_0xea4c('0x3f')][_0xea4c('0x44')]));_0x235960[_0xea4c('0x43')]=_0x235960[_0xea4c('0x43')][_0xea4c('0x45')]?_0x235960[_0xea4c('0x43')]:_0x3468d1[_0xea4c('0x3e')];if(_0x4e1bbe[_0xea4c('0x3f')][_0xea4c('0x4f')]){_0x235960['include']=[{'all':!![]}];}_0x235960=_[_0xea4c('0x4c')]({},_0x235960,_0x4e1bbe['options']);return db['ChatMessage'][_0xea4c('0x54')](_0x235960)[_0xea4c('0x1d')](handleEntityNotFound(_0x2dc148,null))[_0xea4c('0x1d')](respondWithResult(_0x2dc148,null))[_0xea4c('0x28')](handleError(_0x2dc148,null));};exports[_0xea4c('0x55')]=function(_0x3506e4,_0x5309fe){return db['ChatMessage']['create'](_0x3506e4['body'],{})['then'](respondWithResult(_0x5309fe,0xc9))[_0xea4c('0x28')](handleError(_0x5309fe,null));};exports[_0xea4c('0x56')]=function(_0x4fd41c,_0x4914d9){if(_0x4fd41c[_0xea4c('0x57')]['id']){delete _0x4fd41c[_0xea4c('0x57')]['id'];}return db[_0xea4c('0x4e')]['find']({'where':{'id':_0x4fd41c[_0xea4c('0x53')]['id']}})[_0xea4c('0x1d')](handleEntityNotFound(_0x4914d9,null))[_0xea4c('0x1d')](saveUpdates(_0x4fd41c[_0xea4c('0x57')],null))[_0xea4c('0x1d')](respondWithResult(_0x4914d9,null))['catch'](handleError(_0x4914d9,null));};exports[_0xea4c('0x35')]=function(_0x7390cb,_0x39cc54){return db[_0xea4c('0x4e')][_0xea4c('0x54')]({'where':{'id':_0x7390cb[_0xea4c('0x53')]['id']}})[_0xea4c('0x1d')](handleEntityNotFound(_0x39cc54,null))[_0xea4c('0x1d')](removeEntity(_0x39cc54,null))[_0xea4c('0x28')](handleError(_0x39cc54,null));};exports['describe']=function(_0x37e048,_0x3103c3){return db['ChatMessage'][_0xea4c('0x58')]()[_0xea4c('0x1d')](respondWithResult(_0x3103c3,null))[_0xea4c('0x28')](handleError(_0x3103c3,null));};var interaction_log=require(_0xea4c('0x12'))('chat-interactions');exports['accept']=function(_0x4cd3a2,_0x48ddda,_0x5ba7b4){var _0x2d2d4d={'agent':{},'channel':_0xea4c('0x59')};if(_0x4cd3a2[_0xea4c('0x57')]['id']){delete _0x4cd3a2[_0xea4c('0x57')]['id'];}_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5a')]=!![];_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5b')]=moment()[_0xea4c('0x5c')](_0xea4c('0x5d'));_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')]=_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')]||_0x4cd3a2[_0xea4c('0x5f')]['id'];_0x2d2d4d['agent']['id']=_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')];return db['ChatMessage'][_0xea4c('0x54')]({'where':{'id':_0x4cd3a2[_0xea4c('0x53')]['id'],'UserId':null}})[_0xea4c('0x1d')](handleEntityNotFound(_0x48ddda,null))[_0xea4c('0x1d')](saveUpdates(_0x4cd3a2[_0xea4c('0x57')],null))['then'](function(_0x4a1234){if(_0x4a1234){_0x2d2d4d[_0xea4c('0x26')]=_0x4a1234['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4a1234['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x48ddda,null))[_0xea4c('0x1d')](function(_0x510978){if(_0x510978){return _0x510978[_0xea4c('0x56')]({'UserId':_0x4cd3a2[_0xea4c('0x57')]['UserId'],'read1stAt':_[_0xea4c('0x60')](_0x510978[_0xea4c('0x61')])?moment()['format'](_0xea4c('0x5d')):undefined});}return null;})[_0xea4c('0x1d')](function(_0x3a814c){if(_0x3a814c){_0x2d2d4d[_0xea4c('0x62')]=_0x3a814c[_0xea4c('0x63')]({'plain':!![]});interaction_log[_0xea4c('0x1e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cd3a2[_0xea4c('0x5f')]['id'],_0x4cd3a2[_0xea4c('0x5f')]['name'],_0x4cd3a2[_0xea4c('0x5f')][_0xea4c('0x64')],_0x2d2d4d[_0xea4c('0x62')]['id'],_0x4cd3a2[_0xea4c('0x57')]?JSON['stringify'](_0x4cd3a2[_0xea4c('0x57')]):_0xea4c('0x65'));return respondWithRpcPromise('AcceptMessage',_0xea4c('0x66'),_0x2d2d4d);}return null;})['then'](function(_0x251f46){var _0x3d8475='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x251f46[_0xea4c('0x26')][_0xea4c('0x67')];return db[_0xea4c('0x68')][_0xea4c('0x3f')](_0x3d8475,{'type':db[_0xea4c('0x69')][_0xea4c('0x6a')][_0xea4c('0x6b')],'raw':!![]})[_0xea4c('0x1d')](function(_0x18a5f3){return _0x18a5f3;});})[_0xea4c('0x1d')](function(_0x37d8da){if(_0x37d8da){_0x2d2d4d[_0xea4c('0x26')]['contact']=_0x37d8da[0x0];if(!_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')])return;return db['User'][_0xea4c('0x54')]({'where':{'id':_0x4cd3a2[_0xea4c('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0xea4c('0x37'),_0xea4c('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0xea4c('0x1d')](function(_0x31e41d){if(!_0x31e41d)return null;_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x6d')]=_0x31e41d;return _0x2d2d4d;})['then'](function(_0x34fc6c){if(_0x34fc6c){if(_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x6e')]){_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x6f')]=util[_0xea4c('0x5c')](_0xea4c('0x70'),_0x4cd3a2[_0xea4c('0x5f')][_0xea4c('0x37')]);_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x71')]=_0x2d2d4d['channel'];_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x72')]=_0x2d2d4d[_0xea4c('0x71')];_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x73')]='accept';return respondWithRpcPromise(_0xea4c('0x74'),_0xea4c('0x74'),{'event':_0xea4c('0x75'),'message':_[_0xea4c('0x4c')](_0x2d2d4d[_0xea4c('0x26')],JSON[_0xea4c('0x76')](_0x2d2d4d[_0xea4c('0x62')]['formData']))},client9002)[_0xea4c('0x1d')](function(){return _0x2d2d4d;});}return _0x2d2d4d;}return null;})[_0xea4c('0x1d')](respondWithResult(_0x48ddda,null))[_0xea4c('0x28')](handleError(_0x48ddda,null));};var interaction_log=require('../../config/logger')(_0xea4c('0x77'));exports['reject']=function(_0x4cf9f3,_0x5aca16,_0x5ac821){var _0x47f7a3={'agent':{},'channel':_0xea4c('0x59')};if(_0x4cf9f3['body']['id']){delete _0x4cf9f3[_0xea4c('0x57')]['id'];}_0x4cf9f3['body'][_0xea4c('0x5e')]=_0x4cf9f3[_0xea4c('0x57')][_0xea4c('0x5e')]||_0x4cf9f3[_0xea4c('0x5f')]['id'];_0x47f7a3[_0xea4c('0x6d')]['id']=_0x4cf9f3[_0xea4c('0x57')]['UserId'];return db[_0xea4c('0x4e')][_0xea4c('0x54')]({'where':{'id':_0x4cf9f3['params']['id'],'UserId':null}})[_0xea4c('0x1d')](handleEntityNotFound(_0x5aca16,null))[_0xea4c('0x1d')](function(_0x237153){if(_0x237153){_0x47f7a3[_0xea4c('0x26')]=_0x237153[_0xea4c('0x63')]({'plain':!![]});return db[_0xea4c('0x78')][_0xea4c('0x54')]({'where':{'id':_0x237153['ChatInteractionId']}});}return null;})[_0xea4c('0x1d')](handleEntityNotFound(_0x5aca16,null))[_0xea4c('0x1d')](function(_0x2d9ad7){if(_0x2d9ad7){_0x47f7a3['interaction']=_0x2d9ad7[_0xea4c('0x63')]({'plain':!![]});interaction_log[_0xea4c('0x1e')](_0xea4c('0x79'),_0x4cf9f3['user']['id'],_0x4cf9f3['user'][_0xea4c('0x37')],_0x4cf9f3[_0xea4c('0x5f')]['role'],_0x47f7a3['interaction']['id'],_0x4cf9f3[_0xea4c('0x57')]?JSON[_0xea4c('0x22')](_0x4cf9f3['body']):_0xea4c('0x65'));return respondWithRpcPromise(_0xea4c('0x7a'),_0xea4c('0x7b'),_0x47f7a3);}return null;})[_0xea4c('0x1d')](function(_0x2f7b3f){var _0x2c3969='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2f7b3f[_0xea4c('0x26')][_0xea4c('0x67')];return db['sequelize']['query'](_0x2c3969,{'type':db[_0xea4c('0x69')]['QueryTypes'][_0xea4c('0x6b')],'raw':!![]})['then'](function(_0x130062){return _0x130062;});})[_0xea4c('0x1d')](function(_0x1ec449){if(_0x1ec449){_0x47f7a3[_0xea4c('0x26')][_0xea4c('0x7c')]=_0x1ec449[0x0];if(!_0x4cf9f3[_0xea4c('0x57')][_0xea4c('0x5e')])return;return db[_0xea4c('0x7d')][_0xea4c('0x54')]({'where':{'id':_0x4cf9f3['body'][_0xea4c('0x5e')],'role':_0xea4c('0x6d')},'attributes':['id',_0xea4c('0x37'),_0xea4c('0x6c'),'email',_0xea4c('0x7e')],'raw':!![]});}return null;})[_0xea4c('0x1d')](function(_0x329461){if(!_0x329461)return null;_0x47f7a3[_0xea4c('0x26')][_0xea4c('0x6d')]=_0x329461;return _0x47f7a3;})[_0xea4c('0x1d')](function(_0x51861f){if(_0x51861f){_0x51861f[_0xea4c('0x26')][_0xea4c('0x6f')]=util[_0xea4c('0x5c')]('SIP/%s',_0x4cf9f3['user'][_0xea4c('0x37')]);_0x51861f['message'][_0xea4c('0x71')]=_0x47f7a3[_0xea4c('0x71')];_0x51861f['message'][_0xea4c('0x72')]=_0x47f7a3[_0xea4c('0x71')];_0x51861f[_0xea4c('0x26')][_0xea4c('0x73')]=_0xea4c('0x33');respondWithRpcPromise('EventManager',_0xea4c('0x74'),{'event':'rejectmessage','message':_[_0xea4c('0x4c')](_0x47f7a3[_0xea4c('0x26')],JSON[_0xea4c('0x76')](_0x47f7a3[_0xea4c('0x62')][_0xea4c('0x7f')]))},client9002);return _0x47f7a3;}return null;})[_0xea4c('0x1d')](respondWithResult(_0x5aca16,null))['catch'](handleError(_0x5aca16,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0c78361..3201fd3 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 _0x5aa1=['ChatMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5aa1,0x182));var _0x15aa=function(_0xa650fb,_0x104a00){_0xa650fb=_0xa650fb-0x0;var _0x99f4de=_0x5aa1[_0xa650fb];return _0x99f4de;};'use strict';var EventEmitter=require(_0x15aa('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x15aa('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15aa('0x2'),'afterUpdate':_0x15aa('0x3'),'afterDestroy':_0x15aa('0x4')};function emitEvent(_0xad9fec){return function(_0x23b41d,_0x5b1eb7,_0x429ddc){ChatMessageEvents[_0x15aa('0x5')](_0xad9fec+':'+_0x23b41d['id'],_0x23b41d);ChatMessageEvents[_0x15aa('0x5')](_0xad9fec,_0x23b41d);_0x429ddc(null);};}for(var e in events){if(events[_0x15aa('0x6')](e)){var event=events[e];ChatMessage[_0x15aa('0x7')](e,emitEvent(event));}}module[_0x15aa('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x6a93=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','exports'];(function(_0x5d92d2,_0x399d73){var _0x5e6d11=function(_0x5029a2){while(--_0x5029a2){_0x5d92d2['push'](_0x5d92d2['shift']());}};_0x5e6d11(++_0x399d73);}(_0x6a93,0x180));var _0x36a9=function(_0x5a2415,_0x2db878){_0x5a2415=_0x5a2415-0x0;var _0x55ad6e=_0x6a93[_0x5a2415];return _0x55ad6e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x36a9('0x0'))['db'][_0x36a9('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x36a9('0x2')](0x0);var events={'afterCreate':_0x36a9('0x3'),'afterUpdate':_0x36a9('0x4'),'afterDestroy':_0x36a9('0x5')};function emitEvent(_0x35bee4){return function(_0x4930cb,_0x5abd46,_0x4b511d){ChatMessageEvents['emit'](_0x35bee4+':'+_0x4930cb['id'],_0x4930cb);ChatMessageEvents[_0x36a9('0x6')](_0x35bee4,_0x4930cb);_0x4b511d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x36a9('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index d36b6dc..07fcb1a 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 _0x3f25=['request-promise','rimraf','./chatMessage.attributes','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0x3f25,0xd5));var _0x53f2=function(_0xb3f5d1,_0x38345c){_0xb3f5d1=_0xb3f5d1-0x0;var _0xf256ee=_0x3f25[_0xb3f5d1];return _0xf256ee;};'use strict';var _=require('lodash');var util=require(_0x53f2('0x0'));var logger=require(_0x53f2('0x1'))(_0x53f2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53f2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f2('0x4'));var config=require('../../config/environment');var attributes=require(_0x53f2('0x5'));module['exports']=function(_0x172705,_0x1a7ba3){return _0x172705['define'](_0x53f2('0x6'),attributes,{'tableName':_0x53f2('0x7'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x53f2('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bf2cb,_0x3f9669,_0x420fad){var _0x4621b8=_0x172705[_0x53f2('0x9')];var _0x511e48=_0x5bf2cb[_0x53f2('0xa')]({'plain':!![]});if(_0x511e48[_0x53f2('0xb')][_0x53f2('0xc')]()==='in'||_0x511e48['direction']['toLowerCase']()===_0x53f2('0xd')&&!_0x511e48['secret']&&!_[_0x53f2('0xe')](_0x511e48[_0x53f2('0xf')])){_0x4621b8[_0x53f2('0x10')][_0x53f2('0x11')]({'where':{'id':_0x511e48[_0x53f2('0x12')]}})[_0x53f2('0x13')](function(_0x357955){if(_0x357955){_0x357955['update']({'lastMsgAt':_0x511e48['createdAt'],'lastMsgDirection':_0x511e48['direction'][_0x53f2('0xc')]()});}})[_0x53f2('0x14')](function(_0x3d978f){console[_0x53f2('0x15')](_0x3d978f);});}_0x420fad();}},'charset':_0x53f2('0x16'),'collate':_0x53f2('0x17')});}; \ No newline at end of file +var _0x177a=['secret','isNil','UserId','ChatInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0x177a,0xdd));var _0xa177=function(_0x51536f,_0x178a8b){_0x51536f=_0x51536f-0x0;var _0x89d943=_0x177a[_0x51536f];return _0x89d943;};'use strict';var _=require(_0xa177('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa177('0x1'));var moment=require(_0xa177('0x2'));var BPromise=require(_0xa177('0x3'));var rp=require(_0xa177('0x4'));var fs=require('fs');var path=require(_0xa177('0x5'));var rimraf=require(_0xa177('0x6'));var config=require('../../config/environment');var attributes=require(_0xa177('0x7'));module[_0xa177('0x8')]=function(_0x1f37b0,_0x455737){return _0x1f37b0[_0xa177('0x9')](_0xa177('0xa'),attributes,{'tableName':_0xa177('0xb'),'paranoid':![],'indexes':[{'name':_0xa177('0xc'),'fields':['body'],'type':_0xa177('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53d2ec,_0x2a8a12,_0x210ec5){var _0x4433d2=_0x1f37b0[_0xa177('0xe')];var _0x219c0c=_0x53d2ec[_0xa177('0xf')]({'plain':!![]});if(_0x219c0c[_0xa177('0x10')]['toLowerCase']()==='in'||_0x219c0c[_0xa177('0x10')][_0xa177('0x11')]()===_0xa177('0x12')&&!_0x219c0c[_0xa177('0x13')]&&!_[_0xa177('0x14')](_0x219c0c[_0xa177('0x15')])){_0x4433d2[_0xa177('0x16')]['findOne']({'where':{'id':_0x219c0c['ChatInteractionId']}})[_0xa177('0x17')](function(_0x198a92){if(_0x198a92){_0x198a92[_0xa177('0x18')]({'lastMsgAt':_0x219c0c[_0xa177('0x19')],'lastMsgDirection':_0x219c0c[_0xa177('0x10')][_0xa177('0x11')]()});}})[_0xa177('0x1a')](function(_0xbc9fa4){console[_0xa177('0x1b')](_0xbc9fa4);});}_0x210ec5();}},'charset':_0xa177('0x1c'),'collate':_0xa177('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 6fbd86a..2d9cdd5 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 _0x520a=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','./chatMessage.socket','register','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x520a,0x1de));var _0xa520=function(_0x48b618,_0x7bff4a){_0x48b618=_0x48b618-0x0;var _0x508a99=_0x520a[_0x48b618];return _0x508a99;};'use strict';var _=require(_0xa520('0x0'));var util=require(_0xa520('0x1'));var moment=require(_0xa520('0x2'));var BPromise=require(_0xa520('0x3'));var rs=require(_0xa520('0x4'));var fs=require('fs');var Redis=require(_0xa520('0x5'));var db=require(_0xa520('0x6'))['db'];var utils=require(_0xa520('0x7'));var logger=require(_0xa520('0x8'))(_0xa520('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa520('0xa')]({'port':0x232a});config[_0xa520('0xb')]=_[_0xa520('0xc')](config['redis'],{'host':_0xa520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa520('0xb')]));require(_0xa520('0xe'))[_0xa520('0xf')](socket);function respondWithRpcPromise(_0x14384d,_0x43dc70,_0xd07eec){return new BPromise(function(_0x310a3f,_0x38c6f6){return client['request'](_0x14384d,_0xd07eec)[_0xa520('0x10')](function(_0x2c5ae2){logger[_0xa520('0x11')](_0xa520('0x12'),_0x43dc70,_0xa520('0x13'));logger[_0xa520('0x14')](_0xa520('0x15'),_0x43dc70,_0xa520('0x13'),JSON[_0xa520('0x16')](_0x2c5ae2));if(_0x2c5ae2[_0xa520('0x17')]){if(_0x2c5ae2[_0xa520('0x17')]['code']===0x1f4){logger[_0xa520('0x17')](_0xa520('0x12'),_0x43dc70,_0x2c5ae2[_0xa520('0x17')]['message']);return _0x38c6f6(_0x2c5ae2[_0xa520('0x17')][_0xa520('0x18')]);}logger['error'](_0xa520('0x12'),_0x43dc70,_0x2c5ae2['error'][_0xa520('0x18')]);return _0x310a3f(_0x2c5ae2[_0xa520('0x17')][_0xa520('0x18')]);}else{logger[_0xa520('0x11')](_0xa520('0x12'),_0x43dc70,'request\x20sent');_0x310a3f(_0x2c5ae2[_0xa520('0x19')][_0xa520('0x18')]);}})[_0xa520('0x1a')](function(_0x597f84){logger[_0xa520('0x17')]('ChatMessage,\x20%s,\x20%s',_0x43dc70,_0x597f84);_0x38c6f6(_0x597f84);});});}exports['CreateChatMessage']=function(_0x58e687){var _0x353eab=this;return new Promise(function(_0x438080,_0x4e5aa5){return db[_0xa520('0x1b')][_0xa520('0x1c')](_0x58e687[_0xa520('0x1d')],{'raw':_0x58e687[_0xa520('0x1e')]?_0x58e687[_0xa520('0x1e')][_0xa520('0x1f')]===undefined?!![]:![]:!![]})[_0xa520('0x10')](function(_0x17ed1c){logger[_0xa520('0x11')](_0xa520('0x20'),_0x58e687);logger[_0xa520('0x14')](_0xa520('0x20'),_0x58e687,JSON[_0xa520('0x16')](_0x17ed1c));_0x438080(_0x17ed1c);})[_0xa520('0x1a')](function(_0x4e5f52){logger[_0xa520('0x17')](_0xa520('0x20'),_0x4e5f52[_0xa520('0x18')],_0x58e687);_0x4e5aa5(_0x353eab[_0xa520('0x17')](0x1f4,_0x4e5f52[_0xa520('0x18')]));});});}; \ No newline at end of file +var _0x5831=['body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x242b3d,_0x17ad58){var _0x34958f=function(_0x3a75b7){while(--_0x3a75b7){_0x242b3d['push'](_0x242b3d['shift']());}};_0x34958f(++_0x17ad58);}(_0x5831,0x8c));var _0x1583=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x5831[_0xfd9b19];return _0x514918;};'use strict';var _=require(_0x1583('0x0'));var util=require(_0x1583('0x1'));var moment=require(_0x1583('0x2'));var BPromise=require(_0x1583('0x3'));var rs=require(_0x1583('0x4'));var fs=require('fs');var Redis=require(_0x1583('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1583('0x6'));var logger=require(_0x1583('0x7'))(_0x1583('0x8'));var config=require('../../config/environment');var jayson=require(_0x1583('0x9'));var client=jayson[_0x1583('0xa')][_0x1583('0xb')]({'port':0x232a});config[_0x1583('0xc')]=_[_0x1583('0xd')](config[_0x1583('0xc')],{'host':_0x1583('0xe'),'port':0x18eb});var socket=require(_0x1583('0xf'))(new Redis(config[_0x1583('0xc')]));require(_0x1583('0x10'))[_0x1583('0x11')](socket);function respondWithRpcPromise(_0x53205a,_0x33df2c,_0x1eea64){return new BPromise(function(_0x4a017b,_0x3e4e78){return client[_0x1583('0x12')](_0x53205a,_0x1eea64)[_0x1583('0x13')](function(_0x1c95d9){logger[_0x1583('0x14')](_0x1583('0x15'),_0x33df2c,_0x1583('0x16'));logger['debug'](_0x1583('0x17'),_0x33df2c,_0x1583('0x16'),JSON[_0x1583('0x18')](_0x1c95d9));if(_0x1c95d9['error']){if(_0x1c95d9[_0x1583('0x19')][_0x1583('0x1a')]===0x1f4){logger[_0x1583('0x19')](_0x1583('0x15'),_0x33df2c,_0x1c95d9[_0x1583('0x19')]['message']);return _0x3e4e78(_0x1c95d9[_0x1583('0x19')]['message']);}logger[_0x1583('0x19')](_0x1583('0x15'),_0x33df2c,_0x1c95d9[_0x1583('0x19')][_0x1583('0x1b')]);return _0x4a017b(_0x1c95d9['error'][_0x1583('0x1b')]);}else{logger[_0x1583('0x14')](_0x1583('0x15'),_0x33df2c,_0x1583('0x16'));_0x4a017b(_0x1c95d9[_0x1583('0x1c')][_0x1583('0x1b')]);}})[_0x1583('0x1d')](function(_0x4bc6cb){logger[_0x1583('0x19')]('ChatMessage,\x20%s,\x20%s',_0x33df2c,_0x4bc6cb);_0x3e4e78(_0x4bc6cb);});});}exports['CreateChatMessage']=function(_0x76c34c){var _0x9e2709=this;return new Promise(function(_0x50206d,_0x464721){return db['ChatMessage']['create'](_0x76c34c[_0x1583('0x1e')],{'raw':_0x76c34c[_0x1583('0x1f')]?_0x76c34c['options'][_0x1583('0x20')]===undefined?!![]:![]:!![]})[_0x1583('0x13')](function(_0x2f9ed7){logger[_0x1583('0x14')](_0x1583('0x21'),_0x76c34c);logger['debug'](_0x1583('0x21'),_0x76c34c,JSON[_0x1583('0x18')](_0x2f9ed7));_0x50206d(_0x2f9ed7);})[_0x1583('0x1d')](function(_0x370904){logger[_0x1583('0x19')](_0x1583('0x21'),_0x370904[_0x1583('0x1b')],_0x76c34c);_0x464721(_0x9e2709['error'](0x1f4,_0x370904['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ebed664..d593bd6 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 _0x2975=['update','removeListener','register','length','chatMessage:','save','remove'];(function(_0x4faab0,_0x544bf3){var _0x5b1f25=function(_0xf5d089){while(--_0xf5d089){_0x4faab0['push'](_0x4faab0['shift']());}};_0x5b1f25(++_0x544bf3);}(_0x2975,0x1c5));var _0x5297=function(_0x413db5,_0x556640){_0x413db5=_0x413db5-0x0;var _0x172bb9=_0x2975[_0x413db5];return _0x172bb9;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5297('0x0'),_0x5297('0x1'),_0x5297('0x2')];function createListener(_0x1a511b,_0x115e60){return function(_0x178801){_0x115e60['emit'](_0x1a511b,_0x178801);};}function removeListener(_0x56371f,_0x5e9de3){return function(){ChatMessageEvents[_0x5297('0x3')](_0x56371f,_0x5e9de3);};}exports[_0x5297('0x4')]=function(_0x11a43d){for(var _0x3da9c6=0x0,_0x4d1d2c=events[_0x5297('0x5')];_0x3da9c6<_0x4d1d2c;_0x3da9c6++){var _0x1b72a7=events[_0x3da9c6];var _0x4f12b0=createListener(_0x5297('0x6')+_0x1b72a7,_0x11a43d);ChatMessageEvents['on'](_0x1b72a7,_0x4f12b0);}}; \ No newline at end of file +var _0x43fd=['register','length','save','emit','removeListener'];(function(_0x1e05a9,_0x2e529a){var _0x5be255=function(_0x54c279){while(--_0x54c279){_0x1e05a9['push'](_0x1e05a9['shift']());}};_0x5be255(++_0x2e529a);}(_0x43fd,0x1ec));var _0xd43f=function(_0x538ae2,_0xbff0ca){_0x538ae2=_0x538ae2-0x0;var _0x137049=_0x43fd[_0x538ae2];return _0x137049;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xd43f('0x0'),'remove','update'];function createListener(_0x316ee5,_0x1ead65){return function(_0x484615){_0x1ead65[_0xd43f('0x1')](_0x316ee5,_0x484615);};}function removeListener(_0x48f953,_0x3c2af1){return function(){ChatMessageEvents[_0xd43f('0x2')](_0x48f953,_0x3c2af1);};}exports[_0xd43f('0x3')]=function(_0x33ddff){for(var _0x52e75f=0x0,_0xde214d=events[_0xd43f('0x4')];_0x52e75f<_0xde214d;_0x52e75f++){var _0x20ccd7=events[_0x52e75f];var _0x331163=createListener('chatMessage:'+_0x20ccd7,_0x33ddff);ChatMessageEvents['on'](_0x20ccd7,_0x331163);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 00de4b5..b82bb55 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 _0x844f=['/:id','show','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe'];(function(_0x38c59b,_0x58b8f4){var _0x40fc09=function(_0xae103d){while(--_0xae103d){_0x38c59b['push'](_0x38c59b['shift']());}};_0x40fc09(++_0x58b8f4);}(_0x844f,0x89));var _0xf844=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0x844f[_0x5d7686];return _0x408ab4;};'use strict';var multer=require(_0xf844('0x0'));var util=require(_0xf844('0x1'));var path=require(_0xf844('0x2'));var timeout=require(_0xf844('0x3'));var express=require('express');var router=express[_0xf844('0x4')]();var fs_extra=require(_0xf844('0x5'));var auth=require(_0xf844('0x6'));var interaction=require(_0xf844('0x7'));var config=require(_0xf844('0x8'));var controller=require(_0xf844('0x9'));router[_0xf844('0xa')]('/',auth[_0xf844('0xb')](),controller['index']);router[_0xf844('0xa')](_0xf844('0xc'),auth[_0xf844('0xb')](),controller['describe']);router[_0xf844('0xa')](_0xf844('0xd'),auth[_0xf844('0xb')](),controller[_0xf844('0xe')]);router['post']('/',auth[_0xf844('0xb')](),interaction[_0xf844('0xf')](_0xf844('0x10'),_0xf844('0x11')),controller[_0xf844('0x12')]);router[_0xf844('0x13')](_0xf844('0xd'),controller['update']);router[_0xf844('0x13')](_0xf844('0x14'),auth[_0xf844('0xb')](),controller[_0xf844('0x15')]);router['put'](_0xf844('0x16'),auth[_0xf844('0xb')](),controller['reject']);router[_0xf844('0x17')](_0xf844('0xd'),auth[_0xf844('0xb')](),controller['destroy']);module[_0xf844('0x18')]=router; \ No newline at end of file +var _0x0e51=['chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','isAuthenticated','/:id','show','tracked'];(function(_0x16efb2,_0x59077a){var _0x147206=function(_0xc79a3f){while(--_0xc79a3f){_0x16efb2['push'](_0x16efb2['shift']());}};_0x147206(++_0x59077a);}(_0x0e51,0xe3));var _0x10e5=function(_0x327a56,_0x1e2a01){_0x327a56=_0x327a56-0x0;var _0xf93156=_0x0e51[_0x327a56];return _0xf93156;};'use strict';var multer=require(_0x10e5('0x0'));var util=require(_0x10e5('0x1'));var path=require(_0x10e5('0x2'));var timeout=require(_0x10e5('0x3'));var express=require(_0x10e5('0x4'));var router=express['Router']();var fs_extra=require(_0x10e5('0x5'));var auth=require(_0x10e5('0x6'));var interaction=require(_0x10e5('0x7'));var config=require(_0x10e5('0x8'));var controller=require(_0x10e5('0x9'));router[_0x10e5('0xa')]('/',auth['isAuthenticated'](),controller[_0x10e5('0xb')]);router[_0x10e5('0xa')]('/describe',auth[_0x10e5('0xc')](),controller['describe']);router[_0x10e5('0xa')](_0x10e5('0xd'),auth[_0x10e5('0xc')](),controller[_0x10e5('0xe')]);router['post']('/',auth[_0x10e5('0xc')](),interaction[_0x10e5('0xf')](_0x10e5('0x10'),_0x10e5('0x11')),controller[_0x10e5('0x12')]);router[_0x10e5('0x13')](_0x10e5('0xd'),controller[_0x10e5('0x14')]);router[_0x10e5('0x13')](_0x10e5('0x15'),auth['isAuthenticated'](),controller[_0x10e5('0x16')]);router[_0x10e5('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0x10e5('0x17')]);router[_0x10e5('0x18')](_0x10e5('0xd'),auth['isAuthenticated'](),controller[_0x10e5('0x19')]);module[_0x10e5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 05ee19e..61c4739 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 _0x86eb=['exports','TEXT','medium','sequelize'];(function(_0x456632,_0x4ed53a){var _0x333f66=function(_0x53aafb){while(--_0x53aafb){_0x456632['push'](_0x456632['shift']());}};_0x333f66(++_0x4ed53a);}(_0x86eb,0x123));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb86e('0x0'));module[_0xb86e('0x1')]={'body':{'type':Sequelize[_0xb86e('0x2')](_0xb86e('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x1a68=['TEXT','medium','sequelize','exports'];(function(_0x57b5bf,_0x1e45ed){var _0x1c2194=function(_0x242a1f){while(--_0x242a1f){_0x57b5bf['push'](_0x57b5bf['shift']());}};_0x1c2194(++_0x1e45ed);}(_0x1a68,0x19a));var _0x81a6=function(_0x6422b2,_0x3107fc){_0x6422b2=_0x6422b2-0x0;var _0x41d0b4=_0x1a68[_0x6422b2];return _0x41d0b4;};'use strict';var Sequelize=require(_0x81a6('0x0'));module[_0x81a6('0x1')]={'body':{'type':Sequelize[_0x81a6('0x2')](_0x81a6('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 8c3aaff..2fcf7b9 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(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7a54,0x106));var _0x47a5=function(_0x211a97,_0x368b9e){_0x211a97=_0x211a97-0x0;var _0x466fe8=_0x7a54[_0x211a97];return _0x466fe8;};'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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3fd2fe,_0x410287){var _0x490b81=function(_0xb94835){while(--_0xb94835){_0x3fd2fe['push'](_0x3fd2fe['shift']());}};_0x490b81(++_0x410287);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 8081971..a747cc0 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 _0x300f=['chat_offline_messages','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x300f,0x1ca));var _0xf300=function(_0x153caa,_0xa8bfc3){_0x153caa=_0x153caa-0x0;var _0x53055a=_0x300f[_0x153caa];return _0x53055a;};'use strict';var _=require('lodash');var util=require(_0xf300('0x0'));var logger=require('../../config/logger')(_0xf300('0x1'));var moment=require('moment');var BPromise=require(_0xf300('0x2'));var rp=require(_0xf300('0x3'));var fs=require('fs');var path=require(_0xf300('0x4'));var rimraf=require(_0xf300('0x5'));var config=require(_0xf300('0x6'));var attributes=require(_0xf300('0x7'));module[_0xf300('0x8')]=function(_0x4001e2,_0x614d23){return _0x4001e2[_0xf300('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0xf300('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf300('0xb')});}; \ No newline at end of file +var _0xb2c7=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatOfflineMessage.attributes','define','chat_offline_messages'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb2c7,0x199));var _0x7b2c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb2c7[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x7b2c('0x0'));var logger=require(_0x7b2c('0x1'))('api');var moment=require(_0x7b2c('0x2'));var BPromise=require(_0x7b2c('0x3'));var rp=require(_0x7b2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7b2c('0x5'));var attributes=require(_0x7b2c('0x6'));module['exports']=function(_0x3872cf,_0x4b47c6){return _0x3872cf[_0x7b2c('0x7')]('ChatOfflineMessage',attributes,{'tableName':_0x7b2c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b2c('0x9'),'collate':_0x7b2c('0xa')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 07c60e4..81800f0 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 _0x372b=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x372b,0x18a));var _0xb372=function(_0x24e3f0,_0x3086cb){_0x24e3f0=_0x24e3f0-0x0;var _0x1bace1=_0x372b[_0x24e3f0];return _0x1bace1;};'use strict';var _=require(_0xb372('0x0'));var util=require(_0xb372('0x1'));var moment=require('moment');var BPromise=require(_0xb372('0x2'));var rs=require(_0xb372('0x3'));var fs=require('fs');var Redis=require(_0xb372('0x4'));var db=require(_0xb372('0x5'))['db'];var utils=require(_0xb372('0x6'));var logger=require(_0xb372('0x7'))('rpc');var config=require(_0xb372('0x8'));var jayson=require(_0xb372('0x9'));var client=jayson[_0xb372('0xa')][_0xb372('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39c4ac,_0x3a83ed,_0x1a6925){return new BPromise(function(_0x6a7a15,_0xefe498){return client[_0xb372('0xc')](_0x39c4ac,_0x1a6925)[_0xb372('0xd')](function(_0xf42a9b){logger['info'](_0xb372('0xe'),_0x3a83ed,_0xb372('0xf'));logger['debug'](_0xb372('0x10'),_0x3a83ed,_0xb372('0xf'),JSON['stringify'](_0xf42a9b));if(_0xf42a9b[_0xb372('0x11')]){if(_0xf42a9b[_0xb372('0x11')][_0xb372('0x12')]===0x1f4){logger['error'](_0xb372('0xe'),_0x3a83ed,_0xf42a9b[_0xb372('0x11')][_0xb372('0x13')]);return _0xefe498(_0xf42a9b[_0xb372('0x11')][_0xb372('0x13')]);}logger[_0xb372('0x11')](_0xb372('0xe'),_0x3a83ed,_0xf42a9b['error'][_0xb372('0x13')]);return _0x6a7a15(_0xf42a9b[_0xb372('0x11')]['message']);}else{logger[_0xb372('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3a83ed,_0xb372('0xf'));_0x6a7a15(_0xf42a9b[_0xb372('0x15')][_0xb372('0x13')]);}})[_0xb372('0x16')](function(_0x1704b6){logger['error'](_0xb372('0xe'),_0x3a83ed,_0x1704b6);_0xefe498(_0x1704b6);});});} \ No newline at end of file +var _0x5ad6=['catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x2a4f5a,_0x54f259){var _0x3eafc7=function(_0x486a2a){while(--_0x486a2a){_0x2a4f5a['push'](_0x2a4f5a['shift']());}};_0x3eafc7(++_0x54f259);}(_0x5ad6,0xfd));var _0x65ad=function(_0x9a8878,_0x2ef1b8){_0x9a8878=_0x9a8878-0x0;var _0x5f36a8=_0x5ad6[_0x9a8878];return _0x5f36a8;};'use strict';var _=require(_0x65ad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x65ad('0x1'));var fs=require('fs');var Redis=require(_0x65ad('0x2'));var db=require(_0x65ad('0x3'))['db'];var utils=require(_0x65ad('0x4'));var logger=require(_0x65ad('0x5'))(_0x65ad('0x6'));var config=require(_0x65ad('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a1d63,_0x8cbc9b,_0x369b83){return new BPromise(function(_0x356106,_0xb2b31b){return client[_0x65ad('0x9')](_0x5a1d63,_0x369b83)['then'](function(_0xdd871b){logger[_0x65ad('0xa')](_0x65ad('0xb'),_0x8cbc9b,'request\x20sent');logger[_0x65ad('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x8cbc9b,_0x65ad('0xd'),JSON[_0x65ad('0xe')](_0xdd871b));if(_0xdd871b[_0x65ad('0xf')]){if(_0xdd871b[_0x65ad('0xf')]['code']===0x1f4){logger[_0x65ad('0xf')](_0x65ad('0xb'),_0x8cbc9b,_0xdd871b[_0x65ad('0xf')]['message']);return _0xb2b31b(_0xdd871b['error'][_0x65ad('0x10')]);}logger[_0x65ad('0xf')](_0x65ad('0xb'),_0x8cbc9b,_0xdd871b['error'][_0x65ad('0x10')]);return _0x356106(_0xdd871b[_0x65ad('0xf')][_0x65ad('0x10')]);}else{logger['info'](_0x65ad('0xb'),_0x8cbc9b,_0x65ad('0xd'));_0x356106(_0xdd871b['result'][_0x65ad('0x10')]);}})[_0x65ad('0x11')](function(_0xfe8a42){logger['error'](_0x65ad('0xb'),_0x8cbc9b,_0xfe8a42);_0xb2b31b(_0xfe8a42);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b1fa3ad..6927591 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 _0xc43d=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update'];(function(_0x853aa8,_0x263572){var _0x171e8b=function(_0x58e1a0){while(--_0x58e1a0){_0x853aa8['push'](_0x853aa8['shift']());}};_0x171e8b(++_0x263572);}(_0xc43d,0xc6));var _0xdc43=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0xc43d[_0x239dba];return _0x1ceb11;};'use strict';var multer=require(_0xdc43('0x0'));var util=require(_0xdc43('0x1'));var path=require(_0xdc43('0x2'));var timeout=require(_0xdc43('0x3'));var express=require(_0xdc43('0x4'));var router=express[_0xdc43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdc43('0x6'));var interaction=require(_0xdc43('0x7'));var config=require('../../config/environment');var controller=require(_0xdc43('0x8'));router[_0xdc43('0x9')]('/',auth[_0xdc43('0xa')](),controller['index']);router[_0xdc43('0x9')](_0xdc43('0xb'),auth[_0xdc43('0xa')](),controller[_0xdc43('0xc')]);router['get']('/:id',auth[_0xdc43('0xa')](),controller[_0xdc43('0xd')]);router[_0xdc43('0xe')]('/',auth[_0xdc43('0xa')](),controller['create']);router[_0xdc43('0xf')](_0xdc43('0x10'),auth[_0xdc43('0xa')](),controller[_0xdc43('0x11')]);router['delete'](_0xdc43('0x10'),auth[_0xdc43('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfcb6=['/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe'];(function(_0x50e5b5,_0x5f29fe){var _0x1f3b00=function(_0x6c441b){while(--_0x6c441b){_0x50e5b5['push'](_0x50e5b5['shift']());}};_0x1f3b00(++_0x5f29fe);}(_0xfcb6,0x1ab));var _0x6fcb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xfcb6[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require(_0x6fcb('0x0'));var util=require(_0x6fcb('0x1'));var path=require(_0x6fcb('0x2'));var timeout=require(_0x6fcb('0x3'));var express=require(_0x6fcb('0x4'));var router=express[_0x6fcb('0x5')]();var fs_extra=require(_0x6fcb('0x6'));var auth=require(_0x6fcb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6fcb('0x8'));var controller=require(_0x6fcb('0x9'));router[_0x6fcb('0xa')]('/',auth['isAuthenticated'](),controller[_0x6fcb('0xb')]);router[_0x6fcb('0xa')]('/describe',auth[_0x6fcb('0xc')](),controller[_0x6fcb('0xd')]);router['get'](_0x6fcb('0xe'),auth['isAuthenticated'](),controller[_0x6fcb('0xf')]);router[_0x6fcb('0x10')]('/',auth[_0x6fcb('0xc')](),controller[_0x6fcb('0x11')]);router[_0x6fcb('0x12')](_0x6fcb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6fcb('0xc')](),controller[_0x6fcb('0x13')]);module[_0x6fcb('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a8f5669..7e5cc25 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 _0x0d5b=['mouseOver','timeout','STRING'];(function(_0x3f32ca,_0x2212f2){var _0xf444d=function(_0x4b5b04){while(--_0x4b5b04){_0x3f32ca['push'](_0x3f32ca['shift']());}};_0xf444d(++_0x2212f2);}(_0x0d5b,0xa7));var _0xb0d5=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x0d5b[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb0d5('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb0d5('0x1'),_0xb0d5('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb0d5('0x0')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdeba=['STRING','ENUM','mouseOver','INTEGER','exports'];(function(_0x554dbf,_0x30b7da){var _0x15a0fc=function(_0x338366){while(--_0x338366){_0x554dbf['push'](_0x554dbf['shift']());}};_0x15a0fc(++_0x30b7da);}(_0xdeba,0x9f));var _0xadeb=function(_0x5306f7,_0x474241){_0x5306f7=_0x5306f7-0x0;var _0x47ee7b=_0xdeba[_0x5306f7];return _0x47ee7b;};'use strict';var Sequelize=require('sequelize');module[_0xadeb('0x0')]={'name':{'type':Sequelize[_0xadeb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xadeb('0x2')]('mouseOver','timeout'),'defaultValue':_0xadeb('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xadeb('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index a6e481f..d895b54 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 _0x3a0f=['send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','create','body','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x427f79,_0xa9b4c){var _0x51e7a3=function(_0x396afe){while(--_0x396afe){_0x427f79['push'](_0x427f79['shift']());}};_0x51e7a3(++_0xa9b4c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x13c2ce,_0x13bc0d){_0x13c2ce=_0x13c2ce-0x0;var _0xe4f616=_0x3a0f[_0x13c2ce];return _0xe4f616;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf3a0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf3a0('0x1'));var BPromise=require(_0xf3a0('0x2'));var Mustache=require(_0xf3a0('0x3'));var util=require(_0xf3a0('0x4'));var path=require(_0xf3a0('0x5'));var sox=require(_0xf3a0('0x6'));var csv=require(_0xf3a0('0x7'));var ejs=require(_0xf3a0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3a0('0x9'));var squel=require(_0xf3a0('0xa'));var crypto=require(_0xf3a0('0xb'));var jsforce=require(_0xf3a0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3a0('0x7'));var querystring=require(_0xf3a0('0xd'));var Papa=require(_0xf3a0('0xe'));var Redis=require(_0xf3a0('0xf'));var authService=require(_0xf3a0('0x10'));var qs=require(_0xf3a0('0x11'));var as=require(_0xf3a0('0x12'));var hardwareService=require(_0xf3a0('0x13'));var logger=require('../../config/logger')(_0xf3a0('0x14'));var utils=require(_0xf3a0('0x15'));var config=require(_0xf3a0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3a0('0x17'))['db'];function respondWithStatusCode(_0x923225,_0x19e98c){_0x19e98c=_0x19e98c||0xcc;return function(_0x543728){if(_0x543728){return _0x923225['sendStatus'](_0x19e98c);}return _0x923225[_0xf3a0('0x18')](_0x19e98c)[_0xf3a0('0x19')]();};}function respondWithResult(_0x42522c,_0x426ef3){_0x426ef3=_0x426ef3||0xc8;return function(_0x49b5ff){if(_0x49b5ff){return _0x42522c[_0xf3a0('0x18')](_0x426ef3)[_0xf3a0('0x1a')](_0x49b5ff);}};}function respondWithFilteredResult(_0x34ec7c,_0x223336){return function(_0x2ff90a){if(_0x2ff90a){var _0x239a70=typeof _0x223336[_0xf3a0('0x1b')]===_0xf3a0('0x1c')&&typeof _0x223336['limit']==='undefined';var _0x1be8b9=_0x2ff90a[_0xf3a0('0x1d')];var _0x2c3eba=_0x239a70?0x0:_0x223336[_0xf3a0('0x1b')];var _0x3a47c1=_0x239a70?_0x2ff90a[_0xf3a0('0x1d')]:_0x223336['offset']+_0x223336['limit'];var _0x29d478;if(_0x3a47c1>=_0x1be8b9){_0x3a47c1=_0x1be8b9;_0x29d478=0xc8;}else{_0x29d478=0xce;}_0x34ec7c[_0xf3a0('0x18')](_0x29d478);return _0x34ec7c[_0xf3a0('0x1e')](_0xf3a0('0x1f'),_0x2c3eba+'-'+_0x3a47c1+'/'+_0x1be8b9)[_0xf3a0('0x1a')](_0x2ff90a);}return null;};}function patchUpdates(_0x4f36ae){return function(_0x57a94b){try{jsonpatch[_0xf3a0('0x20')](_0x57a94b,_0x4f36ae,!![]);}catch(_0x4bc714){return BPromise[_0xf3a0('0x21')](_0x4bc714);}return _0x57a94b[_0xf3a0('0x22')]();};}function saveUpdates(_0x307bd4,_0xa984f2){return function(_0x2de459){if(_0x2de459){return _0x2de459[_0xf3a0('0x23')](_0x307bd4)[_0xf3a0('0x24')](function(_0xe7926){return _0xe7926;});}return null;};}function removeEntity(_0x131ab4,_0x2a0955){return function(_0x422601){if(_0x422601){return _0x422601[_0xf3a0('0x25')]()[_0xf3a0('0x24')](function(){_0x131ab4[_0xf3a0('0x18')](0xcc)[_0xf3a0('0x19')]();});}};}function handleEntityNotFound(_0x5569a9,_0x2c4f45){return function(_0x182ce6){if(!_0x182ce6){_0x5569a9[_0xf3a0('0x26')](0x194);}return _0x182ce6;};}function handleError(_0x12ba21,_0x281037){_0x281037=_0x281037||0x1f4;return function(_0x10b5cd){logger[_0xf3a0('0x27')](_0x10b5cd[_0xf3a0('0x28')]);if(_0x10b5cd['name']){delete _0x10b5cd['name'];}_0x12ba21['status'](_0x281037)[_0xf3a0('0x29')](_0x10b5cd);};}exports[_0xf3a0('0x2a')]=function(_0x252f89,_0x260bf2){var _0x51cf50={'raw':!![],'where':{'id':_0x252f89[_0xf3a0('0x2b')]['id']}},_0x2adb99={};_0x2adb99[_0xf3a0('0x2c')]=_[_0xf3a0('0x2d')](db[_0xf3a0('0x2e')][_0xf3a0('0x2f')]);_0x2adb99['query']=_[_0xf3a0('0x2d')](_0x252f89[_0xf3a0('0x30')]);_0x2adb99[_0xf3a0('0x31')]=_[_0xf3a0('0x32')](_0x2adb99[_0xf3a0('0x2c')],_0x2adb99[_0xf3a0('0x30')]);_0x51cf50['attributes']=_[_0xf3a0('0x32')](_0x2adb99[_0xf3a0('0x2c')],qs[_0xf3a0('0x33')](_0x252f89[_0xf3a0('0x30')][_0xf3a0('0x33')]));_0x51cf50[_0xf3a0('0x34')]=_0x51cf50[_0xf3a0('0x34')]['length']?_0x51cf50['attributes']:_0x2adb99[_0xf3a0('0x2c')];if(_0x252f89[_0xf3a0('0x30')][_0xf3a0('0x35')]){_0x51cf50[_0xf3a0('0x36')]=[{'all':!![]}];}_0x51cf50=_[_0xf3a0('0x37')]({},_0x51cf50,_0x252f89[_0xf3a0('0x38')]);return db[_0xf3a0('0x2e')][_0xf3a0('0x39')](_0x51cf50)['then'](handleEntityNotFound(_0x260bf2,null))[_0xf3a0('0x24')](respondWithResult(_0x260bf2,null))[_0xf3a0('0x3a')](handleError(_0x260bf2,null));};exports[_0xf3a0('0x3b')]=function(_0x5e3479,_0x352f51){return db[_0xf3a0('0x2e')][_0xf3a0('0x3b')](_0x5e3479[_0xf3a0('0x3c')],{})['then'](respondWithResult(_0x352f51,0xc9))[_0xf3a0('0x3a')](handleError(_0x352f51,null));};exports[_0xf3a0('0x23')]=function(_0x4e97fb,_0x5cf5ae){if(_0x4e97fb[_0xf3a0('0x3c')]['id']){delete _0x4e97fb[_0xf3a0('0x3c')]['id'];}return db[_0xf3a0('0x2e')][_0xf3a0('0x39')]({'where':{'id':_0x4e97fb['params']['id']}})[_0xf3a0('0x24')](handleEntityNotFound(_0x5cf5ae,null))[_0xf3a0('0x24')](saveUpdates(_0x4e97fb['body'],null))[_0xf3a0('0x24')](respondWithResult(_0x5cf5ae,null))[_0xf3a0('0x3a')](handleError(_0x5cf5ae,null));};exports[_0xf3a0('0x25')]=function(_0x4436b4,_0x256e2d){return db[_0xf3a0('0x2e')][_0xf3a0('0x39')]({'where':{'id':_0x4436b4[_0xf3a0('0x2b')]['id']}})['then'](handleEntityNotFound(_0x256e2d,null))[_0xf3a0('0x24')](removeEntity(_0x256e2d,null))[_0xf3a0('0x3a')](handleError(_0x256e2d,null));}; \ No newline at end of file +var _0x54da=['moment','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','name','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','options','catch','create','update','body','find','destroy','eml-format','zip-dir'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x54da,0x9d));var _0xa54d=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0x54da[_0x43d0dd];return _0x233879;};'use strict';var emlformat=require(_0xa54d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa54d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa54d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa54d('0x3'));var util=require(_0xa54d('0x4'));var path=require(_0xa54d('0x5'));var sox=require(_0xa54d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa54d('0x7'));var _=require(_0xa54d('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa54d('0x9'));var toCsv=require(_0xa54d('0xa'));var querystring=require(_0xa54d('0xb'));var Papa=require('papaparse');var Redis=require(_0xa54d('0xc'));var authService=require(_0xa54d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa54d('0xe'));var logger=require('../../config/logger')(_0xa54d('0xf'));var utils=require(_0xa54d('0x10'));var config=require(_0xa54d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa54d('0x12'))['db'];function respondWithStatusCode(_0x4aa983,_0x4f1d93){_0x4f1d93=_0x4f1d93||0xcc;return function(_0x5ea2b6){if(_0x5ea2b6){return _0x4aa983[_0xa54d('0x13')](_0x4f1d93);}return _0x4aa983[_0xa54d('0x14')](_0x4f1d93)[_0xa54d('0x15')]();};}function respondWithResult(_0x11d38f,_0xd5c470){_0xd5c470=_0xd5c470||0xc8;return function(_0x5f30f9){if(_0x5f30f9){return _0x11d38f[_0xa54d('0x14')](_0xd5c470)[_0xa54d('0x16')](_0x5f30f9);}};}function respondWithFilteredResult(_0x272e8d,_0xdf2d8){return function(_0x23cd06){if(_0x23cd06){var _0xfc1686=typeof _0xdf2d8[_0xa54d('0x17')]===_0xa54d('0x18')&&typeof _0xdf2d8[_0xa54d('0x19')]===_0xa54d('0x18');var _0x3227f7=_0x23cd06[_0xa54d('0x1a')];var _0x49e221=_0xfc1686?0x0:_0xdf2d8[_0xa54d('0x17')];var _0x1fd2bc=_0xfc1686?_0x23cd06[_0xa54d('0x1a')]:_0xdf2d8[_0xa54d('0x17')]+_0xdf2d8[_0xa54d('0x19')];var _0xa4a36b;if(_0x1fd2bc>=_0x3227f7){_0x1fd2bc=_0x3227f7;_0xa4a36b=0xc8;}else{_0xa4a36b=0xce;}_0x272e8d['status'](_0xa4a36b);return _0x272e8d['set'](_0xa54d('0x1b'),_0x49e221+'-'+_0x1fd2bc+'/'+_0x3227f7)[_0xa54d('0x16')](_0x23cd06);}return null;};}function patchUpdates(_0x44cc3d){return function(_0x23fc6d){try{jsonpatch[_0xa54d('0x1c')](_0x23fc6d,_0x44cc3d,!![]);}catch(_0x2d5893){return BPromise[_0xa54d('0x1d')](_0x2d5893);}return _0x23fc6d[_0xa54d('0x1e')]();};}function saveUpdates(_0x4e4250,_0x42a376){return function(_0x47b7ea){if(_0x47b7ea){return _0x47b7ea['update'](_0x4e4250)[_0xa54d('0x1f')](function(_0x99c1b3){return _0x99c1b3;});}return null;};}function removeEntity(_0x5b135f,_0x5695ad){return function(_0x1447d8){if(_0x1447d8){return _0x1447d8['destroy']()[_0xa54d('0x1f')](function(){_0x5b135f[_0xa54d('0x14')](0xcc)[_0xa54d('0x15')]();});}};}function handleEntityNotFound(_0x346086,_0x37dd6c){return function(_0x468d2e){if(!_0x468d2e){_0x346086[_0xa54d('0x13')](0x194);}return _0x468d2e;};}function handleError(_0x33eb45,_0x4497a0){_0x4497a0=_0x4497a0||0x1f4;return function(_0x15030a){logger[_0xa54d('0x20')](_0x15030a['stack']);if(_0x15030a[_0xa54d('0x21')]){delete _0x15030a[_0xa54d('0x21')];}_0x33eb45[_0xa54d('0x14')](_0x4497a0)['send'](_0x15030a);};}exports[_0xa54d('0x22')]=function(_0xb8661f,_0x13f701){var _0x58b625={'raw':!![],'where':{'id':_0xb8661f[_0xa54d('0x23')]['id']}},_0x2e10ff={};_0x2e10ff['model']=_[_0xa54d('0x24')](db[_0xa54d('0x25')]['rawAttributes']);_0x2e10ff[_0xa54d('0x26')]=_[_0xa54d('0x24')](_0xb8661f['query']);_0x2e10ff['filters']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],_0x2e10ff['query']);_0x58b625['attributes']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],qs[_0xa54d('0x29')](_0xb8661f['query']['fields']));_0x58b625['attributes']=_0x58b625[_0xa54d('0x2a')][_0xa54d('0x2b')]?_0x58b625['attributes']:_0x2e10ff[_0xa54d('0x28')];if(_0xb8661f[_0xa54d('0x26')][_0xa54d('0x2c')]){_0x58b625[_0xa54d('0x2d')]=[{'all':!![]}];}_0x58b625=_['merge']({},_0x58b625,_0xb8661f[_0xa54d('0x2e')]);return db[_0xa54d('0x25')]['find'](_0x58b625)[_0xa54d('0x1f')](handleEntityNotFound(_0x13f701,null))[_0xa54d('0x1f')](respondWithResult(_0x13f701,null))[_0xa54d('0x2f')](handleError(_0x13f701,null));};exports[_0xa54d('0x30')]=function(_0x2ecf81,_0x69b869){return db[_0xa54d('0x25')][_0xa54d('0x30')](_0x2ecf81['body'],{})['then'](respondWithResult(_0x69b869,0xc9))[_0xa54d('0x2f')](handleError(_0x69b869,null));};exports[_0xa54d('0x31')]=function(_0x59627b,_0x49d4b8){if(_0x59627b[_0xa54d('0x32')]['id']){delete _0x59627b[_0xa54d('0x32')]['id'];}return db['ChatProactiveAction'][_0xa54d('0x33')]({'where':{'id':_0x59627b[_0xa54d('0x23')]['id']}})['then'](handleEntityNotFound(_0x49d4b8,null))[_0xa54d('0x1f')](saveUpdates(_0x59627b['body'],null))[_0xa54d('0x1f')](respondWithResult(_0x49d4b8,null))[_0xa54d('0x2f')](handleError(_0x49d4b8,null));};exports[_0xa54d('0x34')]=function(_0x482af2,_0x4f9eab){return db[_0xa54d('0x25')][_0xa54d('0x33')]({'where':{'id':_0x482af2[_0xa54d('0x23')]['id']}})[_0xa54d('0x1f')](handleEntityNotFound(_0x4f9eab,null))[_0xa54d('0x1f')](removeEntity(_0x4f9eab,null))[_0xa54d('0x2f')](handleError(_0x4f9eab,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index baa29f3..b8419ff 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 _0xb716=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xb716,0x66));var _0x6b71=function(_0x40e503,_0x217c9b){_0x40e503=_0x40e503-0x0;var _0x3ba3a1=_0xb716[_0x40e503];return _0x3ba3a1;};'use strict';var _=require(_0x6b71('0x0'));var util=require(_0x6b71('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b71('0x2'));var BPromise=require(_0x6b71('0x3'));var rp=require(_0x6b71('0x4'));var fs=require('fs');var path=require(_0x6b71('0x5'));var rimraf=require(_0x6b71('0x6'));var config=require(_0x6b71('0x7'));var attributes=require(_0x6b71('0x8'));module[_0x6b71('0x9')]=function(_0x346fd8,_0x1dcfd4){return _0x346fd8['define'](_0x6b71('0xa'),attributes,{'tableName':_0x6b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6cb=['chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0xadb3d8,_0x38cfde){var _0x12d6a0=function(_0xbb1924){while(--_0xbb1924){_0xadb3d8['push'](_0xadb3d8['shift']());}};_0x12d6a0(++_0x38cfde);}(_0xe6cb,0x12c));var _0xbe6c=function(_0x37bae1,_0x3c05af){_0x37bae1=_0x37bae1-0x0;var _0x3b3f22=_0xe6cb[_0x37bae1];return _0x3b3f22;};'use strict';var _=require(_0xbe6c('0x0'));var util=require(_0xbe6c('0x1'));var logger=require(_0xbe6c('0x2'))(_0xbe6c('0x3'));var moment=require('moment');var BPromise=require(_0xbe6c('0x4'));var rp=require(_0xbe6c('0x5'));var fs=require('fs');var path=require(_0xbe6c('0x6'));var rimraf=require(_0xbe6c('0x7'));var config=require(_0xbe6c('0x8'));var attributes=require(_0xbe6c('0x9'));module['exports']=function(_0x4c988c,_0xbc3ffc){return _0x4c988c[_0xbe6c('0xa')](_0xbe6c('0xb'),attributes,{'tableName':_0xbe6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 292080b..2d49f8a 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 _0x0123=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x456026,_0x3535b2){var _0x1dc941=function(_0x3d0864){while(--_0x3d0864){_0x456026['push'](_0x456026['shift']());}};_0x1dc941(++_0x3535b2);}(_0x0123,0x191));var _0x3012=function(_0x6d16c6,_0x3d150a){_0x6d16c6=_0x6d16c6-0x0;var _0x436ffc=_0x0123[_0x6d16c6];return _0x436ffc;};'use strict';var _=require('lodash');var util=require(_0x3012('0x0'));var moment=require(_0x3012('0x1'));var BPromise=require(_0x3012('0x2'));var rs=require(_0x3012('0x3'));var fs=require('fs');var Redis=require(_0x3012('0x4'));var db=require(_0x3012('0x5'))['db'];var utils=require(_0x3012('0x6'));var logger=require(_0x3012('0x7'))(_0x3012('0x8'));var config=require(_0x3012('0x9'));var jayson=require(_0x3012('0xa'));var client=jayson[_0x3012('0xb')][_0x3012('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ce6e6,_0x2fd453,_0x1de7fe){return new BPromise(function(_0x27684d,_0x4387bd){return client[_0x3012('0xd')](_0x2ce6e6,_0x1de7fe)[_0x3012('0xe')](function(_0x1952f6){logger[_0x3012('0xf')](_0x3012('0x10'),_0x2fd453,_0x3012('0x11'));logger[_0x3012('0x12')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2fd453,'request\x20sent',JSON[_0x3012('0x13')](_0x1952f6));if(_0x1952f6[_0x3012('0x14')]){if(_0x1952f6['error']['code']===0x1f4){logger['error'](_0x3012('0x10'),_0x2fd453,_0x1952f6[_0x3012('0x14')]['message']);return _0x4387bd(_0x1952f6[_0x3012('0x14')][_0x3012('0x15')]);}logger[_0x3012('0x14')](_0x3012('0x10'),_0x2fd453,_0x1952f6[_0x3012('0x14')][_0x3012('0x15')]);return _0x27684d(_0x1952f6[_0x3012('0x14')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2fd453,_0x3012('0x11'));_0x27684d(_0x1952f6[_0x3012('0x16')][_0x3012('0x15')]);}})[_0x3012('0x17')](function(_0xf0b928){logger[_0x3012('0x14')](_0x3012('0x10'),_0x2fd453,_0xf0b928);_0x4387bd(_0xf0b928);});});} \ No newline at end of file +var _0x351b=['error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20d71f,_0x3a8ea1){var _0x25139=function(_0x4ff467){while(--_0x4ff467){_0x20d71f['push'](_0x20d71f['shift']());}};_0x25139(++_0x3a8ea1);}(_0x351b,0x7d));var _0xb351=function(_0x37723a,_0x60b0c1){_0x37723a=_0x37723a-0x0;var _0x32c835=_0x351b[_0x37723a];return _0x32c835;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb351('0x0'));var BPromise=require(_0xb351('0x1'));var rs=require(_0xb351('0x2'));var fs=require('fs');var Redis=require(_0xb351('0x3'));var db=require(_0xb351('0x4'))['db'];var utils=require(_0xb351('0x5'));var logger=require(_0xb351('0x6'))(_0xb351('0x7'));var config=require(_0xb351('0x8'));var jayson=require(_0xb351('0x9'));var client=jayson[_0xb351('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3772b4,_0x2ada1d,_0x367e2e){return new BPromise(function(_0x2387d7,_0x499170){return client[_0xb351('0xb')](_0x3772b4,_0x367e2e)[_0xb351('0xc')](function(_0x1a84c8){logger[_0xb351('0xd')](_0xb351('0xe'),_0x2ada1d,_0xb351('0xf'));logger[_0xb351('0x10')](_0xb351('0x11'),_0x2ada1d,_0xb351('0xf'),JSON[_0xb351('0x12')](_0x1a84c8));if(_0x1a84c8[_0xb351('0x13')]){if(_0x1a84c8[_0xb351('0x13')][_0xb351('0x14')]===0x1f4){logger[_0xb351('0x13')](_0xb351('0xe'),_0x2ada1d,_0x1a84c8[_0xb351('0x13')][_0xb351('0x15')]);return _0x499170(_0x1a84c8[_0xb351('0x13')][_0xb351('0x15')]);}logger[_0xb351('0x13')](_0xb351('0xe'),_0x2ada1d,_0x1a84c8[_0xb351('0x13')][_0xb351('0x15')]);return _0x2387d7(_0x1a84c8[_0xb351('0x13')]['message']);}else{logger[_0xb351('0xd')](_0xb351('0xe'),_0x2ada1d,_0xb351('0xf'));_0x2387d7(_0x1a84c8[_0xb351('0x16')][_0xb351('0x15')]);}})[_0xb351('0x17')](function(_0x5b5ff6){logger[_0xb351('0x13')](_0xb351('0xe'),_0x2ada1d,_0x5b5ff6);_0x499170(_0x5b5ff6);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d80a5ac..aa7be8c 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x5ddafe,_0x1fb508){var _0x5e23aa=function(_0x423efc){while(--_0x423efc){_0x5ddafe['push'](_0x5ddafe['shift']());}};_0x5e23aa(++_0x1fb508);}(_0xa630,0xbe));var _0x0a63=function(_0x55b05a,_0x271eea){_0x55b05a=_0x55b05a-0x0;var _0x1fb7da=_0xa630[_0x55b05a];return _0x1fb7da;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router; \ No newline at end of file +var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x121b02,_0x2978ba){var _0x25048e=function(_0x2d1ed2){while(--_0x2d1ed2){_0x121b02['push'](_0x121b02['shift']());}};_0x25048e(++_0x2978ba);}(_0xd8fb,0x99));var _0xbd8f=function(_0x415599,_0x35740b){_0x415599=_0x415599-0x0;var _0x307cfe=_0xd8fb[_0x415599];return _0x307cfe;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f2314d9..9d2d74a 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 _0xec2e=['INTEGER','ENUM','beepall','roundrobin','STRING','name'];(function(_0x503620,_0x5d50f4){var _0x39f4e3=function(_0x26f222){while(--_0x26f222){_0x503620['push'](_0x503620['shift']());}};_0x39f4e3(++_0x5d50f4);}(_0xec2e,0x112));var _0xeec2=function(_0x4cacc5,_0x38c6a9){_0x4cacc5=_0x4cacc5-0x0;var _0x321014=_0xec2e[_0x4cacc5];return _0x321014;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeec2('0x0')],'unique':_0xeec2('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeec2('0x0')]},'timeout':{'type':Sequelize[_0xeec2('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeec2('0x3')]('rrmemory',_0xeec2('0x4'),_0xeec2('0x5'))}}; \ No newline at end of file +var _0xa31e=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa31e,0x136));var _0xea31=function(_0x415ff8,_0x176fb5){_0x415ff8=_0x415ff8-0x0;var _0x1f347a=_0xa31e[_0x415ff8];return _0x1f347a;};'use strict';var Sequelize=require(_0xea31('0x0'));module[_0xea31('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xea31('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea31('0x3')]('rrmemory',_0xea31('0x4'),_0xea31('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 9a63ca1..9672dae 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 _0x1839=['UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','union','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','order','getAgents','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','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','Content-Range','json','apply','reject','save','then','destroy','get','ChatQueues','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','ChatQueueId'];(function(_0x5ad171,_0x14a45b){var _0x4c9d82=function(_0x2ffe08){while(--_0x2ffe08){_0x5ad171['push'](_0x5ad171['shift']());}};_0x4c9d82(++_0x14a45b);}(_0x1839,0xcb));var _0x9183=function(_0x3e9f07,_0x5868a2){_0x3e9f07=_0x3e9f07-0x0;var _0xf7d079=_0x1839[_0x3e9f07];return _0xf7d079;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9183('0x0'));var jsonpatch=require(_0x9183('0x1'));var rp=require('request-promise');var moment=require(_0x9183('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9183('0x3'));var path=require('path');var sox=require(_0x9183('0x4'));var csv=require(_0x9183('0x5'));var ejs=require(_0x9183('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9183('0x7'));var squel=require(_0x9183('0x8'));var crypto=require(_0x9183('0x9'));var jsforce=require(_0x9183('0xa'));var deskjs=require(_0x9183('0xb'));var toCsv=require(_0x9183('0x5'));var querystring=require(_0x9183('0xc'));var Papa=require(_0x9183('0xd'));var Redis=require('ioredis');var authService=require(_0x9183('0xe'));var qs=require(_0x9183('0xf'));var as=require(_0x9183('0x10'));var hardwareService=require(_0x9183('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x9183('0x12'));var config=require(_0x9183('0x13'));var licenseUtil=require(_0x9183('0x14'));var db=require(_0x9183('0x15'))['db'];config[_0x9183('0x16')]=_[_0x9183('0x17')](config[_0x9183('0x16')],{'host':_0x9183('0x18'),'port':0x18eb});var socket=require(_0x9183('0x19'))(new Redis(config[_0x9183('0x16')]));require('./chatQueue.socket')[_0x9183('0x1a')](socket);var jayson=require(_0x9183('0x1b'));var client=jayson[_0x9183('0x1c')][_0x9183('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x38ccbe,_0x33091a,_0x339fb2,_0xfc8422){return new BPromise(function(_0x31f3dc,_0x563c85){var _0x567078=_0xfc8422||client;return _0x567078[_0x9183('0x1e')](_0x38ccbe,_0x339fb2)['then'](function(_0x595e35){logger[_0x9183('0x1f')](_0x9183('0x20'),_0x33091a,_0x9183('0x21'));logger['debug'](_0x9183('0x22'),_0x33091a,'request\x20sent',JSON[_0x9183('0x23')](_0x595e35));if(_0x595e35['error']){if(_0x595e35[_0x9183('0x24')][_0x9183('0x25')]===0x1f4){logger['error'](_0x9183('0x20'),_0x33091a,_0x595e35[_0x9183('0x24')][_0x9183('0x26')]);return _0x563c85(_0x595e35[_0x9183('0x24')][_0x9183('0x26')]);}logger[_0x9183('0x24')](_0x9183('0x20'),_0x33091a,_0x595e35['error']['message']);return _0x31f3dc(_0x595e35[_0x9183('0x24')][_0x9183('0x26')]);}else{logger[_0x9183('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x33091a,_0x9183('0x21'));_0x31f3dc(_0x595e35[_0x9183('0x27')]['message']);}})[_0x9183('0x28')](function(_0x215866){logger[_0x9183('0x24')]('ChatQueue,\x20%s,\x20%s',_0x33091a,_0x215866);_0x563c85(_0x215866);});});}function respondWithStatusCode(_0x4c4ae5,_0x2c52b9){_0x2c52b9=_0x2c52b9||0xcc;return function(_0xe8ac){if(_0xe8ac){return _0x4c4ae5[_0x9183('0x29')](_0x2c52b9);}return _0x4c4ae5[_0x9183('0x2a')](_0x2c52b9)[_0x9183('0x2b')]();};}function respondWithResult(_0x377917,_0x41a882){_0x41a882=_0x41a882||0xc8;return function(_0x3b266f){if(_0x3b266f){return _0x377917[_0x9183('0x2a')](_0x41a882)['json'](_0x3b266f);}};}function respondWithFilteredResult(_0x55882a,_0x1e834f){return function(_0x5b11a8){if(_0x5b11a8){var _0x554244=typeof _0x1e834f[_0x9183('0x2c')]===_0x9183('0x2d')&&typeof _0x1e834f[_0x9183('0x2e')]===_0x9183('0x2d');var _0x5b3be9=_0x5b11a8['count'];var _0x26fbbd=_0x554244?0x0:_0x1e834f[_0x9183('0x2c')];var _0x5c9509=_0x554244?_0x5b11a8[_0x9183('0x2f')]:_0x1e834f[_0x9183('0x2c')]+_0x1e834f[_0x9183('0x2e')];var _0xa0c938;if(_0x5c9509>=_0x5b3be9){_0x5c9509=_0x5b3be9;_0xa0c938=0xc8;}else{_0xa0c938=0xce;}_0x55882a[_0x9183('0x2a')](_0xa0c938);return _0x55882a['set'](_0x9183('0x30'),_0x26fbbd+'-'+_0x5c9509+'/'+_0x5b3be9)[_0x9183('0x31')](_0x5b11a8);}return null;};}function patchUpdates(_0x53d459){return function(_0x39ca45){try{jsonpatch[_0x9183('0x32')](_0x39ca45,_0x53d459,!![]);}catch(_0x9043a8){return BPromise[_0x9183('0x33')](_0x9043a8);}return _0x39ca45[_0x9183('0x34')]();};}function saveUpdates(_0x5dd9dd,_0x906898){return function(_0x582071){if(_0x582071){return _0x582071['update'](_0x5dd9dd)[_0x9183('0x35')](function(_0x13781c){return _0x13781c;});}return null;};}function removeEntity(_0x264e60,_0xee6594){return function(_0x163bd8){if(_0x163bd8){return _0x163bd8[_0x9183('0x36')]()['then'](function(){var _0x2e434e=_0x163bd8[_0x9183('0x37')]({'plain':!![]});var _0x3672b5=_0x9183('0x38');return db['UserProfileResource'][_0x9183('0x36')]({'where':{'type':_0x3672b5,'resourceId':_0x2e434e['id']}})[_0x9183('0x35')](function(){return _0x163bd8;});})[_0x9183('0x35')](function(){_0x264e60[_0x9183('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3cc2,_0x1de2a2){return function(_0x14fa32){if(!_0x14fa32){_0x2d3cc2[_0x9183('0x29')](0x194);}return _0x14fa32;};}function handleError(_0x1ebb7c,_0x51993d){_0x51993d=_0x51993d||0x1f4;return function(_0x263679){logger[_0x9183('0x24')](_0x263679[_0x9183('0x39')]);if(_0x263679[_0x9183('0x3a')]){delete _0x263679[_0x9183('0x3a')];}_0x1ebb7c[_0x9183('0x2a')](_0x51993d)[_0x9183('0x3b')](_0x263679);};}exports['index']=function(_0x5e9ddd,_0x321fa1){var _0x2d200f={},_0xd31ba3={},_0x3a8463={'count':0x0,'rows':[]};var _0x4bc404=_['map'](db[_0x9183('0x3c')][_0x9183('0x3d')],function(_0x2adb1d){return{'name':_0x2adb1d[_0x9183('0x3e')],'type':_0x2adb1d[_0x9183('0x3f')][_0x9183('0x40')]};});_0xd31ba3[_0x9183('0x41')]=_['map'](_0x4bc404,'name');_0xd31ba3[_0x9183('0x42')]=_[_0x9183('0x43')](_0x5e9ddd[_0x9183('0x42')]);_0xd31ba3[_0x9183('0x44')]=_[_0x9183('0x45')](_0xd31ba3[_0x9183('0x41')],_0xd31ba3[_0x9183('0x42')]);_0x2d200f[_0x9183('0x46')]=_[_0x9183('0x45')](_0xd31ba3[_0x9183('0x41')],qs[_0x9183('0x47')](_0x5e9ddd[_0x9183('0x42')][_0x9183('0x47')]));_0x2d200f[_0x9183('0x46')]=_0x2d200f[_0x9183('0x46')]['length']?_0x2d200f[_0x9183('0x46')]:_0xd31ba3['model'];if(!_0x5e9ddd[_0x9183('0x42')][_0x9183('0x48')](_0x9183('0x49'))){_0x2d200f['limit']=qs[_0x9183('0x2e')](_0x5e9ddd['query'][_0x9183('0x2e')]);_0x2d200f[_0x9183('0x2c')]=qs[_0x9183('0x2c')](_0x5e9ddd[_0x9183('0x42')]['offset']);}_0x2d200f['order']=qs[_0x9183('0x4a')](_0x5e9ddd[_0x9183('0x42')][_0x9183('0x4a')]);_0x2d200f[_0x9183('0x4b')]=qs['filters'](_[_0x9183('0x4c')](_0x5e9ddd[_0x9183('0x42')],_0xd31ba3[_0x9183('0x44')]),_0x4bc404);if(_0x5e9ddd[_0x9183('0x42')][_0x9183('0x4d')]){_0x2d200f['where']=_[_0x9183('0x4e')](_0x2d200f[_0x9183('0x4b')],{'$or':_[_0x9183('0x4f')](_0x4bc404,function(_0x180506){if(_0x180506[_0x9183('0x3f')]!==_0x9183('0x50')){var _0x156278={};_0x156278[_0x180506[_0x9183('0x3a')]]={'$like':'%'+_0x5e9ddd[_0x9183('0x42')][_0x9183('0x4d')]+'%'};return _0x156278;}})});}_0x2d200f=_[_0x9183('0x4e')]({},_0x2d200f,_0x5e9ddd[_0x9183('0x51')]);var _0x2f04d1={'where':_0x2d200f[_0x9183('0x4b')]};return db[_0x9183('0x3c')][_0x9183('0x2f')](_0x2f04d1)[_0x9183('0x35')](function(_0x55cded){_0x3a8463['count']=_0x55cded;if(_0x5e9ddd[_0x9183('0x42')][_0x9183('0x52')]){_0x2d200f['include']=[{'all':!![]}];}return db['ChatQueue'][_0x9183('0x53')](_0x2d200f);})['then'](function(_0x2652b6){_0x3a8463[_0x9183('0x54')]=_0x2652b6;return _0x3a8463;})[_0x9183('0x35')](respondWithFilteredResult(_0x321fa1,_0x2d200f))[_0x9183('0x28')](handleError(_0x321fa1,null));};exports[_0x9183('0x55')]=function(_0x4c8fd6,_0x464f23){var _0x234140={'raw':!![],'where':{'id':_0x4c8fd6['params']['id']}},_0x5018de={};_0x5018de[_0x9183('0x41')]=_[_0x9183('0x43')](db[_0x9183('0x3c')]['rawAttributes']);_0x5018de[_0x9183('0x42')]=_[_0x9183('0x43')](_0x4c8fd6['query']);_0x5018de[_0x9183('0x44')]=_[_0x9183('0x45')](_0x5018de[_0x9183('0x41')],_0x5018de[_0x9183('0x42')]);_0x234140[_0x9183('0x46')]=_[_0x9183('0x45')](_0x5018de[_0x9183('0x41')],qs[_0x9183('0x47')](_0x4c8fd6[_0x9183('0x42')]['fields']));_0x234140[_0x9183('0x46')]=_0x234140['attributes'][_0x9183('0x56')]?_0x234140[_0x9183('0x46')]:_0x5018de[_0x9183('0x41')];if(_0x4c8fd6[_0x9183('0x42')]['includeAll']){_0x234140[_0x9183('0x57')]=[{'all':!![]}];}_0x234140=_[_0x9183('0x4e')]({},_0x234140,_0x4c8fd6['options']);return db[_0x9183('0x3c')]['find'](_0x234140)[_0x9183('0x35')](handleEntityNotFound(_0x464f23,null))[_0x9183('0x35')](respondWithResult(_0x464f23,null))[_0x9183('0x28')](handleError(_0x464f23,null));};exports['create']=function(_0x3fdc6b,_0x7ed0d9){return db[_0x9183('0x3c')][_0x9183('0x58')](_0x3fdc6b[_0x9183('0x59')],{})[_0x9183('0x35')](function(_0x5a88de){var _0x111ca2=_0x3fdc6b[_0x9183('0x5a')][_0x9183('0x37')]({'plain':!![]});if(!_0x111ca2)throw new Error(_0x9183('0x5b'));if(_0x111ca2['role']===_0x9183('0x5a')){var _0x5a228a=_0x5a88de[_0x9183('0x37')]({'plain':!![]});var _0x146abb=_0x9183('0x38');return db['UserProfileSection'][_0x9183('0x5c')]({'where':{'name':_0x146abb,'userProfileId':_0x111ca2[_0x9183('0x5d')]},'raw':!![]})['then'](function(_0x15a7b0){if(_0x15a7b0&&_0x15a7b0[_0x9183('0x5e')]===0x0){return db[_0x9183('0x5f')][_0x9183('0x58')]({'name':_0x5a228a[_0x9183('0x3a')],'resourceId':_0x5a228a['id'],'type':_0x15a7b0[_0x9183('0x3a')],'sectionId':_0x15a7b0['id']},{})[_0x9183('0x35')](function(){return _0x5a88de;});}else{return _0x5a88de;}})['catch'](function(_0x30c3a7){logger[_0x9183('0x24')](_0x9183('0x60'),_0x30c3a7);throw _0x30c3a7;});}return _0x5a88de;})['then'](respondWithResult(_0x7ed0d9,0xc9))[_0x9183('0x28')](handleError(_0x7ed0d9,null));};exports[_0x9183('0x61')]=function(_0x549618,_0xd5fdd2){if(_0x549618['body']['id']){delete _0x549618['body']['id'];}return db['ChatQueue'][_0x9183('0x5c')]({'where':{'id':_0x549618[_0x9183('0x62')]['id']}})['then'](handleEntityNotFound(_0xd5fdd2,null))[_0x9183('0x35')](saveUpdates(_0x549618[_0x9183('0x59')],null))[_0x9183('0x35')](respondWithResult(_0xd5fdd2,null))[_0x9183('0x28')](handleError(_0xd5fdd2,null));};exports[_0x9183('0x36')]=function(_0x28d4c7,_0x3dff5a){return db[_0x9183('0x3c')][_0x9183('0x5c')]({'where':{'id':_0x28d4c7[_0x9183('0x62')]['id']}})[_0x9183('0x35')](handleEntityNotFound(_0x3dff5a,null))[_0x9183('0x35')](removeEntity(_0x3dff5a,null))[_0x9183('0x28')](handleError(_0x3dff5a,null));};exports[_0x9183('0x63')]=function(_0x48e8e3,_0x1481c5){return db[_0x9183('0x3c')][_0x9183('0x63')]()[_0x9183('0x35')](respondWithResult(_0x1481c5,null))[_0x9183('0x28')](handleError(_0x1481c5,null));};exports[_0x9183('0x64')]=function(_0x1e65e7,_0x54ead5,_0x4ec77c){var _0x4dd0d6={'raw':!![],'where':{}},_0x59ce37={},_0x45cf84;return db[_0x9183('0x3c')][_0x9183('0x65')]({'where':{'id':_0x1e65e7[_0x9183('0x62')]['id']}})[_0x9183('0x35')](handleEntityNotFound(_0x54ead5,null))[_0x9183('0x35')](function(_0x3a9479){if(_0x3a9479){_0x45cf84=_0x3a9479['get']({'plain':!![]});_0x59ce37[_0x9183('0x41')]=_[_0x9183('0x43')](db['UserChatQueue'][_0x9183('0x3d')]);_0x59ce37[_0x9183('0x42')]=_[_0x9183('0x43')](_0x1e65e7['query']);_0x59ce37[_0x9183('0x44')]=_[_0x9183('0x45')](_0x59ce37[_0x9183('0x41')],_0x59ce37['query']);_0x4dd0d6[_0x9183('0x46')]=_['intersection'](_0x59ce37[_0x9183('0x41')],qs[_0x9183('0x47')](_0x1e65e7[_0x9183('0x42')]['fields']));_0x4dd0d6['attributes']=_0x4dd0d6[_0x9183('0x46')]['length']?_0x4dd0d6['attributes']:_0x59ce37[_0x9183('0x41')];if(!_0x1e65e7[_0x9183('0x42')]['hasOwnProperty'](_0x9183('0x49'))){_0x4dd0d6[_0x9183('0x2e')]=qs[_0x9183('0x2e')](_0x1e65e7[_0x9183('0x42')][_0x9183('0x2e')]);_0x4dd0d6[_0x9183('0x2c')]=qs['offset'](_0x1e65e7[_0x9183('0x42')][_0x9183('0x2c')]);}_0x4dd0d6['order']=qs[_0x9183('0x4a')](_0x1e65e7[_0x9183('0x42')][_0x9183('0x4a')]);_0x4dd0d6[_0x9183('0x4b')]=qs[_0x9183('0x44')](_['pick'](_0x1e65e7[_0x9183('0x42')],_0x59ce37[_0x9183('0x44')]));_0x4dd0d6[_0x9183('0x4b')][_0x9183('0x66')]=_0x3a9479['id'];if(_0x1e65e7[_0x9183('0x42')]['filter']){_0x4dd0d6['where']=_['merge'](_0x4dd0d6[_0x9183('0x4b')],{'$or':_[_0x9183('0x4f')](_0x4dd0d6[_0x9183('0x46')],function(_0x1f2dc6){var _0x546f3e={};_0x546f3e[_0x1f2dc6]={'$like':'%'+_0x1e65e7['query'][_0x9183('0x4d')]+'%'};return _0x546f3e;})});}_0x4dd0d6=_['merge']({},_0x4dd0d6,_0x1e65e7[_0x9183('0x51')]);return db[_0x9183('0x67')][_0x9183('0x53')](_0x4dd0d6);}})['then'](function(_0x5aab64){if(_0x5aab64){return db[_0x9183('0x68')][_0x9183('0x69')]({'where':{'id':_['map'](_0x5aab64,_0x9183('0x6a')),'role':_0x9183('0x6b')},'attributes':['id','name',_0x9183('0x6c'),_0x9183('0x6d'),_0x9183('0x6e')]});}})[_0x9183('0x35')](function(_0x31206e){if(_0x31206e){return{'count':_0x31206e[_0x9183('0x2f')],'rows':_['map'](_0x31206e[_0x9183('0x54')],function(_0x430d49){return{'membername':_0x430d49[_0x9183('0x3a')],'UserId':_0x430d49['id'],'queue_name':_0x45cf84['name'],'ChatQueueId':_0x45cf84['id'],'interface':util[_0x9183('0x6f')](_0x9183('0x70'),'SIP',_0x430d49[_0x9183('0x3a')]),'penalty':0x0,'paused':_0x430d49[_0x9183('0x6c')],'createdAt':_0x430d49[_0x9183('0x6e')],'updatedAt':_0x430d49[_0x9183('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9183('0x35')](respondWithFilteredResult(_0x54ead5,_0x4dd0d6))['catch'](handleError(_0x54ead5,null));};exports[_0x9183('0x71')]=function(_0x47cd9b,_0x5ba329,_0x328f5e){var _0x2290c6={};var _0x57ff9d={};var _0x5d123f;var _0x31fd4a;return db[_0x9183('0x3c')][_0x9183('0x65')]({'where':{'id':_0x47cd9b['params']['id']}})['then'](handleEntityNotFound(_0x5ba329,null))[_0x9183('0x35')](function(_0x26d1b5){if(_0x26d1b5){_0x5d123f=_0x26d1b5;_0x57ff9d[_0x9183('0x41')]=_['keys'](db[_0x9183('0x72')][_0x9183('0x3d')]);_0x57ff9d[_0x9183('0x42')]=_[_0x9183('0x43')](_0x47cd9b[_0x9183('0x42')]);_0x57ff9d[_0x9183('0x44')]=_[_0x9183('0x45')](_0x57ff9d[_0x9183('0x41')],_0x57ff9d['query']);_0x2290c6[_0x9183('0x46')]=_[_0x9183('0x45')](_0x57ff9d['model'],qs[_0x9183('0x47')](_0x47cd9b[_0x9183('0x42')]['fields']));_0x2290c6['attributes']=_0x2290c6[_0x9183('0x46')][_0x9183('0x56')]?_0x2290c6['attributes']:_0x57ff9d['model'];_0x2290c6['order']=qs[_0x9183('0x4a')](_0x47cd9b['query']['sort']);_0x2290c6[_0x9183('0x4b')]=qs[_0x9183('0x44')](_['pick'](_0x47cd9b[_0x9183('0x42')],_0x57ff9d[_0x9183('0x44')]));if(_0x47cd9b['query']['filter']){_0x2290c6[_0x9183('0x4b')]=_[_0x9183('0x4e')](_0x2290c6[_0x9183('0x4b')],{'$or':_['map'](_0x2290c6['attributes'],function(_0x4f61fb){var _0x420efe={};_0x420efe[_0x4f61fb]={'$like':'%'+_0x47cd9b[_0x9183('0x42')][_0x9183('0x4d')]+'%'};return _0x420efe;})});}_0x2290c6=_['merge']({},_0x2290c6,_0x47cd9b['options']);return _0x5d123f['getTeams'](_0x2290c6);}})['then'](function(_0x3742fd){if(_0x3742fd){_0x31fd4a=_0x3742fd[_0x9183('0x56')];if(!_0x47cd9b[_0x9183('0x42')]['hasOwnProperty']('nolimit')){_0x2290c6[_0x9183('0x2e')]=qs['limit'](_0x47cd9b[_0x9183('0x42')][_0x9183('0x2e')]);_0x2290c6[_0x9183('0x2c')]=qs['offset'](_0x47cd9b[_0x9183('0x42')][_0x9183('0x2c')]);}return _0x5d123f[_0x9183('0x71')](_0x2290c6);}})['then'](function(_0x2a3bd5){if(_0x2a3bd5){return _0x2a3bd5?{'count':_0x31fd4a,'rows':_0x2a3bd5}:null;}})[_0x9183('0x35')](respondWithResult(_0x5ba329,null))[_0x9183('0x28')](handleError(_0x5ba329,null));};exports['addTeams']=function(_0x2a91e7,_0x455141,_0x49128d){var _0x1f31e7=_0x2a91e7['body']['ids'];return db[_0x9183('0x72')][_0x9183('0x53')]({'where':{'id':_0x1f31e7},'attributes':['id'],'include':[{'model':db[_0x9183('0x68')],'as':_0x9183('0x73'),'attributes':['id',_0x9183('0x3a'),_0x9183('0x74'),'voicePause',_0x9183('0x75')],'raw':!![]}]})[_0x9183('0x35')](function(_0x113457){if(_0x113457){var _0x49305e=_[_0x9183('0x76')](_0x113457,function(_0x3a3ab3){var _0x33ae31=_0x3a3ab3[_0x9183('0x37')]({'plain':!![]});return _0x33ae31[_0x9183('0x73')];});return db[_0x9183('0x3c')]['find']({'where':{'id':_0x2a91e7['params']['id']}})['then'](function(_0x2aa7af){return db[_0x9183('0x77')][_0x9183('0x78')](function(_0x2aca44){return _0x2aa7af[_0x9183('0x79')](_0x1f31e7,{'transaction':_0x2aca44})[_0x9183('0x35')](function(){return BPromise[_0x9183('0x7a')](_0x49305e,function(_0x573b7e){return db['UserChatQueue'][_0x9183('0x7b')]({'where':{'UserId':_0x573b7e['id'],'ChatQueueId':_0x2a91e7[_0x9183('0x62')]['id']},'transaction':_0x2aca44});});})['then'](function(){_0x49305e[_0x9183('0x7c')](function(_0x2defa5){socket[_0x9183('0x7d')]('userChatQueue:save',{'UserId':_0x2defa5['id'],'ChatQueueId':_0x2aa7af['id']});});});});});}})[_0x9183('0x35')](respondWithStatusCode(_0x455141,null))[_0x9183('0x28')](handleError(_0x455141,null));};exports[_0x9183('0x7e')]=function(_0x4fdf2b,_0x31234d,_0x59bbd8){return db[_0x9183('0x72')][_0x9183('0x53')]({'where':{'id':_0x4fdf2b[_0x9183('0x42')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9183('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x31234d,null))[_0x9183('0x35')](function(_0x2d7ce3){var _0x165091=_[_0x9183('0x4f')](_0x2d7ce3,'id');var _0x1c4471=[];var _0x40797d=[];var _0x280ba5=squel[_0x9183('0x7f')]();_0x280ba5[_0x9183('0x80')]('tq.TeamId')[_0x9183('0x81')](_0x9183('0x82'),'tq')['join'](_0x9183('0x83'),'ut',_0x9183('0x84'))[_0x9183('0x4b')](_0x9183('0x85'),_0x4fdf2b[_0x9183('0x62')]['id']);for(var _0xfb6f58=0x0;_0xfb6f58<_0x2d7ce3[_0x9183('0x56')];_0xfb6f58+=0x1){let _0xed6907=_0x2d7ce3[_0xfb6f58];for(var _0x23e35b=0x0;_0x23e35b<_0xed6907['Agents'][_0x9183('0x56')];_0x23e35b+=0x1){let _0x5af487=_0xed6907['Agents'][_0x23e35b];var _0x4c7919=_0x280ba5[_0x9183('0x86')]();_0x4c7919[_0x9183('0x4b')](_0x9183('0x87'),_0x5af487['id']);_0x40797d[_0x9183('0x88')](db[_0x9183('0x77')][_0x9183('0x42')](_0x4c7919[_0x9183('0x89')](),{'type':db['sequelize']['QueryTypes'][_0x9183('0x8a')]})[_0x9183('0x35')](function(_0x1f4ee7){if(_0x1f4ee7[_0x9183('0x56')]===0x1){return _0x5af487['id'];}else{var _0x2d1618=_['every'](_[_0x9183('0x4f')](_0x1f4ee7,_0x9183('0x8b')),function(_0x40519c){return _[_0x9183('0x8c')](_0x165091,_0x40519c);});if(_0x2d1618){return _0x5af487['id'];}}}));}}return BPromise['all'](_0x40797d)['then'](function(_0xc5532e){_0x1c4471=_(_0x1c4471)[_0x9183('0x8d')](_0xc5532e)['compact']()['value']();return db[_0x9183('0x3c')][_0x9183('0x5c')]({'where':{'id':_0x4fdf2b[_0x9183('0x62')]['id']}})[_0x9183('0x35')](function(_0x429e24){return db['sequelize']['transaction'](function(_0x57f980){return _0x429e24[_0x9183('0x7e')](_0x4fdf2b[_0x9183('0x42')][_0x9183('0x8e')],{'transaction':_0x57f980})[_0x9183('0x35')](function(){if(!_[_0x9183('0x8f')](_0x1c4471)){return _0x429e24[_0x9183('0x90')](_0x1c4471,{'transaction':_0x57f980});}})[_0x9183('0x35')](function(){_0x1c4471[_0x9183('0x7c')](function(_0x21701c){socket[_0x9183('0x7d')](_0x9183('0x91'),{'UserId':_0x21701c,'ChatQueueId':_0x429e24['id']});});});});});});})[_0x9183('0x35')](respondWithStatusCode(_0x31234d,null))[_0x9183('0x28')](handleError(_0x31234d,null));};exports[_0x9183('0x92')]=function(_0x2f470e,_0x75aef0,_0xeda310){return db[_0x9183('0x3c')]['find']({'where':{'id':_0x2f470e[_0x9183('0x62')]['id']}})['then'](handleEntityNotFound(_0x75aef0,null))[_0x9183('0x35')](function(_0x3eb31d){if(_0x3eb31d){return _0x3eb31d[_0x9183('0x92')](_0x2f470e[_0x9183('0x59')][_0x9183('0x8e')],_[_0x9183('0x93')](_0x2f470e['body'],['ids','id'])||{})[_0x9183('0x94')](function(_0xb6e7a0){for(var _0x44fefa=0x0;_0x44fefa<_0x2f470e[_0x9183('0x59')][_0x9183('0x8e')][_0x9183('0x56')];_0x44fefa+=0x1){socket[_0x9183('0x7d')](_0x9183('0x95'),{'UserId':Number(_0x2f470e[_0x9183('0x59')][_0x9183('0x8e')][_0x44fefa]),'ChatQueueId':Number(_0x2f470e[_0x9183('0x62')]['id'])});}return _0xb6e7a0;});}})[_0x9183('0x35')](respondWithResult(_0x75aef0,null))[_0x9183('0x28')](handleError(_0x75aef0,null));};exports[_0x9183('0x90')]=function(_0xbf01f0,_0x4242ff,_0x4d4c89){return db[_0x9183('0x3c')][_0x9183('0x5c')]({'where':{'id':_0xbf01f0[_0x9183('0x62')]['id']}})[_0x9183('0x35')](handleEntityNotFound(_0x4242ff,null))[_0x9183('0x35')](function(_0xd07532){if(_0xd07532){return _0xd07532[_0x9183('0x90')](_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')])['then'](function(){if(_[_0x9183('0x96')](_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')])){for(var _0x3151d5=0x0;_0x3151d5<_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')][_0x9183('0x56')];_0x3151d5+=0x1){socket[_0x9183('0x7d')](_0x9183('0x91'),{'UserId':Number(_0xbf01f0['query'][_0x9183('0x8e')][_0x3151d5]),'ChatQueueId':Number(_0xbf01f0['params']['id'])});}}else{socket[_0x9183('0x7d')](_0x9183('0x91'),{'UserId':Number(_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')]),'ChatQueueId':Number(_0xbf01f0[_0x9183('0x62')]['id'])});}});}})[_0x9183('0x35')](respondWithStatusCode(_0x4242ff,null))[_0x9183('0x28')](handleError(_0x4242ff,null));};exports['getAgents']=function(_0x4742f,_0xe402e7,_0x68a5a0){var _0x584405={};var _0x5294a1={};var _0x235789;var _0x111f20;return db[_0x9183('0x3c')]['findOne']({'where':{'id':_0x4742f['params']['id']}})[_0x9183('0x35')](handleEntityNotFound(_0xe402e7,null))['then'](function(_0x737fca){if(_0x737fca){_0x235789=_0x737fca;_0x5294a1[_0x9183('0x41')]=_['keys'](db['User'][_0x9183('0x3d')]);_0x5294a1[_0x9183('0x42')]=_[_0x9183('0x43')](_0x4742f['query']);_0x5294a1['filters']=_['intersection'](_0x5294a1[_0x9183('0x41')],_0x5294a1['query']);_0x584405[_0x9183('0x46')]=_[_0x9183('0x45')](_0x5294a1[_0x9183('0x41')],qs['fields'](_0x4742f[_0x9183('0x42')][_0x9183('0x47')]));_0x584405[_0x9183('0x46')]=_0x584405[_0x9183('0x46')]['length']?_0x584405['attributes']:_0x5294a1[_0x9183('0x41')];_0x584405[_0x9183('0x97')]=qs[_0x9183('0x4a')](_0x4742f[_0x9183('0x42')][_0x9183('0x4a')]);_0x584405['where']=qs['filters'](_[_0x9183('0x4c')](_0x4742f[_0x9183('0x42')],_0x5294a1[_0x9183('0x44')]));if(_0x4742f['query'][_0x9183('0x4d')]){_0x584405[_0x9183('0x4b')]=_[_0x9183('0x4e')](_0x584405[_0x9183('0x4b')],{'$or':_['map'](_0x584405['attributes'],function(_0x118cfc){var _0x372fb4={};_0x372fb4[_0x118cfc]={'$like':'%'+_0x4742f['query'][_0x9183('0x4d')]+'%'};return _0x372fb4;})});}_0x584405=_[_0x9183('0x4e')]({},_0x584405,_0x4742f[_0x9183('0x51')]);return _0x235789['getAgents'](_0x584405);}})['then'](function(_0x2bedc0){if(_0x2bedc0){_0x111f20=_0x2bedc0[_0x9183('0x56')];if(!_0x4742f[_0x9183('0x42')]['hasOwnProperty'](_0x9183('0x49'))){_0x584405[_0x9183('0x2e')]=qs[_0x9183('0x2e')](_0x4742f[_0x9183('0x42')][_0x9183('0x2e')]);_0x584405[_0x9183('0x2c')]=qs[_0x9183('0x2c')](_0x4742f[_0x9183('0x42')][_0x9183('0x2c')]);}return _0x235789[_0x9183('0x98')](_0x584405);}})[_0x9183('0x35')](function(_0x23f8b0){if(_0x23f8b0){return _0x23f8b0?{'count':_0x111f20,'rows':_0x23f8b0}:null;}})['then'](respondWithResult(_0xe402e7,null))[_0x9183('0x28')](handleError(_0xe402e7,null));}; \ No newline at end of file +var _0x3498=['intersection','fields','attributes','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','destroy','describe','getMembers','findOne','length','hasOwnProperty','pick','UserChatQueue','User','UserId','agent','chatPause','format','%s/%s','SIP','updatedAt','getTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','includes','all','union','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters'];(function(_0x8beacd,_0x30436e){var _0xacc507=function(_0xf41ba9){while(--_0xf41ba9){_0x8beacd['push'](_0x8beacd['shift']());}};_0xacc507(++_0x30436e);}(_0x3498,0xed));var _0x8349=function(_0x9bff75,_0x3e051f){_0x9bff75=_0x9bff75-0x0;var _0x121481=_0x3498[_0x9bff75];return _0x121481;};'use strict';var emlformat=require(_0x8349('0x0'));var rimraf=require(_0x8349('0x1'));var zipdir=require(_0x8349('0x2'));var jsonpatch=require(_0x8349('0x3'));var rp=require(_0x8349('0x4'));var moment=require(_0x8349('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8349('0x6'));var util=require(_0x8349('0x7'));var path=require(_0x8349('0x8'));var sox=require('sox');var csv=require(_0x8349('0x9'));var ejs=require(_0x8349('0xa'));var fs=require('fs');var fs_extra=require(_0x8349('0xb'));var _=require(_0x8349('0xc'));var squel=require('squel');var crypto=require(_0x8349('0xd'));var jsforce=require(_0x8349('0xe'));var deskjs=require(_0x8349('0xf'));var toCsv=require(_0x8349('0x9'));var querystring=require(_0x8349('0x10'));var Papa=require(_0x8349('0x11'));var Redis=require(_0x8349('0x12'));var authService=require(_0x8349('0x13'));var qs=require(_0x8349('0x14'));var as=require(_0x8349('0x15'));var hardwareService=require(_0x8349('0x16'));var logger=require('../../config/logger')(_0x8349('0x17'));var utils=require(_0x8349('0x18'));var config=require(_0x8349('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8349('0x1a'))['db'];config[_0x8349('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8349('0x1c'))(new Redis(config[_0x8349('0x1b')]));require(_0x8349('0x1d'))[_0x8349('0x1e')](socket);var jayson=require(_0x8349('0x1f'));var client=jayson[_0x8349('0x20')][_0x8349('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3e3660,_0x3d12c0,_0xa4c321,_0x3f1ccb){return new BPromise(function(_0x2e40c0,_0x3ac284){var _0xb8c509=_0x3f1ccb||client;return _0xb8c509[_0x8349('0x22')](_0x3e3660,_0xa4c321)['then'](function(_0x25c4ec){logger[_0x8349('0x23')]('ChatQueue,\x20%s,\x20%s',_0x3d12c0,_0x8349('0x24'));logger[_0x8349('0x25')](_0x8349('0x26'),_0x3d12c0,_0x8349('0x24'),JSON[_0x8349('0x27')](_0x25c4ec));if(_0x25c4ec['error']){if(_0x25c4ec['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3d12c0,_0x25c4ec[_0x8349('0x28')][_0x8349('0x29')]);return _0x3ac284(_0x25c4ec[_0x8349('0x28')][_0x8349('0x29')]);}logger[_0x8349('0x28')](_0x8349('0x2a'),_0x3d12c0,_0x25c4ec[_0x8349('0x28')][_0x8349('0x29')]);return _0x2e40c0(_0x25c4ec[_0x8349('0x28')]['message']);}else{logger[_0x8349('0x23')](_0x8349('0x2a'),_0x3d12c0,_0x8349('0x24'));_0x2e40c0(_0x25c4ec[_0x8349('0x2b')]['message']);}})[_0x8349('0x2c')](function(_0x2a3e72){logger[_0x8349('0x28')](_0x8349('0x2a'),_0x3d12c0,_0x2a3e72);_0x3ac284(_0x2a3e72);});});}function respondWithStatusCode(_0x1247cc,_0x512c2b){_0x512c2b=_0x512c2b||0xcc;return function(_0x3ebaa6){if(_0x3ebaa6){return _0x1247cc[_0x8349('0x2d')](_0x512c2b);}return _0x1247cc[_0x8349('0x2e')](_0x512c2b)[_0x8349('0x2f')]();};}function respondWithResult(_0x1f71a0,_0x5c83ed){_0x5c83ed=_0x5c83ed||0xc8;return function(_0x20fc04){if(_0x20fc04){return _0x1f71a0[_0x8349('0x2e')](_0x5c83ed)[_0x8349('0x30')](_0x20fc04);}};}function respondWithFilteredResult(_0x2eda61,_0x24a0b8){return function(_0x70a355){if(_0x70a355){var _0x3dda69=typeof _0x24a0b8[_0x8349('0x31')]===_0x8349('0x32')&&typeof _0x24a0b8[_0x8349('0x33')]===_0x8349('0x32');var _0x15cd69=_0x70a355['count'];var _0x19928f=_0x3dda69?0x0:_0x24a0b8[_0x8349('0x31')];var _0x25c89f=_0x3dda69?_0x70a355[_0x8349('0x34')]:_0x24a0b8[_0x8349('0x31')]+_0x24a0b8['limit'];var _0x38a113;if(_0x25c89f>=_0x15cd69){_0x25c89f=_0x15cd69;_0x38a113=0xc8;}else{_0x38a113=0xce;}_0x2eda61[_0x8349('0x2e')](_0x38a113);return _0x2eda61[_0x8349('0x35')]('Content-Range',_0x19928f+'-'+_0x25c89f+'/'+_0x15cd69)[_0x8349('0x30')](_0x70a355);}return null;};}function patchUpdates(_0x592d3e){return function(_0x525bc1){try{jsonpatch[_0x8349('0x36')](_0x525bc1,_0x592d3e,!![]);}catch(_0x57e31a){return BPromise[_0x8349('0x37')](_0x57e31a);}return _0x525bc1[_0x8349('0x38')]();};}function saveUpdates(_0x17c76e,_0x36c72d){return function(_0x4957a4){if(_0x4957a4){return _0x4957a4[_0x8349('0x39')](_0x17c76e)['then'](function(_0x58d10d){return _0x58d10d;});}return null;};}function removeEntity(_0x17f987,_0x27d53b){return function(_0x351155){if(_0x351155){return _0x351155['destroy']()[_0x8349('0x3a')](function(){var _0x290265=_0x351155['get']({'plain':!![]});var _0x554280=_0x8349('0x3b');return db[_0x8349('0x3c')]['destroy']({'where':{'type':_0x554280,'resourceId':_0x290265['id']}})[_0x8349('0x3a')](function(){return _0x351155;});})[_0x8349('0x3a')](function(){_0x17f987['status'](0xcc)[_0x8349('0x2f')]();});}};}function handleEntityNotFound(_0x46d644,_0x4af2ae){return function(_0x590a1b){if(!_0x590a1b){_0x46d644[_0x8349('0x2d')](0x194);}return _0x590a1b;};}function handleError(_0x6a744f,_0x1e8f1f){_0x1e8f1f=_0x1e8f1f||0x1f4;return function(_0x1fd70a){logger[_0x8349('0x28')](_0x1fd70a['stack']);if(_0x1fd70a['name']){delete _0x1fd70a[_0x8349('0x3d')];}_0x6a744f[_0x8349('0x2e')](_0x1e8f1f)[_0x8349('0x3e')](_0x1fd70a);};}exports[_0x8349('0x3f')]=function(_0x35ede8,_0x125f27){var _0x3c9255={},_0x45ee56={},_0x235913={'count':0x0,'rows':[]};var _0x2c1d30=_[_0x8349('0x40')](db[_0x8349('0x41')][_0x8349('0x42')],function(_0x10d8b3){return{'name':_0x10d8b3[_0x8349('0x43')],'type':_0x10d8b3[_0x8349('0x44')]['key']};});_0x45ee56[_0x8349('0x45')]=_['map'](_0x2c1d30,'name');_0x45ee56['query']=_[_0x8349('0x46')](_0x35ede8[_0x8349('0x47')]);_0x45ee56[_0x8349('0x48')]=_[_0x8349('0x49')](_0x45ee56[_0x8349('0x45')],_0x45ee56['query']);_0x3c9255['attributes']=_[_0x8349('0x49')](_0x45ee56['model'],qs[_0x8349('0x4a')](_0x35ede8[_0x8349('0x47')][_0x8349('0x4a')]));_0x3c9255[_0x8349('0x4b')]=_0x3c9255[_0x8349('0x4b')]['length']?_0x3c9255[_0x8349('0x4b')]:_0x45ee56[_0x8349('0x45')];if(!_0x35ede8['query']['hasOwnProperty'](_0x8349('0x4c'))){_0x3c9255[_0x8349('0x33')]=qs[_0x8349('0x33')](_0x35ede8[_0x8349('0x47')]['limit']);_0x3c9255[_0x8349('0x31')]=qs[_0x8349('0x31')](_0x35ede8[_0x8349('0x47')][_0x8349('0x31')]);}_0x3c9255[_0x8349('0x4d')]=qs['sort'](_0x35ede8[_0x8349('0x47')][_0x8349('0x4e')]);_0x3c9255[_0x8349('0x4f')]=qs[_0x8349('0x48')](_['pick'](_0x35ede8[_0x8349('0x47')],_0x45ee56[_0x8349('0x48')]),_0x2c1d30);if(_0x35ede8[_0x8349('0x47')][_0x8349('0x50')]){_0x3c9255[_0x8349('0x4f')]=_['merge'](_0x3c9255[_0x8349('0x4f')],{'$or':_['map'](_0x2c1d30,function(_0x268e68){if(_0x268e68[_0x8349('0x44')]!==_0x8349('0x51')){var _0x2d95a0={};_0x2d95a0[_0x268e68[_0x8349('0x3d')]]={'$like':'%'+_0x35ede8[_0x8349('0x47')][_0x8349('0x50')]+'%'};return _0x2d95a0;}})});}_0x3c9255=_[_0x8349('0x52')]({},_0x3c9255,_0x35ede8[_0x8349('0x53')]);var _0x526e72={'where':_0x3c9255[_0x8349('0x4f')]};return db[_0x8349('0x41')]['count'](_0x526e72)[_0x8349('0x3a')](function(_0x31f8c5){_0x235913[_0x8349('0x34')]=_0x31f8c5;if(_0x35ede8['query'][_0x8349('0x54')]){_0x3c9255[_0x8349('0x55')]=[{'all':!![]}];}return db[_0x8349('0x41')][_0x8349('0x56')](_0x3c9255);})[_0x8349('0x3a')](function(_0x12a0b4){_0x235913[_0x8349('0x57')]=_0x12a0b4;return _0x235913;})[_0x8349('0x3a')](respondWithFilteredResult(_0x125f27,_0x3c9255))[_0x8349('0x2c')](handleError(_0x125f27,null));};exports[_0x8349('0x58')]=function(_0xf6f1d2,_0x2192e6){var _0x388306={'raw':!![],'where':{'id':_0xf6f1d2['params']['id']}},_0x240e64={};_0x240e64[_0x8349('0x45')]=_[_0x8349('0x46')](db[_0x8349('0x41')]['rawAttributes']);_0x240e64[_0x8349('0x47')]=_[_0x8349('0x46')](_0xf6f1d2[_0x8349('0x47')]);_0x240e64[_0x8349('0x48')]=_[_0x8349('0x49')](_0x240e64[_0x8349('0x45')],_0x240e64[_0x8349('0x47')]);_0x388306[_0x8349('0x4b')]=_['intersection'](_0x240e64['model'],qs['fields'](_0xf6f1d2[_0x8349('0x47')][_0x8349('0x4a')]));_0x388306['attributes']=_0x388306[_0x8349('0x4b')]['length']?_0x388306[_0x8349('0x4b')]:_0x240e64['model'];if(_0xf6f1d2[_0x8349('0x47')][_0x8349('0x54')]){_0x388306[_0x8349('0x55')]=[{'all':!![]}];}_0x388306=_[_0x8349('0x52')]({},_0x388306,_0xf6f1d2[_0x8349('0x53')]);return db[_0x8349('0x41')][_0x8349('0x59')](_0x388306)[_0x8349('0x3a')](handleEntityNotFound(_0x2192e6,null))['then'](respondWithResult(_0x2192e6,null))['catch'](handleError(_0x2192e6,null));};exports[_0x8349('0x5a')]=function(_0x3db7cc,_0x3103e0){return db[_0x8349('0x41')][_0x8349('0x5a')](_0x3db7cc['body'],{})[_0x8349('0x3a')](function(_0xaade27){var _0x254924=_0x3db7cc['user'][_0x8349('0x5b')]({'plain':!![]});if(!_0x254924)throw new Error(_0x8349('0x5c'));if(_0x254924[_0x8349('0x5d')]===_0x8349('0x5e')){var _0x237ea6=_0xaade27[_0x8349('0x5b')]({'plain':!![]});var _0x225695=_0x8349('0x3b');return db[_0x8349('0x5f')][_0x8349('0x59')]({'where':{'name':_0x225695,'userProfileId':_0x254924[_0x8349('0x60')]},'raw':!![]})[_0x8349('0x3a')](function(_0x4901b1){if(_0x4901b1&&_0x4901b1['autoAssociation']===0x0){return db[_0x8349('0x3c')][_0x8349('0x5a')]({'name':_0x237ea6[_0x8349('0x3d')],'resourceId':_0x237ea6['id'],'type':_0x4901b1[_0x8349('0x3d')],'sectionId':_0x4901b1['id']},{})[_0x8349('0x3a')](function(){return _0xaade27;});}else{return _0xaade27;}})['catch'](function(_0x2c3683){logger[_0x8349('0x28')](_0x8349('0x61'),_0x2c3683);throw _0x2c3683;});}return _0xaade27;})[_0x8349('0x3a')](respondWithResult(_0x3103e0,0xc9))[_0x8349('0x2c')](handleError(_0x3103e0,null));};exports['update']=function(_0x4b8ae2,_0x4350a9){if(_0x4b8ae2['body']['id']){delete _0x4b8ae2['body']['id'];}return db[_0x8349('0x41')][_0x8349('0x59')]({'where':{'id':_0x4b8ae2[_0x8349('0x62')]['id']}})['then'](handleEntityNotFound(_0x4350a9,null))[_0x8349('0x3a')](saveUpdates(_0x4b8ae2[_0x8349('0x63')],null))[_0x8349('0x3a')](respondWithResult(_0x4350a9,null))[_0x8349('0x2c')](handleError(_0x4350a9,null));};exports[_0x8349('0x64')]=function(_0x277ad3,_0x31340a){return db[_0x8349('0x41')][_0x8349('0x59')]({'where':{'id':_0x277ad3[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x31340a,null))[_0x8349('0x3a')](removeEntity(_0x31340a,null))[_0x8349('0x2c')](handleError(_0x31340a,null));};exports[_0x8349('0x65')]=function(_0x335132,_0x410ac6){return db[_0x8349('0x41')][_0x8349('0x65')]()[_0x8349('0x3a')](respondWithResult(_0x410ac6,null))[_0x8349('0x2c')](handleError(_0x410ac6,null));};exports[_0x8349('0x66')]=function(_0xb7167e,_0x1ad09a,_0x58e263){var _0x32922b={'raw':!![],'where':{}},_0x3957f7={},_0x3bd229;return db[_0x8349('0x41')][_0x8349('0x67')]({'where':{'id':_0xb7167e['params']['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x1ad09a,null))[_0x8349('0x3a')](function(_0x1e112a){if(_0x1e112a){_0x3bd229=_0x1e112a[_0x8349('0x5b')]({'plain':!![]});_0x3957f7['model']=_[_0x8349('0x46')](db['UserChatQueue'][_0x8349('0x42')]);_0x3957f7['query']=_['keys'](_0xb7167e[_0x8349('0x47')]);_0x3957f7[_0x8349('0x48')]=_[_0x8349('0x49')](_0x3957f7['model'],_0x3957f7[_0x8349('0x47')]);_0x32922b[_0x8349('0x4b')]=_[_0x8349('0x49')](_0x3957f7[_0x8349('0x45')],qs[_0x8349('0x4a')](_0xb7167e[_0x8349('0x47')]['fields']));_0x32922b[_0x8349('0x4b')]=_0x32922b[_0x8349('0x4b')][_0x8349('0x68')]?_0x32922b[_0x8349('0x4b')]:_0x3957f7[_0x8349('0x45')];if(!_0xb7167e[_0x8349('0x47')][_0x8349('0x69')](_0x8349('0x4c'))){_0x32922b[_0x8349('0x33')]=qs[_0x8349('0x33')](_0xb7167e[_0x8349('0x47')][_0x8349('0x33')]);_0x32922b[_0x8349('0x31')]=qs[_0x8349('0x31')](_0xb7167e[_0x8349('0x47')][_0x8349('0x31')]);}_0x32922b[_0x8349('0x4d')]=qs[_0x8349('0x4e')](_0xb7167e['query'][_0x8349('0x4e')]);_0x32922b[_0x8349('0x4f')]=qs['filters'](_[_0x8349('0x6a')](_0xb7167e[_0x8349('0x47')],_0x3957f7[_0x8349('0x48')]));_0x32922b[_0x8349('0x4f')]['ChatQueueId']=_0x1e112a['id'];if(_0xb7167e['query'][_0x8349('0x50')]){_0x32922b[_0x8349('0x4f')]=_['merge'](_0x32922b['where'],{'$or':_[_0x8349('0x40')](_0x32922b['attributes'],function(_0x546b28){var _0x4d5459={};_0x4d5459[_0x546b28]={'$like':'%'+_0xb7167e['query'][_0x8349('0x50')]+'%'};return _0x4d5459;})});}_0x32922b=_['merge']({},_0x32922b,_0xb7167e[_0x8349('0x53')]);return db[_0x8349('0x6b')]['findAll'](_0x32922b);}})[_0x8349('0x3a')](function(_0x42664d){if(_0x42664d){return db[_0x8349('0x6c')]['findAndCountAll']({'where':{'id':_[_0x8349('0x40')](_0x42664d,_0x8349('0x6d')),'role':_0x8349('0x6e')},'attributes':['id',_0x8349('0x3d'),_0x8349('0x6f'),'updatedAt','createdAt']});}})[_0x8349('0x3a')](function(_0x237320){if(_0x237320){return{'count':_0x237320[_0x8349('0x34')],'rows':_['map'](_0x237320[_0x8349('0x57')],function(_0x14c243){return{'membername':_0x14c243[_0x8349('0x3d')],'UserId':_0x14c243['id'],'queue_name':_0x3bd229[_0x8349('0x3d')],'ChatQueueId':_0x3bd229['id'],'interface':util[_0x8349('0x70')](_0x8349('0x71'),_0x8349('0x72'),_0x14c243[_0x8349('0x3d')]),'penalty':0x0,'paused':_0x14c243[_0x8349('0x6f')],'createdAt':_0x14c243['createdAt'],'updatedAt':_0x14c243[_0x8349('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8349('0x3a')](respondWithFilteredResult(_0x1ad09a,_0x32922b))['catch'](handleError(_0x1ad09a,null));};exports[_0x8349('0x74')]=function(_0xd05efb,_0x3df37e,_0x1d2748){var _0x380fca={};var _0x2ca72c={};var _0x431711;var _0x554631;return db[_0x8349('0x41')][_0x8349('0x67')]({'where':{'id':_0xd05efb['params']['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x3df37e,null))[_0x8349('0x3a')](function(_0x44e3ec){if(_0x44e3ec){_0x431711=_0x44e3ec;_0x2ca72c[_0x8349('0x45')]=_[_0x8349('0x46')](db['Team']['rawAttributes']);_0x2ca72c[_0x8349('0x47')]=_['keys'](_0xd05efb['query']);_0x2ca72c['filters']=_[_0x8349('0x49')](_0x2ca72c['model'],_0x2ca72c['query']);_0x380fca['attributes']=_[_0x8349('0x49')](_0x2ca72c[_0x8349('0x45')],qs[_0x8349('0x4a')](_0xd05efb[_0x8349('0x47')]['fields']));_0x380fca[_0x8349('0x4b')]=_0x380fca[_0x8349('0x4b')][_0x8349('0x68')]?_0x380fca[_0x8349('0x4b')]:_0x2ca72c[_0x8349('0x45')];_0x380fca[_0x8349('0x4d')]=qs[_0x8349('0x4e')](_0xd05efb[_0x8349('0x47')][_0x8349('0x4e')]);_0x380fca[_0x8349('0x4f')]=qs['filters'](_[_0x8349('0x6a')](_0xd05efb[_0x8349('0x47')],_0x2ca72c['filters']));if(_0xd05efb[_0x8349('0x47')]['filter']){_0x380fca[_0x8349('0x4f')]=_[_0x8349('0x52')](_0x380fca['where'],{'$or':_[_0x8349('0x40')](_0x380fca['attributes'],function(_0x2e0aef){var _0x1c1373={};_0x1c1373[_0x2e0aef]={'$like':'%'+_0xd05efb['query'][_0x8349('0x50')]+'%'};return _0x1c1373;})});}_0x380fca=_['merge']({},_0x380fca,_0xd05efb[_0x8349('0x53')]);return _0x431711[_0x8349('0x74')](_0x380fca);}})[_0x8349('0x3a')](function(_0x2e3302){if(_0x2e3302){_0x554631=_0x2e3302['length'];if(!_0xd05efb[_0x8349('0x47')]['hasOwnProperty'](_0x8349('0x4c'))){_0x380fca['limit']=qs[_0x8349('0x33')](_0xd05efb[_0x8349('0x47')][_0x8349('0x33')]);_0x380fca[_0x8349('0x31')]=qs['offset'](_0xd05efb['query']['offset']);}return _0x431711[_0x8349('0x74')](_0x380fca);}})[_0x8349('0x3a')](function(_0x19989c){if(_0x19989c){return _0x19989c?{'count':_0x554631,'rows':_0x19989c}:null;}})[_0x8349('0x3a')](respondWithResult(_0x3df37e,null))[_0x8349('0x2c')](handleError(_0x3df37e,null));};exports['addTeams']=function(_0x139ab9,_0x164bef,_0x63342f){var _0x101992=_0x139ab9[_0x8349('0x63')][_0x8349('0x75')];return db['Team'][_0x8349('0x56')]({'where':{'id':_0x101992},'attributes':['id'],'include':[{'model':db[_0x8349('0x6c')],'as':_0x8349('0x76'),'attributes':['id',_0x8349('0x3d'),_0x8349('0x77'),'voicePause',_0x8349('0x78')],'raw':!![]}]})[_0x8349('0x3a')](function(_0x5f0147){if(_0x5f0147){var _0x2a6c65=_[_0x8349('0x79')](_0x5f0147,function(_0x41f62b){var _0x4072e6=_0x41f62b[_0x8349('0x5b')]({'plain':!![]});return _0x4072e6[_0x8349('0x76')];});return db['ChatQueue'][_0x8349('0x59')]({'where':{'id':_0x139ab9[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](function(_0x2e6500){return db[_0x8349('0x7a')][_0x8349('0x7b')](function(_0x2d5653){return _0x2e6500['addTeams'](_0x101992,{'transaction':_0x2d5653})[_0x8349('0x3a')](function(){return BPromise[_0x8349('0x7c')](_0x2a6c65,function(_0x2074f2){return db['UserChatQueue'][_0x8349('0x7d')]({'where':{'UserId':_0x2074f2['id'],'ChatQueueId':_0x139ab9[_0x8349('0x62')]['id']},'transaction':_0x2d5653});});})['then'](function(){_0x2a6c65['forEach'](function(_0x44d153){socket[_0x8349('0x7e')](_0x8349('0x7f'),{'UserId':_0x44d153['id'],'ChatQueueId':_0x2e6500['id']});});});});});}})[_0x8349('0x3a')](respondWithStatusCode(_0x164bef,null))[_0x8349('0x2c')](handleError(_0x164bef,null));};exports[_0x8349('0x80')]=function(_0x47b6d5,_0x1fdaa0,_0x45f749){return db['Team'][_0x8349('0x56')]({'where':{'id':_0x47b6d5[_0x8349('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8349('0x6c')],'as':_0x8349('0x76'),'attributes':['id'],'raw':!![]}]})[_0x8349('0x3a')](handleEntityNotFound(_0x1fdaa0,null))[_0x8349('0x3a')](function(_0x592966){var _0x3b6c6b=_[_0x8349('0x40')](_0x592966,'id');var _0x2551e2=[];var _0x881407=[];var _0x34a961=squel[_0x8349('0x81')]();_0x34a961[_0x8349('0x82')](_0x8349('0x83'))[_0x8349('0x84')]('team_has_chat_queues','tq')[_0x8349('0x85')](_0x8349('0x86'),'ut',_0x8349('0x87'))[_0x8349('0x4f')](_0x8349('0x88'),_0x47b6d5[_0x8349('0x62')]['id']);for(var _0x26dc13=0x0;_0x26dc13<_0x592966['length'];_0x26dc13+=0x1){let _0x31c828=_0x592966[_0x26dc13];for(var _0x4a1405=0x0;_0x4a1405<_0x31c828['Agents'][_0x8349('0x68')];_0x4a1405+=0x1){let _0x387538=_0x31c828[_0x8349('0x76')][_0x4a1405];var _0x46c9d4=_0x34a961[_0x8349('0x89')]();_0x46c9d4['where'](_0x8349('0x8a'),_0x387538['id']);_0x881407['push'](db[_0x8349('0x7a')][_0x8349('0x47')](_0x46c9d4[_0x8349('0x8b')](),{'type':db['sequelize'][_0x8349('0x8c')]['SELECT']})[_0x8349('0x3a')](function(_0x402edf){if(_0x402edf[_0x8349('0x68')]===0x1){return _0x387538['id'];}else{var _0x248480=_[_0x8349('0x8d')](_[_0x8349('0x40')](_0x402edf,'TeamId'),function(_0x1bb6ca){return _[_0x8349('0x8e')](_0x3b6c6b,_0x1bb6ca);});if(_0x248480){return _0x387538['id'];}}}));}}return BPromise[_0x8349('0x8f')](_0x881407)[_0x8349('0x3a')](function(_0x1e0bd9){_0x2551e2=_(_0x2551e2)[_0x8349('0x90')](_0x1e0bd9)[_0x8349('0x91')]()[_0x8349('0x92')]();return db['ChatQueue'][_0x8349('0x59')]({'where':{'id':_0x47b6d5['params']['id']}})[_0x8349('0x3a')](function(_0x185019){return db[_0x8349('0x7a')][_0x8349('0x7b')](function(_0x5532bd){return _0x185019['removeTeams'](_0x47b6d5[_0x8349('0x47')]['ids'],{'transaction':_0x5532bd})[_0x8349('0x3a')](function(){if(!_['isEmpty'](_0x2551e2)){return _0x185019[_0x8349('0x93')](_0x2551e2,{'transaction':_0x5532bd});}})[_0x8349('0x3a')](function(){_0x2551e2[_0x8349('0x94')](function(_0x49aa5f){socket[_0x8349('0x7e')](_0x8349('0x95'),{'UserId':_0x49aa5f,'ChatQueueId':_0x185019['id']});});});});});});})[_0x8349('0x3a')](respondWithStatusCode(_0x1fdaa0,null))[_0x8349('0x2c')](handleError(_0x1fdaa0,null));};exports[_0x8349('0x96')]=function(_0x16bcd9,_0x24042a,_0x542b57){return db[_0x8349('0x41')]['find']({'where':{'id':_0x16bcd9[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x24042a,null))[_0x8349('0x3a')](function(_0x279215){if(_0x279215){return _0x279215[_0x8349('0x96')](_0x16bcd9[_0x8349('0x63')][_0x8349('0x75')],_[_0x8349('0x97')](_0x16bcd9[_0x8349('0x63')],[_0x8349('0x75'),'id'])||{})[_0x8349('0x98')](function(_0x3ffc37){for(var _0x1df54d=0x0;_0x1df54d<_0x16bcd9['body'][_0x8349('0x75')][_0x8349('0x68')];_0x1df54d+=0x1){socket[_0x8349('0x7e')](_0x8349('0x7f'),{'UserId':Number(_0x16bcd9[_0x8349('0x63')][_0x8349('0x75')][_0x1df54d]),'ChatQueueId':Number(_0x16bcd9[_0x8349('0x62')]['id'])});}return _0x3ffc37;});}})[_0x8349('0x3a')](respondWithResult(_0x24042a,null))['catch'](handleError(_0x24042a,null));};exports[_0x8349('0x93')]=function(_0x717630,_0x3d4319,_0x477398){return db[_0x8349('0x41')]['find']({'where':{'id':_0x717630[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x3d4319,null))[_0x8349('0x3a')](function(_0x506443){if(_0x506443){return _0x506443[_0x8349('0x93')](_0x717630[_0x8349('0x47')]['ids'])[_0x8349('0x3a')](function(){if(_[_0x8349('0x99')](_0x717630[_0x8349('0x47')][_0x8349('0x75')])){for(var _0x5b4da1=0x0;_0x5b4da1<_0x717630[_0x8349('0x47')][_0x8349('0x75')][_0x8349('0x68')];_0x5b4da1+=0x1){socket[_0x8349('0x7e')](_0x8349('0x95'),{'UserId':Number(_0x717630[_0x8349('0x47')][_0x8349('0x75')][_0x5b4da1]),'ChatQueueId':Number(_0x717630[_0x8349('0x62')]['id'])});}}else{socket[_0x8349('0x7e')](_0x8349('0x95'),{'UserId':Number(_0x717630[_0x8349('0x47')][_0x8349('0x75')]),'ChatQueueId':Number(_0x717630[_0x8349('0x62')]['id'])});}});}})[_0x8349('0x3a')](respondWithStatusCode(_0x3d4319,null))[_0x8349('0x2c')](handleError(_0x3d4319,null));};exports[_0x8349('0x9a')]=function(_0x105326,_0x4dcbea,_0x1c048e){var _0x4acd6a={};var _0x13b969={};var _0x3e6dc2;var _0x2ba177;return db['ChatQueue'][_0x8349('0x67')]({'where':{'id':_0x105326[_0x8349('0x62')]['id']}})['then'](handleEntityNotFound(_0x4dcbea,null))[_0x8349('0x3a')](function(_0x256a66){if(_0x256a66){_0x3e6dc2=_0x256a66;_0x13b969[_0x8349('0x45')]=_[_0x8349('0x46')](db[_0x8349('0x6c')][_0x8349('0x42')]);_0x13b969[_0x8349('0x47')]=_[_0x8349('0x46')](_0x105326[_0x8349('0x47')]);_0x13b969['filters']=_[_0x8349('0x49')](_0x13b969[_0x8349('0x45')],_0x13b969[_0x8349('0x47')]);_0x4acd6a[_0x8349('0x4b')]=_['intersection'](_0x13b969['model'],qs[_0x8349('0x4a')](_0x105326[_0x8349('0x47')][_0x8349('0x4a')]));_0x4acd6a['attributes']=_0x4acd6a['attributes']['length']?_0x4acd6a['attributes']:_0x13b969['model'];_0x4acd6a[_0x8349('0x4d')]=qs['sort'](_0x105326[_0x8349('0x47')][_0x8349('0x4e')]);_0x4acd6a[_0x8349('0x4f')]=qs[_0x8349('0x48')](_[_0x8349('0x6a')](_0x105326[_0x8349('0x47')],_0x13b969['filters']));if(_0x105326['query'][_0x8349('0x50')]){_0x4acd6a['where']=_[_0x8349('0x52')](_0x4acd6a[_0x8349('0x4f')],{'$or':_[_0x8349('0x40')](_0x4acd6a[_0x8349('0x4b')],function(_0x3673e2){var _0x3517af={};_0x3517af[_0x3673e2]={'$like':'%'+_0x105326[_0x8349('0x47')][_0x8349('0x50')]+'%'};return _0x3517af;})});}_0x4acd6a=_[_0x8349('0x52')]({},_0x4acd6a,_0x105326['options']);return _0x3e6dc2[_0x8349('0x9a')](_0x4acd6a);}})['then'](function(_0x15c49f){if(_0x15c49f){_0x2ba177=_0x15c49f[_0x8349('0x68')];if(!_0x105326['query']['hasOwnProperty'](_0x8349('0x4c'))){_0x4acd6a[_0x8349('0x33')]=qs[_0x8349('0x33')](_0x105326[_0x8349('0x47')][_0x8349('0x33')]);_0x4acd6a[_0x8349('0x31')]=qs['offset'](_0x105326['query'][_0x8349('0x31')]);}return _0x3e6dc2[_0x8349('0x9a')](_0x4acd6a);}})[_0x8349('0x3a')](function(_0x241c2f){if(_0x241c2f){return _0x241c2f?{'count':_0x2ba177,'rows':_0x241c2f}:null;}})[_0x8349('0x3a')](respondWithResult(_0x4dcbea,null))[_0x8349('0x2c')](handleError(_0x4dcbea,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4ad427c..b1b06db 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 _0x5d25=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2ee35a,_0x3f75b0){var _0x1e1230=function(_0x3c51e2){while(--_0x3c51e2){_0x2ee35a['push'](_0x2ee35a['shift']());}};_0x1e1230(++_0x3f75b0);}(_0x5d25,0x117));var _0x55d2=function(_0x1b7178,_0x1cfbdc){_0x1b7178=_0x1b7178-0x0;var _0x596867=_0x5d25[_0x1b7178];return _0x596867;};'use strict';var EventEmitter=require(_0x55d2('0x0'));var ChatQueue=require(_0x55d2('0x1'))['db'][_0x55d2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x55d2('0x3')](0x0);var events={'afterCreate':_0x55d2('0x4'),'afterUpdate':_0x55d2('0x5'),'afterDestroy':_0x55d2('0x6')};function emitEvent(_0x1b3f53){return function(_0x4621eb,_0x3fac46,_0x35051e){ChatQueueEvents['emit'](_0x1b3f53+':'+_0x4621eb['id'],_0x4621eb);ChatQueueEvents[_0x55d2('0x7')](_0x1b3f53,_0x4621eb);_0x35051e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x55d2('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xc108=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2daafe,_0x588e2d){var _0x3272ab=function(_0x111f9b){while(--_0x111f9b){_0x2daafe['push'](_0x2daafe['shift']());}};_0x3272ab(++_0x588e2d);}(_0xc108,0xe9));var _0x8c10=function(_0x12cb8a,_0x320794){_0x12cb8a=_0x12cb8a-0x0;var _0x204f7a=_0xc108[_0x12cb8a];return _0x204f7a;};'use strict';var EventEmitter=require(_0x8c10('0x0'));var ChatQueue=require(_0x8c10('0x1'))['db'][_0x8c10('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8c10('0x3')](0x0);var events={'afterCreate':_0x8c10('0x4'),'afterUpdate':_0x8c10('0x5'),'afterDestroy':_0x8c10('0x6')};function emitEvent(_0x15e699){return function(_0xec2872,_0x59bcfe,_0x346ca2){ChatQueueEvents[_0x8c10('0x7')](_0x15e699+':'+_0xec2872['id'],_0xec2872);ChatQueueEvents[_0x8c10('0x7')](_0x15e699,_0xec2872);_0x346ca2(null);};}for(var e in events){if(events[_0x8c10('0x8')](e)){var event=events[e];ChatQueue[_0x8c10('0x9')](e,emitEvent(event));}}module[_0x8c10('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 2457405..bd9dbae 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 _0xc8aa=['bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xc8aa,0x98));var _0xac8a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc8aa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xac8a('0x0'));var logger=require(_0xac8a('0x1'))(_0xac8a('0x2'));var moment=require(_0xac8a('0x3'));var BPromise=require(_0xac8a('0x4'));var rp=require(_0xac8a('0x5'));var fs=require('fs');var path=require(_0xac8a('0x6'));var rimraf=require('rimraf');var config=require(_0xac8a('0x7'));var attributes=require(_0xac8a('0x8'));module[_0xac8a('0x9')]=function(_0x65e486,_0x798a97){return _0x65e486[_0xac8a('0xa')](_0xac8a('0xb'),attributes,{'tableName':_0xac8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4699=['./chatQueue.attributes','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e0157,_0x384e12){var _0x2b17ce=function(_0x2e258a){while(--_0x2e258a){_0x1e0157['push'](_0x1e0157['shift']());}};_0x2b17ce(++_0x384e12);}(_0x4699,0x7b));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9469('0x0'))(_0x9469('0x1'));var moment=require(_0x9469('0x2'));var BPromise=require(_0x9469('0x3'));var rp=require(_0x9469('0x4'));var fs=require('fs');var path=require(_0x9469('0x5'));var rimraf=require(_0x9469('0x6'));var config=require('../../config/environment');var attributes=require(_0x9469('0x7'));module['exports']=function(_0x247b63,_0x375b32){return _0x247b63['define'](_0x9469('0x8'),attributes,{'tableName':_0x9469('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 f3dc66f..0d43282 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 _0xfbe6=['register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket'];(function(_0x17c188,_0x39a5b9){var _0xcb1f55=function(_0x4e7ea3){while(--_0x4e7ea3){_0x17c188['push'](_0x17c188['shift']());}};_0xcb1f55(++_0x39a5b9);}(_0xfbe6,0x6d));var _0x6fbe=function(_0x2a590d,_0x2f8f75){_0x2a590d=_0x2a590d-0x0;var _0x57f4bd=_0xfbe6[_0x2a590d];return _0x57f4bd;};'use strict';var _=require(_0x6fbe('0x0'));var util=require(_0x6fbe('0x1'));var moment=require(_0x6fbe('0x2'));var BPromise=require('bluebird');var rs=require(_0x6fbe('0x3'));var fs=require('fs');var Redis=require(_0x6fbe('0x4'));var db=require(_0x6fbe('0x5'))['db'];var utils=require(_0x6fbe('0x6'));var logger=require(_0x6fbe('0x7'))(_0x6fbe('0x8'));var config=require(_0x6fbe('0x9'));var jayson=require(_0x6fbe('0xa'));var client=jayson[_0x6fbe('0xb')][_0x6fbe('0xc')]({'port':0x232a});config['redis']=_[_0x6fbe('0xd')](config[_0x6fbe('0xe')],{'host':_0x6fbe('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fbe('0xe')]));require(_0x6fbe('0x10'))[_0x6fbe('0x11')](socket);function respondWithRpcPromise(_0xf52557,_0x156d44,_0xbc5490){return new BPromise(function(_0x2440a8,_0xabb67){return client[_0x6fbe('0x12')](_0xf52557,_0xbc5490)[_0x6fbe('0x13')](function(_0x57ba06){logger[_0x6fbe('0x14')](_0x6fbe('0x15'),_0x156d44,_0x6fbe('0x16'));logger[_0x6fbe('0x17')](_0x6fbe('0x18'),_0x156d44,_0x6fbe('0x16'),JSON[_0x6fbe('0x19')](_0x57ba06));if(_0x57ba06[_0x6fbe('0x1a')]){if(_0x57ba06['error']['code']===0x1f4){logger[_0x6fbe('0x1a')](_0x6fbe('0x15'),_0x156d44,_0x57ba06[_0x6fbe('0x1a')]['message']);return _0xabb67(_0x57ba06[_0x6fbe('0x1a')][_0x6fbe('0x1b')]);}logger[_0x6fbe('0x1a')](_0x6fbe('0x15'),_0x156d44,_0x57ba06[_0x6fbe('0x1a')][_0x6fbe('0x1b')]);return _0x2440a8(_0x57ba06[_0x6fbe('0x1a')][_0x6fbe('0x1b')]);}else{logger['info'](_0x6fbe('0x15'),_0x156d44,_0x6fbe('0x16'));_0x2440a8(_0x57ba06[_0x6fbe('0x1c')][_0x6fbe('0x1b')]);}})[_0x6fbe('0x1d')](function(_0xc928e3){logger['error'](_0x6fbe('0x15'),_0x156d44,_0xc928e3);_0xabb67(_0xc928e3);});});}exports[_0x6fbe('0x1e')]=function(_0xf621dc){var _0x429a18=this;return new Promise(function(_0x1da159,_0x4155f4){return db['ChatQueue'][_0x6fbe('0x1f')]({'raw':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x21')]===undefined?!![]:![]:!![],'where':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x22')]||null:null,'attributes':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x23')]||null:null,'limit':_0xf621dc['options']?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x24')]||null:null,'include':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')]['include']?_[_0x6fbe('0x25')](_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x26')],function(_0x403660){return{'model':db[_0x403660['model']],'as':_0x403660['as'],'attributes':_0x403660[_0x6fbe('0x23')],'include':_0x403660['include']?_[_0x6fbe('0x25')](_0x403660[_0x6fbe('0x26')],function(_0x171b76){return{'model':db[_0x171b76[_0x6fbe('0x27')]],'as':_0x171b76['as'],'attributes':_0x171b76[_0x6fbe('0x23')],'include':_0x171b76['include']?_[_0x6fbe('0x25')](_0x171b76['include'],function(_0x102555){return{'model':db[_0x102555[_0x6fbe('0x27')]],'as':_0x102555['as'],'attributes':_0x102555['attributes']};}):[]};}):[]};}):[]:[]})[_0x6fbe('0x13')](function(_0x1d8e33){logger[_0x6fbe('0x14')](_0x6fbe('0x1e'),_0xf621dc);logger[_0x6fbe('0x17')](_0x6fbe('0x1e'),_0xf621dc,JSON[_0x6fbe('0x19')](_0x1d8e33));_0x1da159(_0x1d8e33);})[_0x6fbe('0x1d')](function(_0x191e46){logger[_0x6fbe('0x1a')](_0x6fbe('0x1e'),_0x191e46[_0x6fbe('0x1b')],_0xf621dc);_0x4155f4(_0x429a18[_0x6fbe('0x1a')](0x1f4,_0x191e46['message']));});});};exports[_0x6fbe('0x28')]=function(_0x14927a){var _0x471050=this;return new Promise(function(_0x4332f4,_0x1ff129){return db['ChatQueue'][_0x6fbe('0x29')]({'raw':_0x14927a[_0x6fbe('0x20')]?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x21')]===undefined?!![]:![]:!![],'where':_0x14927a[_0x6fbe('0x20')]?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x22')]||null:null,'attributes':_0x14927a['options']?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x23')]||null:null,'include':_0x14927a[_0x6fbe('0x20')]?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x26')]?_[_0x6fbe('0x25')](_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x26')],function(_0x32d8d7){return{'model':db[_0x32d8d7[_0x6fbe('0x27')]],'as':_0x32d8d7['as'],'attributes':_0x32d8d7[_0x6fbe('0x23')],'include':_0x32d8d7[_0x6fbe('0x26')]?_['map'](_0x32d8d7['include'],function(_0x4c0dc1){return{'model':db[_0x4c0dc1[_0x6fbe('0x27')]],'as':_0x4c0dc1['as'],'attributes':_0x4c0dc1['attributes'],'include':_0x4c0dc1['include']?_[_0x6fbe('0x25')](_0x4c0dc1[_0x6fbe('0x26')],function(_0xb334b4){return{'model':db[_0xb334b4['model']],'as':_0xb334b4['as'],'attributes':_0xb334b4[_0x6fbe('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x578727){logger[_0x6fbe('0x14')](_0x6fbe('0x28'),_0x14927a);logger[_0x6fbe('0x17')]('ShowChatQueue',_0x14927a,JSON[_0x6fbe('0x19')](_0x578727));_0x4332f4(_0x578727);})[_0x6fbe('0x1d')](function(_0x1cc0b3){logger['error'](_0x6fbe('0x28'),_0x1cc0b3[_0x6fbe('0x1b')],_0x14927a);_0x1ff129(_0x471050[_0x6fbe('0x1a')](0x1f4,_0x1cc0b3['message']));});});}; \ No newline at end of file +var _0x00f4=['http','redis','defaults','localhost','socket.io-emitter','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowChatQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2aa746,_0x46710e){var _0x250460=function(_0xe75055){while(--_0xe75055){_0x2aa746['push'](_0x2aa746['shift']());}};_0x250460(++_0x46710e);}(_0x00f4,0x137));var _0x400f=function(_0x389c32,_0xe48b5e){_0x389c32=_0x389c32-0x0;var _0x38c203=_0x00f4[_0x389c32];return _0x38c203;};'use strict';var _=require(_0x400f('0x0'));var util=require('util');var moment=require(_0x400f('0x1'));var BPromise=require(_0x400f('0x2'));var rs=require(_0x400f('0x3'));var fs=require('fs');var Redis=require(_0x400f('0x4'));var db=require(_0x400f('0x5'))['db'];var utils=require(_0x400f('0x6'));var logger=require(_0x400f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x400f('0x8'));var client=jayson['client'][_0x400f('0x9')]({'port':0x232a});config[_0x400f('0xa')]=_[_0x400f('0xb')](config[_0x400f('0xa')],{'host':_0x400f('0xc'),'port':0x18eb});var socket=require(_0x400f('0xd'))(new Redis(config[_0x400f('0xa')]));require('./chatQueue.socket')[_0x400f('0xe')](socket);function respondWithRpcPromise(_0x3ad157,_0x162379,_0x448d43){return new BPromise(function(_0x481b05,_0x96bdae){return client[_0x400f('0xf')](_0x3ad157,_0x448d43)['then'](function(_0x2d65b4){logger['info'](_0x400f('0x10'),_0x162379,_0x400f('0x11'));logger[_0x400f('0x12')](_0x400f('0x13'),_0x162379,'request\x20sent',JSON['stringify'](_0x2d65b4));if(_0x2d65b4['error']){if(_0x2d65b4[_0x400f('0x14')][_0x400f('0x15')]===0x1f4){logger[_0x400f('0x14')](_0x400f('0x10'),_0x162379,_0x2d65b4['error'][_0x400f('0x16')]);return _0x96bdae(_0x2d65b4[_0x400f('0x14')][_0x400f('0x16')]);}logger[_0x400f('0x14')](_0x400f('0x10'),_0x162379,_0x2d65b4['error'][_0x400f('0x16')]);return _0x481b05(_0x2d65b4[_0x400f('0x14')]['message']);}else{logger['info'](_0x400f('0x10'),_0x162379,'request\x20sent');_0x481b05(_0x2d65b4[_0x400f('0x17')][_0x400f('0x16')]);}})[_0x400f('0x18')](function(_0x24e1ef){logger['error'](_0x400f('0x10'),_0x162379,_0x24e1ef);_0x96bdae(_0x24e1ef);});});}exports[_0x400f('0x19')]=function(_0x84d0fd){var _0x747b41=this;return new Promise(function(_0x3a9e2c,_0x1245ef){return db[_0x400f('0x1a')]['findAll']({'raw':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1c')]===undefined?!![]:![]:!![],'where':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1d')]||null:null,'attributes':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1e')]||null:null,'limit':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd['options'][_0x400f('0x1f')]||null:null,'include':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x20')]?_[_0x400f('0x21')](_0x84d0fd[_0x400f('0x1b')][_0x400f('0x20')],function(_0x4e279f){return{'model':db[_0x4e279f[_0x400f('0x22')]],'as':_0x4e279f['as'],'attributes':_0x4e279f[_0x400f('0x1e')],'include':_0x4e279f[_0x400f('0x20')]?_[_0x400f('0x21')](_0x4e279f[_0x400f('0x20')],function(_0x1b62be){return{'model':db[_0x1b62be[_0x400f('0x22')]],'as':_0x1b62be['as'],'attributes':_0x1b62be[_0x400f('0x1e')],'include':_0x1b62be[_0x400f('0x20')]?_[_0x400f('0x21')](_0x1b62be[_0x400f('0x20')],function(_0x5c52f2){return{'model':db[_0x5c52f2[_0x400f('0x22')]],'as':_0x5c52f2['as'],'attributes':_0x5c52f2[_0x400f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x400f('0x23')](function(_0x49c993){logger['info'](_0x400f('0x19'),_0x84d0fd);logger[_0x400f('0x12')](_0x400f('0x19'),_0x84d0fd,JSON[_0x400f('0x24')](_0x49c993));_0x3a9e2c(_0x49c993);})[_0x400f('0x18')](function(_0x218c58){logger[_0x400f('0x14')](_0x400f('0x19'),_0x218c58['message'],_0x84d0fd);_0x1245ef(_0x747b41['error'](0x1f4,_0x218c58[_0x400f('0x16')]));});});};exports[_0x400f('0x25')]=function(_0xc83b4f){var _0x208d33=this;return new Promise(function(_0x8549ec,_0x5d1975){return db[_0x400f('0x1a')][_0x400f('0x26')]({'raw':_0xc83b4f['options']?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x1c')]===undefined?!![]:![]:!![],'where':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f['options'][_0x400f('0x1d')]||null:null,'attributes':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x1e')]||null:null,'include':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x20')]?_[_0x400f('0x21')](_0xc83b4f[_0x400f('0x1b')][_0x400f('0x20')],function(_0x534d64){return{'model':db[_0x534d64[_0x400f('0x22')]],'as':_0x534d64['as'],'attributes':_0x534d64[_0x400f('0x1e')],'include':_0x534d64[_0x400f('0x20')]?_[_0x400f('0x21')](_0x534d64['include'],function(_0x52e747){return{'model':db[_0x52e747['model']],'as':_0x52e747['as'],'attributes':_0x52e747[_0x400f('0x1e')],'include':_0x52e747[_0x400f('0x20')]?_[_0x400f('0x21')](_0x52e747['include'],function(_0x4d44b0){return{'model':db[_0x4d44b0[_0x400f('0x22')]],'as':_0x4d44b0['as'],'attributes':_0x4d44b0[_0x400f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x400f('0x23')](function(_0x15461a){logger[_0x400f('0x27')]('ShowChatQueue',_0xc83b4f);logger[_0x400f('0x12')](_0x400f('0x25'),_0xc83b4f,JSON[_0x400f('0x24')](_0x15461a));_0x8549ec(_0x15461a);})['catch'](function(_0x3b9d35){logger[_0x400f('0x14')](_0x400f('0x25'),_0x3b9d35[_0x400f('0x16')],_0xc83b4f);_0x5d1975(_0x208d33[_0x400f('0x14')](0x1f4,_0x3b9d35[_0x400f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b1f7698..a1fdedd 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 _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x517601,_0x173b35){var _0x1d470a=function(_0x324bae){while(--_0x324bae){_0x517601['push'](_0x517601['shift']());}};_0x1d470a(++_0x173b35);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x57f6ad,_0x4795b6){_0x57f6ad=_0x57f6ad-0x0;var _0x425c09=_0x6f0d[_0x57f6ad];return _0x425c09;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file +var _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0x5ad3[_0x297dcf];return _0xe1699b;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 305781a..1341c43 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3555be,_0x4e47ce){var _0x23a8b3=function(_0x4129a1){while(--_0x4129a1){_0x3555be['push'](_0x3555be['shift']());}};_0x23a8b3(++_0x4e47ce);}(_0xe14b,0x93));var _0xbe14=function(_0xe6a63e,_0x94e572){_0xe6a63e=_0xe6a63e-0x0;var _0x4c76af=_0xe14b[_0xe6a63e];return _0x4c76af;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x440a3b,_0x5d29e4){_0x440a3b=_0x440a3b-0x0;var _0x3d45c9=_0x3e74[_0x440a3b];return _0x3d45c9;};'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('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index d3de02e..23d2b36 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 _0xc0af=['exports','STRING','DATE','moment'];(function(_0x1e9c80,_0x386dd6){var _0x53bdd5=function(_0xa1cf40){while(--_0xa1cf40){_0x1e9c80['push'](_0x1e9c80['shift']());}};_0x53bdd5(++_0x386dd6);}(_0xc0af,0x1ab));var _0xfc0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0af[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xfc0a('0x0'));var Sequelize=require('sequelize');module[_0xfc0a('0x1')]={'uniqueid':{'type':Sequelize[_0xfc0a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfc0a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfc0a('0x3')]},'exitAt':{'type':Sequelize[_0xfc0a('0x3')]},'reason':{'type':Sequelize[_0xfc0a('0x2')]}}; \ No newline at end of file +var _0x7233=['sequelize','exports','STRING','DATE','moment'];(function(_0xd5bc05,_0x4139ee){var _0x4e77a4=function(_0x89f218){while(--_0x89f218){_0xd5bc05['push'](_0xd5bc05['shift']());}};_0x4e77a4(++_0x4139ee);}(_0x7233,0x1b2));var _0x3723=function(_0x1275ce,_0x4eaea7){_0x1275ce=_0x1275ce-0x0;var _0x3fab97=_0x7233[_0x1275ce];return _0x3fab97;};'use strict';var moment=require(_0x3723('0x0'));var Sequelize=require(_0x3723('0x1'));module[_0x3723('0x2')]={'uniqueid':{'type':Sequelize[_0x3723('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3723('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3723('0x4')]},'exitAt':{'type':Sequelize[_0x3723('0x4')]},'reason':{'type':Sequelize[_0x3723('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 9a2d3b7..bcf50ff 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 _0x1a38=['pick','filter','where','merge','options','then','includeAll','ChatQueueReport','findAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','reject','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a38,0xb0));var _0x81a3=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x1a38[_0x20c9b2];return _0x2c6030;};'use strict';var emlformat=require(_0x81a3('0x0'));var rimraf=require(_0x81a3('0x1'));var zipdir=require(_0x81a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x81a3('0x3'));var Mustache=require(_0x81a3('0x4'));var util=require(_0x81a3('0x5'));var path=require(_0x81a3('0x6'));var sox=require(_0x81a3('0x7'));var csv=require(_0x81a3('0x8'));var ejs=require(_0x81a3('0x9'));var fs=require('fs');var fs_extra=require(_0x81a3('0xa'));var _=require(_0x81a3('0xb'));var squel=require(_0x81a3('0xc'));var crypto=require(_0x81a3('0xd'));var jsforce=require(_0x81a3('0xe'));var deskjs=require(_0x81a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x81a3('0x10'));var Papa=require(_0x81a3('0x11'));var Redis=require(_0x81a3('0x12'));var authService=require(_0x81a3('0x13'));var qs=require(_0x81a3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81a3('0x15'));var logger=require(_0x81a3('0x16'))(_0x81a3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x81a3('0x18'));var db=require(_0x81a3('0x19'))['db'];function respondWithStatusCode(_0x44ac21,_0x45004e){_0x45004e=_0x45004e||0xcc;return function(_0x199fa0){if(_0x199fa0){return _0x44ac21[_0x81a3('0x1a')](_0x45004e);}return _0x44ac21[_0x81a3('0x1b')](_0x45004e)[_0x81a3('0x1c')]();};}function respondWithResult(_0x3305a9,_0x17fa02){_0x17fa02=_0x17fa02||0xc8;return function(_0x2683f3){if(_0x2683f3){return _0x3305a9[_0x81a3('0x1b')](_0x17fa02)['json'](_0x2683f3);}};}function respondWithFilteredResult(_0x168cf1,_0x277e02){return function(_0x2c5a34){if(_0x2c5a34){var _0x2a0b2c=typeof _0x277e02['offset']===_0x81a3('0x1d')&&typeof _0x277e02[_0x81a3('0x1e')]==='undefined';var _0xcf3fd=_0x2c5a34['count'];var _0x4d4b86=_0x2a0b2c?0x0:_0x277e02[_0x81a3('0x1f')];var _0x1cd821=_0x2a0b2c?_0x2c5a34[_0x81a3('0x20')]:_0x277e02[_0x81a3('0x1f')]+_0x277e02[_0x81a3('0x1e')];var _0x2aaa65;if(_0x1cd821>=_0xcf3fd){_0x1cd821=_0xcf3fd;_0x2aaa65=0xc8;}else{_0x2aaa65=0xce;}_0x168cf1[_0x81a3('0x1b')](_0x2aaa65);return _0x168cf1[_0x81a3('0x21')]('Content-Range',_0x4d4b86+'-'+_0x1cd821+'/'+_0xcf3fd)[_0x81a3('0x22')](_0x2c5a34);}return null;};}function patchUpdates(_0x324706){return function(_0x4ef0c4){try{jsonpatch[_0x81a3('0x23')](_0x4ef0c4,_0x324706,!![]);}catch(_0x2babc8){return BPromise[_0x81a3('0x24')](_0x2babc8);}return _0x4ef0c4[_0x81a3('0x25')]();};}function saveUpdates(_0x58b63d,_0x316d48){return function(_0x3f15ca){if(_0x3f15ca){return _0x3f15ca[_0x81a3('0x26')](_0x58b63d)['then'](function(_0x5bf502){return _0x5bf502;});}return null;};}function removeEntity(_0x245e23,_0x328b0d){return function(_0x19d2e1){if(_0x19d2e1){return _0x19d2e1[_0x81a3('0x27')]()['then'](function(){_0x245e23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1583fd,_0x245026){return function(_0x3ba769){if(!_0x3ba769){_0x1583fd[_0x81a3('0x1a')](0x194);}return _0x3ba769;};}function handleError(_0x1e6603,_0x4096ef){_0x4096ef=_0x4096ef||0x1f4;return function(_0x3f850d){logger[_0x81a3('0x28')](_0x3f850d[_0x81a3('0x29')]);if(_0x3f850d[_0x81a3('0x2a')]){delete _0x3f850d[_0x81a3('0x2a')];}_0x1e6603[_0x81a3('0x1b')](_0x4096ef)['send'](_0x3f850d);};}exports[_0x81a3('0x2b')]=function(_0x346141,_0x398213){var _0x5b4c91={},_0x4afd80={},_0x2e04af={'count':0x0,'rows':[]};var _0x2bec93=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x962822){return{'name':_0x962822[_0x81a3('0x2c')],'type':_0x962822[_0x81a3('0x2d')][_0x81a3('0x2e')]};});_0x4afd80[_0x81a3('0x2f')]=_[_0x81a3('0x30')](_0x2bec93,'name');_0x4afd80[_0x81a3('0x31')]=_['keys'](_0x346141[_0x81a3('0x31')]);_0x4afd80[_0x81a3('0x32')]=_[_0x81a3('0x33')](_0x4afd80[_0x81a3('0x2f')],_0x4afd80[_0x81a3('0x31')]);_0x5b4c91[_0x81a3('0x34')]=_[_0x81a3('0x33')](_0x4afd80[_0x81a3('0x2f')],qs[_0x81a3('0x35')](_0x346141['query']['fields']));_0x5b4c91[_0x81a3('0x34')]=_0x5b4c91['attributes'][_0x81a3('0x36')]?_0x5b4c91['attributes']:_0x4afd80['model'];if(!_0x346141[_0x81a3('0x31')][_0x81a3('0x37')](_0x81a3('0x38'))){_0x5b4c91[_0x81a3('0x1e')]=qs['limit'](_0x346141[_0x81a3('0x31')][_0x81a3('0x1e')]);_0x5b4c91[_0x81a3('0x1f')]=qs['offset'](_0x346141[_0x81a3('0x31')]['offset']);}_0x5b4c91['order']=qs['sort'](_0x346141[_0x81a3('0x31')][_0x81a3('0x39')]);_0x5b4c91['where']=qs[_0x81a3('0x32')](_[_0x81a3('0x3a')](_0x346141[_0x81a3('0x31')],_0x4afd80['filters']),_0x2bec93);if(_0x346141['query'][_0x81a3('0x3b')]){_0x5b4c91[_0x81a3('0x3c')]=_['merge'](_0x5b4c91[_0x81a3('0x3c')],{'$or':_[_0x81a3('0x30')](_0x2bec93,function(_0x519800){if(_0x519800[_0x81a3('0x2d')]!=='VIRTUAL'){var _0x53cf9f={};_0x53cf9f[_0x519800['name']]={'$like':'%'+_0x346141[_0x81a3('0x31')][_0x81a3('0x3b')]+'%'};return _0x53cf9f;}})});}_0x5b4c91=_[_0x81a3('0x3d')]({},_0x5b4c91,_0x346141[_0x81a3('0x3e')]);var _0x24de2d={'where':_0x5b4c91[_0x81a3('0x3c')]};return db['ChatQueueReport'][_0x81a3('0x20')](_0x24de2d)[_0x81a3('0x3f')](function(_0x33504d){_0x2e04af[_0x81a3('0x20')]=_0x33504d;if(_0x346141[_0x81a3('0x31')][_0x81a3('0x40')]){_0x5b4c91['include']=[{'all':!![]}];}return db[_0x81a3('0x41')][_0x81a3('0x42')](_0x5b4c91);})['then'](function(_0x45bc48){_0x2e04af[_0x81a3('0x43')]=_0x45bc48;return _0x2e04af;})[_0x81a3('0x3f')](respondWithFilteredResult(_0x398213,_0x5b4c91))['catch'](handleError(_0x398213,null));};exports[_0x81a3('0x44')]=function(_0x28c205,_0x4e67ba){var _0x24e250={'raw':!![],'where':{'id':_0x28c205[_0x81a3('0x45')]['id']}},_0x13d5bb={};_0x13d5bb[_0x81a3('0x2f')]=_[_0x81a3('0x46')](db[_0x81a3('0x41')][_0x81a3('0x47')]);_0x13d5bb['query']=_['keys'](_0x28c205['query']);_0x13d5bb[_0x81a3('0x32')]=_[_0x81a3('0x33')](_0x13d5bb[_0x81a3('0x2f')],_0x13d5bb['query']);_0x24e250[_0x81a3('0x34')]=_[_0x81a3('0x33')](_0x13d5bb['model'],qs[_0x81a3('0x35')](_0x28c205[_0x81a3('0x31')][_0x81a3('0x35')]));_0x24e250['attributes']=_0x24e250[_0x81a3('0x34')]['length']?_0x24e250[_0x81a3('0x34')]:_0x13d5bb[_0x81a3('0x2f')];if(_0x28c205['query']['includeAll']){_0x24e250[_0x81a3('0x48')]=[{'all':!![]}];}_0x24e250=_[_0x81a3('0x3d')]({},_0x24e250,_0x28c205['options']);return db[_0x81a3('0x41')][_0x81a3('0x49')](_0x24e250)[_0x81a3('0x3f')](handleEntityNotFound(_0x4e67ba,null))[_0x81a3('0x3f')](respondWithResult(_0x4e67ba,null))[_0x81a3('0x4a')](handleError(_0x4e67ba,null));};exports[_0x81a3('0x4b')]=function(_0x54f2df,_0x30836a){return db['ChatQueueReport']['create'](_0x54f2df[_0x81a3('0x4c')],{})['then'](respondWithResult(_0x30836a,0xc9))[_0x81a3('0x4a')](handleError(_0x30836a,null));};exports[_0x81a3('0x26')]=function(_0x4237af,_0x5d7f5c){if(_0x4237af[_0x81a3('0x4c')]['id']){delete _0x4237af[_0x81a3('0x4c')]['id'];}return db[_0x81a3('0x41')][_0x81a3('0x49')]({'where':{'id':_0x4237af[_0x81a3('0x45')]['id']}})[_0x81a3('0x3f')](handleEntityNotFound(_0x5d7f5c,null))[_0x81a3('0x3f')](saveUpdates(_0x4237af[_0x81a3('0x4c')],null))[_0x81a3('0x3f')](respondWithResult(_0x5d7f5c,null))['catch'](handleError(_0x5d7f5c,null));};exports['destroy']=function(_0x286606,_0x376c6e){return db[_0x81a3('0x41')][_0x81a3('0x49')]({'where':{'id':_0x286606[_0x81a3('0x45')]['id']}})[_0x81a3('0x3f')](handleEntityNotFound(_0x376c6e,null))[_0x81a3('0x3f')](removeEntity(_0x376c6e,null))[_0x81a3('0x4a')](handleError(_0x376c6e,null));};exports[_0x81a3('0x4d')]=function(_0x1029b3,_0x740d0f){return db['ChatQueueReport']['describe']()[_0x81a3('0x3f')](respondWithResult(_0x740d0f,null))['catch'](handleError(_0x740d0f,null));}; \ No newline at end of file +var _0xce14=['request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','ChatQueueReport','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch'];(function(_0x378978,_0xa0a007){var _0x3a9567=function(_0x434b3d){while(--_0x434b3d){_0x378978['push'](_0x378978['shift']());}};_0x3a9567(++_0xa0a007);}(_0xce14,0x17f));var _0x4ce1=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xce14[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ce1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ce1('0x1'));var rp=require(_0x4ce1('0x2'));var moment=require('moment');var BPromise=require(_0x4ce1('0x3'));var Mustache=require(_0x4ce1('0x4'));var util=require(_0x4ce1('0x5'));var path=require(_0x4ce1('0x6'));var sox=require(_0x4ce1('0x7'));var csv=require('to-csv');var ejs=require(_0x4ce1('0x8'));var fs=require('fs');var fs_extra=require(_0x4ce1('0x9'));var _=require(_0x4ce1('0xa'));var squel=require(_0x4ce1('0xb'));var crypto=require('crypto');var jsforce=require(_0x4ce1('0xc'));var deskjs=require(_0x4ce1('0xd'));var toCsv=require(_0x4ce1('0xe'));var querystring=require('querystring');var Papa=require(_0x4ce1('0xf'));var Redis=require(_0x4ce1('0x10'));var authService=require(_0x4ce1('0x11'));var qs=require(_0x4ce1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ce1('0x13'));var logger=require(_0x4ce1('0x14'))(_0x4ce1('0x15'));var utils=require(_0x4ce1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4ce1('0x17'));var db=require(_0x4ce1('0x18'))['db'];function respondWithStatusCode(_0x1297d8,_0x16dade){_0x16dade=_0x16dade||0xcc;return function(_0x171b8f){if(_0x171b8f){return _0x1297d8[_0x4ce1('0x19')](_0x16dade);}return _0x1297d8[_0x4ce1('0x1a')](_0x16dade)[_0x4ce1('0x1b')]();};}function respondWithResult(_0x45f57e,_0x15407b){_0x15407b=_0x15407b||0xc8;return function(_0x321df9){if(_0x321df9){return _0x45f57e['status'](_0x15407b)[_0x4ce1('0x1c')](_0x321df9);}};}function respondWithFilteredResult(_0x4fa4bc,_0x172e2c){return function(_0x1bfd82){if(_0x1bfd82){var _0x1decc2=typeof _0x172e2c[_0x4ce1('0x1d')]==='undefined'&&typeof _0x172e2c[_0x4ce1('0x1e')]==='undefined';var _0x548452=_0x1bfd82['count'];var _0xafda9e=_0x1decc2?0x0:_0x172e2c[_0x4ce1('0x1d')];var _0x3105a9=_0x1decc2?_0x1bfd82[_0x4ce1('0x1f')]:_0x172e2c['offset']+_0x172e2c[_0x4ce1('0x1e')];var _0x48a4ed;if(_0x3105a9>=_0x548452){_0x3105a9=_0x548452;_0x48a4ed=0xc8;}else{_0x48a4ed=0xce;}_0x4fa4bc['status'](_0x48a4ed);return _0x4fa4bc[_0x4ce1('0x20')](_0x4ce1('0x21'),_0xafda9e+'-'+_0x3105a9+'/'+_0x548452)[_0x4ce1('0x1c')](_0x1bfd82);}return null;};}function patchUpdates(_0x44a166){return function(_0x1cb999){try{jsonpatch[_0x4ce1('0x22')](_0x1cb999,_0x44a166,!![]);}catch(_0x896adf){return BPromise[_0x4ce1('0x23')](_0x896adf);}return _0x1cb999['save']();};}function saveUpdates(_0x95457f,_0x3bce9d){return function(_0x5c0b4f){if(_0x5c0b4f){return _0x5c0b4f[_0x4ce1('0x24')](_0x95457f)[_0x4ce1('0x25')](function(_0x5aa1c2){return _0x5aa1c2;});}return null;};}function removeEntity(_0x3cf168,_0x2da360){return function(_0x4de527){if(_0x4de527){return _0x4de527['destroy']()['then'](function(){_0x3cf168[_0x4ce1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f6ed,_0x7e6cb3){return function(_0x53895a){if(!_0x53895a){_0x41f6ed[_0x4ce1('0x19')](0x194);}return _0x53895a;};}function handleError(_0x173c1c,_0x312486){_0x312486=_0x312486||0x1f4;return function(_0x7bca8c){logger[_0x4ce1('0x26')](_0x7bca8c[_0x4ce1('0x27')]);if(_0x7bca8c[_0x4ce1('0x28')]){delete _0x7bca8c[_0x4ce1('0x28')];}_0x173c1c[_0x4ce1('0x1a')](_0x312486)[_0x4ce1('0x29')](_0x7bca8c);};}exports[_0x4ce1('0x2a')]=function(_0x1fda83,_0x4e895e){var _0x161fc7={},_0x1ceb1e={},_0x1b9f3c={'count':0x0,'rows':[]};var _0x2002b9=_[_0x4ce1('0x2b')](db['ChatQueueReport'][_0x4ce1('0x2c')],function(_0x355f10){return{'name':_0x355f10[_0x4ce1('0x2d')],'type':_0x355f10[_0x4ce1('0x2e')][_0x4ce1('0x2f')]};});_0x1ceb1e[_0x4ce1('0x30')]=_['map'](_0x2002b9,_0x4ce1('0x28'));_0x1ceb1e[_0x4ce1('0x31')]=_[_0x4ce1('0x32')](_0x1fda83['query']);_0x1ceb1e['filters']=_[_0x4ce1('0x33')](_0x1ceb1e[_0x4ce1('0x30')],_0x1ceb1e[_0x4ce1('0x31')]);_0x161fc7[_0x4ce1('0x34')]=_[_0x4ce1('0x33')](_0x1ceb1e[_0x4ce1('0x30')],qs['fields'](_0x1fda83['query'][_0x4ce1('0x35')]));_0x161fc7[_0x4ce1('0x34')]=_0x161fc7['attributes'][_0x4ce1('0x36')]?_0x161fc7[_0x4ce1('0x34')]:_0x1ceb1e[_0x4ce1('0x30')];if(!_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x37')](_0x4ce1('0x38'))){_0x161fc7[_0x4ce1('0x1e')]=qs[_0x4ce1('0x1e')](_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x1e')]);_0x161fc7[_0x4ce1('0x1d')]=qs['offset'](_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x1d')]);}_0x161fc7[_0x4ce1('0x39')]=qs['sort'](_0x1fda83['query'][_0x4ce1('0x3a')]);_0x161fc7['where']=qs[_0x4ce1('0x3b')](_[_0x4ce1('0x3c')](_0x1fda83[_0x4ce1('0x31')],_0x1ceb1e[_0x4ce1('0x3b')]),_0x2002b9);if(_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x3d')]){_0x161fc7[_0x4ce1('0x3e')]=_['merge'](_0x161fc7['where'],{'$or':_[_0x4ce1('0x2b')](_0x2002b9,function(_0x27d5f4){if(_0x27d5f4[_0x4ce1('0x2e')]!==_0x4ce1('0x3f')){var _0x3a5dd5={};_0x3a5dd5[_0x27d5f4[_0x4ce1('0x28')]]={'$like':'%'+_0x1fda83['query'][_0x4ce1('0x3d')]+'%'};return _0x3a5dd5;}})});}_0x161fc7=_[_0x4ce1('0x40')]({},_0x161fc7,_0x1fda83[_0x4ce1('0x41')]);var _0x3f5d7d={'where':_0x161fc7[_0x4ce1('0x3e')]};return db['ChatQueueReport'][_0x4ce1('0x1f')](_0x3f5d7d)[_0x4ce1('0x25')](function(_0x2247c1){_0x1b9f3c[_0x4ce1('0x1f')]=_0x2247c1;if(_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x42')]){_0x161fc7[_0x4ce1('0x43')]=[{'all':!![]}];}return db[_0x4ce1('0x44')]['findAll'](_0x161fc7);})[_0x4ce1('0x25')](function(_0x17422){_0x1b9f3c[_0x4ce1('0x45')]=_0x17422;return _0x1b9f3c;})[_0x4ce1('0x25')](respondWithFilteredResult(_0x4e895e,_0x161fc7))[_0x4ce1('0x46')](handleError(_0x4e895e,null));};exports[_0x4ce1('0x47')]=function(_0x22643b,_0x37b9af){var _0x542d5c={'raw':!![],'where':{'id':_0x22643b[_0x4ce1('0x48')]['id']}},_0x44127a={};_0x44127a[_0x4ce1('0x30')]=_[_0x4ce1('0x32')](db[_0x4ce1('0x44')][_0x4ce1('0x2c')]);_0x44127a[_0x4ce1('0x31')]=_[_0x4ce1('0x32')](_0x22643b[_0x4ce1('0x31')]);_0x44127a['filters']=_[_0x4ce1('0x33')](_0x44127a[_0x4ce1('0x30')],_0x44127a[_0x4ce1('0x31')]);_0x542d5c['attributes']=_[_0x4ce1('0x33')](_0x44127a[_0x4ce1('0x30')],qs[_0x4ce1('0x35')](_0x22643b[_0x4ce1('0x31')]['fields']));_0x542d5c[_0x4ce1('0x34')]=_0x542d5c[_0x4ce1('0x34')][_0x4ce1('0x36')]?_0x542d5c[_0x4ce1('0x34')]:_0x44127a['model'];if(_0x22643b['query'][_0x4ce1('0x42')]){_0x542d5c['include']=[{'all':!![]}];}_0x542d5c=_[_0x4ce1('0x40')]({},_0x542d5c,_0x22643b[_0x4ce1('0x41')]);return db[_0x4ce1('0x44')][_0x4ce1('0x49')](_0x542d5c)[_0x4ce1('0x25')](handleEntityNotFound(_0x37b9af,null))[_0x4ce1('0x25')](respondWithResult(_0x37b9af,null))[_0x4ce1('0x46')](handleError(_0x37b9af,null));};exports[_0x4ce1('0x4a')]=function(_0x36d714,_0x4ba44c){return db[_0x4ce1('0x44')]['create'](_0x36d714[_0x4ce1('0x4b')],{})[_0x4ce1('0x25')](respondWithResult(_0x4ba44c,0xc9))['catch'](handleError(_0x4ba44c,null));};exports[_0x4ce1('0x24')]=function(_0x544cac,_0xea34e6){if(_0x544cac[_0x4ce1('0x4b')]['id']){delete _0x544cac[_0x4ce1('0x4b')]['id'];}return db['ChatQueueReport'][_0x4ce1('0x49')]({'where':{'id':_0x544cac[_0x4ce1('0x48')]['id']}})[_0x4ce1('0x25')](handleEntityNotFound(_0xea34e6,null))[_0x4ce1('0x25')](saveUpdates(_0x544cac[_0x4ce1('0x4b')],null))[_0x4ce1('0x25')](respondWithResult(_0xea34e6,null))[_0x4ce1('0x46')](handleError(_0xea34e6,null));};exports['destroy']=function(_0x1e67cb,_0x19c220){return db[_0x4ce1('0x44')]['find']({'where':{'id':_0x1e67cb[_0x4ce1('0x48')]['id']}})[_0x4ce1('0x25')](handleEntityNotFound(_0x19c220,null))[_0x4ce1('0x25')](removeEntity(_0x19c220,null))['catch'](handleError(_0x19c220,null));};exports[_0x4ce1('0x4c')]=function(_0x177da,_0x5efbbf){return db['ChatQueueReport'][_0x4ce1('0x4c')]()[_0x4ce1('0x25')](respondWithResult(_0x5efbbf,null))['catch'](handleError(_0x5efbbf,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d1e34db..e1902b7 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x4843cf,_0x480cb5){var _0x52ad78=function(_0xc6def3){while(--_0xc6def3){_0x4843cf['push'](_0x4843cf['shift']());}};_0x52ad78(++_0x480cb5);}(_0xe706,0xa3));var _0x6e70=function(_0xbb5075,_0x50d7f5){_0xbb5075=_0xbb5075-0x0;var _0x902d8=_0xe706[_0xbb5075];return _0x902d8;};'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 +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b23ca4a..5ecacaf 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 _0x9a48=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ChatQueueReport','create','body','options','raw','debug','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5291a8,_0x17f939){var _0x4bf3c6=function(_0x117c8a){while(--_0x117c8a){_0x5291a8['push'](_0x5291a8['shift']());}};_0x4bf3c6(++_0x17f939);}(_0x9a48,0xa4));var _0x89a4=function(_0x2e6e12,_0x238fc4){_0x2e6e12=_0x2e6e12-0x0;var _0x4bebf6=_0x9a48[_0x2e6e12];return _0x4bebf6;};'use strict';var _=require(_0x89a4('0x0'));var util=require(_0x89a4('0x1'));var moment=require('moment');var BPromise=require(_0x89a4('0x2'));var rs=require(_0x89a4('0x3'));var fs=require('fs');var Redis=require(_0x89a4('0x4'));var db=require(_0x89a4('0x5'))['db'];var utils=require(_0x89a4('0x6'));var logger=require(_0x89a4('0x7'))(_0x89a4('0x8'));var config=require(_0x89a4('0x9'));var jayson=require(_0x89a4('0xa'));var client=jayson[_0x89a4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5896aa,_0x5f07b2,_0x54b9c3){return new BPromise(function(_0x4776bd,_0x34cb63){return client[_0x89a4('0xc')](_0x5896aa,_0x54b9c3)[_0x89a4('0xd')](function(_0x10216b){logger['info'](_0x89a4('0xe'),_0x5f07b2,_0x89a4('0xf'));logger['debug'](_0x89a4('0x10'),_0x5f07b2,_0x89a4('0xf'),JSON[_0x89a4('0x11')](_0x10216b));if(_0x10216b[_0x89a4('0x12')]){if(_0x10216b[_0x89a4('0x12')][_0x89a4('0x13')]===0x1f4){logger[_0x89a4('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x5f07b2,_0x10216b['error'][_0x89a4('0x14')]);return _0x34cb63(_0x10216b[_0x89a4('0x12')]['message']);}logger['error'](_0x89a4('0xe'),_0x5f07b2,_0x10216b[_0x89a4('0x12')][_0x89a4('0x14')]);return _0x4776bd(_0x10216b[_0x89a4('0x12')]['message']);}else{logger[_0x89a4('0x15')](_0x89a4('0xe'),_0x5f07b2,_0x89a4('0xf'));_0x4776bd(_0x10216b['result'][_0x89a4('0x14')]);}})[_0x89a4('0x16')](function(_0x2ad944){logger[_0x89a4('0x12')](_0x89a4('0xe'),_0x5f07b2,_0x2ad944);_0x34cb63(_0x2ad944);});});}exports['CreateChatQueueReport']=function(_0x164379){var _0x2566a8=this;return new Promise(function(_0x5b4bd4,_0x1c30d0){return db[_0x89a4('0x17')][_0x89a4('0x18')](_0x164379[_0x89a4('0x19')],{'raw':_0x164379[_0x89a4('0x1a')]?_0x164379[_0x89a4('0x1a')][_0x89a4('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1d7974){logger[_0x89a4('0x15')]('CreateChatQueueReport',_0x164379);logger[_0x89a4('0x1c')](_0x89a4('0x1d'),_0x164379,JSON[_0x89a4('0x11')](_0x1d7974));_0x5b4bd4(_0x1d7974);})[_0x89a4('0x16')](function(_0x49fd43){logger['error'](_0x89a4('0x1d'),_0x49fd43[_0x89a4('0x14')],_0x164379);_0x1c30d0(_0x2566a8[_0x89a4('0x12')](0x1f4,_0x49fd43[_0x89a4('0x14')]));});});};exports[_0x89a4('0x1e')]=function(_0x450a41){var _0x1851bf=this;return new Promise(function(_0x10ab85,_0x4f6993){return db[_0x89a4('0x17')][_0x89a4('0x1f')](_0x450a41[_0x89a4('0x19')],{'raw':_0x450a41[_0x89a4('0x1a')]?_0x450a41['options'][_0x89a4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450a41['options']?_0x450a41[_0x89a4('0x1a')][_0x89a4('0x20')]||null:null,'attributes':_0x450a41[_0x89a4('0x1a')]?_0x450a41[_0x89a4('0x1a')]['attributes']||null:null,'limit':_0x450a41[_0x89a4('0x1a')]?_0x450a41[_0x89a4('0x1a')][_0x89a4('0x21')]||null:null})['then'](function(_0x24ffd1){logger['info'](_0x89a4('0x1e'),_0x450a41);logger[_0x89a4('0x1c')](_0x89a4('0x1e'),_0x450a41,JSON[_0x89a4('0x11')](_0x24ffd1));_0x10ab85(_0x24ffd1);})[_0x89a4('0x16')](function(_0x57adb7){logger[_0x89a4('0x12')](_0x89a4('0x1e'),_0x57adb7[_0x89a4('0x14')],_0x450a41);_0x4f6993(_0x1851bf[_0x89a4('0x12')](0x1f4,_0x57adb7[_0x89a4('0x14')]));});});}; \ No newline at end of file +var _0x21c1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','message','result','CreateChatQueueReport','ChatQueueReport','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','moment'];(function(_0x3b9bb7,_0x4e24df){var _0x4c0b9e=function(_0x3ab385){while(--_0x3ab385){_0x3b9bb7['push'](_0x3b9bb7['shift']());}};_0x4c0b9e(++_0x4e24df);}(_0x21c1,0xef));var _0x121c=function(_0x25365b,_0x336a39){_0x25365b=_0x25365b-0x0;var _0x260a93=_0x21c1[_0x25365b];return _0x260a93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x121c('0x0'));var BPromise=require(_0x121c('0x1'));var rs=require(_0x121c('0x2'));var fs=require('fs');var Redis=require(_0x121c('0x3'));var db=require(_0x121c('0x4'))['db'];var utils=require(_0x121c('0x5'));var logger=require('../../config/logger')(_0x121c('0x6'));var config=require(_0x121c('0x7'));var jayson=require(_0x121c('0x8'));var client=jayson[_0x121c('0x9')][_0x121c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0928,_0x2e957d,_0x492a00){return new BPromise(function(_0x2ad84a,_0x4752fa){return client[_0x121c('0xb')](_0x4d0928,_0x492a00)[_0x121c('0xc')](function(_0x16284c){logger[_0x121c('0xd')](_0x121c('0xe'),_0x2e957d,'request\x20sent');logger[_0x121c('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2e957d,_0x121c('0x10'),JSON['stringify'](_0x16284c));if(_0x16284c['error']){if(_0x16284c[_0x121c('0x11')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2e957d,_0x16284c[_0x121c('0x11')][_0x121c('0x12')]);return _0x4752fa(_0x16284c['error']['message']);}logger[_0x121c('0x11')](_0x121c('0xe'),_0x2e957d,_0x16284c[_0x121c('0x11')]['message']);return _0x2ad84a(_0x16284c[_0x121c('0x11')][_0x121c('0x12')]);}else{logger[_0x121c('0xd')](_0x121c('0xe'),_0x2e957d,_0x121c('0x10'));_0x2ad84a(_0x16284c[_0x121c('0x13')][_0x121c('0x12')]);}})['catch'](function(_0x2005e0){logger['error'](_0x121c('0xe'),_0x2e957d,_0x2005e0);_0x4752fa(_0x2005e0);});});}exports[_0x121c('0x14')]=function(_0x2d52b8){var _0x115b32=this;return new Promise(function(_0x138320,_0x1a63e0){return db[_0x121c('0x15')]['create'](_0x2d52b8[_0x121c('0x16')],{'raw':_0x2d52b8[_0x121c('0x17')]?_0x2d52b8['options'][_0x121c('0x18')]===undefined?!![]:![]:!![]})[_0x121c('0xc')](function(_0x41605b){logger[_0x121c('0xd')]('CreateChatQueueReport',_0x2d52b8);logger['debug'](_0x121c('0x14'),_0x2d52b8,JSON[_0x121c('0x19')](_0x41605b));_0x138320(_0x41605b);})[_0x121c('0x1a')](function(_0xa429bc){logger[_0x121c('0x11')](_0x121c('0x14'),_0xa429bc[_0x121c('0x12')],_0x2d52b8);_0x1a63e0(_0x115b32[_0x121c('0x11')](0x1f4,_0xa429bc[_0x121c('0x12')]));});});};exports[_0x121c('0x1b')]=function(_0x564f19){var _0x7506bb=this;return new Promise(function(_0x2fc2e5,_0x34c6d0){return db[_0x121c('0x15')][_0x121c('0x1c')](_0x564f19['body'],{'raw':_0x564f19[_0x121c('0x17')]?_0x564f19['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x564f19[_0x121c('0x17')]?_0x564f19[_0x121c('0x17')][_0x121c('0x1d')]||null:null,'attributes':_0x564f19[_0x121c('0x17')]?_0x564f19[_0x121c('0x17')]['attributes']||null:null,'limit':_0x564f19[_0x121c('0x17')]?_0x564f19[_0x121c('0x17')]['limit']||null:null})[_0x121c('0xc')](function(_0x225a4d){logger['info'](_0x121c('0x1b'),_0x564f19);logger[_0x121c('0xf')](_0x121c('0x1b'),_0x564f19,JSON[_0x121c('0x19')](_0x225a4d));_0x2fc2e5(_0x225a4d);})[_0x121c('0x1a')](function(_0x57895d){logger[_0x121c('0x11')]('UpdateChatQueueReport',_0x57895d['message'],_0x564f19);_0x34c6d0(_0x7506bb[_0x121c('0x11')](0x1f4,_0x57895d[_0x121c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index cf0d407..eff0ce1 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 _0xc93f=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','index','/describe','describe','/:id','post','update','destroy','multer'];(function(_0x332c3b,_0x37c5a6){var _0x1980d3=function(_0x25924e){while(--_0x25924e){_0x332c3b['push'](_0x332c3b['shift']());}};_0x1980d3(++_0x37c5a6);}(_0xc93f,0x17f));var _0xfc93=function(_0xe01799,_0x2dbf53){_0xe01799=_0xe01799-0x0;var _0x40a1cd=_0xc93f[_0xe01799];return _0x40a1cd;};'use strict';var multer=require(_0xfc93('0x0'));var util=require(_0xfc93('0x1'));var path=require(_0xfc93('0x2'));var timeout=require(_0xfc93('0x3'));var express=require(_0xfc93('0x4'));var router=express['Router']();var fs_extra=require(_0xfc93('0x5'));var auth=require(_0xfc93('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfc93('0x7'));router[_0xfc93('0x8')]('/',auth['isAuthenticated'](),controller[_0xfc93('0x9')]);router[_0xfc93('0x8')](_0xfc93('0xa'),auth['isAuthenticated'](),controller[_0xfc93('0xb')]);router[_0xfc93('0x8')](_0xfc93('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfc93('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfc93('0xe')]);router['delete'](_0xfc93('0xc'),auth['isAuthenticated'](),controller[_0xfc93('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa755=['./chatQueueReport.controller','index','get','/describe','isAuthenticated','/:id','post','create','put','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x13b360,_0x422276){var _0x5e1085=function(_0x25306e){while(--_0x25306e){_0x13b360['push'](_0x13b360['shift']());}};_0x5e1085(++_0x422276);}(_0xa755,0x139));var _0x5a75=function(_0x15310f,_0x9d88b7){_0x15310f=_0x15310f-0x0;var _0xe68043=_0xa755[_0x15310f];return _0xe68043;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a75('0x0'));var timeout=require(_0x5a75('0x1'));var express=require(_0x5a75('0x2'));var router=express[_0x5a75('0x3')]();var fs_extra=require(_0x5a75('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5a75('0x5'));var config=require(_0x5a75('0x6'));var controller=require(_0x5a75('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5a75('0x8')]);router[_0x5a75('0x9')](_0x5a75('0xa'),auth[_0x5a75('0xb')](),controller['describe']);router['get'](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller['show']);router[_0x5a75('0xd')]('/',auth[_0x5a75('0xb')](),controller[_0x5a75('0xe')]);router[_0x5a75('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 7462fa9..9735e83 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x119d13,_0x263cd2){var _0x333c35=function(_0x422c6e){while(--_0x422c6e){_0x119d13['push'](_0x119d13['shift']());}};_0x333c35(++_0x263cd2);}(_0x34e8,0x12c));var _0x834e=function(_0x187500,_0xf0478f){_0x187500=_0x187500-0x0;var _0x2173b6=_0x34e8[_0x187500];return _0x2173b6;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x54ef,0x112));var _0xf54e=function(_0x1f35bc,_0x2f6417){_0x1f35bc=_0x1f35bc-0x0;var _0x382a47=_0x54ef[_0x1f35bc];return _0x382a47;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1f04160..36bd1ee 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 _0xa573=['body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x1e3dd7,_0xff7c29){var _0x9b8d3f=function(_0x3271b9){while(--_0x3271b9){_0x1e3dd7['push'](_0x1e3dd7['shift']());}};_0x9b8d3f(++_0xff7c29);}(_0xa573,0x1a7));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3a57('0x0'));var rimraf=require(_0x3a57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a57('0x2'));var rp=require(_0x3a57('0x3'));var moment=require(_0x3a57('0x4'));var BPromise=require(_0x3a57('0x5'));var Mustache=require('mustache');var util=require(_0x3a57('0x6'));var path=require(_0x3a57('0x7'));var sox=require(_0x3a57('0x8'));var csv=require('to-csv');var ejs=require(_0x3a57('0x9'));var fs=require('fs');var fs_extra=require(_0x3a57('0xa'));var _=require(_0x3a57('0xb'));var squel=require(_0x3a57('0xc'));var crypto=require(_0x3a57('0xd'));var jsforce=require(_0x3a57('0xe'));var deskjs=require(_0x3a57('0xf'));var toCsv=require(_0x3a57('0x10'));var querystring=require(_0x3a57('0x11'));var Papa=require(_0x3a57('0x12'));var Redis=require(_0x3a57('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a57('0x14'));var as=require(_0x3a57('0x15'));var hardwareService=require(_0x3a57('0x16'));var logger=require(_0x3a57('0x17'))(_0x3a57('0x18'));var utils=require(_0x3a57('0x19'));var config=require(_0x3a57('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a57('0x1b'))['db'];function respondWithStatusCode(_0x1459ed,_0x559d3f){_0x559d3f=_0x559d3f||0xcc;return function(_0x124ac8){if(_0x124ac8){return _0x1459ed['sendStatus'](_0x559d3f);}return _0x1459ed[_0x3a57('0x1c')](_0x559d3f)[_0x3a57('0x1d')]();};}function respondWithResult(_0x51549b,_0xa9470a){_0xa9470a=_0xa9470a||0xc8;return function(_0x53b71f){if(_0x53b71f){return _0x51549b[_0x3a57('0x1c')](_0xa9470a)[_0x3a57('0x1e')](_0x53b71f);}};}function respondWithFilteredResult(_0x28c759,_0x38cca8){return function(_0x4e6f14){if(_0x4e6f14){var _0x58ed52=typeof _0x38cca8['offset']===_0x3a57('0x1f')&&typeof _0x38cca8['limit']===_0x3a57('0x1f');var _0xfe8691=_0x4e6f14[_0x3a57('0x20')];var _0x9de628=_0x58ed52?0x0:_0x38cca8[_0x3a57('0x21')];var _0x1c8898=_0x58ed52?_0x4e6f14[_0x3a57('0x20')]:_0x38cca8[_0x3a57('0x21')]+_0x38cca8[_0x3a57('0x22')];var _0x1bd0f8;if(_0x1c8898>=_0xfe8691){_0x1c8898=_0xfe8691;_0x1bd0f8=0xc8;}else{_0x1bd0f8=0xce;}_0x28c759[_0x3a57('0x1c')](_0x1bd0f8);return _0x28c759[_0x3a57('0x23')](_0x3a57('0x24'),_0x9de628+'-'+_0x1c8898+'/'+_0xfe8691)[_0x3a57('0x1e')](_0x4e6f14);}return null;};}function patchUpdates(_0x176bae){return function(_0x5a7f22){try{jsonpatch[_0x3a57('0x25')](_0x5a7f22,_0x176bae,!![]);}catch(_0x5b74ff){return BPromise[_0x3a57('0x26')](_0x5b74ff);}return _0x5a7f22[_0x3a57('0x27')]();};}function saveUpdates(_0x51e548,_0x364eeb){return function(_0x55ede7){if(_0x55ede7){return _0x55ede7[_0x3a57('0x28')](_0x51e548)[_0x3a57('0x29')](function(_0x434271){return _0x434271;});}return null;};}function removeEntity(_0x44ca25,_0x163e33){return function(_0x13871d){if(_0x13871d){return _0x13871d['destroy']()[_0x3a57('0x29')](function(){_0x44ca25['status'](0xcc)[_0x3a57('0x1d')]();});}};}function handleEntityNotFound(_0x3a435e,_0x26b9e8){return function(_0x18cba4){if(!_0x18cba4){_0x3a435e[_0x3a57('0x2a')](0x194);}return _0x18cba4;};}function handleError(_0x42e154,_0x256cbe){_0x256cbe=_0x256cbe||0x1f4;return function(_0x5861cb){logger[_0x3a57('0x2b')](_0x5861cb[_0x3a57('0x2c')]);if(_0x5861cb[_0x3a57('0x2d')]){delete _0x5861cb[_0x3a57('0x2d')];}_0x42e154[_0x3a57('0x1c')](_0x256cbe)[_0x3a57('0x2e')](_0x5861cb);};}exports[_0x3a57('0x2f')]=function(_0x31f436,_0x400c7f){var _0x18e7aa={},_0x4fdf57={},_0x25048a={'count':0x0,'rows':[]};var _0x40e3d9=_[_0x3a57('0x30')](db[_0x3a57('0x31')][_0x3a57('0x32')],function(_0x416ce1){return{'name':_0x416ce1[_0x3a57('0x33')],'type':_0x416ce1[_0x3a57('0x34')][_0x3a57('0x35')]};});_0x4fdf57[_0x3a57('0x36')]=_[_0x3a57('0x30')](_0x40e3d9,_0x3a57('0x2d'));_0x4fdf57['query']=_[_0x3a57('0x37')](_0x31f436[_0x3a57('0x38')]);_0x4fdf57[_0x3a57('0x39')]=_[_0x3a57('0x3a')](_0x4fdf57[_0x3a57('0x36')],_0x4fdf57[_0x3a57('0x38')]);_0x18e7aa[_0x3a57('0x3b')]=_[_0x3a57('0x3a')](_0x4fdf57[_0x3a57('0x36')],qs[_0x3a57('0x3c')](_0x31f436[_0x3a57('0x38')][_0x3a57('0x3c')]));_0x18e7aa['attributes']=_0x18e7aa[_0x3a57('0x3b')][_0x3a57('0x3d')]?_0x18e7aa['attributes']:_0x4fdf57[_0x3a57('0x36')];if(!_0x31f436['query'][_0x3a57('0x3e')](_0x3a57('0x3f'))){_0x18e7aa[_0x3a57('0x22')]=qs[_0x3a57('0x22')](_0x31f436[_0x3a57('0x38')][_0x3a57('0x22')]);_0x18e7aa[_0x3a57('0x21')]=qs['offset'](_0x31f436[_0x3a57('0x38')]['offset']);}_0x18e7aa[_0x3a57('0x40')]=qs[_0x3a57('0x41')](_0x31f436[_0x3a57('0x38')][_0x3a57('0x41')]);_0x18e7aa['where']=qs[_0x3a57('0x39')](_[_0x3a57('0x42')](_0x31f436['query'],_0x4fdf57[_0x3a57('0x39')]),_0x40e3d9);if(_0x31f436[_0x3a57('0x38')]['filter']){_0x18e7aa['where']=_[_0x3a57('0x43')](_0x18e7aa['where'],{'$or':_[_0x3a57('0x30')](_0x40e3d9,function(_0x113111){if(_0x113111[_0x3a57('0x34')]!==_0x3a57('0x44')){var _0x4c8edf={};_0x4c8edf[_0x113111[_0x3a57('0x2d')]]={'$like':'%'+_0x31f436['query'][_0x3a57('0x45')]+'%'};return _0x4c8edf;}})});}_0x18e7aa=_[_0x3a57('0x43')]({},_0x18e7aa,_0x31f436[_0x3a57('0x46')]);var _0x56a92c={'where':_0x18e7aa[_0x3a57('0x47')]};return db[_0x3a57('0x31')]['count'](_0x56a92c)[_0x3a57('0x29')](function(_0x306535){_0x25048a['count']=_0x306535;if(_0x31f436[_0x3a57('0x38')][_0x3a57('0x48')]){_0x18e7aa[_0x3a57('0x49')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x3a57('0x4a')](_0x18e7aa);})[_0x3a57('0x29')](function(_0x4815f8){_0x25048a[_0x3a57('0x4b')]=_0x4815f8;return _0x25048a;})[_0x3a57('0x29')](respondWithFilteredResult(_0x400c7f,_0x18e7aa))[_0x3a57('0x4c')](handleError(_0x400c7f,null));};exports[_0x3a57('0x4d')]=function(_0x4dce27,_0x385b2b){var _0x1e3366={'raw':!![],'where':{'id':_0x4dce27[_0x3a57('0x4e')]['id']}},_0x44a5a0={};_0x44a5a0[_0x3a57('0x36')]=_[_0x3a57('0x37')](db[_0x3a57('0x31')][_0x3a57('0x32')]);_0x44a5a0['query']=_[_0x3a57('0x37')](_0x4dce27['query']);_0x44a5a0[_0x3a57('0x39')]=_[_0x3a57('0x3a')](_0x44a5a0[_0x3a57('0x36')],_0x44a5a0[_0x3a57('0x38')]);_0x1e3366[_0x3a57('0x3b')]=_[_0x3a57('0x3a')](_0x44a5a0[_0x3a57('0x36')],qs[_0x3a57('0x3c')](_0x4dce27[_0x3a57('0x38')]['fields']));_0x1e3366[_0x3a57('0x3b')]=_0x1e3366[_0x3a57('0x3b')][_0x3a57('0x3d')]?_0x1e3366[_0x3a57('0x3b')]:_0x44a5a0['model'];if(_0x4dce27[_0x3a57('0x38')][_0x3a57('0x48')]){_0x1e3366[_0x3a57('0x49')]=[{'all':!![]}];}_0x1e3366=_[_0x3a57('0x43')]({},_0x1e3366,_0x4dce27[_0x3a57('0x46')]);return db[_0x3a57('0x31')][_0x3a57('0x4f')](_0x1e3366)[_0x3a57('0x29')](handleEntityNotFound(_0x385b2b,null))[_0x3a57('0x29')](respondWithResult(_0x385b2b,null))[_0x3a57('0x4c')](handleError(_0x385b2b,null));};exports[_0x3a57('0x50')]=function(_0x1d39e1,_0x17ef2b){return db[_0x3a57('0x31')][_0x3a57('0x50')](_0x1d39e1[_0x3a57('0x51')],{})[_0x3a57('0x29')](respondWithResult(_0x17ef2b,0xc9))[_0x3a57('0x4c')](handleError(_0x17ef2b,null));};exports['update']=function(_0x2874f3,_0x1c1991){if(_0x2874f3[_0x3a57('0x51')]['id']){delete _0x2874f3[_0x3a57('0x51')]['id'];}return db[_0x3a57('0x31')][_0x3a57('0x4f')]({'where':{'id':_0x2874f3[_0x3a57('0x4e')]['id']}})[_0x3a57('0x29')](handleEntityNotFound(_0x1c1991,null))['then'](saveUpdates(_0x2874f3[_0x3a57('0x51')],null))[_0x3a57('0x29')](respondWithResult(_0x1c1991,null))[_0x3a57('0x4c')](handleError(_0x1c1991,null));};exports[_0x3a57('0x52')]=function(_0x2f29d6,_0x56e90c){return db[_0x3a57('0x31')][_0x3a57('0x4f')]({'where':{'id':_0x2f29d6['params']['id']}})[_0x3a57('0x29')](handleEntityNotFound(_0x56e90c,null))[_0x3a57('0x29')](removeEntity(_0x56e90c,null))[_0x3a57('0x4c')](handleError(_0x56e90c,null));};exports[_0x3a57('0x53')]=function(_0xc0a7c,_0x20258d){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x20258d,null))[_0x3a57('0x4c')](handleError(_0x20258d,null));}; \ No newline at end of file +var _0x520a=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatTransferReport','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x7ca8b3,_0x5acc9d){var _0x14d0f5=function(_0x1143dd){while(--_0x1143dd){_0x7ca8b3['push'](_0x7ca8b3['shift']());}};_0x14d0f5(++_0x5acc9d);}(_0x520a,0xe4));var _0xa520=function(_0x183f82,_0x3920b5){_0x183f82=_0x183f82-0x0;var _0x1d09db=_0x520a[_0x183f82];return _0x1d09db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa520('0x0'));var zipdir=require(_0xa520('0x1'));var jsonpatch=require(_0xa520('0x2'));var rp=require(_0xa520('0x3'));var moment=require(_0xa520('0x4'));var BPromise=require(_0xa520('0x5'));var Mustache=require('mustache');var util=require(_0xa520('0x6'));var path=require('path');var sox=require(_0xa520('0x7'));var csv=require('to-csv');var ejs=require(_0xa520('0x8'));var fs=require('fs');var fs_extra=require(_0xa520('0x9'));var _=require(_0xa520('0xa'));var squel=require(_0xa520('0xb'));var crypto=require(_0xa520('0xc'));var jsforce=require(_0xa520('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa520('0xe'));var querystring=require('querystring');var Papa=require(_0xa520('0xf'));var Redis=require(_0xa520('0x10'));var authService=require(_0xa520('0x11'));var qs=require(_0xa520('0x12'));var as=require(_0xa520('0x13'));var hardwareService=require(_0xa520('0x14'));var logger=require(_0xa520('0x15'))(_0xa520('0x16'));var utils=require(_0xa520('0x17'));var config=require(_0xa520('0x18'));var licenseUtil=require(_0xa520('0x19'));var db=require(_0xa520('0x1a'))['db'];function respondWithStatusCode(_0x4fd59e,_0x3170ea){_0x3170ea=_0x3170ea||0xcc;return function(_0x451dc6){if(_0x451dc6){return _0x4fd59e[_0xa520('0x1b')](_0x3170ea);}return _0x4fd59e[_0xa520('0x1c')](_0x3170ea)['end']();};}function respondWithResult(_0x12861a,_0x51174b){_0x51174b=_0x51174b||0xc8;return function(_0x571283){if(_0x571283){return _0x12861a[_0xa520('0x1c')](_0x51174b)[_0xa520('0x1d')](_0x571283);}};}function respondWithFilteredResult(_0x3c4f71,_0xb6aa59){return function(_0x1fa170){if(_0x1fa170){var _0x5551b4=typeof _0xb6aa59['offset']===_0xa520('0x1e')&&typeof _0xb6aa59[_0xa520('0x1f')]==='undefined';var _0x564057=_0x1fa170[_0xa520('0x20')];var _0x2ee5bb=_0x5551b4?0x0:_0xb6aa59[_0xa520('0x21')];var _0x4cc29e=_0x5551b4?_0x1fa170['count']:_0xb6aa59['offset']+_0xb6aa59[_0xa520('0x1f')];var _0x11f819;if(_0x4cc29e>=_0x564057){_0x4cc29e=_0x564057;_0x11f819=0xc8;}else{_0x11f819=0xce;}_0x3c4f71[_0xa520('0x1c')](_0x11f819);return _0x3c4f71[_0xa520('0x22')]('Content-Range',_0x2ee5bb+'-'+_0x4cc29e+'/'+_0x564057)['json'](_0x1fa170);}return null;};}function patchUpdates(_0x3b7753){return function(_0x30926c){try{jsonpatch[_0xa520('0x23')](_0x30926c,_0x3b7753,!![]);}catch(_0x2631c0){return BPromise[_0xa520('0x24')](_0x2631c0);}return _0x30926c[_0xa520('0x25')]();};}function saveUpdates(_0xcd060f,_0x1800d3){return function(_0x2b2d71){if(_0x2b2d71){return _0x2b2d71[_0xa520('0x26')](_0xcd060f)[_0xa520('0x27')](function(_0x25b03d){return _0x25b03d;});}return null;};}function removeEntity(_0x146b1d,_0x22f1e2){return function(_0x53de5b){if(_0x53de5b){return _0x53de5b[_0xa520('0x28')]()[_0xa520('0x27')](function(){_0x146b1d[_0xa520('0x1c')](0xcc)[_0xa520('0x29')]();});}};}function handleEntityNotFound(_0x257a9c,_0x4ff71f){return function(_0x1a02de){if(!_0x1a02de){_0x257a9c[_0xa520('0x1b')](0x194);}return _0x1a02de;};}function handleError(_0x4a3f78,_0x145c54){_0x145c54=_0x145c54||0x1f4;return function(_0x21059b){logger['error'](_0x21059b[_0xa520('0x2a')]);if(_0x21059b[_0xa520('0x2b')]){delete _0x21059b[_0xa520('0x2b')];}_0x4a3f78['status'](_0x145c54)[_0xa520('0x2c')](_0x21059b);};}exports[_0xa520('0x2d')]=function(_0x7cc457,_0x55f1dc){var _0x2395df={},_0x105ff5={},_0xb2d71a={'count':0x0,'rows':[]};var _0x2ca4e5=_[_0xa520('0x2e')](db[_0xa520('0x2f')]['rawAttributes'],function(_0xeb437a){return{'name':_0xeb437a['fieldName'],'type':_0xeb437a[_0xa520('0x30')][_0xa520('0x31')]};});_0x105ff5[_0xa520('0x32')]=_[_0xa520('0x2e')](_0x2ca4e5,_0xa520('0x2b'));_0x105ff5['query']=_[_0xa520('0x33')](_0x7cc457['query']);_0x105ff5[_0xa520('0x34')]=_[_0xa520('0x35')](_0x105ff5['model'],_0x105ff5[_0xa520('0x36')]);_0x2395df['attributes']=_[_0xa520('0x35')](_0x105ff5[_0xa520('0x32')],qs[_0xa520('0x37')](_0x7cc457[_0xa520('0x36')][_0xa520('0x37')]));_0x2395df[_0xa520('0x38')]=_0x2395df['attributes'][_0xa520('0x39')]?_0x2395df[_0xa520('0x38')]:_0x105ff5[_0xa520('0x32')];if(!_0x7cc457[_0xa520('0x36')][_0xa520('0x3a')](_0xa520('0x3b'))){_0x2395df[_0xa520('0x1f')]=qs['limit'](_0x7cc457['query'][_0xa520('0x1f')]);_0x2395df[_0xa520('0x21')]=qs[_0xa520('0x21')](_0x7cc457[_0xa520('0x36')][_0xa520('0x21')]);}_0x2395df[_0xa520('0x3c')]=qs[_0xa520('0x3d')](_0x7cc457[_0xa520('0x36')]['sort']);_0x2395df[_0xa520('0x3e')]=qs[_0xa520('0x34')](_[_0xa520('0x3f')](_0x7cc457[_0xa520('0x36')],_0x105ff5[_0xa520('0x34')]),_0x2ca4e5);if(_0x7cc457[_0xa520('0x36')][_0xa520('0x40')]){_0x2395df[_0xa520('0x3e')]=_[_0xa520('0x41')](_0x2395df[_0xa520('0x3e')],{'$or':_['map'](_0x2ca4e5,function(_0x140095){if(_0x140095[_0xa520('0x30')]!=='VIRTUAL'){var _0x630e63={};_0x630e63[_0x140095[_0xa520('0x2b')]]={'$like':'%'+_0x7cc457['query']['filter']+'%'};return _0x630e63;}})});}_0x2395df=_[_0xa520('0x41')]({},_0x2395df,_0x7cc457[_0xa520('0x42')]);var _0x4409a5={'where':_0x2395df[_0xa520('0x3e')]};return db[_0xa520('0x2f')][_0xa520('0x20')](_0x4409a5)[_0xa520('0x27')](function(_0x574b9b){_0xb2d71a[_0xa520('0x20')]=_0x574b9b;if(_0x7cc457['query'][_0xa520('0x43')]){_0x2395df[_0xa520('0x44')]=[{'all':!![]}];}return db[_0xa520('0x2f')][_0xa520('0x45')](_0x2395df);})['then'](function(_0x20c258){_0xb2d71a[_0xa520('0x46')]=_0x20c258;return _0xb2d71a;})[_0xa520('0x27')](respondWithFilteredResult(_0x55f1dc,_0x2395df))[_0xa520('0x47')](handleError(_0x55f1dc,null));};exports[_0xa520('0x48')]=function(_0x3640b2,_0x1742ab){var _0x2c4b99={'raw':!![],'where':{'id':_0x3640b2[_0xa520('0x49')]['id']}},_0x3c374c={};_0x3c374c[_0xa520('0x32')]=_[_0xa520('0x33')](db[_0xa520('0x2f')]['rawAttributes']);_0x3c374c[_0xa520('0x36')]=_[_0xa520('0x33')](_0x3640b2[_0xa520('0x36')]);_0x3c374c['filters']=_[_0xa520('0x35')](_0x3c374c[_0xa520('0x32')],_0x3c374c[_0xa520('0x36')]);_0x2c4b99[_0xa520('0x38')]=_[_0xa520('0x35')](_0x3c374c[_0xa520('0x32')],qs[_0xa520('0x37')](_0x3640b2[_0xa520('0x36')][_0xa520('0x37')]));_0x2c4b99[_0xa520('0x38')]=_0x2c4b99['attributes'][_0xa520('0x39')]?_0x2c4b99[_0xa520('0x38')]:_0x3c374c[_0xa520('0x32')];if(_0x3640b2[_0xa520('0x36')][_0xa520('0x43')]){_0x2c4b99[_0xa520('0x44')]=[{'all':!![]}];}_0x2c4b99=_['merge']({},_0x2c4b99,_0x3640b2[_0xa520('0x42')]);return db['ChatTransferReport'][_0xa520('0x4a')](_0x2c4b99)[_0xa520('0x27')](handleEntityNotFound(_0x1742ab,null))['then'](respondWithResult(_0x1742ab,null))[_0xa520('0x47')](handleError(_0x1742ab,null));};exports[_0xa520('0x4b')]=function(_0x32cf56,_0x38c290){return db[_0xa520('0x2f')]['create'](_0x32cf56[_0xa520('0x4c')],{})['then'](respondWithResult(_0x38c290,0xc9))[_0xa520('0x47')](handleError(_0x38c290,null));};exports['update']=function(_0x30fdb0,_0x150e0a){if(_0x30fdb0[_0xa520('0x4c')]['id']){delete _0x30fdb0[_0xa520('0x4c')]['id'];}return db[_0xa520('0x2f')]['find']({'where':{'id':_0x30fdb0[_0xa520('0x49')]['id']}})[_0xa520('0x27')](handleEntityNotFound(_0x150e0a,null))[_0xa520('0x27')](saveUpdates(_0x30fdb0[_0xa520('0x4c')],null))[_0xa520('0x27')](respondWithResult(_0x150e0a,null))[_0xa520('0x47')](handleError(_0x150e0a,null));};exports[_0xa520('0x28')]=function(_0x4c4202,_0x8558b3){return db[_0xa520('0x2f')][_0xa520('0x4a')]({'where':{'id':_0x4c4202['params']['id']}})[_0xa520('0x27')](handleEntityNotFound(_0x8558b3,null))[_0xa520('0x27')](removeEntity(_0x8558b3,null))[_0xa520('0x47')](handleError(_0x8558b3,null));};exports[_0xa520('0x4d')]=function(_0x563b0a,_0x138802){return db[_0xa520('0x2f')][_0xa520('0x4d')]()[_0xa520('0x27')](respondWithResult(_0x138802,null))[_0xa520('0x47')](handleError(_0x138802,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 0ada00e..fcc29bd 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 _0x33c8=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x33c8,0x157));var _0x833c=function(_0xeac7f6,_0x2cfdac){_0xeac7f6=_0xeac7f6-0x0;var _0xf7993f=_0x33c8[_0xeac7f6];return _0xf7993f;};'use strict';var _=require(_0x833c('0x0'));var util=require(_0x833c('0x1'));var logger=require(_0x833c('0x2'))(_0x833c('0x3'));var moment=require(_0x833c('0x4'));var BPromise=require('bluebird');var rp=require(_0x833c('0x5'));var fs=require('fs');var path=require(_0x833c('0x6'));var rimraf=require(_0x833c('0x7'));var config=require(_0x833c('0x8'));var attributes=require(_0x833c('0x9'));module[_0x833c('0xa')]=function(_0x3c863f,_0x975972){return _0x3c863f[_0x833c('0xb')](_0x833c('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x833c('0xd'),'fields':[_0x833c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab2b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x16f414,_0xf03e38){var _0x3e0131=function(_0x5a7040){while(--_0x5a7040){_0x16f414['push'](_0x16f414['shift']());}};_0x3e0131(++_0xf03e38);}(_0xab2b,0xdf));var _0xbab2=function(_0x44a78c,_0x4aaa6){_0x44a78c=_0x44a78c-0x0;var _0x160bf3=_0xab2b[_0x44a78c];return _0x160bf3;};'use strict';var _=require('lodash');var util=require(_0xbab2('0x0'));var logger=require(_0xbab2('0x1'))(_0xbab2('0x2'));var moment=require(_0xbab2('0x3'));var BPromise=require(_0xbab2('0x4'));var rp=require(_0xbab2('0x5'));var fs=require('fs');var path=require(_0xbab2('0x6'));var rimraf=require(_0xbab2('0x7'));var config=require(_0xbab2('0x8'));var attributes=require(_0xbab2('0x9'));module[_0xbab2('0xa')]=function(_0x396fa0,_0x510c31){return _0x396fa0[_0xbab2('0xb')](_0xbab2('0xc'),attributes,{'tableName':_0xbab2('0xd'),'paranoid':![],'indexes':[{'name':_0xbab2('0xe'),'fields':[_0xbab2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a9f9ab3..f8f91dc 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 _0x5ed3=['client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1f7d53,_0x25407c){var _0x18f549=function(_0x99b1c7){while(--_0x99b1c7){_0x1f7d53['push'](_0x1f7d53['shift']());}};_0x18f549(++_0x25407c);}(_0x5ed3,0x9f));var _0x35ed=function(_0x5d31b4,_0x2d786c){_0x5d31b4=_0x5d31b4-0x0;var _0x1b6096=_0x5ed3[_0x5d31b4];return _0x1b6096;};'use strict';var _=require(_0x35ed('0x0'));var util=require(_0x35ed('0x1'));var moment=require('moment');var BPromise=require(_0x35ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35ed('0x3'))['db'];var utils=require(_0x35ed('0x4'));var logger=require(_0x35ed('0x5'))(_0x35ed('0x6'));var config=require(_0x35ed('0x7'));var jayson=require(_0x35ed('0x8'));var client=jayson[_0x35ed('0x9')][_0x35ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5141f8,_0x16ef50,_0x30444c){return new BPromise(function(_0x29a17f,_0x5e49d4){return client['request'](_0x5141f8,_0x30444c)[_0x35ed('0xb')](function(_0x1636e6){logger[_0x35ed('0xc')](_0x35ed('0xd'),_0x16ef50,_0x35ed('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x16ef50,_0x35ed('0xe'),JSON[_0x35ed('0xf')](_0x1636e6));if(_0x1636e6[_0x35ed('0x10')]){if(_0x1636e6[_0x35ed('0x10')][_0x35ed('0x11')]===0x1f4){logger[_0x35ed('0x10')](_0x35ed('0xd'),_0x16ef50,_0x1636e6['error'][_0x35ed('0x12')]);return _0x5e49d4(_0x1636e6[_0x35ed('0x10')]['message']);}logger[_0x35ed('0x10')](_0x35ed('0xd'),_0x16ef50,_0x1636e6[_0x35ed('0x10')][_0x35ed('0x12')]);return _0x29a17f(_0x1636e6['error'][_0x35ed('0x12')]);}else{logger['info'](_0x35ed('0xd'),_0x16ef50,_0x35ed('0xe'));_0x29a17f(_0x1636e6[_0x35ed('0x13')][_0x35ed('0x12')]);}})[_0x35ed('0x14')](function(_0x47e4c9){logger[_0x35ed('0x10')](_0x35ed('0xd'),_0x16ef50,_0x47e4c9);_0x5e49d4(_0x47e4c9);});});} \ No newline at end of file +var _0x6022=['then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6022,0x1c1));var _0x2602=function(_0x29a428,_0x4fc21e){_0x29a428=_0x29a428-0x0;var _0x30ffcc=_0x6022[_0x29a428];return _0x30ffcc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2602('0x0'));var BPromise=require(_0x2602('0x1'));var rs=require(_0x2602('0x2'));var fs=require('fs');var Redis=require(_0x2602('0x3'));var db=require(_0x2602('0x4'))['db'];var utils=require(_0x2602('0x5'));var logger=require(_0x2602('0x6'))(_0x2602('0x7'));var config=require(_0x2602('0x8'));var jayson=require(_0x2602('0x9'));var client=jayson[_0x2602('0xa')][_0x2602('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x431c25,_0x184ae5,_0x425dd8){return new BPromise(function(_0x5099b6,_0x32586b){return client[_0x2602('0xc')](_0x431c25,_0x425dd8)[_0x2602('0xd')](function(_0xd57967){logger['info'](_0x2602('0xe'),_0x184ae5,_0x2602('0xf'));logger[_0x2602('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x184ae5,'request\x20sent',JSON['stringify'](_0xd57967));if(_0xd57967[_0x2602('0x11')]){if(_0xd57967[_0x2602('0x11')][_0x2602('0x12')]===0x1f4){logger[_0x2602('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x184ae5,_0xd57967[_0x2602('0x11')][_0x2602('0x13')]);return _0x32586b(_0xd57967[_0x2602('0x11')]['message']);}logger['error'](_0x2602('0xe'),_0x184ae5,_0xd57967['error'][_0x2602('0x13')]);return _0x5099b6(_0xd57967[_0x2602('0x11')]['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x184ae5,_0x2602('0xf'));_0x5099b6(_0xd57967[_0x2602('0x14')][_0x2602('0x13')]);}})[_0x2602('0x15')](function(_0x16c260){logger[_0x2602('0x11')](_0x2602('0xe'),_0x184ae5,_0x16c260);_0x32586b(_0x16c260);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d20955a..ec93be1 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 _0xee60=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2542d1,_0xdb7645){var _0xec2ce7=function(_0x27c486){while(--_0x27c486){_0x2542d1['push'](_0x2542d1['shift']());}};_0xec2ce7(++_0xdb7645);}(_0xee60,0x188));var _0x0ee6=function(_0x27b41a,_0x3b332b){_0x27b41a=_0x27b41a-0x0;var _0x816952=_0xee60[_0x27b41a];return _0x816952;};'use strict';var multer=require(_0x0ee6('0x0'));var util=require(_0x0ee6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ee6('0x2'));var router=express[_0x0ee6('0x3')]();var fs_extra=require(_0x0ee6('0x4'));var auth=require(_0x0ee6('0x5'));var interaction=require(_0x0ee6('0x6'));var config=require('../../config/environment');var controller=require(_0x0ee6('0x7'));router[_0x0ee6('0x8')]('/',auth[_0x0ee6('0x9')](),controller[_0x0ee6('0xa')]);router['get'](_0x0ee6('0xb'),auth[_0x0ee6('0x9')](),controller[_0x0ee6('0xc')]);router['get']('/:id',auth[_0x0ee6('0x9')](),controller[_0x0ee6('0xd')]);router[_0x0ee6('0xe')]('/',auth[_0x0ee6('0x9')](),controller['create']);router['put'](_0x0ee6('0xf'),auth[_0x0ee6('0x9')](),controller['update']);router[_0x0ee6('0x10')](_0x0ee6('0xf'),auth[_0x0ee6('0x9')](),controller[_0x0ee6('0x11')]);module[_0x0ee6('0x12')]=router; \ No newline at end of file +var _0x3923=['get','index','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xf0a2d4,_0x49323f){var _0x1251ae=function(_0x280976){while(--_0x280976){_0xf0a2d4['push'](_0xf0a2d4['shift']());}};_0x1251ae(++_0x49323f);}(_0x3923,0x102));var _0x3392=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3923[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x3392('0x0'));var util=require(_0x3392('0x1'));var path=require(_0x3392('0x2'));var timeout=require(_0x3392('0x3'));var express=require(_0x3392('0x4'));var router=express[_0x3392('0x5')]();var fs_extra=require(_0x3392('0x6'));var auth=require(_0x3392('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x3392('0x8')]('/',auth['isAuthenticated'](),controller[_0x3392('0x9')]);router[_0x3392('0x8')]('/describe',auth[_0x3392('0xa')](),controller[_0x3392('0xb')]);router[_0x3392('0x8')](_0x3392('0xc'),auth['isAuthenticated'](),controller[_0x3392('0xd')]);router[_0x3392('0xe')]('/',auth[_0x3392('0xa')](),controller[_0x3392('0xf')]);router[_0x3392('0x10')](_0x3392('0xc'),auth[_0x3392('0xa')](),controller[_0x3392('0x11')]);router['delete']('/:id',auth[_0x3392('0xa')](),controller[_0x3392('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index d10c5de..05d3e5b 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 _0xc3aa=['bottom_right','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xc3aa,0x1c8));var _0xac3a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc3aa[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xac3a('0x0'));var rs=require(_0xac3a('0x1'));module[_0xac3a('0x2')]={'name':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'unique':_0xac3a('0x4')},'description':{'type':Sequelize[_0xac3a('0x3')]},'mapKey':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x6')},'customerAlias':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac3a('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':_0xac3a('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':_0xac3a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xac3a('0x3')]},'animation':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xac3a('0xb')]('rounded',_0xac3a('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0xd')},'start_chat_button':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0xe')},'offline_chat_button':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0xf')},'header_offline':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x10')},'download_transcript':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xac3a('0x12')]},'closingQuestion':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x14')},'noteTitle':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x15')},'placeholderMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x16')},'closingMessageButton':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0xf')},'skipMessageButton':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x18')},'ratingType':{'type':Sequelize[_0xac3a('0xb')](_0xac3a('0x19'),_0xac3a('0x1a')),'defaultValue':_0xac3a('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xac3a('0x12')],'defaultValue':function(){return JSON[_0xac3a('0x1b')]({'items':[{'type':_0xac3a('0x1c'),'variable':null,'config':{'placeholder':_0xac3a('0x1d'),'type':_0xac3a('0x1e'),'required':!![]},'props':{'title':_0xac3a('0x1d'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xac3a('0x5'),'type':_0xac3a('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xac3a('0x1f')](_0xac3a('0x20'))?JSON[_0xac3a('0x21')](this['getDataValue'](_0xac3a('0x20'))):{};},'set':function(_0x3dd0f2){return this[_0xac3a('0x22')]('onlineForm',JSON[_0xac3a('0x1b')](_0x3dd0f2));}},'offlineForm':{'type':Sequelize[_0xac3a('0x12')],'defaultValue':function(){return JSON[_0xac3a('0x1b')]({'items':[{'type':'input','props':{'title':_0xac3a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xac3a('0x5'),'type':_0xac3a('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xac3a('0x23')},'props':{'title':_0xac3a('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xac3a('0x1f')](_0xac3a('0x24'))?JSON[_0xac3a('0x21')](this[_0xac3a('0x1f')](_0xac3a('0x24'))):{};},'set':function(_0x4f0b67){return this[_0xac3a('0x22')](_0xac3a('0x24'),JSON['stringify'](_0x4f0b67));}},'token':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':function(){return rs[_0xac3a('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xac3a('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x26')},'waitingMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x28')},'offlineMessageBody':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x29')},'skipUnmanaged':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xac3a('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xac3a('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xac3a('0x2a');}},'notificationSound':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xac3a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x2c')},'verticalAlignment':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x2d')},'defaultTitle':{'type':Sequelize[_0xac3a('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xac3a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xac3a('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xac3a('0x9')],'comment':_0xac3a('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xac3a('0x2f'),'set':function(_0x539b29){if(!_0x539b29)this[_0xac3a('0x22')](_0xac3a('0x30'),null);this[_0xac3a('0x22')]('mandatoryDisposition',_0x539b29);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xac3a('0x3')]},'vidaooTopic':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':function(){return _0xac3a('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xac3a('0x12')]}}; \ No newline at end of file +var _0x81b2=['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','address','email','Agent','#011F6A','BOOLEAN','squared','rounded','Chat','Send','Contact\x20us','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','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'];(function(_0x179be4,_0x1b1873){var _0x3fde8b=function(_0x187669){while(--_0x187669){_0x179be4['push'](_0x179be4['shift']());}};_0x3fde8b(++_0x1b1873);}(_0x81b2,0x1ad));var _0x281b=function(_0x31ce3d,_0x581047){_0x31ce3d=_0x31ce3d-0x0;var _0x203d95=_0x81b2[_0x31ce3d];return _0x203d95;};'use strict';var Sequelize=require(_0x281b('0x0'));var rs=require(_0x281b('0x1'));module[_0x281b('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'unique':_0x281b('0x4')},'description':{'type':Sequelize[_0x281b('0x3')]},'mapKey':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x5')},'mapKeyOffline':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x281b('0x9')),'defaultValue':_0x281b('0xa')},'header_online':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xb')},'offline_chat_button':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xc')},'header_offline':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x281b('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x12')},'noteTitle':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x13')},'placeholderMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x14')},'closingMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x15')},'closingMessageButton':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xc')},'skipMessageButton':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x17')},'ratingType':{'type':Sequelize[_0x281b('0x18')](_0x281b('0x19'),_0x281b('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x281b('0xf')],'defaultValue':function(){return JSON[_0x281b('0x1b')]({'items':[{'type':_0x281b('0x1c'),'variable':null,'config':{'placeholder':_0x281b('0x1d'),'type':'text','required':!![]},'props':{'title':_0x281b('0x1d'),'helpText':''}},{'type':_0x281b('0x1c'),'props':{'title':_0x281b('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x281b('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x281b('0x1e')](_0x281b('0x1f'))?JSON[_0x281b('0x20')](this[_0x281b('0x1e')](_0x281b('0x1f'))):{};},'set':function(_0x2f2922){return this[_0x281b('0x21')](_0x281b('0x1f'),JSON['stringify'](_0x2f2922));}},'offlineForm':{'type':Sequelize[_0x281b('0xf')],'defaultValue':function(){return JSON[_0x281b('0x1b')]({'items':[{'type':_0x281b('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x281b('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x281b('0x22')},'props':{'title':_0x281b('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x281b('0x1e')]('offlineForm')?JSON[_0x281b('0x20')](this[_0x281b('0x1e')](_0x281b('0x23'))):{};},'set':function(_0x1b13a){return this[_0x281b('0x21')](_0x281b('0x23'),JSON['stringify'](_0x1b13a));}},'token':{'type':Sequelize[_0x281b('0x3')],'defaultValue':function(){return rs[_0x281b('0x24')]();}},'autoclose':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x25')},'waitingMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x16')},'sendUnmanaged':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x281b('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x281b('0x3')]},'notificationTemplate':{'type':Sequelize[_0x281b('0xf')],'defaultValue':function(){return _0x281b('0x29');}},'notificationSound':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x281b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x2b')},'verticalAlignment':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x2c')},'defaultTitle':{'type':Sequelize[_0x281b('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x281b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x281b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x2e')},'systemAvatar':{'type':Sequelize[_0x281b('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x281b('0xe')],'comment':_0x281b('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![],'comment':_0x281b('0x30'),'set':function(_0x99f00d){if(!_0x99f00d)this[_0x281b('0x21')](_0x281b('0x31'),null);this['setDataValue'](_0x281b('0x32'),_0x99f00d);}},'vidaooEscalation':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x33')},'vidaooNote':{'type':Sequelize[_0x281b('0x3')],'defaultValue':function(){return _0x281b('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x281b('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x281b('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 50a8f48..09af1b9 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 _0xfcf5=['showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','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','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','threadId','externalUrl','ChatInteraction','ContactId','spread','firstName','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','originalname','mimetype','attachments','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','server','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','format','interval','iftime\x20%s','indexOf','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','../../config/license/util','virtual','License','Intervals','push','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','render','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','json','getApplications','addProactiveActions','chatProactiveAction','online','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','then','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','length','order','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png'];(function(_0x1316b7,_0x1ac684){var _0x30a11c=function(_0x2a9697){while(--_0x2a9697){_0x1316b7['push'](_0x1316b7['shift']());}};_0x30a11c(++_0x1ac684);}(_0xfcf5,0x1d3));var _0x5fcf=function(_0x347da9,_0x19b221){_0x347da9=_0x347da9-0x0;var _0x20b0ef=_0xfcf5[_0x347da9];return _0x20b0ef;};'use strict';var BPromise=require(_0x5fcf('0x0'));var Mustache=require('mustache');var util=require(_0x5fcf('0x1'));var path=require('path');var ejs=require(_0x5fcf('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x5fcf('0x3'));var Redis=require(_0x5fcf('0x4'));var qs=require(_0x5fcf('0x5'));var logger=require(_0x5fcf('0x6'))(_0x5fcf('0x7'));var config=require(_0x5fcf('0x8'));var db=require(_0x5fcf('0x9'))['db'];config[_0x5fcf('0xa')]=_[_0x5fcf('0xb')](config[_0x5fcf('0xa')],{'host':_0x5fcf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fcf('0xa')]));require('./chatWebsite.socket')[_0x5fcf('0xd')](socket);var jayson=require(_0x5fcf('0xe'));var client=jayson[_0x5fcf('0xf')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5fcf('0x10')]({'port':0x232a});var client9003=jayson[_0x5fcf('0xf')][_0x5fcf('0x10')]({'port':0x232b});var client9001=jayson[_0x5fcf('0xf')][_0x5fcf('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x3ba27a,_0x487178,_0x2eb81a,_0x1ce4a9){return new BPromise(function(_0x3da251,_0x30d6a7){var _0x32d433=_0x1ce4a9||client;return _0x32d433[_0x5fcf('0x11')](_0x3ba27a,_0x2eb81a)['then'](function(_0x1dce91){logger[_0x5fcf('0x12')](_0x5fcf('0x13'),_0x487178,_0x5fcf('0x14'));logger[_0x5fcf('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x487178,_0x5fcf('0x14'),JSON[_0x5fcf('0x16')](_0x1dce91));if(_0x1dce91[_0x5fcf('0x17')]){if(_0x1dce91[_0x5fcf('0x17')]['code']===0x1f4){logger[_0x5fcf('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x487178,_0x1dce91['error'][_0x5fcf('0x18')]);return _0x30d6a7(_0x1dce91[_0x5fcf('0x17')][_0x5fcf('0x18')]);}logger[_0x5fcf('0x17')](_0x5fcf('0x13'),_0x487178,_0x1dce91[_0x5fcf('0x17')][_0x5fcf('0x18')]);return _0x3da251(_0x1dce91[_0x5fcf('0x17')][_0x5fcf('0x18')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x487178,_0x5fcf('0x14'));_0x3da251(_0x1dce91[_0x5fcf('0x19')]['message']);}})[_0x5fcf('0x1a')](function(_0x3a5c3e){logger[_0x5fcf('0x17')](_0x5fcf('0x13'),_0x487178,_0x3a5c3e);_0x30d6a7(_0x3a5c3e);});});}function respondWithStatusCode(_0x3e30f7,_0x110b49){_0x110b49=_0x110b49||0xcc;return function(_0x4f0768){if(_0x4f0768){return _0x3e30f7[_0x5fcf('0x1b')](_0x110b49);}return _0x3e30f7[_0x5fcf('0x1c')](_0x110b49)[_0x5fcf('0x1d')]();};}function respondWithResult(_0xcf88a0,_0x5e5890){_0x5e5890=_0x5e5890||0xc8;return function(_0x3f6f25){if(_0x3f6f25){return _0xcf88a0[_0x5fcf('0x1c')](_0x5e5890)['json'](_0x3f6f25);}};}function respondWithFilteredResult(_0x3b1458,_0x4c084d){return function(_0x140b28){if(_0x140b28){var _0x4d1d7d=typeof _0x4c084d[_0x5fcf('0x1e')]==='undefined'&&typeof _0x4c084d[_0x5fcf('0x1f')]===_0x5fcf('0x20');var _0x6b7ff3=_0x140b28[_0x5fcf('0x21')];var _0x455232=_0x4d1d7d?0x0:_0x4c084d['offset'];var _0x83fd96=_0x4d1d7d?_0x140b28[_0x5fcf('0x21')]:_0x4c084d[_0x5fcf('0x1e')]+_0x4c084d['limit'];var _0x21bff9;if(_0x83fd96>=_0x6b7ff3){_0x83fd96=_0x6b7ff3;_0x21bff9=0xc8;}else{_0x21bff9=0xce;}_0x3b1458[_0x5fcf('0x1c')](_0x21bff9);return _0x3b1458[_0x5fcf('0x22')](_0x5fcf('0x23'),_0x455232+'-'+_0x83fd96+'/'+_0x6b7ff3)['json'](_0x140b28);}return null;};}function saveUpdates(_0xd62eed){return function(_0x11e9f8){if(_0x11e9f8){return _0x11e9f8['update'](_0xd62eed)[_0x5fcf('0x24')](function(_0x60a908){return _0x60a908;});}return null;};}function removeEntity(_0x2d20e5){return function(_0x23268c){if(_0x23268c){return _0x23268c[_0x5fcf('0x25')]()[_0x5fcf('0x24')](function(){var _0x16d2c7=_0x23268c[_0x5fcf('0x26')]({'plain':!![]});var _0x43a4b1='ChatWebsites';return db[_0x5fcf('0x27')]['destroy']({'where':{'type':_0x43a4b1,'resourceId':_0x16d2c7['id']}})[_0x5fcf('0x24')](function(){return _0x23268c;});})[_0x5fcf('0x24')](function(){_0x2d20e5[_0x5fcf('0x1c')](0xcc)[_0x5fcf('0x1d')]();});}};}function handleEntityNotFound(_0x3f98e1){return function(_0x35b97b){if(!_0x35b97b){_0x3f98e1[_0x5fcf('0x1b')](0x194);}return _0x35b97b;};}function handleError(_0x95ff08,_0x9ebd62){_0x9ebd62=_0x9ebd62||0x1f4;return function(_0x4d8206){logger['error'](_0x4d8206[_0x5fcf('0x28')]);if(_0x4d8206[_0x5fcf('0x29')]){delete _0x4d8206[_0x5fcf('0x29')];}_0x95ff08[_0x5fcf('0x1c')](_0x9ebd62)['send'](_0x4d8206);};}exports[_0x5fcf('0x2a')]=function(_0x275a3d,_0x4189c3){var _0x119284={'include':[{'model':db[_0x5fcf('0x2b')],'as':_0x5fcf('0x2c')}]},_0xc7a42c={},_0x5b963c={'count':0x0,'rows':[]};var _0x1a9da6=_[_0x5fcf('0x2d')](db[_0x5fcf('0x2e')][_0x5fcf('0x2f')],function(_0x4f8660){return{'name':_0x4f8660['fieldName'],'type':_0x4f8660[_0x5fcf('0x30')][_0x5fcf('0x31')]};});_0xc7a42c['model']=_[_0x5fcf('0x2d')](_0x1a9da6,'name');_0xc7a42c[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x275a3d[_0x5fcf('0x32')]);_0xc7a42c[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0xc7a42c['model'],_0xc7a42c['query']);_0x119284['attributes']=_[_0x5fcf('0x35')](_0xc7a42c[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x119284[_0x5fcf('0x38')]=_0x119284[_0x5fcf('0x38')]['length']?_0x119284['attributes']:_0xc7a42c['model'];if(!_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x39')](_0x5fcf('0x3a'))){_0x119284[_0x5fcf('0x1f')]=qs['limit'](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x119284[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x119284['order']=qs[_0x5fcf('0x3b')](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x119284['where']=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x275a3d[_0x5fcf('0x32')],_0xc7a42c[_0x5fcf('0x34')]),_0x1a9da6);if(_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x119284[_0x5fcf('0x3e')]=_['merge'](_0x119284[_0x5fcf('0x3e')],{'$or':_[_0x5fcf('0x2d')](_0x1a9da6,function(_0x1b9681){if(_0x1b9681[_0x5fcf('0x30')]!==_0x5fcf('0x3f')){var _0x2ba4c5={};_0x2ba4c5[_0x1b9681['name']]={'$like':'%'+_0x275a3d[_0x5fcf('0x32')]['filter']+'%'};return _0x2ba4c5;}})});}_0x119284=_[_0x5fcf('0x40')]({},_0x119284,_0x275a3d[_0x5fcf('0x41')]);var _0x6d5c3d={'where':_0x119284[_0x5fcf('0x3e')]};return db[_0x5fcf('0x2e')][_0x5fcf('0x21')](_0x6d5c3d)[_0x5fcf('0x24')](function(_0x304118){_0x5b963c[_0x5fcf('0x21')]=_0x304118;if(_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x42')]){_0x119284[_0x5fcf('0x43')]=[{'all':!![]}];}return db[_0x5fcf('0x2e')][_0x5fcf('0x44')](_0x119284);})['then'](function(_0x5c69bc){_0x5b963c['rows']=_0x5c69bc;return _0x5b963c;})[_0x5fcf('0x24')](respondWithFilteredResult(_0x4189c3,_0x119284))[_0x5fcf('0x1a')](handleError(_0x4189c3,null));};exports[_0x5fcf('0x45')]=function(_0x5a34f6,_0x49e832){var _0x4f0ce7={'raw':![],'where':{'id':_0x5a34f6[_0x5fcf('0x46')]['id']},'include':[{'model':db[_0x5fcf('0x2b')],'as':_0x5fcf('0x2c')}]},_0x31f548={};_0x31f548['model']=_[_0x5fcf('0x33')](db[_0x5fcf('0x2e')][_0x5fcf('0x2f')]);_0x31f548[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x5a34f6[_0x5fcf('0x32')]);_0x31f548[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0x31f548[_0x5fcf('0x36')],_0x31f548[_0x5fcf('0x32')]);_0x4f0ce7['attributes']=_[_0x5fcf('0x35')](_0x31f548['model'],qs[_0x5fcf('0x37')](_0x5a34f6['query'][_0x5fcf('0x37')]));_0x4f0ce7[_0x5fcf('0x38')]=_0x4f0ce7[_0x5fcf('0x38')]['length']?_0x4f0ce7[_0x5fcf('0x38')]:_0x31f548[_0x5fcf('0x36')];if(_0x5a34f6[_0x5fcf('0x32')][_0x5fcf('0x42')]){_0x4f0ce7[_0x5fcf('0x43')]=[{'all':!![]}];}_0x4f0ce7=_[_0x5fcf('0x40')]({},_0x4f0ce7,_0x5a34f6['options']);return db[_0x5fcf('0x2e')][_0x5fcf('0x47')](_0x4f0ce7)[_0x5fcf('0x24')](handleEntityNotFound(_0x49e832,null))[_0x5fcf('0x24')](respondWithResult(_0x49e832,null))['catch'](handleError(_0x49e832,null));};exports[_0x5fcf('0x48')]=function(_0x42ef21,_0xdab191){return db['ChatWebsite'][_0x5fcf('0x48')](_0x42ef21[_0x5fcf('0x49')],{})[_0x5fcf('0x24')](function(_0x3a7306){var _0x3be60f=_0x42ef21[_0x5fcf('0x4a')][_0x5fcf('0x26')]({'plain':!![]});if(!_0x3be60f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3be60f[_0x5fcf('0x4b')]===_0x5fcf('0x4a')){var _0x1622c9=_0x3a7306['get']({'plain':!![]});var _0x58acdf='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x58acdf,'userProfileId':_0x3be60f[_0x5fcf('0x4c')]},'raw':!![]})[_0x5fcf('0x24')](function(_0x4a0e7a){if(_0x4a0e7a&&_0x4a0e7a[_0x5fcf('0x4d')]===0x0){return db[_0x5fcf('0x27')]['create']({'name':_0x1622c9[_0x5fcf('0x29')],'resourceId':_0x1622c9['id'],'type':_0x4a0e7a[_0x5fcf('0x29')],'sectionId':_0x4a0e7a['id']},{})[_0x5fcf('0x24')](function(){return _0x3a7306;});}else{return _0x3a7306;}})[_0x5fcf('0x1a')](function(_0x58c37b){logger['error'](_0x5fcf('0x4e'),_0x58c37b);throw _0x58c37b;});}return _0x3a7306;})[_0x5fcf('0x24')](respondWithResult(_0xdab191,0xc9))[_0x5fcf('0x1a')](handleError(_0xdab191,null));};exports[_0x5fcf('0x4f')]=function(_0x317828,_0x2c083d){if(_0x317828[_0x5fcf('0x49')]['id']){delete _0x317828[_0x5fcf('0x49')]['id'];}return db[_0x5fcf('0x2e')]['find']({'where':{'id':_0x317828[_0x5fcf('0x46')]['id']},'include':[{'model':db[_0x5fcf('0x2b')],'as':_0x5fcf('0x2c')}]})[_0x5fcf('0x24')](handleEntityNotFound(_0x2c083d,null))['then'](saveUpdates(_0x317828[_0x5fcf('0x49')],null))['then'](respondWithResult(_0x2c083d,null))[_0x5fcf('0x1a')](handleError(_0x2c083d,null));};exports[_0x5fcf('0x25')]=function(_0x2add3d,_0x597829){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x2add3d[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x597829,null))[_0x5fcf('0x24')](removeEntity(_0x597829,null))[_0x5fcf('0x1a')](handleError(_0x597829,null));};exports[_0x5fcf('0x50')]=function(_0x541d53,_0x3c2e22){return db['ChatWebsite']['describe']()[_0x5fcf('0x24')](respondWithResult(_0x3c2e22,null))[_0x5fcf('0x1a')](handleError(_0x3c2e22,null));};exports['addDisposition']=function(_0x48d97e,_0x162e43){if(_0x48d97e[_0x5fcf('0x49')]['id']){delete _0x48d97e[_0x5fcf('0x49')]['id'];}return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x48d97e[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x162e43,null))[_0x5fcf('0x24')](function(_0x9c6d42){if(_0x9c6d42){_0x48d97e['body']['ChatWebsiteId']=_0x9c6d42['id'];return db[_0x5fcf('0x51')][_0x5fcf('0x48')](_0x48d97e[_0x5fcf('0x49')]);}})[_0x5fcf('0x24')](respondWithResult(_0x162e43,null))['catch'](handleError(_0x162e43,null));};exports[_0x5fcf('0x52')]=function(_0xd4895a,_0x1d8e59){var _0x3d3e54={'raw':![],'where':{}};var _0x5c2fdb={};var _0xc3c87a={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0xd4895a[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x1d8e59,null))[_0x5fcf('0x24')](function(_0x55953b){if(_0x55953b){_0x5c2fdb[_0x5fcf('0x36')]=_['keys'](db[_0x5fcf('0x51')]['rawAttributes']);_0x5c2fdb['query']=_[_0x5fcf('0x33')](_0xd4895a[_0x5fcf('0x32')]);_0x5c2fdb['filters']=_[_0x5fcf('0x35')](_0x5c2fdb[_0x5fcf('0x36')],_0x5c2fdb['query']);_0x3d3e54[_0x5fcf('0x38')]=_['intersection'](_0x5c2fdb[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0xd4895a['query'][_0x5fcf('0x37')]));_0x3d3e54['attributes']=_0x3d3e54['attributes'][_0x5fcf('0x54')]?_0x3d3e54[_0x5fcf('0x38')]:_0x5c2fdb['model'];if(!_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x39')]('nolimit')){_0x3d3e54[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x3d3e54[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x3d3e54[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x3d3e54[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0xd4895a['query'],_0x5c2fdb[_0x5fcf('0x34')]));_0x3d3e54[_0x5fcf('0x3e')][_0x5fcf('0x56')]=_0x55953b['id'];if(_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x3d3e54[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x3d3e54[_0x5fcf('0x3e')],{'$or':_['map'](_0x3d3e54['attributes'],function(_0x408e6f){var _0x5c7b44={};_0x5c7b44[_0x408e6f]={'$like':'%'+_0xd4895a[_0x5fcf('0x32')]['filter']+'%'};return _0x5c7b44;})});}_0x3d3e54=_[_0x5fcf('0x40')]({},_0x3d3e54,_0xd4895a[_0x5fcf('0x41')]);return db['Disposition'][_0x5fcf('0x21')]({'where':_0x3d3e54[_0x5fcf('0x3e')]})[_0x5fcf('0x24')](function(_0xb003f2){_0xc3c87a[_0x5fcf('0x21')]=_0xb003f2;if(_0xd4895a['query'][_0x5fcf('0x42')]){_0x3d3e54[_0x5fcf('0x43')]=[{'all':!![]}];}return db[_0x5fcf('0x51')][_0x5fcf('0x44')](_0x3d3e54);})[_0x5fcf('0x24')](function(_0x198819){_0xc3c87a['rows']=_0x198819;return _0xc3c87a;});}})[_0x5fcf('0x24')](respondWithFilteredResult(_0x1d8e59,_0x3d3e54))['catch'](handleError(_0x1d8e59,null));};exports[_0x5fcf('0x57')]=function(_0x10ae56,_0x398d0e){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x10ae56[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x398d0e,null))['then'](function(_0x372272){if(_0x372272){return _0x372272[_0x5fcf('0x57')](_0x10ae56[_0x5fcf('0x32')][_0x5fcf('0x58')]);}})[_0x5fcf('0x24')](respondWithStatusCode(_0x398d0e,null))[_0x5fcf('0x1a')](handleError(_0x398d0e,null));};exports[_0x5fcf('0x59')]=function(_0x579f4f,_0x114513){if(_0x579f4f[_0x5fcf('0x49')]['id']){delete _0x579f4f[_0x5fcf('0x49')]['id'];}return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x579f4f[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x114513,null))['then'](function(_0x304b28){if(_0x304b28){_0x579f4f[_0x5fcf('0x49')][_0x5fcf('0x56')]=_0x304b28['id'];return db[_0x5fcf('0x5a')][_0x5fcf('0x48')](_0x579f4f[_0x5fcf('0x49')]);}})[_0x5fcf('0x24')](respondWithResult(_0x114513,null))[_0x5fcf('0x1a')](handleError(_0x114513,null));};exports['getAnswers']=function(_0x19548c,_0xef60d9){var _0x42ea5e={'raw':![],'where':{}};var _0xe6af5a={};var _0x6e00fe={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')]['findOne']({'where':{'id':_0x19548c[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0xef60d9,null))[_0x5fcf('0x24')](function(_0x431daf){if(_0x431daf){_0xe6af5a[_0x5fcf('0x36')]=_[_0x5fcf('0x33')](db[_0x5fcf('0x5a')][_0x5fcf('0x2f')]);_0xe6af5a[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x19548c[_0x5fcf('0x32')]);_0xe6af5a[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0xe6af5a['model'],_0xe6af5a['query']);_0x42ea5e[_0x5fcf('0x38')]=_[_0x5fcf('0x35')](_0xe6af5a[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x42ea5e[_0x5fcf('0x38')]=_0x42ea5e[_0x5fcf('0x38')][_0x5fcf('0x54')]?_0x42ea5e[_0x5fcf('0x38')]:_0xe6af5a[_0x5fcf('0x36')];if(!_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x39')]('nolimit')){_0x42ea5e[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x19548c[_0x5fcf('0x32')]['limit']);_0x42ea5e['offset']=qs['offset'](_0x19548c['query'][_0x5fcf('0x1e')]);}_0x42ea5e[_0x5fcf('0x55')]=qs['sort'](_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x42ea5e['where']=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x19548c[_0x5fcf('0x32')],_0xe6af5a[_0x5fcf('0x34')]));_0x42ea5e[_0x5fcf('0x3e')][_0x5fcf('0x56')]=_0x431daf['id'];if(_0x19548c['query'][_0x5fcf('0x3d')]){_0x42ea5e[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x42ea5e[_0x5fcf('0x3e')],{'$or':_[_0x5fcf('0x2d')](_0x42ea5e[_0x5fcf('0x38')],function(_0x43c719){var _0x3c2451={};_0x3c2451[_0x43c719]={'$like':'%'+_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x3c2451;})});}_0x42ea5e=_[_0x5fcf('0x40')]({},_0x42ea5e,_0x19548c[_0x5fcf('0x41')]);return db[_0x5fcf('0x5a')]['count']({'where':_0x42ea5e[_0x5fcf('0x3e')]})[_0x5fcf('0x24')](function(_0x10d973){_0x6e00fe[_0x5fcf('0x21')]=_0x10d973;if(_0x19548c['query']['includeAll']){_0x42ea5e[_0x5fcf('0x43')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x42ea5e);})[_0x5fcf('0x24')](function(_0x3aca37){_0x6e00fe[_0x5fcf('0x5b')]=_0x3aca37;return _0x6e00fe;});}})['then'](respondWithFilteredResult(_0xef60d9,_0x42ea5e))[_0x5fcf('0x1a')](handleError(_0xef60d9,null));};exports[_0x5fcf('0x5c')]=function(_0x42d1ee,_0xed2078){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x42d1ee['params']['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0xed2078,null))[_0x5fcf('0x24')](function(_0x207e1e){if(_0x207e1e){return _0x207e1e['removeAnswers'](_0x42d1ee[_0x5fcf('0x32')][_0x5fcf('0x58')]);}})[_0x5fcf('0x24')](respondWithStatusCode(_0xed2078,null))[_0x5fcf('0x1a')](handleError(_0xed2078,null));};exports[_0x5fcf('0x5d')]=function(_0x33df2c,_0x54226c){_0x33df2c[_0x5fcf('0x49')][_0x5fcf('0x5e')]=_0x33df2c[_0x5fcf('0x5f')][_0x5fcf('0x60')];return db['ChatWebsite'][_0x5fcf('0x47')]({'where':{'id':_0x33df2c[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x54226c,null))[_0x5fcf('0x24')](saveUpdates(_0x33df2c[_0x5fcf('0x49')],null))[_0x5fcf('0x24')](respondWithResult(_0x54226c,null))['catch'](handleError(_0x54226c,null));};exports['addAvatar']=function(_0x251b2e,_0x56bacb){_0x251b2e[_0x5fcf('0x49')][_0x5fcf('0x61')]=_0x251b2e[_0x5fcf('0x5f')][_0x5fcf('0x60')];return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x251b2e[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x56bacb,null))[_0x5fcf('0x24')](saveUpdates(_0x251b2e[_0x5fcf('0x49')],null))['then'](respondWithResult(_0x56bacb,null))[_0x5fcf('0x1a')](handleError(_0x56bacb,null));};exports[_0x5fcf('0x62')]=function(_0x253fca,_0x3950e2){_0x253fca[_0x5fcf('0x49')][_0x5fcf('0x63')]=_0x253fca[_0x5fcf('0x5f')][_0x5fcf('0x60')];return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x253fca['params']['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x3950e2,null))[_0x5fcf('0x24')](saveUpdates(_0x253fca['body'],null))[_0x5fcf('0x24')](respondWithResult(_0x3950e2,null))['catch'](handleError(_0x3950e2,null));};exports[_0x5fcf('0x64')]=function(_0x32526c,_0x269838){_0x32526c[_0x5fcf('0x49')][_0x5fcf('0x65')]=_0x32526c[_0x5fcf('0x5f')]['filename'];return db['ChatWebsite'][_0x5fcf('0x47')]({'where':{'id':_0x32526c[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x269838,null))[_0x5fcf('0x24')](saveUpdates(_0x32526c[_0x5fcf('0x49')],null))[_0x5fcf('0x24')](respondWithResult(_0x269838,null))[_0x5fcf('0x1a')](handleError(_0x269838,null));};exports[_0x5fcf('0x66')]=function(_0x2faf81,_0x52aa25){var _0x45d21f=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x69'));var _0x4bbb23={'where':{'id':_0x2faf81[_0x5fcf('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2a15cb=![];return require('../../config/license/util')[_0x5fcf('0x6a')]()[_0x5fcf('0x24')](function(_0x12c0cc){if(_0x12c0cc){_0x2a15cb=_0x12c0cc[_0x5fcf('0x6b')];}})[_0x5fcf('0x24')](function(){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')](_0x4bbb23);})[_0x5fcf('0x24')](handleEntityNotFound(_0x52aa25,null))[_0x5fcf('0x24')](function(_0x21786c){if(_0x21786c){if(!_[_0x5fcf('0x6c')](_0x21786c['sitepic'])){if(fs[_0x5fcf('0x6d')](path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x6e'),_0x21786c[_0x5fcf('0x5e')]))&&_0x2a15cb){_0x45d21f=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x6e'),_0x21786c[_0x5fcf('0x5e')]);}}return _0x52aa25[_0x5fcf('0x6f')](_0x45d21f);}})[_0x5fcf('0x1a')](handleError(_0x52aa25,null));};exports[_0x5fcf('0x70')]=function(_0x454f48,_0x19f638){var _0x157a52=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x71'));var _0x2d7da1={'where':{'id':_0x454f48[_0x5fcf('0x46')]['id']},'attributes':['id',_0x5fcf('0x61')],'raw':!![]};return db[_0x5fcf('0x2e')][_0x5fcf('0x47')](_0x2d7da1)[_0x5fcf('0x24')](handleEntityNotFound(_0x19f638,null))[_0x5fcf('0x24')](function(_0xcb36fb){if(_0xcb36fb){if(!_[_0x5fcf('0x6c')](_0xcb36fb[_0x5fcf('0x61')])){if(fs['existsSync'](path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0xcb36fb['agentAvatar']))){_0x157a52=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0xcb36fb['agentAvatar']);}}return _0x19f638['download'](_0x157a52);}})[_0x5fcf('0x1a')](handleError(_0x19f638,null));};exports[_0x5fcf('0x73')]=function(_0x4311be,_0x1b436b){var _0x555045=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x74'));var _0x4a7dad={'where':{'id':_0x4311be[_0x5fcf('0x46')]['id']},'attributes':['id',_0x5fcf('0x63'),_0x5fcf('0x75')],'raw':!![]};return db['ChatWebsite'][_0x5fcf('0x47')](_0x4a7dad)[_0x5fcf('0x24')](handleEntityNotFound(_0x1b436b,null))[_0x5fcf('0x24')](function(_0x2b255a){if(_0x2b255a){if(!_['isNil'](_0x2b255a[_0x5fcf('0x63')])){if(fs[_0x5fcf('0x6d')](path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x2b255a[_0x5fcf('0x63')]))&&_0x2b255a['showCustomerAvatar']){_0x555045=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x2b255a[_0x5fcf('0x63')]);}}return _0x1b436b[_0x5fcf('0x6f')](_0x555045);}})['catch'](handleError(_0x1b436b,null));};exports[_0x5fcf('0x76')]=function(_0x1ffddc,_0x3b6117){var _0x211a5f=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x77'));var _0x148fbe={'where':{'id':_0x1ffddc['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x5fcf('0x47')](_0x148fbe)[_0x5fcf('0x24')](handleEntityNotFound(_0x3b6117,null))[_0x5fcf('0x24')](function(_0x201e5a){if(_0x201e5a){if(!_['isNil'](_0x201e5a['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x201e5a['systemAvatar']))){_0x211a5f=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x201e5a[_0x5fcf('0x65')]);}}return _0x3b6117[_0x5fcf('0x6f')](_0x211a5f);}})['catch'](handleError(_0x3b6117,null));};exports[_0x5fcf('0x78')]=function(_0x2766b8,_0x30aad0){var _0x52357c=require('user-agent-parser');var _0x3c1cc4=new _0x52357c();var _0x261c3f=_0x3c1cc4[_0x5fcf('0x79')](_0x2766b8['headers'][_0x5fcf('0x7a')])[_0x5fcf('0x7b')]();var _0x4ece82={'body':_0x2766b8[_0x5fcf('0x49')],'channel':_0x5fcf('0x7c')};var _0x43b1fa=[];var _0x1b12dc=[];var _0x2f7c56={};var _0x11bb18=![];return db[_0x5fcf('0x7d')][_0x5fcf('0x50')]()[_0x5fcf('0x24')](function(_0x4fc379){if(!_0x4fc379){throw new db['Sequelize'][(_0x5fcf('0x7e'))](_0x5fcf('0x7f'));}_0x43b1fa=_[_0x5fcf('0x80')](_['keys'](_0x4fc379),['createdAt',_0x5fcf('0x81')]);_0x1b12dc=_[_0x5fcf('0x80')](_[_0x5fcf('0x33')](_0x4fc379),[_0x5fcf('0x82'),_0x5fcf('0x81'),_0x5fcf('0x83'),_0x5fcf('0x84')]);if(_0x2766b8[_0x5fcf('0x49')]['id']){delete _0x2766b8[_0x5fcf('0x49')]['id'];}if(_['isNil'](_0x2766b8['body'][_0x5fcf('0x85')])){throw new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0x87'));}if(_[_0x5fcf('0x6c')](_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x49')])||_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x49')]===''){throw new db[(_0x5fcf('0x86'))]['ValidationError'](_0x5fcf('0x88'));}if(_[_0x5fcf('0x6c')](_0x2766b8[_0x5fcf('0x49')]['mapKey'])){throw new db['Sequelize'][(_0x5fcf('0x7e'))](_0x5fcf('0x89')+_0x1b12dc);}if(!_[_0x5fcf('0x8a')](_0x1b12dc,_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x8b')])){throw new db['Sequelize'][(_0x5fcf('0x7e'))](_0x5fcf('0x8c')+_0x1b12dc);}_0x2f7c56[_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x8b')]]=_0x2766b8['body'][_0x5fcf('0x85')];})['then'](function(){return db['ChatWebsite'][_0x5fcf('0x47')]({'where':{'id':_0x2766b8[_0x5fcf('0x46')]['id']},'include':[{'model':db[_0x5fcf('0x8d')],'as':_0x5fcf('0x8e'),'include':[{'model':db[_0x5fcf('0x7d')],'as':_0x5fcf('0x8f'),'where':_0x2f7c56,'limit':0x1,'order':[[_0x5fcf('0x81'),_0x5fcf('0x90')]]}]},{'model':db[_0x5fcf('0x91')],'as':_0x5fcf('0x92')}]});})[_0x5fcf('0x24')](handleEntityNotFound(_0x30aad0,null))[_0x5fcf('0x24')](function(_0x5b92d4){if(_0x5b92d4&&_0x5b92d4[_0x5fcf('0x8e')]){_0x4ece82[_0x5fcf('0x93')]=_0x5b92d4;_0x4ece82['applications']=_0x5b92d4[_0x5fcf('0x92')];_0x4ece82[_0x5fcf('0x94')]=_0x5b92d4['List'];_0x4ece82[_0x5fcf('0x95')]=_[_0x5fcf('0x96')](_0x4ece82['applications'],[_0x5fcf('0x97')],[_0x5fcf('0x98')]);if(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x92')]){delete _0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x92')];}if(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x8e')]&&_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x8e')][_0x5fcf('0x8f')]['length']){return _0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x8e')][_0x5fcf('0x8f')][0x0];}var _0x1c22b7=_[_0x5fcf('0xb')](_0x2766b8[_0x5fcf('0x49')],{'firstName':_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x85')],'ListId':_0x5b92d4[_0x5fcf('0x84')]});_0x1c22b7[_0x2766b8['body'][_0x5fcf('0x8b')]]=_0x2766b8[_0x5fcf('0x49')]['from'];return db[_0x5fcf('0x7d')]['create'](_0x1c22b7,{'fields':_0x43b1fa,'raw':!![]});}})[_0x5fcf('0x24')](handleEntityNotFound(_0x30aad0,null))['then'](function(_0x29d1e9){_0x4ece82['contact']=_0x29d1e9;var _0x4d98c0=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x99')];if(_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0x9b')]){_0x4d98c0=_0x2766b8[_0x5fcf('0x9a')]['cf-connecting-ip'];}else if(_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0x9c')]){_0x4d98c0=_[_0x5fcf('0x9d')](_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0x9c')][_0x5fcf('0x9e')](','));}if(_0x29d1e9){var _0x1ecffc={'ContactId':_0x29d1e9['id'],'ChatWebsiteId':_0x2766b8[_0x5fcf('0x46')]['id'],'from':(_0x29d1e9['firstName']||'')+'\x20'+(_0x29d1e9[_0x5fcf('0x9f')]||''),'customerIp':_0x4d98c0,'customerPort':_0x2766b8['headers'][_0x5fcf('0xa0')]?_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0xa0')]:null,'referer':_0x2766b8[_0x5fcf('0x49')]['referer'],'browserName':_0x261c3f[_0x5fcf('0xa1')][_0x5fcf('0x29')]&&_0x261c3f[_0x5fcf('0xa1')][_0x5fcf('0xa2')]?util['format'](_0x5fcf('0xa3'),_0x261c3f[_0x5fcf('0xa1')][_0x5fcf('0x29')],_0x261c3f[_0x5fcf('0xa1')]['version']):_0x5fcf('0xa4'),'browserVersion':_0x261c3f[_0x5fcf('0xa1')]['version']||_0x5fcf('0xa4'),'osName':util['format'](_0x5fcf('0xa3'),_0x261c3f['os'][_0x5fcf('0x29')],_0x261c3f['os'][_0x5fcf('0xa2')]),'osVersion':_0x261c3f['os'][_0x5fcf('0xa2')],'deviceModel':_0x261c3f['device'][_0x5fcf('0x36')]&&_0x261c3f['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x261c3f[_0x5fcf('0xa5')][_0x5fcf('0x36')],_0x261c3f['device']['vendor'],_0x261c3f[_0x5fcf('0xa5')][_0x5fcf('0x30')]):null,'deviceVendor':_0x261c3f[_0x5fcf('0xa5')]['vendor'],'deviceType':_0x261c3f[_0x5fcf('0xa5')]['type'],'formData':JSON[_0x5fcf('0x16')](_0x2766b8[_0x5fcf('0x49')])};var _0x2d7caa={'ChatWebsiteId':_0x2766b8['params']['id'],'closed':![]};if(_0x2766b8[_0x5fcf('0x49')]['threadId']){_0x2d7caa[_0x5fcf('0xa6')]=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xa6')];return db['ChatInteraction'][_0x5fcf('0x47')]({'where':_0x2d7caa})[_0x5fcf('0x24')](function(_0x2164b7){if(_0x2164b7){return[_0x2164b7,![]];}_0x1ecffc[_0x5fcf('0xa6')]=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xa6')];_0x1ecffc['externalUrl']=_0x2766b8['body'][_0x5fcf('0xa7')];return db[_0x5fcf('0xa8')][_0x5fcf('0x48')](_0x1ecffc)[_0x5fcf('0x24')](function(_0x68fa9d){return[_0x68fa9d,!![]];});});}_0x2d7caa[_0x5fcf('0xa9')]=_0x29d1e9['id'];if(_0x2766b8[_0x5fcf('0x49')]['interaction']&&_0x2766b8[_0x5fcf('0x49')]['interaction']['id']){_0x2d7caa['id']=_0x2766b8['body']['interaction']['id'];return db[_0x5fcf('0xa8')]['find']({'where':_0x2d7caa})[_0x5fcf('0x24')](function(_0x1ed2e9){if(_0x1ed2e9){return[_0x1ed2e9,![]];}return db[_0x5fcf('0xa8')][_0x5fcf('0x48')](_0x1ecffc)[_0x5fcf('0x24')](function(_0x53bec5){return[_0x53bec5,!![]];});});}return db['ChatInteraction']['create'](_0x1ecffc)[_0x5fcf('0x24')](function(_0x180d20){return[_0x180d20,!![]];});}})[_0x5fcf('0xaa')](function(_0x3181b7,_0x47ca52){if(_0x3181b7){_0x11bb18=_0x47ca52;if(!_0x47ca52){var _0x5e4290={'from':(_0x4ece82['contact'][_0x5fcf('0xab')]||'')+'\x20'+(_0x4ece82[_0x5fcf('0xac')][_0x5fcf('0x9f')]||'')};if(_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xa6')]&&_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xad')]&&_0x2766b8['body'][_0x5fcf('0xa6')]!=_0x2766b8[_0x5fcf('0x49')]['messageId']){_0x5e4290[_0x5fcf('0xa6')]=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xad')];}return _0x3181b7['update'](_0x5e4290);}else{return _0x3181b7;}}})[_0x5fcf('0x24')](function(_0x311ac9){_0x4ece82[_0x5fcf('0xae')]=_0x311ac9['get']({'plain':!![]});_0x4ece82[_0x5fcf('0xae')]['created']=_0x11bb18;if(_0x4ece82[_0x5fcf('0xae')][_0x5fcf('0xaf')]){if(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0xb0')]){_0x4ece82['applications']['push']({'id':0x0,'priority':_0x4ece82['applications'][_0x5fcf('0x54')]+0x1,'app':_0x5fcf('0xb1'),'appdata':_0x5fcf('0xb2'),'interval':_0x5fcf('0xb3')});}}return db['ChatMessage'][_0x5fcf('0x48')]({'body':_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x49')],'ChatWebsiteId':_0x2766b8[_0x5fcf('0x46')]['id'],'ChatInteractionId':_0x311ac9['id'],'direction':'in','ContactId':_0x4ece82[_0x5fcf('0xac')]['id'],'AttachmentId':_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xb4')]});})[_0x5fcf('0x24')](function(_0x38c353){_0x4ece82['message']=_0x38c353;if(_0x4ece82['interaction'][_0x5fcf('0xb5')]){return db[_0x5fcf('0xb6')][_0x5fcf('0x47')]({'attributes':['id',_0x5fcf('0x29')],'where':{'id':_0x4ece82[_0x5fcf('0xae')][_0x5fcf('0xb5')]}})[_0x5fcf('0x24')](function(_0x5d6472){if(_0x5d6472){_0x4ece82[_0x5fcf('0x95')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5d6472[_0x5fcf('0x29')]+','+(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0xb7')]||0xa),'interval':_0x5fcf('0xb3')});_0x4ece82['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5fcf('0xb8'),_0x5fcf('0xb9'),_0x4ece82);});}return respondWithRpcPromise(_0x5fcf('0xb8'),_0x5fcf('0xb9'),_0x4ece82);})[_0x5fcf('0x24')](function(_0x294808){respondWithRpcPromise(_0x5fcf('0xba'),'EventManager',{'event':_0x5fcf('0x78'),'message':_0x294808},client9002);return _0x294808;})['then'](respondWithResult(_0x30aad0,null))[_0x5fcf('0x1a')](handleError(_0x30aad0,null));};exports['offline']=function(_0x21ac75,_0x4c317a){var _0x3ebb82,_0x40a279,_0x193825;var _0x2e550f=[];var _0x73961f={};var _0x80b963=_0x21ac75[_0x5fcf('0xbb')]||[];var _0x7b2bc8=[];var _0x2b8d00;return db[_0x5fcf('0x7d')][_0x5fcf('0x50')]()[_0x5fcf('0x24')](function(_0x227033){if(!_0x227033){throw new db[(_0x5fcf('0x86'))]['ValidationError'](_0x5fcf('0x7f'));}_0x2e550f=_[_0x5fcf('0x80')](_[_0x5fcf('0x33')](_0x227033),[_0x5fcf('0x82'),'updatedAt','CompanyId',_0x5fcf('0x84')]);if(_0x21ac75['body']['id']){delete _0x21ac75['body']['id'];}if(_[_0x5fcf('0x6c')](_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0x85')])){throw _0x4c317a['status'](0x1f4)[_0x5fcf('0xbc')](new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0x87')));}if(_[_0x5fcf('0x6c')](_0x21ac75['body']['body'])||_0x21ac75['body'][_0x5fcf('0x49')]===''){throw _0x4c317a[_0x5fcf('0x1c')](0x1f4)[_0x5fcf('0xbc')](new db['Sequelize'][(_0x5fcf('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5fcf('0x6c')](_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')])){throw _0x4c317a[_0x5fcf('0x1c')](0x1f4)[_0x5fcf('0xbc')](new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0xbe')+_0x2e550f));}if(!_[_0x5fcf('0x8a')](_0x2e550f,_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')])){throw _0x4c317a[_0x5fcf('0x1c')](0x1f4)[_0x5fcf('0xbc')](new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0xbf')+_0x2e550f));}_0x73961f[_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')]]=_0x21ac75['body'][_0x5fcf('0x85')];})['then'](function(){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x21ac75[_0x5fcf('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0x5fcf('0x8e')},{'model':db['MailAccount'],'as':_0x5fcf('0xc0')}]});})[_0x5fcf('0x24')](handleEntityNotFound(_0x4c317a,null))[_0x5fcf('0x24')](function(_0xda7f31){if(_0xda7f31&&_0xda7f31['List']){_0x40a279=_0xda7f31;var _0x5383c6=_[_0x5fcf('0xb')](_0x21ac75[_0x5fcf('0x49')],{'firstName':_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0x85')],'phone':_0x21ac75['body'][_0x5fcf('0x85')],'ListId':_0xda7f31['ListId']});_0x5383c6[_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')]]=_0x21ac75['body'][_0x5fcf('0x85')];return db[_0x5fcf('0x7d')]['findOrCreate']({'where':_0x73961f,'defaults':_0x5383c6});}})[_0x5fcf('0xaa')](function(_0x3aec69){if(_0x3aec69){_0x193825=_0x3aec69;var _0x3bfee5=fs[_0x5fcf('0xc1')](path[_0x5fcf('0x67')](config['root'],_0x5fcf('0xc2')),_0x5fcf('0xc3'));var _0x457c63=ejs['render'](_0x3bfee5,{'body':_[_0x5fcf('0xc4')](_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0x49')]),'bodyTitle':_0x40a279['offlineMessageBody']});return db['ChatOfflineMessage'][_0x5fcf('0x48')]({'body':_0x457c63,'ContactId':_0x3aec69['id'],'ChatWebsiteId':_0x40a279['id']});}})[_0x5fcf('0x24')](function(_0x3bc1e9){_0x2b8d00=_0x3bc1e9;if(_0x80b963[_0x5fcf('0x54')]){var _0x81cc45=_0x80b963[_0x5fcf('0x2d')](function(_0x3c4d8e){return{'name':_0x3c4d8e[_0x5fcf('0xc5')],'basename':_0x3c4d8e['filename'],'type':_0x3c4d8e[_0x5fcf('0xc6')],'ChatOfflineMessageId':_0x3bc1e9['id']};});_0x7b2bc8=_0x81cc45[_0x5fcf('0x2d')](_0x5cd716=>{var _0x37e475={'filename':_0x5cd716['name'],'path':path['join'](config[_0x5fcf('0x68')],'server',_0x5fcf('0xbb'),_0x5fcf('0xc7'),'offline-chat',_0x5cd716[_0x5fcf('0xc8')])};return _0x37e475;});if(!_0x40a279['openNewInteraction']){return db[_0x5fcf('0xc9')][_0x5fcf('0xca')](function(_0x5183c1){return db[_0x5fcf('0xcb')]['bulkCreate'](_0x81cc45,{'transaction':_0x5183c1});});}}})[_0x5fcf('0x24')](function(){if(_0x2b8d00){_0x3ebb82=_0x2b8d00;return db[_0x5fcf('0xc0')][_0x5fcf('0x53')]({'where':{'active':!![]},'include':[{'model':db[_0x5fcf('0xcc')],'as':_0x5fcf('0xcd'),'raw':!![]}]});}})[_0x5fcf('0x24')](function(_0x31d956){if(_0x31d956&&_0x31d956[_0x5fcf('0xcd')]&&_0x40a279[_0x5fcf('0xce')]&&_0x40a279[_0x5fcf('0xcf')]){var _0x48a823={'tls':{'rejectUnauthorized':![]}};if(_0x31d956['Smtp'][_0x5fcf('0xd0')]){_0x48a823[_0x5fcf('0xd0')]=_0x31d956['Smtp'][_0x5fcf('0xd0')];}else{_0x48a823[_0x5fcf('0xd1')]=_0x31d956['Smtp'][_0x5fcf('0xd1')];_0x48a823['port']=_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd2')];_0x48a823['secure']=_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd3')];}if(_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd4')]){_0x48a823[_0x5fcf('0xd5')]={'user':_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0x4a')],'pass':_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd6')]};}return respondWithRpcPromise(_0x5fcf('0xd7'),_0x5fcf('0xd8'),{'account':_0x48a823,'message':{'from':util['format'](_0x5fcf('0xd9'),_0x31d956[_0x5fcf('0x29')],_0x31d956[_0x5fcf('0xda')]||_0x31d956['Smtp']['user']),'to':_0x40a279[_0x5fcf('0xcf')],'subject':_0x40a279[_0x5fcf('0xdb')],'html':_0x3ebb82[_0x5fcf('0x49')],'attachments':_0x7b2bc8}},client9003)[_0x5fcf('0x24')](function(){return _0x3ebb82;})[_0x5fcf('0x1a')](function(_0x1e1fb7){console[_0x5fcf('0x17')](_0x1e1fb7);});}})[_0x5fcf('0x24')](function(){if(_0x40a279&&_0x40a279['openNewInteraction']&&_0x40a279[_0x5fcf('0xdc')]){var _0x95bac1=[];if(_0x80b963[_0x5fcf('0x54')]){_0x95bac1=_0x80b963[_0x5fcf('0x2d')](function(_0xcbd9ad){return{'name':_0xcbd9ad[_0x5fcf('0xc5')],'basename':_0xcbd9ad[_0x5fcf('0x60')],'type':_0xcbd9ad[_0x5fcf('0xc6')],'ChatOfflineMessageId':_0x2b8d00['id']};});}var _0x3a6014;if(!_[_0x5fcf('0x6c')](_0x40a279[_0x5fcf('0xdd')])){var _0x47a8b2=_[_0x5fcf('0x2d')](_0x21ac75[_0x5fcf('0x49')],function(_0x1f8f89){return _0x1f8f89;});var _0x5462b2=_[_0x5fcf('0xde')](_0x47a8b2)[0x0];var _0x5068e1=_['mapValues'](_0x5462b2,function(_0xba6abf){return _0xba6abf;});_0x3a6014=_0x5068e1[0x1][_0x40a279['subjectOffline']];}var _0x18cf34={'from':_0x193825[_0x5fcf('0xda')],'firstName':_0x193825[_0x5fcf('0xab')],'lastName':_0x193825[_0x5fcf('0x9f')],'mapKey':_0x5fcf('0xda'),'message':{'from':_0x193825['email'],'to':_0x40a279[_0x5fcf('0xc0')][_0x5fcf('0xda')],'cc':'','subject':_['isNil'](_0x3a6014)?_0x40a279['offlineMessageSubject']:_0x3a6014,'messageId':'','sentAt':new Date(),'attach':_0x95bac1[_0x5fcf('0x54')],'attachments':_0x95bac1,'originChannel':_0x5fcf('0xdf'),'ChatWebsiteId':_0x40a279['id'],'ChatOfflineMessageId':_0x3ebb82['id'],'originTo':_0x40a279[_0x5fcf('0xc0')][_0x5fcf('0xda')]},'body':_0x3ebb82['body']};var _0xc8c72f={'account':{'id':_0x40a279[_0x5fcf('0xdc')]},'body':_0x18cf34,'log':_0x5fcf('0xe0')};return respondWithRpcPromise(_0x5fcf('0xe0'),_0x5fcf('0xe1'),_0xc8c72f,client9001)[_0x5fcf('0x24')](function(){return _0x3ebb82;})[_0x5fcf('0x1a')](function(_0x387f52){console[_0x5fcf('0x17')](_0x387f52);});}return;})['then'](function(){if(_0x3ebb82){return _0x3ebb82;}})[_0x5fcf('0x24')](respondWithResult(_0x4c317a,null))[_0x5fcf('0x1a')](function(_0xccbca1){console['error']('catch',_0xccbca1);for(var _0x188b58 of _0x80b963){var _0x1eefc7=path[_0x5fcf('0x67')](config['root'],_0x5fcf('0xe2'),_0x5fcf('0xbb'),_0x5fcf('0xc7'),_0x5fcf('0xe3'),_0x188b58[_0x5fcf('0x60')]);fs_extra[_0x5fcf('0xe4')](_0x1eefc7)[_0x5fcf('0x1a')](function(_0x403c57){console['error'](_0x5fcf('0xe5'),_0x1eefc7,_0x403c57);});}});};exports[_0x5fcf('0xe6')]=function(_0x1eaadc,_0x225b90){return db[_0x5fcf('0xa8')][_0x5fcf('0x47')]({'where':{'id':_0x1eaadc[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x225b90,null))[_0x5fcf('0x24')](function(_0x33337f){if(_0x33337f){return _0x33337f[_0x5fcf('0xe6')](_0x1eaadc[_0x5fcf('0x49')][_0x5fcf('0x58')],_[_0x5fcf('0xe7')](_0x1eaadc[_0x5fcf('0x49')],[_0x5fcf('0x58'),'id'])||{});}})['then'](respondWithResult(_0x225b90,null))['catch'](handleError(_0x225b90,null));};exports['getInteractions']=function(_0x254e06,_0x217ff7){var _0x165f4f={'raw':![],'where':{}};var _0x276334={};var _0x38345a={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0x254e06[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x217ff7,null))['then'](function(_0x163c6e){if(_0x163c6e){_0x276334['model']=_[_0x5fcf('0x33')](db['ChatInteraction'][_0x5fcf('0x2f')]);_0x276334[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x254e06[_0x5fcf('0x32')]);_0x276334[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0x276334[_0x5fcf('0x36')],_0x276334[_0x5fcf('0x32')]);_0x165f4f['attributes']=_[_0x5fcf('0x35')](_0x276334[_0x5fcf('0x36')],qs['fields'](_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x165f4f['attributes']=_0x165f4f[_0x5fcf('0x38')]['length']?_0x165f4f[_0x5fcf('0x38')]:_0x276334[_0x5fcf('0x36')];if(!_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x39')](_0x5fcf('0x3a'))){_0x165f4f[_0x5fcf('0x1f')]=qs['limit'](_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x165f4f['offset']=qs['offset'](_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x165f4f[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x254e06['query']['sort']);_0x165f4f[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x254e06[_0x5fcf('0x32')],_0x276334['filters']));_0x165f4f['where'][_0x5fcf('0x56')]=_0x163c6e['id'];if(_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x165f4f['where']=_['merge'](_0x165f4f['where'],{'$or':_[_0x5fcf('0x2d')](_0x165f4f[_0x5fcf('0x38')],function(_0x496d27){var _0x15f42b={};_0x15f42b[_0x496d27]={'$like':'%'+_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x15f42b;})});}_0x165f4f=_['merge']({},_0x165f4f,_0x254e06[_0x5fcf('0x41')]);return db['ChatInteraction']['count']({'where':_0x165f4f['where']})[_0x5fcf('0x24')](function(_0x3ed1f8){_0x38345a['count']=_0x3ed1f8;if(_0x254e06[_0x5fcf('0x32')]['includeAll']){_0x165f4f[_0x5fcf('0x43')]=[{'model':db[_0x5fcf('0x7d')],'as':_0x5fcf('0xe8'),'required':![]},{'model':db[_0x5fcf('0xb6')],'as':_0x5fcf('0xe9'),'attributes':[_0x5fcf('0x29'),_0x5fcf('0xea'),_0x5fcf('0xeb')],'required':![]},{'model':db[_0x5fcf('0xec')],'as':'Tags','attributes':['id',_0x5fcf('0x29'),_0x5fcf('0xed')],'where':_0x254e06[_0x5fcf('0x32')][_0x5fcf('0xee')]?{'id':_0x254e06[_0x5fcf('0x32')][_0x5fcf('0xee')]}:undefined,'required':_0x254e06['query'][_0x5fcf('0xee')]?!![]:![]}];}return db[_0x5fcf('0xa8')][_0x5fcf('0x44')](_0x165f4f);})[_0x5fcf('0x24')](function(_0x240b9d){_0x38345a[_0x5fcf('0x5b')]=_0x240b9d;return _0x38345a;});}})[_0x5fcf('0x24')](respondWithFilteredResult(_0x217ff7,_0x165f4f))[_0x5fcf('0x1a')](handleError(_0x217ff7,null));};function iftimePromise(_0x3d76e1,_0x115cf8){return respondWithRpcPromise(_0x5fcf('0xef'),_0x5fcf('0xf0'),{'command':_0x115cf8[_0x5fcf('0xf1')]?util[_0x5fcf('0xf2')]('iftime\x20%s,%s',_0x3d76e1[_0x5fcf('0xf3')],_0x115cf8[_0x5fcf('0xf1')]):util[_0x5fcf('0xf2')](_0x5fcf('0xf4'),_0x3d76e1[_0x5fcf('0xf3')])},client9002)[_0x5fcf('0x24')](function(_0x1f19ce){var _0x3bd061=_0x1f19ce&&_0x1f19ce[_0x5fcf('0xf5')](_0x5fcf('0xf6'))>=0x0?!![]:![];logger[_0x5fcf('0x12')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x115cf8['id'],_0x3d76e1['id'],_0x3d76e1['interval'],_0x3bd061?_0x5fcf('0xf7'):'OFFLINE',_0x115cf8[_0x5fcf('0xf1')]?_0x115cf8['timezone']:'No\x20timezone');return _0x3bd061;})['catch'](function(_0x24427d){logger[_0x5fcf('0x17')](_0x5fcf('0xf8'),_0x115cf8['id'],_0x3d76e1['id'],_0x3d76e1['interval'],util[_0x5fcf('0xf9')](_0x24427d,{'showHidden':![],'depth':null}),_0x115cf8[_0x5fcf('0xf1')]?_0x115cf8[_0x5fcf('0xf1')]:'No\x20timezone');return![];});}exports[_0x5fcf('0xf0')]=function(_0x578991,_0x1d87fd){var _0x5bfa85=0x0;var _0x59487d=0x0;var _0x5ca3c7=![];var _0x4a878c;var _0x3eaaa1;return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x578991['params']['id']},'include':[{'model':db[_0x5fcf('0xfa')],'as':_0x5fcf('0xfa'),'include':[{'model':db[_0x5fcf('0xfa')],'as':'Intervals','attributes':['id',_0x5fcf('0xf3')],'raw':!![]}]}]})[_0x5fcf('0x24')](handleEntityNotFound(_0x1d87fd,null))[_0x5fcf('0x24')](function(_0x487189){if(_0x487189){_0x4a878c=_0x487189;return _0x487189[_0x5fcf('0xfb')]({'raw':!![]});}})[_0x5fcf('0x24')](function(_0x144d48){if(_0x4a878c){if(_0x144d48){_0x3eaaa1=_0x144d48;}}return require(_0x5fcf('0xfc'))['getLicense']();})[_0x5fcf('0x24')](function(_0x13a58b){if(_0x13a58b){_0x59487d=_0x13a58b[_0x5fcf('0xfd')];_0x5ca3c7=_0x13a58b[_0x5fcf('0x6b')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x5fcf('0x24')](function(_0x8bdd22){_0x5bfa85=_0x8bdd22;if(_0x59487d&&_0x8bdd22>_0x59487d){return db[_0x5fcf('0xfe')][_0x5fcf('0x53')]({'where':{'id':0x1}})[_0x5fcf('0x24')](function(_0x1d23e0){if(_0x1d23e0){_0x1d23e0['increment']('chatLicenseExceeded');}});}})[_0x5fcf('0x24')](function(){if(_0x4a878c[_0x5fcf('0xfa')]&&_0x4a878c[_0x5fcf('0xfa')]['Intervals']){var _0x5b4e48=[];for(var _0x246351=0x0;_0x246351<_0x4a878c[_0x5fcf('0xfa')][_0x5fcf('0xff')][_0x5fcf('0x54')];_0x246351++){var _0x33e477=_0x4a878c[_0x5fcf('0xfa')][_0x5fcf('0xff')][_0x246351]['get']({'plain':!![]});_0x5b4e48[_0x5fcf('0x100')](iftimePromise(_0x33e477,_0x4a878c));}return BPromise[_0x5fcf('0x101')](_0x5b4e48)[_0x5fcf('0x24')](function(_0x20a0fb){return _['some'](_0x20a0fb);});}else{return!![];}})[_0x5fcf('0x24')](function(_0x51dffd){var _0x5b102a=fs['readFileSync'](path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x102')),_0x5fcf('0xc3'));var _0x3fe408={'remote':_0x4a878c[_0x5fcf('0x103')],'query':querystring[_0x5fcf('0x16')](_[_0x5fcf('0x40')](_0x4a878c[_0x5fcf('0x26')]({'plain':!![]}),{'customerIp':_0x578991[_0x5fcf('0x9a')][_0x5fcf('0x9c')]||_0x578991[_0x5fcf('0x9a')][_0x5fcf('0x104')]||_0x578991[_0x5fcf('0x105')][_0x5fcf('0x106')]||_0x578991['ip'],'referer':_0x578991[_0x5fcf('0x9a')][_0x5fcf('0x107')],'openedInteractions':_0x5bfa85,'maxInteractions':_0x59487d,'virtual':_0x5ca3c7[_0x5fcf('0xfd')],'online':_0x51dffd,'custom':_0x5ca3c7}))['replace'](/'/g,'\x5c\x27')};_0x1d87fd[_0x5fcf('0xbc')](ejs['render'](Mustache[_0x5fcf('0x108')](_0x5b102a,_0x3fe408),{'proactiveActions':_0x3eaaa1,'alignment':_0x4a878c['alignment'],'verticalAlignment':_0x4a878c[_0x5fcf('0x109')],'div_color':_0x4a878c['color'],'text_color':_0x4a878c[_0x5fcf('0x10a')],'button_color':_0x4a878c[_0x5fcf('0x10b')],'background_color':_0x4a878c[_0x5fcf('0x10c')]}));})['catch'](handleError(_0x1d87fd,null));};exports[_0x5fcf('0x10d')]=function(_0x4b98b2,_0x200efc){var _0x1646b5=_0x4b98b2['params']['id'];var _0x3e429c=_0x4b98b2[_0x5fcf('0x49')];var _0x965101=0xc8;var _0x3570a0=null;return db[_0x5fcf('0xc9')][_0x5fcf('0xca')]({'isolationLevel':db[_0x5fcf('0xc9')][_0x5fcf('0x10e')][_0x5fcf('0x10f')][_0x5fcf('0x110')]},function(_0x117876){return db[_0x5fcf('0x2e')]['findOne']({'where':{'id':_0x1646b5},'transaction':_0x117876})['then'](function(_0x12c8e6){if(_0x12c8e6){return db[_0x5fcf('0x91')][_0x5fcf('0x25')]({'where':{'ChatWebsiteId':_0x1646b5},'transaction':_0x117876})[_0x5fcf('0x24')](function(){var _0x367b64=_[_0x5fcf('0x2d')](_0x3e429c,function(_0x5885af){_0x5885af[_0x5fcf('0x56')]=_0x1646b5;return _0x5885af;});return db[_0x5fcf('0x91')][_0x5fcf('0x111')](_0x367b64,{'transaction':_0x117876});});}else{_0x965101=0x194;_0x3570a0=[];}});})[_0x5fcf('0x24')](function(){if(_0x965101!==0x194){return db['ChatApplication'][_0x5fcf('0x112')]({'where':{'ChatWebsiteId':_0x1646b5},'order':_0x5fcf('0x97')})['then'](function(_0xfc132f){_0x3570a0=_0xfc132f;});}})[_0x5fcf('0x1a')](function(_0x1df6af){_0x965101=0x1f4;logger[_0x5fcf('0x17')](_0x1df6af[_0x5fcf('0x28')]);if(_0x1df6af[_0x5fcf('0x29')]){delete _0x1df6af[_0x5fcf('0x29')];}_0x3570a0=_0x1df6af;})['finally'](function(){if(_0x3570a0===null){_0x200efc['sendStatus'](_0x965101);}else{if(_0x965101===0x1f4){_0x200efc[_0x5fcf('0x1c')](_0x965101)[_0x5fcf('0xbc')](_0x3570a0);}else{_0x200efc[_0x5fcf('0x1c')](_0x965101)[_0x5fcf('0x113')](_0x3570a0);}}});};exports[_0x5fcf('0x114')]=function(_0x4668c0,_0xcc65f6){var _0x5c75a9={};var _0x6851f6={};var _0xc87789;var _0x28d503;return db['ChatWebsite'][_0x5fcf('0x53')]({'where':{'id':_0x4668c0[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0xcc65f6,null))[_0x5fcf('0x24')](function(_0x23f783){if(_0x23f783){_0xc87789=_0x23f783;_0x6851f6['model']=_[_0x5fcf('0x33')](db[_0x5fcf('0x91')][_0x5fcf('0x2f')]);_0x6851f6['query']=_[_0x5fcf('0x33')](_0x4668c0['query']);_0x6851f6[_0x5fcf('0x34')]=_['intersection'](_0x6851f6[_0x5fcf('0x36')],_0x6851f6[_0x5fcf('0x32')]);_0x5c75a9['attributes']=_[_0x5fcf('0x35')](_0x6851f6[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x4668c0[_0x5fcf('0x32')]['fields']));_0x5c75a9[_0x5fcf('0x38')]=_0x5c75a9[_0x5fcf('0x38')][_0x5fcf('0x54')]?_0x5c75a9[_0x5fcf('0x38')]:_0x6851f6[_0x5fcf('0x36')];_0x5c75a9[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x4668c0[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x5c75a9['where']=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x4668c0[_0x5fcf('0x32')],_0x6851f6[_0x5fcf('0x34')]));if(_0x4668c0['query'][_0x5fcf('0x3d')]){_0x5c75a9[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x5c75a9['where'],{'$or':_[_0x5fcf('0x2d')](_0x5c75a9[_0x5fcf('0x38')],function(_0x10a795){var _0x4f7b73={};_0x4f7b73[_0x10a795]={'$like':'%'+_0x4668c0[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x4f7b73;})});}_0x5c75a9=_[_0x5fcf('0x40')]({},_0x5c75a9,_0x4668c0[_0x5fcf('0x41')]);return _0xc87789[_0x5fcf('0x114')](_0x5c75a9);}})['then'](function(_0x339a63){if(_0x339a63){_0x28d503=_0x339a63['length'];if(!_0x4668c0[_0x5fcf('0x32')]['hasOwnProperty'](_0x5fcf('0x3a'))){_0x5c75a9[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x4668c0['query'][_0x5fcf('0x1f')]);_0x5c75a9[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0x4668c0[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}return _0xc87789['getApplications'](_0x5c75a9);}})[_0x5fcf('0x24')](function(_0x42e6b9){if(_0x42e6b9){return _0x42e6b9?{'count':_0x28d503,'rows':_0x42e6b9}:null;}})[_0x5fcf('0x24')](respondWithResult(_0xcc65f6,null))[_0x5fcf('0x1a')](handleError(_0xcc65f6,null));};exports[_0x5fcf('0x115')]=function(_0x50c7c0,_0x19d9b2){return db[_0x5fcf('0x116')][_0x5fcf('0x47')]({'where':{'id':_0x50c7c0[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x19d9b2,null))['then'](function(_0x56d47e){if(_0x56d47e){return _0x56d47e['addProactiveActions'](_0x50c7c0[_0x5fcf('0x49')][_0x5fcf('0x58')],_[_0x5fcf('0xe7')](_0x50c7c0[_0x5fcf('0x49')],[_0x5fcf('0x58'),'id'])||{});}})[_0x5fcf('0x24')](respondWithResult(_0x19d9b2,null))['catch'](handleError(_0x19d9b2,null));};exports[_0x5fcf('0xfb')]=function(_0x32f43f,_0x2c08d8){var _0x1ee450={};var _0x2f80b7={};var _0x18bfbe;var _0x11595d;return db['ChatWebsite'][_0x5fcf('0x53')]({'where':{'id':_0x32f43f[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x2c08d8,null))[_0x5fcf('0x24')](function(_0x44d4fa){if(_0x44d4fa){_0x18bfbe=_0x44d4fa;_0x2f80b7[_0x5fcf('0x36')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x2f80b7[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x32f43f['query']);_0x2f80b7['filters']=_[_0x5fcf('0x35')](_0x2f80b7['model'],_0x2f80b7['query']);_0x1ee450['attributes']=_[_0x5fcf('0x35')](_0x2f80b7['model'],qs['fields'](_0x32f43f['query']['fields']));_0x1ee450['attributes']=_0x1ee450['attributes'][_0x5fcf('0x54')]?_0x1ee450[_0x5fcf('0x38')]:_0x2f80b7[_0x5fcf('0x36')];_0x1ee450[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x32f43f['query']['sort']);_0x1ee450[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x32f43f[_0x5fcf('0x32')],_0x2f80b7[_0x5fcf('0x34')]));if(_0x32f43f[_0x5fcf('0x32')]['filter']){_0x1ee450['where']=_[_0x5fcf('0x40')](_0x1ee450['where'],{'$or':_['map'](_0x1ee450[_0x5fcf('0x38')],function(_0x46ee58){var _0xbfbd39={};_0xbfbd39[_0x46ee58]={'$like':'%'+_0x32f43f[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0xbfbd39;})});}_0x1ee450=_[_0x5fcf('0x40')]({},_0x1ee450,_0x32f43f[_0x5fcf('0x41')]);return _0x18bfbe[_0x5fcf('0xfb')](_0x1ee450);}})[_0x5fcf('0x24')](function(_0xe3e1ef){if(_0xe3e1ef){_0x11595d=_0xe3e1ef[_0x5fcf('0x54')];if(!_0x32f43f[_0x5fcf('0x32')]['hasOwnProperty'](_0x5fcf('0x3a'))){_0x1ee450[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x32f43f[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x1ee450[_0x5fcf('0x1e')]=qs['offset'](_0x32f43f[_0x5fcf('0x32')]['offset']);}return _0x18bfbe[_0x5fcf('0xfb')](_0x1ee450);}})[_0x5fcf('0x24')](function(_0x2b084d){if(_0x2b084d){return _0x2b084d?{'count':_0x11595d,'rows':_0x2b084d}:null;}})['then'](respondWithResult(_0x2c08d8,null))['catch'](handleError(_0x2c08d8,null));};exports['getFields']=function(_0x1bede0,_0x18dc0f){var _0x3cdb79=_0x1bede0['query'][_0x5fcf('0x117')]==='false'?_0x5fcf('0x118'):'onlineForm';return db['ChatWebsite'][_0x5fcf('0x47')]({'attributes':['id',_0x3cdb79],'where':{'id':_0x1bede0[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x18dc0f,null))[_0x5fcf('0x24')](function(_0x1fd757){if(_0x1fd757){var _0x2b148f=_0x1fd757[_0x3cdb79];var _0x8b0a9e=_0x2b148f&&_0x2b148f[_0x5fcf('0x119')]?_0x2b148f[_0x5fcf('0x119')]:[];_0x18dc0f[_0x5fcf('0xbc')]({'fromKey':_[_0x5fcf('0x6c')](_0x2b148f[_0x5fcf('0x11a')])?undefined:_0x2b148f[_0x5fcf('0x11a')],'count':_0x8b0a9e[_0x5fcf('0x54')],'rows':_0x8b0a9e});}})['catch'](handleError(_0x18dc0f,null));};exports['getOfflineMessages']=function(_0x3bef50,_0x553e2d){var _0x26bae1={'raw':![],'where':{}};var _0x12a9f0={};var _0x29d7c8={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0x3bef50[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x553e2d,null))[_0x5fcf('0x24')](function(_0x3c2b66){if(_0x3c2b66){_0x12a9f0[_0x5fcf('0x36')]=_['keys'](db[_0x5fcf('0x11b')]['rawAttributes']);_0x12a9f0[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x3bef50[_0x5fcf('0x32')]);_0x12a9f0[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0x12a9f0['model'],_0x12a9f0[_0x5fcf('0x32')]);_0x26bae1[_0x5fcf('0x38')]=_[_0x5fcf('0x35')](_0x12a9f0[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x3bef50['query'][_0x5fcf('0x37')]));_0x26bae1[_0x5fcf('0x38')]=_0x26bae1[_0x5fcf('0x38')][_0x5fcf('0x54')]?_0x26bae1[_0x5fcf('0x38')]:_0x12a9f0[_0x5fcf('0x36')];if(!_0x3bef50[_0x5fcf('0x32')]['hasOwnProperty'](_0x5fcf('0x3a'))){_0x26bae1[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x3bef50['query'][_0x5fcf('0x1f')]);_0x26bae1[_0x5fcf('0x1e')]=qs['offset'](_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x26bae1[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x3bef50['query'][_0x5fcf('0x3b')]);_0x26bae1[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x3bef50[_0x5fcf('0x32')],_0x12a9f0[_0x5fcf('0x34')]));_0x26bae1[_0x5fcf('0x3e')][_0x5fcf('0x56')]=_0x3c2b66['id'];if(_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x26bae1['where']=_['merge'](_0x26bae1[_0x5fcf('0x3e')],{'$or':_[_0x5fcf('0x2d')](_0x26bae1[_0x5fcf('0x38')],function(_0x46a313){var _0x4e6093={};_0x4e6093[_0x46a313]={'$like':'%'+_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x4e6093;})});}_0x26bae1=_['merge']({},_0x26bae1,_0x3bef50[_0x5fcf('0x41')]);return db[_0x5fcf('0x11b')][_0x5fcf('0x21')]({'where':_0x26bae1[_0x5fcf('0x3e')]})[_0x5fcf('0x24')](function(_0xf8a193){_0x29d7c8[_0x5fcf('0x21')]=_0xf8a193;if(_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x42')]){_0x26bae1['include']=[{'all':!![]}];}else{_0x26bae1['include']=[{'model':db[_0x5fcf('0x7d')],'as':_0x5fcf('0xe8'),'required':![]},{'model':db['Attachment'],'as':_0x5fcf('0x11c'),'required':![]}];}return db[_0x5fcf('0x11b')][_0x5fcf('0x44')](_0x26bae1);})['then'](function(_0x2662a){_0x29d7c8[_0x5fcf('0x5b')]=_0x2662a;return _0x29d7c8;});}})['then'](respondWithFilteredResult(_0x553e2d,_0x26bae1))[_0x5fcf('0x1a')](handleError(_0x553e2d,null));};exports['addAgents']=function(_0x134940,_0x201e90){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x134940[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x201e90,null))[_0x5fcf('0x24')](function(_0x5ed376){if(_0x5ed376){return _0x5ed376[_0x5fcf('0x11d')](_0x134940[_0x5fcf('0x49')]['ids'],_[_0x5fcf('0xe7')](_0x134940[_0x5fcf('0x49')],['ids','id'])||{})[_0x5fcf('0xaa')](function(_0x2aeb60){for(var _0x1106c3=0x0;_0x1106c3<_0x134940[_0x5fcf('0x49')][_0x5fcf('0x58')]['length'];_0x1106c3+=0x1){socket[_0x5fcf('0x11e')](_0x5fcf('0x11f'),{'UserId':Number(_0x134940[_0x5fcf('0x49')][_0x5fcf('0x58')][_0x1106c3]),'ChatWebsiteId':Number(_0x134940['params']['id'])});}return _0x2aeb60;});}})[_0x5fcf('0x24')](respondWithResult(_0x201e90,null))[_0x5fcf('0x1a')](handleError(_0x201e90,null));};exports[_0x5fcf('0x120')]=function(_0x5408ee,_0x56b609){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x5408ee[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x56b609,null))[_0x5fcf('0x24')](function(_0xf7700b){if(_0xf7700b){return _0xf7700b[_0x5fcf('0x120')](_0x5408ee[_0x5fcf('0x32')]['ids'])['then'](function(){if(_[_0x5fcf('0x121')](_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')])){for(var _0x5f2780=0x0;_0x5f2780<_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')][_0x5fcf('0x54')];_0x5f2780+=0x1){socket[_0x5fcf('0x11e')](_0x5fcf('0x122'),{'UserId':Number(_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')][_0x5f2780]),'ChatWebsiteId':Number(_0x5408ee[_0x5fcf('0x46')]['id'])});}}else{socket[_0x5fcf('0x11e')](_0x5fcf('0x122'),{'UserId':Number(_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')]),'ChatWebsiteId':Number(_0x5408ee['params']['id'])});}});}})[_0x5fcf('0x24')](respondWithStatusCode(_0x56b609,null))['catch'](handleError(_0x56b609,null));};exports['getAgents']=function(_0x345922,_0x280764){var _0x284bc5={};var _0x1ccce0={};var _0x408874;var _0x6af59;return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0x345922[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x280764,null))[_0x5fcf('0x24')](function(_0x4254f0){if(_0x4254f0){_0x408874=_0x4254f0;_0x1ccce0[_0x5fcf('0x36')]=_[_0x5fcf('0x33')](db[_0x5fcf('0xb6')][_0x5fcf('0x2f')]);_0x1ccce0[_0x5fcf('0x32')]=_['keys'](_0x345922[_0x5fcf('0x32')]);_0x1ccce0['filters']=_['intersection'](_0x1ccce0[_0x5fcf('0x36')],_0x1ccce0[_0x5fcf('0x32')]);_0x284bc5[_0x5fcf('0x38')]=_[_0x5fcf('0x35')](_0x1ccce0[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x345922[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x284bc5[_0x5fcf('0x38')]=_0x284bc5[_0x5fcf('0x38')]['length']?_0x284bc5['attributes']:_0x1ccce0[_0x5fcf('0x36')];_0x284bc5['order']=qs[_0x5fcf('0x3b')](_0x345922['query'][_0x5fcf('0x3b')]);_0x284bc5[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_['pick'](_0x345922[_0x5fcf('0x32')],_0x1ccce0[_0x5fcf('0x34')]));if(_0x345922[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x284bc5[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x284bc5['where'],{'$or':_['map'](_0x284bc5[_0x5fcf('0x38')],function(_0xbd75fd){var _0xe17709={};_0xe17709[_0xbd75fd]={'$like':'%'+_0x345922[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0xe17709;})});}_0x284bc5=_['merge']({},_0x284bc5,_0x345922[_0x5fcf('0x41')]);return _0x408874[_0x5fcf('0x123')](_0x284bc5);}})[_0x5fcf('0x24')](function(_0x3f4cc5){if(_0x3f4cc5){_0x6af59=_0x3f4cc5[_0x5fcf('0x54')];if(!_0x345922[_0x5fcf('0x32')][_0x5fcf('0x39')]('nolimit')){_0x284bc5['limit']=qs[_0x5fcf('0x1f')](_0x345922['query'][_0x5fcf('0x1f')]);_0x284bc5[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0x345922[_0x5fcf('0x32')]['offset']);}return _0x408874[_0x5fcf('0x123')](_0x284bc5);}})[_0x5fcf('0x24')](function(_0x4fe559){if(_0x4fe559){return _0x4fe559?{'count':_0x6af59,'rows':_0x4fe559}:null;}})[_0x5fcf('0x24')](respondWithResult(_0x280764,null))[_0x5fcf('0x1a')](handleError(_0x280764,null));}; \ No newline at end of file +var _0x7d3c=['removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','account','applications','list','orderBy','priority','asc','Applications','ListId','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','version','%s\x20%s','browser','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','lastName','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','includes','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','server','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','mimetype','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','fullname','Tag','Tags','color','tag','findAll','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','referer','virtual','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','getApplications','addProactiveActions','online','false','offlineForm','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','get','stack','name','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','Pause','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7d3c,0xcc));var _0xc7d3=function(_0x5f1c73,_0x4f9432){_0x5f1c73=_0x5f1c73-0x0;var _0x3c1fa4=_0x7d3c[_0x5f1c73];return _0x3c1fa4;};'use strict';var BPromise=require(_0xc7d3('0x0'));var Mustache=require(_0xc7d3('0x1'));var util=require(_0xc7d3('0x2'));var path=require(_0xc7d3('0x3'));var ejs=require(_0xc7d3('0x4'));var fs=require('fs');var fs_extra=require(_0xc7d3('0x5'));var _=require(_0xc7d3('0x6'));var querystring=require(_0xc7d3('0x7'));var Redis=require(_0xc7d3('0x8'));var qs=require(_0xc7d3('0x9'));var logger=require(_0xc7d3('0xa'))(_0xc7d3('0xb'));var config=require('../../config/environment');var db=require(_0xc7d3('0xc'))['db'];config[_0xc7d3('0xd')]=_[_0xc7d3('0xe')](config[_0xc7d3('0xd')],{'host':_0xc7d3('0xf'),'port':0x18eb});var socket=require(_0xc7d3('0x10'))(new Redis(config[_0xc7d3('0xd')]));require(_0xc7d3('0x11'))['register'](socket);var jayson=require(_0xc7d3('0x12'));var client=jayson[_0xc7d3('0x13')][_0xc7d3('0x14')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xc7d3('0x13')][_0xc7d3('0x14')]({'port':0x232b});var client9001=jayson[_0xc7d3('0x13')][_0xc7d3('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x3bb6ba,_0x951740,_0x10fcca,_0x5516f0){return new BPromise(function(_0x7824dc,_0x395d8e){var _0x17f1e0=_0x5516f0||client;return _0x17f1e0[_0xc7d3('0x15')](_0x3bb6ba,_0x10fcca)[_0xc7d3('0x16')](function(_0x19a1bc){logger[_0xc7d3('0x17')](_0xc7d3('0x18'),_0x951740,'request\x20sent');logger[_0xc7d3('0x19')](_0xc7d3('0x1a'),_0x951740,_0xc7d3('0x1b'),JSON[_0xc7d3('0x1c')](_0x19a1bc));if(_0x19a1bc['error']){if(_0x19a1bc[_0xc7d3('0x1d')][_0xc7d3('0x1e')]===0x1f4){logger[_0xc7d3('0x1d')](_0xc7d3('0x18'),_0x951740,_0x19a1bc[_0xc7d3('0x1d')][_0xc7d3('0x1f')]);return _0x395d8e(_0x19a1bc[_0xc7d3('0x1d')]['message']);}logger[_0xc7d3('0x1d')](_0xc7d3('0x18'),_0x951740,_0x19a1bc[_0xc7d3('0x1d')]['message']);return _0x7824dc(_0x19a1bc[_0xc7d3('0x1d')][_0xc7d3('0x1f')]);}else{logger[_0xc7d3('0x17')](_0xc7d3('0x18'),_0x951740,_0xc7d3('0x1b'));_0x7824dc(_0x19a1bc[_0xc7d3('0x20')]['message']);}})[_0xc7d3('0x21')](function(_0x4a644a){logger[_0xc7d3('0x1d')](_0xc7d3('0x18'),_0x951740,_0x4a644a);_0x395d8e(_0x4a644a);});});}function respondWithStatusCode(_0xf3300f,_0x2e0d48){_0x2e0d48=_0x2e0d48||0xcc;return function(_0x59eb80){if(_0x59eb80){return _0xf3300f[_0xc7d3('0x22')](_0x2e0d48);}return _0xf3300f['status'](_0x2e0d48)[_0xc7d3('0x23')]();};}function respondWithResult(_0x1ccf10,_0x30e785){_0x30e785=_0x30e785||0xc8;return function(_0x12cc69){if(_0x12cc69){return _0x1ccf10[_0xc7d3('0x24')](_0x30e785)[_0xc7d3('0x25')](_0x12cc69);}};}function respondWithFilteredResult(_0x2d7fe9,_0x5888dc){return function(_0x3173ae){if(_0x3173ae){var _0x5e40b7=typeof _0x5888dc[_0xc7d3('0x26')]===_0xc7d3('0x27')&&typeof _0x5888dc[_0xc7d3('0x28')]===_0xc7d3('0x27');var _0x45899c=_0x3173ae[_0xc7d3('0x29')];var _0x29b02b=_0x5e40b7?0x0:_0x5888dc[_0xc7d3('0x26')];var _0x23cb73=_0x5e40b7?_0x3173ae[_0xc7d3('0x29')]:_0x5888dc[_0xc7d3('0x26')]+_0x5888dc[_0xc7d3('0x28')];var _0x23d57f;if(_0x23cb73>=_0x45899c){_0x23cb73=_0x45899c;_0x23d57f=0xc8;}else{_0x23d57f=0xce;}_0x2d7fe9[_0xc7d3('0x24')](_0x23d57f);return _0x2d7fe9['set'](_0xc7d3('0x2a'),_0x29b02b+'-'+_0x23cb73+'/'+_0x45899c)[_0xc7d3('0x25')](_0x3173ae);}return null;};}function saveUpdates(_0x220479){return function(_0x11b703){if(_0x11b703){return _0x11b703['update'](_0x220479)[_0xc7d3('0x16')](function(_0xbc43d8){return _0xbc43d8;});}return null;};}function removeEntity(_0x9f915e){return function(_0x203a17){if(_0x203a17){return _0x203a17[_0xc7d3('0x2b')]()[_0xc7d3('0x16')](function(){var _0x3df0f8=_0x203a17[_0xc7d3('0x2c')]({'plain':!![]});var _0x553f5f='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x553f5f,'resourceId':_0x3df0f8['id']}})['then'](function(){return _0x203a17;});})['then'](function(){_0x9f915e[_0xc7d3('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32808e){return function(_0x1df41e){if(!_0x1df41e){_0x32808e[_0xc7d3('0x22')](0x194);}return _0x1df41e;};}function handleError(_0x20fd9c,_0x3e72d6){_0x3e72d6=_0x3e72d6||0x1f4;return function(_0x3b0f87){logger[_0xc7d3('0x1d')](_0x3b0f87[_0xc7d3('0x2d')]);if(_0x3b0f87[_0xc7d3('0x2e')]){delete _0x3b0f87['name'];}_0x20fd9c['status'](_0x3e72d6)['send'](_0x3b0f87);};}exports[_0xc7d3('0x2f')]=function(_0x221539,_0x111567){var _0x4a3808={'include':[{'model':db['Pause'],'as':_0xc7d3('0x30')}]},_0x345f59={},_0x3cb421={'count':0x0,'rows':[]};var _0x141b47=_[_0xc7d3('0x31')](db[_0xc7d3('0x32')]['rawAttributes'],function(_0x2ad7c8){return{'name':_0x2ad7c8[_0xc7d3('0x33')],'type':_0x2ad7c8[_0xc7d3('0x34')][_0xc7d3('0x35')]};});_0x345f59[_0xc7d3('0x36')]=_[_0xc7d3('0x31')](_0x141b47,'name');_0x345f59['query']=_[_0xc7d3('0x37')](_0x221539[_0xc7d3('0x38')]);_0x345f59[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x345f59[_0xc7d3('0x36')],_0x345f59[_0xc7d3('0x38')]);_0x4a3808[_0xc7d3('0x3b')]=_['intersection'](_0x345f59[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x221539[_0xc7d3('0x38')]['fields']));_0x4a3808['attributes']=_0x4a3808[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x4a3808[_0xc7d3('0x3b')]:_0x345f59[_0xc7d3('0x36')];if(!_0x221539[_0xc7d3('0x38')]['hasOwnProperty'](_0xc7d3('0x3e'))){_0x4a3808[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x221539[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x4a3808[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x221539[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x4a3808[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x221539[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x4a3808[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x221539['query'],_0x345f59['filters']),_0x141b47);if(_0x221539[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x4a3808[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x4a3808[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x141b47,function(_0xc3319d){if(_0xc3319d['type']!==_0xc7d3('0x45')){var _0x2caab7={};_0x2caab7[_0xc3319d['name']]={'$like':'%'+_0x221539[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x2caab7;}})});}_0x4a3808=_[_0xc7d3('0x44')]({},_0x4a3808,_0x221539[_0xc7d3('0x46')]);var _0x41fd77={'where':_0x4a3808[_0xc7d3('0x41')]};return db['ChatWebsite'][_0xc7d3('0x29')](_0x41fd77)[_0xc7d3('0x16')](function(_0x418751){_0x3cb421[_0xc7d3('0x29')]=_0x418751;if(_0x221539['query'][_0xc7d3('0x47')]){_0x4a3808['include']=[{'all':!![]}];}return db[_0xc7d3('0x32')]['findAll'](_0x4a3808);})[_0xc7d3('0x16')](function(_0x223468){_0x3cb421[_0xc7d3('0x48')]=_0x223468;return _0x3cb421;})['then'](respondWithFilteredResult(_0x111567,_0x4a3808))[_0xc7d3('0x21')](handleError(_0x111567,null));};exports[_0xc7d3('0x49')]=function(_0x6c4198,_0x26cdca){var _0x5f3dc2={'raw':![],'where':{'id':_0x6c4198[_0xc7d3('0x4a')]['id']},'include':[{'model':db[_0xc7d3('0x4b')],'as':_0xc7d3('0x30')}]},_0xfa7609={};_0xfa7609['model']=_[_0xc7d3('0x37')](db['ChatWebsite'][_0xc7d3('0x4c')]);_0xfa7609[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x6c4198[_0xc7d3('0x38')]);_0xfa7609[_0xc7d3('0x39')]=_['intersection'](_0xfa7609['model'],_0xfa7609[_0xc7d3('0x38')]);_0x5f3dc2['attributes']=_[_0xc7d3('0x3a')](_0xfa7609[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x6c4198['query']['fields']));_0x5f3dc2['attributes']=_0x5f3dc2[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x5f3dc2[_0xc7d3('0x3b')]:_0xfa7609[_0xc7d3('0x36')];if(_0x6c4198[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x5f3dc2[_0xc7d3('0x4d')]=[{'all':!![]}];}_0x5f3dc2=_['merge']({},_0x5f3dc2,_0x6c4198[_0xc7d3('0x46')]);return db['ChatWebsite'][_0xc7d3('0x4e')](_0x5f3dc2)[_0xc7d3('0x16')](handleEntityNotFound(_0x26cdca,null))[_0xc7d3('0x16')](respondWithResult(_0x26cdca,null))[_0xc7d3('0x21')](handleError(_0x26cdca,null));};exports[_0xc7d3('0x4f')]=function(_0x5b24d0,_0x284aeb){return db[_0xc7d3('0x32')][_0xc7d3('0x4f')](_0x5b24d0[_0xc7d3('0x50')],{})[_0xc7d3('0x16')](function(_0x24c087){var _0x5bea05=_0x5b24d0[_0xc7d3('0x51')]['get']({'plain':!![]});if(!_0x5bea05)throw new Error(_0xc7d3('0x52'));if(_0x5bea05['role']===_0xc7d3('0x51')){var _0x1dd8ad=_0x24c087['get']({'plain':!![]});var _0x50cf41=_0xc7d3('0x53');return db[_0xc7d3('0x54')][_0xc7d3('0x4e')]({'where':{'name':_0x50cf41,'userProfileId':_0x5bea05[_0xc7d3('0x55')]},'raw':!![]})[_0xc7d3('0x16')](function(_0x38594e){if(_0x38594e&&_0x38594e['autoAssociation']===0x0){return db[_0xc7d3('0x56')][_0xc7d3('0x4f')]({'name':_0x1dd8ad['name'],'resourceId':_0x1dd8ad['id'],'type':_0x38594e[_0xc7d3('0x2e')],'sectionId':_0x38594e['id']},{})[_0xc7d3('0x16')](function(){return _0x24c087;});}else{return _0x24c087;}})[_0xc7d3('0x21')](function(_0x3ff73d){logger[_0xc7d3('0x1d')](_0xc7d3('0x57'),_0x3ff73d);throw _0x3ff73d;});}return _0x24c087;})[_0xc7d3('0x16')](respondWithResult(_0x284aeb,0xc9))[_0xc7d3('0x21')](handleError(_0x284aeb,null));};exports['update']=function(_0x25b675,_0xd2fa72){if(_0x25b675[_0xc7d3('0x50')]['id']){delete _0x25b675[_0xc7d3('0x50')]['id'];}return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x25b675[_0xc7d3('0x4a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc7d3('0x16')](handleEntityNotFound(_0xd2fa72,null))[_0xc7d3('0x16')](saveUpdates(_0x25b675[_0xc7d3('0x50')],null))[_0xc7d3('0x16')](respondWithResult(_0xd2fa72,null))[_0xc7d3('0x21')](handleError(_0xd2fa72,null));};exports['destroy']=function(_0xddc856,_0x3e44ef){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0xddc856['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x3e44ef,null))[_0xc7d3('0x16')](removeEntity(_0x3e44ef,null))[_0xc7d3('0x21')](handleError(_0x3e44ef,null));};exports['describe']=function(_0x58d195,_0x5b4e67){return db[_0xc7d3('0x32')][_0xc7d3('0x58')]()[_0xc7d3('0x16')](respondWithResult(_0x5b4e67,null))[_0xc7d3('0x21')](handleError(_0x5b4e67,null));};exports[_0xc7d3('0x59')]=function(_0x506c95,_0x239cde){if(_0x506c95[_0xc7d3('0x50')]['id']){delete _0x506c95[_0xc7d3('0x50')]['id'];}return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x506c95[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x239cde,null))[_0xc7d3('0x16')](function(_0x337500){if(_0x337500){_0x506c95['body'][_0xc7d3('0x5a')]=_0x337500['id'];return db[_0xc7d3('0x5b')]['create'](_0x506c95[_0xc7d3('0x50')]);}})['then'](respondWithResult(_0x239cde,null))['catch'](handleError(_0x239cde,null));};exports['getDispositions']=function(_0x3d84ef,_0x5f5693){var _0x2fe299={'raw':![],'where':{}};var _0x284bdc={};var _0x342ae2={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x3d84ef['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x5f5693,null))['then'](function(_0x274e76){if(_0x274e76){_0x284bdc[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0x5b')][_0xc7d3('0x4c')]);_0x284bdc[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x3d84ef[_0xc7d3('0x38')]);_0x284bdc[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x284bdc['model'],_0x284bdc[_0xc7d3('0x38')]);_0x2fe299[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x284bdc[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x3d84ef[_0xc7d3('0x38')]['fields']));_0x2fe299[_0xc7d3('0x3b')]=_0x2fe299[_0xc7d3('0x3b')]['length']?_0x2fe299[_0xc7d3('0x3b')]:_0x284bdc['model'];if(!_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x2fe299[_0xc7d3('0x28')]=qs['limit'](_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x2fe299[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x2fe299[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x2fe299[_0xc7d3('0x41')]=qs['filters'](_[_0xc7d3('0x42')](_0x3d84ef[_0xc7d3('0x38')],_0x284bdc[_0xc7d3('0x39')]));_0x2fe299['where'][_0xc7d3('0x5a')]=_0x274e76['id'];if(_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x2fe299[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x2fe299[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x2fe299[_0xc7d3('0x3b')],function(_0x3a9d9d){var _0x10d11b={};_0x10d11b[_0x3a9d9d]={'$like':'%'+_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x10d11b;})});}_0x2fe299=_[_0xc7d3('0x44')]({},_0x2fe299,_0x3d84ef[_0xc7d3('0x46')]);return db[_0xc7d3('0x5b')][_0xc7d3('0x29')]({'where':_0x2fe299[_0xc7d3('0x41')]})['then'](function(_0xa84bfa){_0x342ae2[_0xc7d3('0x29')]=_0xa84bfa;if(_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x2fe299[_0xc7d3('0x4d')]=[{'all':!![]}];}return db[_0xc7d3('0x5b')]['findAll'](_0x2fe299);})['then'](function(_0x27a24b){_0x342ae2[_0xc7d3('0x48')]=_0x27a24b;return _0x342ae2;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x5f5693,_0x2fe299))[_0xc7d3('0x21')](handleError(_0x5f5693,null));};exports[_0xc7d3('0x5e')]=function(_0x27188d,_0x383149){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x27188d[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x383149,null))[_0xc7d3('0x16')](function(_0x2b8105){if(_0x2b8105){return _0x2b8105[_0xc7d3('0x5e')](_0x27188d[_0xc7d3('0x38')][_0xc7d3('0x5f')]);}})['then'](respondWithStatusCode(_0x383149,null))[_0xc7d3('0x21')](handleError(_0x383149,null));};exports[_0xc7d3('0x60')]=function(_0x4efab6,_0x59e469){if(_0x4efab6['body']['id']){delete _0x4efab6[_0xc7d3('0x50')]['id'];}return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x4efab6[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x59e469,null))['then'](function(_0x2d5629){if(_0x2d5629){_0x4efab6[_0xc7d3('0x50')][_0xc7d3('0x5a')]=_0x2d5629['id'];return db[_0xc7d3('0x61')][_0xc7d3('0x4f')](_0x4efab6[_0xc7d3('0x50')]);}})[_0xc7d3('0x16')](respondWithResult(_0x59e469,null))[_0xc7d3('0x21')](handleError(_0x59e469,null));};exports[_0xc7d3('0x62')]=function(_0x25d307,_0x13cb52){var _0x21cf22={'raw':![],'where':{}};var _0x3ad56e={};var _0x2af176={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')]['findOne']({'where':{'id':_0x25d307['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x13cb52,null))['then'](function(_0x4f539f){if(_0x4f539f){_0x3ad56e['model']=_['keys'](db[_0xc7d3('0x61')]['rawAttributes']);_0x3ad56e[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x25d307[_0xc7d3('0x38')]);_0x3ad56e[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x3ad56e[_0xc7d3('0x36')],_0x3ad56e[_0xc7d3('0x38')]);_0x21cf22[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x3ad56e['model'],qs['fields'](_0x25d307['query'][_0xc7d3('0x3c')]));_0x21cf22[_0xc7d3('0x3b')]=_0x21cf22['attributes'][_0xc7d3('0x3d')]?_0x21cf22[_0xc7d3('0x3b')]:_0x3ad56e['model'];if(!_0x25d307[_0xc7d3('0x38')]['hasOwnProperty'](_0xc7d3('0x3e'))){_0x21cf22[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x25d307['query'][_0xc7d3('0x28')]);_0x21cf22[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x25d307['query']['offset']);}_0x21cf22[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x25d307['query'][_0xc7d3('0x40')]);_0x21cf22[_0xc7d3('0x41')]=qs['filters'](_[_0xc7d3('0x42')](_0x25d307[_0xc7d3('0x38')],_0x3ad56e['filters']));_0x21cf22[_0xc7d3('0x41')]['ChatWebsiteId']=_0x4f539f['id'];if(_0x25d307[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x21cf22[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x21cf22[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x21cf22[_0xc7d3('0x3b')],function(_0x380b33){var _0x408a75={};_0x408a75[_0x380b33]={'$like':'%'+_0x25d307['query']['filter']+'%'};return _0x408a75;})});}_0x21cf22=_[_0xc7d3('0x44')]({},_0x21cf22,_0x25d307[_0xc7d3('0x46')]);return db[_0xc7d3('0x61')][_0xc7d3('0x29')]({'where':_0x21cf22[_0xc7d3('0x41')]})[_0xc7d3('0x16')](function(_0x51e7ba){_0x2af176['count']=_0x51e7ba;if(_0x25d307[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x21cf22[_0xc7d3('0x4d')]=[{'all':!![]}];}return db[_0xc7d3('0x61')]['findAll'](_0x21cf22);})[_0xc7d3('0x16')](function(_0x310dab){_0x2af176[_0xc7d3('0x48')]=_0x310dab;return _0x2af176;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x13cb52,_0x21cf22))['catch'](handleError(_0x13cb52,null));};exports['removeAnswers']=function(_0x266c36,_0x427428){return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x266c36[_0xc7d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x427428,null))[_0xc7d3('0x16')](function(_0x398ab7){if(_0x398ab7){return _0x398ab7[_0xc7d3('0x63')](_0x266c36[_0xc7d3('0x38')]['ids']);}})[_0xc7d3('0x16')](respondWithStatusCode(_0x427428,null))[_0xc7d3('0x21')](handleError(_0x427428,null));};exports[_0xc7d3('0x64')]=function(_0x4176f6,_0x27c18a){_0x4176f6[_0xc7d3('0x50')]['sitepic']=_0x4176f6[_0xc7d3('0x65')][_0xc7d3('0x66')];return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x4176f6['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x27c18a,null))['then'](saveUpdates(_0x4176f6[_0xc7d3('0x50')],null))[_0xc7d3('0x16')](respondWithResult(_0x27c18a,null))[_0xc7d3('0x21')](handleError(_0x27c18a,null));};exports['addAvatar']=function(_0x2bd9f1,_0x25932d){_0x2bd9f1[_0xc7d3('0x50')][_0xc7d3('0x67')]=_0x2bd9f1[_0xc7d3('0x65')]['filename'];return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x2bd9f1[_0xc7d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x25932d,null))[_0xc7d3('0x16')](saveUpdates(_0x2bd9f1[_0xc7d3('0x50')],null))[_0xc7d3('0x16')](respondWithResult(_0x25932d,null))[_0xc7d3('0x21')](handleError(_0x25932d,null));};exports[_0xc7d3('0x68')]=function(_0x4926f0,_0x10f79c){_0x4926f0[_0xc7d3('0x50')][_0xc7d3('0x69')]=_0x4926f0[_0xc7d3('0x65')][_0xc7d3('0x66')];return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x4926f0['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x10f79c,null))[_0xc7d3('0x16')](saveUpdates(_0x4926f0[_0xc7d3('0x50')],null))['then'](respondWithResult(_0x10f79c,null))['catch'](handleError(_0x10f79c,null));};exports['addSystemAvatar']=function(_0x28ea91,_0x29ddf9){_0x28ea91[_0xc7d3('0x50')]['systemAvatar']=_0x28ea91[_0xc7d3('0x65')][_0xc7d3('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x28ea91[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x29ddf9,null))['then'](saveUpdates(_0x28ea91[_0xc7d3('0x50')],null))['then'](respondWithResult(_0x29ddf9,null))[_0xc7d3('0x21')](handleError(_0x29ddf9,null));};exports[_0xc7d3('0x6a')]=function(_0x445ee5,_0x360021){var _0x2cbcf2=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x6d'));var _0x3ff852={'where':{'id':_0x445ee5[_0xc7d3('0x4a')]['id']},'attributes':['id',_0xc7d3('0x6e')],'raw':!![]};var _0x2f7d29=![];return require(_0xc7d3('0x6f'))[_0xc7d3('0x70')]()['then'](function(_0x189799){if(_0x189799){_0x2f7d29=_0x189799[_0xc7d3('0x71')];}})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')](_0x3ff852);})[_0xc7d3('0x16')](handleEntityNotFound(_0x360021,null))[_0xc7d3('0x16')](function(_0x223c6f){if(_0x223c6f){if(!_[_0xc7d3('0x72')](_0x223c6f[_0xc7d3('0x6e')])){if(fs['existsSync'](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x73'),_0x223c6f[_0xc7d3('0x6e')]))&&_0x2f7d29){_0x2cbcf2=path['join'](config[_0xc7d3('0x6c')],'server/files/images/logos/',_0x223c6f[_0xc7d3('0x6e')]);}}return _0x360021[_0xc7d3('0x74')](_0x2cbcf2);}})[_0xc7d3('0x21')](handleError(_0x360021,null));};exports['getAvatar']=function(_0x533a2b,_0x28565e){var _0x5a6a55=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x75'));var _0x324b94={'where':{'id':_0x533a2b[_0xc7d3('0x4a')]['id']},'attributes':['id',_0xc7d3('0x67')],'raw':!![]};return db[_0xc7d3('0x32')][_0xc7d3('0x4e')](_0x324b94)[_0xc7d3('0x16')](handleEntityNotFound(_0x28565e,null))[_0xc7d3('0x16')](function(_0x366f40){if(_0x366f40){if(!_[_0xc7d3('0x72')](_0x366f40[_0xc7d3('0x67')])){if(fs['existsSync'](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0x366f40[_0xc7d3('0x67')]))){_0x5a6a55=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],'server/files/images/avatars/',_0x366f40['agentAvatar']);}}return _0x28565e[_0xc7d3('0x74')](_0x5a6a55);}})[_0xc7d3('0x21')](handleError(_0x28565e,null));};exports[_0xc7d3('0x77')]=function(_0x19ea7b,_0x4f1a68){var _0x2d642e=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x78'));var _0x1be6a3={'where':{'id':_0x19ea7b['params']['id']},'attributes':['id',_0xc7d3('0x69'),_0xc7d3('0x79')],'raw':!![]};return db[_0xc7d3('0x32')][_0xc7d3('0x4e')](_0x1be6a3)[_0xc7d3('0x16')](handleEntityNotFound(_0x4f1a68,null))['then'](function(_0x4b22c2){if(_0x4b22c2){if(!_['isNil'](_0x4b22c2['customerAvatar'])){if(fs[_0xc7d3('0x7a')](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0x4b22c2[_0xc7d3('0x69')]))&&_0x4b22c2[_0xc7d3('0x79')]){_0x2d642e=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0x4b22c2[_0xc7d3('0x69')]);}}return _0x4f1a68[_0xc7d3('0x74')](_0x2d642e);}})['catch'](handleError(_0x4f1a68,null));};exports[_0xc7d3('0x7b')]=function(_0x4ccbe2,_0x42aef0){var _0x490642=path[_0xc7d3('0x6b')](config['root'],_0xc7d3('0x7c'));var _0x3276f1={'where':{'id':_0x4ccbe2[_0xc7d3('0x4a')]['id']},'attributes':['id',_0xc7d3('0x7d')],'raw':!![]};return db['ChatWebsite'][_0xc7d3('0x4e')](_0x3276f1)[_0xc7d3('0x16')](handleEntityNotFound(_0x42aef0,null))[_0xc7d3('0x16')](function(_0xb6cf5f){if(_0xb6cf5f){if(!_[_0xc7d3('0x72')](_0xb6cf5f[_0xc7d3('0x7d')])){if(fs[_0xc7d3('0x7a')](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0xb6cf5f['systemAvatar']))){_0x490642=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0xb6cf5f[_0xc7d3('0x7d')]);}}return _0x42aef0[_0xc7d3('0x74')](_0x490642);}})[_0xc7d3('0x21')](handleError(_0x42aef0,null));};exports[_0xc7d3('0x7e')]=function(_0x5d2df8,_0x1b59a3){var _0x371382=require(_0xc7d3('0x7f'));var _0x5a02f0=new _0x371382();var _0x5d4532=_0x5a02f0[_0xc7d3('0x80')](_0x5d2df8['headers'][_0xc7d3('0x81')])['getResult']();var _0x2d23f4={'body':_0x5d2df8[_0xc7d3('0x50')],'channel':_0xc7d3('0x82')};var _0x1b8839=[];var _0x1b9f8b=[];var _0x217f4b={};var _0x37cf4=![];return db['CmContact'][_0xc7d3('0x58')]()[_0xc7d3('0x16')](function(_0x569fa8){if(!_0x569fa8){throw new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))](_0xc7d3('0x85'));}_0x1b8839=_[_0xc7d3('0x86')](_[_0xc7d3('0x37')](_0x569fa8),[_0xc7d3('0x87'),'updatedAt']);_0x1b9f8b=_[_0xc7d3('0x86')](_[_0xc7d3('0x37')](_0x569fa8),[_0xc7d3('0x87'),_0xc7d3('0x88'),_0xc7d3('0x89'),'ListId']);if(_0x5d2df8[_0xc7d3('0x50')]['id']){delete _0x5d2df8['body']['id'];}if(_[_0xc7d3('0x72')](_0x5d2df8[_0xc7d3('0x50')]['from'])){throw new db[(_0xc7d3('0x83'))]['ValidationError'](_0xc7d3('0x8a'));}if(_[_0xc7d3('0x72')](_0x5d2df8['body']['body'])||_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x50')]===''){throw new db['Sequelize']['ValidationError'](_0xc7d3('0x8b'));}if(_[_0xc7d3('0x72')](_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')])){throw new db[(_0xc7d3('0x83'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b9f8b);}if(!_['includes'](_0x1b9f8b,_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')])){throw new db[(_0xc7d3('0x83'))]['ValidationError'](_0xc7d3('0x8d')+_0x1b9f8b);}_0x217f4b[_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')]]=_0x5d2df8['body'][_0xc7d3('0x8e')];})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x5d2df8['params']['id']},'include':[{'model':db[_0xc7d3('0x8f')],'as':_0xc7d3('0x90'),'include':[{'model':db[_0xc7d3('0x91')],'as':_0xc7d3('0x92'),'where':_0x217f4b,'limit':0x1,'order':[[_0xc7d3('0x88'),_0xc7d3('0x93')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1b59a3,null))[_0xc7d3('0x16')](function(_0x77810e){if(_0x77810e&&_0x77810e['List']){_0x2d23f4[_0xc7d3('0x94')]=_0x77810e;_0x2d23f4[_0xc7d3('0x95')]=_0x77810e['Applications'];_0x2d23f4[_0xc7d3('0x96')]=_0x77810e[_0xc7d3('0x90')];_0x2d23f4['applications']=_[_0xc7d3('0x97')](_0x2d23f4[_0xc7d3('0x95')],[_0xc7d3('0x98')],[_0xc7d3('0x99')]);if(_0x2d23f4[_0xc7d3('0x94')][_0xc7d3('0x9a')]){delete _0x2d23f4[_0xc7d3('0x94')]['Applications'];}if(_0x2d23f4[_0xc7d3('0x94')]['List']&&_0x2d23f4[_0xc7d3('0x94')]['List'][_0xc7d3('0x92')]['length']){return _0x2d23f4[_0xc7d3('0x94')][_0xc7d3('0x90')][_0xc7d3('0x92')][0x0];}var _0x5e6107=_[_0xc7d3('0xe')](_0x5d2df8[_0xc7d3('0x50')],{'firstName':_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8e')],'ListId':_0x77810e[_0xc7d3('0x9b')]});_0x5e6107[_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')]]=_0x5d2df8['body']['from'];return db[_0xc7d3('0x91')]['create'](_0x5e6107,{'fields':_0x1b8839,'raw':!![]});}})[_0xc7d3('0x16')](handleEntityNotFound(_0x1b59a3,null))[_0xc7d3('0x16')](function(_0x51971f){_0x2d23f4['contact']=_0x51971f;var _0x5108df=_0x5d2df8['body'][_0xc7d3('0x9c')];if(_0x5d2df8[_0xc7d3('0x9d')][_0xc7d3('0x9e')]){_0x5108df=_0x5d2df8['headers'][_0xc7d3('0x9e')];}else if(_0x5d2df8['headers'][_0xc7d3('0x9f')]){_0x5108df=_[_0xc7d3('0xa0')](_0x5d2df8['headers'][_0xc7d3('0x9f')]['split'](','));}if(_0x51971f){var _0x594227={'ContactId':_0x51971f['id'],'ChatWebsiteId':_0x5d2df8[_0xc7d3('0x4a')]['id'],'from':(_0x51971f[_0xc7d3('0xa1')]||'')+'\x20'+(_0x51971f['lastName']||''),'customerIp':_0x5108df,'customerPort':_0x5d2df8[_0xc7d3('0x9d')][_0xc7d3('0xa2')]?_0x5d2df8['headers']['x-real-port']:null,'referer':_0x5d2df8[_0xc7d3('0x50')]['referer'],'browserName':_0x5d4532['browser'][_0xc7d3('0x2e')]&&_0x5d4532['browser'][_0xc7d3('0xa3')]?util['format'](_0xc7d3('0xa4'),_0x5d4532[_0xc7d3('0xa5')][_0xc7d3('0x2e')],_0x5d4532[_0xc7d3('0xa5')]['version']):_0xc7d3('0xa6'),'browserVersion':_0x5d4532[_0xc7d3('0xa5')]['version']||'unknown','osName':util[_0xc7d3('0xa7')](_0xc7d3('0xa4'),_0x5d4532['os'][_0xc7d3('0x2e')],_0x5d4532['os'][_0xc7d3('0xa3')]),'osVersion':_0x5d4532['os'][_0xc7d3('0xa3')],'deviceModel':_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0x36')]&&_0x5d4532[_0xc7d3('0xa8')]['vendor']?util['format'](_0xc7d3('0xa9'),_0x5d4532[_0xc7d3('0xa8')]['model'],_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0xaa')],_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0x34')]):null,'deviceVendor':_0x5d4532['device'][_0xc7d3('0xaa')],'deviceType':_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0x34')],'formData':JSON[_0xc7d3('0x1c')](_0x5d2df8['body'])};var _0x184afb={'ChatWebsiteId':_0x5d2df8['params']['id'],'closed':![]};if(_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')]){_0x184afb['threadId']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')];return db[_0xc7d3('0xac')][_0xc7d3('0x4e')]({'where':_0x184afb})[_0xc7d3('0x16')](function(_0x3c3dd1){if(_0x3c3dd1){return[_0x3c3dd1,![]];}_0x594227[_0xc7d3('0xab')]=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')];_0x594227['externalUrl']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xad')];return db['ChatInteraction'][_0xc7d3('0x4f')](_0x594227)[_0xc7d3('0x16')](function(_0x2dda52){return[_0x2dda52,!![]];});});}_0x184afb[_0xc7d3('0xae')]=_0x51971f['id'];if(_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xaf')]&&_0x5d2df8[_0xc7d3('0x50')]['interaction']['id']){_0x184afb['id']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xaf')]['id'];return db['ChatInteraction'][_0xc7d3('0x4e')]({'where':_0x184afb})[_0xc7d3('0x16')](function(_0x43ef89){if(_0x43ef89){return[_0x43ef89,![]];}return db[_0xc7d3('0xac')][_0xc7d3('0x4f')](_0x594227)['then'](function(_0x143f5c){return[_0x143f5c,!![]];});});}return db[_0xc7d3('0xac')][_0xc7d3('0x4f')](_0x594227)['then'](function(_0x4ef1d1){return[_0x4ef1d1,!![]];});}})['spread'](function(_0x18f459,_0x5219fd){if(_0x18f459){_0x37cf4=_0x5219fd;if(!_0x5219fd){var _0x56f6d={'from':(_0x2d23f4[_0xc7d3('0xb0')][_0xc7d3('0xa1')]||'')+'\x20'+(_0x2d23f4[_0xc7d3('0xb0')][_0xc7d3('0xb1')]||'')};if(_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')]&&_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xb2')]&&_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')]!=_0x5d2df8['body'][_0xc7d3('0xb2')]){_0x56f6d['threadId']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xb2')];}return _0x18f459[_0xc7d3('0xb3')](_0x56f6d);}else{return _0x18f459;}}})[_0xc7d3('0x16')](function(_0x462f8e){_0x2d23f4['interaction']=_0x462f8e[_0xc7d3('0x2c')]({'plain':!![]});_0x2d23f4[_0xc7d3('0xaf')][_0xc7d3('0xb4')]=_0x37cf4;if(_0x2d23f4[_0xc7d3('0xaf')]['created']){if(_0x2d23f4[_0xc7d3('0x94')][_0xc7d3('0xb5')]){_0x2d23f4[_0xc7d3('0x95')][_0xc7d3('0xb6')]({'id':0x0,'priority':_0x2d23f4[_0xc7d3('0x95')][_0xc7d3('0x3d')]+0x1,'app':_0xc7d3('0xb7'),'appdata':_0xc7d3('0xb8'),'interval':_0xc7d3('0xb9')});}}return db[_0xc7d3('0xba')][_0xc7d3('0x4f')]({'body':_0x5d2df8['body'][_0xc7d3('0x50')],'ChatWebsiteId':_0x5d2df8[_0xc7d3('0x4a')]['id'],'ChatInteractionId':_0x462f8e['id'],'direction':'in','ContactId':_0x2d23f4['contact']['id'],'AttachmentId':_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xbb')]});})['then'](function(_0x1cbf52){_0x2d23f4['message']=_0x1cbf52;if(_0x2d23f4['interaction'][_0xc7d3('0xbc')]){return db[_0xc7d3('0xbd')][_0xc7d3('0x4e')]({'attributes':['id','name'],'where':{'id':_0x2d23f4[_0xc7d3('0xaf')][_0xc7d3('0xbc')]}})[_0xc7d3('0x16')](function(_0x368b01){if(_0x368b01){_0x2d23f4[_0xc7d3('0x95')][_0xc7d3('0xbe')]({'id':0x0,'priority':0x0,'app':_0xc7d3('0xbf'),'appdata':_0x368b01[_0xc7d3('0x2e')]+','+(_0x2d23f4[_0xc7d3('0x94')]['waitForTheAssignedAgent']||0xa),'interval':_0xc7d3('0xb9')});_0x2d23f4['forcedOwnership']=!![];}return respondWithRpcPromise(_0xc7d3('0xc0'),'startRouting',_0x2d23f4);});}return respondWithRpcPromise(_0xc7d3('0xc0'),_0xc7d3('0xc1'),_0x2d23f4);})[_0xc7d3('0x16')](function(_0x28f84c){respondWithRpcPromise('EventManager',_0xc7d3('0xc2'),{'event':_0xc7d3('0x7e'),'message':_0x28f84c},client9002);return _0x28f84c;})[_0xc7d3('0x16')](respondWithResult(_0x1b59a3,null))[_0xc7d3('0x21')](handleError(_0x1b59a3,null));};exports[_0xc7d3('0xc3')]=function(_0x6b9b0f,_0x301bd9){var _0xbc6246,_0x4b9aff,_0x5dda8d;var _0x19c11c=[];var _0x49714f={};var _0x416352=_0x6b9b0f[_0xc7d3('0xc4')]||[];var _0x4c9f67=[];var _0x399e02;return db[_0xc7d3('0x91')][_0xc7d3('0x58')]()[_0xc7d3('0x16')](function(_0x3fd0f9){if(!_0x3fd0f9){throw new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))](_0xc7d3('0x85'));}_0x19c11c=_[_0xc7d3('0x86')](_[_0xc7d3('0x37')](_0x3fd0f9),[_0xc7d3('0x87'),_0xc7d3('0x88'),_0xc7d3('0x89'),_0xc7d3('0x9b')]);if(_0x6b9b0f['body']['id']){delete _0x6b9b0f[_0xc7d3('0x50')]['id'];}if(_[_0xc7d3('0x72')](_0x6b9b0f[_0xc7d3('0x50')]['from'])){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)[_0xc7d3('0xc5')](new db[(_0xc7d3('0x83'))]['ValidationError'](_0xc7d3('0x8a')));}if(_['isNil'](_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x50')])||_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x50')]===''){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)['send'](new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))](_0xc7d3('0x8b')));}if(_[_0xc7d3('0x72')](_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')])){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)['send'](new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c11c));}if(!_[_0xc7d3('0xc7')](_0x19c11c,_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')])){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)['send'](new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c11c));}_0x49714f[_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')]]=_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x8e')];})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x6b9b0f[_0xc7d3('0x4a')]['id']},'include':[{'model':db[_0xc7d3('0x8f')],'as':_0xc7d3('0x90')},{'model':db['MailAccount'],'as':_0xc7d3('0xc8')}]});})[_0xc7d3('0x16')](handleEntityNotFound(_0x301bd9,null))['then'](function(_0x13bedb){if(_0x13bedb&&_0x13bedb[_0xc7d3('0x90')]){_0x4b9aff=_0x13bedb;var _0x37839c=_['defaults'](_0x6b9b0f[_0xc7d3('0x50')],{'firstName':_0x6b9b0f[_0xc7d3('0x50')]['from'],'phone':_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x8e')],'ListId':_0x13bedb['ListId']});_0x37839c[_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')]]=_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x8e')];return db[_0xc7d3('0x91')][_0xc7d3('0xc9')]({'where':_0x49714f,'defaults':_0x37839c});}})[_0xc7d3('0xca')](function(_0x37947b){if(_0x37947b){_0x5dda8d=_0x37947b;var _0x178649=fs[_0xc7d3('0xcb')](path[_0xc7d3('0x6b')](config['root'],_0xc7d3('0xcc')),_0xc7d3('0xcd'));var _0x1056b3=ejs[_0xc7d3('0xce')](_0x178649,{'body':_[_0xc7d3('0xcf')](_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x50')]),'bodyTitle':_0x4b9aff[_0xc7d3('0xd0')]});return db['ChatOfflineMessage']['create']({'body':_0x1056b3,'ContactId':_0x37947b['id'],'ChatWebsiteId':_0x4b9aff['id']});}})[_0xc7d3('0x16')](function(_0x413810){_0x399e02=_0x413810;if(_0x416352[_0xc7d3('0x3d')]){var _0x53b38f=_0x416352[_0xc7d3('0x31')](function(_0x559f2e){return{'name':_0x559f2e[_0xc7d3('0xd1')],'basename':_0x559f2e[_0xc7d3('0x66')],'type':_0x559f2e['mimetype'],'ChatOfflineMessageId':_0x413810['id']};});_0x4c9f67=_0x53b38f[_0xc7d3('0x31')](_0x31140f=>{var _0x340738={'filename':_0x31140f[_0xc7d3('0x2e')],'path':path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0xd2'),_0xc7d3('0xc4'),'attachments',_0xc7d3('0xd3'),_0x31140f[_0xc7d3('0xd4')])};return _0x340738;});if(!_0x4b9aff[_0xc7d3('0xd5')]){return db['sequelize'][_0xc7d3('0xd6')](function(_0x298451){return db[_0xc7d3('0xd7')][_0xc7d3('0xd8')](_0x53b38f,{'transaction':_0x298451});});}}})[_0xc7d3('0x16')](function(){if(_0x399e02){_0xbc6246=_0x399e02;return db[_0xc7d3('0xc8')][_0xc7d3('0x5c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc7d3('0xd9'),'raw':!![]}]});}})[_0xc7d3('0x16')](function(_0x1bf9dc){if(_0x1bf9dc&&_0x1bf9dc[_0xc7d3('0xd9')]&&_0x4b9aff[_0xc7d3('0xda')]&&_0x4b9aff[_0xc7d3('0xdb')]){var _0x1adbf7={'tls':{'rejectUnauthorized':![]}};if(_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdc')]){_0x1adbf7[_0xc7d3('0xdc')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdc')];}else{_0x1adbf7[_0xc7d3('0xdd')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdd')];_0x1adbf7[_0xc7d3('0xde')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xde')];_0x1adbf7[_0xc7d3('0xdf')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdf')];}if(_0x1bf9dc['Smtp'][_0xc7d3('0xe0')]){_0x1adbf7[_0xc7d3('0xe1')]={'user':_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0x51')],'pass':_0x1bf9dc['Smtp']['pass']};}return respondWithRpcPromise(_0xc7d3('0xe2'),'sendMail',{'account':_0x1adbf7,'message':{'from':util['format'](_0xc7d3('0xe3'),_0x1bf9dc['name'],_0x1bf9dc[_0xc7d3('0xe4')]||_0x1bf9dc[_0xc7d3('0xd9')]['user']),'to':_0x4b9aff[_0xc7d3('0xdb')],'subject':_0x4b9aff['offlineMessageSubject'],'html':_0xbc6246[_0xc7d3('0x50')],'attachments':_0x4c9f67}},client9003)[_0xc7d3('0x16')](function(){return _0xbc6246;})[_0xc7d3('0x21')](function(_0x48afae){console['error'](_0x48afae);});}})['then'](function(){if(_0x4b9aff&&_0x4b9aff['openNewInteraction']&&_0x4b9aff['MailAccountId']){var _0x126c79=[];if(_0x416352['length']){_0x126c79=_0x416352['map'](function(_0x43d4bd){return{'name':_0x43d4bd[_0xc7d3('0xd1')],'basename':_0x43d4bd[_0xc7d3('0x66')],'type':_0x43d4bd[_0xc7d3('0xe5')],'ChatOfflineMessageId':_0x399e02['id']};});}var _0x4abc97;if(!_[_0xc7d3('0x72')](_0x4b9aff[_0xc7d3('0xe6')])){var _0x38afc6=_[_0xc7d3('0x31')](_0x6b9b0f['body'],function(_0x28a10e){return _0x28a10e;});var _0x51e298=_['toPairsIn'](_0x38afc6)[0x0];var _0x275e78=_[_0xc7d3('0xe7')](_0x51e298,function(_0x1325d0){return _0x1325d0;});_0x4abc97=_0x275e78[0x1][_0x4b9aff['subjectOffline']];}var _0x16c1a9={'from':_0x5dda8d[_0xc7d3('0xe4')],'firstName':_0x5dda8d[_0xc7d3('0xa1')],'lastName':_0x5dda8d[_0xc7d3('0xb1')],'mapKey':_0xc7d3('0xe4'),'message':{'from':_0x5dda8d[_0xc7d3('0xe4')],'to':_0x4b9aff[_0xc7d3('0xc8')][_0xc7d3('0xe4')],'cc':'','subject':_[_0xc7d3('0x72')](_0x4abc97)?_0x4b9aff[_0xc7d3('0xe8')]:_0x4abc97,'messageId':'','sentAt':new Date(),'attach':_0x126c79[_0xc7d3('0x3d')],'attachments':_0x126c79,'originChannel':_0xc7d3('0xe9'),'ChatWebsiteId':_0x4b9aff['id'],'ChatOfflineMessageId':_0xbc6246['id'],'originTo':_0x4b9aff['MailAccount'][_0xc7d3('0xe4')]},'body':_0xbc6246[_0xc7d3('0x50')]};var _0x1f1670={'account':{'id':_0x4b9aff['MailAccountId']},'body':_0x16c1a9,'log':_0xc7d3('0xea')};return respondWithRpcPromise('NotifyMailAccount',_0xc7d3('0xeb'),_0x1f1670,client9001)['then'](function(){return _0xbc6246;})['catch'](function(_0x3acab2){console['error'](_0x3acab2);});}return;})[_0xc7d3('0x16')](function(){if(_0xbc6246){return _0xbc6246;}})['then'](respondWithResult(_0x301bd9,null))[_0xc7d3('0x21')](function(_0x2ac673){console['error']('catch',_0x2ac673);for(var _0x1b91f0 of _0x416352){var _0x1d18fb=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0xd2'),_0xc7d3('0xc4'),_0xc7d3('0xec'),_0xc7d3('0xd3'),_0x1b91f0[_0xc7d3('0x66')]);fs_extra['remove'](_0x1d18fb)['catch'](function(_0x5781ec){console[_0xc7d3('0x1d')](_0xc7d3('0xed'),_0x1d18fb,_0x5781ec);});}});};exports[_0xc7d3('0xee')]=function(_0x15229c,_0x22c0e7){return db['ChatInteraction']['find']({'where':{'id':_0x15229c[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x22c0e7,null))['then'](function(_0x3a6720){if(_0x3a6720){return _0x3a6720[_0xc7d3('0xee')](_0x15229c[_0xc7d3('0x50')][_0xc7d3('0x5f')],_['omit'](_0x15229c[_0xc7d3('0x50')],[_0xc7d3('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x22c0e7,null))[_0xc7d3('0x21')](handleError(_0x22c0e7,null));};exports['getInteractions']=function(_0x1d86dd,_0x228a69){var _0x83456a={'raw':![],'where':{}};var _0x462c1d={};var _0x49ff2e={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x1d86dd['params']['id']}})['then'](handleEntityNotFound(_0x228a69,null))[_0xc7d3('0x16')](function(_0x59fd36){if(_0x59fd36){_0x462c1d[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0xac')][_0xc7d3('0x4c')]);_0x462c1d['query']=_[_0xc7d3('0x37')](_0x1d86dd[_0xc7d3('0x38')]);_0x462c1d[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x462c1d[_0xc7d3('0x36')],_0x462c1d[_0xc7d3('0x38')]);_0x83456a[_0xc7d3('0x3b')]=_['intersection'](_0x462c1d[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x3c')]));_0x83456a['attributes']=_0x83456a[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x83456a[_0xc7d3('0x3b')]:_0x462c1d[_0xc7d3('0x36')];if(!_0x1d86dd['query']['hasOwnProperty'](_0xc7d3('0x3e'))){_0x83456a[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x83456a[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x83456a[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x1d86dd['query'][_0xc7d3('0x40')]);_0x83456a[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_['pick'](_0x1d86dd[_0xc7d3('0x38')],_0x462c1d[_0xc7d3('0x39')]));_0x83456a['where'][_0xc7d3('0x5a')]=_0x59fd36['id'];if(_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x83456a[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x83456a[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x83456a[_0xc7d3('0x3b')],function(_0x51969a){var _0x484791={};_0x484791[_0x51969a]={'$like':'%'+_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x484791;})});}_0x83456a=_[_0xc7d3('0x44')]({},_0x83456a,_0x1d86dd[_0xc7d3('0x46')]);return db[_0xc7d3('0xac')][_0xc7d3('0x29')]({'where':_0x83456a[_0xc7d3('0x41')]})['then'](function(_0x5b8068){_0x49ff2e[_0xc7d3('0x29')]=_0x5b8068;if(_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x83456a[_0xc7d3('0x4d')]=[{'model':db[_0xc7d3('0x91')],'as':_0xc7d3('0xef'),'required':![]},{'model':db[_0xc7d3('0xbd')],'as':'Owner','attributes':[_0xc7d3('0x2e'),_0xc7d3('0xf0'),'internal'],'required':![]},{'model':db[_0xc7d3('0xf1')],'as':_0xc7d3('0xf2'),'attributes':['id',_0xc7d3('0x2e'),_0xc7d3('0xf3')],'where':_0x1d86dd['query'][_0xc7d3('0xf4')]?{'id':_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0xf4')]}:undefined,'required':_0x1d86dd['query'][_0xc7d3('0xf4')]?!![]:![]}];}return db[_0xc7d3('0xac')][_0xc7d3('0xf5')](_0x83456a);})[_0xc7d3('0x16')](function(_0xe8abc0){_0x49ff2e[_0xc7d3('0x48')]=_0xe8abc0;return _0x49ff2e;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x228a69,_0x83456a))[_0xc7d3('0x21')](handleError(_0x228a69,null));};function iftimePromise(_0x2db96a,_0xfb8db8){return respondWithRpcPromise('Command',_0xc7d3('0xf6'),{'command':_0xfb8db8[_0xc7d3('0xf7')]?util[_0xc7d3('0xa7')]('iftime\x20%s,%s',_0x2db96a[_0xc7d3('0xf8')],_0xfb8db8['timezone']):util[_0xc7d3('0xa7')](_0xc7d3('0xf9'),_0x2db96a[_0xc7d3('0xf8')])},client9002)[_0xc7d3('0x16')](function(_0x13670a){var _0x268060=_0x13670a&&_0x13670a[_0xc7d3('0xfa')](_0xc7d3('0xfb'))>=0x0?!![]:![];logger[_0xc7d3('0x17')](_0xc7d3('0xfc'),_0xfb8db8['id'],_0x2db96a['id'],_0x2db96a[_0xc7d3('0xf8')],_0x268060?_0xc7d3('0xfd'):_0xc7d3('0xfe'),_0xfb8db8['timezone']?_0xfb8db8[_0xc7d3('0xf7')]:'No\x20timezone');return _0x268060;})['catch'](function(_0x29b515){logger[_0xc7d3('0x1d')](_0xc7d3('0xfc'),_0xfb8db8['id'],_0x2db96a['id'],_0x2db96a[_0xc7d3('0xf8')],util[_0xc7d3('0xff')](_0x29b515,{'showHidden':![],'depth':null}),_0xfb8db8[_0xc7d3('0xf7')]?_0xfb8db8[_0xc7d3('0xf7')]:_0xc7d3('0x100'));return![];});}exports[_0xc7d3('0xf6')]=function(_0x564d90,_0x65f739){var _0x2ea6a9=0x0;var _0x424ce4=0x0;var _0x22b5e3=![];var _0x48e2a0;var _0x3be01d;return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x564d90[_0xc7d3('0x4a')]['id']},'include':[{'model':db[_0xc7d3('0x101')],'as':'Interval','include':[{'model':db[_0xc7d3('0x101')],'as':_0xc7d3('0x102'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xc7d3('0x16')](handleEntityNotFound(_0x65f739,null))[_0xc7d3('0x16')](function(_0x1dbc79){if(_0x1dbc79){_0x48e2a0=_0x1dbc79;return _0x1dbc79[_0xc7d3('0x103')]({'raw':!![]});}})[_0xc7d3('0x16')](function(_0x59b25e){if(_0x48e2a0){if(_0x59b25e){_0x3be01d=_0x59b25e;}}return require(_0xc7d3('0x6f'))[_0xc7d3('0x70')]();})[_0xc7d3('0x16')](function(_0x4d13cc){if(_0x4d13cc){_0x424ce4=_0x4d13cc['virtual'];_0x22b5e3=_0x4d13cc[_0xc7d3('0x71')];}})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0xac')][_0xc7d3('0x29')]({'where':{'closed':![]}});})['then'](function(_0xa75fc6){_0x2ea6a9=_0xa75fc6;if(_0x424ce4&&_0xa75fc6>_0x424ce4){return db[_0xc7d3('0x104')][_0xc7d3('0x5c')]({'where':{'id':0x1}})[_0xc7d3('0x16')](function(_0x5a62db){if(_0x5a62db){_0x5a62db[_0xc7d3('0x105')](_0xc7d3('0x106'));}});}})[_0xc7d3('0x16')](function(){if(_0x48e2a0[_0xc7d3('0x101')]&&_0x48e2a0[_0xc7d3('0x101')]['Intervals']){var _0x2adff0=[];for(var _0x1eb873=0x0;_0x1eb873<_0x48e2a0[_0xc7d3('0x101')][_0xc7d3('0x102')][_0xc7d3('0x3d')];_0x1eb873++){var _0x860648=_0x48e2a0['Interval'][_0xc7d3('0x102')][_0x1eb873]['get']({'plain':!![]});_0x2adff0[_0xc7d3('0xb6')](iftimePromise(_0x860648,_0x48e2a0));}return BPromise['all'](_0x2adff0)[_0xc7d3('0x16')](function(_0x294582){return _[_0xc7d3('0x107')](_0x294582);});}else{return!![];}})['then'](function(_0x39acbb){var _0x154003=fs[_0xc7d3('0xcb')](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x108')),_0xc7d3('0xcd'));var _0x461156={'remote':_0x48e2a0['remote'],'query':querystring[_0xc7d3('0x1c')](_[_0xc7d3('0x44')](_0x48e2a0[_0xc7d3('0x2c')]({'plain':!![]}),{'customerIp':_0x564d90[_0xc7d3('0x9d')]['x-forwarded-for']||_0x564d90[_0xc7d3('0x9d')][_0xc7d3('0x109')]||_0x564d90[_0xc7d3('0x10a')][_0xc7d3('0x10b')]||_0x564d90['ip'],'referer':_0x564d90[_0xc7d3('0x9d')][_0xc7d3('0x10c')],'openedInteractions':_0x2ea6a9,'maxInteractions':_0x424ce4,'virtual':_0x22b5e3[_0xc7d3('0x10d')],'online':_0x39acbb,'custom':_0x22b5e3}))[_0xc7d3('0x10e')](/'/g,'\x5c\x27')};_0x65f739[_0xc7d3('0xc5')](ejs['render'](Mustache[_0xc7d3('0xce')](_0x154003,_0x461156),{'proactiveActions':_0x3be01d,'alignment':_0x48e2a0[_0xc7d3('0x10f')],'verticalAlignment':_0x48e2a0[_0xc7d3('0x110')],'div_color':_0x48e2a0['color'],'text_color':_0x48e2a0[_0xc7d3('0x111')],'button_color':_0x48e2a0['color_button'],'background_color':_0x48e2a0[_0xc7d3('0x112')]}));})['catch'](handleError(_0x65f739,null));};exports[_0xc7d3('0x113')]=function(_0x5b2a02,_0x427880){var _0x2e8a86=_0x5b2a02[_0xc7d3('0x4a')]['id'];var _0x4d4d7a=_0x5b2a02['body'];var _0x185131=0xc8;var _0x974d13=null;return db[_0xc7d3('0x114')][_0xc7d3('0xd6')]({'isolationLevel':db['sequelize'][_0xc7d3('0x115')][_0xc7d3('0x116')][_0xc7d3('0x117')]},function(_0x19e728){return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x2e8a86},'transaction':_0x19e728})[_0xc7d3('0x16')](function(_0x14f63e){if(_0x14f63e){return db[_0xc7d3('0x118')]['destroy']({'where':{'ChatWebsiteId':_0x2e8a86},'transaction':_0x19e728})[_0xc7d3('0x16')](function(){var _0x4b8af4=_['map'](_0x4d4d7a,function(_0x34b83a){_0x34b83a[_0xc7d3('0x5a')]=_0x2e8a86;return _0x34b83a;});return db[_0xc7d3('0x118')]['bulkCreate'](_0x4b8af4,{'transaction':_0x19e728});});}else{_0x185131=0x194;_0x974d13=[];}});})[_0xc7d3('0x16')](function(){if(_0x185131!==0x194){return db[_0xc7d3('0x118')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2e8a86},'order':_0xc7d3('0x98')})[_0xc7d3('0x16')](function(_0x7a2e84){_0x974d13=_0x7a2e84;});}})[_0xc7d3('0x21')](function(_0x4e5e2b){_0x185131=0x1f4;logger['error'](_0x4e5e2b['stack']);if(_0x4e5e2b[_0xc7d3('0x2e')]){delete _0x4e5e2b[_0xc7d3('0x2e')];}_0x974d13=_0x4e5e2b;})['finally'](function(){if(_0x974d13===null){_0x427880['sendStatus'](_0x185131);}else{if(_0x185131===0x1f4){_0x427880[_0xc7d3('0x24')](_0x185131)[_0xc7d3('0xc5')](_0x974d13);}else{_0x427880[_0xc7d3('0x24')](_0x185131)[_0xc7d3('0x25')](_0x974d13);}}});};exports[_0xc7d3('0x119')]=function(_0x77c62d,_0x2bd357){var _0x325ebe={};var _0x5cf3ec={};var _0x38b02e;var _0x1c31ba;return db['ChatWebsite'][_0xc7d3('0x5c')]({'where':{'id':_0x77c62d['params']['id']}})['then'](handleEntityNotFound(_0x2bd357,null))[_0xc7d3('0x16')](function(_0x3f9fc2){if(_0x3f9fc2){_0x38b02e=_0x3f9fc2;_0x5cf3ec[_0xc7d3('0x36')]=_[_0xc7d3('0x37')](db['ChatApplication'][_0xc7d3('0x4c')]);_0x5cf3ec[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x77c62d['query']);_0x5cf3ec[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x5cf3ec[_0xc7d3('0x36')],_0x5cf3ec[_0xc7d3('0x38')]);_0x325ebe['attributes']=_['intersection'](_0x5cf3ec['model'],qs[_0xc7d3('0x3c')](_0x77c62d['query'][_0xc7d3('0x3c')]));_0x325ebe[_0xc7d3('0x3b')]=_0x325ebe[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x325ebe['attributes']:_0x5cf3ec[_0xc7d3('0x36')];_0x325ebe[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x77c62d[_0xc7d3('0x38')]['sort']);_0x325ebe['where']=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x77c62d[_0xc7d3('0x38')],_0x5cf3ec['filters']));if(_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x325ebe['where']=_[_0xc7d3('0x44')](_0x325ebe[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x325ebe[_0xc7d3('0x3b')],function(_0x6b7cc8){var _0x421c21={};_0x421c21[_0x6b7cc8]={'$like':'%'+_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x421c21;})});}_0x325ebe=_[_0xc7d3('0x44')]({},_0x325ebe,_0x77c62d[_0xc7d3('0x46')]);return _0x38b02e['getApplications'](_0x325ebe);}})[_0xc7d3('0x16')](function(_0x5edc8b){if(_0x5edc8b){_0x1c31ba=_0x5edc8b[_0xc7d3('0x3d')];if(!_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x325ebe[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x77c62d['query']['limit']);_0x325ebe[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x26')]);}return _0x38b02e[_0xc7d3('0x119')](_0x325ebe);}})[_0xc7d3('0x16')](function(_0x34ff8a){if(_0x34ff8a){return _0x34ff8a?{'count':_0x1c31ba,'rows':_0x34ff8a}:null;}})[_0xc7d3('0x16')](respondWithResult(_0x2bd357,null))[_0xc7d3('0x21')](handleError(_0x2bd357,null));};exports[_0xc7d3('0x11a')]=function(_0x764a1e,_0x3fd815){return db['chatProactiveAction']['find']({'where':{'id':_0x764a1e[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x3fd815,null))[_0xc7d3('0x16')](function(_0x37a4f6){if(_0x37a4f6){return _0x37a4f6['addProactiveActions'](_0x764a1e[_0xc7d3('0x50')][_0xc7d3('0x5f')],_['omit'](_0x764a1e[_0xc7d3('0x50')],[_0xc7d3('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x3fd815,null))[_0xc7d3('0x21')](handleError(_0x3fd815,null));};exports[_0xc7d3('0x103')]=function(_0x47d417,_0x54fa9a){var _0x3420ac={};var _0x2ecf23={};var _0x5bf6c2;var _0x39cf2b;return db[_0xc7d3('0x32')]['findOne']({'where':{'id':_0x47d417[_0xc7d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x54fa9a,null))[_0xc7d3('0x16')](function(_0x1e494a){if(_0x1e494a){_0x5bf6c2=_0x1e494a;_0x2ecf23[_0xc7d3('0x36')]=_[_0xc7d3('0x37')](db['ChatProactiveAction'][_0xc7d3('0x4c')]);_0x2ecf23[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x47d417[_0xc7d3('0x38')]);_0x2ecf23[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x2ecf23[_0xc7d3('0x36')],_0x2ecf23[_0xc7d3('0x38')]);_0x3420ac[_0xc7d3('0x3b')]=_['intersection'](_0x2ecf23['model'],qs[_0xc7d3('0x3c')](_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x3c')]));_0x3420ac[_0xc7d3('0x3b')]=_0x3420ac['attributes'][_0xc7d3('0x3d')]?_0x3420ac[_0xc7d3('0x3b')]:_0x2ecf23['model'];_0x3420ac[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x47d417[_0xc7d3('0x38')]['sort']);_0x3420ac[_0xc7d3('0x41')]=qs['filters'](_['pick'](_0x47d417[_0xc7d3('0x38')],_0x2ecf23[_0xc7d3('0x39')]));if(_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x3420ac[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x3420ac[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x3420ac[_0xc7d3('0x3b')],function(_0x34ff1f){var _0x51ee76={};_0x51ee76[_0x34ff1f]={'$like':'%'+_0x47d417['query']['filter']+'%'};return _0x51ee76;})});}_0x3420ac=_[_0xc7d3('0x44')]({},_0x3420ac,_0x47d417['options']);return _0x5bf6c2[_0xc7d3('0x103')](_0x3420ac);}})[_0xc7d3('0x16')](function(_0x419b73){if(_0x419b73){_0x39cf2b=_0x419b73['length'];if(!_0x47d417['query'][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x3420ac[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x3420ac[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x26')]);}return _0x5bf6c2[_0xc7d3('0x103')](_0x3420ac);}})[_0xc7d3('0x16')](function(_0x46a695){if(_0x46a695){return _0x46a695?{'count':_0x39cf2b,'rows':_0x46a695}:null;}})[_0xc7d3('0x16')](respondWithResult(_0x54fa9a,null))[_0xc7d3('0x21')](handleError(_0x54fa9a,null));};exports['getFields']=function(_0x407ec7,_0x277b32){var _0x59f994=_0x407ec7[_0xc7d3('0x38')][_0xc7d3('0x11b')]===_0xc7d3('0x11c')?_0xc7d3('0x11d'):'onlineForm';return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'attributes':['id',_0x59f994],'where':{'id':_0x407ec7[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x277b32,null))[_0xc7d3('0x16')](function(_0x43afc4){if(_0x43afc4){var _0x298090=_0x43afc4[_0x59f994];var _0x569feb=_0x298090&&_0x298090['items']?_0x298090['items']:[];_0x277b32[_0xc7d3('0xc5')]({'fromKey':_[_0xc7d3('0x72')](_0x298090[_0xc7d3('0x11e')])?undefined:_0x298090['fromKey'],'count':_0x569feb['length'],'rows':_0x569feb});}})[_0xc7d3('0x21')](handleError(_0x277b32,null));};exports[_0xc7d3('0x11f')]=function(_0x3968e6,_0x332f2c){var _0x4c808b={'raw':![],'where':{}};var _0x1d23c9={};var _0x49c8e6={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x3968e6[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x332f2c,null))[_0xc7d3('0x16')](function(_0x5d8804){if(_0x5d8804){_0x1d23c9[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0x120')][_0xc7d3('0x4c')]);_0x1d23c9['query']=_[_0xc7d3('0x37')](_0x3968e6[_0xc7d3('0x38')]);_0x1d23c9[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x1d23c9[_0xc7d3('0x36')],_0x1d23c9['query']);_0x4c808b[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x1d23c9[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x3968e6['query'][_0xc7d3('0x3c')]));_0x4c808b[_0xc7d3('0x3b')]=_0x4c808b[_0xc7d3('0x3b')]['length']?_0x4c808b['attributes']:_0x1d23c9[_0xc7d3('0x36')];if(!_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x4c808b[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x3968e6[_0xc7d3('0x38')]['limit']);_0x4c808b[_0xc7d3('0x26')]=qs['offset'](_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x4c808b[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x4c808b[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x3968e6[_0xc7d3('0x38')],_0x1d23c9['filters']));_0x4c808b['where'][_0xc7d3('0x5a')]=_0x5d8804['id'];if(_0x3968e6['query']['filter']){_0x4c808b['where']=_[_0xc7d3('0x44')](_0x4c808b[_0xc7d3('0x41')],{'$or':_['map'](_0x4c808b[_0xc7d3('0x3b')],function(_0x3d7952){var _0x3efcb7={};_0x3efcb7[_0x3d7952]={'$like':'%'+_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x3efcb7;})});}_0x4c808b=_['merge']({},_0x4c808b,_0x3968e6[_0xc7d3('0x46')]);return db[_0xc7d3('0x120')][_0xc7d3('0x29')]({'where':_0x4c808b[_0xc7d3('0x41')]})[_0xc7d3('0x16')](function(_0x49a93a){_0x49c8e6[_0xc7d3('0x29')]=_0x49a93a;if(_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x4c808b[_0xc7d3('0x4d')]=[{'all':!![]}];}else{_0x4c808b['include']=[{'model':db[_0xc7d3('0x91')],'as':_0xc7d3('0xef'),'required':![]},{'model':db[_0xc7d3('0xd7')],'as':_0xc7d3('0x121'),'required':![]}];}return db[_0xc7d3('0x120')][_0xc7d3('0xf5')](_0x4c808b);})[_0xc7d3('0x16')](function(_0x287ff3){_0x49c8e6[_0xc7d3('0x48')]=_0x287ff3;return _0x49c8e6;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x332f2c,_0x4c808b))[_0xc7d3('0x21')](handleError(_0x332f2c,null));};exports[_0xc7d3('0x122')]=function(_0x3c3ad8,_0x3ff930){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x3c3ad8['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x3ff930,null))[_0xc7d3('0x16')](function(_0x23c781){if(_0x23c781){return _0x23c781[_0xc7d3('0x122')](_0x3c3ad8[_0xc7d3('0x50')][_0xc7d3('0x5f')],_[_0xc7d3('0x123')](_0x3c3ad8['body'],['ids','id'])||{})[_0xc7d3('0xca')](function(_0x552219){for(var _0x163460=0x0;_0x163460<_0x3c3ad8[_0xc7d3('0x50')][_0xc7d3('0x5f')][_0xc7d3('0x3d')];_0x163460+=0x1){socket[_0xc7d3('0x124')](_0xc7d3('0x125'),{'UserId':Number(_0x3c3ad8[_0xc7d3('0x50')][_0xc7d3('0x5f')][_0x163460]),'ChatWebsiteId':Number(_0x3c3ad8[_0xc7d3('0x4a')]['id'])});}return _0x552219;});}})[_0xc7d3('0x16')](respondWithResult(_0x3ff930,null))[_0xc7d3('0x21')](handleError(_0x3ff930,null));};exports[_0xc7d3('0x126')]=function(_0x3c97f4,_0xe0c856){return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x3c97f4[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0xe0c856,null))[_0xc7d3('0x16')](function(_0x1440ab){if(_0x1440ab){return _0x1440ab['removeAgents'](_0x3c97f4[_0xc7d3('0x38')][_0xc7d3('0x5f')])[_0xc7d3('0x16')](function(){if(_[_0xc7d3('0x127')](_0x3c97f4[_0xc7d3('0x38')][_0xc7d3('0x5f')])){for(var _0xb1c21=0x0;_0xb1c21<_0x3c97f4[_0xc7d3('0x38')][_0xc7d3('0x5f')][_0xc7d3('0x3d')];_0xb1c21+=0x1){socket[_0xc7d3('0x124')](_0xc7d3('0x128'),{'UserId':Number(_0x3c97f4[_0xc7d3('0x38')]['ids'][_0xb1c21]),'ChatWebsiteId':Number(_0x3c97f4[_0xc7d3('0x4a')]['id'])});}}else{socket['emit'](_0xc7d3('0x128'),{'UserId':Number(_0x3c97f4['query'][_0xc7d3('0x5f')]),'ChatWebsiteId':Number(_0x3c97f4['params']['id'])});}});}})['then'](respondWithStatusCode(_0xe0c856,null))['catch'](handleError(_0xe0c856,null));};exports[_0xc7d3('0x129')]=function(_0x5a4bdc,_0x373825){var _0x3e4b4e={};var _0x537635={};var _0x644262;var _0x35a826;return db['ChatWebsite']['findOne']({'where':{'id':_0x5a4bdc['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x373825,null))[_0xc7d3('0x16')](function(_0x455c25){if(_0x455c25){_0x644262=_0x455c25;_0x537635[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0xbd')]['rawAttributes']);_0x537635[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x5a4bdc[_0xc7d3('0x38')]);_0x537635[_0xc7d3('0x39')]=_['intersection'](_0x537635[_0xc7d3('0x36')],_0x537635['query']);_0x3e4b4e[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x537635[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x3c')]));_0x3e4b4e[_0xc7d3('0x3b')]=_0x3e4b4e[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x3e4b4e[_0xc7d3('0x3b')]:_0x537635[_0xc7d3('0x36')];_0x3e4b4e[_0xc7d3('0x3f')]=qs['sort'](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x3e4b4e[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x5a4bdc['query'],_0x537635[_0xc7d3('0x39')]));if(_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x3e4b4e[_0xc7d3('0x41')]=_['merge'](_0x3e4b4e['where'],{'$or':_['map'](_0x3e4b4e[_0xc7d3('0x3b')],function(_0x4b05bc){var _0x31051a={};_0x31051a[_0x4b05bc]={'$like':'%'+_0x5a4bdc['query'][_0xc7d3('0x43')]+'%'};return _0x31051a;})});}_0x3e4b4e=_[_0xc7d3('0x44')]({},_0x3e4b4e,_0x5a4bdc[_0xc7d3('0x46')]);return _0x644262['getAgents'](_0x3e4b4e);}})[_0xc7d3('0x16')](function(_0x5106e1){if(_0x5106e1){_0x35a826=_0x5106e1['length'];if(!_0x5a4bdc['query'][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x3e4b4e[_0xc7d3('0x28')]=qs['limit'](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x3e4b4e[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x26')]);}return _0x644262[_0xc7d3('0x129')](_0x3e4b4e);}})[_0xc7d3('0x16')](function(_0x3e995f){if(_0x3e995f){return _0x3e995f?{'count':_0x35a826,'rows':_0x3e995f}:null;}})['then'](respondWithResult(_0x373825,null))[_0xc7d3('0x21')](handleError(_0x373825,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index c3d6e90..7b5401d 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 _0x891b=['setMaxListeners','update','remove','emit','hasOwnProperty','ChatWebsite'];(function(_0x1bc7ac,_0x1eed0e){var _0x5a35d7=function(_0x1496c6){while(--_0x1496c6){_0x1bc7ac['push'](_0x1bc7ac['shift']());}};_0x5a35d7(++_0x1eed0e);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xb891('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb891('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb891('0x2'),'afterDestroy':_0xb891('0x3')};function emitEvent(_0x1c519f){return function(_0x467558,_0x587bf1,_0x379509){ChatWebsiteEvents[_0xb891('0x4')](_0x1c519f+':'+_0x467558['id'],_0x467558);ChatWebsiteEvents['emit'](_0x1c519f,_0x467558);_0x379509(null);};}for(var e in events){if(events[_0xb891('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x5183=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatWebsite','update'];(function(_0x59e8ab,_0x5333ce){var _0x22d0f6=function(_0x3126e1){while(--_0x3126e1){_0x59e8ab['push'](_0x59e8ab['shift']());}};_0x22d0f6(++_0x5333ce);}(_0x5183,0x13e));var _0x3518=function(_0xd7f264,_0x3d3a65){_0xd7f264=_0xd7f264-0x0;var _0x53efd3=_0x5183[_0xd7f264];return _0x53efd3;};'use strict';var EventEmitter=require(_0x3518('0x0'));var ChatWebsite=require(_0x3518('0x1'))['db'][_0x3518('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3518('0x3'),'afterDestroy':_0x3518('0x4')};function emitEvent(_0x178571){return function(_0x421ab5,_0x5a38df,_0x54eb64){ChatWebsiteEvents[_0x3518('0x5')](_0x178571+':'+_0x421ab5['id'],_0x421ab5);ChatWebsiteEvents[_0x3518('0x5')](_0x178571,_0x421ab5);_0x54eb64(null);};}for(var e in events){if(events[_0x3518('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 903ec0a..418f188 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 _0x955f=['exports','define','ChatWebsite','chat_websites','util','bluebird','path','../../config/environment'];(function(_0x48620e,_0x4bac8d){var _0x5ddd2a=function(_0x390b40){while(--_0x390b40){_0x48620e['push'](_0x48620e['shift']());}};_0x5ddd2a(++_0x4bac8d);}(_0x955f,0x9c));var _0xf955=function(_0x13ee3a,_0x9837f9){_0x13ee3a=_0x13ee3a-0x0;var _0x28b2df=_0x955f[_0x13ee3a];return _0x28b2df;};'use strict';var _=require('lodash');var util=require(_0xf955('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf955('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf955('0x2'));var rimraf=require('rimraf');var config=require(_0xf955('0x3'));var attributes=require('./chatWebsite.attributes');module[_0xf955('0x4')]=function(_0x3208e1,_0x22e4c5){return _0x3208e1[_0xf955('0x5')](_0xf955('0x6'),attributes,{'tableName':_0xf955('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccb6=['../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b6e73,_0x42744e){var _0x4fbbe3=function(_0x47c0d8){while(--_0x47c0d8){_0x3b6e73['push'](_0x3b6e73['shift']());}};_0x4fbbe3(++_0x42744e);}(_0xccb6,0x125));var _0x6ccb=function(_0x3b918b,_0x2edc55){_0x3b918b=_0x3b918b-0x0;var _0x57d988=_0xccb6[_0x3b918b];return _0x57d988;};'use strict';var _=require('lodash');var util=require(_0x6ccb('0x0'));var logger=require(_0x6ccb('0x1'))('api');var moment=require(_0x6ccb('0x2'));var BPromise=require(_0x6ccb('0x3'));var rp=require(_0x6ccb('0x4'));var fs=require('fs');var path=require(_0x6ccb('0x5'));var rimraf=require(_0x6ccb('0x6'));var config=require(_0x6ccb('0x7'));var attributes=require(_0x6ccb('0x8'));module[_0x6ccb('0x9')]=function(_0xcaf6c6,_0x24b5b5){return _0xcaf6c6[_0x6ccb('0xa')]('ChatWebsite',attributes,{'tableName':_0x6ccb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index f70ce0f..8bedf0a 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 _0xa945=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x5213b5,_0x4cbf42){var _0x2f4eae=function(_0x16caaf){while(--_0x16caaf){_0x5213b5['push'](_0x5213b5['shift']());}};_0x2f4eae(++_0x4cbf42);}(_0xa945,0x1ba));var _0x5a94=function(_0x40ea21,_0x352839){_0x40ea21=_0x40ea21-0x0;var _0x52d643=_0xa945[_0x40ea21];return _0x52d643;};'use strict';var _=require(_0x5a94('0x0'));var util=require(_0x5a94('0x1'));var moment=require(_0x5a94('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a94('0x4'));var logger=require(_0x5a94('0x5'))(_0x5a94('0x6'));var config=require(_0x5a94('0x7'));var jayson=require(_0x5a94('0x8'));var client=jayson['client'][_0x5a94('0x9')]({'port':0x232a});config[_0x5a94('0xa')]=_[_0x5a94('0xb')](config['redis'],{'host':_0x5a94('0xc'),'port':0x18eb});var socket=require(_0x5a94('0xd'))(new Redis(config[_0x5a94('0xa')]));require(_0x5a94('0xe'))[_0x5a94('0xf')](socket);function respondWithRpcPromise(_0x492761,_0x43abc1,_0x5e69e3){return new BPromise(function(_0x2b66a5,_0x34d4ca){return client[_0x5a94('0x10')](_0x492761,_0x5e69e3)[_0x5a94('0x11')](function(_0x4ba1ff){logger[_0x5a94('0x12')](_0x5a94('0x13'),_0x43abc1,_0x5a94('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x43abc1,'request\x20sent',JSON[_0x5a94('0x15')](_0x4ba1ff));if(_0x4ba1ff[_0x5a94('0x16')]){if(_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x17')]===0x1f4){logger['error'](_0x5a94('0x13'),_0x43abc1,_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x18')]);return _0x34d4ca(_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x43abc1,_0x4ba1ff[_0x5a94('0x16')]['message']);return _0x2b66a5(_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x18')]);}else{logger[_0x5a94('0x12')](_0x5a94('0x13'),_0x43abc1,_0x5a94('0x14'));_0x2b66a5(_0x4ba1ff[_0x5a94('0x19')][_0x5a94('0x18')]);}})[_0x5a94('0x1a')](function(_0x188694){logger[_0x5a94('0x16')](_0x5a94('0x13'),_0x43abc1,_0x188694);_0x34d4ca(_0x188694);});});} \ No newline at end of file +var _0xb64c=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xdbf272,_0x2ba789){var _0x236b25=function(_0x3c2606){while(--_0x3c2606){_0xdbf272['push'](_0xdbf272['shift']());}};_0x236b25(++_0x2ba789);}(_0xb64c,0x75));var _0xcb64=function(_0x19a631,_0x2bcdbe){_0x19a631=_0x19a631-0x0;var _0x590361=_0xb64c[_0x19a631];return _0x590361;};'use strict';var _=require('lodash');var util=require(_0xcb64('0x0'));var moment=require(_0xcb64('0x1'));var BPromise=require(_0xcb64('0x2'));var rs=require(_0xcb64('0x3'));var fs=require('fs');var Redis=require(_0xcb64('0x4'));var db=require(_0xcb64('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb64('0x6'))(_0xcb64('0x7'));var config=require(_0xcb64('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb64('0x9')]['http']({'port':0x232a});config[_0xcb64('0xa')]=_[_0xcb64('0xb')](config[_0xcb64('0xa')],{'host':_0xcb64('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb64('0xa')]));require(_0xcb64('0xd'))[_0xcb64('0xe')](socket);function respondWithRpcPromise(_0x950ff,_0x2f85ce,_0xae8bc){return new BPromise(function(_0x231bc1,_0x1dc1d1){return client[_0xcb64('0xf')](_0x950ff,_0xae8bc)[_0xcb64('0x10')](function(_0x3abac0){logger[_0xcb64('0x11')](_0xcb64('0x12'),_0x2f85ce,_0xcb64('0x13'));logger[_0xcb64('0x14')](_0xcb64('0x15'),_0x2f85ce,_0xcb64('0x13'),JSON[_0xcb64('0x16')](_0x3abac0));if(_0x3abac0[_0xcb64('0x17')]){if(_0x3abac0[_0xcb64('0x17')][_0xcb64('0x18')]===0x1f4){logger[_0xcb64('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2f85ce,_0x3abac0['error'][_0xcb64('0x19')]);return _0x1dc1d1(_0x3abac0[_0xcb64('0x17')]['message']);}logger[_0xcb64('0x17')](_0xcb64('0x12'),_0x2f85ce,_0x3abac0['error'][_0xcb64('0x19')]);return _0x231bc1(_0x3abac0['error'][_0xcb64('0x19')]);}else{logger[_0xcb64('0x11')](_0xcb64('0x12'),_0x2f85ce,_0xcb64('0x13'));_0x231bc1(_0x3abac0[_0xcb64('0x1a')][_0xcb64('0x19')]);}})[_0xcb64('0x1b')](function(_0x4e505c){logger[_0xcb64('0x17')](_0xcb64('0x12'),_0x2f85ce,_0x4e505c);_0x1dc1d1(_0x4e505c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8fdcf96..49169c8 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 _0x91f7=['save','remove','update','emit','removeListener','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x91f7,0x9c));var _0x791f=function(_0x2b0ed8,_0x49660c){_0x2b0ed8=_0x2b0ed8-0x0;var _0x5a8d39=_0x91f7[_0x2b0ed8];return _0x5a8d39;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x791f('0x0'),_0x791f('0x1'),_0x791f('0x2')];function createListener(_0x15068b,_0x4239c3){return function(_0x115937){_0x4239c3[_0x791f('0x3')](_0x15068b,_0x115937);};}function removeListener(_0x68e73d,_0x1732d8){return function(){ChatWebsiteEvents[_0x791f('0x4')](_0x68e73d,_0x1732d8);};}exports['register']=function(_0x33d9d8){for(var _0x5ebe4d=0x0,_0x6723cb=events[_0x791f('0x5')];_0x5ebe4d<_0x6723cb;_0x5ebe4d++){var _0x830ae5=events[_0x5ebe4d];var _0xe00e1c=createListener('chatWebsite:'+_0x830ae5,_0x33d9d8);ChatWebsiteEvents['on'](_0x830ae5,_0xe00e1c);}}; \ No newline at end of file +var _0x583e=['update','emit','removeListener','register','length','./chatWebsite.events'];(function(_0x5c4bd8,_0x26e6f1){var _0x211e99=function(_0x376641){while(--_0x376641){_0x5c4bd8['push'](_0x5c4bd8['shift']());}};_0x211e99(++_0x26e6f1);}(_0x583e,0x9b));var _0xe583=function(_0x4eceba,_0x235451){_0x4eceba=_0x4eceba-0x0;var _0x13a23c=_0x583e[_0x4eceba];return _0x13a23c;};'use strict';var ChatWebsiteEvents=require(_0xe583('0x0'));var events=['save','remove',_0xe583('0x1')];function createListener(_0x88e2a0,_0x1b559a){return function(_0x429a43){_0x1b559a[_0xe583('0x2')](_0x88e2a0,_0x429a43);};}function removeListener(_0x2b86e4,_0x4eb10c){return function(){ChatWebsiteEvents[_0xe583('0x3')](_0x2b86e4,_0x4eb10c);};}exports[_0xe583('0x4')]=function(_0x519fe7){for(var _0x37918a=0x0,_0x49c4c1=events[_0xe583('0x5')];_0x37918a<_0x49c4c1;_0x37918a++){var _0x1ad8f5=events[_0x37918a];var _0x46fcba=createListener('chatWebsite:'+_0x1ad8f5,_0x519fe7);ChatWebsiteEvents['on'](_0x1ad8f5,_0x46fcba);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0fb02d1..b607fe2 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 _0xc779=['/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','format','addCustomerAvatar','notify','replace','extname','/:id/offline','any','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','removeAnswers','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','%s-%s','now','originalname'];(function(_0x3b9693,_0x5c73cb){var _0x21f552=function(_0xea0cb5){while(--_0xea0cb5){_0x3b9693['push'](_0x3b9693['shift']());}};_0x21f552(++_0x5c73cb);}(_0xc779,0x166));var _0x9c77=function(_0x445125,_0x1b7870){_0x445125=_0x445125-0x0;var _0x17b5a5=_0xc779[_0x445125];return _0x17b5a5;};'use strict';var multer=require(_0x9c77('0x0'));var util=require(_0x9c77('0x1'));var path=require('path');var timeout=require(_0x9c77('0x2'));var express=require(_0x9c77('0x3'));var router=express['Router']();var fs_extra=require(_0x9c77('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9c77('0x5'));var config=require(_0x9c77('0x6'));var controller=require(_0x9c77('0x7'));router['get']('/',auth[_0x9c77('0x8')](),controller[_0x9c77('0x9')]);router[_0x9c77('0xa')]('/describe',auth[_0x9c77('0x8')](),controller[_0x9c77('0xb')]);router[_0x9c77('0xa')](_0x9c77('0xc'),auth[_0x9c77('0x8')](),controller[_0x9c77('0xd')]);router[_0x9c77('0xa')](_0x9c77('0xe'),auth[_0x9c77('0x8')](),controller[_0x9c77('0xf')]);router[_0x9c77('0xa')](_0x9c77('0x10'),auth['isAuthenticated'](),controller[_0x9c77('0x11')]);router[_0x9c77('0xa')]('/:id/logo',controller[_0x9c77('0x12')]);router[_0x9c77('0xa')]('/:id/avatar',controller[_0x9c77('0x13')]);router[_0x9c77('0xa')](_0x9c77('0x14'),controller[_0x9c77('0x15')]);router[_0x9c77('0xa')](_0x9c77('0x16'),controller['getSystemAvatar']);router[_0x9c77('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9c77('0x17')]);router['get'](_0x9c77('0x18'),controller[_0x9c77('0x19')]);router[_0x9c77('0xa')](_0x9c77('0x1a'),auth[_0x9c77('0x8')](),controller['getApplications']);router[_0x9c77('0xa')](_0x9c77('0x1b'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x1c')]);router[_0x9c77('0xa')](_0x9c77('0x1d'),controller[_0x9c77('0x1e')]);router[_0x9c77('0xa')](_0x9c77('0x1f'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x20')]);router[_0x9c77('0xa')](_0x9c77('0x21'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x22')]);router[_0x9c77('0x23')]('/',auth[_0x9c77('0x8')](),controller[_0x9c77('0x24')]);router['post'](_0x9c77('0xe'),auth['isAuthenticated'](),controller[_0x9c77('0x25')]);router['post'](_0x9c77('0x10'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3311a3,_0x418bfd,_0x248b25){_0x248b25(null,path[_0x9c77('0x27')](config[_0x9c77('0x28')],'server/files/images/logos/'));},'filename':function(_0x4bce16,_0x5b7224,_0x22a070){_0x22a070(null,util['format'](_0x9c77('0x29'),Date[_0x9c77('0x2a')](),_0x5b7224[_0x9c77('0x2b')]));}})});router['post'](_0x9c77('0x2c'),upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller[_0x9c77('0x2f')]);var upload=multer({'storage':multer[_0x9c77('0x30')]({'destination':function(_0x5c5ef5,_0x447b52,_0x46701e){_0x46701e(null,path[_0x9c77('0x27')](config[_0x9c77('0x28')],_0x9c77('0x31')));},'filename':function(_0x56bde7,_0x5106c5,_0x53e9f8){_0x53e9f8(null,util[_0x9c77('0x32')]('%s-%s',Date[_0x9c77('0x2a')](),_0x5106c5[_0x9c77('0x2b')]));}})});router[_0x9c77('0x23')]('/:id/avatar',upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9c77('0x30')]({'destination':function(_0xdcd221,_0x1cf518,_0x4c8a7f){_0x4c8a7f(null,path['join'](config[_0x9c77('0x28')],_0x9c77('0x31')));},'filename':function(_0x567f52,_0x312e3e,_0x127614){_0x127614(null,util[_0x9c77('0x32')](_0x9c77('0x29'),Date[_0x9c77('0x2a')](),_0x312e3e[_0x9c77('0x2b')]));}})});router[_0x9c77('0x23')]('/:id/customer_avatar',upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller[_0x9c77('0x33')]);var upload=multer({'storage':multer[_0x9c77('0x30')]({'destination':function(_0x590d8a,_0x34bc4f,_0x5c2b30){_0x5c2b30(null,path[_0x9c77('0x27')](config[_0x9c77('0x28')],_0x9c77('0x31')));},'filename':function(_0x5be64b,_0x5a7c32,_0x5a789b){_0x5a789b(null,util[_0x9c77('0x32')](_0x9c77('0x29'),Date['now'](),_0x5a7c32['originalname']));}})});router[_0x9c77('0x23')](_0x9c77('0x16'),upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller['addSystemAvatar']);router[_0x9c77('0x23')]('/:id/notify',controller[_0x9c77('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1f9836,_0x4ea3db,_0x21406a){const _0x3b1bda=path[_0x9c77('0x27')](config['root'],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x3b1bda,function(){_0x21406a(null,_0x3b1bda);});},'filename':function(_0x3ef3cc,_0x151d83,_0x3744b7){const _0x544717=_0x151d83[_0x9c77('0x2b')][_0x9c77('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x47bc10=path[_0x9c77('0x36')](_0x544717);const _0x543046=Date['now']()+'-'+_0x544717[_0x9c77('0x35')](_0x47bc10,'')+_0x47bc10;_0x3744b7(null,_0x543046);}})});router[_0x9c77('0x23')](_0x9c77('0x37'),offlineUploadMulter[_0x9c77('0x38')](),controller['offline']);router[_0x9c77('0x23')](_0x9c77('0x39'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x3a')]);router[_0x9c77('0x23')](_0x9c77('0x1a'),auth['isAuthenticated'](),controller[_0x9c77('0x3b')]);router['post'](_0x9c77('0x1b'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x3c')]);router[_0x9c77('0x23')](_0x9c77('0x21'),auth['isAuthenticated'](),controller[_0x9c77('0x3d')]);router[_0x9c77('0x3e')](_0x9c77('0xc'),auth['isAuthenticated'](),controller[_0x9c77('0x3f')]);router[_0x9c77('0x40')](_0x9c77('0xc'),auth[_0x9c77('0x8')](),controller['destroy']);router[_0x9c77('0x40')](_0x9c77('0xe'),auth[_0x9c77('0x8')](),controller['removeDispositions']);router['delete'](_0x9c77('0x10'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x41')]);router[_0x9c77('0x40')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x9c77('0x42')]=router; \ No newline at end of file +var _0xcef0=['exports','util','path','connect-timeout','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','addLogo','server/files/images/avatars/','single','addAvatar','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0x3e330a,_0x11bf04){var _0x451dee=function(_0x1074b7){while(--_0x1074b7){_0x3e330a['push'](_0x3e330a['shift']());}};_0x451dee(++_0x11bf04);}(_0xcef0,0x193));var _0x0cef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcef0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x0cef('0x0'));var path=require(_0x0cef('0x1'));var timeout=require(_0x0cef('0x2'));var express=require('express');var router=express[_0x0cef('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cef('0x4'));var controller=require(_0x0cef('0x5'));router[_0x0cef('0x6')]('/',auth[_0x0cef('0x7')](),controller['index']);router[_0x0cef('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x0cef('0x8')]);router[_0x0cef('0x6')](_0x0cef('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0cef('0x6')](_0x0cef('0xa'),auth[_0x0cef('0x7')](),controller['getDispositions']);router[_0x0cef('0x6')]('/:id/canned_answers',auth[_0x0cef('0x7')](),controller[_0x0cef('0xb')]);router['get']('/:id/logo',controller[_0x0cef('0xc')]);router['get'](_0x0cef('0xd'),controller[_0x0cef('0xe')]);router[_0x0cef('0x6')](_0x0cef('0xf'),controller[_0x0cef('0x10')]);router[_0x0cef('0x6')](_0x0cef('0x11'),controller[_0x0cef('0x12')]);router[_0x0cef('0x6')](_0x0cef('0x13'),auth[_0x0cef('0x7')](),controller['getInteractions']);router[_0x0cef('0x6')]('/:id/snippet',controller[_0x0cef('0x14')]);router[_0x0cef('0x6')](_0x0cef('0x15'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x16')]);router[_0x0cef('0x6')](_0x0cef('0x17'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x18')]);router['get'](_0x0cef('0x19'),controller[_0x0cef('0x1a')]);router['get'](_0x0cef('0x1b'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x0cef('0x6')](_0x0cef('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0cef('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0cef('0x1d')](_0x0cef('0xa'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x1e')]);router[_0x0cef('0x1d')](_0x0cef('0x1f'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x20')]);var upload=multer({'storage':multer[_0x0cef('0x21')]({'destination':function(_0x458a1d,_0x15f85b,_0x42a09d){_0x42a09d(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],_0x0cef('0x24')));},'filename':function(_0xb868a9,_0x4d3626,_0x539d34){_0x539d34(null,util[_0x0cef('0x25')](_0x0cef('0x26'),Date[_0x0cef('0x27')](),_0x4d3626[_0x0cef('0x28')]));}})});router['post'](_0x0cef('0x29'),upload['single']('file'),controller[_0x0cef('0x2a')]);var upload=multer({'storage':multer[_0x0cef('0x21')]({'destination':function(_0x41c63c,_0x12e22d,_0x455103){_0x455103(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],_0x0cef('0x2b')));},'filename':function(_0x5d9928,_0x46b39f,_0x20b4a2){_0x20b4a2(null,util[_0x0cef('0x25')](_0x0cef('0x26'),Date['now'](),_0x46b39f[_0x0cef('0x28')]));}})});router[_0x0cef('0x1d')](_0x0cef('0xd'),upload[_0x0cef('0x2c')]('file'),controller[_0x0cef('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26344e,_0x4e1312,_0x81fd62){_0x81fd62(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],_0x0cef('0x2b')));},'filename':function(_0x31150d,_0x314db8,_0x4bc5ff){_0x4bc5ff(null,util[_0x0cef('0x25')](_0x0cef('0x26'),Date['now'](),_0x314db8[_0x0cef('0x28')]));}})});router[_0x0cef('0x1d')](_0x0cef('0xf'),upload['single'](_0x0cef('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11b414,_0xff0506,_0x11f520){_0x11f520(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],'server/files/images/avatars/'));},'filename':function(_0x5a940a,_0x48b708,_0x78c274){_0x78c274(null,util['format'](_0x0cef('0x26'),Date[_0x0cef('0x27')](),_0x48b708[_0x0cef('0x28')]));}})});router[_0x0cef('0x1d')](_0x0cef('0x11'),upload[_0x0cef('0x2c')](_0x0cef('0x2e')),controller[_0x0cef('0x2f')]);router[_0x0cef('0x1d')](_0x0cef('0x30'),controller[_0x0cef('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x18f3fa,_0x3fc15e,_0x1b8487){const _0x4efa74=path[_0x0cef('0x22')](config[_0x0cef('0x23')],'server/files',_0x0cef('0x32'),_0x0cef('0x33'));fs_extra[_0x0cef('0x34')](_0x4efa74,function(){_0x1b8487(null,_0x4efa74);});},'filename':function(_0x39fe0b,_0x97201d,_0x519cf7){const _0x2754fb=_0x97201d[_0x0cef('0x28')][_0x0cef('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x10f8fe=path[_0x0cef('0x36')](_0x2754fb);const _0x3816e8=Date[_0x0cef('0x27')]()+'-'+_0x2754fb[_0x0cef('0x35')](_0x10f8fe,'')+_0x10f8fe;_0x519cf7(null,_0x3816e8);}})});router[_0x0cef('0x1d')](_0x0cef('0x37'),offlineUploadMulter[_0x0cef('0x38')](),controller[_0x0cef('0x39')]);router[_0x0cef('0x1d')](_0x0cef('0x13'),auth[_0x0cef('0x7')](),controller['addInteraction']);router[_0x0cef('0x1d')](_0x0cef('0x15'),auth['isAuthenticated'](),controller['addApplications']);router[_0x0cef('0x1d')](_0x0cef('0x17'),auth[_0x0cef('0x7')](),controller['addProactiveActions']);router[_0x0cef('0x1d')](_0x0cef('0x1c'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x3a')]);router[_0x0cef('0x3b')](_0x0cef('0x9'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x3c')]);router[_0x0cef('0x3d')]('/:id',auth[_0x0cef('0x7')](),controller[_0x0cef('0x3e')]);router[_0x0cef('0x3d')](_0x0cef('0xa'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x3f')]);router['delete'](_0x0cef('0x1f'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x40')]);router['delete'](_0x0cef('0x1c'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x41')]);module[_0x0cef('0x42')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 838c23e..8a396bb 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 _0xf1c6=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x4a1c82,_0x3cff45){var _0x5eaa64=function(_0x57e43f){while(--_0x57e43f){_0x4a1c82['push'](_0x4a1c82['shift']());}};_0x5eaa64(++_0x3cff45);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x3fbcab,_0x32ed19){_0x3fbcab=_0x3fbcab-0x0;var _0x203045=_0xf1c6[_0x3fbcab];return _0x203045;};'use strict';var Sequelize=require(_0x6f1c('0x0'));module[_0x6f1c('0x1')]={'name':{'type':Sequelize[_0x6f1c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6f1c('0x3')](_0x6f1c('0x4'),_0x6f1c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x6f1c('0x2')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x00e0=['exports','STRING','AmazonAWS','sequelize'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x00e0,0x1e3));var _0x000e=function(_0x4fc888,_0x5ad3e7){_0x4fc888=_0x4fc888-0x0;var _0xf688d1=_0x00e0[_0x4fc888];return _0xf688d1;};'use strict';var Sequelize=require(_0x000e('0x0'));module[_0x000e('0x1')]={'name':{'type':Sequelize[_0x000e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x000e('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x000e('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 bf911db..429dbba 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x1f715a,_0x32cffb){var _0x2a752b=function(_0x38d64a){while(--_0x38d64a){_0x1f715a['push'](_0x1f715a['shift']());}};_0x2a752b(++_0x32cffb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file +var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x4defb9,_0x4c8461){var _0x3fd54e=function(_0x4d57ed){while(--_0x4d57ed){_0x4defb9['push'](_0x4defb9['shift']());}};_0x3fd54e(++_0x4c8461);}(_0xdb28,0x106));var _0x8db2=function(_0x2b72a3,_0x46dc84){_0x2b72a3=_0x2b72a3-0x0;var _0x17ed95=_0xdb28[_0x2b72a3];return _0x17ed95;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f4c8314..0a8d3b5 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 _0x61ed=['../../config/environment','./cloudProvider.attributes','exports','define','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x998c5,_0x241ce8){var _0x5d9e81=function(_0x12294c){while(--_0x12294c){_0x998c5['push'](_0x998c5['shift']());}};_0x5d9e81(++_0x241ce8);}(_0x61ed,0x1ee));var _0xd61e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x61ed[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xd61e('0x0'));var logger=require(_0xd61e('0x1'))('api');var moment=require(_0xd61e('0x2'));var BPromise=require(_0xd61e('0x3'));var rp=require(_0xd61e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd61e('0x5'));var config=require(_0xd61e('0x6'));var attributes=require(_0xd61e('0x7'));module[_0xd61e('0x8')]=function(_0x25d9d0,_0x362b39){return _0x25d9d0[_0xd61e('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16a2=['../../config/logger','request-promise','rimraf','../../config/environment','define','CloudProvider','cloud_providers','lodash','util'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x16a2,0x6a));var _0x216a=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x16a2[_0x271537];return _0x19dc22;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var logger=require(_0x216a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x216a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x216a('0x4'));var config=require(_0x216a('0x5'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x3339b9,_0x502753){return _0x3339b9[_0x216a('0x6')](_0x216a('0x7'),attributes,{'tableName':_0x216a('0x8'),'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 1e074d2..c86d1ad 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 _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0xa20507,_0x194ad9){var _0x2b0948=function(_0x574175){while(--_0x574175){_0xa20507['push'](_0xa20507['shift']());}};_0x2b0948(++_0x194ad9);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x562c5f,_0x247419){_0x562c5f=_0x562c5f-0x0;var _0x495c5b=_0xcf2f[_0x562c5f];return _0x495c5b;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash'];(function(_0xce417f,_0x4e9230){var _0x50c2e9=function(_0x3d3dd3){while(--_0x3d3dd3){_0xce417f['push'](_0xce417f['shift']());}};_0x50c2e9(++_0x4e9230);}(_0x66fa,0x117));var _0xa66f=function(_0x2d4fb2,_0x468359){_0x2d4fb2=_0x2d4fb2-0x0;var _0x2cd0a5=_0x66fa[_0x2d4fb2];return _0x2cd0a5;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('CloudProvider,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 27702c7..e8d8d27 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 _0xdbcd=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xdbcd,0x67));var _0xddbc=function(_0x2d4ab1,_0xd0fc03){_0x2d4ab1=_0x2d4ab1-0x0;var _0x2b4fe0=_0xdbcd[_0x2d4ab1];return _0x2b4fe0;};'use strict';var multer=require('multer');var util=require(_0xddbc('0x0'));var path=require(_0xddbc('0x1'));var timeout=require(_0xddbc('0x2'));var express=require('express');var router=express[_0xddbc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddbc('0x4'));var interaction=require(_0xddbc('0x5'));var config=require(_0xddbc('0x6'));var controller=require(_0xddbc('0x7'));router[_0xddbc('0x8')]('/',auth[_0xddbc('0x9')](),controller['index']);router[_0xddbc('0x8')](_0xddbc('0xa'),auth['isAuthenticated'](),controller[_0xddbc('0xb')]);router[_0xddbc('0xc')]('/',auth[_0xddbc('0x9')](),controller[_0xddbc('0xd')]);router['put']('/:id',auth[_0xddbc('0x9')](),controller['update']);router[_0xddbc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xddbc('0xf')]);module[_0xddbc('0x10')]=router; \ No newline at end of file +var _0xa997=['show','post','create','put','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3a2d01,_0x1b6051){var _0x3bcb4b=function(_0x4a68f5){while(--_0x4a68f5){_0x3a2d01['push'](_0x3a2d01['shift']());}};_0x3bcb4b(++_0x1b6051);}(_0xa997,0xea));var _0x7a99=function(_0x2cea58,_0x153c15){_0x2cea58=_0x2cea58-0x0;var _0x192933=_0xa997[_0x2cea58];return _0x192933;};'use strict';var multer=require(_0x7a99('0x0'));var util=require(_0x7a99('0x1'));var path=require(_0x7a99('0x2'));var timeout=require(_0x7a99('0x3'));var express=require('express');var router=express[_0x7a99('0x4')]();var fs_extra=require(_0x7a99('0x5'));var auth=require(_0x7a99('0x6'));var interaction=require(_0x7a99('0x7'));var config=require(_0x7a99('0x8'));var controller=require('./cloudProvider.controller');router[_0x7a99('0x9')]('/',auth[_0x7a99('0xa')](),controller[_0x7a99('0xb')]);router[_0x7a99('0x9')](_0x7a99('0xc'),auth['isAuthenticated'](),controller[_0x7a99('0xd')]);router[_0x7a99('0xe')]('/',auth['isAuthenticated'](),controller[_0x7a99('0xf')]);router[_0x7a99('0x10')]('/:id',auth[_0x7a99('0xa')](),controller[_0x7a99('0x11')]);router['delete'](_0x7a99('0xc'),auth[_0x7a99('0xa')](),controller[_0x7a99('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 167e447..fa12ab8 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 _0xf13e=['STRING','name','sequelize','exports'];(function(_0x565faf,_0x5f3718){var _0x42292f=function(_0x514b49){while(--_0x514b49){_0x565faf['push'](_0x565faf['shift']());}};_0x42292f(++_0x5f3718);}(_0xf13e,0x6a));var _0xef13=function(_0x4cde1f,_0x3c72bf){_0x4cde1f=_0x4cde1f-0x0;var _0x46afba=_0xf13e[_0x4cde1f];return _0x46afba;};'use strict';var Sequelize=require(_0xef13('0x0'));module[_0xef13('0x1')]={'name':{'type':Sequelize[_0xef13('0x2')],'unique':_0xef13('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xef13('0x2')]},'companyId':{'type':Sequelize[_0xef13('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xef13('0x2')]},'type':{'type':Sequelize[_0xef13('0x2')]},'street':{'type':Sequelize[_0xef13('0x2')]},'postalCode':{'type':Sequelize[_0xef13('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xef13('0x2')]},'email':{'type':Sequelize[_0xef13('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xef13('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xef13('0x2')]},'description':{'type':Sequelize[_0xef13('0x2')]}}; \ No newline at end of file +var _0x2c37=['STRING','exports'];(function(_0x4a6ba2,_0x4504a2){var _0x27ee9e=function(_0x4fe7ae){while(--_0x4fe7ae){_0x4a6ba2['push'](_0x4a6ba2['shift']());}};_0x27ee9e(++_0x4504a2);}(_0x2c37,0x175));var _0x72c3=function(_0x1c02d9,_0x342afd){_0x1c02d9=_0x1c02d9-0x0;var _0x21b6cb=_0x2c37[_0x1c02d9];return _0x21b6cb;};'use strict';var Sequelize=require('sequelize');module[_0x72c3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x72c3('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x72c3('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x72c3('0x1')]},'type':{'type':Sequelize[_0x72c3('0x1')]},'street':{'type':Sequelize[_0x72c3('0x1')]},'postalCode':{'type':Sequelize[_0x72c3('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x72c3('0x1')]},'email':{'type':Sequelize[_0x72c3('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x72c3('0x1')]},'sStreet':{'type':Sequelize[_0x72c3('0x1')]},'sPostalCode':{'type':Sequelize[_0x72c3('0x1')]},'sCity':{'type':Sequelize[_0x72c3('0x1')]},'sCountry':{'type':Sequelize[_0x72c3('0x1')]},'description':{'type':Sequelize[_0x72c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index fe3fc00..d01c909 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 _0x7383=['undefined','limit','count','set','json','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','rawAttributes','pick','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset'];(function(_0x2d26bd,_0x30ebac){var _0x3eccc3=function(_0x5021df){while(--_0x5021df){_0x2d26bd['push'](_0x2d26bd['shift']());}};_0x3eccc3(++_0x30ebac);}(_0x7383,0x18d));var _0x3738=function(_0x3b9eb9,_0x15088d){_0x3b9eb9=_0x3b9eb9-0x0;var _0x4f6d1d=_0x7383[_0x3b9eb9];return _0x4f6d1d;};'use strict';var emlformat=require(_0x3738('0x0'));var rimraf=require(_0x3738('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3738('0x2'));var rp=require(_0x3738('0x3'));var moment=require('moment');var BPromise=require(_0x3738('0x4'));var Mustache=require(_0x3738('0x5'));var util=require(_0x3738('0x6'));var path=require('path');var sox=require(_0x3738('0x7'));var csv=require(_0x3738('0x8'));var ejs=require(_0x3738('0x9'));var fs=require('fs');var fs_extra=require(_0x3738('0xa'));var _=require(_0x3738('0xb'));var squel=require(_0x3738('0xc'));var crypto=require(_0x3738('0xd'));var jsforce=require(_0x3738('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3738('0x8'));var querystring=require('querystring');var Papa=require(_0x3738('0xf'));var Redis=require(_0x3738('0x10'));var authService=require(_0x3738('0x11'));var qs=require(_0x3738('0x12'));var as=require(_0x3738('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3738('0x14'));var utils=require(_0x3738('0x15'));var config=require(_0x3738('0x16'));var licenseUtil=require(_0x3738('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57b984,_0x2db9ef){_0x2db9ef=_0x2db9ef||0xcc;return function(_0x341745){if(_0x341745){return _0x57b984[_0x3738('0x18')](_0x2db9ef);}return _0x57b984[_0x3738('0x19')](_0x2db9ef)[_0x3738('0x1a')]();};}function respondWithResult(_0x2df558,_0x1a9e49){_0x1a9e49=_0x1a9e49||0xc8;return function(_0x114c82){if(_0x114c82){return _0x2df558[_0x3738('0x19')](_0x1a9e49)['json'](_0x114c82);}};}function respondWithFilteredResult(_0x1f6557,_0x553916){return function(_0x524bbd){if(_0x524bbd){var _0xa9c0c9=typeof _0x553916[_0x3738('0x1b')]===_0x3738('0x1c')&&typeof _0x553916[_0x3738('0x1d')]===_0x3738('0x1c');var _0x51ea31=_0x524bbd[_0x3738('0x1e')];var _0x570fbb=_0xa9c0c9?0x0:_0x553916[_0x3738('0x1b')];var _0x10cfa5=_0xa9c0c9?_0x524bbd[_0x3738('0x1e')]:_0x553916['offset']+_0x553916[_0x3738('0x1d')];var _0x212d00;if(_0x10cfa5>=_0x51ea31){_0x10cfa5=_0x51ea31;_0x212d00=0xc8;}else{_0x212d00=0xce;}_0x1f6557[_0x3738('0x19')](_0x212d00);return _0x1f6557[_0x3738('0x1f')]('Content-Range',_0x570fbb+'-'+_0x10cfa5+'/'+_0x51ea31)[_0x3738('0x20')](_0x524bbd);}return null;};}function patchUpdates(_0x52eab4){return function(_0x56baa1){try{jsonpatch['apply'](_0x56baa1,_0x52eab4,!![]);}catch(_0x58c036){return BPromise[_0x3738('0x21')](_0x58c036);}return _0x56baa1[_0x3738('0x22')]();};}function saveUpdates(_0x409340,_0x49b90f){return function(_0x52b180){if(_0x52b180){return _0x52b180[_0x3738('0x23')](_0x409340)[_0x3738('0x24')](function(_0x3287d3){return _0x3287d3;});}return null;};}function removeEntity(_0x3c3feb,_0x4122eb){return function(_0x2c00da){if(_0x2c00da){return _0x2c00da[_0x3738('0x25')]()['then'](function(){var _0x4ed034=_0x2c00da[_0x3738('0x26')]({'plain':!![]});var _0xae3599=_0x3738('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0xae3599,'resourceId':_0x4ed034['id']}})['then'](function(){return _0x2c00da;});})['then'](function(){_0x3c3feb[_0x3738('0x19')](0xcc)[_0x3738('0x1a')]();});}};}function handleEntityNotFound(_0x2fc010,_0x4b7a6e){return function(_0x1821c2){if(!_0x1821c2){_0x2fc010['sendStatus'](0x194);}return _0x1821c2;};}function handleError(_0x42dbb7,_0x2010f3){_0x2010f3=_0x2010f3||0x1f4;return function(_0x4a7359){logger[_0x3738('0x28')](_0x4a7359[_0x3738('0x29')]);if(_0x4a7359['name']){delete _0x4a7359[_0x3738('0x2a')];}_0x42dbb7['status'](_0x2010f3)[_0x3738('0x2b')](_0x4a7359);};}exports[_0x3738('0x2c')]=function(_0x260bde,_0x16a1e3){var _0x1269ed={},_0x38260d={},_0x5bc594={'count':0x0,'rows':[]};return db[_0x3738('0x2d')]['describe']()['then'](function(_0x3b3594){_0x38260d[_0x3738('0x2e')]=_[_0x3738('0x2f')](_0x3b3594);_0x38260d['query']=_[_0x3738('0x2f')](_0x260bde[_0x3738('0x30')]);_0x38260d[_0x3738('0x31')]=_[_0x3738('0x32')](_0x38260d['model'],_0x38260d['query']);_0x1269ed[_0x3738('0x33')]=_['intersection'](_0x38260d[_0x3738('0x2e')],qs[_0x3738('0x34')](_0x260bde[_0x3738('0x30')][_0x3738('0x34')]));_0x1269ed[_0x3738('0x33')]=_0x1269ed[_0x3738('0x33')][_0x3738('0x35')]?_0x1269ed['attributes']:_0x38260d[_0x3738('0x2e')];if(!_0x260bde['query']['hasOwnProperty'](_0x3738('0x36'))){_0x1269ed[_0x3738('0x1d')]=qs[_0x3738('0x1d')](_0x260bde['query']['limit']);_0x1269ed['offset']=qs[_0x3738('0x1b')](_0x260bde[_0x3738('0x30')]['offset']);}_0x1269ed[_0x3738('0x37')]=qs[_0x3738('0x38')](_0x260bde[_0x3738('0x30')][_0x3738('0x38')]);_0x1269ed[_0x3738('0x39')]=qs[_0x3738('0x31')](_['pick'](_0x260bde[_0x3738('0x30')],_0x38260d[_0x3738('0x31')]),_0x3b3594);if(_0x260bde[_0x3738('0x30')][_0x3738('0x3a')]){_0x1269ed[_0x3738('0x39')]=_[_0x3738('0x3b')](_0x1269ed[_0x3738('0x39')],{'$or':_[_0x3738('0x3c')](_0x1269ed['attributes'],function(_0x4760f8){var _0x5171ae={};_0x5171ae[_0x4760f8]={'$like':'%'+_0x260bde[_0x3738('0x30')]['filter']+'%'};return _0x5171ae;})});}_0x1269ed=_[_0x3738('0x3b')]({},_0x1269ed,_0x260bde[_0x3738('0x3d')]);var _0x46cc8d={'where':_0x1269ed['where']};return db[_0x3738('0x2d')]['count'](_0x46cc8d)['then'](function(_0x1b0bf8){_0x5bc594[_0x3738('0x1e')]=_0x1b0bf8;if(_0x260bde[_0x3738('0x30')][_0x3738('0x3e')]){_0x1269ed[_0x3738('0x3f')]=[{'all':!![]}];}return db[_0x3738('0x2d')]['findAll'](_0x1269ed);})[_0x3738('0x24')](function(_0x1c6577){_0x5bc594['rows']=_0x1c6577;return _0x5bc594;})['then'](respondWithFilteredResult(_0x16a1e3,_0x1269ed))[_0x3738('0x40')](handleError(_0x16a1e3,null));})['catch'](handleError(_0x16a1e3,null));};exports['show']=function(_0x1cb381,_0x260b1e){var _0x1de5e0={'raw':![],'where':{'id':_0x1cb381[_0x3738('0x41')]['id']}},_0x28d47a={};_0x28d47a[_0x3738('0x2e')]=_[_0x3738('0x2f')](db[_0x3738('0x2d')]['rawAttributes']);_0x28d47a[_0x3738('0x30')]=_[_0x3738('0x2f')](_0x1cb381['query']);_0x28d47a[_0x3738('0x31')]=_[_0x3738('0x32')](_0x28d47a[_0x3738('0x2e')],_0x28d47a[_0x3738('0x30')]);_0x1de5e0['attributes']=_[_0x3738('0x32')](_0x28d47a[_0x3738('0x2e')],qs[_0x3738('0x34')](_0x1cb381['query']['fields']));_0x1de5e0[_0x3738('0x33')]=_0x1de5e0[_0x3738('0x33')][_0x3738('0x35')]?_0x1de5e0['attributes']:_0x28d47a[_0x3738('0x2e')];if(_0x1cb381['query'][_0x3738('0x3e')]){_0x1de5e0[_0x3738('0x3f')]=[{'all':!![]}];}_0x1de5e0=_[_0x3738('0x3b')]({},_0x1de5e0,_0x1cb381['options']);return db[_0x3738('0x2d')][_0x3738('0x42')](_0x1de5e0)[_0x3738('0x24')](handleEntityNotFound(_0x260b1e,null))[_0x3738('0x24')](respondWithResult(_0x260b1e,null))['catch'](handleError(_0x260b1e,null));};exports['create']=function(_0x29c2b1,_0x10078c){return db[_0x3738('0x2d')][_0x3738('0x43')](_0x29c2b1[_0x3738('0x44')],{})[_0x3738('0x24')](function(_0x2fb3fa){var _0x561c11=_0x29c2b1['user'][_0x3738('0x26')]({'plain':!![]});if(!_0x561c11)throw new Error(_0x3738('0x45'));if(_0x561c11[_0x3738('0x46')]===_0x3738('0x47')){var _0x10e1cc=_0x2fb3fa[_0x3738('0x26')]({'plain':!![]});var _0x17a5e1='Companies';return db[_0x3738('0x48')][_0x3738('0x42')]({'where':{'name':_0x17a5e1,'userProfileId':_0x561c11[_0x3738('0x49')]},'raw':!![]})[_0x3738('0x24')](function(_0x2f3728){if(_0x2f3728&&_0x2f3728['autoAssociation']===0x0){return db[_0x3738('0x4a')]['create']({'name':_0x10e1cc[_0x3738('0x2a')],'resourceId':_0x10e1cc['id'],'type':_0x2f3728['name'],'sectionId':_0x2f3728['id']},{})[_0x3738('0x24')](function(){return _0x2fb3fa;});}else{return _0x2fb3fa;}})['catch'](function(_0xbe1f81){logger['error'](_0x3738('0x4b'),_0xbe1f81);throw _0xbe1f81;});}return _0x2fb3fa;})[_0x3738('0x24')](respondWithResult(_0x10078c,0xc9))['catch'](handleError(_0x10078c,null));};exports[_0x3738('0x23')]=function(_0x4d8890,_0x463b9d){if(_0x4d8890[_0x3738('0x44')]['id']){delete _0x4d8890[_0x3738('0x44')]['id'];}return db[_0x3738('0x2d')][_0x3738('0x42')]({'where':{'id':_0x4d8890[_0x3738('0x41')]['id']}})[_0x3738('0x24')](handleEntityNotFound(_0x463b9d,null))[_0x3738('0x24')](saveUpdates(_0x4d8890[_0x3738('0x44')],null))[_0x3738('0x24')](respondWithResult(_0x463b9d,null))[_0x3738('0x40')](handleError(_0x463b9d,null));};exports[_0x3738('0x25')]=function(_0x310a8f,_0x4a3c82){return db[_0x3738('0x2d')]['find']({'where':{'id':_0x310a8f[_0x3738('0x41')]['id']}})['then'](handleEntityNotFound(_0x4a3c82,null))['then'](removeEntity(_0x4a3c82,null))[_0x3738('0x40')](handleError(_0x4a3c82,null));};exports[_0x3738('0x4c')]=function(_0x470aaf,_0x210c3d){return db['CmCompany'][_0x3738('0x4c')]()[_0x3738('0x24')](respondWithResult(_0x210c3d,null))[_0x3738('0x40')](handleError(_0x210c3d,null));};exports[_0x3738('0x4d')]=function(_0x240629,_0x46b859,_0x54c414){return db[_0x3738('0x4e')][_0x3738('0x42')]({'where':{'id':_0x240629['params']['id']}})[_0x3738('0x24')](handleEntityNotFound(_0x46b859,null))[_0x3738('0x24')](function(_0x45a547){if(_0x45a547){return _0x45a547[_0x3738('0x4d')](_0x240629[_0x3738('0x44')][_0x3738('0x4f')],_[_0x3738('0x50')](_0x240629[_0x3738('0x44')],[_0x3738('0x4f'),'id'])||{});}})[_0x3738('0x24')](respondWithResult(_0x46b859,null))['catch'](handleError(_0x46b859,null));};exports['getContacts']=function(_0x5978cc,_0x5c96bc,_0x1111a6){var _0x4ce982={};var _0x87845={};var _0x2f6fca;var _0x183f81;return db[_0x3738('0x2d')]['findOne']({'where':{'id':_0x5978cc['params']['id']}})[_0x3738('0x24')](handleEntityNotFound(_0x5c96bc,null))[_0x3738('0x24')](function(_0x18fb60){if(_0x18fb60){_0x2f6fca=_0x18fb60;_0x87845[_0x3738('0x2e')]=_[_0x3738('0x2f')](db[_0x3738('0x4e')][_0x3738('0x51')]);_0x87845['query']=_[_0x3738('0x2f')](_0x5978cc[_0x3738('0x30')]);_0x87845['filters']=_[_0x3738('0x32')](_0x87845[_0x3738('0x2e')],_0x87845['query']);_0x4ce982[_0x3738('0x33')]=_[_0x3738('0x32')](_0x87845[_0x3738('0x2e')],qs[_0x3738('0x34')](_0x5978cc[_0x3738('0x30')][_0x3738('0x34')]));_0x4ce982[_0x3738('0x33')]=_0x4ce982['attributes'][_0x3738('0x35')]?_0x4ce982[_0x3738('0x33')]:_0x87845[_0x3738('0x2e')];_0x4ce982['order']=qs[_0x3738('0x38')](_0x5978cc['query']['sort']);_0x4ce982[_0x3738('0x39')]=qs[_0x3738('0x31')](_[_0x3738('0x52')](_0x5978cc[_0x3738('0x30')],_0x87845[_0x3738('0x31')]));if(_0x5978cc[_0x3738('0x30')][_0x3738('0x3a')]){_0x4ce982[_0x3738('0x39')]=_[_0x3738('0x3b')](_0x4ce982['where'],{'$or':_[_0x3738('0x3c')](_0x4ce982[_0x3738('0x33')],function(_0x3b8d19){var _0x273e24={};_0x273e24[_0x3b8d19]={'$like':'%'+_0x5978cc['query'][_0x3738('0x3a')]+'%'};return _0x273e24;})});}_0x4ce982=_[_0x3738('0x3b')]({},_0x4ce982,_0x5978cc[_0x3738('0x3d')]);return _0x2f6fca[_0x3738('0x53')](_0x4ce982);}})[_0x3738('0x24')](function(_0x8f9074){if(_0x8f9074){_0x183f81=_0x8f9074[_0x3738('0x35')];if(!_0x5978cc[_0x3738('0x30')][_0x3738('0x54')]('nolimit')){_0x4ce982[_0x3738('0x1d')]=qs[_0x3738('0x1d')](_0x5978cc[_0x3738('0x30')][_0x3738('0x1d')]);_0x4ce982[_0x3738('0x1b')]=qs[_0x3738('0x1b')](_0x5978cc[_0x3738('0x30')][_0x3738('0x1b')]);}return _0x2f6fca[_0x3738('0x53')](_0x4ce982);}})[_0x3738('0x24')](function(_0x5b77d6){if(_0x5b77d6){return _0x5b77d6?{'count':_0x183f81,'rows':_0x5b77d6}:null;}})[_0x3738('0x24')](respondWithResult(_0x5c96bc,null))['catch'](handleError(_0x5c96bc,null));}; \ No newline at end of file +var _0x51b5=['undefined','limit','count','set','Content-Range','apply','save','then','get','Companies','UserProfileResource','destroy','sendStatus','error','name','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','rows','show','rawAttributes','find','create','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','catch','addContacts','CmContact','ids','omit','options','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x51b5,0x17f));var _0x551b=function(_0x43b5c2,_0x5cd7c7){_0x43b5c2=_0x43b5c2-0x0;var _0x14943a=_0x51b5[_0x43b5c2];return _0x14943a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x551b('0x0'));var zipdir=require(_0x551b('0x1'));var jsonpatch=require(_0x551b('0x2'));var rp=require(_0x551b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x551b('0x4'));var util=require(_0x551b('0x5'));var path=require(_0x551b('0x6'));var sox=require(_0x551b('0x7'));var csv=require(_0x551b('0x8'));var ejs=require(_0x551b('0x9'));var fs=require('fs');var fs_extra=require(_0x551b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x551b('0xb'));var jsforce=require(_0x551b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x551b('0xd'));var Papa=require(_0x551b('0xe'));var Redis=require(_0x551b('0xf'));var authService=require(_0x551b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x551b('0x11'));var hardwareService=require(_0x551b('0x12'));var logger=require('../../config/logger')(_0x551b('0x13'));var utils=require(_0x551b('0x14'));var config=require(_0x551b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x551b('0x16'))['db'];function respondWithStatusCode(_0x936de,_0xf5bc99){_0xf5bc99=_0xf5bc99||0xcc;return function(_0x4f6b0b){if(_0x4f6b0b){return _0x936de['sendStatus'](_0xf5bc99);}return _0x936de['status'](_0xf5bc99)[_0x551b('0x17')]();};}function respondWithResult(_0x260ddd,_0x4e17e9){_0x4e17e9=_0x4e17e9||0xc8;return function(_0x424e87){if(_0x424e87){return _0x260ddd[_0x551b('0x18')](_0x4e17e9)[_0x551b('0x19')](_0x424e87);}};}function respondWithFilteredResult(_0x1e54dc,_0x232a7d){return function(_0x1e2959){if(_0x1e2959){var _0x27642e=typeof _0x232a7d[_0x551b('0x1a')]===_0x551b('0x1b')&&typeof _0x232a7d[_0x551b('0x1c')]===_0x551b('0x1b');var _0x44959e=_0x1e2959[_0x551b('0x1d')];var _0x138982=_0x27642e?0x0:_0x232a7d[_0x551b('0x1a')];var _0x58a7ea=_0x27642e?_0x1e2959['count']:_0x232a7d['offset']+_0x232a7d[_0x551b('0x1c')];var _0x326b8c;if(_0x58a7ea>=_0x44959e){_0x58a7ea=_0x44959e;_0x326b8c=0xc8;}else{_0x326b8c=0xce;}_0x1e54dc[_0x551b('0x18')](_0x326b8c);return _0x1e54dc[_0x551b('0x1e')](_0x551b('0x1f'),_0x138982+'-'+_0x58a7ea+'/'+_0x44959e)[_0x551b('0x19')](_0x1e2959);}return null;};}function patchUpdates(_0x1c60d6){return function(_0x4c7d0f){try{jsonpatch[_0x551b('0x20')](_0x4c7d0f,_0x1c60d6,!![]);}catch(_0x3f97ea){return BPromise['reject'](_0x3f97ea);}return _0x4c7d0f[_0x551b('0x21')]();};}function saveUpdates(_0x1fad8a,_0x312c94){return function(_0x34f19){if(_0x34f19){return _0x34f19['update'](_0x1fad8a)['then'](function(_0x81aec5){return _0x81aec5;});}return null;};}function removeEntity(_0x38e453,_0x2f9e66){return function(_0x2198b9){if(_0x2198b9){return _0x2198b9['destroy']()[_0x551b('0x22')](function(){var _0x3b521b=_0x2198b9[_0x551b('0x23')]({'plain':!![]});var _0x3f01b3=_0x551b('0x24');return db[_0x551b('0x25')][_0x551b('0x26')]({'where':{'type':_0x3f01b3,'resourceId':_0x3b521b['id']}})[_0x551b('0x22')](function(){return _0x2198b9;});})['then'](function(){_0x38e453[_0x551b('0x18')](0xcc)[_0x551b('0x17')]();});}};}function handleEntityNotFound(_0x406f31,_0x49af8b){return function(_0xdb3e47){if(!_0xdb3e47){_0x406f31[_0x551b('0x27')](0x194);}return _0xdb3e47;};}function handleError(_0x292bc3,_0x1cbe6c){_0x1cbe6c=_0x1cbe6c||0x1f4;return function(_0x911d2f){logger[_0x551b('0x28')](_0x911d2f['stack']);if(_0x911d2f[_0x551b('0x29')]){delete _0x911d2f[_0x551b('0x29')];}_0x292bc3[_0x551b('0x18')](_0x1cbe6c)['send'](_0x911d2f);};}exports['index']=function(_0x46150c,_0x2ab726){var _0x4e2689={},_0x41ea53={},_0x2675cc={'count':0x0,'rows':[]};return db[_0x551b('0x2a')][_0x551b('0x2b')]()['then'](function(_0x5c9a19){_0x41ea53[_0x551b('0x2c')]=_[_0x551b('0x2d')](_0x5c9a19);_0x41ea53[_0x551b('0x2e')]=_[_0x551b('0x2d')](_0x46150c[_0x551b('0x2e')]);_0x41ea53[_0x551b('0x2f')]=_[_0x551b('0x30')](_0x41ea53[_0x551b('0x2c')],_0x41ea53[_0x551b('0x2e')]);_0x4e2689['attributes']=_[_0x551b('0x30')](_0x41ea53[_0x551b('0x2c')],qs[_0x551b('0x31')](_0x46150c[_0x551b('0x2e')]['fields']));_0x4e2689[_0x551b('0x32')]=_0x4e2689[_0x551b('0x32')][_0x551b('0x33')]?_0x4e2689[_0x551b('0x32')]:_0x41ea53[_0x551b('0x2c')];if(!_0x46150c[_0x551b('0x2e')][_0x551b('0x34')](_0x551b('0x35'))){_0x4e2689['limit']=qs[_0x551b('0x1c')](_0x46150c[_0x551b('0x2e')][_0x551b('0x1c')]);_0x4e2689[_0x551b('0x1a')]=qs['offset'](_0x46150c[_0x551b('0x2e')][_0x551b('0x1a')]);}_0x4e2689[_0x551b('0x36')]=qs[_0x551b('0x37')](_0x46150c[_0x551b('0x2e')][_0x551b('0x37')]);_0x4e2689[_0x551b('0x38')]=qs[_0x551b('0x2f')](_[_0x551b('0x39')](_0x46150c[_0x551b('0x2e')],_0x41ea53['filters']),_0x5c9a19);if(_0x46150c[_0x551b('0x2e')][_0x551b('0x3a')]){_0x4e2689[_0x551b('0x38')]=_[_0x551b('0x3b')](_0x4e2689[_0x551b('0x38')],{'$or':_[_0x551b('0x3c')](_0x4e2689[_0x551b('0x32')],function(_0x20e9e9){var _0x486f2b={};_0x486f2b[_0x20e9e9]={'$like':'%'+_0x46150c[_0x551b('0x2e')]['filter']+'%'};return _0x486f2b;})});}_0x4e2689=_['merge']({},_0x4e2689,_0x46150c['options']);var _0x26ca63={'where':_0x4e2689['where']};return db[_0x551b('0x2a')][_0x551b('0x1d')](_0x26ca63)[_0x551b('0x22')](function(_0x103f9a){_0x2675cc[_0x551b('0x1d')]=_0x103f9a;if(_0x46150c[_0x551b('0x2e')][_0x551b('0x3d')]){_0x4e2689[_0x551b('0x3e')]=[{'all':!![]}];}return db[_0x551b('0x2a')]['findAll'](_0x4e2689);})[_0x551b('0x22')](function(_0x106d71){_0x2675cc[_0x551b('0x3f')]=_0x106d71;return _0x2675cc;})[_0x551b('0x22')](respondWithFilteredResult(_0x2ab726,_0x4e2689))['catch'](handleError(_0x2ab726,null));})['catch'](handleError(_0x2ab726,null));};exports[_0x551b('0x40')]=function(_0x569c90,_0x5d5625){var _0x1890cb={'raw':![],'where':{'id':_0x569c90['params']['id']}},_0x362ef1={};_0x362ef1[_0x551b('0x2c')]=_['keys'](db[_0x551b('0x2a')][_0x551b('0x41')]);_0x362ef1['query']=_[_0x551b('0x2d')](_0x569c90[_0x551b('0x2e')]);_0x362ef1[_0x551b('0x2f')]=_[_0x551b('0x30')](_0x362ef1[_0x551b('0x2c')],_0x362ef1['query']);_0x1890cb[_0x551b('0x32')]=_[_0x551b('0x30')](_0x362ef1[_0x551b('0x2c')],qs['fields'](_0x569c90[_0x551b('0x2e')]['fields']));_0x1890cb['attributes']=_0x1890cb['attributes'][_0x551b('0x33')]?_0x1890cb[_0x551b('0x32')]:_0x362ef1[_0x551b('0x2c')];if(_0x569c90[_0x551b('0x2e')][_0x551b('0x3d')]){_0x1890cb[_0x551b('0x3e')]=[{'all':!![]}];}_0x1890cb=_[_0x551b('0x3b')]({},_0x1890cb,_0x569c90['options']);return db[_0x551b('0x2a')][_0x551b('0x42')](_0x1890cb)[_0x551b('0x22')](handleEntityNotFound(_0x5d5625,null))['then'](respondWithResult(_0x5d5625,null))['catch'](handleError(_0x5d5625,null));};exports['create']=function(_0x24ba05,_0x15abb1){return db['CmCompany'][_0x551b('0x43')](_0x24ba05['body'],{})[_0x551b('0x22')](function(_0x29e549){var _0x20d1a8=_0x24ba05['user']['get']({'plain':!![]});if(!_0x20d1a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20d1a8[_0x551b('0x44')]===_0x551b('0x45')){var _0x55279a=_0x29e549[_0x551b('0x23')]({'plain':!![]});var _0x54f85b='Companies';return db[_0x551b('0x46')]['find']({'where':{'name':_0x54f85b,'userProfileId':_0x20d1a8[_0x551b('0x47')]},'raw':!![]})[_0x551b('0x22')](function(_0x2d3db9){if(_0x2d3db9&&_0x2d3db9['autoAssociation']===0x0){return db[_0x551b('0x25')][_0x551b('0x43')]({'name':_0x55279a[_0x551b('0x29')],'resourceId':_0x55279a['id'],'type':_0x2d3db9[_0x551b('0x29')],'sectionId':_0x2d3db9['id']},{})[_0x551b('0x22')](function(){return _0x29e549;});}else{return _0x29e549;}})['catch'](function(_0x4f42f0){logger[_0x551b('0x28')](_0x551b('0x48'),_0x4f42f0);throw _0x4f42f0;});}return _0x29e549;})[_0x551b('0x22')](respondWithResult(_0x15abb1,0xc9))['catch'](handleError(_0x15abb1,null));};exports['update']=function(_0x5420d7,_0x175a9b){if(_0x5420d7['body']['id']){delete _0x5420d7[_0x551b('0x49')]['id'];}return db[_0x551b('0x2a')]['find']({'where':{'id':_0x5420d7[_0x551b('0x4a')]['id']}})[_0x551b('0x22')](handleEntityNotFound(_0x175a9b,null))[_0x551b('0x22')](saveUpdates(_0x5420d7[_0x551b('0x49')],null))[_0x551b('0x22')](respondWithResult(_0x175a9b,null))[_0x551b('0x4b')](handleError(_0x175a9b,null));};exports[_0x551b('0x26')]=function(_0xd6cea5,_0x29c17c){return db['CmCompany'][_0x551b('0x42')]({'where':{'id':_0xd6cea5[_0x551b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29c17c,null))['then'](removeEntity(_0x29c17c,null))[_0x551b('0x4b')](handleError(_0x29c17c,null));};exports[_0x551b('0x2b')]=function(_0x294844,_0x9ec691){return db[_0x551b('0x2a')][_0x551b('0x2b')]()[_0x551b('0x22')](respondWithResult(_0x9ec691,null))[_0x551b('0x4b')](handleError(_0x9ec691,null));};exports[_0x551b('0x4c')]=function(_0x3e359b,_0x2b6402,_0x4816a3){return db[_0x551b('0x4d')][_0x551b('0x42')]({'where':{'id':_0x3e359b[_0x551b('0x4a')]['id']}})[_0x551b('0x22')](handleEntityNotFound(_0x2b6402,null))[_0x551b('0x22')](function(_0x5bad8a){if(_0x5bad8a){return _0x5bad8a[_0x551b('0x4c')](_0x3e359b[_0x551b('0x49')][_0x551b('0x4e')],_[_0x551b('0x4f')](_0x3e359b['body'],[_0x551b('0x4e'),'id'])||{});}})[_0x551b('0x22')](respondWithResult(_0x2b6402,null))[_0x551b('0x4b')](handleError(_0x2b6402,null));};exports['getContacts']=function(_0x30a17f,_0x5561fd,_0x4f9347){var _0x55d586={};var _0x4ae4b3={};var _0xb552e5;var _0x3731d0;return db[_0x551b('0x2a')]['findOne']({'where':{'id':_0x30a17f[_0x551b('0x4a')]['id']}})[_0x551b('0x22')](handleEntityNotFound(_0x5561fd,null))[_0x551b('0x22')](function(_0x4fef9e){if(_0x4fef9e){_0xb552e5=_0x4fef9e;_0x4ae4b3[_0x551b('0x2c')]=_[_0x551b('0x2d')](db[_0x551b('0x4d')][_0x551b('0x41')]);_0x4ae4b3[_0x551b('0x2e')]=_[_0x551b('0x2d')](_0x30a17f[_0x551b('0x2e')]);_0x4ae4b3['filters']=_[_0x551b('0x30')](_0x4ae4b3['model'],_0x4ae4b3[_0x551b('0x2e')]);_0x55d586[_0x551b('0x32')]=_[_0x551b('0x30')](_0x4ae4b3[_0x551b('0x2c')],qs[_0x551b('0x31')](_0x30a17f[_0x551b('0x2e')][_0x551b('0x31')]));_0x55d586[_0x551b('0x32')]=_0x55d586[_0x551b('0x32')]['length']?_0x55d586[_0x551b('0x32')]:_0x4ae4b3['model'];_0x55d586['order']=qs['sort'](_0x30a17f[_0x551b('0x2e')][_0x551b('0x37')]);_0x55d586[_0x551b('0x38')]=qs[_0x551b('0x2f')](_['pick'](_0x30a17f[_0x551b('0x2e')],_0x4ae4b3[_0x551b('0x2f')]));if(_0x30a17f['query'][_0x551b('0x3a')]){_0x55d586[_0x551b('0x38')]=_[_0x551b('0x3b')](_0x55d586['where'],{'$or':_[_0x551b('0x3c')](_0x55d586[_0x551b('0x32')],function(_0x781ddb){var _0x2987ee={};_0x2987ee[_0x781ddb]={'$like':'%'+_0x30a17f[_0x551b('0x2e')][_0x551b('0x3a')]+'%'};return _0x2987ee;})});}_0x55d586=_[_0x551b('0x3b')]({},_0x55d586,_0x30a17f[_0x551b('0x50')]);return _0xb552e5[_0x551b('0x51')](_0x55d586);}})[_0x551b('0x22')](function(_0x53e3f4){if(_0x53e3f4){_0x3731d0=_0x53e3f4[_0x551b('0x33')];if(!_0x30a17f[_0x551b('0x2e')]['hasOwnProperty']('nolimit')){_0x55d586[_0x551b('0x1c')]=qs[_0x551b('0x1c')](_0x30a17f[_0x551b('0x2e')][_0x551b('0x1c')]);_0x55d586['offset']=qs[_0x551b('0x1a')](_0x30a17f[_0x551b('0x2e')]['offset']);}return _0xb552e5[_0x551b('0x51')](_0x55d586);}})[_0x551b('0x22')](function(_0x55a782){if(_0x55a782){return _0x55a782?{'count':_0x3731d0,'rows':_0x55a782}:null;}})['then'](respondWithResult(_0x5561fd,null))[_0x551b('0x4b')](handleError(_0x5561fd,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3f3abfe..f194581 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 _0x5c53=['bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x16b6ea,_0x20248c){var _0xb288b7=function(_0x12ea4d){while(--_0x12ea4d){_0x16b6ea['push'](_0x16b6ea['shift']());}};_0xb288b7(++_0x20248c);}(_0x5c53,0x7d));var _0x35c5=function(_0x3965ae,_0x6847f7){_0x3965ae=_0x3965ae-0x0;var _0x491c04=_0x5c53[_0x3965ae];return _0x491c04;};'use strict';var _=require(_0x35c5('0x0'));var util=require(_0x35c5('0x1'));var logger=require(_0x35c5('0x2'))(_0x35c5('0x3'));var moment=require(_0x35c5('0x4'));var BPromise=require(_0x35c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35c5('0x6'));var rimraf=require(_0x35c5('0x7'));var config=require(_0x35c5('0x8'));var attributes=require(_0x35c5('0x9'));module[_0x35c5('0xa')]=function(_0x255819,_0x507d9b){return _0x255819[_0x35c5('0xb')]('CmCompany',attributes,{'tableName':_0x35c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc6=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','CmCompany','lodash','util'];(function(_0x10efc1,_0x5d580d){var _0x122514=function(_0x444e90){while(--_0x444e90){_0x10efc1['push'](_0x10efc1['shift']());}};_0x122514(++_0x5d580d);}(_0xafc6,0x10c));var _0x6afc=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xafc6[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var logger=require(_0x6afc('0x2'))(_0x6afc('0x3'));var moment=require(_0x6afc('0x4'));var BPromise=require('bluebird');var rp=require(_0x6afc('0x5'));var fs=require('fs');var path=require(_0x6afc('0x6'));var rimraf=require('rimraf');var config=require(_0x6afc('0x7'));var attributes=require('./cmCompany.attributes');module[_0x6afc('0x8')]=function(_0x2f02a1,_0x5aa1e8){return _0x2f02a1['define'](_0x6afc('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 2d35924..a94ca5a 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 _0xcb37=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x9b03cc,_0x97006){var _0x27c284=function(_0x4e32e3){while(--_0x4e32e3){_0x9b03cc['push'](_0x9b03cc['shift']());}};_0x27c284(++_0x97006);}(_0xcb37,0x1cc));var _0x7cb3=function(_0x2c786e,_0x53b114){_0x2c786e=_0x2c786e-0x0;var _0x2b1c59=_0xcb37[_0x2c786e];return _0x2b1c59;};'use strict';var _=require('lodash');var util=require(_0x7cb3('0x0'));var moment=require(_0x7cb3('0x1'));var BPromise=require(_0x7cb3('0x2'));var rs=require(_0x7cb3('0x3'));var fs=require('fs');var Redis=require(_0x7cb3('0x4'));var db=require(_0x7cb3('0x5'))['db'];var utils=require(_0x7cb3('0x6'));var logger=require(_0x7cb3('0x7'))(_0x7cb3('0x8'));var config=require(_0x7cb3('0x9'));var jayson=require(_0x7cb3('0xa'));var client=jayson['client'][_0x7cb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e66b3,_0x43aaec,_0x4f0099){return new BPromise(function(_0x44a3a2,_0x42ee5a){return client['request'](_0x3e66b3,_0x4f0099)['then'](function(_0x3ecfd6){logger[_0x7cb3('0xc')](_0x7cb3('0xd'),_0x43aaec,'request\x20sent');logger[_0x7cb3('0xe')](_0x7cb3('0xf'),_0x43aaec,_0x7cb3('0x10'),JSON[_0x7cb3('0x11')](_0x3ecfd6));if(_0x3ecfd6[_0x7cb3('0x12')]){if(_0x3ecfd6[_0x7cb3('0x12')][_0x7cb3('0x13')]===0x1f4){logger[_0x7cb3('0x12')](_0x7cb3('0xd'),_0x43aaec,_0x3ecfd6[_0x7cb3('0x12')][_0x7cb3('0x14')]);return _0x42ee5a(_0x3ecfd6[_0x7cb3('0x12')]['message']);}logger[_0x7cb3('0x12')](_0x7cb3('0xd'),_0x43aaec,_0x3ecfd6[_0x7cb3('0x12')]['message']);return _0x44a3a2(_0x3ecfd6[_0x7cb3('0x12')][_0x7cb3('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x43aaec,_0x7cb3('0x10'));_0x44a3a2(_0x3ecfd6[_0x7cb3('0x15')][_0x7cb3('0x14')]);}})['catch'](function(_0x3f076a){logger[_0x7cb3('0x12')]('CmCompany,\x20%s,\x20%s',_0x43aaec,_0x3f076a);_0x42ee5a(_0x3f076a);});});} \ No newline at end of file +var _0x70e8=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x2c2838,_0x334032){var _0x24899a=function(_0x1a6b48){while(--_0x1a6b48){_0x2c2838['push'](_0x2c2838['shift']());}};_0x24899a(++_0x334032);}(_0x70e8,0xab));var _0x870e=function(_0x22ecf6,_0x487db5){_0x22ecf6=_0x22ecf6-0x0;var _0x47cf2d=_0x70e8[_0x22ecf6];return _0x47cf2d;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var moment=require(_0x870e('0x2'));var BPromise=require(_0x870e('0x3'));var rs=require(_0x870e('0x4'));var fs=require('fs');var Redis=require(_0x870e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x870e('0x6'));var logger=require(_0x870e('0x7'))(_0x870e('0x8'));var config=require(_0x870e('0x9'));var jayson=require(_0x870e('0xa'));var client=jayson[_0x870e('0xb')][_0x870e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55581d,_0x2befe3,_0x2bcb42){return new BPromise(function(_0xea28f7,_0x35fee7){return client[_0x870e('0xd')](_0x55581d,_0x2bcb42)[_0x870e('0xe')](function(_0x414bde){logger['info'](_0x870e('0xf'),_0x2befe3,'request\x20sent');logger[_0x870e('0x10')](_0x870e('0x11'),_0x2befe3,_0x870e('0x12'),JSON[_0x870e('0x13')](_0x414bde));if(_0x414bde[_0x870e('0x14')]){if(_0x414bde[_0x870e('0x14')][_0x870e('0x15')]===0x1f4){logger[_0x870e('0x14')](_0x870e('0xf'),_0x2befe3,_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);return _0x35fee7(_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);}logger['error'](_0x870e('0xf'),_0x2befe3,_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);return _0xea28f7(_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);}else{logger[_0x870e('0x17')](_0x870e('0xf'),_0x2befe3,_0x870e('0x12'));_0xea28f7(_0x414bde['result'][_0x870e('0x16')]);}})[_0x870e('0x18')](function(_0xdafee){logger[_0x870e('0x14')](_0x870e('0xf'),_0x2befe3,_0xdafee);_0x35fee7(_0xdafee);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b5d9fbc..c350314 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 _0xe144=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','show','getContacts','create','post','/:id/contacts','addContacts','put','update','destroy','exports'];(function(_0x57a733,_0x4a4360){var _0x4816b0=function(_0xf62b54){while(--_0xf62b54){_0x57a733['push'](_0x57a733['shift']());}};_0x4816b0(++_0x4a4360);}(_0xe144,0x168));var _0x4e14=function(_0x39628c,_0x2eb8c4){_0x39628c=_0x39628c-0x0;var _0x2b0532=_0xe144[_0x39628c];return _0x2b0532;};'use strict';var multer=require(_0x4e14('0x0'));var util=require('util');var path=require(_0x4e14('0x1'));var timeout=require(_0x4e14('0x2'));var express=require(_0x4e14('0x3'));var router=express[_0x4e14('0x4')]();var fs_extra=require(_0x4e14('0x5'));var auth=require(_0x4e14('0x6'));var interaction=require(_0x4e14('0x7'));var config=require(_0x4e14('0x8'));var controller=require(_0x4e14('0x9'));router[_0x4e14('0xa')]('/',auth[_0x4e14('0xb')](),controller[_0x4e14('0xc')]);router[_0x4e14('0xa')]('/describe',auth[_0x4e14('0xb')](),controller[_0x4e14('0xd')]);router['get']('/:id',auth[_0x4e14('0xb')](),controller[_0x4e14('0xe')]);router[_0x4e14('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x4e14('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4e14('0x10')]);router[_0x4e14('0x11')](_0x4e14('0x12'),auth[_0x4e14('0xb')](),controller[_0x4e14('0x13')]);router[_0x4e14('0x14')]('/:id',auth[_0x4e14('0xb')](),controller[_0x4e14('0x15')]);router['delete']('/:id',auth[_0x4e14('0xb')](),controller[_0x4e14('0x16')]);module[_0x4e14('0x17')]=router; \ No newline at end of file +var _0xc672=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/:id/contacts','post','create','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0xc672,0x13f));var _0x2c67=function(_0x39f9a4,_0x7e8513){_0x39f9a4=_0x39f9a4-0x0;var _0x3bd8fa=_0xc672[_0x39f9a4];return _0x3bd8fa;};'use strict';var multer=require('multer');var util=require(_0x2c67('0x0'));var path=require('path');var timeout=require(_0x2c67('0x1'));var express=require(_0x2c67('0x2'));var router=express[_0x2c67('0x3')]();var fs_extra=require(_0x2c67('0x4'));var auth=require(_0x2c67('0x5'));var interaction=require(_0x2c67('0x6'));var config=require(_0x2c67('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2c67('0x8')]);router[_0x2c67('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2c67('0x9')]('/:id',auth[_0x2c67('0xa')](),controller['show']);router[_0x2c67('0x9')](_0x2c67('0xb'),auth[_0x2c67('0xa')](),controller['getContacts']);router[_0x2c67('0xc')]('/',auth[_0x2c67('0xa')](),controller[_0x2c67('0xd')]);router[_0x2c67('0xc')](_0x2c67('0xb'),auth[_0x2c67('0xa')](),controller['addContacts']);router['put']('/:id',auth[_0x2c67('0xa')](),controller[_0x2c67('0xe')]);router[_0x2c67('0xf')](_0x2c67('0x10'),auth[_0x2c67('0xa')](),controller[_0x2c67('0x11')]);module[_0x2c67('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 5a1f6db..b40916c 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 _0xcf74=['TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x31a3eb,_0x365c03){var _0x38410a=function(_0x28a7a9){while(--_0x28a7a9){_0x31a3eb['push'](_0x31a3eb['shift']());}};_0x38410a(++_0x365c03);}(_0xcf74,0x125));var _0x4cf7=function(_0x2203f2,_0x474c4c){_0x2203f2=_0x2203f2-0x0;var _0x3ee091=_0xcf74[_0x2203f2];return _0x3ee091;};'use strict';var _=require('lodash');var Sequelize=require(_0x4cf7('0x0'));module[_0x4cf7('0x1')]={'firstName':{'type':Sequelize[_0x4cf7('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4cf7('0x2')]},'postalCode':{'type':Sequelize[_0x4cf7('0x2')]},'city':{'type':Sequelize[_0x4cf7('0x2')]},'country':{'type':Sequelize[_0x4cf7('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4cf7('0x2')]},'description':{'type':Sequelize[_0x4cf7('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4cf7('0x2')]},'email':{'type':Sequelize[_0x4cf7('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x4cf7('0x2')]},'fb_data':{'type':Sequelize[_0x4cf7('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4cf7('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x4cf7('0x2')]},'line':{'type':Sequelize[_0x4cf7('0x2')]},'wechat':{'type':Sequelize[_0x4cf7('0x2')]},'telegram':{'type':Sequelize[_0x4cf7('0x2')]},'UserId':{'type':Sequelize[_0x4cf7('0x4')]},'priority':{'type':Sequelize[_0x4cf7('0x4')](0x2)[_0x4cf7('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4cf7('0x6')],'defaultValue':Sequelize[_0x4cf7('0x7')]}}; \ No newline at end of file +var _0x56c4=['DATE','NOW','lodash','sequelize','STRING','INTEGER','UNSIGNED'];(function(_0x14a4d0,_0x4c7068){var _0x18c8ab=function(_0x10bd3b){while(--_0x10bd3b){_0x14a4d0['push'](_0x14a4d0['shift']());}};_0x18c8ab(++_0x4c7068);}(_0x56c4,0x72));var _0x456c=function(_0x399895,_0x52e3e2){_0x399895=_0x399895-0x0;var _0xa8818e=_0x56c4[_0x399895];return _0xa8818e;};'use strict';var _=require(_0x456c('0x0'));var Sequelize=require(_0x456c('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x456c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x456c('0x2')]},'street':{'type':Sequelize[_0x456c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x456c('0x2')]},'country':{'type':Sequelize[_0x456c('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x456c('0x2')]},'fax':{'type':Sequelize[_0x456c('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x456c('0x2')]},'facebook':{'type':Sequelize[_0x456c('0x2')]},'fb_data':{'type':Sequelize[_0x456c('0x2')]},'twitter':{'type':Sequelize[_0x456c('0x2')]},'skype':{'type':Sequelize[_0x456c('0x2')]},'teams':{'type':Sequelize[_0x456c('0x2')]},'viber':{'type':Sequelize[_0x456c('0x2')]},'line':{'type':Sequelize[_0x456c('0x2')]},'wechat':{'type':Sequelize[_0x456c('0x2')]},'telegram':{'type':Sequelize[_0x456c('0x2')]},'UserId':{'type':Sequelize[_0x456c('0x3')]},'priority':{'type':Sequelize[_0x456c('0x3')](0x2)[_0x456c('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x456c('0x5')],'defaultValue':Sequelize[_0x456c('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a5e62b8..ede667a 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 _0x7101=['left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','field','Tag','value','split','map','forEach','union','User','dateOfBirth','fieldType','castTo','DATE','buildExpression','type','text','hasOwnProperty','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','filter','replace','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','SELECT','clone','c.id','DESC','having','t.id\x20IN\x20?','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','count','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','tags','columnName','displayName','findAll','values','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','findOrCreate','spread','show','$and','isNil','omit','format','pickBy','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','params','toParam','phone','getTags','rawAttributes','pick','ContactId','includeAll','include','getHopperHistories','getHopperFinals','options','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','fork','binding_keys','CompanyId','createReadStream','file','meta','import','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','sms','whatsapp','voice','-createdAt','includes','channel','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userDisposition','userThirdDisposition','fullname','alias','createdAt','findAndCountAll','Account','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','chat','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','set','Content-Range','json','update','destroy','then','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','color','from','tools_tags','select','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id'];(function(_0x5a83ef,_0xfe8300){var _0x3913cd=function(_0xcb8a24){while(--_0xcb8a24){_0x5a83ef['push'](_0x5a83ef['shift']());}};_0x3913cd(++_0xfe8300);}(_0x7101,0xdf));var _0x1710=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x7101[_0x383627];return _0x2c16a0;};'use strict';var moment=require('moment');var BPromise=require(_0x1710('0x0'));var util=require(_0x1710('0x1'));var path=require(_0x1710('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1710('0x3'));var Papa=require(_0x1710('0x4'));var Redis=require(_0x1710('0x5'));var qs=require(_0x1710('0x6'));var as=require(_0x1710('0x7'));var logger=require(_0x1710('0x8'))('api');var config=require(_0x1710('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x1710('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1710('0xb'))(new Redis(config[_0x1710('0xa')]));require(_0x1710('0xc'))[_0x1710('0xd')](socket);function respondWithResult(_0x4d1602,_0x4e501c){_0x4e501c=_0x4e501c||0xc8;return function(_0x2992be){if(_0x2992be){return _0x4d1602[_0x1710('0xe')](_0x4e501c)['json'](_0x2992be);}};}function respondWithFilteredResult(_0xf927c7,_0x36b1bc){return function(_0x156bd1){if(_0x156bd1){var _0x24a0aa=typeof _0x36b1bc[_0x1710('0xf')]===_0x1710('0x10')&&typeof _0x36b1bc[_0x1710('0x11')]===_0x1710('0x10');var _0x1cb371=_0x156bd1['count'];var _0x31e98c=_0x24a0aa?0x0:_0x36b1bc['offset'];var _0xad654f=_0x24a0aa?_0x156bd1['count']:_0x36b1bc[_0x1710('0xf')]+_0x36b1bc['limit'];var _0x4ef516;if(_0xad654f>=_0x1cb371){_0xad654f=_0x1cb371;_0x4ef516=0xc8;}else{_0x4ef516=0xce;}_0xf927c7['status'](_0x4ef516);return _0xf927c7[_0x1710('0x12')](_0x1710('0x13'),_0x31e98c+'-'+_0xad654f+'/'+_0x1cb371)[_0x1710('0x14')](_0x156bd1);}return null;};}function saveUpdates(_0x3de4d5){return function(_0x1bfb08){if(_0x1bfb08){return _0x1bfb08[_0x1710('0x15')](_0x3de4d5)['then'](function(_0x27cabb){return _0x27cabb;});}return null;};}function removeEntity(_0x31352d){return function(_0x32e480){if(_0x32e480){return _0x32e480[_0x1710('0x16')]()[_0x1710('0x17')](function(){_0x31352d['status'](0xcc)[_0x1710('0x18')]();});}};}function handleEntityNotFound(_0x4d870d){return function(_0x325f07){if(!_0x325f07){_0x4d870d[_0x1710('0x19')](0x194);}return _0x325f07;};}function handleError(_0x289d9b,_0x3eb05c){_0x3eb05c=_0x3eb05c||0x1f4;return function(_0x32b890){logger['error'](_0x32b890[_0x1710('0x1a')]);if(_0x32b890[_0x1710('0x1b')]){delete _0x32b890[_0x1710('0x1b')];}_0x289d9b[_0x1710('0xe')](_0x3eb05c)[_0x1710('0x1c')](_0x32b890);};}exports[_0x1710('0x1d')]=function(_0x394e8d,_0x3b9e08){var _0xe4fd79={},_0x3fe3b2={},_0x2c07a3={'count':0x0,'rows':[]};return db[_0x1710('0x1e')][_0x1710('0x1f')]()[_0x1710('0x17')](function(_0x47964b){var _0x5740e5=[];for(var _0xff1975=0x0;_0xff19750x1){_0x51127a['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1710('0x5d')](_0x297d94),null);}else{if(qs['isNumeric'](_0x297d94)){_0x51127a['or'](_0x1710('0x5e'),_0x297d94+'%');_0x51127a['or']('c.phone\x20LIKE\x20?',_0x297d94+'%');_0x51127a['or'](_0x1710('0x5f'),_0x297d94+'%');_0x51127a['or'](_0x1710('0x60'),_0x297d94+'%');}else if(qs[_0x1710('0x61')](_0x297d94)){_0x51127a['or'](_0x1710('0x62'),_0x297d94+'%');}else{_0x51127a['or'](_0x1710('0x63'),'%'+_0x297d94+'%');_0x51127a['or'](_0x1710('0x64'),'%'+_0x297d94+'%');_0x51127a['or'](_0x1710('0x62'),'%'+_0x297d94+'%');}}}}_0x782d0d['where'](_0x51127a);_0x782d0d[_0x1710('0x65')]('c.id');var _0x184f2e={'type':db[_0x1710('0x66')]['QueryTypes'][_0x1710('0x67')],'raw':!![]};var _0x21a464=_0x782d0d[_0x1710('0x68')]()[_0x1710('0x43')](_0x1710('0x69'));if(_0xe4fd79['order']){_0xe4fd79['order'][_0x1710('0x48')](function(_0x6b769e){_0x782d0d[_0x1710('0x30')]('c.'+_0x6b769e[0x0],_0x6b769e[0x1]===_0x1710('0x6a')?![]:!![]);});}if(!_['isEmpty'](_0x56d567)){_0x782d0d[_0x1710('0x6b')](_0x11b41c);_0x21a464[_0x1710('0x32')](_0x1710('0x6c'),_0x56d567);}BPromise[_0x1710('0x6d')]()['then'](function(){if(!_0x313954)return;if(_0x394e8d[_0x1710('0x6e')][_0x1710('0x6f')]!=='agent')return;if(!_[_0x1710('0x70')](_0x313954[_0x1710('0x42')],[_0x1710('0x43'),'User'])){return _0x394e8d[_0x1710('0x6e')][_0x1710('0x71')]({'attributes':['id'],'raw':!![]})[_0x1710('0x17')](function(_0xdc020c){if(_[_0x1710('0x54')](_0xdc020c)){_0x21a464[_0x1710('0x32')](_0x1710('0x72'));_0x782d0d[_0x1710('0x32')](_0x1710('0x72'));}else{_0x21a464[_0x1710('0x32')](_0x1710('0x56'),_[_0x1710('0x47')](_0xdc020c,'id'));_0x782d0d[_0x1710('0x32')](_0x1710('0x56'),_['map'](_0xdc020c,'id'));}});}})[_0x1710('0x17')](function(){if(_0x394e8d['user'][_0x1710('0x6f')]===_0x1710('0x73')&&!_0x313954&&!_0x394e8d[_0x1710('0x29')][_0x1710('0x55')])return[];return db[_0x1710('0x74')][_0x1710('0x29')](_0x21a464[_0x1710('0x75')](),_0x184f2e);})[_0x1710('0x17')](function(_0x4205b2){_0x2c07a3[_0x1710('0x76')]=_0x4205b2['length'];if(_0x2c07a3[_0x1710('0x76')]===0x0)return[];return db['sequelize']['query'](_0x190138['toString'](),_0x184f2e)['then'](function(_0x392118){_0x2bf156=_[_0x1710('0x77')](_0x392118,'id');_0x184f2e=_[_0x1710('0x78')](_0x184f2e,{'model':db[_0x1710('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394e8d[_0x1710('0x29')][_0x1710('0x2e')]){_0xe4fd79[_0x1710('0x2c')]['forEach'](function(_0x11bcdb){_0x782d0d[_0x1710('0x43')]('c.'+_0x11bcdb);});}else{_0x782d0d['field'](_0x1710('0x69'));_0x782d0d[_0x1710('0x43')](_0x1710('0x79'));_0x782d0d['field'](_0x1710('0x7a'));_0x782d0d['field'](_0x1710('0x7b'));_0x782d0d[_0x1710('0x43')](_0x1710('0x7c'));_0x782d0d[_0x1710('0x43')](_0x1710('0x7d'));_0x782d0d[_0x1710('0x43')](_0x1710('0x7e'));_0x782d0d[_0x1710('0x43')]('c.ListId');_0x782d0d['field'](_0x1710('0x7f'));_0x782d0d['field'](_0x1710('0x80'));_0x782d0d['field'](_0x1710('0x81'));_0x782d0d['field'](_0x1710('0x82'),_0x1710('0x83'));}if(_0xe4fd79[_0x1710('0x11')])_0x782d0d['limit'](_0xe4fd79['limit']);if(_0xe4fd79[_0x1710('0xf')])_0x782d0d[_0x1710('0xf')](_0xe4fd79[_0x1710('0xf')]);return db['sequelize'][_0x1710('0x29')](_0x782d0d[_0x1710('0x75')](),_0x184f2e);});})[_0x1710('0x17')](function(_0x69b5b0){_0x69b5b0['forEach'](function(_0x15bfeb){if(_0x15bfeb[_0x1710('0x83')]){_0x15bfeb[_0x1710('0x84')]=[];_0x15bfeb['TagIds'][_0x1710('0x46')](',')['forEach'](function(_0x4b070c){_0x15bfeb[_0x1710('0x84')][_0x1710('0x23')](_0x2bf156[_0x4b070c]);});}delete _0x15bfeb[_0x1710('0x83')];});_0x2c07a3[_0x1710('0x85')]=_0x69b5b0;return _0x2c07a3;})[_0x1710('0x17')](respondWithFilteredResult(_0x3b9e08,_0xe4fd79));})[_0x1710('0x86')](handleError(_0x3b9e08,null));};exports[_0x1710('0x16')]=function(_0x167405,_0x78128a){return db[_0x1710('0x1e')][_0x1710('0x87')]({'where':{'id':_0x167405['params']['id']}})[_0x1710('0x17')](handleEntityNotFound(_0x78128a,null))[_0x1710('0x17')](removeEntity(_0x78128a,null))[_0x1710('0x86')](handleError(_0x78128a,null));};exports['describe']=function(_0x1e42ae,_0x54c51c){return db[_0x1710('0x1e')]['describe']()[_0x1710('0x17')](function(_0x2077c1){delete _0x2077c1[_0x1710('0x88')];for(var _0x26cd8c=0x0;_0x26cd8c=_0x38bfe0){_0x38739d=_0x38bfe0;_0x3c77d4=0xc8;}else{_0x3c77d4=0xce;}_0x432730[_0x8a5a('0x11')](_0x3c77d4);return _0x432730['set'](_0x8a5a('0x12'),_0x43949c+'-'+_0x38739d+'/'+_0x38bfe0)[_0x8a5a('0xd')](_0x1a4c0c);}return null;};}function saveUpdates(_0x12c739){return function(_0x5f21f3){if(_0x5f21f3){return _0x5f21f3[_0x8a5a('0x13')](_0x12c739)[_0x8a5a('0x14')](function(_0x3f94bc){return _0x3f94bc;});}return null;};}function removeEntity(_0x2fbb5){return function(_0x58e5b5){if(_0x58e5b5){return _0x58e5b5['destroy']()[_0x8a5a('0x14')](function(){_0x2fbb5[_0x8a5a('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x436c1f){return function(_0x4f4d3a){if(!_0x4f4d3a){_0x436c1f[_0x8a5a('0x15')](0x194);}return _0x4f4d3a;};}function handleError(_0xf162d4,_0x297175){_0x297175=_0x297175||0x1f4;return function(_0x56f6fb){logger[_0x8a5a('0x16')](_0x56f6fb[_0x8a5a('0x17')]);if(_0x56f6fb[_0x8a5a('0x18')]){delete _0x56f6fb[_0x8a5a('0x18')];}_0xf162d4[_0x8a5a('0x11')](_0x297175)[_0x8a5a('0x19')](_0x56f6fb);};}exports['index']=function(_0x30475a,_0x2f08ff){var _0xd1df4f={},_0x6d5c54={},_0xea3626={'count':0x0,'rows':[]};return db[_0x8a5a('0x1a')][_0x8a5a('0x1b')]()['then'](function(_0x51ba99){var _0x19d4c3=[];for(var _0x30f6f6=0x0;_0x30f6f60x1){_0x2fccc6['or'](_0x8a5a('0x58'),qs['getFullTextValue'](_0x1d3de1),null);}else{if(qs['isNumeric'](_0x1d3de1)){_0x2fccc6['or'](_0x8a5a('0x59'),_0x1d3de1+'%');_0x2fccc6['or'](_0x8a5a('0x5a'),_0x1d3de1+'%');_0x2fccc6['or'](_0x8a5a('0x5b'),_0x1d3de1+'%');_0x2fccc6['or']('c.fax\x20LIKE\x20?',_0x1d3de1+'%');}else if(qs[_0x8a5a('0x5c')](_0x1d3de1)){_0x2fccc6['or']('c.email\x20LIKE\x20?',_0x1d3de1+'%');}else{_0x2fccc6['or'](_0x8a5a('0x5d'),'%'+_0x1d3de1+'%');_0x2fccc6['or'](_0x8a5a('0x5e'),'%'+_0x1d3de1+'%');_0x2fccc6['or'](_0x8a5a('0x5f'),'%'+_0x1d3de1+'%');}}}}_0x2254ac[_0x8a5a('0x3a')](_0x2fccc6);_0x2254ac[_0x8a5a('0x60')](_0x8a5a('0x61'));var _0x114914={'type':db[_0x8a5a('0x62')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3e7ec3=_0x2254ac['clone']()[_0x8a5a('0x30')](_0x8a5a('0x61'));if(_0xd1df4f[_0x8a5a('0x2c')]){_0xd1df4f[_0x8a5a('0x2c')][_0x8a5a('0x44')](function(_0x297823){_0x2254ac[_0x8a5a('0x2c')]('c.'+_0x297823[0x0],_0x297823[0x1]===_0x8a5a('0x63')?![]:!![]);});}if(!_[_0x8a5a('0x64')](_0x571440)){_0x2254ac['having'](_0x56a391);_0x3e7ec3[_0x8a5a('0x3a')](_0x8a5a('0x65'),_0x571440);}BPromise[_0x8a5a('0x66')]()[_0x8a5a('0x14')](function(){if(!_0x4f1ba1)return;if(_0x30475a[_0x8a5a('0x67')][_0x8a5a('0x68')]!=='agent')return;if(!_['some'](_0x4f1ba1[_0x8a5a('0x3f')],['field',_0x8a5a('0x47')])){return _0x30475a['user'][_0x8a5a('0x69')]({'attributes':['id'],'raw':!![]})[_0x8a5a('0x14')](function(_0x3dff63){if(_[_0x8a5a('0x64')](_0x3dff63)){_0x3e7ec3['where'](_0x8a5a('0x6a'));_0x2254ac['where'](_0x8a5a('0x6a'));}else{_0x3e7ec3['where'](_0x8a5a('0x6b'),_[_0x8a5a('0x43')](_0x3dff63,'id'));_0x2254ac['where'](_0x8a5a('0x6b'),_[_0x8a5a('0x43')](_0x3dff63,'id'));}});}})[_0x8a5a('0x14')](function(){if(_0x30475a[_0x8a5a('0x67')][_0x8a5a('0x68')]===_0x8a5a('0x6c')&&!_0x4f1ba1&&!_0x30475a[_0x8a5a('0x26')]['ListId'])return[];return db['sequelize'][_0x8a5a('0x26')](_0x3e7ec3[_0x8a5a('0x6d')](),_0x114914);})[_0x8a5a('0x14')](function(_0x2ae783){_0xea3626[_0x8a5a('0xe')]=_0x2ae783['length'];if(_0xea3626[_0x8a5a('0xe')]===0x0)return[];return db[_0x8a5a('0x6e')][_0x8a5a('0x26')](_0x3bce7e[_0x8a5a('0x6d')](),_0x114914)[_0x8a5a('0x14')](function(_0x4b6d59){_0xa11aec=_[_0x8a5a('0x6f')](_0x4b6d59,'id');_0x114914=_[_0x8a5a('0x70')](_0x114914,{'model':db[_0x8a5a('0x1a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30475a[_0x8a5a('0x26')][_0x8a5a('0x2b')]){_0xd1df4f[_0x8a5a('0x29')][_0x8a5a('0x44')](function(_0x3ecb4a){_0x2254ac[_0x8a5a('0x30')]('c.'+_0x3ecb4a);});}else{_0x2254ac[_0x8a5a('0x30')]('c.id');_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x71'));_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x72'));_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x73'));_0x2254ac['field'](_0x8a5a('0x74'));_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x75'));_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x76'));_0x2254ac[_0x8a5a('0x30')]('c.ListId');_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x77'));_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x78'));_0x2254ac[_0x8a5a('0x30')]('c.CompanyId');_0x2254ac[_0x8a5a('0x30')](_0x8a5a('0x79'),'TagIds');}if(_0xd1df4f['limit'])_0x2254ac[_0x8a5a('0x10')](_0xd1df4f[_0x8a5a('0x10')]);if(_0xd1df4f['offset'])_0x2254ac[_0x8a5a('0xf')](_0xd1df4f[_0x8a5a('0xf')]);return db[_0x8a5a('0x6e')]['query'](_0x2254ac[_0x8a5a('0x6d')](),_0x114914);});})[_0x8a5a('0x14')](function(_0x598815){_0x598815[_0x8a5a('0x44')](function(_0x317b9f){if(_0x317b9f['TagIds']){_0x317b9f[_0x8a5a('0x7a')]=[];_0x317b9f[_0x8a5a('0x7b')][_0x8a5a('0x42')](',')[_0x8a5a('0x44')](function(_0x8b8303){_0x317b9f[_0x8a5a('0x7a')][_0x8a5a('0x1f')](_0xa11aec[_0x8b8303]);});}delete _0x317b9f[_0x8a5a('0x7b')];});_0xea3626['rows']=_0x598815;return _0xea3626;})['then'](respondWithFilteredResult(_0x2f08ff,_0xd1df4f));})[_0x8a5a('0x7c')](handleError(_0x2f08ff,null));};exports['destroy']=function(_0x5ed505,_0x4f953d){return db[_0x8a5a('0x1a')][_0x8a5a('0x7d')]({'where':{'id':_0x5ed505[_0x8a5a('0x7e')]['id']}})['then'](handleEntityNotFound(_0x4f953d,null))[_0x8a5a('0x14')](removeEntity(_0x4f953d,null))[_0x8a5a('0x7c')](handleError(_0x4f953d,null));};exports[_0x8a5a('0x1b')]=function(_0x42ceec,_0x45c188){return db[_0x8a5a('0x1a')][_0x8a5a('0x1b')]()['then'](function(_0x3932f7){delete _0x3932f7[_0x8a5a('0x7f')];for(var _0x2f74aa=0x0;_0x2f74aa{}\s\\|]/g,'-');_0x239c64(null,util['format'](_0x18ba('0x24'),path[_0x18ba('0x25')](_0x3c863c[_0x18ba('0x22')],path[_0x18ba('0x26')](_0x3c863c[_0x18ba('0x22')])),Date[_0x18ba('0x27')](),path[_0x18ba('0x26')](_0x3c863c[_0x18ba('0x22')])));}})});router[_0x18ba('0x18')](_0x18ba('0x28'),upload[_0x18ba('0x29')](_0x18ba('0x2a')),controller[_0x18ba('0x2b')]);var upload=multer({'storage':multer[_0x18ba('0x1e')]({'destination':function(_0x19599f,_0x17f988,_0x1ee2c4){_0x1ee2c4(null,path[_0x18ba('0x1f')](config[_0x18ba('0x20')],'server/files/tmp'));},'filename':function(_0x4394bd,_0x1976c0,_0x23cd66){_0x1976c0[_0x18ba('0x22')]=_0x1976c0[_0x18ba('0x22')][_0x18ba('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23cd66(null,util[_0x18ba('0x2c')](_0x18ba('0x24'),path['basename'](_0x1976c0['originalname'],path[_0x18ba('0x26')](_0x1976c0['originalname'])),Date[_0x18ba('0x27')](),path[_0x18ba('0x26')](_0x1976c0[_0x18ba('0x22')])));}})});router[_0x18ba('0x18')](_0x18ba('0x2d'),upload[_0x18ba('0x29')]('file'),controller['upload']);router[_0x18ba('0x18')](_0x18ba('0x2e'),auth[_0x18ba('0xd')](),controller[_0x18ba('0x2f')]);router[_0x18ba('0x30')]('/:id',auth[_0x18ba('0xd')](),controller[_0x18ba('0x31')]);router['delete'](_0x18ba('0xc'),auth[_0x18ba('0xd')](),controller[_0x18ba('0x32')]);module[_0x18ba('0x33')]=router; \ No newline at end of file +var _0x50ec=['/:id/jscripty_sessions','getJscriptySessions','/:id/journey','/merge','merge','post','/create_many','bulkCreate','setTags','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','/csv','file','uploadCsv','diskStorage','now','/upload','single','/upload/:id','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getHoppers','/:id/hopper_finals','getHopperFinals'];(function(_0x5b2cd6,_0xacb1d7){var _0x2c7b78=function(_0x3c077a){while(--_0x3c077a){_0x5b2cd6['push'](_0x5b2cd6['shift']());}};_0x2c7b78(++_0xacb1d7);}(_0x50ec,0x1a7));var _0xc50e=function(_0x29db9f,_0x12f814){_0x29db9f=_0x29db9f-0x0;var _0x207da6=_0x50ec[_0x29db9f];return _0x207da6;};'use strict';var multer=require(_0xc50e('0x0'));var util=require(_0xc50e('0x1'));var path=require(_0xc50e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc50e('0x3'));var router=express[_0xc50e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc50e('0x5'));var config=require('../../config/environment');var controller=require(_0xc50e('0x6'));router[_0xc50e('0x7')]('/',auth[_0xc50e('0x8')](),controller[_0xc50e('0x9')]);router[_0xc50e('0x7')](_0xc50e('0xa'),auth['isAuthenticated'](),controller[_0xc50e('0xb')]);router[_0xc50e('0x7')](_0xc50e('0xc'),auth['isAuthenticated'](),controller[_0xc50e('0xd')]);router[_0xc50e('0x7')](_0xc50e('0xe'),auth[_0xc50e('0x8')](),controller['getTags']);router[_0xc50e('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xc50e('0xf')]);router[_0xc50e('0x7')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0xc50e('0x10'),auth['isAuthenticated'](),controller[_0xc50e('0x11')]);router[_0xc50e('0x7')](_0xc50e('0x12'),auth[_0xc50e('0x8')](),controller[_0xc50e('0x13')]);router['get'](_0xc50e('0x14'),auth[_0xc50e('0x8')](),controller['getJourney']);router['post'](_0xc50e('0x15'),auth[_0xc50e('0x8')](),controller[_0xc50e('0x16')]);router[_0xc50e('0x17')]('/',auth[_0xc50e('0x8')](),controller['create']);router[_0xc50e('0x17')](_0xc50e('0x18'),auth['isAuthenticated'](),controller[_0xc50e('0x19')]);router[_0xc50e('0x17')](_0xc50e('0xe'),auth[_0xc50e('0x8')](),controller[_0xc50e('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x596a73,_0x10d453,_0x33eaf2){_0x33eaf2(null,path[_0xc50e('0x1b')](config[_0xc50e('0x1c')],_0xc50e('0x1d')));},'filename':function(_0x58a9d3,_0x474d9f,_0x57bd7c){_0x474d9f[_0xc50e('0x1e')]=_0x474d9f['originalname'][_0xc50e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57bd7c(null,util[_0xc50e('0x20')](_0xc50e('0x21'),path[_0xc50e('0x22')](_0x474d9f[_0xc50e('0x1e')],path[_0xc50e('0x23')](_0x474d9f[_0xc50e('0x1e')])),Date['now'](),path[_0xc50e('0x23')](_0x474d9f['originalname'])));}})});router['post'](_0xc50e('0x24'),upload['single'](_0xc50e('0x25')),controller[_0xc50e('0x26')]);var upload=multer({'storage':multer[_0xc50e('0x27')]({'destination':function(_0x1ed25c,_0x24eb4d,_0x552b61){_0x552b61(null,path[_0xc50e('0x1b')](config[_0xc50e('0x1c')],_0xc50e('0x1d')));},'filename':function(_0x4eb49d,_0x4797ac,_0x2a17c3){_0x4797ac[_0xc50e('0x1e')]=_0x4797ac[_0xc50e('0x1e')][_0xc50e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2a17c3(null,util[_0xc50e('0x20')](_0xc50e('0x21'),path['basename'](_0x4797ac['originalname'],path[_0xc50e('0x23')](_0x4797ac[_0xc50e('0x1e')])),Date[_0xc50e('0x28')](),path[_0xc50e('0x23')](_0x4797ac[_0xc50e('0x1e')])));}})});router[_0xc50e('0x17')](_0xc50e('0x29'),upload[_0xc50e('0x2a')](_0xc50e('0x25')),controller['upload']);router['post'](_0xc50e('0x2b'),auth[_0xc50e('0x8')](),controller['import']);router[_0xc50e('0x2c')](_0xc50e('0xc'),auth[_0xc50e('0x8')](),controller[_0xc50e('0x2d')]);router[_0xc50e('0x2e')](_0xc50e('0xc'),auth[_0xc50e('0x8')](),controller[_0xc50e('0x2f')]);module[_0xc50e('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 08413ba..627b1eb 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 _0xa667=['alias','long','type','select','parse','values','isArray','stringify','ENUM','lodash','VIRTUAL','getDataValue','STRING','setDataValue'];(function(_0x1f97e8,_0x445a4a){var _0x1ed77c=function(_0x1c990d){while(--_0x1c990d){_0x1f97e8['push'](_0x1f97e8['shift']());}};_0x1ed77c(++_0x445a4a);}(_0xa667,0x87));var _0x7a66=function(_0x1ff582,_0xdf8103){_0x1ff582=_0x1ff582-0x0;var _0x58ba85=_0xa667[_0x1ff582];return _0x58ba85;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7a66('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a66('0x1')],'get':function(_0x475d27){return this[_0x7a66('0x2')]('alias');}},'alias':{'type':Sequelize[_0x7a66('0x3')],'allowNull':![],'set':function(_0x288618){this[_0x7a66('0x4')](_0x7a66('0x5'),_0x288618?_0x288618:this[_0x7a66('0x2')]('name'));}},'type':{'type':Sequelize[_0x7a66('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x7a66('0x6')),'get':function(){if(this[_0x7a66('0x2')](_0x7a66('0x7'))===_0x7a66('0x8')){return JSON[_0x7a66('0x9')](this[_0x7a66('0x2')](_0x7a66('0xa')));}else{return this[_0x7a66('0x2')](_0x7a66('0xa'));}},'set':function(_0x38c780){if(Array[_0x7a66('0xb')](_0x38c780)){this[_0x7a66('0x4')](_0x7a66('0xa'),JSON[_0x7a66('0xc')](_0x38c780));}else{this['setDataValue'](_0x7a66('0xa'),_0x38c780);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7a66('0xd')]('voice')}}; \ No newline at end of file +var _0x1ec1=['ENUM','sequelize','lodash','exports','VIRTUAL','alias','STRING','getDataValue','long','type','select','parse','values','setDataValue','stringify','BOOLEAN'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x1ec1,0x71));var _0x11ec=function(_0x7365ee,_0x27daeb){_0x7365ee=_0x7365ee-0x0;var _0x59fcd1=_0x1ec1[_0x7365ee];return _0x59fcd1;};'use strict';var Sequelize=require(_0x11ec('0x0'));var _=require(_0x11ec('0x1'));module[_0x11ec('0x2')]={'name':{'type':Sequelize[_0x11ec('0x3')],'get':function(_0x730cf4){return this['getDataValue'](_0x11ec('0x4'));}},'alias':{'type':Sequelize[_0x11ec('0x5')],'allowNull':![],'set':function(_0x3a2734){this['setDataValue'](_0x11ec('0x4'),_0x3a2734?_0x3a2734:this[_0x11ec('0x6')]('name'));}},'type':{'type':Sequelize[_0x11ec('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x11ec('0x7')),'get':function(){if(this[_0x11ec('0x6')](_0x11ec('0x8'))===_0x11ec('0x9')){return JSON[_0x11ec('0xa')](this[_0x11ec('0x6')](_0x11ec('0xb')));}else{return this['getDataValue'](_0x11ec('0xb'));}},'set':function(_0x5b9afc){if(Array['isArray'](_0x5b9afc)){this[_0x11ec('0xc')]('values',JSON[_0x11ec('0xd')](_0x5b9afc));}else{this[_0x11ec('0xc')](_0x11ec('0xb'),_0x5b9afc);}}},'required':{'type':Sequelize[_0x11ec('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x11ec('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x11ec('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index aafc393..2a76569 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 _0x3dc1=['number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','type','VIRTUAL','includeAll','include','findAll','rows','catch','merge','options','find','update','body','params','sequelize','transaction','create','Sequelize','TEXT','text'];(function(_0x85188d,_0x1492e2){var _0x3a5680=function(_0x48b883){while(--_0x48b883){_0x85188d['push'](_0x85188d['shift']());}};_0x3a5680(++_0x1492e2);}(_0x3dc1,0xb8));var _0x13dc=function(_0x37ed4b,_0x4bc47d){_0x37ed4b=_0x37ed4b-0x0;var _0x19b578=_0x3dc1[_0x37ed4b];return _0x19b578;};'use strict';var emlformat=require(_0x13dc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x13dc('0x1'));var rp=require('request-promise');var moment=require(_0x13dc('0x2'));var BPromise=require(_0x13dc('0x3'));var Mustache=require(_0x13dc('0x4'));var util=require('util');var path=require(_0x13dc('0x5'));var sox=require(_0x13dc('0x6'));var csv=require(_0x13dc('0x7'));var ejs=require(_0x13dc('0x8'));var fs=require('fs');var fs_extra=require(_0x13dc('0x9'));var _=require(_0x13dc('0xa'));var squel=require('squel');var crypto=require(_0x13dc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x13dc('0xc'));var toCsv=require(_0x13dc('0x7'));var querystring=require(_0x13dc('0xd'));var Papa=require(_0x13dc('0xe'));var Redis=require(_0x13dc('0xf'));var authService=require(_0x13dc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13dc('0x11'));var logger=require(_0x13dc('0x12'))(_0x13dc('0x13'));var utils=require(_0x13dc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x13dc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x523085,_0xae8b00){_0xae8b00=_0xae8b00||0xcc;return function(_0x2a84ba){if(_0x2a84ba){return _0x523085[_0x13dc('0x16')](_0xae8b00);}return _0x523085[_0x13dc('0x17')](_0xae8b00)[_0x13dc('0x18')]();};}function respondWithResult(_0x54c61c,_0xbadabc){_0xbadabc=_0xbadabc||0xc8;return function(_0x4da703){if(_0x4da703){return _0x54c61c[_0x13dc('0x17')](_0xbadabc)['json'](_0x4da703);}};}function respondWithFilteredResult(_0x4ebd18,_0x300740){return function(_0x25d2b5){if(_0x25d2b5){var _0x1003dd=typeof _0x300740[_0x13dc('0x19')]===_0x13dc('0x1a')&&typeof _0x300740[_0x13dc('0x1b')]===_0x13dc('0x1a');var _0x4162ec=_0x25d2b5[_0x13dc('0x1c')];var _0x47436f=_0x1003dd?0x0:_0x300740[_0x13dc('0x19')];var _0x848063=_0x1003dd?_0x25d2b5[_0x13dc('0x1c')]:_0x300740[_0x13dc('0x19')]+_0x300740[_0x13dc('0x1b')];var _0x126c22;if(_0x848063>=_0x4162ec){_0x848063=_0x4162ec;_0x126c22=0xc8;}else{_0x126c22=0xce;}_0x4ebd18['status'](_0x126c22);return _0x4ebd18[_0x13dc('0x1d')](_0x13dc('0x1e'),_0x47436f+'-'+_0x848063+'/'+_0x4162ec)[_0x13dc('0x1f')](_0x25d2b5);}return null;};}function patchUpdates(_0x20fc2c){return function(_0x244491){try{jsonpatch[_0x13dc('0x20')](_0x244491,_0x20fc2c,!![]);}catch(_0x1c4af7){return BPromise[_0x13dc('0x21')](_0x1c4af7);}return _0x244491['save']();};}function saveUpdates(_0x129e7a,_0xbdedc6){return function(_0x416563){if(_0x416563){return _0x416563['update'](_0x129e7a)[_0x13dc('0x22')](function(_0x22093b){return _0x22093b;});}return null;};}function removeEntity(_0x2adf2c,_0x43b088){return function(_0x49e682){if(_0x49e682){return _0x49e682[_0x13dc('0x23')]()[_0x13dc('0x22')](function(){_0x2adf2c[_0x13dc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b8ae,_0x4133ad){return function(_0x24499a){if(!_0x24499a){_0x57b8ae[_0x13dc('0x16')](0x194);}return _0x24499a;};}function handleError(_0x55dab4,_0x31267f){_0x31267f=_0x31267f||0x1f4;return function(_0x5831e7){logger[_0x13dc('0x24')](_0x5831e7[_0x13dc('0x25')]);if(_0x5831e7[_0x13dc('0x26')]){delete _0x5831e7['name'];}_0x55dab4['status'](_0x31267f)[_0x13dc('0x27')](_0x5831e7);};}exports[_0x13dc('0x28')]=function(_0x3f07a3,_0x4b1e03){var _0x1b3f74={},_0x26d41b={},_0x386536={'count':0x0,'rows':[]};var _0xc603c=_[_0x13dc('0x29')](db[_0x13dc('0x2a')][_0x13dc('0x2b')],function(_0x28bda9){return{'name':_0x28bda9[_0x13dc('0x2c')],'type':_0x28bda9['type']['key']};});_0x26d41b[_0x13dc('0x2d')]=_['differenceBy'](_['map'](_0xc603c,'name'),[_0x13dc('0x26')]);_0x26d41b[_0x13dc('0x2e')]=_[_0x13dc('0x2f')](_0x3f07a3[_0x13dc('0x2e')]);_0x26d41b['filters']=_['intersection'](_0x26d41b[_0x13dc('0x2d')],_0x26d41b[_0x13dc('0x2e')]);_0x1b3f74[_0x13dc('0x30')]=_[_0x13dc('0x31')](_0x26d41b[_0x13dc('0x2d')],qs[_0x13dc('0x32')](_0x3f07a3['query'][_0x13dc('0x32')]));_0x1b3f74[_0x13dc('0x30')]=_0x1b3f74[_0x13dc('0x30')][_0x13dc('0x33')]?_0x1b3f74[_0x13dc('0x30')]:_0x26d41b[_0x13dc('0x2d')];if(!_0x3f07a3[_0x13dc('0x2e')][_0x13dc('0x34')](_0x13dc('0x35'))){_0x1b3f74['limit']=qs[_0x13dc('0x1b')](_0x3f07a3[_0x13dc('0x2e')]['limit']);_0x1b3f74[_0x13dc('0x19')]=qs[_0x13dc('0x19')](_0x3f07a3['query']['offset']);}_0x1b3f74[_0x13dc('0x36')]=qs[_0x13dc('0x37')](_0x3f07a3[_0x13dc('0x2e')][_0x13dc('0x37')]);_0x1b3f74['where']=qs[_0x13dc('0x38')](_[_0x13dc('0x39')](_0x3f07a3[_0x13dc('0x2e')],_0x26d41b['filters']),_0xc603c);if(_0x3f07a3[_0x13dc('0x2e')]['filter']){_0x1b3f74['where']=_['merge'](_0x1b3f74['where'],{'$or':_[_0x13dc('0x29')](_0xc603c,function(_0x48e8c6){if(_0x48e8c6[_0x13dc('0x3a')]!==_0x13dc('0x3b')){var _0x21dd8d={};_0x21dd8d[_0x48e8c6['name']]={'$like':'%'+_0x3f07a3[_0x13dc('0x2e')]['filter']+'%'};return _0x21dd8d;}})});}_0x1b3f74=_['merge']({},_0x1b3f74,_0x3f07a3['options']);var _0x2af10f={'where':_0x1b3f74['where']};return db[_0x13dc('0x2a')][_0x13dc('0x1c')](_0x2af10f)['then'](function(_0x5e72aa){_0x386536[_0x13dc('0x1c')]=_0x5e72aa;if(_0x3f07a3[_0x13dc('0x2e')][_0x13dc('0x3c')]){_0x1b3f74[_0x13dc('0x3d')]=[{'all':!![]}];}return db[_0x13dc('0x2a')][_0x13dc('0x3e')](_0x1b3f74);})[_0x13dc('0x22')](function(_0x1b1932){_0x386536[_0x13dc('0x3f')]=_0x1b1932;return _0x386536;})[_0x13dc('0x22')](respondWithFilteredResult(_0x4b1e03,_0x1b3f74))[_0x13dc('0x40')](handleError(_0x4b1e03,null));};exports['show']=function(_0x5b6c63,_0xe86416){var _0xe79926={'raw':!![],'where':{'id':_0x5b6c63['params']['id']}},_0x3706a9={};_0x3706a9['model']=_[_0x13dc('0x2f')](db[_0x13dc('0x2a')][_0x13dc('0x2b')]);_0x3706a9[_0x13dc('0x2e')]=_[_0x13dc('0x2f')](_0x5b6c63[_0x13dc('0x2e')]);_0x3706a9[_0x13dc('0x38')]=_[_0x13dc('0x31')](_0x3706a9[_0x13dc('0x2d')],_0x3706a9[_0x13dc('0x2e')]);_0xe79926[_0x13dc('0x30')]=_[_0x13dc('0x31')](_0x3706a9[_0x13dc('0x2d')],qs[_0x13dc('0x32')](_0x5b6c63[_0x13dc('0x2e')]['fields']));_0xe79926[_0x13dc('0x30')]=_0xe79926[_0x13dc('0x30')][_0x13dc('0x33')]?_0xe79926[_0x13dc('0x30')]:_0x3706a9[_0x13dc('0x2d')];if(_0x5b6c63[_0x13dc('0x2e')]['includeAll']){_0xe79926[_0x13dc('0x3d')]=[{'all':!![]}];}_0xe79926=_[_0x13dc('0x41')]({},_0xe79926,_0x5b6c63[_0x13dc('0x42')]);return db[_0x13dc('0x2a')][_0x13dc('0x43')](_0xe79926)['then'](handleEntityNotFound(_0xe86416,null))[_0x13dc('0x22')](respondWithResult(_0xe86416,null))[_0x13dc('0x40')](handleError(_0xe86416,null));};exports[_0x13dc('0x44')]=function(_0x5f0791,_0x15f71f){if(_0x5f0791[_0x13dc('0x45')]['id']){delete _0x5f0791[_0x13dc('0x45')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x5f0791[_0x13dc('0x46')]['id']}})[_0x13dc('0x22')](handleEntityNotFound(_0x15f71f,null))[_0x13dc('0x22')](saveUpdates(_0x5f0791[_0x13dc('0x45')],null))[_0x13dc('0x22')](respondWithResult(_0x15f71f,null))[_0x13dc('0x40')](handleError(_0x15f71f,null));};exports['destroy']=function(_0x516ff0,_0x3ca533){return db[_0x13dc('0x2a')]['find']({'where':{'id':_0x516ff0['params']['id']}})['then'](handleEntityNotFound(_0x3ca533,null))[_0x13dc('0x22')](removeEntity(_0x3ca533,null))['catch'](handleError(_0x3ca533,null));};exports['create']=function(_0x4cefdd,_0x18c029){var _0x2c6cba;return db[_0x13dc('0x47')][_0x13dc('0x48')](function(_0x4eae72){return db[_0x13dc('0x2a')][_0x13dc('0x49')](_0x4cefdd[_0x13dc('0x45')],{'transaction':_0x4eae72})[_0x13dc('0x22')](function(_0x41b636){_0x2c6cba=_0x41b636;var _0x3cdde5={'type':db[_0x13dc('0x4a')][_0x13dc('0x4b')],'transaction':_0x4eae72};switch(_0x4cefdd[_0x13dc('0x45')][_0x13dc('0x3a')]){case _0x13dc('0x4c'):_0x3cdde5[_0x13dc('0x3a')]=db[_0x13dc('0x4a')]['TEXT'];break;case _0x13dc('0x4d'):_0x3cdde5[_0x13dc('0x3a')]=db[_0x13dc('0x4a')][_0x13dc('0x4e')];break;case _0x13dc('0x4f'):_0x3cdde5[_0x13dc('0x3a')]=db['Sequelize'][_0x13dc('0x50')];_0x3cdde5[_0x13dc('0x51')]=![];break;default:}return db[_0x13dc('0x47')][_0x13dc('0x52')][_0x13dc('0x53')](_0x13dc('0x54'),util[_0x13dc('0x55')](_0x13dc('0x56'),_0x2c6cba['id']),_0x3cdde5);})[_0x13dc('0x22')](function(){return _0x2c6cba;});})[_0x13dc('0x22')](respondWithResult(_0x18c029,0xc9))[_0x13dc('0x40')](handleError(_0x18c029,null));}; \ No newline at end of file +var _0xa1e4=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','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','sendStatus','end','status','json','offset','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','intersection','attributes','fields','length','nolimit','order'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa1e4,0xcf));var _0x4a1e=function(_0x29851d,_0x1a7baf){_0x29851d=_0x29851d-0x0;var _0x4d142f=_0xa1e4[_0x29851d];return _0x4d142f;};'use strict';var emlformat=require(_0x4a1e('0x0'));var rimraf=require(_0x4a1e('0x1'));var zipdir=require(_0x4a1e('0x2'));var jsonpatch=require(_0x4a1e('0x3'));var rp=require(_0x4a1e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a1e('0x5'));var util=require(_0x4a1e('0x6'));var path=require('path');var sox=require(_0x4a1e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a1e('0x8'));var _=require(_0x4a1e('0x9'));var squel=require(_0x4a1e('0xa'));var crypto=require(_0x4a1e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4a1e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4a1e('0xd'));var Papa=require(_0x4a1e('0xe'));var Redis=require(_0x4a1e('0xf'));var authService=require(_0x4a1e('0x10'));var qs=require(_0x4a1e('0x11'));var as=require(_0x4a1e('0x12'));var hardwareService=require(_0x4a1e('0x13'));var logger=require(_0x4a1e('0x14'))(_0x4a1e('0x15'));var utils=require('../../config/utils');var config=require(_0x4a1e('0x16'));var licenseUtil=require(_0x4a1e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7c24,_0x453977){_0x453977=_0x453977||0xcc;return function(_0x559014){if(_0x559014){return _0x2a7c24[_0x4a1e('0x18')](_0x453977);}return _0x2a7c24['status'](_0x453977)[_0x4a1e('0x19')]();};}function respondWithResult(_0xfd105c,_0x14627b){_0x14627b=_0x14627b||0xc8;return function(_0x469d55){if(_0x469d55){return _0xfd105c[_0x4a1e('0x1a')](_0x14627b)[_0x4a1e('0x1b')](_0x469d55);}};}function respondWithFilteredResult(_0x166bfe,_0x3d1686){return function(_0x13b755){if(_0x13b755){var _0x429f33=typeof _0x3d1686[_0x4a1e('0x1c')]==='undefined'&&typeof _0x3d1686['limit']==='undefined';var _0x54d707=_0x13b755[_0x4a1e('0x1d')];var _0x3485ca=_0x429f33?0x0:_0x3d1686['offset'];var _0x3fcaf6=_0x429f33?_0x13b755[_0x4a1e('0x1d')]:_0x3d1686['offset']+_0x3d1686[_0x4a1e('0x1e')];var _0xcbaa26;if(_0x3fcaf6>=_0x54d707){_0x3fcaf6=_0x54d707;_0xcbaa26=0xc8;}else{_0xcbaa26=0xce;}_0x166bfe[_0x4a1e('0x1a')](_0xcbaa26);return _0x166bfe[_0x4a1e('0x1f')](_0x4a1e('0x20'),_0x3485ca+'-'+_0x3fcaf6+'/'+_0x54d707)[_0x4a1e('0x1b')](_0x13b755);}return null;};}function patchUpdates(_0x31b351){return function(_0x42f517){try{jsonpatch['apply'](_0x42f517,_0x31b351,!![]);}catch(_0x571ea9){return BPromise['reject'](_0x571ea9);}return _0x42f517['save']();};}function saveUpdates(_0x4ea192,_0x55bf5f){return function(_0x46e787){if(_0x46e787){return _0x46e787[_0x4a1e('0x21')](_0x4ea192)[_0x4a1e('0x22')](function(_0x34862a){return _0x34862a;});}return null;};}function removeEntity(_0x3cda1f,_0x670fed){return function(_0x464855){if(_0x464855){return _0x464855[_0x4a1e('0x23')]()[_0x4a1e('0x22')](function(){_0x3cda1f[_0x4a1e('0x1a')](0xcc)[_0x4a1e('0x19')]();});}};}function handleEntityNotFound(_0x5e467e,_0x3030e5){return function(_0x1d5032){if(!_0x1d5032){_0x5e467e['sendStatus'](0x194);}return _0x1d5032;};}function handleError(_0x5730eb,_0x1dc3f6){_0x1dc3f6=_0x1dc3f6||0x1f4;return function(_0x282813){logger[_0x4a1e('0x24')](_0x282813[_0x4a1e('0x25')]);if(_0x282813[_0x4a1e('0x26')]){delete _0x282813['name'];}_0x5730eb[_0x4a1e('0x1a')](_0x1dc3f6)[_0x4a1e('0x27')](_0x282813);};}exports[_0x4a1e('0x28')]=function(_0x355dba,_0x2f680f){var _0x410531={},_0x3fb27f={},_0x5944f3={'count':0x0,'rows':[]};var _0x7f492a=_[_0x4a1e('0x29')](db[_0x4a1e('0x2a')][_0x4a1e('0x2b')],function(_0x2814a5){return{'name':_0x2814a5[_0x4a1e('0x2c')],'type':_0x2814a5[_0x4a1e('0x2d')][_0x4a1e('0x2e')]};});_0x3fb27f[_0x4a1e('0x2f')]=_[_0x4a1e('0x30')](_[_0x4a1e('0x29')](_0x7f492a,_0x4a1e('0x26')),[_0x4a1e('0x26')]);_0x3fb27f['query']=_[_0x4a1e('0x31')](_0x355dba[_0x4a1e('0x32')]);_0x3fb27f['filters']=_[_0x4a1e('0x33')](_0x3fb27f[_0x4a1e('0x2f')],_0x3fb27f['query']);_0x410531[_0x4a1e('0x34')]=_[_0x4a1e('0x33')](_0x3fb27f[_0x4a1e('0x2f')],qs[_0x4a1e('0x35')](_0x355dba[_0x4a1e('0x32')][_0x4a1e('0x35')]));_0x410531[_0x4a1e('0x34')]=_0x410531[_0x4a1e('0x34')][_0x4a1e('0x36')]?_0x410531['attributes']:_0x3fb27f[_0x4a1e('0x2f')];if(!_0x355dba['query']['hasOwnProperty'](_0x4a1e('0x37'))){_0x410531[_0x4a1e('0x1e')]=qs[_0x4a1e('0x1e')](_0x355dba[_0x4a1e('0x32')][_0x4a1e('0x1e')]);_0x410531[_0x4a1e('0x1c')]=qs['offset'](_0x355dba[_0x4a1e('0x32')][_0x4a1e('0x1c')]);}_0x410531[_0x4a1e('0x38')]=qs[_0x4a1e('0x39')](_0x355dba[_0x4a1e('0x32')]['sort']);_0x410531[_0x4a1e('0x3a')]=qs[_0x4a1e('0x3b')](_[_0x4a1e('0x3c')](_0x355dba[_0x4a1e('0x32')],_0x3fb27f['filters']),_0x7f492a);if(_0x355dba[_0x4a1e('0x32')][_0x4a1e('0x3d')]){_0x410531[_0x4a1e('0x3a')]=_[_0x4a1e('0x3e')](_0x410531[_0x4a1e('0x3a')],{'$or':_[_0x4a1e('0x29')](_0x7f492a,function(_0x40b431){if(_0x40b431[_0x4a1e('0x2d')]!==_0x4a1e('0x3f')){var _0x21223f={};_0x21223f[_0x40b431['name']]={'$like':'%'+_0x355dba['query'][_0x4a1e('0x3d')]+'%'};return _0x21223f;}})});}_0x410531=_[_0x4a1e('0x3e')]({},_0x410531,_0x355dba[_0x4a1e('0x40')]);var _0x2ad166={'where':_0x410531[_0x4a1e('0x3a')]};return db['CmCustomField'][_0x4a1e('0x1d')](_0x2ad166)[_0x4a1e('0x22')](function(_0x3aa746){_0x5944f3[_0x4a1e('0x1d')]=_0x3aa746;if(_0x355dba[_0x4a1e('0x32')]['includeAll']){_0x410531[_0x4a1e('0x41')]=[{'all':!![]}];}return db[_0x4a1e('0x2a')][_0x4a1e('0x42')](_0x410531);})[_0x4a1e('0x22')](function(_0x541eca){_0x5944f3[_0x4a1e('0x43')]=_0x541eca;return _0x5944f3;})[_0x4a1e('0x22')](respondWithFilteredResult(_0x2f680f,_0x410531))[_0x4a1e('0x44')](handleError(_0x2f680f,null));};exports['show']=function(_0x333069,_0x575fec){var _0x5a5693={'raw':!![],'where':{'id':_0x333069[_0x4a1e('0x45')]['id']}},_0x30a31c={};_0x30a31c['model']=_[_0x4a1e('0x31')](db['CmCustomField'][_0x4a1e('0x2b')]);_0x30a31c[_0x4a1e('0x32')]=_[_0x4a1e('0x31')](_0x333069[_0x4a1e('0x32')]);_0x30a31c[_0x4a1e('0x3b')]=_[_0x4a1e('0x33')](_0x30a31c[_0x4a1e('0x2f')],_0x30a31c[_0x4a1e('0x32')]);_0x5a5693[_0x4a1e('0x34')]=_[_0x4a1e('0x33')](_0x30a31c['model'],qs['fields'](_0x333069[_0x4a1e('0x32')]['fields']));_0x5a5693[_0x4a1e('0x34')]=_0x5a5693[_0x4a1e('0x34')][_0x4a1e('0x36')]?_0x5a5693['attributes']:_0x30a31c[_0x4a1e('0x2f')];if(_0x333069[_0x4a1e('0x32')][_0x4a1e('0x46')]){_0x5a5693['include']=[{'all':!![]}];}_0x5a5693=_[_0x4a1e('0x3e')]({},_0x5a5693,_0x333069[_0x4a1e('0x40')]);return db[_0x4a1e('0x2a')][_0x4a1e('0x47')](_0x5a5693)[_0x4a1e('0x22')](handleEntityNotFound(_0x575fec,null))[_0x4a1e('0x22')](respondWithResult(_0x575fec,null))['catch'](handleError(_0x575fec,null));};exports[_0x4a1e('0x21')]=function(_0x16fea7,_0x36f778){if(_0x16fea7['body']['id']){delete _0x16fea7[_0x4a1e('0x48')]['id'];}return db[_0x4a1e('0x2a')][_0x4a1e('0x47')]({'where':{'id':_0x16fea7[_0x4a1e('0x45')]['id']}})[_0x4a1e('0x22')](handleEntityNotFound(_0x36f778,null))[_0x4a1e('0x22')](saveUpdates(_0x16fea7[_0x4a1e('0x48')],null))[_0x4a1e('0x22')](respondWithResult(_0x36f778,null))[_0x4a1e('0x44')](handleError(_0x36f778,null));};exports[_0x4a1e('0x23')]=function(_0x9fb2b,_0xeb9281){return db[_0x4a1e('0x2a')][_0x4a1e('0x47')]({'where':{'id':_0x9fb2b['params']['id']}})[_0x4a1e('0x22')](handleEntityNotFound(_0xeb9281,null))['then'](removeEntity(_0xeb9281,null))[_0x4a1e('0x44')](handleError(_0xeb9281,null));};exports[_0x4a1e('0x49')]=function(_0x38d89f,_0x2fa31d){var _0x52aa0c;return db[_0x4a1e('0x4a')][_0x4a1e('0x4b')](function(_0x175e89){return db[_0x4a1e('0x2a')][_0x4a1e('0x49')](_0x38d89f[_0x4a1e('0x48')],{'transaction':_0x175e89})[_0x4a1e('0x22')](function(_0x2c0bee){_0x52aa0c=_0x2c0bee;var _0x3ec511={'type':db[_0x4a1e('0x4c')][_0x4a1e('0x4d')],'transaction':_0x175e89};switch(_0x38d89f[_0x4a1e('0x48')][_0x4a1e('0x2d')]){case _0x4a1e('0x4e'):_0x3ec511['type']=db[_0x4a1e('0x4c')][_0x4a1e('0x4d')];break;case'number':_0x3ec511[_0x4a1e('0x2d')]=db[_0x4a1e('0x4c')][_0x4a1e('0x4f')];break;case _0x4a1e('0x50'):_0x3ec511[_0x4a1e('0x2d')]=db[_0x4a1e('0x4c')][_0x4a1e('0x51')];_0x3ec511[_0x4a1e('0x52')]=![];break;default:}return db[_0x4a1e('0x4a')][_0x4a1e('0x53')][_0x4a1e('0x54')](_0x4a1e('0x55'),util[_0x4a1e('0x56')](_0x4a1e('0x57'),_0x52aa0c['id']),_0x3ec511);})[_0x4a1e('0x22')](function(){return _0x52aa0c;});})[_0x4a1e('0x22')](respondWithResult(_0x2fa31d,0xc9))['catch'](handleError(_0x2fa31d,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0c1269f..5468fd1 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 _0x751b=['api','moment','request-promise','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','util','../../config/logger'];(function(_0x29a16e,_0x293e20){var _0x3792f3=function(_0x471c80){while(--_0x471c80){_0x29a16e['push'](_0x29a16e['shift']());}};_0x3792f3(++_0x293e20);}(_0x751b,0x6c));var _0xb751=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x751b[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xb751('0x0'));var logger=require(_0xb751('0x1'))(_0xb751('0x2'));var moment=require(_0xb751('0x3'));var BPromise=require('bluebird');var rp=require(_0xb751('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb751('0x5'));var config=require('../../config/environment');var attributes=require(_0xb751('0x6'));module[_0xb751('0x7')]=function(_0x2101ba,_0x4db392){return _0x2101ba[_0xb751('0x8')](_0xb751('0x9'),attributes,{'tableName':_0xb751('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a03=['cm_custom_fields','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x26372f,_0x53b05f){var _0x4ed4c1=function(_0x438e8d){while(--_0x438e8d){_0x26372f['push'](_0x26372f['shift']());}};_0x4ed4c1(++_0x53b05f);}(_0x7a03,0x160));var _0x37a0=function(_0x1a57d1,_0x4281ff){_0x1a57d1=_0x1a57d1-0x0;var _0x394876=_0x7a03[_0x1a57d1];return _0x394876;};'use strict';var _=require('lodash');var util=require(_0x37a0('0x0'));var logger=require(_0x37a0('0x1'))(_0x37a0('0x2'));var moment=require(_0x37a0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37a0('0x4'));var rimraf=require(_0x37a0('0x5'));var config=require(_0x37a0('0x6'));var attributes=require('./cmCustomField.attributes');module[_0x37a0('0x7')]=function(_0x412a17,_0x3fa98b){return _0x412a17['define']('CmCustomField',attributes,{'tableName':_0x37a0('0x8'),'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 d058c0c..d1d7f7f 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 _0xe3f9=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0xe3f9,0x9a));var _0x9e3f=function(_0xfc2d29,_0x37c077){_0xfc2d29=_0xfc2d29-0x0;var _0x129511=_0xe3f9[_0xfc2d29];return _0x129511;};'use strict';var _=require(_0x9e3f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e3f('0x1'));var rs=require(_0x9e3f('0x2'));var fs=require('fs');var Redis=require(_0x9e3f('0x3'));var db=require(_0x9e3f('0x4'))['db'];var utils=require(_0x9e3f('0x5'));var logger=require(_0x9e3f('0x6'))(_0x9e3f('0x7'));var config=require(_0x9e3f('0x8'));var jayson=require(_0x9e3f('0x9'));var client=jayson[_0x9e3f('0xa')][_0x9e3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23bd49,_0x8383cb,_0x506a07){return new BPromise(function(_0x45e695,_0x1882c7){return client['request'](_0x23bd49,_0x506a07)[_0x9e3f('0xc')](function(_0x335436){logger[_0x9e3f('0xd')](_0x9e3f('0xe'),_0x8383cb,_0x9e3f('0xf'));logger[_0x9e3f('0x10')](_0x9e3f('0x11'),_0x8383cb,_0x9e3f('0xf'),JSON[_0x9e3f('0x12')](_0x335436));if(_0x335436[_0x9e3f('0x13')]){if(_0x335436[_0x9e3f('0x13')][_0x9e3f('0x14')]===0x1f4){logger[_0x9e3f('0x13')](_0x9e3f('0xe'),_0x8383cb,_0x335436['error'][_0x9e3f('0x15')]);return _0x1882c7(_0x335436['error'][_0x9e3f('0x15')]);}logger['error'](_0x9e3f('0xe'),_0x8383cb,_0x335436['error'][_0x9e3f('0x15')]);return _0x45e695(_0x335436['error']['message']);}else{logger['info'](_0x9e3f('0xe'),_0x8383cb,'request\x20sent');_0x45e695(_0x335436[_0x9e3f('0x16')][_0x9e3f('0x15')]);}})[_0x9e3f('0x17')](function(_0x5acb35){logger[_0x9e3f('0x13')](_0x9e3f('0xe'),_0x8383cb,_0x5acb35);_0x1882c7(_0x5acb35);});});} \ No newline at end of file +var _0xe586=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xcb75f2,_0x293700){var _0x24cf22=function(_0xa452a1){while(--_0xa452a1){_0xcb75f2['push'](_0xcb75f2['shift']());}};_0x24cf22(++_0x293700);}(_0xe586,0x151));var _0x6e58=function(_0x51529e,_0x2aebcc){_0x51529e=_0x51529e-0x0;var _0x15c7d4=_0xe586[_0x51529e];return _0x15c7d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e58('0x0'));var BPromise=require(_0x6e58('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e58('0x2'));var db=require(_0x6e58('0x3'))['db'];var utils=require(_0x6e58('0x4'));var logger=require(_0x6e58('0x5'))(_0x6e58('0x6'));var config=require(_0x6e58('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdf019b,_0x27355e,_0x512a3b){return new BPromise(function(_0xac70b8,_0x4b43fb){return client[_0x6e58('0x9')](_0xdf019b,_0x512a3b)[_0x6e58('0xa')](function(_0x577c5e){logger['info'](_0x6e58('0xb'),_0x27355e,'request\x20sent');logger[_0x6e58('0xc')](_0x6e58('0xd'),_0x27355e,'request\x20sent',JSON[_0x6e58('0xe')](_0x577c5e));if(_0x577c5e['error']){if(_0x577c5e[_0x6e58('0xf')][_0x6e58('0x10')]===0x1f4){logger[_0x6e58('0xf')](_0x6e58('0xb'),_0x27355e,_0x577c5e[_0x6e58('0xf')][_0x6e58('0x11')]);return _0x4b43fb(_0x577c5e[_0x6e58('0xf')][_0x6e58('0x11')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x27355e,_0x577c5e['error'][_0x6e58('0x11')]);return _0xac70b8(_0x577c5e[_0x6e58('0xf')][_0x6e58('0x11')]);}else{logger[_0x6e58('0x12')](_0x6e58('0xb'),_0x27355e,'request\x20sent');_0xac70b8(_0x577c5e[_0x6e58('0x13')][_0x6e58('0x11')]);}})[_0x6e58('0x14')](function(_0x326723){logger['error'](_0x6e58('0xb'),_0x27355e,_0x326723);_0x4b43fb(_0x326723);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 6551765..df0bf2d 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 _0x23f4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','delete','destroy','util'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x23f4,0x1ee));var _0x423f=function(_0xce0858,_0x1afbd1){_0xce0858=_0xce0858-0x0;var _0x3cc54b=_0x23f4[_0xce0858];return _0x3cc54b;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var fs_extra=require(_0x423f('0x3'));var auth=require(_0x423f('0x4'));var interaction=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller['index']);router[_0x423f('0x8')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0xb')]);router[_0x423f('0xc')]('/',auth[_0x423f('0x9')](),controller['create']);router['put']('/:id',auth[_0x423f('0x9')](),controller['update']);router[_0x423f('0xd')](_0x423f('0xa'),auth[_0x423f('0x9')](),controller[_0x423f('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4226=['util','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x53645d,_0x5d9d60){var _0x1bed1f=function(_0x9a5369){while(--_0x9a5369){_0x53645d['push'](_0x53645d['shift']());}};_0x1bed1f(++_0x5d9d60);}(_0x4226,0x1dc));var _0x6422=function(_0x2a8567,_0x488e42){_0x2a8567=_0x2a8567-0x0;var _0x54be66=_0x4226[_0x2a8567];return _0x54be66;};'use strict';var multer=require('multer');var util=require(_0x6422('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6422('0x1')]();var fs_extra=require(_0x6422('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6422('0x3'));var config=require(_0x6422('0x4'));var controller=require(_0x6422('0x5'));router[_0x6422('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6422('0x7'),auth['isAuthenticated'](),controller[_0x6422('0x8')]);router[_0x6422('0x9')]('/',auth['isAuthenticated'](),controller[_0x6422('0xa')]);router[_0x6422('0xb')]('/:id',auth[_0x6422('0xc')](),controller[_0x6422('0xd')]);router[_0x6422('0xe')](_0x6422('0x7'),auth[_0x6422('0xc')](),controller[_0x6422('0xf')]);module[_0x6422('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index f59e386..6c526d8 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 _0x4c7a=['UNSIGNED','contactListQueue','moment','STRING','BOOLEAN','DATE','format','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4c7a,0xfa));var _0xa4c7=function(_0x46f4d8,_0x4f2560){_0x46f4d8=_0x46f4d8-0x0;var _0x5ec05e=_0x4c7a[_0x46f4d8];return _0x5ec05e;};'use strict';var moment=require(_0xa4c7('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xa4c7('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xa4c7('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa4c7('0x3')],'defaultValue':moment()[_0xa4c7('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xa4c7('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa4c7('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa4c7('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa4c7('0x3')]},'priority':{'type':Sequelize[_0xa4c7('0x5')](0x2)[_0xa4c7('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa4c7('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa4c7('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xa4c7('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xa4c7('0x5')],'unique':_0xa4c7('0x7')},'CampaignId':{'type':Sequelize[_0xa4c7('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa4c7('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa4c7('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa4c7('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x32ac=['BOOLEAN','DATE','format','INTEGER','contactListQueue','sequelize','exports','STRING'];(function(_0x1a77d1,_0x3b07bf){var _0x30fe67=function(_0x5d29f8){while(--_0x5d29f8){_0x1a77d1['push'](_0x1a77d1['shift']());}};_0x30fe67(++_0x3b07bf);}(_0x32ac,0x1a5));var _0xc32a=function(_0x4ddabf,_0x1d1525){_0x4ddabf=_0x4ddabf-0x0;var _0x4b326c=_0x32ac[_0x4ddabf];return _0x4b326c;};'use strict';var moment=require('moment');var Sequelize=require(_0xc32a('0x0'));module[_0xc32a('0x1')]={'phone':{'type':Sequelize[_0xc32a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xc32a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc32a('0x4')],'defaultValue':moment()[_0xc32a('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc32a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc32a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc32a('0x4')]},'priority':{'type':Sequelize[_0xc32a('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc32a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xc32a('0x6')],'unique':_0xc32a('0x7')},'UserId':{'type':Sequelize[_0xc32a('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xc32a('0x6')],'unique':_0xc32a('0x7')},'CampaignId':{'type':Sequelize[_0xc32a('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc32a('0x6')],'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 8402506..350949e 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 _0x984b=['$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notILike','$overlap','$contains','$any','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmHopper','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','CmContact','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','hopperIds','priority','findOne','scheduledat','recallme','UPDATE','Contact','Company','CmList','List','dialActive','isNumber','error','getOpenContacts','entity\x20not\x20found','fast-json-patch','request-promise','moment','util','path','ejs','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/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','stack','name','index','map','fieldName','type','model','query','filters','intersection','concat','$and'];(function(_0x14186a,_0x59fd7a){var _0x2c7907=function(_0x2f7a9c){while(--_0x2f7a9c){_0x14186a['push'](_0x14186a['shift']());}};_0x2c7907(++_0x59fd7a);}(_0x984b,0xee));var _0xb984=function(_0xfc0c6a,_0x376ca0){_0xfc0c6a=_0xfc0c6a-0x0;var _0x45370a=_0x984b[_0xfc0c6a];return _0x45370a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb984('0x0'));var rp=require(_0xb984('0x1'));var moment=require(_0xb984('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb984('0x3'));var path=require(_0xb984('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb984('0x5'));var fs=require('fs');var fs_extra=require(_0xb984('0x6'));var _=require('lodash');var squel=require(_0xb984('0x7'));var crypto=require(_0xb984('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb984('0x9'));var toCsv=require('to-csv');var querystring=require(_0xb984('0xa'));var Papa=require(_0xb984('0xb'));var Redis=require(_0xb984('0xc'));var authService=require(_0xb984('0xd'));var qs=require(_0xb984('0xe'));var as=require(_0xb984('0xf'));var hardwareService=require(_0xb984('0x10'));var logger=require(_0xb984('0x11'))(_0xb984('0x12'));var utils=require(_0xb984('0x13'));var config=require(_0xb984('0x14'));var licenseUtil=require(_0xb984('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b922b,_0x4b9c75){_0x4b9c75=_0x4b9c75||0xcc;return function(_0x61432f){if(_0x61432f){return _0x1b922b[_0xb984('0x16')](_0x4b9c75);}return _0x1b922b['status'](_0x4b9c75)[_0xb984('0x17')]();};}function respondWithResult(_0x2e7986,_0x564d24){_0x564d24=_0x564d24||0xc8;return function(_0x203dba){if(_0x203dba){return _0x2e7986[_0xb984('0x18')](_0x564d24)['json'](_0x203dba);}};}function respondWithFilteredResult(_0xede12d,_0x4073cb){return function(_0x57365c){if(_0x57365c){var _0x6fae41=typeof _0x4073cb['offset']===_0xb984('0x19')&&typeof _0x4073cb[_0xb984('0x1a')]===_0xb984('0x19');var _0x3f7cff=_0x57365c['count'];var _0x396c36=_0x6fae41?0x0:_0x4073cb[_0xb984('0x1b')];var _0x3a5c96=_0x6fae41?_0x57365c[_0xb984('0x1c')]:_0x4073cb[_0xb984('0x1b')]+_0x4073cb[_0xb984('0x1a')];var _0x5c2e25;if(_0x3a5c96>=_0x3f7cff){_0x3a5c96=_0x3f7cff;_0x5c2e25=0xc8;}else{_0x5c2e25=0xce;}_0xede12d[_0xb984('0x18')](_0x5c2e25);return _0xede12d[_0xb984('0x1d')](_0xb984('0x1e'),_0x396c36+'-'+_0x3a5c96+'/'+_0x3f7cff)[_0xb984('0x1f')](_0x57365c);}return null;};}function patchUpdates(_0x32831b){return function(_0xcf9365){try{jsonpatch['apply'](_0xcf9365,_0x32831b,!![]);}catch(_0x39d16f){return BPromise[_0xb984('0x20')](_0x39d16f);}return _0xcf9365['save']();};}function saveUpdates(_0x44b570,_0x97af5c){return function(_0x14734a){if(_0x14734a){return _0x14734a[_0xb984('0x21')](_0x44b570)[_0xb984('0x22')](function(_0x286033){return _0x286033;});}return null;};}function removeEntity(_0x41510a,_0x52c581){return function(_0x391a1e){if(_0x391a1e){return _0x391a1e[_0xb984('0x23')]()[_0xb984('0x22')](function(){_0x41510a['status'](0xcc)[_0xb984('0x17')]();});}};}function handleEntityNotFound(_0x2e806e,_0x1cb2c2){return function(_0x2d0450){if(!_0x2d0450){_0x2e806e[_0xb984('0x16')](0x194);}return _0x2d0450;};}function handleError(_0x24b278,_0x1faa95){_0x1faa95=_0x1faa95||0x1f4;return function(_0x4b3da0){logger['error'](_0x4b3da0[_0xb984('0x24')]);if(_0x4b3da0[_0xb984('0x25')]){delete _0x4b3da0[_0xb984('0x25')];}_0x24b278[_0xb984('0x18')](_0x1faa95)['send'](_0x4b3da0);};}exports[_0xb984('0x26')]=function(_0x67e4d3,_0x476811){var _0x482a9f={},_0x363e33={},_0x311e22={'count':0x0,'rows':[]};var _0x2012ca=_[_0xb984('0x27')](db['CmHopper']['rawAttributes'],function(_0x4dcf73){return{'name':_0x4dcf73[_0xb984('0x28')],'type':_0x4dcf73[_0xb984('0x29')]['key']};});_0x363e33[_0xb984('0x2a')]=_[_0xb984('0x27')](_0x2012ca,_0xb984('0x25'));_0x363e33[_0xb984('0x2b')]=_['keys'](_0x67e4d3['query']);_0x363e33[_0xb984('0x2c')]=_[_0xb984('0x2d')](_0x363e33[_0xb984('0x2a')],_0x363e33[_0xb984('0x2b')]);_0x363e33['filters']=_[_0xb984('0x2e')](_0x363e33[_0xb984('0x2c')],[_0xb984('0x2f'),_0xb984('0x30'),_0xb984('0x31'),_0xb984('0x32'),'$lt',_0xb984('0x33'),_0xb984('0x34'),_0xb984('0x35'),_0xb984('0x36'),_0xb984('0x37'),_0xb984('0x38'),'$in',_0xb984('0x39'),_0xb984('0x3a'),'$notLike','$iLike',_0xb984('0x3b'),'$like',_0xb984('0x3c'),_0xb984('0x3d'),'$contained',_0xb984('0x3e')]);_0x482a9f['attributes']=_[_0xb984('0x2d')](_0x363e33['model'],qs[_0xb984('0x3f')](_0x67e4d3['query']['fields']));_0x482a9f[_0xb984('0x40')]=_0x482a9f[_0xb984('0x40')]['length']?_0x482a9f[_0xb984('0x40')]:_0x363e33[_0xb984('0x2a')];if(!_0x67e4d3['query'][_0xb984('0x41')](_0xb984('0x42'))){_0x482a9f[_0xb984('0x1a')]=qs[_0xb984('0x1a')](_0x67e4d3['query'][_0xb984('0x1a')]);_0x482a9f[_0xb984('0x1b')]=qs[_0xb984('0x1b')](_0x67e4d3[_0xb984('0x2b')][_0xb984('0x1b')]);}_0x482a9f[_0xb984('0x43')]=qs[_0xb984('0x44')](_0x67e4d3[_0xb984('0x2b')][_0xb984('0x44')]);_0x482a9f[_0xb984('0x45')]=qs['filters'](_[_0xb984('0x46')](_0x67e4d3[_0xb984('0x2b')],_0x363e33[_0xb984('0x2c')]),_0x2012ca);if(_0x67e4d3[_0xb984('0x2b')][_0xb984('0x47')]){_0x482a9f[_0xb984('0x45')]=_[_0xb984('0x48')](_0x482a9f[_0xb984('0x45')],{'$or':_['map'](_0x2012ca,function(_0x5d4be9){if(_0x5d4be9[_0xb984('0x29')]!=='VIRTUAL'){var _0x285afd={};_0x285afd[_0x5d4be9[_0xb984('0x25')]]={'$like':'%'+_0x67e4d3[_0xb984('0x2b')][_0xb984('0x47')]+'%'};return _0x285afd;}})});}_0x482a9f=_['merge']({},_0x482a9f,_0x67e4d3[_0xb984('0x49')]);var _0x3a4583={'where':_0x482a9f['where']};return db[_0xb984('0x4a')][_0xb984('0x1c')](_0x3a4583)[_0xb984('0x22')](function(_0x3f7474){_0x311e22[_0xb984('0x1c')]=_0x3f7474;if(_0x67e4d3[_0xb984('0x2b')][_0xb984('0x4b')]){_0x482a9f['include']=[{'all':!![]}];}return db[_0xb984('0x4a')][_0xb984('0x4c')](_0x482a9f);})['then'](function(_0x5cb1dd){_0x311e22[_0xb984('0x4d')]=_0x5cb1dd;return _0x311e22;})[_0xb984('0x22')](respondWithFilteredResult(_0x476811,_0x482a9f))[_0xb984('0x4e')](handleError(_0x476811,null));};exports[_0xb984('0x4f')]=function(_0x1acc7a,_0x56a3bf){var _0x664cb1={'raw':!![],'where':{'id':_0x1acc7a[_0xb984('0x50')]['id']}},_0x40666f={};_0x40666f[_0xb984('0x2a')]=_[_0xb984('0x51')](db[_0xb984('0x4a')][_0xb984('0x52')]);_0x40666f[_0xb984('0x2b')]=_[_0xb984('0x51')](_0x1acc7a[_0xb984('0x2b')]);_0x40666f['filters']=_[_0xb984('0x2d')](_0x40666f[_0xb984('0x2a')],_0x40666f['query']);_0x664cb1[_0xb984('0x40')]=_[_0xb984('0x2d')](_0x40666f[_0xb984('0x2a')],qs[_0xb984('0x3f')](_0x1acc7a[_0xb984('0x2b')][_0xb984('0x3f')]));_0x664cb1[_0xb984('0x40')]=_0x664cb1[_0xb984('0x40')][_0xb984('0x53')]?_0x664cb1[_0xb984('0x40')]:_0x40666f['model'];if(_0x1acc7a[_0xb984('0x2b')][_0xb984('0x4b')]){_0x664cb1[_0xb984('0x54')]=[{'all':!![]}];}_0x664cb1=_[_0xb984('0x48')]({},_0x664cb1,_0x1acc7a[_0xb984('0x49')]);return db[_0xb984('0x4a')][_0xb984('0x55')](_0x664cb1)[_0xb984('0x22')](handleEntityNotFound(_0x56a3bf,null))[_0xb984('0x22')](respondWithResult(_0x56a3bf,null))['catch'](handleError(_0x56a3bf,null));};exports[_0xb984('0x56')]=function(_0x36e411,_0x3a7cbb){return db['CmHopper'][_0xb984('0x56')](_0x36e411[_0xb984('0x57')],{})['then'](respondWithResult(_0x3a7cbb,0xc9))[_0xb984('0x4e')](handleError(_0x3a7cbb,null));};exports['update']=function(_0x364416,_0x3a9ec3){if(_0x364416['body']['id']){delete _0x364416[_0xb984('0x57')]['id'];}return db[_0xb984('0x4a')][_0xb984('0x55')]({'where':{'id':_0x364416[_0xb984('0x50')]['id']}})[_0xb984('0x22')](handleEntityNotFound(_0x3a9ec3,null))[_0xb984('0x22')](saveUpdates(_0x364416['body'],null))[_0xb984('0x22')](respondWithResult(_0x3a9ec3,null))['catch'](handleError(_0x3a9ec3,null));};exports[_0xb984('0x58')]=function(_0x40b54d,_0x260825){return db['CmHopper']['describe']()[_0xb984('0x22')](respondWithResult(_0x260825,null))[_0xb984('0x4e')](handleError(_0x260825,null));};exports['destroy']=function(_0x493a8b,_0x1e8847){var _0x30c135;return db[_0xb984('0x4a')][_0xb984('0x55')]({'where':{'id':_0x493a8b[_0xb984('0x50')]['id']}})[_0xb984('0x22')](handleEntityNotFound(_0x1e8847,null))['then'](function(_0x502480){if(_0x502480){return _0x502480[_0xb984('0x23')]()[_0xb984('0x22')](function(_0x59ed42){return _0x59ed42;});}})[_0xb984('0x22')](function(_0x159835){_0x30c135=_0x159835;if(_0x159835){if(_0x159835[_0xb984('0x59')]||_0x159835[_0xb984('0x5a')]){return db[_0x159835['VoiceQueueId']?'VoiceQueue':_0xb984('0x5b')][_0xb984('0x55')]({'where':{'id':_0x159835[_0xb984('0x59')]?_0x159835[_0xb984('0x59')]:_0x159835[_0xb984('0x5a')]},'attributes':['id',_0xb984('0x25')],'raw':!![]});}}})['then'](function(_0x2de42b){var _0x261be7={};if(_0x2de42b){_[_0xb984('0x48')](_0x261be7,_[_0xb984('0x5c')](_0x30c135[_0xb984('0x5d')],[_0xb984('0x5e'),'updatedAt','id']));_0x261be7['state']=0x15;_0x261be7['statedesc']=_0xb984('0x5f');_0x261be7[_0xb984('0x60')]=_0x2de42b[_0xb984('0x25')];_0x261be7[_0xb984('0x61')]=_0x493a8b[_0xb984('0x62')]['name'];_0x261be7[_0xb984('0x63')]=_0x493a8b[_0xb984('0x62')]['id'];_0x261be7[_0xb984('0x5f')]=!![];_0x261be7['deletedat']=moment()[_0xb984('0x64')](_0xb984('0x65'));_0x261be7['calleridnum']=_0x30c135['phone'];_0x261be7[_0xb984('0x66')]=_0x30c135['VoiceQueueId']?'queue':_0xb984('0x67');return db['CmContact'][_0xb984('0x55')]({'where':{'id':_0x261be7[_0xb984('0x68')]},'attributes':[_0xb984('0x69'),_0xb984('0x6a')]})[_0xb984('0x22')](function(_0x4378f7){if(!_[_0xb984('0x6b')](_0x1e8847)&&!_[_0xb984('0x6b')](_0x4378f7[_0xb984('0x69')])){_0x261be7[_0xb984('0x6c')]=_0x4378f7[_0xb984('0x69')];if(!_[_0xb984('0x6b')](_0x4378f7['lastName'])){_0x261be7[_0xb984('0x6c')]+='\x20'+_0x4378f7[_0xb984('0x6a')];}}})[_0xb984('0x6d')](function(){return db['CmHopperFinal']['create'](_0x261be7);});}})[_0xb984('0x22')](function(){return _0x1e8847[_0xb984('0x18')](0xcc)[_0xb984('0x17')]();})['catch'](handleError(_0x1e8847,null));};exports[_0xb984('0x6e')]=function(_0x35132b,_0x323d6b,_0x3508cb){var _0x434c5c=[];return db[_0xb984('0x6f')][_0xb984('0x58')]()[_0xb984('0x22')](function(_0x1d7e1e){_0x434c5c=_[_0xb984('0x51')](_0x1d7e1e);return _0x35132b[_0xb984('0x62')][_0xb984('0x70')]({'where':{'type':_0xb984('0x71'),'dialActive':!![],'dialMethod':_0xb984('0x72')},'attributes':['id','dialOrderByScheduledAt',_0xb984('0x73')],'raw':!![]});})['then'](function(_0x2acfc1){if(_0x2acfc1&&_0x2acfc1['length']){return db[_0xb984('0x74')][_0xb984('0x75')](function(_0x278a0d){var _0xae996e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb984('0x64')](_0xb984('0x65'))},'VoiceQueueId':{'$in':_[_0xb984('0x27')](_0x2acfc1,'id')},'$or':[{'UserId':null},{'UserId':_0x35132b[_0xb984('0x62')]['id']}]};var _0x3bc1d3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2acfc1)[_0xb984('0x47')]([_0xb984('0x73'),0x0])[_0xb984('0x27')]('id')[_0xb984('0x76')]()},'$or':[{'UserId':null},{'UserId':_0x35132b['user']['id']}]};var _0x4886bf={'$or':[_0xae996e,_0x3bc1d3]};var _0x917c53=[];if(_0x35132b[_0xb984('0x57')][_0xb984('0x77')]&&_0x35132b['body'][_0xb984('0x77')]===_0xb984('0x78')){if(!_['isEmpty'](_0x35132b['body']['hopperIds'])){_0x4886bf['id']={'$in':_0x35132b[_0xb984('0x57')]['hopperIds']};}_0x917c53=[['priority','ASC'],[_0xb984('0x79'),_0x2acfc1[0x0][_0xb984('0x7a')]===_0xb984('0x7b')?_0xb984('0x7c'):'ASC'],db['sequelize'][_0xb984('0x7d')](_0xb984('0x7e')),['id',_0xb984('0x7c')]];}else{if(!_[_0xb984('0x7f')](_0x35132b[_0xb984('0x57')]['hopperIds'])){_0x4886bf['id']={'$notIn':_0x35132b[_0xb984('0x57')][_0xb984('0x80')]};}_0x917c53=[[_0xb984('0x81'),_0xb984('0x7c')],[_0xb984('0x79'),_0x2acfc1[0x0][_0xb984('0x7a')]],db['sequelize'][_0xb984('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xb984('0x7b')]];}return db[_0xb984('0x4a')][_0xb984('0x82')]({'attributes':['id',_0xb984('0x83'),_0xb984('0x84')],'where':_0x4886bf,'order':_0x917c53,'transaction':_0x278a0d,'lock':_0x278a0d['LOCK'][_0xb984('0x85')],'include':[{'model':db[_0xb984('0x6f')],'as':_0xb984('0x86'),'attributes':_0x434c5c,'include':[{'model':db['CmCompany'],'as':_0xb984('0x87'),'attributes':['id',_0xb984('0x25')]}]},{'model':db[_0xb984('0x88')],'as':_0xb984('0x89'),'attributes':['id',_0xb984('0x25')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0xb984('0x25'),_0xb984('0x8a')]}]})[_0xb984('0x22')](function(_0x2a3a55){if(_0x2a3a55){return _0x2a3a55['update']({'UserId':_0x35132b[_0xb984('0x62')]['id']},{'transaction':_0x278a0d});}});});}})[_0xb984('0x22')](handleEntityNotFound(_0x323d6b,null))[_0xb984('0x22')](respondWithResult(_0x323d6b,null))[_0xb984('0x4e')](handleError(_0x323d6b,null));};exports['getOpenContacts']=function(_0x1b0673,_0x2725eb,_0x417526){return _0x1b0673[_0xb984('0x62')]['getVoiceQueues']({'where':{'type':_0xb984('0x71'),'dialActive':!![],'dialMethod':_0xb984('0x72')},'attributes':['id'],'raw':!![]})[_0xb984('0x22')](function(_0x2d686e){if(_0x2d686e&&_0x2d686e[_0xb984('0x53')]){return db[_0xb984('0x4a')][_0xb984('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb984('0x64')](_0xb984('0x65'))},'VoiceQueueId':{'$in':_[_0xb984('0x27')](_0x2d686e,'id')},'$or':[{'UserId':null},{'UserId':_0x1b0673[_0xb984('0x62')]['id']}]}});}return 0x0;})['then'](function(_0x19b7d0){if(!_[_0xb984('0x6b')](_0x19b7d0)&&_[_0xb984('0x8b')](_0x19b7d0)){return _0x2725eb[_0xb984('0x18')](0xc8)[_0xb984('0x1f')]({'contacts':_0x19b7d0});}else{logger[_0xb984('0x8c')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xb984('0x8d'),0x194,_0xb984('0x8e'));_0x2725eb[_0xb984('0x16')](0x194);}})[_0xb984('0x4e')](handleError(_0x2725eb,null));}; \ No newline at end of file +var _0x441a=['offset','undefined','count','limit','status','set','json','apply','reject','update','then','end','error','send','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','concat','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$iLike','$like','$overlap','$contains','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','CmHopper','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus'];(function(_0x502d5a,_0x161050){var _0x912e2c=function(_0x3fa3d3){while(--_0x3fa3d3){_0x502d5a['push'](_0x502d5a['shift']());}};_0x912e2c(++_0x161050);}(_0x441a,0x7c));var _0xa441=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x441a[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0xa441('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa441('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa441('0x2'));var moment=require(_0xa441('0x3'));var BPromise=require(_0xa441('0x4'));var Mustache=require(_0xa441('0x5'));var util=require(_0xa441('0x6'));var path=require('path');var sox=require(_0xa441('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa441('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa441('0x9'));var deskjs=require(_0xa441('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa441('0xb'));var Papa=require(_0xa441('0xc'));var Redis=require(_0xa441('0xd'));var authService=require(_0xa441('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa441('0xf'));var logger=require('../../config/logger')(_0xa441('0x10'));var utils=require('../../config/utils');var config=require(_0xa441('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1695bd,_0x259548){_0x259548=_0x259548||0xcc;return function(_0x156ee6){if(_0x156ee6){return _0x1695bd[_0xa441('0x12')](_0x259548);}return _0x1695bd['status'](_0x259548)['end']();};}function respondWithResult(_0xcf3ffc,_0x877e5){_0x877e5=_0x877e5||0xc8;return function(_0xbbb353){if(_0xbbb353){return _0xcf3ffc['status'](_0x877e5)['json'](_0xbbb353);}};}function respondWithFilteredResult(_0x4a981a,_0x3ca7e3){return function(_0x4285a5){if(_0x4285a5){var _0x488057=typeof _0x3ca7e3[_0xa441('0x13')]===_0xa441('0x14')&&typeof _0x3ca7e3['limit']===_0xa441('0x14');var _0xc9509a=_0x4285a5['count'];var _0x33c344=_0x488057?0x0:_0x3ca7e3[_0xa441('0x13')];var _0x22ffce=_0x488057?_0x4285a5[_0xa441('0x15')]:_0x3ca7e3[_0xa441('0x13')]+_0x3ca7e3[_0xa441('0x16')];var _0x52a6fa;if(_0x22ffce>=_0xc9509a){_0x22ffce=_0xc9509a;_0x52a6fa=0xc8;}else{_0x52a6fa=0xce;}_0x4a981a[_0xa441('0x17')](_0x52a6fa);return _0x4a981a[_0xa441('0x18')]('Content-Range',_0x33c344+'-'+_0x22ffce+'/'+_0xc9509a)[_0xa441('0x19')](_0x4285a5);}return null;};}function patchUpdates(_0x428627){return function(_0x3ffbe1){try{jsonpatch[_0xa441('0x1a')](_0x3ffbe1,_0x428627,!![]);}catch(_0xd284e1){return BPromise[_0xa441('0x1b')](_0xd284e1);}return _0x3ffbe1['save']();};}function saveUpdates(_0xccbb48,_0x35f9d7){return function(_0x12acf8){if(_0x12acf8){return _0x12acf8[_0xa441('0x1c')](_0xccbb48)[_0xa441('0x1d')](function(_0x6e25b9){return _0x6e25b9;});}return null;};}function removeEntity(_0xed6c12,_0x14cccd){return function(_0x2f6115){if(_0x2f6115){return _0x2f6115['destroy']()[_0xa441('0x1d')](function(){_0xed6c12[_0xa441('0x17')](0xcc)[_0xa441('0x1e')]();});}};}function handleEntityNotFound(_0x6fe1dc,_0x4ac1f9){return function(_0x471ed9){if(!_0x471ed9){_0x6fe1dc[_0xa441('0x12')](0x194);}return _0x471ed9;};}function handleError(_0x3ea0ef,_0x1346ff){_0x1346ff=_0x1346ff||0x1f4;return function(_0x273c86){logger[_0xa441('0x1f')](_0x273c86['stack']);if(_0x273c86['name']){delete _0x273c86['name'];}_0x3ea0ef[_0xa441('0x17')](_0x1346ff)[_0xa441('0x20')](_0x273c86);};}exports[_0xa441('0x21')]=function(_0x1c9aa8,_0x19a6fd){var _0x4b9b9c={},_0x498b02={},_0x400314={'count':0x0,'rows':[]};var _0xa14217=_[_0xa441('0x22')](db['CmHopper']['rawAttributes'],function(_0x22a746){return{'name':_0x22a746[_0xa441('0x23')],'type':_0x22a746[_0xa441('0x24')][_0xa441('0x25')]};});_0x498b02[_0xa441('0x26')]=_[_0xa441('0x22')](_0xa14217,_0xa441('0x27'));_0x498b02[_0xa441('0x28')]=_[_0xa441('0x29')](_0x1c9aa8[_0xa441('0x28')]);_0x498b02[_0xa441('0x2a')]=_[_0xa441('0x2b')](_0x498b02[_0xa441('0x26')],_0x498b02[_0xa441('0x28')]);_0x498b02['filters']=_[_0xa441('0x2c')](_0x498b02['filters'],['$and',_0xa441('0x2d'),_0xa441('0x2e'),_0xa441('0x2f'),_0xa441('0x30'),'$lte',_0xa441('0x31'),_0xa441('0x32'),_0xa441('0x33'),'$between',_0xa441('0x34'),_0xa441('0x35'),_0xa441('0x36'),'$like','$notLike',_0xa441('0x37'),'$notILike',_0xa441('0x38'),_0xa441('0x39'),_0xa441('0x3a'),'$contained',_0xa441('0x3b')]);_0x4b9b9c['attributes']=_['intersection'](_0x498b02[_0xa441('0x26')],qs[_0xa441('0x3c')](_0x1c9aa8['query'][_0xa441('0x3c')]));_0x4b9b9c['attributes']=_0x4b9b9c[_0xa441('0x3d')][_0xa441('0x3e')]?_0x4b9b9c[_0xa441('0x3d')]:_0x498b02['model'];if(!_0x1c9aa8[_0xa441('0x28')][_0xa441('0x3f')](_0xa441('0x40'))){_0x4b9b9c[_0xa441('0x16')]=qs['limit'](_0x1c9aa8['query']['limit']);_0x4b9b9c['offset']=qs[_0xa441('0x13')](_0x1c9aa8[_0xa441('0x28')][_0xa441('0x13')]);}_0x4b9b9c[_0xa441('0x41')]=qs[_0xa441('0x42')](_0x1c9aa8['query'][_0xa441('0x42')]);_0x4b9b9c['where']=qs[_0xa441('0x2a')](_[_0xa441('0x43')](_0x1c9aa8[_0xa441('0x28')],_0x498b02[_0xa441('0x2a')]),_0xa14217);if(_0x1c9aa8[_0xa441('0x28')][_0xa441('0x44')]){_0x4b9b9c[_0xa441('0x45')]=_[_0xa441('0x46')](_0x4b9b9c[_0xa441('0x45')],{'$or':_['map'](_0xa14217,function(_0x35b61a){if(_0x35b61a[_0xa441('0x24')]!==_0xa441('0x47')){var _0x43a052={};_0x43a052[_0x35b61a[_0xa441('0x27')]]={'$like':'%'+_0x1c9aa8[_0xa441('0x28')][_0xa441('0x44')]+'%'};return _0x43a052;}})});}_0x4b9b9c=_[_0xa441('0x46')]({},_0x4b9b9c,_0x1c9aa8[_0xa441('0x48')]);var _0x1a7178={'where':_0x4b9b9c[_0xa441('0x45')]};return db['CmHopper'][_0xa441('0x15')](_0x1a7178)['then'](function(_0x4f8e6c){_0x400314[_0xa441('0x15')]=_0x4f8e6c;if(_0x1c9aa8[_0xa441('0x28')][_0xa441('0x49')]){_0x4b9b9c[_0xa441('0x4a')]=[{'all':!![]}];}return db[_0xa441('0x4b')][_0xa441('0x4c')](_0x4b9b9c);})[_0xa441('0x1d')](function(_0x10d449){_0x400314[_0xa441('0x4d')]=_0x10d449;return _0x400314;})[_0xa441('0x1d')](respondWithFilteredResult(_0x19a6fd,_0x4b9b9c))[_0xa441('0x4e')](handleError(_0x19a6fd,null));};exports[_0xa441('0x4f')]=function(_0x206f28,_0x4df038){var _0xb4c3ae={'raw':!![],'where':{'id':_0x206f28['params']['id']}},_0x5afdab={};_0x5afdab['model']=_[_0xa441('0x29')](db[_0xa441('0x4b')][_0xa441('0x50')]);_0x5afdab[_0xa441('0x28')]=_[_0xa441('0x29')](_0x206f28[_0xa441('0x28')]);_0x5afdab[_0xa441('0x2a')]=_[_0xa441('0x2b')](_0x5afdab['model'],_0x5afdab[_0xa441('0x28')]);_0xb4c3ae[_0xa441('0x3d')]=_['intersection'](_0x5afdab[_0xa441('0x26')],qs[_0xa441('0x3c')](_0x206f28[_0xa441('0x28')][_0xa441('0x3c')]));_0xb4c3ae[_0xa441('0x3d')]=_0xb4c3ae['attributes'][_0xa441('0x3e')]?_0xb4c3ae[_0xa441('0x3d')]:_0x5afdab['model'];if(_0x206f28['query']['includeAll']){_0xb4c3ae[_0xa441('0x4a')]=[{'all':!![]}];}_0xb4c3ae=_['merge']({},_0xb4c3ae,_0x206f28[_0xa441('0x48')]);return db['CmHopper'][_0xa441('0x51')](_0xb4c3ae)[_0xa441('0x1d')](handleEntityNotFound(_0x4df038,null))[_0xa441('0x1d')](respondWithResult(_0x4df038,null))[_0xa441('0x4e')](handleError(_0x4df038,null));};exports[_0xa441('0x52')]=function(_0x471044,_0xe531af){return db[_0xa441('0x4b')][_0xa441('0x52')](_0x471044[_0xa441('0x53')],{})[_0xa441('0x1d')](respondWithResult(_0xe531af,0xc9))[_0xa441('0x4e')](handleError(_0xe531af,null));};exports[_0xa441('0x1c')]=function(_0x49849c,_0x181622){if(_0x49849c[_0xa441('0x53')]['id']){delete _0x49849c['body']['id'];}return db[_0xa441('0x4b')][_0xa441('0x51')]({'where':{'id':_0x49849c[_0xa441('0x54')]['id']}})['then'](handleEntityNotFound(_0x181622,null))[_0xa441('0x1d')](saveUpdates(_0x49849c[_0xa441('0x53')],null))['then'](respondWithResult(_0x181622,null))[_0xa441('0x4e')](handleError(_0x181622,null));};exports['describe']=function(_0x2ab858,_0x2dbc08){return db[_0xa441('0x4b')][_0xa441('0x55')]()[_0xa441('0x1d')](respondWithResult(_0x2dbc08,null))[_0xa441('0x4e')](handleError(_0x2dbc08,null));};exports[_0xa441('0x56')]=function(_0x40564b,_0x42f619){var _0x26b43e;return db[_0xa441('0x4b')]['find']({'where':{'id':_0x40564b[_0xa441('0x54')]['id']}})[_0xa441('0x1d')](handleEntityNotFound(_0x42f619,null))[_0xa441('0x1d')](function(_0x3ce1d3){if(_0x3ce1d3){return _0x3ce1d3[_0xa441('0x56')]()[_0xa441('0x1d')](function(_0x2d7d9e){return _0x2d7d9e;});}})[_0xa441('0x1d')](function(_0x11d33a){_0x26b43e=_0x11d33a;if(_0x11d33a){if(_0x11d33a[_0xa441('0x57')]||_0x11d33a['CampaignId']){return db[_0x11d33a[_0xa441('0x57')]?_0xa441('0x58'):_0xa441('0x59')][_0xa441('0x51')]({'where':{'id':_0x11d33a[_0xa441('0x57')]?_0x11d33a[_0xa441('0x57')]:_0x11d33a[_0xa441('0x5a')]},'attributes':['id',_0xa441('0x27')],'raw':!![]});}}})['then'](function(_0x14090c){var _0x4bc947={};if(_0x14090c){_['merge'](_0x4bc947,_[_0xa441('0x5b')](_0x26b43e[_0xa441('0x5c')],[_0xa441('0x5d'),'updatedAt','id']));_0x4bc947['state']=0x15;_0x4bc947[_0xa441('0x5e')]='deleted';_0x4bc947[_0xa441('0x5f')]=_0x14090c[_0xa441('0x27')];_0x4bc947[_0xa441('0x60')]=_0x40564b[_0xa441('0x61')]['name'];_0x4bc947[_0xa441('0x62')]=_0x40564b[_0xa441('0x61')]['id'];_0x4bc947[_0xa441('0x63')]=!![];_0x4bc947[_0xa441('0x64')]=moment()[_0xa441('0x65')](_0xa441('0x66'));_0x4bc947[_0xa441('0x67')]=_0x26b43e[_0xa441('0x68')];_0x4bc947[_0xa441('0x69')]=_0x26b43e[_0xa441('0x57')]?_0xa441('0x6a'):'ivr';return db[_0xa441('0x6b')][_0xa441('0x51')]({'where':{'id':_0x4bc947[_0xa441('0x6c')]},'attributes':['firstName',_0xa441('0x6d')]})[_0xa441('0x1d')](function(_0x5178cb){if(!_[_0xa441('0x6e')](_0x42f619)&&!_[_0xa441('0x6e')](_0x5178cb['firstName'])){_0x4bc947[_0xa441('0x6f')]=_0x5178cb[_0xa441('0x70')];if(!_[_0xa441('0x6e')](_0x5178cb[_0xa441('0x6d')])){_0x4bc947['calleridname']+='\x20'+_0x5178cb[_0xa441('0x6d')];}}})[_0xa441('0x71')](function(){return db['CmHopperFinal'][_0xa441('0x52')](_0x4bc947);});}})[_0xa441('0x1d')](function(){return _0x42f619[_0xa441('0x17')](0xcc)[_0xa441('0x1e')]();})[_0xa441('0x4e')](handleError(_0x42f619,null));};exports[_0xa441('0x72')]=function(_0x216c6,_0x17f6a3,_0x4a5075){var _0x42529b=[];return db['CmContact'][_0xa441('0x55')]()[_0xa441('0x1d')](function(_0x3d936f){_0x42529b=_[_0xa441('0x29')](_0x3d936f);return _0x216c6[_0xa441('0x61')]['getVoiceQueues']({'where':{'type':_0xa441('0x73'),'dialActive':!![],'dialMethod':_0xa441('0x74')},'attributes':['id',_0xa441('0x75'),_0xa441('0x76')],'raw':!![]});})[_0xa441('0x1d')](function(_0x5665b1){if(_0x5665b1&&_0x5665b1['length']){return db[_0xa441('0x77')][_0xa441('0x78')](function(_0x3c44f7){var _0x365b6c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa441('0x22')](_0x5665b1,'id')},'$or':[{'UserId':null},{'UserId':_0x216c6['user']['id']}]};var _0x2cd432={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5665b1)[_0xa441('0x44')]([_0xa441('0x76'),0x0])[_0xa441('0x22')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x216c6[_0xa441('0x61')]['id']}]};var _0x16e8c2={'$or':[_0x365b6c,_0x2cd432]};var _0x3a9e74=[];if(_0x216c6['body']['direction']&&_0x216c6[_0xa441('0x53')][_0xa441('0x79')]===_0xa441('0x7a')){if(!_['isEmpty'](_0x216c6['body']['hopperIds'])){_0x16e8c2['id']={'$in':_0x216c6[_0xa441('0x53')][_0xa441('0x7b')]};}_0x3a9e74=[[_0xa441('0x7c'),_0xa441('0x7d')],[_0xa441('0x7e'),_0x5665b1[0x0][_0xa441('0x75')]===_0xa441('0x7d')?_0xa441('0x7f'):_0xa441('0x7d')],db[_0xa441('0x77')][_0xa441('0x80')](_0xa441('0x81')),['id',_0xa441('0x7f')]];}else{if(!_[_0xa441('0x82')](_0x216c6[_0xa441('0x53')]['hopperIds'])){_0x16e8c2['id']={'$notIn':_0x216c6['body'][_0xa441('0x7b')]};}_0x3a9e74=[[_0xa441('0x7c'),'DESC'],['scheduledAt',_0x5665b1[0x0][_0xa441('0x75')]],db['sequelize'][_0xa441('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xa441('0x7d')]];}return db[_0xa441('0x4b')]['findOne']({'attributes':['id',_0xa441('0x83'),'recallme'],'where':_0x16e8c2,'order':_0x3a9e74,'transaction':_0x3c44f7,'lock':_0x3c44f7[_0xa441('0x84')][_0xa441('0x85')],'include':[{'model':db['CmContact'],'as':_0xa441('0x86'),'attributes':_0x42529b,'include':[{'model':db[_0xa441('0x87')],'as':_0xa441('0x88'),'attributes':['id',_0xa441('0x27')]}]},{'model':db['CmList'],'as':_0xa441('0x89'),'attributes':['id',_0xa441('0x27')]},{'model':db[_0xa441('0x58')],'as':_0xa441('0x8a'),'attributes':['id',_0xa441('0x27'),'dialActive']}]})[_0xa441('0x1d')](function(_0x4e1eee){if(_0x4e1eee){return _0x4e1eee[_0xa441('0x1c')]({'UserId':_0x216c6[_0xa441('0x61')]['id']},{'transaction':_0x3c44f7});}});});}})[_0xa441('0x1d')](handleEntityNotFound(_0x17f6a3,null))[_0xa441('0x1d')](respondWithResult(_0x17f6a3,null))[_0xa441('0x4e')](handleError(_0x17f6a3,null));};exports[_0xa441('0x8b')]=function(_0x5cc6dd,_0x47ca9e,_0x51b459){return _0x5cc6dd[_0xa441('0x61')]['getVoiceQueues']({'where':{'type':_0xa441('0x73'),'dialActive':!![],'dialMethod':_0xa441('0x74')},'attributes':['id'],'raw':!![]})['then'](function(_0x522817){if(_0x522817&&_0x522817['length']){return db['CmHopper'][_0xa441('0x15')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa441('0x65')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa441('0x22')](_0x522817,'id')},'$or':[{'UserId':null},{'UserId':_0x5cc6dd[_0xa441('0x61')]['id']}]}});}return 0x0;})[_0xa441('0x1d')](function(_0x3a5232){if(!_['isNil'](_0x3a5232)&&_[_0xa441('0x8c')](_0x3a5232)){return _0x47ca9e['status'](0xc8)[_0xa441('0x19')]({'contacts':_0x3a5232});}else{logger[_0xa441('0x1f')](_0xa441('0x8d'),_0xa441('0x8b'),0x194,_0xa441('0x8e'));_0x47ca9e[_0xa441('0x12')](0x194);}})[_0xa441('0x4e')](handleError(_0x47ca9e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 4c88516..7d38a36 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 _0x2bd8=['CmHopper','cm_hopper','scheduledat','phone','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports','define'];(function(_0x320d1c,_0x3d219a){var _0x214b5f=function(_0x322b1e){while(--_0x322b1e){_0x320d1c['push'](_0x320d1c['shift']());}};_0x214b5f(++_0x3d219a);}(_0x2bd8,0x130));var _0x82bd=function(_0x5422e2,_0x33ed2f){_0x5422e2=_0x5422e2-0x0;var _0x27618f=_0x2bd8[_0x5422e2];return _0x27618f;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[{'name':_0x82bd('0xd'),'fields':['scheduledat']},{'name':_0x82bd('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x139b0a,_0x1b7cdd){var _0x3eccbd=function(_0x1fb5ba){while(--_0x1fb5ba){_0x139b0a['push'](_0x139b0a['shift']());}};_0x3eccbd(++_0x1b7cdd);}(_0x2eb2,0x19f));var _0x22eb=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x2eb2[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xb')]},{'name':_0x22eb('0xc'),'fields':[_0x22eb('0xc')]},{'name':_0x22eb('0xd'),'fields':[_0x22eb('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 6cc7e52..62dffe8 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 _0x818b=['UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','keys','voicePause','length','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','CmContact','UserId','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopper','options','raw','attributes','limit','include','map','then','debug','GetCmHopper','find','model','ShowCmHopper','catch','CreateCmHopper','create','body','UpdateCmHopper','update','where'];(function(_0x58fd2f,_0x37e8d8){var _0x1caddd=function(_0x5a3849){while(--_0x5a3849){_0x58fd2f['push'](_0x58fd2f['shift']());}};_0x1caddd(++_0x37e8d8);}(_0x818b,0x71));var _0xb818=function(_0x4a9cd2,_0x17941a){_0x4a9cd2=_0x4a9cd2-0x0;var _0x5b56f5=_0x818b[_0x4a9cd2];return _0x5b56f5;};'use strict';var _=require(_0xb818('0x0'));var util=require(_0xb818('0x1'));var moment=require(_0xb818('0x2'));var BPromise=require('bluebird');var rs=require(_0xb818('0x3'));var fs=require('fs');var Redis=require(_0xb818('0x4'));var db=require(_0xb818('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb818('0x6'))('rpc');var config=require(_0xb818('0x7'));var jayson=require(_0xb818('0x8'));var client=jayson[_0xb818('0x9')][_0xb818('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292332,_0x4c6032,_0x20ee26){return new BPromise(function(_0x40c609,_0x1000f9){return client[_0xb818('0xb')](_0x292332,_0x20ee26)['then'](function(_0x382243){logger[_0xb818('0xc')](_0xb818('0xd'),_0x4c6032,_0xb818('0xe'));logger['debug'](_0xb818('0xf'),_0x4c6032,'request\x20sent',JSON[_0xb818('0x10')](_0x382243));if(_0x382243[_0xb818('0x11')]){if(_0x382243[_0xb818('0x11')][_0xb818('0x12')]===0x1f4){logger[_0xb818('0x11')](_0xb818('0xd'),_0x4c6032,_0x382243[_0xb818('0x11')][_0xb818('0x13')]);return _0x1000f9(_0x382243[_0xb818('0x11')][_0xb818('0x13')]);}logger[_0xb818('0x11')](_0xb818('0xd'),_0x4c6032,_0x382243[_0xb818('0x11')]['message']);return _0x40c609(_0x382243[_0xb818('0x11')]['message']);}else{logger[_0xb818('0xc')](_0xb818('0xd'),_0x4c6032,_0xb818('0xe'));_0x40c609(_0x382243[_0xb818('0x14')][_0xb818('0x13')]);}})['catch'](function(_0x42ca3e){logger['error'](_0xb818('0xd'),_0x4c6032,_0x42ca3e);_0x1000f9(_0x42ca3e);});});}exports['GetCmHopper']=function(_0x413eae){var _0x299a6f=this;return new Promise(function(_0x86be,_0x52d4c2){return db[_0xb818('0x15')]['findAll']({'raw':_0x413eae[_0xb818('0x16')]?_0x413eae[_0xb818('0x16')][_0xb818('0x17')]===undefined?!![]:![]:!![],'where':_0x413eae['options']?_0x413eae['options']['where']||null:null,'attributes':_0x413eae[_0xb818('0x16')]?_0x413eae[_0xb818('0x16')][_0xb818('0x18')]||null:null,'limit':_0x413eae[_0xb818('0x16')]?_0x413eae['options'][_0xb818('0x19')]||null:null,'include':_0x413eae[_0xb818('0x16')]?_0x413eae['options'][_0xb818('0x1a')]?_['map'](_0x413eae[_0xb818('0x16')][_0xb818('0x1a')],function(_0x12ecf6){return{'model':db[_0x12ecf6['model']],'as':_0x12ecf6['as'],'attributes':_0x12ecf6[_0xb818('0x18')],'include':_0x12ecf6[_0xb818('0x1a')]?_[_0xb818('0x1b')](_0x12ecf6[_0xb818('0x1a')],function(_0x10286f){return{'model':db[_0x10286f['model']],'as':_0x10286f['as'],'attributes':_0x10286f[_0xb818('0x18')],'include':_0x10286f[_0xb818('0x1a')]?_['map'](_0x10286f[_0xb818('0x1a')],function(_0x3edc1d){return{'model':db[_0x3edc1d['model']],'as':_0x3edc1d['as'],'attributes':_0x3edc1d[_0xb818('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb818('0x1c')](function(_0x712b92){logger[_0xb818('0xc')]('GetCmHopper',_0x413eae);logger[_0xb818('0x1d')]('GetCmHopper',_0x413eae,JSON[_0xb818('0x10')](_0x712b92));_0x86be(_0x712b92);})['catch'](function(_0x191784){logger[_0xb818('0x11')](_0xb818('0x1e'),_0x191784['message'],_0x413eae);_0x52d4c2(_0x299a6f[_0xb818('0x11')](0x1f4,_0x191784[_0xb818('0x13')]));});});};exports['ShowCmHopper']=function(_0x4cf301){var _0x40a816=this;return new Promise(function(_0x42fab2,_0x2f653d){return db[_0xb818('0x15')][_0xb818('0x1f')]({'raw':_0x4cf301[_0xb818('0x16')]?_0x4cf301['options'][_0xb818('0x17')]===undefined?!![]:![]:!![],'where':_0x4cf301[_0xb818('0x16')]?_0x4cf301[_0xb818('0x16')]['where']||null:null,'attributes':_0x4cf301[_0xb818('0x16')]?_0x4cf301[_0xb818('0x16')]['attributes']||null:null,'include':_0x4cf301[_0xb818('0x16')]?_0x4cf301[_0xb818('0x16')][_0xb818('0x1a')]?_[_0xb818('0x1b')](_0x4cf301[_0xb818('0x16')]['include'],function(_0x18a22b){return{'model':db[_0x18a22b['model']],'as':_0x18a22b['as'],'attributes':_0x18a22b[_0xb818('0x18')],'include':_0x18a22b[_0xb818('0x1a')]?_['map'](_0x18a22b[_0xb818('0x1a')],function(_0x18d9b9){return{'model':db[_0x18d9b9[_0xb818('0x20')]],'as':_0x18d9b9['as'],'attributes':_0x18d9b9[_0xb818('0x18')],'include':_0x18d9b9['include']?_['map'](_0x18d9b9[_0xb818('0x1a')],function(_0x444b0c){return{'model':db[_0x444b0c[_0xb818('0x20')]],'as':_0x444b0c['as'],'attributes':_0x444b0c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb818('0x1c')](function(_0x21fcf6){logger['info'](_0xb818('0x21'),_0x4cf301);logger['debug'](_0xb818('0x21'),_0x4cf301,JSON[_0xb818('0x10')](_0x21fcf6));_0x42fab2(_0x21fcf6);})[_0xb818('0x22')](function(_0x3c10ea){logger['error'](_0xb818('0x21'),_0x3c10ea[_0xb818('0x13')],_0x4cf301);_0x2f653d(_0x40a816[_0xb818('0x11')](0x1f4,_0x3c10ea['message']));});});};exports[_0xb818('0x23')]=function(_0x157a96){var _0x143cdc=this;return new Promise(function(_0x18c2d5,_0x15f90d){return db[_0xb818('0x15')][_0xb818('0x24')](_0x157a96[_0xb818('0x25')],{'raw':_0x157a96[_0xb818('0x16')]?_0x157a96[_0xb818('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28dec9){logger[_0xb818('0xc')](_0xb818('0x23'),_0x157a96);logger[_0xb818('0x1d')](_0xb818('0x23'),_0x157a96,JSON[_0xb818('0x10')](_0x28dec9));_0x18c2d5(_0x28dec9);})[_0xb818('0x22')](function(_0x13acfa){logger[_0xb818('0x11')](_0xb818('0x23'),_0x13acfa['message'],_0x157a96);_0x15f90d(_0x143cdc[_0xb818('0x11')](0x1f4,_0x13acfa['message']));});});};exports[_0xb818('0x26')]=function(_0x530a82){var _0x5e4809=this;return new Promise(function(_0x54d983,_0x3fafe0){return db['CmHopper'][_0xb818('0x27')](_0x530a82[_0xb818('0x25')],{'raw':_0x530a82[_0xb818('0x16')]?_0x530a82[_0xb818('0x16')][_0xb818('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530a82[_0xb818('0x16')]?_0x530a82[_0xb818('0x16')][_0xb818('0x28')]||null:null,'attributes':_0x530a82[_0xb818('0x16')]?_0x530a82[_0xb818('0x16')][_0xb818('0x18')]||null:null,'limit':_0x530a82[_0xb818('0x16')]?_0x530a82[_0xb818('0x16')][_0xb818('0x19')]||null:null})[_0xb818('0x1c')](function(_0x4e3c8a){logger['info'](_0xb818('0x26'),_0x530a82);logger[_0xb818('0xc')](_0xb818('0x29'),JSON[_0xb818('0x10')](_0x530a82[_0xb818('0x16')][_0xb818('0x28')]),_0x530a82[_0xb818('0x25')][_0xb818('0x2a')]);logger[_0xb818('0x1d')](_0xb818('0x26'),_0x530a82,JSON[_0xb818('0x10')](_0x4e3c8a));_0x54d983(_0x4e3c8a);})[_0xb818('0x22')](function(_0x5808a6){logger[_0xb818('0x11')]('UpdateCmHopper',_0x5808a6[_0xb818('0x13')],_0x530a82);_0x3fafe0(_0x5e4809[_0xb818('0x11')](0x1f4,_0x5808a6[_0xb818('0x13')]));});});};exports[_0xb818('0x2b')]=function(_0x448d08){var _0x43b944=this;return new Promise(function(_0x233254,_0x5a4b01){return db[_0xb818('0x15')]['destroy']({'where':_0x448d08[_0xb818('0x16')]?_0x448d08['options'][_0xb818('0x28')]||null:null})[_0xb818('0x1c')](function(_0x48b859){logger[_0xb818('0xc')](_0xb818('0x2b'),_0x448d08);logger['debug']('DestroyCmHopper',_0x448d08,JSON[_0xb818('0x10')](_0x48b859));_0x233254(_0x48b859);})[_0xb818('0x22')](function(_0x2cceae){logger['error'](_0xb818('0x2b'),_0x2cceae['message'],_0x448d08);_0x5a4b01(_0x43b944[_0xb818('0x11')](0x1f4,_0x2cceae[_0xb818('0x13')]));});});};exports[_0xb818('0x2c')]=function(_0xd33026){var _0x3ac5fb=this;return new Promise(function(_0x9ffb37,_0x59007c){return db['CmContact'][_0xb818('0x2d')]()[_0xb818('0x1c')](function(_0x1b11fb){return db[_0xb818('0x2e')]['transaction'](function(_0x4099b6){return db['CmHopper'][_0xb818('0x2f')]({'where':_0xd33026[_0xb818('0x16')]?_0xd33026['options'][_0xb818('0x28')]||null:null,'attributes':_0xd33026[_0xb818('0x16')]?_0xd33026[_0xb818('0x16')]['attributes']||null:null,'limit':_0xd33026['options']?_0xd33026[_0xb818('0x16')][_0xb818('0x19')]||null:null,'order':_0xd33026['options']?_0xd33026['options'][_0xb818('0x30')]||null:null,'transaction':_0x4099b6,'lock':_0x4099b6[_0xb818('0x31')][_0xb818('0x32')],'include':[{'model':db['CmContact'],'as':_0xb818('0x33'),'attributes':_[_0xb818('0x34')](_0x1b11fb)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0xb818('0x35')]}]})[_0xb818('0x1c')](function(_0x33fb0a){var _0x5161c4=[];var _0x59a503=[];for(var _0x491546=0x0;_0x491546<_0x33fb0a[_0xb818('0x36')];_0x491546+=0x1){var _0x36a894=_0x33fb0a[_0x491546]['UserId'];if(_0x36a894===null){_0x5161c4[_0xb818('0x37')](_0x33fb0a[_0x491546]['update'](_0xd33026[_0xb818('0x25')],{'transaction':_0x4099b6}));}else if(!_0x59a503['includes'](_0x36a894)){_0x59a503[_0xb818('0x37')](_0x36a894);_0x5161c4[_0xb818('0x37')](_0x33fb0a[_0x491546][_0xb818('0x27')](_0xd33026[_0xb818('0x25')],{'transaction':_0x4099b6}));}}return BPromise[_0xb818('0x38')](_0x5161c4);});})[_0xb818('0x1c')](function(_0x3b20f1){logger[_0xb818('0xc')](_0xb818('0x2c'),_0xd33026);if(_0x3b20f1[_0xb818('0x36')]>0x0){logger[_0xb818('0xc')](_0xb818('0x39'),_0x3b20f1[0x0][_0xb818('0x3a')]['id'],_0x3b20f1[0x0][_0xb818('0x3a')][_0xb818('0x3b')],_0x3b20f1[0x0][_0xb818('0x3a')]['active']);}logger[_0xb818('0x1d')](_0xb818('0x2c'),_0xd33026,JSON[_0xb818('0x10')](_0x3b20f1));_0x9ffb37(_0x3b20f1);})['catch'](function(_0x447b47){logger['error'](_0xb818('0x2c'),_0x447b47[_0xb818('0x13')],_0xd33026);_0x59007c(_0x3ac5fb[_0xb818('0x11')](0x1f4,_0x447b47['message']));});});});};exports[_0xb818('0x3c')]=function(_0x4e601b){var _0x24cc9b=this;return new Promise(function(_0xe79a09,_0x262a4f){return db['sequelize'][_0xb818('0x3d')](function(_0x17665f){return db[_0xb818('0x3e')][_0xb818('0x24')](_0x4e601b[_0xb818('0x25')],{'raw':_0x4e601b[_0xb818('0x16')]?_0x4e601b[_0xb818('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x17665f})[_0xb818('0x1c')](function(){logger['info'](_0xb818('0x3f'),JSON[_0xb818('0x10')](_0x4e601b[_0xb818('0x16')][_0xb818('0x28')]),_0x4e601b[_0xb818('0x16')][_0xb818('0x28')]['active']);return db[_0xb818('0x15')][_0xb818('0x40')]({'where':_0x4e601b[_0xb818('0x16')]?_0x4e601b['options'][_0xb818('0x28')]||null:null,'transaction':_0x17665f});});})[_0xb818('0x1c')](function(_0x9a6843){logger[_0xb818('0xc')](_0xb818('0x3c'),_0x4e601b);logger['debug'](_0xb818('0x3c'),_0x4e601b,JSON[_0xb818('0x10')](_0x9a6843));_0xe79a09(_0x9a6843);})[_0xb818('0x22')](function(_0x2d7fac){logger[_0xb818('0x11')]('MoveContactManagedDialer',_0x2d7fac['message'],_0x4e601b);_0x262a4f(_0x24cc9b[_0xb818('0x11')](0x1f4,_0x2d7fac[_0xb818('0x13')]));});});};exports[_0xb818('0x41')]=function(_0x3ecbef){var _0xbd19f1=this;return new Promise(function(_0x27c1cd,_0x434331){return db[_0xb818('0x15')][_0xb818('0x2f')]({'raw':_0x3ecbef['options']?_0x3ecbef[_0xb818('0x16')][_0xb818('0x17')]===undefined?!![]:![]:!![],'where':_0x3ecbef[_0xb818('0x16')]?_0x3ecbef[_0xb818('0x16')][_0xb818('0x28')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb818('0x42'),db[_0xb818('0x2e')]['fn']('IF',db[_0xb818('0x2e')]['literal']('`scheduledat`\x20>=\x20'+util['format'](_0xb818('0x43'),moment()[_0xb818('0x44')](_0xb818('0x45')))+_0xb818('0x46')))),_0xb818('0x47')]]})['then'](function(_0x24f008){logger[_0xb818('0xc')](_0xb818('0x41'),_0x3ecbef);logger['debug']('CountReScheduled',_0x3ecbef,JSON[_0xb818('0x10')](_0x24f008));_0x27c1cd(_0x24f008);})[_0xb818('0x22')](function(_0x4e9008){logger['error']('CountReScheduled',_0x4e9008[_0xb818('0x13')],_0x3ecbef);_0x434331(_0xbd19f1[_0xb818('0x11')](0x1f4,_0x4e9008[_0xb818('0x13')]));});});};exports[_0xb818('0x48')]=function(_0x3413d0){var _0x1aa8a4=this;return new Promise(function(_0x20a491,_0x3e96ee){return db[_0xb818('0x49')][_0xb818('0x2d')]()[_0xb818('0x1c')](function(_0x70e921){return db[_0xb818('0x2e')]['transaction'](function(_0xa69808){return db[_0xb818('0x15')]['findAll']({'where':_0x3413d0[_0xb818('0x16')]?_0x3413d0[_0xb818('0x16')]['where']||null:null,'attributes':_0x3413d0[_0xb818('0x16')]?_0x3413d0[_0xb818('0x16')][_0xb818('0x18')]||null:null,'limit':0x1,'order':_0x3413d0[_0xb818('0x16')]?_0x3413d0['options'][_0xb818('0x30')]||null:null,'group':db[_0xb818('0x15')][_0xb818('0x4a')],'transaction':_0xa69808,'lock':_0xa69808[_0xb818('0x31')]['UPDATE'],'include':_0x3413d0[_0xb818('0x16')]?_0x3413d0[_0xb818('0x16')][_0xb818('0x1a')]?_[_0xb818('0x1b')](_0x3413d0[_0xb818('0x16')][_0xb818('0x1a')],function(_0x4dc9c4){return{'model':db[_0x4dc9c4['model']],'as':_0x4dc9c4['as'],'attributes':_0x4dc9c4[_0xb818('0x18')],'include':_0x4dc9c4['include']?_[_0xb818('0x1b')](_0x4dc9c4['include'],function(_0x3f33b0){return{'model':db[_0x3f33b0[_0xb818('0x20')]],'as':_0x3f33b0['as'],'attributes':_0x3f33b0[_0xb818('0x18')],'include':_0x3f33b0[_0xb818('0x1a')]?_[_0xb818('0x1b')](_0x3f33b0[_0xb818('0x1a')],function(_0x55468b){return{'model':db[_0x55468b[_0xb818('0x20')]],'as':_0x55468b['as'],'attributes':_0x55468b['attributes']};}):[]};}):[]};}):[]:[]})[_0xb818('0x1c')](function(_0x3fee1d){var _0x23529a=[];for(var _0x36da5f=0x0;_0x36da5f<_0x3fee1d['length'];_0x36da5f+=0x1){_0x23529a['push'](_0x3fee1d[_0x36da5f][_0xb818('0x27')](_0x3413d0[_0xb818('0x25')],{'transaction':_0xa69808}));}return BPromise[_0xb818('0x38')](_0x23529a);});})[_0xb818('0x1c')](function(_0x2a957c){logger[_0xb818('0xc')](_0xb818('0x48'),_0x3413d0);logger[_0xb818('0x1d')](_0xb818('0x48'),_0x3413d0,JSON[_0xb818('0x10')](_0x2a957c));_0x20a491(_0x2a957c);})[_0xb818('0x22')](function(_0x2ab135){logger[_0xb818('0x11')](_0xb818('0x48'),_0x2ab135['message'],_0x3413d0);_0x3e96ee(_0x1aa8a4[_0xb818('0x11')](0x1f4,_0x2ab135['message']));});});});};exports[_0xb818('0x4b')]=function(_0xbede74){var _0x1e86d7=this;return new Promise(function(_0x3e24f9,_0x2120bd){db['CmContact'][_0xb818('0x2d')]()['then'](function(_0x2b355a){return db['CmHopper']['findAll']({'raw':_0xbede74[_0xb818('0x16')]?_0xbede74['options']['raw']===undefined?!![]:![]:!![],'where':_0xbede74[_0xb818('0x16')]?_0xbede74[_0xb818('0x16')][_0xb818('0x28')]||null:null,'attributes':_0xbede74[_0xb818('0x16')]?_0xbede74[_0xb818('0x16')][_0xb818('0x18')]||null:null,'limit':_0xbede74[_0xb818('0x16')]?_0xbede74[_0xb818('0x16')][_0xb818('0x19')]||null:null,'include':_0xbede74['options']?_0xbede74[_0xb818('0x16')][_0xb818('0x1a')]?_[_0xb818('0x1b')](_0xbede74['options'][_0xb818('0x1a')],function(_0x55da43){return{'model':db[_0x55da43[_0xb818('0x20')]],'as':_0x55da43['as'],'attributes':_0x55da43['as']===_0xb818('0x33')?_[_0xb818('0x34')](_0x2b355a):_0x55da43[_0xb818('0x18')],'include':_0x55da43[_0xb818('0x1a')]?_[_0xb818('0x1b')](_0x55da43['include'],function(_0x2711a3){return{'model':db[_0x2711a3['model']],'as':_0x2711a3['as'],'attributes':_0x2711a3[_0xb818('0x18')],'include':_0x2711a3[_0xb818('0x1a')]?_[_0xb818('0x1b')](_0x2711a3[_0xb818('0x1a')],function(_0x1b7c46){return{'model':db[_0x1b7c46['model']],'as':_0x1b7c46['as'],'attributes':_0x1b7c46[_0xb818('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb818('0x1c')](function(_0x600e10){logger[_0xb818('0xc')](_0xb818('0x1e'),_0xbede74);logger[_0xb818('0x1d')](_0xb818('0x1e'),_0xbede74,JSON[_0xb818('0x10')](_0x600e10));_0x3e24f9(_0x600e10);})[_0xb818('0x22')](function(_0x981fc9){logger['error'](_0xb818('0x1e'),_0x981fc9[_0xb818('0x13')],_0xbede74);_0x2120bd(_0x1e86d7['error'](0x1f4,_0x981fc9[_0xb818('0x13')]));});});});};exports[_0xb818('0x4c')]=function(_0x417bbf){var _0x1a53a2=this;return new Promise(function(_0x20fed9,_0x2205c7){return db[_0xb818('0x2e')][_0xb818('0x3d')](function(_0x3b7213){return db[_0xb818('0x15')][_0xb818('0x27')]({'active':![]},{'where':{},'transaction':_0x3b7213})[_0xb818('0x1c')](function(_0x1e427e){logger[_0xb818('0xc')](_0xb818('0x4c'),_0x417bbf);logger[_0xb818('0x1d')](_0xb818('0x4c'),_0x417bbf,JSON[_0xb818('0x10')](_0x1e427e));_0x20fed9(_0x1e427e);})[_0xb818('0x22')](function(_0x298914){logger[_0xb818('0x11')](_0xb818('0x4c'),_0x298914[_0xb818('0x13')],_0x417bbf);_0x2205c7(_0x1a53a2[_0xb818('0x11')](0x1f4,_0x298914[_0xb818('0x13')]));});});});}; \ No newline at end of file +var _0xd596=['info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','catch','CmHopper,\x20%s,\x20%s','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','then','stringify','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','findAll','LOCK','UPDATE','User','Agent','name','voicePause','UserId','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','describe','GetContactRecallMe','keys','ResetActiveCalls','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x380eaa,_0x3380b5){var _0x576903=function(_0x2416c5){while(--_0x2416c5){_0x380eaa['push'](_0x380eaa['shift']());}};_0x576903(++_0x3380b5);}(_0xd596,0x1be));var _0x6d59=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xd596[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require(_0x6d59('0x0'));var moment=require(_0x6d59('0x1'));var BPromise=require(_0x6d59('0x2'));var rs=require(_0x6d59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d59('0x4'))(_0x6d59('0x5'));var config=require(_0x6d59('0x6'));var jayson=require(_0x6d59('0x7'));var client=jayson[_0x6d59('0x8')][_0x6d59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f836,_0x5895bc,_0x17d876){return new BPromise(function(_0x57c828,_0x3a8549){return client['request'](_0x44f836,_0x17d876)['then'](function(_0x2a8a48){logger[_0x6d59('0xa')]('CmHopper,\x20%s,\x20%s',_0x5895bc,_0x6d59('0xb'));logger[_0x6d59('0xc')](_0x6d59('0xd'),_0x5895bc,_0x6d59('0xb'),JSON['stringify'](_0x2a8a48));if(_0x2a8a48['error']){if(_0x2a8a48[_0x6d59('0xe')][_0x6d59('0xf')]===0x1f4){logger[_0x6d59('0xe')]('CmHopper,\x20%s,\x20%s',_0x5895bc,_0x2a8a48[_0x6d59('0xe')][_0x6d59('0x10')]);return _0x3a8549(_0x2a8a48[_0x6d59('0xe')]['message']);}logger[_0x6d59('0xe')]('CmHopper,\x20%s,\x20%s',_0x5895bc,_0x2a8a48[_0x6d59('0xe')][_0x6d59('0x10')]);return _0x57c828(_0x2a8a48[_0x6d59('0xe')][_0x6d59('0x10')]);}else{logger[_0x6d59('0xa')]('CmHopper,\x20%s,\x20%s',_0x5895bc,_0x6d59('0xb'));_0x57c828(_0x2a8a48['result']['message']);}})[_0x6d59('0x11')](function(_0x3261ad){logger[_0x6d59('0xe')](_0x6d59('0x12'),_0x5895bc,_0x3261ad);_0x3a8549(_0x3261ad);});});}exports[_0x6d59('0x13')]=function(_0x3ae90d){var _0x5c05e0=this;return new Promise(function(_0x3c652b,_0x5f272f){return db[_0x6d59('0x14')]['findAll']({'raw':_0x3ae90d[_0x6d59('0x15')]?_0x3ae90d[_0x6d59('0x15')][_0x6d59('0x16')]===undefined?!![]:![]:!![],'where':_0x3ae90d[_0x6d59('0x15')]?_0x3ae90d[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'attributes':_0x3ae90d['options']?_0x3ae90d[_0x6d59('0x15')][_0x6d59('0x18')]||null:null,'limit':_0x3ae90d[_0x6d59('0x15')]?_0x3ae90d['options'][_0x6d59('0x19')]||null:null,'include':_0x3ae90d[_0x6d59('0x15')]?_0x3ae90d[_0x6d59('0x15')]['include']?_[_0x6d59('0x1a')](_0x3ae90d[_0x6d59('0x15')]['include'],function(_0x51c480){return{'model':db[_0x51c480['model']],'as':_0x51c480['as'],'attributes':_0x51c480[_0x6d59('0x18')],'include':_0x51c480[_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x51c480['include'],function(_0x1eb823){return{'model':db[_0x1eb823[_0x6d59('0x1c')]],'as':_0x1eb823['as'],'attributes':_0x1eb823[_0x6d59('0x18')],'include':_0x1eb823['include']?_['map'](_0x1eb823[_0x6d59('0x1b')],function(_0x41b83c){return{'model':db[_0x41b83c['model']],'as':_0x41b83c['as'],'attributes':_0x41b83c[_0x6d59('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6d59('0x1d')](function(_0x4d5b50){logger[_0x6d59('0xa')]('GetCmHopper',_0x3ae90d);logger[_0x6d59('0xc')](_0x6d59('0x13'),_0x3ae90d,JSON[_0x6d59('0x1e')](_0x4d5b50));_0x3c652b(_0x4d5b50);})[_0x6d59('0x11')](function(_0x191446){logger[_0x6d59('0xe')](_0x6d59('0x13'),_0x191446[_0x6d59('0x10')],_0x3ae90d);_0x5f272f(_0x5c05e0[_0x6d59('0xe')](0x1f4,_0x191446[_0x6d59('0x10')]));});});};exports[_0x6d59('0x1f')]=function(_0x573ad9){var _0x1c5d30=this;return new Promise(function(_0x4b183d,_0x1cc147){return db[_0x6d59('0x14')][_0x6d59('0x20')]({'raw':_0x573ad9[_0x6d59('0x15')]?_0x573ad9[_0x6d59('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x573ad9['options']?_0x573ad9[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'attributes':_0x573ad9[_0x6d59('0x15')]?_0x573ad9[_0x6d59('0x15')][_0x6d59('0x18')]||null:null,'include':_0x573ad9['options']?_0x573ad9[_0x6d59('0x15')]['include']?_[_0x6d59('0x1a')](_0x573ad9[_0x6d59('0x15')]['include'],function(_0x2d81a7){return{'model':db[_0x2d81a7[_0x6d59('0x1c')]],'as':_0x2d81a7['as'],'attributes':_0x2d81a7[_0x6d59('0x18')],'include':_0x2d81a7[_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x2d81a7[_0x6d59('0x1b')],function(_0x2b536e){return{'model':db[_0x2b536e[_0x6d59('0x1c')]],'as':_0x2b536e['as'],'attributes':_0x2b536e[_0x6d59('0x18')],'include':_0x2b536e[_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x2b536e[_0x6d59('0x1b')],function(_0xdec83e){return{'model':db[_0xdec83e[_0x6d59('0x1c')]],'as':_0xdec83e['as'],'attributes':_0xdec83e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f4069){logger['info']('ShowCmHopper',_0x573ad9);logger[_0x6d59('0xc')]('ShowCmHopper',_0x573ad9,JSON[_0x6d59('0x1e')](_0x2f4069));_0x4b183d(_0x2f4069);})[_0x6d59('0x11')](function(_0x507b4c){logger['error'](_0x6d59('0x1f'),_0x507b4c[_0x6d59('0x10')],_0x573ad9);_0x1cc147(_0x1c5d30[_0x6d59('0xe')](0x1f4,_0x507b4c[_0x6d59('0x10')]));});});};exports[_0x6d59('0x21')]=function(_0x348dd2){var _0x511a56=this;return new Promise(function(_0x143c69,_0x116c0e){return db[_0x6d59('0x14')][_0x6d59('0x22')](_0x348dd2[_0x6d59('0x23')],{'raw':_0x348dd2[_0x6d59('0x15')]?_0x348dd2[_0x6d59('0x15')][_0x6d59('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x20a21d){logger['info']('CreateCmHopper',_0x348dd2);logger[_0x6d59('0xc')](_0x6d59('0x21'),_0x348dd2,JSON[_0x6d59('0x1e')](_0x20a21d));_0x143c69(_0x20a21d);})[_0x6d59('0x11')](function(_0x9fe49f){logger[_0x6d59('0xe')](_0x6d59('0x21'),_0x9fe49f['message'],_0x348dd2);_0x116c0e(_0x511a56[_0x6d59('0xe')](0x1f4,_0x9fe49f['message']));});});};exports[_0x6d59('0x24')]=function(_0x10475f){var _0x4ee646=this;return new Promise(function(_0x510416,_0x2a389d){return db[_0x6d59('0x14')][_0x6d59('0x25')](_0x10475f[_0x6d59('0x23')],{'raw':_0x10475f[_0x6d59('0x15')]?_0x10475f[_0x6d59('0x15')][_0x6d59('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10475f[_0x6d59('0x15')]?_0x10475f[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'attributes':_0x10475f[_0x6d59('0x15')]?_0x10475f[_0x6d59('0x15')][_0x6d59('0x18')]||null:null,'limit':_0x10475f[_0x6d59('0x15')]?_0x10475f[_0x6d59('0x15')][_0x6d59('0x19')]||null:null})['then'](function(_0x47014d){logger['info'](_0x6d59('0x24'),_0x10475f);logger[_0x6d59('0xa')](_0x6d59('0x26'),JSON[_0x6d59('0x1e')](_0x10475f[_0x6d59('0x15')][_0x6d59('0x17')]),_0x10475f[_0x6d59('0x23')][_0x6d59('0x27')]);logger[_0x6d59('0xc')](_0x6d59('0x24'),_0x10475f,JSON['stringify'](_0x47014d));_0x510416(_0x47014d);})[_0x6d59('0x11')](function(_0x55113f){logger['error'](_0x6d59('0x24'),_0x55113f[_0x6d59('0x10')],_0x10475f);_0x2a389d(_0x4ee646['error'](0x1f4,_0x55113f[_0x6d59('0x10')]));});});};exports[_0x6d59('0x28')]=function(_0x36ba6f){var _0x3f0c91=this;return new Promise(function(_0x4a140b,_0x2eb542){return db[_0x6d59('0x14')][_0x6d59('0x29')]({'where':_0x36ba6f[_0x6d59('0x15')]?_0x36ba6f['options'][_0x6d59('0x17')]||null:null})[_0x6d59('0x1d')](function(_0x3da15c){logger['info'](_0x6d59('0x28'),_0x36ba6f);logger[_0x6d59('0xc')](_0x6d59('0x28'),_0x36ba6f,JSON['stringify'](_0x3da15c));_0x4a140b(_0x3da15c);})[_0x6d59('0x11')](function(_0x1379b5){logger[_0x6d59('0xe')](_0x6d59('0x28'),_0x1379b5[_0x6d59('0x10')],_0x36ba6f);_0x2eb542(_0x3f0c91[_0x6d59('0xe')](0x1f4,_0x1379b5['message']));});});};exports[_0x6d59('0x2a')]=function(_0x57f354){var _0x3d62cf=this;return new Promise(function(_0x18e65b,_0x4d9248){return db[_0x6d59('0x2b')]['describe']()['then'](function(_0x17619a){return db[_0x6d59('0x2c')][_0x6d59('0x2d')](function(_0x5b3c3e){return db[_0x6d59('0x14')][_0x6d59('0x2e')]({'where':_0x57f354[_0x6d59('0x15')]?_0x57f354[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'attributes':_0x57f354[_0x6d59('0x15')]?_0x57f354[_0x6d59('0x15')][_0x6d59('0x18')]||null:null,'limit':_0x57f354[_0x6d59('0x15')]?_0x57f354[_0x6d59('0x15')][_0x6d59('0x19')]||null:null,'order':_0x57f354[_0x6d59('0x15')]?_0x57f354['options']['order']||null:null,'transaction':_0x5b3c3e,'lock':_0x5b3c3e[_0x6d59('0x2f')][_0x6d59('0x30')],'include':[{'model':db[_0x6d59('0x2b')],'as':'Contact','attributes':_['keys'](_0x17619a)},{'model':db[_0x6d59('0x31')],'as':_0x6d59('0x32'),'attributes':['id',_0x6d59('0x33'),_0x6d59('0x34')]}]})[_0x6d59('0x1d')](function(_0x193d4f){var _0x861cba=[];var _0x49ccab=[];for(var _0x1b0274=0x0;_0x1b0274<_0x193d4f['length'];_0x1b0274+=0x1){var _0x20106f=_0x193d4f[_0x1b0274][_0x6d59('0x35')];if(_0x20106f===null){_0x861cba[_0x6d59('0x36')](_0x193d4f[_0x1b0274][_0x6d59('0x25')](_0x57f354['body'],{'transaction':_0x5b3c3e}));}else if(!_0x49ccab[_0x6d59('0x37')](_0x20106f)){_0x49ccab[_0x6d59('0x36')](_0x20106f);_0x861cba[_0x6d59('0x36')](_0x193d4f[_0x1b0274][_0x6d59('0x25')](_0x57f354['body'],{'transaction':_0x5b3c3e}));}}return BPromise[_0x6d59('0x38')](_0x861cba);});})[_0x6d59('0x1d')](function(_0xa40c89){logger['info'](_0x6d59('0x2a'),_0x57f354);if(_0xa40c89[_0x6d59('0x39')]>0x0){logger[_0x6d59('0xa')](_0x6d59('0x3a'),_0xa40c89[0x0]['dataValues']['id'],_0xa40c89[0x0][_0x6d59('0x3b')][_0x6d59('0x3c')],_0xa40c89[0x0][_0x6d59('0x3b')][_0x6d59('0x27')]);}logger[_0x6d59('0xc')]('GetContactDialer',_0x57f354,JSON['stringify'](_0xa40c89));_0x18e65b(_0xa40c89);})[_0x6d59('0x11')](function(_0x3852de){logger[_0x6d59('0xe')](_0x6d59('0x2a'),_0x3852de[_0x6d59('0x10')],_0x57f354);_0x4d9248(_0x3d62cf['error'](0x1f4,_0x3852de[_0x6d59('0x10')]));});});});};exports[_0x6d59('0x3d')]=function(_0x410130){var _0x5f28ee=this;return new Promise(function(_0x194c5b,_0x546c60){return db[_0x6d59('0x2c')]['transaction'](function(_0x278b7b){return db[_0x6d59('0x3e')]['create'](_0x410130[_0x6d59('0x23')],{'raw':_0x410130[_0x6d59('0x15')]?_0x410130['options'][_0x6d59('0x16')]===undefined?!![]:![]:!![],'transaction':_0x278b7b})[_0x6d59('0x1d')](function(){logger[_0x6d59('0xa')](_0x6d59('0x3f'),JSON[_0x6d59('0x1e')](_0x410130[_0x6d59('0x15')][_0x6d59('0x17')]),_0x410130['options']['where'][_0x6d59('0x27')]);return db[_0x6d59('0x14')][_0x6d59('0x29')]({'where':_0x410130[_0x6d59('0x15')]?_0x410130[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'transaction':_0x278b7b});});})[_0x6d59('0x1d')](function(_0x2a3b3c){logger['info'](_0x6d59('0x3d'),_0x410130);logger[_0x6d59('0xc')]('MoveContactManagedDialer',_0x410130,JSON['stringify'](_0x2a3b3c));_0x194c5b(_0x2a3b3c);})[_0x6d59('0x11')](function(_0x451766){logger['error'](_0x6d59('0x3d'),_0x451766[_0x6d59('0x10')],_0x410130);_0x546c60(_0x5f28ee['error'](0x1f4,_0x451766['message']));});});};exports[_0x6d59('0x40')]=function(_0x8a8585){var _0x36ae46=this;return new Promise(function(_0x3f2f4f,_0x8bb2af){return db['CmHopper'][_0x6d59('0x2e')]({'raw':_0x8a8585[_0x6d59('0x15')]?_0x8a8585['options'][_0x6d59('0x16')]===undefined?!![]:![]:!![],'where':_0x8a8585[_0x6d59('0x15')]?_0x8a8585[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'attributes':[[db[_0x6d59('0x2c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6d59('0x2c')][_0x6d59('0x41')](_0x6d59('0x42')+util[_0x6d59('0x43')](_0x6d59('0x44'),moment()['format'](_0x6d59('0x45')))+_0x6d59('0x46')))),_0x6d59('0x47')]]})[_0x6d59('0x1d')](function(_0x3d6705){logger['info'](_0x6d59('0x40'),_0x8a8585);logger[_0x6d59('0xc')](_0x6d59('0x40'),_0x8a8585,JSON[_0x6d59('0x1e')](_0x3d6705));_0x3f2f4f(_0x3d6705);})[_0x6d59('0x11')](function(_0x437047){logger[_0x6d59('0xe')](_0x6d59('0x40'),_0x437047[_0x6d59('0x10')],_0x8a8585);_0x8bb2af(_0x36ae46[_0x6d59('0xe')](0x1f4,_0x437047[_0x6d59('0x10')]));});});};exports['GetContactRecallMe']=function(_0x4cb258){var _0x470c3c=this;return new Promise(function(_0x578062,_0x786622){return db[_0x6d59('0x2b')][_0x6d59('0x48')]()[_0x6d59('0x1d')](function(_0x2ca051){return db[_0x6d59('0x2c')][_0x6d59('0x2d')](function(_0x2bdeaa){return db[_0x6d59('0x14')][_0x6d59('0x2e')]({'where':_0x4cb258[_0x6d59('0x15')]?_0x4cb258[_0x6d59('0x15')][_0x6d59('0x17')]||null:null,'attributes':_0x4cb258['options']?_0x4cb258[_0x6d59('0x15')][_0x6d59('0x18')]||null:null,'limit':0x1,'order':_0x4cb258[_0x6d59('0x15')]?_0x4cb258[_0x6d59('0x15')]['order']||null:null,'group':db[_0x6d59('0x14')][_0x6d59('0x35')],'transaction':_0x2bdeaa,'lock':_0x2bdeaa[_0x6d59('0x2f')][_0x6d59('0x30')],'include':_0x4cb258[_0x6d59('0x15')]?_0x4cb258[_0x6d59('0x15')][_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x4cb258[_0x6d59('0x15')]['include'],function(_0x1a0372){return{'model':db[_0x1a0372[_0x6d59('0x1c')]],'as':_0x1a0372['as'],'attributes':_0x1a0372[_0x6d59('0x18')],'include':_0x1a0372['include']?_[_0x6d59('0x1a')](_0x1a0372[_0x6d59('0x1b')],function(_0x16569d){return{'model':db[_0x16569d[_0x6d59('0x1c')]],'as':_0x16569d['as'],'attributes':_0x16569d['attributes'],'include':_0x16569d[_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x16569d[_0x6d59('0x1b')],function(_0x22dc55){return{'model':db[_0x22dc55['model']],'as':_0x22dc55['as'],'attributes':_0x22dc55[_0x6d59('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf1ebae){var _0x465475=[];for(var _0x310576=0x0;_0x310576<_0xf1ebae[_0x6d59('0x39')];_0x310576+=0x1){_0x465475[_0x6d59('0x36')](_0xf1ebae[_0x310576]['update'](_0x4cb258[_0x6d59('0x23')],{'transaction':_0x2bdeaa}));}return BPromise[_0x6d59('0x38')](_0x465475);});})[_0x6d59('0x1d')](function(_0x4ba5f){logger[_0x6d59('0xa')](_0x6d59('0x49'),_0x4cb258);logger[_0x6d59('0xc')](_0x6d59('0x49'),_0x4cb258,JSON[_0x6d59('0x1e')](_0x4ba5f));_0x578062(_0x4ba5f);})[_0x6d59('0x11')](function(_0x28fb70){logger[_0x6d59('0xe')]('GetContactRecallMe',_0x28fb70[_0x6d59('0x10')],_0x4cb258);_0x786622(_0x470c3c[_0x6d59('0xe')](0x1f4,_0x28fb70[_0x6d59('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x3e4aac){var _0x978738=this;return new Promise(function(_0x2cf5f8,_0x3fa8ff){db['CmContact']['describe']()[_0x6d59('0x1d')](function(_0x24ef14){return db[_0x6d59('0x14')]['findAll']({'raw':_0x3e4aac['options']?_0x3e4aac[_0x6d59('0x15')][_0x6d59('0x16')]===undefined?!![]:![]:!![],'where':_0x3e4aac[_0x6d59('0x15')]?_0x3e4aac['options'][_0x6d59('0x17')]||null:null,'attributes':_0x3e4aac[_0x6d59('0x15')]?_0x3e4aac[_0x6d59('0x15')][_0x6d59('0x18')]||null:null,'limit':_0x3e4aac[_0x6d59('0x15')]?_0x3e4aac[_0x6d59('0x15')][_0x6d59('0x19')]||null:null,'include':_0x3e4aac['options']?_0x3e4aac['options'][_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x3e4aac[_0x6d59('0x15')][_0x6d59('0x1b')],function(_0x2c0efb){return{'model':db[_0x2c0efb[_0x6d59('0x1c')]],'as':_0x2c0efb['as'],'attributes':_0x2c0efb['as']==='Contact'?_[_0x6d59('0x4a')](_0x24ef14):_0x2c0efb[_0x6d59('0x18')],'include':_0x2c0efb[_0x6d59('0x1b')]?_[_0x6d59('0x1a')](_0x2c0efb['include'],function(_0x1db420){return{'model':db[_0x1db420['model']],'as':_0x1db420['as'],'attributes':_0x1db420[_0x6d59('0x18')],'include':_0x1db420[_0x6d59('0x1b')]?_['map'](_0x1db420[_0x6d59('0x1b')],function(_0x4ab3ac){return{'model':db[_0x4ab3ac[_0x6d59('0x1c')]],'as':_0x4ab3ac['as'],'attributes':_0x4ab3ac[_0x6d59('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f39ca){logger[_0x6d59('0xa')](_0x6d59('0x13'),_0x3e4aac);logger[_0x6d59('0xc')](_0x6d59('0x13'),_0x3e4aac,JSON[_0x6d59('0x1e')](_0x2f39ca));_0x2cf5f8(_0x2f39ca);})[_0x6d59('0x11')](function(_0x235ff6){logger[_0x6d59('0xe')](_0x6d59('0x13'),_0x235ff6['message'],_0x3e4aac);_0x3fa8ff(_0x978738[_0x6d59('0xe')](0x1f4,_0x235ff6[_0x6d59('0x10')]));});});});};exports[_0x6d59('0x4b')]=function(_0x206f81){var _0x59a8b3=this;return new Promise(function(_0x50837e,_0x3219cb){return db[_0x6d59('0x2c')][_0x6d59('0x2d')](function(_0x2babd8){return db[_0x6d59('0x14')][_0x6d59('0x25')]({'active':![]},{'where':{},'transaction':_0x2babd8})['then'](function(_0x566728){logger[_0x6d59('0xa')](_0x6d59('0x4b'),_0x206f81);logger[_0x6d59('0xc')]('ResetActiveCalls',_0x206f81,JSON['stringify'](_0x566728));_0x50837e(_0x566728);})[_0x6d59('0x11')](function(_0x1df0c9){logger[_0x6d59('0xe')]('ResetActiveCalls',_0x1df0c9['message'],_0x206f81);_0x3219cb(_0x59a8b3[_0x6d59('0xe')](0x1f4,_0x1df0c9[_0x6d59('0x10')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 34d3247..61c57df 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 _0x11fe=['update','delete','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id','getPreview'];(function(_0x4d4a74,_0x344a11){var _0x5491d8=function(_0x400056){while(--_0x400056){_0x4d4a74['push'](_0x4d4a74['shift']());}};_0x5491d8(++_0x344a11);}(_0x11fe,0x189));var _0xe11f=function(_0x325e83,_0x42c654){_0x325e83=_0x325e83-0x0;var _0x1af43e=_0x11fe[_0x325e83];return _0x1af43e;};'use strict';var multer=require(_0xe11f('0x0'));var util=require('util');var path=require(_0xe11f('0x1'));var timeout=require('connect-timeout');var express=require(_0xe11f('0x2'));var router=express[_0xe11f('0x3')]();var fs_extra=require(_0xe11f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe11f('0x5'));var config=require(_0xe11f('0x6'));var controller=require('./cmHopper.controller');router[_0xe11f('0x7')]('/',auth[_0xe11f('0x8')](),controller[_0xe11f('0x9')]);router[_0xe11f('0x7')](_0xe11f('0xa'),auth[_0xe11f('0x8')](),controller['describe']);router[_0xe11f('0x7')](_0xe11f('0xb'),auth[_0xe11f('0x8')](),controller[_0xe11f('0xc')]);router['get'](_0xe11f('0xd'),auth[_0xe11f('0x8')](),controller['show']);router['post']('/',auth[_0xe11f('0x8')](),controller['create']);router['post']('/preview',auth['isAuthenticated'](),controller[_0xe11f('0xe')]);router['put'](_0xe11f('0xd'),auth[_0xe11f('0x8')](),controller[_0xe11f('0xf')]);router[_0xe11f('0x10')](_0xe11f('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfa9c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','getPreview','put','delete','destroy','exports','multer','connect-timeout'];(function(_0x36f0d6,_0x145cf0){var _0x50ecde=function(_0x36a2a0){while(--_0x36a2a0){_0x36f0d6['push'](_0x36f0d6['shift']());}};_0x50ecde(++_0x145cf0);}(_0xfa9c,0x11e));var _0xcfa9=function(_0x18a4eb,_0x1a6f5c){_0x18a4eb=_0x18a4eb-0x0;var _0x4ca102=_0xfa9c[_0x18a4eb];return _0x4ca102;};'use strict';var multer=require(_0xcfa9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcfa9('0x1'));var express=require(_0xcfa9('0x2'));var router=express[_0xcfa9('0x3')]();var fs_extra=require(_0xcfa9('0x4'));var auth=require(_0xcfa9('0x5'));var interaction=require(_0xcfa9('0x6'));var config=require(_0xcfa9('0x7'));var controller=require('./cmHopper.controller');router[_0xcfa9('0x8')]('/',auth['isAuthenticated'](),controller[_0xcfa9('0x9')]);router[_0xcfa9('0x8')](_0xcfa9('0xa'),auth[_0xcfa9('0xb')](),controller[_0xcfa9('0xc')]);router[_0xcfa9('0x8')](_0xcfa9('0xd'),auth[_0xcfa9('0xb')](),controller[_0xcfa9('0xe')]);router['get'](_0xcfa9('0xf'),auth[_0xcfa9('0xb')](),controller['show']);router[_0xcfa9('0x10')]('/',auth[_0xcfa9('0xb')](),controller[_0xcfa9('0x11')]);router[_0xcfa9('0x10')](_0xcfa9('0x12'),auth[_0xcfa9('0xb')](),controller[_0xcfa9('0x13')]);router[_0xcfa9('0x14')](_0xcfa9('0xf'),auth[_0xcfa9('0xb')](),controller['update']);router[_0xcfa9('0x15')](_0xcfa9('0xf'),auth[_0xcfa9('0xb')](),controller[_0xcfa9('0x16')]);module[_0xcfa9('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ef1d165..6fc121a 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 _0xad78=['contactListQueue','moment','STRING','INTEGER'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0xad78,0x149));var _0x8ad7=function(_0x48e92c,_0x530b26){_0x48e92c=_0x48e92c-0x0;var _0x26e351=_0xad78[_0x48e92c];return _0x26e351;};'use strict';var moment=require(_0x8ad7('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x8ad7('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8ad7('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8ad7('0x2')],'unique':_0x8ad7('0x3')},'VoiceQueueId':{'type':Sequelize[_0x8ad7('0x2')],'unique':_0x8ad7('0x3')}}; \ No newline at end of file +var _0xfa0b=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x499360,_0x345879){var _0x46a6d9=function(_0x590a91){while(--_0x590a91){_0x499360['push'](_0x499360['shift']());}};_0x46a6d9(++_0x345879);}(_0xfa0b,0x1cc));var _0xbfa0=function(_0x429370,_0x46ff4c){_0x429370=_0x429370-0x0;var _0x41a3ad=_0xfa0b[_0x429370];return _0x41a3ad;};'use strict';var moment=require(_0xbfa0('0x0'));var Sequelize=require('sequelize');module[_0xbfa0('0x1')]={'phone':{'type':Sequelize[_0xbfa0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xbfa0('0x3')],'unique':_0xbfa0('0x4')},'ListId':{'type':Sequelize[_0xbfa0('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xbfa0('0x3')],'unique':_0xbfa0('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 37afdc3..7f6e4ab 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 _0x5b43=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','CmHopperBlack','include','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0xd3bcf8,_0x994fdb){var _0x296170=function(_0x2f5519){while(--_0x2f5519){_0xd3bcf8['push'](_0xd3bcf8['shift']());}};_0x296170(++_0x994fdb);}(_0x5b43,0x123));var _0x35b4=function(_0x290337,_0x25bf27){_0x290337=_0x290337-0x0;var _0x2a33e5=_0x5b43[_0x290337];return _0x2a33e5;};'use strict';var emlformat=require(_0x35b4('0x0'));var rimraf=require(_0x35b4('0x1'));var zipdir=require(_0x35b4('0x2'));var jsonpatch=require(_0x35b4('0x3'));var rp=require(_0x35b4('0x4'));var moment=require(_0x35b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35b4('0x6'));var util=require('util');var path=require(_0x35b4('0x7'));var sox=require(_0x35b4('0x8'));var csv=require(_0x35b4('0x9'));var ejs=require(_0x35b4('0xa'));var fs=require('fs');var fs_extra=require(_0x35b4('0xb'));var _=require(_0x35b4('0xc'));var squel=require(_0x35b4('0xd'));var crypto=require(_0x35b4('0xe'));var jsforce=require(_0x35b4('0xf'));var deskjs=require(_0x35b4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35b4('0x11'));var Papa=require('papaparse');var Redis=require(_0x35b4('0x12'));var authService=require(_0x35b4('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35b4('0x14'));var logger=require(_0x35b4('0x15'))(_0x35b4('0x16'));var utils=require(_0x35b4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x35b4('0x18'));var db=require(_0x35b4('0x19'))['db'];function respondWithStatusCode(_0x4ebbb4,_0x40e4a4){_0x40e4a4=_0x40e4a4||0xcc;return function(_0x1b427a){if(_0x1b427a){return _0x4ebbb4[_0x35b4('0x1a')](_0x40e4a4);}return _0x4ebbb4[_0x35b4('0x1b')](_0x40e4a4)['end']();};}function respondWithResult(_0x15a816,_0x5361ee){_0x5361ee=_0x5361ee||0xc8;return function(_0x42342a){if(_0x42342a){return _0x15a816[_0x35b4('0x1b')](_0x5361ee)[_0x35b4('0x1c')](_0x42342a);}};}function respondWithFilteredResult(_0x332dfd,_0x4ee47a){return function(_0xc83826){if(_0xc83826){var _0x22ea6c=typeof _0x4ee47a['offset']==='undefined'&&typeof _0x4ee47a[_0x35b4('0x1d')]===_0x35b4('0x1e');var _0x277e71=_0xc83826[_0x35b4('0x1f')];var _0x2cd5e5=_0x22ea6c?0x0:_0x4ee47a[_0x35b4('0x20')];var _0xda47a9=_0x22ea6c?_0xc83826[_0x35b4('0x1f')]:_0x4ee47a[_0x35b4('0x20')]+_0x4ee47a[_0x35b4('0x1d')];var _0x3927c9;if(_0xda47a9>=_0x277e71){_0xda47a9=_0x277e71;_0x3927c9=0xc8;}else{_0x3927c9=0xce;}_0x332dfd[_0x35b4('0x1b')](_0x3927c9);return _0x332dfd[_0x35b4('0x21')]('Content-Range',_0x2cd5e5+'-'+_0xda47a9+'/'+_0x277e71)[_0x35b4('0x1c')](_0xc83826);}return null;};}function patchUpdates(_0x3ce6da){return function(_0x22784b){try{jsonpatch[_0x35b4('0x22')](_0x22784b,_0x3ce6da,!![]);}catch(_0x2432b6){return BPromise[_0x35b4('0x23')](_0x2432b6);}return _0x22784b[_0x35b4('0x24')]();};}function saveUpdates(_0xfb3e0c,_0x3ac035){return function(_0x3e1b35){if(_0x3e1b35){return _0x3e1b35[_0x35b4('0x25')](_0xfb3e0c)[_0x35b4('0x26')](function(_0x13802d){return _0x13802d;});}return null;};}function removeEntity(_0x49932f,_0xb8bb7a){return function(_0xcca108){if(_0xcca108){return _0xcca108[_0x35b4('0x27')]()[_0x35b4('0x26')](function(){_0x49932f[_0x35b4('0x1b')](0xcc)[_0x35b4('0x28')]();});}};}function handleEntityNotFound(_0x20ac4d,_0x5c591d){return function(_0x742996){if(!_0x742996){_0x20ac4d[_0x35b4('0x1a')](0x194);}return _0x742996;};}function handleError(_0x253486,_0x26af59){_0x26af59=_0x26af59||0x1f4;return function(_0xaecb39){logger[_0x35b4('0x29')](_0xaecb39[_0x35b4('0x2a')]);if(_0xaecb39[_0x35b4('0x2b')]){delete _0xaecb39['name'];}_0x253486['status'](_0x26af59)[_0x35b4('0x2c')](_0xaecb39);};}exports[_0x35b4('0x2d')]=function(_0x705406,_0x9daeb0){var _0xaee874={},_0x59a4ff={},_0x5ccc1e={'count':0x0,'rows':[]};var _0x389aa7=_['map'](db['CmHopperBlack'][_0x35b4('0x2e')],function(_0xda312c){return{'name':_0xda312c[_0x35b4('0x2f')],'type':_0xda312c[_0x35b4('0x30')]['key']};});_0x59a4ff[_0x35b4('0x31')]=_[_0x35b4('0x32')](_0x389aa7,_0x35b4('0x2b'));_0x59a4ff[_0x35b4('0x33')]=_[_0x35b4('0x34')](_0x705406[_0x35b4('0x33')]);_0x59a4ff[_0x35b4('0x35')]=_[_0x35b4('0x36')](_0x59a4ff['model'],_0x59a4ff[_0x35b4('0x33')]);_0xaee874[_0x35b4('0x37')]=_[_0x35b4('0x36')](_0x59a4ff[_0x35b4('0x31')],qs[_0x35b4('0x38')](_0x705406['query']['fields']));_0xaee874[_0x35b4('0x37')]=_0xaee874[_0x35b4('0x37')][_0x35b4('0x39')]?_0xaee874[_0x35b4('0x37')]:_0x59a4ff[_0x35b4('0x31')];if(!_0x705406[_0x35b4('0x33')][_0x35b4('0x3a')](_0x35b4('0x3b'))){_0xaee874[_0x35b4('0x1d')]=qs['limit'](_0x705406['query']['limit']);_0xaee874['offset']=qs[_0x35b4('0x20')](_0x705406[_0x35b4('0x33')][_0x35b4('0x20')]);}_0xaee874[_0x35b4('0x3c')]=qs[_0x35b4('0x3d')](_0x705406[_0x35b4('0x33')][_0x35b4('0x3d')]);_0xaee874[_0x35b4('0x3e')]=qs[_0x35b4('0x35')](_[_0x35b4('0x3f')](_0x705406['query'],_0x59a4ff[_0x35b4('0x35')]),_0x389aa7);if(_0x705406[_0x35b4('0x33')]['filter']){_0xaee874[_0x35b4('0x3e')]=_[_0x35b4('0x40')](_0xaee874[_0x35b4('0x3e')],{'$or':_[_0x35b4('0x32')](_0x389aa7,function(_0xce0d22){if(_0xce0d22[_0x35b4('0x30')]!==_0x35b4('0x41')){var _0x1ae9fc={};_0x1ae9fc[_0xce0d22[_0x35b4('0x2b')]]={'$like':'%'+_0x705406[_0x35b4('0x33')][_0x35b4('0x42')]+'%'};return _0x1ae9fc;}})});}_0xaee874=_[_0x35b4('0x40')]({},_0xaee874,_0x705406[_0x35b4('0x43')]);var _0x149438={'where':_0xaee874[_0x35b4('0x3e')]};return db['CmHopperBlack'][_0x35b4('0x1f')](_0x149438)[_0x35b4('0x26')](function(_0x2eb2be){_0x5ccc1e[_0x35b4('0x1f')]=_0x2eb2be;if(_0x705406[_0x35b4('0x33')]['includeAll']){_0xaee874['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x35b4('0x44')](_0xaee874);})[_0x35b4('0x26')](function(_0x415eee){_0x5ccc1e[_0x35b4('0x45')]=_0x415eee;return _0x5ccc1e;})['then'](respondWithFilteredResult(_0x9daeb0,_0xaee874))[_0x35b4('0x46')](handleError(_0x9daeb0,null));};exports[_0x35b4('0x47')]=function(_0x14a5eb,_0x134476){var _0x27b4fe={'raw':!![],'where':{'id':_0x14a5eb[_0x35b4('0x48')]['id']}},_0x2712c4={};_0x2712c4[_0x35b4('0x31')]=_['keys'](db[_0x35b4('0x49')]['rawAttributes']);_0x2712c4[_0x35b4('0x33')]=_['keys'](_0x14a5eb[_0x35b4('0x33')]);_0x2712c4[_0x35b4('0x35')]=_[_0x35b4('0x36')](_0x2712c4[_0x35b4('0x31')],_0x2712c4[_0x35b4('0x33')]);_0x27b4fe[_0x35b4('0x37')]=_['intersection'](_0x2712c4['model'],qs[_0x35b4('0x38')](_0x14a5eb['query'][_0x35b4('0x38')]));_0x27b4fe[_0x35b4('0x37')]=_0x27b4fe[_0x35b4('0x37')][_0x35b4('0x39')]?_0x27b4fe[_0x35b4('0x37')]:_0x2712c4['model'];if(_0x14a5eb[_0x35b4('0x33')]['includeAll']){_0x27b4fe[_0x35b4('0x4a')]=[{'all':!![]}];}_0x27b4fe=_[_0x35b4('0x40')]({},_0x27b4fe,_0x14a5eb[_0x35b4('0x43')]);return db['CmHopperBlack']['find'](_0x27b4fe)[_0x35b4('0x26')](handleEntityNotFound(_0x134476,null))['then'](respondWithResult(_0x134476,null))['catch'](handleError(_0x134476,null));};exports['update']=function(_0x146bfb,_0x4a8dd8){if(_0x146bfb[_0x35b4('0x4b')]['id']){delete _0x146bfb[_0x35b4('0x4b')]['id'];}return db[_0x35b4('0x49')][_0x35b4('0x4c')]({'where':{'id':_0x146bfb[_0x35b4('0x48')]['id']}})[_0x35b4('0x26')](handleEntityNotFound(_0x4a8dd8,null))[_0x35b4('0x26')](saveUpdates(_0x146bfb[_0x35b4('0x4b')],null))[_0x35b4('0x26')](respondWithResult(_0x4a8dd8,null))[_0x35b4('0x46')](handleError(_0x4a8dd8,null));};exports['destroy']=function(_0x19396a,_0x12c7b2){return db['CmHopperBlack']['find']({'where':{'id':_0x19396a['params']['id']}})[_0x35b4('0x26')](handleEntityNotFound(_0x12c7b2,null))[_0x35b4('0x26')](removeEntity(_0x12c7b2,null))[_0x35b4('0x46')](handleError(_0x12c7b2,null));};exports['describe']=function(_0x3e70b4,_0x453aab){return db[_0x35b4('0x49')][_0x35b4('0x4d')]()[_0x35b4('0x26')](respondWithResult(_0x453aab,null))['catch'](handleError(_0x453aab,null));}; \ No newline at end of file +var _0xff15=['merge','type','options','includeAll','include','findAll','show','params','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0xff15,0x130));var _0x5ff1=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xff15[_0x2e4e19];return _0x9ba20b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ff1('0x0'));var zipdir=require(_0x5ff1('0x1'));var jsonpatch=require(_0x5ff1('0x2'));var rp=require(_0x5ff1('0x3'));var moment=require(_0x5ff1('0x4'));var BPromise=require(_0x5ff1('0x5'));var Mustache=require(_0x5ff1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5ff1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ff1('0x8'));var _=require(_0x5ff1('0x9'));var squel=require(_0x5ff1('0xa'));var crypto=require('crypto');var jsforce=require(_0x5ff1('0xb'));var deskjs=require(_0x5ff1('0xc'));var toCsv=require(_0x5ff1('0xd'));var querystring=require(_0x5ff1('0xe'));var Papa=require(_0x5ff1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ff1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ff1('0x11'))(_0x5ff1('0x12'));var utils=require(_0x5ff1('0x13'));var config=require(_0x5ff1('0x14'));var licenseUtil=require(_0x5ff1('0x15'));var db=require(_0x5ff1('0x16'))['db'];function respondWithStatusCode(_0x15460d,_0x1d500c){_0x1d500c=_0x1d500c||0xcc;return function(_0x4745bb){if(_0x4745bb){return _0x15460d[_0x5ff1('0x17')](_0x1d500c);}return _0x15460d[_0x5ff1('0x18')](_0x1d500c)['end']();};}function respondWithResult(_0x771700,_0x1c6420){_0x1c6420=_0x1c6420||0xc8;return function(_0x51b288){if(_0x51b288){return _0x771700[_0x5ff1('0x18')](_0x1c6420)[_0x5ff1('0x19')](_0x51b288);}};}function respondWithFilteredResult(_0x517723,_0x26403f){return function(_0x2d1f06){if(_0x2d1f06){var _0x15028c=typeof _0x26403f['offset']===_0x5ff1('0x1a')&&typeof _0x26403f[_0x5ff1('0x1b')]===_0x5ff1('0x1a');var _0x1b26c5=_0x2d1f06['count'];var _0x1dc4dc=_0x15028c?0x0:_0x26403f[_0x5ff1('0x1c')];var _0x35a45f=_0x15028c?_0x2d1f06[_0x5ff1('0x1d')]:_0x26403f[_0x5ff1('0x1c')]+_0x26403f[_0x5ff1('0x1b')];var _0x3df91a;if(_0x35a45f>=_0x1b26c5){_0x35a45f=_0x1b26c5;_0x3df91a=0xc8;}else{_0x3df91a=0xce;}_0x517723[_0x5ff1('0x18')](_0x3df91a);return _0x517723[_0x5ff1('0x1e')](_0x5ff1('0x1f'),_0x1dc4dc+'-'+_0x35a45f+'/'+_0x1b26c5)[_0x5ff1('0x19')](_0x2d1f06);}return null;};}function patchUpdates(_0x34f38c){return function(_0x1ab758){try{jsonpatch[_0x5ff1('0x20')](_0x1ab758,_0x34f38c,!![]);}catch(_0x1be4dd){return BPromise[_0x5ff1('0x21')](_0x1be4dd);}return _0x1ab758[_0x5ff1('0x22')]();};}function saveUpdates(_0x155a4e,_0xcab595){return function(_0x5487d1){if(_0x5487d1){return _0x5487d1[_0x5ff1('0x23')](_0x155a4e)['then'](function(_0x37a922){return _0x37a922;});}return null;};}function removeEntity(_0x295544,_0x4ec9da){return function(_0x368c21){if(_0x368c21){return _0x368c21[_0x5ff1('0x24')]()[_0x5ff1('0x25')](function(){_0x295544[_0x5ff1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fef36,_0x2b2f58){return function(_0x32ad58){if(!_0x32ad58){_0x4fef36[_0x5ff1('0x17')](0x194);}return _0x32ad58;};}function handleError(_0x387375,_0x4544ad){_0x4544ad=_0x4544ad||0x1f4;return function(_0x3e9075){logger[_0x5ff1('0x26')](_0x3e9075[_0x5ff1('0x27')]);if(_0x3e9075[_0x5ff1('0x28')]){delete _0x3e9075[_0x5ff1('0x28')];}_0x387375['status'](_0x4544ad)[_0x5ff1('0x29')](_0x3e9075);};}exports[_0x5ff1('0x2a')]=function(_0x123b5d,_0x4ed805){var _0xd68f2b={},_0x397e0b={},_0x4bba1d={'count':0x0,'rows':[]};var _0x2e5024=_['map'](db[_0x5ff1('0x2b')][_0x5ff1('0x2c')],function(_0x2febd5){return{'name':_0x2febd5[_0x5ff1('0x2d')],'type':_0x2febd5['type'][_0x5ff1('0x2e')]};});_0x397e0b[_0x5ff1('0x2f')]=_[_0x5ff1('0x30')](_0x2e5024,_0x5ff1('0x28'));_0x397e0b[_0x5ff1('0x31')]=_[_0x5ff1('0x32')](_0x123b5d['query']);_0x397e0b[_0x5ff1('0x33')]=_[_0x5ff1('0x34')](_0x397e0b['model'],_0x397e0b['query']);_0xd68f2b['attributes']=_[_0x5ff1('0x34')](_0x397e0b[_0x5ff1('0x2f')],qs[_0x5ff1('0x35')](_0x123b5d[_0x5ff1('0x31')][_0x5ff1('0x35')]));_0xd68f2b[_0x5ff1('0x36')]=_0xd68f2b[_0x5ff1('0x36')][_0x5ff1('0x37')]?_0xd68f2b[_0x5ff1('0x36')]:_0x397e0b['model'];if(!_0x123b5d[_0x5ff1('0x31')]['hasOwnProperty'](_0x5ff1('0x38'))){_0xd68f2b[_0x5ff1('0x1b')]=qs['limit'](_0x123b5d['query']['limit']);_0xd68f2b[_0x5ff1('0x1c')]=qs[_0x5ff1('0x1c')](_0x123b5d[_0x5ff1('0x31')]['offset']);}_0xd68f2b['order']=qs[_0x5ff1('0x39')](_0x123b5d['query'][_0x5ff1('0x39')]);_0xd68f2b[_0x5ff1('0x3a')]=qs['filters'](_[_0x5ff1('0x3b')](_0x123b5d[_0x5ff1('0x31')],_0x397e0b[_0x5ff1('0x33')]),_0x2e5024);if(_0x123b5d['query'][_0x5ff1('0x3c')]){_0xd68f2b['where']=_[_0x5ff1('0x3d')](_0xd68f2b[_0x5ff1('0x3a')],{'$or':_[_0x5ff1('0x30')](_0x2e5024,function(_0x2fe5ef){if(_0x2fe5ef[_0x5ff1('0x3e')]!=='VIRTUAL'){var _0x409582={};_0x409582[_0x2fe5ef['name']]={'$like':'%'+_0x123b5d[_0x5ff1('0x31')][_0x5ff1('0x3c')]+'%'};return _0x409582;}})});}_0xd68f2b=_[_0x5ff1('0x3d')]({},_0xd68f2b,_0x123b5d[_0x5ff1('0x3f')]);var _0x24faa1={'where':_0xd68f2b[_0x5ff1('0x3a')]};return db[_0x5ff1('0x2b')][_0x5ff1('0x1d')](_0x24faa1)['then'](function(_0x5188bf){_0x4bba1d[_0x5ff1('0x1d')]=_0x5188bf;if(_0x123b5d[_0x5ff1('0x31')][_0x5ff1('0x40')]){_0xd68f2b[_0x5ff1('0x41')]=[{'all':!![]}];}return db[_0x5ff1('0x2b')][_0x5ff1('0x42')](_0xd68f2b);})[_0x5ff1('0x25')](function(_0x13eee2){_0x4bba1d['rows']=_0x13eee2;return _0x4bba1d;})[_0x5ff1('0x25')](respondWithFilteredResult(_0x4ed805,_0xd68f2b))['catch'](handleError(_0x4ed805,null));};exports[_0x5ff1('0x43')]=function(_0x229597,_0x5336a9){var _0x355554={'raw':!![],'where':{'id':_0x229597[_0x5ff1('0x44')]['id']}},_0x8839c9={};_0x8839c9['model']=_[_0x5ff1('0x32')](db[_0x5ff1('0x2b')][_0x5ff1('0x2c')]);_0x8839c9[_0x5ff1('0x31')]=_[_0x5ff1('0x32')](_0x229597['query']);_0x8839c9[_0x5ff1('0x33')]=_['intersection'](_0x8839c9[_0x5ff1('0x2f')],_0x8839c9[_0x5ff1('0x31')]);_0x355554['attributes']=_[_0x5ff1('0x34')](_0x8839c9[_0x5ff1('0x2f')],qs[_0x5ff1('0x35')](_0x229597['query'][_0x5ff1('0x35')]));_0x355554[_0x5ff1('0x36')]=_0x355554['attributes']['length']?_0x355554[_0x5ff1('0x36')]:_0x8839c9[_0x5ff1('0x2f')];if(_0x229597[_0x5ff1('0x31')]['includeAll']){_0x355554['include']=[{'all':!![]}];}_0x355554=_['merge']({},_0x355554,_0x229597[_0x5ff1('0x3f')]);return db['CmHopperBlack'][_0x5ff1('0x45')](_0x355554)[_0x5ff1('0x25')](handleEntityNotFound(_0x5336a9,null))[_0x5ff1('0x25')](respondWithResult(_0x5336a9,null))['catch'](handleError(_0x5336a9,null));};exports[_0x5ff1('0x23')]=function(_0x591051,_0x46de25){if(_0x591051[_0x5ff1('0x46')]['id']){delete _0x591051[_0x5ff1('0x46')]['id'];}return db[_0x5ff1('0x2b')][_0x5ff1('0x45')]({'where':{'id':_0x591051[_0x5ff1('0x44')]['id']}})[_0x5ff1('0x25')](handleEntityNotFound(_0x46de25,null))[_0x5ff1('0x25')](saveUpdates(_0x591051['body'],null))['then'](respondWithResult(_0x46de25,null))[_0x5ff1('0x47')](handleError(_0x46de25,null));};exports[_0x5ff1('0x24')]=function(_0x1e8c68,_0x1a8e47){return db[_0x5ff1('0x2b')]['find']({'where':{'id':_0x1e8c68['params']['id']}})[_0x5ff1('0x25')](handleEntityNotFound(_0x1a8e47,null))['then'](removeEntity(_0x1a8e47,null))[_0x5ff1('0x47')](handleError(_0x1a8e47,null));};exports[_0x5ff1('0x48')]=function(_0x53c697,_0x4961b8){return db[_0x5ff1('0x2b')][_0x5ff1('0x48')]()['then'](respondWithResult(_0x4961b8,null))['catch'](handleError(_0x4961b8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index e747bd8..d05e84e 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 _0x2b74=['bluebird','request-promise','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment'];(function(_0x4e9fb4,_0x66b89){var _0x160386=function(_0x33cdf5){while(--_0x33cdf5){_0x4e9fb4['push'](_0x4e9fb4['shift']());}};_0x160386(++_0x66b89);}(_0x2b74,0x10f));var _0x42b7=function(_0x22eb7a,_0x329218){_0x22eb7a=_0x22eb7a-0x0;var _0x4ea5d0=_0x2b74[_0x22eb7a];return _0x4ea5d0;};'use strict';var _=require('lodash');var util=require(_0x42b7('0x0'));var logger=require(_0x42b7('0x1'))(_0x42b7('0x2'));var moment=require(_0x42b7('0x3'));var BPromise=require(_0x42b7('0x4'));var rp=require(_0x42b7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x42b7('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0x42b7('0x7')]=function(_0x25a9f9,_0xe35f34){return _0x25a9f9[_0x42b7('0x8')](_0x42b7('0x9'),attributes,{'tableName':_0x42b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49a5=['rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4fc83c,_0x9ade1d){var _0x83aad1=function(_0x3f0814){while(--_0x3f0814){_0x4fc83c['push'](_0x4fc83c['shift']());}};_0x83aad1(++_0x9ade1d);}(_0x49a5,0xfd));var _0x549a=function(_0x295049,_0x59246e){_0x295049=_0x295049-0x0;var _0x4c1452=_0x49a5[_0x295049];return _0x4c1452;};'use strict';var _=require(_0x549a('0x0'));var util=require(_0x549a('0x1'));var logger=require(_0x549a('0x2'))(_0x549a('0x3'));var moment=require(_0x549a('0x4'));var BPromise=require(_0x549a('0x5'));var rp=require(_0x549a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x549a('0x7'));var config=require('../../config/environment');var attributes=require(_0x549a('0x8'));module[_0x549a('0x9')]=function(_0x380b5e,_0x5f3dc4){return _0x380b5e[_0x549a('0xa')](_0x549a('0xb'),attributes,{'tableName':_0x549a('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 42a19b6..0c0c044 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 _0x148d=['stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','then','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0x148d,0x158));var _0xd148=function(_0x4ab7b8,_0x217147){_0x4ab7b8=_0x4ab7b8-0x0;var _0x978014=_0x148d[_0x4ab7b8];return _0x978014;};'use strict';var _=require(_0xd148('0x0'));var util=require(_0xd148('0x1'));var moment=require(_0xd148('0x2'));var BPromise=require(_0xd148('0x3'));var rs=require(_0xd148('0x4'));var fs=require('fs');var Redis=require(_0xd148('0x5'));var db=require(_0xd148('0x6'))['db'];var utils=require(_0xd148('0x7'));var logger=require(_0xd148('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd148('0x9'));var client=jayson[_0xd148('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22f2ae,_0x248dde,_0x47f808){return new BPromise(function(_0x31f9e8,_0x5cdc24){return client[_0xd148('0xb')](_0x22f2ae,_0x47f808)['then'](function(_0xbaf5fd){logger[_0xd148('0xc')](_0xd148('0xd'),_0x248dde,'request\x20sent');logger[_0xd148('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x248dde,_0xd148('0xf'),JSON[_0xd148('0x10')](_0xbaf5fd));if(_0xbaf5fd['error']){if(_0xbaf5fd[_0xd148('0x11')]['code']===0x1f4){logger['error'](_0xd148('0xd'),_0x248dde,_0xbaf5fd[_0xd148('0x11')]['message']);return _0x5cdc24(_0xbaf5fd[_0xd148('0x11')][_0xd148('0x12')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x248dde,_0xbaf5fd['error']['message']);return _0x31f9e8(_0xbaf5fd[_0xd148('0x11')][_0xd148('0x12')]);}else{logger[_0xd148('0xc')](_0xd148('0xd'),_0x248dde,_0xd148('0xf'));_0x31f9e8(_0xbaf5fd[_0xd148('0x13')][_0xd148('0x12')]);}})[_0xd148('0x14')](function(_0x54e863){logger[_0xd148('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x248dde,_0x54e863);_0x5cdc24(_0x54e863);});});}exports[_0xd148('0x15')]=function(_0x293d3e){var _0x544787=this;return new Promise(function(_0x277454,_0x3bafbb){return db[_0xd148('0x16')]['findAll']({'raw':_0x293d3e[_0xd148('0x17')]?_0x293d3e[_0xd148('0x17')][_0xd148('0x18')]===undefined?!![]:![]:!![],'where':_0x293d3e[_0xd148('0x17')]?_0x293d3e[_0xd148('0x17')][_0xd148('0x19')]||null:null,'attributes':_0x293d3e[_0xd148('0x17')]?_0x293d3e[_0xd148('0x17')][_0xd148('0x1a')]||null:null,'limit':_0x293d3e[_0xd148('0x17')]?_0x293d3e[_0xd148('0x17')][_0xd148('0x1b')]||null:null,'include':_0x293d3e[_0xd148('0x17')]?_0x293d3e['options'][_0xd148('0x1c')]?_[_0xd148('0x1d')](_0x293d3e[_0xd148('0x17')]['include'],function(_0x1c6555){return{'model':db[_0x1c6555[_0xd148('0x1e')]],'as':_0x1c6555['as'],'attributes':_0x1c6555[_0xd148('0x1a')],'include':_0x1c6555[_0xd148('0x1c')]?_[_0xd148('0x1d')](_0x1c6555[_0xd148('0x1c')],function(_0x557d9f){return{'model':db[_0x557d9f[_0xd148('0x1e')]],'as':_0x557d9f['as'],'attributes':_0x557d9f[_0xd148('0x1a')],'include':_0x557d9f[_0xd148('0x1c')]?_[_0xd148('0x1d')](_0x557d9f[_0xd148('0x1c')],function(_0x987c98){return{'model':db[_0x987c98[_0xd148('0x1e')]],'as':_0x987c98['as'],'attributes':_0x987c98[_0xd148('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd148('0x1f')](function(_0x191112){logger['info'](_0xd148('0x15'),_0x293d3e);logger[_0xd148('0xe')](_0xd148('0x15'),_0x293d3e,JSON[_0xd148('0x10')](_0x191112));_0x277454(_0x191112);})[_0xd148('0x14')](function(_0x598a18){logger[_0xd148('0x11')]('GetCmHopperBlack',_0x598a18[_0xd148('0x12')],_0x293d3e);_0x3bafbb(_0x544787['error'](0x1f4,_0x598a18[_0xd148('0x12')]));});});};exports[_0xd148('0x20')]=function(_0x178347){var _0x3feb4a=this;return new Promise(function(_0x338b2c,_0x5c7dc4){return db['CmHopperBlack'][_0xd148('0x21')](_0x178347[_0xd148('0x22')],{'raw':_0x178347[_0xd148('0x17')]?_0x178347[_0xd148('0x17')][_0xd148('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178347[_0xd148('0x17')]?_0x178347[_0xd148('0x17')][_0xd148('0x19')]||null:null,'attributes':_0x178347[_0xd148('0x17')]?_0x178347['options'][_0xd148('0x1a')]||null:null,'limit':_0x178347[_0xd148('0x17')]?_0x178347[_0xd148('0x17')][_0xd148('0x1b')]||null:null})['then'](function(_0x525ff7){logger[_0xd148('0xc')](_0xd148('0x20'),_0x178347);logger[_0xd148('0xe')](_0xd148('0x20'),_0x178347,JSON[_0xd148('0x10')](_0x525ff7));_0x338b2c(_0x525ff7);})[_0xd148('0x14')](function(_0x585102){logger[_0xd148('0x11')](_0xd148('0x20'),_0x585102[_0xd148('0x12')],_0x178347);_0x5c7dc4(_0x3feb4a['error'](0x1f4,_0x585102['message']));});});};exports['DestroyCmHopperBlack']=function(_0x437f62){var _0x5801dc=this;return new Promise(function(_0x30903f,_0x171e66){return db[_0xd148('0x16')]['destroy']({'where':_0x437f62[_0xd148('0x17')]?_0x437f62['options'][_0xd148('0x19')]||null:null})[_0xd148('0x1f')](function(_0x531842){logger[_0xd148('0xc')](_0xd148('0x23'),_0x437f62);logger[_0xd148('0xe')](_0xd148('0x23'),_0x437f62,JSON[_0xd148('0x10')](_0x531842));_0x30903f(_0x531842);})['catch'](function(_0x4c396e){logger[_0xd148('0x11')](_0xd148('0x23'),_0x4c396e['message'],_0x437f62);_0x171e66(_0x5801dc[_0xd148('0x11')](0x1f4,_0x4c396e[_0xd148('0x12')]));});});}; \ No newline at end of file +var _0x0e92=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','CmHopperBlack','findAll','raw','options','attributes','map','include','model','then','debug','GetCmHopperBlack','UpdateCmHopperBlack','update','body','where','limit','DestroyCmHopperBlack','destroy','moment','bluebird','randomstring','ioredis'];(function(_0x104132,_0x7dd10c){var _0x387c94=function(_0x151836){while(--_0x151836){_0x104132['push'](_0x104132['shift']());}};_0x387c94(++_0x7dd10c);}(_0x0e92,0x6e));var _0x20e9=function(_0x580e7d,_0x19534c){_0x580e7d=_0x580e7d-0x0;var _0x353966=_0x0e92[_0x580e7d];return _0x353966;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x20e9('0x0'));var BPromise=require(_0x20e9('0x1'));var rs=require(_0x20e9('0x2'));var fs=require('fs');var Redis=require(_0x20e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x20e9('0x4'));var logger=require(_0x20e9('0x5'))(_0x20e9('0x6'));var config=require(_0x20e9('0x7'));var jayson=require(_0x20e9('0x8'));var client=jayson[_0x20e9('0x9')][_0x20e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f8536,_0x26a20f,_0x2f366f){return new BPromise(function(_0x184918,_0x24ab30){return client['request'](_0x1f8536,_0x2f366f)['then'](function(_0x400655){logger[_0x20e9('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x26a20f,_0x20e9('0xc'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x26a20f,_0x20e9('0xc'),JSON[_0x20e9('0xd')](_0x400655));if(_0x400655[_0x20e9('0xe')]){if(_0x400655[_0x20e9('0xe')][_0x20e9('0xf')]===0x1f4){logger['error'](_0x20e9('0x10'),_0x26a20f,_0x400655[_0x20e9('0xe')]['message']);return _0x24ab30(_0x400655[_0x20e9('0xe')][_0x20e9('0x11')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x26a20f,_0x400655[_0x20e9('0xe')][_0x20e9('0x11')]);return _0x184918(_0x400655[_0x20e9('0xe')][_0x20e9('0x11')]);}else{logger[_0x20e9('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x26a20f,'request\x20sent');_0x184918(_0x400655[_0x20e9('0x12')][_0x20e9('0x11')]);}})[_0x20e9('0x13')](function(_0x38cc11){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x26a20f,_0x38cc11);_0x24ab30(_0x38cc11);});});}exports['GetCmHopperBlack']=function(_0x2e4436){var _0x337003=this;return new Promise(function(_0x85fea4,_0x94e146){return db[_0x20e9('0x14')][_0x20e9('0x15')]({'raw':_0x2e4436['options']?_0x2e4436['options'][_0x20e9('0x16')]===undefined?!![]:![]:!![],'where':_0x2e4436[_0x20e9('0x17')]?_0x2e4436[_0x20e9('0x17')]['where']||null:null,'attributes':_0x2e4436[_0x20e9('0x17')]?_0x2e4436['options'][_0x20e9('0x18')]||null:null,'limit':_0x2e4436[_0x20e9('0x17')]?_0x2e4436[_0x20e9('0x17')]['limit']||null:null,'include':_0x2e4436[_0x20e9('0x17')]?_0x2e4436[_0x20e9('0x17')]['include']?_[_0x20e9('0x19')](_0x2e4436[_0x20e9('0x17')][_0x20e9('0x1a')],function(_0x36aa7a){return{'model':db[_0x36aa7a[_0x20e9('0x1b')]],'as':_0x36aa7a['as'],'attributes':_0x36aa7a[_0x20e9('0x18')],'include':_0x36aa7a['include']?_[_0x20e9('0x19')](_0x36aa7a[_0x20e9('0x1a')],function(_0x49ebcc){return{'model':db[_0x49ebcc['model']],'as':_0x49ebcc['as'],'attributes':_0x49ebcc[_0x20e9('0x18')],'include':_0x49ebcc['include']?_[_0x20e9('0x19')](_0x49ebcc[_0x20e9('0x1a')],function(_0x10f5a6){return{'model':db[_0x10f5a6[_0x20e9('0x1b')]],'as':_0x10f5a6['as'],'attributes':_0x10f5a6[_0x20e9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x20e9('0x1c')](function(_0x276158){logger[_0x20e9('0xb')]('GetCmHopperBlack',_0x2e4436);logger[_0x20e9('0x1d')](_0x20e9('0x1e'),_0x2e4436,JSON[_0x20e9('0xd')](_0x276158));_0x85fea4(_0x276158);})[_0x20e9('0x13')](function(_0x5e5e88){logger[_0x20e9('0xe')](_0x20e9('0x1e'),_0x5e5e88[_0x20e9('0x11')],_0x2e4436);_0x94e146(_0x337003[_0x20e9('0xe')](0x1f4,_0x5e5e88[_0x20e9('0x11')]));});});};exports[_0x20e9('0x1f')]=function(_0x1c0dcd){var _0x57b706=this;return new Promise(function(_0x24ba4d,_0x22fdbc){return db[_0x20e9('0x14')][_0x20e9('0x20')](_0x1c0dcd[_0x20e9('0x21')],{'raw':_0x1c0dcd[_0x20e9('0x17')]?_0x1c0dcd[_0x20e9('0x17')][_0x20e9('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c0dcd[_0x20e9('0x17')]?_0x1c0dcd[_0x20e9('0x17')][_0x20e9('0x22')]||null:null,'attributes':_0x1c0dcd['options']?_0x1c0dcd[_0x20e9('0x17')][_0x20e9('0x18')]||null:null,'limit':_0x1c0dcd[_0x20e9('0x17')]?_0x1c0dcd[_0x20e9('0x17')][_0x20e9('0x23')]||null:null})[_0x20e9('0x1c')](function(_0x3fad3d){logger[_0x20e9('0xb')](_0x20e9('0x1f'),_0x1c0dcd);logger[_0x20e9('0x1d')]('UpdateCmHopperBlack',_0x1c0dcd,JSON['stringify'](_0x3fad3d));_0x24ba4d(_0x3fad3d);})[_0x20e9('0x13')](function(_0x3acdb0){logger[_0x20e9('0xe')](_0x20e9('0x1f'),_0x3acdb0[_0x20e9('0x11')],_0x1c0dcd);_0x22fdbc(_0x57b706[_0x20e9('0xe')](0x1f4,_0x3acdb0[_0x20e9('0x11')]));});});};exports[_0x20e9('0x24')]=function(_0x544d82){var _0x289ea6=this;return new Promise(function(_0xa2a158,_0x4225f4){return db[_0x20e9('0x14')][_0x20e9('0x25')]({'where':_0x544d82[_0x20e9('0x17')]?_0x544d82['options'][_0x20e9('0x22')]||null:null})[_0x20e9('0x1c')](function(_0x5cb69d){logger[_0x20e9('0xb')](_0x20e9('0x24'),_0x544d82);logger[_0x20e9('0x1d')]('DestroyCmHopperBlack',_0x544d82,JSON[_0x20e9('0xd')](_0x5cb69d));_0xa2a158(_0x5cb69d);})[_0x20e9('0x13')](function(_0x106730){logger[_0x20e9('0xe')](_0x20e9('0x24'),_0x106730['message'],_0x544d82);_0x4225f4(_0x289ea6['error'](0x1f4,_0x106730['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1321829..28b3abc 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 _0x3c6c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','put','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x9fd2b3,_0x4b5fe8){var _0x45b38f=function(_0x269e0c){while(--_0x269e0c){_0x9fd2b3['push'](_0x9fd2b3['shift']());}};_0x45b38f(++_0x4b5fe8);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x9ec74c,_0x2b8cba){_0x9ec74c=_0x9ec74c-0x0;var _0x2bdc0e=_0x3c6c[_0x9ec74c];return _0x2bdc0e;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var fs_extra=require(_0xc3c6('0x5'));var auth=require(_0xc3c6('0x6'));var interaction=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var controller=require('./cmHopperBlack.controller');router[_0xc3c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller['show']);router[_0xc3c6('0xd')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xe')]);router['delete'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6050=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','describe','get'];(function(_0x1cfe83,_0x5ecaf3){var _0x59ff8c=function(_0x4569be){while(--_0x4569be){_0x1cfe83['push'](_0x1cfe83['shift']());}};_0x59ff8c(++_0x5ecaf3);}(_0x6050,0x196));var _0x0605=function(_0x279d6a,_0x110e0b){_0x279d6a=_0x279d6a-0x0;var _0x477e51=_0x6050[_0x279d6a];return _0x477e51;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['put'](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0x11')]);module[_0x0605('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index c388d1e..32c476f 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 _0x2e9b=['endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x1e00d4,_0x3b6de3){var _0x405890=function(_0x2ee1f3){while(--_0x2ee1f3){_0x1e00d4['push'](_0x1e00d4['shift']());}};_0x405890(++_0x3b6de3);}(_0x2e9b,0x1c7));var _0xb2e9=function(_0x25e9a9,_0x1137fb){_0x25e9a9=_0x25e9a9-0x0;var _0x1db58d=_0x2e9b[_0x25e9a9];return _0x1db58d;};'use strict';var Sequelize=require(_0xb2e9('0x0'));var moment=require(_0xb2e9('0x1'));module[_0xb2e9('0x2')]={'state':{'type':Sequelize[_0xb2e9('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xb2e9('0x4')]},'scheduledat':{'type':Sequelize[_0xb2e9('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb2e9('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xb2e9('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb2e9('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb2e9('0x4')]},'starttime':{'type':Sequelize[_0xb2e9('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb2e9('0x5')]},'droptime':{'type':Sequelize[_0xb2e9('0x5')]},'endtime':{'type':Sequelize[_0xb2e9('0x5')]},'ringtime':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb2e9('0x4')]},'campaign':{'type':Sequelize[_0xb2e9('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb2e9('0x4')]},'disposition':{'type':Sequelize[_0xb2e9('0x4')]},'secondDisposition':{'type':Sequelize[_0xb2e9('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb2e9('0x4')]},'dispositionat':{'type':Sequelize[_0xb2e9('0x5')],'set':function(_0x453318){var _0x363c59=this[_0xb2e9('0x6')](_0xb2e9('0x7'));if(_0x363c59&&_0x453318){this[_0xb2e9('0x8')](_0xb2e9('0x9'),moment(_0x453318)[_0xb2e9('0xa')](moment(_0x363c59),_0xb2e9('0xb')));}return this[_0xb2e9('0x8')](_0xb2e9('0xc'),_0x453318);}},'amd':{'type':Sequelize[_0xb2e9('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb2e9('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb2e9('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb2e9('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb2e9('0x5')]},'callback':{'type':Sequelize[_0xb2e9('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb2e9('0x5')]},'deleted':{'type':Sequelize[_0xb2e9('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb2e9('0x5')]},'recallme':{'type':Sequelize[_0xb2e9('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb2e9('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa2f=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN'];(function(_0x3714a0,_0x3775e4){var _0x430d52=function(_0xc846cb){while(--_0xc846cb){_0x3714a0['push'](_0x3714a0['shift']());}};_0x430d52(++_0x3775e4);}(_0xaa2f,0x9a));var _0xfaa2=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0xaa2f[_0x16bb0e];return _0x102b8b;};'use strict';var Sequelize=require(_0xfaa2('0x0'));var moment=require(_0xfaa2('0x1'));module[_0xfaa2('0x2')]={'state':{'type':Sequelize[_0xfaa2('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xfaa2('0x4')]},'scheduledat':{'type':Sequelize[_0xfaa2('0x5')]},'countbusyretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfaa2('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xfaa2('0x4')]},'originatecalleridname':{'type':Sequelize[_0xfaa2('0x4')]},'calleridnum':{'type':Sequelize[_0xfaa2('0x4')]},'calleridname':{'type':Sequelize[_0xfaa2('0x4')]},'starttime':{'type':Sequelize[_0xfaa2('0x5')]},'responsetime':{'type':Sequelize[_0xfaa2('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xfaa2('0x5')]},'endtime':{'type':Sequelize[_0xfaa2('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfaa2('0x4')]},'campaign':{'type':Sequelize[_0xfaa2('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfaa2('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xfaa2('0x4')]},'thirdDisposition':{'type':Sequelize[_0xfaa2('0x4')]},'dispositionat':{'type':Sequelize[_0xfaa2('0x5')],'set':function(_0x41161d){var _0x3e7485=this[_0xfaa2('0x6')](_0xfaa2('0x7'));if(_0x3e7485&&_0x41161d){this[_0xfaa2('0x8')](_0xfaa2('0x9'),moment(_0x41161d)[_0xfaa2('0xa')](moment(_0x3e7485),_0xfaa2('0xb')));}return this[_0xfaa2('0x8')](_0xfaa2('0xc'),_0x41161d);}},'amd':{'type':Sequelize[_0xfaa2('0xd')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xfaa2('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xfaa2('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xfaa2('0x5')]},'callback':{'type':Sequelize[_0xfaa2('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfaa2('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xfaa2('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfaa2('0x5')]},'recallme':{'type':Sequelize[_0xfaa2('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xfaa2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfaa2('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 305396e..1ab5c35 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 _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x326f,0xd1));var _0xf326=function(_0x1f6e2f,_0x16b130){_0x1f6e2f=_0x1f6e2f-0x0;var _0x2b4f47=_0x326f[_0x1f6e2f];return _0x2b4f47;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file +var _0x4819=['send','map','CmHopperFinal','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../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','set','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x335515,_0x44f24e){var _0xb92b84=function(_0x2fda54){while(--_0x2fda54){_0x335515['push'](_0x335515['shift']());}};_0xb92b84(++_0x44f24e);}(_0x4819,0xcd));var _0x9481=function(_0x5cbab1,_0x32afac){_0x5cbab1=_0x5cbab1-0x0;var _0x2637f4=_0x4819[_0x5cbab1];return _0x2637f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':!![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['CmHopperFinal']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['describe']=function(_0xd36133,_0x5d3a06){return db['CmHopperFinal'][_0x9481('0x43')]()['then'](respondWithResult(_0x5d3a06,null))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports[_0x9481('0x24')]=function(_0x47f8b2,_0x277e2a){if(_0x47f8b2[_0x9481('0x44')][_0x9481('0x45')]){delete _0x47f8b2[_0x9481('0x44')][_0x9481('0x45')];}return db[_0x9481('0x2b')]['find']({'where':{'uniqueid':_0x47f8b2['params']['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x277e2a,null))[_0x9481('0x25')](saveUpdates(_0x47f8b2[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x277e2a,null))[_0x9481('0x3f')](handleError(_0x277e2a,null));};exports[_0x9481('0x46')]=function(_0x1c070c,_0x3d2250,_0x580273){return db[_0x9481('0x2b')][_0x9481('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x1c070c[_0x9481('0x48')]['id']},'attributes':[[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x9481('0x4b')](_0x9481('0x4c')))),_0x9481('0x4d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db[_0x9481('0x49')]['literal'](_0x9481('0x4e')))),_0x9481('0x4f')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x9481('0x50')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x51')))),_0x9481('0x52')],[db['sequelize']['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x53')))),_0x9481('0x54')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x9481('0x55')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x56')))),_0x9481('0x57')]]})[_0x9481('0x25')](handleEntityNotFound(_0x3d2250,null))['then'](respondWithResult(_0x3d2250,null))['catch'](handleError(_0x3d2250,null));};exports[_0x9481('0x58')]=function(_0x3cbab5,_0xb58b67,_0xe008db){return db[_0x9481('0x2b')][_0x9481('0x47')]({'raw':![],'where':{'CampaignId':_0x3cbab5['params']['id']},'attributes':[[db['sequelize']['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db[_0x9481('0x49')]['literal'](_0x9481('0x4c')))),_0x9481('0x4d')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db['sequelize']['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x4e')))),'busyContacts'],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x9481('0x50')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x51')))),_0x9481('0x52')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x53')))),_0x9481('0x54')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9481('0x55')],[db['sequelize']['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x9481('0x57')]]})[_0x9481('0x25')](handleEntityNotFound(_0xb58b67,null))[_0x9481('0x25')](respondWithResult(_0xb58b67,null))[_0x9481('0x3f')](handleError(_0xb58b67,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0xa83176,_0x265f1c,_0x2a053a){return db[_0x9481('0x59')]['find']({'where':{'id':_0xa83176['params']['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x265f1c,null))[_0x9481('0x25')](function(_0x193992){var _0x380f2a;if(_0x193992){_0x380f2a=squel[_0x9481('0x5a')]()['into'](_0x9481('0x5b'))[_0x9481('0x5c')]([_0x9481('0x5d'),_0x9481('0x5e'),_0x9481('0x5f'),_0x9481('0x60'),_0x9481('0x61'),_0x9481('0x62'),_0x9481('0x63')],squel[_0x9481('0x64')]()[_0x9481('0x65')](_0x9481('0x66'),_0x9481('0x5d'))[_0x9481('0x65')](_0x9481('0x67'),'scheduledAt')[_0x9481('0x65')](_0x9481('0x68'),_0x9481('0x5f'))[_0x9481('0x65')](_0x9481('0x69'),_0x9481('0x60'))[_0x9481('0x65')]('ANY_VALUE(VoiceQueueId)',_0x9481('0x61'))[_0x9481('0x65')]('NOW()','createdAt')[_0x9481('0x65')]('NOW()','updatedAt')[_0x9481('0x6a')]('cm_hopper_final')[_0x9481('0x38')](_0x9481('0x6b'),_0xa83176[_0x9481('0x48')]['id'][_0x9481('0x6c')]())['where'](_0x9481('0x6d'),_0xa83176['body'][_0x9481('0x6e')][_0x9481('0x6c')]())[_0x9481('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9481('0x64')]()['field']('phone')[_0x9481('0x6a')](_0x9481('0x5b'))[_0x9481('0x38')]('VoiceQueueId\x20=\x20?',_0xa83176[_0x9481('0x48')]['id'][_0x9481('0x6c')]()))['where'](_0x9481('0x6f'),squel[_0x9481('0x64')]()[_0x9481('0x65')](_0x9481('0x70'))['from'](_0x9481('0x71'))['where'](_0x9481('0x6b'),_0xa83176[_0x9481('0x48')]['id']['toString']())[_0x9481('0x38')](_0x9481('0x72')))[_0x9481('0x73')]('ContactId'))['toString']();return db[_0x9481('0x49')]['query'](_0x380f2a);}return[];})[_0x9481('0x25')](respondWithResult(_0x265f1c,null))[_0x9481('0x3f')](handleError(_0x265f1c,null));};exports[_0x9481('0x74')]=function(_0x55b428,_0x3f74f1,_0x287d06){return db[_0x9481('0x75')]['find']({'where':{'id':_0x55b428[_0x9481('0x48')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x3f74f1,null))[_0x9481('0x25')](function(_0x32b30f){var _0x347da1;if(_0x32b30f){_0x347da1=squel[_0x9481('0x5a')]()[_0x9481('0x76')](_0x9481('0x5b'))[_0x9481('0x5c')]([_0x9481('0x5d'),'scheduledAt',_0x9481('0x5f'),'ListId','CampaignId','createdAt',_0x9481('0x63')],squel[_0x9481('0x64')]()[_0x9481('0x65')](_0x9481('0x66'),_0x9481('0x5d'))['field'](_0x9481('0x67'),_0x9481('0x5e'))[_0x9481('0x65')](_0x9481('0x68'),_0x9481('0x5f'))[_0x9481('0x65')](_0x9481('0x69'),_0x9481('0x60'))[_0x9481('0x65')](_0x9481('0x77'),'CampaignId')[_0x9481('0x65')](_0x9481('0x67'),_0x9481('0x62'))[_0x9481('0x65')](_0x9481('0x67'),_0x9481('0x63'))[_0x9481('0x6a')](_0x9481('0x71'))[_0x9481('0x38')](_0x9481('0x78'),_0x55b428['params']['id'][_0x9481('0x6c')]())[_0x9481('0x38')](_0x9481('0x6d'),_0x55b428[_0x9481('0x44')][_0x9481('0x6e')][_0x9481('0x6c')]())[_0x9481('0x38')](_0x9481('0x79'))[_0x9481('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9481('0x64')]()['field']('phone')[_0x9481('0x6a')](_0x9481('0x5b'))[_0x9481('0x38')](_0x9481('0x78'),_0x55b428[_0x9481('0x48')]['id'][_0x9481('0x6c')]()))['where'](_0x9481('0x6f'),squel['select']()[_0x9481('0x65')](_0x9481('0x70'))[_0x9481('0x6a')]('cm_hopper_final')['where'](_0x9481('0x78'),_0x55b428[_0x9481('0x48')]['id'][_0x9481('0x6c')]())[_0x9481('0x38')](_0x9481('0x72')))[_0x9481('0x73')](_0x9481('0x5f')))[_0x9481('0x6c')]();return db[_0x9481('0x49')]['query'](_0x347da1);}return[];})[_0x9481('0x25')](respondWithResult(_0x3f74f1,null))[_0x9481('0x3f')](handleError(_0x3f74f1,null));};exports['checkContactHopper']=function(_0x2c53df,_0x534979,_0x616b77){return db[_0x9481('0x7a')]['findOne']({'where':{'VoiceQueueId':_0x2c53df[_0x9481('0x44')][_0x9481('0x61')],'CampaignId':_0x2c53df[_0x9481('0x44')]['CampaignId'],'ContactId':_0x2c53df[_0x9481('0x44')][_0x9481('0x5f')]}})['then'](handleEntityNotFound(_0x534979,null))[_0x9481('0x25')](function(_0x5c7602){if(_0x5c7602){return _0x5c7602;}return null;})[_0x9481('0x25')](respondWithResult(_0x534979,null))[_0x9481('0x3f')](handleError(_0x534979,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 800386b..267a9fd 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 _0x755b=['request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3e064e,_0x18cfa4){var _0x470514=function(_0x241a24){while(--_0x241a24){_0x3e064e['push'](_0x3e064e['shift']());}};_0x470514(++_0x18cfa4);}(_0x755b,0xdb));var _0xb755=function(_0xaa0262,_0x100940){_0xaa0262=_0xaa0262-0x0;var _0x56560b=_0x755b[_0xaa0262];return _0x56560b;};'use strict';var _=require(_0xb755('0x0'));var util=require('util');var logger=require(_0xb755('0x1'))(_0xb755('0x2'));var moment=require(_0xb755('0x3'));var BPromise=require(_0xb755('0x4'));var rp=require(_0xb755('0x5'));var fs=require('fs');var path=require(_0xb755('0x6'));var rimraf=require(_0xb755('0x7'));var config=require(_0xb755('0x8'));var attributes=require(_0xb755('0x9'));module['exports']=function(_0x2a0ba2,_0x2b90ea){return _0x2a0ba2[_0xb755('0xa')]('CmHopperFinal',attributes,{'tableName':_0xb755('0xb'),'paranoid':![],'indexes':[{'name':_0xb755('0xc'),'fields':[_0xb755('0xc')]},{'name':'uniqueid','fields':[_0xb755('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb532=['cm_hopper_final','calleridnum','uniqueid','util','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb532,0x85));var _0x2b53=function(_0x340f77,_0x8d1b86){_0x340f77=_0x340f77-0x0;var _0x5e82a0=_0xb532[_0x340f77];return _0x5e82a0;};'use strict';var _=require('lodash');var util=require(_0x2b53('0x0'));var logger=require('../../config/logger')(_0x2b53('0x1'));var moment=require(_0x2b53('0x2'));var BPromise=require('bluebird');var rp=require(_0x2b53('0x3'));var fs=require('fs');var path=require(_0x2b53('0x4'));var rimraf=require(_0x2b53('0x5'));var config=require(_0x2b53('0x6'));var attributes=require(_0x2b53('0x7'));module['exports']=function(_0x25a399,_0x4447ce){return _0x25a399[_0x2b53('0x8')](_0x2b53('0x9'),attributes,{'tableName':_0x2b53('0xa'),'paranoid':![],'indexes':[{'name':_0x2b53('0xb'),'fields':[_0x2b53('0xb')]},{'name':_0x2b53('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index ac570a3..66a9684 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(_0x50dd6a,_0x4b4c68){var _0x4b6266=function(_0x3c7941){while(--_0x3c7941){_0x50dd6a['push'](_0x50dd6a['shift']());}};_0x4b6266(++_0x4b4c68);}(_0x7a54,0x106));var _0x47a5=function(_0x43220c,_0x1660ed){_0x43220c=_0x43220c-0x0;var _0x16b8aa=_0x7a54[_0x43220c];return _0x16b8aa;};'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(_0x5774ed,_0x160f33){var _0x4cc86b=function(_0x1c5af6){while(--_0x1c5af6){_0x5774ed['push'](_0x5774ed['shift']());}};_0x4cc86b(++_0x160f33);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a2ed5,_0x255d82){_0x1a2ed5=_0x1a2ed5-0x0;var _0x5c9cc1=_0xb10b[_0x1a2ed5];return _0x5c9cc1;};'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 1a2d9ad..cf46505 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 _0xd472=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','multer','util','path'];(function(_0x444210,_0x161320){var _0xdcbe20=function(_0x56806b){while(--_0x56806b){_0x444210['push'](_0x444210['shift']());}};_0xdcbe20(++_0x161320);}(_0xd472,0x1eb));var _0x2d47=function(_0x1e78e1,_0x37811b){_0x1e78e1=_0x1e78e1-0x0;var _0x42efe7=_0xd472[_0x1e78e1];return _0x42efe7;};'use strict';var multer=require(_0x2d47('0x0'));var util=require(_0x2d47('0x1'));var path=require(_0x2d47('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d47('0x3'));var router=express[_0x2d47('0x4')]();var fs_extra=require(_0x2d47('0x5'));var auth=require(_0x2d47('0x6'));var interaction=require(_0x2d47('0x7'));var config=require(_0x2d47('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x2d47('0x9')](),controller[_0x2d47('0xa')]);router[_0x2d47('0xb')](_0x2d47('0xc'),auth[_0x2d47('0x9')](),controller['describe']);router[_0x2d47('0xb')](_0x2d47('0xd'),auth[_0x2d47('0x9')](),controller['show']);router['get'](_0x2d47('0xe'),auth[_0x2d47('0x9')](),controller[_0x2d47('0xf')]);router[_0x2d47('0xb')]('/campaign/countAttributes/:id',auth[_0x2d47('0x9')](),controller[_0x2d47('0x10')]);router[_0x2d47('0x11')](_0x2d47('0x12'),auth[_0x2d47('0x9')](),controller[_0x2d47('0x13')]);router[_0x2d47('0x11')](_0x2d47('0x14'),auth[_0x2d47('0x9')](),controller[_0x2d47('0x15')]);router[_0x2d47('0x11')](_0x2d47('0x16'),auth[_0x2d47('0x9')](),controller[_0x2d47('0x17')]);router['put']('/:id',auth[_0x2d47('0x9')](),controller[_0x2d47('0x18')]);module[_0x2d47('0x19')]=router; \ No newline at end of file +var _0x19e7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','describe','/:id','isAuthenticated','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports'];(function(_0x49ce37,_0x16d953){var _0x325be1=function(_0x29613d){while(--_0x29613d){_0x49ce37['push'](_0x49ce37['shift']());}};_0x325be1(++_0x16d953);}(_0x19e7,0xc8));var _0x719e=function(_0x3a0cb9,_0xf1c42){_0x3a0cb9=_0x3a0cb9-0x0;var _0x54df0e=_0x19e7[_0x3a0cb9];return _0x54df0e;};'use strict';var multer=require(_0x719e('0x0'));var util=require(_0x719e('0x1'));var path=require(_0x719e('0x2'));var timeout=require(_0x719e('0x3'));var express=require(_0x719e('0x4'));var router=express[_0x719e('0x5')]();var fs_extra=require(_0x719e('0x6'));var auth=require(_0x719e('0x7'));var interaction=require(_0x719e('0x8'));var config=require(_0x719e('0x9'));var controller=require(_0x719e('0xa'));router[_0x719e('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x719e('0xb')](_0x719e('0xc'),auth['isAuthenticated'](),controller[_0x719e('0xd')]);router['get'](_0x719e('0xe'),auth[_0x719e('0xf')](),controller[_0x719e('0x10')]);router[_0x719e('0xb')]('/voice/queue/countAttributes/:id',auth[_0x719e('0xf')](),controller[_0x719e('0x11')]);router['get']('/campaign/countAttributes/:id',auth[_0x719e('0xf')](),controller[_0x719e('0x12')]);router['post']('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x719e('0x13')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x719e('0x14')]);router[_0x719e('0x13')](_0x719e('0x15'),auth[_0x719e('0xf')](),controller[_0x719e('0x16')]);router['put'](_0x719e('0xe'),auth['isAuthenticated'](),controller[_0x719e('0x17')]);module[_0x719e('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 204e3be..370f36a 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 _0x938c=['DATE','BOOLEAN','exports','INTEGER','STRING'];(function(_0xd8b3cc,_0x1f1ad5){var _0x3c8c35=function(_0x2c3763){while(--_0x2c3763){_0xd8b3cc['push'](_0xd8b3cc['shift']());}};_0x3c8c35(++_0x1f1ad5);}(_0x938c,0xca));var _0xc938=function(_0x34bd6d,_0x561142){_0x34bd6d=_0x34bd6d-0x0;var _0x4ec383=_0x938c[_0x34bd6d];return _0x4ec383;};'use strict';var Sequelize=require('sequelize');module[_0xc938('0x0')]={'state':{'type':Sequelize[_0xc938('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc938('0x2')]},'scheduledat':{'type':Sequelize[_0xc938('0x3')]},'countbusyretry':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc938('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc938('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc938('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc938('0x2')]},'starttime':{'type':Sequelize[_0xc938('0x3')]},'responsetime':{'type':Sequelize[_0xc938('0x3')]},'answertime':{'type':Sequelize[_0xc938('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc938('0x3')]},'ringtime':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc938('0x2')]},'campaign':{'type':Sequelize[_0xc938('0x2')]},'campaigntype':{'type':Sequelize[_0xc938('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc938('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc938('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc938('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc938('0x3')]},'edited':{'type':Sequelize[_0xc938('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc938('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbb51=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0xbb51,0x19d));var _0x1bb5=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xbb51[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x1bb5('0x0'));module[_0x1bb5('0x1')]={'state':{'type':Sequelize[_0x1bb5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1bb5('0x3')]},'scheduledat':{'type':Sequelize[_0x1bb5('0x4')]},'countbusyretry':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1bb5('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x1bb5('0x3')]},'calleridnum':{'type':Sequelize[_0x1bb5('0x3')]},'calleridname':{'type':Sequelize[_0x1bb5('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1bb5('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x1bb5('0x4')]},'endtime':{'type':Sequelize[_0x1bb5('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1bb5('0x3')]},'campaign':{'type':Sequelize[_0x1bb5('0x3')]},'campaigntype':{'type':Sequelize[_0x1bb5('0x3')]},'membername':{'type':Sequelize[_0x1bb5('0x3')]},'reason':{'type':Sequelize[_0x1bb5('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1bb5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1bb5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1bb5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1bb5('0x4')]},'recallme':{'type':Sequelize[_0x1bb5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1bb5('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 5ec2b4a..ea21e24 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 _0x283b=['CmHopperHistory','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','then','destroy','end','error','stack','name','send','index','map'];(function(_0x47ad6e,_0x22c473){var _0x25d747=function(_0x478ac5){while(--_0x478ac5){_0x47ad6e['push'](_0x47ad6e['shift']());}};_0x25d747(++_0x22c473);}(_0x283b,0xb8));var _0xb283=function(_0x479b26,_0x624e74){_0x479b26=_0x479b26-0x0;var _0x214744=_0x283b[_0x479b26];return _0x214744;};'use strict';var emlformat=require(_0xb283('0x0'));var rimraf=require(_0xb283('0x1'));var zipdir=require(_0xb283('0x2'));var jsonpatch=require(_0xb283('0x3'));var rp=require(_0xb283('0x4'));var moment=require(_0xb283('0x5'));var BPromise=require(_0xb283('0x6'));var Mustache=require('mustache');var util=require(_0xb283('0x7'));var path=require(_0xb283('0x8'));var sox=require('sox');var csv=require(_0xb283('0x9'));var ejs=require(_0xb283('0xa'));var fs=require('fs');var fs_extra=require(_0xb283('0xb'));var _=require(_0xb283('0xc'));var squel=require(_0xb283('0xd'));var crypto=require(_0xb283('0xe'));var jsforce=require(_0xb283('0xf'));var deskjs=require(_0xb283('0x10'));var toCsv=require(_0xb283('0x9'));var querystring=require('querystring');var Papa=require(_0xb283('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb283('0x12'));var as=require(_0xb283('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb283('0x14'))(_0xb283('0x15'));var utils=require('../../config/utils');var config=require(_0xb283('0x16'));var licenseUtil=require(_0xb283('0x17'));var db=require(_0xb283('0x18'))['db'];function respondWithStatusCode(_0x497458,_0x45758a){_0x45758a=_0x45758a||0xcc;return function(_0x27d544){if(_0x27d544){return _0x497458[_0xb283('0x19')](_0x45758a);}return _0x497458[_0xb283('0x1a')](_0x45758a)['end']();};}function respondWithResult(_0x836599,_0x11d37e){_0x11d37e=_0x11d37e||0xc8;return function(_0x533637){if(_0x533637){return _0x836599[_0xb283('0x1a')](_0x11d37e)[_0xb283('0x1b')](_0x533637);}};}function respondWithFilteredResult(_0x55b8c7,_0x4a9eaf){return function(_0x96b834){if(_0x96b834){var _0x2c5e0e=typeof _0x4a9eaf['offset']===_0xb283('0x1c')&&typeof _0x4a9eaf[_0xb283('0x1d')]==='undefined';var _0x35ffac=_0x96b834[_0xb283('0x1e')];var _0x508e6c=_0x2c5e0e?0x0:_0x4a9eaf[_0xb283('0x1f')];var _0x4bfca5=_0x2c5e0e?_0x96b834[_0xb283('0x1e')]:_0x4a9eaf[_0xb283('0x1f')]+_0x4a9eaf['limit'];var _0x5ba3b4;if(_0x4bfca5>=_0x35ffac){_0x4bfca5=_0x35ffac;_0x5ba3b4=0xc8;}else{_0x5ba3b4=0xce;}_0x55b8c7[_0xb283('0x1a')](_0x5ba3b4);return _0x55b8c7[_0xb283('0x20')]('Content-Range',_0x508e6c+'-'+_0x4bfca5+'/'+_0x35ffac)[_0xb283('0x1b')](_0x96b834);}return null;};}function patchUpdates(_0x30f2b6){return function(_0x19db5d){try{jsonpatch[_0xb283('0x21')](_0x19db5d,_0x30f2b6,!![]);}catch(_0x49fb4d){return BPromise[_0xb283('0x22')](_0x49fb4d);}return _0x19db5d['save']();};}function saveUpdates(_0x1afe44,_0x146478){return function(_0x267f93){if(_0x267f93){return _0x267f93['update'](_0x1afe44)[_0xb283('0x23')](function(_0x103387){return _0x103387;});}return null;};}function removeEntity(_0x38aa48,_0x5cd78b){return function(_0x38340a){if(_0x38340a){return _0x38340a[_0xb283('0x24')]()[_0xb283('0x23')](function(){_0x38aa48[_0xb283('0x1a')](0xcc)[_0xb283('0x25')]();});}};}function handleEntityNotFound(_0x258a44,_0x397213){return function(_0x43ca19){if(!_0x43ca19){_0x258a44[_0xb283('0x19')](0x194);}return _0x43ca19;};}function handleError(_0xa1730b,_0x5bda3a){_0x5bda3a=_0x5bda3a||0x1f4;return function(_0x3ad39b){logger[_0xb283('0x26')](_0x3ad39b[_0xb283('0x27')]);if(_0x3ad39b[_0xb283('0x28')]){delete _0x3ad39b[_0xb283('0x28')];}_0xa1730b[_0xb283('0x1a')](_0x5bda3a)[_0xb283('0x29')](_0x3ad39b);};}exports[_0xb283('0x2a')]=function(_0x3f4140,_0x3d8b34){var _0x8f1a26={},_0xb45ac8={},_0x4a8277={'count':0x0,'rows':[]};var _0x1717ab=_[_0xb283('0x2b')](db[_0xb283('0x2c')][_0xb283('0x2d')],function(_0x4798e2){return{'name':_0x4798e2[_0xb283('0x2e')],'type':_0x4798e2['type'][_0xb283('0x2f')]};});_0xb45ac8['model']=_['map'](_0x1717ab,_0xb283('0x28'));_0xb45ac8[_0xb283('0x30')]=_[_0xb283('0x31')](_0x3f4140[_0xb283('0x30')]);_0xb45ac8[_0xb283('0x32')]=_[_0xb283('0x33')](_0xb45ac8[_0xb283('0x34')],_0xb45ac8[_0xb283('0x30')]);_0x8f1a26['attributes']=_['intersection'](_0xb45ac8['model'],qs[_0xb283('0x35')](_0x3f4140['query'][_0xb283('0x35')]));_0x8f1a26[_0xb283('0x36')]=_0x8f1a26[_0xb283('0x36')][_0xb283('0x37')]?_0x8f1a26[_0xb283('0x36')]:_0xb45ac8[_0xb283('0x34')];if(!_0x3f4140['query']['hasOwnProperty']('nolimit')){_0x8f1a26[_0xb283('0x1d')]=qs[_0xb283('0x1d')](_0x3f4140[_0xb283('0x30')][_0xb283('0x1d')]);_0x8f1a26[_0xb283('0x1f')]=qs[_0xb283('0x1f')](_0x3f4140[_0xb283('0x30')][_0xb283('0x1f')]);}_0x8f1a26[_0xb283('0x38')]=qs[_0xb283('0x39')](_0x3f4140['query'][_0xb283('0x39')]);_0x8f1a26[_0xb283('0x3a')]=qs[_0xb283('0x32')](_[_0xb283('0x3b')](_0x3f4140[_0xb283('0x30')],_0xb45ac8[_0xb283('0x32')]),_0x1717ab);if(_0x3f4140['query'][_0xb283('0x3c')]){_0x8f1a26[_0xb283('0x3a')]=_['merge'](_0x8f1a26[_0xb283('0x3a')],{'$or':_[_0xb283('0x2b')](_0x1717ab,function(_0x27c9d7){if(_0x27c9d7['type']!==_0xb283('0x3d')){var _0xc657cc={};_0xc657cc[_0x27c9d7['name']]={'$like':'%'+_0x3f4140[_0xb283('0x30')][_0xb283('0x3c')]+'%'};return _0xc657cc;}})});}_0x8f1a26=_[_0xb283('0x3e')]({},_0x8f1a26,_0x3f4140[_0xb283('0x3f')]);var _0x37a891={'where':_0x8f1a26[_0xb283('0x3a')]};return db[_0xb283('0x2c')][_0xb283('0x1e')](_0x37a891)[_0xb283('0x23')](function(_0x541e45){_0x4a8277[_0xb283('0x1e')]=_0x541e45;if(_0x3f4140['query'][_0xb283('0x40')]){_0x8f1a26[_0xb283('0x41')]=[{'all':!![]}];}return db[_0xb283('0x2c')][_0xb283('0x42')](_0x8f1a26);})[_0xb283('0x23')](function(_0x365668){_0x4a8277['rows']=_0x365668;return _0x4a8277;})[_0xb283('0x23')](respondWithFilteredResult(_0x3d8b34,_0x8f1a26))['catch'](handleError(_0x3d8b34,null));};exports[_0xb283('0x43')]=function(_0x458998,_0xf1cbc){var _0x24c081={'raw':!![],'where':{'id':_0x458998[_0xb283('0x44')]['id']}},_0x5bcb59={};_0x5bcb59['model']=_['keys'](db[_0xb283('0x2c')][_0xb283('0x2d')]);_0x5bcb59[_0xb283('0x30')]=_[_0xb283('0x31')](_0x458998[_0xb283('0x30')]);_0x5bcb59[_0xb283('0x32')]=_[_0xb283('0x33')](_0x5bcb59[_0xb283('0x34')],_0x5bcb59[_0xb283('0x30')]);_0x24c081[_0xb283('0x36')]=_[_0xb283('0x33')](_0x5bcb59[_0xb283('0x34')],qs[_0xb283('0x35')](_0x458998[_0xb283('0x30')]['fields']));_0x24c081[_0xb283('0x36')]=_0x24c081['attributes'][_0xb283('0x37')]?_0x24c081['attributes']:_0x5bcb59[_0xb283('0x34')];if(_0x458998[_0xb283('0x30')][_0xb283('0x40')]){_0x24c081[_0xb283('0x41')]=[{'all':!![]}];}_0x24c081=_[_0xb283('0x3e')]({},_0x24c081,_0x458998[_0xb283('0x3f')]);return db[_0xb283('0x2c')][_0xb283('0x45')](_0x24c081)[_0xb283('0x23')](handleEntityNotFound(_0xf1cbc,null))[_0xb283('0x23')](respondWithResult(_0xf1cbc,null))[_0xb283('0x46')](handleError(_0xf1cbc,null));};exports['create']=function(_0x1f351f,_0x1dd416){return db['CmHopperHistory'][_0xb283('0x47')](_0x1f351f[_0xb283('0x48')],{})[_0xb283('0x23')](respondWithResult(_0x1dd416,0xc9))[_0xb283('0x46')](handleError(_0x1dd416,null));};exports[_0xb283('0x49')]=function(_0x1de769,_0x271f8f){return db[_0xb283('0x2c')]['describe']()[_0xb283('0x23')](respondWithResult(_0x271f8f,null))['catch'](handleError(_0x271f8f,null));};exports[_0xb283('0x4a')]=function(_0x2d5352,_0x7b82a5){if(_0x2d5352[_0xb283('0x48')][_0xb283('0x4b')]){delete _0x2d5352[_0xb283('0x48')]['uniqueid'];}return db[_0xb283('0x2c')]['find']({'where':{'uniqueid':_0x2d5352['params']['id']}})['then'](handleEntityNotFound(_0x7b82a5,null))[_0xb283('0x23')](saveUpdates(_0x2d5352[_0xb283('0x48')],null))[_0xb283('0x23')](respondWithResult(_0x7b82a5,null))['catch'](handleError(_0x7b82a5,null));}; \ No newline at end of file +var _0x130d=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','keys','includeAll','options','find','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','type'];(function(_0x42091d,_0xc73ea){var _0x1592b9=function(_0x548119){while(--_0x548119){_0x42091d['push'](_0x42091d['shift']());}};_0x1592b9(++_0xc73ea);}(_0x130d,0x1ca));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd130('0x0'));var zipdir=require(_0xd130('0x1'));var jsonpatch=require(_0xd130('0x2'));var rp=require('request-promise');var moment=require(_0xd130('0x3'));var BPromise=require(_0xd130('0x4'));var Mustache=require(_0xd130('0x5'));var util=require(_0xd130('0x6'));var path=require(_0xd130('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd130('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd130('0x9'));var crypto=require(_0xd130('0xa'));var jsforce=require(_0xd130('0xb'));var deskjs=require(_0xd130('0xc'));var toCsv=require(_0xd130('0xd'));var querystring=require(_0xd130('0xe'));var Papa=require(_0xd130('0xf'));var Redis=require(_0xd130('0x10'));var authService=require(_0xd130('0x11'));var qs=require(_0xd130('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd130('0x13'));var logger=require(_0xd130('0x14'))('api');var utils=require(_0xd130('0x15'));var config=require(_0xd130('0x16'));var licenseUtil=require(_0xd130('0x17'));var db=require(_0xd130('0x18'))['db'];function respondWithStatusCode(_0x961dd7,_0x2f2db4){_0x2f2db4=_0x2f2db4||0xcc;return function(_0x373f53){if(_0x373f53){return _0x961dd7[_0xd130('0x19')](_0x2f2db4);}return _0x961dd7[_0xd130('0x1a')](_0x2f2db4)['end']();};}function respondWithResult(_0x16685e,_0x18bd89){_0x18bd89=_0x18bd89||0xc8;return function(_0x3d158d){if(_0x3d158d){return _0x16685e[_0xd130('0x1a')](_0x18bd89)[_0xd130('0x1b')](_0x3d158d);}};}function respondWithFilteredResult(_0x84636d,_0x585bd0){return function(_0x55f755){if(_0x55f755){var _0x3e48=typeof _0x585bd0[_0xd130('0x1c')]===_0xd130('0x1d')&&typeof _0x585bd0[_0xd130('0x1e')]===_0xd130('0x1d');var _0x122843=_0x55f755['count'];var _0x14be96=_0x3e48?0x0:_0x585bd0[_0xd130('0x1c')];var _0x55cfc8=_0x3e48?_0x55f755[_0xd130('0x1f')]:_0x585bd0[_0xd130('0x1c')]+_0x585bd0[_0xd130('0x1e')];var _0x3fb3c2;if(_0x55cfc8>=_0x122843){_0x55cfc8=_0x122843;_0x3fb3c2=0xc8;}else{_0x3fb3c2=0xce;}_0x84636d['status'](_0x3fb3c2);return _0x84636d['set'](_0xd130('0x20'),_0x14be96+'-'+_0x55cfc8+'/'+_0x122843)[_0xd130('0x1b')](_0x55f755);}return null;};}function patchUpdates(_0x5d5353){return function(_0x149006){try{jsonpatch[_0xd130('0x21')](_0x149006,_0x5d5353,!![]);}catch(_0x5d4500){return BPromise['reject'](_0x5d4500);}return _0x149006[_0xd130('0x22')]();};}function saveUpdates(_0x1014f3,_0x3364d6){return function(_0x3b8d3e){if(_0x3b8d3e){return _0x3b8d3e['update'](_0x1014f3)['then'](function(_0x59747){return _0x59747;});}return null;};}function removeEntity(_0x47b924,_0x1b4142){return function(_0x1b28db){if(_0x1b28db){return _0x1b28db[_0xd130('0x23')]()[_0xd130('0x24')](function(){_0x47b924['status'](0xcc)[_0xd130('0x25')]();});}};}function handleEntityNotFound(_0x397383,_0x1a5d29){return function(_0x481dcc){if(!_0x481dcc){_0x397383[_0xd130('0x19')](0x194);}return _0x481dcc;};}function handleError(_0x2f9559,_0x375929){_0x375929=_0x375929||0x1f4;return function(_0x1c8349){logger[_0xd130('0x26')](_0x1c8349[_0xd130('0x27')]);if(_0x1c8349['name']){delete _0x1c8349[_0xd130('0x28')];}_0x2f9559['status'](_0x375929)['send'](_0x1c8349);};}exports[_0xd130('0x29')]=function(_0x59ef4d,_0x3ecf9f){var _0x5b9b38={},_0x254cbc={},_0x4015bb={'count':0x0,'rows':[]};var _0x264d0c=_[_0xd130('0x2a')](db[_0xd130('0x2b')][_0xd130('0x2c')],function(_0x50cef7){return{'name':_0x50cef7['fieldName'],'type':_0x50cef7[_0xd130('0x2d')][_0xd130('0x2e')]};});_0x254cbc[_0xd130('0x2f')]=_[_0xd130('0x2a')](_0x264d0c,'name');_0x254cbc['query']=_['keys'](_0x59ef4d[_0xd130('0x30')]);_0x254cbc[_0xd130('0x31')]=_[_0xd130('0x32')](_0x254cbc[_0xd130('0x2f')],_0x254cbc[_0xd130('0x30')]);_0x5b9b38[_0xd130('0x33')]=_['intersection'](_0x254cbc[_0xd130('0x2f')],qs['fields'](_0x59ef4d[_0xd130('0x30')][_0xd130('0x34')]));_0x5b9b38[_0xd130('0x33')]=_0x5b9b38[_0xd130('0x33')][_0xd130('0x35')]?_0x5b9b38[_0xd130('0x33')]:_0x254cbc[_0xd130('0x2f')];if(!_0x59ef4d['query'][_0xd130('0x36')](_0xd130('0x37'))){_0x5b9b38[_0xd130('0x1e')]=qs[_0xd130('0x1e')](_0x59ef4d[_0xd130('0x30')][_0xd130('0x1e')]);_0x5b9b38[_0xd130('0x1c')]=qs[_0xd130('0x1c')](_0x59ef4d[_0xd130('0x30')][_0xd130('0x1c')]);}_0x5b9b38['order']=qs[_0xd130('0x38')](_0x59ef4d[_0xd130('0x30')][_0xd130('0x38')]);_0x5b9b38[_0xd130('0x39')]=qs[_0xd130('0x31')](_['pick'](_0x59ef4d[_0xd130('0x30')],_0x254cbc['filters']),_0x264d0c);if(_0x59ef4d[_0xd130('0x30')][_0xd130('0x3a')]){_0x5b9b38['where']=_[_0xd130('0x3b')](_0x5b9b38[_0xd130('0x39')],{'$or':_['map'](_0x264d0c,function(_0x232f30){if(_0x232f30[_0xd130('0x2d')]!==_0xd130('0x3c')){var _0x1eee1f={};_0x1eee1f[_0x232f30[_0xd130('0x28')]]={'$like':'%'+_0x59ef4d[_0xd130('0x30')][_0xd130('0x3a')]+'%'};return _0x1eee1f;}})});}_0x5b9b38=_[_0xd130('0x3b')]({},_0x5b9b38,_0x59ef4d['options']);var _0x6e89f6={'where':_0x5b9b38[_0xd130('0x39')]};return db[_0xd130('0x2b')][_0xd130('0x1f')](_0x6e89f6)[_0xd130('0x24')](function(_0x4ba7b4){_0x4015bb['count']=_0x4ba7b4;if(_0x59ef4d['query']['includeAll']){_0x5b9b38[_0xd130('0x3d')]=[{'all':!![]}];}return db[_0xd130('0x2b')][_0xd130('0x3e')](_0x5b9b38);})[_0xd130('0x24')](function(_0x573133){_0x4015bb[_0xd130('0x3f')]=_0x573133;return _0x4015bb;})[_0xd130('0x24')](respondWithFilteredResult(_0x3ecf9f,_0x5b9b38))[_0xd130('0x40')](handleError(_0x3ecf9f,null));};exports[_0xd130('0x41')]=function(_0x2d04a6,_0xf373cf){var _0x3e8bcd={'raw':!![],'where':{'id':_0x2d04a6['params']['id']}},_0x283d6d={};_0x283d6d[_0xd130('0x2f')]=_[_0xd130('0x42')](db[_0xd130('0x2b')][_0xd130('0x2c')]);_0x283d6d['query']=_[_0xd130('0x42')](_0x2d04a6[_0xd130('0x30')]);_0x283d6d['filters']=_[_0xd130('0x32')](_0x283d6d[_0xd130('0x2f')],_0x283d6d[_0xd130('0x30')]);_0x3e8bcd[_0xd130('0x33')]=_[_0xd130('0x32')](_0x283d6d[_0xd130('0x2f')],qs[_0xd130('0x34')](_0x2d04a6[_0xd130('0x30')][_0xd130('0x34')]));_0x3e8bcd['attributes']=_0x3e8bcd[_0xd130('0x33')][_0xd130('0x35')]?_0x3e8bcd[_0xd130('0x33')]:_0x283d6d[_0xd130('0x2f')];if(_0x2d04a6[_0xd130('0x30')][_0xd130('0x43')]){_0x3e8bcd['include']=[{'all':!![]}];}_0x3e8bcd=_[_0xd130('0x3b')]({},_0x3e8bcd,_0x2d04a6[_0xd130('0x44')]);return db[_0xd130('0x2b')][_0xd130('0x45')](_0x3e8bcd)[_0xd130('0x24')](handleEntityNotFound(_0xf373cf,null))[_0xd130('0x24')](respondWithResult(_0xf373cf,null))[_0xd130('0x40')](handleError(_0xf373cf,null));};exports['create']=function(_0x518cb6,_0x22be0a){return db['CmHopperHistory']['create'](_0x518cb6[_0xd130('0x46')],{})['then'](respondWithResult(_0x22be0a,0xc9))['catch'](handleError(_0x22be0a,null));};exports['describe']=function(_0x262ad0,_0x4b340b){return db[_0xd130('0x2b')][_0xd130('0x47')]()[_0xd130('0x24')](respondWithResult(_0x4b340b,null))['catch'](handleError(_0x4b340b,null));};exports['update']=function(_0xfdb468,_0x3fea81){if(_0xfdb468[_0xd130('0x46')]['uniqueid']){delete _0xfdb468[_0xd130('0x46')]['uniqueid'];}return db[_0xd130('0x2b')][_0xd130('0x45')]({'where':{'uniqueid':_0xfdb468['params']['id']}})['then'](handleEntityNotFound(_0x3fea81,null))[_0xd130('0x24')](saveUpdates(_0xfdb468[_0xd130('0x46')],null))[_0xd130('0x24')](respondWithResult(_0x3fea81,null))[_0xd130('0x40')](handleError(_0x3fea81,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 571af0f..4351068 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 _0x1751=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes'];(function(_0x434ddb,_0x16f9c7){var _0x25fb09=function(_0x164940){while(--_0x164940){_0x434ddb['push'](_0x434ddb['shift']());}};_0x25fb09(++_0x16f9c7);}(_0x1751,0x76));var _0x1175=function(_0x2845d2,_0x181405){_0x2845d2=_0x2845d2-0x0;var _0x38ff31=_0x1751[_0x2845d2];return _0x38ff31;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));module[_0x1175('0xa')]=function(_0x171756,_0x3f99ca){return _0x171756[_0x1175('0xb')](_0x1175('0xc'),attributes,{'tableName':_0x1175('0xd'),'paranoid':![],'indexes':[{'name':_0x1175('0xe'),'fields':[_0x1175('0xe')]},{'name':_0x1175('0xf'),'fields':[_0x1175('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x49c1=['../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49c1,0xef));var _0x149c=function(_0x21fee6,_0x51219a){_0x21fee6=_0x21fee6-0x0;var _0x2af333=_0x49c1[_0x21fee6];return _0x2af333;};'use strict';var _=require(_0x149c('0x0'));var util=require('util');var logger=require(_0x149c('0x1'))(_0x149c('0x2'));var moment=require(_0x149c('0x3'));var BPromise=require('bluebird');var rp=require(_0x149c('0x4'));var fs=require('fs');var path=require(_0x149c('0x5'));var rimraf=require('rimraf');var config=require(_0x149c('0x6'));var attributes=require(_0x149c('0x7'));module['exports']=function(_0x46c725,_0x561d00){return _0x46c725[_0x149c('0x8')](_0x149c('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x149c('0xa'),'fields':[_0x149c('0xa')]},{'name':'uniqueid','fields':[_0x149c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index ddce53f..8aff5f4 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 _0x9c44=['outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','CmHopperHistory,\x20%s,\x20%s','info','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','findAll','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}exports[_0x49c4('0x15')]=function(_0x4c3253){var _0x512650=this;return new Promise(function(_0x3c782d,_0x2f82d5){return db[_0x49c4('0x16')]['create'](_0x4c3253[_0x49c4('0x17')],{'raw':_0x4c3253['options']?_0x4c3253[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![]})[_0x49c4('0xa')](function(_0x291526){logger[_0x49c4('0x12')](_0x49c4('0x15'),_0x4c3253);logger[_0x49c4('0xc')](_0x49c4('0x15'),_0x4c3253,JSON[_0x49c4('0xd')](_0x291526));_0x3c782d(_0x291526);})['catch'](function(_0x527126){logger['error'](_0x49c4('0x15'),_0x527126['message'],_0x4c3253);_0x2f82d5(_0x512650['error'](0x1f4,_0x527126[_0x49c4('0x10')]));});});};exports[_0x49c4('0x1a')]=function(_0x26c640){var _0xd335e4=this;return new Promise(function(_0x4811c4,_0x5850f2){return db[_0x49c4('0x16')][_0x49c4('0x1b')]({'raw':_0x26c640['options']?_0x26c640[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![],'where':_0x26c640[_0x49c4('0x18')]?_0x26c640[_0x49c4('0x18')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x49c4('0x1c'),db['sequelize'][_0x49c4('0x1d')]('id')),_0x49c4('0x1e')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db['sequelize']['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x21')))),_0x49c4('0x22')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x23')))),_0x49c4('0x24')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x25')))),_0x49c4('0x26')],[db[_0x49c4('0x1f')]['fn']('AVG',db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x27')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0x49c4('0x28'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x49c4('0xa')](function(_0x84c621){logger[_0x49c4('0x12')]('AvgHandleTime',_0x26c640);logger['debug'](_0x49c4('0x1a'),_0x26c640,JSON[_0x49c4('0xd')](_0x84c621));_0x4811c4(_0x84c621);})[_0x49c4('0x14')](function(_0x1238c0){logger[_0x49c4('0xf')](_0x49c4('0x1a'),_0x1238c0[_0x49c4('0x10')],_0x26c640);_0x5850f2(_0xd335e4[_0x49c4('0xf')](0x1f4,_0x1238c0[_0x49c4('0x10')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2d34ca){var _0x5b96df=this;return new Promise(function(_0xdda586,_0x349791){return db[_0x49c4('0x16')][_0x49c4('0x1b')]({'raw':_0x2d34ca['options']?_0x2d34ca[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![],'where':_0x2d34ca[_0x49c4('0x18')]?_0x2d34ca['options'][_0x49c4('0x2a')]||null:null,'attributes':[[_0x49c4('0x2b'),_0x49c4('0x2c')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x2d')))),_0x49c4('0x2e')],[db[_0x49c4('0x1f')]['fn']('COUNT',db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x2f')))),_0x49c4('0x30')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x21')))),_0x49c4('0x31')],[db[_0x49c4('0x1f')]['fn']('COUNT',db[_0x49c4('0x1f')]['fn']('IF',db['sequelize'][_0x49c4('0x20')](_0x49c4('0x32')))),_0x49c4('0x33')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x49c4('0x34')))),_0x49c4('0x35')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db['sequelize']['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x36')))),_0x49c4('0x37')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x49c4('0x38')],[db['sequelize']['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x39')))),'outboundUnknownCallsDay'],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x3a')))),_0x49c4('0x3b')],[db['sequelize']['fn'](_0x49c4('0x1c'),db['sequelize']['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x3c')))),_0x49c4('0x3d')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db['sequelize'][_0x49c4('0x20')](_0x49c4('0x3e')))),'outboundRejectCallsDay'],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0x49c4('0x3f')],[db['sequelize']['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x40')))),_0x49c4('0x41')],[db[_0x49c4('0x1f')]['fn']('COUNT',db[_0x49c4('0x1f')]['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')](_0x49c4('0x42')))),_0x49c4('0x43')]],'group':[_0x49c4('0x2b')]})[_0x49c4('0xa')](function(_0x25d174){logger[_0x49c4('0x12')](_0x49c4('0x44'),_0x2d34ca);logger['debug']('GetVoiceQueueHopperHistory',_0x2d34ca,JSON[_0x49c4('0xd')](_0x25d174));_0xdda586(_0x25d174);})[_0x49c4('0x14')](function(_0x527e74){logger['error'](_0x49c4('0x44'),_0x527e74['message'],_0x2d34ca);_0x349791(_0x5b96df['error'](0x1f4,_0x527e74[_0x49c4('0x10')]));});});};exports[_0x49c4('0x45')]=function(_0x4a0a93){var _0x38c480=this;return new Promise(function(_0x2884ca,_0x16949a){return db[_0x49c4('0x16')]['findAll']({'raw':_0x4a0a93[_0x49c4('0x18')]?_0x4a0a93[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![],'where':_0x4a0a93[_0x49c4('0x18')]?_0x4a0a93[_0x49c4('0x18')][_0x49c4('0x2a')]||null:null,'attributes':[['campaign','name'],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db[_0x49c4('0x1f')][_0x49c4('0x1d')]('id')),_0x49c4('0x46')],[db[_0x49c4('0x1f')]['fn'](_0x49c4('0x1c'),db['sequelize']['fn']('IF',db[_0x49c4('0x1f')][_0x49c4('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x49c4('0x47')]],'group':['campaign']})[_0x49c4('0xa')](function(_0x147ebd){logger[_0x49c4('0x12')](_0x49c4('0x45'),_0x4a0a93);logger[_0x49c4('0xc')](_0x49c4('0x45'),_0x4a0a93,JSON[_0x49c4('0xd')](_0x147ebd));_0x2884ca(_0x147ebd);})[_0x49c4('0x14')](function(_0x483770){logger[_0x49c4('0xf')](_0x49c4('0x45'),_0x483770['message'],_0x4a0a93);_0x16949a(_0x38c480[_0x49c4('0xf')](0x1f4,_0x483770[_0x49c4('0x10')]));});});}; \ No newline at end of file +var _0xebe6=['`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','create','body','options','raw','CreateCmHopperHistory','CmHopperHistory','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','where','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout'];(function(_0x1074ec,_0x1875a7){var _0xf2ef5d=function(_0x279a9e){while(--_0x279a9e){_0x1074ec['push'](_0x1074ec['shift']());}};_0xf2ef5d(++_0x1875a7);}(_0xebe6,0x13a));var _0x6ebe=function(_0x1ad992,_0x5ddc63){_0x1ad992=_0x1ad992-0x0;var _0x535234=_0xebe6[_0x1ad992];return _0x535234;};'use strict';var _=require(_0x6ebe('0x0'));var util=require(_0x6ebe('0x1'));var moment=require(_0x6ebe('0x2'));var BPromise=require(_0x6ebe('0x3'));var rs=require(_0x6ebe('0x4'));var fs=require('fs');var Redis=require(_0x6ebe('0x5'));var db=require(_0x6ebe('0x6'))['db'];var utils=require(_0x6ebe('0x7'));var logger=require(_0x6ebe('0x8'))(_0x6ebe('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6ebe('0xa')][_0x6ebe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1226b9,_0x19b9dc,_0x3f0cdd){return new BPromise(function(_0x4f8750,_0x3cd02f){return client['request'](_0x1226b9,_0x3f0cdd)[_0x6ebe('0xc')](function(_0x1b19d5){logger[_0x6ebe('0xd')](_0x6ebe('0xe'),_0x19b9dc,_0x6ebe('0xf'));logger[_0x6ebe('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x19b9dc,_0x6ebe('0xf'),JSON[_0x6ebe('0x11')](_0x1b19d5));if(_0x1b19d5[_0x6ebe('0x12')]){if(_0x1b19d5[_0x6ebe('0x12')][_0x6ebe('0x13')]===0x1f4){logger[_0x6ebe('0x12')](_0x6ebe('0xe'),_0x19b9dc,_0x1b19d5[_0x6ebe('0x12')]['message']);return _0x3cd02f(_0x1b19d5[_0x6ebe('0x12')]['message']);}logger[_0x6ebe('0x12')](_0x6ebe('0xe'),_0x19b9dc,_0x1b19d5['error'][_0x6ebe('0x14')]);return _0x4f8750(_0x1b19d5[_0x6ebe('0x12')][_0x6ebe('0x14')]);}else{logger[_0x6ebe('0xd')](_0x6ebe('0xe'),_0x19b9dc,_0x6ebe('0xf'));_0x4f8750(_0x1b19d5[_0x6ebe('0x15')][_0x6ebe('0x14')]);}})[_0x6ebe('0x16')](function(_0x53ffa7){logger['error'](_0x6ebe('0xe'),_0x19b9dc,_0x53ffa7);_0x3cd02f(_0x53ffa7);});});}exports['CreateCmHopperHistory']=function(_0x54e610){var _0x16ee38=this;return new Promise(function(_0x326583,_0x3a226e){return db['CmHopperHistory'][_0x6ebe('0x17')](_0x54e610[_0x6ebe('0x18')],{'raw':_0x54e610['options']?_0x54e610[_0x6ebe('0x19')][_0x6ebe('0x1a')]===undefined?!![]:![]:!![]})[_0x6ebe('0xc')](function(_0x50de75){logger['info'](_0x6ebe('0x1b'),_0x54e610);logger[_0x6ebe('0x10')](_0x6ebe('0x1b'),_0x54e610,JSON[_0x6ebe('0x11')](_0x50de75));_0x326583(_0x50de75);})[_0x6ebe('0x16')](function(_0x43b8ce){logger[_0x6ebe('0x12')](_0x6ebe('0x1b'),_0x43b8ce[_0x6ebe('0x14')],_0x54e610);_0x3a226e(_0x16ee38['error'](0x1f4,_0x43b8ce[_0x6ebe('0x14')]));});});};exports['AvgHandleTime']=function(_0x2c06cb){var _0x1c2b55=this;return new Promise(function(_0x5c5913,_0x2a299a){return db[_0x6ebe('0x1c')]['findAll']({'raw':_0x2c06cb[_0x6ebe('0x19')]?_0x2c06cb[_0x6ebe('0x19')][_0x6ebe('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c06cb['options']?_0x2c06cb[_0x6ebe('0x19')]['where']||null:null,'attributes':[[db[_0x6ebe('0x1d')]['fn']('COUNT',db[_0x6ebe('0x1d')][_0x6ebe('0x1e')]('id')),_0x6ebe('0x1f')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x22')))),_0x6ebe('0x23')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db['sequelize']['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0x6ebe('0x24')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x6ebe('0x25')],[db['sequelize']['fn'](_0x6ebe('0x26'),db['sequelize']['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x27')))),_0x6ebe('0x28')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x26'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x29')))),_0x6ebe('0x2a')]]})[_0x6ebe('0xc')](function(_0x11df90){logger[_0x6ebe('0xd')]('AvgHandleTime',_0x2c06cb);logger['debug'](_0x6ebe('0x2b'),_0x2c06cb,JSON[_0x6ebe('0x11')](_0x11df90));_0x5c5913(_0x11df90);})[_0x6ebe('0x16')](function(_0x136c40){logger[_0x6ebe('0x12')](_0x6ebe('0x2b'),_0x136c40[_0x6ebe('0x14')],_0x2c06cb);_0x2a299a(_0x1c2b55[_0x6ebe('0x12')](0x1f4,_0x136c40[_0x6ebe('0x14')]));});});};exports[_0x6ebe('0x2c')]=function(_0x3c2587){var _0x4e72f3=this;return new Promise(function(_0x57cfd8,_0x4cf4b8){return db[_0x6ebe('0x1c')][_0x6ebe('0x2d')]({'raw':_0x3c2587['options']?_0x3c2587[_0x6ebe('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3c2587[_0x6ebe('0x19')]?_0x3c2587[_0x6ebe('0x19')][_0x6ebe('0x2e')]||null:null,'attributes':[[_0x6ebe('0x2f'),'name'],[db['sequelize']['fn']('COUNT',db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize'][_0x6ebe('0x21')](_0x6ebe('0x30')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x31')))),_0x6ebe('0x32')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x22')))),_0x6ebe('0x33')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize'][_0x6ebe('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x6ebe('0x34')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x6ebe('0x35')],[db['sequelize']['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x36')))),_0x6ebe('0x37')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db['sequelize']['fn']('IF',db[_0x6ebe('0x1d')]['literal'](_0x6ebe('0x38')))),_0x6ebe('0x39')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize'][_0x6ebe('0x21')](_0x6ebe('0x3a')))),_0x6ebe('0x3b')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db['sequelize']['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x3c')))),_0x6ebe('0x3d')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')][_0x6ebe('0x21')](_0x6ebe('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')]['literal'](_0x6ebe('0x3f')))),_0x6ebe('0x40')],[db['sequelize']['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize'][_0x6ebe('0x21')](_0x6ebe('0x41')))),_0x6ebe('0x42')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize'][_0x6ebe('0x21')](_0x6ebe('0x43')))),_0x6ebe('0x40')],[db[_0x6ebe('0x1d')]['fn']('COUNT',db[_0x6ebe('0x1d')]['fn']('IF',db[_0x6ebe('0x1d')]['literal'](_0x6ebe('0x44')))),_0x6ebe('0x45')]],'group':[_0x6ebe('0x2f')]})[_0x6ebe('0xc')](function(_0xe3f1b1){logger[_0x6ebe('0xd')](_0x6ebe('0x2c'),_0x3c2587);logger[_0x6ebe('0x10')]('GetVoiceQueueHopperHistory',_0x3c2587,JSON['stringify'](_0xe3f1b1));_0x57cfd8(_0xe3f1b1);})['catch'](function(_0x2b6d39){logger[_0x6ebe('0x12')](_0x6ebe('0x2c'),_0x2b6d39[_0x6ebe('0x14')],_0x3c2587);_0x4cf4b8(_0x4e72f3['error'](0x1f4,_0x2b6d39['message']));});});};exports[_0x6ebe('0x46')]=function(_0x5263de){var _0x45efd6=this;return new Promise(function(_0x5cc9d8,_0x53860e){return db[_0x6ebe('0x1c')][_0x6ebe('0x2d')]({'raw':_0x5263de[_0x6ebe('0x19')]?_0x5263de['options'][_0x6ebe('0x1a')]===undefined?!![]:![]:!![],'where':_0x5263de[_0x6ebe('0x19')]?_0x5263de['options'][_0x6ebe('0x2e')]||null:null,'attributes':[['campaign',_0x6ebe('0x47')],[db[_0x6ebe('0x1d')]['fn'](_0x6ebe('0x20'),db['sequelize'][_0x6ebe('0x1e')]('id')),_0x6ebe('0x48')],[db[_0x6ebe('0x1d')]['fn']('COUNT',db[_0x6ebe('0x1d')]['fn']('IF',db['sequelize'][_0x6ebe('0x21')](_0x6ebe('0x22')))),_0x6ebe('0x49')]],'group':[_0x6ebe('0x2f')]})['then'](function(_0x44d7db){logger[_0x6ebe('0xd')](_0x6ebe('0x46'),_0x5263de);logger[_0x6ebe('0x10')](_0x6ebe('0x46'),_0x5263de,JSON['stringify'](_0x44d7db));_0x5cc9d8(_0x44d7db);})[_0x6ebe('0x16')](function(_0x444cd3){logger[_0x6ebe('0x12')](_0x6ebe('0x46'),_0x444cd3[_0x6ebe('0x14')],_0x5263de);_0x53860e(_0x45efd6[_0x6ebe('0x12')](0x1f4,_0x444cd3[_0x6ebe('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f1262fe..f32666c 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 _0x45d7=['post','create','put','update','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x274d4b,_0x128681){var _0x1a1f03=function(_0x420675){while(--_0x420675){_0x274d4b['push'](_0x274d4b['shift']());}};_0x1a1f03(++_0x128681);}(_0x45d7,0x6a));var _0x745d=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x45d7[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x745d('0x0'));var path=require(_0x745d('0x1'));var timeout=require('connect-timeout');var express=require(_0x745d('0x2'));var router=express['Router']();var fs_extra=require(_0x745d('0x3'));var auth=require(_0x745d('0x4'));var interaction=require(_0x745d('0x5'));var config=require(_0x745d('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x745d('0x7')]('/',auth['isAuthenticated'](),controller[_0x745d('0x8')]);router['get'](_0x745d('0x9'),auth[_0x745d('0xa')](),controller[_0x745d('0xb')]);router[_0x745d('0x7')](_0x745d('0xc'),auth[_0x745d('0xa')](),controller['show']);router[_0x745d('0xd')]('/',auth['isAuthenticated'](),controller[_0x745d('0xe')]);router[_0x745d('0xf')](_0x745d('0xc'),auth[_0x745d('0xa')](),controller[_0x745d('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe03c=['get','isAuthenticated','/describe','describe','/:id','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe03c,0xf2));var _0xce03=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe03c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xce03('0x0'));var util=require(_0xce03('0x1'));var path=require(_0xce03('0x2'));var timeout=require(_0xce03('0x3'));var express=require(_0xce03('0x4'));var router=express['Router']();var fs_extra=require(_0xce03('0x5'));var auth=require(_0xce03('0x6'));var interaction=require(_0xce03('0x7'));var config=require(_0xce03('0x8'));var controller=require(_0xce03('0x9'));router[_0xce03('0xa')]('/',auth[_0xce03('0xb')](),controller['index']);router['get'](_0xce03('0xc'),auth[_0xce03('0xb')](),controller[_0xce03('0xd')]);router['get'](_0xce03('0xe'),auth[_0xce03('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xce03('0xf')](_0xce03('0xe'),auth['isAuthenticated'](),controller[_0xce03('0x10')]);module[_0xce03('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 17f4394..4eaca16 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 _0x3148=['exports','name','STRING','sequelize'];(function(_0x3daf57,_0x5db19a){var _0x20ea9f=function(_0x555ccf){while(--_0x555ccf){_0x3daf57['push'](_0x3daf57['shift']());}};_0x20ea9f(++_0x5db19a);}(_0x3148,0x1d3));var _0x8314=function(_0x129d52,_0x1beadf){_0x129d52=_0x129d52-0x0;var _0x79ef89=_0x3148[_0x129d52];return _0x79ef89;};'use strict';var Sequelize=require(_0x8314('0x0'));module[_0x8314('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8314('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8314('0x3')]},'dialPrefix':{'type':Sequelize[_0x8314('0x3')]}}; \ No newline at end of file +var _0x851c=['name','sequelize','exports','STRING'];(function(_0x556d1c,_0x150ffd){var _0x21bc2b=function(_0x1dd27c){while(--_0x1dd27c){_0x556d1c['push'](_0x556d1c['shift']());}};_0x21bc2b(++_0x150ffd);}(_0x851c,0x19d));var _0xc851=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x851c[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xc851('0x0'));module[_0xc851('0x1')]={'name':{'type':Sequelize[_0xc851('0x2')],'unique':_0xc851('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc851('0x2')]},'dialPrefix':{'type':Sequelize[_0xc851('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 7b9506e..2cba2a5 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 _0x8837=['list_%d_%s.csv','Content-type','text/csv','addCustomField','transaction','CmCustomField','Sequelize','TEXT','type','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','removeAgents','userCmList:remove','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','Lists','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','CmList','includeAll','include','rows','catch','show','params','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','describe','ListId','getDispositions','findOne','Disposition','pick','findAll','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename='];(function(_0x1fa984,_0xd5100b){var _0x3efa99=function(_0x3b239a){while(--_0x3b239a){_0x1fa984['push'](_0x1fa984['shift']());}};_0x3efa99(++_0xd5100b);}(_0x8837,0x13d));var _0x7883=function(_0x4f0130,_0x50e1b6){_0x4f0130=_0x4f0130-0x0;var _0x3d2576=_0x8837[_0x4f0130];return _0x3d2576;};'use strict';var emlformat=require(_0x7883('0x0'));var rimraf=require(_0x7883('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7883('0x2'));var rp=require(_0x7883('0x3'));var moment=require(_0x7883('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7883('0x5'));var util=require('util');var path=require(_0x7883('0x6'));var sox=require('sox');var csv=require(_0x7883('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7883('0x8'));var squel=require(_0x7883('0x9'));var crypto=require(_0x7883('0xa'));var jsforce=require(_0x7883('0xb'));var deskjs=require(_0x7883('0xc'));var toCsv=require(_0x7883('0x7'));var querystring=require(_0x7883('0xd'));var Papa=require(_0x7883('0xe'));var Redis=require(_0x7883('0xf'));var authService=require(_0x7883('0x10'));var qs=require(_0x7883('0x11'));var as=require(_0x7883('0x12'));var hardwareService=require(_0x7883('0x13'));var logger=require('../../config/logger')(_0x7883('0x14'));var utils=require(_0x7883('0x15'));var config=require(_0x7883('0x16'));var licenseUtil=require(_0x7883('0x17'));var db=require('../../mysqldb')['db'];config[_0x7883('0x18')]=_[_0x7883('0x19')](config[_0x7883('0x18')],{'host':_0x7883('0x1a'),'port':0x18eb});var socket=require(_0x7883('0x1b'))(new Redis(config[_0x7883('0x18')]));require('./cmList.socket')[_0x7883('0x1c')](socket);function respondWithStatusCode(_0x2781b7,_0x2d95b4){_0x2d95b4=_0x2d95b4||0xcc;return function(_0x18877f){if(_0x18877f){return _0x2781b7[_0x7883('0x1d')](_0x2d95b4);}return _0x2781b7[_0x7883('0x1e')](_0x2d95b4)[_0x7883('0x1f')]();};}function respondWithResult(_0x6ae143,_0x3944e3){_0x3944e3=_0x3944e3||0xc8;return function(_0x213435){if(_0x213435){return _0x6ae143['status'](_0x3944e3)[_0x7883('0x20')](_0x213435);}};}function respondWithFilteredResult(_0x4b21f3,_0x19e533){return function(_0xe0b59){if(_0xe0b59){var _0x32d94f=typeof _0x19e533[_0x7883('0x21')]===_0x7883('0x22')&&typeof _0x19e533[_0x7883('0x23')]===_0x7883('0x22');var _0x36df81=_0xe0b59[_0x7883('0x24')];var _0x6573c9=_0x32d94f?0x0:_0x19e533[_0x7883('0x21')];var _0x2138da=_0x32d94f?_0xe0b59['count']:_0x19e533[_0x7883('0x21')]+_0x19e533['limit'];var _0x307c8d;if(_0x2138da>=_0x36df81){_0x2138da=_0x36df81;_0x307c8d=0xc8;}else{_0x307c8d=0xce;}_0x4b21f3[_0x7883('0x1e')](_0x307c8d);return _0x4b21f3[_0x7883('0x25')](_0x7883('0x26'),_0x6573c9+'-'+_0x2138da+'/'+_0x36df81)[_0x7883('0x20')](_0xe0b59);}return null;};}function patchUpdates(_0x35b61a){return function(_0x527b5b){try{jsonpatch[_0x7883('0x27')](_0x527b5b,_0x35b61a,!![]);}catch(_0x2dae50){return BPromise['reject'](_0x2dae50);}return _0x527b5b['save']();};}function saveUpdates(_0x58d339,_0x27ca67){return function(_0x53e1de){if(_0x53e1de){return _0x53e1de[_0x7883('0x28')](_0x58d339)[_0x7883('0x29')](function(_0x23412b){return _0x23412b;});}return null;};}function removeEntity(_0x22b4a7,_0x51164c){return function(_0x4a9417){if(_0x4a9417){return _0x4a9417['destroy']()[_0x7883('0x29')](function(){var _0x52f1e1=_0x4a9417[_0x7883('0x2a')]({'plain':!![]});var _0x291b86=_0x7883('0x2b');return db['UserProfileResource'][_0x7883('0x2c')]({'where':{'type':_0x291b86,'resourceId':_0x52f1e1['id']}})[_0x7883('0x29')](function(){return _0x4a9417;});})[_0x7883('0x29')](function(){_0x22b4a7[_0x7883('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f354,_0x5cbdff){return function(_0x3131aa){if(!_0x3131aa){_0x18f354['sendStatus'](0x194);}return _0x3131aa;};}function handleError(_0xa2f7f4,_0x507a74){_0x507a74=_0x507a74||0x1f4;return function(_0x59511e){logger['error'](_0x59511e[_0x7883('0x2d')]);if(_0x59511e[_0x7883('0x2e')]){delete _0x59511e[_0x7883('0x2e')];}_0xa2f7f4['status'](_0x507a74)[_0x7883('0x2f')](_0x59511e);};}exports['index']=function(_0x474068,_0x266955){var _0x2eca06={},_0x1e5e36={},_0xc42d6b={'count':0x0,'rows':[]};var _0x4344dc=_[_0x7883('0x30')](db['CmList'][_0x7883('0x31')],function(_0x561001){return{'name':_0x561001[_0x7883('0x32')],'type':_0x561001['type'][_0x7883('0x33')]};});_0x1e5e36[_0x7883('0x34')]=_[_0x7883('0x30')](_0x4344dc,'name');_0x1e5e36[_0x7883('0x35')]=_[_0x7883('0x36')](_0x474068[_0x7883('0x35')]);_0x1e5e36[_0x7883('0x37')]=_[_0x7883('0x38')](_0x1e5e36[_0x7883('0x34')],_0x1e5e36[_0x7883('0x35')]);_0x2eca06[_0x7883('0x39')]=_[_0x7883('0x38')](_0x1e5e36['model'],qs[_0x7883('0x3a')](_0x474068[_0x7883('0x35')][_0x7883('0x3a')]));_0x2eca06[_0x7883('0x39')]=_0x2eca06[_0x7883('0x39')][_0x7883('0x3b')]?_0x2eca06[_0x7883('0x39')]:_0x1e5e36['model'];if(!_0x474068[_0x7883('0x35')][_0x7883('0x3c')](_0x7883('0x3d'))){_0x2eca06[_0x7883('0x23')]=qs[_0x7883('0x23')](_0x474068[_0x7883('0x35')][_0x7883('0x23')]);_0x2eca06[_0x7883('0x21')]=qs['offset'](_0x474068['query'][_0x7883('0x21')]);}_0x2eca06[_0x7883('0x3e')]=qs[_0x7883('0x3f')](_0x474068['query'][_0x7883('0x3f')]);_0x2eca06['where']=qs[_0x7883('0x37')](_['pick'](_0x474068[_0x7883('0x35')],_0x1e5e36[_0x7883('0x37')]),_0x4344dc);if(_0x474068[_0x7883('0x35')][_0x7883('0x40')]){_0x2eca06[_0x7883('0x41')]=_[_0x7883('0x42')](_0x2eca06['where'],{'$or':_[_0x7883('0x30')](_0x4344dc,function(_0x3242a6){if(_0x3242a6['type']!=='VIRTUAL'){var _0x1bc39c={};_0x1bc39c[_0x3242a6[_0x7883('0x2e')]]={'$like':'%'+_0x474068[_0x7883('0x35')]['filter']+'%'};return _0x1bc39c;}})});}_0x2eca06=_[_0x7883('0x42')]({},_0x2eca06,_0x474068[_0x7883('0x43')]);var _0x208197={'where':_0x2eca06[_0x7883('0x41')]};return db[_0x7883('0x44')][_0x7883('0x24')](_0x208197)[_0x7883('0x29')](function(_0x36af37){_0xc42d6b[_0x7883('0x24')]=_0x36af37;if(_0x474068[_0x7883('0x35')][_0x7883('0x45')]){_0x2eca06[_0x7883('0x46')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x2eca06);})[_0x7883('0x29')](function(_0x412373){_0xc42d6b[_0x7883('0x47')]=_0x412373;return _0xc42d6b;})['then'](respondWithFilteredResult(_0x266955,_0x2eca06))[_0x7883('0x48')](handleError(_0x266955,null));};exports[_0x7883('0x49')]=function(_0x43a7a1,_0x539116){var _0xc1e17b={'raw':![],'where':{'id':_0x43a7a1[_0x7883('0x4a')]['id']}},_0x59a113={};_0x59a113[_0x7883('0x34')]=_[_0x7883('0x36')](db[_0x7883('0x44')][_0x7883('0x31')]);_0x59a113[_0x7883('0x35')]=_[_0x7883('0x36')](_0x43a7a1[_0x7883('0x35')]);_0x59a113[_0x7883('0x37')]=_['intersection'](_0x59a113[_0x7883('0x34')],_0x59a113['query']);_0xc1e17b[_0x7883('0x39')]=_[_0x7883('0x38')](_0x59a113[_0x7883('0x34')],qs[_0x7883('0x3a')](_0x43a7a1['query'][_0x7883('0x3a')]));_0xc1e17b[_0x7883('0x39')]=_0xc1e17b[_0x7883('0x39')][_0x7883('0x3b')]?_0xc1e17b[_0x7883('0x39')]:_0x59a113[_0x7883('0x34')];if(_0x43a7a1[_0x7883('0x35')]['includeAll']){_0xc1e17b[_0x7883('0x46')]=[{'all':!![]}];}_0xc1e17b=_['merge']({},_0xc1e17b,_0x43a7a1[_0x7883('0x43')]);return db[_0x7883('0x44')][_0x7883('0x4b')](_0xc1e17b)[_0x7883('0x29')](handleEntityNotFound(_0x539116,null))[_0x7883('0x29')](respondWithResult(_0x539116,null))['catch'](handleError(_0x539116,null));};exports['create']=function(_0x1316aa,_0x35c882){return db['CmList'][_0x7883('0x4c')](_0x1316aa[_0x7883('0x4d')],{})[_0x7883('0x29')](function(_0x203eb2){var _0x1343e0=_0x1316aa[_0x7883('0x4e')][_0x7883('0x2a')]({'plain':!![]});if(!_0x1343e0)throw new Error(_0x7883('0x4f'));if(_0x1343e0[_0x7883('0x50')]===_0x7883('0x4e')){var _0x256704=_0x203eb2[_0x7883('0x2a')]({'plain':!![]});var _0x37e018=_0x7883('0x2b');return db[_0x7883('0x51')][_0x7883('0x4b')]({'where':{'name':_0x37e018,'userProfileId':_0x1343e0[_0x7883('0x52')]},'raw':!![]})['then'](function(_0x455ba4){if(_0x455ba4&&_0x455ba4[_0x7883('0x53')]===0x0){return db['UserProfileResource'][_0x7883('0x4c')]({'name':_0x256704[_0x7883('0x2e')],'resourceId':_0x256704['id'],'type':_0x455ba4[_0x7883('0x2e')],'sectionId':_0x455ba4['id']},{})[_0x7883('0x29')](function(){return _0x203eb2;});}else{return _0x203eb2;}})[_0x7883('0x48')](function(_0x2ccd9b){logger['error'](_0x7883('0x54'),_0x2ccd9b);throw _0x2ccd9b;});}return _0x203eb2;})[_0x7883('0x29')](respondWithResult(_0x35c882,0xc9))['catch'](handleError(_0x35c882,null));};exports['update']=function(_0x5b9ff8,_0x50e545){if(_0x5b9ff8[_0x7883('0x4d')]['id']){delete _0x5b9ff8['body']['id'];}return db[_0x7883('0x44')][_0x7883('0x4b')]({'where':{'id':_0x5b9ff8[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0x50e545,null))[_0x7883('0x29')](saveUpdates(_0x5b9ff8[_0x7883('0x4d')],null))[_0x7883('0x29')](respondWithResult(_0x50e545,null))[_0x7883('0x48')](handleError(_0x50e545,null));};exports[_0x7883('0x2c')]=function(_0x49b718,_0x259908){return db[_0x7883('0x44')][_0x7883('0x4b')]({'where':{'id':_0x49b718[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0x259908,null))[_0x7883('0x29')](removeEntity(_0x259908,null))['catch'](handleError(_0x259908,null));};exports[_0x7883('0x55')]=function(_0x5c3348,_0x1c7cf4){return db['CmList'][_0x7883('0x55')]()[_0x7883('0x29')](respondWithResult(_0x1c7cf4,null))['catch'](handleError(_0x1c7cf4,null));};exports['addDisposition']=function(_0x250b3a,_0x5bb8ee,_0x55297c){if(_0x250b3a[_0x7883('0x4d')]['id']){delete _0x250b3a[_0x7883('0x4d')]['id'];}return db['CmList']['find']({'where':{'id':_0x250b3a[_0x7883('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bb8ee,null))['then'](function(_0x4e42d1){if(_0x4e42d1){_0x250b3a[_0x7883('0x4d')][_0x7883('0x56')]=_0x4e42d1['id'];return db['Disposition']['create'](_0x250b3a[_0x7883('0x4d')]);}})[_0x7883('0x29')](respondWithResult(_0x5bb8ee,null))[_0x7883('0x48')](handleError(_0x5bb8ee,null));};exports[_0x7883('0x57')]=function(_0x3fe321,_0x35d492,_0x5427f3){var _0x565ede={'raw':![],'where':{}};var _0x421637={};var _0x1fb18b={'count':0x0,'rows':[]};return db[_0x7883('0x44')][_0x7883('0x58')]({'where':{'id':_0x3fe321[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0x35d492,null))['then'](function(_0x2d582c){if(_0x2d582c){_0x421637[_0x7883('0x34')]=_[_0x7883('0x36')](db[_0x7883('0x59')][_0x7883('0x31')]);_0x421637[_0x7883('0x35')]=_[_0x7883('0x36')](_0x3fe321['query']);_0x421637[_0x7883('0x37')]=_[_0x7883('0x38')](_0x421637[_0x7883('0x34')],_0x421637[_0x7883('0x35')]);_0x565ede[_0x7883('0x39')]=_[_0x7883('0x38')](_0x421637['model'],qs[_0x7883('0x3a')](_0x3fe321['query'][_0x7883('0x3a')]));_0x565ede[_0x7883('0x39')]=_0x565ede['attributes'][_0x7883('0x3b')]?_0x565ede[_0x7883('0x39')]:_0x421637[_0x7883('0x34')];if(!_0x3fe321['query'][_0x7883('0x3c')](_0x7883('0x3d'))){_0x565ede['limit']=qs[_0x7883('0x23')](_0x3fe321['query'][_0x7883('0x23')]);_0x565ede[_0x7883('0x21')]=qs[_0x7883('0x21')](_0x3fe321[_0x7883('0x35')][_0x7883('0x21')]);}_0x565ede['order']=qs['sort'](_0x3fe321['query'][_0x7883('0x3f')]);_0x565ede[_0x7883('0x41')]=qs['filters'](_[_0x7883('0x5a')](_0x3fe321[_0x7883('0x35')],_0x421637[_0x7883('0x37')]));_0x565ede[_0x7883('0x41')][_0x7883('0x56')]=_0x2d582c['id'];if(_0x3fe321[_0x7883('0x35')][_0x7883('0x40')]){_0x565ede[_0x7883('0x41')]=_[_0x7883('0x42')](_0x565ede[_0x7883('0x41')],{'$or':_['map'](_0x565ede[_0x7883('0x39')],function(_0x22bb32){var _0x58fbf5={};_0x58fbf5[_0x22bb32]={'$like':'%'+_0x3fe321[_0x7883('0x35')][_0x7883('0x40')]+'%'};return _0x58fbf5;})});}_0x565ede=_[_0x7883('0x42')]({},_0x565ede,_0x3fe321[_0x7883('0x43')]);return db[_0x7883('0x59')][_0x7883('0x24')]({'where':_0x565ede[_0x7883('0x41')]})['then'](function(_0x51c40c){_0x1fb18b[_0x7883('0x24')]=_0x51c40c;if(_0x3fe321['query']['includeAll']){_0x565ede[_0x7883('0x46')]=[{'all':!![]}];}return db[_0x7883('0x59')][_0x7883('0x5b')](_0x565ede);})[_0x7883('0x29')](function(_0x24e978){_0x1fb18b[_0x7883('0x47')]=_0x24e978;return _0x1fb18b;});}})['then'](respondWithFilteredResult(_0x35d492,_0x565ede))['catch'](handleError(_0x35d492,null));};exports[_0x7883('0x5c')]=function(_0x7cc096,_0x1b8c7e,_0x2fba03){return db['CmList']['find']({'where':{'id':_0x7cc096[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0x1b8c7e,null))[_0x7883('0x29')](function(_0x10d54d){if(_0x10d54d){return _0x10d54d['removeDispositions'](_0x7cc096[_0x7883('0x35')][_0x7883('0x5d')]);}})['then'](respondWithStatusCode(_0x1b8c7e,null))[_0x7883('0x48')](handleError(_0x1b8c7e,null));};exports[_0x7883('0x5e')]=function(_0x424966,_0xdf0d50,_0x351f5f){return db[_0x7883('0x44')][_0x7883('0x4b')]({'where':{'id':_0x424966[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0xdf0d50,null))[_0x7883('0x29')](function(_0x46d6b8){if(_0x46d6b8){var _0x3c93b8=[];var _0x4b3300={'success':[],'errors':[]};return db[_0x7883('0x5f')]['describe']()['then'](function(_0x283b91){if(_0x424966[_0x7883('0x4d')]['tags']&&_[_0x7883('0x60')](_0x424966[_0x7883('0x4d')][_0x7883('0x61')])){if(_0x424966[_0x7883('0x4d')][_0x7883('0x61')]['length']){_0x424966['body'][_0x7883('0x61')]=_0x424966['body']['tags'][_0x7883('0x62')](';')+';';}else{_0x424966[_0x7883('0x4d')][_0x7883('0x61')]=null;}}else{_0x424966[_0x7883('0x4d')]['tags']=null;}if(_0x424966[_0x7883('0x4d')]&&_[_0x7883('0x60')](_0x424966[_0x7883('0x4d')])){for(var _0x83e0e8=0x0;_0x83e0e8<_0x424966[_0x7883('0x4d')][_0x7883('0x3b')];_0x83e0e8+=0x1){_0x424966['body'][_0x83e0e8][_0x7883('0x56')]=_0x424966[_0x7883('0x4a')]['id'];_0x3c93b8['push'](_0x424966[_0x7883('0x4d')][_0x83e0e8]);}return BPromise[_0x7883('0x63')](_0x3c93b8,function(_0x414e19){return db[_0x7883('0x5f')]['create'](_[_0x7883('0x64')](_0x414e19,[_0x7883('0x5d'),'id'])||{},{'fields':_[_0x7883('0x36')](_0x283b91),'raw':!![]})[_0x7883('0x29')](function(_0x2b4f1c){_0x4b3300[_0x7883('0x65')][_0x7883('0x66')](_0x2b4f1c[_0x7883('0x67')]);})['catch'](function(_0x584df5){_0x4b3300[_0x7883('0x68')][_0x7883('0x66')]({'data':_0x414e19,'error':_0x584df5[_0x7883('0x69')]});});})['then'](function(_0x2806b5){return _0x4b3300;})[_0x7883('0x48')](function(_0xc0ee07){return _0xc0ee07;});}else{_0xdf0d50[_0x7883('0x1e')](0x190)[_0x7883('0x20')]({'message':_0x7883('0x6a')});}});}})[_0x7883('0x29')](respondWithResult(_0xdf0d50,null))['catch'](handleError(_0xdf0d50,null));};exports[_0x7883('0x6b')]=function(_0x24d469,_0x4cf4cc,_0x561fef){var _0x31a7d5;return db[_0x7883('0x44')][_0x7883('0x4b')]({'where':{'id':_0x24d469[_0x7883('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x7883('0x6c')}]})['then'](handleEntityNotFound(_0x4cf4cc,null))['then'](function(_0x35e5c7){if(_0x35e5c7){_0x31a7d5=_0x35e5c7;return db[_0x7883('0x5f')]['rawAttributes'];}})[_0x7883('0x29')](function(_0x2293ca){if(_0x2293ca){var _0x223bbe={};var _0x1cce81={};_0x1cce81[_0x7883('0x34')]=_[_0x7883('0x6d')](_[_0x7883('0x36')](_0x2293ca),_[_0x7883('0x30')](_0x31a7d5['CustomFields'],function(_0x12fc23){return util['format'](_0x7883('0x6e'),_0x12fc23['id']);}));_0x1cce81[_0x7883('0x35')]=_[_0x7883('0x36')](_0x24d469[_0x7883('0x35')]);_0x1cce81[_0x7883('0x37')]=_[_0x7883('0x38')](_0x1cce81['model'],_0x1cce81[_0x7883('0x35')]);_0x223bbe[_0x7883('0x39')]=_[_0x7883('0x38')](_0x1cce81['model'],qs[_0x7883('0x3a')](_0x24d469['query'][_0x7883('0x3a')]));_0x223bbe[_0x7883('0x39')]=_0x223bbe[_0x7883('0x39')]['length']?_0x223bbe['attributes']:_0x1cce81[_0x7883('0x34')];if(!_0x24d469[_0x7883('0x35')][_0x7883('0x3c')]('nolimit')){_0x223bbe[_0x7883('0x23')]=qs['limit'](_0x24d469[_0x7883('0x35')][_0x7883('0x23')]);_0x223bbe[_0x7883('0x21')]=qs[_0x7883('0x21')](_0x24d469['query']['offset']);}_0x223bbe[_0x7883('0x3e')]=qs[_0x7883('0x3f')](_0x24d469[_0x7883('0x35')][_0x7883('0x3f')]);_0x223bbe[_0x7883('0x41')]=qs[_0x7883('0x37')](_[_0x7883('0x5a')](_0x24d469['query'],_0x1cce81['filters']));_0x223bbe[_0x7883('0x6f')]=!![];if(_0x24d469['query'][_0x7883('0x40')]){_0x223bbe[_0x7883('0x41')]=_[_0x7883('0x42')](_0x223bbe[_0x7883('0x41')],{'$or':_[_0x7883('0x30')](_0x223bbe[_0x7883('0x39')],function(_0x3c7d28){var _0x195122={};_0x195122[_0x3c7d28]={'$like':'%'+_0x24d469['query'][_0x7883('0x40')]+'%'};return _0x195122;})});}_0x223bbe=_[_0x7883('0x42')]({},_0x223bbe,_0x24d469[_0x7883('0x43')]);return _0x31a7d5[_0x7883('0x6b')](_0x223bbe);}})[_0x7883('0x29')](respondWithResult(_0x4cf4cc,null))[_0x7883('0x48')](handleError(_0x4cf4cc,null));};exports[_0x7883('0x70')]=function(_0x3d8c64,_0x237f55,_0x703c89){var _0x34a71f;return db[_0x7883('0x44')][_0x7883('0x4b')]({'where':{'id':_0x3d8c64[_0x7883('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x7883('0x6c')}]})[_0x7883('0x29')](handleEntityNotFound(_0x237f55,null))['then'](function(_0x483f7e){if(_0x483f7e){_0x34a71f=_0x483f7e;return db[_0x7883('0x5f')][_0x7883('0x31')];}})[_0x7883('0x29')](function(_0x73143){if(_0x73143){var _0x2a96c0={};var _0x352872={};_0x352872[_0x7883('0x34')]=_['concat'](_[_0x7883('0x36')](_0x73143),_[_0x7883('0x30')](_0x34a71f[_0x7883('0x6c')],function(_0x3af881){return util['format'](_0x7883('0x6e'),_0x3af881['id']);}));_0x352872[_0x7883('0x35')]=_['keys'](_0x3d8c64[_0x7883('0x35')]);_0x352872[_0x7883('0x37')]=_[_0x7883('0x38')](_0x352872['model'],_0x352872['query']);_0x2a96c0[_0x7883('0x39')]=_[_0x7883('0x38')](_0x352872[_0x7883('0x34')],qs['fields'](_0x3d8c64['query'][_0x7883('0x3a')]));_0x2a96c0[_0x7883('0x39')]=_0x2a96c0[_0x7883('0x39')][_0x7883('0x3b')]?_0x2a96c0['attributes']:_0x352872['model'];if(!_0x3d8c64[_0x7883('0x35')][_0x7883('0x3c')](_0x7883('0x3d'))){_0x2a96c0[_0x7883('0x23')]=qs['limit'](_0x3d8c64[_0x7883('0x35')]['limit']);_0x2a96c0[_0x7883('0x21')]=qs[_0x7883('0x21')](_0x3d8c64[_0x7883('0x35')][_0x7883('0x21')]);}_0x2a96c0[_0x7883('0x3e')]=qs[_0x7883('0x3f')](_0x3d8c64[_0x7883('0x35')][_0x7883('0x3f')]);_0x2a96c0['where']=qs[_0x7883('0x37')](_[_0x7883('0x5a')](_0x3d8c64[_0x7883('0x35')],_0x352872[_0x7883('0x37')]));_0x2a96c0[_0x7883('0x6f')]=!![];if(_0x3d8c64['query'][_0x7883('0x40')]){_0x2a96c0[_0x7883('0x41')]=_[_0x7883('0x42')](_0x2a96c0[_0x7883('0x41')],{'$or':_['map'](_0x2a96c0[_0x7883('0x39')],function(_0x4f6ca7){var _0x467303={};_0x467303[_0x4f6ca7]={'$like':'%'+_0x3d8c64[_0x7883('0x35')][_0x7883('0x40')]+'%'};return _0x467303;})});}_0x2a96c0=_[_0x7883('0x42')]({},_0x2a96c0,_0x3d8c64[_0x7883('0x43')]);return _0x34a71f[_0x7883('0x6b')](_0x2a96c0);}})['then'](function(_0x523d74){if(!_[_0x7883('0x71')](_0x523d74)){var _0x19c27e=toCsv(_0x523d74);var _0x3840a2=Date[_0x7883('0x72')]();fs[_0x7883('0x73')](util[_0x7883('0x74')](_0x7883('0x75'),_0x34a71f['id'],_0x3840a2),_0x19c27e);_0x237f55[_0x7883('0x76')](_0x7883('0x77'),_0x7883('0x78')+util[_0x7883('0x74')](_0x7883('0x79'),_0x34a71f['id'],_0x3840a2));_0x237f55[_0x7883('0x76')](_0x7883('0x7a'),_0x7883('0x7b'));return _0x237f55['download'](util[_0x7883('0x74')](_0x7883('0x75'),_0x34a71f['id'],_0x3840a2));}else{return _0x237f55['sendStatus'](0xcc);}})[_0x7883('0x48')](handleError(_0x237f55,null));};exports[_0x7883('0x7c')]=function(_0x4700f7,_0x399182,_0x2089e9){var _0xf70be3;delete _0x4700f7[_0x7883('0x4d')]['id'];return db[_0x7883('0x44')]['findOne']({'where':{'id':_0x4700f7[_0x7883('0x4a')]['id']}})['then'](handleEntityNotFound(_0x399182,null))[_0x7883('0x29')](function(_0x4b23bb){if(_0x4b23bb){return db['sequelize'][_0x7883('0x7d')](function(_0x250e9a){return db[_0x7883('0x7e')][_0x7883('0x4c')](_0x4700f7[_0x7883('0x4d')],{'transaction':_0x250e9a})[_0x7883('0x29')](function(_0x1265e7){_0xf70be3=_0x1265e7;return _0x4b23bb['addCustomFields'](_0x1265e7,{'transaction':_0x250e9a});})['then'](function(){var _0x14cf79={'type':db[_0x7883('0x7f')][_0x7883('0x80')],'transaction':_0x250e9a};switch(_0x4700f7['body']['type']){case'text':_0x14cf79[_0x7883('0x81')]=db[_0x7883('0x7f')][_0x7883('0x80')];break;case'number':_0x14cf79[_0x7883('0x81')]=db[_0x7883('0x7f')]['INTEGER'];break;case _0x7883('0x82'):_0x14cf79[_0x7883('0x81')]=db[_0x7883('0x7f')][_0x7883('0x83')];_0x14cf79[_0x7883('0x84')]=![];break;default:}return db[_0x7883('0x85')][_0x7883('0x86')][_0x7883('0x87')](_0x7883('0x88'),util['format'](_0x7883('0x89'),_0xf70be3['id']),_0x14cf79);})[_0x7883('0x29')](function(){return _0xf70be3;});});}})[_0x7883('0x29')](respondWithResult(_0x399182,null))[_0x7883('0x48')](handleError(_0x399182,null));};exports[_0x7883('0x8a')]=function(_0x3446eb,_0x76cb87,_0x665ccb){var _0xbd46fd={};var _0x217464={};var _0x2f0a58;var _0x3813ff;return db[_0x7883('0x44')][_0x7883('0x58')]({'where':{'id':_0x3446eb['params']['id']}})['then'](handleEntityNotFound(_0x76cb87,null))[_0x7883('0x29')](function(_0x2c2f55){if(_0x2c2f55){_0x2f0a58=_0x2c2f55;_0x217464[_0x7883('0x34')]=_[_0x7883('0x36')](db['CmCustomField']['rawAttributes']);_0x217464['query']=_[_0x7883('0x36')](_0x3446eb['query']);_0x217464[_0x7883('0x37')]=_[_0x7883('0x38')](_0x217464[_0x7883('0x34')],_0x217464[_0x7883('0x35')]);_0xbd46fd[_0x7883('0x39')]=_[_0x7883('0x38')](_0x217464[_0x7883('0x34')],qs['fields'](_0x3446eb[_0x7883('0x35')][_0x7883('0x3a')]));_0xbd46fd[_0x7883('0x39')]=_0xbd46fd[_0x7883('0x39')]['length']?_0xbd46fd[_0x7883('0x39')]:_0x217464[_0x7883('0x34')];_0xbd46fd[_0x7883('0x3e')]=qs[_0x7883('0x3f')](_0x3446eb[_0x7883('0x35')][_0x7883('0x3f')]);_0xbd46fd[_0x7883('0x41')]=qs[_0x7883('0x37')](_[_0x7883('0x5a')](_0x3446eb[_0x7883('0x35')],_0x217464[_0x7883('0x37')]));_0xbd46fd[_0x7883('0x41')]=_[_0x7883('0x42')](_0xbd46fd['where'],{'$or':[{'ListId':_0x2c2f55['id']},{'ListId':null}]});if(_0x3446eb['query'][_0x7883('0x40')]){_0xbd46fd[_0x7883('0x41')]=_[_0x7883('0x42')](_0xbd46fd[_0x7883('0x41')],{'$or':_[_0x7883('0x30')](_0xbd46fd[_0x7883('0x39')],function(_0x4ced3d){var _0x195878={};_0x195878[_0x4ced3d]={'$like':'%'+_0x3446eb[_0x7883('0x35')][_0x7883('0x40')]+'%'};return _0x195878;})});}_0xbd46fd=_[_0x7883('0x42')]({},_0xbd46fd,_0x3446eb['options']);return db['CmCustomField'][_0x7883('0x8b')](_0xbd46fd);}})[_0x7883('0x29')](respondWithResult(_0x76cb87,null))[_0x7883('0x48')](handleError(_0x76cb87,null));};exports['addAgents']=function(_0x24eb97,_0x4cf008,_0x53a164){return db['CmList']['find']({'where':{'id':_0x24eb97[_0x7883('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4cf008,null))[_0x7883('0x29')](function(_0x4b18ae){if(_0x4b18ae){return _0x4b18ae[_0x7883('0x8c')](_0x24eb97['body'][_0x7883('0x5d')],_[_0x7883('0x64')](_0x24eb97[_0x7883('0x4d')],['ids','id'])||{})[_0x7883('0x8d')](function(_0x18b107){for(var _0x2599b0=0x0;_0x2599b0<_0x24eb97[_0x7883('0x4d')][_0x7883('0x5d')][_0x7883('0x3b')];_0x2599b0+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x24eb97[_0x7883('0x4d')][_0x7883('0x5d')][_0x2599b0]),'CmListId':Number(_0x24eb97[_0x7883('0x4a')]['id'])});}return _0x18b107;});}})[_0x7883('0x29')](respondWithResult(_0x4cf008,null))[_0x7883('0x48')](handleError(_0x4cf008,null));};exports[_0x7883('0x8e')]=function(_0x3e275d,_0x3294e3,_0x224265){return db[_0x7883('0x44')][_0x7883('0x4b')]({'where':{'id':_0x3e275d[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0x3294e3,null))[_0x7883('0x29')](function(_0x57971a){if(_0x57971a){return _0x57971a[_0x7883('0x8e')](_0x3e275d[_0x7883('0x35')][_0x7883('0x5d')])['then'](function(){if(_[_0x7883('0x60')](_0x3e275d[_0x7883('0x35')][_0x7883('0x5d')])){for(var _0x55962b=0x0;_0x55962b<_0x3e275d[_0x7883('0x35')][_0x7883('0x5d')][_0x7883('0x3b')];_0x55962b+=0x1){socket['emit'](_0x7883('0x8f'),{'UserId':Number(_0x3e275d[_0x7883('0x35')][_0x7883('0x5d')][_0x55962b]),'CmListId':Number(_0x3e275d['params']['id'])});}}else{socket[_0x7883('0x90')](_0x7883('0x8f'),{'UserId':Number(_0x3e275d['query'][_0x7883('0x5d')]),'CmListId':Number(_0x3e275d[_0x7883('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3294e3,null))[_0x7883('0x48')](handleError(_0x3294e3,null));};exports['getAgents']=function(_0x44d9ba,_0x22e540,_0x54df39){var _0x4d9150={};var _0x17c550={};var _0x470cf1;var _0x247aae;return db['CmList']['findOne']({'where':{'id':_0x44d9ba[_0x7883('0x4a')]['id']}})[_0x7883('0x29')](handleEntityNotFound(_0x22e540,null))[_0x7883('0x29')](function(_0x4cd4ba){if(_0x4cd4ba){_0x470cf1=_0x4cd4ba;_0x17c550[_0x7883('0x34')]=_[_0x7883('0x36')](db['User'][_0x7883('0x31')]);_0x17c550[_0x7883('0x35')]=_[_0x7883('0x36')](_0x44d9ba[_0x7883('0x35')]);_0x17c550[_0x7883('0x37')]=_[_0x7883('0x38')](_0x17c550[_0x7883('0x34')],_0x17c550['query']);_0x4d9150['attributes']=_[_0x7883('0x38')](_0x17c550[_0x7883('0x34')],qs[_0x7883('0x3a')](_0x44d9ba[_0x7883('0x35')][_0x7883('0x3a')]));_0x4d9150[_0x7883('0x39')]=_0x4d9150[_0x7883('0x39')][_0x7883('0x3b')]?_0x4d9150[_0x7883('0x39')]:_0x17c550[_0x7883('0x34')];_0x4d9150[_0x7883('0x3e')]=qs[_0x7883('0x3f')](_0x44d9ba[_0x7883('0x35')][_0x7883('0x3f')]);_0x4d9150[_0x7883('0x41')]=qs[_0x7883('0x37')](_['pick'](_0x44d9ba[_0x7883('0x35')],_0x17c550[_0x7883('0x37')]));if(_0x44d9ba[_0x7883('0x35')][_0x7883('0x40')]){_0x4d9150['where']=_[_0x7883('0x42')](_0x4d9150[_0x7883('0x41')],{'$or':_[_0x7883('0x30')](_0x4d9150[_0x7883('0x39')],function(_0x44f4d1){var _0x4d33c8={};_0x4d33c8[_0x44f4d1]={'$like':'%'+_0x44d9ba['query'][_0x7883('0x40')]+'%'};return _0x4d33c8;})});}_0x4d9150=_[_0x7883('0x42')]({},_0x4d9150,_0x44d9ba[_0x7883('0x43')]);return _0x470cf1[_0x7883('0x91')](_0x4d9150);}})[_0x7883('0x29')](function(_0x1c60f4){if(_0x1c60f4){_0x247aae=_0x1c60f4[_0x7883('0x3b')];if(!_0x44d9ba['query']['hasOwnProperty'](_0x7883('0x3d'))){_0x4d9150[_0x7883('0x23')]=qs['limit'](_0x44d9ba[_0x7883('0x35')][_0x7883('0x23')]);_0x4d9150['offset']=qs[_0x7883('0x21')](_0x44d9ba[_0x7883('0x35')]['offset']);}return _0x470cf1[_0x7883('0x91')](_0x4d9150);}})[_0x7883('0x29')](function(_0x203380){if(_0x203380){return _0x203380?{'count':_0x247aae,'rows':_0x203380}:null;}})[_0x7883('0x29')](respondWithResult(_0x22e540,null))[_0x7883('0x48')](handleError(_0x22e540,null));}; \ No newline at end of file +var _0x4274=['raw','isEmpty','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','transaction','Sequelize','TEXT','type','text','switch','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','map','CmList','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ListId','Disposition','getDispositions','findOne','order','pick','ids','addContacts','CmContact','tags','join','isArray','each','omit','success','errors','push','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','CmCustomField','concat'];(function(_0x5bd1ac,_0x38adef){var _0x3d6583=function(_0x38ed57){while(--_0x38ed57){_0x5bd1ac['push'](_0x5bd1ac['shift']());}};_0x3d6583(++_0x38adef);}(_0x4274,0xa5));var _0x4427=function(_0x3df57f,_0x39ee9b){_0x3df57f=_0x3df57f-0x0;var _0x3a4b94=_0x4274[_0x3df57f];return _0x3a4b94;};'use strict';var emlformat=require(_0x4427('0x0'));var rimraf=require(_0x4427('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4427('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4427('0x3'));var util=require(_0x4427('0x4'));var path=require(_0x4427('0x5'));var sox=require('sox');var csv=require(_0x4427('0x6'));var ejs=require(_0x4427('0x7'));var fs=require('fs');var fs_extra=require(_0x4427('0x8'));var _=require('lodash');var squel=require(_0x4427('0x9'));var crypto=require(_0x4427('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4427('0xb'));var toCsv=require(_0x4427('0x6'));var querystring=require(_0x4427('0xc'));var Papa=require(_0x4427('0xd'));var Redis=require('ioredis');var authService=require(_0x4427('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4427('0xf'));var logger=require(_0x4427('0x10'))(_0x4427('0x11'));var utils=require(_0x4427('0x12'));var config=require(_0x4427('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4427('0x14'))['db'];config[_0x4427('0x15')]=_[_0x4427('0x16')](config['redis'],{'host':_0x4427('0x17'),'port':0x18eb});var socket=require(_0x4427('0x18'))(new Redis(config[_0x4427('0x15')]));require(_0x4427('0x19'))['register'](socket);function respondWithStatusCode(_0x13dc40,_0x546b22){_0x546b22=_0x546b22||0xcc;return function(_0x35a61d){if(_0x35a61d){return _0x13dc40['sendStatus'](_0x546b22);}return _0x13dc40[_0x4427('0x1a')](_0x546b22)[_0x4427('0x1b')]();};}function respondWithResult(_0x1e241a,_0x5d677d){_0x5d677d=_0x5d677d||0xc8;return function(_0xbdbbc9){if(_0xbdbbc9){return _0x1e241a[_0x4427('0x1a')](_0x5d677d)[_0x4427('0x1c')](_0xbdbbc9);}};}function respondWithFilteredResult(_0x11f8dc,_0x2ebad2){return function(_0x1f32f5){if(_0x1f32f5){var _0x2fd8d5=typeof _0x2ebad2['offset']===_0x4427('0x1d')&&typeof _0x2ebad2[_0x4427('0x1e')]==='undefined';var _0x4785b5=_0x1f32f5[_0x4427('0x1f')];var _0x3e882d=_0x2fd8d5?0x0:_0x2ebad2[_0x4427('0x20')];var _0x4aa883=_0x2fd8d5?_0x1f32f5[_0x4427('0x1f')]:_0x2ebad2[_0x4427('0x20')]+_0x2ebad2['limit'];var _0x1a0674;if(_0x4aa883>=_0x4785b5){_0x4aa883=_0x4785b5;_0x1a0674=0xc8;}else{_0x1a0674=0xce;}_0x11f8dc[_0x4427('0x1a')](_0x1a0674);return _0x11f8dc[_0x4427('0x21')](_0x4427('0x22'),_0x3e882d+'-'+_0x4aa883+'/'+_0x4785b5)['json'](_0x1f32f5);}return null;};}function patchUpdates(_0x27cdd3){return function(_0x4fcd6e){try{jsonpatch[_0x4427('0x23')](_0x4fcd6e,_0x27cdd3,!![]);}catch(_0x30850d){return BPromise[_0x4427('0x24')](_0x30850d);}return _0x4fcd6e['save']();};}function saveUpdates(_0x2f6f08,_0x46fc5f){return function(_0x2fb548){if(_0x2fb548){return _0x2fb548[_0x4427('0x25')](_0x2f6f08)[_0x4427('0x26')](function(_0x3c2443){return _0x3c2443;});}return null;};}function removeEntity(_0x2e5b0f,_0x23594f){return function(_0x517ca3){if(_0x517ca3){return _0x517ca3[_0x4427('0x27')]()['then'](function(){var _0xfc8d27=_0x517ca3[_0x4427('0x28')]({'plain':!![]});var _0x15ee21='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x15ee21,'resourceId':_0xfc8d27['id']}})[_0x4427('0x26')](function(){return _0x517ca3;});})[_0x4427('0x26')](function(){_0x2e5b0f[_0x4427('0x1a')](0xcc)[_0x4427('0x1b')]();});}};}function handleEntityNotFound(_0x12dfbd,_0x1ab534){return function(_0x5d967b){if(!_0x5d967b){_0x12dfbd['sendStatus'](0x194);}return _0x5d967b;};}function handleError(_0x14214d,_0x3ad59f){_0x3ad59f=_0x3ad59f||0x1f4;return function(_0x2954f5){logger[_0x4427('0x29')](_0x2954f5[_0x4427('0x2a')]);if(_0x2954f5[_0x4427('0x2b')]){delete _0x2954f5[_0x4427('0x2b')];}_0x14214d[_0x4427('0x1a')](_0x3ad59f)['send'](_0x2954f5);};}exports['index']=function(_0x2ec1cf,_0x2c2391){var _0x1823cb={},_0xbb268b={},_0x14ed00={'count':0x0,'rows':[]};var _0x3c99ee=_[_0x4427('0x2c')](db[_0x4427('0x2d')][_0x4427('0x2e')],function(_0x21f70d){return{'name':_0x21f70d[_0x4427('0x2f')],'type':_0x21f70d['type']['key']};});_0xbb268b[_0x4427('0x30')]=_['map'](_0x3c99ee,_0x4427('0x2b'));_0xbb268b[_0x4427('0x31')]=_[_0x4427('0x32')](_0x2ec1cf['query']);_0xbb268b[_0x4427('0x33')]=_[_0x4427('0x34')](_0xbb268b['model'],_0xbb268b['query']);_0x1823cb[_0x4427('0x35')]=_[_0x4427('0x34')](_0xbb268b[_0x4427('0x30')],qs[_0x4427('0x36')](_0x2ec1cf['query'][_0x4427('0x36')]));_0x1823cb['attributes']=_0x1823cb[_0x4427('0x35')]['length']?_0x1823cb[_0x4427('0x35')]:_0xbb268b[_0x4427('0x30')];if(!_0x2ec1cf[_0x4427('0x31')][_0x4427('0x37')](_0x4427('0x38'))){_0x1823cb[_0x4427('0x1e')]=qs[_0x4427('0x1e')](_0x2ec1cf[_0x4427('0x31')]['limit']);_0x1823cb['offset']=qs[_0x4427('0x20')](_0x2ec1cf[_0x4427('0x31')][_0x4427('0x20')]);}_0x1823cb['order']=qs[_0x4427('0x39')](_0x2ec1cf[_0x4427('0x31')][_0x4427('0x39')]);_0x1823cb[_0x4427('0x3a')]=qs['filters'](_['pick'](_0x2ec1cf[_0x4427('0x31')],_0xbb268b['filters']),_0x3c99ee);if(_0x2ec1cf[_0x4427('0x31')][_0x4427('0x3b')]){_0x1823cb['where']=_[_0x4427('0x3c')](_0x1823cb['where'],{'$or':_[_0x4427('0x2c')](_0x3c99ee,function(_0xdf5b6a){if(_0xdf5b6a['type']!==_0x4427('0x3d')){var _0x36fa3a={};_0x36fa3a[_0xdf5b6a[_0x4427('0x2b')]]={'$like':'%'+_0x2ec1cf[_0x4427('0x31')][_0x4427('0x3b')]+'%'};return _0x36fa3a;}})});}_0x1823cb=_['merge']({},_0x1823cb,_0x2ec1cf[_0x4427('0x3e')]);var _0x5bae4e={'where':_0x1823cb[_0x4427('0x3a')]};return db[_0x4427('0x2d')][_0x4427('0x1f')](_0x5bae4e)[_0x4427('0x26')](function(_0x49bdff){_0x14ed00['count']=_0x49bdff;if(_0x2ec1cf[_0x4427('0x31')][_0x4427('0x3f')]){_0x1823cb['include']=[{'all':!![]}];}return db[_0x4427('0x2d')][_0x4427('0x40')](_0x1823cb);})['then'](function(_0x44ac83){_0x14ed00[_0x4427('0x41')]=_0x44ac83;return _0x14ed00;})[_0x4427('0x26')](respondWithFilteredResult(_0x2c2391,_0x1823cb))[_0x4427('0x42')](handleError(_0x2c2391,null));};exports[_0x4427('0x43')]=function(_0x18ec20,_0x4d4ff5){var _0x30926e={'raw':![],'where':{'id':_0x18ec20[_0x4427('0x44')]['id']}},_0x5943c0={};_0x5943c0['model']=_['keys'](db[_0x4427('0x2d')][_0x4427('0x2e')]);_0x5943c0[_0x4427('0x31')]=_[_0x4427('0x32')](_0x18ec20[_0x4427('0x31')]);_0x5943c0[_0x4427('0x33')]=_[_0x4427('0x34')](_0x5943c0[_0x4427('0x30')],_0x5943c0[_0x4427('0x31')]);_0x30926e['attributes']=_[_0x4427('0x34')](_0x5943c0['model'],qs['fields'](_0x18ec20[_0x4427('0x31')][_0x4427('0x36')]));_0x30926e[_0x4427('0x35')]=_0x30926e[_0x4427('0x35')][_0x4427('0x45')]?_0x30926e['attributes']:_0x5943c0[_0x4427('0x30')];if(_0x18ec20[_0x4427('0x31')][_0x4427('0x3f')]){_0x30926e[_0x4427('0x46')]=[{'all':!![]}];}_0x30926e=_[_0x4427('0x3c')]({},_0x30926e,_0x18ec20[_0x4427('0x3e')]);return db['CmList']['find'](_0x30926e)['then'](handleEntityNotFound(_0x4d4ff5,null))[_0x4427('0x26')](respondWithResult(_0x4d4ff5,null))[_0x4427('0x42')](handleError(_0x4d4ff5,null));};exports[_0x4427('0x47')]=function(_0x4ccab5,_0xab7fc1){return db[_0x4427('0x2d')][_0x4427('0x47')](_0x4ccab5['body'],{})[_0x4427('0x26')](function(_0x4e64ff){var _0x5a9823=_0x4ccab5['user'][_0x4427('0x28')]({'plain':!![]});if(!_0x5a9823)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a9823[_0x4427('0x48')]==='user'){var _0x405145=_0x4e64ff[_0x4427('0x28')]({'plain':!![]});var _0x50ae3b='Lists';return db['UserProfileSection'][_0x4427('0x49')]({'where':{'name':_0x50ae3b,'userProfileId':_0x5a9823[_0x4427('0x4a')]},'raw':!![]})[_0x4427('0x26')](function(_0x265c0c){if(_0x265c0c&&_0x265c0c[_0x4427('0x4b')]===0x0){return db['UserProfileResource'][_0x4427('0x47')]({'name':_0x405145[_0x4427('0x2b')],'resourceId':_0x405145['id'],'type':_0x265c0c[_0x4427('0x2b')],'sectionId':_0x265c0c['id']},{})[_0x4427('0x26')](function(){return _0x4e64ff;});}else{return _0x4e64ff;}})['catch'](function(_0x2a3078){logger['error'](_0x4427('0x4c'),_0x2a3078);throw _0x2a3078;});}return _0x4e64ff;})[_0x4427('0x26')](respondWithResult(_0xab7fc1,0xc9))['catch'](handleError(_0xab7fc1,null));};exports['update']=function(_0x592062,_0x3d151c){if(_0x592062[_0x4427('0x4d')]['id']){delete _0x592062['body']['id'];}return db[_0x4427('0x2d')]['find']({'where':{'id':_0x592062['params']['id']}})[_0x4427('0x26')](handleEntityNotFound(_0x3d151c,null))[_0x4427('0x26')](saveUpdates(_0x592062[_0x4427('0x4d')],null))[_0x4427('0x26')](respondWithResult(_0x3d151c,null))[_0x4427('0x42')](handleError(_0x3d151c,null));};exports['destroy']=function(_0x2f5c49,_0x46c262){return db[_0x4427('0x2d')][_0x4427('0x49')]({'where':{'id':_0x2f5c49[_0x4427('0x44')]['id']}})[_0x4427('0x26')](handleEntityNotFound(_0x46c262,null))[_0x4427('0x26')](removeEntity(_0x46c262,null))[_0x4427('0x42')](handleError(_0x46c262,null));};exports[_0x4427('0x4e')]=function(_0x11707f,_0x3fd000){return db[_0x4427('0x2d')][_0x4427('0x4e')]()[_0x4427('0x26')](respondWithResult(_0x3fd000,null))['catch'](handleError(_0x3fd000,null));};exports['addDisposition']=function(_0x221579,_0x5e9edd,_0x3fe07b){if(_0x221579[_0x4427('0x4d')]['id']){delete _0x221579[_0x4427('0x4d')]['id'];}return db['CmList'][_0x4427('0x49')]({'where':{'id':_0x221579[_0x4427('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e9edd,null))[_0x4427('0x26')](function(_0x5ddc58){if(_0x5ddc58){_0x221579['body'][_0x4427('0x4f')]=_0x5ddc58['id'];return db[_0x4427('0x50')][_0x4427('0x47')](_0x221579[_0x4427('0x4d')]);}})[_0x4427('0x26')](respondWithResult(_0x5e9edd,null))[_0x4427('0x42')](handleError(_0x5e9edd,null));};exports[_0x4427('0x51')]=function(_0x2e7da7,_0xa0796,_0xb71aa8){var _0x3687f5={'raw':![],'where':{}};var _0x1c4d2c={};var _0x4aa589={'count':0x0,'rows':[]};return db['CmList'][_0x4427('0x52')]({'where':{'id':_0x2e7da7[_0x4427('0x44')]['id']}})[_0x4427('0x26')](handleEntityNotFound(_0xa0796,null))['then'](function(_0x46a9cd){if(_0x46a9cd){_0x1c4d2c['model']=_[_0x4427('0x32')](db[_0x4427('0x50')][_0x4427('0x2e')]);_0x1c4d2c[_0x4427('0x31')]=_['keys'](_0x2e7da7[_0x4427('0x31')]);_0x1c4d2c[_0x4427('0x33')]=_[_0x4427('0x34')](_0x1c4d2c[_0x4427('0x30')],_0x1c4d2c[_0x4427('0x31')]);_0x3687f5[_0x4427('0x35')]=_[_0x4427('0x34')](_0x1c4d2c[_0x4427('0x30')],qs[_0x4427('0x36')](_0x2e7da7[_0x4427('0x31')][_0x4427('0x36')]));_0x3687f5[_0x4427('0x35')]=_0x3687f5[_0x4427('0x35')][_0x4427('0x45')]?_0x3687f5[_0x4427('0x35')]:_0x1c4d2c['model'];if(!_0x2e7da7['query'][_0x4427('0x37')](_0x4427('0x38'))){_0x3687f5[_0x4427('0x1e')]=qs[_0x4427('0x1e')](_0x2e7da7[_0x4427('0x31')][_0x4427('0x1e')]);_0x3687f5[_0x4427('0x20')]=qs[_0x4427('0x20')](_0x2e7da7['query']['offset']);}_0x3687f5[_0x4427('0x53')]=qs[_0x4427('0x39')](_0x2e7da7['query'][_0x4427('0x39')]);_0x3687f5[_0x4427('0x3a')]=qs[_0x4427('0x33')](_[_0x4427('0x54')](_0x2e7da7[_0x4427('0x31')],_0x1c4d2c['filters']));_0x3687f5[_0x4427('0x3a')][_0x4427('0x4f')]=_0x46a9cd['id'];if(_0x2e7da7['query'][_0x4427('0x3b')]){_0x3687f5[_0x4427('0x3a')]=_['merge'](_0x3687f5[_0x4427('0x3a')],{'$or':_[_0x4427('0x2c')](_0x3687f5['attributes'],function(_0x15d767){var _0x5edfc1={};_0x5edfc1[_0x15d767]={'$like':'%'+_0x2e7da7[_0x4427('0x31')][_0x4427('0x3b')]+'%'};return _0x5edfc1;})});}_0x3687f5=_[_0x4427('0x3c')]({},_0x3687f5,_0x2e7da7['options']);return db[_0x4427('0x50')]['count']({'where':_0x3687f5[_0x4427('0x3a')]})[_0x4427('0x26')](function(_0x530881){_0x4aa589['count']=_0x530881;if(_0x2e7da7['query']['includeAll']){_0x3687f5[_0x4427('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3687f5);})[_0x4427('0x26')](function(_0x514c89){_0x4aa589[_0x4427('0x41')]=_0x514c89;return _0x4aa589;});}})[_0x4427('0x26')](respondWithFilteredResult(_0xa0796,_0x3687f5))['catch'](handleError(_0xa0796,null));};exports['removeDispositions']=function(_0x4fec82,_0x487e65,_0x40c185){return db['CmList'][_0x4427('0x49')]({'where':{'id':_0x4fec82[_0x4427('0x44')]['id']}})[_0x4427('0x26')](handleEntityNotFound(_0x487e65,null))[_0x4427('0x26')](function(_0x325fc8){if(_0x325fc8){return _0x325fc8['removeDispositions'](_0x4fec82[_0x4427('0x31')][_0x4427('0x55')]);}})[_0x4427('0x26')](respondWithStatusCode(_0x487e65,null))[_0x4427('0x42')](handleError(_0x487e65,null));};exports[_0x4427('0x56')]=function(_0x306666,_0x4660c8,_0x37ae4c){return db[_0x4427('0x2d')]['find']({'where':{'id':_0x306666['params']['id']}})[_0x4427('0x26')](handleEntityNotFound(_0x4660c8,null))['then'](function(_0x2f2728){if(_0x2f2728){var _0x16b8b2=[];var _0x8fc452={'success':[],'errors':[]};return db[_0x4427('0x57')][_0x4427('0x4e')]()[_0x4427('0x26')](function(_0x4288f3){if(_0x306666['body']['tags']&&_['isArray'](_0x306666[_0x4427('0x4d')][_0x4427('0x58')])){if(_0x306666['body'][_0x4427('0x58')]['length']){_0x306666[_0x4427('0x4d')]['tags']=_0x306666[_0x4427('0x4d')][_0x4427('0x58')][_0x4427('0x59')](';')+';';}else{_0x306666[_0x4427('0x4d')][_0x4427('0x58')]=null;}}else{_0x306666[_0x4427('0x4d')][_0x4427('0x58')]=null;}if(_0x306666['body']&&_[_0x4427('0x5a')](_0x306666[_0x4427('0x4d')])){for(var _0xdd24a7=0x0;_0xdd24a7<_0x306666[_0x4427('0x4d')][_0x4427('0x45')];_0xdd24a7+=0x1){_0x306666[_0x4427('0x4d')][_0xdd24a7][_0x4427('0x4f')]=_0x306666['params']['id'];_0x16b8b2['push'](_0x306666['body'][_0xdd24a7]);}return BPromise[_0x4427('0x5b')](_0x16b8b2,function(_0x55930b){return db['CmContact']['create'](_[_0x4427('0x5c')](_0x55930b,[_0x4427('0x55'),'id'])||{},{'fields':_[_0x4427('0x32')](_0x4288f3),'raw':!![]})['then'](function(_0xb7c3d7){_0x8fc452[_0x4427('0x5d')]['push'](_0xb7c3d7['dataValues']);})[_0x4427('0x42')](function(_0x567899){_0x8fc452[_0x4427('0x5e')][_0x4427('0x5f')]({'data':_0x55930b,'error':_0x567899['message']});});})[_0x4427('0x26')](function(_0x1f0364){return _0x8fc452;})[_0x4427('0x42')](function(_0x4e92c2){return _0x4e92c2;});}else{_0x4660c8['status'](0x190)['json']({'message':_0x4427('0x60')});}});}})['then'](respondWithResult(_0x4660c8,null))[_0x4427('0x42')](handleError(_0x4660c8,null));};exports[_0x4427('0x61')]=function(_0x2ecd87,_0x32197a,_0x14aa8c){var _0x1008be;return db[_0x4427('0x2d')][_0x4427('0x49')]({'where':{'id':_0x2ecd87['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x4427('0x62')}]})[_0x4427('0x26')](handleEntityNotFound(_0x32197a,null))[_0x4427('0x26')](function(_0xb25589){if(_0xb25589){_0x1008be=_0xb25589;return db['CmContact']['rawAttributes'];}})[_0x4427('0x26')](function(_0x4fd19a){if(_0x4fd19a){var _0x3d4ade={};var _0x36d004={};_0x36d004[_0x4427('0x30')]=_['concat'](_[_0x4427('0x32')](_0x4fd19a),_[_0x4427('0x2c')](_0x1008be[_0x4427('0x62')],function(_0xd9686f){return util[_0x4427('0x63')](_0x4427('0x64'),_0xd9686f['id']);}));_0x36d004[_0x4427('0x31')]=_[_0x4427('0x32')](_0x2ecd87['query']);_0x36d004[_0x4427('0x33')]=_[_0x4427('0x34')](_0x36d004[_0x4427('0x30')],_0x36d004[_0x4427('0x31')]);_0x3d4ade[_0x4427('0x35')]=_['intersection'](_0x36d004['model'],qs[_0x4427('0x36')](_0x2ecd87[_0x4427('0x31')][_0x4427('0x36')]));_0x3d4ade[_0x4427('0x35')]=_0x3d4ade['attributes'][_0x4427('0x45')]?_0x3d4ade[_0x4427('0x35')]:_0x36d004[_0x4427('0x30')];if(!_0x2ecd87[_0x4427('0x31')][_0x4427('0x37')](_0x4427('0x38'))){_0x3d4ade[_0x4427('0x1e')]=qs[_0x4427('0x1e')](_0x2ecd87['query'][_0x4427('0x1e')]);_0x3d4ade['offset']=qs[_0x4427('0x20')](_0x2ecd87[_0x4427('0x31')]['offset']);}_0x3d4ade[_0x4427('0x53')]=qs[_0x4427('0x39')](_0x2ecd87[_0x4427('0x31')][_0x4427('0x39')]);_0x3d4ade['where']=qs['filters'](_[_0x4427('0x54')](_0x2ecd87['query'],_0x36d004[_0x4427('0x33')]));_0x3d4ade['raw']=!![];if(_0x2ecd87['query'][_0x4427('0x3b')]){_0x3d4ade['where']=_['merge'](_0x3d4ade[_0x4427('0x3a')],{'$or':_[_0x4427('0x2c')](_0x3d4ade[_0x4427('0x35')],function(_0x2d3d1c){var _0x1d7cc8={};_0x1d7cc8[_0x2d3d1c]={'$like':'%'+_0x2ecd87[_0x4427('0x31')][_0x4427('0x3b')]+'%'};return _0x1d7cc8;})});}_0x3d4ade=_[_0x4427('0x3c')]({},_0x3d4ade,_0x2ecd87[_0x4427('0x3e')]);return _0x1008be[_0x4427('0x61')](_0x3d4ade);}})[_0x4427('0x26')](respondWithResult(_0x32197a,null))['catch'](handleError(_0x32197a,null));};exports['getContactsCsv']=function(_0x420e87,_0x351a7a,_0x31e832){var _0x292a91;return db[_0x4427('0x2d')]['find']({'where':{'id':_0x420e87['params']['id']},'include':[{'model':db[_0x4427('0x65')],'as':_0x4427('0x62')}]})[_0x4427('0x26')](handleEntityNotFound(_0x351a7a,null))['then'](function(_0x16c4bc){if(_0x16c4bc){_0x292a91=_0x16c4bc;return db[_0x4427('0x57')][_0x4427('0x2e')];}})[_0x4427('0x26')](function(_0x5f21ab){if(_0x5f21ab){var _0xdd6cb9={};var _0x2dbe9e={};_0x2dbe9e[_0x4427('0x30')]=_[_0x4427('0x66')](_[_0x4427('0x32')](_0x5f21ab),_[_0x4427('0x2c')](_0x292a91[_0x4427('0x62')],function(_0x504517){return util[_0x4427('0x63')](_0x4427('0x64'),_0x504517['id']);}));_0x2dbe9e['query']=_[_0x4427('0x32')](_0x420e87[_0x4427('0x31')]);_0x2dbe9e['filters']=_[_0x4427('0x34')](_0x2dbe9e['model'],_0x2dbe9e[_0x4427('0x31')]);_0xdd6cb9[_0x4427('0x35')]=_['intersection'](_0x2dbe9e[_0x4427('0x30')],qs[_0x4427('0x36')](_0x420e87['query'][_0x4427('0x36')]));_0xdd6cb9[_0x4427('0x35')]=_0xdd6cb9[_0x4427('0x35')][_0x4427('0x45')]?_0xdd6cb9['attributes']:_0x2dbe9e[_0x4427('0x30')];if(!_0x420e87[_0x4427('0x31')][_0x4427('0x37')](_0x4427('0x38'))){_0xdd6cb9[_0x4427('0x1e')]=qs[_0x4427('0x1e')](_0x420e87['query'][_0x4427('0x1e')]);_0xdd6cb9[_0x4427('0x20')]=qs[_0x4427('0x20')](_0x420e87[_0x4427('0x31')][_0x4427('0x20')]);}_0xdd6cb9[_0x4427('0x53')]=qs[_0x4427('0x39')](_0x420e87[_0x4427('0x31')]['sort']);_0xdd6cb9['where']=qs[_0x4427('0x33')](_['pick'](_0x420e87['query'],_0x2dbe9e['filters']));_0xdd6cb9[_0x4427('0x67')]=!![];if(_0x420e87['query']['filter']){_0xdd6cb9['where']=_[_0x4427('0x3c')](_0xdd6cb9[_0x4427('0x3a')],{'$or':_['map'](_0xdd6cb9[_0x4427('0x35')],function(_0x570d0f){var _0x3a9fbb={};_0x3a9fbb[_0x570d0f]={'$like':'%'+_0x420e87[_0x4427('0x31')][_0x4427('0x3b')]+'%'};return _0x3a9fbb;})});}_0xdd6cb9=_[_0x4427('0x3c')]({},_0xdd6cb9,_0x420e87[_0x4427('0x3e')]);return _0x292a91[_0x4427('0x61')](_0xdd6cb9);}})[_0x4427('0x26')](function(_0x36a219){if(!_[_0x4427('0x68')](_0x36a219)){var _0x48b8be=toCsv(_0x36a219);var _0x476325=Date['now']();fs['writeFileSync'](util[_0x4427('0x63')](_0x4427('0x69'),_0x292a91['id'],_0x476325),_0x48b8be);_0x351a7a['setHeader'](_0x4427('0x6a'),_0x4427('0x6b')+util[_0x4427('0x63')](_0x4427('0x6c'),_0x292a91['id'],_0x476325));_0x351a7a['setHeader'](_0x4427('0x6d'),_0x4427('0x6e'));return _0x351a7a[_0x4427('0x6f')](util[_0x4427('0x63')]('/tmp/list_%d_%s.csv',_0x292a91['id'],_0x476325));}else{return _0x351a7a[_0x4427('0x70')](0xcc);}})[_0x4427('0x42')](handleError(_0x351a7a,null));};exports[_0x4427('0x71')]=function(_0x38aa80,_0x457942,_0x197963){var _0x2bb2bd;delete _0x38aa80[_0x4427('0x4d')]['id'];return db[_0x4427('0x2d')][_0x4427('0x52')]({'where':{'id':_0x38aa80[_0x4427('0x44')]['id']}})['then'](handleEntityNotFound(_0x457942,null))[_0x4427('0x26')](function(_0x2bae0f){if(_0x2bae0f){return db[_0x4427('0x72')][_0x4427('0x73')](function(_0x3550f4){return db[_0x4427('0x65')][_0x4427('0x47')](_0x38aa80['body'],{'transaction':_0x3550f4})[_0x4427('0x26')](function(_0x173f27){_0x2bb2bd=_0x173f27;return _0x2bae0f['addCustomFields'](_0x173f27,{'transaction':_0x3550f4});})['then'](function(){var _0x4a9aeb={'type':db[_0x4427('0x74')][_0x4427('0x75')],'transaction':_0x3550f4};switch(_0x38aa80['body'][_0x4427('0x76')]){case _0x4427('0x77'):_0x4a9aeb[_0x4427('0x76')]=db[_0x4427('0x74')][_0x4427('0x75')];break;case'number':_0x4a9aeb[_0x4427('0x76')]=db[_0x4427('0x74')]['INTEGER'];break;case _0x4427('0x78'):_0x4a9aeb[_0x4427('0x76')]=db[_0x4427('0x74')]['BOOLEAN'];_0x4a9aeb[_0x4427('0x79')]=![];break;default:}return db[_0x4427('0x72')][_0x4427('0x7a')][_0x4427('0x7b')]('cm_contacts',util[_0x4427('0x63')](_0x4427('0x7c'),_0x2bb2bd['id']),_0x4a9aeb);})[_0x4427('0x26')](function(){return _0x2bb2bd;});});}})[_0x4427('0x26')](respondWithResult(_0x457942,null))[_0x4427('0x42')](handleError(_0x457942,null));};exports[_0x4427('0x7d')]=function(_0x80868e,_0x412b55,_0x1db61c){var _0x2b2b56={};var _0x3179e9={};var _0x4ae8b7;var _0x427208;return db['CmList']['findOne']({'where':{'id':_0x80868e[_0x4427('0x44')]['id']}})['then'](handleEntityNotFound(_0x412b55,null))[_0x4427('0x26')](function(_0x16b79c){if(_0x16b79c){_0x4ae8b7=_0x16b79c;_0x3179e9[_0x4427('0x30')]=_[_0x4427('0x32')](db[_0x4427('0x65')][_0x4427('0x2e')]);_0x3179e9[_0x4427('0x31')]=_[_0x4427('0x32')](_0x80868e[_0x4427('0x31')]);_0x3179e9[_0x4427('0x33')]=_[_0x4427('0x34')](_0x3179e9[_0x4427('0x30')],_0x3179e9[_0x4427('0x31')]);_0x2b2b56[_0x4427('0x35')]=_['intersection'](_0x3179e9[_0x4427('0x30')],qs[_0x4427('0x36')](_0x80868e[_0x4427('0x31')][_0x4427('0x36')]));_0x2b2b56['attributes']=_0x2b2b56[_0x4427('0x35')][_0x4427('0x45')]?_0x2b2b56['attributes']:_0x3179e9[_0x4427('0x30')];_0x2b2b56[_0x4427('0x53')]=qs[_0x4427('0x39')](_0x80868e[_0x4427('0x31')]['sort']);_0x2b2b56[_0x4427('0x3a')]=qs[_0x4427('0x33')](_[_0x4427('0x54')](_0x80868e['query'],_0x3179e9[_0x4427('0x33')]));_0x2b2b56[_0x4427('0x3a')]=_[_0x4427('0x3c')](_0x2b2b56[_0x4427('0x3a')],{'$or':[{'ListId':_0x16b79c['id']},{'ListId':null}]});if(_0x80868e[_0x4427('0x31')][_0x4427('0x3b')]){_0x2b2b56[_0x4427('0x3a')]=_[_0x4427('0x3c')](_0x2b2b56[_0x4427('0x3a')],{'$or':_[_0x4427('0x2c')](_0x2b2b56[_0x4427('0x35')],function(_0x4c4b6e){var _0x53441f={};_0x53441f[_0x4c4b6e]={'$like':'%'+_0x80868e[_0x4427('0x31')][_0x4427('0x3b')]+'%'};return _0x53441f;})});}_0x2b2b56=_['merge']({},_0x2b2b56,_0x80868e[_0x4427('0x3e')]);return db[_0x4427('0x65')]['findAndCountAll'](_0x2b2b56);}})['then'](respondWithResult(_0x412b55,null))[_0x4427('0x42')](handleError(_0x412b55,null));};exports[_0x4427('0x7e')]=function(_0x3882d5,_0x4f2720,_0x3b3f8d){return db[_0x4427('0x2d')]['find']({'where':{'id':_0x3882d5[_0x4427('0x44')]['id']}})[_0x4427('0x26')](handleEntityNotFound(_0x4f2720,null))[_0x4427('0x26')](function(_0x1ca734){if(_0x1ca734){return _0x1ca734[_0x4427('0x7e')](_0x3882d5[_0x4427('0x4d')][_0x4427('0x55')],_[_0x4427('0x5c')](_0x3882d5[_0x4427('0x4d')],[_0x4427('0x55'),'id'])||{})[_0x4427('0x7f')](function(_0x2d5164){for(var _0x47ff44=0x0;_0x47ff44<_0x3882d5[_0x4427('0x4d')][_0x4427('0x55')][_0x4427('0x45')];_0x47ff44+=0x1){socket[_0x4427('0x80')](_0x4427('0x81'),{'UserId':Number(_0x3882d5[_0x4427('0x4d')][_0x4427('0x55')][_0x47ff44]),'CmListId':Number(_0x3882d5[_0x4427('0x44')]['id'])});}return _0x2d5164;});}})[_0x4427('0x26')](respondWithResult(_0x4f2720,null))[_0x4427('0x42')](handleError(_0x4f2720,null));};exports[_0x4427('0x82')]=function(_0x574659,_0x366ddd,_0x3b1904){return db[_0x4427('0x2d')][_0x4427('0x49')]({'where':{'id':_0x574659[_0x4427('0x44')]['id']}})['then'](handleEntityNotFound(_0x366ddd,null))['then'](function(_0x3b9263){if(_0x3b9263){return _0x3b9263[_0x4427('0x82')](_0x574659['query']['ids'])['then'](function(){if(_[_0x4427('0x5a')](_0x574659['query'][_0x4427('0x55')])){for(var _0x5ef444=0x0;_0x5ef444<_0x574659[_0x4427('0x31')]['ids']['length'];_0x5ef444+=0x1){socket[_0x4427('0x80')](_0x4427('0x83'),{'UserId':Number(_0x574659[_0x4427('0x31')]['ids'][_0x5ef444]),'CmListId':Number(_0x574659[_0x4427('0x44')]['id'])});}}else{socket[_0x4427('0x80')](_0x4427('0x83'),{'UserId':Number(_0x574659[_0x4427('0x31')][_0x4427('0x55')]),'CmListId':Number(_0x574659[_0x4427('0x44')]['id'])});}});}})[_0x4427('0x26')](respondWithStatusCode(_0x366ddd,null))['catch'](handleError(_0x366ddd,null));};exports['getAgents']=function(_0x53813a,_0x6296b5,_0xecc5f0){var _0x4c9d6e={};var _0x1c92ca={};var _0x1ae55b;var _0x2cc5e8;return db['CmList'][_0x4427('0x52')]({'where':{'id':_0x53813a[_0x4427('0x44')]['id']}})[_0x4427('0x26')](handleEntityNotFound(_0x6296b5,null))['then'](function(_0x5ae058){if(_0x5ae058){_0x1ae55b=_0x5ae058;_0x1c92ca[_0x4427('0x30')]=_[_0x4427('0x32')](db[_0x4427('0x84')]['rawAttributes']);_0x1c92ca['query']=_[_0x4427('0x32')](_0x53813a[_0x4427('0x31')]);_0x1c92ca[_0x4427('0x33')]=_[_0x4427('0x34')](_0x1c92ca[_0x4427('0x30')],_0x1c92ca['query']);_0x4c9d6e[_0x4427('0x35')]=_[_0x4427('0x34')](_0x1c92ca[_0x4427('0x30')],qs[_0x4427('0x36')](_0x53813a[_0x4427('0x31')]['fields']));_0x4c9d6e[_0x4427('0x35')]=_0x4c9d6e[_0x4427('0x35')]['length']?_0x4c9d6e[_0x4427('0x35')]:_0x1c92ca[_0x4427('0x30')];_0x4c9d6e['order']=qs[_0x4427('0x39')](_0x53813a[_0x4427('0x31')][_0x4427('0x39')]);_0x4c9d6e[_0x4427('0x3a')]=qs[_0x4427('0x33')](_[_0x4427('0x54')](_0x53813a[_0x4427('0x31')],_0x1c92ca[_0x4427('0x33')]));if(_0x53813a[_0x4427('0x31')][_0x4427('0x3b')]){_0x4c9d6e[_0x4427('0x3a')]=_[_0x4427('0x3c')](_0x4c9d6e['where'],{'$or':_[_0x4427('0x2c')](_0x4c9d6e[_0x4427('0x35')],function(_0x4e25a7){var _0x59dbef={};_0x59dbef[_0x4e25a7]={'$like':'%'+_0x53813a['query'][_0x4427('0x3b')]+'%'};return _0x59dbef;})});}_0x4c9d6e=_[_0x4427('0x3c')]({},_0x4c9d6e,_0x53813a[_0x4427('0x3e')]);return _0x1ae55b[_0x4427('0x85')](_0x4c9d6e);}})['then'](function(_0x3de544){if(_0x3de544){_0x2cc5e8=_0x3de544['length'];if(!_0x53813a[_0x4427('0x31')]['hasOwnProperty'](_0x4427('0x38'))){_0x4c9d6e[_0x4427('0x1e')]=qs[_0x4427('0x1e')](_0x53813a[_0x4427('0x31')]['limit']);_0x4c9d6e[_0x4427('0x20')]=qs[_0x4427('0x20')](_0x53813a[_0x4427('0x31')][_0x4427('0x20')]);}return _0x1ae55b[_0x4427('0x85')](_0x4c9d6e);}})['then'](function(_0x345e82){if(_0x345e82){return _0x345e82?{'count':_0x2cc5e8,'rows':_0x345e82}:null;}})[_0x4427('0x26')](respondWithResult(_0x6296b5,null))[_0x4427('0x42')](handleError(_0x6296b5,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index babd627..0d70fbe 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x55c979,_0x36c5f0){_0x55c979=_0x55c979-0x0;var _0x690107=_0x5fc3[_0x55c979];return _0x690107;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x55ca,0x126));var _0xa55c=function(_0x2550ce,_0x45209b){_0x2550ce=_0x2550ce-0x0;var _0x25748d=_0x55ca[_0x2550ce];return _0x25748d;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index c7d4f30..247a799 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 _0x2750=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x338a32,_0x5937fe){var _0x18b676=function(_0x48e475){while(--_0x48e475){_0x338a32['push'](_0x338a32['shift']());}};_0x18b676(++_0x5937fe);}(_0x2750,0x13b));var _0x0275=function(_0x13c9bb,_0x4e8f6e){_0x13c9bb=_0x13c9bb-0x0;var _0x16f903=_0x2750[_0x13c9bb];return _0x16f903;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x2cb380,_0x332087){var _0x342087=function(_0x461123){while(--_0x461123){_0x2cb380['push'](_0x2cb380['shift']());}};_0x342087(++_0x332087);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 7b25c9f..30205e6 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 _0x4dbe=['info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x4dbe,0x1a8));var _0xe4db=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4dbe[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xe4db('0x0'));var util=require(_0xe4db('0x1'));var moment=require(_0xe4db('0x2'));var BPromise=require(_0xe4db('0x3'));var rs=require(_0xe4db('0x4'));var fs=require('fs');var Redis=require(_0xe4db('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4db('0x6'));var logger=require('../../config/logger')(_0xe4db('0x7'));var config=require(_0xe4db('0x8'));var jayson=require(_0xe4db('0x9'));var client=jayson[_0xe4db('0xa')][_0xe4db('0xb')]({'port':0x232a});config[_0xe4db('0xc')]=_['defaults'](config[_0xe4db('0xc')],{'host':_0xe4db('0xd'),'port':0x18eb});var socket=require(_0xe4db('0xe'))(new Redis(config[_0xe4db('0xc')]));require(_0xe4db('0xf'))[_0xe4db('0x10')](socket);function respondWithRpcPromise(_0x4c29d6,_0x1f0564,_0x54fca2){return new BPromise(function(_0x1a5865,_0x29f676){return client[_0xe4db('0x11')](_0x4c29d6,_0x54fca2)[_0xe4db('0x12')](function(_0x159802){logger['info'](_0xe4db('0x13'),_0x1f0564,'request\x20sent');logger[_0xe4db('0x14')](_0xe4db('0x15'),_0x1f0564,'request\x20sent',JSON[_0xe4db('0x16')](_0x159802));if(_0x159802['error']){if(_0x159802['error'][_0xe4db('0x17')]===0x1f4){logger[_0xe4db('0x18')](_0xe4db('0x13'),_0x1f0564,_0x159802[_0xe4db('0x18')]['message']);return _0x29f676(_0x159802[_0xe4db('0x18')][_0xe4db('0x19')]);}logger[_0xe4db('0x18')](_0xe4db('0x13'),_0x1f0564,_0x159802[_0xe4db('0x18')]['message']);return _0x1a5865(_0x159802[_0xe4db('0x18')][_0xe4db('0x19')]);}else{logger[_0xe4db('0x1a')]('CmList,\x20%s,\x20%s',_0x1f0564,_0xe4db('0x1b'));_0x1a5865(_0x159802[_0xe4db('0x1c')][_0xe4db('0x19')]);}})[_0xe4db('0x1d')](function(_0x2ef675){logger['error'](_0xe4db('0x13'),_0x1f0564,_0x2ef675);_0x29f676(_0x2ef675);});});} \ No newline at end of file +var _0xe5f2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring'];(function(_0x4e1bf6,_0x52c502){var _0x2a09f3=function(_0x1de681){while(--_0x1de681){_0x4e1bf6['push'](_0x4e1bf6['shift']());}};_0x2a09f3(++_0x52c502);}(_0xe5f2,0x185));var _0x2e5f=function(_0x446107,_0x586669){_0x446107=_0x446107-0x0;var _0x37c302=_0xe5f2[_0x446107];return _0x37c302;};'use strict';var _=require(_0x2e5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2e5f('0x1'));var rs=require(_0x2e5f('0x2'));var fs=require('fs');var Redis=require(_0x2e5f('0x3'));var db=require(_0x2e5f('0x4'))['db'];var utils=require(_0x2e5f('0x5'));var logger=require(_0x2e5f('0x6'))(_0x2e5f('0x7'));var config=require(_0x2e5f('0x8'));var jayson=require(_0x2e5f('0x9'));var client=jayson[_0x2e5f('0xa')][_0x2e5f('0xb')]({'port':0x232a});config[_0x2e5f('0xc')]=_['defaults'](config[_0x2e5f('0xc')],{'host':_0x2e5f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e5f('0xc')]));require(_0x2e5f('0xe'))[_0x2e5f('0xf')](socket);function respondWithRpcPromise(_0x244112,_0x1c0316,_0xdb9967){return new BPromise(function(_0x7de599,_0x1888a0){return client[_0x2e5f('0x10')](_0x244112,_0xdb9967)[_0x2e5f('0x11')](function(_0x22e8c7){logger['info'](_0x2e5f('0x12'),_0x1c0316,_0x2e5f('0x13'));logger[_0x2e5f('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x1c0316,_0x2e5f('0x13'),JSON[_0x2e5f('0x15')](_0x22e8c7));if(_0x22e8c7[_0x2e5f('0x16')]){if(_0x22e8c7['error'][_0x2e5f('0x17')]===0x1f4){logger[_0x2e5f('0x16')]('CmList,\x20%s,\x20%s',_0x1c0316,_0x22e8c7[_0x2e5f('0x16')]['message']);return _0x1888a0(_0x22e8c7[_0x2e5f('0x16')][_0x2e5f('0x18')]);}logger[_0x2e5f('0x16')](_0x2e5f('0x12'),_0x1c0316,_0x22e8c7[_0x2e5f('0x16')][_0x2e5f('0x18')]);return _0x7de599(_0x22e8c7[_0x2e5f('0x16')][_0x2e5f('0x18')]);}else{logger[_0x2e5f('0x19')](_0x2e5f('0x12'),_0x1c0316,_0x2e5f('0x13'));_0x7de599(_0x22e8c7[_0x2e5f('0x1a')][_0x2e5f('0x18')]);}})[_0x2e5f('0x1b')](function(_0x36b042){logger['error'](_0x2e5f('0x12'),_0x1c0316,_0x36b042);_0x1888a0(_0x36b042);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f603e73..3dec51f 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 _0xc626=['save','remove','register','length','cmList:'];(function(_0x344d27,_0x562e14){var _0x53e3ee=function(_0x218170){while(--_0x218170){_0x344d27['push'](_0x344d27['shift']());}};_0x53e3ee(++_0x562e14);}(_0xc626,0x91));var _0x6c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc626[_0x3dd15e];return _0x231fd0;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x6c62('0x0'),_0x6c62('0x1'),'update'];function createListener(_0x530bc2,_0x526e50){return function(_0x679558){_0x526e50['emit'](_0x530bc2,_0x679558);};}function removeListener(_0x482a25,_0xbbbe54){return function(){CmListEvents['removeListener'](_0x482a25,_0xbbbe54);};}exports[_0x6c62('0x2')]=function(_0x4b89f7){for(var _0x205d0c=0x0,_0x2496f0=events[_0x6c62('0x3')];_0x205d0c<_0x2496f0;_0x205d0c++){var _0x4e30ef=events[_0x205d0c];var _0x5c733b=createListener(_0x6c62('0x4')+_0x4e30ef,_0x4b89f7);CmListEvents['on'](_0x4e30ef,_0x5c733b);}}; \ No newline at end of file +var _0xf1e3=['save','update','emit','removeListener','length','cmList:','./cmList.events'];(function(_0x4c1dd4,_0x209141){var _0x29aaf2=function(_0xde5263){while(--_0xde5263){_0x4c1dd4['push'](_0x4c1dd4['shift']());}};_0x29aaf2(++_0x209141);}(_0xf1e3,0x102));var _0x3f1e=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xf1e3[_0x59d89e];return _0x554e93;};'use strict';var CmListEvents=require(_0x3f1e('0x0'));var events=[_0x3f1e('0x1'),'remove',_0x3f1e('0x2')];function createListener(_0x4e13c,_0x452c7){return function(_0x17394c){_0x452c7[_0x3f1e('0x3')](_0x4e13c,_0x17394c);};}function removeListener(_0x237c55,_0x10329d){return function(){CmListEvents[_0x3f1e('0x4')](_0x237c55,_0x10329d);};}exports['register']=function(_0x54641c){for(var _0x538a13=0x0,_0x306685=events[_0x3f1e('0x5')];_0x538a13<_0x306685;_0x538a13++){var _0x45c293=events[_0x538a13];var _0x4c4d56=createListener(_0x3f1e('0x6')+_0x45c293,_0x54641c);CmListEvents['on'](_0x45c293,_0x4c4d56);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 1812709..e629651 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 _0x472a=['show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','addDisposition','addContacts','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5eb1a8,_0x30e664){var _0x14c11c=function(_0x5f2ea5){while(--_0x5f2ea5){_0x5eb1a8['push'](_0x5eb1a8['shift']());}};_0x14c11c(++_0x30e664);}(_0x472a,0x185));var _0xa472=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x472a[_0x382c73];return _0x1dd0bf;};'use strict';var multer=require(_0xa472('0x0'));var util=require(_0xa472('0x1'));var path=require(_0xa472('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa472('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa472('0x4'));var interaction=require(_0xa472('0x5'));var config=require(_0xa472('0x6'));var controller=require(_0xa472('0x7'));router[_0xa472('0x8')]('/',auth[_0xa472('0x9')](),controller[_0xa472('0xa')]);router[_0xa472('0x8')](_0xa472('0xb'),auth[_0xa472('0x9')](),controller[_0xa472('0xc')]);router[_0xa472('0x8')](_0xa472('0xd'),auth['isAuthenticated'](),controller[_0xa472('0xe')]);router[_0xa472('0x8')](_0xa472('0xf'),auth['isAuthenticated'](),controller[_0xa472('0x10')]);router[_0xa472('0x8')](_0xa472('0x11'),auth[_0xa472('0x9')](),controller[_0xa472('0x12')]);router['get'](_0xa472('0x13'),auth[_0xa472('0x9')](),controller[_0xa472('0x14')]);router[_0xa472('0x8')](_0xa472('0x15'),auth['isAuthenticated'](),controller['getCustomFields']);router['get'](_0xa472('0x16'),auth['isAuthenticated'](),controller[_0xa472('0x17')]);router[_0xa472('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa472('0x18')](_0xa472('0xf'),auth[_0xa472('0x9')](),controller[_0xa472('0x19')]);router[_0xa472('0x18')]('/:id/contacts',auth[_0xa472('0x9')](),controller[_0xa472('0x1a')]);router['post'](_0xa472('0x15'),auth[_0xa472('0x9')](),controller['addCustomField']);router[_0xa472('0x18')](_0xa472('0x16'),auth[_0xa472('0x9')](),controller['addAgents']);router[_0xa472('0x1b')](_0xa472('0xd'),auth['isAuthenticated'](),controller[_0xa472('0x1c')]);router['delete']('/:id',auth[_0xa472('0x9')](),controller['destroy']);router[_0xa472('0x1d')](_0xa472('0xf'),auth[_0xa472('0x9')](),controller['removeDispositions']);router[_0xa472('0x1d')](_0xa472('0x16'),auth[_0xa472('0x9')](),controller['removeAgents']);module[_0xa472('0x1e')]=router; \ No newline at end of file +var _0x0853=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','describe','isAuthenticated','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','/:id/contacts','addContacts','addAgents','put','/:id','update','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0x0853,0x1aa));var _0x3085=function(_0x46a225,_0x4c4f5a){_0x46a225=_0x46a225-0x0;var _0x1ed1c2=_0x0853[_0x46a225];return _0x1ed1c2;};'use strict';var multer=require(_0x3085('0x0'));var util=require('util');var path=require(_0x3085('0x1'));var timeout=require(_0x3085('0x2'));var express=require(_0x3085('0x3'));var router=express[_0x3085('0x4')]();var fs_extra=require(_0x3085('0x5'));var auth=require(_0x3085('0x6'));var interaction=require(_0x3085('0x7'));var config=require(_0x3085('0x8'));var controller=require(_0x3085('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3085('0xa')]);router[_0x3085('0xb')](_0x3085('0xc'),auth['isAuthenticated'](),controller[_0x3085('0xd')]);router[_0x3085('0xb')]('/:id',auth[_0x3085('0xe')](),controller[_0x3085('0xf')]);router[_0x3085('0xb')](_0x3085('0x10'),auth[_0x3085('0xe')](),controller['getDispositions']);router[_0x3085('0xb')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x3085('0x11')]);router[_0x3085('0xb')](_0x3085('0x12'),auth[_0x3085('0xe')](),controller[_0x3085('0x13')]);router[_0x3085('0xb')](_0x3085('0x14'),auth[_0x3085('0xe')](),controller[_0x3085('0x15')]);router[_0x3085('0xb')](_0x3085('0x16'),auth[_0x3085('0xe')](),controller['getAgents']);router[_0x3085('0x17')]('/',auth[_0x3085('0xe')](),controller[_0x3085('0x18')]);router[_0x3085('0x17')]('/:id/dispositions',auth[_0x3085('0xe')](),controller[_0x3085('0x19')]);router[_0x3085('0x17')](_0x3085('0x1a'),auth['isAuthenticated'](),controller[_0x3085('0x1b')]);router[_0x3085('0x17')](_0x3085('0x14'),auth[_0x3085('0xe')](),controller['addCustomField']);router[_0x3085('0x17')](_0x3085('0x16'),auth['isAuthenticated'](),controller[_0x3085('0x1c')]);router[_0x3085('0x1d')](_0x3085('0x1e'),auth['isAuthenticated'](),controller[_0x3085('0x1f')]);router[_0x3085('0x20')]('/:id',auth[_0x3085('0xe')](),controller['destroy']);router[_0x3085('0x20')](_0x3085('0x10'),auth['isAuthenticated'](),controller[_0x3085('0x21')]);router['delete'](_0x3085('0x16'),auth[_0x3085('0xe')](),controller[_0x3085('0x22')]);module[_0x3085('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 2d3954b..45e32b4 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 _0xd0b5=['field','STRING'];(function(_0x2fd0d1,_0x468b85){var _0x1adc68=function(_0x5d59ac){while(--_0x5d59ac){_0x2fd0d1['push'](_0x2fd0d1['shift']());}};_0x1adc68(++_0x468b85);}(_0xd0b5,0x1d6));var _0x5d0b=function(_0x58f2f6,_0x5002a6){_0x58f2f6=_0x58f2f6-0x0;var _0x3dbfed=_0xd0b5[_0x58f2f6];return _0x3dbfed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3e479b){return this['getDataValue'](_0x5d0b('0x0'));}},'field':{'type':Sequelize[_0x5d0b('0x1')],'allowNull':![]},'operator':{'type':Sequelize[_0x5d0b('0x1')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5f43=['sequelize','STRING'];(function(_0x2cbd9d,_0x1fbbb3){var _0x48290f=function(_0x22ded1){while(--_0x22ded1){_0x2cbd9d['push'](_0x2cbd9d['shift']());}};_0x48290f(++_0x1fbbb3);}(_0x5f43,0x1ce));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x35f4('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3540c6){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x35f4('0x1')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x35f4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index e869412..7d22cef 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4eff4f,_0xc8ec38){var _0xd95e99=function(_0xfb850){while(--_0xfb850){_0x4eff4f['push'](_0x4eff4f['shift']());}};_0xd95e99(++_0xc8ec38);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2552e6,_0x13676b){var _0x21d950=function(_0x4a4237){while(--_0x4a4237){_0x2552e6['push'](_0x2552e6['shift']());}};_0x21d950(++_0x13676b);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 1cec145..32d108c 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 _0x69c1=['./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3bdf99,_0x3399c1){var _0x4ab791=function(_0x54a15f){while(--_0x54a15f){_0x3bdf99['push'](_0x3bdf99['shift']());}};_0x4ab791(++_0x3399c1);}(_0x69c1,0xef));var _0x169c=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0x69c1[_0x9db5d3];return _0x477a81;};'use strict';var _=require('lodash');var util=require(_0x169c('0x0'));var logger=require(_0x169c('0x1'))(_0x169c('0x2'));var moment=require(_0x169c('0x3'));var BPromise=require(_0x169c('0x4'));var rp=require(_0x169c('0x5'));var fs=require('fs');var path=require(_0x169c('0x6'));var rimraf=require(_0x169c('0x7'));var config=require('../../config/environment');var attributes=require(_0x169c('0x8'));module[_0x169c('0x9')]=function(_0x36ce3a,_0xc18f27){return _0x36ce3a[_0x169c('0xa')](_0x169c('0xb'),attributes,{'tableName':_0x169c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37ae=['path','rimraf','./condition.attributes','exports','define','Condition','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4602e4,_0x378ee6){var _0x425e18=function(_0x328524){while(--_0x328524){_0x4602e4['push'](_0x4602e4['shift']());}};_0x425e18(++_0x378ee6);}(_0x37ae,0xd2));var _0xe37a=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x37ae[_0x207811];return _0x170d56;};'use strict';var _=require(_0xe37a('0x0'));var util=require(_0xe37a('0x1'));var logger=require(_0xe37a('0x2'))(_0xe37a('0x3'));var moment=require(_0xe37a('0x4'));var BPromise=require('bluebird');var rp=require(_0xe37a('0x5'));var fs=require('fs');var path=require(_0xe37a('0x6'));var rimraf=require(_0xe37a('0x7'));var config=require('../../config/environment');var attributes=require(_0xe37a('0x8'));module[_0xe37a('0x9')]=function(_0xd4a806,_0x353dae){return _0xd4a806[_0xe37a('0xa')](_0xe37a('0xb'),attributes,{'tableName':'tools_conditions','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 ed1e4d7..dafa6a9 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 _0x4887=['lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x2a36e6,_0x250137){var _0x438728=function(_0x3598c6){while(--_0x3598c6){_0x2a36e6['push'](_0x2a36e6['shift']());}};_0x438728(++_0x250137);}(_0x4887,0x1e6));var _0x7488=function(_0x1ff25c,_0x5427c1){_0x1ff25c=_0x1ff25c-0x0;var _0x533c53=_0x4887[_0x1ff25c];return _0x533c53;};'use strict';var _=require(_0x7488('0x0'));var util=require(_0x7488('0x1'));var moment=require(_0x7488('0x2'));var BPromise=require(_0x7488('0x3'));var rs=require(_0x7488('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7488('0x5'))(_0x7488('0x6'));var config=require('../../config/environment');var jayson=require(_0x7488('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2615a5,_0x38a45d,_0xb3bcc1){return new BPromise(function(_0x4e9271,_0x284b65){return client[_0x7488('0x8')](_0x2615a5,_0xb3bcc1)[_0x7488('0x9')](function(_0x99c906){logger[_0x7488('0xa')](_0x7488('0xb'),_0x38a45d,_0x7488('0xc'));logger[_0x7488('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x38a45d,_0x7488('0xc'),JSON['stringify'](_0x99c906));if(_0x99c906['error']){if(_0x99c906[_0x7488('0xe')]['code']===0x1f4){logger[_0x7488('0xe')](_0x7488('0xb'),_0x38a45d,_0x99c906['error'][_0x7488('0xf')]);return _0x284b65(_0x99c906[_0x7488('0xe')][_0x7488('0xf')]);}logger[_0x7488('0xe')](_0x7488('0xb'),_0x38a45d,_0x99c906[_0x7488('0xe')]['message']);return _0x4e9271(_0x99c906[_0x7488('0xe')][_0x7488('0xf')]);}else{logger[_0x7488('0xa')](_0x7488('0xb'),_0x38a45d,_0x7488('0xc'));_0x4e9271(_0x99c906[_0x7488('0x10')]['message']);}})[_0x7488('0x11')](function(_0x5c1cb8){logger[_0x7488('0xe')]('Condition,\x20%s,\x20%s',_0x38a45d,_0x5c1cb8);_0x284b65(_0x5c1cb8);});});} \ No newline at end of file +var _0x4868=['stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0x4868,0x12b));var _0x8486=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4868[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8486('0x0'));var util=require(_0x8486('0x1'));var moment=require(_0x8486('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8486('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8486('0x4'));var logger=require(_0x8486('0x5'))(_0x8486('0x6'));var config=require(_0x8486('0x7'));var jayson=require(_0x8486('0x8'));var client=jayson[_0x8486('0x9')][_0x8486('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50c473,_0x390e8c,_0x1dfde3){return new BPromise(function(_0x893bc2,_0x503674){return client['request'](_0x50c473,_0x1dfde3)[_0x8486('0xb')](function(_0x5ebbfb){logger[_0x8486('0xc')](_0x8486('0xd'),_0x390e8c,'request\x20sent');logger[_0x8486('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x390e8c,_0x8486('0xf'),JSON[_0x8486('0x10')](_0x5ebbfb));if(_0x5ebbfb['error']){if(_0x5ebbfb[_0x8486('0x11')]['code']===0x1f4){logger[_0x8486('0x11')](_0x8486('0xd'),_0x390e8c,_0x5ebbfb[_0x8486('0x11')][_0x8486('0x12')]);return _0x503674(_0x5ebbfb[_0x8486('0x11')][_0x8486('0x12')]);}logger[_0x8486('0x11')](_0x8486('0xd'),_0x390e8c,_0x5ebbfb['error'][_0x8486('0x12')]);return _0x893bc2(_0x5ebbfb[_0x8486('0x11')]['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0x390e8c,_0x8486('0xf'));_0x893bc2(_0x5ebbfb[_0x8486('0x13')][_0x8486('0x12')]);}})[_0x8486('0x14')](function(_0xf2c01d){logger[_0x8486('0x11')](_0x8486('0xd'),_0x390e8c,_0xf2c01d);_0x503674(_0xf2c01d);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5fcae5c..32f45a4 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 _0xcfdd=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','destroy'];(function(_0x1d2bfd,_0x4621fb){var _0x4d94c7=function(_0x168631){while(--_0x168631){_0x1d2bfd['push'](_0x1d2bfd['shift']());}};_0x4d94c7(++_0x4621fb);}(_0xcfdd,0x189));var _0xdcfd=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0xcfdd[_0x578275];return _0xf78041;};'use strict';var multer=require(_0xdcfd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdcfd('0x1'));var express=require(_0xdcfd('0x2'));var router=express[_0xdcfd('0x3')]();var fs_extra=require(_0xdcfd('0x4'));var auth=require(_0xdcfd('0x5'));var interaction=require(_0xdcfd('0x6'));var config=require(_0xdcfd('0x7'));var controller=require('./condition.controller');router['put'](_0xdcfd('0x8'),auth[_0xdcfd('0x9')](),controller[_0xdcfd('0xa')]);router[_0xdcfd('0xb')](_0xdcfd('0x8'),auth[_0xdcfd('0x9')](),controller[_0xdcfd('0xc')]);module[_0xdcfd('0xd')]=router; \ No newline at end of file +var _0x472a=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy'];(function(_0x130a8d,_0x5dada7){var _0x180395=function(_0x500c93){while(--_0x500c93){_0x130a8d['push'](_0x130a8d['shift']());}};_0x180395(++_0x5dada7);}(_0x472a,0x197));var _0xa472=function(_0x610f42,_0x1d06ac){_0x610f42=_0x610f42-0x0;var _0x458e75=_0x472a[_0x610f42];return _0x458e75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa472('0x0'));var timeout=require(_0xa472('0x1'));var express=require(_0xa472('0x2'));var router=express[_0xa472('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa472('0x4'));var interaction=require(_0xa472('0x5'));var config=require(_0xa472('0x6'));var controller=require(_0xa472('0x7'));router['put'](_0xa472('0x8'),auth[_0xa472('0x9')](),controller[_0xa472('0xa')]);router[_0xa472('0xb')]('/:id',auth[_0xa472('0x9')](),controller[_0xa472('0xc')]);module[_0xa472('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index ee0a9b4..1b250d3 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 _0xb10b=['name','sequelize','STRING'];(function(_0x15a0c8,_0x2a519f){var _0x3cc63b=function(_0x717a62){while(--_0x717a62){_0x15a0c8['push'](_0x15a0c8['shift']());}};_0x3cc63b(++_0x2a519f);}(_0xb10b,0x12a));var _0xbb10=function(_0x148acb,_0x2694f7){_0x148acb=_0x148acb-0x0;var _0x3b9378=_0xb10b[_0x148acb];return _0x3b9378;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0xfc5b47,_0x2ec02d){var _0x17b3c0=function(_0x49b956){while(--_0x49b956){_0xfc5b47['push'](_0xfc5b47['shift']());}};_0x17b3c0(++_0x2ec02d);}(_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/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6c546f0..38f0e60 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 _0xb418=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','send','index','Dashboard','rawAttributes','fieldName','type','model','query','keys','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','rows','intersection','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','body','updatedAt','autoAssociation','iframe','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','order','getItems','length','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x59a2be,_0x4624b8){var _0x5a56a3=function(_0x3bf684){while(--_0x3bf684){_0x59a2be['push'](_0x59a2be['shift']());}};_0x5a56a3(++_0x4624b8);}(_0xb418,0x1df));var _0x8b41=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xb418[_0x5834bc];return _0x3e183a;};'use strict';var emlformat=require(_0x8b41('0x0'));var rimraf=require(_0x8b41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b41('0x2'));var rp=require(_0x8b41('0x3'));var moment=require('moment');var BPromise=require(_0x8b41('0x4'));var Mustache=require(_0x8b41('0x5'));var util=require(_0x8b41('0x6'));var path=require(_0x8b41('0x7'));var sox=require(_0x8b41('0x8'));var csv=require(_0x8b41('0x9'));var ejs=require(_0x8b41('0xa'));var fs=require('fs');var fs_extra=require(_0x8b41('0xb'));var _=require(_0x8b41('0xc'));var squel=require(_0x8b41('0xd'));var crypto=require('crypto');var jsforce=require(_0x8b41('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b41('0x9'));var querystring=require(_0x8b41('0xf'));var Papa=require('papaparse');var Redis=require(_0x8b41('0x10'));var authService=require(_0x8b41('0x11'));var qs=require(_0x8b41('0x12'));var as=require(_0x8b41('0x13'));var hardwareService=require(_0x8b41('0x14'));var logger=require(_0x8b41('0x15'))('api');var utils=require(_0x8b41('0x16'));var config=require(_0x8b41('0x17'));var licenseUtil=require(_0x8b41('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8b41('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b41('0x1a')]));require(_0x8b41('0x1b'))['register'](socket);function respondWithStatusCode(_0x7789ac,_0x379bb2){_0x379bb2=_0x379bb2||0xcc;return function(_0x429cb7){if(_0x429cb7){return _0x7789ac[_0x8b41('0x1c')](_0x379bb2);}return _0x7789ac[_0x8b41('0x1d')](_0x379bb2)[_0x8b41('0x1e')]();};}function respondWithResult(_0x5d2a7b,_0x21c202){_0x21c202=_0x21c202||0xc8;return function(_0x1161fc){if(_0x1161fc){return _0x5d2a7b[_0x8b41('0x1d')](_0x21c202)[_0x8b41('0x1f')](_0x1161fc);}};}function respondWithFilteredResult(_0x491a77,_0x9be0cf){return function(_0x11a951){if(_0x11a951){var _0xbf01fb=typeof _0x9be0cf[_0x8b41('0x20')]===_0x8b41('0x21')&&typeof _0x9be0cf[_0x8b41('0x22')]===_0x8b41('0x21');var _0x24778c=_0x11a951[_0x8b41('0x23')];var _0x15801e=_0xbf01fb?0x0:_0x9be0cf[_0x8b41('0x20')];var _0x441918=_0xbf01fb?_0x11a951[_0x8b41('0x23')]:_0x9be0cf['offset']+_0x9be0cf[_0x8b41('0x22')];var _0x345b03;if(_0x441918>=_0x24778c){_0x441918=_0x24778c;_0x345b03=0xc8;}else{_0x345b03=0xce;}_0x491a77[_0x8b41('0x1d')](_0x345b03);return _0x491a77[_0x8b41('0x24')](_0x8b41('0x25'),_0x15801e+'-'+_0x441918+'/'+_0x24778c)[_0x8b41('0x1f')](_0x11a951);}return null;};}function patchUpdates(_0x4c773f){return function(_0x22fe3d){try{jsonpatch['apply'](_0x22fe3d,_0x4c773f,!![]);}catch(_0x4abcd9){return BPromise[_0x8b41('0x26')](_0x4abcd9);}return _0x22fe3d[_0x8b41('0x27')]();};}function saveUpdates(_0x2db0fb,_0x4e28fe){return function(_0xcea62f){if(_0xcea62f){return _0xcea62f[_0x8b41('0x28')](_0x2db0fb)[_0x8b41('0x29')](function(_0x128c3a){return _0x128c3a;});}return null;};}function removeEntity(_0x51f793,_0x463894){return function(_0x528223){if(_0x528223){return _0x528223[_0x8b41('0x2a')]()['then'](function(){var _0x1cf38c=_0x528223[_0x8b41('0x2b')]({'plain':!![]});var _0x3233f6=_0x8b41('0x2c');return db[_0x8b41('0x2d')][_0x8b41('0x2a')]({'where':{'type':_0x3233f6,'resourceId':_0x1cf38c['id']}})['then'](function(){return _0x528223;});})[_0x8b41('0x29')](function(){_0x51f793[_0x8b41('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x506993,_0x1e8c69){return function(_0x556b5c){if(!_0x556b5c){_0x506993[_0x8b41('0x1c')](0x194);}return _0x556b5c;};}function handleError(_0x7194f4,_0x57f6e6){_0x57f6e6=_0x57f6e6||0x1f4;return function(_0x3a26e5){logger[_0x8b41('0x2e')](_0x3a26e5['stack']);if(_0x3a26e5[_0x8b41('0x2f')]){delete _0x3a26e5[_0x8b41('0x2f')];}_0x7194f4[_0x8b41('0x1d')](_0x57f6e6)[_0x8b41('0x30')](_0x3a26e5);};}exports[_0x8b41('0x31')]=function(_0x329f60,_0x385f7b){var _0x2ffa27={},_0x1cd663={},_0x7e3bcd={'count':0x0,'rows':[]};var _0x2a273f=_['map'](db[_0x8b41('0x32')][_0x8b41('0x33')],function(_0x2e6b97){return{'name':_0x2e6b97[_0x8b41('0x34')],'type':_0x2e6b97[_0x8b41('0x35')]['key']};});_0x1cd663[_0x8b41('0x36')]=_['map'](_0x2a273f,_0x8b41('0x2f'));_0x1cd663[_0x8b41('0x37')]=_[_0x8b41('0x38')](_0x329f60[_0x8b41('0x37')]);_0x1cd663['filters']=_['intersection'](_0x1cd663[_0x8b41('0x36')],_0x1cd663[_0x8b41('0x37')]);_0x2ffa27[_0x8b41('0x39')]=_['intersection'](_0x1cd663[_0x8b41('0x36')],qs['fields'](_0x329f60['query'][_0x8b41('0x3a')]));_0x2ffa27[_0x8b41('0x39')]=_0x2ffa27['attributes']['length']?_0x2ffa27['attributes']:_0x1cd663[_0x8b41('0x36')];if(!_0x329f60[_0x8b41('0x37')][_0x8b41('0x3b')](_0x8b41('0x3c'))){_0x2ffa27[_0x8b41('0x22')]=qs[_0x8b41('0x22')](_0x329f60[_0x8b41('0x37')][_0x8b41('0x22')]);_0x2ffa27[_0x8b41('0x20')]=qs[_0x8b41('0x20')](_0x329f60[_0x8b41('0x37')][_0x8b41('0x20')]);}_0x2ffa27['order']=qs[_0x8b41('0x3d')](_0x329f60[_0x8b41('0x37')][_0x8b41('0x3d')]);_0x2ffa27[_0x8b41('0x3e')]=qs[_0x8b41('0x3f')](_[_0x8b41('0x40')](_0x329f60[_0x8b41('0x37')],_0x1cd663[_0x8b41('0x3f')]),_0x2a273f);if(_0x329f60[_0x8b41('0x37')][_0x8b41('0x41')]){_0x2ffa27[_0x8b41('0x3e')]=_['merge'](_0x2ffa27['where'],{'$or':_[_0x8b41('0x42')](_0x2a273f,function(_0x2a98b5){if(_0x2a98b5[_0x8b41('0x35')]!=='VIRTUAL'){var _0x5a6a43={};_0x5a6a43[_0x2a98b5['name']]={'$like':'%'+_0x329f60[_0x8b41('0x37')][_0x8b41('0x41')]+'%'};return _0x5a6a43;}})});}_0x2ffa27=_[_0x8b41('0x43')]({},_0x2ffa27,_0x329f60['options']);var _0x280bb9={'where':_0x2ffa27[_0x8b41('0x3e')]};return db[_0x8b41('0x32')][_0x8b41('0x23')](_0x280bb9)['then'](function(_0x4b2210){_0x7e3bcd[_0x8b41('0x23')]=_0x4b2210;if(_0x329f60[_0x8b41('0x37')][_0x8b41('0x44')]){_0x2ffa27[_0x8b41('0x45')]=[{'all':!![]}];}return db[_0x8b41('0x32')][_0x8b41('0x46')](_0x2ffa27);})[_0x8b41('0x29')](function(_0xa5a095){_0x7e3bcd[_0x8b41('0x47')]=_0xa5a095;return _0x7e3bcd;})['then'](respondWithFilteredResult(_0x385f7b,_0x2ffa27))['catch'](handleError(_0x385f7b,null));};exports['show']=function(_0x2ac377,_0x4187e4){var _0x4f0fd1={'raw':![],'where':{'id':_0x2ac377['params']['id']}},_0x344c41={};_0x344c41['model']=_[_0x8b41('0x38')](db[_0x8b41('0x32')]['rawAttributes']);_0x344c41[_0x8b41('0x37')]=_[_0x8b41('0x38')](_0x2ac377['query']);_0x344c41[_0x8b41('0x3f')]=_[_0x8b41('0x48')](_0x344c41['model'],_0x344c41[_0x8b41('0x37')]);_0x4f0fd1[_0x8b41('0x39')]=_['intersection'](_0x344c41[_0x8b41('0x36')],qs[_0x8b41('0x3a')](_0x2ac377['query']['fields']));_0x4f0fd1[_0x8b41('0x39')]=_0x4f0fd1['attributes']['length']?_0x4f0fd1[_0x8b41('0x39')]:_0x344c41['model'];if(_0x2ac377[_0x8b41('0x37')][_0x8b41('0x44')]){_0x4f0fd1[_0x8b41('0x45')]=[{'all':!![]}];}_0x4f0fd1=_[_0x8b41('0x43')]({},_0x4f0fd1,_0x2ac377[_0x8b41('0x49')]);return db[_0x8b41('0x32')][_0x8b41('0x4a')](_0x4f0fd1)[_0x8b41('0x29')](handleEntityNotFound(_0x4187e4,null))[_0x8b41('0x29')](respondWithResult(_0x4187e4,null))[_0x8b41('0x4b')](handleError(_0x4187e4,null));};exports[_0x8b41('0x4c')]=function(_0x293fde,_0x2d4a4d){return db[_0x8b41('0x32')][_0x8b41('0x4c')](_0x293fde['body'],{})[_0x8b41('0x29')](function(_0x2ec908){var _0x4bae16=_0x293fde[_0x8b41('0x4d')][_0x8b41('0x2b')]({'plain':!![]});if(!_0x4bae16)throw new Error(_0x8b41('0x4e'));if(_0x4bae16[_0x8b41('0x4f')]==='user'){var _0x4be62f=_0x2ec908[_0x8b41('0x2b')]({'plain':!![]});var _0x21c984=_0x8b41('0x2c');return db[_0x8b41('0x50')][_0x8b41('0x4a')]({'where':{'name':_0x21c984,'userProfileId':_0x4bae16[_0x8b41('0x51')]},'raw':!![]})[_0x8b41('0x29')](function(_0x33d5fa){if(_0x33d5fa&&_0x33d5fa['autoAssociation']===0x0){return db[_0x8b41('0x2d')][_0x8b41('0x4c')]({'name':_0x4be62f[_0x8b41('0x2f')],'resourceId':_0x4be62f['id'],'type':_0x33d5fa[_0x8b41('0x2f')],'sectionId':_0x33d5fa['id']},{})[_0x8b41('0x29')](function(){return _0x2ec908;});}else{return _0x2ec908;}})['catch'](function(_0x5abc30){logger[_0x8b41('0x2e')](_0x8b41('0x52'),_0x5abc30);throw _0x5abc30;});}return _0x2ec908;})[_0x8b41('0x29')](respondWithResult(_0x2d4a4d,0xc9))['catch'](handleError(_0x2d4a4d,null));};exports[_0x8b41('0x53')]=function(_0x1c8fdb,_0x387897){var _0x4bc44b={'where':{'id':_0x1c8fdb[_0x8b41('0x54')]['id']}},_0x425dab={};_0x425dab['model']=_['keys'](db[_0x8b41('0x32')][_0x8b41('0x33')]);_0x4bc44b[_0x8b41('0x39')]=_['intersection'](_0x425dab[_0x8b41('0x36')],qs[_0x8b41('0x3a')](_0x1c8fdb[_0x8b41('0x37')][_0x8b41('0x3a')]));_0x4bc44b['attributes']=_0x4bc44b[_0x8b41('0x39')]['length']?_0x4bc44b[_0x8b41('0x39')]:_0x425dab[_0x8b41('0x36')];if(_0x1c8fdb[_0x8b41('0x37')][_0x8b41('0x44')]){_0x4bc44b[_0x8b41('0x45')]=[{'all':!![]}];}_0x4bc44b=_[_0x8b41('0x43')]({},_0x4bc44b,_0x1c8fdb['options']);return db[_0x8b41('0x32')][_0x8b41('0x4a')](_0x4bc44b)[_0x8b41('0x29')](handleEntityNotFound(_0x387897,null))[_0x8b41('0x29')](function(_0x460022){if(_0x460022){var _0x3f2b99=_0x460022[_0x8b41('0x2b')]({'plain':!![]});_0x3f2b99=qs[_0x8b41('0x55')](_0x3f2b99,['id',_0x8b41('0x56'),'updatedAt']);_0x1c8fdb['body']=_[_0x8b41('0x55')](_0x1c8fdb[_0x8b41('0x57')],['id',_0x8b41('0x56'),_0x8b41('0x58')]);return db['Dashboard'][_0x8b41('0x4c')](_[_0x8b41('0x43')](_0x3f2b99,_0x1c8fdb['body']),{'include':_0x1c8fdb[_0x8b41('0x37')][_0x8b41('0x44')]?[{'all':!![]}]:undefined})[_0x8b41('0x29')](function(_0x345355){var _0x38df8f=_0x1c8fdb['user'][_0x8b41('0x2b')]({'plain':!![]});if(!_0x38df8f)throw new Error(_0x8b41('0x4e'));if(_0x38df8f[_0x8b41('0x4f')]===_0x8b41('0x4d')){var _0x3aa0ba=_0x345355[_0x8b41('0x2b')]({'plain':!![]});var _0x38aff4=_0x8b41('0x2c');return db['UserProfileSection'][_0x8b41('0x4a')]({'where':{'name':_0x38aff4,'userProfileId':_0x38df8f[_0x8b41('0x51')]},'raw':!![]})[_0x8b41('0x29')](function(_0x55c0db){if(_0x55c0db&&_0x55c0db[_0x8b41('0x59')]===0x0){return db['UserProfileResource'][_0x8b41('0x4c')]({'name':_0x3aa0ba[_0x8b41('0x2f')],'resourceId':_0x3aa0ba['id'],'type':_0x55c0db[_0x8b41('0x2f')],'sectionId':_0x55c0db['id']},{})[_0x8b41('0x29')](function(){return _0x345355;});}else{return _0x345355;}})[_0x8b41('0x4b')](function(_0x1a8fb7){logger[_0x8b41('0x2e')](_0x8b41('0x52'),_0x1a8fb7);throw _0x1a8fb7;});}return _0x345355;});}})['then'](respondWithResult(_0x387897,0xc9))[_0x8b41('0x4b')](handleError(_0x387897,null));};exports['update']=function(_0x5869c0,_0x152832){if(_0x5869c0['body']['id']){delete _0x5869c0[_0x8b41('0x57')]['id'];}return db[_0x8b41('0x32')]['find']({'where':{'id':_0x5869c0[_0x8b41('0x54')]['id']}})[_0x8b41('0x29')](handleEntityNotFound(_0x152832,null))[_0x8b41('0x29')](saveUpdates(_0x5869c0[_0x8b41('0x57')],null))[_0x8b41('0x29')](respondWithResult(_0x152832,null))[_0x8b41('0x4b')](handleError(_0x152832,null));};exports['destroy']=function(_0x24c684,_0xcbb2d8){return db['Dashboard'][_0x8b41('0x4a')]({'where':{'id':_0x24c684['params']['id']}})[_0x8b41('0x29')](handleEntityNotFound(_0xcbb2d8,null))[_0x8b41('0x29')](removeEntity(_0xcbb2d8,null))[_0x8b41('0x4b')](handleError(_0xcbb2d8,null));};function widgetAttributes(_0x3fb6db){try{switch(_0x3fb6db[_0x8b41('0x35')]){case _0x8b41('0x5a'):return[{'name':'attrUrl','value':_0x3fb6db['attrUrl']||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x0]?_0x3fb6db[_0x8b41('0x5b')][0x0][_0x8b41('0x5c')]:undefined)||_0x8b41('0x5d')}];case _0x8b41('0x5e'):return[{'name':_0x8b41('0x5f'),'value':_0x3fb6db[_0x8b41('0x5f')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x0]?_0x3fb6db[_0x8b41('0x5b')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x8b41('0x60'),'value':_0x3fb6db[_0x8b41('0x60')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x0]?_0x3fb6db[_0x8b41('0x5b')][0x0][_0x8b41('0x5c')]:undefined)||_0x8b41('0x61')},{'name':_0x8b41('0x62'),'value':_0x3fb6db['attrTimezone']||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db['attrs'][0x1]?_0x3fb6db[_0x8b41('0x5b')][0x1]['value']:undefined)||'0.00'},{'name':_0x8b41('0x63'),'value':_0x3fb6db[_0x8b41('0x63')]||(_0x3fb6db['attrs']&&_0x3fb6db[_0x8b41('0x5b')][0x2]?_0x3fb6db[_0x8b41('0x5b')][0x2]['value']:undefined)||0xc}];case _0x8b41('0x64'):return[{'name':_0x8b41('0x65'),'value':_0x3fb6db[_0x8b41('0x65')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x0]?_0x3fb6db[_0x8b41('0x5b')][0x0][_0x8b41('0x5c')]:undefined)||_0x8b41('0x66')},{'name':_0x8b41('0x67'),'value':_0x3fb6db[_0x8b41('0x67')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x1]?_0x3fb6db[_0x8b41('0x5b')][0x1][_0x8b41('0x5c')]:undefined)||[]},{'name':_0x8b41('0x63'),'value':_0x3fb6db[_0x8b41('0x63')]||(_0x3fb6db['attrs']&&_0x3fb6db[_0x8b41('0x5b')][0x2]?_0x3fb6db['attrs'][0x2]['value']:undefined)||0x14}];case _0x8b41('0x68'):case _0x8b41('0x69'):return[{'name':'attrSerie1','value':_0x3fb6db[_0x8b41('0x6a')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db['attrs'][0x0]?_0x3fb6db['attrs'][0x0][_0x8b41('0x5c')]:undefined)||_0x8b41('0x66')},{'name':_0x8b41('0x6b'),'value':_0x3fb6db[_0x8b41('0x6b')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x1]?_0x3fb6db['attrs'][0x1]['value']:undefined)||null},{'name':_0x8b41('0x6c'),'value':_0x3fb6db[_0x8b41('0x6c')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db['attrs'][0x2]?_0x3fb6db['attrs'][0x2][_0x8b41('0x5c')]:undefined)||null},{'name':_0x8b41('0x67'),'value':_0x3fb6db['attrVoiceQueues']||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x3]?_0x3fb6db[_0x8b41('0x5b')][0x3]['value']:undefined)||[]}];case _0x8b41('0x6d'):return[{'name':'attrReport','type':_0x3fb6db['reportType']||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x0]?_0x3fb6db[_0x8b41('0x5b')][0x0]['type']:undefined)||null,'value':_0x3fb6db[_0x8b41('0x6e')]||(_0x3fb6db[_0x8b41('0x5b')]&&_0x3fb6db[_0x8b41('0x5b')][0x0]?_0x3fb6db['attrs'][0x0][_0x8b41('0x5c')]:undefined)||null},{'name':'attrRefresh','value':_0x3fb6db[_0x8b41('0x6f')]||(_0x3fb6db['attrs']&&_0x3fb6db['attrs'][0x1]?_0x3fb6db['attrs'][0x1][_0x8b41('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x5c4a2e){logger[_0x8b41('0x2e')](_0x8b41('0x70'),JSON[_0x8b41('0x71')](_0x5c4a2e));return[];}}exports[_0x8b41('0x72')]=function(_0x2ac9f1,_0x34413d,_0x38a72c){if(_0x2ac9f1['body']['id']){delete _0x2ac9f1[_0x8b41('0x57')]['id'];}return db[_0x8b41('0x32')][_0x8b41('0x4a')]({'where':{'id':_0x2ac9f1[_0x8b41('0x54')]['id']}})[_0x8b41('0x29')](handleEntityNotFound(_0x34413d,null))[_0x8b41('0x29')](function(_0x147ae9){if(_0x147ae9){_0x2ac9f1['body'][_0x8b41('0x73')]=_0x147ae9['id'];_0x2ac9f1[_0x8b41('0x57')]['attrs']=widgetAttributes(_0x2ac9f1['body']);return db[_0x8b41('0x74')][_0x8b41('0x4c')](_0x2ac9f1[_0x8b41('0x57')]);}})[_0x8b41('0x29')](respondWithResult(_0x34413d,null))['catch'](handleError(_0x34413d,null));};exports['getItems']=function(_0x266fb9,_0x11fdfd,_0x419b00){var _0x361798={};var _0x5f1263={};var _0x134d9c;var _0x7ae747;return db[_0x8b41('0x32')][_0x8b41('0x75')]({'where':{'id':_0x266fb9[_0x8b41('0x54')]['id']}})[_0x8b41('0x29')](handleEntityNotFound(_0x11fdfd,null))[_0x8b41('0x29')](function(_0x28b730){if(_0x28b730){_0x134d9c=_0x28b730;_0x5f1263['model']=_[_0x8b41('0x38')](db[_0x8b41('0x74')][_0x8b41('0x33')]);_0x5f1263['query']=_[_0x8b41('0x38')](_0x266fb9[_0x8b41('0x37')]);_0x5f1263[_0x8b41('0x3f')]=_[_0x8b41('0x48')](_0x5f1263[_0x8b41('0x36')],_0x5f1263[_0x8b41('0x37')]);_0x361798['attributes']=_['intersection'](_0x5f1263['model'],qs[_0x8b41('0x3a')](_0x266fb9[_0x8b41('0x37')][_0x8b41('0x3a')]));_0x361798[_0x8b41('0x39')]=_0x361798[_0x8b41('0x39')]['length']?_0x361798[_0x8b41('0x39')]:_0x5f1263['model'];_0x361798[_0x8b41('0x76')]=qs[_0x8b41('0x3d')](_0x266fb9[_0x8b41('0x37')][_0x8b41('0x3d')]);_0x361798['where']=qs[_0x8b41('0x3f')](_[_0x8b41('0x40')](_0x266fb9['query'],_0x5f1263[_0x8b41('0x3f')]));if(_0x266fb9['query'][_0x8b41('0x41')]){_0x361798[_0x8b41('0x3e')]=_[_0x8b41('0x43')](_0x361798[_0x8b41('0x3e')],{'$or':_[_0x8b41('0x42')](_0x361798[_0x8b41('0x39')],function(_0x2c14e4){var _0xf6988f={};_0xf6988f[_0x2c14e4]={'$like':'%'+_0x266fb9[_0x8b41('0x37')][_0x8b41('0x41')]+'%'};return _0xf6988f;})});}_0x361798=_['merge']({},_0x361798,_0x266fb9['options']);return _0x134d9c[_0x8b41('0x77')](_0x361798);}})['then'](function(_0x4fbcc7){if(_0x4fbcc7){_0x7ae747=_0x4fbcc7[_0x8b41('0x78')];if(!_0x266fb9[_0x8b41('0x37')][_0x8b41('0x3b')](_0x8b41('0x3c'))){_0x361798[_0x8b41('0x22')]=qs['limit'](_0x266fb9['query'][_0x8b41('0x22')]);_0x361798['offset']=qs[_0x8b41('0x20')](_0x266fb9['query']['offset']);}return _0x134d9c[_0x8b41('0x77')](_0x361798);}})[_0x8b41('0x29')](function(_0x3a46b4){if(_0x3a46b4){return _0x3a46b4?{'count':_0x7ae747,'rows':_0x3a46b4}:null;}})[_0x8b41('0x29')](respondWithResult(_0x11fdfd,null))[_0x8b41('0x4b')](handleError(_0x11fdfd,null));}; \ No newline at end of file +var _0xeedf=['apply','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','map','Dashboard','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','getItems','DashboardItem','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x57977d,_0xb611f5){var _0x21e6b2=function(_0x534060){while(--_0x534060){_0x57977d['push'](_0x57977d['shift']());}};_0x21e6b2(++_0xb611f5);}(_0xeedf,0xc9));var _0xfeed=function(_0x204466,_0x463a4a){_0x204466=_0x204466-0x0;var _0x3a5fbc=_0xeedf[_0x204466];return _0x3a5fbc;};'use strict';var emlformat=require(_0xfeed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfeed('0x1'));var rp=require('request-promise');var moment=require(_0xfeed('0x2'));var BPromise=require(_0xfeed('0x3'));var Mustache=require(_0xfeed('0x4'));var util=require(_0xfeed('0x5'));var path=require(_0xfeed('0x6'));var sox=require(_0xfeed('0x7'));var csv=require(_0xfeed('0x8'));var ejs=require(_0xfeed('0x9'));var fs=require('fs');var fs_extra=require(_0xfeed('0xa'));var _=require(_0xfeed('0xb'));var squel=require('squel');var crypto=require(_0xfeed('0xc'));var jsforce=require(_0xfeed('0xd'));var deskjs=require(_0xfeed('0xe'));var toCsv=require(_0xfeed('0x8'));var querystring=require(_0xfeed('0xf'));var Papa=require(_0xfeed('0x10'));var Redis=require(_0xfeed('0x11'));var authService=require(_0xfeed('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfeed('0x13'));var hardwareService=require(_0xfeed('0x14'));var logger=require(_0xfeed('0x15'))(_0xfeed('0x16'));var utils=require(_0xfeed('0x17'));var config=require(_0xfeed('0x18'));var licenseUtil=require(_0xfeed('0x19'));var db=require(_0xfeed('0x1a'))['db'];config[_0xfeed('0x1b')]=_[_0xfeed('0x1c')](config[_0xfeed('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfeed('0x1d'))[_0xfeed('0x1e')](socket);function respondWithStatusCode(_0x344641,_0x47378f){_0x47378f=_0x47378f||0xcc;return function(_0x40810c){if(_0x40810c){return _0x344641[_0xfeed('0x1f')](_0x47378f);}return _0x344641[_0xfeed('0x20')](_0x47378f)[_0xfeed('0x21')]();};}function respondWithResult(_0x532948,_0x3ca5b2){_0x3ca5b2=_0x3ca5b2||0xc8;return function(_0x2149eb){if(_0x2149eb){return _0x532948[_0xfeed('0x20')](_0x3ca5b2)[_0xfeed('0x22')](_0x2149eb);}};}function respondWithFilteredResult(_0x1b5d59,_0x4a8500){return function(_0x3b0d26){if(_0x3b0d26){var _0x50c6ad=typeof _0x4a8500[_0xfeed('0x23')]===_0xfeed('0x24')&&typeof _0x4a8500[_0xfeed('0x25')]===_0xfeed('0x24');var _0x1d453e=_0x3b0d26[_0xfeed('0x26')];var _0x4711d3=_0x50c6ad?0x0:_0x4a8500[_0xfeed('0x23')];var _0x29c626=_0x50c6ad?_0x3b0d26[_0xfeed('0x26')]:_0x4a8500[_0xfeed('0x23')]+_0x4a8500[_0xfeed('0x25')];var _0x302079;if(_0x29c626>=_0x1d453e){_0x29c626=_0x1d453e;_0x302079=0xc8;}else{_0x302079=0xce;}_0x1b5d59[_0xfeed('0x20')](_0x302079);return _0x1b5d59[_0xfeed('0x27')](_0xfeed('0x28'),_0x4711d3+'-'+_0x29c626+'/'+_0x1d453e)[_0xfeed('0x22')](_0x3b0d26);}return null;};}function patchUpdates(_0x6db848){return function(_0x49d90e){try{jsonpatch[_0xfeed('0x29')](_0x49d90e,_0x6db848,!![]);}catch(_0xac2147){return BPromise['reject'](_0xac2147);}return _0x49d90e[_0xfeed('0x2a')]();};}function saveUpdates(_0xdf1921,_0x5c2bcb){return function(_0xc1984a){if(_0xc1984a){return _0xc1984a['update'](_0xdf1921)[_0xfeed('0x2b')](function(_0x1fcbd9){return _0x1fcbd9;});}return null;};}function removeEntity(_0x201e7e,_0x1deed8){return function(_0x11ab9a){if(_0x11ab9a){return _0x11ab9a[_0xfeed('0x2c')]()[_0xfeed('0x2b')](function(){var _0xb14102=_0x11ab9a[_0xfeed('0x2d')]({'plain':!![]});var _0x2e989b=_0xfeed('0x2e');return db[_0xfeed('0x2f')][_0xfeed('0x2c')]({'where':{'type':_0x2e989b,'resourceId':_0xb14102['id']}})[_0xfeed('0x2b')](function(){return _0x11ab9a;});})['then'](function(){_0x201e7e[_0xfeed('0x20')](0xcc)[_0xfeed('0x21')]();});}};}function handleEntityNotFound(_0xe2f6dd,_0x43bd79){return function(_0x1f0ce9){if(!_0x1f0ce9){_0xe2f6dd[_0xfeed('0x1f')](0x194);}return _0x1f0ce9;};}function handleError(_0xce11b9,_0x594f59){_0x594f59=_0x594f59||0x1f4;return function(_0x4885ef){logger[_0xfeed('0x30')](_0x4885ef[_0xfeed('0x31')]);if(_0x4885ef[_0xfeed('0x32')]){delete _0x4885ef[_0xfeed('0x32')];}_0xce11b9['status'](_0x594f59)[_0xfeed('0x33')](_0x4885ef);};}exports['index']=function(_0x3e97b3,_0x3586cf){var _0x17c92e={},_0x2fd78a={},_0x804539={'count':0x0,'rows':[]};var _0x2ece70=_[_0xfeed('0x34')](db[_0xfeed('0x35')]['rawAttributes'],function(_0x1f418b){return{'name':_0x1f418b[_0xfeed('0x36')],'type':_0x1f418b['type'][_0xfeed('0x37')]};});_0x2fd78a[_0xfeed('0x38')]=_[_0xfeed('0x34')](_0x2ece70,'name');_0x2fd78a['query']=_[_0xfeed('0x39')](_0x3e97b3['query']);_0x2fd78a[_0xfeed('0x3a')]=_[_0xfeed('0x3b')](_0x2fd78a['model'],_0x2fd78a[_0xfeed('0x3c')]);_0x17c92e[_0xfeed('0x3d')]=_['intersection'](_0x2fd78a[_0xfeed('0x38')],qs[_0xfeed('0x3e')](_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x3e')]));_0x17c92e['attributes']=_0x17c92e[_0xfeed('0x3d')][_0xfeed('0x3f')]?_0x17c92e['attributes']:_0x2fd78a[_0xfeed('0x38')];if(!_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x40')](_0xfeed('0x41'))){_0x17c92e[_0xfeed('0x25')]=qs[_0xfeed('0x25')](_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x25')]);_0x17c92e['offset']=qs[_0xfeed('0x23')](_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x23')]);}_0x17c92e[_0xfeed('0x42')]=qs[_0xfeed('0x43')](_0x3e97b3[_0xfeed('0x3c')]['sort']);_0x17c92e['where']=qs[_0xfeed('0x3a')](_[_0xfeed('0x44')](_0x3e97b3[_0xfeed('0x3c')],_0x2fd78a[_0xfeed('0x3a')]),_0x2ece70);if(_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x45')]){_0x17c92e['where']=_[_0xfeed('0x46')](_0x17c92e[_0xfeed('0x47')],{'$or':_[_0xfeed('0x34')](_0x2ece70,function(_0x5d5791){if(_0x5d5791[_0xfeed('0x48')]!==_0xfeed('0x49')){var _0x286e4a={};_0x286e4a[_0x5d5791[_0xfeed('0x32')]]={'$like':'%'+_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x45')]+'%'};return _0x286e4a;}})});}_0x17c92e=_[_0xfeed('0x46')]({},_0x17c92e,_0x3e97b3[_0xfeed('0x4a')]);var _0x8c10bf={'where':_0x17c92e['where']};return db[_0xfeed('0x35')][_0xfeed('0x26')](_0x8c10bf)[_0xfeed('0x2b')](function(_0x20d90f){_0x804539['count']=_0x20d90f;if(_0x3e97b3[_0xfeed('0x3c')][_0xfeed('0x4b')]){_0x17c92e[_0xfeed('0x4c')]=[{'all':!![]}];}return db[_0xfeed('0x35')][_0xfeed('0x4d')](_0x17c92e);})[_0xfeed('0x2b')](function(_0xe03314){_0x804539['rows']=_0xe03314;return _0x804539;})[_0xfeed('0x2b')](respondWithFilteredResult(_0x3586cf,_0x17c92e))[_0xfeed('0x4e')](handleError(_0x3586cf,null));};exports[_0xfeed('0x4f')]=function(_0x585387,_0x636080){var _0xd7346a={'raw':![],'where':{'id':_0x585387[_0xfeed('0x50')]['id']}},_0x15be55={};_0x15be55['model']=_[_0xfeed('0x39')](db['Dashboard'][_0xfeed('0x51')]);_0x15be55[_0xfeed('0x3c')]=_['keys'](_0x585387['query']);_0x15be55['filters']=_['intersection'](_0x15be55[_0xfeed('0x38')],_0x15be55['query']);_0xd7346a[_0xfeed('0x3d')]=_[_0xfeed('0x3b')](_0x15be55['model'],qs[_0xfeed('0x3e')](_0x585387['query']['fields']));_0xd7346a[_0xfeed('0x3d')]=_0xd7346a[_0xfeed('0x3d')][_0xfeed('0x3f')]?_0xd7346a[_0xfeed('0x3d')]:_0x15be55[_0xfeed('0x38')];if(_0x585387[_0xfeed('0x3c')][_0xfeed('0x4b')]){_0xd7346a[_0xfeed('0x4c')]=[{'all':!![]}];}_0xd7346a=_[_0xfeed('0x46')]({},_0xd7346a,_0x585387[_0xfeed('0x4a')]);return db['Dashboard'][_0xfeed('0x52')](_0xd7346a)['then'](handleEntityNotFound(_0x636080,null))[_0xfeed('0x2b')](respondWithResult(_0x636080,null))['catch'](handleError(_0x636080,null));};exports[_0xfeed('0x53')]=function(_0x4be236,_0x50e6d4){return db[_0xfeed('0x35')][_0xfeed('0x53')](_0x4be236[_0xfeed('0x54')],{})['then'](function(_0x416595){var _0x2a1610=_0x4be236[_0xfeed('0x55')]['get']({'plain':!![]});if(!_0x2a1610)throw new Error(_0xfeed('0x56'));if(_0x2a1610[_0xfeed('0x57')]==='user'){var _0x3746f8=_0x416595[_0xfeed('0x2d')]({'plain':!![]});var _0x9b5e5='CustomDashboards';return db[_0xfeed('0x58')][_0xfeed('0x52')]({'where':{'name':_0x9b5e5,'userProfileId':_0x2a1610['userProfileId']},'raw':!![]})[_0xfeed('0x2b')](function(_0x589f94){if(_0x589f94&&_0x589f94['autoAssociation']===0x0){return db[_0xfeed('0x2f')][_0xfeed('0x53')]({'name':_0x3746f8['name'],'resourceId':_0x3746f8['id'],'type':_0x589f94[_0xfeed('0x32')],'sectionId':_0x589f94['id']},{})[_0xfeed('0x2b')](function(){return _0x416595;});}else{return _0x416595;}})[_0xfeed('0x4e')](function(_0x193cd3){logger[_0xfeed('0x30')](_0xfeed('0x59'),_0x193cd3);throw _0x193cd3;});}return _0x416595;})[_0xfeed('0x2b')](respondWithResult(_0x50e6d4,0xc9))[_0xfeed('0x4e')](handleError(_0x50e6d4,null));};exports['clone']=function(_0x46c286,_0x5d08b5){var _0x18adb7={'where':{'id':_0x46c286[_0xfeed('0x50')]['id']}},_0x2444b6={};_0x2444b6[_0xfeed('0x38')]=_[_0xfeed('0x39')](db['Dashboard']['rawAttributes']);_0x18adb7[_0xfeed('0x3d')]=_['intersection'](_0x2444b6[_0xfeed('0x38')],qs[_0xfeed('0x3e')](_0x46c286['query']['fields']));_0x18adb7[_0xfeed('0x3d')]=_0x18adb7[_0xfeed('0x3d')][_0xfeed('0x3f')]?_0x18adb7[_0xfeed('0x3d')]:_0x2444b6[_0xfeed('0x38')];if(_0x46c286['query']['includeAll']){_0x18adb7['include']=[{'all':!![]}];}_0x18adb7=_[_0xfeed('0x46')]({},_0x18adb7,_0x46c286[_0xfeed('0x4a')]);return db['Dashboard'][_0xfeed('0x52')](_0x18adb7)[_0xfeed('0x2b')](handleEntityNotFound(_0x5d08b5,null))[_0xfeed('0x2b')](function(_0x3888aa){if(_0x3888aa){var _0x5efc75=_0x3888aa['get']({'plain':!![]});_0x5efc75=qs[_0xfeed('0x5a')](_0x5efc75,['id',_0xfeed('0x5b'),_0xfeed('0x5c')]);_0x46c286[_0xfeed('0x54')]=_['omit'](_0x46c286[_0xfeed('0x54')],['id',_0xfeed('0x5b'),'updatedAt']);return db[_0xfeed('0x35')][_0xfeed('0x53')](_['merge'](_0x5efc75,_0x46c286[_0xfeed('0x54')]),{'include':_0x46c286[_0xfeed('0x3c')]['includeAll']?[{'all':!![]}]:undefined})[_0xfeed('0x2b')](function(_0x2cd077){var _0x486290=_0x46c286['user']['get']({'plain':!![]});if(!_0x486290)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486290[_0xfeed('0x57')]===_0xfeed('0x55')){var _0xc05a84=_0x2cd077[_0xfeed('0x2d')]({'plain':!![]});var _0x20e31a='CustomDashboards';return db['UserProfileSection'][_0xfeed('0x52')]({'where':{'name':_0x20e31a,'userProfileId':_0x486290[_0xfeed('0x5d')]},'raw':!![]})[_0xfeed('0x2b')](function(_0x10553f){if(_0x10553f&&_0x10553f['autoAssociation']===0x0){return db[_0xfeed('0x2f')][_0xfeed('0x53')]({'name':_0xc05a84[_0xfeed('0x32')],'resourceId':_0xc05a84['id'],'type':_0x10553f[_0xfeed('0x32')],'sectionId':_0x10553f['id']},{})[_0xfeed('0x2b')](function(){return _0x2cd077;});}else{return _0x2cd077;}})[_0xfeed('0x4e')](function(_0xba2f96){logger[_0xfeed('0x30')](_0xfeed('0x59'),_0xba2f96);throw _0xba2f96;});}return _0x2cd077;});}})['then'](respondWithResult(_0x5d08b5,0xc9))['catch'](handleError(_0x5d08b5,null));};exports['update']=function(_0x5441e8,_0x4a0ac7){if(_0x5441e8[_0xfeed('0x54')]['id']){delete _0x5441e8[_0xfeed('0x54')]['id'];}return db[_0xfeed('0x35')][_0xfeed('0x52')]({'where':{'id':_0x5441e8[_0xfeed('0x50')]['id']}})[_0xfeed('0x2b')](handleEntityNotFound(_0x4a0ac7,null))['then'](saveUpdates(_0x5441e8[_0xfeed('0x54')],null))['then'](respondWithResult(_0x4a0ac7,null))['catch'](handleError(_0x4a0ac7,null));};exports[_0xfeed('0x2c')]=function(_0x3b4504,_0xf8891b){return db[_0xfeed('0x35')][_0xfeed('0x52')]({'where':{'id':_0x3b4504[_0xfeed('0x50')]['id']}})[_0xfeed('0x2b')](handleEntityNotFound(_0xf8891b,null))[_0xfeed('0x2b')](removeEntity(_0xf8891b,null))[_0xfeed('0x4e')](handleError(_0xf8891b,null));};function widgetAttributes(_0x2bd656){try{switch(_0x2bd656[_0xfeed('0x48')]){case _0xfeed('0x5e'):return[{'name':_0xfeed('0x5f'),'value':_0x2bd656['attrUrl']||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x0]?_0x2bd656['attrs'][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0xfeed('0x61'),'value':_0x2bd656[_0xfeed('0x61')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x0]?_0x2bd656[_0xfeed('0x60')][0x0][_0xfeed('0x62')]:undefined)||''}];case _0xfeed('0x63'):return[{'name':_0xfeed('0x64'),'value':_0x2bd656[_0xfeed('0x64')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656['attrs'][0x0]?_0x2bd656[_0xfeed('0x60')][0x0][_0xfeed('0x62')]:undefined)||_0xfeed('0x65')},{'name':'attrTimezone','value':_0x2bd656[_0xfeed('0x66')]||(_0x2bd656['attrs']&&_0x2bd656[_0xfeed('0x60')][0x1]?_0x2bd656[_0xfeed('0x60')][0x1]['value']:undefined)||'0.00'},{'name':_0xfeed('0x67'),'value':_0x2bd656['attrFontSize']||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x2]?_0x2bd656['attrs'][0x2][_0xfeed('0x62')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2bd656[_0xfeed('0x68')]||(_0x2bd656['attrs']&&_0x2bd656['attrs'][0x0]?_0x2bd656[_0xfeed('0x60')][0x0][_0xfeed('0x62')]:undefined)||_0xfeed('0x69')},{'name':_0xfeed('0x6a'),'value':_0x2bd656[_0xfeed('0x6a')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x1]?_0x2bd656[_0xfeed('0x60')][0x1][_0xfeed('0x62')]:undefined)||[]},{'name':_0xfeed('0x67'),'value':_0x2bd656['attrFontSize']||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x2]?_0x2bd656[_0xfeed('0x60')][0x2][_0xfeed('0x62')]:undefined)||0x14}];case _0xfeed('0x6b'):case _0xfeed('0x6c'):return[{'name':'attrSerie1','value':_0x2bd656[_0xfeed('0x6d')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x0]?_0x2bd656[_0xfeed('0x60')][0x0]['value']:undefined)||_0xfeed('0x69')},{'name':_0xfeed('0x6e'),'value':_0x2bd656[_0xfeed('0x6e')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656['attrs'][0x1]?_0x2bd656[_0xfeed('0x60')][0x1][_0xfeed('0x62')]:undefined)||null},{'name':_0xfeed('0x6f'),'value':_0x2bd656['attrSerie3']||(_0x2bd656['attrs']&&_0x2bd656[_0xfeed('0x60')][0x2]?_0x2bd656['attrs'][0x2][_0xfeed('0x62')]:undefined)||null},{'name':_0xfeed('0x6a'),'value':_0x2bd656['attrVoiceQueues']||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x3]?_0x2bd656[_0xfeed('0x60')][0x3]['value']:undefined)||[]}];case _0xfeed('0x70'):return[{'name':_0xfeed('0x71'),'type':_0x2bd656[_0xfeed('0x72')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x0]?_0x2bd656[_0xfeed('0x60')][0x0][_0xfeed('0x48')]:undefined)||null,'value':_0x2bd656['attrReport']||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656[_0xfeed('0x60')][0x0]?_0x2bd656['attrs'][0x0][_0xfeed('0x62')]:undefined)||null},{'name':_0xfeed('0x73'),'value':_0x2bd656[_0xfeed('0x73')]||(_0x2bd656[_0xfeed('0x60')]&&_0x2bd656['attrs'][0x1]?_0x2bd656[_0xfeed('0x60')][0x1][_0xfeed('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x40071f){logger[_0xfeed('0x30')]('widgetAttributes:\x20%s',JSON[_0xfeed('0x74')](_0x40071f));return[];}}exports[_0xfeed('0x75')]=function(_0x35f3d4,_0x1a20ce,_0x4f59ff){if(_0x35f3d4['body']['id']){delete _0x35f3d4[_0xfeed('0x54')]['id'];}return db[_0xfeed('0x35')][_0xfeed('0x52')]({'where':{'id':_0x35f3d4[_0xfeed('0x50')]['id']}})[_0xfeed('0x2b')](handleEntityNotFound(_0x1a20ce,null))[_0xfeed('0x2b')](function(_0x721978){if(_0x721978){_0x35f3d4[_0xfeed('0x54')][_0xfeed('0x76')]=_0x721978['id'];_0x35f3d4['body']['attrs']=widgetAttributes(_0x35f3d4[_0xfeed('0x54')]);return db['DashboardItem'][_0xfeed('0x53')](_0x35f3d4[_0xfeed('0x54')]);}})[_0xfeed('0x2b')](respondWithResult(_0x1a20ce,null))[_0xfeed('0x4e')](handleError(_0x1a20ce,null));};exports[_0xfeed('0x77')]=function(_0x4af8d5,_0xc193b5,_0x3609fa){var _0x49d0d6={};var _0x40971d={};var _0x7c7776;var _0x34bbb5;return db['Dashboard']['findOne']({'where':{'id':_0x4af8d5[_0xfeed('0x50')]['id']}})[_0xfeed('0x2b')](handleEntityNotFound(_0xc193b5,null))[_0xfeed('0x2b')](function(_0x21ca97){if(_0x21ca97){_0x7c7776=_0x21ca97;_0x40971d[_0xfeed('0x38')]=_[_0xfeed('0x39')](db[_0xfeed('0x78')]['rawAttributes']);_0x40971d[_0xfeed('0x3c')]=_[_0xfeed('0x39')](_0x4af8d5[_0xfeed('0x3c')]);_0x40971d['filters']=_[_0xfeed('0x3b')](_0x40971d[_0xfeed('0x38')],_0x40971d[_0xfeed('0x3c')]);_0x49d0d6[_0xfeed('0x3d')]=_[_0xfeed('0x3b')](_0x40971d['model'],qs[_0xfeed('0x3e')](_0x4af8d5['query']['fields']));_0x49d0d6[_0xfeed('0x3d')]=_0x49d0d6[_0xfeed('0x3d')][_0xfeed('0x3f')]?_0x49d0d6[_0xfeed('0x3d')]:_0x40971d[_0xfeed('0x38')];_0x49d0d6['order']=qs[_0xfeed('0x43')](_0x4af8d5[_0xfeed('0x3c')]['sort']);_0x49d0d6[_0xfeed('0x47')]=qs[_0xfeed('0x3a')](_[_0xfeed('0x44')](_0x4af8d5['query'],_0x40971d[_0xfeed('0x3a')]));if(_0x4af8d5[_0xfeed('0x3c')][_0xfeed('0x45')]){_0x49d0d6[_0xfeed('0x47')]=_[_0xfeed('0x46')](_0x49d0d6[_0xfeed('0x47')],{'$or':_['map'](_0x49d0d6['attributes'],function(_0x568889){var _0x401170={};_0x401170[_0x568889]={'$like':'%'+_0x4af8d5[_0xfeed('0x3c')][_0xfeed('0x45')]+'%'};return _0x401170;})});}_0x49d0d6=_['merge']({},_0x49d0d6,_0x4af8d5[_0xfeed('0x4a')]);return _0x7c7776['getItems'](_0x49d0d6);}})[_0xfeed('0x2b')](function(_0x4b970c){if(_0x4b970c){_0x34bbb5=_0x4b970c[_0xfeed('0x3f')];if(!_0x4af8d5[_0xfeed('0x3c')][_0xfeed('0x40')](_0xfeed('0x41'))){_0x49d0d6[_0xfeed('0x25')]=qs[_0xfeed('0x25')](_0x4af8d5[_0xfeed('0x3c')]['limit']);_0x49d0d6[_0xfeed('0x23')]=qs['offset'](_0x4af8d5[_0xfeed('0x3c')][_0xfeed('0x23')]);}return _0x7c7776[_0xfeed('0x77')](_0x49d0d6);}})['then'](function(_0x53b2f2){if(_0x53b2f2){return _0x53b2f2?{'count':_0x34bbb5,'rows':_0x53b2f2}:null;}})['then'](respondWithResult(_0xc193b5,null))[_0xfeed('0x4e')](handleError(_0xc193b5,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 3238422..8e75b50 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 _0xe112=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x15ddb8,_0x45ffe4){var _0x530f94=function(_0xfd17bd){while(--_0xfd17bd){_0x15ddb8['push'](_0x15ddb8['shift']());}};_0x530f94(++_0x45ffe4);}(_0xe112,0x1f4));var _0x2e11=function(_0x3c1b7a,_0x5c831c){_0x3c1b7a=_0x3c1b7a-0x0;var _0x1a554c=_0xe112[_0x3c1b7a];return _0x1a554c;};'use strict';var EventEmitter=require(_0x2e11('0x0'));var Dashboard=require(_0x2e11('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x2e11('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e11('0x3'),'afterDestroy':_0x2e11('0x4')};function emitEvent(_0x25beae){return function(_0x49aef9,_0x51aed4,_0x335487){DashboardEvents[_0x2e11('0x5')](_0x25beae+':'+_0x49aef9['id'],_0x49aef9);DashboardEvents[_0x2e11('0x5')](_0x25beae,_0x49aef9);_0x335487(null);};}for(var e in events){if(events[_0x2e11('0x6')](e)){var event=events[e];Dashboard[_0x2e11('0x7')](e,emitEvent(event));}}module[_0x2e11('0x8')]=DashboardEvents; \ No newline at end of file +var _0xb6d4=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6d4,0x16c));var _0x4b6d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb6d4[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x4b6d('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4b6d('0x1')](0x0);var events={'afterCreate':_0x4b6d('0x2'),'afterUpdate':_0x4b6d('0x3'),'afterDestroy':_0x4b6d('0x4')};function emitEvent(_0x1914a0){return function(_0x598386,_0x4442c2,_0x201dfe){DashboardEvents[_0x4b6d('0x5')](_0x1914a0+':'+_0x598386['id'],_0x598386);DashboardEvents[_0x4b6d('0x5')](_0x1914a0,_0x598386);_0x201dfe(null);};}for(var e in events){if(events[_0x4b6d('0x6')](e)){var event=events[e];Dashboard[_0x4b6d('0x7')](e,emitEvent(event));}}module[_0x4b6d('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 7bdf1fd..404bad6 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 _0xe260=['path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0xe260,0xb0));var _0x0e26=function(_0x141eda,_0x45a876){_0x141eda=_0x141eda-0x0;var _0x452488=_0xe260[_0x141eda];return _0x452488;};'use strict';var _=require(_0x0e26('0x0'));var util=require(_0x0e26('0x1'));var logger=require(_0x0e26('0x2'))(_0x0e26('0x3'));var moment=require('moment');var BPromise=require(_0x0e26('0x4'));var rp=require(_0x0e26('0x5'));var fs=require('fs');var path=require(_0x0e26('0x6'));var rimraf=require(_0x0e26('0x7'));var config=require(_0x0e26('0x8'));var attributes=require(_0x0e26('0x9'));module[_0x0e26('0xa')]=function(_0x1f9be2,_0x4fa339){return _0x1f9be2[_0x0e26('0xb')](_0x0e26('0xc'),attributes,{'tableName':_0x0e26('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ce1=['dashboards','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x52df53,_0x5fe4db){var _0xa3ea95=function(_0x5cdf5c){while(--_0x5cdf5c){_0x52df53['push'](_0x52df53['shift']());}};_0xa3ea95(++_0x5fe4db);}(_0x8ce1,0x97));var _0x18ce=function(_0x54df59,_0x2e856b){_0x54df59=_0x54df59-0x0;var _0x3240e1=_0x8ce1[_0x54df59];return _0x3240e1;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var logger=require(_0x18ce('0x2'))(_0x18ce('0x3'));var moment=require('moment');var BPromise=require(_0x18ce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18ce('0x5'));var rimraf=require(_0x18ce('0x6'));var config=require(_0x18ce('0x7'));var attributes=require('./dashboard.attributes');module[_0x18ce('0x8')]=function(_0x139020,_0x48a416){return _0x139020['define']('Dashboard',attributes,{'tableName':_0x18ce('0x9'),'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 ed6f823..fd93f73 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 _0xdc62=['jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xdc62,0x12f));var _0x2dc6=function(_0x5e5dbf,_0x1e8c22){_0x5e5dbf=_0x5e5dbf-0x0;var _0xfd8d51=_0xdc62[_0x5e5dbf];return _0xfd8d51;};'use strict';var _=require(_0x2dc6('0x0'));var util=require(_0x2dc6('0x1'));var moment=require(_0x2dc6('0x2'));var BPromise=require('bluebird');var rs=require(_0x2dc6('0x3'));var fs=require('fs');var Redis=require(_0x2dc6('0x4'));var db=require(_0x2dc6('0x5'))['db'];var utils=require(_0x2dc6('0x6'));var logger=require(_0x2dc6('0x7'))('rpc');var config=require(_0x2dc6('0x8'));var jayson=require(_0x2dc6('0x9'));var client=jayson[_0x2dc6('0xa')][_0x2dc6('0xb')]({'port':0x232a});config[_0x2dc6('0xc')]=_[_0x2dc6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2dc6('0xe'))(new Redis(config[_0x2dc6('0xc')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x5ccdc0,_0x52da17,_0x1d0f98){return new BPromise(function(_0x936602,_0x16168c){return client['request'](_0x5ccdc0,_0x1d0f98)[_0x2dc6('0xf')](function(_0x53be9c){logger[_0x2dc6('0x10')](_0x2dc6('0x11'),_0x52da17,'request\x20sent');logger[_0x2dc6('0x12')](_0x2dc6('0x13'),_0x52da17,_0x2dc6('0x14'),JSON[_0x2dc6('0x15')](_0x53be9c));if(_0x53be9c['error']){if(_0x53be9c['error'][_0x2dc6('0x16')]===0x1f4){logger['error'](_0x2dc6('0x11'),_0x52da17,_0x53be9c[_0x2dc6('0x17')][_0x2dc6('0x18')]);return _0x16168c(_0x53be9c[_0x2dc6('0x17')][_0x2dc6('0x18')]);}logger[_0x2dc6('0x17')]('Dashboard,\x20%s,\x20%s',_0x52da17,_0x53be9c[_0x2dc6('0x17')][_0x2dc6('0x18')]);return _0x936602(_0x53be9c[_0x2dc6('0x17')][_0x2dc6('0x18')]);}else{logger['info'](_0x2dc6('0x11'),_0x52da17,'request\x20sent');_0x936602(_0x53be9c[_0x2dc6('0x19')]['message']);}})['catch'](function(_0x3b5697){logger['error']('Dashboard,\x20%s,\x20%s',_0x52da17,_0x3b5697);_0x16168c(_0x3b5697);});});} \ No newline at end of file +var _0xab57=['localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis'];(function(_0x29c4c2,_0x56b4f7){var _0x2f6fdd=function(_0x2a50c1){while(--_0x2a50c1){_0x29c4c2['push'](_0x29c4c2['shift']());}};_0x2f6fdd(++_0x56b4f7);}(_0xab57,0x102));var _0x7ab5=function(_0x3f0612,_0x99361b){_0x3f0612=_0x3f0612-0x0;var _0x350537=_0xab57[_0x3f0612];return _0x350537;};'use strict';var _=require(_0x7ab5('0x0'));var util=require(_0x7ab5('0x1'));var moment=require('moment');var BPromise=require(_0x7ab5('0x2'));var rs=require(_0x7ab5('0x3'));var fs=require('fs');var Redis=require(_0x7ab5('0x4'));var db=require(_0x7ab5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ab5('0x6'))(_0x7ab5('0x7'));var config=require('../../config/environment');var jayson=require(_0x7ab5('0x8'));var client=jayson['client'][_0x7ab5('0x9')]({'port':0x232a});config['redis']=_[_0x7ab5('0xa')](config[_0x7ab5('0xb')],{'host':_0x7ab5('0xc'),'port':0x18eb});var socket=require(_0x7ab5('0xd'))(new Redis(config['redis']));require(_0x7ab5('0xe'))[_0x7ab5('0xf')](socket);function respondWithRpcPromise(_0x2ce4c7,_0x19f4c4,_0x59182f){return new BPromise(function(_0x3590eb,_0x25b1ad){return client[_0x7ab5('0x10')](_0x2ce4c7,_0x59182f)[_0x7ab5('0x11')](function(_0x4777d5){logger['info'](_0x7ab5('0x12'),_0x19f4c4,_0x7ab5('0x13'));logger['debug'](_0x7ab5('0x14'),_0x19f4c4,'request\x20sent',JSON[_0x7ab5('0x15')](_0x4777d5));if(_0x4777d5[_0x7ab5('0x16')]){if(_0x4777d5[_0x7ab5('0x16')][_0x7ab5('0x17')]===0x1f4){logger[_0x7ab5('0x16')](_0x7ab5('0x12'),_0x19f4c4,_0x4777d5[_0x7ab5('0x16')]['message']);return _0x25b1ad(_0x4777d5[_0x7ab5('0x16')][_0x7ab5('0x18')]);}logger[_0x7ab5('0x16')](_0x7ab5('0x12'),_0x19f4c4,_0x4777d5[_0x7ab5('0x16')][_0x7ab5('0x18')]);return _0x3590eb(_0x4777d5[_0x7ab5('0x16')]['message']);}else{logger[_0x7ab5('0x19')](_0x7ab5('0x12'),_0x19f4c4,'request\x20sent');_0x3590eb(_0x4777d5['result'][_0x7ab5('0x18')]);}})[_0x7ab5('0x1a')](function(_0x48b388){logger[_0x7ab5('0x16')](_0x7ab5('0x12'),_0x19f4c4,_0x48b388);_0x25b1ad(_0x48b388);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 05d6c96..6006816 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 _0x2210=['dashboard:','./dashboard.events','save','remove','update','emit','register','length'];(function(_0x2fe100,_0x394e82){var _0x2a319c=function(_0x462405){while(--_0x462405){_0x2fe100['push'](_0x2fe100['shift']());}};_0x2a319c(++_0x394e82);}(_0x2210,0x121));var _0x0221=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2210[_0xa1e3e3];return _0xc980e9;};'use strict';var DashboardEvents=require(_0x0221('0x0'));var events=[_0x0221('0x1'),_0x0221('0x2'),_0x0221('0x3')];function createListener(_0x48c299,_0x305ddf){return function(_0x4e5e5c){_0x305ddf[_0x0221('0x4')](_0x48c299,_0x4e5e5c);};}function removeListener(_0x29f11b,_0x27792f){return function(){DashboardEvents['removeListener'](_0x29f11b,_0x27792f);};}exports[_0x0221('0x5')]=function(_0x2e5721){for(var _0x178df9=0x0,_0x5edef4=events[_0x0221('0x6')];_0x178df9<_0x5edef4;_0x178df9++){var _0x18783b=events[_0x178df9];var _0x552dfa=createListener(_0x0221('0x7')+_0x18783b,_0x2e5721);DashboardEvents['on'](_0x18783b,_0x552dfa);}}; \ No newline at end of file +var _0x618b=['save','remove','update','emit','register','length','./dashboard.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x618b,0xa0));var _0xb618=function(_0x54330c,_0x5a788a){_0x54330c=_0x54330c-0x0;var _0x51e565=_0x618b[_0x54330c];return _0x51e565;};'use strict';var DashboardEvents=require(_0xb618('0x0'));var events=[_0xb618('0x1'),_0xb618('0x2'),_0xb618('0x3')];function createListener(_0x14559b,_0x5c9141){return function(_0x1b7ac1){_0x5c9141[_0xb618('0x4')](_0x14559b,_0x1b7ac1);};}function removeListener(_0xaa489,_0x4f29a4){return function(){DashboardEvents['removeListener'](_0xaa489,_0x4f29a4);};}exports[_0xb618('0x5')]=function(_0x3d1e84){for(var _0x4bfd3d=0x0,_0x9aa619=events[_0xb618('0x6')];_0x4bfd3d<_0x9aa619;_0x4bfd3d++){var _0x1e031f=events[_0x4bfd3d];var _0x474db2=createListener('dashboard:'+_0x1e031f,_0x3d1e84);DashboardEvents['on'](_0x1e031f,_0x474db2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index df52b34..8c5e9e0 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 _0xa1c7=['getItems','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/items'];(function(_0x41b45e,_0x27d93e){var _0x5eac46=function(_0x580cab){while(--_0x580cab){_0x41b45e['push'](_0x41b45e['shift']());}};_0x5eac46(++_0x27d93e);}(_0xa1c7,0x1ec));var _0x7a1c=function(_0x3dfb61,_0xe69372){_0x3dfb61=_0x3dfb61-0x0;var _0x4df0c1=_0xa1c7[_0x3dfb61];return _0x4df0c1;};'use strict';var multer=require(_0x7a1c('0x0'));var util=require('util');var path=require(_0x7a1c('0x1'));var timeout=require(_0x7a1c('0x2'));var express=require(_0x7a1c('0x3'));var router=express[_0x7a1c('0x4')]();var fs_extra=require(_0x7a1c('0x5'));var auth=require(_0x7a1c('0x6'));var interaction=require(_0x7a1c('0x7'));var config=require(_0x7a1c('0x8'));var controller=require('./dashboard.controller');router[_0x7a1c('0x9')]('/',auth[_0x7a1c('0xa')](),controller['index']);router['get'](_0x7a1c('0xb'),auth['isAuthenticated'](),controller[_0x7a1c('0xc')]);router['get'](_0x7a1c('0xd'),auth[_0x7a1c('0xa')](),controller[_0x7a1c('0xe')]);router[_0x7a1c('0xf')]('/',auth[_0x7a1c('0xa')](),controller['create']);router[_0x7a1c('0xf')](_0x7a1c('0x10'),auth['isAuthenticated'](),controller[_0x7a1c('0x11')]);router[_0x7a1c('0xf')]('/:id/items',auth[_0x7a1c('0xa')](),controller['addItem']);router[_0x7a1c('0x12')]('/:id',auth[_0x7a1c('0xa')](),controller[_0x7a1c('0x13')]);router[_0x7a1c('0x14')](_0x7a1c('0xb'),auth[_0x7a1c('0xa')](),controller[_0x7a1c('0x15')]);module[_0x7a1c('0x16')]=router; \ No newline at end of file +var _0x7f03=['/:id/clone','clone','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create'];(function(_0x1b15b3,_0x54bc61){var _0x42cfcc=function(_0x47f836){while(--_0x47f836){_0x1b15b3['push'](_0x1b15b3['shift']());}};_0x42cfcc(++_0x54bc61);}(_0x7f03,0x118));var _0x37f0=function(_0x33e530,_0x54e69b){_0x33e530=_0x33e530-0x0;var _0x16b2b6=_0x7f03[_0x33e530];return _0x16b2b6;};'use strict';var multer=require(_0x37f0('0x0'));var util=require('util');var path=require(_0x37f0('0x1'));var timeout=require(_0x37f0('0x2'));var express=require(_0x37f0('0x3'));var router=express[_0x37f0('0x4')]();var fs_extra=require(_0x37f0('0x5'));var auth=require(_0x37f0('0x6'));var interaction=require(_0x37f0('0x7'));var config=require(_0x37f0('0x8'));var controller=require(_0x37f0('0x9'));router[_0x37f0('0xa')]('/',auth[_0x37f0('0xb')](),controller[_0x37f0('0xc')]);router['get'](_0x37f0('0xd'),auth[_0x37f0('0xb')](),controller[_0x37f0('0xe')]);router['get'](_0x37f0('0xf'),auth[_0x37f0('0xb')](),controller[_0x37f0('0x10')]);router[_0x37f0('0x11')]('/',auth[_0x37f0('0xb')](),controller[_0x37f0('0x12')]);router['post'](_0x37f0('0x13'),auth['isAuthenticated'](),controller[_0x37f0('0x14')]);router['post'](_0x37f0('0xf'),auth[_0x37f0('0xb')](),controller['addItem']);router['put']('/:id',auth[_0x37f0('0xb')](),controller[_0x37f0('0x15')]);router['delete'](_0x37f0('0xd'),auth['isAuthenticated'](),controller[_0x37f0('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7860269..e1495af 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 _0x5d58=['attrs','stringify','INTEGER','#2196f3','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x1d8427,_0x23aba3){var _0x3b4f68=function(_0x51f59b){while(--_0x51f59b){_0x1d8427['push'](_0x1d8427['shift']());}};_0x3b4f68(++_0x23aba3);}(_0x5d58,0x187));var _0x85d5=function(_0x342a8a,_0x3bec93){_0x342a8a=_0x342a8a-0x0;var _0x28d90c=_0x5d58[_0x342a8a];return _0x28d90c;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x85d5('0x0')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x85d5('0x1')]('long'),'get':function(){try{return JSON[_0x85d5('0x2')](this[_0x85d5('0x3')]('attrs'));}catch(_0x1eb211){return[];}},'set':function(_0x2d457a){try{this[_0x85d5('0x4')](_0x85d5('0x5'),JSON['stringify'](_0x2d457a));}catch(_0x98c963){this[_0x85d5('0x4')]('attrs',JSON[_0x85d5('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x85d5('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x85d5('0x7')]},'col':{'type':Sequelize[_0x85d5('0x7')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85d5('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x85d5('0x0')]},'titleFontSize':{'type':Sequelize[_0x85d5('0x7')],'defaultValue':0xc}}; \ No newline at end of file +var _0x524e=['exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash'];(function(_0x747e36,_0x56b694){var _0x41bbe6=function(_0x1e3463){while(--_0x1e3463){_0x747e36['push'](_0x747e36['shift']());}};_0x41bbe6(++_0x56b694);}(_0x524e,0x15e));var _0xe524=function(_0x3fa570,_0x72d8d5){_0x3fa570=_0x3fa570-0x0;var _0x6008f1=_0x524e[_0x3fa570];return _0x6008f1;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0xe524('0x0'));module[_0xe524('0x1')]={'title':{'type':Sequelize[_0xe524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe524('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe524('0x3')](_0xe524('0x4')),'get':function(){try{return JSON[_0xe524('0x5')](this[_0xe524('0x6')](_0xe524('0x7')));}catch(_0x110cff){return[];}},'set':function(_0x4f75d6){try{this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')](_0x4f75d6));}catch(_0x533c14){this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe524('0xa')]},'col':{'type':Sequelize[_0xe524('0xa')]},'background':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe524('0x2')]},'titleFontSize':{'type':Sequelize[_0xe524('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 5a63c7e..f4d10ca 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 _0x590c=['model','keys','DashboardItem','rawAttributes','query','attributes','intersection','fields','length','includeAll','merge','options','find','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','body','eml-format','fast-json-patch','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','../../config/environment','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','params'];(function(_0x3960e0,_0x4261d6){var _0xe5cbc4=function(_0x653bfb){while(--_0x653bfb){_0x3960e0['push'](_0x3960e0['shift']());}};_0xe5cbc4(++_0x4261d6);}(_0x590c,0x80));var _0xc590=function(_0x26c106,_0x1b1567){_0x26c106=_0x26c106-0x0;var _0x4b4352=_0x590c[_0x26c106];return _0x4b4352;};'use strict';var emlformat=require(_0xc590('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc590('0x1'));var rp=require(_0xc590('0x2'));var moment=require(_0xc590('0x3'));var BPromise=require(_0xc590('0x4'));var Mustache=require(_0xc590('0x5'));var util=require(_0xc590('0x6'));var path=require(_0xc590('0x7'));var sox=require(_0xc590('0x8'));var csv=require(_0xc590('0x9'));var ejs=require(_0xc590('0xa'));var fs=require('fs');var fs_extra=require(_0xc590('0xb'));var _=require(_0xc590('0xc'));var squel=require(_0xc590('0xd'));var crypto=require(_0xc590('0xe'));var jsforce=require(_0xc590('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc590('0x10'));var Papa=require(_0xc590('0x11'));var Redis=require('ioredis');var authService=require(_0xc590('0x12'));var qs=require(_0xc590('0x13'));var as=require(_0xc590('0x14'));var hardwareService=require(_0xc590('0x15'));var logger=require(_0xc590('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc590('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc590('0x18')](config[_0xc590('0x19')],{'host':_0xc590('0x1a'),'port':0x18eb});var socket=require(_0xc590('0x1b'))(new Redis(config[_0xc590('0x19')]));require(_0xc590('0x1c'))[_0xc590('0x1d')](socket);function respondWithStatusCode(_0x158e6b,_0x418024){_0x418024=_0x418024||0xcc;return function(_0x2a74fd){if(_0x2a74fd){return _0x158e6b[_0xc590('0x1e')](_0x418024);}return _0x158e6b[_0xc590('0x1f')](_0x418024)[_0xc590('0x20')]();};}function respondWithResult(_0x4b5000,_0x2f3886){_0x2f3886=_0x2f3886||0xc8;return function(_0x472207){if(_0x472207){return _0x4b5000[_0xc590('0x1f')](_0x2f3886)[_0xc590('0x21')](_0x472207);}};}function respondWithFilteredResult(_0x4197c2,_0x275672){return function(_0x1246ee){if(_0x1246ee){var _0x1515f1=typeof _0x275672[_0xc590('0x22')]===_0xc590('0x23')&&typeof _0x275672[_0xc590('0x24')]===_0xc590('0x23');var _0x1e4e8d=_0x1246ee[_0xc590('0x25')];var _0x4f24eb=_0x1515f1?0x0:_0x275672[_0xc590('0x22')];var _0x349516=_0x1515f1?_0x1246ee['count']:_0x275672['offset']+_0x275672[_0xc590('0x24')];var _0x3ef882;if(_0x349516>=_0x1e4e8d){_0x349516=_0x1e4e8d;_0x3ef882=0xc8;}else{_0x3ef882=0xce;}_0x4197c2[_0xc590('0x1f')](_0x3ef882);return _0x4197c2['set'](_0xc590('0x26'),_0x4f24eb+'-'+_0x349516+'/'+_0x1e4e8d)[_0xc590('0x21')](_0x1246ee);}return null;};}function patchUpdates(_0x4804d0){return function(_0x394220){try{jsonpatch[_0xc590('0x27')](_0x394220,_0x4804d0,!![]);}catch(_0x13e8b5){return BPromise[_0xc590('0x28')](_0x13e8b5);}return _0x394220[_0xc590('0x29')]();};}function saveUpdates(_0x4808ae,_0x50947c){return function(_0x4c2887){if(_0x4c2887){return _0x4c2887[_0xc590('0x2a')](_0x4808ae)[_0xc590('0x2b')](function(_0x1f7de3){return _0x1f7de3;});}return null;};}function removeEntity(_0x1b857f,_0xa27522){return function(_0x29e25b){if(_0x29e25b){return _0x29e25b[_0xc590('0x2c')]()[_0xc590('0x2b')](function(){_0x1b857f[_0xc590('0x1f')](0xcc)[_0xc590('0x20')]();});}};}function handleEntityNotFound(_0x91055,_0x245e2e){return function(_0x5eaf4c){if(!_0x5eaf4c){_0x91055[_0xc590('0x1e')](0x194);}return _0x5eaf4c;};}function handleError(_0x28f1cd,_0x418937){_0x418937=_0x418937||0x1f4;return function(_0x5509da){logger[_0xc590('0x2d')](_0x5509da['stack']);if(_0x5509da[_0xc590('0x2e')]){delete _0x5509da[_0xc590('0x2e')];}_0x28f1cd['status'](_0x418937)[_0xc590('0x2f')](_0x5509da);};}exports[_0xc590('0x30')]=function(_0x555497,_0xc7bebd){var _0xdffac9={'raw':![],'where':{'id':_0x555497[_0xc590('0x31')]['id']}},_0x424e4c={};_0x424e4c[_0xc590('0x32')]=_[_0xc590('0x33')](db[_0xc590('0x34')][_0xc590('0x35')]);_0x424e4c[_0xc590('0x36')]=_[_0xc590('0x33')](_0x555497[_0xc590('0x36')]);_0x424e4c['filters']=_['intersection'](_0x424e4c[_0xc590('0x32')],_0x424e4c[_0xc590('0x36')]);_0xdffac9[_0xc590('0x37')]=_[_0xc590('0x38')](_0x424e4c[_0xc590('0x32')],qs['fields'](_0x555497[_0xc590('0x36')][_0xc590('0x39')]));_0xdffac9[_0xc590('0x37')]=_0xdffac9[_0xc590('0x37')][_0xc590('0x3a')]?_0xdffac9[_0xc590('0x37')]:_0x424e4c[_0xc590('0x32')];if(_0x555497[_0xc590('0x36')][_0xc590('0x3b')]){_0xdffac9['include']=[{'all':!![]}];}_0xdffac9=_[_0xc590('0x3c')]({},_0xdffac9,_0x555497[_0xc590('0x3d')]);return db[_0xc590('0x34')][_0xc590('0x3e')](_0xdffac9)[_0xc590('0x2b')](handleEntityNotFound(_0xc7bebd,null))['then'](respondWithResult(_0xc7bebd,null))[_0xc590('0x3f')](handleError(_0xc7bebd,null));};exports[_0xc590('0x2c')]=function(_0x2a86ee,_0x1fb8ec){return db[_0xc590('0x34')][_0xc590('0x3e')]({'where':{'id':_0x2a86ee[_0xc590('0x31')]['id']}})[_0xc590('0x2b')](handleEntityNotFound(_0x1fb8ec,null))['then'](removeEntity(_0x1fb8ec,null))[_0xc590('0x3f')](handleError(_0x1fb8ec,null));};function widgetAttributes(_0x573285){try{switch(_0x573285['type']){case _0xc590('0x40'):return[{'name':'attrUrl','value':_0x573285[_0xc590('0x41')]||(_0x573285['attrs']&&_0x573285[_0xc590('0x42')][0x0]?_0x573285[_0xc590('0x42')][0x0][_0xc590('0x43')]:undefined)||_0xc590('0x44')}];case _0xc590('0x45'):return[{'name':'attrPath','value':_0x573285[_0xc590('0x46')]||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x0]?_0x573285[_0xc590('0x42')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xc590('0x47'),'value':_0x573285[_0xc590('0x47')]||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x0]?_0x573285[_0xc590('0x42')][0x0][_0xc590('0x43')]:undefined)||_0xc590('0x48')},{'name':_0xc590('0x49'),'value':_0x573285[_0xc590('0x49')]||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x1]?_0x573285[_0xc590('0x42')][0x1]['value']:undefined)||_0xc590('0x4a')},{'name':_0xc590('0x4b'),'value':_0x573285['attrFontSize']||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x2]?_0x573285[_0xc590('0x42')][0x2][_0xc590('0x43')]:undefined)||0xc}];case _0xc590('0x4c'):return[{'name':'attrMetric','value':_0x573285[_0xc590('0x4d')]||(_0x573285['attrs']&&_0x573285[_0xc590('0x42')][0x0]?_0x573285['attrs'][0x0]['value']:undefined)||_0xc590('0x4e')},{'name':'attrVoiceQueues','value':_0x573285['attrVoiceQueues']||(_0x573285['attrs']&&_0x573285[_0xc590('0x42')][0x1]?_0x573285[_0xc590('0x42')][0x1][_0xc590('0x43')]:undefined)||[]},{'name':_0xc590('0x4b'),'value':_0x573285[_0xc590('0x4b')]||(_0x573285['attrs']&&_0x573285[_0xc590('0x42')][0x2]?_0x573285[_0xc590('0x42')][0x2][_0xc590('0x43')]:undefined)||0x14}];case'multibar-chart':case _0xc590('0x4f'):return[{'name':_0xc590('0x50'),'value':_0x573285['attrSerie1']||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x0]?_0x573285[_0xc590('0x42')][0x0][_0xc590('0x43')]:undefined)||_0xc590('0x4e')},{'name':_0xc590('0x51'),'value':_0x573285[_0xc590('0x51')]||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x1]?_0x573285['attrs'][0x1][_0xc590('0x43')]:undefined)||null},{'name':_0xc590('0x52'),'value':_0x573285['attrSerie3']||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x2]?_0x573285['attrs'][0x2][_0xc590('0x43')]:undefined)||null},{'name':_0xc590('0x53'),'value':_0x573285['attrVoiceQueues']||(_0x573285['attrs']&&_0x573285[_0xc590('0x42')][0x3]?_0x573285[_0xc590('0x42')][0x3][_0xc590('0x43')]:undefined)||[]}];case _0xc590('0x54'):return[{'name':'attrReport','type':_0x573285['reportType']||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x0]?_0x573285[_0xc590('0x42')][0x0]['type']:undefined)||null,'value':_0x573285[_0xc590('0x55')]||(_0x573285[_0xc590('0x42')]&&_0x573285[_0xc590('0x42')][0x0]?_0x573285[_0xc590('0x42')][0x0][_0xc590('0x43')]:undefined)||null},{'name':_0xc590('0x56'),'value':_0x573285[_0xc590('0x56')]||(_0x573285[_0xc590('0x42')]&&_0x573285['attrs'][0x1]?_0x573285[_0xc590('0x42')][0x1][_0xc590('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x326619){logger[_0xc590('0x2d')](_0xc590('0x57'),JSON['stringify'](_0x326619));return[];}}exports['create']=function(_0x11a531,_0x366413){if(_0x11a531[_0xc590('0x58')]){_0x11a531[_0xc590('0x58')][_0xc590('0x42')]=widgetAttributes(_0x11a531['body']);}return db[_0xc590('0x34')]['create'](_0x11a531['body'],{})[_0xc590('0x2b')](respondWithResult(_0x366413,0xc9))[_0xc590('0x3f')](handleError(_0x366413,null));};exports[_0xc590('0x2a')]=function(_0x51a6e0,_0x59dcd2){if(_0x51a6e0[_0xc590('0x58')]['id']){delete _0x51a6e0[_0xc590('0x58')]['id'];}_0x51a6e0[_0xc590('0x58')][_0xc590('0x42')]=widgetAttributes(_0x51a6e0['body']);return db[_0xc590('0x34')][_0xc590('0x3e')]({'where':{'id':_0x51a6e0[_0xc590('0x31')]['id']}})['then'](handleEntityNotFound(_0x59dcd2,null))['then'](saveUpdates(_0x51a6e0['body'],null))[_0xc590('0x2b')](respondWithResult(_0x59dcd2,null))['catch'](handleError(_0x59dcd2,null));}; \ No newline at end of file +var _0x089f=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','rawAttributes','query','keys','filters','attributes','intersection','fields','includeAll','merge','options','DashboardItem','find','destroy','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x089f,0x1c7));var _0xf089=function(_0x588f62,_0x3af9b4){_0x588f62=_0x588f62-0x0;var _0x24e645=_0x089f[_0x588f62];return _0x24e645;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf089('0x0'));var zipdir=require(_0xf089('0x1'));var jsonpatch=require(_0xf089('0x2'));var rp=require(_0xf089('0x3'));var moment=require(_0xf089('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf089('0x5'));var util=require(_0xf089('0x6'));var path=require(_0xf089('0x7'));var sox=require('sox');var csv=require(_0xf089('0x8'));var ejs=require(_0xf089('0x9'));var fs=require('fs');var fs_extra=require(_0xf089('0xa'));var _=require('lodash');var squel=require(_0xf089('0xb'));var crypto=require(_0xf089('0xc'));var jsforce=require(_0xf089('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf089('0x8'));var querystring=require(_0xf089('0xe'));var Papa=require(_0xf089('0xf'));var Redis=require(_0xf089('0x10'));var authService=require(_0xf089('0x11'));var qs=require(_0xf089('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf089('0x13'));var logger=require(_0xf089('0x14'))(_0xf089('0x15'));var utils=require('../../config/utils');var config=require(_0xf089('0x16'));var licenseUtil=require(_0xf089('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf089('0x18')](config[_0xf089('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf089('0x1a'))(new Redis(config[_0xf089('0x19')]));require(_0xf089('0x1b'))[_0xf089('0x1c')](socket);function respondWithStatusCode(_0x58b0db,_0x329719){_0x329719=_0x329719||0xcc;return function(_0x4e6438){if(_0x4e6438){return _0x58b0db[_0xf089('0x1d')](_0x329719);}return _0x58b0db['status'](_0x329719)[_0xf089('0x1e')]();};}function respondWithResult(_0x5aee45,_0x3bc27b){_0x3bc27b=_0x3bc27b||0xc8;return function(_0x250d5e){if(_0x250d5e){return _0x5aee45[_0xf089('0x1f')](_0x3bc27b)[_0xf089('0x20')](_0x250d5e);}};}function respondWithFilteredResult(_0xbd29ca,_0x57f2a7){return function(_0x7fbed5){if(_0x7fbed5){var _0x4e714a=typeof _0x57f2a7[_0xf089('0x21')]===_0xf089('0x22')&&typeof _0x57f2a7['limit']===_0xf089('0x22');var _0x6ebaa7=_0x7fbed5['count'];var _0x2c67c1=_0x4e714a?0x0:_0x57f2a7[_0xf089('0x21')];var _0x33ec2a=_0x4e714a?_0x7fbed5[_0xf089('0x23')]:_0x57f2a7[_0xf089('0x21')]+_0x57f2a7[_0xf089('0x24')];var _0x23a008;if(_0x33ec2a>=_0x6ebaa7){_0x33ec2a=_0x6ebaa7;_0x23a008=0xc8;}else{_0x23a008=0xce;}_0xbd29ca[_0xf089('0x1f')](_0x23a008);return _0xbd29ca[_0xf089('0x25')](_0xf089('0x26'),_0x2c67c1+'-'+_0x33ec2a+'/'+_0x6ebaa7)['json'](_0x7fbed5);}return null;};}function patchUpdates(_0x36ace9){return function(_0x31050f){try{jsonpatch[_0xf089('0x27')](_0x31050f,_0x36ace9,!![]);}catch(_0x1b9444){return BPromise[_0xf089('0x28')](_0x1b9444);}return _0x31050f[_0xf089('0x29')]();};}function saveUpdates(_0x249b88,_0x94df4d){return function(_0x22f2f2){if(_0x22f2f2){return _0x22f2f2[_0xf089('0x2a')](_0x249b88)['then'](function(_0x3ec39b){return _0x3ec39b;});}return null;};}function removeEntity(_0x598a4e,_0x38078a){return function(_0x372a7a){if(_0x372a7a){return _0x372a7a['destroy']()[_0xf089('0x2b')](function(){_0x598a4e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42c286,_0x220746){return function(_0x2ffff6){if(!_0x2ffff6){_0x42c286[_0xf089('0x1d')](0x194);}return _0x2ffff6;};}function handleError(_0x14aa96,_0x52e6ac){_0x52e6ac=_0x52e6ac||0x1f4;return function(_0x210147){logger['error'](_0x210147[_0xf089('0x2c')]);if(_0x210147[_0xf089('0x2d')]){delete _0x210147[_0xf089('0x2d')];}_0x14aa96[_0xf089('0x1f')](_0x52e6ac)[_0xf089('0x2e')](_0x210147);};}exports[_0xf089('0x2f')]=function(_0x3268ca,_0x29eb23){var _0x281fee={'raw':![],'where':{'id':_0x3268ca[_0xf089('0x30')]['id']}},_0x2df2bb={};_0x2df2bb[_0xf089('0x31')]=_['keys'](db['DashboardItem'][_0xf089('0x32')]);_0x2df2bb[_0xf089('0x33')]=_[_0xf089('0x34')](_0x3268ca[_0xf089('0x33')]);_0x2df2bb[_0xf089('0x35')]=_['intersection'](_0x2df2bb['model'],_0x2df2bb[_0xf089('0x33')]);_0x281fee[_0xf089('0x36')]=_[_0xf089('0x37')](_0x2df2bb[_0xf089('0x31')],qs[_0xf089('0x38')](_0x3268ca[_0xf089('0x33')][_0xf089('0x38')]));_0x281fee[_0xf089('0x36')]=_0x281fee[_0xf089('0x36')]['length']?_0x281fee[_0xf089('0x36')]:_0x2df2bb['model'];if(_0x3268ca[_0xf089('0x33')][_0xf089('0x39')]){_0x281fee['include']=[{'all':!![]}];}_0x281fee=_[_0xf089('0x3a')]({},_0x281fee,_0x3268ca[_0xf089('0x3b')]);return db[_0xf089('0x3c')][_0xf089('0x3d')](_0x281fee)['then'](handleEntityNotFound(_0x29eb23,null))[_0xf089('0x2b')](respondWithResult(_0x29eb23,null))['catch'](handleError(_0x29eb23,null));};exports[_0xf089('0x3e')]=function(_0x5ac407,_0x5b51ba){return db['DashboardItem'][_0xf089('0x3d')]({'where':{'id':_0x5ac407[_0xf089('0x30')]['id']}})['then'](handleEntityNotFound(_0x5b51ba,null))['then'](removeEntity(_0x5b51ba,null))['catch'](handleError(_0x5b51ba,null));};function widgetAttributes(_0x9d8b9d){try{switch(_0x9d8b9d[_0xf089('0x3f')]){case _0xf089('0x40'):return[{'name':_0xf089('0x41'),'value':_0x9d8b9d['attrUrl']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x0]?_0x9d8b9d[_0xf089('0x42')][0x0]['value']:undefined)||_0xf089('0x43')}];case'custom':return[{'name':_0xf089('0x44'),'value':_0x9d8b9d[_0xf089('0x44')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x0]?_0x9d8b9d[_0xf089('0x42')][0x0][_0xf089('0x45')]:undefined)||''}];case _0xf089('0x46'):return[{'name':_0xf089('0x47'),'value':_0x9d8b9d[_0xf089('0x47')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d['attrs'][0x0]?_0x9d8b9d[_0xf089('0x42')][0x0][_0xf089('0x45')]:undefined)||_0xf089('0x48')},{'name':'attrTimezone','value':_0x9d8b9d['attrTimezone']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x1]?_0x9d8b9d[_0xf089('0x42')][0x1]['value']:undefined)||_0xf089('0x49')},{'name':_0xf089('0x4a'),'value':_0x9d8b9d['attrFontSize']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x2]?_0x9d8b9d['attrs'][0x2][_0xf089('0x45')]:undefined)||0xc}];case'counter':return[{'name':_0xf089('0x4b'),'value':_0x9d8b9d[_0xf089('0x4b')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x0]?_0x9d8b9d[_0xf089('0x42')][0x0]['value']:undefined)||_0xf089('0x4c')},{'name':_0xf089('0x4d'),'value':_0x9d8b9d['attrVoiceQueues']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x1]?_0x9d8b9d[_0xf089('0x42')][0x1][_0xf089('0x45')]:undefined)||[]},{'name':_0xf089('0x4a'),'value':_0x9d8b9d[_0xf089('0x4a')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d['attrs'][0x2]?_0x9d8b9d['attrs'][0x2]['value']:undefined)||0x14}];case _0xf089('0x4e'):case _0xf089('0x4f'):return[{'name':_0xf089('0x50'),'value':_0x9d8b9d[_0xf089('0x50')]||(_0x9d8b9d['attrs']&&_0x9d8b9d[_0xf089('0x42')][0x0]?_0x9d8b9d['attrs'][0x0][_0xf089('0x45')]:undefined)||_0xf089('0x4c')},{'name':_0xf089('0x51'),'value':_0x9d8b9d['attrSerie2']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x1]?_0x9d8b9d['attrs'][0x1][_0xf089('0x45')]:undefined)||null},{'name':_0xf089('0x52'),'value':_0x9d8b9d[_0xf089('0x52')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d['attrs'][0x2]?_0x9d8b9d[_0xf089('0x42')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x9d8b9d[_0xf089('0x4d')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d['attrs'][0x3]?_0x9d8b9d[_0xf089('0x42')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x9d8b9d['reportType']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x0]?_0x9d8b9d['attrs'][0x0][_0xf089('0x3f')]:undefined)||null,'value':_0x9d8b9d[_0xf089('0x53')]||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x0]?_0x9d8b9d[_0xf089('0x42')][0x0][_0xf089('0x45')]:undefined)||null},{'name':_0xf089('0x54'),'value':_0x9d8b9d['attrRefresh']||(_0x9d8b9d[_0xf089('0x42')]&&_0x9d8b9d[_0xf089('0x42')][0x1]?_0x9d8b9d[_0xf089('0x42')][0x1][_0xf089('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x52ed2d){logger[_0xf089('0x55')](_0xf089('0x56'),JSON[_0xf089('0x57')](_0x52ed2d));return[];}}exports[_0xf089('0x58')]=function(_0x356bfd,_0x292766){if(_0x356bfd[_0xf089('0x59')]){_0x356bfd['body']['attrs']=widgetAttributes(_0x356bfd['body']);}return db[_0xf089('0x3c')][_0xf089('0x58')](_0x356bfd['body'],{})['then'](respondWithResult(_0x292766,0xc9))[_0xf089('0x5a')](handleError(_0x292766,null));};exports[_0xf089('0x2a')]=function(_0x34b58b,_0x13aea0){if(_0x34b58b[_0xf089('0x59')]['id']){delete _0x34b58b[_0xf089('0x59')]['id'];}_0x34b58b[_0xf089('0x59')]['attrs']=widgetAttributes(_0x34b58b['body']);return db[_0xf089('0x3c')][_0xf089('0x3d')]({'where':{'id':_0x34b58b[_0xf089('0x30')]['id']}})['then'](handleEntityNotFound(_0x13aea0,null))[_0xf089('0x2b')](saveUpdates(_0x34b58b[_0xf089('0x59')],null))[_0xf089('0x2b')](respondWithResult(_0x13aea0,null))[_0xf089('0x5a')](handleError(_0x13aea0,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 19ed1b7..8c8898d 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 _0x63a6=['save','update','emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x333767,_0x220733){var _0x42a755=function(_0x535b16){while(--_0x535b16){_0x333767['push'](_0x333767['shift']());}};_0x42a755(++_0x220733);}(_0x63a6,0x12e));var _0x663a=function(_0x4941c6,_0x3ca9f8){_0x4941c6=_0x4941c6-0x0;var _0x4d3654=_0x63a6[_0x4941c6];return _0x4d3654;};'use strict';var EventEmitter=require(_0x663a('0x0'));var DashboardItem=require(_0x663a('0x1'))['db'][_0x663a('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x663a('0x3')](0x0);var events={'afterCreate':_0x663a('0x4'),'afterUpdate':_0x663a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48b9c2){return function(_0x21b93a,_0x311614,_0x1b065d){DashboardItemEvents[_0x663a('0x6')](_0x48b9c2+':'+_0x21b93a['id'],_0x21b93a);DashboardItemEvents[_0x663a('0x6')](_0x48b9c2,_0x21b93a);_0x1b065d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x663a('0x7')](e,emitEvent(event));}}module[_0x663a('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x18d9=['hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit'];(function(_0x2138c3,_0x25a7cd){var _0x1162bb=function(_0xc0eebd){while(--_0xc0eebd){_0x2138c3['push'](_0x2138c3['shift']());}};_0x1162bb(++_0x25a7cd);}(_0x18d9,0x13e));var _0x918d=function(_0x193d9d,_0x52705f){_0x193d9d=_0x193d9d-0x0;var _0x1a1148=_0x18d9[_0x193d9d];return _0x1a1148;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x918d('0x0'))['db'][_0x918d('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x918d('0x2')](0x0);var events={'afterCreate':_0x918d('0x3'),'afterUpdate':'update','afterDestroy':_0x918d('0x4')};function emitEvent(_0xb31d41){return function(_0x24a139,_0x38a99b,_0x2e2a5b){DashboardItemEvents[_0x918d('0x5')](_0xb31d41+':'+_0x24a139['id'],_0x24a139);DashboardItemEvents[_0x918d('0x5')](_0xb31d41,_0x24a139);_0x2e2a5b(null);};}for(var e in events){if(events[_0x918d('0x6')](e)){var event=events[e];DashboardItem[_0x918d('0x7')](e,emitEvent(event));}}module[_0x918d('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 0feb481..a1ceb6a 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 _0xf9cb=['define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./dashboardItem.attributes'];(function(_0x495d1f,_0x390d91){var _0x21fa49=function(_0x411b3a){while(--_0x411b3a){_0x495d1f['push'](_0x495d1f['shift']());}};_0x21fa49(++_0x390d91);}(_0xf9cb,0xdb));var _0xbf9c=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0xf9cb[_0x680821];return _0x3f132c;};'use strict';var _=require(_0xbf9c('0x0'));var util=require(_0xbf9c('0x1'));var logger=require(_0xbf9c('0x2'))(_0xbf9c('0x3'));var moment=require(_0xbf9c('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf9c('0x5'));var fs=require('fs');var path=require(_0xbf9c('0x6'));var rimraf=require(_0xbf9c('0x7'));var config=require('../../config/environment');var attributes=require(_0xbf9c('0x8'));module['exports']=function(_0x4d9d35,_0x5be1a7){return _0x4d9d35[_0xbf9c('0x9')](_0xbf9c('0xa'),attributes,{'tableName':_0xbf9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe497=['api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','util','../../config/logger'];(function(_0x1d7f54,_0x54598a){var _0x378681=function(_0x2349d4){while(--_0x2349d4){_0x1d7f54['push'](_0x1d7f54['shift']());}};_0x378681(++_0x54598a);}(_0xe497,0xb3));var _0x7e49=function(_0x50fbb4,_0x373d07){_0x50fbb4=_0x50fbb4-0x0;var _0x22715a=_0xe497[_0x50fbb4];return _0x22715a;};'use strict';var _=require(_0x7e49('0x0'));var util=require(_0x7e49('0x1'));var logger=require(_0x7e49('0x2'))(_0x7e49('0x3'));var moment=require(_0x7e49('0x4'));var BPromise=require('bluebird');var rp=require(_0x7e49('0x5'));var fs=require('fs');var path=require(_0x7e49('0x6'));var rimraf=require(_0x7e49('0x7'));var config=require(_0x7e49('0x8'));var attributes=require(_0x7e49('0x9'));module[_0x7e49('0xa')]=function(_0x163dc8,_0x1b1be5){return _0x163dc8[_0x7e49('0xb')](_0x7e49('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 303fa74..3dd5af4 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 _0x1a15=['http','redis','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4815a6,_0x29ef5e){var _0x309740=function(_0x4c6caf){while(--_0x4c6caf){_0x4815a6['push'](_0x4815a6['shift']());}};_0x309740(++_0x29ef5e);}(_0x1a15,0x7c));var _0x51a1=function(_0x232ab1,_0x51d9f5){_0x232ab1=_0x232ab1-0x0;var _0x5d26f0=_0x1a15[_0x232ab1];return _0x5d26f0;};'use strict';var _=require(_0x51a1('0x0'));var util=require(_0x51a1('0x1'));var moment=require(_0x51a1('0x2'));var BPromise=require(_0x51a1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51a1('0x4'));var db=require(_0x51a1('0x5'))['db'];var utils=require(_0x51a1('0x6'));var logger=require(_0x51a1('0x7'))(_0x51a1('0x8'));var config=require(_0x51a1('0x9'));var jayson=require(_0x51a1('0xa'));var client=jayson['client'][_0x51a1('0xb')]({'port':0x232a});config[_0x51a1('0xc')]=_['defaults'](config[_0x51a1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a1('0xd'))(new Redis(config[_0x51a1('0xc')]));require(_0x51a1('0xe'))[_0x51a1('0xf')](socket);function respondWithRpcPromise(_0xe4a747,_0x113202,_0x28155c){return new BPromise(function(_0x16dd40,_0x1e30e4){return client[_0x51a1('0x10')](_0xe4a747,_0x28155c)[_0x51a1('0x11')](function(_0x1738d3){logger[_0x51a1('0x12')](_0x51a1('0x13'),_0x113202,_0x51a1('0x14'));logger['debug'](_0x51a1('0x15'),_0x113202,_0x51a1('0x14'),JSON['stringify'](_0x1738d3));if(_0x1738d3[_0x51a1('0x16')]){if(_0x1738d3[_0x51a1('0x16')][_0x51a1('0x17')]===0x1f4){logger[_0x51a1('0x16')](_0x51a1('0x13'),_0x113202,_0x1738d3[_0x51a1('0x16')][_0x51a1('0x18')]);return _0x1e30e4(_0x1738d3['error'][_0x51a1('0x18')]);}logger[_0x51a1('0x16')](_0x51a1('0x13'),_0x113202,_0x1738d3[_0x51a1('0x16')][_0x51a1('0x18')]);return _0x16dd40(_0x1738d3[_0x51a1('0x16')][_0x51a1('0x18')]);}else{logger[_0x51a1('0x12')](_0x51a1('0x13'),_0x113202,_0x51a1('0x14'));_0x16dd40(_0x1738d3[_0x51a1('0x19')]['message']);}})[_0x51a1('0x1a')](function(_0x2edc62){logger[_0x51a1('0x16')](_0x51a1('0x13'),_0x113202,_0x2edc62);_0x1e30e4(_0x2edc62);});});} \ No newline at end of file +var _0x5505=['jayson/promise','http','socket.io-emitter','redis','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','DashboardItem,\x20%s,\x20%s','request\x20sent','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x18c4bb,_0x4d00d7){var _0x473656=function(_0xea933c){while(--_0xea933c){_0x18c4bb['push'](_0x18c4bb['shift']());}};_0x473656(++_0x4d00d7);}(_0x5505,0x1ad));var _0x5550=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5505[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x5550('0x0'));var moment=require(_0x5550('0x1'));var BPromise=require('bluebird');var rs=require(_0x5550('0x2'));var fs=require('fs');var Redis=require(_0x5550('0x3'));var db=require(_0x5550('0x4'))['db'];var utils=require(_0x5550('0x5'));var logger=require('../../config/logger')(_0x5550('0x6'));var config=require(_0x5550('0x7'));var jayson=require(_0x5550('0x8'));var client=jayson['client'][_0x5550('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5550('0xa'))(new Redis(config[_0x5550('0xb')]));require(_0x5550('0xc'))[_0x5550('0xd')](socket);function respondWithRpcPromise(_0x19668e,_0x4fd092,_0x275e00){return new BPromise(function(_0x331d18,_0x5b60be){return client['request'](_0x19668e,_0x275e00)[_0x5550('0xe')](function(_0x124313){logger[_0x5550('0xf')]('DashboardItem,\x20%s,\x20%s',_0x4fd092,'request\x20sent');logger['debug'](_0x5550('0x10'),_0x4fd092,'request\x20sent',JSON['stringify'](_0x124313));if(_0x124313[_0x5550('0x11')]){if(_0x124313['error'][_0x5550('0x12')]===0x1f4){logger[_0x5550('0x11')]('DashboardItem,\x20%s,\x20%s',_0x4fd092,_0x124313[_0x5550('0x11')][_0x5550('0x13')]);return _0x5b60be(_0x124313['error']['message']);}logger[_0x5550('0x11')](_0x5550('0x14'),_0x4fd092,_0x124313[_0x5550('0x11')][_0x5550('0x13')]);return _0x331d18(_0x124313[_0x5550('0x11')][_0x5550('0x13')]);}else{logger[_0x5550('0xf')]('DashboardItem,\x20%s,\x20%s',_0x4fd092,_0x5550('0x15'));_0x331d18(_0x124313['result']['message']);}})[_0x5550('0x16')](function(_0x1f3604){logger[_0x5550('0x11')](_0x5550('0x14'),_0x4fd092,_0x1f3604);_0x5b60be(_0x1f3604);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index ca2fe9e..1573f82 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 _0x5bf1=['update','emit','register','length','./dashboardItem.events','save'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x5bf1,0x1d2));var _0x15bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5bf1[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardItemEvents=require(_0x15bf('0x0'));var events=[_0x15bf('0x1'),'remove',_0x15bf('0x2')];function createListener(_0x12c11a,_0x20866d){return function(_0x4817fd){_0x20866d[_0x15bf('0x3')](_0x12c11a,_0x4817fd);};}function removeListener(_0x20b1d1,_0x20d21b){return function(){DashboardItemEvents['removeListener'](_0x20b1d1,_0x20d21b);};}exports[_0x15bf('0x4')]=function(_0x22358e){for(var _0x1d32ae=0x0,_0x55ac5e=events[_0x15bf('0x5')];_0x1d32ae<_0x55ac5e;_0x1d32ae++){var _0x5e0408=events[_0x1d32ae];var _0x483dfd=createListener('dashboardItem:'+_0x5e0408,_0x22358e);DashboardItemEvents['on'](_0x5e0408,_0x483dfd);}}; \ No newline at end of file +var _0x0cd2=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x0cd2,0x113));var _0x20cd=function(_0x3ec00b,_0x250290){_0x3ec00b=_0x3ec00b-0x0;var _0x4290d6=_0x0cd2[_0x3ec00b];return _0x4290d6;};'use strict';var DashboardItemEvents=require(_0x20cd('0x0'));var events=[_0x20cd('0x1'),_0x20cd('0x2'),_0x20cd('0x3')];function createListener(_0x5a1b83,_0xcaf6d0){return function(_0x237c1a){_0xcaf6d0[_0x20cd('0x4')](_0x5a1b83,_0x237c1a);};}function removeListener(_0x26e4e0,_0x27ef65){return function(){DashboardItemEvents['removeListener'](_0x26e4e0,_0x27ef65);};}exports[_0x20cd('0x5')]=function(_0x466c43){for(var _0x8fd8fc=0x0,_0x202953=events[_0x20cd('0x6')];_0x8fd8fc<_0x202953;_0x8fd8fc++){var _0x4fc876=events[_0x8fd8fc];var _0x3c0283=createListener(_0x20cd('0x7')+_0x4fc876,_0x466c43);DashboardItemEvents['on'](_0x4fc876,_0x3c0283);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d3f013d..e91c563 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 _0xe18f=['Router','fs-extra','../../components/auth/service','./dashboardItem.controller','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express'];(function(_0xd90726,_0x175e8c){var _0x48b12a=function(_0x424bf1){while(--_0x424bf1){_0xd90726['push'](_0xd90726['shift']());}};_0x48b12a(++_0x175e8c);}(_0xe18f,0x11d));var _0xfe18=function(_0x5cb8ee,_0x4e77c8){_0x5cb8ee=_0x5cb8ee-0x0;var _0x575d8e=_0xe18f[_0x5cb8ee];return _0x575d8e;};'use strict';var multer=require(_0xfe18('0x0'));var util=require('util');var path=require(_0xfe18('0x1'));var timeout=require(_0xfe18('0x2'));var express=require(_0xfe18('0x3'));var router=express[_0xfe18('0x4')]();var fs_extra=require(_0xfe18('0x5'));var auth=require(_0xfe18('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfe18('0x7'));router['get']('/:id',auth[_0xfe18('0x8')](),controller[_0xfe18('0x9')]);router[_0xfe18('0xa')]('/',auth[_0xfe18('0x8')](),controller[_0xfe18('0xb')]);router[_0xfe18('0xc')](_0xfe18('0xd'),auth[_0xfe18('0x8')](),controller[_0xfe18('0xe')]);router[_0xfe18('0xf')](_0xfe18('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe18('0x10')]=router; \ No newline at end of file +var _0x1ca9=['get','/:id','isAuthenticated','show','post','create','put','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5e749f,_0x2b87d5){var _0x360767=function(_0x13a80f){while(--_0x13a80f){_0x5e749f['push'](_0x5e749f['shift']());}};_0x360767(++_0x2b87d5);}(_0x1ca9,0x198));var _0x91ca=function(_0x2b406e,_0x8460fe){_0x2b406e=_0x2b406e-0x0;var _0x20be0c=_0x1ca9[_0x2b406e];return _0x20be0c;};'use strict';var multer=require(_0x91ca('0x0'));var util=require(_0x91ca('0x1'));var path=require(_0x91ca('0x2'));var timeout=require('connect-timeout');var express=require(_0x91ca('0x3'));var router=express[_0x91ca('0x4')]();var fs_extra=require(_0x91ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x91ca('0x6'));var config=require(_0x91ca('0x7'));var controller=require('./dashboardItem.controller');router[_0x91ca('0x8')](_0x91ca('0x9'),auth[_0x91ca('0xa')](),controller[_0x91ca('0xb')]);router[_0x91ca('0xc')]('/',auth[_0x91ca('0xa')](),controller[_0x91ca('0xd')]);router[_0x91ca('0xe')](_0x91ca('0x9'),auth[_0x91ca('0xa')](),controller['update']);router[_0x91ca('0xf')]('/:id',auth[_0x91ca('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 99a4a1c..0ea2242 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 _0x2e73=['first','second','STRING','ENUM'];(function(_0x48449a,_0x49f179){var _0x41f26a=function(_0x7634b2){while(--_0x7634b2){_0x48449a['push'](_0x48449a['shift']());}};_0x41f26a(++_0x49f179);}(_0x2e73,0x16e));var _0x32e7=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x2e73[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x32e7('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x32e7('0x1')](_0x32e7('0x2'),_0x32e7('0x3'),'third'),'allowNull':![],'defaultValue':_0x32e7('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe123=['ENUM','first','second','third','STRING','sequelize'];(function(_0x43bfe5,_0x41ab0d){var _0x1fa0c1=function(_0x43313f){while(--_0x43313f){_0x43bfe5['push'](_0x43bfe5['shift']());}};_0x1fa0c1(++_0x41ab0d);}(_0xe123,0x89));var _0x3e12=function(_0xac465b,_0x29f752){_0xac465b=_0xac465b-0x0;var _0x3a529d=_0xe123[_0xac465b];return _0x3a529d;};'use strict';var Sequelize=require(_0x3e12('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x3e12('0x1')](_0x3e12('0x2'),_0x3e12('0x3'),_0x3e12('0x4')),'allowNull':![],'defaultValue':_0x3e12('0x2')},'description':{'type':Sequelize[_0x3e12('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 9370bb0..9eeb725 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 _0x0475=['intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','reject','then','destroy','get','Dispositions','UserProfileResource','name','send','index','Disposition','type','key','model','map','query','keys','filters'];(function(_0x5c1829,_0x5e5b18){var _0x45dd65=function(_0x2c08bf){while(--_0x2c08bf){_0x5c1829['push'](_0x5c1829['shift']());}};_0x45dd65(++_0x5e5b18);}(_0x0475,0xbc));var _0x5047=function(_0x388960,_0x2a8993){_0x388960=_0x388960-0x0;var _0x8237db=_0x0475[_0x388960];return _0x8237db;};'use strict';var emlformat=require(_0x5047('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5047('0x1'));var rp=require(_0x5047('0x2'));var moment=require(_0x5047('0x3'));var BPromise=require(_0x5047('0x4'));var Mustache=require(_0x5047('0x5'));var util=require('util');var path=require(_0x5047('0x6'));var sox=require(_0x5047('0x7'));var csv=require(_0x5047('0x8'));var ejs=require(_0x5047('0x9'));var fs=require('fs');var fs_extra=require(_0x5047('0xa'));var _=require(_0x5047('0xb'));var squel=require('squel');var crypto=require(_0x5047('0xc'));var jsforce=require(_0x5047('0xd'));var deskjs=require(_0x5047('0xe'));var toCsv=require(_0x5047('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5047('0xf'));var authService=require(_0x5047('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5047('0x11'));var logger=require(_0x5047('0x12'))(_0x5047('0x13'));var utils=require(_0x5047('0x14'));var config=require(_0x5047('0x15'));var licenseUtil=require(_0x5047('0x16'));var db=require(_0x5047('0x17'))['db'];function respondWithStatusCode(_0x3ad4cc,_0x379fc8){_0x379fc8=_0x379fc8||0xcc;return function(_0x54f217){if(_0x54f217){return _0x3ad4cc[_0x5047('0x18')](_0x379fc8);}return _0x3ad4cc[_0x5047('0x19')](_0x379fc8)[_0x5047('0x1a')]();};}function respondWithResult(_0xb5716,_0x5908e0){_0x5908e0=_0x5908e0||0xc8;return function(_0x58bd25){if(_0x58bd25){return _0xb5716[_0x5047('0x19')](_0x5908e0)[_0x5047('0x1b')](_0x58bd25);}};}function respondWithFilteredResult(_0x54055b,_0x35d82c){return function(_0x22cdff){if(_0x22cdff){var _0x15243c=typeof _0x35d82c[_0x5047('0x1c')]===_0x5047('0x1d')&&typeof _0x35d82c[_0x5047('0x1e')]===_0x5047('0x1d');var _0x34bad5=_0x22cdff['count'];var _0x28bfb1=_0x15243c?0x0:_0x35d82c[_0x5047('0x1c')];var _0x3fce93=_0x15243c?_0x22cdff['count']:_0x35d82c[_0x5047('0x1c')]+_0x35d82c['limit'];var _0x4ad6f1;if(_0x3fce93>=_0x34bad5){_0x3fce93=_0x34bad5;_0x4ad6f1=0xc8;}else{_0x4ad6f1=0xce;}_0x54055b['status'](_0x4ad6f1);return _0x54055b[_0x5047('0x1f')]('Content-Range',_0x28bfb1+'-'+_0x3fce93+'/'+_0x34bad5)['json'](_0x22cdff);}return null;};}function patchUpdates(_0x2084e9){return function(_0x2d96cb){try{jsonpatch['apply'](_0x2d96cb,_0x2084e9,!![]);}catch(_0x1e8d8d){return BPromise[_0x5047('0x20')](_0x1e8d8d);}return _0x2d96cb['save']();};}function saveUpdates(_0x407f6d,_0x416668){return function(_0x57f9da){if(_0x57f9da){return _0x57f9da['update'](_0x407f6d)[_0x5047('0x21')](function(_0x17e87b){return _0x17e87b;});}return null;};}function removeEntity(_0x1f2423,_0x5c4c15){return function(_0x5a1a82){if(_0x5a1a82){return _0x5a1a82[_0x5047('0x22')]()[_0x5047('0x21')](function(){var _0x432739=_0x5a1a82[_0x5047('0x23')]({'plain':!![]});var _0x3584ab=_0x5047('0x24');return db[_0x5047('0x25')][_0x5047('0x22')]({'where':{'type':_0x3584ab,'resourceId':_0x432739['id']}})['then'](function(){return _0x5a1a82;});})[_0x5047('0x21')](function(){_0x1f2423[_0x5047('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5f5e,_0x2bd22e){return function(_0x3597ae){if(!_0x3597ae){_0x2b5f5e['sendStatus'](0x194);}return _0x3597ae;};}function handleError(_0x4ff7d2,_0x11fa6a){_0x11fa6a=_0x11fa6a||0x1f4;return function(_0x437057){logger['error'](_0x437057['stack']);if(_0x437057[_0x5047('0x26')]){delete _0x437057[_0x5047('0x26')];}_0x4ff7d2[_0x5047('0x19')](_0x11fa6a)[_0x5047('0x27')](_0x437057);};}exports[_0x5047('0x28')]=function(_0x5e72d1,_0x4cdea5){var _0x2f7cb8={},_0x54ab18={},_0x4d6497={'count':0x0,'rows':[]};var _0x1173fd=_['map'](db[_0x5047('0x29')]['rawAttributes'],function(_0x855c44){return{'name':_0x855c44['fieldName'],'type':_0x855c44[_0x5047('0x2a')][_0x5047('0x2b')]};});_0x54ab18[_0x5047('0x2c')]=_[_0x5047('0x2d')](_0x1173fd,'name');_0x54ab18[_0x5047('0x2e')]=_[_0x5047('0x2f')](_0x5e72d1['query']);_0x54ab18[_0x5047('0x30')]=_[_0x5047('0x31')](_0x54ab18['model'],_0x54ab18[_0x5047('0x2e')]);_0x2f7cb8['attributes']=_[_0x5047('0x31')](_0x54ab18['model'],qs[_0x5047('0x32')](_0x5e72d1[_0x5047('0x2e')][_0x5047('0x32')]));_0x2f7cb8[_0x5047('0x33')]=_0x2f7cb8[_0x5047('0x33')]['length']?_0x2f7cb8[_0x5047('0x33')]:_0x54ab18[_0x5047('0x2c')];if(!_0x5e72d1[_0x5047('0x2e')][_0x5047('0x34')](_0x5047('0x35'))){_0x2f7cb8[_0x5047('0x1e')]=qs[_0x5047('0x1e')](_0x5e72d1[_0x5047('0x2e')][_0x5047('0x1e')]);_0x2f7cb8[_0x5047('0x1c')]=qs['offset'](_0x5e72d1['query']['offset']);}_0x2f7cb8[_0x5047('0x36')]=qs[_0x5047('0x37')](_0x5e72d1[_0x5047('0x2e')][_0x5047('0x37')]);_0x2f7cb8[_0x5047('0x38')]=qs[_0x5047('0x30')](_[_0x5047('0x39')](_0x5e72d1['query'],_0x54ab18[_0x5047('0x30')]),_0x1173fd);if(_0x5e72d1[_0x5047('0x2e')]['filter']){_0x2f7cb8[_0x5047('0x38')]=_[_0x5047('0x3a')](_0x2f7cb8[_0x5047('0x38')],{'$or':_['map'](_0x1173fd,function(_0x491009){if(_0x491009[_0x5047('0x2a')]!==_0x5047('0x3b')){var _0x7414be={};_0x7414be[_0x491009[_0x5047('0x26')]]={'$like':'%'+_0x5e72d1[_0x5047('0x2e')][_0x5047('0x3c')]+'%'};return _0x7414be;}})});}_0x2f7cb8=_[_0x5047('0x3a')]({},_0x2f7cb8,_0x5e72d1[_0x5047('0x3d')]);var _0x16d6d3={'where':_0x2f7cb8[_0x5047('0x38')]};return db[_0x5047('0x29')][_0x5047('0x3e')](_0x16d6d3)[_0x5047('0x21')](function(_0x326026){_0x4d6497['count']=_0x326026;if(_0x5e72d1['query'][_0x5047('0x3f')]){_0x2f7cb8[_0x5047('0x40')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2f7cb8);})['then'](function(_0x5ddae9){_0x4d6497['rows']=_0x5ddae9;return _0x4d6497;})['then'](respondWithFilteredResult(_0x4cdea5,_0x2f7cb8))[_0x5047('0x41')](handleError(_0x4cdea5,null));};exports['show']=function(_0x1e0942,_0x5e5d50){var _0x202c1e={'raw':!![],'where':{'id':_0x1e0942[_0x5047('0x42')]['id']}},_0x2e3803={};_0x2e3803['model']=_[_0x5047('0x2f')](db['Disposition'][_0x5047('0x43')]);_0x2e3803[_0x5047('0x2e')]=_[_0x5047('0x2f')](_0x1e0942[_0x5047('0x2e')]);_0x2e3803['filters']=_[_0x5047('0x31')](_0x2e3803[_0x5047('0x2c')],_0x2e3803[_0x5047('0x2e')]);_0x202c1e['attributes']=_[_0x5047('0x31')](_0x2e3803[_0x5047('0x2c')],qs['fields'](_0x1e0942[_0x5047('0x2e')][_0x5047('0x32')]));_0x202c1e['attributes']=_0x202c1e[_0x5047('0x33')]['length']?_0x202c1e[_0x5047('0x33')]:_0x2e3803[_0x5047('0x2c')];if(_0x1e0942['query'][_0x5047('0x3f')]){_0x202c1e[_0x5047('0x40')]=[{'all':!![]}];}_0x202c1e=_[_0x5047('0x3a')]({},_0x202c1e,_0x1e0942['options']);return db['Disposition'][_0x5047('0x44')](_0x202c1e)[_0x5047('0x21')](handleEntityNotFound(_0x5e5d50,null))[_0x5047('0x21')](respondWithResult(_0x5e5d50,null))[_0x5047('0x41')](handleError(_0x5e5d50,null));};exports[_0x5047('0x45')]=function(_0x36e8c8,_0xf7e82c){return db[_0x5047('0x29')][_0x5047('0x45')](_0x36e8c8[_0x5047('0x46')],{})[_0x5047('0x21')](function(_0x5d36d0){var _0x533b01=_0x36e8c8[_0x5047('0x47')][_0x5047('0x23')]({'plain':!![]});if(!_0x533b01)throw new Error(_0x5047('0x48'));if(_0x533b01[_0x5047('0x49')]===_0x5047('0x47')){var _0x2e9677=_0x5d36d0[_0x5047('0x23')]({'plain':!![]});var _0xa85e2b='Dispositions';return db[_0x5047('0x4a')][_0x5047('0x44')]({'where':{'name':_0xa85e2b,'userProfileId':_0x533b01[_0x5047('0x4b')]},'raw':!![]})[_0x5047('0x21')](function(_0xfea3b2){if(_0xfea3b2&&_0xfea3b2[_0x5047('0x4c')]===0x0){return db['UserProfileResource'][_0x5047('0x45')]({'name':_0x2e9677[_0x5047('0x26')],'resourceId':_0x2e9677['id'],'type':_0xfea3b2[_0x5047('0x26')],'sectionId':_0xfea3b2['id']},{})[_0x5047('0x21')](function(){return _0x5d36d0;});}else{return _0x5d36d0;}})[_0x5047('0x41')](function(_0x36cb46){logger[_0x5047('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36cb46);throw _0x36cb46;});}return _0x5d36d0;})['then'](respondWithResult(_0xf7e82c,0xc9))[_0x5047('0x41')](handleError(_0xf7e82c,null));};exports[_0x5047('0x4e')]=function(_0x55c7a0,_0x41c18c){if(_0x55c7a0['body']['id']){delete _0x55c7a0['body']['id'];}return db[_0x5047('0x29')][_0x5047('0x44')]({'where':{'id':_0x55c7a0[_0x5047('0x42')]['id']}})[_0x5047('0x21')](handleEntityNotFound(_0x41c18c,null))['then'](saveUpdates(_0x55c7a0[_0x5047('0x46')],null))[_0x5047('0x21')](respondWithResult(_0x41c18c,null))[_0x5047('0x41')](handleError(_0x41c18c,null));};exports[_0x5047('0x22')]=function(_0x16290b,_0x25d8d7){return db['Disposition']['find']({'where':{'id':_0x16290b[_0x5047('0x42')]['id']}})['then'](handleEntityNotFound(_0x25d8d7,null))['then'](removeEntity(_0x25d8d7,null))[_0x5047('0x41')](handleError(_0x25d8d7,null));}; \ No newline at end of file +var _0x5a63=['user','role','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','stack','name','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body'];(function(_0x41e6e,_0x16058f){var _0x452db2=function(_0x926969){while(--_0x926969){_0x41e6e['push'](_0x41e6e['shift']());}};_0x452db2(++_0x16058f);}(_0x5a63,0xe3));var _0x35a6=function(_0x4aaee0,_0x23a353){_0x4aaee0=_0x4aaee0-0x0;var _0x20b667=_0x5a63[_0x4aaee0];return _0x20b667;};'use strict';var emlformat=require(_0x35a6('0x0'));var rimraf=require(_0x35a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x35a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35a6('0x3'));var util=require(_0x35a6('0x4'));var path=require(_0x35a6('0x5'));var sox=require(_0x35a6('0x6'));var csv=require(_0x35a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35a6('0x8'));var _=require('lodash');var squel=require(_0x35a6('0x9'));var crypto=require('crypto');var jsforce=require(_0x35a6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x35a6('0x7'));var querystring=require(_0x35a6('0xb'));var Papa=require(_0x35a6('0xc'));var Redis=require(_0x35a6('0xd'));var authService=require(_0x35a6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x35a6('0xf'));var hardwareService=require(_0x35a6('0x10'));var logger=require(_0x35a6('0x11'))('api');var utils=require(_0x35a6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x35a6('0x13'));var db=require(_0x35a6('0x14'))['db'];function respondWithStatusCode(_0x2baa42,_0x20593b){_0x20593b=_0x20593b||0xcc;return function(_0x617ea0){if(_0x617ea0){return _0x2baa42['sendStatus'](_0x20593b);}return _0x2baa42[_0x35a6('0x15')](_0x20593b)[_0x35a6('0x16')]();};}function respondWithResult(_0x2e6d86,_0x21f7c1){_0x21f7c1=_0x21f7c1||0xc8;return function(_0x250c7){if(_0x250c7){return _0x2e6d86[_0x35a6('0x15')](_0x21f7c1)['json'](_0x250c7);}};}function respondWithFilteredResult(_0x32347a,_0x40c1be){return function(_0x313380){if(_0x313380){var _0x474e34=typeof _0x40c1be[_0x35a6('0x17')]===_0x35a6('0x18')&&typeof _0x40c1be['limit']===_0x35a6('0x18');var _0x4047d2=_0x313380[_0x35a6('0x19')];var _0x39e50d=_0x474e34?0x0:_0x40c1be[_0x35a6('0x17')];var _0x108fb3=_0x474e34?_0x313380[_0x35a6('0x19')]:_0x40c1be['offset']+_0x40c1be[_0x35a6('0x1a')];var _0xbedcb7;if(_0x108fb3>=_0x4047d2){_0x108fb3=_0x4047d2;_0xbedcb7=0xc8;}else{_0xbedcb7=0xce;}_0x32347a[_0x35a6('0x15')](_0xbedcb7);return _0x32347a['set'](_0x35a6('0x1b'),_0x39e50d+'-'+_0x108fb3+'/'+_0x4047d2)[_0x35a6('0x1c')](_0x313380);}return null;};}function patchUpdates(_0x3183eb){return function(_0x4a68b6){try{jsonpatch[_0x35a6('0x1d')](_0x4a68b6,_0x3183eb,!![]);}catch(_0x2d0fa2){return BPromise['reject'](_0x2d0fa2);}return _0x4a68b6[_0x35a6('0x1e')]();};}function saveUpdates(_0x146eca,_0x4b3b00){return function(_0x492be8){if(_0x492be8){return _0x492be8[_0x35a6('0x1f')](_0x146eca)[_0x35a6('0x20')](function(_0x3f1c73){return _0x3f1c73;});}return null;};}function removeEntity(_0x1bb48f,_0x643a2a){return function(_0x43adbe){if(_0x43adbe){return _0x43adbe[_0x35a6('0x21')]()[_0x35a6('0x20')](function(){var _0x28bd6a=_0x43adbe[_0x35a6('0x22')]({'plain':!![]});var _0x32553e=_0x35a6('0x23');return db[_0x35a6('0x24')][_0x35a6('0x21')]({'where':{'type':_0x32553e,'resourceId':_0x28bd6a['id']}})[_0x35a6('0x20')](function(){return _0x43adbe;});})['then'](function(){_0x1bb48f['status'](0xcc)[_0x35a6('0x16')]();});}};}function handleEntityNotFound(_0x287c0b,_0x2680ef){return function(_0x4d68cd){if(!_0x4d68cd){_0x287c0b[_0x35a6('0x25')](0x194);}return _0x4d68cd;};}function handleError(_0x384c42,_0x1b8487){_0x1b8487=_0x1b8487||0x1f4;return function(_0x422ca0){logger['error'](_0x422ca0[_0x35a6('0x26')]);if(_0x422ca0[_0x35a6('0x27')]){delete _0x422ca0[_0x35a6('0x27')];}_0x384c42[_0x35a6('0x15')](_0x1b8487)['send'](_0x422ca0);};}exports['index']=function(_0x19bd13,_0x4189f4){var _0x47aa11={},_0x2a0719={},_0x88953f={'count':0x0,'rows':[]};var _0x26b173=_[_0x35a6('0x28')](db[_0x35a6('0x29')][_0x35a6('0x2a')],function(_0x4d08f8){return{'name':_0x4d08f8[_0x35a6('0x2b')],'type':_0x4d08f8[_0x35a6('0x2c')][_0x35a6('0x2d')]};});_0x2a0719[_0x35a6('0x2e')]=_[_0x35a6('0x28')](_0x26b173,'name');_0x2a0719[_0x35a6('0x2f')]=_[_0x35a6('0x30')](_0x19bd13['query']);_0x2a0719[_0x35a6('0x31')]=_[_0x35a6('0x32')](_0x2a0719[_0x35a6('0x2e')],_0x2a0719[_0x35a6('0x2f')]);_0x47aa11[_0x35a6('0x33')]=_[_0x35a6('0x32')](_0x2a0719[_0x35a6('0x2e')],qs[_0x35a6('0x34')](_0x19bd13[_0x35a6('0x2f')][_0x35a6('0x34')]));_0x47aa11[_0x35a6('0x33')]=_0x47aa11[_0x35a6('0x33')][_0x35a6('0x35')]?_0x47aa11[_0x35a6('0x33')]:_0x2a0719['model'];if(!_0x19bd13['query'][_0x35a6('0x36')]('nolimit')){_0x47aa11[_0x35a6('0x1a')]=qs[_0x35a6('0x1a')](_0x19bd13[_0x35a6('0x2f')]['limit']);_0x47aa11['offset']=qs[_0x35a6('0x17')](_0x19bd13[_0x35a6('0x2f')][_0x35a6('0x17')]);}_0x47aa11[_0x35a6('0x37')]=qs[_0x35a6('0x38')](_0x19bd13[_0x35a6('0x2f')][_0x35a6('0x38')]);_0x47aa11[_0x35a6('0x39')]=qs['filters'](_[_0x35a6('0x3a')](_0x19bd13[_0x35a6('0x2f')],_0x2a0719['filters']),_0x26b173);if(_0x19bd13['query'][_0x35a6('0x3b')]){_0x47aa11['where']=_[_0x35a6('0x3c')](_0x47aa11[_0x35a6('0x39')],{'$or':_[_0x35a6('0x28')](_0x26b173,function(_0x51bca6){if(_0x51bca6[_0x35a6('0x2c')]!==_0x35a6('0x3d')){var _0xa582a0={};_0xa582a0[_0x51bca6[_0x35a6('0x27')]]={'$like':'%'+_0x19bd13[_0x35a6('0x2f')]['filter']+'%'};return _0xa582a0;}})});}_0x47aa11=_['merge']({},_0x47aa11,_0x19bd13['options']);var _0x57eb5d={'where':_0x47aa11['where']};return db[_0x35a6('0x29')][_0x35a6('0x19')](_0x57eb5d)[_0x35a6('0x20')](function(_0x3e9507){_0x88953f[_0x35a6('0x19')]=_0x3e9507;if(_0x19bd13[_0x35a6('0x2f')]['includeAll']){_0x47aa11[_0x35a6('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x35a6('0x3f')](_0x47aa11);})[_0x35a6('0x20')](function(_0x341520){_0x88953f[_0x35a6('0x40')]=_0x341520;return _0x88953f;})[_0x35a6('0x20')](respondWithFilteredResult(_0x4189f4,_0x47aa11))[_0x35a6('0x41')](handleError(_0x4189f4,null));};exports[_0x35a6('0x42')]=function(_0x221602,_0x42b3f8){var _0x480b3e={'raw':!![],'where':{'id':_0x221602[_0x35a6('0x43')]['id']}},_0x13cda8={};_0x13cda8[_0x35a6('0x2e')]=_[_0x35a6('0x30')](db[_0x35a6('0x29')][_0x35a6('0x2a')]);_0x13cda8[_0x35a6('0x2f')]=_[_0x35a6('0x30')](_0x221602[_0x35a6('0x2f')]);_0x13cda8['filters']=_[_0x35a6('0x32')](_0x13cda8[_0x35a6('0x2e')],_0x13cda8[_0x35a6('0x2f')]);_0x480b3e[_0x35a6('0x33')]=_[_0x35a6('0x32')](_0x13cda8[_0x35a6('0x2e')],qs[_0x35a6('0x34')](_0x221602[_0x35a6('0x2f')][_0x35a6('0x34')]));_0x480b3e[_0x35a6('0x33')]=_0x480b3e[_0x35a6('0x33')][_0x35a6('0x35')]?_0x480b3e[_0x35a6('0x33')]:_0x13cda8[_0x35a6('0x2e')];if(_0x221602[_0x35a6('0x2f')][_0x35a6('0x44')]){_0x480b3e[_0x35a6('0x3e')]=[{'all':!![]}];}_0x480b3e=_[_0x35a6('0x3c')]({},_0x480b3e,_0x221602[_0x35a6('0x45')]);return db[_0x35a6('0x29')][_0x35a6('0x46')](_0x480b3e)[_0x35a6('0x20')](handleEntityNotFound(_0x42b3f8,null))['then'](respondWithResult(_0x42b3f8,null))[_0x35a6('0x41')](handleError(_0x42b3f8,null));};exports[_0x35a6('0x47')]=function(_0x1ac050,_0x29062e){return db[_0x35a6('0x29')][_0x35a6('0x47')](_0x1ac050[_0x35a6('0x48')],{})[_0x35a6('0x20')](function(_0x41aab6){var _0x75ddbf=_0x1ac050[_0x35a6('0x49')][_0x35a6('0x22')]({'plain':!![]});if(!_0x75ddbf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x75ddbf[_0x35a6('0x4a')]==='user'){var _0x10dff=_0x41aab6[_0x35a6('0x22')]({'plain':!![]});var _0x3e8206=_0x35a6('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x3e8206,'userProfileId':_0x75ddbf['userProfileId']},'raw':!![]})[_0x35a6('0x20')](function(_0x5820a5){if(_0x5820a5&&_0x5820a5['autoAssociation']===0x0){return db[_0x35a6('0x24')][_0x35a6('0x47')]({'name':_0x10dff[_0x35a6('0x27')],'resourceId':_0x10dff['id'],'type':_0x5820a5['name'],'sectionId':_0x5820a5['id']},{})[_0x35a6('0x20')](function(){return _0x41aab6;});}else{return _0x41aab6;}})[_0x35a6('0x41')](function(_0x3573f5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3573f5);throw _0x3573f5;});}return _0x41aab6;})[_0x35a6('0x20')](respondWithResult(_0x29062e,0xc9))[_0x35a6('0x41')](handleError(_0x29062e,null));};exports[_0x35a6('0x1f')]=function(_0x373da5,_0x581600){if(_0x373da5[_0x35a6('0x48')]['id']){delete _0x373da5[_0x35a6('0x48')]['id'];}return db[_0x35a6('0x29')][_0x35a6('0x46')]({'where':{'id':_0x373da5['params']['id']}})[_0x35a6('0x20')](handleEntityNotFound(_0x581600,null))['then'](saveUpdates(_0x373da5['body'],null))['then'](respondWithResult(_0x581600,null))['catch'](handleError(_0x581600,null));};exports[_0x35a6('0x21')]=function(_0x28433d,_0x13a59c){return db['Disposition'][_0x35a6('0x46')]({'where':{'id':_0x28433d[_0x35a6('0x43')]['id']}})['then'](handleEntityNotFound(_0x13a59c,null))[_0x35a6('0x20')](removeEntity(_0x13a59c,null))['catch'](handleError(_0x13a59c,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 86b9e4b..3dc37e6 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 _0x6b21=['api','moment','bluebird','request-promise','rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger'];(function(_0x3af955,_0x21431c){var _0x167de5=function(_0x78879c){while(--_0x78879c){_0x3af955['push'](_0x3af955['shift']());}};_0x167de5(++_0x21431c);}(_0x6b21,0x112));var _0x16b2=function(_0x117f7c,_0x4bf2e6){_0x117f7c=_0x117f7c-0x0;var _0x40c870=_0x6b21[_0x117f7c];return _0x40c870;};'use strict';var _=require('lodash');var util=require(_0x16b2('0x0'));var logger=require(_0x16b2('0x1'))(_0x16b2('0x2'));var moment=require(_0x16b2('0x3'));var BPromise=require(_0x16b2('0x4'));var rp=require(_0x16b2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16b2('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x16b2('0x7')]=function(_0x244302,_0x5d034c){return _0x244302[_0x16b2('0x8')](_0x16b2('0x9'),attributes,{'tableName':_0x16b2('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x16b2('0xb'),'fields':[_0x16b2('0xc'),_0x16b2('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x16b2('0xc'),_0x16b2('0xe')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x16b2('0xf'),'fields':[_0x16b2('0xc'),_0x16b2('0x10')]},{'unique':!![],'name':_0x16b2('0x11'),'fields':[_0x16b2('0xc'),_0x16b2('0x12')]},{'unique':!![],'name':_0x16b2('0x13'),'fields':[_0x16b2('0xc'),_0x16b2('0x14')]},{'unique':!![],'name':_0x16b2('0x15'),'fields':[_0x16b2('0xc'),_0x16b2('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9614=['../../config/logger','api','bluebird','request-promise','rimraf','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util'];(function(_0x3f10b6,_0x34c1c4){var _0x1ab2ae=function(_0xf0d0f4){while(--_0xf0d0f4){_0x3f10b6['push'](_0x3f10b6['shift']());}};_0x1ab2ae(++_0x34c1c4);}(_0x9614,0x71));var _0x4961=function(_0x32e8f2,_0x33cff3){_0x32e8f2=_0x32e8f2-0x0;var _0xefd2e6=_0x9614[_0x32e8f2];return _0xefd2e6;};'use strict';var _=require(_0x4961('0x0'));var util=require(_0x4961('0x1'));var logger=require(_0x4961('0x2'))(_0x4961('0x3'));var moment=require('moment');var BPromise=require(_0x4961('0x4'));var rp=require(_0x4961('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4961('0x6'));var config=require('../../config/environment');var attributes=require(_0x4961('0x7'));module['exports']=function(_0x5e1b82,_0x15b5d8){return _0x5e1b82[_0x4961('0x8')](_0x4961('0x9'),attributes,{'tableName':_0x4961('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4961('0xb'),'fields':[_0x4961('0xc'),_0x4961('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x4961('0xc'),_0x4961('0xe')]},{'unique':!![],'name':_0x4961('0xf'),'fields':[_0x4961('0xc'),_0x4961('0x10')]},{'unique':!![],'name':_0x4961('0x11'),'fields':[_0x4961('0xc'),_0x4961('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x4961('0xc'),_0x4961('0x13')]},{'unique':!![],'name':_0x4961('0x14'),'fields':['name',_0x4961('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x4961('0xc'),_0x4961('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2d0f589..a34f5d8 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(_0x5c16ea,_0x3adce3){var _0x7944e6=function(_0x44dec4){while(--_0x44dec4){_0x5c16ea['push'](_0x5c16ea['shift']());}};_0x7944e6(++_0x3adce3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x12da1f,_0x4d7ddb){var _0x278905=function(_0x129369){while(--_0x129369){_0x12da1f['push'](_0x12da1f['shift']());}};_0x278905(++_0x4d7ddb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 f006d3f..5f61e4e 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 _0x2a4b=['Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','connect-timeout','express'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x2a4b,0x18b));var _0xb2a4=function(_0x15242a,_0x23aa19){_0x15242a=_0x15242a-0x0;var _0x13b325=_0x2a4b[_0x15242a];return _0x13b325;};'use strict';var multer=require(_0xb2a4('0x0'));var util=require(_0xb2a4('0x1'));var path=require('path');var timeout=require(_0xb2a4('0x2'));var express=require(_0xb2a4('0x3'));var router=express[_0xb2a4('0x4')]();var fs_extra=require(_0xb2a4('0x5'));var auth=require(_0xb2a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb2a4('0x7'));var controller=require(_0xb2a4('0x8'));router[_0xb2a4('0x9')]('/',auth[_0xb2a4('0xa')](),controller[_0xb2a4('0xb')]);router[_0xb2a4('0x9')](_0xb2a4('0xc'),auth['isAuthenticated'](),controller[_0xb2a4('0xd')]);router[_0xb2a4('0xe')]('/',auth[_0xb2a4('0xa')](),controller[_0xb2a4('0xf')]);router[_0xb2a4('0x10')](_0xb2a4('0xc'),auth[_0xb2a4('0xa')](),controller['update']);router[_0xb2a4('0x11')](_0xb2a4('0xc'),auth[_0xb2a4('0xa')](),controller[_0xb2a4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x785d=['express','Router','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4ff5,_0x132b28){var _0x1a96e8=function(_0x5c0624){while(--_0x5c0624){_0x4ff5['push'](_0x4ff5['shift']());}};_0x1a96e8(++_0x132b28);}(_0x785d,0x1b2));var _0xd785=function(_0x16925e,_0x575586){_0x16925e=_0x16925e-0x0;var _0x56e390=_0x785d[_0x16925e];return _0x56e390;};'use strict';var multer=require(_0xd785('0x0'));var util=require(_0xd785('0x1'));var path=require('path');var timeout=require(_0xd785('0x2'));var express=require(_0xd785('0x3'));var router=express[_0xd785('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd785('0x5'));var interaction=require(_0xd785('0x6'));var config=require('../../config/environment');var controller=require(_0xd785('0x7'));router[_0xd785('0x8')]('/',auth[_0xd785('0x9')](),controller['index']);router[_0xd785('0x8')](_0xd785('0xa'),auth[_0xd785('0x9')](),controller[_0xd785('0xb')]);router[_0xd785('0xc')]('/',auth[_0xd785('0x9')](),controller[_0xd785('0xd')]);router[_0xd785('0xe')](_0xd785('0xa'),auth[_0xd785('0x9')](),controller[_0xd785('0xf')]);router[_0xd785('0x10')](_0xd785('0xa'),auth[_0xd785('0x9')](),controller[_0xd785('0x11')]);module[_0xd785('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 32cb024..d23a002 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 _0x7968=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','12000','14400','v17,v27,v29','SIP','KHOMP','TEXT','BOOLEAN','INTEGER'];(function(_0x2d4a54,_0x1f759f){var _0x489a0f=function(_0x1d89b4){while(--_0x1d89b4){_0x2d4a54['push'](_0x2d4a54['shift']());}};_0x489a0f(++_0x1f759f);}(_0x7968,0x67));var _0x8796=function(_0x43a84a,_0x10a060){_0x43a84a=_0x43a84a-0x0;var _0x4c9c11=_0x7968[_0x43a84a];return _0x4c9c11;};'use strict';var Sequelize=require(_0x8796('0x0'));module['exports']={'name':{'type':Sequelize[_0x8796('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8796('0x2')},'headerinfo':{'type':Sequelize[_0x8796('0x1')],'defaultValue':_0x8796('0x3')},'localstationid':{'type':Sequelize[_0x8796('0x1')],'unique':_0x8796('0x4')},'minrate':{'type':Sequelize[_0x8796('0x5')]('2400',_0x8796('0x6'),_0x8796('0x7'),'9600','12000','14400'),'defaultValue':_0x8796('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x8796('0x6'),'7200',_0x8796('0x8'),_0x8796('0x9'),'14400'),'defaultValue':_0x8796('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x8796('0xb')},'gateway':{'type':Sequelize[_0x8796('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8796('0x5')](_0x8796('0xc'),'IAX','DADHI',_0x8796('0xd')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x8796('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8796('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8796('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8796('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8796('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8796('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8796('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8796('0x10')],'allowNull':!![],'defaultValue':null,'comment':_0x8796('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x8796('0xf')],'defaultValue':![],'comment':_0x8796('0x12'),'set':function(_0x461f0d){if(!_0x461f0d)this[_0x8796('0x13')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x461f0d);}}}; \ No newline at end of file +var _0x3ed1=['v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','4800','7200','9600','12000','14400'];(function(_0x1e7ceb,_0x3fad76){var _0x106682=function(_0x480d4d){while(--_0x480d4d){_0x1e7ceb['push'](_0x1e7ceb['shift']());}};_0x106682(++_0x3fad76);}(_0x3ed1,0xf2));var _0x13ed=function(_0x3b89cb,_0x356ca9){_0x3b89cb=_0x3b89cb-0x0;var _0x4b6c3d=_0x3ed1[_0x3b89cb];return _0x4b6c3d;};'use strict';var Sequelize=require('sequelize');module[_0x13ed('0x0')]={'name':{'type':Sequelize[_0x13ed('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x13ed('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x13ed('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x13ed('0x1')],'defaultValue':_0x13ed('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x13ed('0x4')](_0x13ed('0x5'),_0x13ed('0x6'),_0x13ed('0x7'),_0x13ed('0x8'),_0x13ed('0x9'),_0x13ed('0xa')),'defaultValue':_0x13ed('0x6')},'maxrate':{'type':Sequelize[_0x13ed('0x4')]('2400','4800','7200',_0x13ed('0x8'),'12000',_0x13ed('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x13ed('0x1')],'defaultValue':_0x13ed('0xb')},'gateway':{'type':Sequelize[_0x13ed('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x13ed('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x13ed('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x13ed('0xd'),_0x13ed('0xe'),_0x13ed('0xf')),'defaultValue':_0x13ed('0x10')},'key':{'type':Sequelize[_0x13ed('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x13ed('0x11');}},'notificationSound':{'type':Sequelize[_0x13ed('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x13ed('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x13ed('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x13ed('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x13ed('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x13ed('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x13ed('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x13ed('0x12')],'defaultValue':![],'comment':_0x13ed('0x14'),'set':function(_0x2e89c3){if(!_0x2e89c3)this[_0x13ed('0x15')]('mandatoryDispositionPauseId',null);this[_0x13ed('0x15')](_0x13ed('0x16'),_0x2e89c3);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9e7c108..5d8eabb 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 _0x6177=['CmList','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','request-promise','bluebird','path','fs-extra','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','http','client','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','json','apply','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','FaxAccount','includeAll','include','findAll','rows','show','params','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','READ_COMMITTED','FaxApplication','bulkCreate','finally','getApplications','from-voip-provider','exten','localstationid','system','description','priority','Answer','push','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x134ff9,_0x23ce46){var _0x10b590=function(_0x707dd){while(--_0x707dd){_0x134ff9['push'](_0x134ff9['shift']());}};_0x10b590(++_0x23ce46);}(_0x6177,0xd2));var _0x7617=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x6177[_0x342700];return _0x53406f;};'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(_0x7617('0x0'));var moment=require('moment');var BPromise=require(_0x7617('0x1'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7617('0x2'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7617('0x3'));var _=require('lodash');var squel=require(_0x7617('0x4'));var crypto=require('crypto');var jsforce=require(_0x7617('0x5'));var deskjs=require('desk.js');var toCsv=require(_0x7617('0x6'));var querystring=require('querystring');var Papa=require(_0x7617('0x7'));var Redis=require('ioredis');var authService=require(_0x7617('0x8'));var qs=require(_0x7617('0x9'));var as=require(_0x7617('0xa'));var hardwareService=require(_0x7617('0xb'));var logger=require(_0x7617('0xc'))(_0x7617('0xd'));var utils=require(_0x7617('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0x7617('0xf'));var db=require(_0x7617('0x10'))['db'];config[_0x7617('0x11')]=_['defaults'](config[_0x7617('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x7617('0x12'))(new Redis(config[_0x7617('0x11')]));require(_0x7617('0x13'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7617('0x14')]({'port':0x232c});var client9002=jayson[_0x7617('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2324d7,_0x4ff12c,_0x3997e3,_0x26877){return new BPromise(function(_0x92aaca,_0x164d6a){var _0x5c5836=_0x26877||client;return _0x5c5836[_0x7617('0x16')](_0x2324d7,_0x3997e3)[_0x7617('0x17')](function(_0x41ea7e){logger[_0x7617('0x18')]('FaxAccount,\x20%s,\x20%s',_0x4ff12c,_0x7617('0x19'));logger['debug'](_0x7617('0x1a'),_0x4ff12c,'request\x20sent',JSON[_0x7617('0x1b')](_0x41ea7e));if(_0x41ea7e[_0x7617('0x1c')]){if(_0x41ea7e[_0x7617('0x1c')][_0x7617('0x1d')]===0x1f4){logger['error'](_0x7617('0x1e'),_0x4ff12c,_0x41ea7e[_0x7617('0x1c')]['message']);return _0x164d6a(_0x41ea7e['error'][_0x7617('0x1f')]);}logger[_0x7617('0x1c')]('FaxAccount,\x20%s,\x20%s',_0x4ff12c,_0x41ea7e[_0x7617('0x1c')][_0x7617('0x1f')]);return _0x92aaca(_0x41ea7e['error'][_0x7617('0x1f')]);}else{logger['info'](_0x7617('0x1e'),_0x4ff12c,_0x7617('0x19'));_0x92aaca(_0x41ea7e[_0x7617('0x20')][_0x7617('0x1f')]);}})[_0x7617('0x21')](function(_0xa41fe1){logger[_0x7617('0x1c')](_0x7617('0x1e'),_0x4ff12c,_0xa41fe1);_0x164d6a(_0xa41fe1);});});}function respondWithStatusCode(_0xaf2f76,_0x323960){_0x323960=_0x323960||0xcc;return function(_0x50a2b4){if(_0x50a2b4){return _0xaf2f76[_0x7617('0x22')](_0x323960);}return _0xaf2f76[_0x7617('0x23')](_0x323960)[_0x7617('0x24')]();};}function respondWithResult(_0x30f7bf,_0x4a535d){_0x4a535d=_0x4a535d||0xc8;return function(_0x1e0be5){if(_0x1e0be5){return _0x30f7bf[_0x7617('0x23')](_0x4a535d)['json'](_0x1e0be5);}};}function respondWithFilteredResult(_0x1f98ac,_0x3bf2c2){return function(_0x20bc11){if(_0x20bc11){var _0x15f57b=typeof _0x3bf2c2[_0x7617('0x25')]===_0x7617('0x26')&&typeof _0x3bf2c2['limit']===_0x7617('0x26');var _0x2f76be=_0x20bc11['count'];var _0x4e7fed=_0x15f57b?0x0:_0x3bf2c2[_0x7617('0x25')];var _0x1a906c=_0x15f57b?_0x20bc11[_0x7617('0x27')]:_0x3bf2c2[_0x7617('0x25')]+_0x3bf2c2[_0x7617('0x28')];var _0x5c641e;if(_0x1a906c>=_0x2f76be){_0x1a906c=_0x2f76be;_0x5c641e=0xc8;}else{_0x5c641e=0xce;}_0x1f98ac[_0x7617('0x23')](_0x5c641e);return _0x1f98ac['set']('Content-Range',_0x4e7fed+'-'+_0x1a906c+'/'+_0x2f76be)[_0x7617('0x29')](_0x20bc11);}return null;};}function patchUpdates(_0x44b223){return function(_0x3b4b03){try{jsonpatch[_0x7617('0x2a')](_0x3b4b03,_0x44b223,!![]);}catch(_0xf4f0e9){return BPromise['reject'](_0xf4f0e9);}return _0x3b4b03['save']();};}function saveUpdates(_0x5b4e43,_0x50172e){return function(_0x3118b2){if(_0x3118b2){return _0x3118b2[_0x7617('0x2b')](_0x5b4e43)['then'](function(_0x354d0c){return _0x354d0c;});}return null;};}function removeEntity(_0xafe348,_0x546c05){return function(_0x949883){if(_0x949883){return _0x949883[_0x7617('0x2c')]()[_0x7617('0x17')](function(){var _0x1036b8=_0x949883[_0x7617('0x2d')]({'plain':!![]});var _0x48e943='FaxAccounts';return db[_0x7617('0x2e')][_0x7617('0x2c')]({'where':{'type':_0x48e943,'resourceId':_0x1036b8['id']}})[_0x7617('0x17')](function(){return _0x949883;});})['then'](function(){_0xafe348[_0x7617('0x23')](0xcc)[_0x7617('0x24')]();});}};}function handleEntityNotFound(_0x4bac27,_0xce0808){return function(_0x1de2b0){if(!_0x1de2b0){_0x4bac27[_0x7617('0x22')](0x194);}return _0x1de2b0;};}function handleError(_0x370e2e,_0x3e5786){_0x3e5786=_0x3e5786||0x1f4;return function(_0x242911){logger[_0x7617('0x1c')](_0x242911[_0x7617('0x2f')]);if(_0x242911[_0x7617('0x30')]){delete _0x242911[_0x7617('0x30')];}_0x370e2e[_0x7617('0x23')](_0x3e5786)[_0x7617('0x31')](_0x242911);};}exports[_0x7617('0x32')]=function(_0x4051f9,_0x23f42f){var _0x185109={'include':[{'model':db[_0x7617('0x33')],'as':_0x7617('0x34')}]},_0x3af301={},_0x12e29d={'count':0x0,'rows':[]};var _0x363d4e=_['map'](db['FaxAccount'][_0x7617('0x35')],function(_0x40878b){return{'name':_0x40878b[_0x7617('0x36')],'type':_0x40878b[_0x7617('0x37')][_0x7617('0x38')]};});_0x3af301['model']=_[_0x7617('0x39')](_0x363d4e,'name');_0x3af301[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0x4051f9['query']);_0x3af301['filters']=_[_0x7617('0x3c')](_0x3af301[_0x7617('0x3d')],_0x3af301[_0x7617('0x3a')]);_0x185109[_0x7617('0x3e')]=_['intersection'](_0x3af301[_0x7617('0x3d')],qs['fields'](_0x4051f9[_0x7617('0x3a')][_0x7617('0x3f')]));_0x185109[_0x7617('0x3e')]=_0x185109['attributes'][_0x7617('0x40')]?_0x185109[_0x7617('0x3e')]:_0x3af301[_0x7617('0x3d')];if(!_0x4051f9['query'][_0x7617('0x41')](_0x7617('0x42'))){_0x185109['limit']=qs['limit'](_0x4051f9['query'][_0x7617('0x28')]);_0x185109['offset']=qs['offset'](_0x4051f9[_0x7617('0x3a')]['offset']);}_0x185109['order']=qs[_0x7617('0x43')](_0x4051f9['query']['sort']);_0x185109[_0x7617('0x44')]=qs['filters'](_[_0x7617('0x45')](_0x4051f9['query'],_0x3af301[_0x7617('0x46')]),_0x363d4e);if(_0x4051f9[_0x7617('0x3a')]['filter']){_0x185109['where']=_[_0x7617('0x47')](_0x185109[_0x7617('0x44')],{'$or':_[_0x7617('0x39')](_0x363d4e,function(_0x2baa93){if(_0x2baa93['type']!==_0x7617('0x48')){var _0x3b383f={};_0x3b383f[_0x2baa93['name']]={'$like':'%'+_0x4051f9[_0x7617('0x3a')][_0x7617('0x49')]+'%'};return _0x3b383f;}})});}_0x185109=_['merge']({},_0x185109,_0x4051f9[_0x7617('0x4a')]);var _0xf61b88={'where':_0x185109[_0x7617('0x44')]};return db[_0x7617('0x4b')][_0x7617('0x27')](_0xf61b88)[_0x7617('0x17')](function(_0x3a39e1){_0x12e29d[_0x7617('0x27')]=_0x3a39e1;if(_0x4051f9['query'][_0x7617('0x4c')]){_0x185109[_0x7617('0x4d')]=[{'all':!![]}];}return db[_0x7617('0x4b')][_0x7617('0x4e')](_0x185109);})[_0x7617('0x17')](function(_0x1f576b){_0x12e29d[_0x7617('0x4f')]=_0x1f576b;return _0x12e29d;})[_0x7617('0x17')](respondWithFilteredResult(_0x23f42f,_0x185109))[_0x7617('0x21')](handleError(_0x23f42f,null));};exports[_0x7617('0x50')]=function(_0x49e36e,_0x1d10d0){var _0x254b29={'raw':![],'where':{'id':_0x49e36e[_0x7617('0x51')]['id']},'include':[{'model':db[_0x7617('0x33')],'as':_0x7617('0x34')}]},_0x443195={};_0x443195[_0x7617('0x3d')]=_[_0x7617('0x3b')](db[_0x7617('0x4b')][_0x7617('0x35')]);_0x443195[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0x49e36e['query']);_0x443195[_0x7617('0x46')]=_[_0x7617('0x3c')](_0x443195['model'],_0x443195[_0x7617('0x3a')]);_0x254b29[_0x7617('0x3e')]=_['intersection'](_0x443195[_0x7617('0x3d')],qs[_0x7617('0x3f')](_0x49e36e[_0x7617('0x3a')][_0x7617('0x3f')]));_0x254b29[_0x7617('0x3e')]=_0x254b29[_0x7617('0x3e')][_0x7617('0x40')]?_0x254b29[_0x7617('0x3e')]:_0x443195[_0x7617('0x3d')];if(_0x49e36e['query'][_0x7617('0x4c')]){_0x254b29['include']=[{'all':!![]}];}_0x254b29=_[_0x7617('0x47')]({},_0x254b29,_0x49e36e[_0x7617('0x4a')]);return db[_0x7617('0x4b')]['find'](_0x254b29)['then'](handleEntityNotFound(_0x1d10d0,null))['then'](respondWithResult(_0x1d10d0,null))[_0x7617('0x21')](handleError(_0x1d10d0,null));};exports[_0x7617('0x52')]=function(_0xd3418,_0x4b19f0){return db['FaxAccount'][_0x7617('0x52')](_0xd3418[_0x7617('0x53')],{})[_0x7617('0x17')](function(_0xe746da){var _0x38d98c=_0xd3418['user'][_0x7617('0x2d')]({'plain':!![]});if(!_0x38d98c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38d98c[_0x7617('0x54')]===_0x7617('0x55')){var _0x5b1dd4=_0xe746da['get']({'plain':!![]});var _0x2f713a='FaxAccounts';return db[_0x7617('0x56')][_0x7617('0x57')]({'where':{'name':_0x2f713a,'userProfileId':_0x38d98c[_0x7617('0x58')]},'raw':!![]})[_0x7617('0x17')](function(_0x3b2bdf){if(_0x3b2bdf&&_0x3b2bdf[_0x7617('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b1dd4[_0x7617('0x30')],'resourceId':_0x5b1dd4['id'],'type':_0x3b2bdf[_0x7617('0x30')],'sectionId':_0x3b2bdf['id']},{})[_0x7617('0x17')](function(){return _0xe746da;});}else{return _0xe746da;}})[_0x7617('0x21')](function(_0x22a3e4){logger[_0x7617('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22a3e4);throw _0x22a3e4;});}return _0xe746da;})[_0x7617('0x17')](respondWithResult(_0x4b19f0,0xc9))[_0x7617('0x21')](handleError(_0x4b19f0,null));};exports[_0x7617('0x2b')]=function(_0x1405c5,_0x53bf61){if(_0x1405c5[_0x7617('0x53')]['id']){delete _0x1405c5[_0x7617('0x53')]['id'];}return db[_0x7617('0x4b')]['find']({'where':{'id':_0x1405c5[_0x7617('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x7617('0x34')}]})[_0x7617('0x17')](handleEntityNotFound(_0x53bf61,null))[_0x7617('0x17')](saveUpdates(_0x1405c5[_0x7617('0x53')],null))['then'](respondWithResult(_0x53bf61,null))[_0x7617('0x21')](handleError(_0x53bf61,null));};exports['destroy']=function(_0x24a373,_0x17086a){return db[_0x7617('0x4b')][_0x7617('0x57')]({'where':{'id':_0x24a373[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x17086a,null))[_0x7617('0x17')](removeEntity(_0x17086a,null))[_0x7617('0x21')](handleError(_0x17086a,null));};exports[_0x7617('0x5a')]=function(_0x38e9de,_0x299da9){return db['FaxAccount'][_0x7617('0x5a')]()[_0x7617('0x17')](respondWithResult(_0x299da9,null))['catch'](handleError(_0x299da9,null));};exports[_0x7617('0x5b')]=function(_0x3c5d5a,_0x2f4e2e,_0x5ad5c7){if(_0x3c5d5a['body']['id']){delete _0x3c5d5a[_0x7617('0x53')]['id'];}return db[_0x7617('0x4b')]['find']({'where':{'id':_0x3c5d5a[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x2f4e2e,null))['then'](function(_0x1248a7){if(_0x1248a7){_0x3c5d5a[_0x7617('0x53')][_0x7617('0x5c')]=_0x1248a7['id'];return db['Disposition']['create'](_0x3c5d5a[_0x7617('0x53')]);}})[_0x7617('0x17')](respondWithResult(_0x2f4e2e,null))[_0x7617('0x21')](handleError(_0x2f4e2e,null));};exports[_0x7617('0x5d')]=function(_0x3ddedb,_0x97d08b,_0x2c6f8c){var _0x508909={'raw':![],'where':{}};var _0x6e14d1={};var _0xaa58f4={'count':0x0,'rows':[]};return db[_0x7617('0x4b')][_0x7617('0x5e')]({'where':{'id':_0x3ddedb[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x97d08b,null))[_0x7617('0x17')](function(_0x1def4f){if(_0x1def4f){_0x6e14d1[_0x7617('0x3d')]=_[_0x7617('0x3b')](db[_0x7617('0x5f')][_0x7617('0x35')]);_0x6e14d1[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0x3ddedb[_0x7617('0x3a')]);_0x6e14d1[_0x7617('0x46')]=_[_0x7617('0x3c')](_0x6e14d1['model'],_0x6e14d1[_0x7617('0x3a')]);_0x508909['attributes']=_[_0x7617('0x3c')](_0x6e14d1[_0x7617('0x3d')],qs[_0x7617('0x3f')](_0x3ddedb['query'][_0x7617('0x3f')]));_0x508909['attributes']=_0x508909[_0x7617('0x3e')][_0x7617('0x40')]?_0x508909[_0x7617('0x3e')]:_0x6e14d1[_0x7617('0x3d')];if(!_0x3ddedb['query'][_0x7617('0x41')](_0x7617('0x42'))){_0x508909[_0x7617('0x28')]=qs[_0x7617('0x28')](_0x3ddedb['query'][_0x7617('0x28')]);_0x508909[_0x7617('0x25')]=qs['offset'](_0x3ddedb['query'][_0x7617('0x25')]);}_0x508909[_0x7617('0x60')]=qs[_0x7617('0x43')](_0x3ddedb[_0x7617('0x3a')][_0x7617('0x43')]);_0x508909[_0x7617('0x44')]=qs[_0x7617('0x46')](_[_0x7617('0x45')](_0x3ddedb['query'],_0x6e14d1[_0x7617('0x46')]));_0x508909[_0x7617('0x44')]['FaxAccountId']=_0x1def4f['id'];if(_0x3ddedb[_0x7617('0x3a')][_0x7617('0x49')]){_0x508909[_0x7617('0x44')]=_[_0x7617('0x47')](_0x508909['where'],{'$or':_[_0x7617('0x39')](_0x508909[_0x7617('0x3e')],function(_0x40c2f1){var _0x5e6c96={};_0x5e6c96[_0x40c2f1]={'$like':'%'+_0x3ddedb[_0x7617('0x3a')]['filter']+'%'};return _0x5e6c96;})});}_0x508909=_[_0x7617('0x47')]({},_0x508909,_0x3ddedb[_0x7617('0x4a')]);return db['Disposition'][_0x7617('0x27')]({'where':_0x508909['where']})['then'](function(_0x1d2656){_0xaa58f4[_0x7617('0x27')]=_0x1d2656;if(_0x3ddedb[_0x7617('0x3a')][_0x7617('0x4c')]){_0x508909[_0x7617('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0x7617('0x4e')](_0x508909);})[_0x7617('0x17')](function(_0x188c09){_0xaa58f4['rows']=_0x188c09;return _0xaa58f4;});}})[_0x7617('0x17')](respondWithFilteredResult(_0x97d08b,_0x508909))[_0x7617('0x21')](handleError(_0x97d08b,null));};exports[_0x7617('0x61')]=function(_0x38f4b2,_0x53f764,_0x5058ea){return db[_0x7617('0x4b')][_0x7617('0x57')]({'where':{'id':_0x38f4b2[_0x7617('0x51')]['id']}})['then'](handleEntityNotFound(_0x53f764,null))[_0x7617('0x17')](function(_0x50a004){if(_0x50a004){return _0x50a004[_0x7617('0x61')](_0x38f4b2[_0x7617('0x3a')][_0x7617('0x62')]);}})[_0x7617('0x17')](respondWithStatusCode(_0x53f764,null))[_0x7617('0x21')](handleError(_0x53f764,null));};exports[_0x7617('0x63')]=function(_0x2958f1,_0x409b72,_0x4d0933){if(_0x2958f1[_0x7617('0x53')]['id']){delete _0x2958f1[_0x7617('0x53')]['id'];}return db[_0x7617('0x4b')][_0x7617('0x57')]({'where':{'id':_0x2958f1['params']['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x409b72,null))[_0x7617('0x17')](function(_0x30276e){if(_0x30276e){_0x2958f1[_0x7617('0x53')][_0x7617('0x5c')]=_0x30276e['id'];return db['CannedAnswer']['create'](_0x2958f1['body']);}})[_0x7617('0x17')](respondWithResult(_0x409b72,null))[_0x7617('0x21')](handleError(_0x409b72,null));};exports[_0x7617('0x64')]=function(_0x418bc8,_0x14f93a,_0x4d6c94){var _0x142ef0={'raw':![],'where':{}};var _0xa2e56e={};var _0x53dcb8={'count':0x0,'rows':[]};return db[_0x7617('0x4b')][_0x7617('0x5e')]({'where':{'id':_0x418bc8[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x14f93a,null))['then'](function(_0x38a477){if(_0x38a477){_0xa2e56e['model']=_['keys'](db[_0x7617('0x65')][_0x7617('0x35')]);_0xa2e56e[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0x418bc8[_0x7617('0x3a')]);_0xa2e56e[_0x7617('0x46')]=_[_0x7617('0x3c')](_0xa2e56e[_0x7617('0x3d')],_0xa2e56e['query']);_0x142ef0[_0x7617('0x3e')]=_[_0x7617('0x3c')](_0xa2e56e[_0x7617('0x3d')],qs[_0x7617('0x3f')](_0x418bc8[_0x7617('0x3a')]['fields']));_0x142ef0[_0x7617('0x3e')]=_0x142ef0[_0x7617('0x3e')][_0x7617('0x40')]?_0x142ef0[_0x7617('0x3e')]:_0xa2e56e[_0x7617('0x3d')];if(!_0x418bc8['query'][_0x7617('0x41')](_0x7617('0x42'))){_0x142ef0[_0x7617('0x28')]=qs[_0x7617('0x28')](_0x418bc8[_0x7617('0x3a')]['limit']);_0x142ef0[_0x7617('0x25')]=qs[_0x7617('0x25')](_0x418bc8[_0x7617('0x3a')][_0x7617('0x25')]);}_0x142ef0[_0x7617('0x60')]=qs['sort'](_0x418bc8[_0x7617('0x3a')]['sort']);_0x142ef0[_0x7617('0x44')]=qs['filters'](_[_0x7617('0x45')](_0x418bc8[_0x7617('0x3a')],_0xa2e56e[_0x7617('0x46')]));_0x142ef0[_0x7617('0x44')][_0x7617('0x5c')]=_0x38a477['id'];if(_0x418bc8[_0x7617('0x3a')][_0x7617('0x49')]){_0x142ef0[_0x7617('0x44')]=_[_0x7617('0x47')](_0x142ef0[_0x7617('0x44')],{'$or':_[_0x7617('0x39')](_0x142ef0[_0x7617('0x3e')],function(_0x237357){var _0xae6f79={};_0xae6f79[_0x237357]={'$like':'%'+_0x418bc8[_0x7617('0x3a')][_0x7617('0x49')]+'%'};return _0xae6f79;})});}_0x142ef0=_[_0x7617('0x47')]({},_0x142ef0,_0x418bc8[_0x7617('0x4a')]);return db['CannedAnswer'][_0x7617('0x27')]({'where':_0x142ef0[_0x7617('0x44')]})['then'](function(_0x5d0db8){_0x53dcb8['count']=_0x5d0db8;if(_0x418bc8[_0x7617('0x3a')][_0x7617('0x4c')]){_0x142ef0[_0x7617('0x4d')]=[{'all':!![]}];}return db[_0x7617('0x65')][_0x7617('0x4e')](_0x142ef0);})[_0x7617('0x17')](function(_0x2d4588){_0x53dcb8[_0x7617('0x4f')]=_0x2d4588;return _0x53dcb8;});}})[_0x7617('0x17')](respondWithFilteredResult(_0x14f93a,_0x142ef0))[_0x7617('0x21')](handleError(_0x14f93a,null));};exports['removeAnswers']=function(_0x3e642d,_0x3a6148,_0x55daa8){return db[_0x7617('0x4b')][_0x7617('0x57')]({'where':{'id':_0x3e642d[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x3a6148,null))[_0x7617('0x17')](function(_0x5ee871){if(_0x5ee871){return _0x5ee871[_0x7617('0x66')](_0x3e642d[_0x7617('0x3a')]['ids']);}})[_0x7617('0x17')](respondWithStatusCode(_0x3a6148,null))[_0x7617('0x21')](handleError(_0x3a6148,null));};exports[_0x7617('0x67')]=function(_0x455935,_0x2407dd,_0x29a1e3){return db[_0x7617('0x68')][_0x7617('0x57')]({'where':{'id':_0x455935[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x2407dd,null))[_0x7617('0x17')](function(_0x586bd8){if(_0x586bd8){return _0x586bd8[_0x7617('0x67')](_0x455935['body'][_0x7617('0x62')],_[_0x7617('0x69')](_0x455935[_0x7617('0x53')],['ids','id'])||{});}})[_0x7617('0x17')](respondWithResult(_0x2407dd,null))[_0x7617('0x21')](handleError(_0x2407dd,null));};exports['getInteractions']=function(_0x32b335,_0x315775,_0x5b0fdb){var _0x2d1590={'raw':![],'where':{}};var _0x12c958={};var _0x326b96={'count':0x0,'rows':[]};return db[_0x7617('0x4b')]['findOne']({'where':{'id':_0x32b335['params']['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x315775,null))[_0x7617('0x17')](function(_0x4a519d){if(_0x4a519d){_0x12c958[_0x7617('0x3d')]=_[_0x7617('0x3b')](db[_0x7617('0x68')][_0x7617('0x35')]);_0x12c958[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0x32b335[_0x7617('0x3a')]);_0x12c958[_0x7617('0x46')]=_[_0x7617('0x3c')](_0x12c958['model'],_0x12c958[_0x7617('0x3a')]);_0x2d1590[_0x7617('0x3e')]=_[_0x7617('0x3c')](_0x12c958[_0x7617('0x3d')],qs[_0x7617('0x3f')](_0x32b335[_0x7617('0x3a')][_0x7617('0x3f')]));_0x2d1590[_0x7617('0x3e')]=_0x2d1590[_0x7617('0x3e')][_0x7617('0x40')]?_0x2d1590['attributes']:_0x12c958[_0x7617('0x3d')];if(!_0x32b335[_0x7617('0x3a')][_0x7617('0x41')](_0x7617('0x42'))){_0x2d1590[_0x7617('0x28')]=qs[_0x7617('0x28')](_0x32b335[_0x7617('0x3a')][_0x7617('0x28')]);_0x2d1590[_0x7617('0x25')]=qs[_0x7617('0x25')](_0x32b335['query'][_0x7617('0x25')]);}_0x2d1590[_0x7617('0x60')]=qs['sort'](_0x32b335['query']['sort']);_0x2d1590[_0x7617('0x44')]=qs[_0x7617('0x46')](_[_0x7617('0x45')](_0x32b335['query'],_0x12c958['filters']));_0x2d1590['where'][_0x7617('0x5c')]=_0x4a519d['id'];if(_0x32b335[_0x7617('0x3a')]['filter']){_0x2d1590[_0x7617('0x44')]=_[_0x7617('0x47')](_0x2d1590[_0x7617('0x44')],{'$or':_['map'](_0x2d1590[_0x7617('0x3e')],function(_0x4091c2){var _0x36de4a={};_0x36de4a[_0x4091c2]={'$like':'%'+_0x32b335[_0x7617('0x3a')]['filter']+'%'};return _0x36de4a;})});}_0x2d1590=_[_0x7617('0x47')]({},_0x2d1590,_0x32b335[_0x7617('0x4a')]);return db[_0x7617('0x68')][_0x7617('0x27')]({'where':_0x2d1590[_0x7617('0x44')]})[_0x7617('0x17')](function(_0x3f7722){_0x326b96[_0x7617('0x27')]=_0x3f7722;if(_0x32b335[_0x7617('0x3a')]['includeAll']){_0x2d1590[_0x7617('0x4d')]=[{'model':db[_0x7617('0x6a')],'as':'Contact','required':![]},{'model':db[_0x7617('0x6b')],'as':_0x7617('0x6c'),'attributes':[_0x7617('0x30'),_0x7617('0x6d'),_0x7617('0x6e')],'required':![]},{'model':db[_0x7617('0x6f')],'as':_0x7617('0x70'),'attributes':['id','name','color'],'where':_0x32b335[_0x7617('0x3a')][_0x7617('0x71')]?{'id':_0x32b335[_0x7617('0x3a')][_0x7617('0x71')]}:undefined,'required':_0x32b335[_0x7617('0x3a')]['tag']?!![]:![]}];}return db[_0x7617('0x68')][_0x7617('0x4e')](_0x2d1590);})[_0x7617('0x17')](function(_0x469dc6){_0x326b96[_0x7617('0x4f')]=_0x469dc6;return _0x326b96;});}})[_0x7617('0x17')](respondWithFilteredResult(_0x315775,_0x2d1590))[_0x7617('0x21')](handleError(_0x315775,null));};exports['addApplications']=function(_0x3bbfa9,_0xabddb){var _0x50d25a=_0x3bbfa9['params']['id'];var _0xa5f54a=_0x3bbfa9[_0x7617('0x53')];var _0x4ebac7=0xc8;var _0x400f51=null;return db[_0x7617('0x72')][_0x7617('0x73')]({'isolationLevel':db[_0x7617('0x72')]['Transaction']['ISOLATION_LEVELS'][_0x7617('0x74')]},function(_0x440fa4){return db[_0x7617('0x4b')][_0x7617('0x5e')]({'where':{'id':_0x50d25a},'transaction':_0x440fa4})[_0x7617('0x17')](function(_0x268145){if(_0x268145){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x50d25a},'transaction':_0x440fa4})[_0x7617('0x17')](function(){var _0x3ce118=_[_0x7617('0x39')](_0xa5f54a,function(_0x243cd2){_0x243cd2[_0x7617('0x5c')]=_0x50d25a;return _0x243cd2;});return db[_0x7617('0x75')][_0x7617('0x76')](_0x3ce118,{'transaction':_0x440fa4});});}else{_0x4ebac7=0x194;_0x400f51=[];}});})['then'](function(){if(_0x4ebac7!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x50d25a},'order':'priority'})[_0x7617('0x17')](function(_0x5c7265){_0x400f51=_0x5c7265;});}})['catch'](function(_0x4aded4){_0x4ebac7=0x1f4;logger[_0x7617('0x1c')](_0x4aded4[_0x7617('0x2f')]);if(_0x4aded4[_0x7617('0x30')]){delete _0x4aded4['name'];}_0x400f51=_0x4aded4;})[_0x7617('0x77')](function(){if(_0x400f51===null){_0xabddb[_0x7617('0x22')](_0x4ebac7);}else{if(_0x4ebac7===0x1f4){_0xabddb['status'](_0x4ebac7)[_0x7617('0x31')](_0x400f51);}else{_0xabddb[_0x7617('0x23')](_0x4ebac7)['json'](_0x400f51);}}});};exports['getApplications']=function(_0x47fad7,_0xbecc8c,_0x22b065){var _0x3dedb0={};var _0x568d46={};var _0x2d7f84;var _0x2a10ef;return db[_0x7617('0x4b')][_0x7617('0x5e')]({'where':{'id':_0x47fad7['params']['id']}})['then'](handleEntityNotFound(_0xbecc8c,null))[_0x7617('0x17')](function(_0x3bf8a9){if(_0x3bf8a9){_0x2d7f84=_0x3bf8a9;_0x568d46['model']=_['keys'](db[_0x7617('0x75')][_0x7617('0x35')]);_0x568d46['query']=_['keys'](_0x47fad7[_0x7617('0x3a')]);_0x568d46[_0x7617('0x46')]=_['intersection'](_0x568d46['model'],_0x568d46[_0x7617('0x3a')]);_0x3dedb0['attributes']=_[_0x7617('0x3c')](_0x568d46[_0x7617('0x3d')],qs[_0x7617('0x3f')](_0x47fad7[_0x7617('0x3a')]['fields']));_0x3dedb0['attributes']=_0x3dedb0[_0x7617('0x3e')]['length']?_0x3dedb0[_0x7617('0x3e')]:_0x568d46['model'];_0x3dedb0[_0x7617('0x60')]=qs['sort'](_0x47fad7[_0x7617('0x3a')][_0x7617('0x43')]);_0x3dedb0['where']=qs[_0x7617('0x46')](_[_0x7617('0x45')](_0x47fad7[_0x7617('0x3a')],_0x568d46['filters']));if(_0x47fad7[_0x7617('0x3a')][_0x7617('0x49')]){_0x3dedb0['where']=_[_0x7617('0x47')](_0x3dedb0[_0x7617('0x44')],{'$or':_['map'](_0x3dedb0[_0x7617('0x3e')],function(_0x4db54b){var _0x213c86={};_0x213c86[_0x4db54b]={'$like':'%'+_0x47fad7[_0x7617('0x3a')][_0x7617('0x49')]+'%'};return _0x213c86;})});}_0x3dedb0=_[_0x7617('0x47')]({},_0x3dedb0,_0x47fad7[_0x7617('0x4a')]);return _0x2d7f84[_0x7617('0x78')](_0x3dedb0);}})['then'](function(_0x29bd79){if(_0x29bd79){_0x2a10ef=_0x29bd79[_0x7617('0x40')];if(!_0x47fad7[_0x7617('0x3a')][_0x7617('0x41')](_0x7617('0x42'))){_0x3dedb0[_0x7617('0x28')]=qs['limit'](_0x47fad7[_0x7617('0x3a')]['limit']);_0x3dedb0[_0x7617('0x25')]=qs['offset'](_0x47fad7[_0x7617('0x3a')][_0x7617('0x25')]);}return _0x2d7f84[_0x7617('0x78')](_0x3dedb0);}})[_0x7617('0x17')](function(_0x2593fd){if(_0x2593fd){return _0x2593fd?{'count':_0x2a10ef,'rows':_0x2593fd}:null;}})[_0x7617('0x17')](respondWithResult(_0xbecc8c,null))['catch'](handleError(_0xbecc8c,null));};function Extension(_0x19168a,_0xd19fa0,_0x268a9a,_0x21d10e){this['context']=_0x7617('0x79');this[_0x7617('0x7a')]=_0x19168a[_0x7617('0x7b')];this['app']=_0x21d10e;this['type']=_0x7617('0x7c');this[_0x7617('0x7d')]='Fax\x20Extension';this[_0x7617('0x5c')]=_0x19168a['id'];this[_0x7617('0x7e')]=_0xd19fa0;this['appdata']=_0x268a9a;}function createExtensionsReciveFax(_0x3636bb){var _0x20ea23=0x1;var _0x468bf7=[];_0x468bf7['push'](new Extension(_0x3636bb,_0x20ea23,'',_0x7617('0x7f')));_0x20ea23+=0x1;_0x468bf7[_0x7617('0x80')](new Extension(_0x3636bb,_0x20ea23,_0x7617('0x81'),_0x7617('0x82')));_0x20ea23+=0x1;for(var _0x1d82d4 in _0x3636bb){if(_0x3636bb['hasOwnProperty'](_0x1d82d4)&&(_0x1d82d4===_0x7617('0x83')||_0x1d82d4===_0x7617('0x7b')||_0x1d82d4==='gateway'||_0x1d82d4===_0x7617('0x84')||_0x1d82d4===_0x7617('0x85')||_0x1d82d4===_0x7617('0x86')||_0x1d82d4==='minrate'||_0x1d82d4==='modem'||_0x1d82d4==='t38timeout')){_0x468bf7[_0x7617('0x80')](new Extension(_0x3636bb,_0x20ea23,_0x7617('0x87')+_0x1d82d4+')='+_0x3636bb[_0x1d82d4],_0x7617('0x82')));_0x20ea23+=0x1;}}_0x468bf7['push'](new Extension(_0x3636bb,_0x20ea23,'6','Wait'));_0x20ea23+=0x1;_0x468bf7[_0x7617('0x80')](new Extension(_0x3636bb,_0x20ea23,_0x7617('0x88'),_0x7617('0x89')));_0x20ea23=0x0;return _0x468bf7;}exports[_0x7617('0x8a')]=function(_0x9dff9f,_0x529625,_0x1b7e31){var _0x4f3176;return db['sequelize'][_0x7617('0x73')](function(_0xa7ef0){return db['FaxAccount'][_0x7617('0x52')](_0x9dff9f[_0x7617('0x53')],{'transaction':_0xa7ef0})['then'](function(_0x55db04){_0x4f3176=_0x55db04[_0x7617('0x2d')]({'plain':!![]});return db[_0x7617('0x8b')][_0x7617('0x76')](createExtensionsReciveFax(_0x4f3176),{'transaction':_0xa7ef0});});})[_0x7617('0x17')](function(){return _0x4f3176;})[_0x7617('0x17')](respondWithResult(_0x529625,null))['catch'](handleError(_0x529625,null));};exports['updateAccountApplications']=function(_0x59969b,_0x1748b2,_0x1c09fa){var _0x3a998e;return db[_0x7617('0x72')][_0x7617('0x73')](function(_0x3ca7a9){return db[_0x7617('0x4b')][_0x7617('0x2b')](_0x59969b['body'],{'where':{'id':_0x59969b[_0x7617('0x53')]['id']},'transaction':_0x3ca7a9})[_0x7617('0x17')](function(_0x1dc874){return db[_0x7617('0x8b')][_0x7617('0x2c')]({'where':{'FaxAccountId':_0x59969b[_0x7617('0x53')]['id']},'transaction':_0x3ca7a9})[_0x7617('0x17')](function(_0x2306a2){return db[_0x7617('0x8b')][_0x7617('0x76')](createExtensionsReciveFax(_['omit'](_0x59969b[_0x7617('0x53')],[_0x7617('0x8c'),_0x7617('0x38'),_0x7617('0x8d'),_0x7617('0x8e'),_0x7617('0x8f'),_0x7617('0x90')])),{'transaction':_0x3ca7a9});});});})['then'](function(){return db[_0x7617('0x4b')][_0x7617('0x91')](_0x59969b[_0x7617('0x53')]['id']);})[_0x7617('0x17')](respondWithResult(_0x1748b2,null))[_0x7617('0x21')](handleError(_0x1748b2,null));};exports[_0x7617('0x92')]=function(_0xfd76a9,_0x49d3a1,_0x194b82){var _0x3bec31={'raw':!![],'where':{}};var _0x5a7ebd={};var _0x25d5ed={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xfd76a9[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x49d3a1,null))[_0x7617('0x17')](function(_0x7382f5){if(_0x7382f5){_0x5a7ebd[_0x7617('0x3d')]=_[_0x7617('0x3b')](db[_0x7617('0x93')]['rawAttributes']);_0x5a7ebd[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0xfd76a9[_0x7617('0x3a')]);_0x5a7ebd[_0x7617('0x46')]=_[_0x7617('0x3c')](_0x5a7ebd[_0x7617('0x3d')],_0x5a7ebd[_0x7617('0x3a')]);_0x3bec31[_0x7617('0x3e')]=_[_0x7617('0x3c')](_0x5a7ebd[_0x7617('0x3d')],qs['fields'](_0xfd76a9[_0x7617('0x3a')][_0x7617('0x3f')]));_0x3bec31[_0x7617('0x3e')]=_0x3bec31[_0x7617('0x3e')][_0x7617('0x40')]?_0x3bec31[_0x7617('0x3e')]:_0x5a7ebd[_0x7617('0x3d')];if(!_0xfd76a9[_0x7617('0x3a')][_0x7617('0x41')](_0x7617('0x42'))){_0x3bec31[_0x7617('0x28')]=qs[_0x7617('0x28')](_0xfd76a9[_0x7617('0x3a')][_0x7617('0x28')]);_0x3bec31['offset']=qs[_0x7617('0x25')](_0xfd76a9['query'][_0x7617('0x25')]);}_0x3bec31[_0x7617('0x60')]=qs[_0x7617('0x43')](_0xfd76a9['query'][_0x7617('0x43')]);_0x3bec31[_0x7617('0x44')]=qs[_0x7617('0x46')](_[_0x7617('0x45')](_0xfd76a9[_0x7617('0x3a')],_0x5a7ebd[_0x7617('0x46')]));_0x3bec31[_0x7617('0x44')][_0x7617('0x5c')]=_0x7382f5['id'];if(_0xfd76a9['query']['filter']){_0x3bec31[_0x7617('0x44')]=_[_0x7617('0x47')](_0x3bec31[_0x7617('0x44')],{'$or':_[_0x7617('0x39')](_0x3bec31[_0x7617('0x3e')],function(_0x3e1f69){var _0x1a0c3b={};_0x1a0c3b[_0x3e1f69]={'$like':'%'+_0xfd76a9['query']['filter']+'%'};return _0x1a0c3b;})});}if(_0xfd76a9[_0x7617('0x3a')][_0x7617('0x94')]){var _0x5e08b1=_0xfd76a9[_0x7617('0x3a')]['$gte'][_0x7617('0x95')](',');var _0x378e0b={};_0x378e0b[_0x5e08b1[0x0]]={'$gte':moment(_0x5e08b1[0x1])[_0x7617('0x96')](_0x7617('0x97'))};_0x3bec31['where']=_[_0x7617('0x47')](_0x3bec31[_0x7617('0x44')],_0x378e0b);}_0x3bec31=_[_0x7617('0x47')]({},_0x3bec31,_0xfd76a9[_0x7617('0x4a')]);return db['FaxMessage'][_0x7617('0x27')]({'where':_0x3bec31[_0x7617('0x44')]})[_0x7617('0x17')](function(_0x5d154b){_0x25d5ed['count']=_0x5d154b;if(_0xfd76a9['query']['includeAll']){_0x3bec31['include']=[{'all':!![]}];}return db[_0x7617('0x93')]['findAll'](_0x3bec31);})[_0x7617('0x17')](function(_0x108e02){_0x25d5ed[_0x7617('0x4f')]=_0x108e02;return _0x25d5ed;});}})[_0x7617('0x17')](respondWithFilteredResult(_0x49d3a1,_0x3bec31))[_0x7617('0x21')](handleError(_0x49d3a1,null));};exports[_0x7617('0x31')]=function(_0x3f3ab1,_0x14a550,_0x5a43b4){var _0x4af94b,_0x1902e6={},_0x542260;if(_0x3f3ab1[_0x7617('0x53')]['to']){_0x542260=_0x3f3ab1[_0x7617('0x53')]['to'][0x0];}return db[_0x7617('0x4b')]['find']({'where':{'id':_0x3f3ab1[_0x7617('0x51')]['id']},'include':[{'model':db[_0x7617('0x98')],'as':'List','include':[{'model':db[_0x7617('0x6a')],'as':'Contacts','where':{'fax':_0x542260},'limit':0x1,'order':[[_0x7617('0x8e'),_0x7617('0x99')]]}]}]})[_0x7617('0x17')](handleEntityNotFound(_0x14a550,null))['then'](function(_0x1cb1a6){_0x4af94b=_0x1cb1a6;if(_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')]&&_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')]['length']){for(var _0x4f7885=0x0;_0x4f7885<_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][_0x7617('0x40')];_0x4f7885+=0x1){_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][_0x4f7885]={'filename':_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][_0x4f7885][_0x7617('0x30')],'id':_0x3f3ab1['body'][_0x7617('0x9a')][_0x4f7885]['id'],'path':path['join'](config[_0x7617('0x9b')],_0x7617('0x9c'),_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][_0x4f7885][_0x7617('0x9d')])};}}return respondWithRpcPromise(_0x7617('0x9e'),_0x7617('0x9e'),{'FaxAccountId':_[_0x7617('0x9f')](_0x3f3ab1['params']['id'])?undefined:_0x3f3ab1[_0x7617('0x51')]['id'],'path':_[_0x7617('0x9f')](_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][0x0][_0x7617('0x2')])?undefined:_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][0x0]['path'],'fax':_[_0x7617('0x9f')](_0x3f3ab1['body']['to'][0x0])?undefined:_0x3f3ab1[_0x7617('0x53')]['to'][0x0]},client9002);})['then'](function(){if(_0x4af94b){if(_[_0x7617('0x9f')](_0x3f3ab1[_0x7617('0x53')][_0x7617('0xa0')])){_0x3f3ab1[_0x7617('0x53')][_0x7617('0xa0')]=util[_0x7617('0x96')](_0x7617('0xa1'),_0x4af94b[_0x7617('0x30')],_0x4af94b[_0x7617('0xa2')]);}if(_0x4af94b[_0x7617('0xa3')]){if(_0x4af94b[_0x7617('0xa3')][_0x7617('0xa4')]['length']){return _0x4af94b[_0x7617('0xa3')][_0x7617('0xa4')][0x0];}else{return db['CmContact'][_0x7617('0x52')](_[_0x7617('0xa5')](_0x3f3ab1[_0x7617('0x53')],{'firstName':_0x3f3ab1[_0x7617('0x53')]['to'][0x0],'phone':_0x3f3ab1[_0x7617('0x53')]['to'][0x0],'fax':_0x3f3ab1[_0x7617('0x53')]['to'][0x0],'ListId':_0x4af94b['ListId']}));}}else{throw new Error(_0x7617('0xa6'));}}else{throw new Error(_0x7617('0xa7'));}})[_0x7617('0x17')](function(_0x5dc580){if(_0x5dc580){return db[_0x7617('0x68')][_0x7617('0x57')]({'where':{'ContactId':_0x5dc580['id'],'closed':![],'FaxAccountId':_0x4af94b['id']}})[_0x7617('0x17')](function(_0x3c40bc){if(_0x3c40bc){return[_0x3c40bc,![]];}return db[_0x7617('0x68')][_0x7617('0x52')]({'UserId':_0x3f3ab1[_0x7617('0x55')]['id'],'ContactId':_0x5dc580['id'],'FaxAccountId':_0x4af94b['id'],'fax':_0x3f3ab1[_0x7617('0x53')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x7617('0x47')](_0x3f3ab1[_0x7617('0x53')],{'read':![],'body':_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][0x0][_0x7617('0xa8')],'FaxAccountId':_0x4af94b['id'],'UserId':_0x3f3ab1[_0x7617('0x55')]['id'],'ContactId':_0x5dc580['id'],'AttachmentId':_0x3f3ab1[_0x7617('0x53')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x7617('0x93')],'as':_0x7617('0xa9')}]})[_0x7617('0x17')](function(_0x44bfae){return[_0x44bfae,!![]];});});}else{throw new Error(_0x7617('0xaa'));}})[_0x7617('0xab')](function(_0x5d10ed,_0x4da585){if(_0x4da585){return _0x5d10ed;}return db[_0x7617('0x93')][_0x7617('0x52')]({'direction':'out','read':![],'body':_0x3f3ab1['body']['attachments'][0x0][_0x7617('0xa8')],'FaxAccountId':_0x4af94b['id'],'FaxInteractionId':_0x5d10ed['id'],'UserId':_0x3f3ab1[_0x7617('0x55')]['id'],'ContactId':_0x5d10ed['ContactId'],'AttachmentId':_0x3f3ab1[_0x7617('0x53')]['attachments'][0x0]['id']})[_0x7617('0x17')](function(_0x1d1f76){_0x5d10ed[_0x7617('0xac')]['Messages']=[];_0x5d10ed['dataValues'][_0x7617('0xa9')]['push'](_0x1d1f76['dataValues']);return _0x5d10ed;});})['then'](function(_0x7cbe8e){respondWithRpcPromise(_0x7617('0xad'),'SendFax',{'FaxAccountId':_[_0x7617('0x9f')](_0x3f3ab1[_0x7617('0x51')]['id'])?undefined:_0x3f3ab1['params']['id'],'path':_[_0x7617('0x9f')](_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][0x0]['path'])?undefined:_0x3f3ab1[_0x7617('0x53')][_0x7617('0x9a')][0x0][_0x7617('0x2')],'fax':_[_0x7617('0x9f')](_0x3f3ab1[_0x7617('0x53')]['to'][0x0])?undefined:_0x3f3ab1['body']['to'][0x0],'AttachmentId':_0x3f3ab1['body'][_0x7617('0x9a')][0x0]['id']},client9002)[_0x7617('0x17')](function(_0x5418fd){logger[_0x7617('0x18')]('SendFaxRpc,\x20%s',_0x5418fd);})[_0x7617('0x21')](function(_0x510a06){logger[_0x7617('0x18')]('SendFaxRpc,\x20%s',_0x510a06);});return _0x7cbe8e;})['then'](respondWithResult(_0x14a550,null))[_0x7617('0x21')](handleError(_0x14a550,null));};exports[_0x7617('0xae')]=function(_0x39dc1e,_0x2e6f20,_0x42cd56){return db['FaxAccount']['find']({'where':{'id':_0x39dc1e[_0x7617('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e6f20,null))[_0x7617('0x17')](function(_0x536862){if(_0x536862){return _0x536862['addAgents'](_0x39dc1e['body'][_0x7617('0x62')],_[_0x7617('0x69')](_0x39dc1e[_0x7617('0x53')],[_0x7617('0x62'),'id'])||{})[_0x7617('0xab')](function(_0x14ed68){for(var _0x2684ab=0x0;_0x2684ab<_0x39dc1e[_0x7617('0x53')][_0x7617('0x62')][_0x7617('0x40')];_0x2684ab+=0x1){socket[_0x7617('0xaf')](_0x7617('0xb0'),{'UserId':Number(_0x39dc1e[_0x7617('0x53')][_0x7617('0x62')][_0x2684ab]),'FaxAccountId':Number(_0x39dc1e[_0x7617('0x51')]['id'])});}return _0x14ed68;});}})[_0x7617('0x17')](respondWithResult(_0x2e6f20,null))[_0x7617('0x21')](handleError(_0x2e6f20,null));};exports['removeAgents']=function(_0x4c3ef5,_0x1063a3,_0x88b4b1){return db[_0x7617('0x4b')][_0x7617('0x57')]({'where':{'id':_0x4c3ef5[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x1063a3,null))[_0x7617('0x17')](function(_0x37a405){if(_0x37a405){return _0x37a405[_0x7617('0xb1')](_0x4c3ef5[_0x7617('0x3a')][_0x7617('0x62')])['then'](function(){if(_[_0x7617('0xb2')](_0x4c3ef5[_0x7617('0x3a')][_0x7617('0x62')])){for(var _0x83c36d=0x0;_0x83c36d<_0x4c3ef5[_0x7617('0x3a')][_0x7617('0x62')][_0x7617('0x40')];_0x83c36d+=0x1){socket[_0x7617('0xaf')](_0x7617('0xb3'),{'UserId':Number(_0x4c3ef5[_0x7617('0x3a')][_0x7617('0x62')][_0x83c36d]),'FaxAccountId':Number(_0x4c3ef5[_0x7617('0x51')]['id'])});}}else{socket[_0x7617('0xaf')](_0x7617('0xb3'),{'UserId':Number(_0x4c3ef5[_0x7617('0x3a')]['ids']),'FaxAccountId':Number(_0x4c3ef5[_0x7617('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x1063a3,null))[_0x7617('0x21')](handleError(_0x1063a3,null));};exports['getAgents']=function(_0x5706e3,_0x200c8a,_0x3e0128){var _0x4afbe4={};var _0x5a29b7={};var _0x1228c3;var _0x2a674c;return db[_0x7617('0x4b')]['findOne']({'where':{'id':_0x5706e3[_0x7617('0x51')]['id']}})[_0x7617('0x17')](handleEntityNotFound(_0x200c8a,null))[_0x7617('0x17')](function(_0x3294f){if(_0x3294f){_0x1228c3=_0x3294f;_0x5a29b7['model']=_['keys'](db[_0x7617('0x6b')]['rawAttributes']);_0x5a29b7[_0x7617('0x3a')]=_[_0x7617('0x3b')](_0x5706e3['query']);_0x5a29b7[_0x7617('0x46')]=_[_0x7617('0x3c')](_0x5a29b7['model'],_0x5a29b7[_0x7617('0x3a')]);_0x4afbe4['attributes']=_[_0x7617('0x3c')](_0x5a29b7[_0x7617('0x3d')],qs['fields'](_0x5706e3['query'][_0x7617('0x3f')]));_0x4afbe4[_0x7617('0x3e')]=_0x4afbe4[_0x7617('0x3e')]['length']?_0x4afbe4['attributes']:_0x5a29b7[_0x7617('0x3d')];_0x4afbe4[_0x7617('0x60')]=qs[_0x7617('0x43')](_0x5706e3[_0x7617('0x3a')][_0x7617('0x43')]);_0x4afbe4[_0x7617('0x44')]=qs[_0x7617('0x46')](_['pick'](_0x5706e3['query'],_0x5a29b7[_0x7617('0x46')]));if(_0x5706e3['query'][_0x7617('0x49')]){_0x4afbe4[_0x7617('0x44')]=_[_0x7617('0x47')](_0x4afbe4['where'],{'$or':_[_0x7617('0x39')](_0x4afbe4['attributes'],function(_0x10d1ba){var _0xb29726={};_0xb29726[_0x10d1ba]={'$like':'%'+_0x5706e3[_0x7617('0x3a')]['filter']+'%'};return _0xb29726;})});}_0x4afbe4=_[_0x7617('0x47')]({},_0x4afbe4,_0x5706e3[_0x7617('0x4a')]);return _0x1228c3[_0x7617('0xb4')](_0x4afbe4);}})[_0x7617('0x17')](function(_0x1e68e0){if(_0x1e68e0){_0x2a674c=_0x1e68e0[_0x7617('0x40')];if(!_0x5706e3[_0x7617('0x3a')][_0x7617('0x41')](_0x7617('0x42'))){_0x4afbe4[_0x7617('0x28')]=qs[_0x7617('0x28')](_0x5706e3[_0x7617('0x3a')][_0x7617('0x28')]);_0x4afbe4['offset']=qs[_0x7617('0x25')](_0x5706e3['query'][_0x7617('0x25')]);}return _0x1228c3[_0x7617('0xb4')](_0x4afbe4);}})['then'](function(_0xfb2189){if(_0xfb2189){return _0xfb2189?{'count':_0x2a674c,'rows':_0xfb2189}:null;}})[_0x7617('0x17')](respondWithResult(_0x200c8a,null))[_0x7617('0x21')](handleError(_0x200c8a,null));}; \ No newline at end of file +var _0xe73d=['map','rawAttributes','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','include','findAll','rows','catch','show','params','mandatoryDispositionPause','intersection','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','priority','getApplications','context','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/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','bulkCreate','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','CmContact','Contacts','DESC','attachments','join','basename','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause'];(function(_0xd474e4,_0x1a4804){var _0x314957=function(_0xe1e04){while(--_0xe1e04){_0xd474e4['push'](_0xd474e4['shift']());}};_0x314957(++_0x1a4804);}(_0xe73d,0x8d));var _0xde73=function(_0x3f768b,_0x34d84e){_0x3f768b=_0x3f768b-0x0;var _0x19cafb=_0xe73d[_0x3f768b];return _0x19cafb;};'use strict';var emlformat=require(_0xde73('0x0'));var rimraf=require(_0xde73('0x1'));var zipdir=require(_0xde73('0x2'));var jsonpatch=require(_0xde73('0x3'));var rp=require(_0xde73('0x4'));var moment=require(_0xde73('0x5'));var BPromise=require(_0xde73('0x6'));var Mustache=require('mustache');var util=require(_0xde73('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xde73('0x8'));var ejs=require(_0xde73('0x9'));var fs=require('fs');var fs_extra=require(_0xde73('0xa'));var _=require(_0xde73('0xb'));var squel=require('squel');var crypto=require(_0xde73('0xc'));var jsforce=require(_0xde73('0xd'));var deskjs=require(_0xde73('0xe'));var toCsv=require('to-csv');var querystring=require(_0xde73('0xf'));var Papa=require(_0xde73('0x10'));var Redis=require('ioredis');var authService=require(_0xde73('0x11'));var qs=require(_0xde73('0x12'));var as=require(_0xde73('0x13'));var hardwareService=require(_0xde73('0x14'));var logger=require(_0xde73('0x15'))(_0xde73('0x16'));var utils=require(_0xde73('0x17'));var config=require(_0xde73('0x18'));var licenseUtil=require(_0xde73('0x19'));var db=require(_0xde73('0x1a'))['db'];config[_0xde73('0x1b')]=_[_0xde73('0x1c')](config[_0xde73('0x1b')],{'host':_0xde73('0x1d'),'port':0x18eb});var socket=require(_0xde73('0x1e'))(new Redis(config[_0xde73('0x1b')]));require(_0xde73('0x1f'))[_0xde73('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xde73('0x21')][_0xde73('0x22')]({'port':0x232c});var client9002=jayson[_0xde73('0x21')][_0xde73('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x26d336,_0x2ccd79,_0x4559fe,_0x1bccef){return new BPromise(function(_0xac7f0a,_0x425906){var _0x1ca015=_0x1bccef||client;return _0x1ca015[_0xde73('0x23')](_0x26d336,_0x4559fe)['then'](function(_0x30df1a){logger[_0xde73('0x24')](_0xde73('0x25'),_0x2ccd79,_0xde73('0x26'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2ccd79,'request\x20sent',JSON[_0xde73('0x27')](_0x30df1a));if(_0x30df1a[_0xde73('0x28')]){if(_0x30df1a[_0xde73('0x28')][_0xde73('0x29')]===0x1f4){logger[_0xde73('0x28')](_0xde73('0x25'),_0x2ccd79,_0x30df1a['error']['message']);return _0x425906(_0x30df1a['error'][_0xde73('0x2a')]);}logger[_0xde73('0x28')]('FaxAccount,\x20%s,\x20%s',_0x2ccd79,_0x30df1a[_0xde73('0x28')][_0xde73('0x2a')]);return _0xac7f0a(_0x30df1a[_0xde73('0x28')][_0xde73('0x2a')]);}else{logger[_0xde73('0x24')](_0xde73('0x25'),_0x2ccd79,_0xde73('0x26'));_0xac7f0a(_0x30df1a[_0xde73('0x2b')][_0xde73('0x2a')]);}})['catch'](function(_0x44f9c5){logger[_0xde73('0x28')]('FaxAccount,\x20%s,\x20%s',_0x2ccd79,_0x44f9c5);_0x425906(_0x44f9c5);});});}function respondWithStatusCode(_0x34917d,_0x4e661a){_0x4e661a=_0x4e661a||0xcc;return function(_0x3bea07){if(_0x3bea07){return _0x34917d[_0xde73('0x2c')](_0x4e661a);}return _0x34917d[_0xde73('0x2d')](_0x4e661a)[_0xde73('0x2e')]();};}function respondWithResult(_0x4edd10,_0x37ca63){_0x37ca63=_0x37ca63||0xc8;return function(_0x583303){if(_0x583303){return _0x4edd10['status'](_0x37ca63)[_0xde73('0x2f')](_0x583303);}};}function respondWithFilteredResult(_0x4b02bd,_0x5746f3){return function(_0x33b01a){if(_0x33b01a){var _0x1c9f97=typeof _0x5746f3['offset']===_0xde73('0x30')&&typeof _0x5746f3['limit']===_0xde73('0x30');var _0x2125c9=_0x33b01a[_0xde73('0x31')];var _0xe8871d=_0x1c9f97?0x0:_0x5746f3[_0xde73('0x32')];var _0x1223a3=_0x1c9f97?_0x33b01a['count']:_0x5746f3[_0xde73('0x32')]+_0x5746f3[_0xde73('0x33')];var _0x3e73ec;if(_0x1223a3>=_0x2125c9){_0x1223a3=_0x2125c9;_0x3e73ec=0xc8;}else{_0x3e73ec=0xce;}_0x4b02bd[_0xde73('0x2d')](_0x3e73ec);return _0x4b02bd[_0xde73('0x34')]('Content-Range',_0xe8871d+'-'+_0x1223a3+'/'+_0x2125c9)[_0xde73('0x2f')](_0x33b01a);}return null;};}function patchUpdates(_0x5c1b2b){return function(_0x43cd72){try{jsonpatch[_0xde73('0x35')](_0x43cd72,_0x5c1b2b,!![]);}catch(_0x179ea0){return BPromise[_0xde73('0x36')](_0x179ea0);}return _0x43cd72[_0xde73('0x37')]();};}function saveUpdates(_0x12b70f,_0x4dc69d){return function(_0x45c652){if(_0x45c652){return _0x45c652[_0xde73('0x38')](_0x12b70f)[_0xde73('0x39')](function(_0x5c9ff9){return _0x5c9ff9;});}return null;};}function removeEntity(_0x53271a,_0x488702){return function(_0x39e2c9){if(_0x39e2c9){return _0x39e2c9[_0xde73('0x3a')]()[_0xde73('0x39')](function(){var _0x50d5c4=_0x39e2c9['get']({'plain':!![]});var _0x25024a=_0xde73('0x3b');return db[_0xde73('0x3c')]['destroy']({'where':{'type':_0x25024a,'resourceId':_0x50d5c4['id']}})[_0xde73('0x39')](function(){return _0x39e2c9;});})[_0xde73('0x39')](function(){_0x53271a[_0xde73('0x2d')](0xcc)[_0xde73('0x2e')]();});}};}function handleEntityNotFound(_0x573e2e,_0x538b75){return function(_0x338dc7){if(!_0x338dc7){_0x573e2e[_0xde73('0x2c')](0x194);}return _0x338dc7;};}function handleError(_0x2049ee,_0x1d10a8){_0x1d10a8=_0x1d10a8||0x1f4;return function(_0x5c50a5){logger['error'](_0x5c50a5[_0xde73('0x3d')]);if(_0x5c50a5[_0xde73('0x3e')]){delete _0x5c50a5['name'];}_0x2049ee[_0xde73('0x2d')](_0x1d10a8)[_0xde73('0x3f')](_0x5c50a5);};}exports[_0xde73('0x40')]=function(_0x24dc63,_0x241eb6){var _0x563bc7={'include':[{'model':db[_0xde73('0x41')],'as':'mandatoryDispositionPause'}]},_0x32a408={},_0x1f1079={'count':0x0,'rows':[]};var _0x3510d9=_[_0xde73('0x42')](db['FaxAccount'][_0xde73('0x43')],function(_0x4dc017){return{'name':_0x4dc017['fieldName'],'type':_0x4dc017[_0xde73('0x44')][_0xde73('0x45')]};});_0x32a408[_0xde73('0x46')]=_[_0xde73('0x42')](_0x3510d9,_0xde73('0x3e'));_0x32a408['query']=_[_0xde73('0x47')](_0x24dc63[_0xde73('0x48')]);_0x32a408[_0xde73('0x49')]=_['intersection'](_0x32a408[_0xde73('0x46')],_0x32a408[_0xde73('0x48')]);_0x563bc7[_0xde73('0x4a')]=_['intersection'](_0x32a408[_0xde73('0x46')],qs[_0xde73('0x4b')](_0x24dc63[_0xde73('0x48')][_0xde73('0x4b')]));_0x563bc7[_0xde73('0x4a')]=_0x563bc7['attributes'][_0xde73('0x4c')]?_0x563bc7[_0xde73('0x4a')]:_0x32a408[_0xde73('0x46')];if(!_0x24dc63[_0xde73('0x48')]['hasOwnProperty'](_0xde73('0x4d'))){_0x563bc7[_0xde73('0x33')]=qs['limit'](_0x24dc63[_0xde73('0x48')]['limit']);_0x563bc7[_0xde73('0x32')]=qs[_0xde73('0x32')](_0x24dc63[_0xde73('0x48')][_0xde73('0x32')]);}_0x563bc7[_0xde73('0x4e')]=qs[_0xde73('0x4f')](_0x24dc63[_0xde73('0x48')][_0xde73('0x4f')]);_0x563bc7[_0xde73('0x50')]=qs[_0xde73('0x49')](_[_0xde73('0x51')](_0x24dc63[_0xde73('0x48')],_0x32a408[_0xde73('0x49')]),_0x3510d9);if(_0x24dc63[_0xde73('0x48')][_0xde73('0x52')]){_0x563bc7[_0xde73('0x50')]=_[_0xde73('0x53')](_0x563bc7['where'],{'$or':_[_0xde73('0x42')](_0x3510d9,function(_0x3463fa){if(_0x3463fa[_0xde73('0x44')]!==_0xde73('0x54')){var _0x82bda6={};_0x82bda6[_0x3463fa['name']]={'$like':'%'+_0x24dc63[_0xde73('0x48')][_0xde73('0x52')]+'%'};return _0x82bda6;}})});}_0x563bc7=_[_0xde73('0x53')]({},_0x563bc7,_0x24dc63[_0xde73('0x55')]);var _0x3133a5={'where':_0x563bc7[_0xde73('0x50')]};return db[_0xde73('0x56')][_0xde73('0x31')](_0x3133a5)['then'](function(_0x26f2fd){_0x1f1079[_0xde73('0x31')]=_0x26f2fd;if(_0x24dc63['query']['includeAll']){_0x563bc7[_0xde73('0x57')]=[{'all':!![]}];}return db[_0xde73('0x56')][_0xde73('0x58')](_0x563bc7);})[_0xde73('0x39')](function(_0x5020dc){_0x1f1079[_0xde73('0x59')]=_0x5020dc;return _0x1f1079;})['then'](respondWithFilteredResult(_0x241eb6,_0x563bc7))[_0xde73('0x5a')](handleError(_0x241eb6,null));};exports[_0xde73('0x5b')]=function(_0x1e45e8,_0x5013d5){var _0x28136d={'raw':![],'where':{'id':_0x1e45e8[_0xde73('0x5c')]['id']},'include':[{'model':db[_0xde73('0x41')],'as':_0xde73('0x5d')}]},_0x5f425d={};_0x5f425d['model']=_[_0xde73('0x47')](db[_0xde73('0x56')][_0xde73('0x43')]);_0x5f425d[_0xde73('0x48')]=_[_0xde73('0x47')](_0x1e45e8[_0xde73('0x48')]);_0x5f425d[_0xde73('0x49')]=_[_0xde73('0x5e')](_0x5f425d[_0xde73('0x46')],_0x5f425d[_0xde73('0x48')]);_0x28136d[_0xde73('0x4a')]=_['intersection'](_0x5f425d[_0xde73('0x46')],qs[_0xde73('0x4b')](_0x1e45e8[_0xde73('0x48')][_0xde73('0x4b')]));_0x28136d[_0xde73('0x4a')]=_0x28136d[_0xde73('0x4a')][_0xde73('0x4c')]?_0x28136d[_0xde73('0x4a')]:_0x5f425d[_0xde73('0x46')];if(_0x1e45e8['query'][_0xde73('0x5f')]){_0x28136d[_0xde73('0x57')]=[{'all':!![]}];}_0x28136d=_[_0xde73('0x53')]({},_0x28136d,_0x1e45e8[_0xde73('0x55')]);return db[_0xde73('0x56')][_0xde73('0x60')](_0x28136d)[_0xde73('0x39')](handleEntityNotFound(_0x5013d5,null))['then'](respondWithResult(_0x5013d5,null))[_0xde73('0x5a')](handleError(_0x5013d5,null));};exports[_0xde73('0x61')]=function(_0x439af7,_0x1a4cc5){return db[_0xde73('0x56')][_0xde73('0x61')](_0x439af7[_0xde73('0x62')],{})[_0xde73('0x39')](function(_0x24db27){var _0x12d31c=_0x439af7[_0xde73('0x63')][_0xde73('0x64')]({'plain':!![]});if(!_0x12d31c)throw new Error(_0xde73('0x65'));if(_0x12d31c[_0xde73('0x66')]===_0xde73('0x63')){var _0x1b51f5=_0x24db27[_0xde73('0x64')]({'plain':!![]});var _0x17657b=_0xde73('0x3b');return db[_0xde73('0x67')]['find']({'where':{'name':_0x17657b,'userProfileId':_0x12d31c[_0xde73('0x68')]},'raw':!![]})[_0xde73('0x39')](function(_0x5e69bb){if(_0x5e69bb&&_0x5e69bb[_0xde73('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x1b51f5[_0xde73('0x3e')],'resourceId':_0x1b51f5['id'],'type':_0x5e69bb[_0xde73('0x3e')],'sectionId':_0x5e69bb['id']},{})[_0xde73('0x39')](function(){return _0x24db27;});}else{return _0x24db27;}})[_0xde73('0x5a')](function(_0x19f3b4){logger['error'](_0xde73('0x6a'),_0x19f3b4);throw _0x19f3b4;});}return _0x24db27;})[_0xde73('0x39')](respondWithResult(_0x1a4cc5,0xc9))['catch'](handleError(_0x1a4cc5,null));};exports[_0xde73('0x38')]=function(_0x10180b,_0x4a3bc6){if(_0x10180b['body']['id']){delete _0x10180b['body']['id'];}return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x10180b[_0xde73('0x5c')]['id']},'include':[{'model':db[_0xde73('0x41')],'as':_0xde73('0x5d')}]})[_0xde73('0x39')](handleEntityNotFound(_0x4a3bc6,null))[_0xde73('0x39')](saveUpdates(_0x10180b[_0xde73('0x62')],null))['then'](respondWithResult(_0x4a3bc6,null))[_0xde73('0x5a')](handleError(_0x4a3bc6,null));};exports[_0xde73('0x3a')]=function(_0x3ec4b7,_0x432e8c){return db['FaxAccount']['find']({'where':{'id':_0x3ec4b7['params']['id']}})['then'](handleEntityNotFound(_0x432e8c,null))[_0xde73('0x39')](removeEntity(_0x432e8c,null))[_0xde73('0x5a')](handleError(_0x432e8c,null));};exports[_0xde73('0x6b')]=function(_0x49d889,_0x590ad6){return db[_0xde73('0x56')][_0xde73('0x6b')]()[_0xde73('0x39')](respondWithResult(_0x590ad6,null))['catch'](handleError(_0x590ad6,null));};exports[_0xde73('0x6c')]=function(_0x12bc63,_0x58fa39,_0x2903cf){if(_0x12bc63[_0xde73('0x62')]['id']){delete _0x12bc63['body']['id'];}return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x12bc63[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x58fa39,null))[_0xde73('0x39')](function(_0x2c929a){if(_0x2c929a){_0x12bc63[_0xde73('0x62')][_0xde73('0x6d')]=_0x2c929a['id'];return db[_0xde73('0x6e')][_0xde73('0x61')](_0x12bc63[_0xde73('0x62')]);}})[_0xde73('0x39')](respondWithResult(_0x58fa39,null))[_0xde73('0x5a')](handleError(_0x58fa39,null));};exports[_0xde73('0x6f')]=function(_0x52453b,_0x48b4c5,_0x1e9108){var _0x1def1d={'raw':![],'where':{}};var _0x29f0ca={};var _0x1042e8={'count':0x0,'rows':[]};return db[_0xde73('0x56')][_0xde73('0x70')]({'where':{'id':_0x52453b[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x48b4c5,null))[_0xde73('0x39')](function(_0x5f0018){if(_0x5f0018){_0x29f0ca[_0xde73('0x46')]=_[_0xde73('0x47')](db['Disposition']['rawAttributes']);_0x29f0ca[_0xde73('0x48')]=_[_0xde73('0x47')](_0x52453b[_0xde73('0x48')]);_0x29f0ca[_0xde73('0x49')]=_[_0xde73('0x5e')](_0x29f0ca[_0xde73('0x46')],_0x29f0ca[_0xde73('0x48')]);_0x1def1d[_0xde73('0x4a')]=_[_0xde73('0x5e')](_0x29f0ca[_0xde73('0x46')],qs[_0xde73('0x4b')](_0x52453b['query'][_0xde73('0x4b')]));_0x1def1d[_0xde73('0x4a')]=_0x1def1d[_0xde73('0x4a')][_0xde73('0x4c')]?_0x1def1d[_0xde73('0x4a')]:_0x29f0ca[_0xde73('0x46')];if(!_0x52453b[_0xde73('0x48')]['hasOwnProperty'](_0xde73('0x4d'))){_0x1def1d[_0xde73('0x33')]=qs['limit'](_0x52453b['query'][_0xde73('0x33')]);_0x1def1d[_0xde73('0x32')]=qs[_0xde73('0x32')](_0x52453b[_0xde73('0x48')][_0xde73('0x32')]);}_0x1def1d[_0xde73('0x4e')]=qs[_0xde73('0x4f')](_0x52453b['query'][_0xde73('0x4f')]);_0x1def1d[_0xde73('0x50')]=qs[_0xde73('0x49')](_[_0xde73('0x51')](_0x52453b[_0xde73('0x48')],_0x29f0ca['filters']));_0x1def1d[_0xde73('0x50')][_0xde73('0x6d')]=_0x5f0018['id'];if(_0x52453b[_0xde73('0x48')]['filter']){_0x1def1d[_0xde73('0x50')]=_['merge'](_0x1def1d[_0xde73('0x50')],{'$or':_[_0xde73('0x42')](_0x1def1d[_0xde73('0x4a')],function(_0x45fd2d){var _0x40f0a8={};_0x40f0a8[_0x45fd2d]={'$like':'%'+_0x52453b[_0xde73('0x48')][_0xde73('0x52')]+'%'};return _0x40f0a8;})});}_0x1def1d=_[_0xde73('0x53')]({},_0x1def1d,_0x52453b[_0xde73('0x55')]);return db[_0xde73('0x6e')][_0xde73('0x31')]({'where':_0x1def1d[_0xde73('0x50')]})['then'](function(_0x3b35cc){_0x1042e8[_0xde73('0x31')]=_0x3b35cc;if(_0x52453b[_0xde73('0x48')][_0xde73('0x5f')]){_0x1def1d[_0xde73('0x57')]=[{'all':!![]}];}return db[_0xde73('0x6e')][_0xde73('0x58')](_0x1def1d);})[_0xde73('0x39')](function(_0x562117){_0x1042e8[_0xde73('0x59')]=_0x562117;return _0x1042e8;});}})['then'](respondWithFilteredResult(_0x48b4c5,_0x1def1d))[_0xde73('0x5a')](handleError(_0x48b4c5,null));};exports[_0xde73('0x71')]=function(_0x2e789e,_0x1ff874,_0x111cb0){return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x2e789e[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x1ff874,null))[_0xde73('0x39')](function(_0x503747){if(_0x503747){return _0x503747[_0xde73('0x71')](_0x2e789e[_0xde73('0x48')][_0xde73('0x72')]);}})['then'](respondWithStatusCode(_0x1ff874,null))[_0xde73('0x5a')](handleError(_0x1ff874,null));};exports[_0xde73('0x73')]=function(_0x358aca,_0x95476b,_0x103867){if(_0x358aca[_0xde73('0x62')]['id']){delete _0x358aca['body']['id'];}return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x358aca[_0xde73('0x5c')]['id']}})['then'](handleEntityNotFound(_0x95476b,null))['then'](function(_0x23afda){if(_0x23afda){_0x358aca['body'][_0xde73('0x6d')]=_0x23afda['id'];return db[_0xde73('0x74')]['create'](_0x358aca[_0xde73('0x62')]);}})[_0xde73('0x39')](respondWithResult(_0x95476b,null))[_0xde73('0x5a')](handleError(_0x95476b,null));};exports[_0xde73('0x75')]=function(_0x20fe5e,_0xaa5653,_0x106987){var _0x567a18={'raw':![],'where':{}};var _0x10d7f7={};var _0x1d060d={'count':0x0,'rows':[]};return db[_0xde73('0x56')][_0xde73('0x70')]({'where':{'id':_0x20fe5e[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0xaa5653,null))[_0xde73('0x39')](function(_0x40f966){if(_0x40f966){_0x10d7f7[_0xde73('0x46')]=_[_0xde73('0x47')](db[_0xde73('0x74')][_0xde73('0x43')]);_0x10d7f7['query']=_[_0xde73('0x47')](_0x20fe5e[_0xde73('0x48')]);_0x10d7f7['filters']=_[_0xde73('0x5e')](_0x10d7f7[_0xde73('0x46')],_0x10d7f7['query']);_0x567a18[_0xde73('0x4a')]=_['intersection'](_0x10d7f7['model'],qs[_0xde73('0x4b')](_0x20fe5e[_0xde73('0x48')][_0xde73('0x4b')]));_0x567a18[_0xde73('0x4a')]=_0x567a18['attributes'][_0xde73('0x4c')]?_0x567a18[_0xde73('0x4a')]:_0x10d7f7[_0xde73('0x46')];if(!_0x20fe5e[_0xde73('0x48')][_0xde73('0x76')](_0xde73('0x4d'))){_0x567a18['limit']=qs[_0xde73('0x33')](_0x20fe5e[_0xde73('0x48')][_0xde73('0x33')]);_0x567a18[_0xde73('0x32')]=qs[_0xde73('0x32')](_0x20fe5e['query']['offset']);}_0x567a18['order']=qs[_0xde73('0x4f')](_0x20fe5e[_0xde73('0x48')][_0xde73('0x4f')]);_0x567a18[_0xde73('0x50')]=qs[_0xde73('0x49')](_['pick'](_0x20fe5e[_0xde73('0x48')],_0x10d7f7[_0xde73('0x49')]));_0x567a18[_0xde73('0x50')][_0xde73('0x6d')]=_0x40f966['id'];if(_0x20fe5e['query'][_0xde73('0x52')]){_0x567a18[_0xde73('0x50')]=_[_0xde73('0x53')](_0x567a18[_0xde73('0x50')],{'$or':_[_0xde73('0x42')](_0x567a18[_0xde73('0x4a')],function(_0x412472){var _0x51c71a={};_0x51c71a[_0x412472]={'$like':'%'+_0x20fe5e[_0xde73('0x48')][_0xde73('0x52')]+'%'};return _0x51c71a;})});}_0x567a18=_['merge']({},_0x567a18,_0x20fe5e[_0xde73('0x55')]);return db[_0xde73('0x74')][_0xde73('0x31')]({'where':_0x567a18['where']})['then'](function(_0x3aeeaa){_0x1d060d[_0xde73('0x31')]=_0x3aeeaa;if(_0x20fe5e[_0xde73('0x48')]['includeAll']){_0x567a18[_0xde73('0x57')]=[{'all':!![]}];}return db[_0xde73('0x74')]['findAll'](_0x567a18);})[_0xde73('0x39')](function(_0x3d94bd){_0x1d060d['rows']=_0x3d94bd;return _0x1d060d;});}})['then'](respondWithFilteredResult(_0xaa5653,_0x567a18))[_0xde73('0x5a')](handleError(_0xaa5653,null));};exports['removeAnswers']=function(_0x1e7cd1,_0x2108a0,_0x2de04f){return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x1e7cd1[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x2108a0,null))['then'](function(_0x27ce9b){if(_0x27ce9b){return _0x27ce9b[_0xde73('0x77')](_0x1e7cd1[_0xde73('0x48')]['ids']);}})[_0xde73('0x39')](respondWithStatusCode(_0x2108a0,null))[_0xde73('0x5a')](handleError(_0x2108a0,null));};exports['addInteraction']=function(_0x388f64,_0x19ac5f,_0x3238f6){return db[_0xde73('0x78')][_0xde73('0x60')]({'where':{'id':_0x388f64['params']['id']}})['then'](handleEntityNotFound(_0x19ac5f,null))[_0xde73('0x39')](function(_0x2f1dd8){if(_0x2f1dd8){return _0x2f1dd8[_0xde73('0x79')](_0x388f64[_0xde73('0x62')][_0xde73('0x72')],_[_0xde73('0x7a')](_0x388f64[_0xde73('0x62')],[_0xde73('0x72'),'id'])||{});}})[_0xde73('0x39')](respondWithResult(_0x19ac5f,null))[_0xde73('0x5a')](handleError(_0x19ac5f,null));};exports[_0xde73('0x7b')]=function(_0x87f679,_0x1e4e1e,_0x4fda64){var _0x335abc={'raw':![],'where':{}};var _0x5137af={};var _0x50e191={'count':0x0,'rows':[]};return db[_0xde73('0x56')][_0xde73('0x70')]({'where':{'id':_0x87f679['params']['id']}})['then'](handleEntityNotFound(_0x1e4e1e,null))[_0xde73('0x39')](function(_0x47c824){if(_0x47c824){_0x5137af[_0xde73('0x46')]=_[_0xde73('0x47')](db['FaxInteraction'][_0xde73('0x43')]);_0x5137af[_0xde73('0x48')]=_['keys'](_0x87f679[_0xde73('0x48')]);_0x5137af[_0xde73('0x49')]=_[_0xde73('0x5e')](_0x5137af['model'],_0x5137af[_0xde73('0x48')]);_0x335abc[_0xde73('0x4a')]=_[_0xde73('0x5e')](_0x5137af[_0xde73('0x46')],qs[_0xde73('0x4b')](_0x87f679[_0xde73('0x48')]['fields']));_0x335abc[_0xde73('0x4a')]=_0x335abc[_0xde73('0x4a')]['length']?_0x335abc['attributes']:_0x5137af['model'];if(!_0x87f679['query'][_0xde73('0x76')](_0xde73('0x4d'))){_0x335abc[_0xde73('0x33')]=qs['limit'](_0x87f679[_0xde73('0x48')][_0xde73('0x33')]);_0x335abc[_0xde73('0x32')]=qs[_0xde73('0x32')](_0x87f679[_0xde73('0x48')]['offset']);}_0x335abc[_0xde73('0x4e')]=qs[_0xde73('0x4f')](_0x87f679[_0xde73('0x48')][_0xde73('0x4f')]);_0x335abc['where']=qs[_0xde73('0x49')](_[_0xde73('0x51')](_0x87f679['query'],_0x5137af[_0xde73('0x49')]));_0x335abc[_0xde73('0x50')][_0xde73('0x6d')]=_0x47c824['id'];if(_0x87f679[_0xde73('0x48')]['filter']){_0x335abc[_0xde73('0x50')]=_['merge'](_0x335abc[_0xde73('0x50')],{'$or':_[_0xde73('0x42')](_0x335abc['attributes'],function(_0x2ac62f){var _0x4b24d5={};_0x4b24d5[_0x2ac62f]={'$like':'%'+_0x87f679[_0xde73('0x48')]['filter']+'%'};return _0x4b24d5;})});}_0x335abc=_[_0xde73('0x53')]({},_0x335abc,_0x87f679['options']);return db[_0xde73('0x78')][_0xde73('0x31')]({'where':_0x335abc[_0xde73('0x50')]})['then'](function(_0x217c9a){_0x50e191[_0xde73('0x31')]=_0x217c9a;if(_0x87f679['query'][_0xde73('0x5f')]){_0x335abc[_0xde73('0x57')]=[{'model':db['CmContact'],'as':_0xde73('0x7c'),'required':![]},{'model':db[_0xde73('0x7d')],'as':_0xde73('0x7e'),'attributes':[_0xde73('0x3e'),_0xde73('0x7f'),_0xde73('0x80')],'required':![]},{'model':db[_0xde73('0x81')],'as':_0xde73('0x82'),'attributes':['id','name',_0xde73('0x83')],'where':_0x87f679['query'][_0xde73('0x84')]?{'id':_0x87f679[_0xde73('0x48')][_0xde73('0x84')]}:undefined,'required':_0x87f679[_0xde73('0x48')][_0xde73('0x84')]?!![]:![]}];}return db[_0xde73('0x78')][_0xde73('0x58')](_0x335abc);})[_0xde73('0x39')](function(_0x496438){_0x50e191[_0xde73('0x59')]=_0x496438;return _0x50e191;});}})['then'](respondWithFilteredResult(_0x1e4e1e,_0x335abc))[_0xde73('0x5a')](handleError(_0x1e4e1e,null));};exports[_0xde73('0x85')]=function(_0x1865e6,_0x414b0a){var _0x186415=_0x1865e6[_0xde73('0x5c')]['id'];var _0x3ddf4f=_0x1865e6[_0xde73('0x62')];var _0xdab2cb=0xc8;var _0x46043a=null;return db[_0xde73('0x86')][_0xde73('0x87')]({'isolationLevel':db[_0xde73('0x86')][_0xde73('0x88')][_0xde73('0x89')]['READ_COMMITTED']},function(_0x4d3d38){return db[_0xde73('0x56')]['findOne']({'where':{'id':_0x186415},'transaction':_0x4d3d38})[_0xde73('0x39')](function(_0x1f9e39){if(_0x1f9e39){return db[_0xde73('0x8a')][_0xde73('0x3a')]({'where':{'FaxAccountId':_0x186415},'transaction':_0x4d3d38})['then'](function(){var _0x59994e=_['map'](_0x3ddf4f,function(_0x1968d9){_0x1968d9[_0xde73('0x6d')]=_0x186415;return _0x1968d9;});return db[_0xde73('0x8a')]['bulkCreate'](_0x59994e,{'transaction':_0x4d3d38});});}else{_0xdab2cb=0x194;_0x46043a=[];}});})[_0xde73('0x39')](function(){if(_0xdab2cb!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x186415},'order':_0xde73('0x8b')})[_0xde73('0x39')](function(_0x2606b5){_0x46043a=_0x2606b5;});}})[_0xde73('0x5a')](function(_0x39d42){_0xdab2cb=0x1f4;logger[_0xde73('0x28')](_0x39d42[_0xde73('0x3d')]);if(_0x39d42[_0xde73('0x3e')]){delete _0x39d42[_0xde73('0x3e')];}_0x46043a=_0x39d42;})['finally'](function(){if(_0x46043a===null){_0x414b0a[_0xde73('0x2c')](_0xdab2cb);}else{if(_0xdab2cb===0x1f4){_0x414b0a[_0xde73('0x2d')](_0xdab2cb)[_0xde73('0x3f')](_0x46043a);}else{_0x414b0a['status'](_0xdab2cb)[_0xde73('0x2f')](_0x46043a);}}});};exports[_0xde73('0x8c')]=function(_0x281912,_0x39e422,_0x55a1f9){var _0x5d8659={};var _0x21aeb0={};var _0x19d56b;var _0x555334;return db[_0xde73('0x56')][_0xde73('0x70')]({'where':{'id':_0x281912[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x39e422,null))[_0xde73('0x39')](function(_0x118186){if(_0x118186){_0x19d56b=_0x118186;_0x21aeb0[_0xde73('0x46')]=_[_0xde73('0x47')](db['FaxApplication']['rawAttributes']);_0x21aeb0['query']=_[_0xde73('0x47')](_0x281912['query']);_0x21aeb0['filters']=_[_0xde73('0x5e')](_0x21aeb0[_0xde73('0x46')],_0x21aeb0[_0xde73('0x48')]);_0x5d8659[_0xde73('0x4a')]=_[_0xde73('0x5e')](_0x21aeb0[_0xde73('0x46')],qs['fields'](_0x281912[_0xde73('0x48')][_0xde73('0x4b')]));_0x5d8659[_0xde73('0x4a')]=_0x5d8659[_0xde73('0x4a')]['length']?_0x5d8659[_0xde73('0x4a')]:_0x21aeb0[_0xde73('0x46')];_0x5d8659[_0xde73('0x4e')]=qs[_0xde73('0x4f')](_0x281912[_0xde73('0x48')][_0xde73('0x4f')]);_0x5d8659[_0xde73('0x50')]=qs[_0xde73('0x49')](_[_0xde73('0x51')](_0x281912[_0xde73('0x48')],_0x21aeb0['filters']));if(_0x281912[_0xde73('0x48')][_0xde73('0x52')]){_0x5d8659[_0xde73('0x50')]=_['merge'](_0x5d8659[_0xde73('0x50')],{'$or':_[_0xde73('0x42')](_0x5d8659[_0xde73('0x4a')],function(_0x2f1dce){var _0xb2cb73={};_0xb2cb73[_0x2f1dce]={'$like':'%'+_0x281912[_0xde73('0x48')][_0xde73('0x52')]+'%'};return _0xb2cb73;})});}_0x5d8659=_['merge']({},_0x5d8659,_0x281912[_0xde73('0x55')]);return _0x19d56b[_0xde73('0x8c')](_0x5d8659);}})['then'](function(_0x18748c){if(_0x18748c){_0x555334=_0x18748c[_0xde73('0x4c')];if(!_0x281912[_0xde73('0x48')]['hasOwnProperty'](_0xde73('0x4d'))){_0x5d8659['limit']=qs[_0xde73('0x33')](_0x281912[_0xde73('0x48')][_0xde73('0x33')]);_0x5d8659[_0xde73('0x32')]=qs[_0xde73('0x32')](_0x281912[_0xde73('0x48')][_0xde73('0x32')]);}return _0x19d56b[_0xde73('0x8c')](_0x5d8659);}})[_0xde73('0x39')](function(_0x726a97){if(_0x726a97){return _0x726a97?{'count':_0x555334,'rows':_0x726a97}:null;}})[_0xde73('0x39')](respondWithResult(_0x39e422,null))[_0xde73('0x5a')](handleError(_0x39e422,null));};function Extension(_0xab0824,_0x32e4d9,_0x3a5cf4,_0x2802cd){this[_0xde73('0x8d')]='from-voip-provider';this[_0xde73('0x8e')]=_0xab0824['localstationid'];this[_0xde73('0x8f')]=_0x2802cd;this[_0xde73('0x44')]=_0xde73('0x90');this[_0xde73('0x91')]=_0xde73('0x92');this[_0xde73('0x6d')]=_0xab0824['id'];this[_0xde73('0x8b')]=_0x32e4d9;this[_0xde73('0x93')]=_0x3a5cf4;}function createExtensionsReciveFax(_0x341996){var _0xaab3c7=0x1;var _0x325b22=[];_0x325b22[_0xde73('0x94')](new Extension(_0x341996,_0xaab3c7,'',_0xde73('0x95')));_0xaab3c7+=0x1;_0x325b22['push'](new Extension(_0x341996,_0xaab3c7,_0xde73('0x96'),_0xde73('0x97')));_0xaab3c7+=0x1;for(var _0x2c1730 in _0x341996){if(_0x341996['hasOwnProperty'](_0x2c1730)&&(_0x2c1730===_0xde73('0x98')||_0x2c1730===_0xde73('0x99')||_0x2c1730===_0xde73('0x9a')||_0x2c1730===_0xde73('0x9b')||_0x2c1730===_0xde73('0x9c')||_0x2c1730===_0xde73('0x9d')||_0x2c1730===_0xde73('0x9e')||_0x2c1730===_0xde73('0x9f')||_0x2c1730===_0xde73('0xa0'))){_0x325b22[_0xde73('0x94')](new Extension(_0x341996,_0xaab3c7,_0xde73('0xa1')+_0x2c1730+')='+_0x341996[_0x2c1730],'Set'));_0xaab3c7+=0x1;}}_0x325b22[_0xde73('0x94')](new Extension(_0x341996,_0xaab3c7,'6','Wait'));_0xaab3c7+=0x1;_0x325b22['push'](new Extension(_0x341996,_0xaab3c7,_0xde73('0xa2'),_0xde73('0xa3')));_0xaab3c7=0x0;return _0x325b22;}exports[_0xde73('0xa4')]=function(_0x341adb,_0x14f787,_0x366c12){var _0x28bfda;return db[_0xde73('0x86')][_0xde73('0x87')](function(_0x3e409e){return db['FaxAccount']['create'](_0x341adb[_0xde73('0x62')],{'transaction':_0x3e409e})[_0xde73('0x39')](function(_0x5e371e){_0x28bfda=_0x5e371e['get']({'plain':!![]});return db['VoiceExtension'][_0xde73('0xa5')](createExtensionsReciveFax(_0x28bfda),{'transaction':_0x3e409e});});})[_0xde73('0x39')](function(){return _0x28bfda;})['then'](respondWithResult(_0x14f787,null))[_0xde73('0x5a')](handleError(_0x14f787,null));};exports['updateAccountApplications']=function(_0x115b55,_0x195c10,_0x2edfe2){var _0x80dbf7;return db[_0xde73('0x86')]['transaction'](function(_0x14fe05){return db['FaxAccount'][_0xde73('0x38')](_0x115b55[_0xde73('0x62')],{'where':{'id':_0x115b55['body']['id']},'transaction':_0x14fe05})[_0xde73('0x39')](function(_0x5c3982){return db[_0xde73('0xa6')]['destroy']({'where':{'FaxAccountId':_0x115b55['body']['id']},'transaction':_0x14fe05})[_0xde73('0x39')](function(_0x1a3593){return db[_0xde73('0xa6')][_0xde73('0xa5')](createExtensionsReciveFax(_['omit'](_0x115b55[_0xde73('0x62')],[_0xde73('0xa7'),_0xde73('0x45'),_0xde73('0xa8'),_0xde73('0xa9'),_0xde73('0xaa'),_0xde73('0xab')])),{'transaction':_0x14fe05});});});})['then'](function(){return db[_0xde73('0x56')][_0xde73('0xac')](_0x115b55[_0xde73('0x62')]['id']);})[_0xde73('0x39')](respondWithResult(_0x195c10,null))[_0xde73('0x5a')](handleError(_0x195c10,null));};exports[_0xde73('0xad')]=function(_0x229ab0,_0x4c4181,_0x3b6294){var _0x57bd19={'raw':!![],'where':{}};var _0x5e2312={};var _0x50a41b={'count':0x0,'rows':[]};return db['FaxAccount'][_0xde73('0x70')]({'where':{'id':_0x229ab0[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x4c4181,null))[_0xde73('0x39')](function(_0x89da70){if(_0x89da70){_0x5e2312[_0xde73('0x46')]=_['keys'](db['FaxMessage'][_0xde73('0x43')]);_0x5e2312[_0xde73('0x48')]=_['keys'](_0x229ab0[_0xde73('0x48')]);_0x5e2312[_0xde73('0x49')]=_[_0xde73('0x5e')](_0x5e2312['model'],_0x5e2312[_0xde73('0x48')]);_0x57bd19['attributes']=_[_0xde73('0x5e')](_0x5e2312[_0xde73('0x46')],qs[_0xde73('0x4b')](_0x229ab0[_0xde73('0x48')][_0xde73('0x4b')]));_0x57bd19['attributes']=_0x57bd19[_0xde73('0x4a')]['length']?_0x57bd19['attributes']:_0x5e2312[_0xde73('0x46')];if(!_0x229ab0['query'][_0xde73('0x76')](_0xde73('0x4d'))){_0x57bd19[_0xde73('0x33')]=qs['limit'](_0x229ab0[_0xde73('0x48')][_0xde73('0x33')]);_0x57bd19['offset']=qs[_0xde73('0x32')](_0x229ab0[_0xde73('0x48')][_0xde73('0x32')]);}_0x57bd19[_0xde73('0x4e')]=qs[_0xde73('0x4f')](_0x229ab0['query'][_0xde73('0x4f')]);_0x57bd19['where']=qs[_0xde73('0x49')](_[_0xde73('0x51')](_0x229ab0[_0xde73('0x48')],_0x5e2312[_0xde73('0x49')]));_0x57bd19['where'][_0xde73('0x6d')]=_0x89da70['id'];if(_0x229ab0['query']['filter']){_0x57bd19[_0xde73('0x50')]=_[_0xde73('0x53')](_0x57bd19[_0xde73('0x50')],{'$or':_[_0xde73('0x42')](_0x57bd19[_0xde73('0x4a')],function(_0x1cd1e2){var _0x432e3b={};_0x432e3b[_0x1cd1e2]={'$like':'%'+_0x229ab0[_0xde73('0x48')][_0xde73('0x52')]+'%'};return _0x432e3b;})});}if(_0x229ab0[_0xde73('0x48')][_0xde73('0xae')]){var _0x1d9d71=_0x229ab0[_0xde73('0x48')][_0xde73('0xae')][_0xde73('0xaf')](',');var _0x58c0a9={};_0x58c0a9[_0x1d9d71[0x0]]={'$gte':moment(_0x1d9d71[0x1])['format'](_0xde73('0xb0'))};_0x57bd19[_0xde73('0x50')]=_[_0xde73('0x53')](_0x57bd19[_0xde73('0x50')],_0x58c0a9);}_0x57bd19=_['merge']({},_0x57bd19,_0x229ab0[_0xde73('0x55')]);return db[_0xde73('0xb1')]['count']({'where':_0x57bd19[_0xde73('0x50')]})['then'](function(_0x1f5df6){_0x50a41b[_0xde73('0x31')]=_0x1f5df6;if(_0x229ab0[_0xde73('0x48')][_0xde73('0x5f')]){_0x57bd19[_0xde73('0x57')]=[{'all':!![]}];}return db[_0xde73('0xb1')]['findAll'](_0x57bd19);})[_0xde73('0x39')](function(_0x73912b){_0x50a41b['rows']=_0x73912b;return _0x50a41b;});}})[_0xde73('0x39')](respondWithFilteredResult(_0x4c4181,_0x57bd19))[_0xde73('0x5a')](handleError(_0x4c4181,null));};exports[_0xde73('0x3f')]=function(_0x4b392f,_0x417f90,_0x2b8e98){var _0x1caeb4,_0xc70635={},_0x490cae;if(_0x4b392f[_0xde73('0x62')]['to']){_0x490cae=_0x4b392f[_0xde73('0x62')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x4b392f[_0xde73('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xde73('0xb2'),'include':[{'model':db[_0xde73('0xb3')],'as':_0xde73('0xb4'),'where':{'fax':_0x490cae},'limit':0x1,'order':[[_0xde73('0xa9'),_0xde73('0xb5')]]}]}]})[_0xde73('0x39')](handleEntityNotFound(_0x417f90,null))[_0xde73('0x39')](function(_0x2594a8){_0x1caeb4=_0x2594a8;if(_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')]&&_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')]['length']){for(var _0x5904b3=0x0;_0x5904b3<_0x4b392f[_0xde73('0x62')]['attachments'][_0xde73('0x4c')];_0x5904b3+=0x1){_0x4b392f[_0xde73('0x62')]['attachments'][_0x5904b3]={'filename':_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')][_0x5904b3][_0xde73('0x3e')],'id':_0x4b392f[_0xde73('0x62')]['attachments'][_0x5904b3]['id'],'path':path[_0xde73('0xb7')](config['root'],'server/files/attachments',_0x4b392f['body'][_0xde73('0xb6')][_0x5904b3][_0xde73('0xb8')])};}}return respondWithRpcPromise(_0xde73('0xb9'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x4b392f[_0xde73('0x5c')]['id'])?undefined:_0x4b392f[_0xde73('0x5c')]['id'],'path':_[_0xde73('0xba')](_0x4b392f[_0xde73('0x62')]['attachments'][0x0][_0xde73('0xbb')])?undefined:_0x4b392f['body'][_0xde73('0xb6')][0x0][_0xde73('0xbb')],'fax':_['isNil'](_0x4b392f['body']['to'][0x0])?undefined:_0x4b392f['body']['to'][0x0]},client9002);})['then'](function(){if(_0x1caeb4){if(_[_0xde73('0xba')](_0x4b392f['body'][_0xde73('0xbc')])){_0x4b392f[_0xde73('0x62')][_0xde73('0xbc')]=util[_0xde73('0xbd')](_0xde73('0xbe'),_0x1caeb4[_0xde73('0x3e')],_0x1caeb4[_0xde73('0xbf')]);}if(_0x1caeb4[_0xde73('0xb2')]){if(_0x1caeb4[_0xde73('0xb2')][_0xde73('0xb4')][_0xde73('0x4c')]){return _0x1caeb4['List'][_0xde73('0xb4')][0x0];}else{return db[_0xde73('0xb3')][_0xde73('0x61')](_[_0xde73('0x1c')](_0x4b392f['body'],{'firstName':_0x4b392f[_0xde73('0x62')]['to'][0x0],'phone':_0x4b392f[_0xde73('0x62')]['to'][0x0],'fax':_0x4b392f[_0xde73('0x62')]['to'][0x0],'ListId':_0x1caeb4[_0xde73('0xab')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xde73('0xc0'));}})[_0xde73('0x39')](function(_0x504165){if(_0x504165){return db['FaxInteraction']['find']({'where':{'ContactId':_0x504165['id'],'closed':![],'FaxAccountId':_0x1caeb4['id']}})['then'](function(_0x1a48fd){if(_0x1a48fd){return[_0x1a48fd,![]];}return db[_0xde73('0x78')][_0xde73('0x61')]({'UserId':_0x4b392f[_0xde73('0x63')]['id'],'ContactId':_0x504165['id'],'FaxAccountId':_0x1caeb4['id'],'fax':_0x4b392f[_0xde73('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x4b392f[_0xde73('0x62')],{'read':![],'body':_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')][0x0]['filename'],'FaxAccountId':_0x1caeb4['id'],'UserId':_0x4b392f['user']['id'],'ContactId':_0x504165['id'],'AttachmentId':_0x4b392f[_0xde73('0x62')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xde73('0xc1')}]})['then'](function(_0x1ec44e){return[_0x1ec44e,!![]];});});}else{throw new Error(_0xde73('0xc2'));}})[_0xde73('0xc3')](function(_0x341efd,_0x3055fa){if(_0x3055fa){return _0x341efd;}return db[_0xde73('0xb1')][_0xde73('0x61')]({'direction':_0xde73('0xc4'),'read':![],'body':_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')][0x0]['filename'],'FaxAccountId':_0x1caeb4['id'],'FaxInteractionId':_0x341efd['id'],'UserId':_0x4b392f[_0xde73('0x63')]['id'],'ContactId':_0x341efd[_0xde73('0xc5')],'AttachmentId':_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')][0x0]['id']})['then'](function(_0x143b90){_0x341efd[_0xde73('0xc6')][_0xde73('0xc1')]=[];_0x341efd[_0xde73('0xc6')][_0xde73('0xc1')][_0xde73('0x94')](_0x143b90['dataValues']);return _0x341efd;});})['then'](function(_0x3a7fbe){respondWithRpcPromise(_0xde73('0xc7'),_0xde73('0xc7'),{'FaxAccountId':_['isNil'](_0x4b392f[_0xde73('0x5c')]['id'])?undefined:_0x4b392f[_0xde73('0x5c')]['id'],'path':_[_0xde73('0xba')](_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')][0x0][_0xde73('0xbb')])?undefined:_0x4b392f['body'][_0xde73('0xb6')][0x0]['path'],'fax':_[_0xde73('0xba')](_0x4b392f[_0xde73('0x62')]['to'][0x0])?undefined:_0x4b392f['body']['to'][0x0],'AttachmentId':_0x4b392f[_0xde73('0x62')][_0xde73('0xb6')][0x0]['id']},client9002)[_0xde73('0x39')](function(_0x3196df){logger[_0xde73('0x24')]('SendFaxRpc,\x20%s',_0x3196df);})[_0xde73('0x5a')](function(_0x5a9be2){logger['info'](_0xde73('0xc8'),_0x5a9be2);});return _0x3a7fbe;})[_0xde73('0x39')](respondWithResult(_0x417f90,null))[_0xde73('0x5a')](handleError(_0x417f90,null));};exports[_0xde73('0xc9')]=function(_0x26bfbf,_0x1d5762,_0x4b6906){return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x26bfbf[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x1d5762,null))[_0xde73('0x39')](function(_0x2b1a61){if(_0x2b1a61){return _0x2b1a61[_0xde73('0xc9')](_0x26bfbf[_0xde73('0x62')][_0xde73('0x72')],_[_0xde73('0x7a')](_0x26bfbf['body'],[_0xde73('0x72'),'id'])||{})[_0xde73('0xc3')](function(_0x2129a6){for(var _0x592729=0x0;_0x592729<_0x26bfbf[_0xde73('0x62')][_0xde73('0x72')][_0xde73('0x4c')];_0x592729+=0x1){socket[_0xde73('0xca')]('userFaxAccount:save',{'UserId':Number(_0x26bfbf['body'][_0xde73('0x72')][_0x592729]),'FaxAccountId':Number(_0x26bfbf[_0xde73('0x5c')]['id'])});}return _0x2129a6;});}})[_0xde73('0x39')](respondWithResult(_0x1d5762,null))[_0xde73('0x5a')](handleError(_0x1d5762,null));};exports[_0xde73('0xcb')]=function(_0x54f582,_0x2b7eb,_0x54b419){return db[_0xde73('0x56')][_0xde73('0x60')]({'where':{'id':_0x54f582['params']['id']}})[_0xde73('0x39')](handleEntityNotFound(_0x2b7eb,null))[_0xde73('0x39')](function(_0x357e0c){if(_0x357e0c){return _0x357e0c[_0xde73('0xcb')](_0x54f582[_0xde73('0x48')][_0xde73('0x72')])['then'](function(){if(_[_0xde73('0xcc')](_0x54f582[_0xde73('0x48')]['ids'])){for(var _0x2a7cb9=0x0;_0x2a7cb9<_0x54f582['query'][_0xde73('0x72')][_0xde73('0x4c')];_0x2a7cb9+=0x1){socket[_0xde73('0xca')](_0xde73('0xcd'),{'UserId':Number(_0x54f582[_0xde73('0x48')][_0xde73('0x72')][_0x2a7cb9]),'FaxAccountId':Number(_0x54f582['params']['id'])});}}else{socket['emit'](_0xde73('0xcd'),{'UserId':Number(_0x54f582[_0xde73('0x48')][_0xde73('0x72')]),'FaxAccountId':Number(_0x54f582[_0xde73('0x5c')]['id'])});}});}})[_0xde73('0x39')](respondWithStatusCode(_0x2b7eb,null))[_0xde73('0x5a')](handleError(_0x2b7eb,null));};exports['getAgents']=function(_0x453b36,_0xe1a017,_0x35f395){var _0x4d3bb7={};var _0x272576={};var _0x8df4c4;var _0x6971b;return db[_0xde73('0x56')][_0xde73('0x70')]({'where':{'id':_0x453b36[_0xde73('0x5c')]['id']}})[_0xde73('0x39')](handleEntityNotFound(_0xe1a017,null))[_0xde73('0x39')](function(_0x178362){if(_0x178362){_0x8df4c4=_0x178362;_0x272576[_0xde73('0x46')]=_['keys'](db[_0xde73('0x7d')][_0xde73('0x43')]);_0x272576[_0xde73('0x48')]=_[_0xde73('0x47')](_0x453b36[_0xde73('0x48')]);_0x272576[_0xde73('0x49')]=_[_0xde73('0x5e')](_0x272576[_0xde73('0x46')],_0x272576[_0xde73('0x48')]);_0x4d3bb7[_0xde73('0x4a')]=_[_0xde73('0x5e')](_0x272576[_0xde73('0x46')],qs[_0xde73('0x4b')](_0x453b36[_0xde73('0x48')]['fields']));_0x4d3bb7[_0xde73('0x4a')]=_0x4d3bb7[_0xde73('0x4a')][_0xde73('0x4c')]?_0x4d3bb7[_0xde73('0x4a')]:_0x272576[_0xde73('0x46')];_0x4d3bb7[_0xde73('0x4e')]=qs[_0xde73('0x4f')](_0x453b36[_0xde73('0x48')]['sort']);_0x4d3bb7[_0xde73('0x50')]=qs[_0xde73('0x49')](_[_0xde73('0x51')](_0x453b36[_0xde73('0x48')],_0x272576[_0xde73('0x49')]));if(_0x453b36[_0xde73('0x48')][_0xde73('0x52')]){_0x4d3bb7['where']=_[_0xde73('0x53')](_0x4d3bb7[_0xde73('0x50')],{'$or':_['map'](_0x4d3bb7[_0xde73('0x4a')],function(_0x3bc677){var _0x2812cc={};_0x2812cc[_0x3bc677]={'$like':'%'+_0x453b36['query'][_0xde73('0x52')]+'%'};return _0x2812cc;})});}_0x4d3bb7=_['merge']({},_0x4d3bb7,_0x453b36[_0xde73('0x55')]);return _0x8df4c4[_0xde73('0xce')](_0x4d3bb7);}})[_0xde73('0x39')](function(_0x18bd84){if(_0x18bd84){_0x6971b=_0x18bd84[_0xde73('0x4c')];if(!_0x453b36['query'][_0xde73('0x76')](_0xde73('0x4d'))){_0x4d3bb7['limit']=qs[_0xde73('0x33')](_0x453b36[_0xde73('0x48')][_0xde73('0x33')]);_0x4d3bb7['offset']=qs['offset'](_0x453b36[_0xde73('0x48')][_0xde73('0x32')]);}return _0x8df4c4[_0xde73('0xce')](_0x4d3bb7);}})[_0xde73('0x39')](function(_0x3b2932){if(_0x3b2932){return _0x3b2932?{'count':_0x6971b,'rows':_0x3b2932}:null;}})[_0xde73('0x39')](respondWithResult(_0xe1a017,null))[_0xde73('0x5a')](handleError(_0xe1a017,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b107aa2..b247f19 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 _0x45d5=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x5d808c,_0x3509ea){var _0x1ecf2f=function(_0x51eaa7){while(--_0x51eaa7){_0x5d808c['push'](_0x5d808c['shift']());}};_0x1ecf2f(++_0x3509ea);}(_0x45d5,0x1d1));var _0x545d=function(_0x2559bd,_0x1691a6){_0x2559bd=_0x2559bd-0x0;var _0x34ca3e=_0x45d5[_0x2559bd];return _0x34ca3e;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x545d('0x0'))['db'][_0x545d('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x545d('0x2')](0x0);var events={'afterCreate':_0x545d('0x3'),'afterUpdate':_0x545d('0x4'),'afterDestroy':_0x545d('0x5')};function emitEvent(_0x165c61){return function(_0x47e5f1,_0x3765a9,_0x14706c){FaxAccountEvents[_0x545d('0x6')](_0x165c61+':'+_0x47e5f1['id'],_0x47e5f1);FaxAccountEvents[_0x545d('0x6')](_0x165c61,_0x47e5f1);_0x14706c(null);};}for(var e in events){if(events[_0x545d('0x7')](e)){var event=events[e];FaxAccount[_0x545d('0x8')](e,emitEvent(event));}}module[_0x545d('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x720c=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4209a1,_0x5f5b36){var _0x99e3ac=function(_0x216c6c){while(--_0x216c6c){_0x4209a1['push'](_0x4209a1['shift']());}};_0x99e3ac(++_0x5f5b36);}(_0x720c,0x138));var _0xc720=function(_0x54b7d1,_0x51504c){_0x54b7d1=_0x54b7d1-0x0;var _0x38ad9b=_0x720c[_0x54b7d1];return _0x38ad9b;};'use strict';var EventEmitter=require(_0xc720('0x0'));var FaxAccount=require(_0xc720('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc720('0x2')](0x0);var events={'afterCreate':_0xc720('0x3'),'afterUpdate':_0xc720('0x4'),'afterDestroy':_0xc720('0x5')};function emitEvent(_0x540767){return function(_0x3eb280,_0x98ae12,_0x1609a9){FaxAccountEvents[_0xc720('0x6')](_0x540767+':'+_0x3eb280['id'],_0x3eb280);FaxAccountEvents[_0xc720('0x6')](_0x540767,_0x3eb280);_0x1609a9(null);};}for(var e in events){if(events[_0xc720('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xc720('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index faff5d4..9180e0b 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 _0x86f7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','FaxAccount','fax_accounts','lodash','util'];(function(_0x5bd5fc,_0x57597){var _0x420110=function(_0x3d99d8){while(--_0x3d99d8){_0x5bd5fc['push'](_0x5bd5fc['shift']());}};_0x420110(++_0x57597);}(_0x86f7,0x1e2));var _0x786f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86f7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x786f('0x0'));var util=require(_0x786f('0x1'));var logger=require(_0x786f('0x2'))(_0x786f('0x3'));var moment=require(_0x786f('0x4'));var BPromise=require(_0x786f('0x5'));var rp=require(_0x786f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x786f('0x7'));var config=require(_0x786f('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x167ee4,_0x7c3d36){return _0x167ee4['define'](_0x786f('0x9'),attributes,{'tableName':_0x786f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe645=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxAccount.attributes'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe645,0x1f2));var _0x5e64=function(_0x4bd624,_0x43fb16){_0x4bd624=_0x4bd624-0x0;var _0x162d7c=_0xe645[_0x4bd624];return _0x162d7c;};'use strict';var _=require(_0x5e64('0x0'));var util=require(_0x5e64('0x1'));var logger=require(_0x5e64('0x2'))(_0x5e64('0x3'));var moment=require(_0x5e64('0x4'));var BPromise=require('bluebird');var rp=require(_0x5e64('0x5'));var fs=require('fs');var path=require(_0x5e64('0x6'));var rimraf=require(_0x5e64('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e64('0x8'));module[_0x5e64('0x9')]=function(_0x5d24de,_0x47c9ee){return _0x5d24de[_0x5e64('0xa')](_0x5e64('0xb'),attributes,{'tableName':_0x5e64('0xc'),'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 afced07..b9fd5f4 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 _0x0064=['asc','length','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','stringify','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','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','from','find','CmList','List','CmContact','Contacts','Applications','get','account','applications','list','orderBy','priority'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0064,0x78));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4006('0x0'));var util=require(_0x4006('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4006('0x2'));var db=require(_0x4006('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4006('0x4'))(_0x4006('0x5'));var config=require(_0x4006('0x6'));var jayson=require(_0x4006('0x7'));var client=jayson[_0x4006('0x8')][_0x4006('0x9')]({'port':0x232c});config['redis']=_[_0x4006('0xa')](config[_0x4006('0xb')],{'host':_0x4006('0xc'),'port':0x18eb});var socket=require(_0x4006('0xd'))(new Redis(config[_0x4006('0xb')]));require(_0x4006('0xe'))[_0x4006('0xf')](socket);function respondWithRpcPromise(_0x524044,_0x3cd647,_0x54e89b){return new BPromise(function(_0x18c66c,_0x82517){return client['request'](_0x524044,_0x54e89b)[_0x4006('0x10')](function(_0x4382b1){logger['info'](_0x4006('0x11'),_0x3cd647,'request\x20sent');logger['debug'](_0x4006('0x12'),_0x3cd647,_0x4006('0x13'),JSON['stringify'](_0x4382b1));if(_0x4382b1[_0x4006('0x14')]){if(_0x4382b1[_0x4006('0x14')][_0x4006('0x15')]===0x1f4){logger[_0x4006('0x14')](_0x4006('0x11'),_0x3cd647,_0x4382b1[_0x4006('0x14')][_0x4006('0x16')]);return _0x82517(_0x4382b1[_0x4006('0x14')][_0x4006('0x16')]);}logger[_0x4006('0x14')](_0x4006('0x11'),_0x3cd647,_0x4382b1['error'][_0x4006('0x16')]);return _0x18c66c(_0x4382b1[_0x4006('0x14')]['message']);}else{logger['info'](_0x4006('0x11'),_0x3cd647,_0x4006('0x13'));_0x18c66c(_0x4382b1[_0x4006('0x17')]['message']);}})[_0x4006('0x18')](function(_0x1c3d4b){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3cd647,_0x1c3d4b);_0x82517(_0x1c3d4b);});});}exports[_0x4006('0x19')]=function(_0x38c212){var _0x1746d4=this;return new Promise(function(_0x50835c,_0x2ac54e){return db[_0x4006('0x1a')][_0x4006('0x1b')]({'raw':_0x38c212[_0x4006('0x1c')]?_0x38c212[_0x4006('0x1c')][_0x4006('0x1d')]===undefined?!![]:![]:!![],'where':_0x38c212[_0x4006('0x1c')]?_0x38c212[_0x4006('0x1c')][_0x4006('0x1e')]||null:null,'attributes':_0x38c212[_0x4006('0x1c')]?_0x38c212[_0x4006('0x1c')][_0x4006('0x1f')]||null:null,'limit':_0x38c212['options']?_0x38c212['options'][_0x4006('0x20')]||null:null,'include':_0x38c212[_0x4006('0x1c')]?_0x38c212['options'][_0x4006('0x21')]?_[_0x4006('0x22')](_0x38c212[_0x4006('0x1c')]['include'],function(_0x3dc941){return{'model':db[_0x3dc941[_0x4006('0x23')]],'as':_0x3dc941['as'],'attributes':_0x3dc941[_0x4006('0x1f')],'include':_0x3dc941['include']?_[_0x4006('0x22')](_0x3dc941['include'],function(_0x3f3bd0){return{'model':db[_0x3f3bd0[_0x4006('0x23')]],'as':_0x3f3bd0['as'],'attributes':_0x3f3bd0[_0x4006('0x1f')],'include':_0x3f3bd0[_0x4006('0x21')]?_[_0x4006('0x22')](_0x3f3bd0['include'],function(_0x2cf8de){return{'model':db[_0x2cf8de[_0x4006('0x23')]],'as':_0x2cf8de['as'],'attributes':_0x2cf8de[_0x4006('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4006('0x10')](function(_0x2fe4b5){logger[_0x4006('0x24')](_0x4006('0x19'),_0x38c212);logger[_0x4006('0x25')](_0x4006('0x19'),_0x38c212,JSON[_0x4006('0x26')](_0x2fe4b5));_0x50835c(_0x2fe4b5);})['catch'](function(_0x1d0ddf){logger['error'](_0x4006('0x19'),_0x1d0ddf[_0x4006('0x16')],_0x38c212);_0x2ac54e(_0x1746d4[_0x4006('0x14')](0x1f4,_0x1d0ddf[_0x4006('0x16')]));});});};exports[_0x4006('0x27')]=function(_0x2252c7,_0x5c3856,_0x30a14a){var _0x20e62c=this;return new Promise(function(_0xcc1b60,_0x2bf1dd){var _0x198e92={'body':_0x2252c7[_0x4006('0x28')],'channel':_0x4006('0x29')};var _0xfe44c7=[];var _0x1a3558=[];var _0x2e7680={};return db['CmContact'][_0x4006('0x2a')]()[_0x4006('0x10')](function(_0x22e3c0){if(!_0x22e3c0){throw new db[(_0x4006('0x2b'))][(_0x4006('0x2c'))](_0x4006('0x2d'));}_0xfe44c7=_[_0x4006('0x2e')](_['keys'](_0x22e3c0),['createdAt',_0x4006('0x2f')]);_0x1a3558=_[_0x4006('0x2e')](_[_0x4006('0x30')](_0x22e3c0),[_0x4006('0x31'),_0x4006('0x2f'),_0x4006('0x32'),_0x4006('0x33')]);if(_0x2252c7[_0x4006('0x28')]['id']){delete _0x2252c7['body']['id'];}if(_['isNil'](_0x2252c7[_0x4006('0x28')]['from'])){throw new db[(_0x4006('0x2b'))][(_0x4006('0x2c'))](_0x4006('0x34'));}if(_[_0x4006('0x35')](_0x2252c7[_0x4006('0x28')][_0x4006('0x28')])||_0x2252c7[_0x4006('0x28')][_0x4006('0x28')]===''){throw new db[(_0x4006('0x2b'))][(_0x4006('0x2c'))](_0x4006('0x36'));}if(_[_0x4006('0x35')](_0x2252c7[_0x4006('0x28')][_0x4006('0x37')])){throw new db[(_0x4006('0x2b'))]['ValidationError'](_0x4006('0x38')+_0x1a3558);}if(!_[_0x4006('0x39')](_0x1a3558,_0x2252c7[_0x4006('0x28')][_0x4006('0x37')])){throw new db[(_0x4006('0x2b'))][(_0x4006('0x2c'))](_0x4006('0x3a')+_0x1a3558);}_0x2e7680[_0x2252c7[_0x4006('0x28')]['mapKey']]=_0x2252c7[_0x4006('0x28')][_0x4006('0x3b')];})[_0x4006('0x10')](function(){return db[_0x4006('0x1a')][_0x4006('0x3c')]({'where':{'id':_0x2252c7['account']['id']},'include':[{'model':db[_0x4006('0x3d')],'as':_0x4006('0x3e'),'include':[{'model':db[_0x4006('0x3f')],'as':_0x4006('0x40'),'where':_0x2e7680,'limit':0x1,'order':[[_0x4006('0x2f'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x4006('0x41')}]});})['then'](function(_0x32554e){if(_0x32554e&&_0x32554e['List']){var _0x10e1c4=_0x32554e[_0x4006('0x42')]({'plain':!![]});_0x198e92[_0x4006('0x43')]=_0x10e1c4;_0x198e92[_0x4006('0x44')]=_0x10e1c4[_0x4006('0x41')];_0x198e92[_0x4006('0x45')]=_0x10e1c4[_0x4006('0x3e')];_0x198e92[_0x4006('0x44')]=_[_0x4006('0x46')](_0x198e92[_0x4006('0x44')],[_0x4006('0x47')],[_0x4006('0x48')]);if(_0x198e92[_0x4006('0x43')][_0x4006('0x41')]){delete _0x198e92[_0x4006('0x43')][_0x4006('0x41')];}if(_0x198e92[_0x4006('0x43')][_0x4006('0x3e')]&&_0x198e92[_0x4006('0x43')][_0x4006('0x3e')]['Contacts'][_0x4006('0x49')]){return _0x198e92[_0x4006('0x43')][_0x4006('0x3e')]['Contacts'][0x0];}var _0x3b9039=_[_0x4006('0xa')](_0x2252c7['body'],{'firstName':_0x2252c7['body'][_0x4006('0x3b')],'ListId':_0x10e1c4['ListId']});_0x3b9039[_0x2252c7['body'][_0x4006('0x37')]]=_0x2252c7[_0x4006('0x28')]['from'];return db['CmContact'][_0x4006('0x4a')](_0x3b9039,{'fields':_0xfe44c7,'raw':!![]});}})[_0x4006('0x10')](function(_0x24672b){_0x198e92[_0x4006('0x4b')]=_0x24672b;if(_0x24672b){var _0x57f02f={'ContactId':_0x24672b['id'],'FaxAccountId':_0x2252c7[_0x4006('0x43')]['id'],'fax':_0x24672b[_0x4006('0x29')]};return db[_0x4006('0x4c')][_0x4006('0x3c')]({'where':{'ContactId':_0x24672b['id'],'closed':![],'FaxAccountId':_0x2252c7['account']['id']}})[_0x4006('0x10')](function(_0x12214c){if(_0x12214c){return[_0x12214c,![]];}return db[_0x4006('0x4c')][_0x4006('0x4a')](_0x57f02f)['then'](function(_0x59df5b){return[_0x59df5b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4006('0x4d')](function(_0xb858b6,_0x3fbdd6){var _0x183323=_0xb858b6[_0x4006('0x42')]({'plain':!![]});if(_0x3fbdd6){if(_0x198e92[_0x4006('0x43')][_0x4006('0x4e')]){_0x198e92[_0x4006('0x44')][_0x4006('0x4f')]({'id':0x0,'priority':_0x198e92[_0x4006('0x44')]['length']+0x1,'app':_0x4006('0x50'),'appdata':_0x4006('0x51'),'interval':'*,*,*,*'});}_0x183323[_0x4006('0x52')]=!![];}else{_0x183323['created']=![];}_0x198e92[_0x4006('0x53')]=_0x183323;return db[_0x4006('0x54')][_0x4006('0x4a')]({'body':_0x2252c7['body']['body'],'FaxAccountId':_0x2252c7[_0x4006('0x43')]['id'],'FaxInteractionId':_0xb858b6['id'],'direction':'in','ContactId':_0xb858b6[_0x4006('0x55')],'AttachmentId':_0x2252c7['body'][_0x4006('0x56')]});})['then'](function(_0x18b08d){_0x198e92[_0x4006('0x16')]=_0x18b08d;if(_0x198e92['interaction']['UserId']){return db[_0x4006('0x57')][_0x4006('0x3c')]({'attributes':['id',_0x4006('0x58')],'where':{'id':_0x198e92['interaction'][_0x4006('0x59')]}})[_0x4006('0x10')](function(_0x13856d){if(_0x13856d){_0x198e92['applications'][_0x4006('0x5a')]({'id':0x0,'priority':0x0,'app':_0x4006('0x5b'),'appdata':_0x13856d[_0x4006('0x58')]+','+(_0x198e92[_0x4006('0x43')][_0x4006('0x5c')]||0xa),'interval':_0x4006('0x5d')});}return respondWithRpcPromise(_0x4006('0x5e'),_0x4006('0x5f'),_0x198e92);});}return respondWithRpcPromise(_0x4006('0x5e'),'startRouting',_0x198e92);})[_0x4006('0x10')](function(_0x4853f){_0xcc1b60(_0x4853f);})[_0x4006('0x18')](function(_0x2e99b7){_0x2bf1dd(_0x20e62c[_0x4006('0x14')](0x1f4,_0x2e99b7['message']));});});}; \ No newline at end of file +var _0x292d=['name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','FaxAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','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','find','account','CmList','CmContact','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','priority','Contacts','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User'];(function(_0xe3023c,_0x427be5){var _0xc83bd1=function(_0x438e40){while(--_0x438e40){_0xe3023c['push'](_0xe3023c['shift']());}};_0xc83bd1(++_0x427be5);}(_0x292d,0x172));var _0xd292=function(_0x31c27f,_0x40294c){_0x31c27f=_0x31c27f-0x0;var _0x28f9c6=_0x292d[_0x31c27f];return _0x28f9c6;};'use strict';var _=require(_0xd292('0x0'));var util=require(_0xd292('0x1'));var moment=require(_0xd292('0x2'));var BPromise=require(_0xd292('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd292('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd292('0x5'));var logger=require(_0xd292('0x6'))(_0xd292('0x7'));var config=require('../../config/environment');var jayson=require(_0xd292('0x8'));var client=jayson[_0xd292('0x9')][_0xd292('0xa')]({'port':0x232c});config[_0xd292('0xb')]=_[_0xd292('0xc')](config[_0xd292('0xb')],{'host':_0xd292('0xd'),'port':0x18eb});var socket=require(_0xd292('0xe'))(new Redis(config[_0xd292('0xb')]));require('./faxAccount.socket')[_0xd292('0xf')](socket);function respondWithRpcPromise(_0xc1b693,_0xffeb7c,_0x2caa00){return new BPromise(function(_0x50c501,_0x4bb853){return client[_0xd292('0x10')](_0xc1b693,_0x2caa00)[_0xd292('0x11')](function(_0x31ed29){logger[_0xd292('0x12')]('FaxAccount,\x20%s,\x20%s',_0xffeb7c,'request\x20sent');logger[_0xd292('0x13')](_0xd292('0x14'),_0xffeb7c,'request\x20sent',JSON['stringify'](_0x31ed29));if(_0x31ed29[_0xd292('0x15')]){if(_0x31ed29[_0xd292('0x15')]['code']===0x1f4){logger['error'](_0xd292('0x16'),_0xffeb7c,_0x31ed29[_0xd292('0x15')]['message']);return _0x4bb853(_0x31ed29['error']['message']);}logger[_0xd292('0x15')]('FaxAccount,\x20%s,\x20%s',_0xffeb7c,_0x31ed29['error'][_0xd292('0x17')]);return _0x50c501(_0x31ed29[_0xd292('0x15')][_0xd292('0x17')]);}else{logger[_0xd292('0x12')](_0xd292('0x16'),_0xffeb7c,_0xd292('0x18'));_0x50c501(_0x31ed29['result'][_0xd292('0x17')]);}})[_0xd292('0x19')](function(_0x300bdc){logger['error'](_0xd292('0x16'),_0xffeb7c,_0x300bdc);_0x4bb853(_0x300bdc);});});}exports[_0xd292('0x1a')]=function(_0xebacda){var _0x31ecb0=this;return new Promise(function(_0x2b03e1,_0x37e6a6){return db[_0xd292('0x1b')][_0xd292('0x1c')]({'raw':_0xebacda[_0xd292('0x1d')]?_0xebacda[_0xd292('0x1d')][_0xd292('0x1e')]===undefined?!![]:![]:!![],'where':_0xebacda[_0xd292('0x1d')]?_0xebacda[_0xd292('0x1d')]['where']||null:null,'attributes':_0xebacda[_0xd292('0x1d')]?_0xebacda['options'][_0xd292('0x1f')]||null:null,'limit':_0xebacda[_0xd292('0x1d')]?_0xebacda['options'][_0xd292('0x20')]||null:null,'include':_0xebacda[_0xd292('0x1d')]?_0xebacda['options'][_0xd292('0x21')]?_['map'](_0xebacda['options'][_0xd292('0x21')],function(_0x16c555){return{'model':db[_0x16c555['model']],'as':_0x16c555['as'],'attributes':_0x16c555[_0xd292('0x1f')],'include':_0x16c555[_0xd292('0x21')]?_[_0xd292('0x22')](_0x16c555['include'],function(_0x5ae095){return{'model':db[_0x5ae095[_0xd292('0x23')]],'as':_0x5ae095['as'],'attributes':_0x5ae095[_0xd292('0x1f')],'include':_0x5ae095['include']?_[_0xd292('0x22')](_0x5ae095[_0xd292('0x21')],function(_0x15beea){return{'model':db[_0x15beea[_0xd292('0x23')]],'as':_0x15beea['as'],'attributes':_0x15beea[_0xd292('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcc5754){logger[_0xd292('0x12')](_0xd292('0x1a'),_0xebacda);logger['debug']('GetFaxAccount',_0xebacda,JSON[_0xd292('0x24')](_0xcc5754));_0x2b03e1(_0xcc5754);})['catch'](function(_0x475d2e){logger[_0xd292('0x15')](_0xd292('0x1a'),_0x475d2e[_0xd292('0x17')],_0xebacda);_0x37e6a6(_0x31ecb0[_0xd292('0x15')](0x1f4,_0x475d2e['message']));});});};exports[_0xd292('0x25')]=function(_0x44f42d,_0x7d5174,_0x37179e){var _0x446f60=this;return new Promise(function(_0x2c76ab,_0x1058b0){var _0x12b526={'body':_0x44f42d[_0xd292('0x26')],'channel':_0xd292('0x27')};var _0x5bb076=[];var _0x4c4c43=[];var _0xbb37e6={};return db['CmContact']['describe']()[_0xd292('0x11')](function(_0x30c0fe){if(!_0x30c0fe){throw new db[(_0xd292('0x28'))][(_0xd292('0x29'))]('no\x20available\x20attributes');}_0x5bb076=_[_0xd292('0x2a')](_[_0xd292('0x2b')](_0x30c0fe),[_0xd292('0x2c'),_0xd292('0x2d')]);_0x4c4c43=_[_0xd292('0x2a')](_['keys'](_0x30c0fe),[_0xd292('0x2c'),_0xd292('0x2d'),_0xd292('0x2e'),_0xd292('0x2f')]);if(_0x44f42d[_0xd292('0x26')]['id']){delete _0x44f42d[_0xd292('0x26')]['id'];}if(_[_0xd292('0x30')](_0x44f42d[_0xd292('0x26')][_0xd292('0x31')])){throw new db[(_0xd292('0x28'))][(_0xd292('0x29'))](_0xd292('0x32'));}if(_[_0xd292('0x30')](_0x44f42d[_0xd292('0x26')][_0xd292('0x26')])||_0x44f42d[_0xd292('0x26')][_0xd292('0x26')]===''){throw new db[(_0xd292('0x28'))]['ValidationError'](_0xd292('0x33'));}if(_['isNil'](_0x44f42d[_0xd292('0x26')]['mapKey'])){throw new db[(_0xd292('0x28'))]['ValidationError'](_0xd292('0x34')+_0x4c4c43);}if(!_[_0xd292('0x35')](_0x4c4c43,_0x44f42d[_0xd292('0x26')][_0xd292('0x36')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c4c43);}_0xbb37e6[_0x44f42d['body'][_0xd292('0x36')]]=_0x44f42d['body'][_0xd292('0x31')];})[_0xd292('0x11')](function(){return db[_0xd292('0x1b')][_0xd292('0x37')]({'where':{'id':_0x44f42d[_0xd292('0x38')]['id']},'include':[{'model':db[_0xd292('0x39')],'as':'List','include':[{'model':db[_0xd292('0x3a')],'as':'Contacts','where':_0xbb37e6,'limit':0x1,'order':[[_0xd292('0x2d'),_0xd292('0x3b')]]}]},{'model':db[_0xd292('0x3c')],'as':_0xd292('0x3d')}]});})[_0xd292('0x11')](function(_0x14024a){if(_0x14024a&&_0x14024a[_0xd292('0x3e')]){var _0x40ed57=_0x14024a[_0xd292('0x3f')]({'plain':!![]});_0x12b526[_0xd292('0x38')]=_0x40ed57;_0x12b526[_0xd292('0x40')]=_0x40ed57[_0xd292('0x3d')];_0x12b526[_0xd292('0x41')]=_0x40ed57['List'];_0x12b526[_0xd292('0x40')]=_[_0xd292('0x42')](_0x12b526[_0xd292('0x40')],[_0xd292('0x43')],['asc']);if(_0x12b526[_0xd292('0x38')][_0xd292('0x3d')]){delete _0x12b526[_0xd292('0x38')][_0xd292('0x3d')];}if(_0x12b526[_0xd292('0x38')][_0xd292('0x3e')]&&_0x12b526['account'][_0xd292('0x3e')][_0xd292('0x44')][_0xd292('0x45')]){return _0x12b526[_0xd292('0x38')][_0xd292('0x3e')]['Contacts'][0x0];}var _0x19faf3=_[_0xd292('0xc')](_0x44f42d[_0xd292('0x26')],{'firstName':_0x44f42d['body'][_0xd292('0x31')],'ListId':_0x40ed57['ListId']});_0x19faf3[_0x44f42d[_0xd292('0x26')][_0xd292('0x36')]]=_0x44f42d['body'][_0xd292('0x31')];return db[_0xd292('0x3a')][_0xd292('0x46')](_0x19faf3,{'fields':_0x5bb076,'raw':!![]});}})[_0xd292('0x11')](function(_0x469a26){_0x12b526['contact']=_0x469a26;if(_0x469a26){var _0x1f4c41={'ContactId':_0x469a26['id'],'FaxAccountId':_0x44f42d[_0xd292('0x38')]['id'],'fax':_0x469a26[_0xd292('0x27')]};return db['FaxInteraction'][_0xd292('0x37')]({'where':{'ContactId':_0x469a26['id'],'closed':![],'FaxAccountId':_0x44f42d['account']['id']}})[_0xd292('0x11')](function(_0x18f53a){if(_0x18f53a){return[_0x18f53a,![]];}return db[_0xd292('0x47')][_0xd292('0x46')](_0x1f4c41)['then'](function(_0x5310c5){return[_0x5310c5,!![]];});});}else{throw new Error(_0xd292('0x48'));}})[_0xd292('0x49')](function(_0xa9dc6d,_0x92c80e){var _0x209e27=_0xa9dc6d[_0xd292('0x3f')]({'plain':!![]});if(_0x92c80e){if(_0x12b526[_0xd292('0x38')][_0xd292('0x4a')]){_0x12b526[_0xd292('0x40')][_0xd292('0x4b')]({'id':0x0,'priority':_0x12b526[_0xd292('0x40')][_0xd292('0x45')]+0x1,'app':'close','appdata':_0xd292('0x4c'),'interval':_0xd292('0x4d')});}_0x209e27[_0xd292('0x4e')]=!![];}else{_0x209e27[_0xd292('0x4e')]=![];}_0x12b526[_0xd292('0x4f')]=_0x209e27;return db[_0xd292('0x50')]['create']({'body':_0x44f42d[_0xd292('0x26')][_0xd292('0x26')],'FaxAccountId':_0x44f42d[_0xd292('0x38')]['id'],'FaxInteractionId':_0xa9dc6d['id'],'direction':'in','ContactId':_0xa9dc6d[_0xd292('0x51')],'AttachmentId':_0x44f42d[_0xd292('0x26')][_0xd292('0x52')]});})[_0xd292('0x11')](function(_0x2c559e){_0x12b526[_0xd292('0x17')]=_0x2c559e;if(_0x12b526[_0xd292('0x4f')][_0xd292('0x53')]){return db[_0xd292('0x54')][_0xd292('0x37')]({'attributes':['id',_0xd292('0x55')],'where':{'id':_0x12b526[_0xd292('0x4f')][_0xd292('0x53')]}})[_0xd292('0x11')](function(_0x7a08e3){if(_0x7a08e3){_0x12b526[_0xd292('0x40')][_0xd292('0x56')]({'id':0x0,'priority':0x0,'app':_0xd292('0x57'),'appdata':_0x7a08e3[_0xd292('0x55')]+','+(_0x12b526[_0xd292('0x38')][_0xd292('0x58')]||0xa),'interval':_0xd292('0x4d')});}return respondWithRpcPromise(_0xd292('0x59'),_0xd292('0x5a'),_0x12b526);});}return respondWithRpcPromise(_0xd292('0x59'),_0xd292('0x5a'),_0x12b526);})[_0xd292('0x11')](function(_0x27db26){_0x2c76ab(_0x27db26);})[_0xd292('0x19')](function(_0x316d2f){_0x1058b0(_0x446f60[_0xd292('0x15')](0x1f4,_0x316d2f[_0xd292('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6bbc427..dbfaca2 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 _0x01cb=['length','faxAccount:','./faxAccount.events','save','remove','update','emit','register'];(function(_0x394839,_0x39a06f){var _0x3169df=function(_0x1a4145){while(--_0x1a4145){_0x394839['push'](_0x394839['shift']());}};_0x3169df(++_0x39a06f);}(_0x01cb,0x1e2));var _0xb01c=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x01cb[_0x548627];return _0x844a84;};'use strict';var FaxAccountEvents=require(_0xb01c('0x0'));var events=[_0xb01c('0x1'),_0xb01c('0x2'),_0xb01c('0x3')];function createListener(_0x3601d7,_0x41cc77){return function(_0x18e1a9){_0x41cc77[_0xb01c('0x4')](_0x3601d7,_0x18e1a9);};}function removeListener(_0x1ee20e,_0x185341){return function(){FaxAccountEvents['removeListener'](_0x1ee20e,_0x185341);};}exports[_0xb01c('0x5')]=function(_0x2ac0cd){for(var _0x58e415=0x0,_0x597708=events[_0xb01c('0x6')];_0x58e415<_0x597708;_0x58e415++){var _0xf41e90=events[_0x58e415];var _0x14ca4c=createListener(_0xb01c('0x7')+_0xf41e90,_0x2ac0cd);FaxAccountEvents['on'](_0xf41e90,_0x14ca4c);}}; \ No newline at end of file +var _0x6673=['update','emit','register','length','faxAccount:','./faxAccount.events','remove'];(function(_0x1b07a5,_0x12f59d){var _0x39ef2f=function(_0x82d936){while(--_0x82d936){_0x1b07a5['push'](_0x1b07a5['shift']());}};_0x39ef2f(++_0x12f59d);}(_0x6673,0xde));var _0x3667=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x6673[_0x1ac595];return _0x455fff;};'use strict';var FaxAccountEvents=require(_0x3667('0x0'));var events=['save',_0x3667('0x1'),_0x3667('0x2')];function createListener(_0x40aeb0,_0x4e7417){return function(_0x4085f0){_0x4e7417[_0x3667('0x3')](_0x40aeb0,_0x4085f0);};}function removeListener(_0x638cbb,_0x588962){return function(){FaxAccountEvents['removeListener'](_0x638cbb,_0x588962);};}exports[_0x3667('0x4')]=function(_0x2fa77a){for(var _0x4fae8e=0x0,_0xf5c941=events[_0x3667('0x5')];_0x4fae8e<_0xf5c941;_0x4fae8e++){var _0x15483f=events[_0x4fae8e];var _0x54f904=createListener(_0x3667('0x6')+_0x15483f,_0x2fa77a);FaxAccountEvents['on'](_0x15483f,_0x54f904);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 321ecca..b969b86 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(_0x3d9362,_0x1c9b8c){var _0x5a5c98=function(_0x1c6f6e){while(--_0x1c6f6e){_0x3d9362['push'](_0x3d9362['shift']());}};_0x5a5c98(++_0x1c9b8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x49f9fd,_0x3fe108){var _0xc4b947=function(_0x433523){while(--_0x433523){_0x49f9fd['push'](_0x49f9fd['shift']());}};_0xc4b947(++_0x3fe108);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 7a745af..c8d8828 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 _0x5191=['TEXT','*,*,*,*','exports','STRING'];(function(_0x101a02,_0x46cdd4){var _0x4b0780=function(_0x5cbfda){while(--_0x5cbfda){_0x101a02['push'](_0x101a02['shift']());}};_0x4b0780(++_0x46cdd4);}(_0x5191,0x1a6));var _0x1519=function(_0x25be23,_0x43fba0){_0x25be23=_0x25be23-0x0;var _0x202a38=_0x5191[_0x25be23];return _0x202a38;};'use strict';var Sequelize=require('sequelize');module[_0x1519('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1519('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1519('0x2')]()},'description':{'type':Sequelize[_0x1519('0x1')]},'interval':{'type':Sequelize[_0x1519('0x1')],'defaultValue':_0x1519('0x3')}}; \ No newline at end of file +var _0xd9f1=['STRING','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x14b8ee,_0x26d31a){var _0x50ef2b=function(_0x27d7bc){while(--_0x27d7bc){_0x14b8ee['push'](_0x14b8ee['shift']());}};_0x50ef2b(++_0x26d31a);}(_0xd9f1,0xb7));var _0x1d9f=function(_0x569ff8,_0x5a0bcc){_0x569ff8=_0x569ff8-0x0;var _0x504b5d=_0xd9f1[_0x569ff8];return _0x504b5d;};'use strict';var Sequelize=require('sequelize');module[_0x1d9f('0x0')]={'priority':{'type':Sequelize[_0x1d9f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1d9f('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1d9f('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1d9f('0x2')],'defaultValue':_0x1d9f('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e0161ac..740409d 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 _0xba07=['filter','merge','VIRTUAL','include','findAll','catch','show','params','keys','includeAll','options','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5e9e97,_0xb8bda6){var _0x30d2aa=function(_0x1719bb){while(--_0x1719bb){_0x5e9e97['push'](_0x5e9e97['shift']());}};_0x30d2aa(++_0xb8bda6);}(_0xba07,0xed));var _0x7ba0=function(_0x4368e3,_0x1d00b6){_0x4368e3=_0x4368e3-0x0;var _0x506a47=_0xba07[_0x4368e3];return _0x506a47;};'use strict';var emlformat=require(_0x7ba0('0x0'));var rimraf=require(_0x7ba0('0x1'));var zipdir=require(_0x7ba0('0x2'));var jsonpatch=require(_0x7ba0('0x3'));var rp=require(_0x7ba0('0x4'));var moment=require('moment');var BPromise=require(_0x7ba0('0x5'));var Mustache=require('mustache');var util=require(_0x7ba0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7ba0('0x7'));var ejs=require(_0x7ba0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ba0('0x9'));var squel=require(_0x7ba0('0xa'));var crypto=require('crypto');var jsforce=require(_0x7ba0('0xb'));var deskjs=require(_0x7ba0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7ba0('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ba0('0xe'));var qs=require(_0x7ba0('0xf'));var as=require(_0x7ba0('0x10'));var hardwareService=require(_0x7ba0('0x11'));var logger=require(_0x7ba0('0x12'))(_0x7ba0('0x13'));var utils=require(_0x7ba0('0x14'));var config=require(_0x7ba0('0x15'));var licenseUtil=require(_0x7ba0('0x16'));var db=require(_0x7ba0('0x17'))['db'];function respondWithStatusCode(_0xc497a5,_0x465281){_0x465281=_0x465281||0xcc;return function(_0x503cac){if(_0x503cac){return _0xc497a5[_0x7ba0('0x18')](_0x465281);}return _0xc497a5[_0x7ba0('0x19')](_0x465281)['end']();};}function respondWithResult(_0x37cbaf,_0x42ada8){_0x42ada8=_0x42ada8||0xc8;return function(_0x2c41b6){if(_0x2c41b6){return _0x37cbaf[_0x7ba0('0x19')](_0x42ada8)[_0x7ba0('0x1a')](_0x2c41b6);}};}function respondWithFilteredResult(_0x58b39a,_0x457603){return function(_0x3e8e62){if(_0x3e8e62){var _0x5e68f8=typeof _0x457603[_0x7ba0('0x1b')]===_0x7ba0('0x1c')&&typeof _0x457603[_0x7ba0('0x1d')]===_0x7ba0('0x1c');var _0x495af5=_0x3e8e62['count'];var _0x2ca922=_0x5e68f8?0x0:_0x457603[_0x7ba0('0x1b')];var _0x33eb67=_0x5e68f8?_0x3e8e62[_0x7ba0('0x1e')]:_0x457603[_0x7ba0('0x1b')]+_0x457603[_0x7ba0('0x1d')];var _0x436102;if(_0x33eb67>=_0x495af5){_0x33eb67=_0x495af5;_0x436102=0xc8;}else{_0x436102=0xce;}_0x58b39a['status'](_0x436102);return _0x58b39a[_0x7ba0('0x1f')]('Content-Range',_0x2ca922+'-'+_0x33eb67+'/'+_0x495af5)['json'](_0x3e8e62);}return null;};}function patchUpdates(_0xb95aea){return function(_0x289d71){try{jsonpatch['apply'](_0x289d71,_0xb95aea,!![]);}catch(_0x26c97f){return BPromise[_0x7ba0('0x20')](_0x26c97f);}return _0x289d71[_0x7ba0('0x21')]();};}function saveUpdates(_0x2185cb,_0x22e570){return function(_0x41d552){if(_0x41d552){return _0x41d552['update'](_0x2185cb)[_0x7ba0('0x22')](function(_0x2d931f){return _0x2d931f;});}return null;};}function removeEntity(_0x13590a,_0x43f6f5){return function(_0x2c3c48){if(_0x2c3c48){return _0x2c3c48[_0x7ba0('0x23')]()[_0x7ba0('0x22')](function(){_0x13590a[_0x7ba0('0x19')](0xcc)[_0x7ba0('0x24')]();});}};}function handleEntityNotFound(_0x103f60,_0x442207){return function(_0x479729){if(!_0x479729){_0x103f60['sendStatus'](0x194);}return _0x479729;};}function handleError(_0x3b5115,_0x51d29b){_0x51d29b=_0x51d29b||0x1f4;return function(_0x446eeb){logger[_0x7ba0('0x25')](_0x446eeb[_0x7ba0('0x26')]);if(_0x446eeb['name']){delete _0x446eeb[_0x7ba0('0x27')];}_0x3b5115['status'](_0x51d29b)[_0x7ba0('0x28')](_0x446eeb);};}exports[_0x7ba0('0x29')]=function(_0x2af4cf,_0xfd577f){var _0x793690={},_0x4fbb90={},_0x44e2b4={'count':0x0,'rows':[]};var _0x315f40=_[_0x7ba0('0x2a')](db[_0x7ba0('0x2b')][_0x7ba0('0x2c')],function(_0x3f5b5a){return{'name':_0x3f5b5a['fieldName'],'type':_0x3f5b5a[_0x7ba0('0x2d')][_0x7ba0('0x2e')]};});_0x4fbb90['model']=_[_0x7ba0('0x2a')](_0x315f40,_0x7ba0('0x27'));_0x4fbb90[_0x7ba0('0x2f')]=_['keys'](_0x2af4cf[_0x7ba0('0x2f')]);_0x4fbb90[_0x7ba0('0x30')]=_[_0x7ba0('0x31')](_0x4fbb90[_0x7ba0('0x32')],_0x4fbb90['query']);_0x793690['attributes']=_[_0x7ba0('0x31')](_0x4fbb90[_0x7ba0('0x32')],qs[_0x7ba0('0x33')](_0x2af4cf[_0x7ba0('0x2f')][_0x7ba0('0x33')]));_0x793690[_0x7ba0('0x34')]=_0x793690['attributes'][_0x7ba0('0x35')]?_0x793690[_0x7ba0('0x34')]:_0x4fbb90[_0x7ba0('0x32')];if(!_0x2af4cf[_0x7ba0('0x2f')][_0x7ba0('0x36')](_0x7ba0('0x37'))){_0x793690[_0x7ba0('0x1d')]=qs[_0x7ba0('0x1d')](_0x2af4cf[_0x7ba0('0x2f')][_0x7ba0('0x1d')]);_0x793690[_0x7ba0('0x1b')]=qs[_0x7ba0('0x1b')](_0x2af4cf[_0x7ba0('0x2f')][_0x7ba0('0x1b')]);}_0x793690['order']=qs[_0x7ba0('0x38')](_0x2af4cf['query'][_0x7ba0('0x38')]);_0x793690[_0x7ba0('0x39')]=qs['filters'](_[_0x7ba0('0x3a')](_0x2af4cf['query'],_0x4fbb90[_0x7ba0('0x30')]),_0x315f40);if(_0x2af4cf['query'][_0x7ba0('0x3b')]){_0x793690[_0x7ba0('0x39')]=_[_0x7ba0('0x3c')](_0x793690['where'],{'$or':_['map'](_0x315f40,function(_0x179e40){if(_0x179e40[_0x7ba0('0x2d')]!==_0x7ba0('0x3d')){var _0x86e4af={};_0x86e4af[_0x179e40[_0x7ba0('0x27')]]={'$like':'%'+_0x2af4cf['query'][_0x7ba0('0x3b')]+'%'};return _0x86e4af;}})});}_0x793690=_[_0x7ba0('0x3c')]({},_0x793690,_0x2af4cf['options']);var _0x963c5d={'where':_0x793690[_0x7ba0('0x39')]};return db[_0x7ba0('0x2b')][_0x7ba0('0x1e')](_0x963c5d)[_0x7ba0('0x22')](function(_0x38b23b){_0x44e2b4[_0x7ba0('0x1e')]=_0x38b23b;if(_0x2af4cf['query']['includeAll']){_0x793690[_0x7ba0('0x3e')]=[{'all':!![]}];}return db[_0x7ba0('0x2b')][_0x7ba0('0x3f')](_0x793690);})[_0x7ba0('0x22')](function(_0x4dc19d){_0x44e2b4['rows']=_0x4dc19d;return _0x44e2b4;})[_0x7ba0('0x22')](respondWithFilteredResult(_0xfd577f,_0x793690))[_0x7ba0('0x40')](handleError(_0xfd577f,null));};exports[_0x7ba0('0x41')]=function(_0x2960bc,_0x28ecaa){var _0x45d4d9={'raw':!![],'where':{'id':_0x2960bc[_0x7ba0('0x42')]['id']}},_0x553e4d={};_0x553e4d['model']=_[_0x7ba0('0x43')](db[_0x7ba0('0x2b')]['rawAttributes']);_0x553e4d[_0x7ba0('0x2f')]=_[_0x7ba0('0x43')](_0x2960bc[_0x7ba0('0x2f')]);_0x553e4d[_0x7ba0('0x30')]=_[_0x7ba0('0x31')](_0x553e4d['model'],_0x553e4d[_0x7ba0('0x2f')]);_0x45d4d9[_0x7ba0('0x34')]=_[_0x7ba0('0x31')](_0x553e4d[_0x7ba0('0x32')],qs[_0x7ba0('0x33')](_0x2960bc['query'][_0x7ba0('0x33')]));_0x45d4d9[_0x7ba0('0x34')]=_0x45d4d9[_0x7ba0('0x34')]['length']?_0x45d4d9[_0x7ba0('0x34')]:_0x553e4d[_0x7ba0('0x32')];if(_0x2960bc[_0x7ba0('0x2f')][_0x7ba0('0x44')]){_0x45d4d9[_0x7ba0('0x3e')]=[{'all':!![]}];}_0x45d4d9=_[_0x7ba0('0x3c')]({},_0x45d4d9,_0x2960bc[_0x7ba0('0x45')]);return db[_0x7ba0('0x2b')][_0x7ba0('0x46')](_0x45d4d9)[_0x7ba0('0x22')](handleEntityNotFound(_0x28ecaa,null))[_0x7ba0('0x22')](respondWithResult(_0x28ecaa,null))[_0x7ba0('0x40')](handleError(_0x28ecaa,null));};exports[_0x7ba0('0x47')]=function(_0x5b3aaf,_0x2167fa){return db[_0x7ba0('0x2b')][_0x7ba0('0x47')](_0x5b3aaf['body'],{})[_0x7ba0('0x22')](respondWithResult(_0x2167fa,0xc9))[_0x7ba0('0x40')](handleError(_0x2167fa,null));};exports[_0x7ba0('0x48')]=function(_0xe162d9,_0x234a04){if(_0xe162d9[_0x7ba0('0x49')]['id']){delete _0xe162d9[_0x7ba0('0x49')]['id'];}return db['FaxApplication'][_0x7ba0('0x46')]({'where':{'id':_0xe162d9[_0x7ba0('0x42')]['id']}})[_0x7ba0('0x22')](handleEntityNotFound(_0x234a04,null))[_0x7ba0('0x22')](saveUpdates(_0xe162d9[_0x7ba0('0x49')],null))[_0x7ba0('0x22')](respondWithResult(_0x234a04,null))[_0x7ba0('0x40')](handleError(_0x234a04,null));};exports[_0x7ba0('0x23')]=function(_0x18eacc,_0xcbd119){return db['FaxApplication'][_0x7ba0('0x46')]({'where':{'id':_0x18eacc['params']['id']}})[_0x7ba0('0x22')](handleEntityNotFound(_0xcbd119,null))['then'](removeEntity(_0xcbd119,null))[_0x7ba0('0x40')](handleError(_0xcbd119,null));}; \ No newline at end of file +var _0x7799=['limit','count','set','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x263714,_0x399b37){var _0x1cd43d=function(_0x2f2d3a){while(--_0x2f2d3a){_0x263714['push'](_0x263714['shift']());}};_0x1cd43d(++_0x399b37);}(_0x7799,0x1dd));var _0x9779=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7799[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0x9779('0x0'));var rimraf=require(_0x9779('0x1'));var zipdir=require(_0x9779('0x2'));var jsonpatch=require(_0x9779('0x3'));var rp=require(_0x9779('0x4'));var moment=require('moment');var BPromise=require(_0x9779('0x5'));var Mustache=require(_0x9779('0x6'));var util=require(_0x9779('0x7'));var path=require('path');var sox=require(_0x9779('0x8'));var csv=require(_0x9779('0x9'));var ejs=require(_0x9779('0xa'));var fs=require('fs');var fs_extra=require(_0x9779('0xb'));var _=require('lodash');var squel=require(_0x9779('0xc'));var crypto=require('crypto');var jsforce=require(_0x9779('0xd'));var deskjs=require(_0x9779('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9779('0xf'));var Papa=require(_0x9779('0x10'));var Redis=require(_0x9779('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9779('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9779('0x13'))(_0x9779('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9779('0x15'));var db=require(_0x9779('0x16'))['db'];function respondWithStatusCode(_0x7662d0,_0x44ff2d){_0x44ff2d=_0x44ff2d||0xcc;return function(_0x33a705){if(_0x33a705){return _0x7662d0['sendStatus'](_0x44ff2d);}return _0x7662d0[_0x9779('0x17')](_0x44ff2d)['end']();};}function respondWithResult(_0x237f22,_0xc481b8){_0xc481b8=_0xc481b8||0xc8;return function(_0x2bfdbf){if(_0x2bfdbf){return _0x237f22[_0x9779('0x17')](_0xc481b8)[_0x9779('0x18')](_0x2bfdbf);}};}function respondWithFilteredResult(_0x3f9411,_0x5f4ba6){return function(_0x3b4636){if(_0x3b4636){var _0x2a905d=typeof _0x5f4ba6[_0x9779('0x19')]===_0x9779('0x1a')&&typeof _0x5f4ba6[_0x9779('0x1b')]===_0x9779('0x1a');var _0x222bed=_0x3b4636['count'];var _0x439027=_0x2a905d?0x0:_0x5f4ba6[_0x9779('0x19')];var _0x2b34a3=_0x2a905d?_0x3b4636[_0x9779('0x1c')]:_0x5f4ba6['offset']+_0x5f4ba6['limit'];var _0x390438;if(_0x2b34a3>=_0x222bed){_0x2b34a3=_0x222bed;_0x390438=0xc8;}else{_0x390438=0xce;}_0x3f9411[_0x9779('0x17')](_0x390438);return _0x3f9411[_0x9779('0x1d')]('Content-Range',_0x439027+'-'+_0x2b34a3+'/'+_0x222bed)[_0x9779('0x18')](_0x3b4636);}return null;};}function patchUpdates(_0x41e292){return function(_0x5a14a6){try{jsonpatch[_0x9779('0x1e')](_0x5a14a6,_0x41e292,!![]);}catch(_0x266188){return BPromise[_0x9779('0x1f')](_0x266188);}return _0x5a14a6['save']();};}function saveUpdates(_0x51dc39,_0x5da728){return function(_0x160d8c){if(_0x160d8c){return _0x160d8c[_0x9779('0x20')](_0x51dc39)[_0x9779('0x21')](function(_0x53bf31){return _0x53bf31;});}return null;};}function removeEntity(_0x5c1047,_0x2df96e){return function(_0x32a270){if(_0x32a270){return _0x32a270[_0x9779('0x22')]()[_0x9779('0x21')](function(){_0x5c1047[_0x9779('0x17')](0xcc)[_0x9779('0x23')]();});}};}function handleEntityNotFound(_0x2be9eb,_0x5580d8){return function(_0x1885f6){if(!_0x1885f6){_0x2be9eb[_0x9779('0x24')](0x194);}return _0x1885f6;};}function handleError(_0x3ca0e0,_0x475dd7){_0x475dd7=_0x475dd7||0x1f4;return function(_0x16bd9f){logger[_0x9779('0x25')](_0x16bd9f['stack']);if(_0x16bd9f['name']){delete _0x16bd9f[_0x9779('0x26')];}_0x3ca0e0[_0x9779('0x17')](_0x475dd7)[_0x9779('0x27')](_0x16bd9f);};}exports[_0x9779('0x28')]=function(_0x2594f5,_0x1566ab){var _0x324e26={},_0xdf383b={},_0x17da34={'count':0x0,'rows':[]};var _0x20e27d=_[_0x9779('0x29')](db[_0x9779('0x2a')][_0x9779('0x2b')],function(_0x2674bd){return{'name':_0x2674bd[_0x9779('0x2c')],'type':_0x2674bd[_0x9779('0x2d')][_0x9779('0x2e')]};});_0xdf383b['model']=_[_0x9779('0x29')](_0x20e27d,'name');_0xdf383b['query']=_[_0x9779('0x2f')](_0x2594f5[_0x9779('0x30')]);_0xdf383b[_0x9779('0x31')]=_[_0x9779('0x32')](_0xdf383b[_0x9779('0x33')],_0xdf383b[_0x9779('0x30')]);_0x324e26[_0x9779('0x34')]=_[_0x9779('0x32')](_0xdf383b[_0x9779('0x33')],qs[_0x9779('0x35')](_0x2594f5['query'][_0x9779('0x35')]));_0x324e26['attributes']=_0x324e26['attributes'][_0x9779('0x36')]?_0x324e26[_0x9779('0x34')]:_0xdf383b[_0x9779('0x33')];if(!_0x2594f5[_0x9779('0x30')][_0x9779('0x37')]('nolimit')){_0x324e26['limit']=qs[_0x9779('0x1b')](_0x2594f5[_0x9779('0x30')][_0x9779('0x1b')]);_0x324e26['offset']=qs[_0x9779('0x19')](_0x2594f5[_0x9779('0x30')][_0x9779('0x19')]);}_0x324e26[_0x9779('0x38')]=qs[_0x9779('0x39')](_0x2594f5[_0x9779('0x30')][_0x9779('0x39')]);_0x324e26['where']=qs['filters'](_['pick'](_0x2594f5['query'],_0xdf383b['filters']),_0x20e27d);if(_0x2594f5[_0x9779('0x30')][_0x9779('0x3a')]){_0x324e26[_0x9779('0x3b')]=_[_0x9779('0x3c')](_0x324e26['where'],{'$or':_[_0x9779('0x29')](_0x20e27d,function(_0x32b026){if(_0x32b026['type']!=='VIRTUAL'){var _0x4b5934={};_0x4b5934[_0x32b026[_0x9779('0x26')]]={'$like':'%'+_0x2594f5[_0x9779('0x30')][_0x9779('0x3a')]+'%'};return _0x4b5934;}})});}_0x324e26=_[_0x9779('0x3c')]({},_0x324e26,_0x2594f5[_0x9779('0x3d')]);var _0x165e87={'where':_0x324e26[_0x9779('0x3b')]};return db['FaxApplication'][_0x9779('0x1c')](_0x165e87)[_0x9779('0x21')](function(_0x3c15e4){_0x17da34['count']=_0x3c15e4;if(_0x2594f5[_0x9779('0x30')]['includeAll']){_0x324e26[_0x9779('0x3e')]=[{'all':!![]}];}return db[_0x9779('0x2a')][_0x9779('0x3f')](_0x324e26);})[_0x9779('0x21')](function(_0x18d7f7){_0x17da34[_0x9779('0x40')]=_0x18d7f7;return _0x17da34;})[_0x9779('0x21')](respondWithFilteredResult(_0x1566ab,_0x324e26))[_0x9779('0x41')](handleError(_0x1566ab,null));};exports[_0x9779('0x42')]=function(_0x4bc32b,_0x4b5c9e){var _0x16f53f={'raw':!![],'where':{'id':_0x4bc32b[_0x9779('0x43')]['id']}},_0x2f8820={};_0x2f8820[_0x9779('0x33')]=_['keys'](db[_0x9779('0x2a')][_0x9779('0x2b')]);_0x2f8820[_0x9779('0x30')]=_[_0x9779('0x2f')](_0x4bc32b[_0x9779('0x30')]);_0x2f8820[_0x9779('0x31')]=_[_0x9779('0x32')](_0x2f8820[_0x9779('0x33')],_0x2f8820[_0x9779('0x30')]);_0x16f53f[_0x9779('0x34')]=_[_0x9779('0x32')](_0x2f8820[_0x9779('0x33')],qs[_0x9779('0x35')](_0x4bc32b['query'][_0x9779('0x35')]));_0x16f53f[_0x9779('0x34')]=_0x16f53f['attributes'][_0x9779('0x36')]?_0x16f53f[_0x9779('0x34')]:_0x2f8820[_0x9779('0x33')];if(_0x4bc32b[_0x9779('0x30')][_0x9779('0x44')]){_0x16f53f[_0x9779('0x3e')]=[{'all':!![]}];}_0x16f53f=_[_0x9779('0x3c')]({},_0x16f53f,_0x4bc32b[_0x9779('0x3d')]);return db[_0x9779('0x2a')][_0x9779('0x45')](_0x16f53f)[_0x9779('0x21')](handleEntityNotFound(_0x4b5c9e,null))[_0x9779('0x21')](respondWithResult(_0x4b5c9e,null))['catch'](handleError(_0x4b5c9e,null));};exports[_0x9779('0x46')]=function(_0x4eef96,_0x40c23b){return db['FaxApplication'][_0x9779('0x46')](_0x4eef96[_0x9779('0x47')],{})[_0x9779('0x21')](respondWithResult(_0x40c23b,0xc9))[_0x9779('0x41')](handleError(_0x40c23b,null));};exports['update']=function(_0x27147f,_0x3a1f10){if(_0x27147f[_0x9779('0x47')]['id']){delete _0x27147f['body']['id'];}return db[_0x9779('0x2a')][_0x9779('0x45')]({'where':{'id':_0x27147f[_0x9779('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a1f10,null))['then'](saveUpdates(_0x27147f[_0x9779('0x47')],null))[_0x9779('0x21')](respondWithResult(_0x3a1f10,null))[_0x9779('0x41')](handleError(_0x3a1f10,null));};exports[_0x9779('0x22')]=function(_0x325f21,_0x2a4530){return db['FaxApplication'][_0x9779('0x45')]({'where':{'id':_0x325f21[_0x9779('0x43')]['id']}})[_0x9779('0x21')](handleEntityNotFound(_0x2a4530,null))[_0x9779('0x21')](removeEntity(_0x2a4530,null))[_0x9779('0x41')](handleError(_0x2a4530,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9682f5d..4ba84d3 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 _0xabc7=['bluebird','request-promise','rimraf','./faxApplication.attributes','exports','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xabc7,0x1e1));var _0x7abc=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xabc7[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x7abc('0x0'));var util=require(_0x7abc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7abc('0x2'));var BPromise=require(_0x7abc('0x3'));var rp=require(_0x7abc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7abc('0x5'));var config=require('../../config/environment');var attributes=require(_0x7abc('0x6'));module[_0x7abc('0x7')]=function(_0x3baafb,_0x34a8a3){return _0x3baafb['define']('FaxApplication',attributes,{'tableName':_0x7abc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7abc('0x9'),'collate':_0x7abc('0xa')});}; \ No newline at end of file +var _0x2b44=['fax_applications','utf8mb4','lodash','util','moment','request-promise','path','rimraf','../../config/environment','FaxApplication'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x2b44,0x19c));var _0x42b4=function(_0x4aad01,_0x4e8eab){_0x4aad01=_0x4aad01-0x0;var _0x1e8126=_0x2b44[_0x4aad01];return _0x1e8126;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x42b4('0x2'));var BPromise=require('bluebird');var rp=require(_0x42b4('0x3'));var fs=require('fs');var path=require(_0x42b4('0x4'));var rimraf=require(_0x42b4('0x5'));var config=require(_0x42b4('0x6'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x30004d,_0x370b0e){return _0x30004d['define'](_0x42b4('0x7'),attributes,{'tableName':_0x42b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x42b4('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e29e7f2..0029bb0 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 _0x674a=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','then'];(function(_0x3ce986,_0x5d1d3b){var _0x2b4956=function(_0x19c65b){while(--_0x19c65b){_0x3ce986['push'](_0x3ce986['shift']());}};_0x2b4956(++_0x5d1d3b);}(_0x674a,0x1a0));var _0xa674=function(_0xc34268,_0x2a08ef){_0xc34268=_0xc34268-0x0;var _0x90063f=_0x674a[_0xc34268];return _0x90063f;};'use strict';var _=require(_0xa674('0x0'));var util=require('util');var moment=require(_0xa674('0x1'));var BPromise=require(_0xa674('0x2'));var rs=require(_0xa674('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa674('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa674('0x5'))(_0xa674('0x6'));var config=require('../../config/environment');var jayson=require(_0xa674('0x7'));var client=jayson[_0xa674('0x8')][_0xa674('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20477c,_0x5c1493,_0x5b8b64){return new BPromise(function(_0xd6736a,_0x98bcdb){return client[_0xa674('0xa')](_0x20477c,_0x5b8b64)['then'](function(_0x2fecaa){logger[_0xa674('0xb')](_0xa674('0xc'),_0x5c1493,_0xa674('0xd'));logger[_0xa674('0xe')](_0xa674('0xf'),_0x5c1493,_0xa674('0xd'),JSON[_0xa674('0x10')](_0x2fecaa));if(_0x2fecaa['error']){if(_0x2fecaa['error'][_0xa674('0x11')]===0x1f4){logger[_0xa674('0x12')](_0xa674('0xc'),_0x5c1493,_0x2fecaa[_0xa674('0x12')][_0xa674('0x13')]);return _0x98bcdb(_0x2fecaa['error']['message']);}logger['error'](_0xa674('0xc'),_0x5c1493,_0x2fecaa['error'][_0xa674('0x13')]);return _0xd6736a(_0x2fecaa['error'][_0xa674('0x13')]);}else{logger[_0xa674('0xb')](_0xa674('0xc'),_0x5c1493,_0xa674('0xd'));_0xd6736a(_0x2fecaa[_0xa674('0x14')][_0xa674('0x13')]);}})[_0xa674('0x15')](function(_0x221784){logger[_0xa674('0x12')]('FaxApplication,\x20%s,\x20%s',_0x5c1493,_0x221784);_0x98bcdb(_0x221784);});});}exports[_0xa674('0x16')]=function(_0x176c27){var _0x3a91a8=this;return new Promise(function(_0x28306d,_0x4619eb){return db[_0xa674('0x17')][_0xa674('0x18')](_0x176c27[_0xa674('0x19')],{'raw':_0x176c27[_0xa674('0x1a')]?_0x176c27[_0xa674('0x1a')][_0xa674('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176c27[_0xa674('0x1a')]?_0x176c27['options'][_0xa674('0x1c')]||null:null,'attributes':_0x176c27['options']?_0x176c27[_0xa674('0x1a')][_0xa674('0x1d')]||null:null,'limit':_0x176c27['options']?_0x176c27[_0xa674('0x1a')][_0xa674('0x1e')]||null:null})[_0xa674('0x1f')](function(_0xe35303){logger[_0xa674('0xb')](_0xa674('0x16'),_0x176c27);logger['debug'](_0xa674('0x16'),_0x176c27,JSON[_0xa674('0x10')](_0xe35303));_0x28306d(_0xe35303);})[_0xa674('0x15')](function(_0x11c5b0){logger['error'](_0xa674('0x16'),_0x11c5b0[_0xa674('0x13')],_0x176c27);_0x4619eb(_0x3a91a8[_0xa674('0x12')](0x1f4,_0x11c5b0[_0xa674('0x13')]));});});}; \ No newline at end of file +var _0x1580=['body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateFaxApplication','FaxApplication','update'];(function(_0xbf8ef7,_0x572615){var _0x3314ae=function(_0xbdee95){while(--_0xbdee95){_0xbf8ef7['push'](_0xbf8ef7['shift']());}};_0x3314ae(++_0x572615);}(_0x1580,0x6f));var _0x0158=function(_0x50bfc4,_0x27edcf){_0x50bfc4=_0x50bfc4-0x0;var _0x11213a=_0x1580[_0x50bfc4];return _0x11213a;};'use strict';var _=require('lodash');var util=require(_0x0158('0x0'));var moment=require(_0x0158('0x1'));var BPromise=require(_0x0158('0x2'));var rs=require(_0x0158('0x3'));var fs=require('fs');var Redis=require(_0x0158('0x4'));var db=require(_0x0158('0x5'))['db'];var utils=require(_0x0158('0x6'));var logger=require('../../config/logger')(_0x0158('0x7'));var config=require(_0x0158('0x8'));var jayson=require(_0x0158('0x9'));var client=jayson[_0x0158('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fac4,_0x475c40,_0x5c3dbb){return new BPromise(function(_0x52b375,_0x503dd3){return client[_0x0158('0xb')](_0x57fac4,_0x5c3dbb)[_0x0158('0xc')](function(_0x48fcee){logger[_0x0158('0xd')](_0x0158('0xe'),_0x475c40,_0x0158('0xf'));logger[_0x0158('0x10')](_0x0158('0x11'),_0x475c40,_0x0158('0xf'),JSON[_0x0158('0x12')](_0x48fcee));if(_0x48fcee[_0x0158('0x13')]){if(_0x48fcee[_0x0158('0x13')]['code']===0x1f4){logger[_0x0158('0x13')](_0x0158('0xe'),_0x475c40,_0x48fcee['error'][_0x0158('0x14')]);return _0x503dd3(_0x48fcee[_0x0158('0x13')]['message']);}logger[_0x0158('0x13')](_0x0158('0xe'),_0x475c40,_0x48fcee[_0x0158('0x13')]['message']);return _0x52b375(_0x48fcee[_0x0158('0x13')][_0x0158('0x14')]);}else{logger['info'](_0x0158('0xe'),_0x475c40,'request\x20sent');_0x52b375(_0x48fcee['result'][_0x0158('0x14')]);}})['catch'](function(_0x54eb5d){logger['error'](_0x0158('0xe'),_0x475c40,_0x54eb5d);_0x503dd3(_0x54eb5d);});});}exports[_0x0158('0x15')]=function(_0x432b9d){var _0x176e8c=this;return new Promise(function(_0x369477,_0x9227ff){return db[_0x0158('0x16')][_0x0158('0x17')](_0x432b9d[_0x0158('0x18')],{'raw':_0x432b9d['options']?_0x432b9d[_0x0158('0x19')][_0x0158('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x432b9d['options']?_0x432b9d['options']['where']||null:null,'attributes':_0x432b9d[_0x0158('0x19')]?_0x432b9d[_0x0158('0x19')]['attributes']||null:null,'limit':_0x432b9d['options']?_0x432b9d['options']['limit']||null:null})[_0x0158('0xc')](function(_0x35be77){logger[_0x0158('0xd')]('UpdateFaxApplication',_0x432b9d);logger['debug'](_0x0158('0x15'),_0x432b9d,JSON[_0x0158('0x12')](_0x35be77));_0x369477(_0x35be77);})['catch'](function(_0x44d2ec){logger[_0x0158('0x13')]('UpdateFaxApplication',_0x44d2ec[_0x0158('0x14')],_0x432b9d);_0x9227ff(_0x176e8c[_0x0158('0x13')](0x1f4,_0x44d2ec['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 98caa66..b976f12 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 _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('0x11')]=router; \ No newline at end of file +var _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xf7b4,0x152));var _0x4f7b=function(_0x19853a,_0x5cb698){_0x19853a=_0x19853a-0x0;var _0x4524c2=_0xf7b4[_0x19853a];return _0x4524c2;};'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('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e6ebf2f..db62372 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 _0xbdf7=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0xbdf7,0x9c));var _0x7bdf=function(_0x5b1215,_0x5c9bb4){_0x5b1215=_0x5b1215-0x0;var _0x23fd74=_0xbdf7[_0x5b1215];return _0x23fd74;};'use strict';var Sequelize=require(_0x7bdf('0x0'));module[_0x7bdf('0x1')]={'closed':{'type':Sequelize[_0x7bdf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7bdf('0x3')]},'disposition':{'type':Sequelize[_0x7bdf('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7bdf('0x4')]},'note':{'type':Sequelize[_0x7bdf('0x4')]},'read1stAt':{'type':Sequelize[_0x7bdf('0x3')]},'fax':{'type':Sequelize[_0x7bdf('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7bdf('0x5')]('in',_0x7bdf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7bdf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7bdf('0x5')]('in',_0x7bdf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x9324=['STRING','ENUM','out','BOOLEAN','DATE'];(function(_0x414277,_0x589fc4){var _0x48fc95=function(_0x2a5fd7){while(--_0x2a5fd7){_0x414277['push'](_0x414277['shift']());}};_0x48fc95(++_0x589fc4);}(_0x9324,0x19d));var _0x4932=function(_0x3b35ba,_0x5758d6){_0x3b35ba=_0x3b35ba-0x0;var _0x4fe4ac=_0x9324[_0x3b35ba];return _0x4fe4ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x4932('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4932('0x1')]},'disposition':{'type':Sequelize[_0x4932('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4932('0x2')]},'note':{'type':Sequelize[_0x4932('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x4932('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4932('0x3')]('in',_0x4932('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4932('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4932('0x4')),'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 ac56f5b..1926084 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 _0x9b40=['c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','faxInteractionTags:save','download','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','select','field','from','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','isEmpty','forEach','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','SELECT','clone','i.id','order','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','FaxInteraction','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','contactName','Contact.firstName'];(function(_0x1a0e6a,_0x1b43de){var _0x4b3934=function(_0x81dc97){while(--_0x81dc97){_0x1a0e6a['push'](_0x1a0e6a['shift']());}};_0x4b3934(++_0x1b43de);}(_0x9b40,0x1e8));var _0x09b4=function(_0x4c6efa,_0x4fc171){_0x4c6efa=_0x4c6efa-0x0;var _0x14191a=_0x9b40[_0x4c6efa];return _0x14191a;};'use strict';var emlformat=require(_0x09b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09b4('0x1'));var jsonpatch=require(_0x09b4('0x2'));var rp=require(_0x09b4('0x3'));var moment=require(_0x09b4('0x4'));var BPromise=require(_0x09b4('0x5'));var Mustache=require(_0x09b4('0x6'));var util=require(_0x09b4('0x7'));var path=require('path');var sox=require(_0x09b4('0x8'));var csv=require(_0x09b4('0x9'));var ejs=require(_0x09b4('0xa'));var fs=require('fs');var fs_extra=require(_0x09b4('0xb'));var _=require(_0x09b4('0xc'));var squel=require(_0x09b4('0xd'));var crypto=require('crypto');var jsforce=require(_0x09b4('0xe'));var deskjs=require(_0x09b4('0xf'));var toCsv=require(_0x09b4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x09b4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x09b4('0x11'));var as=require(_0x09b4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09b4('0x13'))(_0x09b4('0x14'));var utils=require(_0x09b4('0x15'));var config=require(_0x09b4('0x16'));var licenseUtil=require(_0x09b4('0x17'));var db=require(_0x09b4('0x18'))['db'];config['redis']=_[_0x09b4('0x19')](config[_0x09b4('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x09b4('0x1b'))(new Redis(config[_0x09b4('0x1a')]));require(_0x09b4('0x1c'))[_0x09b4('0x1d')](socket);function respondWithStatusCode(_0x4a2b6e,_0x80c827){_0x80c827=_0x80c827||0xcc;return function(_0x26ddd6){if(_0x26ddd6){return _0x4a2b6e[_0x09b4('0x1e')](_0x80c827);}return _0x4a2b6e[_0x09b4('0x1f')](_0x80c827)['end']();};}function respondWithResult(_0x482c6f,_0x204205){_0x204205=_0x204205||0xc8;return function(_0x5eb261){if(_0x5eb261){return _0x482c6f[_0x09b4('0x1f')](_0x204205)[_0x09b4('0x20')](_0x5eb261);}};}function respondWithFilteredResult(_0x5e2b1c,_0x5e3ce6){return function(_0x5e9acd){if(_0x5e9acd){var _0x19b1fc=typeof _0x5e3ce6[_0x09b4('0x21')]===_0x09b4('0x22')&&typeof _0x5e3ce6['limit']===_0x09b4('0x22');var _0x2cef82=_0x5e9acd[_0x09b4('0x23')];var _0x49b0bb=_0x19b1fc?0x0:_0x5e3ce6[_0x09b4('0x21')];var _0x1fe030=_0x19b1fc?_0x5e9acd[_0x09b4('0x23')]:_0x5e3ce6[_0x09b4('0x21')]+_0x5e3ce6[_0x09b4('0x24')];var _0x1ee5da;if(_0x1fe030>=_0x2cef82){_0x1fe030=_0x2cef82;_0x1ee5da=0xc8;}else{_0x1ee5da=0xce;}_0x5e2b1c[_0x09b4('0x1f')](_0x1ee5da);return _0x5e2b1c[_0x09b4('0x25')](_0x09b4('0x26'),_0x49b0bb+'-'+_0x1fe030+'/'+_0x2cef82)[_0x09b4('0x20')](_0x5e9acd);}return null;};}function patchUpdates(_0x48445a){return function(_0x192b67){try{jsonpatch[_0x09b4('0x27')](_0x192b67,_0x48445a,!![]);}catch(_0x264979){return BPromise['reject'](_0x264979);}return _0x192b67[_0x09b4('0x28')]();};}function saveUpdates(_0x531193,_0x416767){return function(_0x402b91){if(_0x402b91){return _0x402b91[_0x09b4('0x29')](_0x531193)[_0x09b4('0x2a')](function(_0x1b32be){return _0x1b32be;});}return null;};}function removeEntity(_0x39c59e,_0x4299a2){return function(_0x1f1cd8){if(_0x1f1cd8){return _0x1f1cd8[_0x09b4('0x2b')]()['then'](function(){_0x39c59e['status'](0xcc)[_0x09b4('0x2c')]();});}};}function handleEntityNotFound(_0x181cef,_0x1a12da){return function(_0x4c8081){if(!_0x4c8081){_0x181cef['sendStatus'](0x194);}return _0x4c8081;};}function handleError(_0x47db5c,_0x1d3dc4){_0x1d3dc4=_0x1d3dc4||0x1f4;return function(_0x5768dc){logger[_0x09b4('0x2d')](_0x5768dc[_0x09b4('0x2e')]);if(_0x5768dc['name']){delete _0x5768dc['name'];}_0x47db5c[_0x09b4('0x1f')](_0x1d3dc4)[_0x09b4('0x2f')](_0x5768dc);};}function getInteractionUsers(_0x32f44b,_0x167c08){return new BPromise(function(_0x387a18,_0xc52e48){try{if(_0x167c08[_0x32f44b['id']]){_0x32f44b[_0x09b4('0x30')]=_[_0x09b4('0x31')](_0x167c08[_0x32f44b['id']],function(_0xaa82df){return{'id':_0xaa82df['id'],'fullname':_0xaa82df[_0x09b4('0x32')]};});}}catch(_0x1bf857){_0xc52e48(_0x1bf857);}_0x387a18(_0x32f44b);});}function getInteractionTags(_0x43611e,_0x36d7f0){return new BPromise(function(_0xa26f50,_0x5b9d9f){try{if(_0x43611e[_0x09b4('0x33')]){_0x43611e[_0x09b4('0x34')]=[];_0x43611e[_0x09b4('0x33')][_0x09b4('0x35')](',')['forEach'](function(_0x120886){_0x43611e['Tags'][_0x09b4('0x36')](_0x36d7f0[_0x120886]);});}delete _0x43611e[_0x09b4('0x33')];}catch(_0x3d9669){_0x5b9d9f(_0x3d9669);}_0xa26f50(_0x43611e);});}function updateFaxInteraction(_0x2c1834,_0x525a2f,_0x26dfa5){return new BPromise(function(_0xbbea0f,_0x483c2b){return getInteractionUsers(_0x2c1834,_0x26dfa5)[_0x09b4('0x2a')](function(_0x5e9065){return getInteractionTags(_0x5e9065,_0x525a2f);})['then'](function(_0x280889){_0xbbea0f(_0x280889);})[_0x09b4('0x37')](function(_0x31c6d4){_0x483c2b(_0x31c6d4);});});}exports[_0x09b4('0x38')]=function(_0x2e0400,_0x1bbfb6){var _0x1b8495={},_0x55baa8={},_0x59e268={'count':0x0,'rows':[]};var _0x2c952f=_[_0x09b4('0x31')](db['FaxInteraction'][_0x09b4('0x39')],function(_0x44f918){return{'name':_0x44f918[_0x09b4('0x3a')],'type':_0x44f918[_0x09b4('0x3b')][_0x09b4('0x3c')]};});_0x55baa8[_0x09b4('0x3d')]=_[_0x09b4('0x31')](_0x2c952f,_0x09b4('0x3e'));_0x55baa8[_0x09b4('0x3f')]=_['keys'](_0x2e0400[_0x09b4('0x3f')]);_0x55baa8[_0x09b4('0x40')]=_[_0x09b4('0x41')](_0x55baa8[_0x09b4('0x3d')],_0x55baa8['query']);_0x1b8495[_0x09b4('0x42')]=_['intersection'](_0x55baa8[_0x09b4('0x3d')],qs[_0x09b4('0x43')](_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x43')]));_0x1b8495[_0x09b4('0x42')]=_0x1b8495[_0x09b4('0x42')][_0x09b4('0x44')]?_0x1b8495[_0x09b4('0x42')]:_0x55baa8[_0x09b4('0x3d')];if(!_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x45')](_0x09b4('0x46'))){_0x1b8495[_0x09b4('0x24')]=qs[_0x09b4('0x24')](_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x24')]);_0x1b8495[_0x09b4('0x21')]=qs[_0x09b4('0x21')](_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x21')]);}_0x1b8495['order']=qs[_0x09b4('0x47')](_0x2e0400['query'][_0x09b4('0x47')]);_0x1b8495['where']=qs['filters'](_['pick'](_0x2e0400[_0x09b4('0x3f')],_0x55baa8[_0x09b4('0x40')]),_0x2c952f);var _0x55c4f8=[];var _0x4c5b09=squel[_0x09b4('0x48')]()['field']('id')[_0x09b4('0x49')]('name')[_0x09b4('0x49')]('color')[_0x09b4('0x4a')]('tools_tags');var _0x3c128f=squel[_0x09b4('0x48')]()[_0x09b4('0x49')]('u.id')['field'](_0x09b4('0x4b'))['field'](_0x09b4('0x4c'))[_0x09b4('0x4a')]('user_has_fax_interactions','ui')[_0x09b4('0x4d')](_0x09b4('0x4e'),'u',_0x09b4('0x4f'));var _0x53d6f=squel['select']()[_0x09b4('0x4a')](_0x09b4('0x50'),'i')[_0x09b4('0x4d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x09b4('0x4d')](_0x09b4('0x4e'),'o','o.id\x20=\x20i.UserId')[_0x09b4('0x4d')]('fax_accounts','a',_0x09b4('0x51'))[_0x09b4('0x4d')](_0x09b4('0x52'),'me',_0x09b4('0x53'))[_0x09b4('0x4d')](_0x09b4('0x54'),'it',_0x09b4('0x55'))['left_join'](_0x09b4('0x56'),'t',_0x09b4('0x57'));var _0x647dd4=squel[_0x09b4('0x58')]();var _0x52963c=[];var _0x4db7ef=squel[_0x09b4('0x58')]();var _0x4b3e7a;if(_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x59')]){_0x4b3e7a=as[_0x09b4('0x5a')](_0x2e0400['query'][_0x09b4('0x59')]);var _0xe48db2=_0x4b3e7a[_0x09b4('0x5b')];for(var _0x5d33e4=0x0;_0x5d33e4<_0x4b3e7a[_0x09b4('0x5c')]['length'];_0x5d33e4++){var _0xf81700=_0x4b3e7a[_0x09b4('0x5c')][_0x5d33e4];var _0x453c5f='i';var _0x2a3ccb=_['find'](_0x2c952f,[_0x09b4('0x3e'),_0xf81700['field']]);if(!_0x2a3ccb){switch(_0xf81700['field']){case _0x09b4('0x5d'):if(_0xf81700[_0x09b4('0x5e')]==0x1){_0x53d6f[_0x09b4('0x5f')]('`'+_0xf81700[_0x09b4('0x49')]+_0x09b4('0x60'));}else{_0x53d6f['having']('`'+_0xf81700['field']+_0x09b4('0x61'));}break;case'Contact':if(_0xf81700[_0x09b4('0x62')]===_0x09b4('0x63')){if(_0xf81700[_0x09b4('0x5e')]['split']('\x20')[_0x09b4('0x44')]>0x1){_0x647dd4[_0xe48db2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x09b4('0x64')](_0xf81700['value']),null);}else{var _0x1206b6='%'+_0xf81700[_0x09b4('0x5e')]+'%';_0x647dd4[_0xe48db2](_0x09b4('0x65'),_0x1206b6,_0x1206b6,_0x1206b6);}}else{_0x2a3ccb=_[_0x09b4('0x66')](_0x2c952f,[_0x09b4('0x3e'),_0x09b4('0x67')]);_0xf81700[_0x09b4('0x49')]='ContactId';_0x30155e=as[_0x09b4('0x68')](_0x453c5f,_0x2a3ccb[_0x09b4('0x3b')],_0xf81700);_0x647dd4[_0xe48db2](_0x30155e[_0x09b4('0x69')],_0x30155e['value'][_0x09b4('0x6a')],_0x30155e[_0x09b4('0x5e')]['end']);}break;case _0x09b4('0x6b'):var _0x33867f=_0xf81700[_0x09b4('0x5e')]['split'](',')[_0x09b4('0x31')](function(_0x3f89e7){return Number(_0x3f89e7);});_0x33867f['forEach'](function(_0x223292){_0x4db7ef['or'](_0x09b4('0x6c'),'%,'+_0x223292+',%');});_0x52963c=_['union'](_0x52963c,_0x33867f);break;case _0x09b4('0x6d'):if(_0xf81700['operator']===_0x09b4('0x63')){_0x647dd4[_0xe48db2](_0x09b4('0x6e'),'%'+_0xf81700[_0x09b4('0x5e')]+'%',null);}else{_0x2a3ccb=_[_0x09b4('0x66')](_0x2c952f,['name',_0x09b4('0x6f')]);_0xf81700[_0x09b4('0x49')]=_0x09b4('0x6f');_0x30155e=as[_0x09b4('0x68')](_0x453c5f,_0x2a3ccb[_0x09b4('0x3b')],_0xf81700);_0x647dd4[_0xe48db2](_0x30155e['text'],_0x30155e[_0x09b4('0x5e')][_0x09b4('0x6a')],_0x30155e[_0x09b4('0x5e')][_0x09b4('0x2c')]);}break;case _0x09b4('0x70'):_0x30155e=as[_0x09b4('0x68')]('me',null,_0xf81700);_0x647dd4[_0xe48db2](_0x30155e[_0x09b4('0x69')],_0x30155e[_0x09b4('0x5e')][_0x09b4('0x6a')],_0x30155e[_0x09b4('0x5e')]['end']);break;}}else{var _0x30155e=as[_0x09b4('0x68')](_0x453c5f,_0x2a3ccb[_0x09b4('0x3b')],_0xf81700);_0x647dd4[_0xe48db2](_0x30155e['text'],_0x30155e[_0x09b4('0x5e')][_0x09b4('0x6a')],_0x30155e[_0x09b4('0x5e')][_0x09b4('0x2c')]);}}}else{var _0x4dd52e=_(_0x2e0400[_0x09b4('0x3f')])[_0x09b4('0x71')]()[_0x09b4('0x31')](function(_0x279ab7){return _['some'](_0x2c952f,[_0x09b4('0x3e'),_0x279ab7])?_0x279ab7:undefined;})[_0x09b4('0x72')]()[_0x09b4('0x5e')]();if(!_[_0x09b4('0x73')](_0x4dd52e)){_0x4dd52e[_0x09b4('0x74')](function(_0x3edc5d){if(_0x3edc5d===_0x09b4('0x75')){_0x53d6f[_0x09b4('0x76')](_0x09b4('0x77'),[][_0x09b4('0x78')](_0x2e0400['query'][_0x3edc5d]));}else if(_0x3edc5d===_0x09b4('0x79')){var _0x5de182=JSON[_0x09b4('0x7a')](_0x2e0400[_0x09b4('0x3f')][_0x3edc5d])[_0x09b4('0x7b')];var _0x176efc=JSON[_0x09b4('0x7a')](_0x2e0400[_0x09b4('0x3f')][_0x3edc5d])[_0x09b4('0x7c')];_0x53d6f['where'](_0x09b4('0x7d'),_0x5de182,_0x176efc);}else{if(_0x2e0400[_0x09b4('0x3f')][_0x3edc5d]==='null'){_0x53d6f['where']('i.'+_0x3edc5d+'\x20IS\x20NULL');}else{_0x53d6f[_0x09b4('0x76')]('i.'+_0x3edc5d+_0x09b4('0x7e'),_0x2e0400[_0x09b4('0x3f')][_0x3edc5d]);}}});}if(_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x7f')]){if(_0x2e0400[_0x09b4('0x3f')]['read']==0x1){_0x53d6f[_0x09b4('0x5f')](_0x09b4('0x80'));}else{_0x53d6f['having'](_0x09b4('0x81'));}}if(_0x2e0400['query'][_0x09b4('0x82')]){_0x52963c=_[_0x09b4('0x83')](_0x2e0400[_0x09b4('0x3f')]['tag'])?_0x2e0400[_0x09b4('0x3f')]['tag']:new Array(_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x82')]);_0x52963c['forEach'](function(_0x5f59a2){_0x4db7ef['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5f59a2+',%');});}if(_0x2e0400['query'][_0x09b4('0x84')]){var _0x1a9bd9=_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x84')]['replace']('\x5c','\x5c\x5c')[_0x09b4('0x85')](/'/g,'\x27\x27');if(qs[_0x09b4('0x86')](_0x1a9bd9)){_0x647dd4['or'](_0x09b4('0x87'),_0x1a9bd9+'%')['or'](_0x09b4('0x88'),_0x1a9bd9+'%');}_0x647dd4['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1a9bd9+'%');}}_0x53d6f[_0x09b4('0x76')](_0x647dd4);_0x53d6f['group']('i.id');var _0x17351d={'type':db['Sequelize']['QueryTypes'][_0x09b4('0x89')],'raw':!![]};var _0x50d1a3=_0x53d6f[_0x09b4('0x8a')]();_0x50d1a3[_0x09b4('0x49')](_0x09b4('0x8b'));_0x50d1a3[_0x09b4('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x09b4('0x5d'));if(_0x1b8495[_0x09b4('0x8c')]){_0x1b8495[_0x09b4('0x8c')][_0x09b4('0x74')](function(_0x33c5a2){var _0x4febf0=_0x33c5a2[0x0]==='contactName'?_0x33c5a2[0x0]:'i.'+_0x33c5a2[0x0];_0x53d6f[_0x09b4('0x8c')](_0x4febf0,_0x33c5a2[0x1]===_0x09b4('0x8d')?![]:!![]);});}if(!_[_0x09b4('0x73')](_0x52963c)){_0x53d6f[_0x09b4('0x5f')](_0x4db7ef);_0x50d1a3[_0x09b4('0x76')](_0x09b4('0x8e'),_0x52963c);}BPromise['resolve']()['then'](function(){if(!_0x4b3e7a){if(_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x75')])return;_0x50d1a3['where'](_0x09b4('0x8f'));_0x53d6f[_0x09b4('0x76')](_0x09b4('0x8f'));return;}if(_0x2e0400[_0x09b4('0x90')][_0x09b4('0x91')]!==_0x09b4('0x92'))return;return _0x2e0400[_0x09b4('0x90')][_0x09b4('0x93')]({'attributes':['id'],'raw':!![]})[_0x09b4('0x2a')](function(_0x414394){if(_[_0x09b4('0x73')](_0x414394)){_0x50d1a3[_0x09b4('0x76')](_0x09b4('0x94'));_0x53d6f[_0x09b4('0x76')](_0x09b4('0x94'));}else{_0x50d1a3[_0x09b4('0x76')](_0x09b4('0x77'),_['map'](_0x414394,'id'));_0x53d6f[_0x09b4('0x76')](_0x09b4('0x77'),_[_0x09b4('0x31')](_0x414394,'id'));}});})['then'](function(){if(_0x2e0400[_0x09b4('0x90')][_0x09b4('0x91')]===_0x09b4('0x92')&&!_0x4b3e7a&&!_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x75')])return[];return db['sequelize'][_0x09b4('0x3f')](_0x50d1a3['toString'](),_0x17351d);})[_0x09b4('0x2a')](function(_0x146480){_0x59e268[_0x09b4('0x23')]=_0x146480[_0x09b4('0x44')];if(_0x59e268[_0x09b4('0x23')]===0x0)return[];return db[_0x09b4('0x95')][_0x09b4('0x3f')](_0x4c5b09[_0x09b4('0x96')](),_0x17351d)['then'](function(_0x278148){_0x55c4f8=_['keyBy'](_0x278148,'id');_0x17351d=_[_0x09b4('0x97')](_0x17351d,{'model':db[_0x09b4('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e0400[_0x09b4('0x3f')][_0x09b4('0x43')]){_0x1b8495['attributes'][_0x09b4('0x74')](function(_0x2c2662){_0x53d6f[_0x09b4('0x49')]('i.'+_0x2c2662);});}else{_0x53d6f[_0x09b4('0x49')](_0x09b4('0x99'),_0x09b4('0x5d'));_0x53d6f[_0x09b4('0x49')](_0x09b4('0x9a'),'Account.key');_0x53d6f['field'](_0x09b4('0x9b'),_0x09b4('0x9c'));_0x53d6f[_0x09b4('0x49')](_0x09b4('0x9d'),_0x09b4('0x9e'));_0x53d6f[_0x09b4('0x49')]('i.*');_0x53d6f['field']('c.firstName',_0x09b4('0x9f'));_0x53d6f[_0x09b4('0x49')]('c.lastName','Contact.lastName');_0x53d6f[_0x09b4('0x49')](_0x09b4('0xa0'),_0x09b4('0xa1'));_0x53d6f['field'](_0x09b4('0xa2'),_0x09b4('0xa3'));_0x53d6f[_0x09b4('0x49')](_0x09b4('0xa4'),_0x09b4('0xa5'));_0x53d6f['field'](_0x09b4('0xa6'),_0x09b4('0xa7'));_0x53d6f[_0x09b4('0x49')]('o.fullname',_0x09b4('0xa8'));_0x53d6f['field'](_0x09b4('0xa9'),_0x09b4('0xaa'));_0x53d6f[_0x09b4('0x49')](_0x09b4('0xab'),_0x09b4('0x33'));}if(_0x1b8495[_0x09b4('0x24')])_0x53d6f[_0x09b4('0x24')](_0x1b8495[_0x09b4('0x24')]);if(_0x1b8495['offset'])_0x53d6f['offset'](_0x1b8495[_0x09b4('0x21')]);return db[_0x09b4('0x95')][_0x09b4('0x3f')](_0x53d6f[_0x09b4('0x96')](),_0x17351d);})[_0x09b4('0x2a')](function(_0x13d28d){if(_0x13d28d[_0x09b4('0x44')]>0x0)_0x3c128f[_0x09b4('0x76')](_0x09b4('0xac'),_['map'](_0x13d28d,'id'));return db[_0x09b4('0x95')][_0x09b4('0x3f')](_0x3c128f[_0x09b4('0x96')](),_0x17351d)[_0x09b4('0x2a')](function(_0x1140ab){var _0x312466=_[_0x09b4('0xad')](_0x1140ab,_0x09b4('0xae'));var _0x81539c=[];_0x13d28d['forEach'](function(_0x113da2){_0x81539c[_0x09b4('0x36')](updateFaxInteraction(_0x113da2,_0x55c4f8,_0x312466));});return BPromise[_0x09b4('0xaf')](_0x81539c);});});})[_0x09b4('0x2a')](function(_0x53ca4f){_0x59e268[_0x09b4('0xb0')]=_0x53ca4f;return _0x59e268;})[_0x09b4('0x2a')](respondWithFilteredResult(_0x1bbfb6,_0x1b8495))['catch'](handleError(_0x1bbfb6,null));};exports['show']=function(_0x2c8055,_0x11657d){var _0x34c5a8={'raw':![],'where':{'id':_0x2c8055[_0x09b4('0xb1')]['id']}},_0x350292={};_0x350292[_0x09b4('0x3d')]=_[_0x09b4('0x71')](db[_0x09b4('0x98')][_0x09b4('0x39')]);_0x350292[_0x09b4('0x3f')]=_['keys'](_0x2c8055['query']);_0x350292[_0x09b4('0x40')]=_[_0x09b4('0x41')](_0x350292[_0x09b4('0x3d')],_0x350292[_0x09b4('0x3f')]);_0x34c5a8[_0x09b4('0x42')]=_['intersection'](_0x350292['model'],qs[_0x09b4('0x43')](_0x2c8055[_0x09b4('0x3f')][_0x09b4('0x43')]));_0x34c5a8[_0x09b4('0x42')]=_0x34c5a8[_0x09b4('0x42')][_0x09b4('0x44')]?_0x34c5a8[_0x09b4('0x42')]:_0x350292[_0x09b4('0x3d')];if(_0x2c8055[_0x09b4('0x3f')][_0x09b4('0xb2')]){_0x34c5a8[_0x09b4('0xb3')]=[{'all':!![]}];}_0x34c5a8=_[_0x09b4('0x97')]({},_0x34c5a8,_0x2c8055[_0x09b4('0xb4')]);return db[_0x09b4('0x98')][_0x09b4('0x66')](_0x34c5a8)[_0x09b4('0x2a')](handleEntityNotFound(_0x11657d,null))['then'](respondWithResult(_0x11657d,null))[_0x09b4('0x37')](handleError(_0x11657d,null));};exports[_0x09b4('0xb5')]=function(_0x197c3f,_0x1a149e){return db[_0x09b4('0x98')][_0x09b4('0xb5')](_0x197c3f['body'],{})[_0x09b4('0x2a')](respondWithResult(_0x1a149e,0xc9))[_0x09b4('0x37')](handleError(_0x1a149e,null));};exports[_0x09b4('0x29')]=function(_0x31d07e,_0x294457){if(_0x31d07e[_0x09b4('0x70')]['id']){delete _0x31d07e[_0x09b4('0x70')]['id'];}return db[_0x09b4('0x98')][_0x09b4('0x66')]({'where':{'id':_0x31d07e['params']['id']}})[_0x09b4('0x2a')](handleEntityNotFound(_0x294457,null))[_0x09b4('0x2a')](saveUpdates(_0x31d07e['body'],null))[_0x09b4('0x2a')](respondWithResult(_0x294457,null))['catch'](handleError(_0x294457,null));};exports[_0x09b4('0x2b')]=function(_0x1ca596,_0x192b08){return db[_0x09b4('0x98')][_0x09b4('0x66')]({'where':{'id':_0x1ca596[_0x09b4('0xb1')]['id']}})[_0x09b4('0x2a')](handleEntityNotFound(_0x192b08,null))[_0x09b4('0x2a')](removeEntity(_0x192b08,null))[_0x09b4('0x37')](handleError(_0x192b08,null));};exports[_0x09b4('0xb6')]=function(_0x49755e,_0x20066b){return db[_0x09b4('0x98')][_0x09b4('0xb6')]()['then'](respondWithResult(_0x20066b,null))[_0x09b4('0x37')](handleError(_0x20066b,null));};exports[_0x09b4('0xb7')]=function(_0x15d9cd,_0x56aa45,_0xff0601){return db[_0x09b4('0xb8')][_0x09b4('0x66')]({'where':{'id':_0x15d9cd[_0x09b4('0xb1')]['id']}})[_0x09b4('0x2a')](handleEntityNotFound(_0x56aa45,null))[_0x09b4('0x2a')](function(_0x5a37a6){if(_0x5a37a6){return _0x5a37a6[_0x09b4('0xb7')](_0x15d9cd[_0x09b4('0x70')][_0x09b4('0xb9')],_[_0x09b4('0xba')](_0x15d9cd[_0x09b4('0x70')],[_0x09b4('0xb9'),'id'])||{});}})[_0x09b4('0x2a')](respondWithResult(_0x56aa45,null))[_0x09b4('0x37')](handleError(_0x56aa45,null));};exports[_0x09b4('0xbb')]=function(_0x249d7a,_0x30e0fd,_0x220e2d){var _0x23f096={'raw':![],'where':{}};var _0xb15b8f={};var _0x1efffa={'count':0x0,'rows':[]};return db[_0x09b4('0x98')][_0x09b4('0xbc')]({'where':{'id':_0x249d7a[_0x09b4('0xb1')]['id']}})[_0x09b4('0x2a')](handleEntityNotFound(_0x30e0fd,null))[_0x09b4('0x2a')](function(_0x503216){if(_0x503216){_0xb15b8f[_0x09b4('0x3d')]=_['keys'](db['FaxMessage'][_0x09b4('0x39')]);_0xb15b8f[_0x09b4('0x3f')]=_[_0x09b4('0x71')](_0x249d7a[_0x09b4('0x3f')]);_0xb15b8f[_0x09b4('0x40')]=_[_0x09b4('0x41')](_0xb15b8f[_0x09b4('0x3d')],_0xb15b8f[_0x09b4('0x3f')]);_0x23f096[_0x09b4('0x42')]=_[_0x09b4('0x41')](_0xb15b8f[_0x09b4('0x3d')],qs[_0x09b4('0x43')](_0x249d7a[_0x09b4('0x3f')][_0x09b4('0x43')]));_0x23f096[_0x09b4('0x42')]=_0x23f096[_0x09b4('0x42')][_0x09b4('0x44')]?_0x23f096['attributes']:_0xb15b8f[_0x09b4('0x3d')];if(!_0x249d7a[_0x09b4('0x3f')][_0x09b4('0x45')](_0x09b4('0x46'))){_0x23f096['limit']=qs[_0x09b4('0x24')](_0x249d7a[_0x09b4('0x3f')][_0x09b4('0x24')]);_0x23f096[_0x09b4('0x21')]=qs[_0x09b4('0x21')](_0x249d7a[_0x09b4('0x3f')]['offset']);}_0x23f096['order']=qs[_0x09b4('0x47')](_0x249d7a['query'][_0x09b4('0x47')]);_0x23f096[_0x09b4('0x76')]=qs[_0x09b4('0x40')](_['pick'](_0x249d7a['query'],_0xb15b8f[_0x09b4('0x40')]));_0x23f096[_0x09b4('0x76')][_0x09b4('0xae')]=_0x503216['id'];if(_0x249d7a[_0x09b4('0x3f')][_0x09b4('0x84')]){_0x23f096[_0x09b4('0x76')]=_[_0x09b4('0x97')](_0x23f096['where'],{'$or':_['map'](_0x23f096[_0x09b4('0x42')],function(_0x3678fb){var _0x14a3ee={};_0x14a3ee[_0x3678fb]={'$like':'%'+_0x249d7a[_0x09b4('0x3f')][_0x09b4('0x84')]+'%'};return _0x14a3ee;})});}if(_0x249d7a[_0x09b4('0x3f')][_0x09b4('0x7b')]){var _0x1e9f78=_0x249d7a['query'][_0x09b4('0x7b')][_0x09b4('0x35')](',');var _0x3232a9={};_0x3232a9[_0x1e9f78[0x0]]={'$gte':moment(_0x1e9f78[0x1])[_0x09b4('0xbd')](_0x09b4('0xbe'))};_0x23f096[_0x09b4('0x76')]=_['merge'](_0x23f096['where'],_0x3232a9);}_0x23f096=_[_0x09b4('0x97')]({},_0x23f096,_0x249d7a[_0x09b4('0xb4')]);return db[_0x09b4('0xb8')][_0x09b4('0x23')]({'where':_0x23f096[_0x09b4('0x76')]})['then'](function(_0xe6debe){_0x1efffa[_0x09b4('0x23')]=_0xe6debe;if(_0x249d7a[_0x09b4('0x3f')][_0x09b4('0xb2')]){_0x23f096[_0x09b4('0xb3')]=[{'all':!![]}];}return db[_0x09b4('0xb8')][_0x09b4('0xbf')](_0x23f096);})['then'](function(_0x1f412a){_0x1efffa[_0x09b4('0xb0')]=_0x1f412a;return _0x1efffa;});}})['then'](respondWithFilteredResult(_0x30e0fd,_0x23f096))[_0x09b4('0x37')](handleError(_0x30e0fd,null));};exports[_0x09b4('0xc0')]=function(_0x40df0e,_0x4496eb,_0x102dd5){return db['FaxInteraction'][_0x09b4('0x66')]({'where':{'id':_0x40df0e['params']['id']}})['then'](handleEntityNotFound(_0x4496eb,null))[_0x09b4('0x2a')](function(_0x2b86eb){if(_0x2b86eb){return _0x2b86eb['setTags'](_0x40df0e['body'][_0x09b4('0xb9')],_[_0x09b4('0xba')](_0x40df0e['body'],['ids','id'])||{})[_0x09b4('0xc1')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x40df0e[_0x09b4('0x70')]['ids']}});})[_0x09b4('0x2a')](function(_0x13dfca){socket[_0x09b4('0xc2')](_0x09b4('0xc3'),{'id':Number(_0x40df0e[_0x09b4('0xb1')]['id']),'tags':_0x13dfca||[]});return{'id':Number(_0x40df0e[_0x09b4('0xb1')]['id']),'tags':_0x13dfca||[]};});}})[_0x09b4('0x2a')](respondWithResult(_0x4496eb,null))[_0x09b4('0x37')](handleError(_0x4496eb,null));};exports['removeTags']=function(_0xfea22c,_0xfb7c5a,_0x29f83d){return db['FaxInteraction'][_0x09b4('0x66')]({'where':{'id':_0xfea22c[_0x09b4('0xb1')]['id']}})[_0x09b4('0x2a')](handleEntityNotFound(_0xfb7c5a,null))['then'](function(_0x3043e7){if(_0x3043e7){return _0x3043e7['removeTags'](_0xfea22c[_0x09b4('0x3f')][_0x09b4('0xb9')]);}})[_0x09b4('0x2a')](respondWithStatusCode(_0xfb7c5a,null))[_0x09b4('0x37')](handleError(_0xfb7c5a,null));};exports[_0x09b4('0xc4')]=function(_0x19e0b9,_0x55ef94){var _0x497e50=moment()['unix']()[_0x09b4('0x96')]();var _0x51e85e=path[_0x09b4('0xc5')](config[_0x09b4('0xc6')],'server','files',_0x09b4('0xc7'));var _0x83bbd4=path['join'](config['root'],_0x09b4('0xc8'),_0x09b4('0xc9'),_0x09b4('0xca'));var _0x1dcb70=path[_0x09b4('0xc5')](_0x51e85e,_0x497e50);var _0x588eda=util[_0x09b4('0xbd')](_0x09b4('0xcb'),_0x19e0b9['params']['id'],_0x497e50);var _0x62d826=path[_0x09b4('0xc5')](_0x51e85e,_0x588eda);var _0x31e028=[];_0x31e028['push']({'model':db[_0x09b4('0xcc')],'as':_0x09b4('0xcc'),'raw':!![]});var _0x43949e=[{'model':db[_0x09b4('0xb8')],'as':_0x09b4('0xcd'),'attributes':['id',_0x09b4('0x70'),_0x09b4('0x79')],'include':_0x31e028}];return db['FaxInteraction'][_0x09b4('0x66')]({'where':{'id':_0x19e0b9[_0x09b4('0xb1')]['id']},'include':_0x43949e})[_0x09b4('0x2a')](handleEntityNotFound(_0x55ef94,null))[_0x09b4('0x2a')](function(_0x2b3e4a){if(_0x2b3e4a&&_0x2b3e4a[_0x09b4('0xcd')]){var _0x256d83=_0x2b3e4a[_0x09b4('0xce')]({'plain':!![]});fs[_0x09b4('0xcf')](_0x1dcb70);for(var _0x3c53a4=0x0;_0x3c53a4<_0x256d83[_0x09b4('0xcd')][_0x09b4('0x44')];_0x3c53a4++){var _0x1e2ed6=_0x256d83[_0x09b4('0xcd')][_0x3c53a4][_0x09b4('0xcc')];if(_0x1e2ed6){var _0x2aac7=path[_0x09b4('0xc5')](_0x83bbd4,_0x1e2ed6[_0x09b4('0xd0')]);if(fs[_0x09b4('0xd1')](_0x2aac7)){fs[_0x09b4('0xd2')](_0x2aac7)[_0x09b4('0xd3')](fs[_0x09b4('0xd4')](path[_0x09b4('0xc5')](_0x1dcb70,_0x1e2ed6['basename'])));}}}return BPromise[_0x09b4('0xd5')]()[_0x09b4('0x2a')](function(){return new BPromise(function(_0x4a4833,_0x19a1b6){zipdir(_0x1dcb70,{'saveTo':_0x62d826},function(_0x21ef31,_0x556abc){if(_0x21ef31)return _0x19a1b6(_0x21ef31);return _0x4a4833(_0x556abc);});})[_0x09b4('0x2a')](function(){return new BPromise(function(_0x565ed9,_0x198052){rimraf(_0x1dcb70,function(_0x3aa1cb){if(_0x3aa1cb)_0x198052(_0x3aa1cb);return _0x565ed9();});});})[_0x09b4('0x2a')](function(){return _0x55ef94[_0x09b4('0xc4')](_0x62d826,_0x588eda,function(_0x1c6f62){if(_0x1c6f62){console[_0x09b4('0xd6')](_0x09b4('0xd7'),_0x1c6f62);}else{fs['unlinkSync'](_0x62d826);}});});});}else{return _0x55ef94[_0x09b4('0x1e')](0xc8);}})['catch'](handleError(_0x55ef94,null));}; \ No newline at end of file +var _0xf74c=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','destroy','then','sendStatus','error','name','Users','map','TagIds','Tags','forEach','push','index','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','show','params','include','create','update','describe','addMessage','omit','ids','getMessages','findOne','FaxMessage','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','spread','findAll','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x579b51,_0x208da5){var _0x1190a7=function(_0x94f632){while(--_0x94f632){_0x579b51['push'](_0x579b51['shift']());}};_0x1190a7(++_0x208da5);}(_0xf74c,0x1a9));var _0xcf74=function(_0xc4f441,_0x4e86db){_0xc4f441=_0xc4f441-0x0;var _0xe856e6=_0xf74c[_0xc4f441];return _0xe856e6;};'use strict';var emlformat=require(_0xcf74('0x0'));var rimraf=require(_0xcf74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcf74('0x2'));var moment=require('moment');var BPromise=require(_0xcf74('0x3'));var Mustache=require(_0xcf74('0x4'));var util=require('util');var path=require(_0xcf74('0x5'));var sox=require(_0xcf74('0x6'));var csv=require(_0xcf74('0x7'));var ejs=require(_0xcf74('0x8'));var fs=require('fs');var fs_extra=require(_0xcf74('0x9'));var _=require(_0xcf74('0xa'));var squel=require(_0xcf74('0xb'));var crypto=require(_0xcf74('0xc'));var jsforce=require(_0xcf74('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcf74('0x7'));var querystring=require(_0xcf74('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcf74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcf74('0x10'));var hardwareService=require(_0xcf74('0x11'));var logger=require(_0xcf74('0x12'))(_0xcf74('0x13'));var utils=require(_0xcf74('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcf74('0x15'))['db'];config[_0xcf74('0x16')]=_[_0xcf74('0x17')](config[_0xcf74('0x16')],{'host':_0xcf74('0x18'),'port':0x18eb});var socket=require(_0xcf74('0x19'))(new Redis(config[_0xcf74('0x16')]));require(_0xcf74('0x1a'))[_0xcf74('0x1b')](socket);function respondWithStatusCode(_0xd8c943,_0x13e48c){_0x13e48c=_0x13e48c||0xcc;return function(_0x434582){if(_0x434582){return _0xd8c943['sendStatus'](_0x13e48c);}return _0xd8c943[_0xcf74('0x1c')](_0x13e48c)[_0xcf74('0x1d')]();};}function respondWithResult(_0x3d2019,_0x4aaddf){_0x4aaddf=_0x4aaddf||0xc8;return function(_0x183629){if(_0x183629){return _0x3d2019[_0xcf74('0x1c')](_0x4aaddf)['json'](_0x183629);}};}function respondWithFilteredResult(_0x23e311,_0x217ba8){return function(_0x5ab7bf){if(_0x5ab7bf){var _0xcbe59e=typeof _0x217ba8['offset']===_0xcf74('0x1e')&&typeof _0x217ba8[_0xcf74('0x1f')]===_0xcf74('0x1e');var _0x4f99cc=_0x5ab7bf[_0xcf74('0x20')];var _0x3dfeae=_0xcbe59e?0x0:_0x217ba8[_0xcf74('0x21')];var _0x571c07=_0xcbe59e?_0x5ab7bf[_0xcf74('0x20')]:_0x217ba8['offset']+_0x217ba8[_0xcf74('0x1f')];var _0x2bfb40;if(_0x571c07>=_0x4f99cc){_0x571c07=_0x4f99cc;_0x2bfb40=0xc8;}else{_0x2bfb40=0xce;}_0x23e311[_0xcf74('0x1c')](_0x2bfb40);return _0x23e311[_0xcf74('0x22')](_0xcf74('0x23'),_0x3dfeae+'-'+_0x571c07+'/'+_0x4f99cc)[_0xcf74('0x24')](_0x5ab7bf);}return null;};}function patchUpdates(_0x53898b){return function(_0x1a9a29){try{jsonpatch['apply'](_0x1a9a29,_0x53898b,!![]);}catch(_0x3728d0){return BPromise[_0xcf74('0x25')](_0x3728d0);}return _0x1a9a29[_0xcf74('0x26')]();};}function saveUpdates(_0x234106,_0x124bf3){return function(_0x543897){if(_0x543897){return _0x543897['update'](_0x234106)['then'](function(_0x503a4f){return _0x503a4f;});}return null;};}function removeEntity(_0x468360,_0x23f97b){return function(_0xf81f04){if(_0xf81f04){return _0xf81f04[_0xcf74('0x27')]()[_0xcf74('0x28')](function(){_0x468360[_0xcf74('0x1c')](0xcc)[_0xcf74('0x1d')]();});}};}function handleEntityNotFound(_0xd44d2f,_0x953de6){return function(_0x21b3a6){if(!_0x21b3a6){_0xd44d2f[_0xcf74('0x29')](0x194);}return _0x21b3a6;};}function handleError(_0x1e0ca8,_0x551f3e){_0x551f3e=_0x551f3e||0x1f4;return function(_0x5c8067){logger[_0xcf74('0x2a')](_0x5c8067['stack']);if(_0x5c8067[_0xcf74('0x2b')]){delete _0x5c8067[_0xcf74('0x2b')];}_0x1e0ca8['status'](_0x551f3e)['send'](_0x5c8067);};}function getInteractionUsers(_0x33f641,_0x372503){return new BPromise(function(_0xab78e0,_0x9086f6){try{if(_0x372503[_0x33f641['id']]){_0x33f641[_0xcf74('0x2c')]=_[_0xcf74('0x2d')](_0x372503[_0x33f641['id']],function(_0x2e90b4){return{'id':_0x2e90b4['id'],'fullname':_0x2e90b4['fullname']};});}}catch(_0x22d9d7){_0x9086f6(_0x22d9d7);}_0xab78e0(_0x33f641);});}function getInteractionTags(_0x122cc0,_0x542412){return new BPromise(function(_0x4a3823,_0x353a2f){try{if(_0x122cc0[_0xcf74('0x2e')]){_0x122cc0[_0xcf74('0x2f')]=[];_0x122cc0[_0xcf74('0x2e')]['split'](',')[_0xcf74('0x30')](function(_0x6fe4d5){_0x122cc0[_0xcf74('0x2f')][_0xcf74('0x31')](_0x542412[_0x6fe4d5]);});}delete _0x122cc0[_0xcf74('0x2e')];}catch(_0x11a0cd){_0x353a2f(_0x11a0cd);}_0x4a3823(_0x122cc0);});}function updateFaxInteraction(_0x5ace89,_0x3367b4,_0x12b06d){return new BPromise(function(_0x453398,_0x18e475){return getInteractionUsers(_0x5ace89,_0x12b06d)[_0xcf74('0x28')](function(_0x966f5b){return getInteractionTags(_0x966f5b,_0x3367b4);})['then'](function(_0x56ea2b){_0x453398(_0x56ea2b);})['catch'](function(_0x43b182){_0x18e475(_0x43b182);});});}exports[_0xcf74('0x32')]=function(_0xd98faa,_0x5cea1c){var _0x32094a={},_0x3f67fa={},_0x4d4a3a={'count':0x0,'rows':[]};var _0xea4968=_[_0xcf74('0x2d')](db['FaxInteraction'][_0xcf74('0x33')],function(_0x4873bb){return{'name':_0x4873bb['fieldName'],'type':_0x4873bb[_0xcf74('0x34')]['key']};});_0x3f67fa[_0xcf74('0x35')]=_[_0xcf74('0x2d')](_0xea4968,'name');_0x3f67fa['query']=_[_0xcf74('0x36')](_0xd98faa[_0xcf74('0x37')]);_0x3f67fa[_0xcf74('0x38')]=_[_0xcf74('0x39')](_0x3f67fa[_0xcf74('0x35')],_0x3f67fa[_0xcf74('0x37')]);_0x32094a[_0xcf74('0x3a')]=_[_0xcf74('0x39')](_0x3f67fa[_0xcf74('0x35')],qs[_0xcf74('0x3b')](_0xd98faa[_0xcf74('0x37')][_0xcf74('0x3b')]));_0x32094a[_0xcf74('0x3a')]=_0x32094a[_0xcf74('0x3a')][_0xcf74('0x3c')]?_0x32094a[_0xcf74('0x3a')]:_0x3f67fa[_0xcf74('0x35')];if(!_0xd98faa[_0xcf74('0x37')][_0xcf74('0x3d')](_0xcf74('0x3e'))){_0x32094a[_0xcf74('0x1f')]=qs[_0xcf74('0x1f')](_0xd98faa[_0xcf74('0x37')][_0xcf74('0x1f')]);_0x32094a[_0xcf74('0x21')]=qs[_0xcf74('0x21')](_0xd98faa[_0xcf74('0x37')][_0xcf74('0x21')]);}_0x32094a[_0xcf74('0x3f')]=qs[_0xcf74('0x40')](_0xd98faa[_0xcf74('0x37')][_0xcf74('0x40')]);_0x32094a[_0xcf74('0x41')]=qs[_0xcf74('0x38')](_[_0xcf74('0x42')](_0xd98faa[_0xcf74('0x37')],_0x3f67fa['filters']),_0xea4968);var _0x287dde=[];var _0x9e05ad=squel[_0xcf74('0x43')]()[_0xcf74('0x44')]('id')[_0xcf74('0x44')]('name')[_0xcf74('0x44')](_0xcf74('0x45'))[_0xcf74('0x46')](_0xcf74('0x47'));var _0x3f1e6c=squel[_0xcf74('0x43')]()['field'](_0xcf74('0x48'))[_0xcf74('0x44')](_0xcf74('0x49'))['field'](_0xcf74('0x4a'))['from'](_0xcf74('0x4b'),'ui')[_0xcf74('0x4c')]('users','u',_0xcf74('0x4d'));var _0x2e51cf=squel[_0xcf74('0x43')]()['from']('fax_interactions','i')['left_join'](_0xcf74('0x4e'),'c',_0xcf74('0x4f'))[_0xcf74('0x4c')](_0xcf74('0x50'),'o',_0xcf74('0x51'))[_0xcf74('0x4c')](_0xcf74('0x52'),'a','a.id\x20=\x20i.FaxAccountId')[_0xcf74('0x4c')]('fax_messages','me',_0xcf74('0x53'))[_0xcf74('0x4c')](_0xcf74('0x54'),'it',_0xcf74('0x55'))[_0xcf74('0x4c')](_0xcf74('0x47'),'t',_0xcf74('0x56'));var _0x41ea93=squel[_0xcf74('0x57')]();var _0x33fd62=[];var _0x332d0a=squel[_0xcf74('0x57')]();var _0x309188;if(_0xd98faa['query'][_0xcf74('0x58')]){_0x309188=as['parseSearch'](_0xd98faa[_0xcf74('0x37')][_0xcf74('0x58')]);var _0x4db403=_0x309188[_0xcf74('0x59')];for(var _0x29d2c0=0x0;_0x29d2c0<_0x309188[_0xcf74('0x5a')][_0xcf74('0x3c')];_0x29d2c0++){var _0x47cd0f=_0x309188['conditions'][_0x29d2c0];var _0x5cbf18='i';var _0x533df9=_['find'](_0xea4968,[_0xcf74('0x2b'),_0x47cd0f['field']]);if(!_0x533df9){switch(_0x47cd0f[_0xcf74('0x44')]){case'unreadMessages':if(_0x47cd0f['value']==0x1){_0x2e51cf['having']('`'+_0x47cd0f['field']+_0xcf74('0x5b'));}else{_0x2e51cf['having']('`'+_0x47cd0f[_0xcf74('0x44')]+_0xcf74('0x5c'));}break;case _0xcf74('0x5d'):if(_0x47cd0f[_0xcf74('0x5e')]===_0xcf74('0x5f')){if(_0x47cd0f['value'][_0xcf74('0x60')]('\x20')[_0xcf74('0x3c')]>0x1){_0x41ea93[_0x4db403](_0xcf74('0x61'),qs['getFullTextValue'](_0x47cd0f[_0xcf74('0x62')]),null);}else{var _0x57163c='%'+_0x47cd0f[_0xcf74('0x62')]+'%';_0x41ea93[_0x4db403](_0xcf74('0x63'),_0x57163c,_0x57163c,_0x57163c);}}else{_0x533df9=_[_0xcf74('0x64')](_0xea4968,['name',_0xcf74('0x65')]);_0x47cd0f[_0xcf74('0x44')]=_0xcf74('0x65');_0x287bc9=as[_0xcf74('0x66')](_0x5cbf18,_0x533df9[_0xcf74('0x34')],_0x47cd0f);_0x41ea93[_0x4db403](_0x287bc9[_0xcf74('0x67')],_0x287bc9[_0xcf74('0x62')][_0xcf74('0x68')],_0x287bc9[_0xcf74('0x62')][_0xcf74('0x1d')]);}break;case _0xcf74('0x69'):var _0x20d8b7=_0x47cd0f[_0xcf74('0x62')][_0xcf74('0x60')](',')[_0xcf74('0x2d')](function(_0x287056){return Number(_0x287056);});_0x20d8b7['forEach'](function(_0xf92024){_0x332d0a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf92024+',%');});_0x33fd62=_[_0xcf74('0x6a')](_0x33fd62,_0x20d8b7);break;case _0xcf74('0x6b'):if(_0x47cd0f['operator']==='$substring'){_0x41ea93[_0x4db403]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x47cd0f[_0xcf74('0x62')]+'%',null);}else{_0x533df9=_['find'](_0xea4968,[_0xcf74('0x2b'),_0xcf74('0x6c')]);_0x47cd0f[_0xcf74('0x44')]=_0xcf74('0x6c');_0x287bc9=as[_0xcf74('0x66')](_0x5cbf18,_0x533df9[_0xcf74('0x34')],_0x47cd0f);_0x41ea93[_0x4db403](_0x287bc9[_0xcf74('0x67')],_0x287bc9[_0xcf74('0x62')][_0xcf74('0x68')],_0x287bc9[_0xcf74('0x62')]['end']);}break;case _0xcf74('0x6d'):_0x287bc9=as[_0xcf74('0x66')]('me',null,_0x47cd0f);_0x41ea93[_0x4db403](_0x287bc9[_0xcf74('0x67')],_0x287bc9[_0xcf74('0x62')][_0xcf74('0x68')],_0x287bc9[_0xcf74('0x62')]['end']);break;}}else{var _0x287bc9=as[_0xcf74('0x66')](_0x5cbf18,_0x533df9[_0xcf74('0x34')],_0x47cd0f);_0x41ea93[_0x4db403](_0x287bc9[_0xcf74('0x67')],_0x287bc9[_0xcf74('0x62')][_0xcf74('0x68')],_0x287bc9[_0xcf74('0x62')]['end']);}}}else{var _0x46ada6=_(_0xd98faa[_0xcf74('0x37')])['keys']()['map'](function(_0x11ac4e){return _[_0xcf74('0x6e')](_0xea4968,[_0xcf74('0x2b'),_0x11ac4e])?_0x11ac4e:undefined;})[_0xcf74('0x6f')]()[_0xcf74('0x62')]();if(!_[_0xcf74('0x70')](_0x46ada6)){_0x46ada6[_0xcf74('0x30')](function(_0x295971){if(_0x295971===_0xcf74('0x71')){_0x2e51cf[_0xcf74('0x41')](_0xcf74('0x72'),[][_0xcf74('0x73')](_0xd98faa[_0xcf74('0x37')][_0x295971]));}else if(_0x295971===_0xcf74('0x74')){var _0x2fbf14=JSON['parse'](_0xd98faa[_0xcf74('0x37')][_0x295971])[_0xcf74('0x75')];var _0x49f379=JSON[_0xcf74('0x76')](_0xd98faa[_0xcf74('0x37')][_0x295971])['$lte'];_0x2e51cf[_0xcf74('0x41')](_0xcf74('0x77'),_0x2fbf14,_0x49f379);}else{if(_0xd98faa[_0xcf74('0x37')][_0x295971]===_0xcf74('0x78')){_0x2e51cf[_0xcf74('0x41')]('i.'+_0x295971+_0xcf74('0x79'));}else{_0x2e51cf[_0xcf74('0x41')]('i.'+_0x295971+_0xcf74('0x7a'),_0xd98faa['query'][_0x295971]);}}});}if(_0xd98faa['query'][_0xcf74('0x7b')]){if(_0xd98faa[_0xcf74('0x37')][_0xcf74('0x7b')]==0x1){_0x2e51cf['having'](_0xcf74('0x7c'));}else{_0x2e51cf[_0xcf74('0x7d')](_0xcf74('0x7e'));}}if(_0xd98faa[_0xcf74('0x37')]['tag']){_0x33fd62=_[_0xcf74('0x7f')](_0xd98faa[_0xcf74('0x37')][_0xcf74('0x80')])?_0xd98faa[_0xcf74('0x37')][_0xcf74('0x80')]:new Array(_0xd98faa[_0xcf74('0x37')][_0xcf74('0x80')]);_0x33fd62[_0xcf74('0x30')](function(_0x225921){_0x332d0a['or'](_0xcf74('0x81'),'%,'+_0x225921+',%');});}if(_0xd98faa[_0xcf74('0x37')]['filter']){var _0x488d3b=_0xd98faa[_0xcf74('0x37')][_0xcf74('0x82')]['replace']('\x5c','\x5c\x5c')[_0xcf74('0x83')](/'/g,'\x27\x27');if(qs[_0xcf74('0x84')](_0x488d3b)){_0x41ea93['or'](_0xcf74('0x85'),_0x488d3b+'%')['or'](_0xcf74('0x86'),_0x488d3b+'%');}_0x41ea93['or'](_0xcf74('0x87'),_0x488d3b+'%');}}_0x2e51cf[_0xcf74('0x41')](_0x41ea93);_0x2e51cf[_0xcf74('0x88')]('i.id');var _0x5298fc={'type':db[_0xcf74('0x89')][_0xcf74('0x8a')]['SELECT'],'raw':!![]};var _0x190f0b=_0x2e51cf[_0xcf74('0x8b')]();_0x190f0b[_0xcf74('0x44')]('i.id');_0x190f0b[_0xcf74('0x44')](_0xcf74('0x8c'),_0xcf74('0x8d'));if(_0x32094a[_0xcf74('0x3f')]){_0x32094a['order'][_0xcf74('0x30')](function(_0x49d797){var _0x314dee=_0x49d797[0x0]==='contactName'?_0x49d797[0x0]:'i.'+_0x49d797[0x0];_0x2e51cf[_0xcf74('0x3f')](_0x314dee,_0x49d797[0x1]==='DESC'?![]:!![]);});}if(!_[_0xcf74('0x70')](_0x33fd62)){_0x2e51cf['having'](_0x332d0a);_0x190f0b[_0xcf74('0x41')](_0xcf74('0x8e'),_0x33fd62);}BPromise[_0xcf74('0x8f')]()['then'](function(){if(!_0x309188){if(_0xd98faa[_0xcf74('0x37')]['FaxAccountId'])return;_0x190f0b['where'](_0xcf74('0x90'));_0x2e51cf[_0xcf74('0x41')](_0xcf74('0x90'));return;}if(_0xd98faa[_0xcf74('0x91')][_0xcf74('0x92')]!==_0xcf74('0x93'))return;return _0xd98faa[_0xcf74('0x91')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x100d25){if(_['isEmpty'](_0x100d25)){_0x190f0b[_0xcf74('0x41')](_0xcf74('0x94'));_0x2e51cf['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x190f0b[_0xcf74('0x41')](_0xcf74('0x72'),_[_0xcf74('0x2d')](_0x100d25,'id'));_0x2e51cf[_0xcf74('0x41')](_0xcf74('0x72'),_[_0xcf74('0x2d')](_0x100d25,'id'));}});})[_0xcf74('0x28')](function(){if(_0xd98faa[_0xcf74('0x91')]['role']===_0xcf74('0x93')&&!_0x309188&&!_0xd98faa[_0xcf74('0x37')][_0xcf74('0x71')])return[];return db[_0xcf74('0x95')][_0xcf74('0x37')](_0x190f0b[_0xcf74('0x96')](),_0x5298fc);})['then'](function(_0x362b70){_0x4d4a3a[_0xcf74('0x20')]=_0x362b70[_0xcf74('0x3c')];if(_0x4d4a3a[_0xcf74('0x20')]===0x0)return[];return db[_0xcf74('0x95')][_0xcf74('0x37')](_0x9e05ad[_0xcf74('0x96')](),_0x5298fc)[_0xcf74('0x28')](function(_0xdcac13){_0x287dde=_[_0xcf74('0x97')](_0xdcac13,'id');_0x5298fc=_[_0xcf74('0x98')](_0x5298fc,{'model':db[_0xcf74('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd98faa[_0xcf74('0x37')][_0xcf74('0x3b')]){_0x32094a['attributes'][_0xcf74('0x30')](function(_0x249160){_0x2e51cf[_0xcf74('0x44')]('i.'+_0x249160);});}else{_0x2e51cf[_0xcf74('0x44')](_0xcf74('0x8c'),_0xcf74('0x8d'));_0x2e51cf[_0xcf74('0x44')](_0xcf74('0x9a'),_0xcf74('0x9b'));_0x2e51cf[_0xcf74('0x44')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2e51cf[_0xcf74('0x44')](_0xcf74('0x9c'),_0xcf74('0x9d'));_0x2e51cf['field'](_0xcf74('0x9e'));_0x2e51cf[_0xcf74('0x44')](_0xcf74('0x9f'),'Contact.firstName');_0x2e51cf[_0xcf74('0x44')](_0xcf74('0xa0'),'Contact.lastName');_0x2e51cf[_0xcf74('0x44')]('c.email',_0xcf74('0xa1'));_0x2e51cf['field'](_0xcf74('0xa2'),_0xcf74('0xa3'));_0x2e51cf[_0xcf74('0x44')]('c.mobile',_0xcf74('0xa4'));_0x2e51cf['field'](_0xcf74('0xa5'),_0xcf74('0xa6'));_0x2e51cf[_0xcf74('0x44')](_0xcf74('0xa7'),_0xcf74('0xa8'));_0x2e51cf[_0xcf74('0x44')](_0xcf74('0xa9'),_0xcf74('0xaa'));_0x2e51cf[_0xcf74('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xcf74('0x2e'));}if(_0x32094a[_0xcf74('0x1f')])_0x2e51cf[_0xcf74('0x1f')](_0x32094a[_0xcf74('0x1f')]);if(_0x32094a[_0xcf74('0x21')])_0x2e51cf[_0xcf74('0x21')](_0x32094a['offset']);return db[_0xcf74('0x95')][_0xcf74('0x37')](_0x2e51cf[_0xcf74('0x96')](),_0x5298fc);})[_0xcf74('0x28')](function(_0xf8627c){if(_0xf8627c[_0xcf74('0x3c')]>0x0)_0x3f1e6c[_0xcf74('0x41')](_0xcf74('0xab'),_[_0xcf74('0x2d')](_0xf8627c,'id'));return db[_0xcf74('0x95')]['query'](_0x3f1e6c[_0xcf74('0x96')](),_0x5298fc)['then'](function(_0x2cd1f4){var _0x38ab69=_[_0xcf74('0xac')](_0x2cd1f4,_0xcf74('0xad'));var _0x3106ec=[];_0xf8627c[_0xcf74('0x30')](function(_0x27dce4){_0x3106ec['push'](updateFaxInteraction(_0x27dce4,_0x287dde,_0x38ab69));});return BPromise[_0xcf74('0xae')](_0x3106ec);});});})[_0xcf74('0x28')](function(_0x37e0cf){_0x4d4a3a[_0xcf74('0xaf')]=_0x37e0cf;return _0x4d4a3a;})[_0xcf74('0x28')](respondWithFilteredResult(_0x5cea1c,_0x32094a))[_0xcf74('0xb0')](handleError(_0x5cea1c,null));};exports[_0xcf74('0xb1')]=function(_0x5cacdc,_0x4c044e){var _0x54c30c={'raw':![],'where':{'id':_0x5cacdc[_0xcf74('0xb2')]['id']}},_0x51a6c5={};_0x51a6c5['model']=_['keys'](db[_0xcf74('0x99')][_0xcf74('0x33')]);_0x51a6c5['query']=_['keys'](_0x5cacdc[_0xcf74('0x37')]);_0x51a6c5[_0xcf74('0x38')]=_[_0xcf74('0x39')](_0x51a6c5['model'],_0x51a6c5['query']);_0x54c30c[_0xcf74('0x3a')]=_[_0xcf74('0x39')](_0x51a6c5[_0xcf74('0x35')],qs[_0xcf74('0x3b')](_0x5cacdc[_0xcf74('0x37')][_0xcf74('0x3b')]));_0x54c30c[_0xcf74('0x3a')]=_0x54c30c[_0xcf74('0x3a')][_0xcf74('0x3c')]?_0x54c30c['attributes']:_0x51a6c5[_0xcf74('0x35')];if(_0x5cacdc[_0xcf74('0x37')]['includeAll']){_0x54c30c[_0xcf74('0xb3')]=[{'all':!![]}];}_0x54c30c=_[_0xcf74('0x98')]({},_0x54c30c,_0x5cacdc['options']);return db[_0xcf74('0x99')][_0xcf74('0x64')](_0x54c30c)[_0xcf74('0x28')](handleEntityNotFound(_0x4c044e,null))['then'](respondWithResult(_0x4c044e,null))[_0xcf74('0xb0')](handleError(_0x4c044e,null));};exports[_0xcf74('0xb4')]=function(_0x421a69,_0x32ae40){return db['FaxInteraction'][_0xcf74('0xb4')](_0x421a69[_0xcf74('0x6d')],{})[_0xcf74('0x28')](respondWithResult(_0x32ae40,0xc9))[_0xcf74('0xb0')](handleError(_0x32ae40,null));};exports[_0xcf74('0xb5')]=function(_0x45498c,_0x461b0e){if(_0x45498c['body']['id']){delete _0x45498c[_0xcf74('0x6d')]['id'];}return db[_0xcf74('0x99')]['find']({'where':{'id':_0x45498c[_0xcf74('0xb2')]['id']}})['then'](handleEntityNotFound(_0x461b0e,null))[_0xcf74('0x28')](saveUpdates(_0x45498c[_0xcf74('0x6d')],null))[_0xcf74('0x28')](respondWithResult(_0x461b0e,null))[_0xcf74('0xb0')](handleError(_0x461b0e,null));};exports['destroy']=function(_0x3a0a9e,_0x29f56c){return db[_0xcf74('0x99')]['find']({'where':{'id':_0x3a0a9e[_0xcf74('0xb2')]['id']}})[_0xcf74('0x28')](handleEntityNotFound(_0x29f56c,null))[_0xcf74('0x28')](removeEntity(_0x29f56c,null))[_0xcf74('0xb0')](handleError(_0x29f56c,null));};exports[_0xcf74('0xb6')]=function(_0x4b4d6a,_0x4d4d0d){return db[_0xcf74('0x99')]['describe']()[_0xcf74('0x28')](respondWithResult(_0x4d4d0d,null))[_0xcf74('0xb0')](handleError(_0x4d4d0d,null));};exports['addMessage']=function(_0x52a239,_0x34879d,_0x8fedf6){return db['FaxMessage'][_0xcf74('0x64')]({'where':{'id':_0x52a239[_0xcf74('0xb2')]['id']}})[_0xcf74('0x28')](handleEntityNotFound(_0x34879d,null))[_0xcf74('0x28')](function(_0x28d636){if(_0x28d636){return _0x28d636[_0xcf74('0xb7')](_0x52a239[_0xcf74('0x6d')]['ids'],_[_0xcf74('0xb8')](_0x52a239[_0xcf74('0x6d')],[_0xcf74('0xb9'),'id'])||{});}})[_0xcf74('0x28')](respondWithResult(_0x34879d,null))[_0xcf74('0xb0')](handleError(_0x34879d,null));};exports[_0xcf74('0xba')]=function(_0x46ac8c,_0x58706e,_0x23ffd2){var _0x569fa1={'raw':![],'where':{}};var _0x63583a={};var _0x33707b={'count':0x0,'rows':[]};return db[_0xcf74('0x99')][_0xcf74('0xbb')]({'where':{'id':_0x46ac8c[_0xcf74('0xb2')]['id']}})[_0xcf74('0x28')](handleEntityNotFound(_0x58706e,null))[_0xcf74('0x28')](function(_0x25dfe1){if(_0x25dfe1){_0x63583a['model']=_[_0xcf74('0x36')](db[_0xcf74('0xbc')]['rawAttributes']);_0x63583a[_0xcf74('0x37')]=_[_0xcf74('0x36')](_0x46ac8c[_0xcf74('0x37')]);_0x63583a[_0xcf74('0x38')]=_[_0xcf74('0x39')](_0x63583a['model'],_0x63583a['query']);_0x569fa1[_0xcf74('0x3a')]=_[_0xcf74('0x39')](_0x63583a[_0xcf74('0x35')],qs['fields'](_0x46ac8c['query'][_0xcf74('0x3b')]));_0x569fa1[_0xcf74('0x3a')]=_0x569fa1[_0xcf74('0x3a')][_0xcf74('0x3c')]?_0x569fa1['attributes']:_0x63583a['model'];if(!_0x46ac8c[_0xcf74('0x37')][_0xcf74('0x3d')]('nolimit')){_0x569fa1[_0xcf74('0x1f')]=qs[_0xcf74('0x1f')](_0x46ac8c[_0xcf74('0x37')][_0xcf74('0x1f')]);_0x569fa1[_0xcf74('0x21')]=qs[_0xcf74('0x21')](_0x46ac8c[_0xcf74('0x37')][_0xcf74('0x21')]);}_0x569fa1[_0xcf74('0x3f')]=qs[_0xcf74('0x40')](_0x46ac8c['query'][_0xcf74('0x40')]);_0x569fa1[_0xcf74('0x41')]=qs['filters'](_[_0xcf74('0x42')](_0x46ac8c[_0xcf74('0x37')],_0x63583a[_0xcf74('0x38')]));_0x569fa1[_0xcf74('0x41')]['FaxInteractionId']=_0x25dfe1['id'];if(_0x46ac8c[_0xcf74('0x37')][_0xcf74('0x82')]){_0x569fa1[_0xcf74('0x41')]=_[_0xcf74('0x98')](_0x569fa1[_0xcf74('0x41')],{'$or':_[_0xcf74('0x2d')](_0x569fa1['attributes'],function(_0x33dad8){var _0x5aac6b={};_0x5aac6b[_0x33dad8]={'$like':'%'+_0x46ac8c[_0xcf74('0x37')][_0xcf74('0x82')]+'%'};return _0x5aac6b;})});}if(_0x46ac8c[_0xcf74('0x37')]['$gte']){var _0x33747b=_0x46ac8c[_0xcf74('0x37')][_0xcf74('0x75')][_0xcf74('0x60')](',');var _0x410fd9={};_0x410fd9[_0x33747b[0x0]]={'$gte':moment(_0x33747b[0x1])[_0xcf74('0xbd')](_0xcf74('0xbe'))};_0x569fa1[_0xcf74('0x41')]=_[_0xcf74('0x98')](_0x569fa1[_0xcf74('0x41')],_0x410fd9);}_0x569fa1=_['merge']({},_0x569fa1,_0x46ac8c[_0xcf74('0xbf')]);return db[_0xcf74('0xbc')][_0xcf74('0x20')]({'where':_0x569fa1[_0xcf74('0x41')]})[_0xcf74('0x28')](function(_0x7ce6c2){_0x33707b[_0xcf74('0x20')]=_0x7ce6c2;if(_0x46ac8c[_0xcf74('0x37')][_0xcf74('0xc0')]){_0x569fa1[_0xcf74('0xb3')]=[{'all':!![]}];}return db[_0xcf74('0xbc')]['findAll'](_0x569fa1);})[_0xcf74('0x28')](function(_0xe9e98e){_0x33707b[_0xcf74('0xaf')]=_0xe9e98e;return _0x33707b;});}})[_0xcf74('0x28')](respondWithFilteredResult(_0x58706e,_0x569fa1))['catch'](handleError(_0x58706e,null));};exports[_0xcf74('0xc1')]=function(_0x4e6f94,_0x5971d4,_0x307b54){return db[_0xcf74('0x99')][_0xcf74('0x64')]({'where':{'id':_0x4e6f94[_0xcf74('0xb2')]['id']}})[_0xcf74('0x28')](handleEntityNotFound(_0x5971d4,null))[_0xcf74('0x28')](function(_0x449b34){if(_0x449b34){return _0x449b34[_0xcf74('0xc2')](_0x4e6f94[_0xcf74('0x6d')]['ids'],_[_0xcf74('0xb8')](_0x4e6f94['body'],[_0xcf74('0xb9'),'id'])||{})[_0xcf74('0xc3')](function(){return db['Tag'][_0xcf74('0xc4')]({'attributes':['id','name',_0xcf74('0x45')],'where':{'id':_0x4e6f94[_0xcf74('0x6d')][_0xcf74('0xb9')]}});})[_0xcf74('0x28')](function(_0x42b493){socket[_0xcf74('0xc5')](_0xcf74('0xc6'),{'id':Number(_0x4e6f94[_0xcf74('0xb2')]['id']),'tags':_0x42b493||[]});return{'id':Number(_0x4e6f94['params']['id']),'tags':_0x42b493||[]};});}})[_0xcf74('0x28')](respondWithResult(_0x5971d4,null))['catch'](handleError(_0x5971d4,null));};exports[_0xcf74('0xc7')]=function(_0x4e242a,_0x2fc65f,_0x4848eb){return db[_0xcf74('0x99')][_0xcf74('0x64')]({'where':{'id':_0x4e242a[_0xcf74('0xb2')]['id']}})[_0xcf74('0x28')](handleEntityNotFound(_0x2fc65f,null))[_0xcf74('0x28')](function(_0x73953b){if(_0x73953b){return _0x73953b[_0xcf74('0xc7')](_0x4e242a[_0xcf74('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x2fc65f,null))[_0xcf74('0xb0')](handleError(_0x2fc65f,null));};exports[_0xcf74('0xc8')]=function(_0x25ded4,_0x51d2e0){var _0x9ec52d=moment()[_0xcf74('0xc9')]()[_0xcf74('0x96')]();var _0x2b18ff=path[_0xcf74('0xca')](config['root'],_0xcf74('0xcb'),_0xcf74('0xcc'),_0xcf74('0xcd'));var _0x45fb4c=path[_0xcf74('0xca')](config[_0xcf74('0xce')],_0xcf74('0xcb'),_0xcf74('0xcc'),_0xcf74('0xcf'));var _0x1fc7bb=path['join'](_0x2b18ff,_0x9ec52d);var _0x1ad9e0=util['format']('transcript-%d-%s.zip',_0x25ded4['params']['id'],_0x9ec52d);var _0x502f5a=path[_0xcf74('0xca')](_0x2b18ff,_0x1ad9e0);var _0x3b3ce3=[];_0x3b3ce3['push']({'model':db[_0xcf74('0xd0')],'as':_0xcf74('0xd0'),'raw':!![]});var _0x554962=[{'model':db[_0xcf74('0xbc')],'as':_0xcf74('0xd1'),'attributes':['id',_0xcf74('0x6d'),_0xcf74('0x74')],'include':_0x3b3ce3}];return db[_0xcf74('0x99')][_0xcf74('0x64')]({'where':{'id':_0x25ded4['params']['id']},'include':_0x554962})[_0xcf74('0x28')](handleEntityNotFound(_0x51d2e0,null))[_0xcf74('0x28')](function(_0x34e03f){if(_0x34e03f&&_0x34e03f['Messages']){var _0x28a967=_0x34e03f[_0xcf74('0xd2')]({'plain':!![]});fs[_0xcf74('0xd3')](_0x1fc7bb);for(var _0x44f7e0=0x0;_0x44f7e0<_0x28a967['Messages']['length'];_0x44f7e0++){var _0x3dcc2c=_0x28a967['Messages'][_0x44f7e0]['Attachment'];if(_0x3dcc2c){var _0x45c869=path[_0xcf74('0xca')](_0x45fb4c,_0x3dcc2c[_0xcf74('0xd4')]);if(fs[_0xcf74('0xd5')](_0x45c869)){fs[_0xcf74('0xd6')](_0x45c869)[_0xcf74('0xd7')](fs[_0xcf74('0xd8')](path[_0xcf74('0xca')](_0x1fc7bb,_0x3dcc2c[_0xcf74('0xd4')])));}}}return BPromise[_0xcf74('0x8f')]()['then'](function(){return new BPromise(function(_0x54b772,_0xcad3d0){zipdir(_0x1fc7bb,{'saveTo':_0x502f5a},function(_0x50172e,_0x1a996b){if(_0x50172e)return _0xcad3d0(_0x50172e);return _0x54b772(_0x1a996b);});})['then'](function(){return new BPromise(function(_0x130859,_0x60d514){rimraf(_0x1fc7bb,function(_0x3cd69c){if(_0x3cd69c)_0x60d514(_0x3cd69c);return _0x130859();});});})[_0xcf74('0x28')](function(){return _0x51d2e0[_0xcf74('0xc8')](_0x502f5a,_0x1ad9e0,function(_0x24ae25){if(_0x24ae25){console[_0xcf74('0xd9')](_0xcf74('0xda'),_0x24ae25);}else{fs[_0xcf74('0xdb')](_0x502f5a);}});});});}else{return _0x51d2e0[_0xcf74('0x29')](0xc8);}})[_0xcf74('0xb0')](handleError(_0x51d2e0,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f6d6f59..9966d4f 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 _0x7d53=['FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hook','exports','events'];(function(_0x152ae2,_0x45c7b6){var _0x114100=function(_0x404368){while(--_0x404368){_0x152ae2['push'](_0x152ae2['shift']());}};_0x114100(++_0x45c7b6);}(_0x7d53,0x142));var _0x37d5=function(_0x151700,_0x347a4f){_0x151700=_0x151700-0x0;var _0x44c3e0=_0x7d53[_0x151700];return _0x44c3e0;};'use strict';var EventEmitter=require(_0x37d5('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x37d5('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x37d5('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x37d5('0x3')](0x0);var events={'afterCreate':_0x37d5('0x4'),'afterUpdate':_0x37d5('0x5'),'afterDestroy':_0x37d5('0x6')};function emitEvent(_0x4f35f7){return function(_0x1f4cd9,_0x1acad7,_0x410a26){_0x1f4cd9[_0x37d5('0x7')]({'attributes':['id'],'raw':!![]})[_0x37d5('0x8')](function(_0x41a86b){_0x1f4cd9[_0x37d5('0x9')](_0x37d5('0xa'),_0x41a86b['map'](function(_0x3e0f38){return{'id':_0x3e0f38['id']};}));return FaxMessage[_0x37d5('0xb')]({'where':{'FaxInteractionId':_0x1f4cd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x37d5('0x8')](function(_0x3e5358){_0x1f4cd9[_0x37d5('0x9')](_0x37d5('0xc'),_0x3e5358[_0x37d5('0xd')]);FaxInteractionEvents['emit'](_0x4f35f7+':'+_0x1f4cd9['id'],_0x1f4cd9);FaxInteractionEvents[_0x37d5('0xe')](_0x4f35f7,_0x1f4cd9);_0x410a26(null);})['catch'](_0x410a26(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x37d5('0xf')](e,emitEvent(event));}}module[_0x37d5('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xa4fa=['setDataValue','Users','findAll','length','emit','exports','events','../../mysqldb','FaxMessage','update','getUsers','then'];(function(_0x4b8ff5,_0x3f74a0){var _0x5dd0ca=function(_0x137338){while(--_0x137338){_0x4b8ff5['push'](_0x4b8ff5['shift']());}};_0x5dd0ca(++_0x3f74a0);}(_0xa4fa,0x16e));var _0xaa4f=function(_0x2ebbe2,_0x27aa3f){_0x2ebbe2=_0x2ebbe2-0x0;var _0x2c0a75=_0xa4fa[_0x2ebbe2];return _0x2c0a75;};'use strict';var EventEmitter=require(_0xaa4f('0x0'));var FaxInteraction=require(_0xaa4f('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xaa4f('0x1'))['db'][_0xaa4f('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa4f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x46f14f){return function(_0x3f302d,_0x2b02e7,_0x149ed9){_0x3f302d[_0xaa4f('0x4')]({'attributes':['id'],'raw':!![]})[_0xaa4f('0x5')](function(_0x332cf6){_0x3f302d[_0xaa4f('0x6')](_0xaa4f('0x7'),_0x332cf6['map'](function(_0x13908c){return{'id':_0x13908c['id']};}));return FaxMessage[_0xaa4f('0x8')]({'where':{'FaxInteractionId':_0x3f302d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa4f('0x5')](function(_0x390fc0){_0x3f302d[_0xaa4f('0x6')]('unreadMessages',_0x390fc0[_0xaa4f('0x9')]);FaxInteractionEvents[_0xaa4f('0xa')](_0x46f14f+':'+_0x3f302d['id'],_0x3f302d);FaxInteractionEvents[_0xaa4f('0xa')](_0x46f14f,_0x3f302d);_0x149ed9(null);})['catch'](_0x149ed9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xaa4f('0xb')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e49b237..9d76f60 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 _0xebc0=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','fax_interactions'];(function(_0x2b2739,_0x2947c8){var _0x253c3e=function(_0x2b0725){while(--_0x2b0725){_0x2b2739['push'](_0x2b2739['shift']());}};_0x253c3e(++_0x2947c8);}(_0xebc0,0xe5));var _0x0ebc=function(_0x3faca7,_0x3753e9){_0x3faca7=_0x3faca7-0x0;var _0x3a4594=_0xebc0[_0x3faca7];return _0x3a4594;};'use strict';var _=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var logger=require(_0x0ebc('0x2'))('api');var moment=require(_0x0ebc('0x3'));var BPromise=require(_0x0ebc('0x4'));var rp=require(_0x0ebc('0x5'));var fs=require('fs');var path=require(_0x0ebc('0x6'));var rimraf=require(_0x0ebc('0x7'));var config=require(_0x0ebc('0x8'));var attributes=require(_0x0ebc('0x9'));module['exports']=function(_0x5dc144,_0x11b805){return _0x5dc144['define']('FaxInteraction',attributes,{'tableName':_0x0ebc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30d60c,_0x4e301d,_0x5bed1d){if(_0x30d60c['changed'](_0x0ebc('0xb'))){_0x30d60c[_0x0ebc('0xc')]=moment()[_0x0ebc('0xd')](_0x0ebc('0xe'));}_0x5bed1d(null,_0x30d60c);}}});}; \ No newline at end of file +var _0xfad1=['format','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','closedAt'];(function(_0x598191,_0x5152fd){var _0x91295f=function(_0x309daf){while(--_0x309daf){_0x598191['push'](_0x598191['shift']());}};_0x91295f(++_0x5152fd);}(_0xfad1,0xd3));var _0x1fad=function(_0x325f25,_0x2102e2){_0x325f25=_0x325f25-0x0;var _0x25a198=_0xfad1[_0x325f25];return _0x25a198;};'use strict';var _=require('lodash');var util=require(_0x1fad('0x0'));var logger=require(_0x1fad('0x1'))('api');var moment=require(_0x1fad('0x2'));var BPromise=require(_0x1fad('0x3'));var rp=require(_0x1fad('0x4'));var fs=require('fs');var path=require(_0x1fad('0x5'));var rimraf=require(_0x1fad('0x6'));var config=require('../../config/environment');var attributes=require(_0x1fad('0x7'));module[_0x1fad('0x8')]=function(_0x56aac3,_0x5f4a4c){return _0x56aac3[_0x1fad('0x9')](_0x1fad('0xa'),attributes,{'tableName':_0x1fad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x453b97,_0x173fff,_0xcf6f4f){if(_0x453b97['changed'](_0x1fad('0xc'))){_0x453b97[_0x1fad('0xd')]=moment()[_0x1fad('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xcf6f4f(null,_0x453b97);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1592892..0ce233f 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 _0x9c9e=['result','catch','UpdateFaxInteraction','FaxInteraction','body','options','attributes','limit','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s'];(function(_0x467fc7,_0x473d4b){var _0x4d06aa=function(_0x2a29fd){while(--_0x2a29fd){_0x467fc7['push'](_0x467fc7['shift']());}};_0x4d06aa(++_0x473d4b);}(_0x9c9e,0x1e8));var _0xe9c9=function(_0x1c1bba,_0x1702b4){_0x1c1bba=_0x1c1bba-0x0;var _0x3e3915=_0x9c9e[_0x1c1bba];return _0x3e3915;};'use strict';var _=require(_0xe9c9('0x0'));var util=require(_0xe9c9('0x1'));var moment=require(_0xe9c9('0x2'));var BPromise=require(_0xe9c9('0x3'));var rs=require(_0xe9c9('0x4'));var fs=require('fs');var Redis=require(_0xe9c9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9c9('0x6'));var logger=require(_0xe9c9('0x7'))(_0xe9c9('0x8'));var config=require(_0xe9c9('0x9'));var jayson=require(_0xe9c9('0xa'));var client=jayson[_0xe9c9('0xb')][_0xe9c9('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xe9c9('0xd'),'port':0x18eb});var socket=require(_0xe9c9('0xe'))(new Redis(config[_0xe9c9('0xf')]));require(_0xe9c9('0x10'))[_0xe9c9('0x11')](socket);function respondWithRpcPromise(_0x280d7b,_0x24cf91,_0x54b4ef){return new BPromise(function(_0xd2e4e6,_0x7934ae){return client['request'](_0x280d7b,_0x54b4ef)[_0xe9c9('0x12')](function(_0x4c52b5){logger[_0xe9c9('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x24cf91,_0xe9c9('0x14'));logger[_0xe9c9('0x15')](_0xe9c9('0x16'),_0x24cf91,'request\x20sent',JSON[_0xe9c9('0x17')](_0x4c52b5));if(_0x4c52b5['error']){if(_0x4c52b5[_0xe9c9('0x18')][_0xe9c9('0x19')]===0x1f4){logger[_0xe9c9('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x24cf91,_0x4c52b5[_0xe9c9('0x18')][_0xe9c9('0x1a')]);return _0x7934ae(_0x4c52b5[_0xe9c9('0x18')][_0xe9c9('0x1a')]);}logger[_0xe9c9('0x18')](_0xe9c9('0x1b'),_0x24cf91,_0x4c52b5[_0xe9c9('0x18')]['message']);return _0xd2e4e6(_0x4c52b5['error'][_0xe9c9('0x1a')]);}else{logger[_0xe9c9('0x13')](_0xe9c9('0x1b'),_0x24cf91,'request\x20sent');_0xd2e4e6(_0x4c52b5[_0xe9c9('0x1c')][_0xe9c9('0x1a')]);}})[_0xe9c9('0x1d')](function(_0x5a1f0a){logger[_0xe9c9('0x18')](_0xe9c9('0x1b'),_0x24cf91,_0x5a1f0a);_0x7934ae(_0x5a1f0a);});});}exports[_0xe9c9('0x1e')]=function(_0x5ed829){var _0x323070=this;return new Promise(function(_0x1c079f,_0x194b2d){return db[_0xe9c9('0x1f')]['update'](_0x5ed829[_0xe9c9('0x20')],{'raw':_0x5ed829[_0xe9c9('0x21')]?_0x5ed829[_0xe9c9('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ed829['options']?_0x5ed829[_0xe9c9('0x21')]['where']||null:null,'attributes':_0x5ed829[_0xe9c9('0x21')]?_0x5ed829[_0xe9c9('0x21')][_0xe9c9('0x22')]||null:null,'limit':_0x5ed829[_0xe9c9('0x21')]?_0x5ed829[_0xe9c9('0x21')][_0xe9c9('0x23')]||null:null})[_0xe9c9('0x12')](function(_0x5be74e){logger[_0xe9c9('0x13')](_0xe9c9('0x1e'),_0x5ed829);logger['debug']('UpdateFaxInteraction',_0x5ed829,JSON[_0xe9c9('0x17')](_0x5be74e));_0x1c079f(_0x5be74e);})[_0xe9c9('0x1d')](function(_0x1d473d){logger['error'](_0xe9c9('0x1e'),_0x1d473d[_0xe9c9('0x1a')],_0x5ed829);_0x194b2d(_0x323070[_0xe9c9('0x18')](0x1f4,_0x1d473d[_0xe9c9('0x1a')]));});});};exports[_0xe9c9('0x24')]=function(_0x253004){return new Promise(function(_0xacdf0b,_0x452241){return db['FaxInteraction'][_0xe9c9('0x25')]({'where':_0x253004[_0xe9c9('0x21')]?_0x253004['options'][_0xe9c9('0x26')]||null:null})[_0xe9c9('0x12')](function(_0x23d918){if(_0x23d918){return _0x23d918[_0xe9c9('0x27')](_0x253004[_0xe9c9('0x20')]['ids'],_['omit'](_0x253004['body'],[_0xe9c9('0x28'),'id'])||{});}})[_0xe9c9('0x29')](function(_0x3bf06e){logger[_0xe9c9('0x13')](_0xe9c9('0x2a'),_0x253004);logger['debug']('AddTags',_0x253004,JSON[_0xe9c9('0x17')](_0x3bf06e));_0xacdf0b(_0x3bf06e);})[_0xe9c9('0x1d')](function(_0x38728f){logger[_0xe9c9('0x18')]('AddTags',_0x38728f[_0xe9c9('0x1a')],_0x253004);_0x452241(_this[_0xe9c9('0x18')](0x1f4,_0x38728f[_0xe9c9('0x1a')]));});});}; \ No newline at end of file +var _0x6800=['raw','where','attributes','limit','stringify','catch','find','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options'];(function(_0x3a28de,_0x4481bd){var _0x727cf0=function(_0x5a479c){while(--_0x5a479c){_0x3a28de['push'](_0x3a28de['shift']());}};_0x727cf0(++_0x4481bd);}(_0x6800,0x101));var _0x0680=function(_0xd24321,_0x5aac96){_0xd24321=_0xd24321-0x0;var _0x2deac0=_0x6800[_0xd24321];return _0x2deac0;};'use strict';var _=require(_0x0680('0x0'));var util=require(_0x0680('0x1'));var moment=require(_0x0680('0x2'));var BPromise=require(_0x0680('0x3'));var rs=require(_0x0680('0x4'));var fs=require('fs');var Redis=require(_0x0680('0x5'));var db=require(_0x0680('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0680('0x7'));var config=require(_0x0680('0x8'));var jayson=require(_0x0680('0x9'));var client=jayson[_0x0680('0xa')][_0x0680('0xb')]({'port':0x232a});config[_0x0680('0xc')]=_['defaults'](config['redis'],{'host':_0x0680('0xd'),'port':0x18eb});var socket=require(_0x0680('0xe'))(new Redis(config[_0x0680('0xc')]));require(_0x0680('0xf'))['register'](socket);function respondWithRpcPromise(_0x4b1420,_0x3e0760,_0x258c8d){return new BPromise(function(_0x3757eb,_0x3bd91d){return client['request'](_0x4b1420,_0x258c8d)[_0x0680('0x10')](function(_0x51385c){logger[_0x0680('0x11')](_0x0680('0x12'),_0x3e0760,_0x0680('0x13'));logger[_0x0680('0x14')](_0x0680('0x15'),_0x3e0760,_0x0680('0x13'),JSON['stringify'](_0x51385c));if(_0x51385c[_0x0680('0x16')]){if(_0x51385c['error'][_0x0680('0x17')]===0x1f4){logger[_0x0680('0x16')](_0x0680('0x12'),_0x3e0760,_0x51385c[_0x0680('0x16')]['message']);return _0x3bd91d(_0x51385c[_0x0680('0x16')]['message']);}logger[_0x0680('0x16')](_0x0680('0x12'),_0x3e0760,_0x51385c['error'][_0x0680('0x18')]);return _0x3757eb(_0x51385c[_0x0680('0x16')][_0x0680('0x18')]);}else{logger[_0x0680('0x11')](_0x0680('0x12'),_0x3e0760,_0x0680('0x13'));_0x3757eb(_0x51385c[_0x0680('0x19')][_0x0680('0x18')]);}})['catch'](function(_0xf4bc2d){logger[_0x0680('0x16')](_0x0680('0x12'),_0x3e0760,_0xf4bc2d);_0x3bd91d(_0xf4bc2d);});});}exports[_0x0680('0x1a')]=function(_0x1c6dc0){var _0x319ac0=this;return new Promise(function(_0x30a856,_0x539c46){return db[_0x0680('0x1b')][_0x0680('0x1c')](_0x1c6dc0['body'],{'raw':_0x1c6dc0['options']?_0x1c6dc0[_0x0680('0x1d')][_0x0680('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c6dc0[_0x0680('0x1d')]?_0x1c6dc0[_0x0680('0x1d')][_0x0680('0x1f')]||null:null,'attributes':_0x1c6dc0[_0x0680('0x1d')]?_0x1c6dc0[_0x0680('0x1d')][_0x0680('0x20')]||null:null,'limit':_0x1c6dc0[_0x0680('0x1d')]?_0x1c6dc0[_0x0680('0x1d')][_0x0680('0x21')]||null:null})['then'](function(_0x30dd3c){logger[_0x0680('0x11')](_0x0680('0x1a'),_0x1c6dc0);logger[_0x0680('0x14')]('UpdateFaxInteraction',_0x1c6dc0,JSON[_0x0680('0x22')](_0x30dd3c));_0x30a856(_0x30dd3c);})[_0x0680('0x23')](function(_0x147c54){logger[_0x0680('0x16')](_0x0680('0x1a'),_0x147c54[_0x0680('0x18')],_0x1c6dc0);_0x539c46(_0x319ac0[_0x0680('0x16')](0x1f4,_0x147c54['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x4e3be2){return new Promise(function(_0x5d859a,_0x5ab078){return db['FaxInteraction'][_0x0680('0x24')]({'where':_0x4e3be2[_0x0680('0x1d')]?_0x4e3be2[_0x0680('0x1d')][_0x0680('0x1f')]||null:null})[_0x0680('0x10')](function(_0x157383){if(_0x157383){return _0x157383['addTags'](_0x4e3be2[_0x0680('0x25')][_0x0680('0x26')],_['omit'](_0x4e3be2[_0x0680('0x25')],[_0x0680('0x26'),'id'])||{});}})[_0x0680('0x27')](function(_0x5e1941){logger[_0x0680('0x11')]('AddTags',_0x4e3be2);logger[_0x0680('0x14')](_0x0680('0x28'),_0x4e3be2,JSON['stringify'](_0x5e1941));_0x5d859a(_0x5e1941);})['catch'](function(_0x418bf0){logger[_0x0680('0x16')](_0x0680('0x28'),_0x418bf0['message'],_0x4e3be2);_0x5ab078(_this[_0x0680('0x16')](0x1f4,_0x418bf0[_0x0680('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2cfedb5..1193c9e 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 _0x4af8=['register','length','./faxInteraction.events','remove','update','emit','removeListener'];(function(_0x1b640f,_0x215390){var _0x560770=function(_0x5335ba){while(--_0x5335ba){_0x1b640f['push'](_0x1b640f['shift']());}};_0x560770(++_0x215390);}(_0x4af8,0x113));var _0x84af=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x4af8[_0x5783f4];return _0x28e380;};'use strict';var FaxInteractionEvents=require(_0x84af('0x0'));var events=['save',_0x84af('0x1'),_0x84af('0x2')];function createListener(_0x8287c,_0x47a337){return function(_0x354f53){_0x47a337[_0x84af('0x3')](_0x8287c,_0x354f53);};}function removeListener(_0x3c53a3,_0x5519ff){return function(){FaxInteractionEvents[_0x84af('0x4')](_0x3c53a3,_0x5519ff);};}exports[_0x84af('0x5')]=function(_0x8ac3f9){for(var _0x5f0288=0x0,_0x500561=events[_0x84af('0x6')];_0x5f0288<_0x500561;_0x5f0288++){var _0x343ff3=events[_0x5f0288];var _0x269016=createListener('faxInteraction:'+_0x343ff3,_0x8ac3f9);FaxInteractionEvents['on'](_0x343ff3,_0x269016);}}; \ No newline at end of file +var _0xee3d=['./faxInteraction.events','save','update','emit','removeListener','register','length','faxInteraction:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee3d,0x1f0));var _0xdee3=function(_0x40f527,_0x585a5d){_0x40f527=_0x40f527-0x0;var _0x242121=_0xee3d[_0x40f527];return _0x242121;};'use strict';var FaxInteractionEvents=require(_0xdee3('0x0'));var events=[_0xdee3('0x1'),'remove',_0xdee3('0x2')];function createListener(_0x325f62,_0x1d7204){return function(_0x52fd9b){_0x1d7204[_0xdee3('0x3')](_0x325f62,_0x52fd9b);};}function removeListener(_0x11c63e,_0x59bfc8){return function(){FaxInteractionEvents[_0xdee3('0x4')](_0x11c63e,_0x59bfc8);};}exports[_0xdee3('0x5')]=function(_0x9a7368){for(var _0x3da0fd=0x0,_0x2fccb7=events[_0xdee3('0x6')];_0x3da0fd<_0x2fccb7;_0x3da0fd++){var _0x2093d1=events[_0x3da0fd];var _0x412bb2=createListener(_0xdee3('0x7')+_0x2093d1,_0x9a7368);FaxInteractionEvents['on'](_0x2093d1,_0x412bb2);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b290583..1a344dd 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 _0xfbcb=['get','index','isAuthenticated','/:id','getMessages','/:id/download','download','post','/:id/messages','/:id/tags','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','tracked','destroy','delete','removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxInteraction.controller'];(function(_0x24c9a2,_0x351910){var _0x4895eb=function(_0x445f80){while(--_0x445f80){_0x24c9a2['push'](_0x24c9a2['shift']());}};_0x4895eb(++_0x351910);}(_0xfbcb,0xd0));var _0xbfbc=function(_0x50ec10,_0x44289e){_0x50ec10=_0x50ec10-0x0;var _0x1cff8c=_0xfbcb[_0x50ec10];return _0x1cff8c;};'use strict';var multer=require(_0xbfbc('0x0'));var util=require(_0xbfbc('0x1'));var path=require(_0xbfbc('0x2'));var timeout=require(_0xbfbc('0x3'));var express=require(_0xbfbc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbfbc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbfbc('0x6'));var controller=require(_0xbfbc('0x7'));router[_0xbfbc('0x8')]('/',auth['isAuthenticated'](),controller[_0xbfbc('0x9')]);router[_0xbfbc('0x8')]('/describe',auth[_0xbfbc('0xa')](),controller['describe']);router[_0xbfbc('0x8')](_0xbfbc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xbfbc('0x8')]('/:id/messages',auth[_0xbfbc('0xa')](),controller[_0xbfbc('0xc')]);router[_0xbfbc('0x8')](_0xbfbc('0xd'),auth[_0xbfbc('0xa')](),controller[_0xbfbc('0xe')]);router[_0xbfbc('0xf')]('/',auth[_0xbfbc('0xa')](),controller['create']);router[_0xbfbc('0xf')](_0xbfbc('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0xbfbc('0xf')](_0xbfbc('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0xbfbc('0x12'),_0xbfbc('0x13')),controller[_0xbfbc('0x14')]);router['put'](_0xbfbc('0xb'),auth[_0xbfbc('0xa')](),interaction['tracked'](_0xbfbc('0x12'),_0xbfbc('0x15')),controller[_0xbfbc('0x16')]);router['delete'](_0xbfbc('0xb'),auth[_0xbfbc('0xa')](),interaction[_0xbfbc('0x17')](_0xbfbc('0x12'),'faxinteraction:destroy'),controller[_0xbfbc('0x18')]);router[_0xbfbc('0x19')](_0xbfbc('0x11'),auth['isAuthenticated'](),controller[_0xbfbc('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x85d5=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags'];(function(_0x486605,_0x7d40f7){var _0x27e0f7=function(_0x452df4){while(--_0x452df4){_0x486605['push'](_0x486605['shift']());}};_0x27e0f7(++_0x7d40f7);}(_0x85d5,0x1e1));var _0x585d=function(_0x4b8e13,_0x4da73b){_0x4b8e13=_0x4b8e13-0x0;var _0x54c88d=_0x85d5[_0x4b8e13];return _0x54c88d;};'use strict';var multer=require('multer');var util=require(_0x585d('0x0'));var path=require('path');var timeout=require(_0x585d('0x1'));var express=require(_0x585d('0x2'));var router=express[_0x585d('0x3')]();var fs_extra=require(_0x585d('0x4'));var auth=require(_0x585d('0x5'));var interaction=require(_0x585d('0x6'));var config=require(_0x585d('0x7'));var controller=require(_0x585d('0x8'));router[_0x585d('0x9')]('/',auth[_0x585d('0xa')](),controller['index']);router[_0x585d('0x9')]('/describe',auth[_0x585d('0xa')](),controller[_0x585d('0xb')]);router[_0x585d('0x9')](_0x585d('0xc'),auth['isAuthenticated'](),controller[_0x585d('0xd')]);router[_0x585d('0x9')](_0x585d('0xe'),auth[_0x585d('0xa')](),controller[_0x585d('0xf')]);router['get'](_0x585d('0x10'),auth[_0x585d('0xa')](),controller[_0x585d('0x11')]);router[_0x585d('0x12')]('/',auth[_0x585d('0xa')](),controller['create']);router['post'](_0x585d('0xe'),auth[_0x585d('0xa')](),controller[_0x585d('0x13')]);router['post'](_0x585d('0x14'),auth['isAuthenticated'](),interaction[_0x585d('0x15')]('fax',_0x585d('0x16')),controller[_0x585d('0x17')]);router[_0x585d('0x18')](_0x585d('0xc'),auth[_0x585d('0xa')](),interaction[_0x585d('0x15')](_0x585d('0x19'),_0x585d('0x1a')),controller[_0x585d('0x1b')]);router[_0x585d('0x1c')](_0x585d('0xc'),auth[_0x585d('0xa')](),interaction[_0x585d('0x15')](_0x585d('0x19'),_0x585d('0x1d')),controller['destroy']);router[_0x585d('0x1c')](_0x585d('0x14'),auth[_0x585d('0xa')](),controller[_0x585d('0x1e')]);module[_0x585d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index f093fd0..f70709c 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 _0x79d3=['ENUM','out','DATE','sequelize','TEXT','BOOLEAN'];(function(_0x35615a,_0x316487){var _0x3d6e88=function(_0x5c18d0){while(--_0x5c18d0){_0x35615a['push'](_0x35615a['shift']());}};_0x3d6e88(++_0x316487);}(_0x79d3,0x15f));var _0x379d=function(_0x350a01,_0x5ed763){_0x350a01=_0x350a01-0x0;var _0xc17c6b=_0x79d3[_0x350a01];return _0xc17c6b;};'use strict';var Sequelize=require(_0x379d('0x0'));module['exports']={'body':{'type':Sequelize[_0x379d('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x379d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x379d('0x3')]('in','out'),'defaultValue':_0x379d('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x379d('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x379d('0x5')]}}; \ No newline at end of file +var _0x61a5=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x5e30b2,_0x4aa8fc){var _0x556bb0=function(_0x1898b4){while(--_0x1898b4){_0x5e30b2['push'](_0x5e30b2['shift']());}};_0x556bb0(++_0x4aa8fc);}(_0x61a5,0xf0));var _0x561a=function(_0x23292a,_0x1e08ea){_0x23292a=_0x23292a-0x0;var _0x4564f2=_0x61a5[_0x23292a];return _0x4564f2;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'body':{'type':Sequelize[_0x561a('0x1')](_0x561a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x561a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x561a('0x4')]('in',_0x561a('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x561a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x561a('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index e714415..3809dd4 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 _0x7727=['motionChannel','event','EventManager','acceptmessage','FaxInteraction','RejectMessage','rejectMessage','contact','User','CmContact','findOne','Attachment','AttachmentId','SendFax','basename','download','join','server','files','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','sendStatus','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','FaxMessage','findAll','show','params','keys','include','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','format','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel'];(function(_0x18fdb9,_0x3860ce){var _0x55dba7=function(_0x5358c2){while(--_0x5358c2){_0x18fdb9['push'](_0x18fdb9['shift']());}};_0x55dba7(++_0x3860ce);}(_0x7727,0x1b7));var _0x7772=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x7727[_0x3203a1];return _0x24215e;};'use strict';var emlformat=require(_0x7772('0x0'));var rimraf=require(_0x7772('0x1'));var zipdir=require(_0x7772('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7772('0x3'));var BPromise=require(_0x7772('0x4'));var Mustache=require(_0x7772('0x5'));var util=require(_0x7772('0x6'));var path=require(_0x7772('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7772('0x8'));var fs=require('fs');var fs_extra=require(_0x7772('0x9'));var _=require(_0x7772('0xa'));var squel=require(_0x7772('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7772('0xc'));var toCsv=require(_0x7772('0xd'));var querystring=require(_0x7772('0xe'));var Papa=require(_0x7772('0xf'));var Redis=require('ioredis');var authService=require(_0x7772('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7772('0x11'));var hardwareService=require(_0x7772('0x12'));var logger=require(_0x7772('0x13'))(_0x7772('0x14'));var utils=require(_0x7772('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7772('0x16')]=_[_0x7772('0x17')](config[_0x7772('0x16')],{'host':_0x7772('0x18'),'port':0x18eb});var socket=require(_0x7772('0x19'))(new Redis(config['redis']));require(_0x7772('0x1a'))[_0x7772('0x1b')](socket);var jayson=require(_0x7772('0x1c'));var client=jayson[_0x7772('0x1d')][_0x7772('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x7772('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x526d8a,_0x10f870,_0x5301cb,_0x588cf8){return new BPromise(function(_0x31f1f0,_0x46bb4b){var _0x5c2c66=_0x588cf8||client;return _0x5c2c66['request'](_0x526d8a,_0x5301cb)[_0x7772('0x1f')](function(_0x368d85){logger['info'](_0x7772('0x20'),_0x10f870,_0x7772('0x21'));logger[_0x7772('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x10f870,_0x7772('0x21'),JSON[_0x7772('0x23')](_0x368d85));if(_0x368d85['error']){if(_0x368d85[_0x7772('0x24')][_0x7772('0x25')]===0x1f4){logger[_0x7772('0x24')](_0x7772('0x20'),_0x10f870,_0x368d85[_0x7772('0x24')]['message']);return _0x46bb4b(_0x368d85[_0x7772('0x24')][_0x7772('0x26')]);}logger[_0x7772('0x24')](_0x7772('0x20'),_0x10f870,_0x368d85['error'][_0x7772('0x26')]);return _0x31f1f0(_0x368d85[_0x7772('0x24')]['message']);}else{logger[_0x7772('0x27')]('FaxMessage,\x20%s,\x20%s',_0x10f870,_0x7772('0x21'));_0x31f1f0(_0x368d85[_0x7772('0x28')][_0x7772('0x26')]);}})[_0x7772('0x29')](function(_0x52aeab){logger['error'](_0x7772('0x20'),_0x10f870,_0x52aeab);_0x46bb4b(_0x52aeab);});});}function respondWithStatusCode(_0x5db039,_0xbba0fc){_0xbba0fc=_0xbba0fc||0xcc;return function(_0xefac53){if(_0xefac53){return _0x5db039['sendStatus'](_0xbba0fc);}return _0x5db039[_0x7772('0x2a')](_0xbba0fc)[_0x7772('0x2b')]();};}function respondWithResult(_0x3cb552,_0xeeb662){_0xeeb662=_0xeeb662||0xc8;return function(_0x16b43e){if(_0x16b43e){return _0x3cb552[_0x7772('0x2a')](_0xeeb662)[_0x7772('0x2c')](_0x16b43e);}};}function respondWithFilteredResult(_0xab7851,_0xb72837){return function(_0xf80b78){if(_0xf80b78){var _0xdb4545=typeof _0xb72837[_0x7772('0x2d')]==='undefined'&&typeof _0xb72837[_0x7772('0x2e')]===_0x7772('0x2f');var _0x2de5ae=_0xf80b78['count'];var _0xb84143=_0xdb4545?0x0:_0xb72837[_0x7772('0x2d')];var _0x1dbb13=_0xdb4545?_0xf80b78[_0x7772('0x30')]:_0xb72837['offset']+_0xb72837[_0x7772('0x2e')];var _0x309149;if(_0x1dbb13>=_0x2de5ae){_0x1dbb13=_0x2de5ae;_0x309149=0xc8;}else{_0x309149=0xce;}_0xab7851[_0x7772('0x2a')](_0x309149);return _0xab7851[_0x7772('0x31')](_0x7772('0x32'),_0xb84143+'-'+_0x1dbb13+'/'+_0x2de5ae)['json'](_0xf80b78);}return null;};}function patchUpdates(_0x27b561){return function(_0x142df4){try{jsonpatch[_0x7772('0x33')](_0x142df4,_0x27b561,!![]);}catch(_0x4e3afd){return BPromise[_0x7772('0x34')](_0x4e3afd);}return _0x142df4[_0x7772('0x35')]();};}function saveUpdates(_0x1b0c5f,_0x32583e){return function(_0x14e66c){if(_0x14e66c){return _0x14e66c[_0x7772('0x36')](_0x1b0c5f)[_0x7772('0x1f')](function(_0x5e605d){return _0x5e605d;});}return null;};}function removeEntity(_0x2dea15,_0x16bff2){return function(_0x22e39e){if(_0x22e39e){return _0x22e39e['destroy']()['then'](function(){_0x2dea15['status'](0xcc)[_0x7772('0x2b')]();});}};}function handleEntityNotFound(_0x53f9c7,_0x8435d7){return function(_0xa9f7cb){if(!_0xa9f7cb){_0x53f9c7[_0x7772('0x37')](0x194);}return _0xa9f7cb;};}function handleError(_0x558af7,_0x1e8756){_0x1e8756=_0x1e8756||0x1f4;return function(_0x745440){logger[_0x7772('0x24')](_0x745440['stack']);if(_0x745440[_0x7772('0x38')]){delete _0x745440[_0x7772('0x38')];}_0x558af7[_0x7772('0x2a')](_0x1e8756)[_0x7772('0x39')](_0x745440);};}exports[_0x7772('0x3a')]=function(_0x1ffd8f,_0x139989){var _0x20fe7e={},_0x27ad1a={},_0x35f211={'count':0x0,'rows':[]};var _0x298850=_['map'](db['FaxMessage']['rawAttributes'],function(_0x4c8842){return{'name':_0x4c8842[_0x7772('0x3b')],'type':_0x4c8842[_0x7772('0x3c')][_0x7772('0x3d')]};});_0x27ad1a[_0x7772('0x3e')]=_[_0x7772('0x3f')](_0x298850,'name');_0x27ad1a[_0x7772('0x40')]=_['keys'](_0x1ffd8f[_0x7772('0x40')]);_0x27ad1a[_0x7772('0x41')]=_[_0x7772('0x42')](_0x27ad1a[_0x7772('0x3e')],_0x27ad1a[_0x7772('0x40')]);_0x20fe7e['attributes']=_[_0x7772('0x42')](_0x27ad1a[_0x7772('0x3e')],qs[_0x7772('0x43')](_0x1ffd8f['query'][_0x7772('0x43')]));_0x20fe7e[_0x7772('0x44')]=_0x20fe7e[_0x7772('0x44')][_0x7772('0x45')]?_0x20fe7e[_0x7772('0x44')]:_0x27ad1a['model'];if(!_0x1ffd8f[_0x7772('0x40')][_0x7772('0x46')](_0x7772('0x47'))){_0x20fe7e[_0x7772('0x2e')]=qs[_0x7772('0x2e')](_0x1ffd8f['query'][_0x7772('0x2e')]);_0x20fe7e['offset']=qs[_0x7772('0x2d')](_0x1ffd8f[_0x7772('0x40')][_0x7772('0x2d')]);}_0x20fe7e[_0x7772('0x48')]=qs[_0x7772('0x49')](_0x1ffd8f[_0x7772('0x40')]['sort']);_0x20fe7e[_0x7772('0x4a')]=qs[_0x7772('0x41')](_[_0x7772('0x4b')](_0x1ffd8f[_0x7772('0x40')],_0x27ad1a[_0x7772('0x41')]),_0x298850);if(_0x1ffd8f[_0x7772('0x40')][_0x7772('0x4c')]){_0x20fe7e['where']=_[_0x7772('0x4d')](_0x20fe7e[_0x7772('0x4a')],{'$or':_[_0x7772('0x3f')](_0x298850,function(_0x79d2cd){if(_0x79d2cd['type']!==_0x7772('0x4e')){var _0x425d19={};_0x425d19[_0x79d2cd[_0x7772('0x38')]]={'$like':'%'+_0x1ffd8f[_0x7772('0x40')]['filter']+'%'};return _0x425d19;}})});}_0x20fe7e=_[_0x7772('0x4d')]({},_0x20fe7e,_0x1ffd8f[_0x7772('0x4f')]);var _0x25c2c8={'where':_0x20fe7e['where']};return db['FaxMessage'][_0x7772('0x30')](_0x25c2c8)[_0x7772('0x1f')](function(_0x1d69d9){_0x35f211['count']=_0x1d69d9;if(_0x1ffd8f['query'][_0x7772('0x50')]){_0x20fe7e['include']=[{'all':!![]}];}return db[_0x7772('0x51')][_0x7772('0x52')](_0x20fe7e);})[_0x7772('0x1f')](function(_0x422875){_0x35f211['rows']=_0x422875;return _0x35f211;})[_0x7772('0x1f')](respondWithFilteredResult(_0x139989,_0x20fe7e))['catch'](handleError(_0x139989,null));};exports[_0x7772('0x53')]=function(_0x24740b,_0x445050){var _0x589a6e={'raw':!![],'where':{'id':_0x24740b[_0x7772('0x54')]['id']}},_0x2d1d78={};_0x2d1d78[_0x7772('0x3e')]=_[_0x7772('0x55')](db[_0x7772('0x51')]['rawAttributes']);_0x2d1d78[_0x7772('0x40')]=_[_0x7772('0x55')](_0x24740b[_0x7772('0x40')]);_0x2d1d78[_0x7772('0x41')]=_['intersection'](_0x2d1d78[_0x7772('0x3e')],_0x2d1d78[_0x7772('0x40')]);_0x589a6e['attributes']=_[_0x7772('0x42')](_0x2d1d78['model'],qs[_0x7772('0x43')](_0x24740b['query']['fields']));_0x589a6e[_0x7772('0x44')]=_0x589a6e[_0x7772('0x44')]['length']?_0x589a6e[_0x7772('0x44')]:_0x2d1d78[_0x7772('0x3e')];if(_0x24740b[_0x7772('0x40')][_0x7772('0x50')]){_0x589a6e[_0x7772('0x56')]=[{'all':!![]}];}_0x589a6e=_[_0x7772('0x4d')]({},_0x589a6e,_0x24740b['options']);return db[_0x7772('0x51')][_0x7772('0x57')](_0x589a6e)[_0x7772('0x1f')](handleEntityNotFound(_0x445050,null))[_0x7772('0x1f')](respondWithResult(_0x445050,null))['catch'](handleError(_0x445050,null));};exports[_0x7772('0x36')]=function(_0x518bdf,_0x57e574){if(_0x518bdf[_0x7772('0x58')]['id']){delete _0x518bdf[_0x7772('0x58')]['id'];}return db[_0x7772('0x51')][_0x7772('0x57')]({'where':{'id':_0x518bdf['params']['id']}})[_0x7772('0x1f')](handleEntityNotFound(_0x57e574,null))[_0x7772('0x1f')](saveUpdates(_0x518bdf[_0x7772('0x58')],null))[_0x7772('0x1f')](respondWithResult(_0x57e574,null))['catch'](handleError(_0x57e574,null));};exports[_0x7772('0x59')]=function(_0xf70e31,_0x4d6451){return db[_0x7772('0x51')][_0x7772('0x57')]({'where':{'id':_0xf70e31[_0x7772('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d6451,null))['then'](removeEntity(_0x4d6451,null))['catch'](handleError(_0x4d6451,null));};exports[_0x7772('0x5a')]=function(_0x5db8be,_0x28d3ef){return db[_0x7772('0x51')][_0x7772('0x5a')]()['then'](respondWithResult(_0x28d3ef,null))[_0x7772('0x29')](handleError(_0x28d3ef,null));};var interaction_log=require(_0x7772('0x13'))(_0x7772('0x5b'));exports[_0x7772('0x5c')]=function(_0x30d7e9,_0x424a81,_0x30fcd1){var _0x530a72={'agent':{},'channel':_0x7772('0x5d')};if(_0x30d7e9[_0x7772('0x58')]['id']){delete _0x30d7e9[_0x7772('0x58')]['id'];}_0x30d7e9[_0x7772('0x58')][_0x7772('0x5e')]=!![];_0x30d7e9[_0x7772('0x58')][_0x7772('0x5f')]=moment()['format'](_0x7772('0x60'));_0x30d7e9[_0x7772('0x58')]['UserId']=_0x30d7e9[_0x7772('0x58')][_0x7772('0x61')]||_0x30d7e9[_0x7772('0x62')]['id'];_0x530a72[_0x7772('0x63')]['id']=_0x30d7e9[_0x7772('0x58')][_0x7772('0x61')];return db[_0x7772('0x51')][_0x7772('0x57')]({'where':{'id':_0x30d7e9[_0x7772('0x54')]['id'],'UserId':null}})[_0x7772('0x1f')](handleEntityNotFound(_0x424a81,null))[_0x7772('0x1f')](saveUpdates(_0x30d7e9['body'],null))[_0x7772('0x1f')](function(_0x18c3fa){if(_0x18c3fa){_0x530a72[_0x7772('0x26')]=_0x18c3fa[_0x7772('0x64')]({'plain':!![]});return db['FaxInteraction'][_0x7772('0x57')]({'where':{'id':_0x18c3fa[_0x7772('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x424a81,null))[_0x7772('0x1f')](function(_0x57499d){if(_0x57499d){return _0x57499d[_0x7772('0x36')]({'UserId':_0x30d7e9[_0x7772('0x58')]['UserId'],'read1stAt':_[_0x7772('0x66')](_0x57499d[_0x7772('0x67')])?moment()[_0x7772('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x948207){if(_0x948207){_0x530a72[_0x7772('0x69')]=_0x948207[_0x7772('0x64')]({'plain':!![]});interaction_log[_0x7772('0x27')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30d7e9['user']['id'],_0x30d7e9[_0x7772('0x62')][_0x7772('0x38')],_0x30d7e9[_0x7772('0x62')][_0x7772('0x6a')],_0x530a72[_0x7772('0x69')]['id'],_0x30d7e9['body']?JSON['stringify'](_0x30d7e9[_0x7772('0x58')]):_0x7772('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x530a72);}return null;})[_0x7772('0x1f')](function(_0x4eeab8){var _0x221b7c=_0x7772('0x6c')+_0x4eeab8[_0x7772('0x26')][_0x7772('0x6d')];return db[_0x7772('0x6e')]['query'](_0x221b7c,{'type':db[_0x7772('0x6f')][_0x7772('0x70')][_0x7772('0x71')],'raw':!![]})['then'](function(_0x189670){return _0x189670;});})[_0x7772('0x1f')](function(_0x23c309){if(_0x23c309){_0x530a72[_0x7772('0x26')]['contact']=_0x23c309[0x0];if(!_0x30d7e9[_0x7772('0x58')][_0x7772('0x61')])return;return db['User'][_0x7772('0x57')]({'where':{'id':_0x30d7e9[_0x7772('0x58')]['UserId'],'role':'agent'},'attributes':['id','name',_0x7772('0x72'),_0x7772('0x73'),_0x7772('0x74')],'raw':!![]});}return null;})[_0x7772('0x1f')](function(_0x5efe9f){if(!_0x5efe9f)return null;_0x530a72[_0x7772('0x26')][_0x7772('0x63')]=_0x5efe9f;return _0x530a72;})[_0x7772('0x1f')](function(_0xcbab05){if(_0xcbab05){if(_0x30d7e9[_0x7772('0x58')][_0x7772('0x75')]){_0x530a72['message'][_0x7772('0x76')]=util[_0x7772('0x68')](_0x7772('0x77'),_0x30d7e9['user'][_0x7772('0x38')]);_0x530a72[_0x7772('0x26')]['channel']=_0x530a72[_0x7772('0x78')];_0x530a72['message'][_0x7772('0x79')]=_0x530a72[_0x7772('0x78')];_0x530a72[_0x7772('0x26')][_0x7772('0x7a')]=_0x7772('0x5c');return respondWithRpcPromise(_0x7772('0x7b'),'EventManager',{'event':_0x7772('0x7c'),'message':_0x530a72[_0x7772('0x26')]},client9002)['then'](function(){return _0x530a72;});}return _0x530a72;}return null;})[_0x7772('0x1f')](respondWithResult(_0x424a81,null))['catch'](handleError(_0x424a81,null));};var interaction_log=require('../../config/logger')(_0x7772('0x5b'));exports['reject']=function(_0x2e4ca3,_0x27de8f,_0x4557ac){var _0x40e3d5={'agent':{},'channel':_0x7772('0x5d')};if(_0x2e4ca3['body']['id']){delete _0x2e4ca3[_0x7772('0x58')]['id'];}_0x2e4ca3[_0x7772('0x58')][_0x7772('0x61')]=_0x2e4ca3[_0x7772('0x58')][_0x7772('0x61')]||_0x2e4ca3['user']['id'];_0x40e3d5['agent']['id']=_0x2e4ca3['body'][_0x7772('0x61')];return db[_0x7772('0x51')][_0x7772('0x57')]({'where':{'id':_0x2e4ca3[_0x7772('0x54')]['id'],'UserId':null}})[_0x7772('0x1f')](handleEntityNotFound(_0x27de8f,null))[_0x7772('0x1f')](function(_0xdc9da9){if(_0xdc9da9){_0x40e3d5[_0x7772('0x26')]=_0xdc9da9[_0x7772('0x64')]({'plain':!![]});return db[_0x7772('0x7d')][_0x7772('0x57')]({'where':{'id':_0xdc9da9['FaxInteractionId']}});}return null;})[_0x7772('0x1f')](handleEntityNotFound(_0x27de8f,null))[_0x7772('0x1f')](function(_0x4c7bed){if(_0x4c7bed){_0x40e3d5['interaction']=_0x4c7bed[_0x7772('0x64')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e4ca3[_0x7772('0x62')]['id'],_0x2e4ca3['user'][_0x7772('0x38')],_0x2e4ca3['user'][_0x7772('0x6a')],_0x40e3d5[_0x7772('0x69')]['id'],_0x2e4ca3[_0x7772('0x58')]?JSON[_0x7772('0x23')](_0x2e4ca3['body']):_0x7772('0x6b'));return respondWithRpcPromise(_0x7772('0x7e'),_0x7772('0x7f'),_0x40e3d5);}return null;})[_0x7772('0x1f')](function(_0x47d5f3){var _0x43e79c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x47d5f3[_0x7772('0x26')][_0x7772('0x6d')];return db['sequelize'][_0x7772('0x40')](_0x43e79c,{'type':db['Sequelize'][_0x7772('0x70')][_0x7772('0x71')],'raw':!![]})[_0x7772('0x1f')](function(_0x1cab9a){return _0x1cab9a;});})[_0x7772('0x1f')](function(_0x481f4a){if(_0x481f4a){_0x40e3d5['message'][_0x7772('0x80')]=_0x481f4a[0x0];if(!_0x2e4ca3['body'][_0x7772('0x61')])return;return db[_0x7772('0x81')][_0x7772('0x57')]({'where':{'id':_0x2e4ca3[_0x7772('0x58')][_0x7772('0x61')],'role':'agent'},'attributes':['id','name',_0x7772('0x72'),_0x7772('0x73'),_0x7772('0x74')],'raw':!![]});}return null;})[_0x7772('0x1f')](function(_0xc9c9c3){if(!_0xc9c9c3)return null;_0x40e3d5[_0x7772('0x26')][_0x7772('0x63')]=_0xc9c9c3;return _0x40e3d5;})['then'](function(_0x3542b2){if(_0x3542b2){_0x3542b2[_0x7772('0x26')][_0x7772('0x76')]=util['format']('SIP/%s',_0x2e4ca3['user']['name']);_0x3542b2['message'][_0x7772('0x78')]=_0x40e3d5[_0x7772('0x78')];_0x3542b2[_0x7772('0x26')][_0x7772('0x79')]=_0x40e3d5[_0x7772('0x78')];_0x3542b2[_0x7772('0x26')]['event']=_0x7772('0x34');respondWithRpcPromise(_0x7772('0x7b'),_0x7772('0x7b'),{'event':'rejectmessage','message':_0x3542b2[_0x7772('0x26')]},client9002);return _0x40e3d5;}return null;})[_0x7772('0x1f')](respondWithResult(_0x27de8f,null))['catch'](handleError(_0x27de8f,null));};exports['create']=function(_0x28e4f1,_0x3904cc){var _0x182762;return db[_0x7772('0x51')]['create'](_0x28e4f1[_0x7772('0x58')],{})['then'](function(_0x4f322e){_0x182762=_0x4f322e;return db[_0x7772('0x82')][_0x7772('0x83')]({'where':{'id':_0x182762[_0x7772('0x6d')]}});})[_0x7772('0x1f')](function(_0x2a748c){if(_[_0x7772('0x66')](_0x2a748c)){return;}else{_0x182762[_0x7772('0x5d')]=_0x2a748c['fax'];return db[_0x7772('0x84')][_0x7772('0x83')]({'where':{'id':_0x182762[_0x7772('0x85')]}});}})[_0x7772('0x1f')](function(_0x1ff477){return respondWithRpcPromise(_0x7772('0x86'),_0x7772('0x86'),{'FaxAccountId':_['isNil'](_0x28e4f1[_0x7772('0x58')])?undefined:_0x28e4f1['body']['FaxAccountId'],'path':_[_0x7772('0x66')](_0x1ff477)?undefined:util[_0x7772('0x68')]('/var/opt/motion2/server/files/attachments/%s',_0x1ff477[_0x7772('0x87')]),'fax':_[_0x7772('0x66')](_0x182762[_0x7772('0x5d')])?undefined:_0x182762[_0x7772('0x5d')],'AttachmentId':_0x182762[_0x7772('0x85')]},client9002);})[_0x7772('0x1f')](respondWithResult(_0x3904cc,0xc9))[_0x7772('0x29')](handleError(_0x3904cc,null));};exports[_0x7772('0x88')]=function(_0x241ea0,_0x47e91a){var _0x44980b=path[_0x7772('0x89')](config['root'],_0x7772('0x8a'),_0x7772('0x8b'),'attachments');return db[_0x7772('0x51')][_0x7772('0x57')]({'where':{'id':_0x241ea0[_0x7772('0x54')]['id']},'include':[{'model':db['Attachment'],'as':_0x7772('0x84')}]})[_0x7772('0x1f')](handleEntityNotFound(_0x47e91a,null))[_0x7772('0x1f')](function(_0x125708){if(_0x125708){return _0x47e91a[_0x7772('0x88')](path[_0x7772('0x89')](_0x44980b,_0x125708[_0x7772('0x84')][_0x7772('0x87')]));}})[_0x7772('0x29')](handleError(_0x47e91a,null));}; \ No newline at end of file +var _0x724e=['rows','show','params','rawAttributes','keys','include','find','body','describe','fax-interactions','fax','read','readAt','format','user','agent','UserId','get','FaxInteraction','FaxInteractionId','update','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE: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','QueryTypes','SELECT','contact','fullname','internal','manual','interface','channel','motionChannel','event','accept','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','email','SIP/%s','rejectmessage','create','isNil','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','sendStatus','name','index','map','FaxMessage','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','includeAll'];(function(_0xca68a0,_0x53bac4){var _0x3da919=function(_0x4f5c62){while(--_0x4f5c62){_0xca68a0['push'](_0xca68a0['shift']());}};_0x3da919(++_0x53bac4);}(_0x724e,0x159));var _0xe724=function(_0x644df1,_0xfd9077){_0x644df1=_0x644df1-0x0;var _0x5b68e4=_0x724e[_0x644df1];return _0x5b68e4;};'use strict';var emlformat=require(_0xe724('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe724('0x1'));var jsonpatch=require(_0xe724('0x2'));var rp=require(_0xe724('0x3'));var moment=require(_0xe724('0x4'));var BPromise=require(_0xe724('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe724('0x6'));var sox=require('sox');var csv=require(_0xe724('0x7'));var ejs=require(_0xe724('0x8'));var fs=require('fs');var fs_extra=require(_0xe724('0x9'));var _=require(_0xe724('0xa'));var squel=require('squel');var crypto=require(_0xe724('0xb'));var jsforce=require(_0xe724('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe724('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe724('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe724('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe724('0xf'))(_0xe724('0x10'));var utils=require('../../config/utils');var config=require(_0xe724('0x11'));var licenseUtil=require(_0xe724('0x12'));var db=require(_0xe724('0x13'))['db'];config[_0xe724('0x14')]=_[_0xe724('0x15')](config[_0xe724('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xe724('0x16'))(new Redis(config[_0xe724('0x14')]));require('./faxMessage.socket')[_0xe724('0x17')](socket);var jayson=require(_0xe724('0x18'));var client=jayson[_0xe724('0x19')][_0xe724('0x1a')]({'port':0x232c});var client9002=jayson[_0xe724('0x19')][_0xe724('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xb041ff,_0x4508c9,_0x393014,_0x466772){return new BPromise(function(_0x5cdc3e,_0x28972a){var _0x45c49a=_0x466772||client;return _0x45c49a[_0xe724('0x1b')](_0xb041ff,_0x393014)[_0xe724('0x1c')](function(_0x2c42d4){logger[_0xe724('0x1d')](_0xe724('0x1e'),_0x4508c9,_0xe724('0x1f'));logger[_0xe724('0x20')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4508c9,'request\x20sent',JSON[_0xe724('0x21')](_0x2c42d4));if(_0x2c42d4[_0xe724('0x22')]){if(_0x2c42d4[_0xe724('0x22')][_0xe724('0x23')]===0x1f4){logger['error'](_0xe724('0x1e'),_0x4508c9,_0x2c42d4[_0xe724('0x22')][_0xe724('0x24')]);return _0x28972a(_0x2c42d4['error']['message']);}logger[_0xe724('0x22')](_0xe724('0x1e'),_0x4508c9,_0x2c42d4[_0xe724('0x22')][_0xe724('0x24')]);return _0x5cdc3e(_0x2c42d4[_0xe724('0x22')][_0xe724('0x24')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x4508c9,'request\x20sent');_0x5cdc3e(_0x2c42d4[_0xe724('0x25')][_0xe724('0x24')]);}})[_0xe724('0x26')](function(_0xc0894d){logger[_0xe724('0x22')](_0xe724('0x1e'),_0x4508c9,_0xc0894d);_0x28972a(_0xc0894d);});});}function respondWithStatusCode(_0x126bc0,_0x16940d){_0x16940d=_0x16940d||0xcc;return function(_0x437dae){if(_0x437dae){return _0x126bc0['sendStatus'](_0x16940d);}return _0x126bc0[_0xe724('0x27')](_0x16940d)[_0xe724('0x28')]();};}function respondWithResult(_0x22d760,_0x2d4c05){_0x2d4c05=_0x2d4c05||0xc8;return function(_0x15ad61){if(_0x15ad61){return _0x22d760['status'](_0x2d4c05)[_0xe724('0x29')](_0x15ad61);}};}function respondWithFilteredResult(_0x202867,_0x36600a){return function(_0x1eb8b6){if(_0x1eb8b6){var _0x1e52b5=typeof _0x36600a[_0xe724('0x2a')]===_0xe724('0x2b')&&typeof _0x36600a['limit']==='undefined';var _0x5374c5=_0x1eb8b6[_0xe724('0x2c')];var _0x5bb501=_0x1e52b5?0x0:_0x36600a[_0xe724('0x2a')];var _0x130256=_0x1e52b5?_0x1eb8b6[_0xe724('0x2c')]:_0x36600a[_0xe724('0x2a')]+_0x36600a['limit'];var _0x50759f;if(_0x130256>=_0x5374c5){_0x130256=_0x5374c5;_0x50759f=0xc8;}else{_0x50759f=0xce;}_0x202867[_0xe724('0x27')](_0x50759f);return _0x202867[_0xe724('0x2d')](_0xe724('0x2e'),_0x5bb501+'-'+_0x130256+'/'+_0x5374c5)['json'](_0x1eb8b6);}return null;};}function patchUpdates(_0x5bc996){return function(_0x1f5319){try{jsonpatch[_0xe724('0x2f')](_0x1f5319,_0x5bc996,!![]);}catch(_0x39c7d1){return BPromise[_0xe724('0x30')](_0x39c7d1);}return _0x1f5319[_0xe724('0x31')]();};}function saveUpdates(_0xfde1cd,_0x4b3b9c){return function(_0x47d8d3){if(_0x47d8d3){return _0x47d8d3['update'](_0xfde1cd)[_0xe724('0x1c')](function(_0x53c486){return _0x53c486;});}return null;};}function removeEntity(_0x327987,_0x1c16ac){return function(_0x2e43cd){if(_0x2e43cd){return _0x2e43cd[_0xe724('0x32')]()[_0xe724('0x1c')](function(){_0x327987[_0xe724('0x27')](0xcc)[_0xe724('0x28')]();});}};}function handleEntityNotFound(_0x4485df,_0x4c6a6e){return function(_0x17d05b){if(!_0x17d05b){_0x4485df[_0xe724('0x33')](0x194);}return _0x17d05b;};}function handleError(_0xc09a64,_0x59c462){_0x59c462=_0x59c462||0x1f4;return function(_0x508c55){logger['error'](_0x508c55['stack']);if(_0x508c55[_0xe724('0x34')]){delete _0x508c55[_0xe724('0x34')];}_0xc09a64['status'](_0x59c462)['send'](_0x508c55);};}exports[_0xe724('0x35')]=function(_0x598192,_0x653c05){var _0x2b58d2={},_0x4b8c81={},_0x4ffe12={'count':0x0,'rows':[]};var _0xfccfb2=_[_0xe724('0x36')](db[_0xe724('0x37')]['rawAttributes'],function(_0x441b61){return{'name':_0x441b61[_0xe724('0x38')],'type':_0x441b61[_0xe724('0x39')][_0xe724('0x3a')]};});_0x4b8c81['model']=_[_0xe724('0x36')](_0xfccfb2,_0xe724('0x34'));_0x4b8c81['query']=_['keys'](_0x598192[_0xe724('0x3b')]);_0x4b8c81[_0xe724('0x3c')]=_[_0xe724('0x3d')](_0x4b8c81['model'],_0x4b8c81[_0xe724('0x3b')]);_0x2b58d2[_0xe724('0x3e')]=_[_0xe724('0x3d')](_0x4b8c81[_0xe724('0x3f')],qs['fields'](_0x598192['query'][_0xe724('0x40')]));_0x2b58d2[_0xe724('0x3e')]=_0x2b58d2[_0xe724('0x3e')][_0xe724('0x41')]?_0x2b58d2[_0xe724('0x3e')]:_0x4b8c81[_0xe724('0x3f')];if(!_0x598192['query'][_0xe724('0x42')](_0xe724('0x43'))){_0x2b58d2[_0xe724('0x44')]=qs[_0xe724('0x44')](_0x598192[_0xe724('0x3b')][_0xe724('0x44')]);_0x2b58d2[_0xe724('0x2a')]=qs[_0xe724('0x2a')](_0x598192[_0xe724('0x3b')]['offset']);}_0x2b58d2[_0xe724('0x45')]=qs['sort'](_0x598192[_0xe724('0x3b')][_0xe724('0x46')]);_0x2b58d2[_0xe724('0x47')]=qs['filters'](_[_0xe724('0x48')](_0x598192[_0xe724('0x3b')],_0x4b8c81[_0xe724('0x3c')]),_0xfccfb2);if(_0x598192['query']['filter']){_0x2b58d2[_0xe724('0x47')]=_[_0xe724('0x49')](_0x2b58d2['where'],{'$or':_['map'](_0xfccfb2,function(_0x4b1942){if(_0x4b1942[_0xe724('0x39')]!=='VIRTUAL'){var _0x359ba2={};_0x359ba2[_0x4b1942[_0xe724('0x34')]]={'$like':'%'+_0x598192[_0xe724('0x3b')]['filter']+'%'};return _0x359ba2;}})});}_0x2b58d2=_[_0xe724('0x49')]({},_0x2b58d2,_0x598192['options']);var _0x5eaf01={'where':_0x2b58d2[_0xe724('0x47')]};return db[_0xe724('0x37')]['count'](_0x5eaf01)[_0xe724('0x1c')](function(_0x115380){_0x4ffe12['count']=_0x115380;if(_0x598192[_0xe724('0x3b')][_0xe724('0x4a')]){_0x2b58d2['include']=[{'all':!![]}];}return db[_0xe724('0x37')]['findAll'](_0x2b58d2);})[_0xe724('0x1c')](function(_0x1d87d6){_0x4ffe12[_0xe724('0x4b')]=_0x1d87d6;return _0x4ffe12;})[_0xe724('0x1c')](respondWithFilteredResult(_0x653c05,_0x2b58d2))[_0xe724('0x26')](handleError(_0x653c05,null));};exports[_0xe724('0x4c')]=function(_0x5b1a47,_0x591c01){var _0x55a1ac={'raw':!![],'where':{'id':_0x5b1a47[_0xe724('0x4d')]['id']}},_0x1ff4ea={};_0x1ff4ea[_0xe724('0x3f')]=_['keys'](db['FaxMessage'][_0xe724('0x4e')]);_0x1ff4ea[_0xe724('0x3b')]=_[_0xe724('0x4f')](_0x5b1a47[_0xe724('0x3b')]);_0x1ff4ea[_0xe724('0x3c')]=_[_0xe724('0x3d')](_0x1ff4ea[_0xe724('0x3f')],_0x1ff4ea[_0xe724('0x3b')]);_0x55a1ac[_0xe724('0x3e')]=_[_0xe724('0x3d')](_0x1ff4ea['model'],qs[_0xe724('0x40')](_0x5b1a47['query'][_0xe724('0x40')]));_0x55a1ac[_0xe724('0x3e')]=_0x55a1ac['attributes']['length']?_0x55a1ac[_0xe724('0x3e')]:_0x1ff4ea[_0xe724('0x3f')];if(_0x5b1a47[_0xe724('0x3b')][_0xe724('0x4a')]){_0x55a1ac[_0xe724('0x50')]=[{'all':!![]}];}_0x55a1ac=_['merge']({},_0x55a1ac,_0x5b1a47['options']);return db[_0xe724('0x37')][_0xe724('0x51')](_0x55a1ac)[_0xe724('0x1c')](handleEntityNotFound(_0x591c01,null))['then'](respondWithResult(_0x591c01,null))[_0xe724('0x26')](handleError(_0x591c01,null));};exports['update']=function(_0x45bf2f,_0x50ced4){if(_0x45bf2f[_0xe724('0x52')]['id']){delete _0x45bf2f[_0xe724('0x52')]['id'];}return db[_0xe724('0x37')][_0xe724('0x51')]({'where':{'id':_0x45bf2f[_0xe724('0x4d')]['id']}})['then'](handleEntityNotFound(_0x50ced4,null))['then'](saveUpdates(_0x45bf2f[_0xe724('0x52')],null))['then'](respondWithResult(_0x50ced4,null))[_0xe724('0x26')](handleError(_0x50ced4,null));};exports[_0xe724('0x32')]=function(_0x7b7454,_0x58b504){return db[_0xe724('0x37')][_0xe724('0x51')]({'where':{'id':_0x7b7454[_0xe724('0x4d')]['id']}})['then'](handleEntityNotFound(_0x58b504,null))[_0xe724('0x1c')](removeEntity(_0x58b504,null))[_0xe724('0x26')](handleError(_0x58b504,null));};exports['describe']=function(_0x44d17f,_0x58e95d){return db[_0xe724('0x37')][_0xe724('0x53')]()[_0xe724('0x1c')](respondWithResult(_0x58e95d,null))[_0xe724('0x26')](handleError(_0x58e95d,null));};var interaction_log=require('../../config/logger')(_0xe724('0x54'));exports['accept']=function(_0xeec7ac,_0x1a81e7,_0x1ccae1){var _0x3a0886={'agent':{},'channel':_0xe724('0x55')};if(_0xeec7ac['body']['id']){delete _0xeec7ac[_0xe724('0x52')]['id'];}_0xeec7ac[_0xe724('0x52')][_0xe724('0x56')]=!![];_0xeec7ac['body'][_0xe724('0x57')]=moment()[_0xe724('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0xeec7ac[_0xe724('0x52')]['UserId']=_0xeec7ac[_0xe724('0x52')]['UserId']||_0xeec7ac[_0xe724('0x59')]['id'];_0x3a0886[_0xe724('0x5a')]['id']=_0xeec7ac[_0xe724('0x52')][_0xe724('0x5b')];return db[_0xe724('0x37')][_0xe724('0x51')]({'where':{'id':_0xeec7ac[_0xe724('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1a81e7,null))[_0xe724('0x1c')](saveUpdates(_0xeec7ac[_0xe724('0x52')],null))[_0xe724('0x1c')](function(_0x33e251){if(_0x33e251){_0x3a0886[_0xe724('0x24')]=_0x33e251[_0xe724('0x5c')]({'plain':!![]});return db[_0xe724('0x5d')][_0xe724('0x51')]({'where':{'id':_0x33e251[_0xe724('0x5e')]}});}return null;})[_0xe724('0x1c')](handleEntityNotFound(_0x1a81e7,null))['then'](function(_0x37fc97){if(_0x37fc97){return _0x37fc97[_0xe724('0x5f')]({'UserId':_0xeec7ac[_0xe724('0x52')][_0xe724('0x5b')],'read1stAt':_['isNil'](_0x37fc97['read1stAt'])?moment()[_0xe724('0x58')](_0xe724('0x60')):undefined});}return null;})['then'](function(_0x518ed5){if(_0x518ed5){_0x3a0886[_0xe724('0x61')]=_0x518ed5[_0xe724('0x5c')]({'plain':!![]});interaction_log['info'](_0xe724('0x62'),_0xeec7ac[_0xe724('0x59')]['id'],_0xeec7ac[_0xe724('0x59')][_0xe724('0x34')],_0xeec7ac[_0xe724('0x59')][_0xe724('0x63')],_0x3a0886[_0xe724('0x61')]['id'],_0xeec7ac[_0xe724('0x52')]?JSON[_0xe724('0x21')](_0xeec7ac[_0xe724('0x52')]):_0xe724('0x64'));return respondWithRpcPromise(_0xe724('0x65'),_0xe724('0x66'),_0x3a0886);}return null;})['then'](function(_0x19b956){var _0xfdb137=_0xe724('0x67')+_0x19b956[_0xe724('0x24')][_0xe724('0x68')];return db[_0xe724('0x69')]['query'](_0xfdb137,{'type':db['Sequelize'][_0xe724('0x6a')][_0xe724('0x6b')],'raw':!![]})[_0xe724('0x1c')](function(_0x48b24c){return _0x48b24c;});})[_0xe724('0x1c')](function(_0x146571){if(_0x146571){_0x3a0886['message'][_0xe724('0x6c')]=_0x146571[0x0];if(!_0xeec7ac['body'][_0xe724('0x5b')])return;return db['User'][_0xe724('0x51')]({'where':{'id':_0xeec7ac[_0xe724('0x52')][_0xe724('0x5b')],'role':_0xe724('0x5a')},'attributes':['id',_0xe724('0x34'),_0xe724('0x6d'),'email',_0xe724('0x6e')],'raw':!![]});}return null;})[_0xe724('0x1c')](function(_0x22d86c){if(!_0x22d86c)return null;_0x3a0886[_0xe724('0x24')][_0xe724('0x5a')]=_0x22d86c;return _0x3a0886;})['then'](function(_0x44857f){if(_0x44857f){if(_0xeec7ac[_0xe724('0x52')][_0xe724('0x6f')]){_0x3a0886[_0xe724('0x24')][_0xe724('0x70')]=util[_0xe724('0x58')]('SIP/%s',_0xeec7ac[_0xe724('0x59')][_0xe724('0x34')]);_0x3a0886[_0xe724('0x24')][_0xe724('0x71')]=_0x3a0886[_0xe724('0x71')];_0x3a0886['message'][_0xe724('0x72')]=_0x3a0886['channel'];_0x3a0886[_0xe724('0x24')][_0xe724('0x73')]=_0xe724('0x74');return respondWithRpcPromise(_0xe724('0x75'),_0xe724('0x75'),{'event':'acceptmessage','message':_0x3a0886[_0xe724('0x24')]},client9002)[_0xe724('0x1c')](function(){return _0x3a0886;});}return _0x3a0886;}return null;})[_0xe724('0x1c')](respondWithResult(_0x1a81e7,null))['catch'](handleError(_0x1a81e7,null));};var interaction_log=require(_0xe724('0xf'))('fax-interactions');exports[_0xe724('0x30')]=function(_0x1aa8de,_0x37c054,_0x35de66){var _0x46e40e={'agent':{},'channel':_0xe724('0x55')};if(_0x1aa8de['body']['id']){delete _0x1aa8de[_0xe724('0x52')]['id'];}_0x1aa8de[_0xe724('0x52')]['UserId']=_0x1aa8de[_0xe724('0x52')][_0xe724('0x5b')]||_0x1aa8de[_0xe724('0x59')]['id'];_0x46e40e[_0xe724('0x5a')]['id']=_0x1aa8de[_0xe724('0x52')][_0xe724('0x5b')];return db['FaxMessage'][_0xe724('0x51')]({'where':{'id':_0x1aa8de[_0xe724('0x4d')]['id'],'UserId':null}})[_0xe724('0x1c')](handleEntityNotFound(_0x37c054,null))[_0xe724('0x1c')](function(_0x11f87b){if(_0x11f87b){_0x46e40e[_0xe724('0x24')]=_0x11f87b[_0xe724('0x5c')]({'plain':!![]});return db['FaxInteraction'][_0xe724('0x51')]({'where':{'id':_0x11f87b[_0xe724('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x37c054,null))['then'](function(_0x4a71d9){if(_0x4a71d9){_0x46e40e[_0xe724('0x61')]=_0x4a71d9[_0xe724('0x5c')]({'plain':!![]});interaction_log[_0xe724('0x1d')](_0xe724('0x76'),_0x1aa8de[_0xe724('0x59')]['id'],_0x1aa8de[_0xe724('0x59')][_0xe724('0x34')],_0x1aa8de[_0xe724('0x59')][_0xe724('0x63')],_0x46e40e[_0xe724('0x61')]['id'],_0x1aa8de[_0xe724('0x52')]?JSON[_0xe724('0x21')](_0x1aa8de[_0xe724('0x52')]):_0xe724('0x64'));return respondWithRpcPromise(_0xe724('0x77'),_0xe724('0x78'),_0x46e40e);}return null;})[_0xe724('0x1c')](function(_0x3b296c){var _0x559054='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b296c['message'][_0xe724('0x68')];return db[_0xe724('0x69')][_0xe724('0x3b')](_0x559054,{'type':db[_0xe724('0x79')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe724('0x1c')](function(_0x2d956f){return _0x2d956f;});})[_0xe724('0x1c')](function(_0x46276a){if(_0x46276a){_0x46e40e['message']['contact']=_0x46276a[0x0];if(!_0x1aa8de[_0xe724('0x52')]['UserId'])return;return db[_0xe724('0x7a')][_0xe724('0x51')]({'where':{'id':_0x1aa8de[_0xe724('0x52')]['UserId'],'role':_0xe724('0x5a')},'attributes':['id','name','fullname',_0xe724('0x7b'),_0xe724('0x6e')],'raw':!![]});}return null;})[_0xe724('0x1c')](function(_0x3ed81d){if(!_0x3ed81d)return null;_0x46e40e[_0xe724('0x24')][_0xe724('0x5a')]=_0x3ed81d;return _0x46e40e;})['then'](function(_0x189bd2){if(_0x189bd2){_0x189bd2[_0xe724('0x24')]['interface']=util[_0xe724('0x58')](_0xe724('0x7c'),_0x1aa8de[_0xe724('0x59')][_0xe724('0x34')]);_0x189bd2[_0xe724('0x24')][_0xe724('0x71')]=_0x46e40e[_0xe724('0x71')];_0x189bd2[_0xe724('0x24')][_0xe724('0x72')]=_0x46e40e['channel'];_0x189bd2[_0xe724('0x24')][_0xe724('0x73')]=_0xe724('0x30');respondWithRpcPromise(_0xe724('0x75'),_0xe724('0x75'),{'event':_0xe724('0x7d'),'message':_0x189bd2[_0xe724('0x24')]},client9002);return _0x46e40e;}return null;})[_0xe724('0x1c')](respondWithResult(_0x37c054,null))[_0xe724('0x26')](handleError(_0x37c054,null));};exports[_0xe724('0x7e')]=function(_0x23e106,_0x3df835){var _0x45006c;return db[_0xe724('0x37')][_0xe724('0x7e')](_0x23e106[_0xe724('0x52')],{})[_0xe724('0x1c')](function(_0x377917){_0x45006c=_0x377917;return db['CmContact']['findOne']({'where':{'id':_0x45006c[_0xe724('0x68')]}});})['then'](function(_0x16a66a){if(_[_0xe724('0x7f')](_0x16a66a)){return;}else{_0x45006c['fax']=_0x16a66a[_0xe724('0x55')];return db[_0xe724('0x80')][_0xe724('0x81')]({'where':{'id':_0x45006c[_0xe724('0x82')]}});}})[_0xe724('0x1c')](function(_0x4c4848){return respondWithRpcPromise(_0xe724('0x83'),_0xe724('0x83'),{'FaxAccountId':_[_0xe724('0x7f')](_0x23e106[_0xe724('0x52')])?undefined:_0x23e106[_0xe724('0x52')]['FaxAccountId'],'path':_[_0xe724('0x7f')](_0x4c4848)?undefined:util[_0xe724('0x58')](_0xe724('0x84'),_0x4c4848[_0xe724('0x85')]),'fax':_[_0xe724('0x7f')](_0x45006c[_0xe724('0x55')])?undefined:_0x45006c['fax'],'AttachmentId':_0x45006c['AttachmentId']},client9002);})[_0xe724('0x1c')](respondWithResult(_0x3df835,0xc9))[_0xe724('0x26')](handleError(_0x3df835,null));};exports[_0xe724('0x86')]=function(_0x3ac49a,_0x3a804e){var _0x49b6b3=path[_0xe724('0x87')](config[_0xe724('0x88')],_0xe724('0x89'),_0xe724('0x8a'),_0xe724('0x8b'));return db[_0xe724('0x37')][_0xe724('0x51')]({'where':{'id':_0x3ac49a['params']['id']},'include':[{'model':db[_0xe724('0x80')],'as':_0xe724('0x80')}]})['then'](handleEntityNotFound(_0x3a804e,null))[_0xe724('0x1c')](function(_0x79e1cf){if(_0x79e1cf){return _0x3a804e[_0xe724('0x86')](path[_0xe724('0x87')](_0x49b6b3,_0x79e1cf['Attachment'][_0xe724('0x85')]));}})[_0xe724('0x26')](handleError(_0x3a804e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index b7e13a9..e7df0b0 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 _0xa5aa=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5cb75a,_0x49c6e1){var _0x5a15ab=function(_0x3d3ae8){while(--_0x3d3ae8){_0x5cb75a['push'](_0x5cb75a['shift']());}};_0x5a15ab(++_0x49c6e1);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x28bbe2,_0x249a6e){_0x28bbe2=_0x28bbe2-0x0;var _0x3128c7=_0xa5aa[_0x28bbe2];return _0x3128c7;};'use strict';var EventEmitter=require(_0xaa5a('0x0'));var FaxMessage=require(_0xaa5a('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xaa5a('0x2')](0x0);var events={'afterCreate':_0xaa5a('0x3'),'afterUpdate':_0xaa5a('0x4'),'afterDestroy':_0xaa5a('0x5')};function emitEvent(_0x23ed1c){return function(_0xf3106d,_0x569d93,_0x4321e6){FaxMessageEvents[_0xaa5a('0x6')](_0x23ed1c+':'+_0xf3106d['id'],_0xf3106d);FaxMessageEvents[_0xaa5a('0x6')](_0x23ed1c,_0xf3106d);_0x4321e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xaa5a('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xc029=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x592591,_0x46683f){var _0x1c9b89=function(_0x399886){while(--_0x399886){_0x592591['push'](_0x592591['shift']());}};_0x1c9b89(++_0x46683f);}(_0xc029,0x1df));var _0x9c02=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0xc029[_0x47a5bd];return _0x5c2184;};'use strict';var EventEmitter=require(_0x9c02('0x0'));var FaxMessage=require(_0x9c02('0x1'))['db'][_0x9c02('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9c02('0x3')](0x0);var events={'afterCreate':_0x9c02('0x4'),'afterUpdate':_0x9c02('0x5'),'afterDestroy':_0x9c02('0x6')};function emitEvent(_0x291f30){return function(_0x39c897,_0x2a96cd,_0x283c37){FaxMessageEvents[_0x9c02('0x7')](_0x291f30+':'+_0x39c897['id'],_0x39c897);FaxMessageEvents[_0x9c02('0x7')](_0x291f30,_0x39c897);_0x283c37(null);};}for(var e in events){if(events[_0x9c02('0x8')](e)){var event=events[e];FaxMessage[_0x9c02('0x9')](e,emitEvent(event));}}module[_0x9c02('0xa')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 1851b1f..4b56f38 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 _0x1e10=['utf8mb4_unicode_ci','lodash','util','moment','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','createdAt','error','utf8mb4'];(function(_0xca968a,_0x10a5fd){var _0x2b3b89=function(_0x307302){while(--_0x307302){_0xca968a['push'](_0xca968a['shift']());}};_0x2b3b89(++_0x10a5fd);}(_0x1e10,0x1a3));var _0x01e1=function(_0x58ecb4,_0x2c03c4){_0x58ecb4=_0x58ecb4-0x0;var _0x4b2adc=_0x1e10[_0x58ecb4];return _0x4b2adc;};'use strict';var _=require(_0x01e1('0x0'));var util=require(_0x01e1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x01e1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01e1('0x3'));var rimraf=require(_0x01e1('0x4'));var config=require(_0x01e1('0x5'));var attributes=require(_0x01e1('0x6'));module[_0x01e1('0x7')]=function(_0x5cbbd3,_0x1af5d0){return _0x5cbbd3[_0x01e1('0x8')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x01e1('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x103cd8,_0x17a959,_0x1dbb17){var _0x4746c7=_0x5cbbd3[_0x01e1('0xa')];var _0x341585=_0x103cd8['get']({'plain':!![]});if(_0x341585[_0x01e1('0xb')][_0x01e1('0xc')]()==='in'||_0x341585[_0x01e1('0xb')]['toLowerCase']()===_0x01e1('0xd')&&!_0x341585[_0x01e1('0xe')]&&!_['isNil'](_0x341585[_0x01e1('0xf')])){_0x4746c7[_0x01e1('0x10')][_0x01e1('0x11')]({'where':{'id':_0x341585['FaxInteractionId']}})['then'](function(_0x19ad43){if(_0x19ad43){_0x19ad43['update']({'lastMsgAt':_0x341585[_0x01e1('0x12')],'lastMsgDirection':_0x341585[_0x01e1('0xb')][_0x01e1('0xc')]()});}})['catch'](function(_0x56a6c4){console[_0x01e1('0x13')](_0x56a6c4);});}_0x1dbb17();}},'charset':_0x01e1('0x14'),'collate':_0x01e1('0x15')});}; \ No newline at end of file +var _0x23ae=['out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x23ae,0x136));var _0xe23a=function(_0x3c45b4,_0x1941cf){_0x3c45b4=_0x3c45b4-0x0;var _0x73361f=_0x23ae[_0x3c45b4];return _0x73361f;};'use strict';var _=require(_0xe23a('0x0'));var util=require(_0xe23a('0x1'));var logger=require(_0xe23a('0x2'))(_0xe23a('0x3'));var moment=require(_0xe23a('0x4'));var BPromise=require(_0xe23a('0x5'));var rp=require(_0xe23a('0x6'));var fs=require('fs');var path=require(_0xe23a('0x7'));var rimraf=require(_0xe23a('0x8'));var config=require(_0xe23a('0x9'));var attributes=require(_0xe23a('0xa'));module[_0xe23a('0xb')]=function(_0x257697,_0xca6507){return _0x257697['define'](_0xe23a('0xc'),attributes,{'tableName':_0xe23a('0xd'),'paranoid':![],'indexes':[{'name':_0xe23a('0xe'),'fields':[_0xe23a('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3247a7,_0x21d79b,_0xabdff4){var _0x244a68=_0x257697[_0xe23a('0x10')];var _0x3d013f=_0x3247a7[_0xe23a('0x11')]({'plain':!![]});if(_0x3d013f[_0xe23a('0x12')]['toLowerCase']()==='in'||_0x3d013f[_0xe23a('0x12')][_0xe23a('0x13')]()===_0xe23a('0x14')&&!_0x3d013f[_0xe23a('0x15')]&&!_[_0xe23a('0x16')](_0x3d013f[_0xe23a('0x17')])){_0x244a68[_0xe23a('0x18')][_0xe23a('0x19')]({'where':{'id':_0x3d013f[_0xe23a('0x1a')]}})[_0xe23a('0x1b')](function(_0x1b0ced){if(_0x1b0ced){_0x1b0ced[_0xe23a('0x1c')]({'lastMsgAt':_0x3d013f[_0xe23a('0x1d')],'lastMsgDirection':_0x3d013f['direction'][_0xe23a('0x13')]()});}})[_0xe23a('0x1e')](function(_0x2bbc5e){console[_0xe23a('0x1f')](_0x2bbc5e);});}_0xabdff4();}},'charset':_0xe23a('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e64da2d..c47aba9 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 _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x8ba0fd,_0x4b67b4){var _0x4b4cea=function(_0x22ea8b){while(--_0x22ea8b){_0x8ba0fd['push'](_0x8ba0fd['shift']());}};_0x4b4cea(++_0x4b67b4);}(_0x0e85,0x7c));var _0x50e8=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x0e85[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file +var _0xf3cd=['redis','defaults','socket.io-emitter','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','body','options','raw','UpdateFaxMessage','FaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4df29e,_0x3ec895){var _0x3496be=function(_0x4251a3){while(--_0x4251a3){_0x4df29e['push'](_0x4df29e['shift']());}};_0x3496be(++_0x3ec895);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5914a3,_0x22e240){_0x5914a3=_0x5914a3-0x0;var _0x25af13=_0xf3cd[_0x5914a3];return _0x25af13;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});config[_0xdf3c('0xc')]=_[_0xdf3c('0xd')](config[_0xdf3c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf3c('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xdf3c('0xf')](socket);function respondWithRpcPromise(_0x981616,_0x5ef936,_0x1dba4c){return new BPromise(function(_0x205f33,_0x2d420c){return client[_0xdf3c('0x10')](_0x981616,_0x1dba4c)[_0xdf3c('0x11')](function(_0x1c456b){logger[_0xdf3c('0x12')](_0xdf3c('0x13'),_0x5ef936,'request\x20sent');logger[_0xdf3c('0x14')](_0xdf3c('0x15'),_0x5ef936,_0xdf3c('0x16'),JSON[_0xdf3c('0x17')](_0x1c456b));if(_0x1c456b['error']){if(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x19')]===0x1f4){logger[_0xdf3c('0x18')]('FaxMessage,\x20%s,\x20%s',_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x2d420c(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x205f33(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}else{logger['info'](_0xdf3c('0x13'),_0x5ef936,_0xdf3c('0x16'));_0x205f33(_0x1c456b[_0xdf3c('0x1b')][_0xdf3c('0x1a')]);}})[_0xdf3c('0x1c')](function(_0x113b56){logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x113b56);_0x2d420c(_0x113b56);});});}exports[_0xdf3c('0x1d')]=function(_0x18fb5f){var _0x267488=this;return new Promise(function(_0x3d14cc,_0x25487c){return db['FaxMessage']['create'](_0x18fb5f[_0xdf3c('0x1e')],{'raw':_0x18fb5f['options']?_0x18fb5f[_0xdf3c('0x1f')][_0xdf3c('0x20')]===undefined?!![]:![]:!![]})[_0xdf3c('0x11')](function(_0x38b319){logger[_0xdf3c('0x12')](_0xdf3c('0x1d'),_0x18fb5f);logger['debug'](_0xdf3c('0x1d'),_0x18fb5f,JSON[_0xdf3c('0x17')](_0x38b319));_0x3d14cc(_0x38b319);})[_0xdf3c('0x1c')](function(_0x24754a){logger[_0xdf3c('0x18')](_0xdf3c('0x1d'),_0x24754a[_0xdf3c('0x1a')],_0x18fb5f);_0x25487c(_0x267488[_0xdf3c('0x18')](0x1f4,_0x24754a[_0xdf3c('0x1a')]));});});};exports[_0xdf3c('0x21')]=function(_0x4c076c){var _0xd284d7=this;return new Promise(function(_0x153daa,_0x4b57a4){return db[_0xdf3c('0x22')]['update'](_0x4c076c['body'],{'raw':_0x4c076c['options']?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c076c['options']?_0x4c076c['options'][_0xdf3c('0x23')]||null:null,'attributes':_0x4c076c[_0xdf3c('0x1f')]?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x24')]||null:null,'limit':_0x4c076c['options']?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x25')]||null:null})['then'](function(_0x51e0a4){logger[_0xdf3c('0x12')](_0xdf3c('0x21'),_0x4c076c);logger[_0xdf3c('0x14')]('UpdateFaxMessage',_0x4c076c,JSON[_0xdf3c('0x17')](_0x51e0a4));_0x153daa(_0x51e0a4);})[_0xdf3c('0x1c')](function(_0x21e7b8){logger[_0xdf3c('0x18')]('UpdateFaxMessage',_0x21e7b8[_0xdf3c('0x1a')],_0x4c076c);_0x4b57a4(_0xd284d7[_0xdf3c('0x18')](0x1f4,_0x21e7b8['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ce79fa8..86f4bcf 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 _0x5eb9=['removeListener','faxMessage:','./faxMessage.events','save'];(function(_0x41908c,_0x551beb){var _0x17bfe7=function(_0x481a06){while(--_0x481a06){_0x41908c['push'](_0x41908c['shift']());}};_0x17bfe7(++_0x551beb);}(_0x5eb9,0x1e6));var _0x95eb=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0x5eb9[_0x38c632];return _0x12737e;};'use strict';var FaxMessageEvents=require(_0x95eb('0x0'));var events=[_0x95eb('0x1'),'remove','update'];function createListener(_0x4c1b35,_0x58c866){return function(_0x5c8a72){_0x58c866['emit'](_0x4c1b35,_0x5c8a72);};}function removeListener(_0x50d37b,_0x258f86){return function(){FaxMessageEvents[_0x95eb('0x2')](_0x50d37b,_0x258f86);};}exports['register']=function(_0x456f9e){for(var _0x5e513d=0x0,_0x40c30d=events['length'];_0x5e513d<_0x40c30d;_0x5e513d++){var _0x3a0ff3=events[_0x5e513d];var _0x2c27bd=createListener(_0x95eb('0x3')+_0x3a0ff3,_0x456f9e);FaxMessageEvents['on'](_0x3a0ff3,_0x2c27bd);}}; \ No newline at end of file +var _0x7afe=['removeListener','register','length','faxMessage:','./faxMessage.events','save','update','emit'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x7afe,0x15c));var _0xe7af=function(_0x57f9d8,_0x405a9e){_0x57f9d8=_0x57f9d8-0x0;var _0x1d7e50=_0x7afe[_0x57f9d8];return _0x1d7e50;};'use strict';var FaxMessageEvents=require(_0xe7af('0x0'));var events=[_0xe7af('0x1'),'remove',_0xe7af('0x2')];function createListener(_0x2a5cc9,_0x25315d){return function(_0x3e0229){_0x25315d[_0xe7af('0x3')](_0x2a5cc9,_0x3e0229);};}function removeListener(_0x34c91b,_0x38d136){return function(){FaxMessageEvents[_0xe7af('0x4')](_0x34c91b,_0x38d136);};}exports[_0xe7af('0x5')]=function(_0x519bcf){for(var _0xceccd=0x0,_0x30c9e2=events[_0xe7af('0x6')];_0xceccd<_0x30c9e2;_0xceccd++){var _0x26c275=events[_0xceccd];var _0x54fbfb=createListener(_0xe7af('0x7')+_0x26c275,_0x519bcf);FaxMessageEvents['on'](_0x26c275,_0x54fbfb);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d611c56..6859426 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','./faxMessage.controller','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','faxmessage:create','create','put','update','reject','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x38bb32,_0x1fcb7d){var _0x461b6f=function(_0x49474c){while(--_0x49474c){_0x38bb32['push'](_0x38bb32['shift']());}};_0x461b6f(++_0x1fcb7d);}(_0x70e0,0x17b));var _0x070e=function(_0x117d1a,_0x47b7ed){_0x117d1a=_0x117d1a-0x0;var _0x6b685a=_0x70e0[_0x117d1a];return _0x6b685a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x070e('0xd')]);router[_0x070e('0xe')]('/',auth[_0x070e('0x8')](),interaction[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11')),controller[_0x070e('0x12')]);router[_0x070e('0x13')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/accept',auth[_0x070e('0x8')](),controller['accept']);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x16')]);module[_0x070e('0x17')]=router; \ No newline at end of file +var _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0x5cceb2,_0x29e301){var _0x3ca9e1=function(_0x48b4b9){while(--_0x48b4b9){_0x5cceb2['push'](_0x5cceb2['shift']());}};_0x3ca9e1(++_0x29e301);}(_0xca66,0x8b));var _0x6ca6=function(_0x3dd9bd,_0x28212e){_0x3dd9bd=_0x3dd9bd-0x0;var _0x240581=_0xca66[_0x3dd9bd];return _0x240581;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 90faafb..017d525 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 _0xa058=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xa058,0x67));var _0x8a05=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0xa058[_0x3f3bad];return _0x4f0801;};'use strict';var Sequelize=require(_0x8a05('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a05('0x1')],'unique':_0x8a05('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8a05('0x1')]},'timeout':{'type':Sequelize[_0x8a05('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8a05('0x4'),_0x8a05('0x5'),_0x8a05('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8a05('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x13c8=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x515bca,_0x5d3da7){var _0x165119=function(_0x48cdb2){while(--_0x48cdb2){_0x515bca['push'](_0x515bca['shift']());}};_0x165119(++_0x5d3da7);}(_0x13c8,0xa0));var _0x813c=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x13c8[_0x258fb0];return _0x4d1afe;};'use strict';var Sequelize=require(_0x813c('0x0'));module[_0x813c('0x1')]={'name':{'type':Sequelize[_0x813c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x813c('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x813c('0x4')](_0x813c('0x5'),_0x813c('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 706255a..a762108 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 _0x9e04=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxQueues','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','pick','FaxQueueId','options','UserFaxQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','getTeams','ids','Team','Agents','online','voicePause','sequelize','findOrCreate','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./faxQueue.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','keys','length'];(function(_0x668c9f,_0x353d7a){var _0x226095=function(_0x4035f0){while(--_0x4035f0){_0x668c9f['push'](_0x668c9f['shift']());}};_0x226095(++_0x353d7a);}(_0x9e04,0xd3));var _0x49e0=function(_0x5f0de1,_0x285d01){_0x5f0de1=_0x5f0de1-0x0;var _0x1b9f66=_0x9e04[_0x5f0de1];return _0x1b9f66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49e0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49e0('0x1'));var moment=require('moment');var BPromise=require(_0x49e0('0x2'));var Mustache=require(_0x49e0('0x3'));var util=require(_0x49e0('0x4'));var path=require(_0x49e0('0x5'));var sox=require('sox');var csv=require(_0x49e0('0x6'));var ejs=require(_0x49e0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x49e0('0x8'));var crypto=require(_0x49e0('0x9'));var jsforce=require(_0x49e0('0xa'));var deskjs=require(_0x49e0('0xb'));var toCsv=require(_0x49e0('0x6'));var querystring=require(_0x49e0('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x49e0('0xd'));var hardwareService=require(_0x49e0('0xe'));var logger=require('../../config/logger')(_0x49e0('0xf'));var utils=require(_0x49e0('0x10'));var config=require(_0x49e0('0x11'));var licenseUtil=require(_0x49e0('0x12'));var db=require(_0x49e0('0x13'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x49e0('0x14'),'port':0x18eb});var socket=require(_0x49e0('0x15'))(new Redis(config[_0x49e0('0x16')]));require(_0x49e0('0x17'))['register'](socket);function respondWithStatusCode(_0x409fc7,_0x1a66d5){_0x1a66d5=_0x1a66d5||0xcc;return function(_0x3bc62b){if(_0x3bc62b){return _0x409fc7['sendStatus'](_0x1a66d5);}return _0x409fc7[_0x49e0('0x18')](_0x1a66d5)[_0x49e0('0x19')]();};}function respondWithResult(_0x26c5b2,_0x2fe33e){_0x2fe33e=_0x2fe33e||0xc8;return function(_0x4802a5){if(_0x4802a5){return _0x26c5b2['status'](_0x2fe33e)[_0x49e0('0x1a')](_0x4802a5);}};}function respondWithFilteredResult(_0x9f97e3,_0x45ce51){return function(_0x6aac42){if(_0x6aac42){var _0x2102ae=typeof _0x45ce51[_0x49e0('0x1b')]===_0x49e0('0x1c')&&typeof _0x45ce51[_0x49e0('0x1d')]===_0x49e0('0x1c');var _0x535982=_0x6aac42[_0x49e0('0x1e')];var _0x5203c1=_0x2102ae?0x0:_0x45ce51[_0x49e0('0x1b')];var _0x18181c=_0x2102ae?_0x6aac42[_0x49e0('0x1e')]:_0x45ce51['offset']+_0x45ce51['limit'];var _0x535032;if(_0x18181c>=_0x535982){_0x18181c=_0x535982;_0x535032=0xc8;}else{_0x535032=0xce;}_0x9f97e3[_0x49e0('0x18')](_0x535032);return _0x9f97e3[_0x49e0('0x1f')](_0x49e0('0x20'),_0x5203c1+'-'+_0x18181c+'/'+_0x535982)[_0x49e0('0x1a')](_0x6aac42);}return null;};}function patchUpdates(_0x1d1003){return function(_0x5ed85f){try{jsonpatch[_0x49e0('0x21')](_0x5ed85f,_0x1d1003,!![]);}catch(_0x5d82ef){return BPromise[_0x49e0('0x22')](_0x5d82ef);}return _0x5ed85f[_0x49e0('0x23')]();};}function saveUpdates(_0x2ae64a,_0x2aa78b){return function(_0x373c25){if(_0x373c25){return _0x373c25[_0x49e0('0x24')](_0x2ae64a)[_0x49e0('0x25')](function(_0x46f66e){return _0x46f66e;});}return null;};}function removeEntity(_0x5b56ba,_0x342f18){return function(_0x10aaef){if(_0x10aaef){return _0x10aaef[_0x49e0('0x26')]()[_0x49e0('0x25')](function(){var _0x251c41=_0x10aaef[_0x49e0('0x27')]({'plain':!![]});var _0x4fea11='FaxQueues';return db[_0x49e0('0x28')][_0x49e0('0x26')]({'where':{'type':_0x4fea11,'resourceId':_0x251c41['id']}})[_0x49e0('0x25')](function(){return _0x10aaef;});})['then'](function(){_0x5b56ba[_0x49e0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65d5a6,_0x57a82c){return function(_0xcc505e){if(!_0xcc505e){_0x65d5a6['sendStatus'](0x194);}return _0xcc505e;};}function handleError(_0x11ed10,_0x416b17){_0x416b17=_0x416b17||0x1f4;return function(_0x21cb0d){logger['error'](_0x21cb0d[_0x49e0('0x29')]);if(_0x21cb0d[_0x49e0('0x2a')]){delete _0x21cb0d[_0x49e0('0x2a')];}_0x11ed10[_0x49e0('0x18')](_0x416b17)[_0x49e0('0x2b')](_0x21cb0d);};}exports['index']=function(_0x4c80a3,_0x6acf78){var _0x291230={},_0x3a6afc={},_0x4d938d={'count':0x0,'rows':[]};var _0xe91248=_[_0x49e0('0x2c')](db[_0x49e0('0x2d')][_0x49e0('0x2e')],function(_0x54d30d){return{'name':_0x54d30d[_0x49e0('0x2f')],'type':_0x54d30d[_0x49e0('0x30')][_0x49e0('0x31')]};});_0x3a6afc[_0x49e0('0x32')]=_[_0x49e0('0x2c')](_0xe91248,_0x49e0('0x2a'));_0x3a6afc[_0x49e0('0x33')]=_['keys'](_0x4c80a3[_0x49e0('0x33')]);_0x3a6afc[_0x49e0('0x34')]=_['intersection'](_0x3a6afc[_0x49e0('0x32')],_0x3a6afc[_0x49e0('0x33')]);_0x291230[_0x49e0('0x35')]=_[_0x49e0('0x36')](_0x3a6afc[_0x49e0('0x32')],qs['fields'](_0x4c80a3[_0x49e0('0x33')][_0x49e0('0x37')]));_0x291230['attributes']=_0x291230[_0x49e0('0x35')]['length']?_0x291230['attributes']:_0x3a6afc['model'];if(!_0x4c80a3[_0x49e0('0x33')][_0x49e0('0x38')]('nolimit')){_0x291230[_0x49e0('0x1d')]=qs[_0x49e0('0x1d')](_0x4c80a3[_0x49e0('0x33')]['limit']);_0x291230[_0x49e0('0x1b')]=qs[_0x49e0('0x1b')](_0x4c80a3[_0x49e0('0x33')][_0x49e0('0x1b')]);}_0x291230[_0x49e0('0x39')]=qs['sort'](_0x4c80a3[_0x49e0('0x33')][_0x49e0('0x3a')]);_0x291230['where']=qs['filters'](_['pick'](_0x4c80a3[_0x49e0('0x33')],_0x3a6afc[_0x49e0('0x34')]),_0xe91248);if(_0x4c80a3['query'][_0x49e0('0x3b')]){_0x291230[_0x49e0('0x3c')]=_['merge'](_0x291230[_0x49e0('0x3c')],{'$or':_[_0x49e0('0x2c')](_0xe91248,function(_0x2d7b5f){if(_0x2d7b5f[_0x49e0('0x30')]!==_0x49e0('0x3d')){var _0x3f3553={};_0x3f3553[_0x2d7b5f['name']]={'$like':'%'+_0x4c80a3[_0x49e0('0x33')]['filter']+'%'};return _0x3f3553;}})});}_0x291230=_[_0x49e0('0x3e')]({},_0x291230,_0x4c80a3['options']);var _0x235a99={'where':_0x291230[_0x49e0('0x3c')]};return db[_0x49e0('0x2d')][_0x49e0('0x1e')](_0x235a99)['then'](function(_0x57c151){_0x4d938d[_0x49e0('0x1e')]=_0x57c151;if(_0x4c80a3[_0x49e0('0x33')][_0x49e0('0x3f')]){_0x291230[_0x49e0('0x40')]=[{'all':!![]}];}return db[_0x49e0('0x2d')][_0x49e0('0x41')](_0x291230);})['then'](function(_0x10ce24){_0x4d938d['rows']=_0x10ce24;return _0x4d938d;})[_0x49e0('0x25')](respondWithFilteredResult(_0x6acf78,_0x291230))[_0x49e0('0x42')](handleError(_0x6acf78,null));};exports[_0x49e0('0x43')]=function(_0x5ac46e,_0x2d76e9){var _0x34fe19={'raw':!![],'where':{'id':_0x5ac46e[_0x49e0('0x44')]['id']}},_0x3a0a9f={};_0x3a0a9f[_0x49e0('0x32')]=_[_0x49e0('0x45')](db[_0x49e0('0x2d')][_0x49e0('0x2e')]);_0x3a0a9f[_0x49e0('0x33')]=_['keys'](_0x5ac46e[_0x49e0('0x33')]);_0x3a0a9f['filters']=_['intersection'](_0x3a0a9f[_0x49e0('0x32')],_0x3a0a9f[_0x49e0('0x33')]);_0x34fe19[_0x49e0('0x35')]=_['intersection'](_0x3a0a9f['model'],qs[_0x49e0('0x37')](_0x5ac46e[_0x49e0('0x33')][_0x49e0('0x37')]));_0x34fe19[_0x49e0('0x35')]=_0x34fe19[_0x49e0('0x35')][_0x49e0('0x46')]?_0x34fe19['attributes']:_0x3a0a9f[_0x49e0('0x32')];if(_0x5ac46e[_0x49e0('0x33')][_0x49e0('0x3f')]){_0x34fe19['include']=[{'all':!![]}];}_0x34fe19=_[_0x49e0('0x3e')]({},_0x34fe19,_0x5ac46e['options']);return db['FaxQueue']['find'](_0x34fe19)[_0x49e0('0x25')](handleEntityNotFound(_0x2d76e9,null))[_0x49e0('0x25')](respondWithResult(_0x2d76e9,null))[_0x49e0('0x42')](handleError(_0x2d76e9,null));};exports['create']=function(_0x5a90c1,_0x424bbc){return db[_0x49e0('0x2d')][_0x49e0('0x47')](_0x5a90c1[_0x49e0('0x48')],{})[_0x49e0('0x25')](function(_0x5a57b4){var _0x67618f=_0x5a90c1['user'][_0x49e0('0x27')]({'plain':!![]});if(!_0x67618f)throw new Error(_0x49e0('0x49'));if(_0x67618f[_0x49e0('0x4a')]===_0x49e0('0x4b')){var _0x582820=_0x5a57b4['get']({'plain':!![]});var _0x24da9b=_0x49e0('0x4c');return db[_0x49e0('0x4d')][_0x49e0('0x4e')]({'where':{'name':_0x24da9b,'userProfileId':_0x67618f[_0x49e0('0x4f')]},'raw':!![]})[_0x49e0('0x25')](function(_0x59a79f){if(_0x59a79f&&_0x59a79f[_0x49e0('0x50')]===0x0){return db['UserProfileResource'][_0x49e0('0x47')]({'name':_0x582820[_0x49e0('0x2a')],'resourceId':_0x582820['id'],'type':_0x59a79f['name'],'sectionId':_0x59a79f['id']},{})[_0x49e0('0x25')](function(){return _0x5a57b4;});}else{return _0x5a57b4;}})['catch'](function(_0x2b449e){logger[_0x49e0('0x51')](_0x49e0('0x52'),_0x2b449e);throw _0x2b449e;});}return _0x5a57b4;})[_0x49e0('0x25')](respondWithResult(_0x424bbc,0xc9))[_0x49e0('0x42')](handleError(_0x424bbc,null));};exports[_0x49e0('0x24')]=function(_0x224b3f,_0xaff74b){if(_0x224b3f[_0x49e0('0x48')]['id']){delete _0x224b3f[_0x49e0('0x48')]['id'];}return db[_0x49e0('0x2d')][_0x49e0('0x4e')]({'where':{'id':_0x224b3f['params']['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0xaff74b,null))['then'](saveUpdates(_0x224b3f['body'],null))[_0x49e0('0x25')](respondWithResult(_0xaff74b,null))[_0x49e0('0x42')](handleError(_0xaff74b,null));};exports[_0x49e0('0x26')]=function(_0x56932b,_0x24a6d9){return db[_0x49e0('0x2d')][_0x49e0('0x4e')]({'where':{'id':_0x56932b['params']['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0x24a6d9,null))[_0x49e0('0x25')](removeEntity(_0x24a6d9,null))[_0x49e0('0x42')](handleError(_0x24a6d9,null));};exports['describe']=function(_0x338f9b,_0x259038){return db['FaxQueue'][_0x49e0('0x53')]()[_0x49e0('0x25')](respondWithResult(_0x259038,null))['catch'](handleError(_0x259038,null));};exports[_0x49e0('0x54')]=function(_0x140437,_0x269215,_0x426292){var _0x7b8f80={'raw':!![],'where':{}},_0x1e3ed0={},_0x59b5b2;return db['FaxQueue'][_0x49e0('0x55')]({'where':{'id':_0x140437[_0x49e0('0x44')]['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0x269215,null))['then'](function(_0x2e59b4){if(_0x2e59b4){_0x59b5b2=_0x2e59b4['get']({'plain':!![]});_0x1e3ed0['model']=_[_0x49e0('0x45')](db['UserFaxQueue'][_0x49e0('0x2e')]);_0x1e3ed0['query']=_[_0x49e0('0x45')](_0x140437[_0x49e0('0x33')]);_0x1e3ed0[_0x49e0('0x34')]=_['intersection'](_0x1e3ed0[_0x49e0('0x32')],_0x1e3ed0['query']);_0x7b8f80[_0x49e0('0x35')]=_[_0x49e0('0x36')](_0x1e3ed0[_0x49e0('0x32')],qs[_0x49e0('0x37')](_0x140437['query'][_0x49e0('0x37')]));_0x7b8f80[_0x49e0('0x35')]=_0x7b8f80[_0x49e0('0x35')][_0x49e0('0x46')]?_0x7b8f80[_0x49e0('0x35')]:_0x1e3ed0[_0x49e0('0x32')];if(!_0x140437[_0x49e0('0x33')][_0x49e0('0x38')](_0x49e0('0x56'))){_0x7b8f80['limit']=qs[_0x49e0('0x1d')](_0x140437[_0x49e0('0x33')][_0x49e0('0x1d')]);_0x7b8f80[_0x49e0('0x1b')]=qs[_0x49e0('0x1b')](_0x140437[_0x49e0('0x33')]['offset']);}_0x7b8f80[_0x49e0('0x39')]=qs['sort'](_0x140437[_0x49e0('0x33')][_0x49e0('0x3a')]);_0x7b8f80[_0x49e0('0x3c')]=qs[_0x49e0('0x34')](_[_0x49e0('0x57')](_0x140437[_0x49e0('0x33')],_0x1e3ed0[_0x49e0('0x34')]));_0x7b8f80[_0x49e0('0x3c')][_0x49e0('0x58')]=_0x2e59b4['id'];if(_0x140437[_0x49e0('0x33')]['filter']){_0x7b8f80[_0x49e0('0x3c')]=_[_0x49e0('0x3e')](_0x7b8f80['where'],{'$or':_[_0x49e0('0x2c')](_0x7b8f80[_0x49e0('0x35')],function(_0x2bfc0b){var _0x2c22ef={};_0x2c22ef[_0x2bfc0b]={'$like':'%'+_0x140437['query'][_0x49e0('0x3b')]+'%'};return _0x2c22ef;})});}_0x7b8f80=_[_0x49e0('0x3e')]({},_0x7b8f80,_0x140437[_0x49e0('0x59')]);return db[_0x49e0('0x5a')]['findAll'](_0x7b8f80);}})[_0x49e0('0x25')](function(_0x23832d){if(_0x23832d){return db[_0x49e0('0x5b')][_0x49e0('0x5c')]({'where':{'id':_['map'](_0x23832d,_0x49e0('0x5d')),'role':_0x49e0('0x5e')},'attributes':['id',_0x49e0('0x2a'),'faxPause',_0x49e0('0x5f'),_0x49e0('0x60')]});}})[_0x49e0('0x25')](function(_0x3645fb){if(_0x3645fb){return{'count':_0x3645fb[_0x49e0('0x1e')],'rows':_[_0x49e0('0x2c')](_0x3645fb[_0x49e0('0x61')],function(_0x47e6eb){return{'membername':_0x47e6eb[_0x49e0('0x2a')],'UserId':_0x47e6eb['id'],'queue_name':_0x59b5b2[_0x49e0('0x2a')],'FaxQueueId':_0x59b5b2['id'],'interface':util[_0x49e0('0x62')](_0x49e0('0x63'),_0x49e0('0x64'),_0x47e6eb[_0x49e0('0x2a')]),'penalty':0x0,'paused':_0x47e6eb[_0x49e0('0x65')],'createdAt':_0x47e6eb['createdAt'],'updatedAt':_0x47e6eb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x49e0('0x25')](respondWithFilteredResult(_0x269215,_0x7b8f80))['catch'](handleError(_0x269215,null));};exports['getTeams']=function(_0x27bf80,_0x484fe8,_0x30c00f){var _0x55aa4f={};var _0x3f0503={};var _0x1e1435;var _0x1020b2;return db[_0x49e0('0x2d')]['findOne']({'where':{'id':_0x27bf80['params']['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0x484fe8,null))[_0x49e0('0x25')](function(_0x383d8b){if(_0x383d8b){_0x1e1435=_0x383d8b;_0x3f0503['model']=_[_0x49e0('0x45')](db['Team'][_0x49e0('0x2e')]);_0x3f0503[_0x49e0('0x33')]=_[_0x49e0('0x45')](_0x27bf80[_0x49e0('0x33')]);_0x3f0503[_0x49e0('0x34')]=_['intersection'](_0x3f0503['model'],_0x3f0503[_0x49e0('0x33')]);_0x55aa4f[_0x49e0('0x35')]=_['intersection'](_0x3f0503['model'],qs[_0x49e0('0x37')](_0x27bf80[_0x49e0('0x33')][_0x49e0('0x37')]));_0x55aa4f[_0x49e0('0x35')]=_0x55aa4f['attributes'][_0x49e0('0x46')]?_0x55aa4f[_0x49e0('0x35')]:_0x3f0503['model'];_0x55aa4f[_0x49e0('0x39')]=qs['sort'](_0x27bf80['query'][_0x49e0('0x3a')]);_0x55aa4f[_0x49e0('0x3c')]=qs[_0x49e0('0x34')](_['pick'](_0x27bf80[_0x49e0('0x33')],_0x3f0503['filters']));if(_0x27bf80[_0x49e0('0x33')]['filter']){_0x55aa4f[_0x49e0('0x3c')]=_[_0x49e0('0x3e')](_0x55aa4f[_0x49e0('0x3c')],{'$or':_['map'](_0x55aa4f[_0x49e0('0x35')],function(_0x512154){var _0x15c5e6={};_0x15c5e6[_0x512154]={'$like':'%'+_0x27bf80['query'][_0x49e0('0x3b')]+'%'};return _0x15c5e6;})});}_0x55aa4f=_[_0x49e0('0x3e')]({},_0x55aa4f,_0x27bf80[_0x49e0('0x59')]);return _0x1e1435[_0x49e0('0x66')](_0x55aa4f);}})[_0x49e0('0x25')](function(_0x22d959){if(_0x22d959){_0x1020b2=_0x22d959[_0x49e0('0x46')];if(!_0x27bf80['query'][_0x49e0('0x38')]('nolimit')){_0x55aa4f[_0x49e0('0x1d')]=qs['limit'](_0x27bf80[_0x49e0('0x33')][_0x49e0('0x1d')]);_0x55aa4f['offset']=qs['offset'](_0x27bf80[_0x49e0('0x33')][_0x49e0('0x1b')]);}return _0x1e1435[_0x49e0('0x66')](_0x55aa4f);}})[_0x49e0('0x25')](function(_0xccdc87){if(_0xccdc87){return _0xccdc87?{'count':_0x1020b2,'rows':_0xccdc87}:null;}})['then'](respondWithResult(_0x484fe8,null))[_0x49e0('0x42')](handleError(_0x484fe8,null));};exports['addTeams']=function(_0x15819b,_0x1645f6,_0xa6e287){var _0x2330b9=_0x15819b['body'][_0x49e0('0x67')];return db[_0x49e0('0x68')][_0x49e0('0x41')]({'where':{'id':_0x2330b9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x49e0('0x69'),'attributes':['id',_0x49e0('0x2a'),_0x49e0('0x6a'),_0x49e0('0x6b'),'interface'],'raw':!![]}]})[_0x49e0('0x25')](function(_0x20aa47){if(_0x20aa47){var _0x438532=_['flatMap'](_0x20aa47,function(_0x693c43){var _0x38441e=_0x693c43['get']({'plain':!![]});return _0x38441e[_0x49e0('0x69')];});return db[_0x49e0('0x2d')][_0x49e0('0x4e')]({'where':{'id':_0x15819b[_0x49e0('0x44')]['id']}})[_0x49e0('0x25')](function(_0x50de84){return db[_0x49e0('0x6c')]['transaction'](function(_0x3379cc){return _0x50de84['addTeams'](_0x2330b9,{'transaction':_0x3379cc})[_0x49e0('0x25')](function(){return BPromise['each'](_0x438532,function(_0x305b00){return db['UserFaxQueue'][_0x49e0('0x6d')]({'where':{'UserId':_0x305b00['id'],'FaxQueueId':_0x15819b[_0x49e0('0x44')]['id']},'transaction':_0x3379cc});});})[_0x49e0('0x25')](function(){_0x438532['forEach'](function(_0x3b05c2){socket[_0x49e0('0x6e')](_0x49e0('0x6f'),{'UserId':_0x3b05c2['id'],'FaxQueueId':_0x50de84['id']});});});});});}})['then'](respondWithStatusCode(_0x1645f6,null))[_0x49e0('0x42')](handleError(_0x1645f6,null));};exports['removeTeams']=function(_0x1ddaf9,_0x17db7b,_0x1a73a7){return db[_0x49e0('0x68')]['findAll']({'where':{'id':_0x1ddaf9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x49e0('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x49e0('0x25')](handleEntityNotFound(_0x17db7b,null))[_0x49e0('0x25')](function(_0x1f2240){var _0x2775b4=_[_0x49e0('0x2c')](_0x1f2240,'id');var _0x3e0889=[];var _0x29256e=[];var _0x4b3dd=squel[_0x49e0('0x70')]();_0x4b3dd[_0x49e0('0x71')](_0x49e0('0x72'))[_0x49e0('0x73')](_0x49e0('0x74'),'tq')[_0x49e0('0x75')](_0x49e0('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x49e0('0x3c')]('FaxQueueId\x20=\x20?',_0x1ddaf9['params']['id']);for(var _0xb11a85=0x0;_0xb11a85<_0x1f2240[_0x49e0('0x46')];_0xb11a85+=0x1){let _0x490958=_0x1f2240[_0xb11a85];for(var _0x453666=0x0;_0x453666<_0x490958[_0x49e0('0x69')][_0x49e0('0x46')];_0x453666+=0x1){let _0x2b00f5=_0x490958[_0x49e0('0x69')][_0x453666];var _0xce8572=_0x4b3dd['clone']();_0xce8572['where'](_0x49e0('0x77'),_0x2b00f5['id']);_0x29256e[_0x49e0('0x78')](db[_0x49e0('0x6c')][_0x49e0('0x33')](_0xce8572[_0x49e0('0x79')](),{'type':db[_0x49e0('0x6c')][_0x49e0('0x7a')]['SELECT']})['then'](function(_0x2c8bdf){if(_0x2c8bdf[_0x49e0('0x46')]===0x1){return _0x2b00f5['id'];}else{var _0x4c4cb5=_[_0x49e0('0x7b')](_[_0x49e0('0x2c')](_0x2c8bdf,_0x49e0('0x7c')),function(_0x31ca3d){return _[_0x49e0('0x7d')](_0x2775b4,_0x31ca3d);});if(_0x4c4cb5){return _0x2b00f5['id'];}}}));}}return BPromise[_0x49e0('0x7e')](_0x29256e)[_0x49e0('0x25')](function(_0x8407b1){_0x3e0889=_(_0x3e0889)[_0x49e0('0x7f')](_0x8407b1)[_0x49e0('0x80')]()[_0x49e0('0x81')]();return db[_0x49e0('0x2d')][_0x49e0('0x4e')]({'where':{'id':_0x1ddaf9[_0x49e0('0x44')]['id']}})[_0x49e0('0x25')](function(_0x5e5813){return db[_0x49e0('0x6c')][_0x49e0('0x82')](function(_0x5b4e49){return _0x5e5813[_0x49e0('0x83')](_0x1ddaf9['query'][_0x49e0('0x67')],{'transaction':_0x5b4e49})['then'](function(){if(!_[_0x49e0('0x84')](_0x3e0889)){return _0x5e5813[_0x49e0('0x85')](_0x3e0889,{'transaction':_0x5b4e49});}})[_0x49e0('0x25')](function(){_0x3e0889[_0x49e0('0x86')](function(_0x2b6a80){socket[_0x49e0('0x6e')](_0x49e0('0x87'),{'UserId':_0x2b6a80,'FaxQueueId':_0x5e5813['id']});});});});});});})[_0x49e0('0x25')](respondWithStatusCode(_0x17db7b,null))[_0x49e0('0x42')](handleError(_0x17db7b,null));};exports['addAgents']=function(_0x29ad53,_0x11b3e1,_0x2798f2){return db[_0x49e0('0x2d')][_0x49e0('0x4e')]({'where':{'id':_0x29ad53[_0x49e0('0x44')]['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0x11b3e1,null))[_0x49e0('0x25')](function(_0x143efa){if(_0x143efa){return _0x143efa[_0x49e0('0x88')](_0x29ad53[_0x49e0('0x48')][_0x49e0('0x67')],_[_0x49e0('0x89')](_0x29ad53[_0x49e0('0x48')],['ids','id'])||{})[_0x49e0('0x8a')](function(_0x2f1116){for(var _0x7f5ee9=0x0;_0x7f5ee9<_0x29ad53[_0x49e0('0x48')][_0x49e0('0x67')][_0x49e0('0x46')];_0x7f5ee9+=0x1){socket['emit'](_0x49e0('0x6f'),{'UserId':Number(_0x29ad53[_0x49e0('0x48')]['ids'][_0x7f5ee9]),'FaxQueueId':Number(_0x29ad53[_0x49e0('0x44')]['id'])});}return _0x2f1116;});}})['then'](respondWithResult(_0x11b3e1,null))['catch'](handleError(_0x11b3e1,null));};exports[_0x49e0('0x85')]=function(_0x217281,_0xf3b71a,_0x1c801f){return db[_0x49e0('0x2d')][_0x49e0('0x4e')]({'where':{'id':_0x217281['params']['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0xf3b71a,null))['then'](function(_0x7bc9a8){if(_0x7bc9a8){return _0x7bc9a8['removeAgents'](_0x217281['query']['ids'])[_0x49e0('0x25')](function(){if(_[_0x49e0('0x8b')](_0x217281[_0x49e0('0x33')][_0x49e0('0x67')])){for(var _0x28473e=0x0;_0x28473e<_0x217281[_0x49e0('0x33')]['ids'][_0x49e0('0x46')];_0x28473e+=0x1){socket[_0x49e0('0x6e')](_0x49e0('0x87'),{'UserId':Number(_0x217281[_0x49e0('0x33')][_0x49e0('0x67')][_0x28473e]),'FaxQueueId':Number(_0x217281[_0x49e0('0x44')]['id'])});}}else{socket['emit'](_0x49e0('0x87'),{'UserId':Number(_0x217281[_0x49e0('0x33')][_0x49e0('0x67')]),'FaxQueueId':Number(_0x217281[_0x49e0('0x44')]['id'])});}});}})[_0x49e0('0x25')](respondWithStatusCode(_0xf3b71a,null))[_0x49e0('0x42')](handleError(_0xf3b71a,null));};exports[_0x49e0('0x8c')]=function(_0x2a2c23,_0x168028,_0x5c88d2){var _0x2bcf42={};var _0x1a1231={};var _0x5100be;var _0x5db48f;return db[_0x49e0('0x2d')]['findOne']({'where':{'id':_0x2a2c23[_0x49e0('0x44')]['id']}})[_0x49e0('0x25')](handleEntityNotFound(_0x168028,null))[_0x49e0('0x25')](function(_0x16a005){if(_0x16a005){_0x5100be=_0x16a005;_0x1a1231[_0x49e0('0x32')]=_[_0x49e0('0x45')](db[_0x49e0('0x5b')][_0x49e0('0x2e')]);_0x1a1231[_0x49e0('0x33')]=_[_0x49e0('0x45')](_0x2a2c23[_0x49e0('0x33')]);_0x1a1231[_0x49e0('0x34')]=_[_0x49e0('0x36')](_0x1a1231[_0x49e0('0x32')],_0x1a1231['query']);_0x2bcf42[_0x49e0('0x35')]=_[_0x49e0('0x36')](_0x1a1231[_0x49e0('0x32')],qs['fields'](_0x2a2c23[_0x49e0('0x33')][_0x49e0('0x37')]));_0x2bcf42['attributes']=_0x2bcf42[_0x49e0('0x35')][_0x49e0('0x46')]?_0x2bcf42[_0x49e0('0x35')]:_0x1a1231[_0x49e0('0x32')];_0x2bcf42[_0x49e0('0x39')]=qs['sort'](_0x2a2c23[_0x49e0('0x33')]['sort']);_0x2bcf42[_0x49e0('0x3c')]=qs[_0x49e0('0x34')](_['pick'](_0x2a2c23[_0x49e0('0x33')],_0x1a1231[_0x49e0('0x34')]));if(_0x2a2c23[_0x49e0('0x33')]['filter']){_0x2bcf42[_0x49e0('0x3c')]=_['merge'](_0x2bcf42[_0x49e0('0x3c')],{'$or':_[_0x49e0('0x2c')](_0x2bcf42['attributes'],function(_0x33d589){var _0xf02a25={};_0xf02a25[_0x33d589]={'$like':'%'+_0x2a2c23['query']['filter']+'%'};return _0xf02a25;})});}_0x2bcf42=_[_0x49e0('0x3e')]({},_0x2bcf42,_0x2a2c23[_0x49e0('0x59')]);return _0x5100be[_0x49e0('0x8c')](_0x2bcf42);}})[_0x49e0('0x25')](function(_0xf4f777){if(_0xf4f777){_0x5db48f=_0xf4f777[_0x49e0('0x46')];if(!_0x2a2c23[_0x49e0('0x33')][_0x49e0('0x38')](_0x49e0('0x56'))){_0x2bcf42[_0x49e0('0x1d')]=qs[_0x49e0('0x1d')](_0x2a2c23[_0x49e0('0x33')]['limit']);_0x2bcf42['offset']=qs[_0x49e0('0x1b')](_0x2a2c23[_0x49e0('0x33')][_0x49e0('0x1b')]);}return _0x5100be[_0x49e0('0x8c')](_0x2bcf42);}})['then'](function(_0x514687){if(_0x514687){return _0x514687?{'count':_0x5db48f,'rows':_0x514687}:null;}})['then'](respondWithResult(_0x168028,null))[_0x49e0('0x42')](handleError(_0x168028,null));}; \ No newline at end of file +var _0x8657=['set','Content-Range','apply','reject','save','update','then','FaxQueues','UserProfileResource','destroy','sendStatus','stack','name','index','map','FaxQueue','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','describe','getMembers','UserFaxQueue','FaxQueueId','options','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','ids','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','compact','removeTeams','addAgents','omit','spread','userFaxQueue:remove','getAgents','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','status','end','json','offset','undefined','limit','count'];(function(_0x458935,_0x1a5dcc){var _0x68df90=function(_0x1cca90){while(--_0x1cca90){_0x458935['push'](_0x458935['shift']());}};_0x68df90(++_0x1a5dcc);}(_0x8657,0xe8));var _0x7865=function(_0x2bd006,_0x2dfcdc){_0x2bd006=_0x2bd006-0x0;var _0x2ae544=_0x8657[_0x2bd006];return _0x2ae544;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7865('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7865('0x1'));var moment=require('moment');var BPromise=require(_0x7865('0x2'));var Mustache=require(_0x7865('0x3'));var util=require(_0x7865('0x4'));var path=require(_0x7865('0x5'));var sox=require(_0x7865('0x6'));var csv=require(_0x7865('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7865('0x8'));var _=require(_0x7865('0x9'));var squel=require(_0x7865('0xa'));var crypto=require(_0x7865('0xb'));var jsforce=require(_0x7865('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7865('0x7'));var querystring=require(_0x7865('0xd'));var Papa=require('papaparse');var Redis=require(_0x7865('0xe'));var authService=require(_0x7865('0xf'));var qs=require(_0x7865('0x10'));var as=require(_0x7865('0x11'));var hardwareService=require(_0x7865('0x12'));var logger=require(_0x7865('0x13'))('api');var utils=require(_0x7865('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7865('0x15'))['db'];config[_0x7865('0x16')]=_[_0x7865('0x17')](config[_0x7865('0x16')],{'host':_0x7865('0x18'),'port':0x18eb});var socket=require(_0x7865('0x19'))(new Redis(config[_0x7865('0x16')]));require(_0x7865('0x1a'))['register'](socket);function respondWithStatusCode(_0x3d08bd,_0x50d020){_0x50d020=_0x50d020||0xcc;return function(_0x402041){if(_0x402041){return _0x3d08bd['sendStatus'](_0x50d020);}return _0x3d08bd[_0x7865('0x1b')](_0x50d020)[_0x7865('0x1c')]();};}function respondWithResult(_0x334441,_0x131528){_0x131528=_0x131528||0xc8;return function(_0x40b461){if(_0x40b461){return _0x334441[_0x7865('0x1b')](_0x131528)[_0x7865('0x1d')](_0x40b461);}};}function respondWithFilteredResult(_0x47f8d2,_0x35e7f9){return function(_0x4716fd){if(_0x4716fd){var _0x285481=typeof _0x35e7f9[_0x7865('0x1e')]===_0x7865('0x1f')&&typeof _0x35e7f9[_0x7865('0x20')]==='undefined';var _0x528003=_0x4716fd[_0x7865('0x21')];var _0x53c808=_0x285481?0x0:_0x35e7f9['offset'];var _0x2067cf=_0x285481?_0x4716fd[_0x7865('0x21')]:_0x35e7f9[_0x7865('0x1e')]+_0x35e7f9[_0x7865('0x20')];var _0x3d6e45;if(_0x2067cf>=_0x528003){_0x2067cf=_0x528003;_0x3d6e45=0xc8;}else{_0x3d6e45=0xce;}_0x47f8d2[_0x7865('0x1b')](_0x3d6e45);return _0x47f8d2[_0x7865('0x22')](_0x7865('0x23'),_0x53c808+'-'+_0x2067cf+'/'+_0x528003)[_0x7865('0x1d')](_0x4716fd);}return null;};}function patchUpdates(_0x39dcd5){return function(_0x1e0df0){try{jsonpatch[_0x7865('0x24')](_0x1e0df0,_0x39dcd5,!![]);}catch(_0x2cc34a){return BPromise[_0x7865('0x25')](_0x2cc34a);}return _0x1e0df0[_0x7865('0x26')]();};}function saveUpdates(_0x47cbca,_0x11d54a){return function(_0x49580e){if(_0x49580e){return _0x49580e[_0x7865('0x27')](_0x47cbca)[_0x7865('0x28')](function(_0x283f23){return _0x283f23;});}return null;};}function removeEntity(_0x59416f,_0xa0d904){return function(_0x210246){if(_0x210246){return _0x210246['destroy']()[_0x7865('0x28')](function(){var _0x183d31=_0x210246['get']({'plain':!![]});var _0x59bbdf=_0x7865('0x29');return db[_0x7865('0x2a')][_0x7865('0x2b')]({'where':{'type':_0x59bbdf,'resourceId':_0x183d31['id']}})[_0x7865('0x28')](function(){return _0x210246;});})[_0x7865('0x28')](function(){_0x59416f[_0x7865('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x239a25,_0x11f8b7){return function(_0x1b157d){if(!_0x1b157d){_0x239a25[_0x7865('0x2c')](0x194);}return _0x1b157d;};}function handleError(_0x32ca62,_0xc5b0da){_0xc5b0da=_0xc5b0da||0x1f4;return function(_0x5bdb73){logger['error'](_0x5bdb73[_0x7865('0x2d')]);if(_0x5bdb73[_0x7865('0x2e')]){delete _0x5bdb73[_0x7865('0x2e')];}_0x32ca62[_0x7865('0x1b')](_0xc5b0da)['send'](_0x5bdb73);};}exports[_0x7865('0x2f')]=function(_0x233b67,_0x1e44e1){var _0x19713e={},_0x4aff00={},_0x42e64f={'count':0x0,'rows':[]};var _0xd5a450=_[_0x7865('0x30')](db[_0x7865('0x31')][_0x7865('0x32')],function(_0x330be9){return{'name':_0x330be9['fieldName'],'type':_0x330be9[_0x7865('0x33')]['key']};});_0x4aff00[_0x7865('0x34')]=_['map'](_0xd5a450,_0x7865('0x2e'));_0x4aff00['query']=_['keys'](_0x233b67[_0x7865('0x35')]);_0x4aff00[_0x7865('0x36')]=_['intersection'](_0x4aff00[_0x7865('0x34')],_0x4aff00['query']);_0x19713e['attributes']=_[_0x7865('0x37')](_0x4aff00[_0x7865('0x34')],qs['fields'](_0x233b67['query'][_0x7865('0x38')]));_0x19713e[_0x7865('0x39')]=_0x19713e[_0x7865('0x39')][_0x7865('0x3a')]?_0x19713e[_0x7865('0x39')]:_0x4aff00[_0x7865('0x34')];if(!_0x233b67['query'][_0x7865('0x3b')](_0x7865('0x3c'))){_0x19713e['limit']=qs['limit'](_0x233b67['query'][_0x7865('0x20')]);_0x19713e[_0x7865('0x1e')]=qs[_0x7865('0x1e')](_0x233b67[_0x7865('0x35')]['offset']);}_0x19713e[_0x7865('0x3d')]=qs['sort'](_0x233b67['query'][_0x7865('0x3e')]);_0x19713e[_0x7865('0x3f')]=qs[_0x7865('0x36')](_[_0x7865('0x40')](_0x233b67[_0x7865('0x35')],_0x4aff00[_0x7865('0x36')]),_0xd5a450);if(_0x233b67[_0x7865('0x35')][_0x7865('0x41')]){_0x19713e[_0x7865('0x3f')]=_[_0x7865('0x42')](_0x19713e['where'],{'$or':_[_0x7865('0x30')](_0xd5a450,function(_0x54fa4f){if(_0x54fa4f['type']!=='VIRTUAL'){var _0x57ce73={};_0x57ce73[_0x54fa4f['name']]={'$like':'%'+_0x233b67[_0x7865('0x35')][_0x7865('0x41')]+'%'};return _0x57ce73;}})});}_0x19713e=_[_0x7865('0x42')]({},_0x19713e,_0x233b67['options']);var _0x5ae2ad={'where':_0x19713e[_0x7865('0x3f')]};return db['FaxQueue'][_0x7865('0x21')](_0x5ae2ad)[_0x7865('0x28')](function(_0x177666){_0x42e64f[_0x7865('0x21')]=_0x177666;if(_0x233b67['query'][_0x7865('0x43')]){_0x19713e[_0x7865('0x44')]=[{'all':!![]}];}return db[_0x7865('0x31')][_0x7865('0x45')](_0x19713e);})['then'](function(_0x508a09){_0x42e64f[_0x7865('0x46')]=_0x508a09;return _0x42e64f;})[_0x7865('0x28')](respondWithFilteredResult(_0x1e44e1,_0x19713e))[_0x7865('0x47')](handleError(_0x1e44e1,null));};exports['show']=function(_0x4baa5e,_0x4d7d08){var _0x61bad3={'raw':!![],'where':{'id':_0x4baa5e[_0x7865('0x48')]['id']}},_0x2e6232={};_0x2e6232['model']=_[_0x7865('0x49')](db[_0x7865('0x31')][_0x7865('0x32')]);_0x2e6232[_0x7865('0x35')]=_[_0x7865('0x49')](_0x4baa5e[_0x7865('0x35')]);_0x2e6232[_0x7865('0x36')]=_['intersection'](_0x2e6232[_0x7865('0x34')],_0x2e6232['query']);_0x61bad3['attributes']=_[_0x7865('0x37')](_0x2e6232[_0x7865('0x34')],qs[_0x7865('0x38')](_0x4baa5e['query'][_0x7865('0x38')]));_0x61bad3[_0x7865('0x39')]=_0x61bad3[_0x7865('0x39')][_0x7865('0x3a')]?_0x61bad3[_0x7865('0x39')]:_0x2e6232['model'];if(_0x4baa5e[_0x7865('0x35')]['includeAll']){_0x61bad3[_0x7865('0x44')]=[{'all':!![]}];}_0x61bad3=_[_0x7865('0x42')]({},_0x61bad3,_0x4baa5e['options']);return db[_0x7865('0x31')][_0x7865('0x4a')](_0x61bad3)[_0x7865('0x28')](handleEntityNotFound(_0x4d7d08,null))['then'](respondWithResult(_0x4d7d08,null))[_0x7865('0x47')](handleError(_0x4d7d08,null));};exports[_0x7865('0x4b')]=function(_0x2c3f3b,_0xadb320){return db['FaxQueue'][_0x7865('0x4b')](_0x2c3f3b['body'],{})[_0x7865('0x28')](function(_0x13ba38){var _0x2dd979=_0x2c3f3b[_0x7865('0x4c')][_0x7865('0x4d')]({'plain':!![]});if(!_0x2dd979)throw new Error(_0x7865('0x4e'));if(_0x2dd979[_0x7865('0x4f')]===_0x7865('0x4c')){var _0x55e689=_0x13ba38[_0x7865('0x4d')]({'plain':!![]});var _0x333682=_0x7865('0x29');return db[_0x7865('0x50')][_0x7865('0x4a')]({'where':{'name':_0x333682,'userProfileId':_0x2dd979[_0x7865('0x51')]},'raw':!![]})[_0x7865('0x28')](function(_0x545e69){if(_0x545e69&&_0x545e69['autoAssociation']===0x0){return db[_0x7865('0x2a')]['create']({'name':_0x55e689[_0x7865('0x2e')],'resourceId':_0x55e689['id'],'type':_0x545e69[_0x7865('0x2e')],'sectionId':_0x545e69['id']},{})[_0x7865('0x28')](function(){return _0x13ba38;});}else{return _0x13ba38;}})[_0x7865('0x47')](function(_0x4e1fbf){logger[_0x7865('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e1fbf);throw _0x4e1fbf;});}return _0x13ba38;})[_0x7865('0x28')](respondWithResult(_0xadb320,0xc9))[_0x7865('0x47')](handleError(_0xadb320,null));};exports[_0x7865('0x27')]=function(_0x414d19,_0x520e13){if(_0x414d19[_0x7865('0x53')]['id']){delete _0x414d19[_0x7865('0x53')]['id'];}return db[_0x7865('0x31')][_0x7865('0x4a')]({'where':{'id':_0x414d19[_0x7865('0x48')]['id']}})[_0x7865('0x28')](handleEntityNotFound(_0x520e13,null))[_0x7865('0x28')](saveUpdates(_0x414d19[_0x7865('0x53')],null))[_0x7865('0x28')](respondWithResult(_0x520e13,null))['catch'](handleError(_0x520e13,null));};exports[_0x7865('0x2b')]=function(_0x281bb9,_0x3e7ab9){return db[_0x7865('0x31')]['find']({'where':{'id':_0x281bb9[_0x7865('0x48')]['id']}})[_0x7865('0x28')](handleEntityNotFound(_0x3e7ab9,null))[_0x7865('0x28')](removeEntity(_0x3e7ab9,null))[_0x7865('0x47')](handleError(_0x3e7ab9,null));};exports['describe']=function(_0x8ceb68,_0x2d2996){return db['FaxQueue'][_0x7865('0x54')]()['then'](respondWithResult(_0x2d2996,null))['catch'](handleError(_0x2d2996,null));};exports[_0x7865('0x55')]=function(_0x46c080,_0x92566,_0x3cb018){var _0xe525f4={'raw':!![],'where':{}},_0x5645c4={},_0x5b4704;return db[_0x7865('0x31')]['findOne']({'where':{'id':_0x46c080[_0x7865('0x48')]['id']}})[_0x7865('0x28')](handleEntityNotFound(_0x92566,null))['then'](function(_0xfa28d3){if(_0xfa28d3){_0x5b4704=_0xfa28d3['get']({'plain':!![]});_0x5645c4[_0x7865('0x34')]=_[_0x7865('0x49')](db[_0x7865('0x56')][_0x7865('0x32')]);_0x5645c4[_0x7865('0x35')]=_[_0x7865('0x49')](_0x46c080['query']);_0x5645c4[_0x7865('0x36')]=_[_0x7865('0x37')](_0x5645c4[_0x7865('0x34')],_0x5645c4[_0x7865('0x35')]);_0xe525f4[_0x7865('0x39')]=_[_0x7865('0x37')](_0x5645c4['model'],qs['fields'](_0x46c080[_0x7865('0x35')][_0x7865('0x38')]));_0xe525f4[_0x7865('0x39')]=_0xe525f4[_0x7865('0x39')]['length']?_0xe525f4[_0x7865('0x39')]:_0x5645c4['model'];if(!_0x46c080[_0x7865('0x35')][_0x7865('0x3b')](_0x7865('0x3c'))){_0xe525f4[_0x7865('0x20')]=qs[_0x7865('0x20')](_0x46c080[_0x7865('0x35')][_0x7865('0x20')]);_0xe525f4[_0x7865('0x1e')]=qs[_0x7865('0x1e')](_0x46c080['query'][_0x7865('0x1e')]);}_0xe525f4[_0x7865('0x3d')]=qs[_0x7865('0x3e')](_0x46c080[_0x7865('0x35')][_0x7865('0x3e')]);_0xe525f4['where']=qs[_0x7865('0x36')](_[_0x7865('0x40')](_0x46c080[_0x7865('0x35')],_0x5645c4[_0x7865('0x36')]));_0xe525f4[_0x7865('0x3f')][_0x7865('0x57')]=_0xfa28d3['id'];if(_0x46c080[_0x7865('0x35')][_0x7865('0x41')]){_0xe525f4[_0x7865('0x3f')]=_['merge'](_0xe525f4[_0x7865('0x3f')],{'$or':_[_0x7865('0x30')](_0xe525f4[_0x7865('0x39')],function(_0x3b7b89){var _0x42ff90={};_0x42ff90[_0x3b7b89]={'$like':'%'+_0x46c080[_0x7865('0x35')][_0x7865('0x41')]+'%'};return _0x42ff90;})});}_0xe525f4=_[_0x7865('0x42')]({},_0xe525f4,_0x46c080[_0x7865('0x58')]);return db['UserFaxQueue']['findAll'](_0xe525f4);}})[_0x7865('0x28')](function(_0x59de86){if(_0x59de86){return db['User'][_0x7865('0x59')]({'where':{'id':_[_0x7865('0x30')](_0x59de86,_0x7865('0x5a')),'role':_0x7865('0x5b')},'attributes':['id',_0x7865('0x2e'),'faxPause',_0x7865('0x5c'),_0x7865('0x5d')]});}})[_0x7865('0x28')](function(_0x1b59d4){if(_0x1b59d4){return{'count':_0x1b59d4[_0x7865('0x21')],'rows':_[_0x7865('0x30')](_0x1b59d4[_0x7865('0x46')],function(_0x455e06){return{'membername':_0x455e06[_0x7865('0x2e')],'UserId':_0x455e06['id'],'queue_name':_0x5b4704[_0x7865('0x2e')],'FaxQueueId':_0x5b4704['id'],'interface':util[_0x7865('0x5e')](_0x7865('0x5f'),_0x7865('0x60'),_0x455e06[_0x7865('0x2e')]),'penalty':0x0,'paused':_0x455e06[_0x7865('0x61')],'createdAt':_0x455e06['createdAt'],'updatedAt':_0x455e06[_0x7865('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7865('0x28')](respondWithFilteredResult(_0x92566,_0xe525f4))[_0x7865('0x47')](handleError(_0x92566,null));};exports[_0x7865('0x62')]=function(_0x108afc,_0xcbd275,_0x35c06d){var _0x4db885={};var _0x3bc457={};var _0x3ea8f5;var _0x5b935c;return db[_0x7865('0x31')][_0x7865('0x63')]({'where':{'id':_0x108afc[_0x7865('0x48')]['id']}})[_0x7865('0x28')](handleEntityNotFound(_0xcbd275,null))[_0x7865('0x28')](function(_0x1678d6){if(_0x1678d6){_0x3ea8f5=_0x1678d6;_0x3bc457[_0x7865('0x34')]=_[_0x7865('0x49')](db[_0x7865('0x64')]['rawAttributes']);_0x3bc457[_0x7865('0x35')]=_['keys'](_0x108afc[_0x7865('0x35')]);_0x3bc457[_0x7865('0x36')]=_[_0x7865('0x37')](_0x3bc457[_0x7865('0x34')],_0x3bc457[_0x7865('0x35')]);_0x4db885['attributes']=_[_0x7865('0x37')](_0x3bc457['model'],qs['fields'](_0x108afc[_0x7865('0x35')][_0x7865('0x38')]));_0x4db885[_0x7865('0x39')]=_0x4db885[_0x7865('0x39')][_0x7865('0x3a')]?_0x4db885[_0x7865('0x39')]:_0x3bc457[_0x7865('0x34')];_0x4db885[_0x7865('0x3d')]=qs['sort'](_0x108afc[_0x7865('0x35')][_0x7865('0x3e')]);_0x4db885[_0x7865('0x3f')]=qs[_0x7865('0x36')](_[_0x7865('0x40')](_0x108afc[_0x7865('0x35')],_0x3bc457[_0x7865('0x36')]));if(_0x108afc[_0x7865('0x35')][_0x7865('0x41')]){_0x4db885[_0x7865('0x3f')]=_[_0x7865('0x42')](_0x4db885[_0x7865('0x3f')],{'$or':_[_0x7865('0x30')](_0x4db885[_0x7865('0x39')],function(_0x175274){var _0x72f8fb={};_0x72f8fb[_0x175274]={'$like':'%'+_0x108afc[_0x7865('0x35')]['filter']+'%'};return _0x72f8fb;})});}_0x4db885=_[_0x7865('0x42')]({},_0x4db885,_0x108afc[_0x7865('0x58')]);return _0x3ea8f5[_0x7865('0x62')](_0x4db885);}})['then'](function(_0x174ffa){if(_0x174ffa){_0x5b935c=_0x174ffa[_0x7865('0x3a')];if(!_0x108afc[_0x7865('0x35')]['hasOwnProperty'](_0x7865('0x3c'))){_0x4db885['limit']=qs[_0x7865('0x20')](_0x108afc[_0x7865('0x35')][_0x7865('0x20')]);_0x4db885['offset']=qs[_0x7865('0x1e')](_0x108afc['query'][_0x7865('0x1e')]);}return _0x3ea8f5[_0x7865('0x62')](_0x4db885);}})[_0x7865('0x28')](function(_0xd28c1){if(_0xd28c1){return _0xd28c1?{'count':_0x5b935c,'rows':_0xd28c1}:null;}})[_0x7865('0x28')](respondWithResult(_0xcbd275,null))['catch'](handleError(_0xcbd275,null));};exports[_0x7865('0x65')]=function(_0xcd1e4d,_0xfc186f,_0x46cbd5){var _0x24bc76=_0xcd1e4d['body']['ids'];return db[_0x7865('0x64')]['findAll']({'where':{'id':_0x24bc76},'attributes':['id'],'include':[{'model':db[_0x7865('0x66')],'as':_0x7865('0x67'),'attributes':['id','name',_0x7865('0x68'),_0x7865('0x69'),'interface'],'raw':!![]}]})[_0x7865('0x28')](function(_0x91b522){if(_0x91b522){var _0x5a35fd=_[_0x7865('0x6a')](_0x91b522,function(_0x32598e){var _0x1e1e45=_0x32598e['get']({'plain':!![]});return _0x1e1e45['Agents'];});return db[_0x7865('0x31')]['find']({'where':{'id':_0xcd1e4d['params']['id']}})[_0x7865('0x28')](function(_0x259cfa){return db[_0x7865('0x6b')][_0x7865('0x6c')](function(_0x86b9f5){return _0x259cfa['addTeams'](_0x24bc76,{'transaction':_0x86b9f5})[_0x7865('0x28')](function(){return BPromise['each'](_0x5a35fd,function(_0x33f2e5){return db['UserFaxQueue'][_0x7865('0x6d')]({'where':{'UserId':_0x33f2e5['id'],'FaxQueueId':_0xcd1e4d['params']['id']},'transaction':_0x86b9f5});});})['then'](function(){_0x5a35fd[_0x7865('0x6e')](function(_0x277bf7){socket[_0x7865('0x6f')](_0x7865('0x70'),{'UserId':_0x277bf7['id'],'FaxQueueId':_0x259cfa['id']});});});});});}})[_0x7865('0x28')](respondWithStatusCode(_0xfc186f,null))[_0x7865('0x47')](handleError(_0xfc186f,null));};exports['removeTeams']=function(_0x45eed1,_0x8bd8f4,_0x464aa3){return db[_0x7865('0x64')][_0x7865('0x45')]({'where':{'id':_0x45eed1[_0x7865('0x35')][_0x7865('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7865('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7865('0x28')](handleEntityNotFound(_0x8bd8f4,null))['then'](function(_0x38c06f){var _0x2aa74f=_[_0x7865('0x30')](_0x38c06f,'id');var _0x4e1a9b=[];var _0x51e64f=[];var _0x3247df=squel['select']();_0x3247df[_0x7865('0x72')](_0x7865('0x73'))[_0x7865('0x74')](_0x7865('0x75'),'tq')[_0x7865('0x76')](_0x7865('0x77'),'ut',_0x7865('0x78'))['where']('FaxQueueId\x20=\x20?',_0x45eed1['params']['id']);for(var _0x4b7521=0x0;_0x4b7521<_0x38c06f[_0x7865('0x3a')];_0x4b7521+=0x1){let _0x20c589=_0x38c06f[_0x4b7521];for(var _0xe3fa27=0x0;_0xe3fa27<_0x20c589[_0x7865('0x67')]['length'];_0xe3fa27+=0x1){let _0x32b187=_0x20c589['Agents'][_0xe3fa27];var _0x5edbac=_0x3247df[_0x7865('0x79')]();_0x5edbac[_0x7865('0x3f')](_0x7865('0x7a'),_0x32b187['id']);_0x51e64f['push'](db['sequelize'][_0x7865('0x35')](_0x5edbac['toString'](),{'type':db[_0x7865('0x6b')][_0x7865('0x7b')]['SELECT']})[_0x7865('0x28')](function(_0x18bb66){if(_0x18bb66['length']===0x1){return _0x32b187['id'];}else{var _0x3b9efc=_[_0x7865('0x7c')](_[_0x7865('0x30')](_0x18bb66,'TeamId'),function(_0x11a02b){return _[_0x7865('0x7d')](_0x2aa74f,_0x11a02b);});if(_0x3b9efc){return _0x32b187['id'];}}}));}}return BPromise['all'](_0x51e64f)[_0x7865('0x28')](function(_0x2b8679){_0x4e1a9b=_(_0x4e1a9b)['union'](_0x2b8679)[_0x7865('0x7e')]()['value']();return db['FaxQueue'][_0x7865('0x4a')]({'where':{'id':_0x45eed1[_0x7865('0x48')]['id']}})[_0x7865('0x28')](function(_0x147bae){return db[_0x7865('0x6b')][_0x7865('0x6c')](function(_0x2c8455){return _0x147bae[_0x7865('0x7f')](_0x45eed1['query']['ids'],{'transaction':_0x2c8455})[_0x7865('0x28')](function(){if(!_['isEmpty'](_0x4e1a9b)){return _0x147bae['removeAgents'](_0x4e1a9b,{'transaction':_0x2c8455});}})[_0x7865('0x28')](function(){_0x4e1a9b[_0x7865('0x6e')](function(_0x56bb5a){socket[_0x7865('0x6f')]('userFaxQueue:remove',{'UserId':_0x56bb5a,'FaxQueueId':_0x147bae['id']});});});});});});})[_0x7865('0x28')](respondWithStatusCode(_0x8bd8f4,null))[_0x7865('0x47')](handleError(_0x8bd8f4,null));};exports[_0x7865('0x80')]=function(_0x12e910,_0x82fb38,_0x275594){return db[_0x7865('0x31')][_0x7865('0x4a')]({'where':{'id':_0x12e910['params']['id']}})['then'](handleEntityNotFound(_0x82fb38,null))[_0x7865('0x28')](function(_0x8770f8){if(_0x8770f8){return _0x8770f8[_0x7865('0x80')](_0x12e910[_0x7865('0x53')]['ids'],_[_0x7865('0x81')](_0x12e910[_0x7865('0x53')],[_0x7865('0x71'),'id'])||{})[_0x7865('0x82')](function(_0xb33bbf){for(var _0x5e482b=0x0;_0x5e482b<_0x12e910[_0x7865('0x53')][_0x7865('0x71')][_0x7865('0x3a')];_0x5e482b+=0x1){socket[_0x7865('0x6f')]('userFaxQueue:save',{'UserId':Number(_0x12e910[_0x7865('0x53')][_0x7865('0x71')][_0x5e482b]),'FaxQueueId':Number(_0x12e910['params']['id'])});}return _0xb33bbf;});}})[_0x7865('0x28')](respondWithResult(_0x82fb38,null))[_0x7865('0x47')](handleError(_0x82fb38,null));};exports['removeAgents']=function(_0x53cb6d,_0xe900c0,_0x49d1b7){return db[_0x7865('0x31')][_0x7865('0x4a')]({'where':{'id':_0x53cb6d[_0x7865('0x48')]['id']}})[_0x7865('0x28')](handleEntityNotFound(_0xe900c0,null))[_0x7865('0x28')](function(_0x123a62){if(_0x123a62){return _0x123a62['removeAgents'](_0x53cb6d[_0x7865('0x35')][_0x7865('0x71')])[_0x7865('0x28')](function(){if(_['isArray'](_0x53cb6d[_0x7865('0x35')][_0x7865('0x71')])){for(var _0x2ee188=0x0;_0x2ee188<_0x53cb6d['query']['ids'][_0x7865('0x3a')];_0x2ee188+=0x1){socket[_0x7865('0x6f')](_0x7865('0x83'),{'UserId':Number(_0x53cb6d[_0x7865('0x35')][_0x7865('0x71')][_0x2ee188]),'FaxQueueId':Number(_0x53cb6d[_0x7865('0x48')]['id'])});}}else{socket[_0x7865('0x6f')](_0x7865('0x83'),{'UserId':Number(_0x53cb6d[_0x7865('0x35')]['ids']),'FaxQueueId':Number(_0x53cb6d[_0x7865('0x48')]['id'])});}});}})[_0x7865('0x28')](respondWithStatusCode(_0xe900c0,null))[_0x7865('0x47')](handleError(_0xe900c0,null));};exports[_0x7865('0x84')]=function(_0x132070,_0x2a0a56,_0x3ed327){var _0x13edd2={};var _0x45012a={};var _0xf99a4d;var _0x118314;return db['FaxQueue'][_0x7865('0x63')]({'where':{'id':_0x132070[_0x7865('0x48')]['id']}})[_0x7865('0x28')](handleEntityNotFound(_0x2a0a56,null))['then'](function(_0x18f07d){if(_0x18f07d){_0xf99a4d=_0x18f07d;_0x45012a[_0x7865('0x34')]=_[_0x7865('0x49')](db[_0x7865('0x66')]['rawAttributes']);_0x45012a['query']=_['keys'](_0x132070[_0x7865('0x35')]);_0x45012a[_0x7865('0x36')]=_[_0x7865('0x37')](_0x45012a['model'],_0x45012a[_0x7865('0x35')]);_0x13edd2[_0x7865('0x39')]=_[_0x7865('0x37')](_0x45012a[_0x7865('0x34')],qs[_0x7865('0x38')](_0x132070[_0x7865('0x35')][_0x7865('0x38')]));_0x13edd2['attributes']=_0x13edd2[_0x7865('0x39')][_0x7865('0x3a')]?_0x13edd2['attributes']:_0x45012a[_0x7865('0x34')];_0x13edd2[_0x7865('0x3d')]=qs[_0x7865('0x3e')](_0x132070[_0x7865('0x35')]['sort']);_0x13edd2[_0x7865('0x3f')]=qs[_0x7865('0x36')](_[_0x7865('0x40')](_0x132070['query'],_0x45012a['filters']));if(_0x132070[_0x7865('0x35')][_0x7865('0x41')]){_0x13edd2[_0x7865('0x3f')]=_[_0x7865('0x42')](_0x13edd2[_0x7865('0x3f')],{'$or':_[_0x7865('0x30')](_0x13edd2[_0x7865('0x39')],function(_0x525382){var _0x9b70d9={};_0x9b70d9[_0x525382]={'$like':'%'+_0x132070[_0x7865('0x35')][_0x7865('0x41')]+'%'};return _0x9b70d9;})});}_0x13edd2=_[_0x7865('0x42')]({},_0x13edd2,_0x132070[_0x7865('0x58')]);return _0xf99a4d[_0x7865('0x84')](_0x13edd2);}})['then'](function(_0x45d280){if(_0x45d280){_0x118314=_0x45d280['length'];if(!_0x132070[_0x7865('0x35')][_0x7865('0x3b')](_0x7865('0x3c'))){_0x13edd2[_0x7865('0x20')]=qs[_0x7865('0x20')](_0x132070[_0x7865('0x35')]['limit']);_0x13edd2[_0x7865('0x1e')]=qs[_0x7865('0x1e')](_0x132070[_0x7865('0x35')]['offset']);}return _0xf99a4d['getAgents'](_0x13edd2);}})['then'](function(_0x3a62be){if(_0x3a62be){return _0x3a62be?{'count':_0x118314,'rows':_0x3a62be}:null;}})[_0x7865('0x28')](respondWithResult(_0x2a0a56,null))['catch'](handleError(_0x2a0a56,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 46bb072..9766faf 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 _0x5fb5=['FaxQueue','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x5fb5,0x14e));var _0x55fb=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x5fb5[_0xcd0918];return _0x250704;};'use strict';var EventEmitter=require(_0x55fb('0x0'));var FaxQueue=require(_0x55fb('0x1'))['db'][_0x55fb('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x55fb('0x3'),'afterDestroy':_0x55fb('0x4')};function emitEvent(_0x383803){return function(_0x53bf55,_0x5a685f,_0x497f32){FaxQueueEvents[_0x55fb('0x5')](_0x383803+':'+_0x53bf55['id'],_0x53bf55);FaxQueueEvents[_0x55fb('0x5')](_0x383803,_0x53bf55);_0x497f32(null);};}for(var e in events){if(events[_0x55fb('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x4afa=['remove','events','setMaxListeners','save'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4afa,0x19d));var _0xa4af=function(_0x2fbe40,_0xde4bdb){_0x2fbe40=_0x2fbe40-0x0;var _0x5b25f7=_0x4afa[_0x2fbe40];return _0x5b25f7;};'use strict';var EventEmitter=require(_0xa4af('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa4af('0x1')](0x0);var events={'afterCreate':_0xa4af('0x2'),'afterUpdate':'update','afterDestroy':_0xa4af('0x3')};function emitEvent(_0x4b0c6b){return function(_0x2c822d,_0x549301,_0x5ed66a){FaxQueueEvents['emit'](_0x4b0c6b+':'+_0x2c822d['id'],_0x2c822d);FaxQueueEvents['emit'](_0x4b0c6b,_0x2c822d);_0x5ed66a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index beefc59..0da169b 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 _0x623e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','lodash'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x623e,0x1c6));var _0xe623=function(_0x5ad4d4,_0x2ae923){_0x5ad4d4=_0x5ad4d4-0x0;var _0x376c66=_0x623e[_0x5ad4d4];return _0x376c66;};'use strict';var _=require(_0xe623('0x0'));var util=require(_0xe623('0x1'));var logger=require(_0xe623('0x2'))(_0xe623('0x3'));var moment=require('moment');var BPromise=require(_0xe623('0x4'));var rp=require(_0xe623('0x5'));var fs=require('fs');var path=require(_0xe623('0x6'));var rimraf=require(_0xe623('0x7'));var config=require(_0xe623('0x8'));var attributes=require('./faxQueue.attributes');module[_0xe623('0x9')]=function(_0x261b3e,_0x42b62d){return _0x261b3e[_0xe623('0xa')](_0xe623('0xb'),attributes,{'tableName':_0xe623('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbce8=['moment','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','lodash','../../config/logger','api'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xbce8,0xce));var _0x8bce=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xbce8[_0x2891d1];return _0x486948;};'use strict';var _=require(_0x8bce('0x0'));var util=require('util');var logger=require(_0x8bce('0x1'))(_0x8bce('0x2'));var moment=require(_0x8bce('0x3'));var BPromise=require('bluebird');var rp=require(_0x8bce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bce('0x5'));var config=require(_0x8bce('0x6'));var attributes=require(_0x8bce('0x7'));module[_0x8bce('0x8')]=function(_0x429c93,_0x5a885e){return _0x429c93[_0x8bce('0x9')](_0x8bce('0xa'),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 5c3f222..bdaf919 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 _0xc5a6=['stringify','error','code','message','result','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','catch','ShowFaxQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0xc5a6,0x102));var _0x6c5a=function(_0x1fa6b1,_0x3ae581){_0x1fa6b1=_0x1fa6b1-0x0;var _0x1f04e5=_0xc5a6[_0x1fa6b1];return _0x1f04e5;};'use strict';var _=require(_0x6c5a('0x0'));var util=require(_0x6c5a('0x1'));var moment=require('moment');var BPromise=require(_0x6c5a('0x2'));var rs=require(_0x6c5a('0x3'));var fs=require('fs');var Redis=require(_0x6c5a('0x4'));var db=require(_0x6c5a('0x5'))['db'];var utils=require(_0x6c5a('0x6'));var logger=require(_0x6c5a('0x7'))(_0x6c5a('0x8'));var config=require(_0x6c5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c5a('0xa')][_0x6c5a('0xb')]({'port':0x232a});config[_0x6c5a('0xc')]=_[_0x6c5a('0xd')](config[_0x6c5a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c5a('0xe'))(new Redis(config[_0x6c5a('0xc')]));require(_0x6c5a('0xf'))['register'](socket);function respondWithRpcPromise(_0x3105a7,_0x77145b,_0x545665){return new BPromise(function(_0x25eb44,_0x3f29ef){return client[_0x6c5a('0x10')](_0x3105a7,_0x545665)[_0x6c5a('0x11')](function(_0x20abf2){logger[_0x6c5a('0x12')](_0x6c5a('0x13'),_0x77145b,_0x6c5a('0x14'));logger[_0x6c5a('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x77145b,_0x6c5a('0x14'),JSON[_0x6c5a('0x16')](_0x20abf2));if(_0x20abf2[_0x6c5a('0x17')]){if(_0x20abf2[_0x6c5a('0x17')][_0x6c5a('0x18')]===0x1f4){logger[_0x6c5a('0x17')](_0x6c5a('0x13'),_0x77145b,_0x20abf2[_0x6c5a('0x17')][_0x6c5a('0x19')]);return _0x3f29ef(_0x20abf2[_0x6c5a('0x17')][_0x6c5a('0x19')]);}logger[_0x6c5a('0x17')](_0x6c5a('0x13'),_0x77145b,_0x20abf2[_0x6c5a('0x17')][_0x6c5a('0x19')]);return _0x25eb44(_0x20abf2['error'][_0x6c5a('0x19')]);}else{logger[_0x6c5a('0x12')](_0x6c5a('0x13'),_0x77145b,'request\x20sent');_0x25eb44(_0x20abf2[_0x6c5a('0x1a')]['message']);}})['catch'](function(_0x38df40){logger[_0x6c5a('0x17')](_0x6c5a('0x13'),_0x77145b,_0x38df40);_0x3f29ef(_0x38df40);});});}exports['GetFaxQueue']=function(_0xc51a28){var _0xe4219e=this;return new Promise(function(_0x45a005,_0x4e7c23){return db[_0x6c5a('0x1b')][_0x6c5a('0x1c')]({'raw':_0xc51a28[_0x6c5a('0x1d')]?_0xc51a28[_0x6c5a('0x1d')][_0x6c5a('0x1e')]===undefined?!![]:![]:!![],'where':_0xc51a28[_0x6c5a('0x1d')]?_0xc51a28['options'][_0x6c5a('0x1f')]||null:null,'attributes':_0xc51a28[_0x6c5a('0x1d')]?_0xc51a28[_0x6c5a('0x1d')][_0x6c5a('0x20')]||null:null,'limit':_0xc51a28[_0x6c5a('0x1d')]?_0xc51a28[_0x6c5a('0x1d')][_0x6c5a('0x21')]||null:null,'include':_0xc51a28[_0x6c5a('0x1d')]?_0xc51a28['options'][_0x6c5a('0x22')]?_['map'](_0xc51a28[_0x6c5a('0x1d')][_0x6c5a('0x22')],function(_0x4d92cb){return{'model':db[_0x4d92cb['model']],'as':_0x4d92cb['as'],'attributes':_0x4d92cb[_0x6c5a('0x20')],'include':_0x4d92cb[_0x6c5a('0x22')]?_['map'](_0x4d92cb[_0x6c5a('0x22')],function(_0x42d758){return{'model':db[_0x42d758['model']],'as':_0x42d758['as'],'attributes':_0x42d758[_0x6c5a('0x20')],'include':_0x42d758[_0x6c5a('0x22')]?_[_0x6c5a('0x23')](_0x42d758[_0x6c5a('0x22')],function(_0x30203e){return{'model':db[_0x30203e[_0x6c5a('0x24')]],'as':_0x30203e['as'],'attributes':_0x30203e[_0x6c5a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6c5a('0x11')](function(_0x2d732d){logger[_0x6c5a('0x12')](_0x6c5a('0x25'),_0xc51a28);logger[_0x6c5a('0x15')](_0x6c5a('0x25'),_0xc51a28,JSON[_0x6c5a('0x16')](_0x2d732d));_0x45a005(_0x2d732d);})[_0x6c5a('0x26')](function(_0x4f1adb){logger[_0x6c5a('0x17')](_0x6c5a('0x25'),_0x4f1adb[_0x6c5a('0x19')],_0xc51a28);_0x4e7c23(_0xe4219e[_0x6c5a('0x17')](0x1f4,_0x4f1adb[_0x6c5a('0x19')]));});});};exports[_0x6c5a('0x27')]=function(_0xd04907){var _0x57d911=this;return new Promise(function(_0x58b4a9,_0x3c9236){return db['FaxQueue']['find']({'raw':_0xd04907[_0x6c5a('0x1d')]?_0xd04907[_0x6c5a('0x1d')][_0x6c5a('0x1e')]===undefined?!![]:![]:!![],'where':_0xd04907['options']?_0xd04907[_0x6c5a('0x1d')][_0x6c5a('0x1f')]||null:null,'attributes':_0xd04907[_0x6c5a('0x1d')]?_0xd04907['options']['attributes']||null:null,'include':_0xd04907[_0x6c5a('0x1d')]?_0xd04907[_0x6c5a('0x1d')]['include']?_[_0x6c5a('0x23')](_0xd04907[_0x6c5a('0x1d')][_0x6c5a('0x22')],function(_0x3eb402){return{'model':db[_0x3eb402[_0x6c5a('0x24')]],'as':_0x3eb402['as'],'attributes':_0x3eb402['attributes'],'include':_0x3eb402[_0x6c5a('0x22')]?_[_0x6c5a('0x23')](_0x3eb402[_0x6c5a('0x22')],function(_0x42dd18){return{'model':db[_0x42dd18['model']],'as':_0x42dd18['as'],'attributes':_0x42dd18['attributes'],'include':_0x42dd18['include']?_[_0x6c5a('0x23')](_0x42dd18['include'],function(_0x3d1cdf){return{'model':db[_0x3d1cdf[_0x6c5a('0x24')]],'as':_0x3d1cdf['as'],'attributes':_0x3d1cdf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37447c){logger['info'](_0x6c5a('0x27'),_0xd04907);logger[_0x6c5a('0x15')]('ShowFaxQueue',_0xd04907,JSON['stringify'](_0x37447c));_0x58b4a9(_0x37447c);})['catch'](function(_0x449d2a){logger[_0x6c5a('0x17')](_0x6c5a('0x27'),_0x449d2a[_0x6c5a('0x19')],_0xd04907);_0x3c9236(_0x57d911[_0x6c5a('0x17')](0x1f4,_0x449d2a[_0x6c5a('0x19')]));});});}; \ No newline at end of file +var _0xa94b=['request\x20sent','debug','error','code','message','info','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','then','FaxQueue,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa94b,0x187));var _0xba94=function(_0x59632f,_0x42a8e0){_0x59632f=_0x59632f-0x0;var _0x1ec537=_0xa94b[_0x59632f];return _0x1ec537;};'use strict';var _=require('lodash');var util=require(_0xba94('0x0'));var moment=require(_0xba94('0x1'));var BPromise=require(_0xba94('0x2'));var rs=require(_0xba94('0x3'));var fs=require('fs');var Redis=require(_0xba94('0x4'));var db=require(_0xba94('0x5'))['db'];var utils=require(_0xba94('0x6'));var logger=require('../../config/logger')(_0xba94('0x7'));var config=require(_0xba94('0x8'));var jayson=require(_0xba94('0x9'));var client=jayson['client'][_0xba94('0xa')]({'port':0x232a});config[_0xba94('0xb')]=_[_0xba94('0xc')](config['redis'],{'host':_0xba94('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba94('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0xf4d502,_0x4e1d37,_0x1e9d1a){return new BPromise(function(_0x22ba0f,_0x39dd4a){return client['request'](_0xf4d502,_0x1e9d1a)[_0xba94('0xe')](function(_0x207583){logger['info'](_0xba94('0xf'),_0x4e1d37,_0xba94('0x10'));logger[_0xba94('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x4e1d37,_0xba94('0x10'),JSON['stringify'](_0x207583));if(_0x207583[_0xba94('0x12')]){if(_0x207583['error'][_0xba94('0x13')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x4e1d37,_0x207583[_0xba94('0x12')][_0xba94('0x14')]);return _0x39dd4a(_0x207583['error'][_0xba94('0x14')]);}logger['error'](_0xba94('0xf'),_0x4e1d37,_0x207583[_0xba94('0x12')]['message']);return _0x22ba0f(_0x207583[_0xba94('0x12')][_0xba94('0x14')]);}else{logger[_0xba94('0x15')]('FaxQueue,\x20%s,\x20%s',_0x4e1d37,_0xba94('0x10'));_0x22ba0f(_0x207583['result'][_0xba94('0x14')]);}})[_0xba94('0x16')](function(_0x538e7f){logger['error'](_0xba94('0xf'),_0x4e1d37,_0x538e7f);_0x39dd4a(_0x538e7f);});});}exports[_0xba94('0x17')]=function(_0x20bc01){var _0x42c51a=this;return new Promise(function(_0x44190b,_0x2777ff){return db[_0xba94('0x18')][_0xba94('0x19')]({'raw':_0x20bc01[_0xba94('0x1a')]?_0x20bc01[_0xba94('0x1a')][_0xba94('0x1b')]===undefined?!![]:![]:!![],'where':_0x20bc01['options']?_0x20bc01[_0xba94('0x1a')][_0xba94('0x1c')]||null:null,'attributes':_0x20bc01[_0xba94('0x1a')]?_0x20bc01['options'][_0xba94('0x1d')]||null:null,'limit':_0x20bc01[_0xba94('0x1a')]?_0x20bc01[_0xba94('0x1a')][_0xba94('0x1e')]||null:null,'include':_0x20bc01[_0xba94('0x1a')]?_0x20bc01[_0xba94('0x1a')][_0xba94('0x1f')]?_['map'](_0x20bc01['options'][_0xba94('0x1f')],function(_0x55af2a){return{'model':db[_0x55af2a['model']],'as':_0x55af2a['as'],'attributes':_0x55af2a[_0xba94('0x1d')],'include':_0x55af2a[_0xba94('0x1f')]?_[_0xba94('0x20')](_0x55af2a[_0xba94('0x1f')],function(_0x1199af){return{'model':db[_0x1199af[_0xba94('0x21')]],'as':_0x1199af['as'],'attributes':_0x1199af[_0xba94('0x1d')],'include':_0x1199af['include']?_[_0xba94('0x20')](_0x1199af['include'],function(_0x277de0){return{'model':db[_0x277de0[_0xba94('0x21')]],'as':_0x277de0['as'],'attributes':_0x277de0[_0xba94('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xba94('0xe')](function(_0x2e4186){logger[_0xba94('0x15')](_0xba94('0x17'),_0x20bc01);logger[_0xba94('0x11')]('GetFaxQueue',_0x20bc01,JSON[_0xba94('0x22')](_0x2e4186));_0x44190b(_0x2e4186);})[_0xba94('0x16')](function(_0x5b3a53){logger[_0xba94('0x12')](_0xba94('0x17'),_0x5b3a53['message'],_0x20bc01);_0x2777ff(_0x42c51a[_0xba94('0x12')](0x1f4,_0x5b3a53['message']));});});};exports[_0xba94('0x23')]=function(_0x1758e3){var _0x59a81b=this;return new Promise(function(_0x3d3f55,_0xd6bab7){return db['FaxQueue'][_0xba94('0x24')]({'raw':_0x1758e3[_0xba94('0x1a')]?_0x1758e3[_0xba94('0x1a')][_0xba94('0x1b')]===undefined?!![]:![]:!![],'where':_0x1758e3[_0xba94('0x1a')]?_0x1758e3['options'][_0xba94('0x1c')]||null:null,'attributes':_0x1758e3['options']?_0x1758e3[_0xba94('0x1a')][_0xba94('0x1d')]||null:null,'include':_0x1758e3[_0xba94('0x1a')]?_0x1758e3[_0xba94('0x1a')][_0xba94('0x1f')]?_[_0xba94('0x20')](_0x1758e3[_0xba94('0x1a')][_0xba94('0x1f')],function(_0x14169f){return{'model':db[_0x14169f[_0xba94('0x21')]],'as':_0x14169f['as'],'attributes':_0x14169f['attributes'],'include':_0x14169f['include']?_[_0xba94('0x20')](_0x14169f[_0xba94('0x1f')],function(_0x4f23cd){return{'model':db[_0x4f23cd[_0xba94('0x21')]],'as':_0x4f23cd['as'],'attributes':_0x4f23cd[_0xba94('0x1d')],'include':_0x4f23cd[_0xba94('0x1f')]?_['map'](_0x4f23cd[_0xba94('0x1f')],function(_0x5b904f){return{'model':db[_0x5b904f['model']],'as':_0x5b904f['as'],'attributes':_0x5b904f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aca5f){logger[_0xba94('0x15')](_0xba94('0x23'),_0x1758e3);logger[_0xba94('0x11')](_0xba94('0x23'),_0x1758e3,JSON[_0xba94('0x22')](_0x4aca5f));_0x3d3f55(_0x4aca5f);})[_0xba94('0x16')](function(_0x2da6b9){logger[_0xba94('0x12')](_0xba94('0x23'),_0x2da6b9[_0xba94('0x14')],_0x1758e3);_0xd6bab7(_0x59a81b[_0xba94('0x12')](0x1f4,_0x2da6b9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 62902a9..1a6dec1 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 _0xfd60=['faxQueue:','./faxQueue.events','update','emit','removeListener','length'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0xfd60,0x151));var _0x0fd6=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0xfd60[_0x2077c2];return _0x312f9f;};'use strict';var FaxQueueEvents=require(_0x0fd6('0x0'));var events=['save','remove',_0x0fd6('0x1')];function createListener(_0x2b00c9,_0x259fad){return function(_0x5917a0){_0x259fad[_0x0fd6('0x2')](_0x2b00c9,_0x5917a0);};}function removeListener(_0x2eb301,_0x4854c1){return function(){FaxQueueEvents[_0x0fd6('0x3')](_0x2eb301,_0x4854c1);};}exports['register']=function(_0x89d594){for(var _0x52d051=0x0,_0x1cb293=events[_0x0fd6('0x4')];_0x52d051<_0x1cb293;_0x52d051++){var _0x48168b=events[_0x52d051];var _0x49f765=createListener(_0x0fd6('0x5')+_0x48168b,_0x89d594);FaxQueueEvents['on'](_0x48168b,_0x49f765);}}; \ No newline at end of file +var _0x91d9=['save','length','faxQueue:'];(function(_0x5db221,_0x45952f){var _0x437b3a=function(_0x2b5824){while(--_0x2b5824){_0x5db221['push'](_0x5db221['shift']());}};_0x437b3a(++_0x45952f);}(_0x91d9,0x1ec));var _0x991d=function(_0x1190b2,_0x2e340a){_0x1190b2=_0x1190b2-0x0;var _0x1c9012=_0x91d9[_0x1190b2];return _0x1c9012;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x991d('0x0'),'remove','update'];function createListener(_0x6bef1e,_0x48e378){return function(_0x43cbd3){_0x48e378['emit'](_0x6bef1e,_0x43cbd3);};}function removeListener(_0x59cd13,_0x3aadaa){return function(){FaxQueueEvents['removeListener'](_0x59cd13,_0x3aadaa);};}exports['register']=function(_0x464537){for(var _0x33e8d6=0x0,_0x15c54f=events[_0x991d('0x1')];_0x33e8d6<_0x15c54f;_0x33e8d6++){var _0xa52e0f=events[_0x33e8d6];var _0x58249f=createListener(_0x991d('0x2')+_0xa52e0f,_0x464537);FaxQueueEvents['on'](_0xa52e0f,_0x58249f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c219455..e492373 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 _0x1751=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x1abaae,_0x3426b9){var _0x457248=function(_0x4126ca){while(--_0x4126ca){_0x1abaae['push'](_0x1abaae['shift']());}};_0x457248(++_0x3426b9);}(_0x1751,0x76));var _0x1175=function(_0x5b47db,_0x196405){_0x5b47db=_0x5b47db-0x0;var _0x2463d7=_0x1751[_0x5b47db];return _0x2463d7;};'use strict';var multer=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var path=require(_0x1175('0x2'));var timeout=require(_0x1175('0x3'));var express=require('express');var router=express[_0x1175('0x4')]();var fs_extra=require(_0x1175('0x5'));var auth=require(_0x1175('0x6'));var interaction=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var controller=require(_0x1175('0x9'));router[_0x1175('0xa')]('/',auth[_0x1175('0xb')](),controller[_0x1175('0xc')]);router[_0x1175('0xa')](_0x1175('0xd'),auth[_0x1175('0xb')](),controller[_0x1175('0xe')]);router[_0x1175('0xa')](_0x1175('0xf'),auth[_0x1175('0xb')](),controller[_0x1175('0x10')]);router[_0x1175('0xa')](_0x1175('0x11'),auth[_0x1175('0xb')](),controller[_0x1175('0x12')]);router[_0x1175('0xa')](_0x1175('0x13'),auth[_0x1175('0xb')](),controller[_0x1175('0x14')]);router[_0x1175('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x1175('0x15')]);router[_0x1175('0x16')]('/',auth['isAuthenticated'](),controller[_0x1175('0x17')]);router[_0x1175('0x16')](_0x1175('0x13'),auth['isAuthenticated'](),controller[_0x1175('0x18')]);router[_0x1175('0x16')](_0x1175('0x19'),auth['isAuthenticated'](),controller[_0x1175('0x1a')]);router['put'](_0x1175('0xf'),auth[_0x1175('0xb')](),controller[_0x1175('0x1b')]);router[_0x1175('0x1c')]('/:id',auth[_0x1175('0xb')](),controller[_0x1175('0x1d')]);router['delete']('/:id/teams',auth[_0x1175('0xb')](),controller[_0x1175('0x1e')]);router[_0x1175('0x1c')](_0x1175('0x19'),auth[_0x1175('0xb')](),controller['removeAgents']);module[_0x1175('0x1f')]=router; \ No newline at end of file +var _0x7278=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xa98164,_0xf7769f){var _0x42fe1b=function(_0x1ef7ea){while(--_0x1ef7ea){_0xa98164['push'](_0xa98164['shift']());}};_0x42fe1b(++_0xf7769f);}(_0x7278,0x161));var _0x8727=function(_0xa55c44,_0xc722ac){_0xa55c44=_0xa55c44-0x0;var _0x39ade2=_0x7278[_0xa55c44];return _0x39ade2;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xa')](_0x8727('0xe'),auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0xa')](_0x8727('0x10'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router['get'](_0x8727('0x12'),auth[_0x8727('0xb')](),controller[_0x8727('0x13')]);router['post']('/',auth[_0x8727('0xb')](),controller[_0x8727('0x14')]);router['post'](_0x8727('0x10'),auth[_0x8727('0xb')](),controller[_0x8727('0x15')]);router[_0x8727('0x16')](_0x8727('0x12'),auth[_0x8727('0xb')](),controller[_0x8727('0x17')]);router[_0x8727('0x18')](_0x8727('0x19'),auth[_0x8727('0xb')](),controller['update']);router[_0x8727('0x1a')](_0x8727('0x19'),auth[_0x8727('0xb')](),controller[_0x8727('0x1b')]);router[_0x8727('0x1a')](_0x8727('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8727('0x1a')]('/:id/users',auth[_0x8727('0xb')](),controller[_0x8727('0x1c')]);module[_0x8727('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index fba7977..f14d104 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 _0x2144=['moment','sequelize','exports','STRING','DATE'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0x2144,0xfa));var _0x4214=function(_0x202438,_0x21f696){_0x202438=_0x202438-0x0;var _0x43a7f1=_0x2144[_0x202438];return _0x43a7f1;};'use strict';var moment=require(_0x4214('0x0'));var Sequelize=require(_0x4214('0x1'));module[_0x4214('0x2')]={'uniqueid':{'type':Sequelize[_0x4214('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4214('0x3')]},'joinAt':{'type':Sequelize[_0x4214('0x4')]},'leaveAt':{'type':Sequelize[_0x4214('0x4')]},'acceptAt':{'type':Sequelize[_0x4214('0x4')]},'exitAt':{'type':Sequelize[_0x4214('0x4')]},'reason':{'type':Sequelize[_0x4214('0x3')]}}; \ No newline at end of file +var _0x6a8e=['STRING','DATE','moment','sequelize','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x6a8e,0x179));var _0xe6a8=function(_0x2cec83,_0x1a9274){_0x2cec83=_0x2cec83-0x0;var _0x710a3b=_0x6a8e[_0x2cec83];return _0x710a3b;};'use strict';var moment=require(_0xe6a8('0x0'));var Sequelize=require(_0xe6a8('0x1'));module[_0xe6a8('0x2')]={'uniqueid':{'type':Sequelize[_0xe6a8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe6a8('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe6a8('0x4')]},'acceptAt':{'type':Sequelize[_0xe6a8('0x4')]},'exitAt':{'type':Sequelize[_0xe6a8('0x4')]},'reason':{'type':Sequelize[_0xe6a8('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7f69da3..be5786b 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 _0x35ba=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','keys','intersection','model','fields','query','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','rawAttributes','filters','length','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5dd186,_0x23054a){var _0x5cff28=function(_0x38bc8c){while(--_0x38bc8c){_0x5dd186['push'](_0x5dd186['shift']());}};_0x5cff28(++_0x23054a);}(_0x35ba,0x8c));var _0xa35b=function(_0x5ee300,_0x59f054){_0x5ee300=_0x5ee300-0x0;var _0x15717b=_0x35ba[_0x5ee300];return _0x15717b;};'use strict';var emlformat=require(_0xa35b('0x0'));var rimraf=require(_0xa35b('0x1'));var zipdir=require(_0xa35b('0x2'));var jsonpatch=require(_0xa35b('0x3'));var rp=require('request-promise');var moment=require(_0xa35b('0x4'));var BPromise=require(_0xa35b('0x5'));var Mustache=require(_0xa35b('0x6'));var util=require(_0xa35b('0x7'));var path=require(_0xa35b('0x8'));var sox=require(_0xa35b('0x9'));var csv=require('to-csv');var ejs=require(_0xa35b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa35b('0xb'));var squel=require(_0xa35b('0xc'));var crypto=require(_0xa35b('0xd'));var jsforce=require(_0xa35b('0xe'));var deskjs=require(_0xa35b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa35b('0x10'));var Papa=require(_0xa35b('0x11'));var Redis=require(_0xa35b('0x12'));var authService=require(_0xa35b('0x13'));var qs=require(_0xa35b('0x14'));var as=require(_0xa35b('0x15'));var hardwareService=require(_0xa35b('0x16'));var logger=require(_0xa35b('0x17'))(_0xa35b('0x18'));var utils=require('../../config/utils');var config=require(_0xa35b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa35b('0x1a'))['db'];function respondWithStatusCode(_0x3eb762,_0x8e7ec0){_0x8e7ec0=_0x8e7ec0||0xcc;return function(_0xe0c3b6){if(_0xe0c3b6){return _0x3eb762[_0xa35b('0x1b')](_0x8e7ec0);}return _0x3eb762['status'](_0x8e7ec0)[_0xa35b('0x1c')]();};}function respondWithResult(_0x511f41,_0x244353){_0x244353=_0x244353||0xc8;return function(_0x564ff2){if(_0x564ff2){return _0x511f41[_0xa35b('0x1d')](_0x244353)[_0xa35b('0x1e')](_0x564ff2);}};}function respondWithFilteredResult(_0x559610,_0x36a3c1){return function(_0x42b081){if(_0x42b081){var _0xd38665=typeof _0x36a3c1[_0xa35b('0x1f')]===_0xa35b('0x20')&&typeof _0x36a3c1[_0xa35b('0x21')]===_0xa35b('0x20');var _0x2c2fa=_0x42b081[_0xa35b('0x22')];var _0x362dd1=_0xd38665?0x0:_0x36a3c1[_0xa35b('0x1f')];var _0x4ca1ed=_0xd38665?_0x42b081['count']:_0x36a3c1[_0xa35b('0x1f')]+_0x36a3c1['limit'];var _0x2283fa;if(_0x4ca1ed>=_0x2c2fa){_0x4ca1ed=_0x2c2fa;_0x2283fa=0xc8;}else{_0x2283fa=0xce;}_0x559610[_0xa35b('0x1d')](_0x2283fa);return _0x559610[_0xa35b('0x23')](_0xa35b('0x24'),_0x362dd1+'-'+_0x4ca1ed+'/'+_0x2c2fa)[_0xa35b('0x1e')](_0x42b081);}return null;};}function patchUpdates(_0x36279e){return function(_0x31a3d1){try{jsonpatch[_0xa35b('0x25')](_0x31a3d1,_0x36279e,!![]);}catch(_0x14951d){return BPromise[_0xa35b('0x26')](_0x14951d);}return _0x31a3d1[_0xa35b('0x27')]();};}function saveUpdates(_0x3a29c9,_0x563577){return function(_0x1b25da){if(_0x1b25da){return _0x1b25da[_0xa35b('0x28')](_0x3a29c9)['then'](function(_0x301f9f){return _0x301f9f;});}return null;};}function removeEntity(_0x1efafb,_0x21896d){return function(_0x5d77d9){if(_0x5d77d9){return _0x5d77d9[_0xa35b('0x29')]()[_0xa35b('0x2a')](function(){_0x1efafb[_0xa35b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a3cb,_0x2dcba5){return function(_0xa2bf2e){if(!_0xa2bf2e){_0x19a3cb[_0xa35b('0x1b')](0x194);}return _0xa2bf2e;};}function handleError(_0x4f2d52,_0x1538b6){_0x1538b6=_0x1538b6||0x1f4;return function(_0x33da60){logger['error'](_0x33da60[_0xa35b('0x2b')]);if(_0x33da60[_0xa35b('0x2c')]){delete _0x33da60[_0xa35b('0x2c')];}_0x4f2d52[_0xa35b('0x1d')](_0x1538b6)[_0xa35b('0x2d')](_0x33da60);};}exports[_0xa35b('0x2e')]=function(_0x3080f3,_0x22edc5){var _0x5255e4={},_0x130dae={},_0x28c9d7={'count':0x0,'rows':[]};var _0x116a24=_[_0xa35b('0x2f')](db[_0xa35b('0x30')]['rawAttributes'],function(_0x450596){return{'name':_0x450596[_0xa35b('0x31')],'type':_0x450596[_0xa35b('0x32')][_0xa35b('0x33')]};});_0x130dae['model']=_[_0xa35b('0x2f')](_0x116a24,_0xa35b('0x2c'));_0x130dae['query']=_[_0xa35b('0x34')](_0x3080f3['query']);_0x130dae['filters']=_[_0xa35b('0x35')](_0x130dae[_0xa35b('0x36')],_0x130dae['query']);_0x5255e4['attributes']=_['intersection'](_0x130dae[_0xa35b('0x36')],qs[_0xa35b('0x37')](_0x3080f3[_0xa35b('0x38')]['fields']));_0x5255e4[_0xa35b('0x39')]=_0x5255e4[_0xa35b('0x39')]['length']?_0x5255e4[_0xa35b('0x39')]:_0x130dae[_0xa35b('0x36')];if(!_0x3080f3[_0xa35b('0x38')]['hasOwnProperty'](_0xa35b('0x3a'))){_0x5255e4[_0xa35b('0x21')]=qs[_0xa35b('0x21')](_0x3080f3['query'][_0xa35b('0x21')]);_0x5255e4['offset']=qs[_0xa35b('0x1f')](_0x3080f3[_0xa35b('0x38')][_0xa35b('0x1f')]);}_0x5255e4[_0xa35b('0x3b')]=qs[_0xa35b('0x3c')](_0x3080f3[_0xa35b('0x38')]['sort']);_0x5255e4['where']=qs['filters'](_[_0xa35b('0x3d')](_0x3080f3[_0xa35b('0x38')],_0x130dae['filters']),_0x116a24);if(_0x3080f3['query']['filter']){_0x5255e4[_0xa35b('0x3e')]=_[_0xa35b('0x3f')](_0x5255e4[_0xa35b('0x3e')],{'$or':_[_0xa35b('0x2f')](_0x116a24,function(_0x29f177){if(_0x29f177['type']!==_0xa35b('0x40')){var _0x176f6b={};_0x176f6b[_0x29f177[_0xa35b('0x2c')]]={'$like':'%'+_0x3080f3[_0xa35b('0x38')][_0xa35b('0x41')]+'%'};return _0x176f6b;}})});}_0x5255e4=_[_0xa35b('0x3f')]({},_0x5255e4,_0x3080f3['options']);var _0x29335a={'where':_0x5255e4['where']};return db[_0xa35b('0x30')][_0xa35b('0x22')](_0x29335a)[_0xa35b('0x2a')](function(_0x4327b0){_0x28c9d7[_0xa35b('0x22')]=_0x4327b0;if(_0x3080f3[_0xa35b('0x38')][_0xa35b('0x42')]){_0x5255e4[_0xa35b('0x43')]=[{'all':!![]}];}return db[_0xa35b('0x30')][_0xa35b('0x44')](_0x5255e4);})['then'](function(_0x5b49da){_0x28c9d7[_0xa35b('0x45')]=_0x5b49da;return _0x28c9d7;})[_0xa35b('0x2a')](respondWithFilteredResult(_0x22edc5,_0x5255e4))['catch'](handleError(_0x22edc5,null));};exports[_0xa35b('0x46')]=function(_0x135b56,_0x5392dd){var _0x3cb397={'raw':!![],'where':{'id':_0x135b56[_0xa35b('0x47')]['id']}},_0x30ddd2={};_0x30ddd2[_0xa35b('0x36')]=_[_0xa35b('0x34')](db[_0xa35b('0x30')][_0xa35b('0x48')]);_0x30ddd2[_0xa35b('0x38')]=_[_0xa35b('0x34')](_0x135b56['query']);_0x30ddd2[_0xa35b('0x49')]=_[_0xa35b('0x35')](_0x30ddd2[_0xa35b('0x36')],_0x30ddd2[_0xa35b('0x38')]);_0x3cb397[_0xa35b('0x39')]=_[_0xa35b('0x35')](_0x30ddd2[_0xa35b('0x36')],qs[_0xa35b('0x37')](_0x135b56[_0xa35b('0x38')]['fields']));_0x3cb397[_0xa35b('0x39')]=_0x3cb397[_0xa35b('0x39')][_0xa35b('0x4a')]?_0x3cb397['attributes']:_0x30ddd2['model'];if(_0x135b56[_0xa35b('0x38')][_0xa35b('0x42')]){_0x3cb397[_0xa35b('0x43')]=[{'all':!![]}];}_0x3cb397=_[_0xa35b('0x3f')]({},_0x3cb397,_0x135b56[_0xa35b('0x4b')]);return db[_0xa35b('0x30')][_0xa35b('0x4c')](_0x3cb397)[_0xa35b('0x2a')](handleEntityNotFound(_0x5392dd,null))[_0xa35b('0x2a')](respondWithResult(_0x5392dd,null))[_0xa35b('0x4d')](handleError(_0x5392dd,null));};exports[_0xa35b('0x4e')]=function(_0x17e93d,_0x42ec55){return db[_0xa35b('0x30')]['create'](_0x17e93d[_0xa35b('0x4f')],{})['then'](respondWithResult(_0x42ec55,0xc9))[_0xa35b('0x4d')](handleError(_0x42ec55,null));};exports[_0xa35b('0x28')]=function(_0x4b75ec,_0x81e6ad){if(_0x4b75ec[_0xa35b('0x4f')]['id']){delete _0x4b75ec['body']['id'];}return db[_0xa35b('0x30')][_0xa35b('0x4c')]({'where':{'id':_0x4b75ec[_0xa35b('0x47')]['id']}})[_0xa35b('0x2a')](handleEntityNotFound(_0x81e6ad,null))[_0xa35b('0x2a')](saveUpdates(_0x4b75ec[_0xa35b('0x4f')],null))[_0xa35b('0x2a')](respondWithResult(_0x81e6ad,null))['catch'](handleError(_0x81e6ad,null));};exports[_0xa35b('0x29')]=function(_0x1dbfba,_0x3ce180){return db[_0xa35b('0x30')][_0xa35b('0x4c')]({'where':{'id':_0x1dbfba['params']['id']}})['then'](handleEntityNotFound(_0x3ce180,null))[_0xa35b('0x2a')](removeEntity(_0x3ce180,null))[_0xa35b('0x4d')](handleError(_0x3ce180,null));};exports[_0xa35b('0x50')]=function(_0x478992,_0x28aa39){return db[_0xa35b('0x30')][_0xa35b('0x50')]()[_0xa35b('0x2a')](respondWithResult(_0x28aa39,null))[_0xa35b('0x4d')](handleError(_0x28aa39,null));}; \ No newline at end of file +var _0x39cb=['rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','then','error','stack','name','index','map'];(function(_0x466044,_0x27a814){var _0x5416c0=function(_0x390ab3){while(--_0x390ab3){_0x466044['push'](_0x466044['shift']());}};_0x5416c0(++_0x27a814);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb39c('0x0'));var zipdir=require(_0xb39c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb39c('0x2'));var moment=require(_0xb39c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb39c('0x4'));var util=require(_0xb39c('0x5'));var path=require(_0xb39c('0x6'));var sox=require(_0xb39c('0x7'));var csv=require(_0xb39c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb39c('0x9'));var _=require(_0xb39c('0xa'));var squel=require(_0xb39c('0xb'));var crypto=require(_0xb39c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb39c('0x8'));var querystring=require(_0xb39c('0xd'));var Papa=require(_0xb39c('0xe'));var Redis=require(_0xb39c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39c('0x10'));var logger=require(_0xb39c('0x11'))(_0xb39c('0x12'));var utils=require(_0xb39c('0x13'));var config=require(_0xb39c('0x14'));var licenseUtil=require(_0xb39c('0x15'));var db=require(_0xb39c('0x16'))['db'];function respondWithStatusCode(_0x18d12e,_0x51ff24){_0x51ff24=_0x51ff24||0xcc;return function(_0x31e07e){if(_0x31e07e){return _0x18d12e[_0xb39c('0x17')](_0x51ff24);}return _0x18d12e[_0xb39c('0x18')](_0x51ff24)['end']();};}function respondWithResult(_0xf4662a,_0x40a6d3){_0x40a6d3=_0x40a6d3||0xc8;return function(_0x42a203){if(_0x42a203){return _0xf4662a[_0xb39c('0x18')](_0x40a6d3)[_0xb39c('0x19')](_0x42a203);}};}function respondWithFilteredResult(_0x27c22a,_0x8e9181){return function(_0x5277ce){if(_0x5277ce){var _0x316c9b=typeof _0x8e9181[_0xb39c('0x1a')]===_0xb39c('0x1b')&&typeof _0x8e9181[_0xb39c('0x1c')]===_0xb39c('0x1b');var _0x3b7fad=_0x5277ce[_0xb39c('0x1d')];var _0x4e02cf=_0x316c9b?0x0:_0x8e9181[_0xb39c('0x1a')];var _0x2eeae6=_0x316c9b?_0x5277ce['count']:_0x8e9181[_0xb39c('0x1a')]+_0x8e9181[_0xb39c('0x1c')];var _0x28bbe1;if(_0x2eeae6>=_0x3b7fad){_0x2eeae6=_0x3b7fad;_0x28bbe1=0xc8;}else{_0x28bbe1=0xce;}_0x27c22a[_0xb39c('0x18')](_0x28bbe1);return _0x27c22a['set'](_0xb39c('0x1e'),_0x4e02cf+'-'+_0x2eeae6+'/'+_0x3b7fad)[_0xb39c('0x19')](_0x5277ce);}return null;};}function patchUpdates(_0x5e4a0b){return function(_0x2d8e93){try{jsonpatch[_0xb39c('0x1f')](_0x2d8e93,_0x5e4a0b,!![]);}catch(_0x1d3e2d){return BPromise['reject'](_0x1d3e2d);}return _0x2d8e93['save']();};}function saveUpdates(_0x2789fd,_0x1a5b9d){return function(_0x3c8dfd){if(_0x3c8dfd){return _0x3c8dfd['update'](_0x2789fd)[_0xb39c('0x20')](function(_0x438207){return _0x438207;});}return null;};}function removeEntity(_0x1bb895,_0x16f3b0){return function(_0x3b03ed){if(_0x3b03ed){return _0x3b03ed['destroy']()[_0xb39c('0x20')](function(){_0x1bb895[_0xb39c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd145,_0x4492a4){return function(_0x39116b){if(!_0x39116b){_0x1fd145[_0xb39c('0x17')](0x194);}return _0x39116b;};}function handleError(_0xa751db,_0x5453a6){_0x5453a6=_0x5453a6||0x1f4;return function(_0x23a2f1){logger[_0xb39c('0x21')](_0x23a2f1[_0xb39c('0x22')]);if(_0x23a2f1['name']){delete _0x23a2f1[_0xb39c('0x23')];}_0xa751db[_0xb39c('0x18')](_0x5453a6)['send'](_0x23a2f1);};}exports[_0xb39c('0x24')]=function(_0x4b4458,_0x328db1){var _0x4e9672={},_0x714d20={},_0x45fed4={'count':0x0,'rows':[]};var _0x59172f=_[_0xb39c('0x25')](db['FaxQueueReport'][_0xb39c('0x26')],function(_0x2d2743){return{'name':_0x2d2743[_0xb39c('0x27')],'type':_0x2d2743[_0xb39c('0x28')][_0xb39c('0x29')]};});_0x714d20['model']=_[_0xb39c('0x25')](_0x59172f,'name');_0x714d20[_0xb39c('0x2a')]=_['keys'](_0x4b4458[_0xb39c('0x2a')]);_0x714d20[_0xb39c('0x2b')]=_[_0xb39c('0x2c')](_0x714d20[_0xb39c('0x2d')],_0x714d20['query']);_0x4e9672['attributes']=_[_0xb39c('0x2c')](_0x714d20[_0xb39c('0x2d')],qs['fields'](_0x4b4458[_0xb39c('0x2a')][_0xb39c('0x2e')]));_0x4e9672[_0xb39c('0x2f')]=_0x4e9672[_0xb39c('0x2f')][_0xb39c('0x30')]?_0x4e9672[_0xb39c('0x2f')]:_0x714d20[_0xb39c('0x2d')];if(!_0x4b4458[_0xb39c('0x2a')][_0xb39c('0x31')](_0xb39c('0x32'))){_0x4e9672[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x4b4458[_0xb39c('0x2a')][_0xb39c('0x1c')]);_0x4e9672[_0xb39c('0x1a')]=qs[_0xb39c('0x1a')](_0x4b4458[_0xb39c('0x2a')][_0xb39c('0x1a')]);}_0x4e9672[_0xb39c('0x33')]=qs['sort'](_0x4b4458[_0xb39c('0x2a')][_0xb39c('0x34')]);_0x4e9672['where']=qs['filters'](_['pick'](_0x4b4458[_0xb39c('0x2a')],_0x714d20[_0xb39c('0x2b')]),_0x59172f);if(_0x4b4458[_0xb39c('0x2a')]['filter']){_0x4e9672[_0xb39c('0x35')]=_[_0xb39c('0x36')](_0x4e9672[_0xb39c('0x35')],{'$or':_[_0xb39c('0x25')](_0x59172f,function(_0x3e650d){if(_0x3e650d['type']!==_0xb39c('0x37')){var _0x3000d7={};_0x3000d7[_0x3e650d['name']]={'$like':'%'+_0x4b4458[_0xb39c('0x2a')]['filter']+'%'};return _0x3000d7;}})});}_0x4e9672=_[_0xb39c('0x36')]({},_0x4e9672,_0x4b4458[_0xb39c('0x38')]);var _0x3eaf96={'where':_0x4e9672['where']};return db[_0xb39c('0x39')][_0xb39c('0x1d')](_0x3eaf96)[_0xb39c('0x20')](function(_0x44d667){_0x45fed4[_0xb39c('0x1d')]=_0x44d667;if(_0x4b4458[_0xb39c('0x2a')][_0xb39c('0x3a')]){_0x4e9672[_0xb39c('0x3b')]=[{'all':!![]}];}return db[_0xb39c('0x39')][_0xb39c('0x3c')](_0x4e9672);})[_0xb39c('0x20')](function(_0xd1136f){_0x45fed4['rows']=_0xd1136f;return _0x45fed4;})[_0xb39c('0x20')](respondWithFilteredResult(_0x328db1,_0x4e9672))[_0xb39c('0x3d')](handleError(_0x328db1,null));};exports[_0xb39c('0x3e')]=function(_0x29ea9e,_0x3d301e){var _0x390cd7={'raw':!![],'where':{'id':_0x29ea9e[_0xb39c('0x3f')]['id']}},_0x1db549={};_0x1db549[_0xb39c('0x2d')]=_['keys'](db['FaxQueueReport'][_0xb39c('0x26')]);_0x1db549[_0xb39c('0x2a')]=_['keys'](_0x29ea9e['query']);_0x1db549[_0xb39c('0x2b')]=_['intersection'](_0x1db549[_0xb39c('0x2d')],_0x1db549[_0xb39c('0x2a')]);_0x390cd7[_0xb39c('0x2f')]=_[_0xb39c('0x2c')](_0x1db549[_0xb39c('0x2d')],qs['fields'](_0x29ea9e[_0xb39c('0x2a')][_0xb39c('0x2e')]));_0x390cd7['attributes']=_0x390cd7['attributes'][_0xb39c('0x30')]?_0x390cd7['attributes']:_0x1db549['model'];if(_0x29ea9e[_0xb39c('0x2a')][_0xb39c('0x3a')]){_0x390cd7[_0xb39c('0x3b')]=[{'all':!![]}];}_0x390cd7=_[_0xb39c('0x36')]({},_0x390cd7,_0x29ea9e[_0xb39c('0x38')]);return db[_0xb39c('0x39')][_0xb39c('0x40')](_0x390cd7)[_0xb39c('0x20')](handleEntityNotFound(_0x3d301e,null))[_0xb39c('0x20')](respondWithResult(_0x3d301e,null))[_0xb39c('0x3d')](handleError(_0x3d301e,null));};exports['create']=function(_0x23e6f6,_0x7e9750){return db[_0xb39c('0x39')][_0xb39c('0x41')](_0x23e6f6[_0xb39c('0x42')],{})[_0xb39c('0x20')](respondWithResult(_0x7e9750,0xc9))[_0xb39c('0x3d')](handleError(_0x7e9750,null));};exports[_0xb39c('0x43')]=function(_0x38bc36,_0x1ae2cb){if(_0x38bc36[_0xb39c('0x42')]['id']){delete _0x38bc36[_0xb39c('0x42')]['id'];}return db[_0xb39c('0x39')][_0xb39c('0x40')]({'where':{'id':_0x38bc36[_0xb39c('0x3f')]['id']}})[_0xb39c('0x20')](handleEntityNotFound(_0x1ae2cb,null))['then'](saveUpdates(_0x38bc36[_0xb39c('0x42')],null))[_0xb39c('0x20')](respondWithResult(_0x1ae2cb,null))[_0xb39c('0x3d')](handleError(_0x1ae2cb,null));};exports[_0xb39c('0x44')]=function(_0xa50077,_0x18db8f){return db[_0xb39c('0x39')][_0xb39c('0x40')]({'where':{'id':_0xa50077['params']['id']}})['then'](handleEntityNotFound(_0x18db8f,null))[_0xb39c('0x20')](removeEntity(_0x18db8f,null))[_0xb39c('0x3d')](handleError(_0x18db8f,null));};exports['describe']=function(_0x4f4f51,_0x226f60){return db[_0xb39c('0x39')]['describe']()[_0xb39c('0x20')](respondWithResult(_0x226f60,null))['catch'](handleError(_0x226f60,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 34ed346..4f5a590 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x5c5cc0,_0x3a7a7e){var _0x5baf3c=function(_0x2919d1){while(--_0x2919d1){_0x5c5cc0['push'](_0x5c5cc0['shift']());}};_0x5baf3c(++_0x3a7a7e);}(_0x7a54,0x106));var _0x47a5=function(_0x29229d,_0x116935){_0x29229d=_0x29229d-0x0;var _0x370eed=_0x7a54[_0x29229d];return _0x370eed;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x154ce7,_0x4567aa){var _0xc8e500=function(_0x206694){while(--_0x206694){_0x154ce7['push'](_0x154ce7['shift']());}};_0xc8e500(++_0x4567aa);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x5fc3[_0x4bfade];return _0x272465;};'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')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index d1c5a6a..c5f6d2b 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 _0x11d6=['then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','UpdateFaxQueueReport','update','where','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x45397f,_0x2202cd){var _0x35a074=function(_0x309cde){while(--_0x309cde){_0x45397f['push'](_0x45397f['shift']());}};_0x35a074(++_0x2202cd);}(_0x11d6,0x155));var _0x611d=function(_0x23f546,_0x5667c5){_0x23f546=_0x23f546-0x0;var _0x1d7535=_0x11d6[_0x23f546];return _0x1d7535;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x611d('0x0'));var BPromise=require(_0x611d('0x1'));var rs=require(_0x611d('0x2'));var fs=require('fs');var Redis=require(_0x611d('0x3'));var db=require(_0x611d('0x4'))['db'];var utils=require(_0x611d('0x5'));var logger=require(_0x611d('0x6'))(_0x611d('0x7'));var config=require(_0x611d('0x8'));var jayson=require(_0x611d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2be462,_0x38c8e5,_0x58afd2){return new BPromise(function(_0x221de7,_0x566fa3){return client[_0x611d('0xa')](_0x2be462,_0x58afd2)[_0x611d('0xb')](function(_0x209684){logger['info'](_0x611d('0xc'),_0x38c8e5,_0x611d('0xd'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x38c8e5,_0x611d('0xd'),JSON[_0x611d('0xe')](_0x209684));if(_0x209684['error']){if(_0x209684[_0x611d('0xf')][_0x611d('0x10')]===0x1f4){logger[_0x611d('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x38c8e5,_0x209684[_0x611d('0xf')][_0x611d('0x11')]);return _0x566fa3(_0x209684[_0x611d('0xf')][_0x611d('0x11')]);}logger[_0x611d('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x38c8e5,_0x209684[_0x611d('0xf')]['message']);return _0x221de7(_0x209684['error'][_0x611d('0x11')]);}else{logger[_0x611d('0x12')](_0x611d('0xc'),_0x38c8e5,_0x611d('0xd'));_0x221de7(_0x209684[_0x611d('0x13')]['message']);}})[_0x611d('0x14')](function(_0x3f414b){logger[_0x611d('0xf')](_0x611d('0xc'),_0x38c8e5,_0x3f414b);_0x566fa3(_0x3f414b);});});}exports[_0x611d('0x15')]=function(_0x1fb824){var _0x1da650=this;return new Promise(function(_0x576a4e,_0x2183d9){return db[_0x611d('0x16')][_0x611d('0x17')](_0x1fb824[_0x611d('0x18')],{'raw':_0x1fb824[_0x611d('0x19')]?_0x1fb824[_0x611d('0x19')][_0x611d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x531779){logger['info'](_0x611d('0x15'),_0x1fb824);logger[_0x611d('0x1b')](_0x611d('0x15'),_0x1fb824,JSON[_0x611d('0xe')](_0x531779));_0x576a4e(_0x531779);})['catch'](function(_0x2f30b6){logger[_0x611d('0xf')](_0x611d('0x15'),_0x2f30b6[_0x611d('0x11')],_0x1fb824);_0x2183d9(_0x1da650[_0x611d('0xf')](0x1f4,_0x2f30b6[_0x611d('0x11')]));});});};exports[_0x611d('0x1c')]=function(_0x377404){var _0x834be1=this;return new Promise(function(_0x4950ed,_0x4a0002){return db[_0x611d('0x16')][_0x611d('0x1d')](_0x377404[_0x611d('0x18')],{'raw':_0x377404[_0x611d('0x19')]?_0x377404[_0x611d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377404[_0x611d('0x19')]?_0x377404[_0x611d('0x19')][_0x611d('0x1e')]||null:null,'attributes':_0x377404['options']?_0x377404[_0x611d('0x19')]['attributes']||null:null,'limit':_0x377404[_0x611d('0x19')]?_0x377404[_0x611d('0x19')][_0x611d('0x1f')]||null:null})[_0x611d('0xb')](function(_0x38e9f7){logger[_0x611d('0x12')](_0x611d('0x1c'),_0x377404);logger['debug'](_0x611d('0x1c'),_0x377404,JSON[_0x611d('0xe')](_0x38e9f7));_0x4950ed(_0x38e9f7);})[_0x611d('0x14')](function(_0x27c552){logger[_0x611d('0xf')](_0x611d('0x1c'),_0x27c552[_0x611d('0x11')],_0x377404);_0x4a0002(_0x834be1[_0x611d('0xf')](0x1f4,_0x27c552[_0x611d('0x11')]));});});}; \ No newline at end of file +var _0x6583=['CreateFaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x6583,0x147));var _0x3658=function(_0x4c67da,_0x12fba3){_0x4c67da=_0x4c67da-0x0;var _0x507337=_0x6583[_0x4c67da];return _0x507337;};'use strict';var _=require(_0x3658('0x0'));var util=require(_0x3658('0x1'));var moment=require(_0x3658('0x2'));var BPromise=require(_0x3658('0x3'));var rs=require(_0x3658('0x4'));var fs=require('fs');var Redis=require(_0x3658('0x5'));var db=require(_0x3658('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3658('0x7'));var config=require(_0x3658('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3658('0x9')][_0x3658('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43eb95,_0xd0222b,_0x1d0979){return new BPromise(function(_0x27350a,_0x3112fd){return client[_0x3658('0xb')](_0x43eb95,_0x1d0979)['then'](function(_0xefcb9f){logger[_0x3658('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0xd0222b,_0x3658('0xd'));logger[_0x3658('0xe')](_0x3658('0xf'),_0xd0222b,_0x3658('0xd'),JSON[_0x3658('0x10')](_0xefcb9f));if(_0xefcb9f[_0x3658('0x11')]){if(_0xefcb9f['error'][_0x3658('0x12')]===0x1f4){logger['error'](_0x3658('0x13'),_0xd0222b,_0xefcb9f[_0x3658('0x11')][_0x3658('0x14')]);return _0x3112fd(_0xefcb9f[_0x3658('0x11')][_0x3658('0x14')]);}logger[_0x3658('0x11')](_0x3658('0x13'),_0xd0222b,_0xefcb9f[_0x3658('0x11')][_0x3658('0x14')]);return _0x27350a(_0xefcb9f[_0x3658('0x11')][_0x3658('0x14')]);}else{logger[_0x3658('0xc')](_0x3658('0x13'),_0xd0222b,_0x3658('0xd'));_0x27350a(_0xefcb9f[_0x3658('0x15')][_0x3658('0x14')]);}})[_0x3658('0x16')](function(_0xd8c9f0){logger[_0x3658('0x11')](_0x3658('0x13'),_0xd0222b,_0xd8c9f0);_0x3112fd(_0xd8c9f0);});});}exports[_0x3658('0x17')]=function(_0x48feb3){var _0x71f645=this;return new Promise(function(_0x254112,_0x14d7ef){return db['FaxQueueReport'][_0x3658('0x18')](_0x48feb3[_0x3658('0x19')],{'raw':_0x48feb3[_0x3658('0x1a')]?_0x48feb3[_0x3658('0x1a')][_0x3658('0x1b')]===undefined?!![]:![]:!![]})[_0x3658('0x1c')](function(_0x169daf){logger['info'](_0x3658('0x17'),_0x48feb3);logger[_0x3658('0xe')](_0x3658('0x17'),_0x48feb3,JSON[_0x3658('0x10')](_0x169daf));_0x254112(_0x169daf);})[_0x3658('0x16')](function(_0x3f4283){logger['error'](_0x3658('0x17'),_0x3f4283[_0x3658('0x14')],_0x48feb3);_0x14d7ef(_0x71f645[_0x3658('0x11')](0x1f4,_0x3f4283[_0x3658('0x14')]));});});};exports[_0x3658('0x1d')]=function(_0x4b593a){var _0x39237c=this;return new Promise(function(_0x2b1616,_0x4e069d){return db[_0x3658('0x1e')][_0x3658('0x1f')](_0x4b593a[_0x3658('0x19')],{'raw':_0x4b593a[_0x3658('0x1a')]?_0x4b593a[_0x3658('0x1a')][_0x3658('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b593a[_0x3658('0x1a')]?_0x4b593a[_0x3658('0x1a')][_0x3658('0x20')]||null:null,'attributes':_0x4b593a['options']?_0x4b593a['options'][_0x3658('0x21')]||null:null,'limit':_0x4b593a['options']?_0x4b593a[_0x3658('0x1a')][_0x3658('0x22')]||null:null})['then'](function(_0x428f62){logger[_0x3658('0xc')]('UpdateFaxQueueReport',_0x4b593a);logger[_0x3658('0xe')](_0x3658('0x1d'),_0x4b593a,JSON['stringify'](_0x428f62));_0x2b1616(_0x428f62);})[_0x3658('0x16')](function(_0xd37edc){logger['error'](_0x3658('0x1d'),_0xd37edc[_0x3658('0x14')],_0x4b593a);_0x4e069d(_0x39237c[_0x3658('0x11')](0x1f4,_0xd37edc['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ab984a3..0828ff4 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 _0x34d8=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x34d8,0xd3));var _0x834d=function(_0x460ade,_0x256571){_0x460ade=_0x460ade-0x0;var _0x20bfe2=_0x34d8[_0x460ade];return _0x20bfe2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x834d('0x0'));var timeout=require('connect-timeout');var express=require(_0x834d('0x1'));var router=express[_0x834d('0x2')]();var fs_extra=require(_0x834d('0x3'));var auth=require(_0x834d('0x4'));var interaction=require(_0x834d('0x5'));var config=require('../../config/environment');var controller=require(_0x834d('0x6'));router[_0x834d('0x7')]('/',auth[_0x834d('0x8')](),controller[_0x834d('0x9')]);router[_0x834d('0x7')](_0x834d('0xa'),auth[_0x834d('0x8')](),controller[_0x834d('0xb')]);router[_0x834d('0x7')]('/:id',auth[_0x834d('0x8')](),controller[_0x834d('0xc')]);router[_0x834d('0xd')]('/',auth['isAuthenticated'](),controller[_0x834d('0xe')]);router[_0x834d('0xf')]('/:id',auth[_0x834d('0x8')](),controller[_0x834d('0x10')]);router[_0x834d('0x11')](_0x834d('0x12'),auth[_0x834d('0x8')](),controller[_0x834d('0x13')]);module[_0x834d('0x14')]=router; \ No newline at end of file +var _0x727b=['show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x727b,0xee));var _0xb727=function(_0x41a3e6,_0x1a36cc){_0x41a3e6=_0x41a3e6-0x0;var _0x3fd196=_0x727b[_0x41a3e6];return _0x3fd196;};'use strict';var multer=require(_0xb727('0x0'));var util=require(_0xb727('0x1'));var path=require(_0xb727('0x2'));var timeout=require('connect-timeout');var express=require(_0xb727('0x3'));var router=express[_0xb727('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb727('0x5'));var interaction=require(_0xb727('0x6'));var config=require('../../config/environment');var controller=require(_0xb727('0x7'));router[_0xb727('0x8')]('/',auth[_0xb727('0x9')](),controller[_0xb727('0xa')]);router[_0xb727('0x8')](_0xb727('0xb'),auth[_0xb727('0x9')](),controller[_0xb727('0xc')]);router[_0xb727('0x8')](_0xb727('0xd'),auth['isAuthenticated'](),controller[_0xb727('0xe')]);router[_0xb727('0xf')]('/',auth['isAuthenticated'](),controller[_0xb727('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb727('0x11')]);router[_0xb727('0x12')](_0xb727('0xd'),auth[_0xb727('0x9')](),controller[_0xb727('0x13')]);module[_0xb727('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 42d1728..1bb2bcc 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1500ed,_0x4dc1c4){var _0x8086dd=function(_0x2166fb){while(--_0x2166fb){_0x1500ed['push'](_0x1500ed['shift']());}};_0x8086dd(++_0x4dc1c4);}(_0xaa88,0x137));var _0x8aa8=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xaa88[_0x49c057];return _0xd8f0e6;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xbe31a4,_0x11ba89){var _0x15ec28=function(_0x124633){while(--_0x124633){_0xbe31a4['push'](_0xbe31a4['shift']());}};_0x15ec28(++_0x11ba89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 605222d..7d9537b 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 _0x39ed=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','FaxTransferReport','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x39ed,0x1c6));var _0xd39e=function(_0x3d15d3,_0x19de30){_0x3d15d3=_0x3d15d3-0x0;var _0x384ae3=_0x39ed[_0x3d15d3];return _0x384ae3;};'use strict';var emlformat=require(_0xd39e('0x0'));var rimraf=require(_0xd39e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd39e('0x2'));var rp=require(_0xd39e('0x3'));var moment=require(_0xd39e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd39e('0x5'));var util=require(_0xd39e('0x6'));var path=require(_0xd39e('0x7'));var sox=require(_0xd39e('0x8'));var csv=require('to-csv');var ejs=require(_0xd39e('0x9'));var fs=require('fs');var fs_extra=require(_0xd39e('0xa'));var _=require(_0xd39e('0xb'));var squel=require('squel');var crypto=require(_0xd39e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd39e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd39e('0xe'));var Papa=require(_0xd39e('0xf'));var Redis=require(_0xd39e('0x10'));var authService=require(_0xd39e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd39e('0x12'));var hardwareService=require(_0xd39e('0x13'));var logger=require('../../config/logger')(_0xd39e('0x14'));var utils=require(_0xd39e('0x15'));var config=require(_0xd39e('0x16'));var licenseUtil=require(_0xd39e('0x17'));var db=require(_0xd39e('0x18'))['db'];function respondWithStatusCode(_0x13d1dd,_0x15af1d){_0x15af1d=_0x15af1d||0xcc;return function(_0x3a8765){if(_0x3a8765){return _0x13d1dd[_0xd39e('0x19')](_0x15af1d);}return _0x13d1dd[_0xd39e('0x1a')](_0x15af1d)[_0xd39e('0x1b')]();};}function respondWithResult(_0x45200b,_0x2f3a0c){_0x2f3a0c=_0x2f3a0c||0xc8;return function(_0x16dce8){if(_0x16dce8){return _0x45200b[_0xd39e('0x1a')](_0x2f3a0c)[_0xd39e('0x1c')](_0x16dce8);}};}function respondWithFilteredResult(_0x303acf,_0xd67c5c){return function(_0x4c7317){if(_0x4c7317){var _0x2ea8ba=typeof _0xd67c5c[_0xd39e('0x1d')]===_0xd39e('0x1e')&&typeof _0xd67c5c[_0xd39e('0x1f')]===_0xd39e('0x1e');var _0x373569=_0x4c7317['count'];var _0x2bdbec=_0x2ea8ba?0x0:_0xd67c5c[_0xd39e('0x1d')];var _0x4080c7=_0x2ea8ba?_0x4c7317[_0xd39e('0x20')]:_0xd67c5c[_0xd39e('0x1d')]+_0xd67c5c[_0xd39e('0x1f')];var _0xf22b24;if(_0x4080c7>=_0x373569){_0x4080c7=_0x373569;_0xf22b24=0xc8;}else{_0xf22b24=0xce;}_0x303acf['status'](_0xf22b24);return _0x303acf[_0xd39e('0x21')](_0xd39e('0x22'),_0x2bdbec+'-'+_0x4080c7+'/'+_0x373569)[_0xd39e('0x1c')](_0x4c7317);}return null;};}function patchUpdates(_0x1343c0){return function(_0x1575eb){try{jsonpatch[_0xd39e('0x23')](_0x1575eb,_0x1343c0,!![]);}catch(_0x32f327){return BPromise[_0xd39e('0x24')](_0x32f327);}return _0x1575eb[_0xd39e('0x25')]();};}function saveUpdates(_0x15af7e,_0x2ea908){return function(_0x11877a){if(_0x11877a){return _0x11877a['update'](_0x15af7e)[_0xd39e('0x26')](function(_0x1a1744){return _0x1a1744;});}return null;};}function removeEntity(_0x408df8,_0x1e61fc){return function(_0x141a86){if(_0x141a86){return _0x141a86[_0xd39e('0x27')]()[_0xd39e('0x26')](function(){_0x408df8[_0xd39e('0x1a')](0xcc)[_0xd39e('0x1b')]();});}};}function handleEntityNotFound(_0x41ec61,_0x57630a){return function(_0x1030c7){if(!_0x1030c7){_0x41ec61[_0xd39e('0x19')](0x194);}return _0x1030c7;};}function handleError(_0x19969d,_0x413bd8){_0x413bd8=_0x413bd8||0x1f4;return function(_0xcfc380){logger[_0xd39e('0x28')](_0xcfc380[_0xd39e('0x29')]);if(_0xcfc380[_0xd39e('0x2a')]){delete _0xcfc380['name'];}_0x19969d['status'](_0x413bd8)['send'](_0xcfc380);};}exports['index']=function(_0x437a9e,_0x32106a){var _0x45155e={},_0xf7c9cc={},_0x4035f2={'count':0x0,'rows':[]};var _0x5b03db=_[_0xd39e('0x2b')](db[_0xd39e('0x2c')][_0xd39e('0x2d')],function(_0x3b5843){return{'name':_0x3b5843[_0xd39e('0x2e')],'type':_0x3b5843[_0xd39e('0x2f')][_0xd39e('0x30')]};});_0xf7c9cc['model']=_[_0xd39e('0x2b')](_0x5b03db,'name');_0xf7c9cc['query']=_[_0xd39e('0x31')](_0x437a9e['query']);_0xf7c9cc[_0xd39e('0x32')]=_[_0xd39e('0x33')](_0xf7c9cc[_0xd39e('0x34')],_0xf7c9cc[_0xd39e('0x35')]);_0x45155e[_0xd39e('0x36')]=_[_0xd39e('0x33')](_0xf7c9cc[_0xd39e('0x34')],qs[_0xd39e('0x37')](_0x437a9e[_0xd39e('0x35')][_0xd39e('0x37')]));_0x45155e[_0xd39e('0x36')]=_0x45155e[_0xd39e('0x36')][_0xd39e('0x38')]?_0x45155e[_0xd39e('0x36')]:_0xf7c9cc[_0xd39e('0x34')];if(!_0x437a9e[_0xd39e('0x35')]['hasOwnProperty'](_0xd39e('0x39'))){_0x45155e[_0xd39e('0x1f')]=qs['limit'](_0x437a9e['query'][_0xd39e('0x1f')]);_0x45155e[_0xd39e('0x1d')]=qs[_0xd39e('0x1d')](_0x437a9e[_0xd39e('0x35')][_0xd39e('0x1d')]);}_0x45155e[_0xd39e('0x3a')]=qs[_0xd39e('0x3b')](_0x437a9e[_0xd39e('0x35')][_0xd39e('0x3b')]);_0x45155e[_0xd39e('0x3c')]=qs['filters'](_[_0xd39e('0x3d')](_0x437a9e[_0xd39e('0x35')],_0xf7c9cc['filters']),_0x5b03db);if(_0x437a9e[_0xd39e('0x35')][_0xd39e('0x3e')]){_0x45155e[_0xd39e('0x3c')]=_[_0xd39e('0x3f')](_0x45155e[_0xd39e('0x3c')],{'$or':_[_0xd39e('0x2b')](_0x5b03db,function(_0x3be3dd){if(_0x3be3dd[_0xd39e('0x2f')]!==_0xd39e('0x40')){var _0x28a206={};_0x28a206[_0x3be3dd[_0xd39e('0x2a')]]={'$like':'%'+_0x437a9e[_0xd39e('0x35')][_0xd39e('0x3e')]+'%'};return _0x28a206;}})});}_0x45155e=_['merge']({},_0x45155e,_0x437a9e[_0xd39e('0x41')]);var _0x447017={'where':_0x45155e[_0xd39e('0x3c')]};return db[_0xd39e('0x2c')][_0xd39e('0x20')](_0x447017)[_0xd39e('0x26')](function(_0x10c336){_0x4035f2['count']=_0x10c336;if(_0x437a9e['query']['includeAll']){_0x45155e[_0xd39e('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xd39e('0x43')](_0x45155e);})['then'](function(_0x2c536e){_0x4035f2[_0xd39e('0x44')]=_0x2c536e;return _0x4035f2;})[_0xd39e('0x26')](respondWithFilteredResult(_0x32106a,_0x45155e))['catch'](handleError(_0x32106a,null));};exports[_0xd39e('0x45')]=function(_0x2bc796,_0x52c213){var _0x38aa7d={'raw':!![],'where':{'id':_0x2bc796[_0xd39e('0x46')]['id']}},_0x1288a8={};_0x1288a8['model']=_[_0xd39e('0x31')](db['FaxTransferReport'][_0xd39e('0x2d')]);_0x1288a8['query']=_[_0xd39e('0x31')](_0x2bc796[_0xd39e('0x35')]);_0x1288a8[_0xd39e('0x32')]=_['intersection'](_0x1288a8['model'],_0x1288a8[_0xd39e('0x35')]);_0x38aa7d['attributes']=_['intersection'](_0x1288a8[_0xd39e('0x34')],qs[_0xd39e('0x37')](_0x2bc796[_0xd39e('0x35')][_0xd39e('0x37')]));_0x38aa7d[_0xd39e('0x36')]=_0x38aa7d[_0xd39e('0x36')][_0xd39e('0x38')]?_0x38aa7d[_0xd39e('0x36')]:_0x1288a8[_0xd39e('0x34')];if(_0x2bc796['query'][_0xd39e('0x47')]){_0x38aa7d[_0xd39e('0x42')]=[{'all':!![]}];}_0x38aa7d=_['merge']({},_0x38aa7d,_0x2bc796['options']);return db['FaxTransferReport'][_0xd39e('0x48')](_0x38aa7d)[_0xd39e('0x26')](handleEntityNotFound(_0x52c213,null))['then'](respondWithResult(_0x52c213,null))[_0xd39e('0x49')](handleError(_0x52c213,null));};exports[_0xd39e('0x4a')]=function(_0xc05b1c,_0x520c31){return db[_0xd39e('0x2c')][_0xd39e('0x4a')](_0xc05b1c[_0xd39e('0x4b')],{})['then'](respondWithResult(_0x520c31,0xc9))['catch'](handleError(_0x520c31,null));};exports[_0xd39e('0x4c')]=function(_0x5556d7,_0x2c9283){if(_0x5556d7[_0xd39e('0x4b')]['id']){delete _0x5556d7[_0xd39e('0x4b')]['id'];}return db['FaxTransferReport'][_0xd39e('0x48')]({'where':{'id':_0x5556d7[_0xd39e('0x46')]['id']}})[_0xd39e('0x26')](handleEntityNotFound(_0x2c9283,null))['then'](saveUpdates(_0x5556d7[_0xd39e('0x4b')],null))['then'](respondWithResult(_0x2c9283,null))['catch'](handleError(_0x2c9283,null));};exports['destroy']=function(_0x20876e,_0x323eff){return db[_0xd39e('0x2c')][_0xd39e('0x48')]({'where':{'id':_0x20876e[_0xd39e('0x46')]['id']}})['then'](handleEntityNotFound(_0x323eff,null))[_0xd39e('0x26')](removeEntity(_0x323eff,null))[_0xd39e('0x49')](handleError(_0x323eff,null));};exports[_0xd39e('0x4d')]=function(_0x351c71,_0x269bf4){return db['FaxTransferReport']['describe']()[_0xd39e('0x26')](respondWithResult(_0x269bf4,null))[_0xd39e('0x49')](handleError(_0x269bf4,null));}; \ No newline at end of file +var _0xe3a3=['../../config/utils','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','send','map','FaxTransferReport','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','moment','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0xe3a3,0x142));var _0x3e3a=function(_0x251873,_0x5d85ca){_0x251873=_0x251873-0x0;var _0x13da9d=_0xe3a3[_0x251873];return _0x13da9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e3a('0x0'));var zipdir=require(_0x3e3a('0x1'));var jsonpatch=require(_0x3e3a('0x2'));var rp=require('request-promise');var moment=require(_0x3e3a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3e3a('0x4'));var path=require(_0x3e3a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e3a('0x6'));var crypto=require(_0x3e3a('0x7'));var jsforce=require(_0x3e3a('0x8'));var deskjs=require(_0x3e3a('0x9'));var toCsv=require(_0x3e3a('0xa'));var querystring=require(_0x3e3a('0xb'));var Papa=require(_0x3e3a('0xc'));var Redis=require(_0x3e3a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3e3a('0xe'));var as=require(_0x3e3a('0xf'));var hardwareService=require(_0x3e3a('0x10'));var logger=require(_0x3e3a('0x11'))('api');var utils=require(_0x3e3a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3e3a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e25b8,_0x8383e0){_0x8383e0=_0x8383e0||0xcc;return function(_0x4335dd){if(_0x4335dd){return _0x5e25b8['sendStatus'](_0x8383e0);}return _0x5e25b8[_0x3e3a('0x14')](_0x8383e0)['end']();};}function respondWithResult(_0x1282c8,_0x1e5fe6){_0x1e5fe6=_0x1e5fe6||0xc8;return function(_0x25b573){if(_0x25b573){return _0x1282c8[_0x3e3a('0x14')](_0x1e5fe6)[_0x3e3a('0x15')](_0x25b573);}};}function respondWithFilteredResult(_0x4e910f,_0xbfb665){return function(_0x5e5b7b){if(_0x5e5b7b){var _0xf8cef5=typeof _0xbfb665[_0x3e3a('0x16')]===_0x3e3a('0x17')&&typeof _0xbfb665['limit']==='undefined';var _0x20c2e7=_0x5e5b7b[_0x3e3a('0x18')];var _0x11c01e=_0xf8cef5?0x0:_0xbfb665[_0x3e3a('0x16')];var _0x2869b0=_0xf8cef5?_0x5e5b7b['count']:_0xbfb665['offset']+_0xbfb665[_0x3e3a('0x19')];var _0x57c1c5;if(_0x2869b0>=_0x20c2e7){_0x2869b0=_0x20c2e7;_0x57c1c5=0xc8;}else{_0x57c1c5=0xce;}_0x4e910f[_0x3e3a('0x14')](_0x57c1c5);return _0x4e910f[_0x3e3a('0x1a')](_0x3e3a('0x1b'),_0x11c01e+'-'+_0x2869b0+'/'+_0x20c2e7)['json'](_0x5e5b7b);}return null;};}function patchUpdates(_0x588643){return function(_0x19ede8){try{jsonpatch['apply'](_0x19ede8,_0x588643,!![]);}catch(_0x3e9696){return BPromise['reject'](_0x3e9696);}return _0x19ede8['save']();};}function saveUpdates(_0x565ad9,_0x1d87b7){return function(_0x4b2c92){if(_0x4b2c92){return _0x4b2c92['update'](_0x565ad9)[_0x3e3a('0x1c')](function(_0x56c83f){return _0x56c83f;});}return null;};}function removeEntity(_0x439ff9,_0x333736){return function(_0x59d820){if(_0x59d820){return _0x59d820[_0x3e3a('0x1d')]()['then'](function(){_0x439ff9['status'](0xcc)[_0x3e3a('0x1e')]();});}};}function handleEntityNotFound(_0x501a09,_0x43006e){return function(_0xfe1d2b){if(!_0xfe1d2b){_0x501a09[_0x3e3a('0x1f')](0x194);}return _0xfe1d2b;};}function handleError(_0x9ef9ce,_0x32560b){_0x32560b=_0x32560b||0x1f4;return function(_0x552a8c){logger[_0x3e3a('0x20')](_0x552a8c[_0x3e3a('0x21')]);if(_0x552a8c[_0x3e3a('0x22')]){delete _0x552a8c[_0x3e3a('0x22')];}_0x9ef9ce[_0x3e3a('0x14')](_0x32560b)[_0x3e3a('0x23')](_0x552a8c);};}exports['index']=function(_0x17db0b,_0x53c141){var _0x489c03={},_0x3d4cbc={},_0x4e63ae={'count':0x0,'rows':[]};var _0x7906fb=_[_0x3e3a('0x24')](db[_0x3e3a('0x25')]['rawAttributes'],function(_0x13beb6){return{'name':_0x13beb6['fieldName'],'type':_0x13beb6['type'][_0x3e3a('0x26')]};});_0x3d4cbc['model']=_[_0x3e3a('0x24')](_0x7906fb,_0x3e3a('0x22'));_0x3d4cbc['query']=_[_0x3e3a('0x27')](_0x17db0b[_0x3e3a('0x28')]);_0x3d4cbc[_0x3e3a('0x29')]=_[_0x3e3a('0x2a')](_0x3d4cbc[_0x3e3a('0x2b')],_0x3d4cbc[_0x3e3a('0x28')]);_0x489c03[_0x3e3a('0x2c')]=_[_0x3e3a('0x2a')](_0x3d4cbc[_0x3e3a('0x2b')],qs['fields'](_0x17db0b['query'][_0x3e3a('0x2d')]));_0x489c03[_0x3e3a('0x2c')]=_0x489c03[_0x3e3a('0x2c')]['length']?_0x489c03[_0x3e3a('0x2c')]:_0x3d4cbc[_0x3e3a('0x2b')];if(!_0x17db0b[_0x3e3a('0x28')]['hasOwnProperty'](_0x3e3a('0x2e'))){_0x489c03['limit']=qs['limit'](_0x17db0b[_0x3e3a('0x28')][_0x3e3a('0x19')]);_0x489c03[_0x3e3a('0x16')]=qs[_0x3e3a('0x16')](_0x17db0b['query'][_0x3e3a('0x16')]);}_0x489c03[_0x3e3a('0x2f')]=qs[_0x3e3a('0x30')](_0x17db0b[_0x3e3a('0x28')][_0x3e3a('0x30')]);_0x489c03[_0x3e3a('0x31')]=qs[_0x3e3a('0x29')](_[_0x3e3a('0x32')](_0x17db0b[_0x3e3a('0x28')],_0x3d4cbc[_0x3e3a('0x29')]),_0x7906fb);if(_0x17db0b[_0x3e3a('0x28')][_0x3e3a('0x33')]){_0x489c03[_0x3e3a('0x31')]=_[_0x3e3a('0x34')](_0x489c03[_0x3e3a('0x31')],{'$or':_[_0x3e3a('0x24')](_0x7906fb,function(_0x3b6074){if(_0x3b6074[_0x3e3a('0x35')]!==_0x3e3a('0x36')){var _0x360bfb={};_0x360bfb[_0x3b6074[_0x3e3a('0x22')]]={'$like':'%'+_0x17db0b[_0x3e3a('0x28')]['filter']+'%'};return _0x360bfb;}})});}_0x489c03=_[_0x3e3a('0x34')]({},_0x489c03,_0x17db0b[_0x3e3a('0x37')]);var _0x32919a={'where':_0x489c03[_0x3e3a('0x31')]};return db[_0x3e3a('0x25')][_0x3e3a('0x18')](_0x32919a)['then'](function(_0x3bca0d){_0x4e63ae['count']=_0x3bca0d;if(_0x17db0b['query'][_0x3e3a('0x38')]){_0x489c03[_0x3e3a('0x39')]=[{'all':!![]}];}return db[_0x3e3a('0x25')][_0x3e3a('0x3a')](_0x489c03);})[_0x3e3a('0x1c')](function(_0x1275ee){_0x4e63ae['rows']=_0x1275ee;return _0x4e63ae;})[_0x3e3a('0x1c')](respondWithFilteredResult(_0x53c141,_0x489c03))[_0x3e3a('0x3b')](handleError(_0x53c141,null));};exports[_0x3e3a('0x3c')]=function(_0x41c1ea,_0xe02bb5){var _0x3f3aad={'raw':!![],'where':{'id':_0x41c1ea[_0x3e3a('0x3d')]['id']}},_0x29c625={};_0x29c625[_0x3e3a('0x2b')]=_[_0x3e3a('0x27')](db[_0x3e3a('0x25')][_0x3e3a('0x3e')]);_0x29c625['query']=_[_0x3e3a('0x27')](_0x41c1ea[_0x3e3a('0x28')]);_0x29c625[_0x3e3a('0x29')]=_[_0x3e3a('0x2a')](_0x29c625['model'],_0x29c625[_0x3e3a('0x28')]);_0x3f3aad[_0x3e3a('0x2c')]=_['intersection'](_0x29c625[_0x3e3a('0x2b')],qs[_0x3e3a('0x2d')](_0x41c1ea['query']['fields']));_0x3f3aad[_0x3e3a('0x2c')]=_0x3f3aad[_0x3e3a('0x2c')]['length']?_0x3f3aad['attributes']:_0x29c625[_0x3e3a('0x2b')];if(_0x41c1ea[_0x3e3a('0x28')]['includeAll']){_0x3f3aad['include']=[{'all':!![]}];}_0x3f3aad=_[_0x3e3a('0x34')]({},_0x3f3aad,_0x41c1ea[_0x3e3a('0x37')]);return db['FaxTransferReport']['find'](_0x3f3aad)[_0x3e3a('0x1c')](handleEntityNotFound(_0xe02bb5,null))[_0x3e3a('0x1c')](respondWithResult(_0xe02bb5,null))[_0x3e3a('0x3b')](handleError(_0xe02bb5,null));};exports['create']=function(_0xb417a1,_0x135003){return db['FaxTransferReport'][_0x3e3a('0x3f')](_0xb417a1[_0x3e3a('0x40')],{})[_0x3e3a('0x1c')](respondWithResult(_0x135003,0xc9))[_0x3e3a('0x3b')](handleError(_0x135003,null));};exports[_0x3e3a('0x41')]=function(_0x19533d,_0xd67d22){if(_0x19533d[_0x3e3a('0x40')]['id']){delete _0x19533d[_0x3e3a('0x40')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x19533d[_0x3e3a('0x3d')]['id']}})[_0x3e3a('0x1c')](handleEntityNotFound(_0xd67d22,null))[_0x3e3a('0x1c')](saveUpdates(_0x19533d[_0x3e3a('0x40')],null))['then'](respondWithResult(_0xd67d22,null))[_0x3e3a('0x3b')](handleError(_0xd67d22,null));};exports['destroy']=function(_0x4ce476,_0x10e42e){return db[_0x3e3a('0x25')][_0x3e3a('0x42')]({'where':{'id':_0x4ce476[_0x3e3a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x10e42e,null))['then'](removeEntity(_0x10e42e,null))[_0x3e3a('0x3b')](handleError(_0x10e42e,null));};exports[_0x3e3a('0x43')]=function(_0x45ae89,_0xd4199f){return db['FaxTransferReport'][_0x3e3a('0x43')]()[_0x3e3a('0x1c')](respondWithResult(_0xd4199f,null))[_0x3e3a('0x3b')](handleError(_0xd4199f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index cedbd4c..b6976b0 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 _0x5ef5=['report_fax_transfer','uniqueid','lodash','api','moment','bluebird','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x5ef5,0x1d6));var _0x55ef=function(_0x49e412,_0x2ce0fe){_0x49e412=_0x49e412-0x0;var _0x3ecc6f=_0x5ef5[_0x49e412];return _0x3ecc6f;};'use strict';var _=require(_0x55ef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55ef('0x1'));var moment=require(_0x55ef('0x2'));var BPromise=require(_0x55ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x55ef('0x4'));var config=require(_0x55ef('0x5'));var attributes=require(_0x55ef('0x6'));module[_0x55ef('0x7')]=function(_0x12e7eb,_0x3770b){return _0x12e7eb[_0x55ef('0x8')](_0x55ef('0x9'),attributes,{'tableName':_0x55ef('0xa'),'paranoid':![],'indexes':[{'name':_0x55ef('0xb'),'fields':[_0x55ef('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5835=['uniqueid','lodash','api','moment','path','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x5835,0x123));var _0x5583=function(_0x1d2eff,_0x45286f){_0x1d2eff=_0x1d2eff-0x0;var _0x25e995=_0x5835[_0x1d2eff];return _0x25e995;};'use strict';var _=require(_0x5583('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5583('0x1'));var moment=require(_0x5583('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5583('0x3'));var rimraf=require('rimraf');var config=require(_0x5583('0x4'));var attributes=require('./faxTransferReport.attributes');module[_0x5583('0x5')]=function(_0x5a0c58,_0x569959){return _0x5a0c58[_0x5583('0x6')](_0x5583('0x7'),attributes,{'tableName':_0x5583('0x8'),'paranoid':![],'indexes':[{'name':_0x5583('0x9'),'fields':[_0x5583('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index b8f3ebe..89b8d45 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 _0xff3f=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5388f6,_0x545fee){var _0x173721=function(_0x3ffffa){while(--_0x3ffffa){_0x5388f6['push'](_0x5388f6['shift']());}};_0x173721(++_0x545fee);}(_0xff3f,0x1e9));var _0xfff3=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0xff3f[_0x10dbf6];return _0x452147;};'use strict';var _=require('lodash');var util=require(_0xfff3('0x0'));var moment=require(_0xfff3('0x1'));var BPromise=require(_0xfff3('0x2'));var rs=require(_0xfff3('0x3'));var fs=require('fs');var Redis=require(_0xfff3('0x4'));var db=require(_0xfff3('0x5'))['db'];var utils=require(_0xfff3('0x6'));var logger=require('../../config/logger')(_0xfff3('0x7'));var config=require(_0xfff3('0x8'));var jayson=require(_0xfff3('0x9'));var client=jayson[_0xfff3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a01f,_0x27a614,_0xae6cb5){return new BPromise(function(_0x369f9d,_0xb52aca){return client[_0xfff3('0xb')](_0x53a01f,_0xae6cb5)[_0xfff3('0xc')](function(_0x37b31f){logger[_0xfff3('0xd')](_0xfff3('0xe'),_0x27a614,_0xfff3('0xf'));logger[_0xfff3('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x27a614,_0xfff3('0xf'),JSON[_0xfff3('0x11')](_0x37b31f));if(_0x37b31f[_0xfff3('0x12')]){if(_0x37b31f[_0xfff3('0x12')]['code']===0x1f4){logger[_0xfff3('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x27a614,_0x37b31f[_0xfff3('0x12')][_0xfff3('0x13')]);return _0xb52aca(_0x37b31f[_0xfff3('0x12')][_0xfff3('0x13')]);}logger['error'](_0xfff3('0xe'),_0x27a614,_0x37b31f[_0xfff3('0x12')][_0xfff3('0x13')]);return _0x369f9d(_0x37b31f[_0xfff3('0x12')][_0xfff3('0x13')]);}else{logger[_0xfff3('0xd')](_0xfff3('0xe'),_0x27a614,_0xfff3('0xf'));_0x369f9d(_0x37b31f[_0xfff3('0x14')][_0xfff3('0x13')]);}})[_0xfff3('0x15')](function(_0x4daf72){logger[_0xfff3('0x12')](_0xfff3('0xe'),_0x27a614,_0x4daf72);_0xb52aca(_0x4daf72);});});} \ No newline at end of file +var _0x78b2=['request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x78b2,0x1d9));var _0x278b=function(_0x3d9643,_0x31b8b3){_0x3d9643=_0x3d9643-0x0;var _0x13a434=_0x78b2[_0x3d9643];return _0x13a434;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var moment=require(_0x278b('0x2'));var BPromise=require(_0x278b('0x3'));var rs=require(_0x278b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x278b('0x5'))['db'];var utils=require(_0x278b('0x6'));var logger=require(_0x278b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x278b('0x8'));var client=jayson[_0x278b('0x9')][_0x278b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a23e0,_0x59f765,_0x911688){return new BPromise(function(_0x3f72f6,_0x557462){return client[_0x278b('0xb')](_0x8a23e0,_0x911688)[_0x278b('0xc')](function(_0x3ee4f7){logger[_0x278b('0xd')](_0x278b('0xe'),_0x59f765,_0x278b('0xf'));logger[_0x278b('0x10')](_0x278b('0x11'),_0x59f765,_0x278b('0xf'),JSON[_0x278b('0x12')](_0x3ee4f7));if(_0x3ee4f7['error']){if(_0x3ee4f7[_0x278b('0x13')][_0x278b('0x14')]===0x1f4){logger['error'](_0x278b('0xe'),_0x59f765,_0x3ee4f7[_0x278b('0x13')][_0x278b('0x15')]);return _0x557462(_0x3ee4f7[_0x278b('0x13')]['message']);}logger[_0x278b('0x13')](_0x278b('0xe'),_0x59f765,_0x3ee4f7[_0x278b('0x13')]['message']);return _0x3f72f6(_0x3ee4f7[_0x278b('0x13')][_0x278b('0x15')]);}else{logger[_0x278b('0xd')](_0x278b('0xe'),_0x59f765,_0x278b('0xf'));_0x3f72f6(_0x3ee4f7['result'][_0x278b('0x15')]);}})['catch'](function(_0x5aa6c0){logger['error'](_0x278b('0xe'),_0x59f765,_0x5aa6c0);_0x557462(_0x5aa6c0);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 739bc2d..caf79ba 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 _0x79f2=['post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79f2,0x101));var _0x279f=function(_0x3b7dcd,_0x306afe){_0x3b7dcd=_0x3b7dcd-0x0;var _0x1692f8=_0x79f2[_0x3b7dcd];return _0x1692f8;};'use strict';var multer=require(_0x279f('0x0'));var util=require(_0x279f('0x1'));var path=require(_0x279f('0x2'));var timeout=require(_0x279f('0x3'));var express=require('express');var router=express[_0x279f('0x4')]();var fs_extra=require(_0x279f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x279f('0x6'));var config=require(_0x279f('0x7'));var controller=require(_0x279f('0x8'));router[_0x279f('0x9')]('/',auth[_0x279f('0xa')](),controller[_0x279f('0xb')]);router[_0x279f('0x9')]('/describe',auth[_0x279f('0xa')](),controller[_0x279f('0xc')]);router[_0x279f('0x9')]('/:id',auth[_0x279f('0xa')](),controller['show']);router[_0x279f('0xd')]('/',auth[_0x279f('0xa')](),controller[_0x279f('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x279f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x279f('0x10')]);module[_0x279f('0x11')]=router; \ No newline at end of file +var _0x43b4=['/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index'];(function(_0x4e774e,_0x22d57e){var _0x1c5886=function(_0x341e3c){while(--_0x341e3c){_0x4e774e['push'](_0x4e774e['shift']());}};_0x1c5886(++_0x22d57e);}(_0x43b4,0x112));var _0x443b=function(_0x1aa0e7,_0x498fbd){_0x1aa0e7=_0x1aa0e7-0x0;var _0x55f771=_0x43b4[_0x1aa0e7];return _0x55f771;};'use strict';var multer=require('multer');var util=require(_0x443b('0x0'));var path=require(_0x443b('0x1'));var timeout=require(_0x443b('0x2'));var express=require(_0x443b('0x3'));var router=express[_0x443b('0x4')]();var fs_extra=require(_0x443b('0x5'));var auth=require(_0x443b('0x6'));var interaction=require(_0x443b('0x7'));var config=require(_0x443b('0x8'));var controller=require(_0x443b('0x9'));router[_0x443b('0xa')]('/',auth['isAuthenticated'](),controller[_0x443b('0xb')]);router[_0x443b('0xa')](_0x443b('0xc'),auth[_0x443b('0xd')](),controller[_0x443b('0xe')]);router['get'](_0x443b('0xf'),auth[_0x443b('0xd')](),controller[_0x443b('0x10')]);router[_0x443b('0x11')]('/',auth['isAuthenticated'](),controller[_0x443b('0x12')]);router[_0x443b('0x13')](_0x443b('0xf'),auth[_0x443b('0xd')](),controller['update']);router[_0x443b('0x14')]('/:id',auth[_0x443b('0xd')](),controller[_0x443b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index bd71f3c..042a6b9 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 _0xcc17=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer'];(function(_0x40ad16,_0x328d88){var _0x4f332d=function(_0x4cc83a){while(--_0x4cc83a){_0x40ad16['push'](_0x40ad16['shift']());}};_0x4f332d(++_0x328d88);}(_0xcc17,0x1e2));var _0x7cc1=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0xcc17[_0x4ded65];return _0x5864fb;};'use strict';var multer=require(_0x7cc1('0x0'));var util=require('util');var path=require(_0x7cc1('0x1'));var timeout=require(_0x7cc1('0x2'));var express=require('express');var router=express[_0x7cc1('0x3')]();var fs_extra=require(_0x7cc1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cc1('0x5'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x7cc1('0x6')](),controller[_0x7cc1('0x7')]);router[_0x7cc1('0x8')](_0x7cc1('0x9'),auth[_0x7cc1('0x6')](),controller[_0x7cc1('0xa')]);router[_0x7cc1('0x8')](_0x7cc1('0xb'),auth[_0x7cc1('0x6')](),controller['getConfigurations']);router[_0x7cc1('0x8')](_0x7cc1('0xc'),auth['isAuthenticated'](),controller[_0x7cc1('0xd')]);router[_0x7cc1('0xe')]('/',auth[_0x7cc1('0x6')](),controller[_0x7cc1('0xf')]);router[_0x7cc1('0xe')]('/:id/configurations',auth[_0x7cc1('0x6')](),controller[_0x7cc1('0x10')]);router[_0x7cc1('0x11')]('/:id',auth[_0x7cc1('0x6')](),controller['update']);router[_0x7cc1('0x12')](_0x7cc1('0x9'),auth['isAuthenticated'](),controller[_0x7cc1('0x13')]);module[_0x7cc1('0x14')]=router; \ No newline at end of file +var _0xa2df=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x3ed726,_0x3db9e2){var _0x25d2c9=function(_0x107a79){while(--_0x107a79){_0x3ed726['push'](_0x3ed726['shift']());}};_0x25d2c9(++_0x3db9e2);}(_0xa2df,0x97));var _0xfa2d=function(_0x46630b,_0x24c81f){_0x46630b=_0x46630b-0x0;var _0x1ece0c=_0xa2df[_0x46630b];return _0x1ece0c;};'use strict';var multer=require(_0xfa2d('0x0'));var util=require(_0xfa2d('0x1'));var path=require(_0xfa2d('0x2'));var timeout=require(_0xfa2d('0x3'));var express=require(_0xfa2d('0x4'));var router=express[_0xfa2d('0x5')]();var fs_extra=require(_0xfa2d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfa2d('0x7'));var config=require(_0xfa2d('0x8'));var controller=require('./intDeskAccount.controller');router[_0xfa2d('0x9')]('/',auth[_0xfa2d('0xa')](),controller['index']);router[_0xfa2d('0x9')](_0xfa2d('0xb'),auth[_0xfa2d('0xa')](),controller[_0xfa2d('0xc')]);router[_0xfa2d('0x9')](_0xfa2d('0xd'),auth[_0xfa2d('0xa')](),controller['getConfigurations']);router['get'](_0xfa2d('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xfa2d('0xa')](),controller[_0xfa2d('0xf')]);router[_0xfa2d('0x10')](_0xfa2d('0xd'),auth[_0xfa2d('0xa')](),controller[_0xfa2d('0x11')]);router[_0xfa2d('0x12')](_0xfa2d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfa2d('0x13')](_0xfa2d('0xb'),auth['isAuthenticated'](),controller[_0xfa2d('0x14')]);module[_0xfa2d('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 356255f..160ee4b 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 _0x0268=['integrationTab','newTab','sequelize','STRING','basic'];(function(_0x32da31,_0x453374){var _0x58cd41=function(_0x1710c2){while(--_0x1710c2){_0x32da31['push'](_0x32da31['shift']());}};_0x58cd41(++_0x453374);}(_0x0268,0xe3));var _0x8026=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x0268[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x8026('0x0'));module['exports']={'name':{'type':Sequelize[_0x8026('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8026('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x8026('0x2')),'defaultValue':_0x8026('0x2')},'password':{'type':Sequelize[_0x8026('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x8026('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x8026('0x1')]},'serverUrl':{'type':Sequelize[_0x8026('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8026('0x3'),_0x8026('0x4')),'defaultValue':_0x8026('0x3')}}; \ No newline at end of file +var _0xecd2=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x5f0338,_0x3c072c){var _0x4cbc71=function(_0x1beca1){while(--_0x1beca1){_0x5f0338['push'](_0x5f0338['shift']());}};_0x4cbc71(++_0x3c072c);}(_0xecd2,0x168));var _0x2ecd=function(_0x1c445e,_0x16dbd4){_0x1c445e=_0x1c445e-0x0;var _0x2564a0=_0xecd2[_0x1c445e];return _0x2564a0;};'use strict';var Sequelize=require(_0x2ecd('0x0'));module[_0x2ecd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ecd('0x2')]},'username':{'type':Sequelize[_0x2ecd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x2ecd('0x3')](_0x2ecd('0x4')),'defaultValue':_0x2ecd('0x4')},'password':{'type':Sequelize[_0x2ecd('0x2')]},'consumerKey':{'type':Sequelize[_0x2ecd('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2ecd('0x2')]},'tokenSecret':{'type':Sequelize[_0x2ecd('0x2')]},'serverUrl':{'type':Sequelize[_0x2ecd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2ecd('0x3')](_0x2ecd('0x5'),'newTab'),'defaultValue':_0x2ecd('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index a3c6d4a..26a99e9 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 _0xd281=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','update','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','getConfigurations','findOne','hasOwnProperty','nolimit','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','Subjects','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','tokenSecret','substring','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf'];(function(_0x7835a,_0x7ef740){var _0xd46e11=function(_0xe43fad){while(--_0xe43fad){_0x7835a['push'](_0x7835a['shift']());}};_0xd46e11(++_0x7ef740);}(_0xd281,0x1c7));var _0x1d28=function(_0x6363bf,_0x5dff0f){_0x6363bf=_0x6363bf-0x0;var _0x539294=_0xd281[_0x6363bf];return _0x539294;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d28('0x0'));var zipdir=require(_0x1d28('0x1'));var jsonpatch=require(_0x1d28('0x2'));var rp=require(_0x1d28('0x3'));var moment=require(_0x1d28('0x4'));var BPromise=require(_0x1d28('0x5'));var Mustache=require(_0x1d28('0x6'));var util=require(_0x1d28('0x7'));var path=require(_0x1d28('0x8'));var sox=require(_0x1d28('0x9'));var csv=require(_0x1d28('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d28('0xb'));var _=require(_0x1d28('0xc'));var squel=require(_0x1d28('0xd'));var crypto=require(_0x1d28('0xe'));var jsforce=require(_0x1d28('0xf'));var deskjs=require(_0x1d28('0x10'));var toCsv=require(_0x1d28('0xa'));var querystring=require(_0x1d28('0x11'));var Papa=require(_0x1d28('0x12'));var Redis=require('ioredis');var authService=require(_0x1d28('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d28('0x14'))(_0x1d28('0x15'));var utils=require('../../config/utils');var config=require(_0x1d28('0x16'));var licenseUtil=require(_0x1d28('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49ab8a,_0x15beb5){_0x15beb5=_0x15beb5||0xcc;return function(_0x19003e){if(_0x19003e){return _0x49ab8a[_0x1d28('0x18')](_0x15beb5);}return _0x49ab8a['status'](_0x15beb5)['end']();};}function respondWithResult(_0x41a685,_0x43982e){_0x43982e=_0x43982e||0xc8;return function(_0x26f1e6){if(_0x26f1e6){return _0x41a685[_0x1d28('0x19')](_0x43982e)[_0x1d28('0x1a')](_0x26f1e6);}};}function respondWithFilteredResult(_0x3ace67,_0x415cd9){return function(_0x24947e){if(_0x24947e){var _0x3dd6f1=typeof _0x415cd9[_0x1d28('0x1b')]==='undefined'&&typeof _0x415cd9[_0x1d28('0x1c')]===_0x1d28('0x1d');var _0x598281=_0x24947e[_0x1d28('0x1e')];var _0x333fc9=_0x3dd6f1?0x0:_0x415cd9['offset'];var _0x434d69=_0x3dd6f1?_0x24947e[_0x1d28('0x1e')]:_0x415cd9[_0x1d28('0x1b')]+_0x415cd9['limit'];var _0x30af9e;if(_0x434d69>=_0x598281){_0x434d69=_0x598281;_0x30af9e=0xc8;}else{_0x30af9e=0xce;}_0x3ace67['status'](_0x30af9e);return _0x3ace67[_0x1d28('0x1f')]('Content-Range',_0x333fc9+'-'+_0x434d69+'/'+_0x598281)['json'](_0x24947e);}return null;};}function patchUpdates(_0x47f883){return function(_0x363f83){try{jsonpatch[_0x1d28('0x20')](_0x363f83,_0x47f883,!![]);}catch(_0x40ca5f){return BPromise['reject'](_0x40ca5f);}return _0x363f83['save']();};}function saveUpdates(_0x294fbf,_0x53d4ad){return function(_0x4071fd){if(_0x4071fd){return _0x4071fd[_0x1d28('0x21')](_0x294fbf)[_0x1d28('0x22')](function(_0x1ee2e8){return _0x1ee2e8;});}return null;};}function removeEntity(_0x226563,_0x5023c7){return function(_0x507d6c){if(_0x507d6c){return _0x507d6c[_0x1d28('0x23')]()[_0x1d28('0x22')](function(){_0x226563[_0x1d28('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf9897d,_0x27347b){return function(_0xe723f){if(!_0xe723f){_0xf9897d[_0x1d28('0x18')](0x194);}return _0xe723f;};}function handleError(_0xa6392,_0x260a94){_0x260a94=_0x260a94||0x1f4;return function(_0xcb4032){logger[_0x1d28('0x24')](_0xcb4032[_0x1d28('0x25')]);if(_0xcb4032['name']){delete _0xcb4032[_0x1d28('0x26')];}_0xa6392['status'](_0x260a94)['send'](_0xcb4032);};}exports[_0x1d28('0x27')]=function(_0x552da3,_0x468358){var _0x30d9da={},_0x19de9d={},_0x3cbb04={'count':0x0,'rows':[]};var _0xa72c5d=_[_0x1d28('0x28')](db[_0x1d28('0x29')][_0x1d28('0x2a')],function(_0x5e7f8b){return{'name':_0x5e7f8b[_0x1d28('0x2b')],'type':_0x5e7f8b[_0x1d28('0x2c')][_0x1d28('0x2d')]};});_0x19de9d[_0x1d28('0x2e')]=_['map'](_0xa72c5d,'name');_0x19de9d[_0x1d28('0x2f')]=_[_0x1d28('0x30')](_0x552da3[_0x1d28('0x2f')]);_0x19de9d['filters']=_[_0x1d28('0x31')](_0x19de9d[_0x1d28('0x2e')],_0x19de9d[_0x1d28('0x2f')]);_0x30d9da['attributes']=_['intersection'](_0x19de9d[_0x1d28('0x2e')],qs[_0x1d28('0x32')](_0x552da3[_0x1d28('0x2f')][_0x1d28('0x32')]));_0x30d9da['attributes']=_0x30d9da[_0x1d28('0x33')][_0x1d28('0x34')]?_0x30d9da[_0x1d28('0x33')]:_0x19de9d[_0x1d28('0x2e')];if(!_0x552da3['query']['hasOwnProperty']('nolimit')){_0x30d9da[_0x1d28('0x1c')]=qs[_0x1d28('0x1c')](_0x552da3['query']['limit']);_0x30d9da[_0x1d28('0x1b')]=qs[_0x1d28('0x1b')](_0x552da3['query'][_0x1d28('0x1b')]);}_0x30d9da[_0x1d28('0x35')]=qs[_0x1d28('0x36')](_0x552da3[_0x1d28('0x2f')]['sort']);_0x30d9da[_0x1d28('0x37')]=qs['filters'](_[_0x1d28('0x38')](_0x552da3[_0x1d28('0x2f')],_0x19de9d[_0x1d28('0x39')]),_0xa72c5d);if(_0x552da3['query'][_0x1d28('0x3a')]){_0x30d9da[_0x1d28('0x37')]=_[_0x1d28('0x3b')](_0x30d9da[_0x1d28('0x37')],{'$or':_[_0x1d28('0x28')](_0xa72c5d,function(_0x2cf8f9){if(_0x2cf8f9[_0x1d28('0x2c')]!==_0x1d28('0x3c')){var _0xe28c8c={};_0xe28c8c[_0x2cf8f9[_0x1d28('0x26')]]={'$like':'%'+_0x552da3[_0x1d28('0x2f')][_0x1d28('0x3a')]+'%'};return _0xe28c8c;}})});}_0x30d9da=_[_0x1d28('0x3b')]({},_0x30d9da,_0x552da3['options']);var _0x2aeba4={'where':_0x30d9da['where']};return db[_0x1d28('0x29')][_0x1d28('0x1e')](_0x2aeba4)[_0x1d28('0x22')](function(_0x4289c6){_0x3cbb04['count']=_0x4289c6;if(_0x552da3[_0x1d28('0x2f')][_0x1d28('0x3d')]){_0x30d9da[_0x1d28('0x3e')]=[{'all':!![]}];}return db[_0x1d28('0x29')][_0x1d28('0x3f')](_0x30d9da);})['then'](function(_0x30636d){_0x3cbb04[_0x1d28('0x40')]=_0x30636d;return _0x3cbb04;})['then'](respondWithFilteredResult(_0x468358,_0x30d9da))['catch'](handleError(_0x468358,null));};exports[_0x1d28('0x41')]=function(_0x1d5848,_0x2e5465){var _0x19d754={'raw':![],'where':{'id':_0x1d5848[_0x1d28('0x42')]['id']}},_0x1183ce={};_0x1183ce[_0x1d28('0x2e')]=_[_0x1d28('0x30')](db[_0x1d28('0x29')]['rawAttributes']);_0x1183ce[_0x1d28('0x2f')]=_[_0x1d28('0x30')](_0x1d5848[_0x1d28('0x2f')]);_0x1183ce[_0x1d28('0x39')]=_[_0x1d28('0x31')](_0x1183ce[_0x1d28('0x2e')],_0x1183ce[_0x1d28('0x2f')]);_0x19d754[_0x1d28('0x33')]=_[_0x1d28('0x31')](_0x1183ce[_0x1d28('0x2e')],qs[_0x1d28('0x32')](_0x1d5848['query'][_0x1d28('0x32')]));_0x19d754[_0x1d28('0x33')]=_0x19d754['attributes'][_0x1d28('0x34')]?_0x19d754[_0x1d28('0x33')]:_0x1183ce[_0x1d28('0x2e')];if(_0x1d5848[_0x1d28('0x2f')][_0x1d28('0x3d')]){_0x19d754[_0x1d28('0x3e')]=[{'all':!![]}];}_0x19d754=_[_0x1d28('0x3b')]({},_0x19d754,_0x1d5848[_0x1d28('0x43')]);return db['DeskAccount']['find'](_0x19d754)[_0x1d28('0x22')](handleEntityNotFound(_0x2e5465,null))[_0x1d28('0x22')](respondWithResult(_0x2e5465,null))[_0x1d28('0x44')](handleError(_0x2e5465,null));};exports['create']=function(_0x32012c,_0xd9516d){return db[_0x1d28('0x29')][_0x1d28('0x45')](_0x32012c[_0x1d28('0x46')],{})['then'](respondWithResult(_0xd9516d,0xc9))[_0x1d28('0x44')](handleError(_0xd9516d,null));};exports[_0x1d28('0x21')]=function(_0x21a8aa,_0x3ecb22){if(_0x21a8aa[_0x1d28('0x46')]['id']){delete _0x21a8aa['body']['id'];}return db[_0x1d28('0x29')]['find']({'where':{'id':_0x21a8aa[_0x1d28('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ecb22,null))['then'](saveUpdates(_0x21a8aa[_0x1d28('0x46')],null))[_0x1d28('0x22')](respondWithResult(_0x3ecb22,null))[_0x1d28('0x44')](handleError(_0x3ecb22,null));};exports[_0x1d28('0x23')]=function(_0xde197e,_0x3568e6){return db[_0x1d28('0x29')][_0x1d28('0x47')]({'where':{'id':_0xde197e['params']['id']}})[_0x1d28('0x22')](handleEntityNotFound(_0x3568e6,null))[_0x1d28('0x22')](removeEntity(_0x3568e6,null))[_0x1d28('0x44')](handleError(_0x3568e6,null));};exports[_0x1d28('0x48')]=function(_0x3062ab,_0x417eb5,_0x1f5a8b){var _0x3b3f30={};var _0x44622c={};var _0x154d53;var _0x420b51;return db['DeskAccount'][_0x1d28('0x49')]({'where':{'id':_0x3062ab[_0x1d28('0x42')]['id']}})[_0x1d28('0x22')](handleEntityNotFound(_0x417eb5,null))[_0x1d28('0x22')](function(_0x42aa95){if(_0x42aa95){_0x154d53=_0x42aa95;_0x44622c['model']=_['keys'](db['DeskConfiguration'][_0x1d28('0x2a')]);_0x44622c[_0x1d28('0x2f')]=_[_0x1d28('0x30')](_0x3062ab[_0x1d28('0x2f')]);_0x44622c['filters']=_[_0x1d28('0x31')](_0x44622c[_0x1d28('0x2e')],_0x44622c[_0x1d28('0x2f')]);_0x3b3f30[_0x1d28('0x33')]=_[_0x1d28('0x31')](_0x44622c[_0x1d28('0x2e')],qs['fields'](_0x3062ab[_0x1d28('0x2f')][_0x1d28('0x32')]));_0x3b3f30[_0x1d28('0x33')]=_0x3b3f30[_0x1d28('0x33')][_0x1d28('0x34')]?_0x3b3f30['attributes']:_0x44622c['model'];_0x3b3f30[_0x1d28('0x35')]=qs[_0x1d28('0x36')](_0x3062ab[_0x1d28('0x2f')][_0x1d28('0x36')]);_0x3b3f30[_0x1d28('0x37')]=qs[_0x1d28('0x39')](_[_0x1d28('0x38')](_0x3062ab[_0x1d28('0x2f')],_0x44622c[_0x1d28('0x39')]));if(_0x3062ab[_0x1d28('0x2f')][_0x1d28('0x3a')]){_0x3b3f30[_0x1d28('0x37')]=_[_0x1d28('0x3b')](_0x3b3f30[_0x1d28('0x37')],{'$or':_[_0x1d28('0x28')](_0x3b3f30['attributes'],function(_0x4bb66d){var _0x158e75={};_0x158e75[_0x4bb66d]={'$like':'%'+_0x3062ab[_0x1d28('0x2f')]['filter']+'%'};return _0x158e75;})});}_0x3b3f30=_[_0x1d28('0x3b')]({},_0x3b3f30,_0x3062ab['options']);return _0x154d53[_0x1d28('0x48')](_0x3b3f30);}})[_0x1d28('0x22')](function(_0x56c8b4){if(_0x56c8b4){_0x420b51=_0x56c8b4['length'];if(!_0x3062ab['query'][_0x1d28('0x4a')](_0x1d28('0x4b'))){_0x3b3f30[_0x1d28('0x1c')]=qs['limit'](_0x3062ab[_0x1d28('0x2f')][_0x1d28('0x1c')]);_0x3b3f30[_0x1d28('0x1b')]=qs['offset'](_0x3062ab['query'][_0x1d28('0x1b')]);}return _0x154d53[_0x1d28('0x48')](_0x3b3f30);}})['then'](function(_0x521500){if(_0x521500){return _0x521500?{'count':_0x420b51,'rows':_0x521500}:null;}})[_0x1d28('0x22')](respondWithResult(_0x417eb5,null))[_0x1d28('0x44')](handleError(_0x417eb5,null));};exports['addConfiguration']=function(_0x36274a,_0x1a6c59,_0x30542c){if(_0x36274a[_0x1d28('0x46')]['id']){delete _0x36274a['body']['id'];}return db[_0x1d28('0x29')]['findOne']({'where':{'id':_0x36274a[_0x1d28('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a6c59,null))['then'](function(_0x1e657a){if(_0x1e657a){_0x36274a['body'][_0x1d28('0x4c')]=_0x1e657a['id'];_0x36274a[_0x1d28('0x46')]['Subjects']=integrations[_0x1d28('0x4d')](_0x36274a[_0x1d28('0x46')][_0x1d28('0x4e')],_0x36274a[_0x1d28('0x46')][_0x1d28('0x2c')]);_0x36274a[_0x1d28('0x46')][_0x1d28('0x4f')]=integrations[_0x1d28('0x50')](_0x36274a[_0x1d28('0x46')][_0x1d28('0x4e')],_0x36274a[_0x1d28('0x46')][_0x1d28('0x2c')]);return db[_0x1d28('0x51')]['create'](_0x36274a[_0x1d28('0x46')],{'include':[{'model':db['DeskField'],'as':_0x1d28('0x52')},{'model':db[_0x1d28('0x53')],'as':_0x1d28('0x4f')}]});}return null;})['then'](respondWithResult(_0x1a6c59,null))[_0x1d28('0x44')](handleError(_0x1a6c59,null));};exports[_0x1d28('0x54')]=function(_0x55396a,_0x4bb2c5,_0x47f914){var _0x5c523c=[{'name':_0x1d28('0x55'),'label':_0x1d28('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x474d63='';return db['DeskAccount'][_0x1d28('0x49')]({'where':{'id':_0x55396a['params']['id']},'attributes':['id',_0x1d28('0x56'),_0x1d28('0x57'),_0x1d28('0x58'),_0x1d28('0x59'),'consumerKey',_0x1d28('0x5a'),'token',_0x1d28('0x5b')]})[_0x1d28('0x22')](handleEntityNotFound(_0x4bb2c5,null))[_0x1d28('0x22')](function(_0xf4c3e2){if(_0xf4c3e2){_0x474d63=_0xf4c3e2[_0x1d28('0x56')];var _0x2890e7=_0x474d63['slice'](-0x1);if(_0x2890e7==='/'){_0x474d63=_0x474d63[_0x1d28('0x5c')](0x0,_0x474d63['lastIndexOf'](_0x2890e7));}var _0x381c73={'method':'GET','uri':util['format'](_0x1d28('0x5d'),_0x474d63),'headers':{'Content-Type':_0x1d28('0x5e'),'Accept':_0x1d28('0x5e')},'json':!![]};if(_0xf4c3e2[_0x1d28('0x57')]===_0x1d28('0x5f')){_0x381c73[_0x1d28('0x60')][_0x1d28('0x61')]=util[_0x1d28('0x62')](_0x1d28('0x63'),new Buffer(util[_0x1d28('0x62')](_0x1d28('0x64'),_0xf4c3e2[_0x1d28('0x58')],_0xf4c3e2['password']))[_0x1d28('0x65')](_0x1d28('0x66')));}return rp(_0x381c73)[_0x1d28('0x22')](function(_0xf8a38f){return _0x5c523c[_0x1d28('0x67')](_[_0x1d28('0x28')](_0xf8a38f[_0x1d28('0x68')][_0x1d28('0x69')],function(_0x527754){return{'id':_0x527754['name'],'name':_0x527754['name'],'type':_0x527754['type'],'active':_0x527754[_0x1d28('0x6a')],'label':_0x527754[_0x1d28('0x6b')],'custom':!![]};}));});}})[_0x1d28('0x22')](function(_0x52e385){return{'count':_0x52e385[_0x1d28('0x34')],'rows':_0x52e385};})[_0x1d28('0x22')](respondWithResult(_0x4bb2c5,null))[_0x1d28('0x44')](function(_0x6dc40e){var _0x45d751=_0x55396a[_0x1d28('0x2f')][_0x1d28('0x6c')]?0x1f4:_0x6dc40e[_0x1d28('0x6d')]||0x1f4;logger[_0x1d28('0x24')](_0x1d28('0x6e'),_0x1d28('0x54'),_0x45d751,JSON[_0x1d28('0x6f')](_0x6dc40e));delete _0x6dc40e[_0x1d28('0x26')];if(_0x45d751===0x191){_0x45d751=0x190;}_0x4bb2c5[_0x1d28('0x19')](_0x45d751)[_0x1d28('0x70')](_0x55396a[_0x1d28('0x2f')][_0x1d28('0x6c')]?{'message':_0x1d28('0x71'),'statusCode':_0x6dc40e[_0x1d28('0x6d')]}:_0x6dc40e);});}; \ No newline at end of file +var _0xd1a7=['mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','length','find','create','body','params','getConfigurations','DeskConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Descriptions','getDescriptions','channel','DeskField','Subjects','getFields','priority','remoteUri','authType','username','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','Authorization','Basic\x20%s','toString','base64','concat','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd1a7,0x149));var _0x7d1a=function(_0x3a7965,_0x5f1fa7){_0x3a7965=_0x3a7965-0x0;var _0x232aa8=_0xd1a7[_0x3a7965];return _0x232aa8;};'use strict';var emlformat=require(_0x7d1a('0x0'));var rimraf=require(_0x7d1a('0x1'));var zipdir=require(_0x7d1a('0x2'));var jsonpatch=require(_0x7d1a('0x3'));var rp=require(_0x7d1a('0x4'));var moment=require(_0x7d1a('0x5'));var BPromise=require(_0x7d1a('0x6'));var Mustache=require(_0x7d1a('0x7'));var util=require('util');var path=require(_0x7d1a('0x8'));var sox=require(_0x7d1a('0x9'));var csv=require(_0x7d1a('0xa'));var ejs=require(_0x7d1a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d1a('0xc'));var squel=require(_0x7d1a('0xd'));var crypto=require(_0x7d1a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7d1a('0xf'));var toCsv=require(_0x7d1a('0xa'));var querystring=require('querystring');var Papa=require(_0x7d1a('0x10'));var Redis=require(_0x7d1a('0x11'));var authService=require(_0x7d1a('0x12'));var qs=require(_0x7d1a('0x13'));var as=require(_0x7d1a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d1a('0x15'))(_0x7d1a('0x16'));var utils=require(_0x7d1a('0x17'));var config=require(_0x7d1a('0x18'));var licenseUtil=require(_0x7d1a('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56b796,_0x56f205){_0x56f205=_0x56f205||0xcc;return function(_0x280b08){if(_0x280b08){return _0x56b796['sendStatus'](_0x56f205);}return _0x56b796[_0x7d1a('0x1a')](_0x56f205)[_0x7d1a('0x1b')]();};}function respondWithResult(_0x59cb22,_0x1cea68){_0x1cea68=_0x1cea68||0xc8;return function(_0x1cbb01){if(_0x1cbb01){return _0x59cb22[_0x7d1a('0x1a')](_0x1cea68)[_0x7d1a('0x1c')](_0x1cbb01);}};}function respondWithFilteredResult(_0x162df0,_0x225f87){return function(_0x53fd40){if(_0x53fd40){var _0x687cc9=typeof _0x225f87['offset']==='undefined'&&typeof _0x225f87[_0x7d1a('0x1d')]===_0x7d1a('0x1e');var _0x41af00=_0x53fd40[_0x7d1a('0x1f')];var _0x4a88a9=_0x687cc9?0x0:_0x225f87['offset'];var _0x2b152e=_0x687cc9?_0x53fd40[_0x7d1a('0x1f')]:_0x225f87[_0x7d1a('0x20')]+_0x225f87[_0x7d1a('0x1d')];var _0x58cbc8;if(_0x2b152e>=_0x41af00){_0x2b152e=_0x41af00;_0x58cbc8=0xc8;}else{_0x58cbc8=0xce;}_0x162df0[_0x7d1a('0x1a')](_0x58cbc8);return _0x162df0['set'](_0x7d1a('0x21'),_0x4a88a9+'-'+_0x2b152e+'/'+_0x41af00)[_0x7d1a('0x1c')](_0x53fd40);}return null;};}function patchUpdates(_0xec949d){return function(_0x51ad40){try{jsonpatch['apply'](_0x51ad40,_0xec949d,!![]);}catch(_0x239253){return BPromise[_0x7d1a('0x22')](_0x239253);}return _0x51ad40[_0x7d1a('0x23')]();};}function saveUpdates(_0x1d8a11,_0xae0403){return function(_0x68ee0){if(_0x68ee0){return _0x68ee0[_0x7d1a('0x24')](_0x1d8a11)[_0x7d1a('0x25')](function(_0x4b2c39){return _0x4b2c39;});}return null;};}function removeEntity(_0x31b84b,_0x417ab5){return function(_0x1394fb){if(_0x1394fb){return _0x1394fb[_0x7d1a('0x26')]()[_0x7d1a('0x25')](function(){_0x31b84b[_0x7d1a('0x1a')](0xcc)[_0x7d1a('0x1b')]();});}};}function handleEntityNotFound(_0x58efb0,_0x53ccf0){return function(_0xc1181d){if(!_0xc1181d){_0x58efb0[_0x7d1a('0x27')](0x194);}return _0xc1181d;};}function handleError(_0x7b7fca,_0x456644){_0x456644=_0x456644||0x1f4;return function(_0xc30085){logger[_0x7d1a('0x28')](_0xc30085[_0x7d1a('0x29')]);if(_0xc30085[_0x7d1a('0x2a')]){delete _0xc30085[_0x7d1a('0x2a')];}_0x7b7fca[_0x7d1a('0x1a')](_0x456644)[_0x7d1a('0x2b')](_0xc30085);};}exports[_0x7d1a('0x2c')]=function(_0x2e926f,_0x5b1cad){var _0x569674={},_0x33d12d={},_0xc29754={'count':0x0,'rows':[]};var _0x36ff23=_[_0x7d1a('0x2d')](db[_0x7d1a('0x2e')][_0x7d1a('0x2f')],function(_0x1bf391){return{'name':_0x1bf391['fieldName'],'type':_0x1bf391[_0x7d1a('0x30')][_0x7d1a('0x31')]};});_0x33d12d[_0x7d1a('0x32')]=_[_0x7d1a('0x2d')](_0x36ff23,_0x7d1a('0x2a'));_0x33d12d[_0x7d1a('0x33')]=_[_0x7d1a('0x34')](_0x2e926f['query']);_0x33d12d[_0x7d1a('0x35')]=_[_0x7d1a('0x36')](_0x33d12d[_0x7d1a('0x32')],_0x33d12d[_0x7d1a('0x33')]);_0x569674[_0x7d1a('0x37')]=_[_0x7d1a('0x36')](_0x33d12d[_0x7d1a('0x32')],qs[_0x7d1a('0x38')](_0x2e926f[_0x7d1a('0x33')]['fields']));_0x569674[_0x7d1a('0x37')]=_0x569674[_0x7d1a('0x37')]['length']?_0x569674[_0x7d1a('0x37')]:_0x33d12d[_0x7d1a('0x32')];if(!_0x2e926f[_0x7d1a('0x33')]['hasOwnProperty'](_0x7d1a('0x39'))){_0x569674[_0x7d1a('0x1d')]=qs[_0x7d1a('0x1d')](_0x2e926f[_0x7d1a('0x33')][_0x7d1a('0x1d')]);_0x569674[_0x7d1a('0x20')]=qs[_0x7d1a('0x20')](_0x2e926f['query']['offset']);}_0x569674['order']=qs[_0x7d1a('0x3a')](_0x2e926f[_0x7d1a('0x33')][_0x7d1a('0x3a')]);_0x569674['where']=qs['filters'](_[_0x7d1a('0x3b')](_0x2e926f[_0x7d1a('0x33')],_0x33d12d[_0x7d1a('0x35')]),_0x36ff23);if(_0x2e926f[_0x7d1a('0x33')][_0x7d1a('0x3c')]){_0x569674[_0x7d1a('0x3d')]=_[_0x7d1a('0x3e')](_0x569674['where'],{'$or':_[_0x7d1a('0x2d')](_0x36ff23,function(_0x54d00c){if(_0x54d00c[_0x7d1a('0x30')]!=='VIRTUAL'){var _0x29e204={};_0x29e204[_0x54d00c[_0x7d1a('0x2a')]]={'$like':'%'+_0x2e926f['query'][_0x7d1a('0x3c')]+'%'};return _0x29e204;}})});}_0x569674=_[_0x7d1a('0x3e')]({},_0x569674,_0x2e926f[_0x7d1a('0x3f')]);var _0x25bacf={'where':_0x569674[_0x7d1a('0x3d')]};return db[_0x7d1a('0x2e')][_0x7d1a('0x1f')](_0x25bacf)['then'](function(_0x4ce18f){_0xc29754['count']=_0x4ce18f;if(_0x2e926f[_0x7d1a('0x33')][_0x7d1a('0x40')]){_0x569674[_0x7d1a('0x41')]=[{'all':!![]}];}return db[_0x7d1a('0x2e')]['findAll'](_0x569674);})[_0x7d1a('0x25')](function(_0x1514d8){_0xc29754[_0x7d1a('0x42')]=_0x1514d8;return _0xc29754;})[_0x7d1a('0x25')](respondWithFilteredResult(_0x5b1cad,_0x569674))[_0x7d1a('0x43')](handleError(_0x5b1cad,null));};exports[_0x7d1a('0x44')]=function(_0x4ce7f4,_0x48d0f9){var _0x47982a={'raw':![],'where':{'id':_0x4ce7f4['params']['id']}},_0x50fd4c={};_0x50fd4c[_0x7d1a('0x32')]=_[_0x7d1a('0x34')](db[_0x7d1a('0x2e')][_0x7d1a('0x2f')]);_0x50fd4c['query']=_['keys'](_0x4ce7f4[_0x7d1a('0x33')]);_0x50fd4c[_0x7d1a('0x35')]=_['intersection'](_0x50fd4c[_0x7d1a('0x32')],_0x50fd4c[_0x7d1a('0x33')]);_0x47982a[_0x7d1a('0x37')]=_[_0x7d1a('0x36')](_0x50fd4c[_0x7d1a('0x32')],qs['fields'](_0x4ce7f4['query']['fields']));_0x47982a[_0x7d1a('0x37')]=_0x47982a['attributes'][_0x7d1a('0x45')]?_0x47982a['attributes']:_0x50fd4c[_0x7d1a('0x32')];if(_0x4ce7f4[_0x7d1a('0x33')][_0x7d1a('0x40')]){_0x47982a['include']=[{'all':!![]}];}_0x47982a=_[_0x7d1a('0x3e')]({},_0x47982a,_0x4ce7f4[_0x7d1a('0x3f')]);return db[_0x7d1a('0x2e')][_0x7d1a('0x46')](_0x47982a)[_0x7d1a('0x25')](handleEntityNotFound(_0x48d0f9,null))[_0x7d1a('0x25')](respondWithResult(_0x48d0f9,null))[_0x7d1a('0x43')](handleError(_0x48d0f9,null));};exports[_0x7d1a('0x47')]=function(_0x865b4a,_0x21d47d){return db[_0x7d1a('0x2e')]['create'](_0x865b4a[_0x7d1a('0x48')],{})['then'](respondWithResult(_0x21d47d,0xc9))[_0x7d1a('0x43')](handleError(_0x21d47d,null));};exports[_0x7d1a('0x24')]=function(_0x1b93a1,_0x265947){if(_0x1b93a1['body']['id']){delete _0x1b93a1['body']['id'];}return db[_0x7d1a('0x2e')][_0x7d1a('0x46')]({'where':{'id':_0x1b93a1[_0x7d1a('0x49')]['id']}})[_0x7d1a('0x25')](handleEntityNotFound(_0x265947,null))[_0x7d1a('0x25')](saveUpdates(_0x1b93a1[_0x7d1a('0x48')],null))[_0x7d1a('0x25')](respondWithResult(_0x265947,null))[_0x7d1a('0x43')](handleError(_0x265947,null));};exports[_0x7d1a('0x26')]=function(_0x3af5b9,_0x1012f1){return db[_0x7d1a('0x2e')][_0x7d1a('0x46')]({'where':{'id':_0x3af5b9['params']['id']}})[_0x7d1a('0x25')](handleEntityNotFound(_0x1012f1,null))[_0x7d1a('0x25')](removeEntity(_0x1012f1,null))[_0x7d1a('0x43')](handleError(_0x1012f1,null));};exports[_0x7d1a('0x4a')]=function(_0x509a21,_0x122d58,_0x3270ca){var _0x3c0d36={};var _0x3ec838={};var _0xa8f062;var _0x3a3874;return db[_0x7d1a('0x2e')]['findOne']({'where':{'id':_0x509a21[_0x7d1a('0x49')]['id']}})[_0x7d1a('0x25')](handleEntityNotFound(_0x122d58,null))[_0x7d1a('0x25')](function(_0x95c531){if(_0x95c531){_0xa8f062=_0x95c531;_0x3ec838['model']=_['keys'](db[_0x7d1a('0x4b')][_0x7d1a('0x2f')]);_0x3ec838[_0x7d1a('0x33')]=_['keys'](_0x509a21[_0x7d1a('0x33')]);_0x3ec838['filters']=_[_0x7d1a('0x36')](_0x3ec838[_0x7d1a('0x32')],_0x3ec838[_0x7d1a('0x33')]);_0x3c0d36[_0x7d1a('0x37')]=_['intersection'](_0x3ec838['model'],qs['fields'](_0x509a21['query'][_0x7d1a('0x38')]));_0x3c0d36[_0x7d1a('0x37')]=_0x3c0d36[_0x7d1a('0x37')]['length']?_0x3c0d36[_0x7d1a('0x37')]:_0x3ec838['model'];_0x3c0d36[_0x7d1a('0x4c')]=qs['sort'](_0x509a21[_0x7d1a('0x33')][_0x7d1a('0x3a')]);_0x3c0d36['where']=qs[_0x7d1a('0x35')](_[_0x7d1a('0x3b')](_0x509a21[_0x7d1a('0x33')],_0x3ec838[_0x7d1a('0x35')]));if(_0x509a21['query'][_0x7d1a('0x3c')]){_0x3c0d36[_0x7d1a('0x3d')]=_['merge'](_0x3c0d36[_0x7d1a('0x3d')],{'$or':_[_0x7d1a('0x2d')](_0x3c0d36[_0x7d1a('0x37')],function(_0x38f7a6){var _0x43c1c2={};_0x43c1c2[_0x38f7a6]={'$like':'%'+_0x509a21['query'][_0x7d1a('0x3c')]+'%'};return _0x43c1c2;})});}_0x3c0d36=_[_0x7d1a('0x3e')]({},_0x3c0d36,_0x509a21[_0x7d1a('0x3f')]);return _0xa8f062[_0x7d1a('0x4a')](_0x3c0d36);}})[_0x7d1a('0x25')](function(_0x44fe38){if(_0x44fe38){_0x3a3874=_0x44fe38[_0x7d1a('0x45')];if(!_0x509a21[_0x7d1a('0x33')][_0x7d1a('0x4d')](_0x7d1a('0x39'))){_0x3c0d36[_0x7d1a('0x1d')]=qs[_0x7d1a('0x1d')](_0x509a21[_0x7d1a('0x33')][_0x7d1a('0x1d')]);_0x3c0d36[_0x7d1a('0x20')]=qs[_0x7d1a('0x20')](_0x509a21['query'][_0x7d1a('0x20')]);}return _0xa8f062[_0x7d1a('0x4a')](_0x3c0d36);}})[_0x7d1a('0x25')](function(_0x24983d){if(_0x24983d){return _0x24983d?{'count':_0x3a3874,'rows':_0x24983d}:null;}})[_0x7d1a('0x25')](respondWithResult(_0x122d58,null))[_0x7d1a('0x43')](handleError(_0x122d58,null));};exports[_0x7d1a('0x4e')]=function(_0x139047,_0x5e08cb,_0x36033d){if(_0x139047[_0x7d1a('0x48')]['id']){delete _0x139047[_0x7d1a('0x48')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x139047['params']['id']}})[_0x7d1a('0x25')](handleEntityNotFound(_0x5e08cb,null))['then'](function(_0x13597c){if(_0x13597c){_0x139047[_0x7d1a('0x48')][_0x7d1a('0x4f')]=_0x13597c['id'];_0x139047[_0x7d1a('0x48')]['Subjects']=integrations['getSubjects'](_0x139047['body']['channel'],_0x139047[_0x7d1a('0x48')][_0x7d1a('0x30')]);_0x139047[_0x7d1a('0x48')][_0x7d1a('0x50')]=integrations[_0x7d1a('0x51')](_0x139047[_0x7d1a('0x48')][_0x7d1a('0x52')],_0x139047[_0x7d1a('0x48')][_0x7d1a('0x30')]);return db[_0x7d1a('0x4b')]['create'](_0x139047['body'],{'include':[{'model':db[_0x7d1a('0x53')],'as':_0x7d1a('0x54')},{'model':db[_0x7d1a('0x53')],'as':_0x7d1a('0x50')}]});}return null;})['then'](respondWithResult(_0x5e08cb,null))[_0x7d1a('0x43')](handleError(_0x5e08cb,null));};exports[_0x7d1a('0x55')]=function(_0x519bf9,_0x258627,_0x40f9ff){var _0x24553d=[{'name':'priority','label':_0x7d1a('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2aca87='';return db[_0x7d1a('0x2e')]['findOne']({'where':{'id':_0x519bf9[_0x7d1a('0x49')]['id']},'attributes':['id',_0x7d1a('0x57'),_0x7d1a('0x58'),_0x7d1a('0x59'),'password','consumerKey',_0x7d1a('0x5a'),_0x7d1a('0x5b'),_0x7d1a('0x5c')]})[_0x7d1a('0x25')](handleEntityNotFound(_0x258627,null))[_0x7d1a('0x25')](function(_0x2ae203){if(_0x2ae203){_0x2aca87=_0x2ae203['remoteUri'];var _0x393de1=_0x2aca87[_0x7d1a('0x5d')](-0x1);if(_0x393de1==='/'){_0x2aca87=_0x2aca87[_0x7d1a('0x5e')](0x0,_0x2aca87[_0x7d1a('0x5f')](_0x393de1));}var _0x59c3b4={'method':_0x7d1a('0x60'),'uri':util[_0x7d1a('0x61')](_0x7d1a('0x62'),_0x2aca87),'headers':{'Content-Type':_0x7d1a('0x63'),'Accept':_0x7d1a('0x63')},'json':!![]};if(_0x2ae203[_0x7d1a('0x58')]==='basic'){_0x59c3b4['headers'][_0x7d1a('0x64')]=util['format'](_0x7d1a('0x65'),new Buffer(util[_0x7d1a('0x61')]('%s:%s',_0x2ae203['username'],_0x2ae203['password']))[_0x7d1a('0x66')](_0x7d1a('0x67')));}return rp(_0x59c3b4)[_0x7d1a('0x25')](function(_0x222d8c){return _0x24553d[_0x7d1a('0x68')](_[_0x7d1a('0x2d')](_0x222d8c['_embedded']['entries'],function(_0x18c4cb){return{'id':_0x18c4cb[_0x7d1a('0x2a')],'name':_0x18c4cb['name'],'type':_0x18c4cb[_0x7d1a('0x30')],'active':_0x18c4cb[_0x7d1a('0x69')],'label':_0x18c4cb[_0x7d1a('0x6a')],'custom':!![]};}));});}})[_0x7d1a('0x25')](function(_0x25b8ac){return{'count':_0x25b8ac[_0x7d1a('0x45')],'rows':_0x25b8ac};})[_0x7d1a('0x25')](respondWithResult(_0x258627,null))[_0x7d1a('0x43')](function(_0x35bca6){var _0x51a524=_0x519bf9['query'][_0x7d1a('0x6b')]?0x1f4:_0x35bca6[_0x7d1a('0x6c')]||0x1f4;logger[_0x7d1a('0x28')](_0x7d1a('0x6d'),_0x7d1a('0x55'),_0x51a524,JSON[_0x7d1a('0x6e')](_0x35bca6));delete _0x35bca6[_0x7d1a('0x2a')];if(_0x51a524===0x191){_0x51a524=0x190;}_0x258627[_0x7d1a('0x1a')](_0x51a524)[_0x7d1a('0x2b')](_0x519bf9[_0x7d1a('0x33')][_0x7d1a('0x6b')]?{'message':_0x7d1a('0x6f'),'statusCode':_0x35bca6['statusCode']}:_0x35bca6);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 46ac198..22e2873 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 _0xba7a=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3736f5,_0x158148){var _0x5df162=function(_0x1ee11d){while(--_0x1ee11d){_0x3736f5['push'](_0x3736f5['shift']());}};_0x5df162(++_0x158148);}(_0xba7a,0xae));var _0xaba7=function(_0x12d588,_0x299c34){_0x12d588=_0x12d588-0x0;var _0x21543d=_0xba7a[_0x12d588];return _0x21543d;};'use strict';var _=require('lodash');var util=require(_0xaba7('0x0'));var logger=require(_0xaba7('0x1'))(_0xaba7('0x2'));var moment=require(_0xaba7('0x3'));var BPromise=require(_0xaba7('0x4'));var rp=require(_0xaba7('0x5'));var fs=require('fs');var path=require(_0xaba7('0x6'));var rimraf=require(_0xaba7('0x7'));var config=require(_0xaba7('0x8'));var attributes=require(_0xaba7('0x9'));var integrations=require(_0xaba7('0xa'));module[_0xaba7('0xb')]=function(_0x5da8cc,_0x2e2175){return _0x5da8cc[_0xaba7('0xc')]('DeskAccount',attributes,{'tableName':_0xaba7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc4a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','lodash'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xbc4a,0x1ac));var _0xabc4=function(_0x597cc0,_0x13cb73){_0x597cc0=_0x597cc0-0x0;var _0xd18345=_0xbc4a[_0x597cc0];return _0xd18345;};'use strict';var _=require(_0xabc4('0x0'));var util=require(_0xabc4('0x1'));var logger=require(_0xabc4('0x2'))(_0xabc4('0x3'));var moment=require(_0xabc4('0x4'));var BPromise=require(_0xabc4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabc4('0x6'));var rimraf=require(_0xabc4('0x7'));var config=require(_0xabc4('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xabc4('0x9'));module[_0xabc4('0xa')]=function(_0x3b636d,_0x6ea136){return _0x3b636d[_0xabc4('0xb')](_0xabc4('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 8cc3699..12a57e0 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 _0x79bb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','map','include','model','catch','ShowDeskAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x79bb,0xfc));var _0xb79b=function(_0x352d0b,_0xb7ac28){_0x352d0b=_0x352d0b-0x0;var _0x2fa466=_0x79bb[_0x352d0b];return _0x2fa466;};'use strict';var _=require(_0xb79b('0x0'));var util=require(_0xb79b('0x1'));var moment=require(_0xb79b('0x2'));var BPromise=require(_0xb79b('0x3'));var rs=require(_0xb79b('0x4'));var fs=require('fs');var Redis=require(_0xb79b('0x5'));var db=require(_0xb79b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb79b('0x7'))(_0xb79b('0x8'));var config=require(_0xb79b('0x9'));var jayson=require(_0xb79b('0xa'));var client=jayson[_0xb79b('0xb')][_0xb79b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ba2ad,_0x28a9cb,_0x4b5474){return new BPromise(function(_0x37d12f,_0x5b47bb){return client['request'](_0x4ba2ad,_0x4b5474)[_0xb79b('0xd')](function(_0x3346dd){logger['info'](_0xb79b('0xe'),_0x28a9cb,_0xb79b('0xf'));logger[_0xb79b('0x10')](_0xb79b('0x11'),_0x28a9cb,_0xb79b('0xf'),JSON[_0xb79b('0x12')](_0x3346dd));if(_0x3346dd['error']){if(_0x3346dd['error'][_0xb79b('0x13')]===0x1f4){logger[_0xb79b('0x14')](_0xb79b('0xe'),_0x28a9cb,_0x3346dd[_0xb79b('0x14')][_0xb79b('0x15')]);return _0x5b47bb(_0x3346dd['error'][_0xb79b('0x15')]);}logger[_0xb79b('0x14')](_0xb79b('0xe'),_0x28a9cb,_0x3346dd[_0xb79b('0x14')][_0xb79b('0x15')]);return _0x37d12f(_0x3346dd[_0xb79b('0x14')][_0xb79b('0x15')]);}else{logger[_0xb79b('0x16')]('DeskAccount,\x20%s,\x20%s',_0x28a9cb,'request\x20sent');_0x37d12f(_0x3346dd[_0xb79b('0x17')][_0xb79b('0x15')]);}})['catch'](function(_0x2e9eae){logger[_0xb79b('0x14')](_0xb79b('0xe'),_0x28a9cb,_0x2e9eae);_0x5b47bb(_0x2e9eae);});});}exports[_0xb79b('0x18')]=function(_0x387b2b){var _0x20783e=this;return new Promise(function(_0x15b537,_0x29f412){return db[_0xb79b('0x19')][_0xb79b('0x1a')]({'raw':_0x387b2b[_0xb79b('0x1b')]?_0x387b2b[_0xb79b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x387b2b[_0xb79b('0x1b')]?_0x387b2b[_0xb79b('0x1b')][_0xb79b('0x1c')]||null:null,'attributes':_0x387b2b[_0xb79b('0x1b')]?_0x387b2b['options'][_0xb79b('0x1d')]||null:null,'limit':_0x387b2b[_0xb79b('0x1b')]?_0x387b2b[_0xb79b('0x1b')][_0xb79b('0x1e')]||null:null,'include':_0x387b2b[_0xb79b('0x1b')]?_0x387b2b[_0xb79b('0x1b')]['include']?_[_0xb79b('0x1f')](_0x387b2b[_0xb79b('0x1b')][_0xb79b('0x20')],function(_0x1487fc){return{'model':db[_0x1487fc[_0xb79b('0x21')]],'as':_0x1487fc['as'],'attributes':_0x1487fc[_0xb79b('0x1d')],'include':_0x1487fc['include']?_['map'](_0x1487fc[_0xb79b('0x20')],function(_0x32bfcd){return{'model':db[_0x32bfcd['model']],'as':_0x32bfcd['as'],'attributes':_0x32bfcd[_0xb79b('0x1d')],'include':_0x32bfcd[_0xb79b('0x20')]?_[_0xb79b('0x1f')](_0x32bfcd['include'],function(_0x19d7de){return{'model':db[_0x19d7de['model']],'as':_0x19d7de['as'],'attributes':_0x19d7de[_0xb79b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4674da){logger['info']('GetDeskAccount',_0x387b2b);logger[_0xb79b('0x10')](_0xb79b('0x18'),_0x387b2b,JSON[_0xb79b('0x12')](_0x4674da));_0x15b537(_0x4674da);})[_0xb79b('0x22')](function(_0x554b47){logger[_0xb79b('0x14')](_0xb79b('0x18'),_0x554b47['message'],_0x387b2b);_0x29f412(_0x20783e[_0xb79b('0x14')](0x1f4,_0x554b47[_0xb79b('0x15')]));});});};exports[_0xb79b('0x23')]=function(_0x3ba8ef){var _0x3dd06e=this;return new Promise(function(_0x31c3ea,_0x5dce81){return db[_0xb79b('0x19')]['find']({'raw':_0x3ba8ef['options']?_0x3ba8ef[_0xb79b('0x1b')][_0xb79b('0x24')]===undefined?!![]:![]:!![],'where':_0x3ba8ef[_0xb79b('0x1b')]?_0x3ba8ef[_0xb79b('0x1b')]['where']||null:null,'attributes':_0x3ba8ef[_0xb79b('0x1b')]?_0x3ba8ef[_0xb79b('0x1b')][_0xb79b('0x1d')]||null:null,'include':_0x3ba8ef[_0xb79b('0x1b')]?_0x3ba8ef[_0xb79b('0x1b')][_0xb79b('0x20')]?_[_0xb79b('0x1f')](_0x3ba8ef['options'][_0xb79b('0x20')],function(_0x5be65e){return{'model':db[_0x5be65e[_0xb79b('0x21')]],'as':_0x5be65e['as'],'attributes':_0x5be65e[_0xb79b('0x1d')],'include':_0x5be65e[_0xb79b('0x20')]?_[_0xb79b('0x1f')](_0x5be65e[_0xb79b('0x20')],function(_0x82658a){return{'model':db[_0x82658a[_0xb79b('0x21')]],'as':_0x82658a['as'],'attributes':_0x82658a[_0xb79b('0x1d')],'include':_0x82658a[_0xb79b('0x20')]?_[_0xb79b('0x1f')](_0x82658a[_0xb79b('0x20')],function(_0xc1690e){return{'model':db[_0xc1690e['model']],'as':_0xc1690e['as'],'attributes':_0xc1690e[_0xb79b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb79b('0xd')](function(_0x34cd9c){logger[_0xb79b('0x16')](_0xb79b('0x23'),_0x3ba8ef);logger[_0xb79b('0x10')](_0xb79b('0x23'),_0x3ba8ef,JSON[_0xb79b('0x12')](_0x34cd9c));_0x31c3ea(_0x34cd9c);})[_0xb79b('0x22')](function(_0x55d41f){logger[_0xb79b('0x14')](_0xb79b('0x23'),_0x55d41f[_0xb79b('0x15')],_0x3ba8ef);_0x5dce81(_0x3dd06e['error'](0x1f4,_0x55d41f[_0xb79b('0x15')]));});});}; \ No newline at end of file +var _0x527a=['../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include','map','model','ShowDeskAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x49608d,_0x25d995){var _0x59523c=function(_0x51f65e){while(--_0x51f65e){_0x49608d['push'](_0x49608d['shift']());}};_0x59523c(++_0x25d995);}(_0x527a,0x1d8));var _0xa527=function(_0x122da6,_0x1b1737){_0x122da6=_0x122da6-0x0;var _0x233b82=_0x527a[_0x122da6];return _0x233b82;};'use strict';var _=require('lodash');var util=require(_0xa527('0x0'));var moment=require(_0xa527('0x1'));var BPromise=require(_0xa527('0x2'));var rs=require(_0xa527('0x3'));var fs=require('fs');var Redis=require(_0xa527('0x4'));var db=require(_0xa527('0x5'))['db'];var utils=require(_0xa527('0x6'));var logger=require(_0xa527('0x7'))(_0xa527('0x8'));var config=require(_0xa527('0x9'));var jayson=require(_0xa527('0xa'));var client=jayson[_0xa527('0xb')][_0xa527('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31151f,_0x5d9a04,_0x1ce188){return new BPromise(function(_0x21b993,_0x3da6ef){return client['request'](_0x31151f,_0x1ce188)[_0xa527('0xd')](function(_0x2b9ca2){logger[_0xa527('0xe')](_0xa527('0xf'),_0x5d9a04,'request\x20sent');logger[_0xa527('0x10')](_0xa527('0x11'),_0x5d9a04,'request\x20sent',JSON[_0xa527('0x12')](_0x2b9ca2));if(_0x2b9ca2[_0xa527('0x13')]){if(_0x2b9ca2['error'][_0xa527('0x14')]===0x1f4){logger[_0xa527('0x13')](_0xa527('0xf'),_0x5d9a04,_0x2b9ca2[_0xa527('0x13')][_0xa527('0x15')]);return _0x3da6ef(_0x2b9ca2[_0xa527('0x13')][_0xa527('0x15')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x5d9a04,_0x2b9ca2[_0xa527('0x13')][_0xa527('0x15')]);return _0x21b993(_0x2b9ca2['error'][_0xa527('0x15')]);}else{logger['info'](_0xa527('0xf'),_0x5d9a04,_0xa527('0x16'));_0x21b993(_0x2b9ca2[_0xa527('0x17')]['message']);}})[_0xa527('0x18')](function(_0x2a301f){logger[_0xa527('0x13')]('DeskAccount,\x20%s,\x20%s',_0x5d9a04,_0x2a301f);_0x3da6ef(_0x2a301f);});});}exports[_0xa527('0x19')]=function(_0x224eff){var _0x3383e1=this;return new Promise(function(_0x1ab8d5,_0x53a748){return db[_0xa527('0x1a')]['findAll']({'raw':_0x224eff[_0xa527('0x1b')]?_0x224eff[_0xa527('0x1b')][_0xa527('0x1c')]===undefined?!![]:![]:!![],'where':_0x224eff[_0xa527('0x1b')]?_0x224eff[_0xa527('0x1b')]['where']||null:null,'attributes':_0x224eff[_0xa527('0x1b')]?_0x224eff[_0xa527('0x1b')][_0xa527('0x1d')]||null:null,'limit':_0x224eff['options']?_0x224eff[_0xa527('0x1b')][_0xa527('0x1e')]||null:null,'include':_0x224eff[_0xa527('0x1b')]?_0x224eff[_0xa527('0x1b')][_0xa527('0x1f')]?_[_0xa527('0x20')](_0x224eff[_0xa527('0x1b')]['include'],function(_0x1e3559){return{'model':db[_0x1e3559[_0xa527('0x21')]],'as':_0x1e3559['as'],'attributes':_0x1e3559['attributes'],'include':_0x1e3559[_0xa527('0x1f')]?_['map'](_0x1e3559[_0xa527('0x1f')],function(_0x383d32){return{'model':db[_0x383d32[_0xa527('0x21')]],'as':_0x383d32['as'],'attributes':_0x383d32[_0xa527('0x1d')],'include':_0x383d32[_0xa527('0x1f')]?_[_0xa527('0x20')](_0x383d32['include'],function(_0x3b94f9){return{'model':db[_0x3b94f9[_0xa527('0x21')]],'as':_0x3b94f9['as'],'attributes':_0x3b94f9[_0xa527('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa527('0xd')](function(_0x3e10be){logger[_0xa527('0xe')]('GetDeskAccount',_0x224eff);logger['debug'](_0xa527('0x19'),_0x224eff,JSON[_0xa527('0x12')](_0x3e10be));_0x1ab8d5(_0x3e10be);})[_0xa527('0x18')](function(_0x4ab3be){logger[_0xa527('0x13')](_0xa527('0x19'),_0x4ab3be[_0xa527('0x15')],_0x224eff);_0x53a748(_0x3383e1[_0xa527('0x13')](0x1f4,_0x4ab3be[_0xa527('0x15')]));});});};exports[_0xa527('0x22')]=function(_0x29f24d){var _0x29516a=this;return new Promise(function(_0x1a2e19,_0x418dcf){return db[_0xa527('0x1a')][_0xa527('0x23')]({'raw':_0x29f24d[_0xa527('0x1b')]?_0x29f24d[_0xa527('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x29f24d['options']?_0x29f24d[_0xa527('0x1b')][_0xa527('0x24')]||null:null,'attributes':_0x29f24d['options']?_0x29f24d[_0xa527('0x1b')][_0xa527('0x1d')]||null:null,'include':_0x29f24d[_0xa527('0x1b')]?_0x29f24d['options'][_0xa527('0x1f')]?_[_0xa527('0x20')](_0x29f24d[_0xa527('0x1b')][_0xa527('0x1f')],function(_0x1f5ff7){return{'model':db[_0x1f5ff7[_0xa527('0x21')]],'as':_0x1f5ff7['as'],'attributes':_0x1f5ff7['attributes'],'include':_0x1f5ff7[_0xa527('0x1f')]?_[_0xa527('0x20')](_0x1f5ff7[_0xa527('0x1f')],function(_0x3fc606){return{'model':db[_0x3fc606[_0xa527('0x21')]],'as':_0x3fc606['as'],'attributes':_0x3fc606[_0xa527('0x1d')],'include':_0x3fc606[_0xa527('0x1f')]?_[_0xa527('0x20')](_0x3fc606[_0xa527('0x1f')],function(_0xdc2cfc){return{'model':db[_0xdc2cfc[_0xa527('0x21')]],'as':_0xdc2cfc['as'],'attributes':_0xdc2cfc[_0xa527('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa527('0xd')](function(_0x58c031){logger[_0xa527('0xe')](_0xa527('0x22'),_0x29f24d);logger[_0xa527('0x10')](_0xa527('0x22'),_0x29f24d,JSON['stringify'](_0x58c031));_0x1a2e19(_0x58c031);})['catch'](function(_0x4f1d1e){logger[_0xa527('0x13')]('ShowDeskAccount',_0x4f1d1e[_0xa527('0x15')],_0x29f24d);_0x418dcf(_0x29516a[_0xa527('0x13')](0x1f4,_0x4f1d1e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a661f5b..ff3e287 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x1a197e,_0x46c547){var _0x24f4f4=function(_0x13c231){while(--_0x13c231){_0x1a197e['push'](_0x1a197e['shift']());}};_0x24f4f4(++_0x46c547);}(_0x3e74,0x175));var _0x43e7=function(_0x1ca9e5,_0x54ab9c){_0x1ca9e5=_0x1ca9e5-0x0;var _0x543cfd=_0x3e74[_0x1ca9e5];return _0x543cfd;};'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('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x146890,_0x4d7552){var _0x132911=function(_0x314c4b){while(--_0x314c4b){_0x146890['push'](_0x146890['shift']());}};_0x132911(++_0x4d7552);}(_0x008c,0x188));var _0xc008=function(_0x21c69c,_0x1b7535){_0x21c69c=_0x21c69c-0x0;var _0x2acd03=_0x008c[_0x21c69c];return _0x2acd03;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 75897e1..d917ed2 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 _0x90f6=['exports','STRING','sequelize'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x90f6,0xb3));var _0x690f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90f6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x690f('0x0'));module[_0x690f('0x1')]={'name':{'type':Sequelize[_0x690f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xae3d=['STRING','exports'];(function(_0x54e9db,_0x1936d6){var _0x217be2=function(_0xa790c5){while(--_0xa790c5){_0x54e9db['push'](_0x54e9db['shift']());}};_0x217be2(++_0x1936d6);}(_0xae3d,0x187));var _0xdae3=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xae3d[_0x44b3bd];return _0x1efc4a;};'use strict';var Sequelize=require('sequelize');module[_0xdae3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdae3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 24f7ee7..9deb3e6 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 _0xe2a5=['save','update','then','destroy','end','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','include','rows','catch','params','filters','includeAll','find','create','body','findOne','DeskField','pick','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xe2a5,0x193));var _0x5e2a=function(_0x422b11,_0x290b80){_0x422b11=_0x422b11-0x0;var _0x33f148=_0xe2a5[_0x422b11];return _0x33f148;};'use strict';var emlformat=require(_0x5e2a('0x0'));var rimraf=require(_0x5e2a('0x1'));var zipdir=require(_0x5e2a('0x2'));var jsonpatch=require(_0x5e2a('0x3'));var rp=require(_0x5e2a('0x4'));var moment=require(_0x5e2a('0x5'));var BPromise=require(_0x5e2a('0x6'));var Mustache=require('mustache');var util=require(_0x5e2a('0x7'));var path=require(_0x5e2a('0x8'));var sox=require(_0x5e2a('0x9'));var csv=require(_0x5e2a('0xa'));var ejs=require(_0x5e2a('0xb'));var fs=require('fs');var fs_extra=require(_0x5e2a('0xc'));var _=require(_0x5e2a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5e2a('0xe'));var deskjs=require(_0x5e2a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5e2a('0x10'));var Papa=require(_0x5e2a('0x11'));var Redis=require('ioredis');var authService=require(_0x5e2a('0x12'));var qs=require(_0x5e2a('0x13'));var as=require(_0x5e2a('0x14'));var hardwareService=require(_0x5e2a('0x15'));var logger=require(_0x5e2a('0x16'))(_0x5e2a('0x17'));var utils=require(_0x5e2a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5e2a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b5ba7,_0x599ebf){_0x599ebf=_0x599ebf||0xcc;return function(_0x3a9b5f){if(_0x3a9b5f){return _0x3b5ba7[_0x5e2a('0x1a')](_0x599ebf);}return _0x3b5ba7[_0x5e2a('0x1b')](_0x599ebf)['end']();};}function respondWithResult(_0xcd45ac,_0x450e97){_0x450e97=_0x450e97||0xc8;return function(_0x401733){if(_0x401733){return _0xcd45ac[_0x5e2a('0x1b')](_0x450e97)[_0x5e2a('0x1c')](_0x401733);}};}function respondWithFilteredResult(_0x4d8a6c,_0x76b650){return function(_0x1e637f){if(_0x1e637f){var _0x2a01b2=typeof _0x76b650[_0x5e2a('0x1d')]===_0x5e2a('0x1e')&&typeof _0x76b650[_0x5e2a('0x1f')]===_0x5e2a('0x1e');var _0x2b69f8=_0x1e637f['count'];var _0x38980a=_0x2a01b2?0x0:_0x76b650[_0x5e2a('0x1d')];var _0x5cf6fe=_0x2a01b2?_0x1e637f[_0x5e2a('0x20')]:_0x76b650[_0x5e2a('0x1d')]+_0x76b650[_0x5e2a('0x1f')];var _0x2a48e1;if(_0x5cf6fe>=_0x2b69f8){_0x5cf6fe=_0x2b69f8;_0x2a48e1=0xc8;}else{_0x2a48e1=0xce;}_0x4d8a6c[_0x5e2a('0x1b')](_0x2a48e1);return _0x4d8a6c[_0x5e2a('0x21')](_0x5e2a('0x22'),_0x38980a+'-'+_0x5cf6fe+'/'+_0x2b69f8)[_0x5e2a('0x1c')](_0x1e637f);}return null;};}function patchUpdates(_0x1d6fc6){return function(_0x4a0fb8){try{jsonpatch[_0x5e2a('0x23')](_0x4a0fb8,_0x1d6fc6,!![]);}catch(_0x40bbad){return BPromise[_0x5e2a('0x24')](_0x40bbad);}return _0x4a0fb8[_0x5e2a('0x25')]();};}function saveUpdates(_0x60b788,_0x825dca){return function(_0x15035f){if(_0x15035f){return _0x15035f[_0x5e2a('0x26')](_0x60b788)[_0x5e2a('0x27')](function(_0x279958){return _0x279958;});}return null;};}function removeEntity(_0x3da207,_0x165c76){return function(_0x104414){if(_0x104414){return _0x104414[_0x5e2a('0x28')]()[_0x5e2a('0x27')](function(){_0x3da207['status'](0xcc)[_0x5e2a('0x29')]();});}};}function handleEntityNotFound(_0x163ea6,_0xf4fa45){return function(_0x4408bc){if(!_0x4408bc){_0x163ea6[_0x5e2a('0x1a')](0x194);}return _0x4408bc;};}function handleError(_0x19b68b,_0x2eb0bc){_0x2eb0bc=_0x2eb0bc||0x1f4;return function(_0x1c3d2f){logger[_0x5e2a('0x2a')](_0x1c3d2f[_0x5e2a('0x2b')]);if(_0x1c3d2f[_0x5e2a('0x2c')]){delete _0x1c3d2f[_0x5e2a('0x2c')];}_0x19b68b['status'](_0x2eb0bc)[_0x5e2a('0x2d')](_0x1c3d2f);};}exports[_0x5e2a('0x2e')]=function(_0x5bb40b,_0x478b63){var _0x2b8733={},_0x46e186={},_0xf75917={'count':0x0,'rows':[]};var _0x3177a6=_['map'](db[_0x5e2a('0x2f')][_0x5e2a('0x30')],function(_0x2865d2){return{'name':_0x2865d2[_0x5e2a('0x31')],'type':_0x2865d2[_0x5e2a('0x32')][_0x5e2a('0x33')]};});_0x46e186['model']=_['map'](_0x3177a6,_0x5e2a('0x2c'));_0x46e186[_0x5e2a('0x34')]=_[_0x5e2a('0x35')](_0x5bb40b[_0x5e2a('0x34')]);_0x46e186['filters']=_[_0x5e2a('0x36')](_0x46e186['model'],_0x46e186[_0x5e2a('0x34')]);_0x2b8733[_0x5e2a('0x37')]=_['intersection'](_0x46e186[_0x5e2a('0x38')],qs[_0x5e2a('0x39')](_0x5bb40b[_0x5e2a('0x34')][_0x5e2a('0x39')]));_0x2b8733['attributes']=_0x2b8733[_0x5e2a('0x37')][_0x5e2a('0x3a')]?_0x2b8733[_0x5e2a('0x37')]:_0x46e186[_0x5e2a('0x38')];if(!_0x5bb40b[_0x5e2a('0x34')][_0x5e2a('0x3b')](_0x5e2a('0x3c'))){_0x2b8733[_0x5e2a('0x1f')]=qs['limit'](_0x5bb40b[_0x5e2a('0x34')][_0x5e2a('0x1f')]);_0x2b8733[_0x5e2a('0x1d')]=qs[_0x5e2a('0x1d')](_0x5bb40b['query'][_0x5e2a('0x1d')]);}_0x2b8733[_0x5e2a('0x3d')]=qs[_0x5e2a('0x3e')](_0x5bb40b[_0x5e2a('0x34')][_0x5e2a('0x3e')]);_0x2b8733['where']=qs['filters'](_['pick'](_0x5bb40b[_0x5e2a('0x34')],_0x46e186['filters']),_0x3177a6);if(_0x5bb40b[_0x5e2a('0x34')]['filter']){_0x2b8733[_0x5e2a('0x3f')]=_[_0x5e2a('0x40')](_0x2b8733[_0x5e2a('0x3f')],{'$or':_[_0x5e2a('0x41')](_0x3177a6,function(_0x434457){if(_0x434457[_0x5e2a('0x32')]!==_0x5e2a('0x42')){var _0x27cbbd={};_0x27cbbd[_0x434457[_0x5e2a('0x2c')]]={'$like':'%'+_0x5bb40b[_0x5e2a('0x34')][_0x5e2a('0x43')]+'%'};return _0x27cbbd;}})});}_0x2b8733=_[_0x5e2a('0x40')]({},_0x2b8733,_0x5bb40b[_0x5e2a('0x44')]);var _0x30711f={'where':_0x2b8733[_0x5e2a('0x3f')]};return db[_0x5e2a('0x2f')]['count'](_0x30711f)[_0x5e2a('0x27')](function(_0x36c4d9){_0xf75917[_0x5e2a('0x20')]=_0x36c4d9;if(_0x5bb40b[_0x5e2a('0x34')]['includeAll']){_0x2b8733[_0x5e2a('0x45')]=[{'all':!![]}];}return db[_0x5e2a('0x2f')]['findAll'](_0x2b8733);})[_0x5e2a('0x27')](function(_0x3e5930){_0xf75917[_0x5e2a('0x46')]=_0x3e5930;return _0xf75917;})[_0x5e2a('0x27')](respondWithFilteredResult(_0x478b63,_0x2b8733))[_0x5e2a('0x47')](handleError(_0x478b63,null));};exports['show']=function(_0x32b893,_0x379c25){var _0x1507ea={'raw':![],'where':{'id':_0x32b893[_0x5e2a('0x48')]['id']}},_0x3cdc90={};_0x3cdc90[_0x5e2a('0x38')]=_[_0x5e2a('0x35')](db[_0x5e2a('0x2f')]['rawAttributes']);_0x3cdc90[_0x5e2a('0x34')]=_[_0x5e2a('0x35')](_0x32b893[_0x5e2a('0x34')]);_0x3cdc90[_0x5e2a('0x49')]=_[_0x5e2a('0x36')](_0x3cdc90[_0x5e2a('0x38')],_0x3cdc90['query']);_0x1507ea[_0x5e2a('0x37')]=_[_0x5e2a('0x36')](_0x3cdc90[_0x5e2a('0x38')],qs[_0x5e2a('0x39')](_0x32b893[_0x5e2a('0x34')][_0x5e2a('0x39')]));_0x1507ea[_0x5e2a('0x37')]=_0x1507ea['attributes'][_0x5e2a('0x3a')]?_0x1507ea[_0x5e2a('0x37')]:_0x3cdc90[_0x5e2a('0x38')];if(_0x32b893[_0x5e2a('0x34')][_0x5e2a('0x4a')]){_0x1507ea['include']=[{'all':!![]}];}_0x1507ea=_[_0x5e2a('0x40')]({},_0x1507ea,_0x32b893[_0x5e2a('0x44')]);return db[_0x5e2a('0x2f')][_0x5e2a('0x4b')](_0x1507ea)['then'](handleEntityNotFound(_0x379c25,null))[_0x5e2a('0x27')](respondWithResult(_0x379c25,null))[_0x5e2a('0x47')](handleError(_0x379c25,null));};exports['create']=function(_0x1d4da8,_0x4d2bf1){return db['DeskConfiguration'][_0x5e2a('0x4c')](_0x1d4da8['body'],{})['then'](respondWithResult(_0x4d2bf1,0xc9))[_0x5e2a('0x47')](handleError(_0x4d2bf1,null));};exports['update']=function(_0x3eaf1c,_0x3a420e){if(_0x3eaf1c[_0x5e2a('0x4d')]['id']){delete _0x3eaf1c[_0x5e2a('0x4d')]['id'];}return db['DeskConfiguration'][_0x5e2a('0x4b')]({'where':{'id':_0x3eaf1c['params']['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x3a420e,null))[_0x5e2a('0x27')](saveUpdates(_0x3eaf1c[_0x5e2a('0x4d')],null))[_0x5e2a('0x27')](respondWithResult(_0x3a420e,null))[_0x5e2a('0x47')](handleError(_0x3a420e,null));};exports[_0x5e2a('0x28')]=function(_0xc58351,_0x491528){return db[_0x5e2a('0x2f')][_0x5e2a('0x4b')]({'where':{'id':_0xc58351[_0x5e2a('0x48')]['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x491528,null))[_0x5e2a('0x27')](removeEntity(_0x491528,null))[_0x5e2a('0x47')](handleError(_0x491528,null));};exports['getFields']=function(_0x439a00,_0x3b3016,_0x42a37e){var _0x1ca0d1={};var _0x274969={};var _0x21bb73;var _0x3321bf;return db[_0x5e2a('0x2f')][_0x5e2a('0x4e')]({'where':{'id':_0x439a00[_0x5e2a('0x48')]['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x3b3016,null))['then'](function(_0x365b97){if(_0x365b97){_0x21bb73=_0x365b97;_0x274969[_0x5e2a('0x38')]=_['keys'](db[_0x5e2a('0x4f')]['rawAttributes']);_0x274969[_0x5e2a('0x34')]=_[_0x5e2a('0x35')](_0x439a00['query']);_0x274969[_0x5e2a('0x49')]=_[_0x5e2a('0x36')](_0x274969[_0x5e2a('0x38')],_0x274969[_0x5e2a('0x34')]);_0x1ca0d1[_0x5e2a('0x37')]=_[_0x5e2a('0x36')](_0x274969['model'],qs[_0x5e2a('0x39')](_0x439a00[_0x5e2a('0x34')][_0x5e2a('0x39')]));_0x1ca0d1[_0x5e2a('0x37')]=_0x1ca0d1['attributes'][_0x5e2a('0x3a')]?_0x1ca0d1[_0x5e2a('0x37')]:_0x274969['model'];_0x1ca0d1[_0x5e2a('0x3d')]=qs['sort'](_0x439a00['query']['sort']);_0x1ca0d1[_0x5e2a('0x3f')]=qs[_0x5e2a('0x49')](_[_0x5e2a('0x50')](_0x439a00[_0x5e2a('0x34')],_0x274969[_0x5e2a('0x49')]));if(_0x439a00[_0x5e2a('0x34')][_0x5e2a('0x43')]){_0x1ca0d1[_0x5e2a('0x3f')]=_[_0x5e2a('0x40')](_0x1ca0d1['where'],{'$or':_['map'](_0x1ca0d1[_0x5e2a('0x37')],function(_0x4168c7){var _0x5addd8={};_0x5addd8[_0x4168c7]={'$like':'%'+_0x439a00[_0x5e2a('0x34')][_0x5e2a('0x43')]+'%'};return _0x5addd8;})});}_0x1ca0d1=_[_0x5e2a('0x40')]({},_0x1ca0d1,_0x439a00[_0x5e2a('0x44')]);return _0x21bb73[_0x5e2a('0x51')](_0x1ca0d1);}})[_0x5e2a('0x27')](function(_0x2efdbb){if(_0x2efdbb){_0x3321bf=_0x2efdbb[_0x5e2a('0x3a')];if(!_0x439a00[_0x5e2a('0x34')][_0x5e2a('0x3b')](_0x5e2a('0x3c'))){_0x1ca0d1[_0x5e2a('0x1f')]=qs[_0x5e2a('0x1f')](_0x439a00[_0x5e2a('0x34')][_0x5e2a('0x1f')]);_0x1ca0d1[_0x5e2a('0x1d')]=qs[_0x5e2a('0x1d')](_0x439a00[_0x5e2a('0x34')][_0x5e2a('0x1d')]);}return _0x21bb73[_0x5e2a('0x51')](_0x1ca0d1);}})[_0x5e2a('0x27')](function(_0x133a17){if(_0x133a17){return _0x133a17?{'count':_0x3321bf,'rows':_0x133a17}:null;}})[_0x5e2a('0x27')](respondWithResult(_0x3b3016,null))[_0x5e2a('0x47')](handleError(_0x3b3016,null));};exports[_0x5e2a('0x52')]=function(_0x4a9408,_0x3a99a7,_0x3ae6ad){var _0x7c5147={};var _0x196b56={};var _0x1948c7;var _0x5a4a92;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4a9408['params']['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x3a99a7,null))[_0x5e2a('0x27')](function(_0x3d607d){if(_0x3d607d){_0x1948c7=_0x3d607d;_0x196b56[_0x5e2a('0x38')]=_[_0x5e2a('0x35')](db[_0x5e2a('0x4f')]['rawAttributes']);_0x196b56['query']=_[_0x5e2a('0x35')](_0x4a9408[_0x5e2a('0x34')]);_0x196b56[_0x5e2a('0x49')]=_[_0x5e2a('0x36')](_0x196b56['model'],_0x196b56[_0x5e2a('0x34')]);_0x7c5147[_0x5e2a('0x37')]=_[_0x5e2a('0x36')](_0x196b56[_0x5e2a('0x38')],qs[_0x5e2a('0x39')](_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x39')]));_0x7c5147['attributes']=_0x7c5147['attributes'][_0x5e2a('0x3a')]?_0x7c5147['attributes']:_0x196b56[_0x5e2a('0x38')];_0x7c5147[_0x5e2a('0x3d')]=qs['sort'](_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x3e')]);_0x7c5147[_0x5e2a('0x3f')]=qs['filters'](_[_0x5e2a('0x50')](_0x4a9408[_0x5e2a('0x34')],_0x196b56[_0x5e2a('0x49')]));if(_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x43')]){_0x7c5147[_0x5e2a('0x3f')]=_[_0x5e2a('0x40')](_0x7c5147[_0x5e2a('0x3f')],{'$or':_[_0x5e2a('0x41')](_0x7c5147[_0x5e2a('0x37')],function(_0x2b6469){var _0x3f3eb9={};_0x3f3eb9[_0x2b6469]={'$like':'%'+_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x43')]+'%'};return _0x3f3eb9;})});}_0x7c5147=_[_0x5e2a('0x40')]({},_0x7c5147,_0x4a9408[_0x5e2a('0x44')]);return _0x1948c7[_0x5e2a('0x52')](_0x7c5147);}})[_0x5e2a('0x27')](function(_0x7da49){if(_0x7da49){_0x5a4a92=_0x7da49[_0x5e2a('0x3a')];if(!_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x3b')]('nolimit')){_0x7c5147[_0x5e2a('0x1f')]=qs['limit'](_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x1f')]);_0x7c5147['offset']=qs[_0x5e2a('0x1d')](_0x4a9408[_0x5e2a('0x34')][_0x5e2a('0x1d')]);}return _0x1948c7[_0x5e2a('0x52')](_0x7c5147);}})[_0x5e2a('0x27')](function(_0x31693e){if(_0x31693e){return _0x31693e?{'count':_0x5a4a92,'rows':_0x31693e}:null;}})['then'](respondWithResult(_0x3a99a7,null))['catch'](handleError(_0x3a99a7,null));};exports[_0x5e2a('0x53')]=function(_0x3b434d,_0x558402,_0x1a582e){var _0x400f95={};var _0x50ff5b={};var _0x41bb4e;var _0x6c9ef9;return db[_0x5e2a('0x2f')][_0x5e2a('0x4e')]({'where':{'id':_0x3b434d[_0x5e2a('0x48')]['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x558402,null))[_0x5e2a('0x27')](function(_0x2bdcb0){if(_0x2bdcb0){_0x41bb4e=_0x2bdcb0;_0x50ff5b[_0x5e2a('0x38')]=_[_0x5e2a('0x35')](db[_0x5e2a('0x4f')][_0x5e2a('0x30')]);_0x50ff5b['query']=_[_0x5e2a('0x35')](_0x3b434d[_0x5e2a('0x34')]);_0x50ff5b['filters']=_[_0x5e2a('0x36')](_0x50ff5b[_0x5e2a('0x38')],_0x50ff5b['query']);_0x400f95['attributes']=_[_0x5e2a('0x36')](_0x50ff5b[_0x5e2a('0x38')],qs[_0x5e2a('0x39')](_0x3b434d[_0x5e2a('0x34')][_0x5e2a('0x39')]));_0x400f95['attributes']=_0x400f95[_0x5e2a('0x37')][_0x5e2a('0x3a')]?_0x400f95[_0x5e2a('0x37')]:_0x50ff5b[_0x5e2a('0x38')];_0x400f95['order']=qs[_0x5e2a('0x3e')](_0x3b434d[_0x5e2a('0x34')][_0x5e2a('0x3e')]);_0x400f95['where']=qs[_0x5e2a('0x49')](_[_0x5e2a('0x50')](_0x3b434d[_0x5e2a('0x34')],_0x50ff5b['filters']));if(_0x3b434d['query'][_0x5e2a('0x43')]){_0x400f95['where']=_['merge'](_0x400f95[_0x5e2a('0x3f')],{'$or':_[_0x5e2a('0x41')](_0x400f95[_0x5e2a('0x37')],function(_0x42c61d){var _0x477fc8={};_0x477fc8[_0x42c61d]={'$like':'%'+_0x3b434d[_0x5e2a('0x34')]['filter']+'%'};return _0x477fc8;})});}_0x400f95=_[_0x5e2a('0x40')]({},_0x400f95,_0x3b434d[_0x5e2a('0x44')]);return _0x41bb4e[_0x5e2a('0x53')](_0x400f95);}})[_0x5e2a('0x27')](function(_0x3c3f5f){if(_0x3c3f5f){_0x6c9ef9=_0x3c3f5f[_0x5e2a('0x3a')];if(!_0x3b434d[_0x5e2a('0x34')][_0x5e2a('0x3b')](_0x5e2a('0x3c'))){_0x400f95[_0x5e2a('0x1f')]=qs['limit'](_0x3b434d[_0x5e2a('0x34')][_0x5e2a('0x1f')]);_0x400f95[_0x5e2a('0x1d')]=qs[_0x5e2a('0x1d')](_0x3b434d[_0x5e2a('0x34')][_0x5e2a('0x1d')]);}return _0x41bb4e['getDescriptions'](_0x400f95);}})[_0x5e2a('0x27')](function(_0x49935c){if(_0x49935c){return _0x49935c?{'count':_0x6c9ef9,'rows':_0x49935c}:null;}})[_0x5e2a('0x27')](respondWithResult(_0x558402,null))[_0x5e2a('0x47')](handleError(_0x558402,null));};exports['getTags']=function(_0x2c31be,_0x3a9acc,_0x1598b7){var _0x37b723={};var _0x1e91e7={};var _0x3e92e1;var _0x262dee;return db['DeskConfiguration'][_0x5e2a('0x4e')]({'where':{'id':_0x2c31be[_0x5e2a('0x48')]['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x3a9acc,null))[_0x5e2a('0x27')](function(_0x2a58c8){if(_0x2a58c8){_0x3e92e1=_0x2a58c8;_0x1e91e7[_0x5e2a('0x38')]=_['keys'](db[_0x5e2a('0x54')]['rawAttributes']);_0x1e91e7[_0x5e2a('0x34')]=_[_0x5e2a('0x35')](_0x2c31be[_0x5e2a('0x34')]);_0x1e91e7[_0x5e2a('0x49')]=_[_0x5e2a('0x36')](_0x1e91e7['model'],_0x1e91e7['query']);_0x37b723[_0x5e2a('0x37')]=_[_0x5e2a('0x36')](_0x1e91e7[_0x5e2a('0x38')],qs[_0x5e2a('0x39')](_0x2c31be[_0x5e2a('0x34')][_0x5e2a('0x39')]));_0x37b723[_0x5e2a('0x37')]=_0x37b723['attributes']['length']?_0x37b723[_0x5e2a('0x37')]:_0x1e91e7[_0x5e2a('0x38')];_0x37b723[_0x5e2a('0x3d')]=qs[_0x5e2a('0x3e')](_0x2c31be[_0x5e2a('0x34')][_0x5e2a('0x3e')]);_0x37b723[_0x5e2a('0x3f')]=qs[_0x5e2a('0x49')](_[_0x5e2a('0x50')](_0x2c31be[_0x5e2a('0x34')],_0x1e91e7[_0x5e2a('0x49')]));if(_0x2c31be['query']['filter']){_0x37b723[_0x5e2a('0x3f')]=_[_0x5e2a('0x40')](_0x37b723[_0x5e2a('0x3f')],{'$or':_[_0x5e2a('0x41')](_0x37b723[_0x5e2a('0x37')],function(_0x3845d3){var _0xcc37b3={};_0xcc37b3[_0x3845d3]={'$like':'%'+_0x2c31be[_0x5e2a('0x34')]['filter']+'%'};return _0xcc37b3;})});}_0x37b723=_[_0x5e2a('0x40')]({},_0x37b723,_0x2c31be[_0x5e2a('0x44')]);return _0x3e92e1['getTags'](_0x37b723);}})[_0x5e2a('0x27')](function(_0x560772){if(_0x560772){_0x262dee=_0x560772[_0x5e2a('0x3a')];if(!_0x2c31be[_0x5e2a('0x34')][_0x5e2a('0x3b')](_0x5e2a('0x3c'))){_0x37b723[_0x5e2a('0x1f')]=qs[_0x5e2a('0x1f')](_0x2c31be[_0x5e2a('0x34')][_0x5e2a('0x1f')]);_0x37b723[_0x5e2a('0x1d')]=qs['offset'](_0x2c31be[_0x5e2a('0x34')]['offset']);}return _0x3e92e1[_0x5e2a('0x55')](_0x37b723);}})[_0x5e2a('0x27')](function(_0x3e713f){if(_0x3e713f){return _0x3e713f?{'count':_0x262dee,'rows':_0x3e713f}:null;}})[_0x5e2a('0x27')](respondWithResult(_0x3a9acc,null))[_0x5e2a('0x47')](handleError(_0x3a9acc,null));};exports[_0x5e2a('0x56')]=function(_0x25557f,_0x12e84b,_0x1534b0){if(_0x25557f[_0x5e2a('0x4d')]['id']){delete _0x25557f['body']['id'];}return db[_0x5e2a('0x2f')]['findOne']({'where':{'id':_0x25557f[_0x5e2a('0x48')]['id']}})[_0x5e2a('0x27')](handleEntityNotFound(_0x12e84b,null))['then'](function(_0x3252e8){if(_0x3252e8){return _0x3252e8[_0x5e2a('0x56')](_0x25557f['body'][_0x5e2a('0x57')]||[]);}return null;})['then'](respondWithResult(_0x12e84b,null))['catch'](handleError(_0x12e84b,null));}; \ No newline at end of file +var _0x3520=['reject','save','update','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','show','options','create','body','params','destroy','find','getFields','DeskField','order','findOne','nolimit','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply'];(function(_0x5236a7,_0x410673){var _0x55831a=function(_0x5ea8ab){while(--_0x5ea8ab){_0x5236a7['push'](_0x5236a7['shift']());}};_0x55831a(++_0x410673);}(_0x3520,0x134));var _0x0352=function(_0x1fa286,_0x3fdff0){_0x1fa286=_0x1fa286-0x0;var _0x51daf2=_0x3520[_0x1fa286];return _0x51daf2;};'use strict';var emlformat=require(_0x0352('0x0'));var rimraf=require(_0x0352('0x1'));var zipdir=require(_0x0352('0x2'));var jsonpatch=require(_0x0352('0x3'));var rp=require(_0x0352('0x4'));var moment=require(_0x0352('0x5'));var BPromise=require(_0x0352('0x6'));var Mustache=require(_0x0352('0x7'));var util=require(_0x0352('0x8'));var path=require(_0x0352('0x9'));var sox=require(_0x0352('0xa'));var csv=require('to-csv');var ejs=require(_0x0352('0xb'));var fs=require('fs');var fs_extra=require(_0x0352('0xc'));var _=require(_0x0352('0xd'));var squel=require(_0x0352('0xe'));var crypto=require(_0x0352('0xf'));var jsforce=require(_0x0352('0x10'));var deskjs=require(_0x0352('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0352('0x12'));var Papa=require(_0x0352('0x13'));var Redis=require(_0x0352('0x14'));var authService=require(_0x0352('0x15'));var qs=require(_0x0352('0x16'));var as=require(_0x0352('0x17'));var hardwareService=require(_0x0352('0x18'));var logger=require('../../config/logger')(_0x0352('0x19'));var utils=require('../../config/utils');var config=require(_0x0352('0x1a'));var licenseUtil=require(_0x0352('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79d3e7,_0x550f77){_0x550f77=_0x550f77||0xcc;return function(_0x326325){if(_0x326325){return _0x79d3e7['sendStatus'](_0x550f77);}return _0x79d3e7[_0x0352('0x1c')](_0x550f77)[_0x0352('0x1d')]();};}function respondWithResult(_0x53ea5f,_0x5e406f){_0x5e406f=_0x5e406f||0xc8;return function(_0x3e07a1){if(_0x3e07a1){return _0x53ea5f['status'](_0x5e406f)[_0x0352('0x1e')](_0x3e07a1);}};}function respondWithFilteredResult(_0x5d701b,_0x304dd7){return function(_0x137d9e){if(_0x137d9e){var _0x575da3=typeof _0x304dd7[_0x0352('0x1f')]===_0x0352('0x20')&&typeof _0x304dd7[_0x0352('0x21')]===_0x0352('0x20');var _0x11e462=_0x137d9e[_0x0352('0x22')];var _0xd5c0bf=_0x575da3?0x0:_0x304dd7['offset'];var _0x3d4cb9=_0x575da3?_0x137d9e[_0x0352('0x22')]:_0x304dd7[_0x0352('0x1f')]+_0x304dd7['limit'];var _0x39b5c1;if(_0x3d4cb9>=_0x11e462){_0x3d4cb9=_0x11e462;_0x39b5c1=0xc8;}else{_0x39b5c1=0xce;}_0x5d701b[_0x0352('0x1c')](_0x39b5c1);return _0x5d701b['set']('Content-Range',_0xd5c0bf+'-'+_0x3d4cb9+'/'+_0x11e462)[_0x0352('0x1e')](_0x137d9e);}return null;};}function patchUpdates(_0x171c4b){return function(_0x240693){try{jsonpatch[_0x0352('0x23')](_0x240693,_0x171c4b,!![]);}catch(_0xd2bcce){return BPromise[_0x0352('0x24')](_0xd2bcce);}return _0x240693[_0x0352('0x25')]();};}function saveUpdates(_0x4ebc2c,_0x3b9f00){return function(_0x3cff4e){if(_0x3cff4e){return _0x3cff4e[_0x0352('0x26')](_0x4ebc2c)['then'](function(_0x3fd95b){return _0x3fd95b;});}return null;};}function removeEntity(_0x284c8f,_0x571497){return function(_0x3ef968){if(_0x3ef968){return _0x3ef968['destroy']()['then'](function(){_0x284c8f['status'](0xcc)[_0x0352('0x1d')]();});}};}function handleEntityNotFound(_0x17ce85,_0x1782ed){return function(_0x1957ec){if(!_0x1957ec){_0x17ce85[_0x0352('0x27')](0x194);}return _0x1957ec;};}function handleError(_0xe52816,_0x433386){_0x433386=_0x433386||0x1f4;return function(_0x48ecd0){logger[_0x0352('0x28')](_0x48ecd0[_0x0352('0x29')]);if(_0x48ecd0[_0x0352('0x2a')]){delete _0x48ecd0[_0x0352('0x2a')];}_0xe52816[_0x0352('0x1c')](_0x433386)[_0x0352('0x2b')](_0x48ecd0);};}exports[_0x0352('0x2c')]=function(_0x29861c,_0x4340ca){var _0x597f58={},_0x5c04cc={},_0x2ee10c={'count':0x0,'rows':[]};var _0x2a631b=_[_0x0352('0x2d')](db[_0x0352('0x2e')][_0x0352('0x2f')],function(_0x4bdef5){return{'name':_0x4bdef5['fieldName'],'type':_0x4bdef5[_0x0352('0x30')][_0x0352('0x31')]};});_0x5c04cc[_0x0352('0x32')]=_[_0x0352('0x2d')](_0x2a631b,_0x0352('0x2a'));_0x5c04cc[_0x0352('0x33')]=_[_0x0352('0x34')](_0x29861c['query']);_0x5c04cc['filters']=_[_0x0352('0x35')](_0x5c04cc[_0x0352('0x32')],_0x5c04cc[_0x0352('0x33')]);_0x597f58[_0x0352('0x36')]=_[_0x0352('0x35')](_0x5c04cc[_0x0352('0x32')],qs[_0x0352('0x37')](_0x29861c[_0x0352('0x33')][_0x0352('0x37')]));_0x597f58[_0x0352('0x36')]=_0x597f58['attributes'][_0x0352('0x38')]?_0x597f58[_0x0352('0x36')]:_0x5c04cc[_0x0352('0x32')];if(!_0x29861c[_0x0352('0x33')][_0x0352('0x39')]('nolimit')){_0x597f58[_0x0352('0x21')]=qs[_0x0352('0x21')](_0x29861c[_0x0352('0x33')][_0x0352('0x21')]);_0x597f58[_0x0352('0x1f')]=qs[_0x0352('0x1f')](_0x29861c[_0x0352('0x33')][_0x0352('0x1f')]);}_0x597f58['order']=qs[_0x0352('0x3a')](_0x29861c[_0x0352('0x33')][_0x0352('0x3a')]);_0x597f58[_0x0352('0x3b')]=qs[_0x0352('0x3c')](_[_0x0352('0x3d')](_0x29861c['query'],_0x5c04cc[_0x0352('0x3c')]),_0x2a631b);if(_0x29861c[_0x0352('0x33')][_0x0352('0x3e')]){_0x597f58[_0x0352('0x3b')]=_[_0x0352('0x3f')](_0x597f58[_0x0352('0x3b')],{'$or':_['map'](_0x2a631b,function(_0x40a496){if(_0x40a496[_0x0352('0x30')]!==_0x0352('0x40')){var _0x55565b={};_0x55565b[_0x40a496[_0x0352('0x2a')]]={'$like':'%'+_0x29861c['query'][_0x0352('0x3e')]+'%'};return _0x55565b;}})});}_0x597f58=_[_0x0352('0x3f')]({},_0x597f58,_0x29861c['options']);var _0x48fbe9={'where':_0x597f58[_0x0352('0x3b')]};return db[_0x0352('0x2e')][_0x0352('0x22')](_0x48fbe9)[_0x0352('0x41')](function(_0x2816ee){_0x2ee10c[_0x0352('0x22')]=_0x2816ee;if(_0x29861c['query'][_0x0352('0x42')]){_0x597f58[_0x0352('0x43')]=[{'all':!![]}];}return db[_0x0352('0x2e')]['findAll'](_0x597f58);})['then'](function(_0x9254a1){_0x2ee10c[_0x0352('0x44')]=_0x9254a1;return _0x2ee10c;})[_0x0352('0x41')](respondWithFilteredResult(_0x4340ca,_0x597f58))[_0x0352('0x45')](handleError(_0x4340ca,null));};exports[_0x0352('0x46')]=function(_0x5df9e,_0x34d38c){var _0x55bd91={'raw':![],'where':{'id':_0x5df9e['params']['id']}},_0x11bcc5={};_0x11bcc5[_0x0352('0x32')]=_['keys'](db[_0x0352('0x2e')]['rawAttributes']);_0x11bcc5[_0x0352('0x33')]=_['keys'](_0x5df9e[_0x0352('0x33')]);_0x11bcc5['filters']=_[_0x0352('0x35')](_0x11bcc5[_0x0352('0x32')],_0x11bcc5[_0x0352('0x33')]);_0x55bd91[_0x0352('0x36')]=_[_0x0352('0x35')](_0x11bcc5[_0x0352('0x32')],qs[_0x0352('0x37')](_0x5df9e[_0x0352('0x33')][_0x0352('0x37')]));_0x55bd91[_0x0352('0x36')]=_0x55bd91[_0x0352('0x36')][_0x0352('0x38')]?_0x55bd91[_0x0352('0x36')]:_0x11bcc5[_0x0352('0x32')];if(_0x5df9e[_0x0352('0x33')][_0x0352('0x42')]){_0x55bd91['include']=[{'all':!![]}];}_0x55bd91=_[_0x0352('0x3f')]({},_0x55bd91,_0x5df9e[_0x0352('0x47')]);return db['DeskConfiguration']['find'](_0x55bd91)['then'](handleEntityNotFound(_0x34d38c,null))[_0x0352('0x41')](respondWithResult(_0x34d38c,null))[_0x0352('0x45')](handleError(_0x34d38c,null));};exports[_0x0352('0x48')]=function(_0x2877d7,_0x51716f){return db[_0x0352('0x2e')]['create'](_0x2877d7[_0x0352('0x49')],{})['then'](respondWithResult(_0x51716f,0xc9))[_0x0352('0x45')](handleError(_0x51716f,null));};exports[_0x0352('0x26')]=function(_0x2565e6,_0x35fb1e){if(_0x2565e6[_0x0352('0x49')]['id']){delete _0x2565e6[_0x0352('0x49')]['id'];}return db[_0x0352('0x2e')]['find']({'where':{'id':_0x2565e6[_0x0352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35fb1e,null))['then'](saveUpdates(_0x2565e6[_0x0352('0x49')],null))[_0x0352('0x41')](respondWithResult(_0x35fb1e,null))[_0x0352('0x45')](handleError(_0x35fb1e,null));};exports[_0x0352('0x4b')]=function(_0x2200cc,_0x19ecc7){return db[_0x0352('0x2e')][_0x0352('0x4c')]({'where':{'id':_0x2200cc[_0x0352('0x4a')]['id']}})[_0x0352('0x41')](handleEntityNotFound(_0x19ecc7,null))[_0x0352('0x41')](removeEntity(_0x19ecc7,null))[_0x0352('0x45')](handleError(_0x19ecc7,null));};exports[_0x0352('0x4d')]=function(_0x3a1300,_0x5f31f1,_0x8156c0){var _0x16bce0={};var _0x1479d4={};var _0x1bf68e;var _0x2d9b96;return db[_0x0352('0x2e')]['findOne']({'where':{'id':_0x3a1300[_0x0352('0x4a')]['id']}})[_0x0352('0x41')](handleEntityNotFound(_0x5f31f1,null))[_0x0352('0x41')](function(_0x11e9e2){if(_0x11e9e2){_0x1bf68e=_0x11e9e2;_0x1479d4[_0x0352('0x32')]=_[_0x0352('0x34')](db[_0x0352('0x4e')]['rawAttributes']);_0x1479d4[_0x0352('0x33')]=_[_0x0352('0x34')](_0x3a1300[_0x0352('0x33')]);_0x1479d4['filters']=_[_0x0352('0x35')](_0x1479d4[_0x0352('0x32')],_0x1479d4['query']);_0x16bce0[_0x0352('0x36')]=_[_0x0352('0x35')](_0x1479d4['model'],qs[_0x0352('0x37')](_0x3a1300[_0x0352('0x33')][_0x0352('0x37')]));_0x16bce0[_0x0352('0x36')]=_0x16bce0[_0x0352('0x36')]['length']?_0x16bce0[_0x0352('0x36')]:_0x1479d4[_0x0352('0x32')];_0x16bce0[_0x0352('0x4f')]=qs[_0x0352('0x3a')](_0x3a1300[_0x0352('0x33')]['sort']);_0x16bce0[_0x0352('0x3b')]=qs[_0x0352('0x3c')](_[_0x0352('0x3d')](_0x3a1300[_0x0352('0x33')],_0x1479d4[_0x0352('0x3c')]));if(_0x3a1300[_0x0352('0x33')][_0x0352('0x3e')]){_0x16bce0[_0x0352('0x3b')]=_[_0x0352('0x3f')](_0x16bce0[_0x0352('0x3b')],{'$or':_['map'](_0x16bce0[_0x0352('0x36')],function(_0x394b0c){var _0x4ac2df={};_0x4ac2df[_0x394b0c]={'$like':'%'+_0x3a1300[_0x0352('0x33')][_0x0352('0x3e')]+'%'};return _0x4ac2df;})});}_0x16bce0=_[_0x0352('0x3f')]({},_0x16bce0,_0x3a1300['options']);return _0x1bf68e[_0x0352('0x4d')](_0x16bce0);}})[_0x0352('0x41')](function(_0x18156d){if(_0x18156d){_0x2d9b96=_0x18156d[_0x0352('0x38')];if(!_0x3a1300[_0x0352('0x33')][_0x0352('0x39')]('nolimit')){_0x16bce0['limit']=qs['limit'](_0x3a1300['query']['limit']);_0x16bce0[_0x0352('0x1f')]=qs[_0x0352('0x1f')](_0x3a1300[_0x0352('0x33')][_0x0352('0x1f')]);}return _0x1bf68e['getFields'](_0x16bce0);}})[_0x0352('0x41')](function(_0x2294fa){if(_0x2294fa){return _0x2294fa?{'count':_0x2d9b96,'rows':_0x2294fa}:null;}})[_0x0352('0x41')](respondWithResult(_0x5f31f1,null))[_0x0352('0x45')](handleError(_0x5f31f1,null));};exports['getSubjects']=function(_0x5ebec1,_0x8b33b8,_0x5b4e6b){var _0x1eabea={};var _0x5c2b4b={};var _0x3b56ad;var _0x314858;return db[_0x0352('0x2e')][_0x0352('0x50')]({'where':{'id':_0x5ebec1[_0x0352('0x4a')]['id']}})[_0x0352('0x41')](handleEntityNotFound(_0x8b33b8,null))[_0x0352('0x41')](function(_0xc42999){if(_0xc42999){_0x3b56ad=_0xc42999;_0x5c2b4b['model']=_[_0x0352('0x34')](db[_0x0352('0x4e')][_0x0352('0x2f')]);_0x5c2b4b[_0x0352('0x33')]=_[_0x0352('0x34')](_0x5ebec1['query']);_0x5c2b4b[_0x0352('0x3c')]=_[_0x0352('0x35')](_0x5c2b4b[_0x0352('0x32')],_0x5c2b4b[_0x0352('0x33')]);_0x1eabea[_0x0352('0x36')]=_[_0x0352('0x35')](_0x5c2b4b[_0x0352('0x32')],qs['fields'](_0x5ebec1[_0x0352('0x33')][_0x0352('0x37')]));_0x1eabea[_0x0352('0x36')]=_0x1eabea[_0x0352('0x36')][_0x0352('0x38')]?_0x1eabea['attributes']:_0x5c2b4b[_0x0352('0x32')];_0x1eabea[_0x0352('0x4f')]=qs['sort'](_0x5ebec1[_0x0352('0x33')][_0x0352('0x3a')]);_0x1eabea[_0x0352('0x3b')]=qs[_0x0352('0x3c')](_[_0x0352('0x3d')](_0x5ebec1[_0x0352('0x33')],_0x5c2b4b[_0x0352('0x3c')]));if(_0x5ebec1[_0x0352('0x33')][_0x0352('0x3e')]){_0x1eabea[_0x0352('0x3b')]=_[_0x0352('0x3f')](_0x1eabea['where'],{'$or':_[_0x0352('0x2d')](_0x1eabea['attributes'],function(_0x46f43d){var _0x1eeb04={};_0x1eeb04[_0x46f43d]={'$like':'%'+_0x5ebec1[_0x0352('0x33')][_0x0352('0x3e')]+'%'};return _0x1eeb04;})});}_0x1eabea=_[_0x0352('0x3f')]({},_0x1eabea,_0x5ebec1[_0x0352('0x47')]);return _0x3b56ad['getSubjects'](_0x1eabea);}})['then'](function(_0x579caf){if(_0x579caf){_0x314858=_0x579caf[_0x0352('0x38')];if(!_0x5ebec1[_0x0352('0x33')]['hasOwnProperty'](_0x0352('0x51'))){_0x1eabea[_0x0352('0x21')]=qs[_0x0352('0x21')](_0x5ebec1['query'][_0x0352('0x21')]);_0x1eabea[_0x0352('0x1f')]=qs[_0x0352('0x1f')](_0x5ebec1['query'][_0x0352('0x1f')]);}return _0x3b56ad['getSubjects'](_0x1eabea);}})['then'](function(_0x48d932){if(_0x48d932){return _0x48d932?{'count':_0x314858,'rows':_0x48d932}:null;}})['then'](respondWithResult(_0x8b33b8,null))[_0x0352('0x45')](handleError(_0x8b33b8,null));};exports[_0x0352('0x52')]=function(_0x545208,_0x410f8f,_0x5cfc33){var _0x27022f={};var _0x969a16={};var _0x36bdc2;var _0x375020;return db[_0x0352('0x2e')][_0x0352('0x50')]({'where':{'id':_0x545208['params']['id']}})[_0x0352('0x41')](handleEntityNotFound(_0x410f8f,null))[_0x0352('0x41')](function(_0x2b73b1){if(_0x2b73b1){_0x36bdc2=_0x2b73b1;_0x969a16[_0x0352('0x32')]=_[_0x0352('0x34')](db[_0x0352('0x4e')][_0x0352('0x2f')]);_0x969a16[_0x0352('0x33')]=_[_0x0352('0x34')](_0x545208['query']);_0x969a16[_0x0352('0x3c')]=_['intersection'](_0x969a16[_0x0352('0x32')],_0x969a16[_0x0352('0x33')]);_0x27022f[_0x0352('0x36')]=_[_0x0352('0x35')](_0x969a16[_0x0352('0x32')],qs[_0x0352('0x37')](_0x545208[_0x0352('0x33')]['fields']));_0x27022f[_0x0352('0x36')]=_0x27022f['attributes']['length']?_0x27022f[_0x0352('0x36')]:_0x969a16[_0x0352('0x32')];_0x27022f['order']=qs['sort'](_0x545208['query'][_0x0352('0x3a')]);_0x27022f['where']=qs[_0x0352('0x3c')](_[_0x0352('0x3d')](_0x545208[_0x0352('0x33')],_0x969a16['filters']));if(_0x545208[_0x0352('0x33')]['filter']){_0x27022f[_0x0352('0x3b')]=_[_0x0352('0x3f')](_0x27022f[_0x0352('0x3b')],{'$or':_[_0x0352('0x2d')](_0x27022f[_0x0352('0x36')],function(_0x281b42){var _0x471803={};_0x471803[_0x281b42]={'$like':'%'+_0x545208[_0x0352('0x33')][_0x0352('0x3e')]+'%'};return _0x471803;})});}_0x27022f=_[_0x0352('0x3f')]({},_0x27022f,_0x545208[_0x0352('0x47')]);return _0x36bdc2[_0x0352('0x52')](_0x27022f);}})['then'](function(_0x4c4cf3){if(_0x4c4cf3){_0x375020=_0x4c4cf3[_0x0352('0x38')];if(!_0x545208[_0x0352('0x33')][_0x0352('0x39')]('nolimit')){_0x27022f[_0x0352('0x21')]=qs['limit'](_0x545208[_0x0352('0x33')][_0x0352('0x21')]);_0x27022f[_0x0352('0x1f')]=qs[_0x0352('0x1f')](_0x545208[_0x0352('0x33')][_0x0352('0x1f')]);}return _0x36bdc2[_0x0352('0x52')](_0x27022f);}})[_0x0352('0x41')](function(_0x187a91){if(_0x187a91){return _0x187a91?{'count':_0x375020,'rows':_0x187a91}:null;}})[_0x0352('0x41')](respondWithResult(_0x410f8f,null))['catch'](handleError(_0x410f8f,null));};exports[_0x0352('0x53')]=function(_0xcd2b80,_0xb7bd3a,_0x35edea){var _0x1548ed={};var _0x261b51={};var _0x454dcd;var _0x3713ca;return db['DeskConfiguration'][_0x0352('0x50')]({'where':{'id':_0xcd2b80[_0x0352('0x4a')]['id']}})[_0x0352('0x41')](handleEntityNotFound(_0xb7bd3a,null))[_0x0352('0x41')](function(_0x311cc4){if(_0x311cc4){_0x454dcd=_0x311cc4;_0x261b51[_0x0352('0x32')]=_[_0x0352('0x34')](db['Tag'][_0x0352('0x2f')]);_0x261b51[_0x0352('0x33')]=_['keys'](_0xcd2b80[_0x0352('0x33')]);_0x261b51[_0x0352('0x3c')]=_[_0x0352('0x35')](_0x261b51['model'],_0x261b51['query']);_0x1548ed['attributes']=_['intersection'](_0x261b51[_0x0352('0x32')],qs[_0x0352('0x37')](_0xcd2b80[_0x0352('0x33')]['fields']));_0x1548ed[_0x0352('0x36')]=_0x1548ed['attributes'][_0x0352('0x38')]?_0x1548ed['attributes']:_0x261b51[_0x0352('0x32')];_0x1548ed[_0x0352('0x4f')]=qs[_0x0352('0x3a')](_0xcd2b80['query'][_0x0352('0x3a')]);_0x1548ed[_0x0352('0x3b')]=qs[_0x0352('0x3c')](_[_0x0352('0x3d')](_0xcd2b80[_0x0352('0x33')],_0x261b51[_0x0352('0x3c')]));if(_0xcd2b80[_0x0352('0x33')]['filter']){_0x1548ed[_0x0352('0x3b')]=_[_0x0352('0x3f')](_0x1548ed['where'],{'$or':_[_0x0352('0x2d')](_0x1548ed['attributes'],function(_0x366ccd){var _0x5639fb={};_0x5639fb[_0x366ccd]={'$like':'%'+_0xcd2b80['query'][_0x0352('0x3e')]+'%'};return _0x5639fb;})});}_0x1548ed=_['merge']({},_0x1548ed,_0xcd2b80[_0x0352('0x47')]);return _0x454dcd['getTags'](_0x1548ed);}})[_0x0352('0x41')](function(_0x21f6ee){if(_0x21f6ee){_0x3713ca=_0x21f6ee['length'];if(!_0xcd2b80['query']['hasOwnProperty'](_0x0352('0x51'))){_0x1548ed[_0x0352('0x21')]=qs[_0x0352('0x21')](_0xcd2b80['query'][_0x0352('0x21')]);_0x1548ed[_0x0352('0x1f')]=qs[_0x0352('0x1f')](_0xcd2b80[_0x0352('0x33')][_0x0352('0x1f')]);}return _0x454dcd['getTags'](_0x1548ed);}})[_0x0352('0x41')](function(_0x357311){if(_0x357311){return _0x357311?{'count':_0x3713ca,'rows':_0x357311}:null;}})['then'](respondWithResult(_0xb7bd3a,null))['catch'](handleError(_0xb7bd3a,null));};exports[_0x0352('0x54')]=function(_0x4dad33,_0x1a7a9b,_0x25fa9a){if(_0x4dad33['body']['id']){delete _0x4dad33[_0x0352('0x49')]['id'];}return db[_0x0352('0x2e')][_0x0352('0x50')]({'where':{'id':_0x4dad33[_0x0352('0x4a')]['id']}})[_0x0352('0x41')](handleEntityNotFound(_0x1a7a9b,null))[_0x0352('0x41')](function(_0x13ca75){if(_0x13ca75){return _0x13ca75[_0x0352('0x54')](_0x4dad33['body'][_0x0352('0x55')]||[]);}return null;})[_0x0352('0x41')](respondWithResult(_0x1a7a9b,null))[_0x0352('0x45')](handleError(_0x1a7a9b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index db1de51..203176c 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 _0xb5d5=['./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xb5d5,0x1c0));var _0x5b5d=function(_0xeffb06,_0x1f1b06){_0xeffb06=_0xeffb06-0x0;var _0x49cb13=_0xb5d5[_0xeffb06];return _0x49cb13;};'use strict';var _=require('lodash');var util=require(_0x5b5d('0x0'));var logger=require('../../config/logger')(_0x5b5d('0x1'));var moment=require(_0x5b5d('0x2'));var BPromise=require(_0x5b5d('0x3'));var rp=require(_0x5b5d('0x4'));var fs=require('fs');var path=require(_0x5b5d('0x5'));var rimraf=require(_0x5b5d('0x6'));var config=require(_0x5b5d('0x7'));var attributes=require(_0x5b5d('0x8'));module[_0x5b5d('0x9')]=function(_0x4bdedb,_0x579236){return _0x4bdedb[_0x5b5d('0xa')]('DeskConfiguration',attributes,{'tableName':_0x5b5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x720c=['./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0x720c,0x154));var _0xc720=function(_0x278ca2,_0x21e911){_0x278ca2=_0x278ca2-0x0;var _0x39ae01=_0x720c[_0x278ca2];return _0x39ae01;};'use strict';var _=require(_0xc720('0x0'));var util=require('util');var logger=require(_0xc720('0x1'))(_0xc720('0x2'));var moment=require(_0xc720('0x3'));var BPromise=require(_0xc720('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc720('0x5'));var rimraf=require(_0xc720('0x6'));var config=require(_0xc720('0x7'));var attributes=require(_0xc720('0x8'));module[_0xc720('0x9')]=function(_0x6f8d9f,_0x7d6830){return _0x6f8d9f['define'](_0xc720('0xa'),attributes,{'tableName':_0xc720('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 e4b9334..210ef6b 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 _0x6a6e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x6a6e,0xe3));var _0xe6a6=function(_0x2b1a89,_0x41fbef){_0x2b1a89=_0x2b1a89-0x0;var _0x25ff90=_0x6a6e[_0x2b1a89];return _0x25ff90;};'use strict';var _=require(_0xe6a6('0x0'));var util=require(_0xe6a6('0x1'));var moment=require('moment');var BPromise=require(_0xe6a6('0x2'));var rs=require(_0xe6a6('0x3'));var fs=require('fs');var Redis=require(_0xe6a6('0x4'));var db=require(_0xe6a6('0x5'))['db'];var utils=require(_0xe6a6('0x6'));var logger=require(_0xe6a6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe6a6('0x8'));var client=jayson[_0xe6a6('0x9')][_0xe6a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29ea12,_0x1e6dbb,_0x36bb6b){return new BPromise(function(_0x3b6b70,_0x2ed9cb){return client[_0xe6a6('0xb')](_0x29ea12,_0x36bb6b)[_0xe6a6('0xc')](function(_0x2620f2){logger[_0xe6a6('0xd')](_0xe6a6('0xe'),_0x1e6dbb,'request\x20sent');logger[_0xe6a6('0xf')](_0xe6a6('0x10'),_0x1e6dbb,_0xe6a6('0x11'),JSON[_0xe6a6('0x12')](_0x2620f2));if(_0x2620f2[_0xe6a6('0x13')]){if(_0x2620f2[_0xe6a6('0x13')][_0xe6a6('0x14')]===0x1f4){logger[_0xe6a6('0x13')](_0xe6a6('0xe'),_0x1e6dbb,_0x2620f2[_0xe6a6('0x13')]['message']);return _0x2ed9cb(_0x2620f2[_0xe6a6('0x13')][_0xe6a6('0x15')]);}logger[_0xe6a6('0x13')](_0xe6a6('0xe'),_0x1e6dbb,_0x2620f2[_0xe6a6('0x13')]['message']);return _0x3b6b70(_0x2620f2['error'][_0xe6a6('0x15')]);}else{logger[_0xe6a6('0xd')](_0xe6a6('0xe'),_0x1e6dbb,_0xe6a6('0x11'));_0x3b6b70(_0x2620f2['result']['message']);}})[_0xe6a6('0x16')](function(_0x1fb272){logger[_0xe6a6('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x1e6dbb,_0x1fb272);_0x2ed9cb(_0x1fb272);});});} \ No newline at end of file +var _0x11d1=['then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x162084,_0x2fbb98){var _0x4ca283=function(_0x5bd089){while(--_0x5bd089){_0x162084['push'](_0x162084['shift']());}};_0x4ca283(++_0x2fbb98);}(_0x11d1,0x184));var _0x111d=function(_0x5b329c,_0x531989){_0x5b329c=_0x5b329c-0x0;var _0x42fa47=_0x11d1[_0x5b329c];return _0x42fa47;};'use strict';var _=require(_0x111d('0x0'));var util=require('util');var moment=require(_0x111d('0x1'));var BPromise=require(_0x111d('0x2'));var rs=require(_0x111d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x111d('0x4'))['db'];var utils=require(_0x111d('0x5'));var logger=require(_0x111d('0x6'))('rpc');var config=require(_0x111d('0x7'));var jayson=require(_0x111d('0x8'));var client=jayson[_0x111d('0x9')][_0x111d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12b249,_0x497138,_0x4af8b4){return new BPromise(function(_0x1ba64c,_0xdf4197){return client['request'](_0x12b249,_0x4af8b4)[_0x111d('0xb')](function(_0xe864cf){logger['info'](_0x111d('0xc'),_0x497138,_0x111d('0xd'));logger[_0x111d('0xe')](_0x111d('0xf'),_0x497138,_0x111d('0xd'),JSON[_0x111d('0x10')](_0xe864cf));if(_0xe864cf[_0x111d('0x11')]){if(_0xe864cf[_0x111d('0x11')]['code']===0x1f4){logger[_0x111d('0x11')](_0x111d('0xc'),_0x497138,_0xe864cf[_0x111d('0x11')]['message']);return _0xdf4197(_0xe864cf['error'][_0x111d('0x12')]);}logger[_0x111d('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x497138,_0xe864cf['error'][_0x111d('0x12')]);return _0x1ba64c(_0xe864cf[_0x111d('0x11')]['message']);}else{logger['info'](_0x111d('0xc'),_0x497138,'request\x20sent');_0x1ba64c(_0xe864cf[_0x111d('0x13')]['message']);}})[_0x111d('0x14')](function(_0x38b393){logger[_0x111d('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x497138,_0x38b393);_0xdf4197(_0x38b393);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 9414bca..bf4a102 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 _0xa596=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','put','update'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xa596,0x7b));var _0x6a59=function(_0x5babaf,_0x375c53){_0x5babaf=_0x5babaf-0x0;var _0x288102=_0xa596[_0x5babaf];return _0x288102;};'use strict';var multer=require(_0x6a59('0x0'));var util=require(_0x6a59('0x1'));var path=require('path');var timeout=require(_0x6a59('0x2'));var express=require(_0x6a59('0x3'));var router=express[_0x6a59('0x4')]();var fs_extra=require(_0x6a59('0x5'));var auth=require(_0x6a59('0x6'));var interaction=require(_0x6a59('0x7'));var config=require(_0x6a59('0x8'));var controller=require(_0x6a59('0x9'));router['get']('/',auth[_0x6a59('0xa')](),controller[_0x6a59('0xb')]);router[_0x6a59('0xc')](_0x6a59('0xd'),auth[_0x6a59('0xa')](),controller[_0x6a59('0xe')]);router['post']('/',auth[_0x6a59('0xa')](),controller['create']);router[_0x6a59('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6a59('0x10')]);router[_0x6a59('0x11')](_0x6a59('0xd'),auth['isAuthenticated'](),controller[_0x6a59('0x12')]);module[_0x6a59('0x13')]=router; \ No newline at end of file +var _0x7eb7=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','exports','multer','path'];(function(_0x209302,_0x5826ac){var _0x1df8e9=function(_0x16ae49){while(--_0x16ae49){_0x209302['push'](_0x209302['shift']());}};_0x1df8e9(++_0x5826ac);}(_0x7eb7,0xfd));var _0x77eb=function(_0x2db63f,_0x1f95ca){_0x2db63f=_0x2db63f-0x0;var _0x1b6038=_0x7eb7[_0x2db63f];return _0x1b6038;};'use strict';var multer=require(_0x77eb('0x0'));var util=require('util');var path=require(_0x77eb('0x1'));var timeout=require(_0x77eb('0x2'));var express=require('express');var router=express[_0x77eb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x77eb('0x4'));var interaction=require(_0x77eb('0x5'));var config=require(_0x77eb('0x6'));var controller=require(_0x77eb('0x7'));router[_0x77eb('0x8')]('/',auth[_0x77eb('0x9')](),controller[_0x77eb('0xa')]);router[_0x77eb('0x8')](_0x77eb('0xb'),auth[_0x77eb('0x9')](),controller[_0x77eb('0xc')]);router[_0x77eb('0xd')]('/',auth['isAuthenticated'](),controller[_0x77eb('0xe')]);router['put'](_0x77eb('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x77eb('0xf')](_0x77eb('0xb'),auth[_0x77eb('0x9')](),controller['destroy']);module[_0x77eb('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 093c710..862842a 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 _0xbd82=['string','variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM'];(function(_0x5ecde2,_0x6eac96){var _0x489d69=function(_0x16debe){while(--_0x16debe){_0x5ecde2['push'](_0x5ecde2['shift']());}};_0x489d69(++_0x6eac96);}(_0xbd82,0x186));var _0x2bd8=function(_0x361954,_0x591aec){_0x361954=_0x361954-0x0;var _0x18538a=_0xbd82[_0x361954];return _0x18538a;};'use strict';var Sequelize=require('sequelize');module[_0x2bd8('0x0')]={'type':{'type':Sequelize[_0x2bd8('0x1')](_0x2bd8('0x2'),_0x2bd8('0x3'),_0x2bd8('0x4'),_0x2bd8('0x5'),'picklist'),'defaultValue':_0x2bd8('0x2')},'content':{'type':Sequelize[_0x2bd8('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2bd8('0x1')](_0x2bd8('0x2'),_0x2bd8('0x3'),_0x2bd8('0x4'))},'keyContent':{'type':Sequelize[_0x2bd8('0x6')]},'idField':{'type':Sequelize[_0x2bd8('0x6')]},'nameField':{'type':Sequelize[_0x2bd8('0x6')]},'customField':{'type':Sequelize[_0x2bd8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2bd8('0x6')]}}; \ No newline at end of file +var _0xc889=['BOOLEAN','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc889,0x121));var _0x9c88=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xc889[_0x172747];return _0x509692;};'use strict';var Sequelize=require('sequelize');module[_0x9c88('0x0')]={'type':{'type':Sequelize[_0x9c88('0x1')](_0x9c88('0x2'),_0x9c88('0x3'),_0x9c88('0x4'),'keyValue',_0x9c88('0x5')),'defaultValue':_0x9c88('0x2')},'content':{'type':Sequelize[_0x9c88('0x6')]},'key':{'type':Sequelize[_0x9c88('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9c88('0x3'),_0x9c88('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9c88('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9c88('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9c88('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index f37d1c4..38acdff 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 _0xdbfa=['options','find','create','body','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','then','includeAll','findAll','rows','catch','show','params','include'];(function(_0x5d24df,_0x44b3db){var _0x386f69=function(_0x2803bb){while(--_0x2803bb){_0x5d24df['push'](_0x5d24df['shift']());}};_0x386f69(++_0x44b3db);}(_0xdbfa,0x128));var _0xadbf=function(_0x33258c,_0x3c9c64){_0x33258c=_0x33258c-0x0;var _0x432bae=_0xdbfa[_0x33258c];return _0x432bae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xadbf('0x0'));var rp=require('request-promise');var moment=require(_0xadbf('0x1'));var BPromise=require(_0xadbf('0x2'));var Mustache=require('mustache');var util=require(_0xadbf('0x3'));var path=require(_0xadbf('0x4'));var sox=require(_0xadbf('0x5'));var csv=require(_0xadbf('0x6'));var ejs=require(_0xadbf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadbf('0x8'));var squel=require(_0xadbf('0x9'));var crypto=require(_0xadbf('0xa'));var jsforce=require(_0xadbf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xadbf('0x6'));var querystring=require(_0xadbf('0xc'));var Papa=require(_0xadbf('0xd'));var Redis=require('ioredis');var authService=require(_0xadbf('0xe'));var qs=require(_0xadbf('0xf'));var as=require(_0xadbf('0x10'));var hardwareService=require(_0xadbf('0x11'));var logger=require(_0xadbf('0x12'))(_0xadbf('0x13'));var utils=require(_0xadbf('0x14'));var config=require(_0xadbf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xadbf('0x16'))['db'];function respondWithStatusCode(_0x174f2e,_0x4855e5){_0x4855e5=_0x4855e5||0xcc;return function(_0x1bfce4){if(_0x1bfce4){return _0x174f2e[_0xadbf('0x17')](_0x4855e5);}return _0x174f2e['status'](_0x4855e5)['end']();};}function respondWithResult(_0x1ec136,_0x58fa1b){_0x58fa1b=_0x58fa1b||0xc8;return function(_0x2ff34c){if(_0x2ff34c){return _0x1ec136[_0xadbf('0x18')](_0x58fa1b)[_0xadbf('0x19')](_0x2ff34c);}};}function respondWithFilteredResult(_0x44b187,_0x109788){return function(_0x3c4899){if(_0x3c4899){var _0x1008e5=typeof _0x109788[_0xadbf('0x1a')]===_0xadbf('0x1b')&&typeof _0x109788[_0xadbf('0x1c')]===_0xadbf('0x1b');var _0x3e9de1=_0x3c4899['count'];var _0x1b8639=_0x1008e5?0x0:_0x109788[_0xadbf('0x1a')];var _0x38e3f2=_0x1008e5?_0x3c4899[_0xadbf('0x1d')]:_0x109788[_0xadbf('0x1a')]+_0x109788[_0xadbf('0x1c')];var _0x5dfbdf;if(_0x38e3f2>=_0x3e9de1){_0x38e3f2=_0x3e9de1;_0x5dfbdf=0xc8;}else{_0x5dfbdf=0xce;}_0x44b187[_0xadbf('0x18')](_0x5dfbdf);return _0x44b187[_0xadbf('0x1e')](_0xadbf('0x1f'),_0x1b8639+'-'+_0x38e3f2+'/'+_0x3e9de1)[_0xadbf('0x19')](_0x3c4899);}return null;};}function patchUpdates(_0x38a7e4){return function(_0x12536e){try{jsonpatch[_0xadbf('0x20')](_0x12536e,_0x38a7e4,!![]);}catch(_0x1a7f27){return BPromise[_0xadbf('0x21')](_0x1a7f27);}return _0x12536e['save']();};}function saveUpdates(_0x349f1e,_0x252d51){return function(_0x1c871f){if(_0x1c871f){return _0x1c871f[_0xadbf('0x22')](_0x349f1e)['then'](function(_0x333b57){return _0x333b57;});}return null;};}function removeEntity(_0x3f9e1b,_0x1d49c6){return function(_0x34f042){if(_0x34f042){return _0x34f042[_0xadbf('0x23')]()['then'](function(){_0x3f9e1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52da57,_0x31f9c8){return function(_0x9dbbd8){if(!_0x9dbbd8){_0x52da57[_0xadbf('0x17')](0x194);}return _0x9dbbd8;};}function handleError(_0x3c6946,_0x3d7f06){_0x3d7f06=_0x3d7f06||0x1f4;return function(_0x5a17e7){logger[_0xadbf('0x24')](_0x5a17e7[_0xadbf('0x25')]);if(_0x5a17e7[_0xadbf('0x26')]){delete _0x5a17e7['name'];}_0x3c6946[_0xadbf('0x18')](_0x3d7f06)[_0xadbf('0x27')](_0x5a17e7);};}exports[_0xadbf('0x28')]=function(_0x2dcda1,_0x2f3990){var _0x10a0bc={},_0x35d8ba={},_0x56e624={'count':0x0,'rows':[]};var _0x4d1015=_[_0xadbf('0x29')](db[_0xadbf('0x2a')][_0xadbf('0x2b')],function(_0x47a027){return{'name':_0x47a027[_0xadbf('0x2c')],'type':_0x47a027[_0xadbf('0x2d')][_0xadbf('0x2e')]};});_0x35d8ba['model']=_[_0xadbf('0x29')](_0x4d1015,_0xadbf('0x26'));_0x35d8ba['query']=_[_0xadbf('0x2f')](_0x2dcda1[_0xadbf('0x30')]);_0x35d8ba[_0xadbf('0x31')]=_[_0xadbf('0x32')](_0x35d8ba[_0xadbf('0x33')],_0x35d8ba[_0xadbf('0x30')]);_0x10a0bc[_0xadbf('0x34')]=_[_0xadbf('0x32')](_0x35d8ba[_0xadbf('0x33')],qs[_0xadbf('0x35')](_0x2dcda1[_0xadbf('0x30')][_0xadbf('0x35')]));_0x10a0bc[_0xadbf('0x34')]=_0x10a0bc['attributes'][_0xadbf('0x36')]?_0x10a0bc['attributes']:_0x35d8ba[_0xadbf('0x33')];if(!_0x2dcda1[_0xadbf('0x30')][_0xadbf('0x37')](_0xadbf('0x38'))){_0x10a0bc[_0xadbf('0x1c')]=qs[_0xadbf('0x1c')](_0x2dcda1[_0xadbf('0x30')][_0xadbf('0x1c')]);_0x10a0bc[_0xadbf('0x1a')]=qs[_0xadbf('0x1a')](_0x2dcda1[_0xadbf('0x30')][_0xadbf('0x1a')]);}_0x10a0bc['order']=qs[_0xadbf('0x39')](_0x2dcda1[_0xadbf('0x30')][_0xadbf('0x39')]);_0x10a0bc[_0xadbf('0x3a')]=qs[_0xadbf('0x31')](_['pick'](_0x2dcda1[_0xadbf('0x30')],_0x35d8ba[_0xadbf('0x31')]),_0x4d1015);if(_0x2dcda1[_0xadbf('0x30')][_0xadbf('0x3b')]){_0x10a0bc[_0xadbf('0x3a')]=_[_0xadbf('0x3c')](_0x10a0bc[_0xadbf('0x3a')],{'$or':_[_0xadbf('0x29')](_0x4d1015,function(_0x436cd8){if(_0x436cd8[_0xadbf('0x2d')]!=='VIRTUAL'){var _0x52ee56={};_0x52ee56[_0x436cd8['name']]={'$like':'%'+_0x2dcda1['query'][_0xadbf('0x3b')]+'%'};return _0x52ee56;}})});}_0x10a0bc=_['merge']({},_0x10a0bc,_0x2dcda1['options']);var _0x524665={'where':_0x10a0bc[_0xadbf('0x3a')]};return db['DeskField'][_0xadbf('0x1d')](_0x524665)[_0xadbf('0x3d')](function(_0x404060){_0x56e624['count']=_0x404060;if(_0x2dcda1['query'][_0xadbf('0x3e')]){_0x10a0bc['include']=[{'all':!![]}];}return db['DeskField'][_0xadbf('0x3f')](_0x10a0bc);})[_0xadbf('0x3d')](function(_0x31f039){_0x56e624[_0xadbf('0x40')]=_0x31f039;return _0x56e624;})[_0xadbf('0x3d')](respondWithFilteredResult(_0x2f3990,_0x10a0bc))[_0xadbf('0x41')](handleError(_0x2f3990,null));};exports[_0xadbf('0x42')]=function(_0x31888c,_0x25dab9){var _0x3fec4d={'raw':!![],'where':{'id':_0x31888c[_0xadbf('0x43')]['id']}},_0x269bd3={};_0x269bd3[_0xadbf('0x33')]=_['keys'](db[_0xadbf('0x2a')][_0xadbf('0x2b')]);_0x269bd3[_0xadbf('0x30')]=_[_0xadbf('0x2f')](_0x31888c[_0xadbf('0x30')]);_0x269bd3[_0xadbf('0x31')]=_[_0xadbf('0x32')](_0x269bd3[_0xadbf('0x33')],_0x269bd3[_0xadbf('0x30')]);_0x3fec4d[_0xadbf('0x34')]=_[_0xadbf('0x32')](_0x269bd3[_0xadbf('0x33')],qs['fields'](_0x31888c[_0xadbf('0x30')][_0xadbf('0x35')]));_0x3fec4d[_0xadbf('0x34')]=_0x3fec4d['attributes'][_0xadbf('0x36')]?_0x3fec4d[_0xadbf('0x34')]:_0x269bd3[_0xadbf('0x33')];if(_0x31888c[_0xadbf('0x30')][_0xadbf('0x3e')]){_0x3fec4d[_0xadbf('0x44')]=[{'all':!![]}];}_0x3fec4d=_['merge']({},_0x3fec4d,_0x31888c[_0xadbf('0x45')]);return db[_0xadbf('0x2a')][_0xadbf('0x46')](_0x3fec4d)[_0xadbf('0x3d')](handleEntityNotFound(_0x25dab9,null))[_0xadbf('0x3d')](respondWithResult(_0x25dab9,null))[_0xadbf('0x41')](handleError(_0x25dab9,null));};exports[_0xadbf('0x47')]=function(_0x5e92c5,_0x1f7fe3){return db[_0xadbf('0x2a')][_0xadbf('0x47')](_0x5e92c5[_0xadbf('0x48')],{})['then'](respondWithResult(_0x1f7fe3,0xc9))['catch'](handleError(_0x1f7fe3,null));};exports[_0xadbf('0x22')]=function(_0x449ce2,_0x4270b1){if(_0x449ce2['body']['id']){delete _0x449ce2[_0xadbf('0x48')]['id'];}return db[_0xadbf('0x2a')][_0xadbf('0x46')]({'where':{'id':_0x449ce2[_0xadbf('0x43')]['id']}})[_0xadbf('0x3d')](handleEntityNotFound(_0x4270b1,null))[_0xadbf('0x3d')](saveUpdates(_0x449ce2[_0xadbf('0x48')],null))[_0xadbf('0x3d')](respondWithResult(_0x4270b1,null))['catch'](handleError(_0x4270b1,null));};exports['destroy']=function(_0x179d5e,_0x25ff7e){return db[_0xadbf('0x2a')][_0xadbf('0x46')]({'where':{'id':_0x179d5e[_0xadbf('0x43')]['id']}})[_0xadbf('0x3d')](handleEntityNotFound(_0x25ff7e,null))['then'](removeEntity(_0x25ff7e,null))['catch'](handleError(_0x25ff7e,null));}; \ No newline at end of file +var _0x625a=['../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','params','find','create','body','catch','update','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x351224,_0xe0a0b6){var _0x3062b6=function(_0x26ae3d){while(--_0x26ae3d){_0x351224['push'](_0x351224['shift']());}};_0x3062b6(++_0xe0a0b6);}(_0x625a,0x15a));var _0xa625=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x625a[_0xe3e0af];return _0x4828e9;};'use strict';var emlformat=require(_0xa625('0x0'));var rimraf=require(_0xa625('0x1'));var zipdir=require(_0xa625('0x2'));var jsonpatch=require(_0xa625('0x3'));var rp=require(_0xa625('0x4'));var moment=require(_0xa625('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa625('0x6'));var util=require(_0xa625('0x7'));var path=require('path');var sox=require(_0xa625('0x8'));var csv=require(_0xa625('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa625('0xa'));var _=require(_0xa625('0xb'));var squel=require(_0xa625('0xc'));var crypto=require('crypto');var jsforce=require(_0xa625('0xd'));var deskjs=require(_0xa625('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa625('0xf'));var Papa=require(_0xa625('0x10'));var Redis=require(_0xa625('0x11'));var authService=require(_0xa625('0x12'));var qs=require(_0xa625('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa625('0x14'));var logger=require('../../config/logger')(_0xa625('0x15'));var utils=require('../../config/utils');var config=require(_0xa625('0x16'));var licenseUtil=require(_0xa625('0x17'));var db=require(_0xa625('0x18'))['db'];function respondWithStatusCode(_0x86e1b7,_0x5c84a8){_0x5c84a8=_0x5c84a8||0xcc;return function(_0x5d3008){if(_0x5d3008){return _0x86e1b7['sendStatus'](_0x5c84a8);}return _0x86e1b7[_0xa625('0x19')](_0x5c84a8)[_0xa625('0x1a')]();};}function respondWithResult(_0x32cacd,_0x1c2b88){_0x1c2b88=_0x1c2b88||0xc8;return function(_0x114faa){if(_0x114faa){return _0x32cacd[_0xa625('0x19')](_0x1c2b88)[_0xa625('0x1b')](_0x114faa);}};}function respondWithFilteredResult(_0x1a68a2,_0x29454a){return function(_0x47b468){if(_0x47b468){var _0x5bff98=typeof _0x29454a['offset']==='undefined'&&typeof _0x29454a[_0xa625('0x1c')]==='undefined';var _0x17f0da=_0x47b468[_0xa625('0x1d')];var _0x149947=_0x5bff98?0x0:_0x29454a[_0xa625('0x1e')];var _0x4cb4f8=_0x5bff98?_0x47b468[_0xa625('0x1d')]:_0x29454a['offset']+_0x29454a['limit'];var _0x27cff9;if(_0x4cb4f8>=_0x17f0da){_0x4cb4f8=_0x17f0da;_0x27cff9=0xc8;}else{_0x27cff9=0xce;}_0x1a68a2[_0xa625('0x19')](_0x27cff9);return _0x1a68a2[_0xa625('0x1f')](_0xa625('0x20'),_0x149947+'-'+_0x4cb4f8+'/'+_0x17f0da)[_0xa625('0x1b')](_0x47b468);}return null;};}function patchUpdates(_0x5db359){return function(_0x3ddb0d){try{jsonpatch['apply'](_0x3ddb0d,_0x5db359,!![]);}catch(_0x412642){return BPromise[_0xa625('0x21')](_0x412642);}return _0x3ddb0d[_0xa625('0x22')]();};}function saveUpdates(_0x3012ea,_0x1ebda1){return function(_0x249e13){if(_0x249e13){return _0x249e13['update'](_0x3012ea)[_0xa625('0x23')](function(_0x45a3d7){return _0x45a3d7;});}return null;};}function removeEntity(_0x3aa348,_0xe308ba){return function(_0x495df7){if(_0x495df7){return _0x495df7[_0xa625('0x24')]()['then'](function(){_0x3aa348['status'](0xcc)[_0xa625('0x1a')]();});}};}function handleEntityNotFound(_0x251315,_0x224562){return function(_0x432265){if(!_0x432265){_0x251315[_0xa625('0x25')](0x194);}return _0x432265;};}function handleError(_0x2c40a9,_0x440cbc){_0x440cbc=_0x440cbc||0x1f4;return function(_0x26b9c5){logger[_0xa625('0x26')](_0x26b9c5[_0xa625('0x27')]);if(_0x26b9c5[_0xa625('0x28')]){delete _0x26b9c5[_0xa625('0x28')];}_0x2c40a9[_0xa625('0x19')](_0x440cbc)[_0xa625('0x29')](_0x26b9c5);};}exports[_0xa625('0x2a')]=function(_0x1e6496,_0x271056){var _0xb0dad9={},_0xc12f22={},_0x44f216={'count':0x0,'rows':[]};var _0x31e023=_['map'](db[_0xa625('0x2b')][_0xa625('0x2c')],function(_0x4b1ab9){return{'name':_0x4b1ab9[_0xa625('0x2d')],'type':_0x4b1ab9[_0xa625('0x2e')]['key']};});_0xc12f22[_0xa625('0x2f')]=_['map'](_0x31e023,_0xa625('0x28'));_0xc12f22[_0xa625('0x30')]=_[_0xa625('0x31')](_0x1e6496[_0xa625('0x30')]);_0xc12f22[_0xa625('0x32')]=_['intersection'](_0xc12f22[_0xa625('0x2f')],_0xc12f22['query']);_0xb0dad9[_0xa625('0x33')]=_[_0xa625('0x34')](_0xc12f22[_0xa625('0x2f')],qs['fields'](_0x1e6496[_0xa625('0x30')][_0xa625('0x35')]));_0xb0dad9[_0xa625('0x33')]=_0xb0dad9[_0xa625('0x33')][_0xa625('0x36')]?_0xb0dad9['attributes']:_0xc12f22[_0xa625('0x2f')];if(!_0x1e6496[_0xa625('0x30')][_0xa625('0x37')](_0xa625('0x38'))){_0xb0dad9[_0xa625('0x1c')]=qs['limit'](_0x1e6496[_0xa625('0x30')][_0xa625('0x1c')]);_0xb0dad9[_0xa625('0x1e')]=qs[_0xa625('0x1e')](_0x1e6496[_0xa625('0x30')][_0xa625('0x1e')]);}_0xb0dad9['order']=qs[_0xa625('0x39')](_0x1e6496[_0xa625('0x30')][_0xa625('0x39')]);_0xb0dad9[_0xa625('0x3a')]=qs[_0xa625('0x32')](_[_0xa625('0x3b')](_0x1e6496[_0xa625('0x30')],_0xc12f22[_0xa625('0x32')]),_0x31e023);if(_0x1e6496[_0xa625('0x30')][_0xa625('0x3c')]){_0xb0dad9[_0xa625('0x3a')]=_[_0xa625('0x3d')](_0xb0dad9[_0xa625('0x3a')],{'$or':_[_0xa625('0x3e')](_0x31e023,function(_0x1cf4cd){if(_0x1cf4cd[_0xa625('0x2e')]!==_0xa625('0x3f')){var _0x31880c={};_0x31880c[_0x1cf4cd[_0xa625('0x28')]]={'$like':'%'+_0x1e6496[_0xa625('0x30')][_0xa625('0x3c')]+'%'};return _0x31880c;}})});}_0xb0dad9=_['merge']({},_0xb0dad9,_0x1e6496[_0xa625('0x40')]);var _0x35a023={'where':_0xb0dad9[_0xa625('0x3a')]};return db[_0xa625('0x2b')][_0xa625('0x1d')](_0x35a023)['then'](function(_0x1028b0){_0x44f216[_0xa625('0x1d')]=_0x1028b0;if(_0x1e6496['query'][_0xa625('0x41')]){_0xb0dad9['include']=[{'all':!![]}];}return db[_0xa625('0x2b')][_0xa625('0x42')](_0xb0dad9);})[_0xa625('0x23')](function(_0x40b645){_0x44f216[_0xa625('0x43')]=_0x40b645;return _0x44f216;})[_0xa625('0x23')](respondWithFilteredResult(_0x271056,_0xb0dad9))['catch'](handleError(_0x271056,null));};exports['show']=function(_0x3d8211,_0x5719d1){var _0x337fe3={'raw':!![],'where':{'id':_0x3d8211[_0xa625('0x44')]['id']}},_0x54d06d={};_0x54d06d[_0xa625('0x2f')]=_[_0xa625('0x31')](db['DeskField'][_0xa625('0x2c')]);_0x54d06d[_0xa625('0x30')]=_['keys'](_0x3d8211[_0xa625('0x30')]);_0x54d06d[_0xa625('0x32')]=_[_0xa625('0x34')](_0x54d06d[_0xa625('0x2f')],_0x54d06d[_0xa625('0x30')]);_0x337fe3['attributes']=_[_0xa625('0x34')](_0x54d06d[_0xa625('0x2f')],qs[_0xa625('0x35')](_0x3d8211[_0xa625('0x30')]['fields']));_0x337fe3[_0xa625('0x33')]=_0x337fe3['attributes'][_0xa625('0x36')]?_0x337fe3[_0xa625('0x33')]:_0x54d06d[_0xa625('0x2f')];if(_0x3d8211['query']['includeAll']){_0x337fe3['include']=[{'all':!![]}];}_0x337fe3=_['merge']({},_0x337fe3,_0x3d8211['options']);return db[_0xa625('0x2b')][_0xa625('0x45')](_0x337fe3)['then'](handleEntityNotFound(_0x5719d1,null))[_0xa625('0x23')](respondWithResult(_0x5719d1,null))['catch'](handleError(_0x5719d1,null));};exports[_0xa625('0x46')]=function(_0x92aad0,_0x240ee1){return db['DeskField'][_0xa625('0x46')](_0x92aad0[_0xa625('0x47')],{})[_0xa625('0x23')](respondWithResult(_0x240ee1,0xc9))[_0xa625('0x48')](handleError(_0x240ee1,null));};exports[_0xa625('0x49')]=function(_0x18f694,_0xc2be00){if(_0x18f694[_0xa625('0x47')]['id']){delete _0x18f694[_0xa625('0x47')]['id'];}return db[_0xa625('0x2b')][_0xa625('0x45')]({'where':{'id':_0x18f694[_0xa625('0x44')]['id']}})[_0xa625('0x23')](handleEntityNotFound(_0xc2be00,null))['then'](saveUpdates(_0x18f694['body'],null))[_0xa625('0x23')](respondWithResult(_0xc2be00,null))['catch'](handleError(_0xc2be00,null));};exports['destroy']=function(_0x5d1902,_0x13ffc4){return db[_0xa625('0x2b')][_0xa625('0x45')]({'where':{'id':_0x5d1902[_0xa625('0x44')]['id']}})[_0xa625('0x23')](handleEntityNotFound(_0x13ffc4,null))[_0xa625('0x23')](removeEntity(_0x13ffc4,null))[_0xa625('0x48')](handleError(_0x13ffc4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index e6514f5..fa06c16 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 _0x0bda=['idField','FieldId','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0x0bda,0x1c9));var _0xa0bd=function(_0x5de4e2,_0x594768){_0x5de4e2=_0x5de4e2-0x0;var _0xb8d67e=_0x0bda[_0x5de4e2];return _0xb8d67e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa0bd('0x0'))(_0xa0bd('0x1'));var moment=require(_0xa0bd('0x2'));var BPromise=require(_0xa0bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa0bd('0x4'));var config=require(_0xa0bd('0x5'));var attributes=require(_0xa0bd('0x6'));module[_0xa0bd('0x7')]=function(_0x8710ee,_0x584d77){return _0x8710ee[_0xa0bd('0x8')](_0xa0bd('0x9'),attributes,{'tableName':_0xa0bd('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xa0bd('0xb'),_0xa0bd('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7d1=['DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xe7d1,0x195));var _0x1e7d=function(_0xe3edaf,_0x499dd3){_0xe3edaf=_0xe3edaf-0x0;var _0x626855=_0xe7d1[_0xe3edaf];return _0x626855;};'use strict';var _=require(_0x1e7d('0x0'));var util=require('util');var logger=require(_0x1e7d('0x1'))('api');var moment=require(_0x1e7d('0x2'));var BPromise=require(_0x1e7d('0x3'));var rp=require(_0x1e7d('0x4'));var fs=require('fs');var path=require(_0x1e7d('0x5'));var rimraf=require(_0x1e7d('0x6'));var config=require(_0x1e7d('0x7'));var attributes=require(_0x1e7d('0x8'));module[_0x1e7d('0x9')]=function(_0x1b7f93,_0x46ba11){return _0x1b7f93[_0x1e7d('0xa')](_0x1e7d('0xb'),attributes,{'tableName':_0x1e7d('0xc'),'paranoid':![],'indexes':[{'name':_0x1e7d('0xd'),'fields':[_0x1e7d('0xe'),_0x1e7d('0xf')],'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 ef398dd..db1d153 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 _0x1722=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring'];(function(_0x515849,_0x30074d){var _0x3f1a8b=function(_0x5e3b6d){while(--_0x5e3b6d){_0x515849['push'](_0x515849['shift']());}};_0x3f1a8b(++_0x30074d);}(_0x1722,0x1c9));var _0x2172=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1722[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x2172('0x0'));var moment=require(_0x2172('0x1'));var BPromise=require('bluebird');var rs=require(_0x2172('0x2'));var fs=require('fs');var Redis=require(_0x2172('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2172('0x4'))(_0x2172('0x5'));var config=require(_0x2172('0x6'));var jayson=require(_0x2172('0x7'));var client=jayson[_0x2172('0x8')][_0x2172('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bf513,_0x538c16,_0x359752){return new BPromise(function(_0x557375,_0xadb9a1){return client['request'](_0x5bf513,_0x359752)[_0x2172('0xa')](function(_0x46fe31){logger[_0x2172('0xb')](_0x2172('0xc'),_0x538c16,_0x2172('0xd'));logger[_0x2172('0xe')](_0x2172('0xf'),_0x538c16,_0x2172('0xd'),JSON[_0x2172('0x10')](_0x46fe31));if(_0x46fe31[_0x2172('0x11')]){if(_0x46fe31['error'][_0x2172('0x12')]===0x1f4){logger['error'](_0x2172('0xc'),_0x538c16,_0x46fe31[_0x2172('0x11')][_0x2172('0x13')]);return _0xadb9a1(_0x46fe31[_0x2172('0x11')][_0x2172('0x13')]);}logger[_0x2172('0x11')](_0x2172('0xc'),_0x538c16,_0x46fe31[_0x2172('0x11')][_0x2172('0x13')]);return _0x557375(_0x46fe31['error'][_0x2172('0x13')]);}else{logger[_0x2172('0xb')](_0x2172('0xc'),_0x538c16,_0x2172('0xd'));_0x557375(_0x46fe31['result']['message']);}})['catch'](function(_0x47505c){logger['error'](_0x2172('0xc'),_0x538c16,_0x47505c);_0xadb9a1(_0x47505c);});});} \ No newline at end of file +var _0x0a55=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a55,0xaa));var _0x50a5=function(_0x48a15e,_0xf04be3){_0x48a15e=_0x48a15e-0x0;var _0x1938b7=_0x0a55[_0x48a15e];return _0x1938b7;};'use strict';var _=require('lodash');var util=require(_0x50a5('0x0'));var moment=require(_0x50a5('0x1'));var BPromise=require('bluebird');var rs=require(_0x50a5('0x2'));var fs=require('fs');var Redis=require(_0x50a5('0x3'));var db=require(_0x50a5('0x4'))['db'];var utils=require(_0x50a5('0x5'));var logger=require(_0x50a5('0x6'))(_0x50a5('0x7'));var config=require(_0x50a5('0x8'));var jayson=require(_0x50a5('0x9'));var client=jayson[_0x50a5('0xa')][_0x50a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d3f09,_0x3442bc,_0x66f4ae){return new BPromise(function(_0x442884,_0x3974d3){return client[_0x50a5('0xc')](_0x2d3f09,_0x66f4ae)[_0x50a5('0xd')](function(_0x1cbc54){logger[_0x50a5('0xe')](_0x50a5('0xf'),_0x3442bc,'request\x20sent');logger[_0x50a5('0x10')](_0x50a5('0x11'),_0x3442bc,_0x50a5('0x12'),JSON[_0x50a5('0x13')](_0x1cbc54));if(_0x1cbc54[_0x50a5('0x14')]){if(_0x1cbc54[_0x50a5('0x14')][_0x50a5('0x15')]===0x1f4){logger[_0x50a5('0x14')](_0x50a5('0xf'),_0x3442bc,_0x1cbc54[_0x50a5('0x14')][_0x50a5('0x16')]);return _0x3974d3(_0x1cbc54['error']['message']);}logger[_0x50a5('0x14')](_0x50a5('0xf'),_0x3442bc,_0x1cbc54['error'][_0x50a5('0x16')]);return _0x442884(_0x1cbc54[_0x50a5('0x14')][_0x50a5('0x16')]);}else{logger[_0x50a5('0xe')](_0x50a5('0xf'),_0x3442bc,'request\x20sent');_0x442884(_0x1cbc54[_0x50a5('0x17')][_0x50a5('0x16')]);}})[_0x50a5('0x18')](function(_0x5a69a1){logger[_0x50a5('0x14')](_0x50a5('0xf'),_0x3442bc,_0x5a69a1);_0x3974d3(_0x5a69a1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a1a5ec2..17bf033 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 _0x26d5=['../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x530976,_0x9d43cf){var _0xe8f5f5=function(_0x40cdff){while(--_0x40cdff){_0x530976['push'](_0x530976['shift']());}};_0xe8f5f5(++_0x9d43cf);}(_0x26d5,0x158));var _0x526d=function(_0x4d6756,_0x3a15ae){_0x4d6756=_0x4d6756-0x0;var _0x4a14bd=_0x26d5[_0x4d6756];return _0x4a14bd;};'use strict';var multer=require(_0x526d('0x0'));var util=require('util');var path=require(_0x526d('0x1'));var timeout=require(_0x526d('0x2'));var express=require(_0x526d('0x3'));var router=express[_0x526d('0x4')]();var fs_extra=require(_0x526d('0x5'));var auth=require(_0x526d('0x6'));var interaction=require(_0x526d('0x7'));var config=require(_0x526d('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x526d('0x9')]('/',auth[_0x526d('0xa')](),controller[_0x526d('0xb')]);router['get'](_0x526d('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x526d('0xd'),auth['isAuthenticated'](),controller[_0x526d('0xe')]);router[_0x526d('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x526d('0xf')]);router['post']('/',auth[_0x526d('0xa')](),controller[_0x526d('0x10')]);router[_0x526d('0x11')](_0x526d('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x526d('0xc'),auth[_0x526d('0xa')](),controller[_0x526d('0x12')]);router[_0x526d('0x13')](_0x526d('0xc'),auth['isAuthenticated'](),controller[_0x526d('0x14')]);module[_0x526d('0x15')]=router; \ No newline at end of file +var _0xa5eb=['put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x224700,_0x5337ea){var _0x28c528=function(_0x59ef95){while(--_0x59ef95){_0x224700['push'](_0x224700['shift']());}};_0x28c528(++_0x5337ea);}(_0xa5eb,0x98));var _0xba5e=function(_0x3e3e5c,_0x2a7e05){_0x3e3e5c=_0x3e3e5c-0x0;var _0x5600a9=_0xa5eb[_0x3e3e5c];return _0x5600a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xba5e('0x0'));var timeout=require('connect-timeout');var express=require(_0xba5e('0x1'));var router=express[_0xba5e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xba5e('0x3'));var interaction=require(_0xba5e('0x4'));var config=require(_0xba5e('0x5'));var controller=require('./intDynamics365Account.controller');router[_0xba5e('0x6')]('/',auth['isAuthenticated'](),controller[_0xba5e('0x7')]);router[_0xba5e('0x6')]('/:id',auth[_0xba5e('0x8')](),controller[_0xba5e('0x9')]);router[_0xba5e('0x6')](_0xba5e('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xba5e('0x6')](_0xba5e('0xb'),auth[_0xba5e('0x8')](),controller[_0xba5e('0xc')]);router[_0xba5e('0xd')]('/',auth[_0xba5e('0x8')](),controller[_0xba5e('0xe')]);router[_0xba5e('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xba5e('0xf')]);router[_0xba5e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xba5e('0x11')]);router[_0xba5e('0x12')]('/:id',auth[_0xba5e('0x8')](),controller[_0xba5e('0x13')]);module[_0xba5e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 5e1d65b..e281be8 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 _0x18a6=['STRING','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x18a6,0x1c9));var _0x618a=function(_0x26e329,_0x158cca){_0x26e329=_0x26e329-0x0;var _0x1c5009=_0x18a6[_0x26e329];return _0x1c5009;};'use strict';var Sequelize=require('sequelize');module[_0x618a('0x0')]={'name':{'type':Sequelize[_0x618a('0x1')]},'username':{'type':Sequelize[_0x618a('0x1')]},'password':{'type':Sequelize[_0x618a('0x1')]},'remoteUri':{'type':Sequelize[_0x618a('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x618a('0x1')]},'clientSecret':{'type':Sequelize[_0x618a('0x1')]},'serverUrl':{'type':Sequelize[_0x618a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x618a('0x1')]}}; \ No newline at end of file +var _0x547c=['exports','STRING','sequelize'];(function(_0x3123b3,_0x451f66){var _0x142911=function(_0x97f016){while(--_0x97f016){_0x3123b3['push'](_0x3123b3['shift']());}};_0x142911(++_0x451f66);}(_0x547c,0x143));var _0xc547=function(_0x4862fd,_0x5e2895){_0x4862fd=_0x4862fd-0x0;var _0x30692c=_0x547c[_0x4862fd];return _0x30692c;};'use strict';var Sequelize=require(_0xc547('0x0'));module[_0xc547('0x1')]={'name':{'type':Sequelize[_0xc547('0x2')]},'username':{'type':Sequelize[_0xc547('0x2')]},'password':{'type':Sequelize[_0xc547('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc547('0x2')]},'clientSecret':{'type':Sequelize[_0xc547('0x2')]},'serverUrl':{'type':Sequelize[_0xc547('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e792302..f62036d 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 _0xb6f1=['onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','Bearer\x20','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','isNil','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','Wrong\x20credentials','4.0','Options','Label','UserLocalizedLabel','LogicalName','DisplayName',')/Attributes(','TrueOption','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Dynamics365Account','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','findAll','rows','show','params','keys','includeAll','include','find','catch','create','update','body','findOne','Dynamics365Configuration','filter','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents'];(function(_0x5701ac,_0x3b7d9c){var _0x594a5d=function(_0x3a1380){while(--_0x3a1380){_0x5701ac['push'](_0x5701ac['shift']());}};_0x594a5d(++_0x3b7d9c);}(_0xb6f1,0x118));var _0x1b6f=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0xb6f1[_0x29e3b6];return _0x55d4b0;};'use strict';var emlformat=require(_0x1b6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6f('0x2'));var moment=require(_0x1b6f('0x3'));var BPromise=require(_0x1b6f('0x4'));var Mustache=require('mustache');var util=require(_0x1b6f('0x5'));var path=require('path');var sox=require(_0x1b6f('0x6'));var csv=require(_0x1b6f('0x7'));var ejs=require(_0x1b6f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1b6f('0x9'));var crypto=require(_0x1b6f('0xa'));var jsforce=require(_0x1b6f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1b6f('0x7'));var querystring=require(_0x1b6f('0xc'));var Papa=require('papaparse');var Redis=require(_0x1b6f('0xd'));var authService=require(_0x1b6f('0xe'));var qs=require(_0x1b6f('0xf'));var as=require(_0x1b6f('0x10'));var hardwareService=require(_0x1b6f('0x11'));var logger=require(_0x1b6f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1b6f('0x13'));var licenseUtil=require(_0x1b6f('0x14'));var db=require(_0x1b6f('0x15'))['db'];var integrations=require(_0x1b6f('0x16'));function respondWithStatusCode(_0x213a23,_0x19c1a9){_0x19c1a9=_0x19c1a9||0xcc;return function(_0x209687){if(_0x209687){return _0x213a23[_0x1b6f('0x17')](_0x19c1a9);}return _0x213a23[_0x1b6f('0x18')](_0x19c1a9)[_0x1b6f('0x19')]();};}function respondWithResult(_0x3a8364,_0x195740){_0x195740=_0x195740||0xc8;return function(_0xaa927e){if(_0xaa927e){return _0x3a8364[_0x1b6f('0x18')](_0x195740)[_0x1b6f('0x1a')](_0xaa927e);}};}function respondWithFilteredResult(_0x283bd4,_0x2c4d44){return function(_0x3a3b48){if(_0x3a3b48){var _0x453e33=typeof _0x2c4d44[_0x1b6f('0x1b')]==='undefined'&&typeof _0x2c4d44['limit']===_0x1b6f('0x1c');var _0x3da268=_0x3a3b48[_0x1b6f('0x1d')];var _0x1f6b49=_0x453e33?0x0:_0x2c4d44[_0x1b6f('0x1b')];var _0x110255=_0x453e33?_0x3a3b48[_0x1b6f('0x1d')]:_0x2c4d44['offset']+_0x2c4d44[_0x1b6f('0x1e')];var _0x2f758d;if(_0x110255>=_0x3da268){_0x110255=_0x3da268;_0x2f758d=0xc8;}else{_0x2f758d=0xce;}_0x283bd4[_0x1b6f('0x18')](_0x2f758d);return _0x283bd4['set'](_0x1b6f('0x1f'),_0x1f6b49+'-'+_0x110255+'/'+_0x3da268)[_0x1b6f('0x1a')](_0x3a3b48);}return null;};}function patchUpdates(_0x43121d){return function(_0x58b7ed){try{jsonpatch[_0x1b6f('0x20')](_0x58b7ed,_0x43121d,!![]);}catch(_0x419108){return BPromise[_0x1b6f('0x21')](_0x419108);}return _0x58b7ed[_0x1b6f('0x22')]();};}function saveUpdates(_0x8e95df,_0x1a8996){return function(_0x518122){if(_0x518122){return _0x518122['update'](_0x8e95df)[_0x1b6f('0x23')](function(_0x4c236c){return _0x4c236c;});}return null;};}function removeEntity(_0x2345db,_0x375f4f){return function(_0xa35c1f){if(_0xa35c1f){return _0xa35c1f[_0x1b6f('0x24')]()[_0x1b6f('0x23')](function(){_0x2345db[_0x1b6f('0x18')](0xcc)[_0x1b6f('0x19')]();});}};}function handleEntityNotFound(_0x163933,_0x13486f){return function(_0x509183){if(!_0x509183){_0x163933[_0x1b6f('0x17')](0x194);}return _0x509183;};}function handleError(_0x5a490b,_0x15b953){_0x15b953=_0x15b953||0x1f4;return function(_0x509a1d){logger[_0x1b6f('0x25')](_0x509a1d['stack']);if(_0x509a1d['name']){delete _0x509a1d[_0x1b6f('0x26')];}_0x5a490b[_0x1b6f('0x18')](_0x15b953)[_0x1b6f('0x27')](_0x509a1d);};}exports[_0x1b6f('0x28')]=function(_0x42d2b3,_0x3a566){var _0x9483ef={},_0x114646={},_0x31639e={'count':0x0,'rows':[]};var _0x2ee6cf=_['map'](db[_0x1b6f('0x29')]['rawAttributes'],function(_0x57fe9e){return{'name':_0x57fe9e['fieldName'],'type':_0x57fe9e[_0x1b6f('0x2a')][_0x1b6f('0x2b')]};});_0x114646[_0x1b6f('0x2c')]=_[_0x1b6f('0x2d')](_0x2ee6cf,_0x1b6f('0x26'));_0x114646['query']=_['keys'](_0x42d2b3[_0x1b6f('0x2e')]);_0x114646[_0x1b6f('0x2f')]=_[_0x1b6f('0x30')](_0x114646[_0x1b6f('0x2c')],_0x114646[_0x1b6f('0x2e')]);_0x9483ef[_0x1b6f('0x31')]=_['intersection'](_0x114646[_0x1b6f('0x2c')],qs[_0x1b6f('0x32')](_0x42d2b3['query'][_0x1b6f('0x32')]));_0x9483ef[_0x1b6f('0x31')]=_0x9483ef[_0x1b6f('0x31')][_0x1b6f('0x33')]?_0x9483ef['attributes']:_0x114646[_0x1b6f('0x2c')];if(!_0x42d2b3[_0x1b6f('0x2e')][_0x1b6f('0x34')](_0x1b6f('0x35'))){_0x9483ef[_0x1b6f('0x1e')]=qs['limit'](_0x42d2b3[_0x1b6f('0x2e')][_0x1b6f('0x1e')]);_0x9483ef[_0x1b6f('0x1b')]=qs[_0x1b6f('0x1b')](_0x42d2b3['query'][_0x1b6f('0x1b')]);}_0x9483ef[_0x1b6f('0x36')]=qs['sort'](_0x42d2b3[_0x1b6f('0x2e')][_0x1b6f('0x37')]);_0x9483ef[_0x1b6f('0x38')]=qs[_0x1b6f('0x2f')](_['pick'](_0x42d2b3['query'],_0x114646['filters']),_0x2ee6cf);if(_0x42d2b3[_0x1b6f('0x2e')]['filter']){_0x9483ef[_0x1b6f('0x38')]=_[_0x1b6f('0x39')](_0x9483ef['where'],{'$or':_['map'](_0x2ee6cf,function(_0x4e795f){if(_0x4e795f['type']!==_0x1b6f('0x3a')){var _0x5c6d46={};_0x5c6d46[_0x4e795f[_0x1b6f('0x26')]]={'$like':'%'+_0x42d2b3[_0x1b6f('0x2e')]['filter']+'%'};return _0x5c6d46;}})});}_0x9483ef=_[_0x1b6f('0x39')]({},_0x9483ef,_0x42d2b3[_0x1b6f('0x3b')]);var _0x8f8f1d={'where':_0x9483ef[_0x1b6f('0x38')]};return db[_0x1b6f('0x29')][_0x1b6f('0x1d')](_0x8f8f1d)[_0x1b6f('0x23')](function(_0x539f40){_0x31639e['count']=_0x539f40;if(_0x42d2b3[_0x1b6f('0x2e')]['includeAll']){_0x9483ef['include']=[{'all':!![]}];}return db[_0x1b6f('0x29')][_0x1b6f('0x3c')](_0x9483ef);})['then'](function(_0x18644c){_0x31639e[_0x1b6f('0x3d')]=_0x18644c;return _0x31639e;})[_0x1b6f('0x23')](respondWithFilteredResult(_0x3a566,_0x9483ef))['catch'](handleError(_0x3a566,null));};exports[_0x1b6f('0x3e')]=function(_0x325980,_0x39a499){var _0x5abd51={'raw':![],'where':{'id':_0x325980[_0x1b6f('0x3f')]['id']}},_0xe34a36={};_0xe34a36[_0x1b6f('0x2c')]=_[_0x1b6f('0x40')](db[_0x1b6f('0x29')]['rawAttributes']);_0xe34a36['query']=_[_0x1b6f('0x40')](_0x325980[_0x1b6f('0x2e')]);_0xe34a36[_0x1b6f('0x2f')]=_[_0x1b6f('0x30')](_0xe34a36[_0x1b6f('0x2c')],_0xe34a36[_0x1b6f('0x2e')]);_0x5abd51['attributes']=_[_0x1b6f('0x30')](_0xe34a36[_0x1b6f('0x2c')],qs[_0x1b6f('0x32')](_0x325980['query'][_0x1b6f('0x32')]));_0x5abd51['attributes']=_0x5abd51['attributes'][_0x1b6f('0x33')]?_0x5abd51[_0x1b6f('0x31')]:_0xe34a36[_0x1b6f('0x2c')];if(_0x325980[_0x1b6f('0x2e')][_0x1b6f('0x41')]){_0x5abd51[_0x1b6f('0x42')]=[{'all':!![]}];}_0x5abd51=_['merge']({},_0x5abd51,_0x325980[_0x1b6f('0x3b')]);return db[_0x1b6f('0x29')][_0x1b6f('0x43')](_0x5abd51)['then'](handleEntityNotFound(_0x39a499,null))[_0x1b6f('0x23')](respondWithResult(_0x39a499,null))[_0x1b6f('0x44')](handleError(_0x39a499,null));};exports[_0x1b6f('0x45')]=function(_0x198ae7,_0x2a9694){return db[_0x1b6f('0x29')][_0x1b6f('0x45')](_0x198ae7['body'],{})['then'](respondWithResult(_0x2a9694,0xc9))['catch'](handleError(_0x2a9694,null));};exports[_0x1b6f('0x46')]=function(_0x52c12f,_0x5691d3){if(_0x52c12f[_0x1b6f('0x47')]['id']){delete _0x52c12f[_0x1b6f('0x47')]['id'];}return db['Dynamics365Account'][_0x1b6f('0x43')]({'where':{'id':_0x52c12f[_0x1b6f('0x3f')]['id']}})[_0x1b6f('0x23')](handleEntityNotFound(_0x5691d3,null))[_0x1b6f('0x23')](saveUpdates(_0x52c12f[_0x1b6f('0x47')],null))['then'](respondWithResult(_0x5691d3,null))[_0x1b6f('0x44')](handleError(_0x5691d3,null));};exports[_0x1b6f('0x24')]=function(_0x5e66be,_0x4cdd3f){return db[_0x1b6f('0x29')]['find']({'where':{'id':_0x5e66be[_0x1b6f('0x3f')]['id']}})[_0x1b6f('0x23')](handleEntityNotFound(_0x4cdd3f,null))['then'](removeEntity(_0x4cdd3f,null))['catch'](handleError(_0x4cdd3f,null));};exports['getConfigurations']=function(_0x14f433,_0x68a1fd,_0x7ea490){var _0x3fcc7e={};var _0x1fe05d={};var _0x47c16b;var _0x2c8e29;return db[_0x1b6f('0x29')][_0x1b6f('0x48')]({'where':{'id':_0x14f433[_0x1b6f('0x3f')]['id']}})[_0x1b6f('0x23')](handleEntityNotFound(_0x68a1fd,null))[_0x1b6f('0x23')](function(_0x1f39a4){if(_0x1f39a4){_0x47c16b=_0x1f39a4;_0x1fe05d[_0x1b6f('0x2c')]=_[_0x1b6f('0x40')](db[_0x1b6f('0x49')]['rawAttributes']);_0x1fe05d['query']=_[_0x1b6f('0x40')](_0x14f433[_0x1b6f('0x2e')]);_0x1fe05d[_0x1b6f('0x2f')]=_[_0x1b6f('0x30')](_0x1fe05d[_0x1b6f('0x2c')],_0x1fe05d['query']);_0x3fcc7e['attributes']=_['intersection'](_0x1fe05d[_0x1b6f('0x2c')],qs[_0x1b6f('0x32')](_0x14f433['query']['fields']));_0x3fcc7e[_0x1b6f('0x31')]=_0x3fcc7e[_0x1b6f('0x31')][_0x1b6f('0x33')]?_0x3fcc7e['attributes']:_0x1fe05d[_0x1b6f('0x2c')];_0x3fcc7e[_0x1b6f('0x36')]=qs[_0x1b6f('0x37')](_0x14f433[_0x1b6f('0x2e')][_0x1b6f('0x37')]);_0x3fcc7e[_0x1b6f('0x38')]=qs[_0x1b6f('0x2f')](_['pick'](_0x14f433[_0x1b6f('0x2e')],_0x1fe05d[_0x1b6f('0x2f')]));if(_0x14f433[_0x1b6f('0x2e')][_0x1b6f('0x4a')]){_0x3fcc7e['where']=_[_0x1b6f('0x39')](_0x3fcc7e['where'],{'$or':_['map'](_0x3fcc7e[_0x1b6f('0x31')],function(_0x532820){var _0x406d1f={};_0x406d1f[_0x532820]={'$like':'%'+_0x14f433[_0x1b6f('0x2e')][_0x1b6f('0x4a')]+'%'};return _0x406d1f;})});}_0x3fcc7e=_[_0x1b6f('0x39')]({},_0x3fcc7e,_0x14f433[_0x1b6f('0x3b')]);return _0x47c16b[_0x1b6f('0x4b')](_0x3fcc7e);}})['then'](function(_0x5b653f){if(_0x5b653f){_0x2c8e29=_0x5b653f[_0x1b6f('0x33')];if(!_0x14f433[_0x1b6f('0x2e')]['hasOwnProperty']('nolimit')){_0x3fcc7e[_0x1b6f('0x1e')]=qs[_0x1b6f('0x1e')](_0x14f433[_0x1b6f('0x2e')][_0x1b6f('0x1e')]);_0x3fcc7e[_0x1b6f('0x1b')]=qs['offset'](_0x14f433[_0x1b6f('0x2e')][_0x1b6f('0x1b')]);}return _0x47c16b[_0x1b6f('0x4b')](_0x3fcc7e);}})[_0x1b6f('0x23')](function(_0x25ea05){if(_0x25ea05){return _0x25ea05?{'count':_0x2c8e29,'rows':_0x25ea05}:null;}})[_0x1b6f('0x23')](respondWithResult(_0x68a1fd,null))['catch'](handleError(_0x68a1fd,null));};exports['addConfiguration']=function(_0xe0e0ef,_0x3b59c1,_0x1ad72f){if(_0xe0e0ef[_0x1b6f('0x47')]['id']){delete _0xe0e0ef['body']['id'];}return db[_0x1b6f('0x29')][_0x1b6f('0x48')]({'where':{'id':_0xe0e0ef[_0x1b6f('0x3f')]['id']}})[_0x1b6f('0x23')](handleEntityNotFound(_0x3b59c1,null))[_0x1b6f('0x23')](function(_0x579a9b){if(_0x579a9b){_0xe0e0ef[_0x1b6f('0x47')][_0x1b6f('0x4c')]=_0x579a9b['id'];_0xe0e0ef[_0x1b6f('0x47')][_0x1b6f('0x4d')]=integrations[_0x1b6f('0x4e')](_0xe0e0ef['body']['channel'],_0xe0e0ef[_0x1b6f('0x47')][_0x1b6f('0x2a')]);_0xe0e0ef[_0x1b6f('0x47')][_0x1b6f('0x4f')]=integrations[_0x1b6f('0x50')](_0xe0e0ef[_0x1b6f('0x47')][_0x1b6f('0x51')],_0xe0e0ef[_0x1b6f('0x47')][_0x1b6f('0x2a')]);return db[_0x1b6f('0x49')][_0x1b6f('0x45')](_0xe0e0ef['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x1b6f('0x4d')},{'model':db[_0x1b6f('0x52')],'as':_0x1b6f('0x4f')}]});}return null;})[_0x1b6f('0x23')](respondWithResult(_0x3b59c1,null))[_0x1b6f('0x44')](handleError(_0x3b59c1,null));};exports['getFields']=function(_0x53a01d,_0x2ac23c,_0x349524){var _0x521bf2=_0x53a01d[_0x1b6f('0x2e')][_0x1b6f('0x53')];var _0x5acb8f=_0x521bf2===_0x1b6f('0x54')?_0x1b6f('0x55'):_0x1b6f('0x56');var _0xb5f5b0='';var _0x2790aa='';var _0x4c7906='';var _0x34a735='';var _0x288bca='';var _0x489c07='';var _0x40388d='';var _0x54103c='';var _0x1da02d=[_0x1b6f('0x57'),'description','customerid',_0x1b6f('0x58'),_0x1b6f('0x59'),_0x1b6f('0x5a'),_0x1b6f('0x5b'),_0x1b6f('0x5c'),_0x1b6f('0x5d'),'phonecall_activity_parties'];var _0x317d7f=[_0x1b6f('0x5e'),_0x1b6f('0x5f'),_0x1b6f('0x60'),_0x1b6f('0x61'),'contactidname',_0x1b6f('0x62'),_0x1b6f('0x63'),_0x1b6f('0x64'),'createdbyexternalpartyname',_0x1b6f('0x65'),'createdbyname',_0x1b6f('0x66'),_0x1b6f('0x67'),_0x1b6f('0x68'),_0x1b6f('0x69'),'customeridname',_0x1b6f('0x6a'),_0x1b6f('0x6b'),_0x1b6f('0x6c'),_0x1b6f('0x6d'),_0x1b6f('0x6e'),'entityimage_url',_0x1b6f('0x6f'),'exchangerate',_0x1b6f('0x70'),_0x1b6f('0x71'),_0x1b6f('0x72'),_0x1b6f('0x73'),'kbarticleidname',_0x1b6f('0x74'),_0x1b6f('0x75'),_0x1b6f('0x76'),_0x1b6f('0x77'),_0x1b6f('0x78'),_0x1b6f('0x79'),_0x1b6f('0x7a'),_0x1b6f('0x7b'),_0x1b6f('0x7c'),'msdyn_incidenttypename','msdyn_iotalertname',_0x1b6f('0x7d'),_0x1b6f('0x7e'),_0x1b6f('0x7f'),_0x1b6f('0x80'),_0x1b6f('0x81'),_0x1b6f('0x82'),_0x1b6f('0x83'),_0x1b6f('0x84'),_0x1b6f('0x85'),'prioritycodename',_0x1b6f('0x86'),'productserialnumber',_0x1b6f('0x87'),_0x1b6f('0x88'),_0x1b6f('0x89'),'responsiblecontactidname',_0x1b6f('0x8a'),_0x1b6f('0x8b'),_0x1b6f('0x8c'),_0x1b6f('0x8d'),_0x1b6f('0x8e'),_0x1b6f('0x8f'),_0x1b6f('0x90'),_0x1b6f('0x91'),_0x1b6f('0x92'),_0x1b6f('0x93'),_0x1b6f('0x94'),_0x1b6f('0x95'),_0x1b6f('0x96'),'versionnumber'];var _0x143dbc=_0x1da02d[_0x1b6f('0x97')](_0x317d7f);return db[_0x1b6f('0x29')][_0x1b6f('0x48')]({'where':{'id':_0x53a01d[_0x1b6f('0x3f')]['id']},'attributes':['id','username',_0x1b6f('0x98'),_0x1b6f('0x99'),_0x1b6f('0x9a'),_0x1b6f('0x9b'),_0x1b6f('0x9c')]})[_0x1b6f('0x23')](handleEntityNotFound(_0x2ac23c,null))[_0x1b6f('0x23')](function(_0x30f82c){if(_0x30f82c){_0x54103c=_0x30f82c[_0x1b6f('0x99')];var _0x225ec0=_0x54103c[_0x1b6f('0x9d')](-0x1);if(_0x225ec0==='/'){_0x54103c=_0x54103c[_0x1b6f('0x9e')](0x0,_0x54103c[_0x1b6f('0x9f')](_0x225ec0));}_0x40388d=util[_0x1b6f('0xa0')](_0x1b6f('0xa1'),_0x54103c);var _0x350f63={'method':_0x1b6f('0xa2'),'uri':_0x1b6f('0xa3')+_0x30f82c[_0x1b6f('0x9a')]+_0x1b6f('0xa4'),'form':{'client_id':_0x30f82c[_0x1b6f('0x9b')],'resource':_0x54103c,'username':_0x30f82c['username'],'password':_0x30f82c[_0x1b6f('0x98')],'grant_type':_0x1b6f('0x98'),'client_secret':_0x30f82c['clientSecret']},'json':!![]};return rp(_0x350f63);}})[_0x1b6f('0x23')](function(_0x40fde6){_0x489c07=_0x40fde6[_0x1b6f('0xa5')];var _0x157886={'method':_0x1b6f('0xa6'),'uri':encodeURI(_0x40388d+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5acb8f+'\x27'),'headers':{'Authorization':_0x1b6f('0xa7')+_0x489c07,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x157886);})[_0x1b6f('0x23')](function(_0x590f0b){var _0x18ea7b=_0x590f0b['value'][0x0];var _0x1d0320=_0x18ea7b[_0x1b6f('0xa8')];var _0x1753d9={'method':_0x1b6f('0xa6'),'uri':_0x40388d+_0x1b6f('0xa9')+_0x1d0320+_0x1b6f('0xaa'),'headers':{'Authorization':_0x1b6f('0xa7')+_0x489c07,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1753d9);})['then'](function(_0x503211){_0xb5f5b0=_0x503211;_0x2790aa=_0xb5f5b0['Attributes'];_0x2790aa=_[_0x1b6f('0xab')](_0x2790aa,function(_0x14e1ab){return!_0x143dbc[_0x1b6f('0xac')](_0x14e1ab['LogicalName']);});var _0x436b38=[];var _0x45e091=[];_0x2790aa[_0x1b6f('0xad')](function(_0x2060ac){if(_0x2060ac[_0x1b6f('0xae')]){var _0x47bbdc=_0x2060ac['@odata.type'][_0x1b6f('0x9e')](_0x2060ac[_0x1b6f('0xae')]['lastIndexOf']('.')+0x1);if(_0x47bbdc===_0x1b6f('0xaf')){_0x436b38['push'](getSelectList(_0x40388d,_0x521bf2,_0x45e091,_0xb5f5b0[_0x1b6f('0xa8')],_0x2060ac['MetadataId'],_0x489c07));}}});return Promise['all'](_0x436b38);})[_0x1b6f('0x23')](function(_0x2f7515){_0x4c7906=_0x2f7515[0x0];var _0x3a4450=[];var _0x2fefd8=[];_0x2790aa[_0x1b6f('0xad')](function(_0x16337a){if(!_[_0x1b6f('0xb0')](_0x16337a[_0x1b6f('0xae')])){var _0x2bdcc7=_0x16337a[_0x1b6f('0xae')][_0x1b6f('0x9e')](_0x16337a['@odata.type'][_0x1b6f('0x9f')]('.')+0x1);if(_0x2bdcc7==='BooleanAttributeMetadata'){_0x3a4450[_0x1b6f('0xb1')](getBooleanList(_0x40388d,_0x521bf2,_0x2fefd8,_0xb5f5b0['MetadataId'],_0x16337a[_0x1b6f('0xa8')],_0x489c07));}}});return Promise[_0x1b6f('0xb2')](_0x3a4450);})[_0x1b6f('0x23')](function(_0x24db63){_0x34a735=_0x24db63[0x0];var _0x571ec1=[];var _0x8624c1=[];_0x2790aa[_0x1b6f('0xad')](function(_0x34abcb){if(_0x34abcb[_0x1b6f('0xae')]){var _0x17974e=_0x34abcb[_0x1b6f('0xae')][_0x1b6f('0x9e')](_0x34abcb[_0x1b6f('0xae')]['lastIndexOf']('.')+0x1);if(_0x17974e==='StringAttributeMetadata'||_0x17974e===_0x1b6f('0xb3')||_0x17974e===_0x1b6f('0xb4')||_0x17974e===_0x1b6f('0xb5')||_0x17974e===_0x1b6f('0xb6')||_0x17974e==='DateTimeAttributeMetadata'||_0x17974e===_0x1b6f('0xb7')||_0x17974e==='EntityNameAttributeMetadata'||_0x17974e===_0x1b6f('0xb8')||_0x17974e===_0x1b6f('0xb9')){_0x571ec1[_0x1b6f('0xb1')](getInputList(_0x40388d,_0x521bf2,_0x17974e,_0x8624c1,_0xb5f5b0[_0x1b6f('0xa8')],_0x34abcb['MetadataId'],_0x489c07));}}});return Promise[_0x1b6f('0xb2')](_0x571ec1);})[_0x1b6f('0x23')](function(_0x4c5881){_0x288bca=_0x4c5881[0x0];var _0x38c612=_0x4c7906[_0x1b6f('0x97')](_0x34a735)[_0x1b6f('0x97')](_0x288bca);var _0x3dc7e0={'count':_0x38c612[_0x1b6f('0x33')],'rows':_0x38c612};return _0x3dc7e0;})['then'](respondWithResult(_0x2ac23c,null))[_0x1b6f('0x44')](function(_0x1c8f5a){var _0x1f946f=_0x53a01d['query'][_0x1b6f('0xba')]?0x1f4:_0x1c8f5a[_0x1b6f('0xbb')]||0x1f4;logger[_0x1b6f('0x25')](_0x1c8f5a[_0x1b6f('0xbc')]);delete _0x1c8f5a[_0x1b6f('0x26')];if(_0x1f946f===0x191){_0x1f946f=0x190;}_0x2ac23c[_0x1b6f('0x18')](_0x1f946f)[_0x1b6f('0x27')](_0x53a01d[_0x1b6f('0x2e')][_0x1b6f('0xba')]?{'message':_0x1b6f('0xbd'),'statusCode':_0x1c8f5a['statusCode']}:_0x1c8f5a);});};function getSelectList(_0x2a0903,_0x75fb97,_0x166a78,_0x3918d0,_0x182275,_0x4aea53){var _0x58a85d={'method':'GET','uri':_0x2a0903+_0x1b6f('0xa9')+_0x3918d0+')/Attributes('+_0x182275+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x1b6f('0xa7')+_0x4aea53,'If-None-Match':null,'OData-Version':_0x1b6f('0xbe')},'json':!![]};return rp(_0x58a85d)['then'](function(_0x5ab103){var _0x397209=[];var _0x1be45b=_0x5ab103['OptionSet'][_0x1b6f('0xbf')];_0x1be45b[_0x1b6f('0xad')](function(_0x16cd33){_0x397209[_0x1b6f('0xb1')]({'name':_0x16cd33[_0x1b6f('0xc0')][_0x1b6f('0xc1')][_0x1b6f('0xc0')],'value':String(_0x16cd33['Value'])});});var _0x243b58={'id':_0x75fb97+'_'+_0x5ab103[_0x1b6f('0xc2')],'name':_0x5ab103[_0x1b6f('0xc3')][_0x1b6f('0xc1')][_0x1b6f('0xc0')],'custom':![],'options':_0x397209};_0x166a78[_0x1b6f('0xb1')](_0x243b58);return _0x166a78;});}function getBooleanList(_0x396e65,_0x40014e,_0x23385f,_0x220294,_0x2636d3,_0x107ecc){var _0x2600e1={'method':_0x1b6f('0xa6'),'uri':_0x396e65+_0x1b6f('0xa9')+_0x220294+_0x1b6f('0xc4')+_0x2636d3+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x1b6f('0xa7')+_0x107ecc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2600e1)[_0x1b6f('0x23')](function(_0x4a42a4){var _0x3a11e8=[];_0x3a11e8['push']({'name':_0x4a42a4['OptionSet'][_0x1b6f('0xc5')][_0x1b6f('0xc0')][_0x1b6f('0xc1')][_0x1b6f('0xc0')],'value':_0x1b6f('0xc6')},{'name':_0x4a42a4[_0x1b6f('0xc7')][_0x1b6f('0xc8')][_0x1b6f('0xc0')][_0x1b6f('0xc1')]['Label'],'value':_0x1b6f('0xc9')});var _0x3705ba={'id':_0x40014e+'_'+_0x4a42a4['LogicalName'],'name':_0x4a42a4[_0x1b6f('0xc3')][_0x1b6f('0xc1')][_0x1b6f('0xc0')],'custom':![],'options':_0x3a11e8};_0x23385f[_0x1b6f('0xb1')](_0x3705ba);return _0x23385f;});}function getInputList(_0x51c147,_0x27258c,_0x2584d6,_0xede5a5,_0x4b3be9,_0x5cd13a,_0x105718){var _0x3c2e06={'method':_0x1b6f('0xa6'),'uri':_0x51c147+_0x1b6f('0xa9')+_0x4b3be9+_0x1b6f('0xc4')+_0x5cd13a+_0x1b6f('0xca')+_0x2584d6+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x105718,'If-None-Match':null,'OData-Version':_0x1b6f('0xbe')},'json':!![]};return rp(_0x3c2e06)[_0x1b6f('0x23')](function(_0xd8b4d5){var _0x2565a3={'id':_0x27258c+'_'+_0xd8b4d5['LogicalName'],'name':_0xd8b4d5[_0x1b6f('0xc3')][_0x1b6f('0xc1')]?_0xd8b4d5[_0x1b6f('0xc3')][_0x1b6f('0xc1')][_0x1b6f('0xc0')]:_0xd8b4d5[_0x1b6f('0xc2')],'custom':![],'options':[]};_0xede5a5[_0x1b6f('0xb1')](_0x2565a3);return _0xede5a5;});} \ No newline at end of file +var _0x495e=['%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','isNil','BooleanAttributeMetadata','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','LogicalName','DisplayName','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','destroy','error','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','where','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','then','rows','catch','show','params','find','body','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','order','sort','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','create','Dynamics365Field','Descriptions','getFields','ticketType','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','substring','format'];(function(_0xe06a8e,_0x197e62){var _0x3dc1d0=function(_0x37aa7d){while(--_0x37aa7d){_0xe06a8e['push'](_0xe06a8e['shift']());}};_0x3dc1d0(++_0x197e62);}(_0x495e,0xfb));var _0xe495=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x495e[_0x246f0c];return _0x30fe50;};'use strict';var emlformat=require(_0xe495('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe495('0x1'));var rp=require(_0xe495('0x2'));var moment=require(_0xe495('0x3'));var BPromise=require(_0xe495('0x4'));var Mustache=require('mustache');var util=require(_0xe495('0x5'));var path=require(_0xe495('0x6'));var sox=require(_0xe495('0x7'));var csv=require(_0xe495('0x8'));var ejs=require(_0xe495('0x9'));var fs=require('fs');var fs_extra=require(_0xe495('0xa'));var _=require(_0xe495('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe495('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe495('0xd'));var Papa=require(_0xe495('0xe'));var Redis=require(_0xe495('0xf'));var authService=require(_0xe495('0x10'));var qs=require(_0xe495('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe495('0x12'));var logger=require(_0xe495('0x13'))(_0xe495('0x14'));var utils=require('../../config/utils');var config=require(_0xe495('0x15'));var licenseUtil=require(_0xe495('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1d73a5,_0x13aedb){_0x13aedb=_0x13aedb||0xcc;return function(_0x5df017){if(_0x5df017){return _0x1d73a5[_0xe495('0x17')](_0x13aedb);}return _0x1d73a5[_0xe495('0x18')](_0x13aedb)[_0xe495('0x19')]();};}function respondWithResult(_0x14744d,_0x2b5e19){_0x2b5e19=_0x2b5e19||0xc8;return function(_0x593205){if(_0x593205){return _0x14744d[_0xe495('0x18')](_0x2b5e19)[_0xe495('0x1a')](_0x593205);}};}function respondWithFilteredResult(_0x19d096,_0x1c2d78){return function(_0x1ea256){if(_0x1ea256){var _0x48864f=typeof _0x1c2d78['offset']==='undefined'&&typeof _0x1c2d78[_0xe495('0x1b')]===_0xe495('0x1c');var _0x2aa692=_0x1ea256['count'];var _0x1e602c=_0x48864f?0x0:_0x1c2d78[_0xe495('0x1d')];var _0x3ba8cc=_0x48864f?_0x1ea256[_0xe495('0x1e')]:_0x1c2d78[_0xe495('0x1d')]+_0x1c2d78['limit'];var _0x4dfcb7;if(_0x3ba8cc>=_0x2aa692){_0x3ba8cc=_0x2aa692;_0x4dfcb7=0xc8;}else{_0x4dfcb7=0xce;}_0x19d096[_0xe495('0x18')](_0x4dfcb7);return _0x19d096[_0xe495('0x1f')](_0xe495('0x20'),_0x1e602c+'-'+_0x3ba8cc+'/'+_0x2aa692)[_0xe495('0x1a')](_0x1ea256);}return null;};}function patchUpdates(_0x5d5d35){return function(_0x3d4d3c){try{jsonpatch[_0xe495('0x21')](_0x3d4d3c,_0x5d5d35,!![]);}catch(_0x463ba9){return BPromise['reject'](_0x463ba9);}return _0x3d4d3c[_0xe495('0x22')]();};}function saveUpdates(_0x17d13f,_0x475a7e){return function(_0x22cbc3){if(_0x22cbc3){return _0x22cbc3[_0xe495('0x23')](_0x17d13f)['then'](function(_0x33f19){return _0x33f19;});}return null;};}function removeEntity(_0x4d836b,_0x181ead){return function(_0x39cff4){if(_0x39cff4){return _0x39cff4[_0xe495('0x24')]()['then'](function(){_0x4d836b[_0xe495('0x18')](0xcc)[_0xe495('0x19')]();});}};}function handleEntityNotFound(_0x740be5,_0x1db488){return function(_0x21513b){if(!_0x21513b){_0x740be5[_0xe495('0x17')](0x194);}return _0x21513b;};}function handleError(_0x1ffd8b,_0x48b2eb){_0x48b2eb=_0x48b2eb||0x1f4;return function(_0x5a2c68){logger[_0xe495('0x25')](_0x5a2c68['stack']);if(_0x5a2c68[_0xe495('0x26')]){delete _0x5a2c68[_0xe495('0x26')];}_0x1ffd8b['status'](_0x48b2eb)['send'](_0x5a2c68);};}exports[_0xe495('0x27')]=function(_0x620f00,_0xb2c47){var _0x8623c1={},_0x18c427={},_0x258d9c={'count':0x0,'rows':[]};var _0x181d26=_[_0xe495('0x28')](db['Dynamics365Account']['rawAttributes'],function(_0x37b75){return{'name':_0x37b75[_0xe495('0x29')],'type':_0x37b75[_0xe495('0x2a')][_0xe495('0x2b')]};});_0x18c427['model']=_[_0xe495('0x28')](_0x181d26,_0xe495('0x26'));_0x18c427[_0xe495('0x2c')]=_[_0xe495('0x2d')](_0x620f00[_0xe495('0x2c')]);_0x18c427[_0xe495('0x2e')]=_[_0xe495('0x2f')](_0x18c427[_0xe495('0x30')],_0x18c427[_0xe495('0x2c')]);_0x8623c1[_0xe495('0x31')]=_[_0xe495('0x2f')](_0x18c427[_0xe495('0x30')],qs[_0xe495('0x32')](_0x620f00[_0xe495('0x2c')][_0xe495('0x32')]));_0x8623c1['attributes']=_0x8623c1[_0xe495('0x31')][_0xe495('0x33')]?_0x8623c1['attributes']:_0x18c427[_0xe495('0x30')];if(!_0x620f00[_0xe495('0x2c')]['hasOwnProperty']('nolimit')){_0x8623c1[_0xe495('0x1b')]=qs[_0xe495('0x1b')](_0x620f00[_0xe495('0x2c')][_0xe495('0x1b')]);_0x8623c1['offset']=qs[_0xe495('0x1d')](_0x620f00[_0xe495('0x2c')][_0xe495('0x1d')]);}_0x8623c1['order']=qs['sort'](_0x620f00[_0xe495('0x2c')]['sort']);_0x8623c1[_0xe495('0x34')]=qs[_0xe495('0x2e')](_['pick'](_0x620f00['query'],_0x18c427[_0xe495('0x2e')]),_0x181d26);if(_0x620f00[_0xe495('0x2c')][_0xe495('0x35')]){_0x8623c1[_0xe495('0x34')]=_[_0xe495('0x36')](_0x8623c1[_0xe495('0x34')],{'$or':_[_0xe495('0x28')](_0x181d26,function(_0x43f94f){if(_0x43f94f[_0xe495('0x2a')]!==_0xe495('0x37')){var _0x4f566b={};_0x4f566b[_0x43f94f[_0xe495('0x26')]]={'$like':'%'+_0x620f00['query'][_0xe495('0x35')]+'%'};return _0x4f566b;}})});}_0x8623c1=_[_0xe495('0x36')]({},_0x8623c1,_0x620f00[_0xe495('0x38')]);var _0x6cb073={'where':_0x8623c1['where']};return db[_0xe495('0x39')][_0xe495('0x1e')](_0x6cb073)['then'](function(_0x49e4b4){_0x258d9c['count']=_0x49e4b4;if(_0x620f00[_0xe495('0x2c')][_0xe495('0x3a')]){_0x8623c1[_0xe495('0x3b')]=[{'all':!![]}];}return db[_0xe495('0x39')][_0xe495('0x3c')](_0x8623c1);})[_0xe495('0x3d')](function(_0x4df7d3){_0x258d9c[_0xe495('0x3e')]=_0x4df7d3;return _0x258d9c;})[_0xe495('0x3d')](respondWithFilteredResult(_0xb2c47,_0x8623c1))[_0xe495('0x3f')](handleError(_0xb2c47,null));};exports[_0xe495('0x40')]=function(_0x33d831,_0x2ff501){var _0x39ddda={'raw':![],'where':{'id':_0x33d831[_0xe495('0x41')]['id']}},_0x778cea={};_0x778cea['model']=_['keys'](db[_0xe495('0x39')]['rawAttributes']);_0x778cea[_0xe495('0x2c')]=_[_0xe495('0x2d')](_0x33d831['query']);_0x778cea[_0xe495('0x2e')]=_['intersection'](_0x778cea['model'],_0x778cea[_0xe495('0x2c')]);_0x39ddda['attributes']=_[_0xe495('0x2f')](_0x778cea['model'],qs[_0xe495('0x32')](_0x33d831[_0xe495('0x2c')][_0xe495('0x32')]));_0x39ddda[_0xe495('0x31')]=_0x39ddda[_0xe495('0x31')][_0xe495('0x33')]?_0x39ddda[_0xe495('0x31')]:_0x778cea[_0xe495('0x30')];if(_0x33d831[_0xe495('0x2c')][_0xe495('0x3a')]){_0x39ddda['include']=[{'all':!![]}];}_0x39ddda=_[_0xe495('0x36')]({},_0x39ddda,_0x33d831['options']);return db[_0xe495('0x39')][_0xe495('0x42')](_0x39ddda)[_0xe495('0x3d')](handleEntityNotFound(_0x2ff501,null))[_0xe495('0x3d')](respondWithResult(_0x2ff501,null))['catch'](handleError(_0x2ff501,null));};exports['create']=function(_0x54a346,_0x3b3fb1){return db[_0xe495('0x39')]['create'](_0x54a346[_0xe495('0x43')],{})[_0xe495('0x3d')](respondWithResult(_0x3b3fb1,0xc9))[_0xe495('0x3f')](handleError(_0x3b3fb1,null));};exports[_0xe495('0x23')]=function(_0x13fa96,_0x11f801){if(_0x13fa96[_0xe495('0x43')]['id']){delete _0x13fa96['body']['id'];}return db[_0xe495('0x39')][_0xe495('0x42')]({'where':{'id':_0x13fa96[_0xe495('0x41')]['id']}})[_0xe495('0x3d')](handleEntityNotFound(_0x11f801,null))[_0xe495('0x3d')](saveUpdates(_0x13fa96['body'],null))['then'](respondWithResult(_0x11f801,null))[_0xe495('0x3f')](handleError(_0x11f801,null));};exports[_0xe495('0x24')]=function(_0x1b81fd,_0x53cd3f){return db['Dynamics365Account'][_0xe495('0x42')]({'where':{'id':_0x1b81fd['params']['id']}})[_0xe495('0x3d')](handleEntityNotFound(_0x53cd3f,null))[_0xe495('0x3d')](removeEntity(_0x53cd3f,null))['catch'](handleError(_0x53cd3f,null));};exports[_0xe495('0x44')]=function(_0x3e03a2,_0xb3f987,_0x45813c){var _0x2161e2={};var _0xb8959a={};var _0x9b12f9;var _0x2dd789;return db[_0xe495('0x39')][_0xe495('0x45')]({'where':{'id':_0x3e03a2[_0xe495('0x41')]['id']}})[_0xe495('0x3d')](handleEntityNotFound(_0xb3f987,null))['then'](function(_0x444bb1){if(_0x444bb1){_0x9b12f9=_0x444bb1;_0xb8959a[_0xe495('0x30')]=_[_0xe495('0x2d')](db[_0xe495('0x46')][_0xe495('0x47')]);_0xb8959a[_0xe495('0x2c')]=_[_0xe495('0x2d')](_0x3e03a2[_0xe495('0x2c')]);_0xb8959a[_0xe495('0x2e')]=_[_0xe495('0x2f')](_0xb8959a['model'],_0xb8959a['query']);_0x2161e2[_0xe495('0x31')]=_[_0xe495('0x2f')](_0xb8959a['model'],qs[_0xe495('0x32')](_0x3e03a2[_0xe495('0x2c')][_0xe495('0x32')]));_0x2161e2[_0xe495('0x31')]=_0x2161e2['attributes'][_0xe495('0x33')]?_0x2161e2[_0xe495('0x31')]:_0xb8959a[_0xe495('0x30')];_0x2161e2[_0xe495('0x48')]=qs[_0xe495('0x49')](_0x3e03a2[_0xe495('0x2c')]['sort']);_0x2161e2[_0xe495('0x34')]=qs['filters'](_[_0xe495('0x4a')](_0x3e03a2['query'],_0xb8959a[_0xe495('0x2e')]));if(_0x3e03a2['query'][_0xe495('0x35')]){_0x2161e2['where']=_[_0xe495('0x36')](_0x2161e2[_0xe495('0x34')],{'$or':_['map'](_0x2161e2[_0xe495('0x31')],function(_0x1ccb69){var _0x1371e9={};_0x1371e9[_0x1ccb69]={'$like':'%'+_0x3e03a2[_0xe495('0x2c')][_0xe495('0x35')]+'%'};return _0x1371e9;})});}_0x2161e2=_[_0xe495('0x36')]({},_0x2161e2,_0x3e03a2[_0xe495('0x38')]);return _0x9b12f9[_0xe495('0x44')](_0x2161e2);}})[_0xe495('0x3d')](function(_0x11906c){if(_0x11906c){_0x2dd789=_0x11906c[_0xe495('0x33')];if(!_0x3e03a2[_0xe495('0x2c')][_0xe495('0x4b')](_0xe495('0x4c'))){_0x2161e2[_0xe495('0x1b')]=qs[_0xe495('0x1b')](_0x3e03a2[_0xe495('0x2c')][_0xe495('0x1b')]);_0x2161e2[_0xe495('0x1d')]=qs[_0xe495('0x1d')](_0x3e03a2[_0xe495('0x2c')]['offset']);}return _0x9b12f9[_0xe495('0x44')](_0x2161e2);}})['then'](function(_0x3f0766){if(_0x3f0766){return _0x3f0766?{'count':_0x2dd789,'rows':_0x3f0766}:null;}})[_0xe495('0x3d')](respondWithResult(_0xb3f987,null))['catch'](handleError(_0xb3f987,null));};exports[_0xe495('0x4d')]=function(_0x5ea667,_0x518419,_0x23d962){if(_0x5ea667[_0xe495('0x43')]['id']){delete _0x5ea667['body']['id'];}return db[_0xe495('0x39')][_0xe495('0x45')]({'where':{'id':_0x5ea667[_0xe495('0x41')]['id']}})[_0xe495('0x3d')](handleEntityNotFound(_0x518419,null))['then'](function(_0x894486){if(_0x894486){_0x5ea667[_0xe495('0x43')][_0xe495('0x4e')]=_0x894486['id'];_0x5ea667[_0xe495('0x43')][_0xe495('0x4f')]=integrations['getSubjects'](_0x5ea667[_0xe495('0x43')][_0xe495('0x50')],_0x5ea667[_0xe495('0x43')][_0xe495('0x2a')]);_0x5ea667[_0xe495('0x43')]['Descriptions']=integrations['getDescriptions'](_0x5ea667[_0xe495('0x43')][_0xe495('0x50')],_0x5ea667[_0xe495('0x43')]['type']);return db[_0xe495('0x46')][_0xe495('0x51')](_0x5ea667[_0xe495('0x43')],{'include':[{'model':db[_0xe495('0x52')],'as':_0xe495('0x4f')},{'model':db[_0xe495('0x52')],'as':_0xe495('0x53')}]});}return null;})[_0xe495('0x3d')](respondWithResult(_0x518419,null))['catch'](handleError(_0x518419,null));};exports[_0xe495('0x54')]=function(_0xa73873,_0x23dc48,_0x1bf369){var _0x51ef2b=_0xa73873[_0xe495('0x2c')][_0xe495('0x55')];var _0x4beff2=_0x51ef2b==='incident'?_0xe495('0x56'):_0xe495('0x57');var _0x274aa4='';var _0x1aa3b5='';var _0x4059af='';var _0x3d5742='';var _0x4cdd91='';var _0x315ffd='';var _0x567f5b='';var _0xf8b70d='';var _0x1dfe93=[_0xe495('0x58'),_0xe495('0x59'),_0xe495('0x5a'),'ownerid',_0xe495('0x5b'),_0xe495('0x5c'),'phonenumber',_0xe495('0x5d'),_0xe495('0x5e'),'phonecall_activity_parties'];var _0x1c45b6=[_0xe495('0x5f'),_0xe495('0x60'),_0xe495('0x61'),_0xe495('0x62'),_0xe495('0x63'),_0xe495('0x64'),'contractdetailidname',_0xe495('0x65'),_0xe495('0x66'),'createdbyexternalpartyyominame',_0xe495('0x67'),_0xe495('0x68'),_0xe495('0x69'),_0xe495('0x6a'),'createdonbehalfbyyominame','customeridname',_0xe495('0x6b'),_0xe495('0x6c'),_0xe495('0x6d'),'entitlementidname',_0xe495('0x6e'),_0xe495('0x6f'),_0xe495('0x70'),_0xe495('0x71'),_0xe495('0x72'),_0xe495('0x73'),_0xe495('0x74'),_0xe495('0x75'),_0xe495('0x76'),_0xe495('0x77'),'masteridname','modifiedbyexternalpartyname',_0xe495('0x78'),_0xe495('0x79'),'modifiedbyyominame',_0xe495('0x7a'),_0xe495('0x7b'),_0xe495('0x7c'),_0xe495('0x7d'),'msdyn_iotalertname','numberofchildincidents','onholdtime',_0xe495('0x7e'),_0xe495('0x7f'),_0xe495('0x80'),_0xe495('0x81'),_0xe495('0x82'),_0xe495('0x83'),_0xe495('0x84'),_0xe495('0x85'),'productidname',_0xe495('0x86'),_0xe495('0x87'),_0xe495('0x88'),_0xe495('0x89'),_0xe495('0x8a'),_0xe495('0x8b'),_0xe495('0x8c'),_0xe495('0x8d'),_0xe495('0x8e'),_0xe495('0x8f'),_0xe495('0x90'),'statuscode',_0xe495('0x91'),_0xe495('0x92'),_0xe495('0x93'),_0xe495('0x94'),_0xe495('0x95'),_0xe495('0x96'),'versionnumber'];var _0xb07e72=_0x1dfe93[_0xe495('0x97')](_0x1c45b6);return db['Dynamics365Account'][_0xe495('0x45')]({'where':{'id':_0xa73873[_0xe495('0x41')]['id']},'attributes':['id',_0xe495('0x98'),_0xe495('0x99'),_0xe495('0x9a'),_0xe495('0x9b'),_0xe495('0x9c'),'clientSecret']})[_0xe495('0x3d')](handleEntityNotFound(_0x23dc48,null))['then'](function(_0x32e092){if(_0x32e092){_0xf8b70d=_0x32e092[_0xe495('0x9a')];var _0x222aec=_0xf8b70d['slice'](-0x1);if(_0x222aec==='/'){_0xf8b70d=_0xf8b70d[_0xe495('0x9d')](0x0,_0xf8b70d['lastIndexOf'](_0x222aec));}_0x567f5b=util[_0xe495('0x9e')](_0xe495('0x9f'),_0xf8b70d);var _0x1e2274={'method':_0xe495('0xa0'),'uri':_0xe495('0xa1')+_0x32e092[_0xe495('0x9b')]+_0xe495('0xa2'),'form':{'client_id':_0x32e092['clientId'],'resource':_0xf8b70d,'username':_0x32e092[_0xe495('0x98')],'password':_0x32e092[_0xe495('0x99')],'grant_type':_0xe495('0x99'),'client_secret':_0x32e092[_0xe495('0xa3')]},'json':!![]};return rp(_0x1e2274);}})[_0xe495('0x3d')](function(_0x56f658){_0x315ffd=_0x56f658[_0xe495('0xa4')];var _0xbb26a4={'method':_0xe495('0xa5'),'uri':encodeURI(_0x567f5b+_0xe495('0xa6')+_0x4beff2+'\x27'),'headers':{'Authorization':_0xe495('0xa7')+_0x315ffd,'If-None-Match':null,'OData-Version':_0xe495('0xa8')},'json':!![]};return rp(_0xbb26a4);})['then'](function(_0x3ff17f){var _0x234f6b=_0x3ff17f[_0xe495('0xa9')][0x0];var _0x2fe232=_0x234f6b[_0xe495('0xaa')];var _0x3f8db0={'method':_0xe495('0xa5'),'uri':_0x567f5b+_0xe495('0xab')+_0x2fe232+_0xe495('0xac'),'headers':{'Authorization':'Bearer\x20'+_0x315ffd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3f8db0);})[_0xe495('0x3d')](function(_0x8aae75){_0x274aa4=_0x8aae75;_0x1aa3b5=_0x274aa4['Attributes'];_0x1aa3b5=_['remove'](_0x1aa3b5,function(_0x3dbae9){return!_0xb07e72[_0xe495('0xad')](_0x3dbae9['LogicalName']);});var _0x3dfb1f=[];var _0x1729c3=[];_0x1aa3b5[_0xe495('0xae')](function(_0x293220){if(_0x293220['@odata.type']){var _0x1af49f=_0x293220[_0xe495('0xaf')][_0xe495('0x9d')](_0x293220[_0xe495('0xaf')][_0xe495('0xb0')]('.')+0x1);if(_0x1af49f===_0xe495('0xb1')){_0x3dfb1f['push'](getSelectList(_0x567f5b,_0x51ef2b,_0x1729c3,_0x274aa4[_0xe495('0xaa')],_0x293220[_0xe495('0xaa')],_0x315ffd));}}});return Promise['all'](_0x3dfb1f);})[_0xe495('0x3d')](function(_0x1018ae){_0x4059af=_0x1018ae[0x0];var _0x19db42=[];var _0x224124=[];_0x1aa3b5[_0xe495('0xae')](function(_0x362832){if(!_[_0xe495('0xb2')](_0x362832[_0xe495('0xaf')])){var _0x1139bf=_0x362832[_0xe495('0xaf')]['substring'](_0x362832[_0xe495('0xaf')][_0xe495('0xb0')]('.')+0x1);if(_0x1139bf===_0xe495('0xb3')){_0x19db42[_0xe495('0xb4')](getBooleanList(_0x567f5b,_0x51ef2b,_0x224124,_0x274aa4[_0xe495('0xaa')],_0x362832['MetadataId'],_0x315ffd));}}});return Promise[_0xe495('0xb5')](_0x19db42);})['then'](function(_0x33e691){_0x3d5742=_0x33e691[0x0];var _0x40f51a=[];var _0x1198f1=[];_0x1aa3b5[_0xe495('0xae')](function(_0x3be16d){if(_0x3be16d[_0xe495('0xaf')]){var _0x31b518=_0x3be16d[_0xe495('0xaf')][_0xe495('0x9d')](_0x3be16d[_0xe495('0xaf')]['lastIndexOf']('.')+0x1);if(_0x31b518==='StringAttributeMetadata'||_0x31b518===_0xe495('0xb6')||_0x31b518===_0xe495('0xb7')||_0x31b518==='IntegerAttributeMetadata'||_0x31b518==='MemoAttributeMetadata'||_0x31b518===_0xe495('0xb8')||_0x31b518===_0xe495('0xb9')||_0x31b518===_0xe495('0xba')||_0x31b518==='StateAttributeMetadata'||_0x31b518===_0xe495('0xbb')){_0x40f51a[_0xe495('0xb4')](getInputList(_0x567f5b,_0x51ef2b,_0x31b518,_0x1198f1,_0x274aa4['MetadataId'],_0x3be16d[_0xe495('0xaa')],_0x315ffd));}}});return Promise[_0xe495('0xb5')](_0x40f51a);})[_0xe495('0x3d')](function(_0x14a9df){_0x4cdd91=_0x14a9df[0x0];var _0x5d1cf4=_0x4059af[_0xe495('0x97')](_0x3d5742)[_0xe495('0x97')](_0x4cdd91);var _0x376e84={'count':_0x5d1cf4[_0xe495('0x33')],'rows':_0x5d1cf4};return _0x376e84;})['then'](respondWithResult(_0x23dc48,null))[_0xe495('0x3f')](function(_0x4631aa){var _0x4257a2=_0xa73873[_0xe495('0x2c')]['test']?0x1f4:_0x4631aa[_0xe495('0xbc')]||0x1f4;logger['error'](_0x4631aa['stack']);delete _0x4631aa[_0xe495('0x26')];if(_0x4257a2===0x191){_0x4257a2=0x190;}_0x23dc48[_0xe495('0x18')](_0x4257a2)[_0xe495('0xbd')](_0xa73873[_0xe495('0x2c')]['test']?{'message':_0xe495('0xbe'),'statusCode':_0x4631aa[_0xe495('0xbc')]}:_0x4631aa);});};function getSelectList(_0x5e91a9,_0x4ec144,_0x3d8eef,_0x218dd9,_0x38f480,_0x42d944){var _0x9f76e8={'method':_0xe495('0xa5'),'uri':_0x5e91a9+_0xe495('0xab')+_0x218dd9+_0xe495('0xbf')+_0x38f480+_0xe495('0xc0')+_0xe495('0xc1'),'headers':{'Authorization':_0xe495('0xa7')+_0x42d944,'If-None-Match':null,'OData-Version':_0xe495('0xa8')},'json':!![]};return rp(_0x9f76e8)[_0xe495('0x3d')](function(_0x4e21dc){var _0xbf121f=[];var _0x58f3ad=_0x4e21dc[_0xe495('0xc2')][_0xe495('0xc3')];_0x58f3ad[_0xe495('0xae')](function(_0x35e91c){_0xbf121f[_0xe495('0xb4')]({'name':_0x35e91c[_0xe495('0xc4')][_0xe495('0xc5')][_0xe495('0xc4')],'value':String(_0x35e91c['Value'])});});var _0x5cee64={'id':_0x4ec144+'_'+_0x4e21dc[_0xe495('0xc6')],'name':_0x4e21dc[_0xe495('0xc7')]['UserLocalizedLabel'][_0xe495('0xc4')],'custom':![],'options':_0xbf121f};_0x3d8eef[_0xe495('0xb4')](_0x5cee64);return _0x3d8eef;});}function getBooleanList(_0x34d418,_0x536857,_0x44664b,_0x5837c4,_0xf6d54c,_0x180f5a){var _0x2c71ca={'method':_0xe495('0xa5'),'uri':_0x34d418+'EntityDefinitions('+_0x5837c4+_0xe495('0xbf')+_0xf6d54c+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xe495('0xa7')+_0x180f5a,'If-None-Match':null,'OData-Version':_0xe495('0xa8')},'json':!![]};return rp(_0x2c71ca)[_0xe495('0x3d')](function(_0x4da1c5){var _0x13329a=[];_0x13329a['push']({'name':_0x4da1c5[_0xe495('0xc2')][_0xe495('0xc8')]['Label'][_0xe495('0xc5')][_0xe495('0xc4')],'value':_0xe495('0xc9')},{'name':_0x4da1c5[_0xe495('0xc2')][_0xe495('0xca')][_0xe495('0xc4')][_0xe495('0xc5')]['Label'],'value':_0xe495('0xcb')});var _0x17d8ba={'id':_0x536857+'_'+_0x4da1c5[_0xe495('0xc6')],'name':_0x4da1c5[_0xe495('0xc7')]['UserLocalizedLabel'][_0xe495('0xc4')],'custom':![],'options':_0x13329a};_0x44664b[_0xe495('0xb4')](_0x17d8ba);return _0x44664b;});}function getInputList(_0x4c38f5,_0xc45ce9,_0x3508f3,_0x59e594,_0x5e50b3,_0x48fa1f,_0x22a862){var _0x4c2a14={'method':'GET','uri':_0x4c38f5+_0xe495('0xab')+_0x5e50b3+_0xe495('0xbf')+_0x48fa1f+')/Microsoft.Dynamics.CRM.'+_0x3508f3+_0xe495('0xcc'),'headers':{'Authorization':_0xe495('0xa7')+_0x22a862,'If-None-Match':null,'OData-Version':_0xe495('0xa8')},'json':!![]};return rp(_0x4c2a14)[_0xe495('0x3d')](function(_0x419a51){var _0x3a7e2b={'id':_0xc45ce9+'_'+_0x419a51['LogicalName'],'name':_0x419a51[_0xe495('0xc7')]['UserLocalizedLabel']?_0x419a51[_0xe495('0xc7')][_0xe495('0xc5')][_0xe495('0xc4')]:_0x419a51['LogicalName'],'custom':![],'options':[]};_0x59e594[_0xe495('0xb4')](_0x3a7e2b);return _0x59e594;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index d27b688..6da4a7d 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0xc02471,_0x162372){var _0x223cef=function(_0x520230){while(--_0x520230){_0xc02471['push'](_0xc02471['shift']());}};_0x223cef(++_0x162372);}(_0x757a,0xde));var _0xa757=function(_0x163370,_0x2cc8ac){_0x163370=_0x163370-0x0;var _0x147ab8=_0x757a[_0x163370];return _0x147ab8;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x256735,_0x2a34ce){var _0x4b0e63=function(_0x54f8d8){while(--_0x54f8d8){_0x256735['push'](_0x256735['shift']());}};_0x4b0e63(++_0x2a34ce);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'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 3973962..d026e9b 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 _0xf063=['Dynamics365Account','find','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','where','attributes','map','model','include','then','GetDynamics365Account','debug','ShowDynamics365Account'];(function(_0x57f802,_0x51b159){var _0x324c9b=function(_0x4b70ea){while(--_0x4b70ea){_0x57f802['push'](_0x57f802['shift']());}};_0x324c9b(++_0x51b159);}(_0xf063,0xea));var _0x3f06=function(_0x4c5018,_0x98941e){_0x4c5018=_0x4c5018-0x0;var _0x3932b5=_0xf063[_0x4c5018];return _0x3932b5;};'use strict';var _=require(_0x3f06('0x0'));var util=require(_0x3f06('0x1'));var moment=require(_0x3f06('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f06('0x3'));var db=require(_0x3f06('0x4'))['db'];var utils=require(_0x3f06('0x5'));var logger=require('../../config/logger')(_0x3f06('0x6'));var config=require(_0x3f06('0x7'));var jayson=require(_0x3f06('0x8'));var client=jayson['client'][_0x3f06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d384c,_0x302ee5,_0x2afb28){return new BPromise(function(_0x55de92,_0x317a82){return client['request'](_0x5d384c,_0x2afb28)['then'](function(_0x36769c){logger[_0x3f06('0xa')](_0x3f06('0xb'),_0x302ee5,_0x3f06('0xc'));logger['debug'](_0x3f06('0xd'),_0x302ee5,_0x3f06('0xc'),JSON[_0x3f06('0xe')](_0x36769c));if(_0x36769c[_0x3f06('0xf')]){if(_0x36769c[_0x3f06('0xf')][_0x3f06('0x10')]===0x1f4){logger[_0x3f06('0xf')](_0x3f06('0xb'),_0x302ee5,_0x36769c[_0x3f06('0xf')]['message']);return _0x317a82(_0x36769c[_0x3f06('0xf')][_0x3f06('0x11')]);}logger[_0x3f06('0xf')](_0x3f06('0xb'),_0x302ee5,_0x36769c[_0x3f06('0xf')]['message']);return _0x55de92(_0x36769c[_0x3f06('0xf')][_0x3f06('0x11')]);}else{logger[_0x3f06('0xa')](_0x3f06('0xb'),_0x302ee5,_0x3f06('0xc'));_0x55de92(_0x36769c[_0x3f06('0x12')][_0x3f06('0x11')]);}})[_0x3f06('0x13')](function(_0x294465){logger['error'](_0x3f06('0xb'),_0x302ee5,_0x294465);_0x317a82(_0x294465);});});}exports['GetDynamics365Account']=function(_0x52c4a8){var _0x2981d3=this;return new Promise(function(_0x8b7cb6,_0x9947a5){return db['Dynamics365Account']['findAll']({'raw':_0x52c4a8[_0x3f06('0x14')]?_0x52c4a8[_0x3f06('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x52c4a8[_0x3f06('0x14')]?_0x52c4a8['options'][_0x3f06('0x15')]||null:null,'attributes':_0x52c4a8[_0x3f06('0x14')]?_0x52c4a8[_0x3f06('0x14')][_0x3f06('0x16')]||null:null,'limit':_0x52c4a8[_0x3f06('0x14')]?_0x52c4a8[_0x3f06('0x14')]['limit']||null:null,'include':_0x52c4a8['options']?_0x52c4a8[_0x3f06('0x14')]['include']?_[_0x3f06('0x17')](_0x52c4a8[_0x3f06('0x14')]['include'],function(_0x42f9a7){return{'model':db[_0x42f9a7[_0x3f06('0x18')]],'as':_0x42f9a7['as'],'attributes':_0x42f9a7[_0x3f06('0x16')],'include':_0x42f9a7[_0x3f06('0x19')]?_[_0x3f06('0x17')](_0x42f9a7[_0x3f06('0x19')],function(_0x56c956){return{'model':db[_0x56c956['model']],'as':_0x56c956['as'],'attributes':_0x56c956[_0x3f06('0x16')],'include':_0x56c956[_0x3f06('0x19')]?_[_0x3f06('0x17')](_0x56c956[_0x3f06('0x19')],function(_0x1dc8ff){return{'model':db[_0x1dc8ff[_0x3f06('0x18')]],'as':_0x1dc8ff['as'],'attributes':_0x1dc8ff[_0x3f06('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3f06('0x1a')](function(_0x5aca94){logger[_0x3f06('0xa')](_0x3f06('0x1b'),_0x52c4a8);logger[_0x3f06('0x1c')](_0x3f06('0x1b'),_0x52c4a8,JSON[_0x3f06('0xe')](_0x5aca94));_0x8b7cb6(_0x5aca94);})['catch'](function(_0x280375){logger[_0x3f06('0xf')](_0x3f06('0x1b'),_0x280375[_0x3f06('0x11')],_0x52c4a8);_0x9947a5(_0x2981d3[_0x3f06('0xf')](0x1f4,_0x280375['message']));});});};exports[_0x3f06('0x1d')]=function(_0x5a17a6){var _0x4a8f27=this;return new Promise(function(_0x2b5c96,_0x235904){return db[_0x3f06('0x1e')][_0x3f06('0x1f')]({'raw':_0x5a17a6['options']?_0x5a17a6['options'][_0x3f06('0x20')]===undefined?!![]:![]:!![],'where':_0x5a17a6['options']?_0x5a17a6[_0x3f06('0x14')][_0x3f06('0x15')]||null:null,'attributes':_0x5a17a6[_0x3f06('0x14')]?_0x5a17a6[_0x3f06('0x14')][_0x3f06('0x16')]||null:null,'include':_0x5a17a6[_0x3f06('0x14')]?_0x5a17a6[_0x3f06('0x14')][_0x3f06('0x19')]?_['map'](_0x5a17a6['options'][_0x3f06('0x19')],function(_0x3a0e4d){return{'model':db[_0x3a0e4d[_0x3f06('0x18')]],'as':_0x3a0e4d['as'],'attributes':_0x3a0e4d['attributes'],'include':_0x3a0e4d[_0x3f06('0x19')]?_[_0x3f06('0x17')](_0x3a0e4d[_0x3f06('0x19')],function(_0x57445d){return{'model':db[_0x57445d['model']],'as':_0x57445d['as'],'attributes':_0x57445d[_0x3f06('0x16')],'include':_0x57445d['include']?_[_0x3f06('0x17')](_0x57445d[_0x3f06('0x19')],function(_0x1e64eb){return{'model':db[_0x1e64eb[_0x3f06('0x18')]],'as':_0x1e64eb['as'],'attributes':_0x1e64eb[_0x3f06('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3f06('0x1a')](function(_0x2d2793){logger[_0x3f06('0xa')](_0x3f06('0x1d'),_0x5a17a6);logger[_0x3f06('0x1c')](_0x3f06('0x1d'),_0x5a17a6,JSON[_0x3f06('0xe')](_0x2d2793));_0x2b5c96(_0x2d2793);})[_0x3f06('0x13')](function(_0x592d72){logger[_0x3f06('0xf')](_0x3f06('0x1d'),_0x592d72['message'],_0x5a17a6);_0x235904(_0x4a8f27['error'](0x1f4,_0x592d72['message']));});});}; \ No newline at end of file +var _0xc4fb=['request','then','info','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','include','map','model','debug','ShowDynamics365Account','find','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4fb,0x6d));var _0xbc4f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc4fb[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbc4f('0x0'));var rs=require(_0xbc4f('0x1'));var fs=require('fs');var Redis=require(_0xbc4f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc4f('0x3'));var logger=require('../../config/logger')(_0xbc4f('0x4'));var config=require(_0xbc4f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xbc4f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25e9ae,_0x482c78,_0x5c0c66){return new BPromise(function(_0x5eafa8,_0x4a49fe){return client[_0xbc4f('0x7')](_0x25e9ae,_0x5c0c66)[_0xbc4f('0x8')](function(_0x29e229){logger[_0xbc4f('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x482c78,'request\x20sent');logger['debug'](_0xbc4f('0xa'),_0x482c78,'request\x20sent',JSON[_0xbc4f('0xb')](_0x29e229));if(_0x29e229[_0xbc4f('0xc')]){if(_0x29e229[_0xbc4f('0xc')]['code']===0x1f4){logger[_0xbc4f('0xc')](_0xbc4f('0xd'),_0x482c78,_0x29e229['error'][_0xbc4f('0xe')]);return _0x4a49fe(_0x29e229[_0xbc4f('0xc')][_0xbc4f('0xe')]);}logger[_0xbc4f('0xc')](_0xbc4f('0xd'),_0x482c78,_0x29e229[_0xbc4f('0xc')][_0xbc4f('0xe')]);return _0x5eafa8(_0x29e229['error']['message']);}else{logger['info'](_0xbc4f('0xd'),_0x482c78,'request\x20sent');_0x5eafa8(_0x29e229[_0xbc4f('0xf')][_0xbc4f('0xe')]);}})[_0xbc4f('0x10')](function(_0x1a1360){logger[_0xbc4f('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x482c78,_0x1a1360);_0x4a49fe(_0x1a1360);});});}exports[_0xbc4f('0x11')]=function(_0x2335d9){var _0x5942e0=this;return new Promise(function(_0x12ff1e,_0x1948af){return db['Dynamics365Account'][_0xbc4f('0x12')]({'raw':_0x2335d9[_0xbc4f('0x13')]?_0x2335d9[_0xbc4f('0x13')][_0xbc4f('0x14')]===undefined?!![]:![]:!![],'where':_0x2335d9[_0xbc4f('0x13')]?_0x2335d9[_0xbc4f('0x13')][_0xbc4f('0x15')]||null:null,'attributes':_0x2335d9[_0xbc4f('0x13')]?_0x2335d9[_0xbc4f('0x13')][_0xbc4f('0x16')]||null:null,'limit':_0x2335d9[_0xbc4f('0x13')]?_0x2335d9[_0xbc4f('0x13')]['limit']||null:null,'include':_0x2335d9[_0xbc4f('0x13')]?_0x2335d9['options'][_0xbc4f('0x17')]?_[_0xbc4f('0x18')](_0x2335d9['options']['include'],function(_0xe0d07b){return{'model':db[_0xe0d07b[_0xbc4f('0x19')]],'as':_0xe0d07b['as'],'attributes':_0xe0d07b[_0xbc4f('0x16')],'include':_0xe0d07b['include']?_['map'](_0xe0d07b[_0xbc4f('0x17')],function(_0x4f3331){return{'model':db[_0x4f3331['model']],'as':_0x4f3331['as'],'attributes':_0x4f3331[_0xbc4f('0x16')],'include':_0x4f3331[_0xbc4f('0x17')]?_['map'](_0x4f3331[_0xbc4f('0x17')],function(_0x3d80d4){return{'model':db[_0x3d80d4[_0xbc4f('0x19')]],'as':_0x3d80d4['as'],'attributes':_0x3d80d4[_0xbc4f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xbc4f('0x8')](function(_0x31789c){logger[_0xbc4f('0x9')](_0xbc4f('0x11'),_0x2335d9);logger[_0xbc4f('0x1a')]('GetDynamics365Account',_0x2335d9,JSON[_0xbc4f('0xb')](_0x31789c));_0x12ff1e(_0x31789c);})['catch'](function(_0x1c66c9){logger[_0xbc4f('0xc')](_0xbc4f('0x11'),_0x1c66c9[_0xbc4f('0xe')],_0x2335d9);_0x1948af(_0x5942e0[_0xbc4f('0xc')](0x1f4,_0x1c66c9['message']));});});};exports[_0xbc4f('0x1b')]=function(_0x14a2f8){var _0x47c8f2=this;return new Promise(function(_0x54f14f,_0x1995ac){return db['Dynamics365Account'][_0xbc4f('0x1c')]({'raw':_0x14a2f8[_0xbc4f('0x13')]?_0x14a2f8[_0xbc4f('0x13')][_0xbc4f('0x14')]===undefined?!![]:![]:!![],'where':_0x14a2f8[_0xbc4f('0x13')]?_0x14a2f8[_0xbc4f('0x13')][_0xbc4f('0x15')]||null:null,'attributes':_0x14a2f8[_0xbc4f('0x13')]?_0x14a2f8[_0xbc4f('0x13')][_0xbc4f('0x16')]||null:null,'include':_0x14a2f8[_0xbc4f('0x13')]?_0x14a2f8[_0xbc4f('0x13')]['include']?_[_0xbc4f('0x18')](_0x14a2f8[_0xbc4f('0x13')][_0xbc4f('0x17')],function(_0x2fd1fd){return{'model':db[_0x2fd1fd[_0xbc4f('0x19')]],'as':_0x2fd1fd['as'],'attributes':_0x2fd1fd['attributes'],'include':_0x2fd1fd[_0xbc4f('0x17')]?_[_0xbc4f('0x18')](_0x2fd1fd[_0xbc4f('0x17')],function(_0x205c79){return{'model':db[_0x205c79[_0xbc4f('0x19')]],'as':_0x205c79['as'],'attributes':_0x205c79[_0xbc4f('0x16')],'include':_0x205c79[_0xbc4f('0x17')]?_[_0xbc4f('0x18')](_0x205c79[_0xbc4f('0x17')],function(_0x3db960){return{'model':db[_0x3db960[_0xbc4f('0x19')]],'as':_0x3db960['as'],'attributes':_0x3db960[_0xbc4f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xbc4f('0x8')](function(_0x23bbb4){logger['info'](_0xbc4f('0x1b'),_0x14a2f8);logger[_0xbc4f('0x1a')](_0xbc4f('0x1b'),_0x14a2f8,JSON[_0xbc4f('0xb')](_0x23bbb4));_0x54f14f(_0x23bbb4);})[_0xbc4f('0x10')](function(_0x5e86f0){logger['error'](_0xbc4f('0x1b'),_0x5e86f0[_0xbc4f('0xe')],_0x14a2f8);_0x1995ac(_0x47c8f2[_0xbc4f('0xc')](0x1f4,_0x5e86f0[_0xbc4f('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 8ceea31..e5d7597 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 _0x76e0=['./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x492801,_0x39de84){var _0x276377=function(_0x3dd82f){while(--_0x3dd82f){_0x492801['push'](_0x492801['shift']());}};_0x276377(++_0x39de84);}(_0x76e0,0x6e));var _0x076e=function(_0x369594,_0x4a94aa){_0x369594=_0x369594-0x0;var _0x24913f=_0x76e0[_0x369594];return _0x24913f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x076e('0x0'));var router=express['Router']();var fs_extra=require(_0x076e('0x1'));var auth=require(_0x076e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x076e('0x3'));var controller=require(_0x076e('0x4'));router[_0x076e('0x5')]('/',auth[_0x076e('0x6')](),controller[_0x076e('0x7')]);router['get']('/:id',auth[_0x076e('0x6')](),controller[_0x076e('0x8')]);router[_0x076e('0x5')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x076e('0x6')](),controller[_0x076e('0x9')]);router[_0x076e('0x5')](_0x076e('0xa'),auth[_0x076e('0x6')](),controller[_0x076e('0xb')]);router[_0x076e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x076e('0xd')](_0x076e('0xe'),auth[_0x076e('0x6')](),controller[_0x076e('0xf')]);router[_0x076e('0x10')](_0x076e('0xe'),auth['isAuthenticated'](),controller[_0x076e('0x11')]);module[_0x076e('0x12')]=router; \ No newline at end of file +var _0x7400=['put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7400,0x1d7));var _0x0740=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x7400[_0x21af3a];return _0x268a49;};'use strict';var multer=require('multer');var util=require(_0x0740('0x0'));var path=require(_0x0740('0x1'));var timeout=require(_0x0740('0x2'));var express=require(_0x0740('0x3'));var router=express[_0x0740('0x4')]();var fs_extra=require(_0x0740('0x5'));var auth=require(_0x0740('0x6'));var interaction=require(_0x0740('0x7'));var config=require(_0x0740('0x8'));var controller=require(_0x0740('0x9'));router['get']('/',auth[_0x0740('0xa')](),controller[_0x0740('0xb')]);router['get'](_0x0740('0xc'),auth[_0x0740('0xa')](),controller[_0x0740('0xd')]);router[_0x0740('0xe')](_0x0740('0xf'),auth['isAuthenticated'](),controller[_0x0740('0x10')]);router[_0x0740('0xe')](_0x0740('0x11'),auth[_0x0740('0xa')](),controller[_0x0740('0x12')]);router[_0x0740('0xe')](_0x0740('0x13'),auth['isAuthenticated'](),controller[_0x0740('0x14')]);router[_0x0740('0x15')]('/',auth['isAuthenticated'](),controller[_0x0740('0x16')]);router[_0x0740('0x17')](_0x0740('0xc'),auth[_0x0740('0xa')](),controller[_0x0740('0x18')]);router[_0x0740('0x19')](_0x0740('0xc'),auth[_0x0740('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 6eb4ae1..3d3f3b4 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 _0x6287=['ENUM','incident','sequelize','exports','STRING'];(function(_0x1b734e,_0x456cd8){var _0x841eed=function(_0x15da60){while(--_0x15da60){_0x1b734e['push'](_0x1b734e['shift']());}};_0x841eed(++_0x456cd8);}(_0x6287,0xf2));var _0x7628=function(_0x3fc31d,_0x432bc9){_0x3fc31d=_0x3fc31d-0x0;var _0x31bb91=_0x6287[_0x3fc31d];return _0x31bb91;};'use strict';var Sequelize=require(_0x7628('0x0'));module[_0x7628('0x1')]={'name':{'type':Sequelize[_0x7628('0x2')]},'description':{'type':Sequelize[_0x7628('0x2')]},'ticketType':{'type':Sequelize[_0x7628('0x3')](_0x7628('0x4'),'phonecall'),'defaultValue':_0x7628('0x4')}}; \ No newline at end of file +var _0x0b58=['STRING','ENUM','phonecall','sequelize','exports'];(function(_0x2b3fa8,_0x33be7b){var _0x54aac8=function(_0x523fe2){while(--_0x523fe2){_0x2b3fa8['push'](_0x2b3fa8['shift']());}};_0x54aac8(++_0x33be7b);}(_0x0b58,0x184));var _0x80b5=function(_0x2e63e8,_0xed68f5){_0x2e63e8=_0x2e63e8-0x0;var _0x3fe904=_0x0b58[_0x2e63e8];return _0x3fe904;};'use strict';var Sequelize=require(_0x80b5('0x0'));module[_0x80b5('0x1')]={'name':{'type':Sequelize[_0x80b5('0x2')]},'description':{'type':Sequelize[_0x80b5('0x2')]},'ticketType':{'type':Sequelize[_0x80b5('0x3')]('incident',_0x80b5('0x4')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index a44ace9..9e36768 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 _0x21b1=['name','send','index','map','Dynamics365Configuration','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','catch','show','params','length','options','find','create','body','getFields','findOne','Dynamics365Field','rawAttributes','merge','getSubjects','getDescriptions','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack'];(function(_0x572ac8,_0x389c68){var _0x38b826=function(_0x6187fb){while(--_0x6187fb){_0x572ac8['push'](_0x572ac8['shift']());}};_0x38b826(++_0x389c68);}(_0x21b1,0x1e0));var _0x121b=function(_0x4e9ec4,_0x4b336b){_0x4e9ec4=_0x4e9ec4-0x0;var _0xa64e93=_0x21b1[_0x4e9ec4];return _0xa64e93;};'use strict';var emlformat=require(_0x121b('0x0'));var rimraf=require(_0x121b('0x1'));var zipdir=require(_0x121b('0x2'));var jsonpatch=require(_0x121b('0x3'));var rp=require(_0x121b('0x4'));var moment=require(_0x121b('0x5'));var BPromise=require(_0x121b('0x6'));var Mustache=require(_0x121b('0x7'));var util=require(_0x121b('0x8'));var path=require(_0x121b('0x9'));var sox=require(_0x121b('0xa'));var csv=require(_0x121b('0xb'));var ejs=require(_0x121b('0xc'));var fs=require('fs');var fs_extra=require(_0x121b('0xd'));var _=require(_0x121b('0xe'));var squel=require(_0x121b('0xf'));var crypto=require(_0x121b('0x10'));var jsforce=require(_0x121b('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x121b('0x12'));var Papa=require(_0x121b('0x13'));var Redis=require(_0x121b('0x14'));var authService=require(_0x121b('0x15'));var qs=require(_0x121b('0x16'));var as=require(_0x121b('0x17'));var hardwareService=require(_0x121b('0x18'));var logger=require(_0x121b('0x19'))('api');var utils=require(_0x121b('0x1a'));var config=require(_0x121b('0x1b'));var licenseUtil=require(_0x121b('0x1c'));var db=require(_0x121b('0x1d'))['db'];function respondWithStatusCode(_0x95c6e8,_0x3dd98b){_0x3dd98b=_0x3dd98b||0xcc;return function(_0x10e445){if(_0x10e445){return _0x95c6e8[_0x121b('0x1e')](_0x3dd98b);}return _0x95c6e8[_0x121b('0x1f')](_0x3dd98b)['end']();};}function respondWithResult(_0x22b523,_0x41fa02){_0x41fa02=_0x41fa02||0xc8;return function(_0x242d48){if(_0x242d48){return _0x22b523[_0x121b('0x1f')](_0x41fa02)[_0x121b('0x20')](_0x242d48);}};}function respondWithFilteredResult(_0x4be153,_0x5d9a47){return function(_0x4c8d9c){if(_0x4c8d9c){var _0x57a9d3=typeof _0x5d9a47[_0x121b('0x21')]===_0x121b('0x22')&&typeof _0x5d9a47[_0x121b('0x23')]===_0x121b('0x22');var _0x66a14a=_0x4c8d9c[_0x121b('0x24')];var _0x1b8347=_0x57a9d3?0x0:_0x5d9a47['offset'];var _0x584b33=_0x57a9d3?_0x4c8d9c[_0x121b('0x24')]:_0x5d9a47['offset']+_0x5d9a47[_0x121b('0x23')];var _0x37e4ea;if(_0x584b33>=_0x66a14a){_0x584b33=_0x66a14a;_0x37e4ea=0xc8;}else{_0x37e4ea=0xce;}_0x4be153['status'](_0x37e4ea);return _0x4be153[_0x121b('0x25')](_0x121b('0x26'),_0x1b8347+'-'+_0x584b33+'/'+_0x66a14a)['json'](_0x4c8d9c);}return null;};}function patchUpdates(_0x657ad1){return function(_0x4e58b9){try{jsonpatch[_0x121b('0x27')](_0x4e58b9,_0x657ad1,!![]);}catch(_0x249604){return BPromise[_0x121b('0x28')](_0x249604);}return _0x4e58b9[_0x121b('0x29')]();};}function saveUpdates(_0x59ce2c,_0x5cd7d9){return function(_0x18f456){if(_0x18f456){return _0x18f456[_0x121b('0x2a')](_0x59ce2c)['then'](function(_0x3b322c){return _0x3b322c;});}return null;};}function removeEntity(_0x31c942,_0x316ac2){return function(_0x2320bb){if(_0x2320bb){return _0x2320bb[_0x121b('0x2b')]()[_0x121b('0x2c')](function(){_0x31c942[_0x121b('0x1f')](0xcc)[_0x121b('0x2d')]();});}};}function handleEntityNotFound(_0x34f212,_0x105999){return function(_0x167c76){if(!_0x167c76){_0x34f212[_0x121b('0x1e')](0x194);}return _0x167c76;};}function handleError(_0x51ecbd,_0x4b8b1a){_0x4b8b1a=_0x4b8b1a||0x1f4;return function(_0x3366ae){logger[_0x121b('0x2e')](_0x3366ae[_0x121b('0x2f')]);if(_0x3366ae[_0x121b('0x30')]){delete _0x3366ae[_0x121b('0x30')];}_0x51ecbd[_0x121b('0x1f')](_0x4b8b1a)[_0x121b('0x31')](_0x3366ae);};}exports[_0x121b('0x32')]=function(_0x11ff53,_0x465f36){var _0x42de34={},_0x16762f={},_0x1d5475={'count':0x0,'rows':[]};var _0x39057c=_[_0x121b('0x33')](db[_0x121b('0x34')]['rawAttributes'],function(_0x34a47e){return{'name':_0x34a47e[_0x121b('0x35')],'type':_0x34a47e[_0x121b('0x36')][_0x121b('0x37')]};});_0x16762f['model']=_[_0x121b('0x33')](_0x39057c,_0x121b('0x30'));_0x16762f['query']=_[_0x121b('0x38')](_0x11ff53['query']);_0x16762f[_0x121b('0x39')]=_[_0x121b('0x3a')](_0x16762f[_0x121b('0x3b')],_0x16762f[_0x121b('0x3c')]);_0x42de34[_0x121b('0x3d')]=_[_0x121b('0x3a')](_0x16762f[_0x121b('0x3b')],qs['fields'](_0x11ff53[_0x121b('0x3c')][_0x121b('0x3e')]));_0x42de34['attributes']=_0x42de34[_0x121b('0x3d')]['length']?_0x42de34[_0x121b('0x3d')]:_0x16762f[_0x121b('0x3b')];if(!_0x11ff53[_0x121b('0x3c')][_0x121b('0x3f')](_0x121b('0x40'))){_0x42de34['limit']=qs[_0x121b('0x23')](_0x11ff53[_0x121b('0x3c')]['limit']);_0x42de34['offset']=qs['offset'](_0x11ff53[_0x121b('0x3c')][_0x121b('0x21')]);}_0x42de34[_0x121b('0x41')]=qs[_0x121b('0x42')](_0x11ff53[_0x121b('0x3c')][_0x121b('0x42')]);_0x42de34[_0x121b('0x43')]=qs[_0x121b('0x39')](_[_0x121b('0x44')](_0x11ff53[_0x121b('0x3c')],_0x16762f['filters']),_0x39057c);if(_0x11ff53[_0x121b('0x3c')]['filter']){_0x42de34['where']=_['merge'](_0x42de34[_0x121b('0x43')],{'$or':_['map'](_0x39057c,function(_0x169439){if(_0x169439['type']!=='VIRTUAL'){var _0x38c3a2={};_0x38c3a2[_0x169439[_0x121b('0x30')]]={'$like':'%'+_0x11ff53['query'][_0x121b('0x45')]+'%'};return _0x38c3a2;}})});}_0x42de34=_['merge']({},_0x42de34,_0x11ff53['options']);var _0xc6953a={'where':_0x42de34['where']};return db[_0x121b('0x34')][_0x121b('0x24')](_0xc6953a)['then'](function(_0x249575){_0x1d5475[_0x121b('0x24')]=_0x249575;if(_0x11ff53['query'][_0x121b('0x46')]){_0x42de34[_0x121b('0x47')]=[{'all':!![]}];}return db[_0x121b('0x34')][_0x121b('0x48')](_0x42de34);})[_0x121b('0x2c')](function(_0x8049c1){_0x1d5475['rows']=_0x8049c1;return _0x1d5475;})[_0x121b('0x2c')](respondWithFilteredResult(_0x465f36,_0x42de34))[_0x121b('0x49')](handleError(_0x465f36,null));};exports[_0x121b('0x4a')]=function(_0x176141,_0xa39af0){var _0x41857b={'raw':![],'where':{'id':_0x176141[_0x121b('0x4b')]['id']}},_0x203b04={};_0x203b04[_0x121b('0x3b')]=_[_0x121b('0x38')](db[_0x121b('0x34')]['rawAttributes']);_0x203b04[_0x121b('0x3c')]=_['keys'](_0x176141[_0x121b('0x3c')]);_0x203b04[_0x121b('0x39')]=_['intersection'](_0x203b04[_0x121b('0x3b')],_0x203b04[_0x121b('0x3c')]);_0x41857b['attributes']=_[_0x121b('0x3a')](_0x203b04['model'],qs['fields'](_0x176141[_0x121b('0x3c')]['fields']));_0x41857b[_0x121b('0x3d')]=_0x41857b[_0x121b('0x3d')][_0x121b('0x4c')]?_0x41857b[_0x121b('0x3d')]:_0x203b04[_0x121b('0x3b')];if(_0x176141['query'][_0x121b('0x46')]){_0x41857b[_0x121b('0x47')]=[{'all':!![]}];}_0x41857b=_['merge']({},_0x41857b,_0x176141[_0x121b('0x4d')]);return db['Dynamics365Configuration'][_0x121b('0x4e')](_0x41857b)['then'](handleEntityNotFound(_0xa39af0,null))[_0x121b('0x2c')](respondWithResult(_0xa39af0,null))[_0x121b('0x49')](handleError(_0xa39af0,null));};exports['create']=function(_0x3956fa,_0x51feff){return db[_0x121b('0x34')][_0x121b('0x4f')](_0x3956fa['body'],{})[_0x121b('0x2c')](respondWithResult(_0x51feff,0xc9))[_0x121b('0x49')](handleError(_0x51feff,null));};exports[_0x121b('0x2a')]=function(_0x2888d9,_0x32223b){if(_0x2888d9[_0x121b('0x50')]['id']){delete _0x2888d9[_0x121b('0x50')]['id'];}return db['Dynamics365Configuration'][_0x121b('0x4e')]({'where':{'id':_0x2888d9[_0x121b('0x4b')]['id']}})[_0x121b('0x2c')](handleEntityNotFound(_0x32223b,null))[_0x121b('0x2c')](saveUpdates(_0x2888d9[_0x121b('0x50')],null))[_0x121b('0x2c')](respondWithResult(_0x32223b,null))[_0x121b('0x49')](handleError(_0x32223b,null));};exports[_0x121b('0x2b')]=function(_0x9db47,_0x4d1e08){return db[_0x121b('0x34')][_0x121b('0x4e')]({'where':{'id':_0x9db47['params']['id']}})['then'](handleEntityNotFound(_0x4d1e08,null))[_0x121b('0x2c')](removeEntity(_0x4d1e08,null))['catch'](handleError(_0x4d1e08,null));};exports[_0x121b('0x51')]=function(_0x54feae,_0x44f568,_0x121c90){var _0x1d8532={};var _0x515a9a={};var _0x3a073c;var _0x5c3717;return db[_0x121b('0x34')][_0x121b('0x52')]({'where':{'id':_0x54feae[_0x121b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44f568,null))[_0x121b('0x2c')](function(_0x5ba088){if(_0x5ba088){_0x3a073c=_0x5ba088;_0x515a9a[_0x121b('0x3b')]=_[_0x121b('0x38')](db[_0x121b('0x53')][_0x121b('0x54')]);_0x515a9a[_0x121b('0x3c')]=_[_0x121b('0x38')](_0x54feae['query']);_0x515a9a[_0x121b('0x39')]=_[_0x121b('0x3a')](_0x515a9a[_0x121b('0x3b')],_0x515a9a['query']);_0x1d8532['attributes']=_['intersection'](_0x515a9a['model'],qs['fields'](_0x54feae[_0x121b('0x3c')]['fields']));_0x1d8532['attributes']=_0x1d8532[_0x121b('0x3d')][_0x121b('0x4c')]?_0x1d8532[_0x121b('0x3d')]:_0x515a9a['model'];_0x1d8532[_0x121b('0x41')]=qs['sort'](_0x54feae[_0x121b('0x3c')][_0x121b('0x42')]);_0x1d8532[_0x121b('0x43')]=qs['filters'](_[_0x121b('0x44')](_0x54feae[_0x121b('0x3c')],_0x515a9a[_0x121b('0x39')]));if(_0x54feae['query'][_0x121b('0x45')]){_0x1d8532[_0x121b('0x43')]=_[_0x121b('0x55')](_0x1d8532[_0x121b('0x43')],{'$or':_['map'](_0x1d8532[_0x121b('0x3d')],function(_0x431330){var _0x278a6c={};_0x278a6c[_0x431330]={'$like':'%'+_0x54feae[_0x121b('0x3c')][_0x121b('0x45')]+'%'};return _0x278a6c;})});}_0x1d8532=_[_0x121b('0x55')]({},_0x1d8532,_0x54feae['options']);return _0x3a073c['getFields'](_0x1d8532);}})[_0x121b('0x2c')](function(_0x1488aa){if(_0x1488aa){_0x5c3717=_0x1488aa[_0x121b('0x4c')];if(!_0x54feae['query']['hasOwnProperty'](_0x121b('0x40'))){_0x1d8532[_0x121b('0x23')]=qs[_0x121b('0x23')](_0x54feae[_0x121b('0x3c')][_0x121b('0x23')]);_0x1d8532[_0x121b('0x21')]=qs['offset'](_0x54feae[_0x121b('0x3c')][_0x121b('0x21')]);}return _0x3a073c['getFields'](_0x1d8532);}})[_0x121b('0x2c')](function(_0x569781){if(_0x569781){return _0x569781?{'count':_0x5c3717,'rows':_0x569781}:null;}})[_0x121b('0x2c')](respondWithResult(_0x44f568,null))[_0x121b('0x49')](handleError(_0x44f568,null));};exports[_0x121b('0x56')]=function(_0xb30387,_0x393971,_0x106a9b){var _0x501e01={};var _0x4ef676={};var _0x55a13f;var _0x19a56a;return db['Dynamics365Configuration'][_0x121b('0x52')]({'where':{'id':_0xb30387['params']['id']}})[_0x121b('0x2c')](handleEntityNotFound(_0x393971,null))[_0x121b('0x2c')](function(_0x366385){if(_0x366385){_0x55a13f=_0x366385;_0x4ef676[_0x121b('0x3b')]=_[_0x121b('0x38')](db['Dynamics365Field'][_0x121b('0x54')]);_0x4ef676[_0x121b('0x3c')]=_['keys'](_0xb30387[_0x121b('0x3c')]);_0x4ef676[_0x121b('0x39')]=_[_0x121b('0x3a')](_0x4ef676[_0x121b('0x3b')],_0x4ef676['query']);_0x501e01['attributes']=_['intersection'](_0x4ef676['model'],qs['fields'](_0xb30387['query'][_0x121b('0x3e')]));_0x501e01['attributes']=_0x501e01['attributes']['length']?_0x501e01[_0x121b('0x3d')]:_0x4ef676[_0x121b('0x3b')];_0x501e01[_0x121b('0x41')]=qs[_0x121b('0x42')](_0xb30387[_0x121b('0x3c')][_0x121b('0x42')]);_0x501e01[_0x121b('0x43')]=qs['filters'](_[_0x121b('0x44')](_0xb30387['query'],_0x4ef676[_0x121b('0x39')]));if(_0xb30387[_0x121b('0x3c')][_0x121b('0x45')]){_0x501e01[_0x121b('0x43')]=_[_0x121b('0x55')](_0x501e01[_0x121b('0x43')],{'$or':_['map'](_0x501e01[_0x121b('0x3d')],function(_0x5cc344){var _0x5cd0c0={};_0x5cd0c0[_0x5cc344]={'$like':'%'+_0xb30387[_0x121b('0x3c')][_0x121b('0x45')]+'%'};return _0x5cd0c0;})});}_0x501e01=_[_0x121b('0x55')]({},_0x501e01,_0xb30387['options']);return _0x55a13f['getSubjects'](_0x501e01);}})[_0x121b('0x2c')](function(_0x342571){if(_0x342571){_0x19a56a=_0x342571[_0x121b('0x4c')];if(!_0xb30387['query'][_0x121b('0x3f')](_0x121b('0x40'))){_0x501e01[_0x121b('0x23')]=qs[_0x121b('0x23')](_0xb30387[_0x121b('0x3c')][_0x121b('0x23')]);_0x501e01[_0x121b('0x21')]=qs[_0x121b('0x21')](_0xb30387['query'][_0x121b('0x21')]);}return _0x55a13f[_0x121b('0x56')](_0x501e01);}})['then'](function(_0x5791b1){if(_0x5791b1){return _0x5791b1?{'count':_0x19a56a,'rows':_0x5791b1}:null;}})['then'](respondWithResult(_0x393971,null))['catch'](handleError(_0x393971,null));};exports[_0x121b('0x57')]=function(_0x528703,_0x17f465,_0x3c4140){var _0x349158={};var _0x385edf={};var _0x3a8342;var _0x426bf3;return db[_0x121b('0x34')][_0x121b('0x52')]({'where':{'id':_0x528703[_0x121b('0x4b')]['id']}})[_0x121b('0x2c')](handleEntityNotFound(_0x17f465,null))[_0x121b('0x2c')](function(_0x48715c){if(_0x48715c){_0x3a8342=_0x48715c;_0x385edf[_0x121b('0x3b')]=_[_0x121b('0x38')](db[_0x121b('0x53')]['rawAttributes']);_0x385edf[_0x121b('0x3c')]=_[_0x121b('0x38')](_0x528703[_0x121b('0x3c')]);_0x385edf[_0x121b('0x39')]=_[_0x121b('0x3a')](_0x385edf[_0x121b('0x3b')],_0x385edf['query']);_0x349158[_0x121b('0x3d')]=_[_0x121b('0x3a')](_0x385edf[_0x121b('0x3b')],qs['fields'](_0x528703[_0x121b('0x3c')]['fields']));_0x349158[_0x121b('0x3d')]=_0x349158[_0x121b('0x3d')][_0x121b('0x4c')]?_0x349158[_0x121b('0x3d')]:_0x385edf[_0x121b('0x3b')];_0x349158[_0x121b('0x41')]=qs[_0x121b('0x42')](_0x528703['query']['sort']);_0x349158[_0x121b('0x43')]=qs['filters'](_[_0x121b('0x44')](_0x528703[_0x121b('0x3c')],_0x385edf[_0x121b('0x39')]));if(_0x528703[_0x121b('0x3c')][_0x121b('0x45')]){_0x349158[_0x121b('0x43')]=_[_0x121b('0x55')](_0x349158[_0x121b('0x43')],{'$or':_[_0x121b('0x33')](_0x349158[_0x121b('0x3d')],function(_0x3a82fe){var _0x480dbb={};_0x480dbb[_0x3a82fe]={'$like':'%'+_0x528703[_0x121b('0x3c')][_0x121b('0x45')]+'%'};return _0x480dbb;})});}_0x349158=_[_0x121b('0x55')]({},_0x349158,_0x528703['options']);return _0x3a8342[_0x121b('0x57')](_0x349158);}})[_0x121b('0x2c')](function(_0x3d9617){if(_0x3d9617){_0x426bf3=_0x3d9617[_0x121b('0x4c')];if(!_0x528703[_0x121b('0x3c')][_0x121b('0x3f')](_0x121b('0x40'))){_0x349158['limit']=qs[_0x121b('0x23')](_0x528703[_0x121b('0x3c')][_0x121b('0x23')]);_0x349158[_0x121b('0x21')]=qs[_0x121b('0x21')](_0x528703[_0x121b('0x3c')][_0x121b('0x21')]);}return _0x3a8342[_0x121b('0x57')](_0x349158);}})[_0x121b('0x2c')](function(_0x392819){if(_0x392819){return _0x392819?{'count':_0x426bf3,'rows':_0x392819}:null;}})[_0x121b('0x2c')](respondWithResult(_0x17f465,null))[_0x121b('0x49')](handleError(_0x17f465,null));}; \ No newline at end of file +var _0xc851=['stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','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','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy'];(function(_0x4787c3,_0x2f71a2){var _0x64885a=function(_0x1994c7){while(--_0x1994c7){_0x4787c3['push'](_0x4787c3['shift']());}};_0x64885a(++_0x2f71a2);}(_0xc851,0x16a));var _0x1c85=function(_0x2e15b0,_0x2e925e){_0x2e15b0=_0x2e15b0-0x0;var _0x979b09=_0xc851[_0x2e15b0];return _0x979b09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c85('0x0'));var zipdir=require(_0x1c85('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c85('0x2'));var moment=require(_0x1c85('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1c85('0x4'));var util=require(_0x1c85('0x5'));var path=require('path');var sox=require(_0x1c85('0x6'));var csv=require(_0x1c85('0x7'));var ejs=require(_0x1c85('0x8'));var fs=require('fs');var fs_extra=require(_0x1c85('0x9'));var _=require(_0x1c85('0xa'));var squel=require(_0x1c85('0xb'));var crypto=require(_0x1c85('0xc'));var jsforce=require(_0x1c85('0xd'));var deskjs=require(_0x1c85('0xe'));var toCsv=require(_0x1c85('0x7'));var querystring=require(_0x1c85('0xf'));var Papa=require(_0x1c85('0x10'));var Redis=require('ioredis');var authService=require(_0x1c85('0x11'));var qs=require(_0x1c85('0x12'));var as=require(_0x1c85('0x13'));var hardwareService=require(_0x1c85('0x14'));var logger=require(_0x1c85('0x15'))('api');var utils=require(_0x1c85('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c85('0x17'));var db=require(_0x1c85('0x18'))['db'];function respondWithStatusCode(_0x1394ec,_0x3798a){_0x3798a=_0x3798a||0xcc;return function(_0x31ad2e){if(_0x31ad2e){return _0x1394ec['sendStatus'](_0x3798a);}return _0x1394ec[_0x1c85('0x19')](_0x3798a)[_0x1c85('0x1a')]();};}function respondWithResult(_0x1c6aeb,_0x1bf11c){_0x1bf11c=_0x1bf11c||0xc8;return function(_0x18a727){if(_0x18a727){return _0x1c6aeb[_0x1c85('0x19')](_0x1bf11c)['json'](_0x18a727);}};}function respondWithFilteredResult(_0x1f0acc,_0x45b008){return function(_0x17030a){if(_0x17030a){var _0x53bed4=typeof _0x45b008['offset']===_0x1c85('0x1b')&&typeof _0x45b008[_0x1c85('0x1c')]===_0x1c85('0x1b');var _0xbfc682=_0x17030a[_0x1c85('0x1d')];var _0x4f5147=_0x53bed4?0x0:_0x45b008[_0x1c85('0x1e')];var _0x3345c6=_0x53bed4?_0x17030a[_0x1c85('0x1d')]:_0x45b008[_0x1c85('0x1e')]+_0x45b008[_0x1c85('0x1c')];var _0x5f0390;if(_0x3345c6>=_0xbfc682){_0x3345c6=_0xbfc682;_0x5f0390=0xc8;}else{_0x5f0390=0xce;}_0x1f0acc['status'](_0x5f0390);return _0x1f0acc['set']('Content-Range',_0x4f5147+'-'+_0x3345c6+'/'+_0xbfc682)[_0x1c85('0x1f')](_0x17030a);}return null;};}function patchUpdates(_0x41a0ca){return function(_0x10cec4){try{jsonpatch[_0x1c85('0x20')](_0x10cec4,_0x41a0ca,!![]);}catch(_0x529e9f){return BPromise[_0x1c85('0x21')](_0x529e9f);}return _0x10cec4[_0x1c85('0x22')]();};}function saveUpdates(_0xbe286e,_0x4de92b){return function(_0x18ca6b){if(_0x18ca6b){return _0x18ca6b[_0x1c85('0x23')](_0xbe286e)[_0x1c85('0x24')](function(_0x5de252){return _0x5de252;});}return null;};}function removeEntity(_0x4fe2c4,_0x22e495){return function(_0x1c673f){if(_0x1c673f){return _0x1c673f[_0x1c85('0x25')]()[_0x1c85('0x24')](function(){_0x4fe2c4['status'](0xcc)[_0x1c85('0x1a')]();});}};}function handleEntityNotFound(_0x4a7438,_0x3cd52f){return function(_0x5aafe9){if(!_0x5aafe9){_0x4a7438['sendStatus'](0x194);}return _0x5aafe9;};}function handleError(_0xba1b8c,_0x151ccf){_0x151ccf=_0x151ccf||0x1f4;return function(_0x30f332){logger['error'](_0x30f332[_0x1c85('0x26')]);if(_0x30f332[_0x1c85('0x27')]){delete _0x30f332['name'];}_0xba1b8c[_0x1c85('0x19')](_0x151ccf)[_0x1c85('0x28')](_0x30f332);};}exports[_0x1c85('0x29')]=function(_0x3ba4c3,_0x48117f){var _0x5882a8={},_0x41fb6c={},_0xb8e039={'count':0x0,'rows':[]};var _0x2f3c62=_[_0x1c85('0x2a')](db[_0x1c85('0x2b')][_0x1c85('0x2c')],function(_0x1f7491){return{'name':_0x1f7491[_0x1c85('0x2d')],'type':_0x1f7491['type'][_0x1c85('0x2e')]};});_0x41fb6c[_0x1c85('0x2f')]=_[_0x1c85('0x2a')](_0x2f3c62,_0x1c85('0x27'));_0x41fb6c[_0x1c85('0x30')]=_[_0x1c85('0x31')](_0x3ba4c3[_0x1c85('0x30')]);_0x41fb6c[_0x1c85('0x32')]=_[_0x1c85('0x33')](_0x41fb6c['model'],_0x41fb6c['query']);_0x5882a8['attributes']=_[_0x1c85('0x33')](_0x41fb6c[_0x1c85('0x2f')],qs[_0x1c85('0x34')](_0x3ba4c3[_0x1c85('0x30')]['fields']));_0x5882a8[_0x1c85('0x35')]=_0x5882a8[_0x1c85('0x35')]['length']?_0x5882a8[_0x1c85('0x35')]:_0x41fb6c[_0x1c85('0x2f')];if(!_0x3ba4c3['query'][_0x1c85('0x36')](_0x1c85('0x37'))){_0x5882a8['limit']=qs[_0x1c85('0x1c')](_0x3ba4c3[_0x1c85('0x30')]['limit']);_0x5882a8['offset']=qs[_0x1c85('0x1e')](_0x3ba4c3[_0x1c85('0x30')][_0x1c85('0x1e')]);}_0x5882a8[_0x1c85('0x38')]=qs[_0x1c85('0x39')](_0x3ba4c3['query'][_0x1c85('0x39')]);_0x5882a8[_0x1c85('0x3a')]=qs[_0x1c85('0x32')](_[_0x1c85('0x3b')](_0x3ba4c3[_0x1c85('0x30')],_0x41fb6c[_0x1c85('0x32')]),_0x2f3c62);if(_0x3ba4c3[_0x1c85('0x30')][_0x1c85('0x3c')]){_0x5882a8[_0x1c85('0x3a')]=_[_0x1c85('0x3d')](_0x5882a8[_0x1c85('0x3a')],{'$or':_[_0x1c85('0x2a')](_0x2f3c62,function(_0x55e208){if(_0x55e208[_0x1c85('0x3e')]!=='VIRTUAL'){var _0x51aa3b={};_0x51aa3b[_0x55e208[_0x1c85('0x27')]]={'$like':'%'+_0x3ba4c3[_0x1c85('0x30')][_0x1c85('0x3c')]+'%'};return _0x51aa3b;}})});}_0x5882a8=_['merge']({},_0x5882a8,_0x3ba4c3['options']);var _0x20df67={'where':_0x5882a8[_0x1c85('0x3a')]};return db[_0x1c85('0x2b')]['count'](_0x20df67)[_0x1c85('0x24')](function(_0x30c6b3){_0xb8e039[_0x1c85('0x1d')]=_0x30c6b3;if(_0x3ba4c3[_0x1c85('0x30')][_0x1c85('0x3f')]){_0x5882a8[_0x1c85('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x1c85('0x41')](_0x5882a8);})['then'](function(_0x3d187b){_0xb8e039[_0x1c85('0x42')]=_0x3d187b;return _0xb8e039;})[_0x1c85('0x24')](respondWithFilteredResult(_0x48117f,_0x5882a8))['catch'](handleError(_0x48117f,null));};exports[_0x1c85('0x43')]=function(_0x39f44a,_0xc38531){var _0x4dc2e0={'raw':![],'where':{'id':_0x39f44a[_0x1c85('0x44')]['id']}},_0x7f375c={};_0x7f375c[_0x1c85('0x2f')]=_[_0x1c85('0x31')](db['Dynamics365Configuration'][_0x1c85('0x2c')]);_0x7f375c['query']=_[_0x1c85('0x31')](_0x39f44a['query']);_0x7f375c[_0x1c85('0x32')]=_[_0x1c85('0x33')](_0x7f375c['model'],_0x7f375c['query']);_0x4dc2e0[_0x1c85('0x35')]=_['intersection'](_0x7f375c['model'],qs['fields'](_0x39f44a['query']['fields']));_0x4dc2e0[_0x1c85('0x35')]=_0x4dc2e0[_0x1c85('0x35')][_0x1c85('0x45')]?_0x4dc2e0['attributes']:_0x7f375c[_0x1c85('0x2f')];if(_0x39f44a[_0x1c85('0x30')]['includeAll']){_0x4dc2e0[_0x1c85('0x40')]=[{'all':!![]}];}_0x4dc2e0=_['merge']({},_0x4dc2e0,_0x39f44a[_0x1c85('0x46')]);return db[_0x1c85('0x2b')]['find'](_0x4dc2e0)[_0x1c85('0x24')](handleEntityNotFound(_0xc38531,null))['then'](respondWithResult(_0xc38531,null))[_0x1c85('0x47')](handleError(_0xc38531,null));};exports[_0x1c85('0x48')]=function(_0x21bc84,_0x5a08d5){return db[_0x1c85('0x2b')][_0x1c85('0x48')](_0x21bc84[_0x1c85('0x49')],{})[_0x1c85('0x24')](respondWithResult(_0x5a08d5,0xc9))['catch'](handleError(_0x5a08d5,null));};exports[_0x1c85('0x23')]=function(_0x38f8b4,_0x52dffe){if(_0x38f8b4[_0x1c85('0x49')]['id']){delete _0x38f8b4[_0x1c85('0x49')]['id'];}return db[_0x1c85('0x2b')][_0x1c85('0x4a')]({'where':{'id':_0x38f8b4[_0x1c85('0x44')]['id']}})['then'](handleEntityNotFound(_0x52dffe,null))[_0x1c85('0x24')](saveUpdates(_0x38f8b4['body'],null))[_0x1c85('0x24')](respondWithResult(_0x52dffe,null))[_0x1c85('0x47')](handleError(_0x52dffe,null));};exports[_0x1c85('0x25')]=function(_0x5ea872,_0x4ddcba){return db['Dynamics365Configuration'][_0x1c85('0x4a')]({'where':{'id':_0x5ea872[_0x1c85('0x44')]['id']}})[_0x1c85('0x24')](handleEntityNotFound(_0x4ddcba,null))[_0x1c85('0x24')](removeEntity(_0x4ddcba,null))[_0x1c85('0x47')](handleError(_0x4ddcba,null));};exports[_0x1c85('0x4b')]=function(_0x556fc7,_0x4c7e9f,_0x38a963){var _0xe91bdd={};var _0x65fc2d={};var _0x2a2cc;var _0x5c37b7;return db[_0x1c85('0x2b')][_0x1c85('0x4c')]({'where':{'id':_0x556fc7[_0x1c85('0x44')]['id']}})[_0x1c85('0x24')](handleEntityNotFound(_0x4c7e9f,null))[_0x1c85('0x24')](function(_0xfd2bd2){if(_0xfd2bd2){_0x2a2cc=_0xfd2bd2;_0x65fc2d[_0x1c85('0x2f')]=_[_0x1c85('0x31')](db[_0x1c85('0x4d')][_0x1c85('0x2c')]);_0x65fc2d['query']=_[_0x1c85('0x31')](_0x556fc7[_0x1c85('0x30')]);_0x65fc2d[_0x1c85('0x32')]=_[_0x1c85('0x33')](_0x65fc2d[_0x1c85('0x2f')],_0x65fc2d[_0x1c85('0x30')]);_0xe91bdd['attributes']=_[_0x1c85('0x33')](_0x65fc2d[_0x1c85('0x2f')],qs[_0x1c85('0x34')](_0x556fc7[_0x1c85('0x30')][_0x1c85('0x34')]));_0xe91bdd[_0x1c85('0x35')]=_0xe91bdd['attributes'][_0x1c85('0x45')]?_0xe91bdd[_0x1c85('0x35')]:_0x65fc2d['model'];_0xe91bdd[_0x1c85('0x38')]=qs[_0x1c85('0x39')](_0x556fc7[_0x1c85('0x30')][_0x1c85('0x39')]);_0xe91bdd['where']=qs[_0x1c85('0x32')](_[_0x1c85('0x3b')](_0x556fc7[_0x1c85('0x30')],_0x65fc2d[_0x1c85('0x32')]));if(_0x556fc7[_0x1c85('0x30')][_0x1c85('0x3c')]){_0xe91bdd[_0x1c85('0x3a')]=_[_0x1c85('0x3d')](_0xe91bdd['where'],{'$or':_[_0x1c85('0x2a')](_0xe91bdd[_0x1c85('0x35')],function(_0x19dbd3){var _0x4d61c5={};_0x4d61c5[_0x19dbd3]={'$like':'%'+_0x556fc7[_0x1c85('0x30')][_0x1c85('0x3c')]+'%'};return _0x4d61c5;})});}_0xe91bdd=_[_0x1c85('0x3d')]({},_0xe91bdd,_0x556fc7[_0x1c85('0x46')]);return _0x2a2cc[_0x1c85('0x4b')](_0xe91bdd);}})[_0x1c85('0x24')](function(_0x2ccfa0){if(_0x2ccfa0){_0x5c37b7=_0x2ccfa0[_0x1c85('0x45')];if(!_0x556fc7[_0x1c85('0x30')][_0x1c85('0x36')](_0x1c85('0x37'))){_0xe91bdd['limit']=qs[_0x1c85('0x1c')](_0x556fc7['query'][_0x1c85('0x1c')]);_0xe91bdd[_0x1c85('0x1e')]=qs[_0x1c85('0x1e')](_0x556fc7[_0x1c85('0x30')][_0x1c85('0x1e')]);}return _0x2a2cc[_0x1c85('0x4b')](_0xe91bdd);}})[_0x1c85('0x24')](function(_0x59377f){if(_0x59377f){return _0x59377f?{'count':_0x5c37b7,'rows':_0x59377f}:null;}})[_0x1c85('0x24')](respondWithResult(_0x4c7e9f,null))[_0x1c85('0x47')](handleError(_0x4c7e9f,null));};exports['getSubjects']=function(_0x39dea2,_0x34bd37,_0x5a129d){var _0x2fc2e1={};var _0x3bd32b={};var _0x4bd3eb;var _0x5a98f9;return db[_0x1c85('0x2b')][_0x1c85('0x4c')]({'where':{'id':_0x39dea2[_0x1c85('0x44')]['id']}})[_0x1c85('0x24')](handleEntityNotFound(_0x34bd37,null))[_0x1c85('0x24')](function(_0x2b8197){if(_0x2b8197){_0x4bd3eb=_0x2b8197;_0x3bd32b[_0x1c85('0x2f')]=_[_0x1c85('0x31')](db[_0x1c85('0x4d')][_0x1c85('0x2c')]);_0x3bd32b['query']=_[_0x1c85('0x31')](_0x39dea2[_0x1c85('0x30')]);_0x3bd32b[_0x1c85('0x32')]=_['intersection'](_0x3bd32b[_0x1c85('0x2f')],_0x3bd32b[_0x1c85('0x30')]);_0x2fc2e1[_0x1c85('0x35')]=_[_0x1c85('0x33')](_0x3bd32b['model'],qs[_0x1c85('0x34')](_0x39dea2[_0x1c85('0x30')]['fields']));_0x2fc2e1['attributes']=_0x2fc2e1[_0x1c85('0x35')]['length']?_0x2fc2e1[_0x1c85('0x35')]:_0x3bd32b['model'];_0x2fc2e1[_0x1c85('0x38')]=qs['sort'](_0x39dea2[_0x1c85('0x30')][_0x1c85('0x39')]);_0x2fc2e1[_0x1c85('0x3a')]=qs['filters'](_['pick'](_0x39dea2[_0x1c85('0x30')],_0x3bd32b['filters']));if(_0x39dea2[_0x1c85('0x30')][_0x1c85('0x3c')]){_0x2fc2e1[_0x1c85('0x3a')]=_[_0x1c85('0x3d')](_0x2fc2e1[_0x1c85('0x3a')],{'$or':_[_0x1c85('0x2a')](_0x2fc2e1['attributes'],function(_0x53f2cd){var _0x5e2e9a={};_0x5e2e9a[_0x53f2cd]={'$like':'%'+_0x39dea2[_0x1c85('0x30')][_0x1c85('0x3c')]+'%'};return _0x5e2e9a;})});}_0x2fc2e1=_[_0x1c85('0x3d')]({},_0x2fc2e1,_0x39dea2[_0x1c85('0x46')]);return _0x4bd3eb[_0x1c85('0x4e')](_0x2fc2e1);}})[_0x1c85('0x24')](function(_0x4bbf28){if(_0x4bbf28){_0x5a98f9=_0x4bbf28[_0x1c85('0x45')];if(!_0x39dea2[_0x1c85('0x30')][_0x1c85('0x36')](_0x1c85('0x37'))){_0x2fc2e1[_0x1c85('0x1c')]=qs[_0x1c85('0x1c')](_0x39dea2[_0x1c85('0x30')][_0x1c85('0x1c')]);_0x2fc2e1['offset']=qs[_0x1c85('0x1e')](_0x39dea2[_0x1c85('0x30')][_0x1c85('0x1e')]);}return _0x4bd3eb['getSubjects'](_0x2fc2e1);}})['then'](function(_0x105ebb){if(_0x105ebb){return _0x105ebb?{'count':_0x5a98f9,'rows':_0x105ebb}:null;}})[_0x1c85('0x24')](respondWithResult(_0x34bd37,null))[_0x1c85('0x47')](handleError(_0x34bd37,null));};exports['getDescriptions']=function(_0x2a7ef0,_0x4050f6,_0x4a9518){var _0x303c3e={};var _0x324a64={};var _0x4a3391;var _0x9fdc7;return db[_0x1c85('0x2b')]['findOne']({'where':{'id':_0x2a7ef0[_0x1c85('0x44')]['id']}})[_0x1c85('0x24')](handleEntityNotFound(_0x4050f6,null))[_0x1c85('0x24')](function(_0xb57f82){if(_0xb57f82){_0x4a3391=_0xb57f82;_0x324a64[_0x1c85('0x2f')]=_[_0x1c85('0x31')](db[_0x1c85('0x4d')][_0x1c85('0x2c')]);_0x324a64['query']=_['keys'](_0x2a7ef0[_0x1c85('0x30')]);_0x324a64[_0x1c85('0x32')]=_[_0x1c85('0x33')](_0x324a64[_0x1c85('0x2f')],_0x324a64[_0x1c85('0x30')]);_0x303c3e[_0x1c85('0x35')]=_['intersection'](_0x324a64['model'],qs['fields'](_0x2a7ef0[_0x1c85('0x30')][_0x1c85('0x34')]));_0x303c3e[_0x1c85('0x35')]=_0x303c3e['attributes'][_0x1c85('0x45')]?_0x303c3e[_0x1c85('0x35')]:_0x324a64[_0x1c85('0x2f')];_0x303c3e[_0x1c85('0x38')]=qs[_0x1c85('0x39')](_0x2a7ef0[_0x1c85('0x30')]['sort']);_0x303c3e[_0x1c85('0x3a')]=qs[_0x1c85('0x32')](_[_0x1c85('0x3b')](_0x2a7ef0[_0x1c85('0x30')],_0x324a64[_0x1c85('0x32')]));if(_0x2a7ef0[_0x1c85('0x30')][_0x1c85('0x3c')]){_0x303c3e[_0x1c85('0x3a')]=_[_0x1c85('0x3d')](_0x303c3e[_0x1c85('0x3a')],{'$or':_[_0x1c85('0x2a')](_0x303c3e[_0x1c85('0x35')],function(_0x239a68){var _0x5a540f={};_0x5a540f[_0x239a68]={'$like':'%'+_0x2a7ef0['query']['filter']+'%'};return _0x5a540f;})});}_0x303c3e=_[_0x1c85('0x3d')]({},_0x303c3e,_0x2a7ef0[_0x1c85('0x46')]);return _0x4a3391[_0x1c85('0x4f')](_0x303c3e);}})[_0x1c85('0x24')](function(_0x3f4c49){if(_0x3f4c49){_0x9fdc7=_0x3f4c49[_0x1c85('0x45')];if(!_0x2a7ef0[_0x1c85('0x30')][_0x1c85('0x36')](_0x1c85('0x37'))){_0x303c3e[_0x1c85('0x1c')]=qs[_0x1c85('0x1c')](_0x2a7ef0['query'][_0x1c85('0x1c')]);_0x303c3e[_0x1c85('0x1e')]=qs[_0x1c85('0x1e')](_0x2a7ef0[_0x1c85('0x30')]['offset']);}return _0x4a3391[_0x1c85('0x4f')](_0x303c3e);}})[_0x1c85('0x24')](function(_0x489dbf){if(_0x489dbf){return _0x489dbf?{'count':_0x9fdc7,'rows':_0x489dbf}:null;}})[_0x1c85('0x24')](respondWithResult(_0x4050f6,null))[_0x1c85('0x47')](handleError(_0x4050f6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5d71c1a..c78a7bb 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 _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x25db87,_0x217be5){var _0x42ed40=function(_0xdcfca4){while(--_0xdcfca4){_0x25db87['push'](_0x25db87['shift']());}};_0x42ed40(++_0x217be5);}(_0x5b02,0xe9));var _0x25b0=function(_0x55dd02,_0x3ece50){_0x55dd02=_0x55dd02-0x0;var _0x21ea82=_0x5b02[_0x55dd02];return _0x21ea82;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x53807d,_0x4a90a8){var _0x501207=function(_0xea7078){while(--_0xea7078){_0x53807d['push'](_0x53807d['shift']());}};_0x501207(++_0x4a90a8);}(_0x008c,0x188));var _0xc008=function(_0x115d8d,_0xacde78){_0x115d8d=_0x115d8d-0x0;var _0x250c76=_0x008c[_0x115d8d];return _0x250c76;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 6f3e098..ed10218 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 _0x2229=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent','debug'];(function(_0x328554,_0x36fdd7){var _0x1d93fd=function(_0x277e58){while(--_0x277e58){_0x328554['push'](_0x328554['shift']());}};_0x1d93fd(++_0x36fdd7);}(_0x2229,0x12e));var _0x9222=function(_0x7ff50b,_0x399dc0){_0x7ff50b=_0x7ff50b-0x0;var _0x43e570=_0x2229[_0x7ff50b];return _0x43e570;};'use strict';var _=require('lodash');var util=require(_0x9222('0x0'));var moment=require('moment');var BPromise=require(_0x9222('0x1'));var rs=require(_0x9222('0x2'));var fs=require('fs');var Redis=require(_0x9222('0x3'));var db=require(_0x9222('0x4'))['db'];var utils=require(_0x9222('0x5'));var logger=require(_0x9222('0x6'))(_0x9222('0x7'));var config=require(_0x9222('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9222('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7c9e,_0x2766ac,_0x5b357f){return new BPromise(function(_0x5c0c11,_0x449e11){return client[_0x9222('0xa')](_0x1f7c9e,_0x5b357f)['then'](function(_0x2b86a0){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x2766ac,_0x9222('0xb'));logger[_0x9222('0xc')](_0x9222('0xd'),_0x2766ac,_0x9222('0xb'),JSON[_0x9222('0xe')](_0x2b86a0));if(_0x2b86a0[_0x9222('0xf')]){if(_0x2b86a0[_0x9222('0xf')][_0x9222('0x10')]===0x1f4){logger[_0x9222('0xf')](_0x9222('0x11'),_0x2766ac,_0x2b86a0['error'][_0x9222('0x12')]);return _0x449e11(_0x2b86a0[_0x9222('0xf')]['message']);}logger[_0x9222('0xf')](_0x9222('0x11'),_0x2766ac,_0x2b86a0['error'][_0x9222('0x12')]);return _0x5c0c11(_0x2b86a0[_0x9222('0xf')][_0x9222('0x12')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x2766ac,_0x9222('0xb'));_0x5c0c11(_0x2b86a0[_0x9222('0x13')]['message']);}})[_0x9222('0x14')](function(_0x2a3dee){logger[_0x9222('0xf')](_0x9222('0x11'),_0x2766ac,_0x2a3dee);_0x449e11(_0x2a3dee);});});} \ No newline at end of file +var _0x5fdd=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0x29c425,_0x4cc8aa){var _0xf5e207=function(_0x5c449a){while(--_0x5c449a){_0x29c425['push'](_0x29c425['shift']());}};_0xf5e207(++_0x4cc8aa);}(_0x5fdd,0x1b9));var _0xd5fd=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0x5fdd[_0x592d48];return _0x5d789e;};'use strict';var _=require(_0xd5fd('0x0'));var util=require(_0xd5fd('0x1'));var moment=require('moment');var BPromise=require(_0xd5fd('0x2'));var rs=require(_0xd5fd('0x3'));var fs=require('fs');var Redis=require(_0xd5fd('0x4'));var db=require(_0xd5fd('0x5'))['db'];var utils=require(_0xd5fd('0x6'));var logger=require(_0xd5fd('0x7'))(_0xd5fd('0x8'));var config=require(_0xd5fd('0x9'));var jayson=require(_0xd5fd('0xa'));var client=jayson[_0xd5fd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd866,_0xa9541f,_0x1e0b57){return new BPromise(function(_0x5863db,_0x3d29a6){return client['request'](_0x5cd866,_0x1e0b57)[_0xd5fd('0xc')](function(_0x6ac342){logger['info'](_0xd5fd('0xd'),_0xa9541f,_0xd5fd('0xe'));logger[_0xd5fd('0xf')](_0xd5fd('0x10'),_0xa9541f,'request\x20sent',JSON['stringify'](_0x6ac342));if(_0x6ac342['error']){if(_0x6ac342['error'][_0xd5fd('0x11')]===0x1f4){logger['error'](_0xd5fd('0xd'),_0xa9541f,_0x6ac342[_0xd5fd('0x12')][_0xd5fd('0x13')]);return _0x3d29a6(_0x6ac342[_0xd5fd('0x12')]['message']);}logger['error'](_0xd5fd('0xd'),_0xa9541f,_0x6ac342['error'][_0xd5fd('0x13')]);return _0x5863db(_0x6ac342['error'][_0xd5fd('0x13')]);}else{logger['info'](_0xd5fd('0xd'),_0xa9541f,_0xd5fd('0xe'));_0x5863db(_0x6ac342['result']['message']);}})[_0xd5fd('0x14')](function(_0x39f6a8){logger[_0xd5fd('0x12')](_0xd5fd('0xd'),_0xa9541f,_0x39f6a8);_0x3d29a6(_0x39f6a8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index c7cd294..5d59c6c 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 _0xdf30=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer'];(function(_0x5e6eac,_0x7d6b04){var _0x27afd9=function(_0x4cbdb9){while(--_0x4cbdb9){_0x5e6eac['push'](_0x5e6eac['shift']());}};_0x27afd9(++_0x7d6b04);}(_0xdf30,0x11f));var _0x0df3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf30[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0df3('0x0'));var util=require(_0x0df3('0x1'));var path=require(_0x0df3('0x2'));var timeout=require('connect-timeout');var express=require(_0x0df3('0x3'));var router=express[_0x0df3('0x4')]();var fs_extra=require(_0x0df3('0x5'));var auth=require(_0x0df3('0x6'));var interaction=require(_0x0df3('0x7'));var config=require(_0x0df3('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x0df3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0df3('0x9')](_0x0df3('0xa'),auth[_0x0df3('0xb')](),controller[_0x0df3('0xc')]);router['post']('/',auth[_0x0df3('0xb')](),controller[_0x0df3('0xd')]);router[_0x0df3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0df3('0xf')]);router[_0x0df3('0x10')](_0x0df3('0xa'),auth[_0x0df3('0xb')](),controller[_0x0df3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4e99=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','delete','multer','path','connect-timeout','express','Router'];(function(_0x546cad,_0x39e440){var _0x3dc016=function(_0x1c0e09){while(--_0x1c0e09){_0x546cad['push'](_0x546cad['shift']());}};_0x3dc016(++_0x39e440);}(_0x4e99,0x8b));var _0x94e9=function(_0x3d63fc,_0x2db8d0){_0x3d63fc=_0x3d63fc-0x0;var _0x5dc29c=_0x4e99[_0x3d63fc];return _0x5dc29c;};'use strict';var multer=require(_0x94e9('0x0'));var util=require('util');var path=require(_0x94e9('0x1'));var timeout=require(_0x94e9('0x2'));var express=require(_0x94e9('0x3'));var router=express[_0x94e9('0x4')]();var fs_extra=require(_0x94e9('0x5'));var auth=require(_0x94e9('0x6'));var interaction=require(_0x94e9('0x7'));var config=require(_0x94e9('0x8'));var controller=require(_0x94e9('0x9'));router[_0x94e9('0xa')]('/',auth[_0x94e9('0xb')](),controller[_0x94e9('0xc')]);router[_0x94e9('0xa')](_0x94e9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x94e9('0xe')]('/',auth[_0x94e9('0xb')](),controller[_0x94e9('0xf')]);router[_0x94e9('0x10')](_0x94e9('0xd'),auth[_0x94e9('0xb')](),controller['update']);router[_0x94e9('0x11')](_0x94e9('0xd'),auth[_0x94e9('0xb')](),controller['destroy']);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 2516cc7..d84054f 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 _0x658f=['string','variable','customVariable','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x50aaea,_0x30be7e){var _0x13eccf=function(_0x556049){while(--_0x556049){_0x50aaea['push'](_0x50aaea['shift']());}};_0x13eccf(++_0x30be7e);}(_0x658f,0x147));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf658('0x0'));module['exports']={'type':{'type':Sequelize[_0xf658('0x1')](_0xf658('0x2'),_0xf658('0x3'),_0xf658('0x4'),'keyValue','picklist'),'defaultValue':_0xf658('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf658('0x5')]},'keyType':{'type':Sequelize[_0xf658('0x1')](_0xf658('0x2'),_0xf658('0x3'),_0xf658('0x4'))},'keyContent':{'type':Sequelize[_0xf658('0x5')]},'idField':{'type':Sequelize[_0xf658('0x5')]},'nameField':{'type':Sequelize[_0xf658('0x5')]},'customField':{'type':Sequelize[_0xf658('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf658('0x5')]}}; \ No newline at end of file +var _0xa119=['STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xa119,0xd2));var _0x9a11=function(_0x4c0f75,_0x339e4a){_0x4c0f75=_0x4c0f75-0x0;var _0x74c051=_0xa119[_0x4c0f75];return _0x74c051;};'use strict';var Sequelize=require(_0x9a11('0x0'));module[_0x9a11('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9a11('0x2'),_0x9a11('0x3'),_0x9a11('0x4'),_0x9a11('0x5'),'picklist'),'defaultValue':_0x9a11('0x2')},'content':{'type':Sequelize[_0x9a11('0x6')]},'key':{'type':Sequelize[_0x9a11('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9a11('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9a11('0x6')]},'idField':{'type':Sequelize[_0x9a11('0x6')]},'nameField':{'type':Sequelize[_0x9a11('0x6')]},'customField':{'type':Sequelize[_0x9a11('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9b71263..c3e3414 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 _0x6b2e=['mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','offset','status','set','apply','reject','save','update','then','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1bdad7,_0x486229){var _0x5919d0=function(_0x302fba){while(--_0x302fba){_0x1bdad7['push'](_0x1bdad7['shift']());}};_0x5919d0(++_0x486229);}(_0x6b2e,0x126));var _0xe6b2=function(_0x113412,_0x42bc09){_0x113412=_0x113412-0x0;var _0x15dbeb=_0x6b2e[_0x113412];return _0x15dbeb;};'use strict';var emlformat=require(_0xe6b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6b2('0x1'));var jsonpatch=require(_0xe6b2('0x2'));var rp=require(_0xe6b2('0x3'));var moment=require(_0xe6b2('0x4'));var BPromise=require(_0xe6b2('0x5'));var Mustache=require(_0xe6b2('0x6'));var util=require(_0xe6b2('0x7'));var path=require(_0xe6b2('0x8'));var sox=require(_0xe6b2('0x9'));var csv=require(_0xe6b2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6b2('0xb'));var _=require(_0xe6b2('0xc'));var squel=require('squel');var crypto=require(_0xe6b2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe6b2('0xa'));var querystring=require(_0xe6b2('0xe'));var Papa=require(_0xe6b2('0xf'));var Redis=require(_0xe6b2('0x10'));var authService=require(_0xe6b2('0x11'));var qs=require(_0xe6b2('0x12'));var as=require(_0xe6b2('0x13'));var hardwareService=require(_0xe6b2('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe6b2('0x15'));var config=require(_0xe6b2('0x16'));var licenseUtil=require(_0xe6b2('0x17'));var db=require(_0xe6b2('0x18'))['db'];function respondWithStatusCode(_0x531e98,_0x57a0f5){_0x57a0f5=_0x57a0f5||0xcc;return function(_0x25ee11){if(_0x25ee11){return _0x531e98[_0xe6b2('0x19')](_0x57a0f5);}return _0x531e98['status'](_0x57a0f5)[_0xe6b2('0x1a')]();};}function respondWithResult(_0x47cab5,_0x5296fb){_0x5296fb=_0x5296fb||0xc8;return function(_0x1173e7){if(_0x1173e7){return _0x47cab5['status'](_0x5296fb)[_0xe6b2('0x1b')](_0x1173e7);}};}function respondWithFilteredResult(_0x231915,_0x14e2df){return function(_0x180274){if(_0x180274){var _0x4d734b=typeof _0x14e2df['offset']==='undefined'&&typeof _0x14e2df[_0xe6b2('0x1c')]===_0xe6b2('0x1d');var _0x50b97a=_0x180274['count'];var _0x1c78db=_0x4d734b?0x0:_0x14e2df[_0xe6b2('0x1e')];var _0x50b1d1=_0x4d734b?_0x180274['count']:_0x14e2df[_0xe6b2('0x1e')]+_0x14e2df[_0xe6b2('0x1c')];var _0x556acd;if(_0x50b1d1>=_0x50b97a){_0x50b1d1=_0x50b97a;_0x556acd=0xc8;}else{_0x556acd=0xce;}_0x231915[_0xe6b2('0x1f')](_0x556acd);return _0x231915[_0xe6b2('0x20')]('Content-Range',_0x1c78db+'-'+_0x50b1d1+'/'+_0x50b97a)[_0xe6b2('0x1b')](_0x180274);}return null;};}function patchUpdates(_0x1079d4){return function(_0x4455a9){try{jsonpatch[_0xe6b2('0x21')](_0x4455a9,_0x1079d4,!![]);}catch(_0x538cc8){return BPromise[_0xe6b2('0x22')](_0x538cc8);}return _0x4455a9[_0xe6b2('0x23')]();};}function saveUpdates(_0x226492,_0x4a395c){return function(_0x4d3f17){if(_0x4d3f17){return _0x4d3f17[_0xe6b2('0x24')](_0x226492)[_0xe6b2('0x25')](function(_0x28f100){return _0x28f100;});}return null;};}function removeEntity(_0x330672,_0x1c8951){return function(_0x100533){if(_0x100533){return _0x100533['destroy']()[_0xe6b2('0x25')](function(){_0x330672[_0xe6b2('0x1f')](0xcc)[_0xe6b2('0x1a')]();});}};}function handleEntityNotFound(_0x15f557,_0x9eca30){return function(_0x629fe){if(!_0x629fe){_0x15f557[_0xe6b2('0x19')](0x194);}return _0x629fe;};}function handleError(_0x14de7c,_0x34d93a){_0x34d93a=_0x34d93a||0x1f4;return function(_0x4c2647){logger['error'](_0x4c2647['stack']);if(_0x4c2647[_0xe6b2('0x26')]){delete _0x4c2647[_0xe6b2('0x26')];}_0x14de7c['status'](_0x34d93a)[_0xe6b2('0x27')](_0x4c2647);};}exports[_0xe6b2('0x28')]=function(_0xfeea0c,_0x136204){var _0x526707={},_0x75258d={},_0x13d6c4={'count':0x0,'rows':[]};var _0x528635=_[_0xe6b2('0x29')](db[_0xe6b2('0x2a')][_0xe6b2('0x2b')],function(_0x482065){return{'name':_0x482065[_0xe6b2('0x2c')],'type':_0x482065[_0xe6b2('0x2d')][_0xe6b2('0x2e')]};});_0x75258d['model']=_[_0xe6b2('0x29')](_0x528635,_0xe6b2('0x26'));_0x75258d[_0xe6b2('0x2f')]=_[_0xe6b2('0x30')](_0xfeea0c[_0xe6b2('0x2f')]);_0x75258d[_0xe6b2('0x31')]=_[_0xe6b2('0x32')](_0x75258d[_0xe6b2('0x33')],_0x75258d[_0xe6b2('0x2f')]);_0x526707[_0xe6b2('0x34')]=_['intersection'](_0x75258d[_0xe6b2('0x33')],qs[_0xe6b2('0x35')](_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x35')]));_0x526707[_0xe6b2('0x34')]=_0x526707[_0xe6b2('0x34')][_0xe6b2('0x36')]?_0x526707[_0xe6b2('0x34')]:_0x75258d['model'];if(!_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x37')](_0xe6b2('0x38'))){_0x526707[_0xe6b2('0x1c')]=qs[_0xe6b2('0x1c')](_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x1c')]);_0x526707[_0xe6b2('0x1e')]=qs[_0xe6b2('0x1e')](_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x1e')]);}_0x526707[_0xe6b2('0x39')]=qs['sort'](_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x3a')]);_0x526707[_0xe6b2('0x3b')]=qs['filters'](_[_0xe6b2('0x3c')](_0xfeea0c['query'],_0x75258d[_0xe6b2('0x31')]),_0x528635);if(_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x3d')]){_0x526707['where']=_[_0xe6b2('0x3e')](_0x526707[_0xe6b2('0x3b')],{'$or':_['map'](_0x528635,function(_0x3cb173){if(_0x3cb173[_0xe6b2('0x2d')]!==_0xe6b2('0x3f')){var _0xd182a3={};_0xd182a3[_0x3cb173[_0xe6b2('0x26')]]={'$like':'%'+_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x3d')]+'%'};return _0xd182a3;}})});}_0x526707=_[_0xe6b2('0x3e')]({},_0x526707,_0xfeea0c[_0xe6b2('0x40')]);var _0xaa210b={'where':_0x526707[_0xe6b2('0x3b')]};return db[_0xe6b2('0x2a')][_0xe6b2('0x41')](_0xaa210b)[_0xe6b2('0x25')](function(_0x39c137){_0x13d6c4[_0xe6b2('0x41')]=_0x39c137;if(_0xfeea0c[_0xe6b2('0x2f')][_0xe6b2('0x42')]){_0x526707[_0xe6b2('0x43')]=[{'all':!![]}];}return db[_0xe6b2('0x2a')][_0xe6b2('0x44')](_0x526707);})['then'](function(_0x418dd9){_0x13d6c4['rows']=_0x418dd9;return _0x13d6c4;})[_0xe6b2('0x25')](respondWithFilteredResult(_0x136204,_0x526707))[_0xe6b2('0x45')](handleError(_0x136204,null));};exports[_0xe6b2('0x46')]=function(_0x235771,_0x92c285){var _0x37a4e7={'raw':!![],'where':{'id':_0x235771['params']['id']}},_0x34bcf5={};_0x34bcf5[_0xe6b2('0x33')]=_[_0xe6b2('0x30')](db[_0xe6b2('0x2a')]['rawAttributes']);_0x34bcf5[_0xe6b2('0x2f')]=_[_0xe6b2('0x30')](_0x235771['query']);_0x34bcf5[_0xe6b2('0x31')]=_[_0xe6b2('0x32')](_0x34bcf5[_0xe6b2('0x33')],_0x34bcf5[_0xe6b2('0x2f')]);_0x37a4e7['attributes']=_[_0xe6b2('0x32')](_0x34bcf5[_0xe6b2('0x33')],qs[_0xe6b2('0x35')](_0x235771[_0xe6b2('0x2f')][_0xe6b2('0x35')]));_0x37a4e7[_0xe6b2('0x34')]=_0x37a4e7['attributes'][_0xe6b2('0x36')]?_0x37a4e7['attributes']:_0x34bcf5[_0xe6b2('0x33')];if(_0x235771[_0xe6b2('0x2f')]['includeAll']){_0x37a4e7['include']=[{'all':!![]}];}_0x37a4e7=_[_0xe6b2('0x3e')]({},_0x37a4e7,_0x235771[_0xe6b2('0x40')]);return db[_0xe6b2('0x2a')][_0xe6b2('0x47')](_0x37a4e7)[_0xe6b2('0x25')](handleEntityNotFound(_0x92c285,null))[_0xe6b2('0x25')](respondWithResult(_0x92c285,null))[_0xe6b2('0x45')](handleError(_0x92c285,null));};exports[_0xe6b2('0x48')]=function(_0x1d6c7c,_0x54b056){return db['Dynamics365Field'][_0xe6b2('0x48')](_0x1d6c7c[_0xe6b2('0x49')],{})['then'](respondWithResult(_0x54b056,0xc9))[_0xe6b2('0x45')](handleError(_0x54b056,null));};exports[_0xe6b2('0x24')]=function(_0x5d4d36,_0x2c3a3a){if(_0x5d4d36['body']['id']){delete _0x5d4d36[_0xe6b2('0x49')]['id'];}return db['Dynamics365Field'][_0xe6b2('0x47')]({'where':{'id':_0x5d4d36['params']['id']}})['then'](handleEntityNotFound(_0x2c3a3a,null))[_0xe6b2('0x25')](saveUpdates(_0x5d4d36[_0xe6b2('0x49')],null))[_0xe6b2('0x25')](respondWithResult(_0x2c3a3a,null))[_0xe6b2('0x45')](handleError(_0x2c3a3a,null));};exports[_0xe6b2('0x4a')]=function(_0x12f08a,_0x3da4b2){return db['Dynamics365Field'][_0xe6b2('0x47')]({'where':{'id':_0x12f08a['params']['id']}})[_0xe6b2('0x25')](handleEntityNotFound(_0x3da4b2,null))[_0xe6b2('0x25')](removeEntity(_0x3da4b2,null))[_0xe6b2('0x45')](handleError(_0x3da4b2,null));}; \ No newline at end of file +var _0x618e=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','end','error','stack','name','send','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x517849,_0x3012aa){var _0x5ba69b=function(_0x978395){while(--_0x978395){_0x517849['push'](_0x517849['shift']());}};_0x5ba69b(++_0x3012aa);}(_0x618e,0xc6));var _0xe618=function(_0x54b184,_0x2e23aa){_0x54b184=_0x54b184-0x0;var _0x4da576=_0x618e[_0x54b184];return _0x4da576;};'use strict';var emlformat=require(_0xe618('0x0'));var rimraf=require(_0xe618('0x1'));var zipdir=require(_0xe618('0x2'));var jsonpatch=require(_0xe618('0x3'));var rp=require(_0xe618('0x4'));var moment=require(_0xe618('0x5'));var BPromise=require(_0xe618('0x6'));var Mustache=require(_0xe618('0x7'));var util=require('util');var path=require(_0xe618('0x8'));var sox=require('sox');var csv=require(_0xe618('0x9'));var ejs=require(_0xe618('0xa'));var fs=require('fs');var fs_extra=require(_0xe618('0xb'));var _=require(_0xe618('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe618('0xd'));var Redis=require(_0xe618('0xe'));var authService=require(_0xe618('0xf'));var qs=require(_0xe618('0x10'));var as=require(_0xe618('0x11'));var hardwareService=require(_0xe618('0x12'));var logger=require('../../config/logger')(_0xe618('0x13'));var utils=require(_0xe618('0x14'));var config=require(_0xe618('0x15'));var licenseUtil=require(_0xe618('0x16'));var db=require(_0xe618('0x17'))['db'];function respondWithStatusCode(_0x13cf7e,_0x442b8a){_0x442b8a=_0x442b8a||0xcc;return function(_0x16163a){if(_0x16163a){return _0x13cf7e[_0xe618('0x18')](_0x442b8a);}return _0x13cf7e[_0xe618('0x19')](_0x442b8a)['end']();};}function respondWithResult(_0x1c3c80,_0x5383c1){_0x5383c1=_0x5383c1||0xc8;return function(_0x53cee7){if(_0x53cee7){return _0x1c3c80[_0xe618('0x19')](_0x5383c1)[_0xe618('0x1a')](_0x53cee7);}};}function respondWithFilteredResult(_0x277969,_0x27884f){return function(_0x25c455){if(_0x25c455){var _0x6f3f0c=typeof _0x27884f['offset']===_0xe618('0x1b')&&typeof _0x27884f[_0xe618('0x1c')]===_0xe618('0x1b');var _0x162ebf=_0x25c455[_0xe618('0x1d')];var _0x2072e2=_0x6f3f0c?0x0:_0x27884f[_0xe618('0x1e')];var _0xd5962e=_0x6f3f0c?_0x25c455[_0xe618('0x1d')]:_0x27884f['offset']+_0x27884f[_0xe618('0x1c')];var _0x1b9ef4;if(_0xd5962e>=_0x162ebf){_0xd5962e=_0x162ebf;_0x1b9ef4=0xc8;}else{_0x1b9ef4=0xce;}_0x277969[_0xe618('0x19')](_0x1b9ef4);return _0x277969[_0xe618('0x1f')](_0xe618('0x20'),_0x2072e2+'-'+_0xd5962e+'/'+_0x162ebf)[_0xe618('0x1a')](_0x25c455);}return null;};}function patchUpdates(_0x377d2d){return function(_0x32a2af){try{jsonpatch['apply'](_0x32a2af,_0x377d2d,!![]);}catch(_0x5d7921){return BPromise[_0xe618('0x21')](_0x5d7921);}return _0x32a2af[_0xe618('0x22')]();};}function saveUpdates(_0x371059,_0x2920df){return function(_0x35a6dc){if(_0x35a6dc){return _0x35a6dc[_0xe618('0x23')](_0x371059)[_0xe618('0x24')](function(_0x4fe193){return _0x4fe193;});}return null;};}function removeEntity(_0x58d7c8,_0x5699c2){return function(_0x7b9973){if(_0x7b9973){return _0x7b9973['destroy']()[_0xe618('0x24')](function(){_0x58d7c8[_0xe618('0x19')](0xcc)[_0xe618('0x25')]();});}};}function handleEntityNotFound(_0x5ecc13,_0x141055){return function(_0x2aeab9){if(!_0x2aeab9){_0x5ecc13[_0xe618('0x18')](0x194);}return _0x2aeab9;};}function handleError(_0x33ef87,_0x40c0d1){_0x40c0d1=_0x40c0d1||0x1f4;return function(_0x2c4bf0){logger[_0xe618('0x26')](_0x2c4bf0[_0xe618('0x27')]);if(_0x2c4bf0[_0xe618('0x28')]){delete _0x2c4bf0[_0xe618('0x28')];}_0x33ef87[_0xe618('0x19')](_0x40c0d1)[_0xe618('0x29')](_0x2c4bf0);};}exports['index']=function(_0x21dbdf,_0x30f912){var _0x2a914f={},_0x124dcf={},_0x493a70={'count':0x0,'rows':[]};var _0x84fd22=_['map'](db[_0xe618('0x2a')][_0xe618('0x2b')],function(_0x2b2564){return{'name':_0x2b2564[_0xe618('0x2c')],'type':_0x2b2564[_0xe618('0x2d')][_0xe618('0x2e')]};});_0x124dcf[_0xe618('0x2f')]=_['map'](_0x84fd22,_0xe618('0x28'));_0x124dcf[_0xe618('0x30')]=_[_0xe618('0x31')](_0x21dbdf[_0xe618('0x30')]);_0x124dcf[_0xe618('0x32')]=_[_0xe618('0x33')](_0x124dcf['model'],_0x124dcf[_0xe618('0x30')]);_0x2a914f['attributes']=_[_0xe618('0x33')](_0x124dcf[_0xe618('0x2f')],qs[_0xe618('0x34')](_0x21dbdf[_0xe618('0x30')][_0xe618('0x34')]));_0x2a914f['attributes']=_0x2a914f[_0xe618('0x35')][_0xe618('0x36')]?_0x2a914f['attributes']:_0x124dcf[_0xe618('0x2f')];if(!_0x21dbdf[_0xe618('0x30')][_0xe618('0x37')](_0xe618('0x38'))){_0x2a914f[_0xe618('0x1c')]=qs[_0xe618('0x1c')](_0x21dbdf[_0xe618('0x30')]['limit']);_0x2a914f['offset']=qs['offset'](_0x21dbdf[_0xe618('0x30')]['offset']);}_0x2a914f['order']=qs['sort'](_0x21dbdf[_0xe618('0x30')][_0xe618('0x39')]);_0x2a914f[_0xe618('0x3a')]=qs[_0xe618('0x32')](_[_0xe618('0x3b')](_0x21dbdf[_0xe618('0x30')],_0x124dcf[_0xe618('0x32')]),_0x84fd22);if(_0x21dbdf[_0xe618('0x30')][_0xe618('0x3c')]){_0x2a914f[_0xe618('0x3a')]=_[_0xe618('0x3d')](_0x2a914f['where'],{'$or':_['map'](_0x84fd22,function(_0x463439){if(_0x463439['type']!==_0xe618('0x3e')){var _0x4dea64={};_0x4dea64[_0x463439[_0xe618('0x28')]]={'$like':'%'+_0x21dbdf[_0xe618('0x30')][_0xe618('0x3c')]+'%'};return _0x4dea64;}})});}_0x2a914f=_[_0xe618('0x3d')]({},_0x2a914f,_0x21dbdf[_0xe618('0x3f')]);var _0x2b1125={'where':_0x2a914f[_0xe618('0x3a')]};return db[_0xe618('0x2a')]['count'](_0x2b1125)[_0xe618('0x24')](function(_0x649da){_0x493a70[_0xe618('0x1d')]=_0x649da;if(_0x21dbdf['query'][_0xe618('0x40')]){_0x2a914f['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xe618('0x41')](_0x2a914f);})[_0xe618('0x24')](function(_0x3f70d5){_0x493a70[_0xe618('0x42')]=_0x3f70d5;return _0x493a70;})[_0xe618('0x24')](respondWithFilteredResult(_0x30f912,_0x2a914f))[_0xe618('0x43')](handleError(_0x30f912,null));};exports['show']=function(_0x853f0e,_0x536358){var _0x188792={'raw':!![],'where':{'id':_0x853f0e['params']['id']}},_0x564e96={};_0x564e96['model']=_['keys'](db['Dynamics365Field'][_0xe618('0x2b')]);_0x564e96[_0xe618('0x30')]=_[_0xe618('0x31')](_0x853f0e[_0xe618('0x30')]);_0x564e96[_0xe618('0x32')]=_[_0xe618('0x33')](_0x564e96[_0xe618('0x2f')],_0x564e96[_0xe618('0x30')]);_0x188792[_0xe618('0x35')]=_[_0xe618('0x33')](_0x564e96['model'],qs[_0xe618('0x34')](_0x853f0e[_0xe618('0x30')][_0xe618('0x34')]));_0x188792[_0xe618('0x35')]=_0x188792[_0xe618('0x35')][_0xe618('0x36')]?_0x188792['attributes']:_0x564e96['model'];if(_0x853f0e['query'][_0xe618('0x40')]){_0x188792[_0xe618('0x44')]=[{'all':!![]}];}_0x188792=_['merge']({},_0x188792,_0x853f0e['options']);return db[_0xe618('0x2a')][_0xe618('0x45')](_0x188792)[_0xe618('0x24')](handleEntityNotFound(_0x536358,null))['then'](respondWithResult(_0x536358,null))[_0xe618('0x43')](handleError(_0x536358,null));};exports[_0xe618('0x46')]=function(_0xb51b84,_0x127c03){return db[_0xe618('0x2a')][_0xe618('0x46')](_0xb51b84['body'],{})['then'](respondWithResult(_0x127c03,0xc9))[_0xe618('0x43')](handleError(_0x127c03,null));};exports[_0xe618('0x23')]=function(_0xe7b5b4,_0x13749b){if(_0xe7b5b4['body']['id']){delete _0xe7b5b4['body']['id'];}return db[_0xe618('0x2a')][_0xe618('0x45')]({'where':{'id':_0xe7b5b4['params']['id']}})['then'](handleEntityNotFound(_0x13749b,null))[_0xe618('0x24')](saveUpdates(_0xe7b5b4[_0xe618('0x47')],null))[_0xe618('0x24')](respondWithResult(_0x13749b,null))[_0xe618('0x43')](handleError(_0x13749b,null));};exports[_0xe618('0x48')]=function(_0x26fa7a,_0x1eff68){return db[_0xe618('0x2a')]['find']({'where':{'id':_0x26fa7a[_0xe618('0x49')]['id']}})[_0xe618('0x24')](handleEntityNotFound(_0x1eff68,null))['then'](removeEntity(_0x1eff68,null))['catch'](handleError(_0x1eff68,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 92ffefc..90c369a 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 _0x9a21=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9a21,0x1b2));var _0x19a2=function(_0x45585b,_0xb7bdd9){_0x45585b=_0x45585b-0x0;var _0x14649f=_0x9a21[_0x45585b];return _0x14649f;};'use strict';var _=require(_0x19a2('0x0'));var util=require(_0x19a2('0x1'));var logger=require(_0x19a2('0x2'))(_0x19a2('0x3'));var moment=require(_0x19a2('0x4'));var BPromise=require('bluebird');var rp=require(_0x19a2('0x5'));var fs=require('fs');var path=require(_0x19a2('0x6'));var rimraf=require(_0x19a2('0x7'));var config=require(_0x19a2('0x8'));var attributes=require(_0x19a2('0x9'));module[_0x19a2('0xa')]=function(_0x5d1a59,_0x2adb6e){return _0x5d1a59[_0x19a2('0xb')](_0x19a2('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x19a2('0xd'),'fields':[_0x19a2('0xe'),_0x19a2('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc1a=['exports','define','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d70dc,_0x5f2038){var _0xb2d993=function(_0x31ded0){while(--_0x31ded0){_0x4d70dc['push'](_0x4d70dc['shift']());}};_0xb2d993(++_0x5f2038);}(_0xbc1a,0x1e1));var _0xabc1=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xbc1a[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xabc1('0x0'));var util=require('util');var logger=require(_0xabc1('0x1'))(_0xabc1('0x2'));var moment=require(_0xabc1('0x3'));var BPromise=require(_0xabc1('0x4'));var rp=require(_0xabc1('0x5'));var fs=require('fs');var path=require(_0xabc1('0x6'));var rimraf=require(_0xabc1('0x7'));var config=require(_0xabc1('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xabc1('0x9')]=function(_0x4ac519,_0x977f05){return _0x4ac519[_0xabc1('0xa')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xabc1('0xb'),'fields':[_0xabc1('0xc'),_0xabc1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index d1c4fed..caefa62 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 _0xef2d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x3c1e42,_0x3588d3){var _0x58004d=function(_0x4799e5){while(--_0x4799e5){_0x3c1e42['push'](_0x3c1e42['shift']());}};_0x58004d(++_0x3588d3);}(_0xef2d,0x8a));var _0xdef2=function(_0x774864,_0x60b99b){_0x774864=_0x774864-0x0;var _0x147466=_0xef2d[_0x774864];return _0x147466;};'use strict';var _=require(_0xdef2('0x0'));var util=require(_0xdef2('0x1'));var moment=require(_0xdef2('0x2'));var BPromise=require(_0xdef2('0x3'));var rs=require(_0xdef2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdef2('0x5'))['db'];var utils=require(_0xdef2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdef2('0x7'));var jayson=require(_0xdef2('0x8'));var client=jayson[_0xdef2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32cb28,_0x3f16a8,_0x5bd375){return new BPromise(function(_0x3ee310,_0x3bc5d6){return client[_0xdef2('0xa')](_0x32cb28,_0x5bd375)[_0xdef2('0xb')](function(_0x3a59b6){logger[_0xdef2('0xc')](_0xdef2('0xd'),_0x3f16a8,_0xdef2('0xe'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3f16a8,_0xdef2('0xe'),JSON[_0xdef2('0xf')](_0x3a59b6));if(_0x3a59b6[_0xdef2('0x10')]){if(_0x3a59b6['error']['code']===0x1f4){logger[_0xdef2('0x10')](_0xdef2('0xd'),_0x3f16a8,_0x3a59b6[_0xdef2('0x10')][_0xdef2('0x11')]);return _0x3bc5d6(_0x3a59b6[_0xdef2('0x10')][_0xdef2('0x11')]);}logger[_0xdef2('0x10')](_0xdef2('0xd'),_0x3f16a8,_0x3a59b6[_0xdef2('0x10')][_0xdef2('0x11')]);return _0x3ee310(_0x3a59b6['error']['message']);}else{logger[_0xdef2('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x3f16a8,_0xdef2('0xe'));_0x3ee310(_0x3a59b6[_0xdef2('0x12')][_0xdef2('0x11')]);}})[_0xdef2('0x13')](function(_0x3b2f6c){logger[_0xdef2('0x10')](_0xdef2('0xd'),_0x3f16a8,_0x3b2f6c);_0x3bc5d6(_0x3b2f6c);});});} \ No newline at end of file +var _0xdcd1=['result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x15d9bc,_0x513b46){var _0x5868fe=function(_0x1696d0){while(--_0x1696d0){_0x15d9bc['push'](_0x15d9bc['shift']());}};_0x5868fe(++_0x513b46);}(_0xdcd1,0x1d5));var _0x1dcd=function(_0xae6802,_0x5b0d4a){_0xae6802=_0xae6802-0x0;var _0x7190a2=_0xdcd1[_0xae6802];return _0x7190a2;};'use strict';var _=require(_0x1dcd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1dcd('0x1'));var fs=require('fs');var Redis=require(_0x1dcd('0x2'));var db=require(_0x1dcd('0x3'))['db'];var utils=require(_0x1dcd('0x4'));var logger=require(_0x1dcd('0x5'))(_0x1dcd('0x6'));var config=require('../../config/environment');var jayson=require(_0x1dcd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3b91,_0x542bfd,_0x6c4b1b){return new BPromise(function(_0x1104a6,_0x10d5d8){return client[_0x1dcd('0x8')](_0x2f3b91,_0x6c4b1b)[_0x1dcd('0x9')](function(_0x4b3357){logger[_0x1dcd('0xa')](_0x1dcd('0xb'),_0x542bfd,_0x1dcd('0xc'));logger['debug'](_0x1dcd('0xd'),_0x542bfd,'request\x20sent',JSON[_0x1dcd('0xe')](_0x4b3357));if(_0x4b3357[_0x1dcd('0xf')]){if(_0x4b3357[_0x1dcd('0xf')]['code']===0x1f4){logger[_0x1dcd('0xf')](_0x1dcd('0xb'),_0x542bfd,_0x4b3357[_0x1dcd('0xf')]['message']);return _0x10d5d8(_0x4b3357[_0x1dcd('0xf')][_0x1dcd('0x10')]);}logger[_0x1dcd('0xf')](_0x1dcd('0xb'),_0x542bfd,_0x4b3357[_0x1dcd('0xf')][_0x1dcd('0x10')]);return _0x1104a6(_0x4b3357[_0x1dcd('0xf')][_0x1dcd('0x10')]);}else{logger[_0x1dcd('0xa')](_0x1dcd('0xb'),_0x542bfd,_0x1dcd('0xc'));_0x1104a6(_0x4b3357[_0x1dcd('0x11')][_0x1dcd('0x10')]);}})['catch'](function(_0x50e918){logger[_0x1dcd('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x542bfd,_0x50e918);_0x10d5d8(_0x50e918);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 9f01192..976d538 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 _0x312f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports'];(function(_0x34022f,_0x21134c){var _0x1bebdf=function(_0xe4b9bb){while(--_0xe4b9bb){_0x34022f['push'](_0x34022f['shift']());}};_0x1bebdf(++_0x21134c);}(_0x312f,0x1ce));var _0xf312=function(_0x41417e,_0xc1347b){_0x41417e=_0x41417e-0x0;var _0x28aa06=_0x312f[_0x41417e];return _0x28aa06;};'use strict';var multer=require(_0xf312('0x0'));var util=require(_0xf312('0x1'));var path=require(_0xf312('0x2'));var timeout=require(_0xf312('0x3'));var express=require('express');var router=express[_0xf312('0x4')]();var fs_extra=require(_0xf312('0x5'));var auth=require(_0xf312('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf312('0x7'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0xf312('0x8')](),controller['index']);router[_0xf312('0x9')]('/:id',auth[_0xf312('0x8')](),controller['show']);router[_0xf312('0x9')](_0xf312('0xa'),auth[_0xf312('0x8')](),controller[_0xf312('0xb')]);router[_0xf312('0x9')](_0xf312('0xc'),auth[_0xf312('0x8')](),controller[_0xf312('0xd')]);router[_0xf312('0xe')]('/',auth[_0xf312('0x8')](),controller[_0xf312('0xf')]);router[_0xf312('0xe')](_0xf312('0xa'),auth[_0xf312('0x8')](),controller[_0xf312('0x10')]);router[_0xf312('0x11')](_0xf312('0x12'),auth[_0xf312('0x8')](),controller['update']);router[_0xf312('0x13')](_0xf312('0x12'),auth['isAuthenticated'](),controller[_0xf312('0x14')]);module[_0xf312('0x15')]=router; \ No newline at end of file +var _0xaf4a=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1585af,_0x27176c){var _0x10ab5a=function(_0x556eac){while(--_0x556eac){_0x1585af['push'](_0x1585af['shift']());}};_0x10ab5a(++_0x27176c);}(_0xaf4a,0x13c));var _0xaaf4=function(_0x261c0c,_0x21f4cf){_0x261c0c=_0x261c0c-0x0;var _0x48c44d=_0xaf4a[_0x261c0c];return _0x48c44d;};'use strict';var multer=require(_0xaaf4('0x0'));var util=require(_0xaaf4('0x1'));var path=require(_0xaaf4('0x2'));var timeout=require(_0xaaf4('0x3'));var express=require('express');var router=express[_0xaaf4('0x4')]();var fs_extra=require(_0xaaf4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaaf4('0x6'));var config=require(_0xaaf4('0x7'));var controller=require(_0xaaf4('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xaaf4('0x9')]);router[_0xaaf4('0xa')]('/:id',auth[_0xaaf4('0xb')](),controller[_0xaaf4('0xc')]);router['get'](_0xaaf4('0xd'),auth[_0xaaf4('0xb')](),controller['getConfigurations']);router[_0xaaf4('0xa')](_0xaaf4('0xe'),auth['isAuthenticated'](),controller[_0xaaf4('0xf')]);router['post']('/',auth[_0xaaf4('0xb')](),controller[_0xaaf4('0x10')]);router[_0xaaf4('0x11')](_0xaaf4('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xaaf4('0x12')](_0xaaf4('0x13'),auth['isAuthenticated'](),controller[_0xaaf4('0x14')]);router[_0xaaf4('0x15')](_0xaaf4('0x13'),auth['isAuthenticated'](),controller[_0xaaf4('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0d6d3a7..4807fdb 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 _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x151a5d,_0x3f9902){var _0x234dcb=function(_0x287f76){while(--_0x287f76){_0x151a5d['push'](_0x151a5d['shift']());}};_0x234dcb(++_0x3f9902);}(_0xd943,0x15d));var _0x3d94=function(_0x578966,_0x18aa30){_0x578966=_0x578966-0x0;var _0x5b57d3=_0xd943[_0x578966];return _0x5b57d3;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x955f=['exports','STRING','sequelize'];(function(_0x119c25,_0x17ccce){var _0xf16eca=function(_0x3a3d18){while(--_0x3a3d18){_0x119c25['push'](_0x119c25['shift']());}};_0xf16eca(++_0x17ccce);}(_0x955f,0x1eb));var _0xf955=function(_0x3f673e,_0x1c33e6){_0x3f673e=_0x3f673e-0x0;var _0x27a22e=_0x955f[_0x3f673e];return _0x27a22e;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'name':{'type':Sequelize[_0xf955('0x2')]},'description':{'type':Sequelize[_0xf955('0x2')]},'username':{'type':Sequelize[_0xf955('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xf955('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1b447a4..ca75322 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 _0x6324=['then','destroy','end','error','name','send','index','FreshdeskAccount','key','model','map','keys','query','intersection','fields','attributes','length','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','requester','subject','description','priority','source','ticket_type','group','company','remove','includes','custom_text','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x6324,0x142));var _0x4632=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0x6324[_0x2b1bb9];return _0x59f401;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4632('0x18'));function respondWithStatusCode(_0x499d88,_0x4719f7){_0x4719f7=_0x4719f7||0xcc;return function(_0x299073){if(_0x299073){return _0x499d88[_0x4632('0x19')](_0x4719f7);}return _0x499d88[_0x4632('0x1a')](_0x4719f7)['end']();};}function respondWithResult(_0x3ba361,_0x255882){_0x255882=_0x255882||0xc8;return function(_0x3b9901){if(_0x3b9901){return _0x3ba361[_0x4632('0x1a')](_0x255882)[_0x4632('0x1b')](_0x3b9901);}};}function respondWithFilteredResult(_0x5438ab,_0x47b349){return function(_0x2fd7ae){if(_0x2fd7ae){var _0x38bedd=typeof _0x47b349[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x47b349['limit']===_0x4632('0x1d');var _0x113872=_0x2fd7ae[_0x4632('0x1e')];var _0x5b28b7=_0x38bedd?0x0:_0x47b349[_0x4632('0x1c')];var _0x1894bb=_0x38bedd?_0x2fd7ae['count']:_0x47b349['offset']+_0x47b349[_0x4632('0x1f')];var _0x3cf2bd;if(_0x1894bb>=_0x113872){_0x1894bb=_0x113872;_0x3cf2bd=0xc8;}else{_0x3cf2bd=0xce;}_0x5438ab[_0x4632('0x1a')](_0x3cf2bd);return _0x5438ab[_0x4632('0x20')](_0x4632('0x21'),_0x5b28b7+'-'+_0x1894bb+'/'+_0x113872)[_0x4632('0x1b')](_0x2fd7ae);}return null;};}function patchUpdates(_0x9ab826){return function(_0x468ccb){try{jsonpatch[_0x4632('0x22')](_0x468ccb,_0x9ab826,!![]);}catch(_0x3ea0d1){return BPromise[_0x4632('0x23')](_0x3ea0d1);}return _0x468ccb[_0x4632('0x24')]();};}function saveUpdates(_0x2ca6a5,_0x263907){return function(_0x4cfebc){if(_0x4cfebc){return _0x4cfebc[_0x4632('0x25')](_0x2ca6a5)[_0x4632('0x26')](function(_0x3537ed){return _0x3537ed;});}return null;};}function removeEntity(_0x380a9f,_0x1e1b86){return function(_0x38cbbc){if(_0x38cbbc){return _0x38cbbc[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x380a9f[_0x4632('0x1a')](0xcc)[_0x4632('0x28')]();});}};}function handleEntityNotFound(_0x1b8de0,_0x4af026){return function(_0x2e3428){if(!_0x2e3428){_0x1b8de0[_0x4632('0x19')](0x194);}return _0x2e3428;};}function handleError(_0x372679,_0x22d0f5){_0x22d0f5=_0x22d0f5||0x1f4;return function(_0x2a0b11){logger[_0x4632('0x29')](_0x2a0b11['stack']);if(_0x2a0b11['name']){delete _0x2a0b11[_0x4632('0x2a')];}_0x372679[_0x4632('0x1a')](_0x22d0f5)[_0x4632('0x2b')](_0x2a0b11);};}exports[_0x4632('0x2c')]=function(_0x34079f,_0x119d1b){var _0x3570b2={},_0x5e2ee4={},_0x42d505={'count':0x0,'rows':[]};var _0x135fd2=_['map'](db[_0x4632('0x2d')]['rawAttributes'],function(_0x6599ad){return{'name':_0x6599ad['fieldName'],'type':_0x6599ad['type'][_0x4632('0x2e')]};});_0x5e2ee4[_0x4632('0x2f')]=_[_0x4632('0x30')](_0x135fd2,'name');_0x5e2ee4['query']=_[_0x4632('0x31')](_0x34079f[_0x4632('0x32')]);_0x5e2ee4['filters']=_['intersection'](_0x5e2ee4[_0x4632('0x2f')],_0x5e2ee4[_0x4632('0x32')]);_0x3570b2['attributes']=_[_0x4632('0x33')](_0x5e2ee4[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x34079f[_0x4632('0x32')][_0x4632('0x34')]));_0x3570b2['attributes']=_0x3570b2[_0x4632('0x35')][_0x4632('0x36')]?_0x3570b2['attributes']:_0x5e2ee4['model'];if(!_0x34079f[_0x4632('0x32')]['hasOwnProperty']('nolimit')){_0x3570b2[_0x4632('0x1f')]=qs['limit'](_0x34079f[_0x4632('0x32')][_0x4632('0x1f')]);_0x3570b2[_0x4632('0x1c')]=qs['offset'](_0x34079f[_0x4632('0x32')][_0x4632('0x1c')]);}_0x3570b2[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x34079f[_0x4632('0x32')]['sort']);_0x3570b2['where']=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x34079f[_0x4632('0x32')],_0x5e2ee4['filters']),_0x135fd2);if(_0x34079f['query']['filter']){_0x3570b2[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x3570b2['where'],{'$or':_[_0x4632('0x30')](_0x135fd2,function(_0x20a700){if(_0x20a700[_0x4632('0x3d')]!==_0x4632('0x3e')){var _0x2309f1={};_0x2309f1[_0x20a700[_0x4632('0x2a')]]={'$like':'%'+_0x34079f[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0x2309f1;}})});}_0x3570b2=_[_0x4632('0x3c')]({},_0x3570b2,_0x34079f[_0x4632('0x40')]);var _0x1fd3f1={'where':_0x3570b2[_0x4632('0x3b')]};return db['FreshdeskAccount'][_0x4632('0x1e')](_0x1fd3f1)[_0x4632('0x26')](function(_0x4c0e13){_0x42d505[_0x4632('0x1e')]=_0x4c0e13;if(_0x34079f[_0x4632('0x32')]['includeAll']){_0x3570b2[_0x4632('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x4632('0x42')](_0x3570b2);})[_0x4632('0x26')](function(_0x1bfb36){_0x42d505[_0x4632('0x43')]=_0x1bfb36;return _0x42d505;})['then'](respondWithFilteredResult(_0x119d1b,_0x3570b2))[_0x4632('0x44')](handleError(_0x119d1b,null));};exports[_0x4632('0x45')]=function(_0x23ef38,_0x279298){var _0x5cc716={'raw':![],'where':{'id':_0x23ef38[_0x4632('0x46')]['id']}},_0x5b3fa9={};_0x5b3fa9[_0x4632('0x2f')]=_[_0x4632('0x31')](db['FreshdeskAccount'][_0x4632('0x47')]);_0x5b3fa9[_0x4632('0x32')]=_[_0x4632('0x31')](_0x23ef38[_0x4632('0x32')]);_0x5b3fa9[_0x4632('0x39')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],_0x5b3fa9['query']);_0x5cc716[_0x4632('0x35')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x23ef38[_0x4632('0x32')]['fields']));_0x5cc716['attributes']=_0x5cc716[_0x4632('0x35')][_0x4632('0x36')]?_0x5cc716[_0x4632('0x35')]:_0x5b3fa9[_0x4632('0x2f')];if(_0x23ef38['query'][_0x4632('0x48')]){_0x5cc716[_0x4632('0x41')]=[{'all':!![]}];}_0x5cc716=_[_0x4632('0x3c')]({},_0x5cc716,_0x23ef38[_0x4632('0x40')]);return db[_0x4632('0x2d')]['find'](_0x5cc716)[_0x4632('0x26')](handleEntityNotFound(_0x279298,null))[_0x4632('0x26')](respondWithResult(_0x279298,null))[_0x4632('0x44')](handleError(_0x279298,null));};exports[_0x4632('0x49')]=function(_0x3676fa,_0x2eb8b0){return db[_0x4632('0x2d')][_0x4632('0x49')](_0x3676fa[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x2eb8b0,0xc9))[_0x4632('0x44')](handleError(_0x2eb8b0,null));};exports['update']=function(_0xc3ffd0,_0x1ccadb){if(_0xc3ffd0[_0x4632('0x4a')]['id']){delete _0xc3ffd0['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0xc3ffd0[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x1ccadb,null))[_0x4632('0x26')](saveUpdates(_0xc3ffd0[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0x1ccadb,null))[_0x4632('0x44')](handleError(_0x1ccadb,null));};exports[_0x4632('0x27')]=function(_0x1aa831,_0x4e89e3){return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0x1aa831['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x4e89e3,null))[_0x4632('0x26')](removeEntity(_0x4e89e3,null))[_0x4632('0x44')](handleError(_0x4e89e3,null));};exports[_0x4632('0x4c')]=function(_0x2c59f5,_0xfeeac0,_0x248dcf){var _0xf4880f={};var _0x31b42d={};var _0x1b66e0;var _0x3e66d8;return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2c59f5[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xfeeac0,null))[_0x4632('0x26')](function(_0x32cd35){if(_0x32cd35){_0x1b66e0=_0x32cd35;_0x31b42d[_0x4632('0x2f')]=_[_0x4632('0x31')](db[_0x4632('0x4e')]['rawAttributes']);_0x31b42d[_0x4632('0x32')]=_[_0x4632('0x31')](_0x2c59f5[_0x4632('0x32')]);_0x31b42d[_0x4632('0x39')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],_0x31b42d['query']);_0xf4880f[_0x4632('0x35')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],qs['fields'](_0x2c59f5[_0x4632('0x32')][_0x4632('0x34')]));_0xf4880f['attributes']=_0xf4880f[_0x4632('0x35')][_0x4632('0x36')]?_0xf4880f[_0x4632('0x35')]:_0x31b42d['model'];_0xf4880f[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x38')]);_0xf4880f[_0x4632('0x3b')]=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x2c59f5[_0x4632('0x32')],_0x31b42d[_0x4632('0x39')]));if(_0x2c59f5[_0x4632('0x32')]['filter']){_0xf4880f[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0xf4880f['where'],{'$or':_[_0x4632('0x30')](_0xf4880f['attributes'],function(_0x48e942){var _0xa55d76={};_0xa55d76[_0x48e942]={'$like':'%'+_0x2c59f5[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0xa55d76;})});}_0xf4880f=_[_0x4632('0x3c')]({},_0xf4880f,_0x2c59f5[_0x4632('0x40')]);return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x3e2849){if(_0x3e2849){_0x3e66d8=_0x3e2849[_0x4632('0x36')];if(!_0x2c59f5[_0x4632('0x32')][_0x4632('0x4f')](_0x4632('0x50'))){_0xf4880f[_0x4632('0x1f')]=qs[_0x4632('0x1f')](_0x2c59f5['query']['limit']);_0xf4880f[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x1c')]);}return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x5b66ee){if(_0x5b66ee){return _0x5b66ee?{'count':_0x3e66d8,'rows':_0x5b66ee}:null;}})[_0x4632('0x26')](respondWithResult(_0xfeeac0,null))[_0x4632('0x44')](handleError(_0xfeeac0,null));};exports[_0x4632('0x51')]=function(_0x2e4d57,_0x5d1994,_0x529be1){if(_0x2e4d57[_0x4632('0x4a')]['id']){delete _0x2e4d57['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2e4d57[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x5d1994,null))[_0x4632('0x26')](function(_0x5e5669){if(_0x5e5669){_0x2e4d57[_0x4632('0x4a')][_0x4632('0x52')]=_0x5e5669['id'];_0x2e4d57['body']['Subjects']=integrations[_0x4632('0x53')](_0x2e4d57[_0x4632('0x4a')][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')]['type']);_0x2e4d57['body']['Descriptions']=integrations[_0x4632('0x55')](_0x2e4d57['body'][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')][_0x4632('0x3d')]);return db[_0x4632('0x4e')][_0x4632('0x49')](_0x2e4d57[_0x4632('0x4a')],{'include':[{'model':db[_0x4632('0x56')],'as':_0x4632('0x57')},{'model':db[_0x4632('0x56')],'as':_0x4632('0x58')}]});}return null;})[_0x4632('0x26')](respondWithResult(_0x5d1994,null))[_0x4632('0x44')](handleError(_0x5d1994,null));};exports[_0x4632('0x59')]=function(_0x3d5e65,_0x461700,_0x1b2905){var _0x550c4d='';return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x3d5e65[_0x4632('0x46')]['id']},'attributes':['id',_0x4632('0x5a'),_0x4632('0x5b')]})[_0x4632('0x26')](handleEntityNotFound(_0x461700,null))[_0x4632('0x26')](function(_0x24151e){if(_0x24151e){_0x550c4d=_0x24151e[_0x4632('0x5a')];var _0x33561f=_0x550c4d[_0x4632('0x5c')](-0x1);if(_0x33561f==='/'){_0x550c4d=_0x550c4d[_0x4632('0x5d')](0x0,_0x550c4d[_0x4632('0x5e')](_0x33561f));}return rp({'method':'GET','uri':util[_0x4632('0x5f')](_0x4632('0x60'),_0x550c4d,_0x4632('0x61')),'headers':{'Authorization':util[_0x4632('0x5f')](_0x4632('0x62'),new Buffer(util[_0x4632('0x5f')]('%s:X',_0x24151e[_0x4632('0x5b')]))[_0x4632('0x63')]('base64'))},'json':!![]});}})[_0x4632('0x26')](function(_0x458688){if(_0x458688){var _0x879c8=[_0x4632('0x64'),_0x4632('0x65'),'agent',_0x4632('0x66'),_0x4632('0x1a'),_0x4632('0x67'),'group',_0x4632('0x68'),_0x4632('0x69'),_0x4632('0x6a'),_0x4632('0x6b')];_[_0x4632('0x6c')](_0x458688,function(_0x3a3f3a){return _0x879c8[_0x4632('0x6d')](_0x3a3f3a[_0x4632('0x2a')])||!_0x3a3f3a['default']&&_0x3a3f3a[_0x4632('0x3d')]!==_0x4632('0x6e')&&_0x3a3f3a[_0x4632('0x3d')]!=='custom_dropdown';});return{'count':_0x458688[_0x4632('0x36')],'rows':_[_0x4632('0x30')](_0x458688,function(_0x576d93){return{'id':_0x576d93['name'],'name':_0x576d93[_0x4632('0x6f')],'custom':!_0x576d93[_0x4632('0x70')],'options':_0x576d93['choices']?_[_0x4632('0x30')](_0x576d93[_0x4632('0x71')],function(_0x2f1f22){return{'name':_[_0x4632('0x72')](_0x2f1f22),'value':_0x2f1f22};}):[]};})};}})[_0x4632('0x26')](respondWithResult(_0x461700,null))[_0x4632('0x44')](function(_0x43edfd){var _0x130b52=_0x3d5e65['query'][_0x4632('0x73')]?0x1f4:_0x43edfd[_0x4632('0x74')]||0x1f4;logger[_0x4632('0x29')](_0x4632('0x75'),'getFields',_0x130b52,JSON[_0x4632('0x76')](_0x43edfd));delete _0x43edfd[_0x4632('0x2a')];if(_0x130b52===0x191){_0x130b52=0x190;}_0x461700[_0x4632('0x1a')](_0x130b52)[_0x4632('0x2b')](_0x3d5e65[_0x4632('0x32')]['test']?{'message':_0x4632('0x77'),'statusCode':_0x43edfd[_0x4632('0x74')]}:_0x43edfd);});}; \ No newline at end of file +var _0xad8a=['merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','getFields','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','FreshdeskAccount','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','order','sort','where'];(function(_0x2bd7ba,_0x2572c7){var _0x30a488=function(_0x1851fa){while(--_0x1851fa){_0x2bd7ba['push'](_0x2bd7ba['shift']());}};_0x30a488(++_0x2572c7);}(_0xad8a,0xb0));var _0xaad8=function(_0x34a7cb,_0x6c7ef7){_0x34a7cb=_0x34a7cb-0x0;var _0x27c7b4=_0xad8a[_0x34a7cb];return _0x27c7b4;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];var integrations=require(_0xaad8('0x1b'));function respondWithStatusCode(_0xed6744,_0x456b77){_0x456b77=_0x456b77||0xcc;return function(_0x3f24ab){if(_0x3f24ab){return _0xed6744[_0xaad8('0x1c')](_0x456b77);}return _0xed6744[_0xaad8('0x1d')](_0x456b77)[_0xaad8('0x1e')]();};}function respondWithResult(_0x1c70d3,_0x4372fc){_0x4372fc=_0x4372fc||0xc8;return function(_0x147e50){if(_0x147e50){return _0x1c70d3[_0xaad8('0x1d')](_0x4372fc)[_0xaad8('0x1f')](_0x147e50);}};}function respondWithFilteredResult(_0x5e4fbb,_0x334c4d){return function(_0xb63cb3){if(_0xb63cb3){var _0x511344=typeof _0x334c4d[_0xaad8('0x20')]===_0xaad8('0x21')&&typeof _0x334c4d[_0xaad8('0x22')]===_0xaad8('0x21');var _0x19ae08=_0xb63cb3[_0xaad8('0x23')];var _0x535b82=_0x511344?0x0:_0x334c4d[_0xaad8('0x20')];var _0x26684c=_0x511344?_0xb63cb3['count']:_0x334c4d[_0xaad8('0x20')]+_0x334c4d['limit'];var _0x127038;if(_0x26684c>=_0x19ae08){_0x26684c=_0x19ae08;_0x127038=0xc8;}else{_0x127038=0xce;}_0x5e4fbb[_0xaad8('0x1d')](_0x127038);return _0x5e4fbb[_0xaad8('0x24')](_0xaad8('0x25'),_0x535b82+'-'+_0x26684c+'/'+_0x19ae08)['json'](_0xb63cb3);}return null;};}function patchUpdates(_0x18b856){return function(_0x2c8fd8){try{jsonpatch['apply'](_0x2c8fd8,_0x18b856,!![]);}catch(_0x8bc75){return BPromise[_0xaad8('0x26')](_0x8bc75);}return _0x2c8fd8[_0xaad8('0x27')]();};}function saveUpdates(_0x5b4b61,_0x5ba0fb){return function(_0x17f392){if(_0x17f392){return _0x17f392[_0xaad8('0x28')](_0x5b4b61)[_0xaad8('0x29')](function(_0x15e0c6){return _0x15e0c6;});}return null;};}function removeEntity(_0x29ba69,_0x1daacf){return function(_0x424213){if(_0x424213){return _0x424213[_0xaad8('0x2a')]()[_0xaad8('0x29')](function(){_0x29ba69[_0xaad8('0x1d')](0xcc)[_0xaad8('0x1e')]();});}};}function handleEntityNotFound(_0x217bfc,_0x4193cb){return function(_0x37c3f6){if(!_0x37c3f6){_0x217bfc[_0xaad8('0x1c')](0x194);}return _0x37c3f6;};}function handleError(_0x492a4a,_0x3d254e){_0x3d254e=_0x3d254e||0x1f4;return function(_0x94e799){logger[_0xaad8('0x2b')](_0x94e799['stack']);if(_0x94e799[_0xaad8('0x2c')]){delete _0x94e799[_0xaad8('0x2c')];}_0x492a4a[_0xaad8('0x1d')](_0x3d254e)[_0xaad8('0x2d')](_0x94e799);};}exports[_0xaad8('0x2e')]=function(_0x5434a9,_0xafb149){var _0x43c489={},_0x1e253f={},_0x31ad19={'count':0x0,'rows':[]};var _0x151c26=_['map'](db[_0xaad8('0x2f')][_0xaad8('0x30')],function(_0x20ea82){return{'name':_0x20ea82[_0xaad8('0x31')],'type':_0x20ea82['type'][_0xaad8('0x32')]};});_0x1e253f[_0xaad8('0x33')]=_[_0xaad8('0x34')](_0x151c26,_0xaad8('0x2c'));_0x1e253f[_0xaad8('0x35')]=_['keys'](_0x5434a9[_0xaad8('0x35')]);_0x1e253f[_0xaad8('0x36')]=_['intersection'](_0x1e253f['model'],_0x1e253f[_0xaad8('0x35')]);_0x43c489[_0xaad8('0x37')]=_[_0xaad8('0x38')](_0x1e253f[_0xaad8('0x33')],qs['fields'](_0x5434a9[_0xaad8('0x35')][_0xaad8('0x39')]));_0x43c489['attributes']=_0x43c489['attributes'][_0xaad8('0x3a')]?_0x43c489[_0xaad8('0x37')]:_0x1e253f['model'];if(!_0x5434a9[_0xaad8('0x35')]['hasOwnProperty']('nolimit')){_0x43c489[_0xaad8('0x22')]=qs[_0xaad8('0x22')](_0x5434a9['query'][_0xaad8('0x22')]);_0x43c489[_0xaad8('0x20')]=qs[_0xaad8('0x20')](_0x5434a9[_0xaad8('0x35')]['offset']);}_0x43c489[_0xaad8('0x3b')]=qs[_0xaad8('0x3c')](_0x5434a9[_0xaad8('0x35')][_0xaad8('0x3c')]);_0x43c489[_0xaad8('0x3d')]=qs[_0xaad8('0x36')](_['pick'](_0x5434a9[_0xaad8('0x35')],_0x1e253f[_0xaad8('0x36')]),_0x151c26);if(_0x5434a9[_0xaad8('0x35')]['filter']){_0x43c489[_0xaad8('0x3d')]=_[_0xaad8('0x3e')](_0x43c489[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x34')](_0x151c26,function(_0x146518){if(_0x146518[_0xaad8('0x3f')]!==_0xaad8('0x40')){var _0x4d3a4f={};_0x4d3a4f[_0x146518[_0xaad8('0x2c')]]={'$like':'%'+_0x5434a9[_0xaad8('0x35')][_0xaad8('0x41')]+'%'};return _0x4d3a4f;}})});}_0x43c489=_[_0xaad8('0x3e')]({},_0x43c489,_0x5434a9[_0xaad8('0x42')]);var _0xf0cc2f={'where':_0x43c489['where']};return db[_0xaad8('0x2f')][_0xaad8('0x23')](_0xf0cc2f)[_0xaad8('0x29')](function(_0x2e128d){_0x31ad19['count']=_0x2e128d;if(_0x5434a9['query']['includeAll']){_0x43c489[_0xaad8('0x43')]=[{'all':!![]}];}return db[_0xaad8('0x2f')][_0xaad8('0x44')](_0x43c489);})['then'](function(_0x408c25){_0x31ad19[_0xaad8('0x45')]=_0x408c25;return _0x31ad19;})['then'](respondWithFilteredResult(_0xafb149,_0x43c489))[_0xaad8('0x46')](handleError(_0xafb149,null));};exports[_0xaad8('0x47')]=function(_0x2fd56a,_0x292d4e){var _0x3933ac={'raw':![],'where':{'id':_0x2fd56a[_0xaad8('0x48')]['id']}},_0x17fb2b={};_0x17fb2b[_0xaad8('0x33')]=_[_0xaad8('0x49')](db[_0xaad8('0x2f')][_0xaad8('0x30')]);_0x17fb2b[_0xaad8('0x35')]=_['keys'](_0x2fd56a['query']);_0x17fb2b['filters']=_[_0xaad8('0x38')](_0x17fb2b['model'],_0x17fb2b[_0xaad8('0x35')]);_0x3933ac['attributes']=_['intersection'](_0x17fb2b[_0xaad8('0x33')],qs['fields'](_0x2fd56a[_0xaad8('0x35')][_0xaad8('0x39')]));_0x3933ac[_0xaad8('0x37')]=_0x3933ac[_0xaad8('0x37')][_0xaad8('0x3a')]?_0x3933ac[_0xaad8('0x37')]:_0x17fb2b[_0xaad8('0x33')];if(_0x2fd56a[_0xaad8('0x35')][_0xaad8('0x4a')]){_0x3933ac[_0xaad8('0x43')]=[{'all':!![]}];}_0x3933ac=_[_0xaad8('0x3e')]({},_0x3933ac,_0x2fd56a[_0xaad8('0x42')]);return db[_0xaad8('0x2f')][_0xaad8('0x4b')](_0x3933ac)[_0xaad8('0x29')](handleEntityNotFound(_0x292d4e,null))['then'](respondWithResult(_0x292d4e,null))['catch'](handleError(_0x292d4e,null));};exports[_0xaad8('0x4c')]=function(_0x42cfa4,_0x34b8ed){return db['FreshdeskAccount']['create'](_0x42cfa4[_0xaad8('0x4d')],{})['then'](respondWithResult(_0x34b8ed,0xc9))[_0xaad8('0x46')](handleError(_0x34b8ed,null));};exports[_0xaad8('0x28')]=function(_0x313824,_0x21921c){if(_0x313824[_0xaad8('0x4d')]['id']){delete _0x313824[_0xaad8('0x4d')]['id'];}return db[_0xaad8('0x2f')][_0xaad8('0x4b')]({'where':{'id':_0x313824[_0xaad8('0x48')]['id']}})['then'](handleEntityNotFound(_0x21921c,null))[_0xaad8('0x29')](saveUpdates(_0x313824[_0xaad8('0x4d')],null))['then'](respondWithResult(_0x21921c,null))[_0xaad8('0x46')](handleError(_0x21921c,null));};exports['destroy']=function(_0x2a2542,_0x15cb03){return db[_0xaad8('0x2f')][_0xaad8('0x4b')]({'where':{'id':_0x2a2542[_0xaad8('0x48')]['id']}})[_0xaad8('0x29')](handleEntityNotFound(_0x15cb03,null))[_0xaad8('0x29')](removeEntity(_0x15cb03,null))[_0xaad8('0x46')](handleError(_0x15cb03,null));};exports[_0xaad8('0x4e')]=function(_0x4e8198,_0x2461f7,_0x6fe3a3){var _0x3d2b57={};var _0x13f11d={};var _0x2ef071;var _0x9bf893;return db['FreshdeskAccount'][_0xaad8('0x4f')]({'where':{'id':_0x4e8198[_0xaad8('0x48')]['id']}})['then'](handleEntityNotFound(_0x2461f7,null))['then'](function(_0x33e743){if(_0x33e743){_0x2ef071=_0x33e743;_0x13f11d[_0xaad8('0x33')]=_[_0xaad8('0x49')](db[_0xaad8('0x50')][_0xaad8('0x30')]);_0x13f11d[_0xaad8('0x35')]=_['keys'](_0x4e8198[_0xaad8('0x35')]);_0x13f11d[_0xaad8('0x36')]=_[_0xaad8('0x38')](_0x13f11d[_0xaad8('0x33')],_0x13f11d[_0xaad8('0x35')]);_0x3d2b57['attributes']=_['intersection'](_0x13f11d[_0xaad8('0x33')],qs[_0xaad8('0x39')](_0x4e8198[_0xaad8('0x35')]['fields']));_0x3d2b57[_0xaad8('0x37')]=_0x3d2b57[_0xaad8('0x37')][_0xaad8('0x3a')]?_0x3d2b57['attributes']:_0x13f11d[_0xaad8('0x33')];_0x3d2b57['order']=qs[_0xaad8('0x3c')](_0x4e8198[_0xaad8('0x35')][_0xaad8('0x3c')]);_0x3d2b57[_0xaad8('0x3d')]=qs['filters'](_[_0xaad8('0x51')](_0x4e8198[_0xaad8('0x35')],_0x13f11d['filters']));if(_0x4e8198['query'][_0xaad8('0x41')]){_0x3d2b57['where']=_[_0xaad8('0x3e')](_0x3d2b57[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x34')](_0x3d2b57[_0xaad8('0x37')],function(_0x39c26a){var _0x2ff7d5={};_0x2ff7d5[_0x39c26a]={'$like':'%'+_0x4e8198[_0xaad8('0x35')][_0xaad8('0x41')]+'%'};return _0x2ff7d5;})});}_0x3d2b57=_[_0xaad8('0x3e')]({},_0x3d2b57,_0x4e8198['options']);return _0x2ef071[_0xaad8('0x4e')](_0x3d2b57);}})[_0xaad8('0x29')](function(_0x3c950e){if(_0x3c950e){_0x9bf893=_0x3c950e[_0xaad8('0x3a')];if(!_0x4e8198[_0xaad8('0x35')][_0xaad8('0x52')]('nolimit')){_0x3d2b57[_0xaad8('0x22')]=qs[_0xaad8('0x22')](_0x4e8198[_0xaad8('0x35')]['limit']);_0x3d2b57['offset']=qs[_0xaad8('0x20')](_0x4e8198[_0xaad8('0x35')][_0xaad8('0x20')]);}return _0x2ef071[_0xaad8('0x4e')](_0x3d2b57);}})['then'](function(_0x23b332){if(_0x23b332){return _0x23b332?{'count':_0x9bf893,'rows':_0x23b332}:null;}})[_0xaad8('0x29')](respondWithResult(_0x2461f7,null))[_0xaad8('0x46')](handleError(_0x2461f7,null));};exports[_0xaad8('0x53')]=function(_0x97e954,_0x5e755e,_0x584697){if(_0x97e954[_0xaad8('0x4d')]['id']){delete _0x97e954[_0xaad8('0x4d')]['id'];}return db[_0xaad8('0x2f')][_0xaad8('0x4f')]({'where':{'id':_0x97e954[_0xaad8('0x48')]['id']}})[_0xaad8('0x29')](handleEntityNotFound(_0x5e755e,null))['then'](function(_0x177290){if(_0x177290){_0x97e954[_0xaad8('0x4d')][_0xaad8('0x54')]=_0x177290['id'];_0x97e954[_0xaad8('0x4d')][_0xaad8('0x55')]=integrations['getSubjects'](_0x97e954['body']['channel'],_0x97e954[_0xaad8('0x4d')][_0xaad8('0x3f')]);_0x97e954['body'][_0xaad8('0x56')]=integrations[_0xaad8('0x57')](_0x97e954[_0xaad8('0x4d')][_0xaad8('0x58')],_0x97e954[_0xaad8('0x4d')]['type']);return db[_0xaad8('0x50')][_0xaad8('0x4c')](_0x97e954[_0xaad8('0x4d')],{'include':[{'model':db['FreshdeskField'],'as':_0xaad8('0x55')},{'model':db['FreshdeskField'],'as':_0xaad8('0x56')}]});}return null;})[_0xaad8('0x29')](respondWithResult(_0x5e755e,null))['catch'](handleError(_0x5e755e,null));};exports[_0xaad8('0x59')]=function(_0xbad93e,_0x5799fc,_0x6d0d8e){var _0x5603eb='';return db[_0xaad8('0x2f')][_0xaad8('0x4f')]({'where':{'id':_0xbad93e[_0xaad8('0x48')]['id']},'attributes':['id',_0xaad8('0x5a'),'apiKey']})[_0xaad8('0x29')](handleEntityNotFound(_0x5799fc,null))[_0xaad8('0x29')](function(_0xed6a43){if(_0xed6a43){_0x5603eb=_0xed6a43[_0xaad8('0x5a')];var _0x1460a9=_0x5603eb[_0xaad8('0x5b')](-0x1);if(_0x1460a9==='/'){_0x5603eb=_0x5603eb[_0xaad8('0x5c')](0x0,_0x5603eb['lastIndexOf'](_0x1460a9));}return rp({'method':_0xaad8('0x5d'),'uri':util[_0xaad8('0x5e')](_0xaad8('0x5f'),_0x5603eb,_0xaad8('0x60')),'headers':{'Authorization':util[_0xaad8('0x5e')](_0xaad8('0x61'),new Buffer(util['format'](_0xaad8('0x62'),_0xed6a43['apiKey']))[_0xaad8('0x63')]('base64'))},'json':!![]});}})[_0xaad8('0x29')](function(_0x5a3efd){if(_0x5a3efd){var _0x27ef49=[_0xaad8('0x64'),_0xaad8('0x65'),_0xaad8('0x66'),_0xaad8('0x67'),_0xaad8('0x1d'),_0xaad8('0x68'),'group',_0xaad8('0x69'),_0xaad8('0x6a'),'group',_0xaad8('0x6b')];_[_0xaad8('0x6c')](_0x5a3efd,function(_0x3d0324){return _0x27ef49[_0xaad8('0x6d')](_0x3d0324[_0xaad8('0x2c')])||!_0x3d0324[_0xaad8('0x6e')]&&_0x3d0324['type']!==_0xaad8('0x6f')&&_0x3d0324['type']!=='custom_dropdown';});return{'count':_0x5a3efd[_0xaad8('0x3a')],'rows':_[_0xaad8('0x34')](_0x5a3efd,function(_0x550298){return{'id':_0x550298['name'],'name':_0x550298['label'],'custom':!_0x550298['default'],'options':_0x550298[_0xaad8('0x70')]?_[_0xaad8('0x34')](_0x550298[_0xaad8('0x70')],function(_0x4391a1){return{'name':_[_0xaad8('0x71')](_0x4391a1),'value':_0x4391a1};}):[]};})};}})[_0xaad8('0x29')](respondWithResult(_0x5799fc,null))[_0xaad8('0x46')](function(_0x3f431c){var _0x36a3f6=_0xbad93e[_0xaad8('0x35')][_0xaad8('0x72')]?0x1f4:_0x3f431c[_0xaad8('0x73')]||0x1f4;logger[_0xaad8('0x2b')](_0xaad8('0x74'),_0xaad8('0x59'),_0x36a3f6,JSON[_0xaad8('0x75')](_0x3f431c));delete _0x3f431c[_0xaad8('0x2c')];if(_0x36a3f6===0x191){_0x36a3f6=0x190;}_0x5799fc['status'](_0x36a3f6)[_0xaad8('0x2d')](_0xbad93e[_0xaad8('0x35')]['test']?{'message':_0xaad8('0x76'),'statusCode':_0x3f431c[_0xaad8('0x73')]}:_0x3f431c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 622339b..013b356 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 _0x35ab=['moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','api'];(function(_0x2d2f1a,_0xf8d964){var _0x198717=function(_0x48f62a){while(--_0x48f62a){_0x2d2f1a['push'](_0x2d2f1a['shift']());}};_0x198717(++_0xf8d964);}(_0x35ab,0x1d1));var _0xb35a=function(_0x10a64a,_0x72fccc){_0x10a64a=_0x10a64a-0x0;var _0x59dce7=_0x35ab[_0x10a64a];return _0x59dce7;};'use strict';var _=require(_0xb35a('0x0'));var util=require(_0xb35a('0x1'));var logger=require('../../config/logger')(_0xb35a('0x2'));var moment=require(_0xb35a('0x3'));var BPromise=require(_0xb35a('0x4'));var rp=require(_0xb35a('0x5'));var fs=require('fs');var path=require(_0xb35a('0x6'));var rimraf=require('rimraf');var config=require(_0xb35a('0x7'));var attributes=require(_0xb35a('0x8'));var integrations=require(_0xb35a('0x9'));module[_0xb35a('0xa')]=function(_0x4bd1ec,_0xa41510){return _0x4bd1ec[_0xb35a('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xb35a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2f0=['util','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','FreshdeskAccount','lodash'];(function(_0x207408,_0x149b52){var _0x2164ee=function(_0x52ad8a){while(--_0x52ad8a){_0x207408['push'](_0x207408['shift']());}};_0x2164ee(++_0x149b52);}(_0xe2f0,0x117));var _0x0e2f=function(_0x470b1e,_0x469d95){_0x470b1e=_0x470b1e-0x0;var _0x58d7ff=_0xe2f0[_0x470b1e];return _0x58d7ff;};'use strict';var _=require(_0x0e2f('0x0'));var util=require(_0x0e2f('0x1'));var logger=require('../../config/logger')(_0x0e2f('0x2'));var moment=require('moment');var BPromise=require(_0x0e2f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e2f('0x4'));var rimraf=require(_0x0e2f('0x5'));var config=require(_0x0e2f('0x6'));var attributes=require(_0x0e2f('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0e2f('0x8')]=function(_0x377e34,_0x512dc8){return _0x377e34['define'](_0x0e2f('0x9'),attributes,{'tableName':'int_freshdesk_accounts','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 d1e9c69..c5cd0af 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 _0xabfb=['GetFreshdeskAccount','debug','catch','find','ShowFreshdeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshdeskAccount','findAll','options','raw','where','include','model','attributes','map'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xabfb,0x177));var _0xbabf=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0xabfb[_0xed5f9c];return _0x3a1c43;};'use strict';var _=require(_0xbabf('0x0'));var util=require('util');var moment=require(_0xbabf('0x1'));var BPromise=require(_0xbabf('0x2'));var rs=require(_0xbabf('0x3'));var fs=require('fs');var Redis=require(_0xbabf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbabf('0x5'));var logger=require(_0xbabf('0x6'))(_0xbabf('0x7'));var config=require(_0xbabf('0x8'));var jayson=require(_0xbabf('0x9'));var client=jayson[_0xbabf('0xa')][_0xbabf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x71f35c,_0x55af07,_0xf79796){return new BPromise(function(_0x522a33,_0xadadbf){return client[_0xbabf('0xc')](_0x71f35c,_0xf79796)[_0xbabf('0xd')](function(_0xb4c881){logger[_0xbabf('0xe')](_0xbabf('0xf'),_0x55af07,_0xbabf('0x10'));logger['debug'](_0xbabf('0x11'),_0x55af07,_0xbabf('0x10'),JSON[_0xbabf('0x12')](_0xb4c881));if(_0xb4c881[_0xbabf('0x13')]){if(_0xb4c881[_0xbabf('0x13')][_0xbabf('0x14')]===0x1f4){logger[_0xbabf('0x13')](_0xbabf('0xf'),_0x55af07,_0xb4c881[_0xbabf('0x13')]['message']);return _0xadadbf(_0xb4c881[_0xbabf('0x13')][_0xbabf('0x15')]);}logger[_0xbabf('0x13')](_0xbabf('0xf'),_0x55af07,_0xb4c881['error']['message']);return _0x522a33(_0xb4c881[_0xbabf('0x13')]['message']);}else{logger[_0xbabf('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x55af07,_0xbabf('0x10'));_0x522a33(_0xb4c881[_0xbabf('0x16')][_0xbabf('0x15')]);}})['catch'](function(_0x503009){logger[_0xbabf('0x13')](_0xbabf('0xf'),_0x55af07,_0x503009);_0xadadbf(_0x503009);});});}exports['GetFreshdeskAccount']=function(_0x3f7c99){var _0x2cc50d=this;return new Promise(function(_0x15af68,_0x17e96e){return db[_0xbabf('0x17')][_0xbabf('0x18')]({'raw':_0x3f7c99[_0xbabf('0x19')]?_0x3f7c99['options'][_0xbabf('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f7c99['options']?_0x3f7c99[_0xbabf('0x19')][_0xbabf('0x1b')]||null:null,'attributes':_0x3f7c99[_0xbabf('0x19')]?_0x3f7c99[_0xbabf('0x19')]['attributes']||null:null,'limit':_0x3f7c99[_0xbabf('0x19')]?_0x3f7c99[_0xbabf('0x19')]['limit']||null:null,'include':_0x3f7c99[_0xbabf('0x19')]?_0x3f7c99[_0xbabf('0x19')][_0xbabf('0x1c')]?_['map'](_0x3f7c99['options'][_0xbabf('0x1c')],function(_0x110bd3){return{'model':db[_0x110bd3[_0xbabf('0x1d')]],'as':_0x110bd3['as'],'attributes':_0x110bd3[_0xbabf('0x1e')],'include':_0x110bd3[_0xbabf('0x1c')]?_[_0xbabf('0x1f')](_0x110bd3[_0xbabf('0x1c')],function(_0x313d81){return{'model':db[_0x313d81[_0xbabf('0x1d')]],'as':_0x313d81['as'],'attributes':_0x313d81[_0xbabf('0x1e')],'include':_0x313d81[_0xbabf('0x1c')]?_['map'](_0x313d81['include'],function(_0x5d1f3c){return{'model':db[_0x5d1f3c[_0xbabf('0x1d')]],'as':_0x5d1f3c['as'],'attributes':_0x5d1f3c[_0xbabf('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2abdff){logger[_0xbabf('0xe')](_0xbabf('0x20'),_0x3f7c99);logger[_0xbabf('0x21')](_0xbabf('0x20'),_0x3f7c99,JSON[_0xbabf('0x12')](_0x2abdff));_0x15af68(_0x2abdff);})[_0xbabf('0x22')](function(_0x278aa4){logger['error'](_0xbabf('0x20'),_0x278aa4['message'],_0x3f7c99);_0x17e96e(_0x2cc50d[_0xbabf('0x13')](0x1f4,_0x278aa4[_0xbabf('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x3e2e1b){var _0x220a82=this;return new Promise(function(_0x1ba43d,_0x56a5eb){return db[_0xbabf('0x17')][_0xbabf('0x23')]({'raw':_0x3e2e1b[_0xbabf('0x19')]?_0x3e2e1b[_0xbabf('0x19')][_0xbabf('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e2e1b[_0xbabf('0x19')]?_0x3e2e1b[_0xbabf('0x19')][_0xbabf('0x1b')]||null:null,'attributes':_0x3e2e1b[_0xbabf('0x19')]?_0x3e2e1b[_0xbabf('0x19')]['attributes']||null:null,'include':_0x3e2e1b[_0xbabf('0x19')]?_0x3e2e1b[_0xbabf('0x19')][_0xbabf('0x1c')]?_[_0xbabf('0x1f')](_0x3e2e1b[_0xbabf('0x19')][_0xbabf('0x1c')],function(_0x314c25){return{'model':db[_0x314c25['model']],'as':_0x314c25['as'],'attributes':_0x314c25[_0xbabf('0x1e')],'include':_0x314c25[_0xbabf('0x1c')]?_[_0xbabf('0x1f')](_0x314c25[_0xbabf('0x1c')],function(_0x36fc08){return{'model':db[_0x36fc08[_0xbabf('0x1d')]],'as':_0x36fc08['as'],'attributes':_0x36fc08['attributes'],'include':_0x36fc08['include']?_[_0xbabf('0x1f')](_0x36fc08[_0xbabf('0x1c')],function(_0x6938cd){return{'model':db[_0x6938cd[_0xbabf('0x1d')]],'as':_0x6938cd['as'],'attributes':_0x6938cd[_0xbabf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbabf('0xd')](function(_0x5a2482){logger[_0xbabf('0xe')]('ShowFreshdeskAccount',_0x3e2e1b);logger[_0xbabf('0x21')](_0xbabf('0x24'),_0x3e2e1b,JSON['stringify'](_0x5a2482));_0x1ba43d(_0x5a2482);})[_0xbabf('0x22')](function(_0x44e9f2){logger[_0xbabf('0x13')]('ShowFreshdeskAccount',_0x44e9f2['message'],_0x3e2e1b);_0x56a5eb(_0x220a82[_0xbabf('0x13')](0x1f4,_0x44e9f2[_0xbabf('0x15')]));});});}; \ No newline at end of file +var _0x05d9=['GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','raw','options','where','attributes','limit','include','map','model'];(function(_0x143f63,_0x2993ec){var _0x26409e=function(_0x5aaf51){while(--_0x5aaf51){_0x143f63['push'](_0x143f63['shift']());}};_0x26409e(++_0x2993ec);}(_0x05d9,0x1b3));var _0x905d=function(_0x46015d,_0xe0d1e6){_0x46015d=_0x46015d-0x0;var _0x4a5b54=_0x05d9[_0x46015d];return _0x4a5b54;};'use strict';var _=require(_0x905d('0x0'));var util=require(_0x905d('0x1'));var moment=require(_0x905d('0x2'));var BPromise=require(_0x905d('0x3'));var rs=require(_0x905d('0x4'));var fs=require('fs');var Redis=require(_0x905d('0x5'));var db=require(_0x905d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x905d('0x7'))('rpc');var config=require(_0x905d('0x8'));var jayson=require(_0x905d('0x9'));var client=jayson['client'][_0x905d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f0b11,_0x16e261,_0x3639b9){return new BPromise(function(_0x37ee2f,_0x1afd41){return client[_0x905d('0xb')](_0x1f0b11,_0x3639b9)[_0x905d('0xc')](function(_0x4ceb60){logger[_0x905d('0xd')](_0x905d('0xe'),_0x16e261,'request\x20sent');logger[_0x905d('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x16e261,_0x905d('0x10'),JSON[_0x905d('0x11')](_0x4ceb60));if(_0x4ceb60[_0x905d('0x12')]){if(_0x4ceb60[_0x905d('0x12')][_0x905d('0x13')]===0x1f4){logger[_0x905d('0x12')](_0x905d('0xe'),_0x16e261,_0x4ceb60[_0x905d('0x12')][_0x905d('0x14')]);return _0x1afd41(_0x4ceb60[_0x905d('0x12')]['message']);}logger[_0x905d('0x12')](_0x905d('0xe'),_0x16e261,_0x4ceb60[_0x905d('0x12')]['message']);return _0x37ee2f(_0x4ceb60[_0x905d('0x12')][_0x905d('0x14')]);}else{logger[_0x905d('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x16e261,'request\x20sent');_0x37ee2f(_0x4ceb60[_0x905d('0x15')][_0x905d('0x14')]);}})[_0x905d('0x16')](function(_0x5dc6f8){logger[_0x905d('0x12')](_0x905d('0xe'),_0x16e261,_0x5dc6f8);_0x1afd41(_0x5dc6f8);});});}exports['GetFreshdeskAccount']=function(_0x259a3a){var _0x35f1b4=this;return new Promise(function(_0x1fd875,_0x454102){return db[_0x905d('0x17')][_0x905d('0x18')]({'raw':_0x259a3a['options']?_0x259a3a['options'][_0x905d('0x19')]===undefined?!![]:![]:!![],'where':_0x259a3a[_0x905d('0x1a')]?_0x259a3a['options'][_0x905d('0x1b')]||null:null,'attributes':_0x259a3a[_0x905d('0x1a')]?_0x259a3a[_0x905d('0x1a')][_0x905d('0x1c')]||null:null,'limit':_0x259a3a[_0x905d('0x1a')]?_0x259a3a[_0x905d('0x1a')][_0x905d('0x1d')]||null:null,'include':_0x259a3a[_0x905d('0x1a')]?_0x259a3a['options'][_0x905d('0x1e')]?_[_0x905d('0x1f')](_0x259a3a[_0x905d('0x1a')][_0x905d('0x1e')],function(_0x345e6f){return{'model':db[_0x345e6f[_0x905d('0x20')]],'as':_0x345e6f['as'],'attributes':_0x345e6f[_0x905d('0x1c')],'include':_0x345e6f[_0x905d('0x1e')]?_[_0x905d('0x1f')](_0x345e6f[_0x905d('0x1e')],function(_0x219480){return{'model':db[_0x219480['model']],'as':_0x219480['as'],'attributes':_0x219480[_0x905d('0x1c')],'include':_0x219480[_0x905d('0x1e')]?_[_0x905d('0x1f')](_0x219480[_0x905d('0x1e')],function(_0x329cba){return{'model':db[_0x329cba[_0x905d('0x20')]],'as':_0x329cba['as'],'attributes':_0x329cba['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x67fd54){logger[_0x905d('0xd')](_0x905d('0x21'),_0x259a3a);logger[_0x905d('0xf')](_0x905d('0x21'),_0x259a3a,JSON[_0x905d('0x11')](_0x67fd54));_0x1fd875(_0x67fd54);})[_0x905d('0x16')](function(_0xfeedee){logger[_0x905d('0x12')](_0x905d('0x21'),_0xfeedee[_0x905d('0x14')],_0x259a3a);_0x454102(_0x35f1b4['error'](0x1f4,_0xfeedee[_0x905d('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0x2233b6){var _0x46a4b8=this;return new Promise(function(_0x42a745,_0x1b28b4){return db[_0x905d('0x17')][_0x905d('0x22')]({'raw':_0x2233b6['options']?_0x2233b6[_0x905d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2233b6[_0x905d('0x1a')]?_0x2233b6[_0x905d('0x1a')][_0x905d('0x1b')]||null:null,'attributes':_0x2233b6[_0x905d('0x1a')]?_0x2233b6[_0x905d('0x1a')][_0x905d('0x1c')]||null:null,'include':_0x2233b6[_0x905d('0x1a')]?_0x2233b6[_0x905d('0x1a')]['include']?_[_0x905d('0x1f')](_0x2233b6[_0x905d('0x1a')]['include'],function(_0x5e4b0e){return{'model':db[_0x5e4b0e[_0x905d('0x20')]],'as':_0x5e4b0e['as'],'attributes':_0x5e4b0e[_0x905d('0x1c')],'include':_0x5e4b0e['include']?_[_0x905d('0x1f')](_0x5e4b0e[_0x905d('0x1e')],function(_0x52e87a){return{'model':db[_0x52e87a[_0x905d('0x20')]],'as':_0x52e87a['as'],'attributes':_0x52e87a['attributes'],'include':_0x52e87a[_0x905d('0x1e')]?_[_0x905d('0x1f')](_0x52e87a[_0x905d('0x1e')],function(_0x583620){return{'model':db[_0x583620[_0x905d('0x20')]],'as':_0x583620['as'],'attributes':_0x583620[_0x905d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x905d('0xc')](function(_0x50c66d){logger[_0x905d('0xd')](_0x905d('0x23'),_0x2233b6);logger['debug'](_0x905d('0x23'),_0x2233b6,JSON[_0x905d('0x11')](_0x50c66d));_0x42a745(_0x50c66d);})[_0x905d('0x16')](function(_0x36eb55){logger[_0x905d('0x12')](_0x905d('0x23'),_0x36eb55[_0x905d('0x14')],_0x2233b6);_0x1b28b4(_0x46a4b8[_0x905d('0x12')](0x1f4,_0x36eb55[_0x905d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 8728cba..123f69e 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 _0xbbac=['../../components/interaction/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x560623,_0x5c748a){var _0x2a9089=function(_0x565d41){while(--_0x565d41){_0x560623['push'](_0x560623['shift']());}};_0x2a9089(++_0x5c748a);}(_0xbbac,0xc9));var _0xcbba=function(_0x576d1c,_0x3e9700){_0x576d1c=_0x576d1c-0x0;var _0x3e94c5=_0xbbac[_0x576d1c];return _0x3e94c5;};'use strict';var multer=require(_0xcbba('0x0'));var util=require(_0xcbba('0x1'));var path=require(_0xcbba('0x2'));var timeout=require(_0xcbba('0x3'));var express=require('express');var router=express[_0xcbba('0x4')]();var fs_extra=require(_0xcbba('0x5'));var auth=require(_0xcbba('0x6'));var interaction=require(_0xcbba('0x7'));var config=require('../../config/environment');var controller=require(_0xcbba('0x8'));router[_0xcbba('0x9')]('/',auth['isAuthenticated'](),controller[_0xcbba('0xa')]);router[_0xcbba('0x9')](_0xcbba('0xb'),auth[_0xcbba('0xc')](),controller[_0xcbba('0xd')]);router[_0xcbba('0x9')](_0xcbba('0xe'),auth[_0xcbba('0xc')](),controller['getFields']);router[_0xcbba('0x9')]('/:id/subjects',auth[_0xcbba('0xc')](),controller['getSubjects']);router[_0xcbba('0x9')](_0xcbba('0xf'),auth['isAuthenticated'](),controller[_0xcbba('0x10')]);router[_0xcbba('0x9')](_0xcbba('0x11'),auth[_0xcbba('0xc')](),controller[_0xcbba('0x12')]);router['post']('/',auth[_0xcbba('0xc')](),controller[_0xcbba('0x13')]);router['post'](_0xcbba('0x11'),auth[_0xcbba('0xc')](),controller[_0xcbba('0x14')]);router[_0xcbba('0x15')](_0xcbba('0xb'),auth[_0xcbba('0xc')](),controller[_0xcbba('0x16')]);router[_0xcbba('0x17')](_0xcbba('0xb'),auth['isAuthenticated'](),controller[_0xcbba('0x18')]);module[_0xcbba('0x19')]=router; \ No newline at end of file +var _0x896e=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','setTags','put','update','delete','destroy','exports','util','path','express'];(function(_0x12668b,_0x25c5f5){var _0x1b7c40=function(_0x1397de){while(--_0x1397de){_0x12668b['push'](_0x12668b['shift']());}};_0x1b7c40(++_0x25c5f5);}(_0x896e,0x169));var _0xe896=function(_0x538263,_0xf68de8){_0x538263=_0x538263-0x0;var _0x1ed8ef=_0x896e[_0x538263];return _0x1ed8ef;};'use strict';var multer=require('multer');var util=require(_0xe896('0x0'));var path=require(_0xe896('0x1'));var timeout=require('connect-timeout');var express=require(_0xe896('0x2'));var router=express[_0xe896('0x3')]();var fs_extra=require(_0xe896('0x4'));var auth=require(_0xe896('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe896('0x6'));var controller=require(_0xe896('0x7'));router[_0xe896('0x8')]('/',auth[_0xe896('0x9')](),controller[_0xe896('0xa')]);router['get'](_0xe896('0xb'),auth[_0xe896('0x9')](),controller[_0xe896('0xc')]);router[_0xe896('0x8')](_0xe896('0xd'),auth[_0xe896('0x9')](),controller[_0xe896('0xe')]);router['get'](_0xe896('0xf'),auth['isAuthenticated'](),controller[_0xe896('0x10')]);router[_0xe896('0x8')]('/:id/descriptions',auth[_0xe896('0x9')](),controller[_0xe896('0x11')]);router['get'](_0xe896('0x12'),auth[_0xe896('0x9')](),controller[_0xe896('0x13')]);router['post']('/',auth[_0xe896('0x9')](),controller['create']);router['post']('/:id/tags',auth['isAuthenticated'](),controller[_0xe896('0x14')]);router[_0xe896('0x15')](_0xe896('0xb'),auth[_0xe896('0x9')](),controller[_0xe896('0x16')]);router[_0xe896('0x17')]('/:id',auth[_0xe896('0x9')](),controller[_0xe896('0x18')]);module[_0xe896('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 62571ca..d5e39e3 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 _0x20d8=['exports'];(function(_0x1c6811,_0xdd9521){var _0x11f479=function(_0x5042cd){while(--_0x5042cd){_0x1c6811['push'](_0x1c6811['shift']());}};_0x11f479(++_0xdd9521);}(_0x20d8,0x7d));var _0x820d=function(_0x3f23c0,_0x4d4253){_0x3f23c0=_0x3f23c0-0x0;var _0x168bbb=_0x20d8[_0x3f23c0];return _0x168bbb;};'use strict';var Sequelize=require('sequelize');module[_0x820d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x03e4=['sequelize','exports'];(function(_0x19bf59,_0x2ad1fb){var _0x50502a=function(_0x56d712){while(--_0x56d712){_0x19bf59['push'](_0x19bf59['shift']());}};_0x50502a(++_0x2ad1fb);}(_0x03e4,0xfc));var _0x403e=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x03e4[_0x628eee];return _0x447718;};'use strict';var Sequelize=require(_0x403e('0x0'));module[_0x403e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 2578285..09fb294 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 _0xb1e0=['end','status','json','offset','undefined','count','Content-Range','apply','save','then','sendStatus','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x4cfbb7,_0x37774e){var _0x9bbefd=function(_0x228aa7){while(--_0x228aa7){_0x4cfbb7['push'](_0x4cfbb7['shift']());}};_0x9bbefd(++_0x37774e);}(_0xb1e0,0x133));var _0x0b1e=function(_0xb29840,_0xe65b32){_0xb29840=_0xb29840-0x0;var _0x5275e3=_0xb1e0[_0xb29840];return _0x5275e3;};'use strict';var emlformat=require(_0x0b1e('0x0'));var rimraf=require(_0x0b1e('0x1'));var zipdir=require(_0x0b1e('0x2'));var jsonpatch=require(_0x0b1e('0x3'));var rp=require(_0x0b1e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0b1e('0x5'));var util=require(_0x0b1e('0x6'));var path=require(_0x0b1e('0x7'));var sox=require(_0x0b1e('0x8'));var csv=require(_0x0b1e('0x9'));var ejs=require(_0x0b1e('0xa'));var fs=require('fs');var fs_extra=require(_0x0b1e('0xb'));var _=require(_0x0b1e('0xc'));var squel=require(_0x0b1e('0xd'));var crypto=require(_0x0b1e('0xe'));var jsforce=require(_0x0b1e('0xf'));var deskjs=require(_0x0b1e('0x10'));var toCsv=require(_0x0b1e('0x9'));var querystring=require('querystring');var Papa=require(_0x0b1e('0x11'));var Redis=require(_0x0b1e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0b1e('0x13'));var as=require(_0x0b1e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b1e('0x15'))(_0x0b1e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b1e('0x17'));var db=require(_0x0b1e('0x18'))['db'];function respondWithStatusCode(_0x567226,_0x5532e7){_0x5532e7=_0x5532e7||0xcc;return function(_0x1400a7){if(_0x1400a7){return _0x567226['sendStatus'](_0x5532e7);}return _0x567226['status'](_0x5532e7)[_0x0b1e('0x19')]();};}function respondWithResult(_0x22ac2c,_0x23b4ec){_0x23b4ec=_0x23b4ec||0xc8;return function(_0xedb61a){if(_0xedb61a){return _0x22ac2c[_0x0b1e('0x1a')](_0x23b4ec)[_0x0b1e('0x1b')](_0xedb61a);}};}function respondWithFilteredResult(_0x10f7ed,_0x1dc57b){return function(_0x51dec5){if(_0x51dec5){var _0x10c0a1=typeof _0x1dc57b[_0x0b1e('0x1c')]==='undefined'&&typeof _0x1dc57b['limit']===_0x0b1e('0x1d');var _0x5bf1c7=_0x51dec5[_0x0b1e('0x1e')];var _0x50eaa2=_0x10c0a1?0x0:_0x1dc57b[_0x0b1e('0x1c')];var _0xb0e945=_0x10c0a1?_0x51dec5[_0x0b1e('0x1e')]:_0x1dc57b[_0x0b1e('0x1c')]+_0x1dc57b['limit'];var _0x1089dd;if(_0xb0e945>=_0x5bf1c7){_0xb0e945=_0x5bf1c7;_0x1089dd=0xc8;}else{_0x1089dd=0xce;}_0x10f7ed['status'](_0x1089dd);return _0x10f7ed['set'](_0x0b1e('0x1f'),_0x50eaa2+'-'+_0xb0e945+'/'+_0x5bf1c7)[_0x0b1e('0x1b')](_0x51dec5);}return null;};}function patchUpdates(_0x449ed2){return function(_0x22ea46){try{jsonpatch[_0x0b1e('0x20')](_0x22ea46,_0x449ed2,!![]);}catch(_0x33dc98){return BPromise['reject'](_0x33dc98);}return _0x22ea46[_0x0b1e('0x21')]();};}function saveUpdates(_0x415b45,_0x5ec0e4){return function(_0x45141e){if(_0x45141e){return _0x45141e['update'](_0x415b45)['then'](function(_0x32c8ef){return _0x32c8ef;});}return null;};}function removeEntity(_0x55faed,_0x4d073b){return function(_0x5da9b0){if(_0x5da9b0){return _0x5da9b0['destroy']()[_0x0b1e('0x22')](function(){_0x55faed[_0x0b1e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31b2ff,_0x2eb8c4){return function(_0x1611a8){if(!_0x1611a8){_0x31b2ff[_0x0b1e('0x23')](0x194);}return _0x1611a8;};}function handleError(_0x60c436,_0x4ae5df){_0x4ae5df=_0x4ae5df||0x1f4;return function(_0x4adecd){logger[_0x0b1e('0x24')](_0x4adecd[_0x0b1e('0x25')]);if(_0x4adecd[_0x0b1e('0x26')]){delete _0x4adecd[_0x0b1e('0x26')];}_0x60c436[_0x0b1e('0x1a')](_0x4ae5df)['send'](_0x4adecd);};}exports[_0x0b1e('0x27')]=function(_0x3633bd,_0x5c6e96){var _0x43e527={},_0x345c24={},_0x291e73={'count':0x0,'rows':[]};var _0x5e0934=_[_0x0b1e('0x28')](db[_0x0b1e('0x29')][_0x0b1e('0x2a')],function(_0x4a81ea){return{'name':_0x4a81ea[_0x0b1e('0x2b')],'type':_0x4a81ea[_0x0b1e('0x2c')][_0x0b1e('0x2d')]};});_0x345c24[_0x0b1e('0x2e')]=_[_0x0b1e('0x28')](_0x5e0934,_0x0b1e('0x26'));_0x345c24[_0x0b1e('0x2f')]=_[_0x0b1e('0x30')](_0x3633bd[_0x0b1e('0x2f')]);_0x345c24['filters']=_[_0x0b1e('0x31')](_0x345c24[_0x0b1e('0x2e')],_0x345c24[_0x0b1e('0x2f')]);_0x43e527['attributes']=_[_0x0b1e('0x31')](_0x345c24[_0x0b1e('0x2e')],qs[_0x0b1e('0x32')](_0x3633bd[_0x0b1e('0x2f')][_0x0b1e('0x32')]));_0x43e527[_0x0b1e('0x33')]=_0x43e527['attributes'][_0x0b1e('0x34')]?_0x43e527[_0x0b1e('0x33')]:_0x345c24[_0x0b1e('0x2e')];if(!_0x3633bd[_0x0b1e('0x2f')][_0x0b1e('0x35')](_0x0b1e('0x36'))){_0x43e527[_0x0b1e('0x37')]=qs['limit'](_0x3633bd[_0x0b1e('0x2f')][_0x0b1e('0x37')]);_0x43e527[_0x0b1e('0x1c')]=qs[_0x0b1e('0x1c')](_0x3633bd[_0x0b1e('0x2f')][_0x0b1e('0x1c')]);}_0x43e527['order']=qs[_0x0b1e('0x38')](_0x3633bd['query'][_0x0b1e('0x38')]);_0x43e527['where']=qs[_0x0b1e('0x39')](_[_0x0b1e('0x3a')](_0x3633bd[_0x0b1e('0x2f')],_0x345c24['filters']),_0x5e0934);if(_0x3633bd['query'][_0x0b1e('0x3b')]){_0x43e527[_0x0b1e('0x3c')]=_[_0x0b1e('0x3d')](_0x43e527[_0x0b1e('0x3c')],{'$or':_[_0x0b1e('0x28')](_0x5e0934,function(_0x556206){if(_0x556206['type']!==_0x0b1e('0x3e')){var _0x344f20={};_0x344f20[_0x556206[_0x0b1e('0x26')]]={'$like':'%'+_0x3633bd[_0x0b1e('0x2f')][_0x0b1e('0x3b')]+'%'};return _0x344f20;}})});}_0x43e527=_[_0x0b1e('0x3d')]({},_0x43e527,_0x3633bd[_0x0b1e('0x3f')]);var _0x5386eb={'where':_0x43e527['where']};return db[_0x0b1e('0x29')][_0x0b1e('0x1e')](_0x5386eb)['then'](function(_0x55b80c){_0x291e73[_0x0b1e('0x1e')]=_0x55b80c;if(_0x3633bd[_0x0b1e('0x2f')]['includeAll']){_0x43e527[_0x0b1e('0x40')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x0b1e('0x41')](_0x43e527);})[_0x0b1e('0x22')](function(_0x5ad229){_0x291e73[_0x0b1e('0x42')]=_0x5ad229;return _0x291e73;})[_0x0b1e('0x22')](respondWithFilteredResult(_0x5c6e96,_0x43e527))[_0x0b1e('0x43')](handleError(_0x5c6e96,null));};exports['show']=function(_0x41b59a,_0x3cbddd){var _0x56647b={'raw':![],'where':{'id':_0x41b59a[_0x0b1e('0x44')]['id']}},_0x384b82={};_0x384b82[_0x0b1e('0x2e')]=_[_0x0b1e('0x30')](db['FreshdeskConfiguration'][_0x0b1e('0x2a')]);_0x384b82[_0x0b1e('0x2f')]=_[_0x0b1e('0x30')](_0x41b59a[_0x0b1e('0x2f')]);_0x384b82[_0x0b1e('0x39')]=_[_0x0b1e('0x31')](_0x384b82[_0x0b1e('0x2e')],_0x384b82[_0x0b1e('0x2f')]);_0x56647b[_0x0b1e('0x33')]=_[_0x0b1e('0x31')](_0x384b82[_0x0b1e('0x2e')],qs[_0x0b1e('0x32')](_0x41b59a[_0x0b1e('0x2f')][_0x0b1e('0x32')]));_0x56647b['attributes']=_0x56647b[_0x0b1e('0x33')][_0x0b1e('0x34')]?_0x56647b[_0x0b1e('0x33')]:_0x384b82[_0x0b1e('0x2e')];if(_0x41b59a[_0x0b1e('0x2f')][_0x0b1e('0x45')]){_0x56647b[_0x0b1e('0x40')]=[{'all':!![]}];}_0x56647b=_['merge']({},_0x56647b,_0x41b59a[_0x0b1e('0x3f')]);return db[_0x0b1e('0x29')][_0x0b1e('0x46')](_0x56647b)[_0x0b1e('0x22')](handleEntityNotFound(_0x3cbddd,null))[_0x0b1e('0x22')](respondWithResult(_0x3cbddd,null))['catch'](handleError(_0x3cbddd,null));};exports[_0x0b1e('0x47')]=function(_0x4f6d4f,_0x22dc3f){return db[_0x0b1e('0x29')][_0x0b1e('0x47')](_0x4f6d4f[_0x0b1e('0x48')],{})['then'](respondWithResult(_0x22dc3f,0xc9))['catch'](handleError(_0x22dc3f,null));};exports['update']=function(_0x5cce0d,_0x357403){if(_0x5cce0d[_0x0b1e('0x48')]['id']){delete _0x5cce0d['body']['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x5cce0d[_0x0b1e('0x44')]['id']}})[_0x0b1e('0x22')](handleEntityNotFound(_0x357403,null))[_0x0b1e('0x22')](saveUpdates(_0x5cce0d[_0x0b1e('0x48')],null))[_0x0b1e('0x22')](respondWithResult(_0x357403,null))[_0x0b1e('0x43')](handleError(_0x357403,null));};exports[_0x0b1e('0x49')]=function(_0x15946e,_0x576302){return db[_0x0b1e('0x29')]['find']({'where':{'id':_0x15946e[_0x0b1e('0x44')]['id']}})[_0x0b1e('0x22')](handleEntityNotFound(_0x576302,null))['then'](removeEntity(_0x576302,null))[_0x0b1e('0x43')](handleError(_0x576302,null));};exports[_0x0b1e('0x4a')]=function(_0x1b897e,_0x55b087,_0x33c472){var _0x2b776d={};var _0x1ba73b={};var _0x2dffcd;var _0x4d311b;return db[_0x0b1e('0x29')][_0x0b1e('0x4b')]({'where':{'id':_0x1b897e[_0x0b1e('0x44')]['id']}})[_0x0b1e('0x22')](handleEntityNotFound(_0x55b087,null))[_0x0b1e('0x22')](function(_0x2188cc){if(_0x2188cc){_0x2dffcd=_0x2188cc;_0x1ba73b[_0x0b1e('0x2e')]=_[_0x0b1e('0x30')](db[_0x0b1e('0x4c')]['rawAttributes']);_0x1ba73b[_0x0b1e('0x2f')]=_[_0x0b1e('0x30')](_0x1b897e[_0x0b1e('0x2f')]);_0x1ba73b['filters']=_['intersection'](_0x1ba73b[_0x0b1e('0x2e')],_0x1ba73b[_0x0b1e('0x2f')]);_0x2b776d[_0x0b1e('0x33')]=_[_0x0b1e('0x31')](_0x1ba73b[_0x0b1e('0x2e')],qs[_0x0b1e('0x32')](_0x1b897e[_0x0b1e('0x2f')][_0x0b1e('0x32')]));_0x2b776d[_0x0b1e('0x33')]=_0x2b776d[_0x0b1e('0x33')][_0x0b1e('0x34')]?_0x2b776d['attributes']:_0x1ba73b['model'];_0x2b776d[_0x0b1e('0x4d')]=qs['sort'](_0x1b897e[_0x0b1e('0x2f')][_0x0b1e('0x38')]);_0x2b776d[_0x0b1e('0x3c')]=qs[_0x0b1e('0x39')](_[_0x0b1e('0x3a')](_0x1b897e[_0x0b1e('0x2f')],_0x1ba73b[_0x0b1e('0x39')]));if(_0x1b897e[_0x0b1e('0x2f')]['filter']){_0x2b776d[_0x0b1e('0x3c')]=_['merge'](_0x2b776d[_0x0b1e('0x3c')],{'$or':_[_0x0b1e('0x28')](_0x2b776d['attributes'],function(_0x526e97){var _0x1da499={};_0x1da499[_0x526e97]={'$like':'%'+_0x1b897e[_0x0b1e('0x2f')][_0x0b1e('0x3b')]+'%'};return _0x1da499;})});}_0x2b776d=_['merge']({},_0x2b776d,_0x1b897e[_0x0b1e('0x3f')]);return _0x2dffcd[_0x0b1e('0x4a')](_0x2b776d);}})['then'](function(_0x24f67c){if(_0x24f67c){_0x4d311b=_0x24f67c['length'];if(!_0x1b897e[_0x0b1e('0x2f')][_0x0b1e('0x35')](_0x0b1e('0x36'))){_0x2b776d[_0x0b1e('0x37')]=qs[_0x0b1e('0x37')](_0x1b897e[_0x0b1e('0x2f')][_0x0b1e('0x37')]);_0x2b776d[_0x0b1e('0x1c')]=qs[_0x0b1e('0x1c')](_0x1b897e[_0x0b1e('0x2f')][_0x0b1e('0x1c')]);}return _0x2dffcd['getFields'](_0x2b776d);}})[_0x0b1e('0x22')](function(_0x47a94a){if(_0x47a94a){return _0x47a94a?{'count':_0x4d311b,'rows':_0x47a94a}:null;}})[_0x0b1e('0x22')](respondWithResult(_0x55b087,null))[_0x0b1e('0x43')](handleError(_0x55b087,null));};exports['getSubjects']=function(_0x587e96,_0x36aac0,_0x328a85){var _0x1fb010={};var _0x19ccc5={};var _0x5f1596;var _0x5dff29;return db[_0x0b1e('0x29')][_0x0b1e('0x4b')]({'where':{'id':_0x587e96[_0x0b1e('0x44')]['id']}})['then'](handleEntityNotFound(_0x36aac0,null))[_0x0b1e('0x22')](function(_0x217505){if(_0x217505){_0x5f1596=_0x217505;_0x19ccc5[_0x0b1e('0x2e')]=_['keys'](db[_0x0b1e('0x4c')][_0x0b1e('0x2a')]);_0x19ccc5[_0x0b1e('0x2f')]=_[_0x0b1e('0x30')](_0x587e96[_0x0b1e('0x2f')]);_0x19ccc5['filters']=_[_0x0b1e('0x31')](_0x19ccc5['model'],_0x19ccc5[_0x0b1e('0x2f')]);_0x1fb010[_0x0b1e('0x33')]=_[_0x0b1e('0x31')](_0x19ccc5[_0x0b1e('0x2e')],qs['fields'](_0x587e96[_0x0b1e('0x2f')][_0x0b1e('0x32')]));_0x1fb010[_0x0b1e('0x33')]=_0x1fb010['attributes'][_0x0b1e('0x34')]?_0x1fb010[_0x0b1e('0x33')]:_0x19ccc5[_0x0b1e('0x2e')];_0x1fb010[_0x0b1e('0x4d')]=qs['sort'](_0x587e96['query'][_0x0b1e('0x38')]);_0x1fb010['where']=qs['filters'](_[_0x0b1e('0x3a')](_0x587e96[_0x0b1e('0x2f')],_0x19ccc5[_0x0b1e('0x39')]));if(_0x587e96[_0x0b1e('0x2f')][_0x0b1e('0x3b')]){_0x1fb010[_0x0b1e('0x3c')]=_[_0x0b1e('0x3d')](_0x1fb010[_0x0b1e('0x3c')],{'$or':_[_0x0b1e('0x28')](_0x1fb010['attributes'],function(_0x3bac87){var _0x4631ea={};_0x4631ea[_0x3bac87]={'$like':'%'+_0x587e96['query']['filter']+'%'};return _0x4631ea;})});}_0x1fb010=_[_0x0b1e('0x3d')]({},_0x1fb010,_0x587e96[_0x0b1e('0x3f')]);return _0x5f1596['getSubjects'](_0x1fb010);}})[_0x0b1e('0x22')](function(_0x2e830f){if(_0x2e830f){_0x5dff29=_0x2e830f['length'];if(!_0x587e96[_0x0b1e('0x2f')][_0x0b1e('0x35')](_0x0b1e('0x36'))){_0x1fb010[_0x0b1e('0x37')]=qs['limit'](_0x587e96[_0x0b1e('0x2f')]['limit']);_0x1fb010[_0x0b1e('0x1c')]=qs[_0x0b1e('0x1c')](_0x587e96[_0x0b1e('0x2f')][_0x0b1e('0x1c')]);}return _0x5f1596[_0x0b1e('0x4e')](_0x1fb010);}})[_0x0b1e('0x22')](function(_0x15b728){if(_0x15b728){return _0x15b728?{'count':_0x5dff29,'rows':_0x15b728}:null;}})['then'](respondWithResult(_0x36aac0,null))[_0x0b1e('0x43')](handleError(_0x36aac0,null));};exports[_0x0b1e('0x4f')]=function(_0x4a512e,_0x17cb72,_0xb47f2f){var _0x9fe36e={};var _0x4e4fdc={};var _0x29ada8;var _0x41da49;return db[_0x0b1e('0x29')][_0x0b1e('0x4b')]({'where':{'id':_0x4a512e['params']['id']}})[_0x0b1e('0x22')](handleEntityNotFound(_0x17cb72,null))[_0x0b1e('0x22')](function(_0x2e404e){if(_0x2e404e){_0x29ada8=_0x2e404e;_0x4e4fdc['model']=_['keys'](db[_0x0b1e('0x4c')][_0x0b1e('0x2a')]);_0x4e4fdc[_0x0b1e('0x2f')]=_[_0x0b1e('0x30')](_0x4a512e[_0x0b1e('0x2f')]);_0x4e4fdc[_0x0b1e('0x39')]=_['intersection'](_0x4e4fdc[_0x0b1e('0x2e')],_0x4e4fdc[_0x0b1e('0x2f')]);_0x9fe36e[_0x0b1e('0x33')]=_[_0x0b1e('0x31')](_0x4e4fdc[_0x0b1e('0x2e')],qs['fields'](_0x4a512e['query']['fields']));_0x9fe36e[_0x0b1e('0x33')]=_0x9fe36e[_0x0b1e('0x33')][_0x0b1e('0x34')]?_0x9fe36e[_0x0b1e('0x33')]:_0x4e4fdc[_0x0b1e('0x2e')];_0x9fe36e[_0x0b1e('0x4d')]=qs['sort'](_0x4a512e[_0x0b1e('0x2f')]['sort']);_0x9fe36e['where']=qs['filters'](_['pick'](_0x4a512e['query'],_0x4e4fdc['filters']));if(_0x4a512e['query']['filter']){_0x9fe36e[_0x0b1e('0x3c')]=_[_0x0b1e('0x3d')](_0x9fe36e[_0x0b1e('0x3c')],{'$or':_[_0x0b1e('0x28')](_0x9fe36e[_0x0b1e('0x33')],function(_0x12799b){var _0x1f7dae={};_0x1f7dae[_0x12799b]={'$like':'%'+_0x4a512e[_0x0b1e('0x2f')][_0x0b1e('0x3b')]+'%'};return _0x1f7dae;})});}_0x9fe36e=_[_0x0b1e('0x3d')]({},_0x9fe36e,_0x4a512e['options']);return _0x29ada8[_0x0b1e('0x4f')](_0x9fe36e);}})[_0x0b1e('0x22')](function(_0x3275fd){if(_0x3275fd){_0x41da49=_0x3275fd[_0x0b1e('0x34')];if(!_0x4a512e[_0x0b1e('0x2f')][_0x0b1e('0x35')](_0x0b1e('0x36'))){_0x9fe36e[_0x0b1e('0x37')]=qs[_0x0b1e('0x37')](_0x4a512e['query'][_0x0b1e('0x37')]);_0x9fe36e[_0x0b1e('0x1c')]=qs[_0x0b1e('0x1c')](_0x4a512e[_0x0b1e('0x2f')]['offset']);}return _0x29ada8['getDescriptions'](_0x9fe36e);}})[_0x0b1e('0x22')](function(_0x219da7){if(_0x219da7){return _0x219da7?{'count':_0x41da49,'rows':_0x219da7}:null;}})['then'](respondWithResult(_0x17cb72,null))[_0x0b1e('0x43')](handleError(_0x17cb72,null));};exports['getTags']=function(_0x11a43f,_0x2c733d,_0x4b9793){var _0x306789={};var _0x47b994={};var _0x5f63af;var _0x571c38;return db[_0x0b1e('0x29')]['findOne']({'where':{'id':_0x11a43f['params']['id']}})[_0x0b1e('0x22')](handleEntityNotFound(_0x2c733d,null))['then'](function(_0x26fe6b){if(_0x26fe6b){_0x5f63af=_0x26fe6b;_0x47b994['model']=_['keys'](db['Tag']['rawAttributes']);_0x47b994['query']=_['keys'](_0x11a43f[_0x0b1e('0x2f')]);_0x47b994[_0x0b1e('0x39')]=_[_0x0b1e('0x31')](_0x47b994[_0x0b1e('0x2e')],_0x47b994[_0x0b1e('0x2f')]);_0x306789['attributes']=_[_0x0b1e('0x31')](_0x47b994[_0x0b1e('0x2e')],qs[_0x0b1e('0x32')](_0x11a43f[_0x0b1e('0x2f')][_0x0b1e('0x32')]));_0x306789[_0x0b1e('0x33')]=_0x306789[_0x0b1e('0x33')][_0x0b1e('0x34')]?_0x306789['attributes']:_0x47b994[_0x0b1e('0x2e')];_0x306789[_0x0b1e('0x4d')]=qs[_0x0b1e('0x38')](_0x11a43f[_0x0b1e('0x2f')]['sort']);_0x306789[_0x0b1e('0x3c')]=qs[_0x0b1e('0x39')](_[_0x0b1e('0x3a')](_0x11a43f[_0x0b1e('0x2f')],_0x47b994[_0x0b1e('0x39')]));if(_0x11a43f['query'][_0x0b1e('0x3b')]){_0x306789[_0x0b1e('0x3c')]=_['merge'](_0x306789['where'],{'$or':_['map'](_0x306789[_0x0b1e('0x33')],function(_0x4e6836){var _0x3e1260={};_0x3e1260[_0x4e6836]={'$like':'%'+_0x11a43f['query']['filter']+'%'};return _0x3e1260;})});}_0x306789=_[_0x0b1e('0x3d')]({},_0x306789,_0x11a43f[_0x0b1e('0x3f')]);return _0x5f63af[_0x0b1e('0x50')](_0x306789);}})[_0x0b1e('0x22')](function(_0x5dfebb){if(_0x5dfebb){_0x571c38=_0x5dfebb[_0x0b1e('0x34')];if(!_0x11a43f[_0x0b1e('0x2f')][_0x0b1e('0x35')](_0x0b1e('0x36'))){_0x306789[_0x0b1e('0x37')]=qs[_0x0b1e('0x37')](_0x11a43f[_0x0b1e('0x2f')][_0x0b1e('0x37')]);_0x306789[_0x0b1e('0x1c')]=qs['offset'](_0x11a43f[_0x0b1e('0x2f')][_0x0b1e('0x1c')]);}return _0x5f63af['getTags'](_0x306789);}})[_0x0b1e('0x22')](function(_0x234203){if(_0x234203){return _0x234203?{'count':_0x571c38,'rows':_0x234203}:null;}})['then'](respondWithResult(_0x2c733d,null))[_0x0b1e('0x43')](handleError(_0x2c733d,null));};exports[_0x0b1e('0x51')]=function(_0x2b1cf3,_0x3d55f4,_0x393a32){if(_0x2b1cf3['body']['id']){delete _0x2b1cf3['body']['id'];}return db[_0x0b1e('0x29')][_0x0b1e('0x4b')]({'where':{'id':_0x2b1cf3[_0x0b1e('0x44')]['id']}})[_0x0b1e('0x22')](handleEntityNotFound(_0x3d55f4,null))['then'](function(_0x31d76){if(_0x31d76){return _0x31d76[_0x0b1e('0x51')](_0x2b1cf3['body'][_0x0b1e('0x52')]||[]);}return null;})[_0x0b1e('0x22')](respondWithResult(_0x3d55f4,null))['catch'](handleError(_0x3d55f4,null));}; \ No newline at end of file +var _0x5ca9=['index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','getFields','findOne','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x381062,_0x4e7f53){var _0x185cd6=function(_0x300ecb){while(--_0x300ecb){_0x381062['push'](_0x381062['shift']());}};_0x185cd6(++_0x4e7f53);}(_0x5ca9,0x12d));var _0x95ca=function(_0x1d6f43,_0x1a10ce){_0x1d6f43=_0x1d6f43-0x0;var _0x45209a=_0x5ca9[_0x1d6f43];return _0x45209a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95ca('0x0'));var zipdir=require(_0x95ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95ca('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95ca('0x3'));var util=require(_0x95ca('0x4'));var path=require(_0x95ca('0x5'));var sox=require('sox');var csv=require(_0x95ca('0x6'));var ejs=require(_0x95ca('0x7'));var fs=require('fs');var fs_extra=require(_0x95ca('0x8'));var _=require('lodash');var squel=require(_0x95ca('0x9'));var crypto=require(_0x95ca('0xa'));var jsforce=require(_0x95ca('0xb'));var deskjs=require(_0x95ca('0xc'));var toCsv=require('to-csv');var querystring=require(_0x95ca('0xd'));var Papa=require(_0x95ca('0xe'));var Redis=require('ioredis');var authService=require(_0x95ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x95ca('0x10'));var hardwareService=require(_0x95ca('0x11'));var logger=require(_0x95ca('0x12'))(_0x95ca('0x13'));var utils=require(_0x95ca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x95ca('0x15'));var db=require(_0x95ca('0x16'))['db'];function respondWithStatusCode(_0x1fa9b6,_0x30e000){_0x30e000=_0x30e000||0xcc;return function(_0x2037d4){if(_0x2037d4){return _0x1fa9b6[_0x95ca('0x17')](_0x30e000);}return _0x1fa9b6[_0x95ca('0x18')](_0x30e000)['end']();};}function respondWithResult(_0x140f16,_0x38cf6e){_0x38cf6e=_0x38cf6e||0xc8;return function(_0x13099a){if(_0x13099a){return _0x140f16['status'](_0x38cf6e)[_0x95ca('0x19')](_0x13099a);}};}function respondWithFilteredResult(_0x1e16a4,_0x365623){return function(_0x4b9135){if(_0x4b9135){var _0x54e824=typeof _0x365623[_0x95ca('0x1a')]==='undefined'&&typeof _0x365623[_0x95ca('0x1b')]===_0x95ca('0x1c');var _0x3e1ffb=_0x4b9135[_0x95ca('0x1d')];var _0xeee5ea=_0x54e824?0x0:_0x365623[_0x95ca('0x1a')];var _0x30407c=_0x54e824?_0x4b9135[_0x95ca('0x1d')]:_0x365623[_0x95ca('0x1a')]+_0x365623[_0x95ca('0x1b')];var _0x338e69;if(_0x30407c>=_0x3e1ffb){_0x30407c=_0x3e1ffb;_0x338e69=0xc8;}else{_0x338e69=0xce;}_0x1e16a4['status'](_0x338e69);return _0x1e16a4[_0x95ca('0x1e')](_0x95ca('0x1f'),_0xeee5ea+'-'+_0x30407c+'/'+_0x3e1ffb)['json'](_0x4b9135);}return null;};}function patchUpdates(_0x51db69){return function(_0x5d3245){try{jsonpatch[_0x95ca('0x20')](_0x5d3245,_0x51db69,!![]);}catch(_0x1338dd){return BPromise[_0x95ca('0x21')](_0x1338dd);}return _0x5d3245[_0x95ca('0x22')]();};}function saveUpdates(_0x458725,_0xc9a886){return function(_0x5f49d4){if(_0x5f49d4){return _0x5f49d4[_0x95ca('0x23')](_0x458725)[_0x95ca('0x24')](function(_0x499ca1){return _0x499ca1;});}return null;};}function removeEntity(_0x4f272a,_0x30d21d){return function(_0x31963c){if(_0x31963c){return _0x31963c[_0x95ca('0x25')]()[_0x95ca('0x24')](function(){_0x4f272a[_0x95ca('0x18')](0xcc)[_0x95ca('0x26')]();});}};}function handleEntityNotFound(_0x2bb8f8,_0x1999f5){return function(_0x38a06d){if(!_0x38a06d){_0x2bb8f8[_0x95ca('0x17')](0x194);}return _0x38a06d;};}function handleError(_0x26cd14,_0x42ce8){_0x42ce8=_0x42ce8||0x1f4;return function(_0x98d68b){logger[_0x95ca('0x27')](_0x98d68b[_0x95ca('0x28')]);if(_0x98d68b[_0x95ca('0x29')]){delete _0x98d68b['name'];}_0x26cd14['status'](_0x42ce8)[_0x95ca('0x2a')](_0x98d68b);};}exports[_0x95ca('0x2b')]=function(_0x5dc066,_0x1829a6){var _0x48f2f5={},_0x4f30b6={},_0xb9b367={'count':0x0,'rows':[]};var _0x4b516a=_[_0x95ca('0x2c')](db[_0x95ca('0x2d')][_0x95ca('0x2e')],function(_0x4fa3e2){return{'name':_0x4fa3e2[_0x95ca('0x2f')],'type':_0x4fa3e2[_0x95ca('0x30')]['key']};});_0x4f30b6[_0x95ca('0x31')]=_[_0x95ca('0x2c')](_0x4b516a,'name');_0x4f30b6[_0x95ca('0x32')]=_[_0x95ca('0x33')](_0x5dc066[_0x95ca('0x32')]);_0x4f30b6[_0x95ca('0x34')]=_[_0x95ca('0x35')](_0x4f30b6['model'],_0x4f30b6[_0x95ca('0x32')]);_0x48f2f5['attributes']=_[_0x95ca('0x35')](_0x4f30b6['model'],qs[_0x95ca('0x36')](_0x5dc066[_0x95ca('0x32')][_0x95ca('0x36')]));_0x48f2f5['attributes']=_0x48f2f5[_0x95ca('0x37')][_0x95ca('0x38')]?_0x48f2f5[_0x95ca('0x37')]:_0x4f30b6[_0x95ca('0x31')];if(!_0x5dc066[_0x95ca('0x32')][_0x95ca('0x39')](_0x95ca('0x3a'))){_0x48f2f5[_0x95ca('0x1b')]=qs[_0x95ca('0x1b')](_0x5dc066[_0x95ca('0x32')][_0x95ca('0x1b')]);_0x48f2f5[_0x95ca('0x1a')]=qs['offset'](_0x5dc066[_0x95ca('0x32')][_0x95ca('0x1a')]);}_0x48f2f5[_0x95ca('0x3b')]=qs[_0x95ca('0x3c')](_0x5dc066[_0x95ca('0x32')]['sort']);_0x48f2f5['where']=qs[_0x95ca('0x34')](_[_0x95ca('0x3d')](_0x5dc066[_0x95ca('0x32')],_0x4f30b6[_0x95ca('0x34')]),_0x4b516a);if(_0x5dc066[_0x95ca('0x32')]['filter']){_0x48f2f5['where']=_['merge'](_0x48f2f5[_0x95ca('0x3e')],{'$or':_[_0x95ca('0x2c')](_0x4b516a,function(_0x5863bf){if(_0x5863bf[_0x95ca('0x30')]!==_0x95ca('0x3f')){var _0x71284d={};_0x71284d[_0x5863bf[_0x95ca('0x29')]]={'$like':'%'+_0x5dc066['query'][_0x95ca('0x40')]+'%'};return _0x71284d;}})});}_0x48f2f5=_[_0x95ca('0x41')]({},_0x48f2f5,_0x5dc066['options']);var _0x4225d7={'where':_0x48f2f5['where']};return db[_0x95ca('0x2d')][_0x95ca('0x1d')](_0x4225d7)[_0x95ca('0x24')](function(_0x42abab){_0xb9b367[_0x95ca('0x1d')]=_0x42abab;if(_0x5dc066[_0x95ca('0x32')][_0x95ca('0x42')]){_0x48f2f5[_0x95ca('0x43')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x95ca('0x44')](_0x48f2f5);})[_0x95ca('0x24')](function(_0x33d317){_0xb9b367[_0x95ca('0x45')]=_0x33d317;return _0xb9b367;})[_0x95ca('0x24')](respondWithFilteredResult(_0x1829a6,_0x48f2f5))['catch'](handleError(_0x1829a6,null));};exports[_0x95ca('0x46')]=function(_0x164c1a,_0x2eddb0){var _0x17c180={'raw':![],'where':{'id':_0x164c1a[_0x95ca('0x47')]['id']}},_0x18c9f3={};_0x18c9f3['model']=_[_0x95ca('0x33')](db[_0x95ca('0x2d')][_0x95ca('0x2e')]);_0x18c9f3[_0x95ca('0x32')]=_[_0x95ca('0x33')](_0x164c1a[_0x95ca('0x32')]);_0x18c9f3[_0x95ca('0x34')]=_[_0x95ca('0x35')](_0x18c9f3[_0x95ca('0x31')],_0x18c9f3[_0x95ca('0x32')]);_0x17c180[_0x95ca('0x37')]=_['intersection'](_0x18c9f3[_0x95ca('0x31')],qs[_0x95ca('0x36')](_0x164c1a[_0x95ca('0x32')][_0x95ca('0x36')]));_0x17c180[_0x95ca('0x37')]=_0x17c180[_0x95ca('0x37')][_0x95ca('0x38')]?_0x17c180[_0x95ca('0x37')]:_0x18c9f3[_0x95ca('0x31')];if(_0x164c1a[_0x95ca('0x32')][_0x95ca('0x42')]){_0x17c180['include']=[{'all':!![]}];}_0x17c180=_['merge']({},_0x17c180,_0x164c1a[_0x95ca('0x48')]);return db[_0x95ca('0x2d')][_0x95ca('0x49')](_0x17c180)['then'](handleEntityNotFound(_0x2eddb0,null))[_0x95ca('0x24')](respondWithResult(_0x2eddb0,null))['catch'](handleError(_0x2eddb0,null));};exports[_0x95ca('0x4a')]=function(_0x45badf,_0x14e206){return db[_0x95ca('0x2d')][_0x95ca('0x4a')](_0x45badf[_0x95ca('0x4b')],{})[_0x95ca('0x24')](respondWithResult(_0x14e206,0xc9))[_0x95ca('0x4c')](handleError(_0x14e206,null));};exports[_0x95ca('0x23')]=function(_0x323d55,_0x297f54){if(_0x323d55['body']['id']){delete _0x323d55[_0x95ca('0x4b')]['id'];}return db[_0x95ca('0x2d')]['find']({'where':{'id':_0x323d55[_0x95ca('0x47')]['id']}})[_0x95ca('0x24')](handleEntityNotFound(_0x297f54,null))['then'](saveUpdates(_0x323d55[_0x95ca('0x4b')],null))[_0x95ca('0x24')](respondWithResult(_0x297f54,null))['catch'](handleError(_0x297f54,null));};exports[_0x95ca('0x25')]=function(_0x4247db,_0x3f8f05){return db[_0x95ca('0x2d')][_0x95ca('0x49')]({'where':{'id':_0x4247db[_0x95ca('0x47')]['id']}})[_0x95ca('0x24')](handleEntityNotFound(_0x3f8f05,null))[_0x95ca('0x24')](removeEntity(_0x3f8f05,null))[_0x95ca('0x4c')](handleError(_0x3f8f05,null));};exports[_0x95ca('0x4d')]=function(_0x4e698e,_0x251e12,_0x5000d3){var _0x37e2ef={};var _0x474105={};var _0xd4cd7d;var _0x1d3608;return db['FreshdeskConfiguration'][_0x95ca('0x4e')]({'where':{'id':_0x4e698e[_0x95ca('0x47')]['id']}})[_0x95ca('0x24')](handleEntityNotFound(_0x251e12,null))[_0x95ca('0x24')](function(_0x49b09b){if(_0x49b09b){_0xd4cd7d=_0x49b09b;_0x474105[_0x95ca('0x31')]=_[_0x95ca('0x33')](db['FreshdeskField'][_0x95ca('0x2e')]);_0x474105[_0x95ca('0x32')]=_['keys'](_0x4e698e[_0x95ca('0x32')]);_0x474105[_0x95ca('0x34')]=_[_0x95ca('0x35')](_0x474105[_0x95ca('0x31')],_0x474105[_0x95ca('0x32')]);_0x37e2ef[_0x95ca('0x37')]=_[_0x95ca('0x35')](_0x474105[_0x95ca('0x31')],qs[_0x95ca('0x36')](_0x4e698e[_0x95ca('0x32')][_0x95ca('0x36')]));_0x37e2ef['attributes']=_0x37e2ef[_0x95ca('0x37')][_0x95ca('0x38')]?_0x37e2ef[_0x95ca('0x37')]:_0x474105[_0x95ca('0x31')];_0x37e2ef[_0x95ca('0x3b')]=qs['sort'](_0x4e698e[_0x95ca('0x32')][_0x95ca('0x3c')]);_0x37e2ef['where']=qs[_0x95ca('0x34')](_['pick'](_0x4e698e[_0x95ca('0x32')],_0x474105['filters']));if(_0x4e698e[_0x95ca('0x32')][_0x95ca('0x40')]){_0x37e2ef[_0x95ca('0x3e')]=_[_0x95ca('0x41')](_0x37e2ef[_0x95ca('0x3e')],{'$or':_[_0x95ca('0x2c')](_0x37e2ef[_0x95ca('0x37')],function(_0x8e4fa){var _0x127d9b={};_0x127d9b[_0x8e4fa]={'$like':'%'+_0x4e698e[_0x95ca('0x32')]['filter']+'%'};return _0x127d9b;})});}_0x37e2ef=_[_0x95ca('0x41')]({},_0x37e2ef,_0x4e698e[_0x95ca('0x48')]);return _0xd4cd7d['getFields'](_0x37e2ef);}})[_0x95ca('0x24')](function(_0x160c26){if(_0x160c26){_0x1d3608=_0x160c26['length'];if(!_0x4e698e[_0x95ca('0x32')][_0x95ca('0x39')]('nolimit')){_0x37e2ef['limit']=qs[_0x95ca('0x1b')](_0x4e698e[_0x95ca('0x32')]['limit']);_0x37e2ef['offset']=qs[_0x95ca('0x1a')](_0x4e698e['query'][_0x95ca('0x1a')]);}return _0xd4cd7d[_0x95ca('0x4d')](_0x37e2ef);}})[_0x95ca('0x24')](function(_0x493312){if(_0x493312){return _0x493312?{'count':_0x1d3608,'rows':_0x493312}:null;}})['then'](respondWithResult(_0x251e12,null))[_0x95ca('0x4c')](handleError(_0x251e12,null));};exports[_0x95ca('0x4f')]=function(_0x48ff38,_0x5deee8,_0x3ac04a){var _0x20fccc={};var _0x4745bc={};var _0xf52bdb;var _0x5223b6;return db[_0x95ca('0x2d')]['findOne']({'where':{'id':_0x48ff38['params']['id']}})[_0x95ca('0x24')](handleEntityNotFound(_0x5deee8,null))[_0x95ca('0x24')](function(_0x8da90){if(_0x8da90){_0xf52bdb=_0x8da90;_0x4745bc[_0x95ca('0x31')]=_[_0x95ca('0x33')](db[_0x95ca('0x50')]['rawAttributes']);_0x4745bc[_0x95ca('0x32')]=_['keys'](_0x48ff38[_0x95ca('0x32')]);_0x4745bc[_0x95ca('0x34')]=_['intersection'](_0x4745bc['model'],_0x4745bc[_0x95ca('0x32')]);_0x20fccc[_0x95ca('0x37')]=_[_0x95ca('0x35')](_0x4745bc[_0x95ca('0x31')],qs[_0x95ca('0x36')](_0x48ff38['query'][_0x95ca('0x36')]));_0x20fccc[_0x95ca('0x37')]=_0x20fccc[_0x95ca('0x37')][_0x95ca('0x38')]?_0x20fccc[_0x95ca('0x37')]:_0x4745bc[_0x95ca('0x31')];_0x20fccc[_0x95ca('0x3b')]=qs['sort'](_0x48ff38[_0x95ca('0x32')][_0x95ca('0x3c')]);_0x20fccc[_0x95ca('0x3e')]=qs[_0x95ca('0x34')](_[_0x95ca('0x3d')](_0x48ff38[_0x95ca('0x32')],_0x4745bc[_0x95ca('0x34')]));if(_0x48ff38[_0x95ca('0x32')][_0x95ca('0x40')]){_0x20fccc[_0x95ca('0x3e')]=_['merge'](_0x20fccc['where'],{'$or':_[_0x95ca('0x2c')](_0x20fccc['attributes'],function(_0x38c133){var _0x521841={};_0x521841[_0x38c133]={'$like':'%'+_0x48ff38[_0x95ca('0x32')][_0x95ca('0x40')]+'%'};return _0x521841;})});}_0x20fccc=_[_0x95ca('0x41')]({},_0x20fccc,_0x48ff38[_0x95ca('0x48')]);return _0xf52bdb['getSubjects'](_0x20fccc);}})[_0x95ca('0x24')](function(_0x3ef57e){if(_0x3ef57e){_0x5223b6=_0x3ef57e[_0x95ca('0x38')];if(!_0x48ff38[_0x95ca('0x32')][_0x95ca('0x39')](_0x95ca('0x3a'))){_0x20fccc[_0x95ca('0x1b')]=qs[_0x95ca('0x1b')](_0x48ff38[_0x95ca('0x32')][_0x95ca('0x1b')]);_0x20fccc[_0x95ca('0x1a')]=qs['offset'](_0x48ff38[_0x95ca('0x32')][_0x95ca('0x1a')]);}return _0xf52bdb[_0x95ca('0x4f')](_0x20fccc);}})['then'](function(_0x2afd6){if(_0x2afd6){return _0x2afd6?{'count':_0x5223b6,'rows':_0x2afd6}:null;}})['then'](respondWithResult(_0x5deee8,null))[_0x95ca('0x4c')](handleError(_0x5deee8,null));};exports[_0x95ca('0x51')]=function(_0x5c8df7,_0x210583,_0x2c15b2){var _0x415beb={};var _0x2f83e2={};var _0x285a7c;var _0x4e05f3;return db[_0x95ca('0x2d')][_0x95ca('0x4e')]({'where':{'id':_0x5c8df7[_0x95ca('0x47')]['id']}})[_0x95ca('0x24')](handleEntityNotFound(_0x210583,null))[_0x95ca('0x24')](function(_0x14f9fe){if(_0x14f9fe){_0x285a7c=_0x14f9fe;_0x2f83e2[_0x95ca('0x31')]=_[_0x95ca('0x33')](db[_0x95ca('0x50')]['rawAttributes']);_0x2f83e2[_0x95ca('0x32')]=_['keys'](_0x5c8df7['query']);_0x2f83e2['filters']=_[_0x95ca('0x35')](_0x2f83e2[_0x95ca('0x31')],_0x2f83e2[_0x95ca('0x32')]);_0x415beb[_0x95ca('0x37')]=_['intersection'](_0x2f83e2[_0x95ca('0x31')],qs[_0x95ca('0x36')](_0x5c8df7[_0x95ca('0x32')]['fields']));_0x415beb['attributes']=_0x415beb[_0x95ca('0x37')][_0x95ca('0x38')]?_0x415beb[_0x95ca('0x37')]:_0x2f83e2['model'];_0x415beb[_0x95ca('0x3b')]=qs[_0x95ca('0x3c')](_0x5c8df7[_0x95ca('0x32')]['sort']);_0x415beb['where']=qs['filters'](_[_0x95ca('0x3d')](_0x5c8df7['query'],_0x2f83e2[_0x95ca('0x34')]));if(_0x5c8df7['query'][_0x95ca('0x40')]){_0x415beb[_0x95ca('0x3e')]=_[_0x95ca('0x41')](_0x415beb[_0x95ca('0x3e')],{'$or':_['map'](_0x415beb['attributes'],function(_0x47faa4){var _0x27a1d3={};_0x27a1d3[_0x47faa4]={'$like':'%'+_0x5c8df7[_0x95ca('0x32')][_0x95ca('0x40')]+'%'};return _0x27a1d3;})});}_0x415beb=_[_0x95ca('0x41')]({},_0x415beb,_0x5c8df7[_0x95ca('0x48')]);return _0x285a7c[_0x95ca('0x51')](_0x415beb);}})[_0x95ca('0x24')](function(_0x329154){if(_0x329154){_0x4e05f3=_0x329154['length'];if(!_0x5c8df7[_0x95ca('0x32')][_0x95ca('0x39')]('nolimit')){_0x415beb[_0x95ca('0x1b')]=qs[_0x95ca('0x1b')](_0x5c8df7[_0x95ca('0x32')][_0x95ca('0x1b')]);_0x415beb['offset']=qs[_0x95ca('0x1a')](_0x5c8df7[_0x95ca('0x32')][_0x95ca('0x1a')]);}return _0x285a7c[_0x95ca('0x51')](_0x415beb);}})[_0x95ca('0x24')](function(_0x3b0401){if(_0x3b0401){return _0x3b0401?{'count':_0x4e05f3,'rows':_0x3b0401}:null;}})[_0x95ca('0x24')](respondWithResult(_0x210583,null))[_0x95ca('0x4c')](handleError(_0x210583,null));};exports[_0x95ca('0x52')]=function(_0x36bbf6,_0x345d70,_0x3bb9b9){var _0x28df4b={};var _0x5da86c={};var _0x4634b5;var _0x462001;return db[_0x95ca('0x2d')][_0x95ca('0x4e')]({'where':{'id':_0x36bbf6['params']['id']}})[_0x95ca('0x24')](handleEntityNotFound(_0x345d70,null))[_0x95ca('0x24')](function(_0x527940){if(_0x527940){_0x4634b5=_0x527940;_0x5da86c[_0x95ca('0x31')]=_[_0x95ca('0x33')](db[_0x95ca('0x53')][_0x95ca('0x2e')]);_0x5da86c[_0x95ca('0x32')]=_[_0x95ca('0x33')](_0x36bbf6[_0x95ca('0x32')]);_0x5da86c[_0x95ca('0x34')]=_[_0x95ca('0x35')](_0x5da86c[_0x95ca('0x31')],_0x5da86c[_0x95ca('0x32')]);_0x28df4b[_0x95ca('0x37')]=_[_0x95ca('0x35')](_0x5da86c[_0x95ca('0x31')],qs[_0x95ca('0x36')](_0x36bbf6[_0x95ca('0x32')][_0x95ca('0x36')]));_0x28df4b[_0x95ca('0x37')]=_0x28df4b[_0x95ca('0x37')][_0x95ca('0x38')]?_0x28df4b[_0x95ca('0x37')]:_0x5da86c[_0x95ca('0x31')];_0x28df4b[_0x95ca('0x3b')]=qs[_0x95ca('0x3c')](_0x36bbf6[_0x95ca('0x32')][_0x95ca('0x3c')]);_0x28df4b[_0x95ca('0x3e')]=qs[_0x95ca('0x34')](_[_0x95ca('0x3d')](_0x36bbf6['query'],_0x5da86c[_0x95ca('0x34')]));if(_0x36bbf6[_0x95ca('0x32')][_0x95ca('0x40')]){_0x28df4b[_0x95ca('0x3e')]=_['merge'](_0x28df4b[_0x95ca('0x3e')],{'$or':_[_0x95ca('0x2c')](_0x28df4b['attributes'],function(_0x17cbc3){var _0x1ce7e0={};_0x1ce7e0[_0x17cbc3]={'$like':'%'+_0x36bbf6[_0x95ca('0x32')]['filter']+'%'};return _0x1ce7e0;})});}_0x28df4b=_[_0x95ca('0x41')]({},_0x28df4b,_0x36bbf6['options']);return _0x4634b5[_0x95ca('0x52')](_0x28df4b);}})[_0x95ca('0x24')](function(_0x563e94){if(_0x563e94){_0x462001=_0x563e94[_0x95ca('0x38')];if(!_0x36bbf6[_0x95ca('0x32')][_0x95ca('0x39')]('nolimit')){_0x28df4b[_0x95ca('0x1b')]=qs[_0x95ca('0x1b')](_0x36bbf6[_0x95ca('0x32')][_0x95ca('0x1b')]);_0x28df4b[_0x95ca('0x1a')]=qs[_0x95ca('0x1a')](_0x36bbf6['query']['offset']);}return _0x4634b5['getTags'](_0x28df4b);}})['then'](function(_0x1dd9bb){if(_0x1dd9bb){return _0x1dd9bb?{'count':_0x462001,'rows':_0x1dd9bb}:null;}})[_0x95ca('0x24')](respondWithResult(_0x345d70,null))[_0x95ca('0x4c')](handleError(_0x345d70,null));};exports[_0x95ca('0x54')]=function(_0x1a63da,_0x13d958,_0x222b9){if(_0x1a63da[_0x95ca('0x4b')]['id']){delete _0x1a63da[_0x95ca('0x4b')]['id'];}return db[_0x95ca('0x2d')][_0x95ca('0x4e')]({'where':{'id':_0x1a63da[_0x95ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x13d958,null))[_0x95ca('0x24')](function(_0x41064a){if(_0x41064a){return _0x41064a['setTags'](_0x1a63da['body'][_0x95ca('0x55')]||[]);}return null;})[_0x95ca('0x24')](respondWithResult(_0x13d958,null))[_0x95ca('0x4c')](handleError(_0x13d958,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1211ac0..c1d046f 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 _0x723b=['int_freshdesk_configurations','lodash','api','moment','bluebird','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x44052e,_0x3ae893){var _0x420f70=function(_0x3c888f){while(--_0x3c888f){_0x44052e['push'](_0x44052e['shift']());}};_0x420f70(++_0x3ae893);}(_0x723b,0x11f));var _0xb723=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x723b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb723('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb723('0x1'));var moment=require(_0xb723('0x2'));var BPromise=require(_0xb723('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb723('0x4'));var rimraf=require(_0xb723('0x5'));var config=require('../../config/environment');var attributes=require(_0xb723('0x6'));module[_0xb723('0x7')]=function(_0x5ab71c,_0x529d38){return _0x5ab71c[_0xb723('0x8')](_0xb723('0x9'),attributes,{'tableName':_0xb723('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb5e=['../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','../../config/logger','moment','request-promise','rimraf'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xdb5e,0xac));var _0xedb5=function(_0x5c452f,_0x58e9e9){_0x5c452f=_0x5c452f-0x0;var _0x1937f5=_0xdb5e[_0x5c452f];return _0x1937f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xedb5('0x0'))('api');var moment=require(_0xedb5('0x1'));var BPromise=require('bluebird');var rp=require(_0xedb5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedb5('0x3'));var config=require(_0xedb5('0x4'));var attributes=require(_0xedb5('0x5'));module['exports']=function(_0x1fda7d,_0x181d69){return _0x1fda7d[_0xedb5('0x6')](_0xedb5('0x7'),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 a38c26d..bb014e9 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 _0xa28f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment'];(function(_0x3749e7,_0x4c531f){var _0x3d657=function(_0x2e10ec){while(--_0x2e10ec){_0x3749e7['push'](_0x3749e7['shift']());}};_0x3d657(++_0x4c531f);}(_0xa28f,0x1e2));var _0xfa28=function(_0x3deb59,_0x4cdcdf){_0x3deb59=_0x3deb59-0x0;var _0x440fd9=_0xa28f[_0x3deb59];return _0x440fd9;};'use strict';var _=require(_0xfa28('0x0'));var util=require('util');var moment=require(_0xfa28('0x1'));var BPromise=require(_0xfa28('0x2'));var rs=require(_0xfa28('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa28('0x4'))['db'];var utils=require(_0xfa28('0x5'));var logger=require(_0xfa28('0x6'))(_0xfa28('0x7'));var config=require(_0xfa28('0x8'));var jayson=require(_0xfa28('0x9'));var client=jayson['client'][_0xfa28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2907d0,_0x453947,_0xf31335){return new BPromise(function(_0x32cb81,_0x283f0d){return client[_0xfa28('0xb')](_0x2907d0,_0xf31335)[_0xfa28('0xc')](function(_0x485f93){logger[_0xfa28('0xd')](_0xfa28('0xe'),_0x453947,_0xfa28('0xf'));logger[_0xfa28('0x10')](_0xfa28('0x11'),_0x453947,_0xfa28('0xf'),JSON[_0xfa28('0x12')](_0x485f93));if(_0x485f93[_0xfa28('0x13')]){if(_0x485f93[_0xfa28('0x13')]['code']===0x1f4){logger[_0xfa28('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x453947,_0x485f93[_0xfa28('0x13')][_0xfa28('0x14')]);return _0x283f0d(_0x485f93[_0xfa28('0x13')][_0xfa28('0x14')]);}logger['error'](_0xfa28('0xe'),_0x453947,_0x485f93[_0xfa28('0x13')][_0xfa28('0x14')]);return _0x32cb81(_0x485f93[_0xfa28('0x13')]['message']);}else{logger[_0xfa28('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x453947,'request\x20sent');_0x32cb81(_0x485f93['result']['message']);}})[_0xfa28('0x15')](function(_0x7aa9e4){logger['error'](_0xfa28('0xe'),_0x453947,_0x7aa9e4);_0x283f0d(_0x7aa9e4);});});} \ No newline at end of file +var _0x5dc3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x5dc3,0xc0));var _0x35dc=function(_0x21cf80,_0x1fb0a1){_0x21cf80=_0x21cf80-0x0;var _0x5c6bed=_0x5dc3[_0x21cf80];return _0x5c6bed;};'use strict';var _=require(_0x35dc('0x0'));var util=require(_0x35dc('0x1'));var moment=require(_0x35dc('0x2'));var BPromise=require(_0x35dc('0x3'));var rs=require(_0x35dc('0x4'));var fs=require('fs');var Redis=require(_0x35dc('0x5'));var db=require(_0x35dc('0x6'))['db'];var utils=require(_0x35dc('0x7'));var logger=require(_0x35dc('0x8'))(_0x35dc('0x9'));var config=require(_0x35dc('0xa'));var jayson=require(_0x35dc('0xb'));var client=jayson[_0x35dc('0xc')][_0x35dc('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x470897,_0x189d55,_0x186a65){return new BPromise(function(_0x2a5bb3,_0xb178a7){return client[_0x35dc('0xe')](_0x470897,_0x186a65)['then'](function(_0x411331){logger[_0x35dc('0xf')](_0x35dc('0x10'),_0x189d55,'request\x20sent');logger[_0x35dc('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x189d55,_0x35dc('0x12'),JSON[_0x35dc('0x13')](_0x411331));if(_0x411331[_0x35dc('0x14')]){if(_0x411331[_0x35dc('0x14')][_0x35dc('0x15')]===0x1f4){logger[_0x35dc('0x14')](_0x35dc('0x10'),_0x189d55,_0x411331[_0x35dc('0x14')][_0x35dc('0x16')]);return _0xb178a7(_0x411331['error'][_0x35dc('0x16')]);}logger[_0x35dc('0x14')](_0x35dc('0x10'),_0x189d55,_0x411331['error'][_0x35dc('0x16')]);return _0x2a5bb3(_0x411331[_0x35dc('0x14')][_0x35dc('0x16')]);}else{logger[_0x35dc('0xf')](_0x35dc('0x10'),_0x189d55,_0x35dc('0x12'));_0x2a5bb3(_0x411331['result'][_0x35dc('0x16')]);}})[_0x35dc('0x17')](function(_0x1700ba){logger['error'](_0x35dc('0x10'),_0x189d55,_0x1700ba);_0xb178a7(_0x1700ba);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e4e39f8..6037db1 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 _0x8c34=['create','put','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x3715ca,_0x55ebfc){var _0x2b26ad=function(_0x7bef89){while(--_0x7bef89){_0x3715ca['push'](_0x3715ca['shift']());}};_0x2b26ad(++_0x55ebfc);}(_0x8c34,0xd7));var _0x48c3=function(_0x1b90c2,_0x44dc36){_0x1b90c2=_0x1b90c2-0x0;var _0x2c44cf=_0x8c34[_0x1b90c2];return _0x2c44cf;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x48c3('0x0'));var express=require('express');var router=express[_0x48c3('0x1')]();var fs_extra=require(_0x48c3('0x2'));var auth=require(_0x48c3('0x3'));var interaction=require(_0x48c3('0x4'));var config=require(_0x48c3('0x5'));var controller=require(_0x48c3('0x6'));router[_0x48c3('0x7')]('/',auth[_0x48c3('0x8')](),controller[_0x48c3('0x9')]);router[_0x48c3('0x7')](_0x48c3('0xa'),auth[_0x48c3('0x8')](),controller[_0x48c3('0xb')]);router[_0x48c3('0xc')]('/',auth[_0x48c3('0x8')](),controller[_0x48c3('0xd')]);router[_0x48c3('0xe')](_0x48c3('0xa'),auth[_0x48c3('0x8')](),controller[_0x48c3('0xf')]);router[_0x48c3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x48c3('0x11')]);module[_0x48c3('0x12')]=router; \ No newline at end of file +var _0xcffa=['/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get'];(function(_0x9df58d,_0x89f500){var _0x4aca72=function(_0x327a59){while(--_0x327a59){_0x9df58d['push'](_0x9df58d['shift']());}};_0x4aca72(++_0x89f500);}(_0xcffa,0x117));var _0xacff=function(_0x501d96,_0x1579a5){_0x501d96=_0x501d96-0x0;var _0x5edb51=_0xcffa[_0x501d96];return _0x5edb51;};'use strict';var multer=require(_0xacff('0x0'));var util=require(_0xacff('0x1'));var path=require(_0xacff('0x2'));var timeout=require(_0xacff('0x3'));var express=require(_0xacff('0x4'));var router=express['Router']();var fs_extra=require(_0xacff('0x5'));var auth=require(_0xacff('0x6'));var interaction=require(_0xacff('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xacff('0x8')](),controller['index']);router[_0xacff('0x9')](_0xacff('0xa'),auth[_0xacff('0x8')](),controller[_0xacff('0xb')]);router[_0xacff('0xc')]('/',auth[_0xacff('0x8')](),controller[_0xacff('0xd')]);router['put'](_0xacff('0xa'),auth[_0xacff('0x8')](),controller[_0xacff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xacff('0xf')]);module[_0xacff('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 685254f..f85cd94 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 _0xa885=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','STRING','string'];(function(_0x21a2ff,_0x2e4620){var _0x556287=function(_0x3a7bbb){while(--_0x3a7bbb){_0x21a2ff['push'](_0x21a2ff['shift']());}};_0x556287(++_0x2e4620);}(_0xa885,0x169));var _0x5a88=function(_0xea6e86,_0x4f7e34){_0xea6e86=_0xea6e86-0x0;var _0x599fd3=_0xa885[_0xea6e86];return _0x599fd3;};'use strict';var Sequelize=require(_0x5a88('0x0'));module['exports']={'type':{'type':Sequelize[_0x5a88('0x1')]('string',_0x5a88('0x2'),_0x5a88('0x3'),_0x5a88('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5a88('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5a88('0x1')](_0x5a88('0x6'),_0x5a88('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x5a88('0x5')]},'idField':{'type':Sequelize[_0x5a88('0x5')]},'nameField':{'type':Sequelize[_0x5a88('0x5')]},'customField':{'type':Sequelize[_0x5a88('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a88('0x5')]}}; \ No newline at end of file +var _0x18be=['keyValue','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x300bfa,_0x5ec0c7){var _0x255b35=function(_0x37040e){while(--_0x37040e){_0x300bfa['push'](_0x300bfa['shift']());}};_0x255b35(++_0x5ec0c7);}(_0x18be,0x1a3));var _0xe18b=function(_0x4b34be,_0x29dd22){_0x4b34be=_0x4b34be-0x0;var _0x28d88e=_0x18be[_0x4b34be];return _0x28d88e;};'use strict';var Sequelize=require(_0xe18b('0x0'));module[_0xe18b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe18b('0x2'),_0xe18b('0x3'),_0xe18b('0x4'),_0xe18b('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe18b('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe18b('0x7')]('string',_0xe18b('0x3'),_0xe18b('0x4'))},'keyContent':{'type':Sequelize[_0xe18b('0x6')]},'idField':{'type':Sequelize[_0xe18b('0x6')]},'nameField':{'type':Sequelize[_0xe18b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e1553cc..e2d2216 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 _0x6b20=['../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','update','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x370c76,_0x291413){var _0x42c823=function(_0x2948a4){while(--_0x2948a4){_0x370c76['push'](_0x370c76['shift']());}};_0x42c823(++_0x291413);}(_0x6b20,0xd1));var _0x06b2=function(_0x3f85ca,_0x5b6ab1){_0x3f85ca=_0x3f85ca-0x0;var _0x45242b=_0x6b20[_0x3f85ca];return _0x45242b;};'use strict';var emlformat=require(_0x06b2('0x0'));var rimraf=require(_0x06b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b2('0x2'));var rp=require('request-promise');var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var Mustache=require(_0x06b2('0x5'));var util=require('util');var path=require(_0x06b2('0x6'));var sox=require(_0x06b2('0x7'));var csv=require(_0x06b2('0x8'));var ejs=require(_0x06b2('0x9'));var fs=require('fs');var fs_extra=require(_0x06b2('0xa'));var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x8'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var licenseUtil=require(_0x06b2('0x15'));var db=require(_0x06b2('0x16'))['db'];function respondWithStatusCode(_0x44a9b4,_0x810a12){_0x810a12=_0x810a12||0xcc;return function(_0x3039c9){if(_0x3039c9){return _0x44a9b4[_0x06b2('0x17')](_0x810a12);}return _0x44a9b4[_0x06b2('0x18')](_0x810a12)[_0x06b2('0x19')]();};}function respondWithResult(_0xa81f11,_0x2822e9){_0x2822e9=_0x2822e9||0xc8;return function(_0x26faee){if(_0x26faee){return _0xa81f11['status'](_0x2822e9)[_0x06b2('0x1a')](_0x26faee);}};}function respondWithFilteredResult(_0xaee98c,_0x47496c){return function(_0x3830e9){if(_0x3830e9){var _0xef0466=typeof _0x47496c[_0x06b2('0x1b')]==='undefined'&&typeof _0x47496c[_0x06b2('0x1c')]===_0x06b2('0x1d');var _0x525945=_0x3830e9[_0x06b2('0x1e')];var _0x594b48=_0xef0466?0x0:_0x47496c['offset'];var _0x192270=_0xef0466?_0x3830e9[_0x06b2('0x1e')]:_0x47496c[_0x06b2('0x1b')]+_0x47496c[_0x06b2('0x1c')];var _0x4c4e21;if(_0x192270>=_0x525945){_0x192270=_0x525945;_0x4c4e21=0xc8;}else{_0x4c4e21=0xce;}_0xaee98c[_0x06b2('0x18')](_0x4c4e21);return _0xaee98c[_0x06b2('0x1f')](_0x06b2('0x20'),_0x594b48+'-'+_0x192270+'/'+_0x525945)[_0x06b2('0x1a')](_0x3830e9);}return null;};}function patchUpdates(_0xe28985){return function(_0x368ad8){try{jsonpatch[_0x06b2('0x21')](_0x368ad8,_0xe28985,!![]);}catch(_0x5ca622){return BPromise[_0x06b2('0x22')](_0x5ca622);}return _0x368ad8[_0x06b2('0x23')]();};}function saveUpdates(_0xb05f65,_0x208384){return function(_0x4e2a4c){if(_0x4e2a4c){return _0x4e2a4c['update'](_0xb05f65)[_0x06b2('0x24')](function(_0xb5231e){return _0xb5231e;});}return null;};}function removeEntity(_0x4fc95f,_0x39659f){return function(_0x5e40f2){if(_0x5e40f2){return _0x5e40f2[_0x06b2('0x25')]()[_0x06b2('0x24')](function(){_0x4fc95f[_0x06b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4382ce,_0x306ce){return function(_0xc65820){if(!_0xc65820){_0x4382ce[_0x06b2('0x17')](0x194);}return _0xc65820;};}function handleError(_0x1173fc,_0x4f5e90){_0x4f5e90=_0x4f5e90||0x1f4;return function(_0xbb00ea){logger[_0x06b2('0x26')](_0xbb00ea[_0x06b2('0x27')]);if(_0xbb00ea[_0x06b2('0x28')]){delete _0xbb00ea[_0x06b2('0x28')];}_0x1173fc[_0x06b2('0x18')](_0x4f5e90)['send'](_0xbb00ea);};}exports[_0x06b2('0x29')]=function(_0x2a3228,_0x2720fa){var _0x13c0eb={},_0x1f02d8={},_0x1bfaa9={'count':0x0,'rows':[]};var _0x3668bb=_['map'](db[_0x06b2('0x2a')][_0x06b2('0x2b')],function(_0x1637c2){return{'name':_0x1637c2[_0x06b2('0x2c')],'type':_0x1637c2[_0x06b2('0x2d')][_0x06b2('0x2e')]};});_0x1f02d8[_0x06b2('0x2f')]=_[_0x06b2('0x30')](_0x3668bb,'name');_0x1f02d8[_0x06b2('0x31')]=_[_0x06b2('0x32')](_0x2a3228[_0x06b2('0x31')]);_0x1f02d8[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x1f02d8[_0x06b2('0x2f')],_0x1f02d8[_0x06b2('0x31')]);_0x13c0eb['attributes']=_['intersection'](_0x1f02d8[_0x06b2('0x2f')],qs[_0x06b2('0x35')](_0x2a3228[_0x06b2('0x31')]['fields']));_0x13c0eb[_0x06b2('0x36')]=_0x13c0eb[_0x06b2('0x36')][_0x06b2('0x37')]?_0x13c0eb[_0x06b2('0x36')]:_0x1f02d8[_0x06b2('0x2f')];if(!_0x2a3228[_0x06b2('0x31')]['hasOwnProperty'](_0x06b2('0x38'))){_0x13c0eb[_0x06b2('0x1c')]=qs[_0x06b2('0x1c')](_0x2a3228['query'][_0x06b2('0x1c')]);_0x13c0eb[_0x06b2('0x1b')]=qs['offset'](_0x2a3228[_0x06b2('0x31')][_0x06b2('0x1b')]);}_0x13c0eb[_0x06b2('0x39')]=qs[_0x06b2('0x3a')](_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3a')]);_0x13c0eb[_0x06b2('0x3b')]=qs[_0x06b2('0x33')](_[_0x06b2('0x3c')](_0x2a3228[_0x06b2('0x31')],_0x1f02d8[_0x06b2('0x33')]),_0x3668bb);if(_0x2a3228[_0x06b2('0x31')]['filter']){_0x13c0eb[_0x06b2('0x3b')]=_['merge'](_0x13c0eb['where'],{'$or':_[_0x06b2('0x30')](_0x3668bb,function(_0x4e92e0){if(_0x4e92e0[_0x06b2('0x2d')]!=='VIRTUAL'){var _0x35e29c={};_0x35e29c[_0x4e92e0[_0x06b2('0x28')]]={'$like':'%'+_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3d')]+'%'};return _0x35e29c;}})});}_0x13c0eb=_[_0x06b2('0x3e')]({},_0x13c0eb,_0x2a3228['options']);var _0x404eab={'where':_0x13c0eb[_0x06b2('0x3b')]};return db[_0x06b2('0x2a')][_0x06b2('0x1e')](_0x404eab)[_0x06b2('0x24')](function(_0x39fd60){_0x1bfaa9['count']=_0x39fd60;if(_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3f')]){_0x13c0eb['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x06b2('0x40')](_0x13c0eb);})[_0x06b2('0x24')](function(_0x286c9b){_0x1bfaa9[_0x06b2('0x41')]=_0x286c9b;return _0x1bfaa9;})[_0x06b2('0x24')](respondWithFilteredResult(_0x2720fa,_0x13c0eb))[_0x06b2('0x42')](handleError(_0x2720fa,null));};exports[_0x06b2('0x43')]=function(_0x2ff968,_0x2e2a80){var _0x117bf4={'raw':!![],'where':{'id':_0x2ff968[_0x06b2('0x44')]['id']}},_0x1d7750={};_0x1d7750[_0x06b2('0x2f')]=_[_0x06b2('0x32')](db[_0x06b2('0x2a')][_0x06b2('0x2b')]);_0x1d7750[_0x06b2('0x31')]=_[_0x06b2('0x32')](_0x2ff968[_0x06b2('0x31')]);_0x1d7750['filters']=_[_0x06b2('0x34')](_0x1d7750[_0x06b2('0x2f')],_0x1d7750[_0x06b2('0x31')]);_0x117bf4[_0x06b2('0x36')]=_['intersection'](_0x1d7750[_0x06b2('0x2f')],qs[_0x06b2('0x35')](_0x2ff968['query'][_0x06b2('0x35')]));_0x117bf4[_0x06b2('0x36')]=_0x117bf4['attributes'][_0x06b2('0x37')]?_0x117bf4[_0x06b2('0x36')]:_0x1d7750['model'];if(_0x2ff968['query']['includeAll']){_0x117bf4[_0x06b2('0x45')]=[{'all':!![]}];}_0x117bf4=_[_0x06b2('0x3e')]({},_0x117bf4,_0x2ff968[_0x06b2('0x46')]);return db[_0x06b2('0x2a')][_0x06b2('0x47')](_0x117bf4)['then'](handleEntityNotFound(_0x2e2a80,null))['then'](respondWithResult(_0x2e2a80,null))[_0x06b2('0x42')](handleError(_0x2e2a80,null));};exports[_0x06b2('0x48')]=function(_0x979759,_0x1f4d89){return db[_0x06b2('0x2a')][_0x06b2('0x48')](_0x979759['body'],{})[_0x06b2('0x24')](respondWithResult(_0x1f4d89,0xc9))[_0x06b2('0x42')](handleError(_0x1f4d89,null));};exports[_0x06b2('0x49')]=function(_0x33f72e,_0x146c5c){if(_0x33f72e[_0x06b2('0x4a')]['id']){delete _0x33f72e['body']['id'];}return db[_0x06b2('0x2a')][_0x06b2('0x47')]({'where':{'id':_0x33f72e[_0x06b2('0x44')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x146c5c,null))['then'](saveUpdates(_0x33f72e[_0x06b2('0x4a')],null))[_0x06b2('0x24')](respondWithResult(_0x146c5c,null))[_0x06b2('0x42')](handleError(_0x146c5c,null));};exports[_0x06b2('0x25')]=function(_0x546c9e,_0x346f04){return db[_0x06b2('0x2a')][_0x06b2('0x47')]({'where':{'id':_0x546c9e[_0x06b2('0x44')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x346f04,null))[_0x06b2('0x24')](removeEntity(_0x346f04,null))[_0x06b2('0x42')](handleError(_0x346f04,null));}; \ No newline at end of file +var _0x97c1=['params','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FreshdeskField','includeAll','include','rows','catch'];(function(_0x443242,_0x4d9878){var _0x2c7479=function(_0xa1a7b6){while(--_0xa1a7b6){_0x443242['push'](_0x443242['shift']());}};_0x2c7479(++_0x4d9878);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x2911dd,_0x2b6319){return function(_0x499051){if(!_0x499051){_0x2911dd[_0x197c('0x26')](0x194);}return _0x499051;};}function handleError(_0x3331ac,_0x4c3337){_0x4c3337=_0x4c3337||0x1f4;return function(_0x5e7bc9){logger[_0x197c('0x27')](_0x5e7bc9['stack']);if(_0x5e7bc9[_0x197c('0x28')]){delete _0x5e7bc9[_0x197c('0x28')];}_0x3331ac[_0x197c('0x17')](_0x4c3337)[_0x197c('0x29')](_0x5e7bc9);};}exports[_0x197c('0x2a')]=function(_0x3cdcd8,_0x2b6154){var _0x215df1={},_0x4422d1={},_0x5df39e={'count':0x0,'rows':[]};var _0x50dea3=_['map'](db['FreshdeskField'][_0x197c('0x2b')],function(_0x4c9256){return{'name':_0x4c9256[_0x197c('0x2c')],'type':_0x4c9256[_0x197c('0x2d')]['key']};});_0x4422d1[_0x197c('0x2e')]=_['map'](_0x50dea3,_0x197c('0x28'));_0x4422d1[_0x197c('0x2f')]=_[_0x197c('0x30')](_0x3cdcd8[_0x197c('0x2f')]);_0x4422d1[_0x197c('0x31')]=_[_0x197c('0x32')](_0x4422d1[_0x197c('0x2e')],_0x4422d1[_0x197c('0x2f')]);_0x215df1[_0x197c('0x33')]=_['intersection'](_0x4422d1['model'],qs[_0x197c('0x34')](_0x3cdcd8[_0x197c('0x2f')][_0x197c('0x34')]));_0x215df1[_0x197c('0x33')]=_0x215df1[_0x197c('0x33')][_0x197c('0x35')]?_0x215df1[_0x197c('0x33')]:_0x4422d1['model'];if(!_0x3cdcd8['query'][_0x197c('0x36')](_0x197c('0x37'))){_0x215df1['limit']=qs['limit'](_0x3cdcd8[_0x197c('0x2f')][_0x197c('0x1b')]);_0x215df1[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x3cdcd8[_0x197c('0x2f')][_0x197c('0x19')]);}_0x215df1[_0x197c('0x38')]=qs[_0x197c('0x39')](_0x3cdcd8[_0x197c('0x2f')]['sort']);_0x215df1[_0x197c('0x3a')]=qs[_0x197c('0x31')](_[_0x197c('0x3b')](_0x3cdcd8[_0x197c('0x2f')],_0x4422d1[_0x197c('0x31')]),_0x50dea3);if(_0x3cdcd8[_0x197c('0x2f')]['filter']){_0x215df1[_0x197c('0x3a')]=_[_0x197c('0x3c')](_0x215df1[_0x197c('0x3a')],{'$or':_['map'](_0x50dea3,function(_0x28ce19){if(_0x28ce19[_0x197c('0x2d')]!==_0x197c('0x3d')){var _0xdb64da={};_0xdb64da[_0x28ce19[_0x197c('0x28')]]={'$like':'%'+_0x3cdcd8[_0x197c('0x2f')][_0x197c('0x3e')]+'%'};return _0xdb64da;}})});}_0x215df1=_[_0x197c('0x3c')]({},_0x215df1,_0x3cdcd8[_0x197c('0x3f')]);var _0x1dc01b={'where':_0x215df1['where']};return db[_0x197c('0x40')][_0x197c('0x1c')](_0x1dc01b)['then'](function(_0x4c715a){_0x5df39e[_0x197c('0x1c')]=_0x4c715a;if(_0x3cdcd8[_0x197c('0x2f')][_0x197c('0x41')]){_0x215df1[_0x197c('0x42')]=[{'all':!![]}];}return db[_0x197c('0x40')]['findAll'](_0x215df1);})[_0x197c('0x24')](function(_0x3efae){_0x5df39e[_0x197c('0x43')]=_0x3efae;return _0x5df39e;})[_0x197c('0x24')](respondWithFilteredResult(_0x2b6154,_0x215df1))[_0x197c('0x44')](handleError(_0x2b6154,null));};exports['show']=function(_0x3e21bd,_0x37bb94){var _0x6d7bda={'raw':!![],'where':{'id':_0x3e21bd[_0x197c('0x45')]['id']}},_0x197b27={};_0x197b27['model']=_[_0x197c('0x30')](db[_0x197c('0x40')][_0x197c('0x2b')]);_0x197b27[_0x197c('0x2f')]=_[_0x197c('0x30')](_0x3e21bd[_0x197c('0x2f')]);_0x197b27[_0x197c('0x31')]=_[_0x197c('0x32')](_0x197b27[_0x197c('0x2e')],_0x197b27[_0x197c('0x2f')]);_0x6d7bda[_0x197c('0x33')]=_['intersection'](_0x197b27['model'],qs['fields'](_0x3e21bd['query'][_0x197c('0x34')]));_0x6d7bda[_0x197c('0x33')]=_0x6d7bda['attributes'][_0x197c('0x35')]?_0x6d7bda[_0x197c('0x33')]:_0x197b27['model'];if(_0x3e21bd[_0x197c('0x2f')][_0x197c('0x41')]){_0x6d7bda['include']=[{'all':!![]}];}_0x6d7bda=_[_0x197c('0x3c')]({},_0x6d7bda,_0x3e21bd[_0x197c('0x3f')]);return db['FreshdeskField'][_0x197c('0x46')](_0x6d7bda)[_0x197c('0x24')](handleEntityNotFound(_0x37bb94,null))[_0x197c('0x24')](respondWithResult(_0x37bb94,null))['catch'](handleError(_0x37bb94,null));};exports[_0x197c('0x47')]=function(_0x3f26df,_0x220909){return db[_0x197c('0x40')]['create'](_0x3f26df[_0x197c('0x48')],{})[_0x197c('0x24')](respondWithResult(_0x220909,0xc9))[_0x197c('0x44')](handleError(_0x220909,null));};exports['update']=function(_0x5994bf,_0x3a5089){if(_0x5994bf[_0x197c('0x48')]['id']){delete _0x5994bf[_0x197c('0x48')]['id'];}return db[_0x197c('0x40')][_0x197c('0x46')]({'where':{'id':_0x5994bf[_0x197c('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a5089,null))[_0x197c('0x24')](saveUpdates(_0x5994bf['body'],null))[_0x197c('0x24')](respondWithResult(_0x3a5089,null))[_0x197c('0x44')](handleError(_0x3a5089,null));};exports[_0x197c('0x25')]=function(_0x9e8c6a,_0x34a211){return db[_0x197c('0x40')][_0x197c('0x46')]({'where':{'id':_0x9e8c6a[_0x197c('0x45')]['id']}})['then'](handleEntityNotFound(_0x34a211,null))[_0x197c('0x24')](removeEntity(_0x34a211,null))[_0x197c('0x44')](handleError(_0x34a211,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 60756f6..8550315 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 _0x4f16=['util','../../config/logger','request-promise','path','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash'];(function(_0xc2d678,_0x89c9a0){var _0x3cde13=function(_0x3efd5f){while(--_0x3efd5f){_0xc2d678['push'](_0xc2d678['shift']());}};_0x3cde13(++_0x89c9a0);}(_0x4f16,0x11f));var _0x64f1=function(_0x379eaf,_0x4eb489){_0x379eaf=_0x379eaf-0x0;var _0x326f1f=_0x4f16[_0x379eaf];return _0x326f1f;};'use strict';var _=require(_0x64f1('0x0'));var util=require(_0x64f1('0x1'));var logger=require(_0x64f1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64f1('0x3'));var fs=require('fs');var path=require(_0x64f1('0x4'));var rimraf=require('rimraf');var config=require(_0x64f1('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0x64f1('0x6')]=function(_0x1ff13e,_0x464433){return _0x1ff13e[_0x64f1('0x7')](_0x64f1('0x8'),attributes,{'tableName':_0x64f1('0x9'),'paranoid':![],'indexes':[{'name':_0x64f1('0xa'),'fields':['idField',_0x64f1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf442=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0xf442,0xbc));var _0x2f44=function(_0x5387e4,_0x4e4c4a){_0x5387e4=_0x5387e4-0x0;var _0x5636b2=_0xf442[_0x5387e4];return _0x5636b2;};'use strict';var _=require(_0x2f44('0x0'));var util=require(_0x2f44('0x1'));var logger=require(_0x2f44('0x2'))('api');var moment=require(_0x2f44('0x3'));var BPromise=require(_0x2f44('0x4'));var rp=require(_0x2f44('0x5'));var fs=require('fs');var path=require(_0x2f44('0x6'));var rimraf=require(_0x2f44('0x7'));var config=require(_0x2f44('0x8'));var attributes=require(_0x2f44('0x9'));module[_0x2f44('0xa')]=function(_0x9a9a2e,_0x575878){return _0x9a9a2e[_0x2f44('0xb')]('FreshdeskField',attributes,{'tableName':_0x2f44('0xc'),'paranoid':![],'indexes':[{'name':_0x2f44('0xd'),'fields':[_0x2f44('0xe'),_0x2f44('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 7be465f..dc90c74 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 _0xabd6=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x5c0b2a,_0x3793f3){var _0x253f99=function(_0x101b72){while(--_0x101b72){_0x5c0b2a['push'](_0x5c0b2a['shift']());}};_0x253f99(++_0x3793f3);}(_0xabd6,0x1d0));var _0x6abd=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xabd6[_0x9729d7];return _0x3c4ac6;};'use strict';var _=require('lodash');var util=require(_0x6abd('0x0'));var moment=require('moment');var BPromise=require(_0x6abd('0x1'));var rs=require(_0x6abd('0x2'));var fs=require('fs');var Redis=require(_0x6abd('0x3'));var db=require(_0x6abd('0x4'))['db'];var utils=require(_0x6abd('0x5'));var logger=require(_0x6abd('0x6'))(_0x6abd('0x7'));var config=require(_0x6abd('0x8'));var jayson=require(_0x6abd('0x9'));var client=jayson[_0x6abd('0xa')][_0x6abd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38dab1,_0x1fcfed,_0x433fcf){return new BPromise(function(_0x1618b4,_0x40317b){return client[_0x6abd('0xc')](_0x38dab1,_0x433fcf)[_0x6abd('0xd')](function(_0x29b409){logger[_0x6abd('0xe')](_0x6abd('0xf'),_0x1fcfed,_0x6abd('0x10'));logger[_0x6abd('0x11')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x1fcfed,'request\x20sent',JSON['stringify'](_0x29b409));if(_0x29b409[_0x6abd('0x12')]){if(_0x29b409[_0x6abd('0x12')]['code']===0x1f4){logger[_0x6abd('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x1fcfed,_0x29b409[_0x6abd('0x12')]['message']);return _0x40317b(_0x29b409[_0x6abd('0x12')][_0x6abd('0x13')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x1fcfed,_0x29b409['error'][_0x6abd('0x13')]);return _0x1618b4(_0x29b409['error']['message']);}else{logger['info'](_0x6abd('0xf'),_0x1fcfed,'request\x20sent');_0x1618b4(_0x29b409[_0x6abd('0x14')][_0x6abd('0x13')]);}})[_0x6abd('0x15')](function(_0x369c76){logger[_0x6abd('0x12')](_0x6abd('0xf'),_0x1fcfed,_0x369c76);_0x40317b(_0x369c76);});});} \ No newline at end of file +var _0x880e=['info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x880e,0x7c));var _0xe880=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x880e[_0x10d0f0];return _0x93e308;};'use strict';var _=require(_0xe880('0x0'));var util=require(_0xe880('0x1'));var moment=require(_0xe880('0x2'));var BPromise=require(_0xe880('0x3'));var rs=require(_0xe880('0x4'));var fs=require('fs');var Redis=require(_0xe880('0x5'));var db=require(_0xe880('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe880('0x7'));var config=require(_0xe880('0x8'));var jayson=require(_0xe880('0x9'));var client=jayson[_0xe880('0xa')][_0xe880('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24ee82,_0x529ac3,_0x626757){return new BPromise(function(_0x11a392,_0x1abcfd){return client[_0xe880('0xc')](_0x24ee82,_0x626757)[_0xe880('0xd')](function(_0x1c03b4){logger[_0xe880('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x529ac3,_0xe880('0xf'));logger[_0xe880('0x10')](_0xe880('0x11'),_0x529ac3,'request\x20sent',JSON[_0xe880('0x12')](_0x1c03b4));if(_0x1c03b4[_0xe880('0x13')]){if(_0x1c03b4[_0xe880('0x13')][_0xe880('0x14')]===0x1f4){logger[_0xe880('0x13')](_0xe880('0x15'),_0x529ac3,_0x1c03b4[_0xe880('0x13')][_0xe880('0x16')]);return _0x1abcfd(_0x1c03b4[_0xe880('0x13')]['message']);}logger[_0xe880('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x529ac3,_0x1c03b4[_0xe880('0x13')]['message']);return _0x11a392(_0x1c03b4['error'][_0xe880('0x16')]);}else{logger['info'](_0xe880('0x15'),_0x529ac3,_0xe880('0xf'));_0x11a392(_0x1c03b4['result'][_0xe880('0x16')]);}})['catch'](function(_0x5c646e){logger[_0xe880('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x529ac3,_0x5c646e);_0x1abcfd(_0x5c646e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a8f3f0b..365e035 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 _0x76dc=['../../components/interaction/service','get','isAuthenticated','index','show','getConfigurations','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xe311be,_0x7167fd){var _0x380a2b=function(_0x396459){while(--_0x396459){_0xe311be['push'](_0xe311be['shift']());}};_0x380a2b(++_0x7167fd);}(_0x76dc,0x1f2));var _0xc76d=function(_0x105c05,_0x403bda){_0x105c05=_0x105c05-0x0;var _0x4deca7=_0x76dc[_0x105c05];return _0x4deca7;};'use strict';var multer=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var path=require(_0xc76d('0x2'));var timeout=require(_0xc76d('0x3'));var express=require('express');var router=express[_0xc76d('0x4')]();var fs_extra=require(_0xc76d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc76d('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xc76d('0x7')]('/',auth[_0xc76d('0x8')](),controller[_0xc76d('0x9')]);router['get']('/:id',auth[_0xc76d('0x8')](),controller[_0xc76d('0xa')]);router[_0xc76d('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xc76d('0xb')]);router[_0xc76d('0x7')]('/:id/fields',auth[_0xc76d('0x8')](),controller['getFields']);router[_0xc76d('0xc')]('/',auth[_0xc76d('0x8')](),controller[_0xc76d('0xd')]);router[_0xc76d('0xc')](_0xc76d('0xe'),auth[_0xc76d('0x8')](),controller[_0xc76d('0xf')]);router[_0xc76d('0x10')](_0xc76d('0x11'),auth[_0xc76d('0x8')](),controller[_0xc76d('0x12')]);router[_0xc76d('0x13')](_0xc76d('0x11'),auth[_0xc76d('0x8')](),controller['destroy']);module[_0xc76d('0x14')]=router; \ No newline at end of file +var _0xf4eb=['getFields','create','put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x181f79,_0x1c53aa){var _0x3d3170=function(_0x416053){while(--_0x416053){_0x181f79['push'](_0x181f79['shift']());}};_0x3d3170(++_0x1c53aa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3e15d9,_0x3af94d){_0x3e15d9=_0x3e15d9-0x0;var _0x2cc890=_0xf4eb[_0x3e15d9];return _0x2cc890;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xc')]);router['post'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['addConfiguration']);router[_0xbf4e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);module[_0xbf4e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c2dcea2..3cbce20 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 _0x065e=['sequelize','STRING','username'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0x065e,0x1a7));var _0xe065=function(_0x20374d,_0x58df4f){_0x20374d=_0x20374d-0x0;var _0x4d5eab=_0x065e[_0x20374d];return _0x4d5eab;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe065('0x1')],'unique':_0xe065('0x2')},'apiKey':{'type':Sequelize[_0xe065('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x47c5=['username','remoteUri','sequelize','exports','STRING'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0x47c5,0x165));var _0x547c=function(_0x5823a7,_0x3cc2d7){_0x5823a7=_0x5823a7-0x0;var _0x4f1d86=_0x47c5[_0x5823a7];return _0x4f1d86;};'use strict';var Sequelize=require(_0x547c('0x0'));module[_0x547c('0x1')]={'name':{'type':Sequelize[_0x547c('0x2')]},'description':{'type':Sequelize[_0x547c('0x2')]},'username':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f30c4e0..102882c 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 _0xe141=['Descriptions','getFields','username','apiKey','remoteUri','slice','substring','format','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','Content-Range','apply','update','then','destroy','end','name','send','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','FreshsalesConfiguration','rawAttributes','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField'];(function(_0x16b148,_0x7ba829){var _0x552b68=function(_0x273d47){while(--_0x273d47){_0x16b148['push'](_0x16b148['shift']());}};_0x552b68(++_0x7ba829);}(_0xe141,0x193));var _0x1e14=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xe141[_0x126fb9];return _0xc8a3b1;};'use strict';var emlformat=require(_0x1e14('0x0'));var rimraf=require(_0x1e14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e14('0x2'));var rp=require(_0x1e14('0x3'));var moment=require(_0x1e14('0x4'));var BPromise=require(_0x1e14('0x5'));var Mustache=require(_0x1e14('0x6'));var util=require(_0x1e14('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1e14('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1e14('0x9'));var crypto=require(_0x1e14('0xa'));var jsforce=require(_0x1e14('0xb'));var deskjs=require(_0x1e14('0xc'));var toCsv=require(_0x1e14('0xd'));var querystring=require(_0x1e14('0xe'));var Papa=require(_0x1e14('0xf'));var Redis=require(_0x1e14('0x10'));var authService=require(_0x1e14('0x11'));var qs=require(_0x1e14('0x12'));var as=require(_0x1e14('0x13'));var hardwareService=require(_0x1e14('0x14'));var logger=require(_0x1e14('0x15'))('api');var utils=require(_0x1e14('0x16'));var config=require(_0x1e14('0x17'));var licenseUtil=require(_0x1e14('0x18'));var db=require(_0x1e14('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x510cbe,_0x302fc3){_0x302fc3=_0x302fc3||0xcc;return function(_0xc7d2c7){if(_0xc7d2c7){return _0x510cbe[_0x1e14('0x1a')](_0x302fc3);}return _0x510cbe[_0x1e14('0x1b')](_0x302fc3)['end']();};}function respondWithResult(_0x4cd643,_0x1ed697){_0x1ed697=_0x1ed697||0xc8;return function(_0x39922c){if(_0x39922c){return _0x4cd643[_0x1e14('0x1b')](_0x1ed697)[_0x1e14('0x1c')](_0x39922c);}};}function respondWithFilteredResult(_0x3ba88d,_0x1e23f4){return function(_0x4f9b10){if(_0x4f9b10){var _0x48cd68=typeof _0x1e23f4['offset']==='undefined'&&typeof _0x1e23f4[_0x1e14('0x1d')]===_0x1e14('0x1e');var _0x54234a=_0x4f9b10['count'];var _0x172439=_0x48cd68?0x0:_0x1e23f4[_0x1e14('0x1f')];var _0x220dca=_0x48cd68?_0x4f9b10[_0x1e14('0x20')]:_0x1e23f4[_0x1e14('0x1f')]+_0x1e23f4[_0x1e14('0x1d')];var _0x37bea2;if(_0x220dca>=_0x54234a){_0x220dca=_0x54234a;_0x37bea2=0xc8;}else{_0x37bea2=0xce;}_0x3ba88d['status'](_0x37bea2);return _0x3ba88d['set'](_0x1e14('0x21'),_0x172439+'-'+_0x220dca+'/'+_0x54234a)[_0x1e14('0x1c')](_0x4f9b10);}return null;};}function patchUpdates(_0x119c1f){return function(_0x4c5ea1){try{jsonpatch[_0x1e14('0x22')](_0x4c5ea1,_0x119c1f,!![]);}catch(_0x4bf0e0){return BPromise['reject'](_0x4bf0e0);}return _0x4c5ea1['save']();};}function saveUpdates(_0x55188e,_0x2758f0){return function(_0x213933){if(_0x213933){return _0x213933[_0x1e14('0x23')](_0x55188e)[_0x1e14('0x24')](function(_0x5d53b6){return _0x5d53b6;});}return null;};}function removeEntity(_0x9e39b0,_0x2eab55){return function(_0x7b77f){if(_0x7b77f){return _0x7b77f[_0x1e14('0x25')]()[_0x1e14('0x24')](function(){_0x9e39b0[_0x1e14('0x1b')](0xcc)[_0x1e14('0x26')]();});}};}function handleEntityNotFound(_0x1ea421,_0x51bb6d){return function(_0x2351b9){if(!_0x2351b9){_0x1ea421[_0x1e14('0x1a')](0x194);}return _0x2351b9;};}function handleError(_0x508cb7,_0x190471){_0x190471=_0x190471||0x1f4;return function(_0x3828eb){logger['error'](_0x3828eb['stack']);if(_0x3828eb[_0x1e14('0x27')]){delete _0x3828eb[_0x1e14('0x27')];}_0x508cb7[_0x1e14('0x1b')](_0x190471)[_0x1e14('0x28')](_0x3828eb);};}exports['index']=function(_0xc166de,_0x4cf733){var _0x591f3c={},_0x5b72b9={},_0x54e2e1={'count':0x0,'rows':[]};var _0x591a32=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x565728){return{'name':_0x565728['fieldName'],'type':_0x565728[_0x1e14('0x29')]['key']};});_0x5b72b9[_0x1e14('0x2a')]=_[_0x1e14('0x2b')](_0x591a32,_0x1e14('0x27'));_0x5b72b9['query']=_['keys'](_0xc166de['query']);_0x5b72b9[_0x1e14('0x2c')]=_[_0x1e14('0x2d')](_0x5b72b9[_0x1e14('0x2a')],_0x5b72b9[_0x1e14('0x2e')]);_0x591f3c[_0x1e14('0x2f')]=_[_0x1e14('0x2d')](_0x5b72b9['model'],qs[_0x1e14('0x30')](_0xc166de[_0x1e14('0x2e')]['fields']));_0x591f3c[_0x1e14('0x2f')]=_0x591f3c[_0x1e14('0x2f')][_0x1e14('0x31')]?_0x591f3c[_0x1e14('0x2f')]:_0x5b72b9[_0x1e14('0x2a')];if(!_0xc166de['query'][_0x1e14('0x32')](_0x1e14('0x33'))){_0x591f3c[_0x1e14('0x1d')]=qs[_0x1e14('0x1d')](_0xc166de[_0x1e14('0x2e')][_0x1e14('0x1d')]);_0x591f3c[_0x1e14('0x1f')]=qs[_0x1e14('0x1f')](_0xc166de['query']['offset']);}_0x591f3c['order']=qs[_0x1e14('0x34')](_0xc166de[_0x1e14('0x2e')][_0x1e14('0x34')]);_0x591f3c[_0x1e14('0x35')]=qs[_0x1e14('0x2c')](_[_0x1e14('0x36')](_0xc166de[_0x1e14('0x2e')],_0x5b72b9[_0x1e14('0x2c')]),_0x591a32);if(_0xc166de[_0x1e14('0x2e')][_0x1e14('0x37')]){_0x591f3c[_0x1e14('0x35')]=_[_0x1e14('0x38')](_0x591f3c[_0x1e14('0x35')],{'$or':_['map'](_0x591a32,function(_0x19e249){if(_0x19e249[_0x1e14('0x29')]!==_0x1e14('0x39')){var _0xdf8750={};_0xdf8750[_0x19e249[_0x1e14('0x27')]]={'$like':'%'+_0xc166de[_0x1e14('0x2e')][_0x1e14('0x37')]+'%'};return _0xdf8750;}})});}_0x591f3c=_[_0x1e14('0x38')]({},_0x591f3c,_0xc166de[_0x1e14('0x3a')]);var _0x5b90d8={'where':_0x591f3c[_0x1e14('0x35')]};return db[_0x1e14('0x3b')][_0x1e14('0x20')](_0x5b90d8)['then'](function(_0x501c0f){_0x54e2e1[_0x1e14('0x20')]=_0x501c0f;if(_0xc166de[_0x1e14('0x2e')][_0x1e14('0x3c')]){_0x591f3c[_0x1e14('0x3d')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x1e14('0x3e')](_0x591f3c);})[_0x1e14('0x24')](function(_0x59894e){_0x54e2e1[_0x1e14('0x3f')]=_0x59894e;return _0x54e2e1;})[_0x1e14('0x24')](respondWithFilteredResult(_0x4cf733,_0x591f3c))[_0x1e14('0x40')](handleError(_0x4cf733,null));};exports[_0x1e14('0x41')]=function(_0x508aab,_0x5482e8){var _0x1fb7e3={'raw':![],'where':{'id':_0x508aab[_0x1e14('0x42')]['id']}},_0xae4a63={};_0xae4a63[_0x1e14('0x2a')]=_[_0x1e14('0x43')](db[_0x1e14('0x3b')]['rawAttributes']);_0xae4a63[_0x1e14('0x2e')]=_[_0x1e14('0x43')](_0x508aab[_0x1e14('0x2e')]);_0xae4a63['filters']=_[_0x1e14('0x2d')](_0xae4a63[_0x1e14('0x2a')],_0xae4a63[_0x1e14('0x2e')]);_0x1fb7e3['attributes']=_[_0x1e14('0x2d')](_0xae4a63[_0x1e14('0x2a')],qs['fields'](_0x508aab['query'][_0x1e14('0x30')]));_0x1fb7e3[_0x1e14('0x2f')]=_0x1fb7e3[_0x1e14('0x2f')][_0x1e14('0x31')]?_0x1fb7e3[_0x1e14('0x2f')]:_0xae4a63[_0x1e14('0x2a')];if(_0x508aab[_0x1e14('0x2e')][_0x1e14('0x3c')]){_0x1fb7e3[_0x1e14('0x3d')]=[{'all':!![]}];}_0x1fb7e3=_['merge']({},_0x1fb7e3,_0x508aab['options']);return db[_0x1e14('0x3b')][_0x1e14('0x44')](_0x1fb7e3)[_0x1e14('0x24')](handleEntityNotFound(_0x5482e8,null))[_0x1e14('0x24')](respondWithResult(_0x5482e8,null))[_0x1e14('0x40')](handleError(_0x5482e8,null));};exports[_0x1e14('0x45')]=function(_0x5362ef,_0x14ca96){return db[_0x1e14('0x3b')][_0x1e14('0x45')](_0x5362ef['body'],{})[_0x1e14('0x24')](respondWithResult(_0x14ca96,0xc9))['catch'](handleError(_0x14ca96,null));};exports[_0x1e14('0x23')]=function(_0x11871d,_0x30f165){if(_0x11871d[_0x1e14('0x46')]['id']){delete _0x11871d[_0x1e14('0x46')]['id'];}return db['FreshsalesAccount'][_0x1e14('0x44')]({'where':{'id':_0x11871d[_0x1e14('0x42')]['id']}})['then'](handleEntityNotFound(_0x30f165,null))[_0x1e14('0x24')](saveUpdates(_0x11871d[_0x1e14('0x46')],null))[_0x1e14('0x24')](respondWithResult(_0x30f165,null))['catch'](handleError(_0x30f165,null));};exports[_0x1e14('0x25')]=function(_0x2efd0a,_0x1ef806){return db['FreshsalesAccount'][_0x1e14('0x44')]({'where':{'id':_0x2efd0a[_0x1e14('0x42')]['id']}})[_0x1e14('0x24')](handleEntityNotFound(_0x1ef806,null))['then'](removeEntity(_0x1ef806,null))[_0x1e14('0x40')](handleError(_0x1ef806,null));};exports['getConfigurations']=function(_0x105589,_0x598fe4,_0x305893){var _0x5925ff={};var _0x296f2f={};var _0x5cfc92;var _0x424dcc;return db[_0x1e14('0x3b')][_0x1e14('0x47')]({'where':{'id':_0x105589[_0x1e14('0x42')]['id']}})[_0x1e14('0x24')](handleEntityNotFound(_0x598fe4,null))['then'](function(_0x44166c){if(_0x44166c){_0x5cfc92=_0x44166c;_0x296f2f[_0x1e14('0x2a')]=_[_0x1e14('0x43')](db[_0x1e14('0x48')][_0x1e14('0x49')]);_0x296f2f['query']=_[_0x1e14('0x43')](_0x105589['query']);_0x296f2f[_0x1e14('0x2c')]=_[_0x1e14('0x2d')](_0x296f2f['model'],_0x296f2f[_0x1e14('0x2e')]);_0x5925ff[_0x1e14('0x2f')]=_[_0x1e14('0x2d')](_0x296f2f[_0x1e14('0x2a')],qs[_0x1e14('0x30')](_0x105589[_0x1e14('0x2e')][_0x1e14('0x30')]));_0x5925ff[_0x1e14('0x2f')]=_0x5925ff[_0x1e14('0x2f')][_0x1e14('0x31')]?_0x5925ff[_0x1e14('0x2f')]:_0x296f2f['model'];_0x5925ff['order']=qs['sort'](_0x105589['query'][_0x1e14('0x34')]);_0x5925ff['where']=qs[_0x1e14('0x2c')](_[_0x1e14('0x36')](_0x105589[_0x1e14('0x2e')],_0x296f2f['filters']));if(_0x105589[_0x1e14('0x2e')][_0x1e14('0x37')]){_0x5925ff[_0x1e14('0x35')]=_[_0x1e14('0x38')](_0x5925ff['where'],{'$or':_[_0x1e14('0x2b')](_0x5925ff[_0x1e14('0x2f')],function(_0x27c9be){var _0x1df759={};_0x1df759[_0x27c9be]={'$like':'%'+_0x105589[_0x1e14('0x2e')][_0x1e14('0x37')]+'%'};return _0x1df759;})});}_0x5925ff=_['merge']({},_0x5925ff,_0x105589[_0x1e14('0x3a')]);return _0x5cfc92[_0x1e14('0x4a')](_0x5925ff);}})[_0x1e14('0x24')](function(_0x38f219){if(_0x38f219){_0x424dcc=_0x38f219[_0x1e14('0x31')];if(!_0x105589[_0x1e14('0x2e')][_0x1e14('0x32')](_0x1e14('0x33'))){_0x5925ff[_0x1e14('0x1d')]=qs[_0x1e14('0x1d')](_0x105589[_0x1e14('0x2e')][_0x1e14('0x1d')]);_0x5925ff[_0x1e14('0x1f')]=qs[_0x1e14('0x1f')](_0x105589[_0x1e14('0x2e')][_0x1e14('0x1f')]);}return _0x5cfc92[_0x1e14('0x4a')](_0x5925ff);}})['then'](function(_0x5a39b1){if(_0x5a39b1){return _0x5a39b1?{'count':_0x424dcc,'rows':_0x5a39b1}:null;}})[_0x1e14('0x24')](respondWithResult(_0x598fe4,null))['catch'](handleError(_0x598fe4,null));};exports[_0x1e14('0x4b')]=function(_0x55171b,_0x3c6ee4,_0x1222cd){if(_0x55171b[_0x1e14('0x46')]['id']){delete _0x55171b['body']['id'];}return db[_0x1e14('0x3b')]['findOne']({'where':{'id':_0x55171b[_0x1e14('0x42')]['id']}})[_0x1e14('0x24')](handleEntityNotFound(_0x3c6ee4,null))[_0x1e14('0x24')](function(_0x1f9e6e){if(_0x1f9e6e){_0x55171b['body'][_0x1e14('0x4c')]=_0x1f9e6e['id'];_0x55171b[_0x1e14('0x46')][_0x1e14('0x4d')]=integrations[_0x1e14('0x4e')](_0x55171b['body'][_0x1e14('0x4f')],_0x55171b[_0x1e14('0x46')][_0x1e14('0x29')]);_0x55171b[_0x1e14('0x46')]['Descriptions']=integrations[_0x1e14('0x50')](_0x55171b['body'][_0x1e14('0x4f')],_0x55171b[_0x1e14('0x46')]['type']);return db['FreshsalesConfiguration']['create'](_0x55171b[_0x1e14('0x46')],{'include':[{'model':db[_0x1e14('0x51')],'as':_0x1e14('0x4d')},{'model':db[_0x1e14('0x51')],'as':_0x1e14('0x52')}]});}return null;})[_0x1e14('0x24')](respondWithResult(_0x3c6ee4,null))[_0x1e14('0x40')](handleError(_0x3c6ee4,null));};exports[_0x1e14('0x53')]=function(_0x4ffbfe,_0x6e625b,_0x488b70){var _0x58c6d4='';var _0x1b997a='';return db['FreshsalesAccount'][_0x1e14('0x47')]({'where':{'id':_0x4ffbfe[_0x1e14('0x42')]['id']},'attributes':['id',_0x1e14('0x54'),'remoteUri',_0x1e14('0x55')]})['then'](handleEntityNotFound(_0x6e625b,null))[_0x1e14('0x24')](function(_0x5a277e){if(_0x5a277e){_0x1b997a=_0x5a277e['username'];_0x58c6d4=_0x5a277e['remoteUri'];var _0x231511=_0x5a277e[_0x1e14('0x56')][_0x1e14('0x57')](-0x1);if(_0x231511==='/'){_0x58c6d4=_0x58c6d4[_0x1e14('0x58')](0x0,_0x58c6d4['lastIndexOf'](_0x231511));}return rp({'method':'GET','uri':util[_0x1e14('0x59')]('%s%s',_0x58c6d4,_0x1e14('0x5a')),'headers':{'Authorization':_0x1e14('0x5b')+_0x5a277e[_0x1e14('0x55')]},'json':!![]});}})[_0x1e14('0x24')](function(_0x1a916b){if(_0x1a916b){var _0x59a56d=_0x1a916b[_0x1e14('0x5c')];var _0x731513=![];var _0x32745a=null;for(_0x32745a=0x0;_0x32745a<_0x59a56d[_0x1e14('0x31')];_0x32745a++){if(_0x59a56d[_0x32745a]['email']===_0x1b997a){_0x731513=!![];}}if(_0x731513){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1e14('0x5d')});}}})[_0x1e14('0x24')](respondWithResult(_0x6e625b,null))[_0x1e14('0x40')](function(_0x58c5b2){var _0xcef856=_0x4ffbfe[_0x1e14('0x2e')]['test']?0x1f4:_0x58c5b2[_0x1e14('0x5e')]||0x1f4;logger[_0x1e14('0x5f')](_0x1e14('0x60'),_0x1e14('0x53'),_0xcef856,JSON['stringify'](_0x58c5b2));delete _0x58c5b2[_0x1e14('0x27')];if(_0xcef856===0x191){_0xcef856=0x190;}_0x6e625b[_0x1e14('0x1b')](_0xcef856)[_0x1e14('0x28')](_0x4ffbfe['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x58c5b2['statusCode']}:_0x58c5b2);});}; \ No newline at end of file +var _0x2c49=['getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','GET','format','/api/selector/owners','users','email','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','zip-dir','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','FreshsalesAccount','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','findOne','order'];(function(_0x5e7ea5,_0x963331){var _0x7f2a7b=function(_0x1a672c){while(--_0x1a672c){_0x5e7ea5['push'](_0x5e7ea5['shift']());}};_0x7f2a7b(++_0x963331);}(_0x2c49,0x141));var _0x92c4=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x2c49[_0x2b737c];return _0x466ed5;};'use strict';var emlformat=require(_0x92c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x92c4('0x2'));var Mustache=require(_0x92c4('0x3'));var util=require('util');var path=require(_0x92c4('0x4'));var sox=require(_0x92c4('0x5'));var csv=require('to-csv');var ejs=require(_0x92c4('0x6'));var fs=require('fs');var fs_extra=require(_0x92c4('0x7'));var _=require(_0x92c4('0x8'));var squel=require(_0x92c4('0x9'));var crypto=require(_0x92c4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x92c4('0xb'));var toCsv=require(_0x92c4('0xc'));var querystring=require(_0x92c4('0xd'));var Papa=require(_0x92c4('0xe'));var Redis=require(_0x92c4('0xf'));var authService=require(_0x92c4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x92c4('0x11'));var hardwareService=require(_0x92c4('0x12'));var logger=require(_0x92c4('0x13'))('api');var utils=require(_0x92c4('0x14'));var config=require(_0x92c4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x92c4('0x16'))['db'];var integrations=require(_0x92c4('0x17'));function respondWithStatusCode(_0x10b2cd,_0x11dd68){_0x11dd68=_0x11dd68||0xcc;return function(_0x181dd4){if(_0x181dd4){return _0x10b2cd['sendStatus'](_0x11dd68);}return _0x10b2cd[_0x92c4('0x18')](_0x11dd68)['end']();};}function respondWithResult(_0x5b0679,_0x598723){_0x598723=_0x598723||0xc8;return function(_0x251579){if(_0x251579){return _0x5b0679[_0x92c4('0x18')](_0x598723)[_0x92c4('0x19')](_0x251579);}};}function respondWithFilteredResult(_0x29d26a,_0xe08f9a){return function(_0x5bd75f){if(_0x5bd75f){var _0x1d7c53=typeof _0xe08f9a[_0x92c4('0x1a')]===_0x92c4('0x1b')&&typeof _0xe08f9a[_0x92c4('0x1c')]==='undefined';var _0x14c22d=_0x5bd75f[_0x92c4('0x1d')];var _0x315a6f=_0x1d7c53?0x0:_0xe08f9a[_0x92c4('0x1a')];var _0x5b3de4=_0x1d7c53?_0x5bd75f[_0x92c4('0x1d')]:_0xe08f9a['offset']+_0xe08f9a['limit'];var _0x3349ac;if(_0x5b3de4>=_0x14c22d){_0x5b3de4=_0x14c22d;_0x3349ac=0xc8;}else{_0x3349ac=0xce;}_0x29d26a[_0x92c4('0x18')](_0x3349ac);return _0x29d26a[_0x92c4('0x1e')](_0x92c4('0x1f'),_0x315a6f+'-'+_0x5b3de4+'/'+_0x14c22d)[_0x92c4('0x19')](_0x5bd75f);}return null;};}function patchUpdates(_0x42afec){return function(_0x55edda){try{jsonpatch[_0x92c4('0x20')](_0x55edda,_0x42afec,!![]);}catch(_0x46ea87){return BPromise[_0x92c4('0x21')](_0x46ea87);}return _0x55edda[_0x92c4('0x22')]();};}function saveUpdates(_0x532181,_0x1e3e8e){return function(_0x11def6){if(_0x11def6){return _0x11def6[_0x92c4('0x23')](_0x532181)[_0x92c4('0x24')](function(_0x109c8b){return _0x109c8b;});}return null;};}function removeEntity(_0x418299,_0x51bcaf){return function(_0x2eea6b){if(_0x2eea6b){return _0x2eea6b['destroy']()[_0x92c4('0x24')](function(){_0x418299[_0x92c4('0x18')](0xcc)[_0x92c4('0x25')]();});}};}function handleEntityNotFound(_0x392d6c,_0xd7c650){return function(_0x23037b){if(!_0x23037b){_0x392d6c['sendStatus'](0x194);}return _0x23037b;};}function handleError(_0xc1fa38,_0x2daee9){_0x2daee9=_0x2daee9||0x1f4;return function(_0x389a5a){logger[_0x92c4('0x26')](_0x389a5a[_0x92c4('0x27')]);if(_0x389a5a[_0x92c4('0x28')]){delete _0x389a5a[_0x92c4('0x28')];}_0xc1fa38[_0x92c4('0x18')](_0x2daee9)[_0x92c4('0x29')](_0x389a5a);};}exports[_0x92c4('0x2a')]=function(_0x41b21b,_0x258b7e){var _0x3d0e8c={},_0x2f0e4e={},_0x3a3b4c={'count':0x0,'rows':[]};var _0x2ce848=_['map'](db[_0x92c4('0x2b')]['rawAttributes'],function(_0xd8fa85){return{'name':_0xd8fa85['fieldName'],'type':_0xd8fa85[_0x92c4('0x2c')][_0x92c4('0x2d')]};});_0x2f0e4e['model']=_['map'](_0x2ce848,_0x92c4('0x28'));_0x2f0e4e['query']=_[_0x92c4('0x2e')](_0x41b21b[_0x92c4('0x2f')]);_0x2f0e4e['filters']=_[_0x92c4('0x30')](_0x2f0e4e['model'],_0x2f0e4e[_0x92c4('0x2f')]);_0x3d0e8c[_0x92c4('0x31')]=_['intersection'](_0x2f0e4e[_0x92c4('0x32')],qs[_0x92c4('0x33')](_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x33')]));_0x3d0e8c[_0x92c4('0x31')]=_0x3d0e8c['attributes'][_0x92c4('0x34')]?_0x3d0e8c[_0x92c4('0x31')]:_0x2f0e4e[_0x92c4('0x32')];if(!_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x35')]('nolimit')){_0x3d0e8c['limit']=qs[_0x92c4('0x1c')](_0x41b21b[_0x92c4('0x2f')]['limit']);_0x3d0e8c['offset']=qs[_0x92c4('0x1a')](_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x1a')]);}_0x3d0e8c['order']=qs[_0x92c4('0x36')](_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x36')]);_0x3d0e8c[_0x92c4('0x37')]=qs[_0x92c4('0x38')](_[_0x92c4('0x39')](_0x41b21b[_0x92c4('0x2f')],_0x2f0e4e['filters']),_0x2ce848);if(_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x3a')]){_0x3d0e8c['where']=_[_0x92c4('0x3b')](_0x3d0e8c[_0x92c4('0x37')],{'$or':_[_0x92c4('0x3c')](_0x2ce848,function(_0x1e6e3d){if(_0x1e6e3d[_0x92c4('0x2c')]!==_0x92c4('0x3d')){var _0x131a1e={};_0x131a1e[_0x1e6e3d[_0x92c4('0x28')]]={'$like':'%'+_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x3a')]+'%'};return _0x131a1e;}})});}_0x3d0e8c=_[_0x92c4('0x3b')]({},_0x3d0e8c,_0x41b21b[_0x92c4('0x3e')]);var _0x565a45={'where':_0x3d0e8c[_0x92c4('0x37')]};return db['FreshsalesAccount'][_0x92c4('0x1d')](_0x565a45)[_0x92c4('0x24')](function(_0x1619c8){_0x3a3b4c[_0x92c4('0x1d')]=_0x1619c8;if(_0x41b21b[_0x92c4('0x2f')][_0x92c4('0x3f')]){_0x3d0e8c[_0x92c4('0x40')]=[{'all':!![]}];}return db[_0x92c4('0x2b')]['findAll'](_0x3d0e8c);})[_0x92c4('0x24')](function(_0x14279f){_0x3a3b4c[_0x92c4('0x41')]=_0x14279f;return _0x3a3b4c;})['then'](respondWithFilteredResult(_0x258b7e,_0x3d0e8c))[_0x92c4('0x42')](handleError(_0x258b7e,null));};exports[_0x92c4('0x43')]=function(_0x34b329,_0x468b85){var _0x4b1aea={'raw':![],'where':{'id':_0x34b329[_0x92c4('0x44')]['id']}},_0x314974={};_0x314974[_0x92c4('0x32')]=_[_0x92c4('0x2e')](db['FreshsalesAccount'][_0x92c4('0x45')]);_0x314974['query']=_[_0x92c4('0x2e')](_0x34b329['query']);_0x314974[_0x92c4('0x38')]=_[_0x92c4('0x30')](_0x314974['model'],_0x314974[_0x92c4('0x2f')]);_0x4b1aea[_0x92c4('0x31')]=_[_0x92c4('0x30')](_0x314974[_0x92c4('0x32')],qs[_0x92c4('0x33')](_0x34b329[_0x92c4('0x2f')][_0x92c4('0x33')]));_0x4b1aea[_0x92c4('0x31')]=_0x4b1aea['attributes']['length']?_0x4b1aea['attributes']:_0x314974['model'];if(_0x34b329[_0x92c4('0x2f')][_0x92c4('0x3f')]){_0x4b1aea[_0x92c4('0x40')]=[{'all':!![]}];}_0x4b1aea=_[_0x92c4('0x3b')]({},_0x4b1aea,_0x34b329['options']);return db['FreshsalesAccount'][_0x92c4('0x46')](_0x4b1aea)[_0x92c4('0x24')](handleEntityNotFound(_0x468b85,null))[_0x92c4('0x24')](respondWithResult(_0x468b85,null))['catch'](handleError(_0x468b85,null));};exports[_0x92c4('0x47')]=function(_0x283616,_0x2684fe){return db[_0x92c4('0x2b')][_0x92c4('0x47')](_0x283616[_0x92c4('0x48')],{})[_0x92c4('0x24')](respondWithResult(_0x2684fe,0xc9))['catch'](handleError(_0x2684fe,null));};exports[_0x92c4('0x23')]=function(_0x54fd3c,_0x49cde5){if(_0x54fd3c[_0x92c4('0x48')]['id']){delete _0x54fd3c[_0x92c4('0x48')]['id'];}return db[_0x92c4('0x2b')]['find']({'where':{'id':_0x54fd3c[_0x92c4('0x44')]['id']}})[_0x92c4('0x24')](handleEntityNotFound(_0x49cde5,null))['then'](saveUpdates(_0x54fd3c[_0x92c4('0x48')],null))[_0x92c4('0x24')](respondWithResult(_0x49cde5,null))[_0x92c4('0x42')](handleError(_0x49cde5,null));};exports['destroy']=function(_0x367b30,_0x19d6bf){return db['FreshsalesAccount'][_0x92c4('0x46')]({'where':{'id':_0x367b30[_0x92c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x19d6bf,null))['then'](removeEntity(_0x19d6bf,null))[_0x92c4('0x42')](handleError(_0x19d6bf,null));};exports['getConfigurations']=function(_0x16c529,_0x4a55fd,_0x35ef50){var _0x2e33ac={};var _0x2d763a={};var _0x5adb1d;var _0x16e0a4;return db[_0x92c4('0x2b')][_0x92c4('0x49')]({'where':{'id':_0x16c529[_0x92c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a55fd,null))[_0x92c4('0x24')](function(_0x474993){if(_0x474993){_0x5adb1d=_0x474993;_0x2d763a['model']=_[_0x92c4('0x2e')](db['FreshsalesConfiguration'][_0x92c4('0x45')]);_0x2d763a['query']=_[_0x92c4('0x2e')](_0x16c529[_0x92c4('0x2f')]);_0x2d763a[_0x92c4('0x38')]=_['intersection'](_0x2d763a['model'],_0x2d763a['query']);_0x2e33ac[_0x92c4('0x31')]=_[_0x92c4('0x30')](_0x2d763a[_0x92c4('0x32')],qs[_0x92c4('0x33')](_0x16c529[_0x92c4('0x2f')][_0x92c4('0x33')]));_0x2e33ac['attributes']=_0x2e33ac[_0x92c4('0x31')][_0x92c4('0x34')]?_0x2e33ac[_0x92c4('0x31')]:_0x2d763a['model'];_0x2e33ac[_0x92c4('0x4a')]=qs[_0x92c4('0x36')](_0x16c529[_0x92c4('0x2f')][_0x92c4('0x36')]);_0x2e33ac[_0x92c4('0x37')]=qs[_0x92c4('0x38')](_[_0x92c4('0x39')](_0x16c529[_0x92c4('0x2f')],_0x2d763a[_0x92c4('0x38')]));if(_0x16c529['query']['filter']){_0x2e33ac['where']=_[_0x92c4('0x3b')](_0x2e33ac['where'],{'$or':_[_0x92c4('0x3c')](_0x2e33ac[_0x92c4('0x31')],function(_0x359e44){var _0x376729={};_0x376729[_0x359e44]={'$like':'%'+_0x16c529[_0x92c4('0x2f')][_0x92c4('0x3a')]+'%'};return _0x376729;})});}_0x2e33ac=_[_0x92c4('0x3b')]({},_0x2e33ac,_0x16c529[_0x92c4('0x3e')]);return _0x5adb1d[_0x92c4('0x4b')](_0x2e33ac);}})[_0x92c4('0x24')](function(_0x28e3b2){if(_0x28e3b2){_0x16e0a4=_0x28e3b2[_0x92c4('0x34')];if(!_0x16c529[_0x92c4('0x2f')][_0x92c4('0x35')](_0x92c4('0x4c'))){_0x2e33ac['limit']=qs['limit'](_0x16c529[_0x92c4('0x2f')]['limit']);_0x2e33ac[_0x92c4('0x1a')]=qs[_0x92c4('0x1a')](_0x16c529['query']['offset']);}return _0x5adb1d[_0x92c4('0x4b')](_0x2e33ac);}})['then'](function(_0x543c46){if(_0x543c46){return _0x543c46?{'count':_0x16e0a4,'rows':_0x543c46}:null;}})[_0x92c4('0x24')](respondWithResult(_0x4a55fd,null))[_0x92c4('0x42')](handleError(_0x4a55fd,null));};exports[_0x92c4('0x4d')]=function(_0x3958d9,_0x59fb09,_0x3afdae){if(_0x3958d9[_0x92c4('0x48')]['id']){delete _0x3958d9[_0x92c4('0x48')]['id'];}return db[_0x92c4('0x2b')]['findOne']({'where':{'id':_0x3958d9[_0x92c4('0x44')]['id']}})[_0x92c4('0x24')](handleEntityNotFound(_0x59fb09,null))['then'](function(_0x142dff){if(_0x142dff){_0x3958d9[_0x92c4('0x48')][_0x92c4('0x4e')]=_0x142dff['id'];_0x3958d9[_0x92c4('0x48')][_0x92c4('0x4f')]=integrations[_0x92c4('0x50')](_0x3958d9[_0x92c4('0x48')][_0x92c4('0x51')],_0x3958d9[_0x92c4('0x48')][_0x92c4('0x2c')]);_0x3958d9[_0x92c4('0x48')]['Descriptions']=integrations[_0x92c4('0x52')](_0x3958d9[_0x92c4('0x48')][_0x92c4('0x51')],_0x3958d9[_0x92c4('0x48')][_0x92c4('0x2c')]);return db[_0x92c4('0x53')][_0x92c4('0x47')](_0x3958d9['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x92c4('0x4f')},{'model':db['FreshsalesField'],'as':_0x92c4('0x54')}]});}return null;})[_0x92c4('0x24')](respondWithResult(_0x59fb09,null))[_0x92c4('0x42')](handleError(_0x59fb09,null));};exports[_0x92c4('0x55')]=function(_0x22c5ec,_0x2ee885,_0x38fefd){var _0x4a08ea='';var _0x2db12f='';return db[_0x92c4('0x2b')][_0x92c4('0x49')]({'where':{'id':_0x22c5ec[_0x92c4('0x44')]['id']},'attributes':['id',_0x92c4('0x56'),_0x92c4('0x57'),_0x92c4('0x58')]})['then'](handleEntityNotFound(_0x2ee885,null))[_0x92c4('0x24')](function(_0x117db4){if(_0x117db4){_0x2db12f=_0x117db4['username'];_0x4a08ea=_0x117db4[_0x92c4('0x57')];var _0x5485d7=_0x117db4[_0x92c4('0x57')][_0x92c4('0x59')](-0x1);if(_0x5485d7==='/'){_0x4a08ea=_0x4a08ea[_0x92c4('0x5a')](0x0,_0x4a08ea['lastIndexOf'](_0x5485d7));}return rp({'method':_0x92c4('0x5b'),'uri':util[_0x92c4('0x5c')]('%s%s',_0x4a08ea,_0x92c4('0x5d')),'headers':{'Authorization':'Token\x20token='+_0x117db4['apiKey']},'json':!![]});}})[_0x92c4('0x24')](function(_0x3fccaa){if(_0x3fccaa){var _0x48b0b2=_0x3fccaa[_0x92c4('0x5e')];var _0x3c52e2=![];var _0x43d367=null;for(_0x43d367=0x0;_0x43d367<_0x48b0b2['length'];_0x43d367++){if(_0x48b0b2[_0x43d367][_0x92c4('0x5f')]===_0x2db12f){_0x3c52e2=!![];}}if(_0x3c52e2){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x92c4('0x24')](respondWithResult(_0x2ee885,null))['catch'](function(_0x2f3c55){var _0x19dc52=_0x22c5ec[_0x92c4('0x2f')]['test']?0x1f4:_0x2f3c55['statusCode']||0x1f4;logger['error'](_0x92c4('0x60'),_0x92c4('0x55'),_0x19dc52,JSON[_0x92c4('0x61')](_0x2f3c55));delete _0x2f3c55[_0x92c4('0x28')];if(_0x19dc52===0x191){_0x19dc52=0x190;}_0x2ee885[_0x92c4('0x18')](_0x19dc52)[_0x92c4('0x29')](_0x22c5ec[_0x92c4('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2f3c55[_0x92c4('0x62')]}:_0x2f3c55);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6f3d09e..4b99b0f 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 _0xfb11=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x1f2370,_0x5939e5){var _0x59a20a=function(_0x5b34a0){while(--_0x5b34a0){_0x1f2370['push'](_0x1f2370['shift']());}};_0x59a20a(++_0x5939e5);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xfb11[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1fb1('0x7')]=function(_0x133727,_0x4c098d){return _0x133727[_0x1fb1('0x8')](_0x1fb1('0x9'),attributes,{'tableName':_0x1fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts','lodash'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x5496,0x175));var _0x6549=function(_0x43bc67,_0x4ed9c9){_0x43bc67=_0x43bc67-0x0;var _0x468f35=_0x5496[_0x43bc67];return _0x468f35;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index cdb0436..7b0a495 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 _0xc2c7=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','catch','find','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa29ebf,_0xc7b854){var _0xcb802b=function(_0x535b45){while(--_0x535b45){_0xa29ebf['push'](_0xa29ebf['shift']());}};_0xcb802b(++_0xc7b854);}(_0xc2c7,0x134));var _0x7c2c=function(_0xedb55f,_0x183227){_0xedb55f=_0xedb55f-0x0;var _0x300053=_0xc2c7[_0xedb55f];return _0x300053;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}exports[_0x7c2c('0x15')]=function(_0x14453f){var _0x2a9539=this;return new Promise(function(_0x17df4a,_0x26be0f){return db[_0x7c2c('0x16')][_0x7c2c('0x17')]({'raw':_0x14453f[_0x7c2c('0x18')]?_0x14453f[_0x7c2c('0x18')][_0x7c2c('0x19')]===undefined?!![]:![]:!![],'where':_0x14453f[_0x7c2c('0x18')]?_0x14453f['options'][_0x7c2c('0x1a')]||null:null,'attributes':_0x14453f['options']?_0x14453f['options'][_0x7c2c('0x1b')]||null:null,'limit':_0x14453f[_0x7c2c('0x18')]?_0x14453f[_0x7c2c('0x18')][_0x7c2c('0x1c')]||null:null,'include':_0x14453f[_0x7c2c('0x18')]?_0x14453f[_0x7c2c('0x18')][_0x7c2c('0x1d')]?_['map'](_0x14453f[_0x7c2c('0x18')]['include'],function(_0x302c93){return{'model':db[_0x302c93['model']],'as':_0x302c93['as'],'attributes':_0x302c93[_0x7c2c('0x1b')],'include':_0x302c93[_0x7c2c('0x1d')]?_[_0x7c2c('0x1e')](_0x302c93['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x1f')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1b')],'include':_0x4d6ec7[_0x7c2c('0x1d')]?_[_0x7c2c('0x1e')](_0x4d6ec7[_0x7c2c('0x1d')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x1f')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xc')](function(_0xf39941){logger[_0x7c2c('0x20')](_0x7c2c('0x15'),_0x14453f);logger[_0x7c2c('0xf')](_0x7c2c('0x15'),_0x14453f,JSON[_0x7c2c('0x11')](_0xf39941));_0x17df4a(_0xf39941);})[_0x7c2c('0x21')](function(_0xa040ff){logger['error'](_0x7c2c('0x15'),_0xa040ff[_0x7c2c('0x14')],_0x14453f);_0x26be0f(_0x2a9539[_0x7c2c('0x12')](0x1f4,_0xa040ff[_0x7c2c('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0xcb98ba){var _0x30dd1c=this;return new Promise(function(_0x4192c8,_0x1ef88b){return db[_0x7c2c('0x16')][_0x7c2c('0x22')]({'raw':_0xcb98ba[_0x7c2c('0x18')]?_0xcb98ba['options'][_0x7c2c('0x19')]===undefined?!![]:![]:!![],'where':_0xcb98ba[_0x7c2c('0x18')]?_0xcb98ba[_0x7c2c('0x18')][_0x7c2c('0x1a')]||null:null,'attributes':_0xcb98ba[_0x7c2c('0x18')]?_0xcb98ba['options']['attributes']||null:null,'include':_0xcb98ba[_0x7c2c('0x18')]?_0xcb98ba['options']['include']?_[_0x7c2c('0x1e')](_0xcb98ba[_0x7c2c('0x18')][_0x7c2c('0x1d')],function(_0x156c03){return{'model':db[_0x156c03['model']],'as':_0x156c03['as'],'attributes':_0x156c03[_0x7c2c('0x1b')],'include':_0x156c03[_0x7c2c('0x1d')]?_[_0x7c2c('0x1e')](_0x156c03[_0x7c2c('0x1d')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x1f')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1b')],'include':_0x204968[_0x7c2c('0x1d')]?_[_0x7c2c('0x1e')](_0x204968[_0x7c2c('0x1d')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x1f')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54cbb7){logger[_0x7c2c('0x20')]('ShowFreshsalesAccount',_0xcb98ba);logger['debug']('ShowFreshsalesAccount',_0xcb98ba,JSON[_0x7c2c('0x11')](_0x54cbb7));_0x4192c8(_0x54cbb7);})[_0x7c2c('0x21')](function(_0x129bf0){logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x129bf0[_0x7c2c('0x14')],_0xcb98ba);_0x1ef88b(_0x30dd1c[_0x7c2c('0x12')](0x1f4,_0x129bf0[_0x7c2c('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(_0x584dda,_0x546173){var _0x141b33=function(_0x448a8b){while(--_0x448a8b){_0x584dda['push'](_0x584dda['shift']());}};_0x141b33(++_0x546173);}(_0x4888,0x198));var _0x8488=function(_0x42ce25,_0x7f11aa){_0x42ce25=_0x42ce25-0x0;var _0x14b4cd=_0x4888[_0x42ce25];return _0x14b4cd;};'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 12247d8..d4f64d0 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 _0x5e68=['isAuthenticated','index','get','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x401bc5,_0x2bd123){var _0x59c2bc=function(_0x4eb61f){while(--_0x4eb61f){_0x401bc5['push'](_0x401bc5['shift']());}};_0x59c2bc(++_0x2bd123);}(_0x5e68,0x1c6));var _0x85e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5e68[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x85e6('0x0'));var path=require(_0x85e6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85e6('0x2')]();var fs_extra=require(_0x85e6('0x3'));var auth=require(_0x85e6('0x4'));var interaction=require(_0x85e6('0x5'));var config=require(_0x85e6('0x6'));var controller=require(_0x85e6('0x7'));router['get']('/',auth[_0x85e6('0x8')](),controller[_0x85e6('0x9')]);router[_0x85e6('0xa')](_0x85e6('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x85e6('0xc'),auth[_0x85e6('0x8')](),controller[_0x85e6('0xd')]);router[_0x85e6('0xa')](_0x85e6('0xe'),auth[_0x85e6('0x8')](),controller[_0x85e6('0xf')]);router[_0x85e6('0xa')]('/:id/fields',auth[_0x85e6('0x8')](),controller['getFields']);router[_0x85e6('0x10')]('/',auth[_0x85e6('0x8')](),controller[_0x85e6('0x11')]);router['put'](_0x85e6('0xb'),auth[_0x85e6('0x8')](),controller[_0x85e6('0x12')]);router[_0x85e6('0x13')](_0x85e6('0xb'),auth[_0x85e6('0x8')](),controller[_0x85e6('0x14')]);module[_0x85e6('0x15')]=router; \ No newline at end of file +var _0x2ccc=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2718ed,_0x432bcb){var _0x4b6bad=function(_0xd8029b){while(--_0xd8029b){_0x2718ed['push'](_0x2718ed['shift']());}};_0x4b6bad(++_0x432bcb);}(_0x2ccc,0xf8));var _0xc2cc=function(_0x3d4633,_0x5056a1){_0x3d4633=_0x3d4633-0x0;var _0x11ae61=_0x2ccc[_0x3d4633];return _0x11ae61;};'use strict';var multer=require(_0xc2cc('0x0'));var util=require('util');var path=require(_0xc2cc('0x1'));var timeout=require(_0xc2cc('0x2'));var express=require(_0xc2cc('0x3'));var router=express['Router']();var fs_extra=require(_0xc2cc('0x4'));var auth=require(_0xc2cc('0x5'));var interaction=require(_0xc2cc('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0xc2cc('0x7')]('/',auth[_0xc2cc('0x8')](),controller['index']);router[_0xc2cc('0x7')](_0xc2cc('0x9'),auth[_0xc2cc('0x8')](),controller[_0xc2cc('0xa')]);router[_0xc2cc('0x7')](_0xc2cc('0xb'),auth[_0xc2cc('0x8')](),controller[_0xc2cc('0xc')]);router[_0xc2cc('0x7')]('/:id/descriptions',auth[_0xc2cc('0x8')](),controller[_0xc2cc('0xd')]);router[_0xc2cc('0x7')](_0xc2cc('0xe'),auth[_0xc2cc('0x8')](),controller['getFields']);router[_0xc2cc('0xf')]('/',auth[_0xc2cc('0x8')](),controller['create']);router[_0xc2cc('0x10')](_0xc2cc('0x9'),auth[_0xc2cc('0x8')](),controller[_0xc2cc('0x11')]);router[_0xc2cc('0x12')](_0xc2cc('0x9'),auth[_0xc2cc('0x8')](),controller[_0xc2cc('0x13')]);module[_0xc2cc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 0db7f3d..121f164 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 _0xcb9e=['sequelize','exports','STRING'];(function(_0x452f1b,_0x3f6471){var _0x1c111d=function(_0x262f86){while(--_0x262f86){_0x452f1b['push'](_0x452f1b['shift']());}};_0x1c111d(++_0x3f6471);}(_0xcb9e,0x1cb));var _0xecb9=function(_0x2eff72,_0x19d73e){_0x2eff72=_0x2eff72-0x0;var _0x37c0fc=_0xcb9e[_0x2eff72];return _0x37c0fc;};'use strict';var Sequelize=require(_0xecb9('0x0'));module[_0xecb9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xecb9('0x2')]}}; \ No newline at end of file +var _0xd0ca=['sequelize','STRING'];(function(_0xb8d37c,_0x10a6a4){var _0x400f4b=function(_0x479ae1){while(--_0x479ae1){_0xb8d37c['push'](_0xb8d37c['shift']());}};_0x400f4b(++_0x10a6a4);}(_0xd0ca,0xbe));var _0xad0c=function(_0x116ae1,_0x19d44a){_0x116ae1=_0x116ae1-0x0;var _0x2de93c=_0xd0ca[_0x116ae1];return _0x2de93c;};'use strict';var Sequelize=require(_0xad0c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xad0c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 7866d80..e21f955 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 _0x281e=['fields','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','then','rows','show','params','length','find','catch','create','body','getSubjects','sort','hasOwnProperty','getDescriptions','findOne','FreshsalesField','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','type','key','model','keys','intersection','query','attributes'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x281e,0x70));var _0xe281=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x281e[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xe281('0x0'));var rimraf=require(_0xe281('0x1'));var zipdir=require(_0xe281('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe281('0x3'));var moment=require(_0xe281('0x4'));var BPromise=require(_0xe281('0x5'));var Mustache=require(_0xe281('0x6'));var util=require(_0xe281('0x7'));var path=require(_0xe281('0x8'));var sox=require(_0xe281('0x9'));var csv=require(_0xe281('0xa'));var ejs=require(_0xe281('0xb'));var fs=require('fs');var fs_extra=require(_0xe281('0xc'));var _=require(_0xe281('0xd'));var squel=require(_0xe281('0xe'));var crypto=require(_0xe281('0xf'));var jsforce=require(_0xe281('0x10'));var deskjs=require(_0xe281('0x11'));var toCsv=require(_0xe281('0xa'));var querystring=require(_0xe281('0x12'));var Papa=require(_0xe281('0x13'));var Redis=require('ioredis');var authService=require(_0xe281('0x14'));var qs=require(_0xe281('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe281('0x16'))(_0xe281('0x17'));var utils=require(_0xe281('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe281('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e6c4,_0x4a735b){_0x4a735b=_0x4a735b||0xcc;return function(_0x11424c){if(_0x11424c){return _0x48e6c4[_0xe281('0x1a')](_0x4a735b);}return _0x48e6c4[_0xe281('0x1b')](_0x4a735b)[_0xe281('0x1c')]();};}function respondWithResult(_0xecd0a6,_0x289242){_0x289242=_0x289242||0xc8;return function(_0xae8352){if(_0xae8352){return _0xecd0a6[_0xe281('0x1b')](_0x289242)[_0xe281('0x1d')](_0xae8352);}};}function respondWithFilteredResult(_0x124a06,_0x795611){return function(_0x196931){if(_0x196931){var _0xc4296a=typeof _0x795611[_0xe281('0x1e')]===_0xe281('0x1f')&&typeof _0x795611[_0xe281('0x20')]===_0xe281('0x1f');var _0x59a305=_0x196931[_0xe281('0x21')];var _0x3a9fe5=_0xc4296a?0x0:_0x795611['offset'];var _0x4ddaa0=_0xc4296a?_0x196931[_0xe281('0x21')]:_0x795611[_0xe281('0x1e')]+_0x795611[_0xe281('0x20')];var _0x38f502;if(_0x4ddaa0>=_0x59a305){_0x4ddaa0=_0x59a305;_0x38f502=0xc8;}else{_0x38f502=0xce;}_0x124a06[_0xe281('0x1b')](_0x38f502);return _0x124a06[_0xe281('0x22')](_0xe281('0x23'),_0x3a9fe5+'-'+_0x4ddaa0+'/'+_0x59a305)[_0xe281('0x1d')](_0x196931);}return null;};}function patchUpdates(_0x5558b1){return function(_0x39b988){try{jsonpatch[_0xe281('0x24')](_0x39b988,_0x5558b1,!![]);}catch(_0x583601){return BPromise[_0xe281('0x25')](_0x583601);}return _0x39b988[_0xe281('0x26')]();};}function saveUpdates(_0x58a832,_0x29d1f8){return function(_0x465cfe){if(_0x465cfe){return _0x465cfe[_0xe281('0x27')](_0x58a832)['then'](function(_0x5108d7){return _0x5108d7;});}return null;};}function removeEntity(_0x38ae9d,_0x368224){return function(_0x80c10e){if(_0x80c10e){return _0x80c10e[_0xe281('0x28')]()['then'](function(){_0x38ae9d['status'](0xcc)[_0xe281('0x1c')]();});}};}function handleEntityNotFound(_0x56d9e1,_0x2b3315){return function(_0x2088ee){if(!_0x2088ee){_0x56d9e1[_0xe281('0x1a')](0x194);}return _0x2088ee;};}function handleError(_0x2d5b10,_0x4cf9f5){_0x4cf9f5=_0x4cf9f5||0x1f4;return function(_0x34c30b){logger[_0xe281('0x29')](_0x34c30b[_0xe281('0x2a')]);if(_0x34c30b['name']){delete _0x34c30b[_0xe281('0x2b')];}_0x2d5b10[_0xe281('0x1b')](_0x4cf9f5)['send'](_0x34c30b);};}exports[_0xe281('0x2c')]=function(_0x45a359,_0x4f2f36){var _0x48efc3={},_0x287e8c={},_0x19ef68={'count':0x0,'rows':[]};var _0x445dd7=_[_0xe281('0x2d')](db['FreshsalesConfiguration'][_0xe281('0x2e')],function(_0x2c4895){return{'name':_0x2c4895['fieldName'],'type':_0x2c4895[_0xe281('0x2f')][_0xe281('0x30')]};});_0x287e8c[_0xe281('0x31')]=_['map'](_0x445dd7,'name');_0x287e8c['query']=_[_0xe281('0x32')](_0x45a359['query']);_0x287e8c['filters']=_[_0xe281('0x33')](_0x287e8c[_0xe281('0x31')],_0x287e8c[_0xe281('0x34')]);_0x48efc3[_0xe281('0x35')]=_[_0xe281('0x33')](_0x287e8c[_0xe281('0x31')],qs[_0xe281('0x36')](_0x45a359['query'][_0xe281('0x36')]));_0x48efc3[_0xe281('0x35')]=_0x48efc3[_0xe281('0x35')]['length']?_0x48efc3[_0xe281('0x35')]:_0x287e8c['model'];if(!_0x45a359[_0xe281('0x34')]['hasOwnProperty'](_0xe281('0x37'))){_0x48efc3[_0xe281('0x20')]=qs[_0xe281('0x20')](_0x45a359[_0xe281('0x34')][_0xe281('0x20')]);_0x48efc3[_0xe281('0x1e')]=qs['offset'](_0x45a359['query']['offset']);}_0x48efc3[_0xe281('0x38')]=qs['sort'](_0x45a359[_0xe281('0x34')]['sort']);_0x48efc3[_0xe281('0x39')]=qs[_0xe281('0x3a')](_[_0xe281('0x3b')](_0x45a359[_0xe281('0x34')],_0x287e8c[_0xe281('0x3a')]),_0x445dd7);if(_0x45a359[_0xe281('0x34')][_0xe281('0x3c')]){_0x48efc3['where']=_['merge'](_0x48efc3['where'],{'$or':_[_0xe281('0x2d')](_0x445dd7,function(_0x595cbb){if(_0x595cbb['type']!==_0xe281('0x3d')){var _0x28c68d={};_0x28c68d[_0x595cbb[_0xe281('0x2b')]]={'$like':'%'+_0x45a359[_0xe281('0x34')][_0xe281('0x3c')]+'%'};return _0x28c68d;}})});}_0x48efc3=_[_0xe281('0x3e')]({},_0x48efc3,_0x45a359[_0xe281('0x3f')]);var _0x19199={'where':_0x48efc3[_0xe281('0x39')]};return db[_0xe281('0x40')]['count'](_0x19199)['then'](function(_0x4f0848){_0x19ef68[_0xe281('0x21')]=_0x4f0848;if(_0x45a359[_0xe281('0x34')][_0xe281('0x41')]){_0x48efc3[_0xe281('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x48efc3);})[_0xe281('0x43')](function(_0x215ed2){_0x19ef68[_0xe281('0x44')]=_0x215ed2;return _0x19ef68;})[_0xe281('0x43')](respondWithFilteredResult(_0x4f2f36,_0x48efc3))['catch'](handleError(_0x4f2f36,null));};exports[_0xe281('0x45')]=function(_0x5b5e4f,_0x3d3d90){var _0x2798c0={'raw':![],'where':{'id':_0x5b5e4f[_0xe281('0x46')]['id']}},_0x7fdb0d={};_0x7fdb0d[_0xe281('0x31')]=_[_0xe281('0x32')](db[_0xe281('0x40')][_0xe281('0x2e')]);_0x7fdb0d[_0xe281('0x34')]=_[_0xe281('0x32')](_0x5b5e4f['query']);_0x7fdb0d['filters']=_['intersection'](_0x7fdb0d[_0xe281('0x31')],_0x7fdb0d[_0xe281('0x34')]);_0x2798c0[_0xe281('0x35')]=_[_0xe281('0x33')](_0x7fdb0d[_0xe281('0x31')],qs[_0xe281('0x36')](_0x5b5e4f[_0xe281('0x34')][_0xe281('0x36')]));_0x2798c0[_0xe281('0x35')]=_0x2798c0[_0xe281('0x35')][_0xe281('0x47')]?_0x2798c0['attributes']:_0x7fdb0d[_0xe281('0x31')];if(_0x5b5e4f[_0xe281('0x34')][_0xe281('0x41')]){_0x2798c0[_0xe281('0x42')]=[{'all':!![]}];}_0x2798c0=_[_0xe281('0x3e')]({},_0x2798c0,_0x5b5e4f['options']);return db[_0xe281('0x40')][_0xe281('0x48')](_0x2798c0)[_0xe281('0x43')](handleEntityNotFound(_0x3d3d90,null))[_0xe281('0x43')](respondWithResult(_0x3d3d90,null))[_0xe281('0x49')](handleError(_0x3d3d90,null));};exports[_0xe281('0x4a')]=function(_0x2e2ec3,_0x4ec707){return db[_0xe281('0x40')][_0xe281('0x4a')](_0x2e2ec3[_0xe281('0x4b')],{})['then'](respondWithResult(_0x4ec707,0xc9))[_0xe281('0x49')](handleError(_0x4ec707,null));};exports[_0xe281('0x27')]=function(_0x3d075b,_0x35d505){if(_0x3d075b[_0xe281('0x4b')]['id']){delete _0x3d075b[_0xe281('0x4b')]['id'];}return db[_0xe281('0x40')][_0xe281('0x48')]({'where':{'id':_0x3d075b[_0xe281('0x46')]['id']}})['then'](handleEntityNotFound(_0x35d505,null))['then'](saveUpdates(_0x3d075b[_0xe281('0x4b')],null))[_0xe281('0x43')](respondWithResult(_0x35d505,null))[_0xe281('0x49')](handleError(_0x35d505,null));};exports['destroy']=function(_0x596fce,_0xd3e824){return db[_0xe281('0x40')][_0xe281('0x48')]({'where':{'id':_0x596fce['params']['id']}})[_0xe281('0x43')](handleEntityNotFound(_0xd3e824,null))['then'](removeEntity(_0xd3e824,null))[_0xe281('0x49')](handleError(_0xd3e824,null));};exports[_0xe281('0x4c')]=function(_0x1ff5b2,_0x3d3ee1,_0x2c8022){var _0xb81c96={};var _0x5f0cf3={};var _0x1123d0;var _0x5e2a90;return db[_0xe281('0x40')]['findOne']({'where':{'id':_0x1ff5b2[_0xe281('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d3ee1,null))[_0xe281('0x43')](function(_0x559a0b){if(_0x559a0b){_0x1123d0=_0x559a0b;_0x5f0cf3[_0xe281('0x31')]=_['keys'](db['FreshsalesField'][_0xe281('0x2e')]);_0x5f0cf3[_0xe281('0x34')]=_[_0xe281('0x32')](_0x1ff5b2['query']);_0x5f0cf3[_0xe281('0x3a')]=_[_0xe281('0x33')](_0x5f0cf3[_0xe281('0x31')],_0x5f0cf3['query']);_0xb81c96[_0xe281('0x35')]=_['intersection'](_0x5f0cf3[_0xe281('0x31')],qs[_0xe281('0x36')](_0x1ff5b2[_0xe281('0x34')]['fields']));_0xb81c96[_0xe281('0x35')]=_0xb81c96[_0xe281('0x35')]['length']?_0xb81c96[_0xe281('0x35')]:_0x5f0cf3[_0xe281('0x31')];_0xb81c96[_0xe281('0x38')]=qs[_0xe281('0x4d')](_0x1ff5b2[_0xe281('0x34')]['sort']);_0xb81c96[_0xe281('0x39')]=qs['filters'](_[_0xe281('0x3b')](_0x1ff5b2['query'],_0x5f0cf3[_0xe281('0x3a')]));if(_0x1ff5b2[_0xe281('0x34')][_0xe281('0x3c')]){_0xb81c96['where']=_[_0xe281('0x3e')](_0xb81c96[_0xe281('0x39')],{'$or':_[_0xe281('0x2d')](_0xb81c96['attributes'],function(_0xb82436){var _0x4a1fe6={};_0x4a1fe6[_0xb82436]={'$like':'%'+_0x1ff5b2[_0xe281('0x34')][_0xe281('0x3c')]+'%'};return _0x4a1fe6;})});}_0xb81c96=_['merge']({},_0xb81c96,_0x1ff5b2[_0xe281('0x3f')]);return _0x1123d0[_0xe281('0x4c')](_0xb81c96);}})[_0xe281('0x43')](function(_0x4adc70){if(_0x4adc70){_0x5e2a90=_0x4adc70[_0xe281('0x47')];if(!_0x1ff5b2['query'][_0xe281('0x4e')](_0xe281('0x37'))){_0xb81c96[_0xe281('0x20')]=qs[_0xe281('0x20')](_0x1ff5b2['query'][_0xe281('0x20')]);_0xb81c96[_0xe281('0x1e')]=qs['offset'](_0x1ff5b2['query'][_0xe281('0x1e')]);}return _0x1123d0[_0xe281('0x4c')](_0xb81c96);}})['then'](function(_0x386c59){if(_0x386c59){return _0x386c59?{'count':_0x5e2a90,'rows':_0x386c59}:null;}})[_0xe281('0x43')](respondWithResult(_0x3d3ee1,null))[_0xe281('0x49')](handleError(_0x3d3ee1,null));};exports[_0xe281('0x4f')]=function(_0x2e44c6,_0x1069e9,_0x5b045f){var _0x231a51={};var _0x49c68c={};var _0x2beece;var _0x43092e;return db[_0xe281('0x40')][_0xe281('0x50')]({'where':{'id':_0x2e44c6[_0xe281('0x46')]['id']}})[_0xe281('0x43')](handleEntityNotFound(_0x1069e9,null))['then'](function(_0xe69b13){if(_0xe69b13){_0x2beece=_0xe69b13;_0x49c68c[_0xe281('0x31')]=_[_0xe281('0x32')](db[_0xe281('0x51')][_0xe281('0x2e')]);_0x49c68c[_0xe281('0x34')]=_[_0xe281('0x32')](_0x2e44c6['query']);_0x49c68c[_0xe281('0x3a')]=_[_0xe281('0x33')](_0x49c68c[_0xe281('0x31')],_0x49c68c[_0xe281('0x34')]);_0x231a51[_0xe281('0x35')]=_[_0xe281('0x33')](_0x49c68c[_0xe281('0x31')],qs[_0xe281('0x36')](_0x2e44c6['query'][_0xe281('0x36')]));_0x231a51['attributes']=_0x231a51[_0xe281('0x35')][_0xe281('0x47')]?_0x231a51[_0xe281('0x35')]:_0x49c68c['model'];_0x231a51[_0xe281('0x38')]=qs[_0xe281('0x4d')](_0x2e44c6[_0xe281('0x34')]['sort']);_0x231a51['where']=qs[_0xe281('0x3a')](_[_0xe281('0x3b')](_0x2e44c6[_0xe281('0x34')],_0x49c68c[_0xe281('0x3a')]));if(_0x2e44c6[_0xe281('0x34')][_0xe281('0x3c')]){_0x231a51[_0xe281('0x39')]=_[_0xe281('0x3e')](_0x231a51['where'],{'$or':_[_0xe281('0x2d')](_0x231a51['attributes'],function(_0x2d7818){var _0x237dfa={};_0x237dfa[_0x2d7818]={'$like':'%'+_0x2e44c6[_0xe281('0x34')][_0xe281('0x3c')]+'%'};return _0x237dfa;})});}_0x231a51=_['merge']({},_0x231a51,_0x2e44c6[_0xe281('0x3f')]);return _0x2beece[_0xe281('0x4f')](_0x231a51);}})[_0xe281('0x43')](function(_0x4381f5){if(_0x4381f5){_0x43092e=_0x4381f5['length'];if(!_0x2e44c6[_0xe281('0x34')][_0xe281('0x4e')]('nolimit')){_0x231a51[_0xe281('0x20')]=qs[_0xe281('0x20')](_0x2e44c6[_0xe281('0x34')][_0xe281('0x20')]);_0x231a51['offset']=qs['offset'](_0x2e44c6[_0xe281('0x34')][_0xe281('0x1e')]);}return _0x2beece[_0xe281('0x4f')](_0x231a51);}})[_0xe281('0x43')](function(_0xd063b2){if(_0xd063b2){return _0xd063b2?{'count':_0x43092e,'rows':_0xd063b2}:null;}})[_0xe281('0x43')](respondWithResult(_0x1069e9,null))[_0xe281('0x49')](handleError(_0x1069e9,null));};exports['getFields']=function(_0x480c58,_0x3df354,_0x1e14ad){var _0xb14e69={};var _0x27336d={};var _0x501ed9;var _0x22f370;return db[_0xe281('0x40')][_0xe281('0x50')]({'where':{'id':_0x480c58['params']['id']}})[_0xe281('0x43')](handleEntityNotFound(_0x3df354,null))[_0xe281('0x43')](function(_0x2a54f6){if(_0x2a54f6){_0x501ed9=_0x2a54f6;_0x27336d[_0xe281('0x31')]=_[_0xe281('0x32')](db[_0xe281('0x51')][_0xe281('0x2e')]);_0x27336d[_0xe281('0x34')]=_[_0xe281('0x32')](_0x480c58[_0xe281('0x34')]);_0x27336d['filters']=_[_0xe281('0x33')](_0x27336d[_0xe281('0x31')],_0x27336d['query']);_0xb14e69[_0xe281('0x35')]=_['intersection'](_0x27336d[_0xe281('0x31')],qs['fields'](_0x480c58[_0xe281('0x34')]['fields']));_0xb14e69[_0xe281('0x35')]=_0xb14e69[_0xe281('0x35')]['length']?_0xb14e69[_0xe281('0x35')]:_0x27336d['model'];_0xb14e69[_0xe281('0x38')]=qs[_0xe281('0x4d')](_0x480c58['query'][_0xe281('0x4d')]);_0xb14e69[_0xe281('0x39')]=qs[_0xe281('0x3a')](_[_0xe281('0x3b')](_0x480c58['query'],_0x27336d['filters']));if(_0x480c58['query'][_0xe281('0x3c')]){_0xb14e69[_0xe281('0x39')]=_[_0xe281('0x3e')](_0xb14e69[_0xe281('0x39')],{'$or':_['map'](_0xb14e69[_0xe281('0x35')],function(_0x1e478c){var _0x3cacd9={};_0x3cacd9[_0x1e478c]={'$like':'%'+_0x480c58['query'][_0xe281('0x3c')]+'%'};return _0x3cacd9;})});}_0xb14e69=_[_0xe281('0x3e')]({},_0xb14e69,_0x480c58[_0xe281('0x3f')]);return _0x501ed9['getFields'](_0xb14e69);}})[_0xe281('0x43')](function(_0x42b723){if(_0x42b723){_0x22f370=_0x42b723[_0xe281('0x47')];if(!_0x480c58['query'][_0xe281('0x4e')](_0xe281('0x37'))){_0xb14e69[_0xe281('0x20')]=qs[_0xe281('0x20')](_0x480c58[_0xe281('0x34')]['limit']);_0xb14e69[_0xe281('0x1e')]=qs[_0xe281('0x1e')](_0x480c58[_0xe281('0x34')][_0xe281('0x1e')]);}return _0x501ed9[_0xe281('0x52')](_0xb14e69);}})[_0xe281('0x43')](function(_0x58362d){if(_0x58362d){return _0x58362d?{'count':_0x22f370,'rows':_0x58362d}:null;}})[_0xe281('0x43')](respondWithResult(_0x3df354,null))[_0xe281('0x49')](handleError(_0x3df354,null));}; \ No newline at end of file +var _0x1818=['length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','options','create','body','find','params','getSubjects','FreshsalesField','sort','nolimit','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x16beeb,_0x1b7399){var _0x5a0de7=function(_0x3a1992){while(--_0x3a1992){_0x16beeb['push'](_0x16beeb['shift']());}};_0x5a0de7(++_0x1b7399);}(_0x1818,0xfa));var _0x8181=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x1818[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x8181('0x0'));var rimraf=require(_0x8181('0x1'));var zipdir=require(_0x8181('0x2'));var jsonpatch=require(_0x8181('0x3'));var rp=require(_0x8181('0x4'));var moment=require(_0x8181('0x5'));var BPromise=require(_0x8181('0x6'));var Mustache=require(_0x8181('0x7'));var util=require(_0x8181('0x8'));var path=require(_0x8181('0x9'));var sox=require(_0x8181('0xa'));var csv=require(_0x8181('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8181('0xc'));var _=require(_0x8181('0xd'));var squel=require(_0x8181('0xe'));var crypto=require(_0x8181('0xf'));var jsforce=require(_0x8181('0x10'));var deskjs=require(_0x8181('0x11'));var toCsv=require(_0x8181('0xb'));var querystring=require('querystring');var Papa=require(_0x8181('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8181('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8181('0x14'));var config=require(_0x8181('0x15'));var licenseUtil=require(_0x8181('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x221774,_0x6c6d2d){_0x6c6d2d=_0x6c6d2d||0xcc;return function(_0x3b93c6){if(_0x3b93c6){return _0x221774[_0x8181('0x17')](_0x6c6d2d);}return _0x221774[_0x8181('0x18')](_0x6c6d2d)[_0x8181('0x19')]();};}function respondWithResult(_0x4b2819,_0x3296f9){_0x3296f9=_0x3296f9||0xc8;return function(_0x1b922c){if(_0x1b922c){return _0x4b2819[_0x8181('0x18')](_0x3296f9)[_0x8181('0x1a')](_0x1b922c);}};}function respondWithFilteredResult(_0x181647,_0x473f59){return function(_0x37ea87){if(_0x37ea87){var _0x5a6951=typeof _0x473f59[_0x8181('0x1b')]===_0x8181('0x1c')&&typeof _0x473f59[_0x8181('0x1d')]===_0x8181('0x1c');var _0x595a6c=_0x37ea87['count'];var _0xe881d5=_0x5a6951?0x0:_0x473f59[_0x8181('0x1b')];var _0x52f655=_0x5a6951?_0x37ea87[_0x8181('0x1e')]:_0x473f59[_0x8181('0x1b')]+_0x473f59[_0x8181('0x1d')];var _0x427f33;if(_0x52f655>=_0x595a6c){_0x52f655=_0x595a6c;_0x427f33=0xc8;}else{_0x427f33=0xce;}_0x181647[_0x8181('0x18')](_0x427f33);return _0x181647[_0x8181('0x1f')](_0x8181('0x20'),_0xe881d5+'-'+_0x52f655+'/'+_0x595a6c)[_0x8181('0x1a')](_0x37ea87);}return null;};}function patchUpdates(_0x37d22e){return function(_0x1049b2){try{jsonpatch['apply'](_0x1049b2,_0x37d22e,!![]);}catch(_0x2b2d3c){return BPromise[_0x8181('0x21')](_0x2b2d3c);}return _0x1049b2['save']();};}function saveUpdates(_0x1eab7d,_0x25cde6){return function(_0x4544b6){if(_0x4544b6){return _0x4544b6[_0x8181('0x22')](_0x1eab7d)[_0x8181('0x23')](function(_0x3d54e4){return _0x3d54e4;});}return null;};}function removeEntity(_0x5351f7,_0x29997d){return function(_0xcabd59){if(_0xcabd59){return _0xcabd59[_0x8181('0x24')]()[_0x8181('0x23')](function(){_0x5351f7[_0x8181('0x18')](0xcc)[_0x8181('0x19')]();});}};}function handleEntityNotFound(_0x32bf47,_0x185488){return function(_0x1845c2){if(!_0x1845c2){_0x32bf47['sendStatus'](0x194);}return _0x1845c2;};}function handleError(_0x389dfa,_0x561551){_0x561551=_0x561551||0x1f4;return function(_0x1fac1b){logger[_0x8181('0x25')](_0x1fac1b[_0x8181('0x26')]);if(_0x1fac1b['name']){delete _0x1fac1b[_0x8181('0x27')];}_0x389dfa['status'](_0x561551)[_0x8181('0x28')](_0x1fac1b);};}exports[_0x8181('0x29')]=function(_0x4c81c2,_0x50345c){var _0x11f50d={},_0x3886ac={},_0x460947={'count':0x0,'rows':[]};var _0x29efc7=_['map'](db[_0x8181('0x2a')][_0x8181('0x2b')],function(_0x58064b){return{'name':_0x58064b['fieldName'],'type':_0x58064b[_0x8181('0x2c')][_0x8181('0x2d')]};});_0x3886ac[_0x8181('0x2e')]=_[_0x8181('0x2f')](_0x29efc7,_0x8181('0x27'));_0x3886ac[_0x8181('0x30')]=_[_0x8181('0x31')](_0x4c81c2[_0x8181('0x30')]);_0x3886ac[_0x8181('0x32')]=_[_0x8181('0x33')](_0x3886ac[_0x8181('0x2e')],_0x3886ac[_0x8181('0x30')]);_0x11f50d['attributes']=_['intersection'](_0x3886ac[_0x8181('0x2e')],qs[_0x8181('0x34')](_0x4c81c2[_0x8181('0x30')][_0x8181('0x34')]));_0x11f50d[_0x8181('0x35')]=_0x11f50d['attributes'][_0x8181('0x36')]?_0x11f50d[_0x8181('0x35')]:_0x3886ac[_0x8181('0x2e')];if(!_0x4c81c2[_0x8181('0x30')][_0x8181('0x37')]('nolimit')){_0x11f50d[_0x8181('0x1d')]=qs[_0x8181('0x1d')](_0x4c81c2['query'][_0x8181('0x1d')]);_0x11f50d['offset']=qs[_0x8181('0x1b')](_0x4c81c2[_0x8181('0x30')][_0x8181('0x1b')]);}_0x11f50d[_0x8181('0x38')]=qs['sort'](_0x4c81c2[_0x8181('0x30')]['sort']);_0x11f50d['where']=qs[_0x8181('0x32')](_[_0x8181('0x39')](_0x4c81c2['query'],_0x3886ac[_0x8181('0x32')]),_0x29efc7);if(_0x4c81c2[_0x8181('0x30')][_0x8181('0x3a')]){_0x11f50d[_0x8181('0x3b')]=_[_0x8181('0x3c')](_0x11f50d['where'],{'$or':_[_0x8181('0x2f')](_0x29efc7,function(_0x4914a0){if(_0x4914a0[_0x8181('0x2c')]!==_0x8181('0x3d')){var _0x3183dd={};_0x3183dd[_0x4914a0[_0x8181('0x27')]]={'$like':'%'+_0x4c81c2[_0x8181('0x30')][_0x8181('0x3a')]+'%'};return _0x3183dd;}})});}_0x11f50d=_[_0x8181('0x3c')]({},_0x11f50d,_0x4c81c2['options']);var _0x4240de={'where':_0x11f50d[_0x8181('0x3b')]};return db[_0x8181('0x2a')][_0x8181('0x1e')](_0x4240de)[_0x8181('0x23')](function(_0x2067de){_0x460947[_0x8181('0x1e')]=_0x2067de;if(_0x4c81c2['query'][_0x8181('0x3e')]){_0x11f50d['include']=[{'all':!![]}];}return db[_0x8181('0x2a')][_0x8181('0x3f')](_0x11f50d);})[_0x8181('0x23')](function(_0x42c042){_0x460947['rows']=_0x42c042;return _0x460947;})[_0x8181('0x23')](respondWithFilteredResult(_0x50345c,_0x11f50d))[_0x8181('0x40')](handleError(_0x50345c,null));};exports['show']=function(_0x1cb0c8,_0x542ed5){var _0x4b2640={'raw':![],'where':{'id':_0x1cb0c8['params']['id']}},_0x39245b={};_0x39245b['model']=_[_0x8181('0x31')](db[_0x8181('0x2a')]['rawAttributes']);_0x39245b[_0x8181('0x30')]=_[_0x8181('0x31')](_0x1cb0c8[_0x8181('0x30')]);_0x39245b[_0x8181('0x32')]=_[_0x8181('0x33')](_0x39245b[_0x8181('0x2e')],_0x39245b[_0x8181('0x30')]);_0x4b2640[_0x8181('0x35')]=_[_0x8181('0x33')](_0x39245b[_0x8181('0x2e')],qs[_0x8181('0x34')](_0x1cb0c8['query']['fields']));_0x4b2640[_0x8181('0x35')]=_0x4b2640[_0x8181('0x35')][_0x8181('0x36')]?_0x4b2640[_0x8181('0x35')]:_0x39245b[_0x8181('0x2e')];if(_0x1cb0c8[_0x8181('0x30')][_0x8181('0x3e')]){_0x4b2640['include']=[{'all':!![]}];}_0x4b2640=_[_0x8181('0x3c')]({},_0x4b2640,_0x1cb0c8[_0x8181('0x41')]);return db['FreshsalesConfiguration']['find'](_0x4b2640)[_0x8181('0x23')](handleEntityNotFound(_0x542ed5,null))['then'](respondWithResult(_0x542ed5,null))['catch'](handleError(_0x542ed5,null));};exports[_0x8181('0x42')]=function(_0x27d801,_0x1a8c08){return db['FreshsalesConfiguration'][_0x8181('0x42')](_0x27d801[_0x8181('0x43')],{})['then'](respondWithResult(_0x1a8c08,0xc9))[_0x8181('0x40')](handleError(_0x1a8c08,null));};exports[_0x8181('0x22')]=function(_0x34f0fe,_0x15eda0){if(_0x34f0fe[_0x8181('0x43')]['id']){delete _0x34f0fe[_0x8181('0x43')]['id'];}return db[_0x8181('0x2a')][_0x8181('0x44')]({'where':{'id':_0x34f0fe[_0x8181('0x45')]['id']}})[_0x8181('0x23')](handleEntityNotFound(_0x15eda0,null))[_0x8181('0x23')](saveUpdates(_0x34f0fe[_0x8181('0x43')],null))[_0x8181('0x23')](respondWithResult(_0x15eda0,null))[_0x8181('0x40')](handleError(_0x15eda0,null));};exports[_0x8181('0x24')]=function(_0x353c76,_0x5bbf7d){return db[_0x8181('0x2a')][_0x8181('0x44')]({'where':{'id':_0x353c76[_0x8181('0x45')]['id']}})[_0x8181('0x23')](handleEntityNotFound(_0x5bbf7d,null))['then'](removeEntity(_0x5bbf7d,null))[_0x8181('0x40')](handleError(_0x5bbf7d,null));};exports[_0x8181('0x46')]=function(_0x462af5,_0x3e26f0,_0x58b324){var _0x2ab344={};var _0x9848fe={};var _0x242434;var _0x32d38a;return db[_0x8181('0x2a')]['findOne']({'where':{'id':_0x462af5[_0x8181('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e26f0,null))[_0x8181('0x23')](function(_0xbdcfd6){if(_0xbdcfd6){_0x242434=_0xbdcfd6;_0x9848fe['model']=_[_0x8181('0x31')](db[_0x8181('0x47')][_0x8181('0x2b')]);_0x9848fe[_0x8181('0x30')]=_[_0x8181('0x31')](_0x462af5[_0x8181('0x30')]);_0x9848fe[_0x8181('0x32')]=_[_0x8181('0x33')](_0x9848fe['model'],_0x9848fe[_0x8181('0x30')]);_0x2ab344[_0x8181('0x35')]=_[_0x8181('0x33')](_0x9848fe[_0x8181('0x2e')],qs[_0x8181('0x34')](_0x462af5[_0x8181('0x30')][_0x8181('0x34')]));_0x2ab344[_0x8181('0x35')]=_0x2ab344[_0x8181('0x35')][_0x8181('0x36')]?_0x2ab344[_0x8181('0x35')]:_0x9848fe[_0x8181('0x2e')];_0x2ab344[_0x8181('0x38')]=qs[_0x8181('0x48')](_0x462af5[_0x8181('0x30')][_0x8181('0x48')]);_0x2ab344[_0x8181('0x3b')]=qs['filters'](_[_0x8181('0x39')](_0x462af5[_0x8181('0x30')],_0x9848fe[_0x8181('0x32')]));if(_0x462af5['query'][_0x8181('0x3a')]){_0x2ab344[_0x8181('0x3b')]=_['merge'](_0x2ab344[_0x8181('0x3b')],{'$or':_[_0x8181('0x2f')](_0x2ab344[_0x8181('0x35')],function(_0x5d3a4f){var _0x456e09={};_0x456e09[_0x5d3a4f]={'$like':'%'+_0x462af5[_0x8181('0x30')][_0x8181('0x3a')]+'%'};return _0x456e09;})});}_0x2ab344=_[_0x8181('0x3c')]({},_0x2ab344,_0x462af5[_0x8181('0x41')]);return _0x242434[_0x8181('0x46')](_0x2ab344);}})['then'](function(_0x26a98c){if(_0x26a98c){_0x32d38a=_0x26a98c[_0x8181('0x36')];if(!_0x462af5[_0x8181('0x30')][_0x8181('0x37')](_0x8181('0x49'))){_0x2ab344[_0x8181('0x1d')]=qs[_0x8181('0x1d')](_0x462af5[_0x8181('0x30')][_0x8181('0x1d')]);_0x2ab344[_0x8181('0x1b')]=qs[_0x8181('0x1b')](_0x462af5[_0x8181('0x30')][_0x8181('0x1b')]);}return _0x242434[_0x8181('0x46')](_0x2ab344);}})[_0x8181('0x23')](function(_0x1b39c0){if(_0x1b39c0){return _0x1b39c0?{'count':_0x32d38a,'rows':_0x1b39c0}:null;}})['then'](respondWithResult(_0x3e26f0,null))[_0x8181('0x40')](handleError(_0x3e26f0,null));};exports['getDescriptions']=function(_0x36dc3f,_0x56bbe4,_0x4f4db7){var _0x42c1e2={};var _0x1295f4={};var _0x11ad90;var _0x1d65b2;return db[_0x8181('0x2a')][_0x8181('0x4a')]({'where':{'id':_0x36dc3f[_0x8181('0x45')]['id']}})['then'](handleEntityNotFound(_0x56bbe4,null))[_0x8181('0x23')](function(_0x18f0da){if(_0x18f0da){_0x11ad90=_0x18f0da;_0x1295f4[_0x8181('0x2e')]=_[_0x8181('0x31')](db[_0x8181('0x47')][_0x8181('0x2b')]);_0x1295f4[_0x8181('0x30')]=_[_0x8181('0x31')](_0x36dc3f[_0x8181('0x30')]);_0x1295f4[_0x8181('0x32')]=_['intersection'](_0x1295f4[_0x8181('0x2e')],_0x1295f4[_0x8181('0x30')]);_0x42c1e2[_0x8181('0x35')]=_[_0x8181('0x33')](_0x1295f4[_0x8181('0x2e')],qs[_0x8181('0x34')](_0x36dc3f[_0x8181('0x30')][_0x8181('0x34')]));_0x42c1e2[_0x8181('0x35')]=_0x42c1e2[_0x8181('0x35')]['length']?_0x42c1e2[_0x8181('0x35')]:_0x1295f4['model'];_0x42c1e2[_0x8181('0x38')]=qs[_0x8181('0x48')](_0x36dc3f[_0x8181('0x30')][_0x8181('0x48')]);_0x42c1e2['where']=qs['filters'](_[_0x8181('0x39')](_0x36dc3f[_0x8181('0x30')],_0x1295f4[_0x8181('0x32')]));if(_0x36dc3f[_0x8181('0x30')][_0x8181('0x3a')]){_0x42c1e2[_0x8181('0x3b')]=_['merge'](_0x42c1e2[_0x8181('0x3b')],{'$or':_['map'](_0x42c1e2[_0x8181('0x35')],function(_0x254df3){var _0x2ad0a2={};_0x2ad0a2[_0x254df3]={'$like':'%'+_0x36dc3f[_0x8181('0x30')]['filter']+'%'};return _0x2ad0a2;})});}_0x42c1e2=_[_0x8181('0x3c')]({},_0x42c1e2,_0x36dc3f['options']);return _0x11ad90[_0x8181('0x4b')](_0x42c1e2);}})[_0x8181('0x23')](function(_0x350400){if(_0x350400){_0x1d65b2=_0x350400[_0x8181('0x36')];if(!_0x36dc3f['query'][_0x8181('0x37')](_0x8181('0x49'))){_0x42c1e2['limit']=qs[_0x8181('0x1d')](_0x36dc3f[_0x8181('0x30')][_0x8181('0x1d')]);_0x42c1e2[_0x8181('0x1b')]=qs[_0x8181('0x1b')](_0x36dc3f[_0x8181('0x30')]['offset']);}return _0x11ad90['getDescriptions'](_0x42c1e2);}})[_0x8181('0x23')](function(_0x4f7851){if(_0x4f7851){return _0x4f7851?{'count':_0x1d65b2,'rows':_0x4f7851}:null;}})[_0x8181('0x23')](respondWithResult(_0x56bbe4,null))['catch'](handleError(_0x56bbe4,null));};exports['getFields']=function(_0x4055f1,_0x569563,_0x43c6b3){var _0x28eea7={};var _0x1188bd={};var _0x3dacad;var _0x177956;return db['FreshsalesConfiguration'][_0x8181('0x4a')]({'where':{'id':_0x4055f1['params']['id']}})[_0x8181('0x23')](handleEntityNotFound(_0x569563,null))[_0x8181('0x23')](function(_0x4adfa7){if(_0x4adfa7){_0x3dacad=_0x4adfa7;_0x1188bd[_0x8181('0x2e')]=_[_0x8181('0x31')](db['FreshsalesField']['rawAttributes']);_0x1188bd[_0x8181('0x30')]=_[_0x8181('0x31')](_0x4055f1[_0x8181('0x30')]);_0x1188bd[_0x8181('0x32')]=_[_0x8181('0x33')](_0x1188bd[_0x8181('0x2e')],_0x1188bd[_0x8181('0x30')]);_0x28eea7[_0x8181('0x35')]=_[_0x8181('0x33')](_0x1188bd[_0x8181('0x2e')],qs[_0x8181('0x34')](_0x4055f1[_0x8181('0x30')][_0x8181('0x34')]));_0x28eea7[_0x8181('0x35')]=_0x28eea7['attributes']['length']?_0x28eea7[_0x8181('0x35')]:_0x1188bd[_0x8181('0x2e')];_0x28eea7[_0x8181('0x38')]=qs['sort'](_0x4055f1[_0x8181('0x30')][_0x8181('0x48')]);_0x28eea7[_0x8181('0x3b')]=qs['filters'](_[_0x8181('0x39')](_0x4055f1['query'],_0x1188bd['filters']));if(_0x4055f1[_0x8181('0x30')][_0x8181('0x3a')]){_0x28eea7[_0x8181('0x3b')]=_[_0x8181('0x3c')](_0x28eea7[_0x8181('0x3b')],{'$or':_['map'](_0x28eea7[_0x8181('0x35')],function(_0xe76387){var _0xe40f70={};_0xe40f70[_0xe76387]={'$like':'%'+_0x4055f1['query'][_0x8181('0x3a')]+'%'};return _0xe40f70;})});}_0x28eea7=_[_0x8181('0x3c')]({},_0x28eea7,_0x4055f1[_0x8181('0x41')]);return _0x3dacad['getFields'](_0x28eea7);}})[_0x8181('0x23')](function(_0x3c76c6){if(_0x3c76c6){_0x177956=_0x3c76c6['length'];if(!_0x4055f1[_0x8181('0x30')]['hasOwnProperty'](_0x8181('0x49'))){_0x28eea7['limit']=qs[_0x8181('0x1d')](_0x4055f1[_0x8181('0x30')][_0x8181('0x1d')]);_0x28eea7[_0x8181('0x1b')]=qs[_0x8181('0x1b')](_0x4055f1[_0x8181('0x30')]['offset']);}return _0x3dacad['getFields'](_0x28eea7);}})['then'](function(_0x690e4f){if(_0x690e4f){return _0x690e4f?{'count':_0x177956,'rows':_0x690e4f}:null;}})[_0x8181('0x23')](respondWithResult(_0x569563,null))[_0x8181('0x40')](handleError(_0x569563,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4ee3ae2..832b931 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 _0x081b=['FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x50e07b,_0x40b209){var _0x5f32ef=function(_0x40d5a9){while(--_0x40d5a9){_0x50e07b['push'](_0x50e07b['shift']());}};_0x5f32ef(++_0x40b209);}(_0x081b,0xbf));var _0xb081=function(_0x504b02,_0x330fc8){_0x504b02=_0x504b02-0x0;var _0x9ec60=_0x081b[_0x504b02];return _0x9ec60;};'use strict';var _=require(_0xb081('0x0'));var util=require(_0xb081('0x1'));var logger=require(_0xb081('0x2'))(_0xb081('0x3'));var moment=require(_0xb081('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb081('0x5'));var config=require(_0xb081('0x6'));var attributes=require(_0xb081('0x7'));module['exports']=function(_0x26db9e,_0x113f75){return _0x26db9e[_0xb081('0x8')](_0xb081('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5611=['../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5afeab,_0x536dcd){var _0x419cd3=function(_0x20edb8){while(--_0x20edb8){_0x5afeab['push'](_0x5afeab['shift']());}};_0x419cd3(++_0x536dcd);}(_0x5611,0x139));var _0x1561=function(_0x4b3659,_0x590f0d){_0x4b3659=_0x4b3659-0x0;var _0x300edb=_0x5611[_0x4b3659];return _0x300edb;};'use strict';var _=require(_0x1561('0x0'));var util=require(_0x1561('0x1'));var logger=require(_0x1561('0x2'))(_0x1561('0x3'));var moment=require(_0x1561('0x4'));var BPromise=require(_0x1561('0x5'));var rp=require(_0x1561('0x6'));var fs=require('fs');var path=require(_0x1561('0x7'));var rimraf=require(_0x1561('0x8'));var config=require(_0x1561('0x9'));var attributes=require(_0x1561('0xa'));module['exports']=function(_0x2b6e34,_0x4ee513){return _0x2b6e34[_0x1561('0xb')](_0x1561('0xc'),attributes,{'tableName':_0x1561('0xd'),'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 46eff33..c8187ad 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 _0xd335=['FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x324574,_0x4924ec){var _0x3ec5db=function(_0x4b4da4){while(--_0x4b4da4){_0x324574['push'](_0x324574['shift']());}};_0x3ec5db(++_0x4924ec);}(_0xd335,0x172));var _0x5d33=function(_0x1a2e8a,_0x178988){_0x1a2e8a=_0x1a2e8a-0x0;var _0xa74c96=_0xd335[_0x1a2e8a];return _0xa74c96;};'use strict';var _=require(_0x5d33('0x0'));var util=require(_0x5d33('0x1'));var moment=require(_0x5d33('0x2'));var BPromise=require(_0x5d33('0x3'));var rs=require(_0x5d33('0x4'));var fs=require('fs');var Redis=require(_0x5d33('0x5'));var db=require(_0x5d33('0x6'))['db'];var utils=require(_0x5d33('0x7'));var logger=require(_0x5d33('0x8'))('rpc');var config=require(_0x5d33('0x9'));var jayson=require(_0x5d33('0xa'));var client=jayson[_0x5d33('0xb')][_0x5d33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x150e66,_0x365344,_0x251668){return new BPromise(function(_0x56e550,_0x4e625f){return client[_0x5d33('0xd')](_0x150e66,_0x251668)['then'](function(_0xca05ea){logger['info'](_0x5d33('0xe'),_0x365344,'request\x20sent');logger[_0x5d33('0xf')](_0x5d33('0x10'),_0x365344,_0x5d33('0x11'),JSON[_0x5d33('0x12')](_0xca05ea));if(_0xca05ea[_0x5d33('0x13')]){if(_0xca05ea[_0x5d33('0x13')][_0x5d33('0x14')]===0x1f4){logger[_0x5d33('0x13')](_0x5d33('0xe'),_0x365344,_0xca05ea[_0x5d33('0x13')]['message']);return _0x4e625f(_0xca05ea[_0x5d33('0x13')][_0x5d33('0x15')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x365344,_0xca05ea[_0x5d33('0x13')][_0x5d33('0x15')]);return _0x56e550(_0xca05ea[_0x5d33('0x13')][_0x5d33('0x15')]);}else{logger[_0x5d33('0x16')](_0x5d33('0xe'),_0x365344,_0x5d33('0x11'));_0x56e550(_0xca05ea[_0x5d33('0x17')][_0x5d33('0x15')]);}})['catch'](function(_0x4438df){logger[_0x5d33('0x13')](_0x5d33('0xe'),_0x365344,_0x4438df);_0x4e625f(_0x4438df);});});} \ No newline at end of file +var _0xd8f6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x474436,_0x43787c){var _0x10e037=function(_0x558b44){while(--_0x558b44){_0x474436['push'](_0x474436['shift']());}};_0x10e037(++_0x43787c);}(_0xd8f6,0x126));var _0x6d8f=function(_0x15d0e5,_0x41133f){_0x15d0e5=_0x15d0e5-0x0;var _0x1de25b=_0xd8f6[_0x15d0e5];return _0x1de25b;};'use strict';var _=require(_0x6d8f('0x0'));var util=require('util');var moment=require(_0x6d8f('0x1'));var BPromise=require(_0x6d8f('0x2'));var rs=require(_0x6d8f('0x3'));var fs=require('fs');var Redis=require(_0x6d8f('0x4'));var db=require(_0x6d8f('0x5'))['db'];var utils=require(_0x6d8f('0x6'));var logger=require(_0x6d8f('0x7'))(_0x6d8f('0x8'));var config=require(_0x6d8f('0x9'));var jayson=require(_0x6d8f('0xa'));var client=jayson[_0x6d8f('0xb')][_0x6d8f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12ff57,_0x19cb67,_0x55ea8a){return new BPromise(function(_0x2c6ce3,_0x2d756e){return client['request'](_0x12ff57,_0x55ea8a)['then'](function(_0x498984){logger['info'](_0x6d8f('0xd'),_0x19cb67,_0x6d8f('0xe'));logger[_0x6d8f('0xf')](_0x6d8f('0x10'),_0x19cb67,_0x6d8f('0xe'),JSON[_0x6d8f('0x11')](_0x498984));if(_0x498984[_0x6d8f('0x12')]){if(_0x498984[_0x6d8f('0x12')][_0x6d8f('0x13')]===0x1f4){logger[_0x6d8f('0x12')](_0x6d8f('0xd'),_0x19cb67,_0x498984['error'][_0x6d8f('0x14')]);return _0x2d756e(_0x498984['error']['message']);}logger[_0x6d8f('0x12')](_0x6d8f('0xd'),_0x19cb67,_0x498984[_0x6d8f('0x12')][_0x6d8f('0x14')]);return _0x2c6ce3(_0x498984[_0x6d8f('0x12')][_0x6d8f('0x14')]);}else{logger[_0x6d8f('0x15')](_0x6d8f('0xd'),_0x19cb67,_0x6d8f('0xe'));_0x2c6ce3(_0x498984['result'][_0x6d8f('0x14')]);}})[_0x6d8f('0x16')](function(_0x2daee9){logger[_0x6d8f('0x12')](_0x6d8f('0xd'),_0x19cb67,_0x2daee9);_0x2d756e(_0x2daee9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8712c60..67a5ed4 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 _0x8369=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get','index','isAuthenticated','show','post','put','/:id','update','destroy'];(function(_0x5c4038,_0x16f339){var _0x5c30d1=function(_0x877830){while(--_0x877830){_0x5c4038['push'](_0x5c4038['shift']());}};_0x5c30d1(++_0x16f339);}(_0x8369,0x10b));var _0x9836=function(_0x5e5c0a,_0x54b00c){_0x5e5c0a=_0x5e5c0a-0x0;var _0x59f466=_0x8369[_0x5e5c0a];return _0x59f466;};'use strict';var multer=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var path=require(_0x9836('0x2'));var timeout=require(_0x9836('0x3'));var express=require(_0x9836('0x4'));var router=express[_0x9836('0x5')]();var fs_extra=require(_0x9836('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9836('0x7'));var config=require('../../config/environment');var controller=require(_0x9836('0x8'));router[_0x9836('0x9')]('/',auth['isAuthenticated'](),controller[_0x9836('0xa')]);router[_0x9836('0x9')]('/:id',auth[_0x9836('0xb')](),controller[_0x9836('0xc')]);router[_0x9836('0xd')]('/',auth[_0x9836('0xb')](),controller['create']);router[_0x9836('0xe')](_0x9836('0xf'),auth[_0x9836('0xb')](),controller[_0x9836('0x10')]);router['delete'](_0x9836('0xf'),auth[_0x9836('0xb')](),controller[_0x9836('0x11')]);module[_0x9836('0x12')]=router; \ No newline at end of file +var _0x1738=['fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','exports','multer','util','express','Router'];(function(_0x5338e1,_0x32d425){var _0x3dba82=function(_0x495578){while(--_0x495578){_0x5338e1['push'](_0x5338e1['shift']());}};_0x3dba82(++_0x32d425);}(_0x1738,0x1bc));var _0x8173=function(_0x2ca668,_0x22a13f){_0x2ca668=_0x2ca668-0x0;var _0x4cf7be=_0x1738[_0x2ca668];return _0x4cf7be;};'use strict';var multer=require(_0x8173('0x0'));var util=require(_0x8173('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8173('0x2'));var router=express[_0x8173('0x3')]();var fs_extra=require(_0x8173('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8173('0x5'));var controller=require(_0x8173('0x6'));router[_0x8173('0x7')]('/',auth[_0x8173('0x8')](),controller[_0x8173('0x9')]);router[_0x8173('0x7')](_0x8173('0xa'),auth[_0x8173('0x8')](),controller[_0x8173('0xb')]);router[_0x8173('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8173('0xd')](_0x8173('0xa'),auth[_0x8173('0x8')](),controller['update']);router['delete'](_0x8173('0xa'),auth[_0x8173('0x8')](),controller[_0x8173('0xe')]);module[_0x8173('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index aadb95d..e49a028 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 _0x7eff=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x317af5,_0x239686){var _0x59ea41=function(_0x29bd78){while(--_0x29bd78){_0x317af5['push'](_0x317af5['shift']());}};_0x59ea41(++_0x239686);}(_0x7eff,0x13e));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf7ef('0x0')]={'type':{'type':Sequelize[_0xf7ef('0x1')]('string',_0xf7ef('0x2'),_0xf7ef('0x3'),_0xf7ef('0x4'),_0xf7ef('0x5')),'defaultValue':_0xf7ef('0x6')},'content':{'type':Sequelize[_0xf7ef('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf7ef('0x6'),_0xf7ef('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xf7ef('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf7ef('0x7')]},'customField':{'type':Sequelize[_0xf7ef('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd101=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0xf8769b,_0xb5b74e){var _0x197c18=function(_0x2a9046){while(--_0x2a9046){_0xf8769b['push'](_0xf8769b['shift']());}};_0x197c18(++_0xb5b74e);}(_0xd101,0x15f));var _0x1d10=function(_0x1a0e6a,_0x2686a8){_0x1a0e6a=_0x1a0e6a-0x0;var _0x49453d=_0xd101[_0x1a0e6a];return _0x49453d;};'use strict';var Sequelize=require(_0x1d10('0x0'));module[_0x1d10('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1d10('0x2'),_0x1d10('0x3'),_0x1d10('0x4'),_0x1d10('0x5'),_0x1d10('0x6')),'defaultValue':_0x1d10('0x2')},'content':{'type':Sequelize[_0x1d10('0x7')]},'key':{'type':Sequelize[_0x1d10('0x7')]},'keyType':{'type':Sequelize[_0x1d10('0x8')]('string','variable',_0x1d10('0x4'))},'keyContent':{'type':Sequelize[_0x1d10('0x7')]},'idField':{'type':Sequelize[_0x1d10('0x7')]},'nameField':{'type':Sequelize[_0x1d10('0x7')]},'customField':{'type':Sequelize[_0x1d10('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1d10('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 6582f6a..97d7bd7 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 _0x5274=['pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','FreshsalesField','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x5274,0xed));var _0x4527=function(_0x5e8fc,_0x1ccc06){_0x5e8fc=_0x5e8fc-0x0;var _0x41c58c=_0x5274[_0x5e8fc];return _0x41c58c;};'use strict';var emlformat=require(_0x4527('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4527('0x1'));var jsonpatch=require(_0x4527('0x2'));var rp=require('request-promise');var moment=require(_0x4527('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4527('0x4'));var path=require('path');var sox=require(_0x4527('0x5'));var csv=require(_0x4527('0x6'));var ejs=require(_0x4527('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4527('0x8'));var jsforce=require(_0x4527('0x9'));var deskjs=require(_0x4527('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4527('0xb'));var Papa=require(_0x4527('0xc'));var Redis=require(_0x4527('0xd'));var authService=require(_0x4527('0xe'));var qs=require(_0x4527('0xf'));var as=require(_0x4527('0x10'));var hardwareService=require(_0x4527('0x11'));var logger=require(_0x4527('0x12'))(_0x4527('0x13'));var utils=require(_0x4527('0x14'));var config=require(_0x4527('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4527('0x16'))['db'];function respondWithStatusCode(_0x2aa9f7,_0x2de012){_0x2de012=_0x2de012||0xcc;return function(_0x31377a){if(_0x31377a){return _0x2aa9f7['sendStatus'](_0x2de012);}return _0x2aa9f7[_0x4527('0x17')](_0x2de012)['end']();};}function respondWithResult(_0x253b89,_0x1e8b9e){_0x1e8b9e=_0x1e8b9e||0xc8;return function(_0x5c9e1c){if(_0x5c9e1c){return _0x253b89[_0x4527('0x17')](_0x1e8b9e)[_0x4527('0x18')](_0x5c9e1c);}};}function respondWithFilteredResult(_0x3216b6,_0x49ff86){return function(_0x4c5a10){if(_0x4c5a10){var _0x18fb4d=typeof _0x49ff86[_0x4527('0x19')]==='undefined'&&typeof _0x49ff86['limit']===_0x4527('0x1a');var _0x5f0242=_0x4c5a10['count'];var _0x4e8c85=_0x18fb4d?0x0:_0x49ff86[_0x4527('0x19')];var _0x3c7548=_0x18fb4d?_0x4c5a10[_0x4527('0x1b')]:_0x49ff86[_0x4527('0x19')]+_0x49ff86[_0x4527('0x1c')];var _0x5c9f4b;if(_0x3c7548>=_0x5f0242){_0x3c7548=_0x5f0242;_0x5c9f4b=0xc8;}else{_0x5c9f4b=0xce;}_0x3216b6[_0x4527('0x17')](_0x5c9f4b);return _0x3216b6[_0x4527('0x1d')](_0x4527('0x1e'),_0x4e8c85+'-'+_0x3c7548+'/'+_0x5f0242)['json'](_0x4c5a10);}return null;};}function patchUpdates(_0x26206d){return function(_0x49d6f6){try{jsonpatch[_0x4527('0x1f')](_0x49d6f6,_0x26206d,!![]);}catch(_0x2c1eca){return BPromise[_0x4527('0x20')](_0x2c1eca);}return _0x49d6f6[_0x4527('0x21')]();};}function saveUpdates(_0x5c54d5,_0x6bd10b){return function(_0x3424fc){if(_0x3424fc){return _0x3424fc[_0x4527('0x22')](_0x5c54d5)[_0x4527('0x23')](function(_0x96986e){return _0x96986e;});}return null;};}function removeEntity(_0x3cce27,_0x1e62bc){return function(_0x4f908d){if(_0x4f908d){return _0x4f908d[_0x4527('0x24')]()['then'](function(){_0x3cce27[_0x4527('0x17')](0xcc)[_0x4527('0x25')]();});}};}function handleEntityNotFound(_0x276667,_0x184670){return function(_0x402717){if(!_0x402717){_0x276667['sendStatus'](0x194);}return _0x402717;};}function handleError(_0x36a285,_0x55b303){_0x55b303=_0x55b303||0x1f4;return function(_0x44cded){logger['error'](_0x44cded[_0x4527('0x26')]);if(_0x44cded[_0x4527('0x27')]){delete _0x44cded[_0x4527('0x27')];}_0x36a285[_0x4527('0x17')](_0x55b303)[_0x4527('0x28')](_0x44cded);};}exports[_0x4527('0x29')]=function(_0x2b7ef9,_0x415d11){var _0x2a17ce={},_0x16a9de={},_0xd34c8e={'count':0x0,'rows':[]};var _0x3d03f6=_['map'](db[_0x4527('0x2a')]['rawAttributes'],function(_0x37587e){return{'name':_0x37587e[_0x4527('0x2b')],'type':_0x37587e[_0x4527('0x2c')][_0x4527('0x2d')]};});_0x16a9de[_0x4527('0x2e')]=_[_0x4527('0x2f')](_0x3d03f6,_0x4527('0x27'));_0x16a9de[_0x4527('0x30')]=_[_0x4527('0x31')](_0x2b7ef9[_0x4527('0x30')]);_0x16a9de['filters']=_[_0x4527('0x32')](_0x16a9de[_0x4527('0x2e')],_0x16a9de['query']);_0x2a17ce[_0x4527('0x33')]=_[_0x4527('0x32')](_0x16a9de[_0x4527('0x2e')],qs[_0x4527('0x34')](_0x2b7ef9['query'][_0x4527('0x34')]));_0x2a17ce[_0x4527('0x33')]=_0x2a17ce[_0x4527('0x33')][_0x4527('0x35')]?_0x2a17ce[_0x4527('0x33')]:_0x16a9de[_0x4527('0x2e')];if(!_0x2b7ef9['query']['hasOwnProperty'](_0x4527('0x36'))){_0x2a17ce[_0x4527('0x1c')]=qs[_0x4527('0x1c')](_0x2b7ef9[_0x4527('0x30')][_0x4527('0x1c')]);_0x2a17ce[_0x4527('0x19')]=qs[_0x4527('0x19')](_0x2b7ef9[_0x4527('0x30')][_0x4527('0x19')]);}_0x2a17ce[_0x4527('0x37')]=qs[_0x4527('0x38')](_0x2b7ef9['query'][_0x4527('0x38')]);_0x2a17ce[_0x4527('0x39')]=qs[_0x4527('0x3a')](_[_0x4527('0x3b')](_0x2b7ef9[_0x4527('0x30')],_0x16a9de[_0x4527('0x3a')]),_0x3d03f6);if(_0x2b7ef9[_0x4527('0x30')][_0x4527('0x3c')]){_0x2a17ce[_0x4527('0x39')]=_[_0x4527('0x3d')](_0x2a17ce[_0x4527('0x39')],{'$or':_['map'](_0x3d03f6,function(_0x1d8fc5){if(_0x1d8fc5[_0x4527('0x2c')]!=='VIRTUAL'){var _0x217639={};_0x217639[_0x1d8fc5[_0x4527('0x27')]]={'$like':'%'+_0x2b7ef9['query'][_0x4527('0x3c')]+'%'};return _0x217639;}})});}_0x2a17ce=_[_0x4527('0x3d')]({},_0x2a17ce,_0x2b7ef9[_0x4527('0x3e')]);var _0x20a704={'where':_0x2a17ce['where']};return db[_0x4527('0x2a')]['count'](_0x20a704)[_0x4527('0x23')](function(_0x31fdbc){_0xd34c8e[_0x4527('0x1b')]=_0x31fdbc;if(_0x2b7ef9[_0x4527('0x30')][_0x4527('0x3f')]){_0x2a17ce[_0x4527('0x40')]=[{'all':!![]}];}return db[_0x4527('0x2a')][_0x4527('0x41')](_0x2a17ce);})[_0x4527('0x23')](function(_0x503456){_0xd34c8e[_0x4527('0x42')]=_0x503456;return _0xd34c8e;})[_0x4527('0x23')](respondWithFilteredResult(_0x415d11,_0x2a17ce))['catch'](handleError(_0x415d11,null));};exports[_0x4527('0x43')]=function(_0x1b07ae,_0x2d397c){var _0x231b55={'raw':!![],'where':{'id':_0x1b07ae[_0x4527('0x44')]['id']}},_0x1f394e={};_0x1f394e['model']=_[_0x4527('0x31')](db[_0x4527('0x2a')][_0x4527('0x45')]);_0x1f394e[_0x4527('0x30')]=_[_0x4527('0x31')](_0x1b07ae[_0x4527('0x30')]);_0x1f394e[_0x4527('0x3a')]=_[_0x4527('0x32')](_0x1f394e[_0x4527('0x2e')],_0x1f394e[_0x4527('0x30')]);_0x231b55[_0x4527('0x33')]=_[_0x4527('0x32')](_0x1f394e[_0x4527('0x2e')],qs[_0x4527('0x34')](_0x1b07ae['query'][_0x4527('0x34')]));_0x231b55['attributes']=_0x231b55[_0x4527('0x33')][_0x4527('0x35')]?_0x231b55[_0x4527('0x33')]:_0x1f394e[_0x4527('0x2e')];if(_0x1b07ae[_0x4527('0x30')][_0x4527('0x3f')]){_0x231b55[_0x4527('0x40')]=[{'all':!![]}];}_0x231b55=_['merge']({},_0x231b55,_0x1b07ae[_0x4527('0x3e')]);return db[_0x4527('0x2a')][_0x4527('0x46')](_0x231b55)[_0x4527('0x23')](handleEntityNotFound(_0x2d397c,null))[_0x4527('0x23')](respondWithResult(_0x2d397c,null))[_0x4527('0x47')](handleError(_0x2d397c,null));};exports['create']=function(_0x495cfb,_0x347f77){return db[_0x4527('0x2a')][_0x4527('0x48')](_0x495cfb[_0x4527('0x49')],{})[_0x4527('0x23')](respondWithResult(_0x347f77,0xc9))['catch'](handleError(_0x347f77,null));};exports[_0x4527('0x22')]=function(_0xed52f5,_0x367625){if(_0xed52f5['body']['id']){delete _0xed52f5[_0x4527('0x49')]['id'];}return db[_0x4527('0x2a')][_0x4527('0x46')]({'where':{'id':_0xed52f5[_0x4527('0x44')]['id']}})[_0x4527('0x23')](handleEntityNotFound(_0x367625,null))[_0x4527('0x23')](saveUpdates(_0xed52f5['body'],null))[_0x4527('0x23')](respondWithResult(_0x367625,null))['catch'](handleError(_0x367625,null));};exports[_0x4527('0x24')]=function(_0x5ba11e,_0x4b952f){return db[_0x4527('0x2a')][_0x4527('0x46')]({'where':{'id':_0x5ba11e[_0x4527('0x44')]['id']}})[_0x4527('0x23')](handleEntityNotFound(_0x4b952f,null))[_0x4527('0x23')](removeEntity(_0x4b952f,null))[_0x4527('0x47')](handleError(_0x4b952f,null));}; \ No newline at end of file +var _0x03fe=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','where','merge','options','FreshsalesField','include','findAll','show','params','fields','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map'];(function(_0x1899dd,_0x7a5f25){var _0x2563eb=function(_0x5238e6){while(--_0x5238e6){_0x1899dd['push'](_0x1899dd['shift']());}};_0x2563eb(++_0x7a5f25);}(_0x03fe,0xa1));var _0xe03f=function(_0x2c7226,_0x29e306){_0x2c7226=_0x2c7226-0x0;var _0x7853d8=_0x03fe[_0x2c7226];return _0x7853d8;};'use strict';var emlformat=require(_0xe03f('0x0'));var rimraf=require(_0xe03f('0x1'));var zipdir=require(_0xe03f('0x2'));var jsonpatch=require(_0xe03f('0x3'));var rp=require(_0xe03f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe03f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe03f('0x6'));var csv=require(_0xe03f('0x7'));var ejs=require(_0xe03f('0x8'));var fs=require('fs');var fs_extra=require(_0xe03f('0x9'));var _=require('lodash');var squel=require(_0xe03f('0xa'));var crypto=require(_0xe03f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe03f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe03f('0xd'));var Papa=require(_0xe03f('0xe'));var Redis=require(_0xe03f('0xf'));var authService=require(_0xe03f('0x10'));var qs=require(_0xe03f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe03f('0x12'))(_0xe03f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe03f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4749d3,_0x2edc23){_0x2edc23=_0x2edc23||0xcc;return function(_0x46edc5){if(_0x46edc5){return _0x4749d3[_0xe03f('0x15')](_0x2edc23);}return _0x4749d3[_0xe03f('0x16')](_0x2edc23)[_0xe03f('0x17')]();};}function respondWithResult(_0xc10066,_0x298dac){_0x298dac=_0x298dac||0xc8;return function(_0x55c472){if(_0x55c472){return _0xc10066[_0xe03f('0x16')](_0x298dac)[_0xe03f('0x18')](_0x55c472);}};}function respondWithFilteredResult(_0x36548d,_0x4f0683){return function(_0x4f0fef){if(_0x4f0fef){var _0x40fd5b=typeof _0x4f0683[_0xe03f('0x19')]===_0xe03f('0x1a')&&typeof _0x4f0683[_0xe03f('0x1b')]===_0xe03f('0x1a');var _0x2cef30=_0x4f0fef[_0xe03f('0x1c')];var _0x485e1e=_0x40fd5b?0x0:_0x4f0683[_0xe03f('0x19')];var _0x40e103=_0x40fd5b?_0x4f0fef[_0xe03f('0x1c')]:_0x4f0683[_0xe03f('0x19')]+_0x4f0683['limit'];var _0x491fda;if(_0x40e103>=_0x2cef30){_0x40e103=_0x2cef30;_0x491fda=0xc8;}else{_0x491fda=0xce;}_0x36548d[_0xe03f('0x16')](_0x491fda);return _0x36548d['set'](_0xe03f('0x1d'),_0x485e1e+'-'+_0x40e103+'/'+_0x2cef30)[_0xe03f('0x18')](_0x4f0fef);}return null;};}function patchUpdates(_0xba33ce){return function(_0x1ce198){try{jsonpatch[_0xe03f('0x1e')](_0x1ce198,_0xba33ce,!![]);}catch(_0xe82b5c){return BPromise['reject'](_0xe82b5c);}return _0x1ce198[_0xe03f('0x1f')]();};}function saveUpdates(_0x35901f,_0x2b5d01){return function(_0x5f0dc2){if(_0x5f0dc2){return _0x5f0dc2[_0xe03f('0x20')](_0x35901f)[_0xe03f('0x21')](function(_0x47aa79){return _0x47aa79;});}return null;};}function removeEntity(_0x569041,_0x2b7458){return function(_0x50c9e6){if(_0x50c9e6){return _0x50c9e6[_0xe03f('0x22')]()['then'](function(){_0x569041[_0xe03f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33e05b,_0x20f8aa){return function(_0x21f1f7){if(!_0x21f1f7){_0x33e05b[_0xe03f('0x15')](0x194);}return _0x21f1f7;};}function handleError(_0x57d4cb,_0x43ab0d){_0x43ab0d=_0x43ab0d||0x1f4;return function(_0xf55bc6){logger['error'](_0xf55bc6[_0xe03f('0x23')]);if(_0xf55bc6[_0xe03f('0x24')]){delete _0xf55bc6[_0xe03f('0x24')];}_0x57d4cb[_0xe03f('0x16')](_0x43ab0d)[_0xe03f('0x25')](_0xf55bc6);};}exports[_0xe03f('0x26')]=function(_0x52d55e,_0x187f83){var _0x1076f5={},_0x59853b={},_0x268de1={'count':0x0,'rows':[]};var _0x3e56e9=_[_0xe03f('0x27')](db['FreshsalesField'][_0xe03f('0x28')],function(_0x5792ed){return{'name':_0x5792ed[_0xe03f('0x29')],'type':_0x5792ed[_0xe03f('0x2a')][_0xe03f('0x2b')]};});_0x59853b[_0xe03f('0x2c')]=_[_0xe03f('0x27')](_0x3e56e9,_0xe03f('0x24'));_0x59853b[_0xe03f('0x2d')]=_[_0xe03f('0x2e')](_0x52d55e[_0xe03f('0x2d')]);_0x59853b[_0xe03f('0x2f')]=_[_0xe03f('0x30')](_0x59853b[_0xe03f('0x2c')],_0x59853b[_0xe03f('0x2d')]);_0x1076f5[_0xe03f('0x31')]=_['intersection'](_0x59853b['model'],qs['fields'](_0x52d55e['query']['fields']));_0x1076f5[_0xe03f('0x31')]=_0x1076f5['attributes'][_0xe03f('0x32')]?_0x1076f5[_0xe03f('0x31')]:_0x59853b[_0xe03f('0x2c')];if(!_0x52d55e[_0xe03f('0x2d')]['hasOwnProperty'](_0xe03f('0x33'))){_0x1076f5[_0xe03f('0x1b')]=qs[_0xe03f('0x1b')](_0x52d55e[_0xe03f('0x2d')][_0xe03f('0x1b')]);_0x1076f5[_0xe03f('0x19')]=qs[_0xe03f('0x19')](_0x52d55e['query']['offset']);}_0x1076f5[_0xe03f('0x34')]=qs['sort'](_0x52d55e[_0xe03f('0x2d')][_0xe03f('0x35')]);_0x1076f5['where']=qs[_0xe03f('0x2f')](_['pick'](_0x52d55e[_0xe03f('0x2d')],_0x59853b[_0xe03f('0x2f')]),_0x3e56e9);if(_0x52d55e[_0xe03f('0x2d')][_0xe03f('0x36')]){_0x1076f5[_0xe03f('0x37')]=_[_0xe03f('0x38')](_0x1076f5[_0xe03f('0x37')],{'$or':_[_0xe03f('0x27')](_0x3e56e9,function(_0x4c1e2c){if(_0x4c1e2c[_0xe03f('0x2a')]!=='VIRTUAL'){var _0x4a1203={};_0x4a1203[_0x4c1e2c[_0xe03f('0x24')]]={'$like':'%'+_0x52d55e['query'][_0xe03f('0x36')]+'%'};return _0x4a1203;}})});}_0x1076f5=_[_0xe03f('0x38')]({},_0x1076f5,_0x52d55e[_0xe03f('0x39')]);var _0x5a1039={'where':_0x1076f5[_0xe03f('0x37')]};return db[_0xe03f('0x3a')][_0xe03f('0x1c')](_0x5a1039)[_0xe03f('0x21')](function(_0x539547){_0x268de1[_0xe03f('0x1c')]=_0x539547;if(_0x52d55e[_0xe03f('0x2d')]['includeAll']){_0x1076f5[_0xe03f('0x3b')]=[{'all':!![]}];}return db['FreshsalesField'][_0xe03f('0x3c')](_0x1076f5);})[_0xe03f('0x21')](function(_0x6499f){_0x268de1['rows']=_0x6499f;return _0x268de1;})[_0xe03f('0x21')](respondWithFilteredResult(_0x187f83,_0x1076f5))['catch'](handleError(_0x187f83,null));};exports[_0xe03f('0x3d')]=function(_0xa05d2c,_0x328e3e){var _0x3cbad3={'raw':!![],'where':{'id':_0xa05d2c[_0xe03f('0x3e')]['id']}},_0x907c45={};_0x907c45[_0xe03f('0x2c')]=_[_0xe03f('0x2e')](db[_0xe03f('0x3a')][_0xe03f('0x28')]);_0x907c45[_0xe03f('0x2d')]=_[_0xe03f('0x2e')](_0xa05d2c[_0xe03f('0x2d')]);_0x907c45[_0xe03f('0x2f')]=_[_0xe03f('0x30')](_0x907c45[_0xe03f('0x2c')],_0x907c45[_0xe03f('0x2d')]);_0x3cbad3[_0xe03f('0x31')]=_[_0xe03f('0x30')](_0x907c45['model'],qs[_0xe03f('0x3f')](_0xa05d2c['query'][_0xe03f('0x3f')]));_0x3cbad3[_0xe03f('0x31')]=_0x3cbad3[_0xe03f('0x31')][_0xe03f('0x32')]?_0x3cbad3[_0xe03f('0x31')]:_0x907c45[_0xe03f('0x2c')];if(_0xa05d2c[_0xe03f('0x2d')]['includeAll']){_0x3cbad3[_0xe03f('0x3b')]=[{'all':!![]}];}_0x3cbad3=_[_0xe03f('0x38')]({},_0x3cbad3,_0xa05d2c['options']);return db[_0xe03f('0x3a')][_0xe03f('0x40')](_0x3cbad3)['then'](handleEntityNotFound(_0x328e3e,null))[_0xe03f('0x21')](respondWithResult(_0x328e3e,null))[_0xe03f('0x41')](handleError(_0x328e3e,null));};exports['create']=function(_0x313bc0,_0x547007){return db[_0xe03f('0x3a')]['create'](_0x313bc0[_0xe03f('0x42')],{})[_0xe03f('0x21')](respondWithResult(_0x547007,0xc9))[_0xe03f('0x41')](handleError(_0x547007,null));};exports['update']=function(_0x5f4dc2,_0x4c9f52){if(_0x5f4dc2[_0xe03f('0x42')]['id']){delete _0x5f4dc2[_0xe03f('0x42')]['id'];}return db['FreshsalesField'][_0xe03f('0x40')]({'where':{'id':_0x5f4dc2['params']['id']}})[_0xe03f('0x21')](handleEntityNotFound(_0x4c9f52,null))[_0xe03f('0x21')](saveUpdates(_0x5f4dc2[_0xe03f('0x42')],null))['then'](respondWithResult(_0x4c9f52,null))[_0xe03f('0x41')](handleError(_0x4c9f52,null));};exports[_0xe03f('0x22')]=function(_0x470853,_0x5834d4){return db[_0xe03f('0x3a')][_0xe03f('0x40')]({'where':{'id':_0x470853['params']['id']}})['then'](handleEntityNotFound(_0x5834d4,null))[_0xe03f('0x21')](removeEntity(_0x5834d4,null))[_0xe03f('0x41')](handleError(_0x5834d4,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index dc03362..cba0a6b 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 _0x2cf5=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise'];(function(_0x44ba19,_0x4f829d){var _0x56f6ee=function(_0xf692b8){while(--_0xf692b8){_0x44ba19['push'](_0x44ba19['shift']());}};_0x56f6ee(++_0x4f829d);}(_0x2cf5,0x19f));var _0x52cf=function(_0x1e348f,_0x2ca195){_0x1e348f=_0x1e348f-0x0;var _0xd427cf=_0x2cf5[_0x1e348f];return _0xd427cf;};'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('0xc'),_0x52cf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x186d=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x186d,0x1ca));var _0xd186=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x186d[_0x595bd1];return _0xd0344f;};'use strict';var _=require('lodash');var util=require(_0xd186('0x0'));var logger=require(_0xd186('0x1'))(_0xd186('0x2'));var moment=require(_0xd186('0x3'));var BPromise=require(_0xd186('0x4'));var rp=require(_0xd186('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd186('0x6'));var config=require(_0xd186('0x7'));var attributes=require(_0xd186('0x8'));module['exports']=function(_0x5312dd,_0x410c23){return _0x5312dd[_0xd186('0x9')](_0xd186('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xd186('0xb'),'fields':[_0xd186('0xc'),_0xd186('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 214b9fe..7f60259 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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x937c25,_0x1ead67){var _0x4fe3c5=function(_0x3a1c87){while(--_0x3a1c87){_0x937c25['push'](_0x937c25['shift']());}};_0x4fe3c5(++_0x1ead67);}(_0xeff8,0x186));var _0x8eff=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xeff8[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file +var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x216338,_0x23b8a8){var _0x5da776=function(_0x48e7d1){while(--_0x48e7d1){_0x216338['push'](_0x216338['shift']());}};_0x5da776(++_0x23b8a8);}(_0x1883,0xab));var _0x3188=function(_0x29560f,_0x1621cc){_0x29560f=_0x29560f-0x0;var _0x49606e=_0x1883[_0x29560f];return _0x49606e;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 686a55a..f2a6efc 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(_0x17dce7,_0x3a6875){var _0x1387e1=function(_0x7423f3){while(--_0x7423f3){_0x17dce7['push'](_0x17dce7['shift']());}};_0x1387e1(++_0x3a6875);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x46e188,_0x1585f7){var _0x55a640=function(_0xa6acc){while(--_0xa6acc){_0x46e188['push'](_0x46e188['shift']());}};_0x55a640(++_0x1585f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 ceda3e6..3760abb 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 _0x1a05=['username','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x1e5465,_0x2486a3){var _0x33b150=function(_0x42c63e){while(--_0x42c63e){_0x1e5465['push'](_0x1e5465['shift']());}};_0x33b150(++_0x2486a3);}(_0x1a05,0x153));var _0x51a0=function(_0x4d1c53,_0x1a05d9){_0x4d1c53=_0x4d1c53-0x0;var _0xeb6be3=_0x1a05[_0x4d1c53];return _0xeb6be3;};'use strict';var Sequelize=require(_0x51a0('0x0'));module[_0x51a0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x51a0('0x2')]},'username':{'type':Sequelize[_0x51a0('0x2')],'unique':_0x51a0('0x3')},'remoteUri':{'type':Sequelize[_0x51a0('0x2')]},'password':{'type':Sequelize[_0x51a0('0x2')]},'clientId':{'type':Sequelize[_0x51a0('0x2')]},'clientSecret':{'type':Sequelize[_0x51a0('0x2')]},'securityToken':{'type':Sequelize[_0x51a0('0x2')]},'serverUrl':{'type':Sequelize[_0x51a0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x51a0('0x4'),_0x51a0('0x5')),'defaultValue':_0x51a0('0x4')}}; \ No newline at end of file +var _0xb9c6=['exports','STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x158caa,_0x2d7c62){var _0x55e493=function(_0x11ed28){while(--_0x11ed28){_0x158caa['push'](_0x158caa['shift']());}};_0x55e493(++_0x2d7c62);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x33f153,_0x39d65d){_0x33f153=_0x33f153-0x0;var _0x12ac15=_0xb9c6[_0x33f153];return _0x12ac15;};'use strict';var Sequelize=require(_0x6b9c('0x0'));module[_0x6b9c('0x1')]={'name':{'type':Sequelize[_0x6b9c('0x2')]},'description':{'type':Sequelize[_0x6b9c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6b9c('0x3')},'remoteUri':{'type':Sequelize[_0x6b9c('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x6b9c('0x2')]},'serverUrl':{'type':Sequelize[_0x6b9c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6b9c('0x4')]('integrationTab',_0x6b9c('0x5')),'defaultValue':_0x6b9c('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 31741da..98f32cd 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 _0x4bcb=['send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','set','reject','save','then','end','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','destroy','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','lastIndexOf','Connection','clientSecret','login','password','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','textarea','phone','remove','includes','custom','picklistValues','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1bca7f,_0x2c06fd){var _0x5822f7=function(_0x3c6f42){while(--_0x3c6f42){_0x1bca7f['push'](_0x1bca7f['shift']());}};_0x5822f7(++_0x2c06fd);}(_0x4bcb,0x1ea));var _0xb4bc=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x4bcb[_0x8ae98b];return _0xc30bd4;};'use strict';var emlformat=require(_0xb4bc('0x0'));var rimraf=require(_0xb4bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4bc('0x2'));var rp=require(_0xb4bc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb4bc('0x4'));var util=require(_0xb4bc('0x5'));var path=require(_0xb4bc('0x6'));var sox=require('sox');var csv=require(_0xb4bc('0x7'));var ejs=require(_0xb4bc('0x8'));var fs=require('fs');var fs_extra=require(_0xb4bc('0x9'));var _=require(_0xb4bc('0xa'));var squel=require('squel');var crypto=require(_0xb4bc('0xb'));var jsforce=require(_0xb4bc('0xc'));var deskjs=require(_0xb4bc('0xd'));var toCsv=require(_0xb4bc('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb4bc('0xe'));var authService=require(_0xb4bc('0xf'));var qs=require(_0xb4bc('0x10'));var as=require(_0xb4bc('0x11'));var hardwareService=require(_0xb4bc('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb4bc('0x13'));var config=require(_0xb4bc('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4bc('0x15'))['db'];var integrations=require(_0xb4bc('0x16'));function respondWithStatusCode(_0x2156b4,_0x5f35ae){_0x5f35ae=_0x5f35ae||0xcc;return function(_0x431acc){if(_0x431acc){return _0x2156b4[_0xb4bc('0x17')](_0x5f35ae);}return _0x2156b4[_0xb4bc('0x18')](_0x5f35ae)['end']();};}function respondWithResult(_0x75f542,_0x439c15){_0x439c15=_0x439c15||0xc8;return function(_0x3ae509){if(_0x3ae509){return _0x75f542[_0xb4bc('0x18')](_0x439c15)[_0xb4bc('0x19')](_0x3ae509);}};}function respondWithFilteredResult(_0x595bc3,_0x35e094){return function(_0x40dba0){if(_0x40dba0){var _0xbd1368=typeof _0x35e094[_0xb4bc('0x1a')]==='undefined'&&typeof _0x35e094['limit']==='undefined';var _0x9279dc=_0x40dba0['count'];var _0x5e94fd=_0xbd1368?0x0:_0x35e094[_0xb4bc('0x1a')];var _0x55c9c3=_0xbd1368?_0x40dba0['count']:_0x35e094['offset']+_0x35e094[_0xb4bc('0x1b')];var _0x489010;if(_0x55c9c3>=_0x9279dc){_0x55c9c3=_0x9279dc;_0x489010=0xc8;}else{_0x489010=0xce;}_0x595bc3[_0xb4bc('0x18')](_0x489010);return _0x595bc3[_0xb4bc('0x1c')]('Content-Range',_0x5e94fd+'-'+_0x55c9c3+'/'+_0x9279dc)[_0xb4bc('0x19')](_0x40dba0);}return null;};}function patchUpdates(_0x3e9d95){return function(_0x5724c3){try{jsonpatch['apply'](_0x5724c3,_0x3e9d95,!![]);}catch(_0x301b38){return BPromise[_0xb4bc('0x1d')](_0x301b38);}return _0x5724c3[_0xb4bc('0x1e')]();};}function saveUpdates(_0x24d342,_0x4de510){return function(_0x4239aa){if(_0x4239aa){return _0x4239aa['update'](_0x24d342)[_0xb4bc('0x1f')](function(_0x3f492a){return _0x3f492a;});}return null;};}function removeEntity(_0x32c7f6,_0x44b76b){return function(_0x45752c){if(_0x45752c){return _0x45752c['destroy']()[_0xb4bc('0x1f')](function(){_0x32c7f6[_0xb4bc('0x18')](0xcc)[_0xb4bc('0x20')]();});}};}function handleEntityNotFound(_0x148561,_0x18a9d8){return function(_0x3afc3e){if(!_0x3afc3e){_0x148561[_0xb4bc('0x17')](0x194);}return _0x3afc3e;};}function handleError(_0x301217,_0x5c56e6){_0x5c56e6=_0x5c56e6||0x1f4;return function(_0xbb0852){logger['error'](_0xbb0852[_0xb4bc('0x21')]);if(_0xbb0852[_0xb4bc('0x22')]){delete _0xbb0852[_0xb4bc('0x22')];}_0x301217[_0xb4bc('0x18')](_0x5c56e6)['send'](_0xbb0852);};}exports[_0xb4bc('0x23')]=function(_0x269a92,_0x559edc){var _0x1f183a={},_0xa30735={},_0x498136={'count':0x0,'rows':[]};var _0x16760f=_[_0xb4bc('0x24')](db[_0xb4bc('0x25')][_0xb4bc('0x26')],function(_0x525e10){return{'name':_0x525e10[_0xb4bc('0x27')],'type':_0x525e10[_0xb4bc('0x28')]['key']};});_0xa30735[_0xb4bc('0x29')]=_[_0xb4bc('0x24')](_0x16760f,_0xb4bc('0x22'));_0xa30735[_0xb4bc('0x2a')]=_[_0xb4bc('0x2b')](_0x269a92[_0xb4bc('0x2a')]);_0xa30735[_0xb4bc('0x2c')]=_[_0xb4bc('0x2d')](_0xa30735[_0xb4bc('0x29')],_0xa30735[_0xb4bc('0x2a')]);_0x1f183a[_0xb4bc('0x2e')]=_['intersection'](_0xa30735[_0xb4bc('0x29')],qs[_0xb4bc('0x2f')](_0x269a92['query'][_0xb4bc('0x2f')]));_0x1f183a[_0xb4bc('0x2e')]=_0x1f183a['attributes'][_0xb4bc('0x30')]?_0x1f183a['attributes']:_0xa30735[_0xb4bc('0x29')];if(!_0x269a92[_0xb4bc('0x2a')][_0xb4bc('0x31')]('nolimit')){_0x1f183a[_0xb4bc('0x1b')]=qs[_0xb4bc('0x1b')](_0x269a92[_0xb4bc('0x2a')]['limit']);_0x1f183a[_0xb4bc('0x1a')]=qs[_0xb4bc('0x1a')](_0x269a92['query'][_0xb4bc('0x1a')]);}_0x1f183a['order']=qs[_0xb4bc('0x32')](_0x269a92['query'][_0xb4bc('0x32')]);_0x1f183a[_0xb4bc('0x33')]=qs[_0xb4bc('0x2c')](_[_0xb4bc('0x34')](_0x269a92[_0xb4bc('0x2a')],_0xa30735[_0xb4bc('0x2c')]),_0x16760f);if(_0x269a92[_0xb4bc('0x2a')][_0xb4bc('0x35')]){_0x1f183a[_0xb4bc('0x33')]=_[_0xb4bc('0x36')](_0x1f183a[_0xb4bc('0x33')],{'$or':_[_0xb4bc('0x24')](_0x16760f,function(_0x5a76bc){if(_0x5a76bc[_0xb4bc('0x28')]!=='VIRTUAL'){var _0x537396={};_0x537396[_0x5a76bc['name']]={'$like':'%'+_0x269a92[_0xb4bc('0x2a')]['filter']+'%'};return _0x537396;}})});}_0x1f183a=_[_0xb4bc('0x36')]({},_0x1f183a,_0x269a92['options']);var _0x246ff6={'where':_0x1f183a[_0xb4bc('0x33')]};return db[_0xb4bc('0x25')]['count'](_0x246ff6)['then'](function(_0x3570a1){_0x498136[_0xb4bc('0x37')]=_0x3570a1;if(_0x269a92[_0xb4bc('0x2a')][_0xb4bc('0x38')]){_0x1f183a[_0xb4bc('0x39')]=[{'all':!![]}];}return db[_0xb4bc('0x25')][_0xb4bc('0x3a')](_0x1f183a);})['then'](function(_0x16c6bc){_0x498136[_0xb4bc('0x3b')]=_0x16c6bc;return _0x498136;})[_0xb4bc('0x1f')](respondWithFilteredResult(_0x559edc,_0x1f183a))[_0xb4bc('0x3c')](handleError(_0x559edc,null));};exports[_0xb4bc('0x3d')]=function(_0x2a62fc,_0x36e322){var _0x1f06ee={'raw':![],'where':{'id':_0x2a62fc['params']['id']}},_0x55bb34={};_0x55bb34[_0xb4bc('0x29')]=_[_0xb4bc('0x2b')](db['SalesforceAccount'][_0xb4bc('0x26')]);_0x55bb34['query']=_[_0xb4bc('0x2b')](_0x2a62fc[_0xb4bc('0x2a')]);_0x55bb34['filters']=_[_0xb4bc('0x2d')](_0x55bb34[_0xb4bc('0x29')],_0x55bb34[_0xb4bc('0x2a')]);_0x1f06ee[_0xb4bc('0x2e')]=_[_0xb4bc('0x2d')](_0x55bb34[_0xb4bc('0x29')],qs['fields'](_0x2a62fc['query'][_0xb4bc('0x2f')]));_0x1f06ee[_0xb4bc('0x2e')]=_0x1f06ee[_0xb4bc('0x2e')][_0xb4bc('0x30')]?_0x1f06ee[_0xb4bc('0x2e')]:_0x55bb34[_0xb4bc('0x29')];if(_0x2a62fc[_0xb4bc('0x2a')]['includeAll']){_0x1f06ee['include']=[{'all':!![]}];}_0x1f06ee=_[_0xb4bc('0x36')]({},_0x1f06ee,_0x2a62fc[_0xb4bc('0x3e')]);return db[_0xb4bc('0x25')][_0xb4bc('0x3f')](_0x1f06ee)[_0xb4bc('0x1f')](handleEntityNotFound(_0x36e322,null))['then'](respondWithResult(_0x36e322,null))[_0xb4bc('0x3c')](handleError(_0x36e322,null));};exports[_0xb4bc('0x40')]=function(_0x157abe,_0x1d2bde){return db['SalesforceAccount'][_0xb4bc('0x40')](_0x157abe[_0xb4bc('0x41')],{})[_0xb4bc('0x1f')](respondWithResult(_0x1d2bde,0xc9))[_0xb4bc('0x3c')](handleError(_0x1d2bde,null));};exports[_0xb4bc('0x42')]=function(_0x1906f4,_0x3005d6){if(_0x1906f4[_0xb4bc('0x41')]['id']){delete _0x1906f4[_0xb4bc('0x41')]['id'];}return db[_0xb4bc('0x25')][_0xb4bc('0x3f')]({'where':{'id':_0x1906f4[_0xb4bc('0x43')]['id']}})[_0xb4bc('0x1f')](handleEntityNotFound(_0x3005d6,null))[_0xb4bc('0x1f')](saveUpdates(_0x1906f4[_0xb4bc('0x41')],null))[_0xb4bc('0x1f')](respondWithResult(_0x3005d6,null))[_0xb4bc('0x3c')](handleError(_0x3005d6,null));};exports[_0xb4bc('0x44')]=function(_0x3558b4,_0x5edfce){return db[_0xb4bc('0x25')][_0xb4bc('0x3f')]({'where':{'id':_0x3558b4[_0xb4bc('0x43')]['id']}})[_0xb4bc('0x1f')](handleEntityNotFound(_0x5edfce,null))[_0xb4bc('0x1f')](removeEntity(_0x5edfce,null))['catch'](handleError(_0x5edfce,null));};exports[_0xb4bc('0x45')]=function(_0x3d1a98,_0x29a869,_0x3a5ed7){var _0x114e89={};var _0x5b3273={};var _0x5ec60e;var _0xbe3eb4;return db[_0xb4bc('0x25')][_0xb4bc('0x46')]({'where':{'id':_0x3d1a98[_0xb4bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x29a869,null))[_0xb4bc('0x1f')](function(_0x528315){if(_0x528315){_0x5ec60e=_0x528315;_0x5b3273['model']=_[_0xb4bc('0x2b')](db[_0xb4bc('0x47')][_0xb4bc('0x26')]);_0x5b3273[_0xb4bc('0x2a')]=_['keys'](_0x3d1a98[_0xb4bc('0x2a')]);_0x5b3273['filters']=_[_0xb4bc('0x2d')](_0x5b3273[_0xb4bc('0x29')],_0x5b3273[_0xb4bc('0x2a')]);_0x114e89[_0xb4bc('0x2e')]=_[_0xb4bc('0x2d')](_0x5b3273['model'],qs[_0xb4bc('0x2f')](_0x3d1a98['query'][_0xb4bc('0x2f')]));_0x114e89[_0xb4bc('0x2e')]=_0x114e89[_0xb4bc('0x2e')][_0xb4bc('0x30')]?_0x114e89[_0xb4bc('0x2e')]:_0x5b3273[_0xb4bc('0x29')];_0x114e89[_0xb4bc('0x48')]=qs[_0xb4bc('0x32')](_0x3d1a98[_0xb4bc('0x2a')]['sort']);_0x114e89[_0xb4bc('0x33')]=qs['filters'](_[_0xb4bc('0x34')](_0x3d1a98['query'],_0x5b3273[_0xb4bc('0x2c')]));if(_0x3d1a98[_0xb4bc('0x2a')][_0xb4bc('0x35')]){_0x114e89[_0xb4bc('0x33')]=_[_0xb4bc('0x36')](_0x114e89[_0xb4bc('0x33')],{'$or':_['map'](_0x114e89[_0xb4bc('0x2e')],function(_0x333718){var _0x2aea02={};_0x2aea02[_0x333718]={'$like':'%'+_0x3d1a98[_0xb4bc('0x2a')][_0xb4bc('0x35')]+'%'};return _0x2aea02;})});}_0x114e89=_['merge']({},_0x114e89,_0x3d1a98[_0xb4bc('0x3e')]);return _0x5ec60e['getConfigurations'](_0x114e89);}})[_0xb4bc('0x1f')](function(_0x229617){if(_0x229617){_0xbe3eb4=_0x229617['length'];if(!_0x3d1a98['query'][_0xb4bc('0x31')]('nolimit')){_0x114e89[_0xb4bc('0x1b')]=qs['limit'](_0x3d1a98['query']['limit']);_0x114e89[_0xb4bc('0x1a')]=qs[_0xb4bc('0x1a')](_0x3d1a98[_0xb4bc('0x2a')][_0xb4bc('0x1a')]);}return _0x5ec60e[_0xb4bc('0x45')](_0x114e89);}})['then'](function(_0x8eb0a8){if(_0x8eb0a8){return _0x8eb0a8?{'count':_0xbe3eb4,'rows':_0x8eb0a8}:null;}})[_0xb4bc('0x1f')](respondWithResult(_0x29a869,null))[_0xb4bc('0x3c')](handleError(_0x29a869,null));};exports[_0xb4bc('0x49')]=function(_0x2df466,_0x20f7b1,_0x4ba1cd){if(_0x2df466[_0xb4bc('0x41')]['id']){delete _0x2df466[_0xb4bc('0x41')]['id'];}return db[_0xb4bc('0x25')][_0xb4bc('0x46')]({'where':{'id':_0x2df466[_0xb4bc('0x43')]['id']}})[_0xb4bc('0x1f')](handleEntityNotFound(_0x20f7b1,null))[_0xb4bc('0x1f')](function(_0x2a6310){if(_0x2a6310){_0x2df466['body'][_0xb4bc('0x4a')]=_0x2a6310['id'];_0x2df466[_0xb4bc('0x41')][_0xb4bc('0x4b')]=integrations[_0xb4bc('0x4c')](_0x2df466[_0xb4bc('0x41')][_0xb4bc('0x4d')],_0x2df466[_0xb4bc('0x41')][_0xb4bc('0x28')]);_0x2df466[_0xb4bc('0x41')][_0xb4bc('0x4e')]=integrations[_0xb4bc('0x4f')](_0x2df466['body'][_0xb4bc('0x4d')],_0x2df466[_0xb4bc('0x41')][_0xb4bc('0x28')]);return db['SalesforceConfiguration']['create'](_0x2df466[_0xb4bc('0x41')],{'include':[{'model':db[_0xb4bc('0x50')],'as':_0xb4bc('0x4b')},{'model':db[_0xb4bc('0x50')],'as':_0xb4bc('0x4e')}]});}return null;})[_0xb4bc('0x1f')](respondWithResult(_0x20f7b1,null))['catch'](handleError(_0x20f7b1,null));};exports[_0xb4bc('0x51')]=function(_0x4be368,_0x527e64,_0x263584){var _0x5f52f7;var _0x1cdf52='';var _0x35c941=_0xb4bc('0x52');return db[_0xb4bc('0x25')][_0xb4bc('0x46')]({'where':{'id':_0x4be368['params']['id']},'attributes':['id',_0xb4bc('0x53'),_0xb4bc('0x54'),'clientSecret',_0xb4bc('0x55'),'password','securityToken']})[_0xb4bc('0x1f')](handleEntityNotFound(_0x527e64,null))['then'](function(_0x15b761){if(_0x15b761){_0x1cdf52=_0x15b761[_0xb4bc('0x53')];var _0x1b4d24=_0x1cdf52['slice'](-0x1);if(_0x1b4d24==='/'){_0x1cdf52=_0x1cdf52['substring'](0x0,_0x1cdf52[_0xb4bc('0x56')](_0x1b4d24));}_0x5f52f7=new jsforce[(_0xb4bc('0x57'))]({'oauth2':{'loginUrl':_0x1cdf52,'clientId':_0x15b761[_0xb4bc('0x54')],'clientSecret':_0x15b761[_0xb4bc('0x58')]}});return _0x5f52f7[_0xb4bc('0x59')](_0x15b761[_0xb4bc('0x55')],_0x15b761[_0xb4bc('0x5a')][_0xb4bc('0x5b')](_0x15b761[_0xb4bc('0x5c')]));}})['then'](function(_0x53d120){if(_0x53d120){if(!_[_0xb4bc('0x5d')](_0x4be368[_0xb4bc('0x2a')][_0xb4bc('0x5e')])){_0x35c941=_0x4be368['query'][_0xb4bc('0x5e')];}return _0x5f52f7[_0xb4bc('0x5f')](_0x35c941)[_0xb4bc('0x60')]();}})[_0xb4bc('0x1f')](function(_0x37d3c6){var _0x2b1fc0=[_0xb4bc('0x61'),_0xb4bc('0x62'),_0xb4bc('0x63'),_0xb4bc('0x64'),_0xb4bc('0x65'),_0xb4bc('0x66')];var _0x2b46d1=[_0xb4bc('0x67'),_0xb4bc('0x68'),_0xb4bc('0x69'),'boolean','email',_0xb4bc('0x6a'),_0xb4bc('0x6b')];if(_0x37d3c6){_[_0xb4bc('0x6c')](_0x37d3c6['fields'],function(_0x1b03d2){return _0x2b1fc0[_0xb4bc('0x6d')](_0x1b03d2[_0xb4bc('0x22')])||!_0x2b46d1[_0xb4bc('0x6d')](_0x1b03d2[_0xb4bc('0x28')]);});return{'count':_0x37d3c6['fields'][_0xb4bc('0x30')],'rows':_[_0xb4bc('0x24')](_0x37d3c6[_0xb4bc('0x2f')],function(_0x31c3a1){return{'id':_0x31c3a1['name'],'name':_0x31c3a1['label'],'custom':_0x31c3a1[_0xb4bc('0x6e')],'options':_0x31c3a1[_0xb4bc('0x6f')][_0xb4bc('0x30')]>0x0?_['map'](_0x31c3a1[_0xb4bc('0x6f')],function(_0x3c1253){return{'name':_0x3c1253['label'],'value':_0x3c1253['value']};}):_0x31c3a1[_0xb4bc('0x28')]=='boolean'?[{'name':'True','value':_0xb4bc('0x70')},{'name':_0xb4bc('0x71'),'value':_0xb4bc('0x72')}]:[]};})};}})[_0xb4bc('0x1f')](respondWithResult(_0x527e64,null))['catch'](function(_0x5e34c0){var _0x3e12ce=_0x4be368[_0xb4bc('0x2a')][_0xb4bc('0x73')]?0x1f4:_0x5e34c0[_0xb4bc('0x74')]||0x1f4;logger[_0xb4bc('0x75')](_0xb4bc('0x76'),_0xb4bc('0x51'),_0x3e12ce,JSON[_0xb4bc('0x77')](_0x5e34c0));delete _0x5e34c0[_0xb4bc('0x22')];if(_0x3e12ce===0x191){_0x3e12ce=0x190;}_0x527e64[_0xb4bc('0x18')](_0x3e12ce)[_0xb4bc('0x78')](_0x4be368[_0xb4bc('0x2a')][_0xb4bc('0x73')]?{'message':_0xb4bc('0x79'),'statusCode':_0x5e34c0[_0xb4bc('0x74')]}:_0x5e34c0);});}; \ No newline at end of file +var _0xcc2a=['keys','rawAttributes','find','create','body','getConfigurations','SalesforceConfiguration','order','pick','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','clientId','clientSecret','password','slice','substring','lastIndexOf','securityToken','ticketType','sobject','OwnerId','ActivityDate','Description','string','int','picklist','boolean','email','remove','includes','label','custom','picklistValues','value','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','SalesforceAccount','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc2a,0x123));var _0xacc2=function(_0x4f7464,_0xc6fe4){_0x4f7464=_0x4f7464-0x0;var _0x1f82f1=_0xcc2a[_0x4f7464];return _0x1f82f1;};'use strict';var emlformat=require(_0xacc2('0x0'));var rimraf=require(_0xacc2('0x1'));var zipdir=require(_0xacc2('0x2'));var jsonpatch=require(_0xacc2('0x3'));var rp=require('request-promise');var moment=require(_0xacc2('0x4'));var BPromise=require(_0xacc2('0x5'));var Mustache=require('mustache');var util=require(_0xacc2('0x6'));var path=require(_0xacc2('0x7'));var sox=require(_0xacc2('0x8'));var csv=require(_0xacc2('0x9'));var ejs=require(_0xacc2('0xa'));var fs=require('fs');var fs_extra=require(_0xacc2('0xb'));var _=require(_0xacc2('0xc'));var squel=require(_0xacc2('0xd'));var crypto=require('crypto');var jsforce=require(_0xacc2('0xe'));var deskjs=require(_0xacc2('0xf'));var toCsv=require(_0xacc2('0x9'));var querystring=require(_0xacc2('0x10'));var Papa=require(_0xacc2('0x11'));var Redis=require(_0xacc2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xacc2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacc2('0x14'));var logger=require(_0xacc2('0x15'))(_0xacc2('0x16'));var utils=require(_0xacc2('0x17'));var config=require(_0xacc2('0x18'));var licenseUtil=require(_0xacc2('0x19'));var db=require(_0xacc2('0x1a'))['db'];var integrations=require(_0xacc2('0x1b'));function respondWithStatusCode(_0x15d529,_0x2453d7){_0x2453d7=_0x2453d7||0xcc;return function(_0x39c25f){if(_0x39c25f){return _0x15d529[_0xacc2('0x1c')](_0x2453d7);}return _0x15d529[_0xacc2('0x1d')](_0x2453d7)[_0xacc2('0x1e')]();};}function respondWithResult(_0x494ed8,_0x181e2a){_0x181e2a=_0x181e2a||0xc8;return function(_0x284cd7){if(_0x284cd7){return _0x494ed8['status'](_0x181e2a)['json'](_0x284cd7);}};}function respondWithFilteredResult(_0x2aac6d,_0x2cd700){return function(_0x3addf0){if(_0x3addf0){var _0x27f4db=typeof _0x2cd700[_0xacc2('0x1f')]===_0xacc2('0x20')&&typeof _0x2cd700[_0xacc2('0x21')]===_0xacc2('0x20');var _0x48abc8=_0x3addf0[_0xacc2('0x22')];var _0x6d6ad0=_0x27f4db?0x0:_0x2cd700[_0xacc2('0x1f')];var _0xe0fab1=_0x27f4db?_0x3addf0['count']:_0x2cd700[_0xacc2('0x1f')]+_0x2cd700[_0xacc2('0x21')];var _0x4a527d;if(_0xe0fab1>=_0x48abc8){_0xe0fab1=_0x48abc8;_0x4a527d=0xc8;}else{_0x4a527d=0xce;}_0x2aac6d['status'](_0x4a527d);return _0x2aac6d[_0xacc2('0x23')](_0xacc2('0x24'),_0x6d6ad0+'-'+_0xe0fab1+'/'+_0x48abc8)[_0xacc2('0x25')](_0x3addf0);}return null;};}function patchUpdates(_0x48dba8){return function(_0x3fa17d){try{jsonpatch[_0xacc2('0x26')](_0x3fa17d,_0x48dba8,!![]);}catch(_0x3d49a0){return BPromise[_0xacc2('0x27')](_0x3d49a0);}return _0x3fa17d[_0xacc2('0x28')]();};}function saveUpdates(_0x4dd0c3,_0x311934){return function(_0x503bc5){if(_0x503bc5){return _0x503bc5[_0xacc2('0x29')](_0x4dd0c3)[_0xacc2('0x2a')](function(_0x3ccd9c){return _0x3ccd9c;});}return null;};}function removeEntity(_0x3a1b30,_0x2c9ec8){return function(_0x3cf009){if(_0x3cf009){return _0x3cf009[_0xacc2('0x2b')]()[_0xacc2('0x2a')](function(){_0x3a1b30[_0xacc2('0x1d')](0xcc)[_0xacc2('0x1e')]();});}};}function handleEntityNotFound(_0x5a5faf,_0x2b1ea3){return function(_0x48e7bb){if(!_0x48e7bb){_0x5a5faf[_0xacc2('0x1c')](0x194);}return _0x48e7bb;};}function handleError(_0x44f7b3,_0x1c9426){_0x1c9426=_0x1c9426||0x1f4;return function(_0xa28d12){logger[_0xacc2('0x2c')](_0xa28d12[_0xacc2('0x2d')]);if(_0xa28d12[_0xacc2('0x2e')]){delete _0xa28d12[_0xacc2('0x2e')];}_0x44f7b3[_0xacc2('0x1d')](_0x1c9426)[_0xacc2('0x2f')](_0xa28d12);};}exports['index']=function(_0x3d823d,_0x5e6cec){var _0x5cb943={},_0x4f73f6={},_0x413173={'count':0x0,'rows':[]};var _0x1d54a0=_['map'](db[_0xacc2('0x30')]['rawAttributes'],function(_0x15f03f){return{'name':_0x15f03f[_0xacc2('0x31')],'type':_0x15f03f[_0xacc2('0x32')]['key']};});_0x4f73f6['model']=_['map'](_0x1d54a0,_0xacc2('0x2e'));_0x4f73f6[_0xacc2('0x33')]=_['keys'](_0x3d823d[_0xacc2('0x33')]);_0x4f73f6[_0xacc2('0x34')]=_[_0xacc2('0x35')](_0x4f73f6[_0xacc2('0x36')],_0x4f73f6['query']);_0x5cb943[_0xacc2('0x37')]=_['intersection'](_0x4f73f6[_0xacc2('0x36')],qs[_0xacc2('0x38')](_0x3d823d['query'][_0xacc2('0x38')]));_0x5cb943['attributes']=_0x5cb943[_0xacc2('0x37')]['length']?_0x5cb943['attributes']:_0x4f73f6['model'];if(!_0x3d823d[_0xacc2('0x33')][_0xacc2('0x39')](_0xacc2('0x3a'))){_0x5cb943[_0xacc2('0x21')]=qs[_0xacc2('0x21')](_0x3d823d[_0xacc2('0x33')][_0xacc2('0x21')]);_0x5cb943[_0xacc2('0x1f')]=qs[_0xacc2('0x1f')](_0x3d823d[_0xacc2('0x33')]['offset']);}_0x5cb943['order']=qs[_0xacc2('0x3b')](_0x3d823d[_0xacc2('0x33')][_0xacc2('0x3b')]);_0x5cb943[_0xacc2('0x3c')]=qs[_0xacc2('0x34')](_['pick'](_0x3d823d[_0xacc2('0x33')],_0x4f73f6[_0xacc2('0x34')]),_0x1d54a0);if(_0x3d823d[_0xacc2('0x33')][_0xacc2('0x3d')]){_0x5cb943[_0xacc2('0x3c')]=_[_0xacc2('0x3e')](_0x5cb943['where'],{'$or':_[_0xacc2('0x3f')](_0x1d54a0,function(_0x57d047){if(_0x57d047[_0xacc2('0x32')]!==_0xacc2('0x40')){var _0x42717f={};_0x42717f[_0x57d047[_0xacc2('0x2e')]]={'$like':'%'+_0x3d823d[_0xacc2('0x33')][_0xacc2('0x3d')]+'%'};return _0x42717f;}})});}_0x5cb943=_[_0xacc2('0x3e')]({},_0x5cb943,_0x3d823d[_0xacc2('0x41')]);var _0x20fb5f={'where':_0x5cb943[_0xacc2('0x3c')]};return db['SalesforceAccount'][_0xacc2('0x22')](_0x20fb5f)[_0xacc2('0x2a')](function(_0x5744ee){_0x413173['count']=_0x5744ee;if(_0x3d823d[_0xacc2('0x33')][_0xacc2('0x42')]){_0x5cb943[_0xacc2('0x43')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x5cb943);})['then'](function(_0x17c7f9){_0x413173[_0xacc2('0x44')]=_0x17c7f9;return _0x413173;})[_0xacc2('0x2a')](respondWithFilteredResult(_0x5e6cec,_0x5cb943))[_0xacc2('0x45')](handleError(_0x5e6cec,null));};exports[_0xacc2('0x46')]=function(_0x530b72,_0x2ac988){var _0x3539eb={'raw':![],'where':{'id':_0x530b72[_0xacc2('0x47')]['id']}},_0x57786a={};_0x57786a[_0xacc2('0x36')]=_[_0xacc2('0x48')](db[_0xacc2('0x30')][_0xacc2('0x49')]);_0x57786a[_0xacc2('0x33')]=_[_0xacc2('0x48')](_0x530b72[_0xacc2('0x33')]);_0x57786a[_0xacc2('0x34')]=_['intersection'](_0x57786a[_0xacc2('0x36')],_0x57786a['query']);_0x3539eb[_0xacc2('0x37')]=_[_0xacc2('0x35')](_0x57786a[_0xacc2('0x36')],qs[_0xacc2('0x38')](_0x530b72[_0xacc2('0x33')]['fields']));_0x3539eb['attributes']=_0x3539eb[_0xacc2('0x37')]['length']?_0x3539eb['attributes']:_0x57786a[_0xacc2('0x36')];if(_0x530b72[_0xacc2('0x33')][_0xacc2('0x42')]){_0x3539eb[_0xacc2('0x43')]=[{'all':!![]}];}_0x3539eb=_[_0xacc2('0x3e')]({},_0x3539eb,_0x530b72[_0xacc2('0x41')]);return db['SalesforceAccount'][_0xacc2('0x4a')](_0x3539eb)[_0xacc2('0x2a')](handleEntityNotFound(_0x2ac988,null))[_0xacc2('0x2a')](respondWithResult(_0x2ac988,null))[_0xacc2('0x45')](handleError(_0x2ac988,null));};exports[_0xacc2('0x4b')]=function(_0x109c97,_0x453ef6){return db[_0xacc2('0x30')][_0xacc2('0x4b')](_0x109c97[_0xacc2('0x4c')],{})['then'](respondWithResult(_0x453ef6,0xc9))[_0xacc2('0x45')](handleError(_0x453ef6,null));};exports[_0xacc2('0x29')]=function(_0x1e84a3,_0x3fb5c3){if(_0x1e84a3[_0xacc2('0x4c')]['id']){delete _0x1e84a3['body']['id'];}return db[_0xacc2('0x30')][_0xacc2('0x4a')]({'where':{'id':_0x1e84a3['params']['id']}})[_0xacc2('0x2a')](handleEntityNotFound(_0x3fb5c3,null))[_0xacc2('0x2a')](saveUpdates(_0x1e84a3['body'],null))[_0xacc2('0x2a')](respondWithResult(_0x3fb5c3,null))[_0xacc2('0x45')](handleError(_0x3fb5c3,null));};exports[_0xacc2('0x2b')]=function(_0x1dd18b,_0x5508b0){return db[_0xacc2('0x30')][_0xacc2('0x4a')]({'where':{'id':_0x1dd18b['params']['id']}})[_0xacc2('0x2a')](handleEntityNotFound(_0x5508b0,null))['then'](removeEntity(_0x5508b0,null))[_0xacc2('0x45')](handleError(_0x5508b0,null));};exports[_0xacc2('0x4d')]=function(_0x3d159a,_0x558128,_0x43e72a){var _0x12be3f={};var _0x2e18e3={};var _0x5851dd;var _0x84daae;return db[_0xacc2('0x30')]['findOne']({'where':{'id':_0x3d159a[_0xacc2('0x47')]['id']}})['then'](handleEntityNotFound(_0x558128,null))[_0xacc2('0x2a')](function(_0x349ec8){if(_0x349ec8){_0x5851dd=_0x349ec8;_0x2e18e3[_0xacc2('0x36')]=_[_0xacc2('0x48')](db[_0xacc2('0x4e')][_0xacc2('0x49')]);_0x2e18e3[_0xacc2('0x33')]=_[_0xacc2('0x48')](_0x3d159a[_0xacc2('0x33')]);_0x2e18e3[_0xacc2('0x34')]=_[_0xacc2('0x35')](_0x2e18e3['model'],_0x2e18e3[_0xacc2('0x33')]);_0x12be3f['attributes']=_['intersection'](_0x2e18e3[_0xacc2('0x36')],qs[_0xacc2('0x38')](_0x3d159a[_0xacc2('0x33')][_0xacc2('0x38')]));_0x12be3f['attributes']=_0x12be3f[_0xacc2('0x37')]['length']?_0x12be3f[_0xacc2('0x37')]:_0x2e18e3['model'];_0x12be3f[_0xacc2('0x4f')]=qs['sort'](_0x3d159a[_0xacc2('0x33')][_0xacc2('0x3b')]);_0x12be3f['where']=qs['filters'](_[_0xacc2('0x50')](_0x3d159a[_0xacc2('0x33')],_0x2e18e3['filters']));if(_0x3d159a[_0xacc2('0x33')]['filter']){_0x12be3f[_0xacc2('0x3c')]=_['merge'](_0x12be3f[_0xacc2('0x3c')],{'$or':_['map'](_0x12be3f['attributes'],function(_0x2ee729){var _0x1e975a={};_0x1e975a[_0x2ee729]={'$like':'%'+_0x3d159a[_0xacc2('0x33')][_0xacc2('0x3d')]+'%'};return _0x1e975a;})});}_0x12be3f=_[_0xacc2('0x3e')]({},_0x12be3f,_0x3d159a[_0xacc2('0x41')]);return _0x5851dd[_0xacc2('0x4d')](_0x12be3f);}})[_0xacc2('0x2a')](function(_0x12888a){if(_0x12888a){_0x84daae=_0x12888a[_0xacc2('0x51')];if(!_0x3d159a[_0xacc2('0x33')][_0xacc2('0x39')](_0xacc2('0x3a'))){_0x12be3f['limit']=qs[_0xacc2('0x21')](_0x3d159a['query'][_0xacc2('0x21')]);_0x12be3f['offset']=qs[_0xacc2('0x1f')](_0x3d159a['query'][_0xacc2('0x1f')]);}return _0x5851dd['getConfigurations'](_0x12be3f);}})[_0xacc2('0x2a')](function(_0x364bee){if(_0x364bee){return _0x364bee?{'count':_0x84daae,'rows':_0x364bee}:null;}})['then'](respondWithResult(_0x558128,null))[_0xacc2('0x45')](handleError(_0x558128,null));};exports[_0xacc2('0x52')]=function(_0x16c3c4,_0xd9c640,_0xa2e56b){if(_0x16c3c4[_0xacc2('0x4c')]['id']){delete _0x16c3c4[_0xacc2('0x4c')]['id'];}return db['SalesforceAccount'][_0xacc2('0x53')]({'where':{'id':_0x16c3c4[_0xacc2('0x47')]['id']}})['then'](handleEntityNotFound(_0xd9c640,null))[_0xacc2('0x2a')](function(_0x154880){if(_0x154880){_0x16c3c4['body'][_0xacc2('0x54')]=_0x154880['id'];_0x16c3c4[_0xacc2('0x4c')][_0xacc2('0x55')]=integrations[_0xacc2('0x56')](_0x16c3c4[_0xacc2('0x4c')][_0xacc2('0x57')],_0x16c3c4['body'][_0xacc2('0x32')]);_0x16c3c4[_0xacc2('0x4c')][_0xacc2('0x58')]=integrations[_0xacc2('0x59')](_0x16c3c4['body']['channel'],_0x16c3c4[_0xacc2('0x4c')][_0xacc2('0x32')]);return db[_0xacc2('0x4e')][_0xacc2('0x4b')](_0x16c3c4['body'],{'include':[{'model':db[_0xacc2('0x5a')],'as':_0xacc2('0x55')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xd9c640,null))['catch'](handleError(_0xd9c640,null));};exports[_0xacc2('0x5b')]=function(_0x2e1210,_0x199241,_0x41fe93){var _0x2415eb;var _0x41b626='';var _0xb114fe='Task';return db[_0xacc2('0x30')][_0xacc2('0x53')]({'where':{'id':_0x2e1210[_0xacc2('0x47')]['id']},'attributes':['id','remoteUri',_0xacc2('0x5c'),_0xacc2('0x5d'),'username',_0xacc2('0x5e'),'securityToken']})['then'](handleEntityNotFound(_0x199241,null))[_0xacc2('0x2a')](function(_0x4a72ff){if(_0x4a72ff){_0x41b626=_0x4a72ff['remoteUri'];var _0x465c0d=_0x41b626[_0xacc2('0x5f')](-0x1);if(_0x465c0d==='/'){_0x41b626=_0x41b626[_0xacc2('0x60')](0x0,_0x41b626[_0xacc2('0x61')](_0x465c0d));}_0x2415eb=new jsforce['Connection']({'oauth2':{'loginUrl':_0x41b626,'clientId':_0x4a72ff[_0xacc2('0x5c')],'clientSecret':_0x4a72ff['clientSecret']}});return _0x2415eb['login'](_0x4a72ff['username'],_0x4a72ff[_0xacc2('0x5e')]['concat'](_0x4a72ff[_0xacc2('0x62')]));}})[_0xacc2('0x2a')](function(_0x45e8f5){if(_0x45e8f5){if(!_['isNil'](_0x2e1210[_0xacc2('0x33')][_0xacc2('0x63')])){_0xb114fe=_0x2e1210[_0xacc2('0x33')][_0xacc2('0x63')];}return _0x2415eb[_0xacc2('0x64')](_0xb114fe)['describe']();}})[_0xacc2('0x2a')](function(_0x69188){var _0x88b595=[_0xacc2('0x65'),_0xacc2('0x66'),'IsReminderSet','IsRecurrence','Subject',_0xacc2('0x67')];var _0x332958=[_0xacc2('0x68'),_0xacc2('0x69'),_0xacc2('0x6a'),_0xacc2('0x6b'),_0xacc2('0x6c'),'textarea','phone'];if(_0x69188){_[_0xacc2('0x6d')](_0x69188[_0xacc2('0x38')],function(_0x583850){return _0x88b595[_0xacc2('0x6e')](_0x583850['name'])||!_0x332958[_0xacc2('0x6e')](_0x583850[_0xacc2('0x32')]);});return{'count':_0x69188[_0xacc2('0x38')][_0xacc2('0x51')],'rows':_['map'](_0x69188[_0xacc2('0x38')],function(_0x5a682d){return{'id':_0x5a682d[_0xacc2('0x2e')],'name':_0x5a682d[_0xacc2('0x6f')],'custom':_0x5a682d[_0xacc2('0x70')],'options':_0x5a682d[_0xacc2('0x71')]['length']>0x0?_['map'](_0x5a682d[_0xacc2('0x71')],function(_0x529787){return{'name':_0x529787[_0xacc2('0x6f')],'value':_0x529787[_0xacc2('0x72')]};}):_0x5a682d[_0xacc2('0x32')]==_0xacc2('0x6b')?[{'name':'True','value':'true'},{'name':'False','value':_0xacc2('0x73')}]:[]};})};}})['then'](respondWithResult(_0x199241,null))['catch'](function(_0x4fd639){var _0x12697d=_0x2e1210[_0xacc2('0x33')][_0xacc2('0x74')]?0x1f4:_0x4fd639[_0xacc2('0x75')]||0x1f4;logger['error'](_0xacc2('0x76'),'getFields',_0x12697d,JSON[_0xacc2('0x77')](_0x4fd639));delete _0x4fd639[_0xacc2('0x2e')];if(_0x12697d===0x191){_0x12697d=0x190;}_0x199241[_0xacc2('0x1d')](_0x12697d)[_0xacc2('0x2f')](_0x2e1210[_0xacc2('0x33')][_0xacc2('0x74')]?{'message':_0xacc2('0x78'),'statusCode':_0x4fd639[_0xacc2('0x75')]}:_0x4fd639);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b5306e8..4c63b56 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 _0x4071=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x570214,_0x16e18b){var _0x3a4c6a=function(_0xca184e){while(--_0xca184e){_0x570214['push'](_0x570214['shift']());}};_0x3a4c6a(++_0x16e18b);}(_0x4071,0x1c0));var _0x1407=function(_0x3a38cb,_0x2aae28){_0x3a38cb=_0x3a38cb-0x0;var _0x5a3121=_0x4071[_0x3a38cb];return _0x5a3121;};'use strict';var _=require('lodash');var util=require(_0x1407('0x0'));var logger=require(_0x1407('0x1'))('api');var moment=require(_0x1407('0x2'));var BPromise=require(_0x1407('0x3'));var rp=require(_0x1407('0x4'));var fs=require('fs');var path=require(_0x1407('0x5'));var rimraf=require(_0x1407('0x6'));var config=require(_0x1407('0x7'));var attributes=require(_0x1407('0x8'));var integrations=require(_0x1407('0x9'));module[_0x1407('0xa')]=function(_0x40be7b,_0x30d87b){return _0x40be7b[_0x1407('0xb')](_0x1407('0xc'),attributes,{'tableName':_0x1407('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3f9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x8d001e,_0x4fa793){var _0x423818=function(_0x2258f7){while(--_0x2258f7){_0x8d001e['push'](_0x8d001e['shift']());}};_0x423818(++_0x4fa793);}(_0xc3f9,0x125));var _0x9c3f=function(_0x3f8f31,_0x2ba3b6){_0x3f8f31=_0x3f8f31-0x0;var _0x287e4a=_0xc3f9[_0x3f8f31];return _0x287e4a;};'use strict';var _=require(_0x9c3f('0x0'));var util=require(_0x9c3f('0x1'));var logger=require(_0x9c3f('0x2'))(_0x9c3f('0x3'));var moment=require(_0x9c3f('0x4'));var BPromise=require(_0x9c3f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c3f('0x6'));var rimraf=require(_0x9c3f('0x7'));var config=require(_0x9c3f('0x8'));var attributes=require(_0x9c3f('0x9'));var integrations=require(_0x9c3f('0xa'));module['exports']=function(_0x89ecda,_0x5537bc){return _0x89ecda[_0x9c3f('0xb')](_0x9c3f('0xc'),attributes,{'tableName':_0x9c3f('0xd'),'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 67ce391..1dc0392 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 _0x25e4=['../../config/logger','../../config/environment','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowSalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x25e4,0x1cd));var _0x425e=function(_0x5a1725,_0x103bde){_0x5a1725=_0x5a1725-0x0;var _0x36d7ec=_0x25e4[_0x5a1725];return _0x36d7ec;};'use strict';var _=require(_0x425e('0x0'));var util=require(_0x425e('0x1'));var moment=require(_0x425e('0x2'));var BPromise=require(_0x425e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x425e('0x4'));var db=require(_0x425e('0x5'))['db'];var utils=require(_0x425e('0x6'));var logger=require(_0x425e('0x7'))('rpc');var config=require(_0x425e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x425e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd6f69f,_0x49602d,_0x5b949d){return new BPromise(function(_0x10a7df,_0x334d1d){return client[_0x425e('0xa')](_0xd6f69f,_0x5b949d)[_0x425e('0xb')](function(_0x5b43d8){logger[_0x425e('0xc')](_0x425e('0xd'),_0x49602d,'request\x20sent');logger[_0x425e('0xe')](_0x425e('0xf'),_0x49602d,_0x425e('0x10'),JSON[_0x425e('0x11')](_0x5b43d8));if(_0x5b43d8[_0x425e('0x12')]){if(_0x5b43d8[_0x425e('0x12')][_0x425e('0x13')]===0x1f4){logger[_0x425e('0x12')](_0x425e('0xd'),_0x49602d,_0x5b43d8[_0x425e('0x12')][_0x425e('0x14')]);return _0x334d1d(_0x5b43d8[_0x425e('0x12')]['message']);}logger['error'](_0x425e('0xd'),_0x49602d,_0x5b43d8[_0x425e('0x12')][_0x425e('0x14')]);return _0x10a7df(_0x5b43d8[_0x425e('0x12')][_0x425e('0x14')]);}else{logger[_0x425e('0xc')](_0x425e('0xd'),_0x49602d,_0x425e('0x10'));_0x10a7df(_0x5b43d8[_0x425e('0x15')][_0x425e('0x14')]);}})[_0x425e('0x16')](function(_0x114fe5){logger['error'](_0x425e('0xd'),_0x49602d,_0x114fe5);_0x334d1d(_0x114fe5);});});}exports[_0x425e('0x17')]=function(_0x5b69c2){var _0x68e162=this;return new Promise(function(_0x53bd06,_0x5e7ab8){return db[_0x425e('0x18')][_0x425e('0x19')]({'raw':_0x5b69c2[_0x425e('0x1a')]?_0x5b69c2[_0x425e('0x1a')][_0x425e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b69c2[_0x425e('0x1a')]?_0x5b69c2[_0x425e('0x1a')][_0x425e('0x1c')]||null:null,'attributes':_0x5b69c2[_0x425e('0x1a')]?_0x5b69c2[_0x425e('0x1a')]['attributes']||null:null,'limit':_0x5b69c2['options']?_0x5b69c2[_0x425e('0x1a')][_0x425e('0x1d')]||null:null,'include':_0x5b69c2[_0x425e('0x1a')]?_0x5b69c2['options'][_0x425e('0x1e')]?_[_0x425e('0x1f')](_0x5b69c2[_0x425e('0x1a')][_0x425e('0x1e')],function(_0x2e0170){return{'model':db[_0x2e0170[_0x425e('0x20')]],'as':_0x2e0170['as'],'attributes':_0x2e0170[_0x425e('0x21')],'include':_0x2e0170['include']?_[_0x425e('0x1f')](_0x2e0170[_0x425e('0x1e')],function(_0x2395e7){return{'model':db[_0x2395e7[_0x425e('0x20')]],'as':_0x2395e7['as'],'attributes':_0x2395e7['attributes'],'include':_0x2395e7['include']?_[_0x425e('0x1f')](_0x2395e7['include'],function(_0x56f0fb){return{'model':db[_0x56f0fb[_0x425e('0x20')]],'as':_0x56f0fb['as'],'attributes':_0x56f0fb[_0x425e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x425e('0xb')](function(_0xb651f){logger[_0x425e('0xc')]('GetSalesforceAccount',_0x5b69c2);logger[_0x425e('0xe')](_0x425e('0x17'),_0x5b69c2,JSON[_0x425e('0x11')](_0xb651f));_0x53bd06(_0xb651f);})[_0x425e('0x16')](function(_0x2e424c){logger[_0x425e('0x12')](_0x425e('0x17'),_0x2e424c[_0x425e('0x14')],_0x5b69c2);_0x5e7ab8(_0x68e162['error'](0x1f4,_0x2e424c[_0x425e('0x14')]));});});};exports[_0x425e('0x22')]=function(_0x3345ea){var _0x291ad1=this;return new Promise(function(_0x4dd774,_0x535191){return db[_0x425e('0x18')][_0x425e('0x23')]({'raw':_0x3345ea[_0x425e('0x1a')]?_0x3345ea[_0x425e('0x1a')][_0x425e('0x1b')]===undefined?!![]:![]:!![],'where':_0x3345ea[_0x425e('0x1a')]?_0x3345ea[_0x425e('0x1a')][_0x425e('0x1c')]||null:null,'attributes':_0x3345ea[_0x425e('0x1a')]?_0x3345ea[_0x425e('0x1a')][_0x425e('0x21')]||null:null,'include':_0x3345ea[_0x425e('0x1a')]?_0x3345ea['options'][_0x425e('0x1e')]?_[_0x425e('0x1f')](_0x3345ea[_0x425e('0x1a')][_0x425e('0x1e')],function(_0x18035e){return{'model':db[_0x18035e['model']],'as':_0x18035e['as'],'attributes':_0x18035e[_0x425e('0x21')],'include':_0x18035e[_0x425e('0x1e')]?_['map'](_0x18035e[_0x425e('0x1e')],function(_0x369252){return{'model':db[_0x369252[_0x425e('0x20')]],'as':_0x369252['as'],'attributes':_0x369252[_0x425e('0x21')],'include':_0x369252['include']?_[_0x425e('0x1f')](_0x369252[_0x425e('0x1e')],function(_0x45e61d){return{'model':db[_0x45e61d['model']],'as':_0x45e61d['as'],'attributes':_0x45e61d[_0x425e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x425e('0xb')](function(_0x452efb){logger[_0x425e('0xc')]('ShowSalesforceAccount',_0x3345ea);logger[_0x425e('0xe')](_0x425e('0x22'),_0x3345ea,JSON[_0x425e('0x11')](_0x452efb));_0x4dd774(_0x452efb);})[_0x425e('0x16')](function(_0x416e83){logger[_0x425e('0x12')](_0x425e('0x22'),_0x416e83[_0x425e('0x14')],_0x3345ea);_0x535191(_0x291ad1[_0x425e('0x12')](0x1f4,_0x416e83[_0x425e('0x14')]));});});}; \ No newline at end of file +var _0x54f3=['stringify','error','code','message','info','result','GetSalesforceAccount','options','raw','attributes','limit','include','map','model','then','catch','SalesforceAccount','where','ShowSalesforceAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x22ca85,_0x2af8bb){var _0x5a8f3f=function(_0x2bf2b5){while(--_0x2bf2b5){_0x22ca85['push'](_0x22ca85['shift']());}};_0x5a8f3f(++_0x2af8bb);}(_0x54f3,0xec));var _0x354f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x54f3[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x354f('0x0'));var util=require(_0x354f('0x1'));var moment=require(_0x354f('0x2'));var BPromise=require('bluebird');var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x354f('0x4'))['db'];var utils=require(_0x354f('0x5'));var logger=require('../../config/logger')(_0x354f('0x6'));var config=require('../../config/environment');var jayson=require(_0x354f('0x7'));var client=jayson[_0x354f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x223964,_0x39bed0,_0x5670d6){return new BPromise(function(_0x4f3e8f,_0x3438be){return client['request'](_0x223964,_0x5670d6)['then'](function(_0x4b68cf){logger['info'](_0x354f('0x9'),_0x39bed0,_0x354f('0xa'));logger[_0x354f('0xb')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x39bed0,_0x354f('0xa'),JSON[_0x354f('0xc')](_0x4b68cf));if(_0x4b68cf[_0x354f('0xd')]){if(_0x4b68cf[_0x354f('0xd')][_0x354f('0xe')]===0x1f4){logger[_0x354f('0xd')](_0x354f('0x9'),_0x39bed0,_0x4b68cf[_0x354f('0xd')][_0x354f('0xf')]);return _0x3438be(_0x4b68cf[_0x354f('0xd')][_0x354f('0xf')]);}logger['error'](_0x354f('0x9'),_0x39bed0,_0x4b68cf[_0x354f('0xd')][_0x354f('0xf')]);return _0x4f3e8f(_0x4b68cf['error'][_0x354f('0xf')]);}else{logger[_0x354f('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x39bed0,_0x354f('0xa'));_0x4f3e8f(_0x4b68cf[_0x354f('0x11')]['message']);}})['catch'](function(_0x1509f2){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x39bed0,_0x1509f2);_0x3438be(_0x1509f2);});});}exports[_0x354f('0x12')]=function(_0x4c8da4){var _0x4dcc20=this;return new Promise(function(_0x56de89,_0x18ee87){return db['SalesforceAccount']['findAll']({'raw':_0x4c8da4[_0x354f('0x13')]?_0x4c8da4[_0x354f('0x13')][_0x354f('0x14')]===undefined?!![]:![]:!![],'where':_0x4c8da4['options']?_0x4c8da4['options']['where']||null:null,'attributes':_0x4c8da4[_0x354f('0x13')]?_0x4c8da4['options'][_0x354f('0x15')]||null:null,'limit':_0x4c8da4[_0x354f('0x13')]?_0x4c8da4['options'][_0x354f('0x16')]||null:null,'include':_0x4c8da4[_0x354f('0x13')]?_0x4c8da4[_0x354f('0x13')][_0x354f('0x17')]?_[_0x354f('0x18')](_0x4c8da4[_0x354f('0x13')][_0x354f('0x17')],function(_0x457476){return{'model':db[_0x457476[_0x354f('0x19')]],'as':_0x457476['as'],'attributes':_0x457476[_0x354f('0x15')],'include':_0x457476[_0x354f('0x17')]?_[_0x354f('0x18')](_0x457476[_0x354f('0x17')],function(_0x27ea31){return{'model':db[_0x27ea31[_0x354f('0x19')]],'as':_0x27ea31['as'],'attributes':_0x27ea31[_0x354f('0x15')],'include':_0x27ea31[_0x354f('0x17')]?_[_0x354f('0x18')](_0x27ea31[_0x354f('0x17')],function(_0x3005c6){return{'model':db[_0x3005c6['model']],'as':_0x3005c6['as'],'attributes':_0x3005c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x354f('0x1a')](function(_0x40dc91){logger['info'](_0x354f('0x12'),_0x4c8da4);logger[_0x354f('0xb')](_0x354f('0x12'),_0x4c8da4,JSON['stringify'](_0x40dc91));_0x56de89(_0x40dc91);})[_0x354f('0x1b')](function(_0x150fba){logger[_0x354f('0xd')](_0x354f('0x12'),_0x150fba[_0x354f('0xf')],_0x4c8da4);_0x18ee87(_0x4dcc20[_0x354f('0xd')](0x1f4,_0x150fba[_0x354f('0xf')]));});});};exports['ShowSalesforceAccount']=function(_0x1f9a54){var _0x390cc4=this;return new Promise(function(_0x190fc8,_0x2c1fff){return db[_0x354f('0x1c')]['find']({'raw':_0x1f9a54['options']?_0x1f9a54['options'][_0x354f('0x14')]===undefined?!![]:![]:!![],'where':_0x1f9a54[_0x354f('0x13')]?_0x1f9a54['options'][_0x354f('0x1d')]||null:null,'attributes':_0x1f9a54['options']?_0x1f9a54[_0x354f('0x13')][_0x354f('0x15')]||null:null,'include':_0x1f9a54[_0x354f('0x13')]?_0x1f9a54[_0x354f('0x13')][_0x354f('0x17')]?_[_0x354f('0x18')](_0x1f9a54[_0x354f('0x13')][_0x354f('0x17')],function(_0x4d966d){return{'model':db[_0x4d966d[_0x354f('0x19')]],'as':_0x4d966d['as'],'attributes':_0x4d966d[_0x354f('0x15')],'include':_0x4d966d['include']?_[_0x354f('0x18')](_0x4d966d[_0x354f('0x17')],function(_0x5ba977){return{'model':db[_0x5ba977[_0x354f('0x19')]],'as':_0x5ba977['as'],'attributes':_0x5ba977[_0x354f('0x15')],'include':_0x5ba977[_0x354f('0x17')]?_[_0x354f('0x18')](_0x5ba977[_0x354f('0x17')],function(_0x23d211){return{'model':db[_0x23d211[_0x354f('0x19')]],'as':_0x23d211['as'],'attributes':_0x23d211[_0x354f('0x15')]};}):[]};}):[]};}):[]:[]})[_0x354f('0x1a')](function(_0x27397e){logger['info']('ShowSalesforceAccount',_0x1f9a54);logger[_0x354f('0xb')](_0x354f('0x1e'),_0x1f9a54,JSON[_0x354f('0xc')](_0x27397e));_0x190fc8(_0x27397e);})[_0x354f('0x1b')](function(_0x232122){logger[_0x354f('0xd')](_0x354f('0x1e'),_0x232122[_0x354f('0xf')],_0x1f9a54);_0x2c1fff(_0x390cc4['error'](0x1f4,_0x232122['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 7c46de0..7744cc2 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xdb28,0x106));var _0x8db2=function(_0x3ca39a,_0x568ce4){_0x3ca39a=_0x3ca39a-0x0;var _0x2727ea=_0xdb28[_0x3ca39a];return _0x2727ea;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xdb28,0x106));var _0x8db2=function(_0x912ad4,_0x4293c2){_0x912ad4=_0x912ad4-0x0;var _0x3f87c5=_0xdb28[_0x912ad4];return _0x3f87c5;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9117467..10787f6 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 _0xa606=['account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead'];(function(_0x13ca34,_0x1dafc0){var _0x64317a=function(_0x33e787){while(--_0x33e787){_0x13ca34['push'](_0x13ca34['shift']());}};_0x64317a(++_0x1dafc0);}(_0xa606,0x10b));var _0x6a60=function(_0x37ed6e,_0x40a32c){_0x37ed6e=_0x37ed6e-0x0;var _0x12dc35=_0xa606[_0x37ed6e];return _0x12dc35;};'use strict';var Sequelize=require(_0x6a60('0x0'));module[_0x6a60('0x1')]={'name':{'type':Sequelize[_0x6a60('0x2')]},'description':{'type':Sequelize[_0x6a60('0x2')]},'ticketType':{'type':Sequelize[_0x6a60('0x3')]('Task',_0x6a60('0x4')),'defaultValue':_0x6a60('0x5')},'moduleSearch':{'type':Sequelize[_0x6a60('0x3')](_0x6a60('0x6'),_0x6a60('0x7'),_0x6a60('0x8'),_0x6a60('0x9'),_0x6a60('0xa')),'defaultValue':_0x6a60('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x6a60('0xb'),_0x6a60('0x7'),_0x6a60('0x8'),'account'),'defaultValue':_0x6a60('0x8')},'leadId':{'type':Sequelize[_0x6a60('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x6a60('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x6a60('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4e84=['STRING','ENUM','Case','contact_lead','lead','account','nothing','contact','sequelize'];(function(_0x47a5d6,_0x1dc3c0){var _0x9c7e09=function(_0x249b4d){while(--_0x249b4d){_0x47a5d6['push'](_0x47a5d6['shift']());}};_0x9c7e09(++_0x1dc3c0);}(_0x4e84,0xbc));var _0x44e8=function(_0x58eb7c,_0x89fcb7){_0x58eb7c=_0x58eb7c-0x0;var _0x5051c6=_0x4e84[_0x58eb7c];return _0x5051c6;};'use strict';var Sequelize=require(_0x44e8('0x0'));module['exports']={'name':{'type':Sequelize[_0x44e8('0x1')]},'description':{'type':Sequelize[_0x44e8('0x1')]},'ticketType':{'type':Sequelize[_0x44e8('0x2')]('Task',_0x44e8('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x44e8('0x2')](_0x44e8('0x4'),'contact',_0x44e8('0x5'),'account_contact_lead',_0x44e8('0x6')),'defaultValue':_0x44e8('0x4')},'moduleCreate':{'type':Sequelize[_0x44e8('0x2')](_0x44e8('0x7'),_0x44e8('0x8'),_0x44e8('0x5'),_0x44e8('0x6')),'defaultValue':_0x44e8('0x5')},'leadId':{'type':Sequelize[_0x44e8('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x44e8('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x44e8('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x44e8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c7e43af..2078250 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 _0x851c=['find','body','getFields','findOne','SalesforceField','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','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','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','catch','params'];(function(_0x770f7,_0x3af003){var _0xe797c6=function(_0x47d92a){while(--_0x47d92a){_0x770f7['push'](_0x770f7['shift']());}};_0xe797c6(++_0x3af003);}(_0x851c,0x19d));var _0xc851=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x851c[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xc851('0x0'));var rimraf=require(_0xc851('0x1'));var zipdir=require(_0xc851('0x2'));var jsonpatch=require(_0xc851('0x3'));var rp=require(_0xc851('0x4'));var moment=require(_0xc851('0x5'));var BPromise=require(_0xc851('0x6'));var Mustache=require('mustache');var util=require(_0xc851('0x7'));var path=require(_0xc851('0x8'));var sox=require('sox');var csv=require(_0xc851('0x9'));var ejs=require(_0xc851('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc851('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc851('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc851('0xd'));var Papa=require(_0xc851('0xe'));var Redis=require(_0xc851('0xf'));var authService=require(_0xc851('0x10'));var qs=require(_0xc851('0x11'));var as=require(_0xc851('0x12'));var hardwareService=require(_0xc851('0x13'));var logger=require(_0xc851('0x14'))('api');var utils=require(_0xc851('0x15'));var config=require(_0xc851('0x16'));var licenseUtil=require(_0xc851('0x17'));var db=require(_0xc851('0x18'))['db'];function respondWithStatusCode(_0x46227a,_0xd918b6){_0xd918b6=_0xd918b6||0xcc;return function(_0x3301f8){if(_0x3301f8){return _0x46227a[_0xc851('0x19')](_0xd918b6);}return _0x46227a[_0xc851('0x1a')](_0xd918b6)[_0xc851('0x1b')]();};}function respondWithResult(_0x24d83a,_0x3fddbe){_0x3fddbe=_0x3fddbe||0xc8;return function(_0x35be4d){if(_0x35be4d){return _0x24d83a[_0xc851('0x1a')](_0x3fddbe)[_0xc851('0x1c')](_0x35be4d);}};}function respondWithFilteredResult(_0x458951,_0x5e67ee){return function(_0xc2be54){if(_0xc2be54){var _0x5ad5e1=typeof _0x5e67ee[_0xc851('0x1d')]==='undefined'&&typeof _0x5e67ee[_0xc851('0x1e')]===_0xc851('0x1f');var _0x2235b9=_0xc2be54[_0xc851('0x20')];var _0xc06f5=_0x5ad5e1?0x0:_0x5e67ee[_0xc851('0x1d')];var _0x2c1894=_0x5ad5e1?_0xc2be54['count']:_0x5e67ee[_0xc851('0x1d')]+_0x5e67ee[_0xc851('0x1e')];var _0x543377;if(_0x2c1894>=_0x2235b9){_0x2c1894=_0x2235b9;_0x543377=0xc8;}else{_0x543377=0xce;}_0x458951[_0xc851('0x1a')](_0x543377);return _0x458951[_0xc851('0x21')](_0xc851('0x22'),_0xc06f5+'-'+_0x2c1894+'/'+_0x2235b9)[_0xc851('0x1c')](_0xc2be54);}return null;};}function patchUpdates(_0x5ad006){return function(_0x28fb91){try{jsonpatch[_0xc851('0x23')](_0x28fb91,_0x5ad006,!![]);}catch(_0x138277){return BPromise[_0xc851('0x24')](_0x138277);}return _0x28fb91[_0xc851('0x25')]();};}function saveUpdates(_0x4bcc4b,_0x5ad1b1){return function(_0x442271){if(_0x442271){return _0x442271[_0xc851('0x26')](_0x4bcc4b)[_0xc851('0x27')](function(_0x9e5531){return _0x9e5531;});}return null;};}function removeEntity(_0x2c4cb4,_0x35525a){return function(_0x57b70b){if(_0x57b70b){return _0x57b70b[_0xc851('0x28')]()['then'](function(){_0x2c4cb4['status'](0xcc)[_0xc851('0x1b')]();});}};}function handleEntityNotFound(_0x1d6bc4,_0x4a2ef0){return function(_0x16b3c4){if(!_0x16b3c4){_0x1d6bc4[_0xc851('0x19')](0x194);}return _0x16b3c4;};}function handleError(_0x1a0330,_0x48afe7){_0x48afe7=_0x48afe7||0x1f4;return function(_0x2c6d43){logger[_0xc851('0x29')](_0x2c6d43[_0xc851('0x2a')]);if(_0x2c6d43[_0xc851('0x2b')]){delete _0x2c6d43[_0xc851('0x2b')];}_0x1a0330[_0xc851('0x1a')](_0x48afe7)[_0xc851('0x2c')](_0x2c6d43);};}exports[_0xc851('0x2d')]=function(_0x3f9a52,_0x24f1f1){var _0x279a40={},_0x13a826={},_0x5570c0={'count':0x0,'rows':[]};var _0x2989b9=_[_0xc851('0x2e')](db['SalesforceConfiguration'][_0xc851('0x2f')],function(_0x482e0d){return{'name':_0x482e0d['fieldName'],'type':_0x482e0d['type'][_0xc851('0x30')]};});_0x13a826['model']=_[_0xc851('0x2e')](_0x2989b9,'name');_0x13a826[_0xc851('0x31')]=_[_0xc851('0x32')](_0x3f9a52[_0xc851('0x31')]);_0x13a826[_0xc851('0x33')]=_[_0xc851('0x34')](_0x13a826[_0xc851('0x35')],_0x13a826[_0xc851('0x31')]);_0x279a40[_0xc851('0x36')]=_[_0xc851('0x34')](_0x13a826[_0xc851('0x35')],qs[_0xc851('0x37')](_0x3f9a52['query'][_0xc851('0x37')]));_0x279a40['attributes']=_0x279a40[_0xc851('0x36')][_0xc851('0x38')]?_0x279a40[_0xc851('0x36')]:_0x13a826[_0xc851('0x35')];if(!_0x3f9a52[_0xc851('0x31')][_0xc851('0x39')](_0xc851('0x3a'))){_0x279a40['limit']=qs['limit'](_0x3f9a52[_0xc851('0x31')][_0xc851('0x1e')]);_0x279a40['offset']=qs['offset'](_0x3f9a52[_0xc851('0x31')][_0xc851('0x1d')]);}_0x279a40[_0xc851('0x3b')]=qs['sort'](_0x3f9a52[_0xc851('0x31')][_0xc851('0x3c')]);_0x279a40[_0xc851('0x3d')]=qs[_0xc851('0x33')](_[_0xc851('0x3e')](_0x3f9a52[_0xc851('0x31')],_0x13a826[_0xc851('0x33')]),_0x2989b9);if(_0x3f9a52['query'][_0xc851('0x3f')]){_0x279a40[_0xc851('0x3d')]=_[_0xc851('0x40')](_0x279a40[_0xc851('0x3d')],{'$or':_[_0xc851('0x2e')](_0x2989b9,function(_0x4e57a1){if(_0x4e57a1[_0xc851('0x41')]!==_0xc851('0x42')){var _0x2be2aa={};_0x2be2aa[_0x4e57a1['name']]={'$like':'%'+_0x3f9a52[_0xc851('0x31')]['filter']+'%'};return _0x2be2aa;}})});}_0x279a40=_[_0xc851('0x40')]({},_0x279a40,_0x3f9a52['options']);var _0x1e8499={'where':_0x279a40['where']};return db[_0xc851('0x43')][_0xc851('0x20')](_0x1e8499)[_0xc851('0x27')](function(_0x5b1dbd){_0x5570c0[_0xc851('0x20')]=_0x5b1dbd;if(_0x3f9a52[_0xc851('0x31')][_0xc851('0x44')]){_0x279a40[_0xc851('0x45')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xc851('0x46')](_0x279a40);})[_0xc851('0x27')](function(_0x471f3d){_0x5570c0['rows']=_0x471f3d;return _0x5570c0;})['then'](respondWithFilteredResult(_0x24f1f1,_0x279a40))[_0xc851('0x47')](handleError(_0x24f1f1,null));};exports['show']=function(_0x5f35f7,_0x536954){var _0x563d77={'raw':![],'where':{'id':_0x5f35f7[_0xc851('0x48')]['id']}},_0x2b045b={};_0x2b045b[_0xc851('0x35')]=_[_0xc851('0x32')](db[_0xc851('0x43')][_0xc851('0x2f')]);_0x2b045b[_0xc851('0x31')]=_[_0xc851('0x32')](_0x5f35f7[_0xc851('0x31')]);_0x2b045b[_0xc851('0x33')]=_[_0xc851('0x34')](_0x2b045b[_0xc851('0x35')],_0x2b045b[_0xc851('0x31')]);_0x563d77[_0xc851('0x36')]=_['intersection'](_0x2b045b['model'],qs[_0xc851('0x37')](_0x5f35f7['query']['fields']));_0x563d77[_0xc851('0x36')]=_0x563d77[_0xc851('0x36')]['length']?_0x563d77['attributes']:_0x2b045b[_0xc851('0x35')];if(_0x5f35f7[_0xc851('0x31')]['includeAll']){_0x563d77[_0xc851('0x45')]=[{'all':!![]}];}_0x563d77=_[_0xc851('0x40')]({},_0x563d77,_0x5f35f7['options']);return db[_0xc851('0x43')][_0xc851('0x49')](_0x563d77)[_0xc851('0x27')](handleEntityNotFound(_0x536954,null))[_0xc851('0x27')](respondWithResult(_0x536954,null))[_0xc851('0x47')](handleError(_0x536954,null));};exports['create']=function(_0x3350ab,_0x125ef1){return db[_0xc851('0x43')]['create'](_0x3350ab[_0xc851('0x4a')],{})[_0xc851('0x27')](respondWithResult(_0x125ef1,0xc9))[_0xc851('0x47')](handleError(_0x125ef1,null));};exports['update']=function(_0x53c81f,_0x1fcc0a){if(_0x53c81f[_0xc851('0x4a')]['id']){delete _0x53c81f[_0xc851('0x4a')]['id'];}return db['SalesforceConfiguration'][_0xc851('0x49')]({'where':{'id':_0x53c81f['params']['id']}})[_0xc851('0x27')](handleEntityNotFound(_0x1fcc0a,null))[_0xc851('0x27')](saveUpdates(_0x53c81f[_0xc851('0x4a')],null))[_0xc851('0x27')](respondWithResult(_0x1fcc0a,null))[_0xc851('0x47')](handleError(_0x1fcc0a,null));};exports[_0xc851('0x28')]=function(_0xf9f17,_0x436e79){return db['SalesforceConfiguration'][_0xc851('0x49')]({'where':{'id':_0xf9f17[_0xc851('0x48')]['id']}})['then'](handleEntityNotFound(_0x436e79,null))[_0xc851('0x27')](removeEntity(_0x436e79,null))[_0xc851('0x47')](handleError(_0x436e79,null));};exports[_0xc851('0x4b')]=function(_0x246612,_0x5ccb21,_0x4c924c){var _0x3a262f={};var _0x5ac34f={};var _0x3f00f5;var _0x4b5332;return db[_0xc851('0x43')][_0xc851('0x4c')]({'where':{'id':_0x246612[_0xc851('0x48')]['id']}})[_0xc851('0x27')](handleEntityNotFound(_0x5ccb21,null))[_0xc851('0x27')](function(_0x5839c0){if(_0x5839c0){_0x3f00f5=_0x5839c0;_0x5ac34f[_0xc851('0x35')]=_['keys'](db[_0xc851('0x4d')]['rawAttributes']);_0x5ac34f[_0xc851('0x31')]=_[_0xc851('0x32')](_0x246612[_0xc851('0x31')]);_0x5ac34f[_0xc851('0x33')]=_[_0xc851('0x34')](_0x5ac34f['model'],_0x5ac34f[_0xc851('0x31')]);_0x3a262f[_0xc851('0x36')]=_[_0xc851('0x34')](_0x5ac34f[_0xc851('0x35')],qs[_0xc851('0x37')](_0x246612[_0xc851('0x31')][_0xc851('0x37')]));_0x3a262f[_0xc851('0x36')]=_0x3a262f[_0xc851('0x36')][_0xc851('0x38')]?_0x3a262f[_0xc851('0x36')]:_0x5ac34f[_0xc851('0x35')];_0x3a262f['order']=qs[_0xc851('0x3c')](_0x246612[_0xc851('0x31')][_0xc851('0x3c')]);_0x3a262f[_0xc851('0x3d')]=qs[_0xc851('0x33')](_[_0xc851('0x3e')](_0x246612['query'],_0x5ac34f[_0xc851('0x33')]));if(_0x246612['query'][_0xc851('0x3f')]){_0x3a262f['where']=_['merge'](_0x3a262f[_0xc851('0x3d')],{'$or':_['map'](_0x3a262f[_0xc851('0x36')],function(_0x39ef78){var _0x2c979b={};_0x2c979b[_0x39ef78]={'$like':'%'+_0x246612['query'][_0xc851('0x3f')]+'%'};return _0x2c979b;})});}_0x3a262f=_[_0xc851('0x40')]({},_0x3a262f,_0x246612[_0xc851('0x4e')]);return _0x3f00f5[_0xc851('0x4b')](_0x3a262f);}})[_0xc851('0x27')](function(_0x8cbec5){if(_0x8cbec5){_0x4b5332=_0x8cbec5['length'];if(!_0x246612[_0xc851('0x31')][_0xc851('0x39')](_0xc851('0x3a'))){_0x3a262f['limit']=qs[_0xc851('0x1e')](_0x246612[_0xc851('0x31')]['limit']);_0x3a262f[_0xc851('0x1d')]=qs[_0xc851('0x1d')](_0x246612[_0xc851('0x31')][_0xc851('0x1d')]);}return _0x3f00f5['getFields'](_0x3a262f);}})['then'](function(_0x55faa7){if(_0x55faa7){return _0x55faa7?{'count':_0x4b5332,'rows':_0x55faa7}:null;}})['then'](respondWithResult(_0x5ccb21,null))[_0xc851('0x47')](handleError(_0x5ccb21,null));};exports[_0xc851('0x4f')]=function(_0x200e68,_0x22a386,_0x11bfa8){var _0x2e6766={};var _0x5dd945={};var _0x43cb32;var _0x4d67b6;return db['SalesforceConfiguration'][_0xc851('0x4c')]({'where':{'id':_0x200e68[_0xc851('0x48')]['id']}})['then'](handleEntityNotFound(_0x22a386,null))[_0xc851('0x27')](function(_0x60e022){if(_0x60e022){_0x43cb32=_0x60e022;_0x5dd945['model']=_[_0xc851('0x32')](db[_0xc851('0x4d')][_0xc851('0x2f')]);_0x5dd945['query']=_['keys'](_0x200e68['query']);_0x5dd945[_0xc851('0x33')]=_[_0xc851('0x34')](_0x5dd945['model'],_0x5dd945[_0xc851('0x31')]);_0x2e6766[_0xc851('0x36')]=_[_0xc851('0x34')](_0x5dd945[_0xc851('0x35')],qs[_0xc851('0x37')](_0x200e68[_0xc851('0x31')][_0xc851('0x37')]));_0x2e6766[_0xc851('0x36')]=_0x2e6766[_0xc851('0x36')][_0xc851('0x38')]?_0x2e6766[_0xc851('0x36')]:_0x5dd945[_0xc851('0x35')];_0x2e6766[_0xc851('0x3b')]=qs['sort'](_0x200e68[_0xc851('0x31')][_0xc851('0x3c')]);_0x2e6766['where']=qs[_0xc851('0x33')](_['pick'](_0x200e68[_0xc851('0x31')],_0x5dd945[_0xc851('0x33')]));if(_0x200e68[_0xc851('0x31')][_0xc851('0x3f')]){_0x2e6766['where']=_['merge'](_0x2e6766[_0xc851('0x3d')],{'$or':_['map'](_0x2e6766[_0xc851('0x36')],function(_0x595175){var _0x7e9c88={};_0x7e9c88[_0x595175]={'$like':'%'+_0x200e68['query'][_0xc851('0x3f')]+'%'};return _0x7e9c88;})});}_0x2e6766=_[_0xc851('0x40')]({},_0x2e6766,_0x200e68[_0xc851('0x4e')]);return _0x43cb32['getSubjects'](_0x2e6766);}})['then'](function(_0x532efe){if(_0x532efe){_0x4d67b6=_0x532efe[_0xc851('0x38')];if(!_0x200e68['query'][_0xc851('0x39')](_0xc851('0x3a'))){_0x2e6766['limit']=qs['limit'](_0x200e68['query'][_0xc851('0x1e')]);_0x2e6766[_0xc851('0x1d')]=qs[_0xc851('0x1d')](_0x200e68[_0xc851('0x31')][_0xc851('0x1d')]);}return _0x43cb32['getSubjects'](_0x2e6766);}})['then'](function(_0x3cf605){if(_0x3cf605){return _0x3cf605?{'count':_0x4d67b6,'rows':_0x3cf605}:null;}})[_0xc851('0x27')](respondWithResult(_0x22a386,null))[_0xc851('0x47')](handleError(_0x22a386,null));};exports['getDescriptions']=function(_0x250007,_0x556cda,_0x55f71b){var _0x35b256={};var _0x56dbf9={};var _0x4c0767;var _0x48cae8;return db[_0xc851('0x43')][_0xc851('0x4c')]({'where':{'id':_0x250007[_0xc851('0x48')]['id']}})[_0xc851('0x27')](handleEntityNotFound(_0x556cda,null))['then'](function(_0xcf7da4){if(_0xcf7da4){_0x4c0767=_0xcf7da4;_0x56dbf9[_0xc851('0x35')]=_[_0xc851('0x32')](db[_0xc851('0x4d')][_0xc851('0x2f')]);_0x56dbf9[_0xc851('0x31')]=_[_0xc851('0x32')](_0x250007['query']);_0x56dbf9['filters']=_[_0xc851('0x34')](_0x56dbf9[_0xc851('0x35')],_0x56dbf9['query']);_0x35b256['attributes']=_[_0xc851('0x34')](_0x56dbf9[_0xc851('0x35')],qs[_0xc851('0x37')](_0x250007[_0xc851('0x31')][_0xc851('0x37')]));_0x35b256['attributes']=_0x35b256[_0xc851('0x36')][_0xc851('0x38')]?_0x35b256[_0xc851('0x36')]:_0x56dbf9[_0xc851('0x35')];_0x35b256['order']=qs[_0xc851('0x3c')](_0x250007[_0xc851('0x31')][_0xc851('0x3c')]);_0x35b256['where']=qs['filters'](_[_0xc851('0x3e')](_0x250007[_0xc851('0x31')],_0x56dbf9['filters']));if(_0x250007[_0xc851('0x31')][_0xc851('0x3f')]){_0x35b256[_0xc851('0x3d')]=_[_0xc851('0x40')](_0x35b256['where'],{'$or':_[_0xc851('0x2e')](_0x35b256[_0xc851('0x36')],function(_0x45d17a){var _0x1bbf4b={};_0x1bbf4b[_0x45d17a]={'$like':'%'+_0x250007[_0xc851('0x31')][_0xc851('0x3f')]+'%'};return _0x1bbf4b;})});}_0x35b256=_['merge']({},_0x35b256,_0x250007[_0xc851('0x4e')]);return _0x4c0767[_0xc851('0x50')](_0x35b256);}})['then'](function(_0x3bb7c9){if(_0x3bb7c9){_0x48cae8=_0x3bb7c9['length'];if(!_0x250007[_0xc851('0x31')]['hasOwnProperty'](_0xc851('0x3a'))){_0x35b256[_0xc851('0x1e')]=qs[_0xc851('0x1e')](_0x250007['query']['limit']);_0x35b256[_0xc851('0x1d')]=qs['offset'](_0x250007[_0xc851('0x31')][_0xc851('0x1d')]);}return _0x4c0767[_0xc851('0x50')](_0x35b256);}})[_0xc851('0x27')](function(_0x381a0a){if(_0x381a0a){return _0x381a0a?{'count':_0x48cae8,'rows':_0x381a0a}:null;}})[_0xc851('0x27')](respondWithResult(_0x556cda,null))['catch'](handleError(_0x556cda,null));}; \ No newline at end of file +var _0xc2e5=['query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','then','include','findAll','catch','show','params','rawAttributes','length','includeAll','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','error','name','index','map','SalesforceConfiguration','type','model'];(function(_0x5e21c6,_0x4937a5){var _0x5e1922=function(_0xbf973c){while(--_0xbf973c){_0x5e21c6['push'](_0x5e21c6['shift']());}};_0x5e1922(++_0x4937a5);}(_0xc2e5,0x6f));var _0x5c2e=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0xc2e5[_0x2e1907];return _0x401555;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c2e('0x0'));var zipdir=require(_0x5c2e('0x1'));var jsonpatch=require(_0x5c2e('0x2'));var rp=require(_0x5c2e('0x3'));var moment=require(_0x5c2e('0x4'));var BPromise=require(_0x5c2e('0x5'));var Mustache=require(_0x5c2e('0x6'));var util=require('util');var path=require(_0x5c2e('0x7'));var sox=require(_0x5c2e('0x8'));var csv=require(_0x5c2e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c2e('0xa'));var _=require('lodash');var squel=require(_0x5c2e('0xb'));var crypto=require(_0x5c2e('0xc'));var jsforce=require(_0x5c2e('0xd'));var deskjs=require(_0x5c2e('0xe'));var toCsv=require(_0x5c2e('0x9'));var querystring=require('querystring');var Papa=require(_0x5c2e('0xf'));var Redis=require(_0x5c2e('0x10'));var authService=require(_0x5c2e('0x11'));var qs=require(_0x5c2e('0x12'));var as=require(_0x5c2e('0x13'));var hardwareService=require(_0x5c2e('0x14'));var logger=require('../../config/logger')(_0x5c2e('0x15'));var utils=require(_0x5c2e('0x16'));var config=require(_0x5c2e('0x17'));var licenseUtil=require(_0x5c2e('0x18'));var db=require(_0x5c2e('0x19'))['db'];function respondWithStatusCode(_0x4a134c,_0x5b963b){_0x5b963b=_0x5b963b||0xcc;return function(_0x1ba5ad){if(_0x1ba5ad){return _0x4a134c['sendStatus'](_0x5b963b);}return _0x4a134c['status'](_0x5b963b)[_0x5c2e('0x1a')]();};}function respondWithResult(_0xe7fe49,_0xb6c231){_0xb6c231=_0xb6c231||0xc8;return function(_0x2643f3){if(_0x2643f3){return _0xe7fe49[_0x5c2e('0x1b')](_0xb6c231)[_0x5c2e('0x1c')](_0x2643f3);}};}function respondWithFilteredResult(_0x5d0acc,_0x33601e){return function(_0x313a6f){if(_0x313a6f){var _0x3b1884=typeof _0x33601e[_0x5c2e('0x1d')]===_0x5c2e('0x1e')&&typeof _0x33601e['limit']==='undefined';var _0x49e32e=_0x313a6f[_0x5c2e('0x1f')];var _0x2fd98a=_0x3b1884?0x0:_0x33601e['offset'];var _0x5979df=_0x3b1884?_0x313a6f[_0x5c2e('0x1f')]:_0x33601e['offset']+_0x33601e[_0x5c2e('0x20')];var _0x52ffaa;if(_0x5979df>=_0x49e32e){_0x5979df=_0x49e32e;_0x52ffaa=0xc8;}else{_0x52ffaa=0xce;}_0x5d0acc[_0x5c2e('0x1b')](_0x52ffaa);return _0x5d0acc['set'](_0x5c2e('0x21'),_0x2fd98a+'-'+_0x5979df+'/'+_0x49e32e)['json'](_0x313a6f);}return null;};}function patchUpdates(_0xe0c1a7){return function(_0xe74fa4){try{jsonpatch['apply'](_0xe74fa4,_0xe0c1a7,!![]);}catch(_0x2c98ef){return BPromise[_0x5c2e('0x22')](_0x2c98ef);}return _0xe74fa4[_0x5c2e('0x23')]();};}function saveUpdates(_0x437a32,_0x1e3949){return function(_0x4e6dca){if(_0x4e6dca){return _0x4e6dca[_0x5c2e('0x24')](_0x437a32)['then'](function(_0x3136f0){return _0x3136f0;});}return null;};}function removeEntity(_0x3e9535,_0x441403){return function(_0x5f473a){if(_0x5f473a){return _0x5f473a[_0x5c2e('0x25')]()['then'](function(){_0x3e9535['status'](0xcc)[_0x5c2e('0x1a')]();});}};}function handleEntityNotFound(_0x2bbe81,_0x276bcf){return function(_0x55a3ed){if(!_0x55a3ed){_0x2bbe81['sendStatus'](0x194);}return _0x55a3ed;};}function handleError(_0x400c27,_0x4a3647){_0x4a3647=_0x4a3647||0x1f4;return function(_0x351630){logger[_0x5c2e('0x26')](_0x351630['stack']);if(_0x351630[_0x5c2e('0x27')]){delete _0x351630[_0x5c2e('0x27')];}_0x400c27[_0x5c2e('0x1b')](_0x4a3647)['send'](_0x351630);};}exports[_0x5c2e('0x28')]=function(_0x1cf3b6,_0x13b0d8){var _0x5adc99={},_0xdaaafc={},_0x515427={'count':0x0,'rows':[]};var _0x223617=_[_0x5c2e('0x29')](db[_0x5c2e('0x2a')]['rawAttributes'],function(_0xc2b38a){return{'name':_0xc2b38a['fieldName'],'type':_0xc2b38a[_0x5c2e('0x2b')]['key']};});_0xdaaafc[_0x5c2e('0x2c')]=_[_0x5c2e('0x29')](_0x223617,'name');_0xdaaafc[_0x5c2e('0x2d')]=_[_0x5c2e('0x2e')](_0x1cf3b6['query']);_0xdaaafc['filters']=_['intersection'](_0xdaaafc['model'],_0xdaaafc[_0x5c2e('0x2d')]);_0x5adc99[_0x5c2e('0x2f')]=_[_0x5c2e('0x30')](_0xdaaafc[_0x5c2e('0x2c')],qs[_0x5c2e('0x31')](_0x1cf3b6[_0x5c2e('0x2d')][_0x5c2e('0x31')]));_0x5adc99[_0x5c2e('0x2f')]=_0x5adc99[_0x5c2e('0x2f')]['length']?_0x5adc99[_0x5c2e('0x2f')]:_0xdaaafc['model'];if(!_0x1cf3b6[_0x5c2e('0x2d')][_0x5c2e('0x32')](_0x5c2e('0x33'))){_0x5adc99[_0x5c2e('0x20')]=qs[_0x5c2e('0x20')](_0x1cf3b6[_0x5c2e('0x2d')][_0x5c2e('0x20')]);_0x5adc99[_0x5c2e('0x1d')]=qs['offset'](_0x1cf3b6[_0x5c2e('0x2d')][_0x5c2e('0x1d')]);}_0x5adc99[_0x5c2e('0x34')]=qs[_0x5c2e('0x35')](_0x1cf3b6[_0x5c2e('0x2d')][_0x5c2e('0x35')]);_0x5adc99[_0x5c2e('0x36')]=qs[_0x5c2e('0x37')](_[_0x5c2e('0x38')](_0x1cf3b6[_0x5c2e('0x2d')],_0xdaaafc[_0x5c2e('0x37')]),_0x223617);if(_0x1cf3b6['query']['filter']){_0x5adc99[_0x5c2e('0x36')]=_[_0x5c2e('0x39')](_0x5adc99[_0x5c2e('0x36')],{'$or':_['map'](_0x223617,function(_0x2440b6){if(_0x2440b6[_0x5c2e('0x2b')]!==_0x5c2e('0x3a')){var _0x32616e={};_0x32616e[_0x2440b6[_0x5c2e('0x27')]]={'$like':'%'+_0x1cf3b6[_0x5c2e('0x2d')][_0x5c2e('0x3b')]+'%'};return _0x32616e;}})});}_0x5adc99=_[_0x5c2e('0x39')]({},_0x5adc99,_0x1cf3b6[_0x5c2e('0x3c')]);var _0x390133={'where':_0x5adc99[_0x5c2e('0x36')]};return db[_0x5c2e('0x2a')][_0x5c2e('0x1f')](_0x390133)[_0x5c2e('0x3d')](function(_0x3904b4){_0x515427['count']=_0x3904b4;if(_0x1cf3b6[_0x5c2e('0x2d')]['includeAll']){_0x5adc99[_0x5c2e('0x3e')]=[{'all':!![]}];}return db[_0x5c2e('0x2a')][_0x5c2e('0x3f')](_0x5adc99);})[_0x5c2e('0x3d')](function(_0x587ac4){_0x515427['rows']=_0x587ac4;return _0x515427;})['then'](respondWithFilteredResult(_0x13b0d8,_0x5adc99))[_0x5c2e('0x40')](handleError(_0x13b0d8,null));};exports[_0x5c2e('0x41')]=function(_0x41b893,_0xf34255){var _0xbc6c11={'raw':![],'where':{'id':_0x41b893[_0x5c2e('0x42')]['id']}},_0x49aee0={};_0x49aee0[_0x5c2e('0x2c')]=_[_0x5c2e('0x2e')](db[_0x5c2e('0x2a')][_0x5c2e('0x43')]);_0x49aee0[_0x5c2e('0x2d')]=_[_0x5c2e('0x2e')](_0x41b893[_0x5c2e('0x2d')]);_0x49aee0[_0x5c2e('0x37')]=_[_0x5c2e('0x30')](_0x49aee0['model'],_0x49aee0[_0x5c2e('0x2d')]);_0xbc6c11[_0x5c2e('0x2f')]=_[_0x5c2e('0x30')](_0x49aee0[_0x5c2e('0x2c')],qs[_0x5c2e('0x31')](_0x41b893[_0x5c2e('0x2d')]['fields']));_0xbc6c11[_0x5c2e('0x2f')]=_0xbc6c11[_0x5c2e('0x2f')][_0x5c2e('0x44')]?_0xbc6c11[_0x5c2e('0x2f')]:_0x49aee0['model'];if(_0x41b893[_0x5c2e('0x2d')][_0x5c2e('0x45')]){_0xbc6c11['include']=[{'all':!![]}];}_0xbc6c11=_[_0x5c2e('0x39')]({},_0xbc6c11,_0x41b893['options']);return db[_0x5c2e('0x2a')][_0x5c2e('0x46')](_0xbc6c11)[_0x5c2e('0x3d')](handleEntityNotFound(_0xf34255,null))[_0x5c2e('0x3d')](respondWithResult(_0xf34255,null))['catch'](handleError(_0xf34255,null));};exports[_0x5c2e('0x47')]=function(_0x50a9f0,_0x4789ea){return db[_0x5c2e('0x2a')]['create'](_0x50a9f0[_0x5c2e('0x48')],{})[_0x5c2e('0x3d')](respondWithResult(_0x4789ea,0xc9))[_0x5c2e('0x40')](handleError(_0x4789ea,null));};exports[_0x5c2e('0x24')]=function(_0x52768d,_0x1098f9){if(_0x52768d[_0x5c2e('0x48')]['id']){delete _0x52768d[_0x5c2e('0x48')]['id'];}return db[_0x5c2e('0x2a')][_0x5c2e('0x46')]({'where':{'id':_0x52768d[_0x5c2e('0x42')]['id']}})['then'](handleEntityNotFound(_0x1098f9,null))[_0x5c2e('0x3d')](saveUpdates(_0x52768d['body'],null))[_0x5c2e('0x3d')](respondWithResult(_0x1098f9,null))[_0x5c2e('0x40')](handleError(_0x1098f9,null));};exports[_0x5c2e('0x25')]=function(_0x2183cd,_0x3cf510){return db[_0x5c2e('0x2a')][_0x5c2e('0x46')]({'where':{'id':_0x2183cd[_0x5c2e('0x42')]['id']}})[_0x5c2e('0x3d')](handleEntityNotFound(_0x3cf510,null))['then'](removeEntity(_0x3cf510,null))[_0x5c2e('0x40')](handleError(_0x3cf510,null));};exports[_0x5c2e('0x49')]=function(_0x562eab,_0x21df68,_0xba0fae){var _0x2db10e={};var _0x55a07d={};var _0x3d4759;var _0x3f2501;return db['SalesforceConfiguration'][_0x5c2e('0x4a')]({'where':{'id':_0x562eab['params']['id']}})[_0x5c2e('0x3d')](handleEntityNotFound(_0x21df68,null))[_0x5c2e('0x3d')](function(_0x16d0ea){if(_0x16d0ea){_0x3d4759=_0x16d0ea;_0x55a07d[_0x5c2e('0x2c')]=_[_0x5c2e('0x2e')](db[_0x5c2e('0x4b')][_0x5c2e('0x43')]);_0x55a07d[_0x5c2e('0x2d')]=_[_0x5c2e('0x2e')](_0x562eab[_0x5c2e('0x2d')]);_0x55a07d[_0x5c2e('0x37')]=_['intersection'](_0x55a07d[_0x5c2e('0x2c')],_0x55a07d[_0x5c2e('0x2d')]);_0x2db10e[_0x5c2e('0x2f')]=_[_0x5c2e('0x30')](_0x55a07d[_0x5c2e('0x2c')],qs[_0x5c2e('0x31')](_0x562eab[_0x5c2e('0x2d')][_0x5c2e('0x31')]));_0x2db10e[_0x5c2e('0x2f')]=_0x2db10e['attributes'][_0x5c2e('0x44')]?_0x2db10e[_0x5c2e('0x2f')]:_0x55a07d['model'];_0x2db10e[_0x5c2e('0x34')]=qs['sort'](_0x562eab['query'][_0x5c2e('0x35')]);_0x2db10e['where']=qs[_0x5c2e('0x37')](_[_0x5c2e('0x38')](_0x562eab[_0x5c2e('0x2d')],_0x55a07d[_0x5c2e('0x37')]));if(_0x562eab[_0x5c2e('0x2d')][_0x5c2e('0x3b')]){_0x2db10e[_0x5c2e('0x36')]=_[_0x5c2e('0x39')](_0x2db10e[_0x5c2e('0x36')],{'$or':_[_0x5c2e('0x29')](_0x2db10e['attributes'],function(_0x3e0721){var _0x4af352={};_0x4af352[_0x3e0721]={'$like':'%'+_0x562eab[_0x5c2e('0x2d')][_0x5c2e('0x3b')]+'%'};return _0x4af352;})});}_0x2db10e=_[_0x5c2e('0x39')]({},_0x2db10e,_0x562eab['options']);return _0x3d4759[_0x5c2e('0x49')](_0x2db10e);}})['then'](function(_0x464aea){if(_0x464aea){_0x3f2501=_0x464aea[_0x5c2e('0x44')];if(!_0x562eab[_0x5c2e('0x2d')]['hasOwnProperty'](_0x5c2e('0x33'))){_0x2db10e[_0x5c2e('0x20')]=qs[_0x5c2e('0x20')](_0x562eab[_0x5c2e('0x2d')]['limit']);_0x2db10e['offset']=qs['offset'](_0x562eab[_0x5c2e('0x2d')][_0x5c2e('0x1d')]);}return _0x3d4759[_0x5c2e('0x49')](_0x2db10e);}})[_0x5c2e('0x3d')](function(_0x437751){if(_0x437751){return _0x437751?{'count':_0x3f2501,'rows':_0x437751}:null;}})[_0x5c2e('0x3d')](respondWithResult(_0x21df68,null))['catch'](handleError(_0x21df68,null));};exports[_0x5c2e('0x4c')]=function(_0x44d047,_0x4de271,_0x2aa76a){var _0x25ded9={};var _0x303725={};var _0x2fd52c;var _0x397347;return db[_0x5c2e('0x2a')][_0x5c2e('0x4a')]({'where':{'id':_0x44d047[_0x5c2e('0x42')]['id']}})[_0x5c2e('0x3d')](handleEntityNotFound(_0x4de271,null))[_0x5c2e('0x3d')](function(_0x58f4c4){if(_0x58f4c4){_0x2fd52c=_0x58f4c4;_0x303725['model']=_[_0x5c2e('0x2e')](db['SalesforceField'][_0x5c2e('0x43')]);_0x303725[_0x5c2e('0x2d')]=_['keys'](_0x44d047[_0x5c2e('0x2d')]);_0x303725[_0x5c2e('0x37')]=_[_0x5c2e('0x30')](_0x303725[_0x5c2e('0x2c')],_0x303725[_0x5c2e('0x2d')]);_0x25ded9[_0x5c2e('0x2f')]=_['intersection'](_0x303725[_0x5c2e('0x2c')],qs[_0x5c2e('0x31')](_0x44d047['query'][_0x5c2e('0x31')]));_0x25ded9[_0x5c2e('0x2f')]=_0x25ded9['attributes'][_0x5c2e('0x44')]?_0x25ded9[_0x5c2e('0x2f')]:_0x303725[_0x5c2e('0x2c')];_0x25ded9['order']=qs[_0x5c2e('0x35')](_0x44d047['query']['sort']);_0x25ded9[_0x5c2e('0x36')]=qs[_0x5c2e('0x37')](_[_0x5c2e('0x38')](_0x44d047['query'],_0x303725[_0x5c2e('0x37')]));if(_0x44d047['query']['filter']){_0x25ded9[_0x5c2e('0x36')]=_[_0x5c2e('0x39')](_0x25ded9['where'],{'$or':_['map'](_0x25ded9['attributes'],function(_0x2efbdb){var _0x31acef={};_0x31acef[_0x2efbdb]={'$like':'%'+_0x44d047[_0x5c2e('0x2d')][_0x5c2e('0x3b')]+'%'};return _0x31acef;})});}_0x25ded9=_[_0x5c2e('0x39')]({},_0x25ded9,_0x44d047[_0x5c2e('0x3c')]);return _0x2fd52c[_0x5c2e('0x4c')](_0x25ded9);}})[_0x5c2e('0x3d')](function(_0x28dd9f){if(_0x28dd9f){_0x397347=_0x28dd9f[_0x5c2e('0x44')];if(!_0x44d047[_0x5c2e('0x2d')][_0x5c2e('0x32')]('nolimit')){_0x25ded9['limit']=qs[_0x5c2e('0x20')](_0x44d047[_0x5c2e('0x2d')][_0x5c2e('0x20')]);_0x25ded9[_0x5c2e('0x1d')]=qs[_0x5c2e('0x1d')](_0x44d047[_0x5c2e('0x2d')][_0x5c2e('0x1d')]);}return _0x2fd52c[_0x5c2e('0x4c')](_0x25ded9);}})[_0x5c2e('0x3d')](function(_0x551de4){if(_0x551de4){return _0x551de4?{'count':_0x397347,'rows':_0x551de4}:null;}})[_0x5c2e('0x3d')](respondWithResult(_0x4de271,null))[_0x5c2e('0x40')](handleError(_0x4de271,null));};exports[_0x5c2e('0x4d')]=function(_0x29726f,_0x2a30b5,_0x312042){var _0x41c7e6={};var _0x5c083a={};var _0x3cccb7;var _0x361489;return db['SalesforceConfiguration'][_0x5c2e('0x4a')]({'where':{'id':_0x29726f['params']['id']}})[_0x5c2e('0x3d')](handleEntityNotFound(_0x2a30b5,null))[_0x5c2e('0x3d')](function(_0x18dbac){if(_0x18dbac){_0x3cccb7=_0x18dbac;_0x5c083a['model']=_[_0x5c2e('0x2e')](db[_0x5c2e('0x4b')][_0x5c2e('0x43')]);_0x5c083a[_0x5c2e('0x2d')]=_[_0x5c2e('0x2e')](_0x29726f[_0x5c2e('0x2d')]);_0x5c083a[_0x5c2e('0x37')]=_[_0x5c2e('0x30')](_0x5c083a['model'],_0x5c083a['query']);_0x41c7e6[_0x5c2e('0x2f')]=_[_0x5c2e('0x30')](_0x5c083a[_0x5c2e('0x2c')],qs[_0x5c2e('0x31')](_0x29726f[_0x5c2e('0x2d')]['fields']));_0x41c7e6[_0x5c2e('0x2f')]=_0x41c7e6[_0x5c2e('0x2f')][_0x5c2e('0x44')]?_0x41c7e6[_0x5c2e('0x2f')]:_0x5c083a['model'];_0x41c7e6[_0x5c2e('0x34')]=qs[_0x5c2e('0x35')](_0x29726f[_0x5c2e('0x2d')][_0x5c2e('0x35')]);_0x41c7e6[_0x5c2e('0x36')]=qs[_0x5c2e('0x37')](_['pick'](_0x29726f[_0x5c2e('0x2d')],_0x5c083a[_0x5c2e('0x37')]));if(_0x29726f[_0x5c2e('0x2d')][_0x5c2e('0x3b')]){_0x41c7e6['where']=_['merge'](_0x41c7e6[_0x5c2e('0x36')],{'$or':_[_0x5c2e('0x29')](_0x41c7e6[_0x5c2e('0x2f')],function(_0x4b9bf7){var _0x1cbee0={};_0x1cbee0[_0x4b9bf7]={'$like':'%'+_0x29726f[_0x5c2e('0x2d')][_0x5c2e('0x3b')]+'%'};return _0x1cbee0;})});}_0x41c7e6=_[_0x5c2e('0x39')]({},_0x41c7e6,_0x29726f[_0x5c2e('0x3c')]);return _0x3cccb7[_0x5c2e('0x4d')](_0x41c7e6);}})[_0x5c2e('0x3d')](function(_0x2ca8ae){if(_0x2ca8ae){_0x361489=_0x2ca8ae[_0x5c2e('0x44')];if(!_0x29726f[_0x5c2e('0x2d')][_0x5c2e('0x32')](_0x5c2e('0x33'))){_0x41c7e6[_0x5c2e('0x20')]=qs['limit'](_0x29726f[_0x5c2e('0x2d')]['limit']);_0x41c7e6['offset']=qs['offset'](_0x29726f[_0x5c2e('0x2d')]['offset']);}return _0x3cccb7['getDescriptions'](_0x41c7e6);}})[_0x5c2e('0x3d')](function(_0x40b171){if(_0x40b171){return _0x40b171?{'count':_0x361489,'rows':_0x40b171}:null;}})[_0x5c2e('0x3d')](respondWithResult(_0x2a30b5,null))['catch'](handleError(_0x2a30b5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 4b74d71..faf7411 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 _0x4eec=['define','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2bf365,_0x1fcd14){var _0x571489=function(_0x305243){while(--_0x305243){_0x2bf365['push'](_0x2bf365['shift']());}};_0x571489(++_0x1fcd14);}(_0x4eec,0x1e9));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc4ee('0x0'))('api');var moment=require(_0xc4ee('0x1'));var BPromise=require('bluebird');var rp=require(_0xc4ee('0x2'));var fs=require('fs');var path=require(_0xc4ee('0x3'));var rimraf=require(_0xc4ee('0x4'));var config=require(_0xc4ee('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xc4ee('0x6')]=function(_0x115683,_0xb81d84){return _0x115683[_0xc4ee('0x7')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b17=['exports','define','SalesforceConfiguration','lodash','util','../../config/logger','moment','request-promise','rimraf','./intSalesforceConfiguration.attributes'];(function(_0x22ae88,_0x3932eb){var _0x157f88=function(_0x592b3c){while(--_0x592b3c){_0x22ae88['push'](_0x22ae88['shift']());}};_0x157f88(++_0x3932eb);}(_0x6b17,0x11b));var _0x76b1=function(_0x392f82,_0x4dc713){_0x392f82=_0x392f82-0x0;var _0x3ad0b8=_0x6b17[_0x392f82];return _0x3ad0b8;};'use strict';var _=require(_0x76b1('0x0'));var util=require(_0x76b1('0x1'));var logger=require(_0x76b1('0x2'))('api');var moment=require(_0x76b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x76b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b1('0x5'));var config=require('../../config/environment');var attributes=require(_0x76b1('0x6'));module[_0x76b1('0x7')]=function(_0xc77a73,_0x422b54){return _0xc77a73[_0x76b1('0x8')](_0x76b1('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 445edcc..7c298d1 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 _0xc92b=['../../config/logger','rpc','../../config/environment','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xc92b,0x1f3));var _0xbc92=function(_0x1dc419,_0x24ecf9){_0x1dc419=_0x1dc419-0x0;var _0x1d805e=_0xc92b[_0x1dc419];return _0x1d805e;};'use strict';var _=require(_0xbc92('0x0'));var util=require(_0xbc92('0x1'));var moment=require('moment');var BPromise=require(_0xbc92('0x2'));var rs=require(_0xbc92('0x3'));var fs=require('fs');var Redis=require(_0xbc92('0x4'));var db=require(_0xbc92('0x5'))['db'];var utils=require(_0xbc92('0x6'));var logger=require(_0xbc92('0x7'))(_0xbc92('0x8'));var config=require(_0xbc92('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbc92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b0d1a,_0x522d64,_0x20eaa9){return new BPromise(function(_0x1a8fab,_0x282159){return client[_0xbc92('0xb')](_0x4b0d1a,_0x20eaa9)['then'](function(_0x5d9478){logger[_0xbc92('0xc')](_0xbc92('0xd'),_0x522d64,'request\x20sent');logger[_0xbc92('0xe')](_0xbc92('0xf'),_0x522d64,'request\x20sent',JSON['stringify'](_0x5d9478));if(_0x5d9478[_0xbc92('0x10')]){if(_0x5d9478['error'][_0xbc92('0x11')]===0x1f4){logger[_0xbc92('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x522d64,_0x5d9478[_0xbc92('0x10')][_0xbc92('0x12')]);return _0x282159(_0x5d9478[_0xbc92('0x10')][_0xbc92('0x12')]);}logger[_0xbc92('0x10')](_0xbc92('0xd'),_0x522d64,_0x5d9478[_0xbc92('0x10')][_0xbc92('0x12')]);return _0x1a8fab(_0x5d9478[_0xbc92('0x10')][_0xbc92('0x12')]);}else{logger[_0xbc92('0xc')](_0xbc92('0xd'),_0x522d64,_0xbc92('0x13'));_0x1a8fab(_0x5d9478[_0xbc92('0x14')][_0xbc92('0x12')]);}})[_0xbc92('0x15')](function(_0x532ad7){logger[_0xbc92('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x522d64,_0x532ad7);_0x282159(_0x532ad7);});});} \ No newline at end of file +var _0x6608=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','randomstring'];(function(_0x4ab760,_0x426fad){var _0x1df3ff=function(_0x3b6e2f){while(--_0x3b6e2f){_0x4ab760['push'](_0x4ab760['shift']());}};_0x1df3ff(++_0x426fad);}(_0x6608,0x174));var _0x8660=function(_0x34169c,_0x2fca01){_0x34169c=_0x34169c-0x0;var _0x42fdea=_0x6608[_0x34169c];return _0x42fdea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8660('0x0'));var BPromise=require('bluebird');var rs=require(_0x8660('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8660('0x2'))['db'];var utils=require(_0x8660('0x3'));var logger=require(_0x8660('0x4'))(_0x8660('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8660('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xcad938,_0x640178,_0x508349){return new BPromise(function(_0x4aedbb,_0x455bf3){return client['request'](_0xcad938,_0x508349)[_0x8660('0x7')](function(_0x49d84f){logger[_0x8660('0x8')](_0x8660('0x9'),_0x640178,_0x8660('0xa'));logger[_0x8660('0xb')](_0x8660('0xc'),_0x640178,_0x8660('0xa'),JSON[_0x8660('0xd')](_0x49d84f));if(_0x49d84f['error']){if(_0x49d84f['error']['code']===0x1f4){logger[_0x8660('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x640178,_0x49d84f[_0x8660('0xe')][_0x8660('0xf')]);return _0x455bf3(_0x49d84f[_0x8660('0xe')][_0x8660('0xf')]);}logger[_0x8660('0xe')](_0x8660('0x9'),_0x640178,_0x49d84f[_0x8660('0xe')][_0x8660('0xf')]);return _0x4aedbb(_0x49d84f['error'][_0x8660('0xf')]);}else{logger[_0x8660('0x8')](_0x8660('0x9'),_0x640178,_0x8660('0xa'));_0x4aedbb(_0x49d84f['result'][_0x8660('0xf')]);}})[_0x8660('0x10')](function(_0x3808a3){logger[_0x8660('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x640178,_0x3808a3);_0x455bf3(_0x3808a3);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 998f3e3..66f1027 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 _0x6096=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show'];(function(_0x424975,_0x1c34e4){var _0x257c9f=function(_0x489a62){while(--_0x489a62){_0x424975['push'](_0x424975['shift']());}};_0x257c9f(++_0x1c34e4);}(_0x6096,0x1ab));var _0x6609=function(_0x403e08,_0x475d8b){_0x403e08=_0x403e08-0x0;var _0x26cb04=_0x6096[_0x403e08];return _0x26cb04;};'use strict';var multer=require(_0x6609('0x0'));var util=require(_0x6609('0x1'));var path=require(_0x6609('0x2'));var timeout=require(_0x6609('0x3'));var express=require(_0x6609('0x4'));var router=express[_0x6609('0x5')]();var fs_extra=require(_0x6609('0x6'));var auth=require(_0x6609('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6609('0x8'));var controller=require(_0x6609('0x9'));router[_0x6609('0xa')]('/',auth[_0x6609('0xb')](),controller['index']);router[_0x6609('0xa')](_0x6609('0xc'),auth[_0x6609('0xb')](),controller[_0x6609('0xd')]);router[_0x6609('0xe')]('/',auth['isAuthenticated'](),controller[_0x6609('0xf')]);router[_0x6609('0x10')]('/:id',auth[_0x6609('0xb')](),controller[_0x6609('0x11')]);router[_0x6609('0x12')](_0x6609('0xc'),auth[_0x6609('0xb')](),controller[_0x6609('0x13')]);module[_0x6609('0x14')]=router; \ No newline at end of file +var _0xa31d=['fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express'];(function(_0x452cb0,_0x465fff){var _0x1f9ca7=function(_0x5c9457){while(--_0x5c9457){_0x452cb0['push'](_0x452cb0['shift']());}};_0x1f9ca7(++_0x465fff);}(_0xa31d,0x152));var _0xda31=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xa31d[_0x561771];return _0x54d16e;};'use strict';var multer=require(_0xda31('0x0'));var util=require(_0xda31('0x1'));var path=require(_0xda31('0x2'));var timeout=require('connect-timeout');var express=require(_0xda31('0x3'));var router=express['Router']();var fs_extra=require(_0xda31('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xda31('0x5'));var config=require(_0xda31('0x6'));var controller=require(_0xda31('0x7'));router[_0xda31('0x8')]('/',auth[_0xda31('0x9')](),controller[_0xda31('0xa')]);router[_0xda31('0x8')](_0xda31('0xb'),auth['isAuthenticated'](),controller[_0xda31('0xc')]);router[_0xda31('0xd')]('/',auth[_0xda31('0x9')](),controller[_0xda31('0xe')]);router[_0xda31('0xf')](_0xda31('0xb'),auth[_0xda31('0x9')](),controller[_0xda31('0x10')]);router[_0xda31('0x11')](_0xda31('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xda31('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b0d8635..f45f093 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 _0xc685=['picklist','string','STRING','variable','sequelize','ENUM','customVariable','keyValue'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xc685,0x18c));var _0x5c68=function(_0x12927f,_0x2e86ed){_0x12927f=_0x12927f-0x0;var _0x3a9f11=_0xc685[_0x12927f];return _0x3a9f11;};'use strict';var Sequelize=require(_0x5c68('0x0'));module['exports']={'type':{'type':Sequelize[_0x5c68('0x1')]('string','variable',_0x5c68('0x2'),_0x5c68('0x3'),_0x5c68('0x4')),'defaultValue':_0x5c68('0x5')},'content':{'type':Sequelize[_0x5c68('0x6')]},'key':{'type':Sequelize[_0x5c68('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5c68('0x5'),_0x5c68('0x7'),_0x5c68('0x2'))},'keyContent':{'type':Sequelize[_0x5c68('0x6')]},'idField':{'type':Sequelize[_0x5c68('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4ebe=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize','exports'];(function(_0x5dce1a,_0x124b3e){var _0xeef0d4=function(_0x554fda){while(--_0x554fda){_0x5dce1a['push'](_0x5dce1a['shift']());}};_0xeef0d4(++_0x124b3e);}(_0x4ebe,0x193));var _0xe4eb=function(_0x4f9325,_0x5a85a4){_0x4f9325=_0x4f9325-0x0;var _0x463f64=_0x4ebe[_0x4f9325];return _0x463f64;};'use strict';var Sequelize=require(_0xe4eb('0x0'));module[_0xe4eb('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe4eb('0x2'),_0xe4eb('0x3'),_0xe4eb('0x4'),_0xe4eb('0x5'),_0xe4eb('0x6')),'defaultValue':_0xe4eb('0x2')},'content':{'type':Sequelize[_0xe4eb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe4eb('0x8')](_0xe4eb('0x2'),_0xe4eb('0x3'),_0xe4eb('0x4'))},'keyContent':{'type':Sequelize[_0xe4eb('0x7')]},'idField':{'type':Sequelize[_0xe4eb('0x7')]},'variableName':{'type':Sequelize[_0xe4eb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index fc7ea61..9f9c7a0 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 _0x2f02=['apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','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','end','status','json','offset','undefined','limit','count','set'];(function(_0x3241e0,_0x5f3409){var _0x4361f7=function(_0x1d1d06){while(--_0x1d1d06){_0x3241e0['push'](_0x3241e0['shift']());}};_0x4361f7(++_0x5f3409);}(_0x2f02,0x1a4));var _0x22f0=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0x2f02[_0x26d386];return _0x4ef9a8;};'use strict';var emlformat=require(_0x22f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x22f0('0x2'));var moment=require(_0x22f0('0x3'));var BPromise=require(_0x22f0('0x4'));var Mustache=require(_0x22f0('0x5'));var util=require(_0x22f0('0x6'));var path=require(_0x22f0('0x7'));var sox=require('sox');var csv=require(_0x22f0('0x8'));var ejs=require(_0x22f0('0x9'));var fs=require('fs');var fs_extra=require(_0x22f0('0xa'));var _=require(_0x22f0('0xb'));var squel=require(_0x22f0('0xc'));var crypto=require(_0x22f0('0xd'));var jsforce=require(_0x22f0('0xe'));var deskjs=require(_0x22f0('0xf'));var toCsv=require(_0x22f0('0x8'));var querystring=require(_0x22f0('0x10'));var Papa=require(_0x22f0('0x11'));var Redis=require(_0x22f0('0x12'));var authService=require(_0x22f0('0x13'));var qs=require(_0x22f0('0x14'));var as=require(_0x22f0('0x15'));var hardwareService=require(_0x22f0('0x16'));var logger=require(_0x22f0('0x17'))(_0x22f0('0x18'));var utils=require(_0x22f0('0x19'));var config=require(_0x22f0('0x1a'));var licenseUtil=require(_0x22f0('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40d3a9,_0x6a475b){_0x6a475b=_0x6a475b||0xcc;return function(_0x4bdfb1){if(_0x4bdfb1){return _0x40d3a9['sendStatus'](_0x6a475b);}return _0x40d3a9['status'](_0x6a475b)[_0x22f0('0x1c')]();};}function respondWithResult(_0x136dac,_0x4d638a){_0x4d638a=_0x4d638a||0xc8;return function(_0xfbfc52){if(_0xfbfc52){return _0x136dac[_0x22f0('0x1d')](_0x4d638a)[_0x22f0('0x1e')](_0xfbfc52);}};}function respondWithFilteredResult(_0xff28d9,_0xbd123e){return function(_0x33fdcf){if(_0x33fdcf){var _0x165dc3=typeof _0xbd123e[_0x22f0('0x1f')]===_0x22f0('0x20')&&typeof _0xbd123e[_0x22f0('0x21')]===_0x22f0('0x20');var _0x49b9f6=_0x33fdcf[_0x22f0('0x22')];var _0x501139=_0x165dc3?0x0:_0xbd123e[_0x22f0('0x1f')];var _0x1d488d=_0x165dc3?_0x33fdcf['count']:_0xbd123e[_0x22f0('0x1f')]+_0xbd123e[_0x22f0('0x21')];var _0x5ba835;if(_0x1d488d>=_0x49b9f6){_0x1d488d=_0x49b9f6;_0x5ba835=0xc8;}else{_0x5ba835=0xce;}_0xff28d9[_0x22f0('0x1d')](_0x5ba835);return _0xff28d9[_0x22f0('0x23')]('Content-Range',_0x501139+'-'+_0x1d488d+'/'+_0x49b9f6)[_0x22f0('0x1e')](_0x33fdcf);}return null;};}function patchUpdates(_0x5c6002){return function(_0x2612d8){try{jsonpatch[_0x22f0('0x24')](_0x2612d8,_0x5c6002,!![]);}catch(_0x295650){return BPromise[_0x22f0('0x25')](_0x295650);}return _0x2612d8[_0x22f0('0x26')]();};}function saveUpdates(_0x301a4b,_0x69ea09){return function(_0x5e01e7){if(_0x5e01e7){return _0x5e01e7['update'](_0x301a4b)['then'](function(_0x222ee3){return _0x222ee3;});}return null;};}function removeEntity(_0x47e4eb,_0x463052){return function(_0x1bc9b1){if(_0x1bc9b1){return _0x1bc9b1[_0x22f0('0x27')]()[_0x22f0('0x28')](function(){_0x47e4eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d23e6,_0x3399f7){return function(_0x57b9c0){if(!_0x57b9c0){_0x3d23e6[_0x22f0('0x29')](0x194);}return _0x57b9c0;};}function handleError(_0x4d0ad5,_0x16210b){_0x16210b=_0x16210b||0x1f4;return function(_0x114f4f){logger[_0x22f0('0x2a')](_0x114f4f[_0x22f0('0x2b')]);if(_0x114f4f[_0x22f0('0x2c')]){delete _0x114f4f['name'];}_0x4d0ad5[_0x22f0('0x1d')](_0x16210b)[_0x22f0('0x2d')](_0x114f4f);};}exports['index']=function(_0xae1144,_0x5a70f9){var _0x27c5aa={},_0x5b7728={},_0x196244={'count':0x0,'rows':[]};var _0x1ff407=_[_0x22f0('0x2e')](db[_0x22f0('0x2f')][_0x22f0('0x30')],function(_0x4efed4){return{'name':_0x4efed4[_0x22f0('0x31')],'type':_0x4efed4['type'][_0x22f0('0x32')]};});_0x5b7728[_0x22f0('0x33')]=_[_0x22f0('0x2e')](_0x1ff407,_0x22f0('0x2c'));_0x5b7728[_0x22f0('0x34')]=_['keys'](_0xae1144[_0x22f0('0x34')]);_0x5b7728['filters']=_[_0x22f0('0x35')](_0x5b7728['model'],_0x5b7728[_0x22f0('0x34')]);_0x27c5aa[_0x22f0('0x36')]=_['intersection'](_0x5b7728[_0x22f0('0x33')],qs[_0x22f0('0x37')](_0xae1144[_0x22f0('0x34')]['fields']));_0x27c5aa[_0x22f0('0x36')]=_0x27c5aa[_0x22f0('0x36')][_0x22f0('0x38')]?_0x27c5aa['attributes']:_0x5b7728['model'];if(!_0xae1144['query']['hasOwnProperty'](_0x22f0('0x39'))){_0x27c5aa[_0x22f0('0x21')]=qs['limit'](_0xae1144[_0x22f0('0x34')]['limit']);_0x27c5aa[_0x22f0('0x1f')]=qs[_0x22f0('0x1f')](_0xae1144[_0x22f0('0x34')][_0x22f0('0x1f')]);}_0x27c5aa[_0x22f0('0x3a')]=qs[_0x22f0('0x3b')](_0xae1144[_0x22f0('0x34')][_0x22f0('0x3b')]);_0x27c5aa[_0x22f0('0x3c')]=qs[_0x22f0('0x3d')](_['pick'](_0xae1144[_0x22f0('0x34')],_0x5b7728[_0x22f0('0x3d')]),_0x1ff407);if(_0xae1144['query']['filter']){_0x27c5aa[_0x22f0('0x3c')]=_['merge'](_0x27c5aa['where'],{'$or':_[_0x22f0('0x2e')](_0x1ff407,function(_0x257cd4){if(_0x257cd4['type']!==_0x22f0('0x3e')){var _0x1afbdf={};_0x1afbdf[_0x257cd4[_0x22f0('0x2c')]]={'$like':'%'+_0xae1144['query'][_0x22f0('0x3f')]+'%'};return _0x1afbdf;}})});}_0x27c5aa=_[_0x22f0('0x40')]({},_0x27c5aa,_0xae1144[_0x22f0('0x41')]);var _0x2e13d3={'where':_0x27c5aa['where']};return db[_0x22f0('0x2f')]['count'](_0x2e13d3)[_0x22f0('0x28')](function(_0x55e05a){_0x196244['count']=_0x55e05a;if(_0xae1144[_0x22f0('0x34')][_0x22f0('0x42')]){_0x27c5aa[_0x22f0('0x43')]=[{'all':!![]}];}return db[_0x22f0('0x2f')]['findAll'](_0x27c5aa);})[_0x22f0('0x28')](function(_0x3cc350){_0x196244[_0x22f0('0x44')]=_0x3cc350;return _0x196244;})[_0x22f0('0x28')](respondWithFilteredResult(_0x5a70f9,_0x27c5aa))[_0x22f0('0x45')](handleError(_0x5a70f9,null));};exports[_0x22f0('0x46')]=function(_0x4b3932,_0x29b0d3){var _0x5c5fb5={'raw':!![],'where':{'id':_0x4b3932[_0x22f0('0x47')]['id']}},_0x4e33c8={};_0x4e33c8[_0x22f0('0x33')]=_['keys'](db[_0x22f0('0x2f')][_0x22f0('0x30')]);_0x4e33c8[_0x22f0('0x34')]=_[_0x22f0('0x48')](_0x4b3932['query']);_0x4e33c8[_0x22f0('0x3d')]=_[_0x22f0('0x35')](_0x4e33c8[_0x22f0('0x33')],_0x4e33c8[_0x22f0('0x34')]);_0x5c5fb5['attributes']=_[_0x22f0('0x35')](_0x4e33c8[_0x22f0('0x33')],qs[_0x22f0('0x37')](_0x4b3932[_0x22f0('0x34')][_0x22f0('0x37')]));_0x5c5fb5[_0x22f0('0x36')]=_0x5c5fb5[_0x22f0('0x36')][_0x22f0('0x38')]?_0x5c5fb5[_0x22f0('0x36')]:_0x4e33c8['model'];if(_0x4b3932[_0x22f0('0x34')]['includeAll']){_0x5c5fb5['include']=[{'all':!![]}];}_0x5c5fb5=_['merge']({},_0x5c5fb5,_0x4b3932['options']);return db['SalesforceField'][_0x22f0('0x49')](_0x5c5fb5)['then'](handleEntityNotFound(_0x29b0d3,null))['then'](respondWithResult(_0x29b0d3,null))[_0x22f0('0x45')](handleError(_0x29b0d3,null));};exports[_0x22f0('0x4a')]=function(_0x2b277d,_0x5ddd23){return db[_0x22f0('0x2f')][_0x22f0('0x4a')](_0x2b277d[_0x22f0('0x4b')],{})[_0x22f0('0x28')](respondWithResult(_0x5ddd23,0xc9))[_0x22f0('0x45')](handleError(_0x5ddd23,null));};exports['update']=function(_0x5ea6d0,_0x189d84){if(_0x5ea6d0['body']['id']){delete _0x5ea6d0[_0x22f0('0x4b')]['id'];}return db[_0x22f0('0x2f')][_0x22f0('0x49')]({'where':{'id':_0x5ea6d0['params']['id']}})['then'](handleEntityNotFound(_0x189d84,null))[_0x22f0('0x28')](saveUpdates(_0x5ea6d0[_0x22f0('0x4b')],null))['then'](respondWithResult(_0x189d84,null))[_0x22f0('0x45')](handleError(_0x189d84,null));};exports[_0x22f0('0x27')]=function(_0x3be414,_0x29dcf1){return db['SalesforceField'][_0x22f0('0x49')]({'where':{'id':_0x3be414['params']['id']}})[_0x22f0('0x28')](handleEntityNotFound(_0x29dcf1,null))[_0x22f0('0x28')](removeEntity(_0x29dcf1,null))['catch'](handleError(_0x29dcf1,null));}; \ No newline at end of file +var _0x7f36=['sort','where','filter','merge','VIRTUAL','options','SalesforceField','include','findAll','params','length','includeAll','find','catch','create','body','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit'];(function(_0x1fdab4,_0x5c516f){var _0x39b038=function(_0x2a8eed){while(--_0x2a8eed){_0x1fdab4['push'](_0x1fdab4['shift']());}};_0x39b038(++_0x5c516f);}(_0x7f36,0x1ec));var _0x67f3=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x7f36[_0x1cfe2e];return _0x39233f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x67f3('0x0'));var jsonpatch=require(_0x67f3('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67f3('0x2'));var Mustache=require(_0x67f3('0x3'));var util=require(_0x67f3('0x4'));var path=require('path');var sox=require(_0x67f3('0x5'));var csv=require(_0x67f3('0x6'));var ejs=require(_0x67f3('0x7'));var fs=require('fs');var fs_extra=require(_0x67f3('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x67f3('0x9'));var jsforce=require(_0x67f3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x67f3('0x6'));var querystring=require(_0x67f3('0xb'));var Papa=require(_0x67f3('0xc'));var Redis=require('ioredis');var authService=require(_0x67f3('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x67f3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67f3('0xf'))(_0x67f3('0x10'));var utils=require(_0x67f3('0x11'));var config=require(_0x67f3('0x12'));var licenseUtil=require(_0x67f3('0x13'));var db=require(_0x67f3('0x14'))['db'];function respondWithStatusCode(_0x3d34da,_0x50e377){_0x50e377=_0x50e377||0xcc;return function(_0x476d86){if(_0x476d86){return _0x3d34da['sendStatus'](_0x50e377);}return _0x3d34da[_0x67f3('0x15')](_0x50e377)['end']();};}function respondWithResult(_0x56e5a2,_0x51e4c3){_0x51e4c3=_0x51e4c3||0xc8;return function(_0x12df74){if(_0x12df74){return _0x56e5a2['status'](_0x51e4c3)['json'](_0x12df74);}};}function respondWithFilteredResult(_0x3c7b32,_0x21c344){return function(_0xf268b){if(_0xf268b){var _0x3c5183=typeof _0x21c344['offset']===_0x67f3('0x16')&&typeof _0x21c344[_0x67f3('0x17')]===_0x67f3('0x16');var _0x1e8bb7=_0xf268b[_0x67f3('0x18')];var _0x2d368e=_0x3c5183?0x0:_0x21c344[_0x67f3('0x19')];var _0x384783=_0x3c5183?_0xf268b[_0x67f3('0x18')]:_0x21c344[_0x67f3('0x19')]+_0x21c344[_0x67f3('0x17')];var _0x5ec86b;if(_0x384783>=_0x1e8bb7){_0x384783=_0x1e8bb7;_0x5ec86b=0xc8;}else{_0x5ec86b=0xce;}_0x3c7b32[_0x67f3('0x15')](_0x5ec86b);return _0x3c7b32[_0x67f3('0x1a')]('Content-Range',_0x2d368e+'-'+_0x384783+'/'+_0x1e8bb7)['json'](_0xf268b);}return null;};}function patchUpdates(_0x3bd8db){return function(_0x319c47){try{jsonpatch[_0x67f3('0x1b')](_0x319c47,_0x3bd8db,!![]);}catch(_0x50cfff){return BPromise[_0x67f3('0x1c')](_0x50cfff);}return _0x319c47[_0x67f3('0x1d')]();};}function saveUpdates(_0x44b7ed,_0x56834d){return function(_0x3ced5f){if(_0x3ced5f){return _0x3ced5f[_0x67f3('0x1e')](_0x44b7ed)[_0x67f3('0x1f')](function(_0x3f9262){return _0x3f9262;});}return null;};}function removeEntity(_0x2cf92d,_0x5f1f57){return function(_0x57b935){if(_0x57b935){return _0x57b935[_0x67f3('0x20')]()['then'](function(){_0x2cf92d[_0x67f3('0x15')](0xcc)[_0x67f3('0x21')]();});}};}function handleEntityNotFound(_0x66fde6,_0x373655){return function(_0x387888){if(!_0x387888){_0x66fde6[_0x67f3('0x22')](0x194);}return _0x387888;};}function handleError(_0x519a85,_0x4a93cc){_0x4a93cc=_0x4a93cc||0x1f4;return function(_0x2d30cd){logger[_0x67f3('0x23')](_0x2d30cd[_0x67f3('0x24')]);if(_0x2d30cd[_0x67f3('0x25')]){delete _0x2d30cd['name'];}_0x519a85[_0x67f3('0x15')](_0x4a93cc)[_0x67f3('0x26')](_0x2d30cd);};}exports[_0x67f3('0x27')]=function(_0x3b3d46,_0x432d06){var _0xc7d0c8={},_0x1c0f32={},_0x51140b={'count':0x0,'rows':[]};var _0x5c827d=_[_0x67f3('0x28')](db['SalesforceField'][_0x67f3('0x29')],function(_0x32cd7c){return{'name':_0x32cd7c['fieldName'],'type':_0x32cd7c[_0x67f3('0x2a')][_0x67f3('0x2b')]};});_0x1c0f32[_0x67f3('0x2c')]=_[_0x67f3('0x28')](_0x5c827d,_0x67f3('0x25'));_0x1c0f32[_0x67f3('0x2d')]=_[_0x67f3('0x2e')](_0x3b3d46[_0x67f3('0x2d')]);_0x1c0f32[_0x67f3('0x2f')]=_[_0x67f3('0x30')](_0x1c0f32['model'],_0x1c0f32[_0x67f3('0x2d')]);_0xc7d0c8[_0x67f3('0x31')]=_[_0x67f3('0x30')](_0x1c0f32['model'],qs[_0x67f3('0x32')](_0x3b3d46['query'][_0x67f3('0x32')]));_0xc7d0c8[_0x67f3('0x31')]=_0xc7d0c8[_0x67f3('0x31')]['length']?_0xc7d0c8[_0x67f3('0x31')]:_0x1c0f32[_0x67f3('0x2c')];if(!_0x3b3d46[_0x67f3('0x2d')]['hasOwnProperty'](_0x67f3('0x33'))){_0xc7d0c8[_0x67f3('0x17')]=qs[_0x67f3('0x17')](_0x3b3d46['query'][_0x67f3('0x17')]);_0xc7d0c8[_0x67f3('0x19')]=qs[_0x67f3('0x19')](_0x3b3d46['query']['offset']);}_0xc7d0c8['order']=qs[_0x67f3('0x34')](_0x3b3d46['query']['sort']);_0xc7d0c8[_0x67f3('0x35')]=qs[_0x67f3('0x2f')](_['pick'](_0x3b3d46[_0x67f3('0x2d')],_0x1c0f32['filters']),_0x5c827d);if(_0x3b3d46[_0x67f3('0x2d')][_0x67f3('0x36')]){_0xc7d0c8['where']=_[_0x67f3('0x37')](_0xc7d0c8[_0x67f3('0x35')],{'$or':_[_0x67f3('0x28')](_0x5c827d,function(_0x430a93){if(_0x430a93[_0x67f3('0x2a')]!==_0x67f3('0x38')){var _0x534917={};_0x534917[_0x430a93[_0x67f3('0x25')]]={'$like':'%'+_0x3b3d46['query'][_0x67f3('0x36')]+'%'};return _0x534917;}})});}_0xc7d0c8=_[_0x67f3('0x37')]({},_0xc7d0c8,_0x3b3d46[_0x67f3('0x39')]);var _0x11da01={'where':_0xc7d0c8[_0x67f3('0x35')]};return db[_0x67f3('0x3a')][_0x67f3('0x18')](_0x11da01)['then'](function(_0x4a810f){_0x51140b[_0x67f3('0x18')]=_0x4a810f;if(_0x3b3d46[_0x67f3('0x2d')]['includeAll']){_0xc7d0c8[_0x67f3('0x3b')]=[{'all':!![]}];}return db[_0x67f3('0x3a')][_0x67f3('0x3c')](_0xc7d0c8);})['then'](function(_0x5054e6){_0x51140b['rows']=_0x5054e6;return _0x51140b;})[_0x67f3('0x1f')](respondWithFilteredResult(_0x432d06,_0xc7d0c8))['catch'](handleError(_0x432d06,null));};exports['show']=function(_0x4309a0,_0x569a75){var _0x2038e0={'raw':!![],'where':{'id':_0x4309a0[_0x67f3('0x3d')]['id']}},_0x4a167d={};_0x4a167d[_0x67f3('0x2c')]=_[_0x67f3('0x2e')](db['SalesforceField'][_0x67f3('0x29')]);_0x4a167d[_0x67f3('0x2d')]=_['keys'](_0x4309a0[_0x67f3('0x2d')]);_0x4a167d['filters']=_[_0x67f3('0x30')](_0x4a167d[_0x67f3('0x2c')],_0x4a167d['query']);_0x2038e0['attributes']=_[_0x67f3('0x30')](_0x4a167d[_0x67f3('0x2c')],qs[_0x67f3('0x32')](_0x4309a0['query']['fields']));_0x2038e0[_0x67f3('0x31')]=_0x2038e0[_0x67f3('0x31')][_0x67f3('0x3e')]?_0x2038e0[_0x67f3('0x31')]:_0x4a167d[_0x67f3('0x2c')];if(_0x4309a0[_0x67f3('0x2d')][_0x67f3('0x3f')]){_0x2038e0['include']=[{'all':!![]}];}_0x2038e0=_[_0x67f3('0x37')]({},_0x2038e0,_0x4309a0[_0x67f3('0x39')]);return db[_0x67f3('0x3a')][_0x67f3('0x40')](_0x2038e0)[_0x67f3('0x1f')](handleEntityNotFound(_0x569a75,null))[_0x67f3('0x1f')](respondWithResult(_0x569a75,null))[_0x67f3('0x41')](handleError(_0x569a75,null));};exports[_0x67f3('0x42')]=function(_0x533353,_0x21c9a7){return db[_0x67f3('0x3a')]['create'](_0x533353[_0x67f3('0x43')],{})[_0x67f3('0x1f')](respondWithResult(_0x21c9a7,0xc9))[_0x67f3('0x41')](handleError(_0x21c9a7,null));};exports[_0x67f3('0x1e')]=function(_0x15c93c,_0x2f1999){if(_0x15c93c[_0x67f3('0x43')]['id']){delete _0x15c93c[_0x67f3('0x43')]['id'];}return db[_0x67f3('0x3a')][_0x67f3('0x40')]({'where':{'id':_0x15c93c['params']['id']}})['then'](handleEntityNotFound(_0x2f1999,null))['then'](saveUpdates(_0x15c93c[_0x67f3('0x43')],null))[_0x67f3('0x1f')](respondWithResult(_0x2f1999,null))[_0x67f3('0x41')](handleError(_0x2f1999,null));};exports['destroy']=function(_0x3df5fa,_0x4a4958){return db[_0x67f3('0x3a')][_0x67f3('0x40')]({'where':{'id':_0x3df5fa[_0x67f3('0x3d')]['id']}})[_0x67f3('0x1f')](handleEntityNotFound(_0x4a4958,null))[_0x67f3('0x1f')](removeEntity(_0x4a4958,null))[_0x67f3('0x41')](handleError(_0x4a4958,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 444fd92..e3eef3b 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 _0xb910=['./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb910,0x11e));var _0x0b91=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb910[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var logger=require(_0x0b91('0x2'))(_0x0b91('0x3'));var moment=require(_0x0b91('0x4'));var BPromise=require('bluebird');var rp=require(_0x0b91('0x5'));var fs=require('fs');var path=require(_0x0b91('0x6'));var rimraf=require(_0x0b91('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b91('0x8'));module[_0x0b91('0x9')]=function(_0x1d1f52,_0x28d92c){return _0x1d1f52[_0x0b91('0xa')](_0x0b91('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x0b91('0xc'),'fields':['idField',_0x0b91('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe944=['request-promise','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment','bluebird'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0xe944,0xea));var _0x4e94=function(_0x243dfb,_0x215457){_0x243dfb=_0x243dfb-0x0;var _0x58aacf=_0xe944[_0x243dfb];return _0x58aacf;};'use strict';var _=require(_0x4e94('0x0'));var util=require(_0x4e94('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4e94('0x2'));var BPromise=require(_0x4e94('0x3'));var rp=require(_0x4e94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e94('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e94('0x6'));module[_0x4e94('0x7')]=function(_0xcc4636,_0x1d3ca7){return _0xcc4636[_0x4e94('0x8')](_0x4e94('0x9'),attributes,{'tableName':_0x4e94('0xa'),'paranoid':![],'indexes':[{'name':_0x4e94('0xb'),'fields':[_0x4e94('0xc'),_0x4e94('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 97ffd90..abbd227 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 _0xb8e7=['bluebird','../../mysqldb','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','error','code','message','result','catch','lodash','util','moment'];(function(_0x34037f,_0x21f444){var _0x217ea2=function(_0x333300){while(--_0x333300){_0x34037f['push'](_0x34037f['shift']());}};_0x217ea2(++_0x21f444);}(_0xb8e7,0x6b));var _0x7b8e=function(_0x17e743,_0x568254){_0x17e743=_0x17e743-0x0;var _0x263c25=_0xb8e7[_0x17e743];return _0x263c25;};'use strict';var _=require(_0x7b8e('0x0'));var util=require(_0x7b8e('0x1'));var moment=require(_0x7b8e('0x2'));var BPromise=require(_0x7b8e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b8e('0x5'));var config=require(_0x7b8e('0x6'));var jayson=require(_0x7b8e('0x7'));var client=jayson[_0x7b8e('0x8')][_0x7b8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420caa,_0x3de4d2,_0x316f89){return new BPromise(function(_0x37a15e,_0x101669){return client[_0x7b8e('0xa')](_0x420caa,_0x316f89)[_0x7b8e('0xb')](function(_0x3fae50){logger[_0x7b8e('0xc')](_0x7b8e('0xd'),_0x3de4d2,_0x7b8e('0xe'));logger[_0x7b8e('0xf')](_0x7b8e('0x10'),_0x3de4d2,_0x7b8e('0xe'),JSON['stringify'](_0x3fae50));if(_0x3fae50[_0x7b8e('0x11')]){if(_0x3fae50[_0x7b8e('0x11')][_0x7b8e('0x12')]===0x1f4){logger['error'](_0x7b8e('0xd'),_0x3de4d2,_0x3fae50[_0x7b8e('0x11')][_0x7b8e('0x13')]);return _0x101669(_0x3fae50[_0x7b8e('0x11')][_0x7b8e('0x13')]);}logger['error'](_0x7b8e('0xd'),_0x3de4d2,_0x3fae50[_0x7b8e('0x11')]['message']);return _0x37a15e(_0x3fae50['error'][_0x7b8e('0x13')]);}else{logger[_0x7b8e('0xc')](_0x7b8e('0xd'),_0x3de4d2,'request\x20sent');_0x37a15e(_0x3fae50[_0x7b8e('0x14')]['message']);}})[_0x7b8e('0x15')](function(_0x318ecb){logger[_0x7b8e('0x11')]('SalesforceField,\x20%s,\x20%s',_0x3de4d2,_0x318ecb);_0x101669(_0x318ecb);});});} \ No newline at end of file +var _0x158c=['message','request\x20sent','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xc439d5,_0x55b542){var _0x54ce5b=function(_0x975b31){while(--_0x975b31){_0xc439d5['push'](_0xc439d5['shift']());}};_0x54ce5b(++_0x55b542);}(_0x158c,0x71));var _0xc158=function(_0x21bc4c,_0x5b74bf){_0x21bc4c=_0x21bc4c-0x0;var _0x5b7f9e=_0x158c[_0x21bc4c];return _0x5b7f9e;};'use strict';var _=require(_0xc158('0x0'));var util=require(_0xc158('0x1'));var moment=require(_0xc158('0x2'));var BPromise=require('bluebird');var rs=require(_0xc158('0x3'));var fs=require('fs');var Redis=require(_0xc158('0x4'));var db=require(_0xc158('0x5'))['db'];var utils=require(_0xc158('0x6'));var logger=require(_0xc158('0x7'))(_0xc158('0x8'));var config=require(_0xc158('0x9'));var jayson=require(_0xc158('0xa'));var client=jayson['client'][_0xc158('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48875e,_0x5caaa8,_0x5cbb0c){return new BPromise(function(_0x39d676,_0x3c09e5){return client['request'](_0x48875e,_0x5cbb0c)[_0xc158('0xc')](function(_0x528f5c){logger[_0xc158('0xd')](_0xc158('0xe'),_0x5caaa8,'request\x20sent');logger[_0xc158('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5caaa8,'request\x20sent',JSON[_0xc158('0x10')](_0x528f5c));if(_0x528f5c[_0xc158('0x11')]){if(_0x528f5c[_0xc158('0x11')][_0xc158('0x12')]===0x1f4){logger[_0xc158('0x11')](_0xc158('0xe'),_0x5caaa8,_0x528f5c[_0xc158('0x11')][_0xc158('0x13')]);return _0x3c09e5(_0x528f5c['error']['message']);}logger[_0xc158('0x11')](_0xc158('0xe'),_0x5caaa8,_0x528f5c[_0xc158('0x11')]['message']);return _0x39d676(_0x528f5c['error'][_0xc158('0x13')]);}else{logger[_0xc158('0xd')](_0xc158('0xe'),_0x5caaa8,_0xc158('0x14'));_0x39d676(_0x528f5c['result'][_0xc158('0x13')]);}})[_0xc158('0x15')](function(_0xf9eca3){logger['error'](_0xc158('0xe'),_0x5caaa8,_0xf9eca3);_0x3c09e5(_0xf9eca3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 2fb2225..a45ef34 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 _0x9bfa=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x58421e,_0x17cc3a){var _0x2001a1=function(_0xbc85b4){while(--_0xbc85b4){_0x58421e['push'](_0x58421e['shift']());}};_0x2001a1(++_0x17cc3a);}(_0x9bfa,0x167));var _0xa9bf=function(_0x5ae2ba,_0x4809ce){_0x5ae2ba=_0x5ae2ba-0x0;var _0x326a5d=_0x9bfa[_0x5ae2ba];return _0x326a5d;};'use strict';var multer=require(_0xa9bf('0x0'));var util=require(_0xa9bf('0x1'));var path=require('path');var timeout=require(_0xa9bf('0x2'));var express=require(_0xa9bf('0x3'));var router=express[_0xa9bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa9bf('0x5'));var interaction=require(_0xa9bf('0x6'));var config=require(_0xa9bf('0x7'));var controller=require(_0xa9bf('0x8'));router[_0xa9bf('0x9')]('/',auth[_0xa9bf('0xa')](),controller[_0xa9bf('0xb')]);router[_0xa9bf('0x9')]('/:id',auth[_0xa9bf('0xa')](),controller[_0xa9bf('0xc')]);router[_0xa9bf('0x9')](_0xa9bf('0xd'),auth['isAuthenticated'](),controller[_0xa9bf('0xe')]);router[_0xa9bf('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa9bf('0xf')]);router['post']('/',auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x10')]);router['post'](_0xa9bf('0xd'),auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x11')]);router[_0xa9bf('0x12')](_0xa9bf('0x13'),auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x14')]);router[_0xa9bf('0x15')](_0xa9bf('0x13'),auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x16')]);module[_0xa9bf('0x17')]=router; \ No newline at end of file +var _0x28a1=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id'];(function(_0x90c569,_0x39c751){var _0x2576f8=function(_0x3985b8){while(--_0x3985b8){_0x90c569['push'](_0x90c569['shift']());}};_0x2576f8(++_0x39c751);}(_0x28a1,0x145));var _0x128a=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x28a1[_0x4a93bb];return _0x208468;};'use strict';var multer=require(_0x128a('0x0'));var util=require(_0x128a('0x1'));var path=require('path');var timeout=require(_0x128a('0x2'));var express=require(_0x128a('0x3'));var router=express[_0x128a('0x4')]();var fs_extra=require(_0x128a('0x5'));var auth=require(_0x128a('0x6'));var interaction=require(_0x128a('0x7'));var config=require(_0x128a('0x8'));var controller=require(_0x128a('0x9'));router[_0x128a('0xa')]('/',auth['isAuthenticated'](),controller[_0x128a('0xb')]);router[_0x128a('0xa')](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0xe')]);router[_0x128a('0xa')](_0x128a('0xf'),auth['isAuthenticated'](),controller[_0x128a('0x10')]);router[_0x128a('0xa')](_0x128a('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0x128a('0x12')]('/',auth[_0x128a('0xd')](),controller[_0x128a('0x13')]);router[_0x128a('0x12')](_0x128a('0xf'),auth[_0x128a('0xd')](),controller[_0x128a('0x14')]);router[_0x128a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x128a('0x16')]);router[_0x128a('0x17')](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0x18')]);module[_0x128a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 26b9df4..2c02f46 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 _0x7b7a=['STRING','exports'];(function(_0x731feb,_0x2a6924){var _0x87949f=function(_0x4c6abd){while(--_0x4c6abd){_0x731feb['push'](_0x731feb['shift']());}};_0x87949f(++_0x2a6924);}(_0x7b7a,0x16d));var _0xa7b7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7b7a[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0xa7b7('0x0')]={'name':{'type':Sequelize[_0xa7b7('0x1')]},'description':{'type':Sequelize[_0xa7b7('0x1')]},'username':{'type':Sequelize[_0xa7b7('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xa7b7('0x1')]},'email':{'type':Sequelize[_0xa7b7('0x1')]},'remoteUri':{'type':Sequelize[_0xa7b7('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa7b7('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x78ba=['username','remoteUri','sequelize','exports','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x78ba,0xe3));var _0xa78b=function(_0x23dc12,_0x3ee4e2){_0x23dc12=_0x23dc12-0x0;var _0x1ac010=_0x78ba[_0x23dc12];return _0x1ac010;};'use strict';var Sequelize=require(_0xa78b('0x0'));module[_0xa78b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa78b('0x2')]},'username':{'type':Sequelize[_0xa78b('0x2')],'unique':_0xa78b('0x3')},'password':{'type':Sequelize[_0xa78b('0x2')]},'email':{'type':Sequelize[_0xa78b('0x2')]},'remoteUri':{'type':Sequelize[_0xa78b('0x2')],'unique':_0xa78b('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index b40e3cd..86c09d8 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 _0x51bd=['delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','assigned_to','comments','sla_due','comments_and_work_notes','sys_mod_count','reopen_count','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','ServicenowAccount','rawAttributes','find','catch','create','body','params','getConfigurations','ServicenowConfiguration','pick','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','user_input','sys_domain','state','sys_created_by','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','time_worked','expected_start','opened_at','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x51bd,0xf0));var _0xd51b=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x51bd[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0xd51b('0x0'));var rimraf=require(_0xd51b('0x1'));var zipdir=require(_0xd51b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd51b('0x3'));var moment=require(_0xd51b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd51b('0x5'));var util=require(_0xd51b('0x6'));var path=require('path');var sox=require(_0xd51b('0x7'));var csv=require(_0xd51b('0x8'));var ejs=require(_0xd51b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd51b('0xa'));var squel=require(_0xd51b('0xb'));var crypto=require(_0xd51b('0xc'));var jsforce=require(_0xd51b('0xd'));var deskjs=require(_0xd51b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd51b('0xf'));var Papa=require(_0xd51b('0x10'));var Redis=require(_0xd51b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd51b('0x12'));var as=require(_0xd51b('0x13'));var hardwareService=require(_0xd51b('0x14'));var logger=require('../../config/logger')(_0xd51b('0x15'));var utils=require('../../config/utils');var config=require(_0xd51b('0x16'));var licenseUtil=require(_0xd51b('0x17'));var db=require(_0xd51b('0x18'))['db'];var integrations=require(_0xd51b('0x19'));function respondWithStatusCode(_0x14343b,_0x332e03){_0x332e03=_0x332e03||0xcc;return function(_0x1e9be6){if(_0x1e9be6){return _0x14343b['sendStatus'](_0x332e03);}return _0x14343b[_0xd51b('0x1a')](_0x332e03)[_0xd51b('0x1b')]();};}function respondWithResult(_0x1929a1,_0x276257){_0x276257=_0x276257||0xc8;return function(_0x1bfec0){if(_0x1bfec0){return _0x1929a1[_0xd51b('0x1a')](_0x276257)[_0xd51b('0x1c')](_0x1bfec0);}};}function respondWithFilteredResult(_0x213384,_0x54dbe8){return function(_0x3cfd15){if(_0x3cfd15){var _0x57b1e1=typeof _0x54dbe8['offset']===_0xd51b('0x1d')&&typeof _0x54dbe8[_0xd51b('0x1e')]===_0xd51b('0x1d');var _0x637c38=_0x3cfd15[_0xd51b('0x1f')];var _0xff72b9=_0x57b1e1?0x0:_0x54dbe8[_0xd51b('0x20')];var _0x117631=_0x57b1e1?_0x3cfd15[_0xd51b('0x1f')]:_0x54dbe8[_0xd51b('0x20')]+_0x54dbe8['limit'];var _0x58efdd;if(_0x117631>=_0x637c38){_0x117631=_0x637c38;_0x58efdd=0xc8;}else{_0x58efdd=0xce;}_0x213384[_0xd51b('0x1a')](_0x58efdd);return _0x213384['set']('Content-Range',_0xff72b9+'-'+_0x117631+'/'+_0x637c38)[_0xd51b('0x1c')](_0x3cfd15);}return null;};}function patchUpdates(_0x14c5fd){return function(_0x242f90){try{jsonpatch[_0xd51b('0x21')](_0x242f90,_0x14c5fd,!![]);}catch(_0x3cfc20){return BPromise[_0xd51b('0x22')](_0x3cfc20);}return _0x242f90['save']();};}function saveUpdates(_0x4c6d82,_0x201dad){return function(_0x3a0a71){if(_0x3a0a71){return _0x3a0a71[_0xd51b('0x23')](_0x4c6d82)[_0xd51b('0x24')](function(_0xc58c94){return _0xc58c94;});}return null;};}function removeEntity(_0x48fc6f,_0x5887f6){return function(_0x5ca585){if(_0x5ca585){return _0x5ca585[_0xd51b('0x25')]()[_0xd51b('0x24')](function(){_0x48fc6f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7ce1,_0x3ff11e){return function(_0x2bbbfe){if(!_0x2bbbfe){_0xe7ce1[_0xd51b('0x26')](0x194);}return _0x2bbbfe;};}function handleError(_0x26a279,_0x4759e4){_0x4759e4=_0x4759e4||0x1f4;return function(_0x23099a){logger[_0xd51b('0x27')](_0x23099a[_0xd51b('0x28')]);if(_0x23099a[_0xd51b('0x29')]){delete _0x23099a[_0xd51b('0x29')];}_0x26a279[_0xd51b('0x1a')](_0x4759e4)['send'](_0x23099a);};}exports[_0xd51b('0x2a')]=function(_0xde220d,_0x5f246e){var _0x21f520={},_0x3876f3={},_0x491d71={'count':0x0,'rows':[]};var _0x59a372=_[_0xd51b('0x2b')](db['ServicenowAccount']['rawAttributes'],function(_0x453dbe){return{'name':_0x453dbe[_0xd51b('0x2c')],'type':_0x453dbe[_0xd51b('0x2d')][_0xd51b('0x2e')]};});_0x3876f3[_0xd51b('0x2f')]=_[_0xd51b('0x2b')](_0x59a372,_0xd51b('0x29'));_0x3876f3[_0xd51b('0x30')]=_['keys'](_0xde220d[_0xd51b('0x30')]);_0x3876f3[_0xd51b('0x31')]=_[_0xd51b('0x32')](_0x3876f3['model'],_0x3876f3[_0xd51b('0x30')]);_0x21f520[_0xd51b('0x33')]=_[_0xd51b('0x32')](_0x3876f3[_0xd51b('0x2f')],qs[_0xd51b('0x34')](_0xde220d[_0xd51b('0x30')][_0xd51b('0x34')]));_0x21f520[_0xd51b('0x33')]=_0x21f520[_0xd51b('0x33')][_0xd51b('0x35')]?_0x21f520['attributes']:_0x3876f3[_0xd51b('0x2f')];if(!_0xde220d['query'][_0xd51b('0x36')](_0xd51b('0x37'))){_0x21f520[_0xd51b('0x1e')]=qs['limit'](_0xde220d[_0xd51b('0x30')][_0xd51b('0x1e')]);_0x21f520[_0xd51b('0x20')]=qs[_0xd51b('0x20')](_0xde220d[_0xd51b('0x30')][_0xd51b('0x20')]);}_0x21f520[_0xd51b('0x38')]=qs[_0xd51b('0x39')](_0xde220d['query'][_0xd51b('0x39')]);_0x21f520[_0xd51b('0x3a')]=qs[_0xd51b('0x31')](_['pick'](_0xde220d[_0xd51b('0x30')],_0x3876f3[_0xd51b('0x31')]),_0x59a372);if(_0xde220d[_0xd51b('0x30')][_0xd51b('0x3b')]){_0x21f520['where']=_['merge'](_0x21f520[_0xd51b('0x3a')],{'$or':_[_0xd51b('0x2b')](_0x59a372,function(_0x3e4b20){if(_0x3e4b20[_0xd51b('0x2d')]!==_0xd51b('0x3c')){var _0x5c677d={};_0x5c677d[_0x3e4b20[_0xd51b('0x29')]]={'$like':'%'+_0xde220d[_0xd51b('0x30')][_0xd51b('0x3b')]+'%'};return _0x5c677d;}})});}_0x21f520=_[_0xd51b('0x3d')]({},_0x21f520,_0xde220d[_0xd51b('0x3e')]);var _0x458f7b={'where':_0x21f520['where']};return db['ServicenowAccount'][_0xd51b('0x1f')](_0x458f7b)[_0xd51b('0x24')](function(_0x1bba7b){_0x491d71[_0xd51b('0x1f')]=_0x1bba7b;if(_0xde220d['query'][_0xd51b('0x3f')]){_0x21f520[_0xd51b('0x40')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xd51b('0x41')](_0x21f520);})[_0xd51b('0x24')](function(_0x59a70b){_0x491d71['rows']=_0x59a70b;return _0x491d71;})[_0xd51b('0x24')](respondWithFilteredResult(_0x5f246e,_0x21f520))['catch'](handleError(_0x5f246e,null));};exports[_0xd51b('0x42')]=function(_0x164280,_0x38e00f){var _0x1ed12d={'raw':![],'where':{'id':_0x164280['params']['id']}},_0x205422={};_0x205422[_0xd51b('0x2f')]=_[_0xd51b('0x43')](db[_0xd51b('0x44')][_0xd51b('0x45')]);_0x205422['query']=_[_0xd51b('0x43')](_0x164280[_0xd51b('0x30')]);_0x205422[_0xd51b('0x31')]=_[_0xd51b('0x32')](_0x205422[_0xd51b('0x2f')],_0x205422['query']);_0x1ed12d[_0xd51b('0x33')]=_[_0xd51b('0x32')](_0x205422[_0xd51b('0x2f')],qs[_0xd51b('0x34')](_0x164280[_0xd51b('0x30')][_0xd51b('0x34')]));_0x1ed12d[_0xd51b('0x33')]=_0x1ed12d[_0xd51b('0x33')][_0xd51b('0x35')]?_0x1ed12d['attributes']:_0x205422[_0xd51b('0x2f')];if(_0x164280['query'][_0xd51b('0x3f')]){_0x1ed12d[_0xd51b('0x40')]=[{'all':!![]}];}_0x1ed12d=_[_0xd51b('0x3d')]({},_0x1ed12d,_0x164280['options']);return db[_0xd51b('0x44')][_0xd51b('0x46')](_0x1ed12d)[_0xd51b('0x24')](handleEntityNotFound(_0x38e00f,null))[_0xd51b('0x24')](respondWithResult(_0x38e00f,null))[_0xd51b('0x47')](handleError(_0x38e00f,null));};exports[_0xd51b('0x48')]=function(_0x254244,_0x28e03f){return db[_0xd51b('0x44')][_0xd51b('0x48')](_0x254244[_0xd51b('0x49')],{})[_0xd51b('0x24')](respondWithResult(_0x28e03f,0xc9))[_0xd51b('0x47')](handleError(_0x28e03f,null));};exports[_0xd51b('0x23')]=function(_0x39362a,_0x5b289c){if(_0x39362a[_0xd51b('0x49')]['id']){delete _0x39362a[_0xd51b('0x49')]['id'];}return db[_0xd51b('0x44')][_0xd51b('0x46')]({'where':{'id':_0x39362a[_0xd51b('0x4a')]['id']}})[_0xd51b('0x24')](handleEntityNotFound(_0x5b289c,null))[_0xd51b('0x24')](saveUpdates(_0x39362a['body'],null))[_0xd51b('0x24')](respondWithResult(_0x5b289c,null))[_0xd51b('0x47')](handleError(_0x5b289c,null));};exports['destroy']=function(_0x4408b3,_0x15ab0a){return db['ServicenowAccount'][_0xd51b('0x46')]({'where':{'id':_0x4408b3['params']['id']}})[_0xd51b('0x24')](handleEntityNotFound(_0x15ab0a,null))[_0xd51b('0x24')](removeEntity(_0x15ab0a,null))['catch'](handleError(_0x15ab0a,null));};exports[_0xd51b('0x4b')]=function(_0xeb91e1,_0x4ccdf1,_0x2e6e8b){var _0x254c1={};var _0xa719d8={};var _0x593da7;var _0x205878;return db[_0xd51b('0x44')]['findOne']({'where':{'id':_0xeb91e1[_0xd51b('0x4a')]['id']}})[_0xd51b('0x24')](handleEntityNotFound(_0x4ccdf1,null))['then'](function(_0x569325){if(_0x569325){_0x593da7=_0x569325;_0xa719d8[_0xd51b('0x2f')]=_['keys'](db[_0xd51b('0x4c')]['rawAttributes']);_0xa719d8['query']=_['keys'](_0xeb91e1['query']);_0xa719d8['filters']=_[_0xd51b('0x32')](_0xa719d8[_0xd51b('0x2f')],_0xa719d8[_0xd51b('0x30')]);_0x254c1[_0xd51b('0x33')]=_[_0xd51b('0x32')](_0xa719d8['model'],qs[_0xd51b('0x34')](_0xeb91e1[_0xd51b('0x30')][_0xd51b('0x34')]));_0x254c1[_0xd51b('0x33')]=_0x254c1[_0xd51b('0x33')]['length']?_0x254c1[_0xd51b('0x33')]:_0xa719d8[_0xd51b('0x2f')];_0x254c1[_0xd51b('0x38')]=qs['sort'](_0xeb91e1[_0xd51b('0x30')][_0xd51b('0x39')]);_0x254c1[_0xd51b('0x3a')]=qs[_0xd51b('0x31')](_[_0xd51b('0x4d')](_0xeb91e1[_0xd51b('0x30')],_0xa719d8[_0xd51b('0x31')]));if(_0xeb91e1['query'][_0xd51b('0x3b')]){_0x254c1['where']=_['merge'](_0x254c1['where'],{'$or':_[_0xd51b('0x2b')](_0x254c1[_0xd51b('0x33')],function(_0x436282){var _0xa015f6={};_0xa015f6[_0x436282]={'$like':'%'+_0xeb91e1[_0xd51b('0x30')][_0xd51b('0x3b')]+'%'};return _0xa015f6;})});}_0x254c1=_['merge']({},_0x254c1,_0xeb91e1[_0xd51b('0x3e')]);return _0x593da7[_0xd51b('0x4b')](_0x254c1);}})['then'](function(_0x2e01f7){if(_0x2e01f7){_0x205878=_0x2e01f7[_0xd51b('0x35')];if(!_0xeb91e1['query'][_0xd51b('0x36')](_0xd51b('0x37'))){_0x254c1[_0xd51b('0x1e')]=qs[_0xd51b('0x1e')](_0xeb91e1[_0xd51b('0x30')][_0xd51b('0x1e')]);_0x254c1[_0xd51b('0x20')]=qs[_0xd51b('0x20')](_0xeb91e1[_0xd51b('0x30')][_0xd51b('0x20')]);}return _0x593da7[_0xd51b('0x4b')](_0x254c1);}})[_0xd51b('0x24')](function(_0x329b5d){if(_0x329b5d){return _0x329b5d?{'count':_0x205878,'rows':_0x329b5d}:null;}})[_0xd51b('0x24')](respondWithResult(_0x4ccdf1,null))[_0xd51b('0x47')](handleError(_0x4ccdf1,null));};exports['addConfiguration']=function(_0x28debb,_0x48854a,_0x82649){if(_0x28debb[_0xd51b('0x49')]['id']){delete _0x28debb[_0xd51b('0x49')]['id'];}return db[_0xd51b('0x44')][_0xd51b('0x4e')]({'where':{'id':_0x28debb[_0xd51b('0x4a')]['id']}})[_0xd51b('0x24')](handleEntityNotFound(_0x48854a,null))[_0xd51b('0x24')](function(_0xf14ca6){if(_0xf14ca6){_0x28debb[_0xd51b('0x49')][_0xd51b('0x4f')]=_0xf14ca6['id'];_0x28debb[_0xd51b('0x49')][_0xd51b('0x50')]=integrations['getSubjects'](_0x28debb[_0xd51b('0x49')][_0xd51b('0x51')],_0x28debb[_0xd51b('0x49')][_0xd51b('0x2d')]);_0x28debb[_0xd51b('0x49')][_0xd51b('0x52')]=integrations[_0xd51b('0x53')](_0x28debb['body']['channel'],_0x28debb[_0xd51b('0x49')][_0xd51b('0x2d')]);return db[_0xd51b('0x4c')][_0xd51b('0x48')](_0x28debb['body'],{'include':[{'model':db[_0xd51b('0x54')],'as':'Subjects'},{'model':db[_0xd51b('0x54')],'as':'Descriptions'}]});}return null;})[_0xd51b('0x24')](respondWithResult(_0x48854a,null))[_0xd51b('0x47')](handleError(_0x48854a,null));};exports[_0xd51b('0x55')]=function(_0x3c4e68,_0x29499c,_0x2fddb0){var _0x4ec95a=[_0xd51b('0x56'),_0xd51b('0x57'),_0xd51b('0x58'),_0xd51b('0x59'),_0xd51b('0x5a'),'notify',_0xd51b('0x5b'),_0xd51b('0x5c'),'category'];var _0x3d303f=[_0xd51b('0x5d'),_0xd51b('0x56'),_0xd51b('0x5e'),_0xd51b('0x5f'),_0xd51b('0x60'),'sys_updated_on',_0xd51b('0x61'),'hold_reason',_0xd51b('0x62'),_0xd51b('0x63'),'resolved_by','sys_updated_by','opened_by',_0xd51b('0x64'),'sys_created_on',_0xd51b('0x65'),_0xd51b('0x66'),_0xd51b('0x67'),_0xd51b('0x58'),_0xd51b('0x38'),'calendar_stc',_0xd51b('0x68'),_0xd51b('0x69'),'delivery_plan',_0xd51b('0x6a'),_0xd51b('0x6b'),_0xd51b('0x6c'),_0xd51b('0x6d'),_0xd51b('0x6e'),'sys_domain_path','rfc',_0xd51b('0x6f'),_0xd51b('0x70'),_0xd51b('0x71'),'business_duration','group_list',_0xd51b('0x72'),_0xd51b('0x73'),_0xd51b('0x74'),'caller_id',_0xd51b('0x75'),_0xd51b('0x59'),_0xd51b('0x76'),_0xd51b('0x77'),'close_code','correlation_display',_0xd51b('0x78'),_0xd51b('0x79'),_0xd51b('0x7a'),_0xd51b('0x7b'),_0xd51b('0x7c'),_0xd51b('0x7d'),_0xd51b('0x7e'),_0xd51b('0x7f'),_0xd51b('0x80'),_0xd51b('0x81'),'closed_by',_0xd51b('0x82'),'parent_incident',_0xd51b('0x83'),_0xd51b('0x84'),_0xd51b('0x85'),'incident_state',_0xd51b('0x86'),_0xd51b('0x87'),'company','reassignment_count','activity_due',_0xd51b('0x88'),'severity',_0xd51b('0x89'),_0xd51b('0x8a'),'approval',_0xd51b('0x8b'),'due_date',_0xd51b('0x8c'),_0xd51b('0x8d'),'sys_tags','escalation','upon_approval',_0xd51b('0x8e'),_0xd51b('0x8f'),'category'];var _0x4ca9e9='';var _0x4891bc='';var _0x370620=[];var _0x31efad='';var _0x4554aa='';var _0x7d976=[];var _0x48b86c='';var _0x98d3='';var _0x27e25a={};var _0x14aab4='';return db[_0xd51b('0x44')]['findOne']({'where':{'id':_0x3c4e68['params']['id']},'attributes':['id',_0xd51b('0x90'),_0xd51b('0x91'),_0xd51b('0x92'),_0xd51b('0x93'),_0xd51b('0x94')]})['then'](handleEntityNotFound(_0x29499c,null))['then'](function(_0x2e35a6){if(_0x2e35a6){_0x14aab4=_0x2e35a6[_0xd51b('0x93')];var _0x3d63c2=_0x14aab4[_0xd51b('0x95')](-0x1);if(_0x3d63c2==='/'){_0x14aab4=_0x14aab4[_0xd51b('0x96')](0x0,_0x14aab4['lastIndexOf'](_0x3d63c2));}_0x98d3=util[_0xd51b('0x97')](_0xd51b('0x98'),_0x14aab4);_0x48b86c=util['format'](_0xd51b('0x99'),_0x14aab4);_0x27e25a={'user':_0x2e35a6[_0xd51b('0x90')],'pass':_0x2e35a6[_0xd51b('0x91')]};var _0x29ee41={'method':_0xd51b('0x9a'),'uri':_0x98d3+_0xd51b('0x9b'),'auth':_0x27e25a,'json':!![]};return rp(_0x29ee41);}})[_0xd51b('0x24')](function(_0x2e2c77){if(_0x2e2c77['result']['length']>0x0){_0x4ca9e9=_0x2e2c77[_0xd51b('0x9c')];}console[_0xd51b('0x9d')]('incident\x20table\x20objects',_0x4ca9e9);_0x7d976=[];_0x4891bc=Object[_0xd51b('0x9e')]([],_0x4ca9e9);_[_0xd51b('0x9f')](_0x4891bc,function(_0x47a366){return!_0x4ec95a[_0xd51b('0xa0')](_0x47a366['name']);});_0x4891bc['forEach'](function(_0x2c9d09){var _0x1446ec=createFieldObject(_0x48b86c,_0x27e25a,_0x2c9d09['internalType'],_0x2c9d09[_0xd51b('0x29')],_0x2c9d09[_0xd51b('0xa1')],![]);_0x7d976[_0xd51b('0xa2')](_0x1446ec);});return Promise[_0xd51b('0xa3')](_0x7d976);})['then'](function(_0x12bd4d){_0x370620=_0x12bd4d;_0x31efad=Object[_0xd51b('0x9e')]([],_0x4ca9e9);console[_0xd51b('0x9d')](_0xd51b('0xa4'),_0x4ca9e9);_['remove'](_0x31efad,function(_0x1f38ef){return _0x3d303f['includes'](_0x1f38ef[_0xd51b('0x29')]);});console['log'](_0xd51b('0xa5'),_0x31efad);_0x7d976=[];_0x31efad[_0xd51b('0xa6')](function(_0x1d5492){var _0x3bae73=createFieldObject(_0x48b86c,_0x27e25a,_0x1d5492['internalType'],_0x1d5492[_0xd51b('0x29')],_0x1d5492[_0xd51b('0xa1')],!![]);_0x7d976[_0xd51b('0xa2')](_0x3bae73);});return Promise[_0xd51b('0xa3')](_0x7d976);})[_0xd51b('0x24')](function(_0x3f59ae){_0x4554aa=_0x3f59ae;var _0x2ec44b=_0x370620[_0xd51b('0xa7')](_0x4554aa);return{'count':_0x2ec44b['length'],'rows':_0x2ec44b};})[_0xd51b('0x24')](respondWithResult(_0x29499c,null))[_0xd51b('0x47')](function(_0x1c31ca){console[_0xd51b('0x9d')](_0xd51b('0xa8')+_0x1c31ca);var _0x3d8e83=_0x3c4e68[_0xd51b('0x30')][_0xd51b('0xa9')]?0x1f4:_0x1c31ca[_0xd51b('0xaa')]||0x1f4;logger[_0xd51b('0x27')](_0x1c31ca[_0xd51b('0x28')]);delete _0x1c31ca['name'];if(_0x3d8e83===0x191){_0x3d8e83=0x190;}_0x29499c[_0xd51b('0x1a')](_0x3d8e83)[_0xd51b('0xab')](_0x3c4e68[_0xd51b('0x30')][_0xd51b('0xa9')]?{'message':_0xd51b('0xac'),'statusCode':_0x1c31ca[_0xd51b('0xaa')]}:_0x1c31ca);});};function createFieldObject(_0x180817,_0x1e1bb0,_0x1e234e,_0x198493,_0x5d4234,_0x2e0231){return new Promise(function(_0x5943d9,_0x6d01f3){var _0x477de4={'id':_0x198493,'name':_0x5d4234,'custom':_0x2e0231};if(_0x1e234e===_0xd51b('0xad')){_0x477de4[_0xd51b('0x3e')]=[{'name':'True','value':_0xd51b('0xae')},{'name':_0xd51b('0xaf'),'value':_0xd51b('0xb0')}];_0x5943d9(_0x477de4);}else{var _0x1d816e={'method':_0xd51b('0x9a'),'uri':_0x180817+_0xd51b('0xb1')+_0x198493,'auth':_0x1e1bb0,'json':!![]};return rp(_0x1d816e)[_0xd51b('0x24')](function(_0x59b5f4){var _0x349903=[];if(_0x59b5f4['result']['length']>0x0){_0x59b5f4['result'][_0xd51b('0xa6')](function(_0x27cf20){if(_0x27cf20[_0xd51b('0xb2')]===_0xd51b('0xb0')){var _0x562f05={'name':_0x27cf20[_0xd51b('0xa1')],'value':_0x27cf20[_0xd51b('0xb3')]};_0x349903[_0xd51b('0xa2')](_0x562f05);}});}_0x477de4[_0xd51b('0x3e')]=_0x349903;if(_0x477de4[_0xd51b('0x3e')][_0xd51b('0x35')]>0x0){_0x5943d9(_0x477de4);}else{if(_0x2e0231==![]){_0x5943d9();}else{_0x5943d9(_0x477de4);}}});}});} \ No newline at end of file +var _0x0c70=['parent_incident','sys_id','reopened_by','urgency','reassignment_count','approval','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','sys_choice?sysparm_query=name=incident^element=','false','value','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','options','find','catch','create','update','body','params','getConfigurations','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','Subjects','ServicenowField','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','knowledge','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','description','calendar_duration','sys_class_name','close_notes','closed_by'];(function(_0x35b84c,_0x4fe10f){var _0x1522d6=function(_0x4eea95){while(--_0x4eea95){_0x35b84c['push'](_0x35b84c['shift']());}};_0x1522d6(++_0x4fe10f);}(_0x0c70,0xe1));var _0x00c7=function(_0x35cd23,_0x4920d8){_0x35cd23=_0x35cd23-0x0;var _0x4aa1fe=_0x0c70[_0x35cd23];return _0x4aa1fe;};'use strict';var emlformat=require(_0x00c7('0x0'));var rimraf=require(_0x00c7('0x1'));var zipdir=require(_0x00c7('0x2'));var jsonpatch=require(_0x00c7('0x3'));var rp=require('request-promise');var moment=require(_0x00c7('0x4'));var BPromise=require(_0x00c7('0x5'));var Mustache=require(_0x00c7('0x6'));var util=require(_0x00c7('0x7'));var path=require(_0x00c7('0x8'));var sox=require(_0x00c7('0x9'));var csv=require(_0x00c7('0xa'));var ejs=require(_0x00c7('0xb'));var fs=require('fs');var fs_extra=require(_0x00c7('0xc'));var _=require(_0x00c7('0xd'));var squel=require(_0x00c7('0xe'));var crypto=require(_0x00c7('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x00c7('0x10'));var toCsv=require(_0x00c7('0xa'));var querystring=require(_0x00c7('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x00c7('0x12'));var hardwareService=require(_0x00c7('0x13'));var logger=require(_0x00c7('0x14'))('api');var utils=require(_0x00c7('0x15'));var config=require(_0x00c7('0x16'));var licenseUtil=require(_0x00c7('0x17'));var db=require(_0x00c7('0x18'))['db'];var integrations=require(_0x00c7('0x19'));function respondWithStatusCode(_0xa3946d,_0x5ceb23){_0x5ceb23=_0x5ceb23||0xcc;return function(_0x545a23){if(_0x545a23){return _0xa3946d[_0x00c7('0x1a')](_0x5ceb23);}return _0xa3946d['status'](_0x5ceb23)[_0x00c7('0x1b')]();};}function respondWithResult(_0x415ac1,_0x18b8ee){_0x18b8ee=_0x18b8ee||0xc8;return function(_0x855cc){if(_0x855cc){return _0x415ac1[_0x00c7('0x1c')](_0x18b8ee)[_0x00c7('0x1d')](_0x855cc);}};}function respondWithFilteredResult(_0x15cf6f,_0x1ed12a){return function(_0x5c55d3){if(_0x5c55d3){var _0x36ed02=typeof _0x1ed12a[_0x00c7('0x1e')]===_0x00c7('0x1f')&&typeof _0x1ed12a[_0x00c7('0x20')]==='undefined';var _0x26a8e4=_0x5c55d3[_0x00c7('0x21')];var _0x2e9fc1=_0x36ed02?0x0:_0x1ed12a[_0x00c7('0x1e')];var _0x25bec5=_0x36ed02?_0x5c55d3[_0x00c7('0x21')]:_0x1ed12a[_0x00c7('0x1e')]+_0x1ed12a[_0x00c7('0x20')];var _0x5ecd2e;if(_0x25bec5>=_0x26a8e4){_0x25bec5=_0x26a8e4;_0x5ecd2e=0xc8;}else{_0x5ecd2e=0xce;}_0x15cf6f[_0x00c7('0x1c')](_0x5ecd2e);return _0x15cf6f['set'](_0x00c7('0x22'),_0x2e9fc1+'-'+_0x25bec5+'/'+_0x26a8e4)['json'](_0x5c55d3);}return null;};}function patchUpdates(_0x1b19d9){return function(_0x5e81e2){try{jsonpatch[_0x00c7('0x23')](_0x5e81e2,_0x1b19d9,!![]);}catch(_0x2efaa9){return BPromise[_0x00c7('0x24')](_0x2efaa9);}return _0x5e81e2[_0x00c7('0x25')]();};}function saveUpdates(_0x1185d,_0x48117d){return function(_0x27937b){if(_0x27937b){return _0x27937b['update'](_0x1185d)[_0x00c7('0x26')](function(_0x507fef){return _0x507fef;});}return null;};}function removeEntity(_0x4a9793,_0x2c48f8){return function(_0x586bd8){if(_0x586bd8){return _0x586bd8[_0x00c7('0x27')]()[_0x00c7('0x26')](function(){_0x4a9793[_0x00c7('0x1c')](0xcc)[_0x00c7('0x1b')]();});}};}function handleEntityNotFound(_0x1948ad,_0x5852c9){return function(_0x13d086){if(!_0x13d086){_0x1948ad[_0x00c7('0x1a')](0x194);}return _0x13d086;};}function handleError(_0x20c731,_0x4288d4){_0x4288d4=_0x4288d4||0x1f4;return function(_0x452405){logger[_0x00c7('0x28')](_0x452405[_0x00c7('0x29')]);if(_0x452405['name']){delete _0x452405[_0x00c7('0x2a')];}_0x20c731[_0x00c7('0x1c')](_0x4288d4)[_0x00c7('0x2b')](_0x452405);};}exports[_0x00c7('0x2c')]=function(_0x501cb8,_0x4c4aa9){var _0x219809={},_0x2091a4={},_0x89784c={'count':0x0,'rows':[]};var _0x124093=_['map'](db[_0x00c7('0x2d')][_0x00c7('0x2e')],function(_0x5b14ea){return{'name':_0x5b14ea[_0x00c7('0x2f')],'type':_0x5b14ea['type'][_0x00c7('0x30')]};});_0x2091a4['model']=_['map'](_0x124093,_0x00c7('0x2a'));_0x2091a4[_0x00c7('0x31')]=_[_0x00c7('0x32')](_0x501cb8[_0x00c7('0x31')]);_0x2091a4[_0x00c7('0x33')]=_[_0x00c7('0x34')](_0x2091a4[_0x00c7('0x35')],_0x2091a4[_0x00c7('0x31')]);_0x219809[_0x00c7('0x36')]=_[_0x00c7('0x34')](_0x2091a4[_0x00c7('0x35')],qs[_0x00c7('0x37')](_0x501cb8['query']['fields']));_0x219809[_0x00c7('0x36')]=_0x219809[_0x00c7('0x36')][_0x00c7('0x38')]?_0x219809[_0x00c7('0x36')]:_0x2091a4[_0x00c7('0x35')];if(!_0x501cb8[_0x00c7('0x31')][_0x00c7('0x39')](_0x00c7('0x3a'))){_0x219809['limit']=qs[_0x00c7('0x20')](_0x501cb8[_0x00c7('0x31')][_0x00c7('0x20')]);_0x219809['offset']=qs[_0x00c7('0x1e')](_0x501cb8[_0x00c7('0x31')][_0x00c7('0x1e')]);}_0x219809[_0x00c7('0x3b')]=qs['sort'](_0x501cb8[_0x00c7('0x31')][_0x00c7('0x3c')]);_0x219809[_0x00c7('0x3d')]=qs[_0x00c7('0x33')](_[_0x00c7('0x3e')](_0x501cb8[_0x00c7('0x31')],_0x2091a4[_0x00c7('0x33')]),_0x124093);if(_0x501cb8[_0x00c7('0x31')][_0x00c7('0x3f')]){_0x219809['where']=_['merge'](_0x219809['where'],{'$or':_['map'](_0x124093,function(_0x4b35b4){if(_0x4b35b4['type']!==_0x00c7('0x40')){var _0x3bd31a={};_0x3bd31a[_0x4b35b4['name']]={'$like':'%'+_0x501cb8['query']['filter']+'%'};return _0x3bd31a;}})});}_0x219809=_[_0x00c7('0x41')]({},_0x219809,_0x501cb8['options']);var _0x4519f5={'where':_0x219809[_0x00c7('0x3d')]};return db[_0x00c7('0x2d')][_0x00c7('0x21')](_0x4519f5)[_0x00c7('0x26')](function(_0x48ec87){_0x89784c[_0x00c7('0x21')]=_0x48ec87;if(_0x501cb8[_0x00c7('0x31')][_0x00c7('0x42')]){_0x219809[_0x00c7('0x43')]=[{'all':!![]}];}return db[_0x00c7('0x2d')]['findAll'](_0x219809);})[_0x00c7('0x26')](function(_0x5feda7){_0x89784c[_0x00c7('0x44')]=_0x5feda7;return _0x89784c;})[_0x00c7('0x26')](respondWithFilteredResult(_0x4c4aa9,_0x219809))['catch'](handleError(_0x4c4aa9,null));};exports['show']=function(_0x29e59f,_0x48c7d6){var _0x45c98d={'raw':![],'where':{'id':_0x29e59f['params']['id']}},_0x5713c0={};_0x5713c0[_0x00c7('0x35')]=_['keys'](db[_0x00c7('0x2d')][_0x00c7('0x2e')]);_0x5713c0[_0x00c7('0x31')]=_['keys'](_0x29e59f[_0x00c7('0x31')]);_0x5713c0[_0x00c7('0x33')]=_['intersection'](_0x5713c0['model'],_0x5713c0[_0x00c7('0x31')]);_0x45c98d[_0x00c7('0x36')]=_[_0x00c7('0x34')](_0x5713c0[_0x00c7('0x35')],qs[_0x00c7('0x37')](_0x29e59f['query'][_0x00c7('0x37')]));_0x45c98d['attributes']=_0x45c98d[_0x00c7('0x36')][_0x00c7('0x38')]?_0x45c98d['attributes']:_0x5713c0[_0x00c7('0x35')];if(_0x29e59f[_0x00c7('0x31')]['includeAll']){_0x45c98d[_0x00c7('0x43')]=[{'all':!![]}];}_0x45c98d=_['merge']({},_0x45c98d,_0x29e59f[_0x00c7('0x45')]);return db[_0x00c7('0x2d')][_0x00c7('0x46')](_0x45c98d)[_0x00c7('0x26')](handleEntityNotFound(_0x48c7d6,null))[_0x00c7('0x26')](respondWithResult(_0x48c7d6,null))[_0x00c7('0x47')](handleError(_0x48c7d6,null));};exports[_0x00c7('0x48')]=function(_0x364c70,_0x43e990){return db[_0x00c7('0x2d')][_0x00c7('0x48')](_0x364c70['body'],{})[_0x00c7('0x26')](respondWithResult(_0x43e990,0xc9))[_0x00c7('0x47')](handleError(_0x43e990,null));};exports[_0x00c7('0x49')]=function(_0x594c09,_0x4e7514){if(_0x594c09['body']['id']){delete _0x594c09[_0x00c7('0x4a')]['id'];}return db[_0x00c7('0x2d')][_0x00c7('0x46')]({'where':{'id':_0x594c09['params']['id']}})[_0x00c7('0x26')](handleEntityNotFound(_0x4e7514,null))[_0x00c7('0x26')](saveUpdates(_0x594c09[_0x00c7('0x4a')],null))[_0x00c7('0x26')](respondWithResult(_0x4e7514,null))[_0x00c7('0x47')](handleError(_0x4e7514,null));};exports[_0x00c7('0x27')]=function(_0x1eed3c,_0x6d52e){return db['ServicenowAccount'][_0x00c7('0x46')]({'where':{'id':_0x1eed3c[_0x00c7('0x4b')]['id']}})[_0x00c7('0x26')](handleEntityNotFound(_0x6d52e,null))[_0x00c7('0x26')](removeEntity(_0x6d52e,null))['catch'](handleError(_0x6d52e,null));};exports['getConfigurations']=function(_0x4e760b,_0x136006,_0x1f1302){var _0x3b3a2b={};var _0x5d4b23={};var _0x297045;var _0x4c8785;return db[_0x00c7('0x2d')]['findOne']({'where':{'id':_0x4e760b[_0x00c7('0x4b')]['id']}})[_0x00c7('0x26')](handleEntityNotFound(_0x136006,null))[_0x00c7('0x26')](function(_0x1977c0){if(_0x1977c0){_0x297045=_0x1977c0;_0x5d4b23[_0x00c7('0x35')]=_['keys'](db['ServicenowConfiguration'][_0x00c7('0x2e')]);_0x5d4b23['query']=_[_0x00c7('0x32')](_0x4e760b[_0x00c7('0x31')]);_0x5d4b23[_0x00c7('0x33')]=_[_0x00c7('0x34')](_0x5d4b23[_0x00c7('0x35')],_0x5d4b23[_0x00c7('0x31')]);_0x3b3a2b[_0x00c7('0x36')]=_[_0x00c7('0x34')](_0x5d4b23[_0x00c7('0x35')],qs[_0x00c7('0x37')](_0x4e760b['query'][_0x00c7('0x37')]));_0x3b3a2b[_0x00c7('0x36')]=_0x3b3a2b[_0x00c7('0x36')][_0x00c7('0x38')]?_0x3b3a2b[_0x00c7('0x36')]:_0x5d4b23[_0x00c7('0x35')];_0x3b3a2b['order']=qs[_0x00c7('0x3c')](_0x4e760b[_0x00c7('0x31')]['sort']);_0x3b3a2b[_0x00c7('0x3d')]=qs[_0x00c7('0x33')](_[_0x00c7('0x3e')](_0x4e760b[_0x00c7('0x31')],_0x5d4b23['filters']));if(_0x4e760b[_0x00c7('0x31')][_0x00c7('0x3f')]){_0x3b3a2b[_0x00c7('0x3d')]=_[_0x00c7('0x41')](_0x3b3a2b['where'],{'$or':_['map'](_0x3b3a2b[_0x00c7('0x36')],function(_0x40269c){var _0x542417={};_0x542417[_0x40269c]={'$like':'%'+_0x4e760b[_0x00c7('0x31')][_0x00c7('0x3f')]+'%'};return _0x542417;})});}_0x3b3a2b=_[_0x00c7('0x41')]({},_0x3b3a2b,_0x4e760b[_0x00c7('0x45')]);return _0x297045[_0x00c7('0x4c')](_0x3b3a2b);}})[_0x00c7('0x26')](function(_0x33d9b4){if(_0x33d9b4){_0x4c8785=_0x33d9b4[_0x00c7('0x38')];if(!_0x4e760b[_0x00c7('0x31')][_0x00c7('0x39')](_0x00c7('0x3a'))){_0x3b3a2b[_0x00c7('0x20')]=qs[_0x00c7('0x20')](_0x4e760b[_0x00c7('0x31')][_0x00c7('0x20')]);_0x3b3a2b[_0x00c7('0x1e')]=qs[_0x00c7('0x1e')](_0x4e760b['query'][_0x00c7('0x1e')]);}return _0x297045[_0x00c7('0x4c')](_0x3b3a2b);}})[_0x00c7('0x26')](function(_0x269f1b){if(_0x269f1b){return _0x269f1b?{'count':_0x4c8785,'rows':_0x269f1b}:null;}})[_0x00c7('0x26')](respondWithResult(_0x136006,null))[_0x00c7('0x47')](handleError(_0x136006,null));};exports[_0x00c7('0x4d')]=function(_0x356814,_0xe889f0,_0x3ac871){if(_0x356814[_0x00c7('0x4a')]['id']){delete _0x356814['body']['id'];}return db['ServicenowAccount'][_0x00c7('0x4e')]({'where':{'id':_0x356814[_0x00c7('0x4b')]['id']}})[_0x00c7('0x26')](handleEntityNotFound(_0xe889f0,null))[_0x00c7('0x26')](function(_0x30dbb2){if(_0x30dbb2){_0x356814[_0x00c7('0x4a')]['AccountId']=_0x30dbb2['id'];_0x356814[_0x00c7('0x4a')]['Subjects']=integrations[_0x00c7('0x4f')](_0x356814[_0x00c7('0x4a')][_0x00c7('0x50')],_0x356814['body']['type']);_0x356814[_0x00c7('0x4a')][_0x00c7('0x51')]=integrations[_0x00c7('0x52')](_0x356814['body'][_0x00c7('0x50')],_0x356814[_0x00c7('0x4a')]['type']);return db['ServicenowConfiguration'][_0x00c7('0x48')](_0x356814['body'],{'include':[{'model':db['ServicenowField'],'as':_0x00c7('0x53')},{'model':db[_0x00c7('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xe889f0,null))['catch'](handleError(_0xe889f0,null));};exports['getFields']=function(_0x25d60e,_0x5bc988,_0x37bee7){var _0x31ab93=[_0x00c7('0x55'),_0x00c7('0x56'),'knowledge',_0x00c7('0x57'),_0x00c7('0x58'),_0x00c7('0x59'),_0x00c7('0x5a'),_0x00c7('0x5b'),_0x00c7('0x5c')];var _0x3bc224=[_0x00c7('0x5d'),_0x00c7('0x55'),_0x00c7('0x5e'),'watch_list',_0x00c7('0x5f'),_0x00c7('0x60'),_0x00c7('0x61'),_0x00c7('0x56'),_0x00c7('0x62'),_0x00c7('0x63'),_0x00c7('0x64'),_0x00c7('0x65'),_0x00c7('0x66'),_0x00c7('0x67'),'sys_created_on',_0x00c7('0x68'),_0x00c7('0x69'),'sys_created_by',_0x00c7('0x6a'),_0x00c7('0x3b'),_0x00c7('0x6b'),'closed_at',_0x00c7('0x6c'),'delivery_plan',_0x00c7('0x6d'),_0x00c7('0x6e'),_0x00c7('0x6f'),_0x00c7('0x70'),_0x00c7('0x71'),_0x00c7('0x72'),_0x00c7('0x73'),_0x00c7('0x74'),'expected_start',_0x00c7('0x75'),_0x00c7('0x76'),_0x00c7('0x77'),'work_end','reopened_time',_0x00c7('0x78'),_0x00c7('0x79'),_0x00c7('0x7a'),_0x00c7('0x57'),_0x00c7('0x7b'),_0x00c7('0x7c'),'close_code','correlation_display',_0x00c7('0x7d'),'work_start','assignment_group','business_stc','additional_assignee_list',_0x00c7('0x7e'),_0x00c7('0x7f'),_0x00c7('0x59'),_0x00c7('0x80'),_0x00c7('0x81'),_0x00c7('0x82'),'follow_up',_0x00c7('0x83'),_0x00c7('0x84'),'contact_type',_0x00c7('0x85'),_0x00c7('0x5a'),_0x00c7('0x86'),'problem_id','company',_0x00c7('0x87'),'activity_due','assigned_to',_0x00c7('0x5b'),'comments','sla_due',_0x00c7('0x88'),_0x00c7('0x89'),'due_date',_0x00c7('0x8a'),_0x00c7('0x8b'),'sys_tags',_0x00c7('0x8c'),_0x00c7('0x8d'),'correlation_id',_0x00c7('0x8e'),_0x00c7('0x5c')];var _0x47f3ea='';var _0x781dc8='';var _0x2b8f35=[];var _0x46151f='';var _0x415d40='';var _0x94f067=[];var _0x4a0760='';var _0x4a814a='';var _0x13b434={};var _0x11baf9='';return db[_0x00c7('0x2d')]['findOne']({'where':{'id':_0x25d60e['params']['id']},'attributes':['id',_0x00c7('0x8f'),_0x00c7('0x90'),_0x00c7('0x91'),_0x00c7('0x92'),_0x00c7('0x93')]})[_0x00c7('0x26')](handleEntityNotFound(_0x5bc988,null))[_0x00c7('0x26')](function(_0x108055){if(_0x108055){_0x11baf9=_0x108055['remoteUri'];var _0x3f13b8=_0x11baf9['slice'](-0x1);if(_0x3f13b8==='/'){_0x11baf9=_0x11baf9[_0x00c7('0x94')](0x0,_0x11baf9[_0x00c7('0x95')](_0x3f13b8));}_0x4a814a=util[_0x00c7('0x96')](_0x00c7('0x97'),_0x11baf9);_0x4a0760=util[_0x00c7('0x96')](_0x00c7('0x98'),_0x11baf9);_0x13b434={'user':_0x108055['username'],'pass':_0x108055[_0x00c7('0x90')]};var _0x5aafb7={'method':_0x00c7('0x99'),'uri':_0x4a814a+_0x00c7('0x9a'),'auth':_0x13b434,'json':!![]};return rp(_0x5aafb7);}})[_0x00c7('0x26')](function(_0x1e0e36){if(_0x1e0e36[_0x00c7('0x9b')][_0x00c7('0x38')]>0x0){_0x47f3ea=_0x1e0e36[_0x00c7('0x9b')];}console[_0x00c7('0x9c')](_0x00c7('0x9d'),_0x47f3ea);_0x94f067=[];_0x781dc8=Object[_0x00c7('0x9e')]([],_0x47f3ea);_[_0x00c7('0x9f')](_0x781dc8,function(_0x55b2da){return!_0x31ab93['includes'](_0x55b2da[_0x00c7('0x2a')]);});_0x781dc8['forEach'](function(_0x14edc4){var _0x497bc6=createFieldObject(_0x4a0760,_0x13b434,_0x14edc4['internalType'],_0x14edc4['name'],_0x14edc4[_0x00c7('0xa0')],![]);_0x94f067[_0x00c7('0xa1')](_0x497bc6);});return Promise[_0x00c7('0xa2')](_0x94f067);})['then'](function(_0x4fdc4f){_0x2b8f35=_0x4fdc4f;_0x46151f=Object['assign']([],_0x47f3ea);console[_0x00c7('0x9c')](_0x00c7('0xa3'),_0x47f3ea);_[_0x00c7('0x9f')](_0x46151f,function(_0x4f61d6){return _0x3bc224[_0x00c7('0xa4')](_0x4f61d6[_0x00c7('0x2a')]);});console[_0x00c7('0x9c')](_0x00c7('0xa5'),_0x46151f);_0x94f067=[];_0x46151f[_0x00c7('0xa6')](function(_0x45b718){var _0x31ccbc=createFieldObject(_0x4a0760,_0x13b434,_0x45b718[_0x00c7('0xa7')],_0x45b718['name'],_0x45b718[_0x00c7('0xa0')],!![]);_0x94f067['push'](_0x31ccbc);});return Promise[_0x00c7('0xa2')](_0x94f067);})[_0x00c7('0x26')](function(_0x51e798){_0x415d40=_0x51e798;var _0x1fbfcb=_0x2b8f35[_0x00c7('0xa8')](_0x415d40);return{'count':_0x1fbfcb[_0x00c7('0x38')],'rows':_0x1fbfcb};})[_0x00c7('0x26')](respondWithResult(_0x5bc988,null))[_0x00c7('0x47')](function(_0x5bff82){console[_0x00c7('0x9c')](_0x00c7('0xa9')+_0x5bff82);var _0x4cc977=_0x25d60e[_0x00c7('0x31')][_0x00c7('0xaa')]?0x1f4:_0x5bff82[_0x00c7('0xab')]||0x1f4;logger[_0x00c7('0x28')](_0x5bff82['stack']);delete _0x5bff82[_0x00c7('0x2a')];if(_0x4cc977===0x191){_0x4cc977=0x190;}_0x5bc988[_0x00c7('0x1c')](_0x4cc977)['send'](_0x25d60e[_0x00c7('0x31')][_0x00c7('0xaa')]?{'message':_0x00c7('0xac'),'statusCode':_0x5bff82[_0x00c7('0xab')]}:_0x5bff82);});};function createFieldObject(_0x22980d,_0x5f3719,_0x361a64,_0x333622,_0x43cfaa,_0x10b603){return new Promise(function(_0x8a6868,_0x1ee4ce){var _0x159f44={'id':_0x333622,'name':_0x43cfaa,'custom':_0x10b603};if(_0x361a64===_0x00c7('0xad')){_0x159f44[_0x00c7('0x45')]=[{'name':'True','value':_0x00c7('0xae')},{'name':'False','value':'false'}];_0x8a6868(_0x159f44);}else{var _0x57a6e0={'method':_0x00c7('0x99'),'uri':_0x22980d+_0x00c7('0xaf')+_0x333622,'auth':_0x5f3719,'json':!![]};return rp(_0x57a6e0)[_0x00c7('0x26')](function(_0x1cda07){var _0x34dcc1=[];if(_0x1cda07[_0x00c7('0x9b')][_0x00c7('0x38')]>0x0){_0x1cda07[_0x00c7('0x9b')][_0x00c7('0xa6')](function(_0x228106){if(_0x228106['inactive']===_0x00c7('0xb0')){var _0x28e63b={'name':_0x228106[_0x00c7('0xa0')],'value':_0x228106[_0x00c7('0xb1')]};_0x34dcc1['push'](_0x28e63b);}});}_0x159f44[_0x00c7('0x45')]=_0x34dcc1;if(_0x159f44[_0x00c7('0x45')][_0x00c7('0x38')]>0x0){_0x8a6868(_0x159f44);}else{if(_0x10b603==![]){_0x8a6868();}else{_0x8a6868(_0x159f44);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 97153cd..bd6dc0f 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 _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7da7,0x10d));var _0x77da=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x7da7[_0x5a7d5f];return _0x5dcded;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['path','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x3c7efb,_0x262297){var _0x1dc7e0=function(_0x51555e){while(--_0x51555e){_0x3c7efb['push'](_0x3c7efb['shift']());}};_0x1dc7e0(++_0x262297);}(_0x1623,0xab));var _0x3162=function(_0x12daac,_0x258867){_0x12daac=_0x12daac-0x0;var _0x8c6f7a=_0x1623[_0x12daac];return _0x8c6f7a;};'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 diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index fc85396..3cf646b 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 _0x04ee=['http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','attributes','limit','include','map','ShowServicenowAccount','find','raw','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xd3da2a,_0x22241c){var _0x10ab61=function(_0x12b964){while(--_0x12b964){_0xd3da2a['push'](_0xd3da2a['shift']());}};_0x10ab61(++_0x22241c);}(_0x04ee,0x1d5));var _0xe04e=function(_0x2ff3b7,_0x48ba3d){_0x2ff3b7=_0x2ff3b7-0x0;var _0x35fae3=_0x04ee[_0x2ff3b7];return _0x35fae3;};'use strict';var _=require(_0xe04e('0x0'));var util=require(_0xe04e('0x1'));var moment=require(_0xe04e('0x2'));var BPromise=require(_0xe04e('0x3'));var rs=require(_0xe04e('0x4'));var fs=require('fs');var Redis=require(_0xe04e('0x5'));var db=require(_0xe04e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe04e('0x7'))(_0xe04e('0x8'));var config=require(_0xe04e('0x9'));var jayson=require(_0xe04e('0xa'));var client=jayson[_0xe04e('0xb')][_0xe04e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe77962,_0x1fc244,_0x439809){return new BPromise(function(_0x45f988,_0x40562d){return client['request'](_0xe77962,_0x439809)[_0xe04e('0xd')](function(_0x2f6c02){logger[_0xe04e('0xe')](_0xe04e('0xf'),_0x1fc244,_0xe04e('0x10'));logger[_0xe04e('0x11')](_0xe04e('0x12'),_0x1fc244,_0xe04e('0x10'),JSON[_0xe04e('0x13')](_0x2f6c02));if(_0x2f6c02[_0xe04e('0x14')]){if(_0x2f6c02[_0xe04e('0x14')][_0xe04e('0x15')]===0x1f4){logger[_0xe04e('0x14')](_0xe04e('0xf'),_0x1fc244,_0x2f6c02['error'][_0xe04e('0x16')]);return _0x40562d(_0x2f6c02[_0xe04e('0x14')]['message']);}logger[_0xe04e('0x14')](_0xe04e('0xf'),_0x1fc244,_0x2f6c02[_0xe04e('0x14')]['message']);return _0x45f988(_0x2f6c02[_0xe04e('0x14')][_0xe04e('0x16')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1fc244,_0xe04e('0x10'));_0x45f988(_0x2f6c02[_0xe04e('0x17')][_0xe04e('0x16')]);}})[_0xe04e('0x18')](function(_0x4c9e15){logger[_0xe04e('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x1fc244,_0x4c9e15);_0x40562d(_0x4c9e15);});});}exports[_0xe04e('0x19')]=function(_0xc0c04d){var _0x28a88f=this;return new Promise(function(_0x509731,_0x3034ea){return db[_0xe04e('0x1a')][_0xe04e('0x1b')]({'raw':_0xc0c04d['options']?_0xc0c04d['options']['raw']===undefined?!![]:![]:!![],'where':_0xc0c04d['options']?_0xc0c04d[_0xe04e('0x1c')]['where']||null:null,'attributes':_0xc0c04d[_0xe04e('0x1c')]?_0xc0c04d[_0xe04e('0x1c')][_0xe04e('0x1d')]||null:null,'limit':_0xc0c04d[_0xe04e('0x1c')]?_0xc0c04d['options'][_0xe04e('0x1e')]||null:null,'include':_0xc0c04d[_0xe04e('0x1c')]?_0xc0c04d['options']['include']?_['map'](_0xc0c04d[_0xe04e('0x1c')][_0xe04e('0x1f')],function(_0x5b036c){return{'model':db[_0x5b036c['model']],'as':_0x5b036c['as'],'attributes':_0x5b036c[_0xe04e('0x1d')],'include':_0x5b036c[_0xe04e('0x1f')]?_[_0xe04e('0x20')](_0x5b036c['include'],function(_0x3415b3){return{'model':db[_0x3415b3['model']],'as':_0x3415b3['as'],'attributes':_0x3415b3[_0xe04e('0x1d')],'include':_0x3415b3['include']?_['map'](_0x3415b3[_0xe04e('0x1f')],function(_0x320a3d){return{'model':db[_0x320a3d['model']],'as':_0x320a3d['as'],'attributes':_0x320a3d[_0xe04e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe04e('0xd')](function(_0x2f8fb8){logger[_0xe04e('0xe')]('GetServicenowAccount',_0xc0c04d);logger[_0xe04e('0x11')](_0xe04e('0x19'),_0xc0c04d,JSON['stringify'](_0x2f8fb8));_0x509731(_0x2f8fb8);})[_0xe04e('0x18')](function(_0x128081){logger['error'](_0xe04e('0x19'),_0x128081[_0xe04e('0x16')],_0xc0c04d);_0x3034ea(_0x28a88f[_0xe04e('0x14')](0x1f4,_0x128081['message']));});});};exports[_0xe04e('0x21')]=function(_0x2b96db){var _0x97aec8=this;return new Promise(function(_0x55f4de,_0x572110){return db[_0xe04e('0x1a')][_0xe04e('0x22')]({'raw':_0x2b96db[_0xe04e('0x1c')]?_0x2b96db[_0xe04e('0x1c')][_0xe04e('0x23')]===undefined?!![]:![]:!![],'where':_0x2b96db[_0xe04e('0x1c')]?_0x2b96db[_0xe04e('0x1c')]['where']||null:null,'attributes':_0x2b96db['options']?_0x2b96db[_0xe04e('0x1c')][_0xe04e('0x1d')]||null:null,'include':_0x2b96db[_0xe04e('0x1c')]?_0x2b96db[_0xe04e('0x1c')][_0xe04e('0x1f')]?_['map'](_0x2b96db['options'][_0xe04e('0x1f')],function(_0x136433){return{'model':db[_0x136433[_0xe04e('0x24')]],'as':_0x136433['as'],'attributes':_0x136433['attributes'],'include':_0x136433['include']?_[_0xe04e('0x20')](_0x136433[_0xe04e('0x1f')],function(_0x5ac718){return{'model':db[_0x5ac718[_0xe04e('0x24')]],'as':_0x5ac718['as'],'attributes':_0x5ac718[_0xe04e('0x1d')],'include':_0x5ac718[_0xe04e('0x1f')]?_[_0xe04e('0x20')](_0x5ac718['include'],function(_0x5f2dce){return{'model':db[_0x5f2dce[_0xe04e('0x24')]],'as':_0x5f2dce['as'],'attributes':_0x5f2dce[_0xe04e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe04e('0xd')](function(_0x43d6a0){logger[_0xe04e('0xe')](_0xe04e('0x21'),_0x2b96db);logger['debug']('ShowServicenowAccount',_0x2b96db,JSON['stringify'](_0x43d6a0));_0x55f4de(_0x43d6a0);})[_0xe04e('0x18')](function(_0x285e55){logger['error'](_0xe04e('0x21'),_0x285e55[_0xe04e('0x16')],_0x2b96db);_0x572110(_0x97aec8[_0xe04e('0x14')](0x1f4,_0x285e55[_0xe04e('0x16')]));});});}; \ No newline at end of file +var _0xf50a=['GetServicenowAccount','stringify','ShowServicenowAccount','find','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','ServicenowAccount','findAll','options','raw','limit','include','map','attributes','model','then'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xf50a,0x19e));var _0xaf50=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xf50a[_0x4d40dd];return _0x1c51f2;};'use strict';var _=require(_0xaf50('0x0'));var util=require(_0xaf50('0x1'));var moment=require(_0xaf50('0x2'));var BPromise=require(_0xaf50('0x3'));var rs=require(_0xaf50('0x4'));var fs=require('fs');var Redis=require(_0xaf50('0x5'));var db=require(_0xaf50('0x6'))['db'];var utils=require(_0xaf50('0x7'));var logger=require(_0xaf50('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf50('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549484,_0x45a7c6,_0x23fb33){return new BPromise(function(_0x50512f,_0x28ef9e){return client[_0xaf50('0xa')](_0x549484,_0x23fb33)['then'](function(_0x463ac0){logger[_0xaf50('0xb')](_0xaf50('0xc'),_0x45a7c6,'request\x20sent');logger[_0xaf50('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x45a7c6,_0xaf50('0xe'),JSON['stringify'](_0x463ac0));if(_0x463ac0[_0xaf50('0xf')]){if(_0x463ac0[_0xaf50('0xf')][_0xaf50('0x10')]===0x1f4){logger[_0xaf50('0xf')](_0xaf50('0xc'),_0x45a7c6,_0x463ac0[_0xaf50('0xf')][_0xaf50('0x11')]);return _0x28ef9e(_0x463ac0[_0xaf50('0xf')]['message']);}logger[_0xaf50('0xf')](_0xaf50('0xc'),_0x45a7c6,_0x463ac0[_0xaf50('0xf')][_0xaf50('0x11')]);return _0x50512f(_0x463ac0[_0xaf50('0xf')][_0xaf50('0x11')]);}else{logger[_0xaf50('0xb')](_0xaf50('0xc'),_0x45a7c6,_0xaf50('0xe'));_0x50512f(_0x463ac0['result'][_0xaf50('0x11')]);}})['catch'](function(_0x93014b){logger[_0xaf50('0xf')](_0xaf50('0xc'),_0x45a7c6,_0x93014b);_0x28ef9e(_0x93014b);});});}exports['GetServicenowAccount']=function(_0x29bbe9){var _0x34ea8b=this;return new Promise(function(_0x1c31da,_0x5bd17c){return db[_0xaf50('0x12')][_0xaf50('0x13')]({'raw':_0x29bbe9[_0xaf50('0x14')]?_0x29bbe9['options'][_0xaf50('0x15')]===undefined?!![]:![]:!![],'where':_0x29bbe9[_0xaf50('0x14')]?_0x29bbe9[_0xaf50('0x14')]['where']||null:null,'attributes':_0x29bbe9[_0xaf50('0x14')]?_0x29bbe9[_0xaf50('0x14')]['attributes']||null:null,'limit':_0x29bbe9[_0xaf50('0x14')]?_0x29bbe9[_0xaf50('0x14')][_0xaf50('0x16')]||null:null,'include':_0x29bbe9[_0xaf50('0x14')]?_0x29bbe9[_0xaf50('0x14')][_0xaf50('0x17')]?_[_0xaf50('0x18')](_0x29bbe9[_0xaf50('0x14')][_0xaf50('0x17')],function(_0x3110a3){return{'model':db[_0x3110a3['model']],'as':_0x3110a3['as'],'attributes':_0x3110a3[_0xaf50('0x19')],'include':_0x3110a3['include']?_[_0xaf50('0x18')](_0x3110a3[_0xaf50('0x17')],function(_0x7c0341){return{'model':db[_0x7c0341['model']],'as':_0x7c0341['as'],'attributes':_0x7c0341[_0xaf50('0x19')],'include':_0x7c0341[_0xaf50('0x17')]?_['map'](_0x7c0341[_0xaf50('0x17')],function(_0x13cec8){return{'model':db[_0x13cec8[_0xaf50('0x1a')]],'as':_0x13cec8['as'],'attributes':_0x13cec8[_0xaf50('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaf50('0x1b')](function(_0x37dba6){logger[_0xaf50('0xb')](_0xaf50('0x1c'),_0x29bbe9);logger[_0xaf50('0xd')]('GetServicenowAccount',_0x29bbe9,JSON[_0xaf50('0x1d')](_0x37dba6));_0x1c31da(_0x37dba6);})['catch'](function(_0x5b5dea){logger[_0xaf50('0xf')](_0xaf50('0x1c'),_0x5b5dea[_0xaf50('0x11')],_0x29bbe9);_0x5bd17c(_0x34ea8b[_0xaf50('0xf')](0x1f4,_0x5b5dea[_0xaf50('0x11')]));});});};exports[_0xaf50('0x1e')]=function(_0x25e36a){var _0x22ee03=this;return new Promise(function(_0x2e6c6e,_0x329390){return db['ServicenowAccount'][_0xaf50('0x1f')]({'raw':_0x25e36a[_0xaf50('0x14')]?_0x25e36a[_0xaf50('0x14')][_0xaf50('0x15')]===undefined?!![]:![]:!![],'where':_0x25e36a['options']?_0x25e36a[_0xaf50('0x14')][_0xaf50('0x20')]||null:null,'attributes':_0x25e36a[_0xaf50('0x14')]?_0x25e36a[_0xaf50('0x14')][_0xaf50('0x19')]||null:null,'include':_0x25e36a[_0xaf50('0x14')]?_0x25e36a[_0xaf50('0x14')][_0xaf50('0x17')]?_['map'](_0x25e36a[_0xaf50('0x14')]['include'],function(_0x574fb6){return{'model':db[_0x574fb6[_0xaf50('0x1a')]],'as':_0x574fb6['as'],'attributes':_0x574fb6[_0xaf50('0x19')],'include':_0x574fb6[_0xaf50('0x17')]?_[_0xaf50('0x18')](_0x574fb6[_0xaf50('0x17')],function(_0x3032a0){return{'model':db[_0x3032a0[_0xaf50('0x1a')]],'as':_0x3032a0['as'],'attributes':_0x3032a0[_0xaf50('0x19')],'include':_0x3032a0['include']?_['map'](_0x3032a0[_0xaf50('0x17')],function(_0x9f8206){return{'model':db[_0x9f8206[_0xaf50('0x1a')]],'as':_0x9f8206['as'],'attributes':_0x9f8206['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf50('0x1b')](function(_0x5df46d){logger[_0xaf50('0xb')]('ShowServicenowAccount',_0x25e36a);logger['debug'](_0xaf50('0x1e'),_0x25e36a,JSON[_0xaf50('0x1d')](_0x5df46d));_0x2e6c6e(_0x5df46d);})[_0xaf50('0x21')](function(_0x124c2b){logger[_0xaf50('0xf')]('ShowServicenowAccount',_0x124c2b[_0xaf50('0x11')],_0x25e36a);_0x329390(_0x22ee03[_0xaf50('0xf')](0x1f4,_0x124c2b[_0xaf50('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d691bce..4b19d19 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 _0x2a2b=['/:id/descriptions','getDescriptions','post','create','update','delete','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x36975e,_0x103ce0){var _0x51ded9=function(_0x5e81c5){while(--_0x5e81c5){_0x36975e['push'](_0x36975e['shift']());}};_0x51ded9(++_0x103ce0);}(_0x2a2b,0x65));var _0xb2a2=function(_0x5426e0,_0x429fc5){_0x5426e0=_0x5426e0-0x0;var _0x4ac62b=_0x2a2b[_0x5426e0];return _0x4ac62b;};'use strict';var multer=require(_0xb2a2('0x0'));var util=require(_0xb2a2('0x1'));var path=require(_0xb2a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xb2a2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2a2('0x4'));var interaction=require(_0xb2a2('0x5'));var config=require(_0xb2a2('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0xb2a2('0x7')]('/',auth['isAuthenticated'](),controller[_0xb2a2('0x8')]);router['get']('/:id',auth[_0xb2a2('0x9')](),controller['show']);router[_0xb2a2('0x7')](_0xb2a2('0xa'),auth[_0xb2a2('0x9')](),controller[_0xb2a2('0xb')]);router['get'](_0xb2a2('0xc'),auth[_0xb2a2('0x9')](),controller[_0xb2a2('0xd')]);router['get'](_0xb2a2('0xe'),auth[_0xb2a2('0x9')](),controller[_0xb2a2('0xf')]);router[_0xb2a2('0x10')]('/',auth[_0xb2a2('0x9')](),controller[_0xb2a2('0x11')]);router['put']('/:id',auth[_0xb2a2('0x9')](),controller[_0xb2a2('0x12')]);router[_0xb2a2('0x13')](_0xb2a2('0x14'),auth[_0xb2a2('0x9')](),controller[_0xb2a2('0x15')]);module[_0xb2a2('0x16')]=router; \ No newline at end of file +var _0xe30d=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show'];(function(_0x17d98c,_0x355fcd){var _0x468b60=function(_0x6ff0fa){while(--_0x6ff0fa){_0x17d98c['push'](_0x17d98c['shift']());}};_0x468b60(++_0x355fcd);}(_0xe30d,0x159));var _0xde30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe30d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde30('0x0'));var util=require('util');var path=require(_0xde30('0x1'));var timeout=require(_0xde30('0x2'));var express=require(_0xde30('0x3'));var router=express['Router']();var fs_extra=require(_0xde30('0x4'));var auth=require(_0xde30('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde30('0x6'));var controller=require(_0xde30('0x7'));router[_0xde30('0x8')]('/',auth[_0xde30('0x9')](),controller['index']);router['get'](_0xde30('0xa'),auth[_0xde30('0x9')](),controller[_0xde30('0xb')]);router['get']('/:id/fields',auth[_0xde30('0x9')](),controller[_0xde30('0xc')]);router[_0xde30('0x8')](_0xde30('0xd'),auth[_0xde30('0x9')](),controller[_0xde30('0xe')]);router[_0xde30('0x8')](_0xde30('0xf'),auth[_0xde30('0x9')](),controller['getDescriptions']);router[_0xde30('0x10')]('/',auth[_0xde30('0x9')](),controller[_0xde30('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xde30('0x12')]);router['delete']('/:id',auth[_0xde30('0x9')](),controller[_0xde30('0x13')]);module[_0xde30('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 1d44ad5..75ed044 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 _0x76a1=['exports','STRING'];(function(_0x2f06e4,_0x5c5045){var _0x3a0b9a=function(_0x163d78){while(--_0x163d78){_0x2f06e4['push'](_0x2f06e4['shift']());}};_0x3a0b9a(++_0x5c5045);}(_0x76a1,0x152));var _0x176a=function(_0x37c343,_0x200e66){_0x37c343=_0x37c343-0x0;var _0x164303=_0x76a1[_0x37c343];return _0x164303;};'use strict';var Sequelize=require('sequelize');module[_0x176a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x176a('0x1')]}}; \ No newline at end of file +var _0x5015=['exports','STRING','sequelize'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x5015,0xe3));var _0x5501=function(_0x5aaecd,_0x26c921){_0x5aaecd=_0x5aaecd-0x0;var _0x398dc6=_0x5015[_0x5aaecd];return _0x398dc6;};'use strict';var Sequelize=require(_0x5501('0x0'));module[_0x5501('0x1')]={'name':{'type':Sequelize[_0x5501('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 9b0f53e..4aecc72 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 _0x920e=['fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','catch','params','find','create','body','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','eml-format','zip-dir'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x920e,0xee));var _0xe920=function(_0x19c721,_0x3ac23f){_0x19c721=_0x19c721-0x0;var _0x34e188=_0x920e[_0x19c721];return _0x34e188;};'use strict';var emlformat=require(_0xe920('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe920('0x1'));var jsonpatch=require(_0xe920('0x2'));var rp=require(_0xe920('0x3'));var moment=require(_0xe920('0x4'));var BPromise=require(_0xe920('0x5'));var Mustache=require(_0xe920('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe920('0x7'));var ejs=require(_0xe920('0x8'));var fs=require('fs');var fs_extra=require(_0xe920('0x9'));var _=require(_0xe920('0xa'));var squel=require(_0xe920('0xb'));var crypto=require(_0xe920('0xc'));var jsforce=require(_0xe920('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe920('0x7'));var querystring=require('querystring');var Papa=require(_0xe920('0xe'));var Redis=require(_0xe920('0xf'));var authService=require(_0xe920('0x10'));var qs=require(_0xe920('0x11'));var as=require(_0xe920('0x12'));var hardwareService=require(_0xe920('0x13'));var logger=require('../../config/logger')(_0xe920('0x14'));var utils=require(_0xe920('0x15'));var config=require(_0xe920('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe920('0x17'))['db'];function respondWithStatusCode(_0x44da0f,_0x3e4e9a){_0x3e4e9a=_0x3e4e9a||0xcc;return function(_0x3723ea){if(_0x3723ea){return _0x44da0f['sendStatus'](_0x3e4e9a);}return _0x44da0f[_0xe920('0x18')](_0x3e4e9a)[_0xe920('0x19')]();};}function respondWithResult(_0x5de39c,_0x340902){_0x340902=_0x340902||0xc8;return function(_0xb94a12){if(_0xb94a12){return _0x5de39c[_0xe920('0x18')](_0x340902)[_0xe920('0x1a')](_0xb94a12);}};}function respondWithFilteredResult(_0x59b864,_0x5cc417){return function(_0x2ed834){if(_0x2ed834){var _0x424306=typeof _0x5cc417[_0xe920('0x1b')]===_0xe920('0x1c')&&typeof _0x5cc417[_0xe920('0x1d')]===_0xe920('0x1c');var _0x9814fb=_0x2ed834['count'];var _0x5e8d4e=_0x424306?0x0:_0x5cc417['offset'];var _0x5dcf24=_0x424306?_0x2ed834[_0xe920('0x1e')]:_0x5cc417[_0xe920('0x1b')]+_0x5cc417[_0xe920('0x1d')];var _0x492ef0;if(_0x5dcf24>=_0x9814fb){_0x5dcf24=_0x9814fb;_0x492ef0=0xc8;}else{_0x492ef0=0xce;}_0x59b864['status'](_0x492ef0);return _0x59b864[_0xe920('0x1f')](_0xe920('0x20'),_0x5e8d4e+'-'+_0x5dcf24+'/'+_0x9814fb)[_0xe920('0x1a')](_0x2ed834);}return null;};}function patchUpdates(_0x1fc051){return function(_0x4121a2){try{jsonpatch[_0xe920('0x21')](_0x4121a2,_0x1fc051,!![]);}catch(_0x3ce7fd){return BPromise[_0xe920('0x22')](_0x3ce7fd);}return _0x4121a2[_0xe920('0x23')]();};}function saveUpdates(_0x1154ad,_0x5b9d9e){return function(_0xcfcbdd){if(_0xcfcbdd){return _0xcfcbdd[_0xe920('0x24')](_0x1154ad)['then'](function(_0x16a287){return _0x16a287;});}return null;};}function removeEntity(_0x303da4,_0x3047bf){return function(_0x1cf9c8){if(_0x1cf9c8){return _0x1cf9c8[_0xe920('0x25')]()['then'](function(){_0x303da4['status'](0xcc)[_0xe920('0x19')]();});}};}function handleEntityNotFound(_0x2dcf47,_0x25941b){return function(_0x4cbcd9){if(!_0x4cbcd9){_0x2dcf47[_0xe920('0x26')](0x194);}return _0x4cbcd9;};}function handleError(_0x13d933,_0xd14a3f){_0xd14a3f=_0xd14a3f||0x1f4;return function(_0xf9d01e){logger[_0xe920('0x27')](_0xf9d01e['stack']);if(_0xf9d01e[_0xe920('0x28')]){delete _0xf9d01e['name'];}_0x13d933[_0xe920('0x18')](_0xd14a3f)['send'](_0xf9d01e);};}exports[_0xe920('0x29')]=function(_0x2be5e5,_0x14ffc4){var _0x14a595={},_0x2f6eed={},_0x54364d={'count':0x0,'rows':[]};var _0x4a7772=_[_0xe920('0x2a')](db[_0xe920('0x2b')][_0xe920('0x2c')],function(_0x5ccb7a){return{'name':_0x5ccb7a['fieldName'],'type':_0x5ccb7a[_0xe920('0x2d')][_0xe920('0x2e')]};});_0x2f6eed[_0xe920('0x2f')]=_[_0xe920('0x2a')](_0x4a7772,'name');_0x2f6eed[_0xe920('0x30')]=_[_0xe920('0x31')](_0x2be5e5['query']);_0x2f6eed[_0xe920('0x32')]=_[_0xe920('0x33')](_0x2f6eed[_0xe920('0x2f')],_0x2f6eed[_0xe920('0x30')]);_0x14a595['attributes']=_[_0xe920('0x33')](_0x2f6eed['model'],qs[_0xe920('0x34')](_0x2be5e5[_0xe920('0x30')]['fields']));_0x14a595[_0xe920('0x35')]=_0x14a595['attributes'][_0xe920('0x36')]?_0x14a595[_0xe920('0x35')]:_0x2f6eed[_0xe920('0x2f')];if(!_0x2be5e5[_0xe920('0x30')][_0xe920('0x37')](_0xe920('0x38'))){_0x14a595[_0xe920('0x1d')]=qs[_0xe920('0x1d')](_0x2be5e5[_0xe920('0x30')]['limit']);_0x14a595[_0xe920('0x1b')]=qs[_0xe920('0x1b')](_0x2be5e5[_0xe920('0x30')][_0xe920('0x1b')]);}_0x14a595[_0xe920('0x39')]=qs[_0xe920('0x3a')](_0x2be5e5[_0xe920('0x30')][_0xe920('0x3a')]);_0x14a595[_0xe920('0x3b')]=qs[_0xe920('0x32')](_['pick'](_0x2be5e5[_0xe920('0x30')],_0x2f6eed[_0xe920('0x32')]),_0x4a7772);if(_0x2be5e5[_0xe920('0x30')]['filter']){_0x14a595[_0xe920('0x3b')]=_[_0xe920('0x3c')](_0x14a595['where'],{'$or':_[_0xe920('0x2a')](_0x4a7772,function(_0x3bd79f){if(_0x3bd79f[_0xe920('0x2d')]!==_0xe920('0x3d')){var _0x5652f5={};_0x5652f5[_0x3bd79f['name']]={'$like':'%'+_0x2be5e5['query'][_0xe920('0x3e')]+'%'};return _0x5652f5;}})});}_0x14a595=_[_0xe920('0x3c')]({},_0x14a595,_0x2be5e5[_0xe920('0x3f')]);var _0x12a87c={'where':_0x14a595[_0xe920('0x3b')]};return db['ServicenowConfiguration'][_0xe920('0x1e')](_0x12a87c)['then'](function(_0x4f8d57){_0x54364d[_0xe920('0x1e')]=_0x4f8d57;if(_0x2be5e5[_0xe920('0x30')][_0xe920('0x40')]){_0x14a595[_0xe920('0x41')]=[{'all':!![]}];}return db[_0xe920('0x2b')][_0xe920('0x42')](_0x14a595);})[_0xe920('0x43')](function(_0x305be0){_0x54364d[_0xe920('0x44')]=_0x305be0;return _0x54364d;})[_0xe920('0x43')](respondWithFilteredResult(_0x14ffc4,_0x14a595))[_0xe920('0x45')](handleError(_0x14ffc4,null));};exports['show']=function(_0xfe1ed1,_0x169407){var _0x1de7ba={'raw':![],'where':{'id':_0xfe1ed1[_0xe920('0x46')]['id']}},_0x304d47={};_0x304d47[_0xe920('0x2f')]=_[_0xe920('0x31')](db['ServicenowConfiguration']['rawAttributes']);_0x304d47[_0xe920('0x30')]=_['keys'](_0xfe1ed1[_0xe920('0x30')]);_0x304d47[_0xe920('0x32')]=_[_0xe920('0x33')](_0x304d47[_0xe920('0x2f')],_0x304d47[_0xe920('0x30')]);_0x1de7ba[_0xe920('0x35')]=_[_0xe920('0x33')](_0x304d47[_0xe920('0x2f')],qs['fields'](_0xfe1ed1[_0xe920('0x30')]['fields']));_0x1de7ba['attributes']=_0x1de7ba[_0xe920('0x35')][_0xe920('0x36')]?_0x1de7ba[_0xe920('0x35')]:_0x304d47[_0xe920('0x2f')];if(_0xfe1ed1[_0xe920('0x30')]['includeAll']){_0x1de7ba[_0xe920('0x41')]=[{'all':!![]}];}_0x1de7ba=_['merge']({},_0x1de7ba,_0xfe1ed1['options']);return db['ServicenowConfiguration'][_0xe920('0x47')](_0x1de7ba)[_0xe920('0x43')](handleEntityNotFound(_0x169407,null))['then'](respondWithResult(_0x169407,null))[_0xe920('0x45')](handleError(_0x169407,null));};exports['create']=function(_0x5820c5,_0x249738){return db[_0xe920('0x2b')][_0xe920('0x48')](_0x5820c5[_0xe920('0x49')],{})['then'](respondWithResult(_0x249738,0xc9))[_0xe920('0x45')](handleError(_0x249738,null));};exports[_0xe920('0x24')]=function(_0x475346,_0x2e5e7f){if(_0x475346[_0xe920('0x49')]['id']){delete _0x475346[_0xe920('0x49')]['id'];}return db['ServicenowConfiguration'][_0xe920('0x47')]({'where':{'id':_0x475346[_0xe920('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e5e7f,null))[_0xe920('0x43')](saveUpdates(_0x475346[_0xe920('0x49')],null))[_0xe920('0x43')](respondWithResult(_0x2e5e7f,null))[_0xe920('0x45')](handleError(_0x2e5e7f,null));};exports[_0xe920('0x25')]=function(_0x267fd3,_0x56a3fb){return db[_0xe920('0x2b')][_0xe920('0x47')]({'where':{'id':_0x267fd3[_0xe920('0x46')]['id']}})[_0xe920('0x43')](handleEntityNotFound(_0x56a3fb,null))[_0xe920('0x43')](removeEntity(_0x56a3fb,null))[_0xe920('0x45')](handleError(_0x56a3fb,null));};exports['getFields']=function(_0x5b99b6,_0x31e654,_0x52eb87){var _0x334b45={};var _0x535366={};var _0x9951da;var _0x5b9da2;return db[_0xe920('0x2b')][_0xe920('0x4a')]({'where':{'id':_0x5b99b6[_0xe920('0x46')]['id']}})[_0xe920('0x43')](handleEntityNotFound(_0x31e654,null))[_0xe920('0x43')](function(_0x1637d6){if(_0x1637d6){_0x9951da=_0x1637d6;_0x535366[_0xe920('0x2f')]=_[_0xe920('0x31')](db[_0xe920('0x4b')][_0xe920('0x2c')]);_0x535366[_0xe920('0x30')]=_[_0xe920('0x31')](_0x5b99b6[_0xe920('0x30')]);_0x535366['filters']=_[_0xe920('0x33')](_0x535366[_0xe920('0x2f')],_0x535366[_0xe920('0x30')]);_0x334b45[_0xe920('0x35')]=_['intersection'](_0x535366['model'],qs[_0xe920('0x34')](_0x5b99b6[_0xe920('0x30')][_0xe920('0x34')]));_0x334b45[_0xe920('0x35')]=_0x334b45[_0xe920('0x35')][_0xe920('0x36')]?_0x334b45[_0xe920('0x35')]:_0x535366[_0xe920('0x2f')];_0x334b45[_0xe920('0x39')]=qs[_0xe920('0x3a')](_0x5b99b6[_0xe920('0x30')][_0xe920('0x3a')]);_0x334b45[_0xe920('0x3b')]=qs[_0xe920('0x32')](_[_0xe920('0x4c')](_0x5b99b6['query'],_0x535366[_0xe920('0x32')]));if(_0x5b99b6[_0xe920('0x30')][_0xe920('0x3e')]){_0x334b45[_0xe920('0x3b')]=_[_0xe920('0x3c')](_0x334b45['where'],{'$or':_[_0xe920('0x2a')](_0x334b45[_0xe920('0x35')],function(_0x522560){var _0x5db055={};_0x5db055[_0x522560]={'$like':'%'+_0x5b99b6[_0xe920('0x30')][_0xe920('0x3e')]+'%'};return _0x5db055;})});}_0x334b45=_[_0xe920('0x3c')]({},_0x334b45,_0x5b99b6[_0xe920('0x3f')]);return _0x9951da[_0xe920('0x4d')](_0x334b45);}})['then'](function(_0x5bab57){if(_0x5bab57){_0x5b9da2=_0x5bab57[_0xe920('0x36')];if(!_0x5b99b6[_0xe920('0x30')]['hasOwnProperty'](_0xe920('0x38'))){_0x334b45[_0xe920('0x1d')]=qs[_0xe920('0x1d')](_0x5b99b6[_0xe920('0x30')][_0xe920('0x1d')]);_0x334b45[_0xe920('0x1b')]=qs[_0xe920('0x1b')](_0x5b99b6[_0xe920('0x30')][_0xe920('0x1b')]);}return _0x9951da['getFields'](_0x334b45);}})[_0xe920('0x43')](function(_0xdd7970){if(_0xdd7970){return _0xdd7970?{'count':_0x5b9da2,'rows':_0xdd7970}:null;}})[_0xe920('0x43')](respondWithResult(_0x31e654,null))['catch'](handleError(_0x31e654,null));};exports[_0xe920('0x4e')]=function(_0x41d3b5,_0x12b694,_0x2e2ec4){var _0x5e7b53={};var _0x4030e2={};var _0xf37c98;var _0x413aef;return db[_0xe920('0x2b')]['findOne']({'where':{'id':_0x41d3b5['params']['id']}})[_0xe920('0x43')](handleEntityNotFound(_0x12b694,null))[_0xe920('0x43')](function(_0x1484a8){if(_0x1484a8){_0xf37c98=_0x1484a8;_0x4030e2[_0xe920('0x2f')]=_[_0xe920('0x31')](db[_0xe920('0x4b')]['rawAttributes']);_0x4030e2['query']=_[_0xe920('0x31')](_0x41d3b5[_0xe920('0x30')]);_0x4030e2['filters']=_[_0xe920('0x33')](_0x4030e2[_0xe920('0x2f')],_0x4030e2[_0xe920('0x30')]);_0x5e7b53['attributes']=_[_0xe920('0x33')](_0x4030e2['model'],qs[_0xe920('0x34')](_0x41d3b5[_0xe920('0x30')][_0xe920('0x34')]));_0x5e7b53[_0xe920('0x35')]=_0x5e7b53[_0xe920('0x35')]['length']?_0x5e7b53[_0xe920('0x35')]:_0x4030e2[_0xe920('0x2f')];_0x5e7b53[_0xe920('0x39')]=qs[_0xe920('0x3a')](_0x41d3b5[_0xe920('0x30')][_0xe920('0x3a')]);_0x5e7b53[_0xe920('0x3b')]=qs[_0xe920('0x32')](_['pick'](_0x41d3b5['query'],_0x4030e2[_0xe920('0x32')]));if(_0x41d3b5[_0xe920('0x30')]['filter']){_0x5e7b53[_0xe920('0x3b')]=_[_0xe920('0x3c')](_0x5e7b53[_0xe920('0x3b')],{'$or':_['map'](_0x5e7b53[_0xe920('0x35')],function(_0x2f0540){var _0x320536={};_0x320536[_0x2f0540]={'$like':'%'+_0x41d3b5[_0xe920('0x30')][_0xe920('0x3e')]+'%'};return _0x320536;})});}_0x5e7b53=_['merge']({},_0x5e7b53,_0x41d3b5[_0xe920('0x3f')]);return _0xf37c98[_0xe920('0x4e')](_0x5e7b53);}})[_0xe920('0x43')](function(_0x278227){if(_0x278227){_0x413aef=_0x278227['length'];if(!_0x41d3b5[_0xe920('0x30')]['hasOwnProperty']('nolimit')){_0x5e7b53[_0xe920('0x1d')]=qs[_0xe920('0x1d')](_0x41d3b5[_0xe920('0x30')]['limit']);_0x5e7b53['offset']=qs[_0xe920('0x1b')](_0x41d3b5[_0xe920('0x30')][_0xe920('0x1b')]);}return _0xf37c98['getSubjects'](_0x5e7b53);}})['then'](function(_0x4dc8f1){if(_0x4dc8f1){return _0x4dc8f1?{'count':_0x413aef,'rows':_0x4dc8f1}:null;}})['then'](respondWithResult(_0x12b694,null))[_0xe920('0x45')](handleError(_0x12b694,null));};exports['getDescriptions']=function(_0x5eef60,_0x11fd0c,_0x4b2430){var _0x57c4c5={};var _0x3bf304={};var _0x44d442;var _0x5b11ff;return db[_0xe920('0x2b')]['findOne']({'where':{'id':_0x5eef60[_0xe920('0x46')]['id']}})[_0xe920('0x43')](handleEntityNotFound(_0x11fd0c,null))[_0xe920('0x43')](function(_0x3d8758){if(_0x3d8758){_0x44d442=_0x3d8758;_0x3bf304['model']=_[_0xe920('0x31')](db['ServicenowField']['rawAttributes']);_0x3bf304['query']=_[_0xe920('0x31')](_0x5eef60[_0xe920('0x30')]);_0x3bf304[_0xe920('0x32')]=_[_0xe920('0x33')](_0x3bf304['model'],_0x3bf304['query']);_0x57c4c5[_0xe920('0x35')]=_[_0xe920('0x33')](_0x3bf304[_0xe920('0x2f')],qs['fields'](_0x5eef60[_0xe920('0x30')]['fields']));_0x57c4c5[_0xe920('0x35')]=_0x57c4c5[_0xe920('0x35')]['length']?_0x57c4c5[_0xe920('0x35')]:_0x3bf304[_0xe920('0x2f')];_0x57c4c5[_0xe920('0x39')]=qs[_0xe920('0x3a')](_0x5eef60['query'][_0xe920('0x3a')]);_0x57c4c5[_0xe920('0x3b')]=qs[_0xe920('0x32')](_['pick'](_0x5eef60[_0xe920('0x30')],_0x3bf304[_0xe920('0x32')]));if(_0x5eef60[_0xe920('0x30')]['filter']){_0x57c4c5[_0xe920('0x3b')]=_[_0xe920('0x3c')](_0x57c4c5[_0xe920('0x3b')],{'$or':_[_0xe920('0x2a')](_0x57c4c5[_0xe920('0x35')],function(_0x2e9876){var _0xba014b={};_0xba014b[_0x2e9876]={'$like':'%'+_0x5eef60['query'][_0xe920('0x3e')]+'%'};return _0xba014b;})});}_0x57c4c5=_[_0xe920('0x3c')]({},_0x57c4c5,_0x5eef60['options']);return _0x44d442[_0xe920('0x4f')](_0x57c4c5);}})[_0xe920('0x43')](function(_0x3b5c62){if(_0x3b5c62){_0x5b11ff=_0x3b5c62[_0xe920('0x36')];if(!_0x5eef60[_0xe920('0x30')]['hasOwnProperty'](_0xe920('0x38'))){_0x57c4c5[_0xe920('0x1d')]=qs[_0xe920('0x1d')](_0x5eef60['query'][_0xe920('0x1d')]);_0x57c4c5[_0xe920('0x1b')]=qs[_0xe920('0x1b')](_0x5eef60[_0xe920('0x30')]['offset']);}return _0x44d442[_0xe920('0x4f')](_0x57c4c5);}})[_0xe920('0x43')](function(_0x1fc964){if(_0x1fc964){return _0x1fc964?{'count':_0x5b11ff,'rows':_0x1fc964}:null;}})[_0xe920('0x43')](respondWithResult(_0x11fd0c,null))[_0xe920('0x45')](handleError(_0x11fd0c,null));}; \ No newline at end of file +var _0x7038=['findOne','hasOwnProperty','getSubjects','ServicenowField','rawAttributes','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','json','apply','save','update','then','destroy','error','stack','send','index','map','fieldName','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','include','ServicenowConfiguration','findAll','rows','catch','show','params','fields','options','find','create','body','getFields'];(function(_0x543354,_0x44dec9){var _0x1f0843=function(_0x687201){while(--_0x687201){_0x543354['push'](_0x543354['shift']());}};_0x1f0843(++_0x44dec9);}(_0x7038,0x1a5));var _0x8703=function(_0x415b7f,_0x463d1c){_0x415b7f=_0x415b7f-0x0;var _0x46d589=_0x7038[_0x415b7f];return _0x46d589;};'use strict';var emlformat=require(_0x8703('0x0'));var rimraf=require(_0x8703('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8703('0x2'));var rp=require(_0x8703('0x3'));var moment=require(_0x8703('0x4'));var BPromise=require(_0x8703('0x5'));var Mustache=require(_0x8703('0x6'));var util=require(_0x8703('0x7'));var path=require(_0x8703('0x8'));var sox=require(_0x8703('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8703('0xa'));var _=require(_0x8703('0xb'));var squel=require(_0x8703('0xc'));var crypto=require(_0x8703('0xd'));var jsforce=require(_0x8703('0xe'));var deskjs=require(_0x8703('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8703('0x10'));var Papa=require(_0x8703('0x11'));var Redis=require(_0x8703('0x12'));var authService=require(_0x8703('0x13'));var qs=require(_0x8703('0x14'));var as=require(_0x8703('0x15'));var hardwareService=require(_0x8703('0x16'));var logger=require(_0x8703('0x17'))(_0x8703('0x18'));var utils=require(_0x8703('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8703('0x1a'));var db=require(_0x8703('0x1b'))['db'];function respondWithStatusCode(_0x3e06cf,_0xabc945){_0xabc945=_0xabc945||0xcc;return function(_0x1abb8d){if(_0x1abb8d){return _0x3e06cf[_0x8703('0x1c')](_0xabc945);}return _0x3e06cf['status'](_0xabc945)[_0x8703('0x1d')]();};}function respondWithResult(_0x5c3617,_0x4c874e){_0x4c874e=_0x4c874e||0xc8;return function(_0x1dfcca){if(_0x1dfcca){return _0x5c3617['status'](_0x4c874e)['json'](_0x1dfcca);}};}function respondWithFilteredResult(_0x1c7107,_0x23f55d){return function(_0x5cc1f2){if(_0x5cc1f2){var _0x40e9f5=typeof _0x23f55d[_0x8703('0x1e')]===_0x8703('0x1f')&&typeof _0x23f55d['limit']===_0x8703('0x1f');var _0x1e1661=_0x5cc1f2[_0x8703('0x20')];var _0x52a7b6=_0x40e9f5?0x0:_0x23f55d[_0x8703('0x1e')];var _0x21dbbd=_0x40e9f5?_0x5cc1f2[_0x8703('0x20')]:_0x23f55d['offset']+_0x23f55d[_0x8703('0x21')];var _0x5b8915;if(_0x21dbbd>=_0x1e1661){_0x21dbbd=_0x1e1661;_0x5b8915=0xc8;}else{_0x5b8915=0xce;}_0x1c7107[_0x8703('0x22')](_0x5b8915);return _0x1c7107[_0x8703('0x23')]('Content-Range',_0x52a7b6+'-'+_0x21dbbd+'/'+_0x1e1661)[_0x8703('0x24')](_0x5cc1f2);}return null;};}function patchUpdates(_0x49238a){return function(_0x4d498e){try{jsonpatch[_0x8703('0x25')](_0x4d498e,_0x49238a,!![]);}catch(_0x194ec8){return BPromise['reject'](_0x194ec8);}return _0x4d498e[_0x8703('0x26')]();};}function saveUpdates(_0x290fbc,_0x2a6607){return function(_0x258818){if(_0x258818){return _0x258818[_0x8703('0x27')](_0x290fbc)[_0x8703('0x28')](function(_0xa99a78){return _0xa99a78;});}return null;};}function removeEntity(_0x4fd280,_0x43f4f0){return function(_0x28d824){if(_0x28d824){return _0x28d824[_0x8703('0x29')]()[_0x8703('0x28')](function(){_0x4fd280[_0x8703('0x22')](0xcc)[_0x8703('0x1d')]();});}};}function handleEntityNotFound(_0x1c168d,_0x1cc4e6){return function(_0x241f68){if(!_0x241f68){_0x1c168d[_0x8703('0x1c')](0x194);}return _0x241f68;};}function handleError(_0x30adff,_0x509891){_0x509891=_0x509891||0x1f4;return function(_0x376453){logger[_0x8703('0x2a')](_0x376453[_0x8703('0x2b')]);if(_0x376453['name']){delete _0x376453['name'];}_0x30adff[_0x8703('0x22')](_0x509891)[_0x8703('0x2c')](_0x376453);};}exports[_0x8703('0x2d')]=function(_0x501cb3,_0x436139){var _0xa3813b={},_0x10786a={},_0x517016={'count':0x0,'rows':[]};var _0x210090=_[_0x8703('0x2e')](db['ServicenowConfiguration']['rawAttributes'],function(_0x7c8463){return{'name':_0x7c8463[_0x8703('0x2f')],'type':_0x7c8463['type']['key']};});_0x10786a[_0x8703('0x30')]=_[_0x8703('0x2e')](_0x210090,'name');_0x10786a[_0x8703('0x31')]=_[_0x8703('0x32')](_0x501cb3[_0x8703('0x31')]);_0x10786a[_0x8703('0x33')]=_[_0x8703('0x34')](_0x10786a[_0x8703('0x30')],_0x10786a[_0x8703('0x31')]);_0xa3813b[_0x8703('0x35')]=_[_0x8703('0x34')](_0x10786a[_0x8703('0x30')],qs['fields'](_0x501cb3[_0x8703('0x31')]['fields']));_0xa3813b[_0x8703('0x35')]=_0xa3813b[_0x8703('0x35')][_0x8703('0x36')]?_0xa3813b[_0x8703('0x35')]:_0x10786a[_0x8703('0x30')];if(!_0x501cb3['query']['hasOwnProperty'](_0x8703('0x37'))){_0xa3813b[_0x8703('0x21')]=qs[_0x8703('0x21')](_0x501cb3[_0x8703('0x31')][_0x8703('0x21')]);_0xa3813b[_0x8703('0x1e')]=qs[_0x8703('0x1e')](_0x501cb3[_0x8703('0x31')][_0x8703('0x1e')]);}_0xa3813b[_0x8703('0x38')]=qs[_0x8703('0x39')](_0x501cb3['query']['sort']);_0xa3813b['where']=qs['filters'](_[_0x8703('0x3a')](_0x501cb3['query'],_0x10786a[_0x8703('0x33')]),_0x210090);if(_0x501cb3[_0x8703('0x31')][_0x8703('0x3b')]){_0xa3813b[_0x8703('0x3c')]=_[_0x8703('0x3d')](_0xa3813b[_0x8703('0x3c')],{'$or':_[_0x8703('0x2e')](_0x210090,function(_0xf80b4a){if(_0xf80b4a['type']!==_0x8703('0x3e')){var _0x8e858a={};_0x8e858a[_0xf80b4a[_0x8703('0x3f')]]={'$like':'%'+_0x501cb3[_0x8703('0x31')]['filter']+'%'};return _0x8e858a;}})});}_0xa3813b=_['merge']({},_0xa3813b,_0x501cb3['options']);var _0x1078f7={'where':_0xa3813b[_0x8703('0x3c')]};return db['ServicenowConfiguration']['count'](_0x1078f7)[_0x8703('0x28')](function(_0x569c41){_0x517016['count']=_0x569c41;if(_0x501cb3['query']['includeAll']){_0xa3813b[_0x8703('0x40')]=[{'all':!![]}];}return db[_0x8703('0x41')][_0x8703('0x42')](_0xa3813b);})[_0x8703('0x28')](function(_0x6ed6b5){_0x517016[_0x8703('0x43')]=_0x6ed6b5;return _0x517016;})[_0x8703('0x28')](respondWithFilteredResult(_0x436139,_0xa3813b))[_0x8703('0x44')](handleError(_0x436139,null));};exports[_0x8703('0x45')]=function(_0x34a277,_0x1b6cd7){var _0x11dd58={'raw':![],'where':{'id':_0x34a277[_0x8703('0x46')]['id']}},_0x54f792={};_0x54f792[_0x8703('0x30')]=_['keys'](db[_0x8703('0x41')]['rawAttributes']);_0x54f792[_0x8703('0x31')]=_[_0x8703('0x32')](_0x34a277['query']);_0x54f792[_0x8703('0x33')]=_[_0x8703('0x34')](_0x54f792[_0x8703('0x30')],_0x54f792[_0x8703('0x31')]);_0x11dd58[_0x8703('0x35')]=_['intersection'](_0x54f792['model'],qs[_0x8703('0x47')](_0x34a277[_0x8703('0x31')][_0x8703('0x47')]));_0x11dd58[_0x8703('0x35')]=_0x11dd58[_0x8703('0x35')]['length']?_0x11dd58[_0x8703('0x35')]:_0x54f792[_0x8703('0x30')];if(_0x34a277[_0x8703('0x31')]['includeAll']){_0x11dd58[_0x8703('0x40')]=[{'all':!![]}];}_0x11dd58=_[_0x8703('0x3d')]({},_0x11dd58,_0x34a277[_0x8703('0x48')]);return db[_0x8703('0x41')][_0x8703('0x49')](_0x11dd58)[_0x8703('0x28')](handleEntityNotFound(_0x1b6cd7,null))[_0x8703('0x28')](respondWithResult(_0x1b6cd7,null))['catch'](handleError(_0x1b6cd7,null));};exports['create']=function(_0x4436a2,_0x13b128){return db['ServicenowConfiguration'][_0x8703('0x4a')](_0x4436a2[_0x8703('0x4b')],{})[_0x8703('0x28')](respondWithResult(_0x13b128,0xc9))['catch'](handleError(_0x13b128,null));};exports[_0x8703('0x27')]=function(_0x549b17,_0x2ef576){if(_0x549b17[_0x8703('0x4b')]['id']){delete _0x549b17[_0x8703('0x4b')]['id'];}return db['ServicenowConfiguration'][_0x8703('0x49')]({'where':{'id':_0x549b17[_0x8703('0x46')]['id']}})[_0x8703('0x28')](handleEntityNotFound(_0x2ef576,null))[_0x8703('0x28')](saveUpdates(_0x549b17[_0x8703('0x4b')],null))['then'](respondWithResult(_0x2ef576,null))[_0x8703('0x44')](handleError(_0x2ef576,null));};exports[_0x8703('0x29')]=function(_0x51bd09,_0x3ab1bc){return db[_0x8703('0x41')][_0x8703('0x49')]({'where':{'id':_0x51bd09[_0x8703('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ab1bc,null))['then'](removeEntity(_0x3ab1bc,null))[_0x8703('0x44')](handleError(_0x3ab1bc,null));};exports[_0x8703('0x4c')]=function(_0x1e1be2,_0x2d39f7,_0x1da0eb){var _0x18f890={};var _0x157fb9={};var _0xde0d8;var _0x16fc4a;return db[_0x8703('0x41')][_0x8703('0x4d')]({'where':{'id':_0x1e1be2[_0x8703('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d39f7,null))['then'](function(_0x37f7d7){if(_0x37f7d7){_0xde0d8=_0x37f7d7;_0x157fb9[_0x8703('0x30')]=_[_0x8703('0x32')](db['ServicenowField']['rawAttributes']);_0x157fb9[_0x8703('0x31')]=_[_0x8703('0x32')](_0x1e1be2[_0x8703('0x31')]);_0x157fb9[_0x8703('0x33')]=_[_0x8703('0x34')](_0x157fb9[_0x8703('0x30')],_0x157fb9[_0x8703('0x31')]);_0x18f890[_0x8703('0x35')]=_[_0x8703('0x34')](_0x157fb9[_0x8703('0x30')],qs[_0x8703('0x47')](_0x1e1be2[_0x8703('0x31')][_0x8703('0x47')]));_0x18f890[_0x8703('0x35')]=_0x18f890[_0x8703('0x35')][_0x8703('0x36')]?_0x18f890['attributes']:_0x157fb9['model'];_0x18f890[_0x8703('0x38')]=qs['sort'](_0x1e1be2[_0x8703('0x31')][_0x8703('0x39')]);_0x18f890[_0x8703('0x3c')]=qs['filters'](_[_0x8703('0x3a')](_0x1e1be2[_0x8703('0x31')],_0x157fb9[_0x8703('0x33')]));if(_0x1e1be2[_0x8703('0x31')][_0x8703('0x3b')]){_0x18f890['where']=_[_0x8703('0x3d')](_0x18f890[_0x8703('0x3c')],{'$or':_[_0x8703('0x2e')](_0x18f890[_0x8703('0x35')],function(_0xd8ec08){var _0x120b64={};_0x120b64[_0xd8ec08]={'$like':'%'+_0x1e1be2[_0x8703('0x31')][_0x8703('0x3b')]+'%'};return _0x120b64;})});}_0x18f890=_[_0x8703('0x3d')]({},_0x18f890,_0x1e1be2['options']);return _0xde0d8[_0x8703('0x4c')](_0x18f890);}})[_0x8703('0x28')](function(_0x4c8b64){if(_0x4c8b64){_0x16fc4a=_0x4c8b64[_0x8703('0x36')];if(!_0x1e1be2['query'][_0x8703('0x4e')](_0x8703('0x37'))){_0x18f890[_0x8703('0x21')]=qs[_0x8703('0x21')](_0x1e1be2['query'][_0x8703('0x21')]);_0x18f890['offset']=qs[_0x8703('0x1e')](_0x1e1be2[_0x8703('0x31')]['offset']);}return _0xde0d8[_0x8703('0x4c')](_0x18f890);}})['then'](function(_0x438b00){if(_0x438b00){return _0x438b00?{'count':_0x16fc4a,'rows':_0x438b00}:null;}})['then'](respondWithResult(_0x2d39f7,null))[_0x8703('0x44')](handleError(_0x2d39f7,null));};exports[_0x8703('0x4f')]=function(_0x19be29,_0x45fde0,_0x2216c1){var _0x3f5a31={};var _0x4647c1={};var _0x274f1e;var _0xeee66f;return db[_0x8703('0x41')][_0x8703('0x4d')]({'where':{'id':_0x19be29[_0x8703('0x46')]['id']}})[_0x8703('0x28')](handleEntityNotFound(_0x45fde0,null))[_0x8703('0x28')](function(_0x7db78d){if(_0x7db78d){_0x274f1e=_0x7db78d;_0x4647c1[_0x8703('0x30')]=_[_0x8703('0x32')](db[_0x8703('0x50')][_0x8703('0x51')]);_0x4647c1[_0x8703('0x31')]=_['keys'](_0x19be29[_0x8703('0x31')]);_0x4647c1[_0x8703('0x33')]=_['intersection'](_0x4647c1[_0x8703('0x30')],_0x4647c1[_0x8703('0x31')]);_0x3f5a31['attributes']=_[_0x8703('0x34')](_0x4647c1[_0x8703('0x30')],qs[_0x8703('0x47')](_0x19be29[_0x8703('0x31')][_0x8703('0x47')]));_0x3f5a31['attributes']=_0x3f5a31[_0x8703('0x35')]['length']?_0x3f5a31[_0x8703('0x35')]:_0x4647c1['model'];_0x3f5a31['order']=qs[_0x8703('0x39')](_0x19be29[_0x8703('0x31')][_0x8703('0x39')]);_0x3f5a31[_0x8703('0x3c')]=qs[_0x8703('0x33')](_[_0x8703('0x3a')](_0x19be29[_0x8703('0x31')],_0x4647c1[_0x8703('0x33')]));if(_0x19be29[_0x8703('0x31')][_0x8703('0x3b')]){_0x3f5a31[_0x8703('0x3c')]=_[_0x8703('0x3d')](_0x3f5a31[_0x8703('0x3c')],{'$or':_[_0x8703('0x2e')](_0x3f5a31[_0x8703('0x35')],function(_0x1bb24f){var _0x5df1d8={};_0x5df1d8[_0x1bb24f]={'$like':'%'+_0x19be29[_0x8703('0x31')][_0x8703('0x3b')]+'%'};return _0x5df1d8;})});}_0x3f5a31=_[_0x8703('0x3d')]({},_0x3f5a31,_0x19be29[_0x8703('0x48')]);return _0x274f1e[_0x8703('0x4f')](_0x3f5a31);}})[_0x8703('0x28')](function(_0x56fb7d){if(_0x56fb7d){_0xeee66f=_0x56fb7d['length'];if(!_0x19be29[_0x8703('0x31')][_0x8703('0x4e')](_0x8703('0x37'))){_0x3f5a31[_0x8703('0x21')]=qs[_0x8703('0x21')](_0x19be29['query'][_0x8703('0x21')]);_0x3f5a31[_0x8703('0x1e')]=qs[_0x8703('0x1e')](_0x19be29['query'][_0x8703('0x1e')]);}return _0x274f1e[_0x8703('0x4f')](_0x3f5a31);}})['then'](function(_0x6a283f){if(_0x6a283f){return _0x6a283f?{'count':_0xeee66f,'rows':_0x6a283f}:null;}})[_0x8703('0x28')](respondWithResult(_0x45fde0,null))['catch'](handleError(_0x45fde0,null));};exports[_0x8703('0x52')]=function(_0x39978c,_0x4bc5b3,_0x746e5b){var _0x2ddeac={};var _0x3a05d5={};var _0xb1c4a8;var _0x1f413a;return db[_0x8703('0x41')][_0x8703('0x4d')]({'where':{'id':_0x39978c[_0x8703('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bc5b3,null))[_0x8703('0x28')](function(_0x5413a0){if(_0x5413a0){_0xb1c4a8=_0x5413a0;_0x3a05d5['model']=_[_0x8703('0x32')](db['ServicenowField']['rawAttributes']);_0x3a05d5[_0x8703('0x31')]=_[_0x8703('0x32')](_0x39978c[_0x8703('0x31')]);_0x3a05d5[_0x8703('0x33')]=_['intersection'](_0x3a05d5['model'],_0x3a05d5[_0x8703('0x31')]);_0x2ddeac[_0x8703('0x35')]=_['intersection'](_0x3a05d5[_0x8703('0x30')],qs[_0x8703('0x47')](_0x39978c[_0x8703('0x31')][_0x8703('0x47')]));_0x2ddeac[_0x8703('0x35')]=_0x2ddeac[_0x8703('0x35')][_0x8703('0x36')]?_0x2ddeac[_0x8703('0x35')]:_0x3a05d5[_0x8703('0x30')];_0x2ddeac['order']=qs[_0x8703('0x39')](_0x39978c['query']['sort']);_0x2ddeac[_0x8703('0x3c')]=qs[_0x8703('0x33')](_[_0x8703('0x3a')](_0x39978c[_0x8703('0x31')],_0x3a05d5[_0x8703('0x33')]));if(_0x39978c[_0x8703('0x31')]['filter']){_0x2ddeac['where']=_[_0x8703('0x3d')](_0x2ddeac['where'],{'$or':_[_0x8703('0x2e')](_0x2ddeac['attributes'],function(_0x23bbda){var _0x325f77={};_0x325f77[_0x23bbda]={'$like':'%'+_0x39978c[_0x8703('0x31')][_0x8703('0x3b')]+'%'};return _0x325f77;})});}_0x2ddeac=_['merge']({},_0x2ddeac,_0x39978c[_0x8703('0x48')]);return _0xb1c4a8['getDescriptions'](_0x2ddeac);}})[_0x8703('0x28')](function(_0x258fd8){if(_0x258fd8){_0x1f413a=_0x258fd8['length'];if(!_0x39978c['query'][_0x8703('0x4e')]('nolimit')){_0x2ddeac['limit']=qs[_0x8703('0x21')](_0x39978c[_0x8703('0x31')][_0x8703('0x21')]);_0x2ddeac[_0x8703('0x1e')]=qs[_0x8703('0x1e')](_0x39978c[_0x8703('0x31')][_0x8703('0x1e')]);}return _0xb1c4a8['getDescriptions'](_0x2ddeac);}})[_0x8703('0x28')](function(_0x420bf3){if(_0x420bf3){return _0x420bf3?{'count':_0x1f413a,'rows':_0x420bf3}:null;}})[_0x8703('0x28')](respondWithResult(_0x4bc5b3,null))['catch'](handleError(_0x4bc5b3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 738cb78..314d4ea 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 _0xcf66=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x46f48c,_0x343ca7){var _0x43d8de=function(_0x2e9de1){while(--_0x2e9de1){_0x46f48c['push'](_0x46f48c['shift']());}};_0x43d8de(++_0x343ca7);}(_0xcf66,0x71));var _0x6cf6=function(_0x3ca204,_0x559ca6){_0x3ca204=_0x3ca204-0x0;var _0x5972a3=_0xcf66[_0x3ca204];return _0x5972a3;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var logger=require(_0x6cf6('0x2'))('api');var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x6cf6('0x7')]=function(_0x1fbedd,_0x2a573e){return _0x1fbedd['define'](_0x6cf6('0x8'),attributes,{'tableName':_0x6cf6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe890=['define','ServicenowConfiguration','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x1c29fa,_0x29ac1a){var _0x438d41=function(_0xe0b7a7){while(--_0xe0b7a7){_0x1c29fa['push'](_0x1c29fa['shift']());}};_0x438d41(++_0x29ac1a);}(_0xe890,0x1a6));var _0x0e89=function(_0xdf8249,_0x18d6ed){_0xdf8249=_0xdf8249-0x0;var _0x4a1c86=_0xe890[_0xdf8249];return _0x4a1c86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e89('0x0'))(_0x0e89('0x1'));var moment=require(_0x0e89('0x2'));var BPromise=require(_0x0e89('0x3'));var rp=require(_0x0e89('0x4'));var fs=require('fs');var path=require(_0x0e89('0x5'));var rimraf=require(_0x0e89('0x6'));var config=require(_0x0e89('0x7'));var attributes=require(_0x0e89('0x8'));module[_0x0e89('0x9')]=function(_0x563a51,_0x58f553){return _0x563a51[_0x0e89('0xa')](_0x0e89('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 775e4b8..140819f 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 _0xad07=['message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x5a5cad,_0x43ca84){var _0x5437fd=function(_0x58ab10){while(--_0x58ab10){_0x5a5cad['push'](_0x5a5cad['shift']());}};_0x5437fd(++_0x43ca84);}(_0xad07,0x1ab));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ad0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7ad0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ad0('0x2'));var db=require(_0x7ad0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ad0('0x4'))(_0x7ad0('0x5'));var config=require('../../config/environment');var jayson=require(_0x7ad0('0x6'));var client=jayson[_0x7ad0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462f81,_0x14fd78,_0x1a9ed2){return new BPromise(function(_0x2c3e0f,_0x539e26){return client[_0x7ad0('0x8')](_0x462f81,_0x1a9ed2)['then'](function(_0x3c6422){logger[_0x7ad0('0x9')](_0x7ad0('0xa'),_0x14fd78,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x14fd78,_0x7ad0('0xb'),JSON[_0x7ad0('0xc')](_0x3c6422));if(_0x3c6422['error']){if(_0x3c6422['error'][_0x7ad0('0xd')]===0x1f4){logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x14fd78,_0x3c6422[_0x7ad0('0xe')][_0x7ad0('0xf')]);return _0x539e26(_0x3c6422[_0x7ad0('0xe')]['message']);}logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x14fd78,_0x3c6422[_0x7ad0('0xe')][_0x7ad0('0xf')]);return _0x2c3e0f(_0x3c6422[_0x7ad0('0xe')][_0x7ad0('0xf')]);}else{logger[_0x7ad0('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14fd78,_0x7ad0('0xb'));_0x2c3e0f(_0x3c6422[_0x7ad0('0x10')]['message']);}})['catch'](function(_0x448ef6){logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x14fd78,_0x448ef6);_0x539e26(_0x448ef6);});});} \ No newline at end of file +var _0xa1b8=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x332045,_0x5529e9){var _0x3ee8f0=function(_0x288202){while(--_0x288202){_0x332045['push'](_0x332045['shift']());}};_0x3ee8f0(++_0x5529e9);}(_0xa1b8,0x1b7));var _0x8a1b=function(_0x2d0693,_0x2bab88){_0x2d0693=_0x2d0693-0x0;var _0x11e12b=_0xa1b8[_0x2d0693];return _0x11e12b;};'use strict';var _=require(_0x8a1b('0x0'));var util=require(_0x8a1b('0x1'));var moment=require(_0x8a1b('0x2'));var BPromise=require(_0x8a1b('0x3'));var rs=require(_0x8a1b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a1b('0x5'))['db'];var utils=require(_0x8a1b('0x6'));var logger=require(_0x8a1b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8a1b('0x8'));var client=jayson[_0x8a1b('0x9')][_0x8a1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40cca6,_0x571ece,_0x31efd6){return new BPromise(function(_0x1e03b5,_0x2bf975){return client[_0x8a1b('0xb')](_0x40cca6,_0x31efd6)[_0x8a1b('0xc')](function(_0x462b42){logger[_0x8a1b('0xd')](_0x8a1b('0xe'),_0x571ece,_0x8a1b('0xf'));logger['debug'](_0x8a1b('0x10'),_0x571ece,'request\x20sent',JSON[_0x8a1b('0x11')](_0x462b42));if(_0x462b42[_0x8a1b('0x12')]){if(_0x462b42[_0x8a1b('0x12')][_0x8a1b('0x13')]===0x1f4){logger[_0x8a1b('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x571ece,_0x462b42['error'][_0x8a1b('0x14')]);return _0x2bf975(_0x462b42[_0x8a1b('0x12')]['message']);}logger['error'](_0x8a1b('0xe'),_0x571ece,_0x462b42[_0x8a1b('0x12')][_0x8a1b('0x14')]);return _0x1e03b5(_0x462b42[_0x8a1b('0x12')][_0x8a1b('0x14')]);}else{logger['info'](_0x8a1b('0xe'),_0x571ece,_0x8a1b('0xf'));_0x1e03b5(_0x462b42[_0x8a1b('0x15')][_0x8a1b('0x14')]);}})[_0x8a1b('0x16')](function(_0x4d2b13){logger[_0x8a1b('0x12')](_0x8a1b('0xe'),_0x571ece,_0x4d2b13);_0x2bf975(_0x4d2b13);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7202b89..d33a499 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 _0xc2e4=['index','/:id','post','put','update','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xc2e4,0xca));var _0x4c2e=function(_0x1ee9ef,_0x3ee2d3){_0x1ee9ef=_0x1ee9ef-0x0;var _0x3d9e67=_0xc2e4[_0x1ee9ef];return _0x3d9e67;};'use strict';var multer=require(_0x4c2e('0x0'));var util=require('util');var path=require(_0x4c2e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c2e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4c2e('0x3'));var interaction=require(_0x4c2e('0x4'));var config=require('../../config/environment');var controller=require(_0x4c2e('0x5'));router[_0x4c2e('0x6')]('/',auth[_0x4c2e('0x7')](),controller[_0x4c2e('0x8')]);router[_0x4c2e('0x6')](_0x4c2e('0x9'),auth[_0x4c2e('0x7')](),controller['show']);router[_0x4c2e('0xa')]('/',auth[_0x4c2e('0x7')](),controller['create']);router[_0x4c2e('0xb')]('/:id',auth[_0x4c2e('0x7')](),controller[_0x4c2e('0xc')]);router[_0x4c2e('0xd')](_0x4c2e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x4c2e('0xe')]=router; \ No newline at end of file +var _0x2acd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x14b1e3,_0x44d1ed){var _0x36b443=function(_0x3705fa){while(--_0x3705fa){_0x14b1e3['push'](_0x14b1e3['shift']());}};_0x36b443(++_0x44d1ed);}(_0x2acd,0x9b));var _0xd2ac=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2acd[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xd2ac('0x0'));var util=require(_0xd2ac('0x1'));var path=require(_0xd2ac('0x2'));var timeout=require(_0xd2ac('0x3'));var express=require(_0xd2ac('0x4'));var router=express[_0xd2ac('0x5')]();var fs_extra=require(_0xd2ac('0x6'));var auth=require(_0xd2ac('0x7'));var interaction=require(_0xd2ac('0x8'));var config=require(_0xd2ac('0x9'));var controller=require(_0xd2ac('0xa'));router[_0xd2ac('0xb')]('/',auth[_0xd2ac('0xc')](),controller[_0xd2ac('0xd')]);router[_0xd2ac('0xb')](_0xd2ac('0xe'),auth['isAuthenticated'](),controller[_0xd2ac('0xf')]);router[_0xd2ac('0x10')]('/',auth[_0xd2ac('0xc')](),controller[_0xd2ac('0x11')]);router[_0xd2ac('0x12')](_0xd2ac('0xe'),auth[_0xd2ac('0xc')](),controller[_0xd2ac('0x13')]);router[_0xd2ac('0x14')]('/:id',auth[_0xd2ac('0xc')](),controller[_0xd2ac('0x15')]);module[_0xd2ac('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 5d30c56..beef8f1 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 _0x49e9=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x49e9,0x11d));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x949e('0x0'));module[_0x949e('0x1')]={'type':{'type':Sequelize[_0x949e('0x2')](_0x949e('0x3'),_0x949e('0x4'),_0x949e('0x5'),_0x949e('0x6'),_0x949e('0x7')),'defaultValue':_0x949e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x949e('0x8')]},'keyType':{'type':Sequelize[_0x949e('0x2')](_0x949e('0x3'),_0x949e('0x4'),_0x949e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x949e('0x8')]},'nameField':{'type':Sequelize[_0x949e('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x65e1=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x65e1,0x168));var _0x165e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x65e1[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x165e('0x0'));module[_0x165e('0x1')]={'type':{'type':Sequelize[_0x165e('0x2')](_0x165e('0x3'),_0x165e('0x4'),_0x165e('0x5'),'keyValue',_0x165e('0x6')),'defaultValue':_0x165e('0x3')},'content':{'type':Sequelize[_0x165e('0x7')]},'key':{'type':Sequelize[_0x165e('0x7')]},'keyType':{'type':Sequelize[_0x165e('0x2')](_0x165e('0x3'),'variable',_0x165e('0x5'))},'keyContent':{'type':Sequelize[_0x165e('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x165e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x165e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 6e09495..11e8091 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 _0x91d0=['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','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','index','map','ServicenowField','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','name','options','includeAll','findAll','rows','show','params','fields','include','merge','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv'];(function(_0x2fea93,_0x1b0cad){var _0x385f92=function(_0x3535d6){while(--_0x3535d6){_0x2fea93['push'](_0x2fea93['shift']());}};_0x385f92(++_0x1b0cad);}(_0x91d0,0x127));var _0x091d=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x91d0[_0x3daa8c];return _0x2b1bd7;};'use strict';var emlformat=require(_0x091d('0x0'));var rimraf=require(_0x091d('0x1'));var zipdir=require(_0x091d('0x2'));var jsonpatch=require(_0x091d('0x3'));var rp=require('request-promise');var moment=require(_0x091d('0x4'));var BPromise=require(_0x091d('0x5'));var Mustache=require(_0x091d('0x6'));var util=require(_0x091d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x091d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x091d('0x9'));var _=require(_0x091d('0xa'));var squel=require(_0x091d('0xb'));var crypto=require('crypto');var jsforce=require(_0x091d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x091d('0xd'));var Papa=require(_0x091d('0xe'));var Redis=require(_0x091d('0xf'));var authService=require(_0x091d('0x10'));var qs=require(_0x091d('0x11'));var as=require(_0x091d('0x12'));var hardwareService=require(_0x091d('0x13'));var logger=require(_0x091d('0x14'))(_0x091d('0x15'));var utils=require(_0x091d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x091d('0x17'))['db'];function respondWithStatusCode(_0x46db3f,_0x590e67){_0x590e67=_0x590e67||0xcc;return function(_0x35da1d){if(_0x35da1d){return _0x46db3f[_0x091d('0x18')](_0x590e67);}return _0x46db3f[_0x091d('0x19')](_0x590e67)[_0x091d('0x1a')]();};}function respondWithResult(_0x5f2e34,_0x5b3319){_0x5b3319=_0x5b3319||0xc8;return function(_0xe5c780){if(_0xe5c780){return _0x5f2e34[_0x091d('0x19')](_0x5b3319)[_0x091d('0x1b')](_0xe5c780);}};}function respondWithFilteredResult(_0x5b07c1,_0x5ea47){return function(_0x4151d3){if(_0x4151d3){var _0x5b4a9e=typeof _0x5ea47[_0x091d('0x1c')]==='undefined'&&typeof _0x5ea47[_0x091d('0x1d')]===_0x091d('0x1e');var _0x15818e=_0x4151d3[_0x091d('0x1f')];var _0x2b513e=_0x5b4a9e?0x0:_0x5ea47[_0x091d('0x1c')];var _0x41767d=_0x5b4a9e?_0x4151d3[_0x091d('0x1f')]:_0x5ea47['offset']+_0x5ea47[_0x091d('0x1d')];var _0x35e414;if(_0x41767d>=_0x15818e){_0x41767d=_0x15818e;_0x35e414=0xc8;}else{_0x35e414=0xce;}_0x5b07c1[_0x091d('0x19')](_0x35e414);return _0x5b07c1[_0x091d('0x20')](_0x091d('0x21'),_0x2b513e+'-'+_0x41767d+'/'+_0x15818e)[_0x091d('0x1b')](_0x4151d3);}return null;};}function patchUpdates(_0x393029){return function(_0x51b270){try{jsonpatch[_0x091d('0x22')](_0x51b270,_0x393029,!![]);}catch(_0x40d615){return BPromise[_0x091d('0x23')](_0x40d615);}return _0x51b270['save']();};}function saveUpdates(_0x1e0557,_0x125573){return function(_0x589149){if(_0x589149){return _0x589149[_0x091d('0x24')](_0x1e0557)[_0x091d('0x25')](function(_0xfe527d){return _0xfe527d;});}return null;};}function removeEntity(_0x131aff,_0x516be9){return function(_0x5c5eea){if(_0x5c5eea){return _0x5c5eea['destroy']()['then'](function(){_0x131aff[_0x091d('0x19')](0xcc)[_0x091d('0x1a')]();});}};}function handleEntityNotFound(_0x38d880,_0x4338ca){return function(_0x5e3999){if(!_0x5e3999){_0x38d880[_0x091d('0x18')](0x194);}return _0x5e3999;};}function handleError(_0x45701a,_0x377b19){_0x377b19=_0x377b19||0x1f4;return function(_0xa16ff4){logger[_0x091d('0x26')](_0xa16ff4[_0x091d('0x27')]);if(_0xa16ff4['name']){delete _0xa16ff4['name'];}_0x45701a[_0x091d('0x19')](_0x377b19)['send'](_0xa16ff4);};}exports[_0x091d('0x28')]=function(_0x47f23c,_0x2abc9a){var _0x310608={},_0x5894a5={},_0x1c6c1e={'count':0x0,'rows':[]};var _0x2d0f2=_[_0x091d('0x29')](db[_0x091d('0x2a')][_0x091d('0x2b')],function(_0x4f77c3){return{'name':_0x4f77c3['fieldName'],'type':_0x4f77c3[_0x091d('0x2c')][_0x091d('0x2d')]};});_0x5894a5['model']=_[_0x091d('0x29')](_0x2d0f2,'name');_0x5894a5['query']=_[_0x091d('0x2e')](_0x47f23c[_0x091d('0x2f')]);_0x5894a5[_0x091d('0x30')]=_[_0x091d('0x31')](_0x5894a5[_0x091d('0x32')],_0x5894a5[_0x091d('0x2f')]);_0x310608[_0x091d('0x33')]=_[_0x091d('0x31')](_0x5894a5['model'],qs['fields'](_0x47f23c[_0x091d('0x2f')]['fields']));_0x310608[_0x091d('0x33')]=_0x310608[_0x091d('0x33')][_0x091d('0x34')]?_0x310608[_0x091d('0x33')]:_0x5894a5['model'];if(!_0x47f23c[_0x091d('0x2f')][_0x091d('0x35')](_0x091d('0x36'))){_0x310608[_0x091d('0x1d')]=qs[_0x091d('0x1d')](_0x47f23c[_0x091d('0x2f')][_0x091d('0x1d')]);_0x310608['offset']=qs[_0x091d('0x1c')](_0x47f23c[_0x091d('0x2f')]['offset']);}_0x310608[_0x091d('0x37')]=qs[_0x091d('0x38')](_0x47f23c[_0x091d('0x2f')][_0x091d('0x38')]);_0x310608[_0x091d('0x39')]=qs[_0x091d('0x30')](_[_0x091d('0x3a')](_0x47f23c[_0x091d('0x2f')],_0x5894a5[_0x091d('0x30')]),_0x2d0f2);if(_0x47f23c[_0x091d('0x2f')][_0x091d('0x3b')]){_0x310608[_0x091d('0x39')]=_['merge'](_0x310608[_0x091d('0x39')],{'$or':_[_0x091d('0x29')](_0x2d0f2,function(_0x4c69a6){if(_0x4c69a6[_0x091d('0x2c')]!==_0x091d('0x3c')){var _0x109adc={};_0x109adc[_0x4c69a6[_0x091d('0x3d')]]={'$like':'%'+_0x47f23c['query'][_0x091d('0x3b')]+'%'};return _0x109adc;}})});}_0x310608=_['merge']({},_0x310608,_0x47f23c[_0x091d('0x3e')]);var _0x10a12a={'where':_0x310608[_0x091d('0x39')]};return db[_0x091d('0x2a')]['count'](_0x10a12a)[_0x091d('0x25')](function(_0x52e497){_0x1c6c1e[_0x091d('0x1f')]=_0x52e497;if(_0x47f23c['query'][_0x091d('0x3f')]){_0x310608['include']=[{'all':!![]}];}return db['ServicenowField'][_0x091d('0x40')](_0x310608);})['then'](function(_0x56ca0a){_0x1c6c1e[_0x091d('0x41')]=_0x56ca0a;return _0x1c6c1e;})[_0x091d('0x25')](respondWithFilteredResult(_0x2abc9a,_0x310608))['catch'](handleError(_0x2abc9a,null));};exports[_0x091d('0x42')]=function(_0x1a2f7f,_0x7ca790){var _0x342487={'raw':!![],'where':{'id':_0x1a2f7f[_0x091d('0x43')]['id']}},_0x40640a={};_0x40640a[_0x091d('0x32')]=_[_0x091d('0x2e')](db['ServicenowField'][_0x091d('0x2b')]);_0x40640a['query']=_[_0x091d('0x2e')](_0x1a2f7f[_0x091d('0x2f')]);_0x40640a[_0x091d('0x30')]=_['intersection'](_0x40640a[_0x091d('0x32')],_0x40640a['query']);_0x342487['attributes']=_[_0x091d('0x31')](_0x40640a['model'],qs[_0x091d('0x44')](_0x1a2f7f['query']['fields']));_0x342487[_0x091d('0x33')]=_0x342487[_0x091d('0x33')][_0x091d('0x34')]?_0x342487['attributes']:_0x40640a[_0x091d('0x32')];if(_0x1a2f7f[_0x091d('0x2f')][_0x091d('0x3f')]){_0x342487[_0x091d('0x45')]=[{'all':!![]}];}_0x342487=_[_0x091d('0x46')]({},_0x342487,_0x1a2f7f[_0x091d('0x3e')]);return db[_0x091d('0x2a')][_0x091d('0x47')](_0x342487)[_0x091d('0x25')](handleEntityNotFound(_0x7ca790,null))[_0x091d('0x25')](respondWithResult(_0x7ca790,null))[_0x091d('0x48')](handleError(_0x7ca790,null));};exports[_0x091d('0x49')]=function(_0x14c952,_0x49a753){return db[_0x091d('0x2a')][_0x091d('0x49')](_0x14c952['body'],{})['then'](respondWithResult(_0x49a753,0xc9))[_0x091d('0x48')](handleError(_0x49a753,null));};exports[_0x091d('0x24')]=function(_0x21a334,_0x57e804){if(_0x21a334[_0x091d('0x4a')]['id']){delete _0x21a334[_0x091d('0x4a')]['id'];}return db[_0x091d('0x2a')][_0x091d('0x47')]({'where':{'id':_0x21a334[_0x091d('0x43')]['id']}})[_0x091d('0x25')](handleEntityNotFound(_0x57e804,null))[_0x091d('0x25')](saveUpdates(_0x21a334[_0x091d('0x4a')],null))[_0x091d('0x25')](respondWithResult(_0x57e804,null))[_0x091d('0x48')](handleError(_0x57e804,null));};exports[_0x091d('0x4b')]=function(_0x403870,_0x16c93d){return db[_0x091d('0x2a')][_0x091d('0x47')]({'where':{'id':_0x403870[_0x091d('0x43')]['id']}})[_0x091d('0x25')](handleEntityNotFound(_0x16c93d,null))[_0x091d('0x25')](removeEntity(_0x16c93d,null))[_0x091d('0x48')](handleError(_0x16c93d,null));}; \ No newline at end of file +var _0x62c5=['request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','filter','VIRTUAL','merge','options','include','ServicenowField','findAll','rows','show','rawAttributes','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch'];(function(_0x581e2e,_0x2ebdd3){var _0x28d613=function(_0x4c56a4){while(--_0x4c56a4){_0x581e2e['push'](_0x581e2e['shift']());}};_0x28d613(++_0x2ebdd3);}(_0x62c5,0x125));var _0x562c=function(_0x2151c7,_0x13f5fb){_0x2151c7=_0x2151c7-0x0;var _0x1154ac=_0x62c5[_0x2151c7];return _0x1154ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x562c('0x0'));var zipdir=require(_0x562c('0x1'));var jsonpatch=require(_0x562c('0x2'));var rp=require(_0x562c('0x3'));var moment=require('moment');var BPromise=require(_0x562c('0x4'));var Mustache=require('mustache');var util=require(_0x562c('0x5'));var path=require(_0x562c('0x6'));var sox=require(_0x562c('0x7'));var csv=require(_0x562c('0x8'));var ejs=require(_0x562c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x562c('0xa'));var squel=require(_0x562c('0xb'));var crypto=require(_0x562c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x562c('0x8'));var querystring=require(_0x562c('0xd'));var Papa=require(_0x562c('0xe'));var Redis=require(_0x562c('0xf'));var authService=require(_0x562c('0x10'));var qs=require(_0x562c('0x11'));var as=require(_0x562c('0x12'));var hardwareService=require(_0x562c('0x13'));var logger=require(_0x562c('0x14'))(_0x562c('0x15'));var utils=require(_0x562c('0x16'));var config=require(_0x562c('0x17'));var licenseUtil=require(_0x562c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbbf3ed,_0x47e2d3){_0x47e2d3=_0x47e2d3||0xcc;return function(_0x56bea9){if(_0x56bea9){return _0xbbf3ed[_0x562c('0x19')](_0x47e2d3);}return _0xbbf3ed['status'](_0x47e2d3)[_0x562c('0x1a')]();};}function respondWithResult(_0x18ac02,_0x12d12b){_0x12d12b=_0x12d12b||0xc8;return function(_0x115a98){if(_0x115a98){return _0x18ac02[_0x562c('0x1b')](_0x12d12b)[_0x562c('0x1c')](_0x115a98);}};}function respondWithFilteredResult(_0x4b7117,_0x41b125){return function(_0x175572){if(_0x175572){var _0x23e859=typeof _0x41b125[_0x562c('0x1d')]==='undefined'&&typeof _0x41b125[_0x562c('0x1e')]===_0x562c('0x1f');var _0x259282=_0x175572[_0x562c('0x20')];var _0x47b1a7=_0x23e859?0x0:_0x41b125[_0x562c('0x1d')];var _0x4686b3=_0x23e859?_0x175572['count']:_0x41b125[_0x562c('0x1d')]+_0x41b125[_0x562c('0x1e')];var _0x59bcc6;if(_0x4686b3>=_0x259282){_0x4686b3=_0x259282;_0x59bcc6=0xc8;}else{_0x59bcc6=0xce;}_0x4b7117['status'](_0x59bcc6);return _0x4b7117['set'](_0x562c('0x21'),_0x47b1a7+'-'+_0x4686b3+'/'+_0x259282)[_0x562c('0x1c')](_0x175572);}return null;};}function patchUpdates(_0x3be56d){return function(_0x17d22c){try{jsonpatch[_0x562c('0x22')](_0x17d22c,_0x3be56d,!![]);}catch(_0x4a82bd){return BPromise['reject'](_0x4a82bd);}return _0x17d22c['save']();};}function saveUpdates(_0x1d7a14,_0x576fde){return function(_0x101f32){if(_0x101f32){return _0x101f32[_0x562c('0x23')](_0x1d7a14)['then'](function(_0x305acf){return _0x305acf;});}return null;};}function removeEntity(_0x572077,_0x7631fb){return function(_0x333b98){if(_0x333b98){return _0x333b98[_0x562c('0x24')]()[_0x562c('0x25')](function(){_0x572077['status'](0xcc)[_0x562c('0x1a')]();});}};}function handleEntityNotFound(_0x39b76b,_0x30527d){return function(_0x594a43){if(!_0x594a43){_0x39b76b[_0x562c('0x19')](0x194);}return _0x594a43;};}function handleError(_0xa7a1de,_0x41f84b){_0x41f84b=_0x41f84b||0x1f4;return function(_0x357041){logger[_0x562c('0x26')](_0x357041[_0x562c('0x27')]);if(_0x357041[_0x562c('0x28')]){delete _0x357041[_0x562c('0x28')];}_0xa7a1de[_0x562c('0x1b')](_0x41f84b)[_0x562c('0x29')](_0x357041);};}exports[_0x562c('0x2a')]=function(_0x494e5b,_0xc0369c){var _0x4f1cf2={},_0x54a087={},_0x43db5d={'count':0x0,'rows':[]};var _0x24da74=_[_0x562c('0x2b')](db['ServicenowField']['rawAttributes'],function(_0x3d54fc){return{'name':_0x3d54fc[_0x562c('0x2c')],'type':_0x3d54fc[_0x562c('0x2d')][_0x562c('0x2e')]};});_0x54a087[_0x562c('0x2f')]=_[_0x562c('0x2b')](_0x24da74,_0x562c('0x28'));_0x54a087[_0x562c('0x30')]=_[_0x562c('0x31')](_0x494e5b[_0x562c('0x30')]);_0x54a087['filters']=_['intersection'](_0x54a087[_0x562c('0x2f')],_0x54a087[_0x562c('0x30')]);_0x4f1cf2[_0x562c('0x32')]=_[_0x562c('0x33')](_0x54a087[_0x562c('0x2f')],qs[_0x562c('0x34')](_0x494e5b['query'][_0x562c('0x34')]));_0x4f1cf2[_0x562c('0x32')]=_0x4f1cf2['attributes'][_0x562c('0x35')]?_0x4f1cf2[_0x562c('0x32')]:_0x54a087[_0x562c('0x2f')];if(!_0x494e5b[_0x562c('0x30')][_0x562c('0x36')]('nolimit')){_0x4f1cf2[_0x562c('0x1e')]=qs[_0x562c('0x1e')](_0x494e5b[_0x562c('0x30')][_0x562c('0x1e')]);_0x4f1cf2['offset']=qs[_0x562c('0x1d')](_0x494e5b[_0x562c('0x30')][_0x562c('0x1d')]);}_0x4f1cf2['order']=qs[_0x562c('0x37')](_0x494e5b[_0x562c('0x30')][_0x562c('0x37')]);_0x4f1cf2[_0x562c('0x38')]=qs[_0x562c('0x39')](_['pick'](_0x494e5b[_0x562c('0x30')],_0x54a087[_0x562c('0x39')]),_0x24da74);if(_0x494e5b[_0x562c('0x30')][_0x562c('0x3a')]){_0x4f1cf2[_0x562c('0x38')]=_['merge'](_0x4f1cf2[_0x562c('0x38')],{'$or':_[_0x562c('0x2b')](_0x24da74,function(_0x5ccc3d){if(_0x5ccc3d[_0x562c('0x2d')]!==_0x562c('0x3b')){var _0x17cc9a={};_0x17cc9a[_0x5ccc3d[_0x562c('0x28')]]={'$like':'%'+_0x494e5b[_0x562c('0x30')][_0x562c('0x3a')]+'%'};return _0x17cc9a;}})});}_0x4f1cf2=_[_0x562c('0x3c')]({},_0x4f1cf2,_0x494e5b[_0x562c('0x3d')]);var _0x2e76d1={'where':_0x4f1cf2[_0x562c('0x38')]};return db['ServicenowField'][_0x562c('0x20')](_0x2e76d1)[_0x562c('0x25')](function(_0x5da0f2){_0x43db5d[_0x562c('0x20')]=_0x5da0f2;if(_0x494e5b[_0x562c('0x30')]['includeAll']){_0x4f1cf2[_0x562c('0x3e')]=[{'all':!![]}];}return db[_0x562c('0x3f')][_0x562c('0x40')](_0x4f1cf2);})[_0x562c('0x25')](function(_0x12dae7){_0x43db5d[_0x562c('0x41')]=_0x12dae7;return _0x43db5d;})[_0x562c('0x25')](respondWithFilteredResult(_0xc0369c,_0x4f1cf2))['catch'](handleError(_0xc0369c,null));};exports[_0x562c('0x42')]=function(_0x384e01,_0x3cc45f){var _0x4e567d={'raw':!![],'where':{'id':_0x384e01['params']['id']}},_0x59422f={};_0x59422f[_0x562c('0x2f')]=_[_0x562c('0x31')](db['ServicenowField'][_0x562c('0x43')]);_0x59422f[_0x562c('0x30')]=_[_0x562c('0x31')](_0x384e01['query']);_0x59422f[_0x562c('0x39')]=_[_0x562c('0x33')](_0x59422f['model'],_0x59422f[_0x562c('0x30')]);_0x4e567d[_0x562c('0x32')]=_[_0x562c('0x33')](_0x59422f['model'],qs[_0x562c('0x34')](_0x384e01[_0x562c('0x30')][_0x562c('0x34')]));_0x4e567d[_0x562c('0x32')]=_0x4e567d[_0x562c('0x32')]['length']?_0x4e567d['attributes']:_0x59422f[_0x562c('0x2f')];if(_0x384e01[_0x562c('0x30')][_0x562c('0x44')]){_0x4e567d['include']=[{'all':!![]}];}_0x4e567d=_[_0x562c('0x3c')]({},_0x4e567d,_0x384e01[_0x562c('0x3d')]);return db[_0x562c('0x3f')][_0x562c('0x45')](_0x4e567d)['then'](handleEntityNotFound(_0x3cc45f,null))[_0x562c('0x25')](respondWithResult(_0x3cc45f,null))[_0x562c('0x46')](handleError(_0x3cc45f,null));};exports[_0x562c('0x47')]=function(_0xc475e,_0x2eb99c){return db[_0x562c('0x3f')][_0x562c('0x47')](_0xc475e['body'],{})[_0x562c('0x25')](respondWithResult(_0x2eb99c,0xc9))['catch'](handleError(_0x2eb99c,null));};exports[_0x562c('0x23')]=function(_0x1ced53,_0x3c3355){if(_0x1ced53[_0x562c('0x48')]['id']){delete _0x1ced53['body']['id'];}return db[_0x562c('0x3f')]['find']({'where':{'id':_0x1ced53[_0x562c('0x49')]['id']}})[_0x562c('0x25')](handleEntityNotFound(_0x3c3355,null))[_0x562c('0x25')](saveUpdates(_0x1ced53[_0x562c('0x48')],null))['then'](respondWithResult(_0x3c3355,null))['catch'](handleError(_0x3c3355,null));};exports[_0x562c('0x24')]=function(_0x4c0e34,_0x24bd16){return db[_0x562c('0x3f')][_0x562c('0x45')]({'where':{'id':_0x4c0e34[_0x562c('0x49')]['id']}})[_0x562c('0x25')](handleEntityNotFound(_0x24bd16,null))['then'](removeEntity(_0x24bd16,null))[_0x562c('0x46')](handleError(_0x24bd16,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 18ef8d6..779dc54 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 _0xd157=['define','ServicenowField','int_servicenow_fields','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd157,0x138));var _0x7d15=function(_0xe3171a,_0x201884){_0xe3171a=_0xe3171a-0x0;var _0x14540b=_0xd157[_0xe3171a];return _0x14540b;};'use strict';var _=require(_0x7d15('0x0'));var util=require('util');var logger=require(_0x7d15('0x1'))(_0x7d15('0x2'));var moment=require(_0x7d15('0x3'));var BPromise=require(_0x7d15('0x4'));var rp=require(_0x7d15('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d15('0x6'));var config=require(_0x7d15('0x7'));var attributes=require(_0x7d15('0x8'));module[_0x7d15('0x9')]=function(_0xf4bd30,_0x62123e){return _0xf4bd30[_0x7d15('0xa')](_0x7d15('0xb'),attributes,{'tableName':_0x7d15('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x7d15('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf698=['path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf698,0x14b));var _0x8f69=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xf698[_0x4b174a];return _0x3cd7bf;};'use strict';var _=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var logger=require(_0x8f69('0x2'))('api');var moment=require(_0x8f69('0x3'));var BPromise=require(_0x8f69('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f69('0x5'));var rimraf=require(_0x8f69('0x6'));var config=require(_0x8f69('0x7'));var attributes=require(_0x8f69('0x8'));module[_0x8f69('0x9')]=function(_0x196200,_0x2039b3){return _0x196200[_0x8f69('0xa')](_0x8f69('0xb'),attributes,{'tableName':_0x8f69('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x8f69('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index f1489b7..499d833 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac4a,0x13f));var _0xaac4=function(_0xd8de,_0x33ce05){_0xd8de=_0xd8de-0x0;var _0x59d32a=_0xac4a[_0xd8de];return _0x59d32a;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x13cd14,_0x31de06){var _0xf8a723=function(_0x2c72ba){while(--_0x2c72ba){_0x13cd14['push'](_0x13cd14['shift']());}};_0xf8a723(++_0x31de06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index acb07e7..66588fc 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(_0x23b6ef,_0x57db42){var _0xba36cb=function(_0x55c4ec){while(--_0x55c4ec){_0x23b6ef['push'](_0x23b6ef['shift']());}};_0xba36cb(++_0x57db42);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x9ce71a,_0x389acc){var _0x5a705c=function(_0x27221d){while(--_0x27221d){_0x9ce71a['push'](_0x9ce71a['shift']());}};_0x5a705c(++_0x389acc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 95edcec..89cd1d5 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(_0x4e0186,_0x8fbe95){var _0x425f05=function(_0x5cd86c){while(--_0x5cd86c){_0x4e0186['push'](_0x4e0186['shift']());}};_0x425f05(++_0x8fbe95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x81e55f,_0x4d15e6){var _0x4933bb=function(_0x3ed703){while(--_0x3ed703){_0x81e55f['push'](_0x81e55f['shift']());}};_0x4933bb(++_0x4d15e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 600da55..9db0a24 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 _0x1803=['SugarcrmAccount','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','keys','options','create','body','find','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','remove','includes','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map'];(function(_0x25a381,_0x2f2014){var _0x43b715=function(_0x57870a){while(--_0x57870a){_0x25a381['push'](_0x25a381['shift']());}};_0x43b715(++_0x2f2014);}(_0x1803,0x1be));var _0x3180=function(_0x146ebe,_0x34e95c){_0x146ebe=_0x146ebe-0x0;var _0xe9e128=_0x1803[_0x146ebe];return _0xe9e128;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3180('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3180('0x1'));var rp=require(_0x3180('0x2'));var moment=require(_0x3180('0x3'));var BPromise=require(_0x3180('0x4'));var Mustache=require(_0x3180('0x5'));var util=require(_0x3180('0x6'));var path=require(_0x3180('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3180('0x8'));var fs=require('fs');var fs_extra=require(_0x3180('0x9'));var _=require(_0x3180('0xa'));var squel=require('squel');var crypto=require(_0x3180('0xb'));var jsforce=require(_0x3180('0xc'));var deskjs=require(_0x3180('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3180('0xe'));var Papa=require(_0x3180('0xf'));var Redis=require(_0x3180('0x10'));var authService=require(_0x3180('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3180('0x12'));var hardwareService=require(_0x3180('0x13'));var logger=require(_0x3180('0x14'))(_0x3180('0x15'));var utils=require(_0x3180('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3180('0x17'));var db=require(_0x3180('0x18'))['db'];var integrations=require(_0x3180('0x19'));function respondWithStatusCode(_0x340c59,_0x4e9def){_0x4e9def=_0x4e9def||0xcc;return function(_0x35f090){if(_0x35f090){return _0x340c59[_0x3180('0x1a')](_0x4e9def);}return _0x340c59['status'](_0x4e9def)[_0x3180('0x1b')]();};}function respondWithResult(_0x451a10,_0xab0021){_0xab0021=_0xab0021||0xc8;return function(_0x40a34f){if(_0x40a34f){return _0x451a10[_0x3180('0x1c')](_0xab0021)[_0x3180('0x1d')](_0x40a34f);}};}function respondWithFilteredResult(_0x24a34c,_0x253f69){return function(_0x48f290){if(_0x48f290){var _0x4f7305=typeof _0x253f69['offset']===_0x3180('0x1e')&&typeof _0x253f69[_0x3180('0x1f')]==='undefined';var _0x593e87=_0x48f290['count'];var _0x68eff2=_0x4f7305?0x0:_0x253f69[_0x3180('0x20')];var _0x570d74=_0x4f7305?_0x48f290[_0x3180('0x21')]:_0x253f69[_0x3180('0x20')]+_0x253f69[_0x3180('0x1f')];var _0x5ab197;if(_0x570d74>=_0x593e87){_0x570d74=_0x593e87;_0x5ab197=0xc8;}else{_0x5ab197=0xce;}_0x24a34c[_0x3180('0x1c')](_0x5ab197);return _0x24a34c[_0x3180('0x22')](_0x3180('0x23'),_0x68eff2+'-'+_0x570d74+'/'+_0x593e87)[_0x3180('0x1d')](_0x48f290);}return null;};}function patchUpdates(_0x3f121c){return function(_0x5aadfd){try{jsonpatch[_0x3180('0x24')](_0x5aadfd,_0x3f121c,!![]);}catch(_0x90a4fb){return BPromise[_0x3180('0x25')](_0x90a4fb);}return _0x5aadfd[_0x3180('0x26')]();};}function saveUpdates(_0x13f4f6,_0x167c9a){return function(_0x93a48f){if(_0x93a48f){return _0x93a48f[_0x3180('0x27')](_0x13f4f6)[_0x3180('0x28')](function(_0x19d815){return _0x19d815;});}return null;};}function removeEntity(_0x3022d5,_0xd66c21){return function(_0x520659){if(_0x520659){return _0x520659[_0x3180('0x29')]()[_0x3180('0x28')](function(){_0x3022d5[_0x3180('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ddfa7,_0xd2467d){return function(_0x4d5475){if(!_0x4d5475){_0x3ddfa7[_0x3180('0x1a')](0x194);}return _0x4d5475;};}function handleError(_0x1bd8f4,_0x399c06){_0x399c06=_0x399c06||0x1f4;return function(_0x4982ca){logger['error'](_0x4982ca['stack']);if(_0x4982ca[_0x3180('0x2a')]){delete _0x4982ca['name'];}_0x1bd8f4[_0x3180('0x1c')](_0x399c06)[_0x3180('0x2b')](_0x4982ca);};}exports[_0x3180('0x2c')]=function(_0x50297a,_0x199b3e){var _0x232e81={},_0x1ead13={},_0x2fda94={'count':0x0,'rows':[]};var _0x2ece52=_[_0x3180('0x2d')](db[_0x3180('0x2e')][_0x3180('0x2f')],function(_0x42944f){return{'name':_0x42944f[_0x3180('0x30')],'type':_0x42944f[_0x3180('0x31')]['key']};});_0x1ead13[_0x3180('0x32')]=_[_0x3180('0x2d')](_0x2ece52,_0x3180('0x2a'));_0x1ead13[_0x3180('0x33')]=_['keys'](_0x50297a[_0x3180('0x33')]);_0x1ead13[_0x3180('0x34')]=_['intersection'](_0x1ead13[_0x3180('0x32')],_0x1ead13[_0x3180('0x33')]);_0x232e81[_0x3180('0x35')]=_[_0x3180('0x36')](_0x1ead13[_0x3180('0x32')],qs[_0x3180('0x37')](_0x50297a[_0x3180('0x33')][_0x3180('0x37')]));_0x232e81[_0x3180('0x35')]=_0x232e81['attributes'][_0x3180('0x38')]?_0x232e81['attributes']:_0x1ead13['model'];if(!_0x50297a['query'][_0x3180('0x39')](_0x3180('0x3a'))){_0x232e81[_0x3180('0x1f')]=qs[_0x3180('0x1f')](_0x50297a['query'][_0x3180('0x1f')]);_0x232e81[_0x3180('0x20')]=qs[_0x3180('0x20')](_0x50297a[_0x3180('0x33')][_0x3180('0x20')]);}_0x232e81[_0x3180('0x3b')]=qs[_0x3180('0x3c')](_0x50297a[_0x3180('0x33')][_0x3180('0x3c')]);_0x232e81['where']=qs[_0x3180('0x34')](_[_0x3180('0x3d')](_0x50297a[_0x3180('0x33')],_0x1ead13[_0x3180('0x34')]),_0x2ece52);if(_0x50297a[_0x3180('0x33')][_0x3180('0x3e')]){_0x232e81[_0x3180('0x3f')]=_[_0x3180('0x40')](_0x232e81[_0x3180('0x3f')],{'$or':_[_0x3180('0x2d')](_0x2ece52,function(_0xf2e8ee){if(_0xf2e8ee[_0x3180('0x31')]!=='VIRTUAL'){var _0x2169a4={};_0x2169a4[_0xf2e8ee[_0x3180('0x2a')]]={'$like':'%'+_0x50297a[_0x3180('0x33')][_0x3180('0x3e')]+'%'};return _0x2169a4;}})});}_0x232e81=_[_0x3180('0x40')]({},_0x232e81,_0x50297a['options']);var _0x10c92a={'where':_0x232e81[_0x3180('0x3f')]};return db[_0x3180('0x2e')]['count'](_0x10c92a)['then'](function(_0x2adec3){_0x2fda94[_0x3180('0x21')]=_0x2adec3;if(_0x50297a['query'][_0x3180('0x41')]){_0x232e81[_0x3180('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x232e81);})['then'](function(_0x103b1d){_0x2fda94[_0x3180('0x43')]=_0x103b1d;return _0x2fda94;})[_0x3180('0x28')](respondWithFilteredResult(_0x199b3e,_0x232e81))[_0x3180('0x44')](handleError(_0x199b3e,null));};exports[_0x3180('0x45')]=function(_0x5bcb08,_0x4df085){var _0x31ec90={'raw':![],'where':{'id':_0x5bcb08[_0x3180('0x46')]['id']}},_0x30cc67={};_0x30cc67[_0x3180('0x32')]=_[_0x3180('0x47')](db[_0x3180('0x2e')]['rawAttributes']);_0x30cc67[_0x3180('0x33')]=_['keys'](_0x5bcb08[_0x3180('0x33')]);_0x30cc67[_0x3180('0x34')]=_[_0x3180('0x36')](_0x30cc67[_0x3180('0x32')],_0x30cc67[_0x3180('0x33')]);_0x31ec90[_0x3180('0x35')]=_[_0x3180('0x36')](_0x30cc67[_0x3180('0x32')],qs[_0x3180('0x37')](_0x5bcb08['query']['fields']));_0x31ec90[_0x3180('0x35')]=_0x31ec90[_0x3180('0x35')][_0x3180('0x38')]?_0x31ec90[_0x3180('0x35')]:_0x30cc67['model'];if(_0x5bcb08[_0x3180('0x33')][_0x3180('0x41')]){_0x31ec90['include']=[{'all':!![]}];}_0x31ec90=_[_0x3180('0x40')]({},_0x31ec90,_0x5bcb08[_0x3180('0x48')]);return db['SugarcrmAccount']['find'](_0x31ec90)['then'](handleEntityNotFound(_0x4df085,null))[_0x3180('0x28')](respondWithResult(_0x4df085,null))[_0x3180('0x44')](handleError(_0x4df085,null));};exports[_0x3180('0x49')]=function(_0x21289f,_0xc7046c){return db['SugarcrmAccount'][_0x3180('0x49')](_0x21289f[_0x3180('0x4a')],{})[_0x3180('0x28')](respondWithResult(_0xc7046c,0xc9))[_0x3180('0x44')](handleError(_0xc7046c,null));};exports['update']=function(_0x17d2bf,_0x3d8b80){if(_0x17d2bf[_0x3180('0x4a')]['id']){delete _0x17d2bf[_0x3180('0x4a')]['id'];}return db[_0x3180('0x2e')][_0x3180('0x4b')]({'where':{'id':_0x17d2bf[_0x3180('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d8b80,null))[_0x3180('0x28')](saveUpdates(_0x17d2bf[_0x3180('0x4a')],null))[_0x3180('0x28')](respondWithResult(_0x3d8b80,null))[_0x3180('0x44')](handleError(_0x3d8b80,null));};exports[_0x3180('0x29')]=function(_0x1d9bae,_0xbbaa57){return db[_0x3180('0x2e')]['find']({'where':{'id':_0x1d9bae[_0x3180('0x46')]['id']}})['then'](handleEntityNotFound(_0xbbaa57,null))[_0x3180('0x28')](removeEntity(_0xbbaa57,null))[_0x3180('0x44')](handleError(_0xbbaa57,null));};exports[_0x3180('0x4c')]=function(_0x31d4f9,_0x2fcc15,_0x106de5){var _0x57b159={};var _0x3d63a7={};var _0x3cac3e;var _0xd46097;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x31d4f9[_0x3180('0x46')]['id']}})[_0x3180('0x28')](handleEntityNotFound(_0x2fcc15,null))[_0x3180('0x28')](function(_0x30b196){if(_0x30b196){_0x3cac3e=_0x30b196;_0x3d63a7['model']=_[_0x3180('0x47')](db[_0x3180('0x4d')][_0x3180('0x2f')]);_0x3d63a7[_0x3180('0x33')]=_[_0x3180('0x47')](_0x31d4f9[_0x3180('0x33')]);_0x3d63a7[_0x3180('0x34')]=_[_0x3180('0x36')](_0x3d63a7['model'],_0x3d63a7['query']);_0x57b159[_0x3180('0x35')]=_[_0x3180('0x36')](_0x3d63a7['model'],qs[_0x3180('0x37')](_0x31d4f9[_0x3180('0x33')][_0x3180('0x37')]));_0x57b159['attributes']=_0x57b159[_0x3180('0x35')][_0x3180('0x38')]?_0x57b159['attributes']:_0x3d63a7[_0x3180('0x32')];_0x57b159[_0x3180('0x3b')]=qs[_0x3180('0x3c')](_0x31d4f9[_0x3180('0x33')][_0x3180('0x3c')]);_0x57b159[_0x3180('0x3f')]=qs[_0x3180('0x34')](_[_0x3180('0x3d')](_0x31d4f9[_0x3180('0x33')],_0x3d63a7[_0x3180('0x34')]));if(_0x31d4f9[_0x3180('0x33')]['filter']){_0x57b159[_0x3180('0x3f')]=_[_0x3180('0x40')](_0x57b159[_0x3180('0x3f')],{'$or':_['map'](_0x57b159[_0x3180('0x35')],function(_0x225b9c){var _0x5939ac={};_0x5939ac[_0x225b9c]={'$like':'%'+_0x31d4f9['query'][_0x3180('0x3e')]+'%'};return _0x5939ac;})});}_0x57b159=_['merge']({},_0x57b159,_0x31d4f9[_0x3180('0x48')]);return _0x3cac3e[_0x3180('0x4c')](_0x57b159);}})[_0x3180('0x28')](function(_0x121db9){if(_0x121db9){_0xd46097=_0x121db9[_0x3180('0x38')];if(!_0x31d4f9[_0x3180('0x33')]['hasOwnProperty'](_0x3180('0x3a'))){_0x57b159[_0x3180('0x1f')]=qs[_0x3180('0x1f')](_0x31d4f9[_0x3180('0x33')][_0x3180('0x1f')]);_0x57b159[_0x3180('0x20')]=qs[_0x3180('0x20')](_0x31d4f9['query'][_0x3180('0x20')]);}return _0x3cac3e['getConfigurations'](_0x57b159);}})['then'](function(_0x541055){if(_0x541055){return _0x541055?{'count':_0xd46097,'rows':_0x541055}:null;}})['then'](respondWithResult(_0x2fcc15,null))[_0x3180('0x44')](handleError(_0x2fcc15,null));};exports[_0x3180('0x4e')]=function(_0xa23f95,_0x4a8e8a,_0x14d2ab){if(_0xa23f95[_0x3180('0x4a')]['id']){delete _0xa23f95[_0x3180('0x4a')]['id'];}return db[_0x3180('0x2e')][_0x3180('0x4f')]({'where':{'id':_0xa23f95['params']['id']}})[_0x3180('0x28')](handleEntityNotFound(_0x4a8e8a,null))[_0x3180('0x28')](function(_0x22fae6){if(_0x22fae6){_0xa23f95[_0x3180('0x4a')][_0x3180('0x50')]=_0x22fae6['id'];_0xa23f95[_0x3180('0x4a')][_0x3180('0x51')]=integrations[_0x3180('0x52')](_0xa23f95[_0x3180('0x4a')][_0x3180('0x53')],_0xa23f95['body'][_0x3180('0x31')]);_0xa23f95[_0x3180('0x4a')]['Descriptions']=integrations[_0x3180('0x54')](_0xa23f95[_0x3180('0x4a')][_0x3180('0x53')],_0xa23f95[_0x3180('0x4a')]['type']);return db[_0x3180('0x4d')]['create'](_0xa23f95['body'],{'include':[{'model':db[_0x3180('0x55')],'as':'Subjects'},{'model':db[_0x3180('0x55')],'as':_0x3180('0x56')}]});}return null;})['then'](respondWithResult(_0x4a8e8a,null))[_0x3180('0x44')](handleError(_0x4a8e8a,null));};exports[_0x3180('0x57')]=function(_0x1a4f31,_0x7ae680,_0x16d825){var _0x108844='';var _0x382701=['id',_0x3180('0x2a'),_0x3180('0x58'),_0x3180('0x59'),_0x3180('0x5a'),'date_start',_0x3180('0x5b'),'duration_minutes',_0x3180('0x5c'),'parent_type',_0x3180('0x5d'),_0x3180('0x5e')];return db[_0x3180('0x2e')][_0x3180('0x4f')]({'where':{'id':_0x1a4f31[_0x3180('0x46')]['id']},'attributes':['id',_0x3180('0x5f'),_0x3180('0x60'),'remoteUri']})['then'](handleEntityNotFound(_0x7ae680,null))[_0x3180('0x28')](function(_0x2447f5){if(_0x2447f5){_0x108844=_0x2447f5[_0x3180('0x61')];var _0x12f7c8=_0x108844[_0x3180('0x62')](-0x1);if(_0x12f7c8==='/'){_0x108844=_0x108844[_0x3180('0x63')](0x0,_0x108844[_0x3180('0x64')](_0x12f7c8));}return rp({'method':_0x3180('0x65'),'uri':util[_0x3180('0x66')](_0x3180('0x67'),_0x108844,_0x3180('0x68')),'json':!![],'form':{'method':_0x3180('0x69'),'input_type':_0x3180('0x6a'),'response_type':_0x3180('0x6a'),'rest_data':JSON[_0x3180('0x6b')]({'user_auth':{'user_name':_0x2447f5[_0x3180('0x5f')],'password':_0x2447f5[_0x3180('0x60')],'encryption':_0x3180('0x6c')},'application':_0x3180('0x6d')})}});}})[_0x3180('0x28')](function(_0x18b8b1){if(_0x18b8b1&&_0x18b8b1[_0x3180('0x2a')]!==_0x3180('0x6e')&&_0x18b8b1[_0x3180('0x2a')]!==_0x3180('0x6f')){return rp({'method':_0x3180('0x65'),'uri':util['format']('%s%s',_0x108844,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3180('0x70'),'input_type':'JSON','response_type':_0x3180('0x6a'),'rest_data':JSON[_0x3180('0x6b')]({'session':_0x18b8b1['id'],'module_name':_0x3180('0x71')})}})[_0x3180('0x28')](function(_0x50920c){if(_0x50920c){var _0x7e5b60=_[_0x3180('0x72')](_0x50920c['module_fields']);_[_0x3180('0x73')](_0x7e5b60,function(_0x6c3599){return _0x382701[_0x3180('0x74')](_0x6c3599[_0x3180('0x2a')]);});return{'count':_0x7e5b60[_0x3180('0x38')],'rows':_[_0x3180('0x2d')](_0x7e5b60,function(_0x41d11b){return{'id':_0x41d11b[_0x3180('0x2a')],'name':_0x41d11b['label'],'custom':_[_0x3180('0x75')](_0x41d11b[_0x3180('0x2a')],'_c')?!![]:![],'options':_0x41d11b[_0x3180('0x48')]?_[_0x3180('0x2d')](_['values'](_0x41d11b[_0x3180('0x48')]),function(_0x160266){return{'name':_0x160266[_0x3180('0x76')],'value':_0x160266['name']};}):[]};})};}})[_0x3180('0x28')](respondWithResult(_0x7ae680,null))[_0x3180('0x44')](function(_0x1fb2b5){var _0x3b7bbd=_0x1a4f31['query']['test']?0x1f4:_0x1fb2b5[_0x3180('0x77')]||0x1f4;logger['error'](_0x3180('0x78'),_0x3180('0x57'),_0x3b7bbd,JSON['stringify'](_0x1fb2b5));delete _0x1fb2b5[_0x3180('0x2a')];if(_0x3b7bbd===0x191){_0x3b7bbd=0x190;}_0x7ae680[_0x3180('0x1c')](_0x3b7bbd)[_0x3180('0x2b')](_0x1a4f31[_0x3180('0x33')][_0x3180('0x79')]?{'message':_0x3180('0x7a'),'statusCode':_0x1fb2b5[_0x3180('0x77')]}:_0x1fb2b5);});}else{var _0x5a22d0=0x1f4;_0x7ae680[_0x3180('0x1c')](_0x5a22d0)[_0x3180('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xdf03=['mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','update','body','params','getConfigurations','SugarcrmConfiguration','order','sort','AccountId','Subjects','getSubjects','type','getDescriptions','create','SugarcrmField','Descriptions','getFields','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','stringify','values','module_fields','remove','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x5c9e02,_0x5803c7){var _0x3542f8=function(_0x41d557){while(--_0x41d557){_0x5c9e02['push'](_0x5c9e02['shift']());}};_0x3542f8(++_0x5803c7);}(_0xdf03,0x73));var _0x3df0=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xdf03[_0x4db46b];return _0x565be8;};'use strict';var emlformat=require(_0x3df0('0x0'));var rimraf=require(_0x3df0('0x1'));var zipdir=require(_0x3df0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3df0('0x3'));var moment=require(_0x3df0('0x4'));var BPromise=require(_0x3df0('0x5'));var Mustache=require(_0x3df0('0x6'));var util=require(_0x3df0('0x7'));var path=require('path');var sox=require(_0x3df0('0x8'));var csv=require('to-csv');var ejs=require(_0x3df0('0x9'));var fs=require('fs');var fs_extra=require(_0x3df0('0xa'));var _=require('lodash');var squel=require(_0x3df0('0xb'));var crypto=require(_0x3df0('0xc'));var jsforce=require(_0x3df0('0xd'));var deskjs=require(_0x3df0('0xe'));var toCsv=require(_0x3df0('0xf'));var querystring=require('querystring');var Papa=require(_0x3df0('0x10'));var Redis=require('ioredis');var authService=require(_0x3df0('0x11'));var qs=require(_0x3df0('0x12'));var as=require(_0x3df0('0x13'));var hardwareService=require(_0x3df0('0x14'));var logger=require('../../config/logger')(_0x3df0('0x15'));var utils=require(_0x3df0('0x16'));var config=require(_0x3df0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3df0('0x18'))['db'];var integrations=require(_0x3df0('0x19'));function respondWithStatusCode(_0x5bb939,_0x25b30d){_0x25b30d=_0x25b30d||0xcc;return function(_0x16582e){if(_0x16582e){return _0x5bb939[_0x3df0('0x1a')](_0x25b30d);}return _0x5bb939['status'](_0x25b30d)[_0x3df0('0x1b')]();};}function respondWithResult(_0x1b891b,_0x3d01bf){_0x3d01bf=_0x3d01bf||0xc8;return function(_0x49ff14){if(_0x49ff14){return _0x1b891b['status'](_0x3d01bf)[_0x3df0('0x1c')](_0x49ff14);}};}function respondWithFilteredResult(_0x1cd9f0,_0x5914c4){return function(_0x56076f){if(_0x56076f){var _0x55ca89=typeof _0x5914c4[_0x3df0('0x1d')]==='undefined'&&typeof _0x5914c4['limit']===_0x3df0('0x1e');var _0x4e01d4=_0x56076f[_0x3df0('0x1f')];var _0x21ee27=_0x55ca89?0x0:_0x5914c4['offset'];var _0x30435a=_0x55ca89?_0x56076f[_0x3df0('0x1f')]:_0x5914c4['offset']+_0x5914c4[_0x3df0('0x20')];var _0x56f296;if(_0x30435a>=_0x4e01d4){_0x30435a=_0x4e01d4;_0x56f296=0xc8;}else{_0x56f296=0xce;}_0x1cd9f0[_0x3df0('0x21')](_0x56f296);return _0x1cd9f0['set'](_0x3df0('0x22'),_0x21ee27+'-'+_0x30435a+'/'+_0x4e01d4)['json'](_0x56076f);}return null;};}function patchUpdates(_0x2a7649){return function(_0x279b72){try{jsonpatch[_0x3df0('0x23')](_0x279b72,_0x2a7649,!![]);}catch(_0x2ad4c0){return BPromise[_0x3df0('0x24')](_0x2ad4c0);}return _0x279b72['save']();};}function saveUpdates(_0x57715c,_0x2cb963){return function(_0x4c4472){if(_0x4c4472){return _0x4c4472['update'](_0x57715c)[_0x3df0('0x25')](function(_0x100e28){return _0x100e28;});}return null;};}function removeEntity(_0x827329,_0x1c68e2){return function(_0x23ecda){if(_0x23ecda){return _0x23ecda[_0x3df0('0x26')]()[_0x3df0('0x25')](function(){_0x827329[_0x3df0('0x21')](0xcc)[_0x3df0('0x1b')]();});}};}function handleEntityNotFound(_0x407083,_0x2c141a){return function(_0xf47fce){if(!_0xf47fce){_0x407083[_0x3df0('0x1a')](0x194);}return _0xf47fce;};}function handleError(_0xa1a861,_0x42e1f1){_0x42e1f1=_0x42e1f1||0x1f4;return function(_0x3aeaf3){logger[_0x3df0('0x27')](_0x3aeaf3[_0x3df0('0x28')]);if(_0x3aeaf3[_0x3df0('0x29')]){delete _0x3aeaf3['name'];}_0xa1a861[_0x3df0('0x21')](_0x42e1f1)[_0x3df0('0x2a')](_0x3aeaf3);};}exports[_0x3df0('0x2b')]=function(_0x1cc97b,_0x3678bd){var _0x379326={},_0x410578={},_0x41489a={'count':0x0,'rows':[]};var _0x166fbc=_[_0x3df0('0x2c')](db[_0x3df0('0x2d')][_0x3df0('0x2e')],function(_0x3d2cb2){return{'name':_0x3d2cb2[_0x3df0('0x2f')],'type':_0x3d2cb2['type'][_0x3df0('0x30')]};});_0x410578[_0x3df0('0x31')]=_[_0x3df0('0x2c')](_0x166fbc,_0x3df0('0x29'));_0x410578['query']=_[_0x3df0('0x32')](_0x1cc97b['query']);_0x410578[_0x3df0('0x33')]=_[_0x3df0('0x34')](_0x410578[_0x3df0('0x31')],_0x410578[_0x3df0('0x35')]);_0x379326[_0x3df0('0x36')]=_['intersection'](_0x410578[_0x3df0('0x31')],qs[_0x3df0('0x37')](_0x1cc97b[_0x3df0('0x35')][_0x3df0('0x37')]));_0x379326[_0x3df0('0x36')]=_0x379326['attributes'][_0x3df0('0x38')]?_0x379326[_0x3df0('0x36')]:_0x410578[_0x3df0('0x31')];if(!_0x1cc97b[_0x3df0('0x35')][_0x3df0('0x39')](_0x3df0('0x3a'))){_0x379326[_0x3df0('0x20')]=qs[_0x3df0('0x20')](_0x1cc97b[_0x3df0('0x35')][_0x3df0('0x20')]);_0x379326[_0x3df0('0x1d')]=qs[_0x3df0('0x1d')](_0x1cc97b['query'][_0x3df0('0x1d')]);}_0x379326['order']=qs['sort'](_0x1cc97b[_0x3df0('0x35')]['sort']);_0x379326[_0x3df0('0x3b')]=qs[_0x3df0('0x33')](_[_0x3df0('0x3c')](_0x1cc97b[_0x3df0('0x35')],_0x410578[_0x3df0('0x33')]),_0x166fbc);if(_0x1cc97b['query'][_0x3df0('0x3d')]){_0x379326['where']=_[_0x3df0('0x3e')](_0x379326[_0x3df0('0x3b')],{'$or':_[_0x3df0('0x2c')](_0x166fbc,function(_0x5269e5){if(_0x5269e5['type']!==_0x3df0('0x3f')){var _0x2530f0={};_0x2530f0[_0x5269e5['name']]={'$like':'%'+_0x1cc97b['query'][_0x3df0('0x3d')]+'%'};return _0x2530f0;}})});}_0x379326=_[_0x3df0('0x3e')]({},_0x379326,_0x1cc97b[_0x3df0('0x40')]);var _0x5e45aa={'where':_0x379326[_0x3df0('0x3b')]};return db[_0x3df0('0x2d')]['count'](_0x5e45aa)[_0x3df0('0x25')](function(_0x3f6e95){_0x41489a['count']=_0x3f6e95;if(_0x1cc97b[_0x3df0('0x35')][_0x3df0('0x41')]){_0x379326[_0x3df0('0x42')]=[{'all':!![]}];}return db[_0x3df0('0x2d')][_0x3df0('0x43')](_0x379326);})[_0x3df0('0x25')](function(_0x4d4018){_0x41489a[_0x3df0('0x44')]=_0x4d4018;return _0x41489a;})[_0x3df0('0x25')](respondWithFilteredResult(_0x3678bd,_0x379326))[_0x3df0('0x45')](handleError(_0x3678bd,null));};exports[_0x3df0('0x46')]=function(_0x595735,_0xe45ee8){var _0x168b37={'raw':![],'where':{'id':_0x595735['params']['id']}},_0x48f764={};_0x48f764['model']=_['keys'](db[_0x3df0('0x2d')][_0x3df0('0x2e')]);_0x48f764[_0x3df0('0x35')]=_[_0x3df0('0x32')](_0x595735[_0x3df0('0x35')]);_0x48f764[_0x3df0('0x33')]=_[_0x3df0('0x34')](_0x48f764['model'],_0x48f764[_0x3df0('0x35')]);_0x168b37['attributes']=_[_0x3df0('0x34')](_0x48f764['model'],qs[_0x3df0('0x37')](_0x595735['query'][_0x3df0('0x37')]));_0x168b37['attributes']=_0x168b37[_0x3df0('0x36')][_0x3df0('0x38')]?_0x168b37[_0x3df0('0x36')]:_0x48f764[_0x3df0('0x31')];if(_0x595735[_0x3df0('0x35')]['includeAll']){_0x168b37[_0x3df0('0x42')]=[{'all':!![]}];}_0x168b37=_['merge']({},_0x168b37,_0x595735[_0x3df0('0x40')]);return db['SugarcrmAccount'][_0x3df0('0x47')](_0x168b37)[_0x3df0('0x25')](handleEntityNotFound(_0xe45ee8,null))[_0x3df0('0x25')](respondWithResult(_0xe45ee8,null))['catch'](handleError(_0xe45ee8,null));};exports['create']=function(_0x50f4e0,_0x346be4){return db[_0x3df0('0x2d')]['create'](_0x50f4e0['body'],{})[_0x3df0('0x25')](respondWithResult(_0x346be4,0xc9))[_0x3df0('0x45')](handleError(_0x346be4,null));};exports[_0x3df0('0x48')]=function(_0x298430,_0xc56b16){if(_0x298430[_0x3df0('0x49')]['id']){delete _0x298430['body']['id'];}return db[_0x3df0('0x2d')]['find']({'where':{'id':_0x298430[_0x3df0('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc56b16,null))[_0x3df0('0x25')](saveUpdates(_0x298430[_0x3df0('0x49')],null))[_0x3df0('0x25')](respondWithResult(_0xc56b16,null))[_0x3df0('0x45')](handleError(_0xc56b16,null));};exports['destroy']=function(_0x13cd4c,_0x43d204){return db[_0x3df0('0x2d')]['find']({'where':{'id':_0x13cd4c[_0x3df0('0x4a')]['id']}})[_0x3df0('0x25')](handleEntityNotFound(_0x43d204,null))[_0x3df0('0x25')](removeEntity(_0x43d204,null))[_0x3df0('0x45')](handleError(_0x43d204,null));};exports[_0x3df0('0x4b')]=function(_0x283b6a,_0x1e9623,_0x461bf0){var _0x463ecf={};var _0x12fa0a={};var _0x33111e;var _0x5c6939;return db[_0x3df0('0x2d')]['findOne']({'where':{'id':_0x283b6a[_0x3df0('0x4a')]['id']}})[_0x3df0('0x25')](handleEntityNotFound(_0x1e9623,null))[_0x3df0('0x25')](function(_0x4c08c7){if(_0x4c08c7){_0x33111e=_0x4c08c7;_0x12fa0a[_0x3df0('0x31')]=_[_0x3df0('0x32')](db[_0x3df0('0x4c')][_0x3df0('0x2e')]);_0x12fa0a[_0x3df0('0x35')]=_[_0x3df0('0x32')](_0x283b6a['query']);_0x12fa0a['filters']=_[_0x3df0('0x34')](_0x12fa0a[_0x3df0('0x31')],_0x12fa0a[_0x3df0('0x35')]);_0x463ecf[_0x3df0('0x36')]=_[_0x3df0('0x34')](_0x12fa0a[_0x3df0('0x31')],qs[_0x3df0('0x37')](_0x283b6a[_0x3df0('0x35')][_0x3df0('0x37')]));_0x463ecf[_0x3df0('0x36')]=_0x463ecf[_0x3df0('0x36')][_0x3df0('0x38')]?_0x463ecf['attributes']:_0x12fa0a['model'];_0x463ecf[_0x3df0('0x4d')]=qs[_0x3df0('0x4e')](_0x283b6a[_0x3df0('0x35')]['sort']);_0x463ecf[_0x3df0('0x3b')]=qs[_0x3df0('0x33')](_['pick'](_0x283b6a[_0x3df0('0x35')],_0x12fa0a['filters']));if(_0x283b6a['query'][_0x3df0('0x3d')]){_0x463ecf[_0x3df0('0x3b')]=_[_0x3df0('0x3e')](_0x463ecf['where'],{'$or':_[_0x3df0('0x2c')](_0x463ecf['attributes'],function(_0x264206){var _0x1dedfc={};_0x1dedfc[_0x264206]={'$like':'%'+_0x283b6a['query']['filter']+'%'};return _0x1dedfc;})});}_0x463ecf=_[_0x3df0('0x3e')]({},_0x463ecf,_0x283b6a[_0x3df0('0x40')]);return _0x33111e[_0x3df0('0x4b')](_0x463ecf);}})[_0x3df0('0x25')](function(_0x168f65){if(_0x168f65){_0x5c6939=_0x168f65[_0x3df0('0x38')];if(!_0x283b6a[_0x3df0('0x35')][_0x3df0('0x39')](_0x3df0('0x3a'))){_0x463ecf[_0x3df0('0x20')]=qs['limit'](_0x283b6a['query'][_0x3df0('0x20')]);_0x463ecf[_0x3df0('0x1d')]=qs['offset'](_0x283b6a[_0x3df0('0x35')][_0x3df0('0x1d')]);}return _0x33111e[_0x3df0('0x4b')](_0x463ecf);}})[_0x3df0('0x25')](function(_0x4ca16c){if(_0x4ca16c){return _0x4ca16c?{'count':_0x5c6939,'rows':_0x4ca16c}:null;}})[_0x3df0('0x25')](respondWithResult(_0x1e9623,null))['catch'](handleError(_0x1e9623,null));};exports['addConfiguration']=function(_0x5250ee,_0x1857d7,_0x13467d){if(_0x5250ee['body']['id']){delete _0x5250ee['body']['id'];}return db[_0x3df0('0x2d')]['findOne']({'where':{'id':_0x5250ee[_0x3df0('0x4a')]['id']}})[_0x3df0('0x25')](handleEntityNotFound(_0x1857d7,null))[_0x3df0('0x25')](function(_0x32ad74){if(_0x32ad74){_0x5250ee['body'][_0x3df0('0x4f')]=_0x32ad74['id'];_0x5250ee[_0x3df0('0x49')][_0x3df0('0x50')]=integrations[_0x3df0('0x51')](_0x5250ee['body']['channel'],_0x5250ee[_0x3df0('0x49')][_0x3df0('0x52')]);_0x5250ee[_0x3df0('0x49')]['Descriptions']=integrations[_0x3df0('0x53')](_0x5250ee[_0x3df0('0x49')]['channel'],_0x5250ee[_0x3df0('0x49')][_0x3df0('0x52')]);return db[_0x3df0('0x4c')][_0x3df0('0x54')](_0x5250ee[_0x3df0('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0x3df0('0x50')},{'model':db[_0x3df0('0x55')],'as':_0x3df0('0x56')}]});}return null;})[_0x3df0('0x25')](respondWithResult(_0x1857d7,null))['catch'](handleError(_0x1857d7,null));};exports[_0x3df0('0x57')]=function(_0xe3822b,_0x1d4dbe,_0x479545){var _0xb532c7='';var _0x264a77=['id','name','assigned_user_id','created_by',_0x3df0('0x58'),'date_start',_0x3df0('0x59'),_0x3df0('0x5a'),_0x3df0('0x5b'),_0x3df0('0x5c'),_0x3df0('0x5d'),_0x3df0('0x5e')];return db['SugarcrmAccount'][_0x3df0('0x5f')]({'where':{'id':_0xe3822b[_0x3df0('0x4a')]['id']},'attributes':['id',_0x3df0('0x60'),_0x3df0('0x61'),'remoteUri']})[_0x3df0('0x25')](handleEntityNotFound(_0x1d4dbe,null))['then'](function(_0x2acde1){if(_0x2acde1){_0xb532c7=_0x2acde1[_0x3df0('0x62')];var _0x9faef3=_0xb532c7[_0x3df0('0x63')](-0x1);if(_0x9faef3==='/'){_0xb532c7=_0xb532c7[_0x3df0('0x64')](0x0,_0xb532c7[_0x3df0('0x65')](_0x9faef3));}return rp({'method':'POST','uri':util[_0x3df0('0x66')]('%s%s',_0xb532c7,_0x3df0('0x67')),'json':!![],'form':{'method':_0x3df0('0x68'),'input_type':'JSON','response_type':_0x3df0('0x69'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2acde1[_0x3df0('0x60')],'password':_0x2acde1[_0x3df0('0x61')],'encryption':'PLAIN'},'application':_0x3df0('0x6a')})}});}})[_0x3df0('0x25')](function(_0x24acc8){if(_0x24acc8&&_0x24acc8[_0x3df0('0x29')]!==_0x3df0('0x6b')&&_0x24acc8[_0x3df0('0x29')]!==_0x3df0('0x6c')){return rp({'method':_0x3df0('0x6d'),'uri':util[_0x3df0('0x66')]('%s%s',_0xb532c7,_0x3df0('0x67')),'json':!![],'form':{'method':_0x3df0('0x6e'),'input_type':_0x3df0('0x69'),'response_type':_0x3df0('0x69'),'rest_data':JSON[_0x3df0('0x6f')]({'session':_0x24acc8['id'],'module_name':'Calls'})}})[_0x3df0('0x25')](function(_0xd82d81){if(_0xd82d81){var _0xed63b6=_[_0x3df0('0x70')](_0xd82d81[_0x3df0('0x71')]);_[_0x3df0('0x72')](_0xed63b6,function(_0x2a93f2){return _0x264a77[_0x3df0('0x73')](_0x2a93f2[_0x3df0('0x29')]);});return{'count':_0xed63b6[_0x3df0('0x38')],'rows':_['map'](_0xed63b6,function(_0x21cd75){return{'id':_0x21cd75[_0x3df0('0x29')],'name':_0x21cd75['label'],'custom':_[_0x3df0('0x74')](_0x21cd75[_0x3df0('0x29')],'_c')?!![]:![],'options':_0x21cd75[_0x3df0('0x40')]?_[_0x3df0('0x2c')](_[_0x3df0('0x70')](_0x21cd75[_0x3df0('0x40')]),function(_0x44bfce){return{'name':_0x44bfce['value'],'value':_0x44bfce[_0x3df0('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x1d4dbe,null))[_0x3df0('0x45')](function(_0x1cecd5){var _0x3b7342=_0xe3822b[_0x3df0('0x35')][_0x3df0('0x75')]?0x1f4:_0x1cecd5[_0x3df0('0x76')]||0x1f4;logger[_0x3df0('0x27')](_0x3df0('0x77'),_0x3df0('0x57'),_0x3b7342,JSON[_0x3df0('0x6f')](_0x1cecd5));delete _0x1cecd5[_0x3df0('0x29')];if(_0x3b7342===0x191){_0x3b7342=0x190;}_0x1d4dbe[_0x3df0('0x21')](_0x3b7342)[_0x3df0('0x2a')](_0xe3822b[_0x3df0('0x35')][_0x3df0('0x75')]?{'message':_0x3df0('0x78'),'statusCode':_0x1cecd5[_0x3df0('0x76')]}:_0x1cecd5);});}else{var _0xffe895=0x1f4;_0x1d4dbe[_0x3df0('0x21')](_0xffe895)[_0x3df0('0x2a')]({'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 87845ba..844e8ba 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 _0x843e=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x2dfbee,_0x22cadd){var _0xfea92a=function(_0x4a134a){while(--_0x4a134a){_0x2dfbee['push'](_0x2dfbee['shift']());}};_0xfea92a(++_0x22cadd);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe843('0x0'));var util=require(_0xe843('0x1'));var logger=require(_0xe843('0x2'))(_0xe843('0x3'));var moment=require('moment');var BPromise=require(_0xe843('0x4'));var rp=require(_0xe843('0x5'));var fs=require('fs');var path=require(_0xe843('0x6'));var rimraf=require(_0xe843('0x7'));var config=require(_0xe843('0x8'));var attributes=require(_0xe843('0x9'));var integrations=require(_0xe843('0xa'));module['exports']=function(_0x3fdf63,_0x329018){return _0x3fdf63['define'](_0xe843('0xb'),attributes,{'tableName':_0xe843('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6edc=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6edc,0x138));var _0xc6ed=function(_0x3cf1ae,_0x4ccd9e){_0x3cf1ae=_0x3cf1ae-0x0;var _0x287598=_0x6edc[_0x3cf1ae];return _0x287598;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var logger=require(_0xc6ed('0x2'))(_0xc6ed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc6ed('0x4'));var fs=require('fs');var path=require(_0xc6ed('0x5'));var rimraf=require(_0xc6ed('0x6'));var config=require(_0xc6ed('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xc6ed('0x8'));module[_0xc6ed('0x9')]=function(_0x2b3e56,_0x548a14){return _0x2b3e56[_0xc6ed('0xa')]('SugarcrmAccount',attributes,{'tableName':_0xc6ed('0xb'),'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 3df0bdc..8b31cca 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 _0xdbdf=['error','message','result','catch','SugarcrmAccount','options','raw','where','limit','map','include','model','attributes','GetSugarcrmAccount','debug','ShowSugarcrmAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5cbd5f,_0x27bee9){var _0x16bbfd=function(_0x4377d2){while(--_0x4377d2){_0x5cbd5f['push'](_0x5cbd5f['shift']());}};_0x16bbfd(++_0x27bee9);}(_0xdbdf,0x7a));var _0xfdbd=function(_0x2af127,_0x358d69){_0x2af127=_0x2af127-0x0;var _0x1c4bcd=_0xdbdf[_0x2af127];return _0x1c4bcd;};'use strict';var _=require(_0xfdbd('0x0'));var util=require('util');var moment=require(_0xfdbd('0x1'));var BPromise=require('bluebird');var rs=require(_0xfdbd('0x2'));var fs=require('fs');var Redis=require(_0xfdbd('0x3'));var db=require(_0xfdbd('0x4'))['db'];var utils=require(_0xfdbd('0x5'));var logger=require('../../config/logger')(_0xfdbd('0x6'));var config=require(_0xfdbd('0x7'));var jayson=require(_0xfdbd('0x8'));var client=jayson[_0xfdbd('0x9')][_0xfdbd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f1656,_0x3a82a7,_0xa552e8){return new BPromise(function(_0x2c03fa,_0x44c00e){return client[_0xfdbd('0xb')](_0x2f1656,_0xa552e8)[_0xfdbd('0xc')](function(_0x9c446e){logger[_0xfdbd('0xd')](_0xfdbd('0xe'),_0x3a82a7,_0xfdbd('0xf'));logger['debug'](_0xfdbd('0x10'),_0x3a82a7,_0xfdbd('0xf'),JSON[_0xfdbd('0x11')](_0x9c446e));if(_0x9c446e[_0xfdbd('0x12')]){if(_0x9c446e['error']['code']===0x1f4){logger[_0xfdbd('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x3a82a7,_0x9c446e[_0xfdbd('0x12')][_0xfdbd('0x13')]);return _0x44c00e(_0x9c446e[_0xfdbd('0x12')]['message']);}logger[_0xfdbd('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x3a82a7,_0x9c446e[_0xfdbd('0x12')][_0xfdbd('0x13')]);return _0x2c03fa(_0x9c446e['error']['message']);}else{logger[_0xfdbd('0xd')](_0xfdbd('0xe'),_0x3a82a7,_0xfdbd('0xf'));_0x2c03fa(_0x9c446e[_0xfdbd('0x14')][_0xfdbd('0x13')]);}})[_0xfdbd('0x15')](function(_0x844c46){logger[_0xfdbd('0x12')](_0xfdbd('0xe'),_0x3a82a7,_0x844c46);_0x44c00e(_0x844c46);});});}exports['GetSugarcrmAccount']=function(_0x1dc5b1){var _0x2b53ff=this;return new Promise(function(_0x1fe1b2,_0x4032e1){return db[_0xfdbd('0x16')]['findAll']({'raw':_0x1dc5b1[_0xfdbd('0x17')]?_0x1dc5b1['options'][_0xfdbd('0x18')]===undefined?!![]:![]:!![],'where':_0x1dc5b1[_0xfdbd('0x17')]?_0x1dc5b1['options'][_0xfdbd('0x19')]||null:null,'attributes':_0x1dc5b1['options']?_0x1dc5b1[_0xfdbd('0x17')]['attributes']||null:null,'limit':_0x1dc5b1[_0xfdbd('0x17')]?_0x1dc5b1[_0xfdbd('0x17')][_0xfdbd('0x1a')]||null:null,'include':_0x1dc5b1[_0xfdbd('0x17')]?_0x1dc5b1['options']['include']?_[_0xfdbd('0x1b')](_0x1dc5b1['options'][_0xfdbd('0x1c')],function(_0x4c241d){return{'model':db[_0x4c241d[_0xfdbd('0x1d')]],'as':_0x4c241d['as'],'attributes':_0x4c241d[_0xfdbd('0x1e')],'include':_0x4c241d[_0xfdbd('0x1c')]?_[_0xfdbd('0x1b')](_0x4c241d[_0xfdbd('0x1c')],function(_0x338857){return{'model':db[_0x338857[_0xfdbd('0x1d')]],'as':_0x338857['as'],'attributes':_0x338857['attributes'],'include':_0x338857[_0xfdbd('0x1c')]?_['map'](_0x338857[_0xfdbd('0x1c')],function(_0x328982){return{'model':db[_0x328982[_0xfdbd('0x1d')]],'as':_0x328982['as'],'attributes':_0x328982['attributes']};}):[]};}):[]};}):[]:[]})[_0xfdbd('0xc')](function(_0x1639ef){logger[_0xfdbd('0xd')](_0xfdbd('0x1f'),_0x1dc5b1);logger[_0xfdbd('0x20')](_0xfdbd('0x1f'),_0x1dc5b1,JSON[_0xfdbd('0x11')](_0x1639ef));_0x1fe1b2(_0x1639ef);})['catch'](function(_0x490d43){logger[_0xfdbd('0x12')](_0xfdbd('0x1f'),_0x490d43[_0xfdbd('0x13')],_0x1dc5b1);_0x4032e1(_0x2b53ff[_0xfdbd('0x12')](0x1f4,_0x490d43['message']));});});};exports[_0xfdbd('0x21')]=function(_0x58c7a9){var _0x1ebe7d=this;return new Promise(function(_0x1d3a8f,_0x85b049){return db[_0xfdbd('0x16')][_0xfdbd('0x22')]({'raw':_0x58c7a9['options']?_0x58c7a9['options'][_0xfdbd('0x18')]===undefined?!![]:![]:!![],'where':_0x58c7a9[_0xfdbd('0x17')]?_0x58c7a9['options']['where']||null:null,'attributes':_0x58c7a9[_0xfdbd('0x17')]?_0x58c7a9[_0xfdbd('0x17')]['attributes']||null:null,'include':_0x58c7a9[_0xfdbd('0x17')]?_0x58c7a9[_0xfdbd('0x17')][_0xfdbd('0x1c')]?_[_0xfdbd('0x1b')](_0x58c7a9[_0xfdbd('0x17')]['include'],function(_0x5f3766){return{'model':db[_0x5f3766[_0xfdbd('0x1d')]],'as':_0x5f3766['as'],'attributes':_0x5f3766['attributes'],'include':_0x5f3766[_0xfdbd('0x1c')]?_[_0xfdbd('0x1b')](_0x5f3766[_0xfdbd('0x1c')],function(_0x5a5324){return{'model':db[_0x5a5324['model']],'as':_0x5a5324['as'],'attributes':_0x5a5324[_0xfdbd('0x1e')],'include':_0x5a5324[_0xfdbd('0x1c')]?_[_0xfdbd('0x1b')](_0x5a5324[_0xfdbd('0x1c')],function(_0x3bdbea){return{'model':db[_0x3bdbea[_0xfdbd('0x1d')]],'as':_0x3bdbea['as'],'attributes':_0x3bdbea[_0xfdbd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfdbd('0xc')](function(_0x49ae16){logger[_0xfdbd('0xd')]('ShowSugarcrmAccount',_0x58c7a9);logger['debug'](_0xfdbd('0x21'),_0x58c7a9,JSON[_0xfdbd('0x11')](_0x49ae16));_0x1d3a8f(_0x49ae16);})[_0xfdbd('0x15')](function(_0x446100){logger[_0xfdbd('0x12')](_0xfdbd('0x21'),_0x446100['message'],_0x58c7a9);_0x85b049(_0x1ebe7d[_0xfdbd('0x12')](0x1f4,_0x446100[_0xfdbd('0x13')]));});});}; \ No newline at end of file +var _0x083f=['map','model','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include'];(function(_0x4d6e3f,_0x416586){var _0x4c9254=function(_0x53a8c6){while(--_0x53a8c6){_0x4d6e3f['push'](_0x4d6e3f['shift']());}};_0x4c9254(++_0x416586);}(_0x083f,0x126));var _0xf083=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x083f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf083('0x0'));var util=require(_0xf083('0x1'));var moment=require(_0xf083('0x2'));var BPromise=require(_0xf083('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf083('0x4'))['db'];var utils=require(_0xf083('0x5'));var logger=require(_0xf083('0x6'))('rpc');var config=require(_0xf083('0x7'));var jayson=require(_0xf083('0x8'));var client=jayson[_0xf083('0x9')][_0xf083('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1356cf,_0x692a67,_0x51c296){return new BPromise(function(_0xc9d749,_0x47de5a){return client[_0xf083('0xb')](_0x1356cf,_0x51c296)[_0xf083('0xc')](function(_0x5e4814){logger[_0xf083('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x692a67,_0xf083('0xe'));logger[_0xf083('0xf')](_0xf083('0x10'),_0x692a67,_0xf083('0xe'),JSON['stringify'](_0x5e4814));if(_0x5e4814[_0xf083('0x11')]){if(_0x5e4814[_0xf083('0x11')][_0xf083('0x12')]===0x1f4){logger[_0xf083('0x11')](_0xf083('0x13'),_0x692a67,_0x5e4814[_0xf083('0x11')]['message']);return _0x47de5a(_0x5e4814[_0xf083('0x11')]['message']);}logger[_0xf083('0x11')](_0xf083('0x13'),_0x692a67,_0x5e4814[_0xf083('0x11')][_0xf083('0x14')]);return _0xc9d749(_0x5e4814[_0xf083('0x11')][_0xf083('0x14')]);}else{logger[_0xf083('0xd')](_0xf083('0x13'),_0x692a67,_0xf083('0xe'));_0xc9d749(_0x5e4814[_0xf083('0x15')][_0xf083('0x14')]);}})[_0xf083('0x16')](function(_0x13898f){logger[_0xf083('0x11')](_0xf083('0x13'),_0x692a67,_0x13898f);_0x47de5a(_0x13898f);});});}exports['GetSugarcrmAccount']=function(_0x1ad1fc){var _0x2fc45b=this;return new Promise(function(_0x142023,_0xc02ed8){return db[_0xf083('0x17')][_0xf083('0x18')]({'raw':_0x1ad1fc[_0xf083('0x19')]?_0x1ad1fc['options'][_0xf083('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ad1fc[_0xf083('0x19')]?_0x1ad1fc[_0xf083('0x19')]['where']||null:null,'attributes':_0x1ad1fc[_0xf083('0x19')]?_0x1ad1fc['options'][_0xf083('0x1b')]||null:null,'limit':_0x1ad1fc[_0xf083('0x19')]?_0x1ad1fc[_0xf083('0x19')][_0xf083('0x1c')]||null:null,'include':_0x1ad1fc[_0xf083('0x19')]?_0x1ad1fc['options'][_0xf083('0x1d')]?_[_0xf083('0x1e')](_0x1ad1fc[_0xf083('0x19')][_0xf083('0x1d')],function(_0x584135){return{'model':db[_0x584135[_0xf083('0x1f')]],'as':_0x584135['as'],'attributes':_0x584135['attributes'],'include':_0x584135[_0xf083('0x1d')]?_['map'](_0x584135[_0xf083('0x1d')],function(_0x2beedc){return{'model':db[_0x2beedc['model']],'as':_0x2beedc['as'],'attributes':_0x2beedc[_0xf083('0x1b')],'include':_0x2beedc[_0xf083('0x1d')]?_[_0xf083('0x1e')](_0x2beedc[_0xf083('0x1d')],function(_0x1eb11c){return{'model':db[_0x1eb11c['model']],'as':_0x1eb11c['as'],'attributes':_0x1eb11c[_0xf083('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf083('0xc')](function(_0x31ec5d){logger[_0xf083('0xd')](_0xf083('0x20'),_0x1ad1fc);logger['debug'](_0xf083('0x20'),_0x1ad1fc,JSON[_0xf083('0x21')](_0x31ec5d));_0x142023(_0x31ec5d);})[_0xf083('0x16')](function(_0x5c3bfc){logger['error']('GetSugarcrmAccount',_0x5c3bfc[_0xf083('0x14')],_0x1ad1fc);_0xc02ed8(_0x2fc45b[_0xf083('0x11')](0x1f4,_0x5c3bfc[_0xf083('0x14')]));});});};exports[_0xf083('0x22')]=function(_0x532906){var _0x45122c=this;return new Promise(function(_0x3b693e,_0x397698){return db[_0xf083('0x17')]['find']({'raw':_0x532906[_0xf083('0x19')]?_0x532906[_0xf083('0x19')][_0xf083('0x1a')]===undefined?!![]:![]:!![],'where':_0x532906['options']?_0x532906[_0xf083('0x19')][_0xf083('0x23')]||null:null,'attributes':_0x532906[_0xf083('0x19')]?_0x532906[_0xf083('0x19')][_0xf083('0x1b')]||null:null,'include':_0x532906[_0xf083('0x19')]?_0x532906[_0xf083('0x19')][_0xf083('0x1d')]?_[_0xf083('0x1e')](_0x532906[_0xf083('0x19')]['include'],function(_0x53214a){return{'model':db[_0x53214a[_0xf083('0x1f')]],'as':_0x53214a['as'],'attributes':_0x53214a[_0xf083('0x1b')],'include':_0x53214a[_0xf083('0x1d')]?_[_0xf083('0x1e')](_0x53214a['include'],function(_0x2acf0a){return{'model':db[_0x2acf0a['model']],'as':_0x2acf0a['as'],'attributes':_0x2acf0a[_0xf083('0x1b')],'include':_0x2acf0a[_0xf083('0x1d')]?_[_0xf083('0x1e')](_0x2acf0a[_0xf083('0x1d')],function(_0x342993){return{'model':db[_0x342993[_0xf083('0x1f')]],'as':_0x342993['as'],'attributes':_0x342993[_0xf083('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d0fbf){logger[_0xf083('0xd')](_0xf083('0x22'),_0x532906);logger[_0xf083('0xf')](_0xf083('0x22'),_0x532906,JSON[_0xf083('0x21')](_0x4d0fbf));_0x3b693e(_0x4d0fbf);})[_0xf083('0x16')](function(_0x898c8d){logger[_0xf083('0x11')](_0xf083('0x22'),_0x898c8d[_0xf083('0x14')],_0x532906);_0x397698(_0x45122c[_0xf083('0x11')](0x1f4,_0x898c8d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 14e6421..e000a41 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 _0xf430=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0xf430,0x19f));var _0x0f43=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xf430[_0x1b6311];return _0x25aab6;};'use strict';var multer=require(_0x0f43('0x0'));var util=require('util');var path=require(_0x0f43('0x1'));var timeout=require(_0x0f43('0x2'));var express=require(_0x0f43('0x3'));var router=express['Router']();var fs_extra=require(_0x0f43('0x4'));var auth=require(_0x0f43('0x5'));var interaction=require(_0x0f43('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x0f43('0x7')](),controller[_0x0f43('0x8')]);router['get']('/:id',auth[_0x0f43('0x7')](),controller['show']);router[_0x0f43('0x9')](_0x0f43('0xa'),auth[_0x0f43('0x7')](),controller[_0x0f43('0xb')]);router[_0x0f43('0x9')](_0x0f43('0xc'),auth['isAuthenticated'](),controller[_0x0f43('0xd')]);router['get'](_0x0f43('0xe'),auth[_0x0f43('0x7')](),controller[_0x0f43('0xf')]);router[_0x0f43('0x10')]('/',auth[_0x0f43('0x7')](),controller[_0x0f43('0x11')]);router[_0x0f43('0x12')](_0x0f43('0x13'),auth[_0x0f43('0x7')](),controller[_0x0f43('0x14')]);router['delete'](_0x0f43('0x13'),auth[_0x0f43('0x7')](),controller[_0x0f43('0x15')]);module[_0x0f43('0x16')]=router; \ No newline at end of file +var _0xd564=['post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','getSubjects','getDescriptions'];(function(_0x3dc30d,_0x3eee3c){var _0x225236=function(_0x303bd2){while(--_0x303bd2){_0x3dc30d['push'](_0x3dc30d['shift']());}};_0x225236(++_0x3eee3c);}(_0xd564,0xf7));var _0x4d56=function(_0x102e76,_0x2a2d0d){_0x102e76=_0x102e76-0x0;var _0x781213=_0xd564[_0x102e76];return _0x781213;};'use strict';var multer=require(_0x4d56('0x0'));var util=require(_0x4d56('0x1'));var path=require('path');var timeout=require(_0x4d56('0x2'));var express=require(_0x4d56('0x3'));var router=express['Router']();var fs_extra=require(_0x4d56('0x4'));var auth=require(_0x4d56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d56('0x6'));var controller=require(_0x4d56('0x7'));router['get']('/',auth[_0x4d56('0x8')](),controller[_0x4d56('0x9')]);router[_0x4d56('0xa')]('/:id',auth[_0x4d56('0x8')](),controller['show']);router[_0x4d56('0xa')]('/:id/fields',auth[_0x4d56('0x8')](),controller['getFields']);router[_0x4d56('0xa')]('/:id/subjects',auth[_0x4d56('0x8')](),controller[_0x4d56('0xb')]);router['get']('/:id/descriptions',auth[_0x4d56('0x8')](),controller[_0x4d56('0xc')]);router[_0x4d56('0xd')]('/',auth[_0x4d56('0x8')](),controller[_0x4d56('0xe')]);router[_0x4d56('0xf')](_0x4d56('0x10'),auth[_0x4d56('0x8')](),controller[_0x4d56('0x11')]);router[_0x4d56('0x12')]('/:id',auth[_0x4d56('0x8')](),controller['destroy']);module[_0x4d56('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 8e3b9c4..74c532e 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 _0x5719=['sequelize','exports','STRING'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x5719,0x141));var _0x9571=function(_0x6adeaa,_0x5a44e4){_0x6adeaa=_0x6adeaa-0x0;var _0x285bc3=_0x5719[_0x6adeaa];return _0x285bc3;};'use strict';var Sequelize=require(_0x9571('0x0'));module[_0x9571('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9571('0x2')]}}; \ No newline at end of file +var _0x1e97=['exports','STRING'];(function(_0x179ad4,_0xb25dd2){var _0x32c20b=function(_0x477a53){while(--_0x477a53){_0x179ad4['push'](_0x179ad4['shift']());}};_0x32c20b(++_0xb25dd2);}(_0x1e97,0x17a));var _0x71e9=function(_0x4b3700,_0x421b8b){_0x4b3700=_0x4b3700-0x0;var _0x585dcf=_0x1e97[_0x4b3700];return _0x585dcf;};'use strict';var Sequelize=require('sequelize');module[_0x71e9('0x0')]={'name':{'type':Sequelize[_0x71e9('0x1')]},'description':{'type':Sequelize[_0x71e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index ec88d31..0d281fe 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 _0x5761=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','create','find','params','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x218e99,_0x4a364f){var _0x47da41=function(_0x483838){while(--_0x483838){_0x218e99['push'](_0x218e99['shift']());}};_0x47da41(++_0x4a364f);}(_0x5761,0xd7));var _0x1576=function(_0x2b2964,_0x5d8c69){_0x2b2964=_0x2b2964-0x0;var _0x201630=_0x5761[_0x2b2964];return _0x201630;};'use strict';var emlformat=require(_0x1576('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1576('0x1'));var jsonpatch=require(_0x1576('0x2'));var rp=require(_0x1576('0x3'));var moment=require('moment');var BPromise=require(_0x1576('0x4'));var Mustache=require(_0x1576('0x5'));var util=require('util');var path=require(_0x1576('0x6'));var sox=require(_0x1576('0x7'));var csv=require(_0x1576('0x8'));var ejs=require(_0x1576('0x9'));var fs=require('fs');var fs_extra=require(_0x1576('0xa'));var _=require(_0x1576('0xb'));var squel=require('squel');var crypto=require(_0x1576('0xc'));var jsforce=require(_0x1576('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1576('0x8'));var querystring=require(_0x1576('0xe'));var Papa=require(_0x1576('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1576('0x10'));var hardwareService=require(_0x1576('0x11'));var logger=require('../../config/logger')(_0x1576('0x12'));var utils=require(_0x1576('0x13'));var config=require(_0x1576('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1576('0x15'))['db'];function respondWithStatusCode(_0x368b12,_0x5891cc){_0x5891cc=_0x5891cc||0xcc;return function(_0x476020){if(_0x476020){return _0x368b12[_0x1576('0x16')](_0x5891cc);}return _0x368b12['status'](_0x5891cc)[_0x1576('0x17')]();};}function respondWithResult(_0x34f593,_0x4442dc){_0x4442dc=_0x4442dc||0xc8;return function(_0x3669c9){if(_0x3669c9){return _0x34f593[_0x1576('0x18')](_0x4442dc)[_0x1576('0x19')](_0x3669c9);}};}function respondWithFilteredResult(_0x374ed5,_0x34ad00){return function(_0xf082d){if(_0xf082d){var _0x2da87e=typeof _0x34ad00[_0x1576('0x1a')]===_0x1576('0x1b')&&typeof _0x34ad00[_0x1576('0x1c')]==='undefined';var _0x23d550=_0xf082d[_0x1576('0x1d')];var _0x517372=_0x2da87e?0x0:_0x34ad00[_0x1576('0x1a')];var _0x29a8fa=_0x2da87e?_0xf082d[_0x1576('0x1d')]:_0x34ad00[_0x1576('0x1a')]+_0x34ad00['limit'];var _0x449eaa;if(_0x29a8fa>=_0x23d550){_0x29a8fa=_0x23d550;_0x449eaa=0xc8;}else{_0x449eaa=0xce;}_0x374ed5[_0x1576('0x18')](_0x449eaa);return _0x374ed5[_0x1576('0x1e')](_0x1576('0x1f'),_0x517372+'-'+_0x29a8fa+'/'+_0x23d550)[_0x1576('0x19')](_0xf082d);}return null;};}function patchUpdates(_0x4e086d){return function(_0x311bec){try{jsonpatch[_0x1576('0x20')](_0x311bec,_0x4e086d,!![]);}catch(_0x43c871){return BPromise['reject'](_0x43c871);}return _0x311bec[_0x1576('0x21')]();};}function saveUpdates(_0x38fcb4,_0x4c0c94){return function(_0x48c07b){if(_0x48c07b){return _0x48c07b[_0x1576('0x22')](_0x38fcb4)[_0x1576('0x23')](function(_0xa1fa4){return _0xa1fa4;});}return null;};}function removeEntity(_0x155be8,_0x69116a){return function(_0x2d6528){if(_0x2d6528){return _0x2d6528[_0x1576('0x24')]()[_0x1576('0x23')](function(){_0x155be8[_0x1576('0x18')](0xcc)[_0x1576('0x17')]();});}};}function handleEntityNotFound(_0x120d22,_0xd7e66a){return function(_0x1a00c4){if(!_0x1a00c4){_0x120d22[_0x1576('0x16')](0x194);}return _0x1a00c4;};}function handleError(_0x1fe62e,_0xe86bb7){_0xe86bb7=_0xe86bb7||0x1f4;return function(_0x425ad7){logger[_0x1576('0x25')](_0x425ad7[_0x1576('0x26')]);if(_0x425ad7[_0x1576('0x27')]){delete _0x425ad7[_0x1576('0x27')];}_0x1fe62e['status'](_0xe86bb7)['send'](_0x425ad7);};}exports[_0x1576('0x28')]=function(_0x46d2e1,_0x1d67f9){var _0x41599b={},_0x212c31={},_0x275957={'count':0x0,'rows':[]};var _0x53dfa5=_[_0x1576('0x29')](db[_0x1576('0x2a')][_0x1576('0x2b')],function(_0x57d4d7){return{'name':_0x57d4d7[_0x1576('0x2c')],'type':_0x57d4d7[_0x1576('0x2d')][_0x1576('0x2e')]};});_0x212c31[_0x1576('0x2f')]=_[_0x1576('0x29')](_0x53dfa5,_0x1576('0x27'));_0x212c31['query']=_['keys'](_0x46d2e1[_0x1576('0x30')]);_0x212c31[_0x1576('0x31')]=_[_0x1576('0x32')](_0x212c31[_0x1576('0x2f')],_0x212c31['query']);_0x41599b['attributes']=_[_0x1576('0x32')](_0x212c31['model'],qs['fields'](_0x46d2e1[_0x1576('0x30')][_0x1576('0x33')]));_0x41599b[_0x1576('0x34')]=_0x41599b[_0x1576('0x34')][_0x1576('0x35')]?_0x41599b[_0x1576('0x34')]:_0x212c31[_0x1576('0x2f')];if(!_0x46d2e1['query'][_0x1576('0x36')](_0x1576('0x37'))){_0x41599b[_0x1576('0x1c')]=qs['limit'](_0x46d2e1[_0x1576('0x30')][_0x1576('0x1c')]);_0x41599b[_0x1576('0x1a')]=qs['offset'](_0x46d2e1[_0x1576('0x30')][_0x1576('0x1a')]);}_0x41599b[_0x1576('0x38')]=qs[_0x1576('0x39')](_0x46d2e1[_0x1576('0x30')]['sort']);_0x41599b['where']=qs[_0x1576('0x31')](_[_0x1576('0x3a')](_0x46d2e1[_0x1576('0x30')],_0x212c31[_0x1576('0x31')]),_0x53dfa5);if(_0x46d2e1[_0x1576('0x30')][_0x1576('0x3b')]){_0x41599b[_0x1576('0x3c')]=_[_0x1576('0x3d')](_0x41599b[_0x1576('0x3c')],{'$or':_[_0x1576('0x29')](_0x53dfa5,function(_0xabf85e){if(_0xabf85e[_0x1576('0x2d')]!==_0x1576('0x3e')){var _0x4876f8={};_0x4876f8[_0xabf85e[_0x1576('0x27')]]={'$like':'%'+_0x46d2e1[_0x1576('0x30')][_0x1576('0x3b')]+'%'};return _0x4876f8;}})});}_0x41599b=_[_0x1576('0x3d')]({},_0x41599b,_0x46d2e1['options']);var _0x340c80={'where':_0x41599b['where']};return db[_0x1576('0x2a')][_0x1576('0x1d')](_0x340c80)[_0x1576('0x23')](function(_0x2f0b72){_0x275957[_0x1576('0x1d')]=_0x2f0b72;if(_0x46d2e1[_0x1576('0x30')][_0x1576('0x3f')]){_0x41599b[_0x1576('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1576('0x41')](_0x41599b);})['then'](function(_0x2d55d8){_0x275957[_0x1576('0x42')]=_0x2d55d8;return _0x275957;})[_0x1576('0x23')](respondWithFilteredResult(_0x1d67f9,_0x41599b))[_0x1576('0x43')](handleError(_0x1d67f9,null));};exports[_0x1576('0x44')]=function(_0x17c846,_0x32db6c){var _0x3c421d={'raw':![],'where':{'id':_0x17c846['params']['id']}},_0x16ef44={};_0x16ef44[_0x1576('0x2f')]=_[_0x1576('0x45')](db['SugarcrmConfiguration']['rawAttributes']);_0x16ef44[_0x1576('0x30')]=_[_0x1576('0x45')](_0x17c846[_0x1576('0x30')]);_0x16ef44[_0x1576('0x31')]=_['intersection'](_0x16ef44['model'],_0x16ef44[_0x1576('0x30')]);_0x3c421d[_0x1576('0x34')]=_[_0x1576('0x32')](_0x16ef44['model'],qs['fields'](_0x17c846[_0x1576('0x30')][_0x1576('0x33')]));_0x3c421d['attributes']=_0x3c421d['attributes'][_0x1576('0x35')]?_0x3c421d['attributes']:_0x16ef44[_0x1576('0x2f')];if(_0x17c846[_0x1576('0x30')][_0x1576('0x3f')]){_0x3c421d[_0x1576('0x40')]=[{'all':!![]}];}_0x3c421d=_[_0x1576('0x3d')]({},_0x3c421d,_0x17c846[_0x1576('0x46')]);return db['SugarcrmConfiguration']['find'](_0x3c421d)[_0x1576('0x23')](handleEntityNotFound(_0x32db6c,null))[_0x1576('0x23')](respondWithResult(_0x32db6c,null))['catch'](handleError(_0x32db6c,null));};exports[_0x1576('0x47')]=function(_0x44a76c,_0x43d75e){return db[_0x1576('0x2a')][_0x1576('0x47')](_0x44a76c['body'],{})[_0x1576('0x23')](respondWithResult(_0x43d75e,0xc9))[_0x1576('0x43')](handleError(_0x43d75e,null));};exports[_0x1576('0x22')]=function(_0x1de558,_0x5d920f){if(_0x1de558['body']['id']){delete _0x1de558['body']['id'];}return db[_0x1576('0x2a')][_0x1576('0x48')]({'where':{'id':_0x1de558[_0x1576('0x49')]['id']}})[_0x1576('0x23')](handleEntityNotFound(_0x5d920f,null))['then'](saveUpdates(_0x1de558['body'],null))[_0x1576('0x23')](respondWithResult(_0x5d920f,null))[_0x1576('0x43')](handleError(_0x5d920f,null));};exports[_0x1576('0x24')]=function(_0x13d19d,_0x292ac4){return db[_0x1576('0x2a')][_0x1576('0x48')]({'where':{'id':_0x13d19d['params']['id']}})[_0x1576('0x23')](handleEntityNotFound(_0x292ac4,null))['then'](removeEntity(_0x292ac4,null))['catch'](handleError(_0x292ac4,null));};exports[_0x1576('0x4a')]=function(_0x414057,_0x571f8e,_0x418904){var _0x33f56a={};var _0x3bd790={};var _0x5529a8;var _0x4f0b2f;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x414057[_0x1576('0x49')]['id']}})['then'](handleEntityNotFound(_0x571f8e,null))[_0x1576('0x23')](function(_0x19f03d){if(_0x19f03d){_0x5529a8=_0x19f03d;_0x3bd790['model']=_[_0x1576('0x45')](db[_0x1576('0x4b')][_0x1576('0x2b')]);_0x3bd790[_0x1576('0x30')]=_['keys'](_0x414057[_0x1576('0x30')]);_0x3bd790[_0x1576('0x31')]=_[_0x1576('0x32')](_0x3bd790[_0x1576('0x2f')],_0x3bd790[_0x1576('0x30')]);_0x33f56a['attributes']=_[_0x1576('0x32')](_0x3bd790[_0x1576('0x2f')],qs[_0x1576('0x33')](_0x414057[_0x1576('0x30')][_0x1576('0x33')]));_0x33f56a[_0x1576('0x34')]=_0x33f56a[_0x1576('0x34')]['length']?_0x33f56a[_0x1576('0x34')]:_0x3bd790['model'];_0x33f56a[_0x1576('0x38')]=qs[_0x1576('0x39')](_0x414057['query'][_0x1576('0x39')]);_0x33f56a[_0x1576('0x3c')]=qs[_0x1576('0x31')](_['pick'](_0x414057[_0x1576('0x30')],_0x3bd790[_0x1576('0x31')]));if(_0x414057[_0x1576('0x30')]['filter']){_0x33f56a[_0x1576('0x3c')]=_[_0x1576('0x3d')](_0x33f56a[_0x1576('0x3c')],{'$or':_[_0x1576('0x29')](_0x33f56a['attributes'],function(_0x58fee6){var _0x53e3ab={};_0x53e3ab[_0x58fee6]={'$like':'%'+_0x414057[_0x1576('0x30')][_0x1576('0x3b')]+'%'};return _0x53e3ab;})});}_0x33f56a=_[_0x1576('0x3d')]({},_0x33f56a,_0x414057[_0x1576('0x46')]);return _0x5529a8['getFields'](_0x33f56a);}})['then'](function(_0x207aff){if(_0x207aff){_0x4f0b2f=_0x207aff['length'];if(!_0x414057[_0x1576('0x30')]['hasOwnProperty'](_0x1576('0x37'))){_0x33f56a[_0x1576('0x1c')]=qs[_0x1576('0x1c')](_0x414057[_0x1576('0x30')][_0x1576('0x1c')]);_0x33f56a[_0x1576('0x1a')]=qs['offset'](_0x414057[_0x1576('0x30')][_0x1576('0x1a')]);}return _0x5529a8['getFields'](_0x33f56a);}})[_0x1576('0x23')](function(_0x2ca972){if(_0x2ca972){return _0x2ca972?{'count':_0x4f0b2f,'rows':_0x2ca972}:null;}})[_0x1576('0x23')](respondWithResult(_0x571f8e,null))['catch'](handleError(_0x571f8e,null));};exports[_0x1576('0x4c')]=function(_0x388ea8,_0x179add,_0x4b171d){var _0x39975b={};var _0xa29dfa={};var _0x368c90;var _0x1c5edb;return db['SugarcrmConfiguration'][_0x1576('0x4d')]({'where':{'id':_0x388ea8[_0x1576('0x49')]['id']}})['then'](handleEntityNotFound(_0x179add,null))[_0x1576('0x23')](function(_0x186c40){if(_0x186c40){_0x368c90=_0x186c40;_0xa29dfa[_0x1576('0x2f')]=_[_0x1576('0x45')](db[_0x1576('0x4b')]['rawAttributes']);_0xa29dfa['query']=_[_0x1576('0x45')](_0x388ea8['query']);_0xa29dfa[_0x1576('0x31')]=_[_0x1576('0x32')](_0xa29dfa[_0x1576('0x2f')],_0xa29dfa[_0x1576('0x30')]);_0x39975b[_0x1576('0x34')]=_[_0x1576('0x32')](_0xa29dfa['model'],qs[_0x1576('0x33')](_0x388ea8[_0x1576('0x30')][_0x1576('0x33')]));_0x39975b[_0x1576('0x34')]=_0x39975b[_0x1576('0x34')][_0x1576('0x35')]?_0x39975b[_0x1576('0x34')]:_0xa29dfa[_0x1576('0x2f')];_0x39975b[_0x1576('0x38')]=qs[_0x1576('0x39')](_0x388ea8[_0x1576('0x30')][_0x1576('0x39')]);_0x39975b['where']=qs[_0x1576('0x31')](_[_0x1576('0x3a')](_0x388ea8[_0x1576('0x30')],_0xa29dfa['filters']));if(_0x388ea8[_0x1576('0x30')][_0x1576('0x3b')]){_0x39975b['where']=_[_0x1576('0x3d')](_0x39975b[_0x1576('0x3c')],{'$or':_['map'](_0x39975b[_0x1576('0x34')],function(_0x563e80){var _0x2b9080={};_0x2b9080[_0x563e80]={'$like':'%'+_0x388ea8['query']['filter']+'%'};return _0x2b9080;})});}_0x39975b=_[_0x1576('0x3d')]({},_0x39975b,_0x388ea8['options']);return _0x368c90[_0x1576('0x4c')](_0x39975b);}})[_0x1576('0x23')](function(_0x158dbd){if(_0x158dbd){_0x1c5edb=_0x158dbd[_0x1576('0x35')];if(!_0x388ea8['query'][_0x1576('0x36')](_0x1576('0x37'))){_0x39975b[_0x1576('0x1c')]=qs[_0x1576('0x1c')](_0x388ea8[_0x1576('0x30')][_0x1576('0x1c')]);_0x39975b['offset']=qs['offset'](_0x388ea8[_0x1576('0x30')][_0x1576('0x1a')]);}return _0x368c90['getSubjects'](_0x39975b);}})[_0x1576('0x23')](function(_0x5ca85d){if(_0x5ca85d){return _0x5ca85d?{'count':_0x1c5edb,'rows':_0x5ca85d}:null;}})[_0x1576('0x23')](respondWithResult(_0x179add,null))['catch'](handleError(_0x179add,null));};exports[_0x1576('0x4e')]=function(_0x2eaefd,_0x5e1117,_0x3b1f15){var _0x5979c3={};var _0xb414ed={};var _0x96c491;var _0x49fe53;return db[_0x1576('0x2a')][_0x1576('0x4d')]({'where':{'id':_0x2eaefd[_0x1576('0x49')]['id']}})[_0x1576('0x23')](handleEntityNotFound(_0x5e1117,null))[_0x1576('0x23')](function(_0x535562){if(_0x535562){_0x96c491=_0x535562;_0xb414ed[_0x1576('0x2f')]=_['keys'](db['SugarcrmField'][_0x1576('0x2b')]);_0xb414ed[_0x1576('0x30')]=_[_0x1576('0x45')](_0x2eaefd[_0x1576('0x30')]);_0xb414ed[_0x1576('0x31')]=_[_0x1576('0x32')](_0xb414ed[_0x1576('0x2f')],_0xb414ed['query']);_0x5979c3[_0x1576('0x34')]=_['intersection'](_0xb414ed[_0x1576('0x2f')],qs[_0x1576('0x33')](_0x2eaefd[_0x1576('0x30')]['fields']));_0x5979c3[_0x1576('0x34')]=_0x5979c3['attributes']['length']?_0x5979c3[_0x1576('0x34')]:_0xb414ed['model'];_0x5979c3[_0x1576('0x38')]=qs[_0x1576('0x39')](_0x2eaefd[_0x1576('0x30')][_0x1576('0x39')]);_0x5979c3['where']=qs[_0x1576('0x31')](_[_0x1576('0x3a')](_0x2eaefd[_0x1576('0x30')],_0xb414ed[_0x1576('0x31')]));if(_0x2eaefd['query'][_0x1576('0x3b')]){_0x5979c3['where']=_[_0x1576('0x3d')](_0x5979c3[_0x1576('0x3c')],{'$or':_[_0x1576('0x29')](_0x5979c3['attributes'],function(_0x157c33){var _0x664018={};_0x664018[_0x157c33]={'$like':'%'+_0x2eaefd[_0x1576('0x30')][_0x1576('0x3b')]+'%'};return _0x664018;})});}_0x5979c3=_[_0x1576('0x3d')]({},_0x5979c3,_0x2eaefd[_0x1576('0x46')]);return _0x96c491[_0x1576('0x4e')](_0x5979c3);}})[_0x1576('0x23')](function(_0xad34dd){if(_0xad34dd){_0x49fe53=_0xad34dd[_0x1576('0x35')];if(!_0x2eaefd[_0x1576('0x30')]['hasOwnProperty'](_0x1576('0x37'))){_0x5979c3[_0x1576('0x1c')]=qs[_0x1576('0x1c')](_0x2eaefd[_0x1576('0x30')][_0x1576('0x1c')]);_0x5979c3[_0x1576('0x1a')]=qs['offset'](_0x2eaefd[_0x1576('0x30')][_0x1576('0x1a')]);}return _0x96c491[_0x1576('0x4e')](_0x5979c3);}})['then'](function(_0x220e1e){if(_0x220e1e){return _0x220e1e?{'count':_0x49fe53,'rows':_0x220e1e}:null;}})[_0x1576('0x23')](respondWithResult(_0x5e1117,null))[_0x1576('0x43')](handleError(_0x5e1117,null));}; \ No newline at end of file +var _0xd41e=['length','attributes','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','keys','create','body','find','getFields','SugarcrmField','rawAttributes','order','getSubjects','findOne','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','error','name','send','map','SugarcrmConfiguration','type','key','query','model','intersection','fields'];(function(_0x7762d6,_0x1934b7){var _0x2627c3=function(_0x2fcf01){while(--_0x2fcf01){_0x7762d6['push'](_0x7762d6['shift']());}};_0x2627c3(++_0x1934b7);}(_0xd41e,0x1e4));var _0xed41=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xd41e[_0x41d02a];return _0x4c3983;};'use strict';var emlformat=require(_0xed41('0x0'));var rimraf=require(_0xed41('0x1'));var zipdir=require(_0xed41('0x2'));var jsonpatch=require(_0xed41('0x3'));var rp=require(_0xed41('0x4'));var moment=require(_0xed41('0x5'));var BPromise=require(_0xed41('0x6'));var Mustache=require(_0xed41('0x7'));var util=require(_0xed41('0x8'));var path=require('path');var sox=require(_0xed41('0x9'));var csv=require(_0xed41('0xa'));var ejs=require(_0xed41('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed41('0xc'));var crypto=require('crypto');var jsforce=require(_0xed41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xed41('0xa'));var querystring=require(_0xed41('0xe'));var Papa=require(_0xed41('0xf'));var Redis=require(_0xed41('0x10'));var authService=require(_0xed41('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed41('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed41('0x13'))('api');var utils=require(_0xed41('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xed41('0x15'));var db=require(_0xed41('0x16'))['db'];function respondWithStatusCode(_0x236a38,_0x15b78c){_0x15b78c=_0x15b78c||0xcc;return function(_0x11fa5b){if(_0x11fa5b){return _0x236a38[_0xed41('0x17')](_0x15b78c);}return _0x236a38[_0xed41('0x18')](_0x15b78c)[_0xed41('0x19')]();};}function respondWithResult(_0x31a797,_0x3b49c9){_0x3b49c9=_0x3b49c9||0xc8;return function(_0x3f1f3b){if(_0x3f1f3b){return _0x31a797[_0xed41('0x18')](_0x3b49c9)[_0xed41('0x1a')](_0x3f1f3b);}};}function respondWithFilteredResult(_0x251b13,_0x1df70f){return function(_0x452ecb){if(_0x452ecb){var _0x47b0f0=typeof _0x1df70f['offset']===_0xed41('0x1b')&&typeof _0x1df70f['limit']===_0xed41('0x1b');var _0x3fd2c6=_0x452ecb[_0xed41('0x1c')];var _0x9cf663=_0x47b0f0?0x0:_0x1df70f[_0xed41('0x1d')];var _0xcb8005=_0x47b0f0?_0x452ecb[_0xed41('0x1c')]:_0x1df70f[_0xed41('0x1d')]+_0x1df70f[_0xed41('0x1e')];var _0x391c1e;if(_0xcb8005>=_0x3fd2c6){_0xcb8005=_0x3fd2c6;_0x391c1e=0xc8;}else{_0x391c1e=0xce;}_0x251b13[_0xed41('0x18')](_0x391c1e);return _0x251b13[_0xed41('0x1f')]('Content-Range',_0x9cf663+'-'+_0xcb8005+'/'+_0x3fd2c6)[_0xed41('0x1a')](_0x452ecb);}return null;};}function patchUpdates(_0x1be986){return function(_0x14f94d){try{jsonpatch['apply'](_0x14f94d,_0x1be986,!![]);}catch(_0x339206){return BPromise[_0xed41('0x20')](_0x339206);}return _0x14f94d[_0xed41('0x21')]();};}function saveUpdates(_0x256afe,_0x2ff4b2){return function(_0x510605){if(_0x510605){return _0x510605[_0xed41('0x22')](_0x256afe)[_0xed41('0x23')](function(_0x425ead){return _0x425ead;});}return null;};}function removeEntity(_0x3e793b,_0x32614d){return function(_0xb2460){if(_0xb2460){return _0xb2460[_0xed41('0x24')]()[_0xed41('0x23')](function(){_0x3e793b[_0xed41('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af7a2,_0x90d3b3){return function(_0x2c7242){if(!_0x2c7242){_0x3af7a2[_0xed41('0x17')](0x194);}return _0x2c7242;};}function handleError(_0x268bcd,_0x1f6141){_0x1f6141=_0x1f6141||0x1f4;return function(_0x2bd51f){logger[_0xed41('0x25')](_0x2bd51f['stack']);if(_0x2bd51f[_0xed41('0x26')]){delete _0x2bd51f[_0xed41('0x26')];}_0x268bcd[_0xed41('0x18')](_0x1f6141)[_0xed41('0x27')](_0x2bd51f);};}exports['index']=function(_0x18e055,_0x4d05be){var _0x7fdbda={},_0x19e554={},_0x5a1c37={'count':0x0,'rows':[]};var _0x409085=_[_0xed41('0x28')](db[_0xed41('0x29')]['rawAttributes'],function(_0x443102){return{'name':_0x443102['fieldName'],'type':_0x443102[_0xed41('0x2a')][_0xed41('0x2b')]};});_0x19e554['model']=_[_0xed41('0x28')](_0x409085,_0xed41('0x26'));_0x19e554[_0xed41('0x2c')]=_['keys'](_0x18e055[_0xed41('0x2c')]);_0x19e554['filters']=_['intersection'](_0x19e554[_0xed41('0x2d')],_0x19e554[_0xed41('0x2c')]);_0x7fdbda['attributes']=_[_0xed41('0x2e')](_0x19e554[_0xed41('0x2d')],qs[_0xed41('0x2f')](_0x18e055[_0xed41('0x2c')]['fields']));_0x7fdbda['attributes']=_0x7fdbda['attributes'][_0xed41('0x30')]?_0x7fdbda[_0xed41('0x31')]:_0x19e554[_0xed41('0x2d')];if(!_0x18e055[_0xed41('0x2c')][_0xed41('0x32')]('nolimit')){_0x7fdbda['limit']=qs[_0xed41('0x1e')](_0x18e055['query'][_0xed41('0x1e')]);_0x7fdbda[_0xed41('0x1d')]=qs['offset'](_0x18e055[_0xed41('0x2c')][_0xed41('0x1d')]);}_0x7fdbda['order']=qs[_0xed41('0x33')](_0x18e055[_0xed41('0x2c')][_0xed41('0x33')]);_0x7fdbda[_0xed41('0x34')]=qs[_0xed41('0x35')](_[_0xed41('0x36')](_0x18e055[_0xed41('0x2c')],_0x19e554[_0xed41('0x35')]),_0x409085);if(_0x18e055['query']['filter']){_0x7fdbda[_0xed41('0x34')]=_[_0xed41('0x37')](_0x7fdbda[_0xed41('0x34')],{'$or':_[_0xed41('0x28')](_0x409085,function(_0x31c8aa){if(_0x31c8aa[_0xed41('0x2a')]!==_0xed41('0x38')){var _0x1001ae={};_0x1001ae[_0x31c8aa['name']]={'$like':'%'+_0x18e055[_0xed41('0x2c')][_0xed41('0x39')]+'%'};return _0x1001ae;}})});}_0x7fdbda=_[_0xed41('0x37')]({},_0x7fdbda,_0x18e055[_0xed41('0x3a')]);var _0x35b5cb={'where':_0x7fdbda[_0xed41('0x34')]};return db[_0xed41('0x29')]['count'](_0x35b5cb)['then'](function(_0x5c84a1){_0x5a1c37['count']=_0x5c84a1;if(_0x18e055[_0xed41('0x2c')]['includeAll']){_0x7fdbda[_0xed41('0x3b')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xed41('0x3c')](_0x7fdbda);})[_0xed41('0x23')](function(_0x297f12){_0x5a1c37['rows']=_0x297f12;return _0x5a1c37;})[_0xed41('0x23')](respondWithFilteredResult(_0x4d05be,_0x7fdbda))[_0xed41('0x3d')](handleError(_0x4d05be,null));};exports[_0xed41('0x3e')]=function(_0x134679,_0x397f67){var _0x1966b2={'raw':![],'where':{'id':_0x134679[_0xed41('0x3f')]['id']}},_0x1bf5f5={};_0x1bf5f5['model']=_[_0xed41('0x40')](db[_0xed41('0x29')]['rawAttributes']);_0x1bf5f5[_0xed41('0x2c')]=_[_0xed41('0x40')](_0x134679[_0xed41('0x2c')]);_0x1bf5f5[_0xed41('0x35')]=_[_0xed41('0x2e')](_0x1bf5f5[_0xed41('0x2d')],_0x1bf5f5[_0xed41('0x2c')]);_0x1966b2[_0xed41('0x31')]=_['intersection'](_0x1bf5f5[_0xed41('0x2d')],qs[_0xed41('0x2f')](_0x134679[_0xed41('0x2c')][_0xed41('0x2f')]));_0x1966b2[_0xed41('0x31')]=_0x1966b2['attributes'][_0xed41('0x30')]?_0x1966b2['attributes']:_0x1bf5f5[_0xed41('0x2d')];if(_0x134679[_0xed41('0x2c')]['includeAll']){_0x1966b2[_0xed41('0x3b')]=[{'all':!![]}];}_0x1966b2=_[_0xed41('0x37')]({},_0x1966b2,_0x134679[_0xed41('0x3a')]);return db[_0xed41('0x29')]['find'](_0x1966b2)[_0xed41('0x23')](handleEntityNotFound(_0x397f67,null))[_0xed41('0x23')](respondWithResult(_0x397f67,null))[_0xed41('0x3d')](handleError(_0x397f67,null));};exports[_0xed41('0x41')]=function(_0x14b158,_0x1118d4){return db[_0xed41('0x29')][_0xed41('0x41')](_0x14b158[_0xed41('0x42')],{})[_0xed41('0x23')](respondWithResult(_0x1118d4,0xc9))[_0xed41('0x3d')](handleError(_0x1118d4,null));};exports[_0xed41('0x22')]=function(_0x174aae,_0xf474f6){if(_0x174aae[_0xed41('0x42')]['id']){delete _0x174aae[_0xed41('0x42')]['id'];}return db[_0xed41('0x29')][_0xed41('0x43')]({'where':{'id':_0x174aae[_0xed41('0x3f')]['id']}})['then'](handleEntityNotFound(_0xf474f6,null))[_0xed41('0x23')](saveUpdates(_0x174aae[_0xed41('0x42')],null))[_0xed41('0x23')](respondWithResult(_0xf474f6,null))[_0xed41('0x3d')](handleError(_0xf474f6,null));};exports[_0xed41('0x24')]=function(_0x49d37,_0x169fa0){return db[_0xed41('0x29')][_0xed41('0x43')]({'where':{'id':_0x49d37['params']['id']}})[_0xed41('0x23')](handleEntityNotFound(_0x169fa0,null))[_0xed41('0x23')](removeEntity(_0x169fa0,null))[_0xed41('0x3d')](handleError(_0x169fa0,null));};exports[_0xed41('0x44')]=function(_0x263150,_0x15eb3c,_0x2ea5fd){var _0x2b6278={};var _0x42e8={};var _0x5691af;var _0xd1e2b5;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x263150[_0xed41('0x3f')]['id']}})[_0xed41('0x23')](handleEntityNotFound(_0x15eb3c,null))[_0xed41('0x23')](function(_0x2d39b2){if(_0x2d39b2){_0x5691af=_0x2d39b2;_0x42e8['model']=_[_0xed41('0x40')](db[_0xed41('0x45')][_0xed41('0x46')]);_0x42e8[_0xed41('0x2c')]=_['keys'](_0x263150[_0xed41('0x2c')]);_0x42e8[_0xed41('0x35')]=_[_0xed41('0x2e')](_0x42e8['model'],_0x42e8[_0xed41('0x2c')]);_0x2b6278[_0xed41('0x31')]=_[_0xed41('0x2e')](_0x42e8['model'],qs[_0xed41('0x2f')](_0x263150['query'][_0xed41('0x2f')]));_0x2b6278[_0xed41('0x31')]=_0x2b6278['attributes'][_0xed41('0x30')]?_0x2b6278[_0xed41('0x31')]:_0x42e8[_0xed41('0x2d')];_0x2b6278[_0xed41('0x47')]=qs['sort'](_0x263150[_0xed41('0x2c')][_0xed41('0x33')]);_0x2b6278[_0xed41('0x34')]=qs[_0xed41('0x35')](_[_0xed41('0x36')](_0x263150[_0xed41('0x2c')],_0x42e8[_0xed41('0x35')]));if(_0x263150[_0xed41('0x2c')]['filter']){_0x2b6278[_0xed41('0x34')]=_['merge'](_0x2b6278['where'],{'$or':_[_0xed41('0x28')](_0x2b6278[_0xed41('0x31')],function(_0x183fb5){var _0x54b8b4={};_0x54b8b4[_0x183fb5]={'$like':'%'+_0x263150[_0xed41('0x2c')][_0xed41('0x39')]+'%'};return _0x54b8b4;})});}_0x2b6278=_[_0xed41('0x37')]({},_0x2b6278,_0x263150['options']);return _0x5691af[_0xed41('0x44')](_0x2b6278);}})[_0xed41('0x23')](function(_0x36a09b){if(_0x36a09b){_0xd1e2b5=_0x36a09b[_0xed41('0x30')];if(!_0x263150[_0xed41('0x2c')]['hasOwnProperty']('nolimit')){_0x2b6278[_0xed41('0x1e')]=qs[_0xed41('0x1e')](_0x263150[_0xed41('0x2c')][_0xed41('0x1e')]);_0x2b6278[_0xed41('0x1d')]=qs[_0xed41('0x1d')](_0x263150[_0xed41('0x2c')][_0xed41('0x1d')]);}return _0x5691af['getFields'](_0x2b6278);}})['then'](function(_0x2ec788){if(_0x2ec788){return _0x2ec788?{'count':_0xd1e2b5,'rows':_0x2ec788}:null;}})[_0xed41('0x23')](respondWithResult(_0x15eb3c,null))[_0xed41('0x3d')](handleError(_0x15eb3c,null));};exports[_0xed41('0x48')]=function(_0x213352,_0x5793b4,_0x5af63d){var _0x5ba0b8={};var _0x2ede23={};var _0x1574aa;var _0x4d349d;return db[_0xed41('0x29')][_0xed41('0x49')]({'where':{'id':_0x213352[_0xed41('0x3f')]['id']}})[_0xed41('0x23')](handleEntityNotFound(_0x5793b4,null))[_0xed41('0x23')](function(_0x4aae34){if(_0x4aae34){_0x1574aa=_0x4aae34;_0x2ede23[_0xed41('0x2d')]=_[_0xed41('0x40')](db['SugarcrmField']['rawAttributes']);_0x2ede23['query']=_[_0xed41('0x40')](_0x213352[_0xed41('0x2c')]);_0x2ede23[_0xed41('0x35')]=_[_0xed41('0x2e')](_0x2ede23[_0xed41('0x2d')],_0x2ede23[_0xed41('0x2c')]);_0x5ba0b8[_0xed41('0x31')]=_[_0xed41('0x2e')](_0x2ede23['model'],qs[_0xed41('0x2f')](_0x213352[_0xed41('0x2c')][_0xed41('0x2f')]));_0x5ba0b8['attributes']=_0x5ba0b8[_0xed41('0x31')][_0xed41('0x30')]?_0x5ba0b8[_0xed41('0x31')]:_0x2ede23[_0xed41('0x2d')];_0x5ba0b8[_0xed41('0x47')]=qs[_0xed41('0x33')](_0x213352[_0xed41('0x2c')][_0xed41('0x33')]);_0x5ba0b8[_0xed41('0x34')]=qs[_0xed41('0x35')](_['pick'](_0x213352[_0xed41('0x2c')],_0x2ede23['filters']));if(_0x213352[_0xed41('0x2c')]['filter']){_0x5ba0b8[_0xed41('0x34')]=_[_0xed41('0x37')](_0x5ba0b8['where'],{'$or':_[_0xed41('0x28')](_0x5ba0b8['attributes'],function(_0x1010c5){var _0x3f561c={};_0x3f561c[_0x1010c5]={'$like':'%'+_0x213352[_0xed41('0x2c')][_0xed41('0x39')]+'%'};return _0x3f561c;})});}_0x5ba0b8=_['merge']({},_0x5ba0b8,_0x213352[_0xed41('0x3a')]);return _0x1574aa[_0xed41('0x48')](_0x5ba0b8);}})[_0xed41('0x23')](function(_0x4496e6){if(_0x4496e6){_0x4d349d=_0x4496e6[_0xed41('0x30')];if(!_0x213352[_0xed41('0x2c')]['hasOwnProperty']('nolimit')){_0x5ba0b8[_0xed41('0x1e')]=qs['limit'](_0x213352[_0xed41('0x2c')][_0xed41('0x1e')]);_0x5ba0b8['offset']=qs[_0xed41('0x1d')](_0x213352[_0xed41('0x2c')][_0xed41('0x1d')]);}return _0x1574aa[_0xed41('0x48')](_0x5ba0b8);}})[_0xed41('0x23')](function(_0x23bbbb){if(_0x23bbbb){return _0x23bbbb?{'count':_0x4d349d,'rows':_0x23bbbb}:null;}})[_0xed41('0x23')](respondWithResult(_0x5793b4,null))[_0xed41('0x3d')](handleError(_0x5793b4,null));};exports[_0xed41('0x4a')]=function(_0x43f838,_0x415cd4,_0x4c101a){var _0x191a0a={};var _0x4146e0={};var _0x3b2f26;var _0x12c2b9;return db[_0xed41('0x29')][_0xed41('0x49')]({'where':{'id':_0x43f838[_0xed41('0x3f')]['id']}})['then'](handleEntityNotFound(_0x415cd4,null))[_0xed41('0x23')](function(_0x2eb558){if(_0x2eb558){_0x3b2f26=_0x2eb558;_0x4146e0[_0xed41('0x2d')]=_['keys'](db[_0xed41('0x45')][_0xed41('0x46')]);_0x4146e0[_0xed41('0x2c')]=_[_0xed41('0x40')](_0x43f838[_0xed41('0x2c')]);_0x4146e0[_0xed41('0x35')]=_[_0xed41('0x2e')](_0x4146e0['model'],_0x4146e0[_0xed41('0x2c')]);_0x191a0a[_0xed41('0x31')]=_['intersection'](_0x4146e0[_0xed41('0x2d')],qs[_0xed41('0x2f')](_0x43f838[_0xed41('0x2c')][_0xed41('0x2f')]));_0x191a0a[_0xed41('0x31')]=_0x191a0a[_0xed41('0x31')][_0xed41('0x30')]?_0x191a0a[_0xed41('0x31')]:_0x4146e0['model'];_0x191a0a[_0xed41('0x47')]=qs[_0xed41('0x33')](_0x43f838['query']['sort']);_0x191a0a['where']=qs[_0xed41('0x35')](_[_0xed41('0x36')](_0x43f838[_0xed41('0x2c')],_0x4146e0[_0xed41('0x35')]));if(_0x43f838[_0xed41('0x2c')][_0xed41('0x39')]){_0x191a0a[_0xed41('0x34')]=_[_0xed41('0x37')](_0x191a0a['where'],{'$or':_[_0xed41('0x28')](_0x191a0a[_0xed41('0x31')],function(_0x1ea9fd){var _0x23adc0={};_0x23adc0[_0x1ea9fd]={'$like':'%'+_0x43f838[_0xed41('0x2c')][_0xed41('0x39')]+'%'};return _0x23adc0;})});}_0x191a0a=_[_0xed41('0x37')]({},_0x191a0a,_0x43f838[_0xed41('0x3a')]);return _0x3b2f26[_0xed41('0x4a')](_0x191a0a);}})['then'](function(_0x506294){if(_0x506294){_0x12c2b9=_0x506294[_0xed41('0x30')];if(!_0x43f838[_0xed41('0x2c')][_0xed41('0x32')](_0xed41('0x4b'))){_0x191a0a[_0xed41('0x1e')]=qs[_0xed41('0x1e')](_0x43f838[_0xed41('0x2c')][_0xed41('0x1e')]);_0x191a0a['offset']=qs[_0xed41('0x1d')](_0x43f838['query'][_0xed41('0x1d')]);}return _0x3b2f26[_0xed41('0x4a')](_0x191a0a);}})['then'](function(_0x555c95){if(_0x555c95){return _0x555c95?{'count':_0x12c2b9,'rows':_0x555c95}:null;}})[_0xed41('0x23')](respondWithResult(_0x415cd4,null))[_0xed41('0x3d')](handleError(_0x415cd4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a327d9e..f1d407b 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 _0x9cdd=['util','api','moment','path','rimraf','exports','define','lodash'];(function(_0x4d2cb3,_0x37ae86){var _0x452695=function(_0x7b923f){while(--_0x7b923f){_0x4d2cb3['push'](_0x4d2cb3['shift']());}};_0x452695(++_0x37ae86);}(_0x9cdd,0x8f));var _0xd9cd=function(_0x3a953a,_0x46c161){_0x3a953a=_0x3a953a-0x0;var _0x2f81d1=_0x9cdd[_0x3a953a];return _0x2f81d1;};'use strict';var _=require(_0xd9cd('0x0'));var util=require(_0xd9cd('0x1'));var logger=require('../../config/logger')(_0xd9cd('0x2'));var moment=require(_0xd9cd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9cd('0x4'));var rimraf=require(_0xd9cd('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xd9cd('0x6')]=function(_0x5dd2de,_0x50f8ce){return _0x5dd2de[_0xd9cd('0x7')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc569=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x277079,_0x511204){var _0x205a0b=function(_0x4f7df8){while(--_0x4f7df8){_0x277079['push'](_0x277079['shift']());}};_0x205a0b(++_0x511204);}(_0xc569,0xf4));var _0x9c56=function(_0x2d0c1d,_0x273257){_0x2d0c1d=_0x2d0c1d-0x0;var _0x8aa29c=_0xc569[_0x2d0c1d];return _0x8aa29c;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var logger=require(_0x9c56('0x2'))(_0x9c56('0x3'));var moment=require(_0x9c56('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c56('0x5'));var fs=require('fs');var path=require(_0x9c56('0x6'));var rimraf=require('rimraf');var config=require(_0x9c56('0x7'));var attributes=require(_0x9c56('0x8'));module[_0x9c56('0x9')]=function(_0x41fa66,_0x2b66f2){return _0x41fa66['define'](_0x9c56('0xa'),attributes,{'tableName':_0x9c56('0xb'),'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 be61b43..2d4aa76 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 _0x3667=['error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4cf711,_0xb8759f){var _0x214daf=function(_0x21eb62){while(--_0x21eb62){_0x4cf711['push'](_0x4cf711['shift']());}};_0x214daf(++_0xb8759f);}(_0x3667,0x78));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require('util');var moment=require(_0x7366('0x1'));var BPromise=require(_0x7366('0x2'));var rs=require(_0x7366('0x3'));var fs=require('fs');var Redis=require(_0x7366('0x4'));var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require(_0x7366('0x7'))(_0x7366('0x8'));var config=require(_0x7366('0x9'));var jayson=require(_0x7366('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2456cb,_0x5f0d8f,_0x2b9f4e){return new BPromise(function(_0x28f20d,_0x26c4bf){return client[_0x7366('0xb')](_0x2456cb,_0x2b9f4e)[_0x7366('0xc')](function(_0x26e170){logger[_0x7366('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5f0d8f,_0x7366('0xe'));logger[_0x7366('0xf')](_0x7366('0x10'),_0x5f0d8f,'request\x20sent',JSON[_0x7366('0x11')](_0x26e170));if(_0x26e170[_0x7366('0x12')]){if(_0x26e170[_0x7366('0x12')]['code']===0x1f4){logger[_0x7366('0x12')](_0x7366('0x13'),_0x5f0d8f,_0x26e170[_0x7366('0x12')][_0x7366('0x14')]);return _0x26c4bf(_0x26e170['error'][_0x7366('0x14')]);}logger[_0x7366('0x12')](_0x7366('0x13'),_0x5f0d8f,_0x26e170['error'][_0x7366('0x14')]);return _0x28f20d(_0x26e170[_0x7366('0x12')][_0x7366('0x14')]);}else{logger[_0x7366('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5f0d8f,_0x7366('0xe'));_0x28f20d(_0x26e170[_0x7366('0x15')][_0x7366('0x14')]);}})[_0x7366('0x16')](function(_0x534c70){logger[_0x7366('0x12')](_0x7366('0x13'),_0x5f0d8f,_0x534c70);_0x26c4bf(_0x534c70);});});} \ No newline at end of file +var _0x0096=['jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49998a,_0x27d4f2){var _0x51a91f=function(_0x4f7ed2){while(--_0x4f7ed2){_0x49998a['push'](_0x49998a['shift']());}};_0x51a91f(++_0x27d4f2);}(_0x0096,0x13d));var _0x6009=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0x0096[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0x6009('0x0'));var util=require('util');var moment=require(_0x6009('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6009('0x2'))['db'];var utils=require(_0x6009('0x3'));var logger=require(_0x6009('0x4'))(_0x6009('0x5'));var config=require(_0x6009('0x6'));var jayson=require(_0x6009('0x7'));var client=jayson[_0x6009('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341b47,_0x108b78,_0x2c7dfe){return new BPromise(function(_0x441fef,_0x42448a){return client['request'](_0x341b47,_0x2c7dfe)[_0x6009('0x9')](function(_0x516a7b){logger[_0x6009('0xa')](_0x6009('0xb'),_0x108b78,_0x6009('0xc'));logger[_0x6009('0xd')](_0x6009('0xe'),_0x108b78,_0x6009('0xc'),JSON[_0x6009('0xf')](_0x516a7b));if(_0x516a7b['error']){if(_0x516a7b[_0x6009('0x10')]['code']===0x1f4){logger['error'](_0x6009('0xb'),_0x108b78,_0x516a7b[_0x6009('0x10')]['message']);return _0x42448a(_0x516a7b['error'][_0x6009('0x11')]);}logger[_0x6009('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x108b78,_0x516a7b[_0x6009('0x10')][_0x6009('0x11')]);return _0x441fef(_0x516a7b['error'][_0x6009('0x11')]);}else{logger['info'](_0x6009('0xb'),_0x108b78,'request\x20sent');_0x441fef(_0x516a7b['result'][_0x6009('0x11')]);}})['catch'](function(_0x5a7c64){logger[_0x6009('0x10')](_0x6009('0xb'),_0x108b78,_0x5a7c64);_0x42448a(_0x5a7c64);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index df323b2..596cac4 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 _0xac58=['index','show','post','/:id','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xac58,0x14b));var _0x8ac5=function(_0x209995,_0x2ce275){_0x209995=_0x209995-0x0;var _0x266f67=_0xac58[_0x209995];return _0x266f67;};'use strict';var multer=require(_0x8ac5('0x0'));var util=require(_0x8ac5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ac5('0x2'));var router=express[_0x8ac5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ac5('0x4'));var interaction=require(_0x8ac5('0x5'));var config=require(_0x8ac5('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x8ac5('0x7')]('/',auth[_0x8ac5('0x8')](),controller[_0x8ac5('0x9')]);router[_0x8ac5('0x7')]('/:id',auth[_0x8ac5('0x8')](),controller[_0x8ac5('0xa')]);router[_0x8ac5('0xb')]('/',auth[_0x8ac5('0x8')](),controller['create']);router['put'](_0x8ac5('0xc'),auth[_0x8ac5('0x8')](),controller[_0x8ac5('0xd')]);router[_0x8ac5('0xe')](_0x8ac5('0xc'),auth['isAuthenticated'](),controller[_0x8ac5('0xf')]);module[_0x8ac5('0x10')]=router; \ No newline at end of file +var _0x665b=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x665b,0xd2));var _0xb665=function(_0x53e57c,_0x37c9e7){_0x53e57c=_0x53e57c-0x0;var _0x3782fa=_0x665b[_0x53e57c];return _0x3782fa;};'use strict';var multer=require(_0xb665('0x0'));var util=require(_0xb665('0x1'));var path=require(_0xb665('0x2'));var timeout=require('connect-timeout');var express=require(_0xb665('0x3'));var router=express[_0xb665('0x4')]();var fs_extra=require(_0xb665('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb665('0x6'));var config=require('../../config/environment');var controller=require(_0xb665('0x7'));router[_0xb665('0x8')]('/',auth[_0xb665('0x9')](),controller[_0xb665('0xa')]);router[_0xb665('0x8')](_0xb665('0xb'),auth['isAuthenticated'](),controller[_0xb665('0xc')]);router[_0xb665('0xd')]('/',auth[_0xb665('0x9')](),controller[_0xb665('0xe')]);router[_0xb665('0xf')](_0xb665('0xb'),auth[_0xb665('0x9')](),controller['update']);router[_0xb665('0x10')](_0xb665('0xb'),auth[_0xb665('0x9')](),controller[_0xb665('0x11')]);module[_0xb665('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index ef7e96e..0883536 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 _0x03b9=['ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x03b9,0x1af));var _0x903b=function(_0x555331,_0x5019dd){_0x555331=_0x555331-0x0;var _0x381363=_0x03b9[_0x555331];return _0x381363;};'use strict';var Sequelize=require('sequelize');module[_0x903b('0x0')]={'type':{'type':Sequelize[_0x903b('0x1')](_0x903b('0x2'),_0x903b('0x3'),'customVariable',_0x903b('0x4'),_0x903b('0x5')),'defaultValue':_0x903b('0x2')},'content':{'type':Sequelize[_0x903b('0x6')]},'key':{'type':Sequelize[_0x903b('0x6')]},'keyType':{'type':Sequelize[_0x903b('0x1')](_0x903b('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x903b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x903b('0x6')]},'customField':{'type':Sequelize[_0x903b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x903b('0x6')]}}; \ No newline at end of file +var _0x4d74=['string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4d74,0x142));var _0x44d7=function(_0x1734ab,_0x254bb2){_0x1734ab=_0x1734ab-0x0;var _0x41008e=_0x4d74[_0x1734ab];return _0x41008e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x44d7('0x0'),'variable',_0x44d7('0x1'),_0x44d7('0x2'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x44d7('0x3')]},'key':{'type':Sequelize[_0x44d7('0x3')]},'keyType':{'type':Sequelize[_0x44d7('0x4')](_0x44d7('0x0'),_0x44d7('0x5'),_0x44d7('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x44d7('0x3')]},'nameField':{'type':Sequelize[_0x44d7('0x3')]},'customField':{'type':Sequelize[_0x44d7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x44d7('0x3')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 3a7217a..9ec1b60 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 _0xdddc=['error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','destroy','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xdddc,0x15b));var _0xcddd=function(_0x38f66c,_0x32fdd8){_0x38f66c=_0x38f66c-0x0;var _0x4761f5=_0xdddc[_0x38f66c];return _0x4761f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcddd('0x0'));var zipdir=require(_0xcddd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcddd('0x2'));var moment=require(_0xcddd('0x3'));var BPromise=require(_0xcddd('0x4'));var Mustache=require(_0xcddd('0x5'));var util=require(_0xcddd('0x6'));var path=require(_0xcddd('0x7'));var sox=require(_0xcddd('0x8'));var csv=require(_0xcddd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcddd('0xa'));var _=require(_0xcddd('0xb'));var squel=require(_0xcddd('0xc'));var crypto=require('crypto');var jsforce=require(_0xcddd('0xd'));var deskjs=require(_0xcddd('0xe'));var toCsv=require(_0xcddd('0x9'));var querystring=require('querystring');var Papa=require(_0xcddd('0xf'));var Redis=require(_0xcddd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcddd('0x11'));var as=require(_0xcddd('0x12'));var hardwareService=require(_0xcddd('0x13'));var logger=require(_0xcddd('0x14'))(_0xcddd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcddd('0x16'));var db=require(_0xcddd('0x17'))['db'];function respondWithStatusCode(_0xad7922,_0x1e8584){_0x1e8584=_0x1e8584||0xcc;return function(_0x5e13f1){if(_0x5e13f1){return _0xad7922[_0xcddd('0x18')](_0x1e8584);}return _0xad7922[_0xcddd('0x19')](_0x1e8584)['end']();};}function respondWithResult(_0x24df75,_0x1dc986){_0x1dc986=_0x1dc986||0xc8;return function(_0xf01731){if(_0xf01731){return _0x24df75['status'](_0x1dc986)[_0xcddd('0x1a')](_0xf01731);}};}function respondWithFilteredResult(_0x1ae472,_0x1b4bd5){return function(_0xe1c867){if(_0xe1c867){var _0x49d268=typeof _0x1b4bd5[_0xcddd('0x1b')]===_0xcddd('0x1c')&&typeof _0x1b4bd5[_0xcddd('0x1d')]===_0xcddd('0x1c');var _0x2dd56e=_0xe1c867[_0xcddd('0x1e')];var _0x4c25f4=_0x49d268?0x0:_0x1b4bd5['offset'];var _0x22afe0=_0x49d268?_0xe1c867['count']:_0x1b4bd5[_0xcddd('0x1b')]+_0x1b4bd5[_0xcddd('0x1d')];var _0x1c5f23;if(_0x22afe0>=_0x2dd56e){_0x22afe0=_0x2dd56e;_0x1c5f23=0xc8;}else{_0x1c5f23=0xce;}_0x1ae472['status'](_0x1c5f23);return _0x1ae472[_0xcddd('0x1f')](_0xcddd('0x20'),_0x4c25f4+'-'+_0x22afe0+'/'+_0x2dd56e)['json'](_0xe1c867);}return null;};}function patchUpdates(_0x31007a){return function(_0x1061c1){try{jsonpatch[_0xcddd('0x21')](_0x1061c1,_0x31007a,!![]);}catch(_0x13d6c7){return BPromise[_0xcddd('0x22')](_0x13d6c7);}return _0x1061c1[_0xcddd('0x23')]();};}function saveUpdates(_0x533b3e,_0x4d9b52){return function(_0x401f5b){if(_0x401f5b){return _0x401f5b['update'](_0x533b3e)[_0xcddd('0x24')](function(_0x2da2aa){return _0x2da2aa;});}return null;};}function removeEntity(_0x27dc71,_0x47fd41){return function(_0x58d24f){if(_0x58d24f){return _0x58d24f['destroy']()[_0xcddd('0x24')](function(){_0x27dc71[_0xcddd('0x19')](0xcc)[_0xcddd('0x25')]();});}};}function handleEntityNotFound(_0x418ec4,_0x3a3ee1){return function(_0x42b7b8){if(!_0x42b7b8){_0x418ec4[_0xcddd('0x18')](0x194);}return _0x42b7b8;};}function handleError(_0x5d8c51,_0x5037d1){_0x5037d1=_0x5037d1||0x1f4;return function(_0x487dc3){logger[_0xcddd('0x26')](_0x487dc3[_0xcddd('0x27')]);if(_0x487dc3[_0xcddd('0x28')]){delete _0x487dc3[_0xcddd('0x28')];}_0x5d8c51[_0xcddd('0x19')](_0x5037d1)[_0xcddd('0x29')](_0x487dc3);};}exports[_0xcddd('0x2a')]=function(_0xa8b29c,_0x3d1e54){var _0x3080cf={},_0x1c3df1={},_0x31b4a6={'count':0x0,'rows':[]};var _0x26b2f2=_[_0xcddd('0x2b')](db[_0xcddd('0x2c')][_0xcddd('0x2d')],function(_0x285bff){return{'name':_0x285bff[_0xcddd('0x2e')],'type':_0x285bff[_0xcddd('0x2f')][_0xcddd('0x30')]};});_0x1c3df1[_0xcddd('0x31')]=_[_0xcddd('0x2b')](_0x26b2f2,'name');_0x1c3df1[_0xcddd('0x32')]=_[_0xcddd('0x33')](_0xa8b29c[_0xcddd('0x32')]);_0x1c3df1[_0xcddd('0x34')]=_[_0xcddd('0x35')](_0x1c3df1[_0xcddd('0x31')],_0x1c3df1[_0xcddd('0x32')]);_0x3080cf[_0xcddd('0x36')]=_[_0xcddd('0x35')](_0x1c3df1[_0xcddd('0x31')],qs['fields'](_0xa8b29c[_0xcddd('0x32')][_0xcddd('0x37')]));_0x3080cf[_0xcddd('0x36')]=_0x3080cf[_0xcddd('0x36')][_0xcddd('0x38')]?_0x3080cf[_0xcddd('0x36')]:_0x1c3df1[_0xcddd('0x31')];if(!_0xa8b29c['query'][_0xcddd('0x39')](_0xcddd('0x3a'))){_0x3080cf[_0xcddd('0x1d')]=qs[_0xcddd('0x1d')](_0xa8b29c[_0xcddd('0x32')]['limit']);_0x3080cf['offset']=qs[_0xcddd('0x1b')](_0xa8b29c[_0xcddd('0x32')][_0xcddd('0x1b')]);}_0x3080cf[_0xcddd('0x3b')]=qs[_0xcddd('0x3c')](_0xa8b29c[_0xcddd('0x32')][_0xcddd('0x3c')]);_0x3080cf['where']=qs[_0xcddd('0x34')](_[_0xcddd('0x3d')](_0xa8b29c[_0xcddd('0x32')],_0x1c3df1[_0xcddd('0x34')]),_0x26b2f2);if(_0xa8b29c[_0xcddd('0x32')][_0xcddd('0x3e')]){_0x3080cf['where']=_[_0xcddd('0x3f')](_0x3080cf[_0xcddd('0x40')],{'$or':_[_0xcddd('0x2b')](_0x26b2f2,function(_0xfb57e3){if(_0xfb57e3[_0xcddd('0x2f')]!==_0xcddd('0x41')){var _0x1de121={};_0x1de121[_0xfb57e3[_0xcddd('0x28')]]={'$like':'%'+_0xa8b29c['query'][_0xcddd('0x3e')]+'%'};return _0x1de121;}})});}_0x3080cf=_[_0xcddd('0x3f')]({},_0x3080cf,_0xa8b29c[_0xcddd('0x42')]);var _0x2b2524={'where':_0x3080cf[_0xcddd('0x40')]};return db['SugarcrmField'][_0xcddd('0x1e')](_0x2b2524)[_0xcddd('0x24')](function(_0x2e726f){_0x31b4a6[_0xcddd('0x1e')]=_0x2e726f;if(_0xa8b29c[_0xcddd('0x32')][_0xcddd('0x43')]){_0x3080cf['include']=[{'all':!![]}];}return db[_0xcddd('0x2c')][_0xcddd('0x44')](_0x3080cf);})[_0xcddd('0x24')](function(_0x19a2e4){_0x31b4a6[_0xcddd('0x45')]=_0x19a2e4;return _0x31b4a6;})[_0xcddd('0x24')](respondWithFilteredResult(_0x3d1e54,_0x3080cf))[_0xcddd('0x46')](handleError(_0x3d1e54,null));};exports['show']=function(_0x695626,_0x4f18c5){var _0x499767={'raw':!![],'where':{'id':_0x695626['params']['id']}},_0x49b7cb={};_0x49b7cb[_0xcddd('0x31')]=_[_0xcddd('0x33')](db[_0xcddd('0x2c')]['rawAttributes']);_0x49b7cb[_0xcddd('0x32')]=_[_0xcddd('0x33')](_0x695626[_0xcddd('0x32')]);_0x49b7cb['filters']=_['intersection'](_0x49b7cb['model'],_0x49b7cb[_0xcddd('0x32')]);_0x499767[_0xcddd('0x36')]=_[_0xcddd('0x35')](_0x49b7cb['model'],qs['fields'](_0x695626[_0xcddd('0x32')][_0xcddd('0x37')]));_0x499767['attributes']=_0x499767[_0xcddd('0x36')][_0xcddd('0x38')]?_0x499767[_0xcddd('0x36')]:_0x49b7cb[_0xcddd('0x31')];if(_0x695626[_0xcddd('0x32')][_0xcddd('0x43')]){_0x499767[_0xcddd('0x47')]=[{'all':!![]}];}_0x499767=_[_0xcddd('0x3f')]({},_0x499767,_0x695626['options']);return db[_0xcddd('0x2c')][_0xcddd('0x48')](_0x499767)['then'](handleEntityNotFound(_0x4f18c5,null))['then'](respondWithResult(_0x4f18c5,null))[_0xcddd('0x46')](handleError(_0x4f18c5,null));};exports[_0xcddd('0x49')]=function(_0x456075,_0x45925a){return db[_0xcddd('0x2c')][_0xcddd('0x49')](_0x456075['body'],{})[_0xcddd('0x24')](respondWithResult(_0x45925a,0xc9))[_0xcddd('0x46')](handleError(_0x45925a,null));};exports['update']=function(_0x17f66b,_0x50508f){if(_0x17f66b[_0xcddd('0x4a')]['id']){delete _0x17f66b[_0xcddd('0x4a')]['id'];}return db[_0xcddd('0x2c')][_0xcddd('0x48')]({'where':{'id':_0x17f66b['params']['id']}})[_0xcddd('0x24')](handleEntityNotFound(_0x50508f,null))[_0xcddd('0x24')](saveUpdates(_0x17f66b[_0xcddd('0x4a')],null))[_0xcddd('0x24')](respondWithResult(_0x50508f,null))['catch'](handleError(_0x50508f,null));};exports[_0xcddd('0x4b')]=function(_0x1e449b,_0x4de7dd){return db[_0xcddd('0x2c')][_0xcddd('0x48')]({'where':{'id':_0x1e449b[_0xcddd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4de7dd,null))[_0xcddd('0x24')](removeEntity(_0x4de7dd,null))[_0xcddd('0x46')](handleError(_0x4de7dd,null));}; \ No newline at end of file +var _0x3ccb=['count','apply','reject','update','destroy','then','error','stack','name','send','index','SugarcrmField','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','rows','params','catch','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3ccb,0xfd));var _0xb3cc=function(_0x32ce31,_0x2f87d2){_0x32ce31=_0x32ce31-0x0;var _0xf13059=_0x3ccb[_0x32ce31];return _0xf13059;};'use strict';var emlformat=require(_0xb3cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb3cc('0x1'));var rp=require(_0xb3cc('0x2'));var moment=require(_0xb3cc('0x3'));var BPromise=require(_0xb3cc('0x4'));var Mustache=require(_0xb3cc('0x5'));var util=require(_0xb3cc('0x6'));var path=require(_0xb3cc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb3cc('0x8'));var fs=require('fs');var fs_extra=require(_0xb3cc('0x9'));var _=require(_0xb3cc('0xa'));var squel=require(_0xb3cc('0xb'));var crypto=require(_0xb3cc('0xc'));var jsforce=require(_0xb3cc('0xd'));var deskjs=require(_0xb3cc('0xe'));var toCsv=require(_0xb3cc('0xf'));var querystring=require(_0xb3cc('0x10'));var Papa=require('papaparse');var Redis=require(_0xb3cc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3cc('0x12'));var logger=require(_0xb3cc('0x13'))(_0xb3cc('0x14'));var utils=require(_0xb3cc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb3cc('0x16'));var db=require(_0xb3cc('0x17'))['db'];function respondWithStatusCode(_0x13d77d,_0x3291c3){_0x3291c3=_0x3291c3||0xcc;return function(_0x3d154f){if(_0x3d154f){return _0x13d77d[_0xb3cc('0x18')](_0x3291c3);}return _0x13d77d[_0xb3cc('0x19')](_0x3291c3)[_0xb3cc('0x1a')]();};}function respondWithResult(_0x24e2ec,_0xf458e7){_0xf458e7=_0xf458e7||0xc8;return function(_0xce81b7){if(_0xce81b7){return _0x24e2ec[_0xb3cc('0x19')](_0xf458e7)[_0xb3cc('0x1b')](_0xce81b7);}};}function respondWithFilteredResult(_0x5ae88d,_0x485ff6){return function(_0x6f25ba){if(_0x6f25ba){var _0x3680bb=typeof _0x485ff6[_0xb3cc('0x1c')]===_0xb3cc('0x1d')&&typeof _0x485ff6[_0xb3cc('0x1e')]===_0xb3cc('0x1d');var _0x1e566d=_0x6f25ba[_0xb3cc('0x1f')];var _0x28bf94=_0x3680bb?0x0:_0x485ff6['offset'];var _0x1dea49=_0x3680bb?_0x6f25ba[_0xb3cc('0x1f')]:_0x485ff6[_0xb3cc('0x1c')]+_0x485ff6[_0xb3cc('0x1e')];var _0x450f18;if(_0x1dea49>=_0x1e566d){_0x1dea49=_0x1e566d;_0x450f18=0xc8;}else{_0x450f18=0xce;}_0x5ae88d[_0xb3cc('0x19')](_0x450f18);return _0x5ae88d['set']('Content-Range',_0x28bf94+'-'+_0x1dea49+'/'+_0x1e566d)[_0xb3cc('0x1b')](_0x6f25ba);}return null;};}function patchUpdates(_0x267fa8){return function(_0x2e8b3b){try{jsonpatch[_0xb3cc('0x20')](_0x2e8b3b,_0x267fa8,!![]);}catch(_0x27526a){return BPromise[_0xb3cc('0x21')](_0x27526a);}return _0x2e8b3b['save']();};}function saveUpdates(_0x55b594,_0x52443d){return function(_0x2caeec){if(_0x2caeec){return _0x2caeec[_0xb3cc('0x22')](_0x55b594)['then'](function(_0x2b2f58){return _0x2b2f58;});}return null;};}function removeEntity(_0x3e8f89,_0x4bd75d){return function(_0x417ae7){if(_0x417ae7){return _0x417ae7[_0xb3cc('0x23')]()[_0xb3cc('0x24')](function(){_0x3e8f89[_0xb3cc('0x19')](0xcc)[_0xb3cc('0x1a')]();});}};}function handleEntityNotFound(_0x5bd29f,_0x20d590){return function(_0x4c5b23){if(!_0x4c5b23){_0x5bd29f[_0xb3cc('0x18')](0x194);}return _0x4c5b23;};}function handleError(_0x16d9e0,_0x2e2229){_0x2e2229=_0x2e2229||0x1f4;return function(_0x5d64f2){logger[_0xb3cc('0x25')](_0x5d64f2[_0xb3cc('0x26')]);if(_0x5d64f2[_0xb3cc('0x27')]){delete _0x5d64f2[_0xb3cc('0x27')];}_0x16d9e0['status'](_0x2e2229)[_0xb3cc('0x28')](_0x5d64f2);};}exports[_0xb3cc('0x29')]=function(_0x465f3c,_0x54673a){var _0x560cdb={},_0x2adf01={},_0x2e00a9={'count':0x0,'rows':[]};var _0x1bf5df=_['map'](db[_0xb3cc('0x2a')]['rawAttributes'],function(_0x4ae166){return{'name':_0x4ae166[_0xb3cc('0x2b')],'type':_0x4ae166[_0xb3cc('0x2c')][_0xb3cc('0x2d')]};});_0x2adf01['model']=_['map'](_0x1bf5df,_0xb3cc('0x27'));_0x2adf01[_0xb3cc('0x2e')]=_[_0xb3cc('0x2f')](_0x465f3c[_0xb3cc('0x2e')]);_0x2adf01[_0xb3cc('0x30')]=_[_0xb3cc('0x31')](_0x2adf01[_0xb3cc('0x32')],_0x2adf01[_0xb3cc('0x2e')]);_0x560cdb['attributes']=_[_0xb3cc('0x31')](_0x2adf01[_0xb3cc('0x32')],qs[_0xb3cc('0x33')](_0x465f3c[_0xb3cc('0x2e')][_0xb3cc('0x33')]));_0x560cdb['attributes']=_0x560cdb['attributes'][_0xb3cc('0x34')]?_0x560cdb[_0xb3cc('0x35')]:_0x2adf01[_0xb3cc('0x32')];if(!_0x465f3c[_0xb3cc('0x2e')]['hasOwnProperty'](_0xb3cc('0x36'))){_0x560cdb[_0xb3cc('0x1e')]=qs['limit'](_0x465f3c[_0xb3cc('0x2e')][_0xb3cc('0x1e')]);_0x560cdb[_0xb3cc('0x1c')]=qs[_0xb3cc('0x1c')](_0x465f3c[_0xb3cc('0x2e')][_0xb3cc('0x1c')]);}_0x560cdb['order']=qs[_0xb3cc('0x37')](_0x465f3c['query']['sort']);_0x560cdb['where']=qs[_0xb3cc('0x30')](_[_0xb3cc('0x38')](_0x465f3c['query'],_0x2adf01['filters']),_0x1bf5df);if(_0x465f3c[_0xb3cc('0x2e')][_0xb3cc('0x39')]){_0x560cdb[_0xb3cc('0x3a')]=_[_0xb3cc('0x3b')](_0x560cdb['where'],{'$or':_[_0xb3cc('0x3c')](_0x1bf5df,function(_0x331aca){if(_0x331aca[_0xb3cc('0x2c')]!==_0xb3cc('0x3d')){var _0x1b679c={};_0x1b679c[_0x331aca[_0xb3cc('0x27')]]={'$like':'%'+_0x465f3c[_0xb3cc('0x2e')]['filter']+'%'};return _0x1b679c;}})});}_0x560cdb=_['merge']({},_0x560cdb,_0x465f3c[_0xb3cc('0x3e')]);var _0x4552fb={'where':_0x560cdb['where']};return db[_0xb3cc('0x2a')]['count'](_0x4552fb)[_0xb3cc('0x24')](function(_0x481ba1){_0x2e00a9['count']=_0x481ba1;if(_0x465f3c[_0xb3cc('0x2e')][_0xb3cc('0x3f')]){_0x560cdb[_0xb3cc('0x40')]=[{'all':!![]}];}return db[_0xb3cc('0x2a')]['findAll'](_0x560cdb);})['then'](function(_0x5dc4df){_0x2e00a9[_0xb3cc('0x41')]=_0x5dc4df;return _0x2e00a9;})['then'](respondWithFilteredResult(_0x54673a,_0x560cdb))['catch'](handleError(_0x54673a,null));};exports['show']=function(_0x530093,_0x2cd137){var _0x57f73a={'raw':!![],'where':{'id':_0x530093[_0xb3cc('0x42')]['id']}},_0xfcd599={};_0xfcd599['model']=_[_0xb3cc('0x2f')](db[_0xb3cc('0x2a')]['rawAttributes']);_0xfcd599[_0xb3cc('0x2e')]=_['keys'](_0x530093[_0xb3cc('0x2e')]);_0xfcd599[_0xb3cc('0x30')]=_[_0xb3cc('0x31')](_0xfcd599[_0xb3cc('0x32')],_0xfcd599[_0xb3cc('0x2e')]);_0x57f73a[_0xb3cc('0x35')]=_[_0xb3cc('0x31')](_0xfcd599[_0xb3cc('0x32')],qs[_0xb3cc('0x33')](_0x530093[_0xb3cc('0x2e')][_0xb3cc('0x33')]));_0x57f73a[_0xb3cc('0x35')]=_0x57f73a[_0xb3cc('0x35')]['length']?_0x57f73a[_0xb3cc('0x35')]:_0xfcd599[_0xb3cc('0x32')];if(_0x530093[_0xb3cc('0x2e')][_0xb3cc('0x3f')]){_0x57f73a[_0xb3cc('0x40')]=[{'all':!![]}];}_0x57f73a=_['merge']({},_0x57f73a,_0x530093[_0xb3cc('0x3e')]);return db[_0xb3cc('0x2a')]['find'](_0x57f73a)[_0xb3cc('0x24')](handleEntityNotFound(_0x2cd137,null))['then'](respondWithResult(_0x2cd137,null))[_0xb3cc('0x43')](handleError(_0x2cd137,null));};exports['create']=function(_0x4f39af,_0x536253){return db[_0xb3cc('0x2a')][_0xb3cc('0x44')](_0x4f39af[_0xb3cc('0x45')],{})['then'](respondWithResult(_0x536253,0xc9))['catch'](handleError(_0x536253,null));};exports[_0xb3cc('0x22')]=function(_0x5cf941,_0x2f044f){if(_0x5cf941[_0xb3cc('0x45')]['id']){delete _0x5cf941['body']['id'];}return db[_0xb3cc('0x2a')][_0xb3cc('0x46')]({'where':{'id':_0x5cf941[_0xb3cc('0x42')]['id']}})[_0xb3cc('0x24')](handleEntityNotFound(_0x2f044f,null))[_0xb3cc('0x24')](saveUpdates(_0x5cf941[_0xb3cc('0x45')],null))[_0xb3cc('0x24')](respondWithResult(_0x2f044f,null))['catch'](handleError(_0x2f044f,null));};exports[_0xb3cc('0x23')]=function(_0x3e205a,_0x2b20c6){return db[_0xb3cc('0x2a')]['find']({'where':{'id':_0x3e205a['params']['id']}})[_0xb3cc('0x24')](handleEntityNotFound(_0x2b20c6,null))[_0xb3cc('0x24')](removeEntity(_0x2b20c6,null))[_0xb3cc('0x43')](handleError(_0x2b20c6,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 420e4c0..bd714a7 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 _0x1a5d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash'];(function(_0x13830b,_0x3c80fa){var _0xfd2472=function(_0x297ed1){while(--_0x297ed1){_0x13830b['push'](_0x13830b['shift']());}};_0xfd2472(++_0x3c80fa);}(_0x1a5d,0x7f));var _0xd1a5=function(_0x27e6ce,_0x56e78f){_0x27e6ce=_0x27e6ce-0x0;var _0x3484e8=_0x1a5d[_0x27e6ce];return _0x3484e8;};'use strict';var _=require(_0xd1a5('0x0'));var util=require(_0xd1a5('0x1'));var logger=require(_0xd1a5('0x2'))(_0xd1a5('0x3'));var moment=require(_0xd1a5('0x4'));var BPromise=require(_0xd1a5('0x5'));var rp=require(_0xd1a5('0x6'));var fs=require('fs');var path=require(_0xd1a5('0x7'));var rimraf=require(_0xd1a5('0x8'));var config=require(_0xd1a5('0x9'));var attributes=require(_0xd1a5('0xa'));module[_0xd1a5('0xb')]=function(_0x211d3d,_0xb9120){return _0x211d3d[_0xd1a5('0xc')]('SugarcrmField',attributes,{'tableName':_0xd1a5('0xd'),'paranoid':![],'indexes':[{'name':_0xd1a5('0xe'),'fields':[_0xd1a5('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56b3=['FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x26b404,_0x29259e){var _0x4be8fc=function(_0x2656f8){while(--_0x2656f8){_0x26b404['push'](_0x26b404['shift']());}};_0x4be8fc(++_0x29259e);}(_0x56b3,0x1eb));var _0x356b=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x56b3[_0x1fdb40];return _0x281f93;};'use strict';var _=require(_0x356b('0x0'));var util=require(_0x356b('0x1'));var logger=require(_0x356b('0x2'))(_0x356b('0x3'));var moment=require('moment');var BPromise=require(_0x356b('0x4'));var rp=require(_0x356b('0x5'));var fs=require('fs');var path=require(_0x356b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x356b('0x7')]=function(_0xc74bd2,_0x1e836b){return _0xc74bd2[_0x356b('0x8')](_0x356b('0x9'),attributes,{'tableName':_0x356b('0xa'),'paranoid':![],'indexes':[{'name':_0x356b('0xb'),'fields':[_0x356b('0xc'),_0x356b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 5564bc6..bf83c69 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 _0xa1fc=['error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x44cd59,_0x1e2080){var _0x3b5a3f=function(_0x5039e1){while(--_0x5039e1){_0x44cd59['push'](_0x44cd59['shift']());}};_0x3b5a3f(++_0x1e2080);}(_0xa1fc,0x8a));var _0xca1f=function(_0x5443e2,_0xe2863c){_0x5443e2=_0x5443e2-0x0;var _0x5cb7c0=_0xa1fc[_0x5443e2];return _0x5cb7c0;};'use strict';var _=require(_0xca1f('0x0'));var util=require(_0xca1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca1f('0x2'));var fs=require('fs');var Redis=require(_0xca1f('0x3'));var db=require(_0xca1f('0x4'))['db'];var utils=require(_0xca1f('0x5'));var logger=require(_0xca1f('0x6'))(_0xca1f('0x7'));var config=require(_0xca1f('0x8'));var jayson=require(_0xca1f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46e3c2,_0x375b39,_0x349d6a){return new BPromise(function(_0x21d890,_0xe872e8){return client[_0xca1f('0xa')](_0x46e3c2,_0x349d6a)[_0xca1f('0xb')](function(_0x2855c8){logger['info'](_0xca1f('0xc'),_0x375b39,_0xca1f('0xd'));logger['debug'](_0xca1f('0xe'),_0x375b39,_0xca1f('0xd'),JSON[_0xca1f('0xf')](_0x2855c8));if(_0x2855c8[_0xca1f('0x10')]){if(_0x2855c8[_0xca1f('0x10')][_0xca1f('0x11')]===0x1f4){logger['error'](_0xca1f('0xc'),_0x375b39,_0x2855c8[_0xca1f('0x10')]['message']);return _0xe872e8(_0x2855c8[_0xca1f('0x10')][_0xca1f('0x12')]);}logger[_0xca1f('0x10')](_0xca1f('0xc'),_0x375b39,_0x2855c8['error'][_0xca1f('0x12')]);return _0x21d890(_0x2855c8['error']['message']);}else{logger[_0xca1f('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x375b39,'request\x20sent');_0x21d890(_0x2855c8[_0xca1f('0x14')][_0xca1f('0x12')]);}})[_0xca1f('0x15')](function(_0x2d2bb3){logger[_0xca1f('0x10')](_0xca1f('0xc'),_0x375b39,_0x2d2bb3);_0xe872e8(_0x2d2bb3);});});} \ No newline at end of file +var _0xb7ce=['rpc','../../config/environment','jayson/promise','http','debug','request\x20sent','stringify','error','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d01d6,_0xfa8365){var _0x5eb446=function(_0x2e6e3c){while(--_0x2e6e3c){_0x5d01d6['push'](_0x5d01d6['shift']());}};_0x5eb446(++_0xfa8365);}(_0xb7ce,0x150));var _0xeb7c=function(_0x17a25d,_0x474ed6){_0x17a25d=_0x17a25d-0x0;var _0xd7e615=_0xb7ce[_0x17a25d];return _0xd7e615;};'use strict';var _=require('lodash');var util=require(_0xeb7c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb7c('0x1'));var fs=require('fs');var Redis=require(_0xeb7c('0x2'));var db=require(_0xeb7c('0x3'))['db'];var utils=require(_0xeb7c('0x4'));var logger=require(_0xeb7c('0x5'))(_0xeb7c('0x6'));var config=require(_0xeb7c('0x7'));var jayson=require(_0xeb7c('0x8'));var client=jayson['client'][_0xeb7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b6b28,_0x30e52c,_0x158a29){return new BPromise(function(_0x401c2a,_0x4446f8){return client['request'](_0x2b6b28,_0x158a29)['then'](function(_0x4890c1){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x30e52c,'request\x20sent');logger[_0xeb7c('0xa')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x30e52c,_0xeb7c('0xb'),JSON[_0xeb7c('0xc')](_0x4890c1));if(_0x4890c1[_0xeb7c('0xd')]){if(_0x4890c1[_0xeb7c('0xd')]['code']===0x1f4){logger[_0xeb7c('0xd')](_0xeb7c('0xe'),_0x30e52c,_0x4890c1[_0xeb7c('0xd')][_0xeb7c('0xf')]);return _0x4446f8(_0x4890c1[_0xeb7c('0xd')][_0xeb7c('0xf')]);}logger[_0xeb7c('0xd')](_0xeb7c('0xe'),_0x30e52c,_0x4890c1[_0xeb7c('0xd')][_0xeb7c('0xf')]);return _0x401c2a(_0x4890c1[_0xeb7c('0xd')]['message']);}else{logger[_0xeb7c('0x10')](_0xeb7c('0xe'),_0x30e52c,'request\x20sent');_0x401c2a(_0x4890c1[_0xeb7c('0x11')][_0xeb7c('0xf')]);}})[_0xeb7c('0x12')](function(_0x13ef5d){logger['error'](_0xeb7c('0xe'),_0x30e52c,_0x13ef5d);_0x4446f8(_0x13ef5d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5b44851..546ef6f 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 _0x9ca8=['/:id/fields','post','create','addConfiguration','put','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x2c6e9e,_0x263f4b){var _0x39496c=function(_0x1e77f2){while(--_0x1e77f2){_0x2c6e9e['push'](_0x2c6e9e['shift']());}};_0x39496c(++_0x263f4b);}(_0x9ca8,0x123));var _0x89ca=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x9ca8[_0x53abe5];return _0xc1c37e;};'use strict';var multer=require('multer');var util=require(_0x89ca('0x0'));var path=require('path');var timeout=require(_0x89ca('0x1'));var express=require(_0x89ca('0x2'));var router=express[_0x89ca('0x3')]();var fs_extra=require(_0x89ca('0x4'));var auth=require(_0x89ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89ca('0x6'));var controller=require(_0x89ca('0x7'));router[_0x89ca('0x8')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xa')]);router[_0x89ca('0x8')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['show']);router['get'](_0x89ca('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x89ca('0x8')](_0x89ca('0xd'),auth[_0x89ca('0x9')](),controller['getFields']);router[_0x89ca('0xe')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xf')]);router[_0x89ca('0xe')](_0x89ca('0xc'),auth[_0x89ca('0x9')](),controller[_0x89ca('0x10')]);router[_0x89ca('0x11')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['update']);router['delete'](_0x89ca('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x89ca('0x12')]=router; \ No newline at end of file +var _0xd0b5=['post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields'];(function(_0x59ec0b,_0x12f0e4){var _0x180dd6=function(_0x16f4c3){while(--_0x16f4c3){_0x59ec0b['push'](_0x59ec0b['shift']());}};_0x180dd6(++_0x12f0e4);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x3ee18c,_0x40e8a7){_0x3ee18c=_0x3ee18c-0x0;var _0x15c982=_0xd0b5[_0x3ee18c];return _0x15c982;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5d0b('0x0'));var timeout=require(_0x5d0b('0x1'));var express=require('express');var router=express[_0x5d0b('0x2')]();var fs_extra=require(_0x5d0b('0x3'));var auth=require(_0x5d0b('0x4'));var interaction=require(_0x5d0b('0x5'));var config=require(_0x5d0b('0x6'));var controller=require(_0x5d0b('0x7'));router[_0x5d0b('0x8')]('/',auth[_0x5d0b('0x9')](),controller[_0x5d0b('0xa')]);router[_0x5d0b('0x8')](_0x5d0b('0xb'),auth[_0x5d0b('0x9')](),controller[_0x5d0b('0xc')]);router['get'](_0x5d0b('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x5d0b('0x8')](_0x5d0b('0xe'),auth['isAuthenticated'](),controller[_0x5d0b('0xf')]);router[_0x5d0b('0x10')]('/',auth['isAuthenticated'](),controller[_0x5d0b('0x11')]);router[_0x5d0b('0x10')](_0x5d0b('0xd'),auth[_0x5d0b('0x9')](),controller[_0x5d0b('0x12')]);router[_0x5d0b('0x13')]('/:id',auth[_0x5d0b('0x9')](),controller[_0x5d0b('0x14')]);router[_0x5d0b('0x15')](_0x5d0b('0xb'),auth['isAuthenticated'](),controller[_0x5d0b('0x16')]);module[_0x5d0b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 01c9300..a596f48 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 _0xb393=['sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb393,0xbe));var _0x3b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb393[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x3b39('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b39('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3b39('0x1')]},'username':{'type':Sequelize[_0x3b39('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3b39('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x3b39('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3b39('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3b39('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8afe=['HelpDesk','sequelize','exports','STRING'];(function(_0x178a9c,_0x562a28){var _0x3fd933=function(_0x37a0e2){while(--_0x37a0e2){_0x178a9c['push'](_0x178a9c['shift']());}};_0x3fd933(++_0x562a28);}(_0x8afe,0x1dd));var _0xe8af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8afe[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe8af('0x0'));module[_0xe8af('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe8af('0x2')]},'username':{'type':Sequelize[_0xe8af('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe8af('0x2')],'allowNull':![],'defaultValue':_0xe8af('0x3')},'remoteUri':{'type':Sequelize[_0xe8af('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe8af('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe8af('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index bae4ee0..223bc24 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 _0xca5b=['reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','map','VtigerAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','describe','autogenerated'];(function(_0x50c191,_0x1a8810){var _0x1d8570=function(_0x2757ad){while(--_0x2757ad){_0x50c191['push'](_0x50c191['shift']());}};_0x1d8570(++_0x1a8810);}(_0xca5b,0x8a));var _0xbca5=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0xca5b[_0x290fa6];return _0x47f1f3;};'use strict';var emlformat=require(_0xbca5('0x0'));var rimraf=require(_0xbca5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbca5('0x2'));var moment=require(_0xbca5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbca5('0x4'));var path=require(_0xbca5('0x5'));var sox=require(_0xbca5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbca5('0x7'));var _=require('lodash');var squel=require(_0xbca5('0x8'));var crypto=require(_0xbca5('0x9'));var jsforce=require(_0xbca5('0xa'));var deskjs=require(_0xbca5('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbca5('0xc'));var Papa=require(_0xbca5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbca5('0xe'));var as=require(_0xbca5('0xf'));var hardwareService=require(_0xbca5('0x10'));var logger=require(_0xbca5('0x11'))(_0xbca5('0x12'));var utils=require(_0xbca5('0x13'));var config=require(_0xbca5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbca5('0x15'))['db'];var integrations=require(_0xbca5('0x16'));function respondWithStatusCode(_0x5845ee,_0x1c8dac){_0x1c8dac=_0x1c8dac||0xcc;return function(_0x4e7df5){if(_0x4e7df5){return _0x5845ee[_0xbca5('0x17')](_0x1c8dac);}return _0x5845ee[_0xbca5('0x18')](_0x1c8dac)['end']();};}function respondWithResult(_0x33596e,_0x2f9a88){_0x2f9a88=_0x2f9a88||0xc8;return function(_0xe8b592){if(_0xe8b592){return _0x33596e['status'](_0x2f9a88)[_0xbca5('0x19')](_0xe8b592);}};}function respondWithFilteredResult(_0x4cc840,_0x57ae75){return function(_0x51947b){if(_0x51947b){var _0x183dd4=typeof _0x57ae75['offset']===_0xbca5('0x1a')&&typeof _0x57ae75[_0xbca5('0x1b')]==='undefined';var _0x20c17f=_0x51947b[_0xbca5('0x1c')];var _0x2cf225=_0x183dd4?0x0:_0x57ae75[_0xbca5('0x1d')];var _0x55e6cb=_0x183dd4?_0x51947b[_0xbca5('0x1c')]:_0x57ae75[_0xbca5('0x1d')]+_0x57ae75['limit'];var _0x2b7c74;if(_0x55e6cb>=_0x20c17f){_0x55e6cb=_0x20c17f;_0x2b7c74=0xc8;}else{_0x2b7c74=0xce;}_0x4cc840[_0xbca5('0x18')](_0x2b7c74);return _0x4cc840[_0xbca5('0x1e')](_0xbca5('0x1f'),_0x2cf225+'-'+_0x55e6cb+'/'+_0x20c17f)[_0xbca5('0x19')](_0x51947b);}return null;};}function patchUpdates(_0x1e4220){return function(_0x155521){try{jsonpatch['apply'](_0x155521,_0x1e4220,!![]);}catch(_0x4d100e){return BPromise[_0xbca5('0x20')](_0x4d100e);}return _0x155521[_0xbca5('0x21')]();};}function saveUpdates(_0x1b5289,_0x387b3c){return function(_0x5c40cc){if(_0x5c40cc){return _0x5c40cc[_0xbca5('0x22')](_0x1b5289)[_0xbca5('0x23')](function(_0x40f444){return _0x40f444;});}return null;};}function removeEntity(_0x118033,_0x37aa6b){return function(_0x53e309){if(_0x53e309){return _0x53e309[_0xbca5('0x24')]()[_0xbca5('0x23')](function(){_0x118033['status'](0xcc)[_0xbca5('0x25')]();});}};}function handleEntityNotFound(_0xc534a,_0x1ec511){return function(_0x57bbc5){if(!_0x57bbc5){_0xc534a[_0xbca5('0x17')](0x194);}return _0x57bbc5;};}function handleError(_0x3b1abb,_0x5b4ba9){_0x5b4ba9=_0x5b4ba9||0x1f4;return function(_0xcceb96){logger[_0xbca5('0x26')](_0xcceb96['stack']);if(_0xcceb96[_0xbca5('0x27')]){delete _0xcceb96[_0xbca5('0x27')];}_0x3b1abb['status'](_0x5b4ba9)[_0xbca5('0x28')](_0xcceb96);};}exports['index']=function(_0x5e72a1,_0x248744){var _0x5acd03={},_0x177524={},_0x5946c2={'count':0x0,'rows':[]};var _0x3ca9df=_[_0xbca5('0x29')](db[_0xbca5('0x2a')][_0xbca5('0x2b')],function(_0x270401){return{'name':_0x270401['fieldName'],'type':_0x270401[_0xbca5('0x2c')][_0xbca5('0x2d')]};});_0x177524[_0xbca5('0x2e')]=_[_0xbca5('0x29')](_0x3ca9df,'name');_0x177524[_0xbca5('0x2f')]=_[_0xbca5('0x30')](_0x5e72a1[_0xbca5('0x2f')]);_0x177524['filters']=_[_0xbca5('0x31')](_0x177524[_0xbca5('0x2e')],_0x177524[_0xbca5('0x2f')]);_0x5acd03[_0xbca5('0x32')]=_[_0xbca5('0x31')](_0x177524['model'],qs[_0xbca5('0x33')](_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x33')]));_0x5acd03[_0xbca5('0x32')]=_0x5acd03[_0xbca5('0x32')][_0xbca5('0x34')]?_0x5acd03[_0xbca5('0x32')]:_0x177524[_0xbca5('0x2e')];if(!_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x35')](_0xbca5('0x36'))){_0x5acd03[_0xbca5('0x1b')]=qs['limit'](_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x1b')]);_0x5acd03['offset']=qs[_0xbca5('0x1d')](_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x1d')]);}_0x5acd03[_0xbca5('0x37')]=qs[_0xbca5('0x38')](_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x38')]);_0x5acd03[_0xbca5('0x39')]=qs[_0xbca5('0x3a')](_['pick'](_0x5e72a1[_0xbca5('0x2f')],_0x177524[_0xbca5('0x3a')]),_0x3ca9df);if(_0x5e72a1['query'][_0xbca5('0x3b')]){_0x5acd03[_0xbca5('0x39')]=_[_0xbca5('0x3c')](_0x5acd03[_0xbca5('0x39')],{'$or':_['map'](_0x3ca9df,function(_0x4be058){if(_0x4be058[_0xbca5('0x2c')]!==_0xbca5('0x3d')){var _0x2872e6={};_0x2872e6[_0x4be058['name']]={'$like':'%'+_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x3b')]+'%'};return _0x2872e6;}})});}_0x5acd03=_['merge']({},_0x5acd03,_0x5e72a1[_0xbca5('0x3e')]);var _0x5084ab={'where':_0x5acd03['where']};return db[_0xbca5('0x2a')]['count'](_0x5084ab)[_0xbca5('0x23')](function(_0x590da1){_0x5946c2[_0xbca5('0x1c')]=_0x590da1;if(_0x5e72a1[_0xbca5('0x2f')][_0xbca5('0x3f')]){_0x5acd03[_0xbca5('0x40')]=[{'all':!![]}];}return db[_0xbca5('0x2a')][_0xbca5('0x41')](_0x5acd03);})[_0xbca5('0x23')](function(_0x21b817){_0x5946c2[_0xbca5('0x42')]=_0x21b817;return _0x5946c2;})['then'](respondWithFilteredResult(_0x248744,_0x5acd03))[_0xbca5('0x43')](handleError(_0x248744,null));};exports['show']=function(_0x79803f,_0x4a4d9b){var _0x445375={'raw':![],'where':{'id':_0x79803f[_0xbca5('0x44')]['id']}},_0x2dcca7={};_0x2dcca7[_0xbca5('0x2e')]=_[_0xbca5('0x30')](db['VtigerAccount'][_0xbca5('0x2b')]);_0x2dcca7['query']=_[_0xbca5('0x30')](_0x79803f[_0xbca5('0x2f')]);_0x2dcca7[_0xbca5('0x3a')]=_[_0xbca5('0x31')](_0x2dcca7[_0xbca5('0x2e')],_0x2dcca7[_0xbca5('0x2f')]);_0x445375['attributes']=_[_0xbca5('0x31')](_0x2dcca7[_0xbca5('0x2e')],qs[_0xbca5('0x33')](_0x79803f[_0xbca5('0x2f')][_0xbca5('0x33')]));_0x445375['attributes']=_0x445375[_0xbca5('0x32')][_0xbca5('0x34')]?_0x445375[_0xbca5('0x32')]:_0x2dcca7[_0xbca5('0x2e')];if(_0x79803f[_0xbca5('0x2f')][_0xbca5('0x3f')]){_0x445375[_0xbca5('0x40')]=[{'all':!![]}];}_0x445375=_[_0xbca5('0x3c')]({},_0x445375,_0x79803f[_0xbca5('0x3e')]);return db['VtigerAccount']['find'](_0x445375)['then'](handleEntityNotFound(_0x4a4d9b,null))[_0xbca5('0x23')](respondWithResult(_0x4a4d9b,null))[_0xbca5('0x43')](handleError(_0x4a4d9b,null));};exports[_0xbca5('0x45')]=function(_0x4b6a73,_0x3da7b8){return db[_0xbca5('0x2a')][_0xbca5('0x45')](_0x4b6a73[_0xbca5('0x46')],{})[_0xbca5('0x23')](respondWithResult(_0x3da7b8,0xc9))[_0xbca5('0x43')](handleError(_0x3da7b8,null));};exports[_0xbca5('0x22')]=function(_0x157655,_0x4e7ba8){if(_0x157655[_0xbca5('0x46')]['id']){delete _0x157655['body']['id'];}return db['VtigerAccount'][_0xbca5('0x47')]({'where':{'id':_0x157655[_0xbca5('0x44')]['id']}})[_0xbca5('0x23')](handleEntityNotFound(_0x4e7ba8,null))['then'](saveUpdates(_0x157655[_0xbca5('0x46')],null))['then'](respondWithResult(_0x4e7ba8,null))[_0xbca5('0x43')](handleError(_0x4e7ba8,null));};exports['destroy']=function(_0x17d909,_0x466083){return db[_0xbca5('0x2a')][_0xbca5('0x47')]({'where':{'id':_0x17d909['params']['id']}})[_0xbca5('0x23')](handleEntityNotFound(_0x466083,null))[_0xbca5('0x23')](removeEntity(_0x466083,null))[_0xbca5('0x43')](handleError(_0x466083,null));};exports[_0xbca5('0x48')]=function(_0x5473e9,_0x42ee21,_0x49713d){var _0x26dcba={};var _0x247947={};var _0x4505f9;var _0xd04a31;return db['VtigerAccount'][_0xbca5('0x49')]({'where':{'id':_0x5473e9[_0xbca5('0x44')]['id']}})['then'](handleEntityNotFound(_0x42ee21,null))[_0xbca5('0x23')](function(_0x562103){if(_0x562103){_0x4505f9=_0x562103;_0x247947[_0xbca5('0x2e')]=_[_0xbca5('0x30')](db[_0xbca5('0x4a')][_0xbca5('0x2b')]);_0x247947['query']=_[_0xbca5('0x30')](_0x5473e9['query']);_0x247947[_0xbca5('0x3a')]=_[_0xbca5('0x31')](_0x247947[_0xbca5('0x2e')],_0x247947[_0xbca5('0x2f')]);_0x26dcba['attributes']=_[_0xbca5('0x31')](_0x247947[_0xbca5('0x2e')],qs['fields'](_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x33')]));_0x26dcba[_0xbca5('0x32')]=_0x26dcba[_0xbca5('0x32')]['length']?_0x26dcba['attributes']:_0x247947['model'];_0x26dcba[_0xbca5('0x37')]=qs[_0xbca5('0x38')](_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x38')]);_0x26dcba[_0xbca5('0x39')]=qs['filters'](_[_0xbca5('0x4b')](_0x5473e9['query'],_0x247947[_0xbca5('0x3a')]));if(_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x3b')]){_0x26dcba[_0xbca5('0x39')]=_[_0xbca5('0x3c')](_0x26dcba[_0xbca5('0x39')],{'$or':_[_0xbca5('0x29')](_0x26dcba[_0xbca5('0x32')],function(_0x1d3b9d){var _0x2dba91={};_0x2dba91[_0x1d3b9d]={'$like':'%'+_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x3b')]+'%'};return _0x2dba91;})});}_0x26dcba=_[_0xbca5('0x3c')]({},_0x26dcba,_0x5473e9['options']);return _0x4505f9['getConfigurations'](_0x26dcba);}})[_0xbca5('0x23')](function(_0x495885){if(_0x495885){_0xd04a31=_0x495885['length'];if(!_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x35')](_0xbca5('0x36'))){_0x26dcba[_0xbca5('0x1b')]=qs[_0xbca5('0x1b')](_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x1b')]);_0x26dcba[_0xbca5('0x1d')]=qs['offset'](_0x5473e9[_0xbca5('0x2f')][_0xbca5('0x1d')]);}return _0x4505f9['getConfigurations'](_0x26dcba);}})[_0xbca5('0x23')](function(_0x44a49d){if(_0x44a49d){return _0x44a49d?{'count':_0xd04a31,'rows':_0x44a49d}:null;}})[_0xbca5('0x23')](respondWithResult(_0x42ee21,null))['catch'](handleError(_0x42ee21,null));};exports[_0xbca5('0x4c')]=function(_0x4f38c4,_0x31eb79,_0x5db8c9){if(_0x4f38c4['body']['id']){delete _0x4f38c4[_0xbca5('0x46')]['id'];}return db[_0xbca5('0x2a')][_0xbca5('0x49')]({'where':{'id':_0x4f38c4[_0xbca5('0x44')]['id']}})[_0xbca5('0x23')](handleEntityNotFound(_0x31eb79,null))[_0xbca5('0x23')](function(_0xd760b3){if(_0xd760b3){_0x4f38c4[_0xbca5('0x46')][_0xbca5('0x4d')]=_0xd760b3['id'];_0x4f38c4[_0xbca5('0x46')][_0xbca5('0x4e')]=integrations[_0xbca5('0x4f')](_0x4f38c4['body'][_0xbca5('0x50')],_0x4f38c4['body']['type']);_0x4f38c4[_0xbca5('0x46')][_0xbca5('0x51')]=integrations[_0xbca5('0x52')](_0x4f38c4[_0xbca5('0x46')][_0xbca5('0x50')],_0x4f38c4[_0xbca5('0x46')][_0xbca5('0x2c')]);return db[_0xbca5('0x4a')][_0xbca5('0x45')](_0x4f38c4['body'],{'include':[{'model':db[_0xbca5('0x53')],'as':_0xbca5('0x4e')},{'model':db['VtigerField'],'as':_0xbca5('0x51')}]});}return null;})[_0xbca5('0x23')](respondWithResult(_0x31eb79,null))[_0xbca5('0x43')](handleError(_0x31eb79,null));};var md5=require(_0xbca5('0x54'));exports[_0xbca5('0x55')]=function(_0x1c7f2a,_0x580066,_0x2d4806){var _0x5d84b2=null;var _0x536db8=null;var _0x479148=null;var _0x2ffa6a=null;var _0x4a7b7a='';return db[_0xbca5('0x2a')]['findOne']({'where':{'id':_0x1c7f2a['params']['id']},'attributes':['id',_0xbca5('0x27'),_0xbca5('0x56'),_0xbca5('0x57'),_0xbca5('0x58'),_0xbca5('0x59'),'serverUrl',_0xbca5('0x5a')]})['then'](handleEntityNotFound(_0x580066,null))[_0xbca5('0x23')](function(_0x21e3aa){if(_0x21e3aa){_0x5d84b2=_0x21e3aa[_0xbca5('0x56')];_0x536db8=_0x21e3aa[_0xbca5('0x5a')];_0x479148=_0x21e3aa['moduleName'];_0x4a7b7a=_0x21e3aa[_0xbca5('0x59')];var _0x557b08=_0x4a7b7a[_0xbca5('0x5b')](-0x1);if(_0x557b08==='/'){_0x4a7b7a=_0x4a7b7a[_0xbca5('0x5c')](0x0,_0x4a7b7a[_0xbca5('0x5d')](_0x557b08));}_0x2ffa6a=util[_0xbca5('0x5e')](_0xbca5('0x5f'),_0x4a7b7a);var _0xd02a1={'method':_0xbca5('0x60'),'uri':_0x2ffa6a,'qs':{'operation':'getchallenge','username':_0x21e3aa['username']},'json':!![]};return rp(_0xd02a1);}})[_0xbca5('0x23')](function(_0x57de60){if(_0x57de60[_0xbca5('0x61')]){var _0x46905c={'method':_0xbca5('0x62'),'uri':_0x2ffa6a,'form':{'operation':_0xbca5('0x63'),'username':_0x5d84b2,'accessKey':md5(_0x57de60[_0xbca5('0x64')][_0xbca5('0x65')]+_0x536db8)},'json':!![]};return rp(_0x46905c);}})[_0xbca5('0x23')](function(_0x22fa52){if(_0x22fa52[_0xbca5('0x61')]){var _0x18bae1={'method':_0xbca5('0x60'),'uri':_0x2ffa6a,'qs':{'operation':_0xbca5('0x66'),'username':_0x5d84b2,'sessionName':_0x22fa52[_0xbca5('0x64')]['sessionName'],'elementType':_0x479148},'json':!![]};return rp(_0x18bae1);}})[_0xbca5('0x23')](function(_0x2b7126){if(_0x2b7126[_0xbca5('0x61')]){var _0x43424b=[_0xbca5('0x67'),_0xbca5('0x68'),_0xbca5('0x69')];_[_0xbca5('0x6a')](_0x2b7126[_0xbca5('0x64')]['fields'],function(_0x3f697c){return _0x43424b[_0xbca5('0x6b')](_0x3f697c[_0xbca5('0x2c')][_0xbca5('0x27')]);});_[_0xbca5('0x6a')](_0x2b7126[_0xbca5('0x64')][_0xbca5('0x33')],function(_0x507983){return _0x507983[_0xbca5('0x6c')]===_0xbca5('0x6d');});return{'count':_0x2b7126[_0xbca5('0x64')]['fields'][_0xbca5('0x34')],'rows':_[_0xbca5('0x29')](_0x2b7126[_0xbca5('0x64')][_0xbca5('0x33')],function(_0x38860a){return{'id':_0x38860a[_0xbca5('0x27')],'name':_0x38860a['label'],'custom':_[_0xbca5('0x6e')](_0x38860a['name'],_0xbca5('0x6f'))?!![]:![],'options':_0x38860a['type'][_0xbca5('0x27')]===_0xbca5('0x70')&&_0x38860a[_0xbca5('0x2c')][_0xbca5('0x71')][_0xbca5('0x34')]>0x0?_[_0xbca5('0x29')](_0x38860a[_0xbca5('0x2c')][_0xbca5('0x71')],function(_0x51682a){return{'name':_0x51682a['label'],'value':_0x51682a['value']};}):[]};})};}})[_0xbca5('0x23')](respondWithResult(_0x580066,null))['catch'](function(_0x4dac1c){console[_0xbca5('0x72')](_0xbca5('0x73')+_0x4dac1c);var _0x1900de=_0x1c7f2a[_0xbca5('0x2f')][_0xbca5('0x74')]?0x1f4:_0x4dac1c['statusCode']||0x1f4;logger['error'](_0xbca5('0x75'),_0xbca5('0x55'),_0x1900de,JSON[_0xbca5('0x76')](_0x4dac1c));delete _0x4dac1c[_0xbca5('0x27')];if(_0x1900de===0x191){_0x1900de=0x190;}_0x580066[_0xbca5('0x18')](_0x1900de)['send'](_0x1c7f2a[_0xbca5('0x2f')][_0xbca5('0x74')]?{'message':_0xbca5('0x77'),'statusCode':_0x4dac1c[_0xbca5('0x78')]}:_0x4dac1c);});}; \ No newline at end of file +var _0xef6d=['save','destroy','then','end','error','stack','name','send','map','VtigerAccount','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','where','type','filter','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','update','params','getConfigurations','findOne','merge','hasOwnProperty','catch','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','lastIndexOf','format','%s/webservice.php','GET','getchallenge','result','token','success','describe','sessionName','autogenerated','reference','owner','remove','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject'];(function(_0x17f1bd,_0x5f5005){var _0x16bfaa=function(_0x58ce92){while(--_0x58ce92){_0x17f1bd['push'](_0x17f1bd['shift']());}};_0x16bfaa(++_0x5f5005);}(_0xef6d,0xcc));var _0xdef6=function(_0x4e05f4,_0x211ddb){_0x4e05f4=_0x4e05f4-0x0;var _0x2bbcd5=_0xef6d[_0x4e05f4];return _0x2bbcd5;};'use strict';var emlformat=require(_0xdef6('0x0'));var rimraf=require(_0xdef6('0x1'));var zipdir=require(_0xdef6('0x2'));var jsonpatch=require(_0xdef6('0x3'));var rp=require('request-promise');var moment=require(_0xdef6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdef6('0x5'));var util=require('util');var path=require(_0xdef6('0x6'));var sox=require(_0xdef6('0x7'));var csv=require(_0xdef6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdef6('0x9'));var _=require(_0xdef6('0xa'));var squel=require(_0xdef6('0xb'));var crypto=require(_0xdef6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdef6('0xd'));var toCsv=require(_0xdef6('0x8'));var querystring=require(_0xdef6('0xe'));var Papa=require(_0xdef6('0xf'));var Redis=require(_0xdef6('0x10'));var authService=require(_0xdef6('0x11'));var qs=require(_0xdef6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdef6('0x13'));var logger=require(_0xdef6('0x14'))(_0xdef6('0x15'));var utils=require(_0xdef6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdef6('0x17'))['db'];var integrations=require(_0xdef6('0x18'));function respondWithStatusCode(_0x23ff4f,_0x1c05ba){_0x1c05ba=_0x1c05ba||0xcc;return function(_0xb0a6b0){if(_0xb0a6b0){return _0x23ff4f[_0xdef6('0x19')](_0x1c05ba);}return _0x23ff4f[_0xdef6('0x1a')](_0x1c05ba)['end']();};}function respondWithResult(_0x16a2c8,_0x33fd44){_0x33fd44=_0x33fd44||0xc8;return function(_0x395877){if(_0x395877){return _0x16a2c8[_0xdef6('0x1a')](_0x33fd44)[_0xdef6('0x1b')](_0x395877);}};}function respondWithFilteredResult(_0x477dd9,_0xdd3527){return function(_0x1bfcc3){if(_0x1bfcc3){var _0x16b77f=typeof _0xdd3527['offset']===_0xdef6('0x1c')&&typeof _0xdd3527[_0xdef6('0x1d')]==='undefined';var _0x1e9cb6=_0x1bfcc3['count'];var _0x452b3e=_0x16b77f?0x0:_0xdd3527[_0xdef6('0x1e')];var _0x44cadf=_0x16b77f?_0x1bfcc3[_0xdef6('0x1f')]:_0xdd3527[_0xdef6('0x1e')]+_0xdd3527[_0xdef6('0x1d')];var _0x171e33;if(_0x44cadf>=_0x1e9cb6){_0x44cadf=_0x1e9cb6;_0x171e33=0xc8;}else{_0x171e33=0xce;}_0x477dd9['status'](_0x171e33);return _0x477dd9[_0xdef6('0x20')](_0xdef6('0x21'),_0x452b3e+'-'+_0x44cadf+'/'+_0x1e9cb6)['json'](_0x1bfcc3);}return null;};}function patchUpdates(_0x114e33){return function(_0x40c525){try{jsonpatch[_0xdef6('0x22')](_0x40c525,_0x114e33,!![]);}catch(_0x20bb2b){return BPromise[_0xdef6('0x23')](_0x20bb2b);}return _0x40c525[_0xdef6('0x24')]();};}function saveUpdates(_0x47a0a6,_0x28c316){return function(_0x444032){if(_0x444032){return _0x444032['update'](_0x47a0a6)['then'](function(_0x363a69){return _0x363a69;});}return null;};}function removeEntity(_0x58a987,_0x420134){return function(_0x599c88){if(_0x599c88){return _0x599c88[_0xdef6('0x25')]()[_0xdef6('0x26')](function(){_0x58a987[_0xdef6('0x1a')](0xcc)[_0xdef6('0x27')]();});}};}function handleEntityNotFound(_0x492cd5,_0x3c4a48){return function(_0x5eec06){if(!_0x5eec06){_0x492cd5[_0xdef6('0x19')](0x194);}return _0x5eec06;};}function handleError(_0x3b5626,_0xab2000){_0xab2000=_0xab2000||0x1f4;return function(_0x583394){logger[_0xdef6('0x28')](_0x583394[_0xdef6('0x29')]);if(_0x583394[_0xdef6('0x2a')]){delete _0x583394['name'];}_0x3b5626[_0xdef6('0x1a')](_0xab2000)[_0xdef6('0x2b')](_0x583394);};}exports['index']=function(_0x1dc9eb,_0x36e856){var _0x159165={},_0x45e05c={},_0x2b631c={'count':0x0,'rows':[]};var _0x58823f=_[_0xdef6('0x2c')](db[_0xdef6('0x2d')]['rawAttributes'],function(_0x217473){return{'name':_0x217473[_0xdef6('0x2e')],'type':_0x217473['type'][_0xdef6('0x2f')]};});_0x45e05c[_0xdef6('0x30')]=_[_0xdef6('0x2c')](_0x58823f,_0xdef6('0x2a'));_0x45e05c[_0xdef6('0x31')]=_[_0xdef6('0x32')](_0x1dc9eb['query']);_0x45e05c['filters']=_[_0xdef6('0x33')](_0x45e05c['model'],_0x45e05c[_0xdef6('0x31')]);_0x159165['attributes']=_[_0xdef6('0x33')](_0x45e05c['model'],qs[_0xdef6('0x34')](_0x1dc9eb[_0xdef6('0x31')]['fields']));_0x159165[_0xdef6('0x35')]=_0x159165[_0xdef6('0x35')][_0xdef6('0x36')]?_0x159165[_0xdef6('0x35')]:_0x45e05c['model'];if(!_0x1dc9eb[_0xdef6('0x31')]['hasOwnProperty'](_0xdef6('0x37'))){_0x159165[_0xdef6('0x1d')]=qs[_0xdef6('0x1d')](_0x1dc9eb[_0xdef6('0x31')][_0xdef6('0x1d')]);_0x159165['offset']=qs['offset'](_0x1dc9eb[_0xdef6('0x31')][_0xdef6('0x1e')]);}_0x159165[_0xdef6('0x38')]=qs[_0xdef6('0x39')](_0x1dc9eb[_0xdef6('0x31')][_0xdef6('0x39')]);_0x159165['where']=qs[_0xdef6('0x3a')](_['pick'](_0x1dc9eb[_0xdef6('0x31')],_0x45e05c[_0xdef6('0x3a')]),_0x58823f);if(_0x1dc9eb[_0xdef6('0x31')]['filter']){_0x159165[_0xdef6('0x3b')]=_['merge'](_0x159165['where'],{'$or':_[_0xdef6('0x2c')](_0x58823f,function(_0x3342f3){if(_0x3342f3[_0xdef6('0x3c')]!=='VIRTUAL'){var _0xf696b9={};_0xf696b9[_0x3342f3[_0xdef6('0x2a')]]={'$like':'%'+_0x1dc9eb[_0xdef6('0x31')][_0xdef6('0x3d')]+'%'};return _0xf696b9;}})});}_0x159165=_['merge']({},_0x159165,_0x1dc9eb[_0xdef6('0x3e')]);var _0x59c387={'where':_0x159165[_0xdef6('0x3b')]};return db[_0xdef6('0x2d')][_0xdef6('0x1f')](_0x59c387)[_0xdef6('0x26')](function(_0x45a95b){_0x2b631c[_0xdef6('0x1f')]=_0x45a95b;if(_0x1dc9eb[_0xdef6('0x31')][_0xdef6('0x3f')]){_0x159165[_0xdef6('0x40')]=[{'all':!![]}];}return db[_0xdef6('0x2d')][_0xdef6('0x41')](_0x159165);})['then'](function(_0x512b9f){_0x2b631c[_0xdef6('0x42')]=_0x512b9f;return _0x2b631c;})['then'](respondWithFilteredResult(_0x36e856,_0x159165))['catch'](handleError(_0x36e856,null));};exports[_0xdef6('0x43')]=function(_0x52ba1a,_0x221c85){var _0xfe3622={'raw':![],'where':{'id':_0x52ba1a['params']['id']}},_0x25da50={};_0x25da50['model']=_[_0xdef6('0x32')](db['VtigerAccount'][_0xdef6('0x44')]);_0x25da50[_0xdef6('0x31')]=_[_0xdef6('0x32')](_0x52ba1a['query']);_0x25da50[_0xdef6('0x3a')]=_[_0xdef6('0x33')](_0x25da50[_0xdef6('0x30')],_0x25da50[_0xdef6('0x31')]);_0xfe3622[_0xdef6('0x35')]=_[_0xdef6('0x33')](_0x25da50[_0xdef6('0x30')],qs['fields'](_0x52ba1a[_0xdef6('0x31')][_0xdef6('0x34')]));_0xfe3622[_0xdef6('0x35')]=_0xfe3622['attributes']['length']?_0xfe3622[_0xdef6('0x35')]:_0x25da50[_0xdef6('0x30')];if(_0x52ba1a[_0xdef6('0x31')][_0xdef6('0x3f')]){_0xfe3622['include']=[{'all':!![]}];}_0xfe3622=_['merge']({},_0xfe3622,_0x52ba1a[_0xdef6('0x3e')]);return db[_0xdef6('0x2d')][_0xdef6('0x45')](_0xfe3622)['then'](handleEntityNotFound(_0x221c85,null))[_0xdef6('0x26')](respondWithResult(_0x221c85,null))['catch'](handleError(_0x221c85,null));};exports[_0xdef6('0x46')]=function(_0x153137,_0x25ba06){return db['VtigerAccount']['create'](_0x153137[_0xdef6('0x47')],{})[_0xdef6('0x26')](respondWithResult(_0x25ba06,0xc9))['catch'](handleError(_0x25ba06,null));};exports[_0xdef6('0x48')]=function(_0x3d2fa5,_0x392ffd){if(_0x3d2fa5['body']['id']){delete _0x3d2fa5[_0xdef6('0x47')]['id'];}return db[_0xdef6('0x2d')]['find']({'where':{'id':_0x3d2fa5[_0xdef6('0x49')]['id']}})[_0xdef6('0x26')](handleEntityNotFound(_0x392ffd,null))[_0xdef6('0x26')](saveUpdates(_0x3d2fa5[_0xdef6('0x47')],null))[_0xdef6('0x26')](respondWithResult(_0x392ffd,null))['catch'](handleError(_0x392ffd,null));};exports[_0xdef6('0x25')]=function(_0x24af13,_0x3d07ab){return db[_0xdef6('0x2d')][_0xdef6('0x45')]({'where':{'id':_0x24af13[_0xdef6('0x49')]['id']}})[_0xdef6('0x26')](handleEntityNotFound(_0x3d07ab,null))[_0xdef6('0x26')](removeEntity(_0x3d07ab,null))['catch'](handleError(_0x3d07ab,null));};exports[_0xdef6('0x4a')]=function(_0x56825f,_0x1530ab,_0xdb6bc){var _0x5a0f40={};var _0x3b4faf={};var _0x387664;var _0x5b09ee;return db['VtigerAccount'][_0xdef6('0x4b')]({'where':{'id':_0x56825f[_0xdef6('0x49')]['id']}})[_0xdef6('0x26')](handleEntityNotFound(_0x1530ab,null))['then'](function(_0x670632){if(_0x670632){_0x387664=_0x670632;_0x3b4faf['model']=_['keys'](db['VtigerConfiguration'][_0xdef6('0x44')]);_0x3b4faf[_0xdef6('0x31')]=_[_0xdef6('0x32')](_0x56825f[_0xdef6('0x31')]);_0x3b4faf[_0xdef6('0x3a')]=_[_0xdef6('0x33')](_0x3b4faf[_0xdef6('0x30')],_0x3b4faf[_0xdef6('0x31')]);_0x5a0f40[_0xdef6('0x35')]=_[_0xdef6('0x33')](_0x3b4faf['model'],qs[_0xdef6('0x34')](_0x56825f[_0xdef6('0x31')][_0xdef6('0x34')]));_0x5a0f40[_0xdef6('0x35')]=_0x5a0f40['attributes'][_0xdef6('0x36')]?_0x5a0f40[_0xdef6('0x35')]:_0x3b4faf[_0xdef6('0x30')];_0x5a0f40[_0xdef6('0x38')]=qs[_0xdef6('0x39')](_0x56825f['query'][_0xdef6('0x39')]);_0x5a0f40[_0xdef6('0x3b')]=qs[_0xdef6('0x3a')](_['pick'](_0x56825f[_0xdef6('0x31')],_0x3b4faf[_0xdef6('0x3a')]));if(_0x56825f[_0xdef6('0x31')]['filter']){_0x5a0f40[_0xdef6('0x3b')]=_['merge'](_0x5a0f40[_0xdef6('0x3b')],{'$or':_[_0xdef6('0x2c')](_0x5a0f40[_0xdef6('0x35')],function(_0x6e47a1){var _0x4cf649={};_0x4cf649[_0x6e47a1]={'$like':'%'+_0x56825f['query']['filter']+'%'};return _0x4cf649;})});}_0x5a0f40=_[_0xdef6('0x4c')]({},_0x5a0f40,_0x56825f[_0xdef6('0x3e')]);return _0x387664[_0xdef6('0x4a')](_0x5a0f40);}})['then'](function(_0x16c373){if(_0x16c373){_0x5b09ee=_0x16c373[_0xdef6('0x36')];if(!_0x56825f[_0xdef6('0x31')][_0xdef6('0x4d')](_0xdef6('0x37'))){_0x5a0f40[_0xdef6('0x1d')]=qs[_0xdef6('0x1d')](_0x56825f['query']['limit']);_0x5a0f40[_0xdef6('0x1e')]=qs[_0xdef6('0x1e')](_0x56825f[_0xdef6('0x31')]['offset']);}return _0x387664[_0xdef6('0x4a')](_0x5a0f40);}})['then'](function(_0x4e35a7){if(_0x4e35a7){return _0x4e35a7?{'count':_0x5b09ee,'rows':_0x4e35a7}:null;}})[_0xdef6('0x26')](respondWithResult(_0x1530ab,null))[_0xdef6('0x4e')](handleError(_0x1530ab,null));};exports[_0xdef6('0x4f')]=function(_0x167e49,_0x1d6a34,_0x58a32f){if(_0x167e49[_0xdef6('0x47')]['id']){delete _0x167e49['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x167e49[_0xdef6('0x49')]['id']}})[_0xdef6('0x26')](handleEntityNotFound(_0x1d6a34,null))[_0xdef6('0x26')](function(_0x1c6ad1){if(_0x1c6ad1){_0x167e49[_0xdef6('0x47')]['AccountId']=_0x1c6ad1['id'];_0x167e49[_0xdef6('0x47')][_0xdef6('0x50')]=integrations[_0xdef6('0x51')](_0x167e49[_0xdef6('0x47')][_0xdef6('0x52')],_0x167e49['body'][_0xdef6('0x3c')]);_0x167e49[_0xdef6('0x47')][_0xdef6('0x53')]=integrations[_0xdef6('0x54')](_0x167e49[_0xdef6('0x47')][_0xdef6('0x52')],_0x167e49[_0xdef6('0x47')]['type']);return db[_0xdef6('0x55')][_0xdef6('0x46')](_0x167e49[_0xdef6('0x47')],{'include':[{'model':db[_0xdef6('0x56')],'as':'Subjects'},{'model':db[_0xdef6('0x56')],'as':_0xdef6('0x53')}]});}return null;})[_0xdef6('0x26')](respondWithResult(_0x1d6a34,null))[_0xdef6('0x4e')](handleError(_0x1d6a34,null));};var md5=require(_0xdef6('0x57'));exports[_0xdef6('0x58')]=function(_0x625760,_0x2cec6a,_0x2ae29a){var _0x57c30a=null;var _0x1f581f=null;var _0x19d74e=null;var _0x49e6a9=null;var _0x889751='';return db[_0xdef6('0x2d')][_0xdef6('0x4b')]({'where':{'id':_0x625760[_0xdef6('0x49')]['id']},'attributes':['id',_0xdef6('0x2a'),_0xdef6('0x59'),_0xdef6('0x5a'),_0xdef6('0x5b'),_0xdef6('0x5c'),'serverUrl',_0xdef6('0x5d')]})['then'](handleEntityNotFound(_0x2cec6a,null))[_0xdef6('0x26')](function(_0x430938){if(_0x430938){_0x57c30a=_0x430938[_0xdef6('0x59')];_0x1f581f=_0x430938[_0xdef6('0x5d')];_0x19d74e=_0x430938[_0xdef6('0x5b')];_0x889751=_0x430938[_0xdef6('0x5c')];var _0x284342=_0x889751['slice'](-0x1);if(_0x284342==='/'){_0x889751=_0x889751['substring'](0x0,_0x889751[_0xdef6('0x5e')](_0x284342));}_0x49e6a9=util[_0xdef6('0x5f')](_0xdef6('0x60'),_0x889751);var _0x4ce07e={'method':_0xdef6('0x61'),'uri':_0x49e6a9,'qs':{'operation':_0xdef6('0x62'),'username':_0x430938['username']},'json':!![]};return rp(_0x4ce07e);}})['then'](function(_0xdd668e){if(_0xdd668e['success']){var _0x36d62e={'method':'POST','uri':_0x49e6a9,'form':{'operation':'login','username':_0x57c30a,'accessKey':md5(_0xdd668e[_0xdef6('0x63')][_0xdef6('0x64')]+_0x1f581f)},'json':!![]};return rp(_0x36d62e);}})['then'](function(_0x411724){if(_0x411724[_0xdef6('0x65')]){var _0x44a3cf={'method':'GET','uri':_0x49e6a9,'qs':{'operation':_0xdef6('0x66'),'username':_0x57c30a,'sessionName':_0x411724[_0xdef6('0x63')][_0xdef6('0x67')],'elementType':_0x19d74e},'json':!![]};return rp(_0x44a3cf);}})[_0xdef6('0x26')](function(_0x526736){if(_0x526736[_0xdef6('0x65')]){var _0x55017d=[_0xdef6('0x68'),_0xdef6('0x69'),_0xdef6('0x6a')];_[_0xdef6('0x6b')](_0x526736['result'][_0xdef6('0x34')],function(_0x22eada){return _0x55017d['includes'](_0x22eada[_0xdef6('0x3c')][_0xdef6('0x2a')]);});_[_0xdef6('0x6b')](_0x526736[_0xdef6('0x63')]['fields'],function(_0x3f5fc7){return _0x3f5fc7['editable']==='false';});return{'count':_0x526736[_0xdef6('0x63')]['fields']['length'],'rows':_['map'](_0x526736[_0xdef6('0x63')][_0xdef6('0x34')],function(_0x258bd6){return{'id':_0x258bd6['name'],'name':_0x258bd6[_0xdef6('0x6c')],'custom':_[_0xdef6('0x6d')](_0x258bd6[_0xdef6('0x2a')],_0xdef6('0x6e'))?!![]:![],'options':_0x258bd6['type'][_0xdef6('0x2a')]===_0xdef6('0x6f')&&_0x258bd6[_0xdef6('0x3c')][_0xdef6('0x70')][_0xdef6('0x36')]>0x0?_[_0xdef6('0x2c')](_0x258bd6[_0xdef6('0x3c')]['picklistValues'],function(_0x34d3c1){return{'name':_0x34d3c1[_0xdef6('0x6c')],'value':_0x34d3c1[_0xdef6('0x71')]};}):[]};})};}})[_0xdef6('0x26')](respondWithResult(_0x2cec6a,null))[_0xdef6('0x4e')](function(_0x38929f){console[_0xdef6('0x72')](_0xdef6('0x73')+_0x38929f);var _0xe64689=_0x625760[_0xdef6('0x31')][_0xdef6('0x74')]?0x1f4:_0x38929f[_0xdef6('0x75')]||0x1f4;logger[_0xdef6('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xe64689,JSON[_0xdef6('0x76')](_0x38929f));delete _0x38929f['name'];if(_0xe64689===0x191){_0xe64689=0x190;}_0x2cec6a[_0xdef6('0x1a')](_0xe64689)[_0xdef6('0x2b')](_0x625760['query'][_0xdef6('0x74')]?{'message':_0xdef6('0x77'),'statusCode':_0x38929f[_0xdef6('0x75')]}:_0x38929f);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 8aec96c..e3a583b 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 _0xe684=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe684,0x77));var _0x4e68=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xe684[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x4e68('0x0'));var util=require('util');var logger=require(_0x4e68('0x1'))(_0x4e68('0x2'));var moment=require(_0x4e68('0x3'));var BPromise=require(_0x4e68('0x4'));var rp=require(_0x4e68('0x5'));var fs=require('fs');var path=require(_0x4e68('0x6'));var rimraf=require(_0x4e68('0x7'));var config=require(_0x4e68('0x8'));var attributes=require(_0x4e68('0x9'));var integrations=require(_0x4e68('0xa'));module[_0x4e68('0xb')]=function(_0x383e02,_0x5ce845){return _0x383e02[_0x4e68('0xc')]('VtigerAccount',attributes,{'tableName':_0x4e68('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4607=['../../components/integrations/configuration','VtigerAccount','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4607,0x1d8));var _0x7460=function(_0x187593,_0x59a685){_0x187593=_0x187593-0x0;var _0x39f3ef=_0x4607[_0x187593];return _0x39f3ef;};'use strict';var _=require('lodash');var util=require(_0x7460('0x0'));var logger=require('../../config/logger')(_0x7460('0x1'));var moment=require('moment');var BPromise=require(_0x7460('0x2'));var rp=require(_0x7460('0x3'));var fs=require('fs');var path=require(_0x7460('0x4'));var rimraf=require(_0x7460('0x5'));var config=require(_0x7460('0x6'));var attributes=require(_0x7460('0x7'));var integrations=require(_0x7460('0x8'));module['exports']=function(_0xce740f,_0x387459){return _0xce740f['define'](_0x7460('0x9'),attributes,{'tableName':'int_vtiger_accounts','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 1ee3802..f7dacc7 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 _0xeb74=['attributes','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map'];(function(_0x3ca03e,_0x9d45cd){var _0x3515b2=function(_0x5f1c91){while(--_0x5f1c91){_0x3ca03e['push'](_0x3ca03e['shift']());}};_0x3515b2(++_0x9d45cd);}(_0xeb74,0xe3));var _0x4eb7=function(_0x6bd8f1,_0x5b3f11){_0x6bd8f1=_0x6bd8f1-0x0;var _0x22841b=_0xeb74[_0x6bd8f1];return _0x22841b;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')]({'raw':_0x3b6d41['options']?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')]['attributes']||null:null,'limit':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1d')]||null:null,'include':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0x13e871){return{'model':db[_0x13e871['model']],'as':_0x13e871['as'],'attributes':_0x13e871[_0x4eb7('0x20')],'include':_0x13e871[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x13e871[_0x4eb7('0x1e')],function(_0x3e0da2){return{'model':db[_0x3e0da2[_0x4eb7('0x21')]],'as':_0x3e0da2['as'],'attributes':_0x3e0da2[_0x4eb7('0x20')],'include':_0x3e0da2[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3e0da2[_0x4eb7('0x1e')],function(_0xf83c11){return{'model':db[_0xf83c11[_0x4eb7('0x21')]],'as':_0xf83c11['as'],'attributes':_0xf83c11[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x433794){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger[_0x4eb7('0xe')](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x22')](_0x433794));_0x302e16(_0x433794);})[_0x4eb7('0x16')](function(_0x17030a){logger[_0x4eb7('0x11')]('GetVtigerAccount',_0x17030a[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478['error'](0x1f4,_0x17030a[_0x4eb7('0x13')]));});});};exports[_0x4eb7('0x23')]=function(_0xc5aa21){var _0x1fe298=this;return new Promise(function(_0x468195,_0x1cec8e){return db[_0x4eb7('0x18')][_0x4eb7('0x24')]({'raw':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21['options'][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5aa21['options']?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0xc5aa21['options']?_0xc5aa21['options'][_0x4eb7('0x20')]||null:null,'include':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_['map'](_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0xcc9bb4){return{'model':db[_0xcc9bb4[_0x4eb7('0x21')]],'as':_0xcc9bb4['as'],'attributes':_0xcc9bb4[_0x4eb7('0x20')],'include':_0xcc9bb4['include']?_[_0x4eb7('0x1f')](_0xcc9bb4[_0x4eb7('0x1e')],function(_0x31cc6d){return{'model':db[_0x31cc6d['model']],'as':_0x31cc6d['as'],'attributes':_0x31cc6d[_0x4eb7('0x20')],'include':_0x31cc6d[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x31cc6d['include'],function(_0x70f2b2){return{'model':db[_0x70f2b2['model']],'as':_0x70f2b2['as'],'attributes':_0x70f2b2[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x392fa3){logger[_0x4eb7('0x14')]('ShowVtigerAccount',_0xc5aa21);logger[_0x4eb7('0xe')](_0x4eb7('0x23'),_0xc5aa21,JSON[_0x4eb7('0x22')](_0x392fa3));_0x468195(_0x392fa3);})[_0x4eb7('0x16')](function(_0x4f0cce){logger['error']('ShowVtigerAccount',_0x4f0cce[_0x4eb7('0x13')],_0xc5aa21);_0x1cec8e(_0x1fe298[_0x4eb7('0x11')](0x1f4,_0x4f0cce[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0xa571=['http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x4df92b,_0x32a4bb){var _0x223d6c=function(_0x392dfb){while(--_0x392dfb){_0x4df92b['push'](_0x4df92b['shift']());}};_0x223d6c(++_0x32a4bb);}(_0xa571,0x107));var _0x1a57=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0xa571[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')]({'raw':_0x1662a3[_0x1a57('0x18')]?_0x1662a3[_0x1a57('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1662a3['options']?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x19')]||null:null,'attributes':_0x1662a3[_0x1a57('0x18')]?_0x1662a3['options']['attributes']||null:null,'limit':_0x1662a3['options']?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1a')]||null:null,'include':_0x1662a3[_0x1a57('0x18')]?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1b')],function(_0x183ca3){return{'model':db[_0x183ca3[_0x1a57('0x1d')]],'as':_0x183ca3['as'],'attributes':_0x183ca3[_0x1a57('0x1e')],'include':_0x183ca3[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x183ca3[_0x1a57('0x1b')],function(_0x2f9454){return{'model':db[_0x2f9454[_0x1a57('0x1d')]],'as':_0x2f9454['as'],'attributes':_0x2f9454[_0x1a57('0x1e')],'include':_0x2f9454[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x2f9454[_0x1a57('0x1b')],function(_0x26584b){return{'model':db[_0x26584b[_0x1a57('0x1d')]],'as':_0x26584b['as'],'attributes':_0x26584b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x139d8c){logger[_0x1a57('0xc')]('GetVtigerAccount',_0x1662a3);logger[_0x1a57('0xf')]('GetVtigerAccount',_0x1662a3,JSON[_0x1a57('0x11')](_0x139d8c));_0x53bb20(_0x139d8c);})[_0x1a57('0x14')](function(_0x53bf6e){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x53bf6e[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x53bf6e['message']));});});};exports[_0x1a57('0x1f')]=function(_0x396832){var _0x4374f0=this;return new Promise(function(_0x160536,_0x5763ba){return db[_0x1a57('0x16')][_0x1a57('0x20')]({'raw':_0x396832[_0x1a57('0x18')]?_0x396832[_0x1a57('0x18')][_0x1a57('0x21')]===undefined?!![]:![]:!![],'where':_0x396832[_0x1a57('0x18')]?_0x396832[_0x1a57('0x18')][_0x1a57('0x19')]||null:null,'attributes':_0x396832[_0x1a57('0x18')]?_0x396832['options'][_0x1a57('0x1e')]||null:null,'include':_0x396832[_0x1a57('0x18')]?_0x396832['options']['include']?_[_0x1a57('0x1c')](_0x396832[_0x1a57('0x18')][_0x1a57('0x1b')],function(_0x170bf7){return{'model':db[_0x170bf7[_0x1a57('0x1d')]],'as':_0x170bf7['as'],'attributes':_0x170bf7[_0x1a57('0x1e')],'include':_0x170bf7[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x170bf7[_0x1a57('0x1b')],function(_0x2a6feb){return{'model':db[_0x2a6feb[_0x1a57('0x1d')]],'as':_0x2a6feb['as'],'attributes':_0x2a6feb[_0x1a57('0x1e')],'include':_0x2a6feb[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x2a6feb[_0x1a57('0x1b')],function(_0x12102f){return{'model':db[_0x12102f[_0x1a57('0x1d')]],'as':_0x12102f['as'],'attributes':_0x12102f[_0x1a57('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cd160){logger[_0x1a57('0xc')](_0x1a57('0x1f'),_0x396832);logger[_0x1a57('0xf')](_0x1a57('0x1f'),_0x396832,JSON[_0x1a57('0x11')](_0x3cd160));_0x160536(_0x3cd160);})[_0x1a57('0x14')](function(_0x23d087){logger[_0x1a57('0x12')]('ShowVtigerAccount',_0x23d087['message'],_0x396832);_0x5763ba(_0x4374f0['error'](0x1f4,_0x23d087['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f2fa57f..292ef78 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 _0x9fad=['getSubjects','getDescriptions','post','put','update','delete','/:id','exports','multer','util','path','express','Router','fs-extra','get','isAuthenticated','show','getFields','/:id/subjects'];(function(_0x1f870d,_0x2c8e07){var _0x99757f=function(_0x411066){while(--_0x411066){_0x1f870d['push'](_0x1f870d['shift']());}};_0x99757f(++_0x2c8e07);}(_0x9fad,0x112));var _0xd9fa=function(_0xcd1c05,_0x1cdab3){_0xcd1c05=_0xcd1c05-0x0;var _0x260a01=_0x9fad[_0xcd1c05];return _0x260a01;};'use strict';var multer=require(_0xd9fa('0x0'));var util=require(_0xd9fa('0x1'));var path=require(_0xd9fa('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9fa('0x3'));var router=express[_0xd9fa('0x4')]();var fs_extra=require(_0xd9fa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xd9fa('0x6')]('/',auth[_0xd9fa('0x7')](),controller['index']);router[_0xd9fa('0x6')]('/:id',auth[_0xd9fa('0x7')](),controller[_0xd9fa('0x8')]);router[_0xd9fa('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd9fa('0x9')]);router[_0xd9fa('0x6')](_0xd9fa('0xa'),auth[_0xd9fa('0x7')](),controller[_0xd9fa('0xb')]);router[_0xd9fa('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xd9fa('0xc')]);router[_0xd9fa('0xd')]('/',auth[_0xd9fa('0x7')](),controller['create']);router[_0xd9fa('0xe')]('/:id',auth[_0xd9fa('0x7')](),controller[_0xd9fa('0xf')]);router[_0xd9fa('0x10')](_0xd9fa('0x11'),auth[_0xd9fa('0x7')](),controller['destroy']);module[_0xd9fa('0x12')]=router; \ No newline at end of file +var _0x0aa0=['fs-extra','./intVtigerConfiguration.controller','isAuthenticated','index','get','getFields','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x4a3d88,_0x3b7912){var _0x56b4ed=function(_0x5c05d9){while(--_0x5c05d9){_0x4a3d88['push'](_0x4a3d88['shift']());}};_0x56b4ed(++_0x3b7912);}(_0x0aa0,0x1de));var _0x00aa=function(_0x1d9c8f,_0x1c3e51){_0x1d9c8f=_0x1d9c8f-0x0;var _0x44dd65=_0x0aa0[_0x1d9c8f];return _0x44dd65;};'use strict';var multer=require(_0x00aa('0x0'));var util=require(_0x00aa('0x1'));var path=require(_0x00aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x00aa('0x3'));var router=express[_0x00aa('0x4')]();var fs_extra=require(_0x00aa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x00aa('0x6'));router['get']('/',auth[_0x00aa('0x7')](),controller[_0x00aa('0x8')]);router[_0x00aa('0x9')]('/:id',auth[_0x00aa('0x7')](),controller['show']);router[_0x00aa('0x9')]('/:id/fields',auth[_0x00aa('0x7')](),controller[_0x00aa('0xa')]);router[_0x00aa('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x00aa('0xb')]);router[_0x00aa('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x00aa('0xc')]);router[_0x00aa('0xd')]('/',auth[_0x00aa('0x7')](),controller[_0x00aa('0xe')]);router[_0x00aa('0xf')](_0x00aa('0x10'),auth[_0x00aa('0x7')](),controller[_0x00aa('0x11')]);router[_0x00aa('0x12')]('/:id',auth[_0x00aa('0x7')](),controller[_0x00aa('0x13')]);module[_0x00aa('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a14cfef..de78b5f 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 _0x7f45=['exports','STRING','sequelize'];(function(_0x9fd5b6,_0xa9573f){var _0x54da6a=function(_0x4eb378){while(--_0x4eb378){_0x9fd5b6['push'](_0x9fd5b6['shift']());}};_0x54da6a(++_0xa9573f);}(_0x7f45,0xf8));var _0x57f4=function(_0x88c95b,_0x90638a){_0x88c95b=_0x88c95b-0x0;var _0x572ca0=_0x7f45[_0x88c95b];return _0x572ca0;};'use strict';var Sequelize=require(_0x57f4('0x0'));module[_0x57f4('0x1')]={'name':{'type':Sequelize[_0x57f4('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x26c4=['sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x26c4,0xb1));var _0x426c=function(_0x465447,_0x3a56e0){_0x465447=_0x465447-0x0;var _0x55a4b5=_0x26c4[_0x465447];return _0x55a4b5;};'use strict';var Sequelize=require(_0x426c('0x0'));module[_0x426c('0x1')]={'name':{'type':Sequelize[_0x426c('0x2')]},'description':{'type':Sequelize[_0x426c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 742b58f..2cfac8d 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 _0xbfc9=['send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','VtigerField','getFields','hasOwnProperty','nolimit','findOne','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','error','stack','name'];(function(_0x2f7a9b,_0x2a102d){var _0x2cc3ae=function(_0x2e384a){while(--_0x2e384a){_0x2f7a9b['push'](_0x2f7a9b['shift']());}};_0x2cc3ae(++_0x2a102d);}(_0xbfc9,0x173));var _0x9bfc=function(_0x88cb5e,_0x97fdf1){_0x88cb5e=_0x88cb5e-0x0;var _0x6a0b8a=_0xbfc9[_0x88cb5e];return _0x6a0b8a;};'use strict';var emlformat=require(_0x9bfc('0x0'));var rimraf=require(_0x9bfc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bfc('0x2'));var rp=require('request-promise');var moment=require(_0x9bfc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9bfc('0x4'));var util=require(_0x9bfc('0x5'));var path=require(_0x9bfc('0x6'));var sox=require(_0x9bfc('0x7'));var csv=require('to-csv');var ejs=require(_0x9bfc('0x8'));var fs=require('fs');var fs_extra=require(_0x9bfc('0x9'));var _=require(_0x9bfc('0xa'));var squel=require(_0x9bfc('0xb'));var crypto=require(_0x9bfc('0xc'));var jsforce=require(_0x9bfc('0xd'));var deskjs=require(_0x9bfc('0xe'));var toCsv=require(_0x9bfc('0xf'));var querystring=require(_0x9bfc('0x10'));var Papa=require(_0x9bfc('0x11'));var Redis=require('ioredis');var authService=require(_0x9bfc('0x12'));var qs=require(_0x9bfc('0x13'));var as=require(_0x9bfc('0x14'));var hardwareService=require(_0x9bfc('0x15'));var logger=require(_0x9bfc('0x16'))(_0x9bfc('0x17'));var utils=require('../../config/utils');var config=require(_0x9bfc('0x18'));var licenseUtil=require(_0x9bfc('0x19'));var db=require(_0x9bfc('0x1a'))['db'];function respondWithStatusCode(_0xd08ef1,_0x1831cc){_0x1831cc=_0x1831cc||0xcc;return function(_0x3d5470){if(_0x3d5470){return _0xd08ef1[_0x9bfc('0x1b')](_0x1831cc);}return _0xd08ef1[_0x9bfc('0x1c')](_0x1831cc)[_0x9bfc('0x1d')]();};}function respondWithResult(_0x150c98,_0x6d13c7){_0x6d13c7=_0x6d13c7||0xc8;return function(_0x4cf02a){if(_0x4cf02a){return _0x150c98[_0x9bfc('0x1c')](_0x6d13c7)[_0x9bfc('0x1e')](_0x4cf02a);}};}function respondWithFilteredResult(_0x186e1b,_0xd88755){return function(_0x4baed5){if(_0x4baed5){var _0x751484=typeof _0xd88755[_0x9bfc('0x1f')]===_0x9bfc('0x20')&&typeof _0xd88755['limit']===_0x9bfc('0x20');var _0x20a4e5=_0x4baed5[_0x9bfc('0x21')];var _0x49ec09=_0x751484?0x0:_0xd88755['offset'];var _0x1dde53=_0x751484?_0x4baed5[_0x9bfc('0x21')]:_0xd88755['offset']+_0xd88755[_0x9bfc('0x22')];var _0xd0face;if(_0x1dde53>=_0x20a4e5){_0x1dde53=_0x20a4e5;_0xd0face=0xc8;}else{_0xd0face=0xce;}_0x186e1b[_0x9bfc('0x1c')](_0xd0face);return _0x186e1b[_0x9bfc('0x23')](_0x9bfc('0x24'),_0x49ec09+'-'+_0x1dde53+'/'+_0x20a4e5)[_0x9bfc('0x1e')](_0x4baed5);}return null;};}function patchUpdates(_0x3e1b4e){return function(_0x32126d){try{jsonpatch['apply'](_0x32126d,_0x3e1b4e,!![]);}catch(_0x5f3382){return BPromise[_0x9bfc('0x25')](_0x5f3382);}return _0x32126d['save']();};}function saveUpdates(_0x448e11,_0x1d8cef){return function(_0x5c3927){if(_0x5c3927){return _0x5c3927[_0x9bfc('0x26')](_0x448e11)['then'](function(_0x56e3a7){return _0x56e3a7;});}return null;};}function removeEntity(_0x5cb081,_0x331769){return function(_0x5ba667){if(_0x5ba667){return _0x5ba667[_0x9bfc('0x27')]()[_0x9bfc('0x28')](function(){_0x5cb081[_0x9bfc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27389c,_0x11dc75){return function(_0x1dbd78){if(!_0x1dbd78){_0x27389c[_0x9bfc('0x1b')](0x194);}return _0x1dbd78;};}function handleError(_0x196242,_0x18f907){_0x18f907=_0x18f907||0x1f4;return function(_0x32c09f){logger[_0x9bfc('0x29')](_0x32c09f[_0x9bfc('0x2a')]);if(_0x32c09f[_0x9bfc('0x2b')]){delete _0x32c09f[_0x9bfc('0x2b')];}_0x196242[_0x9bfc('0x1c')](_0x18f907)[_0x9bfc('0x2c')](_0x32c09f);};}exports[_0x9bfc('0x2d')]=function(_0x4accc1,_0x3abf60){var _0x451054={},_0x295e69={},_0x4b3b59={'count':0x0,'rows':[]};var _0x35c7df=_[_0x9bfc('0x2e')](db[_0x9bfc('0x2f')][_0x9bfc('0x30')],function(_0x373e33){return{'name':_0x373e33[_0x9bfc('0x31')],'type':_0x373e33[_0x9bfc('0x32')]['key']};});_0x295e69[_0x9bfc('0x33')]=_[_0x9bfc('0x2e')](_0x35c7df,'name');_0x295e69[_0x9bfc('0x34')]=_['keys'](_0x4accc1[_0x9bfc('0x34')]);_0x295e69['filters']=_[_0x9bfc('0x35')](_0x295e69['model'],_0x295e69[_0x9bfc('0x34')]);_0x451054['attributes']=_[_0x9bfc('0x35')](_0x295e69['model'],qs['fields'](_0x4accc1[_0x9bfc('0x34')][_0x9bfc('0x36')]));_0x451054[_0x9bfc('0x37')]=_0x451054['attributes'][_0x9bfc('0x38')]?_0x451054[_0x9bfc('0x37')]:_0x295e69[_0x9bfc('0x33')];if(!_0x4accc1[_0x9bfc('0x34')]['hasOwnProperty']('nolimit')){_0x451054[_0x9bfc('0x22')]=qs['limit'](_0x4accc1[_0x9bfc('0x34')][_0x9bfc('0x22')]);_0x451054[_0x9bfc('0x1f')]=qs['offset'](_0x4accc1[_0x9bfc('0x34')][_0x9bfc('0x1f')]);}_0x451054[_0x9bfc('0x39')]=qs[_0x9bfc('0x3a')](_0x4accc1[_0x9bfc('0x34')][_0x9bfc('0x3a')]);_0x451054['where']=qs[_0x9bfc('0x3b')](_[_0x9bfc('0x3c')](_0x4accc1['query'],_0x295e69[_0x9bfc('0x3b')]),_0x35c7df);if(_0x4accc1['query'][_0x9bfc('0x3d')]){_0x451054['where']=_[_0x9bfc('0x3e')](_0x451054[_0x9bfc('0x3f')],{'$or':_[_0x9bfc('0x2e')](_0x35c7df,function(_0xd85f37){if(_0xd85f37['type']!==_0x9bfc('0x40')){var _0x3f2a3b={};_0x3f2a3b[_0xd85f37[_0x9bfc('0x2b')]]={'$like':'%'+_0x4accc1['query'][_0x9bfc('0x3d')]+'%'};return _0x3f2a3b;}})});}_0x451054=_[_0x9bfc('0x3e')]({},_0x451054,_0x4accc1[_0x9bfc('0x41')]);var _0x20e583={'where':_0x451054[_0x9bfc('0x3f')]};return db[_0x9bfc('0x2f')][_0x9bfc('0x21')](_0x20e583)[_0x9bfc('0x28')](function(_0x493ce0){_0x4b3b59[_0x9bfc('0x21')]=_0x493ce0;if(_0x4accc1['query'][_0x9bfc('0x42')]){_0x451054[_0x9bfc('0x43')]=[{'all':!![]}];}return db[_0x9bfc('0x2f')][_0x9bfc('0x44')](_0x451054);})[_0x9bfc('0x28')](function(_0x13029b){_0x4b3b59['rows']=_0x13029b;return _0x4b3b59;})[_0x9bfc('0x28')](respondWithFilteredResult(_0x3abf60,_0x451054))[_0x9bfc('0x45')](handleError(_0x3abf60,null));};exports[_0x9bfc('0x46')]=function(_0x11a36c,_0x3e1522){var _0x11b749={'raw':![],'where':{'id':_0x11a36c['params']['id']}},_0x48dda6={};_0x48dda6[_0x9bfc('0x33')]=_[_0x9bfc('0x47')](db[_0x9bfc('0x2f')][_0x9bfc('0x30')]);_0x48dda6[_0x9bfc('0x34')]=_['keys'](_0x11a36c[_0x9bfc('0x34')]);_0x48dda6[_0x9bfc('0x3b')]=_[_0x9bfc('0x35')](_0x48dda6[_0x9bfc('0x33')],_0x48dda6[_0x9bfc('0x34')]);_0x11b749[_0x9bfc('0x37')]=_[_0x9bfc('0x35')](_0x48dda6[_0x9bfc('0x33')],qs[_0x9bfc('0x36')](_0x11a36c['query'][_0x9bfc('0x36')]));_0x11b749[_0x9bfc('0x37')]=_0x11b749['attributes']['length']?_0x11b749[_0x9bfc('0x37')]:_0x48dda6['model'];if(_0x11a36c['query']['includeAll']){_0x11b749[_0x9bfc('0x43')]=[{'all':!![]}];}_0x11b749=_[_0x9bfc('0x3e')]({},_0x11b749,_0x11a36c[_0x9bfc('0x41')]);return db[_0x9bfc('0x2f')][_0x9bfc('0x48')](_0x11b749)[_0x9bfc('0x28')](handleEntityNotFound(_0x3e1522,null))[_0x9bfc('0x28')](respondWithResult(_0x3e1522,null))[_0x9bfc('0x45')](handleError(_0x3e1522,null));};exports[_0x9bfc('0x49')]=function(_0xf7291e,_0x8f5f85){return db['VtigerConfiguration'][_0x9bfc('0x49')](_0xf7291e[_0x9bfc('0x4a')],{})[_0x9bfc('0x28')](respondWithResult(_0x8f5f85,0xc9))[_0x9bfc('0x45')](handleError(_0x8f5f85,null));};exports['update']=function(_0x378335,_0x28d01f){if(_0x378335[_0x9bfc('0x4a')]['id']){delete _0x378335[_0x9bfc('0x4a')]['id'];}return db[_0x9bfc('0x2f')][_0x9bfc('0x48')]({'where':{'id':_0x378335[_0x9bfc('0x4b')]['id']}})[_0x9bfc('0x28')](handleEntityNotFound(_0x28d01f,null))[_0x9bfc('0x28')](saveUpdates(_0x378335[_0x9bfc('0x4a')],null))[_0x9bfc('0x28')](respondWithResult(_0x28d01f,null))[_0x9bfc('0x45')](handleError(_0x28d01f,null));};exports[_0x9bfc('0x27')]=function(_0x359e8c,_0x530726){return db[_0x9bfc('0x2f')][_0x9bfc('0x48')]({'where':{'id':_0x359e8c['params']['id']}})['then'](handleEntityNotFound(_0x530726,null))[_0x9bfc('0x28')](removeEntity(_0x530726,null))['catch'](handleError(_0x530726,null));};exports['getFields']=function(_0x248095,_0x310440,_0x537cb9){var _0x251323={};var _0x349997={};var _0x1feb2c;var _0x5271a9;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x248095[_0x9bfc('0x4b')]['id']}})[_0x9bfc('0x28')](handleEntityNotFound(_0x310440,null))['then'](function(_0x5a073c){if(_0x5a073c){_0x1feb2c=_0x5a073c;_0x349997[_0x9bfc('0x33')]=_[_0x9bfc('0x47')](db[_0x9bfc('0x4c')][_0x9bfc('0x30')]);_0x349997[_0x9bfc('0x34')]=_[_0x9bfc('0x47')](_0x248095[_0x9bfc('0x34')]);_0x349997[_0x9bfc('0x3b')]=_[_0x9bfc('0x35')](_0x349997[_0x9bfc('0x33')],_0x349997[_0x9bfc('0x34')]);_0x251323['attributes']=_[_0x9bfc('0x35')](_0x349997[_0x9bfc('0x33')],qs[_0x9bfc('0x36')](_0x248095[_0x9bfc('0x34')][_0x9bfc('0x36')]));_0x251323[_0x9bfc('0x37')]=_0x251323[_0x9bfc('0x37')][_0x9bfc('0x38')]?_0x251323[_0x9bfc('0x37')]:_0x349997[_0x9bfc('0x33')];_0x251323[_0x9bfc('0x39')]=qs[_0x9bfc('0x3a')](_0x248095[_0x9bfc('0x34')][_0x9bfc('0x3a')]);_0x251323[_0x9bfc('0x3f')]=qs[_0x9bfc('0x3b')](_[_0x9bfc('0x3c')](_0x248095[_0x9bfc('0x34')],_0x349997[_0x9bfc('0x3b')]));if(_0x248095[_0x9bfc('0x34')]['filter']){_0x251323['where']=_['merge'](_0x251323[_0x9bfc('0x3f')],{'$or':_[_0x9bfc('0x2e')](_0x251323['attributes'],function(_0x27573b){var _0x1da694={};_0x1da694[_0x27573b]={'$like':'%'+_0x248095[_0x9bfc('0x34')][_0x9bfc('0x3d')]+'%'};return _0x1da694;})});}_0x251323=_[_0x9bfc('0x3e')]({},_0x251323,_0x248095['options']);return _0x1feb2c[_0x9bfc('0x4d')](_0x251323);}})[_0x9bfc('0x28')](function(_0x4f6fac){if(_0x4f6fac){_0x5271a9=_0x4f6fac[_0x9bfc('0x38')];if(!_0x248095[_0x9bfc('0x34')][_0x9bfc('0x4e')](_0x9bfc('0x4f'))){_0x251323['limit']=qs[_0x9bfc('0x22')](_0x248095['query'][_0x9bfc('0x22')]);_0x251323['offset']=qs[_0x9bfc('0x1f')](_0x248095[_0x9bfc('0x34')]['offset']);}return _0x1feb2c[_0x9bfc('0x4d')](_0x251323);}})['then'](function(_0x5b1c82){if(_0x5b1c82){return _0x5b1c82?{'count':_0x5271a9,'rows':_0x5b1c82}:null;}})[_0x9bfc('0x28')](respondWithResult(_0x310440,null))['catch'](handleError(_0x310440,null));};exports['getSubjects']=function(_0x3b9cdc,_0x468f74,_0x42efd7){var _0x5577ee={};var _0x3703e9={};var _0x25f6fe;var _0x558e8f;return db[_0x9bfc('0x2f')][_0x9bfc('0x50')]({'where':{'id':_0x3b9cdc['params']['id']}})[_0x9bfc('0x28')](handleEntityNotFound(_0x468f74,null))[_0x9bfc('0x28')](function(_0x4804aa){if(_0x4804aa){_0x25f6fe=_0x4804aa;_0x3703e9[_0x9bfc('0x33')]=_[_0x9bfc('0x47')](db[_0x9bfc('0x4c')][_0x9bfc('0x30')]);_0x3703e9[_0x9bfc('0x34')]=_['keys'](_0x3b9cdc['query']);_0x3703e9[_0x9bfc('0x3b')]=_[_0x9bfc('0x35')](_0x3703e9[_0x9bfc('0x33')],_0x3703e9[_0x9bfc('0x34')]);_0x5577ee[_0x9bfc('0x37')]=_[_0x9bfc('0x35')](_0x3703e9['model'],qs[_0x9bfc('0x36')](_0x3b9cdc[_0x9bfc('0x34')][_0x9bfc('0x36')]));_0x5577ee['attributes']=_0x5577ee[_0x9bfc('0x37')]['length']?_0x5577ee['attributes']:_0x3703e9[_0x9bfc('0x33')];_0x5577ee['order']=qs['sort'](_0x3b9cdc[_0x9bfc('0x34')][_0x9bfc('0x3a')]);_0x5577ee[_0x9bfc('0x3f')]=qs[_0x9bfc('0x3b')](_[_0x9bfc('0x3c')](_0x3b9cdc['query'],_0x3703e9[_0x9bfc('0x3b')]));if(_0x3b9cdc['query'][_0x9bfc('0x3d')]){_0x5577ee['where']=_[_0x9bfc('0x3e')](_0x5577ee['where'],{'$or':_[_0x9bfc('0x2e')](_0x5577ee[_0x9bfc('0x37')],function(_0x22dd8d){var _0x272fe9={};_0x272fe9[_0x22dd8d]={'$like':'%'+_0x3b9cdc['query'][_0x9bfc('0x3d')]+'%'};return _0x272fe9;})});}_0x5577ee=_[_0x9bfc('0x3e')]({},_0x5577ee,_0x3b9cdc[_0x9bfc('0x41')]);return _0x25f6fe[_0x9bfc('0x51')](_0x5577ee);}})[_0x9bfc('0x28')](function(_0x3d617b){if(_0x3d617b){_0x558e8f=_0x3d617b['length'];if(!_0x3b9cdc[_0x9bfc('0x34')][_0x9bfc('0x4e')](_0x9bfc('0x4f'))){_0x5577ee[_0x9bfc('0x22')]=qs[_0x9bfc('0x22')](_0x3b9cdc[_0x9bfc('0x34')][_0x9bfc('0x22')]);_0x5577ee[_0x9bfc('0x1f')]=qs[_0x9bfc('0x1f')](_0x3b9cdc[_0x9bfc('0x34')][_0x9bfc('0x1f')]);}return _0x25f6fe[_0x9bfc('0x51')](_0x5577ee);}})[_0x9bfc('0x28')](function(_0x44729a){if(_0x44729a){return _0x44729a?{'count':_0x558e8f,'rows':_0x44729a}:null;}})[_0x9bfc('0x28')](respondWithResult(_0x468f74,null))[_0x9bfc('0x45')](handleError(_0x468f74,null));};exports[_0x9bfc('0x52')]=function(_0x194273,_0x3abd04,_0x2369b8){var _0x5099d0={};var _0x567f24={};var _0xaef2e8;var _0x3a427e;return db[_0x9bfc('0x2f')][_0x9bfc('0x50')]({'where':{'id':_0x194273[_0x9bfc('0x4b')]['id']}})[_0x9bfc('0x28')](handleEntityNotFound(_0x3abd04,null))[_0x9bfc('0x28')](function(_0x5d4a19){if(_0x5d4a19){_0xaef2e8=_0x5d4a19;_0x567f24[_0x9bfc('0x33')]=_[_0x9bfc('0x47')](db[_0x9bfc('0x4c')]['rawAttributes']);_0x567f24['query']=_['keys'](_0x194273[_0x9bfc('0x34')]);_0x567f24[_0x9bfc('0x3b')]=_[_0x9bfc('0x35')](_0x567f24[_0x9bfc('0x33')],_0x567f24[_0x9bfc('0x34')]);_0x5099d0[_0x9bfc('0x37')]=_[_0x9bfc('0x35')](_0x567f24[_0x9bfc('0x33')],qs['fields'](_0x194273[_0x9bfc('0x34')]['fields']));_0x5099d0['attributes']=_0x5099d0[_0x9bfc('0x37')][_0x9bfc('0x38')]?_0x5099d0[_0x9bfc('0x37')]:_0x567f24[_0x9bfc('0x33')];_0x5099d0[_0x9bfc('0x39')]=qs['sort'](_0x194273[_0x9bfc('0x34')][_0x9bfc('0x3a')]);_0x5099d0[_0x9bfc('0x3f')]=qs['filters'](_[_0x9bfc('0x3c')](_0x194273[_0x9bfc('0x34')],_0x567f24[_0x9bfc('0x3b')]));if(_0x194273[_0x9bfc('0x34')][_0x9bfc('0x3d')]){_0x5099d0[_0x9bfc('0x3f')]=_['merge'](_0x5099d0[_0x9bfc('0x3f')],{'$or':_[_0x9bfc('0x2e')](_0x5099d0[_0x9bfc('0x37')],function(_0xe52645){var _0x371c87={};_0x371c87[_0xe52645]={'$like':'%'+_0x194273[_0x9bfc('0x34')][_0x9bfc('0x3d')]+'%'};return _0x371c87;})});}_0x5099d0=_[_0x9bfc('0x3e')]({},_0x5099d0,_0x194273['options']);return _0xaef2e8[_0x9bfc('0x52')](_0x5099d0);}})[_0x9bfc('0x28')](function(_0xbdcb46){if(_0xbdcb46){_0x3a427e=_0xbdcb46[_0x9bfc('0x38')];if(!_0x194273[_0x9bfc('0x34')]['hasOwnProperty'](_0x9bfc('0x4f'))){_0x5099d0[_0x9bfc('0x22')]=qs[_0x9bfc('0x22')](_0x194273[_0x9bfc('0x34')][_0x9bfc('0x22')]);_0x5099d0['offset']=qs[_0x9bfc('0x1f')](_0x194273['query'][_0x9bfc('0x1f')]);}return _0xaef2e8[_0x9bfc('0x52')](_0x5099d0);}})[_0x9bfc('0x28')](function(_0x386450){if(_0x386450){return _0x386450?{'count':_0x3a427e,'rows':_0x386450}:null;}})[_0x9bfc('0x28')](respondWithResult(_0x3abd04,null))[_0x9bfc('0x45')](handleError(_0x3abd04,null));}; \ No newline at end of file +var _0x92e8=['offset','undefined','limit','count','reject','save','then','destroy','error','stack','name','send','map','VtigerConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','rawAttributes','create','update','body','find','getFields','findOne','VtigerField','filter','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','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','status','end','json'];(function(_0x575a9d,_0x470f8b){var _0x2558d1=function(_0x4e2cc2){while(--_0x4e2cc2){_0x575a9d['push'](_0x575a9d['shift']());}};_0x2558d1(++_0x470f8b);}(_0x92e8,0x1b3));var _0x892e=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x92e8[_0xea343d];return _0x2c6e9c;};'use strict';var emlformat=require(_0x892e('0x0'));var rimraf=require(_0x892e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x892e('0x2'));var rp=require(_0x892e('0x3'));var moment=require('moment');var BPromise=require(_0x892e('0x4'));var Mustache=require(_0x892e('0x5'));var util=require(_0x892e('0x6'));var path=require(_0x892e('0x7'));var sox=require('sox');var csv=require(_0x892e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x892e('0x9'));var squel=require('squel');var crypto=require(_0x892e('0xa'));var jsforce=require(_0x892e('0xb'));var deskjs=require(_0x892e('0xc'));var toCsv=require(_0x892e('0x8'));var querystring=require(_0x892e('0xd'));var Papa=require(_0x892e('0xe'));var Redis=require(_0x892e('0xf'));var authService=require(_0x892e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x892e('0x11'));var hardwareService=require(_0x892e('0x12'));var logger=require(_0x892e('0x13'))('api');var utils=require(_0x892e('0x14'));var config=require(_0x892e('0x15'));var licenseUtil=require(_0x892e('0x16'));var db=require(_0x892e('0x17'))['db'];function respondWithStatusCode(_0x54fb7a,_0x36a578){_0x36a578=_0x36a578||0xcc;return function(_0x1735a1){if(_0x1735a1){return _0x54fb7a['sendStatus'](_0x36a578);}return _0x54fb7a[_0x892e('0x18')](_0x36a578)[_0x892e('0x19')]();};}function respondWithResult(_0x4b2220,_0x3ca6e1){_0x3ca6e1=_0x3ca6e1||0xc8;return function(_0x25adcb){if(_0x25adcb){return _0x4b2220['status'](_0x3ca6e1)[_0x892e('0x1a')](_0x25adcb);}};}function respondWithFilteredResult(_0x403e71,_0x80950){return function(_0x13d000){if(_0x13d000){var _0x3d7a61=typeof _0x80950[_0x892e('0x1b')]===_0x892e('0x1c')&&typeof _0x80950[_0x892e('0x1d')]===_0x892e('0x1c');var _0x59fa15=_0x13d000['count'];var _0xaa25a1=_0x3d7a61?0x0:_0x80950[_0x892e('0x1b')];var _0x4eb423=_0x3d7a61?_0x13d000[_0x892e('0x1e')]:_0x80950[_0x892e('0x1b')]+_0x80950[_0x892e('0x1d')];var _0x45012c;if(_0x4eb423>=_0x59fa15){_0x4eb423=_0x59fa15;_0x45012c=0xc8;}else{_0x45012c=0xce;}_0x403e71[_0x892e('0x18')](_0x45012c);return _0x403e71['set']('Content-Range',_0xaa25a1+'-'+_0x4eb423+'/'+_0x59fa15)[_0x892e('0x1a')](_0x13d000);}return null;};}function patchUpdates(_0x399338){return function(_0x7c3407){try{jsonpatch['apply'](_0x7c3407,_0x399338,!![]);}catch(_0x1a69ea){return BPromise[_0x892e('0x1f')](_0x1a69ea);}return _0x7c3407[_0x892e('0x20')]();};}function saveUpdates(_0x32eec0,_0xe23293){return function(_0x47fba9){if(_0x47fba9){return _0x47fba9['update'](_0x32eec0)[_0x892e('0x21')](function(_0x37ffa5){return _0x37ffa5;});}return null;};}function removeEntity(_0x3e153d,_0x425d61){return function(_0x221a04){if(_0x221a04){return _0x221a04[_0x892e('0x22')]()[_0x892e('0x21')](function(){_0x3e153d[_0x892e('0x18')](0xcc)[_0x892e('0x19')]();});}};}function handleEntityNotFound(_0x4ec286,_0x11593e){return function(_0x135b00){if(!_0x135b00){_0x4ec286['sendStatus'](0x194);}return _0x135b00;};}function handleError(_0x242e3a,_0x39aa96){_0x39aa96=_0x39aa96||0x1f4;return function(_0x53b032){logger[_0x892e('0x23')](_0x53b032[_0x892e('0x24')]);if(_0x53b032['name']){delete _0x53b032[_0x892e('0x25')];}_0x242e3a[_0x892e('0x18')](_0x39aa96)[_0x892e('0x26')](_0x53b032);};}exports['index']=function(_0x664173,_0x4afb00){var _0x3cda81={},_0x730069={},_0xec9890={'count':0x0,'rows':[]};var _0x5810ec=_[_0x892e('0x27')](db[_0x892e('0x28')]['rawAttributes'],function(_0x51b672){return{'name':_0x51b672[_0x892e('0x29')],'type':_0x51b672[_0x892e('0x2a')][_0x892e('0x2b')]};});_0x730069[_0x892e('0x2c')]=_[_0x892e('0x27')](_0x5810ec,_0x892e('0x25'));_0x730069[_0x892e('0x2d')]=_['keys'](_0x664173['query']);_0x730069[_0x892e('0x2e')]=_[_0x892e('0x2f')](_0x730069[_0x892e('0x2c')],_0x730069[_0x892e('0x2d')]);_0x3cda81['attributes']=_[_0x892e('0x2f')](_0x730069[_0x892e('0x2c')],qs[_0x892e('0x30')](_0x664173[_0x892e('0x2d')][_0x892e('0x30')]));_0x3cda81['attributes']=_0x3cda81[_0x892e('0x31')][_0x892e('0x32')]?_0x3cda81['attributes']:_0x730069[_0x892e('0x2c')];if(!_0x664173[_0x892e('0x2d')][_0x892e('0x33')](_0x892e('0x34'))){_0x3cda81['limit']=qs[_0x892e('0x1d')](_0x664173[_0x892e('0x2d')]['limit']);_0x3cda81[_0x892e('0x1b')]=qs[_0x892e('0x1b')](_0x664173[_0x892e('0x2d')][_0x892e('0x1b')]);}_0x3cda81[_0x892e('0x35')]=qs[_0x892e('0x36')](_0x664173[_0x892e('0x2d')][_0x892e('0x36')]);_0x3cda81[_0x892e('0x37')]=qs['filters'](_[_0x892e('0x38')](_0x664173[_0x892e('0x2d')],_0x730069[_0x892e('0x2e')]),_0x5810ec);if(_0x664173[_0x892e('0x2d')]['filter']){_0x3cda81['where']=_['merge'](_0x3cda81['where'],{'$or':_['map'](_0x5810ec,function(_0x44dee3){if(_0x44dee3['type']!==_0x892e('0x39')){var _0xe51455={};_0xe51455[_0x44dee3[_0x892e('0x25')]]={'$like':'%'+_0x664173[_0x892e('0x2d')]['filter']+'%'};return _0xe51455;}})});}_0x3cda81=_[_0x892e('0x3a')]({},_0x3cda81,_0x664173[_0x892e('0x3b')]);var _0x536801={'where':_0x3cda81[_0x892e('0x37')]};return db['VtigerConfiguration'][_0x892e('0x1e')](_0x536801)[_0x892e('0x21')](function(_0xddaad){_0xec9890[_0x892e('0x1e')]=_0xddaad;if(_0x664173[_0x892e('0x2d')][_0x892e('0x3c')]){_0x3cda81[_0x892e('0x3d')]=[{'all':!![]}];}return db[_0x892e('0x28')]['findAll'](_0x3cda81);})['then'](function(_0x4ba5d4){_0xec9890['rows']=_0x4ba5d4;return _0xec9890;})[_0x892e('0x21')](respondWithFilteredResult(_0x4afb00,_0x3cda81))[_0x892e('0x3e')](handleError(_0x4afb00,null));};exports[_0x892e('0x3f')]=function(_0x583fab,_0x2e0a91){var _0xc95c8b={'raw':![],'where':{'id':_0x583fab[_0x892e('0x40')]['id']}},_0x1c0968={};_0x1c0968[_0x892e('0x2c')]=_[_0x892e('0x41')](db[_0x892e('0x28')][_0x892e('0x42')]);_0x1c0968['query']=_[_0x892e('0x41')](_0x583fab[_0x892e('0x2d')]);_0x1c0968[_0x892e('0x2e')]=_[_0x892e('0x2f')](_0x1c0968[_0x892e('0x2c')],_0x1c0968[_0x892e('0x2d')]);_0xc95c8b['attributes']=_['intersection'](_0x1c0968[_0x892e('0x2c')],qs[_0x892e('0x30')](_0x583fab[_0x892e('0x2d')]['fields']));_0xc95c8b[_0x892e('0x31')]=_0xc95c8b[_0x892e('0x31')][_0x892e('0x32')]?_0xc95c8b['attributes']:_0x1c0968['model'];if(_0x583fab[_0x892e('0x2d')][_0x892e('0x3c')]){_0xc95c8b[_0x892e('0x3d')]=[{'all':!![]}];}_0xc95c8b=_['merge']({},_0xc95c8b,_0x583fab[_0x892e('0x3b')]);return db[_0x892e('0x28')]['find'](_0xc95c8b)[_0x892e('0x21')](handleEntityNotFound(_0x2e0a91,null))[_0x892e('0x21')](respondWithResult(_0x2e0a91,null))[_0x892e('0x3e')](handleError(_0x2e0a91,null));};exports[_0x892e('0x43')]=function(_0x130fbb,_0x16b72c){return db[_0x892e('0x28')][_0x892e('0x43')](_0x130fbb['body'],{})[_0x892e('0x21')](respondWithResult(_0x16b72c,0xc9))[_0x892e('0x3e')](handleError(_0x16b72c,null));};exports[_0x892e('0x44')]=function(_0xaa8cc3,_0x3578d3){if(_0xaa8cc3[_0x892e('0x45')]['id']){delete _0xaa8cc3['body']['id'];}return db[_0x892e('0x28')][_0x892e('0x46')]({'where':{'id':_0xaa8cc3[_0x892e('0x40')]['id']}})[_0x892e('0x21')](handleEntityNotFound(_0x3578d3,null))[_0x892e('0x21')](saveUpdates(_0xaa8cc3['body'],null))['then'](respondWithResult(_0x3578d3,null))['catch'](handleError(_0x3578d3,null));};exports['destroy']=function(_0x61c932,_0x208cfc){return db[_0x892e('0x28')][_0x892e('0x46')]({'where':{'id':_0x61c932[_0x892e('0x40')]['id']}})['then'](handleEntityNotFound(_0x208cfc,null))[_0x892e('0x21')](removeEntity(_0x208cfc,null))[_0x892e('0x3e')](handleError(_0x208cfc,null));};exports[_0x892e('0x47')]=function(_0x3b699c,_0x4d7f31,_0x317f22){var _0x300ef3={};var _0xa05bc8={};var _0x11e128;var _0x44522e;return db[_0x892e('0x28')][_0x892e('0x48')]({'where':{'id':_0x3b699c[_0x892e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d7f31,null))[_0x892e('0x21')](function(_0x16dbe3){if(_0x16dbe3){_0x11e128=_0x16dbe3;_0xa05bc8['model']=_[_0x892e('0x41')](db[_0x892e('0x49')][_0x892e('0x42')]);_0xa05bc8[_0x892e('0x2d')]=_[_0x892e('0x41')](_0x3b699c[_0x892e('0x2d')]);_0xa05bc8['filters']=_[_0x892e('0x2f')](_0xa05bc8[_0x892e('0x2c')],_0xa05bc8[_0x892e('0x2d')]);_0x300ef3[_0x892e('0x31')]=_['intersection'](_0xa05bc8[_0x892e('0x2c')],qs[_0x892e('0x30')](_0x3b699c['query'][_0x892e('0x30')]));_0x300ef3[_0x892e('0x31')]=_0x300ef3['attributes'][_0x892e('0x32')]?_0x300ef3[_0x892e('0x31')]:_0xa05bc8[_0x892e('0x2c')];_0x300ef3[_0x892e('0x35')]=qs[_0x892e('0x36')](_0x3b699c[_0x892e('0x2d')][_0x892e('0x36')]);_0x300ef3[_0x892e('0x37')]=qs[_0x892e('0x2e')](_[_0x892e('0x38')](_0x3b699c[_0x892e('0x2d')],_0xa05bc8['filters']));if(_0x3b699c[_0x892e('0x2d')][_0x892e('0x4a')]){_0x300ef3['where']=_['merge'](_0x300ef3['where'],{'$or':_[_0x892e('0x27')](_0x300ef3[_0x892e('0x31')],function(_0xa39801){var _0x591de5={};_0x591de5[_0xa39801]={'$like':'%'+_0x3b699c[_0x892e('0x2d')][_0x892e('0x4a')]+'%'};return _0x591de5;})});}_0x300ef3=_[_0x892e('0x3a')]({},_0x300ef3,_0x3b699c[_0x892e('0x3b')]);return _0x11e128[_0x892e('0x47')](_0x300ef3);}})[_0x892e('0x21')](function(_0x161789){if(_0x161789){_0x44522e=_0x161789[_0x892e('0x32')];if(!_0x3b699c[_0x892e('0x2d')][_0x892e('0x33')](_0x892e('0x34'))){_0x300ef3['limit']=qs[_0x892e('0x1d')](_0x3b699c[_0x892e('0x2d')][_0x892e('0x1d')]);_0x300ef3[_0x892e('0x1b')]=qs[_0x892e('0x1b')](_0x3b699c[_0x892e('0x2d')][_0x892e('0x1b')]);}return _0x11e128['getFields'](_0x300ef3);}})[_0x892e('0x21')](function(_0x141c0c){if(_0x141c0c){return _0x141c0c?{'count':_0x44522e,'rows':_0x141c0c}:null;}})[_0x892e('0x21')](respondWithResult(_0x4d7f31,null))[_0x892e('0x3e')](handleError(_0x4d7f31,null));};exports['getSubjects']=function(_0x56f7f1,_0x4445e3,_0x2a5696){var _0x4e69a5={};var _0x37c4db={};var _0x22e420;var _0x48bbde;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x56f7f1[_0x892e('0x40')]['id']}})[_0x892e('0x21')](handleEntityNotFound(_0x4445e3,null))['then'](function(_0x2a319c){if(_0x2a319c){_0x22e420=_0x2a319c;_0x37c4db[_0x892e('0x2c')]=_[_0x892e('0x41')](db[_0x892e('0x49')][_0x892e('0x42')]);_0x37c4db[_0x892e('0x2d')]=_[_0x892e('0x41')](_0x56f7f1[_0x892e('0x2d')]);_0x37c4db['filters']=_[_0x892e('0x2f')](_0x37c4db[_0x892e('0x2c')],_0x37c4db['query']);_0x4e69a5[_0x892e('0x31')]=_[_0x892e('0x2f')](_0x37c4db[_0x892e('0x2c')],qs[_0x892e('0x30')](_0x56f7f1[_0x892e('0x2d')][_0x892e('0x30')]));_0x4e69a5['attributes']=_0x4e69a5[_0x892e('0x31')]['length']?_0x4e69a5['attributes']:_0x37c4db[_0x892e('0x2c')];_0x4e69a5[_0x892e('0x35')]=qs[_0x892e('0x36')](_0x56f7f1['query'][_0x892e('0x36')]);_0x4e69a5['where']=qs[_0x892e('0x2e')](_[_0x892e('0x38')](_0x56f7f1[_0x892e('0x2d')],_0x37c4db[_0x892e('0x2e')]));if(_0x56f7f1[_0x892e('0x2d')][_0x892e('0x4a')]){_0x4e69a5[_0x892e('0x37')]=_[_0x892e('0x3a')](_0x4e69a5[_0x892e('0x37')],{'$or':_[_0x892e('0x27')](_0x4e69a5[_0x892e('0x31')],function(_0x5332fe){var _0x1b88df={};_0x1b88df[_0x5332fe]={'$like':'%'+_0x56f7f1['query'][_0x892e('0x4a')]+'%'};return _0x1b88df;})});}_0x4e69a5=_[_0x892e('0x3a')]({},_0x4e69a5,_0x56f7f1[_0x892e('0x3b')]);return _0x22e420[_0x892e('0x4b')](_0x4e69a5);}})[_0x892e('0x21')](function(_0x1158af){if(_0x1158af){_0x48bbde=_0x1158af[_0x892e('0x32')];if(!_0x56f7f1['query'][_0x892e('0x33')]('nolimit')){_0x4e69a5['limit']=qs[_0x892e('0x1d')](_0x56f7f1[_0x892e('0x2d')][_0x892e('0x1d')]);_0x4e69a5[_0x892e('0x1b')]=qs[_0x892e('0x1b')](_0x56f7f1['query']['offset']);}return _0x22e420[_0x892e('0x4b')](_0x4e69a5);}})[_0x892e('0x21')](function(_0x53a3f6){if(_0x53a3f6){return _0x53a3f6?{'count':_0x48bbde,'rows':_0x53a3f6}:null;}})[_0x892e('0x21')](respondWithResult(_0x4445e3,null))['catch'](handleError(_0x4445e3,null));};exports[_0x892e('0x4c')]=function(_0x1c878c,_0x29b9c7,_0x3cb405){var _0x14673e={};var _0x1b7a5d={};var _0x4bae10;var _0x1d5f3d;return db['VtigerConfiguration'][_0x892e('0x48')]({'where':{'id':_0x1c878c[_0x892e('0x40')]['id']}})[_0x892e('0x21')](handleEntityNotFound(_0x29b9c7,null))[_0x892e('0x21')](function(_0x4213a5){if(_0x4213a5){_0x4bae10=_0x4213a5;_0x1b7a5d[_0x892e('0x2c')]=_[_0x892e('0x41')](db[_0x892e('0x49')][_0x892e('0x42')]);_0x1b7a5d[_0x892e('0x2d')]=_[_0x892e('0x41')](_0x1c878c[_0x892e('0x2d')]);_0x1b7a5d[_0x892e('0x2e')]=_[_0x892e('0x2f')](_0x1b7a5d['model'],_0x1b7a5d['query']);_0x14673e[_0x892e('0x31')]=_['intersection'](_0x1b7a5d[_0x892e('0x2c')],qs[_0x892e('0x30')](_0x1c878c['query'][_0x892e('0x30')]));_0x14673e[_0x892e('0x31')]=_0x14673e[_0x892e('0x31')][_0x892e('0x32')]?_0x14673e[_0x892e('0x31')]:_0x1b7a5d[_0x892e('0x2c')];_0x14673e[_0x892e('0x35')]=qs[_0x892e('0x36')](_0x1c878c[_0x892e('0x2d')][_0x892e('0x36')]);_0x14673e['where']=qs[_0x892e('0x2e')](_['pick'](_0x1c878c['query'],_0x1b7a5d['filters']));if(_0x1c878c[_0x892e('0x2d')]['filter']){_0x14673e['where']=_['merge'](_0x14673e[_0x892e('0x37')],{'$or':_[_0x892e('0x27')](_0x14673e[_0x892e('0x31')],function(_0x3a5e97){var _0x202976={};_0x202976[_0x3a5e97]={'$like':'%'+_0x1c878c[_0x892e('0x2d')][_0x892e('0x4a')]+'%'};return _0x202976;})});}_0x14673e=_[_0x892e('0x3a')]({},_0x14673e,_0x1c878c[_0x892e('0x3b')]);return _0x4bae10[_0x892e('0x4c')](_0x14673e);}})['then'](function(_0x8ac962){if(_0x8ac962){_0x1d5f3d=_0x8ac962['length'];if(!_0x1c878c['query'][_0x892e('0x33')](_0x892e('0x34'))){_0x14673e[_0x892e('0x1d')]=qs['limit'](_0x1c878c[_0x892e('0x2d')]['limit']);_0x14673e[_0x892e('0x1b')]=qs[_0x892e('0x1b')](_0x1c878c[_0x892e('0x2d')]['offset']);}return _0x4bae10[_0x892e('0x4c')](_0x14673e);}})[_0x892e('0x21')](function(_0x1a9a26){if(_0x1a9a26){return _0x1a9a26?{'count':_0x1d5f3d,'rows':_0x1a9a26}:null;}})['then'](respondWithResult(_0x29b9c7,null))['catch'](handleError(_0x29b9c7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 2bcf1e3..9af8c1d 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 _0x9d35=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42bf14,_0x580c92){var _0x126d1d=function(_0x5c4701){while(--_0x5c4701){_0x42bf14['push'](_0x42bf14['shift']());}};_0x126d1d(++_0x580c92);}(_0x9d35,0x18e));var _0x59d3=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0x9d35[_0xf4add4];return _0x1c42fb;};'use strict';var _=require(_0x59d3('0x0'));var util=require(_0x59d3('0x1'));var logger=require(_0x59d3('0x2'))(_0x59d3('0x3'));var moment=require(_0x59d3('0x4'));var BPromise=require(_0x59d3('0x5'));var rp=require(_0x59d3('0x6'));var fs=require('fs');var path=require(_0x59d3('0x7'));var rimraf=require(_0x59d3('0x8'));var config=require(_0x59d3('0x9'));var attributes=require(_0x59d3('0xa'));module[_0x59d3('0xb')]=function(_0x1ef65f,_0x44a2ec){return _0x1ef65f[_0x59d3('0xc')](_0x59d3('0xd'),attributes,{'tableName':_0x59d3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fe0=['moment','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1fe0,0xad));var _0x01fe=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x1fe0[_0xe45118];return _0x15e15d;};'use strict';var _=require(_0x01fe('0x0'));var util=require(_0x01fe('0x1'));var logger=require('../../config/logger')(_0x01fe('0x2'));var moment=require(_0x01fe('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01fe('0x4'));var rimraf=require('rimraf');var config=require(_0x01fe('0x5'));var attributes=require(_0x01fe('0x6'));module[_0x01fe('0x7')]=function(_0x3fb64c,_0x32c8d4){return _0x3fb64c[_0x01fe('0x8')](_0x01fe('0x9'),attributes,{'tableName':_0x01fe('0xa'),'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 3b4faa5..19fe76e 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 _0x23a3=['info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x211e4d,_0x27e967){var _0x42782e=function(_0x1fc6eb){while(--_0x1fc6eb){_0x211e4d['push'](_0x211e4d['shift']());}};_0x42782e(++_0x27e967);}(_0x23a3,0x134));var _0x323a=function(_0x8a93eb,_0x226507){_0x8a93eb=_0x8a93eb-0x0;var _0x213e0d=_0x23a3[_0x8a93eb];return _0x213e0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x323a('0x0'));var BPromise=require(_0x323a('0x1'));var rs=require(_0x323a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x323a('0x3'))['db'];var utils=require(_0x323a('0x4'));var logger=require('../../config/logger')(_0x323a('0x5'));var config=require(_0x323a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x323a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421714,_0x4e8b59,_0x3ac187){return new BPromise(function(_0x54e1f1,_0x3bd9c1){return client[_0x323a('0x8')](_0x421714,_0x3ac187)['then'](function(_0x339e6e){logger['info'](_0x323a('0x9'),_0x4e8b59,_0x323a('0xa'));logger['debug'](_0x323a('0xb'),_0x4e8b59,_0x323a('0xa'),JSON[_0x323a('0xc')](_0x339e6e));if(_0x339e6e[_0x323a('0xd')]){if(_0x339e6e[_0x323a('0xd')][_0x323a('0xe')]===0x1f4){logger[_0x323a('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4e8b59,_0x339e6e[_0x323a('0xd')][_0x323a('0xf')]);return _0x3bd9c1(_0x339e6e[_0x323a('0xd')][_0x323a('0xf')]);}logger[_0x323a('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4e8b59,_0x339e6e[_0x323a('0xd')][_0x323a('0xf')]);return _0x54e1f1(_0x339e6e[_0x323a('0xd')][_0x323a('0xf')]);}else{logger[_0x323a('0x10')](_0x323a('0x9'),_0x4e8b59,_0x323a('0xa'));_0x54e1f1(_0x339e6e['result']['message']);}})[_0x323a('0x11')](function(_0x2ba1aa){logger[_0x323a('0xd')](_0x323a('0x9'),_0x4e8b59,_0x2ba1aa);_0x3bd9c1(_0x2ba1aa);});});} \ No newline at end of file +var _0xd710=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd710,0x121));var _0x0d71=function(_0x37ba2a,_0x8eedd6){_0x37ba2a=_0x37ba2a-0x0;var _0x4ffd69=_0xd710[_0x37ba2a];return _0x4ffd69;};'use strict';var _=require(_0x0d71('0x0'));var util=require(_0x0d71('0x1'));var moment=require(_0x0d71('0x2'));var BPromise=require(_0x0d71('0x3'));var rs=require(_0x0d71('0x4'));var fs=require('fs');var Redis=require(_0x0d71('0x5'));var db=require(_0x0d71('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d71('0x7'))(_0x0d71('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0d71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b91eb,_0x1f29f0,_0x51fd01){return new BPromise(function(_0x56853a,_0x2fbaa8){return client[_0x0d71('0xa')](_0x3b91eb,_0x51fd01)['then'](function(_0x1f1c35){logger[_0x0d71('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x1f29f0,_0x0d71('0xc'));logger[_0x0d71('0xd')](_0x0d71('0xe'),_0x1f29f0,_0x0d71('0xc'),JSON[_0x0d71('0xf')](_0x1f1c35));if(_0x1f1c35['error']){if(_0x1f1c35[_0x0d71('0x10')][_0x0d71('0x11')]===0x1f4){logger[_0x0d71('0x10')](_0x0d71('0x12'),_0x1f29f0,_0x1f1c35[_0x0d71('0x10')][_0x0d71('0x13')]);return _0x2fbaa8(_0x1f1c35['error']['message']);}logger[_0x0d71('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1f29f0,_0x1f1c35['error'][_0x0d71('0x13')]);return _0x56853a(_0x1f1c35[_0x0d71('0x10')][_0x0d71('0x13')]);}else{logger[_0x0d71('0xb')](_0x0d71('0x12'),_0x1f29f0,_0x0d71('0xc'));_0x56853a(_0x1f1c35[_0x0d71('0x14')][_0x0d71('0x13')]);}})[_0x0d71('0x15')](function(_0xf1a261){logger['error'](_0x0d71('0x12'),_0x1f29f0,_0xf1a261);_0x2fbaa8(_0xf1a261);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8142b14..13668b1 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 _0x8d4f=['connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util'];(function(_0xc64265,_0x59a55e){var _0x460c30=function(_0x4ba3a4){while(--_0x4ba3a4){_0xc64265['push'](_0xc64265['shift']());}};_0x460c30(++_0x59a55e);}(_0x8d4f,0xbe));var _0xf8d4=function(_0x575e6d,_0x1e19ac){_0x575e6d=_0x575e6d-0x0;var _0x5d4dfd=_0x8d4f[_0x575e6d];return _0x5d4dfd;};'use strict';var multer=require(_0xf8d4('0x0'));var util=require(_0xf8d4('0x1'));var path=require('path');var timeout=require(_0xf8d4('0x2'));var express=require(_0xf8d4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf8d4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf8d4('0x5'));var controller=require('./intVtigerField.controller');router[_0xf8d4('0x6')]('/',auth[_0xf8d4('0x7')](),controller[_0xf8d4('0x8')]);router[_0xf8d4('0x6')](_0xf8d4('0x9'),auth[_0xf8d4('0x7')](),controller[_0xf8d4('0xa')]);router[_0xf8d4('0xb')]('/',auth[_0xf8d4('0x7')](),controller['create']);router[_0xf8d4('0xc')]('/:id',auth[_0xf8d4('0x7')](),controller[_0xf8d4('0xd')]);router[_0xf8d4('0xe')](_0xf8d4('0x9'),auth[_0xf8d4('0x7')](),controller[_0xf8d4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0ede=['express','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','update','delete','destroy','exports'];(function(_0x539072,_0x59d351){var _0x5c9a45=function(_0x840e2){while(--_0x840e2){_0x539072['push'](_0x539072['shift']());}};_0x5c9a45(++_0x59d351);}(_0x0ede,0xb6));var _0xe0ed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0ede[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe0ed('0x0'));var router=express[_0xe0ed('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xe0ed('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe0ed('0x3'));var controller=require(_0xe0ed('0x4'));router['get']('/',auth[_0xe0ed('0x5')](),controller[_0xe0ed('0x6')]);router[_0xe0ed('0x7')](_0xe0ed('0x8'),auth[_0xe0ed('0x5')](),controller[_0xe0ed('0x9')]);router['post']('/',auth[_0xe0ed('0x5')](),controller['create']);router['put'](_0xe0ed('0x8'),auth[_0xe0ed('0x5')](),controller[_0xe0ed('0xa')]);router[_0xe0ed('0xb')]('/:id',auth[_0xe0ed('0x5')](),controller[_0xe0ed('0xc')]);module[_0xe0ed('0xd')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e160df0..8a92321 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 _0x62d0=['string','variable','customVariable','keyValue','picklist','ENUM','STRING','BOOLEAN','sequelize','exports'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x62d0,0x1b6));var _0x062d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x62d0[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x062d('0x0'));module[_0x062d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x062d('0x2'),_0x062d('0x3'),_0x062d('0x4'),_0x062d('0x5'),_0x062d('0x6')),'defaultValue':_0x062d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x062d('0x7')](_0x062d('0x2'),_0x062d('0x3'),_0x062d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x062d('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x062d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x062d('0x8')]}}; \ No newline at end of file +var _0x3a45=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1ebf97,_0x510a3d){var _0x2bd171=function(_0x5b5021){while(--_0x5b5021){_0x1ebf97['push'](_0x1ebf97['shift']());}};_0x2bd171(++_0x510a3d);}(_0x3a45,0x15c));var _0x53a4=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x3a45[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0x53a4('0x0'));module[_0x53a4('0x1')]={'type':{'type':Sequelize[_0x53a4('0x2')](_0x53a4('0x3'),'variable',_0x53a4('0x4'),_0x53a4('0x5'),'picklist'),'defaultValue':_0x53a4('0x3')},'content':{'type':Sequelize[_0x53a4('0x6')]},'key':{'type':Sequelize[_0x53a4('0x6')]},'keyType':{'type':Sequelize[_0x53a4('0x2')](_0x53a4('0x3'),'variable',_0x53a4('0x4'))},'keyContent':{'type':Sequelize[_0x53a4('0x6')]},'idField':{'type':Sequelize[_0x53a4('0x6')]},'nameField':{'type':Sequelize[_0x53a4('0x6')]},'customField':{'type':Sequelize[_0x53a4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x53a4('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index e84e6de..e770c2a 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 _0x5704=['findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','include'];(function(_0x54e7eb,_0x558a24){var _0x37a309=function(_0x5a6df3){while(--_0x5a6df3){_0x54e7eb['push'](_0x54e7eb['shift']());}};_0x37a309(++_0x558a24);}(_0x5704,0xed));var _0x4570=function(_0x5024cf,_0x27a833){_0x5024cf=_0x5024cf-0x0;var _0x4b6827=_0x5704[_0x5024cf];return _0x4b6827;};'use strict';var emlformat=require(_0x4570('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4570('0x1'));var jsonpatch=require(_0x4570('0x2'));var rp=require(_0x4570('0x3'));var moment=require(_0x4570('0x4'));var BPromise=require(_0x4570('0x5'));var Mustache=require('mustache');var util=require(_0x4570('0x6'));var path=require(_0x4570('0x7'));var sox=require(_0x4570('0x8'));var csv=require('to-csv');var ejs=require(_0x4570('0x9'));var fs=require('fs');var fs_extra=require(_0x4570('0xa'));var _=require('lodash');var squel=require(_0x4570('0xb'));var crypto=require(_0x4570('0xc'));var jsforce=require(_0x4570('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4570('0xe'));var querystring=require(_0x4570('0xf'));var Papa=require(_0x4570('0x10'));var Redis=require('ioredis');var authService=require(_0x4570('0x11'));var qs=require(_0x4570('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4570('0x13'))('api');var utils=require(_0x4570('0x14'));var config=require(_0x4570('0x15'));var licenseUtil=require(_0x4570('0x16'));var db=require(_0x4570('0x17'))['db'];function respondWithStatusCode(_0x40c19a,_0xb52989){_0xb52989=_0xb52989||0xcc;return function(_0x47af60){if(_0x47af60){return _0x40c19a['sendStatus'](_0xb52989);}return _0x40c19a[_0x4570('0x18')](_0xb52989)[_0x4570('0x19')]();};}function respondWithResult(_0x231d55,_0x2b6515){_0x2b6515=_0x2b6515||0xc8;return function(_0x1a06d1){if(_0x1a06d1){return _0x231d55[_0x4570('0x18')](_0x2b6515)[_0x4570('0x1a')](_0x1a06d1);}};}function respondWithFilteredResult(_0x1821e9,_0x5db0ff){return function(_0xeacc3){if(_0xeacc3){var _0x5ce56c=typeof _0x5db0ff[_0x4570('0x1b')]===_0x4570('0x1c')&&typeof _0x5db0ff[_0x4570('0x1d')]==='undefined';var _0x48ce91=_0xeacc3['count'];var _0xcc6ac5=_0x5ce56c?0x0:_0x5db0ff[_0x4570('0x1b')];var _0x293add=_0x5ce56c?_0xeacc3['count']:_0x5db0ff[_0x4570('0x1b')]+_0x5db0ff['limit'];var _0x3349a8;if(_0x293add>=_0x48ce91){_0x293add=_0x48ce91;_0x3349a8=0xc8;}else{_0x3349a8=0xce;}_0x1821e9[_0x4570('0x18')](_0x3349a8);return _0x1821e9[_0x4570('0x1e')]('Content-Range',_0xcc6ac5+'-'+_0x293add+'/'+_0x48ce91)[_0x4570('0x1a')](_0xeacc3);}return null;};}function patchUpdates(_0x143eed){return function(_0x5d5946){try{jsonpatch[_0x4570('0x1f')](_0x5d5946,_0x143eed,!![]);}catch(_0x3de56e){return BPromise[_0x4570('0x20')](_0x3de56e);}return _0x5d5946[_0x4570('0x21')]();};}function saveUpdates(_0x10623c,_0x49b8db){return function(_0x1121b7){if(_0x1121b7){return _0x1121b7[_0x4570('0x22')](_0x10623c)['then'](function(_0x473477){return _0x473477;});}return null;};}function removeEntity(_0x4c8ecc,_0xc1490c){return function(_0x325996){if(_0x325996){return _0x325996[_0x4570('0x23')]()['then'](function(){_0x4c8ecc[_0x4570('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f95f,_0x1ef432){return function(_0x1a61c5){if(!_0x1a61c5){_0x47f95f[_0x4570('0x24')](0x194);}return _0x1a61c5;};}function handleError(_0x3615b2,_0x13422a){_0x13422a=_0x13422a||0x1f4;return function(_0x10c52a){logger[_0x4570('0x25')](_0x10c52a[_0x4570('0x26')]);if(_0x10c52a[_0x4570('0x27')]){delete _0x10c52a['name'];}_0x3615b2[_0x4570('0x18')](_0x13422a)[_0x4570('0x28')](_0x10c52a);};}exports[_0x4570('0x29')]=function(_0x32559c,_0x51a545){var _0x1b8005={},_0x386866={},_0x1fc64a={'count':0x0,'rows':[]};var _0x1b10cd=_[_0x4570('0x2a')](db[_0x4570('0x2b')][_0x4570('0x2c')],function(_0x30d406){return{'name':_0x30d406[_0x4570('0x2d')],'type':_0x30d406[_0x4570('0x2e')][_0x4570('0x2f')]};});_0x386866[_0x4570('0x30')]=_[_0x4570('0x2a')](_0x1b10cd,_0x4570('0x27'));_0x386866[_0x4570('0x31')]=_[_0x4570('0x32')](_0x32559c[_0x4570('0x31')]);_0x386866[_0x4570('0x33')]=_[_0x4570('0x34')](_0x386866[_0x4570('0x30')],_0x386866[_0x4570('0x31')]);_0x1b8005[_0x4570('0x35')]=_[_0x4570('0x34')](_0x386866[_0x4570('0x30')],qs[_0x4570('0x36')](_0x32559c[_0x4570('0x31')]['fields']));_0x1b8005['attributes']=_0x1b8005[_0x4570('0x35')][_0x4570('0x37')]?_0x1b8005[_0x4570('0x35')]:_0x386866[_0x4570('0x30')];if(!_0x32559c[_0x4570('0x31')]['hasOwnProperty']('nolimit')){_0x1b8005['limit']=qs[_0x4570('0x1d')](_0x32559c[_0x4570('0x31')][_0x4570('0x1d')]);_0x1b8005[_0x4570('0x1b')]=qs[_0x4570('0x1b')](_0x32559c['query'][_0x4570('0x1b')]);}_0x1b8005[_0x4570('0x38')]=qs[_0x4570('0x39')](_0x32559c[_0x4570('0x31')]['sort']);_0x1b8005[_0x4570('0x3a')]=qs[_0x4570('0x33')](_[_0x4570('0x3b')](_0x32559c['query'],_0x386866[_0x4570('0x33')]),_0x1b10cd);if(_0x32559c['query'][_0x4570('0x3c')]){_0x1b8005['where']=_[_0x4570('0x3d')](_0x1b8005[_0x4570('0x3a')],{'$or':_[_0x4570('0x2a')](_0x1b10cd,function(_0x692d91){if(_0x692d91[_0x4570('0x2e')]!==_0x4570('0x3e')){var _0x205e1e={};_0x205e1e[_0x692d91[_0x4570('0x27')]]={'$like':'%'+_0x32559c[_0x4570('0x31')][_0x4570('0x3c')]+'%'};return _0x205e1e;}})});}_0x1b8005=_[_0x4570('0x3d')]({},_0x1b8005,_0x32559c[_0x4570('0x3f')]);var _0x11643b={'where':_0x1b8005[_0x4570('0x3a')]};return db[_0x4570('0x2b')][_0x4570('0x40')](_0x11643b)[_0x4570('0x41')](function(_0x525e1d){_0x1fc64a[_0x4570('0x40')]=_0x525e1d;if(_0x32559c[_0x4570('0x31')]['includeAll']){_0x1b8005[_0x4570('0x42')]=[{'all':!![]}];}return db[_0x4570('0x2b')][_0x4570('0x43')](_0x1b8005);})[_0x4570('0x41')](function(_0x4c0bf7){_0x1fc64a[_0x4570('0x44')]=_0x4c0bf7;return _0x1fc64a;})[_0x4570('0x41')](respondWithFilteredResult(_0x51a545,_0x1b8005))['catch'](handleError(_0x51a545,null));};exports[_0x4570('0x45')]=function(_0x2ca8b6,_0x1f0a5d){var _0x413829={'raw':!![],'where':{'id':_0x2ca8b6[_0x4570('0x46')]['id']}},_0x441831={};_0x441831[_0x4570('0x30')]=_[_0x4570('0x32')](db['VtigerField'][_0x4570('0x2c')]);_0x441831['query']=_['keys'](_0x2ca8b6[_0x4570('0x31')]);_0x441831['filters']=_[_0x4570('0x34')](_0x441831[_0x4570('0x30')],_0x441831['query']);_0x413829['attributes']=_['intersection'](_0x441831['model'],qs['fields'](_0x2ca8b6[_0x4570('0x31')][_0x4570('0x36')]));_0x413829[_0x4570('0x35')]=_0x413829[_0x4570('0x35')]['length']?_0x413829[_0x4570('0x35')]:_0x441831[_0x4570('0x30')];if(_0x2ca8b6[_0x4570('0x31')][_0x4570('0x47')]){_0x413829['include']=[{'all':!![]}];}_0x413829=_['merge']({},_0x413829,_0x2ca8b6[_0x4570('0x3f')]);return db[_0x4570('0x2b')][_0x4570('0x48')](_0x413829)[_0x4570('0x41')](handleEntityNotFound(_0x1f0a5d,null))['then'](respondWithResult(_0x1f0a5d,null))[_0x4570('0x49')](handleError(_0x1f0a5d,null));};exports['create']=function(_0xa713bb,_0x1e52a1){return db[_0x4570('0x2b')][_0x4570('0x4a')](_0xa713bb[_0x4570('0x4b')],{})[_0x4570('0x41')](respondWithResult(_0x1e52a1,0xc9))[_0x4570('0x49')](handleError(_0x1e52a1,null));};exports[_0x4570('0x22')]=function(_0x5cb98f,_0x63d863){if(_0x5cb98f[_0x4570('0x4b')]['id']){delete _0x5cb98f[_0x4570('0x4b')]['id'];}return db['VtigerField'][_0x4570('0x48')]({'where':{'id':_0x5cb98f['params']['id']}})[_0x4570('0x41')](handleEntityNotFound(_0x63d863,null))['then'](saveUpdates(_0x5cb98f[_0x4570('0x4b')],null))[_0x4570('0x41')](respondWithResult(_0x63d863,null))[_0x4570('0x49')](handleError(_0x63d863,null));};exports[_0x4570('0x23')]=function(_0x98878,_0x3a1775){return db[_0x4570('0x2b')][_0x4570('0x48')]({'where':{'id':_0x98878[_0x4570('0x46')]['id']}})[_0x4570('0x41')](handleEntityNotFound(_0x3a1775,null))[_0x4570('0x41')](removeEntity(_0x3a1775,null))[_0x4570('0x49')](handleError(_0x3a1775,null));}; \ No newline at end of file +var _0x41f7=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','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'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x41f7,0x84));var _0x741f=function(_0x2255da,_0x570f68){_0x2255da=_0x2255da-0x0;var _0x16dff8=_0x41f7[_0x2255da];return _0x16dff8;};'use strict';var emlformat=require(_0x741f('0x0'));var rimraf=require(_0x741f('0x1'));var zipdir=require(_0x741f('0x2'));var jsonpatch=require(_0x741f('0x3'));var rp=require(_0x741f('0x4'));var moment=require('moment');var BPromise=require(_0x741f('0x5'));var Mustache=require(_0x741f('0x6'));var util=require(_0x741f('0x7'));var path=require('path');var sox=require(_0x741f('0x8'));var csv=require('to-csv');var ejs=require(_0x741f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x741f('0xa'));var crypto=require(_0x741f('0xb'));var jsforce=require(_0x741f('0xc'));var deskjs=require(_0x741f('0xd'));var toCsv=require(_0x741f('0xe'));var querystring=require(_0x741f('0xf'));var Papa=require(_0x741f('0x10'));var Redis=require(_0x741f('0x11'));var authService=require(_0x741f('0x12'));var qs=require(_0x741f('0x13'));var as=require(_0x741f('0x14'));var hardwareService=require(_0x741f('0x15'));var logger=require('../../config/logger')(_0x741f('0x16'));var utils=require(_0x741f('0x17'));var config=require(_0x741f('0x18'));var licenseUtil=require(_0x741f('0x19'));var db=require(_0x741f('0x1a'))['db'];function respondWithStatusCode(_0x358801,_0x235815){_0x235815=_0x235815||0xcc;return function(_0x7b1ed){if(_0x7b1ed){return _0x358801[_0x741f('0x1b')](_0x235815);}return _0x358801[_0x741f('0x1c')](_0x235815)[_0x741f('0x1d')]();};}function respondWithResult(_0x57790e,_0x8e4579){_0x8e4579=_0x8e4579||0xc8;return function(_0x31d5a0){if(_0x31d5a0){return _0x57790e[_0x741f('0x1c')](_0x8e4579)['json'](_0x31d5a0);}};}function respondWithFilteredResult(_0x2845a0,_0x47b8a2){return function(_0x41784a){if(_0x41784a){var _0x568638=typeof _0x47b8a2[_0x741f('0x1e')]===_0x741f('0x1f')&&typeof _0x47b8a2[_0x741f('0x20')]===_0x741f('0x1f');var _0x5099b4=_0x41784a[_0x741f('0x21')];var _0x3e467c=_0x568638?0x0:_0x47b8a2[_0x741f('0x1e')];var _0x547f05=_0x568638?_0x41784a[_0x741f('0x21')]:_0x47b8a2[_0x741f('0x1e')]+_0x47b8a2[_0x741f('0x20')];var _0x285e40;if(_0x547f05>=_0x5099b4){_0x547f05=_0x5099b4;_0x285e40=0xc8;}else{_0x285e40=0xce;}_0x2845a0[_0x741f('0x1c')](_0x285e40);return _0x2845a0[_0x741f('0x22')](_0x741f('0x23'),_0x3e467c+'-'+_0x547f05+'/'+_0x5099b4)['json'](_0x41784a);}return null;};}function patchUpdates(_0x1cefb9){return function(_0x50cf2a){try{jsonpatch[_0x741f('0x24')](_0x50cf2a,_0x1cefb9,!![]);}catch(_0x119f8a){return BPromise[_0x741f('0x25')](_0x119f8a);}return _0x50cf2a['save']();};}function saveUpdates(_0x3e8fc0,_0x22390d){return function(_0x434fbc){if(_0x434fbc){return _0x434fbc[_0x741f('0x26')](_0x3e8fc0)[_0x741f('0x27')](function(_0xeafafa){return _0xeafafa;});}return null;};}function removeEntity(_0x489688,_0x4c700){return function(_0x292cff){if(_0x292cff){return _0x292cff[_0x741f('0x28')]()['then'](function(){_0x489688[_0x741f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x356c74,_0x2d2bc9){return function(_0x5b161a){if(!_0x5b161a){_0x356c74[_0x741f('0x1b')](0x194);}return _0x5b161a;};}function handleError(_0x432714,_0x15891c){_0x15891c=_0x15891c||0x1f4;return function(_0x5942e2){logger[_0x741f('0x29')](_0x5942e2[_0x741f('0x2a')]);if(_0x5942e2[_0x741f('0x2b')]){delete _0x5942e2[_0x741f('0x2b')];}_0x432714['status'](_0x15891c)['send'](_0x5942e2);};}exports[_0x741f('0x2c')]=function(_0x28274c,_0x417cc9){var _0xeed998={},_0xf58179={},_0x1fbbb9={'count':0x0,'rows':[]};var _0x49cc58=_['map'](db[_0x741f('0x2d')][_0x741f('0x2e')],function(_0x2f7a35){return{'name':_0x2f7a35[_0x741f('0x2f')],'type':_0x2f7a35[_0x741f('0x30')][_0x741f('0x31')]};});_0xf58179[_0x741f('0x32')]=_[_0x741f('0x33')](_0x49cc58,_0x741f('0x2b'));_0xf58179[_0x741f('0x34')]=_[_0x741f('0x35')](_0x28274c[_0x741f('0x34')]);_0xf58179[_0x741f('0x36')]=_[_0x741f('0x37')](_0xf58179[_0x741f('0x32')],_0xf58179[_0x741f('0x34')]);_0xeed998[_0x741f('0x38')]=_[_0x741f('0x37')](_0xf58179[_0x741f('0x32')],qs[_0x741f('0x39')](_0x28274c[_0x741f('0x34')][_0x741f('0x39')]));_0xeed998[_0x741f('0x38')]=_0xeed998[_0x741f('0x38')][_0x741f('0x3a')]?_0xeed998['attributes']:_0xf58179[_0x741f('0x32')];if(!_0x28274c[_0x741f('0x34')][_0x741f('0x3b')](_0x741f('0x3c'))){_0xeed998[_0x741f('0x20')]=qs['limit'](_0x28274c['query'][_0x741f('0x20')]);_0xeed998[_0x741f('0x1e')]=qs[_0x741f('0x1e')](_0x28274c[_0x741f('0x34')]['offset']);}_0xeed998[_0x741f('0x3d')]=qs[_0x741f('0x3e')](_0x28274c[_0x741f('0x34')][_0x741f('0x3e')]);_0xeed998[_0x741f('0x3f')]=qs[_0x741f('0x36')](_[_0x741f('0x40')](_0x28274c[_0x741f('0x34')],_0xf58179['filters']),_0x49cc58);if(_0x28274c[_0x741f('0x34')][_0x741f('0x41')]){_0xeed998['where']=_[_0x741f('0x42')](_0xeed998['where'],{'$or':_[_0x741f('0x33')](_0x49cc58,function(_0x164b0f){if(_0x164b0f[_0x741f('0x30')]!==_0x741f('0x43')){var _0x32c1a7={};_0x32c1a7[_0x164b0f[_0x741f('0x2b')]]={'$like':'%'+_0x28274c[_0x741f('0x34')]['filter']+'%'};return _0x32c1a7;}})});}_0xeed998=_[_0x741f('0x42')]({},_0xeed998,_0x28274c[_0x741f('0x44')]);var _0x4e23dd={'where':_0xeed998['where']};return db[_0x741f('0x2d')][_0x741f('0x21')](_0x4e23dd)[_0x741f('0x27')](function(_0x3375f6){_0x1fbbb9['count']=_0x3375f6;if(_0x28274c[_0x741f('0x34')][_0x741f('0x45')]){_0xeed998[_0x741f('0x46')]=[{'all':!![]}];}return db[_0x741f('0x2d')][_0x741f('0x47')](_0xeed998);})[_0x741f('0x27')](function(_0x1322f6){_0x1fbbb9['rows']=_0x1322f6;return _0x1fbbb9;})[_0x741f('0x27')](respondWithFilteredResult(_0x417cc9,_0xeed998))[_0x741f('0x48')](handleError(_0x417cc9,null));};exports[_0x741f('0x49')]=function(_0x933295,_0x239061){var _0x402641={'raw':!![],'where':{'id':_0x933295['params']['id']}},_0x25f1d2={};_0x25f1d2[_0x741f('0x32')]=_[_0x741f('0x35')](db['VtigerField'][_0x741f('0x2e')]);_0x25f1d2[_0x741f('0x34')]=_['keys'](_0x933295[_0x741f('0x34')]);_0x25f1d2['filters']=_[_0x741f('0x37')](_0x25f1d2[_0x741f('0x32')],_0x25f1d2['query']);_0x402641['attributes']=_[_0x741f('0x37')](_0x25f1d2['model'],qs[_0x741f('0x39')](_0x933295[_0x741f('0x34')][_0x741f('0x39')]));_0x402641[_0x741f('0x38')]=_0x402641['attributes'][_0x741f('0x3a')]?_0x402641[_0x741f('0x38')]:_0x25f1d2[_0x741f('0x32')];if(_0x933295[_0x741f('0x34')]['includeAll']){_0x402641[_0x741f('0x46')]=[{'all':!![]}];}_0x402641=_[_0x741f('0x42')]({},_0x402641,_0x933295['options']);return db[_0x741f('0x2d')][_0x741f('0x4a')](_0x402641)['then'](handleEntityNotFound(_0x239061,null))[_0x741f('0x27')](respondWithResult(_0x239061,null))['catch'](handleError(_0x239061,null));};exports[_0x741f('0x4b')]=function(_0x49c0a0,_0xda17bb){return db[_0x741f('0x2d')][_0x741f('0x4b')](_0x49c0a0[_0x741f('0x4c')],{})[_0x741f('0x27')](respondWithResult(_0xda17bb,0xc9))[_0x741f('0x48')](handleError(_0xda17bb,null));};exports[_0x741f('0x26')]=function(_0xeefd86,_0xace027){if(_0xeefd86[_0x741f('0x4c')]['id']){delete _0xeefd86[_0x741f('0x4c')]['id'];}return db[_0x741f('0x2d')][_0x741f('0x4a')]({'where':{'id':_0xeefd86[_0x741f('0x4d')]['id']}})[_0x741f('0x27')](handleEntityNotFound(_0xace027,null))['then'](saveUpdates(_0xeefd86[_0x741f('0x4c')],null))[_0x741f('0x27')](respondWithResult(_0xace027,null))[_0x741f('0x48')](handleError(_0xace027,null));};exports[_0x741f('0x28')]=function(_0x3bb697,_0x158380){return db[_0x741f('0x2d')][_0x741f('0x4a')]({'where':{'id':_0x3bb697['params']['id']}})[_0x741f('0x27')](handleEntityNotFound(_0x158380,null))[_0x741f('0x27')](removeEntity(_0x158380,null))[_0x741f('0x48')](handleError(_0x158380,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 940cddc..a55c1b3 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 _0xb711=['vtiger_unique_index','idField','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb711,0x146));var _0x1b71=function(_0x14ca7d,_0x468836){_0x14ca7d=_0x14ca7d-0x0;var _0x3d84be=_0xb711[_0x14ca7d];return _0x3d84be;};'use strict';var _=require(_0x1b71('0x0'));var util=require(_0x1b71('0x1'));var logger=require(_0x1b71('0x2'))('api');var moment=require(_0x1b71('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b71('0x4'));var rimraf=require(_0x1b71('0x5'));var config=require(_0x1b71('0x6'));var attributes=require(_0x1b71('0x7'));module[_0x1b71('0x8')]=function(_0x21b277,_0xb7f342){return _0x21b277['define'](_0x1b71('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x1b71('0xa'),'fields':[_0x1b71('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde84=['moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','int_vtiger_fields','lodash','util','../../config/logger','api'];(function(_0x58855b,_0x3f215c){var _0x44d388=function(_0x354571){while(--_0x354571){_0x58855b['push'](_0x58855b['shift']());}};_0x44d388(++_0x3f215c);}(_0xde84,0xb7));var _0x4de8=function(_0x299d05,_0x3b46d9){_0x299d05=_0x299d05-0x0;var _0x2046f3=_0xde84[_0x299d05];return _0x2046f3;};'use strict';var _=require(_0x4de8('0x0'));var util=require(_0x4de8('0x1'));var logger=require(_0x4de8('0x2'))(_0x4de8('0x3'));var moment=require(_0x4de8('0x4'));var BPromise=require(_0x4de8('0x5'));var rp=require(_0x4de8('0x6'));var fs=require('fs');var path=require(_0x4de8('0x7'));var rimraf=require(_0x4de8('0x8'));var config=require('../../config/environment');var attributes=require(_0x4de8('0x9'));module['exports']=function(_0x47676d,_0x284a25){return _0x47676d['define']('VtigerField',attributes,{'tableName':_0x4de8('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index c2f1831..fa9267f 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 _0x880d=['message','VtigerField,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x175f79,_0x7fed9){var _0x5005da=function(_0x27ab74){while(--_0x27ab74){_0x175f79['push'](_0x175f79['shift']());}};_0x5005da(++_0x7fed9);}(_0x880d,0x137));var _0xd880=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x880d[_0x507403];return _0x1327c;};'use strict';var _=require(_0xd880('0x0'));var util=require(_0xd880('0x1'));var moment=require('moment');var BPromise=require(_0xd880('0x2'));var rs=require(_0xd880('0x3'));var fs=require('fs');var Redis=require(_0xd880('0x4'));var db=require(_0xd880('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd880('0x6'));var jayson=require(_0xd880('0x7'));var client=jayson[_0xd880('0x8')][_0xd880('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x543ed8,_0x1b8b46,_0x3a3b8){return new BPromise(function(_0x7821a,_0x2c8b86){return client[_0xd880('0xa')](_0x543ed8,_0x3a3b8)[_0xd880('0xb')](function(_0x1f8e42){logger[_0xd880('0xc')]('VtigerField,\x20%s,\x20%s',_0x1b8b46,_0xd880('0xd'));logger[_0xd880('0xe')](_0xd880('0xf'),_0x1b8b46,_0xd880('0xd'),JSON[_0xd880('0x10')](_0x1f8e42));if(_0x1f8e42[_0xd880('0x11')]){if(_0x1f8e42[_0xd880('0x11')][_0xd880('0x12')]===0x1f4){logger[_0xd880('0x11')]('VtigerField,\x20%s,\x20%s',_0x1b8b46,_0x1f8e42[_0xd880('0x11')][_0xd880('0x13')]);return _0x2c8b86(_0x1f8e42['error'][_0xd880('0x13')]);}logger[_0xd880('0x11')](_0xd880('0x14'),_0x1b8b46,_0x1f8e42['error'][_0xd880('0x13')]);return _0x7821a(_0x1f8e42[_0xd880('0x11')][_0xd880('0x13')]);}else{logger[_0xd880('0xc')](_0xd880('0x14'),_0x1b8b46,_0xd880('0xd'));_0x7821a(_0x1f8e42[_0xd880('0x15')]['message']);}})['catch'](function(_0x5d6084){logger['error'](_0xd880('0x14'),_0x1b8b46,_0x5d6084);_0x2c8b86(_0x5d6084);});});} \ No newline at end of file +var _0x86bc=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86bc,0x1d4));var _0xc86b=function(_0x30ebcb,_0x1ea3ec){_0x30ebcb=_0x30ebcb-0x0;var _0x608417=_0x86bc[_0x30ebcb];return _0x608417;};'use strict';var _=require(_0xc86b('0x0'));var util=require(_0xc86b('0x1'));var moment=require(_0xc86b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc86b('0x3'));var fs=require('fs');var Redis=require(_0xc86b('0x4'));var db=require(_0xc86b('0x5'))['db'];var utils=require(_0xc86b('0x6'));var logger=require('../../config/logger')(_0xc86b('0x7'));var config=require(_0xc86b('0x8'));var jayson=require(_0xc86b('0x9'));var client=jayson[_0xc86b('0xa')][_0xc86b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca4ef,_0x549378,_0x2e5f25){return new BPromise(function(_0xd8d156,_0x1da5a4){return client[_0xc86b('0xc')](_0x5ca4ef,_0x2e5f25)['then'](function(_0x10d24b){logger[_0xc86b('0xd')](_0xc86b('0xe'),_0x549378,'request\x20sent');logger[_0xc86b('0xf')](_0xc86b('0x10'),_0x549378,'request\x20sent',JSON[_0xc86b('0x11')](_0x10d24b));if(_0x10d24b[_0xc86b('0x12')]){if(_0x10d24b[_0xc86b('0x12')]['code']===0x1f4){logger[_0xc86b('0x12')](_0xc86b('0xe'),_0x549378,_0x10d24b[_0xc86b('0x12')][_0xc86b('0x13')]);return _0x1da5a4(_0x10d24b[_0xc86b('0x12')][_0xc86b('0x13')]);}logger['error'](_0xc86b('0xe'),_0x549378,_0x10d24b['error'][_0xc86b('0x13')]);return _0xd8d156(_0x10d24b['error'][_0xc86b('0x13')]);}else{logger[_0xc86b('0xd')](_0xc86b('0xe'),_0x549378,_0xc86b('0x14'));_0xd8d156(_0x10d24b[_0xc86b('0x15')][_0xc86b('0x13')]);}})[_0xc86b('0x16')](function(_0x3408aa){logger[_0xc86b('0x12')]('VtigerField,\x20%s,\x20%s',_0x549378,_0x3408aa);_0x1da5a4(_0x3408aa);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 125f435..362d0f3 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 _0xf1e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','/:id/configurations','addConfiguration','put','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0xf1e9,0xc3));var _0x9f1e=function(_0x4ded2f,_0x3e14cc){_0x4ded2f=_0x4ded2f-0x0;var _0x325180=_0xf1e9[_0x4ded2f];return _0x325180;};'use strict';var multer=require(_0x9f1e('0x0'));var util=require('util');var path=require(_0x9f1e('0x1'));var timeout=require(_0x9f1e('0x2'));var express=require('express');var router=express[_0x9f1e('0x3')]();var fs_extra=require(_0x9f1e('0x4'));var auth=require(_0x9f1e('0x5'));var interaction=require(_0x9f1e('0x6'));var config=require(_0x9f1e('0x7'));var controller=require(_0x9f1e('0x8'));router[_0x9f1e('0x9')]('/',auth[_0x9f1e('0xa')](),controller[_0x9f1e('0xb')]);router[_0x9f1e('0x9')](_0x9f1e('0xc'),auth['isAuthenticated'](),controller[_0x9f1e('0xd')]);router[_0x9f1e('0x9')]('/:id/configurations',auth[_0x9f1e('0xa')](),controller[_0x9f1e('0xe')]);router[_0x9f1e('0x9')]('/:id/fields',auth[_0x9f1e('0xa')](),controller[_0x9f1e('0xf')]);router['post']('/',auth[_0x9f1e('0xa')](),controller['create']);router['post'](_0x9f1e('0x10'),auth[_0x9f1e('0xa')](),controller[_0x9f1e('0x11')]);router[_0x9f1e('0x12')](_0x9f1e('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9f1e('0xc'),auth[_0x9f1e('0xa')](),controller['destroy']);module[_0x9f1e('0x13')]=router; \ No newline at end of file +var _0x2e72=['util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','exports','multer'];(function(_0x311d4f,_0x29deb5){var _0x2e8f5d=function(_0x30305c){while(--_0x30305c){_0x311d4f['push'](_0x311d4f['shift']());}};_0x2e8f5d(++_0x29deb5);}(_0x2e72,0x68));var _0x22e7=function(_0x3bbd2d,_0xf8ba3c){_0x3bbd2d=_0x3bbd2d-0x0;var _0x241bd4=_0x2e72[_0x3bbd2d];return _0x241bd4;};'use strict';var multer=require(_0x22e7('0x0'));var util=require(_0x22e7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x22e7('0x2'));var router=express[_0x22e7('0x3')]();var fs_extra=require(_0x22e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x22e7('0x5'));var config=require(_0x22e7('0x6'));var controller=require(_0x22e7('0x7'));router['get']('/',auth[_0x22e7('0x8')](),controller['index']);router[_0x22e7('0x9')](_0x22e7('0xa'),auth[_0x22e7('0x8')](),controller[_0x22e7('0xb')]);router['get'](_0x22e7('0xc'),auth[_0x22e7('0x8')](),controller[_0x22e7('0xd')]);router[_0x22e7('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x22e7('0xe')]);router['post']('/',auth[_0x22e7('0x8')](),controller['create']);router[_0x22e7('0xf')](_0x22e7('0xc'),auth['isAuthenticated'](),controller[_0x22e7('0x10')]);router[_0x22e7('0x11')](_0x22e7('0xa'),auth[_0x22e7('0x8')](),controller[_0x22e7('0x12')]);router[_0x22e7('0x13')](_0x22e7('0xa'),auth[_0x22e7('0x8')](),controller['destroy']);module[_0x22e7('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 72bd9b9..60c5dd0 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 _0xf567=['sequelize','exports','STRING','username','remoteUri','ENUM','token','password','integrationTab','newTab'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xf567,0x118));var _0x7f56=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf567[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7f56('0x0'));module[_0x7f56('0x1')]={'name':{'type':Sequelize[_0x7f56('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7f56('0x2')],'unique':_0x7f56('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x7f56('0x2')]},'remoteUri':{'type':Sequelize[_0x7f56('0x2')],'unique':_0x7f56('0x4')},'authType':{'type':Sequelize[_0x7f56('0x5')]('password',_0x7f56('0x6')),'defaultValue':_0x7f56('0x7')},'serverUrl':{'type':Sequelize[_0x7f56('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7f56('0x8'),_0x7f56('0x9')),'defaultValue':_0x7f56('0x8')}}; \ No newline at end of file +var _0xe944=['password','token','integrationTab','newTab','sequelize','STRING','remoteUri','ENUM'];(function(_0x4e95ac,_0x20990b){var _0x309c6b=function(_0x4b00a2){while(--_0x4b00a2){_0x4e95ac['push'](_0x4e95ac['shift']());}};_0x309c6b(++_0x20990b);}(_0xe944,0x174));var _0x4e94=function(_0x29abb9,_0x580986){_0x29abb9=_0x29abb9-0x0;var _0x56eaaa=_0xe944[_0x29abb9];return _0x56eaaa;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e94('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x4e94('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4e94('0x2')},'authType':{'type':Sequelize[_0x4e94('0x3')](_0x4e94('0x4'),_0x4e94('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x4e94('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4e94('0x3')](_0x4e94('0x6'),_0x4e94('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index cb544cc..97f70a3 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 _0xeb74=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xeb74,0xe3));var _0x4eb7=function(_0x13bff6,_0x5a2b98){_0x13bff6=_0x13bff6-0x0;var _0x2db738=_0xeb74[_0x13bff6];return _0x2db738;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];var integrations=require(_0x4eb7('0x19'));function respondWithStatusCode(_0x4194e1,_0x3c9f45){_0x3c9f45=_0x3c9f45||0xcc;return function(_0x4c27a4){if(_0x4c27a4){return _0x4194e1['sendStatus'](_0x3c9f45);}return _0x4194e1['status'](_0x3c9f45)[_0x4eb7('0x1a')]();};}function respondWithResult(_0x51f09d,_0x84c68b){_0x84c68b=_0x84c68b||0xc8;return function(_0x119afa){if(_0x119afa){return _0x51f09d[_0x4eb7('0x1b')](_0x84c68b)[_0x4eb7('0x1c')](_0x119afa);}};}function respondWithFilteredResult(_0x5d6d5,_0x21433d){return function(_0x11674f){if(_0x11674f){var _0x76988=typeof _0x21433d[_0x4eb7('0x1d')]===_0x4eb7('0x1e')&&typeof _0x21433d['limit']===_0x4eb7('0x1e');var _0x11ac9f=_0x11674f[_0x4eb7('0x1f')];var _0xf14478=_0x76988?0x0:_0x21433d[_0x4eb7('0x1d')];var _0x44f1b9=_0x76988?_0x11674f[_0x4eb7('0x1f')]:_0x21433d[_0x4eb7('0x1d')]+_0x21433d['limit'];var _0x3cf53a;if(_0x44f1b9>=_0x11ac9f){_0x44f1b9=_0x11ac9f;_0x3cf53a=0xc8;}else{_0x3cf53a=0xce;}_0x5d6d5[_0x4eb7('0x1b')](_0x3cf53a);return _0x5d6d5[_0x4eb7('0x20')](_0x4eb7('0x21'),_0xf14478+'-'+_0x44f1b9+'/'+_0x11ac9f)[_0x4eb7('0x1c')](_0x11674f);}return null;};}function patchUpdates(_0x2efd67){return function(_0x11fb0a){try{jsonpatch['apply'](_0x11fb0a,_0x2efd67,!![]);}catch(_0x214a28){return BPromise[_0x4eb7('0x22')](_0x214a28);}return _0x11fb0a[_0x4eb7('0x23')]();};}function saveUpdates(_0x164515,_0x14a7be){return function(_0x1b4640){if(_0x1b4640){return _0x1b4640[_0x4eb7('0x24')](_0x164515)[_0x4eb7('0x25')](function(_0x1a2b8b){return _0x1a2b8b;});}return null;};}function removeEntity(_0x13e871,_0x4de2d9){return function(_0x3e72cd){if(_0x3e72cd){return _0x3e72cd[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x13e871[_0x4eb7('0x1b')](0xcc)[_0x4eb7('0x1a')]();});}};}function handleEntityNotFound(_0x25eb74,_0x365060){return function(_0xe9db8){if(!_0xe9db8){_0x25eb74[_0x4eb7('0x27')](0x194);}return _0xe9db8;};}function handleError(_0x248759,_0xf83c11){_0xf83c11=_0xf83c11||0x1f4;return function(_0x2984b2){logger[_0x4eb7('0x28')](_0x2984b2[_0x4eb7('0x29')]);if(_0x2984b2[_0x4eb7('0x2a')]){delete _0x2984b2[_0x4eb7('0x2a')];}_0x248759[_0x4eb7('0x1b')](_0xf83c11)[_0x4eb7('0x2b')](_0x2984b2);};}exports[_0x4eb7('0x2c')]=function(_0x28fda8,_0x114c68){var _0x17030a={},_0x3ed224={},_0x50209d={'count':0x0,'rows':[]};var _0x34515c=_['map'](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')],function(_0xc5aa21){return{'name':_0xc5aa21[_0x4eb7('0x2f')],'type':_0xc5aa21[_0x4eb7('0x30')][_0x4eb7('0x31')]};});_0x3ed224[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x34515c,_0x4eb7('0x2a'));_0x3ed224['query']=_[_0x4eb7('0x34')](_0x28fda8['query']);_0x3ed224[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x3ed224['model'],_0x3ed224['query']);_0x17030a[_0x4eb7('0x37')]=_[_0x4eb7('0x36')](_0x3ed224[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x28fda8['query'][_0x4eb7('0x38')]));_0x17030a[_0x4eb7('0x37')]=_0x17030a[_0x4eb7('0x37')][_0x4eb7('0x39')]?_0x17030a[_0x4eb7('0x37')]:_0x3ed224['model'];if(!_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3b')](_0x4eb7('0x3c'))){_0x17030a['limit']=qs[_0x4eb7('0x3d')](_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3d')]);_0x17030a['offset']=qs[_0x4eb7('0x1d')](_0x28fda8['query'][_0x4eb7('0x1d')]);}_0x17030a[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x28fda8[_0x4eb7('0x3a')]['sort']);_0x17030a[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_[_0x4eb7('0x41')](_0x28fda8[_0x4eb7('0x3a')],_0x3ed224['filters']),_0x34515c);if(_0x28fda8['query']['filter']){_0x17030a[_0x4eb7('0x40')]=_[_0x4eb7('0x42')](_0x17030a[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x34515c,function(_0x210c20){if(_0x210c20[_0x4eb7('0x30')]!==_0x4eb7('0x43')){var _0x20d2bc={};_0x20d2bc[_0x210c20[_0x4eb7('0x2a')]]={'$like':'%'+_0x28fda8[_0x4eb7('0x3a')]['filter']+'%'};return _0x20d2bc;}})});}_0x17030a=_[_0x4eb7('0x42')]({},_0x17030a,_0x28fda8[_0x4eb7('0x44')]);var _0xe04d76={'where':_0x17030a[_0x4eb7('0x40')]};return db[_0x4eb7('0x2d')][_0x4eb7('0x1f')](_0xe04d76)[_0x4eb7('0x25')](function(_0xef998f){_0x50209d[_0x4eb7('0x1f')]=_0xef998f;if(_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x17030a[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x2d')][_0x4eb7('0x47')](_0x17030a);})[_0x4eb7('0x25')](function(_0x5b819f){_0x50209d[_0x4eb7('0x48')]=_0x5b819f;return _0x50209d;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x114c68,_0x17030a))[_0x4eb7('0x49')](handleError(_0x114c68,null));};exports[_0x4eb7('0x4a')]=function(_0x5eff9e,_0x2fd5c2){var _0x2df542={'raw':![],'where':{'id':_0x5eff9e[_0x4eb7('0x4b')]['id']}},_0x482357={};_0x482357[_0x4eb7('0x32')]=_[_0x4eb7('0x34')](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')]);_0x482357[_0x4eb7('0x3a')]=_['keys'](_0x5eff9e[_0x4eb7('0x3a')]);_0x482357['filters']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],_0x482357[_0x4eb7('0x3a')]);_0x2df542['attributes']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x5eff9e[_0x4eb7('0x3a')]['fields']));_0x2df542[_0x4eb7('0x37')]=_0x2df542['attributes'][_0x4eb7('0x39')]?_0x2df542[_0x4eb7('0x37')]:_0x482357[_0x4eb7('0x32')];if(_0x5eff9e[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x2df542['include']=[{'all':!![]}];}_0x2df542=_['merge']({},_0x2df542,_0x5eff9e[_0x4eb7('0x44')]);return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')](_0x2df542)[_0x4eb7('0x25')](handleEntityNotFound(_0x2fd5c2,null))[_0x4eb7('0x25')](respondWithResult(_0x2fd5c2,null))['catch'](handleError(_0x2fd5c2,null));};exports[_0x4eb7('0x4d')]=function(_0x104284,_0x56609e){return db[_0x4eb7('0x2d')][_0x4eb7('0x4d')](_0x104284['body'],{})[_0x4eb7('0x25')](respondWithResult(_0x56609e,0xc9))[_0x4eb7('0x49')](handleError(_0x56609e,null));};exports[_0x4eb7('0x24')]=function(_0x5774d5,_0x130113){if(_0x5774d5['body']['id']){delete _0x5774d5['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x5774d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x130113,null))[_0x4eb7('0x25')](saveUpdates(_0x5774d5[_0x4eb7('0x4e')],null))[_0x4eb7('0x25')](respondWithResult(_0x130113,null))[_0x4eb7('0x49')](handleError(_0x130113,null));};exports[_0x4eb7('0x26')]=function(_0x23c0d5,_0x42a1d9){return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x23c0d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x42a1d9,null))[_0x4eb7('0x25')](removeEntity(_0x42a1d9,null))[_0x4eb7('0x49')](handleError(_0x42a1d9,null));};exports[_0x4eb7('0x4f')]=function(_0x1411c9,_0x11cc3d,_0x4cfba8){var _0x3f3d41={};var _0x550888={};var _0x4db5f7;var _0x3f3a5f;return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x1411c9[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x11cc3d,null))['then'](function(_0x4e3163){if(_0x4e3163){_0x4db5f7=_0x4e3163;_0x550888[_0x4eb7('0x32')]=_['keys'](db[_0x4eb7('0x51')][_0x4eb7('0x2e')]);_0x550888[_0x4eb7('0x3a')]=_[_0x4eb7('0x34')](_0x1411c9['query']);_0x550888[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],_0x550888[_0x4eb7('0x3a')]);_0x3f3d41['attributes']=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],qs['fields'](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x38')]));_0x3f3d41['attributes']=_0x3f3d41[_0x4eb7('0x37')]['length']?_0x3f3d41[_0x4eb7('0x37')]:_0x550888['model'];_0x3f3d41[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x3f')]);_0x3f3d41[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_['pick'](_0x1411c9['query'],_0x550888[_0x4eb7('0x35')]));if(_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]){_0x3f3d41[_0x4eb7('0x40')]=_['merge'](_0x3f3d41[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x3f3d41['attributes'],function(_0x452f21){var _0xba9272={};_0xba9272[_0x452f21]={'$like':'%'+_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]+'%'};return _0xba9272;})});}_0x3f3d41=_[_0x4eb7('0x42')]({},_0x3f3d41,_0x1411c9[_0x4eb7('0x44')]);return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})['then'](function(_0x5839f1){if(_0x5839f1){_0x3f3a5f=_0x5839f1[_0x4eb7('0x39')];if(!_0x1411c9['query'][_0x4eb7('0x3b')]('nolimit')){_0x3f3d41[_0x4eb7('0x3d')]=qs['limit'](_0x1411c9['query'][_0x4eb7('0x3d')]);_0x3f3d41[_0x4eb7('0x1d')]=qs['offset'](_0x1411c9[_0x4eb7('0x3a')]['offset']);}return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})[_0x4eb7('0x25')](function(_0x4ab8e8){if(_0x4ab8e8){return _0x4ab8e8?{'count':_0x3f3a5f,'rows':_0x4ab8e8}:null;}})[_0x4eb7('0x25')](respondWithResult(_0x11cc3d,null))[_0x4eb7('0x49')](handleError(_0x11cc3d,null));};exports['addConfiguration']=function(_0x4b492a,_0x5c8d45,_0x59e2f2){if(_0x4b492a[_0x4eb7('0x4e')]['id']){delete _0x4b492a['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x4b492a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5c8d45,null))[_0x4eb7('0x25')](function(_0x463ab6){if(_0x463ab6){_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x53')]=_0x463ab6['id'];_0x4b492a[_0x4eb7('0x4e')]['Subjects']=integrations['getSubjects'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x55')]=integrations['getDescriptions'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);return db[_0x4eb7('0x51')][_0x4eb7('0x4d')](_0x4b492a['body'],{'include':[{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x57')},{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x55')}]});}return null;})['then'](respondWithResult(_0x5c8d45,null))['catch'](handleError(_0x5c8d45,null));};exports[_0x4eb7('0x58')]=function(_0x3883f3,_0x4e8125,_0x1911ad){var _0x4b698b='';return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x3883f3[_0x4eb7('0x4b')]['id']},'attributes':['id',_0x4eb7('0x59'),'password',_0x4eb7('0x5a'),_0x4eb7('0x5b'),_0x4eb7('0x5c')]})[_0x4eb7('0x25')](handleEntityNotFound(_0x4e8125,null))[_0x4eb7('0x25')](function(_0x3271d0){if(_0x3271d0){_0x4b698b=_0x3271d0[_0x4eb7('0x5c')];var _0x232242=_0x4b698b[_0x4eb7('0x5d')](-0x1);if(_0x232242==='/'){_0x4b698b=_0x4b698b[_0x4eb7('0x5e')](0x0,_0x4b698b[_0x4eb7('0x5f')](_0x232242));}var _0x713b0a={'method':_0x4eb7('0x60'),'uri':util[_0x4eb7('0x61')](_0x4eb7('0x62'),_0x4b698b,_0x4eb7('0x63')),'json':!![]};switch(_0x3271d0[_0x4eb7('0x5b')]){case _0x4eb7('0x64'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x66'),_0x3271d0[_0x4eb7('0x59')],_0x3271d0[_0x4eb7('0x64')]))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;case _0x4eb7('0x5a'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format'](_0x4eb7('0x69'),new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x6a'),_0x3271d0['username'],_0x3271d0['token']))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;default:throw new db[(_0x4eb7('0x6b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x713b0a);}})[_0x4eb7('0x25')](function(_0x1a1525){if(_0x1a1525){var _0x4778f9=[_0x4eb7('0x6c'),_0x4eb7('0x6d'),_0x4eb7('0x6e'),_0x4eb7('0x6f')];_[_0x4eb7('0x70')](_0x1a1525[_0x4eb7('0x63')],function(_0x2e531e){return _0x4778f9[_0x4eb7('0x71')](_0x2e531e[_0x4eb7('0x30')]);});return{'count':_0x1a1525['ticket_fields']['length'],'rows':_[_0x4eb7('0x33')](_0x1a1525[_0x4eb7('0x63')],function(_0x14648d){return{'id':_0x14648d['id'],'name':_0x14648d[_0x4eb7('0x72')]>0x7?_0x14648d[_0x4eb7('0x73')]:_0x14648d[_0x4eb7('0x30')],'custom':_0x14648d['position']>0x7?!![]:![],'options':_0x14648d['system_field_options']?_0x14648d[_0x4eb7('0x74')]:_0x14648d[_0x4eb7('0x75')]?_0x14648d[_0x4eb7('0x75')]:[]};})};}})[_0x4eb7('0x25')](respondWithResult(_0x4e8125,null))[_0x4eb7('0x49')](function(_0x2480ed){var _0x13f574=_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?0x1f4:_0x2480ed[_0x4eb7('0x77')]||0x1f4;logger[_0x4eb7('0x28')](_0x4eb7('0x78'),_0x4eb7('0x58'),_0x13f574,JSON[_0x4eb7('0x79')](_0x2480ed));delete _0x2480ed['name'];if(_0x13f574===0x191){_0x13f574=0x190;}_0x4e8125[_0x4eb7('0x1b')](_0x13f574)[_0x4eb7('0x2b')](_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x2480ed[_0x4eb7('0x77')]}:_0x2480ed);});}; \ No newline at end of file +var _0x0abf=['eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','name','send','index','map','ZendeskAccount','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','toString','base64','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test'];(function(_0x3be39b,_0x5cc1c){var _0x303fe5=function(_0x1479d8){while(--_0x1479d8){_0x3be39b['push'](_0x3be39b['shift']());}};_0x303fe5(++_0x5cc1c);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var licenseUtil=require(_0xf0ab('0x15'));var db=require(_0xf0ab('0x16'))['db'];var integrations=require(_0xf0ab('0x17'));function respondWithStatusCode(_0x34ccdc,_0x4fdd5f){_0x4fdd5f=_0x4fdd5f||0xcc;return function(_0x39b4e7){if(_0x39b4e7){return _0x34ccdc[_0xf0ab('0x18')](_0x4fdd5f);}return _0x34ccdc[_0xf0ab('0x19')](_0x4fdd5f)[_0xf0ab('0x1a')]();};}function respondWithResult(_0x1824ef,_0x36cabe){_0x36cabe=_0x36cabe||0xc8;return function(_0x3d7129){if(_0x3d7129){return _0x1824ef[_0xf0ab('0x19')](_0x36cabe)[_0xf0ab('0x1b')](_0x3d7129);}};}function respondWithFilteredResult(_0x3c5bfd,_0x20f453){return function(_0x221bac){if(_0x221bac){var _0x200cf5=typeof _0x20f453[_0xf0ab('0x1c')]===_0xf0ab('0x1d')&&typeof _0x20f453['limit']===_0xf0ab('0x1d');var _0x9e3b47=_0x221bac[_0xf0ab('0x1e')];var _0x1ffeb5=_0x200cf5?0x0:_0x20f453[_0xf0ab('0x1c')];var _0xb9a33=_0x200cf5?_0x221bac[_0xf0ab('0x1e')]:_0x20f453[_0xf0ab('0x1c')]+_0x20f453[_0xf0ab('0x1f')];var _0x1874a5;if(_0xb9a33>=_0x9e3b47){_0xb9a33=_0x9e3b47;_0x1874a5=0xc8;}else{_0x1874a5=0xce;}_0x3c5bfd[_0xf0ab('0x19')](_0x1874a5);return _0x3c5bfd[_0xf0ab('0x20')](_0xf0ab('0x21'),_0x1ffeb5+'-'+_0xb9a33+'/'+_0x9e3b47)[_0xf0ab('0x1b')](_0x221bac);}return null;};}function patchUpdates(_0x2cd961){return function(_0x45c1c9){try{jsonpatch['apply'](_0x45c1c9,_0x2cd961,!![]);}catch(_0x153492){return BPromise[_0xf0ab('0x22')](_0x153492);}return _0x45c1c9[_0xf0ab('0x23')]();};}function saveUpdates(_0x11ab3a,_0x3bf6a1){return function(_0x374531){if(_0x374531){return _0x374531[_0xf0ab('0x24')](_0x11ab3a)[_0xf0ab('0x25')](function(_0x36ad01){return _0x36ad01;});}return null;};}function removeEntity(_0x18bb37,_0x43119f){return function(_0x5645b2){if(_0x5645b2){return _0x5645b2['destroy']()['then'](function(){_0x18bb37[_0xf0ab('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eca32,_0x16b979){return function(_0x51ac90){if(!_0x51ac90){_0x3eca32[_0xf0ab('0x18')](0x194);}return _0x51ac90;};}function handleError(_0x22671e,_0x10bf5f){_0x10bf5f=_0x10bf5f||0x1f4;return function(_0x38fb71){logger[_0xf0ab('0x26')](_0x38fb71['stack']);if(_0x38fb71[_0xf0ab('0x27')]){delete _0x38fb71['name'];}_0x22671e['status'](_0x10bf5f)[_0xf0ab('0x28')](_0x38fb71);};}exports[_0xf0ab('0x29')]=function(_0x1b223d,_0x445160){var _0x43476c={},_0x174052={},_0x367302={'count':0x0,'rows':[]};var _0x14da9c=_[_0xf0ab('0x2a')](db[_0xf0ab('0x2b')][_0xf0ab('0x2c')],function(_0x199753){return{'name':_0x199753['fieldName'],'type':_0x199753[_0xf0ab('0x2d')][_0xf0ab('0x2e')]};});_0x174052['model']=_['map'](_0x14da9c,_0xf0ab('0x27'));_0x174052[_0xf0ab('0x2f')]=_[_0xf0ab('0x30')](_0x1b223d['query']);_0x174052['filters']=_[_0xf0ab('0x31')](_0x174052['model'],_0x174052[_0xf0ab('0x2f')]);_0x43476c['attributes']=_[_0xf0ab('0x31')](_0x174052[_0xf0ab('0x32')],qs['fields'](_0x1b223d['query'][_0xf0ab('0x33')]));_0x43476c[_0xf0ab('0x34')]=_0x43476c[_0xf0ab('0x34')][_0xf0ab('0x35')]?_0x43476c[_0xf0ab('0x34')]:_0x174052[_0xf0ab('0x32')];if(!_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x36')](_0xf0ab('0x37'))){_0x43476c[_0xf0ab('0x1f')]=qs[_0xf0ab('0x1f')](_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x1f')]);_0x43476c[_0xf0ab('0x1c')]=qs['offset'](_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x1c')]);}_0x43476c[_0xf0ab('0x38')]=qs['sort'](_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x39')]);_0x43476c[_0xf0ab('0x3a')]=qs['filters'](_[_0xf0ab('0x3b')](_0x1b223d['query'],_0x174052[_0xf0ab('0x3c')]),_0x14da9c);if(_0x1b223d['query'][_0xf0ab('0x3d')]){_0x43476c[_0xf0ab('0x3a')]=_[_0xf0ab('0x3e')](_0x43476c[_0xf0ab('0x3a')],{'$or':_[_0xf0ab('0x2a')](_0x14da9c,function(_0x1dfb2e){if(_0x1dfb2e['type']!==_0xf0ab('0x3f')){var _0x683d08={};_0x683d08[_0x1dfb2e['name']]={'$like':'%'+_0x1b223d[_0xf0ab('0x2f')][_0xf0ab('0x3d')]+'%'};return _0x683d08;}})});}_0x43476c=_[_0xf0ab('0x3e')]({},_0x43476c,_0x1b223d[_0xf0ab('0x40')]);var _0x31fa72={'where':_0x43476c[_0xf0ab('0x3a')]};return db[_0xf0ab('0x2b')]['count'](_0x31fa72)[_0xf0ab('0x25')](function(_0x4f6e93){_0x367302[_0xf0ab('0x1e')]=_0x4f6e93;if(_0x1b223d['query'][_0xf0ab('0x41')]){_0x43476c[_0xf0ab('0x42')]=[{'all':!![]}];}return db[_0xf0ab('0x2b')][_0xf0ab('0x43')](_0x43476c);})[_0xf0ab('0x25')](function(_0x553d07){_0x367302[_0xf0ab('0x44')]=_0x553d07;return _0x367302;})[_0xf0ab('0x25')](respondWithFilteredResult(_0x445160,_0x43476c))[_0xf0ab('0x45')](handleError(_0x445160,null));};exports[_0xf0ab('0x46')]=function(_0x191caf,_0x17a73){var _0x45849c={'raw':![],'where':{'id':_0x191caf[_0xf0ab('0x47')]['id']}},_0x413f5c={};_0x413f5c[_0xf0ab('0x32')]=_[_0xf0ab('0x30')](db[_0xf0ab('0x2b')][_0xf0ab('0x2c')]);_0x413f5c['query']=_['keys'](_0x191caf[_0xf0ab('0x2f')]);_0x413f5c['filters']=_[_0xf0ab('0x31')](_0x413f5c[_0xf0ab('0x32')],_0x413f5c['query']);_0x45849c[_0xf0ab('0x34')]=_[_0xf0ab('0x31')](_0x413f5c['model'],qs[_0xf0ab('0x33')](_0x191caf[_0xf0ab('0x2f')][_0xf0ab('0x33')]));_0x45849c[_0xf0ab('0x34')]=_0x45849c[_0xf0ab('0x34')][_0xf0ab('0x35')]?_0x45849c[_0xf0ab('0x34')]:_0x413f5c[_0xf0ab('0x32')];if(_0x191caf[_0xf0ab('0x2f')][_0xf0ab('0x41')]){_0x45849c[_0xf0ab('0x42')]=[{'all':!![]}];}_0x45849c=_[_0xf0ab('0x3e')]({},_0x45849c,_0x191caf[_0xf0ab('0x40')]);return db[_0xf0ab('0x2b')]['find'](_0x45849c)['then'](handleEntityNotFound(_0x17a73,null))[_0xf0ab('0x25')](respondWithResult(_0x17a73,null))['catch'](handleError(_0x17a73,null));};exports['create']=function(_0x4e57d3,_0xc3b68d){return db[_0xf0ab('0x2b')][_0xf0ab('0x48')](_0x4e57d3[_0xf0ab('0x49')],{})[_0xf0ab('0x25')](respondWithResult(_0xc3b68d,0xc9))[_0xf0ab('0x45')](handleError(_0xc3b68d,null));};exports[_0xf0ab('0x24')]=function(_0x1a0f21,_0xc6862b){if(_0x1a0f21[_0xf0ab('0x49')]['id']){delete _0x1a0f21[_0xf0ab('0x49')]['id'];}return db[_0xf0ab('0x2b')]['find']({'where':{'id':_0x1a0f21[_0xf0ab('0x47')]['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0xc6862b,null))[_0xf0ab('0x25')](saveUpdates(_0x1a0f21[_0xf0ab('0x49')],null))[_0xf0ab('0x25')](respondWithResult(_0xc6862b,null))[_0xf0ab('0x45')](handleError(_0xc6862b,null));};exports[_0xf0ab('0x4a')]=function(_0x2e6c5e,_0x47f564){return db['ZendeskAccount']['find']({'where':{'id':_0x2e6c5e[_0xf0ab('0x47')]['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0x47f564,null))['then'](removeEntity(_0x47f564,null))[_0xf0ab('0x45')](handleError(_0x47f564,null));};exports[_0xf0ab('0x4b')]=function(_0x4edb01,_0x1a9981,_0x53d6a4){var _0x1352ac={};var _0xe4ef6d={};var _0x187389;var _0x33112b;return db[_0xf0ab('0x2b')]['findOne']({'where':{'id':_0x4edb01[_0xf0ab('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a9981,null))[_0xf0ab('0x25')](function(_0x4c9d2b){if(_0x4c9d2b){_0x187389=_0x4c9d2b;_0xe4ef6d[_0xf0ab('0x32')]=_['keys'](db['ZendeskConfiguration'][_0xf0ab('0x2c')]);_0xe4ef6d['query']=_[_0xf0ab('0x30')](_0x4edb01['query']);_0xe4ef6d[_0xf0ab('0x3c')]=_['intersection'](_0xe4ef6d[_0xf0ab('0x32')],_0xe4ef6d[_0xf0ab('0x2f')]);_0x1352ac[_0xf0ab('0x34')]=_['intersection'](_0xe4ef6d['model'],qs['fields'](_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x33')]));_0x1352ac['attributes']=_0x1352ac['attributes'][_0xf0ab('0x35')]?_0x1352ac[_0xf0ab('0x34')]:_0xe4ef6d[_0xf0ab('0x32')];_0x1352ac[_0xf0ab('0x38')]=qs[_0xf0ab('0x39')](_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x39')]);_0x1352ac[_0xf0ab('0x3a')]=qs[_0xf0ab('0x3c')](_[_0xf0ab('0x3b')](_0x4edb01[_0xf0ab('0x2f')],_0xe4ef6d['filters']));if(_0x4edb01[_0xf0ab('0x2f')]['filter']){_0x1352ac[_0xf0ab('0x3a')]=_[_0xf0ab('0x3e')](_0x1352ac[_0xf0ab('0x3a')],{'$or':_[_0xf0ab('0x2a')](_0x1352ac[_0xf0ab('0x34')],function(_0x3c168f){var _0x152e80={};_0x152e80[_0x3c168f]={'$like':'%'+_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x3d')]+'%'};return _0x152e80;})});}_0x1352ac=_[_0xf0ab('0x3e')]({},_0x1352ac,_0x4edb01['options']);return _0x187389[_0xf0ab('0x4b')](_0x1352ac);}})[_0xf0ab('0x25')](function(_0x4062b7){if(_0x4062b7){_0x33112b=_0x4062b7[_0xf0ab('0x35')];if(!_0x4edb01[_0xf0ab('0x2f')][_0xf0ab('0x36')](_0xf0ab('0x37'))){_0x1352ac[_0xf0ab('0x1f')]=qs[_0xf0ab('0x1f')](_0x4edb01['query']['limit']);_0x1352ac[_0xf0ab('0x1c')]=qs[_0xf0ab('0x1c')](_0x4edb01[_0xf0ab('0x2f')]['offset']);}return _0x187389[_0xf0ab('0x4b')](_0x1352ac);}})[_0xf0ab('0x25')](function(_0xd61dcf){if(_0xd61dcf){return _0xd61dcf?{'count':_0x33112b,'rows':_0xd61dcf}:null;}})['then'](respondWithResult(_0x1a9981,null))[_0xf0ab('0x45')](handleError(_0x1a9981,null));};exports[_0xf0ab('0x4c')]=function(_0x3fc57e,_0x3d333f,_0x23f4f8){if(_0x3fc57e['body']['id']){delete _0x3fc57e[_0xf0ab('0x49')]['id'];}return db[_0xf0ab('0x2b')][_0xf0ab('0x4d')]({'where':{'id':_0x3fc57e[_0xf0ab('0x47')]['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0x3d333f,null))[_0xf0ab('0x25')](function(_0xe3fc19){if(_0xe3fc19){_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x4e')]=_0xe3fc19['id'];_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x4f')]=integrations[_0xf0ab('0x50')](_0x3fc57e[_0xf0ab('0x49')]['channel'],_0x3fc57e['body'][_0xf0ab('0x2d')]);_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x51')]=integrations['getDescriptions'](_0x3fc57e[_0xf0ab('0x49')]['channel'],_0x3fc57e[_0xf0ab('0x49')][_0xf0ab('0x2d')]);return db[_0xf0ab('0x52')]['create'](_0x3fc57e[_0xf0ab('0x49')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0xf0ab('0x53')],'as':_0xf0ab('0x51')}]});}return null;})[_0xf0ab('0x25')](respondWithResult(_0x3d333f,null))['catch'](handleError(_0x3d333f,null));};exports[_0xf0ab('0x54')]=function(_0x92ade0,_0x1035b3,_0x122c41){var _0x5b6923='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x92ade0[_0xf0ab('0x47')]['id']},'attributes':['id',_0xf0ab('0x55'),_0xf0ab('0x56'),_0xf0ab('0x57'),_0xf0ab('0x58'),_0xf0ab('0x59')]})[_0xf0ab('0x25')](handleEntityNotFound(_0x1035b3,null))[_0xf0ab('0x25')](function(_0x3119d1){if(_0x3119d1){_0x5b6923=_0x3119d1[_0xf0ab('0x59')];var _0x228334=_0x5b6923['slice'](-0x1);if(_0x228334==='/'){_0x5b6923=_0x5b6923[_0xf0ab('0x5a')](0x0,_0x5b6923[_0xf0ab('0x5b')](_0x228334));}var _0x24e4f5={'method':_0xf0ab('0x5c'),'uri':util[_0xf0ab('0x5d')](_0xf0ab('0x5e'),_0x5b6923,_0xf0ab('0x5f')),'json':!![]};switch(_0x3119d1[_0xf0ab('0x58')]){case'password':_0x24e4f5[_0xf0ab('0x60')]={'Authorization':util[_0xf0ab('0x5d')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x3119d1[_0xf0ab('0x55')],_0x3119d1[_0xf0ab('0x56')]))[_0xf0ab('0x61')](_0xf0ab('0x62')))};break;case _0xf0ab('0x57'):_0x24e4f5[_0xf0ab('0x60')]={'Authorization':util['format'](_0xf0ab('0x63'),new Buffer(util['format'](_0xf0ab('0x64'),_0x3119d1['username'],_0x3119d1[_0xf0ab('0x57')]))['toString'](_0xf0ab('0x62')))};break;default:throw new db['Sequelize']['ValidationError'](_0xf0ab('0x65'));}return rp(_0x24e4f5);}})[_0xf0ab('0x25')](function(_0x1f37a2){if(_0x1f37a2){var _0xd96ca8=[_0xf0ab('0x66'),_0xf0ab('0x67'),_0xf0ab('0x68'),_0xf0ab('0x69')];_[_0xf0ab('0x6a')](_0x1f37a2[_0xf0ab('0x5f')],function(_0x1650c0){return _0xd96ca8[_0xf0ab('0x6b')](_0x1650c0[_0xf0ab('0x2d')]);});return{'count':_0x1f37a2['ticket_fields'][_0xf0ab('0x35')],'rows':_[_0xf0ab('0x2a')](_0x1f37a2[_0xf0ab('0x5f')],function(_0x12acef){return{'id':_0x12acef['id'],'name':_0x12acef[_0xf0ab('0x6c')]>0x7?_0x12acef[_0xf0ab('0x6d')]:_0x12acef[_0xf0ab('0x2d')],'custom':_0x12acef[_0xf0ab('0x6c')]>0x7?!![]:![],'options':_0x12acef[_0xf0ab('0x6e')]?_0x12acef[_0xf0ab('0x6e')]:_0x12acef[_0xf0ab('0x6f')]?_0x12acef[_0xf0ab('0x6f')]:[]};})};}})['then'](respondWithResult(_0x1035b3,null))[_0xf0ab('0x45')](function(_0x1f18cd){var _0x3221ff=_0x92ade0[_0xf0ab('0x2f')]['test']?0x1f4:_0x1f18cd[_0xf0ab('0x70')]||0x1f4;logger[_0xf0ab('0x26')](_0xf0ab('0x71'),_0xf0ab('0x54'),_0x3221ff,JSON[_0xf0ab('0x72')](_0x1f18cd));delete _0x1f18cd['name'];if(_0x3221ff===0x191){_0x3221ff=0x190;}_0x1035b3[_0xf0ab('0x19')](_0x3221ff)[_0xf0ab('0x28')](_0x92ade0['query'][_0xf0ab('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1f18cd[_0xf0ab('0x70')]}:_0x1f18cd);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7b8c720..0fc9518 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 _0xd493=['api','moment','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x2b948f,_0x398e62){var _0x1237bc=function(_0x3c1843){while(--_0x3c1843){_0x2b948f['push'](_0x2b948f['shift']());}};_0x1237bc(++_0x398e62);}(_0xd493,0x171));var _0x3d49=function(_0x81f35f,_0x315882){_0x81f35f=_0x81f35f-0x0;var _0x37fb6f=_0xd493[_0x81f35f];return _0x37fb6f;};'use strict';var _=require(_0x3d49('0x0'));var util=require(_0x3d49('0x1'));var logger=require(_0x3d49('0x2'))(_0x3d49('0x3'));var moment=require(_0x3d49('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d49('0x5'));var rimraf=require(_0x3d49('0x6'));var config=require(_0x3d49('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x3d49('0x8'));module['exports']=function(_0x3a9cfe,_0x8cbf15){return _0x3a9cfe[_0x3d49('0x9')](_0x3d49('0xa'),attributes,{'tableName':_0x3d49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd445=['moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api'];(function(_0x14f586,_0x5280e8){var _0x1d6d98=function(_0xa4c2b1){while(--_0xa4c2b1){_0x14f586['push'](_0x14f586['shift']());}};_0x1d6d98(++_0x5280e8);}(_0xd445,0x1cb));var _0x5d44=function(_0x3daae1,_0xa92e8c){_0x3daae1=_0x3daae1-0x0;var _0x1983a2=_0xd445[_0x3daae1];return _0x1983a2;};'use strict';var _=require('lodash');var util=require(_0x5d44('0x0'));var logger=require(_0x5d44('0x1'))(_0x5d44('0x2'));var moment=require(_0x5d44('0x3'));var BPromise=require(_0x5d44('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d44('0x5'));var rimraf=require(_0x5d44('0x6'));var config=require(_0x5d44('0x7'));var attributes=require(_0x5d44('0x8'));var integrations=require(_0x5d44('0x9'));module[_0x5d44('0xa')]=function(_0x458ed1,_0xb6ba25){return _0x458ed1[_0x5d44('0xb')](_0x5d44('0xc'),attributes,{'tableName':_0x5d44('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 1d5eb85..33866d0 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 _0xba48=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0x351e5e,_0xc126aa){var _0x22d61e=function(_0x4465cd){while(--_0x4465cd){_0x351e5e['push'](_0x351e5e['shift']());}};_0x22d61e(++_0xc126aa);}(_0xba48,0xd3));var _0x8ba4=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xba48[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x8ba4('0x0'));var util=require(_0x8ba4('0x1'));var moment=require(_0x8ba4('0x2'));var BPromise=require(_0x8ba4('0x3'));var rs=require(_0x8ba4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ba4('0x5'))['db'];var utils=require(_0x8ba4('0x6'));var logger=require(_0x8ba4('0x7'))(_0x8ba4('0x8'));var config=require(_0x8ba4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8ba4('0xa')][_0x8ba4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1083e4,_0x4eb615,_0x2bf9b0){return new BPromise(function(_0x525fa6,_0x30a731){return client[_0x8ba4('0xc')](_0x1083e4,_0x2bf9b0)[_0x8ba4('0xd')](function(_0x163c62){logger[_0x8ba4('0xe')](_0x8ba4('0xf'),_0x4eb615,_0x8ba4('0x10'));logger[_0x8ba4('0x11')](_0x8ba4('0x12'),_0x4eb615,'request\x20sent',JSON[_0x8ba4('0x13')](_0x163c62));if(_0x163c62[_0x8ba4('0x14')]){if(_0x163c62['error'][_0x8ba4('0x15')]===0x1f4){logger[_0x8ba4('0x14')](_0x8ba4('0xf'),_0x4eb615,_0x163c62['error'][_0x8ba4('0x16')]);return _0x30a731(_0x163c62[_0x8ba4('0x14')][_0x8ba4('0x16')]);}logger[_0x8ba4('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x4eb615,_0x163c62['error']['message']);return _0x525fa6(_0x163c62[_0x8ba4('0x14')][_0x8ba4('0x16')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x4eb615,'request\x20sent');_0x525fa6(_0x163c62['result'][_0x8ba4('0x16')]);}})[_0x8ba4('0x17')](function(_0x37b6fd){logger[_0x8ba4('0x14')](_0x8ba4('0xf'),_0x4eb615,_0x37b6fd);_0x30a731(_0x37b6fd);});});}exports[_0x8ba4('0x18')]=function(_0x25442c){var _0x772f7e=this;return new Promise(function(_0x16be3c,_0x399568){return db[_0x8ba4('0x19')][_0x8ba4('0x1a')]({'raw':_0x25442c[_0x8ba4('0x1b')]?_0x25442c[_0x8ba4('0x1b')][_0x8ba4('0x1c')]===undefined?!![]:![]:!![],'where':_0x25442c[_0x8ba4('0x1b')]?_0x25442c[_0x8ba4('0x1b')][_0x8ba4('0x1d')]||null:null,'attributes':_0x25442c[_0x8ba4('0x1b')]?_0x25442c[_0x8ba4('0x1b')][_0x8ba4('0x1e')]||null:null,'limit':_0x25442c[_0x8ba4('0x1b')]?_0x25442c[_0x8ba4('0x1b')][_0x8ba4('0x1f')]||null:null,'include':_0x25442c['options']?_0x25442c[_0x8ba4('0x1b')][_0x8ba4('0x20')]?_[_0x8ba4('0x21')](_0x25442c['options'][_0x8ba4('0x20')],function(_0x4197f2){return{'model':db[_0x4197f2[_0x8ba4('0x22')]],'as':_0x4197f2['as'],'attributes':_0x4197f2[_0x8ba4('0x1e')],'include':_0x4197f2[_0x8ba4('0x20')]?_[_0x8ba4('0x21')](_0x4197f2[_0x8ba4('0x20')],function(_0x4834b6){return{'model':db[_0x4834b6[_0x8ba4('0x22')]],'as':_0x4834b6['as'],'attributes':_0x4834b6['attributes'],'include':_0x4834b6[_0x8ba4('0x20')]?_[_0x8ba4('0x21')](_0x4834b6['include'],function(_0x1c27f4){return{'model':db[_0x1c27f4[_0x8ba4('0x22')]],'as':_0x1c27f4['as'],'attributes':_0x1c27f4[_0x8ba4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ba4('0xd')](function(_0x369cdf){logger[_0x8ba4('0xe')](_0x8ba4('0x18'),_0x25442c);logger[_0x8ba4('0x11')]('GetZendeskAccount',_0x25442c,JSON[_0x8ba4('0x13')](_0x369cdf));_0x16be3c(_0x369cdf);})[_0x8ba4('0x17')](function(_0x4801b7){logger[_0x8ba4('0x14')](_0x8ba4('0x18'),_0x4801b7['message'],_0x25442c);_0x399568(_0x772f7e[_0x8ba4('0x14')](0x1f4,_0x4801b7[_0x8ba4('0x16')]));});});};exports['ShowZendeskAccount']=function(_0x4cadfb){var _0x4f0000=this;return new Promise(function(_0x5aa839,_0x284afb){return db['ZendeskAccount']['find']({'raw':_0x4cadfb[_0x8ba4('0x1b')]?_0x4cadfb[_0x8ba4('0x1b')][_0x8ba4('0x1c')]===undefined?!![]:![]:!![],'where':_0x4cadfb[_0x8ba4('0x1b')]?_0x4cadfb[_0x8ba4('0x1b')][_0x8ba4('0x1d')]||null:null,'attributes':_0x4cadfb['options']?_0x4cadfb[_0x8ba4('0x1b')][_0x8ba4('0x1e')]||null:null,'include':_0x4cadfb[_0x8ba4('0x1b')]?_0x4cadfb[_0x8ba4('0x1b')]['include']?_[_0x8ba4('0x21')](_0x4cadfb[_0x8ba4('0x1b')][_0x8ba4('0x20')],function(_0x1d4b4e){return{'model':db[_0x1d4b4e[_0x8ba4('0x22')]],'as':_0x1d4b4e['as'],'attributes':_0x1d4b4e[_0x8ba4('0x1e')],'include':_0x1d4b4e[_0x8ba4('0x20')]?_[_0x8ba4('0x21')](_0x1d4b4e['include'],function(_0x2202d5){return{'model':db[_0x2202d5[_0x8ba4('0x22')]],'as':_0x2202d5['as'],'attributes':_0x2202d5[_0x8ba4('0x1e')],'include':_0x2202d5[_0x8ba4('0x20')]?_[_0x8ba4('0x21')](_0x2202d5['include'],function(_0x1945cd){return{'model':db[_0x1945cd[_0x8ba4('0x22')]],'as':_0x1945cd['as'],'attributes':_0x1945cd[_0x8ba4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ba4('0xd')](function(_0x16bfaf){logger['info']('ShowZendeskAccount',_0x4cadfb);logger[_0x8ba4('0x11')](_0x8ba4('0x23'),_0x4cadfb,JSON['stringify'](_0x16bfaf));_0x5aa839(_0x16bfaf);})[_0x8ba4('0x17')](function(_0x338fbb){logger[_0x8ba4('0x14')](_0x8ba4('0x23'),_0x338fbb['message'],_0x4cadfb);_0x284afb(_0x4f0000[_0x8ba4('0x14')](0x1f4,_0x338fbb['message']));});});}; \ No newline at end of file +var _0x44ce=['findAll','options','attributes','include','map','model','catch','ShowZendeskAccount','find','raw','where','util','moment','bluebird','../../config/logger','rpc','../../config/environment','client','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount'];(function(_0x52a03f,_0x184019){var _0x203519=function(_0x1c6f75){while(--_0x1c6f75){_0x52a03f['push'](_0x52a03f['shift']());}};_0x203519(++_0x184019);}(_0x44ce,0x83));var _0xe44c=function(_0x263fa9,_0x5d3c80){_0x263fa9=_0x263fa9-0x0;var _0x3b12ec=_0x44ce[_0x263fa9];return _0x3b12ec;};'use strict';var _=require('lodash');var util=require(_0xe44c('0x0'));var moment=require(_0xe44c('0x1'));var BPromise=require(_0xe44c('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(_0xe44c('0x3'))(_0xe44c('0x4'));var config=require(_0xe44c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe44c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1131e9,_0x17ac90,_0x36e48f){return new BPromise(function(_0xc1b83c,_0x1413e1){return client['request'](_0x1131e9,_0x36e48f)[_0xe44c('0x7')](function(_0x31f7a5){logger[_0xe44c('0x8')](_0xe44c('0x9'),_0x17ac90,_0xe44c('0xa'));logger[_0xe44c('0xb')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x17ac90,_0xe44c('0xa'),JSON[_0xe44c('0xc')](_0x31f7a5));if(_0x31f7a5[_0xe44c('0xd')]){if(_0x31f7a5[_0xe44c('0xd')][_0xe44c('0xe')]===0x1f4){logger['error'](_0xe44c('0x9'),_0x17ac90,_0x31f7a5['error'][_0xe44c('0xf')]);return _0x1413e1(_0x31f7a5['error'][_0xe44c('0xf')]);}logger[_0xe44c('0xd')](_0xe44c('0x9'),_0x17ac90,_0x31f7a5[_0xe44c('0xd')][_0xe44c('0xf')]);return _0xc1b83c(_0x31f7a5[_0xe44c('0xd')]['message']);}else{logger[_0xe44c('0x8')](_0xe44c('0x9'),_0x17ac90,_0xe44c('0xa'));_0xc1b83c(_0x31f7a5[_0xe44c('0x10')]['message']);}})['catch'](function(_0x487cf5){logger[_0xe44c('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x17ac90,_0x487cf5);_0x1413e1(_0x487cf5);});});}exports[_0xe44c('0x11')]=function(_0x5af0b4){var _0x358dad=this;return new Promise(function(_0x37652b,_0x30c28e){return db[_0xe44c('0x12')][_0xe44c('0x13')]({'raw':_0x5af0b4['options']?_0x5af0b4[_0xe44c('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5af0b4['options']?_0x5af0b4[_0xe44c('0x14')]['where']||null:null,'attributes':_0x5af0b4[_0xe44c('0x14')]?_0x5af0b4[_0xe44c('0x14')][_0xe44c('0x15')]||null:null,'limit':_0x5af0b4[_0xe44c('0x14')]?_0x5af0b4[_0xe44c('0x14')]['limit']||null:null,'include':_0x5af0b4['options']?_0x5af0b4[_0xe44c('0x14')][_0xe44c('0x16')]?_[_0xe44c('0x17')](_0x5af0b4['options'][_0xe44c('0x16')],function(_0x5710c9){return{'model':db[_0x5710c9[_0xe44c('0x18')]],'as':_0x5710c9['as'],'attributes':_0x5710c9['attributes'],'include':_0x5710c9[_0xe44c('0x16')]?_['map'](_0x5710c9[_0xe44c('0x16')],function(_0x415ff7){return{'model':db[_0x415ff7[_0xe44c('0x18')]],'as':_0x415ff7['as'],'attributes':_0x415ff7['attributes'],'include':_0x415ff7[_0xe44c('0x16')]?_[_0xe44c('0x17')](_0x415ff7[_0xe44c('0x16')],function(_0x122cef){return{'model':db[_0x122cef[_0xe44c('0x18')]],'as':_0x122cef['as'],'attributes':_0x122cef[_0xe44c('0x15')]};}):[]};}):[]};}):[]:[]})[_0xe44c('0x7')](function(_0x2b5527){logger[_0xe44c('0x8')](_0xe44c('0x11'),_0x5af0b4);logger[_0xe44c('0xb')]('GetZendeskAccount',_0x5af0b4,JSON['stringify'](_0x2b5527));_0x37652b(_0x2b5527);})[_0xe44c('0x19')](function(_0x11e870){logger['error'](_0xe44c('0x11'),_0x11e870[_0xe44c('0xf')],_0x5af0b4);_0x30c28e(_0x358dad[_0xe44c('0xd')](0x1f4,_0x11e870['message']));});});};exports[_0xe44c('0x1a')]=function(_0x51abf6){var _0x3f5223=this;return new Promise(function(_0x4b0931,_0x1c3367){return db[_0xe44c('0x12')][_0xe44c('0x1b')]({'raw':_0x51abf6[_0xe44c('0x14')]?_0x51abf6[_0xe44c('0x14')][_0xe44c('0x1c')]===undefined?!![]:![]:!![],'where':_0x51abf6[_0xe44c('0x14')]?_0x51abf6[_0xe44c('0x14')][_0xe44c('0x1d')]||null:null,'attributes':_0x51abf6[_0xe44c('0x14')]?_0x51abf6['options'][_0xe44c('0x15')]||null:null,'include':_0x51abf6[_0xe44c('0x14')]?_0x51abf6[_0xe44c('0x14')][_0xe44c('0x16')]?_['map'](_0x51abf6[_0xe44c('0x14')]['include'],function(_0x1b2e0e){return{'model':db[_0x1b2e0e[_0xe44c('0x18')]],'as':_0x1b2e0e['as'],'attributes':_0x1b2e0e[_0xe44c('0x15')],'include':_0x1b2e0e[_0xe44c('0x16')]?_['map'](_0x1b2e0e[_0xe44c('0x16')],function(_0x12a17e){return{'model':db[_0x12a17e[_0xe44c('0x18')]],'as':_0x12a17e['as'],'attributes':_0x12a17e[_0xe44c('0x15')],'include':_0x12a17e[_0xe44c('0x16')]?_[_0xe44c('0x17')](_0x12a17e[_0xe44c('0x16')],function(_0x35ddf1){return{'model':db[_0x35ddf1[_0xe44c('0x18')]],'as':_0x35ddf1['as'],'attributes':_0x35ddf1[_0xe44c('0x15')]};}):[]};}):[]};}):[]:[]})[_0xe44c('0x7')](function(_0xaa637e){logger[_0xe44c('0x8')](_0xe44c('0x1a'),_0x51abf6);logger[_0xe44c('0xb')](_0xe44c('0x1a'),_0x51abf6,JSON['stringify'](_0xaa637e));_0x4b0931(_0xaa637e);})[_0xe44c('0x19')](function(_0x3b21b){logger[_0xe44c('0xd')](_0xe44c('0x1a'),_0x3b21b[_0xe44c('0xf')],_0x51abf6);_0x1c3367(_0x3f5223['error'](0x1f4,_0x3b21b[_0xe44c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index babe832..c760b7c 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x362c5d,_0x18e75d){var _0x585517=function(_0x26daf8){while(--_0x26daf8){_0x362c5d['push'](_0x362c5d['shift']());}};_0x585517(++_0x18e75d);}(_0xda3f,0xec));var _0xfda3=function(_0xa89828,_0x46072f){_0xa89828=_0xa89828-0x0;var _0x5ed283=_0xda3f[_0xa89828];return _0x5ed283;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file +var _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x492046,_0x357725){var _0x18558b=function(_0x64ae1c){while(--_0x64ae1c){_0x492046['push'](_0x492046['shift']());}};_0x18558b(++_0x357725);}(_0xb10b,0x12a));var _0xbb10=function(_0x131090,_0x4b5e43){_0x131090=_0x131090-0x0;var _0x1e10cf=_0xb10b[_0x131090];return _0x1e10cf;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index af47134..f7d39b3 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 _0xcd2a=['sequelize','exports','STRING'];(function(_0x38416c,_0x378c9d){var _0x40d1de=function(_0x5588cf){while(--_0x5588cf){_0x38416c['push'](_0x38416c['shift']());}};_0x40d1de(++_0x378c9d);}(_0xcd2a,0x13e));var _0xacd2=function(_0x2b9d5c,_0x173518){_0x2b9d5c=_0x2b9d5c-0x0;var _0x37bb93=_0xcd2a[_0x2b9d5c];return _0x37bb93;};'use strict';var Sequelize=require(_0xacd2('0x0'));module[_0xacd2('0x1')]={'name':{'type':Sequelize[_0xacd2('0x2')]},'description':{'type':Sequelize[_0xacd2('0x2')]}}; \ No newline at end of file +var _0x549e=['exports','STRING','sequelize'];(function(_0x2e750b,_0x270a5e){var _0x55ca65=function(_0x52ceb3){while(--_0x52ceb3){_0x2e750b['push'](_0x2e750b['shift']());}};_0x55ca65(++_0x270a5e);}(_0x549e,0x104));var _0xe549=function(_0xa77cc9,_0x3df827){_0xa77cc9=_0xa77cc9-0x0;var _0x55d0d5=_0x549e[_0xa77cc9];return _0x55d0d5;};'use strict';var Sequelize=require(_0xe549('0x0'));module[_0xe549('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe549('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2cf7d08..35d3f0f 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 _0x4639=['getTags','Tag','hasOwnProperty','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x4639,0x107));var _0x9463=function(_0x3b84dc,_0x5b6a7b){_0x3b84dc=_0x3b84dc-0x0;var _0x2c8da3=_0x4639[_0x3b84dc];return _0x2c8da3;};'use strict';var emlformat=require(_0x9463('0x0'));var rimraf=require(_0x9463('0x1'));var zipdir=require(_0x9463('0x2'));var jsonpatch=require(_0x9463('0x3'));var rp=require(_0x9463('0x4'));var moment=require(_0x9463('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9463('0x6'));var util=require(_0x9463('0x7'));var path=require(_0x9463('0x8'));var sox=require(_0x9463('0x9'));var csv=require(_0x9463('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9463('0xb'));var squel=require(_0x9463('0xc'));var crypto=require(_0x9463('0xd'));var jsforce=require(_0x9463('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9463('0xa'));var querystring=require(_0x9463('0xf'));var Papa=require('papaparse');var Redis=require(_0x9463('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9463('0x11'));var as=require(_0x9463('0x12'));var hardwareService=require(_0x9463('0x13'));var logger=require(_0x9463('0x14'))(_0x9463('0x15'));var utils=require(_0x9463('0x16'));var config=require(_0x9463('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9463('0x18'))['db'];function respondWithStatusCode(_0x4d801a,_0x3675d0){_0x3675d0=_0x3675d0||0xcc;return function(_0x5ce39f){if(_0x5ce39f){return _0x4d801a[_0x9463('0x19')](_0x3675d0);}return _0x4d801a[_0x9463('0x1a')](_0x3675d0)['end']();};}function respondWithResult(_0xbe4488,_0x20b76c){_0x20b76c=_0x20b76c||0xc8;return function(_0x131a05){if(_0x131a05){return _0xbe4488[_0x9463('0x1a')](_0x20b76c)[_0x9463('0x1b')](_0x131a05);}};}function respondWithFilteredResult(_0x2857e5,_0x38fd85){return function(_0x4b5ef5){if(_0x4b5ef5){var _0x145ac9=typeof _0x38fd85[_0x9463('0x1c')]===_0x9463('0x1d')&&typeof _0x38fd85['limit']===_0x9463('0x1d');var _0x37ccf6=_0x4b5ef5[_0x9463('0x1e')];var _0x4423ed=_0x145ac9?0x0:_0x38fd85[_0x9463('0x1c')];var _0x21754e=_0x145ac9?_0x4b5ef5['count']:_0x38fd85[_0x9463('0x1c')]+_0x38fd85[_0x9463('0x1f')];var _0x1f90a4;if(_0x21754e>=_0x37ccf6){_0x21754e=_0x37ccf6;_0x1f90a4=0xc8;}else{_0x1f90a4=0xce;}_0x2857e5[_0x9463('0x1a')](_0x1f90a4);return _0x2857e5[_0x9463('0x20')](_0x9463('0x21'),_0x4423ed+'-'+_0x21754e+'/'+_0x37ccf6)['json'](_0x4b5ef5);}return null;};}function patchUpdates(_0x48119c){return function(_0x336c71){try{jsonpatch[_0x9463('0x22')](_0x336c71,_0x48119c,!![]);}catch(_0x2a032b){return BPromise[_0x9463('0x23')](_0x2a032b);}return _0x336c71['save']();};}function saveUpdates(_0x28c55c,_0x2d7a82){return function(_0x52a9f0){if(_0x52a9f0){return _0x52a9f0[_0x9463('0x24')](_0x28c55c)[_0x9463('0x25')](function(_0x2fc5a5){return _0x2fc5a5;});}return null;};}function removeEntity(_0x3017ab,_0x3704dd){return function(_0x2d7859){if(_0x2d7859){return _0x2d7859[_0x9463('0x26')]()['then'](function(){_0x3017ab['status'](0xcc)[_0x9463('0x27')]();});}};}function handleEntityNotFound(_0x32f686,_0x5f0f34){return function(_0x4e5add){if(!_0x4e5add){_0x32f686[_0x9463('0x19')](0x194);}return _0x4e5add;};}function handleError(_0x563058,_0x58eee5){_0x58eee5=_0x58eee5||0x1f4;return function(_0x321e18){logger['error'](_0x321e18[_0x9463('0x28')]);if(_0x321e18[_0x9463('0x29')]){delete _0x321e18[_0x9463('0x29')];}_0x563058[_0x9463('0x1a')](_0x58eee5)[_0x9463('0x2a')](_0x321e18);};}exports[_0x9463('0x2b')]=function(_0x190bc6,_0x57e8ff){var _0x25dc13={},_0x165ea0={},_0x1d28da={'count':0x0,'rows':[]};var _0xbc3c9=_[_0x9463('0x2c')](db[_0x9463('0x2d')][_0x9463('0x2e')],function(_0x1cb756){return{'name':_0x1cb756[_0x9463('0x2f')],'type':_0x1cb756[_0x9463('0x30')][_0x9463('0x31')]};});_0x165ea0['model']=_[_0x9463('0x2c')](_0xbc3c9,'name');_0x165ea0['query']=_[_0x9463('0x32')](_0x190bc6[_0x9463('0x33')]);_0x165ea0[_0x9463('0x34')]=_[_0x9463('0x35')](_0x165ea0[_0x9463('0x36')],_0x165ea0['query']);_0x25dc13['attributes']=_[_0x9463('0x35')](_0x165ea0[_0x9463('0x36')],qs[_0x9463('0x37')](_0x190bc6[_0x9463('0x33')][_0x9463('0x37')]));_0x25dc13[_0x9463('0x38')]=_0x25dc13[_0x9463('0x38')][_0x9463('0x39')]?_0x25dc13[_0x9463('0x38')]:_0x165ea0[_0x9463('0x36')];if(!_0x190bc6[_0x9463('0x33')]['hasOwnProperty'](_0x9463('0x3a'))){_0x25dc13['limit']=qs['limit'](_0x190bc6[_0x9463('0x33')]['limit']);_0x25dc13[_0x9463('0x1c')]=qs['offset'](_0x190bc6[_0x9463('0x33')][_0x9463('0x1c')]);}_0x25dc13[_0x9463('0x3b')]=qs['sort'](_0x190bc6[_0x9463('0x33')][_0x9463('0x3c')]);_0x25dc13[_0x9463('0x3d')]=qs['filters'](_[_0x9463('0x3e')](_0x190bc6[_0x9463('0x33')],_0x165ea0[_0x9463('0x34')]),_0xbc3c9);if(_0x190bc6[_0x9463('0x33')][_0x9463('0x3f')]){_0x25dc13[_0x9463('0x3d')]=_[_0x9463('0x40')](_0x25dc13[_0x9463('0x3d')],{'$or':_[_0x9463('0x2c')](_0xbc3c9,function(_0x164a26){if(_0x164a26['type']!==_0x9463('0x41')){var _0x5dad8e={};_0x5dad8e[_0x164a26[_0x9463('0x29')]]={'$like':'%'+_0x190bc6[_0x9463('0x33')][_0x9463('0x3f')]+'%'};return _0x5dad8e;}})});}_0x25dc13=_[_0x9463('0x40')]({},_0x25dc13,_0x190bc6[_0x9463('0x42')]);var _0x67e7f={'where':_0x25dc13[_0x9463('0x3d')]};return db['ZendeskConfiguration'][_0x9463('0x1e')](_0x67e7f)[_0x9463('0x25')](function(_0x3c6244){_0x1d28da['count']=_0x3c6244;if(_0x190bc6[_0x9463('0x33')]['includeAll']){_0x25dc13['include']=[{'all':!![]}];}return db[_0x9463('0x2d')]['findAll'](_0x25dc13);})[_0x9463('0x25')](function(_0x4d6047){_0x1d28da[_0x9463('0x43')]=_0x4d6047;return _0x1d28da;})['then'](respondWithFilteredResult(_0x57e8ff,_0x25dc13))[_0x9463('0x44')](handleError(_0x57e8ff,null));};exports[_0x9463('0x45')]=function(_0xb0ab1e,_0x53894a){var _0x9ebe38={'raw':![],'where':{'id':_0xb0ab1e[_0x9463('0x46')]['id']}},_0x5db51d={};_0x5db51d[_0x9463('0x36')]=_[_0x9463('0x32')](db[_0x9463('0x2d')]['rawAttributes']);_0x5db51d[_0x9463('0x33')]=_['keys'](_0xb0ab1e[_0x9463('0x33')]);_0x5db51d[_0x9463('0x34')]=_[_0x9463('0x35')](_0x5db51d[_0x9463('0x36')],_0x5db51d['query']);_0x9ebe38[_0x9463('0x38')]=_['intersection'](_0x5db51d[_0x9463('0x36')],qs[_0x9463('0x37')](_0xb0ab1e['query'][_0x9463('0x37')]));_0x9ebe38[_0x9463('0x38')]=_0x9ebe38['attributes'][_0x9463('0x39')]?_0x9ebe38[_0x9463('0x38')]:_0x5db51d[_0x9463('0x36')];if(_0xb0ab1e[_0x9463('0x33')][_0x9463('0x47')]){_0x9ebe38[_0x9463('0x48')]=[{'all':!![]}];}_0x9ebe38=_[_0x9463('0x40')]({},_0x9ebe38,_0xb0ab1e[_0x9463('0x42')]);return db[_0x9463('0x2d')][_0x9463('0x49')](_0x9ebe38)[_0x9463('0x25')](handleEntityNotFound(_0x53894a,null))['then'](respondWithResult(_0x53894a,null))[_0x9463('0x44')](handleError(_0x53894a,null));};exports[_0x9463('0x4a')]=function(_0x496b56,_0x14c08e){return db[_0x9463('0x2d')][_0x9463('0x4a')](_0x496b56[_0x9463('0x4b')],{})['then'](respondWithResult(_0x14c08e,0xc9))['catch'](handleError(_0x14c08e,null));};exports[_0x9463('0x24')]=function(_0x221bbd,_0x5317ef){if(_0x221bbd[_0x9463('0x4b')]['id']){delete _0x221bbd[_0x9463('0x4b')]['id'];}return db[_0x9463('0x2d')][_0x9463('0x49')]({'where':{'id':_0x221bbd[_0x9463('0x46')]['id']}})[_0x9463('0x25')](handleEntityNotFound(_0x5317ef,null))[_0x9463('0x25')](saveUpdates(_0x221bbd[_0x9463('0x4b')],null))[_0x9463('0x25')](respondWithResult(_0x5317ef,null))[_0x9463('0x44')](handleError(_0x5317ef,null));};exports[_0x9463('0x26')]=function(_0xf6fd21,_0x2adffa){return db[_0x9463('0x2d')][_0x9463('0x49')]({'where':{'id':_0xf6fd21[_0x9463('0x46')]['id']}})['then'](handleEntityNotFound(_0x2adffa,null))['then'](removeEntity(_0x2adffa,null))[_0x9463('0x44')](handleError(_0x2adffa,null));};exports[_0x9463('0x4c')]=function(_0x58e571,_0x18163b,_0x13dec0){var _0x1ee0f8={};var _0x4ffcf3={};var _0x24916d;var _0x17e7f2;return db[_0x9463('0x2d')][_0x9463('0x4d')]({'where':{'id':_0x58e571[_0x9463('0x46')]['id']}})[_0x9463('0x25')](handleEntityNotFound(_0x18163b,null))[_0x9463('0x25')](function(_0xbb82fe){if(_0xbb82fe){_0x24916d=_0xbb82fe;_0x4ffcf3[_0x9463('0x36')]=_[_0x9463('0x32')](db[_0x9463('0x4e')][_0x9463('0x2e')]);_0x4ffcf3['query']=_['keys'](_0x58e571['query']);_0x4ffcf3[_0x9463('0x34')]=_[_0x9463('0x35')](_0x4ffcf3[_0x9463('0x36')],_0x4ffcf3[_0x9463('0x33')]);_0x1ee0f8[_0x9463('0x38')]=_[_0x9463('0x35')](_0x4ffcf3['model'],qs[_0x9463('0x37')](_0x58e571[_0x9463('0x33')][_0x9463('0x37')]));_0x1ee0f8[_0x9463('0x38')]=_0x1ee0f8[_0x9463('0x38')][_0x9463('0x39')]?_0x1ee0f8[_0x9463('0x38')]:_0x4ffcf3[_0x9463('0x36')];_0x1ee0f8[_0x9463('0x3b')]=qs[_0x9463('0x3c')](_0x58e571[_0x9463('0x33')]['sort']);_0x1ee0f8['where']=qs[_0x9463('0x34')](_[_0x9463('0x3e')](_0x58e571[_0x9463('0x33')],_0x4ffcf3['filters']));if(_0x58e571[_0x9463('0x33')][_0x9463('0x3f')]){_0x1ee0f8['where']=_[_0x9463('0x40')](_0x1ee0f8[_0x9463('0x3d')],{'$or':_[_0x9463('0x2c')](_0x1ee0f8[_0x9463('0x38')],function(_0x3265ca){var _0x26a75d={};_0x26a75d[_0x3265ca]={'$like':'%'+_0x58e571[_0x9463('0x33')]['filter']+'%'};return _0x26a75d;})});}_0x1ee0f8=_[_0x9463('0x40')]({},_0x1ee0f8,_0x58e571['options']);return _0x24916d[_0x9463('0x4c')](_0x1ee0f8);}})[_0x9463('0x25')](function(_0x1b341f){if(_0x1b341f){_0x17e7f2=_0x1b341f['length'];if(!_0x58e571[_0x9463('0x33')]['hasOwnProperty'](_0x9463('0x3a'))){_0x1ee0f8['limit']=qs[_0x9463('0x1f')](_0x58e571['query'][_0x9463('0x1f')]);_0x1ee0f8['offset']=qs[_0x9463('0x1c')](_0x58e571[_0x9463('0x33')]['offset']);}return _0x24916d[_0x9463('0x4c')](_0x1ee0f8);}})[_0x9463('0x25')](function(_0x180b24){if(_0x180b24){return _0x180b24?{'count':_0x17e7f2,'rows':_0x180b24}:null;}})[_0x9463('0x25')](respondWithResult(_0x18163b,null))[_0x9463('0x44')](handleError(_0x18163b,null));};exports[_0x9463('0x4f')]=function(_0xd2b94a,_0x14d58b,_0x335346){var _0x59e1d7={};var _0x57360d={};var _0x1edd90;var _0x2ea636;return db[_0x9463('0x2d')][_0x9463('0x4d')]({'where':{'id':_0xd2b94a['params']['id']}})[_0x9463('0x25')](handleEntityNotFound(_0x14d58b,null))[_0x9463('0x25')](function(_0x39eb4c){if(_0x39eb4c){_0x1edd90=_0x39eb4c;_0x57360d[_0x9463('0x36')]=_[_0x9463('0x32')](db[_0x9463('0x4e')][_0x9463('0x2e')]);_0x57360d[_0x9463('0x33')]=_[_0x9463('0x32')](_0xd2b94a[_0x9463('0x33')]);_0x57360d[_0x9463('0x34')]=_[_0x9463('0x35')](_0x57360d[_0x9463('0x36')],_0x57360d[_0x9463('0x33')]);_0x59e1d7['attributes']=_['intersection'](_0x57360d[_0x9463('0x36')],qs['fields'](_0xd2b94a[_0x9463('0x33')][_0x9463('0x37')]));_0x59e1d7[_0x9463('0x38')]=_0x59e1d7[_0x9463('0x38')][_0x9463('0x39')]?_0x59e1d7[_0x9463('0x38')]:_0x57360d['model'];_0x59e1d7[_0x9463('0x3b')]=qs[_0x9463('0x3c')](_0xd2b94a[_0x9463('0x33')][_0x9463('0x3c')]);_0x59e1d7[_0x9463('0x3d')]=qs['filters'](_[_0x9463('0x3e')](_0xd2b94a[_0x9463('0x33')],_0x57360d[_0x9463('0x34')]));if(_0xd2b94a['query'][_0x9463('0x3f')]){_0x59e1d7[_0x9463('0x3d')]=_[_0x9463('0x40')](_0x59e1d7['where'],{'$or':_[_0x9463('0x2c')](_0x59e1d7[_0x9463('0x38')],function(_0xf3a27c){var _0x3dd2bc={};_0x3dd2bc[_0xf3a27c]={'$like':'%'+_0xd2b94a[_0x9463('0x33')]['filter']+'%'};return _0x3dd2bc;})});}_0x59e1d7=_[_0x9463('0x40')]({},_0x59e1d7,_0xd2b94a['options']);return _0x1edd90[_0x9463('0x4f')](_0x59e1d7);}})['then'](function(_0x401bc0){if(_0x401bc0){_0x2ea636=_0x401bc0[_0x9463('0x39')];if(!_0xd2b94a['query']['hasOwnProperty']('nolimit')){_0x59e1d7['limit']=qs[_0x9463('0x1f')](_0xd2b94a[_0x9463('0x33')][_0x9463('0x1f')]);_0x59e1d7['offset']=qs['offset'](_0xd2b94a['query'][_0x9463('0x1c')]);}return _0x1edd90[_0x9463('0x4f')](_0x59e1d7);}})[_0x9463('0x25')](function(_0x2568ac){if(_0x2568ac){return _0x2568ac?{'count':_0x2ea636,'rows':_0x2568ac}:null;}})[_0x9463('0x25')](respondWithResult(_0x14d58b,null))['catch'](handleError(_0x14d58b,null));};exports[_0x9463('0x50')]=function(_0xa5f9cc,_0x398a47,_0x448a39){var _0x9879e4={};var _0x868a33={};var _0x44235b;var _0x4d3319;return db[_0x9463('0x2d')][_0x9463('0x4d')]({'where':{'id':_0xa5f9cc['params']['id']}})[_0x9463('0x25')](handleEntityNotFound(_0x398a47,null))['then'](function(_0xb77c37){if(_0xb77c37){_0x44235b=_0xb77c37;_0x868a33[_0x9463('0x36')]=_[_0x9463('0x32')](db[_0x9463('0x4e')][_0x9463('0x2e')]);_0x868a33[_0x9463('0x33')]=_[_0x9463('0x32')](_0xa5f9cc[_0x9463('0x33')]);_0x868a33[_0x9463('0x34')]=_[_0x9463('0x35')](_0x868a33[_0x9463('0x36')],_0x868a33[_0x9463('0x33')]);_0x9879e4[_0x9463('0x38')]=_[_0x9463('0x35')](_0x868a33[_0x9463('0x36')],qs[_0x9463('0x37')](_0xa5f9cc['query'][_0x9463('0x37')]));_0x9879e4[_0x9463('0x38')]=_0x9879e4[_0x9463('0x38')][_0x9463('0x39')]?_0x9879e4[_0x9463('0x38')]:_0x868a33[_0x9463('0x36')];_0x9879e4['order']=qs[_0x9463('0x3c')](_0xa5f9cc[_0x9463('0x33')]['sort']);_0x9879e4[_0x9463('0x3d')]=qs[_0x9463('0x34')](_[_0x9463('0x3e')](_0xa5f9cc['query'],_0x868a33[_0x9463('0x34')]));if(_0xa5f9cc[_0x9463('0x33')]['filter']){_0x9879e4['where']=_[_0x9463('0x40')](_0x9879e4['where'],{'$or':_[_0x9463('0x2c')](_0x9879e4[_0x9463('0x38')],function(_0x3635fd){var _0x12d1ef={};_0x12d1ef[_0x3635fd]={'$like':'%'+_0xa5f9cc[_0x9463('0x33')][_0x9463('0x3f')]+'%'};return _0x12d1ef;})});}_0x9879e4=_[_0x9463('0x40')]({},_0x9879e4,_0xa5f9cc['options']);return _0x44235b[_0x9463('0x50')](_0x9879e4);}})[_0x9463('0x25')](function(_0x105cf5){if(_0x105cf5){_0x4d3319=_0x105cf5[_0x9463('0x39')];if(!_0xa5f9cc[_0x9463('0x33')]['hasOwnProperty'](_0x9463('0x3a'))){_0x9879e4['limit']=qs[_0x9463('0x1f')](_0xa5f9cc[_0x9463('0x33')][_0x9463('0x1f')]);_0x9879e4[_0x9463('0x1c')]=qs['offset'](_0xa5f9cc['query']['offset']);}return _0x44235b['getDescriptions'](_0x9879e4);}})[_0x9463('0x25')](function(_0x3fc9e3){if(_0x3fc9e3){return _0x3fc9e3?{'count':_0x4d3319,'rows':_0x3fc9e3}:null;}})[_0x9463('0x25')](respondWithResult(_0x398a47,null))['catch'](handleError(_0x398a47,null));};exports[_0x9463('0x51')]=function(_0x4c92f5,_0x7c6f66,_0x5c0563){var _0x10db2e={};var _0x240aa1={};var _0x1a5cb7;var _0x16780a;return db[_0x9463('0x2d')][_0x9463('0x4d')]({'where':{'id':_0x4c92f5[_0x9463('0x46')]['id']}})[_0x9463('0x25')](handleEntityNotFound(_0x7c6f66,null))['then'](function(_0x5a3f26){if(_0x5a3f26){_0x1a5cb7=_0x5a3f26;_0x240aa1[_0x9463('0x36')]=_[_0x9463('0x32')](db[_0x9463('0x52')][_0x9463('0x2e')]);_0x240aa1[_0x9463('0x33')]=_[_0x9463('0x32')](_0x4c92f5[_0x9463('0x33')]);_0x240aa1[_0x9463('0x34')]=_[_0x9463('0x35')](_0x240aa1[_0x9463('0x36')],_0x240aa1[_0x9463('0x33')]);_0x10db2e[_0x9463('0x38')]=_[_0x9463('0x35')](_0x240aa1['model'],qs['fields'](_0x4c92f5[_0x9463('0x33')][_0x9463('0x37')]));_0x10db2e[_0x9463('0x38')]=_0x10db2e[_0x9463('0x38')][_0x9463('0x39')]?_0x10db2e[_0x9463('0x38')]:_0x240aa1[_0x9463('0x36')];_0x10db2e[_0x9463('0x3b')]=qs['sort'](_0x4c92f5[_0x9463('0x33')][_0x9463('0x3c')]);_0x10db2e[_0x9463('0x3d')]=qs[_0x9463('0x34')](_[_0x9463('0x3e')](_0x4c92f5[_0x9463('0x33')],_0x240aa1[_0x9463('0x34')]));if(_0x4c92f5[_0x9463('0x33')]['filter']){_0x10db2e['where']=_[_0x9463('0x40')](_0x10db2e[_0x9463('0x3d')],{'$or':_[_0x9463('0x2c')](_0x10db2e['attributes'],function(_0x472c06){var _0x3d13bf={};_0x3d13bf[_0x472c06]={'$like':'%'+_0x4c92f5[_0x9463('0x33')][_0x9463('0x3f')]+'%'};return _0x3d13bf;})});}_0x10db2e=_[_0x9463('0x40')]({},_0x10db2e,_0x4c92f5['options']);return _0x1a5cb7[_0x9463('0x51')](_0x10db2e);}})[_0x9463('0x25')](function(_0x25a4fc){if(_0x25a4fc){_0x16780a=_0x25a4fc[_0x9463('0x39')];if(!_0x4c92f5[_0x9463('0x33')][_0x9463('0x53')](_0x9463('0x3a'))){_0x10db2e['limit']=qs[_0x9463('0x1f')](_0x4c92f5[_0x9463('0x33')][_0x9463('0x1f')]);_0x10db2e[_0x9463('0x1c')]=qs[_0x9463('0x1c')](_0x4c92f5[_0x9463('0x33')]['offset']);}return _0x1a5cb7[_0x9463('0x51')](_0x10db2e);}})['then'](function(_0x2bf81b){if(_0x2bf81b){return _0x2bf81b?{'count':_0x16780a,'rows':_0x2bf81b}:null;}})[_0x9463('0x25')](respondWithResult(_0x7c6f66,null))['catch'](handleError(_0x7c6f66,null));};exports[_0x9463('0x54')]=function(_0x340506,_0x3618ab,_0x358f90){if(_0x340506['body']['id']){delete _0x340506[_0x9463('0x4b')]['id'];}return db[_0x9463('0x2d')][_0x9463('0x4d')]({'where':{'id':_0x340506[_0x9463('0x46')]['id']}})[_0x9463('0x25')](handleEntityNotFound(_0x3618ab,null))[_0x9463('0x25')](function(_0x3c96a1){if(_0x3c96a1){return _0x3c96a1[_0x9463('0x54')](_0x340506['body'][_0x9463('0x55')]||[]);}return null;})['then'](respondWithResult(_0x3618ab,null))['catch'](handleError(_0x3618ab,null));}; \ No newline at end of file +var _0x3066=['body','update','params','findOne','ZendeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','then','stack','name','send','index','map','ZendeskConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','rawAttributes','include','find','catch','create'];(function(_0x243fd3,_0x25e8d3){var _0x1575b7=function(_0x44d893){while(--_0x44d893){_0x243fd3['push'](_0x243fd3['shift']());}};_0x1575b7(++_0x25e8d3);}(_0x3066,0xa9));var _0x6306=function(_0x258d1f,_0x13d542){_0x258d1f=_0x258d1f-0x0;var _0x19be46=_0x3066[_0x258d1f];return _0x19be46;};'use strict';var emlformat=require(_0x6306('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(_0x6306('0x1'));var util=require(_0x6306('0x2'));var path=require('path');var sox=require(_0x6306('0x3'));var csv=require(_0x6306('0x4'));var ejs=require(_0x6306('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6306('0x6'));var crypto=require(_0x6306('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x6306('0x8'));var toCsv=require('to-csv');var querystring=require(_0x6306('0x9'));var Papa=require(_0x6306('0xa'));var Redis=require(_0x6306('0xb'));var authService=require(_0x6306('0xc'));var qs=require(_0x6306('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6306('0xe'));var utils=require(_0x6306('0xf'));var config=require(_0x6306('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x6306('0x11'))['db'];function respondWithStatusCode(_0x3a2a58,_0xfb9df4){_0xfb9df4=_0xfb9df4||0xcc;return function(_0x27dffb){if(_0x27dffb){return _0x3a2a58[_0x6306('0x12')](_0xfb9df4);}return _0x3a2a58['status'](_0xfb9df4)[_0x6306('0x13')]();};}function respondWithResult(_0x161eec,_0x287c8a){_0x287c8a=_0x287c8a||0xc8;return function(_0x5af842){if(_0x5af842){return _0x161eec[_0x6306('0x14')](_0x287c8a)[_0x6306('0x15')](_0x5af842);}};}function respondWithFilteredResult(_0x49c33b,_0x2c4aec){return function(_0xaa9e42){if(_0xaa9e42){var _0x30a495=typeof _0x2c4aec['offset']===_0x6306('0x16')&&typeof _0x2c4aec[_0x6306('0x17')]===_0x6306('0x16');var _0x37e021=_0xaa9e42[_0x6306('0x18')];var _0x3261ff=_0x30a495?0x0:_0x2c4aec['offset'];var _0x5c01d3=_0x30a495?_0xaa9e42[_0x6306('0x18')]:_0x2c4aec[_0x6306('0x19')]+_0x2c4aec['limit'];var _0x45c607;if(_0x5c01d3>=_0x37e021){_0x5c01d3=_0x37e021;_0x45c607=0xc8;}else{_0x45c607=0xce;}_0x49c33b[_0x6306('0x14')](_0x45c607);return _0x49c33b[_0x6306('0x1a')](_0x6306('0x1b'),_0x3261ff+'-'+_0x5c01d3+'/'+_0x37e021)['json'](_0xaa9e42);}return null;};}function patchUpdates(_0xf4836b){return function(_0x28c095){try{jsonpatch[_0x6306('0x1c')](_0x28c095,_0xf4836b,!![]);}catch(_0x3c91ee){return BPromise['reject'](_0x3c91ee);}return _0x28c095[_0x6306('0x1d')]();};}function saveUpdates(_0xf9649c,_0x1af1a8){return function(_0x118baf){if(_0x118baf){return _0x118baf['update'](_0xf9649c)['then'](function(_0x217fa4){return _0x217fa4;});}return null;};}function removeEntity(_0xb28540,_0x35a987){return function(_0x4025b6){if(_0x4025b6){return _0x4025b6[_0x6306('0x1e')]()[_0x6306('0x1f')](function(){_0xb28540[_0x6306('0x14')](0xcc)[_0x6306('0x13')]();});}};}function handleEntityNotFound(_0x405ff9,_0x127807){return function(_0x9fb169){if(!_0x9fb169){_0x405ff9[_0x6306('0x12')](0x194);}return _0x9fb169;};}function handleError(_0x33f3cf,_0x33a650){_0x33a650=_0x33a650||0x1f4;return function(_0x4d78e1){logger['error'](_0x4d78e1[_0x6306('0x20')]);if(_0x4d78e1['name']){delete _0x4d78e1[_0x6306('0x21')];}_0x33f3cf[_0x6306('0x14')](_0x33a650)[_0x6306('0x22')](_0x4d78e1);};}exports[_0x6306('0x23')]=function(_0x1ed0be,_0x57da93){var _0x5a4711={},_0xd9913d={},_0x5e5044={'count':0x0,'rows':[]};var _0x5728cd=_[_0x6306('0x24')](db[_0x6306('0x25')]['rawAttributes'],function(_0x40d140){return{'name':_0x40d140['fieldName'],'type':_0x40d140[_0x6306('0x26')][_0x6306('0x27')]};});_0xd9913d[_0x6306('0x28')]=_[_0x6306('0x24')](_0x5728cd,_0x6306('0x21'));_0xd9913d[_0x6306('0x29')]=_[_0x6306('0x2a')](_0x1ed0be[_0x6306('0x29')]);_0xd9913d[_0x6306('0x2b')]=_[_0x6306('0x2c')](_0xd9913d[_0x6306('0x28')],_0xd9913d['query']);_0x5a4711[_0x6306('0x2d')]=_[_0x6306('0x2c')](_0xd9913d['model'],qs[_0x6306('0x2e')](_0x1ed0be[_0x6306('0x29')][_0x6306('0x2e')]));_0x5a4711['attributes']=_0x5a4711[_0x6306('0x2d')][_0x6306('0x2f')]?_0x5a4711[_0x6306('0x2d')]:_0xd9913d[_0x6306('0x28')];if(!_0x1ed0be[_0x6306('0x29')]['hasOwnProperty'](_0x6306('0x30'))){_0x5a4711[_0x6306('0x17')]=qs[_0x6306('0x17')](_0x1ed0be['query'][_0x6306('0x17')]);_0x5a4711[_0x6306('0x19')]=qs['offset'](_0x1ed0be[_0x6306('0x29')][_0x6306('0x19')]);}_0x5a4711[_0x6306('0x31')]=qs[_0x6306('0x32')](_0x1ed0be[_0x6306('0x29')][_0x6306('0x32')]);_0x5a4711[_0x6306('0x33')]=qs['filters'](_[_0x6306('0x34')](_0x1ed0be[_0x6306('0x29')],_0xd9913d[_0x6306('0x2b')]),_0x5728cd);if(_0x1ed0be['query'][_0x6306('0x35')]){_0x5a4711[_0x6306('0x33')]=_[_0x6306('0x36')](_0x5a4711[_0x6306('0x33')],{'$or':_[_0x6306('0x24')](_0x5728cd,function(_0x2f9382){if(_0x2f9382[_0x6306('0x26')]!==_0x6306('0x37')){var _0x1fdfa2={};_0x1fdfa2[_0x2f9382['name']]={'$like':'%'+_0x1ed0be[_0x6306('0x29')][_0x6306('0x35')]+'%'};return _0x1fdfa2;}})});}_0x5a4711=_['merge']({},_0x5a4711,_0x1ed0be[_0x6306('0x38')]);var _0x575628={'where':_0x5a4711[_0x6306('0x33')]};return db[_0x6306('0x25')][_0x6306('0x18')](_0x575628)[_0x6306('0x1f')](function(_0x4b8089){_0x5e5044[_0x6306('0x18')]=_0x4b8089;if(_0x1ed0be[_0x6306('0x29')][_0x6306('0x39')]){_0x5a4711['include']=[{'all':!![]}];}return db[_0x6306('0x25')]['findAll'](_0x5a4711);})[_0x6306('0x1f')](function(_0x3cc5f6){_0x5e5044[_0x6306('0x3a')]=_0x3cc5f6;return _0x5e5044;})[_0x6306('0x1f')](respondWithFilteredResult(_0x57da93,_0x5a4711))['catch'](handleError(_0x57da93,null));};exports[_0x6306('0x3b')]=function(_0x2950b3,_0x3c490b){var _0x5bafbd={'raw':![],'where':{'id':_0x2950b3['params']['id']}},_0x5d00d5={};_0x5d00d5['model']=_[_0x6306('0x2a')](db['ZendeskConfiguration'][_0x6306('0x3c')]);_0x5d00d5[_0x6306('0x29')]=_[_0x6306('0x2a')](_0x2950b3['query']);_0x5d00d5[_0x6306('0x2b')]=_[_0x6306('0x2c')](_0x5d00d5[_0x6306('0x28')],_0x5d00d5[_0x6306('0x29')]);_0x5bafbd['attributes']=_[_0x6306('0x2c')](_0x5d00d5[_0x6306('0x28')],qs[_0x6306('0x2e')](_0x2950b3[_0x6306('0x29')]['fields']));_0x5bafbd['attributes']=_0x5bafbd[_0x6306('0x2d')][_0x6306('0x2f')]?_0x5bafbd[_0x6306('0x2d')]:_0x5d00d5[_0x6306('0x28')];if(_0x2950b3['query'][_0x6306('0x39')]){_0x5bafbd[_0x6306('0x3d')]=[{'all':!![]}];}_0x5bafbd=_[_0x6306('0x36')]({},_0x5bafbd,_0x2950b3[_0x6306('0x38')]);return db['ZendeskConfiguration'][_0x6306('0x3e')](_0x5bafbd)[_0x6306('0x1f')](handleEntityNotFound(_0x3c490b,null))[_0x6306('0x1f')](respondWithResult(_0x3c490b,null))[_0x6306('0x3f')](handleError(_0x3c490b,null));};exports[_0x6306('0x40')]=function(_0x552b56,_0x1b60c1){return db[_0x6306('0x25')]['create'](_0x552b56[_0x6306('0x41')],{})[_0x6306('0x1f')](respondWithResult(_0x1b60c1,0xc9))[_0x6306('0x3f')](handleError(_0x1b60c1,null));};exports[_0x6306('0x42')]=function(_0x130b86,_0x2b3c59){if(_0x130b86[_0x6306('0x41')]['id']){delete _0x130b86[_0x6306('0x41')]['id'];}return db[_0x6306('0x25')][_0x6306('0x3e')]({'where':{'id':_0x130b86[_0x6306('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b3c59,null))[_0x6306('0x1f')](saveUpdates(_0x130b86[_0x6306('0x41')],null))[_0x6306('0x1f')](respondWithResult(_0x2b3c59,null))[_0x6306('0x3f')](handleError(_0x2b3c59,null));};exports['destroy']=function(_0x3c6f22,_0x595d1a){return db[_0x6306('0x25')][_0x6306('0x3e')]({'where':{'id':_0x3c6f22[_0x6306('0x43')]['id']}})['then'](handleEntityNotFound(_0x595d1a,null))['then'](removeEntity(_0x595d1a,null))['catch'](handleError(_0x595d1a,null));};exports['getFields']=function(_0x550cd6,_0x8c77c0,_0x134416){var _0x2e03bc={};var _0x19b6f0={};var _0x56aa28;var _0x4396be;return db[_0x6306('0x25')][_0x6306('0x44')]({'where':{'id':_0x550cd6[_0x6306('0x43')]['id']}})[_0x6306('0x1f')](handleEntityNotFound(_0x8c77c0,null))[_0x6306('0x1f')](function(_0x3e8fec){if(_0x3e8fec){_0x56aa28=_0x3e8fec;_0x19b6f0['model']=_['keys'](db[_0x6306('0x45')][_0x6306('0x3c')]);_0x19b6f0['query']=_[_0x6306('0x2a')](_0x550cd6['query']);_0x19b6f0[_0x6306('0x2b')]=_['intersection'](_0x19b6f0['model'],_0x19b6f0['query']);_0x2e03bc[_0x6306('0x2d')]=_[_0x6306('0x2c')](_0x19b6f0[_0x6306('0x28')],qs[_0x6306('0x2e')](_0x550cd6[_0x6306('0x29')][_0x6306('0x2e')]));_0x2e03bc[_0x6306('0x2d')]=_0x2e03bc[_0x6306('0x2d')]['length']?_0x2e03bc[_0x6306('0x2d')]:_0x19b6f0['model'];_0x2e03bc['order']=qs['sort'](_0x550cd6[_0x6306('0x29')][_0x6306('0x32')]);_0x2e03bc['where']=qs[_0x6306('0x2b')](_[_0x6306('0x34')](_0x550cd6[_0x6306('0x29')],_0x19b6f0[_0x6306('0x2b')]));if(_0x550cd6[_0x6306('0x29')][_0x6306('0x35')]){_0x2e03bc[_0x6306('0x33')]=_[_0x6306('0x36')](_0x2e03bc[_0x6306('0x33')],{'$or':_[_0x6306('0x24')](_0x2e03bc[_0x6306('0x2d')],function(_0x5b0aea){var _0x349fbc={};_0x349fbc[_0x5b0aea]={'$like':'%'+_0x550cd6[_0x6306('0x29')]['filter']+'%'};return _0x349fbc;})});}_0x2e03bc=_['merge']({},_0x2e03bc,_0x550cd6[_0x6306('0x38')]);return _0x56aa28[_0x6306('0x46')](_0x2e03bc);}})[_0x6306('0x1f')](function(_0x61fdb6){if(_0x61fdb6){_0x4396be=_0x61fdb6[_0x6306('0x2f')];if(!_0x550cd6[_0x6306('0x29')][_0x6306('0x47')](_0x6306('0x30'))){_0x2e03bc[_0x6306('0x17')]=qs['limit'](_0x550cd6[_0x6306('0x29')][_0x6306('0x17')]);_0x2e03bc[_0x6306('0x19')]=qs[_0x6306('0x19')](_0x550cd6[_0x6306('0x29')][_0x6306('0x19')]);}return _0x56aa28['getFields'](_0x2e03bc);}})['then'](function(_0x26c416){if(_0x26c416){return _0x26c416?{'count':_0x4396be,'rows':_0x26c416}:null;}})[_0x6306('0x1f')](respondWithResult(_0x8c77c0,null))[_0x6306('0x3f')](handleError(_0x8c77c0,null));};exports[_0x6306('0x48')]=function(_0x4a6296,_0x2afce9,_0x2f1270){var _0x2cb3b8={};var _0x1c3b52={};var _0x3f9645;var _0x5c40d9;return db[_0x6306('0x25')][_0x6306('0x44')]({'where':{'id':_0x4a6296[_0x6306('0x43')]['id']}})[_0x6306('0x1f')](handleEntityNotFound(_0x2afce9,null))[_0x6306('0x1f')](function(_0x4fa2d5){if(_0x4fa2d5){_0x3f9645=_0x4fa2d5;_0x1c3b52['model']=_['keys'](db[_0x6306('0x45')][_0x6306('0x3c')]);_0x1c3b52[_0x6306('0x29')]=_[_0x6306('0x2a')](_0x4a6296[_0x6306('0x29')]);_0x1c3b52[_0x6306('0x2b')]=_[_0x6306('0x2c')](_0x1c3b52['model'],_0x1c3b52[_0x6306('0x29')]);_0x2cb3b8[_0x6306('0x2d')]=_['intersection'](_0x1c3b52[_0x6306('0x28')],qs[_0x6306('0x2e')](_0x4a6296[_0x6306('0x29')][_0x6306('0x2e')]));_0x2cb3b8[_0x6306('0x2d')]=_0x2cb3b8['attributes']['length']?_0x2cb3b8[_0x6306('0x2d')]:_0x1c3b52['model'];_0x2cb3b8[_0x6306('0x31')]=qs[_0x6306('0x32')](_0x4a6296[_0x6306('0x29')][_0x6306('0x32')]);_0x2cb3b8[_0x6306('0x33')]=qs[_0x6306('0x2b')](_[_0x6306('0x34')](_0x4a6296['query'],_0x1c3b52[_0x6306('0x2b')]));if(_0x4a6296[_0x6306('0x29')][_0x6306('0x35')]){_0x2cb3b8[_0x6306('0x33')]=_[_0x6306('0x36')](_0x2cb3b8['where'],{'$or':_[_0x6306('0x24')](_0x2cb3b8['attributes'],function(_0x31d962){var _0x356f38={};_0x356f38[_0x31d962]={'$like':'%'+_0x4a6296['query'][_0x6306('0x35')]+'%'};return _0x356f38;})});}_0x2cb3b8=_[_0x6306('0x36')]({},_0x2cb3b8,_0x4a6296['options']);return _0x3f9645['getSubjects'](_0x2cb3b8);}})[_0x6306('0x1f')](function(_0x2a8000){if(_0x2a8000){_0x5c40d9=_0x2a8000[_0x6306('0x2f')];if(!_0x4a6296[_0x6306('0x29')][_0x6306('0x47')](_0x6306('0x30'))){_0x2cb3b8[_0x6306('0x17')]=qs[_0x6306('0x17')](_0x4a6296[_0x6306('0x29')][_0x6306('0x17')]);_0x2cb3b8['offset']=qs[_0x6306('0x19')](_0x4a6296[_0x6306('0x29')][_0x6306('0x19')]);}return _0x3f9645[_0x6306('0x48')](_0x2cb3b8);}})[_0x6306('0x1f')](function(_0x5cd1d3){if(_0x5cd1d3){return _0x5cd1d3?{'count':_0x5c40d9,'rows':_0x5cd1d3}:null;}})[_0x6306('0x1f')](respondWithResult(_0x2afce9,null))[_0x6306('0x3f')](handleError(_0x2afce9,null));};exports[_0x6306('0x49')]=function(_0x38b3a9,_0x42f005,_0x4a4ed2){var _0x4439aa={};var _0x441f7e={};var _0xcb280d;var _0x170c2d;return db[_0x6306('0x25')][_0x6306('0x44')]({'where':{'id':_0x38b3a9[_0x6306('0x43')]['id']}})['then'](handleEntityNotFound(_0x42f005,null))['then'](function(_0x21e47f){if(_0x21e47f){_0xcb280d=_0x21e47f;_0x441f7e['model']=_['keys'](db[_0x6306('0x45')][_0x6306('0x3c')]);_0x441f7e[_0x6306('0x29')]=_[_0x6306('0x2a')](_0x38b3a9[_0x6306('0x29')]);_0x441f7e[_0x6306('0x2b')]=_[_0x6306('0x2c')](_0x441f7e[_0x6306('0x28')],_0x441f7e[_0x6306('0x29')]);_0x4439aa[_0x6306('0x2d')]=_[_0x6306('0x2c')](_0x441f7e[_0x6306('0x28')],qs[_0x6306('0x2e')](_0x38b3a9[_0x6306('0x29')][_0x6306('0x2e')]));_0x4439aa[_0x6306('0x2d')]=_0x4439aa[_0x6306('0x2d')]['length']?_0x4439aa[_0x6306('0x2d')]:_0x441f7e[_0x6306('0x28')];_0x4439aa[_0x6306('0x31')]=qs[_0x6306('0x32')](_0x38b3a9[_0x6306('0x29')][_0x6306('0x32')]);_0x4439aa[_0x6306('0x33')]=qs['filters'](_[_0x6306('0x34')](_0x38b3a9[_0x6306('0x29')],_0x441f7e[_0x6306('0x2b')]));if(_0x38b3a9[_0x6306('0x29')][_0x6306('0x35')]){_0x4439aa[_0x6306('0x33')]=_[_0x6306('0x36')](_0x4439aa[_0x6306('0x33')],{'$or':_[_0x6306('0x24')](_0x4439aa[_0x6306('0x2d')],function(_0x512519){var _0x4d7602={};_0x4d7602[_0x512519]={'$like':'%'+_0x38b3a9['query'][_0x6306('0x35')]+'%'};return _0x4d7602;})});}_0x4439aa=_[_0x6306('0x36')]({},_0x4439aa,_0x38b3a9['options']);return _0xcb280d[_0x6306('0x49')](_0x4439aa);}})['then'](function(_0x51aba0){if(_0x51aba0){_0x170c2d=_0x51aba0[_0x6306('0x2f')];if(!_0x38b3a9[_0x6306('0x29')][_0x6306('0x47')]('nolimit')){_0x4439aa['limit']=qs[_0x6306('0x17')](_0x38b3a9[_0x6306('0x29')][_0x6306('0x17')]);_0x4439aa[_0x6306('0x19')]=qs['offset'](_0x38b3a9[_0x6306('0x29')][_0x6306('0x19')]);}return _0xcb280d[_0x6306('0x49')](_0x4439aa);}})[_0x6306('0x1f')](function(_0x2b9039){if(_0x2b9039){return _0x2b9039?{'count':_0x170c2d,'rows':_0x2b9039}:null;}})[_0x6306('0x1f')](respondWithResult(_0x42f005,null))['catch'](handleError(_0x42f005,null));};exports[_0x6306('0x4a')]=function(_0x1e40b2,_0x4f9adc,_0x5ca4a2){var _0x3b540d={};var _0x273117={};var _0x4f4d3b;var _0x1df18a;return db[_0x6306('0x25')][_0x6306('0x44')]({'where':{'id':_0x1e40b2[_0x6306('0x43')]['id']}})[_0x6306('0x1f')](handleEntityNotFound(_0x4f9adc,null))[_0x6306('0x1f')](function(_0x3b1013){if(_0x3b1013){_0x4f4d3b=_0x3b1013;_0x273117['model']=_['keys'](db[_0x6306('0x4b')][_0x6306('0x3c')]);_0x273117[_0x6306('0x29')]=_[_0x6306('0x2a')](_0x1e40b2[_0x6306('0x29')]);_0x273117[_0x6306('0x2b')]=_[_0x6306('0x2c')](_0x273117[_0x6306('0x28')],_0x273117['query']);_0x3b540d[_0x6306('0x2d')]=_[_0x6306('0x2c')](_0x273117[_0x6306('0x28')],qs['fields'](_0x1e40b2[_0x6306('0x29')][_0x6306('0x2e')]));_0x3b540d[_0x6306('0x2d')]=_0x3b540d['attributes'][_0x6306('0x2f')]?_0x3b540d['attributes']:_0x273117['model'];_0x3b540d['order']=qs[_0x6306('0x32')](_0x1e40b2[_0x6306('0x29')][_0x6306('0x32')]);_0x3b540d['where']=qs[_0x6306('0x2b')](_['pick'](_0x1e40b2[_0x6306('0x29')],_0x273117[_0x6306('0x2b')]));if(_0x1e40b2[_0x6306('0x29')][_0x6306('0x35')]){_0x3b540d['where']=_[_0x6306('0x36')](_0x3b540d[_0x6306('0x33')],{'$or':_[_0x6306('0x24')](_0x3b540d[_0x6306('0x2d')],function(_0x3b23dd){var _0x37de28={};_0x37de28[_0x3b23dd]={'$like':'%'+_0x1e40b2[_0x6306('0x29')][_0x6306('0x35')]+'%'};return _0x37de28;})});}_0x3b540d=_[_0x6306('0x36')]({},_0x3b540d,_0x1e40b2[_0x6306('0x38')]);return _0x4f4d3b[_0x6306('0x4a')](_0x3b540d);}})[_0x6306('0x1f')](function(_0x328cc1){if(_0x328cc1){_0x1df18a=_0x328cc1['length'];if(!_0x1e40b2[_0x6306('0x29')][_0x6306('0x47')](_0x6306('0x30'))){_0x3b540d[_0x6306('0x17')]=qs[_0x6306('0x17')](_0x1e40b2[_0x6306('0x29')]['limit']);_0x3b540d[_0x6306('0x19')]=qs[_0x6306('0x19')](_0x1e40b2['query'][_0x6306('0x19')]);}return _0x4f4d3b[_0x6306('0x4a')](_0x3b540d);}})[_0x6306('0x1f')](function(_0x22c6bf){if(_0x22c6bf){return _0x22c6bf?{'count':_0x1df18a,'rows':_0x22c6bf}:null;}})['then'](respondWithResult(_0x4f9adc,null))[_0x6306('0x3f')](handleError(_0x4f9adc,null));};exports[_0x6306('0x4c')]=function(_0x51fb3c,_0x12c8ce,_0x1773dd){if(_0x51fb3c[_0x6306('0x41')]['id']){delete _0x51fb3c['body']['id'];}return db['ZendeskConfiguration'][_0x6306('0x44')]({'where':{'id':_0x51fb3c[_0x6306('0x43')]['id']}})[_0x6306('0x1f')](handleEntityNotFound(_0x12c8ce,null))[_0x6306('0x1f')](function(_0x465691){if(_0x465691){return _0x465691[_0x6306('0x4c')](_0x51fb3c[_0x6306('0x41')][_0x6306('0x4d')]||[]);}return null;})[_0x6306('0x1f')](respondWithResult(_0x12c8ce,null))[_0x6306('0x3f')](handleError(_0x12c8ce,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 0863b41..a6b2eac 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 _0x2032=['int_zendesk_configurations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x2cf866,_0xc3dd26){var _0x3c7564=function(_0x51b9b3){while(--_0x51b9b3){_0x2cf866['push'](_0x2cf866['shift']());}};_0x3c7564(++_0xc3dd26);}(_0x2032,0xd9));var _0x2203=function(_0x469201,_0x3ad146){_0x469201=_0x469201-0x0;var _0x15292d=_0x2032[_0x469201];return _0x15292d;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe511=['bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','api'];(function(_0x10feee,_0x175b17){var _0x4cbcec=function(_0x3667a4){while(--_0x3667a4){_0x10feee['push'](_0x10feee['shift']());}};_0x4cbcec(++_0x175b17);}(_0xe511,0x16f));var _0x1e51=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0xe511[_0x32084f];return _0x187302;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','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 1b639fa..32202ce 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 _0xc5c2=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0xc5c2,0xed));var _0x2c5c=function(_0x106591,_0x5619a8){_0x106591=_0x106591-0x0;var _0x20013f=_0xc5c2[_0x106591];return _0x20013f;};'use strict';var _=require(_0x2c5c('0x0'));var util=require(_0x2c5c('0x1'));var moment=require(_0x2c5c('0x2'));var BPromise=require(_0x2c5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c5c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c5c('0x5'));var logger=require(_0x2c5c('0x6'))(_0x2c5c('0x7'));var config=require('../../config/environment');var jayson=require(_0x2c5c('0x8'));var client=jayson['client'][_0x2c5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428e0f,_0x972b71,_0x405b96){return new BPromise(function(_0x365c4d,_0x8580cc){return client['request'](_0x428e0f,_0x405b96)['then'](function(_0x480e5f){logger[_0x2c5c('0xa')](_0x2c5c('0xb'),_0x972b71,_0x2c5c('0xc'));logger['debug'](_0x2c5c('0xd'),_0x972b71,_0x2c5c('0xc'),JSON['stringify'](_0x480e5f));if(_0x480e5f['error']){if(_0x480e5f[_0x2c5c('0xe')][_0x2c5c('0xf')]===0x1f4){logger[_0x2c5c('0xe')](_0x2c5c('0xb'),_0x972b71,_0x480e5f[_0x2c5c('0xe')][_0x2c5c('0x10')]);return _0x8580cc(_0x480e5f[_0x2c5c('0xe')]['message']);}logger[_0x2c5c('0xe')](_0x2c5c('0xb'),_0x972b71,_0x480e5f[_0x2c5c('0xe')]['message']);return _0x365c4d(_0x480e5f[_0x2c5c('0xe')][_0x2c5c('0x10')]);}else{logger[_0x2c5c('0xa')](_0x2c5c('0xb'),_0x972b71,'request\x20sent');_0x365c4d(_0x480e5f[_0x2c5c('0x11')][_0x2c5c('0x10')]);}})[_0x2c5c('0x12')](function(_0x1596a8){logger[_0x2c5c('0xe')](_0x2c5c('0xb'),_0x972b71,_0x1596a8);_0x8580cc(_0x1596a8);});});} \ No newline at end of file +var _0x1f51=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f51,0x12e));var _0x11f5=function(_0x1b0900,_0x17d4cc){_0x1b0900=_0x1b0900-0x0;var _0x25a9af=_0x1f51[_0x1b0900];return _0x25a9af;};'use strict';var _=require(_0x11f5('0x0'));var util=require('util');var moment=require(_0x11f5('0x1'));var BPromise=require(_0x11f5('0x2'));var rs=require(_0x11f5('0x3'));var fs=require('fs');var Redis=require(_0x11f5('0x4'));var db=require(_0x11f5('0x5'))['db'];var utils=require(_0x11f5('0x6'));var logger=require(_0x11f5('0x7'))(_0x11f5('0x8'));var config=require(_0x11f5('0x9'));var jayson=require(_0x11f5('0xa'));var client=jayson['client'][_0x11f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x414477,_0x5ac5b,_0x1a14c2){return new BPromise(function(_0x26b526,_0x4485b7){return client[_0x11f5('0xc')](_0x414477,_0x1a14c2)[_0x11f5('0xd')](function(_0x52583a){logger['info'](_0x11f5('0xe'),_0x5ac5b,_0x11f5('0xf'));logger[_0x11f5('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5ac5b,_0x11f5('0xf'),JSON[_0x11f5('0x11')](_0x52583a));if(_0x52583a[_0x11f5('0x12')]){if(_0x52583a[_0x11f5('0x12')][_0x11f5('0x13')]===0x1f4){logger[_0x11f5('0x12')](_0x11f5('0xe'),_0x5ac5b,_0x52583a[_0x11f5('0x12')][_0x11f5('0x14')]);return _0x4485b7(_0x52583a[_0x11f5('0x12')][_0x11f5('0x14')]);}logger[_0x11f5('0x12')](_0x11f5('0xe'),_0x5ac5b,_0x52583a[_0x11f5('0x12')][_0x11f5('0x14')]);return _0x26b526(_0x52583a[_0x11f5('0x12')]['message']);}else{logger['info'](_0x11f5('0xe'),_0x5ac5b,_0x11f5('0xf'));_0x26b526(_0x52583a[_0x11f5('0x15')][_0x11f5('0x14')]);}})[_0x11f5('0x16')](function(_0x20826f){logger['error'](_0x11f5('0xe'),_0x5ac5b,_0x20826f);_0x4485b7(_0x20826f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index d1f2003..6640738 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 _0xa1da=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x59db0f,_0x466ec8){var _0x2d3a0c=function(_0x5a1a4d){while(--_0x5a1a4d){_0x59db0f['push'](_0x59db0f['shift']());}};_0x2d3a0c(++_0x466ec8);}(_0xa1da,0xff));var _0xaa1d=function(_0x4fa821,_0x76b65f){_0x4fa821=_0x4fa821-0x0;var _0x1da928=_0xa1da[_0x4fa821];return _0x1da928;};'use strict';var multer=require('multer');var util=require(_0xaa1d('0x0'));var path=require(_0xaa1d('0x1'));var timeout=require(_0xaa1d('0x2'));var express=require(_0xaa1d('0x3'));var router=express[_0xaa1d('0x4')]();var fs_extra=require(_0xaa1d('0x5'));var auth=require(_0xaa1d('0x6'));var interaction=require(_0xaa1d('0x7'));var config=require(_0xaa1d('0x8'));var controller=require(_0xaa1d('0x9'));router[_0xaa1d('0xa')]('/',auth[_0xaa1d('0xb')](),controller['index']);router[_0xaa1d('0xa')](_0xaa1d('0xc'),auth[_0xaa1d('0xb')](),controller['show']);router[_0xaa1d('0xd')]('/',auth[_0xaa1d('0xb')](),controller[_0xaa1d('0xe')]);router[_0xaa1d('0xf')](_0xaa1d('0xc'),auth[_0xaa1d('0xb')](),controller[_0xaa1d('0x10')]);router[_0xaa1d('0x11')](_0xaa1d('0xc'),auth['isAuthenticated'](),controller[_0xaa1d('0x12')]);module[_0xaa1d('0x13')]=router; \ No newline at end of file +var _0xc859=['express','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17eb73,_0x27b996){var _0x3da89d=function(_0x5dda72){while(--_0x5dda72){_0x17eb73['push'](_0x17eb73['shift']());}};_0x3da89d(++_0x27b996);}(_0xc859,0x1d7));var _0x9c85=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xc859[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x9c85('0x0'));var util=require(_0x9c85('0x1'));var path=require(_0x9c85('0x2'));var timeout=require(_0x9c85('0x3'));var express=require(_0x9c85('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9c85('0x5'));var config=require(_0x9c85('0x6'));var controller=require(_0x9c85('0x7'));router[_0x9c85('0x8')]('/',auth[_0x9c85('0x9')](),controller[_0x9c85('0xa')]);router[_0x9c85('0x8')](_0x9c85('0xb'),auth[_0x9c85('0x9')](),controller[_0x9c85('0xc')]);router[_0x9c85('0xd')]('/',auth[_0x9c85('0x9')](),controller[_0x9c85('0xe')]);router[_0x9c85('0xf')](_0x9c85('0xb'),auth[_0x9c85('0x9')](),controller[_0x9c85('0x10')]);router['delete']('/:id',auth[_0x9c85('0x9')](),controller[_0x9c85('0x11')]);module[_0x9c85('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 3721fee..af1601f 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 _0x6654=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x6654,0x199));var _0x4665=function(_0x4edbca,_0x4b29bb){_0x4edbca=_0x4edbca-0x0;var _0x2bbe91=_0x6654[_0x4edbca];return _0x2bbe91;};'use strict';var Sequelize=require(_0x4665('0x0'));module[_0x4665('0x1')]={'type':{'type':Sequelize[_0x4665('0x2')](_0x4665('0x3'),_0x4665('0x4'),'customVariable',_0x4665('0x5'),_0x4665('0x6')),'defaultValue':_0x4665('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4665('0x7')]},'keyType':{'type':Sequelize[_0x4665('0x2')]('string',_0x4665('0x4'),_0x4665('0x8'))},'keyContent':{'type':Sequelize[_0x4665('0x7')]},'idField':{'type':Sequelize[_0x4665('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4665('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x95b7=['STRING','string','variable','customVariable','keyValue'];(function(_0x52b62b,_0x1100cd){var _0x3d14d0=function(_0x1b5ef7){while(--_0x1b5ef7){_0x52b62b['push'](_0x52b62b['shift']());}};_0x3d14d0(++_0x1100cd);}(_0x95b7,0x1dc));var _0x795b=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x95b7[_0xbb9dbf];return _0x30223c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x795b('0x0'),_0x795b('0x1'),_0x795b('0x2'),_0x795b('0x3'),'picklist'),'defaultValue':_0x795b('0x0')},'content':{'type':Sequelize[_0x795b('0x4')]},'key':{'type':Sequelize[_0x795b('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x795b('0x0'),_0x795b('0x1'),_0x795b('0x2'))},'keyContent':{'type':Sequelize[_0x795b('0x4')]},'idField':{'type':Sequelize[_0x795b('0x4')]},'nameField':{'type':Sequelize[_0x795b('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 9e7cf4a..14f4e81 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 _0x43c4=['attributes','fields','length','limit','sort','pick','where','merge','map','type','VIRTUAL','filter','options','ZendeskField','then','includeAll','findAll','show','params','include','create','body','find','catch','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','save','destroy','sendStatus','stack','name','send','index','rawAttributes','key','model','keys','query','filters','intersection'];(function(_0x307d52,_0x5501dd){var _0x3f9550=function(_0x56e78b){while(--_0x56e78b){_0x307d52['push'](_0x307d52['shift']());}};_0x3f9550(++_0x5501dd);}(_0x43c4,0xe4));var _0x443c=function(_0x4fc035,_0x198965){_0x4fc035=_0x4fc035-0x0;var _0x929338=_0x43c4[_0x4fc035];return _0x929338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x443c('0x0'));var zipdir=require(_0x443c('0x1'));var jsonpatch=require(_0x443c('0x2'));var rp=require(_0x443c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x443c('0x4'));var path=require(_0x443c('0x5'));var sox=require(_0x443c('0x6'));var csv=require(_0x443c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x443c('0x8'));var _=require(_0x443c('0x9'));var squel=require(_0x443c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x443c('0xb'));var toCsv=require(_0x443c('0x7'));var querystring=require(_0x443c('0xc'));var Papa=require(_0x443c('0xd'));var Redis=require('ioredis');var authService=require(_0x443c('0xe'));var qs=require(_0x443c('0xf'));var as=require(_0x443c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x443c('0x11'))(_0x443c('0x12'));var utils=require(_0x443c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x443c('0x14'));var db=require(_0x443c('0x15'))['db'];function respondWithStatusCode(_0xc13250,_0xe4912){_0xe4912=_0xe4912||0xcc;return function(_0x2683c8){if(_0x2683c8){return _0xc13250['sendStatus'](_0xe4912);}return _0xc13250['status'](_0xe4912)[_0x443c('0x16')]();};}function respondWithResult(_0x446f91,_0x30edbf){_0x30edbf=_0x30edbf||0xc8;return function(_0x66e59c){if(_0x66e59c){return _0x446f91[_0x443c('0x17')](_0x30edbf)[_0x443c('0x18')](_0x66e59c);}};}function respondWithFilteredResult(_0x36e058,_0x622374){return function(_0x2363ce){if(_0x2363ce){var _0xe5117=typeof _0x622374[_0x443c('0x19')]==='undefined'&&typeof _0x622374['limit']===_0x443c('0x1a');var _0x524071=_0x2363ce[_0x443c('0x1b')];var _0x3eea78=_0xe5117?0x0:_0x622374[_0x443c('0x19')];var _0x429604=_0xe5117?_0x2363ce[_0x443c('0x1b')]:_0x622374[_0x443c('0x19')]+_0x622374['limit'];var _0x85f0f9;if(_0x429604>=_0x524071){_0x429604=_0x524071;_0x85f0f9=0xc8;}else{_0x85f0f9=0xce;}_0x36e058[_0x443c('0x17')](_0x85f0f9);return _0x36e058[_0x443c('0x1c')](_0x443c('0x1d'),_0x3eea78+'-'+_0x429604+'/'+_0x524071)['json'](_0x2363ce);}return null;};}function patchUpdates(_0x2cc9d6){return function(_0x478be5){try{jsonpatch['apply'](_0x478be5,_0x2cc9d6,!![]);}catch(_0x2f31aa){return BPromise['reject'](_0x2f31aa);}return _0x478be5[_0x443c('0x1e')]();};}function saveUpdates(_0xdb248d,_0x449151){return function(_0x2c7933){if(_0x2c7933){return _0x2c7933['update'](_0xdb248d)['then'](function(_0x4f2af7){return _0x4f2af7;});}return null;};}function removeEntity(_0x5e80c3,_0x3d99f8){return function(_0x13e924){if(_0x13e924){return _0x13e924[_0x443c('0x1f')]()['then'](function(){_0x5e80c3[_0x443c('0x17')](0xcc)[_0x443c('0x16')]();});}};}function handleEntityNotFound(_0x2a7725,_0x3e8b21){return function(_0xf058cd){if(!_0xf058cd){_0x2a7725[_0x443c('0x20')](0x194);}return _0xf058cd;};}function handleError(_0x4fff34,_0x5679ec){_0x5679ec=_0x5679ec||0x1f4;return function(_0x552d0b){logger['error'](_0x552d0b[_0x443c('0x21')]);if(_0x552d0b['name']){delete _0x552d0b[_0x443c('0x22')];}_0x4fff34[_0x443c('0x17')](_0x5679ec)[_0x443c('0x23')](_0x552d0b);};}exports[_0x443c('0x24')]=function(_0x417e79,_0x4099a0){var _0x595052={},_0x21c4d8={},_0x223718={'count':0x0,'rows':[]};var _0x7b4d63=_['map'](db['ZendeskField'][_0x443c('0x25')],function(_0x21afa1){return{'name':_0x21afa1['fieldName'],'type':_0x21afa1['type'][_0x443c('0x26')]};});_0x21c4d8[_0x443c('0x27')]=_['map'](_0x7b4d63,'name');_0x21c4d8['query']=_[_0x443c('0x28')](_0x417e79[_0x443c('0x29')]);_0x21c4d8[_0x443c('0x2a')]=_[_0x443c('0x2b')](_0x21c4d8['model'],_0x21c4d8[_0x443c('0x29')]);_0x595052[_0x443c('0x2c')]=_['intersection'](_0x21c4d8[_0x443c('0x27')],qs[_0x443c('0x2d')](_0x417e79['query']['fields']));_0x595052[_0x443c('0x2c')]=_0x595052[_0x443c('0x2c')][_0x443c('0x2e')]?_0x595052['attributes']:_0x21c4d8[_0x443c('0x27')];if(!_0x417e79[_0x443c('0x29')]['hasOwnProperty']('nolimit')){_0x595052[_0x443c('0x2f')]=qs[_0x443c('0x2f')](_0x417e79[_0x443c('0x29')]['limit']);_0x595052['offset']=qs[_0x443c('0x19')](_0x417e79[_0x443c('0x29')]['offset']);}_0x595052['order']=qs[_0x443c('0x30')](_0x417e79[_0x443c('0x29')][_0x443c('0x30')]);_0x595052['where']=qs['filters'](_[_0x443c('0x31')](_0x417e79[_0x443c('0x29')],_0x21c4d8[_0x443c('0x2a')]),_0x7b4d63);if(_0x417e79['query']['filter']){_0x595052[_0x443c('0x32')]=_[_0x443c('0x33')](_0x595052['where'],{'$or':_[_0x443c('0x34')](_0x7b4d63,function(_0x58ec6c){if(_0x58ec6c[_0x443c('0x35')]!==_0x443c('0x36')){var _0x248758={};_0x248758[_0x58ec6c[_0x443c('0x22')]]={'$like':'%'+_0x417e79[_0x443c('0x29')][_0x443c('0x37')]+'%'};return _0x248758;}})});}_0x595052=_[_0x443c('0x33')]({},_0x595052,_0x417e79[_0x443c('0x38')]);var _0x435799={'where':_0x595052[_0x443c('0x32')]};return db[_0x443c('0x39')][_0x443c('0x1b')](_0x435799)[_0x443c('0x3a')](function(_0x7ad59f){_0x223718[_0x443c('0x1b')]=_0x7ad59f;if(_0x417e79[_0x443c('0x29')][_0x443c('0x3b')]){_0x595052['include']=[{'all':!![]}];}return db['ZendeskField'][_0x443c('0x3c')](_0x595052);})[_0x443c('0x3a')](function(_0x45f4f3){_0x223718['rows']=_0x45f4f3;return _0x223718;})[_0x443c('0x3a')](respondWithFilteredResult(_0x4099a0,_0x595052))['catch'](handleError(_0x4099a0,null));};exports[_0x443c('0x3d')]=function(_0x430283,_0x52778a){var _0x51b1a7={'raw':!![],'where':{'id':_0x430283[_0x443c('0x3e')]['id']}},_0x3db6be={};_0x3db6be[_0x443c('0x27')]=_['keys'](db[_0x443c('0x39')][_0x443c('0x25')]);_0x3db6be[_0x443c('0x29')]=_[_0x443c('0x28')](_0x430283[_0x443c('0x29')]);_0x3db6be[_0x443c('0x2a')]=_[_0x443c('0x2b')](_0x3db6be[_0x443c('0x27')],_0x3db6be[_0x443c('0x29')]);_0x51b1a7[_0x443c('0x2c')]=_[_0x443c('0x2b')](_0x3db6be[_0x443c('0x27')],qs['fields'](_0x430283[_0x443c('0x29')][_0x443c('0x2d')]));_0x51b1a7[_0x443c('0x2c')]=_0x51b1a7[_0x443c('0x2c')][_0x443c('0x2e')]?_0x51b1a7[_0x443c('0x2c')]:_0x3db6be[_0x443c('0x27')];if(_0x430283[_0x443c('0x29')]['includeAll']){_0x51b1a7[_0x443c('0x3f')]=[{'all':!![]}];}_0x51b1a7=_[_0x443c('0x33')]({},_0x51b1a7,_0x430283['options']);return db['ZendeskField']['find'](_0x51b1a7)[_0x443c('0x3a')](handleEntityNotFound(_0x52778a,null))[_0x443c('0x3a')](respondWithResult(_0x52778a,null))['catch'](handleError(_0x52778a,null));};exports['create']=function(_0x5266be,_0x1773fb){return db[_0x443c('0x39')][_0x443c('0x40')](_0x5266be['body'],{})[_0x443c('0x3a')](respondWithResult(_0x1773fb,0xc9))['catch'](handleError(_0x1773fb,null));};exports['update']=function(_0x4f1a90,_0x16faaa){if(_0x4f1a90['body']['id']){delete _0x4f1a90[_0x443c('0x41')]['id'];}return db[_0x443c('0x39')][_0x443c('0x42')]({'where':{'id':_0x4f1a90['params']['id']}})[_0x443c('0x3a')](handleEntityNotFound(_0x16faaa,null))['then'](saveUpdates(_0x4f1a90[_0x443c('0x41')],null))[_0x443c('0x3a')](respondWithResult(_0x16faaa,null))['catch'](handleError(_0x16faaa,null));};exports[_0x443c('0x1f')]=function(_0x33cde5,_0x19504f){return db[_0x443c('0x39')]['find']({'where':{'id':_0x33cde5[_0x443c('0x3e')]['id']}})[_0x443c('0x3a')](handleEntityNotFound(_0x19504f,null))[_0x443c('0x3a')](removeEntity(_0x19504f,null))[_0x443c('0x43')](handleError(_0x19504f,null));}; \ No newline at end of file +var _0x4edf=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','stack','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','count','then','includeAll','include','params','find','catch','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4b39ec,_0x8503cf){var _0xf07fa7=function(_0x12d972){while(--_0x12d972){_0x4b39ec['push'](_0x4b39ec['shift']());}};_0xf07fa7(++_0x8503cf);}(_0x4edf,0x196));var _0xf4ed=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x4edf[_0x263a2f];return _0x8020e8;};'use strict';var emlformat=require(_0xf4ed('0x0'));var rimraf=require(_0xf4ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf4ed('0x2'));var moment=require(_0xf4ed('0x3'));var BPromise=require(_0xf4ed('0x4'));var Mustache=require(_0xf4ed('0x5'));var util=require(_0xf4ed('0x6'));var path=require(_0xf4ed('0x7'));var sox=require(_0xf4ed('0x8'));var csv=require(_0xf4ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4ed('0xa'));var _=require(_0xf4ed('0xb'));var squel=require(_0xf4ed('0xc'));var crypto=require(_0xf4ed('0xd'));var jsforce=require(_0xf4ed('0xe'));var deskjs=require(_0xf4ed('0xf'));var toCsv=require(_0xf4ed('0x9'));var querystring=require(_0xf4ed('0x10'));var Papa=require('papaparse');var Redis=require(_0xf4ed('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf4ed('0x12'));var as=require(_0xf4ed('0x13'));var hardwareService=require(_0xf4ed('0x14'));var logger=require(_0xf4ed('0x15'))(_0xf4ed('0x16'));var utils=require(_0xf4ed('0x17'));var config=require(_0xf4ed('0x18'));var licenseUtil=require(_0xf4ed('0x19'));var db=require(_0xf4ed('0x1a'))['db'];function respondWithStatusCode(_0x31078d,_0x27e974){_0x27e974=_0x27e974||0xcc;return function(_0x5000d5){if(_0x5000d5){return _0x31078d['sendStatus'](_0x27e974);}return _0x31078d[_0xf4ed('0x1b')](_0x27e974)[_0xf4ed('0x1c')]();};}function respondWithResult(_0x30e08c,_0x103f62){_0x103f62=_0x103f62||0xc8;return function(_0x39d437){if(_0x39d437){return _0x30e08c[_0xf4ed('0x1b')](_0x103f62)[_0xf4ed('0x1d')](_0x39d437);}};}function respondWithFilteredResult(_0x552347,_0x513c6d){return function(_0x2b0316){if(_0x2b0316){var _0x30c8d8=typeof _0x513c6d[_0xf4ed('0x1e')]===_0xf4ed('0x1f')&&typeof _0x513c6d[_0xf4ed('0x20')]==='undefined';var _0x1cb49b=_0x2b0316['count'];var _0x5e67ec=_0x30c8d8?0x0:_0x513c6d[_0xf4ed('0x1e')];var _0x5e03a3=_0x30c8d8?_0x2b0316['count']:_0x513c6d['offset']+_0x513c6d[_0xf4ed('0x20')];var _0x11fab6;if(_0x5e03a3>=_0x1cb49b){_0x5e03a3=_0x1cb49b;_0x11fab6=0xc8;}else{_0x11fab6=0xce;}_0x552347[_0xf4ed('0x1b')](_0x11fab6);return _0x552347[_0xf4ed('0x21')](_0xf4ed('0x22'),_0x5e67ec+'-'+_0x5e03a3+'/'+_0x1cb49b)[_0xf4ed('0x1d')](_0x2b0316);}return null;};}function patchUpdates(_0xcdd3b7){return function(_0x407c75){try{jsonpatch[_0xf4ed('0x23')](_0x407c75,_0xcdd3b7,!![]);}catch(_0x11ec8e){return BPromise[_0xf4ed('0x24')](_0x11ec8e);}return _0x407c75['save']();};}function saveUpdates(_0x461cca,_0x1e0010){return function(_0x20c308){if(_0x20c308){return _0x20c308[_0xf4ed('0x25')](_0x461cca)['then'](function(_0x5d0c14){return _0x5d0c14;});}return null;};}function removeEntity(_0x265623,_0xfb138b){return function(_0x7dc8fc){if(_0x7dc8fc){return _0x7dc8fc['destroy']()['then'](function(){_0x265623['status'](0xcc)[_0xf4ed('0x1c')]();});}};}function handleEntityNotFound(_0x18ed82,_0x5dbe46){return function(_0x297c00){if(!_0x297c00){_0x18ed82['sendStatus'](0x194);}return _0x297c00;};}function handleError(_0x316263,_0x59179c){_0x59179c=_0x59179c||0x1f4;return function(_0x7c691d){logger['error'](_0x7c691d[_0xf4ed('0x26')]);if(_0x7c691d['name']){delete _0x7c691d['name'];}_0x316263[_0xf4ed('0x1b')](_0x59179c)['send'](_0x7c691d);};}exports['index']=function(_0x2008b3,_0x163e2a){var _0x2c2b17={},_0x57fbdf={},_0x2e0bef={'count':0x0,'rows':[]};var _0x6dd95=_[_0xf4ed('0x27')](db['ZendeskField'][_0xf4ed('0x28')],function(_0x10b54e){return{'name':_0x10b54e[_0xf4ed('0x29')],'type':_0x10b54e[_0xf4ed('0x2a')][_0xf4ed('0x2b')]};});_0x57fbdf[_0xf4ed('0x2c')]=_[_0xf4ed('0x27')](_0x6dd95,_0xf4ed('0x2d'));_0x57fbdf[_0xf4ed('0x2e')]=_[_0xf4ed('0x2f')](_0x2008b3[_0xf4ed('0x2e')]);_0x57fbdf[_0xf4ed('0x30')]=_['intersection'](_0x57fbdf[_0xf4ed('0x2c')],_0x57fbdf[_0xf4ed('0x2e')]);_0x2c2b17[_0xf4ed('0x31')]=_[_0xf4ed('0x32')](_0x57fbdf[_0xf4ed('0x2c')],qs['fields'](_0x2008b3[_0xf4ed('0x2e')]['fields']));_0x2c2b17[_0xf4ed('0x31')]=_0x2c2b17[_0xf4ed('0x31')][_0xf4ed('0x33')]?_0x2c2b17[_0xf4ed('0x31')]:_0x57fbdf[_0xf4ed('0x2c')];if(!_0x2008b3[_0xf4ed('0x2e')][_0xf4ed('0x34')](_0xf4ed('0x35'))){_0x2c2b17[_0xf4ed('0x20')]=qs[_0xf4ed('0x20')](_0x2008b3[_0xf4ed('0x2e')][_0xf4ed('0x20')]);_0x2c2b17[_0xf4ed('0x1e')]=qs['offset'](_0x2008b3['query']['offset']);}_0x2c2b17[_0xf4ed('0x36')]=qs[_0xf4ed('0x37')](_0x2008b3['query'][_0xf4ed('0x37')]);_0x2c2b17[_0xf4ed('0x38')]=qs[_0xf4ed('0x30')](_[_0xf4ed('0x39')](_0x2008b3[_0xf4ed('0x2e')],_0x57fbdf[_0xf4ed('0x30')]),_0x6dd95);if(_0x2008b3['query'][_0xf4ed('0x3a')]){_0x2c2b17[_0xf4ed('0x38')]=_[_0xf4ed('0x3b')](_0x2c2b17[_0xf4ed('0x38')],{'$or':_['map'](_0x6dd95,function(_0x197448){if(_0x197448[_0xf4ed('0x2a')]!==_0xf4ed('0x3c')){var _0xc3b5e5={};_0xc3b5e5[_0x197448[_0xf4ed('0x2d')]]={'$like':'%'+_0x2008b3[_0xf4ed('0x2e')][_0xf4ed('0x3a')]+'%'};return _0xc3b5e5;}})});}_0x2c2b17=_['merge']({},_0x2c2b17,_0x2008b3['options']);var _0xfbf231={'where':_0x2c2b17[_0xf4ed('0x38')]};return db[_0xf4ed('0x3d')][_0xf4ed('0x3e')](_0xfbf231)[_0xf4ed('0x3f')](function(_0x461c25){_0x2e0bef['count']=_0x461c25;if(_0x2008b3['query'][_0xf4ed('0x40')]){_0x2c2b17[_0xf4ed('0x41')]=[{'all':!![]}];}return db[_0xf4ed('0x3d')]['findAll'](_0x2c2b17);})[_0xf4ed('0x3f')](function(_0x2ee1){_0x2e0bef['rows']=_0x2ee1;return _0x2e0bef;})[_0xf4ed('0x3f')](respondWithFilteredResult(_0x163e2a,_0x2c2b17))['catch'](handleError(_0x163e2a,null));};exports['show']=function(_0x18c5f4,_0x2e5b6b){var _0x1e40ef={'raw':!![],'where':{'id':_0x18c5f4[_0xf4ed('0x42')]['id']}},_0x38afcb={};_0x38afcb[_0xf4ed('0x2c')]=_[_0xf4ed('0x2f')](db[_0xf4ed('0x3d')][_0xf4ed('0x28')]);_0x38afcb[_0xf4ed('0x2e')]=_[_0xf4ed('0x2f')](_0x18c5f4[_0xf4ed('0x2e')]);_0x38afcb[_0xf4ed('0x30')]=_[_0xf4ed('0x32')](_0x38afcb[_0xf4ed('0x2c')],_0x38afcb[_0xf4ed('0x2e')]);_0x1e40ef['attributes']=_[_0xf4ed('0x32')](_0x38afcb[_0xf4ed('0x2c')],qs['fields'](_0x18c5f4[_0xf4ed('0x2e')]['fields']));_0x1e40ef[_0xf4ed('0x31')]=_0x1e40ef[_0xf4ed('0x31')][_0xf4ed('0x33')]?_0x1e40ef[_0xf4ed('0x31')]:_0x38afcb['model'];if(_0x18c5f4[_0xf4ed('0x2e')][_0xf4ed('0x40')]){_0x1e40ef[_0xf4ed('0x41')]=[{'all':!![]}];}_0x1e40ef=_[_0xf4ed('0x3b')]({},_0x1e40ef,_0x18c5f4['options']);return db['ZendeskField'][_0xf4ed('0x43')](_0x1e40ef)[_0xf4ed('0x3f')](handleEntityNotFound(_0x2e5b6b,null))[_0xf4ed('0x3f')](respondWithResult(_0x2e5b6b,null))[_0xf4ed('0x44')](handleError(_0x2e5b6b,null));};exports[_0xf4ed('0x45')]=function(_0xe64ff1,_0x136185){return db[_0xf4ed('0x3d')][_0xf4ed('0x45')](_0xe64ff1[_0xf4ed('0x46')],{})[_0xf4ed('0x3f')](respondWithResult(_0x136185,0xc9))[_0xf4ed('0x44')](handleError(_0x136185,null));};exports[_0xf4ed('0x25')]=function(_0x374a36,_0xb8021){if(_0x374a36[_0xf4ed('0x46')]['id']){delete _0x374a36[_0xf4ed('0x46')]['id'];}return db[_0xf4ed('0x3d')]['find']({'where':{'id':_0x374a36[_0xf4ed('0x42')]['id']}})[_0xf4ed('0x3f')](handleEntityNotFound(_0xb8021,null))[_0xf4ed('0x3f')](saveUpdates(_0x374a36[_0xf4ed('0x46')],null))['then'](respondWithResult(_0xb8021,null))[_0xf4ed('0x44')](handleError(_0xb8021,null));};exports['destroy']=function(_0x1c99f9,_0x4df88c){return db['ZendeskField'][_0xf4ed('0x43')]({'where':{'id':_0x1c99f9['params']['id']}})[_0xf4ed('0x3f')](handleEntityNotFound(_0x4df88c,null))[_0xf4ed('0x3f')](removeEntity(_0x4df88c,null))['catch'](handleError(_0x4df88c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 51c2403..9e268fb 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 _0x9975=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x9975,0x1d7));var _0x5997=function(_0xb62b8b,_0x2ee1b1){_0xb62b8b=_0xb62b8b-0x0;var _0x196c65=_0x9975[_0xb62b8b];return _0x196c65;};'use strict';var _=require('lodash');var util=require(_0x5997('0x0'));var logger=require(_0x5997('0x1'))(_0x5997('0x2'));var moment=require('moment');var BPromise=require(_0x5997('0x3'));var rp=require(_0x5997('0x4'));var fs=require('fs');var path=require(_0x5997('0x5'));var rimraf=require(_0x5997('0x6'));var config=require(_0x5997('0x7'));var attributes=require(_0x5997('0x8'));module[_0x5997('0x9')]=function(_0x18c7f3,_0x339e86){return _0x18c7f3[_0x5997('0xa')](_0x5997('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x5997('0xc'),'fields':[_0x5997('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94cf=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x94cf,0x124));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf94c('0x0'));var util=require(_0xf94c('0x1'));var logger=require('../../config/logger')(_0xf94c('0x2'));var moment=require('moment');var BPromise=require(_0xf94c('0x3'));var rp=require(_0xf94c('0x4'));var fs=require('fs');var path=require(_0xf94c('0x5'));var rimraf=require(_0xf94c('0x6'));var config=require(_0xf94c('0x7'));var attributes=require(_0xf94c('0x8'));module[_0xf94c('0x9')]=function(_0x31ebed,_0x1dfeeb){return _0x31ebed[_0xf94c('0xa')](_0xf94c('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xf94c('0xc'),'fields':[_0xf94c('0xd'),'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 ba376ef..95706a1 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 _0x631c=['stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','request','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x37bcfe,_0xce61b3){var _0x57c7cf=function(_0xad4f52){while(--_0xad4f52){_0x37bcfe['push'](_0x37bcfe['shift']());}};_0x57c7cf(++_0xce61b3);}(_0x631c,0x115));var _0xc631=function(_0x186d7d,_0x4d973b){_0x186d7d=_0x186d7d-0x0;var _0x37b347=_0x631c[_0x186d7d];return _0x37b347;};'use strict';var _=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var moment=require('moment');var BPromise=require(_0xc631('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc631('0x3'));var db=require(_0xc631('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc631('0x5'));var config=require(_0xc631('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15e046,_0x3f9c32,_0x4e956b){return new BPromise(function(_0x5a42f4,_0x61b4ea){return client[_0xc631('0x7')](_0x15e046,_0x4e956b)['then'](function(_0x335238){logger['info'](_0xc631('0x8'),_0x3f9c32,'request\x20sent');logger[_0xc631('0x9')](_0xc631('0xa'),_0x3f9c32,_0xc631('0xb'),JSON[_0xc631('0xc')](_0x335238));if(_0x335238[_0xc631('0xd')]){if(_0x335238['error'][_0xc631('0xe')]===0x1f4){logger['error'](_0xc631('0x8'),_0x3f9c32,_0x335238[_0xc631('0xd')][_0xc631('0xf')]);return _0x61b4ea(_0x335238[_0xc631('0xd')][_0xc631('0xf')]);}logger[_0xc631('0xd')](_0xc631('0x8'),_0x3f9c32,_0x335238[_0xc631('0xd')][_0xc631('0xf')]);return _0x5a42f4(_0x335238[_0xc631('0xd')][_0xc631('0xf')]);}else{logger['info'](_0xc631('0x8'),_0x3f9c32,_0xc631('0xb'));_0x5a42f4(_0x335238[_0xc631('0x10')][_0xc631('0xf')]);}})['catch'](function(_0x1d1e37){logger[_0xc631('0xd')](_0xc631('0x8'),_0x3f9c32,_0x1d1e37);_0x61b4ea(_0x1d1e37);});});} \ No newline at end of file +var _0x4554=['lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x4554,0x176));var _0x4455=function(_0x367994,_0x556f09){_0x367994=_0x367994-0x0;var _0x47d22f=_0x4554[_0x367994];return _0x47d22f;};'use strict';var _=require(_0x4455('0x0'));var util=require(_0x4455('0x1'));var moment=require('moment');var BPromise=require(_0x4455('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4455('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4455('0x4'));var logger=require('../../config/logger')(_0x4455('0x5'));var config=require(_0x4455('0x6'));var jayson=require(_0x4455('0x7'));var client=jayson['client'][_0x4455('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x367b8a,_0x4103d0,_0x1a96c6){return new BPromise(function(_0x2b9323,_0x197e14){return client[_0x4455('0x9')](_0x367b8a,_0x1a96c6)[_0x4455('0xa')](function(_0x1394c6){logger['info'](_0x4455('0xb'),_0x4103d0,_0x4455('0xc'));logger[_0x4455('0xd')](_0x4455('0xe'),_0x4103d0,'request\x20sent',JSON[_0x4455('0xf')](_0x1394c6));if(_0x1394c6[_0x4455('0x10')]){if(_0x1394c6[_0x4455('0x10')][_0x4455('0x11')]===0x1f4){logger['error'](_0x4455('0xb'),_0x4103d0,_0x1394c6[_0x4455('0x10')][_0x4455('0x12')]);return _0x197e14(_0x1394c6[_0x4455('0x10')][_0x4455('0x12')]);}logger[_0x4455('0x10')](_0x4455('0xb'),_0x4103d0,_0x1394c6['error'][_0x4455('0x12')]);return _0x2b9323(_0x1394c6[_0x4455('0x10')][_0x4455('0x12')]);}else{logger[_0x4455('0x13')](_0x4455('0xb'),_0x4103d0,_0x4455('0xc'));_0x2b9323(_0x1394c6[_0x4455('0x14')]['message']);}})[_0x4455('0x15')](function(_0x4faaf5){logger[_0x4455('0x10')]('ZendeskField,\x20%s,\x20%s',_0x4103d0,_0x4faaf5);_0x197e14(_0x4faaf5);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index e38ccca..8de0d8f 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 _0x97db=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x97db,0x1de));var _0xb97d=function(_0x44bfec,_0x3589cd){_0x44bfec=_0x44bfec-0x0;var _0x3a96ce=_0x97db[_0x44bfec];return _0x3a96ce;};'use strict';var multer=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var path=require(_0xb97d('0x2'));var timeout=require(_0xb97d('0x3'));var express=require(_0xb97d('0x4'));var router=express[_0xb97d('0x5')]();var fs_extra=require(_0xb97d('0x6'));var auth=require(_0xb97d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb97d('0x8'));var controller=require(_0xb97d('0x9'));router[_0xb97d('0xa')]('/',auth[_0xb97d('0xb')](),controller[_0xb97d('0xc')]);router[_0xb97d('0xa')](_0xb97d('0xd'),auth[_0xb97d('0xb')](),controller[_0xb97d('0xe')]);router[_0xb97d('0xa')](_0xb97d('0xf'),auth[_0xb97d('0xb')](),controller['getConfigurations']);router[_0xb97d('0xa')](_0xb97d('0x10'),auth['isAuthenticated'](),controller[_0xb97d('0x11')]);router[_0xb97d('0x12')]('/',auth[_0xb97d('0xb')](),controller['create']);router[_0xb97d('0x12')](_0xb97d('0xf'),auth[_0xb97d('0xb')](),controller[_0xb97d('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb97d('0x14')]);router[_0xb97d('0x15')](_0xb97d('0xd'),auth['isAuthenticated'](),controller[_0xb97d('0x16')]);module[_0xb97d('0x17')]=router; \ No newline at end of file +var _0xe813=['get','index','/:id/configurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','update','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller'];(function(_0x3033a3,_0x428602){var _0x41a114=function(_0x15302d){while(--_0x15302d){_0x3033a3['push'](_0x3033a3['shift']());}};_0x41a114(++_0x428602);}(_0xe813,0x1d8));var _0x3e81=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0xe813[_0x542d80];return _0x1f4492;};'use strict';var multer=require('multer');var util=require(_0x3e81('0x0'));var path=require(_0x3e81('0x1'));var timeout=require(_0x3e81('0x2'));var express=require(_0x3e81('0x3'));var router=express['Router']();var fs_extra=require(_0x3e81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3e81('0x5'));var config=require(_0x3e81('0x6'));var controller=require(_0x3e81('0x7'));router[_0x3e81('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e81('0x9')]);router[_0x3e81('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3e81('0x8')](_0x3e81('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3e81('0x8')](_0x3e81('0xb'),auth[_0x3e81('0xc')](),controller[_0x3e81('0xd')]);router[_0x3e81('0xe')]('/',auth[_0x3e81('0xc')](),controller['create']);router[_0x3e81('0xe')](_0x3e81('0xa'),auth['isAuthenticated'](),controller[_0x3e81('0xf')]);router['put']('/:id',auth[_0x3e81('0xc')](),controller[_0x3e81('0x10')]);router['delete'](_0x3e81('0x11'),auth['isAuthenticated'](),controller[_0x3e81('0x12')]);module[_0x3e81('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d32d288..6a7eefc 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 _0x70e0=['STRING','sequelize','exports'];(function(_0x1df624,_0xb4b455){var _0x1dcff3=function(_0x3d275d){while(--_0x3d275d){_0x1df624['push'](_0x1df624['shift']());}};_0x1dcff3(++_0xb4b455);}(_0x70e0,0x17b));var _0x070e=function(_0x3634df,_0x41c2f1){_0x3634df=_0x3634df-0x0;var _0x3b2cd3=_0x70e0[_0x3634df];return _0x3b2cd3;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file +var _0x9f62=['exports','STRING'];(function(_0x298e65,_0x34daea){var _0x3361ca=function(_0x42f3da){while(--_0x42f3da){_0x298e65['push'](_0x298e65['shift']());}};_0x3361ca(++_0x34daea);}(_0x9f62,0x154));var _0x29f6=function(_0x41ead1,_0x5e57cb){_0x41ead1=_0x41ead1-0x0;var _0x5f0880=_0x9f62[_0x41ead1];return _0x5f0880;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x29f6('0x1')]},'host':{'type':Sequelize[_0x29f6('0x1')]},'zone':{'type':Sequelize[_0x29f6('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x29f6('0x1')]},'refreshToken':{'type':Sequelize[_0x29f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 1e2971d..e13cca1 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 _0x54eb=['stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','ZohoAccount','include','findAll','includeAll','find','catch','create','body','params','getConfigurations','findOne','ZohoConfiguration','filter','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientId','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','display_label','custom_field','data_type','picklist','pick_list_values','test','stringify','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x203016,_0x76cc10){var _0x435c90=function(_0x41a801){while(--_0x41a801){_0x203016['push'](_0x203016['shift']());}};_0x435c90(++_0x76cc10);}(_0x54eb,0xdd));var _0xb54e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x54eb[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb54e('0x0'));var zipdir=require(_0xb54e('0x1'));var jsonpatch=require(_0xb54e('0x2'));var rp=require(_0xb54e('0x3'));var moment=require(_0xb54e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb54e('0x5'));var util=require(_0xb54e('0x6'));var path=require(_0xb54e('0x7'));var sox=require('sox');var csv=require(_0xb54e('0x8'));var ejs=require(_0xb54e('0x9'));var fs=require('fs');var fs_extra=require(_0xb54e('0xa'));var _=require(_0xb54e('0xb'));var squel=require(_0xb54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xb54e('0xd'));var deskjs=require(_0xb54e('0xe'));var toCsv=require(_0xb54e('0x8'));var querystring=require(_0xb54e('0xf'));var Papa=require(_0xb54e('0x10'));var Redis=require(_0xb54e('0x11'));var authService=require(_0xb54e('0x12'));var qs=require(_0xb54e('0x13'));var as=require(_0xb54e('0x14'));var hardwareService=require(_0xb54e('0x15'));var logger=require(_0xb54e('0x16'))(_0xb54e('0x17'));var utils=require(_0xb54e('0x18'));var config=require(_0xb54e('0x19'));var licenseUtil=require(_0xb54e('0x1a'));var db=require(_0xb54e('0x1b'))['db'];var integrations=require(_0xb54e('0x1c'));function respondWithStatusCode(_0xf8990a,_0x3bd507){_0x3bd507=_0x3bd507||0xcc;return function(_0x42473b){if(_0x42473b){return _0xf8990a[_0xb54e('0x1d')](_0x3bd507);}return _0xf8990a[_0xb54e('0x1e')](_0x3bd507)[_0xb54e('0x1f')]();};}function respondWithResult(_0x18f73f,_0x158c9b){_0x158c9b=_0x158c9b||0xc8;return function(_0xe46381){if(_0xe46381){return _0x18f73f[_0xb54e('0x1e')](_0x158c9b)[_0xb54e('0x20')](_0xe46381);}};}function respondWithFilteredResult(_0x58a316,_0x22b0ec){return function(_0x123abc){if(_0x123abc){var _0x30ba0e=typeof _0x22b0ec[_0xb54e('0x21')]==='undefined'&&typeof _0x22b0ec[_0xb54e('0x22')]===_0xb54e('0x23');var _0x4cedbd=_0x123abc['count'];var _0x4dbf7b=_0x30ba0e?0x0:_0x22b0ec[_0xb54e('0x21')];var _0x4e5244=_0x30ba0e?_0x123abc['count']:_0x22b0ec[_0xb54e('0x21')]+_0x22b0ec[_0xb54e('0x22')];var _0x37a7f7;if(_0x4e5244>=_0x4cedbd){_0x4e5244=_0x4cedbd;_0x37a7f7=0xc8;}else{_0x37a7f7=0xce;}_0x58a316[_0xb54e('0x1e')](_0x37a7f7);return _0x58a316[_0xb54e('0x24')](_0xb54e('0x25'),_0x4dbf7b+'-'+_0x4e5244+'/'+_0x4cedbd)[_0xb54e('0x20')](_0x123abc);}return null;};}function patchUpdates(_0x1e3e5d){return function(_0x272f80){try{jsonpatch[_0xb54e('0x26')](_0x272f80,_0x1e3e5d,!![]);}catch(_0x5852ac){return BPromise[_0xb54e('0x27')](_0x5852ac);}return _0x272f80[_0xb54e('0x28')]();};}function saveUpdates(_0x15a6a5,_0x20de95){return function(_0x1b9f78){if(_0x1b9f78){return _0x1b9f78[_0xb54e('0x29')](_0x15a6a5)[_0xb54e('0x2a')](function(_0xc078e9){return _0xc078e9;});}return null;};}function removeEntity(_0x4edf97,_0x584839){return function(_0x5801a1){if(_0x5801a1){return _0x5801a1[_0xb54e('0x2b')]()[_0xb54e('0x2a')](function(){_0x4edf97[_0xb54e('0x1e')](0xcc)[_0xb54e('0x1f')]();});}};}function handleEntityNotFound(_0x29d0d1,_0x2a1a75){return function(_0x4b290c){if(!_0x4b290c){_0x29d0d1[_0xb54e('0x1d')](0x194);}return _0x4b290c;};}function handleError(_0x3d1a58,_0x592c93){_0x592c93=_0x592c93||0x1f4;return function(_0x35e859){logger[_0xb54e('0x2c')](_0x35e859[_0xb54e('0x2d')]);if(_0x35e859['name']){delete _0x35e859[_0xb54e('0x2e')];}_0x3d1a58[_0xb54e('0x1e')](_0x592c93)['send'](_0x35e859);};}exports[_0xb54e('0x2f')]=function(_0x2e2eee,_0x59cc36){var _0x4167c0={},_0x508312={},_0x18e561={'count':0x0,'rows':[]};var _0x20e4cf=_[_0xb54e('0x30')](db['ZohoAccount'][_0xb54e('0x31')],function(_0x4926be){return{'name':_0x4926be[_0xb54e('0x32')],'type':_0x4926be[_0xb54e('0x33')][_0xb54e('0x34')]};});_0x508312[_0xb54e('0x35')]=_['map'](_0x20e4cf,_0xb54e('0x2e'));_0x508312[_0xb54e('0x36')]=_[_0xb54e('0x37')](_0x2e2eee[_0xb54e('0x36')]);_0x508312[_0xb54e('0x38')]=_['intersection'](_0x508312[_0xb54e('0x35')],_0x508312[_0xb54e('0x36')]);_0x4167c0['attributes']=_[_0xb54e('0x39')](_0x508312[_0xb54e('0x35')],qs[_0xb54e('0x3a')](_0x2e2eee[_0xb54e('0x36')][_0xb54e('0x3a')]));_0x4167c0['attributes']=_0x4167c0[_0xb54e('0x3b')][_0xb54e('0x3c')]?_0x4167c0[_0xb54e('0x3b')]:_0x508312['model'];if(!_0x2e2eee[_0xb54e('0x36')][_0xb54e('0x3d')](_0xb54e('0x3e'))){_0x4167c0['limit']=qs[_0xb54e('0x22')](_0x2e2eee[_0xb54e('0x36')][_0xb54e('0x22')]);_0x4167c0[_0xb54e('0x21')]=qs[_0xb54e('0x21')](_0x2e2eee['query'][_0xb54e('0x21')]);}_0x4167c0[_0xb54e('0x3f')]=qs['sort'](_0x2e2eee[_0xb54e('0x36')][_0xb54e('0x40')]);_0x4167c0[_0xb54e('0x41')]=qs[_0xb54e('0x38')](_[_0xb54e('0x42')](_0x2e2eee[_0xb54e('0x36')],_0x508312[_0xb54e('0x38')]),_0x20e4cf);if(_0x2e2eee[_0xb54e('0x36')]['filter']){_0x4167c0[_0xb54e('0x41')]=_['merge'](_0x4167c0['where'],{'$or':_[_0xb54e('0x30')](_0x20e4cf,function(_0x3905d4){if(_0x3905d4['type']!==_0xb54e('0x43')){var _0x4472bc={};_0x4472bc[_0x3905d4[_0xb54e('0x2e')]]={'$like':'%'+_0x2e2eee[_0xb54e('0x36')]['filter']+'%'};return _0x4472bc;}})});}_0x4167c0=_[_0xb54e('0x44')]({},_0x4167c0,_0x2e2eee[_0xb54e('0x45')]);var _0x4ad249={'where':_0x4167c0[_0xb54e('0x41')]};return db[_0xb54e('0x46')]['count'](_0x4ad249)[_0xb54e('0x2a')](function(_0x2677d6){_0x18e561['count']=_0x2677d6;if(_0x2e2eee['query']['includeAll']){_0x4167c0[_0xb54e('0x47')]=[{'all':!![]}];}return db['ZohoAccount'][_0xb54e('0x48')](_0x4167c0);})[_0xb54e('0x2a')](function(_0xc0ce5c){_0x18e561['rows']=_0xc0ce5c;return _0x18e561;})[_0xb54e('0x2a')](respondWithFilteredResult(_0x59cc36,_0x4167c0))['catch'](handleError(_0x59cc36,null));};exports['show']=function(_0x19f52b,_0x4ee839){var _0x23ccb9={'raw':![],'where':{'id':_0x19f52b['params']['id']}},_0x18d058={};_0x18d058['model']=_['keys'](db[_0xb54e('0x46')][_0xb54e('0x31')]);_0x18d058['query']=_[_0xb54e('0x37')](_0x19f52b['query']);_0x18d058[_0xb54e('0x38')]=_['intersection'](_0x18d058[_0xb54e('0x35')],_0x18d058['query']);_0x23ccb9[_0xb54e('0x3b')]=_[_0xb54e('0x39')](_0x18d058['model'],qs[_0xb54e('0x3a')](_0x19f52b['query'][_0xb54e('0x3a')]));_0x23ccb9['attributes']=_0x23ccb9[_0xb54e('0x3b')][_0xb54e('0x3c')]?_0x23ccb9[_0xb54e('0x3b')]:_0x18d058[_0xb54e('0x35')];if(_0x19f52b[_0xb54e('0x36')][_0xb54e('0x49')]){_0x23ccb9['include']=[{'all':!![]}];}_0x23ccb9=_[_0xb54e('0x44')]({},_0x23ccb9,_0x19f52b['options']);return db[_0xb54e('0x46')][_0xb54e('0x4a')](_0x23ccb9)[_0xb54e('0x2a')](handleEntityNotFound(_0x4ee839,null))[_0xb54e('0x2a')](respondWithResult(_0x4ee839,null))[_0xb54e('0x4b')](handleError(_0x4ee839,null));};exports['create']=function(_0x4ffe6e,_0x745a01){return db[_0xb54e('0x46')][_0xb54e('0x4c')](_0x4ffe6e[_0xb54e('0x4d')],{})[_0xb54e('0x2a')](respondWithResult(_0x745a01,0xc9))[_0xb54e('0x4b')](handleError(_0x745a01,null));};exports[_0xb54e('0x29')]=function(_0xb28837,_0x24e105){if(_0xb28837[_0xb54e('0x4d')]['id']){delete _0xb28837[_0xb54e('0x4d')]['id'];}return db['ZohoAccount'][_0xb54e('0x4a')]({'where':{'id':_0xb28837[_0xb54e('0x4e')]['id']}})[_0xb54e('0x2a')](handleEntityNotFound(_0x24e105,null))[_0xb54e('0x2a')](saveUpdates(_0xb28837['body'],null))[_0xb54e('0x2a')](respondWithResult(_0x24e105,null))[_0xb54e('0x4b')](handleError(_0x24e105,null));};exports[_0xb54e('0x2b')]=function(_0x23b070,_0x474da5){return db[_0xb54e('0x46')][_0xb54e('0x4a')]({'where':{'id':_0x23b070[_0xb54e('0x4e')]['id']}})[_0xb54e('0x2a')](handleEntityNotFound(_0x474da5,null))[_0xb54e('0x2a')](removeEntity(_0x474da5,null))[_0xb54e('0x4b')](handleError(_0x474da5,null));};exports[_0xb54e('0x4f')]=function(_0x4dae0b,_0x2fac28,_0x19bbce){var _0x9c178={};var _0x649ed9={};var _0x8f778e;var _0x35403e;return db['ZohoAccount'][_0xb54e('0x50')]({'where':{'id':_0x4dae0b[_0xb54e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fac28,null))['then'](function(_0x5bfe62){if(_0x5bfe62){_0x8f778e=_0x5bfe62;_0x649ed9[_0xb54e('0x35')]=_['keys'](db[_0xb54e('0x51')][_0xb54e('0x31')]);_0x649ed9[_0xb54e('0x36')]=_[_0xb54e('0x37')](_0x4dae0b[_0xb54e('0x36')]);_0x649ed9[_0xb54e('0x38')]=_[_0xb54e('0x39')](_0x649ed9[_0xb54e('0x35')],_0x649ed9[_0xb54e('0x36')]);_0x9c178[_0xb54e('0x3b')]=_[_0xb54e('0x39')](_0x649ed9['model'],qs[_0xb54e('0x3a')](_0x4dae0b['query'][_0xb54e('0x3a')]));_0x9c178[_0xb54e('0x3b')]=_0x9c178[_0xb54e('0x3b')][_0xb54e('0x3c')]?_0x9c178[_0xb54e('0x3b')]:_0x649ed9['model'];_0x9c178[_0xb54e('0x3f')]=qs['sort'](_0x4dae0b[_0xb54e('0x36')][_0xb54e('0x40')]);_0x9c178[_0xb54e('0x41')]=qs[_0xb54e('0x38')](_['pick'](_0x4dae0b[_0xb54e('0x36')],_0x649ed9['filters']));if(_0x4dae0b[_0xb54e('0x36')][_0xb54e('0x52')]){_0x9c178[_0xb54e('0x41')]=_[_0xb54e('0x44')](_0x9c178[_0xb54e('0x41')],{'$or':_['map'](_0x9c178[_0xb54e('0x3b')],function(_0x5574fd){var _0x36dec6={};_0x36dec6[_0x5574fd]={'$like':'%'+_0x4dae0b[_0xb54e('0x36')]['filter']+'%'};return _0x36dec6;})});}_0x9c178=_[_0xb54e('0x44')]({},_0x9c178,_0x4dae0b['options']);return _0x8f778e['getConfigurations'](_0x9c178);}})[_0xb54e('0x2a')](function(_0x21dd44){if(_0x21dd44){_0x35403e=_0x21dd44[_0xb54e('0x3c')];if(!_0x4dae0b[_0xb54e('0x36')][_0xb54e('0x3d')](_0xb54e('0x3e'))){_0x9c178[_0xb54e('0x22')]=qs['limit'](_0x4dae0b[_0xb54e('0x36')][_0xb54e('0x22')]);_0x9c178['offset']=qs[_0xb54e('0x21')](_0x4dae0b[_0xb54e('0x36')][_0xb54e('0x21')]);}return _0x8f778e['getConfigurations'](_0x9c178);}})[_0xb54e('0x2a')](function(_0x33132){if(_0x33132){return _0x33132?{'count':_0x35403e,'rows':_0x33132}:null;}})[_0xb54e('0x2a')](respondWithResult(_0x2fac28,null))[_0xb54e('0x4b')](handleError(_0x2fac28,null));};exports['addConfiguration']=function(_0x2787d1,_0x37b905,_0x27a73b){if(_0x2787d1['body']['id']){delete _0x2787d1[_0xb54e('0x4d')]['id'];}return db[_0xb54e('0x46')][_0xb54e('0x50')]({'where':{'id':_0x2787d1['params']['id']}})[_0xb54e('0x2a')](handleEntityNotFound(_0x37b905,null))[_0xb54e('0x2a')](function(_0x132c98){if(_0x132c98){_0x2787d1['body'][_0xb54e('0x53')]=_0x132c98['id'];_0x2787d1['body'][_0xb54e('0x54')]=integrations[_0xb54e('0x55')](_0x2787d1[_0xb54e('0x4d')][_0xb54e('0x56')],_0x2787d1[_0xb54e('0x4d')][_0xb54e('0x33')]);_0x2787d1[_0xb54e('0x4d')][_0xb54e('0x57')]=integrations['getDescriptions'](_0x2787d1[_0xb54e('0x4d')]['channel'],_0x2787d1[_0xb54e('0x4d')][_0xb54e('0x33')]);return db['ZohoConfiguration'][_0xb54e('0x4c')](_0x2787d1[_0xb54e('0x4d')],{'include':[{'model':db[_0xb54e('0x58')],'as':_0xb54e('0x54')},{'model':db['ZohoField'],'as':_0xb54e('0x57')}]});}return null;})[_0xb54e('0x2a')](respondWithResult(_0x37b905,null))[_0xb54e('0x4b')](handleError(_0x37b905,null));};function getAccessToken(_0x58ae25){return new Promise(function(_0x5d530b,_0xf6d114){var _0x2c87d7;switch(_0x58ae25['zone']){case'US':_0x2c87d7=_0xb54e('0x59');break;case'AU':_0x2c87d7=_0xb54e('0x5a');break;case'EU':_0x2c87d7=_0xb54e('0x5b');break;case'IN':_0x2c87d7=_0xb54e('0x5c');break;case'CN':_0x2c87d7='https://accounts.zoho.com.cn';break;default:_0x2c87d7='https://accounts.zoho.eu';break;}var _0x4812c4={'method':'POST','uri':_0x2c87d7+_0xb54e('0x5d'),'qs':{'refresh_token':_0x58ae25[_0xb54e('0x5e')],'client_id':_0x58ae25['clientId'],'client_secret':_0x58ae25[_0xb54e('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4812c4)[_0xb54e('0x2a')](function(_0x995e2){if(_0x995e2[_0xb54e('0x60')]){_0x5d530b(_0x995e2[_0xb54e('0x60')]);}else{_0xf6d114(_0xb54e('0x61'));}})[_0xb54e('0x4b')](function(_0x31cda0){_0xf6d114(_0x31cda0);});});}exports[_0xb54e('0x62')]=function(_0x5b4792,_0x1791fb,_0x103d53){var _0x3397cf,_0x1e6eb1,_0xd54da7,_0x9db919,_0x4137dc;return db[_0xb54e('0x46')][_0xb54e('0x50')]({'where':{'id':_0x5b4792[_0xb54e('0x4e')]['id']},'attributes':['id',_0xb54e('0x63'),_0xb54e('0x64'),_0xb54e('0x65'),_0xb54e('0x5f'),_0xb54e('0x66'),_0xb54e('0x67'),_0xb54e('0x5e')]})[_0xb54e('0x2a')](handleEntityNotFound(_0x1791fb,null))[_0xb54e('0x2a')](function(_0x41e611){_0x4137dc=_0x41e611;_0x3397cf=_0x4137dc[_0xb54e('0x63')];_0x1e6eb1=_0x3397cf===_0xb54e('0x68')?'eu':_0xb54e('0x69');_0xd54da7=_0x4137dc[_0xb54e('0x66')];var _0x25451e=_0xd54da7['slice'](-0x1);if(_0x25451e==='/'||_0x25451e==='\x5c'||_0x25451e===':'){_0xd54da7=_0xd54da7[_0xb54e('0x6a')](0x0,_0xd54da7[_0xb54e('0x6b')](_0x25451e));}if(!_0x4137dc[_0xb54e('0x5e')]){throw new Error(_0xb54e('0x6c'));}return getAccessToken(_0x4137dc);})[_0xb54e('0x2a')](function(_0x4974ed){if(_0x4974ed){return rp({'method':_0xb54e('0x6d'),'uri':util[_0xb54e('0x6e')](_0xb54e('0x6f'),_0x1e6eb1),'qs':{'module':_0xb54e('0x70')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4974ed},'json':!![]});}})[_0xb54e('0x2a')](function(_0x3fa0c2){if(_0x3fa0c2){if(_0x3fa0c2[_0xb54e('0x71')]&&_0x3fa0c2[_0xb54e('0x71')][_0xb54e('0x2c')]){throw new Error(_0x3fa0c2[_0xb54e('0x71')][_0xb54e('0x2c')][_0xb54e('0x72')]);}var _0x3d60d3=[];var _0x12f586=[];var _0x45d56c=['Owner',_0xb54e('0x73'),'Description',_0xb54e('0x74'),_0xb54e('0x75'),_0xb54e('0x76'),'Call_Start_Time',_0xb54e('0x77')];_0x12f586=_[_0xb54e('0x78')](_0x3fa0c2[_0xb54e('0x3a')],function(_0x1645c3){return _0x45d56c[_0xb54e('0x79')](_0x1645c3[_0xb54e('0x7a')]);});for(var _0x21f9d1=0x0;_0x21f9d1<_0x12f586[_0xb54e('0x3c')];_0x21f9d1++){if(_0x12f586[_0x21f9d1]['system_mandatory']===![]){_0x3d60d3['push']({'id':_0x12f586[_0x21f9d1]['id'],'name':_0x12f586[_0x21f9d1][_0xb54e('0x7b')],'custom':_0x12f586[_0x21f9d1][_0xb54e('0x7c')],'options':_0x12f586[_0x21f9d1][_0xb54e('0x7d')]===_0xb54e('0x7e')&&_0x12f586[_0x21f9d1][_0xb54e('0x7f')]['length']>-0x1?_[_0xb54e('0x30')](_0x12f586[_0x21f9d1][_0xb54e('0x7f')],function(_0x23ff3a){return{'name':_0x23ff3a,'value':_0x23ff3a};}):[]});}}return{'count':_0x3d60d3[_0xb54e('0x3c')],'rows':_0x3d60d3};}else{return{'count':0x0,'rows':[]};}})[_0xb54e('0x2a')](respondWithResult(_0x1791fb,null))[_0xb54e('0x4b')](function(_0x55b875){var _0x23cd1a=_0x5b4792[_0xb54e('0x36')][_0xb54e('0x80')]?0x1f4:_0x55b875['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb54e('0x62'),_0x23cd1a,JSON[_0xb54e('0x81')](_0x55b875));delete _0x55b875[_0xb54e('0x2e')];if(_0x23cd1a===0x191){_0x23cd1a=0x190;}_0x1791fb['status'](_0x23cd1a)[_0xb54e('0x82')](_0x5b4792[_0xb54e('0x36')][_0xb54e('0x80')]?{'message':_0xb54e('0x83'),'statusCode':_0x55b875[_0xb54e('0x84')]}:_0x55b875);});}; \ No newline at end of file +var _0xe58b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','ZohoAccount','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','includeAll','find','create','catch','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zoho.eu','com','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Subject','Call_Duration','Call_Result','Call_Type','includes','api_name','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe58b,0x158));var _0xbe58=function(_0x16652e,_0x28a210){_0x16652e=_0x16652e-0x0;var _0x31d01e=_0xe58b[_0x16652e];return _0x31d01e;};'use strict';var emlformat=require(_0xbe58('0x0'));var rimraf=require(_0xbe58('0x1'));var zipdir=require(_0xbe58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe58('0x3'));var BPromise=require(_0xbe58('0x4'));var Mustache=require(_0xbe58('0x5'));var util=require(_0xbe58('0x6'));var path=require(_0xbe58('0x7'));var sox=require(_0xbe58('0x8'));var csv=require(_0xbe58('0x9'));var ejs=require(_0xbe58('0xa'));var fs=require('fs');var fs_extra=require(_0xbe58('0xb'));var _=require(_0xbe58('0xc'));var squel=require(_0xbe58('0xd'));var crypto=require('crypto');var jsforce=require(_0xbe58('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbe58('0x9'));var querystring=require('querystring');var Papa=require(_0xbe58('0xf'));var Redis=require('ioredis');var authService=require(_0xbe58('0x10'));var qs=require(_0xbe58('0x11'));var as=require(_0xbe58('0x12'));var hardwareService=require(_0xbe58('0x13'));var logger=require('../../config/logger')(_0xbe58('0x14'));var utils=require(_0xbe58('0x15'));var config=require(_0xbe58('0x16'));var licenseUtil=require(_0xbe58('0x17'));var db=require(_0xbe58('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5c490c,_0x2812fc){_0x2812fc=_0x2812fc||0xcc;return function(_0x3a02bd){if(_0x3a02bd){return _0x5c490c[_0xbe58('0x19')](_0x2812fc);}return _0x5c490c['status'](_0x2812fc)[_0xbe58('0x1a')]();};}function respondWithResult(_0x2110d0,_0x239591){_0x239591=_0x239591||0xc8;return function(_0x3bba59){if(_0x3bba59){return _0x2110d0['status'](_0x239591)['json'](_0x3bba59);}};}function respondWithFilteredResult(_0x4fabd5,_0x2c2db4){return function(_0x36f0f0){if(_0x36f0f0){var _0x3f6fd9=typeof _0x2c2db4[_0xbe58('0x1b')]==='undefined'&&typeof _0x2c2db4[_0xbe58('0x1c')]==='undefined';var _0x10b1e0=_0x36f0f0[_0xbe58('0x1d')];var _0x37e3de=_0x3f6fd9?0x0:_0x2c2db4[_0xbe58('0x1b')];var _0x41fb8b=_0x3f6fd9?_0x36f0f0[_0xbe58('0x1d')]:_0x2c2db4[_0xbe58('0x1b')]+_0x2c2db4['limit'];var _0x5c1011;if(_0x41fb8b>=_0x10b1e0){_0x41fb8b=_0x10b1e0;_0x5c1011=0xc8;}else{_0x5c1011=0xce;}_0x4fabd5[_0xbe58('0x1e')](_0x5c1011);return _0x4fabd5[_0xbe58('0x1f')](_0xbe58('0x20'),_0x37e3de+'-'+_0x41fb8b+'/'+_0x10b1e0)['json'](_0x36f0f0);}return null;};}function patchUpdates(_0x41a375){return function(_0x892a46){try{jsonpatch[_0xbe58('0x21')](_0x892a46,_0x41a375,!![]);}catch(_0x12e423){return BPromise[_0xbe58('0x22')](_0x12e423);}return _0x892a46[_0xbe58('0x23')]();};}function saveUpdates(_0x3fca93,_0x486e26){return function(_0x458019){if(_0x458019){return _0x458019[_0xbe58('0x24')](_0x3fca93)[_0xbe58('0x25')](function(_0x293b2d){return _0x293b2d;});}return null;};}function removeEntity(_0x7898db,_0x4769b5){return function(_0x5388dd){if(_0x5388dd){return _0x5388dd[_0xbe58('0x26')]()['then'](function(){_0x7898db[_0xbe58('0x1e')](0xcc)[_0xbe58('0x1a')]();});}};}function handleEntityNotFound(_0x958c64,_0x3972d6){return function(_0x18d974){if(!_0x18d974){_0x958c64[_0xbe58('0x19')](0x194);}return _0x18d974;};}function handleError(_0x1621b5,_0x5ef12b){_0x5ef12b=_0x5ef12b||0x1f4;return function(_0x55cbe9){logger['error'](_0x55cbe9[_0xbe58('0x27')]);if(_0x55cbe9[_0xbe58('0x28')]){delete _0x55cbe9[_0xbe58('0x28')];}_0x1621b5[_0xbe58('0x1e')](_0x5ef12b)['send'](_0x55cbe9);};}exports['index']=function(_0x4b28c1,_0x4220fa){var _0x2c0f8a={},_0x49cf42={},_0x19dc52={'count':0x0,'rows':[]};var _0x1432d8=_[_0xbe58('0x29')](db[_0xbe58('0x2a')][_0xbe58('0x2b')],function(_0x4e694e){return{'name':_0x4e694e['fieldName'],'type':_0x4e694e['type'][_0xbe58('0x2c')]};});_0x49cf42[_0xbe58('0x2d')]=_[_0xbe58('0x29')](_0x1432d8,_0xbe58('0x28'));_0x49cf42['query']=_[_0xbe58('0x2e')](_0x4b28c1[_0xbe58('0x2f')]);_0x49cf42[_0xbe58('0x30')]=_[_0xbe58('0x31')](_0x49cf42[_0xbe58('0x2d')],_0x49cf42['query']);_0x2c0f8a[_0xbe58('0x32')]=_[_0xbe58('0x31')](_0x49cf42[_0xbe58('0x2d')],qs[_0xbe58('0x33')](_0x4b28c1['query'][_0xbe58('0x33')]));_0x2c0f8a[_0xbe58('0x32')]=_0x2c0f8a['attributes'][_0xbe58('0x34')]?_0x2c0f8a['attributes']:_0x49cf42[_0xbe58('0x2d')];if(!_0x4b28c1[_0xbe58('0x2f')][_0xbe58('0x35')](_0xbe58('0x36'))){_0x2c0f8a[_0xbe58('0x1c')]=qs[_0xbe58('0x1c')](_0x4b28c1[_0xbe58('0x2f')][_0xbe58('0x1c')]);_0x2c0f8a['offset']=qs[_0xbe58('0x1b')](_0x4b28c1[_0xbe58('0x2f')]['offset']);}_0x2c0f8a[_0xbe58('0x37')]=qs[_0xbe58('0x38')](_0x4b28c1['query']['sort']);_0x2c0f8a[_0xbe58('0x39')]=qs[_0xbe58('0x30')](_[_0xbe58('0x3a')](_0x4b28c1[_0xbe58('0x2f')],_0x49cf42[_0xbe58('0x30')]),_0x1432d8);if(_0x4b28c1[_0xbe58('0x2f')][_0xbe58('0x3b')]){_0x2c0f8a[_0xbe58('0x39')]=_[_0xbe58('0x3c')](_0x2c0f8a['where'],{'$or':_['map'](_0x1432d8,function(_0x57f93b){if(_0x57f93b[_0xbe58('0x3d')]!==_0xbe58('0x3e')){var _0x4092cb={};_0x4092cb[_0x57f93b[_0xbe58('0x28')]]={'$like':'%'+_0x4b28c1['query'][_0xbe58('0x3b')]+'%'};return _0x4092cb;}})});}_0x2c0f8a=_['merge']({},_0x2c0f8a,_0x4b28c1[_0xbe58('0x3f')]);var _0x27934c={'where':_0x2c0f8a[_0xbe58('0x39')]};return db[_0xbe58('0x2a')][_0xbe58('0x1d')](_0x27934c)['then'](function(_0x416dd9){_0x19dc52[_0xbe58('0x1d')]=_0x416dd9;if(_0x4b28c1[_0xbe58('0x2f')]['includeAll']){_0x2c0f8a[_0xbe58('0x40')]=[{'all':!![]}];}return db[_0xbe58('0x2a')][_0xbe58('0x41')](_0x2c0f8a);})[_0xbe58('0x25')](function(_0x23cdda){_0x19dc52['rows']=_0x23cdda;return _0x19dc52;})[_0xbe58('0x25')](respondWithFilteredResult(_0x4220fa,_0x2c0f8a))['catch'](handleError(_0x4220fa,null));};exports[_0xbe58('0x42')]=function(_0x3f4eeb,_0x4151d4){var _0x5202e4={'raw':![],'where':{'id':_0x3f4eeb[_0xbe58('0x43')]['id']}},_0x5e7825={};_0x5e7825['model']=_['keys'](db[_0xbe58('0x2a')][_0xbe58('0x2b')]);_0x5e7825['query']=_[_0xbe58('0x2e')](_0x3f4eeb[_0xbe58('0x2f')]);_0x5e7825['filters']=_[_0xbe58('0x31')](_0x5e7825[_0xbe58('0x2d')],_0x5e7825[_0xbe58('0x2f')]);_0x5202e4[_0xbe58('0x32')]=_[_0xbe58('0x31')](_0x5e7825[_0xbe58('0x2d')],qs[_0xbe58('0x33')](_0x3f4eeb[_0xbe58('0x2f')][_0xbe58('0x33')]));_0x5202e4[_0xbe58('0x32')]=_0x5202e4[_0xbe58('0x32')]['length']?_0x5202e4['attributes']:_0x5e7825[_0xbe58('0x2d')];if(_0x3f4eeb[_0xbe58('0x2f')][_0xbe58('0x44')]){_0x5202e4[_0xbe58('0x40')]=[{'all':!![]}];}_0x5202e4=_[_0xbe58('0x3c')]({},_0x5202e4,_0x3f4eeb[_0xbe58('0x3f')]);return db[_0xbe58('0x2a')][_0xbe58('0x45')](_0x5202e4)[_0xbe58('0x25')](handleEntityNotFound(_0x4151d4,null))[_0xbe58('0x25')](respondWithResult(_0x4151d4,null))['catch'](handleError(_0x4151d4,null));};exports[_0xbe58('0x46')]=function(_0x1a1530,_0x571665){return db[_0xbe58('0x2a')][_0xbe58('0x46')](_0x1a1530['body'],{})[_0xbe58('0x25')](respondWithResult(_0x571665,0xc9))[_0xbe58('0x47')](handleError(_0x571665,null));};exports[_0xbe58('0x24')]=function(_0x1f5bbb,_0x2f271d){if(_0x1f5bbb['body']['id']){delete _0x1f5bbb[_0xbe58('0x48')]['id'];}return db[_0xbe58('0x2a')][_0xbe58('0x45')]({'where':{'id':_0x1f5bbb['params']['id']}})[_0xbe58('0x25')](handleEntityNotFound(_0x2f271d,null))['then'](saveUpdates(_0x1f5bbb[_0xbe58('0x48')],null))[_0xbe58('0x25')](respondWithResult(_0x2f271d,null))[_0xbe58('0x47')](handleError(_0x2f271d,null));};exports['destroy']=function(_0xf62bb1,_0x10cfc1){return db[_0xbe58('0x2a')][_0xbe58('0x45')]({'where':{'id':_0xf62bb1[_0xbe58('0x43')]['id']}})['then'](handleEntityNotFound(_0x10cfc1,null))['then'](removeEntity(_0x10cfc1,null))[_0xbe58('0x47')](handleError(_0x10cfc1,null));};exports[_0xbe58('0x49')]=function(_0x175c62,_0x4036ab,_0x159023){var _0x505c17={};var _0x38b104={};var _0x1242f4;var _0x3bd789;return db[_0xbe58('0x2a')][_0xbe58('0x4a')]({'where':{'id':_0x175c62[_0xbe58('0x43')]['id']}})[_0xbe58('0x25')](handleEntityNotFound(_0x4036ab,null))[_0xbe58('0x25')](function(_0x117a12){if(_0x117a12){_0x1242f4=_0x117a12;_0x38b104['model']=_[_0xbe58('0x2e')](db['ZohoConfiguration'][_0xbe58('0x2b')]);_0x38b104['query']=_['keys'](_0x175c62[_0xbe58('0x2f')]);_0x38b104[_0xbe58('0x30')]=_[_0xbe58('0x31')](_0x38b104[_0xbe58('0x2d')],_0x38b104['query']);_0x505c17[_0xbe58('0x32')]=_['intersection'](_0x38b104[_0xbe58('0x2d')],qs[_0xbe58('0x33')](_0x175c62['query'][_0xbe58('0x33')]));_0x505c17['attributes']=_0x505c17[_0xbe58('0x32')][_0xbe58('0x34')]?_0x505c17[_0xbe58('0x32')]:_0x38b104[_0xbe58('0x2d')];_0x505c17[_0xbe58('0x37')]=qs[_0xbe58('0x38')](_0x175c62[_0xbe58('0x2f')][_0xbe58('0x38')]);_0x505c17['where']=qs[_0xbe58('0x30')](_[_0xbe58('0x3a')](_0x175c62[_0xbe58('0x2f')],_0x38b104[_0xbe58('0x30')]));if(_0x175c62[_0xbe58('0x2f')][_0xbe58('0x3b')]){_0x505c17['where']=_[_0xbe58('0x3c')](_0x505c17['where'],{'$or':_['map'](_0x505c17[_0xbe58('0x32')],function(_0x4cdd6e){var _0x5b26bd={};_0x5b26bd[_0x4cdd6e]={'$like':'%'+_0x175c62[_0xbe58('0x2f')][_0xbe58('0x3b')]+'%'};return _0x5b26bd;})});}_0x505c17=_[_0xbe58('0x3c')]({},_0x505c17,_0x175c62['options']);return _0x1242f4['getConfigurations'](_0x505c17);}})[_0xbe58('0x25')](function(_0x399c9b){if(_0x399c9b){_0x3bd789=_0x399c9b[_0xbe58('0x34')];if(!_0x175c62[_0xbe58('0x2f')][_0xbe58('0x35')](_0xbe58('0x36'))){_0x505c17[_0xbe58('0x1c')]=qs[_0xbe58('0x1c')](_0x175c62['query']['limit']);_0x505c17['offset']=qs[_0xbe58('0x1b')](_0x175c62[_0xbe58('0x2f')][_0xbe58('0x1b')]);}return _0x1242f4[_0xbe58('0x49')](_0x505c17);}})[_0xbe58('0x25')](function(_0x3ad344){if(_0x3ad344){return _0x3ad344?{'count':_0x3bd789,'rows':_0x3ad344}:null;}})[_0xbe58('0x25')](respondWithResult(_0x4036ab,null))[_0xbe58('0x47')](handleError(_0x4036ab,null));};exports[_0xbe58('0x4b')]=function(_0x1672cf,_0x44f18b,_0x53eae1){if(_0x1672cf[_0xbe58('0x48')]['id']){delete _0x1672cf[_0xbe58('0x48')]['id'];}return db['ZohoAccount'][_0xbe58('0x4a')]({'where':{'id':_0x1672cf[_0xbe58('0x43')]['id']}})[_0xbe58('0x25')](handleEntityNotFound(_0x44f18b,null))['then'](function(_0x3984d1){if(_0x3984d1){_0x1672cf[_0xbe58('0x48')][_0xbe58('0x4c')]=_0x3984d1['id'];_0x1672cf['body'][_0xbe58('0x4d')]=integrations[_0xbe58('0x4e')](_0x1672cf['body']['channel'],_0x1672cf[_0xbe58('0x48')][_0xbe58('0x3d')]);_0x1672cf['body'][_0xbe58('0x4f')]=integrations[_0xbe58('0x50')](_0x1672cf[_0xbe58('0x48')]['channel'],_0x1672cf['body'][_0xbe58('0x3d')]);return db['ZohoConfiguration'][_0xbe58('0x46')](_0x1672cf[_0xbe58('0x48')],{'include':[{'model':db[_0xbe58('0x51')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xbe58('0x4f')}]});}return null;})[_0xbe58('0x25')](respondWithResult(_0x44f18b,null))[_0xbe58('0x47')](handleError(_0x44f18b,null));};function getAccessToken(_0x3ebbe8){return new Promise(function(_0xded82,_0x1a8895){var _0x2ca49d;switch(_0x3ebbe8[_0xbe58('0x52')]){case'US':_0x2ca49d='https://accounts.zoho.com';break;case'AU':_0x2ca49d=_0xbe58('0x53');break;case'EU':_0x2ca49d=_0xbe58('0x54');break;case'IN':_0x2ca49d=_0xbe58('0x55');break;case'CN':_0x2ca49d='https://accounts.zoho.com.cn';break;default:_0x2ca49d=_0xbe58('0x54');break;}var _0x2b25a2={'method':_0xbe58('0x56'),'uri':_0x2ca49d+_0xbe58('0x57'),'qs':{'refresh_token':_0x3ebbe8[_0xbe58('0x58')],'client_id':_0x3ebbe8[_0xbe58('0x59')],'client_secret':_0x3ebbe8[_0xbe58('0x5a')],'grant_type':_0xbe58('0x5b')},'json':!![]};return rp(_0x2b25a2)[_0xbe58('0x25')](function(_0x55be06){if(_0x55be06['access_token']){_0xded82(_0x55be06[_0xbe58('0x5c')]);}else{_0x1a8895(_0xbe58('0x5d'));}})[_0xbe58('0x47')](function(_0x269ab2){_0x1a8895(_0x269ab2);});});}exports[_0xbe58('0x5e')]=function(_0x2d3447,_0x414db2,_0xe50a4e){var _0x23896e,_0x11ef11,_0x1e1223,_0x4e1b8,_0x3588b1;return db[_0xbe58('0x2a')][_0xbe58('0x4a')]({'where':{'id':_0x2d3447[_0xbe58('0x43')]['id']},'attributes':['id','host',_0xbe58('0x52'),_0xbe58('0x59'),'clientSecret','serverUrl','code','refreshToken']})[_0xbe58('0x25')](handleEntityNotFound(_0x414db2,null))[_0xbe58('0x25')](function(_0x5e6f2a){_0x3588b1=_0x5e6f2a;_0x23896e=_0x3588b1['host'];_0x11ef11=_0x23896e===_0xbe58('0x5f')?'eu':_0xbe58('0x60');_0x1e1223=_0x3588b1[_0xbe58('0x61')];var _0x16d01e=_0x1e1223[_0xbe58('0x62')](-0x1);if(_0x16d01e==='/'||_0x16d01e==='\x5c'||_0x16d01e===':'){_0x1e1223=_0x1e1223['substring'](0x0,_0x1e1223[_0xbe58('0x63')](_0x16d01e));}if(!_0x3588b1['refreshToken']){throw new Error(_0xbe58('0x64'));}return getAccessToken(_0x3588b1);})[_0xbe58('0x25')](function(_0x488900){if(_0x488900){return rp({'method':_0xbe58('0x65'),'uri':util['format'](_0xbe58('0x66'),_0x11ef11),'qs':{'module':_0xbe58('0x67')},'headers':{'Authorization':_0xbe58('0x68')+_0x488900},'json':!![]});}})['then'](function(_0x4acadd){if(_0x4acadd){if(_0x4acadd['response']&&_0x4acadd[_0xbe58('0x69')][_0xbe58('0x6a')]){throw new Error(_0x4acadd['response']['error'][_0xbe58('0x6b')]);}var _0x52d283=[];var _0x34affe=[];var _0x30b11c=['Owner',_0xbe58('0x6c'),'Description','WhoId',_0xbe58('0x6d'),_0xbe58('0x6e'),'Call_Start_Time',_0xbe58('0x6f')];_0x34affe=_['remove'](_0x4acadd[_0xbe58('0x33')],function(_0x559446){return _0x30b11c[_0xbe58('0x70')](_0x559446[_0xbe58('0x71')]);});for(var _0x232bba=0x0;_0x232bba<_0x34affe['length'];_0x232bba++){if(_0x34affe[_0x232bba]['system_mandatory']===![]){_0x52d283[_0xbe58('0x72')]({'id':_0x34affe[_0x232bba]['id'],'name':_0x34affe[_0x232bba][_0xbe58('0x73')],'custom':_0x34affe[_0x232bba]['custom_field'],'options':_0x34affe[_0x232bba][_0xbe58('0x74')]==='picklist'&&_0x34affe[_0x232bba][_0xbe58('0x75')][_0xbe58('0x34')]>-0x1?_[_0xbe58('0x29')](_0x34affe[_0x232bba][_0xbe58('0x75')],function(_0x3a7c92){return{'name':_0x3a7c92,'value':_0x3a7c92};}):[]});}}return{'count':_0x52d283[_0xbe58('0x34')],'rows':_0x52d283};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x414db2,null))[_0xbe58('0x47')](function(_0x59a397){var _0x2f97ee=_0x2d3447[_0xbe58('0x2f')][_0xbe58('0x76')]?0x1f4:_0x59a397[_0xbe58('0x77')]||0x1f4;logger['error'](_0xbe58('0x78'),_0xbe58('0x5e'),_0x2f97ee,JSON[_0xbe58('0x79')](_0x59a397));delete _0x59a397['name'];if(_0x2f97ee===0x191){_0x2f97ee=0x190;}_0x414db2[_0xbe58('0x1e')](_0x2f97ee)['send'](_0x2d3447[_0xbe58('0x2f')][_0xbe58('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x59a397[_0xbe58('0x77')]}:_0x59a397);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c268aea..00098af 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 _0xa944=['moment','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','name','inspect','catch','slice','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa944,0xe7));var _0x4a94=function(_0x4a1c26,_0x336b40){_0x4a1c26=_0x4a1c26-0x0;var _0x2c52d1=_0xa944[_0x4a1c26];return _0x2c52d1;};'use strict';var _=require('lodash');var util=require(_0x4a94('0x0'));var logger=require(_0x4a94('0x1'))(_0x4a94('0x2'));var moment=require(_0x4a94('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a94('0x4'));var rimraf=require(_0x4a94('0x5'));var config=require(_0x4a94('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x4a94('0x7'));module['exports']=function(_0x1330d9,_0x5d3a39){return _0x1330d9[_0x4a94('0x8')](_0x4a94('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x246239,_0x36abd6,_0x227b25){if(_0x246239[_0x4a94('0xa')](_0x4a94('0xb'))||_0x246239[_0x4a94('0xa')](_0x4a94('0xc'))||_0x246239[_0x4a94('0xa')](_0x4a94('0xd'))||_0x246239[_0x4a94('0xa')](_0x4a94('0xe'))||_0x246239[_0x4a94('0xa')](_0x4a94('0xf'))||_0x246239[_0x4a94('0xa')](_0x4a94('0x10'))){var _0x251289,_0x43103a;_0x251289=_0x246239[_0x4a94('0xc')];var _0x3bff6c=_0x251289['slice'](-0x1);if(_0x3bff6c==='/'||_0x3bff6c==='\x5c'||_0x3bff6c===':'){_0x251289=_0x251289['substring'](0x0,_0x251289[_0x4a94('0x11')](_0x3bff6c));}switch(_0x246239['zone']){case'US':_0x43103a=_0x4a94('0x12');break;case'AU':_0x43103a=_0x4a94('0x13');break;case'IN':_0x43103a=_0x4a94('0x14');break;case'CN':_0x43103a=_0x4a94('0x15');break;default:_0x43103a=_0x4a94('0x16');break;}var _0x5857b5={'method':_0x4a94('0x17'),'uri':_0x43103a+_0x4a94('0x18'),'form':{'grant_type':_0x4a94('0x19'),'client_id':_0x246239[_0x4a94('0xd')],'client_secret':_0x246239[_0x4a94('0xe')],'redirect_uri':_0x246239[_0x4a94('0xc')],'code':_0x246239[_0x4a94('0xf')]},'headers':{'Content-Type':_0x4a94('0x1a')}};return rp(_0x5857b5)[_0x4a94('0x1b')](function(_0x356905){var _0x73a475=JSON['parse'](_0x356905);if(_0x73a475['refresh_token']){_0x246239[_0x4a94('0x1c')]=_0x73a475[_0x4a94('0x1d')];logger[_0x4a94('0x1e')](util[_0x4a94('0x1f')](_0x4a94('0x20'),_0x246239['name'],_0x246239['id']));}else{logger[_0x4a94('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x246239[_0x4a94('0x22')],_0x246239['id']),util[_0x4a94('0x23')](_0x73a475,{'showHidden':![],'depth':null}));}return _0x227b25(null,_0x36abd6);})[_0x4a94('0x24')](function(_0x1e888f){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x246239['name'],_0x246239['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x227b25(_0x1e888f);});}else{return _0x227b25(null,_0x36abd6);}},'beforeUpdate':function(_0x42c517,_0x5165e8,_0x5be97f){if(_0x42c517[_0x4a94('0xa')](_0x4a94('0xb'))||_0x42c517[_0x4a94('0xa')](_0x4a94('0xc'))||_0x42c517[_0x4a94('0xa')]('clientId')||_0x42c517[_0x4a94('0xa')]('clientSecret')||_0x42c517['changed'](_0x4a94('0xf'))||_0x42c517[_0x4a94('0xa')](_0x4a94('0x10'))){var _0x22dcea,_0x2ea549;_0x22dcea=_0x42c517[_0x4a94('0xc')];var _0x3cadf6=_0x22dcea[_0x4a94('0x25')](-0x1);if(_0x3cadf6==='/'||_0x3cadf6==='\x5c'||_0x3cadf6===':'){_0x22dcea=_0x22dcea['substring'](0x0,_0x22dcea[_0x4a94('0x11')](_0x3cadf6));}switch(_0x42c517[_0x4a94('0xb')]){case'US':_0x2ea549=_0x4a94('0x12');break;case'AU':_0x2ea549=_0x4a94('0x13');break;case'IN':_0x2ea549='https://accounts.zoho.in';break;case'CN':_0x2ea549=_0x4a94('0x15');break;default:_0x2ea549=_0x4a94('0x16');break;}var _0x3cc815={'method':_0x4a94('0x17'),'uri':_0x2ea549+_0x4a94('0x18'),'form':{'grant_type':_0x4a94('0x19'),'client_id':_0x42c517['clientId'],'client_secret':_0x42c517[_0x4a94('0xe')],'redirect_uri':_0x42c517['serverUrl'],'code':_0x42c517[_0x4a94('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3cc815)[_0x4a94('0x1b')](function(_0x4108a8){var _0x4f3703=JSON['parse'](_0x4108a8);if(_0x4f3703[_0x4a94('0x1d')]){_0x42c517[_0x4a94('0x1c')]=_0x4f3703[_0x4a94('0x1d')];logger[_0x4a94('0x1e')](util[_0x4a94('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42c517[_0x4a94('0x22')],_0x42c517['id']));}else{logger[_0x4a94('0x21')](util[_0x4a94('0x1f')](_0x4a94('0x26'),_0x42c517['name'],_0x42c517['id']),util[_0x4a94('0x23')](_0x4f3703,{'showHidden':![],'depth':null}));}return _0x5be97f(null,_0x5165e8);})[_0x4a94('0x24')](function(_0xc0d3fb){logger[_0x4a94('0x21')](util[_0x4a94('0x1f')](_0x4a94('0x26'),_0x42c517[_0x4a94('0x22')],_0x42c517['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5be97f(_0xc0d3fb);});}else{return _0x5be97f(null,_0x5165e8);}}}});}; \ No newline at end of file +var _0x9769=['serverUrl','clientId','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','POST','lodash','util','api','request-promise','path','rimraf','./intZohoAccount.attributes','int_zoho_accounts','changed','zone'];(function(_0x53e1e8,_0x422ca0){var _0x2856c8=function(_0x1c8142){while(--_0x1c8142){_0x53e1e8['push'](_0x53e1e8['shift']());}};_0x2856c8(++_0x422ca0);}(_0x9769,0x15e));var _0x9976=function(_0x34b79f,_0x28ca01){_0x34b79f=_0x34b79f-0x0;var _0xed22bd=_0x9769[_0x34b79f];return _0xed22bd;};'use strict';var _=require(_0x9976('0x0'));var util=require(_0x9976('0x1'));var logger=require('../../config/logger')(_0x9976('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9976('0x3'));var fs=require('fs');var path=require(_0x9976('0x4'));var rimraf=require(_0x9976('0x5'));var config=require('../../config/environment');var attributes=require(_0x9976('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x24041c,_0x1a39ca){return _0x24041c['define']('ZohoAccount',attributes,{'tableName':_0x9976('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27923e,_0x5346b5,_0x2d4e5f){if(_0x27923e[_0x9976('0x8')](_0x9976('0x9'))||_0x27923e['changed'](_0x9976('0xa'))||_0x27923e[_0x9976('0x8')](_0x9976('0xb'))||_0x27923e['changed'](_0x9976('0xc'))||_0x27923e['changed']('code')||_0x27923e[_0x9976('0x8')]('host')){var _0x2e8aa6,_0x56c814;_0x2e8aa6=_0x27923e[_0x9976('0xa')];var _0x26479a=_0x2e8aa6[_0x9976('0xd')](-0x1);if(_0x26479a==='/'||_0x26479a==='\x5c'||_0x26479a===':'){_0x2e8aa6=_0x2e8aa6[_0x9976('0xe')](0x0,_0x2e8aa6[_0x9976('0xf')](_0x26479a));}switch(_0x27923e['zone']){case'US':_0x56c814='https://accounts.zoho.com';break;case'AU':_0x56c814=_0x9976('0x10');break;case'IN':_0x56c814=_0x9976('0x11');break;case'CN':_0x56c814=_0x9976('0x12');break;default:_0x56c814=_0x9976('0x13');break;}var _0x49ecd0={'method':'POST','uri':_0x56c814+_0x9976('0x14'),'form':{'grant_type':_0x9976('0x15'),'client_id':_0x27923e['clientId'],'client_secret':_0x27923e[_0x9976('0xc')],'redirect_uri':_0x27923e[_0x9976('0xa')],'code':_0x27923e[_0x9976('0x16')]},'headers':{'Content-Type':_0x9976('0x17')}};return rp(_0x49ecd0)[_0x9976('0x18')](function(_0xa34401){var _0x51a78b=JSON[_0x9976('0x19')](_0xa34401);if(_0x51a78b[_0x9976('0x1a')]){_0x27923e['refreshToken']=_0x51a78b[_0x9976('0x1a')];logger[_0x9976('0x1b')](util['format'](_0x9976('0x1c'),_0x27923e[_0x9976('0x1d')],_0x27923e['id']));}else{logger[_0x9976('0x1e')](util[_0x9976('0x1f')](_0x9976('0x20'),_0x27923e[_0x9976('0x1d')],_0x27923e['id']),util[_0x9976('0x21')](_0x51a78b,{'showHidden':![],'depth':null}));}return _0x2d4e5f(null,_0x5346b5);})[_0x9976('0x22')](function(_0x34a46c){logger[_0x9976('0x1e')](util[_0x9976('0x1f')](_0x9976('0x20'),_0x27923e['name'],_0x27923e['id']),util[_0x9976('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2d4e5f(_0x34a46c);});}else{return _0x2d4e5f(null,_0x5346b5);}},'beforeUpdate':function(_0x13e1ed,_0x2fe704,_0x4db140){if(_0x13e1ed[_0x9976('0x8')](_0x9976('0x9'))||_0x13e1ed[_0x9976('0x8')](_0x9976('0xa'))||_0x13e1ed[_0x9976('0x8')](_0x9976('0xb'))||_0x13e1ed['changed'](_0x9976('0xc'))||_0x13e1ed[_0x9976('0x8')](_0x9976('0x16'))||_0x13e1ed[_0x9976('0x8')]('host')){var _0x385529,_0x5d3ce3;_0x385529=_0x13e1ed[_0x9976('0xa')];var _0x1f304d=_0x385529[_0x9976('0xd')](-0x1);if(_0x1f304d==='/'||_0x1f304d==='\x5c'||_0x1f304d===':'){_0x385529=_0x385529['substring'](0x0,_0x385529['lastIndexOf'](_0x1f304d));}switch(_0x13e1ed['zone']){case'US':_0x5d3ce3='https://accounts.zoho.com';break;case'AU':_0x5d3ce3=_0x9976('0x10');break;case'IN':_0x5d3ce3=_0x9976('0x11');break;case'CN':_0x5d3ce3='https://accounts.zoho.com.cn';break;default:_0x5d3ce3=_0x9976('0x13');break;}var _0x57f751={'method':_0x9976('0x23'),'uri':_0x5d3ce3+_0x9976('0x14'),'form':{'grant_type':_0x9976('0x15'),'client_id':_0x13e1ed[_0x9976('0xb')],'client_secret':_0x13e1ed['clientSecret'],'redirect_uri':_0x13e1ed['serverUrl'],'code':_0x13e1ed[_0x9976('0x16')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x57f751)[_0x9976('0x18')](function(_0x4f4208){var _0x1b028=JSON[_0x9976('0x19')](_0x4f4208);if(_0x1b028[_0x9976('0x1a')]){_0x13e1ed['refreshToken']=_0x1b028[_0x9976('0x1a')];logger[_0x9976('0x1b')](util[_0x9976('0x1f')](_0x9976('0x1c'),_0x13e1ed[_0x9976('0x1d')],_0x13e1ed['id']));}else{logger[_0x9976('0x1e')](util[_0x9976('0x1f')](_0x9976('0x20'),_0x13e1ed[_0x9976('0x1d')],_0x13e1ed['id']),util[_0x9976('0x21')](_0x1b028,{'showHidden':![],'depth':null}));}return _0x4db140(null,_0x2fe704);})['catch'](function(_0x53f8c6){logger[_0x9976('0x1e')](util[_0x9976('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x13e1ed[_0x9976('0x1d')],_0x13e1ed['id']),util[_0x9976('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x4db140(_0x53f8c6);});}else{return _0x4db140(null,_0x2fe704);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index eea06df..04108e3 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 _0x57ef=['options','raw','where','attributes','include','map','model','ShowZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount'];(function(_0x206e60,_0x2e2ce2){var _0x3be657=function(_0x54f232){while(--_0x54f232){_0x206e60['push'](_0x206e60['shift']());}};_0x3be657(++_0x2e2ce2);}(_0x57ef,0xdb));var _0xf57e=function(_0xc18e54,_0x549850){_0xc18e54=_0xc18e54-0x0;var _0x29cacb=_0x57ef[_0xc18e54];return _0x29cacb;};'use strict';var _=require('lodash');var util=require(_0xf57e('0x0'));var moment=require(_0xf57e('0x1'));var BPromise=require(_0xf57e('0x2'));var rs=require(_0xf57e('0x3'));var fs=require('fs');var Redis=require(_0xf57e('0x4'));var db=require(_0xf57e('0x5'))['db'];var utils=require(_0xf57e('0x6'));var logger=require('../../config/logger')(_0xf57e('0x7'));var config=require(_0xf57e('0x8'));var jayson=require(_0xf57e('0x9'));var client=jayson[_0xf57e('0xa')][_0xf57e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f47b5,_0x2498c5,_0x29ad0f){return new BPromise(function(_0x48031b,_0x2c69e6){return client[_0xf57e('0xc')](_0x2f47b5,_0x29ad0f)[_0xf57e('0xd')](function(_0x2430b1){logger[_0xf57e('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x2498c5,_0xf57e('0xf'));logger[_0xf57e('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2498c5,_0xf57e('0xf'),JSON[_0xf57e('0x11')](_0x2430b1));if(_0x2430b1[_0xf57e('0x12')]){if(_0x2430b1[_0xf57e('0x12')][_0xf57e('0x13')]===0x1f4){logger[_0xf57e('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x2498c5,_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);return _0x2c69e6(_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);}logger[_0xf57e('0x12')](_0xf57e('0x15'),_0x2498c5,_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);return _0x48031b(_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);}else{logger[_0xf57e('0xe')](_0xf57e('0x15'),_0x2498c5,_0xf57e('0xf'));_0x48031b(_0x2430b1[_0xf57e('0x16')][_0xf57e('0x14')]);}})[_0xf57e('0x17')](function(_0x464d53){logger[_0xf57e('0x12')](_0xf57e('0x15'),_0x2498c5,_0x464d53);_0x2c69e6(_0x464d53);});});}exports[_0xf57e('0x18')]=function(_0x186f69){var _0x3858e4=this;return new Promise(function(_0x588ec8,_0x5ab063){return db[_0xf57e('0x19')]['findAll']({'raw':_0x186f69[_0xf57e('0x1a')]?_0x186f69['options'][_0xf57e('0x1b')]===undefined?!![]:![]:!![],'where':_0x186f69[_0xf57e('0x1a')]?_0x186f69[_0xf57e('0x1a')][_0xf57e('0x1c')]||null:null,'attributes':_0x186f69['options']?_0x186f69[_0xf57e('0x1a')][_0xf57e('0x1d')]||null:null,'limit':_0x186f69[_0xf57e('0x1a')]?_0x186f69[_0xf57e('0x1a')]['limit']||null:null,'include':_0x186f69['options']?_0x186f69[_0xf57e('0x1a')][_0xf57e('0x1e')]?_[_0xf57e('0x1f')](_0x186f69[_0xf57e('0x1a')]['include'],function(_0x134557){return{'model':db[_0x134557[_0xf57e('0x20')]],'as':_0x134557['as'],'attributes':_0x134557['attributes'],'include':_0x134557[_0xf57e('0x1e')]?_[_0xf57e('0x1f')](_0x134557[_0xf57e('0x1e')],function(_0xa3072d){return{'model':db[_0xa3072d[_0xf57e('0x20')]],'as':_0xa3072d['as'],'attributes':_0xa3072d[_0xf57e('0x1d')],'include':_0xa3072d['include']?_[_0xf57e('0x1f')](_0xa3072d['include'],function(_0x342c9d){return{'model':db[_0x342c9d[_0xf57e('0x20')]],'as':_0x342c9d['as'],'attributes':_0x342c9d[_0xf57e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52147d){logger[_0xf57e('0xe')](_0xf57e('0x18'),_0x186f69);logger['debug'](_0xf57e('0x18'),_0x186f69,JSON[_0xf57e('0x11')](_0x52147d));_0x588ec8(_0x52147d);})['catch'](function(_0x545f45){logger[_0xf57e('0x12')]('GetZohoAccount',_0x545f45[_0xf57e('0x14')],_0x186f69);_0x5ab063(_0x3858e4[_0xf57e('0x12')](0x1f4,_0x545f45[_0xf57e('0x14')]));});});};exports[_0xf57e('0x21')]=function(_0x502211){var _0x4e5ec2=this;return new Promise(function(_0xc821b7,_0x4bfefb){return db[_0xf57e('0x19')][_0xf57e('0x22')]({'raw':_0x502211[_0xf57e('0x1a')]?_0x502211['options'][_0xf57e('0x1b')]===undefined?!![]:![]:!![],'where':_0x502211[_0xf57e('0x1a')]?_0x502211['options']['where']||null:null,'attributes':_0x502211[_0xf57e('0x1a')]?_0x502211['options'][_0xf57e('0x1d')]||null:null,'include':_0x502211[_0xf57e('0x1a')]?_0x502211['options']['include']?_[_0xf57e('0x1f')](_0x502211[_0xf57e('0x1a')][_0xf57e('0x1e')],function(_0x3d2401){return{'model':db[_0x3d2401['model']],'as':_0x3d2401['as'],'attributes':_0x3d2401['attributes'],'include':_0x3d2401[_0xf57e('0x1e')]?_[_0xf57e('0x1f')](_0x3d2401[_0xf57e('0x1e')],function(_0x360734){return{'model':db[_0x360734[_0xf57e('0x20')]],'as':_0x360734['as'],'attributes':_0x360734['attributes'],'include':_0x360734[_0xf57e('0x1e')]?_['map'](_0x360734['include'],function(_0x94631d){return{'model':db[_0x94631d['model']],'as':_0x94631d['as'],'attributes':_0x94631d[_0xf57e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf57e('0xd')](function(_0x58ea86){logger[_0xf57e('0xe')](_0xf57e('0x21'),_0x502211);logger[_0xf57e('0x10')](_0xf57e('0x21'),_0x502211,JSON[_0xf57e('0x11')](_0x58ea86));_0xc821b7(_0x58ea86);})[_0xf57e('0x17')](function(_0x31c136){logger[_0xf57e('0x12')](_0xf57e('0x21'),_0x31c136[_0xf57e('0x14')],_0x502211);_0x4bfefb(_0x4e5ec2[_0xf57e('0x12')](0x1f4,_0x31c136[_0xf57e('0x14')]));});});}; \ No newline at end of file +var _0x147b=['ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','options','raw','where','attributes','limit','include','map','model','debug','ShowZohoAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x147b,0x193));var _0xb147=function(_0x1b943f,_0x6f6e83){_0x1b943f=_0x1b943f-0x0;var _0x8b7549=_0x147b[_0x1b943f];return _0x8b7549;};'use strict';var _=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var moment=require('moment');var BPromise=require(_0xb147('0x2'));var rs=require(_0xb147('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb147('0x4'))['db'];var utils=require(_0xb147('0x5'));var logger=require(_0xb147('0x6'))('rpc');var config=require(_0xb147('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb147('0x8')][_0xb147('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x336146,_0x5e93d8,_0x5456ed){return new BPromise(function(_0x42bbdb,_0x1a1f88){return client[_0xb147('0xa')](_0x336146,_0x5456ed)[_0xb147('0xb')](function(_0xd5122a){logger[_0xb147('0xc')](_0xb147('0xd'),_0x5e93d8,_0xb147('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5e93d8,_0xb147('0xe'),JSON[_0xb147('0xf')](_0xd5122a));if(_0xd5122a[_0xb147('0x10')]){if(_0xd5122a[_0xb147('0x10')][_0xb147('0x11')]===0x1f4){logger[_0xb147('0x10')](_0xb147('0xd'),_0x5e93d8,_0xd5122a[_0xb147('0x10')][_0xb147('0x12')]);return _0x1a1f88(_0xd5122a[_0xb147('0x10')][_0xb147('0x12')]);}logger['error'](_0xb147('0xd'),_0x5e93d8,_0xd5122a[_0xb147('0x10')][_0xb147('0x12')]);return _0x42bbdb(_0xd5122a[_0xb147('0x10')]['message']);}else{logger[_0xb147('0xc')](_0xb147('0xd'),_0x5e93d8,'request\x20sent');_0x42bbdb(_0xd5122a['result'][_0xb147('0x12')]);}})[_0xb147('0x13')](function(_0x34e3c1){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5e93d8,_0x34e3c1);_0x1a1f88(_0x34e3c1);});});}exports[_0xb147('0x14')]=function(_0x5e3235){var _0x3a9bca=this;return new Promise(function(_0x107b35,_0x11a08a){return db['ZohoAccount']['findAll']({'raw':_0x5e3235['options']?_0x5e3235[_0xb147('0x15')][_0xb147('0x16')]===undefined?!![]:![]:!![],'where':_0x5e3235[_0xb147('0x15')]?_0x5e3235['options'][_0xb147('0x17')]||null:null,'attributes':_0x5e3235[_0xb147('0x15')]?_0x5e3235[_0xb147('0x15')][_0xb147('0x18')]||null:null,'limit':_0x5e3235[_0xb147('0x15')]?_0x5e3235['options'][_0xb147('0x19')]||null:null,'include':_0x5e3235[_0xb147('0x15')]?_0x5e3235[_0xb147('0x15')][_0xb147('0x1a')]?_[_0xb147('0x1b')](_0x5e3235['options']['include'],function(_0x203161){return{'model':db[_0x203161[_0xb147('0x1c')]],'as':_0x203161['as'],'attributes':_0x203161[_0xb147('0x18')],'include':_0x203161[_0xb147('0x1a')]?_['map'](_0x203161[_0xb147('0x1a')],function(_0x4c5475){return{'model':db[_0x4c5475['model']],'as':_0x4c5475['as'],'attributes':_0x4c5475[_0xb147('0x18')],'include':_0x4c5475[_0xb147('0x1a')]?_[_0xb147('0x1b')](_0x4c5475[_0xb147('0x1a')],function(_0x12c18f){return{'model':db[_0x12c18f[_0xb147('0x1c')]],'as':_0x12c18f['as'],'attributes':_0x12c18f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bf2ae){logger[_0xb147('0xc')]('GetZohoAccount',_0x5e3235);logger[_0xb147('0x1d')](_0xb147('0x14'),_0x5e3235,JSON['stringify'](_0x3bf2ae));_0x107b35(_0x3bf2ae);})['catch'](function(_0x2b90ef){logger[_0xb147('0x10')](_0xb147('0x14'),_0x2b90ef[_0xb147('0x12')],_0x5e3235);_0x11a08a(_0x3a9bca[_0xb147('0x10')](0x1f4,_0x2b90ef['message']));});});};exports[_0xb147('0x1e')]=function(_0x315896){var _0x273fff=this;return new Promise(function(_0x15cdfa,_0x40608d){return db['ZohoAccount'][_0xb147('0x1f')]({'raw':_0x315896[_0xb147('0x15')]?_0x315896[_0xb147('0x15')][_0xb147('0x16')]===undefined?!![]:![]:!![],'where':_0x315896[_0xb147('0x15')]?_0x315896[_0xb147('0x15')][_0xb147('0x17')]||null:null,'attributes':_0x315896[_0xb147('0x15')]?_0x315896[_0xb147('0x15')]['attributes']||null:null,'include':_0x315896[_0xb147('0x15')]?_0x315896[_0xb147('0x15')][_0xb147('0x1a')]?_[_0xb147('0x1b')](_0x315896[_0xb147('0x15')][_0xb147('0x1a')],function(_0x1e5799){return{'model':db[_0x1e5799[_0xb147('0x1c')]],'as':_0x1e5799['as'],'attributes':_0x1e5799['attributes'],'include':_0x1e5799[_0xb147('0x1a')]?_[_0xb147('0x1b')](_0x1e5799[_0xb147('0x1a')],function(_0x26ccc6){return{'model':db[_0x26ccc6[_0xb147('0x1c')]],'as':_0x26ccc6['as'],'attributes':_0x26ccc6[_0xb147('0x18')],'include':_0x26ccc6[_0xb147('0x1a')]?_['map'](_0x26ccc6[_0xb147('0x1a')],function(_0x48cc99){return{'model':db[_0x48cc99[_0xb147('0x1c')]],'as':_0x48cc99['as'],'attributes':_0x48cc99[_0xb147('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d3e2b){logger['info'](_0xb147('0x1e'),_0x315896);logger[_0xb147('0x1d')](_0xb147('0x1e'),_0x315896,JSON[_0xb147('0xf')](_0x5d3e2b));_0x15cdfa(_0x5d3e2b);})[_0xb147('0x13')](function(_0x4f6e08){logger[_0xb147('0x10')]('ShowZohoAccount',_0x4f6e08['message'],_0x315896);_0x40608d(_0x273fff['error'](0x1f4,_0x4f6e08[_0xb147('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index a2eed6c..4cfb7ef 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 _0xd8a8=['get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x457a6e,_0x105f2e){var _0x14cc45=function(_0x3bfdf5){while(--_0x3bfdf5){_0x457a6e['push'](_0x457a6e['shift']());}};_0x14cc45(++_0x105f2e);}(_0xd8a8,0xb8));var _0x8d8a=function(_0xa460bc,_0x5be5d8){_0xa460bc=_0xa460bc-0x0;var _0x38bdfa=_0xd8a8[_0xa460bc];return _0x38bdfa;};'use strict';var multer=require(_0x8d8a('0x0'));var util=require(_0x8d8a('0x1'));var path=require(_0x8d8a('0x2'));var timeout=require(_0x8d8a('0x3'));var express=require(_0x8d8a('0x4'));var router=express[_0x8d8a('0x5')]();var fs_extra=require(_0x8d8a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d8a('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x8d8a('0x8')]('/',auth[_0x8d8a('0x9')](),controller[_0x8d8a('0xa')]);router[_0x8d8a('0x8')]('/:id',auth[_0x8d8a('0x9')](),controller['show']);router[_0x8d8a('0x8')](_0x8d8a('0xb'),auth['isAuthenticated'](),controller[_0x8d8a('0xc')]);router['get'](_0x8d8a('0xd'),auth[_0x8d8a('0x9')](),controller[_0x8d8a('0xe')]);router[_0x8d8a('0x8')](_0x8d8a('0xf'),auth[_0x8d8a('0x9')](),controller[_0x8d8a('0x10')]);router[_0x8d8a('0x11')]('/',auth['isAuthenticated'](),controller[_0x8d8a('0x12')]);router[_0x8d8a('0x13')](_0x8d8a('0x14'),auth[_0x8d8a('0x9')](),controller[_0x8d8a('0x15')]);router['delete'](_0x8d8a('0x14'),auth['isAuthenticated'](),controller[_0x8d8a('0x16')]);module[_0x8d8a('0x17')]=router; \ No newline at end of file +var _0xdf6c=['index','/:id','show','/:id/fields','/:id/descriptions','post','create','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xdf6c,0x185));var _0xcdf6=function(_0x52676b,_0x1ba5b9){_0x52676b=_0x52676b-0x0;var _0x161126=_0xdf6c[_0x52676b];return _0x161126;};'use strict';var multer=require(_0xcdf6('0x0'));var util=require(_0xcdf6('0x1'));var path=require(_0xcdf6('0x2'));var timeout=require('connect-timeout');var express=require(_0xcdf6('0x3'));var router=express[_0xcdf6('0x4')]();var fs_extra=require(_0xcdf6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcdf6('0x6'));var config=require(_0xcdf6('0x7'));var controller=require(_0xcdf6('0x8'));router[_0xcdf6('0x9')]('/',auth[_0xcdf6('0xa')](),controller[_0xcdf6('0xb')]);router[_0xcdf6('0x9')](_0xcdf6('0xc'),auth[_0xcdf6('0xa')](),controller[_0xcdf6('0xd')]);router['get'](_0xcdf6('0xe'),auth[_0xcdf6('0xa')](),controller['getFields']);router[_0xcdf6('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xcdf6('0xf'),auth[_0xcdf6('0xa')](),controller['getDescriptions']);router[_0xcdf6('0x10')]('/',auth[_0xcdf6('0xa')](),controller[_0xcdf6('0x11')]);router['put'](_0xcdf6('0xc'),auth[_0xcdf6('0xa')](),controller[_0xcdf6('0x12')]);router[_0xcdf6('0x13')](_0xcdf6('0xc'),auth[_0xcdf6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 68d15f6..7f18166 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 _0xa6a1=['lead','contact','sequelize','STRING','ENUM'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa6a1,0xbb));var _0x1a6a=function(_0x142eb1,_0x48334b){_0x142eb1=_0x142eb1-0x0;var _0x5f566d=_0xa6a1[_0x142eb1];return _0x5f566d;};'use strict';var Sequelize=require(_0x1a6a('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a6a('0x1')]},'moduleCreate':{'type':Sequelize[_0x1a6a('0x2')]('lead','contact','nothing'),'defaultValue':_0x1a6a('0x3')},'moduleSearch':{'type':Sequelize[_0x1a6a('0x2')]('contact_lead',_0x1a6a('0x4'),_0x1a6a('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8610=['STRING','lead','contact','ENUM','sequelize','exports'];(function(_0xbf9f6a,_0x36a221){var _0x29acbc=function(_0x41e4e6){while(--_0x41e4e6){_0xbf9f6a['push'](_0xbf9f6a['shift']());}};_0x29acbc(++_0x36a221);}(_0x8610,0x154));var _0x0861=function(_0x5edc7e,_0x32f14f){_0x5edc7e=_0x5edc7e-0x0;var _0x1e319f=_0x8610[_0x5edc7e];return _0x1e319f;};'use strict';var Sequelize=require(_0x0861('0x0'));module[_0x0861('0x1')]={'name':{'type':Sequelize[_0x0861('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x0861('0x3'),_0x0861('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x0861('0x5')]('contact_lead',_0x0861('0x4'),_0x0861('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x0861('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 7cc63e2..d937152 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 _0xcdc3=['merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','create','body','find','getFields','findOne','ZohoField','keys','pick','order','getDescriptions','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','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xcdc3,0xb1));var _0x3cdc=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcdc3[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x3cdc('0x0'));var rimraf=require(_0x3cdc('0x1'));var zipdir=require(_0x3cdc('0x2'));var jsonpatch=require(_0x3cdc('0x3'));var rp=require(_0x3cdc('0x4'));var moment=require('moment');var BPromise=require(_0x3cdc('0x5'));var Mustache=require(_0x3cdc('0x6'));var util=require(_0x3cdc('0x7'));var path=require('path');var sox=require(_0x3cdc('0x8'));var csv=require(_0x3cdc('0x9'));var ejs=require(_0x3cdc('0xa'));var fs=require('fs');var fs_extra=require(_0x3cdc('0xb'));var _=require(_0x3cdc('0xc'));var squel=require(_0x3cdc('0xd'));var crypto=require(_0x3cdc('0xe'));var jsforce=require(_0x3cdc('0xf'));var deskjs=require(_0x3cdc('0x10'));var toCsv=require(_0x3cdc('0x9'));var querystring=require('querystring');var Papa=require(_0x3cdc('0x11'));var Redis=require(_0x3cdc('0x12'));var authService=require(_0x3cdc('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cdc('0x14'));var logger=require(_0x3cdc('0x15'))(_0x3cdc('0x16'));var utils=require(_0x3cdc('0x17'));var config=require(_0x3cdc('0x18'));var licenseUtil=require(_0x3cdc('0x19'));var db=require(_0x3cdc('0x1a'))['db'];function respondWithStatusCode(_0x17698e,_0xddc359){_0xddc359=_0xddc359||0xcc;return function(_0x5079ff){if(_0x5079ff){return _0x17698e['sendStatus'](_0xddc359);}return _0x17698e[_0x3cdc('0x1b')](_0xddc359)['end']();};}function respondWithResult(_0x3e5c9f,_0x3102c5){_0x3102c5=_0x3102c5||0xc8;return function(_0x471192){if(_0x471192){return _0x3e5c9f['status'](_0x3102c5)[_0x3cdc('0x1c')](_0x471192);}};}function respondWithFilteredResult(_0x277d9a,_0x51eba0){return function(_0x233b31){if(_0x233b31){var _0x38a791=typeof _0x51eba0['offset']===_0x3cdc('0x1d')&&typeof _0x51eba0[_0x3cdc('0x1e')]===_0x3cdc('0x1d');var _0x418a38=_0x233b31[_0x3cdc('0x1f')];var _0x1d43a7=_0x38a791?0x0:_0x51eba0[_0x3cdc('0x20')];var _0xc5bf13=_0x38a791?_0x233b31[_0x3cdc('0x1f')]:_0x51eba0[_0x3cdc('0x20')]+_0x51eba0[_0x3cdc('0x1e')];var _0x12e1bf;if(_0xc5bf13>=_0x418a38){_0xc5bf13=_0x418a38;_0x12e1bf=0xc8;}else{_0x12e1bf=0xce;}_0x277d9a[_0x3cdc('0x1b')](_0x12e1bf);return _0x277d9a['set'](_0x3cdc('0x21'),_0x1d43a7+'-'+_0xc5bf13+'/'+_0x418a38)['json'](_0x233b31);}return null;};}function patchUpdates(_0x34700d){return function(_0xc245f2){try{jsonpatch[_0x3cdc('0x22')](_0xc245f2,_0x34700d,!![]);}catch(_0x526aae){return BPromise[_0x3cdc('0x23')](_0x526aae);}return _0xc245f2['save']();};}function saveUpdates(_0x4006e0,_0x3bcc4a){return function(_0x20ea71){if(_0x20ea71){return _0x20ea71[_0x3cdc('0x24')](_0x4006e0)[_0x3cdc('0x25')](function(_0xd8cb99){return _0xd8cb99;});}return null;};}function removeEntity(_0x27fae0,_0x4f4cd3){return function(_0x2b8ec8){if(_0x2b8ec8){return _0x2b8ec8[_0x3cdc('0x26')]()[_0x3cdc('0x25')](function(){_0x27fae0[_0x3cdc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bb4f3,_0x4429d1){return function(_0x2e5fb4){if(!_0x2e5fb4){_0x3bb4f3['sendStatus'](0x194);}return _0x2e5fb4;};}function handleError(_0x400651,_0x549b61){_0x549b61=_0x549b61||0x1f4;return function(_0xefa16b){logger['error'](_0xefa16b[_0x3cdc('0x27')]);if(_0xefa16b[_0x3cdc('0x28')]){delete _0xefa16b[_0x3cdc('0x28')];}_0x400651[_0x3cdc('0x1b')](_0x549b61)[_0x3cdc('0x29')](_0xefa16b);};}exports[_0x3cdc('0x2a')]=function(_0x23b304,_0x5aa4ea){var _0x388381={},_0x22cf74={},_0x59f331={'count':0x0,'rows':[]};var _0x2b1439=_[_0x3cdc('0x2b')](db[_0x3cdc('0x2c')][_0x3cdc('0x2d')],function(_0x4d8042){return{'name':_0x4d8042[_0x3cdc('0x2e')],'type':_0x4d8042[_0x3cdc('0x2f')]['key']};});_0x22cf74[_0x3cdc('0x30')]=_[_0x3cdc('0x2b')](_0x2b1439,'name');_0x22cf74[_0x3cdc('0x31')]=_['keys'](_0x23b304[_0x3cdc('0x31')]);_0x22cf74['filters']=_[_0x3cdc('0x32')](_0x22cf74[_0x3cdc('0x30')],_0x22cf74[_0x3cdc('0x31')]);_0x388381[_0x3cdc('0x33')]=_['intersection'](_0x22cf74[_0x3cdc('0x30')],qs[_0x3cdc('0x34')](_0x23b304[_0x3cdc('0x31')][_0x3cdc('0x34')]));_0x388381[_0x3cdc('0x33')]=_0x388381[_0x3cdc('0x33')][_0x3cdc('0x35')]?_0x388381[_0x3cdc('0x33')]:_0x22cf74[_0x3cdc('0x30')];if(!_0x23b304[_0x3cdc('0x31')][_0x3cdc('0x36')](_0x3cdc('0x37'))){_0x388381['limit']=qs[_0x3cdc('0x1e')](_0x23b304['query'][_0x3cdc('0x1e')]);_0x388381[_0x3cdc('0x20')]=qs[_0x3cdc('0x20')](_0x23b304['query'][_0x3cdc('0x20')]);}_0x388381['order']=qs[_0x3cdc('0x38')](_0x23b304[_0x3cdc('0x31')][_0x3cdc('0x38')]);_0x388381[_0x3cdc('0x39')]=qs[_0x3cdc('0x3a')](_['pick'](_0x23b304[_0x3cdc('0x31')],_0x22cf74[_0x3cdc('0x3a')]),_0x2b1439);if(_0x23b304[_0x3cdc('0x31')][_0x3cdc('0x3b')]){_0x388381['where']=_[_0x3cdc('0x3c')](_0x388381[_0x3cdc('0x39')],{'$or':_[_0x3cdc('0x2b')](_0x2b1439,function(_0x3461e4){if(_0x3461e4['type']!==_0x3cdc('0x3d')){var _0x2564ad={};_0x2564ad[_0x3461e4[_0x3cdc('0x28')]]={'$like':'%'+_0x23b304[_0x3cdc('0x31')][_0x3cdc('0x3b')]+'%'};return _0x2564ad;}})});}_0x388381=_['merge']({},_0x388381,_0x23b304['options']);var _0x17191c={'where':_0x388381[_0x3cdc('0x39')]};return db[_0x3cdc('0x2c')][_0x3cdc('0x1f')](_0x17191c)[_0x3cdc('0x25')](function(_0xaf9229){_0x59f331['count']=_0xaf9229;if(_0x23b304[_0x3cdc('0x31')][_0x3cdc('0x3e')]){_0x388381['include']=[{'all':!![]}];}return db[_0x3cdc('0x2c')][_0x3cdc('0x3f')](_0x388381);})[_0x3cdc('0x25')](function(_0x41615f){_0x59f331[_0x3cdc('0x40')]=_0x41615f;return _0x59f331;})[_0x3cdc('0x25')](respondWithFilteredResult(_0x5aa4ea,_0x388381))[_0x3cdc('0x41')](handleError(_0x5aa4ea,null));};exports['show']=function(_0x5d3add,_0x52af94){var _0x3080dc={'raw':![],'where':{'id':_0x5d3add[_0x3cdc('0x42')]['id']}},_0x2eeacf={};_0x2eeacf[_0x3cdc('0x30')]=_['keys'](db[_0x3cdc('0x2c')][_0x3cdc('0x2d')]);_0x2eeacf['query']=_['keys'](_0x5d3add['query']);_0x2eeacf[_0x3cdc('0x3a')]=_[_0x3cdc('0x32')](_0x2eeacf['model'],_0x2eeacf[_0x3cdc('0x31')]);_0x3080dc[_0x3cdc('0x33')]=_['intersection'](_0x2eeacf['model'],qs[_0x3cdc('0x34')](_0x5d3add[_0x3cdc('0x31')][_0x3cdc('0x34')]));_0x3080dc['attributes']=_0x3080dc['attributes'][_0x3cdc('0x35')]?_0x3080dc['attributes']:_0x2eeacf[_0x3cdc('0x30')];if(_0x5d3add[_0x3cdc('0x31')][_0x3cdc('0x3e')]){_0x3080dc[_0x3cdc('0x43')]=[{'all':!![]}];}_0x3080dc=_[_0x3cdc('0x3c')]({},_0x3080dc,_0x5d3add[_0x3cdc('0x44')]);return db[_0x3cdc('0x2c')]['find'](_0x3080dc)[_0x3cdc('0x25')](handleEntityNotFound(_0x52af94,null))[_0x3cdc('0x25')](respondWithResult(_0x52af94,null))[_0x3cdc('0x41')](handleError(_0x52af94,null));};exports[_0x3cdc('0x45')]=function(_0x1f0992,_0x4b94a7){return db[_0x3cdc('0x2c')][_0x3cdc('0x45')](_0x1f0992[_0x3cdc('0x46')],{})[_0x3cdc('0x25')](respondWithResult(_0x4b94a7,0xc9))[_0x3cdc('0x41')](handleError(_0x4b94a7,null));};exports[_0x3cdc('0x24')]=function(_0x21d23b,_0x165975){if(_0x21d23b[_0x3cdc('0x46')]['id']){delete _0x21d23b[_0x3cdc('0x46')]['id'];}return db[_0x3cdc('0x2c')]['find']({'where':{'id':_0x21d23b[_0x3cdc('0x42')]['id']}})[_0x3cdc('0x25')](handleEntityNotFound(_0x165975,null))['then'](saveUpdates(_0x21d23b[_0x3cdc('0x46')],null))[_0x3cdc('0x25')](respondWithResult(_0x165975,null))[_0x3cdc('0x41')](handleError(_0x165975,null));};exports[_0x3cdc('0x26')]=function(_0x485386,_0x384d54){return db[_0x3cdc('0x2c')][_0x3cdc('0x47')]({'where':{'id':_0x485386[_0x3cdc('0x42')]['id']}})[_0x3cdc('0x25')](handleEntityNotFound(_0x384d54,null))[_0x3cdc('0x25')](removeEntity(_0x384d54,null))['catch'](handleError(_0x384d54,null));};exports[_0x3cdc('0x48')]=function(_0x1bdb2c,_0x204247,_0x5c8995){var _0x1eebbf={};var _0x3ed399={};var _0x4c2f34;var _0x2ea0a0;return db[_0x3cdc('0x2c')][_0x3cdc('0x49')]({'where':{'id':_0x1bdb2c[_0x3cdc('0x42')]['id']}})[_0x3cdc('0x25')](handleEntityNotFound(_0x204247,null))[_0x3cdc('0x25')](function(_0x415308){if(_0x415308){_0x4c2f34=_0x415308;_0x3ed399[_0x3cdc('0x30')]=_['keys'](db[_0x3cdc('0x4a')][_0x3cdc('0x2d')]);_0x3ed399['query']=_[_0x3cdc('0x4b')](_0x1bdb2c[_0x3cdc('0x31')]);_0x3ed399['filters']=_[_0x3cdc('0x32')](_0x3ed399[_0x3cdc('0x30')],_0x3ed399[_0x3cdc('0x31')]);_0x1eebbf['attributes']=_[_0x3cdc('0x32')](_0x3ed399[_0x3cdc('0x30')],qs['fields'](_0x1bdb2c[_0x3cdc('0x31')]['fields']));_0x1eebbf[_0x3cdc('0x33')]=_0x1eebbf[_0x3cdc('0x33')]['length']?_0x1eebbf[_0x3cdc('0x33')]:_0x3ed399[_0x3cdc('0x30')];_0x1eebbf['order']=qs['sort'](_0x1bdb2c[_0x3cdc('0x31')][_0x3cdc('0x38')]);_0x1eebbf[_0x3cdc('0x39')]=qs[_0x3cdc('0x3a')](_[_0x3cdc('0x4c')](_0x1bdb2c[_0x3cdc('0x31')],_0x3ed399[_0x3cdc('0x3a')]));if(_0x1bdb2c[_0x3cdc('0x31')][_0x3cdc('0x3b')]){_0x1eebbf[_0x3cdc('0x39')]=_['merge'](_0x1eebbf[_0x3cdc('0x39')],{'$or':_['map'](_0x1eebbf[_0x3cdc('0x33')],function(_0x32db0f){var _0x3d2da1={};_0x3d2da1[_0x32db0f]={'$like':'%'+_0x1bdb2c[_0x3cdc('0x31')][_0x3cdc('0x3b')]+'%'};return _0x3d2da1;})});}_0x1eebbf=_[_0x3cdc('0x3c')]({},_0x1eebbf,_0x1bdb2c[_0x3cdc('0x44')]);return _0x4c2f34[_0x3cdc('0x48')](_0x1eebbf);}})[_0x3cdc('0x25')](function(_0x5e781d){if(_0x5e781d){_0x2ea0a0=_0x5e781d[_0x3cdc('0x35')];if(!_0x1bdb2c[_0x3cdc('0x31')]['hasOwnProperty'](_0x3cdc('0x37'))){_0x1eebbf[_0x3cdc('0x1e')]=qs[_0x3cdc('0x1e')](_0x1bdb2c[_0x3cdc('0x31')][_0x3cdc('0x1e')]);_0x1eebbf['offset']=qs[_0x3cdc('0x20')](_0x1bdb2c['query'][_0x3cdc('0x20')]);}return _0x4c2f34[_0x3cdc('0x48')](_0x1eebbf);}})[_0x3cdc('0x25')](function(_0x38c2aa){if(_0x38c2aa){return _0x38c2aa?{'count':_0x2ea0a0,'rows':_0x38c2aa}:null;}})['then'](respondWithResult(_0x204247,null))[_0x3cdc('0x41')](handleError(_0x204247,null));};exports['getSubjects']=function(_0x56b5a8,_0xe337c9,_0x37e9b9){var _0xf7261e={};var _0x19d886={};var _0x3c24fe;var _0xe1af3a;return db[_0x3cdc('0x2c')]['findOne']({'where':{'id':_0x56b5a8[_0x3cdc('0x42')]['id']}})[_0x3cdc('0x25')](handleEntityNotFound(_0xe337c9,null))['then'](function(_0x18581){if(_0x18581){_0x3c24fe=_0x18581;_0x19d886[_0x3cdc('0x30')]=_[_0x3cdc('0x4b')](db[_0x3cdc('0x4a')][_0x3cdc('0x2d')]);_0x19d886[_0x3cdc('0x31')]=_['keys'](_0x56b5a8['query']);_0x19d886['filters']=_[_0x3cdc('0x32')](_0x19d886[_0x3cdc('0x30')],_0x19d886[_0x3cdc('0x31')]);_0xf7261e[_0x3cdc('0x33')]=_['intersection'](_0x19d886[_0x3cdc('0x30')],qs[_0x3cdc('0x34')](_0x56b5a8[_0x3cdc('0x31')][_0x3cdc('0x34')]));_0xf7261e[_0x3cdc('0x33')]=_0xf7261e[_0x3cdc('0x33')][_0x3cdc('0x35')]?_0xf7261e[_0x3cdc('0x33')]:_0x19d886['model'];_0xf7261e[_0x3cdc('0x4d')]=qs[_0x3cdc('0x38')](_0x56b5a8[_0x3cdc('0x31')][_0x3cdc('0x38')]);_0xf7261e[_0x3cdc('0x39')]=qs[_0x3cdc('0x3a')](_[_0x3cdc('0x4c')](_0x56b5a8[_0x3cdc('0x31')],_0x19d886[_0x3cdc('0x3a')]));if(_0x56b5a8['query']['filter']){_0xf7261e[_0x3cdc('0x39')]=_[_0x3cdc('0x3c')](_0xf7261e[_0x3cdc('0x39')],{'$or':_['map'](_0xf7261e[_0x3cdc('0x33')],function(_0x67bb4d){var _0x9150fc={};_0x9150fc[_0x67bb4d]={'$like':'%'+_0x56b5a8['query'][_0x3cdc('0x3b')]+'%'};return _0x9150fc;})});}_0xf7261e=_[_0x3cdc('0x3c')]({},_0xf7261e,_0x56b5a8['options']);return _0x3c24fe['getSubjects'](_0xf7261e);}})[_0x3cdc('0x25')](function(_0x5ad4bb){if(_0x5ad4bb){_0xe1af3a=_0x5ad4bb[_0x3cdc('0x35')];if(!_0x56b5a8['query']['hasOwnProperty']('nolimit')){_0xf7261e[_0x3cdc('0x1e')]=qs[_0x3cdc('0x1e')](_0x56b5a8[_0x3cdc('0x31')][_0x3cdc('0x1e')]);_0xf7261e[_0x3cdc('0x20')]=qs['offset'](_0x56b5a8[_0x3cdc('0x31')][_0x3cdc('0x20')]);}return _0x3c24fe['getSubjects'](_0xf7261e);}})[_0x3cdc('0x25')](function(_0x3e43f4){if(_0x3e43f4){return _0x3e43f4?{'count':_0xe1af3a,'rows':_0x3e43f4}:null;}})['then'](respondWithResult(_0xe337c9,null))[_0x3cdc('0x41')](handleError(_0xe337c9,null));};exports[_0x3cdc('0x4e')]=function(_0x39f5fc,_0x12fe28,_0x367bee){var _0x4bb8cc={};var _0x43d19d={};var _0x1f4173;var _0x54abff;return db[_0x3cdc('0x2c')][_0x3cdc('0x49')]({'where':{'id':_0x39f5fc[_0x3cdc('0x42')]['id']}})[_0x3cdc('0x25')](handleEntityNotFound(_0x12fe28,null))[_0x3cdc('0x25')](function(_0x1980ba){if(_0x1980ba){_0x1f4173=_0x1980ba;_0x43d19d[_0x3cdc('0x30')]=_[_0x3cdc('0x4b')](db[_0x3cdc('0x4a')]['rawAttributes']);_0x43d19d[_0x3cdc('0x31')]=_[_0x3cdc('0x4b')](_0x39f5fc[_0x3cdc('0x31')]);_0x43d19d[_0x3cdc('0x3a')]=_[_0x3cdc('0x32')](_0x43d19d[_0x3cdc('0x30')],_0x43d19d[_0x3cdc('0x31')]);_0x4bb8cc[_0x3cdc('0x33')]=_[_0x3cdc('0x32')](_0x43d19d[_0x3cdc('0x30')],qs[_0x3cdc('0x34')](_0x39f5fc[_0x3cdc('0x31')][_0x3cdc('0x34')]));_0x4bb8cc[_0x3cdc('0x33')]=_0x4bb8cc[_0x3cdc('0x33')][_0x3cdc('0x35')]?_0x4bb8cc[_0x3cdc('0x33')]:_0x43d19d['model'];_0x4bb8cc[_0x3cdc('0x4d')]=qs[_0x3cdc('0x38')](_0x39f5fc[_0x3cdc('0x31')][_0x3cdc('0x38')]);_0x4bb8cc[_0x3cdc('0x39')]=qs['filters'](_['pick'](_0x39f5fc['query'],_0x43d19d[_0x3cdc('0x3a')]));if(_0x39f5fc['query'][_0x3cdc('0x3b')]){_0x4bb8cc[_0x3cdc('0x39')]=_[_0x3cdc('0x3c')](_0x4bb8cc['where'],{'$or':_[_0x3cdc('0x2b')](_0x4bb8cc['attributes'],function(_0x2cf51b){var _0x3cd99e={};_0x3cd99e[_0x2cf51b]={'$like':'%'+_0x39f5fc[_0x3cdc('0x31')][_0x3cdc('0x3b')]+'%'};return _0x3cd99e;})});}_0x4bb8cc=_['merge']({},_0x4bb8cc,_0x39f5fc[_0x3cdc('0x44')]);return _0x1f4173[_0x3cdc('0x4e')](_0x4bb8cc);}})[_0x3cdc('0x25')](function(_0x152f04){if(_0x152f04){_0x54abff=_0x152f04[_0x3cdc('0x35')];if(!_0x39f5fc[_0x3cdc('0x31')][_0x3cdc('0x36')]('nolimit')){_0x4bb8cc[_0x3cdc('0x1e')]=qs[_0x3cdc('0x1e')](_0x39f5fc[_0x3cdc('0x31')][_0x3cdc('0x1e')]);_0x4bb8cc[_0x3cdc('0x20')]=qs['offset'](_0x39f5fc[_0x3cdc('0x31')][_0x3cdc('0x20')]);}return _0x1f4173[_0x3cdc('0x4e')](_0x4bb8cc);}})[_0x3cdc('0x25')](function(_0x4f4f00){if(_0x4f4f00){return _0x4f4f00?{'count':_0x54abff,'rows':_0x4f4f00}:null;}})['then'](respondWithResult(_0x12fe28,null))[_0x3cdc('0x41')](handleError(_0x12fe28,null));}; \ No newline at end of file +var _0xb09f=['intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','find','catch','create','body','getFields','findOne','ZohoField','order','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','index','ZohoConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb09f,0x191));var _0xfb09=function(_0x3cfe67,_0x213f8a){_0x3cfe67=_0x3cfe67-0x0;var _0x471255=_0xb09f[_0x3cfe67];return _0x471255;};'use strict';var emlformat=require(_0xfb09('0x0'));var rimraf=require(_0xfb09('0x1'));var zipdir=require(_0xfb09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb09('0x3'));var moment=require(_0xfb09('0x4'));var BPromise=require(_0xfb09('0x5'));var Mustache=require(_0xfb09('0x6'));var util=require('util');var path=require('path');var sox=require(_0xfb09('0x7'));var csv=require(_0xfb09('0x8'));var ejs=require(_0xfb09('0x9'));var fs=require('fs');var fs_extra=require(_0xfb09('0xa'));var _=require(_0xfb09('0xb'));var squel=require('squel');var crypto=require(_0xfb09('0xc'));var jsforce=require(_0xfb09('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfb09('0x8'));var querystring=require(_0xfb09('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb09('0xf'));var qs=require(_0xfb09('0x10'));var as=require(_0xfb09('0x11'));var hardwareService=require(_0xfb09('0x12'));var logger=require('../../config/logger')(_0xfb09('0x13'));var utils=require('../../config/utils');var config=require(_0xfb09('0x14'));var licenseUtil=require(_0xfb09('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4475f0,_0x5c2e12){_0x5c2e12=_0x5c2e12||0xcc;return function(_0x1693d4){if(_0x1693d4){return _0x4475f0[_0xfb09('0x16')](_0x5c2e12);}return _0x4475f0['status'](_0x5c2e12)['end']();};}function respondWithResult(_0x3aa11d,_0x11dc72){_0x11dc72=_0x11dc72||0xc8;return function(_0x3c12e9){if(_0x3c12e9){return _0x3aa11d[_0xfb09('0x17')](_0x11dc72)['json'](_0x3c12e9);}};}function respondWithFilteredResult(_0x2301b5,_0x362af7){return function(_0x421c59){if(_0x421c59){var _0x4c1897=typeof _0x362af7[_0xfb09('0x18')]===_0xfb09('0x19')&&typeof _0x362af7[_0xfb09('0x1a')]===_0xfb09('0x19');var _0x3a094d=_0x421c59[_0xfb09('0x1b')];var _0x1acb71=_0x4c1897?0x0:_0x362af7[_0xfb09('0x18')];var _0x1245cd=_0x4c1897?_0x421c59['count']:_0x362af7[_0xfb09('0x18')]+_0x362af7[_0xfb09('0x1a')];var _0x5b297c;if(_0x1245cd>=_0x3a094d){_0x1245cd=_0x3a094d;_0x5b297c=0xc8;}else{_0x5b297c=0xce;}_0x2301b5[_0xfb09('0x17')](_0x5b297c);return _0x2301b5[_0xfb09('0x1c')]('Content-Range',_0x1acb71+'-'+_0x1245cd+'/'+_0x3a094d)['json'](_0x421c59);}return null;};}function patchUpdates(_0x562994){return function(_0x4a3bea){try{jsonpatch[_0xfb09('0x1d')](_0x4a3bea,_0x562994,!![]);}catch(_0x45706f){return BPromise[_0xfb09('0x1e')](_0x45706f);}return _0x4a3bea['save']();};}function saveUpdates(_0x4df5e4,_0x30f7a3){return function(_0x2700c4){if(_0x2700c4){return _0x2700c4[_0xfb09('0x1f')](_0x4df5e4)[_0xfb09('0x20')](function(_0x5889ff){return _0x5889ff;});}return null;};}function removeEntity(_0x1a5ec0,_0x54bb4b){return function(_0x8c0d0a){if(_0x8c0d0a){return _0x8c0d0a[_0xfb09('0x21')]()['then'](function(){_0x1a5ec0[_0xfb09('0x17')](0xcc)[_0xfb09('0x22')]();});}};}function handleEntityNotFound(_0x102d63,_0xd38d29){return function(_0x5cfdba){if(!_0x5cfdba){_0x102d63[_0xfb09('0x16')](0x194);}return _0x5cfdba;};}function handleError(_0x30ae4f,_0x418f92){_0x418f92=_0x418f92||0x1f4;return function(_0x593039){logger[_0xfb09('0x23')](_0x593039[_0xfb09('0x24')]);if(_0x593039[_0xfb09('0x25')]){delete _0x593039[_0xfb09('0x25')];}_0x30ae4f[_0xfb09('0x17')](_0x418f92)['send'](_0x593039);};}exports[_0xfb09('0x26')]=function(_0x599684,_0x19ba35){var _0x256fc4={},_0x2f7f0b={},_0x58991e={'count':0x0,'rows':[]};var _0x434166=_['map'](db[_0xfb09('0x27')][_0xfb09('0x28')],function(_0x47e24d){return{'name':_0x47e24d[_0xfb09('0x29')],'type':_0x47e24d[_0xfb09('0x2a')]['key']};});_0x2f7f0b[_0xfb09('0x2b')]=_[_0xfb09('0x2c')](_0x434166,_0xfb09('0x25'));_0x2f7f0b[_0xfb09('0x2d')]=_[_0xfb09('0x2e')](_0x599684[_0xfb09('0x2d')]);_0x2f7f0b[_0xfb09('0x2f')]=_['intersection'](_0x2f7f0b['model'],_0x2f7f0b[_0xfb09('0x2d')]);_0x256fc4[_0xfb09('0x30')]=_[_0xfb09('0x31')](_0x2f7f0b['model'],qs['fields'](_0x599684[_0xfb09('0x2d')][_0xfb09('0x32')]));_0x256fc4[_0xfb09('0x30')]=_0x256fc4[_0xfb09('0x30')][_0xfb09('0x33')]?_0x256fc4[_0xfb09('0x30')]:_0x2f7f0b[_0xfb09('0x2b')];if(!_0x599684[_0xfb09('0x2d')][_0xfb09('0x34')]('nolimit')){_0x256fc4[_0xfb09('0x1a')]=qs['limit'](_0x599684[_0xfb09('0x2d')][_0xfb09('0x1a')]);_0x256fc4[_0xfb09('0x18')]=qs[_0xfb09('0x18')](_0x599684[_0xfb09('0x2d')][_0xfb09('0x18')]);}_0x256fc4['order']=qs[_0xfb09('0x35')](_0x599684[_0xfb09('0x2d')][_0xfb09('0x35')]);_0x256fc4[_0xfb09('0x36')]=qs[_0xfb09('0x2f')](_[_0xfb09('0x37')](_0x599684['query'],_0x2f7f0b['filters']),_0x434166);if(_0x599684[_0xfb09('0x2d')]['filter']){_0x256fc4[_0xfb09('0x36')]=_[_0xfb09('0x38')](_0x256fc4[_0xfb09('0x36')],{'$or':_[_0xfb09('0x2c')](_0x434166,function(_0x5d0314){if(_0x5d0314[_0xfb09('0x2a')]!==_0xfb09('0x39')){var _0x5d3cbf={};_0x5d3cbf[_0x5d0314['name']]={'$like':'%'+_0x599684[_0xfb09('0x2d')][_0xfb09('0x3a')]+'%'};return _0x5d3cbf;}})});}_0x256fc4=_[_0xfb09('0x38')]({},_0x256fc4,_0x599684[_0xfb09('0x3b')]);var _0x5ae5a6={'where':_0x256fc4[_0xfb09('0x36')]};return db[_0xfb09('0x27')][_0xfb09('0x1b')](_0x5ae5a6)['then'](function(_0x2908ac){_0x58991e['count']=_0x2908ac;if(_0x599684[_0xfb09('0x2d')][_0xfb09('0x3c')]){_0x256fc4[_0xfb09('0x3d')]=[{'all':!![]}];}return db[_0xfb09('0x27')]['findAll'](_0x256fc4);})[_0xfb09('0x20')](function(_0x409889){_0x58991e[_0xfb09('0x3e')]=_0x409889;return _0x58991e;})[_0xfb09('0x20')](respondWithFilteredResult(_0x19ba35,_0x256fc4))['catch'](handleError(_0x19ba35,null));};exports['show']=function(_0x3981d8,_0x33cfe2){var _0x300a9a={'raw':![],'where':{'id':_0x3981d8[_0xfb09('0x3f')]['id']}},_0x33915b={};_0x33915b['model']=_[_0xfb09('0x2e')](db['ZohoConfiguration'][_0xfb09('0x28')]);_0x33915b[_0xfb09('0x2d')]=_['keys'](_0x3981d8[_0xfb09('0x2d')]);_0x33915b[_0xfb09('0x2f')]=_['intersection'](_0x33915b[_0xfb09('0x2b')],_0x33915b[_0xfb09('0x2d')]);_0x300a9a[_0xfb09('0x30')]=_[_0xfb09('0x31')](_0x33915b[_0xfb09('0x2b')],qs[_0xfb09('0x32')](_0x3981d8[_0xfb09('0x2d')]['fields']));_0x300a9a[_0xfb09('0x30')]=_0x300a9a[_0xfb09('0x30')][_0xfb09('0x33')]?_0x300a9a[_0xfb09('0x30')]:_0x33915b[_0xfb09('0x2b')];if(_0x3981d8[_0xfb09('0x2d')][_0xfb09('0x3c')]){_0x300a9a[_0xfb09('0x3d')]=[{'all':!![]}];}_0x300a9a=_[_0xfb09('0x38')]({},_0x300a9a,_0x3981d8[_0xfb09('0x3b')]);return db[_0xfb09('0x27')][_0xfb09('0x40')](_0x300a9a)[_0xfb09('0x20')](handleEntityNotFound(_0x33cfe2,null))[_0xfb09('0x20')](respondWithResult(_0x33cfe2,null))[_0xfb09('0x41')](handleError(_0x33cfe2,null));};exports[_0xfb09('0x42')]=function(_0x1a7b16,_0x581db2){return db['ZohoConfiguration'][_0xfb09('0x42')](_0x1a7b16[_0xfb09('0x43')],{})['then'](respondWithResult(_0x581db2,0xc9))[_0xfb09('0x41')](handleError(_0x581db2,null));};exports[_0xfb09('0x1f')]=function(_0x49a043,_0x29f953){if(_0x49a043[_0xfb09('0x43')]['id']){delete _0x49a043[_0xfb09('0x43')]['id'];}return db[_0xfb09('0x27')]['find']({'where':{'id':_0x49a043[_0xfb09('0x3f')]['id']}})[_0xfb09('0x20')](handleEntityNotFound(_0x29f953,null))[_0xfb09('0x20')](saveUpdates(_0x49a043[_0xfb09('0x43')],null))[_0xfb09('0x20')](respondWithResult(_0x29f953,null))['catch'](handleError(_0x29f953,null));};exports[_0xfb09('0x21')]=function(_0x1118e8,_0x426e60){return db[_0xfb09('0x27')][_0xfb09('0x40')]({'where':{'id':_0x1118e8[_0xfb09('0x3f')]['id']}})['then'](handleEntityNotFound(_0x426e60,null))[_0xfb09('0x20')](removeEntity(_0x426e60,null))[_0xfb09('0x41')](handleError(_0x426e60,null));};exports[_0xfb09('0x44')]=function(_0x330a97,_0x5f4669,_0x3224ab){var _0x412954={};var _0x13d1e6={};var _0x44bcef;var _0x3221cc;return db[_0xfb09('0x27')][_0xfb09('0x45')]({'where':{'id':_0x330a97['params']['id']}})[_0xfb09('0x20')](handleEntityNotFound(_0x5f4669,null))[_0xfb09('0x20')](function(_0x5e43e1){if(_0x5e43e1){_0x44bcef=_0x5e43e1;_0x13d1e6[_0xfb09('0x2b')]=_[_0xfb09('0x2e')](db[_0xfb09('0x46')][_0xfb09('0x28')]);_0x13d1e6['query']=_[_0xfb09('0x2e')](_0x330a97['query']);_0x13d1e6['filters']=_[_0xfb09('0x31')](_0x13d1e6['model'],_0x13d1e6[_0xfb09('0x2d')]);_0x412954[_0xfb09('0x30')]=_[_0xfb09('0x31')](_0x13d1e6[_0xfb09('0x2b')],qs[_0xfb09('0x32')](_0x330a97[_0xfb09('0x2d')][_0xfb09('0x32')]));_0x412954[_0xfb09('0x30')]=_0x412954[_0xfb09('0x30')][_0xfb09('0x33')]?_0x412954[_0xfb09('0x30')]:_0x13d1e6[_0xfb09('0x2b')];_0x412954[_0xfb09('0x47')]=qs[_0xfb09('0x35')](_0x330a97[_0xfb09('0x2d')][_0xfb09('0x35')]);_0x412954[_0xfb09('0x36')]=qs[_0xfb09('0x2f')](_[_0xfb09('0x37')](_0x330a97[_0xfb09('0x2d')],_0x13d1e6['filters']));if(_0x330a97['query']['filter']){_0x412954[_0xfb09('0x36')]=_[_0xfb09('0x38')](_0x412954[_0xfb09('0x36')],{'$or':_[_0xfb09('0x2c')](_0x412954[_0xfb09('0x30')],function(_0x4587b3){var _0x3d9553={};_0x3d9553[_0x4587b3]={'$like':'%'+_0x330a97[_0xfb09('0x2d')][_0xfb09('0x3a')]+'%'};return _0x3d9553;})});}_0x412954=_[_0xfb09('0x38')]({},_0x412954,_0x330a97[_0xfb09('0x3b')]);return _0x44bcef[_0xfb09('0x44')](_0x412954);}})['then'](function(_0x37d3fd){if(_0x37d3fd){_0x3221cc=_0x37d3fd[_0xfb09('0x33')];if(!_0x330a97[_0xfb09('0x2d')][_0xfb09('0x34')](_0xfb09('0x48'))){_0x412954['limit']=qs[_0xfb09('0x1a')](_0x330a97[_0xfb09('0x2d')]['limit']);_0x412954[_0xfb09('0x18')]=qs['offset'](_0x330a97[_0xfb09('0x2d')]['offset']);}return _0x44bcef[_0xfb09('0x44')](_0x412954);}})[_0xfb09('0x20')](function(_0x324367){if(_0x324367){return _0x324367?{'count':_0x3221cc,'rows':_0x324367}:null;}})[_0xfb09('0x20')](respondWithResult(_0x5f4669,null))['catch'](handleError(_0x5f4669,null));};exports[_0xfb09('0x49')]=function(_0xdc3f97,_0x4b347b,_0x185036){var _0x560fbe={};var _0x16d40b={};var _0xa54fc2;var _0x2437ec;return db[_0xfb09('0x27')][_0xfb09('0x45')]({'where':{'id':_0xdc3f97[_0xfb09('0x3f')]['id']}})[_0xfb09('0x20')](handleEntityNotFound(_0x4b347b,null))['then'](function(_0x39504d){if(_0x39504d){_0xa54fc2=_0x39504d;_0x16d40b[_0xfb09('0x2b')]=_['keys'](db['ZohoField'][_0xfb09('0x28')]);_0x16d40b['query']=_[_0xfb09('0x2e')](_0xdc3f97['query']);_0x16d40b[_0xfb09('0x2f')]=_['intersection'](_0x16d40b[_0xfb09('0x2b')],_0x16d40b[_0xfb09('0x2d')]);_0x560fbe[_0xfb09('0x30')]=_['intersection'](_0x16d40b['model'],qs[_0xfb09('0x32')](_0xdc3f97['query'][_0xfb09('0x32')]));_0x560fbe[_0xfb09('0x30')]=_0x560fbe[_0xfb09('0x30')]['length']?_0x560fbe[_0xfb09('0x30')]:_0x16d40b[_0xfb09('0x2b')];_0x560fbe[_0xfb09('0x47')]=qs[_0xfb09('0x35')](_0xdc3f97[_0xfb09('0x2d')][_0xfb09('0x35')]);_0x560fbe['where']=qs[_0xfb09('0x2f')](_[_0xfb09('0x37')](_0xdc3f97['query'],_0x16d40b[_0xfb09('0x2f')]));if(_0xdc3f97[_0xfb09('0x2d')]['filter']){_0x560fbe[_0xfb09('0x36')]=_[_0xfb09('0x38')](_0x560fbe[_0xfb09('0x36')],{'$or':_[_0xfb09('0x2c')](_0x560fbe['attributes'],function(_0x1203dd){var _0x201739={};_0x201739[_0x1203dd]={'$like':'%'+_0xdc3f97[_0xfb09('0x2d')][_0xfb09('0x3a')]+'%'};return _0x201739;})});}_0x560fbe=_[_0xfb09('0x38')]({},_0x560fbe,_0xdc3f97['options']);return _0xa54fc2[_0xfb09('0x49')](_0x560fbe);}})['then'](function(_0x25b951){if(_0x25b951){_0x2437ec=_0x25b951['length'];if(!_0xdc3f97['query'][_0xfb09('0x34')](_0xfb09('0x48'))){_0x560fbe[_0xfb09('0x1a')]=qs[_0xfb09('0x1a')](_0xdc3f97[_0xfb09('0x2d')]['limit']);_0x560fbe[_0xfb09('0x18')]=qs[_0xfb09('0x18')](_0xdc3f97[_0xfb09('0x2d')][_0xfb09('0x18')]);}return _0xa54fc2[_0xfb09('0x49')](_0x560fbe);}})[_0xfb09('0x20')](function(_0x24ce23){if(_0x24ce23){return _0x24ce23?{'count':_0x2437ec,'rows':_0x24ce23}:null;}})[_0xfb09('0x20')](respondWithResult(_0x4b347b,null))['catch'](handleError(_0x4b347b,null));};exports['getDescriptions']=function(_0x5c900c,_0x26d175,_0x55fb4f){var _0x22806b={};var _0x785b9d={};var _0x31c526;var _0x4b739b;return db[_0xfb09('0x27')][_0xfb09('0x45')]({'where':{'id':_0x5c900c[_0xfb09('0x3f')]['id']}})['then'](handleEntityNotFound(_0x26d175,null))['then'](function(_0x3bb292){if(_0x3bb292){_0x31c526=_0x3bb292;_0x785b9d['model']=_[_0xfb09('0x2e')](db[_0xfb09('0x46')][_0xfb09('0x28')]);_0x785b9d[_0xfb09('0x2d')]=_['keys'](_0x5c900c[_0xfb09('0x2d')]);_0x785b9d[_0xfb09('0x2f')]=_[_0xfb09('0x31')](_0x785b9d[_0xfb09('0x2b')],_0x785b9d[_0xfb09('0x2d')]);_0x22806b[_0xfb09('0x30')]=_[_0xfb09('0x31')](_0x785b9d[_0xfb09('0x2b')],qs[_0xfb09('0x32')](_0x5c900c['query'][_0xfb09('0x32')]));_0x22806b['attributes']=_0x22806b[_0xfb09('0x30')][_0xfb09('0x33')]?_0x22806b[_0xfb09('0x30')]:_0x785b9d[_0xfb09('0x2b')];_0x22806b[_0xfb09('0x47')]=qs[_0xfb09('0x35')](_0x5c900c['query'][_0xfb09('0x35')]);_0x22806b['where']=qs[_0xfb09('0x2f')](_[_0xfb09('0x37')](_0x5c900c[_0xfb09('0x2d')],_0x785b9d[_0xfb09('0x2f')]));if(_0x5c900c['query'][_0xfb09('0x3a')]){_0x22806b['where']=_[_0xfb09('0x38')](_0x22806b[_0xfb09('0x36')],{'$or':_['map'](_0x22806b[_0xfb09('0x30')],function(_0x131eeb){var _0x481290={};_0x481290[_0x131eeb]={'$like':'%'+_0x5c900c[_0xfb09('0x2d')]['filter']+'%'};return _0x481290;})});}_0x22806b=_['merge']({},_0x22806b,_0x5c900c[_0xfb09('0x3b')]);return _0x31c526[_0xfb09('0x4a')](_0x22806b);}})[_0xfb09('0x20')](function(_0x1de51b){if(_0x1de51b){_0x4b739b=_0x1de51b['length'];if(!_0x5c900c[_0xfb09('0x2d')][_0xfb09('0x34')]('nolimit')){_0x22806b['limit']=qs['limit'](_0x5c900c[_0xfb09('0x2d')][_0xfb09('0x1a')]);_0x22806b['offset']=qs[_0xfb09('0x18')](_0x5c900c['query']['offset']);}return _0x31c526[_0xfb09('0x4a')](_0x22806b);}})[_0xfb09('0x20')](function(_0x4144e3){if(_0x4144e3){return _0x4144e3?{'count':_0x4b739b,'rows':_0x4144e3}:null;}})[_0xfb09('0x20')](respondWithResult(_0x26d175,null))[_0xfb09('0x41')](handleError(_0x26d175,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c254647..48a9187 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 _0x5589=['bluebird','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x197127,_0x48bbfd){var _0x558ca6=function(_0x580faf){while(--_0x580faf){_0x197127['push'](_0x197127['shift']());}};_0x558ca6(++_0x48bbfd);}(_0x5589,0x1a0));var _0x9558=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x5589[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x9558('0x0'));var util=require('util');var logger=require(_0x9558('0x1'))(_0x9558('0x2'));var moment=require(_0x9558('0x3'));var BPromise=require(_0x9558('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9558('0x5'));var config=require('../../config/environment');var attributes=require(_0x9558('0x6'));module['exports']=function(_0x317d65,_0x204da5){return _0x317d65[_0x9558('0x7')](_0x9558('0x8'),attributes,{'tableName':_0x9558('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2097=['bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x168484,_0x3124ad){var _0x3af701=function(_0x552ef3){while(--_0x552ef3){_0x168484['push'](_0x168484['shift']());}};_0x3af701(++_0x3124ad);}(_0x2097,0x127));var _0x7209=function(_0x4363d6,_0x3b04b6){_0x4363d6=_0x4363d6-0x0;var _0x2786c9=_0x2097[_0x4363d6];return _0x2786c9;};'use strict';var _=require(_0x7209('0x0'));var util=require(_0x7209('0x1'));var logger=require(_0x7209('0x2'))(_0x7209('0x3'));var moment=require('moment');var BPromise=require(_0x7209('0x4'));var rp=require(_0x7209('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7209('0x6'));var config=require(_0x7209('0x7'));var attributes=require(_0x7209('0x8'));module[_0x7209('0x9')]=function(_0x26eec7,_0x55d431){return _0x26eec7[_0x7209('0xa')](_0x7209('0xb'),attributes,{'tableName':_0x7209('0xc'),'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 a0b2b34..87bce5f 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 _0x3c52=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x5e925b,_0x144e71){var _0x457256=function(_0x572588){while(--_0x572588){_0x5e925b['push'](_0x5e925b['shift']());}};_0x457256(++_0x144e71);}(_0x3c52,0x187));var _0x23c5=function(_0x3f1117,_0x5e8b33){_0x3f1117=_0x3f1117-0x0;var _0x2d8c39=_0x3c52[_0x3f1117];return _0x2d8c39;};'use strict';var _=require(_0x23c5('0x0'));var util=require(_0x23c5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x23c5('0x2'));var fs=require('fs');var Redis=require(_0x23c5('0x3'));var db=require(_0x23c5('0x4'))['db'];var utils=require(_0x23c5('0x5'));var logger=require(_0x23c5('0x6'))(_0x23c5('0x7'));var config=require(_0x23c5('0x8'));var jayson=require(_0x23c5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55047a,_0x199205,_0x214e68){return new BPromise(function(_0x433ff3,_0xd7c1db){return client[_0x23c5('0xa')](_0x55047a,_0x214e68)[_0x23c5('0xb')](function(_0x550a56){logger[_0x23c5('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x199205,'request\x20sent');logger[_0x23c5('0xd')](_0x23c5('0xe'),_0x199205,'request\x20sent',JSON['stringify'](_0x550a56));if(_0x550a56[_0x23c5('0xf')]){if(_0x550a56[_0x23c5('0xf')][_0x23c5('0x10')]===0x1f4){logger[_0x23c5('0xf')](_0x23c5('0x11'),_0x199205,_0x550a56[_0x23c5('0xf')][_0x23c5('0x12')]);return _0xd7c1db(_0x550a56[_0x23c5('0xf')][_0x23c5('0x12')]);}logger[_0x23c5('0xf')](_0x23c5('0x11'),_0x199205,_0x550a56['error'][_0x23c5('0x12')]);return _0x433ff3(_0x550a56[_0x23c5('0xf')][_0x23c5('0x12')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x199205,_0x23c5('0x13'));_0x433ff3(_0x550a56[_0x23c5('0x14')][_0x23c5('0x12')]);}})[_0x23c5('0x15')](function(_0x4bfbbe){logger['error'](_0x23c5('0x11'),_0x199205,_0x4bfbbe);_0xd7c1db(_0x4bfbbe);});});} \ No newline at end of file +var _0xbc4a=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1d1d98,_0xb6e7a9){var _0x17cd4b=function(_0x32e8d1){while(--_0x32e8d1){_0x1d1d98['push'](_0x1d1d98['shift']());}};_0x17cd4b(++_0xb6e7a9);}(_0xbc4a,0xe8));var _0xabc4=function(_0x52d2c8,_0x40f9a8){_0x52d2c8=_0x52d2c8-0x0;var _0x54d5c9=_0xbc4a[_0x52d2c8];return _0x54d5c9;};'use strict';var _=require(_0xabc4('0x0'));var util=require('util');var moment=require(_0xabc4('0x1'));var BPromise=require(_0xabc4('0x2'));var rs=require(_0xabc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabc4('0x4'))['db'];var utils=require(_0xabc4('0x5'));var logger=require('../../config/logger')(_0xabc4('0x6'));var config=require(_0xabc4('0x7'));var jayson=require(_0xabc4('0x8'));var client=jayson[_0xabc4('0x9')][_0xabc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e744d,_0x19c31d,_0x5bf048){return new BPromise(function(_0x822c1c,_0x126b84){return client[_0xabc4('0xb')](_0x5e744d,_0x5bf048)[_0xabc4('0xc')](function(_0x352bb9){logger[_0xabc4('0xd')](_0xabc4('0xe'),_0x19c31d,_0xabc4('0xf'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x19c31d,'request\x20sent',JSON[_0xabc4('0x10')](_0x352bb9));if(_0x352bb9[_0xabc4('0x11')]){if(_0x352bb9[_0xabc4('0x11')][_0xabc4('0x12')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x19c31d,_0x352bb9[_0xabc4('0x11')][_0xabc4('0x13')]);return _0x126b84(_0x352bb9['error']['message']);}logger[_0xabc4('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x19c31d,_0x352bb9[_0xabc4('0x11')][_0xabc4('0x13')]);return _0x822c1c(_0x352bb9[_0xabc4('0x11')][_0xabc4('0x13')]);}else{logger[_0xabc4('0xd')](_0xabc4('0xe'),_0x19c31d,_0xabc4('0xf'));_0x822c1c(_0x352bb9[_0xabc4('0x14')][_0xabc4('0x13')]);}})['catch'](function(_0x409fff){logger[_0xabc4('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x19c31d,_0x409fff);_0x126b84(_0x409fff);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 37f18db..8702144 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 _0x4dc8=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4dc8,0x167));var _0x84dc=function(_0x1ceb8d,_0x1c5b66){_0x1ceb8d=_0x1ceb8d-0x0;var _0x46c361=_0x4dc8[_0x1ceb8d];return _0x46c361;};'use strict';var multer=require(_0x84dc('0x0'));var util=require(_0x84dc('0x1'));var path=require(_0x84dc('0x2'));var timeout=require(_0x84dc('0x3'));var express=require(_0x84dc('0x4'));var router=express[_0x84dc('0x5')]();var fs_extra=require(_0x84dc('0x6'));var auth=require(_0x84dc('0x7'));var interaction=require(_0x84dc('0x8'));var config=require(_0x84dc('0x9'));var controller=require('./intZohoField.controller');router[_0x84dc('0xa')]('/',auth[_0x84dc('0xb')](),controller['index']);router[_0x84dc('0xa')](_0x84dc('0xc'),auth[_0x84dc('0xb')](),controller[_0x84dc('0xd')]);router['post']('/',auth[_0x84dc('0xb')](),controller['create']);router[_0x84dc('0xe')](_0x84dc('0xc'),auth[_0x84dc('0xb')](),controller['update']);router[_0x84dc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x84dc('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd7e3=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x1ecffd,_0x34f3df){var _0x4ebd17=function(_0x1beb1f){while(--_0x1beb1f){_0x1ecffd['push'](_0x1ecffd['shift']());}};_0x4ebd17(++_0x34f3df);}(_0xd7e3,0x148));var _0x3d7e=function(_0x4cffe7,_0x34ba59){_0x4cffe7=_0x4cffe7-0x0;var _0x2f967d=_0xd7e3[_0x4cffe7];return _0x2f967d;};'use strict';var multer=require(_0x3d7e('0x0'));var util=require(_0x3d7e('0x1'));var path=require(_0x3d7e('0x2'));var timeout=require(_0x3d7e('0x3'));var express=require('express');var router=express[_0x3d7e('0x4')]();var fs_extra=require(_0x3d7e('0x5'));var auth=require(_0x3d7e('0x6'));var interaction=require(_0x3d7e('0x7'));var config=require(_0x3d7e('0x8'));var controller=require(_0x3d7e('0x9'));router[_0x3d7e('0xa')]('/',auth[_0x3d7e('0xb')](),controller['index']);router[_0x3d7e('0xa')](_0x3d7e('0xc'),auth[_0x3d7e('0xb')](),controller[_0x3d7e('0xd')]);router[_0x3d7e('0xe')]('/',auth[_0x3d7e('0xb')](),controller[_0x3d7e('0xf')]);router['put'](_0x3d7e('0xc'),auth[_0x3d7e('0xb')](),controller[_0x3d7e('0x10')]);router[_0x3d7e('0x11')](_0x3d7e('0xc'),auth['isAuthenticated'](),controller[_0x3d7e('0x12')]);module[_0x3d7e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7c623cd..b6fdddc 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 _0xd45a=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist'];(function(_0x4dc37f,_0x3c4a37){var _0x1693e2=function(_0x2a8b99){while(--_0x2a8b99){_0x4dc37f['push'](_0x4dc37f['shift']());}};_0x1693e2(++_0x3c4a37);}(_0xd45a,0x9d));var _0xad45=function(_0x4d0901,_0x58fa77){_0x4d0901=_0x4d0901-0x0;var _0x42fa1e=_0xd45a[_0x4d0901];return _0x42fa1e;};'use strict';var Sequelize=require(_0xad45('0x0'));module[_0xad45('0x1')]={'type':{'type':Sequelize[_0xad45('0x2')]('string','variable',_0xad45('0x3'),'keyValue',_0xad45('0x4')),'defaultValue':_0xad45('0x5')},'content':{'type':Sequelize[_0xad45('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xad45('0x2')](_0xad45('0x5'),_0xad45('0x7'),_0xad45('0x3'))},'keyContent':{'type':Sequelize[_0xad45('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xad45('0x6')]},'customField':{'type':Sequelize[_0xad45('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad45('0x6')]}}; \ No newline at end of file +var _0xad69=['exports','ENUM','variable','customVariable','picklist','STRING','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xad69,0x133));var _0x9ad6=function(_0x25e942,_0x27fd6a){_0x25e942=_0x25e942-0x0;var _0x2bd619=_0xad69[_0x25e942];return _0x2bd619;};'use strict';var Sequelize=require(_0x9ad6('0x0'));module[_0x9ad6('0x1')]={'type':{'type':Sequelize[_0x9ad6('0x2')]('string',_0x9ad6('0x3'),_0x9ad6('0x4'),'keyValue',_0x9ad6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9ad6('0x6')]},'key':{'type':Sequelize[_0x9ad6('0x6')]},'keyType':{'type':Sequelize[_0x9ad6('0x2')]('string','variable',_0x9ad6('0x4'))},'keyContent':{'type':Sequelize[_0x9ad6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9ad6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9ad6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 94d04af..3628102 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 _0x0ce5=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','params','options','create','body','catch','find','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0ce5,0x157));var _0x50ce=function(_0x14bb2f,_0x3c8ed0){_0x14bb2f=_0x14bb2f-0x0;var _0x5e2041=_0x0ce5[_0x14bb2f];return _0x5e2041;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50ce('0x0'));var zipdir=require(_0x50ce('0x1'));var jsonpatch=require(_0x50ce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x50ce('0x3'));var Mustache=require(_0x50ce('0x4'));var util=require(_0x50ce('0x5'));var path=require(_0x50ce('0x6'));var sox=require(_0x50ce('0x7'));var csv=require(_0x50ce('0x8'));var ejs=require(_0x50ce('0x9'));var fs=require('fs');var fs_extra=require(_0x50ce('0xa'));var _=require(_0x50ce('0xb'));var squel=require(_0x50ce('0xc'));var crypto=require(_0x50ce('0xd'));var jsforce=require(_0x50ce('0xe'));var deskjs=require(_0x50ce('0xf'));var toCsv=require(_0x50ce('0x8'));var querystring=require(_0x50ce('0x10'));var Papa=require(_0x50ce('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50ce('0x12'));var logger=require('../../config/logger')(_0x50ce('0x13'));var utils=require(_0x50ce('0x14'));var config=require(_0x50ce('0x15'));var licenseUtil=require(_0x50ce('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42dd1c,_0xfb9aa5){_0xfb9aa5=_0xfb9aa5||0xcc;return function(_0x31655e){if(_0x31655e){return _0x42dd1c[_0x50ce('0x17')](_0xfb9aa5);}return _0x42dd1c[_0x50ce('0x18')](_0xfb9aa5)[_0x50ce('0x19')]();};}function respondWithResult(_0x399e98,_0x4a86c6){_0x4a86c6=_0x4a86c6||0xc8;return function(_0x48e805){if(_0x48e805){return _0x399e98[_0x50ce('0x18')](_0x4a86c6)[_0x50ce('0x1a')](_0x48e805);}};}function respondWithFilteredResult(_0x349056,_0x48810b){return function(_0x24f27a){if(_0x24f27a){var _0x48bef3=typeof _0x48810b[_0x50ce('0x1b')]==='undefined'&&typeof _0x48810b[_0x50ce('0x1c')]===_0x50ce('0x1d');var _0x39ac36=_0x24f27a[_0x50ce('0x1e')];var _0x397fa2=_0x48bef3?0x0:_0x48810b[_0x50ce('0x1b')];var _0x4f13bb=_0x48bef3?_0x24f27a[_0x50ce('0x1e')]:_0x48810b[_0x50ce('0x1b')]+_0x48810b[_0x50ce('0x1c')];var _0x21fdc9;if(_0x4f13bb>=_0x39ac36){_0x4f13bb=_0x39ac36;_0x21fdc9=0xc8;}else{_0x21fdc9=0xce;}_0x349056['status'](_0x21fdc9);return _0x349056[_0x50ce('0x1f')]('Content-Range',_0x397fa2+'-'+_0x4f13bb+'/'+_0x39ac36)[_0x50ce('0x1a')](_0x24f27a);}return null;};}function patchUpdates(_0x46e3ba){return function(_0x2fec3a){try{jsonpatch['apply'](_0x2fec3a,_0x46e3ba,!![]);}catch(_0x307c2c){return BPromise[_0x50ce('0x20')](_0x307c2c);}return _0x2fec3a[_0x50ce('0x21')]();};}function saveUpdates(_0x4c0703,_0x383096){return function(_0x5bd334){if(_0x5bd334){return _0x5bd334[_0x50ce('0x22')](_0x4c0703)[_0x50ce('0x23')](function(_0x335d7c){return _0x335d7c;});}return null;};}function removeEntity(_0x5e6a61,_0x3e8af2){return function(_0x585181){if(_0x585181){return _0x585181[_0x50ce('0x24')]()[_0x50ce('0x23')](function(){_0x5e6a61[_0x50ce('0x18')](0xcc)[_0x50ce('0x19')]();});}};}function handleEntityNotFound(_0x1314ae,_0x52a1fa){return function(_0x4f84aa){if(!_0x4f84aa){_0x1314ae[_0x50ce('0x17')](0x194);}return _0x4f84aa;};}function handleError(_0x20077b,_0x355b66){_0x355b66=_0x355b66||0x1f4;return function(_0x1fff4a){logger['error'](_0x1fff4a[_0x50ce('0x25')]);if(_0x1fff4a[_0x50ce('0x26')]){delete _0x1fff4a[_0x50ce('0x26')];}_0x20077b[_0x50ce('0x18')](_0x355b66)[_0x50ce('0x27')](_0x1fff4a);};}exports['index']=function(_0x1dc779,_0x4a84a3){var _0x26b8d9={},_0x9bb16d={},_0x113984={'count':0x0,'rows':[]};var _0x470acb=_[_0x50ce('0x28')](db[_0x50ce('0x29')][_0x50ce('0x2a')],function(_0x37eba3){return{'name':_0x37eba3[_0x50ce('0x2b')],'type':_0x37eba3[_0x50ce('0x2c')]['key']};});_0x9bb16d[_0x50ce('0x2d')]=_[_0x50ce('0x28')](_0x470acb,_0x50ce('0x26'));_0x9bb16d[_0x50ce('0x2e')]=_[_0x50ce('0x2f')](_0x1dc779[_0x50ce('0x2e')]);_0x9bb16d['filters']=_[_0x50ce('0x30')](_0x9bb16d[_0x50ce('0x2d')],_0x9bb16d[_0x50ce('0x2e')]);_0x26b8d9[_0x50ce('0x31')]=_[_0x50ce('0x30')](_0x9bb16d[_0x50ce('0x2d')],qs[_0x50ce('0x32')](_0x1dc779[_0x50ce('0x2e')]['fields']));_0x26b8d9[_0x50ce('0x31')]=_0x26b8d9[_0x50ce('0x31')][_0x50ce('0x33')]?_0x26b8d9[_0x50ce('0x31')]:_0x9bb16d['model'];if(!_0x1dc779[_0x50ce('0x2e')][_0x50ce('0x34')](_0x50ce('0x35'))){_0x26b8d9['limit']=qs[_0x50ce('0x1c')](_0x1dc779[_0x50ce('0x2e')]['limit']);_0x26b8d9[_0x50ce('0x1b')]=qs[_0x50ce('0x1b')](_0x1dc779[_0x50ce('0x2e')][_0x50ce('0x1b')]);}_0x26b8d9['order']=qs['sort'](_0x1dc779[_0x50ce('0x2e')][_0x50ce('0x36')]);_0x26b8d9[_0x50ce('0x37')]=qs[_0x50ce('0x38')](_[_0x50ce('0x39')](_0x1dc779[_0x50ce('0x2e')],_0x9bb16d[_0x50ce('0x38')]),_0x470acb);if(_0x1dc779[_0x50ce('0x2e')][_0x50ce('0x3a')]){_0x26b8d9[_0x50ce('0x37')]=_[_0x50ce('0x3b')](_0x26b8d9[_0x50ce('0x37')],{'$or':_[_0x50ce('0x28')](_0x470acb,function(_0x1c7744){if(_0x1c7744[_0x50ce('0x2c')]!=='VIRTUAL'){var _0xbf0fe7={};_0xbf0fe7[_0x1c7744[_0x50ce('0x26')]]={'$like':'%'+_0x1dc779[_0x50ce('0x2e')][_0x50ce('0x3a')]+'%'};return _0xbf0fe7;}})});}_0x26b8d9=_[_0x50ce('0x3b')]({},_0x26b8d9,_0x1dc779['options']);var _0x4bd718={'where':_0x26b8d9[_0x50ce('0x37')]};return db[_0x50ce('0x29')][_0x50ce('0x1e')](_0x4bd718)['then'](function(_0xb358e6){_0x113984['count']=_0xb358e6;if(_0x1dc779[_0x50ce('0x2e')][_0x50ce('0x3c')]){_0x26b8d9[_0x50ce('0x3d')]=[{'all':!![]}];}return db[_0x50ce('0x29')][_0x50ce('0x3e')](_0x26b8d9);})[_0x50ce('0x23')](function(_0x3db2d6){_0x113984[_0x50ce('0x3f')]=_0x3db2d6;return _0x113984;})[_0x50ce('0x23')](respondWithFilteredResult(_0x4a84a3,_0x26b8d9))['catch'](handleError(_0x4a84a3,null));};exports['show']=function(_0x2f1e0c,_0x522f9c){var _0x124fb1={'raw':!![],'where':{'id':_0x2f1e0c[_0x50ce('0x40')]['id']}},_0xaab0b1={};_0xaab0b1[_0x50ce('0x2d')]=_['keys'](db[_0x50ce('0x29')][_0x50ce('0x2a')]);_0xaab0b1['query']=_[_0x50ce('0x2f')](_0x2f1e0c[_0x50ce('0x2e')]);_0xaab0b1['filters']=_[_0x50ce('0x30')](_0xaab0b1[_0x50ce('0x2d')],_0xaab0b1[_0x50ce('0x2e')]);_0x124fb1['attributes']=_[_0x50ce('0x30')](_0xaab0b1[_0x50ce('0x2d')],qs['fields'](_0x2f1e0c[_0x50ce('0x2e')][_0x50ce('0x32')]));_0x124fb1[_0x50ce('0x31')]=_0x124fb1[_0x50ce('0x31')][_0x50ce('0x33')]?_0x124fb1[_0x50ce('0x31')]:_0xaab0b1[_0x50ce('0x2d')];if(_0x2f1e0c['query'][_0x50ce('0x3c')]){_0x124fb1[_0x50ce('0x3d')]=[{'all':!![]}];}_0x124fb1=_[_0x50ce('0x3b')]({},_0x124fb1,_0x2f1e0c[_0x50ce('0x41')]);return db[_0x50ce('0x29')]['find'](_0x124fb1)['then'](handleEntityNotFound(_0x522f9c,null))[_0x50ce('0x23')](respondWithResult(_0x522f9c,null))['catch'](handleError(_0x522f9c,null));};exports[_0x50ce('0x42')]=function(_0x51bb27,_0x4a339b){return db[_0x50ce('0x29')][_0x50ce('0x42')](_0x51bb27[_0x50ce('0x43')],{})[_0x50ce('0x23')](respondWithResult(_0x4a339b,0xc9))[_0x50ce('0x44')](handleError(_0x4a339b,null));};exports[_0x50ce('0x22')]=function(_0x5ba959,_0x2d38ce){if(_0x5ba959[_0x50ce('0x43')]['id']){delete _0x5ba959[_0x50ce('0x43')]['id'];}return db[_0x50ce('0x29')]['find']({'where':{'id':_0x5ba959[_0x50ce('0x40')]['id']}})[_0x50ce('0x23')](handleEntityNotFound(_0x2d38ce,null))[_0x50ce('0x23')](saveUpdates(_0x5ba959[_0x50ce('0x43')],null))[_0x50ce('0x23')](respondWithResult(_0x2d38ce,null))[_0x50ce('0x44')](handleError(_0x2d38ce,null));};exports[_0x50ce('0x24')]=function(_0xe39f31,_0x1ff0fd){return db['ZohoField'][_0x50ce('0x45')]({'where':{'id':_0xe39f31[_0x50ce('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ff0fd,null))[_0x50ce('0x23')](removeEntity(_0x1ff0fd,null))['catch'](handleError(_0x1ff0fd,null));}; \ No newline at end of file +var _0x032e=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','ZohoField','include','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2d96f9,_0x2a3451){var _0x4b178b=function(_0x303ccf){while(--_0x303ccf){_0x2d96f9['push'](_0x2d96f9['shift']());}};_0x4b178b(++_0x2a3451);}(_0x032e,0x1cc));var _0xe032=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x032e[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe032('0x0'));var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require(_0xe032('0x3'));var moment=require(_0xe032('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe032('0x5'));var util=require(_0xe032('0x6'));var path=require(_0xe032('0x7'));var sox=require(_0xe032('0x8'));var csv=require(_0xe032('0x9'));var ejs=require(_0xe032('0xa'));var fs=require('fs');var fs_extra=require(_0xe032('0xb'));var _=require('lodash');var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x9'));var querystring=require(_0xe032('0x10'));var Papa=require('papaparse');var Redis=require(_0xe032('0x11'));var authService=require(_0xe032('0x12'));var qs=require(_0xe032('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe032('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe032('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe032('0x16'))['db'];function respondWithStatusCode(_0x48555b,_0x405184){_0x405184=_0x405184||0xcc;return function(_0x12c535){if(_0x12c535){return _0x48555b[_0xe032('0x17')](_0x405184);}return _0x48555b[_0xe032('0x18')](_0x405184)[_0xe032('0x19')]();};}function respondWithResult(_0x140e56,_0x10aac3){_0x10aac3=_0x10aac3||0xc8;return function(_0x1cc0bb){if(_0x1cc0bb){return _0x140e56[_0xe032('0x18')](_0x10aac3)[_0xe032('0x1a')](_0x1cc0bb);}};}function respondWithFilteredResult(_0x23883c,_0x16a36e){return function(_0x3f3010){if(_0x3f3010){var _0x40a175=typeof _0x16a36e[_0xe032('0x1b')]===_0xe032('0x1c')&&typeof _0x16a36e['limit']==='undefined';var _0x13b1f9=_0x3f3010['count'];var _0xd43d01=_0x40a175?0x0:_0x16a36e[_0xe032('0x1b')];var _0x1625a0=_0x40a175?_0x3f3010[_0xe032('0x1d')]:_0x16a36e[_0xe032('0x1b')]+_0x16a36e[_0xe032('0x1e')];var _0x39031b;if(_0x1625a0>=_0x13b1f9){_0x1625a0=_0x13b1f9;_0x39031b=0xc8;}else{_0x39031b=0xce;}_0x23883c[_0xe032('0x18')](_0x39031b);return _0x23883c[_0xe032('0x1f')](_0xe032('0x20'),_0xd43d01+'-'+_0x1625a0+'/'+_0x13b1f9)[_0xe032('0x1a')](_0x3f3010);}return null;};}function patchUpdates(_0x230656){return function(_0x35093e){try{jsonpatch[_0xe032('0x21')](_0x35093e,_0x230656,!![]);}catch(_0x1a159d){return BPromise[_0xe032('0x22')](_0x1a159d);}return _0x35093e[_0xe032('0x23')]();};}function saveUpdates(_0x448e8a,_0x39f019){return function(_0x5e37f9){if(_0x5e37f9){return _0x5e37f9[_0xe032('0x24')](_0x448e8a)['then'](function(_0x3122db){return _0x3122db;});}return null;};}function removeEntity(_0x2b3544,_0x330030){return function(_0x36b8f7){if(_0x36b8f7){return _0x36b8f7[_0xe032('0x25')]()[_0xe032('0x26')](function(){_0x2b3544[_0xe032('0x18')](0xcc)[_0xe032('0x19')]();});}};}function handleEntityNotFound(_0x52db98,_0x4f4cc7){return function(_0x2cf48c){if(!_0x2cf48c){_0x52db98[_0xe032('0x17')](0x194);}return _0x2cf48c;};}function handleError(_0xdbc726,_0x1f1592){_0x1f1592=_0x1f1592||0x1f4;return function(_0x1d83c2){logger['error'](_0x1d83c2[_0xe032('0x27')]);if(_0x1d83c2[_0xe032('0x28')]){delete _0x1d83c2[_0xe032('0x28')];}_0xdbc726['status'](_0x1f1592)[_0xe032('0x29')](_0x1d83c2);};}exports['index']=function(_0x24435d,_0x3c835e){var _0x322c9c={},_0x1911fb={},_0x5f16e8={'count':0x0,'rows':[]};var _0x425e9a=_['map'](db['ZohoField']['rawAttributes'],function(_0x4bfcf2){return{'name':_0x4bfcf2['fieldName'],'type':_0x4bfcf2[_0xe032('0x2a')][_0xe032('0x2b')]};});_0x1911fb[_0xe032('0x2c')]=_['map'](_0x425e9a,'name');_0x1911fb[_0xe032('0x2d')]=_[_0xe032('0x2e')](_0x24435d[_0xe032('0x2d')]);_0x1911fb[_0xe032('0x2f')]=_[_0xe032('0x30')](_0x1911fb[_0xe032('0x2c')],_0x1911fb[_0xe032('0x2d')]);_0x322c9c[_0xe032('0x31')]=_[_0xe032('0x30')](_0x1911fb['model'],qs['fields'](_0x24435d[_0xe032('0x2d')][_0xe032('0x32')]));_0x322c9c['attributes']=_0x322c9c[_0xe032('0x31')][_0xe032('0x33')]?_0x322c9c[_0xe032('0x31')]:_0x1911fb[_0xe032('0x2c')];if(!_0x24435d[_0xe032('0x2d')][_0xe032('0x34')](_0xe032('0x35'))){_0x322c9c[_0xe032('0x1e')]=qs[_0xe032('0x1e')](_0x24435d['query'][_0xe032('0x1e')]);_0x322c9c[_0xe032('0x1b')]=qs[_0xe032('0x1b')](_0x24435d[_0xe032('0x2d')][_0xe032('0x1b')]);}_0x322c9c[_0xe032('0x36')]=qs[_0xe032('0x37')](_0x24435d[_0xe032('0x2d')]['sort']);_0x322c9c['where']=qs[_0xe032('0x2f')](_[_0xe032('0x38')](_0x24435d[_0xe032('0x2d')],_0x1911fb[_0xe032('0x2f')]),_0x425e9a);if(_0x24435d['query'][_0xe032('0x39')]){_0x322c9c[_0xe032('0x3a')]=_[_0xe032('0x3b')](_0x322c9c[_0xe032('0x3a')],{'$or':_[_0xe032('0x3c')](_0x425e9a,function(_0x20e526){if(_0x20e526[_0xe032('0x2a')]!==_0xe032('0x3d')){var _0x5401d3={};_0x5401d3[_0x20e526[_0xe032('0x28')]]={'$like':'%'+_0x24435d['query'][_0xe032('0x39')]+'%'};return _0x5401d3;}})});}_0x322c9c=_[_0xe032('0x3b')]({},_0x322c9c,_0x24435d[_0xe032('0x3e')]);var _0x3fbca0={'where':_0x322c9c[_0xe032('0x3a')]};return db[_0xe032('0x3f')]['count'](_0x3fbca0)[_0xe032('0x26')](function(_0x51f196){_0x5f16e8['count']=_0x51f196;if(_0x24435d[_0xe032('0x2d')]['includeAll']){_0x322c9c[_0xe032('0x40')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x322c9c);})['then'](function(_0x24e0bc){_0x5f16e8[_0xe032('0x41')]=_0x24e0bc;return _0x5f16e8;})[_0xe032('0x26')](respondWithFilteredResult(_0x3c835e,_0x322c9c))[_0xe032('0x42')](handleError(_0x3c835e,null));};exports[_0xe032('0x43')]=function(_0x36d083,_0x13d548){var _0x10523b={'raw':!![],'where':{'id':_0x36d083[_0xe032('0x44')]['id']}},_0x177c47={};_0x177c47[_0xe032('0x2c')]=_[_0xe032('0x2e')](db[_0xe032('0x3f')][_0xe032('0x45')]);_0x177c47[_0xe032('0x2d')]=_[_0xe032('0x2e')](_0x36d083['query']);_0x177c47['filters']=_[_0xe032('0x30')](_0x177c47[_0xe032('0x2c')],_0x177c47[_0xe032('0x2d')]);_0x10523b[_0xe032('0x31')]=_[_0xe032('0x30')](_0x177c47[_0xe032('0x2c')],qs['fields'](_0x36d083[_0xe032('0x2d')][_0xe032('0x32')]));_0x10523b[_0xe032('0x31')]=_0x10523b[_0xe032('0x31')][_0xe032('0x33')]?_0x10523b[_0xe032('0x31')]:_0x177c47[_0xe032('0x2c')];if(_0x36d083[_0xe032('0x2d')]['includeAll']){_0x10523b['include']=[{'all':!![]}];}_0x10523b=_['merge']({},_0x10523b,_0x36d083[_0xe032('0x3e')]);return db['ZohoField'][_0xe032('0x46')](_0x10523b)[_0xe032('0x26')](handleEntityNotFound(_0x13d548,null))[_0xe032('0x26')](respondWithResult(_0x13d548,null))[_0xe032('0x42')](handleError(_0x13d548,null));};exports[_0xe032('0x47')]=function(_0x2941ad,_0x5cecec){return db[_0xe032('0x3f')][_0xe032('0x47')](_0x2941ad[_0xe032('0x48')],{})[_0xe032('0x26')](respondWithResult(_0x5cecec,0xc9))[_0xe032('0x42')](handleError(_0x5cecec,null));};exports['update']=function(_0x523c92,_0x31fd6a){if(_0x523c92[_0xe032('0x48')]['id']){delete _0x523c92[_0xe032('0x48')]['id'];}return db[_0xe032('0x3f')][_0xe032('0x46')]({'where':{'id':_0x523c92[_0xe032('0x44')]['id']}})[_0xe032('0x26')](handleEntityNotFound(_0x31fd6a,null))[_0xe032('0x26')](saveUpdates(_0x523c92[_0xe032('0x48')],null))['then'](respondWithResult(_0x31fd6a,null))[_0xe032('0x42')](handleError(_0x31fd6a,null));};exports['destroy']=function(_0x5dbc05,_0x4a6c59){return db[_0xe032('0x3f')][_0xe032('0x46')]({'where':{'id':_0x5dbc05[_0xe032('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a6c59,null))[_0xe032('0x26')](removeEntity(_0x4a6c59,null))['catch'](handleError(_0x4a6c59,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index afbe08c..078f848 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 _0x2d72=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0x2d72,0xa8));var _0x22d7=function(_0x5637af,_0x70154a){_0x5637af=_0x5637af-0x0;var _0x138f81=_0x2d72[_0x5637af];return _0x138f81;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x22d7('0xe'),_0x22d7('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47c5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZohoField.attributes','exports','define'];(function(_0xb5d42f,_0x586749){var _0x12d255=function(_0x1b1e27){while(--_0x1b1e27){_0xb5d42f['push'](_0xb5d42f['shift']());}};_0x12d255(++_0x586749);}(_0x47c5,0x165));var _0x547c=function(_0x539fef,_0x17f310){_0x539fef=_0x539fef-0x0;var _0x1c9d6f=_0x47c5[_0x539fef];return _0x1c9d6f;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));module[_0x547c('0x9')]=function(_0x51ab7f,_0x2e5b57){return _0x51ab7f[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('0xc'),'paranoid':![],'indexes':[{'name':_0x547c('0xd'),'fields':[_0x547c('0xe'),_0x547c('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 c6a9f7b..9b59bfb 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 _0x3346=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3a4a43,_0x4959e1){var _0x1748ef=function(_0x386c78){while(--_0x386c78){_0x3a4a43['push'](_0x3a4a43['shift']());}};_0x1748ef(++_0x4959e1);}(_0x3346,0xed));var _0x6334=function(_0xbcb0da,_0x222c33){_0xbcb0da=_0xbcb0da-0x0;var _0x237804=_0x3346[_0xbcb0da];return _0x237804;};'use strict';var _=require('lodash');var util=require(_0x6334('0x0'));var moment=require(_0x6334('0x1'));var BPromise=require(_0x6334('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6334('0x3'));var db=require(_0x6334('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6334('0x5'))(_0x6334('0x6'));var config=require(_0x6334('0x7'));var jayson=require(_0x6334('0x8'));var client=jayson['client'][_0x6334('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c1ce9,_0x10f742,_0x5a449a){return new BPromise(function(_0xe13bb7,_0x4b3e9a){return client[_0x6334('0xa')](_0x1c1ce9,_0x5a449a)[_0x6334('0xb')](function(_0x1acb72){logger[_0x6334('0xc')](_0x6334('0xd'),_0x10f742,'request\x20sent');logger[_0x6334('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x10f742,_0x6334('0xf'),JSON[_0x6334('0x10')](_0x1acb72));if(_0x1acb72[_0x6334('0x11')]){if(_0x1acb72['error'][_0x6334('0x12')]===0x1f4){logger[_0x6334('0x11')](_0x6334('0xd'),_0x10f742,_0x1acb72['error'][_0x6334('0x13')]);return _0x4b3e9a(_0x1acb72[_0x6334('0x11')][_0x6334('0x13')]);}logger[_0x6334('0x11')](_0x6334('0xd'),_0x10f742,_0x1acb72[_0x6334('0x11')][_0x6334('0x13')]);return _0xe13bb7(_0x1acb72['error']['message']);}else{logger[_0x6334('0xc')]('ZohoField,\x20%s,\x20%s',_0x10f742,_0x6334('0xf'));_0xe13bb7(_0x1acb72[_0x6334('0x14')][_0x6334('0x13')]);}})[_0x6334('0x15')](function(_0x30a96f){logger[_0x6334('0x11')](_0x6334('0xd'),_0x10f742,_0x30a96f);_0x4b3e9a(_0x30a96f);});});} \ No newline at end of file +var _0x8ece=['then','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZohoField,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0xb61d60,_0x3ecb2b){var _0x5af7be=function(_0x2aa6fa){while(--_0x2aa6fa){_0xb61d60['push'](_0xb61d60['shift']());}};_0x5af7be(++_0x3ecb2b);}(_0x8ece,0xf1));var _0xe8ec=function(_0x23c507,_0x496810){_0x23c507=_0x23c507-0x0;var _0x2e6331=_0x8ece[_0x23c507];return _0x2e6331;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require(_0xe8ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x5'))['db'];var utils=require(_0xe8ec('0x6'));var logger=require(_0xe8ec('0x7'))(_0xe8ec('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x180853,_0x3a00c2,_0x365e57){return new BPromise(function(_0x4a86a9,_0x4a3ec7){return client[_0xe8ec('0xb')](_0x180853,_0x365e57)[_0xe8ec('0xc')](function(_0x47cb6e){logger['info']('ZohoField,\x20%s,\x20%s',_0x3a00c2,'request\x20sent');logger[_0xe8ec('0xd')](_0xe8ec('0xe'),_0x3a00c2,_0xe8ec('0xf'),JSON[_0xe8ec('0x10')](_0x47cb6e));if(_0x47cb6e[_0xe8ec('0x11')]){if(_0x47cb6e['error'][_0xe8ec('0x12')]===0x1f4){logger[_0xe8ec('0x11')]('ZohoField,\x20%s,\x20%s',_0x3a00c2,_0x47cb6e['error'][_0xe8ec('0x13')]);return _0x4a3ec7(_0x47cb6e[_0xe8ec('0x11')]['message']);}logger[_0xe8ec('0x11')](_0xe8ec('0x14'),_0x3a00c2,_0x47cb6e[_0xe8ec('0x11')]['message']);return _0x4a86a9(_0x47cb6e['error'][_0xe8ec('0x13')]);}else{logger[_0xe8ec('0x15')](_0xe8ec('0x14'),_0x3a00c2,_0xe8ec('0xf'));_0x4a86a9(_0x47cb6e['result'][_0xe8ec('0x13')]);}})[_0xe8ec('0x16')](function(_0x9445b2){logger['error'](_0xe8ec('0x14'),_0x3a00c2,_0x9445b2);_0x4a3ec7(_0x9445b2);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 328b845..26d9a70 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4811a5,_0x10c242){var _0x47182b=function(_0xe536a){while(--_0xe536a){_0x4811a5['push'](_0x4811a5['shift']());}};_0x47182b(++_0x10c242);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xcb91[_0x231b2e];return _0x3feb2a;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b9c76,_0x10ca20){var _0x54df50=function(_0x1fdc3a){while(--_0x1fdc3a){_0x2b9c76['push'](_0x2b9c76['shift']());}};_0x54df50(++_0x10ca20);}(_0xe706,0xa3));var _0x6e70=function(_0x37e8e8,_0x1be63e){_0x37e8e8=_0x37e8e8-0x0;var _0x2c3c9e=_0xe706[_0x37e8e8];return _0x2c3c9e;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 382335d..909bf24 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 _0x408a=['app.js','INTEGER','BOOLEAN','exports','STRING'];(function(_0x2d3b0a,_0x21d953){var _0x363102=function(_0x5dddac){while(--_0x5dddac){_0x2d3b0a['push'](_0x2d3b0a['shift']());}};_0x363102(++_0x21d953);}(_0x408a,0x67));var _0xa408=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x408a[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0xa408('0x0')]={'name':{'type':Sequelize[_0xa408('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xa408('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xa408('0x1')],'defaultValue':_0xa408('0x2')},'filename':{'type':Sequelize[_0xa408('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa408('0x1')]},'size':{'type':Sequelize[_0xa408('0x3')]},'active':{'type':Sequelize[_0xa408('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xa408('0x1')]},'logo':{'type':Sequelize[_0xa408('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0xa408('0x1')]},'title':{'type':Sequelize[_0xa408('0x1')]},'remoteUri':{'type':Sequelize[_0xa408('0x1')]},'link':{'type':Sequelize[_0xa408('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xab06=['state','exports','unique_name_and_version','STRING','INTEGER','BOOLEAN'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0xab06,0x1e7));var _0x6ab0=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xab06[_0x2cc569];return _0x1bfc2e;};'use strict';var Sequelize=require('sequelize');module[_0x6ab0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6ab0('0x1')},'version':{'type':Sequelize[_0x6ab0('0x2')],'allowNull':![],'unique':_0x6ab0('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x6ab0('0x2')]},'path':{'type':Sequelize[_0x6ab0('0x2')]},'type':{'type':Sequelize[_0x6ab0('0x2')]},'size':{'type':Sequelize[_0x6ab0('0x3')]},'active':{'type':Sequelize[_0x6ab0('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x6ab0('0x2')]},'state':{'type':Sequelize[_0x6ab0('0x2')],'unique':_0x6ab0('0x5')},'description':{'type':Sequelize[_0x6ab0('0x2')]},'title':{'type':Sequelize[_0x6ab0('0x2')]},'remoteUri':{'type':Sequelize[_0x6ab0('0x2')]},'link':{'type':Sequelize[_0x6ab0('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 4e037b0..653d0b0 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 _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x11aee5,_0x27fa94){var _0x2e8c9d=function(_0x33ff83){while(--_0x33ff83){_0x11aee5['push'](_0x11aee5['shift']());}};_0x2e8c9d(++_0x27fa94);}(_0x4888,0x198));var _0x8488=function(_0x4a0fdd,_0x5da918){_0x4a0fdd=_0x4a0fdd-0x0;var _0x2124c7=_0x4888[_0x4a0fdd];return _0x2124c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));}; \ No newline at end of file +var _0x9536=['includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','Integration','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9536,0x179));var _0x6953=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x9536[_0x470e67];return _0x28bbde;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 57a316f..aaab77a 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 _0xd1fd=['request-promise','path','../../config/environment','exports','lodash','util','api','moment','bluebird'];(function(_0x18168d,_0x47657f){var _0x3e969d=function(_0x4c81a1){while(--_0x4c81a1){_0x18168d['push'](_0x18168d['shift']());}};_0x3e969d(++_0x47657f);}(_0xd1fd,0x1c6));var _0xdd1f=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xd1fd[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0xdd1f('0x0'));var util=require(_0xdd1f('0x1'));var logger=require('../../config/logger')(_0xdd1f('0x2'));var moment=require(_0xdd1f('0x3'));var BPromise=require(_0xdd1f('0x4'));var rp=require(_0xdd1f('0x5'));var fs=require('fs');var path=require(_0xdd1f('0x6'));var rimraf=require('rimraf');var config=require(_0xdd1f('0x7'));var attributes=require('./integration.attributes');module[_0xdd1f('0x8')]=function(_0x30624e,_0x45543b){return _0x30624e['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff11=['rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xff11,0x1ce));var _0x1ff1=function(_0x37b403,_0x3ecacb){_0x37b403=_0x37b403-0x0;var _0x4b4b8a=_0xff11[_0x37b403];return _0x4b4b8a;};'use strict';var _=require(_0x1ff1('0x0'));var util=require('util');var logger=require(_0x1ff1('0x1'))(_0x1ff1('0x2'));var moment=require(_0x1ff1('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ff1('0x4'));var fs=require('fs');var path=require(_0x1ff1('0x5'));var rimraf=require(_0x1ff1('0x6'));var config=require(_0x1ff1('0x7'));var attributes=require(_0x1ff1('0x8'));module[_0x1ff1('0x9')]=function(_0x50a7c6,_0x578a9f){return _0x50a7c6['define'](_0x1ff1('0xa'),attributes,{'tableName':_0x1ff1('0xb'),'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 b41a2a9..2321822 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 _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2d96f1,_0xa647e4){var _0x41a5b0=function(_0x3ca36f){while(--_0x3ca36f){_0x2d96f1['push'](_0x2d96f1['shift']());}};_0x41a5b0(++_0xa647e4);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xa0fe37,_0x713d51){_0xa0fe37=_0xa0fe37-0x0;var _0x459d56=_0xd7d1[_0xa0fe37];return _0x459d56;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file +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(_0xb5fc75,_0x3d4821){var _0x21334d=function(_0x46a551){while(--_0x46a551){_0xb5fc75['push'](_0xb5fc75['shift']());}};_0x21334d(++_0x3d4821);}(_0xdb28,0x106));var _0x8db2=function(_0x59569d,_0x538f3f){_0x59569d=_0x59569d-0x0;var _0x546193=_0xdb28[_0x59569d];return _0x546193;};'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 7efadae..d2384dc 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x249020,_0x26e7ab){var _0x4e9c18=function(_0x112ccd){while(--_0x112ccd){_0x249020['push'](_0x249020['shift']());}};_0x4e9c18(++_0x26e7ab);}(_0x2ef3,0xba));var _0x32ef=function(_0xbf2311,_0x34ce79){_0xbf2311=_0xbf2311-0x0;var _0x340ae6=_0x2ef3[_0xbf2311];return _0x340ae6;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4fc7fc,_0x15e34f){var _0x4d1ff2=function(_0x183ced){while(--_0x183ced){_0x4fc7fc['push'](_0x4fc7fc['shift']());}};_0x4d1ff2(++_0x15e34f);}(_0x4975,0x86));var _0x5497=function(_0x319840,_0x51f79f){_0x319840=_0x319840-0x0;var _0x3b09c9=_0x4975[_0x319840];return _0x3b09c9;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5d1f43d..7bcbfba 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 _0x7b6e=['sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','FAILED'];(function(_0x443ddc,_0x357f02){var _0x395a00=function(_0xad82ca){while(--_0xad82ca){_0x443ddc['push'](_0x443ddc['shift']());}};_0x395a00(++_0x357f02);}(_0x7b6e,0x75));var _0xe7b6=function(_0x9c0817,_0x50058d){_0x9c0817=_0x9c0817-0x0;var _0x396086=_0x7b6e[_0x9c0817];return _0x396086;};'use strict';var Sequelize=require(_0xe7b6('0x0'));module['exports']={'integration':{'type':Sequelize[_0xe7b6('0x1')]},'eventChannel':{'type':Sequelize[_0xe7b6('0x1')]},'exitStatus':{'type':Sequelize[_0xe7b6('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xe7b6('0x2')]},'contacts':{'type':Sequelize[_0xe7b6('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe7b6('0x1')]},'calleridname':{'type':Sequelize[_0xe7b6('0x1')]},'queue':{'type':Sequelize[_0xe7b6('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe7b6('0x1')]},'agentcalledAt':{'type':Sequelize[_0xe7b6('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe7b6('0x3')]},'holdtime':{'type':Sequelize[_0xe7b6('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe7b6('0x3')]},'talktime':{'type':Sequelize[_0xe7b6('0x2')]},'agentacw':{'type':Sequelize[_0xe7b6('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xe7b6('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xe7b6('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe7b6('0x3')]},'agentdump':{'type':Sequelize[_0xe7b6('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe7b6('0x3')]},'lastevent':{'type':Sequelize[_0xe7b6('0x1')]},'channel':{'type':Sequelize[_0xe7b6('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xe7b6('0x1')]},'connectedlinename':{'type':Sequelize[_0xe7b6('0x1')]},'language':{'type':Sequelize[_0xe7b6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe7b6('0x1')]},'exten':{'type':Sequelize[_0xe7b6('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xe7b6('0x1')]},'destchannelstate':{'type':Sequelize[_0xe7b6('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe7b6('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe7b6('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe7b6('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xe7b6('0x1')]},'destaccountcode':{'type':Sequelize[_0xe7b6('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe7b6('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xe7b6('0x1')]},'subject':{'type':Sequelize[_0xe7b6('0x1')]},'from':{'type':Sequelize[_0xe7b6('0x1')]},'to':{'type':Sequelize[_0xe7b6('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xe7b6('0x5')]},'html':{'type':Sequelize[_0xe7b6('0x5')]},'text':{'type':Sequelize[_0xe7b6('0x5')]},'status':{'type':Sequelize['ENUM'](_0xe7b6('0x6'),_0xe7b6('0x7'),'RECEIVED',_0xe7b6('0x8'))},'url':{'type':Sequelize[_0xe7b6('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xe7b6('0x2')]}}; \ No newline at end of file +var _0x7136=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x2a90f8,_0x3d864b){var _0x4d55c0=function(_0x551edc){while(--_0x551edc){_0x2a90f8['push'](_0x2a90f8['shift']());}};_0x4d55c0(++_0x3d864b);}(_0x7136,0x13a));var _0x6713=function(_0x86a8fa,_0x323e96){_0x86a8fa=_0x86a8fa-0x0;var _0x551384=_0x7136[_0x86a8fa];return _0x551384;};'use strict';var Sequelize=require(_0x6713('0x0'));module[_0x6713('0x1')]={'integration':{'type':Sequelize[_0x6713('0x2')]},'eventChannel':{'type':Sequelize[_0x6713('0x2')]},'exitStatus':{'type':Sequelize[_0x6713('0x2')]},'ticketId':{'type':Sequelize[_0x6713('0x2')]},'integrationId':{'type':Sequelize[_0x6713('0x3')]},'contacts':{'type':Sequelize[_0x6713('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6713('0x2')]},'queue':{'type':Sequelize[_0x6713('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6713('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6713('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x6713('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6713('0x4')]},'talktime':{'type':Sequelize[_0x6713('0x3')]},'agentacw':{'type':Sequelize[_0x6713('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6713('0x3')]},'reason':{'type':Sequelize[_0x6713('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6713('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6713('0x4')]},'agentdump':{'type':Sequelize[_0x6713('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6713('0x4')]},'lastevent':{'type':Sequelize[_0x6713('0x2')]},'channel':{'type':Sequelize[_0x6713('0x2')]},'channelstate':{'type':Sequelize[_0x6713('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6713('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6713('0x2')]},'language':{'type':Sequelize[_0x6713('0x2')]},'accountcode':{'type':Sequelize[_0x6713('0x2')]},'context':{'type':Sequelize[_0x6713('0x2')]},'exten':{'type':Sequelize[_0x6713('0x2')]},'priority':{'type':Sequelize[_0x6713('0x2')]},'destchannel':{'type':Sequelize[_0x6713('0x2')]},'destchannelstate':{'type':Sequelize[_0x6713('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6713('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6713('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6713('0x2')]},'destaccountcode':{'type':Sequelize[_0x6713('0x2')]},'destcontext':{'type':Sequelize[_0x6713('0x2')]},'destexten':{'type':Sequelize[_0x6713('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6713('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6713('0x2')]},'from':{'type':Sequelize[_0x6713('0x2')]},'to':{'type':Sequelize[_0x6713('0x2')]},'cc':{'type':Sequelize[_0x6713('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x6713('0x6')]},'text':{'type':Sequelize[_0x6713('0x6')]},'status':{'type':Sequelize[_0x6713('0x7')](_0x6713('0x8'),_0x6713('0x9'),_0x6713('0xa'),_0x6713('0xb'))},'url':{'type':Sequelize[_0x6713('0x2')]},'app':{'type':Sequelize[_0x6713('0x2')]},'appdata':{'type':Sequelize[_0x6713('0x2')]},'projectId':{'type':Sequelize[_0x6713('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 6f85017..6ab8ca2 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 _0x4f26=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','then','end','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','show','params','includeAll','include','create','body','find','catch','describe','eml-format','zip-dir','mustache','util','path'];(function(_0x2b7f56,_0x41bc7d){var _0x36896d=function(_0x551d56){while(--_0x551d56){_0x2b7f56['push'](_0x2b7f56['shift']());}};_0x36896d(++_0x41bc7d);}(_0x4f26,0x1f3));var _0x64f2=function(_0x31823b,_0x29d64d){_0x31823b=_0x31823b-0x0;var _0x1ca861=_0x4f26[_0x31823b];return _0x1ca861;};'use strict';var emlformat=require(_0x64f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x64f2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x64f2('0x2'));var util=require(_0x64f2('0x3'));var path=require(_0x64f2('0x4'));var sox=require(_0x64f2('0x5'));var csv=require(_0x64f2('0x6'));var ejs=require(_0x64f2('0x7'));var fs=require('fs');var fs_extra=require(_0x64f2('0x8'));var _=require(_0x64f2('0x9'));var squel=require('squel');var crypto=require(_0x64f2('0xa'));var jsforce=require(_0x64f2('0xb'));var deskjs=require(_0x64f2('0xc'));var toCsv=require(_0x64f2('0x6'));var querystring=require(_0x64f2('0xd'));var Papa=require(_0x64f2('0xe'));var Redis=require('ioredis');var authService=require(_0x64f2('0xf'));var qs=require(_0x64f2('0x10'));var as=require(_0x64f2('0x11'));var hardwareService=require(_0x64f2('0x12'));var logger=require(_0x64f2('0x13'))(_0x64f2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x64f2('0x15'));var db=require(_0x64f2('0x16'))['db'];function respondWithStatusCode(_0x187f18,_0x23e578){_0x23e578=_0x23e578||0xcc;return function(_0x454aad){if(_0x454aad){return _0x187f18[_0x64f2('0x17')](_0x23e578);}return _0x187f18[_0x64f2('0x18')](_0x23e578)['end']();};}function respondWithResult(_0x2959a9,_0x225900){_0x225900=_0x225900||0xc8;return function(_0x456f17){if(_0x456f17){return _0x2959a9[_0x64f2('0x18')](_0x225900)[_0x64f2('0x19')](_0x456f17);}};}function respondWithFilteredResult(_0x320e6d,_0x41822f){return function(_0x5a7f8f){if(_0x5a7f8f){var _0x4af1dc=typeof _0x41822f[_0x64f2('0x1a')]==='undefined'&&typeof _0x41822f[_0x64f2('0x1b')]===_0x64f2('0x1c');var _0x2cfcd5=_0x5a7f8f[_0x64f2('0x1d')];var _0x20bb6d=_0x4af1dc?0x0:_0x41822f[_0x64f2('0x1a')];var _0x37840c=_0x4af1dc?_0x5a7f8f['count']:_0x41822f[_0x64f2('0x1a')]+_0x41822f['limit'];var _0x48dc00;if(_0x37840c>=_0x2cfcd5){_0x37840c=_0x2cfcd5;_0x48dc00=0xc8;}else{_0x48dc00=0xce;}_0x320e6d['status'](_0x48dc00);return _0x320e6d['set'](_0x64f2('0x1e'),_0x20bb6d+'-'+_0x37840c+'/'+_0x2cfcd5)[_0x64f2('0x19')](_0x5a7f8f);}return null;};}function patchUpdates(_0x1ce8f5){return function(_0x159573){try{jsonpatch['apply'](_0x159573,_0x1ce8f5,!![]);}catch(_0x55d541){return BPromise[_0x64f2('0x1f')](_0x55d541);}return _0x159573['save']();};}function saveUpdates(_0x334e5c,_0x4d04bb){return function(_0x38a807){if(_0x38a807){return _0x38a807[_0x64f2('0x20')](_0x334e5c)['then'](function(_0x13b09a){return _0x13b09a;});}return null;};}function removeEntity(_0xdefcb8,_0x3fe709){return function(_0x3fed76){if(_0x3fed76){return _0x3fed76[_0x64f2('0x21')]()[_0x64f2('0x22')](function(){_0xdefcb8[_0x64f2('0x18')](0xcc)[_0x64f2('0x23')]();});}};}function handleEntityNotFound(_0x38251c,_0x4c367b){return function(_0x3bbdab){if(!_0x3bbdab){_0x38251c['sendStatus'](0x194);}return _0x3bbdab;};}function handleError(_0x10793f,_0x2fef13){_0x2fef13=_0x2fef13||0x1f4;return function(_0x3bb280){logger[_0x64f2('0x24')](_0x3bb280['stack']);if(_0x3bb280['name']){delete _0x3bb280[_0x64f2('0x25')];}_0x10793f[_0x64f2('0x18')](_0x2fef13)[_0x64f2('0x26')](_0x3bb280);};}exports[_0x64f2('0x27')]=function(_0x3e2742,_0x1457d9){var _0x45bc4d={},_0x5dfbe6={},_0xe2c451={'count':0x0,'rows':[]};var _0xcc2b47=_[_0x64f2('0x28')](db[_0x64f2('0x29')][_0x64f2('0x2a')],function(_0x15b673){return{'name':_0x15b673[_0x64f2('0x2b')],'type':_0x15b673['type'][_0x64f2('0x2c')]};});_0x5dfbe6[_0x64f2('0x2d')]=_['map'](_0xcc2b47,'name');_0x5dfbe6[_0x64f2('0x2e')]=_[_0x64f2('0x2f')](_0x3e2742[_0x64f2('0x2e')]);_0x5dfbe6[_0x64f2('0x30')]=_[_0x64f2('0x31')](_0x5dfbe6[_0x64f2('0x2d')],_0x5dfbe6[_0x64f2('0x2e')]);_0x45bc4d[_0x64f2('0x32')]=_[_0x64f2('0x31')](_0x5dfbe6['model'],qs[_0x64f2('0x33')](_0x3e2742['query']['fields']));_0x45bc4d[_0x64f2('0x32')]=_0x45bc4d[_0x64f2('0x32')][_0x64f2('0x34')]?_0x45bc4d[_0x64f2('0x32')]:_0x5dfbe6[_0x64f2('0x2d')];if(!_0x3e2742[_0x64f2('0x2e')][_0x64f2('0x35')](_0x64f2('0x36'))){_0x45bc4d[_0x64f2('0x1b')]=qs['limit'](_0x3e2742['query'][_0x64f2('0x1b')]);_0x45bc4d['offset']=qs['offset'](_0x3e2742[_0x64f2('0x2e')][_0x64f2('0x1a')]);}_0x45bc4d[_0x64f2('0x37')]=qs['sort'](_0x3e2742[_0x64f2('0x2e')][_0x64f2('0x38')]);_0x45bc4d[_0x64f2('0x39')]=qs['filters'](_[_0x64f2('0x3a')](_0x3e2742[_0x64f2('0x2e')],_0x5dfbe6[_0x64f2('0x30')]),_0xcc2b47);if(_0x3e2742[_0x64f2('0x2e')][_0x64f2('0x3b')]){_0x45bc4d['where']=_[_0x64f2('0x3c')](_0x45bc4d['where'],{'$or':_[_0x64f2('0x28')](_0xcc2b47,function(_0x267925){if(_0x267925['type']!=='VIRTUAL'){var _0x560515={};_0x560515[_0x267925[_0x64f2('0x25')]]={'$like':'%'+_0x3e2742[_0x64f2('0x2e')][_0x64f2('0x3b')]+'%'};return _0x560515;}})});}_0x45bc4d=_[_0x64f2('0x3c')]({},_0x45bc4d,_0x3e2742[_0x64f2('0x3d')]);var _0x4d6c38={'where':_0x45bc4d['where']};return db[_0x64f2('0x29')][_0x64f2('0x1d')](_0x4d6c38)[_0x64f2('0x22')](function(_0x52e92b){_0xe2c451[_0x64f2('0x1d')]=_0x52e92b;if(_0x3e2742[_0x64f2('0x2e')]['includeAll']){_0x45bc4d['include']=[{'all':!![]}];}return db[_0x64f2('0x29')]['findAll'](_0x45bc4d);})['then'](function(_0xfda541){_0xe2c451[_0x64f2('0x3e')]=_0xfda541;return _0xe2c451;})['then'](respondWithFilteredResult(_0x1457d9,_0x45bc4d))['catch'](handleError(_0x1457d9,null));};exports[_0x64f2('0x3f')]=function(_0x1fb520,_0x2827b3){var _0x3b2407={'raw':![],'where':{'id':_0x1fb520[_0x64f2('0x40')]['id']}},_0x418cf5={};_0x418cf5[_0x64f2('0x2d')]=_[_0x64f2('0x2f')](db['IntegrationReport'][_0x64f2('0x2a')]);_0x418cf5['query']=_[_0x64f2('0x2f')](_0x1fb520[_0x64f2('0x2e')]);_0x418cf5[_0x64f2('0x30')]=_[_0x64f2('0x31')](_0x418cf5[_0x64f2('0x2d')],_0x418cf5[_0x64f2('0x2e')]);_0x3b2407[_0x64f2('0x32')]=_['intersection'](_0x418cf5[_0x64f2('0x2d')],qs[_0x64f2('0x33')](_0x1fb520[_0x64f2('0x2e')][_0x64f2('0x33')]));_0x3b2407[_0x64f2('0x32')]=_0x3b2407[_0x64f2('0x32')][_0x64f2('0x34')]?_0x3b2407[_0x64f2('0x32')]:_0x418cf5['model'];if(_0x1fb520['query'][_0x64f2('0x41')]){_0x3b2407[_0x64f2('0x42')]=[{'all':!![]}];}_0x3b2407=_[_0x64f2('0x3c')]({},_0x3b2407,_0x1fb520[_0x64f2('0x3d')]);return db[_0x64f2('0x29')]['find'](_0x3b2407)[_0x64f2('0x22')](handleEntityNotFound(_0x2827b3,null))[_0x64f2('0x22')](respondWithResult(_0x2827b3,null))['catch'](handleError(_0x2827b3,null));};exports[_0x64f2('0x43')]=function(_0x404c3e,_0x4a21dc){return db[_0x64f2('0x29')][_0x64f2('0x43')](_0x404c3e[_0x64f2('0x44')],{})[_0x64f2('0x22')](respondWithResult(_0x4a21dc,0xc9))['catch'](handleError(_0x4a21dc,null));};exports['update']=function(_0x1eafd8,_0x38ff4f){if(_0x1eafd8[_0x64f2('0x44')]['id']){delete _0x1eafd8[_0x64f2('0x44')]['id'];}return db[_0x64f2('0x29')][_0x64f2('0x45')]({'where':{'id':_0x1eafd8[_0x64f2('0x40')]['id']}})[_0x64f2('0x22')](handleEntityNotFound(_0x38ff4f,null))[_0x64f2('0x22')](saveUpdates(_0x1eafd8[_0x64f2('0x44')],null))['then'](respondWithResult(_0x38ff4f,null))[_0x64f2('0x46')](handleError(_0x38ff4f,null));};exports[_0x64f2('0x21')]=function(_0x26f340,_0x49ec83){return db['IntegrationReport']['find']({'where':{'id':_0x26f340[_0x64f2('0x40')]['id']}})[_0x64f2('0x22')](handleEntityNotFound(_0x49ec83,null))[_0x64f2('0x22')](removeEntity(_0x49ec83,null))[_0x64f2('0x46')](handleError(_0x49ec83,null));};exports[_0x64f2('0x47')]=function(_0x5a81a2,_0x112469){return db[_0x64f2('0x29')]['describe']()[_0x64f2('0x22')](respondWithResult(_0x112469,null))[_0x64f2('0x46')](handleError(_0x112469,null));}; \ No newline at end of file +var _0xe78b=['../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','findAll','rows','show','params','rawAttributes','includeAll','include','find','catch','create','body','destroy','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xe78b,0x81));var _0xbe78=function(_0x3d9319,_0x390e90){_0x3d9319=_0x3d9319-0x0;var _0x52bc3a=_0xe78b[_0x3d9319];return _0x52bc3a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbe78('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe78('0x1'));var moment=require(_0xbe78('0x2'));var BPromise=require(_0xbe78('0x3'));var Mustache=require(_0xbe78('0x4'));var util=require(_0xbe78('0x5'));var path=require(_0xbe78('0x6'));var sox=require(_0xbe78('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe78('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbe78('0x9'));var jsforce=require(_0xbe78('0xa'));var deskjs=require(_0xbe78('0xb'));var toCsv=require(_0xbe78('0xc'));var querystring=require('querystring');var Papa=require(_0xbe78('0xd'));var Redis=require(_0xbe78('0xe'));var authService=require(_0xbe78('0xf'));var qs=require(_0xbe78('0x10'));var as=require(_0xbe78('0x11'));var hardwareService=require(_0xbe78('0x12'));var logger=require(_0xbe78('0x13'))(_0xbe78('0x14'));var utils=require(_0xbe78('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbe78('0x16'))['db'];function respondWithStatusCode(_0x40aefd,_0x25cd29){_0x25cd29=_0x25cd29||0xcc;return function(_0x220497){if(_0x220497){return _0x40aefd[_0xbe78('0x17')](_0x25cd29);}return _0x40aefd[_0xbe78('0x18')](_0x25cd29)[_0xbe78('0x19')]();};}function respondWithResult(_0x28d0da,_0x322188){_0x322188=_0x322188||0xc8;return function(_0x13c3c9){if(_0x13c3c9){return _0x28d0da[_0xbe78('0x18')](_0x322188)[_0xbe78('0x1a')](_0x13c3c9);}};}function respondWithFilteredResult(_0x116c87,_0x4a2700){return function(_0x3c557b){if(_0x3c557b){var _0x175ad6=typeof _0x4a2700[_0xbe78('0x1b')]===_0xbe78('0x1c')&&typeof _0x4a2700['limit']==='undefined';var _0x220815=_0x3c557b[_0xbe78('0x1d')];var _0x40741e=_0x175ad6?0x0:_0x4a2700[_0xbe78('0x1b')];var _0x2cb854=_0x175ad6?_0x3c557b[_0xbe78('0x1d')]:_0x4a2700['offset']+_0x4a2700['limit'];var _0x4a8d37;if(_0x2cb854>=_0x220815){_0x2cb854=_0x220815;_0x4a8d37=0xc8;}else{_0x4a8d37=0xce;}_0x116c87[_0xbe78('0x18')](_0x4a8d37);return _0x116c87[_0xbe78('0x1e')](_0xbe78('0x1f'),_0x40741e+'-'+_0x2cb854+'/'+_0x220815)[_0xbe78('0x1a')](_0x3c557b);}return null;};}function patchUpdates(_0x1716e5){return function(_0x57c0c4){try{jsonpatch[_0xbe78('0x20')](_0x57c0c4,_0x1716e5,!![]);}catch(_0x2cb599){return BPromise['reject'](_0x2cb599);}return _0x57c0c4[_0xbe78('0x21')]();};}function saveUpdates(_0x2462fb,_0x1f820b){return function(_0x76d823){if(_0x76d823){return _0x76d823[_0xbe78('0x22')](_0x2462fb)[_0xbe78('0x23')](function(_0x50ae21){return _0x50ae21;});}return null;};}function removeEntity(_0x1fca66,_0x489c09){return function(_0x3d0ab0){if(_0x3d0ab0){return _0x3d0ab0['destroy']()[_0xbe78('0x23')](function(){_0x1fca66['status'](0xcc)[_0xbe78('0x19')]();});}};}function handleEntityNotFound(_0x272756,_0x36117c){return function(_0x39657b){if(!_0x39657b){_0x272756[_0xbe78('0x17')](0x194);}return _0x39657b;};}function handleError(_0x1022e3,_0x2eca97){_0x2eca97=_0x2eca97||0x1f4;return function(_0x4d1486){logger[_0xbe78('0x24')](_0x4d1486[_0xbe78('0x25')]);if(_0x4d1486[_0xbe78('0x26')]){delete _0x4d1486[_0xbe78('0x26')];}_0x1022e3[_0xbe78('0x18')](_0x2eca97)[_0xbe78('0x27')](_0x4d1486);};}exports[_0xbe78('0x28')]=function(_0xeb499,_0x21e467){var _0x44c281={},_0x371eb8={},_0x2a2df6={'count':0x0,'rows':[]};var _0x3a09fd=_[_0xbe78('0x29')](db[_0xbe78('0x2a')]['rawAttributes'],function(_0xc38200){return{'name':_0xc38200[_0xbe78('0x2b')],'type':_0xc38200[_0xbe78('0x2c')][_0xbe78('0x2d')]};});_0x371eb8[_0xbe78('0x2e')]=_[_0xbe78('0x29')](_0x3a09fd,_0xbe78('0x26'));_0x371eb8[_0xbe78('0x2f')]=_[_0xbe78('0x30')](_0xeb499[_0xbe78('0x2f')]);_0x371eb8['filters']=_[_0xbe78('0x31')](_0x371eb8[_0xbe78('0x2e')],_0x371eb8[_0xbe78('0x2f')]);_0x44c281[_0xbe78('0x32')]=_['intersection'](_0x371eb8['model'],qs['fields'](_0xeb499['query'][_0xbe78('0x33')]));_0x44c281['attributes']=_0x44c281[_0xbe78('0x32')][_0xbe78('0x34')]?_0x44c281['attributes']:_0x371eb8[_0xbe78('0x2e')];if(!_0xeb499[_0xbe78('0x2f')][_0xbe78('0x35')](_0xbe78('0x36'))){_0x44c281[_0xbe78('0x37')]=qs[_0xbe78('0x37')](_0xeb499[_0xbe78('0x2f')][_0xbe78('0x37')]);_0x44c281[_0xbe78('0x1b')]=qs[_0xbe78('0x1b')](_0xeb499[_0xbe78('0x2f')]['offset']);}_0x44c281[_0xbe78('0x38')]=qs['sort'](_0xeb499[_0xbe78('0x2f')][_0xbe78('0x39')]);_0x44c281[_0xbe78('0x3a')]=qs[_0xbe78('0x3b')](_[_0xbe78('0x3c')](_0xeb499[_0xbe78('0x2f')],_0x371eb8['filters']),_0x3a09fd);if(_0xeb499[_0xbe78('0x2f')][_0xbe78('0x3d')]){_0x44c281[_0xbe78('0x3a')]=_['merge'](_0x44c281[_0xbe78('0x3a')],{'$or':_['map'](_0x3a09fd,function(_0x300d47){if(_0x300d47[_0xbe78('0x2c')]!=='VIRTUAL'){var _0x54713b={};_0x54713b[_0x300d47[_0xbe78('0x26')]]={'$like':'%'+_0xeb499[_0xbe78('0x2f')][_0xbe78('0x3d')]+'%'};return _0x54713b;}})});}_0x44c281=_[_0xbe78('0x3e')]({},_0x44c281,_0xeb499['options']);var _0x1898db={'where':_0x44c281[_0xbe78('0x3a')]};return db[_0xbe78('0x2a')][_0xbe78('0x1d')](_0x1898db)[_0xbe78('0x23')](function(_0x442c06){_0x2a2df6[_0xbe78('0x1d')]=_0x442c06;if(_0xeb499['query']['includeAll']){_0x44c281['include']=[{'all':!![]}];}return db[_0xbe78('0x2a')][_0xbe78('0x3f')](_0x44c281);})[_0xbe78('0x23')](function(_0x2fe69e){_0x2a2df6[_0xbe78('0x40')]=_0x2fe69e;return _0x2a2df6;})[_0xbe78('0x23')](respondWithFilteredResult(_0x21e467,_0x44c281))['catch'](handleError(_0x21e467,null));};exports[_0xbe78('0x41')]=function(_0x4d91c0,_0x29b47a){var _0x4a3e77={'raw':![],'where':{'id':_0x4d91c0[_0xbe78('0x42')]['id']}},_0xcbf378={};_0xcbf378['model']=_[_0xbe78('0x30')](db[_0xbe78('0x2a')][_0xbe78('0x43')]);_0xcbf378[_0xbe78('0x2f')]=_[_0xbe78('0x30')](_0x4d91c0[_0xbe78('0x2f')]);_0xcbf378[_0xbe78('0x3b')]=_[_0xbe78('0x31')](_0xcbf378[_0xbe78('0x2e')],_0xcbf378[_0xbe78('0x2f')]);_0x4a3e77[_0xbe78('0x32')]=_[_0xbe78('0x31')](_0xcbf378[_0xbe78('0x2e')],qs['fields'](_0x4d91c0[_0xbe78('0x2f')]['fields']));_0x4a3e77[_0xbe78('0x32')]=_0x4a3e77['attributes'][_0xbe78('0x34')]?_0x4a3e77[_0xbe78('0x32')]:_0xcbf378[_0xbe78('0x2e')];if(_0x4d91c0[_0xbe78('0x2f')][_0xbe78('0x44')]){_0x4a3e77[_0xbe78('0x45')]=[{'all':!![]}];}_0x4a3e77=_[_0xbe78('0x3e')]({},_0x4a3e77,_0x4d91c0['options']);return db[_0xbe78('0x2a')][_0xbe78('0x46')](_0x4a3e77)[_0xbe78('0x23')](handleEntityNotFound(_0x29b47a,null))[_0xbe78('0x23')](respondWithResult(_0x29b47a,null))[_0xbe78('0x47')](handleError(_0x29b47a,null));};exports['create']=function(_0x3822b9,_0x17f049){return db[_0xbe78('0x2a')][_0xbe78('0x48')](_0x3822b9[_0xbe78('0x49')],{})[_0xbe78('0x23')](respondWithResult(_0x17f049,0xc9))[_0xbe78('0x47')](handleError(_0x17f049,null));};exports[_0xbe78('0x22')]=function(_0x1063fc,_0x497ceb){if(_0x1063fc[_0xbe78('0x49')]['id']){delete _0x1063fc[_0xbe78('0x49')]['id'];}return db[_0xbe78('0x2a')][_0xbe78('0x46')]({'where':{'id':_0x1063fc[_0xbe78('0x42')]['id']}})[_0xbe78('0x23')](handleEntityNotFound(_0x497ceb,null))['then'](saveUpdates(_0x1063fc[_0xbe78('0x49')],null))['then'](respondWithResult(_0x497ceb,null))[_0xbe78('0x47')](handleError(_0x497ceb,null));};exports[_0xbe78('0x4a')]=function(_0x232b68,_0x2db6de){return db[_0xbe78('0x2a')]['find']({'where':{'id':_0x232b68['params']['id']}})[_0xbe78('0x23')](handleEntityNotFound(_0x2db6de,null))['then'](removeEntity(_0x2db6de,null))['catch'](handleError(_0x2db6de,null));};exports['describe']=function(_0x1068e6,_0x670bd1){return db[_0xbe78('0x2a')]['describe']()[_0xbe78('0x23')](respondWithResult(_0x670bd1,null))[_0xbe78('0x47')](handleError(_0x670bd1,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e6a2388..f1b66b9 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 _0x1967=['exports','define','IntegrationReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes'];(function(_0x484d23,_0x3b80e7){var _0x3fec0a=function(_0x387623){while(--_0x387623){_0x484d23['push'](_0x484d23['shift']());}};_0x3fec0a(++_0x3b80e7);}(_0x1967,0x177));var _0x7196=function(_0x113fcd,_0x55c729){_0x113fcd=_0x113fcd-0x0;var _0x2ae322=_0x1967[_0x113fcd];return _0x2ae322;};'use strict';var _=require(_0x7196('0x0'));var util=require('util');var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require('../../config/environment');var attributes=require(_0x7196('0x8'));module[_0x7196('0x9')]=function(_0x740757,_0x4aa5e6){return _0x740757[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x235f=['api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','exports','lodash','util'];(function(_0x536e3a,_0x52e179){var _0x371a90=function(_0x26b7a4){while(--_0x26b7a4){_0x536e3a['push'](_0x536e3a['shift']());}};_0x371a90(++_0x52e179);}(_0x235f,0x134));var _0xf235=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x235f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf235('0x0'));var util=require(_0xf235('0x1'));var logger=require('../../config/logger')(_0xf235('0x2'));var moment=require(_0xf235('0x3'));var BPromise=require(_0xf235('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf235('0x5'));var rimraf=require(_0xf235('0x6'));var config=require(_0xf235('0x7'));var attributes=require(_0xf235('0x8'));module[_0xf235('0x9')]=function(_0x3ba573,_0x1999cf){return _0x3ba573['define']('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index a474e9f..e92e5f7 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 _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x5aadc4,_0x59c02d){var _0x3d2ad2=function(_0x51dae5){while(--_0x51dae5){_0x5aadc4['push'](_0x5aadc4['shift']());}};_0x3d2ad2(++_0x59c02d);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14b170,_0x1339ad){var _0x1be761=function(_0x4026f3){while(--_0x4026f3){_0x14b170['push'](_0x14b170['shift']());}};_0x1be761(++_0x1339ad);}(_0x5fab,0x177));var _0xb5fa=function(_0x5f5c34,_0x23e89){_0x5f5c34=_0x5f5c34-0x0;var _0x48c0a7=_0x5fab[_0x5f5c34];return _0x48c0a7;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d57482e..e218376 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 _0xbe2a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util'];(function(_0x49d5c7,_0x3f77aa){var _0x2f1f5e=function(_0x58d445){while(--_0x58d445){_0x49d5c7['push'](_0x49d5c7['shift']());}};_0x2f1f5e(++_0x3f77aa);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x320b9e,_0x5520eb){_0x320b9e=_0x320b9e-0x0;var _0x537dba=_0xbe2a[_0x320b9e];return _0x537dba;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var fs_extra=require(_0xabe2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xabe2('0x7'));var config=require('../../config/environment');var controller=require(_0xabe2('0x8'));router[_0xabe2('0x9')]('/',auth[_0xabe2('0xa')](),controller[_0xabe2('0xb')]);router[_0xabe2('0x9')](_0xabe2('0xc'),auth['isAuthenticated'](),controller[_0xabe2('0xd')]);router[_0xabe2('0x9')](_0xabe2('0xe'),auth[_0xabe2('0xa')](),controller[_0xabe2('0xf')]);router[_0xabe2('0x10')]('/',auth['isAuthenticated'](),controller[_0xabe2('0x11')]);router[_0xabe2('0x10')](_0xabe2('0xe'),auth['isAuthenticated'](),controller['addInterval']);router['post'](_0xabe2('0x12'),auth['isAuthenticated'](),controller[_0xabe2('0x13')]);router[_0xabe2('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xabe2('0x15')]);router[_0xabe2('0x16')](_0xabe2('0xc'),auth[_0xabe2('0xa')](),controller[_0xabe2('0x17')]);module[_0xabe2('0x18')]=router; \ No newline at end of file +var _0x00b7=['post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','getIntervals'];(function(_0x17e466,_0x245016){var _0x5ab7d1=function(_0x387db1){while(--_0x387db1){_0x17e466['push'](_0x17e466['shift']());}};_0x5ab7d1(++_0x245016);}(_0x00b7,0x13c));var _0x700b=function(_0x3795f0,_0x1b2470){_0x3795f0=_0x3795f0-0x0;var _0x100320=_0x00b7[_0x3795f0];return _0x100320;};'use strict';var multer=require(_0x700b('0x0'));var util=require('util');var path=require(_0x700b('0x1'));var timeout=require(_0x700b('0x2'));var express=require(_0x700b('0x3'));var router=express[_0x700b('0x4')]();var fs_extra=require(_0x700b('0x5'));var auth=require(_0x700b('0x6'));var interaction=require(_0x700b('0x7'));var config=require(_0x700b('0x8'));var controller=require('./interval.controller');router['get']('/',auth[_0x700b('0x9')](),controller['index']);router['get'](_0x700b('0xa'),auth[_0x700b('0x9')](),controller[_0x700b('0xb')]);router[_0x700b('0xc')]('/:id/sub_intervals',auth[_0x700b('0x9')](),controller[_0x700b('0xd')]);router[_0x700b('0xe')]('/',auth[_0x700b('0x9')](),controller['create']);router[_0x700b('0xe')](_0x700b('0xf'),auth[_0x700b('0x9')](),controller[_0x700b('0x10')]);router[_0x700b('0xe')](_0x700b('0x11'),auth[_0x700b('0x9')](),controller[_0x700b('0x12')]);router[_0x700b('0x13')]('/:id',auth[_0x700b('0x9')](),controller['update']);router[_0x700b('0x14')]('/:id',auth[_0x700b('0x9')](),controller[_0x700b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 3ae5f56..5d60be9 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 _0x3334=['sequelize','STRING'];(function(_0x483e77,_0x433e9b){var _0x359df0=function(_0x3c3d57){while(--_0x3c3d57){_0x483e77['push'](_0x483e77['shift']());}};_0x359df0(++_0x433e9b);}(_0x3334,0x94));var _0x4333=function(_0x3fdf2b,_0x2b8890){_0x3fdf2b=_0x3fdf2b-0x0;var _0x22078d=_0x3334[_0x3fdf2b];return _0x22078d;};'use strict';var Sequelize=require(_0x4333('0x0'));module['exports']={'name':{'type':Sequelize[_0x4333('0x1')]},'description':{'type':Sequelize[_0x4333('0x1')]},'interval':{'type':Sequelize[_0x4333('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x38e9=['sequelize','exports','STRING'];(function(_0x51543d,_0x204989){var _0x4a62cb=function(_0x369871){while(--_0x369871){_0x51543d['push'](_0x51543d['shift']());}};_0x4a62cb(++_0x204989);}(_0x38e9,0x189));var _0x938e=function(_0x44c844,_0x1e3d7d){_0x44c844=_0x44c844-0x0;var _0x1d51b7=_0x38e9[_0x44c844];return _0x1d51b7;};'use strict';var Sequelize=require(_0x938e('0x0'));module[_0x938e('0x1')]={'name':{'type':Sequelize[_0x938e('0x2')]},'description':{'type':Sequelize[_0x938e('0x2')]},'interval':{'type':Sequelize[_0x938e('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 38e8802..cded21c 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 _0x4efe=['includeAll','include','rows','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addInterval','IntervalId','findOne','getIntervals','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Interval'];(function(_0x3b020e,_0x3ee30a){var _0x45d673=function(_0x207275){while(--_0x207275){_0x3b020e['push'](_0x3b020e['shift']());}};_0x45d673(++_0x3ee30a);}(_0x4efe,0x1d8));var _0xe4ef=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x4efe[_0x4cc492];return _0x1f36b9;};'use strict';var emlformat=require(_0xe4ef('0x0'));var rimraf=require(_0xe4ef('0x1'));var zipdir=require(_0xe4ef('0x2'));var jsonpatch=require(_0xe4ef('0x3'));var rp=require(_0xe4ef('0x4'));var moment=require(_0xe4ef('0x5'));var BPromise=require(_0xe4ef('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe4ef('0x7'));var sox=require(_0xe4ef('0x8'));var csv=require(_0xe4ef('0x9'));var ejs=require(_0xe4ef('0xa'));var fs=require('fs');var fs_extra=require(_0xe4ef('0xb'));var _=require(_0xe4ef('0xc'));var squel=require('squel');var crypto=require(_0xe4ef('0xd'));var jsforce=require(_0xe4ef('0xe'));var deskjs=require(_0xe4ef('0xf'));var toCsv=require(_0xe4ef('0x9'));var querystring=require(_0xe4ef('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4ef('0x11'));var authService=require(_0xe4ef('0x12'));var qs=require(_0xe4ef('0x13'));var as=require(_0xe4ef('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe4ef('0x15'));var utils=require(_0xe4ef('0x16'));var config=require(_0xe4ef('0x17'));var licenseUtil=require(_0xe4ef('0x18'));var db=require(_0xe4ef('0x19'))['db'];var extensions=require(_0xe4ef('0x1a'));function respondWithStatusCode(_0x25e96d,_0x50f607){_0x50f607=_0x50f607||0xcc;return function(_0x3d9e59){if(_0x3d9e59){return _0x25e96d[_0xe4ef('0x1b')](_0x50f607);}return _0x25e96d[_0xe4ef('0x1c')](_0x50f607)[_0xe4ef('0x1d')]();};}function respondWithResult(_0x457ab5,_0x2d35e0){_0x2d35e0=_0x2d35e0||0xc8;return function(_0x2c652b){if(_0x2c652b){return _0x457ab5['status'](_0x2d35e0)[_0xe4ef('0x1e')](_0x2c652b);}};}function respondWithFilteredResult(_0x205272,_0x13a631){return function(_0x478939){if(_0x478939){var _0x43c786=typeof _0x13a631[_0xe4ef('0x1f')]===_0xe4ef('0x20')&&typeof _0x13a631['limit']===_0xe4ef('0x20');var _0xf5b1f8=_0x478939[_0xe4ef('0x21')];var _0x18d790=_0x43c786?0x0:_0x13a631['offset'];var _0x43ffab=_0x43c786?_0x478939[_0xe4ef('0x21')]:_0x13a631[_0xe4ef('0x1f')]+_0x13a631[_0xe4ef('0x22')];var _0x4be3c5;if(_0x43ffab>=_0xf5b1f8){_0x43ffab=_0xf5b1f8;_0x4be3c5=0xc8;}else{_0x4be3c5=0xce;}_0x205272['status'](_0x4be3c5);return _0x205272['set']('Content-Range',_0x18d790+'-'+_0x43ffab+'/'+_0xf5b1f8)[_0xe4ef('0x1e')](_0x478939);}return null;};}function patchUpdates(_0x382544){return function(_0x58869b){try{jsonpatch[_0xe4ef('0x23')](_0x58869b,_0x382544,!![]);}catch(_0x12230c){return BPromise['reject'](_0x12230c);}return _0x58869b[_0xe4ef('0x24')]();};}function saveUpdates(_0x5e1a3e,_0x25b62c){return function(_0x40c9e8){if(_0x40c9e8){return _0x40c9e8[_0xe4ef('0x25')](_0x5e1a3e)[_0xe4ef('0x26')](function(_0x1a0441){return _0x1a0441;});}return null;};}function removeEntity(_0x30f286,_0x36e37f){return function(_0x1234ae){if(_0x1234ae){return _0x1234ae[_0xe4ef('0x27')]()[_0xe4ef('0x26')](function(){var _0x331e5e=_0x1234ae['get']({'plain':!![]});var _0x4006b1=_0xe4ef('0x28');return db[_0xe4ef('0x29')]['destroy']({'where':{'type':_0x4006b1,'resourceId':_0x331e5e['id']}})[_0xe4ef('0x26')](function(){return _0x1234ae;});})[_0xe4ef('0x26')](function(){_0x30f286['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x595259,_0x13344e){return function(_0x42d712){if(!_0x42d712){_0x595259[_0xe4ef('0x1b')](0x194);}return _0x42d712;};}function handleError(_0x344552,_0x1e5852){_0x1e5852=_0x1e5852||0x1f4;return function(_0x1243db){logger[_0xe4ef('0x2a')](_0x1243db[_0xe4ef('0x2b')]);if(_0x1243db[_0xe4ef('0x2c')]){delete _0x1243db[_0xe4ef('0x2c')];}_0x344552[_0xe4ef('0x1c')](_0x1e5852)[_0xe4ef('0x2d')](_0x1243db);};}exports[_0xe4ef('0x2e')]=function(_0x4b3075,_0x5e1e69){var _0x38f464={},_0x4718db={},_0x4e4fab={'count':0x0,'rows':[]};var _0x10fbab=_['map'](db['Interval'][_0xe4ef('0x2f')],function(_0x333b21){return{'name':_0x333b21[_0xe4ef('0x30')],'type':_0x333b21[_0xe4ef('0x31')]['key']};});_0x4718db[_0xe4ef('0x32')]=_[_0xe4ef('0x33')](_0x10fbab,_0xe4ef('0x2c'));_0x4718db[_0xe4ef('0x34')]=_['keys'](_0x4b3075[_0xe4ef('0x34')]);_0x4718db[_0xe4ef('0x35')]=_[_0xe4ef('0x36')](_0x4718db[_0xe4ef('0x32')],_0x4718db[_0xe4ef('0x34')]);_0x38f464[_0xe4ef('0x37')]=_[_0xe4ef('0x36')](_0x4718db[_0xe4ef('0x32')],qs[_0xe4ef('0x38')](_0x4b3075[_0xe4ef('0x34')][_0xe4ef('0x38')]));_0x38f464[_0xe4ef('0x37')]=_0x38f464[_0xe4ef('0x37')][_0xe4ef('0x39')]?_0x38f464[_0xe4ef('0x37')]:_0x4718db[_0xe4ef('0x32')];if(!_0x4b3075[_0xe4ef('0x34')][_0xe4ef('0x3a')](_0xe4ef('0x3b'))){_0x38f464['limit']=qs[_0xe4ef('0x22')](_0x4b3075[_0xe4ef('0x34')][_0xe4ef('0x22')]);_0x38f464[_0xe4ef('0x1f')]=qs[_0xe4ef('0x1f')](_0x4b3075[_0xe4ef('0x34')][_0xe4ef('0x1f')]);}_0x38f464[_0xe4ef('0x3c')]=qs[_0xe4ef('0x3d')](_0x4b3075[_0xe4ef('0x34')][_0xe4ef('0x3d')]);_0x38f464[_0xe4ef('0x3e')]=qs['filters'](_[_0xe4ef('0x3f')](_0x4b3075[_0xe4ef('0x34')],_0x4718db[_0xe4ef('0x35')]),_0x10fbab);if(_0x4b3075['query']['filter']){_0x38f464[_0xe4ef('0x3e')]=_['merge'](_0x38f464['where'],{'$or':_['map'](_0x10fbab,function(_0x2ce562){if(_0x2ce562['type']!=='VIRTUAL'){var _0x5a41bc={};_0x5a41bc[_0x2ce562[_0xe4ef('0x2c')]]={'$like':'%'+_0x4b3075['query'][_0xe4ef('0x40')]+'%'};return _0x5a41bc;}})});}_0x38f464=_[_0xe4ef('0x41')]({},_0x38f464,_0x4b3075[_0xe4ef('0x42')]);var _0x4f8167={'where':_0x38f464[_0xe4ef('0x3e')]};return db[_0xe4ef('0x43')][_0xe4ef('0x21')](_0x4f8167)['then'](function(_0x5bef7f){_0x4e4fab[_0xe4ef('0x21')]=_0x5bef7f;if(_0x4b3075[_0xe4ef('0x34')][_0xe4ef('0x44')]){_0x38f464[_0xe4ef('0x45')]=[{'all':!![]}];}return db[_0xe4ef('0x43')]['findAll'](_0x38f464);})[_0xe4ef('0x26')](function(_0x3f878f){_0x4e4fab[_0xe4ef('0x46')]=_0x3f878f;return _0x4e4fab;})[_0xe4ef('0x26')](respondWithFilteredResult(_0x5e1e69,_0x38f464))[_0xe4ef('0x47')](handleError(_0x5e1e69,null));};exports['show']=function(_0x1e239e,_0x3b6fda){var _0x3908fb={'raw':!![],'where':{'id':_0x1e239e[_0xe4ef('0x48')]['id']}},_0x14414c={};_0x14414c[_0xe4ef('0x32')]=_[_0xe4ef('0x49')](db['Interval'][_0xe4ef('0x2f')]);_0x14414c['query']=_[_0xe4ef('0x49')](_0x1e239e[_0xe4ef('0x34')]);_0x14414c['filters']=_[_0xe4ef('0x36')](_0x14414c[_0xe4ef('0x32')],_0x14414c[_0xe4ef('0x34')]);_0x3908fb[_0xe4ef('0x37')]=_[_0xe4ef('0x36')](_0x14414c[_0xe4ef('0x32')],qs['fields'](_0x1e239e[_0xe4ef('0x34')][_0xe4ef('0x38')]));_0x3908fb[_0xe4ef('0x37')]=_0x3908fb[_0xe4ef('0x37')][_0xe4ef('0x39')]?_0x3908fb[_0xe4ef('0x37')]:_0x14414c[_0xe4ef('0x32')];if(_0x1e239e[_0xe4ef('0x34')]['includeAll']){_0x3908fb[_0xe4ef('0x45')]=[{'all':!![]}];}_0x3908fb=_[_0xe4ef('0x41')]({},_0x3908fb,_0x1e239e[_0xe4ef('0x42')]);return db['Interval']['find'](_0x3908fb)[_0xe4ef('0x26')](handleEntityNotFound(_0x3b6fda,null))[_0xe4ef('0x26')](respondWithResult(_0x3b6fda,null))[_0xe4ef('0x47')](handleError(_0x3b6fda,null));};exports[_0xe4ef('0x4a')]=function(_0xd1ff3e,_0x232414){return db[_0xe4ef('0x43')][_0xe4ef('0x4a')](_0xd1ff3e[_0xe4ef('0x4b')],{})[_0xe4ef('0x26')](function(_0x2a7623){var _0xe679da=_0xd1ff3e[_0xe4ef('0x4c')]['get']({'plain':!![]});if(!_0xe679da)throw new Error(_0xe4ef('0x4d'));if(_0xe679da[_0xe4ef('0x4e')]===_0xe4ef('0x4c')){var _0x3840e4=_0x2a7623['get']({'plain':!![]});var _0x1a97d8=_0xe4ef('0x28');return db[_0xe4ef('0x4f')]['find']({'where':{'name':_0x1a97d8,'userProfileId':_0xe679da[_0xe4ef('0x50')]},'raw':!![]})[_0xe4ef('0x26')](function(_0x37deb9){if(_0x37deb9&&_0x37deb9[_0xe4ef('0x51')]===0x0){return db[_0xe4ef('0x29')][_0xe4ef('0x4a')]({'name':_0x3840e4[_0xe4ef('0x2c')],'resourceId':_0x3840e4['id'],'type':_0x37deb9[_0xe4ef('0x2c')],'sectionId':_0x37deb9['id']},{})['then'](function(){return _0x2a7623;});}else{return _0x2a7623;}})[_0xe4ef('0x47')](function(_0x51c08c){logger[_0xe4ef('0x2a')](_0xe4ef('0x52'),_0x51c08c);throw _0x51c08c;});}return _0x2a7623;})['then'](respondWithResult(_0x232414,0xc9))[_0xe4ef('0x47')](handleError(_0x232414,null));};exports[_0xe4ef('0x25')]=function(_0x459436,_0x1bdeb9){if(_0x459436[_0xe4ef('0x4b')]['id']){delete _0x459436[_0xe4ef('0x4b')]['id'];}return db[_0xe4ef('0x43')]['find']({'where':{'id':_0x459436[_0xe4ef('0x48')]['id']}})[_0xe4ef('0x26')](handleEntityNotFound(_0x1bdeb9,null))['then'](saveUpdates(_0x459436[_0xe4ef('0x4b')],null))[_0xe4ef('0x26')](respondWithResult(_0x1bdeb9,null))['catch'](handleError(_0x1bdeb9,null));};exports[_0xe4ef('0x27')]=function(_0x1a0672,_0x33e0df){return db[_0xe4ef('0x43')][_0xe4ef('0x53')]({'where':{'id':_0x1a0672['params']['id']}})['then'](handleEntityNotFound(_0x33e0df,null))[_0xe4ef('0x26')](removeEntity(_0x33e0df,null))[_0xe4ef('0x47')](handleError(_0x33e0df,null));};exports[_0xe4ef('0x54')]=function(_0x4d8165,_0x2a8249,_0x7e8e75){if(_0x4d8165[_0xe4ef('0x4b')]['id']){delete _0x4d8165[_0xe4ef('0x4b')]['id'];}return db[_0xe4ef('0x43')][_0xe4ef('0x53')]({'where':{'id':_0x4d8165['params']['id']}})[_0xe4ef('0x26')](handleEntityNotFound(_0x2a8249,null))[_0xe4ef('0x26')](function(_0x289638){if(_0x289638){_0x4d8165[_0xe4ef('0x4b')][_0xe4ef('0x55')]=_0x289638['id'];return db[_0xe4ef('0x43')][_0xe4ef('0x4a')](_0x4d8165[_0xe4ef('0x4b')]);}})[_0xe4ef('0x26')](respondWithResult(_0x2a8249,null))[_0xe4ef('0x47')](handleError(_0x2a8249,null));};exports['getIntervals']=function(_0x52e34e,_0x5829c4,_0x3017bc){var _0x375c4d={};var _0x407603={};var _0x340669;var _0x51d1f1;return db[_0xe4ef('0x43')][_0xe4ef('0x56')]({'where':{'id':_0x52e34e[_0xe4ef('0x48')]['id']}})[_0xe4ef('0x26')](handleEntityNotFound(_0x5829c4,null))[_0xe4ef('0x26')](function(_0x24a73c){if(_0x24a73c){_0x340669=_0x24a73c;_0x407603[_0xe4ef('0x32')]=_[_0xe4ef('0x49')](db[_0xe4ef('0x43')][_0xe4ef('0x2f')]);_0x407603[_0xe4ef('0x34')]=_[_0xe4ef('0x49')](_0x52e34e[_0xe4ef('0x34')]);_0x407603[_0xe4ef('0x35')]=_[_0xe4ef('0x36')](_0x407603[_0xe4ef('0x32')],_0x407603[_0xe4ef('0x34')]);_0x375c4d[_0xe4ef('0x37')]=_[_0xe4ef('0x36')](_0x407603['model'],qs['fields'](_0x52e34e['query'][_0xe4ef('0x38')]));_0x375c4d[_0xe4ef('0x37')]=_0x375c4d[_0xe4ef('0x37')]['length']?_0x375c4d['attributes']:_0x407603['model'];_0x375c4d[_0xe4ef('0x3c')]=qs['sort'](_0x52e34e[_0xe4ef('0x34')][_0xe4ef('0x3d')]);_0x375c4d['where']=qs[_0xe4ef('0x35')](_[_0xe4ef('0x3f')](_0x52e34e[_0xe4ef('0x34')],_0x407603[_0xe4ef('0x35')]));if(_0x52e34e[_0xe4ef('0x34')]['filter']){_0x375c4d[_0xe4ef('0x3e')]=_[_0xe4ef('0x41')](_0x375c4d[_0xe4ef('0x3e')],{'$or':_[_0xe4ef('0x33')](_0x375c4d[_0xe4ef('0x37')],function(_0x20dc05){var _0xacc81b={};_0xacc81b[_0x20dc05]={'$like':'%'+_0x52e34e[_0xe4ef('0x34')][_0xe4ef('0x40')]+'%'};return _0xacc81b;})});}_0x375c4d=_[_0xe4ef('0x41')]({},_0x375c4d,_0x52e34e[_0xe4ef('0x42')]);return _0x340669['getIntervals'](_0x375c4d);}})[_0xe4ef('0x26')](function(_0xd896e){if(_0xd896e){_0x51d1f1=_0xd896e[_0xe4ef('0x39')];if(!_0x52e34e[_0xe4ef('0x34')]['hasOwnProperty']('nolimit')){_0x375c4d[_0xe4ef('0x22')]=qs[_0xe4ef('0x22')](_0x52e34e[_0xe4ef('0x34')]['limit']);_0x375c4d[_0xe4ef('0x1f')]=qs[_0xe4ef('0x1f')](_0x52e34e[_0xe4ef('0x34')][_0xe4ef('0x1f')]);}return _0x340669[_0xe4ef('0x57')](_0x375c4d);}})[_0xe4ef('0x26')](function(_0x497f11){if(_0x497f11){return _0x497f11?{'count':_0x51d1f1,'rows':_0x497f11}:null;}})[_0xe4ef('0x26')](respondWithResult(_0x5829c4,null))[_0xe4ef('0x47')](handleError(_0x5829c4,null));};exports['addIntervals']=function(_0x5d2519,_0x3fdf98,_0x492896){return db[_0xe4ef('0x43')][_0xe4ef('0x56')]({'where':{'id':_0x5d2519[_0xe4ef('0x48')]['id']}})[_0xe4ef('0x26')](handleEntityNotFound(_0x3fdf98,null))['then'](function(_0x2f0ea6){if(_0x2f0ea6){return db[_0xe4ef('0x58')]['transaction'](function(_0x2d3a91){return db[_0xe4ef('0x43')][_0xe4ef('0x27')]({'where':{'IntervalId':_0x5d2519[_0xe4ef('0x48')]['id']},'transaction':_0x2d3a91})[_0xe4ef('0x26')](function(_0x2a7fca){var _0x53296e=_[_0xe4ef('0x33')](_0x5d2519[_0xe4ef('0x4b')],function(_0x432392){delete _0x432392['id'];_0x432392['IntervalId']=_0x5d2519['params']['id'];return _0x432392;});return db[_0xe4ef('0x43')][_0xe4ef('0x59')](_0x53296e,{'transaction':_0x2d3a91});});})[_0xe4ef('0x26')](function(){return db[_0xe4ef('0x43')]['findAll']({'where':{'IntervalId':_0x5d2519[_0xe4ef('0x48')]['id']}});});}})[_0xe4ef('0x26')](respondWithResult(_0x3fdf98,null))[_0xe4ef('0x47')](handleError(_0x3fdf98,null));}; \ No newline at end of file +var _0x3575=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','Intervals','destroy','error','stack','name','send','index','map','Interval','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','include','catch','show','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','addInterval','IntervalId','getIntervals','findOne','options','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x3575,0x1c5));var _0x5357=function(_0x4dc974,_0x275684){_0x4dc974=_0x4dc974-0x0;var _0x1b6b44=_0x3575[_0x4dc974];return _0x1b6b44;};'use strict';var emlformat=require(_0x5357('0x0'));var rimraf=require(_0x5357('0x1'));var zipdir=require(_0x5357('0x2'));var jsonpatch=require(_0x5357('0x3'));var rp=require(_0x5357('0x4'));var moment=require(_0x5357('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5357('0x6'));var util=require(_0x5357('0x7'));var path=require(_0x5357('0x8'));var sox=require(_0x5357('0x9'));var csv=require(_0x5357('0xa'));var ejs=require(_0x5357('0xb'));var fs=require('fs');var fs_extra=require(_0x5357('0xc'));var _=require(_0x5357('0xd'));var squel=require(_0x5357('0xe'));var crypto=require(_0x5357('0xf'));var jsforce=require(_0x5357('0x10'));var deskjs=require(_0x5357('0x11'));var toCsv=require(_0x5357('0xa'));var querystring=require(_0x5357('0x12'));var Papa=require(_0x5357('0x13'));var Redis=require(_0x5357('0x14'));var authService=require(_0x5357('0x15'));var qs=require(_0x5357('0x16'));var as=require(_0x5357('0x17'));var hardwareService=require(_0x5357('0x18'));var logger=require('../../config/logger')(_0x5357('0x19'));var utils=require(_0x5357('0x1a'));var config=require(_0x5357('0x1b'));var licenseUtil=require(_0x5357('0x1c'));var db=require(_0x5357('0x1d'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x135741,_0x207145){_0x207145=_0x207145||0xcc;return function(_0x2d56f7){if(_0x2d56f7){return _0x135741[_0x5357('0x1e')](_0x207145);}return _0x135741[_0x5357('0x1f')](_0x207145)[_0x5357('0x20')]();};}function respondWithResult(_0x267e72,_0x11f4d9){_0x11f4d9=_0x11f4d9||0xc8;return function(_0x546835){if(_0x546835){return _0x267e72['status'](_0x11f4d9)[_0x5357('0x21')](_0x546835);}};}function respondWithFilteredResult(_0x4fa5fd,_0x452786){return function(_0x2daa12){if(_0x2daa12){var _0x5d3f91=typeof _0x452786['offset']===_0x5357('0x22')&&typeof _0x452786[_0x5357('0x23')]===_0x5357('0x22');var _0x31e1ad=_0x2daa12[_0x5357('0x24')];var _0xc3e8ba=_0x5d3f91?0x0:_0x452786[_0x5357('0x25')];var _0x20367c=_0x5d3f91?_0x2daa12[_0x5357('0x24')]:_0x452786[_0x5357('0x25')]+_0x452786['limit'];var _0x32f8b9;if(_0x20367c>=_0x31e1ad){_0x20367c=_0x31e1ad;_0x32f8b9=0xc8;}else{_0x32f8b9=0xce;}_0x4fa5fd[_0x5357('0x1f')](_0x32f8b9);return _0x4fa5fd[_0x5357('0x26')]('Content-Range',_0xc3e8ba+'-'+_0x20367c+'/'+_0x31e1ad)[_0x5357('0x21')](_0x2daa12);}return null;};}function patchUpdates(_0x2d2f36){return function(_0x25aec0){try{jsonpatch['apply'](_0x25aec0,_0x2d2f36,!![]);}catch(_0x2b3a07){return BPromise[_0x5357('0x27')](_0x2b3a07);}return _0x25aec0[_0x5357('0x28')]();};}function saveUpdates(_0x5e4142,_0x5a3bad){return function(_0xda6041){if(_0xda6041){return _0xda6041[_0x5357('0x29')](_0x5e4142)['then'](function(_0x3c1675){return _0x3c1675;});}return null;};}function removeEntity(_0x16d299,_0x371828){return function(_0x1977a2){if(_0x1977a2){return _0x1977a2['destroy']()[_0x5357('0x2a')](function(){var _0x2052f1=_0x1977a2['get']({'plain':!![]});var _0x3cd915=_0x5357('0x2b');return db['UserProfileResource'][_0x5357('0x2c')]({'where':{'type':_0x3cd915,'resourceId':_0x2052f1['id']}})[_0x5357('0x2a')](function(){return _0x1977a2;});})[_0x5357('0x2a')](function(){_0x16d299[_0x5357('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c320a,_0x23ee24){return function(_0x28de59){if(!_0x28de59){_0x2c320a[_0x5357('0x1e')](0x194);}return _0x28de59;};}function handleError(_0x152ed1,_0xc9b852){_0xc9b852=_0xc9b852||0x1f4;return function(_0x2d9ab7){logger[_0x5357('0x2d')](_0x2d9ab7[_0x5357('0x2e')]);if(_0x2d9ab7[_0x5357('0x2f')]){delete _0x2d9ab7[_0x5357('0x2f')];}_0x152ed1['status'](_0xc9b852)[_0x5357('0x30')](_0x2d9ab7);};}exports[_0x5357('0x31')]=function(_0x26be90,_0x383ebb){var _0x154bef={},_0x469e38={},_0x1aefe2={'count':0x0,'rows':[]};var _0x3fc74f=_[_0x5357('0x32')](db[_0x5357('0x33')]['rawAttributes'],function(_0x538f35){return{'name':_0x538f35[_0x5357('0x34')],'type':_0x538f35[_0x5357('0x35')][_0x5357('0x36')]};});_0x469e38['model']=_[_0x5357('0x32')](_0x3fc74f,_0x5357('0x2f'));_0x469e38[_0x5357('0x37')]=_[_0x5357('0x38')](_0x26be90[_0x5357('0x37')]);_0x469e38[_0x5357('0x39')]=_[_0x5357('0x3a')](_0x469e38[_0x5357('0x3b')],_0x469e38[_0x5357('0x37')]);_0x154bef['attributes']=_[_0x5357('0x3a')](_0x469e38['model'],qs[_0x5357('0x3c')](_0x26be90['query'][_0x5357('0x3c')]));_0x154bef[_0x5357('0x3d')]=_0x154bef[_0x5357('0x3d')][_0x5357('0x3e')]?_0x154bef[_0x5357('0x3d')]:_0x469e38[_0x5357('0x3b')];if(!_0x26be90[_0x5357('0x37')][_0x5357('0x3f')](_0x5357('0x40'))){_0x154bef[_0x5357('0x23')]=qs[_0x5357('0x23')](_0x26be90[_0x5357('0x37')][_0x5357('0x23')]);_0x154bef[_0x5357('0x25')]=qs[_0x5357('0x25')](_0x26be90[_0x5357('0x37')]['offset']);}_0x154bef[_0x5357('0x41')]=qs[_0x5357('0x42')](_0x26be90['query']['sort']);_0x154bef['where']=qs[_0x5357('0x39')](_['pick'](_0x26be90[_0x5357('0x37')],_0x469e38[_0x5357('0x39')]),_0x3fc74f);if(_0x26be90[_0x5357('0x37')][_0x5357('0x43')]){_0x154bef[_0x5357('0x44')]=_['merge'](_0x154bef[_0x5357('0x44')],{'$or':_[_0x5357('0x32')](_0x3fc74f,function(_0x48d9c4){if(_0x48d9c4[_0x5357('0x35')]!==_0x5357('0x45')){var _0x25d0f7={};_0x25d0f7[_0x48d9c4[_0x5357('0x2f')]]={'$like':'%'+_0x26be90[_0x5357('0x37')]['filter']+'%'};return _0x25d0f7;}})});}_0x154bef=_[_0x5357('0x46')]({},_0x154bef,_0x26be90['options']);var _0x292e99={'where':_0x154bef[_0x5357('0x44')]};return db[_0x5357('0x33')][_0x5357('0x24')](_0x292e99)[_0x5357('0x2a')](function(_0x27daf2){_0x1aefe2[_0x5357('0x24')]=_0x27daf2;if(_0x26be90[_0x5357('0x37')][_0x5357('0x47')]){_0x154bef[_0x5357('0x48')]=[{'all':!![]}];}return db[_0x5357('0x33')]['findAll'](_0x154bef);})[_0x5357('0x2a')](function(_0x4b4e16){_0x1aefe2['rows']=_0x4b4e16;return _0x1aefe2;})[_0x5357('0x2a')](respondWithFilteredResult(_0x383ebb,_0x154bef))[_0x5357('0x49')](handleError(_0x383ebb,null));};exports[_0x5357('0x4a')]=function(_0x39cbb4,_0x3d71d2){var _0x2ea659={'raw':!![],'where':{'id':_0x39cbb4['params']['id']}},_0x16147e={};_0x16147e[_0x5357('0x3b')]=_[_0x5357('0x38')](db['Interval'][_0x5357('0x4b')]);_0x16147e[_0x5357('0x37')]=_[_0x5357('0x38')](_0x39cbb4[_0x5357('0x37')]);_0x16147e[_0x5357('0x39')]=_[_0x5357('0x3a')](_0x16147e[_0x5357('0x3b')],_0x16147e[_0x5357('0x37')]);_0x2ea659[_0x5357('0x3d')]=_[_0x5357('0x3a')](_0x16147e[_0x5357('0x3b')],qs[_0x5357('0x3c')](_0x39cbb4[_0x5357('0x37')][_0x5357('0x3c')]));_0x2ea659[_0x5357('0x3d')]=_0x2ea659['attributes'][_0x5357('0x3e')]?_0x2ea659[_0x5357('0x3d')]:_0x16147e[_0x5357('0x3b')];if(_0x39cbb4[_0x5357('0x37')][_0x5357('0x47')]){_0x2ea659[_0x5357('0x48')]=[{'all':!![]}];}_0x2ea659=_[_0x5357('0x46')]({},_0x2ea659,_0x39cbb4['options']);return db[_0x5357('0x33')]['find'](_0x2ea659)['then'](handleEntityNotFound(_0x3d71d2,null))[_0x5357('0x2a')](respondWithResult(_0x3d71d2,null))[_0x5357('0x49')](handleError(_0x3d71d2,null));};exports['create']=function(_0xb47b2d,_0x4d0ccb){return db[_0x5357('0x33')][_0x5357('0x4c')](_0xb47b2d[_0x5357('0x4d')],{})[_0x5357('0x2a')](function(_0x2be8aa){var _0x1d1b9f=_0xb47b2d['user'][_0x5357('0x4e')]({'plain':!![]});if(!_0x1d1b9f)throw new Error(_0x5357('0x4f'));if(_0x1d1b9f[_0x5357('0x50')]===_0x5357('0x51')){var _0x2f9eb3=_0x2be8aa[_0x5357('0x4e')]({'plain':!![]});var _0x59976e=_0x5357('0x2b');return db[_0x5357('0x52')][_0x5357('0x53')]({'where':{'name':_0x59976e,'userProfileId':_0x1d1b9f[_0x5357('0x54')]},'raw':!![]})['then'](function(_0x54b560){if(_0x54b560&&_0x54b560[_0x5357('0x55')]===0x0){return db[_0x5357('0x56')][_0x5357('0x4c')]({'name':_0x2f9eb3[_0x5357('0x2f')],'resourceId':_0x2f9eb3['id'],'type':_0x54b560['name'],'sectionId':_0x54b560['id']},{})[_0x5357('0x2a')](function(){return _0x2be8aa;});}else{return _0x2be8aa;}})[_0x5357('0x49')](function(_0x31fce9){logger[_0x5357('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31fce9);throw _0x31fce9;});}return _0x2be8aa;})[_0x5357('0x2a')](respondWithResult(_0x4d0ccb,0xc9))[_0x5357('0x49')](handleError(_0x4d0ccb,null));};exports[_0x5357('0x29')]=function(_0x506db1,_0x248637){if(_0x506db1['body']['id']){delete _0x506db1['body']['id'];}return db['Interval'][_0x5357('0x53')]({'where':{'id':_0x506db1['params']['id']}})[_0x5357('0x2a')](handleEntityNotFound(_0x248637,null))[_0x5357('0x2a')](saveUpdates(_0x506db1[_0x5357('0x4d')],null))['then'](respondWithResult(_0x248637,null))[_0x5357('0x49')](handleError(_0x248637,null));};exports[_0x5357('0x2c')]=function(_0x5ee13d,_0x61972){return db[_0x5357('0x33')]['find']({'where':{'id':_0x5ee13d[_0x5357('0x57')]['id']}})['then'](handleEntityNotFound(_0x61972,null))[_0x5357('0x2a')](removeEntity(_0x61972,null))[_0x5357('0x49')](handleError(_0x61972,null));};exports[_0x5357('0x58')]=function(_0x1ec379,_0x2ffdcd,_0x3e9548){if(_0x1ec379[_0x5357('0x4d')]['id']){delete _0x1ec379[_0x5357('0x4d')]['id'];}return db[_0x5357('0x33')][_0x5357('0x53')]({'where':{'id':_0x1ec379['params']['id']}})[_0x5357('0x2a')](handleEntityNotFound(_0x2ffdcd,null))[_0x5357('0x2a')](function(_0x1b9bbd){if(_0x1b9bbd){_0x1ec379[_0x5357('0x4d')][_0x5357('0x59')]=_0x1b9bbd['id'];return db[_0x5357('0x33')][_0x5357('0x4c')](_0x1ec379[_0x5357('0x4d')]);}})[_0x5357('0x2a')](respondWithResult(_0x2ffdcd,null))['catch'](handleError(_0x2ffdcd,null));};exports[_0x5357('0x5a')]=function(_0x4eebc1,_0x4aef60,_0x22068e){var _0x4954fa={};var _0x23e4e4={};var _0x914d22;var _0x2dac51;return db[_0x5357('0x33')][_0x5357('0x5b')]({'where':{'id':_0x4eebc1[_0x5357('0x57')]['id']}})[_0x5357('0x2a')](handleEntityNotFound(_0x4aef60,null))[_0x5357('0x2a')](function(_0x25eae0){if(_0x25eae0){_0x914d22=_0x25eae0;_0x23e4e4[_0x5357('0x3b')]=_[_0x5357('0x38')](db['Interval'][_0x5357('0x4b')]);_0x23e4e4[_0x5357('0x37')]=_[_0x5357('0x38')](_0x4eebc1[_0x5357('0x37')]);_0x23e4e4[_0x5357('0x39')]=_['intersection'](_0x23e4e4['model'],_0x23e4e4[_0x5357('0x37')]);_0x4954fa[_0x5357('0x3d')]=_[_0x5357('0x3a')](_0x23e4e4[_0x5357('0x3b')],qs[_0x5357('0x3c')](_0x4eebc1[_0x5357('0x37')]['fields']));_0x4954fa[_0x5357('0x3d')]=_0x4954fa[_0x5357('0x3d')][_0x5357('0x3e')]?_0x4954fa[_0x5357('0x3d')]:_0x23e4e4[_0x5357('0x3b')];_0x4954fa[_0x5357('0x41')]=qs[_0x5357('0x42')](_0x4eebc1[_0x5357('0x37')][_0x5357('0x42')]);_0x4954fa['where']=qs[_0x5357('0x39')](_['pick'](_0x4eebc1[_0x5357('0x37')],_0x23e4e4[_0x5357('0x39')]));if(_0x4eebc1[_0x5357('0x37')][_0x5357('0x43')]){_0x4954fa['where']=_[_0x5357('0x46')](_0x4954fa[_0x5357('0x44')],{'$or':_['map'](_0x4954fa[_0x5357('0x3d')],function(_0x8e238b){var _0x423b6b={};_0x423b6b[_0x8e238b]={'$like':'%'+_0x4eebc1[_0x5357('0x37')]['filter']+'%'};return _0x423b6b;})});}_0x4954fa=_[_0x5357('0x46')]({},_0x4954fa,_0x4eebc1[_0x5357('0x5c')]);return _0x914d22[_0x5357('0x5a')](_0x4954fa);}})[_0x5357('0x2a')](function(_0x346dc1){if(_0x346dc1){_0x2dac51=_0x346dc1['length'];if(!_0x4eebc1[_0x5357('0x37')][_0x5357('0x3f')](_0x5357('0x40'))){_0x4954fa['limit']=qs['limit'](_0x4eebc1[_0x5357('0x37')][_0x5357('0x23')]);_0x4954fa[_0x5357('0x25')]=qs[_0x5357('0x25')](_0x4eebc1[_0x5357('0x37')][_0x5357('0x25')]);}return _0x914d22[_0x5357('0x5a')](_0x4954fa);}})[_0x5357('0x2a')](function(_0x241719){if(_0x241719){return _0x241719?{'count':_0x2dac51,'rows':_0x241719}:null;}})['then'](respondWithResult(_0x4aef60,null))[_0x5357('0x49')](handleError(_0x4aef60,null));};exports[_0x5357('0x5d')]=function(_0x5a2883,_0x54e644,_0x313c9e){return db[_0x5357('0x33')][_0x5357('0x5b')]({'where':{'id':_0x5a2883[_0x5357('0x57')]['id']}})[_0x5357('0x2a')](handleEntityNotFound(_0x54e644,null))[_0x5357('0x2a')](function(_0x1e93e7){if(_0x1e93e7){return db['sequelize'][_0x5357('0x5e')](function(_0x52e04c){return db['Interval'][_0x5357('0x2c')]({'where':{'IntervalId':_0x5a2883[_0x5357('0x57')]['id']},'transaction':_0x52e04c})['then'](function(_0x16f308){var _0x3945a9=_[_0x5357('0x32')](_0x5a2883[_0x5357('0x4d')],function(_0x1ecbab){delete _0x1ecbab['id'];_0x1ecbab[_0x5357('0x59')]=_0x5a2883['params']['id'];return _0x1ecbab;});return db[_0x5357('0x33')][_0x5357('0x5f')](_0x3945a9,{'transaction':_0x52e04c});});})['then'](function(){return db[_0x5357('0x33')]['findAll']({'where':{'IntervalId':_0x5a2883[_0x5357('0x57')]['id']}});});}})['then'](respondWithResult(_0x54e644,null))[_0x5357('0x49')](handleError(_0x54e644,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 5311eb2..de5a04d 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 _0x7f11=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','util'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x7f11,0x10c));var _0x17f1=function(_0x35183e,_0x3cc77f){_0x35183e=_0x35183e-0x0;var _0x3a21c5=_0x7f11[_0x35183e];return _0x3a21c5;};'use strict';var _=require(_0x17f1('0x0'));var util=require(_0x17f1('0x1'));var logger=require(_0x17f1('0x2'))(_0x17f1('0x3'));var moment=require(_0x17f1('0x4'));var BPromise=require(_0x17f1('0x5'));var rp=require(_0x17f1('0x6'));var fs=require('fs');var path=require(_0x17f1('0x7'));var rimraf=require(_0x17f1('0x8'));var config=require('../../config/environment');var attributes=require(_0x17f1('0x9'));var extensions=require(_0x17f1('0xa'));module[_0x17f1('0xb')]=function(_0x19ed7a,_0x3729cb){return _0x19ed7a['define'](_0x17f1('0xc'),attributes,{'tableName':_0x17f1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x26754e,_0x50f99c){extensions['rewrite'](_0x19ed7a,_0x26754e);},'afterBulkCreate':function(_0x3d3478,_0x49e681,_0x24c077){_0x24c077();extensions['rewrite'](_0x19ed7a,_0x3d3478[0x0]);},'afterUpdate':function(_0x4bfe89,_0x287bd7){extensions[_0x17f1('0xe')](_0x19ed7a,_0x4bfe89);},'afterDestroy':function(_0x14210b,_0x1662a2){extensions['rewrite'](_0x19ed7a,_0x14210b);}}});}; \ No newline at end of file +var _0x887a=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','Interval','rewrite'];(function(_0x14eb39,_0x6850e8){var _0x35923f=function(_0xe3276a){while(--_0xe3276a){_0x14eb39['push'](_0x14eb39['shift']());}};_0x35923f(++_0x6850e8);}(_0x887a,0x186));var _0xa887=function(_0x4f7f16,_0x2e0123){_0x4f7f16=_0x4f7f16-0x0;var _0x3612a1=_0x887a[_0x4f7f16];return _0x3612a1;};'use strict';var _=require(_0xa887('0x0'));var util=require('util');var logger=require(_0xa887('0x1'))(_0xa887('0x2'));var moment=require(_0xa887('0x3'));var BPromise=require(_0xa887('0x4'));var rp=require(_0xa887('0x5'));var fs=require('fs');var path=require(_0xa887('0x6'));var rimraf=require(_0xa887('0x7'));var config=require(_0xa887('0x8'));var attributes=require(_0xa887('0x9'));var extensions=require(_0xa887('0xa'));module['exports']=function(_0x3a0a2d,_0x660e78){return _0x3a0a2d['define'](_0xa887('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1048b2,_0x3da47b){extensions[_0xa887('0xc')](_0x3a0a2d,_0x1048b2);},'afterBulkCreate':function(_0x1dc804,_0x2abfba,_0x48d440){_0x48d440();extensions['rewrite'](_0x3a0a2d,_0x1dc804[0x0]);},'afterUpdate':function(_0x228bd0,_0x4bbb57){extensions[_0xa887('0xc')](_0x3a0a2d,_0x228bd0);},'afterDestroy':function(_0x485d47,_0x26c80b){extensions['rewrite'](_0x3a0a2d,_0x485d47);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6e96d67..135554d 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(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 6a86e33..ce61c4a 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x2725cb,_0x4af1c9){var _0xf4bac1=function(_0x454ce9){while(--_0x454ce9){_0x2725cb['push'](_0x2725cb['shift']());}};_0xf4bac1(++_0x4af1c9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x51f40e,_0x14e8ea){_0x51f40e=_0x51f40e-0x0;var _0xb37761=_0x5f2f[_0x51f40e];return _0xb37761;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x3e9416,_0x19b129){var _0x3b2898=function(_0x534c58){while(--_0x534c58){_0x3e9416['push'](_0x3e9416['shift']());}};_0x3b2898(++_0x19b129);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18a425,_0x2522bb){_0x18a425=_0x18a425-0x0;var _0x20c778=_0x5f2f[_0x18a425];return _0x20c778;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 84a5993..12ac763 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 _0xf84d=['name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503'];(function(_0x12ad86,_0x13f2c2){var _0x2e37fb=function(_0x116e07){while(--_0x116e07){_0x12ad86['push'](_0x12ad86['shift']());}};_0x2e37fb(++_0x13f2c2);}(_0xf84d,0x16d));var _0xdf84=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0xf84d[_0x4226d6];return _0x19655b;};'use strict';var BPromise=require(_0xdf84('0x0'));var https=require(_0xdf84('0x1'));var logger=require('../../config/logger')(_0xdf84('0x2'));var USERNAME=_0xdf84('0x3');var PASSWORD=_0xdf84('0x4');function openIssue(_0x47253e,_0x4f1268){var _0x32873d={'fields':{'project':{'key':_0x47253e[_0xdf84('0x5')]||_0xdf84('0x6')},'summary':(_0x47253e[_0xdf84('0x7')]||'Report')+_0xdf84('0x8')+_0x47253e['ip'],'description':_0x47253e['description']||JSON['stringify'](_0x47253e),'issuetype':{'name':_0x47253e[_0xdf84('0x9')]||_0xdf84('0xa')}}};_0x32873d[_0xdf84('0xb')][_0xdf84('0xc')]=_0x47253e[_0xdf84('0xd')];_0x32873d[_0xdf84('0xb')][_0xdf84('0xe')]=_0x47253e[_0xdf84('0xf')];_0x32873d[_0xdf84('0xb')][_0xdf84('0x10')]=_0x47253e[_0xdf84('0x11')];_0x32873d[_0xdf84('0xb')][_0xdf84('0x12')]=_0x47253e[_0xdf84('0x13')];_0x32873d[_0xdf84('0xb')][_0xdf84('0x14')]=_0x47253e[_0xdf84('0x15')];_0x32873d['fields'][_0xdf84('0x16')]=_0x47253e['ip'];var _0x57339e={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0xdf84('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xdf84('0x18'),'Authorization':_0xdf84('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xdf84('0x1a')](_0xdf84('0x1b'))}};var _0x5ef5ce=JSON[_0xdf84('0x1c')](_0x32873d);var _0x174a77=https[_0xdf84('0x1d')](_0x57339e,function(_0x4c01ba){_0x4c01ba[_0xdf84('0x1e')](_0xdf84('0x1f'));var _0x4522f7='';_0x4c01ba['on'](_0xdf84('0x20'),function(_0x149f35){_0x4522f7+=_0x149f35;});_0x4c01ba['on'](_0xdf84('0x21'),function(){if(_0x4f1268){return _0x4f1268[_0xdf84('0x22')](_0x4c01ba[_0xdf84('0x23')])[_0xdf84('0x24')](JSON[_0xdf84('0x25')](_0x4522f7));}});});_0x174a77['on'](_0xdf84('0x26'),function(_0x30e5f7){if(_0x4f1268){return _0x4f1268[_0xdf84('0x22')](0x1f4)[_0xdf84('0x24')]({'errors':[{'message':_0xdf84('0x27'),'type':'api.jira'}]});}});_0x174a77[_0xdf84('0x28')](_0x5ef5ce);_0x174a77[_0xdf84('0x21')]();}exports[_0xdf84('0x29')]=openIssue;exports[_0xdf84('0x2a')]=function(_0x5e1aac,_0x558cb0){_0x5e1aac[_0xdf84('0x2b')]['ip']=_0x5e1aac[_0xdf84('0x2c')][_0xdf84('0x2d')]||_0x5e1aac[_0xdf84('0x2e')][_0xdf84('0x2f')]||_0x5e1aac['socket'][_0xdf84('0x2f')]||_0x5e1aac[_0xdf84('0x2e')]['socket'][_0xdf84('0x2f')];return openIssue(_0x5e1aac[_0xdf84('0x2b')],_0x558cb0);}; \ No newline at end of file +var _0xad5d=['issuetype','fields','customfield_11500','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','x-forwarded-for','socket','remoteAddress','connection','body','https','../../config/logger','api','support','3eAmWpBVP0','summary','\x20from\x20','description','stringify'];(function(_0x125789,_0xc6d4c9){var _0x5d6d4d=function(_0x4712fd){while(--_0x4712fd){_0x125789['push'](_0x125789['shift']());}};_0x5d6d4d(++_0xc6d4c9);}(_0xad5d,0x1af));var _0xdad5=function(_0x3dd90c,_0x22430c){_0x3dd90c=_0x3dd90c-0x0;var _0x451eee=_0xad5d[_0x3dd90c];return _0x451eee;};'use strict';var BPromise=require('bluebird');var https=require(_0xdad5('0x0'));var logger=require(_0xdad5('0x1'))(_0xdad5('0x2'));var USERNAME=_0xdad5('0x3');var PASSWORD=_0xdad5('0x4');function openIssue(_0x4bca13,_0x2b3c25){var _0x5d6537={'fields':{'project':{'key':_0x4bca13['key']||'MOTGUI'},'summary':(_0x4bca13[_0xdad5('0x5')]||'Report')+_0xdad5('0x6')+_0x4bca13['ip'],'description':_0x4bca13[_0xdad5('0x7')]||JSON[_0xdad5('0x8')](_0x4bca13),'issuetype':{'name':_0x4bca13[_0xdad5('0x9')]||'Bug'}}};_0x5d6537[_0xdad5('0xa')][_0xdad5('0xb')]=_0x4bca13['email'];_0x5d6537['fields']['customfield_11501']=_0x4bca13[_0xdad5('0xc')];_0x5d6537['fields'][_0xdad5('0xd')]=_0x4bca13[_0xdad5('0xe')];_0x5d6537[_0xdad5('0xa')][_0xdad5('0xf')]=_0x4bca13[_0xdad5('0x10')];_0x5d6537['fields'][_0xdad5('0x11')]=_0x4bca13[_0xdad5('0x12')];_0x5d6537[_0xdad5('0xa')][_0xdad5('0x13')]=_0x4bca13['ip'];var _0x1fa57f={'host':_0xdad5('0x14'),'port':0x1bb,'path':_0xdad5('0x15'),'method':_0xdad5('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xdad5('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xdad5('0x18')](_0xdad5('0x19'))}};var _0x5b7081=JSON['stringify'](_0x5d6537);var _0x35d963=https[_0xdad5('0x1a')](_0x1fa57f,function(_0x57fc21){_0x57fc21['setEncoding'](_0xdad5('0x1b'));var _0x81024a='';_0x57fc21['on']('data',function(_0x38174e){_0x81024a+=_0x38174e;});_0x57fc21['on'](_0xdad5('0x1c'),function(){if(_0x2b3c25){return _0x2b3c25[_0xdad5('0x1d')](_0x57fc21[_0xdad5('0x1e')])[_0xdad5('0x1f')](JSON[_0xdad5('0x20')](_0x81024a));}});});_0x35d963['on'](_0xdad5('0x21'),function(_0x4716f5){if(_0x2b3c25){return _0x2b3c25[_0xdad5('0x1d')](0x1f4)[_0xdad5('0x1f')]({'errors':[{'message':_0xdad5('0x22'),'type':_0xdad5('0x23')}]});}});_0x35d963[_0xdad5('0x24')](_0x5b7081);_0x35d963[_0xdad5('0x1c')]();}exports[_0xdad5('0x25')]=openIssue;exports[_0xdad5('0x26')]=function(_0x52cf33,_0x385156){_0x52cf33['body']['ip']=_0x52cf33['headers'][_0xdad5('0x27')]||_0x52cf33['connection']['remoteAddress']||_0x52cf33[_0xdad5('0x28')][_0xdad5('0x29')]||_0x52cf33[_0xdad5('0x2a')][_0xdad5('0x28')][_0xdad5('0x29')];return openIssue(_0x52cf33[_0xdad5('0x2b')],_0x385156);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3bb3bd6..9f1d6e2 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 _0xe14d=['isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x31c794,_0x123270){var _0xeeaedb=function(_0x2a3755){while(--_0x2a3755){_0x31c794['push'](_0x31c794['shift']());}};_0xeeaedb(++_0x123270);}(_0xe14d,0x1ee));var _0xde14=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xe14d[_0x31cb5f];return _0x586042;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/describe',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0xf')]('/',auth[_0xde14('0xa')](),controller['create']);router[_0xde14('0x10')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x11')]);router[_0xde14('0x12')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x49ee32,_0x5b3c04){var _0x109a4d=function(_0x115a0a){while(--_0x115a0a){_0x49ee32['push'](_0x49ee32['shift']());}};_0x109a4d(++_0x5b3c04);}(_0xedd9,0xfc));var _0x9edd=function(_0x334574,_0x1b7eb7){_0x334574=_0x334574-0x0;var _0x282909=_0xedd9[_0x334574];return _0x282909;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router['delete'](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x13')]);module[_0x9edd('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 04787f0..5f0c1d5 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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x15ffc4,_0x6f2d1){_0x15ffc4=_0x15ffc4-0x0;var _0x7dadae=_0x7a54[_0x15ffc4];return _0x7dadae;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7a54,0x106));var _0x47a5=function(_0x10293f,_0x4f4b31){_0x10293f=_0x10293f-0x0;var _0x560a36=_0x7a54[_0x10293f];return _0x560a36;};'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 86428a2..950ec0d 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 _0x7676=['name','send','map','JscriptyAnswerReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7676,0xb8));var _0x6767=function(_0x310505,_0x2e0004){_0x310505=_0x310505-0x0;var _0x294153=_0x7676[_0x310505];return _0x294153;};'use strict';var emlformat=require(_0x6767('0x0'));var rimraf=require(_0x6767('0x1'));var zipdir=require(_0x6767('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6767('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6767('0x4'));var util=require('util');var path=require(_0x6767('0x5'));var sox=require(_0x6767('0x6'));var csv=require(_0x6767('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6767('0x8'));var _=require(_0x6767('0x9'));var squel=require(_0x6767('0xa'));var crypto=require('crypto');var jsforce=require(_0x6767('0xb'));var deskjs=require(_0x6767('0xc'));var toCsv=require(_0x6767('0x7'));var querystring=require(_0x6767('0xd'));var Papa=require(_0x6767('0xe'));var Redis=require(_0x6767('0xf'));var authService=require(_0x6767('0x10'));var qs=require(_0x6767('0x11'));var as=require(_0x6767('0x12'));var hardwareService=require(_0x6767('0x13'));var logger=require(_0x6767('0x14'))(_0x6767('0x15'));var utils=require('../../config/utils');var config=require(_0x6767('0x16'));var licenseUtil=require(_0x6767('0x17'));var db=require(_0x6767('0x18'))['db'];function respondWithStatusCode(_0x4968aa,_0x532c43){_0x532c43=_0x532c43||0xcc;return function(_0xb167cf){if(_0xb167cf){return _0x4968aa[_0x6767('0x19')](_0x532c43);}return _0x4968aa['status'](_0x532c43)[_0x6767('0x1a')]();};}function respondWithResult(_0x37db3f,_0x51f1b0){_0x51f1b0=_0x51f1b0||0xc8;return function(_0x259320){if(_0x259320){return _0x37db3f[_0x6767('0x1b')](_0x51f1b0)[_0x6767('0x1c')](_0x259320);}};}function respondWithFilteredResult(_0x4079c7,_0x549d80){return function(_0x428d2c){if(_0x428d2c){var _0x49b65f=typeof _0x549d80[_0x6767('0x1d')]===_0x6767('0x1e')&&typeof _0x549d80[_0x6767('0x1f')]==='undefined';var _0x2ee252=_0x428d2c['count'];var _0x9ac747=_0x49b65f?0x0:_0x549d80['offset'];var _0x3c309f=_0x49b65f?_0x428d2c['count']:_0x549d80['offset']+_0x549d80[_0x6767('0x1f')];var _0x29359f;if(_0x3c309f>=_0x2ee252){_0x3c309f=_0x2ee252;_0x29359f=0xc8;}else{_0x29359f=0xce;}_0x4079c7['status'](_0x29359f);return _0x4079c7[_0x6767('0x20')](_0x6767('0x21'),_0x9ac747+'-'+_0x3c309f+'/'+_0x2ee252)['json'](_0x428d2c);}return null;};}function patchUpdates(_0x2f5350){return function(_0x4a89c5){try{jsonpatch[_0x6767('0x22')](_0x4a89c5,_0x2f5350,!![]);}catch(_0x51e14e){return BPromise['reject'](_0x51e14e);}return _0x4a89c5[_0x6767('0x23')]();};}function saveUpdates(_0x414e94,_0xa88d6d){return function(_0x5caf8e){if(_0x5caf8e){return _0x5caf8e[_0x6767('0x24')](_0x414e94)[_0x6767('0x25')](function(_0x2bd141){return _0x2bd141;});}return null;};}function removeEntity(_0x378246,_0x315b29){return function(_0x2dace2){if(_0x2dace2){return _0x2dace2[_0x6767('0x26')]()[_0x6767('0x25')](function(){_0x378246[_0x6767('0x1b')](0xcc)[_0x6767('0x1a')]();});}};}function handleEntityNotFound(_0x2a0116,_0x20094e){return function(_0x5c4d0f){if(!_0x5c4d0f){_0x2a0116[_0x6767('0x19')](0x194);}return _0x5c4d0f;};}function handleError(_0x3219d7,_0xc06b4e){_0xc06b4e=_0xc06b4e||0x1f4;return function(_0x58a738){logger[_0x6767('0x27')](_0x58a738[_0x6767('0x28')]);if(_0x58a738['name']){delete _0x58a738[_0x6767('0x29')];}_0x3219d7[_0x6767('0x1b')](_0xc06b4e)[_0x6767('0x2a')](_0x58a738);};}exports['index']=function(_0x373da7,_0x254bf1){var _0xd64868={},_0x428d5f={},_0x58a347={'count':0x0,'rows':[]};var _0x6457af=_[_0x6767('0x2b')](db[_0x6767('0x2c')]['rawAttributes'],function(_0xe9228a){return{'name':_0xe9228a[_0x6767('0x2d')],'type':_0xe9228a['type'][_0x6767('0x2e')]};});_0x428d5f['model']=_[_0x6767('0x2b')](_0x6457af,_0x6767('0x29'));_0x428d5f[_0x6767('0x2f')]=_['keys'](_0x373da7[_0x6767('0x2f')]);_0x428d5f[_0x6767('0x30')]=_[_0x6767('0x31')](_0x428d5f[_0x6767('0x32')],_0x428d5f[_0x6767('0x2f')]);_0xd64868[_0x6767('0x33')]=_[_0x6767('0x31')](_0x428d5f[_0x6767('0x32')],qs[_0x6767('0x34')](_0x373da7['query'][_0x6767('0x34')]));_0xd64868[_0x6767('0x33')]=_0xd64868['attributes'][_0x6767('0x35')]?_0xd64868[_0x6767('0x33')]:_0x428d5f[_0x6767('0x32')];if(!_0x373da7[_0x6767('0x2f')][_0x6767('0x36')]('nolimit')){_0xd64868['limit']=qs[_0x6767('0x1f')](_0x373da7[_0x6767('0x2f')][_0x6767('0x1f')]);_0xd64868[_0x6767('0x1d')]=qs[_0x6767('0x1d')](_0x373da7[_0x6767('0x2f')]['offset']);}_0xd64868[_0x6767('0x37')]=qs[_0x6767('0x38')](_0x373da7[_0x6767('0x2f')][_0x6767('0x38')]);_0xd64868[_0x6767('0x39')]=qs['filters'](_[_0x6767('0x3a')](_0x373da7[_0x6767('0x2f')],_0x428d5f[_0x6767('0x30')]),_0x6457af);if(_0x373da7[_0x6767('0x2f')][_0x6767('0x3b')]){_0xd64868[_0x6767('0x39')]=_[_0x6767('0x3c')](_0xd64868[_0x6767('0x39')],{'$or':_[_0x6767('0x2b')](_0x6457af,function(_0x642c86){if(_0x642c86[_0x6767('0x3d')]!==_0x6767('0x3e')){var _0x42db53={};_0x42db53[_0x642c86['name']]={'$like':'%'+_0x373da7['query'][_0x6767('0x3b')]+'%'};return _0x42db53;}})});}_0xd64868=_['merge']({},_0xd64868,_0x373da7[_0x6767('0x3f')]);var _0x19f408={'where':_0xd64868[_0x6767('0x39')]};return db[_0x6767('0x2c')][_0x6767('0x40')](_0x19f408)[_0x6767('0x25')](function(_0x3c0eb4){_0x58a347[_0x6767('0x40')]=_0x3c0eb4;if(_0x373da7[_0x6767('0x2f')]['includeAll']){_0xd64868[_0x6767('0x41')]=[{'all':!![]}];}return db[_0x6767('0x2c')][_0x6767('0x42')](_0xd64868);})[_0x6767('0x25')](function(_0x164b5c){_0x58a347['rows']=_0x164b5c;return _0x58a347;})[_0x6767('0x25')](respondWithFilteredResult(_0x254bf1,_0xd64868))[_0x6767('0x43')](handleError(_0x254bf1,null));};exports[_0x6767('0x44')]=function(_0x248ecd,_0x3a2c23){var _0x37e1f6={'raw':!![],'where':{'id':_0x248ecd[_0x6767('0x45')]['id']}},_0x8a6bca={};_0x8a6bca['model']=_[_0x6767('0x46')](db[_0x6767('0x2c')]['rawAttributes']);_0x8a6bca[_0x6767('0x2f')]=_[_0x6767('0x46')](_0x248ecd[_0x6767('0x2f')]);_0x8a6bca[_0x6767('0x30')]=_[_0x6767('0x31')](_0x8a6bca[_0x6767('0x32')],_0x8a6bca['query']);_0x37e1f6[_0x6767('0x33')]=_['intersection'](_0x8a6bca[_0x6767('0x32')],qs['fields'](_0x248ecd['query'][_0x6767('0x34')]));_0x37e1f6[_0x6767('0x33')]=_0x37e1f6[_0x6767('0x33')][_0x6767('0x35')]?_0x37e1f6[_0x6767('0x33')]:_0x8a6bca[_0x6767('0x32')];if(_0x248ecd[_0x6767('0x2f')]['includeAll']){_0x37e1f6['include']=[{'all':!![]}];}_0x37e1f6=_[_0x6767('0x3c')]({},_0x37e1f6,_0x248ecd['options']);return db[_0x6767('0x2c')]['find'](_0x37e1f6)['then'](handleEntityNotFound(_0x3a2c23,null))['then'](respondWithResult(_0x3a2c23,null))[_0x6767('0x43')](handleError(_0x3a2c23,null));};exports[_0x6767('0x47')]=function(_0x48068d,_0xc2b3aa){return db[_0x6767('0x2c')][_0x6767('0x47')](_0x48068d['body'],{})[_0x6767('0x25')](respondWithResult(_0xc2b3aa,0xc9))[_0x6767('0x43')](handleError(_0xc2b3aa,null));};exports[_0x6767('0x24')]=function(_0x300829,_0x21b2e8){if(_0x300829['body']['id']){delete _0x300829[_0x6767('0x48')]['id'];}return db[_0x6767('0x2c')][_0x6767('0x49')]({'where':{'id':_0x300829[_0x6767('0x45')]['id']}})[_0x6767('0x25')](handleEntityNotFound(_0x21b2e8,null))['then'](saveUpdates(_0x300829[_0x6767('0x48')],null))[_0x6767('0x25')](respondWithResult(_0x21b2e8,null))['catch'](handleError(_0x21b2e8,null));};exports['destroy']=function(_0x50c817,_0x6397cb){return db[_0x6767('0x2c')][_0x6767('0x49')]({'where':{'id':_0x50c817[_0x6767('0x45')]['id']}})[_0x6767('0x25')](handleEntityNotFound(_0x6397cb,null))[_0x6767('0x25')](removeEntity(_0x6397cb,null))[_0x6767('0x43')](handleError(_0x6397cb,null));};exports[_0x6767('0x4a')]=function(_0x1d6675,_0x32d0c4){return db[_0x6767('0x2c')][_0x6767('0x4a')]()[_0x6767('0x25')](respondWithResult(_0x32d0c4,null))[_0x6767('0x43')](handleError(_0x32d0c4,null));}; \ No newline at end of file +var _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x85d0,0x164));var _0x085d=function(_0x290b02,_0x5971f1){_0x290b02=_0x290b02-0x0;var _0x28b88c=_0x85d0[_0x290b02];return _0x28b88c;};'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(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['JscriptyAnswerReport'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['JscriptyAnswerReport'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['JscriptyAnswerReport'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 2eee26e..b58feb3 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 _0x134e=['request-promise','path','../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x134e,0x125));var _0xe134=function(_0x462636,_0x5679aa){_0x462636=_0x462636-0x0;var _0x390b12=_0x134e[_0x462636];return _0x390b12;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe134('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe134('0x1'));var fs=require('fs');var path=require(_0xe134('0x2'));var rimraf=require('rimraf');var config=require(_0xe134('0x3'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xe134('0x4')]=function(_0x3019d6,_0x5a1dfb){return _0x3019d6['define'](_0xe134('0x5'),attributes,{'tableName':_0xe134('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fc4=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x0fc4,0x1d9));var _0x40fc=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x0fc4[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0x40fc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40fc('0x1'));var moment=require(_0x40fc('0x2'));var BPromise=require(_0x40fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40fc('0x4'));var rimraf=require(_0x40fc('0x5'));var config=require(_0x40fc('0x6'));var attributes=require(_0x40fc('0x7'));module[_0x40fc('0x8')]=function(_0x104ffc,_0x2f4430){return _0x104ffc[_0x40fc('0x9')](_0x40fc('0xa'),attributes,{'tableName':'report_jscripty_answers','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 6b37828..8d3377c 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 _0x0e0d=['request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x35e54a,_0x46953a){var _0x35c2b0=function(_0x3c0ab9){while(--_0x3c0ab9){_0x35e54a['push'](_0x35e54a['shift']());}};_0x35c2b0(++_0x46953a);}(_0x0e0d,0x6a));var _0xd0e0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x0e0d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd0e0('0x0'));var util=require(_0xd0e0('0x1'));var moment=require(_0xd0e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0e0('0x3'));var fs=require('fs');var Redis=require(_0xd0e0('0x4'));var db=require(_0xd0e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd0e0('0x6'));var config=require(_0xd0e0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca3fd5,_0x4e286e,_0x3c1144){return new BPromise(function(_0x17e984,_0x5153b4){return client[_0xd0e0('0x9')](_0xca3fd5,_0x3c1144)[_0xd0e0('0xa')](function(_0x1c853b){logger[_0xd0e0('0xb')](_0xd0e0('0xc'),_0x4e286e,'request\x20sent');logger[_0xd0e0('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4e286e,_0xd0e0('0xe'),JSON['stringify'](_0x1c853b));if(_0x1c853b[_0xd0e0('0xf')]){if(_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x10')]===0x1f4){logger[_0xd0e0('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4e286e,_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x11')]);return _0x5153b4(_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x11')]);}logger[_0xd0e0('0xf')](_0xd0e0('0xc'),_0x4e286e,_0x1c853b[_0xd0e0('0xf')]['message']);return _0x17e984(_0x1c853b['error'][_0xd0e0('0x11')]);}else{logger[_0xd0e0('0xb')](_0xd0e0('0xc'),_0x4e286e,'request\x20sent');_0x17e984(_0x1c853b[_0xd0e0('0x12')][_0xd0e0('0x11')]);}})[_0xd0e0('0x13')](function(_0x63dc4f){logger[_0xd0e0('0xf')](_0xd0e0('0xc'),_0x4e286e,_0x63dc4f);_0x5153b4(_0x63dc4f);});});} \ No newline at end of file +var _0x7380=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','JscriptyAnswerReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent'];(function(_0x44b4fe,_0x2aaaa7){var _0x5b5a60=function(_0xce3a70){while(--_0xce3a70){_0x44b4fe['push'](_0x44b4fe['shift']());}};_0x5b5a60(++_0x2aaaa7);}(_0x7380,0x1e2));var _0x0738=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x7380[_0x5d7227];return _0x15ac55;};'use strict';var _=require(_0x0738('0x0'));var util=require(_0x0738('0x1'));var moment=require(_0x0738('0x2'));var BPromise=require(_0x0738('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0738('0x4'));var db=require(_0x0738('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0738('0x6'));var jayson=require(_0x0738('0x7'));var client=jayson[_0x0738('0x8')][_0x0738('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x588c57,_0x2270fb,_0x366c60){return new BPromise(function(_0x14056c,_0x54c22f){return client['request'](_0x588c57,_0x366c60)['then'](function(_0x300eaa){logger['info'](_0x0738('0xa'),_0x2270fb,'request\x20sent');logger[_0x0738('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2270fb,'request\x20sent',JSON[_0x0738('0xc')](_0x300eaa));if(_0x300eaa[_0x0738('0xd')]){if(_0x300eaa[_0x0738('0xd')][_0x0738('0xe')]===0x1f4){logger['error'](_0x0738('0xa'),_0x2270fb,_0x300eaa[_0x0738('0xd')][_0x0738('0xf')]);return _0x54c22f(_0x300eaa[_0x0738('0xd')][_0x0738('0xf')]);}logger[_0x0738('0xd')](_0x0738('0xa'),_0x2270fb,_0x300eaa[_0x0738('0xd')][_0x0738('0xf')]);return _0x14056c(_0x300eaa[_0x0738('0xd')][_0x0738('0xf')]);}else{logger[_0x0738('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2270fb,_0x0738('0x11'));_0x14056c(_0x300eaa[_0x0738('0x12')]['message']);}})[_0x0738('0x13')](function(_0x485288){logger[_0x0738('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2270fb,_0x485288);_0x54c22f(_0x485288);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ad8beca..386d9aa 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 _0xaeef=['clone','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0xaeef,0x10a));var _0xfaee=function(_0x325c38,_0x55d21e){_0x325c38=_0x325c38-0x0;var _0x2026da=_0xaeef[_0x325c38];return _0x2026da;};'use strict';var multer=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var path=require(_0xfaee('0x2'));var timeout=require('connect-timeout');var express=require(_0xfaee('0x3'));var router=express[_0xfaee('0x4')]();var fs_extra=require(_0xfaee('0x5'));var auth=require(_0xfaee('0x6'));var interaction=require(_0xfaee('0x7'));var config=require(_0xfaee('0x8'));var controller=require(_0xfaee('0x9'));router[_0xfaee('0xa')]('/',auth[_0xfaee('0xb')](),controller[_0xfaee('0xc')]);router[_0xfaee('0xa')](_0xfaee('0xd'),auth[_0xfaee('0xb')](),controller['show']);router[_0xfaee('0xa')](_0xfaee('0xe'),auth['isAuthenticated'](),controller[_0xfaee('0xf')]);router[_0xfaee('0xa')](_0xfaee('0x10'),auth[_0xfaee('0xb')](),controller[_0xfaee('0x11')]);router[_0xfaee('0xa')](_0xfaee('0x12'),auth[_0xfaee('0xb')](),timeout(_0xfaee('0x13')),controller[_0xfaee('0x14')]);router[_0xfaee('0x15')]('/',auth[_0xfaee('0xb')](),controller[_0xfaee('0x16')]);router['post'](_0xfaee('0x17'),auth[_0xfaee('0xb')](),controller[_0xfaee('0x18')]);router[_0xfaee('0x19')](_0xfaee('0xd'),auth['isAuthenticated'](),controller[_0xfaee('0x1a')]);router[_0xfaee('0x1b')](_0xfaee('0xd'),auth[_0xfaee('0xb')](),controller[_0xfaee('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x5826=['index','show','/:id/sessions','isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x3fcc68,_0x3425b4){var _0x5dd967=function(_0x4117e2){while(--_0x4117e2){_0x3fcc68['push'](_0x3fcc68['shift']());}};_0x5dd967(++_0x3425b4);}(_0x5826,0x151));var _0x6582=function(_0x2e117f,_0x347173){_0x2e117f=_0x2e117f-0x0;var _0x4b9f15=_0x5826[_0x2e117f];return _0x4b9f15;};'use strict';var multer=require(_0x6582('0x0'));var util=require(_0x6582('0x1'));var path=require(_0x6582('0x2'));var timeout=require('connect-timeout');var express=require(_0x6582('0x3'));var router=express[_0x6582('0x4')]();var fs_extra=require(_0x6582('0x5'));var auth=require(_0x6582('0x6'));var interaction=require(_0x6582('0x7'));var config=require(_0x6582('0x8'));var controller=require(_0x6582('0x9'));router[_0x6582('0xa')]('/',auth['isAuthenticated'](),controller[_0x6582('0xb')]);router[_0x6582('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6582('0xc')]);router['get'](_0x6582('0xd'),auth[_0x6582('0xe')](),controller[_0x6582('0xf')]);router[_0x6582('0xa')](_0x6582('0x10'),auth['isAuthenticated'](),controller[_0x6582('0x11')]);router[_0x6582('0xa')](_0x6582('0x12'),auth[_0x6582('0xe')](),timeout(_0x6582('0x13')),controller[_0x6582('0x14')]);router[_0x6582('0x15')]('/',auth[_0x6582('0xe')](),controller[_0x6582('0x16')]);router[_0x6582('0x15')](_0x6582('0x17'),auth[_0x6582('0xe')](),controller[_0x6582('0x18')]);router[_0x6582('0x19')](_0x6582('0x1a'),auth[_0x6582('0xe')](),controller[_0x6582('0x1b')]);router[_0x6582('0x1c')]('/:id',auth[_0x6582('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 39731de..74f38cf 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 _0xfc76=['isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','exports','name','STRING','TEXT','long','isObjectLike','formData','stringify'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xfc76,0x19b));var _0x6fc7=function(_0x5d1840,_0x174f2c){_0x5d1840=_0x5d1840-0x0;var _0x38d947=_0xfc76[_0x5d1840];return _0x38d947;};'use strict';var Sequelize=require(_0x6fc7('0x0'));var _=require('lodash');var util=require('util');module[_0x6fc7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6fc7('0x2')},'description':{'type':Sequelize[_0x6fc7('0x3')]},'formData':{'type':Sequelize[_0x6fc7('0x4')](_0x6fc7('0x5')),'set':function(_0x57ef6e){if(_[_0x6fc7('0x6')](_0x57ef6e)){this['setDataValue'](_0x6fc7('0x7'),JSON[_0x6fc7('0x8')](_0x57ef6e));}else if(_[_0x6fc7('0x9')](_0x57ef6e)){this[_0x6fc7('0xa')](_0x6fc7('0x7'),_0x57ef6e);}else{this[_0x6fc7('0xa')](_0x6fc7('0x7'),util[_0x6fc7('0xb')](_0x6fc7('0xc'),this[_0x6fc7('0xd')]('name')||'',this[_0x6fc7('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6fc7('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6fc7('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c0f=['lodash','util','exports','name','TEXT','setDataValue','stringify','formData','getDataValue','description','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c0f,0x1a3));var _0xf3c0=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x3c0f[_0x42f009];return _0x22a1e0;};'use strict';var Sequelize=require(_0xf3c0('0x0'));var _=require(_0xf3c0('0x1'));var util=require(_0xf3c0('0x2'));module[_0xf3c0('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xf3c0('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xf3c0('0x5')]('long'),'set':function(_0x141d6e){if(_['isObjectLike'](_0x141d6e)){this[_0xf3c0('0x6')]('formData',JSON[_0xf3c0('0x7')](_0x141d6e));}else if(_['isString'](_0x141d6e)){this['setDataValue'](_0xf3c0('0x8'),_0x141d6e);}else{this[_0xf3c0('0x6')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue']('name')||'',this[_0xf3c0('0x9')](_0xf3c0('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf3c0('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf3c0('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index bc2c222..6aaac96 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 _0xe651=['order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','-createdAt','questionId','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','Projects','destroy','error','stack','name','send','index','map','JscriptyProject','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe651,0x1a5));var _0x1e65=function(_0x517c7c,_0x32f634){_0x517c7c=_0x517c7c-0x0;var _0x1a9832=_0xe651[_0x517c7c];return _0x1a9832;};'use strict';var emlformat=require(_0x1e65('0x0'));var rimraf=require(_0x1e65('0x1'));var zipdir=require(_0x1e65('0x2'));var jsonpatch=require(_0x1e65('0x3'));var rp=require(_0x1e65('0x4'));var moment=require(_0x1e65('0x5'));var BPromise=require(_0x1e65('0x6'));var Mustache=require('mustache');var util=require(_0x1e65('0x7'));var path=require(_0x1e65('0x8'));var sox=require(_0x1e65('0x9'));var csv=require(_0x1e65('0xa'));var ejs=require(_0x1e65('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1e65('0xc'));var crypto=require('crypto');var jsforce=require(_0x1e65('0xd'));var deskjs=require(_0x1e65('0xe'));var toCsv=require(_0x1e65('0xa'));var querystring=require(_0x1e65('0xf'));var Papa=require(_0x1e65('0x10'));var Redis=require(_0x1e65('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1e65('0x12'));var as=require(_0x1e65('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e65('0x14'))(_0x1e65('0x15'));var utils=require(_0x1e65('0x16'));var config=require(_0x1e65('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e65('0x18'))['db'];function respondWithStatusCode(_0x3afd35,_0x4dfdfc){_0x4dfdfc=_0x4dfdfc||0xcc;return function(_0xd7d863){if(_0xd7d863){return _0x3afd35[_0x1e65('0x19')](_0x4dfdfc);}return _0x3afd35['status'](_0x4dfdfc)['end']();};}function respondWithResult(_0x532f4c,_0x3b22c2){_0x3b22c2=_0x3b22c2||0xc8;return function(_0x103f58){if(_0x103f58){return _0x532f4c[_0x1e65('0x1a')](_0x3b22c2)[_0x1e65('0x1b')](_0x103f58);}};}function respondWithFilteredResult(_0x55020e,_0x38f0fa){return function(_0x13472d){if(_0x13472d){var _0x3c0f80=typeof _0x38f0fa[_0x1e65('0x1c')]===_0x1e65('0x1d')&&typeof _0x38f0fa[_0x1e65('0x1e')]===_0x1e65('0x1d');var _0x381b93=_0x13472d[_0x1e65('0x1f')];var _0x506fe3=_0x3c0f80?0x0:_0x38f0fa[_0x1e65('0x1c')];var _0x26107c=_0x3c0f80?_0x13472d[_0x1e65('0x1f')]:_0x38f0fa[_0x1e65('0x1c')]+_0x38f0fa[_0x1e65('0x1e')];var _0x518e95;if(_0x26107c>=_0x381b93){_0x26107c=_0x381b93;_0x518e95=0xc8;}else{_0x518e95=0xce;}_0x55020e[_0x1e65('0x1a')](_0x518e95);return _0x55020e['set'](_0x1e65('0x20'),_0x506fe3+'-'+_0x26107c+'/'+_0x381b93)[_0x1e65('0x1b')](_0x13472d);}return null;};}function patchUpdates(_0x591997){return function(_0x255a65){try{jsonpatch[_0x1e65('0x21')](_0x255a65,_0x591997,!![]);}catch(_0x49a1db){return BPromise[_0x1e65('0x22')](_0x49a1db);}return _0x255a65[_0x1e65('0x23')]();};}function saveUpdates(_0x47bf5a,_0x3f9709){return function(_0x425b1f){if(_0x425b1f){return _0x425b1f[_0x1e65('0x24')](_0x47bf5a)[_0x1e65('0x25')](function(_0x136666){return _0x136666;});}return null;};}function removeEntity(_0x3f37e8,_0x3c5d56){return function(_0x5d416d){if(_0x5d416d){return _0x5d416d['destroy']()[_0x1e65('0x25')](function(){var _0x4dbd1c=_0x5d416d[_0x1e65('0x26')]({'plain':!![]});var _0x116b0f=_0x1e65('0x27');return db['UserProfileResource'][_0x1e65('0x28')]({'where':{'type':_0x116b0f,'resourceId':_0x4dbd1c['id']}})[_0x1e65('0x25')](function(){return _0x5d416d;});})[_0x1e65('0x25')](function(){_0x3f37e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x491ddd,_0x15d172){return function(_0x38193a){if(!_0x38193a){_0x491ddd[_0x1e65('0x19')](0x194);}return _0x38193a;};}function handleError(_0x4de845,_0x8faa2b){_0x8faa2b=_0x8faa2b||0x1f4;return function(_0x43a9e2){logger[_0x1e65('0x29')](_0x43a9e2[_0x1e65('0x2a')]);if(_0x43a9e2[_0x1e65('0x2b')]){delete _0x43a9e2[_0x1e65('0x2b')];}_0x4de845[_0x1e65('0x1a')](_0x8faa2b)[_0x1e65('0x2c')](_0x43a9e2);};}exports[_0x1e65('0x2d')]=function(_0x19dcae,_0x129a3b){var _0xe0e23e={},_0x59bd5b={},_0x1b4e4e={'count':0x0,'rows':[]};var _0x1fb966=_[_0x1e65('0x2e')](db[_0x1e65('0x2f')]['rawAttributes'],function(_0x2cb23f){return{'name':_0x2cb23f['fieldName'],'type':_0x2cb23f[_0x1e65('0x30')][_0x1e65('0x31')]};});_0x59bd5b[_0x1e65('0x32')]=_[_0x1e65('0x2e')](_0x1fb966,_0x1e65('0x2b'));_0x59bd5b[_0x1e65('0x33')]=_[_0x1e65('0x34')](_0x19dcae[_0x1e65('0x33')]);_0x59bd5b['filters']=_[_0x1e65('0x35')](_0x59bd5b[_0x1e65('0x32')],_0x59bd5b[_0x1e65('0x33')]);_0xe0e23e['attributes']=_[_0x1e65('0x35')](_0x59bd5b[_0x1e65('0x32')],qs[_0x1e65('0x36')](_0x19dcae[_0x1e65('0x33')][_0x1e65('0x36')]));_0xe0e23e[_0x1e65('0x37')]=_0xe0e23e['attributes'][_0x1e65('0x38')]?_0xe0e23e[_0x1e65('0x37')]:_0x59bd5b[_0x1e65('0x32')];if(!_0x19dcae['query'][_0x1e65('0x39')](_0x1e65('0x3a'))){_0xe0e23e[_0x1e65('0x1e')]=qs['limit'](_0x19dcae[_0x1e65('0x33')][_0x1e65('0x1e')]);_0xe0e23e[_0x1e65('0x1c')]=qs[_0x1e65('0x1c')](_0x19dcae[_0x1e65('0x33')]['offset']);}_0xe0e23e[_0x1e65('0x3b')]=qs[_0x1e65('0x3c')](_0x19dcae[_0x1e65('0x33')][_0x1e65('0x3c')]);_0xe0e23e['where']=qs[_0x1e65('0x3d')](_[_0x1e65('0x3e')](_0x19dcae[_0x1e65('0x33')],_0x59bd5b['filters']),_0x1fb966);if(_0x19dcae['query'][_0x1e65('0x3f')]){_0xe0e23e[_0x1e65('0x40')]=_['merge'](_0xe0e23e[_0x1e65('0x40')],{'$or':_[_0x1e65('0x2e')](_0x1fb966,function(_0x54c3ff){if(_0x54c3ff[_0x1e65('0x30')]!==_0x1e65('0x41')){var _0x2c4705={};_0x2c4705[_0x54c3ff[_0x1e65('0x2b')]]={'$like':'%'+_0x19dcae[_0x1e65('0x33')][_0x1e65('0x3f')]+'%'};return _0x2c4705;}})});}_0xe0e23e=_[_0x1e65('0x42')]({},_0xe0e23e,_0x19dcae[_0x1e65('0x43')]);var _0x70d6d6={'where':_0xe0e23e['where']};return db[_0x1e65('0x2f')]['count'](_0x70d6d6)[_0x1e65('0x25')](function(_0x59ff1f){_0x1b4e4e[_0x1e65('0x1f')]=_0x59ff1f;if(_0x19dcae[_0x1e65('0x33')][_0x1e65('0x44')]){_0xe0e23e['include']=[{'all':!![]}];}return db[_0x1e65('0x2f')][_0x1e65('0x45')](_0xe0e23e);})[_0x1e65('0x25')](function(_0x4bbc2e){_0x1b4e4e[_0x1e65('0x46')]=_0x4bbc2e;return _0x1b4e4e;})['then'](respondWithFilteredResult(_0x129a3b,_0xe0e23e))[_0x1e65('0x47')](handleError(_0x129a3b,null));};exports[_0x1e65('0x48')]=function(_0x44d58a,_0x553f52){var _0x349f20={'raw':![],'where':{'id':_0x44d58a['params']['id']}},_0x2a59cb={};_0x2a59cb[_0x1e65('0x32')]=_['keys'](db['JscriptyProject'][_0x1e65('0x49')]);_0x2a59cb[_0x1e65('0x33')]=_[_0x1e65('0x34')](_0x44d58a[_0x1e65('0x33')]);_0x2a59cb[_0x1e65('0x3d')]=_[_0x1e65('0x35')](_0x2a59cb[_0x1e65('0x32')],_0x2a59cb[_0x1e65('0x33')]);_0x349f20[_0x1e65('0x37')]=_[_0x1e65('0x35')](_0x2a59cb[_0x1e65('0x32')],qs[_0x1e65('0x36')](_0x44d58a[_0x1e65('0x33')][_0x1e65('0x36')]));_0x349f20['attributes']=_0x349f20[_0x1e65('0x37')][_0x1e65('0x38')]?_0x349f20['attributes']:_0x2a59cb['model'];if(_0x44d58a[_0x1e65('0x33')][_0x1e65('0x44')]){_0x349f20[_0x1e65('0x4a')]=[{'all':!![]}];}_0x349f20=_[_0x1e65('0x42')]({},_0x349f20,_0x44d58a[_0x1e65('0x43')]);return db[_0x1e65('0x2f')][_0x1e65('0x4b')](_0x349f20)[_0x1e65('0x25')](handleEntityNotFound(_0x553f52,null))[_0x1e65('0x25')](respondWithResult(_0x553f52,null))[_0x1e65('0x47')](handleError(_0x553f52,null));};exports[_0x1e65('0x4c')]=function(_0x7e6dfe,_0x45ec0c){return db[_0x1e65('0x2f')][_0x1e65('0x4c')](_0x7e6dfe[_0x1e65('0x4d')],{})['then'](function(_0x43c16c){var _0x4d714c=_0x7e6dfe[_0x1e65('0x4e')][_0x1e65('0x26')]({'plain':!![]});if(!_0x4d714c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d714c['role']===_0x1e65('0x4e')){var _0x51cde6=_0x43c16c[_0x1e65('0x26')]({'plain':!![]});var _0x266d26=_0x1e65('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x266d26,'userProfileId':_0x4d714c[_0x1e65('0x4f')]},'raw':!![]})[_0x1e65('0x25')](function(_0x19b1d3){if(_0x19b1d3&&_0x19b1d3[_0x1e65('0x50')]===0x0){return db[_0x1e65('0x51')][_0x1e65('0x4c')]({'name':_0x51cde6[_0x1e65('0x2b')],'resourceId':_0x51cde6['id'],'type':_0x19b1d3[_0x1e65('0x2b')],'sectionId':_0x19b1d3['id']},{})[_0x1e65('0x25')](function(){return _0x43c16c;});}else{return _0x43c16c;}})[_0x1e65('0x47')](function(_0x5052e5){logger['error'](_0x1e65('0x52'),_0x5052e5);throw _0x5052e5;});}return _0x43c16c;})[_0x1e65('0x25')](respondWithResult(_0x45ec0c,0xc9))[_0x1e65('0x47')](handleError(_0x45ec0c,null));};exports['clone']=function(_0x578925,_0x5a29ce){var _0x4f92c9={'where':{'id':_0x578925[_0x1e65('0x53')]['id']}},_0x699f1f={};_0x699f1f[_0x1e65('0x32')]=_['keys'](db[_0x1e65('0x2f')][_0x1e65('0x49')]);_0x4f92c9[_0x1e65('0x37')]=_['intersection'](_0x699f1f[_0x1e65('0x32')],qs['fields'](_0x578925[_0x1e65('0x33')][_0x1e65('0x36')]));_0x4f92c9['attributes']=_0x4f92c9[_0x1e65('0x37')]['length']?_0x4f92c9[_0x1e65('0x37')]:_0x699f1f[_0x1e65('0x32')];if(_0x578925['query']['includeAll']){_0x4f92c9['include']=[{'all':!![]}];}_0x4f92c9=_[_0x1e65('0x42')]({},_0x4f92c9,_0x578925['options']);return db['JscriptyProject']['find'](_0x4f92c9)[_0x1e65('0x25')](handleEntityNotFound(_0x5a29ce,null))[_0x1e65('0x25')](function(_0x5c0e5d){if(_0x5c0e5d){var _0x2b6d30=_0x5c0e5d[_0x1e65('0x26')]({'plain':!![]});_0x2b6d30=qs[_0x1e65('0x54')](_0x2b6d30,['id',_0x1e65('0x55'),_0x1e65('0x56')]);_0x578925[_0x1e65('0x4d')]=_[_0x1e65('0x54')](_0x578925[_0x1e65('0x4d')],['id',_0x1e65('0x55'),'updatedAt']);return db['JscriptyProject'][_0x1e65('0x4c')](_['merge'](_0x2b6d30,_0x578925[_0x1e65('0x4d')]),{'include':_0x578925[_0x1e65('0x33')][_0x1e65('0x44')]?[{'all':!![]}]:undefined})[_0x1e65('0x25')](function(_0x427f3d){var _0x2274bb=_0x578925[_0x1e65('0x4e')][_0x1e65('0x26')]({'plain':!![]});if(!_0x2274bb)throw new Error(_0x1e65('0x57'));if(_0x2274bb[_0x1e65('0x58')]===_0x1e65('0x4e')){var _0x482429=_0x427f3d[_0x1e65('0x26')]({'plain':!![]});var _0x479082='Projects';return db[_0x1e65('0x59')][_0x1e65('0x4b')]({'where':{'name':_0x479082,'userProfileId':_0x2274bb[_0x1e65('0x4f')]},'raw':!![]})[_0x1e65('0x25')](function(_0x109d3c){if(_0x109d3c&&_0x109d3c[_0x1e65('0x50')]===0x0){return db[_0x1e65('0x51')]['create']({'name':_0x482429['name'],'resourceId':_0x482429['id'],'type':_0x109d3c[_0x1e65('0x2b')],'sectionId':_0x109d3c['id']},{})[_0x1e65('0x25')](function(){return _0x427f3d;});}else{return _0x427f3d;}})[_0x1e65('0x47')](function(_0x42ca95){logger[_0x1e65('0x29')](_0x1e65('0x52'),_0x42ca95);throw _0x42ca95;});}return _0x427f3d;});}})['then'](respondWithResult(_0x5a29ce,0xc9))[_0x1e65('0x47')](handleError(_0x5a29ce,null));};exports[_0x1e65('0x24')]=function(_0x466dcf,_0x59a55f){if(_0x466dcf['body']['id']){delete _0x466dcf[_0x1e65('0x4d')]['id'];}return db['JscriptyProject'][_0x1e65('0x4b')]({'where':{'id':_0x466dcf[_0x1e65('0x53')]['id']}})[_0x1e65('0x25')](handleEntityNotFound(_0x59a55f,null))[_0x1e65('0x25')](saveUpdates(_0x466dcf[_0x1e65('0x4d')],null))[_0x1e65('0x25')](respondWithResult(_0x59a55f,null))[_0x1e65('0x47')](handleError(_0x59a55f,null));};exports[_0x1e65('0x28')]=function(_0x5337e0,_0x4601a5){return db['JscriptyProject'][_0x1e65('0x4b')]({'where':{'id':_0x5337e0['params']['id']}})[_0x1e65('0x25')](handleEntityNotFound(_0x4601a5,null))[_0x1e65('0x25')](removeEntity(_0x4601a5,null))[_0x1e65('0x47')](handleError(_0x4601a5,null));};exports[_0x1e65('0x5a')]=function(_0x701591,_0x55a6d7,_0x1a9aa4){var _0x2d6a0d={'raw':!![],'where':{}};var _0x2b3485={};var _0x574a1b={'count':0x0,'rows':[]};return db[_0x1e65('0x2f')]['findOne']({'where':{'id':_0x701591[_0x1e65('0x53')]['id']}})[_0x1e65('0x25')](handleEntityNotFound(_0x55a6d7,null))[_0x1e65('0x25')](function(_0x3fef79){if(_0x3fef79){_0x2b3485[_0x1e65('0x32')]=_['keys'](db[_0x1e65('0x5b')][_0x1e65('0x49')]);_0x2b3485[_0x1e65('0x33')]=_[_0x1e65('0x34')](_0x701591['query']);_0x2b3485['filters']=_[_0x1e65('0x35')](_0x2b3485[_0x1e65('0x32')],_0x2b3485[_0x1e65('0x33')]);_0x2d6a0d[_0x1e65('0x37')]=_['intersection'](_0x2b3485['model'],qs[_0x1e65('0x36')](_0x701591[_0x1e65('0x33')]['fields']));_0x2d6a0d[_0x1e65('0x37')]=_0x2d6a0d[_0x1e65('0x37')]['length']?_0x2d6a0d[_0x1e65('0x37')]:_0x2b3485[_0x1e65('0x32')];if(!_0x701591[_0x1e65('0x33')][_0x1e65('0x39')]('nolimit')){_0x2d6a0d['limit']=qs['limit'](_0x701591[_0x1e65('0x33')][_0x1e65('0x1e')]);_0x2d6a0d[_0x1e65('0x1c')]=qs[_0x1e65('0x1c')](_0x701591['query'][_0x1e65('0x1c')]);}_0x2d6a0d['order']=qs[_0x1e65('0x3c')](_0x701591[_0x1e65('0x33')][_0x1e65('0x3c')]);_0x2d6a0d[_0x1e65('0x40')]=qs[_0x1e65('0x3d')](_[_0x1e65('0x3e')](_0x701591[_0x1e65('0x33')],_0x2b3485[_0x1e65('0x3d')]));_0x2d6a0d[_0x1e65('0x40')][_0x1e65('0x5c')]=_0x3fef79['id'];if(_0x701591[_0x1e65('0x33')][_0x1e65('0x3f')]){_0x2d6a0d[_0x1e65('0x40')]=_[_0x1e65('0x42')](_0x2d6a0d[_0x1e65('0x40')],{'$or':_[_0x1e65('0x2e')](_0x2d6a0d[_0x1e65('0x37')],function(_0x1c6a6b){var _0x12ab04={};_0x12ab04[_0x1c6a6b]={'$like':'%'+_0x701591[_0x1e65('0x33')][_0x1e65('0x3f')]+'%'};return _0x12ab04;})});}_0x2d6a0d=_[_0x1e65('0x42')]({},_0x2d6a0d,_0x701591[_0x1e65('0x43')]);return db[_0x1e65('0x5b')]['count']({'where':_0x2d6a0d[_0x1e65('0x40')]})[_0x1e65('0x25')](function(_0x2002b4){_0x574a1b[_0x1e65('0x1f')]=_0x2002b4;if(_0x701591['query'][_0x1e65('0x44')]){_0x2d6a0d[_0x1e65('0x4a')]=[{'all':!![]}];}return db[_0x1e65('0x5b')][_0x1e65('0x45')](_0x2d6a0d);})[_0x1e65('0x25')](function(_0x3c561e){_0x574a1b['rows']=_0x3c561e;return _0x574a1b;});}})[_0x1e65('0x25')](respondWithFilteredResult(_0x55a6d7,_0x2d6a0d))[_0x1e65('0x47')](handleError(_0x55a6d7,null));};exports[_0x1e65('0x5d')]=function(_0x28c488,_0x1ad1be,_0x34118f){var _0x19f3ce={'raw':!![],'where':{}};var _0x1fe767={};var _0x308b08={'count':0x0,'rows':[]};return db[_0x1e65('0x2f')][_0x1e65('0x5e')]({'where':{'id':_0x28c488[_0x1e65('0x53')]['id']}})[_0x1e65('0x25')](handleEntityNotFound(_0x1ad1be,null))['then'](function(_0x1cb805){if(_0x1cb805){_0x1fe767[_0x1e65('0x32')]=_[_0x1e65('0x34')](db[_0x1e65('0x5f')][_0x1e65('0x49')]);_0x1fe767[_0x1e65('0x33')]=_[_0x1e65('0x34')](_0x28c488['query']);_0x1fe767[_0x1e65('0x3d')]=_[_0x1e65('0x35')](_0x1fe767[_0x1e65('0x32')],_0x1fe767[_0x1e65('0x33')]);_0x19f3ce[_0x1e65('0x37')]=_[_0x1e65('0x35')](_0x1fe767['model'],qs[_0x1e65('0x36')](_0x28c488['query'][_0x1e65('0x36')]));_0x19f3ce[_0x1e65('0x37')]=_0x19f3ce[_0x1e65('0x37')]['length']?_0x19f3ce[_0x1e65('0x37')]:_0x1fe767[_0x1e65('0x32')];if(!_0x28c488[_0x1e65('0x33')][_0x1e65('0x39')]('nolimit')){_0x19f3ce[_0x1e65('0x1e')]=qs[_0x1e65('0x1e')](_0x28c488[_0x1e65('0x33')][_0x1e65('0x1e')]);_0x19f3ce[_0x1e65('0x1c')]=qs[_0x1e65('0x1c')](_0x28c488[_0x1e65('0x33')][_0x1e65('0x1c')]);}_0x19f3ce[_0x1e65('0x3b')]=qs[_0x1e65('0x3c')](_0x28c488[_0x1e65('0x33')][_0x1e65('0x3c')]);_0x19f3ce[_0x1e65('0x40')]=qs[_0x1e65('0x3d')](_['pick'](_0x28c488[_0x1e65('0x33')],_0x1fe767[_0x1e65('0x3d')]));_0x19f3ce[_0x1e65('0x40')][_0x1e65('0x5c')]=_0x1cb805['id'];if(_0x28c488[_0x1e65('0x33')][_0x1e65('0x3f')]){_0x19f3ce[_0x1e65('0x40')]=_['merge'](_0x19f3ce['where'],{'$or':_['map'](_0x19f3ce['attributes'],function(_0x39c18b){var _0xc16555={};_0xc16555[_0x39c18b]={'$like':'%'+_0x28c488[_0x1e65('0x33')][_0x1e65('0x3f')]+'%'};return _0xc16555;})});}_0x19f3ce=_[_0x1e65('0x42')]({},_0x19f3ce,_0x28c488[_0x1e65('0x43')]);return db[_0x1e65('0x5f')][_0x1e65('0x1f')]({'where':_0x19f3ce[_0x1e65('0x40')]})['then'](function(_0x191fe3){_0x308b08[_0x1e65('0x1f')]=_0x191fe3;if(_0x28c488['query'][_0x1e65('0x44')]){_0x19f3ce['include']=[{'all':!![]}];}return db[_0x1e65('0x5f')][_0x1e65('0x45')](_0x19f3ce);})['then'](function(_0x48c673){_0x308b08[_0x1e65('0x46')]=_0x48c673;return _0x308b08;});}})[_0x1e65('0x25')](respondWithFilteredResult(_0x1ad1be,_0x19f3ce))['catch'](handleError(_0x1ad1be,null));};function char(_0x2e775d){return'number'===typeof _0x2e775d?String[_0x1e65('0x60')][_0x1e65('0x21')](null,arguments):_0x2e775d;}function needsEncapsulation(_0x540079){return!!_0x540079&&(_0x540079[_0x1e65('0x61')]()['indexOf'](char(0xd))>=0x0||_0x540079[_0x1e65('0x61')]()['indexOf'](char(0xa))>=0x0||_0x540079[_0x1e65('0x61')]()['indexOf'](char(0x2c))>=0x0||_0x540079['toString']()[_0x1e65('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3555b5){var _0x3c807e=char(0x22),_0x32f200='\x5c'+char(0x22),_0x247f95=_0x3555b5[_0x1e65('0x61')]()[_0x1e65('0x63')](new RegExp(_0x3c807e,'g'),_0x32f200);return _0x3c807e+_0x247f95+_0x3c807e;}exports[_0x1e65('0x64')]=function(_0x5ef292,_0x362294,_0x5543fd){var _0x1274a6,_0x2153a4;var _0x2519e6={'where':{'ProjectId':_0x5ef292[_0x1e65('0x53')]['id']}};if(_0x5ef292[_0x1e65('0x33')][_0x1e65('0x65')]){_0x2519e6['where']['starttime']=JSON['parse'](_0x5ef292['query'][_0x1e65('0x65')]);}return db['JscriptySessionReport'][_0x1e65('0x45')](_0x2519e6)[_0x1e65('0x25')](handleEntityNotFound(_0x362294,null))['then'](function(_0x56c272){if(_0x56c272){_0x1274a6=_0x56c272;return db['JscriptyQuestionReport'][_0x1e65('0x45')]({'where':{'SessionId':{'$in':_[_0x1e65('0x2e')](_0x1274a6,'id')},'ProjectId':_0x5ef292[_0x1e65('0x53')]['id']},'order':_0x1e65('0x66')});}})[_0x1e65('0x25')](handleEntityNotFound(_0x362294,null))[_0x1e65('0x25')](function(_0x15c4bf){if(_0x15c4bf){_0x2153a4=_0x15c4bf;var _0x177474={};for(var _0xc82e60=0x0,_0x2f1cfe=_0x2153a4[_0x1e65('0x38')];_0xc82e60<_0x2f1cfe;_0xc82e60++){if(!_0x177474[_0x1e65('0x39')](_0x2153a4[_0xc82e60][_0x1e65('0x67')])){_0x177474[_0x2153a4[_0xc82e60][_0x1e65('0x67')]]=needsEncapsulation(_0x2153a4[_0xc82e60]['question'])?encapsulate(_0x2153a4[_0xc82e60]['question']):_0x2153a4[_0xc82e60]['question'];}}var _0x42bc29=[],_0x37c220={};for(var _0x224780=0x0,_0x16fa61=_0x1274a6[_0x1e65('0x38')];_0x224780<_0x16fa61;_0x224780++){_0x37c220={'ProjectId':_0x5ef292[_0x1e65('0x53')]['id'],'SessionId':_0x1274a6[_0x224780]['id'],'StartTime':moment(_0x1274a6[_0x224780][_0x1e65('0x68')])[_0x1e65('0x69')](_0x1e65('0x6a'))};for(var _0x416ebe=0x0,_0x156e25=_0x2153a4[_0x1e65('0x38')];_0x416ebe<_0x156e25;_0x416ebe++){if(_0x2153a4[_0x416ebe][_0x1e65('0x6b')]==_0x1274a6[_0x224780]['id']&&_0x177474[_0x1e65('0x39')](_0x2153a4[_0x416ebe]['questionId'])){_0x37c220[_0x177474[_0x2153a4[_0x416ebe][_0x1e65('0x67')]]]=_0x2153a4[_0x416ebe][_0x1e65('0x6c')];}}for(var _0x260a40 in _0x177474){if(!_0x37c220[_0x1e65('0x39')](_0x177474[_0x260a40])){_0x37c220[_0x177474[_0x260a40]]=null;}}_0x42bc29[_0x1e65('0x6d')](_0x37c220);}return _0x42bc29;}})[_0x1e65('0x25')](function(_0x5b3939){if(!_[_0x1e65('0x6e')](_0x5b3939)){var _0x143999=toCsv(_0x5b3939);var _0x334193=Date[_0x1e65('0x6f')]();fs[_0x1e65('0x70')](util[_0x1e65('0x69')](_0x1e65('0x71'),_0x5ef292['params']['id'],_0x334193),_0x143999);_0x362294[_0x1e65('0x72')]('Content-disposition',_0x1e65('0x73')+util[_0x1e65('0x69')](_0x1e65('0x74'),_0x5ef292[_0x1e65('0x53')]['id'],_0x334193));_0x362294['setHeader'](_0x1e65('0x75'),_0x1e65('0x76'));return _0x362294[_0x1e65('0x77')](util[_0x1e65('0x69')](_0x1e65('0x71'),_0x5ef292[_0x1e65('0x53')]['id'],_0x334193));}else{return _0x362294[_0x1e65('0x19')](0xcc);}})[_0x1e65('0x47')](handleError(_0x362294,null));}; \ No newline at end of file +var _0x6a47=['isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','intersection','find','body','user','UserProfileSection','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getSessions','nolimit','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push'];(function(_0x1bc6b4,_0x3c6a45){var _0x44e7cf=function(_0x2cbe95){while(--_0x2cbe95){_0x1bc6b4['push'](_0x1bc6b4['shift']());}};_0x44e7cf(++_0x3c6a45);}(_0x6a47,0x84));var _0x76a4=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x6a47[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x76a4('0x0'));var rimraf=require(_0x76a4('0x1'));var zipdir=require(_0x76a4('0x2'));var jsonpatch=require(_0x76a4('0x3'));var rp=require(_0x76a4('0x4'));var moment=require(_0x76a4('0x5'));var BPromise=require(_0x76a4('0x6'));var Mustache=require('mustache');var util=require(_0x76a4('0x7'));var path=require(_0x76a4('0x8'));var sox=require(_0x76a4('0x9'));var csv=require(_0x76a4('0xa'));var ejs=require(_0x76a4('0xb'));var fs=require('fs');var fs_extra=require(_0x76a4('0xc'));var _=require('lodash');var squel=require(_0x76a4('0xd'));var crypto=require(_0x76a4('0xe'));var jsforce=require(_0x76a4('0xf'));var deskjs=require(_0x76a4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x76a4('0x11'));var Papa=require(_0x76a4('0x12'));var Redis=require(_0x76a4('0x13'));var authService=require(_0x76a4('0x14'));var qs=require(_0x76a4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76a4('0x16'));var logger=require(_0x76a4('0x17'))(_0x76a4('0x18'));var utils=require(_0x76a4('0x19'));var config=require(_0x76a4('0x1a'));var licenseUtil=require(_0x76a4('0x1b'));var db=require(_0x76a4('0x1c'))['db'];function respondWithStatusCode(_0x230882,_0x138010){_0x138010=_0x138010||0xcc;return function(_0x56b800){if(_0x56b800){return _0x230882[_0x76a4('0x1d')](_0x138010);}return _0x230882[_0x76a4('0x1e')](_0x138010)[_0x76a4('0x1f')]();};}function respondWithResult(_0x2e8181,_0x5eeb62){_0x5eeb62=_0x5eeb62||0xc8;return function(_0x169211){if(_0x169211){return _0x2e8181[_0x76a4('0x1e')](_0x5eeb62)[_0x76a4('0x20')](_0x169211);}};}function respondWithFilteredResult(_0x2f70e2,_0x962263){return function(_0x2cfed3){if(_0x2cfed3){var _0x25e50c=typeof _0x962263[_0x76a4('0x21')]===_0x76a4('0x22')&&typeof _0x962263[_0x76a4('0x23')]===_0x76a4('0x22');var _0x1cfc51=_0x2cfed3[_0x76a4('0x24')];var _0xa091ba=_0x25e50c?0x0:_0x962263[_0x76a4('0x21')];var _0x57fb53=_0x25e50c?_0x2cfed3[_0x76a4('0x24')]:_0x962263[_0x76a4('0x21')]+_0x962263[_0x76a4('0x23')];var _0x17e734;if(_0x57fb53>=_0x1cfc51){_0x57fb53=_0x1cfc51;_0x17e734=0xc8;}else{_0x17e734=0xce;}_0x2f70e2[_0x76a4('0x1e')](_0x17e734);return _0x2f70e2['set']('Content-Range',_0xa091ba+'-'+_0x57fb53+'/'+_0x1cfc51)['json'](_0x2cfed3);}return null;};}function patchUpdates(_0x3ee68e){return function(_0x11e806){try{jsonpatch[_0x76a4('0x25')](_0x11e806,_0x3ee68e,!![]);}catch(_0x39d20d){return BPromise[_0x76a4('0x26')](_0x39d20d);}return _0x11e806[_0x76a4('0x27')]();};}function saveUpdates(_0x4813ff,_0x246d81){return function(_0x34dd31){if(_0x34dd31){return _0x34dd31[_0x76a4('0x28')](_0x4813ff)[_0x76a4('0x29')](function(_0x4df760){return _0x4df760;});}return null;};}function removeEntity(_0xc89e5d,_0x253974){return function(_0x4b9bfa){if(_0x4b9bfa){return _0x4b9bfa[_0x76a4('0x2a')]()[_0x76a4('0x29')](function(){var _0x16783b=_0x4b9bfa[_0x76a4('0x2b')]({'plain':!![]});var _0xe11f8f=_0x76a4('0x2c');return db[_0x76a4('0x2d')]['destroy']({'where':{'type':_0xe11f8f,'resourceId':_0x16783b['id']}})[_0x76a4('0x29')](function(){return _0x4b9bfa;});})[_0x76a4('0x29')](function(){_0xc89e5d[_0x76a4('0x1e')](0xcc)[_0x76a4('0x1f')]();});}};}function handleEntityNotFound(_0x1aaf5b,_0xc4a263){return function(_0x35308e){if(!_0x35308e){_0x1aaf5b[_0x76a4('0x1d')](0x194);}return _0x35308e;};}function handleError(_0x430e4a,_0x5bb5b1){_0x5bb5b1=_0x5bb5b1||0x1f4;return function(_0x59c759){logger[_0x76a4('0x2e')](_0x59c759[_0x76a4('0x2f')]);if(_0x59c759[_0x76a4('0x30')]){delete _0x59c759[_0x76a4('0x30')];}_0x430e4a[_0x76a4('0x1e')](_0x5bb5b1)[_0x76a4('0x31')](_0x59c759);};}exports[_0x76a4('0x32')]=function(_0x5425ff,_0x415c05){var _0x334427={},_0x288d5e={},_0x1c7361={'count':0x0,'rows':[]};var _0x75d98c=_[_0x76a4('0x33')](db[_0x76a4('0x34')][_0x76a4('0x35')],function(_0x566609){return{'name':_0x566609[_0x76a4('0x36')],'type':_0x566609[_0x76a4('0x37')][_0x76a4('0x38')]};});_0x288d5e[_0x76a4('0x39')]=_['map'](_0x75d98c,_0x76a4('0x30'));_0x288d5e['query']=_[_0x76a4('0x3a')](_0x5425ff[_0x76a4('0x3b')]);_0x288d5e['filters']=_['intersection'](_0x288d5e[_0x76a4('0x39')],_0x288d5e[_0x76a4('0x3b')]);_0x334427[_0x76a4('0x3c')]=_['intersection'](_0x288d5e[_0x76a4('0x39')],qs[_0x76a4('0x3d')](_0x5425ff['query'][_0x76a4('0x3d')]));_0x334427[_0x76a4('0x3c')]=_0x334427[_0x76a4('0x3c')][_0x76a4('0x3e')]?_0x334427[_0x76a4('0x3c')]:_0x288d5e[_0x76a4('0x39')];if(!_0x5425ff[_0x76a4('0x3b')][_0x76a4('0x3f')]('nolimit')){_0x334427[_0x76a4('0x23')]=qs[_0x76a4('0x23')](_0x5425ff['query']['limit']);_0x334427[_0x76a4('0x21')]=qs[_0x76a4('0x21')](_0x5425ff['query'][_0x76a4('0x21')]);}_0x334427[_0x76a4('0x40')]=qs[_0x76a4('0x41')](_0x5425ff[_0x76a4('0x3b')]['sort']);_0x334427['where']=qs[_0x76a4('0x42')](_[_0x76a4('0x43')](_0x5425ff['query'],_0x288d5e[_0x76a4('0x42')]),_0x75d98c);if(_0x5425ff[_0x76a4('0x3b')]['filter']){_0x334427[_0x76a4('0x44')]=_[_0x76a4('0x45')](_0x334427[_0x76a4('0x44')],{'$or':_['map'](_0x75d98c,function(_0x36a3fe){if(_0x36a3fe[_0x76a4('0x37')]!==_0x76a4('0x46')){var _0x3e2c64={};_0x3e2c64[_0x36a3fe[_0x76a4('0x30')]]={'$like':'%'+_0x5425ff[_0x76a4('0x3b')][_0x76a4('0x47')]+'%'};return _0x3e2c64;}})});}_0x334427=_[_0x76a4('0x45')]({},_0x334427,_0x5425ff[_0x76a4('0x48')]);var _0x29e85e={'where':_0x334427[_0x76a4('0x44')]};return db[_0x76a4('0x34')][_0x76a4('0x24')](_0x29e85e)['then'](function(_0x3338c1){_0x1c7361[_0x76a4('0x24')]=_0x3338c1;if(_0x5425ff[_0x76a4('0x3b')][_0x76a4('0x49')]){_0x334427[_0x76a4('0x4a')]=[{'all':!![]}];}return db['JscriptyProject'][_0x76a4('0x4b')](_0x334427);})[_0x76a4('0x29')](function(_0x43de80){_0x1c7361[_0x76a4('0x4c')]=_0x43de80;return _0x1c7361;})[_0x76a4('0x29')](respondWithFilteredResult(_0x415c05,_0x334427))['catch'](handleError(_0x415c05,null));};exports[_0x76a4('0x4d')]=function(_0x1c1b0a,_0x8407e8){var _0x131f97={'raw':![],'where':{'id':_0x1c1b0a[_0x76a4('0x4e')]['id']}},_0x4a6c15={};_0x4a6c15[_0x76a4('0x39')]=_['keys'](db[_0x76a4('0x34')][_0x76a4('0x35')]);_0x4a6c15[_0x76a4('0x3b')]=_[_0x76a4('0x3a')](_0x1c1b0a[_0x76a4('0x3b')]);_0x4a6c15['filters']=_[_0x76a4('0x4f')](_0x4a6c15['model'],_0x4a6c15[_0x76a4('0x3b')]);_0x131f97[_0x76a4('0x3c')]=_[_0x76a4('0x4f')](_0x4a6c15['model'],qs[_0x76a4('0x3d')](_0x1c1b0a[_0x76a4('0x3b')]['fields']));_0x131f97[_0x76a4('0x3c')]=_0x131f97[_0x76a4('0x3c')][_0x76a4('0x3e')]?_0x131f97[_0x76a4('0x3c')]:_0x4a6c15[_0x76a4('0x39')];if(_0x1c1b0a['query'][_0x76a4('0x49')]){_0x131f97[_0x76a4('0x4a')]=[{'all':!![]}];}_0x131f97=_[_0x76a4('0x45')]({},_0x131f97,_0x1c1b0a[_0x76a4('0x48')]);return db[_0x76a4('0x34')][_0x76a4('0x50')](_0x131f97)[_0x76a4('0x29')](handleEntityNotFound(_0x8407e8,null))[_0x76a4('0x29')](respondWithResult(_0x8407e8,null))['catch'](handleError(_0x8407e8,null));};exports['create']=function(_0x56fff5,_0x286b21){return db[_0x76a4('0x34')]['create'](_0x56fff5[_0x76a4('0x51')],{})[_0x76a4('0x29')](function(_0xb01a9c){var _0x44b093=_0x56fff5[_0x76a4('0x52')][_0x76a4('0x2b')]({'plain':!![]});if(!_0x44b093)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44b093['role']==='user'){var _0x4533aa=_0xb01a9c['get']({'plain':!![]});var _0x2550fc=_0x76a4('0x2c');return db[_0x76a4('0x53')]['find']({'where':{'name':_0x2550fc,'userProfileId':_0x44b093[_0x76a4('0x54')]},'raw':!![]})[_0x76a4('0x29')](function(_0x39f93d){if(_0x39f93d&&_0x39f93d['autoAssociation']===0x0){return db['UserProfileResource'][_0x76a4('0x55')]({'name':_0x4533aa[_0x76a4('0x30')],'resourceId':_0x4533aa['id'],'type':_0x39f93d[_0x76a4('0x30')],'sectionId':_0x39f93d['id']},{})[_0x76a4('0x29')](function(){return _0xb01a9c;});}else{return _0xb01a9c;}})[_0x76a4('0x56')](function(_0x4ff075){logger[_0x76a4('0x2e')](_0x76a4('0x57'),_0x4ff075);throw _0x4ff075;});}return _0xb01a9c;})[_0x76a4('0x29')](respondWithResult(_0x286b21,0xc9))[_0x76a4('0x56')](handleError(_0x286b21,null));};exports['clone']=function(_0x1957dc,_0x2b31e3){var _0x503674={'where':{'id':_0x1957dc['params']['id']}},_0x371ed1={};_0x371ed1[_0x76a4('0x39')]=_[_0x76a4('0x3a')](db[_0x76a4('0x34')][_0x76a4('0x35')]);_0x503674[_0x76a4('0x3c')]=_['intersection'](_0x371ed1[_0x76a4('0x39')],qs[_0x76a4('0x3d')](_0x1957dc[_0x76a4('0x3b')][_0x76a4('0x3d')]));_0x503674[_0x76a4('0x3c')]=_0x503674[_0x76a4('0x3c')][_0x76a4('0x3e')]?_0x503674[_0x76a4('0x3c')]:_0x371ed1['model'];if(_0x1957dc[_0x76a4('0x3b')]['includeAll']){_0x503674[_0x76a4('0x4a')]=[{'all':!![]}];}_0x503674=_['merge']({},_0x503674,_0x1957dc[_0x76a4('0x48')]);return db[_0x76a4('0x34')][_0x76a4('0x50')](_0x503674)[_0x76a4('0x29')](handleEntityNotFound(_0x2b31e3,null))['then'](function(_0x51ae2e){if(_0x51ae2e){var _0x372e59=_0x51ae2e[_0x76a4('0x2b')]({'plain':!![]});_0x372e59=qs['omit'](_0x372e59,['id',_0x76a4('0x58'),_0x76a4('0x59')]);_0x1957dc[_0x76a4('0x51')]=_[_0x76a4('0x5a')](_0x1957dc[_0x76a4('0x51')],['id',_0x76a4('0x58'),_0x76a4('0x59')]);return db[_0x76a4('0x34')]['create'](_[_0x76a4('0x45')](_0x372e59,_0x1957dc[_0x76a4('0x51')]),{'include':_0x1957dc[_0x76a4('0x3b')]['includeAll']?[{'all':!![]}]:undefined})[_0x76a4('0x29')](function(_0x5a7753){var _0x230cd2=_0x1957dc[_0x76a4('0x52')][_0x76a4('0x2b')]({'plain':!![]});if(!_0x230cd2)throw new Error(_0x76a4('0x5b'));if(_0x230cd2['role']===_0x76a4('0x52')){var _0x57ba53=_0x5a7753[_0x76a4('0x2b')]({'plain':!![]});var _0x5ab84f=_0x76a4('0x2c');return db[_0x76a4('0x53')]['find']({'where':{'name':_0x5ab84f,'userProfileId':_0x230cd2[_0x76a4('0x54')]},'raw':!![]})[_0x76a4('0x29')](function(_0x65817b){if(_0x65817b&&_0x65817b[_0x76a4('0x5c')]===0x0){return db[_0x76a4('0x2d')]['create']({'name':_0x57ba53['name'],'resourceId':_0x57ba53['id'],'type':_0x65817b[_0x76a4('0x30')],'sectionId':_0x65817b['id']},{})[_0x76a4('0x29')](function(){return _0x5a7753;});}else{return _0x5a7753;}})['catch'](function(_0xd534a6){logger[_0x76a4('0x2e')](_0x76a4('0x57'),_0xd534a6);throw _0xd534a6;});}return _0x5a7753;});}})[_0x76a4('0x29')](respondWithResult(_0x2b31e3,0xc9))[_0x76a4('0x56')](handleError(_0x2b31e3,null));};exports[_0x76a4('0x28')]=function(_0x4b75c2,_0x3e236d){if(_0x4b75c2[_0x76a4('0x51')]['id']){delete _0x4b75c2[_0x76a4('0x51')]['id'];}return db[_0x76a4('0x34')]['find']({'where':{'id':_0x4b75c2[_0x76a4('0x4e')]['id']}})[_0x76a4('0x29')](handleEntityNotFound(_0x3e236d,null))[_0x76a4('0x29')](saveUpdates(_0x4b75c2[_0x76a4('0x51')],null))[_0x76a4('0x29')](respondWithResult(_0x3e236d,null))['catch'](handleError(_0x3e236d,null));};exports['destroy']=function(_0x4b8ee1,_0x27f379){return db[_0x76a4('0x34')][_0x76a4('0x50')]({'where':{'id':_0x4b8ee1[_0x76a4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x27f379,null))[_0x76a4('0x29')](removeEntity(_0x27f379,null))[_0x76a4('0x56')](handleError(_0x27f379,null));};exports[_0x76a4('0x5d')]=function(_0x4a0606,_0x446854,_0x1522e4){var _0x35cd76={'raw':!![],'where':{}};var _0x5033c5={};var _0x10183c={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x4a0606[_0x76a4('0x4e')]['id']}})[_0x76a4('0x29')](handleEntityNotFound(_0x446854,null))[_0x76a4('0x29')](function(_0x185070){if(_0x185070){_0x5033c5['model']=_[_0x76a4('0x3a')](db['JscriptySessionReport'][_0x76a4('0x35')]);_0x5033c5[_0x76a4('0x3b')]=_[_0x76a4('0x3a')](_0x4a0606[_0x76a4('0x3b')]);_0x5033c5['filters']=_[_0x76a4('0x4f')](_0x5033c5['model'],_0x5033c5[_0x76a4('0x3b')]);_0x35cd76[_0x76a4('0x3c')]=_['intersection'](_0x5033c5['model'],qs[_0x76a4('0x3d')](_0x4a0606[_0x76a4('0x3b')]['fields']));_0x35cd76[_0x76a4('0x3c')]=_0x35cd76[_0x76a4('0x3c')]['length']?_0x35cd76[_0x76a4('0x3c')]:_0x5033c5[_0x76a4('0x39')];if(!_0x4a0606[_0x76a4('0x3b')]['hasOwnProperty'](_0x76a4('0x5e'))){_0x35cd76[_0x76a4('0x23')]=qs[_0x76a4('0x23')](_0x4a0606[_0x76a4('0x3b')][_0x76a4('0x23')]);_0x35cd76[_0x76a4('0x21')]=qs[_0x76a4('0x21')](_0x4a0606['query'][_0x76a4('0x21')]);}_0x35cd76[_0x76a4('0x40')]=qs['sort'](_0x4a0606[_0x76a4('0x3b')][_0x76a4('0x41')]);_0x35cd76[_0x76a4('0x44')]=qs[_0x76a4('0x42')](_[_0x76a4('0x43')](_0x4a0606['query'],_0x5033c5[_0x76a4('0x42')]));_0x35cd76[_0x76a4('0x44')]['ProjectId']=_0x185070['id'];if(_0x4a0606['query'][_0x76a4('0x47')]){_0x35cd76[_0x76a4('0x44')]=_[_0x76a4('0x45')](_0x35cd76[_0x76a4('0x44')],{'$or':_[_0x76a4('0x33')](_0x35cd76[_0x76a4('0x3c')],function(_0xd99640){var _0x1069d8={};_0x1069d8[_0xd99640]={'$like':'%'+_0x4a0606[_0x76a4('0x3b')][_0x76a4('0x47')]+'%'};return _0x1069d8;})});}_0x35cd76=_[_0x76a4('0x45')]({},_0x35cd76,_0x4a0606['options']);return db[_0x76a4('0x5f')]['count']({'where':_0x35cd76['where']})['then'](function(_0x5b9879){_0x10183c['count']=_0x5b9879;if(_0x4a0606[_0x76a4('0x3b')][_0x76a4('0x49')]){_0x35cd76[_0x76a4('0x4a')]=[{'all':!![]}];}return db[_0x76a4('0x5f')][_0x76a4('0x4b')](_0x35cd76);})[_0x76a4('0x29')](function(_0x1fe333){_0x10183c[_0x76a4('0x4c')]=_0x1fe333;return _0x10183c;});}})['then'](respondWithFilteredResult(_0x446854,_0x35cd76))['catch'](handleError(_0x446854,null));};exports[_0x76a4('0x60')]=function(_0x4d316f,_0x19aee0,_0x7a24cf){var _0x25af55={'raw':!![],'where':{}};var _0x30bb37={};var _0x2c023f={'count':0x0,'rows':[]};return db[_0x76a4('0x34')]['findOne']({'where':{'id':_0x4d316f['params']['id']}})[_0x76a4('0x29')](handleEntityNotFound(_0x19aee0,null))['then'](function(_0x77e6fc){if(_0x77e6fc){_0x30bb37[_0x76a4('0x39')]=_[_0x76a4('0x3a')](db[_0x76a4('0x61')][_0x76a4('0x35')]);_0x30bb37[_0x76a4('0x3b')]=_['keys'](_0x4d316f['query']);_0x30bb37[_0x76a4('0x42')]=_['intersection'](_0x30bb37[_0x76a4('0x39')],_0x30bb37[_0x76a4('0x3b')]);_0x25af55[_0x76a4('0x3c')]=_[_0x76a4('0x4f')](_0x30bb37['model'],qs[_0x76a4('0x3d')](_0x4d316f['query']['fields']));_0x25af55[_0x76a4('0x3c')]=_0x25af55[_0x76a4('0x3c')]['length']?_0x25af55[_0x76a4('0x3c')]:_0x30bb37[_0x76a4('0x39')];if(!_0x4d316f[_0x76a4('0x3b')]['hasOwnProperty']('nolimit')){_0x25af55[_0x76a4('0x23')]=qs[_0x76a4('0x23')](_0x4d316f[_0x76a4('0x3b')][_0x76a4('0x23')]);_0x25af55[_0x76a4('0x21')]=qs['offset'](_0x4d316f[_0x76a4('0x3b')]['offset']);}_0x25af55['order']=qs[_0x76a4('0x41')](_0x4d316f[_0x76a4('0x3b')]['sort']);_0x25af55['where']=qs['filters'](_[_0x76a4('0x43')](_0x4d316f['query'],_0x30bb37['filters']));_0x25af55[_0x76a4('0x44')]['ProjectId']=_0x77e6fc['id'];if(_0x4d316f[_0x76a4('0x3b')][_0x76a4('0x47')]){_0x25af55['where']=_[_0x76a4('0x45')](_0x25af55[_0x76a4('0x44')],{'$or':_[_0x76a4('0x33')](_0x25af55[_0x76a4('0x3c')],function(_0x54150d){var _0x5c1a63={};_0x5c1a63[_0x54150d]={'$like':'%'+_0x4d316f[_0x76a4('0x3b')]['filter']+'%'};return _0x5c1a63;})});}_0x25af55=_[_0x76a4('0x45')]({},_0x25af55,_0x4d316f['options']);return db[_0x76a4('0x61')][_0x76a4('0x24')]({'where':_0x25af55['where']})[_0x76a4('0x29')](function(_0x94819f){_0x2c023f[_0x76a4('0x24')]=_0x94819f;if(_0x4d316f[_0x76a4('0x3b')][_0x76a4('0x49')]){_0x25af55[_0x76a4('0x4a')]=[{'all':!![]}];}return db[_0x76a4('0x61')][_0x76a4('0x4b')](_0x25af55);})[_0x76a4('0x29')](function(_0x3a1d82){_0x2c023f['rows']=_0x3a1d82;return _0x2c023f;});}})[_0x76a4('0x29')](respondWithFilteredResult(_0x19aee0,_0x25af55))[_0x76a4('0x56')](handleError(_0x19aee0,null));};function char(_0xbc669b){return _0x76a4('0x62')===typeof _0xbc669b?String['fromCharCode'][_0x76a4('0x25')](null,arguments):_0xbc669b;}function needsEncapsulation(_0x4457d0){return!!_0x4457d0&&(_0x4457d0[_0x76a4('0x63')]()[_0x76a4('0x64')](char(0xd))>=0x0||_0x4457d0[_0x76a4('0x63')]()[_0x76a4('0x64')](char(0xa))>=0x0||_0x4457d0[_0x76a4('0x63')]()['indexOf'](char(0x2c))>=0x0||_0x4457d0['toString']()[_0x76a4('0x64')](char(0x22))>=0x0);}function encapsulate(_0x5d94f7){var _0x3728f5=char(0x22),_0x8270db='\x5c'+char(0x22),_0x51b426=_0x5d94f7['toString']()[_0x76a4('0x65')](new RegExp(_0x3728f5,'g'),_0x8270db);return _0x3728f5+_0x51b426+_0x3728f5;}exports[_0x76a4('0x66')]=function(_0x5d156a,_0x916e11,_0x523dc3){var _0x12fb5a,_0x3853f3;var _0x1bde62={'where':{'ProjectId':_0x5d156a['params']['id']}};if(_0x5d156a['query'][_0x76a4('0x67')]){_0x1bde62[_0x76a4('0x44')][_0x76a4('0x68')]=JSON[_0x76a4('0x69')](_0x5d156a[_0x76a4('0x3b')]['startTime']);}return db[_0x76a4('0x5f')][_0x76a4('0x4b')](_0x1bde62)[_0x76a4('0x29')](handleEntityNotFound(_0x916e11,null))[_0x76a4('0x29')](function(_0x4b71e4){if(_0x4b71e4){_0x12fb5a=_0x4b71e4;return db[_0x76a4('0x6a')][_0x76a4('0x4b')]({'where':{'SessionId':{'$in':_[_0x76a4('0x33')](_0x12fb5a,'id')},'ProjectId':_0x5d156a['params']['id']},'order':_0x76a4('0x6b')});}})[_0x76a4('0x29')](handleEntityNotFound(_0x916e11,null))['then'](function(_0x300da9){if(_0x300da9){_0x3853f3=_0x300da9;var _0x53b2a5={};for(var _0x3932a7=0x0,_0x18f70c=_0x3853f3[_0x76a4('0x3e')];_0x3932a7<_0x18f70c;_0x3932a7++){if(!_0x53b2a5[_0x76a4('0x3f')](_0x3853f3[_0x3932a7][_0x76a4('0x6c')])){_0x53b2a5[_0x3853f3[_0x3932a7][_0x76a4('0x6c')]]=needsEncapsulation(_0x3853f3[_0x3932a7][_0x76a4('0x6d')])?encapsulate(_0x3853f3[_0x3932a7][_0x76a4('0x6d')]):_0x3853f3[_0x3932a7][_0x76a4('0x6d')];}}var _0x2c9f9e=[],_0x365299={};for(var _0x5b9783=0x0,_0x1106de=_0x12fb5a[_0x76a4('0x3e')];_0x5b9783<_0x1106de;_0x5b9783++){_0x365299={'ProjectId':_0x5d156a['params']['id'],'SessionId':_0x12fb5a[_0x5b9783]['id'],'StartTime':moment(_0x12fb5a[_0x5b9783][_0x76a4('0x68')])[_0x76a4('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x10dfbb=0x0,_0x1b6bba=_0x3853f3['length'];_0x10dfbb<_0x1b6bba;_0x10dfbb++){if(_0x3853f3[_0x10dfbb][_0x76a4('0x6f')]==_0x12fb5a[_0x5b9783]['id']&&_0x53b2a5['hasOwnProperty'](_0x3853f3[_0x10dfbb][_0x76a4('0x6c')])){_0x365299[_0x53b2a5[_0x3853f3[_0x10dfbb][_0x76a4('0x6c')]]]=_0x3853f3[_0x10dfbb][_0x76a4('0x70')];}}for(var _0xe2c80b in _0x53b2a5){if(!_0x365299['hasOwnProperty'](_0x53b2a5[_0xe2c80b])){_0x365299[_0x53b2a5[_0xe2c80b]]=null;}}_0x2c9f9e[_0x76a4('0x71')](_0x365299);}return _0x2c9f9e;}})[_0x76a4('0x29')](function(_0x358013){if(!_[_0x76a4('0x72')](_0x358013)){var _0x31b443=toCsv(_0x358013);var _0x25d01b=Date['now']();fs[_0x76a4('0x73')](util['format'](_0x76a4('0x74'),_0x5d156a[_0x76a4('0x4e')]['id'],_0x25d01b),_0x31b443);_0x916e11[_0x76a4('0x75')](_0x76a4('0x76'),_0x76a4('0x77')+util['format'](_0x76a4('0x78'),_0x5d156a[_0x76a4('0x4e')]['id'],_0x25d01b));_0x916e11[_0x76a4('0x75')](_0x76a4('0x79'),'text/csv');return _0x916e11[_0x76a4('0x7a')](util[_0x76a4('0x6e')](_0x76a4('0x74'),_0x5d156a[_0x76a4('0x4e')]['id'],_0x25d01b));}else{return _0x916e11[_0x76a4('0x1d')](0xcc);}})[_0x76a4('0x56')](handleError(_0x916e11,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 28403ca..498e608 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 _0xaa19=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x5109c7,_0x5f0171){var _0x18eafc=function(_0x101ec3){while(--_0x101ec3){_0x5109c7['push'](_0x5109c7['shift']());}};_0x18eafc(++_0x5f0171);}(_0xaa19,0x79));var _0x9aa1=function(_0x131ff2,_0x2baea2){_0x131ff2=_0x131ff2-0x0;var _0x3c1ecc=_0xaa19[_0x131ff2];return _0x3c1ecc;};'use strict';var _=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var logger=require(_0x9aa1('0x2'))(_0x9aa1('0x3'));var moment=require('moment');var BPromise=require(_0x9aa1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9aa1('0x5'));var rimraf=require('rimraf');var config=require(_0x9aa1('0x6'));var attributes=require(_0x9aa1('0x7'));module[_0x9aa1('0x8')]=function(_0x52124b,_0x1e59f8){return _0x52124b[_0x9aa1('0x9')](_0x9aa1('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dac=['../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x134631,_0x4870a1){var _0x3412d8=function(_0x4248ff){while(--_0x4248ff){_0x134631['push'](_0x134631['shift']());}};_0x3412d8(++_0x4870a1);}(_0x6dac,0x16e));var _0xc6da=function(_0x36ef13,_0x32851d){_0x36ef13=_0x36ef13-0x0;var _0x233cec=_0x6dac[_0x36ef13];return _0x233cec;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require(_0xc6da('0x4'));var BPromise=require(_0xc6da('0x5'));var rp=require(_0xc6da('0x6'));var fs=require('fs');var path=require(_0xc6da('0x7'));var rimraf=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var attributes=require(_0xc6da('0xa'));module[_0xc6da('0xb')]=function(_0x325f49,_0x5caf49){return _0x325f49[_0xc6da('0xc')](_0xc6da('0xd'),attributes,{'tableName':_0xc6da('0xe'),'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 f06d2a3..9c25e8d 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4cbd5a,_0x2396d5){var _0x592330=function(_0x1c1b12){while(--_0x1c1b12){_0x4cbd5a['push'](_0x4cbd5a['shift']());}};_0x592330(++_0x2396d5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x21212c,_0xabbaf3){_0x21212c=_0x21212c-0x0;var _0x137677=_0xb43b[_0x21212c];return _0x137677;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xac4a,0x13f));var _0xaac4=function(_0x9dd182,_0x535e45){_0x9dd182=_0x9dd182-0x0;var _0x1af42d=_0xac4a[_0x9dd182];return _0x1af42d;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2f25a6d..e004cfa 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 _0xce8a=['describe','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe'];(function(_0x36cffd,_0x12fb18){var _0x105188=function(_0x100673){while(--_0x100673){_0x36cffd['push'](_0x36cffd['shift']());}};_0x105188(++_0x12fb18);}(_0xce8a,0x1ea));var _0xace8=function(_0x1b536d,_0x157f49){_0x1b536d=_0x1b536d-0x0;var _0x5c3fe3=_0xce8a[_0x1b536d];return _0x5c3fe3;};'use strict';var multer=require(_0xace8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xace8('0x1')]();var fs_extra=require(_0xace8('0x2'));var auth=require(_0xace8('0x3'));var interaction=require(_0xace8('0x4'));var config=require(_0xace8('0x5'));var controller=require(_0xace8('0x6'));router[_0xace8('0x7')]('/',auth['isAuthenticated'](),controller[_0xace8('0x8')]);router[_0xace8('0x7')](_0xace8('0x9'),auth['isAuthenticated'](),controller[_0xace8('0xa')]);router[_0xace8('0x7')](_0xace8('0xb'),auth['isAuthenticated'](),controller[_0xace8('0xc')]);router[_0xace8('0xd')]('/',auth[_0xace8('0xe')](),controller[_0xace8('0xf')]);router[_0xace8('0x10')](_0xace8('0xb'),auth['isAuthenticated'](),controller[_0xace8('0x11')]);router[_0xace8('0x12')]('/:id',auth[_0xace8('0xe')](),controller['destroy']);module[_0xace8('0x13')]=router; \ No newline at end of file +var _0x10d6=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','describe','/:id'];(function(_0x14e258,_0x4265d1){var _0x120325=function(_0x5519af){while(--_0x5519af){_0x14e258['push'](_0x14e258['shift']());}};_0x120325(++_0x4265d1);}(_0x10d6,0x14b));var _0x610d=function(_0x2dd82b,_0x384905){_0x2dd82b=_0x2dd82b-0x0;var _0x31d2df=_0x10d6[_0x2dd82b];return _0x31d2df;};'use strict';var multer=require(_0x610d('0x0'));var util=require(_0x610d('0x1'));var path=require(_0x610d('0x2'));var timeout=require('connect-timeout');var express=require(_0x610d('0x3'));var router=express['Router']();var fs_extra=require(_0x610d('0x4'));var auth=require(_0x610d('0x5'));var interaction=require(_0x610d('0x6'));var config=require(_0x610d('0x7'));var controller=require(_0x610d('0x8'));router[_0x610d('0x9')]('/',auth['isAuthenticated'](),controller[_0x610d('0xa')]);router[_0x610d('0x9')](_0x610d('0xb'),auth['isAuthenticated'](),controller[_0x610d('0xc')]);router[_0x610d('0x9')](_0x610d('0xd'),auth[_0x610d('0xe')](),controller[_0x610d('0xf')]);router[_0x610d('0x10')]('/',auth[_0x610d('0xe')](),controller[_0x610d('0x11')]);router[_0x610d('0x12')](_0x610d('0xd'),auth[_0x610d('0xe')](),controller[_0x610d('0x13')]);router[_0x610d('0x14')](_0x610d('0xd'),auth[_0x610d('0xe')](),controller[_0x610d('0x15')]);module[_0x610d('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 6db8eb0..d089e5e 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(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x3360ce,_0x1603d5){_0x3360ce=_0x3360ce-0x0;var _0x1c6f4f=_0x7a54[_0x3360ce];return _0x1c6f4f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0xed3624,_0x3da0db){_0xed3624=_0xed3624-0x0;var _0x61682b=_0x7a54[_0xed3624];return _0x61682b;};'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 ed42349..029dd5d 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 _0x545e=['key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','intersection','include','options','create','body','find','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x545e,0x13b));var _0xe545=function(_0x3d05d1,_0x4325fc){_0x3d05d1=_0x3d05d1-0x0;var _0x3dc93e=_0x545e[_0x3d05d1];return _0x3dc93e;};'use strict';var emlformat=require(_0xe545('0x0'));var rimraf=require(_0xe545('0x1'));var zipdir=require(_0xe545('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe545('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe545('0x4'));var path=require(_0xe545('0x5'));var sox=require(_0xe545('0x6'));var csv=require(_0xe545('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe545('0x8'));var _=require(_0xe545('0x9'));var squel=require(_0xe545('0xa'));var crypto=require(_0xe545('0xb'));var jsforce=require(_0xe545('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe545('0x7'));var querystring=require(_0xe545('0xd'));var Papa=require(_0xe545('0xe'));var Redis=require(_0xe545('0xf'));var authService=require(_0xe545('0x10'));var qs=require(_0xe545('0x11'));var as=require(_0xe545('0x12'));var hardwareService=require(_0xe545('0x13'));var logger=require(_0xe545('0x14'))('api');var utils=require(_0xe545('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe545('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2acad,_0x3d95a6){_0x3d95a6=_0x3d95a6||0xcc;return function(_0x703144){if(_0x703144){return _0x2acad[_0xe545('0x17')](_0x3d95a6);}return _0x2acad[_0xe545('0x18')](_0x3d95a6)[_0xe545('0x19')]();};}function respondWithResult(_0x1ed2ca,_0x22677d){_0x22677d=_0x22677d||0xc8;return function(_0x3d4d85){if(_0x3d4d85){return _0x1ed2ca[_0xe545('0x18')](_0x22677d)[_0xe545('0x1a')](_0x3d4d85);}};}function respondWithFilteredResult(_0x43fb80,_0x29536c){return function(_0x31d75b){if(_0x31d75b){var _0x50e888=typeof _0x29536c['offset']===_0xe545('0x1b')&&typeof _0x29536c[_0xe545('0x1c')]===_0xe545('0x1b');var _0x7ec26b=_0x31d75b[_0xe545('0x1d')];var _0x87a1ec=_0x50e888?0x0:_0x29536c[_0xe545('0x1e')];var _0x3a092e=_0x50e888?_0x31d75b['count']:_0x29536c[_0xe545('0x1e')]+_0x29536c[_0xe545('0x1c')];var _0x1221cd;if(_0x3a092e>=_0x7ec26b){_0x3a092e=_0x7ec26b;_0x1221cd=0xc8;}else{_0x1221cd=0xce;}_0x43fb80[_0xe545('0x18')](_0x1221cd);return _0x43fb80['set'](_0xe545('0x1f'),_0x87a1ec+'-'+_0x3a092e+'/'+_0x7ec26b)['json'](_0x31d75b);}return null;};}function patchUpdates(_0x4f129e){return function(_0x203c22){try{jsonpatch['apply'](_0x203c22,_0x4f129e,!![]);}catch(_0x41eb05){return BPromise[_0xe545('0x20')](_0x41eb05);}return _0x203c22[_0xe545('0x21')]();};}function saveUpdates(_0x5b6a3d,_0x1481f7){return function(_0x119743){if(_0x119743){return _0x119743[_0xe545('0x22')](_0x5b6a3d)['then'](function(_0x25a874){return _0x25a874;});}return null;};}function removeEntity(_0xb74e40,_0x27c28f){return function(_0x4ccdd8){if(_0x4ccdd8){return _0x4ccdd8[_0xe545('0x23')]()[_0xe545('0x24')](function(){_0xb74e40[_0xe545('0x18')](0xcc)[_0xe545('0x19')]();});}};}function handleEntityNotFound(_0x3b79af,_0x17a99c){return function(_0x41d63f){if(!_0x41d63f){_0x3b79af[_0xe545('0x17')](0x194);}return _0x41d63f;};}function handleError(_0x584836,_0x3fbcbd){_0x3fbcbd=_0x3fbcbd||0x1f4;return function(_0x25fdd0){logger[_0xe545('0x25')](_0x25fdd0[_0xe545('0x26')]);if(_0x25fdd0[_0xe545('0x27')]){delete _0x25fdd0['name'];}_0x584836[_0xe545('0x18')](_0x3fbcbd)[_0xe545('0x28')](_0x25fdd0);};}exports['index']=function(_0x512f12,_0x16c0b3){var _0xe3fec2={},_0x38a57a={},_0xbf0e62={'count':0x0,'rows':[]};var _0x552c5d=_[_0xe545('0x29')](db[_0xe545('0x2a')][_0xe545('0x2b')],function(_0x5e25d2){return{'name':_0x5e25d2[_0xe545('0x2c')],'type':_0x5e25d2['type'][_0xe545('0x2d')]};});_0x38a57a[_0xe545('0x2e')]=_['map'](_0x552c5d,_0xe545('0x27'));_0x38a57a[_0xe545('0x2f')]=_[_0xe545('0x30')](_0x512f12[_0xe545('0x2f')]);_0x38a57a[_0xe545('0x31')]=_['intersection'](_0x38a57a[_0xe545('0x2e')],_0x38a57a[_0xe545('0x2f')]);_0xe3fec2[_0xe545('0x32')]=_['intersection'](_0x38a57a[_0xe545('0x2e')],qs['fields'](_0x512f12[_0xe545('0x2f')][_0xe545('0x33')]));_0xe3fec2[_0xe545('0x32')]=_0xe3fec2[_0xe545('0x32')]['length']?_0xe3fec2[_0xe545('0x32')]:_0x38a57a[_0xe545('0x2e')];if(!_0x512f12[_0xe545('0x2f')][_0xe545('0x34')](_0xe545('0x35'))){_0xe3fec2[_0xe545('0x1c')]=qs[_0xe545('0x1c')](_0x512f12[_0xe545('0x2f')][_0xe545('0x1c')]);_0xe3fec2['offset']=qs[_0xe545('0x1e')](_0x512f12[_0xe545('0x2f')][_0xe545('0x1e')]);}_0xe3fec2['order']=qs[_0xe545('0x36')](_0x512f12[_0xe545('0x2f')][_0xe545('0x36')]);_0xe3fec2[_0xe545('0x37')]=qs['filters'](_['pick'](_0x512f12[_0xe545('0x2f')],_0x38a57a['filters']),_0x552c5d);if(_0x512f12[_0xe545('0x2f')][_0xe545('0x38')]){_0xe3fec2[_0xe545('0x37')]=_[_0xe545('0x39')](_0xe3fec2[_0xe545('0x37')],{'$or':_[_0xe545('0x29')](_0x552c5d,function(_0x1accb3){if(_0x1accb3[_0xe545('0x3a')]!==_0xe545('0x3b')){var _0x3a8eec={};_0x3a8eec[_0x1accb3['name']]={'$like':'%'+_0x512f12[_0xe545('0x2f')]['filter']+'%'};return _0x3a8eec;}})});}_0xe3fec2=_[_0xe545('0x39')]({},_0xe3fec2,_0x512f12['options']);var _0x27892f={'where':_0xe3fec2[_0xe545('0x37')]};return db[_0xe545('0x2a')][_0xe545('0x1d')](_0x27892f)['then'](function(_0x4af369){_0xbf0e62[_0xe545('0x1d')]=_0x4af369;if(_0x512f12['query'][_0xe545('0x3c')]){_0xe3fec2['include']=[{'all':!![]}];}return db[_0xe545('0x2a')][_0xe545('0x3d')](_0xe3fec2);})[_0xe545('0x24')](function(_0x3fd591){_0xbf0e62[_0xe545('0x3e')]=_0x3fd591;return _0xbf0e62;})['then'](respondWithFilteredResult(_0x16c0b3,_0xe3fec2))[_0xe545('0x3f')](handleError(_0x16c0b3,null));};exports[_0xe545('0x40')]=function(_0x4616a7,_0x2e00e3){var _0x340a6b={'raw':!![],'where':{'id':_0x4616a7[_0xe545('0x41')]['id']}},_0x5714ad={};_0x5714ad[_0xe545('0x2e')]=_[_0xe545('0x30')](db[_0xe545('0x2a')][_0xe545('0x2b')]);_0x5714ad[_0xe545('0x2f')]=_[_0xe545('0x30')](_0x4616a7[_0xe545('0x2f')]);_0x5714ad['filters']=_[_0xe545('0x42')](_0x5714ad[_0xe545('0x2e')],_0x5714ad[_0xe545('0x2f')]);_0x340a6b['attributes']=_[_0xe545('0x42')](_0x5714ad['model'],qs['fields'](_0x4616a7[_0xe545('0x2f')][_0xe545('0x33')]));_0x340a6b[_0xe545('0x32')]=_0x340a6b[_0xe545('0x32')]['length']?_0x340a6b['attributes']:_0x5714ad[_0xe545('0x2e')];if(_0x4616a7[_0xe545('0x2f')]['includeAll']){_0x340a6b[_0xe545('0x43')]=[{'all':!![]}];}_0x340a6b=_[_0xe545('0x39')]({},_0x340a6b,_0x4616a7[_0xe545('0x44')]);return db[_0xe545('0x2a')]['find'](_0x340a6b)['then'](handleEntityNotFound(_0x2e00e3,null))[_0xe545('0x24')](respondWithResult(_0x2e00e3,null))[_0xe545('0x3f')](handleError(_0x2e00e3,null));};exports['create']=function(_0x5253a6,_0x3eedac){return db[_0xe545('0x2a')][_0xe545('0x45')](_0x5253a6[_0xe545('0x46')],{})[_0xe545('0x24')](respondWithResult(_0x3eedac,0xc9))[_0xe545('0x3f')](handleError(_0x3eedac,null));};exports[_0xe545('0x22')]=function(_0x245674,_0x1cd7b3){if(_0x245674[_0xe545('0x46')]['id']){delete _0x245674['body']['id'];}return db[_0xe545('0x2a')][_0xe545('0x47')]({'where':{'id':_0x245674['params']['id']}})[_0xe545('0x24')](handleEntityNotFound(_0x1cd7b3,null))[_0xe545('0x24')](saveUpdates(_0x245674[_0xe545('0x46')],null))['then'](respondWithResult(_0x1cd7b3,null))['catch'](handleError(_0x1cd7b3,null));};exports[_0xe545('0x23')]=function(_0x46ca8a,_0x546d78){return db['JscriptyQuestionReport'][_0xe545('0x47')]({'where':{'id':_0x46ca8a[_0xe545('0x41')]['id']}})[_0xe545('0x24')](handleEntityNotFound(_0x546d78,null))[_0xe545('0x24')](removeEntity(_0x546d78,null))[_0xe545('0x3f')](handleError(_0x546d78,null));};exports['describe']=function(_0x1971fd,_0x9a03c7){return db[_0xe545('0x2a')]['describe']()[_0xe545('0x24')](respondWithResult(_0x9a03c7,null))['catch'](handleError(_0x9a03c7,null));}; \ No newline at end of file +var _0xb69c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring'];(function(_0x3987b4,_0x1f3f7b){var _0x46fbd0=function(_0x19973a){while(--_0x19973a){_0x3987b4['push'](_0x3987b4['shift']());}};_0x46fbd0(++_0x1f3f7b);}(_0xb69c,0x175));var _0xcb69=function(_0x523306,_0x47abfd){_0x523306=_0x523306-0x0;var _0x3d5f31=_0xb69c[_0x523306];return _0x3d5f31;};'use strict';var emlformat=require(_0xcb69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb69('0x1'));var jsonpatch=require(_0xcb69('0x2'));var rp=require(_0xcb69('0x3'));var moment=require(_0xcb69('0x4'));var BPromise=require(_0xcb69('0x5'));var Mustache=require(_0xcb69('0x6'));var util=require(_0xcb69('0x7'));var path=require(_0xcb69('0x8'));var sox=require(_0xcb69('0x9'));var csv=require(_0xcb69('0xa'));var ejs=require(_0xcb69('0xb'));var fs=require('fs');var fs_extra=require(_0xcb69('0xc'));var _=require(_0xcb69('0xd'));var squel=require('squel');var crypto=require(_0xcb69('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcb69('0xf'));var toCsv=require(_0xcb69('0xa'));var querystring=require(_0xcb69('0x10'));var Papa=require(_0xcb69('0x11'));var Redis=require(_0xcb69('0x12'));var authService=require(_0xcb69('0x13'));var qs=require(_0xcb69('0x14'));var as=require(_0xcb69('0x15'));var hardwareService=require(_0xcb69('0x16'));var logger=require('../../config/logger')(_0xcb69('0x17'));var utils=require('../../config/utils');var config=require(_0xcb69('0x18'));var licenseUtil=require(_0xcb69('0x19'));var db=require(_0xcb69('0x1a'))['db'];function respondWithStatusCode(_0x53bb6e,_0x5d07e0){_0x5d07e0=_0x5d07e0||0xcc;return function(_0x4d66ec){if(_0x4d66ec){return _0x53bb6e['sendStatus'](_0x5d07e0);}return _0x53bb6e[_0xcb69('0x1b')](_0x5d07e0)[_0xcb69('0x1c')]();};}function respondWithResult(_0x301d25,_0x2b2e6e){_0x2b2e6e=_0x2b2e6e||0xc8;return function(_0x376664){if(_0x376664){return _0x301d25[_0xcb69('0x1b')](_0x2b2e6e)['json'](_0x376664);}};}function respondWithFilteredResult(_0x5929c1,_0x16a30f){return function(_0x3b609c){if(_0x3b609c){var _0x30b83f=typeof _0x16a30f[_0xcb69('0x1d')]===_0xcb69('0x1e')&&typeof _0x16a30f['limit']===_0xcb69('0x1e');var _0x56d295=_0x3b609c[_0xcb69('0x1f')];var _0x1fc8f8=_0x30b83f?0x0:_0x16a30f['offset'];var _0x48872b=_0x30b83f?_0x3b609c['count']:_0x16a30f[_0xcb69('0x1d')]+_0x16a30f[_0xcb69('0x20')];var _0x522ca3;if(_0x48872b>=_0x56d295){_0x48872b=_0x56d295;_0x522ca3=0xc8;}else{_0x522ca3=0xce;}_0x5929c1['status'](_0x522ca3);return _0x5929c1[_0xcb69('0x21')](_0xcb69('0x22'),_0x1fc8f8+'-'+_0x48872b+'/'+_0x56d295)[_0xcb69('0x23')](_0x3b609c);}return null;};}function patchUpdates(_0xcb2086){return function(_0x20e997){try{jsonpatch[_0xcb69('0x24')](_0x20e997,_0xcb2086,!![]);}catch(_0x4e33d3){return BPromise[_0xcb69('0x25')](_0x4e33d3);}return _0x20e997['save']();};}function saveUpdates(_0x395ce4,_0x5d06a){return function(_0x4c6efc){if(_0x4c6efc){return _0x4c6efc[_0xcb69('0x26')](_0x395ce4)['then'](function(_0x5007f9){return _0x5007f9;});}return null;};}function removeEntity(_0x3c979a,_0x372b5b){return function(_0x198432){if(_0x198432){return _0x198432[_0xcb69('0x27')]()[_0xcb69('0x28')](function(){_0x3c979a['status'](0xcc)[_0xcb69('0x1c')]();});}};}function handleEntityNotFound(_0x2415d3,_0x11e103){return function(_0x18beb8){if(!_0x18beb8){_0x2415d3['sendStatus'](0x194);}return _0x18beb8;};}function handleError(_0x3fc177,_0x3d63f4){_0x3d63f4=_0x3d63f4||0x1f4;return function(_0x141f46){logger[_0xcb69('0x29')](_0x141f46['stack']);if(_0x141f46[_0xcb69('0x2a')]){delete _0x141f46[_0xcb69('0x2a')];}_0x3fc177['status'](_0x3d63f4)[_0xcb69('0x2b')](_0x141f46);};}exports[_0xcb69('0x2c')]=function(_0x21ae64,_0x5ef170){var _0x53ad08={},_0x1bd19b={},_0x3491dd={'count':0x0,'rows':[]};var _0x232760=_['map'](db['JscriptyQuestionReport'][_0xcb69('0x2d')],function(_0x59ef81){return{'name':_0x59ef81['fieldName'],'type':_0x59ef81[_0xcb69('0x2e')][_0xcb69('0x2f')]};});_0x1bd19b[_0xcb69('0x30')]=_[_0xcb69('0x31')](_0x232760,'name');_0x1bd19b[_0xcb69('0x32')]=_[_0xcb69('0x33')](_0x21ae64[_0xcb69('0x32')]);_0x1bd19b[_0xcb69('0x34')]=_[_0xcb69('0x35')](_0x1bd19b[_0xcb69('0x30')],_0x1bd19b['query']);_0x53ad08[_0xcb69('0x36')]=_[_0xcb69('0x35')](_0x1bd19b[_0xcb69('0x30')],qs['fields'](_0x21ae64[_0xcb69('0x32')][_0xcb69('0x37')]));_0x53ad08['attributes']=_0x53ad08[_0xcb69('0x36')][_0xcb69('0x38')]?_0x53ad08[_0xcb69('0x36')]:_0x1bd19b[_0xcb69('0x30')];if(!_0x21ae64[_0xcb69('0x32')][_0xcb69('0x39')](_0xcb69('0x3a'))){_0x53ad08[_0xcb69('0x20')]=qs[_0xcb69('0x20')](_0x21ae64[_0xcb69('0x32')][_0xcb69('0x20')]);_0x53ad08[_0xcb69('0x1d')]=qs['offset'](_0x21ae64['query'][_0xcb69('0x1d')]);}_0x53ad08['order']=qs[_0xcb69('0x3b')](_0x21ae64[_0xcb69('0x32')][_0xcb69('0x3b')]);_0x53ad08[_0xcb69('0x3c')]=qs[_0xcb69('0x34')](_[_0xcb69('0x3d')](_0x21ae64[_0xcb69('0x32')],_0x1bd19b[_0xcb69('0x34')]),_0x232760);if(_0x21ae64[_0xcb69('0x32')]['filter']){_0x53ad08[_0xcb69('0x3c')]=_[_0xcb69('0x3e')](_0x53ad08['where'],{'$or':_[_0xcb69('0x31')](_0x232760,function(_0x1f6c3f){if(_0x1f6c3f['type']!==_0xcb69('0x3f')){var _0x3db159={};_0x3db159[_0x1f6c3f['name']]={'$like':'%'+_0x21ae64[_0xcb69('0x32')][_0xcb69('0x40')]+'%'};return _0x3db159;}})});}_0x53ad08=_[_0xcb69('0x3e')]({},_0x53ad08,_0x21ae64[_0xcb69('0x41')]);var _0x2cd151={'where':_0x53ad08[_0xcb69('0x3c')]};return db[_0xcb69('0x42')][_0xcb69('0x1f')](_0x2cd151)['then'](function(_0x1568c3){_0x3491dd[_0xcb69('0x1f')]=_0x1568c3;if(_0x21ae64[_0xcb69('0x32')][_0xcb69('0x43')]){_0x53ad08[_0xcb69('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xcb69('0x45')](_0x53ad08);})[_0xcb69('0x28')](function(_0x59a9bc){_0x3491dd[_0xcb69('0x46')]=_0x59a9bc;return _0x3491dd;})[_0xcb69('0x28')](respondWithFilteredResult(_0x5ef170,_0x53ad08))[_0xcb69('0x47')](handleError(_0x5ef170,null));};exports[_0xcb69('0x48')]=function(_0x50c897,_0x206125){var _0x270a5a={'raw':!![],'where':{'id':_0x50c897[_0xcb69('0x49')]['id']}},_0x2a9dab={};_0x2a9dab[_0xcb69('0x30')]=_[_0xcb69('0x33')](db[_0xcb69('0x42')][_0xcb69('0x2d')]);_0x2a9dab['query']=_[_0xcb69('0x33')](_0x50c897['query']);_0x2a9dab[_0xcb69('0x34')]=_[_0xcb69('0x35')](_0x2a9dab[_0xcb69('0x30')],_0x2a9dab['query']);_0x270a5a[_0xcb69('0x36')]=_[_0xcb69('0x35')](_0x2a9dab[_0xcb69('0x30')],qs[_0xcb69('0x37')](_0x50c897[_0xcb69('0x32')][_0xcb69('0x37')]));_0x270a5a[_0xcb69('0x36')]=_0x270a5a[_0xcb69('0x36')][_0xcb69('0x38')]?_0x270a5a['attributes']:_0x2a9dab[_0xcb69('0x30')];if(_0x50c897['query'][_0xcb69('0x43')]){_0x270a5a[_0xcb69('0x44')]=[{'all':!![]}];}_0x270a5a=_[_0xcb69('0x3e')]({},_0x270a5a,_0x50c897[_0xcb69('0x41')]);return db[_0xcb69('0x42')][_0xcb69('0x4a')](_0x270a5a)[_0xcb69('0x28')](handleEntityNotFound(_0x206125,null))['then'](respondWithResult(_0x206125,null))[_0xcb69('0x47')](handleError(_0x206125,null));};exports[_0xcb69('0x4b')]=function(_0x320cca,_0x426f88){return db['JscriptyQuestionReport'][_0xcb69('0x4b')](_0x320cca[_0xcb69('0x4c')],{})[_0xcb69('0x28')](respondWithResult(_0x426f88,0xc9))[_0xcb69('0x47')](handleError(_0x426f88,null));};exports['update']=function(_0x4a77bf,_0x355e48){if(_0x4a77bf[_0xcb69('0x4c')]['id']){delete _0x4a77bf[_0xcb69('0x4c')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x4a77bf[_0xcb69('0x49')]['id']}})[_0xcb69('0x28')](handleEntityNotFound(_0x355e48,null))[_0xcb69('0x28')](saveUpdates(_0x4a77bf[_0xcb69('0x4c')],null))['then'](respondWithResult(_0x355e48,null))[_0xcb69('0x47')](handleError(_0x355e48,null));};exports[_0xcb69('0x27')]=function(_0x6f3433,_0x407f4b){return db[_0xcb69('0x42')][_0xcb69('0x4a')]({'where':{'id':_0x6f3433[_0xcb69('0x49')]['id']}})[_0xcb69('0x28')](handleEntityNotFound(_0x407f4b,null))[_0xcb69('0x28')](removeEntity(_0x407f4b,null))[_0xcb69('0x47')](handleError(_0x407f4b,null));};exports[_0xcb69('0x4d')]=function(_0x4c75cf,_0x3870f7){return db[_0xcb69('0x42')][_0xcb69('0x4d')]()[_0xcb69('0x28')](respondWithResult(_0x3870f7,null))[_0xcb69('0x47')](handleError(_0x3870f7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index c343add..b12be15 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 _0x8d58=['../../config/logger','api','bluebird','request-promise','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x8e6111,_0x401431){var _0x4eea98=function(_0x3ca78a){while(--_0x3ca78a){_0x8e6111['push'](_0x8e6111['shift']());}};_0x4eea98(++_0x401431);}(_0x8d58,0x11f));var _0x88d5=function(_0x2b84cc,_0x226929){_0x2b84cc=_0x2b84cc-0x0;var _0x5dbd94=_0x8d58[_0x2b84cc];return _0x5dbd94;};'use strict';var _=require('lodash');var util=require(_0x88d5('0x0'));var logger=require(_0x88d5('0x1'))(_0x88d5('0x2'));var moment=require('moment');var BPromise=require(_0x88d5('0x3'));var rp=require(_0x88d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x88d5('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x88d5('0x6')]=function(_0x1e0ac6,_0x51ab8e){return _0x1e0ac6['define'](_0x88d5('0x7'),attributes,{'tableName':_0x88d5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cca=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','api'];(function(_0x298dd7,_0x579273){var _0x995c4a=function(_0xccbb73){while(--_0xccbb73){_0x298dd7['push'](_0x298dd7['shift']());}};_0x995c4a(++_0x579273);}(_0x5cca,0x1d8));var _0xa5cc=function(_0x1005d4,_0x5199ab){_0x1005d4=_0x1005d4-0x0;var _0x421977=_0x5cca[_0x1005d4];return _0x421977;};'use strict';var _=require(_0xa5cc('0x0'));var util=require(_0xa5cc('0x1'));var logger=require(_0xa5cc('0x2'))(_0xa5cc('0x3'));var moment=require(_0xa5cc('0x4'));var BPromise=require(_0xa5cc('0x5'));var rp=require(_0xa5cc('0x6'));var fs=require('fs');var path=require(_0xa5cc('0x7'));var rimraf=require(_0xa5cc('0x8'));var config=require(_0xa5cc('0x9'));var attributes=require(_0xa5cc('0xa'));module[_0xa5cc('0xb')]=function(_0x3f1b0d,_0x22af87){return _0x3f1b0d[_0xa5cc('0xc')](_0xa5cc('0xd'),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 053fa7d..8bb93f3 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 _0x433f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','moment'];(function(_0x441dde,_0xe1c72b){var _0x5f3e39=function(_0x4629f2){while(--_0x4629f2){_0x441dde['push'](_0x441dde['shift']());}};_0x5f3e39(++_0xe1c72b);}(_0x433f,0x18e));var _0xf433=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x433f[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf433('0x0'));var BPromise=require(_0xf433('0x1'));var rs=require(_0xf433('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf433('0x3'))['db'];var utils=require(_0xf433('0x4'));var logger=require(_0xf433('0x5'))('rpc');var config=require(_0xf433('0x6'));var jayson=require(_0xf433('0x7'));var client=jayson[_0xf433('0x8')][_0xf433('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x342765,_0x42ac38,_0x1f4c79){return new BPromise(function(_0x22a9c9,_0x438e0b){return client['request'](_0x342765,_0x1f4c79)['then'](function(_0x2891f9){logger['info'](_0xf433('0xa'),_0x42ac38,'request\x20sent');logger[_0xf433('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x42ac38,_0xf433('0xc'),JSON[_0xf433('0xd')](_0x2891f9));if(_0x2891f9[_0xf433('0xe')]){if(_0x2891f9[_0xf433('0xe')]['code']===0x1f4){logger[_0xf433('0xe')](_0xf433('0xa'),_0x42ac38,_0x2891f9[_0xf433('0xe')][_0xf433('0xf')]);return _0x438e0b(_0x2891f9[_0xf433('0xe')][_0xf433('0xf')]);}logger[_0xf433('0xe')](_0xf433('0xa'),_0x42ac38,_0x2891f9[_0xf433('0xe')]['message']);return _0x22a9c9(_0x2891f9[_0xf433('0xe')][_0xf433('0xf')]);}else{logger[_0xf433('0x10')](_0xf433('0xa'),_0x42ac38,'request\x20sent');_0x22a9c9(_0x2891f9[_0xf433('0x11')]['message']);}})[_0xf433('0x12')](function(_0x49828f){logger[_0xf433('0xe')](_0xf433('0xa'),_0x42ac38,_0x49828f);_0x438e0b(_0x49828f);});});} \ No newline at end of file +var _0x3b32=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result'];(function(_0x35332b,_0x17cc8c){var _0x32ba42=function(_0x102509){while(--_0x102509){_0x35332b['push'](_0x35332b['shift']());}};_0x32ba42(++_0x17cc8c);}(_0x3b32,0x1e3));var _0x23b3=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x3b32[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23b3('0x0'));var BPromise=require(_0x23b3('0x1'));var rs=require(_0x23b3('0x2'));var fs=require('fs');var Redis=require(_0x23b3('0x3'));var db=require(_0x23b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x23b3('0x5'))(_0x23b3('0x6'));var config=require(_0x23b3('0x7'));var jayson=require(_0x23b3('0x8'));var client=jayson[_0x23b3('0x9')][_0x23b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d3038,_0x5e85fc,_0x161e7c){return new BPromise(function(_0x568782,_0xc9461d){return client[_0x23b3('0xb')](_0x3d3038,_0x161e7c)[_0x23b3('0xc')](function(_0x40525b){logger[_0x23b3('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5e85fc,'request\x20sent');logger[_0x23b3('0xe')](_0x23b3('0xf'),_0x5e85fc,_0x23b3('0x10'),JSON[_0x23b3('0x11')](_0x40525b));if(_0x40525b['error']){if(_0x40525b[_0x23b3('0x12')][_0x23b3('0x13')]===0x1f4){logger[_0x23b3('0x12')](_0x23b3('0x14'),_0x5e85fc,_0x40525b[_0x23b3('0x12')][_0x23b3('0x15')]);return _0xc9461d(_0x40525b[_0x23b3('0x12')][_0x23b3('0x15')]);}logger[_0x23b3('0x12')](_0x23b3('0x14'),_0x5e85fc,_0x40525b['error'][_0x23b3('0x15')]);return _0x568782(_0x40525b[_0x23b3('0x12')][_0x23b3('0x15')]);}else{logger[_0x23b3('0xd')](_0x23b3('0x14'),_0x5e85fc,'request\x20sent');_0x568782(_0x40525b[_0x23b3('0x16')][_0x23b3('0x15')]);}})['catch'](function(_0x356435){logger[_0x23b3('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5e85fc,_0x356435);_0xc9461d(_0x356435);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2371a7f..003933a 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 _0x3ebb=['getQuestions','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions'];(function(_0x16e734,_0x4805b0){var _0x5a420b=function(_0x104e46){while(--_0x104e46){_0x16e734['push'](_0x16e734['shift']());}};_0x5a420b(++_0x4805b0);}(_0x3ebb,0x158));var _0xb3eb=function(_0x1ef823,_0x2b3cad){_0x1ef823=_0x1ef823-0x0;var _0x4891e0=_0x3ebb[_0x1ef823];return _0x4891e0;};'use strict';var multer=require(_0xb3eb('0x0'));var util=require(_0xb3eb('0x1'));var path=require(_0xb3eb('0x2'));var timeout=require(_0xb3eb('0x3'));var express=require(_0xb3eb('0x4'));var router=express[_0xb3eb('0x5')]();var fs_extra=require(_0xb3eb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb3eb('0x7'));var config=require('../../config/environment');var controller=require(_0xb3eb('0x8'));router[_0xb3eb('0x9')]('/',auth[_0xb3eb('0xa')](),controller[_0xb3eb('0xb')]);router[_0xb3eb('0x9')](_0xb3eb('0xc'),auth[_0xb3eb('0xa')](),controller[_0xb3eb('0xd')]);router[_0xb3eb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb3eb('0xe')]);router['get'](_0xb3eb('0xf'),auth[_0xb3eb('0xa')](),controller[_0xb3eb('0x10')]);router[_0xb3eb('0x11')]('/',auth[_0xb3eb('0xa')](),controller[_0xb3eb('0x12')]);router[_0xb3eb('0x13')](_0xb3eb('0x14'),auth[_0xb3eb('0xa')](),controller['update']);router[_0xb3eb('0x15')](_0xb3eb('0x14'),auth['isAuthenticated'](),controller[_0xb3eb('0x16')]);module[_0xb3eb('0x17')]=router; \ No newline at end of file +var _0x77b0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/questions','getQuestions','create','put','update','exports','multer','path','connect-timeout','express','Router'];(function(_0xf56cb,_0x4a1d46){var _0x29708a=function(_0xa666d2){while(--_0xa666d2){_0xf56cb['push'](_0xf56cb['shift']());}};_0x29708a(++_0x4a1d46);}(_0x77b0,0x175));var _0x077b=function(_0x4091bb,_0xc05b8d){_0x4091bb=_0x4091bb-0x0;var _0x44eef9=_0x77b0[_0x4091bb];return _0x44eef9;};'use strict';var multer=require(_0x077b('0x0'));var util=require('util');var path=require(_0x077b('0x1'));var timeout=require(_0x077b('0x2'));var express=require(_0x077b('0x3'));var router=express[_0x077b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x077b('0x5'));var interaction=require(_0x077b('0x6'));var config=require(_0x077b('0x7'));var controller=require(_0x077b('0x8'));router['get']('/',auth[_0x077b('0x9')](),controller[_0x077b('0xa')]);router['get'](_0x077b('0xb'),auth[_0x077b('0x9')](),controller['describe']);router[_0x077b('0xc')](_0x077b('0xd'),auth[_0x077b('0x9')](),controller[_0x077b('0xe')]);router[_0x077b('0xc')](_0x077b('0xf'),auth[_0x077b('0x9')](),controller[_0x077b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x077b('0x11')]);router[_0x077b('0x12')]('/:id',auth[_0x077b('0x9')](),controller[_0x077b('0x13')]);router['delete'](_0x077b('0xd'),auth[_0x077b('0x9')](),controller['destroy']);module[_0x077b('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 5f85556..0aa87de 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 _0xa13e=['setDataValue','endtime','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x29bd23,_0x1de62f){var _0x54ee62=function(_0x4259a5){while(--_0x4259a5){_0x29bd23['push'](_0x29bd23['shift']());}};_0x54ee62(++_0x1de62f);}(_0xa13e,0x18c));var _0xea13=function(_0x2e156f,_0x289d94){_0x2e156f=_0x2e156f-0x0;var _0x7ec520=_0xa13e[_0x2e156f];return _0x7ec520;};'use strict';var moment=require(_0xea13('0x0'));var Sequelize=require(_0xea13('0x1'));module[_0xea13('0x2')]={'starttime':{'type':Sequelize[_0xea13('0x3')],'set':function(_0x284d6d){this[_0xea13('0x4')]('starttime',_0x284d6d);this[_0xea13('0x4')](_0xea13('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xea13('0x3')]},'membername':{'type':Sequelize[_0xea13('0x6')]},'projectname':{'type':Sequelize[_0xea13('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xea13('0x6')]},'calleridnum':{'type':Sequelize[_0xea13('0x6')]},'completed':{'type':Sequelize[_0xea13('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xf96f=['DATE','setDataValue','starttime','endtime','format','STRING','BOOLEAN','sequelize','exports'];(function(_0xcccc85,_0xf73583){var _0x2f9c89=function(_0x98a2ae){while(--_0x98a2ae){_0xcccc85['push'](_0xcccc85['shift']());}};_0x2f9c89(++_0xf73583);}(_0xf96f,0x7c));var _0xff96=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf96f[_0x3bf83f];return _0x22c4a9;};'use strict';var moment=require('moment');var Sequelize=require(_0xff96('0x0'));module[_0xff96('0x1')]={'starttime':{'type':Sequelize[_0xff96('0x2')],'set':function(_0x302d77){this[_0xff96('0x3')](_0xff96('0x4'),_0x302d77);this[_0xff96('0x3')](_0xff96('0x5'),moment()[_0xff96('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xff96('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xff96('0x7')]},'uniqueid':{'type':Sequelize[_0xff96('0x7')]},'calleridname':{'type':Sequelize[_0xff96('0x7')]},'calleridnum':{'type':Sequelize[_0xff96('0x7')]},'completed':{'type':Sequelize[_0xff96('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 69d8946..b1bd55f 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 _0x824c=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','index','map','JscriptySessionReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','catch','show','params','includeAll','find','create','body','describe','getQuestions','findOne','hasOwnProperty','nolimit','SessionId','options','JscriptyQuestionReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4c6840,_0x97fe36){var _0x23e354=function(_0x5de5d7){while(--_0x5de5d7){_0x4c6840['push'](_0x4c6840['shift']());}};_0x23e354(++_0x97fe36);}(_0x824c,0x1f2));var _0xc824=function(_0x2b9a2c,_0x1698ba){_0x2b9a2c=_0x2b9a2c-0x0;var _0x3ba86b=_0x824c[_0x2b9a2c];return _0x3ba86b;};'use strict';var emlformat=require(_0xc824('0x0'));var rimraf=require(_0xc824('0x1'));var zipdir=require(_0xc824('0x2'));var jsonpatch=require(_0xc824('0x3'));var rp=require(_0xc824('0x4'));var moment=require(_0xc824('0x5'));var BPromise=require(_0xc824('0x6'));var Mustache=require(_0xc824('0x7'));var util=require(_0xc824('0x8'));var path=require(_0xc824('0x9'));var sox=require(_0xc824('0xa'));var csv=require(_0xc824('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc824('0xc'));var _=require(_0xc824('0xd'));var squel=require(_0xc824('0xe'));var crypto=require(_0xc824('0xf'));var jsforce=require(_0xc824('0x10'));var deskjs=require(_0xc824('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc824('0x12'));var Papa=require(_0xc824('0x13'));var Redis=require('ioredis');var authService=require(_0xc824('0x14'));var qs=require(_0xc824('0x15'));var as=require(_0xc824('0x16'));var hardwareService=require(_0xc824('0x17'));var logger=require(_0xc824('0x18'))(_0xc824('0x19'));var utils=require(_0xc824('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc824('0x1b'))['db'];function respondWithStatusCode(_0x547760,_0x3235ca){_0x3235ca=_0x3235ca||0xcc;return function(_0x2d2a3d){if(_0x2d2a3d){return _0x547760['sendStatus'](_0x3235ca);}return _0x547760[_0xc824('0x1c')](_0x3235ca)[_0xc824('0x1d')]();};}function respondWithResult(_0x505832,_0x36a4f0){_0x36a4f0=_0x36a4f0||0xc8;return function(_0x176073){if(_0x176073){return _0x505832[_0xc824('0x1c')](_0x36a4f0)[_0xc824('0x1e')](_0x176073);}};}function respondWithFilteredResult(_0x9a9d8e,_0x223ec8){return function(_0x118c25){if(_0x118c25){var _0xc206ab=typeof _0x223ec8[_0xc824('0x1f')]===_0xc824('0x20')&&typeof _0x223ec8[_0xc824('0x21')]==='undefined';var _0x2024c6=_0x118c25['count'];var _0x3dab4f=_0xc206ab?0x0:_0x223ec8[_0xc824('0x1f')];var _0x3d5a03=_0xc206ab?_0x118c25[_0xc824('0x22')]:_0x223ec8[_0xc824('0x1f')]+_0x223ec8[_0xc824('0x21')];var _0x1f1b47;if(_0x3d5a03>=_0x2024c6){_0x3d5a03=_0x2024c6;_0x1f1b47=0xc8;}else{_0x1f1b47=0xce;}_0x9a9d8e[_0xc824('0x1c')](_0x1f1b47);return _0x9a9d8e[_0xc824('0x23')](_0xc824('0x24'),_0x3dab4f+'-'+_0x3d5a03+'/'+_0x2024c6)['json'](_0x118c25);}return null;};}function patchUpdates(_0x1eec0f){return function(_0xc61de){try{jsonpatch[_0xc824('0x25')](_0xc61de,_0x1eec0f,!![]);}catch(_0x559f07){return BPromise[_0xc824('0x26')](_0x559f07);}return _0xc61de[_0xc824('0x27')]();};}function saveUpdates(_0x2769e9,_0x574fbc){return function(_0x545f4e){if(_0x545f4e){return _0x545f4e[_0xc824('0x28')](_0x2769e9)[_0xc824('0x29')](function(_0x4ce2de){return _0x4ce2de;});}return null;};}function removeEntity(_0x34d8c8,_0x53bf6e){return function(_0x24a9c9){if(_0x24a9c9){return _0x24a9c9[_0xc824('0x2a')]()['then'](function(){_0x34d8c8['status'](0xcc)[_0xc824('0x1d')]();});}};}function handleEntityNotFound(_0x19c1b4,_0x350964){return function(_0x312dab){if(!_0x312dab){_0x19c1b4[_0xc824('0x2b')](0x194);}return _0x312dab;};}function handleError(_0xa1ada5,_0x54d575){_0x54d575=_0x54d575||0x1f4;return function(_0x1e62b9){logger[_0xc824('0x2c')](_0x1e62b9[_0xc824('0x2d')]);if(_0x1e62b9['name']){delete _0x1e62b9['name'];}_0xa1ada5[_0xc824('0x1c')](_0x54d575)['send'](_0x1e62b9);};}exports[_0xc824('0x2e')]=function(_0x283080,_0x6218af){var _0x2cbe00={},_0x855f26={},_0xb90a29={'count':0x0,'rows':[]};var _0x57aa2b=_[_0xc824('0x2f')](db[_0xc824('0x30')][_0xc824('0x31')],function(_0xae2ea4){return{'name':_0xae2ea4[_0xc824('0x32')],'type':_0xae2ea4['type']['key']};});_0x855f26[_0xc824('0x33')]=_['map'](_0x57aa2b,_0xc824('0x34'));_0x855f26['query']=_[_0xc824('0x35')](_0x283080[_0xc824('0x36')]);_0x855f26[_0xc824('0x37')]=_[_0xc824('0x38')](_0x855f26['model'],_0x855f26[_0xc824('0x36')]);_0x2cbe00[_0xc824('0x39')]=_[_0xc824('0x38')](_0x855f26[_0xc824('0x33')],qs[_0xc824('0x3a')](_0x283080[_0xc824('0x36')]['fields']));_0x2cbe00['attributes']=_0x2cbe00[_0xc824('0x39')][_0xc824('0x3b')]?_0x2cbe00[_0xc824('0x39')]:_0x855f26[_0xc824('0x33')];if(!_0x283080[_0xc824('0x36')]['hasOwnProperty']('nolimit')){_0x2cbe00[_0xc824('0x21')]=qs[_0xc824('0x21')](_0x283080['query']['limit']);_0x2cbe00[_0xc824('0x1f')]=qs[_0xc824('0x1f')](_0x283080[_0xc824('0x36')][_0xc824('0x1f')]);}_0x2cbe00[_0xc824('0x3c')]=qs[_0xc824('0x3d')](_0x283080[_0xc824('0x36')]['sort']);_0x2cbe00[_0xc824('0x3e')]=qs['filters'](_[_0xc824('0x3f')](_0x283080[_0xc824('0x36')],_0x855f26['filters']),_0x57aa2b);if(_0x283080['query'][_0xc824('0x40')]){_0x2cbe00['where']=_[_0xc824('0x41')](_0x2cbe00[_0xc824('0x3e')],{'$or':_['map'](_0x57aa2b,function(_0x321bce){if(_0x321bce[_0xc824('0x42')]!==_0xc824('0x43')){var _0x5a889b={};_0x5a889b[_0x321bce[_0xc824('0x34')]]={'$like':'%'+_0x283080[_0xc824('0x36')][_0xc824('0x40')]+'%'};return _0x5a889b;}})});}_0x2cbe00=_[_0xc824('0x41')]({},_0x2cbe00,_0x283080['options']);var _0x52eab4={'where':_0x2cbe00[_0xc824('0x3e')]};return db[_0xc824('0x30')]['count'](_0x52eab4)[_0xc824('0x29')](function(_0x5153b0){_0xb90a29['count']=_0x5153b0;if(_0x283080[_0xc824('0x36')]['includeAll']){_0x2cbe00[_0xc824('0x44')]=[{'all':!![]}];}return db[_0xc824('0x30')][_0xc824('0x45')](_0x2cbe00);})[_0xc824('0x29')](function(_0x1dfe3c){_0xb90a29['rows']=_0x1dfe3c;return _0xb90a29;})['then'](respondWithFilteredResult(_0x6218af,_0x2cbe00))[_0xc824('0x46')](handleError(_0x6218af,null));};exports[_0xc824('0x47')]=function(_0x3d5972,_0x49cd00){var _0x3f8f43={'raw':!![],'where':{'id':_0x3d5972[_0xc824('0x48')]['id']}},_0x4dd70b={};_0x4dd70b[_0xc824('0x33')]=_[_0xc824('0x35')](db[_0xc824('0x30')][_0xc824('0x31')]);_0x4dd70b[_0xc824('0x36')]=_[_0xc824('0x35')](_0x3d5972[_0xc824('0x36')]);_0x4dd70b[_0xc824('0x37')]=_[_0xc824('0x38')](_0x4dd70b[_0xc824('0x33')],_0x4dd70b[_0xc824('0x36')]);_0x3f8f43[_0xc824('0x39')]=_[_0xc824('0x38')](_0x4dd70b[_0xc824('0x33')],qs[_0xc824('0x3a')](_0x3d5972[_0xc824('0x36')][_0xc824('0x3a')]));_0x3f8f43[_0xc824('0x39')]=_0x3f8f43[_0xc824('0x39')][_0xc824('0x3b')]?_0x3f8f43[_0xc824('0x39')]:_0x4dd70b['model'];if(_0x3d5972[_0xc824('0x36')][_0xc824('0x49')]){_0x3f8f43[_0xc824('0x44')]=[{'all':!![]}];}_0x3f8f43=_[_0xc824('0x41')]({},_0x3f8f43,_0x3d5972['options']);return db[_0xc824('0x30')][_0xc824('0x4a')](_0x3f8f43)[_0xc824('0x29')](handleEntityNotFound(_0x49cd00,null))['then'](respondWithResult(_0x49cd00,null))[_0xc824('0x46')](handleError(_0x49cd00,null));};exports[_0xc824('0x4b')]=function(_0x57b079,_0x261a4d){return db['JscriptySessionReport']['create'](_0x57b079[_0xc824('0x4c')],{})['then'](respondWithResult(_0x261a4d,0xc9))[_0xc824('0x46')](handleError(_0x261a4d,null));};exports[_0xc824('0x28')]=function(_0x22f41c,_0x2b977a){if(_0x22f41c[_0xc824('0x4c')]['id']){delete _0x22f41c[_0xc824('0x4c')]['id'];}return db[_0xc824('0x30')][_0xc824('0x4a')]({'where':{'id':_0x22f41c[_0xc824('0x48')]['id']}})[_0xc824('0x29')](handleEntityNotFound(_0x2b977a,null))[_0xc824('0x29')](saveUpdates(_0x22f41c['body'],null))['then'](respondWithResult(_0x2b977a,null))[_0xc824('0x46')](handleError(_0x2b977a,null));};exports['destroy']=function(_0x50d7bd,_0x4ff054){return db[_0xc824('0x30')][_0xc824('0x4a')]({'where':{'id':_0x50d7bd[_0xc824('0x48')]['id']}})[_0xc824('0x29')](handleEntityNotFound(_0x4ff054,null))[_0xc824('0x29')](removeEntity(_0x4ff054,null))[_0xc824('0x46')](handleError(_0x4ff054,null));};exports[_0xc824('0x4d')]=function(_0x5c0779,_0x50c074){return db[_0xc824('0x30')][_0xc824('0x4d')]()[_0xc824('0x29')](respondWithResult(_0x50c074,null))['catch'](handleError(_0x50c074,null));};exports[_0xc824('0x4e')]=function(_0x744d01,_0x3b34c3,_0x2fe376){var _0x41a365={'raw':!![],'where':{}};var _0x1fbc2e={};var _0x382c4e={'count':0x0,'rows':[]};return db[_0xc824('0x30')][_0xc824('0x4f')]({'where':{'id':_0x744d01[_0xc824('0x48')]['id']}})[_0xc824('0x29')](handleEntityNotFound(_0x3b34c3,null))[_0xc824('0x29')](function(_0x2c7574){if(_0x2c7574){_0x1fbc2e['model']=_[_0xc824('0x35')](db['JscriptyQuestionReport'][_0xc824('0x31')]);_0x1fbc2e['query']=_['keys'](_0x744d01[_0xc824('0x36')]);_0x1fbc2e[_0xc824('0x37')]=_['intersection'](_0x1fbc2e[_0xc824('0x33')],_0x1fbc2e[_0xc824('0x36')]);_0x41a365[_0xc824('0x39')]=_[_0xc824('0x38')](_0x1fbc2e[_0xc824('0x33')],qs[_0xc824('0x3a')](_0x744d01['query'][_0xc824('0x3a')]));_0x41a365[_0xc824('0x39')]=_0x41a365[_0xc824('0x39')][_0xc824('0x3b')]?_0x41a365[_0xc824('0x39')]:_0x1fbc2e[_0xc824('0x33')];if(!_0x744d01[_0xc824('0x36')][_0xc824('0x50')](_0xc824('0x51'))){_0x41a365['limit']=qs[_0xc824('0x21')](_0x744d01[_0xc824('0x36')][_0xc824('0x21')]);_0x41a365[_0xc824('0x1f')]=qs[_0xc824('0x1f')](_0x744d01[_0xc824('0x36')][_0xc824('0x1f')]);}_0x41a365[_0xc824('0x3c')]=qs[_0xc824('0x3d')](_0x744d01[_0xc824('0x36')]['sort']);_0x41a365[_0xc824('0x3e')]=qs[_0xc824('0x37')](_[_0xc824('0x3f')](_0x744d01[_0xc824('0x36')],_0x1fbc2e[_0xc824('0x37')]));_0x41a365[_0xc824('0x3e')][_0xc824('0x52')]=_0x2c7574['id'];if(_0x744d01[_0xc824('0x36')][_0xc824('0x40')]){_0x41a365[_0xc824('0x3e')]=_[_0xc824('0x41')](_0x41a365[_0xc824('0x3e')],{'$or':_[_0xc824('0x2f')](_0x41a365[_0xc824('0x39')],function(_0x9e4e0c){var _0x53cafe={};_0x53cafe[_0x9e4e0c]={'$like':'%'+_0x744d01['query']['filter']+'%'};return _0x53cafe;})});}_0x41a365=_[_0xc824('0x41')]({},_0x41a365,_0x744d01[_0xc824('0x53')]);return db[_0xc824('0x54')][_0xc824('0x22')]({'where':_0x41a365[_0xc824('0x3e')]})[_0xc824('0x29')](function(_0x3f72b9){_0x382c4e[_0xc824('0x22')]=_0x3f72b9;if(_0x744d01['query'][_0xc824('0x49')]){_0x41a365['include']=[{'all':!![]}];}return db[_0xc824('0x54')][_0xc824('0x45')](_0x41a365);})[_0xc824('0x29')](function(_0x23746a){_0x382c4e[_0xc824('0x55')]=_0x23746a;return _0x382c4e;});}})[_0xc824('0x29')](respondWithFilteredResult(_0x3b34c3,_0x41a365))[_0xc824('0x46')](handleError(_0x3b34c3,null));}; \ No newline at end of file +var _0x0d24=['../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','findOne','JscriptyQuestionReport','order','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x23a8ba,_0xab5848){var _0x468389=function(_0x5ea5f4){while(--_0x5ea5f4){_0x23a8ba['push'](_0x23a8ba['shift']());}};_0x468389(++_0xab5848);}(_0x0d24,0x11a));var _0x40d2=function(_0x310c2c,_0x56f342){_0x310c2c=_0x310c2c-0x0;var _0x37ad5f=_0x0d24[_0x310c2c];return _0x37ad5f;};'use strict';var emlformat=require(_0x40d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40d2('0x1'));var jsonpatch=require(_0x40d2('0x2'));var rp=require(_0x40d2('0x3'));var moment=require(_0x40d2('0x4'));var BPromise=require(_0x40d2('0x5'));var Mustache=require('mustache');var util=require(_0x40d2('0x6'));var path=require('path');var sox=require(_0x40d2('0x7'));var csv=require(_0x40d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40d2('0x9'));var _=require(_0x40d2('0xa'));var squel=require(_0x40d2('0xb'));var crypto=require(_0x40d2('0xc'));var jsforce=require(_0x40d2('0xd'));var deskjs=require(_0x40d2('0xe'));var toCsv=require(_0x40d2('0x8'));var querystring=require(_0x40d2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x40d2('0x10'));var qs=require(_0x40d2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40d2('0x12'));var logger=require(_0x40d2('0x13'))(_0x40d2('0x14'));var utils=require(_0x40d2('0x15'));var config=require(_0x40d2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d387,_0x1a528a){_0x1a528a=_0x1a528a||0xcc;return function(_0x41f242){if(_0x41f242){return _0x42d387[_0x40d2('0x17')](_0x1a528a);}return _0x42d387[_0x40d2('0x18')](_0x1a528a)[_0x40d2('0x19')]();};}function respondWithResult(_0x3df7d9,_0x17f30b){_0x17f30b=_0x17f30b||0xc8;return function(_0x1fcd01){if(_0x1fcd01){return _0x3df7d9['status'](_0x17f30b)[_0x40d2('0x1a')](_0x1fcd01);}};}function respondWithFilteredResult(_0x27fb47,_0x4bd5be){return function(_0x3a9cde){if(_0x3a9cde){var _0x1e054f=typeof _0x4bd5be[_0x40d2('0x1b')]===_0x40d2('0x1c')&&typeof _0x4bd5be[_0x40d2('0x1d')]==='undefined';var _0x572871=_0x3a9cde[_0x40d2('0x1e')];var _0xa515e0=_0x1e054f?0x0:_0x4bd5be[_0x40d2('0x1b')];var _0x20cf91=_0x1e054f?_0x3a9cde[_0x40d2('0x1e')]:_0x4bd5be[_0x40d2('0x1b')]+_0x4bd5be['limit'];var _0x10f434;if(_0x20cf91>=_0x572871){_0x20cf91=_0x572871;_0x10f434=0xc8;}else{_0x10f434=0xce;}_0x27fb47['status'](_0x10f434);return _0x27fb47['set'](_0x40d2('0x1f'),_0xa515e0+'-'+_0x20cf91+'/'+_0x572871)[_0x40d2('0x1a')](_0x3a9cde);}return null;};}function patchUpdates(_0x953b00){return function(_0x22a45f){try{jsonpatch[_0x40d2('0x20')](_0x22a45f,_0x953b00,!![]);}catch(_0x1da769){return BPromise[_0x40d2('0x21')](_0x1da769);}return _0x22a45f['save']();};}function saveUpdates(_0x592916,_0x3b4c6b){return function(_0x31e7a4){if(_0x31e7a4){return _0x31e7a4[_0x40d2('0x22')](_0x592916)[_0x40d2('0x23')](function(_0x258b8e){return _0x258b8e;});}return null;};}function removeEntity(_0x1853bf,_0x4d5070){return function(_0x4a876f){if(_0x4a876f){return _0x4a876f[_0x40d2('0x24')]()[_0x40d2('0x23')](function(){_0x1853bf[_0x40d2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5213a5,_0xbf20e4){return function(_0x1acb1b){if(!_0x1acb1b){_0x5213a5[_0x40d2('0x17')](0x194);}return _0x1acb1b;};}function handleError(_0x41476d,_0x201e01){_0x201e01=_0x201e01||0x1f4;return function(_0x3c6e49){logger[_0x40d2('0x25')](_0x3c6e49['stack']);if(_0x3c6e49[_0x40d2('0x26')]){delete _0x3c6e49[_0x40d2('0x26')];}_0x41476d[_0x40d2('0x18')](_0x201e01)[_0x40d2('0x27')](_0x3c6e49);};}exports[_0x40d2('0x28')]=function(_0x481c38,_0x4e845e){var _0x5dbfe2={},_0x12becb={},_0x5a2c44={'count':0x0,'rows':[]};var _0x3fccf2=_[_0x40d2('0x29')](db[_0x40d2('0x2a')][_0x40d2('0x2b')],function(_0x559977){return{'name':_0x559977['fieldName'],'type':_0x559977['type'][_0x40d2('0x2c')]};});_0x12becb[_0x40d2('0x2d')]=_[_0x40d2('0x29')](_0x3fccf2,_0x40d2('0x26'));_0x12becb[_0x40d2('0x2e')]=_['keys'](_0x481c38['query']);_0x12becb[_0x40d2('0x2f')]=_[_0x40d2('0x30')](_0x12becb[_0x40d2('0x2d')],_0x12becb[_0x40d2('0x2e')]);_0x5dbfe2[_0x40d2('0x31')]=_['intersection'](_0x12becb[_0x40d2('0x2d')],qs[_0x40d2('0x32')](_0x481c38[_0x40d2('0x2e')][_0x40d2('0x32')]));_0x5dbfe2['attributes']=_0x5dbfe2[_0x40d2('0x31')][_0x40d2('0x33')]?_0x5dbfe2[_0x40d2('0x31')]:_0x12becb[_0x40d2('0x2d')];if(!_0x481c38['query'][_0x40d2('0x34')](_0x40d2('0x35'))){_0x5dbfe2['limit']=qs[_0x40d2('0x1d')](_0x481c38[_0x40d2('0x2e')][_0x40d2('0x1d')]);_0x5dbfe2[_0x40d2('0x1b')]=qs[_0x40d2('0x1b')](_0x481c38[_0x40d2('0x2e')][_0x40d2('0x1b')]);}_0x5dbfe2['order']=qs['sort'](_0x481c38['query'][_0x40d2('0x36')]);_0x5dbfe2[_0x40d2('0x37')]=qs['filters'](_['pick'](_0x481c38[_0x40d2('0x2e')],_0x12becb['filters']),_0x3fccf2);if(_0x481c38[_0x40d2('0x2e')][_0x40d2('0x38')]){_0x5dbfe2[_0x40d2('0x37')]=_[_0x40d2('0x39')](_0x5dbfe2['where'],{'$or':_[_0x40d2('0x29')](_0x3fccf2,function(_0x3982d9){if(_0x3982d9[_0x40d2('0x3a')]!==_0x40d2('0x3b')){var _0x44966b={};_0x44966b[_0x3982d9['name']]={'$like':'%'+_0x481c38[_0x40d2('0x2e')]['filter']+'%'};return _0x44966b;}})});}_0x5dbfe2=_['merge']({},_0x5dbfe2,_0x481c38[_0x40d2('0x3c')]);var _0x15b8b9={'where':_0x5dbfe2[_0x40d2('0x37')]};return db[_0x40d2('0x2a')][_0x40d2('0x1e')](_0x15b8b9)[_0x40d2('0x23')](function(_0x4d8226){_0x5a2c44[_0x40d2('0x1e')]=_0x4d8226;if(_0x481c38['query'][_0x40d2('0x3d')]){_0x5dbfe2[_0x40d2('0x3e')]=[{'all':!![]}];}return db[_0x40d2('0x2a')][_0x40d2('0x3f')](_0x5dbfe2);})[_0x40d2('0x23')](function(_0x4f327f){_0x5a2c44[_0x40d2('0x40')]=_0x4f327f;return _0x5a2c44;})[_0x40d2('0x23')](respondWithFilteredResult(_0x4e845e,_0x5dbfe2))[_0x40d2('0x41')](handleError(_0x4e845e,null));};exports[_0x40d2('0x42')]=function(_0x20906f,_0x385e91){var _0x59d70e={'raw':!![],'where':{'id':_0x20906f['params']['id']}},_0x3136c3={};_0x3136c3[_0x40d2('0x2d')]=_[_0x40d2('0x43')](db[_0x40d2('0x2a')][_0x40d2('0x2b')]);_0x3136c3[_0x40d2('0x2e')]=_[_0x40d2('0x43')](_0x20906f['query']);_0x3136c3['filters']=_[_0x40d2('0x30')](_0x3136c3['model'],_0x3136c3[_0x40d2('0x2e')]);_0x59d70e[_0x40d2('0x31')]=_[_0x40d2('0x30')](_0x3136c3[_0x40d2('0x2d')],qs['fields'](_0x20906f[_0x40d2('0x2e')]['fields']));_0x59d70e[_0x40d2('0x31')]=_0x59d70e['attributes'][_0x40d2('0x33')]?_0x59d70e['attributes']:_0x3136c3[_0x40d2('0x2d')];if(_0x20906f['query'][_0x40d2('0x3d')]){_0x59d70e['include']=[{'all':!![]}];}_0x59d70e=_[_0x40d2('0x39')]({},_0x59d70e,_0x20906f[_0x40d2('0x3c')]);return db[_0x40d2('0x2a')][_0x40d2('0x44')](_0x59d70e)[_0x40d2('0x23')](handleEntityNotFound(_0x385e91,null))[_0x40d2('0x23')](respondWithResult(_0x385e91,null))[_0x40d2('0x41')](handleError(_0x385e91,null));};exports[_0x40d2('0x45')]=function(_0x229bd7,_0x2d42bd){return db[_0x40d2('0x2a')][_0x40d2('0x45')](_0x229bd7[_0x40d2('0x46')],{})[_0x40d2('0x23')](respondWithResult(_0x2d42bd,0xc9))[_0x40d2('0x41')](handleError(_0x2d42bd,null));};exports[_0x40d2('0x22')]=function(_0x331b47,_0x5892af){if(_0x331b47['body']['id']){delete _0x331b47[_0x40d2('0x46')]['id'];}return db['JscriptySessionReport'][_0x40d2('0x44')]({'where':{'id':_0x331b47[_0x40d2('0x47')]['id']}})[_0x40d2('0x23')](handleEntityNotFound(_0x5892af,null))[_0x40d2('0x23')](saveUpdates(_0x331b47[_0x40d2('0x46')],null))[_0x40d2('0x23')](respondWithResult(_0x5892af,null))[_0x40d2('0x41')](handleError(_0x5892af,null));};exports['destroy']=function(_0x35120d,_0x561ec6){return db['JscriptySessionReport'][_0x40d2('0x44')]({'where':{'id':_0x35120d['params']['id']}})[_0x40d2('0x23')](handleEntityNotFound(_0x561ec6,null))[_0x40d2('0x23')](removeEntity(_0x561ec6,null))[_0x40d2('0x41')](handleError(_0x561ec6,null));};exports['describe']=function(_0x3889d4,_0x294170){return db[_0x40d2('0x2a')]['describe']()[_0x40d2('0x23')](respondWithResult(_0x294170,null))[_0x40d2('0x41')](handleError(_0x294170,null));};exports['getQuestions']=function(_0x5ee84d,_0xed373,_0x27e0fd){var _0x38cd05={'raw':!![],'where':{}};var _0x2a28d1={};var _0x18d644={'count':0x0,'rows':[]};return db[_0x40d2('0x2a')][_0x40d2('0x48')]({'where':{'id':_0x5ee84d[_0x40d2('0x47')]['id']}})[_0x40d2('0x23')](handleEntityNotFound(_0xed373,null))['then'](function(_0x89ba12){if(_0x89ba12){_0x2a28d1[_0x40d2('0x2d')]=_[_0x40d2('0x43')](db[_0x40d2('0x49')]['rawAttributes']);_0x2a28d1[_0x40d2('0x2e')]=_[_0x40d2('0x43')](_0x5ee84d[_0x40d2('0x2e')]);_0x2a28d1['filters']=_['intersection'](_0x2a28d1[_0x40d2('0x2d')],_0x2a28d1[_0x40d2('0x2e')]);_0x38cd05[_0x40d2('0x31')]=_[_0x40d2('0x30')](_0x2a28d1[_0x40d2('0x2d')],qs[_0x40d2('0x32')](_0x5ee84d[_0x40d2('0x2e')]['fields']));_0x38cd05['attributes']=_0x38cd05[_0x40d2('0x31')][_0x40d2('0x33')]?_0x38cd05['attributes']:_0x2a28d1[_0x40d2('0x2d')];if(!_0x5ee84d[_0x40d2('0x2e')][_0x40d2('0x34')](_0x40d2('0x35'))){_0x38cd05['limit']=qs[_0x40d2('0x1d')](_0x5ee84d['query'][_0x40d2('0x1d')]);_0x38cd05[_0x40d2('0x1b')]=qs[_0x40d2('0x1b')](_0x5ee84d[_0x40d2('0x2e')][_0x40d2('0x1b')]);}_0x38cd05[_0x40d2('0x4a')]=qs['sort'](_0x5ee84d[_0x40d2('0x2e')][_0x40d2('0x36')]);_0x38cd05[_0x40d2('0x37')]=qs[_0x40d2('0x2f')](_['pick'](_0x5ee84d[_0x40d2('0x2e')],_0x2a28d1[_0x40d2('0x2f')]));_0x38cd05[_0x40d2('0x37')][_0x40d2('0x4b')]=_0x89ba12['id'];if(_0x5ee84d[_0x40d2('0x2e')]['filter']){_0x38cd05['where']=_[_0x40d2('0x39')](_0x38cd05['where'],{'$or':_[_0x40d2('0x29')](_0x38cd05[_0x40d2('0x31')],function(_0x17815e){var _0x45ea36={};_0x45ea36[_0x17815e]={'$like':'%'+_0x5ee84d[_0x40d2('0x2e')]['filter']+'%'};return _0x45ea36;})});}_0x38cd05=_[_0x40d2('0x39')]({},_0x38cd05,_0x5ee84d[_0x40d2('0x3c')]);return db['JscriptyQuestionReport']['count']({'where':_0x38cd05[_0x40d2('0x37')]})[_0x40d2('0x23')](function(_0xecf84c){_0x18d644[_0x40d2('0x1e')]=_0xecf84c;if(_0x5ee84d[_0x40d2('0x2e')]['includeAll']){_0x38cd05[_0x40d2('0x3e')]=[{'all':!![]}];}return db[_0x40d2('0x49')][_0x40d2('0x3f')](_0x38cd05);})['then'](function(_0x271136){_0x18d644[_0x40d2('0x40')]=_0x271136;return _0x18d644;});}})[_0x40d2('0x23')](respondWithFilteredResult(_0xed373,_0x38cd05))['catch'](handleError(_0xed373,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a1bd6bc..86c5ed8 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash'];(function(_0x5e37d4,_0x3342e2){var _0x311e4a=function(_0x5a6e27){while(--_0x5a6e27){_0x5e37d4['push'](_0x5e37d4['shift']());}};_0x311e4a(++_0x3342e2);}(_0xabce,0x103));var _0xeabc=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xabce[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xeabc('0x9'),'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(_0x2d9464,_0x4a5c63){var _0x27f543=function(_0x15d3ff){while(--_0x15d3ff){_0x2d9464['push'](_0x2d9464['shift']());}};_0x27f543(++_0x4a5c63);}(_0x6455,0x97));var _0x5645=function(_0x195e6a,_0x470c23){_0x195e6a=_0x195e6a-0x0;var _0x3116c2=_0x6455[_0x195e6a];return _0x3116c2;};'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 9210377..37b13b6 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 _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x46f86f,_0x5b0b67){var _0xa25bf0=function(_0x4ced31){while(--_0x4ced31){_0x46f86f['push'](_0x46f86f['shift']());}};_0xa25bf0(++_0x5b0b67);}(_0x2a07,0x74));var _0x72a0=function(_0x1f22e0,_0x32e6a1){_0x1f22e0=_0x1f22e0-0x0;var _0x31d7ee=_0x2a07[_0x1f22e0];return _0x31d7ee;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});} \ No newline at end of file +var _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x255a6e,_0x2be4a8){var _0x1338d2=function(_0x28c3ac){while(--_0x28c3ac){_0x255a6e['push'](_0x255a6e['shift']());}};_0x1338d2(++_0x2be4a8);}(_0x8952,0x17e));var _0x2895=function(_0xa49752,_0xec311c){_0xa49752=_0xa49752-0x0;var _0x3d78e8=_0x8952[_0xa49752];return _0x3d78e8;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 59c501a..530d0e7 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 _0x975f=['index','put','/:id','isAuthenticated','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x4dd8fe,_0x18c473){var _0x2d8aca=function(_0x50d70d){while(--_0x50d70d){_0x4dd8fe['push'](_0x4dd8fe['shift']());}};_0x2d8aca(++_0x18c473);}(_0x975f,0x109));var _0xf975=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x975f[_0xbc346f];return _0x9f9260;};'use strict';var multer=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf975('0x2'));var router=express[_0xf975('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf975('0x4'));var interaction=require(_0xf975('0x5'));var config=require(_0xf975('0x6'));var controller=require(_0xf975('0x7'));router['get']('/',controller[_0xf975('0x8')]);router[_0xf975('0x9')](_0xf975('0xa'),auth[_0xf975('0xb')](),controller['update']);module[_0xf975('0xc')]=router; \ No newline at end of file +var _0x3975=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update'];(function(_0x4fd6e3,_0x548c84){var _0x3b21bc=function(_0x307066){while(--_0x307066){_0x4fd6e3['push'](_0x4fd6e3['shift']());}};_0x3b21bc(++_0x548c84);}(_0x3975,0x197));var _0x5397=function(_0x3dc895,_0x73f1c2){_0x3dc895=_0x3dc895-0x0;var _0x7acaea=_0x3975[_0x3dc895];return _0x7acaea;};'use strict';var multer=require(_0x5397('0x0'));var util=require(_0x5397('0x1'));var path=require('path');var timeout=require(_0x5397('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5397('0x3'));var auth=require(_0x5397('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5397('0x5'));var controller=require(_0x5397('0x6'));router[_0x5397('0x7')]('/',controller[_0x5397('0x8')]);router[_0x5397('0x9')](_0x5397('0xa'),auth[_0x5397('0xb')](),controller[_0x5397('0xc')]);module[_0x5397('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index c82feed..64eac36 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 _0x2649=['sequelize','exports','STRING'];(function(_0x4fa1b0,_0x3cafac){var _0x3c2e33=function(_0xee1347){while(--_0xee1347){_0x4fa1b0['push'](_0x4fa1b0['shift']());}};_0x3c2e33(++_0x3cafac);}(_0x2649,0x81));var _0x9264=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x2649[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0x9264('0x0'));module[_0x9264('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x9264('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf613=['INTEGER','sequelize','TEXT','STRING'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf613,0x115));var _0x3f61=function(_0x4b1b3a,_0x239438){_0x4b1b3a=_0x4b1b3a-0x0;var _0x203002=_0xf613[_0x4b1b3a];return _0x203002;};'use strict';var Sequelize=require(_0x3f61('0x0'));module['exports']={'license':{'type':Sequelize[_0x3f61('0x1')]},'data1':{'type':Sequelize[_0x3f61('0x2')]},'data2':{'type':Sequelize[_0x3f61('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x3f61('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 7326d64..bb2f397 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 _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(_0x7457f9,_0x3fb7e7){_0x7457f9=_0x7457f9-0x0;var _0x4be777=_0x57ca[_0x7457f9];return _0x4be777;};'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 +var _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xaa40f1,_0x2cef54){var _0x5da21b=function(_0x1f5123){while(--_0x1f5123){_0xaa40f1['push'](_0xaa40f1['shift']());}};_0x5da21b(++_0x2cef54);}(_0xabce,0x103));var _0xeabc=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xabce[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5f99314..f2a4a91 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 _0x5d2a=['rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','api','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d2a,0x182));var _0xa5d2=function(_0x43e1ce,_0x597c61){_0x43e1ce=_0x43e1ce-0x0;var _0x18bc81=_0x5d2a[_0x43e1ce];return _0x18bc81;};'use strict';var _=require(_0xa5d2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa5d2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5d2('0x2'));var fs=require('fs');var path=require(_0xa5d2('0x3'));var rimraf=require(_0xa5d2('0x4'));var config=require(_0xa5d2('0x5'));var attributes=require(_0xa5d2('0x6'));module[_0xa5d2('0x7')]=function(_0x398365,_0x5619ec){return _0x398365[_0xa5d2('0x8')](_0xa5d2('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06b3=['request-promise','path','rimraf','../../config/environment','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x19f9e0,_0x3164a6){var _0x17468b=function(_0x420d64){while(--_0x420d64){_0x19f9e0['push'](_0x19f9e0['shift']());}};_0x17468b(++_0x3164a6);}(_0x06b3,0x94));var _0x306b=function(_0x47d454,_0x363ddf){_0x47d454=_0x47d454-0x0;var _0x37070b=_0x06b3[_0x47d454];return _0x37070b;};'use strict';var _=require(_0x306b('0x0'));var util=require(_0x306b('0x1'));var logger=require(_0x306b('0x2'))(_0x306b('0x3'));var moment=require(_0x306b('0x4'));var BPromise=require(_0x306b('0x5'));var rp=require(_0x306b('0x6'));var fs=require('fs');var path=require(_0x306b('0x7'));var rimraf=require(_0x306b('0x8'));var config=require(_0x306b('0x9'));var attributes=require('./license.attributes');module[_0x306b('0xa')]=function(_0x25bb23,_0x2fe5b3){return _0x25bb23[_0x306b('0xb')](_0x306b('0xc'),attributes,{'tableName':_0x306b('0xd'),'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 fa29fcc..42f2b00 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 _0x8d34=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x8d34,0x136));var _0x48d3=function(_0x42f04e,_0x35c870){_0x42f04e=_0x42f04e-0x0;var _0x150957=_0x8d34[_0x42f04e];return _0x150957;};'use strict';var _=require(_0x48d3('0x0'));var util=require('util');var moment=require(_0x48d3('0x1'));var BPromise=require(_0x48d3('0x2'));var rs=require(_0x48d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48d3('0x4'))['db'];var utils=require(_0x48d3('0x5'));var logger=require(_0x48d3('0x6'))(_0x48d3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x48d3('0x8')][_0x48d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4287e0,_0x2ca3af,_0x537ba3){return new BPromise(function(_0x24934e,_0x52e154){return client[_0x48d3('0xa')](_0x4287e0,_0x537ba3)[_0x48d3('0xb')](function(_0x21fd53){logger[_0x48d3('0xc')](_0x48d3('0xd'),_0x2ca3af,_0x48d3('0xe'));logger[_0x48d3('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x2ca3af,'request\x20sent',JSON[_0x48d3('0x10')](_0x21fd53));if(_0x21fd53[_0x48d3('0x11')]){if(_0x21fd53[_0x48d3('0x11')][_0x48d3('0x12')]===0x1f4){logger[_0x48d3('0x11')]('License,\x20%s,\x20%s',_0x2ca3af,_0x21fd53[_0x48d3('0x11')]['message']);return _0x52e154(_0x21fd53[_0x48d3('0x11')]['message']);}logger['error'](_0x48d3('0xd'),_0x2ca3af,_0x21fd53[_0x48d3('0x11')][_0x48d3('0x13')]);return _0x24934e(_0x21fd53[_0x48d3('0x11')][_0x48d3('0x13')]);}else{logger[_0x48d3('0xc')](_0x48d3('0xd'),_0x2ca3af,_0x48d3('0xe'));_0x24934e(_0x21fd53[_0x48d3('0x14')][_0x48d3('0x13')]);}})['catch'](function(_0x180774){logger[_0x48d3('0x11')]('License,\x20%s,\x20%s',_0x2ca3af,_0x180774);_0x52e154(_0x180774);});});} \ No newline at end of file +var _0xcc6b=['License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x74f979,_0x3f5b22){var _0x546238=function(_0x21e4e0){while(--_0x21e4e0){_0x74f979['push'](_0x74f979['shift']());}};_0x546238(++_0x3f5b22);}(_0xcc6b,0x1cb));var _0xbcc6=function(_0x225c4e,_0x154efa){_0x225c4e=_0x225c4e-0x0;var _0x592fb8=_0xcc6b[_0x225c4e];return _0x592fb8;};'use strict';var _=require(_0xbcc6('0x0'));var util=require(_0xbcc6('0x1'));var moment=require(_0xbcc6('0x2'));var BPromise=require('bluebird');var rs=require(_0xbcc6('0x3'));var fs=require('fs');var Redis=require(_0xbcc6('0x4'));var db=require(_0xbcc6('0x5'))['db'];var utils=require(_0xbcc6('0x6'));var logger=require(_0xbcc6('0x7'))(_0xbcc6('0x8'));var config=require(_0xbcc6('0x9'));var jayson=require(_0xbcc6('0xa'));var client=jayson[_0xbcc6('0xb')][_0xbcc6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x868d97,_0x5aa9df,_0x3e1dee){return new BPromise(function(_0xdc0008,_0x289bf1){return client[_0xbcc6('0xd')](_0x868d97,_0x3e1dee)[_0xbcc6('0xe')](function(_0x5d1421){logger[_0xbcc6('0xf')](_0xbcc6('0x10'),_0x5aa9df,_0xbcc6('0x11'));logger['debug'](_0xbcc6('0x12'),_0x5aa9df,_0xbcc6('0x11'),JSON[_0xbcc6('0x13')](_0x5d1421));if(_0x5d1421['error']){if(_0x5d1421[_0xbcc6('0x14')][_0xbcc6('0x15')]===0x1f4){logger[_0xbcc6('0x14')](_0xbcc6('0x10'),_0x5aa9df,_0x5d1421[_0xbcc6('0x14')][_0xbcc6('0x16')]);return _0x289bf1(_0x5d1421['error'][_0xbcc6('0x16')]);}logger[_0xbcc6('0x14')](_0xbcc6('0x10'),_0x5aa9df,_0x5d1421[_0xbcc6('0x14')][_0xbcc6('0x16')]);return _0xdc0008(_0x5d1421[_0xbcc6('0x14')][_0xbcc6('0x16')]);}else{logger[_0xbcc6('0xf')](_0xbcc6('0x10'),_0x5aa9df,'request\x20sent');_0xdc0008(_0x5d1421[_0xbcc6('0x17')][_0xbcc6('0x16')]);}})[_0xbcc6('0x18')](function(_0x137ad5){logger[_0xbcc6('0x14')](_0xbcc6('0x10'),_0x5aa9df,_0x137ad5);_0x289bf1(_0x137ad5);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index d92b3ed..e181521 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 _0x803d=['/:id/out_servers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','post','addDisposition','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap'];(function(_0x426ccf,_0x4fbf52){var _0x243f84=function(_0x4e2e15){while(--_0x4e2e15){_0x426ccf['push'](_0x426ccf['shift']());}};_0x243f84(++_0x4fbf52);}(_0x803d,0x6e));var _0xd803=function(_0x3904d9,_0x3479ab){_0x3904d9=_0x3904d9-0x0;var _0x2f6fc0=_0x803d[_0x3904d9];return _0x2f6fc0;};'use strict';var multer=require(_0xd803('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd803('0x1'));var express=require(_0xd803('0x2'));var router=express['Router']();var fs_extra=require(_0xd803('0x3'));var auth=require(_0xd803('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd803('0x5'));var controller=require('./mailAccount.controller');router[_0xd803('0x6')]('/',auth[_0xd803('0x7')](),controller['index']);router[_0xd803('0x6')](_0xd803('0x8'),auth[_0xd803('0x7')](),controller[_0xd803('0x9')]);router[_0xd803('0x6')](_0xd803('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd803('0x6')](_0xd803('0xb'),auth[_0xd803('0x7')](),controller[_0xd803('0xc')]);router['get'](_0xd803('0xd'),auth[_0xd803('0x7')](),controller[_0xd803('0xe')]);router[_0xd803('0x6')]('/:id/in_servers',auth[_0xd803('0x7')](),controller[_0xd803('0xf')]);router['get'](_0xd803('0x10'),auth[_0xd803('0x7')](),controller['getSmtp']);router[_0xd803('0x6')](_0xd803('0x11'),auth[_0xd803('0x7')](),controller['getInteractions']);router['get'](_0xd803('0x12'),auth[_0xd803('0x7')](),controller[_0xd803('0x13')]);router[_0xd803('0x6')](_0xd803('0x14'),auth[_0xd803('0x7')](),controller['getMessages']);router[_0xd803('0x6')](_0xd803('0x15'),auth[_0xd803('0x7')](),controller[_0xd803('0x16')]);router[_0xd803('0x6')]('/:id/users',auth[_0xd803('0x7')](),controller['getAgents']);router[_0xd803('0x17')]('/:id/dispositions',auth[_0xd803('0x7')](),controller[_0xd803('0x18')]);router[_0xd803('0x17')](_0xd803('0xd'),auth[_0xd803('0x7')](),controller['addAnswer']);router[_0xd803('0x17')]('/',auth['isAuthenticated'](),controller[_0xd803('0x19')]);router[_0xd803('0x17')](_0xd803('0x1a'),auth[_0xd803('0x7')](),controller[_0xd803('0x1b')]);router[_0xd803('0x17')](_0xd803('0x10'),auth[_0xd803('0x7')](),controller[_0xd803('0x1c')]);router[_0xd803('0x17')](_0xd803('0x11'),auth[_0xd803('0x7')](),controller[_0xd803('0x1d')]);router[_0xd803('0x17')](_0xd803('0x12'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xd803('0x1e'),auth['isAuthenticated'](),controller[_0xd803('0x1f')]);router[_0xd803('0x17')](_0xd803('0x20'),auth[_0xd803('0x7')](),controller[_0xd803('0x21')]);router[_0xd803('0x22')](_0xd803('0xa'),auth[_0xd803('0x7')](),controller[_0xd803('0x23')]);router[_0xd803('0x24')]('/:id/dispositions',auth[_0xd803('0x7')](),controller[_0xd803('0x25')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd803('0x26')]);router['delete'](_0xd803('0x1a'),auth['isAuthenticated'](),controller['removeImap']);router[_0xd803('0x24')](_0xd803('0x10'),auth[_0xd803('0x7')](),controller[_0xd803('0x27')]);router[_0xd803('0x24')](_0xd803('0xa'),auth[_0xd803('0x7')](),controller['destroy']);router[_0xd803('0x24')]('/:id/users',auth[_0xd803('0x7')](),controller[_0xd803('0x28')]);module[_0xd803('0x29')]=router; \ No newline at end of file +var _0x712b=['getInteractions','/:id/applications','getApplications','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','create','addSmtp','addApplications','/:id/send','send','addAgents','/:id','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions'];(function(_0x3ba5c1,_0x549dce){var _0x32d1b4=function(_0x3781d2){while(--_0x3781d2){_0x3ba5c1['push'](_0x3ba5c1['shift']());}};_0x32d1b4(++_0x549dce);}(_0x712b,0x6f));var _0xb712=function(_0x4491d3,_0x2417a3){_0x4491d3=_0x4491d3-0x0;var _0x2e9465=_0x712b[_0x4491d3];return _0x2e9465;};'use strict';var multer=require(_0xb712('0x0'));var util=require(_0xb712('0x1'));var path=require(_0xb712('0x2'));var timeout=require(_0xb712('0x3'));var express=require(_0xb712('0x4'));var router=express[_0xb712('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb712('0x6'));var config=require('../../config/environment');var controller=require(_0xb712('0x7'));router[_0xb712('0x8')]('/',auth[_0xb712('0x9')](),controller[_0xb712('0xa')]);router['get'](_0xb712('0xb'),auth[_0xb712('0x9')](),controller[_0xb712('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb712('0xd')]);router[_0xb712('0x8')]('/:id/dispositions',auth[_0xb712('0x9')](),controller[_0xb712('0xe')]);router[_0xb712('0x8')]('/:id/canned_answers',auth[_0xb712('0x9')](),controller[_0xb712('0xf')]);router[_0xb712('0x8')](_0xb712('0x10'),auth[_0xb712('0x9')](),controller[_0xb712('0x11')]);router['get'](_0xb712('0x12'),auth[_0xb712('0x9')](),controller[_0xb712('0x13')]);router['get'](_0xb712('0x14'),auth[_0xb712('0x9')](),controller[_0xb712('0x15')]);router[_0xb712('0x8')](_0xb712('0x16'),auth[_0xb712('0x9')](),controller[_0xb712('0x17')]);router[_0xb712('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xb712('0x8')]('/:id/verify',auth['isAuthenticated'](),controller[_0xb712('0x18')]);router['get'](_0xb712('0x19'),auth[_0xb712('0x9')](),controller[_0xb712('0x1a')]);router[_0xb712('0x1b')](_0xb712('0x1c'),auth[_0xb712('0x9')](),controller['addDisposition']);router[_0xb712('0x1b')]('/:id/canned_answers',auth[_0xb712('0x9')](),controller['addAnswer']);router[_0xb712('0x1b')]('/',auth[_0xb712('0x9')](),controller[_0xb712('0x1d')]);router[_0xb712('0x1b')]('/:id/in_servers',auth[_0xb712('0x9')](),controller['addImap']);router[_0xb712('0x1b')]('/:id/out_servers',auth[_0xb712('0x9')](),controller[_0xb712('0x1e')]);router[_0xb712('0x1b')](_0xb712('0x14'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xb712('0x1b')](_0xb712('0x16'),auth[_0xb712('0x9')](),controller[_0xb712('0x1f')]);router[_0xb712('0x1b')](_0xb712('0x20'),auth[_0xb712('0x9')](),controller[_0xb712('0x21')]);router[_0xb712('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0xb712('0x22')]);router['put'](_0xb712('0x23'),auth[_0xb712('0x9')](),controller[_0xb712('0x24')]);router[_0xb712('0x25')](_0xb712('0x1c'),auth[_0xb712('0x9')](),controller[_0xb712('0x26')]);router[_0xb712('0x25')](_0xb712('0x27'),auth['isAuthenticated'](),controller[_0xb712('0x28')]);router[_0xb712('0x25')](_0xb712('0x10'),auth[_0xb712('0x9')](),controller[_0xb712('0x29')]);router[_0xb712('0x25')](_0xb712('0x12'),auth[_0xb712('0x9')](),controller[_0xb712('0x2a')]);router[_0xb712('0x25')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb712('0x25')](_0xb712('0x19'),auth[_0xb712('0x9')](),controller['removeAgents']);module[_0xb712('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 17ff71e..73f531c 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 _0xe14d=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x575211,_0x389691){var _0x40730c=function(_0x86592e){while(--_0x86592e){_0x575211['push'](_0x575211['shift']());}};_0x40730c(++_0x389691);}(_0xe14d,0x1ee));var _0xde14=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xe14d[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'description':{'type':Sequelize[_0xde14('0x2')]},'name':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xde14('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xde14('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xde14('0x4')]},'markAsUnread':{'type':Sequelize[_0xde14('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xde14('0x2')],'allowNull':![],'defaultValue':_0xde14('0x5')},'fontSize':{'type':Sequelize[_0xde14('0x6')](0x2)[_0xde14('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xde14('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde14('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xde14('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xde14('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde14('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde14('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde14('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde14('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xde14('0x3')],'defaultValue':![],'comment':_0xde14('0x8'),'set':function(_0x417269){if(!_0x417269)this[_0xde14('0x9')](_0xde14('0xa'),null);this[_0xde14('0x9')](_0xde14('0xb'),_0x417269);}}}; \ No newline at end of file +var _0x85d0=['UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d0,0x164));var _0x085d=function(_0x11eeb1,_0x3519f5){_0x11eeb1=_0x11eeb1-0x0;var _0x344570=_0x85d0[_0x11eeb1];return _0x344570;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x085d('0x0')],'defaultValue':![]},'email':{'type':Sequelize[_0x085d('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x085d('0x0')],'defaultValue':!![]},'key':{'type':Sequelize[_0x085d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x085d('0x2')]},'markAsUnread':{'type':Sequelize[_0x085d('0x0')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x085d('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x085d('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x085d('0x2')],'defaultValue':function(){return _0x085d('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x085d('0x0')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x085d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x085d('0x0')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x085d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x085d('0x0')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x085d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x085d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x085d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x085d('0x0')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x764e2b){if(!_0x764e2b)this[_0x085d('0x8')](_0x085d('0x9'),null);this[_0x085d('0x8')]('mandatoryDisposition',_0x764e2b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 1a388be..eb76ba4 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 _0x55f4=['filters','pick','filter','merge','options','includeAll','findAll','show','params','keys','include','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','hasOwnProperty','rows','removeDispositions','ids','getAnswers','CannedAnswer','rawAttributes','removeAnswers','email','description','isNil','cservice','user','Smtp','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','Contacts','updatedAt','from','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','subject','out','format','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','html-to-text','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55f4,0x1f1));var _0x455f=function(_0x20c19e,_0x1b8c3a){_0x20c19e=_0x20c19e-0x0;var _0x2375bd=_0x55f4[_0x20c19e];return _0x2375bd;};'use strict';var emlformat=require(_0x455f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x455f('0x1'));var jsonpatch=require(_0x455f('0x2'));var rp=require(_0x455f('0x3'));var moment=require('moment');var BPromise=require(_0x455f('0x4'));var Mustache=require(_0x455f('0x5'));var util=require(_0x455f('0x6'));var path=require(_0x455f('0x7'));var sox=require(_0x455f('0x8'));var csv=require('to-csv');var ejs=require(_0x455f('0x9'));var fs=require('fs');var fs_extra=require(_0x455f('0xa'));var _=require(_0x455f('0xb'));var squel=require(_0x455f('0xc'));var crypto=require('crypto');var jsforce=require(_0x455f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x455f('0xe'));var querystring=require(_0x455f('0xf'));var Papa=require(_0x455f('0x10'));var htmlToText=require(_0x455f('0x11'));var juice=require(_0x455f('0x12'));var Redis=require(_0x455f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x455f('0x14'));var as=require(_0x455f('0x15'));var hardwareService=require(_0x455f('0x16'));var logger=require(_0x455f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x455f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x455f('0x19'))['db'];config[_0x455f('0x1a')]=_[_0x455f('0x1b')](config[_0x455f('0x1a')],{'host':_0x455f('0x1c'),'port':0x18eb});var socket=require(_0x455f('0x1d'))(new Redis(config[_0x455f('0x1a')]));require(_0x455f('0x1e'))[_0x455f('0x1f')](socket);var jayson=require(_0x455f('0x20'));var client=jayson['client'][_0x455f('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x1221e3,_0x3c3c3a,_0x1572f0,_0x1dd8a6){return new BPromise(function(_0x153ef8,_0x549e37){var _0x582b54=_0x1dd8a6||client;return _0x582b54[_0x455f('0x22')](_0x1221e3,_0x1572f0)[_0x455f('0x23')](function(_0x2f1f0c){logger[_0x455f('0x24')](_0x455f('0x25'),_0x3c3c3a,_0x455f('0x26'));logger[_0x455f('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3c3c3a,_0x455f('0x26'),JSON['stringify'](_0x2f1f0c));if(_0x2f1f0c['error']){if(_0x2f1f0c[_0x455f('0x28')]['code']===0x1f4){logger[_0x455f('0x28')]('MailAccount,\x20%s,\x20%s',_0x3c3c3a,_0x2f1f0c[_0x455f('0x28')][_0x455f('0x29')]);return _0x549e37(_0x2f1f0c[_0x455f('0x28')][_0x455f('0x29')]);}logger['error'](_0x455f('0x25'),_0x3c3c3a,_0x2f1f0c[_0x455f('0x28')][_0x455f('0x29')]);return _0x153ef8(_0x2f1f0c[_0x455f('0x28')]['message']);}else{logger[_0x455f('0x24')](_0x455f('0x25'),_0x3c3c3a,_0x455f('0x26'));_0x153ef8(_0x2f1f0c[_0x455f('0x2a')]['message']);}})[_0x455f('0x2b')](function(_0x199de4){logger[_0x455f('0x28')](_0x455f('0x25'),_0x3c3c3a,_0x199de4);_0x549e37(_0x199de4);});});}function respondWithStatusCode(_0x425693,_0x32f214){_0x32f214=_0x32f214||0xcc;return function(_0x2be7cd){if(_0x2be7cd){return _0x425693[_0x455f('0x2c')](_0x32f214);}return _0x425693['status'](_0x32f214)[_0x455f('0x2d')]();};}function respondWithResult(_0x74fc0,_0x3d4ea1){_0x3d4ea1=_0x3d4ea1||0xc8;return function(_0x2bc8ae){if(_0x2bc8ae){return _0x74fc0[_0x455f('0x2e')](_0x3d4ea1)[_0x455f('0x2f')](_0x2bc8ae);}};}function respondWithFilteredResult(_0x3edd4c,_0x1f3ab1){return function(_0x4f37d8){if(_0x4f37d8){var _0x116a5b=typeof _0x1f3ab1[_0x455f('0x30')]===_0x455f('0x31')&&typeof _0x1f3ab1[_0x455f('0x32')]==='undefined';var _0x51461e=_0x4f37d8[_0x455f('0x33')];var _0x253267=_0x116a5b?0x0:_0x1f3ab1[_0x455f('0x30')];var _0x3fc0b2=_0x116a5b?_0x4f37d8[_0x455f('0x33')]:_0x1f3ab1['offset']+_0x1f3ab1['limit'];var _0xa43a50;if(_0x3fc0b2>=_0x51461e){_0x3fc0b2=_0x51461e;_0xa43a50=0xc8;}else{_0xa43a50=0xce;}_0x3edd4c['status'](_0xa43a50);return _0x3edd4c[_0x455f('0x34')](_0x455f('0x35'),_0x253267+'-'+_0x3fc0b2+'/'+_0x51461e)[_0x455f('0x2f')](_0x4f37d8);}return null;};}function patchUpdates(_0x399c40){return function(_0x56d4cf){try{jsonpatch[_0x455f('0x36')](_0x56d4cf,_0x399c40,!![]);}catch(_0x5b383c){return BPromise['reject'](_0x5b383c);}return _0x56d4cf[_0x455f('0x37')]();};}function saveUpdates(_0x5a9190,_0x4789ad){return function(_0x31becf){if(_0x31becf){return _0x31becf[_0x455f('0x38')](_0x5a9190)[_0x455f('0x23')](function(_0x551c79){return _0x551c79;});}return null;};}function removeEntity(_0x352931,_0x1fb394){return function(_0x1a1962){if(_0x1a1962){return _0x1a1962[_0x455f('0x39')]()[_0x455f('0x23')](function(){var _0x30eb67=_0x1a1962[_0x455f('0x3a')]({'plain':!![]});var _0x593964=_0x455f('0x3b');return db[_0x455f('0x3c')][_0x455f('0x39')]({'where':{'type':_0x593964,'resourceId':_0x30eb67['id']}})[_0x455f('0x23')](function(){return _0x1a1962;});})[_0x455f('0x23')](function(){_0x352931[_0x455f('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53344f,_0x21782e){return function(_0x7f058e){if(!_0x7f058e){_0x53344f[_0x455f('0x2c')](0x194);}return _0x7f058e;};}function handleError(_0x27e4c4,_0x48583c){_0x48583c=_0x48583c||0x1f4;return function(_0xfd178b){logger[_0x455f('0x28')](_0xfd178b[_0x455f('0x3d')]);if(_0xfd178b[_0x455f('0x3e')]){delete _0xfd178b[_0x455f('0x3e')];}_0x27e4c4[_0x455f('0x2e')](_0x48583c)[_0x455f('0x3f')](_0xfd178b);};}exports[_0x455f('0x40')]=function(_0xc88eed,_0x1fd1e9){var _0x400b2f={'include':[{'model':db[_0x455f('0x41')],'as':_0x455f('0x42')},{'model':db[_0x455f('0x43')],'as':'Smtp'},{'model':db[_0x455f('0x44')],'as':_0x455f('0x45')}]},_0x336b0f={},_0x9df7b1={'count':0x0,'rows':[]};var _0x4e1887=_[_0x455f('0x46')](db[_0x455f('0x47')]['rawAttributes'],function(_0x190560){return{'name':_0x190560[_0x455f('0x48')],'type':_0x190560[_0x455f('0x49')][_0x455f('0x4a')]};});_0x336b0f['model']=_[_0x455f('0x46')](_0x4e1887,_0x455f('0x3e'));_0x336b0f[_0x455f('0x4b')]=_['keys'](_0xc88eed[_0x455f('0x4b')]);_0x336b0f['filters']=_[_0x455f('0x4c')](_0x336b0f[_0x455f('0x4d')],_0x336b0f[_0x455f('0x4b')]);_0x400b2f['attributes']=_['intersection'](_0x336b0f[_0x455f('0x4d')],qs[_0x455f('0x4e')](_0xc88eed[_0x455f('0x4b')][_0x455f('0x4e')]));_0x400b2f[_0x455f('0x4f')]=_0x400b2f[_0x455f('0x4f')][_0x455f('0x50')]?_0x400b2f[_0x455f('0x4f')]:_0x336b0f[_0x455f('0x4d')];if(!_0xc88eed[_0x455f('0x4b')]['hasOwnProperty'](_0x455f('0x51'))){_0x400b2f['limit']=qs[_0x455f('0x32')](_0xc88eed[_0x455f('0x4b')][_0x455f('0x32')]);_0x400b2f['offset']=qs[_0x455f('0x30')](_0xc88eed[_0x455f('0x4b')][_0x455f('0x30')]);}_0x400b2f[_0x455f('0x52')]=qs[_0x455f('0x53')](_0xc88eed[_0x455f('0x4b')][_0x455f('0x53')]);_0x400b2f[_0x455f('0x54')]=qs[_0x455f('0x55')](_[_0x455f('0x56')](_0xc88eed['query'],_0x336b0f[_0x455f('0x55')]),_0x4e1887);if(_0xc88eed[_0x455f('0x4b')][_0x455f('0x57')]){_0x400b2f[_0x455f('0x54')]=_[_0x455f('0x58')](_0x400b2f[_0x455f('0x54')],{'$or':_[_0x455f('0x46')](_0x4e1887,function(_0x3c9e6e){if(_0x3c9e6e[_0x455f('0x49')]!=='VIRTUAL'){var _0x32f035={};_0x32f035[_0x3c9e6e[_0x455f('0x3e')]]={'$like':'%'+_0xc88eed[_0x455f('0x4b')][_0x455f('0x57')]+'%'};return _0x32f035;}})});}_0x400b2f=_[_0x455f('0x58')]({},_0x400b2f,_0xc88eed[_0x455f('0x59')]);var _0x278358={'where':_0x400b2f['where']};return db[_0x455f('0x47')][_0x455f('0x33')](_0x278358)['then'](function(_0x3e4bd0){_0x9df7b1[_0x455f('0x33')]=_0x3e4bd0;if(_0xc88eed[_0x455f('0x4b')][_0x455f('0x5a')]){_0x400b2f['include']=[{'all':!![]}];}return db[_0x455f('0x47')][_0x455f('0x5b')](_0x400b2f);})[_0x455f('0x23')](function(_0x151b59){_0x9df7b1['rows']=_0x151b59;return _0x9df7b1;})[_0x455f('0x23')](respondWithFilteredResult(_0x1fd1e9,_0x400b2f))['catch'](handleError(_0x1fd1e9,null));};exports[_0x455f('0x5c')]=function(_0x1f109c,_0x315f1d){var _0x26103a={'raw':![],'where':{'id':_0x1f109c[_0x455f('0x5d')]['id']},'include':[{'model':db[_0x455f('0x41')],'as':_0x455f('0x42')},{'model':db[_0x455f('0x43')],'as':'Smtp'},{'model':db[_0x455f('0x44')],'as':_0x455f('0x45')}]},_0x4adf0c={};_0x4adf0c[_0x455f('0x4d')]=_[_0x455f('0x5e')](db['MailAccount']['rawAttributes']);_0x4adf0c['query']=_[_0x455f('0x5e')](_0x1f109c['query']);_0x4adf0c[_0x455f('0x55')]=_['intersection'](_0x4adf0c[_0x455f('0x4d')],_0x4adf0c[_0x455f('0x4b')]);_0x26103a[_0x455f('0x4f')]=_[_0x455f('0x4c')](_0x4adf0c[_0x455f('0x4d')],qs[_0x455f('0x4e')](_0x1f109c[_0x455f('0x4b')][_0x455f('0x4e')]));_0x26103a[_0x455f('0x4f')]=_0x26103a[_0x455f('0x4f')][_0x455f('0x50')]?_0x26103a[_0x455f('0x4f')]:_0x4adf0c['model'];if(_0x1f109c['query'][_0x455f('0x5a')]){_0x26103a[_0x455f('0x5f')]=[{'all':!![]}];}_0x26103a=_[_0x455f('0x58')]({},_0x26103a,_0x1f109c['options']);return db[_0x455f('0x47')][_0x455f('0x60')](_0x26103a)[_0x455f('0x23')](handleEntityNotFound(_0x315f1d,null))[_0x455f('0x23')](respondWithResult(_0x315f1d,null))[_0x455f('0x2b')](handleError(_0x315f1d,null));};exports[_0x455f('0x38')]=function(_0x2456e6,_0x32bf98){if(_0x2456e6[_0x455f('0x61')]['id']){delete _0x2456e6[_0x455f('0x61')]['id'];}return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0x2456e6['params']['id']},'include':[{'model':db[_0x455f('0x41')],'as':'Imap'},{'model':db[_0x455f('0x43')],'as':'Smtp'},{'model':db[_0x455f('0x44')],'as':_0x455f('0x45')}]})[_0x455f('0x23')](handleEntityNotFound(_0x32bf98,null))[_0x455f('0x23')](saveUpdates(_0x2456e6['body'],null))[_0x455f('0x23')](function(_0x2a94c1){if(_0x2a94c1&&_0x2456e6[_0x455f('0x61')]['Imap']){return db[_0x455f('0x41')][_0x455f('0x38')](_0x2456e6[_0x455f('0x61')]['Imap'],{'where':{'MailAccountId':_0x2a94c1['id']}})[_0x455f('0x23')](function(){return _0x2a94c1;});}return _0x2a94c1;})['then'](function(_0x73592e){if(_0x73592e&&_0x2456e6[_0x455f('0x61')]['Smtp']){return db[_0x455f('0x43')][_0x455f('0x38')](_0x2456e6['body']['Smtp'],{'where':{'MailAccountId':_0x73592e['id']}})[_0x455f('0x23')](function(){return _0x73592e;});}return _0x73592e;})[_0x455f('0x23')](respondWithResult(_0x32bf98,null))[_0x455f('0x2b')](handleError(_0x32bf98,null));};exports[_0x455f('0x62')]=function(_0x2e504c,_0x28cf8d){return db[_0x455f('0x47')]['describe']()[_0x455f('0x23')](respondWithResult(_0x28cf8d,null))[_0x455f('0x2b')](handleError(_0x28cf8d,null));};exports[_0x455f('0x63')]=function(_0x340012,_0x3dacf2,_0x588df4){if(_0x340012['body']['id']){delete _0x340012[_0x455f('0x61')]['id'];}return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0x340012[_0x455f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3dacf2,null))[_0x455f('0x23')](function(_0x5aaa76){if(_0x5aaa76){_0x340012['body'][_0x455f('0x64')]=_0x5aaa76['id'];return db[_0x455f('0x65')][_0x455f('0x66')](_0x340012[_0x455f('0x61')]);}})[_0x455f('0x23')](respondWithResult(_0x3dacf2,null))['catch'](handleError(_0x3dacf2,null));};exports[_0x455f('0x67')]=function(_0x59ff04,_0x57310a,_0x4f0bbb){var _0x218096={'raw':![],'where':{}};var _0x5c1aed={};var _0x1e68b4={'count':0x0,'rows':[]};return db[_0x455f('0x47')]['findOne']({'where':{'id':_0x59ff04[_0x455f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x57310a,null))[_0x455f('0x23')](function(_0x193f5f){if(_0x193f5f){_0x5c1aed[_0x455f('0x4d')]=_[_0x455f('0x5e')](db[_0x455f('0x65')]['rawAttributes']);_0x5c1aed[_0x455f('0x4b')]=_[_0x455f('0x5e')](_0x59ff04[_0x455f('0x4b')]);_0x5c1aed[_0x455f('0x55')]=_[_0x455f('0x4c')](_0x5c1aed[_0x455f('0x4d')],_0x5c1aed[_0x455f('0x4b')]);_0x218096[_0x455f('0x4f')]=_[_0x455f('0x4c')](_0x5c1aed['model'],qs[_0x455f('0x4e')](_0x59ff04[_0x455f('0x4b')]['fields']));_0x218096['attributes']=_0x218096[_0x455f('0x4f')][_0x455f('0x50')]?_0x218096[_0x455f('0x4f')]:_0x5c1aed[_0x455f('0x4d')];if(!_0x59ff04['query'][_0x455f('0x68')](_0x455f('0x51'))){_0x218096[_0x455f('0x32')]=qs[_0x455f('0x32')](_0x59ff04[_0x455f('0x4b')]['limit']);_0x218096['offset']=qs[_0x455f('0x30')](_0x59ff04[_0x455f('0x4b')][_0x455f('0x30')]);}_0x218096[_0x455f('0x52')]=qs[_0x455f('0x53')](_0x59ff04[_0x455f('0x4b')][_0x455f('0x53')]);_0x218096[_0x455f('0x54')]=qs[_0x455f('0x55')](_[_0x455f('0x56')](_0x59ff04[_0x455f('0x4b')],_0x5c1aed[_0x455f('0x55')]));_0x218096[_0x455f('0x54')]['MailAccountId']=_0x193f5f['id'];if(_0x59ff04[_0x455f('0x4b')][_0x455f('0x57')]){_0x218096[_0x455f('0x54')]=_[_0x455f('0x58')](_0x218096[_0x455f('0x54')],{'$or':_[_0x455f('0x46')](_0x218096['attributes'],function(_0x49522b){var _0xd539ed={};_0xd539ed[_0x49522b]={'$like':'%'+_0x59ff04[_0x455f('0x4b')][_0x455f('0x57')]+'%'};return _0xd539ed;})});}_0x218096=_[_0x455f('0x58')]({},_0x218096,_0x59ff04['options']);return db[_0x455f('0x65')]['count']({'where':_0x218096[_0x455f('0x54')]})[_0x455f('0x23')](function(_0x1706cd){_0x1e68b4[_0x455f('0x33')]=_0x1706cd;if(_0x59ff04[_0x455f('0x4b')][_0x455f('0x5a')]){_0x218096[_0x455f('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0x455f('0x5b')](_0x218096);})['then'](function(_0x507b05){_0x1e68b4[_0x455f('0x69')]=_0x507b05;return _0x1e68b4;});}})[_0x455f('0x23')](respondWithFilteredResult(_0x57310a,_0x218096))[_0x455f('0x2b')](handleError(_0x57310a,null));};exports['removeDispositions']=function(_0x5bd58d,_0x40ebfd,_0x995054){return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0x5bd58d[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x40ebfd,null))[_0x455f('0x23')](function(_0x1b0f89){if(_0x1b0f89){return _0x1b0f89[_0x455f('0x6a')](_0x5bd58d[_0x455f('0x4b')][_0x455f('0x6b')]);}})[_0x455f('0x23')](respondWithStatusCode(_0x40ebfd,null))['catch'](handleError(_0x40ebfd,null));};exports['addAnswer']=function(_0x1daa15,_0x8761bb,_0x53a8a8){if(_0x1daa15[_0x455f('0x61')]['id']){delete _0x1daa15[_0x455f('0x61')]['id'];}return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0x1daa15['params']['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x8761bb,null))['then'](function(_0x2d7698){if(_0x2d7698){_0x1daa15[_0x455f('0x61')][_0x455f('0x64')]=_0x2d7698['id'];return db['CannedAnswer'][_0x455f('0x66')](_0x1daa15[_0x455f('0x61')]);}})['then'](respondWithResult(_0x8761bb,null))['catch'](handleError(_0x8761bb,null));};exports[_0x455f('0x6c')]=function(_0x1aee00,_0x248906,_0x1c5d89){var _0x151559={'raw':![],'where':{}};var _0xfda8ce={};var _0x53e40a={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x1aee00[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x248906,null))[_0x455f('0x23')](function(_0x442e1d){if(_0x442e1d){_0xfda8ce[_0x455f('0x4d')]=_[_0x455f('0x5e')](db[_0x455f('0x6d')][_0x455f('0x6e')]);_0xfda8ce[_0x455f('0x4b')]=_[_0x455f('0x5e')](_0x1aee00[_0x455f('0x4b')]);_0xfda8ce[_0x455f('0x55')]=_[_0x455f('0x4c')](_0xfda8ce[_0x455f('0x4d')],_0xfda8ce['query']);_0x151559[_0x455f('0x4f')]=_[_0x455f('0x4c')](_0xfda8ce[_0x455f('0x4d')],qs[_0x455f('0x4e')](_0x1aee00['query'][_0x455f('0x4e')]));_0x151559[_0x455f('0x4f')]=_0x151559[_0x455f('0x4f')][_0x455f('0x50')]?_0x151559['attributes']:_0xfda8ce['model'];if(!_0x1aee00['query'][_0x455f('0x68')](_0x455f('0x51'))){_0x151559[_0x455f('0x32')]=qs['limit'](_0x1aee00[_0x455f('0x4b')][_0x455f('0x32')]);_0x151559[_0x455f('0x30')]=qs['offset'](_0x1aee00[_0x455f('0x4b')]['offset']);}_0x151559[_0x455f('0x52')]=qs[_0x455f('0x53')](_0x1aee00[_0x455f('0x4b')][_0x455f('0x53')]);_0x151559['where']=qs[_0x455f('0x55')](_['pick'](_0x1aee00[_0x455f('0x4b')],_0xfda8ce[_0x455f('0x55')]));_0x151559[_0x455f('0x54')]['MailAccountId']=_0x442e1d['id'];if(_0x1aee00[_0x455f('0x4b')][_0x455f('0x57')]){_0x151559[_0x455f('0x54')]=_['merge'](_0x151559[_0x455f('0x54')],{'$or':_[_0x455f('0x46')](_0x151559[_0x455f('0x4f')],function(_0x2b56b5){var _0x109962={};_0x109962[_0x2b56b5]={'$like':'%'+_0x1aee00[_0x455f('0x4b')][_0x455f('0x57')]+'%'};return _0x109962;})});}_0x151559=_[_0x455f('0x58')]({},_0x151559,_0x1aee00['options']);return db[_0x455f('0x6d')][_0x455f('0x33')]({'where':_0x151559[_0x455f('0x54')]})[_0x455f('0x23')](function(_0x182aa7){_0x53e40a[_0x455f('0x33')]=_0x182aa7;if(_0x1aee00[_0x455f('0x4b')][_0x455f('0x5a')]){_0x151559['include']=[{'all':!![]}];}return db[_0x455f('0x6d')][_0x455f('0x5b')](_0x151559);})['then'](function(_0x39480b){_0x53e40a[_0x455f('0x69')]=_0x39480b;return _0x53e40a;});}})['then'](respondWithFilteredResult(_0x248906,_0x151559))[_0x455f('0x2b')](handleError(_0x248906,null));};exports[_0x455f('0x6f')]=function(_0x401b58,_0x4d42c1,_0x539ec4){return db['MailAccount'][_0x455f('0x60')]({'where':{'id':_0x401b58[_0x455f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4d42c1,null))[_0x455f('0x23')](function(_0x22d566){if(_0x22d566){return _0x22d566[_0x455f('0x6f')](_0x401b58['query'][_0x455f('0x6b')]);}})[_0x455f('0x23')](respondWithStatusCode(_0x4d42c1,null))['catch'](handleError(_0x4d42c1,null));};exports[_0x455f('0x66')]=function(_0x234873,_0x1d1adc){var _0x57883e={'name':_0x234873[_0x455f('0x61')][_0x455f('0x3e')],'key':_0x234873[_0x455f('0x61')][_0x455f('0x4a')],'email':_0x234873[_0x455f('0x61')][_0x455f('0x70')],'ListId':_0x234873[_0x455f('0x61')]['ListId'],'active':!_['isNil'](_0x234873['body']['active'])?_0x234873[_0x455f('0x61')]['active']:!![],'description':_0x234873[_0x455f('0x61')][_0x455f('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0x455f('0x72')](_0x234873[_0x455f('0x61')][_0x455f('0x73')])){if(_0x234873[_0x455f('0x61')]['cauthentication']){_0x57883e[_0x455f('0x42')][_0x455f('0x74')]=_0x57883e[_0x455f('0x75')][_0x455f('0x74')]=_0x234873[_0x455f('0x61')][_0x455f('0x76')];_0x57883e[_0x455f('0x42')][_0x455f('0x77')]=_0x57883e[_0x455f('0x75')][_0x455f('0x78')]=_0x234873['body'][_0x455f('0x79')];}else{_0x57883e[_0x455f('0x42')][_0x455f('0x7a')]=_0x57883e[_0x455f('0x75')][_0x455f('0x7a')]=![];}_0x57883e[_0x455f('0x42')][_0x455f('0x7b')]=_0x234873['body']['Imap'][_0x455f('0x7b')];_0x57883e[_0x455f('0x42')]['port']=_0x234873[_0x455f('0x61')][_0x455f('0x42')][_0x455f('0x7c')];_0x57883e[_0x455f('0x75')]['host']=_0x234873['body'][_0x455f('0x75')][_0x455f('0x7b')];_0x57883e[_0x455f('0x75')][_0x455f('0x7c')]=_0x234873[_0x455f('0x61')][_0x455f('0x75')]['port'];}else{_0x57883e[_0x455f('0x42')][_0x455f('0x7d')]=_0x57883e[_0x455f('0x75')]['service']=_0x234873['body'][_0x455f('0x73')];_0x57883e['Imap'][_0x455f('0x74')]=_0x57883e[_0x455f('0x75')][_0x455f('0x74')]=_0x234873['body'][_0x455f('0x76')];_0x57883e[_0x455f('0x42')][_0x455f('0x77')]=_0x57883e[_0x455f('0x75')]['pass']=_0x234873[_0x455f('0x61')]['cpassword'];}return db[_0x455f('0x47')][_0x455f('0x66')](_0x57883e,{'include':[{'model':db['MailServerOut'],'as':_0x455f('0x75')},{'model':db[_0x455f('0x41')],'as':_0x455f('0x42')}]})[_0x455f('0x23')](function(_0x3fa2bd){var _0x44c945=_0x234873['user'][_0x455f('0x3a')]({'plain':!![]});if(!_0x44c945)throw new Error(_0x455f('0x7e'));if(_0x44c945['role']===_0x455f('0x74')){var _0x2754a2=_0x3fa2bd[_0x455f('0x3a')]({'plain':!![]});return db['UserProfileSection'][_0x455f('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x44c945[_0x455f('0x7f')]},'raw':!![]})[_0x455f('0x23')](function(_0x24c65b){if(_0x24c65b&&_0x24c65b['autoAssociation']===0x0){return db[_0x455f('0x3c')][_0x455f('0x66')]({'name':_0x2754a2[_0x455f('0x3e')],'resourceId':_0x2754a2['id'],'type':_0x24c65b['name'],'sectionId':_0x24c65b['id']},{})['then'](function(){return _0x3fa2bd;});}else{return _0x3fa2bd;}})[_0x455f('0x2b')](function(_0x420519){logger[_0x455f('0x28')](_0x455f('0x80'),_0x420519);throw _0x420519;});}return _0x3fa2bd;})[_0x455f('0x23')](respondWithResult(_0x1d1adc,0xc9))[_0x455f('0x2b')](handleError(_0x1d1adc,null));};exports[_0x455f('0x81')]=function(_0x1d731e,_0x2ed178,_0xac2ec0){return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x1d731e['params']['id']}})['then'](handleEntityNotFound(_0x2ed178,null))[_0x455f('0x23')](function(_0xa7217d){if(_0xa7217d){return _0xa7217d[_0x455f('0x81')]();}return null;})[_0x455f('0x23')](respondWithResult(_0x2ed178,null))[_0x455f('0x2b')](handleError(_0x2ed178,null));};exports['addImap']=function(_0x412ee7,_0x720840,_0x36d93f){if(_0x412ee7[_0x455f('0x61')]['id']){delete _0x412ee7[_0x455f('0x61')]['id'];}return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0x412ee7[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x720840,null))['then'](function(_0xab2d22){if(_0xab2d22){_0x412ee7[_0x455f('0x61')][_0x455f('0x64')]=_0xab2d22['id'];return db[_0x455f('0x41')][_0x455f('0x66')](_0x412ee7[_0x455f('0x61')]);}})[_0x455f('0x23')](respondWithResult(_0x720840,null))[_0x455f('0x2b')](handleError(_0x720840,null));};exports[_0x455f('0x83')]=function(_0x30ba89,_0x279189,_0x347c4f){return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x30ba89[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x279189,null))[_0x455f('0x23')](function(_0x55fde0){if(_0x55fde0){return _0x55fde0['setImap'](null);}return null;})[_0x455f('0x23')](respondWithStatusCode(_0x279189,null))['catch'](handleError(_0x279189,null));};exports[_0x455f('0x84')]=function(_0x374c3b,_0x89d698,_0x3fd0ba){return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x374c3b[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x89d698,null))[_0x455f('0x23')](function(_0x141496){if(_0x141496){return _0x141496[_0x455f('0x84')]();}return null;})[_0x455f('0x23')](respondWithResult(_0x89d698,null))[_0x455f('0x2b')](handleError(_0x89d698,null));};exports[_0x455f('0x85')]=function(_0xbc54df,_0x5bc7fa,_0x47c47f){if(_0xbc54df[_0x455f('0x61')]['id']){delete _0xbc54df[_0x455f('0x61')]['id'];}return db['MailAccount'][_0x455f('0x60')]({'where':{'id':_0xbc54df[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x5bc7fa,null))[_0x455f('0x23')](function(_0x33637f){if(_0x33637f){_0xbc54df[_0x455f('0x61')]['MailAccountId']=_0x33637f['id'];return db['MailServerOut']['create'](_0xbc54df['body']);}})['then'](respondWithResult(_0x5bc7fa,null))[_0x455f('0x2b')](handleError(_0x5bc7fa,null));};exports[_0x455f('0x86')]=function(_0x29bafa,_0x224878,_0x531e2c){return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x29bafa[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x224878,null))['then'](function(_0xa27d3c){if(_0xa27d3c){return _0xa27d3c['setSmtp'](null);}return null;})[_0x455f('0x23')](respondWithStatusCode(_0x224878,null))[_0x455f('0x2b')](handleError(_0x224878,null));};exports[_0x455f('0x87')]=function(_0x1109e4,_0x473634,_0x1d64b4){return db[_0x455f('0x88')][_0x455f('0x60')]({'where':{'id':_0x1109e4['params']['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x473634,null))['then'](function(_0x1ead6d){if(_0x1ead6d){return _0x1ead6d['addInteraction'](_0x1109e4[_0x455f('0x61')][_0x455f('0x6b')],_['omit'](_0x1109e4[_0x455f('0x61')],[_0x455f('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x473634,null))['catch'](handleError(_0x473634,null));};exports[_0x455f('0x89')]=function(_0x12ed72,_0x592a70,_0x4d71f1){var _0x5942b3={'raw':![],'where':{}};var _0x550fc4={};var _0x16901b={'count':0x0,'rows':[]};return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x12ed72[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x592a70,null))[_0x455f('0x23')](function(_0x16e297){if(_0x16e297){_0x550fc4[_0x455f('0x4d')]=_[_0x455f('0x5e')](db[_0x455f('0x88')][_0x455f('0x6e')]);_0x550fc4[_0x455f('0x4b')]=_[_0x455f('0x5e')](_0x12ed72['query']);_0x550fc4['filters']=_[_0x455f('0x4c')](_0x550fc4['model'],_0x550fc4[_0x455f('0x4b')]);_0x5942b3[_0x455f('0x4f')]=_[_0x455f('0x4c')](_0x550fc4[_0x455f('0x4d')],qs[_0x455f('0x4e')](_0x12ed72['query'][_0x455f('0x4e')]));_0x5942b3['attributes']=_0x5942b3[_0x455f('0x4f')]['length']?_0x5942b3[_0x455f('0x4f')]:_0x550fc4[_0x455f('0x4d')];if(!_0x12ed72[_0x455f('0x4b')][_0x455f('0x68')]('nolimit')){_0x5942b3[_0x455f('0x32')]=qs[_0x455f('0x32')](_0x12ed72[_0x455f('0x4b')][_0x455f('0x32')]);_0x5942b3[_0x455f('0x30')]=qs[_0x455f('0x30')](_0x12ed72[_0x455f('0x4b')][_0x455f('0x30')]);}_0x5942b3[_0x455f('0x52')]=qs[_0x455f('0x53')](_0x12ed72[_0x455f('0x4b')][_0x455f('0x53')]);_0x5942b3['where']=qs[_0x455f('0x55')](_['pick'](_0x12ed72[_0x455f('0x4b')],_0x550fc4[_0x455f('0x55')]));_0x5942b3[_0x455f('0x54')][_0x455f('0x64')]=_0x16e297['id'];if(_0x12ed72[_0x455f('0x4b')]['filter']){_0x5942b3['where']=_[_0x455f('0x58')](_0x5942b3['where'],{'$or':_[_0x455f('0x46')](_0x5942b3[_0x455f('0x4f')],function(_0x12262a){var _0x42fdc5={};_0x42fdc5[_0x12262a]={'$like':'%'+_0x12ed72[_0x455f('0x4b')][_0x455f('0x57')]+'%'};return _0x42fdc5;})});}_0x5942b3=_[_0x455f('0x58')]({},_0x5942b3,_0x12ed72[_0x455f('0x59')]);return db[_0x455f('0x88')][_0x455f('0x33')]({'where':_0x5942b3[_0x455f('0x54')]})[_0x455f('0x23')](function(_0x4ebddb){_0x16901b['count']=_0x4ebddb;if(_0x12ed72[_0x455f('0x4b')][_0x455f('0x5a')]){_0x5942b3['include']=[{'model':db[_0x455f('0x8a')],'as':_0x455f('0x8b'),'required':![]},{'model':db[_0x455f('0x8c')],'as':_0x455f('0x8d'),'attributes':[_0x455f('0x3e'),_0x455f('0x8e'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x455f('0x8f'),'attributes':['id','name','color'],'where':_0x12ed72[_0x455f('0x4b')]['tag']?{'id':_0x12ed72[_0x455f('0x4b')][_0x455f('0x90')]}:undefined,'required':_0x12ed72['query'][_0x455f('0x90')]?!![]:![]}];}return db[_0x455f('0x88')][_0x455f('0x5b')](_0x5942b3);})[_0x455f('0x23')](function(_0x78d9f8){_0x16901b[_0x455f('0x69')]=_0x78d9f8;return _0x16901b;});}})['then'](respondWithFilteredResult(_0x592a70,_0x5942b3))['catch'](handleError(_0x592a70,null));};exports[_0x455f('0x91')]=function addApplications(_0x59f1e3,_0x28d6f8){var _0x26e502=_0x59f1e3[_0x455f('0x5d')]['id'];var _0x5bae44=_0x59f1e3['body'];var _0x12cfe6=0xc8;var _0x350b78=null;return db[_0x455f('0x92')][_0x455f('0x93')]({'isolationLevel':db['sequelize'][_0x455f('0x94')][_0x455f('0x95')][_0x455f('0x96')]},function(_0x3974e2){return db['MailAccount'][_0x455f('0x82')]({'where':{'id':_0x26e502},'transaction':_0x3974e2})[_0x455f('0x23')](function(_0x24bbd8){if(_0x24bbd8){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x26e502},'transaction':_0x3974e2})['then'](function(){var _0x23a9bf=_['map'](_0x5bae44,function(_0xf29bff){_0xf29bff[_0x455f('0x64')]=_0x26e502;return _0xf29bff;});return db[_0x455f('0x97')][_0x455f('0x98')](_0x23a9bf,{'transaction':_0x3974e2});});}else{_0x12cfe6=0x194;_0x350b78=[];}});})[_0x455f('0x23')](function(){if(_0x12cfe6!==0x194){return db[_0x455f('0x97')][_0x455f('0x99')]({'where':{'MailAccountId':_0x26e502},'order':_0x455f('0x9a')})[_0x455f('0x23')](function(_0x54e02d){_0x350b78=_0x54e02d;});}})[_0x455f('0x2b')](function(_0x4c31db){_0x12cfe6=0x1f4;logger[_0x455f('0x28')](_0x4c31db[_0x455f('0x3d')]);if(_0x4c31db[_0x455f('0x3e')]){delete _0x4c31db[_0x455f('0x3e')];}_0x350b78=_0x4c31db;})[_0x455f('0x9b')](function(){if(_0x350b78===null){_0x28d6f8[_0x455f('0x2c')](_0x12cfe6);}else{if(_0x12cfe6===0x1f4){_0x28d6f8[_0x455f('0x2e')](_0x12cfe6)['send'](_0x350b78);}else{_0x28d6f8[_0x455f('0x2e')](_0x12cfe6)[_0x455f('0x2f')](_0x350b78);}}});};exports[_0x455f('0x9c')]=function(_0x3cd179,_0x4c855f,_0x59d178){var _0x352e84={};var _0x576ccd={};var _0x25d57a;var _0x25ba88;return db[_0x455f('0x47')]['findOne']({'where':{'id':_0x3cd179[_0x455f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4c855f,null))['then'](function(_0x792b6d){if(_0x792b6d){_0x25d57a=_0x792b6d;_0x576ccd[_0x455f('0x4d')]=_[_0x455f('0x5e')](db[_0x455f('0x97')]['rawAttributes']);_0x576ccd[_0x455f('0x4b')]=_['keys'](_0x3cd179[_0x455f('0x4b')]);_0x576ccd[_0x455f('0x55')]=_[_0x455f('0x4c')](_0x576ccd[_0x455f('0x4d')],_0x576ccd[_0x455f('0x4b')]);_0x352e84[_0x455f('0x4f')]=_[_0x455f('0x4c')](_0x576ccd['model'],qs[_0x455f('0x4e')](_0x3cd179['query']['fields']));_0x352e84[_0x455f('0x4f')]=_0x352e84[_0x455f('0x4f')][_0x455f('0x50')]?_0x352e84[_0x455f('0x4f')]:_0x576ccd[_0x455f('0x4d')];_0x352e84[_0x455f('0x52')]=qs[_0x455f('0x53')](_0x3cd179[_0x455f('0x4b')]['sort']);_0x352e84['where']=qs['filters'](_[_0x455f('0x56')](_0x3cd179[_0x455f('0x4b')],_0x576ccd[_0x455f('0x55')]));if(_0x3cd179['query'][_0x455f('0x57')]){_0x352e84[_0x455f('0x54')]=_[_0x455f('0x58')](_0x352e84['where'],{'$or':_[_0x455f('0x46')](_0x352e84[_0x455f('0x4f')],function(_0x3721da){var _0x5150d3={};_0x5150d3[_0x3721da]={'$like':'%'+_0x3cd179[_0x455f('0x4b')][_0x455f('0x57')]+'%'};return _0x5150d3;})});}_0x352e84=_[_0x455f('0x58')]({},_0x352e84,_0x3cd179[_0x455f('0x59')]);return _0x25d57a[_0x455f('0x9c')](_0x352e84);}})[_0x455f('0x23')](function(_0x1afced){if(_0x1afced){_0x25ba88=_0x1afced[_0x455f('0x50')];if(!_0x3cd179[_0x455f('0x4b')]['hasOwnProperty']('nolimit')){_0x352e84[_0x455f('0x32')]=qs[_0x455f('0x32')](_0x3cd179[_0x455f('0x4b')][_0x455f('0x32')]);_0x352e84['offset']=qs[_0x455f('0x30')](_0x3cd179[_0x455f('0x4b')][_0x455f('0x30')]);}return _0x25d57a[_0x455f('0x9c')](_0x352e84);}})[_0x455f('0x23')](function(_0x3932f7){if(_0x3932f7){return _0x3932f7?{'count':_0x25ba88,'rows':_0x3932f7}:null;}})['then'](respondWithResult(_0x4c855f,null))[_0x455f('0x2b')](handleError(_0x4c855f,null));};exports[_0x455f('0x9d')]=function(_0x415c32,_0x27efbb,_0x3a344d){var _0x1e8a9a={'raw':!![],'where':{}};var _0x26bf31={};var _0x2dc486={'count':0x0,'rows':[]};return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x415c32['params']['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x27efbb,null))['then'](function(_0x3f3da3){if(_0x3f3da3){_0x26bf31[_0x455f('0x4d')]=_[_0x455f('0x5e')](db['MailMessage'][_0x455f('0x6e')]);_0x26bf31['query']=_[_0x455f('0x5e')](_0x415c32[_0x455f('0x4b')]);_0x26bf31[_0x455f('0x55')]=_[_0x455f('0x4c')](_0x26bf31[_0x455f('0x4d')],_0x26bf31[_0x455f('0x4b')]);_0x1e8a9a['attributes']=_[_0x455f('0x4c')](_0x26bf31[_0x455f('0x4d')],qs[_0x455f('0x4e')](_0x415c32[_0x455f('0x4b')][_0x455f('0x4e')]));_0x1e8a9a[_0x455f('0x4f')]=_0x1e8a9a[_0x455f('0x4f')][_0x455f('0x50')]?_0x1e8a9a['attributes']:_0x26bf31[_0x455f('0x4d')];if(!_0x415c32['query']['hasOwnProperty'](_0x455f('0x51'))){_0x1e8a9a['limit']=qs[_0x455f('0x32')](_0x415c32['query'][_0x455f('0x32')]);_0x1e8a9a['offset']=qs[_0x455f('0x30')](_0x415c32[_0x455f('0x4b')]['offset']);}_0x1e8a9a[_0x455f('0x52')]=qs[_0x455f('0x53')](_0x415c32[_0x455f('0x4b')][_0x455f('0x53')]);_0x1e8a9a['where']=qs['filters'](_[_0x455f('0x56')](_0x415c32[_0x455f('0x4b')],_0x26bf31[_0x455f('0x55')]));_0x1e8a9a[_0x455f('0x54')][_0x455f('0x64')]=_0x3f3da3['id'];if(_0x415c32['query'][_0x455f('0x57')]){_0x1e8a9a[_0x455f('0x54')]=_[_0x455f('0x58')](_0x1e8a9a['where'],{'$or':_[_0x455f('0x46')](_0x1e8a9a[_0x455f('0x4f')],function(_0x43dd92){var _0xe427c0={};_0xe427c0[_0x43dd92]={'$like':'%'+_0x415c32[_0x455f('0x4b')][_0x455f('0x57')]+'%'};return _0xe427c0;})});}if(_0x415c32[_0x455f('0x4b')][_0x455f('0x9e')]){var _0x1031a5=_0x415c32[_0x455f('0x4b')]['$gte'][_0x455f('0x9f')](',');var _0x22bb4a={};_0x22bb4a[_0x1031a5[0x0]]={'$gte':moment(_0x1031a5[0x1])['format'](_0x455f('0xa0'))};_0x1e8a9a['where']=_['merge'](_0x1e8a9a[_0x455f('0x54')],_0x22bb4a);}_0x1e8a9a=_[_0x455f('0x58')]({},_0x1e8a9a,_0x415c32['options']);return db[_0x455f('0xa1')][_0x455f('0x33')]({'where':_0x1e8a9a[_0x455f('0x54')]})[_0x455f('0x23')](function(_0xbb8a72){_0x2dc486[_0x455f('0x33')]=_0xbb8a72;if(_0x415c32[_0x455f('0x4b')][_0x455f('0x5a')]){_0x1e8a9a[_0x455f('0x5f')]=[{'all':!![]}];}return db['MailMessage'][_0x455f('0x5b')](_0x1e8a9a);})[_0x455f('0x23')](function(_0x194b41){if(_0x415c32[_0x455f('0x4b')]['inlineCss']===_0x455f('0xa2')){for(var _0x320c3e=0x0;_0x320c3e<_0x194b41['length'];_0x320c3e++){_0x194b41[_0x320c3e]['body']=juice(_0x194b41[_0x320c3e][_0x455f('0x61')]);}}_0x2dc486[_0x455f('0x69')]=_0x194b41;return _0x2dc486;});}})[_0x455f('0x23')](respondWithFilteredResult(_0x27efbb,_0x1e8a9a))[_0x455f('0x2b')](handleError(_0x27efbb,null));};exports['send']=function(_0x2ff697,_0x1dcafb,_0x27bf85){var _0x4d3d22,_0xeecfcb={},_0x305657;if(_0x2ff697[_0x455f('0x61')]['to']){_0x305657=_0x2ff697[_0x455f('0x61')]['to'][_0x455f('0x9f')](',')[0x0];}return db['MailAccount'][_0x455f('0x60')]({'where':{'id':_0x2ff697[_0x455f('0x5d')]['id']},'include':[{'model':db[_0x455f('0xa3')],'as':_0x455f('0xa4'),'include':[{'model':db[_0x455f('0x8a')],'as':_0x455f('0xa5'),'where':{'email':_0x305657},'limit':0x1,'order':[[_0x455f('0xa6'),'DESC']]}]},{'model':db[_0x455f('0x43')],'as':_0x455f('0x75'),'raw':!![]}]})[_0x455f('0x23')](handleEntityNotFound(_0x1dcafb,null))[_0x455f('0x23')](function(_0x823d88){if(_0x823d88){_0x4d3d22=_0x823d88;if(_0x823d88[_0x455f('0x75')]){if(_[_0x455f('0x72')](_0x2ff697[_0x455f('0x61')][_0x455f('0xa7')])){_0x2ff697[_0x455f('0x61')][_0x455f('0xa7')]=util['format']('%s\x20<%s>',_0x823d88['name'],_0x823d88[_0x455f('0x70')]||_0x823d88[_0x455f('0x75')][_0x455f('0x74')]);}if(_0x2ff697[_0x455f('0x61')][_0x455f('0xa8')]&&_0x2ff697['body'][_0x455f('0xa8')][_0x455f('0x50')]){for(var _0x598990=0x0;_0x598990<_0x2ff697[_0x455f('0x61')][_0x455f('0xa8')][_0x455f('0x50')];_0x598990+=0x1){_0x2ff697[_0x455f('0x61')][_0x455f('0xa8')][_0x598990]={'filename':_0x2ff697[_0x455f('0x61')][_0x455f('0xa8')][_0x598990][_0x455f('0x3e')],'path':path[_0x455f('0xa9')](config[_0x455f('0xaa')],'server/files/attachments',_0x2ff697['body'][_0x455f('0xa8')][_0x598990][_0x455f('0xab')])};}}var _0x121deb={'tls':{'rejectUnauthorized':![]}};if(_[_0x455f('0x72')](_0x823d88[_0x455f('0x75')][_0x455f('0x7d')])){if(_0x823d88[_0x455f('0x75')][_0x455f('0x7a')]){_0x121deb[_0x455f('0xac')]={'user':_0x823d88[_0x455f('0x75')][_0x455f('0x74')],'pass':_0x823d88[_0x455f('0x75')][_0x455f('0x78')]};}_0x121deb['host']=_0x823d88[_0x455f('0x75')]['host'];_0x121deb['port']=_0x823d88['Smtp'][_0x455f('0x7c')];_0x121deb[_0x455f('0xad')]=_0x823d88[_0x455f('0x75')]['secure'];}else{_0x121deb[_0x455f('0x7d')]=_0x823d88[_0x455f('0x75')][_0x455f('0x7d')];_0x121deb[_0x455f('0xac')]={'user':_0x823d88[_0x455f('0x75')][_0x455f('0x74')],'pass':_0x823d88['Smtp'][_0x455f('0x78')]};}return respondWithRpcPromise(_0x455f('0xae'),_0x455f('0xaf'),{'account':_0x121deb,'message':_0x2ff697[_0x455f('0x61')]});}else{throw new Error(_0x455f('0xb0'));}}})[_0x455f('0x23')](function(_0x52dac6){if(_0x52dac6){_0xeecfcb=_0x52dac6;if(_0x4d3d22[_0x455f('0xa4')]){if(_0x4d3d22['List'][_0x455f('0xa5')]['length']){return _0x4d3d22[_0x455f('0xa4')][_0x455f('0xa5')][0x0];}else{return db[_0x455f('0x8a')][_0x455f('0x66')](_[_0x455f('0x1b')](_0x2ff697[_0x455f('0x61')],{'firstName':_0x2ff697['body']['to'],'email':_0x2ff697[_0x455f('0x61')]['to'],'phone':_0x2ff697[_0x455f('0x61')]['to'],'ListId':_0x4d3d22['ListId']}));}}else{throw new Error(_0x455f('0xb0'));}}})[_0x455f('0x23')](function(_0x435614){if(_0x435614){var _0x7ac1f9={'UserId':_0x2ff697[_0x455f('0x74')]['id'],'ContactId':_0x435614['id'],'MailAccountId':_0x4d3d22['id'],'inReplyTo':_0xeecfcb['messageId'],'to':_0x2ff697[_0x455f('0x61')][_0x455f('0xa7')],'cc':_0x2ff697[_0x455f('0x61')]['cc'],'subject':_0x2ff697[_0x455f('0x61')][_0x455f('0xb1')],'attach':_0x2ff697[_0x455f('0x61')]['attach'],'firstMsgDirection':_0x455f('0xb2'),'lastMsgAt':moment()[_0x455f('0xb3')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x455f('0xb2'),'Messages':[_[_0x455f('0x58')](_0x2ff697[_0x455f('0x61')],{'messageId':_0xeecfcb['messageId'],'sentAt':moment()[_0x455f('0xb3')](_0x455f('0xa0')),'read':!![],'MailAccountId':_0x4d3d22['id'],'UserId':_0x2ff697[_0x455f('0x74')]['id'],'ContactId':_0x435614['id']})]};if(_0x2ff697[_0x455f('0x61')][_0x455f('0xb4')]){_0x7ac1f9=_[_0x455f('0x58')](_0x7ac1f9,_0x2ff697['body'][_0x455f('0xb4')]);}return db['MailInteraction']['create'](_0x7ac1f9,{'include':[{'model':db[_0x455f('0xa1')],'as':_0x455f('0xb5')}]});}})[_0x455f('0x23')](respondWithResult(_0x1dcafb,null))[_0x455f('0x2b')](handleError(_0x1dcafb,null));};exports[_0x455f('0xb6')]=function(_0x27ac62,_0x41d02b,_0x215623){return db['MailAccount'][_0x455f('0x60')]({'where':{'id':_0x27ac62[_0x455f('0x5d')]['id']},'include':[{'model':db[_0x455f('0x43')],'as':'Smtp','raw':!![]}]})[_0x455f('0x23')](handleEntityNotFound(_0x41d02b,null))['then'](function(_0x38dd32){if(_0x38dd32&&_0x38dd32[_0x455f('0x75')]){var _0x55cc06={'id':_0x38dd32['id'],'tls':{'rejectUnauthorized':![]}};if(_0x38dd32[_0x455f('0x75')]['service']){_0x55cc06['service']=_0x38dd32[_0x455f('0x75')]['service'];}else{_0x55cc06[_0x455f('0x7b')]=_0x38dd32['Smtp'][_0x455f('0x7b')];_0x55cc06[_0x455f('0x7c')]=_0x38dd32[_0x455f('0x75')][_0x455f('0x7c')];_0x55cc06['secure']=_0x38dd32[_0x455f('0x75')][_0x455f('0xad')];}if(_0x38dd32['Smtp'][_0x455f('0x7a')]){_0x55cc06[_0x455f('0xac')]={'user':_0x38dd32['Smtp']['user'],'pass':_0x38dd32['Smtp']['pass']};}return respondWithRpcPromise(_0x455f('0xb7'),_0x455f('0xb6'),{'account':_0x55cc06});}})[_0x455f('0x23')](respondWithResult(_0x41d02b,null))[_0x455f('0x2b')](handleError(_0x41d02b,null));};exports['destroy']=function(_0x2e8234,_0x515c08){return db[_0x455f('0x47')]['find']({'where':{'id':_0x2e8234[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x515c08,null))[_0x455f('0x23')](function(_0x20695f){if(_0x20695f&&_0x20695f[_0x455f('0x7d')]){throw new db[(_0x455f('0xb8'))][(_0x455f('0xb9'))](_0x455f('0xba'));}return _0x20695f;})[_0x455f('0x23')](removeEntity(_0x515c08,null))['catch'](handleError(_0x515c08,null));};exports[_0x455f('0xbb')]=function(_0xdcbb25,_0x4ea8b6,_0x580e0a){return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0xdcbb25[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x4ea8b6,null))[_0x455f('0x23')](function(_0x496052){if(_0x496052){return _0x496052[_0x455f('0xbb')](_0xdcbb25[_0x455f('0x61')][_0x455f('0x6b')],_[_0x455f('0xbc')](_0xdcbb25[_0x455f('0x61')],['ids','id'])||{})['spread'](function(_0x5c0483){for(var _0x371ea2=0x0;_0x371ea2<_0xdcbb25[_0x455f('0x61')][_0x455f('0x6b')][_0x455f('0x50')];_0x371ea2+=0x1){socket[_0x455f('0xbd')](_0x455f('0xbe'),{'UserId':Number(_0xdcbb25[_0x455f('0x61')][_0x455f('0x6b')][_0x371ea2]),'MailAccountId':Number(_0xdcbb25[_0x455f('0x5d')]['id'])});}return _0x5c0483;});}})[_0x455f('0x23')](respondWithResult(_0x4ea8b6,null))[_0x455f('0x2b')](handleError(_0x4ea8b6,null));};exports[_0x455f('0xbf')]=function(_0x195cea,_0xc8ea33,_0x3cb625){return db[_0x455f('0x47')][_0x455f('0x60')]({'where':{'id':_0x195cea['params']['id']}})[_0x455f('0x23')](handleEntityNotFound(_0xc8ea33,null))[_0x455f('0x23')](function(_0x2d2aad){if(_0x2d2aad){return _0x2d2aad[_0x455f('0xbf')](_0x195cea['query'][_0x455f('0x6b')])['then'](function(){if(_[_0x455f('0xc0')](_0x195cea[_0x455f('0x4b')][_0x455f('0x6b')])){for(var _0x593462=0x0;_0x593462<_0x195cea[_0x455f('0x4b')]['ids'][_0x455f('0x50')];_0x593462+=0x1){socket[_0x455f('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x195cea['query'][_0x455f('0x6b')][_0x593462]),'MailAccountId':Number(_0x195cea['params']['id'])});}}else{socket[_0x455f('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x195cea[_0x455f('0x4b')][_0x455f('0x6b')]),'MailAccountId':Number(_0x195cea['params']['id'])});}});}})[_0x455f('0x23')](respondWithStatusCode(_0xc8ea33,null))[_0x455f('0x2b')](handleError(_0xc8ea33,null));};exports[_0x455f('0xc1')]=function(_0x31f161,_0x52c192,_0xf0e6c6){var _0x40717b={};var _0x50d233={};var _0xc01365;var _0x570cef;return db[_0x455f('0x47')][_0x455f('0x82')]({'where':{'id':_0x31f161[_0x455f('0x5d')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x52c192,null))[_0x455f('0x23')](function(_0x48cfd2){if(_0x48cfd2){_0xc01365=_0x48cfd2;_0x50d233['model']=_[_0x455f('0x5e')](db['User'][_0x455f('0x6e')]);_0x50d233[_0x455f('0x4b')]=_[_0x455f('0x5e')](_0x31f161[_0x455f('0x4b')]);_0x50d233[_0x455f('0x55')]=_[_0x455f('0x4c')](_0x50d233[_0x455f('0x4d')],_0x50d233[_0x455f('0x4b')]);_0x40717b['attributes']=_[_0x455f('0x4c')](_0x50d233['model'],qs[_0x455f('0x4e')](_0x31f161['query'][_0x455f('0x4e')]));_0x40717b[_0x455f('0x4f')]=_0x40717b[_0x455f('0x4f')][_0x455f('0x50')]?_0x40717b[_0x455f('0x4f')]:_0x50d233[_0x455f('0x4d')];_0x40717b[_0x455f('0x52')]=qs[_0x455f('0x53')](_0x31f161[_0x455f('0x4b')][_0x455f('0x53')]);_0x40717b[_0x455f('0x54')]=qs[_0x455f('0x55')](_['pick'](_0x31f161[_0x455f('0x4b')],_0x50d233[_0x455f('0x55')]));if(_0x31f161[_0x455f('0x4b')][_0x455f('0x57')]){_0x40717b[_0x455f('0x54')]=_[_0x455f('0x58')](_0x40717b[_0x455f('0x54')],{'$or':_['map'](_0x40717b[_0x455f('0x4f')],function(_0x3d58d9){var _0x2ab316={};_0x2ab316[_0x3d58d9]={'$like':'%'+_0x31f161['query'][_0x455f('0x57')]+'%'};return _0x2ab316;})});}_0x40717b=_[_0x455f('0x58')]({},_0x40717b,_0x31f161[_0x455f('0x59')]);return _0xc01365[_0x455f('0xc1')](_0x40717b);}})['then'](function(_0x42a583){if(_0x42a583){_0x570cef=_0x42a583[_0x455f('0x50')];if(!_0x31f161[_0x455f('0x4b')][_0x455f('0x68')]('nolimit')){_0x40717b['limit']=qs[_0x455f('0x32')](_0x31f161[_0x455f('0x4b')][_0x455f('0x32')]);_0x40717b['offset']=qs[_0x455f('0x30')](_0x31f161[_0x455f('0x4b')][_0x455f('0x30')]);}return _0xc01365[_0x455f('0xc1')](_0x40717b);}})[_0x455f('0x23')](function(_0x45c747){if(_0x45c747){return _0x45c747?{'count':_0x570cef,'rows':_0x45c747}:null;}})[_0x455f('0x23')](respondWithResult(_0x52c192,null))[_0x455f('0x2b')](handleError(_0x52c192,null));}; \ No newline at end of file +var _0x586b=['Contacts','updatedAt','DESC','from','format','email','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','MailAccounts','end','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','mandatoryDispositionPause','includeAll','update','body','MailServerIn','describe','addDisposition','find','MailAccountId','create','getDispositions','findOne','params','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','options','removeAnswers','ListId','isNil','active','description','cservice','user','cuser','password','pass','authentication','host','port','service','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','true','split','CmList','CmContact'];(function(_0x44029c,_0x426690){var _0x547fa1=function(_0x37b1f9){while(--_0x37b1f9){_0x44029c['push'](_0x44029c['shift']());}};_0x547fa1(++_0x426690);}(_0x586b,0x1bb));var _0xb586=function(_0x1b5ddf,_0xeafbf9){_0x1b5ddf=_0x1b5ddf-0x0;var _0x391bc4=_0x586b[_0x1b5ddf];return _0x391bc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb586('0x0'));var jsonpatch=require(_0xb586('0x1'));var rp=require(_0xb586('0x2'));var moment=require(_0xb586('0x3'));var BPromise=require(_0xb586('0x4'));var Mustache=require(_0xb586('0x5'));var util=require(_0xb586('0x6'));var path=require(_0xb586('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb586('0x8'));var fs=require('fs');var fs_extra=require(_0xb586('0x9'));var _=require(_0xb586('0xa'));var squel=require(_0xb586('0xb'));var crypto=require(_0xb586('0xc'));var jsforce=require(_0xb586('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb586('0xe'));var querystring=require(_0xb586('0xf'));var Papa=require(_0xb586('0x10'));var htmlToText=require(_0xb586('0x11'));var juice=require(_0xb586('0x12'));var Redis=require(_0xb586('0x13'));var authService=require(_0xb586('0x14'));var qs=require(_0xb586('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb586('0x16'));var logger=require('../../config/logger')(_0xb586('0x17'));var utils=require(_0xb586('0x18'));var config=require(_0xb586('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb586('0x1a'))['db'];config[_0xb586('0x1b')]=_[_0xb586('0x1c')](config[_0xb586('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xb586('0x1d'))(new Redis(config['redis']));require(_0xb586('0x1e'))[_0xb586('0x1f')](socket);var jayson=require(_0xb586('0x20'));var client=jayson[_0xb586('0x21')][_0xb586('0x22')]({'port':0x232b});function respondWithRpcPromise(_0xb6dd9,_0x147ef3,_0x3e56a8,_0x16d897){return new BPromise(function(_0x1fad76,_0x4c85d0){var _0x2ae787=_0x16d897||client;return _0x2ae787[_0xb586('0x23')](_0xb6dd9,_0x3e56a8)['then'](function(_0x240a0b){logger[_0xb586('0x24')](_0xb586('0x25'),_0x147ef3,_0xb586('0x26'));logger[_0xb586('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x147ef3,_0xb586('0x26'),JSON[_0xb586('0x28')](_0x240a0b));if(_0x240a0b['error']){if(_0x240a0b[_0xb586('0x29')]['code']===0x1f4){logger[_0xb586('0x29')](_0xb586('0x25'),_0x147ef3,_0x240a0b[_0xb586('0x29')][_0xb586('0x2a')]);return _0x4c85d0(_0x240a0b[_0xb586('0x29')][_0xb586('0x2a')]);}logger[_0xb586('0x29')](_0xb586('0x25'),_0x147ef3,_0x240a0b[_0xb586('0x29')][_0xb586('0x2a')]);return _0x1fad76(_0x240a0b[_0xb586('0x29')]['message']);}else{logger[_0xb586('0x24')](_0xb586('0x25'),_0x147ef3,_0xb586('0x26'));_0x1fad76(_0x240a0b[_0xb586('0x2b')][_0xb586('0x2a')]);}})[_0xb586('0x2c')](function(_0x361c29){logger[_0xb586('0x29')](_0xb586('0x25'),_0x147ef3,_0x361c29);_0x4c85d0(_0x361c29);});});}function respondWithStatusCode(_0x4b7aad,_0x147f8b){_0x147f8b=_0x147f8b||0xcc;return function(_0x3f1a03){if(_0x3f1a03){return _0x4b7aad[_0xb586('0x2d')](_0x147f8b);}return _0x4b7aad['status'](_0x147f8b)['end']();};}function respondWithResult(_0x5e575f,_0x33bb8e){_0x33bb8e=_0x33bb8e||0xc8;return function(_0x37bc70){if(_0x37bc70){return _0x5e575f[_0xb586('0x2e')](_0x33bb8e)[_0xb586('0x2f')](_0x37bc70);}};}function respondWithFilteredResult(_0x4b1597,_0x58ae61){return function(_0x3510e1){if(_0x3510e1){var _0x22ee1d=typeof _0x58ae61[_0xb586('0x30')]===_0xb586('0x31')&&typeof _0x58ae61['limit']==='undefined';var _0x3b6437=_0x3510e1[_0xb586('0x32')];var _0x1bc5e7=_0x22ee1d?0x0:_0x58ae61[_0xb586('0x30')];var _0x3b32ec=_0x22ee1d?_0x3510e1[_0xb586('0x32')]:_0x58ae61[_0xb586('0x30')]+_0x58ae61['limit'];var _0x4a36c8;if(_0x3b32ec>=_0x3b6437){_0x3b32ec=_0x3b6437;_0x4a36c8=0xc8;}else{_0x4a36c8=0xce;}_0x4b1597[_0xb586('0x2e')](_0x4a36c8);return _0x4b1597['set'](_0xb586('0x33'),_0x1bc5e7+'-'+_0x3b32ec+'/'+_0x3b6437)['json'](_0x3510e1);}return null;};}function patchUpdates(_0x2e9955){return function(_0xd7395b){try{jsonpatch[_0xb586('0x34')](_0xd7395b,_0x2e9955,!![]);}catch(_0x30a384){return BPromise[_0xb586('0x35')](_0x30a384);}return _0xd7395b[_0xb586('0x36')]();};}function saveUpdates(_0x45d74a,_0x33caf3){return function(_0x4ca097){if(_0x4ca097){return _0x4ca097['update'](_0x45d74a)[_0xb586('0x37')](function(_0x3fd54e){return _0x3fd54e;});}return null;};}function removeEntity(_0x9614c5,_0x39164a){return function(_0x1936ce){if(_0x1936ce){return _0x1936ce[_0xb586('0x38')]()[_0xb586('0x37')](function(){var _0x2793a4=_0x1936ce['get']({'plain':!![]});var _0x3fc1b8=_0xb586('0x39');return db['UserProfileResource'][_0xb586('0x38')]({'where':{'type':_0x3fc1b8,'resourceId':_0x2793a4['id']}})[_0xb586('0x37')](function(){return _0x1936ce;});})[_0xb586('0x37')](function(){_0x9614c5['status'](0xcc)[_0xb586('0x3a')]();});}};}function handleEntityNotFound(_0x25e754,_0x5dce20){return function(_0xaf85a){if(!_0xaf85a){_0x25e754['sendStatus'](0x194);}return _0xaf85a;};}function handleError(_0x5b7c97,_0xf44649){_0xf44649=_0xf44649||0x1f4;return function(_0x12301d){logger[_0xb586('0x29')](_0x12301d[_0xb586('0x3b')]);if(_0x12301d[_0xb586('0x3c')]){delete _0x12301d[_0xb586('0x3c')];}_0x5b7c97['status'](_0xf44649)[_0xb586('0x3d')](_0x12301d);};}exports[_0xb586('0x3e')]=function(_0x5b0686,_0xa23570){var _0x39a885={'include':[{'model':db['MailServerIn'],'as':_0xb586('0x3f')},{'model':db[_0xb586('0x40')],'as':_0xb586('0x41')},{'model':db[_0xb586('0x42')],'as':'mandatoryDispositionPause'}]},_0x781812={},_0x1cc24c={'count':0x0,'rows':[]};var _0x9f6bf9=_[_0xb586('0x43')](db[_0xb586('0x44')][_0xb586('0x45')],function(_0x309d22){return{'name':_0x309d22[_0xb586('0x46')],'type':_0x309d22[_0xb586('0x47')][_0xb586('0x48')]};});_0x781812[_0xb586('0x49')]=_[_0xb586('0x43')](_0x9f6bf9,_0xb586('0x3c'));_0x781812[_0xb586('0x4a')]=_[_0xb586('0x4b')](_0x5b0686[_0xb586('0x4a')]);_0x781812['filters']=_[_0xb586('0x4c')](_0x781812[_0xb586('0x49')],_0x781812[_0xb586('0x4a')]);_0x39a885[_0xb586('0x4d')]=_['intersection'](_0x781812[_0xb586('0x49')],qs[_0xb586('0x4e')](_0x5b0686[_0xb586('0x4a')][_0xb586('0x4e')]));_0x39a885[_0xb586('0x4d')]=_0x39a885[_0xb586('0x4d')][_0xb586('0x4f')]?_0x39a885['attributes']:_0x781812[_0xb586('0x49')];if(!_0x5b0686[_0xb586('0x4a')]['hasOwnProperty'](_0xb586('0x50'))){_0x39a885[_0xb586('0x51')]=qs[_0xb586('0x51')](_0x5b0686['query'][_0xb586('0x51')]);_0x39a885['offset']=qs[_0xb586('0x30')](_0x5b0686['query'][_0xb586('0x30')]);}_0x39a885['order']=qs[_0xb586('0x52')](_0x5b0686[_0xb586('0x4a')][_0xb586('0x52')]);_0x39a885['where']=qs[_0xb586('0x53')](_[_0xb586('0x54')](_0x5b0686[_0xb586('0x4a')],_0x781812[_0xb586('0x53')]),_0x9f6bf9);if(_0x5b0686['query'][_0xb586('0x55')]){_0x39a885[_0xb586('0x56')]=_[_0xb586('0x57')](_0x39a885[_0xb586('0x56')],{'$or':_[_0xb586('0x43')](_0x9f6bf9,function(_0x30122e){if(_0x30122e[_0xb586('0x47')]!==_0xb586('0x58')){var _0x92c920={};_0x92c920[_0x30122e['name']]={'$like':'%'+_0x5b0686[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0x92c920;}})});}_0x39a885=_[_0xb586('0x57')]({},_0x39a885,_0x5b0686['options']);var _0x3fcb22={'where':_0x39a885[_0xb586('0x56')]};return db['MailAccount'][_0xb586('0x32')](_0x3fcb22)['then'](function(_0x210127){_0x1cc24c[_0xb586('0x32')]=_0x210127;if(_0x5b0686['query']['includeAll']){_0x39a885[_0xb586('0x59')]=[{'all':!![]}];}return db[_0xb586('0x44')][_0xb586('0x5a')](_0x39a885);})[_0xb586('0x37')](function(_0x3679ea){_0x1cc24c[_0xb586('0x5b')]=_0x3679ea;return _0x1cc24c;})[_0xb586('0x37')](respondWithFilteredResult(_0xa23570,_0x39a885))[_0xb586('0x2c')](handleError(_0xa23570,null));};exports[_0xb586('0x5c')]=function(_0x51a915,_0x6ed528){var _0x303070={'raw':![],'where':{'id':_0x51a915['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xb586('0x3f')},{'model':db['MailServerOut'],'as':_0xb586('0x41')},{'model':db[_0xb586('0x42')],'as':_0xb586('0x5d')}]},_0x20db8a={};_0x20db8a[_0xb586('0x49')]=_[_0xb586('0x4b')](db[_0xb586('0x44')][_0xb586('0x45')]);_0x20db8a[_0xb586('0x4a')]=_[_0xb586('0x4b')](_0x51a915['query']);_0x20db8a[_0xb586('0x53')]=_['intersection'](_0x20db8a[_0xb586('0x49')],_0x20db8a[_0xb586('0x4a')]);_0x303070[_0xb586('0x4d')]=_['intersection'](_0x20db8a[_0xb586('0x49')],qs[_0xb586('0x4e')](_0x51a915[_0xb586('0x4a')][_0xb586('0x4e')]));_0x303070[_0xb586('0x4d')]=_0x303070[_0xb586('0x4d')][_0xb586('0x4f')]?_0x303070[_0xb586('0x4d')]:_0x20db8a[_0xb586('0x49')];if(_0x51a915['query'][_0xb586('0x5e')]){_0x303070[_0xb586('0x59')]=[{'all':!![]}];}_0x303070=_[_0xb586('0x57')]({},_0x303070,_0x51a915['options']);return db['MailAccount']['find'](_0x303070)[_0xb586('0x37')](handleEntityNotFound(_0x6ed528,null))[_0xb586('0x37')](respondWithResult(_0x6ed528,null))[_0xb586('0x2c')](handleError(_0x6ed528,null));};exports[_0xb586('0x5f')]=function(_0x3d8e17,_0x58631f){if(_0x3d8e17[_0xb586('0x60')]['id']){delete _0x3d8e17[_0xb586('0x60')]['id'];}return db[_0xb586('0x44')]['find']({'where':{'id':_0x3d8e17['params']['id']},'include':[{'model':db[_0xb586('0x61')],'as':_0xb586('0x3f')},{'model':db[_0xb586('0x40')],'as':_0xb586('0x41')},{'model':db[_0xb586('0x42')],'as':'mandatoryDispositionPause'}]})[_0xb586('0x37')](handleEntityNotFound(_0x58631f,null))[_0xb586('0x37')](saveUpdates(_0x3d8e17[_0xb586('0x60')],null))[_0xb586('0x37')](function(_0x5b32cc){if(_0x5b32cc&&_0x3d8e17['body'][_0xb586('0x3f')]){return db[_0xb586('0x61')][_0xb586('0x5f')](_0x3d8e17[_0xb586('0x60')]['Imap'],{'where':{'MailAccountId':_0x5b32cc['id']}})[_0xb586('0x37')](function(){return _0x5b32cc;});}return _0x5b32cc;})[_0xb586('0x37')](function(_0x3da737){if(_0x3da737&&_0x3d8e17[_0xb586('0x60')][_0xb586('0x41')]){return db['MailServerOut']['update'](_0x3d8e17[_0xb586('0x60')][_0xb586('0x41')],{'where':{'MailAccountId':_0x3da737['id']}})[_0xb586('0x37')](function(){return _0x3da737;});}return _0x3da737;})[_0xb586('0x37')](respondWithResult(_0x58631f,null))[_0xb586('0x2c')](handleError(_0x58631f,null));};exports['describe']=function(_0x109f4a,_0x386cdc){return db[_0xb586('0x44')][_0xb586('0x62')]()['then'](respondWithResult(_0x386cdc,null))[_0xb586('0x2c')](handleError(_0x386cdc,null));};exports[_0xb586('0x63')]=function(_0x49ec27,_0x395d63,_0x1ffb72){if(_0x49ec27['body']['id']){delete _0x49ec27[_0xb586('0x60')]['id'];}return db['MailAccount'][_0xb586('0x64')]({'where':{'id':_0x49ec27['params']['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x395d63,null))['then'](function(_0x30e85f){if(_0x30e85f){_0x49ec27['body'][_0xb586('0x65')]=_0x30e85f['id'];return db['Disposition'][_0xb586('0x66')](_0x49ec27['body']);}})[_0xb586('0x37')](respondWithResult(_0x395d63,null))[_0xb586('0x2c')](handleError(_0x395d63,null));};exports[_0xb586('0x67')]=function(_0x36a577,_0x1c96b3,_0x43b854){var _0x34015e={'raw':![],'where':{}};var _0x673588={};var _0x260de3={'count':0x0,'rows':[]};return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x36a577[_0xb586('0x69')]['id']}})['then'](handleEntityNotFound(_0x1c96b3,null))['then'](function(_0x3b1695){if(_0x3b1695){_0x673588[_0xb586('0x49')]=_[_0xb586('0x4b')](db[_0xb586('0x6a')][_0xb586('0x45')]);_0x673588[_0xb586('0x4a')]=_[_0xb586('0x4b')](_0x36a577[_0xb586('0x4a')]);_0x673588[_0xb586('0x53')]=_['intersection'](_0x673588['model'],_0x673588[_0xb586('0x4a')]);_0x34015e['attributes']=_['intersection'](_0x673588[_0xb586('0x49')],qs[_0xb586('0x4e')](_0x36a577[_0xb586('0x4a')][_0xb586('0x4e')]));_0x34015e[_0xb586('0x4d')]=_0x34015e['attributes'][_0xb586('0x4f')]?_0x34015e[_0xb586('0x4d')]:_0x673588['model'];if(!_0x36a577['query']['hasOwnProperty'](_0xb586('0x50'))){_0x34015e[_0xb586('0x51')]=qs[_0xb586('0x51')](_0x36a577[_0xb586('0x4a')]['limit']);_0x34015e['offset']=qs[_0xb586('0x30')](_0x36a577[_0xb586('0x4a')]['offset']);}_0x34015e[_0xb586('0x6b')]=qs[_0xb586('0x52')](_0x36a577[_0xb586('0x4a')]['sort']);_0x34015e[_0xb586('0x56')]=qs[_0xb586('0x53')](_[_0xb586('0x54')](_0x36a577['query'],_0x673588[_0xb586('0x53')]));_0x34015e['where'][_0xb586('0x65')]=_0x3b1695['id'];if(_0x36a577['query']['filter']){_0x34015e[_0xb586('0x56')]=_[_0xb586('0x57')](_0x34015e['where'],{'$or':_[_0xb586('0x43')](_0x34015e[_0xb586('0x4d')],function(_0x59f964){var _0x382e71={};_0x382e71[_0x59f964]={'$like':'%'+_0x36a577[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0x382e71;})});}_0x34015e=_['merge']({},_0x34015e,_0x36a577['options']);return db[_0xb586('0x6a')]['count']({'where':_0x34015e[_0xb586('0x56')]})['then'](function(_0x29f36c){_0x260de3[_0xb586('0x32')]=_0x29f36c;if(_0x36a577['query'][_0xb586('0x5e')]){_0x34015e[_0xb586('0x59')]=[{'all':!![]}];}return db[_0xb586('0x6a')][_0xb586('0x5a')](_0x34015e);})[_0xb586('0x37')](function(_0x17b6fa){_0x260de3[_0xb586('0x5b')]=_0x17b6fa;return _0x260de3;});}})[_0xb586('0x37')](respondWithFilteredResult(_0x1c96b3,_0x34015e))[_0xb586('0x2c')](handleError(_0x1c96b3,null));};exports[_0xb586('0x6c')]=function(_0x4f4ae4,_0x14abd1,_0x1999e7){return db['MailAccount'][_0xb586('0x64')]({'where':{'id':_0x4f4ae4[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x14abd1,null))[_0xb586('0x37')](function(_0x225f28){if(_0x225f28){return _0x225f28['removeDispositions'](_0x4f4ae4['query'][_0xb586('0x6d')]);}})[_0xb586('0x37')](respondWithStatusCode(_0x14abd1,null))[_0xb586('0x2c')](handleError(_0x14abd1,null));};exports[_0xb586('0x6e')]=function(_0x3711b6,_0x43be2e,_0x23cf0d){if(_0x3711b6[_0xb586('0x60')]['id']){delete _0x3711b6[_0xb586('0x60')]['id'];}return db[_0xb586('0x44')][_0xb586('0x64')]({'where':{'id':_0x3711b6[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x43be2e,null))[_0xb586('0x37')](function(_0x42c758){if(_0x42c758){_0x3711b6['body'][_0xb586('0x65')]=_0x42c758['id'];return db[_0xb586('0x6f')]['create'](_0x3711b6[_0xb586('0x60')]);}})[_0xb586('0x37')](respondWithResult(_0x43be2e,null))[_0xb586('0x2c')](handleError(_0x43be2e,null));};exports['getAnswers']=function(_0x218266,_0x35effe,_0x4007e5){var _0x18e101={'raw':![],'where':{}};var _0x579cd6={};var _0x560861={'count':0x0,'rows':[]};return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x218266[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x35effe,null))[_0xb586('0x37')](function(_0x3105ae){if(_0x3105ae){_0x579cd6[_0xb586('0x49')]=_[_0xb586('0x4b')](db['CannedAnswer'][_0xb586('0x45')]);_0x579cd6['query']=_['keys'](_0x218266[_0xb586('0x4a')]);_0x579cd6[_0xb586('0x53')]=_[_0xb586('0x4c')](_0x579cd6[_0xb586('0x49')],_0x579cd6['query']);_0x18e101[_0xb586('0x4d')]=_[_0xb586('0x4c')](_0x579cd6[_0xb586('0x49')],qs[_0xb586('0x4e')](_0x218266[_0xb586('0x4a')][_0xb586('0x4e')]));_0x18e101[_0xb586('0x4d')]=_0x18e101[_0xb586('0x4d')]['length']?_0x18e101[_0xb586('0x4d')]:_0x579cd6['model'];if(!_0x218266[_0xb586('0x4a')][_0xb586('0x70')]('nolimit')){_0x18e101[_0xb586('0x51')]=qs[_0xb586('0x51')](_0x218266[_0xb586('0x4a')][_0xb586('0x51')]);_0x18e101['offset']=qs[_0xb586('0x30')](_0x218266[_0xb586('0x4a')][_0xb586('0x30')]);}_0x18e101[_0xb586('0x6b')]=qs[_0xb586('0x52')](_0x218266[_0xb586('0x4a')]['sort']);_0x18e101['where']=qs[_0xb586('0x53')](_[_0xb586('0x54')](_0x218266['query'],_0x579cd6['filters']));_0x18e101[_0xb586('0x56')][_0xb586('0x65')]=_0x3105ae['id'];if(_0x218266[_0xb586('0x4a')]['filter']){_0x18e101['where']=_[_0xb586('0x57')](_0x18e101[_0xb586('0x56')],{'$or':_[_0xb586('0x43')](_0x18e101[_0xb586('0x4d')],function(_0x227b4d){var _0x2ad093={};_0x2ad093[_0x227b4d]={'$like':'%'+_0x218266[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0x2ad093;})});}_0x18e101=_[_0xb586('0x57')]({},_0x18e101,_0x218266[_0xb586('0x71')]);return db[_0xb586('0x6f')][_0xb586('0x32')]({'where':_0x18e101['where']})[_0xb586('0x37')](function(_0x4334e5){_0x560861[_0xb586('0x32')]=_0x4334e5;if(_0x218266[_0xb586('0x4a')][_0xb586('0x5e')]){_0x18e101['include']=[{'all':!![]}];}return db[_0xb586('0x6f')]['findAll'](_0x18e101);})['then'](function(_0x3b339){_0x560861[_0xb586('0x5b')]=_0x3b339;return _0x560861;});}})['then'](respondWithFilteredResult(_0x35effe,_0x18e101))['catch'](handleError(_0x35effe,null));};exports[_0xb586('0x72')]=function(_0x37a5fb,_0x32f899,_0x335097){return db[_0xb586('0x44')][_0xb586('0x64')]({'where':{'id':_0x37a5fb[_0xb586('0x69')]['id']}})['then'](handleEntityNotFound(_0x32f899,null))[_0xb586('0x37')](function(_0x5ccff5){if(_0x5ccff5){return _0x5ccff5['removeAnswers'](_0x37a5fb[_0xb586('0x4a')][_0xb586('0x6d')]);}})[_0xb586('0x37')](respondWithStatusCode(_0x32f899,null))[_0xb586('0x2c')](handleError(_0x32f899,null));};exports[_0xb586('0x66')]=function(_0x581799,_0x2cfcd1){var _0x21aae1={'name':_0x581799[_0xb586('0x60')]['name'],'key':_0x581799[_0xb586('0x60')][_0xb586('0x48')],'email':_0x581799['body']['email'],'ListId':_0x581799[_0xb586('0x60')][_0xb586('0x73')],'active':!_[_0xb586('0x74')](_0x581799[_0xb586('0x60')][_0xb586('0x75')])?_0x581799['body'][_0xb586('0x75')]:!![],'description':_0x581799[_0xb586('0x60')][_0xb586('0x76')]||null,'Imap':{},'Smtp':{}};if(_[_0xb586('0x74')](_0x581799[_0xb586('0x60')][_0xb586('0x77')])){if(_0x581799['body']['cauthentication']){_0x21aae1['Imap']['user']=_0x21aae1['Smtp'][_0xb586('0x78')]=_0x581799[_0xb586('0x60')][_0xb586('0x79')];_0x21aae1['Imap'][_0xb586('0x7a')]=_0x21aae1[_0xb586('0x41')][_0xb586('0x7b')]=_0x581799[_0xb586('0x60')]['cpassword'];}else{_0x21aae1['Imap'][_0xb586('0x7c')]=_0x21aae1[_0xb586('0x41')][_0xb586('0x7c')]=![];}_0x21aae1[_0xb586('0x3f')][_0xb586('0x7d')]=_0x581799[_0xb586('0x60')]['Imap'][_0xb586('0x7d')];_0x21aae1['Imap'][_0xb586('0x7e')]=_0x581799[_0xb586('0x60')][_0xb586('0x3f')][_0xb586('0x7e')];_0x21aae1['Smtp'][_0xb586('0x7d')]=_0x581799[_0xb586('0x60')][_0xb586('0x41')][_0xb586('0x7d')];_0x21aae1[_0xb586('0x41')]['port']=_0x581799[_0xb586('0x60')][_0xb586('0x41')][_0xb586('0x7e')];}else{_0x21aae1['Imap'][_0xb586('0x7f')]=_0x21aae1[_0xb586('0x41')][_0xb586('0x7f')]=_0x581799[_0xb586('0x60')][_0xb586('0x77')];_0x21aae1[_0xb586('0x3f')]['user']=_0x21aae1[_0xb586('0x41')][_0xb586('0x78')]=_0x581799['body'][_0xb586('0x79')];_0x21aae1[_0xb586('0x3f')][_0xb586('0x7a')]=_0x21aae1['Smtp'][_0xb586('0x7b')]=_0x581799['body'][_0xb586('0x80')];}return db[_0xb586('0x44')][_0xb586('0x66')](_0x21aae1,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xb586('0x61')],'as':'Imap'}]})[_0xb586('0x37')](function(_0x60d5a4){var _0x3dc073=_0x581799[_0xb586('0x78')][_0xb586('0x81')]({'plain':!![]});if(!_0x3dc073)throw new Error(_0xb586('0x82'));if(_0x3dc073[_0xb586('0x83')]==='user'){var _0x4c67c2=_0x60d5a4['get']({'plain':!![]});return db[_0xb586('0x84')]['find']({'where':{'name':_0xb586('0x39'),'userProfileId':_0x3dc073[_0xb586('0x85')]},'raw':!![]})[_0xb586('0x37')](function(_0x55442c){if(_0x55442c&&_0x55442c[_0xb586('0x86')]===0x0){return db['UserProfileResource'][_0xb586('0x66')]({'name':_0x4c67c2['name'],'resourceId':_0x4c67c2['id'],'type':_0x55442c[_0xb586('0x3c')],'sectionId':_0x55442c['id']},{})[_0xb586('0x37')](function(){return _0x60d5a4;});}else{return _0x60d5a4;}})[_0xb586('0x2c')](function(_0x380d9f){logger['error'](_0xb586('0x87'),_0x380d9f);throw _0x380d9f;});}return _0x60d5a4;})[_0xb586('0x37')](respondWithResult(_0x2cfcd1,0xc9))['catch'](handleError(_0x2cfcd1,null));};exports[_0xb586('0x88')]=function(_0x13c73b,_0x148c99,_0x22e0b3){return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x13c73b[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x148c99,null))[_0xb586('0x37')](function(_0x3a4002){if(_0x3a4002){return _0x3a4002[_0xb586('0x88')]();}return null;})[_0xb586('0x37')](respondWithResult(_0x148c99,null))['catch'](handleError(_0x148c99,null));};exports[_0xb586('0x89')]=function(_0x6858a3,_0x7f6b87,_0x48f09c){if(_0x6858a3[_0xb586('0x60')]['id']){delete _0x6858a3['body']['id'];}return db[_0xb586('0x44')][_0xb586('0x64')]({'where':{'id':_0x6858a3[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x7f6b87,null))[_0xb586('0x37')](function(_0x25448e){if(_0x25448e){_0x6858a3['body']['MailAccountId']=_0x25448e['id'];return db['MailServerIn']['create'](_0x6858a3[_0xb586('0x60')]);}})[_0xb586('0x37')](respondWithResult(_0x7f6b87,null))[_0xb586('0x2c')](handleError(_0x7f6b87,null));};exports[_0xb586('0x8a')]=function(_0xe7c6b,_0x3bbd40,_0xf4766e){return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0xe7c6b[_0xb586('0x69')]['id']}})['then'](handleEntityNotFound(_0x3bbd40,null))[_0xb586('0x37')](function(_0x5f0ba2){if(_0x5f0ba2){return _0x5f0ba2[_0xb586('0x8b')](null);}return null;})[_0xb586('0x37')](respondWithStatusCode(_0x3bbd40,null))['catch'](handleError(_0x3bbd40,null));};exports[_0xb586('0x8c')]=function(_0x4b6649,_0x3468e3,_0xa4f36){return db['MailAccount'][_0xb586('0x68')]({'where':{'id':_0x4b6649['params']['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x3468e3,null))[_0xb586('0x37')](function(_0x598621){if(_0x598621){return _0x598621[_0xb586('0x8c')]();}return null;})[_0xb586('0x37')](respondWithResult(_0x3468e3,null))[_0xb586('0x2c')](handleError(_0x3468e3,null));};exports[_0xb586('0x8d')]=function(_0x5bdc04,_0x1a05ba,_0x35ffa0){if(_0x5bdc04['body']['id']){delete _0x5bdc04['body']['id'];}return db[_0xb586('0x44')][_0xb586('0x64')]({'where':{'id':_0x5bdc04[_0xb586('0x69')]['id']}})['then'](handleEntityNotFound(_0x1a05ba,null))[_0xb586('0x37')](function(_0x55fe7a){if(_0x55fe7a){_0x5bdc04[_0xb586('0x60')][_0xb586('0x65')]=_0x55fe7a['id'];return db[_0xb586('0x40')][_0xb586('0x66')](_0x5bdc04[_0xb586('0x60')]);}})['then'](respondWithResult(_0x1a05ba,null))[_0xb586('0x2c')](handleError(_0x1a05ba,null));};exports[_0xb586('0x8e')]=function(_0x4b02c1,_0x244801,_0x509e51){return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x4b02c1['params']['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x244801,null))[_0xb586('0x37')](function(_0x2e933b){if(_0x2e933b){return _0x2e933b[_0xb586('0x8f')](null);}return null;})[_0xb586('0x37')](respondWithStatusCode(_0x244801,null))['catch'](handleError(_0x244801,null));};exports[_0xb586('0x90')]=function(_0x1ff4c3,_0x2237b8,_0x4e36b4){return db[_0xb586('0x91')]['find']({'where':{'id':_0x1ff4c3[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x2237b8,null))['then'](function(_0x243c11){if(_0x243c11){return _0x243c11[_0xb586('0x90')](_0x1ff4c3[_0xb586('0x60')][_0xb586('0x6d')],_[_0xb586('0x92')](_0x1ff4c3[_0xb586('0x60')],[_0xb586('0x6d'),'id'])||{});}})[_0xb586('0x37')](respondWithResult(_0x2237b8,null))[_0xb586('0x2c')](handleError(_0x2237b8,null));};exports[_0xb586('0x93')]=function(_0x54e754,_0x95de99,_0x1b2586){var _0xad114c={'raw':![],'where':{}};var _0xe0cece={};var _0x3a3346={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x54e754[_0xb586('0x69')]['id']}})['then'](handleEntityNotFound(_0x95de99,null))[_0xb586('0x37')](function(_0x376ec6){if(_0x376ec6){_0xe0cece['model']=_[_0xb586('0x4b')](db[_0xb586('0x91')]['rawAttributes']);_0xe0cece[_0xb586('0x4a')]=_[_0xb586('0x4b')](_0x54e754[_0xb586('0x4a')]);_0xe0cece[_0xb586('0x53')]=_['intersection'](_0xe0cece[_0xb586('0x49')],_0xe0cece[_0xb586('0x4a')]);_0xad114c[_0xb586('0x4d')]=_[_0xb586('0x4c')](_0xe0cece[_0xb586('0x49')],qs[_0xb586('0x4e')](_0x54e754[_0xb586('0x4a')][_0xb586('0x4e')]));_0xad114c[_0xb586('0x4d')]=_0xad114c[_0xb586('0x4d')][_0xb586('0x4f')]?_0xad114c[_0xb586('0x4d')]:_0xe0cece[_0xb586('0x49')];if(!_0x54e754[_0xb586('0x4a')][_0xb586('0x70')]('nolimit')){_0xad114c['limit']=qs[_0xb586('0x51')](_0x54e754[_0xb586('0x4a')][_0xb586('0x51')]);_0xad114c[_0xb586('0x30')]=qs['offset'](_0x54e754['query']['offset']);}_0xad114c[_0xb586('0x6b')]=qs[_0xb586('0x52')](_0x54e754[_0xb586('0x4a')][_0xb586('0x52')]);_0xad114c['where']=qs['filters'](_[_0xb586('0x54')](_0x54e754[_0xb586('0x4a')],_0xe0cece['filters']));_0xad114c[_0xb586('0x56')][_0xb586('0x65')]=_0x376ec6['id'];if(_0x54e754['query'][_0xb586('0x55')]){_0xad114c[_0xb586('0x56')]=_[_0xb586('0x57')](_0xad114c[_0xb586('0x56')],{'$or':_['map'](_0xad114c[_0xb586('0x4d')],function(_0x5c5c2e){var _0xad6f9a={};_0xad6f9a[_0x5c5c2e]={'$like':'%'+_0x54e754[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0xad6f9a;})});}_0xad114c=_['merge']({},_0xad114c,_0x54e754['options']);return db[_0xb586('0x91')][_0xb586('0x32')]({'where':_0xad114c[_0xb586('0x56')]})[_0xb586('0x37')](function(_0x48770f){_0x3a3346[_0xb586('0x32')]=_0x48770f;if(_0x54e754[_0xb586('0x4a')][_0xb586('0x5e')]){_0xad114c['include']=[{'model':db['CmContact'],'as':_0xb586('0x94'),'required':![]},{'model':db[_0xb586('0x95')],'as':_0xb586('0x96'),'attributes':[_0xb586('0x3c'),'fullname',_0xb586('0x97')],'required':![]},{'model':db[_0xb586('0x98')],'as':_0xb586('0x99'),'attributes':['id',_0xb586('0x3c'),'color'],'where':_0x54e754[_0xb586('0x4a')][_0xb586('0x9a')]?{'id':_0x54e754[_0xb586('0x4a')][_0xb586('0x9a')]}:undefined,'required':_0x54e754[_0xb586('0x4a')][_0xb586('0x9a')]?!![]:![]}];}return db[_0xb586('0x91')][_0xb586('0x5a')](_0xad114c);})[_0xb586('0x37')](function(_0x5eed8c){_0x3a3346[_0xb586('0x5b')]=_0x5eed8c;return _0x3a3346;});}})[_0xb586('0x37')](respondWithFilteredResult(_0x95de99,_0xad114c))[_0xb586('0x2c')](handleError(_0x95de99,null));};exports[_0xb586('0x9b')]=function addApplications(_0x2b6141,_0x589e5a){var _0x129a5f=_0x2b6141[_0xb586('0x69')]['id'];var _0x3712b8=_0x2b6141[_0xb586('0x60')];var _0x2c3a39=0xc8;var _0x13bb53=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xb586('0x9c')][_0xb586('0x9d')][_0xb586('0x9e')][_0xb586('0x9f')]},function(_0x423e93){return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x129a5f},'transaction':_0x423e93})['then'](function(_0x7fcd95){if(_0x7fcd95){return db[_0xb586('0xa0')][_0xb586('0x38')]({'where':{'MailAccountId':_0x129a5f},'transaction':_0x423e93})['then'](function(){var _0xbf8135=_[_0xb586('0x43')](_0x3712b8,function(_0x2b94a5){_0x2b94a5[_0xb586('0x65')]=_0x129a5f;return _0x2b94a5;});return db['MailApplication']['bulkCreate'](_0xbf8135,{'transaction':_0x423e93});});}else{_0x2c3a39=0x194;_0x13bb53=[];}});})[_0xb586('0x37')](function(){if(_0x2c3a39!==0x194){return db[_0xb586('0xa0')][_0xb586('0xa1')]({'where':{'MailAccountId':_0x129a5f},'order':_0xb586('0xa2')})[_0xb586('0x37')](function(_0x45ef43){_0x13bb53=_0x45ef43;});}})[_0xb586('0x2c')](function(_0x4854dc){_0x2c3a39=0x1f4;logger[_0xb586('0x29')](_0x4854dc[_0xb586('0x3b')]);if(_0x4854dc[_0xb586('0x3c')]){delete _0x4854dc[_0xb586('0x3c')];}_0x13bb53=_0x4854dc;})[_0xb586('0xa3')](function(){if(_0x13bb53===null){_0x589e5a[_0xb586('0x2d')](_0x2c3a39);}else{if(_0x2c3a39===0x1f4){_0x589e5a[_0xb586('0x2e')](_0x2c3a39)[_0xb586('0x3d')](_0x13bb53);}else{_0x589e5a[_0xb586('0x2e')](_0x2c3a39)[_0xb586('0x2f')](_0x13bb53);}}});};exports[_0xb586('0xa4')]=function(_0x531e18,_0x53cd6c,_0x4eff96){var _0x3740cb={};var _0x2b8526={};var _0x5f3755;var _0x24f76d;return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x531e18[_0xb586('0x69')]['id']}})['then'](handleEntityNotFound(_0x53cd6c,null))['then'](function(_0x30570c){if(_0x30570c){_0x5f3755=_0x30570c;_0x2b8526[_0xb586('0x49')]=_[_0xb586('0x4b')](db[_0xb586('0xa0')][_0xb586('0x45')]);_0x2b8526['query']=_['keys'](_0x531e18['query']);_0x2b8526[_0xb586('0x53')]=_[_0xb586('0x4c')](_0x2b8526[_0xb586('0x49')],_0x2b8526[_0xb586('0x4a')]);_0x3740cb[_0xb586('0x4d')]=_[_0xb586('0x4c')](_0x2b8526[_0xb586('0x49')],qs[_0xb586('0x4e')](_0x531e18[_0xb586('0x4a')][_0xb586('0x4e')]));_0x3740cb[_0xb586('0x4d')]=_0x3740cb[_0xb586('0x4d')][_0xb586('0x4f')]?_0x3740cb[_0xb586('0x4d')]:_0x2b8526[_0xb586('0x49')];_0x3740cb['order']=qs[_0xb586('0x52')](_0x531e18['query'][_0xb586('0x52')]);_0x3740cb['where']=qs[_0xb586('0x53')](_[_0xb586('0x54')](_0x531e18[_0xb586('0x4a')],_0x2b8526[_0xb586('0x53')]));if(_0x531e18[_0xb586('0x4a')][_0xb586('0x55')]){_0x3740cb[_0xb586('0x56')]=_['merge'](_0x3740cb[_0xb586('0x56')],{'$or':_[_0xb586('0x43')](_0x3740cb[_0xb586('0x4d')],function(_0x146daf){var _0x157bb4={};_0x157bb4[_0x146daf]={'$like':'%'+_0x531e18[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0x157bb4;})});}_0x3740cb=_['merge']({},_0x3740cb,_0x531e18[_0xb586('0x71')]);return _0x5f3755[_0xb586('0xa4')](_0x3740cb);}})[_0xb586('0x37')](function(_0x4b110f){if(_0x4b110f){_0x24f76d=_0x4b110f[_0xb586('0x4f')];if(!_0x531e18[_0xb586('0x4a')][_0xb586('0x70')](_0xb586('0x50'))){_0x3740cb[_0xb586('0x51')]=qs[_0xb586('0x51')](_0x531e18['query'][_0xb586('0x51')]);_0x3740cb[_0xb586('0x30')]=qs[_0xb586('0x30')](_0x531e18['query'][_0xb586('0x30')]);}return _0x5f3755[_0xb586('0xa4')](_0x3740cb);}})[_0xb586('0x37')](function(_0x4cc6d2){if(_0x4cc6d2){return _0x4cc6d2?{'count':_0x24f76d,'rows':_0x4cc6d2}:null;}})[_0xb586('0x37')](respondWithResult(_0x53cd6c,null))[_0xb586('0x2c')](handleError(_0x53cd6c,null));};exports[_0xb586('0xa5')]=function(_0x26cb9f,_0x5f0921,_0x14c226){var _0x5b42dd={'raw':!![],'where':{}};var _0x294eaa={};var _0x9f5b03={'count':0x0,'rows':[]};return db[_0xb586('0x44')][_0xb586('0x68')]({'where':{'id':_0x26cb9f[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x5f0921,null))['then'](function(_0x33354f){if(_0x33354f){_0x294eaa['model']=_[_0xb586('0x4b')](db[_0xb586('0xa6')][_0xb586('0x45')]);_0x294eaa['query']=_['keys'](_0x26cb9f[_0xb586('0x4a')]);_0x294eaa[_0xb586('0x53')]=_[_0xb586('0x4c')](_0x294eaa['model'],_0x294eaa[_0xb586('0x4a')]);_0x5b42dd[_0xb586('0x4d')]=_[_0xb586('0x4c')](_0x294eaa[_0xb586('0x49')],qs['fields'](_0x26cb9f[_0xb586('0x4a')][_0xb586('0x4e')]));_0x5b42dd['attributes']=_0x5b42dd[_0xb586('0x4d')][_0xb586('0x4f')]?_0x5b42dd['attributes']:_0x294eaa[_0xb586('0x49')];if(!_0x26cb9f[_0xb586('0x4a')][_0xb586('0x70')](_0xb586('0x50'))){_0x5b42dd[_0xb586('0x51')]=qs[_0xb586('0x51')](_0x26cb9f[_0xb586('0x4a')][_0xb586('0x51')]);_0x5b42dd['offset']=qs['offset'](_0x26cb9f[_0xb586('0x4a')][_0xb586('0x30')]);}_0x5b42dd[_0xb586('0x6b')]=qs[_0xb586('0x52')](_0x26cb9f[_0xb586('0x4a')][_0xb586('0x52')]);_0x5b42dd['where']=qs[_0xb586('0x53')](_['pick'](_0x26cb9f[_0xb586('0x4a')],_0x294eaa[_0xb586('0x53')]));_0x5b42dd[_0xb586('0x56')]['MailAccountId']=_0x33354f['id'];if(_0x26cb9f['query']['filter']){_0x5b42dd[_0xb586('0x56')]=_[_0xb586('0x57')](_0x5b42dd[_0xb586('0x56')],{'$or':_[_0xb586('0x43')](_0x5b42dd[_0xb586('0x4d')],function(_0x5b52fa){var _0x43ec59={};_0x43ec59[_0x5b52fa]={'$like':'%'+_0x26cb9f[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0x43ec59;})});}if(_0x26cb9f[_0xb586('0x4a')][_0xb586('0xa7')]){var _0xdf6cca=_0x26cb9f[_0xb586('0x4a')]['$gte']['split'](',');var _0x40ec1e={};_0x40ec1e[_0xdf6cca[0x0]]={'$gte':moment(_0xdf6cca[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5b42dd['where']=_[_0xb586('0x57')](_0x5b42dd[_0xb586('0x56')],_0x40ec1e);}_0x5b42dd=_[_0xb586('0x57')]({},_0x5b42dd,_0x26cb9f[_0xb586('0x71')]);return db[_0xb586('0xa6')][_0xb586('0x32')]({'where':_0x5b42dd[_0xb586('0x56')]})[_0xb586('0x37')](function(_0x2325ae){_0x9f5b03[_0xb586('0x32')]=_0x2325ae;if(_0x26cb9f[_0xb586('0x4a')][_0xb586('0x5e')]){_0x5b42dd[_0xb586('0x59')]=[{'all':!![]}];}return db[_0xb586('0xa6')][_0xb586('0x5a')](_0x5b42dd);})['then'](function(_0x10c07d){if(_0x26cb9f[_0xb586('0x4a')]['inlineCss']===_0xb586('0xa8')){for(var _0x388a0d=0x0;_0x388a0d<_0x10c07d[_0xb586('0x4f')];_0x388a0d++){_0x10c07d[_0x388a0d]['body']=juice(_0x10c07d[_0x388a0d][_0xb586('0x60')]);}}_0x9f5b03['rows']=_0x10c07d;return _0x9f5b03;});}})[_0xb586('0x37')](respondWithFilteredResult(_0x5f0921,_0x5b42dd))[_0xb586('0x2c')](handleError(_0x5f0921,null));};exports[_0xb586('0x3d')]=function(_0x341c01,_0x4b5e6f,_0x226e95){var _0x312aae,_0x168c18={},_0x267dde;if(_0x341c01[_0xb586('0x60')]['to']){_0x267dde=_0x341c01[_0xb586('0x60')]['to'][_0xb586('0xa9')](',')[0x0];}return db['MailAccount'][_0xb586('0x64')]({'where':{'id':_0x341c01[_0xb586('0x69')]['id']},'include':[{'model':db[_0xb586('0xaa')],'as':'List','include':[{'model':db[_0xb586('0xab')],'as':_0xb586('0xac'),'where':{'email':_0x267dde},'limit':0x1,'order':[[_0xb586('0xad'),_0xb586('0xae')]]}]},{'model':db[_0xb586('0x40')],'as':'Smtp','raw':!![]}]})[_0xb586('0x37')](handleEntityNotFound(_0x4b5e6f,null))['then'](function(_0x53299d){if(_0x53299d){_0x312aae=_0x53299d;if(_0x53299d['Smtp']){if(_['isNil'](_0x341c01['body'][_0xb586('0xaf')])){_0x341c01[_0xb586('0x60')][_0xb586('0xaf')]=util[_0xb586('0xb0')]('%s\x20<%s>',_0x53299d['name'],_0x53299d[_0xb586('0xb1')]||_0x53299d[_0xb586('0x41')][_0xb586('0x78')]);}if(_0x341c01[_0xb586('0x60')][_0xb586('0xb2')]&&_0x341c01['body'][_0xb586('0xb2')][_0xb586('0x4f')]){for(var _0x2b2a64=0x0;_0x2b2a64<_0x341c01['body'][_0xb586('0xb2')][_0xb586('0x4f')];_0x2b2a64+=0x1){_0x341c01[_0xb586('0x60')]['attachments'][_0x2b2a64]={'filename':_0x341c01[_0xb586('0x60')][_0xb586('0xb2')][_0x2b2a64][_0xb586('0x3c')],'path':path[_0xb586('0xb3')](config[_0xb586('0xb4')],_0xb586('0xb5'),_0x341c01['body'][_0xb586('0xb2')][_0x2b2a64][_0xb586('0xb6')])};}}var _0x3ab9d0={'tls':{'rejectUnauthorized':![]}};if(_[_0xb586('0x74')](_0x53299d[_0xb586('0x41')][_0xb586('0x7f')])){if(_0x53299d[_0xb586('0x41')][_0xb586('0x7c')]){_0x3ab9d0[_0xb586('0xb7')]={'user':_0x53299d[_0xb586('0x41')][_0xb586('0x78')],'pass':_0x53299d[_0xb586('0x41')][_0xb586('0x7b')]};}_0x3ab9d0[_0xb586('0x7d')]=_0x53299d['Smtp']['host'];_0x3ab9d0[_0xb586('0x7e')]=_0x53299d[_0xb586('0x41')][_0xb586('0x7e')];_0x3ab9d0[_0xb586('0xb8')]=_0x53299d[_0xb586('0x41')]['secure'];}else{_0x3ab9d0[_0xb586('0x7f')]=_0x53299d['Smtp'][_0xb586('0x7f')];_0x3ab9d0[_0xb586('0xb7')]={'user':_0x53299d['Smtp'][_0xb586('0x78')],'pass':_0x53299d[_0xb586('0x41')][_0xb586('0x7b')]};}return respondWithRpcPromise(_0xb586('0xb9'),_0xb586('0xba'),{'account':_0x3ab9d0,'message':_0x341c01[_0xb586('0x60')]});}else{throw new Error(_0xb586('0xbb'));}}})[_0xb586('0x37')](function(_0x23e22a){if(_0x23e22a){_0x168c18=_0x23e22a;if(_0x312aae[_0xb586('0xbc')]){if(_0x312aae[_0xb586('0xbc')][_0xb586('0xac')][_0xb586('0x4f')]){return _0x312aae[_0xb586('0xbc')][_0xb586('0xac')][0x0];}else{return db[_0xb586('0xab')][_0xb586('0x66')](_[_0xb586('0x1c')](_0x341c01[_0xb586('0x60')],{'firstName':_0x341c01[_0xb586('0x60')]['to'],'email':_0x341c01[_0xb586('0x60')]['to'],'phone':_0x341c01[_0xb586('0x60')]['to'],'ListId':_0x312aae[_0xb586('0x73')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xb586('0x37')](function(_0x5cf137){if(_0x5cf137){var _0x378440={'UserId':_0x341c01[_0xb586('0x78')]['id'],'ContactId':_0x5cf137['id'],'MailAccountId':_0x312aae['id'],'inReplyTo':_0x168c18[_0xb586('0xbd')],'to':_0x341c01[_0xb586('0x60')][_0xb586('0xaf')],'cc':_0x341c01[_0xb586('0x60')]['cc'],'subject':_0x341c01['body'][_0xb586('0xbe')],'attach':_0x341c01[_0xb586('0x60')][_0xb586('0xbf')],'firstMsgDirection':_0xb586('0xc0'),'lastMsgAt':moment()[_0xb586('0xb0')](_0xb586('0xc1')),'lastMsgDirection':'out','Messages':[_[_0xb586('0x57')](_0x341c01['body'],{'messageId':_0x168c18[_0xb586('0xbd')],'sentAt':moment()[_0xb586('0xb0')](_0xb586('0xc1')),'read':!![],'MailAccountId':_0x312aae['id'],'UserId':_0x341c01[_0xb586('0x78')]['id'],'ContactId':_0x5cf137['id']})]};if(_0x341c01[_0xb586('0x60')][_0xb586('0xc2')]){_0x378440=_[_0xb586('0x57')](_0x378440,_0x341c01[_0xb586('0x60')]['Interaction']);}return db[_0xb586('0x91')][_0xb586('0x66')](_0x378440,{'include':[{'model':db[_0xb586('0xa6')],'as':'Messages'}]});}})[_0xb586('0x37')](respondWithResult(_0x4b5e6f,null))['catch'](handleError(_0x4b5e6f,null));};exports[_0xb586('0xc3')]=function(_0x303339,_0xc3b52d,_0x59d104){return db[_0xb586('0x44')][_0xb586('0x64')]({'where':{'id':_0x303339[_0xb586('0x69')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xb586('0x41'),'raw':!![]}]})[_0xb586('0x37')](handleEntityNotFound(_0xc3b52d,null))[_0xb586('0x37')](function(_0x32c974){if(_0x32c974&&_0x32c974[_0xb586('0x41')]){var _0x5cc265={'id':_0x32c974['id'],'tls':{'rejectUnauthorized':![]}};if(_0x32c974['Smtp'][_0xb586('0x7f')]){_0x5cc265[_0xb586('0x7f')]=_0x32c974[_0xb586('0x41')]['service'];}else{_0x5cc265[_0xb586('0x7d')]=_0x32c974['Smtp'][_0xb586('0x7d')];_0x5cc265[_0xb586('0x7e')]=_0x32c974[_0xb586('0x41')][_0xb586('0x7e')];_0x5cc265[_0xb586('0xb8')]=_0x32c974[_0xb586('0x41')][_0xb586('0xb8')];}if(_0x32c974[_0xb586('0x41')]['authentication']){_0x5cc265['auth']={'user':_0x32c974[_0xb586('0x41')][_0xb586('0x78')],'pass':_0x32c974[_0xb586('0x41')]['pass']};}return respondWithRpcPromise(_0xb586('0xc4'),_0xb586('0xc3'),{'account':_0x5cc265});}})[_0xb586('0x37')](respondWithResult(_0xc3b52d,null))['catch'](handleError(_0xc3b52d,null));};exports['destroy']=function(_0x4022d6,_0x5c76a2){return db[_0xb586('0x44')]['find']({'where':{'id':_0x4022d6[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x5c76a2,null))[_0xb586('0x37')](function(_0x51ffd2){if(_0x51ffd2&&_0x51ffd2[_0xb586('0x7f')]){throw new db['Sequelize']['ValidationError'](_0xb586('0xc5'));}return _0x51ffd2;})[_0xb586('0x37')](removeEntity(_0x5c76a2,null))[_0xb586('0x2c')](handleError(_0x5c76a2,null));};exports[_0xb586('0xc6')]=function(_0x23215f,_0x2a028b,_0x5430e5){return db[_0xb586('0x44')]['find']({'where':{'id':_0x23215f['params']['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x2a028b,null))[_0xb586('0x37')](function(_0x4317f5){if(_0x4317f5){return _0x4317f5[_0xb586('0xc6')](_0x23215f[_0xb586('0x60')]['ids'],_[_0xb586('0x92')](_0x23215f[_0xb586('0x60')],[_0xb586('0x6d'),'id'])||{})[_0xb586('0xc7')](function(_0x336613){for(var _0x5f1d43=0x0;_0x5f1d43<_0x23215f[_0xb586('0x60')][_0xb586('0x6d')][_0xb586('0x4f')];_0x5f1d43+=0x1){socket[_0xb586('0xc8')](_0xb586('0xc9'),{'UserId':Number(_0x23215f[_0xb586('0x60')]['ids'][_0x5f1d43]),'MailAccountId':Number(_0x23215f[_0xb586('0x69')]['id'])});}return _0x336613;});}})[_0xb586('0x37')](respondWithResult(_0x2a028b,null))['catch'](handleError(_0x2a028b,null));};exports[_0xb586('0xca')]=function(_0x9dfeb2,_0x63c939,_0x2bbbef){return db[_0xb586('0x44')][_0xb586('0x64')]({'where':{'id':_0x9dfeb2['params']['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x63c939,null))[_0xb586('0x37')](function(_0x8dd923){if(_0x8dd923){return _0x8dd923['removeAgents'](_0x9dfeb2[_0xb586('0x4a')]['ids'])['then'](function(){if(_['isArray'](_0x9dfeb2['query']['ids'])){for(var _0x380bfa=0x0;_0x380bfa<_0x9dfeb2[_0xb586('0x4a')][_0xb586('0x6d')][_0xb586('0x4f')];_0x380bfa+=0x1){socket[_0xb586('0xc8')]('userMailAccount:remove',{'UserId':Number(_0x9dfeb2[_0xb586('0x4a')][_0xb586('0x6d')][_0x380bfa]),'MailAccountId':Number(_0x9dfeb2[_0xb586('0x69')]['id'])});}}else{socket[_0xb586('0xc8')](_0xb586('0xcb'),{'UserId':Number(_0x9dfeb2[_0xb586('0x4a')][_0xb586('0x6d')]),'MailAccountId':Number(_0x9dfeb2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x63c939,null))[_0xb586('0x2c')](handleError(_0x63c939,null));};exports[_0xb586('0xcc')]=function(_0x1fdff7,_0x59096e,_0x7632b3){var _0xc9410e={};var _0x4c7bb9={};var _0x1b5ad0;var _0x27d733;return db['MailAccount'][_0xb586('0x68')]({'where':{'id':_0x1fdff7[_0xb586('0x69')]['id']}})[_0xb586('0x37')](handleEntityNotFound(_0x59096e,null))[_0xb586('0x37')](function(_0x5ddb65){if(_0x5ddb65){_0x1b5ad0=_0x5ddb65;_0x4c7bb9['model']=_[_0xb586('0x4b')](db[_0xb586('0x95')]['rawAttributes']);_0x4c7bb9['query']=_[_0xb586('0x4b')](_0x1fdff7['query']);_0x4c7bb9['filters']=_[_0xb586('0x4c')](_0x4c7bb9['model'],_0x4c7bb9[_0xb586('0x4a')]);_0xc9410e['attributes']=_[_0xb586('0x4c')](_0x4c7bb9['model'],qs[_0xb586('0x4e')](_0x1fdff7[_0xb586('0x4a')][_0xb586('0x4e')]));_0xc9410e[_0xb586('0x4d')]=_0xc9410e[_0xb586('0x4d')][_0xb586('0x4f')]?_0xc9410e[_0xb586('0x4d')]:_0x4c7bb9['model'];_0xc9410e[_0xb586('0x6b')]=qs[_0xb586('0x52')](_0x1fdff7[_0xb586('0x4a')][_0xb586('0x52')]);_0xc9410e['where']=qs[_0xb586('0x53')](_[_0xb586('0x54')](_0x1fdff7[_0xb586('0x4a')],_0x4c7bb9['filters']));if(_0x1fdff7['query'][_0xb586('0x55')]){_0xc9410e[_0xb586('0x56')]=_[_0xb586('0x57')](_0xc9410e[_0xb586('0x56')],{'$or':_[_0xb586('0x43')](_0xc9410e[_0xb586('0x4d')],function(_0x567c35){var _0x3bf95e={};_0x3bf95e[_0x567c35]={'$like':'%'+_0x1fdff7[_0xb586('0x4a')][_0xb586('0x55')]+'%'};return _0x3bf95e;})});}_0xc9410e=_['merge']({},_0xc9410e,_0x1fdff7[_0xb586('0x71')]);return _0x1b5ad0[_0xb586('0xcc')](_0xc9410e);}})[_0xb586('0x37')](function(_0x232ab7){if(_0x232ab7){_0x27d733=_0x232ab7[_0xb586('0x4f')];if(!_0x1fdff7[_0xb586('0x4a')][_0xb586('0x70')](_0xb586('0x50'))){_0xc9410e['limit']=qs[_0xb586('0x51')](_0x1fdff7[_0xb586('0x4a')][_0xb586('0x51')]);_0xc9410e[_0xb586('0x30')]=qs[_0xb586('0x30')](_0x1fdff7[_0xb586('0x4a')][_0xb586('0x30')]);}return _0x1b5ad0['getAgents'](_0xc9410e);}})[_0xb586('0x37')](function(_0x44324c){if(_0x44324c){return _0x44324c?{'count':_0x27d733,'rows':_0x44324c}:null;}})[_0xb586('0x37')](respondWithResult(_0x59096e,null))[_0xb586('0x2c')](handleError(_0x59096e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index a04b049..c747183 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 _0xbdc2=['events','../../mysqldb','MailAccount','setMaxListeners','remove','emit','hook','exports'];(function(_0x8573c4,_0xfdc7a8){var _0x4a3b68=function(_0xbf1a5e){while(--_0xbf1a5e){_0x8573c4['push'](_0x8573c4['shift']());}};_0x4a3b68(++_0xfdc7a8);}(_0xbdc2,0x148));var _0x2bdc=function(_0x2c396c,_0x4db177){_0x2c396c=_0x2c396c-0x0;var _0x26219b=_0xbdc2[_0x2c396c];return _0x26219b;};'use strict';var EventEmitter=require(_0x2bdc('0x0'));var MailAccount=require(_0x2bdc('0x1'))['db'][_0x2bdc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2bdc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2bdc('0x4')};function emitEvent(_0x1d9116){return function(_0x522434,_0x1855bd,_0x378db8){MailAccountEvents['emit'](_0x1d9116+':'+_0x522434['id'],_0x522434);MailAccountEvents[_0x2bdc('0x5')](_0x1d9116,_0x522434);_0x378db8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x2bdc('0x6')](e,emitEvent(event));}}module[_0x2bdc('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xddd2=['remove','emit','hasOwnProperty','hook','exports','events','MailAccount','save','update'];(function(_0x31ddba,_0x28ec26){var _0x3f014c=function(_0x24aa10){while(--_0x24aa10){_0x31ddba['push'](_0x31ddba['shift']());}};_0x3f014c(++_0x28ec26);}(_0xddd2,0x1e2));var _0x2ddd=function(_0x2b6f49,_0x3f5a45){_0x2b6f49=_0x2b6f49-0x0;var _0x26d444=_0xddd2[_0x2b6f49];return _0x26d444;};'use strict';var EventEmitter=require(_0x2ddd('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x2ddd('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ddd('0x2'),'afterUpdate':_0x2ddd('0x3'),'afterDestroy':_0x2ddd('0x4')};function emitEvent(_0x10f929){return function(_0x38ce79,_0x44befd,_0x2cbc62){MailAccountEvents['emit'](_0x10f929+':'+_0x38ce79['id'],_0x38ce79);MailAccountEvents[_0x2ddd('0x5')](_0x10f929,_0x38ce79);_0x2cbc62(null);};}for(var e in events){if(events[_0x2ddd('0x6')](e)){var event=events[e];MailAccount[_0x2ddd('0x7')](e,emitEvent(event));}}module[_0x2ddd('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 0f3c48f..1aed122 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 _0x2964=['exports','MailAccount','mail_accounts','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2ab5c5,_0x37ed0d){var _0x59615b=function(_0x212c98){while(--_0x212c98){_0x2ab5c5['push'](_0x2ab5c5['shift']());}};_0x59615b(++_0x37ed0d);}(_0x2964,0x14d));var _0x4296=function(_0x19e800,_0x244402){_0x19e800=_0x19e800-0x0;var _0x1c34e3=_0x2964[_0x19e800];return _0x1c34e3;};'use strict';var _=require('lodash');var util=require(_0x4296('0x0'));var logger=require(_0x4296('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4296('0x2'));var rp=require(_0x4296('0x3'));var fs=require('fs');var path=require(_0x4296('0x4'));var rimraf=require(_0x4296('0x5'));var config=require(_0x4296('0x6'));var attributes=require('./mailAccount.attributes');module[_0x4296('0x7')]=function(_0x29b1f6,_0x3b3a2e){return _0x29b1f6['define'](_0x4296('0x8'),attributes,{'tableName':_0x4296('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e96=['MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','exports'];(function(_0x1b4ecf,_0x1168ba){var _0x37ff64=function(_0x60f740){while(--_0x60f740){_0x1b4ecf['push'](_0x1b4ecf['shift']());}};_0x37ff64(++_0x1168ba);}(_0x5e96,0xab));var _0x65e9=function(_0x5728d6,_0x17faf5){_0x5728d6=_0x5728d6-0x0;var _0x4d61b5=_0x5e96[_0x5728d6];return _0x4d61b5;};'use strict';var _=require(_0x65e9('0x0'));var util=require(_0x65e9('0x1'));var logger=require(_0x65e9('0x2'))(_0x65e9('0x3'));var moment=require(_0x65e9('0x4'));var BPromise=require(_0x65e9('0x5'));var rp=require(_0x65e9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65e9('0x7'));var config=require(_0x65e9('0x8'));var attributes=require(_0x65e9('0x9'));module[_0x65e9('0xa')]=function(_0x17dd78,_0x2833a7){return _0x17dd78['define'](_0x65e9('0xb'),attributes,{'tableName':_0x65e9('0xc'),'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 f9ff91d..269fddb 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 _0xa2aa=['subject','attach','format','interaction','contact','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','raw','options','where','attributes','include','map','model','debug','ShowMailAccount','find','NotifyMailAccount','mail','difference','rawAttributes','createdAt','updatedAt','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','list','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','defaults','CmContact','List\x20not\x20found','messageId','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update'];(function(_0x5a5011,_0x3778b9){var _0x2e6ee1=function(_0x5db251){while(--_0x5db251){_0x5a5011['push'](_0x5a5011['shift']());}};_0x2e6ee1(++_0x3778b9);}(_0xa2aa,0x161));var _0xaa2a=function(_0x1a1a11,_0x560ed8){_0x1a1a11=_0x1a1a11-0x0;var _0x186ec3=_0xa2aa[_0x1a1a11];return _0x186ec3;};'use strict';var _=require(_0xaa2a('0x0'));var util=require(_0xaa2a('0x1'));var moment=require(_0xaa2a('0x2'));var BPromise=require(_0xaa2a('0x3'));var rs=require(_0xaa2a('0x4'));var fs=require('fs');var Redis=require(_0xaa2a('0x5'));var db=require(_0xaa2a('0x6'))['db'];var utils=require(_0xaa2a('0x7'));var logger=require(_0xaa2a('0x8'))('rpc');var config=require(_0xaa2a('0x9'));var jayson=require(_0xaa2a('0xa'));var client=jayson[_0xaa2a('0xb')][_0xaa2a('0xc')]({'port':0x232c});config[_0xaa2a('0xd')]=_['defaults'](config[_0xaa2a('0xd')],{'host':_0xaa2a('0xe'),'port':0x18eb});var socket=require(_0xaa2a('0xf'))(new Redis(config[_0xaa2a('0xd')]));require(_0xaa2a('0x10'))[_0xaa2a('0x11')](socket);function respondWithRpcPromise(_0x4a23a2,_0x1a2c06,_0x3142bf){return new BPromise(function(_0x2ab443,_0x3822ef){return client[_0xaa2a('0x12')](_0x4a23a2,_0x3142bf)[_0xaa2a('0x13')](function(_0x344bfe){logger[_0xaa2a('0x14')](_0xaa2a('0x15'),_0x1a2c06,_0xaa2a('0x16'));logger['debug'](_0xaa2a('0x17'),_0x1a2c06,_0xaa2a('0x16'),JSON[_0xaa2a('0x18')](_0x344bfe));if(_0x344bfe[_0xaa2a('0x19')]){if(_0x344bfe['error'][_0xaa2a('0x1a')]===0x1f4){logger[_0xaa2a('0x19')](_0xaa2a('0x15'),_0x1a2c06,_0x344bfe[_0xaa2a('0x19')]['message']);return _0x3822ef(_0x344bfe['error']['message']);}logger[_0xaa2a('0x19')]('MailAccount,\x20%s,\x20%s',_0x1a2c06,_0x344bfe['error'][_0xaa2a('0x1b')]);return _0x2ab443(_0x344bfe[_0xaa2a('0x19')]['message']);}else{logger['info'](_0xaa2a('0x15'),_0x1a2c06,_0xaa2a('0x16'));_0x2ab443(_0x344bfe[_0xaa2a('0x1c')][_0xaa2a('0x1b')]);}})[_0xaa2a('0x1d')](function(_0x5edf29){logger[_0xaa2a('0x19')]('MailAccount,\x20%s,\x20%s',_0x1a2c06,_0x5edf29);_0x3822ef(_0x5edf29);});});}exports[_0xaa2a('0x1e')]=function(_0x37e75d){var _0x5b6b6c=this;return new Promise(function(_0x5879fd,_0x136ce1){return db[_0xaa2a('0x1f')][_0xaa2a('0x20')]({'raw':_0x37e75d['options']?_0x37e75d['options'][_0xaa2a('0x21')]===undefined?!![]:![]:!![],'where':_0x37e75d[_0xaa2a('0x22')]?_0x37e75d[_0xaa2a('0x22')][_0xaa2a('0x23')]||null:null,'attributes':_0x37e75d[_0xaa2a('0x22')]?_0x37e75d[_0xaa2a('0x22')][_0xaa2a('0x24')]||null:null,'limit':_0x37e75d['options']?_0x37e75d[_0xaa2a('0x22')]['limit']||null:null,'include':_0x37e75d[_0xaa2a('0x22')]?_0x37e75d['options'][_0xaa2a('0x25')]?_[_0xaa2a('0x26')](_0x37e75d['options'][_0xaa2a('0x25')],function(_0x1c2ce2){return{'model':db[_0x1c2ce2[_0xaa2a('0x27')]],'as':_0x1c2ce2['as'],'attributes':_0x1c2ce2[_0xaa2a('0x24')],'include':_0x1c2ce2[_0xaa2a('0x25')]?_[_0xaa2a('0x26')](_0x1c2ce2['include'],function(_0xf3e419){return{'model':db[_0xf3e419[_0xaa2a('0x27')]],'as':_0xf3e419['as'],'attributes':_0xf3e419[_0xaa2a('0x24')],'include':_0xf3e419['include']?_['map'](_0xf3e419[_0xaa2a('0x25')],function(_0xa541dd){return{'model':db[_0xa541dd[_0xaa2a('0x27')]],'as':_0xa541dd['as'],'attributes':_0xa541dd[_0xaa2a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19e585){logger['info'](_0xaa2a('0x1e'),_0x37e75d);logger[_0xaa2a('0x28')](_0xaa2a('0x1e'),_0x37e75d,JSON[_0xaa2a('0x18')](_0x19e585));_0x5879fd(_0x19e585);})[_0xaa2a('0x1d')](function(_0x24043d){logger[_0xaa2a('0x19')](_0xaa2a('0x1e'),_0x24043d[_0xaa2a('0x1b')],_0x37e75d);_0x136ce1(_0x5b6b6c[_0xaa2a('0x19')](0x1f4,_0x24043d[_0xaa2a('0x1b')]));});});};exports[_0xaa2a('0x29')]=function(_0x442f2d){var _0x4ceb11=this;return new Promise(function(_0x226565,_0x2dd766){return db['MailAccount'][_0xaa2a('0x2a')]({'raw':_0x442f2d[_0xaa2a('0x22')]?_0x442f2d[_0xaa2a('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x442f2d[_0xaa2a('0x22')]?_0x442f2d['options'][_0xaa2a('0x23')]||null:null,'attributes':_0x442f2d[_0xaa2a('0x22')]?_0x442f2d[_0xaa2a('0x22')][_0xaa2a('0x24')]||null:null,'include':_0x442f2d[_0xaa2a('0x22')]?_0x442f2d[_0xaa2a('0x22')]['include']?_[_0xaa2a('0x26')](_0x442f2d[_0xaa2a('0x22')][_0xaa2a('0x25')],function(_0x127ea8){return{'model':db[_0x127ea8[_0xaa2a('0x27')]],'as':_0x127ea8['as'],'attributes':_0x127ea8[_0xaa2a('0x24')],'include':_0x127ea8[_0xaa2a('0x25')]?_[_0xaa2a('0x26')](_0x127ea8[_0xaa2a('0x25')],function(_0x1ca572){return{'model':db[_0x1ca572['model']],'as':_0x1ca572['as'],'attributes':_0x1ca572['attributes'],'include':_0x1ca572[_0xaa2a('0x25')]?_[_0xaa2a('0x26')](_0x1ca572['include'],function(_0x301618){return{'model':db[_0x301618[_0xaa2a('0x27')]],'as':_0x301618['as'],'attributes':_0x301618[_0xaa2a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xaa2a('0x13')](function(_0x3460b4){logger[_0xaa2a('0x14')](_0xaa2a('0x29'),_0x442f2d);logger[_0xaa2a('0x28')](_0xaa2a('0x29'),_0x442f2d,JSON[_0xaa2a('0x18')](_0x3460b4));_0x226565(_0x3460b4);})[_0xaa2a('0x1d')](function(_0x47128a){logger[_0xaa2a('0x19')](_0xaa2a('0x29'),_0x47128a[_0xaa2a('0x1b')],_0x442f2d);_0x2dd766(_0x4ceb11['error'](0x1f4,_0x47128a['message']));});});};exports[_0xaa2a('0x2b')]=function(_0x501a6b){var _0x30eab0=this;return new Promise(function(_0x2265f8,_0x5e58e2){var _0x36ec05={'body':_0x501a6b['body'],'channel':_0xaa2a('0x2c')};var _0x24263a=_[_0xaa2a('0x2d')](_['keys'](db['CmContact'][_0xaa2a('0x2e')]),[_0xaa2a('0x2f'),_0xaa2a('0x30'),'CompanyId','ListId']);var _0x428df7=![];if(_0x501a6b[_0xaa2a('0x31')]['id']){delete _0x501a6b[_0xaa2a('0x31')]['id'];}if(_[_0xaa2a('0x32')](_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x33')])){return _0x5e58e2(_0x30eab0[_0xaa2a('0x19')](0x1f4,_0xaa2a('0x34')));}if(_[_0xaa2a('0x32')](_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x31')])||_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x31')]===''){return _0x5e58e2(_0x30eab0['error'](0x1f4,_0xaa2a('0x35')));}if(_[_0xaa2a('0x32')](_0x501a6b[_0xaa2a('0x31')]['mapKey'])){return _0x5e58e2(_0x30eab0[_0xaa2a('0x19')](0x1f4,_0xaa2a('0x36')+_0x24263a));}if(!_[_0xaa2a('0x37')](_0x24263a,_0x501a6b[_0xaa2a('0x31')]['mapKey'])){return _0x5e58e2(_0x30eab0['error'](0x1f4,_0xaa2a('0x38')+_0x24263a));}var _0x28d347={};_0x28d347[_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x39')]]=_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x33')];return db[_0xaa2a('0x1f')][_0xaa2a('0x2a')]({'where':{'id':_0x501a6b[_0xaa2a('0x3a')]['id']},'include':[{'model':db[_0xaa2a('0x3b')],'as':_0xaa2a('0x3c'),'include':[{'model':db['CmContact'],'as':_0xaa2a('0x3d'),'where':_0x28d347,'limit':0x1,'order':[[_0xaa2a('0x30'),_0xaa2a('0x3e')]]}]},{'model':db[_0xaa2a('0x3f')],'as':_0xaa2a('0x40')},{'model':db[_0xaa2a('0x41')],'as':_0xaa2a('0x42')}]})[_0xaa2a('0x13')](function(_0x464c42){if(_0x464c42&&_0x464c42['List']){var _0x2531ca=_0x464c42[_0xaa2a('0x43')]({'plain':!![]});_0x36ec05[_0xaa2a('0x3a')]=_[_0xaa2a('0x44')](_0x2531ca,[_0xaa2a('0x40'),_0xaa2a('0x3c')]);_0x36ec05['applications']=_0x2531ca[_0xaa2a('0x40')];_0x36ec05[_0xaa2a('0x45')]=_0x2531ca['List'];_0x36ec05[_0xaa2a('0x46')]=_[_0xaa2a('0x47')](_0x36ec05[_0xaa2a('0x46')],[_0xaa2a('0x48')],['asc']);if(_0x36ec05[_0xaa2a('0x3a')]&&_0x36ec05['account']['autoclose']){_0x36ec05[_0xaa2a('0x46')][_0xaa2a('0x49')]({'id':0x0,'priority':_0x36ec05[_0xaa2a('0x46')][_0xaa2a('0x4a')]+0x1,'app':_0xaa2a('0x4b'),'appdata':_0xaa2a('0x4c'),'interval':_0xaa2a('0x4d')});}if(_0x36ec05['account'][_0xaa2a('0x40')]){delete _0x36ec05[_0xaa2a('0x3a')][_0xaa2a('0x40')];}if(_0x36ec05[_0xaa2a('0x3a')]['List']){delete _0x36ec05[_0xaa2a('0x3a')][_0xaa2a('0x3c')];}if(_0x2531ca[_0xaa2a('0x3c')]['Contacts'][_0xaa2a('0x4a')]){return _0x2531ca[_0xaa2a('0x3c')]['Contacts'][0x0];}var _0x15e4ee=_[_0xaa2a('0x4e')](_0x501a6b[_0xaa2a('0x31')],{'firstName':_0x501a6b['body']['from'],'ListId':_0x2531ca['ListId']});_0x15e4ee[_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x39')]]=_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x33')];return db[_0xaa2a('0x4f')]['create'](_0x15e4ee);}else{throw new Error(_0xaa2a('0x50'));}})[_0xaa2a('0x13')](function(_0x253026){_0x36ec05['contact']=_0x253026;if(_0x253026){if(!_0x501a6b['body']['message']['messageId']){_0x501a6b[_0xaa2a('0x31')]['message']['messageId']=rs['generate']()+'\x20'+_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x33')];}var _0x8c67cf={'ContactId':_0x253026['id'],'MailAccountId':_0x501a6b[_0xaa2a('0x3a')]['id'],'inReplyTo':_0x501a6b['body'][_0xaa2a('0x1b')][_0xaa2a('0x51')],'to':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x33')],'cc':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')]['cc'],'subject':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')]['subject'],'attach':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')]['attach'],'lastMsgAt':moment()['format'](_0xaa2a('0x52')),'lastMsgDirection':'in'};return db[_0xaa2a('0x53')][_0xaa2a('0x2a')]({'where':{'closed':![],'MailAccountId':_0x501a6b[_0xaa2a('0x3a')]['id']},'include':[{'model':db[_0xaa2a('0x54')],'as':_0xaa2a('0x55'),'attributes':[_0xaa2a('0x51')],'where':{'messageId':_0x501a6b['body'][_0xaa2a('0x1b')][_0xaa2a('0x56')]}}]})[_0xaa2a('0x13')](function(_0x1fab8e){if(_0x1fab8e){return[_0x1fab8e,![]];}return db[_0xaa2a('0x53')][_0xaa2a('0x57')](_0x8c67cf)['then'](function(_0x342240){return[_0x342240,!![]];});});}else{throw new Error(_0xaa2a('0x58'));}})[_0xaa2a('0x59')](function(_0x2c17c4,_0x54add7){if(_0x2c17c4){_0x428df7=_0x54add7;if(!_0x54add7){return _0x2c17c4[_0xaa2a('0x5a')]({'inReplyTo':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x51')],'to':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x33')],'cc':_0x501a6b['body'][_0xaa2a('0x1b')]['cc'],'subject':_0x501a6b[_0xaa2a('0x31')]['message'][_0xaa2a('0x5b')],'attach':_0x2c17c4[_0xaa2a('0x5c')]?_0x2c17c4['attach']:_0x501a6b['body'][_0xaa2a('0x1b')][_0xaa2a('0x5c')],'substatus':null,'substatusAt':moment()[_0xaa2a('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xaa2a('0x5d')](_0xaa2a('0x52')),'lastMsgDirection':'in'});}else{return _0x2c17c4;}}})[_0xaa2a('0x13')](function(_0x34882c){_0x36ec05[_0xaa2a('0x5e')]=_0x34882c[_0xaa2a('0x43')]({'plain':!![]});_0x36ec05[_0xaa2a('0x5e')]['created']=_0x428df7;return db[_0xaa2a('0x54')][_0xaa2a('0x57')]({'body':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x31')],'MailAccountId':_0x501a6b['account']['id'],'MailInteractionId':_0x34882c['id'],'direction':'in','ContactId':_0x36ec05[_0xaa2a('0x5f')]['id'],'messageId':_0x501a6b['body']['message'][_0xaa2a('0x51')],'from':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x33')],'to':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')]['to'],'cc':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')]['cc'],'subject':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x5b')],'attach':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x5c')],'Attachments':_0x501a6b[_0xaa2a('0x31')]['message']['attachments'],'originTo':_0x501a6b['body'][_0xaa2a('0x1b')][_0xaa2a('0x60')],'originCc':_0x501a6b['body'][_0xaa2a('0x1b')][_0xaa2a('0x61')],'bcc':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x62')],'ChatWebsiteId':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x63')]||null,'originChannel':_0x501a6b[_0xaa2a('0x31')]['message'][_0xaa2a('0x64')]||_0xaa2a('0x65'),'ChatOfflineMessageId':_0x501a6b[_0xaa2a('0x31')][_0xaa2a('0x1b')][_0xaa2a('0x66')]||null},{'include':[{'model':db['Attachment'],'as':_0xaa2a('0x67')}]});})[_0xaa2a('0x13')](function(_0x13fbb8){_0x36ec05['message']=_0x13fbb8;if(_0x36ec05['interaction'][_0xaa2a('0x68')]){return db[_0xaa2a('0x69')][_0xaa2a('0x2a')]({'attributes':['id',_0xaa2a('0x6a')],'where':{'id':_0x36ec05[_0xaa2a('0x5e')][_0xaa2a('0x68')]}})[_0xaa2a('0x13')](function(_0x4a69d6){if(_0x4a69d6){_0x36ec05[_0xaa2a('0x46')][_0xaa2a('0x6b')]({'id':0x0,'priority':0x0,'app':_0xaa2a('0x6c'),'appdata':_0x4a69d6['name']+','+(_0x36ec05['account']['waitForTheAssignedAgent']||0xa),'interval':_0xaa2a('0x4d')});}return respondWithRpcPromise(_0xaa2a('0x6d'),_0xaa2a('0x6e'),_0x36ec05);});}return respondWithRpcPromise(_0xaa2a('0x6d'),_0xaa2a('0x6e'),_0x36ec05);})[_0xaa2a('0x13')](function(_0x34072c){_0x2265f8(_0x34072c);})[_0xaa2a('0x1d')](function(_0x1938bf){_0x5e58e2(_0x30eab0[_0xaa2a('0x19')](0x1f4,_0x1938bf[_0xaa2a('0x1b')]));});});}; \ No newline at end of file +var _0xde10=['updatedAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','DESC','MailServerOut','get','omit','Applications','applications','list','orderBy','priority','account','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','MailInteraction','Contact\x20not\x20found','spread','format','interaction','created','MailMessage','attachments','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailAccount','findAll','options','raw','include','model','attributes','map','ShowMailAccount','MailAccount','where','then','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xde10,0x1e8));var _0x0de1=function(_0x22e109,_0x13673e){_0x22e109=_0x22e109-0x0;var _0x530735=_0xde10[_0x22e109];return _0x530735;};'use strict';var _=require(_0x0de1('0x0'));var util=require(_0x0de1('0x1'));var moment=require(_0x0de1('0x2'));var BPromise=require(_0x0de1('0x3'));var rs=require(_0x0de1('0x4'));var fs=require('fs');var Redis=require(_0x0de1('0x5'));var db=require(_0x0de1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0de1('0x7'));var config=require(_0x0de1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0de1('0x9')][_0x0de1('0xa')]({'port':0x232c});config[_0x0de1('0xb')]=_[_0x0de1('0xc')](config[_0x0de1('0xb')],{'host':_0x0de1('0xd'),'port':0x18eb});var socket=require(_0x0de1('0xe'))(new Redis(config[_0x0de1('0xb')]));require(_0x0de1('0xf'))[_0x0de1('0x10')](socket);function respondWithRpcPromise(_0x36215d,_0x375615,_0x53f3cd){return new BPromise(function(_0x107fa7,_0x5df70d){return client['request'](_0x36215d,_0x53f3cd)['then'](function(_0x181f25){logger[_0x0de1('0x11')](_0x0de1('0x12'),_0x375615,_0x0de1('0x13'));logger[_0x0de1('0x14')](_0x0de1('0x15'),_0x375615,_0x0de1('0x13'),JSON[_0x0de1('0x16')](_0x181f25));if(_0x181f25['error']){if(_0x181f25['error'][_0x0de1('0x17')]===0x1f4){logger[_0x0de1('0x18')](_0x0de1('0x12'),_0x375615,_0x181f25[_0x0de1('0x18')][_0x0de1('0x19')]);return _0x5df70d(_0x181f25['error']['message']);}logger[_0x0de1('0x18')](_0x0de1('0x12'),_0x375615,_0x181f25['error']['message']);return _0x107fa7(_0x181f25[_0x0de1('0x18')][_0x0de1('0x19')]);}else{logger[_0x0de1('0x11')](_0x0de1('0x12'),_0x375615,'request\x20sent');_0x107fa7(_0x181f25[_0x0de1('0x1a')][_0x0de1('0x19')]);}})[_0x0de1('0x1b')](function(_0x21eb78){logger[_0x0de1('0x18')](_0x0de1('0x12'),_0x375615,_0x21eb78);_0x5df70d(_0x21eb78);});});}exports[_0x0de1('0x1c')]=function(_0x34c96f){var _0x2d71d2=this;return new Promise(function(_0x3dceeb,_0x21b35b){return db['MailAccount'][_0x0de1('0x1d')]({'raw':_0x34c96f[_0x0de1('0x1e')]?_0x34c96f[_0x0de1('0x1e')][_0x0de1('0x1f')]===undefined?!![]:![]:!![],'where':_0x34c96f[_0x0de1('0x1e')]?_0x34c96f['options']['where']||null:null,'attributes':_0x34c96f[_0x0de1('0x1e')]?_0x34c96f[_0x0de1('0x1e')]['attributes']||null:null,'limit':_0x34c96f[_0x0de1('0x1e')]?_0x34c96f[_0x0de1('0x1e')]['limit']||null:null,'include':_0x34c96f[_0x0de1('0x1e')]?_0x34c96f[_0x0de1('0x1e')]['include']?_['map'](_0x34c96f[_0x0de1('0x1e')][_0x0de1('0x20')],function(_0x272332){return{'model':db[_0x272332[_0x0de1('0x21')]],'as':_0x272332['as'],'attributes':_0x272332[_0x0de1('0x22')],'include':_0x272332[_0x0de1('0x20')]?_[_0x0de1('0x23')](_0x272332[_0x0de1('0x20')],function(_0x2aa494){return{'model':db[_0x2aa494[_0x0de1('0x21')]],'as':_0x2aa494['as'],'attributes':_0x2aa494[_0x0de1('0x22')],'include':_0x2aa494[_0x0de1('0x20')]?_['map'](_0x2aa494[_0x0de1('0x20')],function(_0x5c293f){return{'model':db[_0x5c293f['model']],'as':_0x5c293f['as'],'attributes':_0x5c293f[_0x0de1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x231a30){logger[_0x0de1('0x11')](_0x0de1('0x1c'),_0x34c96f);logger[_0x0de1('0x14')](_0x0de1('0x1c'),_0x34c96f,JSON[_0x0de1('0x16')](_0x231a30));_0x3dceeb(_0x231a30);})[_0x0de1('0x1b')](function(_0x490b8c){logger['error']('GetMailAccount',_0x490b8c[_0x0de1('0x19')],_0x34c96f);_0x21b35b(_0x2d71d2[_0x0de1('0x18')](0x1f4,_0x490b8c[_0x0de1('0x19')]));});});};exports[_0x0de1('0x24')]=function(_0x403200){var _0x27fa93=this;return new Promise(function(_0x3989e2,_0x1e411c){return db[_0x0de1('0x25')]['find']({'raw':_0x403200['options']?_0x403200[_0x0de1('0x1e')][_0x0de1('0x1f')]===undefined?!![]:![]:!![],'where':_0x403200[_0x0de1('0x1e')]?_0x403200[_0x0de1('0x1e')][_0x0de1('0x26')]||null:null,'attributes':_0x403200[_0x0de1('0x1e')]?_0x403200[_0x0de1('0x1e')]['attributes']||null:null,'include':_0x403200[_0x0de1('0x1e')]?_0x403200['options'][_0x0de1('0x20')]?_[_0x0de1('0x23')](_0x403200['options'][_0x0de1('0x20')],function(_0xfb5e8e){return{'model':db[_0xfb5e8e[_0x0de1('0x21')]],'as':_0xfb5e8e['as'],'attributes':_0xfb5e8e[_0x0de1('0x22')],'include':_0xfb5e8e[_0x0de1('0x20')]?_['map'](_0xfb5e8e[_0x0de1('0x20')],function(_0x257f9e){return{'model':db[_0x257f9e[_0x0de1('0x21')]],'as':_0x257f9e['as'],'attributes':_0x257f9e['attributes'],'include':_0x257f9e[_0x0de1('0x20')]?_[_0x0de1('0x23')](_0x257f9e[_0x0de1('0x20')],function(_0x211b4e){return{'model':db[_0x211b4e[_0x0de1('0x21')]],'as':_0x211b4e['as'],'attributes':_0x211b4e[_0x0de1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0de1('0x27')](function(_0x4b6d07){logger[_0x0de1('0x11')](_0x0de1('0x24'),_0x403200);logger[_0x0de1('0x14')](_0x0de1('0x24'),_0x403200,JSON[_0x0de1('0x16')](_0x4b6d07));_0x3989e2(_0x4b6d07);})[_0x0de1('0x1b')](function(_0x365967){logger[_0x0de1('0x18')](_0x0de1('0x24'),_0x365967[_0x0de1('0x19')],_0x403200);_0x1e411c(_0x27fa93[_0x0de1('0x18')](0x1f4,_0x365967['message']));});});};exports[_0x0de1('0x28')]=function(_0x45240a){var _0xfab056=this;return new Promise(function(_0x318845,_0x2e5740){var _0x5aed47={'body':_0x45240a['body'],'channel':_0x0de1('0x29')};var _0x38a7f1=_[_0x0de1('0x2a')](_[_0x0de1('0x2b')](db[_0x0de1('0x2c')][_0x0de1('0x2d')]),[_0x0de1('0x2e'),_0x0de1('0x2f'),_0x0de1('0x30'),_0x0de1('0x31')]);var _0x44ca5b=![];if(_0x45240a[_0x0de1('0x32')]['id']){delete _0x45240a['body']['id'];}if(_[_0x0de1('0x33')](_0x45240a['body'][_0x0de1('0x34')])){return _0x2e5740(_0xfab056[_0x0de1('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x45240a[_0x0de1('0x32')][_0x0de1('0x32')])||_0x45240a['body'][_0x0de1('0x32')]===''){return _0x2e5740(_0xfab056[_0x0de1('0x18')](0x1f4,_0x0de1('0x35')));}if(_[_0x0de1('0x33')](_0x45240a[_0x0de1('0x32')][_0x0de1('0x36')])){return _0x2e5740(_0xfab056[_0x0de1('0x18')](0x1f4,_0x0de1('0x37')+_0x38a7f1));}if(!_[_0x0de1('0x38')](_0x38a7f1,_0x45240a['body'][_0x0de1('0x36')])){return _0x2e5740(_0xfab056[_0x0de1('0x18')](0x1f4,_0x0de1('0x39')+_0x38a7f1));}var _0x149ccf={};_0x149ccf[_0x45240a[_0x0de1('0x32')][_0x0de1('0x36')]]=_0x45240a[_0x0de1('0x32')]['from'];return db[_0x0de1('0x25')][_0x0de1('0x3a')]({'where':{'id':_0x45240a['account']['id']},'include':[{'model':db[_0x0de1('0x3b')],'as':_0x0de1('0x3c'),'include':[{'model':db[_0x0de1('0x2c')],'as':'Contacts','where':_0x149ccf,'limit':0x1,'order':[[_0x0de1('0x2f'),_0x0de1('0x3d')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x0de1('0x3e')],'as':'Smtp'}]})[_0x0de1('0x27')](function(_0x3f4ea3){if(_0x3f4ea3&&_0x3f4ea3[_0x0de1('0x3c')]){var _0x3fcdc2=_0x3f4ea3[_0x0de1('0x3f')]({'plain':!![]});_0x5aed47['account']=_[_0x0de1('0x40')](_0x3fcdc2,[_0x0de1('0x41'),'List']);_0x5aed47[_0x0de1('0x42')]=_0x3fcdc2[_0x0de1('0x41')];_0x5aed47[_0x0de1('0x43')]=_0x3fcdc2[_0x0de1('0x3c')];_0x5aed47[_0x0de1('0x42')]=_[_0x0de1('0x44')](_0x5aed47['applications'],[_0x0de1('0x45')],['asc']);if(_0x5aed47[_0x0de1('0x46')]&&_0x5aed47['account'][_0x0de1('0x47')]){_0x5aed47[_0x0de1('0x42')][_0x0de1('0x48')]({'id':0x0,'priority':_0x5aed47[_0x0de1('0x42')][_0x0de1('0x49')]+0x1,'app':_0x0de1('0x4a'),'appdata':'autoclose','interval':_0x0de1('0x4b')});}if(_0x5aed47[_0x0de1('0x46')][_0x0de1('0x41')]){delete _0x5aed47[_0x0de1('0x46')][_0x0de1('0x41')];}if(_0x5aed47[_0x0de1('0x46')][_0x0de1('0x3c')]){delete _0x5aed47['account'][_0x0de1('0x3c')];}if(_0x3fcdc2['List'][_0x0de1('0x4c')][_0x0de1('0x49')]){return _0x3fcdc2[_0x0de1('0x3c')][_0x0de1('0x4c')][0x0];}var _0x5eea74=_['defaults'](_0x45240a[_0x0de1('0x32')],{'firstName':_0x45240a[_0x0de1('0x32')]['from'],'ListId':_0x3fcdc2[_0x0de1('0x31')]});_0x5eea74[_0x45240a[_0x0de1('0x32')][_0x0de1('0x36')]]=_0x45240a[_0x0de1('0x32')][_0x0de1('0x34')];return db['CmContact'][_0x0de1('0x4d')](_0x5eea74);}else{throw new Error(_0x0de1('0x4e'));}})[_0x0de1('0x27')](function(_0x300dcb){_0x5aed47[_0x0de1('0x4f')]=_0x300dcb;if(_0x300dcb){if(!_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x50')]){_0x45240a[_0x0de1('0x32')]['message'][_0x0de1('0x50')]=rs['generate']()+'\x20'+_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x34')];}var _0x26eef0={'ContactId':_0x300dcb['id'],'MailAccountId':_0x45240a[_0x0de1('0x46')]['id'],'inReplyTo':_0x45240a[_0x0de1('0x32')]['message'][_0x0de1('0x50')],'to':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')]['from'],'cc':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')]['cc'],'subject':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x51')],'attach':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x52')],'lastMsgAt':moment()['format'](_0x0de1('0x53')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x45240a['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x0de1('0x54'),'attributes':[_0x0de1('0x50')],'where':{'messageId':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')]['inReplyTo']}}]})[_0x0de1('0x27')](function(_0x5c3007){if(_0x5c3007){return[_0x5c3007,![]];}return db[_0x0de1('0x55')][_0x0de1('0x4d')](_0x26eef0)[_0x0de1('0x27')](function(_0x4c1e29){return[_0x4c1e29,!![]];});});}else{throw new Error(_0x0de1('0x56'));}})[_0x0de1('0x57')](function(_0xbd8fac,_0x18dbfb){if(_0xbd8fac){_0x44ca5b=_0x18dbfb;if(!_0x18dbfb){return _0xbd8fac['update']({'inReplyTo':_0x45240a[_0x0de1('0x32')]['message']['messageId'],'to':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x34')],'cc':_0x45240a[_0x0de1('0x32')]['message']['cc'],'subject':_0x45240a['body']['message'][_0x0de1('0x51')],'attach':_0xbd8fac[_0x0de1('0x52')]?_0xbd8fac['attach']:_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x52')],'substatus':null,'substatusAt':moment()['format'](_0x0de1('0x53')),'lastMsgAt':moment()[_0x0de1('0x58')](_0x0de1('0x53')),'lastMsgDirection':'in'});}else{return _0xbd8fac;}}})[_0x0de1('0x27')](function(_0xfac453){_0x5aed47['interaction']=_0xfac453[_0x0de1('0x3f')]({'plain':!![]});_0x5aed47[_0x0de1('0x59')][_0x0de1('0x5a')]=_0x44ca5b;return db[_0x0de1('0x5b')]['create']({'body':_0x45240a[_0x0de1('0x32')][_0x0de1('0x32')],'MailAccountId':_0x45240a[_0x0de1('0x46')]['id'],'MailInteractionId':_0xfac453['id'],'direction':'in','ContactId':_0x5aed47['contact']['id'],'messageId':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x50')],'from':_0x45240a['body']['message']['from'],'to':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')]['to'],'cc':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')]['cc'],'subject':_0x45240a[_0x0de1('0x32')]['message'][_0x0de1('0x51')],'attach':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x52')],'Attachments':_0x45240a['body']['message'][_0x0de1('0x5c')],'originTo':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')]['originTo'],'originCc':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x5d')],'bcc':_0x45240a[_0x0de1('0x32')]['message']['bcc'],'ChatWebsiteId':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x5e')]||null,'originChannel':_0x45240a[_0x0de1('0x32')]['message'][_0x0de1('0x5f')]||_0x0de1('0x60'),'ChatOfflineMessageId':_0x45240a[_0x0de1('0x32')][_0x0de1('0x19')][_0x0de1('0x61')]||null},{'include':[{'model':db[_0x0de1('0x62')],'as':_0x0de1('0x63')}]});})[_0x0de1('0x27')](function(_0x565a20){_0x5aed47['message']=_0x565a20;if(_0x5aed47['interaction'][_0x0de1('0x64')]){return db[_0x0de1('0x65')][_0x0de1('0x3a')]({'attributes':['id',_0x0de1('0x66')],'where':{'id':_0x5aed47[_0x0de1('0x59')][_0x0de1('0x64')]}})[_0x0de1('0x27')](function(_0x6a7364){if(_0x6a7364){_0x5aed47[_0x0de1('0x42')][_0x0de1('0x67')]({'id':0x0,'priority':0x0,'app':_0x0de1('0x68'),'appdata':_0x6a7364[_0x0de1('0x66')]+','+(_0x5aed47[_0x0de1('0x46')]['waitForTheAssignedAgent']||0xa),'interval':_0x0de1('0x4b')});}return respondWithRpcPromise('Start','startRouting',_0x5aed47);});}return respondWithRpcPromise(_0x0de1('0x69'),_0x0de1('0x6a'),_0x5aed47);})[_0x0de1('0x27')](function(_0x2f5d8c){_0x318845(_0x2f5d8c);})[_0x0de1('0x1b')](function(_0x3bd81b){_0x2e5740(_0xfab056['error'](0x1f4,_0x3bd81b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 67709c0..ebe7730 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 _0xa3bb=['length','mailAccount:','./mailAccount.events','save','update','emit','removeListener','register'];(function(_0x4057af,_0x36ce0b){var _0x3f58bf=function(_0x46c554){while(--_0x46c554){_0x4057af['push'](_0x4057af['shift']());}};_0x3f58bf(++_0x36ce0b);}(_0xa3bb,0xd2));var _0xba3b=function(_0x1266bb,_0x38a1d2){_0x1266bb=_0x1266bb-0x0;var _0x2448d9=_0xa3bb[_0x1266bb];return _0x2448d9;};'use strict';var MailAccountEvents=require(_0xba3b('0x0'));var events=[_0xba3b('0x1'),'remove',_0xba3b('0x2')];function createListener(_0x15d518,_0x8652bf){return function(_0x3de044){_0x8652bf[_0xba3b('0x3')](_0x15d518,_0x3de044);};}function removeListener(_0x4b1d5f,_0x32bdad){return function(){MailAccountEvents[_0xba3b('0x4')](_0x4b1d5f,_0x32bdad);};}exports[_0xba3b('0x5')]=function(_0xbd04d5){for(var _0x371869=0x0,_0x65ee44=events[_0xba3b('0x6')];_0x371869<_0x65ee44;_0x371869++){var _0x445c10=events[_0x371869];var _0x504543=createListener(_0xba3b('0x7')+_0x445c10,_0xbd04d5);MailAccountEvents['on'](_0x445c10,_0x504543);}}; \ No newline at end of file +var _0x70f0=['remove','update','removeListener','register','length','mailAccount:','save'];(function(_0x284c05,_0x2793ec){var _0x2c09f9=function(_0x53b988){while(--_0x53b988){_0x284c05['push'](_0x284c05['shift']());}};_0x2c09f9(++_0x2793ec);}(_0x70f0,0x18e));var _0x070f=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x70f0[_0x34a8c8];return _0x1fe6e5;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x070f('0x0'),_0x070f('0x1'),_0x070f('0x2')];function createListener(_0x321db5,_0x5189c1){return function(_0x370078){_0x5189c1['emit'](_0x321db5,_0x370078);};}function removeListener(_0x47414,_0xb1629e){return function(){MailAccountEvents[_0x070f('0x3')](_0x47414,_0xb1629e);};}exports[_0x070f('0x4')]=function(_0x442135){for(var _0x1daaa1=0x0,_0x22179e=events[_0x070f('0x5')];_0x1daaa1<_0x22179e;_0x1daaa1++){var _0x2dd687=events[_0x1daaa1];var _0x2edefa=createListener(_0x070f('0x6')+_0x2dd687,_0x442135);MailAccountEvents['on'](_0x2dd687,_0x2edefa);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 0412716..064b243 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 _0xdcb5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0x3a6194,_0x4574e2){var _0x298116=function(_0x27297c){while(--_0x27297c){_0x3a6194['push'](_0x3a6194['shift']());}};_0x298116(++_0x4574e2);}(_0xdcb5,0x8a));var _0x5dcb=function(_0x85c0b6,_0x449a99){_0x85c0b6=_0x85c0b6-0x0;var _0x1225f7=_0xdcb5[_0x85c0b6];return _0x1225f7;};'use strict';var multer=require(_0x5dcb('0x0'));var util=require(_0x5dcb('0x1'));var path=require(_0x5dcb('0x2'));var timeout=require(_0x5dcb('0x3'));var express=require(_0x5dcb('0x4'));var router=express[_0x5dcb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5dcb('0x6'));var interaction=require(_0x5dcb('0x7'));var config=require(_0x5dcb('0x8'));var controller=require(_0x5dcb('0x9'));router[_0x5dcb('0xa')](_0x5dcb('0xb'),auth[_0x5dcb('0xc')](),controller[_0x5dcb('0xd')]);router[_0x5dcb('0xe')](_0x5dcb('0xb'),auth[_0x5dcb('0xc')](),controller[_0x5dcb('0xf')]);router['delete'](_0x5dcb('0xb'),auth[_0x5dcb('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6122=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','put'];(function(_0xc8f5a3,_0x4a02a5){var _0x55041a=function(_0x43fe7d){while(--_0x43fe7d){_0xc8f5a3['push'](_0xc8f5a3['shift']());}};_0x55041a(++_0x4a02a5);}(_0x6122,0x19d));var _0x2612=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x6122[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require(_0x2612('0x0'));var util=require(_0x2612('0x1'));var path=require(_0x2612('0x2'));var timeout=require(_0x2612('0x3'));var express=require(_0x2612('0x4'));var router=express[_0x2612('0x5')]();var fs_extra=require(_0x2612('0x6'));var auth=require(_0x2612('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2612('0x8'));var controller=require('./mailApplication.controller');router[_0x2612('0x9')]('/:id',auth[_0x2612('0xa')](),controller['show']);router[_0x2612('0xb')]('/:id',auth[_0x2612('0xa')](),controller[_0x2612('0xc')]);router[_0x2612('0xd')](_0x2612('0xe'),auth[_0x2612('0xa')](),controller[_0x2612('0xf')]);module[_0x2612('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 231a2f1..a546b72 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 _0xaa65=['noop','TEXT','STRING'];(function(_0x472396,_0x45e593){var _0x1076a2=function(_0x5a172e){while(--_0x5a172e){_0x472396['push'](_0x472396['shift']());}};_0x1076a2(++_0x45e593);}(_0xaa65,0x194));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5aa6('0x0')],'allowNull':![],'defaultValue':_0x5aa6('0x1')},'appdata':{'type':Sequelize[_0x5aa6('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7b21=['*,*,*,*','sequelize','exports','STRING'];(function(_0x6b717b,_0x3d9046){var _0x49abe4=function(_0x5cfe22){while(--_0x5cfe22){_0x6b717b['push'](_0x6b717b['shift']());}};_0x49abe4(++_0x3d9046);}(_0x7b21,0x159));var _0x17b2=function(_0x52d35c,_0x33fe43){_0x52d35c=_0x52d35c-0x0;var _0x4f0f0b=_0x7b21[_0x52d35c];return _0x4f0f0b;};'use strict';var Sequelize=require(_0x17b2('0x0'));module[_0x17b2('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x17b2('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x17b2('0x2')]},'interval':{'type':Sequelize[_0x17b2('0x2')],'defaultValue':_0x17b2('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9496aa9..2a76c6a 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 _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','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'];(function(_0x17550c,_0x4f9e05){var _0xded30f=function(_0x13045b){while(--_0x13045b){_0x17550c['push'](_0x17550c['shift']());}};_0xded30f(++_0x4f9e05);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5df55a,_0x363d79){_0x5df55a=_0x5df55a-0x0;var _0x276aef=_0x9bde[_0x5df55a];return _0x276aef;};'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'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3a1e42,_0xb37717){var _0x1b29d5=function(_0x2ede9c){while(--_0x2ede9c){_0x3a1e42['push'](_0x3a1e42['shift']());}};_0x1b29d5(++_0xb37717);}(_0x54ef,0x112));var _0xf54e=function(_0x172b00,_0x6d3e09){_0x172b00=_0x172b00-0x0;var _0x5cf7dd=_0x54ef[_0x172b00];return _0x5cf7dd;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 8fe18b1..05ff1c6 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 _0x0209=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','lodash'];(function(_0x4e1ab6,_0x411385){var _0x293a9a=function(_0x16f2d5){while(--_0x16f2d5){_0x4e1ab6['push'](_0x4e1ab6['shift']());}};_0x293a9a(++_0x411385);}(_0x0209,0x8e));var _0x9020=function(_0x23a55a,_0x4dd78d){_0x23a55a=_0x23a55a-0x0;var _0xcc98f2=_0x0209[_0x23a55a];return _0xcc98f2;};'use strict';var _=require(_0x9020('0x0'));var util=require(_0x9020('0x1'));var logger=require(_0x9020('0x2'))(_0x9020('0x3'));var moment=require(_0x9020('0x4'));var BPromise=require('bluebird');var rp=require(_0x9020('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9020('0x6'));var config=require(_0x9020('0x7'));var attributes=require(_0x9020('0x8'));module[_0x9020('0x9')]=function(_0x20853d,_0xaaca8f){return _0x20853d[_0x9020('0xa')](_0x9020('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9020('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x346f=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash'];(function(_0x5dda56,_0x317b90){var _0x294f8d=function(_0x5ee55a){while(--_0x5ee55a){_0x5dda56['push'](_0x5dda56['shift']());}};_0x294f8d(++_0x317b90);}(_0x346f,0x8f));var _0xf346=function(_0x4135e9,_0x3a9d97){_0x4135e9=_0x4135e9-0x0;var _0x270a6a=_0x346f[_0x4135e9];return _0x270a6a;};'use strict';var _=require(_0xf346('0x0'));var util=require(_0xf346('0x1'));var logger=require(_0xf346('0x2'))(_0xf346('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf346('0x4'));var fs=require('fs');var path=require(_0xf346('0x5'));var rimraf=require(_0xf346('0x6'));var config=require(_0xf346('0x7'));var attributes=require('./mailApplication.attributes');module[_0xf346('0x8')]=function(_0x5a80ca,_0x19ba94){return _0x5a80ca['define'](_0xf346('0x9'),attributes,{'tableName':_0xf346('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf346('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c58f394..9b8fc39 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 _0xd1eb=['error','code','MailApplication,\x20%s,\x20%s','message','info','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1438d5,_0x671126){var _0x4ff4a4=function(_0x4889dd){while(--_0x4889dd){_0x1438d5['push'](_0x1438d5['shift']());}};_0x4ff4a4(++_0x671126);}(_0xd1eb,0xc3));var _0xbd1e=function(_0x429eac,_0x2c7b44){_0x429eac=_0x429eac-0x0;var _0x5339fa=_0xd1eb[_0x429eac];return _0x5339fa;};'use strict';var _=require(_0xbd1e('0x0'));var util=require(_0xbd1e('0x1'));var moment=require(_0xbd1e('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd1e('0x4'));var logger=require(_0xbd1e('0x5'))(_0xbd1e('0x6'));var config=require(_0xbd1e('0x7'));var jayson=require(_0xbd1e('0x8'));var client=jayson[_0xbd1e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5e0b,_0x2c5fd3,_0x3934dc){return new BPromise(function(_0x36776c,_0x5d44e){return client[_0xbd1e('0xa')](_0x4a5e0b,_0x3934dc)[_0xbd1e('0xb')](function(_0x221bf4){logger['info']('MailApplication,\x20%s,\x20%s',_0x2c5fd3,_0xbd1e('0xc'));logger[_0xbd1e('0xd')](_0xbd1e('0xe'),_0x2c5fd3,_0xbd1e('0xc'),JSON['stringify'](_0x221bf4));if(_0x221bf4[_0xbd1e('0xf')]){if(_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x10')]===0x1f4){logger[_0xbd1e('0xf')](_0xbd1e('0x11'),_0x2c5fd3,_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);return _0x5d44e(_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);}logger[_0xbd1e('0xf')](_0xbd1e('0x11'),_0x2c5fd3,_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);return _0x36776c(_0x221bf4[_0xbd1e('0xf')][_0xbd1e('0x12')]);}else{logger[_0xbd1e('0x13')]('MailApplication,\x20%s,\x20%s',_0x2c5fd3,_0xbd1e('0xc'));_0x36776c(_0x221bf4['result'][_0xbd1e('0x12')]);}})[_0xbd1e('0x14')](function(_0x525980){logger[_0xbd1e('0xf')](_0xbd1e('0x11'),_0x2c5fd3,_0x525980);_0x5d44e(_0x525980);});});}exports[_0xbd1e('0x15')]=function(_0x211978){var _0x55c126=this;return new Promise(function(_0x1fb242,_0x4cb77b){return db[_0xbd1e('0x16')][_0xbd1e('0x17')](_0x211978[_0xbd1e('0x18')],{'raw':_0x211978[_0xbd1e('0x19')]?_0x211978[_0xbd1e('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x211978[_0xbd1e('0x19')]?_0x211978[_0xbd1e('0x19')][_0xbd1e('0x1a')]||null:null,'attributes':_0x211978[_0xbd1e('0x19')]?_0x211978[_0xbd1e('0x19')][_0xbd1e('0x1b')]||null:null,'limit':_0x211978[_0xbd1e('0x19')]?_0x211978[_0xbd1e('0x19')][_0xbd1e('0x1c')]||null:null})[_0xbd1e('0xb')](function(_0x460a2c){logger[_0xbd1e('0x13')]('UpdateMailApplication',_0x211978);logger['debug'](_0xbd1e('0x15'),_0x211978,JSON[_0xbd1e('0x1d')](_0x460a2c));_0x1fb242(_0x460a2c);})[_0xbd1e('0x14')](function(_0x4ef8d9){logger[_0xbd1e('0xf')](_0xbd1e('0x15'),_0x4ef8d9['message'],_0x211978);_0x4cb77b(_0x55c126[_0xbd1e('0xf')](0x1f4,_0x4ef8d9[_0xbd1e('0x12')]));});});}; \ No newline at end of file +var _0xbf3a=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication,\x20%s,\x20%s','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','limit','debug','catch'];(function(_0x5c5e3f,_0x2720f6){var _0x28bdec=function(_0x2ab646){while(--_0x2ab646){_0x5c5e3f['push'](_0x5c5e3f['shift']());}};_0x28bdec(++_0x2720f6);}(_0xbf3a,0x193));var _0xabf3=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xbf3a[_0x3818c0];return _0x55ec33;};'use strict';var _=require(_0xabf3('0x0'));var util=require('util');var moment=require(_0xabf3('0x1'));var BPromise=require(_0xabf3('0x2'));var rs=require(_0xabf3('0x3'));var fs=require('fs');var Redis=require(_0xabf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabf3('0x5'));var logger=require(_0xabf3('0x6'))(_0xabf3('0x7'));var config=require(_0xabf3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabf3('0x9')][_0xabf3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38c49f,_0x29b4e1,_0x327034){return new BPromise(function(_0x28b68b,_0x3ad527){return client[_0xabf3('0xb')](_0x38c49f,_0x327034)[_0xabf3('0xc')](function(_0x1c6b6d){logger[_0xabf3('0xd')]('MailApplication,\x20%s,\x20%s',_0x29b4e1,_0xabf3('0xe'));logger['debug'](_0xabf3('0xf'),_0x29b4e1,_0xabf3('0xe'),JSON[_0xabf3('0x10')](_0x1c6b6d));if(_0x1c6b6d[_0xabf3('0x11')]){if(_0x1c6b6d[_0xabf3('0x11')][_0xabf3('0x12')]===0x1f4){logger[_0xabf3('0x11')]('MailApplication,\x20%s,\x20%s',_0x29b4e1,_0x1c6b6d[_0xabf3('0x11')]['message']);return _0x3ad527(_0x1c6b6d[_0xabf3('0x11')][_0xabf3('0x13')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x29b4e1,_0x1c6b6d[_0xabf3('0x11')][_0xabf3('0x13')]);return _0x28b68b(_0x1c6b6d['error']['message']);}else{logger[_0xabf3('0xd')](_0xabf3('0x14'),_0x29b4e1,_0xabf3('0xe'));_0x28b68b(_0x1c6b6d['result'][_0xabf3('0x13')]);}})['catch'](function(_0x24affb){logger['error'](_0xabf3('0x14'),_0x29b4e1,_0x24affb);_0x3ad527(_0x24affb);});});}exports[_0xabf3('0x15')]=function(_0x1779e0){var _0x3756f4=this;return new Promise(function(_0x516be0,_0x314c0b){return db[_0xabf3('0x16')][_0xabf3('0x17')](_0x1779e0['body'],{'raw':_0x1779e0[_0xabf3('0x18')]?_0x1779e0[_0xabf3('0x18')][_0xabf3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1779e0['options']?_0x1779e0['options'][_0xabf3('0x1a')]||null:null,'attributes':_0x1779e0[_0xabf3('0x18')]?_0x1779e0['options'][_0xabf3('0x1b')]||null:null,'limit':_0x1779e0[_0xabf3('0x18')]?_0x1779e0[_0xabf3('0x18')][_0xabf3('0x1c')]||null:null})[_0xabf3('0xc')](function(_0x186d9e){logger[_0xabf3('0xd')](_0xabf3('0x15'),_0x1779e0);logger[_0xabf3('0x1d')]('UpdateMailApplication',_0x1779e0,JSON[_0xabf3('0x10')](_0x186d9e));_0x516be0(_0x186d9e);})[_0xabf3('0x1e')](function(_0x57400a){logger[_0xabf3('0x11')](_0xabf3('0x15'),_0x57400a['message'],_0x1779e0);_0x314c0b(_0x3756f4[_0xabf3('0x11')](0x1f4,_0x57400a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 864c271..a8f05d0 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 _0x7a6f=['getMessages','/:id/download','download','create','post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x27097a,_0x1b7f8b){var _0x26378b=function(_0x39f8f8){while(--_0x39f8f8){_0x27097a['push'](_0x27097a['shift']());}};_0x26378b(++_0x1b7f8b);}(_0x7a6f,0x148));var _0xf7a6=function(_0x117bac,_0x5df9a1){_0x117bac=_0x117bac-0x0;var _0x448f72=_0x7a6f[_0x117bac];return _0x448f72;};'use strict';var express=require(_0xf7a6('0x0'));var router=express[_0xf7a6('0x1')]();var auth=require(_0xf7a6('0x2'));var interaction=require(_0xf7a6('0x3'));var controller=require(_0xf7a6('0x4'));router[_0xf7a6('0x5')]('/',auth[_0xf7a6('0x6')](),controller[_0xf7a6('0x7')]);router[_0xf7a6('0x5')](_0xf7a6('0x8'),auth[_0xf7a6('0x6')](),controller[_0xf7a6('0x9')]);router[_0xf7a6('0x5')](_0xf7a6('0xa'),auth[_0xf7a6('0x6')](),controller[_0xf7a6('0xb')]);router[_0xf7a6('0x5')](_0xf7a6('0xc'),auth[_0xf7a6('0x6')](),controller[_0xf7a6('0xd')]);router[_0xf7a6('0x5')](_0xf7a6('0xe'),auth['isAuthenticated'](),controller[_0xf7a6('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf7a6('0x10')]);router[_0xf7a6('0x11')](_0xf7a6('0xc'),auth[_0xf7a6('0x6')](),controller[_0xf7a6('0x12')]);router[_0xf7a6('0x11')](_0xf7a6('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0xf7a6('0x14'),_0xf7a6('0x15')),controller[_0xf7a6('0x16')]);router[_0xf7a6('0x17')](_0xf7a6('0xa'),auth[_0xf7a6('0x6')](),interaction[_0xf7a6('0x18')](_0xf7a6('0x14'),_0xf7a6('0x19')),controller[_0xf7a6('0x1a')]);router[_0xf7a6('0x1b')]('/:id',auth[_0xf7a6('0x6')](),interaction[_0xf7a6('0x18')](_0xf7a6('0x14'),'mailinteraction:destroy'),controller[_0xf7a6('0x1c')]);router[_0xf7a6('0x1b')](_0xf7a6('0x13'),auth[_0xf7a6('0x6')](),controller[_0xf7a6('0x1d')]);module[_0xf7a6('0x1e')]=router; \ No newline at end of file +var _0x1f7d=['removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','mail','addTags','/:id','mailinteraction:update','update','delete','destroy'];(function(_0x30b9aa,_0x2408ba){var _0x5d4f99=function(_0x50238a){while(--_0x50238a){_0x30b9aa['push'](_0x30b9aa['shift']());}};_0x5d4f99(++_0x2408ba);}(_0x1f7d,0x1b2));var _0xd1f7=function(_0x15a9cf,_0x5cdbd7){_0x15a9cf=_0x15a9cf-0x0;var _0x2716a5=_0x1f7d[_0x15a9cf];return _0x2716a5;};'use strict';var express=require(_0xd1f7('0x0'));var router=express[_0xd1f7('0x1')]();var auth=require(_0xd1f7('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xd1f7('0x3'));router[_0xd1f7('0x4')]('/',auth[_0xd1f7('0x5')](),controller[_0xd1f7('0x6')]);router[_0xd1f7('0x4')](_0xd1f7('0x7'),auth[_0xd1f7('0x5')](),controller[_0xd1f7('0x8')]);router['get']('/:id',auth[_0xd1f7('0x5')](),controller['show']);router[_0xd1f7('0x4')](_0xd1f7('0x9'),auth[_0xd1f7('0x5')](),controller[_0xd1f7('0xa')]);router['get'](_0xd1f7('0xb'),auth[_0xd1f7('0x5')](),controller[_0xd1f7('0xc')]);router['post']('/',auth[_0xd1f7('0x5')](),controller[_0xd1f7('0xd')]);router['post'](_0xd1f7('0x9'),auth[_0xd1f7('0x5')](),controller[_0xd1f7('0xe')]);router[_0xd1f7('0xf')](_0xd1f7('0x10'),auth[_0xd1f7('0x5')](),interaction[_0xd1f7('0x11')](_0xd1f7('0x12'),'mailinteraction:addtags'),controller[_0xd1f7('0x13')]);router['put'](_0xd1f7('0x14'),auth['isAuthenticated'](),interaction[_0xd1f7('0x11')](_0xd1f7('0x12'),_0xd1f7('0x15')),controller[_0xd1f7('0x16')]);router[_0xd1f7('0x17')](_0xd1f7('0x14'),auth[_0xd1f7('0x5')](),interaction[_0xd1f7('0x11')](_0xd1f7('0x12'),'mailinteraction:destroy'),controller[_0xd1f7('0x18')]);router[_0xd1f7('0x17')]('/:id/tags',auth[_0xd1f7('0x5')](),controller[_0xd1f7('0x19')]);module[_0xd1f7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 6f737a7..69ca217 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 _0xfd69=['TEXT','long','ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x17870c,_0x2d4610){var _0xb81c8d=function(_0x574db0){while(--_0x574db0){_0x17870c['push'](_0x17870c['shift']());}};_0xb81c8d(++_0x2d4610);}(_0xfd69,0x124));var _0x9fd6=function(_0x3751a9,_0x100d68){_0x3751a9=_0x3751a9-0x0;var _0x5696f1=_0xfd69[_0x3751a9];return _0x5696f1;};'use strict';var Sequelize=require(_0x9fd6('0x0'));var iconv=require('iconv');module[_0x9fd6('0x1')]={'closed':{'type':Sequelize[_0x9fd6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9fd6('0x3')]},'disposition':{'type':Sequelize[_0x9fd6('0x4')]},'secondDisposition':{'type':Sequelize[_0x9fd6('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9fd6('0x4')]},'note':{'type':Sequelize[_0x9fd6('0x4')]},'inReplyTo':{'type':Sequelize[_0x9fd6('0x4')](0x1fe)},'to':{'type':Sequelize[_0x9fd6('0x4')]},'cc':{'type':Sequelize[_0x9fd6('0x5')](_0x9fd6('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x9fd6('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x9fd6('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x9fd6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9fd6('0x7')]('in',_0x9fd6('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9fd6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9fd6('0x7')]('in',_0x9fd6('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9fd6('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x43b8=['out','sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0xc3a00c,_0x11be1d){var _0x4bcc1d=function(_0x33b107){while(--_0x33b107){_0xc3a00c['push'](_0xc3a00c['shift']());}};_0x4bcc1d(++_0x11be1d);}(_0x43b8,0x13c));var _0x843b=function(_0x57d135,_0x48a49b){_0x57d135=_0x57d135-0x0;var _0x239119=_0x43b8[_0x57d135];return _0x239119;};'use strict';var Sequelize=require(_0x843b('0x0'));var iconv=require(_0x843b('0x1'));module['exports']={'closed':{'type':Sequelize[_0x843b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x843b('0x3')]},'disposition':{'type':Sequelize[_0x843b('0x4')]},'secondDisposition':{'type':Sequelize[_0x843b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x843b('0x4')]},'note':{'type':Sequelize[_0x843b('0x4')]},'inReplyTo':{'type':Sequelize[_0x843b('0x4')](0x1fe)},'to':{'type':Sequelize[_0x843b('0x4')]},'cc':{'type':Sequelize[_0x843b('0x5')](_0x843b('0x6'))},'subject':{'type':Sequelize[_0x843b('0x5')]()},'attach':{'type':Sequelize[_0x843b('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x843b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x843b('0x7')]('in',_0x843b('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x843b('0x7')]('in',_0x843b('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x843b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 5901765..e60470f 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 _0xa5c2=['o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','show','params','includeAll','include','options','create','body','describe','addMessage','ids','getMessages','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','omit','spread','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','Messages','get','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','eml-format','rimraf','zip-dir','moment','util','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','limit','count','set','update','destroy','then','error','stack','name','map','fullname','TagIds','split','forEach','push','MailMessage','findOne','plainBody','trimStart','catch','index','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','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','end','Tag','union','$substring','text','start','some','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','MailInteraction','a.mandatoryDisposition','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','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax'];(function(_0x208c01,_0x2dd63d){var _0x54a5fc=function(_0x35120d){while(--_0x35120d){_0x208c01['push'](_0x208c01['shift']());}};_0x54a5fc(++_0x2dd63d);}(_0xa5c2,0x1ea));var _0x2a5c=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0xa5c2[_0xc7348b];return _0x307cec;};'use strict';var emlformat=require(_0x2a5c('0x0'));var rimraf=require(_0x2a5c('0x1'));var zipdir=require(_0x2a5c('0x2'));var moment=require(_0x2a5c('0x3'));var BPromise=require('bluebird');var util=require(_0x2a5c('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x2a5c('0x5'));var squel=require(_0x2a5c('0x6'));var juice=require(_0x2a5c('0x7'));var Redis=require('ioredis');var qs=require(_0x2a5c('0x8'));var as=require(_0x2a5c('0x9'));var logger=require(_0x2a5c('0xa'))('api');var config=require(_0x2a5c('0xb'));var db=require(_0x2a5c('0xc'))['db'];var htmlEntities=require(_0x2a5c('0xd'));config[_0x2a5c('0xe')]=_[_0x2a5c('0xf')](config[_0x2a5c('0xe')],{'host':_0x2a5c('0x10'),'port':0x18eb});var socket=require(_0x2a5c('0x11'))(new Redis(config[_0x2a5c('0xe')]));require(_0x2a5c('0x12'))[_0x2a5c('0x13')](socket);function respondWithStatusCode(_0x2fac2e,_0x2371ab){_0x2371ab=_0x2371ab||0xcc;return function(_0x3fdde1){if(_0x3fdde1){return _0x2fac2e[_0x2a5c('0x14')](_0x2371ab);}return _0x2fac2e[_0x2a5c('0x15')](_0x2371ab)['end']();};}function respondWithResult(_0x1c944e,_0x324c4a){_0x324c4a=_0x324c4a||0xc8;return function(_0x11a915){if(_0x11a915){return _0x1c944e['status'](_0x324c4a)[_0x2a5c('0x16')](_0x11a915);}};}function respondWithFilteredResult(_0x58dc6d,_0x3bb3bb){return function(_0x45c6a3){if(_0x45c6a3){var _0x5af799=typeof _0x3bb3bb[_0x2a5c('0x17')]==='undefined'&&typeof _0x3bb3bb[_0x2a5c('0x18')]==='undefined';var _0x1e0a63=_0x45c6a3['count'];var _0x1fbfb6=_0x5af799?0x0:_0x3bb3bb[_0x2a5c('0x17')];var _0x566946=_0x5af799?_0x45c6a3[_0x2a5c('0x19')]:_0x3bb3bb[_0x2a5c('0x17')]+_0x3bb3bb[_0x2a5c('0x18')];var _0x2efed7;if(_0x566946>=_0x1e0a63){_0x566946=_0x1e0a63;_0x2efed7=0xc8;}else{_0x2efed7=0xce;}_0x58dc6d[_0x2a5c('0x15')](_0x2efed7);return _0x58dc6d[_0x2a5c('0x1a')]('Content-Range',_0x1fbfb6+'-'+_0x566946+'/'+_0x1e0a63)[_0x2a5c('0x16')](_0x45c6a3);}return null;};}function saveUpdates(_0x7c7fac){return function(_0x3dad77){if(_0x3dad77){return _0x3dad77[_0x2a5c('0x1b')](_0x7c7fac)['then'](function(_0x3ec70d){return _0x3ec70d;});}return null;};}function removeEntity(_0x57f54e){return function(_0x28579e){if(_0x28579e){return _0x28579e[_0x2a5c('0x1c')]()[_0x2a5c('0x1d')](function(){_0x57f54e[_0x2a5c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8224){return function(_0x252950){if(!_0x252950){_0x2b8224[_0x2a5c('0x14')](0x194);}return _0x252950;};}function handleError(_0xdc7855,_0x37c6da){_0x37c6da=_0x37c6da||0x1f4;return function(_0xa9db4b){logger[_0x2a5c('0x1e')](_0xa9db4b[_0x2a5c('0x1f')]);if(_0xa9db4b[_0x2a5c('0x20')]){delete _0xa9db4b[_0x2a5c('0x20')];}_0xdc7855[_0x2a5c('0x15')](_0x37c6da)['send'](_0xa9db4b);};}function getInteractionUsers(_0x4b5f9e,_0x2a934d){return new BPromise(function(_0x14e1e0,_0x3039d7){try{if(_0x2a934d[_0x4b5f9e['id']]){_0x4b5f9e['Users']=_[_0x2a5c('0x21')](_0x2a934d[_0x4b5f9e['id']],function(_0x1fcb5f){return{'id':_0x1fcb5f['id'],'fullname':_0x1fcb5f[_0x2a5c('0x22')]};});}}catch(_0x5d0bdf){_0x3039d7(_0x5d0bdf);}_0x14e1e0(_0x4b5f9e);});}function getInteractionTags(_0x49e3a3,_0x2cfd1a){return new BPromise(function(_0x5e6632,_0x160004){try{if(_0x49e3a3[_0x2a5c('0x23')]){_0x49e3a3['Tags']=[];_0x49e3a3[_0x2a5c('0x23')][_0x2a5c('0x24')](',')[_0x2a5c('0x25')](function(_0x1aafde){_0x49e3a3['Tags'][_0x2a5c('0x26')](_0x2cfd1a[_0x1aafde]);});}delete _0x49e3a3[_0x2a5c('0x23')];}catch(_0x14f1d4){_0x160004(_0x14f1d4);}_0x5e6632(_0x49e3a3);});}function getLastMessageText(_0x175fef){return new BPromise(function(_0x2e3233,_0x62f025){return db[_0x2a5c('0x27')][_0x2a5c('0x28')]({'where':{'$and':[{'MailInteractionId':_0x175fef['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x2a5c('0x1d')](function(_0x178469){if(_0x178469&&_0x178469[_0x2a5c('0x29')]){_0x175fef['lastMsgText']=_[_0x2a5c('0x2a')](_0x178469[_0x2a5c('0x29')]);}_0x2e3233(_0x175fef);})[_0x2a5c('0x2b')](function(_0xdf0b3b){_0x62f025(_0xdf0b3b);});});}function updateMailInteraction(_0x57d256,_0x9b7652,_0x5a8bb4,_0x4b4b99){return new BPromise(function(_0x4a7f01,_0x2f406c){return getInteractionUsers(_0x57d256,_0x5a8bb4)['then'](function(_0x2bbdb6){return getInteractionTags(_0x2bbdb6,_0x9b7652);})[_0x2a5c('0x1d')](function(_0x1cc38e){if(_0x4b4b99){_0x4a7f01(getLastMessageText(_0x1cc38e));}else{_0x4a7f01(_0x1cc38e);}})[_0x2a5c('0x2b')](function(_0x2983f9){_0x2f406c(_0x2983f9);});});}exports[_0x2a5c('0x2c')]=function(_0x19d918,_0x439022){var _0x304955={},_0x4b2748={},_0x1b30a8={'count':0x0,'rows':[]};var _0x681b97=_[_0x2a5c('0x21')](db['MailInteraction'][_0x2a5c('0x2d')],function(_0x463bff){return{'name':_0x463bff[_0x2a5c('0x2e')],'type':_0x463bff[_0x2a5c('0x2f')][_0x2a5c('0x30')]};});_0x4b2748['model']=_[_0x2a5c('0x21')](_0x681b97,_0x2a5c('0x20'));_0x4b2748['query']=_[_0x2a5c('0x31')](_0x19d918[_0x2a5c('0x32')]);_0x4b2748[_0x2a5c('0x33')]=_[_0x2a5c('0x34')](_0x4b2748[_0x2a5c('0x35')],_0x4b2748[_0x2a5c('0x32')]);_0x304955['attributes']=_[_0x2a5c('0x34')](_0x4b2748[_0x2a5c('0x35')],qs[_0x2a5c('0x36')](_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x36')]));_0x304955['attributes']=_0x304955[_0x2a5c('0x37')][_0x2a5c('0x38')]?_0x304955[_0x2a5c('0x37')]:_0x4b2748[_0x2a5c('0x35')];if(!_0x19d918[_0x2a5c('0x32')]['hasOwnProperty'](_0x2a5c('0x39'))){_0x304955[_0x2a5c('0x18')]=qs['limit'](_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x18')]);_0x304955['offset']=qs['offset'](_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x17')]);}_0x304955[_0x2a5c('0x3a')]=qs[_0x2a5c('0x3b')](_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x3b')]);_0x304955[_0x2a5c('0x3c')]=qs[_0x2a5c('0x33')](_[_0x2a5c('0x3d')](_0x19d918['query'],_0x4b2748[_0x2a5c('0x33')]),_0x681b97);var _0x5740e8=[];var _0x5608c1=squel[_0x2a5c('0x3e')]()[_0x2a5c('0x3f')]('id')[_0x2a5c('0x3f')](_0x2a5c('0x20'))[_0x2a5c('0x3f')](_0x2a5c('0x40'))[_0x2a5c('0x41')](_0x2a5c('0x42'));var _0x2ff039=squel['select']()['field'](_0x2a5c('0x43'))[_0x2a5c('0x3f')](_0x2a5c('0x44'))['field'](_0x2a5c('0x45'))['from']('user_has_mail_interactions','ui')[_0x2a5c('0x46')](_0x2a5c('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x9fad95=squel[_0x2a5c('0x3e')]()['from'](_0x2a5c('0x48'),'i')[_0x2a5c('0x46')]('cm_contacts','c',_0x2a5c('0x49'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join']('mail_accounts','a',_0x2a5c('0x4a'))[_0x2a5c('0x46')](_0x2a5c('0x4b'),'me','me.MailInteractionId\x20=\x20i.id')[_0x2a5c('0x46')](_0x2a5c('0x4c'),'it','it.MailInteractionId\x20=\x20i.id')[_0x2a5c('0x46')](_0x2a5c('0x42'),'t',_0x2a5c('0x4d'));var _0x5c6496=squel['expr']();var _0x5c20f7=[];var _0xac13d2=squel[_0x2a5c('0x4e')]();var _0x4c436e;if(_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x4f')]){_0x4c436e=as['parseSearch'](_0x19d918['query'][_0x2a5c('0x4f')]);var _0x12d1d6=_0x4c436e['sqlOperator'];for(var _0x3a40eb=0x0;_0x3a40eb<_0x4c436e[_0x2a5c('0x50')][_0x2a5c('0x38')];_0x3a40eb++){var _0x498a4a=_0x4c436e[_0x2a5c('0x50')][_0x3a40eb];var _0x15928c='i';var _0x23352c=_[_0x2a5c('0x51')](_0x681b97,[_0x2a5c('0x20'),_0x498a4a[_0x2a5c('0x3f')]]);if(!_0x23352c){switch(_0x498a4a[_0x2a5c('0x3f')]){case _0x2a5c('0x52'):if(_0x498a4a[_0x2a5c('0x53')]==0x1){_0x9fad95[_0x2a5c('0x54')]('`'+_0x498a4a[_0x2a5c('0x3f')]+_0x2a5c('0x55'));}else{_0x9fad95['having']('`'+_0x498a4a[_0x2a5c('0x3f')]+_0x2a5c('0x56'));}break;case _0x2a5c('0x57'):if(_0x498a4a['operator']==='$substring'){if(_0x498a4a[_0x2a5c('0x53')][_0x2a5c('0x24')]('\x20')[_0x2a5c('0x38')]>0x1){_0x5c6496[_0x12d1d6](_0x2a5c('0x58'),qs[_0x2a5c('0x59')](_0x498a4a[_0x2a5c('0x53')]),null);}else{var _0x1500b9='%'+_0x498a4a[_0x2a5c('0x53')]+'%';_0x5c6496[_0x12d1d6](_0x2a5c('0x5a'),_0x1500b9,_0x1500b9,_0x1500b9);}}else{_0x23352c=_[_0x2a5c('0x51')](_0x681b97,[_0x2a5c('0x20'),'ContactId']);_0x498a4a['field']=_0x2a5c('0x5b');_0x181e24=as[_0x2a5c('0x5c')](_0x15928c,_0x23352c[_0x2a5c('0x2f')],_0x498a4a);_0x5c6496[_0x12d1d6](_0x181e24['text'],_0x181e24[_0x2a5c('0x53')]['start'],_0x181e24[_0x2a5c('0x53')][_0x2a5c('0x5d')]);}break;case _0x2a5c('0x5e'):var _0x3281ec=_0x498a4a['value'][_0x2a5c('0x24')](',')['map'](function(_0x393339){return Number(_0x393339);});_0x3281ec[_0x2a5c('0x25')](function(_0x4371ec){_0xac13d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4371ec+',%');});_0x5c20f7=_[_0x2a5c('0x5f')](_0x5c20f7,_0x3281ec);break;case'User':if(_0x498a4a['operator']===_0x2a5c('0x60')){_0x5c6496[_0x12d1d6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x498a4a[_0x2a5c('0x53')]+'%',null);}else{_0x23352c=_[_0x2a5c('0x51')](_0x681b97,[_0x2a5c('0x20'),'UserId']);_0x498a4a[_0x2a5c('0x3f')]='UserId';_0x181e24=as[_0x2a5c('0x5c')](_0x15928c,_0x23352c['type'],_0x498a4a);_0x5c6496[_0x12d1d6](_0x181e24[_0x2a5c('0x61')],_0x181e24[_0x2a5c('0x53')][_0x2a5c('0x62')],_0x181e24[_0x2a5c('0x53')]['end']);}break;case _0x2a5c('0x29'):_0x181e24=as[_0x2a5c('0x5c')]('me',null,_0x498a4a);_0x5c6496[_0x12d1d6](_0x181e24['text'],_0x181e24['value'][_0x2a5c('0x62')],_0x181e24[_0x2a5c('0x53')][_0x2a5c('0x5d')]);break;}}else{var _0x181e24=as[_0x2a5c('0x5c')](_0x15928c,_0x23352c[_0x2a5c('0x2f')],_0x498a4a);_0x5c6496[_0x12d1d6](_0x181e24[_0x2a5c('0x61')],_0x181e24['value']['start'],_0x181e24[_0x2a5c('0x53')][_0x2a5c('0x5d')]);}}}else{var _0x6b0d37=_(_0x19d918['query'])['keys']()[_0x2a5c('0x21')](function(_0x563ff8){return _[_0x2a5c('0x63')](_0x681b97,['name',_0x563ff8])?_0x563ff8:undefined;})['compact']()[_0x2a5c('0x53')]();if(!_['isEmpty'](_0x6b0d37)){_0x6b0d37[_0x2a5c('0x25')](function(_0x4c1cb5){if(_0x4c1cb5===_0x2a5c('0x64')){_0x9fad95['where'](_0x2a5c('0x65'),[][_0x2a5c('0x66')](_0x19d918[_0x2a5c('0x32')][_0x4c1cb5]));}else if(_0x4c1cb5===_0x2a5c('0x67')){var _0x592307=JSON['parse'](_0x19d918[_0x2a5c('0x32')][_0x4c1cb5])[_0x2a5c('0x68')];var _0x4f000c=JSON[_0x2a5c('0x69')](_0x19d918[_0x2a5c('0x32')][_0x4c1cb5])['$lte'];_0x9fad95[_0x2a5c('0x3c')](_0x2a5c('0x6a'),_0x592307,_0x4f000c);}else{if(_0x19d918['query'][_0x4c1cb5]===_0x2a5c('0x6b')){_0x9fad95['where']('i.'+_0x4c1cb5+_0x2a5c('0x6c'));}else{_0x9fad95[_0x2a5c('0x3c')]('i.'+_0x4c1cb5+_0x2a5c('0x6d'),_0x19d918[_0x2a5c('0x32')][_0x4c1cb5]);}}});}if(_0x19d918[_0x2a5c('0x32')]['read']){if(_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x6e')]==0x1){_0x9fad95[_0x2a5c('0x54')](_0x2a5c('0x6f'));}else{_0x9fad95['having'](_0x2a5c('0x70'));}}if(_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x71')]){_0x5c20f7=_[_0x2a5c('0x72')](_0x19d918[_0x2a5c('0x32')]['tag'])?_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x71')]:new Array(_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x71')]);_0x5c20f7[_0x2a5c('0x25')](function(_0x5cbc37){_0xac13d2['or'](_0x2a5c('0x73'),'%,'+_0x5cbc37+',%');});}if(_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x74')]){var _0x5af529=_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x74')][_0x2a5c('0x75')]('\x5c','\x5c\x5c')[_0x2a5c('0x75')](/'/g,'\x27\x27');if(qs[_0x2a5c('0x76')](_0x5af529)){_0x5c6496['or']('i.id\x20LIKE\x20?',_0x5af529+'%');}else if(qs[_0x2a5c('0x77')](_0x5af529)){_0x5c6496['or'](_0x2a5c('0x78'),_0x5af529+'%');}else{_0x5c6496['or'](_0x2a5c('0x79'),qs[_0x2a5c('0x59')](_0x5af529))['or'](_0x2a5c('0x7a'),qs['getFullTextValue'](_0x5af529));}}}_0x9fad95[_0x2a5c('0x3c')](_0x5c6496);_0x9fad95[_0x2a5c('0x7b')](_0x2a5c('0x7c'));var _0x3f2038={'type':db[_0x2a5c('0x7d')][_0x2a5c('0x7e')][_0x2a5c('0x7f')],'raw':!![]};var _0x4c71a6=_0x9fad95[_0x2a5c('0x80')]();_0x4c71a6[_0x2a5c('0x3f')](_0x2a5c('0x7c'));_0x4c71a6[_0x2a5c('0x3f')](_0x2a5c('0x81'),_0x2a5c('0x52'));if(_0x304955[_0x2a5c('0x3a')]){_0x304955[_0x2a5c('0x3a')][_0x2a5c('0x25')](function(_0x2208bb){var _0x21c926=_0x2208bb[0x0]===_0x2a5c('0x82')?_0x2208bb[0x0]:'i.'+_0x2208bb[0x0];_0x9fad95[_0x2a5c('0x3a')](_0x21c926,_0x2208bb[0x1]===_0x2a5c('0x83')?![]:!![]);});}if(!_[_0x2a5c('0x84')](_0x5c20f7)){_0x9fad95[_0x2a5c('0x54')](_0xac13d2);_0x4c71a6[_0x2a5c('0x3c')](_0x2a5c('0x85'),_0x5c20f7);}BPromise[_0x2a5c('0x86')]()[_0x2a5c('0x1d')](function(){if(!_0x4c436e){if(_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x64')])return;_0x4c71a6['where'](_0x2a5c('0x87'));_0x9fad95[_0x2a5c('0x3c')](_0x2a5c('0x87'));return;}if(_0x19d918['user'][_0x2a5c('0x88')]!==_0x2a5c('0x89'))return;return _0x19d918['user'][_0x2a5c('0x8a')]({'attributes':['id'],'raw':!![]})[_0x2a5c('0x1d')](function(_0x3486ad){if(_[_0x2a5c('0x84')](_0x3486ad)){_0x4c71a6[_0x2a5c('0x3c')](_0x2a5c('0x8b'));_0x9fad95['where'](_0x2a5c('0x8b'));}else{_0x4c71a6[_0x2a5c('0x3c')](_0x2a5c('0x65'),_['map'](_0x3486ad,'id'));_0x9fad95[_0x2a5c('0x3c')](_0x2a5c('0x65'),_[_0x2a5c('0x21')](_0x3486ad,'id'));}});})[_0x2a5c('0x1d')](function(){if(_0x19d918['user']['role']==='agent'&&!_0x4c436e&&!_0x19d918[_0x2a5c('0x32')][_0x2a5c('0x64')])return[];return db['sequelize']['query'](_0x4c71a6[_0x2a5c('0x8c')](),_0x3f2038);})['then'](function(_0x122527){_0x1b30a8[_0x2a5c('0x19')]=_0x122527[_0x2a5c('0x38')];if(_0x1b30a8['count']===0x0)return[];return db[_0x2a5c('0x8d')][_0x2a5c('0x32')](_0x5608c1[_0x2a5c('0x8c')](),_0x3f2038)[_0x2a5c('0x1d')](function(_0x46ed39){_0x5740e8=_[_0x2a5c('0x8e')](_0x46ed39,'id');_0x3f2038=_[_0x2a5c('0x8f')](_0x3f2038,{'model':db[_0x2a5c('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19d918['query'][_0x2a5c('0x36')]){_0x304955[_0x2a5c('0x37')]['forEach'](function(_0x5bdf9f){_0x9fad95[_0x2a5c('0x3f')]('i.'+_0x5bdf9f);});}else{_0x9fad95[_0x2a5c('0x3f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2a5c('0x52'));_0x9fad95[_0x2a5c('0x3f')]('a.key','Account.key');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x91'),_0x2a5c('0x92'));_0x9fad95['field'](_0x2a5c('0x93'),'contactName');_0x9fad95[_0x2a5c('0x3f')]('i.id');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x94'));_0x9fad95[_0x2a5c('0x3f')]('i.updatedAt');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x95'));_0x9fad95[_0x2a5c('0x3f')]('i.closedAt');_0x9fad95['field'](_0x2a5c('0x96'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x97'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x98'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x99'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x9a'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x9b'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x9c'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x9d'));_0x9fad95[_0x2a5c('0x3f')]('i.to');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x9e'));_0x9fad95[_0x2a5c('0x3f')]('i.MailAccountId');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0x9f'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xa0'),_0x2a5c('0xa1'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xa2'),_0x2a5c('0xa3'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xa4'),'Contact.email');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xa5'),_0x2a5c('0xa6'));_0x9fad95['field'](_0x2a5c('0xa7'),_0x2a5c('0xa8'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xa9'),'Contact.fax');_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xaa'),_0x2a5c('0xab'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xac'),_0x2a5c('0xad'));_0x9fad95[_0x2a5c('0x3f')](_0x2a5c('0xae'),_0x2a5c('0x23'));}if(_0x304955[_0x2a5c('0x18')])_0x9fad95[_0x2a5c('0x18')](_0x304955['limit']);if(_0x304955['offset'])_0x9fad95['offset'](_0x304955[_0x2a5c('0x17')]);return db[_0x2a5c('0x8d')][_0x2a5c('0x32')](_0x9fad95['toString'](),_0x3f2038);})[_0x2a5c('0x1d')](function(_0x4cd126){if(_0x4cd126['length']>0x0)_0x2ff039[_0x2a5c('0x3c')](_0x2a5c('0xaf'),_[_0x2a5c('0x21')](_0x4cd126,'id'));return db[_0x2a5c('0x8d')][_0x2a5c('0x32')](_0x2ff039['toString'](),_0x3f2038)['then'](function(_0x28a22b){var _0x5d07f9=_['groupBy'](_0x28a22b,_0x2a5c('0xb0'));var _0x485817=[];return db[_0x2a5c('0xb1')][_0x2a5c('0x28')]({'attributes':[_0x2a5c('0xb2')],'raw':!![]})[_0x2a5c('0x1d')](function(_0x2c0b03){var _0x4684b9=_0x2c0b03['enableEmailPreview'];_0x4cd126[_0x2a5c('0x25')](function(_0x35995d){_0x485817[_0x2a5c('0x26')](updateMailInteraction(_0x35995d,_0x5740e8,_0x5d07f9,_0x4684b9));});return BPromise['all'](_0x485817);});});});})[_0x2a5c('0x1d')](function(_0x37f468){_0x1b30a8['rows']=_0x37f468;return _0x1b30a8;})[_0x2a5c('0x1d')](respondWithFilteredResult(_0x439022,_0x304955))[_0x2a5c('0x2b')](handleError(_0x439022,null));};exports[_0x2a5c('0xb3')]=function(_0xeacc5,_0x37cc39){var _0x575424={'raw':![],'where':{'id':_0xeacc5[_0x2a5c('0xb4')]['id']}},_0x8a0b3b={};_0x8a0b3b[_0x2a5c('0x35')]=_[_0x2a5c('0x31')](db[_0x2a5c('0x90')][_0x2a5c('0x2d')]);_0x8a0b3b[_0x2a5c('0x32')]=_[_0x2a5c('0x31')](_0xeacc5[_0x2a5c('0x32')]);_0x8a0b3b['filters']=_[_0x2a5c('0x34')](_0x8a0b3b[_0x2a5c('0x35')],_0x8a0b3b['query']);_0x575424[_0x2a5c('0x37')]=_[_0x2a5c('0x34')](_0x8a0b3b[_0x2a5c('0x35')],qs['fields'](_0xeacc5['query'][_0x2a5c('0x36')]));_0x575424[_0x2a5c('0x37')]=_0x575424['attributes'][_0x2a5c('0x38')]?_0x575424[_0x2a5c('0x37')]:_0x8a0b3b[_0x2a5c('0x35')];if(_0xeacc5[_0x2a5c('0x32')][_0x2a5c('0xb5')]){_0x575424[_0x2a5c('0xb6')]=[{'all':!![]}];}_0x575424=_[_0x2a5c('0x8f')]({},_0x575424,_0xeacc5[_0x2a5c('0xb7')]);return db[_0x2a5c('0x90')][_0x2a5c('0x51')](_0x575424)[_0x2a5c('0x1d')](handleEntityNotFound(_0x37cc39,null))[_0x2a5c('0x1d')](respondWithResult(_0x37cc39,null))[_0x2a5c('0x2b')](handleError(_0x37cc39,null));};exports[_0x2a5c('0xb8')]=function(_0x176dfb,_0x227478){return db[_0x2a5c('0x90')]['create'](_0x176dfb['body'],{})[_0x2a5c('0x1d')](respondWithResult(_0x227478,0xc9))[_0x2a5c('0x2b')](handleError(_0x227478,null));};exports[_0x2a5c('0x1b')]=function(_0xd27d53,_0xc3bd94){if(_0xd27d53[_0x2a5c('0xb9')]['id']){delete _0xd27d53[_0x2a5c('0xb9')]['id'];}return db['MailInteraction'][_0x2a5c('0x51')]({'where':{'id':_0xd27d53['params']['id']}})[_0x2a5c('0x1d')](handleEntityNotFound(_0xc3bd94,null))['then'](saveUpdates(_0xd27d53[_0x2a5c('0xb9')],null))[_0x2a5c('0x1d')](respondWithResult(_0xc3bd94,null))[_0x2a5c('0x2b')](handleError(_0xc3bd94,null));};exports[_0x2a5c('0x1c')]=function(_0x3bdda2,_0x44ba1c){return db[_0x2a5c('0x90')][_0x2a5c('0x51')]({'where':{'id':_0x3bdda2[_0x2a5c('0xb4')]['id']}})[_0x2a5c('0x1d')](handleEntityNotFound(_0x44ba1c,null))['then'](removeEntity(_0x44ba1c,null))[_0x2a5c('0x2b')](handleError(_0x44ba1c,null));};exports[_0x2a5c('0xba')]=function(_0x361390,_0x43508b){return db[_0x2a5c('0x90')][_0x2a5c('0xba')]()[_0x2a5c('0x1d')](respondWithResult(_0x43508b,null))[_0x2a5c('0x2b')](handleError(_0x43508b,null));};exports[_0x2a5c('0xbb')]=function(_0x893faa,_0x469b8b){return db[_0x2a5c('0x27')][_0x2a5c('0x51')]({'where':{'id':_0x893faa[_0x2a5c('0xb4')]['id']}})[_0x2a5c('0x1d')](handleEntityNotFound(_0x469b8b,null))[_0x2a5c('0x1d')](function(_0x6defe8){if(_0x6defe8){return _0x6defe8[_0x2a5c('0xbb')](_0x893faa[_0x2a5c('0xb9')][_0x2a5c('0xbc')],_['omit'](_0x893faa['body'],['ids','id'])||{});}})[_0x2a5c('0x1d')](respondWithResult(_0x469b8b,null))['catch'](handleError(_0x469b8b,null));};exports[_0x2a5c('0xbd')]=function(_0x2464e4,_0x365c92){var _0x466de9={'raw':![],'where':{}};var _0x4ae648={};var _0x109698={'count':0x0,'rows':[]};return db[_0x2a5c('0x90')]['findOne']({'where':{'id':_0x2464e4[_0x2a5c('0xb4')]['id']}})['then'](handleEntityNotFound(_0x365c92,null))['then'](function(_0x5b2f06){if(_0x5b2f06){_0x4ae648['model']=_[_0x2a5c('0x31')](db[_0x2a5c('0x27')][_0x2a5c('0x2d')]);_0x4ae648[_0x2a5c('0x32')]=_[_0x2a5c('0x31')](_0x2464e4['query']);_0x4ae648[_0x2a5c('0x33')]=_[_0x2a5c('0x34')](_0x4ae648[_0x2a5c('0x35')],_0x4ae648[_0x2a5c('0x32')]);_0x466de9['attributes']=_[_0x2a5c('0x34')](_0x4ae648[_0x2a5c('0x35')],qs[_0x2a5c('0x36')](_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x36')]));_0x466de9[_0x2a5c('0x37')]=_0x466de9[_0x2a5c('0x37')][_0x2a5c('0x38')]?_0x466de9[_0x2a5c('0x37')]:_0x4ae648[_0x2a5c('0x35')];if(!_0x2464e4['query'][_0x2a5c('0xbe')](_0x2a5c('0x39'))){_0x466de9[_0x2a5c('0x18')]=qs['limit'](_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x18')]);_0x466de9[_0x2a5c('0x17')]=qs[_0x2a5c('0x17')](_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x17')]);}_0x466de9[_0x2a5c('0x3a')]=qs[_0x2a5c('0x3b')](_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x3b')]);_0x466de9[_0x2a5c('0x3c')]=qs[_0x2a5c('0x33')](_['pick'](_0x2464e4[_0x2a5c('0x32')],_0x4ae648[_0x2a5c('0x33')]));_0x466de9[_0x2a5c('0x3c')]['MailInteractionId']=_0x5b2f06['id'];if(_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x74')]){_0x466de9[_0x2a5c('0x3c')]=_[_0x2a5c('0x8f')](_0x466de9[_0x2a5c('0x3c')],{'$or':_[_0x2a5c('0x21')](_0x466de9['attributes'],function(_0x20c78){var _0x79f569={};_0x79f569[_0x20c78]={'$like':'%'+_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x74')]+'%'};return _0x79f569;})});}if(_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x68')]){var _0x87a4a0=_0x2464e4[_0x2a5c('0x32')][_0x2a5c('0x68')][_0x2a5c('0x24')](',');var _0xa955f7={};_0xa955f7[_0x87a4a0[0x0]]={'$gte':moment(_0x87a4a0[0x1])[_0x2a5c('0xbf')](_0x2a5c('0xc0'))};_0x466de9[_0x2a5c('0x3c')]=_['merge'](_0x466de9[_0x2a5c('0x3c')],_0xa955f7);}_0x466de9=_[_0x2a5c('0x8f')]({},_0x466de9,_0x2464e4[_0x2a5c('0xb7')]);return db[_0x2a5c('0x27')][_0x2a5c('0x19')]({'where':_0x466de9[_0x2a5c('0x3c')]})[_0x2a5c('0x1d')](function(_0x9e4574){_0x109698[_0x2a5c('0x19')]=_0x9e4574;if(_0x2464e4['query'][_0x2a5c('0xb5')]){_0x466de9[_0x2a5c('0xb6')]=[{'all':!![]}];}return db[_0x2a5c('0x27')][_0x2a5c('0xc1')](_0x466de9);})['then'](function(_0x20eb1b){if(_0x2464e4[_0x2a5c('0x32')]['inlineCss']==='true'){for(var _0x15296f=0x0;_0x15296f<_0x20eb1b[_0x2a5c('0x38')];_0x15296f++){_0x20eb1b[_0x15296f][_0x2a5c('0xb9')]=juice(_0x20eb1b[_0x15296f][_0x2a5c('0xb9')]);}}_0x109698[_0x2a5c('0xc2')]=_0x20eb1b;return _0x109698;});}})[_0x2a5c('0x1d')](respondWithFilteredResult(_0x365c92,_0x466de9))[_0x2a5c('0x2b')](handleError(_0x365c92,null));};exports['addTags']=function(_0x2111c5,_0x70fb2f){return db['MailInteraction']['find']({'where':{'id':_0x2111c5[_0x2a5c('0xb4')]['id']}})['then'](handleEntityNotFound(_0x70fb2f,null))[_0x2a5c('0x1d')](function(_0x572917){if(_0x572917){return _0x572917['setTags'](_0x2111c5[_0x2a5c('0xb9')][_0x2a5c('0xbc')],_[_0x2a5c('0xc3')](_0x2111c5[_0x2a5c('0xb9')],[_0x2a5c('0xbc'),'id'])||{})[_0x2a5c('0xc4')](function(){return db[_0x2a5c('0x5e')][_0x2a5c('0xc1')]({'attributes':['id',_0x2a5c('0x20'),'color'],'where':{'id':_0x2111c5[_0x2a5c('0xb9')][_0x2a5c('0xbc')]}});})[_0x2a5c('0x1d')](function(_0x5a27d7){socket['emit']('mailInteractionTags:save',{'id':Number(_0x2111c5[_0x2a5c('0xb4')]['id']),'tags':_0x5a27d7||[]});return{'id':Number(_0x2111c5[_0x2a5c('0xb4')]['id']),'tags':_0x5a27d7||[]};});}})[_0x2a5c('0x1d')](respondWithResult(_0x70fb2f,null))[_0x2a5c('0x2b')](handleError(_0x70fb2f,null));};exports[_0x2a5c('0xc5')]=function(_0x2ff5de,_0x2375da){return db['MailInteraction'][_0x2a5c('0x51')]({'where':{'id':_0x2ff5de['params']['id']}})[_0x2a5c('0x1d')](handleEntityNotFound(_0x2375da,null))['then'](function(_0x3574d9){if(_0x3574d9){return _0x3574d9[_0x2a5c('0xc5')](_0x2ff5de[_0x2a5c('0x32')][_0x2a5c('0xbc')]);}})['then'](respondWithStatusCode(_0x2375da,null))['catch'](handleError(_0x2375da,null));};exports[_0x2a5c('0xc6')]=function(_0x53a12a,_0x3d6ab5){var _0x3ff38f=moment()['unix']()[_0x2a5c('0x8c')]();var _0x125665=path[_0x2a5c('0xc7')](config[_0x2a5c('0xc8')],_0x2a5c('0xc9'),'files','tmp');var _0x16314e=path['join'](config[_0x2a5c('0xc8')],_0x2a5c('0xc9'),_0x2a5c('0xca'),_0x2a5c('0xcb'));var _0x26288f=path[_0x2a5c('0xc7')](_0x125665,_0x3ff38f);var _0x3ef690=util[_0x2a5c('0xbf')](_0x2a5c('0xcc'),_0x53a12a[_0x2a5c('0xb4')]['id'],_0x3ff38f);var _0x1db47f=path['join'](_0x125665,_0x3ef690);var _0x328813=[];if(_0x53a12a[_0x2a5c('0x32')]['attachments']){_0x328813[_0x2a5c('0x26')]({'model':db[_0x2a5c('0xcd')],'as':_0x2a5c('0xce'),'raw':!![]});}var _0x1e25ab=[{'model':db[_0x2a5c('0x27')],'as':'Messages','attributes':['id',_0x2a5c('0xb9'),_0x2a5c('0x41'),'to','cc',_0x2a5c('0xcf'),_0x2a5c('0xd0'),_0x2a5c('0x67')],'where':{'secret':![]},'order':qs[_0x2a5c('0x3b')]('id'),'include':_0x328813}];return db[_0x2a5c('0x90')]['find']({'where':{'id':_0x53a12a[_0x2a5c('0xb4')]['id']},'include':_0x1e25ab})[_0x2a5c('0x1d')](handleEntityNotFound(_0x3d6ab5,null))[_0x2a5c('0x1d')](function(_0x1df8f1){if(_0x1df8f1&&_0x1df8f1[_0x2a5c('0xd1')]){var _0xb14ed8=_0x1df8f1[_0x2a5c('0xd2')]({'plain':!![]});fs[_0x2a5c('0xd3')](_0x26288f);return BPromise['each'](_0xb14ed8[_0x2a5c('0xd1')],function(_0x37acec,_0x35e45a){var _0x3e2d44={'from':_0x37acec[_0x2a5c('0x41')],'to':_0x37acec['to'],'subject':_0x37acec[_0x2a5c('0xd0')],'html':htmlEntities['decode'](_0x37acec[_0x2a5c('0xb9')]),'headers':{'Date':moment(_0x37acec[_0x2a5c('0x67')])['format'](_0x2a5c('0xd4'))},'attachments':[]};if(_0x37acec['cc']){_0x3e2d44[_0x2a5c('0xd5')]['Cc']=_0x37acec['cc'];}if(_0x37acec[_0x2a5c('0xcf')]){_0x3e2d44['headers'][_0x2a5c('0xd6')]=_0x37acec[_0x2a5c('0xcf')];}return new BPromise(function(_0x1ebd2c,_0x535ffd){if(_0x37acec[_0x2a5c('0xce')]){for(var _0x16c861=0x0;_0x16c861<_0x37acec['Attachments'][_0x2a5c('0x38')];_0x16c861++){var _0x539c42=_0x37acec[_0x2a5c('0xce')][_0x16c861];var _0x1f82bd=path[_0x2a5c('0xc7')](_0x16314e,_0x539c42[_0x2a5c('0xd7')]);if(fs[_0x2a5c('0xd8')](_0x1f82bd)){_0x3e2d44[_0x2a5c('0xcb')]['push']({'name':_0x539c42[_0x2a5c('0x20')],'contentType':_0x539c42[_0x2a5c('0x2f')],'data':fs[_0x2a5c('0xd9')](_0x1f82bd)});}}}emlformat[_0x2a5c('0xda')](_0x3e2d44,function(_0x1560c6,_0x484114){if(_0x1560c6)return _0x535ffd(_0x1560c6);fs[_0x2a5c('0xdb')](path[_0x2a5c('0xc7')](_0x26288f,util[_0x2a5c('0xbf')]('message%d.eml',_0x35e45a)),_0x484114);return _0x1ebd2c(_0x484114);});});})[_0x2a5c('0x1d')](function(){return new BPromise(function(_0x1d12cf,_0x4779bc){zipdir(_0x26288f,{'saveTo':_0x1db47f},function(_0x4ec034,_0x3dacdf){if(_0x4ec034)return _0x4779bc(_0x4ec034);return _0x1d12cf(_0x3dacdf);});})[_0x2a5c('0x1d')](function(){return new BPromise(function(_0xdc9c34,_0x30f887){rimraf(_0x26288f,function(_0x14094d){if(_0x14094d)_0x30f887(_0x14094d);return _0xdc9c34();});});})[_0x2a5c('0x1d')](function(){return _0x3d6ab5[_0x2a5c('0xc6')](_0x1db47f,_0x3ef690,function(_0x544d39){if(!_0x544d39)fs['unlinkSync'](_0x1db47f);});});});}else{return _0x3d6ab5[_0x2a5c('0x14')](0xc8);}})[_0x2a5c('0x2b')](handleError(_0x3d6ab5,null));}; \ No newline at end of file +var _0x83af=['u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','start','some','compact','isEmpty','forEach','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','o.internal','Owner.internal','groupBy','MailInteractionId','enableEmailPreview','all','rows','params','keys','includeAll','options','create','body','describe','addMessage','ids','omit','rawAttributes','filters','nolimit','include','inlineCss','true','addTags','setTags','findAll','color','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','format','Attachment','Messages','bcc','subject','get','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','zip-dir','moment','bluebird','path','lodash','squel','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','push','MailMessage','findOne','out','plainBody','-id','trimStart','catch','MailInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users'];(function(_0x466805,_0x3e5529){var _0x4e57f1=function(_0x556795){while(--_0x556795){_0x466805['push'](_0x466805['shift']());}};_0x4e57f1(++_0x3e5529);}(_0x83af,0x177));var _0xf83a=function(_0x43316e,_0x318677){_0x43316e=_0x43316e-0x0;var _0x5b2881=_0x83af[_0x43316e];return _0x5b2881;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf83a('0x0'));var moment=require(_0xf83a('0x1'));var BPromise=require(_0xf83a('0x2'));var util=require('util');var path=require(_0xf83a('0x3'));var fs=require('fs');var _=require(_0xf83a('0x4'));var squel=require(_0xf83a('0x5'));var juice=require(_0xf83a('0x6'));var Redis=require('ioredis');var qs=require(_0xf83a('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xf83a('0x8'))(_0xf83a('0x9'));var config=require(_0xf83a('0xa'));var db=require(_0xf83a('0xb'))['db'];var htmlEntities=require(_0xf83a('0xc'));config[_0xf83a('0xd')]=_[_0xf83a('0xe')](config['redis'],{'host':_0xf83a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf83a('0x10'))['register'](socket);function respondWithStatusCode(_0x36ccba,_0x302d60){_0x302d60=_0x302d60||0xcc;return function(_0x2b43bd){if(_0x2b43bd){return _0x36ccba[_0xf83a('0x11')](_0x302d60);}return _0x36ccba[_0xf83a('0x12')](_0x302d60)[_0xf83a('0x13')]();};}function respondWithResult(_0x552a4f,_0x41cf3a){_0x41cf3a=_0x41cf3a||0xc8;return function(_0x4714b2){if(_0x4714b2){return _0x552a4f['status'](_0x41cf3a)[_0xf83a('0x14')](_0x4714b2);}};}function respondWithFilteredResult(_0x46cb0b,_0x3efe66){return function(_0x2cf259){if(_0x2cf259){var _0x2da35d=typeof _0x3efe66['offset']===_0xf83a('0x15')&&typeof _0x3efe66[_0xf83a('0x16')]==='undefined';var _0x24d02c=_0x2cf259[_0xf83a('0x17')];var _0x20903f=_0x2da35d?0x0:_0x3efe66[_0xf83a('0x18')];var _0x3ad7c7=_0x2da35d?_0x2cf259[_0xf83a('0x17')]:_0x3efe66['offset']+_0x3efe66['limit'];var _0x48e458;if(_0x3ad7c7>=_0x24d02c){_0x3ad7c7=_0x24d02c;_0x48e458=0xc8;}else{_0x48e458=0xce;}_0x46cb0b[_0xf83a('0x12')](_0x48e458);return _0x46cb0b[_0xf83a('0x19')](_0xf83a('0x1a'),_0x20903f+'-'+_0x3ad7c7+'/'+_0x24d02c)[_0xf83a('0x14')](_0x2cf259);}return null;};}function saveUpdates(_0x32a14c){return function(_0x161c2b){if(_0x161c2b){return _0x161c2b[_0xf83a('0x1b')](_0x32a14c)[_0xf83a('0x1c')](function(_0xfcef35){return _0xfcef35;});}return null;};}function removeEntity(_0xe90800){return function(_0x2dddb3){if(_0x2dddb3){return _0x2dddb3[_0xf83a('0x1d')]()[_0xf83a('0x1c')](function(){_0xe90800[_0xf83a('0x12')](0xcc)[_0xf83a('0x13')]();});}};}function handleEntityNotFound(_0x3b561f){return function(_0x58678c){if(!_0x58678c){_0x3b561f[_0xf83a('0x11')](0x194);}return _0x58678c;};}function handleError(_0x5c2962,_0x32d885){_0x32d885=_0x32d885||0x1f4;return function(_0x5191f4){logger[_0xf83a('0x1e')](_0x5191f4[_0xf83a('0x1f')]);if(_0x5191f4[_0xf83a('0x20')]){delete _0x5191f4[_0xf83a('0x20')];}_0x5c2962['status'](_0x32d885)['send'](_0x5191f4);};}function getInteractionUsers(_0x346957,_0xd0a4c5){return new BPromise(function(_0x17a4b9,_0x42347a){try{if(_0xd0a4c5[_0x346957['id']]){_0x346957[_0xf83a('0x21')]=_[_0xf83a('0x22')](_0xd0a4c5[_0x346957['id']],function(_0x22bc90){return{'id':_0x22bc90['id'],'fullname':_0x22bc90[_0xf83a('0x23')]};});}}catch(_0x761faa){_0x42347a(_0x761faa);}_0x17a4b9(_0x346957);});}function getInteractionTags(_0x4b4851,_0x4ef7ff){return new BPromise(function(_0x1e0edf,_0x6856ef){try{if(_0x4b4851[_0xf83a('0x24')]){_0x4b4851[_0xf83a('0x25')]=[];_0x4b4851[_0xf83a('0x24')]['split'](',')['forEach'](function(_0xa1d42e){_0x4b4851['Tags'][_0xf83a('0x26')](_0x4ef7ff[_0xa1d42e]);});}delete _0x4b4851['TagIds'];}catch(_0xe052e1){_0x6856ef(_0xe052e1);}_0x1e0edf(_0x4b4851);});}function getLastMessageText(_0x4e8397){return new BPromise(function(_0x49882d,_0x20d8fb){return db[_0xf83a('0x27')][_0xf83a('0x28')]({'where':{'$and':[{'MailInteractionId':_0x4e8397['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf83a('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf83a('0x2a')],'order':_0xf83a('0x2b'),'raw':!![]})['then'](function(_0x2efcbc){if(_0x2efcbc&&_0x2efcbc[_0xf83a('0x2a')]){_0x4e8397['lastMsgText']=_[_0xf83a('0x2c')](_0x2efcbc[_0xf83a('0x2a')]);}_0x49882d(_0x4e8397);})[_0xf83a('0x2d')](function(_0x57c1ba){_0x20d8fb(_0x57c1ba);});});}function updateMailInteraction(_0x18afa2,_0x4b6e42,_0x6270c5,_0x3db85b){return new BPromise(function(_0x2a1c9c,_0x43824b){return getInteractionUsers(_0x18afa2,_0x6270c5)[_0xf83a('0x1c')](function(_0x153a89){return getInteractionTags(_0x153a89,_0x4b6e42);})[_0xf83a('0x1c')](function(_0x544733){if(_0x3db85b){_0x2a1c9c(getLastMessageText(_0x544733));}else{_0x2a1c9c(_0x544733);}})[_0xf83a('0x2d')](function(_0x23a287){_0x43824b(_0x23a287);});});}exports['index']=function(_0x113575,_0x481d32){var _0x173fb0={},_0x3970a5={},_0x144de0={'count':0x0,'rows':[]};var _0x49e298=_[_0xf83a('0x22')](db[_0xf83a('0x2e')]['rawAttributes'],function(_0xb9d04a){return{'name':_0xb9d04a[_0xf83a('0x2f')],'type':_0xb9d04a[_0xf83a('0x30')][_0xf83a('0x31')]};});_0x3970a5[_0xf83a('0x32')]=_[_0xf83a('0x22')](_0x49e298,_0xf83a('0x20'));_0x3970a5[_0xf83a('0x33')]=_['keys'](_0x113575['query']);_0x3970a5['filters']=_[_0xf83a('0x34')](_0x3970a5[_0xf83a('0x32')],_0x3970a5[_0xf83a('0x33')]);_0x173fb0[_0xf83a('0x35')]=_['intersection'](_0x3970a5['model'],qs[_0xf83a('0x36')](_0x113575['query'][_0xf83a('0x36')]));_0x173fb0[_0xf83a('0x35')]=_0x173fb0[_0xf83a('0x35')][_0xf83a('0x37')]?_0x173fb0['attributes']:_0x3970a5['model'];if(!_0x113575[_0xf83a('0x33')][_0xf83a('0x38')]('nolimit')){_0x173fb0[_0xf83a('0x16')]=qs[_0xf83a('0x16')](_0x113575[_0xf83a('0x33')][_0xf83a('0x16')]);_0x173fb0[_0xf83a('0x18')]=qs[_0xf83a('0x18')](_0x113575[_0xf83a('0x33')][_0xf83a('0x18')]);}_0x173fb0['order']=qs[_0xf83a('0x39')](_0x113575[_0xf83a('0x33')]['sort']);_0x173fb0[_0xf83a('0x3a')]=qs['filters'](_[_0xf83a('0x3b')](_0x113575['query'],_0x3970a5['filters']),_0x49e298);var _0x2e66dd=[];var _0x1359d6=squel[_0xf83a('0x3c')]()[_0xf83a('0x3d')]('id')[_0xf83a('0x3d')](_0xf83a('0x20'))['field']('color')[_0xf83a('0x3e')](_0xf83a('0x3f'));var _0x32b863=squel[_0xf83a('0x3c')]()[_0xf83a('0x3d')](_0xf83a('0x40'))[_0xf83a('0x3d')](_0xf83a('0x41'))['field'](_0xf83a('0x42'))[_0xf83a('0x3e')]('user_has_mail_interactions','ui')[_0xf83a('0x43')](_0xf83a('0x44'),'u',_0xf83a('0x45'));var _0x352bb1=squel[_0xf83a('0x3c')]()[_0xf83a('0x3e')](_0xf83a('0x46'),'i')['left_join'](_0xf83a('0x47'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf83a('0x43')](_0xf83a('0x44'),'o',_0xf83a('0x48'))[_0xf83a('0x43')]('mail_accounts','a',_0xf83a('0x49'))['left_join']('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0xf83a('0x43')](_0xf83a('0x4a'),'it',_0xf83a('0x4b'))[_0xf83a('0x43')](_0xf83a('0x3f'),'t',_0xf83a('0x4c'));var _0x509b18=squel['expr']();var _0x28eb28=[];var _0x22d5bd=squel[_0xf83a('0x4d')]();var _0x576f94;if(_0x113575[_0xf83a('0x33')][_0xf83a('0x4e')]){_0x576f94=as[_0xf83a('0x4f')](_0x113575['query']['search']);var _0x2ed96f=_0x576f94[_0xf83a('0x50')];for(var _0x5a8dce=0x0;_0x5a8dce<_0x576f94[_0xf83a('0x51')][_0xf83a('0x37')];_0x5a8dce++){var _0x567ded=_0x576f94['conditions'][_0x5a8dce];var _0x728be9='i';var _0xc824d1=_[_0xf83a('0x52')](_0x49e298,['name',_0x567ded[_0xf83a('0x3d')]]);if(!_0xc824d1){switch(_0x567ded[_0xf83a('0x3d')]){case _0xf83a('0x53'):if(_0x567ded[_0xf83a('0x54')]==0x1){_0x352bb1[_0xf83a('0x55')]('`'+_0x567ded[_0xf83a('0x3d')]+_0xf83a('0x56'));}else{_0x352bb1['having']('`'+_0x567ded[_0xf83a('0x3d')]+'`\x20>\x200');}break;case _0xf83a('0x57'):if(_0x567ded[_0xf83a('0x58')]===_0xf83a('0x59')){if(_0x567ded[_0xf83a('0x54')]['split']('\x20')['length']>0x1){_0x509b18[_0x2ed96f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf83a('0x5a')](_0x567ded[_0xf83a('0x54')]),null);}else{var _0xa50abc='%'+_0x567ded['value']+'%';_0x509b18[_0x2ed96f](_0xf83a('0x5b'),_0xa50abc,_0xa50abc,_0xa50abc);}}else{_0xc824d1=_[_0xf83a('0x52')](_0x49e298,['name','ContactId']);_0x567ded['field']='ContactId';_0x33d958=as[_0xf83a('0x5c')](_0x728be9,_0xc824d1['type'],_0x567ded);_0x509b18[_0x2ed96f](_0x33d958[_0xf83a('0x5d')],_0x33d958[_0xf83a('0x54')]['start'],_0x33d958['value'][_0xf83a('0x13')]);}break;case _0xf83a('0x5e'):var _0xeb5334=_0x567ded[_0xf83a('0x54')][_0xf83a('0x5f')](',')[_0xf83a('0x22')](function(_0xc06359){return Number(_0xc06359);});_0xeb5334['forEach'](function(_0x27de7a){_0x22d5bd['or'](_0xf83a('0x60'),'%,'+_0x27de7a+',%');});_0x28eb28=_['union'](_0x28eb28,_0xeb5334);break;case _0xf83a('0x61'):if(_0x567ded['operator']===_0xf83a('0x59')){_0x509b18[_0x2ed96f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x567ded[_0xf83a('0x54')]+'%',null);}else{_0xc824d1=_[_0xf83a('0x52')](_0x49e298,[_0xf83a('0x20'),_0xf83a('0x62')]);_0x567ded[_0xf83a('0x3d')]=_0xf83a('0x62');_0x33d958=as[_0xf83a('0x5c')](_0x728be9,_0xc824d1[_0xf83a('0x30')],_0x567ded);_0x509b18[_0x2ed96f](_0x33d958[_0xf83a('0x5d')],_0x33d958[_0xf83a('0x54')][_0xf83a('0x63')],_0x33d958[_0xf83a('0x54')][_0xf83a('0x13')]);}break;case _0xf83a('0x2a'):_0x33d958=as[_0xf83a('0x5c')]('me',null,_0x567ded);_0x509b18[_0x2ed96f](_0x33d958['text'],_0x33d958[_0xf83a('0x54')]['start'],_0x33d958['value'][_0xf83a('0x13')]);break;}}else{var _0x33d958=as[_0xf83a('0x5c')](_0x728be9,_0xc824d1['type'],_0x567ded);_0x509b18[_0x2ed96f](_0x33d958[_0xf83a('0x5d')],_0x33d958[_0xf83a('0x54')][_0xf83a('0x63')],_0x33d958[_0xf83a('0x54')]['end']);}}}else{var _0x493718=_(_0x113575['query'])['keys']()['map'](function(_0x48b70e){return _[_0xf83a('0x64')](_0x49e298,['name',_0x48b70e])?_0x48b70e:undefined;})[_0xf83a('0x65')]()[_0xf83a('0x54')]();if(!_[_0xf83a('0x66')](_0x493718)){_0x493718[_0xf83a('0x67')](function(_0x255c50){if(_0x255c50==='MailAccountId'){_0x352bb1[_0xf83a('0x3a')]('i.MailAccountId\x20IN\x20?',[][_0xf83a('0x68')](_0x113575['query'][_0x255c50]));}else if(_0x255c50==='createdAt'){var _0x251153=JSON[_0xf83a('0x69')](_0x113575['query'][_0x255c50])[_0xf83a('0x6a')];var _0xe0423c=JSON[_0xf83a('0x69')](_0x113575[_0xf83a('0x33')][_0x255c50])[_0xf83a('0x6b')];_0x352bb1['where'](_0xf83a('0x6c'),_0x251153,_0xe0423c);}else{if(_0x113575[_0xf83a('0x33')][_0x255c50]===_0xf83a('0x6d')){_0x352bb1[_0xf83a('0x3a')]('i.'+_0x255c50+_0xf83a('0x6e'));}else{_0x352bb1[_0xf83a('0x3a')]('i.'+_0x255c50+_0xf83a('0x6f'),_0x113575[_0xf83a('0x33')][_0x255c50]);}}});}if(_0x113575['query'][_0xf83a('0x70')]){if(_0x113575[_0xf83a('0x33')][_0xf83a('0x70')]==0x1){_0x352bb1['having'](_0xf83a('0x71'));}else{_0x352bb1[_0xf83a('0x55')](_0xf83a('0x72'));}}if(_0x113575[_0xf83a('0x33')][_0xf83a('0x73')]){_0x28eb28=_[_0xf83a('0x74')](_0x113575[_0xf83a('0x33')]['tag'])?_0x113575[_0xf83a('0x33')]['tag']:new Array(_0x113575[_0xf83a('0x33')][_0xf83a('0x73')]);_0x28eb28[_0xf83a('0x67')](function(_0x373a99){_0x22d5bd['or'](_0xf83a('0x60'),'%,'+_0x373a99+',%');});}if(_0x113575[_0xf83a('0x33')][_0xf83a('0x75')]){var _0x4546e8=_0x113575[_0xf83a('0x33')]['filter'][_0xf83a('0x76')]('\x5c','\x5c\x5c')[_0xf83a('0x76')](/'/g,'\x27\x27');if(qs[_0xf83a('0x77')](_0x4546e8)){_0x509b18['or'](_0xf83a('0x78'),_0x4546e8+'%');}else if(qs['isEmail'](_0x4546e8)){_0x509b18['or']('c.email\x20LIKE\x20?',_0x4546e8+'%');}else{_0x509b18['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4546e8))['or'](_0xf83a('0x79'),qs[_0xf83a('0x5a')](_0x4546e8));}}}_0x352bb1['where'](_0x509b18);_0x352bb1[_0xf83a('0x7a')](_0xf83a('0x7b'));var _0x398806={'type':db['Sequelize'][_0xf83a('0x7c')][_0xf83a('0x7d')],'raw':!![]};var _0x51c9cb=_0x352bb1[_0xf83a('0x7e')]();_0x51c9cb['field'](_0xf83a('0x7b'));_0x51c9cb['field'](_0xf83a('0x7f'),_0xf83a('0x53'));if(_0x173fb0[_0xf83a('0x80')]){_0x173fb0[_0xf83a('0x80')][_0xf83a('0x67')](function(_0x27cc4d){var _0x4c41d4=_0x27cc4d[0x0]==='contactName'?_0x27cc4d[0x0]:'i.'+_0x27cc4d[0x0];_0x352bb1[_0xf83a('0x80')](_0x4c41d4,_0x27cc4d[0x1]==='DESC'?![]:!![]);});}if(!_[_0xf83a('0x66')](_0x28eb28)){_0x352bb1[_0xf83a('0x55')](_0x22d5bd);_0x51c9cb[_0xf83a('0x3a')]('t.id\x20IN\x20?',_0x28eb28);}BPromise[_0xf83a('0x81')]()['then'](function(){if(!_0x576f94){if(_0x113575[_0xf83a('0x33')][_0xf83a('0x82')])return;_0x51c9cb[_0xf83a('0x3a')](_0xf83a('0x83'));_0x352bb1['where'](_0xf83a('0x83'));return;}if(_0x113575[_0xf83a('0x84')][_0xf83a('0x85')]!==_0xf83a('0x86'))return;return _0x113575[_0xf83a('0x84')][_0xf83a('0x87')]({'attributes':['id'],'raw':!![]})[_0xf83a('0x1c')](function(_0x35d38a){if(_[_0xf83a('0x66')](_0x35d38a)){_0x51c9cb[_0xf83a('0x3a')](_0xf83a('0x88'));_0x352bb1['where'](_0xf83a('0x88'));}else{_0x51c9cb[_0xf83a('0x3a')](_0xf83a('0x89'),_[_0xf83a('0x22')](_0x35d38a,'id'));_0x352bb1[_0xf83a('0x3a')](_0xf83a('0x89'),_['map'](_0x35d38a,'id'));}});})[_0xf83a('0x1c')](function(){if(_0x113575['user']['role']===_0xf83a('0x86')&&!_0x576f94&&!_0x113575[_0xf83a('0x33')][_0xf83a('0x82')])return[];return db['sequelize'][_0xf83a('0x33')](_0x51c9cb[_0xf83a('0x8a')](),_0x398806);})[_0xf83a('0x1c')](function(_0x51899c){_0x144de0['count']=_0x51899c[_0xf83a('0x37')];if(_0x144de0[_0xf83a('0x17')]===0x0)return[];return db[_0xf83a('0x8b')][_0xf83a('0x33')](_0x1359d6[_0xf83a('0x8a')](),_0x398806)[_0xf83a('0x1c')](function(_0xe527cb){_0x2e66dd=_[_0xf83a('0x8c')](_0xe527cb,'id');_0x398806=_[_0xf83a('0x8d')](_0x398806,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x113575[_0xf83a('0x33')][_0xf83a('0x36')]){_0x173fb0[_0xf83a('0x35')]['forEach'](function(_0x194601){_0x352bb1[_0xf83a('0x3d')]('i.'+_0x194601);});}else{_0x352bb1['field'](_0xf83a('0x7f'),_0xf83a('0x53'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x8e'),_0xf83a('0x8f'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x90'),_0xf83a('0x91'));_0x352bb1[_0xf83a('0x3d')]('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');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x7b'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x92'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x93'));_0x352bb1['field']('i.closed');_0x352bb1[_0xf83a('0x3d')]('i.closedAt');_0x352bb1['field']('i.attach');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x94'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x95'));_0x352bb1[_0xf83a('0x3d')]('i.subject');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x96'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x97'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x98'));_0x352bb1['field']('i.substatus');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x99'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x9a'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x9b'));_0x352bb1[_0xf83a('0x3d')]('i.UserId');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x9c'),'Contact.firstName');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0x9d'),_0xf83a('0x9e'));_0x352bb1['field'](_0xf83a('0x9f'),_0xf83a('0xa0'));_0x352bb1['field'](_0xf83a('0xa1'),_0xf83a('0xa2'));_0x352bb1[_0xf83a('0x3d')](_0xf83a('0xa3'),'Contact.mobile');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0xa4'),'Contact.fax');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0xa5'),'Owner.fullname');_0x352bb1[_0xf83a('0x3d')](_0xf83a('0xa6'),_0xf83a('0xa7'));_0x352bb1[_0xf83a('0x3d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf83a('0x24'));}if(_0x173fb0['limit'])_0x352bb1[_0xf83a('0x16')](_0x173fb0[_0xf83a('0x16')]);if(_0x173fb0[_0xf83a('0x18')])_0x352bb1[_0xf83a('0x18')](_0x173fb0[_0xf83a('0x18')]);return db[_0xf83a('0x8b')][_0xf83a('0x33')](_0x352bb1[_0xf83a('0x8a')](),_0x398806);})[_0xf83a('0x1c')](function(_0x32b568){if(_0x32b568[_0xf83a('0x37')]>0x0)_0x32b863['where']('ui.MailInteractionId\x20IN\x20?',_[_0xf83a('0x22')](_0x32b568,'id'));return db['sequelize'][_0xf83a('0x33')](_0x32b863[_0xf83a('0x8a')](),_0x398806)[_0xf83a('0x1c')](function(_0x3f495d){var _0x418301=_[_0xf83a('0xa8')](_0x3f495d,_0xf83a('0xa9'));var _0x1a7ee7=[];return db['Setting']['findOne']({'attributes':[_0xf83a('0xaa')],'raw':!![]})[_0xf83a('0x1c')](function(_0x45387b){var _0x1abc5f=_0x45387b[_0xf83a('0xaa')];_0x32b568['forEach'](function(_0x111790){_0x1a7ee7[_0xf83a('0x26')](updateMailInteraction(_0x111790,_0x2e66dd,_0x418301,_0x1abc5f));});return BPromise[_0xf83a('0xab')](_0x1a7ee7);});});});})['then'](function(_0x454a04){_0x144de0[_0xf83a('0xac')]=_0x454a04;return _0x144de0;})[_0xf83a('0x1c')](respondWithFilteredResult(_0x481d32,_0x173fb0))[_0xf83a('0x2d')](handleError(_0x481d32,null));};exports['show']=function(_0xece561,_0x2e257c){var _0x6d6c0b={'raw':![],'where':{'id':_0xece561[_0xf83a('0xad')]['id']}},_0x526727={};_0x526727['model']=_[_0xf83a('0xae')](db[_0xf83a('0x2e')]['rawAttributes']);_0x526727['query']=_['keys'](_0xece561[_0xf83a('0x33')]);_0x526727['filters']=_[_0xf83a('0x34')](_0x526727[_0xf83a('0x32')],_0x526727[_0xf83a('0x33')]);_0x6d6c0b[_0xf83a('0x35')]=_[_0xf83a('0x34')](_0x526727[_0xf83a('0x32')],qs[_0xf83a('0x36')](_0xece561[_0xf83a('0x33')][_0xf83a('0x36')]));_0x6d6c0b[_0xf83a('0x35')]=_0x6d6c0b[_0xf83a('0x35')][_0xf83a('0x37')]?_0x6d6c0b[_0xf83a('0x35')]:_0x526727[_0xf83a('0x32')];if(_0xece561[_0xf83a('0x33')][_0xf83a('0xaf')]){_0x6d6c0b['include']=[{'all':!![]}];}_0x6d6c0b=_[_0xf83a('0x8d')]({},_0x6d6c0b,_0xece561[_0xf83a('0xb0')]);return db[_0xf83a('0x2e')][_0xf83a('0x52')](_0x6d6c0b)[_0xf83a('0x1c')](handleEntityNotFound(_0x2e257c,null))[_0xf83a('0x1c')](respondWithResult(_0x2e257c,null))['catch'](handleError(_0x2e257c,null));};exports[_0xf83a('0xb1')]=function(_0x4cb766,_0x18e03e){return db[_0xf83a('0x2e')][_0xf83a('0xb1')](_0x4cb766['body'],{})[_0xf83a('0x1c')](respondWithResult(_0x18e03e,0xc9))['catch'](handleError(_0x18e03e,null));};exports[_0xf83a('0x1b')]=function(_0x3f3bfe,_0x20d3ad){if(_0x3f3bfe['body']['id']){delete _0x3f3bfe[_0xf83a('0xb2')]['id'];}return db[_0xf83a('0x2e')][_0xf83a('0x52')]({'where':{'id':_0x3f3bfe[_0xf83a('0xad')]['id']}})['then'](handleEntityNotFound(_0x20d3ad,null))[_0xf83a('0x1c')](saveUpdates(_0x3f3bfe[_0xf83a('0xb2')],null))[_0xf83a('0x1c')](respondWithResult(_0x20d3ad,null))[_0xf83a('0x2d')](handleError(_0x20d3ad,null));};exports[_0xf83a('0x1d')]=function(_0xaae633,_0x5a9e15){return db['MailInteraction'][_0xf83a('0x52')]({'where':{'id':_0xaae633[_0xf83a('0xad')]['id']}})[_0xf83a('0x1c')](handleEntityNotFound(_0x5a9e15,null))[_0xf83a('0x1c')](removeEntity(_0x5a9e15,null))[_0xf83a('0x2d')](handleError(_0x5a9e15,null));};exports[_0xf83a('0xb3')]=function(_0x2f6cc0,_0xd55322){return db[_0xf83a('0x2e')][_0xf83a('0xb3')]()[_0xf83a('0x1c')](respondWithResult(_0xd55322,null))[_0xf83a('0x2d')](handleError(_0xd55322,null));};exports[_0xf83a('0xb4')]=function(_0x35b6fe,_0x4683cf){return db['MailMessage'][_0xf83a('0x52')]({'where':{'id':_0x35b6fe['params']['id']}})['then'](handleEntityNotFound(_0x4683cf,null))[_0xf83a('0x1c')](function(_0x4cd34c){if(_0x4cd34c){return _0x4cd34c[_0xf83a('0xb4')](_0x35b6fe[_0xf83a('0xb2')][_0xf83a('0xb5')],_[_0xf83a('0xb6')](_0x35b6fe[_0xf83a('0xb2')],[_0xf83a('0xb5'),'id'])||{});}})[_0xf83a('0x1c')](respondWithResult(_0x4683cf,null))[_0xf83a('0x2d')](handleError(_0x4683cf,null));};exports['getMessages']=function(_0x44d90d,_0x4440ec){var _0x26b517={'raw':![],'where':{}};var _0x26498e={};var _0x1aa848={'count':0x0,'rows':[]};return db[_0xf83a('0x2e')]['findOne']({'where':{'id':_0x44d90d['params']['id']}})[_0xf83a('0x1c')](handleEntityNotFound(_0x4440ec,null))[_0xf83a('0x1c')](function(_0x24719b){if(_0x24719b){_0x26498e[_0xf83a('0x32')]=_[_0xf83a('0xae')](db[_0xf83a('0x27')][_0xf83a('0xb7')]);_0x26498e[_0xf83a('0x33')]=_['keys'](_0x44d90d[_0xf83a('0x33')]);_0x26498e[_0xf83a('0xb8')]=_[_0xf83a('0x34')](_0x26498e[_0xf83a('0x32')],_0x26498e['query']);_0x26b517[_0xf83a('0x35')]=_[_0xf83a('0x34')](_0x26498e['model'],qs[_0xf83a('0x36')](_0x44d90d[_0xf83a('0x33')][_0xf83a('0x36')]));_0x26b517['attributes']=_0x26b517[_0xf83a('0x35')]['length']?_0x26b517[_0xf83a('0x35')]:_0x26498e[_0xf83a('0x32')];if(!_0x44d90d[_0xf83a('0x33')][_0xf83a('0x38')](_0xf83a('0xb9'))){_0x26b517[_0xf83a('0x16')]=qs[_0xf83a('0x16')](_0x44d90d[_0xf83a('0x33')][_0xf83a('0x16')]);_0x26b517[_0xf83a('0x18')]=qs['offset'](_0x44d90d['query'][_0xf83a('0x18')]);}_0x26b517['order']=qs[_0xf83a('0x39')](_0x44d90d[_0xf83a('0x33')][_0xf83a('0x39')]);_0x26b517[_0xf83a('0x3a')]=qs['filters'](_[_0xf83a('0x3b')](_0x44d90d['query'],_0x26498e[_0xf83a('0xb8')]));_0x26b517[_0xf83a('0x3a')][_0xf83a('0xa9')]=_0x24719b['id'];if(_0x44d90d[_0xf83a('0x33')]['filter']){_0x26b517[_0xf83a('0x3a')]=_[_0xf83a('0x8d')](_0x26b517[_0xf83a('0x3a')],{'$or':_[_0xf83a('0x22')](_0x26b517['attributes'],function(_0x425166){var _0x47f67b={};_0x47f67b[_0x425166]={'$like':'%'+_0x44d90d[_0xf83a('0x33')]['filter']+'%'};return _0x47f67b;})});}if(_0x44d90d[_0xf83a('0x33')]['$gte']){var _0x4047bc=_0x44d90d[_0xf83a('0x33')][_0xf83a('0x6a')][_0xf83a('0x5f')](',');var _0x59780b={};_0x59780b[_0x4047bc[0x0]]={'$gte':moment(_0x4047bc[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x26b517[_0xf83a('0x3a')]=_[_0xf83a('0x8d')](_0x26b517[_0xf83a('0x3a')],_0x59780b);}_0x26b517=_[_0xf83a('0x8d')]({},_0x26b517,_0x44d90d['options']);return db[_0xf83a('0x27')][_0xf83a('0x17')]({'where':_0x26b517['where']})['then'](function(_0x224a06){_0x1aa848[_0xf83a('0x17')]=_0x224a06;if(_0x44d90d[_0xf83a('0x33')][_0xf83a('0xaf')]){_0x26b517[_0xf83a('0xba')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x26b517);})[_0xf83a('0x1c')](function(_0x25258b){if(_0x44d90d[_0xf83a('0x33')][_0xf83a('0xbb')]===_0xf83a('0xbc')){for(var _0x212f55=0x0;_0x212f55<_0x25258b[_0xf83a('0x37')];_0x212f55++){_0x25258b[_0x212f55][_0xf83a('0xb2')]=juice(_0x25258b[_0x212f55][_0xf83a('0xb2')]);}}_0x1aa848[_0xf83a('0xac')]=_0x25258b;return _0x1aa848;});}})[_0xf83a('0x1c')](respondWithFilteredResult(_0x4440ec,_0x26b517))[_0xf83a('0x2d')](handleError(_0x4440ec,null));};exports[_0xf83a('0xbd')]=function(_0x209c41,_0x250517){return db[_0xf83a('0x2e')]['find']({'where':{'id':_0x209c41['params']['id']}})['then'](handleEntityNotFound(_0x250517,null))[_0xf83a('0x1c')](function(_0x3cc590){if(_0x3cc590){return _0x3cc590[_0xf83a('0xbe')](_0x209c41[_0xf83a('0xb2')][_0xf83a('0xb5')],_[_0xf83a('0xb6')](_0x209c41[_0xf83a('0xb2')],[_0xf83a('0xb5'),'id'])||{})['spread'](function(){return db[_0xf83a('0x5e')][_0xf83a('0xbf')]({'attributes':['id',_0xf83a('0x20'),_0xf83a('0xc0')],'where':{'id':_0x209c41['body']['ids']}});})[_0xf83a('0x1c')](function(_0x4a21e2){socket[_0xf83a('0xc1')](_0xf83a('0xc2'),{'id':Number(_0x209c41[_0xf83a('0xad')]['id']),'tags':_0x4a21e2||[]});return{'id':Number(_0x209c41[_0xf83a('0xad')]['id']),'tags':_0x4a21e2||[]};});}})[_0xf83a('0x1c')](respondWithResult(_0x250517,null))[_0xf83a('0x2d')](handleError(_0x250517,null));};exports['removeTags']=function(_0x47335b,_0x33924b){return db[_0xf83a('0x2e')]['find']({'where':{'id':_0x47335b[_0xf83a('0xad')]['id']}})[_0xf83a('0x1c')](handleEntityNotFound(_0x33924b,null))[_0xf83a('0x1c')](function(_0x18e5b4){if(_0x18e5b4){return _0x18e5b4[_0xf83a('0xc3')](_0x47335b[_0xf83a('0x33')][_0xf83a('0xb5')]);}})[_0xf83a('0x1c')](respondWithStatusCode(_0x33924b,null))[_0xf83a('0x2d')](handleError(_0x33924b,null));};exports[_0xf83a('0xc4')]=function(_0x1d152f,_0x1f0f59){var _0x4e70a1=moment()[_0xf83a('0xc5')]()[_0xf83a('0x8a')]();var _0x3d1245=path['join'](config[_0xf83a('0xc6')],_0xf83a('0xc7'),_0xf83a('0xc8'),'tmp');var _0x551f97=path[_0xf83a('0xc9')](config[_0xf83a('0xc6')],_0xf83a('0xc7'),_0xf83a('0xc8'),_0xf83a('0xca'));var _0xba4994=path[_0xf83a('0xc9')](_0x3d1245,_0x4e70a1);var _0x12f9f0=util[_0xf83a('0xcb')]('transcript-%d-%s.zip',_0x1d152f['params']['id'],_0x4e70a1);var _0x16be7c=path[_0xf83a('0xc9')](_0x3d1245,_0x12f9f0);var _0x366615=[];if(_0x1d152f[_0xf83a('0x33')][_0xf83a('0xca')]){_0x366615['push']({'model':db[_0xf83a('0xcc')],'as':'Attachments','raw':!![]});}var _0x5691ab=[{'model':db[_0xf83a('0x27')],'as':_0xf83a('0xcd'),'attributes':['id',_0xf83a('0xb2'),_0xf83a('0x3e'),'to','cc',_0xf83a('0xce'),_0xf83a('0xcf'),'createdAt'],'where':{'secret':![]},'order':qs[_0xf83a('0x39')]('id'),'include':_0x366615}];return db[_0xf83a('0x2e')][_0xf83a('0x52')]({'where':{'id':_0x1d152f[_0xf83a('0xad')]['id']},'include':_0x5691ab})[_0xf83a('0x1c')](handleEntityNotFound(_0x1f0f59,null))['then'](function(_0x18032d){if(_0x18032d&&_0x18032d[_0xf83a('0xcd')]){var _0x1892e4=_0x18032d[_0xf83a('0xd0')]({'plain':!![]});fs['mkdirSync'](_0xba4994);return BPromise['each'](_0x1892e4['Messages'],function(_0xe4e8dd,_0x3fccf2){var _0x59a9c8={'from':_0xe4e8dd[_0xf83a('0x3e')],'to':_0xe4e8dd['to'],'subject':_0xe4e8dd['subject'],'html':htmlEntities[_0xf83a('0xd1')](_0xe4e8dd[_0xf83a('0xb2')]),'headers':{'Date':moment(_0xe4e8dd[_0xf83a('0xd2')])[_0xf83a('0xcb')](_0xf83a('0xd3'))},'attachments':[]};if(_0xe4e8dd['cc']){_0x59a9c8[_0xf83a('0xd4')]['Cc']=_0xe4e8dd['cc'];}if(_0xe4e8dd['bcc']){_0x59a9c8[_0xf83a('0xd4')][_0xf83a('0xd5')]=_0xe4e8dd[_0xf83a('0xce')];}return new BPromise(function(_0x274e15,_0x18aa46){if(_0xe4e8dd[_0xf83a('0xd6')]){for(var _0x3c3f70=0x0;_0x3c3f70<_0xe4e8dd[_0xf83a('0xd6')][_0xf83a('0x37')];_0x3c3f70++){var _0x23d503=_0xe4e8dd[_0xf83a('0xd6')][_0x3c3f70];var _0x46d183=path[_0xf83a('0xc9')](_0x551f97,_0x23d503[_0xf83a('0xd7')]);if(fs[_0xf83a('0xd8')](_0x46d183)){_0x59a9c8[_0xf83a('0xca')][_0xf83a('0x26')]({'name':_0x23d503['name'],'contentType':_0x23d503[_0xf83a('0x30')],'data':fs[_0xf83a('0xd9')](_0x46d183)});}}}emlformat[_0xf83a('0xda')](_0x59a9c8,function(_0x4aaeeb,_0x2b575f){if(_0x4aaeeb)return _0x18aa46(_0x4aaeeb);fs[_0xf83a('0xdb')](path[_0xf83a('0xc9')](_0xba4994,util[_0xf83a('0xcb')](_0xf83a('0xdc'),_0x3fccf2)),_0x2b575f);return _0x274e15(_0x2b575f);});});})[_0xf83a('0x1c')](function(){return new BPromise(function(_0x23c2c6,_0x466a21){zipdir(_0xba4994,{'saveTo':_0x16be7c},function(_0x54c600,_0x18a0d6){if(_0x54c600)return _0x466a21(_0x54c600);return _0x23c2c6(_0x18a0d6);});})['then'](function(){return new BPromise(function(_0x290f92,_0x1d1919){rimraf(_0xba4994,function(_0x3691e8){if(_0x3691e8)_0x1d1919(_0x3691e8);return _0x290f92();});});})[_0xf83a('0x1c')](function(){return _0x1f0f59[_0xf83a('0xc4')](_0x16be7c,_0x12f9f0,function(_0x59dfab){if(!_0x59dfab)fs[_0xf83a('0xdd')](_0x16be7c);});});});}else{return _0x1f0f59[_0xf83a('0x11')](0xc8);}})[_0xf83a('0x2d')](handleError(_0x1f0f59,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3010c2d..25c92af 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 _0x8b2e=['update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','MailInteraction','MailMessage','save'];(function(_0x5d0014,_0xae2937){var _0x4b9719=function(_0xcb576c){while(--_0xcb576c){_0x5d0014['push'](_0x5d0014['shift']());}};_0x4b9719(++_0xae2937);}(_0x8b2e,0x1b6));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xe8b2('0x0'))['db'][_0xe8b2('0x1')];var MailMessage=require(_0xe8b2('0x0'))['db'][_0xe8b2('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe8b2('0x3'),'afterUpdate':_0xe8b2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x16e8f0){return function(_0xa9cbd5,_0x133aa7,_0x24239a){_0xa9cbd5[_0xe8b2('0x5')]({'attributes':['id'],'raw':!![]})[_0xe8b2('0x6')](function(_0x303941){_0xa9cbd5[_0xe8b2('0x7')](_0xe8b2('0x8'),_0x303941[_0xe8b2('0x9')](function(_0x1f0bef){return{'id':_0x1f0bef['id']};}));return MailMessage[_0xe8b2('0xa')]({'where':{'MailInteractionId':_0xa9cbd5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2877ef){_0xa9cbd5['setDataValue'](_0xe8b2('0xb'),_0x2877ef[_0xe8b2('0xc')]);MailInteractionEvents[_0xe8b2('0xd')](_0x16e8f0+':'+_0xa9cbd5['id'],_0xa9cbd5);MailInteractionEvents[_0xe8b2('0xd')](_0x16e8f0,_0xa9cbd5);_0x24239a(null);})[_0xe8b2('0xe')](_0x24239a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xe8b2('0xf')](e,emitEvent(event));}}module[_0xe8b2('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x5bd5=['save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x554c4d,_0x1c1c54){var _0x73f158=function(_0x3f6814){while(--_0x3f6814){_0x554c4d['push'](_0x554c4d['shift']());}};_0x73f158(++_0x1c1c54);}(_0x5bd5,0xb8));var _0x55bd=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x5bd5[_0x121886];return _0x20ca01;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x55bd('0x0'))['db'][_0x55bd('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x55bd('0x2')](0x0);var events={'afterCreate':_0x55bd('0x3'),'afterUpdate':_0x55bd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5b6bef){return function(_0x944334,_0x33d00b,_0x33c84b){_0x944334[_0x55bd('0x5')]({'attributes':['id'],'raw':!![]})[_0x55bd('0x6')](function(_0x1701d9){_0x944334[_0x55bd('0x7')](_0x55bd('0x8'),_0x1701d9[_0x55bd('0x9')](function(_0x2034dc){return{'id':_0x2034dc['id']};}));return MailMessage[_0x55bd('0xa')]({'where':{'MailInteractionId':_0x944334['id'],'direction':'in','read':![]},'raw':!![]});})[_0x55bd('0x6')](function(_0x5613d3){_0x944334[_0x55bd('0x7')](_0x55bd('0xb'),_0x5613d3[_0x55bd('0xc')]);MailInteractionEvents[_0x55bd('0xd')](_0x5b6bef+':'+_0x944334['id'],_0x944334);MailInteractionEvents[_0x55bd('0xd')](_0x5b6bef,_0x944334);_0x33c84b(null);})[_0x55bd('0xe')](_0x33c84b(null));};}for(var e in events){if(events[_0x55bd('0xf')](e)){var event=events[e];MailInteraction[_0x55bd('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index aead48e..d9c6a0a 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 _0xb914=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0xb914,0xaa));var _0x4b91=function(_0x7870ff,_0x21c985){_0x7870ff=_0x7870ff-0x0;var _0x5d66d6=_0xb914[_0x7870ff];return _0x5d66d6;};'use strict';var _=require(_0x4b91('0x0'));var util=require(_0x4b91('0x1'));var logger=require(_0x4b91('0x2'))(_0x4b91('0x3'));var moment=require(_0x4b91('0x4'));var BPromise=require(_0x4b91('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4b91('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b91('0x7'));module['exports']=function(_0x3afdb0,_0x4abd0e){return _0x3afdb0[_0x4b91('0x8')](_0x4b91('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x4b91('0xa'),'fields':[_0x4b91('0xb'),'to'],'type':_0x4b91('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6a072d,_0x46f325,_0x1f1cf3){if(_0x6a072d[_0x4b91('0xd')]){_0x6a072d[_0x4b91('0xe')]=moment()[_0x4b91('0xf')](_0x4b91('0x10'));}if(_0x6a072d[_0x4b91('0x11')]){_0x6a072d[_0x4b91('0x12')]=moment()['format'](_0x4b91('0x10'));}_0x1f1cf3(null,_0x46f325);},'beforeUpdate':function(_0x916b46,_0x56817a,_0x9bf45f){if(_0x916b46['changed'](_0x4b91('0xd'))){_0x916b46['substatusAt']=_0x916b46[_0x4b91('0xd')]?moment()[_0x4b91('0xf')](_0x4b91('0x10')):null;}if(_0x916b46[_0x4b91('0x13')](_0x4b91('0x11'))){_0x916b46['closedAt']=moment()['format'](_0x4b91('0x10'));_0x916b46[_0x4b91('0xd')]=null;_0x916b46['substatusAt']=null;}_0x9bf45f(null,_0x916b46);},'afterUpdate':function(_0x186e8e,_0x686744,_0x2668de){var _0x17eb30=_0x3afdb0[_0x4b91('0x14')];var _0x49c225=_0x186e8e[_0x4b91('0x15')]({'plain':!![]});if(_0x49c225['closed']){return _0x17eb30[_0x4b91('0x16')][_0x4b91('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x49c225['id']}})[_0x4b91('0x18')](function(){_0x2668de();})[_0x4b91('0x19')](function(_0x1b3ae9){_0x2668de(_0x1b3ae9);});}else{_0x2668de();}}},'charset':_0x4b91('0x1a'),'collate':_0x4b91('0x1b')});}; \ No newline at end of file +var _0x21e4=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','get','MailMessage','update','then','catch','utf8mb4'];(function(_0x21d77d,_0x55f316){var _0x405101=function(_0x1823d6){while(--_0x1823d6){_0x21d77d['push'](_0x21d77d['shift']());}};_0x405101(++_0x55f316);}(_0x21e4,0xcc));var _0x421e=function(_0x7de0af,_0x2741f8){_0x7de0af=_0x7de0af-0x0;var _0x149ba6=_0x21e4[_0x7de0af];return _0x149ba6;};'use strict';var _=require(_0x421e('0x0'));var util=require(_0x421e('0x1'));var logger=require(_0x421e('0x2'))(_0x421e('0x3'));var moment=require(_0x421e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x421e('0x5'));var rimraf=require(_0x421e('0x6'));var config=require(_0x421e('0x7'));var attributes=require(_0x421e('0x8'));module[_0x421e('0x9')]=function(_0x135b93,_0xe23fd4){return _0x135b93[_0x421e('0xa')](_0x421e('0xb'),attributes,{'tableName':_0x421e('0xc'),'paranoid':![],'indexes':[{'name':_0x421e('0xd'),'fields':[_0x421e('0xe'),'to'],'type':_0x421e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2637bc,_0x296f00,_0x526f37){if(_0x2637bc['substatus']){_0x2637bc[_0x421e('0x10')]=moment()[_0x421e('0x11')](_0x421e('0x12'));}if(_0x2637bc[_0x421e('0x13')]){_0x2637bc[_0x421e('0x14')]=moment()[_0x421e('0x11')](_0x421e('0x12'));}_0x526f37(null,_0x296f00);},'beforeUpdate':function(_0x4e9ed0,_0x3ab20d,_0x219fbf){if(_0x4e9ed0['changed'](_0x421e('0x15'))){_0x4e9ed0[_0x421e('0x10')]=_0x4e9ed0[_0x421e('0x15')]?moment()[_0x421e('0x11')](_0x421e('0x12')):null;}if(_0x4e9ed0['changed'](_0x421e('0x13'))){_0x4e9ed0['closedAt']=moment()[_0x421e('0x11')](_0x421e('0x12'));_0x4e9ed0[_0x421e('0x15')]=null;_0x4e9ed0['substatusAt']=null;}_0x219fbf(null,_0x4e9ed0);},'afterUpdate':function(_0x3aa84a,_0x200f0a,_0x10fce6){var _0xdc943b=_0x135b93['models'];var _0x452c13=_0x3aa84a[_0x421e('0x16')]({'plain':!![]});if(_0x452c13[_0x421e('0x13')]){return _0xdc943b[_0x421e('0x17')][_0x421e('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x452c13['id']}})[_0x421e('0x19')](function(){_0x10fce6();})[_0x421e('0x1a')](function(_0xba49fb){_0x10fce6(_0xba49fb);});}else{_0x10fce6();}}},'charset':_0x421e('0x1b'),'collate':_0x421e('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index a5f0a59..976a2b5 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 _0x4312=['where','attributes','limit','UpdateMailInteraction','find','addTags','body','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailInteraction','update','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4312,0xaf));var _0x2431=function(_0x406459,_0x2a5eae){_0x406459=_0x406459-0x0;var _0x6895c3=_0x4312[_0x406459];return _0x6895c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2431('0x0'));var BPromise=require(_0x2431('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2431('0x2'));var db=require(_0x2431('0x3'))['db'];var utils=require(_0x2431('0x4'));var logger=require(_0x2431('0x5'))(_0x2431('0x6'));var config=require(_0x2431('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2431('0x8')]['http']({'port':0x232a});config[_0x2431('0x9')]=_[_0x2431('0xa')](config['redis'],{'host':_0x2431('0xb'),'port':0x18eb});var socket=require(_0x2431('0xc'))(new Redis(config[_0x2431('0x9')]));require('./mailInteraction.socket')[_0x2431('0xd')](socket);function respondWithRpcPromise(_0x26b223,_0xb751e,_0x568a96){return new BPromise(function(_0x12615b,_0x4a71f2){return client[_0x2431('0xe')](_0x26b223,_0x568a96)[_0x2431('0xf')](function(_0x384711){logger['info'](_0x2431('0x10'),_0xb751e,_0x2431('0x11'));logger[_0x2431('0x12')](_0x2431('0x13'),_0xb751e,'request\x20sent',JSON[_0x2431('0x14')](_0x384711));if(_0x384711[_0x2431('0x15')]){if(_0x384711[_0x2431('0x15')][_0x2431('0x16')]===0x1f4){logger[_0x2431('0x15')](_0x2431('0x10'),_0xb751e,_0x384711[_0x2431('0x15')][_0x2431('0x17')]);return _0x4a71f2(_0x384711[_0x2431('0x15')]['message']);}logger[_0x2431('0x15')](_0x2431('0x10'),_0xb751e,_0x384711[_0x2431('0x15')][_0x2431('0x17')]);return _0x12615b(_0x384711[_0x2431('0x15')][_0x2431('0x17')]);}else{logger[_0x2431('0x18')](_0x2431('0x10'),_0xb751e,_0x2431('0x11'));_0x12615b(_0x384711[_0x2431('0x19')][_0x2431('0x17')]);}})[_0x2431('0x1a')](function(_0x3b1776){logger[_0x2431('0x15')]('MailInteraction,\x20%s,\x20%s',_0xb751e,_0x3b1776);_0x4a71f2(_0x3b1776);});});}exports['UpdateMailInteraction']=function(_0x3b4fa0){var _0x41b5df=this;return new Promise(function(_0x2e6b2b,_0x51d1ef){return db[_0x2431('0x1b')][_0x2431('0x1c')](_0x3b4fa0['body'],{'raw':_0x3b4fa0['options']?_0x3b4fa0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0[_0x2431('0x1d')][_0x2431('0x1e')]||null:null,'attributes':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0['options'][_0x2431('0x1f')]||null:null,'limit':_0x3b4fa0['options']?_0x3b4fa0[_0x2431('0x1d')][_0x2431('0x20')]||null:null})[_0x2431('0xf')](function(_0x5e8ca1){logger[_0x2431('0x18')](_0x2431('0x21'),_0x3b4fa0);logger[_0x2431('0x12')]('UpdateMailInteraction',_0x3b4fa0,JSON['stringify'](_0x5e8ca1));_0x2e6b2b(_0x5e8ca1);})['catch'](function(_0x30a845){logger['error'](_0x2431('0x21'),_0x30a845[_0x2431('0x17')],_0x3b4fa0);_0x51d1ef(_0x41b5df[_0x2431('0x15')](0x1f4,_0x30a845[_0x2431('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x4ceb17){return new Promise(function(_0x24995f,_0x3954cc){return db['MailInteraction'][_0x2431('0x22')]({'where':_0x4ceb17[_0x2431('0x1d')]?_0x4ceb17['options'][_0x2431('0x1e')]||null:null})[_0x2431('0xf')](function(_0x553b1e){if(_0x553b1e){return _0x553b1e[_0x2431('0x23')](_0x4ceb17[_0x2431('0x24')][_0x2431('0x25')],_[_0x2431('0x26')](_0x4ceb17[_0x2431('0x24')],[_0x2431('0x25'),'id'])||{});}})[_0x2431('0x27')](function(_0x20ffad){logger[_0x2431('0x18')](_0x2431('0x28'),_0x4ceb17);logger[_0x2431('0x12')](_0x2431('0x28'),_0x4ceb17,JSON[_0x2431('0x14')](_0x20ffad));_0x24995f(_0x20ffad);})[_0x2431('0x1a')](function(_0x5597e6){logger[_0x2431('0x15')]('AddTags',_0x5597e6[_0x2431('0x17')],_0x4ceb17);_0x3954cc(_this[_0x2431('0x15')](0x1f4,_0x5597e6[_0x2431('0x17')]));});});}; \ No newline at end of file +var _0x9a3d=['catch','AddTagsToMailInteraction','find','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','then'];(function(_0x2bc371,_0x4db983){var _0xee4467=function(_0x141fc8){while(--_0x141fc8){_0x2bc371['push'](_0x2bc371['shift']());}};_0xee4467(++_0x4db983);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x24c4b7,_0x5ab930){_0x24c4b7=_0x24c4b7-0x0;var _0x1a9b2e=_0x9a3d[_0x24c4b7];return _0x1a9b2e;};'use strict';var _=require('lodash');var util=require(_0xd9a3('0x0'));var moment=require(_0xd9a3('0x1'));var BPromise=require(_0xd9a3('0x2'));var rs=require(_0xd9a3('0x3'));var fs=require('fs');var Redis=require(_0xd9a3('0x4'));var db=require(_0xd9a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9a3('0x6'))(_0xd9a3('0x7'));var config=require(_0xd9a3('0x8'));var jayson=require(_0xd9a3('0x9'));var client=jayson['client'][_0xd9a3('0xa')]({'port':0x232a});config[_0xd9a3('0xb')]=_[_0xd9a3('0xc')](config[_0xd9a3('0xb')],{'host':_0xd9a3('0xd'),'port':0x18eb});var socket=require(_0xd9a3('0xe'))(new Redis(config[_0xd9a3('0xb')]));require(_0xd9a3('0xf'))['register'](socket);function respondWithRpcPromise(_0x407a3a,_0xa8d3ac,_0x13b0a5){return new BPromise(function(_0x56fab5,_0x1f7d7f){return client[_0xd9a3('0x10')](_0x407a3a,_0x13b0a5)['then'](function(_0x38baff){logger[_0xd9a3('0x11')](_0xd9a3('0x12'),_0xa8d3ac,_0xd9a3('0x13'));logger[_0xd9a3('0x14')](_0xd9a3('0x15'),_0xa8d3ac,_0xd9a3('0x13'),JSON[_0xd9a3('0x16')](_0x38baff));if(_0x38baff['error']){if(_0x38baff[_0xd9a3('0x17')][_0xd9a3('0x18')]===0x1f4){logger[_0xd9a3('0x17')](_0xd9a3('0x12'),_0xa8d3ac,_0x38baff[_0xd9a3('0x17')][_0xd9a3('0x19')]);return _0x1f7d7f(_0x38baff[_0xd9a3('0x17')]['message']);}logger[_0xd9a3('0x17')]('MailInteraction,\x20%s,\x20%s',_0xa8d3ac,_0x38baff['error'][_0xd9a3('0x19')]);return _0x56fab5(_0x38baff['error']['message']);}else{logger[_0xd9a3('0x11')](_0xd9a3('0x12'),_0xa8d3ac,'request\x20sent');_0x56fab5(_0x38baff['result']['message']);}})['catch'](function(_0x54c7f9){logger[_0xd9a3('0x17')]('MailInteraction,\x20%s,\x20%s',_0xa8d3ac,_0x54c7f9);_0x1f7d7f(_0x54c7f9);});});}exports[_0xd9a3('0x1a')]=function(_0x36d503){var _0x4eca09=this;return new Promise(function(_0x136610,_0x12674f){return db[_0xd9a3('0x1b')][_0xd9a3('0x1c')](_0x36d503[_0xd9a3('0x1d')],{'raw':_0x36d503[_0xd9a3('0x1e')]?_0x36d503[_0xd9a3('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36d503[_0xd9a3('0x1e')]?_0x36d503[_0xd9a3('0x1e')][_0xd9a3('0x1f')]||null:null,'attributes':_0x36d503[_0xd9a3('0x1e')]?_0x36d503[_0xd9a3('0x1e')][_0xd9a3('0x20')]||null:null,'limit':_0x36d503['options']?_0x36d503[_0xd9a3('0x1e')][_0xd9a3('0x21')]||null:null})[_0xd9a3('0x22')](function(_0x20022e){logger[_0xd9a3('0x11')](_0xd9a3('0x1a'),_0x36d503);logger[_0xd9a3('0x14')](_0xd9a3('0x1a'),_0x36d503,JSON['stringify'](_0x20022e));_0x136610(_0x20022e);})[_0xd9a3('0x23')](function(_0x31ebd5){logger[_0xd9a3('0x17')]('UpdateMailInteraction',_0x31ebd5[_0xd9a3('0x19')],_0x36d503);_0x12674f(_0x4eca09['error'](0x1f4,_0x31ebd5[_0xd9a3('0x19')]));});});};exports[_0xd9a3('0x24')]=function(_0x81abf5){return new Promise(function(_0x2ca767,_0x12f0e6){return db[_0xd9a3('0x1b')][_0xd9a3('0x25')]({'where':_0x81abf5[_0xd9a3('0x1e')]?_0x81abf5['options'][_0xd9a3('0x1f')]||null:null})[_0xd9a3('0x22')](function(_0xe0d8aa){if(_0xe0d8aa){return _0xe0d8aa['addTags'](_0x81abf5[_0xd9a3('0x1d')][_0xd9a3('0x26')],_['omit'](_0x81abf5['body'],[_0xd9a3('0x26'),'id'])||{});}})[_0xd9a3('0x27')](function(_0x2678c5){logger['info'](_0xd9a3('0x28'),_0x81abf5);logger[_0xd9a3('0x14')](_0xd9a3('0x28'),_0x81abf5,JSON[_0xd9a3('0x16')](_0x2678c5));_0x2ca767(_0x2678c5);})[_0xd9a3('0x23')](function(_0x20e7cb){logger['error'](_0xd9a3('0x28'),_0x20e7cb[_0xd9a3('0x19')],_0x81abf5);_0x12f0e6(_this[_0xd9a3('0x17')](0x1f4,_0x20e7cb[_0xd9a3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 4a1269f..fce156f 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 _0xaf2f=['update','emit','removeListener','register','length','mailInteraction:','remove'];(function(_0x4a0b7a,_0x1ded24){var _0x2dec04=function(_0x3f84ec){while(--_0x3f84ec){_0x4a0b7a['push'](_0x4a0b7a['shift']());}};_0x2dec04(++_0x1ded24);}(_0xaf2f,0x1e9));var _0xfaf2=function(_0x43443f,_0x51014d){_0x43443f=_0x43443f-0x0;var _0x1ec13b=_0xaf2f[_0x43443f];return _0x1ec13b;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xfaf2('0x0'),_0xfaf2('0x1')];function createListener(_0x6e294e,_0x150ca4){return function(_0x5d038c){_0x150ca4[_0xfaf2('0x2')](_0x6e294e,_0x5d038c);};}function removeListener(_0x1fb808,_0x329155){return function(){MailInteractionEvents[_0xfaf2('0x3')](_0x1fb808,_0x329155);};}exports[_0xfaf2('0x4')]=function(_0x5946c3){for(var _0x28d879=0x0,_0x28ee59=events[_0xfaf2('0x5')];_0x28d879<_0x28ee59;_0x28d879++){var _0xeffb1c=events[_0x28d879];var _0x449ea0=createListener(_0xfaf2('0x6')+_0xeffb1c,_0x5946c3);MailInteractionEvents['on'](_0xeffb1c,_0x449ea0);}}; \ No newline at end of file +var _0x774a=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x41d41c,_0x199583){var _0x44fe54=function(_0x5df0c5){while(--_0x5df0c5){_0x41d41c['push'](_0x41d41c['shift']());}};_0x44fe54(++_0x199583);}(_0x774a,0x12e));var _0xa774=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x774a[_0x14add3];return _0x4a174f;};'use strict';var MailInteractionEvents=require(_0xa774('0x0'));var events=[_0xa774('0x1'),_0xa774('0x2'),_0xa774('0x3')];function createListener(_0x2bdb5d,_0x1b90bc){return function(_0x4c7993){_0x1b90bc[_0xa774('0x4')](_0x2bdb5d,_0x4c7993);};}function removeListener(_0x538ab9,_0x52f43e){return function(){MailInteractionEvents[_0xa774('0x5')](_0x538ab9,_0x52f43e);};}exports[_0xa774('0x6')]=function(_0x2cb220){for(var _0x329f45=0x0,_0x23785d=events[_0xa774('0x7')];_0x329f45<_0x23785d;_0x329f45++){var _0x324187=events[_0x329f45];var _0x436b11=createListener(_0xa774('0x8')+_0x324187,_0x2cb220);MailInteractionEvents['on'](_0x324187,_0x436b11);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 5f38f08..46b63d4 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 _0x62c0=['util','path','connect-timeout','../../components/auth/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','/:id','show','/:id/download','post','tracked','mail','put','accept','/:id/reject','reject','multer'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x62c0,0xdb));var _0x062c=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x62c0[_0x5eef05];return _0x56d4b8;};'use strict';var multer=require(_0x062c('0x0'));var util=require(_0x062c('0x1'));var path=require(_0x062c('0x2'));var timeout=require(_0x062c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x062c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x062c('0x5'));var controller=require(_0x062c('0x6'));router[_0x062c('0x7')]('/',auth['isAuthenticated'](),controller[_0x062c('0x8')]);router[_0x062c('0x7')]('/describe',auth[_0x062c('0x9')](),controller['describe']);router[_0x062c('0x7')](_0x062c('0xa'),auth[_0x062c('0x9')](),controller[_0x062c('0xb')]);router[_0x062c('0x7')](_0x062c('0xc'),auth[_0x062c('0x9')](),controller['download']);router[_0x062c('0xd')]('/',auth[_0x062c('0x9')](),interaction[_0x062c('0xe')](_0x062c('0xf'),'mailmessage:create'),controller['create']);router[_0x062c('0x10')](_0x062c('0xa'),auth[_0x062c('0x9')](),controller['update']);router[_0x062c('0x10')]('/:id/accept',auth[_0x062c('0x9')](),controller[_0x062c('0x11')]);router[_0x062c('0x10')](_0x062c('0x12'),auth[_0x062c('0x9')](),controller[_0x062c('0x13')]);router['delete'](_0x062c('0xa'),auth[_0x062c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x80df=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','mail','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3eb98a,_0x422440){var _0x1e000b=function(_0x450ba8){while(--_0x450ba8){_0x3eb98a['push'](_0x3eb98a['shift']());}};_0x1e000b(++_0x422440);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var path=require(_0xf80d('0x2'));var timeout=require(_0xf80d('0x3'));var express=require('express');var router=express[_0xf80d('0x4')]();var fs_extra=require(_0xf80d('0x5'));var auth=require(_0xf80d('0x6'));var interaction=require(_0xf80d('0x7'));var config=require(_0xf80d('0x8'));var controller=require(_0xf80d('0x9'));router[_0xf80d('0xa')]('/',auth[_0xf80d('0xb')](),controller[_0xf80d('0xc')]);router[_0xf80d('0xa')]('/describe',auth[_0xf80d('0xb')](),controller[_0xf80d('0xd')]);router[_0xf80d('0xa')](_0xf80d('0xe'),auth[_0xf80d('0xb')](),controller[_0xf80d('0xf')]);router[_0xf80d('0xa')](_0xf80d('0x10'),auth[_0xf80d('0xb')](),controller[_0xf80d('0x11')]);router[_0xf80d('0x12')]('/',auth[_0xf80d('0xb')](),interaction[_0xf80d('0x13')](_0xf80d('0x14'),'mailmessage:create'),controller['create']);router[_0xf80d('0x15')](_0xf80d('0xe'),auth['isAuthenticated'](),controller[_0xf80d('0x16')]);router['put'](_0xf80d('0x17'),auth['isAuthenticated'](),controller[_0xf80d('0x18')]);router['put'](_0xf80d('0x19'),auth[_0xf80d('0xb')](),controller[_0xf80d('0x1a')]);router[_0xf80d('0x1b')](_0xf80d('0xe'),auth[_0xf80d('0xb')](),controller[_0xf80d('0x1c')]);module[_0xf80d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 5eef216..957bf6d 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 _0x1ef6=['out','STRING','long','DATE','INTEGER','Email','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM'];(function(_0xcae7c6,_0x1996a4){var _0x20c01b=function(_0xce4e50){while(--_0xce4e50){_0xcae7c6['push'](_0xcae7c6['shift']());}};_0x20c01b(++_0x1996a4);}(_0x1ef6,0x11a));var _0x61ef=function(_0x29be28,_0x1d71e5){_0x29be28=_0x29be28-0x0;var _0x5bcc73=_0x1ef6[_0x29be28];return _0x5bcc73;};'use strict';var Sequelize=require(_0x61ef('0x0'));var _=require(_0x61ef('0x1'));module['exports']={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x61ef('0x2')](_0x61ef('0x3'))},'read':{'type':Sequelize[_0x61ef('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x61ef('0x5')]('in',_0x61ef('0x6')),'defaultValue':_0x61ef('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x61ef('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x61ef('0x2')](_0x61ef('0x8'))},'cc':{'type':Sequelize[_0x61ef('0x2')](_0x61ef('0x8'))},'bcc':{'type':Sequelize[_0x61ef('0x2')](_0x61ef('0x8'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x61ef('0x9')]},'attach':{'type':Sequelize[_0x61ef('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x61ef('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x61ef('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x61ef('0x8'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize['ENUM'](_0x61ef('0xb'),'Chat'),'defaultValue':_0x61ef('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x71ff=['STRING','long','INTEGER','DATE','Email','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x38edc7,_0x5d0576){var _0x3eb41e=function(_0x2c0917){while(--_0x2c0917){_0x38edc7['push'](_0x38edc7['shift']());}};_0x3eb41e(++_0x5d0576);}(_0x71ff,0x144));var _0xf71f=function(_0xf56197,_0x3da8f3){_0xf56197=_0xf56197-0x0;var _0x3dd377=_0x71ff[_0xf56197];return _0x3dd377;};'use strict';var Sequelize=require(_0xf71f('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xf71f('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf71f('0x1')](_0xf71f('0x2'))},'read':{'type':Sequelize[_0xf71f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf71f('0x4')]('in',_0xf71f('0x5')),'defaultValue':_0xf71f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf71f('0x6')](0x1fe)},'from':{'type':Sequelize[_0xf71f('0x6')]},'to':{'type':Sequelize[_0xf71f('0x1')]('long')},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0xf71f('0x1')](_0xf71f('0x7'))},'subject':{'type':Sequelize[_0xf71f('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xf71f('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf71f('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf71f('0x9')]},'originTo':{'type':Sequelize[_0xf71f('0x1')](_0xf71f('0x7'))},'originCc':{'type':Sequelize[_0xf71f('0x1')](_0xf71f('0x7'))},'originChannel':{'type':Sequelize[_0xf71f('0x4')](_0xf71f('0xa'),'Chat'),'defaultValue':_0xf71f('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 33a3131..e59f347 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 _0x4a83=['headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','index','MailMessage','key','model','map','query','intersection','attributes','length','nolimit','filters','pick','filter','merge','where','type','VIRTUAL','includeAll','findAll','rows','params','keys','rawAttributes','fields','include','options','find','body','describe','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','attachments','server/files/attachments','basename','CmContact','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','agent','manual','SIP/%s','channel','event','fromString','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','interface','motionChannel','EventManager','unix','join','server','files','tmp','root','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments'];(function(_0x59197b,_0x35ec49){var _0x2c5edf=function(_0x3c7354){while(--_0x3c7354){_0x59197b['push'](_0x59197b['shift']());}};_0x2c5edf(++_0x35ec49);}(_0x4a83,0x143));var _0x34a8=function(_0x1b45d0,_0x5f3d83){_0x1b45d0=_0x1b45d0-0x0;var _0x3d2feb=_0x4a83[_0x1b45d0];return _0x3d2feb;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x34a8('0x0'));var util=require(_0x34a8('0x1'));var path=require(_0x34a8('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x34a8('0x3'));var htmlToText=require(_0x34a8('0x4'));var qs=require(_0x34a8('0x5'));var logger=require('../../config/logger')(_0x34a8('0x6'));var interaction_log=require('../../config/logger')(_0x34a8('0x7'));var config=require(_0x34a8('0x8'));var db=require(_0x34a8('0x9'))['db'];config[_0x34a8('0xa')]=_[_0x34a8('0xb')](config[_0x34a8('0xa')],{'host':_0x34a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34a8('0xa')]));var htmlEntities=require(_0x34a8('0xd'));require(_0x34a8('0xe'))[_0x34a8('0xf')](socket);var jayson=require(_0x34a8('0x10'));var client=jayson[_0x34a8('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x34a8('0x11')][_0x34a8('0x12')]({'port':0x232b});var client9002=jayson[_0x34a8('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c57ba,_0x73a38f,_0x287eb4,_0x85b4b){return new BPromise(function(_0x107f84,_0x31563c){var _0x59f8d0=_0x85b4b||client;return _0x59f8d0['request'](_0x2c57ba,_0x287eb4)['then'](function(_0x1ddaef){logger[_0x34a8('0x13')]('MailMessage,\x20%s,\x20%s',_0x73a38f,_0x34a8('0x14'));logger[_0x34a8('0x15')](_0x34a8('0x16'),_0x73a38f,'request\x20sent',JSON[_0x34a8('0x17')](_0x1ddaef));if(_0x1ddaef[_0x34a8('0x18')]){if(_0x1ddaef[_0x34a8('0x18')][_0x34a8('0x19')]===0x1f4){logger['error'](_0x34a8('0x1a'),_0x73a38f,_0x1ddaef[_0x34a8('0x18')][_0x34a8('0x1b')]);return _0x31563c(_0x1ddaef[_0x34a8('0x18')][_0x34a8('0x1b')]);}logger[_0x34a8('0x18')](_0x34a8('0x1a'),_0x73a38f,_0x1ddaef[_0x34a8('0x18')][_0x34a8('0x1b')]);return _0x107f84(_0x1ddaef[_0x34a8('0x18')]['message']);}else{logger[_0x34a8('0x13')](_0x34a8('0x1a'),_0x73a38f,_0x34a8('0x14'));_0x107f84(_0x1ddaef['result']['message']);}})[_0x34a8('0x1c')](function(_0x4f5f73){logger['error']('MailMessage,\x20%s,\x20%s',_0x73a38f,_0x4f5f73);_0x31563c(_0x4f5f73);});});}function respondWithResult(_0x25393b,_0x38e9b1){_0x38e9b1=_0x38e9b1||0xc8;return function(_0x4dc4bb){if(_0x4dc4bb){return _0x25393b[_0x34a8('0x1d')](_0x38e9b1)[_0x34a8('0x1e')](_0x4dc4bb);}};}function respondWithFilteredResult(_0x2c4b5c,_0x50270a){return function(_0x490fbd){if(_0x490fbd){var _0x34b386=typeof _0x50270a[_0x34a8('0x1f')]===_0x34a8('0x20')&&typeof _0x50270a[_0x34a8('0x21')]===_0x34a8('0x20');var _0x4f471f=_0x490fbd[_0x34a8('0x22')];var _0x379a77=_0x34b386?0x0:_0x50270a[_0x34a8('0x1f')];var _0x580c9d=_0x34b386?_0x490fbd[_0x34a8('0x22')]:_0x50270a[_0x34a8('0x1f')]+_0x50270a[_0x34a8('0x21')];var _0x546bac;if(_0x580c9d>=_0x4f471f){_0x580c9d=_0x4f471f;_0x546bac=0xc8;}else{_0x546bac=0xce;}_0x2c4b5c['status'](_0x546bac);return _0x2c4b5c[_0x34a8('0x23')](_0x34a8('0x24'),_0x379a77+'-'+_0x580c9d+'/'+_0x4f471f)[_0x34a8('0x1e')](_0x490fbd);}return null;};}function saveUpdates(_0x3f8ca6){return function(_0x3902b1){if(_0x3902b1){return _0x3902b1[_0x34a8('0x25')](_0x3f8ca6)[_0x34a8('0x26')](function(_0x3b7e8c){return _0x3b7e8c;});}return null;};}function removeEntity(_0x133c4f){return function(_0x43c119){if(_0x43c119){return _0x43c119[_0x34a8('0x27')]()[_0x34a8('0x26')](function(){_0x133c4f[_0x34a8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1de1c8){return function(_0xb32b32){if(!_0xb32b32){_0x1de1c8['sendStatus'](0x194);}return _0xb32b32;};}function handleError(_0x2bfeb4,_0x1fe65b){_0x1fe65b=_0x1fe65b||0x1f4;return function(_0x2f1930){logger[_0x34a8('0x18')](_0x2f1930[_0x34a8('0x28')]);if(_0x2f1930[_0x34a8('0x29')]){delete _0x2f1930[_0x34a8('0x29')];}_0x2bfeb4[_0x34a8('0x1d')](_0x1fe65b)['send'](_0x2f1930);};}exports[_0x34a8('0x2a')]=function(_0x347159,_0x945208){var _0x5a6c2d={},_0x332e21={},_0x36e48b={'count':0x0,'rows':[]};var _0x3a318d=_['map'](db[_0x34a8('0x2b')]['rawAttributes'],function(_0x109f04){return{'name':_0x109f04['fieldName'],'type':_0x109f04['type'][_0x34a8('0x2c')]};});_0x332e21[_0x34a8('0x2d')]=_[_0x34a8('0x2e')](_0x3a318d,'name');_0x332e21[_0x34a8('0x2f')]=_['keys'](_0x347159[_0x34a8('0x2f')]);_0x332e21['filters']=_[_0x34a8('0x30')](_0x332e21['model'],_0x332e21[_0x34a8('0x2f')]);_0x5a6c2d[_0x34a8('0x31')]=_[_0x34a8('0x30')](_0x332e21[_0x34a8('0x2d')],qs['fields'](_0x347159['query']['fields']));_0x5a6c2d['attributes']=_0x5a6c2d[_0x34a8('0x31')][_0x34a8('0x32')]?_0x5a6c2d['attributes']:_0x332e21['model'];if(!_0x347159[_0x34a8('0x2f')]['hasOwnProperty'](_0x34a8('0x33'))){_0x5a6c2d[_0x34a8('0x21')]=qs[_0x34a8('0x21')](_0x347159['query'][_0x34a8('0x21')]);_0x5a6c2d[_0x34a8('0x1f')]=qs[_0x34a8('0x1f')](_0x347159[_0x34a8('0x2f')][_0x34a8('0x1f')]);}_0x5a6c2d['order']=qs['sort'](_0x347159[_0x34a8('0x2f')]['sort']);_0x5a6c2d['where']=qs[_0x34a8('0x34')](_[_0x34a8('0x35')](_0x347159['query'],_0x332e21['filters']),_0x3a318d);if(_0x347159[_0x34a8('0x2f')][_0x34a8('0x36')]){_0x5a6c2d['where']=_[_0x34a8('0x37')](_0x5a6c2d[_0x34a8('0x38')],{'$or':_[_0x34a8('0x2e')](_0x3a318d,function(_0x585bf2){if(_0x585bf2[_0x34a8('0x39')]!==_0x34a8('0x3a')){var _0x261058={};_0x261058[_0x585bf2['name']]={'$like':'%'+_0x347159[_0x34a8('0x2f')][_0x34a8('0x36')]+'%'};return _0x261058;}})});}_0x5a6c2d=_[_0x34a8('0x37')]({},_0x5a6c2d,_0x347159['options']);var _0x41cb31={'where':_0x5a6c2d[_0x34a8('0x38')]};return db[_0x34a8('0x2b')]['count'](_0x41cb31)[_0x34a8('0x26')](function(_0x3716e8){_0x36e48b[_0x34a8('0x22')]=_0x3716e8;if(_0x347159[_0x34a8('0x2f')][_0x34a8('0x3b')]){_0x5a6c2d['include']=[{'all':!![]}];}return db[_0x34a8('0x2b')][_0x34a8('0x3c')](_0x5a6c2d);})[_0x34a8('0x26')](function(_0x49d1be){_0x36e48b[_0x34a8('0x3d')]=_0x49d1be;return _0x36e48b;})[_0x34a8('0x26')](respondWithFilteredResult(_0x945208,_0x5a6c2d))['catch'](handleError(_0x945208,null));};exports['show']=function(_0x162acb,_0x3fc142){var _0x524fa2={'raw':!![],'where':{'id':_0x162acb[_0x34a8('0x3e')]['id']}},_0x1c2a69={};_0x1c2a69[_0x34a8('0x2d')]=_[_0x34a8('0x3f')](db[_0x34a8('0x2b')][_0x34a8('0x40')]);_0x1c2a69[_0x34a8('0x2f')]=_['keys'](_0x162acb[_0x34a8('0x2f')]);_0x1c2a69[_0x34a8('0x34')]=_['intersection'](_0x1c2a69[_0x34a8('0x2d')],_0x1c2a69[_0x34a8('0x2f')]);_0x524fa2[_0x34a8('0x31')]=_[_0x34a8('0x30')](_0x1c2a69[_0x34a8('0x2d')],qs['fields'](_0x162acb[_0x34a8('0x2f')][_0x34a8('0x41')]));_0x524fa2[_0x34a8('0x31')]=_0x524fa2['attributes'][_0x34a8('0x32')]?_0x524fa2[_0x34a8('0x31')]:_0x1c2a69[_0x34a8('0x2d')];if(_0x162acb[_0x34a8('0x2f')][_0x34a8('0x3b')]){_0x524fa2[_0x34a8('0x42')]=[{'all':!![]}];}_0x524fa2=_[_0x34a8('0x37')]({},_0x524fa2,_0x162acb[_0x34a8('0x43')]);return db[_0x34a8('0x2b')][_0x34a8('0x44')](_0x524fa2)[_0x34a8('0x26')](handleEntityNotFound(_0x3fc142,null))[_0x34a8('0x26')](respondWithResult(_0x3fc142,null))['catch'](handleError(_0x3fc142,null));};exports[_0x34a8('0x25')]=function(_0x8a6a96,_0x17c5c7){if(_0x8a6a96[_0x34a8('0x45')]['id']){delete _0x8a6a96['body']['id'];}return db[_0x34a8('0x2b')][_0x34a8('0x44')]({'where':{'id':_0x8a6a96[_0x34a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x17c5c7,null))[_0x34a8('0x26')](saveUpdates(_0x8a6a96[_0x34a8('0x45')],null))[_0x34a8('0x26')](respondWithResult(_0x17c5c7,null))[_0x34a8('0x1c')](handleError(_0x17c5c7,null));};exports[_0x34a8('0x27')]=function(_0x13fdea,_0x469abe){return db['MailMessage']['find']({'where':{'id':_0x13fdea['params']['id']}})['then'](handleEntityNotFound(_0x469abe,null))[_0x34a8('0x26')](removeEntity(_0x469abe,null))[_0x34a8('0x1c')](handleError(_0x469abe,null));};exports[_0x34a8('0x46')]=function(_0x30b9fd,_0x46db3c){return db[_0x34a8('0x2b')][_0x34a8('0x46')]()['then'](respondWithResult(_0x46db3c,null))['catch'](handleError(_0x46db3c,null));};exports['create']=function(_0x19e7c3,_0x19d50a){return db['MailMessage']['create'](_0x19e7c3[_0x34a8('0x45')])['then'](function(_0x8e9239){if(_0x8e9239){if(_0x8e9239[_0x34a8('0x47')]===_0x34a8('0x48')&&!_0x8e9239['secret']){var _0x4c0179,_0x994e89,_0x514394;if(_0x19e7c3[_0x34a8('0x45')]['to']){_0x994e89=_0x19e7c3['body']['to'][_0x34a8('0x49')](',')[0x0];}return db[_0x34a8('0x4a')][_0x34a8('0x4b')]({'where':{'id':_0x8e9239[_0x34a8('0x4c')]},'include':[{'model':db[_0x34a8('0x4d')],'as':_0x34a8('0x4e'),'include':[{'model':db['CmContact'],'as':_0x34a8('0x4f'),'where':{'email':_0x994e89},'limit':0x1,'order':[[_0x34a8('0x50'),_0x34a8('0x51')]]}]},{'model':db[_0x34a8('0x52')],'as':_0x34a8('0x53'),'raw':!![]}]})['then'](function(_0xf0c5c){_0x4c0179=_0xf0c5c;if(_0x4c0179&&_0x4c0179['Smtp']){var _0x5b3fda={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4c0179['Smtp'][_0x34a8('0x54')])){_0x5b3fda[_0x34a8('0x55')]=_0x4c0179[_0x34a8('0x53')][_0x34a8('0x55')];_0x5b3fda['port']=_0x4c0179[_0x34a8('0x53')][_0x34a8('0x56')];_0x5b3fda[_0x34a8('0x57')]=_0x4c0179[_0x34a8('0x53')][_0x34a8('0x57')];if(_0x4c0179[_0x34a8('0x53')]['authentication']){_0x5b3fda[_0x34a8('0x58')]={'user':_0x4c0179['Smtp'][_0x34a8('0x59')],'pass':_0x4c0179[_0x34a8('0x53')][_0x34a8('0x5a')]};}}else{_0x5b3fda['service']=_0x4c0179[_0x34a8('0x53')][_0x34a8('0x54')];_0x5b3fda[_0x34a8('0x58')]={'user':_0x4c0179[_0x34a8('0x53')][_0x34a8('0x59')],'pass':_0x4c0179[_0x34a8('0x53')][_0x34a8('0x5a')]};_0x5b3fda[_0x34a8('0x57')]=_0x4c0179['Smtp']['secure'];}if(_0x19e7c3[_0x34a8('0x45')][_0x34a8('0x5b')]&&_0x19e7c3[_0x34a8('0x45')][_0x34a8('0x5b')][_0x34a8('0x32')]){for(var _0x2bfa22=0x0;_0x2bfa22<_0x19e7c3[_0x34a8('0x45')][_0x34a8('0x5b')][_0x34a8('0x32')];_0x2bfa22+=0x1){_0x19e7c3['body'][_0x34a8('0x5b')][_0x2bfa22]={'filename':_0x19e7c3[_0x34a8('0x45')]['attachments'][_0x2bfa22][_0x34a8('0x29')],'path':path['join'](config['root'],_0x34a8('0x5c'),_0x19e7c3['body'][_0x34a8('0x5b')][_0x2bfa22][_0x34a8('0x5d')])};}}_0x514394={'account':_0x5b3fda,'message':_0x19e7c3[_0x34a8('0x45')]};return;}})['then'](function(){if(_0x4c0179[_0x34a8('0x4e')]){if(_0x4c0179[_0x34a8('0x4e')][_0x34a8('0x4f')]['length']){return _0x4c0179[_0x34a8('0x4e')][_0x34a8('0x4f')][0x0];}else{return db[_0x34a8('0x5e')]['create'](_[_0x34a8('0xb')](_0x19e7c3[_0x34a8('0x45')],{'firstName':_0x19e7c3[_0x34a8('0x45')]['to'],'email':_0x19e7c3[_0x34a8('0x45')]['to'],'phone':_0x19e7c3['body']['to'],'ListId':_0x4c0179['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0x34a8('0x26')](function(){if(_0x514394){return respondWithRpcPromise(_0x34a8('0x5f'),_0x34a8('0x60'),_0x514394,client9003)[_0x34a8('0x26')](function(_0x3156c8){return _0x8e9239['update']({'read':!![],'messageId':_0x3156c8['messageId'],'sentAt':moment()[_0x34a8('0x61')](_0x34a8('0x62'))});})[_0x34a8('0x1c')](function(_0x3a0951){logger[_0x34a8('0x18')]('%s',JSON[_0x34a8('0x17')](_0x3a0951));return _0x8e9239;});}return _0x8e9239;});}return _0x8e9239;}})['then'](respondWithResult(_0x19d50a,0xc9))[_0x34a8('0x1c')](handleError(_0x19d50a,null));};exports[_0x34a8('0x63')]=function(_0x62f757,_0x4d82b1){var _0x3f22af={'agent':{},'channel':_0x34a8('0x64')};if(_0x62f757[_0x34a8('0x45')]['id']){delete _0x62f757[_0x34a8('0x45')]['id'];}_0x62f757[_0x34a8('0x45')]['read']=!![];_0x62f757[_0x34a8('0x45')][_0x34a8('0x65')]=moment()['format'](_0x34a8('0x62'));_0x62f757['body']['UserId']=_0x62f757[_0x34a8('0x45')][_0x34a8('0x66')]||_0x62f757['user']['id'];_0x3f22af['agent']['id']=_0x62f757[_0x34a8('0x45')][_0x34a8('0x66')];return db[_0x34a8('0x2b')][_0x34a8('0x44')]({'where':{'id':_0x62f757[_0x34a8('0x3e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d82b1,null))[_0x34a8('0x26')](saveUpdates(_0x62f757['body'],null))[_0x34a8('0x26')](function(_0x338d6b){if(_0x338d6b){_0x3f22af[_0x34a8('0x1b')]=_0x338d6b[_0x34a8('0x67')]({'plain':!![]});return db[_0x34a8('0x68')][_0x34a8('0x44')]({'where':{'id':_0x338d6b[_0x34a8('0x69')]}});}return null;})[_0x34a8('0x26')](handleEntityNotFound(_0x4d82b1,null))[_0x34a8('0x26')](function(_0x4c73a3){if(_0x4c73a3){return _0x4c73a3[_0x34a8('0x25')]({'UserId':_0x62f757[_0x34a8('0x45')][_0x34a8('0x66')],'read1stAt':_['isNil'](_0x4c73a3[_0x34a8('0x6a')])?moment()['format'](_0x34a8('0x62')):undefined});}return null;})['then'](function(_0x45064f){if(_0x45064f){_0x3f22af[_0x34a8('0x6b')]=_0x45064f[_0x34a8('0x67')]({'plain':!![]});interaction_log['info'](_0x34a8('0x6c'),_0x62f757[_0x34a8('0x59')]['id'],_0x62f757['user']['name'],_0x62f757[_0x34a8('0x59')][_0x34a8('0x6d')],_0x3f22af['interaction']['id'],_0x62f757[_0x34a8('0x45')]?JSON['stringify'](_0x62f757[_0x34a8('0x45')]):_0x34a8('0x6e'));return respondWithRpcPromise(_0x34a8('0x6f'),'acceptMessage',_0x3f22af);}return null;})[_0x34a8('0x26')](function(_0x18060e){var _0x5c6679=_0x34a8('0x70')+_0x18060e[_0x34a8('0x1b')]['ContactId'];return db[_0x34a8('0x71')][_0x34a8('0x2f')](_0x5c6679,{'type':db[_0x34a8('0x72')]['QueryTypes'][_0x34a8('0x73')],'raw':!![]})[_0x34a8('0x26')](function(_0x51ef16){return _0x51ef16;});})[_0x34a8('0x26')](function(_0x5f4b74){if(_0x5f4b74){_0x3f22af[_0x34a8('0x1b')][_0x34a8('0x74')]=_0x5f4b74[0x0];if(!_0x62f757['body'][_0x34a8('0x66')])return;return db[_0x34a8('0x75')][_0x34a8('0x44')]({'where':{'id':_0x62f757['body'][_0x34a8('0x66')],'role':'agent'},'attributes':['id',_0x34a8('0x29'),_0x34a8('0x76'),_0x34a8('0x77'),_0x34a8('0x78')],'raw':!![]});}return null;})[_0x34a8('0x26')](function(_0x368cc0){if(!_0x368cc0)return null;_0x3f22af[_0x34a8('0x1b')][_0x34a8('0x79')]=_0x368cc0;return _0x3f22af;})['then'](function(_0x4c1a5a){if(_0x4c1a5a){if(_0x62f757['body'][_0x34a8('0x7a')]){_0x3f22af['message']['interface']=util[_0x34a8('0x61')](_0x34a8('0x7b'),_0x62f757[_0x34a8('0x59')][_0x34a8('0x29')]);_0x3f22af[_0x34a8('0x1b')][_0x34a8('0x7c')]=_0x3f22af['channel'];_0x3f22af[_0x34a8('0x1b')]['motionChannel']=_0x3f22af[_0x34a8('0x7c')];_0x3f22af[_0x34a8('0x1b')][_0x34a8('0x7d')]=_0x34a8('0x63');_0x3f22af[_0x34a8('0x1b')][_0x34a8('0x45')]=htmlToText[_0x34a8('0x7e')](_0x3f22af['message'][_0x34a8('0x45')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x34a8('0x7f'),'message':_0x3f22af[_0x34a8('0x1b')]},client9002)[_0x34a8('0x26')](function(){return _0x3f22af;});}return _0x3f22af;}return null;})[_0x34a8('0x26')](respondWithResult(_0x4d82b1,null))['catch'](handleError(_0x4d82b1,null));};exports[_0x34a8('0x80')]=function(_0x5b1b8b,_0x294bff){var _0x6205fa={'agent':{},'channel':_0x34a8('0x64')};if(_0x5b1b8b['body']['id']){delete _0x5b1b8b['body']['id'];}_0x5b1b8b[_0x34a8('0x45')][_0x34a8('0x66')]=_0x5b1b8b[_0x34a8('0x45')][_0x34a8('0x66')]||_0x5b1b8b[_0x34a8('0x59')]['id'];_0x6205fa[_0x34a8('0x79')]['id']=_0x5b1b8b[_0x34a8('0x45')][_0x34a8('0x66')];return db[_0x34a8('0x2b')][_0x34a8('0x44')]({'where':{'id':_0x5b1b8b[_0x34a8('0x3e')]['id'],'UserId':null}})[_0x34a8('0x26')](handleEntityNotFound(_0x294bff,null))[_0x34a8('0x26')](function(_0x4ffe0a){if(_0x4ffe0a){_0x6205fa[_0x34a8('0x1b')]=_0x4ffe0a[_0x34a8('0x67')]({'plain':!![]});return db[_0x34a8('0x68')]['find']({'where':{'id':_0x4ffe0a['MailInteractionId']}});}return null;})[_0x34a8('0x26')](handleEntityNotFound(_0x294bff,null))[_0x34a8('0x26')](function(_0x6dd425){if(_0x6dd425){_0x6205fa['interaction']=_0x6dd425[_0x34a8('0x67')]({'plain':!![]});interaction_log[_0x34a8('0x13')](_0x34a8('0x81'),_0x5b1b8b[_0x34a8('0x59')]['id'],_0x5b1b8b[_0x34a8('0x59')][_0x34a8('0x29')],_0x5b1b8b[_0x34a8('0x59')][_0x34a8('0x6d')],_0x6205fa[_0x34a8('0x6b')]['id'],_0x5b1b8b[_0x34a8('0x45')]?JSON['stringify'](_0x5b1b8b[_0x34a8('0x45')]):_0x34a8('0x6e'));return respondWithRpcPromise('RejectMessage',_0x34a8('0x82'),_0x6205fa);}return null;})[_0x34a8('0x26')](function(_0x536373){var _0xf2fe96=_0x34a8('0x70')+_0x536373['message']['ContactId'];return db[_0x34a8('0x71')][_0x34a8('0x2f')](_0xf2fe96,{'type':db['Sequelize'][_0x34a8('0x83')][_0x34a8('0x73')],'raw':!![]})[_0x34a8('0x26')](function(_0x5ce970){return _0x5ce970;});})[_0x34a8('0x26')](function(_0x523c31){if(_0x523c31){_0x6205fa[_0x34a8('0x1b')]['contact']=_0x523c31[0x0];if(!_0x5b1b8b[_0x34a8('0x45')][_0x34a8('0x66')])return;return db[_0x34a8('0x75')][_0x34a8('0x44')]({'where':{'id':_0x5b1b8b['body'][_0x34a8('0x66')],'role':_0x34a8('0x79')},'attributes':['id','name',_0x34a8('0x76'),_0x34a8('0x77'),_0x34a8('0x78')],'raw':!![]});}return null;})[_0x34a8('0x26')](function(_0x4f28be){if(!_0x4f28be)return null;_0x6205fa['message'][_0x34a8('0x79')]=_0x4f28be;return _0x6205fa;})[_0x34a8('0x26')](function(_0xcc592e){if(_0xcc592e){_0xcc592e['message'][_0x34a8('0x84')]=util[_0x34a8('0x61')](_0x34a8('0x7b'),_0x5b1b8b[_0x34a8('0x59')]['name']);_0xcc592e['message']['channel']=_0x6205fa[_0x34a8('0x7c')];_0xcc592e['message'][_0x34a8('0x85')]=_0x6205fa[_0x34a8('0x7c')];_0xcc592e[_0x34a8('0x1b')][_0x34a8('0x7d')]=_0x34a8('0x80');_0xcc592e[_0x34a8('0x1b')][_0x34a8('0x45')]=htmlToText[_0x34a8('0x7e')](_0x6205fa['message'][_0x34a8('0x45')]);respondWithRpcPromise(_0x34a8('0x86'),'EventManager',{'event':'rejectmessage','message':_0xcc592e[_0x34a8('0x1b')]},client9002);return _0x6205fa;}return null;})[_0x34a8('0x26')](respondWithResult(_0x294bff,null))['catch'](handleError(_0x294bff,null));};exports['download']=function(_0x36b504,_0x55431a){var _0x260fdc=moment()[_0x34a8('0x87')]()['toString']();var _0x4f18a2=path[_0x34a8('0x88')](config['root'],_0x34a8('0x89'),_0x34a8('0x8a'),_0x34a8('0x8b'));var _0x58b6ef=path['join'](config[_0x34a8('0x8c')],_0x34a8('0x89'),'files',_0x34a8('0x5b'));var _0xd12d16=util[_0x34a8('0x61')](_0x34a8('0x8d'),_0x260fdc);return db[_0x34a8('0x2b')][_0x34a8('0x44')]({'where':{'id':_0x36b504[_0x34a8('0x3e')]['id']},'attributes':['id',_0x34a8('0x45'),_0x34a8('0x8e'),'to','cc',_0x34a8('0x8f'),_0x34a8('0x90'),_0x34a8('0x91')],'include':_0x36b504[_0x34a8('0x2f')][_0x34a8('0x5b')]?[{'model':db[_0x34a8('0x92')],'as':_0x34a8('0x93')}]:undefined})[_0x34a8('0x26')](handleEntityNotFound(_0x55431a,null))[_0x34a8('0x26')](function(_0x2695f0){if(_0x2695f0){var _0x276301=_0x2695f0;var _0x475762={'from':_0x276301[_0x34a8('0x8e')],'to':_0x276301['to'],'subject':_0x276301[_0x34a8('0x90')],'html':htmlEntities['decode'](_0x276301[_0x34a8('0x45')]),'headers':{'Date':moment(_0x276301[_0x34a8('0x91')])[_0x34a8('0x61')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2695f0['cc']){_0x475762[_0x34a8('0x94')]['Cc']=_0x2695f0['cc'];}if(_0x2695f0[_0x34a8('0x8f')]){_0x475762[_0x34a8('0x94')][_0x34a8('0x95')]=_0x2695f0[_0x34a8('0x8f')];}return new BPromise(function(_0x4f812d,_0x522fc0){if(_0x2695f0[_0x34a8('0x93')]){for(var _0x477109=0x0;_0x477109<_0x2695f0[_0x34a8('0x93')][_0x34a8('0x32')];_0x477109++){var _0x96c09e=_0x2695f0[_0x34a8('0x93')][_0x477109];var _0xf0515a=path[_0x34a8('0x88')](_0x58b6ef,_0x96c09e['basename']);if(fs[_0x34a8('0x96')](_0xf0515a)){_0x475762[_0x34a8('0x5b')][_0x34a8('0x97')]({'name':_0x96c09e['name'],'contentType':_0x96c09e[_0x34a8('0x39')],'data':fs[_0x34a8('0x98')](_0xf0515a)});}}}emlformat[_0x34a8('0x99')](_0x475762,function(_0xf059a5,_0x51cf3e){if(_0xf059a5)return _0x522fc0(_0xf059a5);fs[_0x34a8('0x9a')](path[_0x34a8('0x88')](_0x4f18a2,_0xd12d16),_0x51cf3e);return _0x4f812d(_0x51cf3e);});});}})[_0x34a8('0x26')](function(_0x120577){if(_0x120577){return _0x55431a[_0x34a8('0x9b')](path[_0x34a8('0x88')](_0x4f18a2,_0xd12d16),_0xd12d16,function(_0x338468){if(!_0x338468)fs[_0x34a8('0x9c')](path[_0x34a8('0x88')](_0x4f18a2,_0xd12d16));});}})['catch'](handleError(_0x55431a,null));}; \ No newline at end of file +var _0x2f8f=['filter','options','include','findAll','show','params','includeAll','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','User','interface','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','util','lodash','ioredis','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x2f8f,0x104));var _0xf2f8=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x2f8f[_0x50cd41];return _0x399475;};'use strict';var emlformat=require(_0xf2f8('0x0'));var moment=require(_0xf2f8('0x1'));var BPromise=require('bluebird');var util=require(_0xf2f8('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xf2f8('0x3'));var Redis=require(_0xf2f8('0x4'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var interaction_log=require(_0xf2f8('0x5'))(_0xf2f8('0x6'));var config=require(_0xf2f8('0x7'));var db=require(_0xf2f8('0x8'))['db'];config[_0xf2f8('0x9')]=_[_0xf2f8('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf2f8('0xb'))(new Redis(config[_0xf2f8('0x9')]));var htmlEntities=require(_0xf2f8('0xc'));require(_0xf2f8('0xd'))[_0xf2f8('0xe')](socket);var jayson=require(_0xf2f8('0xf'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0xf2f8('0x10')]['http']({'port':0x232b});var client9002=jayson[_0xf2f8('0x10')][_0xf2f8('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x417644,_0x4215bd,_0x1f26df,_0x48981d){return new BPromise(function(_0x1d4216,_0x4c12e9){var _0x13df1a=_0x48981d||client;return _0x13df1a[_0xf2f8('0x12')](_0x417644,_0x1f26df)[_0xf2f8('0x13')](function(_0x52f277){logger[_0xf2f8('0x14')](_0xf2f8('0x15'),_0x4215bd,_0xf2f8('0x16'));logger['debug'](_0xf2f8('0x17'),_0x4215bd,_0xf2f8('0x16'),JSON[_0xf2f8('0x18')](_0x52f277));if(_0x52f277['error']){if(_0x52f277[_0xf2f8('0x19')][_0xf2f8('0x1a')]===0x1f4){logger[_0xf2f8('0x19')](_0xf2f8('0x15'),_0x4215bd,_0x52f277['error'][_0xf2f8('0x1b')]);return _0x4c12e9(_0x52f277[_0xf2f8('0x19')][_0xf2f8('0x1b')]);}logger['error'](_0xf2f8('0x15'),_0x4215bd,_0x52f277[_0xf2f8('0x19')]['message']);return _0x1d4216(_0x52f277[_0xf2f8('0x19')][_0xf2f8('0x1b')]);}else{logger[_0xf2f8('0x14')](_0xf2f8('0x15'),_0x4215bd,_0xf2f8('0x16'));_0x1d4216(_0x52f277['result'][_0xf2f8('0x1b')]);}})[_0xf2f8('0x1c')](function(_0x53edb7){logger[_0xf2f8('0x19')](_0xf2f8('0x15'),_0x4215bd,_0x53edb7);_0x4c12e9(_0x53edb7);});});}function respondWithResult(_0x4ae97a,_0x191b4c){_0x191b4c=_0x191b4c||0xc8;return function(_0xe2d402){if(_0xe2d402){return _0x4ae97a[_0xf2f8('0x1d')](_0x191b4c)[_0xf2f8('0x1e')](_0xe2d402);}};}function respondWithFilteredResult(_0x2a6421,_0x96de75){return function(_0x189b8b){if(_0x189b8b){var _0x1c1bfe=typeof _0x96de75['offset']==='undefined'&&typeof _0x96de75[_0xf2f8('0x1f')]==='undefined';var _0x5882ea=_0x189b8b[_0xf2f8('0x20')];var _0x5bf863=_0x1c1bfe?0x0:_0x96de75[_0xf2f8('0x21')];var _0x924633=_0x1c1bfe?_0x189b8b[_0xf2f8('0x20')]:_0x96de75[_0xf2f8('0x21')]+_0x96de75[_0xf2f8('0x1f')];var _0x407f6d;if(_0x924633>=_0x5882ea){_0x924633=_0x5882ea;_0x407f6d=0xc8;}else{_0x407f6d=0xce;}_0x2a6421[_0xf2f8('0x1d')](_0x407f6d);return _0x2a6421[_0xf2f8('0x22')](_0xf2f8('0x23'),_0x5bf863+'-'+_0x924633+'/'+_0x5882ea)[_0xf2f8('0x1e')](_0x189b8b);}return null;};}function saveUpdates(_0x4d0f2d){return function(_0x3d3c26){if(_0x3d3c26){return _0x3d3c26[_0xf2f8('0x24')](_0x4d0f2d)[_0xf2f8('0x13')](function(_0x4820fb){return _0x4820fb;});}return null;};}function removeEntity(_0x2381a0){return function(_0x36b84e){if(_0x36b84e){return _0x36b84e[_0xf2f8('0x25')]()[_0xf2f8('0x13')](function(){_0x2381a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2703){return function(_0x109a14){if(!_0x109a14){_0x3a2703['sendStatus'](0x194);}return _0x109a14;};}function handleError(_0x788228,_0x2f4595){_0x2f4595=_0x2f4595||0x1f4;return function(_0x3ff7d4){logger[_0xf2f8('0x19')](_0x3ff7d4[_0xf2f8('0x26')]);if(_0x3ff7d4[_0xf2f8('0x27')]){delete _0x3ff7d4[_0xf2f8('0x27')];}_0x788228['status'](_0x2f4595)[_0xf2f8('0x28')](_0x3ff7d4);};}exports[_0xf2f8('0x29')]=function(_0x1bf466,_0x44b284){var _0x4082d7={},_0x419c99={},_0x385716={'count':0x0,'rows':[]};var _0x4c476f=_[_0xf2f8('0x2a')](db[_0xf2f8('0x2b')][_0xf2f8('0x2c')],function(_0x54ba7a){return{'name':_0x54ba7a['fieldName'],'type':_0x54ba7a[_0xf2f8('0x2d')][_0xf2f8('0x2e')]};});_0x419c99[_0xf2f8('0x2f')]=_['map'](_0x4c476f,_0xf2f8('0x27'));_0x419c99[_0xf2f8('0x30')]=_[_0xf2f8('0x31')](_0x1bf466[_0xf2f8('0x30')]);_0x419c99[_0xf2f8('0x32')]=_[_0xf2f8('0x33')](_0x419c99[_0xf2f8('0x2f')],_0x419c99[_0xf2f8('0x30')]);_0x4082d7[_0xf2f8('0x34')]=_[_0xf2f8('0x33')](_0x419c99[_0xf2f8('0x2f')],qs[_0xf2f8('0x35')](_0x1bf466[_0xf2f8('0x30')]['fields']));_0x4082d7[_0xf2f8('0x34')]=_0x4082d7[_0xf2f8('0x34')][_0xf2f8('0x36')]?_0x4082d7[_0xf2f8('0x34')]:_0x419c99[_0xf2f8('0x2f')];if(!_0x1bf466[_0xf2f8('0x30')]['hasOwnProperty']('nolimit')){_0x4082d7['limit']=qs[_0xf2f8('0x1f')](_0x1bf466[_0xf2f8('0x30')]['limit']);_0x4082d7[_0xf2f8('0x21')]=qs[_0xf2f8('0x21')](_0x1bf466[_0xf2f8('0x30')][_0xf2f8('0x21')]);}_0x4082d7['order']=qs[_0xf2f8('0x37')](_0x1bf466[_0xf2f8('0x30')][_0xf2f8('0x37')]);_0x4082d7[_0xf2f8('0x38')]=qs[_0xf2f8('0x32')](_[_0xf2f8('0x39')](_0x1bf466[_0xf2f8('0x30')],_0x419c99[_0xf2f8('0x32')]),_0x4c476f);if(_0x1bf466[_0xf2f8('0x30')]['filter']){_0x4082d7[_0xf2f8('0x38')]=_[_0xf2f8('0x3a')](_0x4082d7[_0xf2f8('0x38')],{'$or':_[_0xf2f8('0x2a')](_0x4c476f,function(_0x39ed97){if(_0x39ed97['type']!==_0xf2f8('0x3b')){var _0x442fe3={};_0x442fe3[_0x39ed97[_0xf2f8('0x27')]]={'$like':'%'+_0x1bf466[_0xf2f8('0x30')][_0xf2f8('0x3c')]+'%'};return _0x442fe3;}})});}_0x4082d7=_[_0xf2f8('0x3a')]({},_0x4082d7,_0x1bf466[_0xf2f8('0x3d')]);var _0x21c99a={'where':_0x4082d7[_0xf2f8('0x38')]};return db[_0xf2f8('0x2b')][_0xf2f8('0x20')](_0x21c99a)[_0xf2f8('0x13')](function(_0x7ed2d5){_0x385716[_0xf2f8('0x20')]=_0x7ed2d5;if(_0x1bf466[_0xf2f8('0x30')]['includeAll']){_0x4082d7[_0xf2f8('0x3e')]=[{'all':!![]}];}return db[_0xf2f8('0x2b')][_0xf2f8('0x3f')](_0x4082d7);})[_0xf2f8('0x13')](function(_0x133530){_0x385716['rows']=_0x133530;return _0x385716;})[_0xf2f8('0x13')](respondWithFilteredResult(_0x44b284,_0x4082d7))[_0xf2f8('0x1c')](handleError(_0x44b284,null));};exports[_0xf2f8('0x40')]=function(_0x34986f,_0x51387e){var _0x249f74={'raw':!![],'where':{'id':_0x34986f[_0xf2f8('0x41')]['id']}},_0x182119={};_0x182119[_0xf2f8('0x2f')]=_[_0xf2f8('0x31')](db['MailMessage']['rawAttributes']);_0x182119['query']=_['keys'](_0x34986f[_0xf2f8('0x30')]);_0x182119[_0xf2f8('0x32')]=_[_0xf2f8('0x33')](_0x182119['model'],_0x182119[_0xf2f8('0x30')]);_0x249f74[_0xf2f8('0x34')]=_[_0xf2f8('0x33')](_0x182119[_0xf2f8('0x2f')],qs[_0xf2f8('0x35')](_0x34986f['query'][_0xf2f8('0x35')]));_0x249f74[_0xf2f8('0x34')]=_0x249f74[_0xf2f8('0x34')][_0xf2f8('0x36')]?_0x249f74[_0xf2f8('0x34')]:_0x182119[_0xf2f8('0x2f')];if(_0x34986f['query'][_0xf2f8('0x42')]){_0x249f74[_0xf2f8('0x3e')]=[{'all':!![]}];}_0x249f74=_[_0xf2f8('0x3a')]({},_0x249f74,_0x34986f[_0xf2f8('0x3d')]);return db[_0xf2f8('0x2b')][_0xf2f8('0x43')](_0x249f74)[_0xf2f8('0x13')](handleEntityNotFound(_0x51387e,null))[_0xf2f8('0x13')](respondWithResult(_0x51387e,null))[_0xf2f8('0x1c')](handleError(_0x51387e,null));};exports[_0xf2f8('0x24')]=function(_0x20b6bb,_0x5db687){if(_0x20b6bb['body']['id']){delete _0x20b6bb[_0xf2f8('0x44')]['id'];}return db[_0xf2f8('0x2b')][_0xf2f8('0x43')]({'where':{'id':_0x20b6bb[_0xf2f8('0x41')]['id']}})[_0xf2f8('0x13')](handleEntityNotFound(_0x5db687,null))[_0xf2f8('0x13')](saveUpdates(_0x20b6bb[_0xf2f8('0x44')],null))[_0xf2f8('0x13')](respondWithResult(_0x5db687,null))[_0xf2f8('0x1c')](handleError(_0x5db687,null));};exports[_0xf2f8('0x25')]=function(_0x3528fd,_0xf27aa4){return db[_0xf2f8('0x2b')][_0xf2f8('0x43')]({'where':{'id':_0x3528fd[_0xf2f8('0x41')]['id']}})[_0xf2f8('0x13')](handleEntityNotFound(_0xf27aa4,null))[_0xf2f8('0x13')](removeEntity(_0xf27aa4,null))[_0xf2f8('0x1c')](handleError(_0xf27aa4,null));};exports['describe']=function(_0x4735ce,_0x282afb){return db[_0xf2f8('0x2b')][_0xf2f8('0x45')]()[_0xf2f8('0x13')](respondWithResult(_0x282afb,null))[_0xf2f8('0x1c')](handleError(_0x282afb,null));};exports[_0xf2f8('0x46')]=function(_0x4263f4,_0x4f6b35){return db['MailMessage'][_0xf2f8('0x46')](_0x4263f4[_0xf2f8('0x44')])[_0xf2f8('0x13')](function(_0x231e34){if(_0x231e34){if(_0x231e34[_0xf2f8('0x47')]===_0xf2f8('0x48')&&!_0x231e34[_0xf2f8('0x49')]){var _0x404ad4,_0xfc6f09,_0xbb708c;if(_0x4263f4[_0xf2f8('0x44')]['to']){_0xfc6f09=_0x4263f4[_0xf2f8('0x44')]['to'][_0xf2f8('0x4a')](',')[0x0];}return db[_0xf2f8('0x4b')][_0xf2f8('0x4c')]({'where':{'id':_0x231e34[_0xf2f8('0x4d')]},'include':[{'model':db[_0xf2f8('0x4e')],'as':_0xf2f8('0x4f'),'include':[{'model':db[_0xf2f8('0x50')],'as':_0xf2f8('0x51'),'where':{'email':_0xfc6f09},'limit':0x1,'order':[[_0xf2f8('0x52'),_0xf2f8('0x53')]]}]},{'model':db[_0xf2f8('0x54')],'as':'Smtp','raw':!![]}]})[_0xf2f8('0x13')](function(_0x193a1b){_0x404ad4=_0x193a1b;if(_0x404ad4&&_0x404ad4[_0xf2f8('0x55')]){var _0x36cb71={'tls':{'rejectUnauthorized':![]}};if(_[_0xf2f8('0x56')](_0x404ad4['Smtp'][_0xf2f8('0x57')])){_0x36cb71['host']=_0x404ad4[_0xf2f8('0x55')][_0xf2f8('0x58')];_0x36cb71['port']=_0x404ad4[_0xf2f8('0x55')][_0xf2f8('0x59')];_0x36cb71['secure']=_0x404ad4[_0xf2f8('0x55')][_0xf2f8('0x5a')];if(_0x404ad4[_0xf2f8('0x55')][_0xf2f8('0x5b')]){_0x36cb71[_0xf2f8('0x5c')]={'user':_0x404ad4['Smtp'][_0xf2f8('0x5d')],'pass':_0x404ad4[_0xf2f8('0x55')][_0xf2f8('0x5e')]};}}else{_0x36cb71[_0xf2f8('0x57')]=_0x404ad4[_0xf2f8('0x55')]['service'];_0x36cb71['auth']={'user':_0x404ad4['Smtp']['user'],'pass':_0x404ad4['Smtp'][_0xf2f8('0x5e')]};_0x36cb71[_0xf2f8('0x5a')]=_0x404ad4[_0xf2f8('0x55')][_0xf2f8('0x5a')];}if(_0x4263f4[_0xf2f8('0x44')][_0xf2f8('0x5f')]&&_0x4263f4[_0xf2f8('0x44')][_0xf2f8('0x5f')][_0xf2f8('0x36')]){for(var _0x1a5052=0x0;_0x1a5052<_0x4263f4[_0xf2f8('0x44')][_0xf2f8('0x5f')][_0xf2f8('0x36')];_0x1a5052+=0x1){_0x4263f4[_0xf2f8('0x44')][_0xf2f8('0x5f')][_0x1a5052]={'filename':_0x4263f4[_0xf2f8('0x44')][_0xf2f8('0x5f')][_0x1a5052][_0xf2f8('0x27')],'path':path[_0xf2f8('0x60')](config[_0xf2f8('0x61')],_0xf2f8('0x62'),_0x4263f4[_0xf2f8('0x44')]['attachments'][_0x1a5052]['basename'])};}}_0xbb708c={'account':_0x36cb71,'message':_0x4263f4[_0xf2f8('0x44')]};return;}})[_0xf2f8('0x13')](function(){if(_0x404ad4[_0xf2f8('0x4f')]){if(_0x404ad4['List'][_0xf2f8('0x51')][_0xf2f8('0x36')]){return _0x404ad4[_0xf2f8('0x4f')]['Contacts'][0x0];}else{return db[_0xf2f8('0x50')][_0xf2f8('0x46')](_[_0xf2f8('0xa')](_0x4263f4[_0xf2f8('0x44')],{'firstName':_0x4263f4[_0xf2f8('0x44')]['to'],'email':_0x4263f4['body']['to'],'phone':_0x4263f4['body']['to'],'ListId':_0x404ad4['ListId']}));}}else{throw new Error(_0xf2f8('0x63'));}})['then'](function(){if(_0xbb708c){return respondWithRpcPromise('SendMail',_0xf2f8('0x64'),_0xbb708c,client9003)[_0xf2f8('0x13')](function(_0x5a0faa){return _0x231e34['update']({'read':!![],'messageId':_0x5a0faa[_0xf2f8('0x65')],'sentAt':moment()[_0xf2f8('0x66')](_0xf2f8('0x67'))});})['catch'](function(_0x4754c2){logger[_0xf2f8('0x19')]('%s',JSON[_0xf2f8('0x18')](_0x4754c2));return _0x231e34;});}return _0x231e34;});}return _0x231e34;}})['then'](respondWithResult(_0x4f6b35,0xc9))['catch'](handleError(_0x4f6b35,null));};exports['accept']=function(_0x5d0b20,_0x56459a){var _0x550b4c={'agent':{},'channel':_0xf2f8('0x68')};if(_0x5d0b20[_0xf2f8('0x44')]['id']){delete _0x5d0b20[_0xf2f8('0x44')]['id'];}_0x5d0b20[_0xf2f8('0x44')]['read']=!![];_0x5d0b20[_0xf2f8('0x44')][_0xf2f8('0x69')]=moment()[_0xf2f8('0x66')](_0xf2f8('0x67'));_0x5d0b20['body']['UserId']=_0x5d0b20[_0xf2f8('0x44')][_0xf2f8('0x6a')]||_0x5d0b20[_0xf2f8('0x5d')]['id'];_0x550b4c[_0xf2f8('0x6b')]['id']=_0x5d0b20[_0xf2f8('0x44')][_0xf2f8('0x6a')];return db[_0xf2f8('0x2b')][_0xf2f8('0x43')]({'where':{'id':_0x5d0b20[_0xf2f8('0x41')]['id'],'UserId':null}})[_0xf2f8('0x13')](handleEntityNotFound(_0x56459a,null))[_0xf2f8('0x13')](saveUpdates(_0x5d0b20[_0xf2f8('0x44')],null))[_0xf2f8('0x13')](function(_0xc95519){if(_0xc95519){_0x550b4c[_0xf2f8('0x1b')]=_0xc95519[_0xf2f8('0x6c')]({'plain':!![]});return db[_0xf2f8('0x6d')][_0xf2f8('0x43')]({'where':{'id':_0xc95519[_0xf2f8('0x6e')]}});}return null;})['then'](handleEntityNotFound(_0x56459a,null))[_0xf2f8('0x13')](function(_0xb4349f){if(_0xb4349f){return _0xb4349f[_0xf2f8('0x24')]({'UserId':_0x5d0b20[_0xf2f8('0x44')]['UserId'],'read1stAt':_[_0xf2f8('0x56')](_0xb4349f[_0xf2f8('0x6f')])?moment()['format'](_0xf2f8('0x67')):undefined});}return null;})[_0xf2f8('0x13')](function(_0x34f644){if(_0x34f644){_0x550b4c[_0xf2f8('0x70')]=_0x34f644[_0xf2f8('0x6c')]({'plain':!![]});interaction_log[_0xf2f8('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d0b20[_0xf2f8('0x5d')]['id'],_0x5d0b20[_0xf2f8('0x5d')]['name'],_0x5d0b20['user'][_0xf2f8('0x71')],_0x550b4c[_0xf2f8('0x70')]['id'],_0x5d0b20['body']?JSON[_0xf2f8('0x18')](_0x5d0b20[_0xf2f8('0x44')]):_0xf2f8('0x72'));return respondWithRpcPromise('AcceptMessage',_0xf2f8('0x73'),_0x550b4c);}return null;})[_0xf2f8('0x13')](function(_0x4bfd19){var _0x4f0b92=_0xf2f8('0x74')+_0x4bfd19['message'][_0xf2f8('0x75')];return db[_0xf2f8('0x76')][_0xf2f8('0x30')](_0x4f0b92,{'type':db[_0xf2f8('0x77')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x5a7534){return _0x5a7534;});})['then'](function(_0x32262b){if(_0x32262b){_0x550b4c[_0xf2f8('0x1b')][_0xf2f8('0x78')]=_0x32262b[0x0];if(!_0x5d0b20[_0xf2f8('0x44')]['UserId'])return;return db['User'][_0xf2f8('0x43')]({'where':{'id':_0x5d0b20[_0xf2f8('0x44')]['UserId'],'role':'agent'},'attributes':['id',_0xf2f8('0x27'),_0xf2f8('0x79'),_0xf2f8('0x7a'),_0xf2f8('0x7b')],'raw':!![]});}return null;})[_0xf2f8('0x13')](function(_0x41b42b){if(!_0x41b42b)return null;_0x550b4c['message'][_0xf2f8('0x6b')]=_0x41b42b;return _0x550b4c;})['then'](function(_0x2b5b7d){if(_0x2b5b7d){if(_0x5d0b20[_0xf2f8('0x44')][_0xf2f8('0x7c')]){_0x550b4c[_0xf2f8('0x1b')]['interface']=util[_0xf2f8('0x66')](_0xf2f8('0x7d'),_0x5d0b20[_0xf2f8('0x5d')][_0xf2f8('0x27')]);_0x550b4c['message'][_0xf2f8('0x7e')]=_0x550b4c[_0xf2f8('0x7e')];_0x550b4c['message'][_0xf2f8('0x7f')]=_0x550b4c['channel'];_0x550b4c[_0xf2f8('0x1b')]['event']='accept';_0x550b4c['message'][_0xf2f8('0x44')]=htmlToText['fromString'](_0x550b4c[_0xf2f8('0x1b')][_0xf2f8('0x44')]);return respondWithRpcPromise('EventManager',_0xf2f8('0x80'),{'event':_0xf2f8('0x81'),'message':_0x550b4c[_0xf2f8('0x1b')]},client9002)[_0xf2f8('0x13')](function(){return _0x550b4c;});}return _0x550b4c;}return null;})[_0xf2f8('0x13')](respondWithResult(_0x56459a,null))[_0xf2f8('0x1c')](handleError(_0x56459a,null));};exports[_0xf2f8('0x82')]=function(_0x72f917,_0x35d8c1){var _0x31bcb7={'agent':{},'channel':_0xf2f8('0x68')};if(_0x72f917[_0xf2f8('0x44')]['id']){delete _0x72f917[_0xf2f8('0x44')]['id'];}_0x72f917[_0xf2f8('0x44')]['UserId']=_0x72f917[_0xf2f8('0x44')]['UserId']||_0x72f917[_0xf2f8('0x5d')]['id'];_0x31bcb7[_0xf2f8('0x6b')]['id']=_0x72f917[_0xf2f8('0x44')][_0xf2f8('0x6a')];return db[_0xf2f8('0x2b')][_0xf2f8('0x43')]({'where':{'id':_0x72f917['params']['id'],'UserId':null}})[_0xf2f8('0x13')](handleEntityNotFound(_0x35d8c1,null))['then'](function(_0x5a3a26){if(_0x5a3a26){_0x31bcb7['message']=_0x5a3a26['get']({'plain':!![]});return db[_0xf2f8('0x6d')]['find']({'where':{'id':_0x5a3a26['MailInteractionId']}});}return null;})[_0xf2f8('0x13')](handleEntityNotFound(_0x35d8c1,null))[_0xf2f8('0x13')](function(_0x15b62c){if(_0x15b62c){_0x31bcb7['interaction']=_0x15b62c['get']({'plain':!![]});interaction_log[_0xf2f8('0x14')](_0xf2f8('0x83'),_0x72f917[_0xf2f8('0x5d')]['id'],_0x72f917[_0xf2f8('0x5d')][_0xf2f8('0x27')],_0x72f917[_0xf2f8('0x5d')]['role'],_0x31bcb7[_0xf2f8('0x70')]['id'],_0x72f917[_0xf2f8('0x44')]?JSON[_0xf2f8('0x18')](_0x72f917[_0xf2f8('0x44')]):_0xf2f8('0x72'));return respondWithRpcPromise(_0xf2f8('0x84'),_0xf2f8('0x85'),_0x31bcb7);}return null;})['then'](function(_0x15950f){var _0x1fb9d1=_0xf2f8('0x74')+_0x15950f[_0xf2f8('0x1b')][_0xf2f8('0x75')];return db[_0xf2f8('0x76')][_0xf2f8('0x30')](_0x1fb9d1,{'type':db['Sequelize'][_0xf2f8('0x86')][_0xf2f8('0x87')],'raw':!![]})[_0xf2f8('0x13')](function(_0x24db3b){return _0x24db3b;});})[_0xf2f8('0x13')](function(_0x1b6d3f){if(_0x1b6d3f){_0x31bcb7[_0xf2f8('0x1b')][_0xf2f8('0x78')]=_0x1b6d3f[0x0];if(!_0x72f917[_0xf2f8('0x44')][_0xf2f8('0x6a')])return;return db[_0xf2f8('0x88')][_0xf2f8('0x43')]({'where':{'id':_0x72f917[_0xf2f8('0x44')]['UserId'],'role':_0xf2f8('0x6b')},'attributes':['id',_0xf2f8('0x27'),_0xf2f8('0x79'),'email','internal'],'raw':!![]});}return null;})[_0xf2f8('0x13')](function(_0x57cd8a){if(!_0x57cd8a)return null;_0x31bcb7[_0xf2f8('0x1b')][_0xf2f8('0x6b')]=_0x57cd8a;return _0x31bcb7;})[_0xf2f8('0x13')](function(_0x575395){if(_0x575395){_0x575395['message'][_0xf2f8('0x89')]=util['format'](_0xf2f8('0x7d'),_0x72f917[_0xf2f8('0x5d')][_0xf2f8('0x27')]);_0x575395['message'][_0xf2f8('0x7e')]=_0x31bcb7[_0xf2f8('0x7e')];_0x575395[_0xf2f8('0x1b')][_0xf2f8('0x7f')]=_0x31bcb7['channel'];_0x575395[_0xf2f8('0x1b')]['event']=_0xf2f8('0x82');_0x575395[_0xf2f8('0x1b')][_0xf2f8('0x44')]=htmlToText['fromString'](_0x31bcb7[_0xf2f8('0x1b')][_0xf2f8('0x44')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0xf2f8('0x8a'),'message':_0x575395['message']},client9002);return _0x31bcb7;}return null;})[_0xf2f8('0x13')](respondWithResult(_0x35d8c1,null))['catch'](handleError(_0x35d8c1,null));};exports[_0xf2f8('0x8b')]=function(_0x3c6848,_0x171cfe){var _0x11045c=moment()[_0xf2f8('0x8c')]()[_0xf2f8('0x8d')]();var _0x3cfe93=path[_0xf2f8('0x60')](config['root'],_0xf2f8('0x8e'),_0xf2f8('0x8f'),_0xf2f8('0x90'));var _0xd2252f=path[_0xf2f8('0x60')](config['root'],_0xf2f8('0x8e'),_0xf2f8('0x8f'),_0xf2f8('0x5f'));var _0x5e5a4c=util[_0xf2f8('0x66')](_0xf2f8('0x91'),_0x11045c);return db['MailMessage'][_0xf2f8('0x43')]({'where':{'id':_0x3c6848[_0xf2f8('0x41')]['id']},'attributes':['id','body',_0xf2f8('0x92'),'to','cc',_0xf2f8('0x93'),_0xf2f8('0x94'),_0xf2f8('0x95')],'include':_0x3c6848['query'][_0xf2f8('0x5f')]?[{'model':db['Attachment'],'as':_0xf2f8('0x96')}]:undefined})[_0xf2f8('0x13')](handleEntityNotFound(_0x171cfe,null))[_0xf2f8('0x13')](function(_0x37dd0f){if(_0x37dd0f){var _0x9998eb=_0x37dd0f;var _0x12d863={'from':_0x9998eb[_0xf2f8('0x92')],'to':_0x9998eb['to'],'subject':_0x9998eb[_0xf2f8('0x94')],'html':htmlEntities[_0xf2f8('0x97')](_0x9998eb[_0xf2f8('0x44')]),'headers':{'Date':moment(_0x9998eb['createdAt'])['format'](_0xf2f8('0x98'))},'attachments':[]};if(_0x37dd0f['cc']){_0x12d863[_0xf2f8('0x99')]['Cc']=_0x37dd0f['cc'];}if(_0x37dd0f[_0xf2f8('0x93')]){_0x12d863[_0xf2f8('0x99')]['Bcc']=_0x37dd0f[_0xf2f8('0x93')];}return new BPromise(function(_0x410034,_0x446eee){if(_0x37dd0f[_0xf2f8('0x96')]){for(var _0x3965cc=0x0;_0x3965cc<_0x37dd0f['Attachments'][_0xf2f8('0x36')];_0x3965cc++){var _0x111b55=_0x37dd0f[_0xf2f8('0x96')][_0x3965cc];var _0x28ef96=path[_0xf2f8('0x60')](_0xd2252f,_0x111b55[_0xf2f8('0x9a')]);if(fs[_0xf2f8('0x9b')](_0x28ef96)){_0x12d863[_0xf2f8('0x5f')][_0xf2f8('0x9c')]({'name':_0x111b55['name'],'contentType':_0x111b55[_0xf2f8('0x2d')],'data':fs[_0xf2f8('0x9d')](_0x28ef96)});}}}emlformat['build'](_0x12d863,function(_0x8d2949,_0x55a8b9){if(_0x8d2949)return _0x446eee(_0x8d2949);fs[_0xf2f8('0x9e')](path[_0xf2f8('0x60')](_0x3cfe93,_0x5e5a4c),_0x55a8b9);return _0x410034(_0x55a8b9);});});}})['then'](function(_0x5190bb){if(_0x5190bb){return _0x171cfe[_0xf2f8('0x8b')](path[_0xf2f8('0x60')](_0x3cfe93,_0x5e5a4c),_0x5e5a4c,function(_0x522116){if(!_0x522116)fs[_0xf2f8('0x9f')](path[_0xf2f8('0x60')](_0x3cfe93,_0x5e5a4c));});}})[_0xf2f8('0x1c')](handleError(_0x171cfe,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 44b7d08..6ca6920 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 _0x8446=['MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0x8446,0x1c1));var _0x6844=function(_0x50b6ff,_0xb9324f){_0x50b6ff=_0x50b6ff-0x0;var _0x57cb31=_0x8446[_0x50b6ff];return _0x57cb31;};'use strict';var EventEmitter=require(_0x6844('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x6844('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6844('0x2')](0x0);var events={'afterCreate':_0x6844('0x3'),'afterUpdate':_0x6844('0x4'),'afterDestroy':_0x6844('0x5')};function emitEvent(_0x197cb1){return function(_0xf15dea,_0x69e9bd,_0x3275a1){MailMessageEvents[_0x6844('0x6')](_0x197cb1+':'+_0xf15dea['id'],_0xf15dea);MailMessageEvents[_0x6844('0x6')](_0x197cb1,_0xf15dea);_0x3275a1(null);};}for(var e in events){if(events[_0x6844('0x7')](e)){var event=events[e];MailMessage[_0x6844('0x8')](e,emitEvent(event));}}module[_0x6844('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x9220=['hook','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x9220,0x13c));var _0x0922=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x9220[_0x5627e1];return _0x2f013f;};'use strict';var EventEmitter=require(_0x0922('0x0'));var MailMessage=require(_0x0922('0x1'))['db'][_0x0922('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0922('0x3')](0x0);var events={'afterCreate':_0x0922('0x4'),'afterUpdate':'update','afterDestroy':_0x0922('0x5')};function emitEvent(_0x479c6a){return function(_0x573552,_0x5187a6,_0x580df0){MailMessageEvents[_0x0922('0x6')](_0x479c6a+':'+_0x573552['id'],_0x573552);MailMessageEvents['emit'](_0x479c6a,_0x573552);_0x580df0(null);};}for(var e in events){if(events[_0x0922('0x7')](e)){var event=events[e];MailMessage[_0x0922('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 19be00c..6caf76a 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 _0xe7ac=['toLowerCase','out','secret','isNil','findOne','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','FULLTEXT','fromString','models','direction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe7ac,0x183));var _0xce7a=function(_0x19a103,_0x10285f){_0x19a103=_0x19a103-0x0;var _0x357485=_0xe7ac[_0x19a103];return _0x357485;};'use strict';var _=require(_0xce7a('0x0'));var util=require('util');var logger=require(_0xce7a('0x1'))(_0xce7a('0x2'));var moment=require(_0xce7a('0x3'));var BPromise=require(_0xce7a('0x4'));var rp=require(_0xce7a('0x5'));var htmlToText=require(_0xce7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce7a('0x7'));var config=require(_0xce7a('0x8'));var attributes=require(_0xce7a('0x9'));module[_0xce7a('0xa')]=function(_0xd182e6,_0x2616fb){return _0xd182e6[_0xce7a('0xb')](_0xce7a('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xce7a('0xd'),'fields':[_0xce7a('0xd')]},{'name':'fti_mail_messages','fields':[_0xce7a('0xe'),'subject'],'type':_0xce7a('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a3956,_0x2b3fb3,_0x74c5ff){if(_0x4a3956['body']){_0x4a3956[_0xce7a('0xe')]=htmlToText[_0xce7a('0x10')](_0x4a3956['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x74c5ff(null,_0x2b3fb3);},'afterCreate':function(_0x30b9aa,_0x48e2d6,_0x180c60){var _0x444866=_0xd182e6[_0xce7a('0x11')];var _0x538692=_0x30b9aa['get']({'plain':!![]});if(_0x538692[_0xce7a('0x12')][_0xce7a('0x13')]()==='in'||_0x538692[_0xce7a('0x12')][_0xce7a('0x13')]()===_0xce7a('0x14')&&!_0x538692[_0xce7a('0x15')]&&!_[_0xce7a('0x16')](_0x538692['UserId'])){_0x444866['MailInteraction'][_0xce7a('0x17')]({'where':{'id':_0x538692['MailInteractionId']}})[_0xce7a('0x18')](function(_0x169f89){if(_0x169f89){_0x169f89['update']({'lastMsgAt':_0x538692[_0xce7a('0x19')],'lastMsgDirection':_0x538692[_0xce7a('0x12')][_0xce7a('0x13')]()});}})[_0xce7a('0x1a')](function(_0x385904){console[_0xce7a('0x1b')](_0x385904);});}_0x180c60();}},'charset':'utf8mb4','collate':_0xce7a('0x1c')});}; \ No newline at end of file +var _0x7a3e=['MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','out','secret','isNil','UserId'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0x7a3e,0xcd));var _0xe7a3=function(_0xb085f4,_0xc7a45e){_0xb085f4=_0xb085f4-0x0;var _0xb553e6=_0x7a3e[_0xb085f4];return _0xb553e6;};'use strict';var _=require(_0xe7a3('0x0'));var util=require(_0xe7a3('0x1'));var logger=require(_0xe7a3('0x2'))(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require(_0xe7a3('0x5'));var rp=require(_0xe7a3('0x6'));var htmlToText=require(_0xe7a3('0x7'));var fs=require('fs');var path=require(_0xe7a3('0x8'));var rimraf=require(_0xe7a3('0x9'));var config=require(_0xe7a3('0xa'));var attributes=require(_0xe7a3('0xb'));module[_0xe7a3('0xc')]=function(_0x2fc62c,_0x2b4cd3){return _0x2fc62c['define']('MailMessage',attributes,{'tableName':_0xe7a3('0xd'),'paranoid':![],'indexes':[{'name':_0xe7a3('0xe'),'fields':[_0xe7a3('0xe')]},{'name':_0xe7a3('0xf'),'fields':[_0xe7a3('0x10'),_0xe7a3('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2490a8,_0x5490bd,_0x2c0dd7){if(_0x2490a8[_0xe7a3('0x12')]){_0x2490a8[_0xe7a3('0x10')]=htmlToText[_0xe7a3('0x13')](_0x2490a8['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2c0dd7(null,_0x5490bd);},'afterCreate':function(_0x133a12,_0x5664c0,_0x31d7d1){var _0x2db7ae=_0x2fc62c['models'];var _0x58f1ca=_0x133a12[_0xe7a3('0x14')]({'plain':!![]});if(_0x58f1ca[_0xe7a3('0x15')]['toLowerCase']()==='in'||_0x58f1ca['direction']['toLowerCase']()===_0xe7a3('0x16')&&!_0x58f1ca[_0xe7a3('0x17')]&&!_[_0xe7a3('0x18')](_0x58f1ca[_0xe7a3('0x19')])){_0x2db7ae['MailInteraction']['findOne']({'where':{'id':_0x58f1ca[_0xe7a3('0x1a')]}})[_0xe7a3('0x1b')](function(_0x14ed3f){if(_0x14ed3f){_0x14ed3f[_0xe7a3('0x1c')]({'lastMsgAt':_0x58f1ca[_0xe7a3('0x1d')],'lastMsgDirection':_0x58f1ca['direction']['toLowerCase']()});}})[_0xe7a3('0x1e')](function(_0x5501e7){console[_0xe7a3('0x1f')](_0x5501e7);});}_0x31d7d1();}},'charset':'utf8mb4','collate':_0xe7a3('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index c2a6ad9..f09a221 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 _0x8f4c=['body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8f4c,0x113));var _0xc8f4=function(_0x288788,_0x13b561){_0x288788=_0x288788-0x0;var _0x71cb99=_0x8f4c[_0x288788];return _0x71cb99;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc8f4('0xa')](config['redis'],{'host':_0xc8f4('0xb'),'port':0x18eb});var socket=require(_0xc8f4('0xc'))(new Redis(config[_0xc8f4('0xd')]));require(_0xc8f4('0xe'))[_0xc8f4('0xf')](socket);function respondWithRpcPromise(_0x599de3,_0x38c41b,_0x191b92){return new BPromise(function(_0x2fba62,_0x3a2f8a){return client['request'](_0x599de3,_0x191b92)[_0xc8f4('0x10')](function(_0x52c699){logger[_0xc8f4('0x11')](_0xc8f4('0x12'),_0x38c41b,_0xc8f4('0x13'));logger[_0xc8f4('0x14')](_0xc8f4('0x15'),_0x38c41b,'request\x20sent',JSON[_0xc8f4('0x16')](_0x52c699));if(_0x52c699[_0xc8f4('0x17')]){if(_0x52c699[_0xc8f4('0x17')][_0xc8f4('0x18')]===0x1f4){logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x52c699['error'][_0xc8f4('0x19')]);return _0x3a2f8a(_0x52c699[_0xc8f4('0x17')][_0xc8f4('0x19')]);}logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x52c699['error'][_0xc8f4('0x19')]);return _0x2fba62(_0x52c699['error']['message']);}else{logger[_0xc8f4('0x11')](_0xc8f4('0x12'),_0x38c41b,_0xc8f4('0x13'));_0x2fba62(_0x52c699[_0xc8f4('0x1a')][_0xc8f4('0x19')]);}})[_0xc8f4('0x1b')](function(_0x2459ac){logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x2459ac);_0x3a2f8a(_0x2459ac);});});}exports[_0xc8f4('0x1c')]=function(_0x3cd90c){var _0x3126e5=this;return new Promise(function(_0x22236c,_0x5f3264){return db[_0xc8f4('0x1d')][_0xc8f4('0x1e')](_0x3cd90c[_0xc8f4('0x1f')],{'raw':_0x3cd90c[_0xc8f4('0x20')]?_0x3cd90c[_0xc8f4('0x20')][_0xc8f4('0x21')]===undefined?!![]:![]:!![]})[_0xc8f4('0x10')](function(_0x43eb57){logger['info'](_0xc8f4('0x1c'),_0x3cd90c);logger[_0xc8f4('0x14')](_0xc8f4('0x1c'),_0x3cd90c,JSON[_0xc8f4('0x16')](_0x43eb57));_0x22236c(_0x43eb57);})['catch'](function(_0x39174f){logger['error'](_0xc8f4('0x1c'),_0x39174f['message'],_0x3cd90c);_0x5f3264(_0x3126e5[_0xc8f4('0x17')](0x1f4,_0x39174f[_0xc8f4('0x19')]));});});}; \ No newline at end of file +var _0xef0f=['code','message','result','catch','CreateMailMessage','create','options','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1de98c,_0x288537){var _0x163794=function(_0x9f870c){while(--_0x9f870c){_0x1de98c['push'](_0x1de98c['shift']());}};_0x163794(++_0x288537);}(_0xef0f,0x168));var _0xfef0=function(_0x57806f,_0x1f187e){_0x57806f=_0x57806f-0x0;var _0x1a1498=_0xef0f[_0x57806f];return _0x1a1498;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}exports[_0xfef0('0x1c')]=function(_0x4e24de){var _0x20826b=this;return new Promise(function(_0x1a0aa0,_0x28dee1){return db['MailMessage'][_0xfef0('0x1d')](_0x4e24de['body'],{'raw':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b8b22){logger[_0xfef0('0x12')]('CreateMailMessage',_0x4e24de);logger[_0xfef0('0x1f')](_0xfef0('0x1c'),_0x4e24de,JSON[_0xfef0('0x16')](_0x4b8b22));_0x1a0aa0(_0x4b8b22);})[_0xfef0('0x1b')](function(_0x249fe4){logger[_0xfef0('0x17')]('CreateMailMessage',_0x249fe4['message'],_0x4e24de);_0x28dee1(_0x20826b[_0xfef0('0x17')](0x1f4,_0x249fe4[_0xfef0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2dd39eb..40e0d39 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 _0x77a4=['save','remove','register','length','mailMessage:','./mailMessage.events'];(function(_0x4b0584,_0x5399d6){var _0x3df614=function(_0x1816bb){while(--_0x1816bb){_0x4b0584['push'](_0x4b0584['shift']());}};_0x3df614(++_0x5399d6);}(_0x77a4,0x155));var _0x477a=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x77a4[_0x2d61ac];return _0x3f7d3c;};'use strict';var MailMessageEvents=require(_0x477a('0x0'));var events=[_0x477a('0x1'),_0x477a('0x2'),'update'];function createListener(_0x5a4195,_0x332514){return function(_0x5eda66){_0x332514['emit'](_0x5a4195,_0x5eda66);};}function removeListener(_0x250d12,_0x683b74){return function(){MailMessageEvents['removeListener'](_0x250d12,_0x683b74);};}exports[_0x477a('0x3')]=function(_0x4ca293){for(var _0x4318b5=0x0,_0x29d2c0=events[_0x477a('0x4')];_0x4318b5<_0x29d2c0;_0x4318b5++){var _0x217ce0=events[_0x4318b5];var _0xbfea2a=createListener(_0x477a('0x5')+_0x217ce0,_0x4ca293);MailMessageEvents['on'](_0x217ce0,_0xbfea2a);}}; \ No newline at end of file +var _0xb99b=['remove','update','emit','register','./mailMessage.events'];(function(_0x30eb6c,_0x50570f){var _0x46ae27=function(_0x3e96e6){while(--_0x3e96e6){_0x30eb6c['push'](_0x30eb6c['shift']());}};_0x46ae27(++_0x50570f);}(_0xb99b,0xa9));var _0xbb99=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb99b[_0x14add3];return _0x4a174f;};'use strict';var MailMessageEvents=require(_0xbb99('0x0'));var events=['save',_0xbb99('0x1'),_0xbb99('0x2')];function createListener(_0x52fed2,_0x25fbfe){return function(_0x2c75e5){_0x25fbfe[_0xbb99('0x3')](_0x52fed2,_0x2c75e5);};}function removeListener(_0x3269e7,_0x86c343){return function(){MailMessageEvents['removeListener'](_0x3269e7,_0x86c343);};}exports[_0xbb99('0x4')]=function(_0x156d6c){for(var _0x91bc33=0x0,_0x5ae9d9=events['length'];_0x91bc33<_0x5ae9d9;_0x91bc33++){var _0x2a3af6=events[_0x91bc33];var _0x45d51f=createListener('mailMessage:'+_0x2a3af6,_0x156d6c);MailMessageEvents['on'](_0x2a3af6,_0x45d51f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0cb1a4a..0be8cb0 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 _0xad0f=['post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x26cf81,_0x5699b0){var _0x2858cf=function(_0x5792df){while(--_0x5792df){_0x26cf81['push'](_0x26cf81['shift']());}};_0x2858cf(++_0x5699b0);}(_0xad0f,0x1d9));var _0xfad0=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0xad0f[_0x5538d5];return _0x323b1a;};'use strict';var multer=require(_0xfad0('0x0'));var util=require('util');var path=require(_0xfad0('0x1'));var timeout=require(_0xfad0('0x2'));var express=require('express');var router=express[_0xfad0('0x3')]();var fs_extra=require(_0xfad0('0x4'));var auth=require(_0xfad0('0x5'));var interaction=require(_0xfad0('0x6'));var config=require('../../config/environment');var controller=require(_0xfad0('0x7'));router['get']('/',auth[_0xfad0('0x8')](),controller[_0xfad0('0x9')]);router[_0xfad0('0xa')](_0xfad0('0xb'),auth[_0xfad0('0x8')](),controller['describe']);router[_0xfad0('0xa')](_0xfad0('0xc'),auth[_0xfad0('0x8')](),controller[_0xfad0('0xd')]);router[_0xfad0('0xa')](_0xfad0('0xe'),auth[_0xfad0('0x8')](),controller[_0xfad0('0xf')]);router[_0xfad0('0xa')](_0xfad0('0x10'),auth[_0xfad0('0x8')](),controller[_0xfad0('0x11')]);router[_0xfad0('0xa')](_0xfad0('0x12'),auth[_0xfad0('0x8')](),controller[_0xfad0('0x13')]);router[_0xfad0('0x14')]('/',auth[_0xfad0('0x8')](),controller[_0xfad0('0x15')]);router[_0xfad0('0x14')](_0xfad0('0x10'),auth['isAuthenticated'](),controller[_0xfad0('0x16')]);router[_0xfad0('0x14')](_0xfad0('0x12'),auth[_0xfad0('0x8')](),controller[_0xfad0('0x17')]);router[_0xfad0('0x18')](_0xfad0('0xc'),auth[_0xfad0('0x8')](),controller['update']);router[_0xfad0('0x19')](_0xfad0('0xc'),auth[_0xfad0('0x8')](),controller['destroy']);router[_0xfad0('0x19')](_0xfad0('0x10'),auth[_0xfad0('0x8')](),controller[_0xfad0('0x1a')]);router[_0xfad0('0x19')]('/:id/users',auth[_0xfad0('0x8')](),controller[_0xfad0('0x1b')]);module[_0xfad0('0x1c')]=router; \ No newline at end of file +var _0xa04f=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','destroy','delete','removeTeams'];(function(_0x54fdd9,_0x2c8d89){var _0x5c43c2=function(_0x2deb4a){while(--_0x2deb4a){_0x54fdd9['push'](_0x54fdd9['shift']());}};_0x5c43c2(++_0x2c8d89);}(_0xa04f,0xfd));var _0xfa04=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa04f[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0xfa04('0x0'));var util=require(_0xfa04('0x1'));var path=require('path');var timeout=require(_0xfa04('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfa04('0x3'));var auth=require(_0xfa04('0x4'));var interaction=require(_0xfa04('0x5'));var config=require('../../config/environment');var controller=require(_0xfa04('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa04('0x7')]);router[_0xfa04('0x8')](_0xfa04('0x9'),auth['isAuthenticated'](),controller[_0xfa04('0xa')]);router[_0xfa04('0x8')](_0xfa04('0xb'),auth[_0xfa04('0xc')](),controller[_0xfa04('0xd')]);router[_0xfa04('0x8')](_0xfa04('0xe'),auth['isAuthenticated'](),controller[_0xfa04('0xf')]);router[_0xfa04('0x8')](_0xfa04('0x10'),auth[_0xfa04('0xc')](),controller[_0xfa04('0x11')]);router['get'](_0xfa04('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xfa04('0x13')]('/',auth[_0xfa04('0xc')](),controller[_0xfa04('0x14')]);router['post'](_0xfa04('0x10'),auth[_0xfa04('0xc')](),controller[_0xfa04('0x15')]);router[_0xfa04('0x13')](_0xfa04('0x12'),auth[_0xfa04('0xc')](),controller['addAgents']);router[_0xfa04('0x16')]('/:id',auth[_0xfa04('0xc')](),controller[_0xfa04('0x17')]);router['delete'](_0xfa04('0xb'),auth[_0xfa04('0xc')](),controller[_0xfa04('0x18')]);router[_0xfa04('0x19')]('/:id/teams',auth[_0xfa04('0xc')](),controller[_0xfa04('0x1a')]);router[_0xfa04('0x19')](_0xfa04('0x12'),auth[_0xfa04('0xc')](),controller['removeAgents']);module[_0xfa04('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 62e1868..5f7dc6c 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 _0xedf6=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xedf6,0x12e));var _0x6edf=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xedf6[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require(_0x6edf('0x0'));module[_0x6edf('0x1')]={'name':{'type':Sequelize[_0x6edf('0x2')],'unique':_0x6edf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6edf('0x2')]},'timeout':{'type':Sequelize[_0x6edf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6edf('0x5')]('rrmemory','beepall',_0x6edf('0x6'))}}; \ No newline at end of file +var _0x68b5=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x103521,_0x442b3d){var _0x57a696=function(_0x260429){while(--_0x260429){_0x103521['push'](_0x103521['shift']());}};_0x57a696(++_0x442b3d);}(_0x68b5,0x1ae));var _0x568b=function(_0x4bb02f,_0x4c2f05){_0x4bb02f=_0x4bb02f-0x0;var _0x15e331=_0x68b5[_0x4bb02f];return _0x15e331;};'use strict';var Sequelize=require(_0x568b('0x0'));module['exports']={'name':{'type':Sequelize[_0x568b('0x1')],'unique':_0x568b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x568b('0x1')]},'timeout':{'type':Sequelize[_0x568b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x568b('0x4')](_0x568b('0x5'),_0x568b('0x6'),_0x568b('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 134b424..f10b47b 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 _0x1ca7=['findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','MailQueues','UserProfileResource','end','stack','index','map','MailQueue','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','order','pick','UserMailQueue','findAll'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x1ca7,0x157));var _0x71ca=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x1ca7[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0x71ca('0x0'));var rimraf=require(_0x71ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71ca('0x2'));var BPromise=require(_0x71ca('0x3'));var Mustache=require(_0x71ca('0x4'));var util=require('util');var path=require(_0x71ca('0x5'));var sox=require(_0x71ca('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71ca('0x7'));var _=require(_0x71ca('0x8'));var squel=require(_0x71ca('0x9'));var crypto=require(_0x71ca('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x71ca('0xb'));var toCsv=require(_0x71ca('0xc'));var querystring=require('querystring');var Papa=require(_0x71ca('0xd'));var Redis=require(_0x71ca('0xe'));var authService=require(_0x71ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x71ca('0x10'));var hardwareService=require(_0x71ca('0x11'));var logger=require(_0x71ca('0x12'))(_0x71ca('0x13'));var utils=require(_0x71ca('0x14'));var config=require(_0x71ca('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x71ca('0x16'))['db'];config[_0x71ca('0x17')]=_['defaults'](config[_0x71ca('0x17')],{'host':_0x71ca('0x18'),'port':0x18eb});var socket=require(_0x71ca('0x19'))(new Redis(config[_0x71ca('0x17')]));require(_0x71ca('0x1a'))[_0x71ca('0x1b')](socket);function respondWithStatusCode(_0x2a38af,_0x3cbe45){_0x3cbe45=_0x3cbe45||0xcc;return function(_0xbb95a9){if(_0xbb95a9){return _0x2a38af[_0x71ca('0x1c')](_0x3cbe45);}return _0x2a38af['status'](_0x3cbe45)['end']();};}function respondWithResult(_0x3f206d,_0x5c6b85){_0x5c6b85=_0x5c6b85||0xc8;return function(_0xb9c59f){if(_0xb9c59f){return _0x3f206d[_0x71ca('0x1d')](_0x5c6b85)['json'](_0xb9c59f);}};}function respondWithFilteredResult(_0x4c71e3,_0x470470){return function(_0x4d43b1){if(_0x4d43b1){var _0x2c4310=typeof _0x470470[_0x71ca('0x1e')]===_0x71ca('0x1f')&&typeof _0x470470[_0x71ca('0x20')]==='undefined';var _0x4c92e8=_0x4d43b1['count'];var _0x13733f=_0x2c4310?0x0:_0x470470[_0x71ca('0x1e')];var _0x46ffec=_0x2c4310?_0x4d43b1[_0x71ca('0x21')]:_0x470470[_0x71ca('0x1e')]+_0x470470[_0x71ca('0x20')];var _0x459359;if(_0x46ffec>=_0x4c92e8){_0x46ffec=_0x4c92e8;_0x459359=0xc8;}else{_0x459359=0xce;}_0x4c71e3[_0x71ca('0x1d')](_0x459359);return _0x4c71e3[_0x71ca('0x22')](_0x71ca('0x23'),_0x13733f+'-'+_0x46ffec+'/'+_0x4c92e8)['json'](_0x4d43b1);}return null;};}function patchUpdates(_0x48692c){return function(_0x4a7820){try{jsonpatch[_0x71ca('0x24')](_0x4a7820,_0x48692c,!![]);}catch(_0x47a5ee){return BPromise['reject'](_0x47a5ee);}return _0x4a7820[_0x71ca('0x25')]();};}function saveUpdates(_0x2e2e22,_0x458d4a){return function(_0x1a4fe7){if(_0x1a4fe7){return _0x1a4fe7[_0x71ca('0x26')](_0x2e2e22)[_0x71ca('0x27')](function(_0x5d4504){return _0x5d4504;});}return null;};}function removeEntity(_0x106f65,_0x35f577){return function(_0x4bfe19){if(_0x4bfe19){return _0x4bfe19[_0x71ca('0x28')]()[_0x71ca('0x27')](function(){var _0x35c857=_0x4bfe19[_0x71ca('0x29')]({'plain':!![]});var _0x5e90b0=_0x71ca('0x2a');return db[_0x71ca('0x2b')][_0x71ca('0x28')]({'where':{'type':_0x5e90b0,'resourceId':_0x35c857['id']}})[_0x71ca('0x27')](function(){return _0x4bfe19;});})[_0x71ca('0x27')](function(){_0x106f65[_0x71ca('0x1d')](0xcc)[_0x71ca('0x2c')]();});}};}function handleEntityNotFound(_0x5f2367,_0x53562d){return function(_0xabe6e7){if(!_0xabe6e7){_0x5f2367[_0x71ca('0x1c')](0x194);}return _0xabe6e7;};}function handleError(_0x7feccd,_0x485875){_0x485875=_0x485875||0x1f4;return function(_0x525bc1){logger['error'](_0x525bc1[_0x71ca('0x2d')]);if(_0x525bc1['name']){delete _0x525bc1['name'];}_0x7feccd[_0x71ca('0x1d')](_0x485875)['send'](_0x525bc1);};}exports[_0x71ca('0x2e')]=function(_0x3b456d,_0x36115a){var _0x5e6c23={},_0x15e975={},_0x290eba={'count':0x0,'rows':[]};var _0xc390ff=_[_0x71ca('0x2f')](db[_0x71ca('0x30')]['rawAttributes'],function(_0x2de033){return{'name':_0x2de033[_0x71ca('0x31')],'type':_0x2de033[_0x71ca('0x32')][_0x71ca('0x33')]};});_0x15e975[_0x71ca('0x34')]=_[_0x71ca('0x2f')](_0xc390ff,_0x71ca('0x35'));_0x15e975[_0x71ca('0x36')]=_['keys'](_0x3b456d['query']);_0x15e975[_0x71ca('0x37')]=_[_0x71ca('0x38')](_0x15e975[_0x71ca('0x34')],_0x15e975[_0x71ca('0x36')]);_0x5e6c23[_0x71ca('0x39')]=_[_0x71ca('0x38')](_0x15e975[_0x71ca('0x34')],qs[_0x71ca('0x3a')](_0x3b456d['query'][_0x71ca('0x3a')]));_0x5e6c23['attributes']=_0x5e6c23[_0x71ca('0x39')][_0x71ca('0x3b')]?_0x5e6c23[_0x71ca('0x39')]:_0x15e975[_0x71ca('0x34')];if(!_0x3b456d[_0x71ca('0x36')][_0x71ca('0x3c')](_0x71ca('0x3d'))){_0x5e6c23[_0x71ca('0x20')]=qs[_0x71ca('0x20')](_0x3b456d[_0x71ca('0x36')][_0x71ca('0x20')]);_0x5e6c23['offset']=qs[_0x71ca('0x1e')](_0x3b456d[_0x71ca('0x36')][_0x71ca('0x1e')]);}_0x5e6c23['order']=qs[_0x71ca('0x3e')](_0x3b456d[_0x71ca('0x36')][_0x71ca('0x3e')]);_0x5e6c23[_0x71ca('0x3f')]=qs[_0x71ca('0x37')](_['pick'](_0x3b456d['query'],_0x15e975[_0x71ca('0x37')]),_0xc390ff);if(_0x3b456d[_0x71ca('0x36')][_0x71ca('0x40')]){_0x5e6c23[_0x71ca('0x3f')]=_[_0x71ca('0x41')](_0x5e6c23[_0x71ca('0x3f')],{'$or':_['map'](_0xc390ff,function(_0x4b01b4){if(_0x4b01b4[_0x71ca('0x32')]!==_0x71ca('0x42')){var _0x169596={};_0x169596[_0x4b01b4['name']]={'$like':'%'+_0x3b456d[_0x71ca('0x36')][_0x71ca('0x40')]+'%'};return _0x169596;}})});}_0x5e6c23=_[_0x71ca('0x41')]({},_0x5e6c23,_0x3b456d[_0x71ca('0x43')]);var _0x437e46={'where':_0x5e6c23[_0x71ca('0x3f')]};return db[_0x71ca('0x30')][_0x71ca('0x21')](_0x437e46)[_0x71ca('0x27')](function(_0x223aa5){_0x290eba['count']=_0x223aa5;if(_0x3b456d['query'][_0x71ca('0x44')]){_0x5e6c23['include']=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x5e6c23);})['then'](function(_0x5ccef4){_0x290eba[_0x71ca('0x45')]=_0x5ccef4;return _0x290eba;})[_0x71ca('0x27')](respondWithFilteredResult(_0x36115a,_0x5e6c23))[_0x71ca('0x46')](handleError(_0x36115a,null));};exports[_0x71ca('0x47')]=function(_0x12662f,_0x5b0f6d){var _0x5b98b0={'raw':!![],'where':{'id':_0x12662f[_0x71ca('0x48')]['id']}},_0xc29b6b={};_0xc29b6b[_0x71ca('0x34')]=_[_0x71ca('0x49')](db[_0x71ca('0x30')][_0x71ca('0x4a')]);_0xc29b6b['query']=_[_0x71ca('0x49')](_0x12662f[_0x71ca('0x36')]);_0xc29b6b[_0x71ca('0x37')]=_[_0x71ca('0x38')](_0xc29b6b['model'],_0xc29b6b[_0x71ca('0x36')]);_0x5b98b0['attributes']=_[_0x71ca('0x38')](_0xc29b6b[_0x71ca('0x34')],qs[_0x71ca('0x3a')](_0x12662f[_0x71ca('0x36')][_0x71ca('0x3a')]));_0x5b98b0[_0x71ca('0x39')]=_0x5b98b0[_0x71ca('0x39')][_0x71ca('0x3b')]?_0x5b98b0[_0x71ca('0x39')]:_0xc29b6b[_0x71ca('0x34')];if(_0x12662f[_0x71ca('0x36')][_0x71ca('0x44')]){_0x5b98b0[_0x71ca('0x4b')]=[{'all':!![]}];}_0x5b98b0=_[_0x71ca('0x41')]({},_0x5b98b0,_0x12662f[_0x71ca('0x43')]);return db[_0x71ca('0x30')][_0x71ca('0x4c')](_0x5b98b0)['then'](handleEntityNotFound(_0x5b0f6d,null))[_0x71ca('0x27')](respondWithResult(_0x5b0f6d,null))[_0x71ca('0x46')](handleError(_0x5b0f6d,null));};exports[_0x71ca('0x4d')]=function(_0x4db1bf,_0x33e14e){return db['MailQueue'][_0x71ca('0x4d')](_0x4db1bf['body'],{})[_0x71ca('0x27')](function(_0x14f264){var _0x14b83d=_0x4db1bf['user'][_0x71ca('0x29')]({'plain':!![]});if(!_0x14b83d)throw new Error(_0x71ca('0x4e'));if(_0x14b83d[_0x71ca('0x4f')]===_0x71ca('0x50')){var _0x4aea6e=_0x14f264['get']({'plain':!![]});var _0x1c9a4e=_0x71ca('0x2a');return db['UserProfileSection'][_0x71ca('0x4c')]({'where':{'name':_0x1c9a4e,'userProfileId':_0x14b83d[_0x71ca('0x51')]},'raw':!![]})['then'](function(_0xf11ba3){if(_0xf11ba3&&_0xf11ba3['autoAssociation']===0x0){return db[_0x71ca('0x2b')][_0x71ca('0x4d')]({'name':_0x4aea6e[_0x71ca('0x35')],'resourceId':_0x4aea6e['id'],'type':_0xf11ba3[_0x71ca('0x35')],'sectionId':_0xf11ba3['id']},{})[_0x71ca('0x27')](function(){return _0x14f264;});}else{return _0x14f264;}})['catch'](function(_0x504962){logger[_0x71ca('0x52')](_0x71ca('0x53'),_0x504962);throw _0x504962;});}return _0x14f264;})[_0x71ca('0x27')](respondWithResult(_0x33e14e,0xc9))['catch'](handleError(_0x33e14e,null));};exports[_0x71ca('0x26')]=function(_0x217a7d,_0xdfa72d){if(_0x217a7d[_0x71ca('0x54')]['id']){delete _0x217a7d[_0x71ca('0x54')]['id'];}return db[_0x71ca('0x30')][_0x71ca('0x4c')]({'where':{'id':_0x217a7d[_0x71ca('0x48')]['id']}})[_0x71ca('0x27')](handleEntityNotFound(_0xdfa72d,null))[_0x71ca('0x27')](saveUpdates(_0x217a7d['body'],null))['then'](respondWithResult(_0xdfa72d,null))[_0x71ca('0x46')](handleError(_0xdfa72d,null));};exports[_0x71ca('0x28')]=function(_0x57a6aa,_0x390ff4){return db[_0x71ca('0x30')]['find']({'where':{'id':_0x57a6aa[_0x71ca('0x48')]['id']}})['then'](handleEntityNotFound(_0x390ff4,null))[_0x71ca('0x27')](removeEntity(_0x390ff4,null))[_0x71ca('0x46')](handleError(_0x390ff4,null));};exports[_0x71ca('0x55')]=function(_0x17d0c4,_0x11ecfd){return db['MailQueue'][_0x71ca('0x55')]()['then'](respondWithResult(_0x11ecfd,null))['catch'](handleError(_0x11ecfd,null));};exports[_0x71ca('0x56')]=function(_0x4f3295,_0x449102,_0x1625ce){var _0x160c25={'raw':!![],'where':{}},_0x34ebc1={},_0x3451be;return db['MailQueue'][_0x71ca('0x57')]({'where':{'id':_0x4f3295['params']['id']}})['then'](handleEntityNotFound(_0x449102,null))[_0x71ca('0x27')](function(_0xf835ac){if(_0xf835ac){_0x3451be=_0xf835ac['get']({'plain':!![]});_0x34ebc1[_0x71ca('0x34')]=_['keys'](db['UserMailQueue'][_0x71ca('0x4a')]);_0x34ebc1[_0x71ca('0x36')]=_['keys'](_0x4f3295[_0x71ca('0x36')]);_0x34ebc1[_0x71ca('0x37')]=_[_0x71ca('0x38')](_0x34ebc1[_0x71ca('0x34')],_0x34ebc1['query']);_0x160c25[_0x71ca('0x39')]=_['intersection'](_0x34ebc1[_0x71ca('0x34')],qs[_0x71ca('0x3a')](_0x4f3295['query'][_0x71ca('0x3a')]));_0x160c25['attributes']=_0x160c25['attributes'][_0x71ca('0x3b')]?_0x160c25[_0x71ca('0x39')]:_0x34ebc1['model'];if(!_0x4f3295[_0x71ca('0x36')]['hasOwnProperty'](_0x71ca('0x3d'))){_0x160c25[_0x71ca('0x20')]=qs[_0x71ca('0x20')](_0x4f3295[_0x71ca('0x36')][_0x71ca('0x20')]);_0x160c25['offset']=qs[_0x71ca('0x1e')](_0x4f3295[_0x71ca('0x36')]['offset']);}_0x160c25[_0x71ca('0x58')]=qs[_0x71ca('0x3e')](_0x4f3295[_0x71ca('0x36')][_0x71ca('0x3e')]);_0x160c25['where']=qs['filters'](_[_0x71ca('0x59')](_0x4f3295['query'],_0x34ebc1[_0x71ca('0x37')]));_0x160c25[_0x71ca('0x3f')]['MailQueueId']=_0xf835ac['id'];if(_0x4f3295['query']['filter']){_0x160c25['where']=_['merge'](_0x160c25['where'],{'$or':_[_0x71ca('0x2f')](_0x160c25[_0x71ca('0x39')],function(_0x4654ea){var _0x31966e={};_0x31966e[_0x4654ea]={'$like':'%'+_0x4f3295[_0x71ca('0x36')][_0x71ca('0x40')]+'%'};return _0x31966e;})});}_0x160c25=_[_0x71ca('0x41')]({},_0x160c25,_0x4f3295[_0x71ca('0x43')]);return db[_0x71ca('0x5a')][_0x71ca('0x5b')](_0x160c25);}})[_0x71ca('0x27')](function(_0x27a2af){if(_0x27a2af){return db['User'][_0x71ca('0x5c')]({'where':{'id':_[_0x71ca('0x2f')](_0x27a2af,_0x71ca('0x5d')),'role':_0x71ca('0x5e')},'attributes':['id',_0x71ca('0x35'),_0x71ca('0x5f'),'updatedAt',_0x71ca('0x60')]});}})['then'](function(_0x1cb28f){if(_0x1cb28f){return{'count':_0x1cb28f['count'],'rows':_[_0x71ca('0x2f')](_0x1cb28f[_0x71ca('0x45')],function(_0x5b71c6){return{'membername':_0x5b71c6[_0x71ca('0x35')],'UserId':_0x5b71c6['id'],'queue_name':_0x3451be[_0x71ca('0x35')],'MailQueueId':_0x3451be['id'],'interface':util[_0x71ca('0x61')](_0x71ca('0x62'),_0x71ca('0x63'),_0x5b71c6[_0x71ca('0x35')]),'penalty':0x0,'paused':_0x5b71c6[_0x71ca('0x5f')],'createdAt':_0x5b71c6['createdAt'],'updatedAt':_0x5b71c6[_0x71ca('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x71ca('0x27')](respondWithFilteredResult(_0x449102,_0x160c25))[_0x71ca('0x46')](handleError(_0x449102,null));};exports[_0x71ca('0x65')]=function(_0xf608b,_0x388d26,_0x1603f4){var _0x17a9e6={};var _0x4aaa73={};var _0x17a19b;var _0x57c44d;return db[_0x71ca('0x30')][_0x71ca('0x57')]({'where':{'id':_0xf608b[_0x71ca('0x48')]['id']}})[_0x71ca('0x27')](handleEntityNotFound(_0x388d26,null))[_0x71ca('0x27')](function(_0x425535){if(_0x425535){_0x17a19b=_0x425535;_0x4aaa73['model']=_[_0x71ca('0x49')](db[_0x71ca('0x66')][_0x71ca('0x4a')]);_0x4aaa73[_0x71ca('0x36')]=_[_0x71ca('0x49')](_0xf608b[_0x71ca('0x36')]);_0x4aaa73[_0x71ca('0x37')]=_['intersection'](_0x4aaa73[_0x71ca('0x34')],_0x4aaa73[_0x71ca('0x36')]);_0x17a9e6[_0x71ca('0x39')]=_[_0x71ca('0x38')](_0x4aaa73['model'],qs[_0x71ca('0x3a')](_0xf608b[_0x71ca('0x36')][_0x71ca('0x3a')]));_0x17a9e6['attributes']=_0x17a9e6[_0x71ca('0x39')][_0x71ca('0x3b')]?_0x17a9e6[_0x71ca('0x39')]:_0x4aaa73[_0x71ca('0x34')];_0x17a9e6[_0x71ca('0x58')]=qs['sort'](_0xf608b[_0x71ca('0x36')][_0x71ca('0x3e')]);_0x17a9e6[_0x71ca('0x3f')]=qs[_0x71ca('0x37')](_[_0x71ca('0x59')](_0xf608b[_0x71ca('0x36')],_0x4aaa73['filters']));if(_0xf608b[_0x71ca('0x36')][_0x71ca('0x40')]){_0x17a9e6[_0x71ca('0x3f')]=_[_0x71ca('0x41')](_0x17a9e6[_0x71ca('0x3f')],{'$or':_[_0x71ca('0x2f')](_0x17a9e6[_0x71ca('0x39')],function(_0x1455f5){var _0x1ce921={};_0x1ce921[_0x1455f5]={'$like':'%'+_0xf608b[_0x71ca('0x36')]['filter']+'%'};return _0x1ce921;})});}_0x17a9e6=_[_0x71ca('0x41')]({},_0x17a9e6,_0xf608b[_0x71ca('0x43')]);return _0x17a19b[_0x71ca('0x65')](_0x17a9e6);}})[_0x71ca('0x27')](function(_0x3e1932){if(_0x3e1932){_0x57c44d=_0x3e1932[_0x71ca('0x3b')];if(!_0xf608b[_0x71ca('0x36')][_0x71ca('0x3c')](_0x71ca('0x3d'))){_0x17a9e6[_0x71ca('0x20')]=qs[_0x71ca('0x20')](_0xf608b['query'][_0x71ca('0x20')]);_0x17a9e6[_0x71ca('0x1e')]=qs[_0x71ca('0x1e')](_0xf608b[_0x71ca('0x36')][_0x71ca('0x1e')]);}return _0x17a19b[_0x71ca('0x65')](_0x17a9e6);}})[_0x71ca('0x27')](function(_0x297612){if(_0x297612){return _0x297612?{'count':_0x57c44d,'rows':_0x297612}:null;}})[_0x71ca('0x27')](respondWithResult(_0x388d26,null))[_0x71ca('0x46')](handleError(_0x388d26,null));};exports[_0x71ca('0x67')]=function(_0x2d368d,_0x2b7b3b,_0x251673){var _0x4c21ee=_0x2d368d['body'][_0x71ca('0x68')];return db[_0x71ca('0x66')][_0x71ca('0x5b')]({'where':{'id':_0x4c21ee},'attributes':['id'],'include':[{'model':db[_0x71ca('0x69')],'as':_0x71ca('0x6a'),'attributes':['id',_0x71ca('0x35'),'online',_0x71ca('0x6b'),_0x71ca('0x6c')],'raw':!![]}]})[_0x71ca('0x27')](function(_0x36b191){if(_0x36b191){var _0xa18b32=_[_0x71ca('0x6d')](_0x36b191,function(_0x78fd69){var _0x434497=_0x78fd69['get']({'plain':!![]});return _0x434497[_0x71ca('0x6a')];});return db[_0x71ca('0x30')][_0x71ca('0x4c')]({'where':{'id':_0x2d368d[_0x71ca('0x48')]['id']}})['then'](function(_0x58ba92){return db['sequelize'][_0x71ca('0x6e')](function(_0x264b56){return _0x58ba92[_0x71ca('0x67')](_0x4c21ee,{'transaction':_0x264b56})[_0x71ca('0x27')](function(){return BPromise[_0x71ca('0x6f')](_0xa18b32,function(_0x3e9ae6){return db[_0x71ca('0x5a')][_0x71ca('0x70')]({'where':{'UserId':_0x3e9ae6['id'],'MailQueueId':_0x2d368d['params']['id']},'transaction':_0x264b56});});})[_0x71ca('0x27')](function(){_0xa18b32[_0x71ca('0x71')](function(_0x14d276){socket[_0x71ca('0x72')]('userMailQueue:save',{'UserId':_0x14d276['id'],'MailQueueId':_0x58ba92['id']});});});});});}})[_0x71ca('0x27')](respondWithStatusCode(_0x2b7b3b,null))[_0x71ca('0x46')](handleError(_0x2b7b3b,null));};exports[_0x71ca('0x73')]=function(_0x3af6c6,_0x5d7287,_0x2eb3e9){return db[_0x71ca('0x66')][_0x71ca('0x5b')]({'where':{'id':_0x3af6c6[_0x71ca('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x71ca('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x71ca('0x27')](handleEntityNotFound(_0x5d7287,null))[_0x71ca('0x27')](function(_0x570196){var _0x164bcb=_[_0x71ca('0x2f')](_0x570196,'id');var _0x43d880=[];var _0x4a58fc=[];var _0x29fe4a=squel['select']();_0x29fe4a[_0x71ca('0x74')](_0x71ca('0x75'))[_0x71ca('0x76')]('team_has_mail_queues','tq')[_0x71ca('0x77')](_0x71ca('0x78'),'ut',_0x71ca('0x79'))[_0x71ca('0x3f')](_0x71ca('0x7a'),_0x3af6c6[_0x71ca('0x48')]['id']);for(var _0x4f55d2=0x0;_0x4f55d2<_0x570196['length'];_0x4f55d2+=0x1){let _0x963e8a=_0x570196[_0x4f55d2];for(var _0x593ed1=0x0;_0x593ed1<_0x963e8a[_0x71ca('0x6a')][_0x71ca('0x3b')];_0x593ed1+=0x1){let _0x483293=_0x963e8a[_0x71ca('0x6a')][_0x593ed1];var _0x4882a9=_0x29fe4a[_0x71ca('0x7b')]();_0x4882a9[_0x71ca('0x3f')](_0x71ca('0x7c'),_0x483293['id']);_0x4a58fc[_0x71ca('0x7d')](db[_0x71ca('0x7e')]['query'](_0x4882a9[_0x71ca('0x7f')](),{'type':db[_0x71ca('0x7e')][_0x71ca('0x80')][_0x71ca('0x81')]})['then'](function(_0x54f313){if(_0x54f313['length']===0x1){return _0x483293['id'];}else{var _0x1e5585=_[_0x71ca('0x82')](_[_0x71ca('0x2f')](_0x54f313,_0x71ca('0x83')),function(_0x45720b){return _[_0x71ca('0x84')](_0x164bcb,_0x45720b);});if(_0x1e5585){return _0x483293['id'];}}}));}}return BPromise[_0x71ca('0x85')](_0x4a58fc)['then'](function(_0x2bfebc){_0x43d880=_(_0x43d880)[_0x71ca('0x86')](_0x2bfebc)[_0x71ca('0x87')]()['value']();return db[_0x71ca('0x30')][_0x71ca('0x4c')]({'where':{'id':_0x3af6c6[_0x71ca('0x48')]['id']}})['then'](function(_0x1d98c3){return db[_0x71ca('0x7e')]['transaction'](function(_0x3e0069){return _0x1d98c3[_0x71ca('0x73')](_0x3af6c6[_0x71ca('0x36')][_0x71ca('0x68')],{'transaction':_0x3e0069})[_0x71ca('0x27')](function(){if(!_[_0x71ca('0x88')](_0x43d880)){return _0x1d98c3['removeAgents'](_0x43d880,{'transaction':_0x3e0069});}})[_0x71ca('0x27')](function(){_0x43d880[_0x71ca('0x71')](function(_0x59ff40){socket[_0x71ca('0x72')](_0x71ca('0x89'),{'UserId':_0x59ff40,'MailQueueId':_0x1d98c3['id']});});});});});});})['then'](respondWithStatusCode(_0x5d7287,null))[_0x71ca('0x46')](handleError(_0x5d7287,null));};exports[_0x71ca('0x8a')]=function(_0x6833b1,_0x46805a,_0x264880){return db['MailQueue'][_0x71ca('0x4c')]({'where':{'id':_0x6833b1['params']['id']}})['then'](handleEntityNotFound(_0x46805a,null))[_0x71ca('0x27')](function(_0x58e3d0){if(_0x58e3d0){return _0x58e3d0[_0x71ca('0x8a')](_0x6833b1[_0x71ca('0x54')][_0x71ca('0x68')],_[_0x71ca('0x8b')](_0x6833b1[_0x71ca('0x54')],[_0x71ca('0x68'),'id'])||{})[_0x71ca('0x8c')](function(_0x56661d){for(var _0x27d6e9=0x0;_0x27d6e9<_0x6833b1['body']['ids'][_0x71ca('0x3b')];_0x27d6e9+=0x1){socket['emit'](_0x71ca('0x8d'),{'UserId':Number(_0x6833b1[_0x71ca('0x54')][_0x71ca('0x68')][_0x27d6e9]),'MailQueueId':Number(_0x6833b1[_0x71ca('0x48')]['id'])});}return _0x56661d;});}})[_0x71ca('0x27')](respondWithResult(_0x46805a,null))[_0x71ca('0x46')](handleError(_0x46805a,null));};exports[_0x71ca('0x8e')]=function(_0x41e977,_0x370a97,_0x432e21){return db[_0x71ca('0x30')][_0x71ca('0x4c')]({'where':{'id':_0x41e977[_0x71ca('0x48')]['id']}})[_0x71ca('0x27')](handleEntityNotFound(_0x370a97,null))[_0x71ca('0x27')](function(_0x2783ec){if(_0x2783ec){return _0x2783ec[_0x71ca('0x8e')](_0x41e977['query']['ids'])[_0x71ca('0x27')](function(){if(_[_0x71ca('0x8f')](_0x41e977[_0x71ca('0x36')][_0x71ca('0x68')])){for(var _0x3302fc=0x0;_0x3302fc<_0x41e977['query'][_0x71ca('0x68')][_0x71ca('0x3b')];_0x3302fc+=0x1){socket[_0x71ca('0x72')](_0x71ca('0x89'),{'UserId':Number(_0x41e977['query']['ids'][_0x3302fc]),'MailQueueId':Number(_0x41e977['params']['id'])});}}else{socket[_0x71ca('0x72')](_0x71ca('0x89'),{'UserId':Number(_0x41e977[_0x71ca('0x36')][_0x71ca('0x68')]),'MailQueueId':Number(_0x41e977[_0x71ca('0x48')]['id'])});}});}})[_0x71ca('0x27')](respondWithStatusCode(_0x370a97,null))[_0x71ca('0x46')](handleError(_0x370a97,null));};exports['getAgents']=function(_0x377d78,_0x15e373,_0x588597){var _0xcadb5={};var _0x415ee7={};var _0x14a155;var _0x5377f8;return db['MailQueue'][_0x71ca('0x57')]({'where':{'id':_0x377d78['params']['id']}})[_0x71ca('0x27')](handleEntityNotFound(_0x15e373,null))[_0x71ca('0x27')](function(_0x46aeaa){if(_0x46aeaa){_0x14a155=_0x46aeaa;_0x415ee7['model']=_[_0x71ca('0x49')](db[_0x71ca('0x69')]['rawAttributes']);_0x415ee7['query']=_['keys'](_0x377d78['query']);_0x415ee7[_0x71ca('0x37')]=_[_0x71ca('0x38')](_0x415ee7['model'],_0x415ee7['query']);_0xcadb5[_0x71ca('0x39')]=_[_0x71ca('0x38')](_0x415ee7[_0x71ca('0x34')],qs[_0x71ca('0x3a')](_0x377d78[_0x71ca('0x36')][_0x71ca('0x3a')]));_0xcadb5['attributes']=_0xcadb5['attributes']['length']?_0xcadb5['attributes']:_0x415ee7['model'];_0xcadb5[_0x71ca('0x58')]=qs[_0x71ca('0x3e')](_0x377d78['query'][_0x71ca('0x3e')]);_0xcadb5[_0x71ca('0x3f')]=qs[_0x71ca('0x37')](_[_0x71ca('0x59')](_0x377d78[_0x71ca('0x36')],_0x415ee7[_0x71ca('0x37')]));if(_0x377d78[_0x71ca('0x36')][_0x71ca('0x40')]){_0xcadb5[_0x71ca('0x3f')]=_['merge'](_0xcadb5[_0x71ca('0x3f')],{'$or':_[_0x71ca('0x2f')](_0xcadb5[_0x71ca('0x39')],function(_0x851e15){var _0x55ae1a={};_0x55ae1a[_0x851e15]={'$like':'%'+_0x377d78[_0x71ca('0x36')][_0x71ca('0x40')]+'%'};return _0x55ae1a;})});}_0xcadb5=_['merge']({},_0xcadb5,_0x377d78[_0x71ca('0x43')]);return _0x14a155[_0x71ca('0x90')](_0xcadb5);}})[_0x71ca('0x27')](function(_0x20a8f9){if(_0x20a8f9){_0x5377f8=_0x20a8f9['length'];if(!_0x377d78[_0x71ca('0x36')][_0x71ca('0x3c')](_0x71ca('0x3d'))){_0xcadb5[_0x71ca('0x20')]=qs[_0x71ca('0x20')](_0x377d78[_0x71ca('0x36')][_0x71ca('0x20')]);_0xcadb5['offset']=qs['offset'](_0x377d78['query'][_0x71ca('0x1e')]);}return _0x14a155[_0x71ca('0x90')](_0xcadb5);}})[_0x71ca('0x27')](function(_0xcb3eec){if(_0xcb3eec){return _0xcb3eec?{'count':_0x5377f8,'rows':_0xcb3eec}:null;}})['then'](respondWithResult(_0x15e373,null))['catch'](handleError(_0x15e373,null));}; \ No newline at end of file +var _0x9434=['then','destroy','get','MailQueues','UserProfileResource','error','name','send','index','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','create','user','userProfileId','body','params','find','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','Team','getTeams','findAll','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update'];(function(_0x34e515,_0x41b150){var _0x5980df=function(_0x13be05){while(--_0x13be05){_0x34e515['push'](_0x34e515['shift']());}};_0x5980df(++_0x41b150);}(_0x9434,0x168));var _0x4943=function(_0x254c2f,_0x2b0be9){_0x254c2f=_0x254c2f-0x0;var _0x50562d=_0x9434[_0x254c2f];return _0x50562d;};'use strict';var emlformat=require(_0x4943('0x0'));var rimraf=require(_0x4943('0x1'));var zipdir=require(_0x4943('0x2'));var jsonpatch=require(_0x4943('0x3'));var rp=require(_0x4943('0x4'));var moment=require(_0x4943('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4943('0x6'));var util=require(_0x4943('0x7'));var path=require('path');var sox=require(_0x4943('0x8'));var csv=require(_0x4943('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4943('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4943('0xb'));var jsforce=require(_0x4943('0xc'));var deskjs=require(_0x4943('0xd'));var toCsv=require(_0x4943('0x9'));var querystring=require(_0x4943('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4943('0xf'));var qs=require(_0x4943('0x10'));var as=require(_0x4943('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4943('0x12'))(_0x4943('0x13'));var utils=require('../../config/utils');var config=require(_0x4943('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4943('0x15')]=_[_0x4943('0x16')](config[_0x4943('0x15')],{'host':_0x4943('0x17'),'port':0x18eb});var socket=require(_0x4943('0x18'))(new Redis(config[_0x4943('0x15')]));require(_0x4943('0x19'))['register'](socket);function respondWithStatusCode(_0x902712,_0xf4ec0b){_0xf4ec0b=_0xf4ec0b||0xcc;return function(_0x2ae9b5){if(_0x2ae9b5){return _0x902712[_0x4943('0x1a')](_0xf4ec0b);}return _0x902712[_0x4943('0x1b')](_0xf4ec0b)[_0x4943('0x1c')]();};}function respondWithResult(_0x4b075e,_0x26b707){_0x26b707=_0x26b707||0xc8;return function(_0x407485){if(_0x407485){return _0x4b075e[_0x4943('0x1b')](_0x26b707)['json'](_0x407485);}};}function respondWithFilteredResult(_0x53377c,_0x2922b8){return function(_0x4cba96){if(_0x4cba96){var _0x2f0add=typeof _0x2922b8[_0x4943('0x1d')]==='undefined'&&typeof _0x2922b8[_0x4943('0x1e')]===_0x4943('0x1f');var _0x38749b=_0x4cba96['count'];var _0x44f439=_0x2f0add?0x0:_0x2922b8['offset'];var _0x2833ed=_0x2f0add?_0x4cba96[_0x4943('0x20')]:_0x2922b8[_0x4943('0x1d')]+_0x2922b8[_0x4943('0x1e')];var _0x278569;if(_0x2833ed>=_0x38749b){_0x2833ed=_0x38749b;_0x278569=0xc8;}else{_0x278569=0xce;}_0x53377c[_0x4943('0x1b')](_0x278569);return _0x53377c['set'](_0x4943('0x21'),_0x44f439+'-'+_0x2833ed+'/'+_0x38749b)[_0x4943('0x22')](_0x4cba96);}return null;};}function patchUpdates(_0x34e322){return function(_0x325f07){try{jsonpatch[_0x4943('0x23')](_0x325f07,_0x34e322,!![]);}catch(_0xd88a73){return BPromise[_0x4943('0x24')](_0xd88a73);}return _0x325f07[_0x4943('0x25')]();};}function saveUpdates(_0x5dd061,_0x5dbc0a){return function(_0x315c7f){if(_0x315c7f){return _0x315c7f[_0x4943('0x26')](_0x5dd061)[_0x4943('0x27')](function(_0x5d8cbe){return _0x5d8cbe;});}return null;};}function removeEntity(_0x41f98d,_0xd49582){return function(_0x4a442e){if(_0x4a442e){return _0x4a442e[_0x4943('0x28')]()[_0x4943('0x27')](function(){var _0x43cbfe=_0x4a442e[_0x4943('0x29')]({'plain':!![]});var _0x35f393=_0x4943('0x2a');return db[_0x4943('0x2b')][_0x4943('0x28')]({'where':{'type':_0x35f393,'resourceId':_0x43cbfe['id']}})[_0x4943('0x27')](function(){return _0x4a442e;});})[_0x4943('0x27')](function(){_0x41f98d[_0x4943('0x1b')](0xcc)[_0x4943('0x1c')]();});}};}function handleEntityNotFound(_0xa71fec,_0x83bbd8){return function(_0x38b0a0){if(!_0x38b0a0){_0xa71fec[_0x4943('0x1a')](0x194);}return _0x38b0a0;};}function handleError(_0x1fbc57,_0x20c7b4){_0x20c7b4=_0x20c7b4||0x1f4;return function(_0x5d792c){logger[_0x4943('0x2c')](_0x5d792c['stack']);if(_0x5d792c[_0x4943('0x2d')]){delete _0x5d792c[_0x4943('0x2d')];}_0x1fbc57[_0x4943('0x1b')](_0x20c7b4)[_0x4943('0x2e')](_0x5d792c);};}exports[_0x4943('0x2f')]=function(_0x248486,_0x3dd058){var _0x315581={},_0x571df7={},_0x322a94={'count':0x0,'rows':[]};var _0x4081fb=_['map'](db[_0x4943('0x30')][_0x4943('0x31')],function(_0x50b275){return{'name':_0x50b275[_0x4943('0x32')],'type':_0x50b275[_0x4943('0x33')][_0x4943('0x34')]};});_0x571df7['model']=_[_0x4943('0x35')](_0x4081fb,_0x4943('0x2d'));_0x571df7[_0x4943('0x36')]=_[_0x4943('0x37')](_0x248486[_0x4943('0x36')]);_0x571df7['filters']=_[_0x4943('0x38')](_0x571df7[_0x4943('0x39')],_0x571df7[_0x4943('0x36')]);_0x315581[_0x4943('0x3a')]=_[_0x4943('0x38')](_0x571df7[_0x4943('0x39')],qs[_0x4943('0x3b')](_0x248486[_0x4943('0x36')][_0x4943('0x3b')]));_0x315581[_0x4943('0x3a')]=_0x315581[_0x4943('0x3a')]['length']?_0x315581[_0x4943('0x3a')]:_0x571df7[_0x4943('0x39')];if(!_0x248486[_0x4943('0x36')][_0x4943('0x3c')](_0x4943('0x3d'))){_0x315581['limit']=qs['limit'](_0x248486['query'][_0x4943('0x1e')]);_0x315581[_0x4943('0x1d')]=qs['offset'](_0x248486[_0x4943('0x36')]['offset']);}_0x315581[_0x4943('0x3e')]=qs[_0x4943('0x3f')](_0x248486[_0x4943('0x36')][_0x4943('0x3f')]);_0x315581[_0x4943('0x40')]=qs[_0x4943('0x41')](_[_0x4943('0x42')](_0x248486[_0x4943('0x36')],_0x571df7[_0x4943('0x41')]),_0x4081fb);if(_0x248486[_0x4943('0x36')][_0x4943('0x43')]){_0x315581[_0x4943('0x40')]=_[_0x4943('0x44')](_0x315581[_0x4943('0x40')],{'$or':_[_0x4943('0x35')](_0x4081fb,function(_0x364acd){if(_0x364acd[_0x4943('0x33')]!==_0x4943('0x45')){var _0x2eeb4b={};_0x2eeb4b[_0x364acd[_0x4943('0x2d')]]={'$like':'%'+_0x248486[_0x4943('0x36')][_0x4943('0x43')]+'%'};return _0x2eeb4b;}})});}_0x315581=_[_0x4943('0x44')]({},_0x315581,_0x248486[_0x4943('0x46')]);var _0x32e4c1={'where':_0x315581[_0x4943('0x40')]};return db[_0x4943('0x30')]['count'](_0x32e4c1)[_0x4943('0x27')](function(_0x147179){_0x322a94['count']=_0x147179;if(_0x248486['query'][_0x4943('0x47')]){_0x315581['include']=[{'all':!![]}];}return db[_0x4943('0x30')]['findAll'](_0x315581);})[_0x4943('0x27')](function(_0x54db13){_0x322a94[_0x4943('0x48')]=_0x54db13;return _0x322a94;})['then'](respondWithFilteredResult(_0x3dd058,_0x315581))[_0x4943('0x49')](handleError(_0x3dd058,null));};exports[_0x4943('0x4a')]=function(_0x1e1ef,_0x542205){var _0x501eea={'raw':!![],'where':{'id':_0x1e1ef['params']['id']}},_0xc7d961={};_0xc7d961[_0x4943('0x39')]=_['keys'](db[_0x4943('0x30')][_0x4943('0x31')]);_0xc7d961[_0x4943('0x36')]=_[_0x4943('0x37')](_0x1e1ef['query']);_0xc7d961['filters']=_[_0x4943('0x38')](_0xc7d961['model'],_0xc7d961['query']);_0x501eea[_0x4943('0x3a')]=_[_0x4943('0x38')](_0xc7d961[_0x4943('0x39')],qs[_0x4943('0x3b')](_0x1e1ef[_0x4943('0x36')][_0x4943('0x3b')]));_0x501eea[_0x4943('0x3a')]=_0x501eea['attributes'][_0x4943('0x4b')]?_0x501eea[_0x4943('0x3a')]:_0xc7d961['model'];if(_0x1e1ef[_0x4943('0x36')][_0x4943('0x47')]){_0x501eea[_0x4943('0x4c')]=[{'all':!![]}];}_0x501eea=_['merge']({},_0x501eea,_0x1e1ef[_0x4943('0x46')]);return db[_0x4943('0x30')]['find'](_0x501eea)[_0x4943('0x27')](handleEntityNotFound(_0x542205,null))[_0x4943('0x27')](respondWithResult(_0x542205,null))['catch'](handleError(_0x542205,null));};exports[_0x4943('0x4d')]=function(_0x346a6d,_0x289af4){return db['MailQueue'][_0x4943('0x4d')](_0x346a6d['body'],{})['then'](function(_0x1f4f57){var _0x33a332=_0x346a6d[_0x4943('0x4e')]['get']({'plain':!![]});if(!_0x33a332)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33a332['role']===_0x4943('0x4e')){var _0x49fbfb=_0x1f4f57['get']({'plain':!![]});var _0x88b338='MailQueues';return db['UserProfileSection']['find']({'where':{'name':_0x88b338,'userProfileId':_0x33a332[_0x4943('0x4f')]},'raw':!![]})[_0x4943('0x27')](function(_0x24288a){if(_0x24288a&&_0x24288a['autoAssociation']===0x0){return db[_0x4943('0x2b')][_0x4943('0x4d')]({'name':_0x49fbfb[_0x4943('0x2d')],'resourceId':_0x49fbfb['id'],'type':_0x24288a['name'],'sectionId':_0x24288a['id']},{})[_0x4943('0x27')](function(){return _0x1f4f57;});}else{return _0x1f4f57;}})[_0x4943('0x49')](function(_0x5d4948){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d4948);throw _0x5d4948;});}return _0x1f4f57;})['then'](respondWithResult(_0x289af4,0xc9))[_0x4943('0x49')](handleError(_0x289af4,null));};exports[_0x4943('0x26')]=function(_0x41e6de,_0x3056c6){if(_0x41e6de['body']['id']){delete _0x41e6de[_0x4943('0x50')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x41e6de[_0x4943('0x51')]['id']}})[_0x4943('0x27')](handleEntityNotFound(_0x3056c6,null))[_0x4943('0x27')](saveUpdates(_0x41e6de['body'],null))[_0x4943('0x27')](respondWithResult(_0x3056c6,null))[_0x4943('0x49')](handleError(_0x3056c6,null));};exports[_0x4943('0x28')]=function(_0x344737,_0x224021){return db['MailQueue'][_0x4943('0x52')]({'where':{'id':_0x344737[_0x4943('0x51')]['id']}})[_0x4943('0x27')](handleEntityNotFound(_0x224021,null))[_0x4943('0x27')](removeEntity(_0x224021,null))['catch'](handleError(_0x224021,null));};exports['describe']=function(_0x273493,_0x1670c9){return db[_0x4943('0x30')]['describe']()[_0x4943('0x27')](respondWithResult(_0x1670c9,null))[_0x4943('0x49')](handleError(_0x1670c9,null));};exports[_0x4943('0x53')]=function(_0x15b827,_0x2ca08e,_0x2b8a57){var _0x4c70b9={'raw':!![],'where':{}},_0x20af64={},_0x3bf6e2;return db[_0x4943('0x30')][_0x4943('0x54')]({'where':{'id':_0x15b827[_0x4943('0x51')]['id']}})[_0x4943('0x27')](handleEntityNotFound(_0x2ca08e,null))[_0x4943('0x27')](function(_0x3a382c){if(_0x3a382c){_0x3bf6e2=_0x3a382c[_0x4943('0x29')]({'plain':!![]});_0x20af64['model']=_['keys'](db[_0x4943('0x55')]['rawAttributes']);_0x20af64[_0x4943('0x36')]=_[_0x4943('0x37')](_0x15b827['query']);_0x20af64[_0x4943('0x41')]=_['intersection'](_0x20af64['model'],_0x20af64['query']);_0x4c70b9['attributes']=_[_0x4943('0x38')](_0x20af64[_0x4943('0x39')],qs[_0x4943('0x3b')](_0x15b827[_0x4943('0x36')][_0x4943('0x3b')]));_0x4c70b9[_0x4943('0x3a')]=_0x4c70b9[_0x4943('0x3a')][_0x4943('0x4b')]?_0x4c70b9[_0x4943('0x3a')]:_0x20af64[_0x4943('0x39')];if(!_0x15b827[_0x4943('0x36')][_0x4943('0x3c')](_0x4943('0x3d'))){_0x4c70b9[_0x4943('0x1e')]=qs[_0x4943('0x1e')](_0x15b827[_0x4943('0x36')][_0x4943('0x1e')]);_0x4c70b9[_0x4943('0x1d')]=qs[_0x4943('0x1d')](_0x15b827['query'][_0x4943('0x1d')]);}_0x4c70b9[_0x4943('0x3e')]=qs[_0x4943('0x3f')](_0x15b827[_0x4943('0x36')][_0x4943('0x3f')]);_0x4c70b9[_0x4943('0x40')]=qs['filters'](_['pick'](_0x15b827[_0x4943('0x36')],_0x20af64[_0x4943('0x41')]));_0x4c70b9[_0x4943('0x40')][_0x4943('0x56')]=_0x3a382c['id'];if(_0x15b827[_0x4943('0x36')][_0x4943('0x43')]){_0x4c70b9['where']=_[_0x4943('0x44')](_0x4c70b9[_0x4943('0x40')],{'$or':_['map'](_0x4c70b9[_0x4943('0x3a')],function(_0x202144){var _0x4f60f8={};_0x4f60f8[_0x202144]={'$like':'%'+_0x15b827['query'][_0x4943('0x43')]+'%'};return _0x4f60f8;})});}_0x4c70b9=_[_0x4943('0x44')]({},_0x4c70b9,_0x15b827['options']);return db[_0x4943('0x55')]['findAll'](_0x4c70b9);}})[_0x4943('0x27')](function(_0x4259df){if(_0x4259df){return db[_0x4943('0x57')][_0x4943('0x58')]({'where':{'id':_[_0x4943('0x35')](_0x4259df,'UserId'),'role':_0x4943('0x59')},'attributes':['id',_0x4943('0x2d'),_0x4943('0x5a'),_0x4943('0x5b'),'createdAt']});}})[_0x4943('0x27')](function(_0x3f3be4){if(_0x3f3be4){return{'count':_0x3f3be4['count'],'rows':_[_0x4943('0x35')](_0x3f3be4[_0x4943('0x48')],function(_0x55822d){return{'membername':_0x55822d[_0x4943('0x2d')],'UserId':_0x55822d['id'],'queue_name':_0x3bf6e2[_0x4943('0x2d')],'MailQueueId':_0x3bf6e2['id'],'interface':util['format']('%s/%s','SIP',_0x55822d['name']),'penalty':0x0,'paused':_0x55822d[_0x4943('0x5a')],'createdAt':_0x55822d[_0x4943('0x5c')],'updatedAt':_0x55822d[_0x4943('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2ca08e,_0x4c70b9))[_0x4943('0x49')](handleError(_0x2ca08e,null));};exports['getTeams']=function(_0x106240,_0x3f76ee,_0x2382ba){var _0x5bd674={};var _0x5ef17f={};var _0x4d7327;var _0x258ee2;return db[_0x4943('0x30')]['findOne']({'where':{'id':_0x106240[_0x4943('0x51')]['id']}})['then'](handleEntityNotFound(_0x3f76ee,null))[_0x4943('0x27')](function(_0x193422){if(_0x193422){_0x4d7327=_0x193422;_0x5ef17f[_0x4943('0x39')]=_['keys'](db[_0x4943('0x5d')][_0x4943('0x31')]);_0x5ef17f[_0x4943('0x36')]=_[_0x4943('0x37')](_0x106240['query']);_0x5ef17f['filters']=_['intersection'](_0x5ef17f['model'],_0x5ef17f[_0x4943('0x36')]);_0x5bd674[_0x4943('0x3a')]=_[_0x4943('0x38')](_0x5ef17f['model'],qs[_0x4943('0x3b')](_0x106240['query'][_0x4943('0x3b')]));_0x5bd674[_0x4943('0x3a')]=_0x5bd674[_0x4943('0x3a')][_0x4943('0x4b')]?_0x5bd674[_0x4943('0x3a')]:_0x5ef17f[_0x4943('0x39')];_0x5bd674[_0x4943('0x3e')]=qs['sort'](_0x106240[_0x4943('0x36')][_0x4943('0x3f')]);_0x5bd674[_0x4943('0x40')]=qs[_0x4943('0x41')](_[_0x4943('0x42')](_0x106240[_0x4943('0x36')],_0x5ef17f[_0x4943('0x41')]));if(_0x106240[_0x4943('0x36')][_0x4943('0x43')]){_0x5bd674['where']=_['merge'](_0x5bd674['where'],{'$or':_['map'](_0x5bd674[_0x4943('0x3a')],function(_0x4be4da){var _0x5e2efa={};_0x5e2efa[_0x4be4da]={'$like':'%'+_0x106240['query']['filter']+'%'};return _0x5e2efa;})});}_0x5bd674=_['merge']({},_0x5bd674,_0x106240[_0x4943('0x46')]);return _0x4d7327[_0x4943('0x5e')](_0x5bd674);}})[_0x4943('0x27')](function(_0x4ae248){if(_0x4ae248){_0x258ee2=_0x4ae248[_0x4943('0x4b')];if(!_0x106240[_0x4943('0x36')][_0x4943('0x3c')](_0x4943('0x3d'))){_0x5bd674['limit']=qs[_0x4943('0x1e')](_0x106240[_0x4943('0x36')][_0x4943('0x1e')]);_0x5bd674['offset']=qs[_0x4943('0x1d')](_0x106240[_0x4943('0x36')][_0x4943('0x1d')]);}return _0x4d7327[_0x4943('0x5e')](_0x5bd674);}})[_0x4943('0x27')](function(_0x258792){if(_0x258792){return _0x258792?{'count':_0x258ee2,'rows':_0x258792}:null;}})[_0x4943('0x27')](respondWithResult(_0x3f76ee,null))[_0x4943('0x49')](handleError(_0x3f76ee,null));};exports['addTeams']=function(_0x6d85f4,_0xdc215b,_0x59313e){var _0x25b309=_0x6d85f4['body']['ids'];return db['Team'][_0x4943('0x5f')]({'where':{'id':_0x25b309},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4943('0x60'),'attributes':['id',_0x4943('0x2d'),'online',_0x4943('0x61'),_0x4943('0x62')],'raw':!![]}]})[_0x4943('0x27')](function(_0x1569ed){if(_0x1569ed){var _0x119a8a=_[_0x4943('0x63')](_0x1569ed,function(_0x2b0f59){var _0x47832b=_0x2b0f59[_0x4943('0x29')]({'plain':!![]});return _0x47832b[_0x4943('0x60')];});return db['MailQueue'][_0x4943('0x52')]({'where':{'id':_0x6d85f4['params']['id']}})[_0x4943('0x27')](function(_0x3be116){return db[_0x4943('0x64')][_0x4943('0x65')](function(_0x3c5bda){return _0x3be116[_0x4943('0x66')](_0x25b309,{'transaction':_0x3c5bda})['then'](function(){return BPromise[_0x4943('0x67')](_0x119a8a,function(_0x3718e5){return db[_0x4943('0x55')][_0x4943('0x68')]({'where':{'UserId':_0x3718e5['id'],'MailQueueId':_0x6d85f4['params']['id']},'transaction':_0x3c5bda});});})[_0x4943('0x27')](function(){_0x119a8a[_0x4943('0x69')](function(_0x149a51){socket[_0x4943('0x6a')]('userMailQueue:save',{'UserId':_0x149a51['id'],'MailQueueId':_0x3be116['id']});});});});});}})[_0x4943('0x27')](respondWithStatusCode(_0xdc215b,null))[_0x4943('0x49')](handleError(_0xdc215b,null));};exports[_0x4943('0x6b')]=function(_0x127357,_0x2bc020,_0xc4e3b9){return db[_0x4943('0x5d')][_0x4943('0x5f')]({'where':{'id':_0x127357[_0x4943('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4943('0x57')],'as':_0x4943('0x60'),'attributes':['id'],'raw':!![]}]})[_0x4943('0x27')](handleEntityNotFound(_0x2bc020,null))[_0x4943('0x27')](function(_0x535a69){var _0x570e41=_['map'](_0x535a69,'id');var _0x10da1d=[];var _0x15d621=[];var _0x3b754e=squel[_0x4943('0x6c')]();_0x3b754e[_0x4943('0x6d')](_0x4943('0x6e'))[_0x4943('0x6f')](_0x4943('0x70'),'tq')[_0x4943('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4943('0x40')]('MailQueueId\x20=\x20?',_0x127357[_0x4943('0x51')]['id']);for(var _0x4282f8=0x0;_0x4282f8<_0x535a69['length'];_0x4282f8+=0x1){let _0xe133b8=_0x535a69[_0x4282f8];for(var _0x11e0a9=0x0;_0x11e0a9<_0xe133b8[_0x4943('0x60')][_0x4943('0x4b')];_0x11e0a9+=0x1){let _0x385bd8=_0xe133b8[_0x4943('0x60')][_0x11e0a9];var _0x3597d5=_0x3b754e['clone']();_0x3597d5['where'](_0x4943('0x72'),_0x385bd8['id']);_0x15d621['push'](db['sequelize'][_0x4943('0x36')](_0x3597d5[_0x4943('0x73')](),{'type':db[_0x4943('0x64')][_0x4943('0x74')][_0x4943('0x75')]})[_0x4943('0x27')](function(_0x19b2ed){if(_0x19b2ed[_0x4943('0x4b')]===0x1){return _0x385bd8['id'];}else{var _0x31510b=_[_0x4943('0x76')](_['map'](_0x19b2ed,_0x4943('0x77')),function(_0x410b14){return _['includes'](_0x570e41,_0x410b14);});if(_0x31510b){return _0x385bd8['id'];}}}));}}return BPromise[_0x4943('0x78')](_0x15d621)[_0x4943('0x27')](function(_0x10a736){_0x10da1d=_(_0x10da1d)[_0x4943('0x79')](_0x10a736)[_0x4943('0x7a')]()[_0x4943('0x7b')]();return db[_0x4943('0x30')][_0x4943('0x52')]({'where':{'id':_0x127357[_0x4943('0x51')]['id']}})['then'](function(_0x217157){return db['sequelize'][_0x4943('0x65')](function(_0x460a82){return _0x217157[_0x4943('0x6b')](_0x127357[_0x4943('0x36')][_0x4943('0x7c')],{'transaction':_0x460a82})['then'](function(){if(!_[_0x4943('0x7d')](_0x10da1d)){return _0x217157['removeAgents'](_0x10da1d,{'transaction':_0x460a82});}})['then'](function(){_0x10da1d[_0x4943('0x69')](function(_0x34056b){socket[_0x4943('0x6a')](_0x4943('0x7e'),{'UserId':_0x34056b,'MailQueueId':_0x217157['id']});});});});});});})[_0x4943('0x27')](respondWithStatusCode(_0x2bc020,null))['catch'](handleError(_0x2bc020,null));};exports[_0x4943('0x7f')]=function(_0x59fa0e,_0x2f6925,_0x305689){return db[_0x4943('0x30')][_0x4943('0x52')]({'where':{'id':_0x59fa0e['params']['id']}})[_0x4943('0x27')](handleEntityNotFound(_0x2f6925,null))[_0x4943('0x27')](function(_0x5eaab3){if(_0x5eaab3){return _0x5eaab3['addAgents'](_0x59fa0e[_0x4943('0x50')][_0x4943('0x7c')],_[_0x4943('0x80')](_0x59fa0e[_0x4943('0x50')],[_0x4943('0x7c'),'id'])||{})[_0x4943('0x81')](function(_0x5dec5f){for(var _0x5bcca3=0x0;_0x5bcca3<_0x59fa0e[_0x4943('0x50')][_0x4943('0x7c')][_0x4943('0x4b')];_0x5bcca3+=0x1){socket[_0x4943('0x6a')]('userMailQueue:save',{'UserId':Number(_0x59fa0e[_0x4943('0x50')][_0x4943('0x7c')][_0x5bcca3]),'MailQueueId':Number(_0x59fa0e[_0x4943('0x51')]['id'])});}return _0x5dec5f;});}})[_0x4943('0x27')](respondWithResult(_0x2f6925,null))[_0x4943('0x49')](handleError(_0x2f6925,null));};exports[_0x4943('0x82')]=function(_0x3beceb,_0x4ec551,_0x10a9c8){return db[_0x4943('0x30')][_0x4943('0x52')]({'where':{'id':_0x3beceb[_0x4943('0x51')]['id']}})[_0x4943('0x27')](handleEntityNotFound(_0x4ec551,null))[_0x4943('0x27')](function(_0x42eb38){if(_0x42eb38){return _0x42eb38[_0x4943('0x82')](_0x3beceb[_0x4943('0x36')][_0x4943('0x7c')])[_0x4943('0x27')](function(){if(_[_0x4943('0x83')](_0x3beceb[_0x4943('0x36')][_0x4943('0x7c')])){for(var _0x4e2264=0x0;_0x4e2264<_0x3beceb[_0x4943('0x36')][_0x4943('0x7c')][_0x4943('0x4b')];_0x4e2264+=0x1){socket[_0x4943('0x6a')](_0x4943('0x7e'),{'UserId':Number(_0x3beceb[_0x4943('0x36')]['ids'][_0x4e2264]),'MailQueueId':Number(_0x3beceb[_0x4943('0x51')]['id'])});}}else{socket['emit'](_0x4943('0x7e'),{'UserId':Number(_0x3beceb[_0x4943('0x36')]['ids']),'MailQueueId':Number(_0x3beceb['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4ec551,null))[_0x4943('0x49')](handleError(_0x4ec551,null));};exports[_0x4943('0x84')]=function(_0x1b516e,_0x45a19f,_0x3a9960){var _0x7621b3={};var _0x564863={};var _0x19127c;var _0x36ae89;return db[_0x4943('0x30')][_0x4943('0x54')]({'where':{'id':_0x1b516e['params']['id']}})[_0x4943('0x27')](handleEntityNotFound(_0x45a19f,null))['then'](function(_0x10148d){if(_0x10148d){_0x19127c=_0x10148d;_0x564863[_0x4943('0x39')]=_[_0x4943('0x37')](db[_0x4943('0x57')][_0x4943('0x31')]);_0x564863[_0x4943('0x36')]=_[_0x4943('0x37')](_0x1b516e['query']);_0x564863['filters']=_[_0x4943('0x38')](_0x564863[_0x4943('0x39')],_0x564863['query']);_0x7621b3[_0x4943('0x3a')]=_[_0x4943('0x38')](_0x564863[_0x4943('0x39')],qs[_0x4943('0x3b')](_0x1b516e['query'][_0x4943('0x3b')]));_0x7621b3[_0x4943('0x3a')]=_0x7621b3['attributes'][_0x4943('0x4b')]?_0x7621b3[_0x4943('0x3a')]:_0x564863['model'];_0x7621b3[_0x4943('0x3e')]=qs[_0x4943('0x3f')](_0x1b516e[_0x4943('0x36')][_0x4943('0x3f')]);_0x7621b3[_0x4943('0x40')]=qs[_0x4943('0x41')](_['pick'](_0x1b516e[_0x4943('0x36')],_0x564863[_0x4943('0x41')]));if(_0x1b516e[_0x4943('0x36')][_0x4943('0x43')]){_0x7621b3[_0x4943('0x40')]=_['merge'](_0x7621b3['where'],{'$or':_['map'](_0x7621b3[_0x4943('0x3a')],function(_0x1926de){var _0x44d3ba={};_0x44d3ba[_0x1926de]={'$like':'%'+_0x1b516e[_0x4943('0x36')]['filter']+'%'};return _0x44d3ba;})});}_0x7621b3=_[_0x4943('0x44')]({},_0x7621b3,_0x1b516e[_0x4943('0x46')]);return _0x19127c['getAgents'](_0x7621b3);}})[_0x4943('0x27')](function(_0x1d10dd){if(_0x1d10dd){_0x36ae89=_0x1d10dd[_0x4943('0x4b')];if(!_0x1b516e[_0x4943('0x36')][_0x4943('0x3c')](_0x4943('0x3d'))){_0x7621b3[_0x4943('0x1e')]=qs[_0x4943('0x1e')](_0x1b516e[_0x4943('0x36')][_0x4943('0x1e')]);_0x7621b3[_0x4943('0x1d')]=qs['offset'](_0x1b516e['query'][_0x4943('0x1d')]);}return _0x19127c['getAgents'](_0x7621b3);}})[_0x4943('0x27')](function(_0x353cf9){if(_0x353cf9){return _0x353cf9?{'count':_0x36ae89,'rows':_0x353cf9}:null;}})[_0x4943('0x27')](respondWithResult(_0x45a19f,null))[_0x4943('0x49')](handleError(_0x45a19f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 217c55a..cb48412 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 _0xe76b=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x3d214b,_0x16bb18){var _0x405854=function(_0x15244b){while(--_0x15244b){_0x3d214b['push'](_0x3d214b['shift']());}};_0x405854(++_0x16bb18);}(_0xe76b,0xd7));var _0xbe76=function(_0x978971,_0x4ca3cb){_0x978971=_0x978971-0x0;var _0x48572f=_0xe76b[_0x978971];return _0x48572f;};'use strict';var EventEmitter=require(_0xbe76('0x0'));var MailQueue=require(_0xbe76('0x1'))['db'][_0xbe76('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbe76('0x3')](0x0);var events={'afterCreate':_0xbe76('0x4'),'afterUpdate':_0xbe76('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1cff8b){return function(_0x2d66e8,_0x4913ce,_0x3033d6){MailQueueEvents['emit'](_0x1cff8b+':'+_0x2d66e8['id'],_0x2d66e8);MailQueueEvents[_0xbe76('0x6')](_0x1cff8b,_0x2d66e8);_0x3033d6(null);};}for(var e in events){if(events[_0xbe76('0x7')](e)){var event=events[e];MailQueue[_0xbe76('0x8')](e,emitEvent(event));}}module[_0xbe76('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xd076=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue'];(function(_0x4998c1,_0x43dfa3){var _0xc5c474=function(_0x4b4448){while(--_0x4b4448){_0x4998c1['push'](_0x4998c1['shift']());}};_0xc5c474(++_0x43dfa3);}(_0xd076,0x101));var _0x6d07=function(_0x43e527,_0x2431c0){_0x43e527=_0x43e527-0x0;var _0x197f52=_0xd076[_0x43e527];return _0x197f52;};'use strict';var EventEmitter=require(_0x6d07('0x0'));var MailQueue=require(_0x6d07('0x1'))['db'][_0x6d07('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6d07('0x3')](0x0);var events={'afterCreate':_0x6d07('0x4'),'afterUpdate':_0x6d07('0x5'),'afterDestroy':_0x6d07('0x6')};function emitEvent(_0x37ef0d){return function(_0x9a513b,_0x380b52,_0x581bd5){MailQueueEvents[_0x6d07('0x7')](_0x37ef0d+':'+_0x9a513b['id'],_0x9a513b);MailQueueEvents['emit'](_0x37ef0d,_0x9a513b);_0x581bd5(null);};}for(var e in events){if(events[_0x6d07('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x6d07('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ebaa50e..a1b4ca3 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 _0x5790=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api','moment'];(function(_0x3a3a6a,_0x5eb6a9){var _0xa89294=function(_0x55d78c){while(--_0x55d78c){_0x3a3a6a['push'](_0x3a3a6a['shift']());}};_0xa89294(++_0x5eb6a9);}(_0x5790,0x15b));var _0x0579=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5790[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0579('0x0'));var util=require('util');var logger=require(_0x0579('0x1'))(_0x0579('0x2'));var moment=require(_0x0579('0x3'));var BPromise=require('bluebird');var rp=require(_0x0579('0x4'));var fs=require('fs');var path=require(_0x0579('0x5'));var rimraf=require(_0x0579('0x6'));var config=require(_0x0579('0x7'));var attributes=require(_0x0579('0x8'));module[_0x0579('0x9')]=function(_0x27f7f6,_0x4b3c0b){return _0x27f7f6[_0x0579('0xa')](_0x0579('0xb'),attributes,{'tableName':_0x0579('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe4e=['moment','bluebird','request-promise','path','../../config/environment','define','MailQueue','lodash','util','../../config/logger'];(function(_0x362d6a,_0x253e0d){var _0x2af49e=function(_0x4a43f8){while(--_0x4a43f8){_0x362d6a['push'](_0x362d6a['shift']());}};_0x2af49e(++_0x253e0d);}(_0xfe4e,0xb1));var _0xefe4=function(_0x4f8bbf,_0x1b1a45){_0x4f8bbf=_0x4f8bbf-0x0;var _0x5aa7a7=_0xfe4e[_0x4f8bbf];return _0x5aa7a7;};'use strict';var _=require(_0xefe4('0x0'));var util=require(_0xefe4('0x1'));var logger=require(_0xefe4('0x2'))('api');var moment=require(_0xefe4('0x3'));var BPromise=require(_0xefe4('0x4'));var rp=require(_0xefe4('0x5'));var fs=require('fs');var path=require(_0xefe4('0x6'));var rimraf=require('rimraf');var config=require(_0xefe4('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x106329,_0x24307c){return _0x106329[_0xefe4('0x8')](_0xefe4('0x9'),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 91ee413..0563c2d 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 _0xefd6=['where','attributes','include','map','model','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw'];(function(_0x8ec947,_0x444fa2){var _0x115d2b=function(_0x4cbd1a){while(--_0x4cbd1a){_0x8ec947['push'](_0x8ec947['shift']());}};_0x115d2b(++_0x444fa2);}(_0xefd6,0x126));var _0x6efd=function(_0x398b37,_0x47322e){_0x398b37=_0x398b37-0x0;var _0xd5ac06=_0xefd6[_0x398b37];return _0xd5ac06;};'use strict';var _=require(_0x6efd('0x0'));var util=require(_0x6efd('0x1'));var moment=require(_0x6efd('0x2'));var BPromise=require(_0x6efd('0x3'));var rs=require(_0x6efd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6efd('0x5'))['db'];var utils=require(_0x6efd('0x6'));var logger=require(_0x6efd('0x7'))(_0x6efd('0x8'));var config=require(_0x6efd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6efd('0xa')]({'port':0x232a});config['redis']=_[_0x6efd('0xb')](config[_0x6efd('0xc')],{'host':_0x6efd('0xd'),'port':0x18eb});var socket=require(_0x6efd('0xe'))(new Redis(config[_0x6efd('0xc')]));require(_0x6efd('0xf'))[_0x6efd('0x10')](socket);function respondWithRpcPromise(_0x4d2195,_0x348e0a,_0x3d5770){return new BPromise(function(_0x1cd95e,_0x347d5b){return client[_0x6efd('0x11')](_0x4d2195,_0x3d5770)[_0x6efd('0x12')](function(_0x17861c){logger[_0x6efd('0x13')](_0x6efd('0x14'),_0x348e0a,_0x6efd('0x15'));logger[_0x6efd('0x16')](_0x6efd('0x17'),_0x348e0a,_0x6efd('0x15'),JSON[_0x6efd('0x18')](_0x17861c));if(_0x17861c[_0x6efd('0x19')]){if(_0x17861c[_0x6efd('0x19')][_0x6efd('0x1a')]===0x1f4){logger[_0x6efd('0x19')]('MailQueue,\x20%s,\x20%s',_0x348e0a,_0x17861c['error']['message']);return _0x347d5b(_0x17861c['error'][_0x6efd('0x1b')]);}logger[_0x6efd('0x19')](_0x6efd('0x14'),_0x348e0a,_0x17861c[_0x6efd('0x19')][_0x6efd('0x1b')]);return _0x1cd95e(_0x17861c[_0x6efd('0x19')][_0x6efd('0x1b')]);}else{logger[_0x6efd('0x13')](_0x6efd('0x14'),_0x348e0a,_0x6efd('0x15'));_0x1cd95e(_0x17861c['result'][_0x6efd('0x1b')]);}})[_0x6efd('0x1c')](function(_0x48762a){logger['error'](_0x6efd('0x14'),_0x348e0a,_0x48762a);_0x347d5b(_0x48762a);});});}exports[_0x6efd('0x1d')]=function(_0x4c1686){var _0x118197=this;return new Promise(function(_0x46de82,_0x4fac36){return db[_0x6efd('0x1e')][_0x6efd('0x1f')]({'raw':_0x4c1686[_0x6efd('0x20')]?_0x4c1686[_0x6efd('0x20')][_0x6efd('0x21')]===undefined?!![]:![]:!![],'where':_0x4c1686[_0x6efd('0x20')]?_0x4c1686['options'][_0x6efd('0x22')]||null:null,'attributes':_0x4c1686[_0x6efd('0x20')]?_0x4c1686[_0x6efd('0x20')][_0x6efd('0x23')]||null:null,'limit':_0x4c1686[_0x6efd('0x20')]?_0x4c1686[_0x6efd('0x20')]['limit']||null:null,'include':_0x4c1686[_0x6efd('0x20')]?_0x4c1686['options'][_0x6efd('0x24')]?_['map'](_0x4c1686[_0x6efd('0x20')][_0x6efd('0x24')],function(_0xfde98e){return{'model':db[_0xfde98e['model']],'as':_0xfde98e['as'],'attributes':_0xfde98e[_0x6efd('0x23')],'include':_0xfde98e[_0x6efd('0x24')]?_[_0x6efd('0x25')](_0xfde98e['include'],function(_0xca945b){return{'model':db[_0xca945b['model']],'as':_0xca945b['as'],'attributes':_0xca945b[_0x6efd('0x23')],'include':_0xca945b[_0x6efd('0x24')]?_['map'](_0xca945b['include'],function(_0x55a650){return{'model':db[_0x55a650[_0x6efd('0x26')]],'as':_0x55a650['as'],'attributes':_0x55a650[_0x6efd('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36406f){logger['info'](_0x6efd('0x1d'),_0x4c1686);logger[_0x6efd('0x16')](_0x6efd('0x1d'),_0x4c1686,JSON[_0x6efd('0x18')](_0x36406f));_0x46de82(_0x36406f);})['catch'](function(_0x36fdd2){logger[_0x6efd('0x19')]('GetMailQueue',_0x36fdd2[_0x6efd('0x1b')],_0x4c1686);_0x4fac36(_0x118197[_0x6efd('0x19')](0x1f4,_0x36fdd2[_0x6efd('0x1b')]));});});};exports['ShowMailQueue']=function(_0x436b80){var _0x354892=this;return new Promise(function(_0x29b392,_0x696cf9){return db['MailQueue'][_0x6efd('0x27')]({'raw':_0x436b80[_0x6efd('0x20')]?_0x436b80[_0x6efd('0x20')][_0x6efd('0x21')]===undefined?!![]:![]:!![],'where':_0x436b80[_0x6efd('0x20')]?_0x436b80[_0x6efd('0x20')][_0x6efd('0x22')]||null:null,'attributes':_0x436b80[_0x6efd('0x20')]?_0x436b80[_0x6efd('0x20')][_0x6efd('0x23')]||null:null,'include':_0x436b80['options']?_0x436b80[_0x6efd('0x20')][_0x6efd('0x24')]?_['map'](_0x436b80['options'][_0x6efd('0x24')],function(_0x4ef412){return{'model':db[_0x4ef412[_0x6efd('0x26')]],'as':_0x4ef412['as'],'attributes':_0x4ef412['attributes'],'include':_0x4ef412[_0x6efd('0x24')]?_[_0x6efd('0x25')](_0x4ef412[_0x6efd('0x24')],function(_0x24d993){return{'model':db[_0x24d993['model']],'as':_0x24d993['as'],'attributes':_0x24d993[_0x6efd('0x23')],'include':_0x24d993[_0x6efd('0x24')]?_[_0x6efd('0x25')](_0x24d993[_0x6efd('0x24')],function(_0x59368f){return{'model':db[_0x59368f[_0x6efd('0x26')]],'as':_0x59368f['as'],'attributes':_0x59368f[_0x6efd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6efd('0x12')](function(_0x5e5108){logger[_0x6efd('0x13')](_0x6efd('0x28'),_0x436b80);logger[_0x6efd('0x16')]('ShowMailQueue',_0x436b80,JSON[_0x6efd('0x18')](_0x5e5108));_0x29b392(_0x5e5108);})['catch'](function(_0x1a0e73){logger[_0x6efd('0x19')](_0x6efd('0x28'),_0x1a0e73[_0x6efd('0x1b')],_0x436b80);_0x696cf9(_0x354892[_0x6efd('0x19')](0x1f4,_0x1a0e73[_0x6efd('0x1b')]));});});}; \ No newline at end of file +var _0x64a6=['stringify','error','code','message','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetMailQueue','MailQueue','ShowMailQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x64a6,0x183));var _0x664a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x64a6[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x664a('0x0'));var util=require(_0x664a('0x1'));var moment=require(_0x664a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x664a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x664a('0x4'));var logger=require(_0x664a('0x5'))(_0x664a('0x6'));var config=require(_0x664a('0x7'));var jayson=require(_0x664a('0x8'));var client=jayson[_0x664a('0x9')][_0x664a('0xa')]({'port':0x232a});config['redis']=_[_0x664a('0xb')](config[_0x664a('0xc')],{'host':_0x664a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x664a('0xc')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x28777d,_0x3d169c,_0x59dee0){return new BPromise(function(_0x4e8464,_0x184447){return client['request'](_0x28777d,_0x59dee0)[_0x664a('0xe')](function(_0xb335f7){logger[_0x664a('0xf')](_0x664a('0x10'),_0x3d169c,_0x664a('0x11'));logger[_0x664a('0x12')](_0x664a('0x13'),_0x3d169c,_0x664a('0x11'),JSON[_0x664a('0x14')](_0xb335f7));if(_0xb335f7[_0x664a('0x15')]){if(_0xb335f7[_0x664a('0x15')][_0x664a('0x16')]===0x1f4){logger[_0x664a('0x15')](_0x664a('0x10'),_0x3d169c,_0xb335f7[_0x664a('0x15')][_0x664a('0x17')]);return _0x184447(_0xb335f7[_0x664a('0x15')][_0x664a('0x17')]);}logger['error'](_0x664a('0x10'),_0x3d169c,_0xb335f7['error'][_0x664a('0x17')]);return _0x4e8464(_0xb335f7[_0x664a('0x15')][_0x664a('0x17')]);}else{logger['info'](_0x664a('0x10'),_0x3d169c,'request\x20sent');_0x4e8464(_0xb335f7['result']['message']);}})[_0x664a('0x18')](function(_0x548bf1){logger[_0x664a('0x15')](_0x664a('0x10'),_0x3d169c,_0x548bf1);_0x184447(_0x548bf1);});});}exports['GetMailQueue']=function(_0x23a7d6){var _0x43ca29=this;return new Promise(function(_0x5f5548,_0x101e9c){return db['MailQueue'][_0x664a('0x19')]({'raw':_0x23a7d6[_0x664a('0x1a')]?_0x23a7d6['options'][_0x664a('0x1b')]===undefined?!![]:![]:!![],'where':_0x23a7d6[_0x664a('0x1a')]?_0x23a7d6[_0x664a('0x1a')][_0x664a('0x1c')]||null:null,'attributes':_0x23a7d6[_0x664a('0x1a')]?_0x23a7d6[_0x664a('0x1a')]['attributes']||null:null,'limit':_0x23a7d6[_0x664a('0x1a')]?_0x23a7d6[_0x664a('0x1a')][_0x664a('0x1d')]||null:null,'include':_0x23a7d6[_0x664a('0x1a')]?_0x23a7d6[_0x664a('0x1a')][_0x664a('0x1e')]?_[_0x664a('0x1f')](_0x23a7d6[_0x664a('0x1a')]['include'],function(_0x11cbb8){return{'model':db[_0x11cbb8[_0x664a('0x20')]],'as':_0x11cbb8['as'],'attributes':_0x11cbb8[_0x664a('0x21')],'include':_0x11cbb8[_0x664a('0x1e')]?_[_0x664a('0x1f')](_0x11cbb8[_0x664a('0x1e')],function(_0x338e5b){return{'model':db[_0x338e5b[_0x664a('0x20')]],'as':_0x338e5b['as'],'attributes':_0x338e5b[_0x664a('0x21')],'include':_0x338e5b['include']?_[_0x664a('0x1f')](_0x338e5b[_0x664a('0x1e')],function(_0x7c8ccb){return{'model':db[_0x7c8ccb['model']],'as':_0x7c8ccb['as'],'attributes':_0x7c8ccb[_0x664a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x664a('0xe')](function(_0x85001e){logger[_0x664a('0xf')](_0x664a('0x22'),_0x23a7d6);logger['debug'](_0x664a('0x22'),_0x23a7d6,JSON[_0x664a('0x14')](_0x85001e));_0x5f5548(_0x85001e);})[_0x664a('0x18')](function(_0x219645){logger[_0x664a('0x15')](_0x664a('0x22'),_0x219645['message'],_0x23a7d6);_0x101e9c(_0x43ca29[_0x664a('0x15')](0x1f4,_0x219645['message']));});});};exports['ShowMailQueue']=function(_0x527054){var _0x17913c=this;return new Promise(function(_0x11dde3,_0x3e8f44){return db[_0x664a('0x23')]['find']({'raw':_0x527054[_0x664a('0x1a')]?_0x527054[_0x664a('0x1a')][_0x664a('0x1b')]===undefined?!![]:![]:!![],'where':_0x527054[_0x664a('0x1a')]?_0x527054[_0x664a('0x1a')][_0x664a('0x1c')]||null:null,'attributes':_0x527054[_0x664a('0x1a')]?_0x527054[_0x664a('0x1a')][_0x664a('0x21')]||null:null,'include':_0x527054[_0x664a('0x1a')]?_0x527054['options'][_0x664a('0x1e')]?_[_0x664a('0x1f')](_0x527054[_0x664a('0x1a')][_0x664a('0x1e')],function(_0x4ef7ac){return{'model':db[_0x4ef7ac[_0x664a('0x20')]],'as':_0x4ef7ac['as'],'attributes':_0x4ef7ac[_0x664a('0x21')],'include':_0x4ef7ac[_0x664a('0x1e')]?_[_0x664a('0x1f')](_0x4ef7ac[_0x664a('0x1e')],function(_0x197c05){return{'model':db[_0x197c05['model']],'as':_0x197c05['as'],'attributes':_0x197c05[_0x664a('0x21')],'include':_0x197c05[_0x664a('0x1e')]?_[_0x664a('0x1f')](_0x197c05[_0x664a('0x1e')],function(_0xf8847a){return{'model':db[_0xf8847a['model']],'as':_0xf8847a['as'],'attributes':_0xf8847a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x111bd0){logger[_0x664a('0xf')](_0x664a('0x24'),_0x527054);logger[_0x664a('0x12')](_0x664a('0x24'),_0x527054,JSON[_0x664a('0x14')](_0x111bd0));_0x11dde3(_0x111bd0);})[_0x664a('0x18')](function(_0x170000){logger[_0x664a('0x15')](_0x664a('0x24'),_0x170000['message'],_0x527054);_0x3e8f44(_0x17913c[_0x664a('0x15')](0x1f4,_0x170000['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 317775e..4aed2fe 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 _0x6ee9=['length','mailQueue:','save','remove','emit','removeListener','register'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x6ee9,0x9c));var _0x96ee=function(_0x19fdf2,_0x2286bf){_0x19fdf2=_0x19fdf2-0x0;var _0x2a8df7=_0x6ee9[_0x19fdf2];return _0x2a8df7;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x96ee('0x0'),_0x96ee('0x1'),'update'];function createListener(_0x2cc93f,_0x1b8eb1){return function(_0x119a9b){_0x1b8eb1[_0x96ee('0x2')](_0x2cc93f,_0x119a9b);};}function removeListener(_0x4abf7e,_0x3bacbd){return function(){MailQueueEvents[_0x96ee('0x3')](_0x4abf7e,_0x3bacbd);};}exports[_0x96ee('0x4')]=function(_0x28f15c){for(var _0x42c188=0x0,_0x141f00=events[_0x96ee('0x5')];_0x42c188<_0x141f00;_0x42c188++){var _0x37087c=events[_0x42c188];var _0x44633a=createListener(_0x96ee('0x6')+_0x37087c,_0x28f15c);MailQueueEvents['on'](_0x37087c,_0x44633a);}}; \ No newline at end of file +var _0x4a2e=['save','remove','emit','register','length','./mailQueue.events'];(function(_0x13db42,_0x31e8a2){var _0x1715c8=function(_0x3e6bc0){while(--_0x3e6bc0){_0x13db42['push'](_0x13db42['shift']());}};_0x1715c8(++_0x31e8a2);}(_0x4a2e,0x125));var _0xe4a2=function(_0x176308,_0x5b4d58){_0x176308=_0x176308-0x0;var _0x545160=_0x4a2e[_0x176308];return _0x545160;};'use strict';var MailQueueEvents=require(_0xe4a2('0x0'));var events=[_0xe4a2('0x1'),_0xe4a2('0x2'),'update'];function createListener(_0x36e827,_0x38471b){return function(_0x4f067f){_0x38471b[_0xe4a2('0x3')](_0x36e827,_0x4f067f);};}function removeListener(_0x39b079,_0x583dab){return function(){MailQueueEvents['removeListener'](_0x39b079,_0x583dab);};}exports[_0xe4a2('0x4')]=function(_0x5d62f6){for(var _0x3e0f6c=0x0,_0x53fef5=events[_0xe4a2('0x5')];_0x3e0f6c<_0x53fef5;_0x3e0f6c++){var _0x4ec2aa=events[_0x3e0f6c];var _0x2445da=createListener('mailQueue:'+_0x4ec2aa,_0x5d62f6);MailQueueEvents['on'](_0x4ec2aa,_0x2445da);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f664051..469e5be 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 _0x005c=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports'];(function(_0x453ff6,_0x7b96c8){var _0x13ed00=function(_0x39e533){while(--_0x39e533){_0x453ff6['push'](_0x453ff6['shift']());}};_0x13ed00(++_0x7b96c8);}(_0x005c,0x132));var _0xc005=function(_0x3bd4ba,_0x4f3b0f){_0x3bd4ba=_0x3bd4ba-0x0;var _0x456aca=_0x005c[_0x3bd4ba];return _0x456aca;};'use strict';var multer=require(_0xc005('0x0'));var util=require('util');var path=require(_0xc005('0x1'));var timeout=require(_0xc005('0x2'));var express=require('express');var router=express[_0xc005('0x3')]();var fs_extra=require(_0xc005('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc005('0x5'));var config=require('../../config/environment');var controller=require(_0xc005('0x6'));router[_0xc005('0x7')]('/',auth[_0xc005('0x8')](),controller[_0xc005('0x9')]);router['get']('/describe',auth[_0xc005('0x8')](),controller['describe']);router[_0xc005('0x7')](_0xc005('0xa'),auth['isAuthenticated'](),controller[_0xc005('0xb')]);router[_0xc005('0xc')]('/',auth[_0xc005('0x8')](),controller[_0xc005('0xd')]);router[_0xc005('0xe')]('/:id',auth[_0xc005('0x8')](),controller[_0xc005('0xf')]);router[_0xc005('0x10')](_0xc005('0xa'),auth[_0xc005('0x8')](),controller['destroy']);module[_0xc005('0x11')]=router; \ No newline at end of file +var _0xaefc=['describe','/:id','show','post','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x501f76,_0x51105d){var _0x33d197=function(_0x1ac6ba){while(--_0x1ac6ba){_0x501f76['push'](_0x501f76['shift']());}};_0x33d197(++_0x51105d);}(_0xaefc,0xea));var _0xcaef=function(_0x33aef2,_0x6c1cdf){_0x33aef2=_0x33aef2-0x0;var _0x41b7c2=_0xaefc[_0x33aef2];return _0x41b7c2;};'use strict';var multer=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var path=require(_0xcaef('0x2'));var timeout=require(_0xcaef('0x3'));var express=require(_0xcaef('0x4'));var router=express[_0xcaef('0x5')]();var fs_extra=require(_0xcaef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcaef('0x7'));var config=require(_0xcaef('0x8'));var controller=require('./mailQueueReport.controller');router[_0xcaef('0x9')]('/',auth[_0xcaef('0xa')](),controller[_0xcaef('0xb')]);router[_0xcaef('0x9')](_0xcaef('0xc'),auth[_0xcaef('0xa')](),controller[_0xcaef('0xd')]);router[_0xcaef('0x9')](_0xcaef('0xe'),auth['isAuthenticated'](),controller[_0xcaef('0xf')]);router[_0xcaef('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcaef('0x11')](_0xcaef('0xe'),auth[_0xcaef('0xa')](),controller['update']);router['delete'](_0xcaef('0xe'),auth[_0xcaef('0xa')](),controller['destroy']);module[_0xcaef('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 2670370..a3da108 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 _0x01c9=['exports','STRING','DATE','sequelize'];(function(_0x4202ef,_0x487985){var _0x3909c5=function(_0x452a0c){while(--_0x452a0c){_0x4202ef['push'](_0x4202ef['shift']());}};_0x3909c5(++_0x487985);}(_0x01c9,0x1a3));var _0x901c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x01c9[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var Sequelize=require(_0x901c('0x0'));module[_0x901c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x901c('0x2')]},'joinAt':{'type':Sequelize[_0x901c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x901c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x901c('0x2')]}}; \ No newline at end of file +var _0x7b66=['sequelize','STRING','DATE'];(function(_0x37be92,_0x4d0fb1){var _0x40cb54=function(_0x262a18){while(--_0x262a18){_0x37be92['push'](_0x37be92['shift']());}};_0x40cb54(++_0x4d0fb1);}(_0x7b66,0x1aa));var _0x67b6=function(_0x9cd579,_0x4d9b7c){_0x9cd579=_0x9cd579-0x0;var _0x44ffff=_0x7b66[_0x9cd579];return _0x44ffff;};'use strict';var moment=require('moment');var Sequelize=require(_0x67b6('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x67b6('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x67b6('0x2')]},'acceptAt':{'type':Sequelize[_0x67b6('0x2')]},'exitAt':{'type':Sequelize[_0x67b6('0x2')]},'reason':{'type':Sequelize[_0x67b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e363c69..04727d2 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 _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xacf4,0xe7));var _0x4acf=function(_0x31f806,_0x35fd82){_0x31f806=_0x31f806-0x0;var _0x3afcf9=_0xacf4[_0x31f806];return _0x3afcf9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['MailQueueReport'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['MailQueueReport']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file +var _0x7b84=['sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','merge','VIRTUAL','filter','MailQueueReport','includeAll','findAll','rows','catch','show','params','include','options','create','body','update','find','describe','eml-format','rimraf','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x14ca9d,_0x26ae69){var _0x358742=function(_0x40807f){while(--_0x40807f){_0x14ca9d['push'](_0x14ca9d['shift']());}};_0x358742(++_0x26ae69);}(_0x7b84,0x17c));var _0x47b8=function(_0x42b4f4,_0x1f2042){_0x42b4f4=_0x42b4f4-0x0;var _0x3eeb2f=_0x7b84[_0x42b4f4];return _0x3eeb2f;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require(_0x47b8('0x3'));var rp=require(_0x47b8('0x4'));var moment=require(_0x47b8('0x5'));var BPromise=require(_0x47b8('0x6'));var Mustache=require('mustache');var util=require(_0x47b8('0x7'));var path=require(_0x47b8('0x8'));var sox=require(_0x47b8('0x9'));var csv=require(_0x47b8('0xa'));var ejs=require(_0x47b8('0xb'));var fs=require('fs');var fs_extra=require(_0x47b8('0xc'));var _=require('lodash');var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0xa'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require(_0x47b8('0x15'));var as=require(_0x47b8('0x16'));var hardwareService=require(_0x47b8('0x17'));var logger=require(_0x47b8('0x18'))(_0x47b8('0x19'));var utils=require(_0x47b8('0x1a'));var config=require(_0x47b8('0x1b'));var licenseUtil=require(_0x47b8('0x1c'));var db=require(_0x47b8('0x1d'))['db'];function respondWithStatusCode(_0x25a224,_0x289ac7){_0x289ac7=_0x289ac7||0xcc;return function(_0x1edb4b){if(_0x1edb4b){return _0x25a224[_0x47b8('0x1e')](_0x289ac7);}return _0x25a224[_0x47b8('0x1f')](_0x289ac7)[_0x47b8('0x20')]();};}function respondWithResult(_0x173015,_0x223121){_0x223121=_0x223121||0xc8;return function(_0xf66dd6){if(_0xf66dd6){return _0x173015['status'](_0x223121)[_0x47b8('0x21')](_0xf66dd6);}};}function respondWithFilteredResult(_0x340da0,_0x3e760a){return function(_0x1217a4){if(_0x1217a4){var _0x34d5a5=typeof _0x3e760a[_0x47b8('0x22')]===_0x47b8('0x23')&&typeof _0x3e760a['limit']===_0x47b8('0x23');var _0x5c2b2c=_0x1217a4['count'];var _0x4f7317=_0x34d5a5?0x0:_0x3e760a[_0x47b8('0x22')];var _0x36faf1=_0x34d5a5?_0x1217a4[_0x47b8('0x24')]:_0x3e760a['offset']+_0x3e760a['limit'];var _0x4f6716;if(_0x36faf1>=_0x5c2b2c){_0x36faf1=_0x5c2b2c;_0x4f6716=0xc8;}else{_0x4f6716=0xce;}_0x340da0[_0x47b8('0x1f')](_0x4f6716);return _0x340da0['set'](_0x47b8('0x25'),_0x4f7317+'-'+_0x36faf1+'/'+_0x5c2b2c)[_0x47b8('0x21')](_0x1217a4);}return null;};}function patchUpdates(_0x303f19){return function(_0xfccf56){try{jsonpatch['apply'](_0xfccf56,_0x303f19,!![]);}catch(_0xc20df1){return BPromise[_0x47b8('0x26')](_0xc20df1);}return _0xfccf56[_0x47b8('0x27')]();};}function saveUpdates(_0x2f75d2,_0x168cde){return function(_0x232708){if(_0x232708){return _0x232708['update'](_0x2f75d2)[_0x47b8('0x28')](function(_0x2a22e3){return _0x2a22e3;});}return null;};}function removeEntity(_0x5301f8,_0x22e7dd){return function(_0x247429){if(_0x247429){return _0x247429[_0x47b8('0x29')]()[_0x47b8('0x28')](function(){_0x5301f8['status'](0xcc)[_0x47b8('0x20')]();});}};}function handleEntityNotFound(_0x332c23,_0x319d17){return function(_0x3e3de0){if(!_0x3e3de0){_0x332c23[_0x47b8('0x1e')](0x194);}return _0x3e3de0;};}function handleError(_0xbf5ce9,_0x40918f){_0x40918f=_0x40918f||0x1f4;return function(_0x568c1e){logger[_0x47b8('0x2a')](_0x568c1e[_0x47b8('0x2b')]);if(_0x568c1e['name']){delete _0x568c1e[_0x47b8('0x2c')];}_0xbf5ce9[_0x47b8('0x1f')](_0x40918f)[_0x47b8('0x2d')](_0x568c1e);};}exports[_0x47b8('0x2e')]=function(_0x4da0e0,_0x162d96){var _0x5c347f={},_0x2c89fc={},_0x2255ab={'count':0x0,'rows':[]};var _0x33e653=_[_0x47b8('0x2f')](db['MailQueueReport'][_0x47b8('0x30')],function(_0x264dd9){return{'name':_0x264dd9[_0x47b8('0x31')],'type':_0x264dd9[_0x47b8('0x32')][_0x47b8('0x33')]};});_0x2c89fc[_0x47b8('0x34')]=_['map'](_0x33e653,'name');_0x2c89fc['query']=_[_0x47b8('0x35')](_0x4da0e0[_0x47b8('0x36')]);_0x2c89fc[_0x47b8('0x37')]=_['intersection'](_0x2c89fc['model'],_0x2c89fc['query']);_0x5c347f['attributes']=_[_0x47b8('0x38')](_0x2c89fc[_0x47b8('0x34')],qs[_0x47b8('0x39')](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x39')]));_0x5c347f[_0x47b8('0x3a')]=_0x5c347f[_0x47b8('0x3a')][_0x47b8('0x3b')]?_0x5c347f[_0x47b8('0x3a')]:_0x2c89fc['model'];if(!_0x4da0e0['query'][_0x47b8('0x3c')](_0x47b8('0x3d'))){_0x5c347f['limit']=qs['limit'](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x3e')]);_0x5c347f[_0x47b8('0x22')]=qs['offset'](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x22')]);}_0x5c347f['order']=qs['sort'](_0x4da0e0['query']['sort']);_0x5c347f[_0x47b8('0x3f')]=qs[_0x47b8('0x37')](_[_0x47b8('0x40')](_0x4da0e0[_0x47b8('0x36')],_0x2c89fc[_0x47b8('0x37')]),_0x33e653);if(_0x4da0e0[_0x47b8('0x36')]['filter']){_0x5c347f['where']=_[_0x47b8('0x41')](_0x5c347f[_0x47b8('0x3f')],{'$or':_[_0x47b8('0x2f')](_0x33e653,function(_0x4a9ed6){if(_0x4a9ed6['type']!==_0x47b8('0x42')){var _0x2c89bc={};_0x2c89bc[_0x4a9ed6['name']]={'$like':'%'+_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x43')]+'%'};return _0x2c89bc;}})});}_0x5c347f=_['merge']({},_0x5c347f,_0x4da0e0['options']);var _0x493b69={'where':_0x5c347f['where']};return db[_0x47b8('0x44')][_0x47b8('0x24')](_0x493b69)[_0x47b8('0x28')](function(_0x28cf2c){_0x2255ab[_0x47b8('0x24')]=_0x28cf2c;if(_0x4da0e0['query'][_0x47b8('0x45')]){_0x5c347f['include']=[{'all':!![]}];}return db[_0x47b8('0x44')][_0x47b8('0x46')](_0x5c347f);})[_0x47b8('0x28')](function(_0x5bede8){_0x2255ab[_0x47b8('0x47')]=_0x5bede8;return _0x2255ab;})[_0x47b8('0x28')](respondWithFilteredResult(_0x162d96,_0x5c347f))[_0x47b8('0x48')](handleError(_0x162d96,null));};exports[_0x47b8('0x49')]=function(_0x3eaf01,_0x15b9a1){var _0x2d2971={'raw':!![],'where':{'id':_0x3eaf01[_0x47b8('0x4a')]['id']}},_0x569d29={};_0x569d29['model']=_[_0x47b8('0x35')](db[_0x47b8('0x44')][_0x47b8('0x30')]);_0x569d29[_0x47b8('0x36')]=_[_0x47b8('0x35')](_0x3eaf01[_0x47b8('0x36')]);_0x569d29['filters']=_['intersection'](_0x569d29[_0x47b8('0x34')],_0x569d29[_0x47b8('0x36')]);_0x2d2971[_0x47b8('0x3a')]=_['intersection'](_0x569d29[_0x47b8('0x34')],qs['fields'](_0x3eaf01[_0x47b8('0x36')][_0x47b8('0x39')]));_0x2d2971[_0x47b8('0x3a')]=_0x2d2971[_0x47b8('0x3a')][_0x47b8('0x3b')]?_0x2d2971['attributes']:_0x569d29[_0x47b8('0x34')];if(_0x3eaf01[_0x47b8('0x36')][_0x47b8('0x45')]){_0x2d2971[_0x47b8('0x4b')]=[{'all':!![]}];}_0x2d2971=_[_0x47b8('0x41')]({},_0x2d2971,_0x3eaf01[_0x47b8('0x4c')]);return db[_0x47b8('0x44')]['find'](_0x2d2971)[_0x47b8('0x28')](handleEntityNotFound(_0x15b9a1,null))['then'](respondWithResult(_0x15b9a1,null))[_0x47b8('0x48')](handleError(_0x15b9a1,null));};exports[_0x47b8('0x4d')]=function(_0x4a46eb,_0x132e9a){return db[_0x47b8('0x44')][_0x47b8('0x4d')](_0x4a46eb[_0x47b8('0x4e')],{})[_0x47b8('0x28')](respondWithResult(_0x132e9a,0xc9))[_0x47b8('0x48')](handleError(_0x132e9a,null));};exports[_0x47b8('0x4f')]=function(_0x381d3a,_0x4ad8a8){if(_0x381d3a[_0x47b8('0x4e')]['id']){delete _0x381d3a[_0x47b8('0x4e')]['id'];}return db[_0x47b8('0x44')]['find']({'where':{'id':_0x381d3a[_0x47b8('0x4a')]['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x4ad8a8,null))[_0x47b8('0x28')](saveUpdates(_0x381d3a[_0x47b8('0x4e')],null))['then'](respondWithResult(_0x4ad8a8,null))[_0x47b8('0x48')](handleError(_0x4ad8a8,null));};exports[_0x47b8('0x29')]=function(_0x51ac62,_0x270054){return db[_0x47b8('0x44')][_0x47b8('0x50')]({'where':{'id':_0x51ac62['params']['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x270054,null))['then'](removeEntity(_0x270054,null))[_0x47b8('0x48')](handleError(_0x270054,null));};exports['describe']=function(_0x2a03c2,_0x498512){return db[_0x47b8('0x44')][_0x47b8('0x51')]()[_0x47b8('0x28')](respondWithResult(_0x498512,null))[_0x47b8('0x48')](handleError(_0x498512,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index f31e2cc..ef86400 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 _0x7c24=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7c24,0xf9));var _0x47c2=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7c24[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x47c2('0x0'));var util=require(_0x47c2('0x1'));var logger=require(_0x47c2('0x2'))(_0x47c2('0x3'));var moment=require(_0x47c2('0x4'));var BPromise=require(_0x47c2('0x5'));var rp=require(_0x47c2('0x6'));var fs=require('fs');var path=require(_0x47c2('0x7'));var rimraf=require(_0x47c2('0x8'));var config=require(_0x47c2('0x9'));var attributes=require(_0x47c2('0xa'));module[_0x47c2('0xb')]=function(_0x453740,_0x2369cf){return _0x453740['define'](_0x47c2('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x47c2('0xd'),'fields':[_0x47c2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c17=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x5c17,0x1ba));var _0x75c1=function(_0x5e26e9,_0x467282){_0x5e26e9=_0x5e26e9-0x0;var _0x5c3807=_0x5c17[_0x5e26e9];return _0x5c3807;};'use strict';var _=require(_0x75c1('0x0'));var util=require(_0x75c1('0x1'));var logger=require('../../config/logger')(_0x75c1('0x2'));var moment=require(_0x75c1('0x3'));var BPromise=require('bluebird');var rp=require(_0x75c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75c1('0x5'));var config=require(_0x75c1('0x6'));var attributes=require(_0x75c1('0x7'));module[_0x75c1('0x8')]=function(_0x3158f7,_0x78d22){return _0x3158f7[_0x75c1('0x9')](_0x75c1('0xa'),attributes,{'tableName':_0x75c1('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x75c1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3eab001..c264c05 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x274e0e,_0x3aace4){var _0x4ca356=function(_0x59e7a3){while(--_0x59e7a3){_0x274e0e['push'](_0x274e0e['shift']());}};_0x4ca356(++_0x3aace4);}(_0x2ef3,0xba));var _0x32ef=function(_0x535965,_0x27cd69){_0x535965=_0x535965-0x0;var _0x12020d=_0x2ef3[_0x535965];return _0x12020d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x386e42,_0x229c59){var _0x37c93b=function(_0x24fc67){while(--_0x24fc67){_0x386e42['push'](_0x386e42['shift']());}};_0x37c93b(++_0x229c59);}(_0x1261,0x144));var _0x1126=function(_0x16d991,_0x3f07cc){_0x16d991=_0x16d991-0x0;var _0x4f41c3=_0x1261[_0x16d991];return _0x4f41c3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 274faa0..4fe39cf 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x35d26a,_0x47172f){var _0x373504=function(_0x23cbb4){while(--_0x23cbb4){_0x35d26a['push'](_0x35d26a['shift']());}};_0x373504(++_0x47172f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xcb91[_0x4bd950];return _0x5dc59a;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1ace72,_0x274a09){var _0x38e16e=function(_0x4c31e6){while(--_0x4c31e6){_0x1ace72['push'](_0x1ace72['shift']());}};_0x38e16e(++_0x274a09);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index dc6cb1d..13cff8b 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 _0x24cf=['INTEGER','STRING','BOOLEAN','INBOX'];(function(_0x560232,_0x3d3008){var _0x478ab6=function(_0x20e131){while(--_0x20e131){_0x560232['push'](_0x560232['shift']());}};_0x478ab6(++_0x3d3008);}(_0x24cf,0x1d5));var _0xf24c=function(_0x5b8040,_0x16d9ee){_0x5b8040=_0x5b8040-0x0;var _0x5b7210=_0x24cf[_0x5b8040];return _0x5b7210;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xf24c('0x0')]},'host':{'type':Sequelize[_0xf24c('0x0')]},'authentication':{'type':Sequelize[_0xf24c('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf24c('0x0')]},'password':{'type':Sequelize[_0xf24c('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xf24c('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf24c('0x0')],'defaultValue':_0xf24c('0x2')},'connTimeout':{'type':Sequelize[_0xf24c('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa75b=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0xa75b,0x170));var _0xba75=function(_0x2fdb0f,_0x38204b){_0x2fdb0f=_0x2fdb0f-0x0;var _0x272eef=_0xa75b[_0x2fdb0f];return _0x272eef;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xba75('0x1')]},'authentication':{'type':Sequelize[_0xba75('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xba75('0x1')]},'password':{'type':Sequelize[_0xba75('0x1')]},'port':{'type':Sequelize[_0xba75('0x3')]},'tls':{'type':Sequelize[_0xba75('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x4')},'connTimeout':{'type':Sequelize[_0xba75('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xba75('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7e87f02..5438432 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 _0x3df8=['./mailServerIn.attributes','exports','define','MailServerIn','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3df8,0x1a6));var _0x83df=function(_0x319fc1,_0x29179b){_0x319fc1=_0x319fc1-0x0;var _0xb768af=_0x3df8[_0x319fc1];return _0xb768af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x83df('0x0'))(_0x83df('0x1'));var moment=require('moment');var BPromise=require(_0x83df('0x2'));var rp=require(_0x83df('0x3'));var fs=require('fs');var path=require(_0x83df('0x4'));var rimraf=require(_0x83df('0x5'));var config=require(_0x83df('0x6'));var attributes=require(_0x83df('0x7'));module[_0x83df('0x8')]=function(_0x254114,_0x14c7df){return _0x254114[_0x83df('0x9')](_0x83df('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0863=['api','moment','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util'];(function(_0x46ff43,_0x231145){var _0x1a6fb9=function(_0x2c0406){while(--_0x2c0406){_0x46ff43['push'](_0x46ff43['shift']());}};_0x1a6fb9(++_0x231145);}(_0x0863,0xa8));var _0x3086=function(_0x380a86,_0x3d96ed){_0x380a86=_0x380a86-0x0;var _0x1baa04=_0x0863[_0x380a86];return _0x1baa04;};'use strict';var _=require(_0x3086('0x0'));var util=require(_0x3086('0x1'));var logger=require('../../config/logger')(_0x3086('0x2'));var moment=require(_0x3086('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3086('0x4'));var config=require(_0x3086('0x5'));var attributes=require(_0x3086('0x6'));module[_0x3086('0x7')]=function(_0x1db72a,_0x1874d3){return _0x1db72a[_0x3086('0x8')](_0x3086('0x9'),attributes,{'tableName':'mail_servers_in','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 3046b0d..c647008 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 _0x3cb3=['model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include','map'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x3cb3,0x156));var _0x33cb=function(_0xba5e8b,_0x16ef1e){_0xba5e8b=_0xba5e8b-0x0;var _0x2b029c=_0x3cb3[_0xba5e8b];return _0x2b029c;};'use strict';var _=require(_0x33cb('0x0'));var util=require(_0x33cb('0x1'));var moment=require(_0x33cb('0x2'));var BPromise=require(_0x33cb('0x3'));var rs=require(_0x33cb('0x4'));var fs=require('fs');var Redis=require(_0x33cb('0x5'));var db=require(_0x33cb('0x6'))['db'];var utils=require(_0x33cb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x33cb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x33cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31cdb1,_0x51cb1a,_0x29d263){return new BPromise(function(_0x561f30,_0x181b1d){return client[_0x33cb('0xa')](_0x31cdb1,_0x29d263)[_0x33cb('0xb')](function(_0x54c48c){logger[_0x33cb('0xc')](_0x33cb('0xd'),_0x51cb1a,'request\x20sent');logger[_0x33cb('0xe')](_0x33cb('0xf'),_0x51cb1a,_0x33cb('0x10'),JSON[_0x33cb('0x11')](_0x54c48c));if(_0x54c48c[_0x33cb('0x12')]){if(_0x54c48c[_0x33cb('0x12')]['code']===0x1f4){logger[_0x33cb('0x12')](_0x33cb('0xd'),_0x51cb1a,_0x54c48c[_0x33cb('0x12')]['message']);return _0x181b1d(_0x54c48c[_0x33cb('0x12')][_0x33cb('0x13')]);}logger[_0x33cb('0x12')]('MailServerIn,\x20%s,\x20%s',_0x51cb1a,_0x54c48c[_0x33cb('0x12')]['message']);return _0x561f30(_0x54c48c[_0x33cb('0x12')]['message']);}else{logger[_0x33cb('0xc')]('MailServerIn,\x20%s,\x20%s',_0x51cb1a,'request\x20sent');_0x561f30(_0x54c48c[_0x33cb('0x14')][_0x33cb('0x13')]);}})[_0x33cb('0x15')](function(_0xf43ddb){logger[_0x33cb('0x12')](_0x33cb('0xd'),_0x51cb1a,_0xf43ddb);_0x181b1d(_0xf43ddb);});});}exports[_0x33cb('0x16')]=function(_0x1bdceb){var _0x3f19a6=this;return new Promise(function(_0x32ae00,_0x348466){return db[_0x33cb('0x17')][_0x33cb('0x18')]({'raw':_0x1bdceb[_0x33cb('0x19')]?_0x1bdceb[_0x33cb('0x19')][_0x33cb('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bdceb['options']?_0x1bdceb[_0x33cb('0x19')]['where']||null:null,'attributes':_0x1bdceb[_0x33cb('0x19')]?_0x1bdceb[_0x33cb('0x19')][_0x33cb('0x1b')]||null:null,'limit':_0x1bdceb[_0x33cb('0x19')]?_0x1bdceb[_0x33cb('0x19')]['limit']||null:null,'include':_0x1bdceb[_0x33cb('0x19')]?_0x1bdceb['options'][_0x33cb('0x1c')]?_[_0x33cb('0x1d')](_0x1bdceb['options'][_0x33cb('0x1c')],function(_0x29f8a2){return{'model':db[_0x29f8a2[_0x33cb('0x1e')]],'as':_0x29f8a2['as'],'attributes':_0x29f8a2[_0x33cb('0x1b')],'include':_0x29f8a2[_0x33cb('0x1c')]?_[_0x33cb('0x1d')](_0x29f8a2[_0x33cb('0x1c')],function(_0x27cbc3){return{'model':db[_0x27cbc3[_0x33cb('0x1e')]],'as':_0x27cbc3['as'],'attributes':_0x27cbc3[_0x33cb('0x1b')],'include':_0x27cbc3[_0x33cb('0x1c')]?_[_0x33cb('0x1d')](_0x27cbc3['include'],function(_0xbdd1df){return{'model':db[_0xbdd1df['model']],'as':_0xbdd1df['as'],'attributes':_0xbdd1df[_0x33cb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x33cb('0xb')](function(_0x43a186){logger[_0x33cb('0xc')](_0x33cb('0x16'),_0x1bdceb);logger[_0x33cb('0xe')](_0x33cb('0x16'),_0x1bdceb,JSON[_0x33cb('0x11')](_0x43a186));_0x32ae00(_0x43a186);})[_0x33cb('0x15')](function(_0x7f8dd){logger['error'](_0x33cb('0x16'),_0x7f8dd['message'],_0x1bdceb);_0x348466(_0x3f19a6['error'](0x1f4,_0x7f8dd[_0x33cb('0x13')]));});});}; \ No newline at end of file +var _0x16f9=['findAll','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x16f9,0xae));var _0x916f=function(_0x4183e7,_0x3634d5){_0x4183e7=_0x4183e7-0x0;var _0x41073d=_0x16f9[_0x4183e7];return _0x41073d;};'use strict';var _=require(_0x916f('0x0'));var util=require(_0x916f('0x1'));var moment=require(_0x916f('0x2'));var BPromise=require(_0x916f('0x3'));var rs=require(_0x916f('0x4'));var fs=require('fs');var Redis=require(_0x916f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x916f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x916f('0x7'));var client=jayson[_0x916f('0x8')][_0x916f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x356257,_0x36dbe5,_0x188bac){return new BPromise(function(_0x5d80fb,_0x5a9572){return client[_0x916f('0xa')](_0x356257,_0x188bac)[_0x916f('0xb')](function(_0x1431ec){logger[_0x916f('0xc')](_0x916f('0xd'),_0x36dbe5,_0x916f('0xe'));logger[_0x916f('0xf')](_0x916f('0x10'),_0x36dbe5,_0x916f('0xe'),JSON[_0x916f('0x11')](_0x1431ec));if(_0x1431ec['error']){if(_0x1431ec[_0x916f('0x12')][_0x916f('0x13')]===0x1f4){logger[_0x916f('0x12')](_0x916f('0xd'),_0x36dbe5,_0x1431ec[_0x916f('0x12')][_0x916f('0x14')]);return _0x5a9572(_0x1431ec[_0x916f('0x12')][_0x916f('0x14')]);}logger['error'](_0x916f('0xd'),_0x36dbe5,_0x1431ec[_0x916f('0x12')][_0x916f('0x14')]);return _0x5d80fb(_0x1431ec[_0x916f('0x12')]['message']);}else{logger[_0x916f('0xc')](_0x916f('0xd'),_0x36dbe5,_0x916f('0xe'));_0x5d80fb(_0x1431ec[_0x916f('0x15')][_0x916f('0x14')]);}})['catch'](function(_0x2ae386){logger[_0x916f('0x12')](_0x916f('0xd'),_0x36dbe5,_0x2ae386);_0x5a9572(_0x2ae386);});});}exports[_0x916f('0x16')]=function(_0x3d547e){var _0x27716a=this;return new Promise(function(_0x545d09,_0x456c54){return db[_0x916f('0x17')][_0x916f('0x18')]({'raw':_0x3d547e[_0x916f('0x19')]?_0x3d547e[_0x916f('0x19')][_0x916f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d547e[_0x916f('0x19')]?_0x3d547e['options'][_0x916f('0x1b')]||null:null,'attributes':_0x3d547e[_0x916f('0x19')]?_0x3d547e[_0x916f('0x19')][_0x916f('0x1c')]||null:null,'limit':_0x3d547e[_0x916f('0x19')]?_0x3d547e['options']['limit']||null:null,'include':_0x3d547e[_0x916f('0x19')]?_0x3d547e[_0x916f('0x19')][_0x916f('0x1d')]?_[_0x916f('0x1e')](_0x3d547e[_0x916f('0x19')][_0x916f('0x1d')],function(_0x52d7ae){return{'model':db[_0x52d7ae['model']],'as':_0x52d7ae['as'],'attributes':_0x52d7ae[_0x916f('0x1c')],'include':_0x52d7ae[_0x916f('0x1d')]?_['map'](_0x52d7ae[_0x916f('0x1d')],function(_0x53982e){return{'model':db[_0x53982e[_0x916f('0x1f')]],'as':_0x53982e['as'],'attributes':_0x53982e[_0x916f('0x1c')],'include':_0x53982e[_0x916f('0x1d')]?_[_0x916f('0x1e')](_0x53982e[_0x916f('0x1d')],function(_0x33c25d){return{'model':db[_0x33c25d[_0x916f('0x1f')]],'as':_0x33c25d['as'],'attributes':_0x33c25d[_0x916f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e03ec){logger[_0x916f('0xc')](_0x916f('0x16'),_0x3d547e);logger[_0x916f('0xf')](_0x916f('0x16'),_0x3d547e,JSON[_0x916f('0x11')](_0x1e03ec));_0x545d09(_0x1e03ec);})[_0x916f('0x20')](function(_0x46fd3c){logger[_0x916f('0x12')]('GetMailServerIn',_0x46fd3c[_0x916f('0x14')],_0x3d547e);_0x456c54(_0x27716a['error'](0x1f4,_0x46fd3c[_0x916f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ad2efe6..515069c 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7a54,0x106));var _0x47a5=function(_0x216bb6,_0x3eec85){_0x216bb6=_0x216bb6-0x0;var _0x1543a3=_0x7a54[_0x216bb6];return _0x1543a3;};'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 bcd122c..fafacb6 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 _0x99a7=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x270ecb,_0x1a163f){var _0x2346c5=function(_0x4106fc){while(--_0x4106fc){_0x270ecb['push'](_0x270ecb['shift']());}};_0x2346c5(++_0x1a163f);}(_0x99a7,0x19b));var _0x799a=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x99a7[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require('sequelize');module[_0x799a('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x799a('0x1')]},'pass':{'type':Sequelize[_0x799a('0x1')]},'port':{'type':Sequelize[_0x799a('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x799a('0x1')]},'authentication':{'type':Sequelize[_0x799a('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7809=['STRING','INTEGER','exports'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0x7809,0xe3));var _0x9780=function(_0x177f53,_0xe6234c){_0x177f53=_0x177f53-0x0;var _0x148e9e=_0x7809[_0x177f53];return _0x148e9e;};'use strict';var Sequelize=require('sequelize');module[_0x9780('0x0')]={'description':{'type':Sequelize[_0x9780('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x9780('0x1')]},'pass':{'type':Sequelize[_0x9780('0x1')]},'port':{'type':Sequelize[_0x9780('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index a015655..1e968e0 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 _0x3050=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailServerOut','includeAll','include','findAll','rows','catch','show','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x3050,0x16e));var _0x0305=function(_0x27aaff,_0x22a4ad){_0x27aaff=_0x27aaff-0x0;var _0x49d48a=_0x3050[_0x27aaff];return _0x49d48a;};'use strict';var emlformat=require(_0x0305('0x0'));var rimraf=require(_0x0305('0x1'));var zipdir=require(_0x0305('0x2'));var jsonpatch=require(_0x0305('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0305('0x4'));var Mustache=require('mustache');var util=require(_0x0305('0x5'));var path=require(_0x0305('0x6'));var sox=require(_0x0305('0x7'));var csv=require(_0x0305('0x8'));var ejs=require(_0x0305('0x9'));var fs=require('fs');var fs_extra=require(_0x0305('0xa'));var _=require(_0x0305('0xb'));var squel=require(_0x0305('0xc'));var crypto=require(_0x0305('0xd'));var jsforce=require(_0x0305('0xe'));var deskjs=require(_0x0305('0xf'));var toCsv=require(_0x0305('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0305('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0305('0x11'));var as=require(_0x0305('0x12'));var hardwareService=require(_0x0305('0x13'));var logger=require('../../config/logger')(_0x0305('0x14'));var utils=require(_0x0305('0x15'));var config=require(_0x0305('0x16'));var licenseUtil=require(_0x0305('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x133623,_0x13406b){_0x13406b=_0x13406b||0xcc;return function(_0x2b7050){if(_0x2b7050){return _0x133623[_0x0305('0x18')](_0x13406b);}return _0x133623[_0x0305('0x19')](_0x13406b)['end']();};}function respondWithResult(_0x417fd7,_0xb15566){_0xb15566=_0xb15566||0xc8;return function(_0x468356){if(_0x468356){return _0x417fd7['status'](_0xb15566)[_0x0305('0x1a')](_0x468356);}};}function respondWithFilteredResult(_0x2da9b7,_0x22624e){return function(_0x497949){if(_0x497949){var _0x2fe5e8=typeof _0x22624e[_0x0305('0x1b')]===_0x0305('0x1c')&&typeof _0x22624e[_0x0305('0x1d')]===_0x0305('0x1c');var _0x493f89=_0x497949[_0x0305('0x1e')];var _0x2582fa=_0x2fe5e8?0x0:_0x22624e[_0x0305('0x1b')];var _0x4dff28=_0x2fe5e8?_0x497949[_0x0305('0x1e')]:_0x22624e[_0x0305('0x1b')]+_0x22624e[_0x0305('0x1d')];var _0x302930;if(_0x4dff28>=_0x493f89){_0x4dff28=_0x493f89;_0x302930=0xc8;}else{_0x302930=0xce;}_0x2da9b7['status'](_0x302930);return _0x2da9b7['set'](_0x0305('0x1f'),_0x2582fa+'-'+_0x4dff28+'/'+_0x493f89)[_0x0305('0x1a')](_0x497949);}return null;};}function patchUpdates(_0x2bce49){return function(_0x23c651){try{jsonpatch[_0x0305('0x20')](_0x23c651,_0x2bce49,!![]);}catch(_0x392fef){return BPromise[_0x0305('0x21')](_0x392fef);}return _0x23c651[_0x0305('0x22')]();};}function saveUpdates(_0x348612,_0x4dc3bf){return function(_0x8509f6){if(_0x8509f6){return _0x8509f6[_0x0305('0x23')](_0x348612)[_0x0305('0x24')](function(_0x3e5315){return _0x3e5315;});}return null;};}function removeEntity(_0x269fa6,_0xfea2e0){return function(_0x4836c9){if(_0x4836c9){return _0x4836c9['destroy']()[_0x0305('0x24')](function(){_0x269fa6[_0x0305('0x19')](0xcc)[_0x0305('0x25')]();});}};}function handleEntityNotFound(_0x2a2824,_0x341913){return function(_0x3a09b2){if(!_0x3a09b2){_0x2a2824[_0x0305('0x18')](0x194);}return _0x3a09b2;};}function handleError(_0x1ca8f1,_0x1da21c){_0x1da21c=_0x1da21c||0x1f4;return function(_0x3a6672){logger[_0x0305('0x26')](_0x3a6672[_0x0305('0x27')]);if(_0x3a6672[_0x0305('0x28')]){delete _0x3a6672[_0x0305('0x28')];}_0x1ca8f1['status'](_0x1da21c)[_0x0305('0x29')](_0x3a6672);};}exports[_0x0305('0x2a')]=function(_0x19aff4,_0x11c92c){var _0x4ee016={},_0x2cb4b9={},_0x683f32={'count':0x0,'rows':[]};var _0x1c567d=_[_0x0305('0x2b')](db['MailServerOut'][_0x0305('0x2c')],function(_0x3bb413){return{'name':_0x3bb413['fieldName'],'type':_0x3bb413[_0x0305('0x2d')][_0x0305('0x2e')]};});_0x2cb4b9[_0x0305('0x2f')]=_[_0x0305('0x2b')](_0x1c567d,_0x0305('0x28'));_0x2cb4b9[_0x0305('0x30')]=_[_0x0305('0x31')](_0x19aff4['query']);_0x2cb4b9[_0x0305('0x32')]=_[_0x0305('0x33')](_0x2cb4b9[_0x0305('0x2f')],_0x2cb4b9[_0x0305('0x30')]);_0x4ee016[_0x0305('0x34')]=_['intersection'](_0x2cb4b9[_0x0305('0x2f')],qs[_0x0305('0x35')](_0x19aff4[_0x0305('0x30')]['fields']));_0x4ee016[_0x0305('0x34')]=_0x4ee016['attributes'][_0x0305('0x36')]?_0x4ee016[_0x0305('0x34')]:_0x2cb4b9[_0x0305('0x2f')];if(!_0x19aff4[_0x0305('0x30')][_0x0305('0x37')](_0x0305('0x38'))){_0x4ee016[_0x0305('0x1d')]=qs['limit'](_0x19aff4['query'][_0x0305('0x1d')]);_0x4ee016[_0x0305('0x1b')]=qs[_0x0305('0x1b')](_0x19aff4[_0x0305('0x30')][_0x0305('0x1b')]);}_0x4ee016[_0x0305('0x39')]=qs[_0x0305('0x3a')](_0x19aff4[_0x0305('0x30')][_0x0305('0x3a')]);_0x4ee016[_0x0305('0x3b')]=qs[_0x0305('0x32')](_['pick'](_0x19aff4[_0x0305('0x30')],_0x2cb4b9[_0x0305('0x32')]),_0x1c567d);if(_0x19aff4['query'][_0x0305('0x3c')]){_0x4ee016[_0x0305('0x3b')]=_[_0x0305('0x3d')](_0x4ee016[_0x0305('0x3b')],{'$or':_['map'](_0x1c567d,function(_0x546eb6){if(_0x546eb6[_0x0305('0x2d')]!==_0x0305('0x3e')){var _0xba56f9={};_0xba56f9[_0x546eb6[_0x0305('0x28')]]={'$like':'%'+_0x19aff4[_0x0305('0x30')][_0x0305('0x3c')]+'%'};return _0xba56f9;}})});}_0x4ee016=_[_0x0305('0x3d')]({},_0x4ee016,_0x19aff4[_0x0305('0x3f')]);var _0x2e479d={'where':_0x4ee016[_0x0305('0x3b')]};return db[_0x0305('0x40')][_0x0305('0x1e')](_0x2e479d)['then'](function(_0x5ceef6){_0x683f32['count']=_0x5ceef6;if(_0x19aff4[_0x0305('0x30')][_0x0305('0x41')]){_0x4ee016[_0x0305('0x42')]=[{'all':!![]}];}return db[_0x0305('0x40')][_0x0305('0x43')](_0x4ee016);})[_0x0305('0x24')](function(_0x3d9afc){_0x683f32[_0x0305('0x44')]=_0x3d9afc;return _0x683f32;})[_0x0305('0x24')](respondWithFilteredResult(_0x11c92c,_0x4ee016))[_0x0305('0x45')](handleError(_0x11c92c,null));};exports[_0x0305('0x46')]=function(_0x5b4ee7,_0x1421ee){var _0x34c585={'raw':!![],'where':{'id':_0x5b4ee7['params']['id']}},_0xf24507={};_0xf24507[_0x0305('0x2f')]=_[_0x0305('0x31')](db['MailServerOut'][_0x0305('0x2c')]);_0xf24507['query']=_[_0x0305('0x31')](_0x5b4ee7['query']);_0xf24507[_0x0305('0x32')]=_['intersection'](_0xf24507[_0x0305('0x2f')],_0xf24507[_0x0305('0x30')]);_0x34c585['attributes']=_['intersection'](_0xf24507[_0x0305('0x2f')],qs['fields'](_0x5b4ee7[_0x0305('0x30')]['fields']));_0x34c585['attributes']=_0x34c585['attributes'][_0x0305('0x36')]?_0x34c585[_0x0305('0x34')]:_0xf24507['model'];if(_0x5b4ee7[_0x0305('0x30')][_0x0305('0x41')]){_0x34c585['include']=[{'all':!![]}];}_0x34c585=_[_0x0305('0x3d')]({},_0x34c585,_0x5b4ee7['options']);return db[_0x0305('0x40')]['find'](_0x34c585)[_0x0305('0x24')](handleEntityNotFound(_0x1421ee,null))['then'](respondWithResult(_0x1421ee,null))['catch'](handleError(_0x1421ee,null));};exports[_0x0305('0x47')]=function(_0x4aab5e,_0x137963){return db[_0x0305('0x40')][_0x0305('0x47')](_0x4aab5e[_0x0305('0x48')],{})[_0x0305('0x24')](respondWithResult(_0x137963,0xc9))[_0x0305('0x45')](handleError(_0x137963,null));};exports[_0x0305('0x23')]=function(_0x589ea6,_0x2d17c4){if(_0x589ea6[_0x0305('0x48')]['id']){delete _0x589ea6[_0x0305('0x48')]['id'];}return db[_0x0305('0x40')][_0x0305('0x49')]({'where':{'id':_0x589ea6[_0x0305('0x4a')]['id']}})[_0x0305('0x24')](handleEntityNotFound(_0x2d17c4,null))[_0x0305('0x24')](saveUpdates(_0x589ea6[_0x0305('0x48')],null))[_0x0305('0x24')](respondWithResult(_0x2d17c4,null))[_0x0305('0x45')](handleError(_0x2d17c4,null));};exports[_0x0305('0x4b')]=function(_0x4d7162,_0x508a9e){return db['MailServerOut'][_0x0305('0x49')]({'where':{'id':_0x4d7162[_0x0305('0x4a')]['id']}})['then'](handleEntityNotFound(_0x508a9e,null))[_0x0305('0x24')](removeEntity(_0x508a9e,null))['catch'](handleError(_0x508a9e,null));}; \ No newline at end of file +var _0x9a0e=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','catch','params','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','then','destroy','end','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x1cf25b,_0x5dc789){var _0x1a687b=function(_0x25c283){while(--_0x25c283){_0x1cf25b['push'](_0x1cf25b['shift']());}};_0x1a687b(++_0x5dc789);}(_0x9a0e,0x178));var _0xe9a0=function(_0x528e07,_0x2426a7){_0x528e07=_0x528e07-0x0;var _0x4f4ba3=_0x9a0e[_0x528e07];return _0x4f4ba3;};'use strict';var emlformat=require(_0xe9a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9a0('0x2'));var moment=require(_0xe9a0('0x3'));var BPromise=require(_0xe9a0('0x4'));var Mustache=require('mustache');var util=require(_0xe9a0('0x5'));var path=require(_0xe9a0('0x6'));var sox=require(_0xe9a0('0x7'));var csv=require('to-csv');var ejs=require(_0xe9a0('0x8'));var fs=require('fs');var fs_extra=require(_0xe9a0('0x9'));var _=require(_0xe9a0('0xa'));var squel=require('squel');var crypto=require(_0xe9a0('0xb'));var jsforce=require(_0xe9a0('0xc'));var deskjs=require(_0xe9a0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe9a0('0xe'));var Papa=require(_0xe9a0('0xf'));var Redis=require('ioredis');var authService=require(_0xe9a0('0x10'));var qs=require(_0xe9a0('0x11'));var as=require(_0xe9a0('0x12'));var hardwareService=require(_0xe9a0('0x13'));var logger=require(_0xe9a0('0x14'))('api');var utils=require(_0xe9a0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe9a0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x877bcd,_0x2ffd77){_0x2ffd77=_0x2ffd77||0xcc;return function(_0x4dacad){if(_0x4dacad){return _0x877bcd[_0xe9a0('0x17')](_0x2ffd77);}return _0x877bcd[_0xe9a0('0x18')](_0x2ffd77)['end']();};}function respondWithResult(_0x1e0ef4,_0x8a29ba){_0x8a29ba=_0x8a29ba||0xc8;return function(_0x4c4992){if(_0x4c4992){return _0x1e0ef4[_0xe9a0('0x18')](_0x8a29ba)[_0xe9a0('0x19')](_0x4c4992);}};}function respondWithFilteredResult(_0x152425,_0x1580fe){return function(_0x41deac){if(_0x41deac){var _0x227e5a=typeof _0x1580fe[_0xe9a0('0x1a')]==='undefined'&&typeof _0x1580fe[_0xe9a0('0x1b')]===_0xe9a0('0x1c');var _0x485840=_0x41deac[_0xe9a0('0x1d')];var _0x5f19bd=_0x227e5a?0x0:_0x1580fe[_0xe9a0('0x1a')];var _0x4eb051=_0x227e5a?_0x41deac[_0xe9a0('0x1d')]:_0x1580fe['offset']+_0x1580fe[_0xe9a0('0x1b')];var _0x248452;if(_0x4eb051>=_0x485840){_0x4eb051=_0x485840;_0x248452=0xc8;}else{_0x248452=0xce;}_0x152425[_0xe9a0('0x18')](_0x248452);return _0x152425[_0xe9a0('0x1e')]('Content-Range',_0x5f19bd+'-'+_0x4eb051+'/'+_0x485840)[_0xe9a0('0x19')](_0x41deac);}return null;};}function patchUpdates(_0x382ee6){return function(_0x4c3ffc){try{jsonpatch[_0xe9a0('0x1f')](_0x4c3ffc,_0x382ee6,!![]);}catch(_0x3df232){return BPromise['reject'](_0x3df232);}return _0x4c3ffc[_0xe9a0('0x20')]();};}function saveUpdates(_0x21110b,_0x5332c4){return function(_0xd0d525){if(_0xd0d525){return _0xd0d525['update'](_0x21110b)[_0xe9a0('0x21')](function(_0x4fbda5){return _0x4fbda5;});}return null;};}function removeEntity(_0x4574ee,_0x162acc){return function(_0x2a358a){if(_0x2a358a){return _0x2a358a[_0xe9a0('0x22')]()[_0xe9a0('0x21')](function(){_0x4574ee[_0xe9a0('0x18')](0xcc)[_0xe9a0('0x23')]();});}};}function handleEntityNotFound(_0x63a569,_0x3004ef){return function(_0x3e1ae6){if(!_0x3e1ae6){_0x63a569[_0xe9a0('0x17')](0x194);}return _0x3e1ae6;};}function handleError(_0x35a232,_0x13e741){_0x13e741=_0x13e741||0x1f4;return function(_0x8dd71e){logger['error'](_0x8dd71e['stack']);if(_0x8dd71e['name']){delete _0x8dd71e[_0xe9a0('0x24')];}_0x35a232['status'](_0x13e741)[_0xe9a0('0x25')](_0x8dd71e);};}exports[_0xe9a0('0x26')]=function(_0x12c74e,_0x55f79a){var _0x5346cc={},_0x1e65c9={},_0x14d5b6={'count':0x0,'rows':[]};var _0x428c1d=_[_0xe9a0('0x27')](db[_0xe9a0('0x28')][_0xe9a0('0x29')],function(_0x16646b){return{'name':_0x16646b[_0xe9a0('0x2a')],'type':_0x16646b[_0xe9a0('0x2b')][_0xe9a0('0x2c')]};});_0x1e65c9[_0xe9a0('0x2d')]=_[_0xe9a0('0x27')](_0x428c1d,_0xe9a0('0x24'));_0x1e65c9['query']=_[_0xe9a0('0x2e')](_0x12c74e[_0xe9a0('0x2f')]);_0x1e65c9[_0xe9a0('0x30')]=_[_0xe9a0('0x31')](_0x1e65c9[_0xe9a0('0x2d')],_0x1e65c9[_0xe9a0('0x2f')]);_0x5346cc[_0xe9a0('0x32')]=_[_0xe9a0('0x31')](_0x1e65c9['model'],qs['fields'](_0x12c74e['query'][_0xe9a0('0x33')]));_0x5346cc[_0xe9a0('0x32')]=_0x5346cc[_0xe9a0('0x32')][_0xe9a0('0x34')]?_0x5346cc[_0xe9a0('0x32')]:_0x1e65c9[_0xe9a0('0x2d')];if(!_0x12c74e[_0xe9a0('0x2f')][_0xe9a0('0x35')](_0xe9a0('0x36'))){_0x5346cc[_0xe9a0('0x1b')]=qs[_0xe9a0('0x1b')](_0x12c74e[_0xe9a0('0x2f')][_0xe9a0('0x1b')]);_0x5346cc['offset']=qs['offset'](_0x12c74e[_0xe9a0('0x2f')][_0xe9a0('0x1a')]);}_0x5346cc[_0xe9a0('0x37')]=qs[_0xe9a0('0x38')](_0x12c74e[_0xe9a0('0x2f')][_0xe9a0('0x38')]);_0x5346cc['where']=qs['filters'](_[_0xe9a0('0x39')](_0x12c74e[_0xe9a0('0x2f')],_0x1e65c9[_0xe9a0('0x30')]),_0x428c1d);if(_0x12c74e[_0xe9a0('0x2f')]['filter']){_0x5346cc[_0xe9a0('0x3a')]=_['merge'](_0x5346cc[_0xe9a0('0x3a')],{'$or':_[_0xe9a0('0x27')](_0x428c1d,function(_0x4fae09){if(_0x4fae09[_0xe9a0('0x2b')]!==_0xe9a0('0x3b')){var _0x2f3ae1={};_0x2f3ae1[_0x4fae09[_0xe9a0('0x24')]]={'$like':'%'+_0x12c74e['query'][_0xe9a0('0x3c')]+'%'};return _0x2f3ae1;}})});}_0x5346cc=_[_0xe9a0('0x3d')]({},_0x5346cc,_0x12c74e[_0xe9a0('0x3e')]);var _0x28e477={'where':_0x5346cc['where']};return db[_0xe9a0('0x28')][_0xe9a0('0x1d')](_0x28e477)[_0xe9a0('0x21')](function(_0x5d1095){_0x14d5b6['count']=_0x5d1095;if(_0x12c74e[_0xe9a0('0x2f')][_0xe9a0('0x3f')]){_0x5346cc[_0xe9a0('0x40')]=[{'all':!![]}];}return db[_0xe9a0('0x28')]['findAll'](_0x5346cc);})['then'](function(_0xcaa67c){_0x14d5b6['rows']=_0xcaa67c;return _0x14d5b6;})['then'](respondWithFilteredResult(_0x55f79a,_0x5346cc))[_0xe9a0('0x41')](handleError(_0x55f79a,null));};exports['show']=function(_0x10ba46,_0x5ab99e){var _0x40fae0={'raw':!![],'where':{'id':_0x10ba46[_0xe9a0('0x42')]['id']}},_0x1dff0f={};_0x1dff0f[_0xe9a0('0x2d')]=_[_0xe9a0('0x2e')](db[_0xe9a0('0x28')]['rawAttributes']);_0x1dff0f[_0xe9a0('0x2f')]=_[_0xe9a0('0x2e')](_0x10ba46[_0xe9a0('0x2f')]);_0x1dff0f[_0xe9a0('0x30')]=_[_0xe9a0('0x31')](_0x1dff0f[_0xe9a0('0x2d')],_0x1dff0f[_0xe9a0('0x2f')]);_0x40fae0[_0xe9a0('0x32')]=_[_0xe9a0('0x31')](_0x1dff0f['model'],qs['fields'](_0x10ba46[_0xe9a0('0x2f')][_0xe9a0('0x33')]));_0x40fae0['attributes']=_0x40fae0[_0xe9a0('0x32')]['length']?_0x40fae0[_0xe9a0('0x32')]:_0x1dff0f[_0xe9a0('0x2d')];if(_0x10ba46[_0xe9a0('0x2f')][_0xe9a0('0x3f')]){_0x40fae0[_0xe9a0('0x40')]=[{'all':!![]}];}_0x40fae0=_['merge']({},_0x40fae0,_0x10ba46['options']);return db[_0xe9a0('0x28')][_0xe9a0('0x43')](_0x40fae0)[_0xe9a0('0x21')](handleEntityNotFound(_0x5ab99e,null))[_0xe9a0('0x21')](respondWithResult(_0x5ab99e,null))[_0xe9a0('0x41')](handleError(_0x5ab99e,null));};exports[_0xe9a0('0x44')]=function(_0x35fc6e,_0x4cd17b){return db['MailServerOut'][_0xe9a0('0x44')](_0x35fc6e[_0xe9a0('0x45')],{})[_0xe9a0('0x21')](respondWithResult(_0x4cd17b,0xc9))[_0xe9a0('0x41')](handleError(_0x4cd17b,null));};exports[_0xe9a0('0x46')]=function(_0x476af5,_0x447e86){if(_0x476af5[_0xe9a0('0x45')]['id']){delete _0x476af5[_0xe9a0('0x45')]['id'];}return db[_0xe9a0('0x28')][_0xe9a0('0x43')]({'where':{'id':_0x476af5['params']['id']}})[_0xe9a0('0x21')](handleEntityNotFound(_0x447e86,null))['then'](saveUpdates(_0x476af5[_0xe9a0('0x45')],null))[_0xe9a0('0x21')](respondWithResult(_0x447e86,null))[_0xe9a0('0x41')](handleError(_0x447e86,null));};exports[_0xe9a0('0x22')]=function(_0x5e4dd5,_0x3cdb84){return db[_0xe9a0('0x28')]['find']({'where':{'id':_0x5e4dd5['params']['id']}})[_0xe9a0('0x21')](handleEntityNotFound(_0x3cdb84,null))[_0xe9a0('0x21')](removeEntity(_0x3cdb84,null))[_0xe9a0('0x41')](handleError(_0x3cdb84,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index c6cf06e..8667562 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 _0xcc01=['exports','define','MailServerOut','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x431e2b,_0x2ec4fd){var _0x161d16=function(_0x5031f2){while(--_0x5031f2){_0x431e2b['push'](_0x431e2b['shift']());}};_0x161d16(++_0x2ec4fd);}(_0xcc01,0x1ef));var _0x1cc0=function(_0x3955fa,_0x346a70){_0x3955fa=_0x3955fa-0x0;var _0x3e89d5=_0xcc01[_0x3955fa];return _0x3e89d5;};'use strict';var _=require(_0x1cc0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1cc0('0x1'));var moment=require(_0x1cc0('0x2'));var BPromise=require(_0x1cc0('0x3'));var rp=require(_0x1cc0('0x4'));var fs=require('fs');var path=require(_0x1cc0('0x5'));var rimraf=require(_0x1cc0('0x6'));var config=require(_0x1cc0('0x7'));var attributes=require(_0x1cc0('0x8'));module[_0x1cc0('0x9')]=function(_0x1b72fb,_0x261a0e){return _0x1b72fb[_0x1cc0('0xa')](_0x1cc0('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd7c=['bluebird','request-promise','path','rimraf','exports','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x1f2901,_0x23104a){var _0x23e15b=function(_0xdd45fd){while(--_0xdd45fd){_0x1f2901['push'](_0x1f2901['shift']());}};_0x23e15b(++_0x23104a);}(_0xdd7c,0x182));var _0xcdd7=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xdd7c[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require(_0xcdd7('0x0'));var util=require(_0xcdd7('0x1'));var logger=require(_0xcdd7('0x2'))(_0xcdd7('0x3'));var moment=require('moment');var BPromise=require(_0xcdd7('0x4'));var rp=require(_0xcdd7('0x5'));var fs=require('fs');var path=require(_0xcdd7('0x6'));var rimraf=require(_0xcdd7('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xcdd7('0x8')]=function(_0x5d5c92,_0x3fc579){return _0x5d5c92['define']('MailServerOut',attributes,{'tableName':_0xcdd7('0x9'),'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 5a3e5a3..796bb3d 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x38e265,_0x49d09b){var _0xc32198=function(_0x2a0d36){while(--_0x2a0d36){_0x38e265['push'](_0x38e265['shift']());}};_0xc32198(++_0x49d09b);}(_0xdb28,0x106));var _0x8db2=function(_0x40bc68,_0x35c043){_0x40bc68=_0x40bc68-0x0;var _0x1979bf=_0xdb28[_0x40bc68];return _0x1979bf;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3ef210,_0x4c403d){var _0x28b828=function(_0x23a6ab){while(--_0x23a6ab){_0x3ef210['push'](_0x3ef210['shift']());}};_0x28b828(++_0x4c403d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14aae4,_0x5c989d){_0x14aae4=_0x14aae4-0x0;var _0x49170c=_0x5f2f[_0x14aae4];return _0x49170c;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f68f29b..c949623 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 _0xad5e=['/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x18e502,_0x34ec90){var _0x3b3e3e=function(_0x37fd1d){while(--_0x37fd1d){_0x18e502['push'](_0x18e502['shift']());}};_0x3b3e3e(++_0x34ec90);}(_0xad5e,0x120));var _0xead5=function(_0x3cc762,_0x2babfc){_0x3cc762=_0x3cc762-0x0;var _0x4dd5a1=_0xad5e[_0x3cc762];return _0x4dd5a1;};'use strict';var multer=require(_0xead5('0x0'));var util=require(_0xead5('0x1'));var path=require(_0xead5('0x2'));var timeout=require(_0xead5('0x3'));var express=require(_0xead5('0x4'));var router=express[_0xead5('0x5')]();var fs_extra=require(_0xead5('0x6'));var auth=require(_0xead5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xead5('0x8'));var controller=require('./mailSubstatus.controller');router[_0xead5('0x9')]('/',auth[_0xead5('0xa')](),controller[_0xead5('0xb')]);router[_0xead5('0x9')](_0xead5('0xc'),auth[_0xead5('0xa')](),controller['describe']);router['get'](_0xead5('0xd'),auth[_0xead5('0xa')](),controller[_0xead5('0xe')]);router['post']('/',auth[_0xead5('0xa')](),controller[_0xead5('0xf')]);router[_0xead5('0x10')](_0xead5('0xd'),auth[_0xead5('0xa')](),controller[_0xead5('0x11')]);router['delete']('/:id',auth[_0xead5('0xa')](),controller[_0xead5('0x12')]);module[_0xead5('0x13')]=router; \ No newline at end of file +var _0xd602=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xd602,0xac));var _0x2d60=function(_0x151f56,_0x3ecc1f){_0x151f56=_0x151f56-0x0;var _0x5ede64=_0xd602[_0x151f56];return _0x5ede64;};'use strict';var multer=require(_0x2d60('0x0'));var util=require(_0x2d60('0x1'));var path=require(_0x2d60('0x2'));var timeout=require(_0x2d60('0x3'));var express=require('express');var router=express[_0x2d60('0x4')]();var fs_extra=require(_0x2d60('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d60('0x6'));var controller=require('./mailSubstatus.controller');router[_0x2d60('0x7')]('/',auth[_0x2d60('0x8')](),controller[_0x2d60('0x9')]);router[_0x2d60('0x7')](_0x2d60('0xa'),auth['isAuthenticated'](),controller[_0x2d60('0xb')]);router[_0x2d60('0x7')](_0x2d60('0xc'),auth['isAuthenticated'](),controller[_0x2d60('0xd')]);router[_0x2d60('0xe')]('/',auth[_0x2d60('0x8')](),controller['create']);router['put'](_0x2d60('0xc'),auth[_0x2d60('0x8')](),controller[_0x2d60('0xf')]);router[_0x2d60('0x10')](_0x2d60('0xc'),auth[_0x2d60('0x8')](),controller[_0x2d60('0x11')]);module[_0x2d60('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 62f59db..d672556 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 _0xfc65=['STRING','sequelize','name'];(function(_0x4b0dfa,_0x24fc57){var _0x5345e5=function(_0x4ba788){while(--_0x4ba788){_0x4b0dfa['push'](_0x4b0dfa['shift']());}};_0x5345e5(++_0x24fc57);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x27f664,_0x5a160f){_0x27f664=_0x27f664-0x0;var _0x1c7d68=_0xfc65[_0x27f664];return _0x1c7d68;};'use strict';var Sequelize=require(_0x5fc6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5fc6('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5fc6('0x2')]}}; \ No newline at end of file +var _0xbd0a=['STRING','sequelize'];(function(_0x493f9b,_0xfdbb2b){var _0x404bf7=function(_0x18b36b){while(--_0x18b36b){_0x493f9b['push'](_0x493f9b['shift']());}};_0x404bf7(++_0xfdbb2b);}(_0xbd0a,0x1b9));var _0xabd0=function(_0xc1b850,_0xa18dbc){_0xc1b850=_0xc1b850-0x0;var _0x12718c=_0xbd0a[_0xc1b850];return _0x12718c;};'use strict';var Sequelize=require(_0xabd0('0x0'));module['exports']={'name':{'type':Sequelize[_0xabd0('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d0b2306..7b16c57 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 _0xe455=['set','Content-Range','json','apply','reject','then','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','MailSubstatus','findAll','rows','catch','show','find','create','update','body','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit'];(function(_0x2231b9,_0x2fd7c2){var _0x5e76dc=function(_0x34a12d){while(--_0x34a12d){_0x2231b9['push'](_0x2231b9['shift']());}};_0x5e76dc(++_0x2fd7c2);}(_0xe455,0x73));var _0x5e45=function(_0x25e274,_0x5d7b21){_0x25e274=_0x25e274-0x0;var _0x24c1e9=_0xe455[_0x25e274];return _0x24c1e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e45('0x0'));var zipdir=require(_0x5e45('0x1'));var jsonpatch=require(_0x5e45('0x2'));var rp=require('request-promise');var moment=require(_0x5e45('0x3'));var BPromise=require(_0x5e45('0x4'));var Mustache=require(_0x5e45('0x5'));var util=require(_0x5e45('0x6'));var path=require('path');var sox=require(_0x5e45('0x7'));var csv=require('to-csv');var ejs=require(_0x5e45('0x8'));var fs=require('fs');var fs_extra=require(_0x5e45('0x9'));var _=require(_0x5e45('0xa'));var squel=require(_0x5e45('0xb'));var crypto=require(_0x5e45('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e45('0xd'));var Papa=require(_0x5e45('0xe'));var Redis=require(_0x5e45('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5e45('0x10'));var as=require(_0x5e45('0x11'));var hardwareService=require(_0x5e45('0x12'));var logger=require('../../config/logger')(_0x5e45('0x13'));var utils=require('../../config/utils');var config=require(_0x5e45('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e45('0x15'))['db'];function respondWithStatusCode(_0xe5485a,_0x4f23be){_0x4f23be=_0x4f23be||0xcc;return function(_0x386e26){if(_0x386e26){return _0xe5485a[_0x5e45('0x16')](_0x4f23be);}return _0xe5485a['status'](_0x4f23be)['end']();};}function respondWithResult(_0x2a0ee8,_0x1bab75){_0x1bab75=_0x1bab75||0xc8;return function(_0x48bbc2){if(_0x48bbc2){return _0x2a0ee8[_0x5e45('0x17')](_0x1bab75)['json'](_0x48bbc2);}};}function respondWithFilteredResult(_0x44e14b,_0x1855c1){return function(_0x277e3a){if(_0x277e3a){var _0x3c58fd=typeof _0x1855c1[_0x5e45('0x18')]===_0x5e45('0x19')&&typeof _0x1855c1[_0x5e45('0x1a')]===_0x5e45('0x19');var _0x27e42d=_0x277e3a['count'];var _0x4bbf86=_0x3c58fd?0x0:_0x1855c1[_0x5e45('0x18')];var _0x1294b3=_0x3c58fd?_0x277e3a['count']:_0x1855c1[_0x5e45('0x18')]+_0x1855c1[_0x5e45('0x1a')];var _0x247b41;if(_0x1294b3>=_0x27e42d){_0x1294b3=_0x27e42d;_0x247b41=0xc8;}else{_0x247b41=0xce;}_0x44e14b[_0x5e45('0x17')](_0x247b41);return _0x44e14b[_0x5e45('0x1b')](_0x5e45('0x1c'),_0x4bbf86+'-'+_0x1294b3+'/'+_0x27e42d)[_0x5e45('0x1d')](_0x277e3a);}return null;};}function patchUpdates(_0x3a4f4c){return function(_0x49db7c){try{jsonpatch[_0x5e45('0x1e')](_0x49db7c,_0x3a4f4c,!![]);}catch(_0x3bc941){return BPromise[_0x5e45('0x1f')](_0x3bc941);}return _0x49db7c['save']();};}function saveUpdates(_0x3e422c,_0x4e0898){return function(_0x7cd132){if(_0x7cd132){return _0x7cd132['update'](_0x3e422c)[_0x5e45('0x20')](function(_0x58b594){return _0x58b594;});}return null;};}function removeEntity(_0x443fe7,_0x53e5ab){return function(_0xfc9bdc){if(_0xfc9bdc){return _0xfc9bdc['destroy']()[_0x5e45('0x20')](function(){_0x443fe7[_0x5e45('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a9bf,_0x4bbac0){return function(_0x501935){if(!_0x501935){_0x16a9bf[_0x5e45('0x16')](0x194);}return _0x501935;};}function handleError(_0x584bf0,_0x1ec29b){_0x1ec29b=_0x1ec29b||0x1f4;return function(_0x12a34a){logger[_0x5e45('0x21')](_0x12a34a[_0x5e45('0x22')]);if(_0x12a34a[_0x5e45('0x23')]){delete _0x12a34a[_0x5e45('0x23')];}_0x584bf0[_0x5e45('0x17')](_0x1ec29b)[_0x5e45('0x24')](_0x12a34a);};}exports['index']=function(_0x36e956,_0x3818){var _0x352801={},_0x2d3fb1={},_0x397d26={'count':0x0,'rows':[]};var _0x53a002=_[_0x5e45('0x25')](db['MailSubstatus'][_0x5e45('0x26')],function(_0x1ca2c6){return{'name':_0x1ca2c6['fieldName'],'type':_0x1ca2c6[_0x5e45('0x27')][_0x5e45('0x28')]};});_0x2d3fb1['model']=_['map'](_0x53a002,_0x5e45('0x23'));_0x2d3fb1[_0x5e45('0x29')]=_[_0x5e45('0x2a')](_0x36e956[_0x5e45('0x29')]);_0x2d3fb1[_0x5e45('0x2b')]=_['intersection'](_0x2d3fb1[_0x5e45('0x2c')],_0x2d3fb1[_0x5e45('0x29')]);_0x352801[_0x5e45('0x2d')]=_[_0x5e45('0x2e')](_0x2d3fb1[_0x5e45('0x2c')],qs[_0x5e45('0x2f')](_0x36e956[_0x5e45('0x29')]['fields']));_0x352801[_0x5e45('0x2d')]=_0x352801['attributes'][_0x5e45('0x30')]?_0x352801[_0x5e45('0x2d')]:_0x2d3fb1[_0x5e45('0x2c')];if(!_0x36e956[_0x5e45('0x29')][_0x5e45('0x31')](_0x5e45('0x32'))){_0x352801['limit']=qs[_0x5e45('0x1a')](_0x36e956[_0x5e45('0x29')]['limit']);_0x352801['offset']=qs[_0x5e45('0x18')](_0x36e956['query'][_0x5e45('0x18')]);}_0x352801['order']=qs[_0x5e45('0x33')](_0x36e956[_0x5e45('0x29')]['sort']);_0x352801[_0x5e45('0x34')]=qs[_0x5e45('0x2b')](_[_0x5e45('0x35')](_0x36e956[_0x5e45('0x29')],_0x2d3fb1['filters']),_0x53a002);if(_0x36e956['query']['filter']){_0x352801[_0x5e45('0x34')]=_[_0x5e45('0x36')](_0x352801[_0x5e45('0x34')],{'$or':_[_0x5e45('0x25')](_0x53a002,function(_0x2a0d93){if(_0x2a0d93[_0x5e45('0x27')]!==_0x5e45('0x37')){var _0x20801a={};_0x20801a[_0x2a0d93[_0x5e45('0x23')]]={'$like':'%'+_0x36e956[_0x5e45('0x29')][_0x5e45('0x38')]+'%'};return _0x20801a;}})});}_0x352801=_['merge']({},_0x352801,_0x36e956[_0x5e45('0x39')]);var _0x39c36e={'where':_0x352801['where']};return db['MailSubstatus']['count'](_0x39c36e)[_0x5e45('0x20')](function(_0x27994c){_0x397d26[_0x5e45('0x3a')]=_0x27994c;if(_0x36e956[_0x5e45('0x29')][_0x5e45('0x3b')]){_0x352801[_0x5e45('0x3c')]=[{'all':!![]}];}return db[_0x5e45('0x3d')][_0x5e45('0x3e')](_0x352801);})[_0x5e45('0x20')](function(_0x5ab8bd){_0x397d26[_0x5e45('0x3f')]=_0x5ab8bd;return _0x397d26;})[_0x5e45('0x20')](respondWithFilteredResult(_0x3818,_0x352801))[_0x5e45('0x40')](handleError(_0x3818,null));};exports[_0x5e45('0x41')]=function(_0xf504db,_0x229d2b){var _0x598f76={'raw':!![],'where':{'id':_0xf504db['params']['id']}},_0x4439cc={};_0x4439cc[_0x5e45('0x2c')]=_[_0x5e45('0x2a')](db['MailSubstatus'][_0x5e45('0x26')]);_0x4439cc[_0x5e45('0x29')]=_['keys'](_0xf504db[_0x5e45('0x29')]);_0x4439cc['filters']=_[_0x5e45('0x2e')](_0x4439cc[_0x5e45('0x2c')],_0x4439cc[_0x5e45('0x29')]);_0x598f76[_0x5e45('0x2d')]=_[_0x5e45('0x2e')](_0x4439cc[_0x5e45('0x2c')],qs[_0x5e45('0x2f')](_0xf504db['query'][_0x5e45('0x2f')]));_0x598f76[_0x5e45('0x2d')]=_0x598f76['attributes'][_0x5e45('0x30')]?_0x598f76[_0x5e45('0x2d')]:_0x4439cc[_0x5e45('0x2c')];if(_0xf504db[_0x5e45('0x29')][_0x5e45('0x3b')]){_0x598f76[_0x5e45('0x3c')]=[{'all':!![]}];}_0x598f76=_[_0x5e45('0x36')]({},_0x598f76,_0xf504db['options']);return db[_0x5e45('0x3d')][_0x5e45('0x42')](_0x598f76)['then'](handleEntityNotFound(_0x229d2b,null))[_0x5e45('0x20')](respondWithResult(_0x229d2b,null))['catch'](handleError(_0x229d2b,null));};exports['create']=function(_0x4c3fea,_0x5cdf4a){return db['MailSubstatus'][_0x5e45('0x43')](_0x4c3fea['body'],{})[_0x5e45('0x20')](respondWithResult(_0x5cdf4a,0xc9))['catch'](handleError(_0x5cdf4a,null));};exports[_0x5e45('0x44')]=function(_0x3409e2,_0x471a4d){if(_0x3409e2['body']['id']){delete _0x3409e2['body']['id'];}return db['MailSubstatus'][_0x5e45('0x42')]({'where':{'id':_0x3409e2['params']['id']}})[_0x5e45('0x20')](handleEntityNotFound(_0x471a4d,null))[_0x5e45('0x20')](saveUpdates(_0x3409e2[_0x5e45('0x45')],null))[_0x5e45('0x20')](respondWithResult(_0x471a4d,null))[_0x5e45('0x40')](handleError(_0x471a4d,null));};exports[_0x5e45('0x46')]=function(_0x322fda,_0x4c5388){return db[_0x5e45('0x3d')][_0x5e45('0x42')]({'where':{'id':_0x322fda['params']['id']}})[_0x5e45('0x20')](handleEntityNotFound(_0x4c5388,null))[_0x5e45('0x20')](removeEntity(_0x4c5388,null))[_0x5e45('0x40')](handleError(_0x4c5388,null));};exports['describe']=function(_0x15ed91,_0x5e12a2){return db[_0x5e45('0x3d')]['describe']()['then'](respondWithResult(_0x5e12a2,null))[_0x5e45('0x40')](handleError(_0x5e12a2,null));}; \ No newline at end of file +var _0x940c=['lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','sendStatus','error','name','send','map','MailSubstatus','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra'];(function(_0x509634,_0x2d7526){var _0x15d17b=function(_0x1280c8){while(--_0x1280c8){_0x509634['push'](_0x509634['shift']());}};_0x15d17b(++_0x2d7526);}(_0x940c,0x8e));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc940('0x0'));var rimraf=require(_0xc940('0x1'));var zipdir=require(_0xc940('0x2'));var jsonpatch=require(_0xc940('0x3'));var rp=require(_0xc940('0x4'));var moment=require(_0xc940('0x5'));var BPromise=require(_0xc940('0x6'));var Mustache=require('mustache');var util=require(_0xc940('0x7'));var path=require(_0xc940('0x8'));var sox=require(_0xc940('0x9'));var csv=require('to-csv');var ejs=require(_0xc940('0xa'));var fs=require('fs');var fs_extra=require(_0xc940('0xb'));var _=require(_0xc940('0xc'));var squel=require(_0xc940('0xd'));var crypto=require(_0xc940('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc940('0xf'));var toCsv=require(_0xc940('0x10'));var querystring=require(_0xc940('0x11'));var Papa=require(_0xc940('0x12'));var Redis=require(_0xc940('0x13'));var authService=require(_0xc940('0x14'));var qs=require(_0xc940('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc940('0x16'));var utils=require(_0xc940('0x17'));var config=require(_0xc940('0x18'));var licenseUtil=require(_0xc940('0x19'));var db=require(_0xc940('0x1a'))['db'];function respondWithStatusCode(_0x4b78b3,_0x15d116){_0x15d116=_0x15d116||0xcc;return function(_0x3da078){if(_0x3da078){return _0x4b78b3['sendStatus'](_0x15d116);}return _0x4b78b3[_0xc940('0x1b')](_0x15d116)[_0xc940('0x1c')]();};}function respondWithResult(_0x491edb,_0x5afcc7){_0x5afcc7=_0x5afcc7||0xc8;return function(_0x5ae2e8){if(_0x5ae2e8){return _0x491edb[_0xc940('0x1b')](_0x5afcc7)['json'](_0x5ae2e8);}};}function respondWithFilteredResult(_0x52a115,_0x281db1){return function(_0x58bf35){if(_0x58bf35){var _0x21ce67=typeof _0x281db1[_0xc940('0x1d')]==='undefined'&&typeof _0x281db1[_0xc940('0x1e')]===_0xc940('0x1f');var _0x6bcebc=_0x58bf35[_0xc940('0x20')];var _0x1c3257=_0x21ce67?0x0:_0x281db1[_0xc940('0x1d')];var _0x1e04b7=_0x21ce67?_0x58bf35[_0xc940('0x20')]:_0x281db1[_0xc940('0x1d')]+_0x281db1[_0xc940('0x1e')];var _0x42babd;if(_0x1e04b7>=_0x6bcebc){_0x1e04b7=_0x6bcebc;_0x42babd=0xc8;}else{_0x42babd=0xce;}_0x52a115[_0xc940('0x1b')](_0x42babd);return _0x52a115[_0xc940('0x21')]('Content-Range',_0x1c3257+'-'+_0x1e04b7+'/'+_0x6bcebc)[_0xc940('0x22')](_0x58bf35);}return null;};}function patchUpdates(_0x4ea102){return function(_0x571297){try{jsonpatch[_0xc940('0x23')](_0x571297,_0x4ea102,!![]);}catch(_0x2ed846){return BPromise[_0xc940('0x24')](_0x2ed846);}return _0x571297[_0xc940('0x25')]();};}function saveUpdates(_0x56d6c0,_0x357c49){return function(_0x46bca8){if(_0x46bca8){return _0x46bca8[_0xc940('0x26')](_0x56d6c0)[_0xc940('0x27')](function(_0x389951){return _0x389951;});}return null;};}function removeEntity(_0x5cc14f,_0x546e05){return function(_0x1311d7){if(_0x1311d7){return _0x1311d7['destroy']()[_0xc940('0x27')](function(){_0x5cc14f[_0xc940('0x1b')](0xcc)[_0xc940('0x1c')]();});}};}function handleEntityNotFound(_0x4df756,_0x274e1f){return function(_0x2c3da6){if(!_0x2c3da6){_0x4df756[_0xc940('0x28')](0x194);}return _0x2c3da6;};}function handleError(_0x4ceccd,_0x54978d){_0x54978d=_0x54978d||0x1f4;return function(_0x5bda8e){logger[_0xc940('0x29')](_0x5bda8e['stack']);if(_0x5bda8e['name']){delete _0x5bda8e[_0xc940('0x2a')];}_0x4ceccd['status'](_0x54978d)[_0xc940('0x2b')](_0x5bda8e);};}exports['index']=function(_0x5b1e87,_0x3742f4){var _0x59a3c4={},_0xdc081d={},_0x5a2355={'count':0x0,'rows':[]};var _0x566c99=_[_0xc940('0x2c')](db[_0xc940('0x2d')][_0xc940('0x2e')],function(_0x33de8d){return{'name':_0x33de8d['fieldName'],'type':_0x33de8d[_0xc940('0x2f')]['key']};});_0xdc081d[_0xc940('0x30')]=_[_0xc940('0x2c')](_0x566c99,'name');_0xdc081d['query']=_[_0xc940('0x31')](_0x5b1e87[_0xc940('0x32')]);_0xdc081d['filters']=_[_0xc940('0x33')](_0xdc081d['model'],_0xdc081d['query']);_0x59a3c4[_0xc940('0x34')]=_[_0xc940('0x33')](_0xdc081d[_0xc940('0x30')],qs[_0xc940('0x35')](_0x5b1e87['query'][_0xc940('0x35')]));_0x59a3c4['attributes']=_0x59a3c4[_0xc940('0x34')][_0xc940('0x36')]?_0x59a3c4[_0xc940('0x34')]:_0xdc081d[_0xc940('0x30')];if(!_0x5b1e87[_0xc940('0x32')][_0xc940('0x37')](_0xc940('0x38'))){_0x59a3c4['limit']=qs['limit'](_0x5b1e87['query'][_0xc940('0x1e')]);_0x59a3c4[_0xc940('0x1d')]=qs[_0xc940('0x1d')](_0x5b1e87['query'][_0xc940('0x1d')]);}_0x59a3c4[_0xc940('0x39')]=qs['sort'](_0x5b1e87[_0xc940('0x32')][_0xc940('0x3a')]);_0x59a3c4['where']=qs[_0xc940('0x3b')](_[_0xc940('0x3c')](_0x5b1e87[_0xc940('0x32')],_0xdc081d[_0xc940('0x3b')]),_0x566c99);if(_0x5b1e87[_0xc940('0x32')][_0xc940('0x3d')]){_0x59a3c4[_0xc940('0x3e')]=_['merge'](_0x59a3c4[_0xc940('0x3e')],{'$or':_['map'](_0x566c99,function(_0x2660af){if(_0x2660af[_0xc940('0x2f')]!==_0xc940('0x3f')){var _0x5dc44d={};_0x5dc44d[_0x2660af[_0xc940('0x2a')]]={'$like':'%'+_0x5b1e87[_0xc940('0x32')]['filter']+'%'};return _0x5dc44d;}})});}_0x59a3c4=_[_0xc940('0x40')]({},_0x59a3c4,_0x5b1e87[_0xc940('0x41')]);var _0x396956={'where':_0x59a3c4[_0xc940('0x3e')]};return db[_0xc940('0x2d')][_0xc940('0x20')](_0x396956)[_0xc940('0x27')](function(_0x1a787b){_0x5a2355[_0xc940('0x20')]=_0x1a787b;if(_0x5b1e87[_0xc940('0x32')][_0xc940('0x42')]){_0x59a3c4['include']=[{'all':!![]}];}return db[_0xc940('0x2d')][_0xc940('0x43')](_0x59a3c4);})[_0xc940('0x27')](function(_0x127de7){_0x5a2355['rows']=_0x127de7;return _0x5a2355;})['then'](respondWithFilteredResult(_0x3742f4,_0x59a3c4))[_0xc940('0x44')](handleError(_0x3742f4,null));};exports[_0xc940('0x45')]=function(_0x565eaa,_0x3b176f){var _0x22d289={'raw':!![],'where':{'id':_0x565eaa[_0xc940('0x46')]['id']}},_0x40d4c4={};_0x40d4c4[_0xc940('0x30')]=_[_0xc940('0x31')](db[_0xc940('0x2d')]['rawAttributes']);_0x40d4c4[_0xc940('0x32')]=_[_0xc940('0x31')](_0x565eaa[_0xc940('0x32')]);_0x40d4c4[_0xc940('0x3b')]=_[_0xc940('0x33')](_0x40d4c4[_0xc940('0x30')],_0x40d4c4['query']);_0x22d289[_0xc940('0x34')]=_[_0xc940('0x33')](_0x40d4c4[_0xc940('0x30')],qs[_0xc940('0x35')](_0x565eaa['query'][_0xc940('0x35')]));_0x22d289[_0xc940('0x34')]=_0x22d289['attributes'][_0xc940('0x36')]?_0x22d289[_0xc940('0x34')]:_0x40d4c4[_0xc940('0x30')];if(_0x565eaa['query']['includeAll']){_0x22d289[_0xc940('0x47')]=[{'all':!![]}];}_0x22d289=_[_0xc940('0x40')]({},_0x22d289,_0x565eaa[_0xc940('0x41')]);return db[_0xc940('0x2d')]['find'](_0x22d289)[_0xc940('0x27')](handleEntityNotFound(_0x3b176f,null))[_0xc940('0x27')](respondWithResult(_0x3b176f,null))['catch'](handleError(_0x3b176f,null));};exports['create']=function(_0x27f83b,_0x2e7829){return db[_0xc940('0x2d')][_0xc940('0x48')](_0x27f83b[_0xc940('0x49')],{})[_0xc940('0x27')](respondWithResult(_0x2e7829,0xc9))['catch'](handleError(_0x2e7829,null));};exports[_0xc940('0x26')]=function(_0x6b8dc9,_0x13390d){if(_0x6b8dc9[_0xc940('0x49')]['id']){delete _0x6b8dc9[_0xc940('0x49')]['id'];}return db[_0xc940('0x2d')]['find']({'where':{'id':_0x6b8dc9[_0xc940('0x46')]['id']}})[_0xc940('0x27')](handleEntityNotFound(_0x13390d,null))[_0xc940('0x27')](saveUpdates(_0x6b8dc9['body'],null))[_0xc940('0x27')](respondWithResult(_0x13390d,null))[_0xc940('0x44')](handleError(_0x13390d,null));};exports[_0xc940('0x4a')]=function(_0x34d889,_0x239e4b){return db[_0xc940('0x2d')][_0xc940('0x4b')]({'where':{'id':_0x34d889[_0xc940('0x46')]['id']}})[_0xc940('0x27')](handleEntityNotFound(_0x239e4b,null))[_0xc940('0x27')](removeEntity(_0x239e4b,null))[_0xc940('0x44')](handleError(_0x239e4b,null));};exports[_0xc940('0x4c')]=function(_0x4b9da5,_0x42d9bf){return db[_0xc940('0x2d')][_0xc940('0x4c')]()['then'](respondWithResult(_0x42d9bf,null))[_0xc940('0x44')](handleError(_0x42d9bf,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 06e71fc..058d807 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a5=['setMaxListeners','update','emit','hook','../../mysqldb','MailSubstatus'];(function(_0x495d4d,_0x244bb1){var _0x30a114=function(_0x108167){while(--_0x108167){_0x495d4d['push'](_0x495d4d['shift']());}};_0x30a114(++_0x244bb1);}(_0xd4a5,0x13c));var _0x5d4a=function(_0x814de8,_0x4c67d8){_0x814de8=_0x814de8-0x0;var _0xe8411b=_0xd4a5[_0x814de8];return _0xe8411b;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x5d4a('0x0'))['db'][_0x5d4a('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5d4a('0x2')](0x0);var events={'afterUpdate':_0x5d4a('0x3')};function emitEvent(_0x4a1b57){return function(_0x58afb4,_0x45124e,_0x38861b){MailSubstatusEvents[_0x5d4a('0x4')](_0x4a1b57+':'+_0x58afb4['id'],_0x58afb4);MailSubstatusEvents[_0x5d4a('0x4')](_0x4a1b57,_0x58afb4);_0x38861b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x5d4a('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x447a=['setMaxListeners','update','emit','hook','MailSubstatus'];(function(_0x2ac573,_0xeeaa8b){var _0x11415f=function(_0x1de677){while(--_0x1de677){_0x2ac573['push'](_0x2ac573['shift']());}};_0x11415f(++_0xeeaa8b);}(_0x447a,0x6d));var _0xa447=function(_0x26a382,_0x3d54db){_0x26a382=_0x26a382-0x0;var _0x14f9c8=_0x447a[_0x26a382];return _0x14f9c8;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0xa447('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa447('0x1')](0x0);var events={'afterUpdate':_0xa447('0x2')};function emitEvent(_0xee6a12){return function(_0x56aba8,_0x4bfdaa,_0x515428){MailSubstatusEvents[_0xa447('0x3')](_0xee6a12+':'+_0x56aba8['id'],_0x56aba8);MailSubstatusEvents[_0xa447('0x3')](_0xee6a12,_0x56aba8);_0x515428(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xa447('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index cf911fe..89e6be4 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 _0xf19d=['exports','define','MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','./mailSubstatus.attributes'];(function(_0x58432c,_0x22b7bd){var _0x17cc35=function(_0x2ee063){while(--_0x2ee063){_0x58432c['push'](_0x58432c['shift']());}};_0x17cc35(++_0x22b7bd);}(_0xf19d,0x14c));var _0xdf19=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xf19d[_0x1b349a];return _0x5d1f7c;};'use strict';var attributes=require(_0xdf19('0x0'));module[_0xdf19('0x1')]=function(_0x173479){var _0x4a18d3=_0x173479['models'];return _0x173479[_0xdf19('0x2')](_0xdf19('0x3'),attributes,{'tableName':_0xdf19('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x6902cb,_0x41d305,_0x17daed){return _0x4a18d3[_0xdf19('0x5')][_0xdf19('0x6')]({'value':_0x6902cb[_0xdf19('0x7')]},{'where':{'field':'mailSubstatus','value':_0x6902cb[_0xdf19('0x8')][_0xdf19('0x7')]}})['then'](function(){_0x17daed();})['catch'](function(_0x52c99d){_0x17daed(_0x52c99d);});}}});}; \ No newline at end of file +var _0xe9ae=['then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','update','name','mailSubstatus','_previousDataValues'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0xe9ae,0x1d0));var _0xee9a=function(_0x4b5e01,_0x4ecea7){_0x4b5e01=_0x4b5e01-0x0;var _0x17cfee=_0xe9ae[_0x4b5e01];return _0x17cfee;};'use strict';var attributes=require(_0xee9a('0x0'));module[_0xee9a('0x1')]=function(_0x3d175e){var _0x331762=_0x3d175e[_0xee9a('0x2')];return _0x3d175e[_0xee9a('0x3')]('MailSubstatus',attributes,{'tableName':_0xee9a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xbc6b7a,_0x2ad7ee,_0xcd14d3){return _0x331762['Condition'][_0xee9a('0x5')]({'value':_0xbc6b7a[_0xee9a('0x6')]},{'where':{'field':_0xee9a('0x7'),'value':_0xbc6b7a[_0xee9a('0x8')]['name']}})[_0xee9a('0x9')](function(){_0xcd14d3();})[_0xee9a('0xa')](function(_0x5ced2c){_0xcd14d3(_0x5ced2c);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9eec017..5d887b0 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 _0xc0d8=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc0d8,0x1b5));var _0x8c0d=function(_0x1d3d65,_0x4b848d){_0x1d3d65=_0x1d3d65-0x0;var _0x4a6bab=_0xc0d8[_0x1d3d65];return _0x4a6bab;};'use strict';var _=require(_0x8c0d('0x0'));var util=require('util');var moment=require(_0x8c0d('0x1'));var BPromise=require(_0x8c0d('0x2'));var rs=require(_0x8c0d('0x3'));var fs=require('fs');var Redis=require(_0x8c0d('0x4'));var db=require(_0x8c0d('0x5'))['db'];var utils=require(_0x8c0d('0x6'));var logger=require('../../config/logger')(_0x8c0d('0x7'));var config=require(_0x8c0d('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x509fa3,_0x3f1bef,_0x2e5928){return new BPromise(function(_0x3ae062,_0xad198f){return client['request'](_0x509fa3,_0x2e5928)[_0x8c0d('0x9')](function(_0x315e9a){logger['info'](_0x8c0d('0xa'),_0x3f1bef,_0x8c0d('0xb'));logger[_0x8c0d('0xc')](_0x8c0d('0xd'),_0x3f1bef,_0x8c0d('0xb'),JSON[_0x8c0d('0xe')](_0x315e9a));if(_0x315e9a[_0x8c0d('0xf')]){if(_0x315e9a['error'][_0x8c0d('0x10')]===0x1f4){logger[_0x8c0d('0xf')](_0x8c0d('0xa'),_0x3f1bef,_0x315e9a[_0x8c0d('0xf')][_0x8c0d('0x11')]);return _0xad198f(_0x315e9a['error'][_0x8c0d('0x11')]);}logger[_0x8c0d('0xf')](_0x8c0d('0xa'),_0x3f1bef,_0x315e9a[_0x8c0d('0xf')][_0x8c0d('0x11')]);return _0x3ae062(_0x315e9a[_0x8c0d('0xf')][_0x8c0d('0x11')]);}else{logger[_0x8c0d('0x12')](_0x8c0d('0xa'),_0x3f1bef,_0x8c0d('0xb'));_0x3ae062(_0x315e9a[_0x8c0d('0x13')][_0x8c0d('0x11')]);}})[_0x8c0d('0x14')](function(_0x5359f5){logger[_0x8c0d('0xf')](_0x8c0d('0xa'),_0x3f1bef,_0x5359f5);_0xad198f(_0x5359f5);});});} \ No newline at end of file +var _0x6cd0=['stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ad92f,_0x1cf47f){var _0x4e075d=function(_0x1982b0){while(--_0x1982b0){_0x3ad92f['push'](_0x3ad92f['shift']());}};_0x4e075d(++_0x1cf47f);}(_0x6cd0,0x1ce));var _0x06cd=function(_0xafd14f,_0x1642ab){_0xafd14f=_0xafd14f-0x0;var _0x2454d3=_0x6cd0[_0xafd14f];return _0x2454d3;};'use strict';var _=require(_0x06cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x06cd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06cd('0x2'))['db'];var utils=require(_0x06cd('0x3'));var logger=require('../../config/logger')(_0x06cd('0x4'));var config=require('../../config/environment');var jayson=require(_0x06cd('0x5'));var client=jayson[_0x06cd('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d75d7,_0x348b57,_0x42e321){return new BPromise(function(_0x17d458,_0xd5de73){return client[_0x06cd('0x7')](_0x4d75d7,_0x42e321)[_0x06cd('0x8')](function(_0x3f5c5e){logger[_0x06cd('0x9')](_0x06cd('0xa'),_0x348b57,_0x06cd('0xb'));logger[_0x06cd('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x348b57,'request\x20sent',JSON[_0x06cd('0xd')](_0x3f5c5e));if(_0x3f5c5e[_0x06cd('0xe')]){if(_0x3f5c5e[_0x06cd('0xe')][_0x06cd('0xf')]===0x1f4){logger[_0x06cd('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x348b57,_0x3f5c5e[_0x06cd('0xe')][_0x06cd('0x10')]);return _0xd5de73(_0x3f5c5e[_0x06cd('0xe')][_0x06cd('0x10')]);}logger[_0x06cd('0xe')](_0x06cd('0xa'),_0x348b57,_0x3f5c5e[_0x06cd('0xe')][_0x06cd('0x10')]);return _0x17d458(_0x3f5c5e[_0x06cd('0xe')][_0x06cd('0x10')]);}else{logger[_0x06cd('0x9')](_0x06cd('0xa'),_0x348b57,_0x06cd('0xb'));_0x17d458(_0x3f5c5e[_0x06cd('0x11')][_0x06cd('0x10')]);}})[_0x06cd('0x12')](function(_0x32e136){logger[_0x06cd('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x348b57,_0x32e136);_0xd5de73(_0x32e136);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 46820d2..0221aab 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 _0x3dd3=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','/:id','show','post'];(function(_0x90e9ab,_0x426802){var _0xdfa58b=function(_0x3d760e){while(--_0x3d760e){_0x90e9ab['push'](_0x90e9ab['shift']());}};_0xdfa58b(++_0x426802);}(_0x3dd3,0x135));var _0x33dd=function(_0x29ecc7,_0x41fb1f){_0x29ecc7=_0x29ecc7-0x0;var _0x5c43dc=_0x3dd3[_0x29ecc7];return _0x5c43dc;};'use strict';var multer=require(_0x33dd('0x0'));var util=require(_0x33dd('0x1'));var path=require('path');var timeout=require(_0x33dd('0x2'));var express=require(_0x33dd('0x3'));var router=express[_0x33dd('0x4')]();var fs_extra=require(_0x33dd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x33dd('0x6'));var controller=require(_0x33dd('0x7'));router['get']('/',auth[_0x33dd('0x8')](),controller['index']);router[_0x33dd('0x9')](_0x33dd('0xa'),auth[_0x33dd('0x8')](),controller['describe']);router[_0x33dd('0x9')](_0x33dd('0xb'),auth[_0x33dd('0x8')](),controller[_0x33dd('0xc')]);router[_0x33dd('0xd')]('/',auth[_0x33dd('0x8')](),controller['create']);router[_0x33dd('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x33dd('0xf')]);router[_0x33dd('0x10')](_0x33dd('0xb'),auth[_0x33dd('0x8')](),controller[_0x33dd('0x11')]);module[_0x33dd('0x12')]=router; \ No newline at end of file +var _0x5f10=['create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0xc10343,_0x1d816d){var _0x21235b=function(_0x4b0a0b){while(--_0x4b0a0b){_0xc10343['push'](_0xc10343['shift']());}};_0x21235b(++_0x1d816d);}(_0x5f10,0x1af));var _0x05f1=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0x5f10[_0x65c597];return _0x1ec368;};'use strict';var multer=require('multer');var util=require(_0x05f1('0x0'));var path=require(_0x05f1('0x1'));var timeout=require(_0x05f1('0x2'));var express=require('express');var router=express[_0x05f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05f1('0x5'));var controller=require('./mailTransferReport.controller');router[_0x05f1('0x6')]('/',auth[_0x05f1('0x7')](),controller['index']);router[_0x05f1('0x6')](_0x05f1('0x8'),auth[_0x05f1('0x7')](),controller[_0x05f1('0x9')]);router[_0x05f1('0x6')](_0x05f1('0xa'),auth[_0x05f1('0x7')](),controller['show']);router['post']('/',auth[_0x05f1('0x7')](),controller[_0x05f1('0xb')]);router[_0x05f1('0xc')](_0x05f1('0xa'),auth[_0x05f1('0x7')](),controller[_0x05f1('0xd')]);router[_0x05f1('0xe')](_0x05f1('0xa'),auth[_0x05f1('0x7')](),controller[_0x05f1('0xf')]);module[_0x05f1('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 28fb554..331d0a4 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x544362,_0xc31c04){var _0x5c12f9=function(_0x365c8b){while(--_0x365c8b){_0x544362['push'](_0x544362['shift']());}};_0x5c12f9(++_0xc31c04);}(_0x54ef,0x112));var _0xf54e=function(_0x419c68,_0x1bc149){_0x419c68=_0x419c68-0x0;var _0x581c54=_0x54ef[_0x419c68];return _0x581c54;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x215e63,_0x361847){_0x215e63=_0x215e63-0x0;var _0x474b7f=_0xb43b[_0x215e63];return _0x474b7f;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a086d20..fe32c84 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 _0xc6b8=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','findAll','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','MailTransferReport','rawAttributes','key','query','keys'];(function(_0x7b8b47,_0x274711){var _0x5b3c2a=function(_0x146c44){while(--_0x146c44){_0x7b8b47['push'](_0x7b8b47['shift']());}};_0x5b3c2a(++_0x274711);}(_0xc6b8,0x145));var _0x8c6b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc6b8[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x8c6b('0x0'));var rimraf=require(_0x8c6b('0x1'));var zipdir=require(_0x8c6b('0x2'));var jsonpatch=require(_0x8c6b('0x3'));var rp=require(_0x8c6b('0x4'));var moment=require(_0x8c6b('0x5'));var BPromise=require(_0x8c6b('0x6'));var Mustache=require('mustache');var util=require(_0x8c6b('0x7'));var path=require(_0x8c6b('0x8'));var sox=require(_0x8c6b('0x9'));var csv=require('to-csv');var ejs=require(_0x8c6b('0xa'));var fs=require('fs');var fs_extra=require(_0x8c6b('0xb'));var _=require('lodash');var squel=require(_0x8c6b('0xc'));var crypto=require(_0x8c6b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c6b('0xe'));var toCsv=require(_0x8c6b('0xf'));var querystring=require('querystring');var Papa=require(_0x8c6b('0x10'));var Redis=require(_0x8c6b('0x11'));var authService=require(_0x8c6b('0x12'));var qs=require(_0x8c6b('0x13'));var as=require(_0x8c6b('0x14'));var hardwareService=require(_0x8c6b('0x15'));var logger=require(_0x8c6b('0x16'))(_0x8c6b('0x17'));var utils=require(_0x8c6b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6afd65,_0x47bfac){_0x47bfac=_0x47bfac||0xcc;return function(_0x14db20){if(_0x14db20){return _0x6afd65[_0x8c6b('0x19')](_0x47bfac);}return _0x6afd65[_0x8c6b('0x1a')](_0x47bfac)['end']();};}function respondWithResult(_0x37379a,_0x34c057){_0x34c057=_0x34c057||0xc8;return function(_0x2d9cdb){if(_0x2d9cdb){return _0x37379a[_0x8c6b('0x1a')](_0x34c057)[_0x8c6b('0x1b')](_0x2d9cdb);}};}function respondWithFilteredResult(_0x3a1650,_0x11c1a2){return function(_0x5f5a44){if(_0x5f5a44){var _0x4c9057=typeof _0x11c1a2[_0x8c6b('0x1c')]===_0x8c6b('0x1d')&&typeof _0x11c1a2['limit']===_0x8c6b('0x1d');var _0x311a72=_0x5f5a44['count'];var _0x4ca668=_0x4c9057?0x0:_0x11c1a2[_0x8c6b('0x1c')];var _0x57d8fd=_0x4c9057?_0x5f5a44[_0x8c6b('0x1e')]:_0x11c1a2[_0x8c6b('0x1c')]+_0x11c1a2[_0x8c6b('0x1f')];var _0x6364c6;if(_0x57d8fd>=_0x311a72){_0x57d8fd=_0x311a72;_0x6364c6=0xc8;}else{_0x6364c6=0xce;}_0x3a1650[_0x8c6b('0x1a')](_0x6364c6);return _0x3a1650[_0x8c6b('0x20')](_0x8c6b('0x21'),_0x4ca668+'-'+_0x57d8fd+'/'+_0x311a72)[_0x8c6b('0x1b')](_0x5f5a44);}return null;};}function patchUpdates(_0x20f6db){return function(_0x26cc44){try{jsonpatch[_0x8c6b('0x22')](_0x26cc44,_0x20f6db,!![]);}catch(_0x306bef){return BPromise['reject'](_0x306bef);}return _0x26cc44[_0x8c6b('0x23')]();};}function saveUpdates(_0x10ae53,_0x2831cf){return function(_0x153973){if(_0x153973){return _0x153973[_0x8c6b('0x24')](_0x10ae53)[_0x8c6b('0x25')](function(_0x59797f){return _0x59797f;});}return null;};}function removeEntity(_0x13722f,_0x2b24b4){return function(_0x1b4ca3){if(_0x1b4ca3){return _0x1b4ca3[_0x8c6b('0x26')]()[_0x8c6b('0x25')](function(){_0x13722f[_0x8c6b('0x1a')](0xcc)[_0x8c6b('0x27')]();});}};}function handleEntityNotFound(_0x591699,_0x3f9656){return function(_0x12ac3c){if(!_0x12ac3c){_0x591699['sendStatus'](0x194);}return _0x12ac3c;};}function handleError(_0x513613,_0x361e5e){_0x361e5e=_0x361e5e||0x1f4;return function(_0xf9ec4a){logger[_0x8c6b('0x28')](_0xf9ec4a[_0x8c6b('0x29')]);if(_0xf9ec4a[_0x8c6b('0x2a')]){delete _0xf9ec4a[_0x8c6b('0x2a')];}_0x513613[_0x8c6b('0x1a')](_0x361e5e)['send'](_0xf9ec4a);};}exports[_0x8c6b('0x2b')]=function(_0x5004b1,_0x2d2d77){var _0x44613f={},_0x3d843c={},_0x62a6e6={'count':0x0,'rows':[]};var _0x3a051b=_[_0x8c6b('0x2c')](db[_0x8c6b('0x2d')][_0x8c6b('0x2e')],function(_0x45830a){return{'name':_0x45830a['fieldName'],'type':_0x45830a['type'][_0x8c6b('0x2f')]};});_0x3d843c['model']=_[_0x8c6b('0x2c')](_0x3a051b,_0x8c6b('0x2a'));_0x3d843c[_0x8c6b('0x30')]=_[_0x8c6b('0x31')](_0x5004b1['query']);_0x3d843c[_0x8c6b('0x32')]=_[_0x8c6b('0x33')](_0x3d843c[_0x8c6b('0x34')],_0x3d843c[_0x8c6b('0x30')]);_0x44613f[_0x8c6b('0x35')]=_['intersection'](_0x3d843c['model'],qs[_0x8c6b('0x36')](_0x5004b1[_0x8c6b('0x30')][_0x8c6b('0x36')]));_0x44613f[_0x8c6b('0x35')]=_0x44613f[_0x8c6b('0x35')][_0x8c6b('0x37')]?_0x44613f[_0x8c6b('0x35')]:_0x3d843c[_0x8c6b('0x34')];if(!_0x5004b1['query'][_0x8c6b('0x38')](_0x8c6b('0x39'))){_0x44613f[_0x8c6b('0x1f')]=qs[_0x8c6b('0x1f')](_0x5004b1['query'][_0x8c6b('0x1f')]);_0x44613f[_0x8c6b('0x1c')]=qs[_0x8c6b('0x1c')](_0x5004b1[_0x8c6b('0x30')]['offset']);}_0x44613f[_0x8c6b('0x3a')]=qs[_0x8c6b('0x3b')](_0x5004b1[_0x8c6b('0x30')][_0x8c6b('0x3b')]);_0x44613f[_0x8c6b('0x3c')]=qs['filters'](_['pick'](_0x5004b1[_0x8c6b('0x30')],_0x3d843c[_0x8c6b('0x32')]),_0x3a051b);if(_0x5004b1[_0x8c6b('0x30')][_0x8c6b('0x3d')]){_0x44613f[_0x8c6b('0x3c')]=_[_0x8c6b('0x3e')](_0x44613f[_0x8c6b('0x3c')],{'$or':_[_0x8c6b('0x2c')](_0x3a051b,function(_0x5acc97){if(_0x5acc97[_0x8c6b('0x3f')]!=='VIRTUAL'){var _0x291602={};_0x291602[_0x5acc97[_0x8c6b('0x2a')]]={'$like':'%'+_0x5004b1['query'][_0x8c6b('0x3d')]+'%'};return _0x291602;}})});}_0x44613f=_[_0x8c6b('0x3e')]({},_0x44613f,_0x5004b1['options']);var _0x23429d={'where':_0x44613f[_0x8c6b('0x3c')]};return db[_0x8c6b('0x2d')][_0x8c6b('0x1e')](_0x23429d)[_0x8c6b('0x25')](function(_0x1f1685){_0x62a6e6[_0x8c6b('0x1e')]=_0x1f1685;if(_0x5004b1[_0x8c6b('0x30')][_0x8c6b('0x40')]){_0x44613f['include']=[{'all':!![]}];}return db[_0x8c6b('0x2d')][_0x8c6b('0x41')](_0x44613f);})['then'](function(_0x47dae4){_0x62a6e6[_0x8c6b('0x42')]=_0x47dae4;return _0x62a6e6;})['then'](respondWithFilteredResult(_0x2d2d77,_0x44613f))[_0x8c6b('0x43')](handleError(_0x2d2d77,null));};exports[_0x8c6b('0x44')]=function(_0x68b5f,_0x510419){var _0x359020={'raw':!![],'where':{'id':_0x68b5f[_0x8c6b('0x45')]['id']}},_0xcb2d53={};_0xcb2d53[_0x8c6b('0x34')]=_[_0x8c6b('0x31')](db[_0x8c6b('0x2d')][_0x8c6b('0x2e')]);_0xcb2d53[_0x8c6b('0x30')]=_['keys'](_0x68b5f[_0x8c6b('0x30')]);_0xcb2d53['filters']=_[_0x8c6b('0x33')](_0xcb2d53[_0x8c6b('0x34')],_0xcb2d53[_0x8c6b('0x30')]);_0x359020[_0x8c6b('0x35')]=_[_0x8c6b('0x33')](_0xcb2d53['model'],qs[_0x8c6b('0x36')](_0x68b5f[_0x8c6b('0x30')][_0x8c6b('0x36')]));_0x359020[_0x8c6b('0x35')]=_0x359020[_0x8c6b('0x35')][_0x8c6b('0x37')]?_0x359020['attributes']:_0xcb2d53[_0x8c6b('0x34')];if(_0x68b5f['query'][_0x8c6b('0x40')]){_0x359020['include']=[{'all':!![]}];}_0x359020=_['merge']({},_0x359020,_0x68b5f[_0x8c6b('0x46')]);return db['MailTransferReport']['find'](_0x359020)[_0x8c6b('0x25')](handleEntityNotFound(_0x510419,null))['then'](respondWithResult(_0x510419,null))[_0x8c6b('0x43')](handleError(_0x510419,null));};exports['create']=function(_0x39d3b9,_0x381767){return db[_0x8c6b('0x2d')][_0x8c6b('0x47')](_0x39d3b9['body'],{})['then'](respondWithResult(_0x381767,0xc9))[_0x8c6b('0x43')](handleError(_0x381767,null));};exports[_0x8c6b('0x24')]=function(_0x14f847,_0x2ac520){if(_0x14f847['body']['id']){delete _0x14f847[_0x8c6b('0x48')]['id'];}return db[_0x8c6b('0x2d')][_0x8c6b('0x49')]({'where':{'id':_0x14f847[_0x8c6b('0x45')]['id']}})[_0x8c6b('0x25')](handleEntityNotFound(_0x2ac520,null))[_0x8c6b('0x25')](saveUpdates(_0x14f847[_0x8c6b('0x48')],null))[_0x8c6b('0x25')](respondWithResult(_0x2ac520,null))[_0x8c6b('0x43')](handleError(_0x2ac520,null));};exports[_0x8c6b('0x26')]=function(_0x45c6a1,_0x18e5f1){return db[_0x8c6b('0x2d')][_0x8c6b('0x49')]({'where':{'id':_0x45c6a1[_0x8c6b('0x45')]['id']}})['then'](handleEntityNotFound(_0x18e5f1,null))[_0x8c6b('0x25')](removeEntity(_0x18e5f1,null))[_0x8c6b('0x43')](handleError(_0x18e5f1,null));};exports[_0x8c6b('0x4a')]=function(_0x380cc5,_0x4c8245){return db['MailTransferReport']['describe']()[_0x8c6b('0x25')](respondWithResult(_0x4c8245,null))[_0x8c6b('0x43')](handleError(_0x4c8245,null));}; \ No newline at end of file +var _0xe667=['send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','rows','params','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','error','name'];(function(_0xc14e9b,_0x5c3047){var _0x48f298=function(_0x3ddc68){while(--_0x3ddc68){_0xc14e9b['push'](_0xc14e9b['shift']());}};_0x48f298(++_0x5c3047);}(_0xe667,0x1d2));var _0x7e66=function(_0x5df2e8,_0x1ceac8){_0x5df2e8=_0x5df2e8-0x0;var _0x4e25bf=_0xe667[_0x5df2e8];return _0x4e25bf;};'use strict';var emlformat=require(_0x7e66('0x0'));var rimraf=require(_0x7e66('0x1'));var zipdir=require(_0x7e66('0x2'));var jsonpatch=require(_0x7e66('0x3'));var rp=require('request-promise');var moment=require(_0x7e66('0x4'));var BPromise=require(_0x7e66('0x5'));var Mustache=require('mustache');var util=require(_0x7e66('0x6'));var path=require(_0x7e66('0x7'));var sox=require(_0x7e66('0x8'));var csv=require(_0x7e66('0x9'));var ejs=require(_0x7e66('0xa'));var fs=require('fs');var fs_extra=require(_0x7e66('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7e66('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7e66('0xd'));var toCsv=require(_0x7e66('0x9'));var querystring=require(_0x7e66('0xe'));var Papa=require(_0x7e66('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e66('0x10'));var as=require(_0x7e66('0x11'));var hardwareService=require(_0x7e66('0x12'));var logger=require('../../config/logger')(_0x7e66('0x13'));var utils=require(_0x7e66('0x14'));var config=require(_0x7e66('0x15'));var licenseUtil=require(_0x7e66('0x16'));var db=require(_0x7e66('0x17'))['db'];function respondWithStatusCode(_0x4a2769,_0x3c77ed){_0x3c77ed=_0x3c77ed||0xcc;return function(_0x551f5c){if(_0x551f5c){return _0x4a2769['sendStatus'](_0x3c77ed);}return _0x4a2769['status'](_0x3c77ed)[_0x7e66('0x18')]();};}function respondWithResult(_0x7a814a,_0x330a4a){_0x330a4a=_0x330a4a||0xc8;return function(_0x3c0162){if(_0x3c0162){return _0x7a814a[_0x7e66('0x19')](_0x330a4a)[_0x7e66('0x1a')](_0x3c0162);}};}function respondWithFilteredResult(_0x17ad7e,_0xe20ef7){return function(_0x427886){if(_0x427886){var _0x423be3=typeof _0xe20ef7['offset']===_0x7e66('0x1b')&&typeof _0xe20ef7[_0x7e66('0x1c')]===_0x7e66('0x1b');var _0x385263=_0x427886[_0x7e66('0x1d')];var _0x48baa5=_0x423be3?0x0:_0xe20ef7['offset'];var _0x595b1a=_0x423be3?_0x427886[_0x7e66('0x1d')]:_0xe20ef7[_0x7e66('0x1e')]+_0xe20ef7[_0x7e66('0x1c')];var _0x165d33;if(_0x595b1a>=_0x385263){_0x595b1a=_0x385263;_0x165d33=0xc8;}else{_0x165d33=0xce;}_0x17ad7e['status'](_0x165d33);return _0x17ad7e[_0x7e66('0x1f')](_0x7e66('0x20'),_0x48baa5+'-'+_0x595b1a+'/'+_0x385263)['json'](_0x427886);}return null;};}function patchUpdates(_0xedd302){return function(_0x197d32){try{jsonpatch[_0x7e66('0x21')](_0x197d32,_0xedd302,!![]);}catch(_0x9f0a1e){return BPromise['reject'](_0x9f0a1e);}return _0x197d32['save']();};}function saveUpdates(_0x21f5c9,_0x1f67a8){return function(_0x376854){if(_0x376854){return _0x376854['update'](_0x21f5c9)[_0x7e66('0x22')](function(_0x313a76){return _0x313a76;});}return null;};}function removeEntity(_0x3097f5,_0x324b99){return function(_0x3d1b61){if(_0x3d1b61){return _0x3d1b61[_0x7e66('0x23')]()[_0x7e66('0x22')](function(){_0x3097f5[_0x7e66('0x19')](0xcc)[_0x7e66('0x18')]();});}};}function handleEntityNotFound(_0x323bb1,_0x17aa20){return function(_0x51c517){if(!_0x51c517){_0x323bb1['sendStatus'](0x194);}return _0x51c517;};}function handleError(_0x1d3913,_0x170756){_0x170756=_0x170756||0x1f4;return function(_0x20b2e3){logger[_0x7e66('0x24')](_0x20b2e3['stack']);if(_0x20b2e3['name']){delete _0x20b2e3[_0x7e66('0x25')];}_0x1d3913[_0x7e66('0x19')](_0x170756)[_0x7e66('0x26')](_0x20b2e3);};}exports[_0x7e66('0x27')]=function(_0x3b0ff6,_0x2d64e4){var _0x533efd={},_0x4c9525={},_0x4e998b={'count':0x0,'rows':[]};var _0xe658b9=_[_0x7e66('0x28')](db[_0x7e66('0x29')][_0x7e66('0x2a')],function(_0x338941){return{'name':_0x338941[_0x7e66('0x2b')],'type':_0x338941[_0x7e66('0x2c')][_0x7e66('0x2d')]};});_0x4c9525[_0x7e66('0x2e')]=_['map'](_0xe658b9,_0x7e66('0x25'));_0x4c9525[_0x7e66('0x2f')]=_[_0x7e66('0x30')](_0x3b0ff6[_0x7e66('0x2f')]);_0x4c9525[_0x7e66('0x31')]=_[_0x7e66('0x32')](_0x4c9525[_0x7e66('0x2e')],_0x4c9525[_0x7e66('0x2f')]);_0x533efd[_0x7e66('0x33')]=_[_0x7e66('0x32')](_0x4c9525[_0x7e66('0x2e')],qs[_0x7e66('0x34')](_0x3b0ff6[_0x7e66('0x2f')][_0x7e66('0x34')]));_0x533efd[_0x7e66('0x33')]=_0x533efd[_0x7e66('0x33')][_0x7e66('0x35')]?_0x533efd[_0x7e66('0x33')]:_0x4c9525[_0x7e66('0x2e')];if(!_0x3b0ff6['query'][_0x7e66('0x36')](_0x7e66('0x37'))){_0x533efd[_0x7e66('0x1c')]=qs[_0x7e66('0x1c')](_0x3b0ff6[_0x7e66('0x2f')][_0x7e66('0x1c')]);_0x533efd[_0x7e66('0x1e')]=qs[_0x7e66('0x1e')](_0x3b0ff6['query']['offset']);}_0x533efd['order']=qs['sort'](_0x3b0ff6[_0x7e66('0x2f')][_0x7e66('0x38')]);_0x533efd[_0x7e66('0x39')]=qs[_0x7e66('0x31')](_[_0x7e66('0x3a')](_0x3b0ff6['query'],_0x4c9525[_0x7e66('0x31')]),_0xe658b9);if(_0x3b0ff6[_0x7e66('0x2f')]['filter']){_0x533efd[_0x7e66('0x39')]=_[_0x7e66('0x3b')](_0x533efd[_0x7e66('0x39')],{'$or':_[_0x7e66('0x28')](_0xe658b9,function(_0x5cd149){if(_0x5cd149[_0x7e66('0x2c')]!=='VIRTUAL'){var _0x274130={};_0x274130[_0x5cd149['name']]={'$like':'%'+_0x3b0ff6[_0x7e66('0x2f')][_0x7e66('0x3c')]+'%'};return _0x274130;}})});}_0x533efd=_[_0x7e66('0x3b')]({},_0x533efd,_0x3b0ff6[_0x7e66('0x3d')]);var _0x5b041e={'where':_0x533efd['where']};return db['MailTransferReport'][_0x7e66('0x1d')](_0x5b041e)[_0x7e66('0x22')](function(_0x1409eb){_0x4e998b[_0x7e66('0x1d')]=_0x1409eb;if(_0x3b0ff6['query'][_0x7e66('0x3e')]){_0x533efd[_0x7e66('0x3f')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x533efd);})['then'](function(_0x586934){_0x4e998b[_0x7e66('0x40')]=_0x586934;return _0x4e998b;})[_0x7e66('0x22')](respondWithFilteredResult(_0x2d64e4,_0x533efd))['catch'](handleError(_0x2d64e4,null));};exports['show']=function(_0x1ab7c6,_0x58ab84){var _0xd79896={'raw':!![],'where':{'id':_0x1ab7c6[_0x7e66('0x41')]['id']}},_0x330d11={};_0x330d11[_0x7e66('0x2e')]=_[_0x7e66('0x30')](db[_0x7e66('0x29')][_0x7e66('0x2a')]);_0x330d11[_0x7e66('0x2f')]=_[_0x7e66('0x30')](_0x1ab7c6['query']);_0x330d11[_0x7e66('0x31')]=_[_0x7e66('0x32')](_0x330d11[_0x7e66('0x2e')],_0x330d11[_0x7e66('0x2f')]);_0xd79896[_0x7e66('0x33')]=_[_0x7e66('0x32')](_0x330d11[_0x7e66('0x2e')],qs['fields'](_0x1ab7c6[_0x7e66('0x2f')][_0x7e66('0x34')]));_0xd79896[_0x7e66('0x33')]=_0xd79896[_0x7e66('0x33')][_0x7e66('0x35')]?_0xd79896[_0x7e66('0x33')]:_0x330d11[_0x7e66('0x2e')];if(_0x1ab7c6[_0x7e66('0x2f')][_0x7e66('0x3e')]){_0xd79896[_0x7e66('0x3f')]=[{'all':!![]}];}_0xd79896=_[_0x7e66('0x3b')]({},_0xd79896,_0x1ab7c6[_0x7e66('0x3d')]);return db[_0x7e66('0x29')]['find'](_0xd79896)[_0x7e66('0x22')](handleEntityNotFound(_0x58ab84,null))[_0x7e66('0x22')](respondWithResult(_0x58ab84,null))[_0x7e66('0x42')](handleError(_0x58ab84,null));};exports[_0x7e66('0x43')]=function(_0x3fc3af,_0x1f998a){return db[_0x7e66('0x29')]['create'](_0x3fc3af[_0x7e66('0x44')],{})[_0x7e66('0x22')](respondWithResult(_0x1f998a,0xc9))[_0x7e66('0x42')](handleError(_0x1f998a,null));};exports[_0x7e66('0x45')]=function(_0x2e8c76,_0x3dcefc){if(_0x2e8c76[_0x7e66('0x44')]['id']){delete _0x2e8c76[_0x7e66('0x44')]['id'];}return db[_0x7e66('0x29')][_0x7e66('0x46')]({'where':{'id':_0x2e8c76['params']['id']}})['then'](handleEntityNotFound(_0x3dcefc,null))[_0x7e66('0x22')](saveUpdates(_0x2e8c76['body'],null))['then'](respondWithResult(_0x3dcefc,null))[_0x7e66('0x42')](handleError(_0x3dcefc,null));};exports[_0x7e66('0x23')]=function(_0x286bd5,_0x49a0d1){return db[_0x7e66('0x29')][_0x7e66('0x46')]({'where':{'id':_0x286bd5['params']['id']}})[_0x7e66('0x22')](handleEntityNotFound(_0x49a0d1,null))[_0x7e66('0x22')](removeEntity(_0x49a0d1,null))['catch'](handleError(_0x49a0d1,null));};exports[_0x7e66('0x47')]=function(_0x305141,_0x519618){return db['MailTransferReport'][_0x7e66('0x47')]()[_0x7e66('0x22')](respondWithResult(_0x519618,null))[_0x7e66('0x42')](handleError(_0x519618,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index b243344..bdf1261 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 _0x5697=['./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x5697,0x1b5));var _0x7569=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0x5697[_0x483e3a];return _0x43fca9;};'use strict';var _=require(_0x7569('0x0'));var util=require('util');var logger=require(_0x7569('0x1'))(_0x7569('0x2'));var moment=require(_0x7569('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7569('0x4'));module['exports']=function(_0x5705bd,_0x5afe12){return _0x5705bd[_0x7569('0x5')](_0x7569('0x6'),attributes,{'tableName':_0x7569('0x7'),'paranoid':![],'indexes':[{'name':_0x7569('0x8'),'fields':[_0x7569('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1979=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x7fa7b2,_0x19ce9c){var _0x35a9b5=function(_0x115fbd){while(--_0x115fbd){_0x7fa7b2['push'](_0x7fa7b2['shift']());}};_0x35a9b5(++_0x19ce9c);}(_0x1979,0xa2));var _0x9197=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x1979[_0x36a469];return _0x3347fc;};'use strict';var _=require(_0x9197('0x0'));var util=require('util');var logger=require(_0x9197('0x1'))('api');var moment=require(_0x9197('0x2'));var BPromise=require(_0x9197('0x3'));var rp=require(_0x9197('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9197('0x5'));var attributes=require(_0x9197('0x6'));module[_0x9197('0x7')]=function(_0x52bc6d,_0x3620f7){return _0x52bc6d[_0x9197('0x8')](_0x9197('0x9'),attributes,{'tableName':_0x9197('0xa'),'paranoid':![],'indexes':[{'name':_0x9197('0xb'),'fields':[_0x9197('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 0e9e62e..2308f55 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 _0x0b6e=['../../config/utils','../../config/logger','../../config/environment','http','then','info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0x0b6e,0x11f));var _0xe0b6=function(_0x14ccb0,_0x2cf815){_0x14ccb0=_0x14ccb0-0x0;var _0x44cfef=_0x0b6e[_0x14ccb0];return _0x44cfef;};'use strict';var _=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var moment=require(_0xe0b6('0x2'));var BPromise=require(_0xe0b6('0x3'));var rs=require(_0xe0b6('0x4'));var fs=require('fs');var Redis=require(_0xe0b6('0x5'));var db=require(_0xe0b6('0x6'))['db'];var utils=require(_0xe0b6('0x7'));var logger=require(_0xe0b6('0x8'))('rpc');var config=require(_0xe0b6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe0b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52c623,_0x578e46,_0x3a5b9a){return new BPromise(function(_0x3ffd68,_0x5e2d4b){return client['request'](_0x52c623,_0x3a5b9a)[_0xe0b6('0xb')](function(_0x2d7e0e){logger[_0xe0b6('0xc')](_0xe0b6('0xd'),_0x578e46,'request\x20sent');logger[_0xe0b6('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x578e46,_0xe0b6('0xf'),JSON[_0xe0b6('0x10')](_0x2d7e0e));if(_0x2d7e0e['error']){if(_0x2d7e0e['error'][_0xe0b6('0x11')]===0x1f4){logger[_0xe0b6('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x578e46,_0x2d7e0e[_0xe0b6('0x12')]['message']);return _0x5e2d4b(_0x2d7e0e[_0xe0b6('0x12')][_0xe0b6('0x13')]);}logger[_0xe0b6('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x578e46,_0x2d7e0e['error'][_0xe0b6('0x13')]);return _0x3ffd68(_0x2d7e0e[_0xe0b6('0x12')][_0xe0b6('0x13')]);}else{logger['info'](_0xe0b6('0xd'),_0x578e46,'request\x20sent');_0x3ffd68(_0x2d7e0e['result'][_0xe0b6('0x13')]);}})[_0xe0b6('0x14')](function(_0x1773b4){logger[_0xe0b6('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x578e46,_0x1773b4);_0x5e2d4b(_0x1773b4);});});} \ No newline at end of file +var _0x868e=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x5088d4,_0xe41ec6){var _0x1b0d34=function(_0x36ff46){while(--_0x36ff46){_0x5088d4['push'](_0x5088d4['shift']());}};_0x1b0d34(++_0xe41ec6);}(_0x868e,0x14c));var _0xe868=function(_0x2ab512,_0x4f38fe){_0x2ab512=_0x2ab512-0x0;var _0x59ad50=_0x868e[_0x2ab512];return _0x59ad50;};'use strict';var _=require(_0xe868('0x0'));var util=require(_0xe868('0x1'));var moment=require(_0xe868('0x2'));var BPromise=require(_0xe868('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe868('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe868('0x5'));var logger=require('../../config/logger')(_0xe868('0x6'));var config=require(_0xe868('0x7'));var jayson=require(_0xe868('0x8'));var client=jayson[_0xe868('0x9')][_0xe868('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a0b43,_0x20ff8f,_0x4ecbcf){return new BPromise(function(_0x1db3b4,_0x2af178){return client['request'](_0x2a0b43,_0x4ecbcf)['then'](function(_0x4d726b){logger['info'](_0xe868('0xb'),_0x20ff8f,'request\x20sent');logger[_0xe868('0xc')](_0xe868('0xd'),_0x20ff8f,_0xe868('0xe'),JSON[_0xe868('0xf')](_0x4d726b));if(_0x4d726b[_0xe868('0x10')]){if(_0x4d726b[_0xe868('0x10')][_0xe868('0x11')]===0x1f4){logger[_0xe868('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x20ff8f,_0x4d726b[_0xe868('0x10')][_0xe868('0x12')]);return _0x2af178(_0x4d726b['error']['message']);}logger['error'](_0xe868('0xb'),_0x20ff8f,_0x4d726b[_0xe868('0x10')][_0xe868('0x12')]);return _0x1db3b4(_0x4d726b[_0xe868('0x10')][_0xe868('0x12')]);}else{logger[_0xe868('0x13')](_0xe868('0xb'),_0x20ff8f,_0xe868('0xe'));_0x1db3b4(_0x4d726b[_0xe868('0x14')][_0xe868('0x12')]);}})[_0xe868('0x15')](function(_0x4bbea0){logger[_0xe868('0x10')](_0xe868('0xb'),_0x20ff8f,_0x4bbea0);_0x2af178(_0x4bbea0);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 8a6e974..a47f290 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 _0xa91a=['destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update'];(function(_0x454043,_0x124652){var _0x183c52=function(_0x1432d4){while(--_0x1432d4){_0x454043['push'](_0x454043['shift']());}};_0x183c52(++_0x124652);}(_0xa91a,0x157));var _0xaa91=function(_0x4fe468,_0x39131e){_0x4fe468=_0x4fe468-0x0;var _0x2de424=_0xa91a[_0x4fe468];return _0x2de424;};'use strict';var multer=require(_0xaa91('0x0'));var util=require(_0xaa91('0x1'));var path=require(_0xaa91('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa91('0x3'));var router=express['Router']();var fs_extra=require(_0xaa91('0x4'));var auth=require(_0xaa91('0x5'));var interaction=require(_0xaa91('0x6'));var config=require(_0xaa91('0x7'));var controller=require(_0xaa91('0x8'));router[_0xaa91('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa91('0xa')]);router[_0xaa91('0x9')]('/describe',auth[_0xaa91('0xb')](),controller[_0xaa91('0xc')]);router[_0xaa91('0x9')](_0xaa91('0xd'),auth[_0xaa91('0xb')](),controller[_0xaa91('0xe')]);router['post']('/',auth[_0xaa91('0xb')](),controller[_0xaa91('0xf')]);router[_0xaa91('0x10')](_0xaa91('0xd'),auth[_0xaa91('0xb')](),controller[_0xaa91('0x11')]);router['delete']('/:id',auth[_0xaa91('0xb')](),controller[_0xaa91('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc7e2=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','multer'];(function(_0x1c3407,_0x3b5d54){var _0x3f8aff=function(_0x5b55f9){while(--_0x5b55f9){_0x1c3407['push'](_0x1c3407['shift']());}};_0x3f8aff(++_0x3b5d54);}(_0xc7e2,0xb3));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2c7e('0x0'));var util=require(_0x2c7e('0x1'));var path=require('path');var timeout=require(_0x2c7e('0x2'));var express=require(_0x2c7e('0x3'));var router=express['Router']();var fs_extra=require(_0x2c7e('0x4'));var auth=require(_0x2c7e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c7e('0x6'));var controller=require(_0x2c7e('0x7'));router[_0x2c7e('0x8')]('/',auth[_0x2c7e('0x9')](),controller[_0x2c7e('0xa')]);router['get']('/describe',auth[_0x2c7e('0x9')](),controller['describe']);router[_0x2c7e('0x8')]('/:id',auth[_0x2c7e('0x9')](),controller[_0x2c7e('0xb')]);router[_0x2c7e('0xc')]('/',auth[_0x2c7e('0x9')](),controller[_0x2c7e('0xd')]);router[_0x2c7e('0xe')](_0x2c7e('0xf'),auth[_0x2c7e('0x9')](),controller[_0x2c7e('0x10')]);router[_0x2c7e('0x11')](_0x2c7e('0xf'),auth['isAuthenticated'](),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 2845546..d16df56 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 _0xa329=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER'];(function(_0xb7ecc2,_0x1609d4){var _0x35e4d1=function(_0x5f34f7){while(--_0x5f34f7){_0xb7ecc2['push'](_0xb7ecc2['shift']());}};_0x35e4d1(++_0x1609d4);}(_0xa329,0x144));var _0x9a32=function(_0x2b857c,_0x220756){_0x2b857c=_0x2b857c-0x0;var _0x43e2af=_0xa329[_0x2b857c];return _0x43e2af;};'use strict';var Sequelize=require(_0x9a32('0x0'));var moment=require(_0x9a32('0x1'));module[_0x9a32('0x2')]={'channel':{'type':Sequelize[_0x9a32('0x3')]},'membername':{'type':Sequelize[_0x9a32('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9a32('0x3')],'defaultValue':_0x9a32('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x9a32('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4609a9){var _0x279998=moment(_0x4609a9);var _0xfe2f8d=moment(this[_0x9a32('0x6')](_0x9a32('0x7')));var _0x4fb9f2=_0x279998[_0x9a32('0x8')](_0xfe2f8d,_0x9a32('0x9'));this[_0x9a32('0xa')](_0x9a32('0xb'),_0x4609a9);this[_0x9a32('0xa')]('duration',_0x4fb9f2>=0x0?_0x4fb9f2:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9a32('0x3')],'comment':_0x9a32('0xc')},'data3':{'type':Sequelize[_0x9a32('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x9a32('0x3')],'comment':_0x9a32('0xd')},'data5':{'type':Sequelize[_0x9a32('0x3')],'comment':_0x9a32('0xe')},'role':{'type':Sequelize[_0x9a32('0x3')]},'internal':{'type':Sequelize[_0x9a32('0x5')]},'uniqueid':{'type':Sequelize[_0x9a32('0x3')]}}; \ No newline at end of file +var _0xaf72=['seconds','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff'];(function(_0x33f0ea,_0x3df8d2){var _0x6a02c5=function(_0x30970d){while(--_0x30970d){_0x33f0ea['push'](_0x33f0ea['shift']());}};_0x6a02c5(++_0x3df8d2);}(_0xaf72,0x1a6));var _0x2af7=function(_0x11c99a,_0x24e6e7){_0x11c99a=_0x11c99a-0x0;var _0x51f8a7=_0xaf72[_0x11c99a];return _0x51f8a7;};'use strict';var Sequelize=require(_0x2af7('0x0'));var moment=require('moment');module[_0x2af7('0x1')]={'channel':{'type':Sequelize[_0x2af7('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2af7('0x2')],'defaultValue':_0x2af7('0x3'),'comment':_0x2af7('0x4')},'duration':{'type':Sequelize[_0x2af7('0x5')]},'enterAt':{'type':Sequelize[_0x2af7('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4f5800){var _0x99de8a=moment(_0x4f5800);var _0x50929c=moment(this[_0x2af7('0x7')](_0x2af7('0x8')));var _0x3629d2=_0x99de8a[_0x2af7('0x9')](_0x50929c,_0x2af7('0xa'));this['setDataValue']('exitAt',_0x4f5800);this['setDataValue'](_0x2af7('0xb'),_0x3629d2>=0x0?_0x3629d2:null);}},'data1':{'type':Sequelize[_0x2af7('0x2')],'comment':_0x2af7('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x2af7('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2af7('0x2')],'comment':_0x2af7('0xe')},'data5':{'type':Sequelize[_0x2af7('0x2')],'comment':_0x2af7('0xf')},'role':{'type':Sequelize[_0x2af7('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2af7('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f97670f..5576e8f 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x34e8,0x12c));var _0x834e=function(_0x416193,_0x13c64d){_0x416193=_0x416193-0x0;var _0x4169c5=_0x34e8[_0x416193];return _0x4169c5;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x543f82,_0x11b3b8){var _0x52313c=function(_0x4060d9){while(--_0x4060d9){_0x543f82['push'](_0x543f82['shift']());}};_0x52313c(++_0x11b3b8);}(_0x7217,0x19e));var _0x7721=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x7217[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 384fa12..57aa29a 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 _0x7756=['define','MemberReport','report_member','membername_interface','interface','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x123bbd,_0x23a032){var _0x3d0da4=function(_0x1ab17b){while(--_0x1ab17b){_0x123bbd['push'](_0x123bbd['shift']());}};_0x3d0da4(++_0x23a032);}(_0x7756,0x131));var _0x6775=function(_0x5bf474,_0x1803ea){_0x5bf474=_0x5bf474-0x0;var _0x5debda=_0x7756[_0x5bf474];return _0x5debda;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6775('0x0'))(_0x6775('0x1'));var moment=require(_0x6775('0x2'));var BPromise=require(_0x6775('0x3'));var rp=require(_0x6775('0x4'));var fs=require('fs');var path=require(_0x6775('0x5'));var rimraf=require(_0x6775('0x6'));var config=require(_0x6775('0x7'));var attributes=require(_0x6775('0x8'));module[_0x6775('0x9')]=function(_0x13edd3,_0x188e1f){return _0x13edd3[_0x6775('0xa')](_0x6775('0xb'),attributes,{'tableName':_0x6775('0xc'),'paranoid':![],'indexes':[{'name':_0x6775('0xd'),'fields':['membername',_0x6775('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5776=['../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x5776,0x17d));var _0x6577=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5776[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6577('0x0'));var util=require(_0x6577('0x1'));var logger=require(_0x6577('0x2'))(_0x6577('0x3'));var moment=require(_0x6577('0x4'));var BPromise=require(_0x6577('0x5'));var rp=require(_0x6577('0x6'));var fs=require('fs');var path=require(_0x6577('0x7'));var rimraf=require(_0x6577('0x8'));var config=require(_0x6577('0x9'));var attributes=require(_0x6577('0xa'));module['exports']=function(_0x240cde,_0x6647b2){return _0x240cde['define'](_0x6577('0xb'),attributes,{'tableName':_0x6577('0xc'),'paranoid':![],'indexes':[{'name':_0x6577('0xd'),'fields':['membername',_0x6577('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 87760c2..9074d40 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 _0xde81=['MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','where','attributes','include','map','model','then','GetMemberReport','CreateMemberReport','MemberReport','create','body','raw','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','debug'];(function(_0x49dcb7,_0x360602){var _0xaa711c=function(_0x42bda1){while(--_0x42bda1){_0x49dcb7['push'](_0x49dcb7['shift']());}};_0xaa711c(++_0x360602);}(_0xde81,0x109));var _0x1de8=function(_0x10dd9e,_0x318ec5){_0x10dd9e=_0x10dd9e-0x0;var _0x56c587=_0xde81[_0x10dd9e];return _0x56c587;};'use strict';var _=require(_0x1de8('0x0'));var util=require(_0x1de8('0x1'));var moment=require(_0x1de8('0x2'));var BPromise=require(_0x1de8('0x3'));var rs=require(_0x1de8('0x4'));var fs=require('fs');var Redis=require(_0x1de8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1de8('0x6'))('rpc');var config=require(_0x1de8('0x7'));var jayson=require(_0x1de8('0x8'));var client=jayson[_0x1de8('0x9')][_0x1de8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22918e,_0x342ed9,_0x435404){return new BPromise(function(_0x5ae9ca,_0x510b1b){return client[_0x1de8('0xb')](_0x22918e,_0x435404)['then'](function(_0xf214d1){logger[_0x1de8('0xc')](_0x1de8('0xd'),_0x342ed9,'request\x20sent');logger[_0x1de8('0xe')](_0x1de8('0xf'),_0x342ed9,_0x1de8('0x10'),JSON[_0x1de8('0x11')](_0xf214d1));if(_0xf214d1[_0x1de8('0x12')]){if(_0xf214d1[_0x1de8('0x12')][_0x1de8('0x13')]===0x1f4){logger[_0x1de8('0x12')](_0x1de8('0xd'),_0x342ed9,_0xf214d1[_0x1de8('0x12')]['message']);return _0x510b1b(_0xf214d1[_0x1de8('0x12')]['message']);}logger[_0x1de8('0x12')](_0x1de8('0xd'),_0x342ed9,_0xf214d1['error']['message']);return _0x5ae9ca(_0xf214d1[_0x1de8('0x12')][_0x1de8('0x14')]);}else{logger[_0x1de8('0xc')](_0x1de8('0xd'),_0x342ed9,'request\x20sent');_0x5ae9ca(_0xf214d1[_0x1de8('0x15')][_0x1de8('0x14')]);}})[_0x1de8('0x16')](function(_0x4d5fbc){logger[_0x1de8('0x12')](_0x1de8('0xd'),_0x342ed9,_0x4d5fbc);_0x510b1b(_0x4d5fbc);});});}exports['GetMemberReport']=function(_0x322b64){var _0x59a24d=this;return new Promise(function(_0x4b166c,_0x4758b3){return db['MemberReport'][_0x1de8('0x17')]({'raw':_0x322b64[_0x1de8('0x18')]?_0x322b64[_0x1de8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x322b64[_0x1de8('0x18')]?_0x322b64[_0x1de8('0x18')][_0x1de8('0x19')]||null:null,'attributes':_0x322b64[_0x1de8('0x18')]?_0x322b64[_0x1de8('0x18')][_0x1de8('0x1a')]||null:null,'limit':_0x322b64[_0x1de8('0x18')]?_0x322b64[_0x1de8('0x18')]['limit']||null:null,'include':_0x322b64[_0x1de8('0x18')]?_0x322b64[_0x1de8('0x18')][_0x1de8('0x1b')]?_[_0x1de8('0x1c')](_0x322b64[_0x1de8('0x18')][_0x1de8('0x1b')],function(_0x116942){return{'model':db[_0x116942['model']],'as':_0x116942['as'],'attributes':_0x116942[_0x1de8('0x1a')],'include':_0x116942['include']?_['map'](_0x116942[_0x1de8('0x1b')],function(_0x4600c7){return{'model':db[_0x4600c7[_0x1de8('0x1d')]],'as':_0x4600c7['as'],'attributes':_0x4600c7[_0x1de8('0x1a')],'include':_0x4600c7[_0x1de8('0x1b')]?_[_0x1de8('0x1c')](_0x4600c7[_0x1de8('0x1b')],function(_0x49f8a6){return{'model':db[_0x49f8a6[_0x1de8('0x1d')]],'as':_0x49f8a6['as'],'attributes':_0x49f8a6[_0x1de8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1de8('0x1e')](function(_0x1b8870){logger[_0x1de8('0xc')]('GetMemberReport',_0x322b64);logger['debug'](_0x1de8('0x1f'),_0x322b64,JSON[_0x1de8('0x11')](_0x1b8870));_0x4b166c(_0x1b8870);})[_0x1de8('0x16')](function(_0x2bd4b7){logger['error'](_0x1de8('0x1f'),_0x2bd4b7[_0x1de8('0x14')],_0x322b64);_0x4758b3(_0x59a24d['error'](0x1f4,_0x2bd4b7[_0x1de8('0x14')]));});});};exports[_0x1de8('0x20')]=function(_0x3d7ae0){var _0xc1912f=this;return new Promise(function(_0x125535,_0x287527){return db[_0x1de8('0x21')][_0x1de8('0x22')](_0x3d7ae0[_0x1de8('0x23')],{'raw':_0x3d7ae0[_0x1de8('0x18')]?_0x3d7ae0[_0x1de8('0x18')][_0x1de8('0x24')]===undefined?!![]:![]:!![]})[_0x1de8('0x1e')](function(_0x3f4888){logger[_0x1de8('0xc')]('CreateMemberReport',_0x3d7ae0);logger[_0x1de8('0xe')](_0x1de8('0x20'),_0x3d7ae0,JSON[_0x1de8('0x11')](_0x3f4888));_0x125535(_0x3f4888);})[_0x1de8('0x16')](function(_0x1a20eb){logger[_0x1de8('0x12')]('CreateMemberReport',_0x1a20eb['message'],_0x3d7ae0);_0x287527(_0xc1912f[_0x1de8('0x12')](0x1f4,_0x1a20eb[_0x1de8('0x14')]));});});};exports[_0x1de8('0x25')]=function(_0x11a3fd){var _0x1bbae3=this;return new Promise(function(_0x5f290b,_0x1c7009){return db['MemberReport'][_0x1de8('0x26')](_0x11a3fd[_0x1de8('0x23')],{'raw':_0x11a3fd[_0x1de8('0x18')]?_0x11a3fd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11a3fd[_0x1de8('0x18')]?_0x11a3fd[_0x1de8('0x18')][_0x1de8('0x19')]||null:null,'attributes':_0x11a3fd['options']?_0x11a3fd['options'][_0x1de8('0x1a')]||null:null,'limit':_0x11a3fd[_0x1de8('0x18')]?_0x11a3fd[_0x1de8('0x18')][_0x1de8('0x27')]||null:null})['then'](function(_0x40d62d){logger[_0x1de8('0xc')](_0x1de8('0x25'),_0x11a3fd);logger[_0x1de8('0xe')](_0x1de8('0x25'),_0x11a3fd,JSON[_0x1de8('0x11')](_0x40d62d));_0x5f290b(_0x40d62d);})[_0x1de8('0x16')](function(_0x47f62c){logger[_0x1de8('0x12')]('UpdateMemberReport',_0x47f62c['message'],_0x11a3fd);_0x1c7009(_0x1bbae3[_0x1de8('0x12')](0x1f4,_0x47f62c[_0x1de8('0x14')]));});});}; \ No newline at end of file +var _0x23f4=['MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','map','include','model','create','body','then','CreateMemberReport','UpdateMemberReport','MemberReport','update','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MemberReport,\x20%s,\x20%s','debug'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x23f4,0x1ee));var _0x423f=function(_0x76eae9,_0x54e7fe){_0x76eae9=_0x76eae9-0x0;var _0x2d06e2=_0x23f4[_0x76eae9];return _0x2d06e2;};'use strict';var _=require('lodash');var util=require(_0x423f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x423f('0x1'));var fs=require('fs');var Redis=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];var utils=require(_0x423f('0x4'));var logger=require(_0x423f('0x5'))(_0x423f('0x6'));var config=require(_0x423f('0x7'));var jayson=require(_0x423f('0x8'));var client=jayson[_0x423f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x260eae,_0x47716d,_0x55258d){return new BPromise(function(_0x727b4e,_0x416fb1){return client[_0x423f('0xa')](_0x260eae,_0x55258d)['then'](function(_0x5b5ee6){logger['info'](_0x423f('0xb'),_0x47716d,'request\x20sent');logger[_0x423f('0xc')](_0x423f('0xd'),_0x47716d,_0x423f('0xe'),JSON[_0x423f('0xf')](_0x5b5ee6));if(_0x5b5ee6['error']){if(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x11')]===0x1f4){logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x5b5ee6[_0x423f('0x10')]['message']);return _0x416fb1(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);}logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);return _0x727b4e(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);}else{logger[_0x423f('0x13')](_0x423f('0xb'),_0x47716d,_0x423f('0xe'));_0x727b4e(_0x5b5ee6[_0x423f('0x14')][_0x423f('0x12')]);}})[_0x423f('0x15')](function(_0x9d1487){logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x9d1487);_0x416fb1(_0x9d1487);});});}exports[_0x423f('0x16')]=function(_0x26b6d1){var _0x5424e6=this;return new Promise(function(_0x99435f,_0x569fd0){return db['MemberReport'][_0x423f('0x17')]({'raw':_0x26b6d1['options']?_0x26b6d1[_0x423f('0x18')][_0x423f('0x19')]===undefined?!![]:![]:!![],'where':_0x26b6d1['options']?_0x26b6d1[_0x423f('0x18')][_0x423f('0x1a')]||null:null,'attributes':_0x26b6d1['options']?_0x26b6d1[_0x423f('0x18')][_0x423f('0x1b')]||null:null,'limit':_0x26b6d1['options']?_0x26b6d1[_0x423f('0x18')][_0x423f('0x1c')]||null:null,'include':_0x26b6d1['options']?_0x26b6d1[_0x423f('0x18')]['include']?_[_0x423f('0x1d')](_0x26b6d1[_0x423f('0x18')][_0x423f('0x1e')],function(_0x3955a0){return{'model':db[_0x3955a0[_0x423f('0x1f')]],'as':_0x3955a0['as'],'attributes':_0x3955a0[_0x423f('0x1b')],'include':_0x3955a0[_0x423f('0x1e')]?_[_0x423f('0x1d')](_0x3955a0[_0x423f('0x1e')],function(_0x36f57f){return{'model':db[_0x36f57f[_0x423f('0x1f')]],'as':_0x36f57f['as'],'attributes':_0x36f57f[_0x423f('0x1b')],'include':_0x36f57f[_0x423f('0x1e')]?_[_0x423f('0x1d')](_0x36f57f['include'],function(_0x3308dd){return{'model':db[_0x3308dd[_0x423f('0x1f')]],'as':_0x3308dd['as'],'attributes':_0x3308dd[_0x423f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fc44d){logger[_0x423f('0x13')](_0x423f('0x16'),_0x26b6d1);logger[_0x423f('0xc')]('GetMemberReport',_0x26b6d1,JSON['stringify'](_0x4fc44d));_0x99435f(_0x4fc44d);})[_0x423f('0x15')](function(_0xbb4bce){logger['error'](_0x423f('0x16'),_0xbb4bce[_0x423f('0x12')],_0x26b6d1);_0x569fd0(_0x5424e6[_0x423f('0x10')](0x1f4,_0xbb4bce[_0x423f('0x12')]));});});};exports['CreateMemberReport']=function(_0x6dcc7a){var _0x332bbc=this;return new Promise(function(_0x39c8ee,_0x15c0e8){return db['MemberReport'][_0x423f('0x20')](_0x6dcc7a[_0x423f('0x21')],{'raw':_0x6dcc7a[_0x423f('0x18')]?_0x6dcc7a[_0x423f('0x18')][_0x423f('0x19')]===undefined?!![]:![]:!![]})[_0x423f('0x22')](function(_0x36851f){logger[_0x423f('0x13')](_0x423f('0x23'),_0x6dcc7a);logger[_0x423f('0xc')]('CreateMemberReport',_0x6dcc7a,JSON[_0x423f('0xf')](_0x36851f));_0x39c8ee(_0x36851f);})[_0x423f('0x15')](function(_0xb4d704){logger['error'](_0x423f('0x23'),_0xb4d704['message'],_0x6dcc7a);_0x15c0e8(_0x332bbc[_0x423f('0x10')](0x1f4,_0xb4d704[_0x423f('0x12')]));});});};exports[_0x423f('0x24')]=function(_0x40ee34){var _0x145981=this;return new Promise(function(_0x4a5134,_0x5ea12a){return db[_0x423f('0x25')][_0x423f('0x26')](_0x40ee34[_0x423f('0x21')],{'raw':_0x40ee34[_0x423f('0x18')]?_0x40ee34[_0x423f('0x18')][_0x423f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40ee34[_0x423f('0x18')]?_0x40ee34[_0x423f('0x18')][_0x423f('0x1a')]||null:null,'attributes':_0x40ee34[_0x423f('0x18')]?_0x40ee34[_0x423f('0x18')][_0x423f('0x1b')]||null:null,'limit':_0x40ee34[_0x423f('0x18')]?_0x40ee34['options']['limit']||null:null})[_0x423f('0x22')](function(_0x6f58e9){logger[_0x423f('0x13')](_0x423f('0x24'),_0x40ee34);logger[_0x423f('0xc')]('UpdateMemberReport',_0x40ee34,JSON[_0x423f('0xf')](_0x6f58e9));_0x4a5134(_0x6f58e9);})[_0x423f('0x15')](function(_0x2e6d28){logger[_0x423f('0x10')](_0x423f('0x24'),_0x2e6d28[_0x423f('0x12')],_0x40ee34);_0x5ea12a(_0x145981[_0x423f('0x10')](0x1f4,_0x2e6d28[_0x423f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d5225ba..bc8421c 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 _0xcff9=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcff9,0x9c));var _0x9cff=function(_0x227949,_0x447dd9){_0x227949=_0x227949-0x0;var _0x9ca153=_0xcff9[_0x227949];return _0x9ca153;};'use strict';var multer=require(_0x9cff('0x0'));var util=require(_0x9cff('0x1'));var path=require('path');var timeout=require(_0x9cff('0x2'));var express=require(_0x9cff('0x3'));var router=express[_0x9cff('0x4')]();var fs_extra=require(_0x9cff('0x5'));var auth=require(_0x9cff('0x6'));var interaction=require(_0x9cff('0x7'));var config=require(_0x9cff('0x8'));var controller=require(_0x9cff('0x9'));router['get']('/',controller[_0x9cff('0xa')]);module[_0x9cff('0xb')]=router; \ No newline at end of file +var _0x4351=['get','index','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x347f53,_0x34eee3){var _0x33ecde=function(_0x55ea07){while(--_0x55ea07){_0x347f53['push'](_0x347f53['shift']());}};_0x33ecde(++_0x34eee3);}(_0x4351,0x1b5));var _0x1435=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4351[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express[_0x1435('0x5')]();var fs_extra=require(_0x1435('0x6'));var auth=require(_0x1435('0x7'));var interaction=require(_0x1435('0x8'));var config=require(_0x1435('0x9'));var controller=require(_0x1435('0xa'));router[_0x1435('0xb')]('/',controller[_0x1435('0xc')]);module[_0x1435('0xd')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index bc835ae..f434fe3 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 _0x22fc=['exports','STRING','version','sequelize'];(function(_0x5024e6,_0x3aaa08){var _0x51ec48=function(_0x547727){while(--_0x547727){_0x5024e6['push'](_0x5024e6['shift']());}};_0x51ec48(++_0x3aaa08);}(_0x22fc,0x67));var _0xc22f=function(_0xe98466,_0x39f6fb){_0xe98466=_0xe98466-0x0;var _0x58f1b1=_0x22fc[_0xe98466];return _0x58f1b1;};'use strict';var Sequelize=require(_0xc22f('0x0'));module[_0xc22f('0x1')]={'version':{'type':Sequelize[_0xc22f('0x2')],'unique':_0xc22f('0x3')}}; \ No newline at end of file +var _0xf190=['version','sequelize','exports','STRING'];(function(_0xc24eb1,_0x2cb4ef){var _0x42c23c=function(_0x1094bd){while(--_0x1094bd){_0xc24eb1['push'](_0xc24eb1['shift']());}};_0x42c23c(++_0x2cb4ef);}(_0xf190,0x189));var _0x0f19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf190[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0f19('0x0'));module[_0x0f19('0x1')]={'version':{'type':Sequelize[_0x0f19('0x2')],'unique':_0x0f19('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index be45cbb..43e538b 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 _0xd42d=['util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','merge','count','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x3f1222,_0x2621e5){var _0x3021f7=function(_0xc74ffe){while(--_0xc74ffe){_0x3f1222['push'](_0x3f1222['shift']());}};_0x3021f7(++_0x2621e5);}(_0xd42d,0x1d5));var _0xdd42=function(_0x40cbbd,_0x10185b){_0x40cbbd=_0x40cbbd-0x0;var _0x2ff260=_0xd42d[_0x40cbbd];return _0x2ff260;};'use strict';var emlformat=require(_0xdd42('0x0'));var rimraf=require(_0xdd42('0x1'));var zipdir=require(_0xdd42('0x2'));var jsonpatch=require(_0xdd42('0x3'));var rp=require(_0xdd42('0x4'));var moment=require(_0xdd42('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdd42('0x6'));var util=require(_0xdd42('0x7'));var path=require(_0xdd42('0x8'));var sox=require(_0xdd42('0x9'));var csv=require(_0xdd42('0xa'));var ejs=require(_0xdd42('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd42('0xc'));var squel=require('squel');var crypto=require(_0xdd42('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdd42('0xe'));var toCsv=require(_0xdd42('0xa'));var querystring=require(_0xdd42('0xf'));var Papa=require(_0xdd42('0x10'));var Redis=require(_0xdd42('0x11'));var authService=require(_0xdd42('0x12'));var qs=require(_0xdd42('0x13'));var as=require(_0xdd42('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd42('0x15'))(_0xdd42('0x16'));var utils=require('../../config/utils');var config=require(_0xdd42('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4503c2,_0x3158b3){_0x3158b3=_0x3158b3||0xcc;return function(_0x171ef2){if(_0x171ef2){return _0x4503c2['sendStatus'](_0x3158b3);}return _0x4503c2[_0xdd42('0x18')](_0x3158b3)[_0xdd42('0x19')]();};}function respondWithResult(_0x22a2fa,_0x2e0282){_0x2e0282=_0x2e0282||0xc8;return function(_0x58b53b){if(_0x58b53b){return _0x22a2fa[_0xdd42('0x18')](_0x2e0282)[_0xdd42('0x1a')](_0x58b53b);}};}function respondWithFilteredResult(_0x24ca0b,_0x2f9578){return function(_0x31c506){if(_0x31c506){var _0x26989d=typeof _0x2f9578['offset']===_0xdd42('0x1b')&&typeof _0x2f9578[_0xdd42('0x1c')]==='undefined';var _0xd8dfb6=_0x31c506['count'];var _0x510aa3=_0x26989d?0x0:_0x2f9578[_0xdd42('0x1d')];var _0x18e05b=_0x26989d?_0x31c506['count']:_0x2f9578['offset']+_0x2f9578[_0xdd42('0x1c')];var _0x337401;if(_0x18e05b>=_0xd8dfb6){_0x18e05b=_0xd8dfb6;_0x337401=0xc8;}else{_0x337401=0xce;}_0x24ca0b[_0xdd42('0x18')](_0x337401);return _0x24ca0b[_0xdd42('0x1e')](_0xdd42('0x1f'),_0x510aa3+'-'+_0x18e05b+'/'+_0xd8dfb6)[_0xdd42('0x1a')](_0x31c506);}return null;};}function patchUpdates(_0xa3659a){return function(_0x2bf97e){try{jsonpatch[_0xdd42('0x20')](_0x2bf97e,_0xa3659a,!![]);}catch(_0x407d71){return BPromise[_0xdd42('0x21')](_0x407d71);}return _0x2bf97e[_0xdd42('0x22')]();};}function saveUpdates(_0x15d5e4,_0x419aca){return function(_0x43f211){if(_0x43f211){return _0x43f211[_0xdd42('0x23')](_0x15d5e4)[_0xdd42('0x24')](function(_0x3d7e5f){return _0x3d7e5f;});}return null;};}function removeEntity(_0x5a7e59,_0x50801a){return function(_0x58d1c2){if(_0x58d1c2){return _0x58d1c2['destroy']()[_0xdd42('0x24')](function(){_0x5a7e59[_0xdd42('0x18')](0xcc)[_0xdd42('0x19')]();});}};}function handleEntityNotFound(_0x15bd04,_0x17f62f){return function(_0x2325f4){if(!_0x2325f4){_0x15bd04[_0xdd42('0x25')](0x194);}return _0x2325f4;};}function handleError(_0x3f4437,_0x1b6c89){_0x1b6c89=_0x1b6c89||0x1f4;return function(_0x391a59){logger[_0xdd42('0x26')](_0x391a59[_0xdd42('0x27')]);if(_0x391a59[_0xdd42('0x28')]){delete _0x391a59[_0xdd42('0x28')];}_0x3f4437['status'](_0x1b6c89)['send'](_0x391a59);};}exports[_0xdd42('0x29')]=function(_0x2d9d10,_0x2bdfb6){var _0x55c81a={},_0x4b1403={},_0x5f4c86={'count':0x0,'rows':[]};var _0x2c80d7=_[_0xdd42('0x2a')](db[_0xdd42('0x2b')][_0xdd42('0x2c')],function(_0x31939b){return{'name':_0x31939b[_0xdd42('0x2d')],'type':_0x31939b[_0xdd42('0x2e')][_0xdd42('0x2f')]};});_0x4b1403[_0xdd42('0x30')]=_['map'](_0x2c80d7,_0xdd42('0x28'));_0x4b1403[_0xdd42('0x31')]=_[_0xdd42('0x32')](_0x2d9d10[_0xdd42('0x31')]);_0x4b1403[_0xdd42('0x33')]=_[_0xdd42('0x34')](_0x4b1403[_0xdd42('0x30')],_0x4b1403['query']);_0x55c81a['attributes']=_[_0xdd42('0x34')](_0x4b1403['model'],qs[_0xdd42('0x35')](_0x2d9d10[_0xdd42('0x31')]['fields']));_0x55c81a['attributes']=_0x55c81a[_0xdd42('0x36')][_0xdd42('0x37')]?_0x55c81a[_0xdd42('0x36')]:_0x4b1403[_0xdd42('0x30')];if(!_0x2d9d10['query'][_0xdd42('0x38')](_0xdd42('0x39'))){_0x55c81a['limit']=qs[_0xdd42('0x1c')](_0x2d9d10[_0xdd42('0x31')][_0xdd42('0x1c')]);_0x55c81a[_0xdd42('0x1d')]=qs[_0xdd42('0x1d')](_0x2d9d10['query']['offset']);}_0x55c81a['order']=qs['sort'](_0x2d9d10[_0xdd42('0x31')][_0xdd42('0x3a')]);_0x55c81a['where']=qs[_0xdd42('0x33')](_[_0xdd42('0x3b')](_0x2d9d10[_0xdd42('0x31')],_0x4b1403[_0xdd42('0x33')]),_0x2c80d7);if(_0x2d9d10[_0xdd42('0x31')]['filter']){_0x55c81a[_0xdd42('0x3c')]=_['merge'](_0x55c81a['where'],{'$or':_[_0xdd42('0x2a')](_0x2c80d7,function(_0x2b5b6d){if(_0x2b5b6d['type']!==_0xdd42('0x3d')){var _0xc5936a={};_0xc5936a[_0x2b5b6d[_0xdd42('0x28')]]={'$like':'%'+_0x2d9d10['query']['filter']+'%'};return _0xc5936a;}})});}_0x55c81a=_[_0xdd42('0x3e')]({},_0x55c81a,_0x2d9d10['options']);var _0x87c24f={'where':_0x55c81a[_0xdd42('0x3c')]};return db[_0xdd42('0x2b')][_0xdd42('0x3f')](_0x87c24f)[_0xdd42('0x24')](function(_0x457e9e){_0x5f4c86[_0xdd42('0x3f')]=_0x457e9e;if(_0x2d9d10[_0xdd42('0x31')][_0xdd42('0x40')]){_0x55c81a[_0xdd42('0x41')]=[{'all':!![]}];}return db['Migration'][_0xdd42('0x42')](_0x55c81a);})[_0xdd42('0x24')](function(_0x1dfeea){_0x5f4c86[_0xdd42('0x43')]=_0x1dfeea;return _0x5f4c86;})[_0xdd42('0x24')](respondWithFilteredResult(_0x2bdfb6,_0x55c81a))['catch'](handleError(_0x2bdfb6,null));}; \ No newline at end of file +var _0x272f=['limit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','end','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit'];(function(_0x4e46cc,_0x25d841){var _0x5b4583=function(_0x7005ab){while(--_0x7005ab){_0x4e46cc['push'](_0x4e46cc['shift']());}};_0x5b4583(++_0x25d841);}(_0x272f,0x1bc));var _0xf272=function(_0x1ea19f,_0x347c72){_0x1ea19f=_0x1ea19f-0x0;var _0x4f74b7=_0x272f[_0x1ea19f];return _0x4f74b7;};'use strict';var emlformat=require(_0xf272('0x0'));var rimraf=require(_0xf272('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf272('0x2'));var rp=require(_0xf272('0x3'));var moment=require(_0xf272('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf272('0x5'));var util=require(_0xf272('0x6'));var path=require(_0xf272('0x7'));var sox=require('sox');var csv=require(_0xf272('0x8'));var ejs=require(_0xf272('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf272('0xa'));var crypto=require(_0xf272('0xb'));var jsforce=require(_0xf272('0xc'));var deskjs=require(_0xf272('0xd'));var toCsv=require(_0xf272('0x8'));var querystring=require(_0xf272('0xe'));var Papa=require(_0xf272('0xf'));var Redis=require(_0xf272('0x10'));var authService=require(_0xf272('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf272('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf272('0x13'))(_0xf272('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf272('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83367a,_0x3ae437){_0x3ae437=_0x3ae437||0xcc;return function(_0x3ed8a4){if(_0x3ed8a4){return _0x83367a['sendStatus'](_0x3ae437);}return _0x83367a['status'](_0x3ae437)[_0xf272('0x16')]();};}function respondWithResult(_0x5725cb,_0x139516){_0x139516=_0x139516||0xc8;return function(_0x4186e7){if(_0x4186e7){return _0x5725cb[_0xf272('0x17')](_0x139516)[_0xf272('0x18')](_0x4186e7);}};}function respondWithFilteredResult(_0xf0fa59,_0x1495d0){return function(_0x4c6a5f){if(_0x4c6a5f){var _0x1e3bbe=typeof _0x1495d0[_0xf272('0x19')]===_0xf272('0x1a')&&typeof _0x1495d0['limit']===_0xf272('0x1a');var _0x187066=_0x4c6a5f[_0xf272('0x1b')];var _0x252fb6=_0x1e3bbe?0x0:_0x1495d0[_0xf272('0x19')];var _0x77bb0a=_0x1e3bbe?_0x4c6a5f[_0xf272('0x1b')]:_0x1495d0[_0xf272('0x19')]+_0x1495d0['limit'];var _0x59708a;if(_0x77bb0a>=_0x187066){_0x77bb0a=_0x187066;_0x59708a=0xc8;}else{_0x59708a=0xce;}_0xf0fa59[_0xf272('0x17')](_0x59708a);return _0xf0fa59[_0xf272('0x1c')]('Content-Range',_0x252fb6+'-'+_0x77bb0a+'/'+_0x187066)[_0xf272('0x18')](_0x4c6a5f);}return null;};}function patchUpdates(_0x5a4cb4){return function(_0x5adacf){try{jsonpatch[_0xf272('0x1d')](_0x5adacf,_0x5a4cb4,!![]);}catch(_0x38adb2){return BPromise[_0xf272('0x1e')](_0x38adb2);}return _0x5adacf['save']();};}function saveUpdates(_0x3a5644,_0x3c831f){return function(_0x233dae){if(_0x233dae){return _0x233dae[_0xf272('0x1f')](_0x3a5644)[_0xf272('0x20')](function(_0x4d756f){return _0x4d756f;});}return null;};}function removeEntity(_0x54532d,_0xf89ad3){return function(_0x3eb749){if(_0x3eb749){return _0x3eb749[_0xf272('0x21')]()['then'](function(){_0x54532d[_0xf272('0x17')](0xcc)[_0xf272('0x16')]();});}};}function handleEntityNotFound(_0x5db18e,_0x248cd5){return function(_0x2d0355){if(!_0x2d0355){_0x5db18e[_0xf272('0x22')](0x194);}return _0x2d0355;};}function handleError(_0x2fa6bd,_0x4b360b){_0x4b360b=_0x4b360b||0x1f4;return function(_0x4b5e4e){logger[_0xf272('0x23')](_0x4b5e4e[_0xf272('0x24')]);if(_0x4b5e4e[_0xf272('0x25')]){delete _0x4b5e4e['name'];}_0x2fa6bd[_0xf272('0x17')](_0x4b360b)[_0xf272('0x26')](_0x4b5e4e);};}exports[_0xf272('0x27')]=function(_0x70ef26,_0x16cfc7){var _0x1fb10c={},_0x187df2={},_0x4bf5d7={'count':0x0,'rows':[]};var _0xae203c=_[_0xf272('0x28')](db[_0xf272('0x29')][_0xf272('0x2a')],function(_0x352a34){return{'name':_0x352a34['fieldName'],'type':_0x352a34['type'][_0xf272('0x2b')]};});_0x187df2[_0xf272('0x2c')]=_['map'](_0xae203c,'name');_0x187df2[_0xf272('0x2d')]=_['keys'](_0x70ef26['query']);_0x187df2[_0xf272('0x2e')]=_[_0xf272('0x2f')](_0x187df2['model'],_0x187df2[_0xf272('0x2d')]);_0x1fb10c[_0xf272('0x30')]=_[_0xf272('0x2f')](_0x187df2[_0xf272('0x2c')],qs[_0xf272('0x31')](_0x70ef26['query'][_0xf272('0x31')]));_0x1fb10c[_0xf272('0x30')]=_0x1fb10c['attributes'][_0xf272('0x32')]?_0x1fb10c[_0xf272('0x30')]:_0x187df2[_0xf272('0x2c')];if(!_0x70ef26[_0xf272('0x2d')]['hasOwnProperty'](_0xf272('0x33'))){_0x1fb10c[_0xf272('0x34')]=qs[_0xf272('0x34')](_0x70ef26[_0xf272('0x2d')][_0xf272('0x34')]);_0x1fb10c[_0xf272('0x19')]=qs['offset'](_0x70ef26['query'][_0xf272('0x19')]);}_0x1fb10c['order']=qs['sort'](_0x70ef26[_0xf272('0x2d')][_0xf272('0x35')]);_0x1fb10c['where']=qs[_0xf272('0x2e')](_[_0xf272('0x36')](_0x70ef26[_0xf272('0x2d')],_0x187df2['filters']),_0xae203c);if(_0x70ef26[_0xf272('0x2d')][_0xf272('0x37')]){_0x1fb10c[_0xf272('0x38')]=_['merge'](_0x1fb10c[_0xf272('0x38')],{'$or':_[_0xf272('0x28')](_0xae203c,function(_0x4b8b7f){if(_0x4b8b7f['type']!==_0xf272('0x39')){var _0x30557a={};_0x30557a[_0x4b8b7f[_0xf272('0x25')]]={'$like':'%'+_0x70ef26[_0xf272('0x2d')][_0xf272('0x37')]+'%'};return _0x30557a;}})});}_0x1fb10c=_['merge']({},_0x1fb10c,_0x70ef26[_0xf272('0x3a')]);var _0x246815={'where':_0x1fb10c[_0xf272('0x38')]};return db[_0xf272('0x29')][_0xf272('0x1b')](_0x246815)[_0xf272('0x20')](function(_0x52cbb9){_0x4bf5d7['count']=_0x52cbb9;if(_0x70ef26[_0xf272('0x2d')][_0xf272('0x3b')]){_0x1fb10c[_0xf272('0x3c')]=[{'all':!![]}];}return db[_0xf272('0x29')]['findAll'](_0x1fb10c);})[_0xf272('0x20')](function(_0x30b69d){_0x4bf5d7['rows']=_0x30b69d;return _0x4bf5d7;})['then'](respondWithFilteredResult(_0x16cfc7,_0x1fb10c))[_0xf272('0x3d')](handleError(_0x16cfc7,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 2d0aa97..3b67a78 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 _0x4bef=['define','Migration','migrations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3c0ea7,_0x9485d3){var _0x52c6bb=function(_0x45b130){while(--_0x45b130){_0x3c0ea7['push'](_0x3c0ea7['shift']());}};_0x52c6bb(++_0x9485d3);}(_0x4bef,0x183));var _0xf4be=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x4bef[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xf4be('0x0'));var util=require(_0xf4be('0x1'));var logger=require('../../config/logger')(_0xf4be('0x2'));var moment=require(_0xf4be('0x3'));var BPromise=require(_0xf4be('0x4'));var rp=require(_0xf4be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4be('0x6'));var config=require(_0xf4be('0x7'));var attributes=require('./migration.attributes');module[_0xf4be('0x8')]=function(_0x2b8cdb,_0x214ea9){return _0x2b8cdb[_0xf4be('0x9')](_0xf4be('0xa'),attributes,{'tableName':_0xf4be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x617a=['path','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','api','moment','bluebird','request-promise'];(function(_0x200ab8,_0x21f1b8){var _0x568a43=function(_0x6c8102){while(--_0x6c8102){_0x200ab8['push'](_0x200ab8['shift']());}};_0x568a43(++_0x21f1b8);}(_0x617a,0x132));var _0xa617=function(_0x1f4ea0,_0xf62d9b){_0x1f4ea0=_0x1f4ea0-0x0;var _0xc3d0ca=_0x617a[_0x1f4ea0];return _0xc3d0ca;};'use strict';var _=require(_0xa617('0x0'));var util=require(_0xa617('0x1'));var logger=require('../../config/logger')(_0xa617('0x2'));var moment=require(_0xa617('0x3'));var BPromise=require(_0xa617('0x4'));var rp=require(_0xa617('0x5'));var fs=require('fs');var path=require(_0xa617('0x6'));var rimraf=require('rimraf');var config=require(_0xa617('0x7'));var attributes=require(_0xa617('0x8'));module[_0xa617('0x9')]=function(_0x454527,_0x3eb33d){return _0x454527[_0xa617('0xa')](_0xa617('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index f91e5a6..161ad88 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 _0xb6b8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','util'];(function(_0xd02923,_0x7d3515){var _0x10ff2f=function(_0x4da910){while(--_0x4da910){_0xd02923['push'](_0xd02923['shift']());}};_0x10ff2f(++_0x7d3515);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x1b4f25,_0x353927){_0x1b4f25=_0x1b4f25-0x0;var _0x6b0931=_0xb6b8[_0x1b4f25];return _0x6b0931;};'use strict';var _=require('lodash');var util=require(_0x8b6b('0x0'));var moment=require(_0x8b6b('0x1'));var BPromise=require(_0x8b6b('0x2'));var rs=require(_0x8b6b('0x3'));var fs=require('fs');var Redis=require(_0x8b6b('0x4'));var db=require(_0x8b6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b6b('0x6'))(_0x8b6b('0x7'));var config=require(_0x8b6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b6b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56da2a,_0x21bbc2,_0x303c21){return new BPromise(function(_0x142239,_0x21c84e){return client[_0x8b6b('0xa')](_0x56da2a,_0x303c21)[_0x8b6b('0xb')](function(_0x1f2c39){logger[_0x8b6b('0xc')]('Migration,\x20%s,\x20%s',_0x21bbc2,'request\x20sent');logger['debug'](_0x8b6b('0xd'),_0x21bbc2,_0x8b6b('0xe'),JSON[_0x8b6b('0xf')](_0x1f2c39));if(_0x1f2c39['error']){if(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x11')]===0x1f4){logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x21c84e(_0x1f2c39[_0x8b6b('0x10')]['message']);}logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x142239(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x13')]);}else{logger[_0x8b6b('0xc')](_0x8b6b('0x12'),_0x21bbc2,'request\x20sent');_0x142239(_0x1f2c39[_0x8b6b('0x14')][_0x8b6b('0x13')]);}})[_0x8b6b('0x15')](function(_0x2d16c7){logger[_0x8b6b('0x10')](_0x8b6b('0x12'),_0x21bbc2,_0x2d16c7);_0x21c84e(_0x2d16c7);});});} \ No newline at end of file +var _0x3df4=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x334a5f,_0x1c1e69){var _0x53f6bb=function(_0x398f2b){while(--_0x398f2b){_0x334a5f['push'](_0x334a5f['shift']());}};_0x53f6bb(++_0x1c1e69);}(_0x3df4,0x102));var _0x43df=function(_0x4c9eb3,_0x510fec){_0x4c9eb3=_0x4c9eb3-0x0;var _0x5ae9f4=_0x3df4[_0x4c9eb3];return _0x5ae9f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43df('0x0'));var BPromise=require(_0x43df('0x1'));var rs=require(_0x43df('0x2'));var fs=require('fs');var Redis=require(_0x43df('0x3'));var db=require(_0x43df('0x4'))['db'];var utils=require(_0x43df('0x5'));var logger=require(_0x43df('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x43df('0x7'));var client=jayson[_0x43df('0x8')][_0x43df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43fd8c,_0x5ba02f,_0x5863be){return new BPromise(function(_0x2492a9,_0x44b685){return client[_0x43df('0xa')](_0x43fd8c,_0x5863be)[_0x43df('0xb')](function(_0x553304){logger[_0x43df('0xc')]('Migration,\x20%s,\x20%s',_0x5ba02f,_0x43df('0xd'));logger[_0x43df('0xe')](_0x43df('0xf'),_0x5ba02f,_0x43df('0xd'),JSON[_0x43df('0x10')](_0x553304));if(_0x553304[_0x43df('0x11')]){if(_0x553304[_0x43df('0x11')]['code']===0x1f4){logger[_0x43df('0x11')](_0x43df('0x12'),_0x5ba02f,_0x553304['error'][_0x43df('0x13')]);return _0x44b685(_0x553304['error'][_0x43df('0x13')]);}logger[_0x43df('0x11')]('Migration,\x20%s,\x20%s',_0x5ba02f,_0x553304[_0x43df('0x11')]['message']);return _0x2492a9(_0x553304['error'][_0x43df('0x13')]);}else{logger[_0x43df('0xc')]('Migration,\x20%s,\x20%s',_0x5ba02f,_0x43df('0xd'));_0x2492a9(_0x553304['result'][_0x43df('0x13')]);}})[_0x43df('0x14')](function(_0x14b258){logger[_0x43df('0x11')](_0x43df('0x12'),_0x5ba02f,_0x14b258);_0x44b685(_0x14b258);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 6d04bee..cc67987 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0xba34,0x119));var _0x4ba3=function(_0x43ef85,_0x41536f){_0x43ef85=_0x43ef85-0x0;var _0x46f587=_0xba34[_0x43ef85];return _0x46f587;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/:id',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0xc')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xf'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x10')]);router[_0x4ba3('0x11')](_0x4ba3('0xf'),auth['isAuthenticated'](),controller[_0x4ba3('0x12')]);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x1e44=['index','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated'];(function(_0x28b63f,_0x15a936){var _0x3d01d2=function(_0x43d3df){while(--_0x43d3df){_0x28b63f['push'](_0x28b63f['shift']());}};_0x3d01d2(++_0x15a936);}(_0x1e44,0xb3));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x41e4('0x0'));var util=require(_0x41e4('0x1'));var path=require(_0x41e4('0x2'));var timeout=require('connect-timeout');var express=require(_0x41e4('0x3'));var router=express[_0x41e4('0x4')]();var fs_extra=require(_0x41e4('0x5'));var auth=require(_0x41e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x41e4('0x7'));var controller=require(_0x41e4('0x8'));router[_0x41e4('0x9')]('/',auth[_0x41e4('0xa')](),controller[_0x41e4('0xb')]);router[_0x41e4('0x9')](_0x41e4('0xc'),auth[_0x41e4('0xa')](),controller['show']);router[_0x41e4('0xd')]('/',auth[_0x41e4('0xa')](),controller[_0x41e4('0xe')]);router[_0x41e4('0xf')](_0x41e4('0xc'),auth[_0x41e4('0xa')](),controller[_0x41e4('0x10')]);router[_0x41e4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x41e4('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index cdec469..e90e83b 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 _0x76a1=['localnet','externip','stun','turn','STRING','exports','ENUM'];(function(_0x47f587,_0x33ec3a){var _0x2a26d3=function(_0x3154f0){while(--_0x3154f0){_0x47f587['push'](_0x47f587['shift']());}};_0x2a26d3(++_0x33ec3a);}(_0x76a1,0x101));var _0x176a=function(_0x2c607e,_0x2a9734){_0x2c607e=_0x2c607e-0x0;var _0x5ad450=_0x76a1[_0x2c607e];return _0x5ad450;};'use strict';var Sequelize=require('sequelize');module[_0x176a('0x0')]={'type':{'type':Sequelize[_0x176a('0x1')](_0x176a('0x2'),_0x176a('0x3'),_0x176a('0x4'),_0x176a('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x176a('0x6')]},'password':{'type':Sequelize[_0x176a('0x6')]}}; \ No newline at end of file +var _0x18b6=['sequelize','exports','externip','turn','STRING'];(function(_0x172c1e,_0x1ecfce){var _0x2d02d5=function(_0x19e128){while(--_0x19e128){_0x172c1e['push'](_0x172c1e['shift']());}};_0x2d02d5(++_0x1ecfce);}(_0x18b6,0x64));var _0x618b=function(_0x36daf1,_0x4a3b60){_0x36daf1=_0x36daf1-0x0;var _0x1f360a=_0x18b6[_0x36daf1];return _0x1f360a;};'use strict';var Sequelize=require(_0x618b('0x0'));module[_0x618b('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0x618b('0x2'),'stun',_0x618b('0x3'))},'value':{'type':Sequelize[_0x618b('0x4')]},'username':{'type':Sequelize[_0x618b('0x4')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index b797d8c..aa8fce7 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 _0x0223=['offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','Network','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','sequelize','transaction','body','toUpperCase','readFileSync','root','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','server/files/templates/stun_multiple.ejs','TURN','/etc/asterisk/sip_xcally_%s.conf','destroy','STUN','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','jayson/promise','client','http','request','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','Network,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json'];(function(_0x488f67,_0x1ac412){var _0x14aefd=function(_0x2cf9d7){while(--_0x2cf9d7){_0x488f67['push'](_0x488f67['shift']());}};_0x14aefd(++_0x1ac412);}(_0x0223,0xaf));var _0x3022=function(_0x14d175,_0x230bf7){_0x14d175=_0x14d175-0x0;var _0x2946e9=_0x0223[_0x14d175];return _0x2946e9;};'use strict';var emlformat=require(_0x3022('0x0'));var rimraf=require(_0x3022('0x1'));var zipdir=require(_0x3022('0x2'));var jsonpatch=require(_0x3022('0x3'));var rp=require('request-promise');var moment=require(_0x3022('0x4'));var BPromise=require(_0x3022('0x5'));var Mustache=require(_0x3022('0x6'));var util=require(_0x3022('0x7'));var path=require(_0x3022('0x8'));var sox=require(_0x3022('0x9'));var csv=require(_0x3022('0xa'));var ejs=require(_0x3022('0xb'));var fs=require('fs');var fs_extra=require(_0x3022('0xc'));var _=require(_0x3022('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3022('0xe'));var toCsv=require(_0x3022('0xa'));var querystring=require('querystring');var Papa=require(_0x3022('0xf'));var Redis=require(_0x3022('0x10'));var authService=require(_0x3022('0x11'));var qs=require(_0x3022('0x12'));var as=require(_0x3022('0x13'));var hardwareService=require(_0x3022('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3022('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3022('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3022('0x17'));var client=jayson[_0x3022('0x18')][_0x3022('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1edc00,_0x1427be,_0xe0d010,_0x510c3a){return new BPromise(function(_0x23d6fc,_0xcbb1b){var _0x4a4354=_0x510c3a||client;return _0x4a4354[_0x3022('0x1a')](_0x1edc00,_0xe0d010)['then'](function(_0x1d5fd9){logger[_0x3022('0x1b')]('Network,\x20%s,\x20%s',_0x1427be,_0x3022('0x1c'));logger['debug'](_0x3022('0x1d'),_0x1427be,_0x3022('0x1c'),JSON['stringify'](_0x1d5fd9));if(_0x1d5fd9[_0x3022('0x1e')]){if(_0x1d5fd9[_0x3022('0x1e')]['code']===0x1f4){logger[_0x3022('0x1e')](_0x3022('0x1f'),_0x1427be,_0x1d5fd9[_0x3022('0x1e')][_0x3022('0x20')]);return _0xcbb1b(_0x1d5fd9[_0x3022('0x1e')]['message']);}logger['error'](_0x3022('0x1f'),_0x1427be,_0x1d5fd9[_0x3022('0x1e')]['message']);return _0x23d6fc(_0x1d5fd9[_0x3022('0x1e')][_0x3022('0x20')]);}else{logger[_0x3022('0x1b')](_0x3022('0x1f'),_0x1427be,'request\x20sent');_0x23d6fc(_0x1d5fd9[_0x3022('0x21')]['message']);}})[_0x3022('0x22')](function(_0x537385){logger[_0x3022('0x1e')](_0x3022('0x1f'),_0x1427be,_0x537385);_0xcbb1b(_0x537385);});});}function respondWithStatusCode(_0x49da67,_0x4af23a){_0x4af23a=_0x4af23a||0xcc;return function(_0xd7d37){if(_0xd7d37){return _0x49da67[_0x3022('0x23')](_0x4af23a);}return _0x49da67['status'](_0x4af23a)[_0x3022('0x24')]();};}function respondWithResult(_0x3af8d6,_0x417801){_0x417801=_0x417801||0xc8;return function(_0x5772f2){if(_0x5772f2){return _0x3af8d6[_0x3022('0x25')](_0x417801)[_0x3022('0x26')](_0x5772f2);}};}function respondWithFilteredResult(_0x547081,_0x2b99e5){return function(_0x3c8ec1){if(_0x3c8ec1){var _0xe447b9=typeof _0x2b99e5[_0x3022('0x27')]===_0x3022('0x28')&&typeof _0x2b99e5[_0x3022('0x29')]===_0x3022('0x28');var _0x4d6659=_0x3c8ec1['count'];var _0x5e3738=_0xe447b9?0x0:_0x2b99e5[_0x3022('0x27')];var _0x2cb86b=_0xe447b9?_0x3c8ec1[_0x3022('0x2a')]:_0x2b99e5[_0x3022('0x27')]+_0x2b99e5['limit'];var _0x2a1ae9;if(_0x2cb86b>=_0x4d6659){_0x2cb86b=_0x4d6659;_0x2a1ae9=0xc8;}else{_0x2a1ae9=0xce;}_0x547081['status'](_0x2a1ae9);return _0x547081[_0x3022('0x2b')]('Content-Range',_0x5e3738+'-'+_0x2cb86b+'/'+_0x4d6659)[_0x3022('0x26')](_0x3c8ec1);}return null;};}function patchUpdates(_0x56cc97){return function(_0x2b8733){try{jsonpatch[_0x3022('0x2c')](_0x2b8733,_0x56cc97,!![]);}catch(_0x1cb568){return BPromise[_0x3022('0x2d')](_0x1cb568);}return _0x2b8733[_0x3022('0x2e')]();};}function saveUpdates(_0x5edf05,_0x24e90f){return function(_0x503062){if(_0x503062){return _0x503062[_0x3022('0x2f')](_0x5edf05)['then'](function(_0x44c741){return _0x44c741;});}return null;};}function removeEntity(_0x27ea39,_0x14535f){return function(_0x2a887a){if(_0x2a887a){return _0x2a887a['destroy']()[_0x3022('0x30')](function(){_0x27ea39[_0x3022('0x25')](0xcc)[_0x3022('0x24')]();});}};}function handleEntityNotFound(_0x21f240,_0x5abcab){return function(_0x32b00a){if(!_0x32b00a){_0x21f240[_0x3022('0x23')](0x194);}return _0x32b00a;};}function handleError(_0x2e6f06,_0x2d4606){_0x2d4606=_0x2d4606||0x1f4;return function(_0x11df35){logger[_0x3022('0x1e')](_0x11df35[_0x3022('0x31')]);if(_0x11df35['name']){delete _0x11df35[_0x3022('0x32')];}_0x2e6f06[_0x3022('0x25')](_0x2d4606)[_0x3022('0x33')](_0x11df35);};}exports['index']=function(_0x3160cb,_0x590fb3){var _0x3388cd={},_0x46e185={},_0x281488={'count':0x0,'rows':[]};var _0xca3e40=_['map'](db[_0x3022('0x34')]['rawAttributes'],function(_0x73326){return{'name':_0x73326[_0x3022('0x35')],'type':_0x73326['type']['key']};});_0x46e185[_0x3022('0x36')]=_[_0x3022('0x37')](_0xca3e40,_0x3022('0x32'));_0x46e185[_0x3022('0x38')]=_[_0x3022('0x39')](_0x3160cb['query']);_0x46e185['filters']=_[_0x3022('0x3a')](_0x46e185[_0x3022('0x36')],_0x46e185[_0x3022('0x38')]);_0x3388cd[_0x3022('0x3b')]=_[_0x3022('0x3a')](_0x46e185['model'],qs[_0x3022('0x3c')](_0x3160cb[_0x3022('0x38')][_0x3022('0x3c')]));_0x3388cd[_0x3022('0x3b')]=_0x3388cd[_0x3022('0x3b')][_0x3022('0x3d')]?_0x3388cd['attributes']:_0x46e185[_0x3022('0x36')];if(!_0x3160cb[_0x3022('0x38')][_0x3022('0x3e')](_0x3022('0x3f'))){_0x3388cd[_0x3022('0x29')]=qs[_0x3022('0x29')](_0x3160cb[_0x3022('0x38')][_0x3022('0x29')]);_0x3388cd[_0x3022('0x27')]=qs[_0x3022('0x27')](_0x3160cb[_0x3022('0x38')][_0x3022('0x27')]);}_0x3388cd[_0x3022('0x40')]=qs[_0x3022('0x41')](_0x3160cb[_0x3022('0x38')]['sort']);_0x3388cd[_0x3022('0x42')]=qs['filters'](_[_0x3022('0x43')](_0x3160cb[_0x3022('0x38')],_0x46e185[_0x3022('0x44')]),_0xca3e40);if(_0x3160cb[_0x3022('0x38')][_0x3022('0x45')]){_0x3388cd['where']=_[_0x3022('0x46')](_0x3388cd['where'],{'$or':_[_0x3022('0x37')](_0xca3e40,function(_0x464d13){if(_0x464d13[_0x3022('0x47')]!==_0x3022('0x48')){var _0x5e70ea={};_0x5e70ea[_0x464d13[_0x3022('0x32')]]={'$like':'%'+_0x3160cb[_0x3022('0x38')][_0x3022('0x45')]+'%'};return _0x5e70ea;}})});}_0x3388cd=_['merge']({},_0x3388cd,_0x3160cb[_0x3022('0x49')]);var _0x25e68e={'where':_0x3388cd[_0x3022('0x42')]};return db[_0x3022('0x34')][_0x3022('0x2a')](_0x25e68e)[_0x3022('0x30')](function(_0x525a96){_0x281488[_0x3022('0x2a')]=_0x525a96;if(_0x3160cb['query']['includeAll']){_0x3388cd[_0x3022('0x4a')]=[{'all':!![]}];}return db[_0x3022('0x34')][_0x3022('0x4b')](_0x3388cd);})[_0x3022('0x30')](function(_0x332087){_0x281488[_0x3022('0x4c')]=_0x332087;return _0x281488;})['then'](respondWithFilteredResult(_0x590fb3,_0x3388cd))['catch'](handleError(_0x590fb3,null));};exports[_0x3022('0x4d')]=function(_0x1d97a9,_0x21953c){var _0x48bd80={'raw':!![],'where':{'id':_0x1d97a9[_0x3022('0x4e')]['id']}},_0x290802={};_0x290802['model']=_[_0x3022('0x39')](db['Network'][_0x3022('0x4f')]);_0x290802[_0x3022('0x38')]=_['keys'](_0x1d97a9[_0x3022('0x38')]);_0x290802[_0x3022('0x44')]=_['intersection'](_0x290802[_0x3022('0x36')],_0x290802[_0x3022('0x38')]);_0x48bd80['attributes']=_['intersection'](_0x290802['model'],qs[_0x3022('0x3c')](_0x1d97a9[_0x3022('0x38')][_0x3022('0x3c')]));_0x48bd80['attributes']=_0x48bd80[_0x3022('0x3b')][_0x3022('0x3d')]?_0x48bd80[_0x3022('0x3b')]:_0x290802['model'];if(_0x1d97a9[_0x3022('0x38')][_0x3022('0x50')]){_0x48bd80[_0x3022('0x4a')]=[{'all':!![]}];}_0x48bd80=_[_0x3022('0x46')]({},_0x48bd80,_0x1d97a9[_0x3022('0x49')]);return db[_0x3022('0x34')][_0x3022('0x51')](_0x48bd80)[_0x3022('0x30')](handleEntityNotFound(_0x21953c,null))[_0x3022('0x30')](respondWithResult(_0x21953c,null))['catch'](handleError(_0x21953c,null));};exports[_0x3022('0x52')]=function(_0x42e27c,_0x20f1dd,_0x15697a){var _0x23f562;return db[_0x3022('0x53')][_0x3022('0x54')](function(_0x5bf9f9){return db[_0x3022('0x34')][_0x3022('0x52')](_0x42e27c[_0x3022('0x55')],{'raw':!![]})['then'](function(_0x19934b){_0x23f562=_0x19934b;return db['Network']['findAll']({'where':{'type':_0x42e27c[_0x3022('0x55')]['type']},'raw':!![]});})[_0x3022('0x30')](function(_0x165a49){if(_0x23f562[_0x3022('0x47')][_0x3022('0x56')]()=='STUN'){var _0x6eaa2e=fs[_0x3022('0x57')](path['join'](config[_0x3022('0x58')],'server/files/templates/stun_multiple.ejs'),_0x3022('0x59'));var _0x21ff43=ejs['render'](_0x6eaa2e,{'networks':_0x165a49||[]});fs[_0x3022('0x5a')](_0x3022('0x5b'),_0x21ff43);return respondWithRpcPromise(_0x3022('0x5c'),_0x3022('0x52'),{'module':_0x3022('0x5d')});}else if(_0x23f562[_0x3022('0x47')][_0x3022('0x56')]()=='TURN'){var _0x1a8d85=fs[_0x3022('0x57')](path[_0x3022('0x5e')](config[_0x3022('0x58')],_0x3022('0x5f')),_0x3022('0x59'));var _0x268ca8=ejs[_0x3022('0x60')](_0x1a8d85,{'networks':_0x165a49||[]});fs[_0x3022('0x5a')](_0x3022('0x61'),_0x268ca8);return respondWithRpcPromise('Reload',_0x3022('0x52'),{'module':_0x3022('0x5d')});}else{var _0x1d2d7e=fs['readFileSync'](path[_0x3022('0x5e')](config['root'],_0x3022('0x62')),_0x3022('0x59'));var _0x17933b=ejs[_0x3022('0x60')](_0x1d2d7e,{'networks':_0x165a49||[]});fs['writeFileSync'](util[_0x3022('0x63')]('/etc/asterisk/sip_xcally_%s.conf',_0x42e27c[_0x3022('0x55')][_0x3022('0x47')][_0x3022('0x64')]()),_0x17933b);return respondWithRpcPromise(_0x3022('0x5c'),_0x3022('0x52'),{'module':_0x3022('0x65')});}return null;})[_0x3022('0x30')](function(){return _0x23f562;});})[_0x3022('0x30')](respondWithResult(_0x20f1dd,0xc9))[_0x3022('0x22')](handleError(_0x20f1dd,null));};exports['update']=function(_0x39037c,_0x77913c,_0x12a9d6){var _0x3e375b;return db['sequelize'][_0x3022('0x54')](function(_0x414bc5){return db[_0x3022('0x34')][_0x3022('0x51')]({'where':{'id':_0x39037c[_0x3022('0x4e')]['id']}})[_0x3022('0x30')](handleEntityNotFound(_0x77913c,null))[_0x3022('0x30')](saveUpdates(_0x39037c[_0x3022('0x55')],null))[_0x3022('0x30')](function(_0x3d7b14){if(_0x3d7b14){_0x3e375b=_0x3d7b14;return db[_0x3022('0x34')][_0x3022('0x4b')]({'where':{'type':_0x3e375b[_0x3022('0x47')]},'raw':!![]});}return null;})[_0x3022('0x30')](function(_0x28cdc7){if(_0x3e375b['type']['toUpperCase']()=='STUN'){var _0x299f16=fs['readFileSync'](path[_0x3022('0x5e')](config['root'],_0x3022('0x66')),_0x3022('0x59'));var _0x371657=ejs[_0x3022('0x60')](_0x299f16,{'networks':_0x28cdc7||[]});fs[_0x3022('0x5a')](_0x3022('0x5b'),_0x371657);return respondWithRpcPromise(_0x3022('0x5c'),_0x3022('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x3e375b[_0x3022('0x47')][_0x3022('0x56')]()==_0x3022('0x67')){var _0x589155=fs['readFileSync'](path[_0x3022('0x5e')](config[_0x3022('0x58')],_0x3022('0x5f')),'utf8');var _0x4fddc6=ejs[_0x3022('0x60')](_0x589155,{'networks':_0x28cdc7||[]});fs[_0x3022('0x5a')](_0x3022('0x61'),_0x4fddc6);return respondWithRpcPromise(_0x3022('0x5c'),_0x3022('0x2f'),{'module':_0x3022('0x5d')});}else{var _0x4e2244=fs[_0x3022('0x57')](path[_0x3022('0x5e')](config[_0x3022('0x58')],_0x3022('0x62')),_0x3022('0x59'));var _0x448a96=ejs[_0x3022('0x60')](_0x4e2244,{'networks':_0x28cdc7||[]});fs[_0x3022('0x5a')](util[_0x3022('0x63')](_0x3022('0x68'),_0x39037c[_0x3022('0x55')][_0x3022('0x47')][_0x3022('0x64')]()),_0x448a96);return respondWithRpcPromise(_0x3022('0x5c'),_0x3022('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x3022('0x30')](function(_0x4bbb25){if(_0x4bbb25){return _0x3e375b;}return null;});})[_0x3022('0x30')](respondWithResult(_0x77913c,null))[_0x3022('0x22')](handleError(_0x77913c,null));};exports[_0x3022('0x69')]=function(_0x492bd3,_0x1ff776,_0x33c4f4){var _0x4ca8c9;return db[_0x3022('0x34')][_0x3022('0x51')]({'where':{'id':_0x492bd3['params']['id']}})[_0x3022('0x30')](function(_0x2a7115){_0x4ca8c9=_0x2a7115;return _0x2a7115;})[_0x3022('0x30')](handleEntityNotFound(_0x1ff776,null))['then'](removeEntity(_0x1ff776,null))[_0x3022('0x30')](function(){if(_0x4ca8c9){return db[_0x3022('0x34')]['findAll']({'where':{'type':_0x4ca8c9[_0x3022('0x47')]},'raw':!![]});}})['then'](function(_0xf938de){if(_0x4ca8c9[_0x3022('0x47')]['toUpperCase']()==_0x3022('0x6a')){var _0x4a1a41=fs['readFileSync'](path[_0x3022('0x5e')](config['root'],_0x3022('0x66')),_0x3022('0x59'));var _0x2bcc43=ejs['render'](_0x4a1a41,{'networks':_0xf938de||[]});fs[_0x3022('0x5a')](_0x3022('0x5b'),_0x2bcc43);return respondWithRpcPromise('Reload',_0x3022('0x69'),{'module':_0x3022('0x5d')});}else if(_0x4ca8c9['type'][_0x3022('0x56')]()=='TURN'){var _0x25ae9e=fs[_0x3022('0x57')](path['join'](config[_0x3022('0x58')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x35951d=ejs[_0x3022('0x60')](_0x25ae9e,{'networks':_0xf938de||[]});fs[_0x3022('0x5a')](_0x3022('0x61'),_0x35951d);return respondWithRpcPromise(_0x3022('0x5c'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x3c5d5e=fs['readFileSync'](path['join'](config['root'],_0x3022('0x62')),'utf8');var _0x401a54=ejs[_0x3022('0x60')](_0x3c5d5e,{'networks':_0xf938de||[]});fs[_0x3022('0x5a')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x492bd3[_0x3022('0x55')][_0x3022('0x47')][_0x3022('0x64')]()),_0x401a54);return respondWithRpcPromise(_0x3022('0x5c'),_0x3022('0x69'),{'module':_0x3022('0x65')});}return null;})[_0x3022('0x22')](handleError(_0x1ff776,null));}; \ No newline at end of file +var _0xbed7=['writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','STUN','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','reject','save','update','destroy','end','sendStatus','stack','name','index','Network','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','fields','includeAll','find','create','sequelize','transaction','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8'];(function(_0x2c977c,_0x414c31){var _0x18132b=function(_0x4e5670){while(--_0x4e5670){_0x2c977c['push'](_0x2c977c['shift']());}};_0x18132b(++_0x414c31);}(_0xbed7,0x14b));var _0x7bed=function(_0xc2da2e,_0x243ec5){_0xc2da2e=_0xc2da2e-0x0;var _0x3f322f=_0xbed7[_0xc2da2e];return _0x3f322f;};'use strict';var emlformat=require(_0x7bed('0x0'));var rimraf=require(_0x7bed('0x1'));var zipdir=require(_0x7bed('0x2'));var jsonpatch=require(_0x7bed('0x3'));var rp=require(_0x7bed('0x4'));var moment=require('moment');var BPromise=require(_0x7bed('0x5'));var Mustache=require(_0x7bed('0x6'));var util=require(_0x7bed('0x7'));var path=require(_0x7bed('0x8'));var sox=require(_0x7bed('0x9'));var csv=require(_0x7bed('0xa'));var ejs=require(_0x7bed('0xb'));var fs=require('fs');var fs_extra=require(_0x7bed('0xc'));var _=require(_0x7bed('0xd'));var squel=require('squel');var crypto=require(_0x7bed('0xe'));var jsforce=require(_0x7bed('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7bed('0xa'));var querystring=require(_0x7bed('0x10'));var Papa=require('papaparse');var Redis=require(_0x7bed('0x11'));var authService=require(_0x7bed('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7bed('0x13'));var hardwareService=require(_0x7bed('0x14'));var logger=require(_0x7bed('0x15'))(_0x7bed('0x16'));var utils=require('../../config/utils');var config=require(_0x7bed('0x17'));var licenseUtil=require(_0x7bed('0x18'));var db=require(_0x7bed('0x19'))['db'];var jayson=require(_0x7bed('0x1a'));var client=jayson[_0x7bed('0x1b')][_0x7bed('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x58e75b,_0x1db60f,_0x218010,_0x157369){return new BPromise(function(_0x3befe2,_0x4aa30e){var _0x212864=_0x157369||client;return _0x212864[_0x7bed('0x1d')](_0x58e75b,_0x218010)[_0x7bed('0x1e')](function(_0x274ea8){logger[_0x7bed('0x1f')](_0x7bed('0x20'),_0x1db60f,_0x7bed('0x21'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x1db60f,_0x7bed('0x21'),JSON[_0x7bed('0x22')](_0x274ea8));if(_0x274ea8[_0x7bed('0x23')]){if(_0x274ea8[_0x7bed('0x23')][_0x7bed('0x24')]===0x1f4){logger[_0x7bed('0x23')](_0x7bed('0x20'),_0x1db60f,_0x274ea8[_0x7bed('0x23')][_0x7bed('0x25')]);return _0x4aa30e(_0x274ea8[_0x7bed('0x23')][_0x7bed('0x25')]);}logger[_0x7bed('0x23')]('Network,\x20%s,\x20%s',_0x1db60f,_0x274ea8[_0x7bed('0x23')][_0x7bed('0x25')]);return _0x3befe2(_0x274ea8[_0x7bed('0x23')][_0x7bed('0x25')]);}else{logger[_0x7bed('0x1f')](_0x7bed('0x20'),_0x1db60f,_0x7bed('0x21'));_0x3befe2(_0x274ea8[_0x7bed('0x26')][_0x7bed('0x25')]);}})[_0x7bed('0x27')](function(_0xe8d590){logger[_0x7bed('0x23')](_0x7bed('0x20'),_0x1db60f,_0xe8d590);_0x4aa30e(_0xe8d590);});});}function respondWithStatusCode(_0x42c63f,_0x31d6cc){_0x31d6cc=_0x31d6cc||0xcc;return function(_0x5941b5){if(_0x5941b5){return _0x42c63f['sendStatus'](_0x31d6cc);}return _0x42c63f['status'](_0x31d6cc)['end']();};}function respondWithResult(_0x39d4e2,_0x5b9e5b){_0x5b9e5b=_0x5b9e5b||0xc8;return function(_0x2e9f5c){if(_0x2e9f5c){return _0x39d4e2[_0x7bed('0x28')](_0x5b9e5b)[_0x7bed('0x29')](_0x2e9f5c);}};}function respondWithFilteredResult(_0x3c0116,_0x53e281){return function(_0xb1b1a7){if(_0xb1b1a7){var _0x2e34df=typeof _0x53e281[_0x7bed('0x2a')]===_0x7bed('0x2b')&&typeof _0x53e281[_0x7bed('0x2c')]===_0x7bed('0x2b');var _0x344403=_0xb1b1a7[_0x7bed('0x2d')];var _0x5e6d69=_0x2e34df?0x0:_0x53e281[_0x7bed('0x2a')];var _0x124f03=_0x2e34df?_0xb1b1a7[_0x7bed('0x2d')]:_0x53e281['offset']+_0x53e281[_0x7bed('0x2c')];var _0x5f498c;if(_0x124f03>=_0x344403){_0x124f03=_0x344403;_0x5f498c=0xc8;}else{_0x5f498c=0xce;}_0x3c0116[_0x7bed('0x28')](_0x5f498c);return _0x3c0116['set']('Content-Range',_0x5e6d69+'-'+_0x124f03+'/'+_0x344403)['json'](_0xb1b1a7);}return null;};}function patchUpdates(_0x115307){return function(_0x1825ff){try{jsonpatch['apply'](_0x1825ff,_0x115307,!![]);}catch(_0xe47356){return BPromise[_0x7bed('0x2e')](_0xe47356);}return _0x1825ff[_0x7bed('0x2f')]();};}function saveUpdates(_0x4866cf,_0x4d61d2){return function(_0x3f4b88){if(_0x3f4b88){return _0x3f4b88[_0x7bed('0x30')](_0x4866cf)[_0x7bed('0x1e')](function(_0x122080){return _0x122080;});}return null;};}function removeEntity(_0x1ac99f,_0x3aa8de){return function(_0x36f320){if(_0x36f320){return _0x36f320[_0x7bed('0x31')]()[_0x7bed('0x1e')](function(){_0x1ac99f[_0x7bed('0x28')](0xcc)[_0x7bed('0x32')]();});}};}function handleEntityNotFound(_0x21169b,_0x2dd7d6){return function(_0x548781){if(!_0x548781){_0x21169b[_0x7bed('0x33')](0x194);}return _0x548781;};}function handleError(_0x5c986a,_0x48bc71){_0x48bc71=_0x48bc71||0x1f4;return function(_0x22444c){logger[_0x7bed('0x23')](_0x22444c[_0x7bed('0x34')]);if(_0x22444c[_0x7bed('0x35')]){delete _0x22444c[_0x7bed('0x35')];}_0x5c986a['status'](_0x48bc71)['send'](_0x22444c);};}exports[_0x7bed('0x36')]=function(_0x21baef,_0x53ea5f){var _0x29ae5b={},_0x50818e={},_0x2eaadc={'count':0x0,'rows':[]};var _0x3840ec=_['map'](db[_0x7bed('0x37')][_0x7bed('0x38')],function(_0x46d050){return{'name':_0x46d050[_0x7bed('0x39')],'type':_0x46d050[_0x7bed('0x3a')][_0x7bed('0x3b')]};});_0x50818e['model']=_[_0x7bed('0x3c')](_0x3840ec,_0x7bed('0x35'));_0x50818e[_0x7bed('0x3d')]=_[_0x7bed('0x3e')](_0x21baef['query']);_0x50818e[_0x7bed('0x3f')]=_[_0x7bed('0x40')](_0x50818e[_0x7bed('0x41')],_0x50818e[_0x7bed('0x3d')]);_0x29ae5b[_0x7bed('0x42')]=_['intersection'](_0x50818e[_0x7bed('0x41')],qs['fields'](_0x21baef[_0x7bed('0x3d')]['fields']));_0x29ae5b[_0x7bed('0x42')]=_0x29ae5b['attributes']['length']?_0x29ae5b[_0x7bed('0x42')]:_0x50818e[_0x7bed('0x41')];if(!_0x21baef[_0x7bed('0x3d')][_0x7bed('0x43')]('nolimit')){_0x29ae5b['limit']=qs[_0x7bed('0x2c')](_0x21baef['query'][_0x7bed('0x2c')]);_0x29ae5b[_0x7bed('0x2a')]=qs[_0x7bed('0x2a')](_0x21baef[_0x7bed('0x3d')]['offset']);}_0x29ae5b[_0x7bed('0x44')]=qs['sort'](_0x21baef[_0x7bed('0x3d')][_0x7bed('0x45')]);_0x29ae5b[_0x7bed('0x46')]=qs['filters'](_[_0x7bed('0x47')](_0x21baef['query'],_0x50818e[_0x7bed('0x3f')]),_0x3840ec);if(_0x21baef[_0x7bed('0x3d')]['filter']){_0x29ae5b[_0x7bed('0x46')]=_[_0x7bed('0x48')](_0x29ae5b[_0x7bed('0x46')],{'$or':_[_0x7bed('0x3c')](_0x3840ec,function(_0x3f94b7){if(_0x3f94b7[_0x7bed('0x3a')]!=='VIRTUAL'){var _0x2ad9e6={};_0x2ad9e6[_0x3f94b7[_0x7bed('0x35')]]={'$like':'%'+_0x21baef['query'][_0x7bed('0x49')]+'%'};return _0x2ad9e6;}})});}_0x29ae5b=_[_0x7bed('0x48')]({},_0x29ae5b,_0x21baef[_0x7bed('0x4a')]);var _0x4fc489={'where':_0x29ae5b[_0x7bed('0x46')]};return db[_0x7bed('0x37')][_0x7bed('0x2d')](_0x4fc489)['then'](function(_0x5c8fdb){_0x2eaadc[_0x7bed('0x2d')]=_0x5c8fdb;if(_0x21baef['query']['includeAll']){_0x29ae5b[_0x7bed('0x4b')]=[{'all':!![]}];}return db[_0x7bed('0x37')][_0x7bed('0x4c')](_0x29ae5b);})[_0x7bed('0x1e')](function(_0xd4f4f2){_0x2eaadc[_0x7bed('0x4d')]=_0xd4f4f2;return _0x2eaadc;})[_0x7bed('0x1e')](respondWithFilteredResult(_0x53ea5f,_0x29ae5b))['catch'](handleError(_0x53ea5f,null));};exports[_0x7bed('0x4e')]=function(_0x4d0227,_0x51aa77){var _0x222b31={'raw':!![],'where':{'id':_0x4d0227[_0x7bed('0x4f')]['id']}},_0x343df3={};_0x343df3['model']=_['keys'](db[_0x7bed('0x37')][_0x7bed('0x38')]);_0x343df3[_0x7bed('0x3d')]=_['keys'](_0x4d0227['query']);_0x343df3[_0x7bed('0x3f')]=_[_0x7bed('0x40')](_0x343df3[_0x7bed('0x41')],_0x343df3[_0x7bed('0x3d')]);_0x222b31[_0x7bed('0x42')]=_[_0x7bed('0x40')](_0x343df3['model'],qs[_0x7bed('0x50')](_0x4d0227['query'][_0x7bed('0x50')]));_0x222b31[_0x7bed('0x42')]=_0x222b31[_0x7bed('0x42')]['length']?_0x222b31['attributes']:_0x343df3[_0x7bed('0x41')];if(_0x4d0227[_0x7bed('0x3d')][_0x7bed('0x51')]){_0x222b31['include']=[{'all':!![]}];}_0x222b31=_[_0x7bed('0x48')]({},_0x222b31,_0x4d0227[_0x7bed('0x4a')]);return db[_0x7bed('0x37')][_0x7bed('0x52')](_0x222b31)[_0x7bed('0x1e')](handleEntityNotFound(_0x51aa77,null))[_0x7bed('0x1e')](respondWithResult(_0x51aa77,null))['catch'](handleError(_0x51aa77,null));};exports[_0x7bed('0x53')]=function(_0x501e76,_0x15524e,_0x303e2a){var _0x3fe492;return db[_0x7bed('0x54')][_0x7bed('0x55')](function(_0x4c152d){return db['Network']['create'](_0x501e76[_0x7bed('0x56')],{'raw':!![]})['then'](function(_0x331117){_0x3fe492=_0x331117;return db[_0x7bed('0x37')][_0x7bed('0x4c')]({'where':{'type':_0x501e76['body']['type']},'raw':!![]});})['then'](function(_0x4a3d8e){if(_0x3fe492[_0x7bed('0x3a')][_0x7bed('0x57')]()=='STUN'){var _0x586628=fs[_0x7bed('0x58')](path[_0x7bed('0x59')](config[_0x7bed('0x5a')],_0x7bed('0x5b')),_0x7bed('0x5c'));var _0x2f6864=ejs['render'](_0x586628,{'networks':_0x4a3d8e||[]});fs[_0x7bed('0x5d')](_0x7bed('0x5e'),_0x2f6864);return respondWithRpcPromise('Reload',_0x7bed('0x53'),{'module':_0x7bed('0x5f')});}else if(_0x3fe492['type'][_0x7bed('0x57')]()==_0x7bed('0x60')){var _0x2557f7=fs[_0x7bed('0x58')](path[_0x7bed('0x59')](config[_0x7bed('0x5a')],_0x7bed('0x61')),'utf8');var _0x568394=ejs[_0x7bed('0x62')](_0x2557f7,{'networks':_0x4a3d8e||[]});fs[_0x7bed('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x568394);return respondWithRpcPromise(_0x7bed('0x63'),'create',{'module':_0x7bed('0x5f')});}else{var _0x53e868=fs['readFileSync'](path['join'](config[_0x7bed('0x5a')],_0x7bed('0x64')),_0x7bed('0x5c'));var _0x2062a4=ejs[_0x7bed('0x62')](_0x53e868,{'networks':_0x4a3d8e||[]});fs[_0x7bed('0x5d')](util[_0x7bed('0x65')](_0x7bed('0x66'),_0x501e76[_0x7bed('0x56')]['type'][_0x7bed('0x67')]()),_0x2062a4);return respondWithRpcPromise(_0x7bed('0x63'),_0x7bed('0x53'),{'module':'chan_sip.so'});}return null;})[_0x7bed('0x1e')](function(){return _0x3fe492;});})['then'](respondWithResult(_0x15524e,0xc9))['catch'](handleError(_0x15524e,null));};exports[_0x7bed('0x30')]=function(_0x1ab485,_0x565cd0,_0x5db5df){var _0xbad82f;return db[_0x7bed('0x54')][_0x7bed('0x55')](function(_0x5e6490){return db[_0x7bed('0x37')][_0x7bed('0x52')]({'where':{'id':_0x1ab485[_0x7bed('0x4f')]['id']}})[_0x7bed('0x1e')](handleEntityNotFound(_0x565cd0,null))['then'](saveUpdates(_0x1ab485[_0x7bed('0x56')],null))[_0x7bed('0x1e')](function(_0x20b882){if(_0x20b882){_0xbad82f=_0x20b882;return db['Network'][_0x7bed('0x4c')]({'where':{'type':_0xbad82f['type']},'raw':!![]});}return null;})[_0x7bed('0x1e')](function(_0x1c1764){if(_0xbad82f[_0x7bed('0x3a')]['toUpperCase']()==_0x7bed('0x68')){var _0x4f23b2=fs[_0x7bed('0x58')](path[_0x7bed('0x59')](config['root'],_0x7bed('0x5b')),'utf8');var _0x118c28=ejs[_0x7bed('0x62')](_0x4f23b2,{'networks':_0x1c1764||[]});fs[_0x7bed('0x5d')]('/etc/asterisk/stun_xcally.conf',_0x118c28);return respondWithRpcPromise('Reload',_0x7bed('0x30'),{'module':_0x7bed('0x5f')});}else if(_0xbad82f[_0x7bed('0x3a')][_0x7bed('0x57')]()==_0x7bed('0x60')){var _0x4de473=fs[_0x7bed('0x58')](path[_0x7bed('0x59')](config['root'],_0x7bed('0x61')),'utf8');var _0x5591a4=ejs[_0x7bed('0x62')](_0x4de473,{'networks':_0x1c1764||[]});fs[_0x7bed('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x5591a4);return respondWithRpcPromise(_0x7bed('0x63'),_0x7bed('0x30'),{'module':_0x7bed('0x5f')});}else{var _0x1367a4=fs['readFileSync'](path['join'](config[_0x7bed('0x5a')],_0x7bed('0x64')),_0x7bed('0x5c'));var _0x2d2db0=ejs[_0x7bed('0x62')](_0x1367a4,{'networks':_0x1c1764||[]});fs['writeFileSync'](util[_0x7bed('0x65')](_0x7bed('0x66'),_0x1ab485[_0x7bed('0x56')]['type'][_0x7bed('0x67')]()),_0x2d2db0);return respondWithRpcPromise(_0x7bed('0x63'),_0x7bed('0x30'),{'module':'chan_sip.so'});}return null;})[_0x7bed('0x1e')](function(_0x57cc8d){if(_0x57cc8d){return _0xbad82f;}return null;});})[_0x7bed('0x1e')](respondWithResult(_0x565cd0,null))['catch'](handleError(_0x565cd0,null));};exports[_0x7bed('0x31')]=function(_0xefc310,_0x3320df,_0x279c15){var _0x59660b;return db[_0x7bed('0x37')]['find']({'where':{'id':_0xefc310[_0x7bed('0x4f')]['id']}})[_0x7bed('0x1e')](function(_0x5cc453){_0x59660b=_0x5cc453;return _0x5cc453;})['then'](handleEntityNotFound(_0x3320df,null))[_0x7bed('0x1e')](removeEntity(_0x3320df,null))[_0x7bed('0x1e')](function(){if(_0x59660b){return db[_0x7bed('0x37')]['findAll']({'where':{'type':_0x59660b[_0x7bed('0x3a')]},'raw':!![]});}})[_0x7bed('0x1e')](function(_0x398f5e){if(_0x59660b[_0x7bed('0x3a')][_0x7bed('0x57')]()==_0x7bed('0x68')){var _0x343fee=fs[_0x7bed('0x58')](path['join'](config[_0x7bed('0x5a')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x20370a=ejs[_0x7bed('0x62')](_0x343fee,{'networks':_0x398f5e||[]});fs['writeFileSync'](_0x7bed('0x5e'),_0x20370a);return respondWithRpcPromise('Reload',_0x7bed('0x31'),{'module':_0x7bed('0x5f')});}else if(_0x59660b[_0x7bed('0x3a')][_0x7bed('0x57')]()==_0x7bed('0x60')){var _0x17e3b2=fs['readFileSync'](path['join'](config['root'],_0x7bed('0x61')),_0x7bed('0x5c'));var _0x5b9d65=ejs[_0x7bed('0x62')](_0x17e3b2,{'networks':_0x398f5e||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x5b9d65);return respondWithRpcPromise(_0x7bed('0x63'),_0x7bed('0x31'),{'module':_0x7bed('0x5f')});}else{var _0xdd7df=fs['readFileSync'](path[_0x7bed('0x59')](config['root'],_0x7bed('0x64')),_0x7bed('0x5c'));var _0x3ad022=ejs[_0x7bed('0x62')](_0xdd7df,{'networks':_0x398f5e||[]});fs[_0x7bed('0x5d')](util[_0x7bed('0x65')](_0x7bed('0x66'),_0xefc310[_0x7bed('0x56')][_0x7bed('0x3a')][_0x7bed('0x67')]()),_0x3ad022);return respondWithRpcPromise('Reload',_0x7bed('0x31'),{'module':_0x7bed('0x69')});}return null;})[_0x7bed('0x27')](handleError(_0x3320df,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d2cc8f2..e80f1b3 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 _0x402f=['exports','define','Network','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x93b697,_0x487b6e){var _0xe7ab75=function(_0x9edfc0){while(--_0x9edfc0){_0x93b697['push'](_0x93b697['shift']());}};_0xe7ab75(++_0x487b6e);}(_0x402f,0x6f));var _0xf402=function(_0x39a6c2,_0x2b857f){_0x39a6c2=_0x39a6c2-0x0;var _0x3fab75=_0x402f[_0x39a6c2];return _0x3fab75;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var logger=require(_0xf402('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf402('0x2'));var rp=require(_0xf402('0x3'));var fs=require('fs');var path=require(_0xf402('0x4'));var rimraf=require('rimraf');var config=require(_0xf402('0x5'));var attributes=require('./network.attributes');module[_0xf402('0x6')]=function(_0x270766,_0x3a1d11){return _0x270766[_0xf402('0x7')](_0xf402('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x402f=['exports','define','Network','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x4373c7,_0x3ec748){var _0x249dc9=function(_0xb1e97){while(--_0xb1e97){_0x4373c7['push'](_0x4373c7['shift']());}};_0x249dc9(++_0x3ec748);}(_0x402f,0x6f));var _0xf402=function(_0x2e1c68,_0x3c0dec){_0x2e1c68=_0x2e1c68-0x0;var _0x30133f=_0x402f[_0x2e1c68];return _0x30133f;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var logger=require(_0xf402('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf402('0x2'));var rp=require(_0xf402('0x3'));var fs=require('fs');var path=require(_0xf402('0x4'));var rimraf=require('rimraf');var config=require(_0xf402('0x5'));var attributes=require('./network.attributes');module[_0xf402('0x6')]=function(_0x270766,_0x3a1d11){return _0x270766[_0xf402('0x7')](_0xf402('0x8'),attributes,{'tableName':'network','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 1a77625..ea701f8 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x339bdf,_0x5a7c54){_0x339bdf=_0x339bdf-0x0;var _0x269e61=_0x7a54[_0x339bdf];return _0x269e61;};'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(_0x227c75,_0x331ff9){var _0x345a9b=function(_0x3f9d17){while(--_0x3f9d17){_0x227c75['push'](_0x227c75['shift']());}};_0x345a9b(++_0x331ff9);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 0d23af5..9b85398 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 _0xa6f6=['post','addDisposition','addAnswer','/:id/notify','notify','addApplications','update','delete','destroy','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents'];(function(_0x2334b3,_0x79e62f){var _0x3b44de=function(_0x412b3e){while(--_0x412b3e){_0x2334b3['push'](_0x2334b3['shift']());}};_0x3b44de(++_0x79e62f);}(_0xa6f6,0x134));var _0x6a6f=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xa6f6[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0x6a6f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6a6f('0x1'));var express=require(_0x6a6f('0x2'));var router=express[_0x6a6f('0x3')]();var fs_extra=require(_0x6a6f('0x4'));var auth=require(_0x6a6f('0x5'));var interaction=require(_0x6a6f('0x6'));var config=require(_0x6a6f('0x7'));var controller=require('./openchannelAccount.controller');router[_0x6a6f('0x8')]('/',auth[_0x6a6f('0x9')](),controller[_0x6a6f('0xa')]);router[_0x6a6f('0x8')](_0x6a6f('0xb'),auth['isAuthenticated'](),controller[_0x6a6f('0xc')]);router[_0x6a6f('0x8')](_0x6a6f('0xd'),auth['isAuthenticated'](),controller[_0x6a6f('0xe')]);router[_0x6a6f('0x8')](_0x6a6f('0xf'),auth['isAuthenticated'](),controller[_0x6a6f('0x10')]);router['get'](_0x6a6f('0x11'),auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x12')]);router[_0x6a6f('0x8')](_0x6a6f('0x13'),auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x14')]);router['get'](_0x6a6f('0x15'),auth['isAuthenticated'](),controller[_0x6a6f('0x16')]);router['get'](_0x6a6f('0x17'),auth['isAuthenticated'](),controller[_0x6a6f('0x18')]);router[_0x6a6f('0x19')]('/',auth[_0x6a6f('0x9')](),controller['create']);router[_0x6a6f('0x19')](_0x6a6f('0xf'),auth['isAuthenticated'](),controller[_0x6a6f('0x1a')]);router[_0x6a6f('0x19')]('/:id/canned_answers',auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x1b')]);router[_0x6a6f('0x19')](_0x6a6f('0x1c'),controller[_0x6a6f('0x1d')]);router[_0x6a6f('0x19')](_0x6a6f('0x13'),auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x1e')]);router[_0x6a6f('0x19')](_0x6a6f('0x17'),auth[_0x6a6f('0x9')](),controller['addAgents']);router[_0x6a6f('0x19')]('/:id/send',auth['isAuthenticated'](),controller['send']);router['put'](_0x6a6f('0xd'),auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x1f')]);router[_0x6a6f('0x20')](_0x6a6f('0xd'),auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x21')]);router[_0x6a6f('0x20')](_0x6a6f('0xf'),auth[_0x6a6f('0x9')](),controller['removeDispositions']);router['delete'](_0x6a6f('0x11'),auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x22')]);router[_0x6a6f('0x20')]('/:id/users',auth[_0x6a6f('0x9')](),controller[_0x6a6f('0x23')]);module[_0x6a6f('0x24')]=router; \ No newline at end of file +var _0xead8=['get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','/:id/users','getAgents','addDisposition','addAnswer','post','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','/:id','delete','destroy','removeAnswers','exports','util','path','express','Router','../../components/interaction/service','./openchannelAccount.controller'];(function(_0x3b0e61,_0x3dfa28){var _0x16dbcd=function(_0x2b31fb){while(--_0x2b31fb){_0x3b0e61['push'](_0x3b0e61['shift']());}};_0x16dbcd(++_0x3dfa28);}(_0xead8,0x19e));var _0x8ead=function(_0x3d7f0e,_0x104d69){_0x3d7f0e=_0x3d7f0e-0x0;var _0x3e45dd=_0xead8[_0x3d7f0e];return _0x3e45dd;};'use strict';var multer=require('multer');var util=require(_0x8ead('0x0'));var path=require(_0x8ead('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ead('0x2'));var router=express[_0x8ead('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8ead('0x4'));var config=require('../../config/environment');var controller=require(_0x8ead('0x5'));router[_0x8ead('0x6')]('/',auth[_0x8ead('0x7')](),controller[_0x8ead('0x8')]);router[_0x8ead('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x8ead('0x9')]);router[_0x8ead('0x6')]('/:id',auth[_0x8ead('0x7')](),controller[_0x8ead('0xa')]);router['get'](_0x8ead('0xb'),auth['isAuthenticated'](),controller[_0x8ead('0xc')]);router[_0x8ead('0x6')](_0x8ead('0xd'),auth['isAuthenticated'](),controller[_0x8ead('0xe')]);router['get']('/:id/applications',auth[_0x8ead('0x7')](),controller[_0x8ead('0xf')]);router[_0x8ead('0x6')](_0x8ead('0x10'),auth[_0x8ead('0x7')](),controller['getInteractions']);router[_0x8ead('0x6')](_0x8ead('0x11'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x12')]);router['post']('/',auth[_0x8ead('0x7')](),controller['create']);router['post'](_0x8ead('0xb'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x13')]);router['post'](_0x8ead('0xd'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x14')]);router[_0x8ead('0x15')](_0x8ead('0x16'),controller[_0x8ead('0x17')]);router[_0x8ead('0x15')](_0x8ead('0x18'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x19')]);router[_0x8ead('0x15')](_0x8ead('0x11'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x1a')]);router[_0x8ead('0x15')](_0x8ead('0x1b'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x1c')]);router[_0x8ead('0x1d')](_0x8ead('0x1e'),auth[_0x8ead('0x7')](),controller['update']);router[_0x8ead('0x1f')](_0x8ead('0x1e'),auth[_0x8ead('0x7')](),controller[_0x8ead('0x20')]);router[_0x8ead('0x1f')](_0x8ead('0xb'),auth[_0x8ead('0x7')](),controller['removeDispositions']);router[_0x8ead('0x1f')](_0x8ead('0xd'),auth['isAuthenticated'](),controller[_0x8ead('0x21')]);router['delete'](_0x8ead('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x8ead('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 6285ebe..f97ff5c 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 _0x1861=['STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x283545,_0x1ec447){var _0xd68eb4=function(_0x5d0076){while(--_0x5d0076){_0x283545['push'](_0x283545['shift']());}};_0xd68eb4(++_0x1ec447);}(_0x1861,0x171));var _0x1186=function(_0x461245,_0x5bc827){_0x461245=_0x461245-0x0;var _0x1d3314=_0x1861[_0x461245];return _0x1d3314;};'use strict';var Sequelize=require(_0x1186('0x0'));var rs=require(_0x1186('0x1'));module[_0x1186('0x2')]={'name':{'type':Sequelize[_0x1186('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x1186('0x3')]},'token':{'type':Sequelize[_0x1186('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1186('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1186('0x4')],'defaultValue':function(){return _0x1186('0x5');}},'notificationSound':{'type':Sequelize[_0x1186('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1186('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x1186('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1186('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1186('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1186('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1186('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1186('0x8'),'set':function(_0x13df7b){if(!_0x13df7b)this['setDataValue'](_0x1186('0x9'),null);this[_0x1186('0xa')](_0x1186('0xb'),_0x13df7b);}}}; \ No newline at end of file +var _0x107e=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x566afa,_0x3e0e4d){var _0x28f150=function(_0x4f3211){while(--_0x4f3211){_0x566afa['push'](_0x566afa['shift']());}};_0x28f150(++_0x3e0e4d);}(_0x107e,0x154));var _0xe107=function(_0x47c987,_0x4efc23){_0x47c987=_0x47c987-0x0;var _0x138d75=_0x107e[_0x47c987];return _0x138d75;};'use strict';var Sequelize=require(_0xe107('0x0'));var rs=require(_0xe107('0x1'));module['exports']={'name':{'type':Sequelize[_0xe107('0x2')],'unique':_0xe107('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xe107('0x2')]},'token':{'type':Sequelize[_0xe107('0x2')],'defaultValue':function(){return rs[_0xe107('0x4')]();}},'replyUri':{'type':Sequelize[_0xe107('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xe107('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe107('0x5');}},'notificationSound':{'type':Sequelize[_0xe107('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe107('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe107('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xe107('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe107('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe107('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xe107('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe107('0x6')],'defaultValue':![],'comment':_0xe107('0x9'),'set':function(_0x2b81ae){if(!_0x2b81ae)this[_0xe107('0xa')](_0xe107('0xb'),null);this[_0xe107('0xa')](_0xe107('0xc'),_0x2b81ae);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 44546a0..9d70855 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 _0xd8c4=['nolimit','order','sort','where','pick','filter','merge','includeAll','include','catch','keys','rawAttributes','options','create','body','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','find','params','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','ValidationError','includes','mapKey','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','from','ListId','contact','firstName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','lastName','messageId','interaction','created','autoclose','close','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','get','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x16f7c3,_0x7cc6bd){var _0x259a52=function(_0x5d494a){while(--_0x5d494a){_0x16f7c3['push'](_0x16f7c3['shift']());}};_0x259a52(++_0x7cc6bd);}(_0xd8c4,0x123));var _0x4d8c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xd8c4[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d8c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d8c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d8c('0x2'));var Mustache=require('mustache');var util=require(_0x4d8c('0x3'));var path=require(_0x4d8c('0x4'));var sox=require(_0x4d8c('0x5'));var csv=require('to-csv');var ejs=require(_0x4d8c('0x6'));var fs=require('fs');var fs_extra=require(_0x4d8c('0x7'));var _=require('lodash');var squel=require(_0x4d8c('0x8'));var crypto=require(_0x4d8c('0x9'));var jsforce=require(_0x4d8c('0xa'));var deskjs=require(_0x4d8c('0xb'));var toCsv=require(_0x4d8c('0xc'));var querystring=require(_0x4d8c('0xd'));var Papa=require('papaparse');var Redis=require(_0x4d8c('0xe'));var authService=require(_0x4d8c('0xf'));var qs=require(_0x4d8c('0x10'));var as=require(_0x4d8c('0x11'));var hardwareService=require(_0x4d8c('0x12'));var logger=require(_0x4d8c('0x13'))(_0x4d8c('0x14'));var utils=require(_0x4d8c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4d8c('0x16'))['db'];config[_0x4d8c('0x17')]=_[_0x4d8c('0x18')](config['redis'],{'host':_0x4d8c('0x19'),'port':0x18eb});var socket=require(_0x4d8c('0x1a'))(new Redis(config[_0x4d8c('0x17')]));require(_0x4d8c('0x1b'))['register'](socket);var jayson=require(_0x4d8c('0x1c'));var client=jayson[_0x4d8c('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x4d8c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x93c93c,_0x5953e7,_0x501c53,_0x654ec8){return new BPromise(function(_0x5e0346,_0x165c84){var _0x5b3923=_0x654ec8||client;return _0x5b3923[_0x4d8c('0x1e')](_0x93c93c,_0x501c53)[_0x4d8c('0x1f')](function(_0x551e87){logger['info'](_0x4d8c('0x20'),_0x5953e7,'request\x20sent');logger[_0x4d8c('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5953e7,'request\x20sent',JSON[_0x4d8c('0x22')](_0x551e87));if(_0x551e87[_0x4d8c('0x23')]){if(_0x551e87['error']['code']===0x1f4){logger['error'](_0x4d8c('0x20'),_0x5953e7,_0x551e87[_0x4d8c('0x23')][_0x4d8c('0x24')]);return _0x165c84(_0x551e87[_0x4d8c('0x23')][_0x4d8c('0x24')]);}logger[_0x4d8c('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x5953e7,_0x551e87[_0x4d8c('0x23')][_0x4d8c('0x24')]);return _0x5e0346(_0x551e87[_0x4d8c('0x23')][_0x4d8c('0x24')]);}else{logger['info'](_0x4d8c('0x20'),_0x5953e7,_0x4d8c('0x25'));_0x5e0346(_0x551e87[_0x4d8c('0x26')][_0x4d8c('0x24')]);}})['catch'](function(_0x2a699b){logger[_0x4d8c('0x23')](_0x4d8c('0x20'),_0x5953e7,_0x2a699b);_0x165c84(_0x2a699b);});});}function respondWithStatusCode(_0x19e4f1,_0x37e7a0){_0x37e7a0=_0x37e7a0||0xcc;return function(_0x24dd14){if(_0x24dd14){return _0x19e4f1[_0x4d8c('0x27')](_0x37e7a0);}return _0x19e4f1[_0x4d8c('0x28')](_0x37e7a0)[_0x4d8c('0x29')]();};}function respondWithResult(_0x5653c5,_0x286050){_0x286050=_0x286050||0xc8;return function(_0xf82abe){if(_0xf82abe){return _0x5653c5[_0x4d8c('0x28')](_0x286050)['json'](_0xf82abe);}};}function respondWithFilteredResult(_0x12a4a8,_0x143e8a){return function(_0x200bdc){if(_0x200bdc){var _0x427343=typeof _0x143e8a[_0x4d8c('0x2a')]===_0x4d8c('0x2b')&&typeof _0x143e8a[_0x4d8c('0x2c')]==='undefined';var _0x44fcdb=_0x200bdc[_0x4d8c('0x2d')];var _0x2d9ab5=_0x427343?0x0:_0x143e8a['offset'];var _0x19334d=_0x427343?_0x200bdc['count']:_0x143e8a[_0x4d8c('0x2a')]+_0x143e8a[_0x4d8c('0x2c')];var _0x2ed3cc;if(_0x19334d>=_0x44fcdb){_0x19334d=_0x44fcdb;_0x2ed3cc=0xc8;}else{_0x2ed3cc=0xce;}_0x12a4a8[_0x4d8c('0x28')](_0x2ed3cc);return _0x12a4a8[_0x4d8c('0x2e')](_0x4d8c('0x2f'),_0x2d9ab5+'-'+_0x19334d+'/'+_0x44fcdb)[_0x4d8c('0x30')](_0x200bdc);}return null;};}function patchUpdates(_0x15d3a0){return function(_0x3b4669){try{jsonpatch[_0x4d8c('0x31')](_0x3b4669,_0x15d3a0,!![]);}catch(_0xf88eea){return BPromise['reject'](_0xf88eea);}return _0x3b4669['save']();};}function saveUpdates(_0x547ff2,_0x5b6dcc){return function(_0x9f7202){if(_0x9f7202){return _0x9f7202[_0x4d8c('0x32')](_0x547ff2)[_0x4d8c('0x1f')](function(_0x4e0813){return _0x4e0813;});}return null;};}function removeEntity(_0x40b286,_0x5bc7f8){return function(_0x177284){if(_0x177284){return _0x177284[_0x4d8c('0x33')]()[_0x4d8c('0x1f')](function(){var _0x59e000=_0x177284[_0x4d8c('0x34')]({'plain':!![]});var _0x124203='OpenchannelAccounts';return db['UserProfileResource'][_0x4d8c('0x33')]({'where':{'type':_0x124203,'resourceId':_0x59e000['id']}})[_0x4d8c('0x1f')](function(){return _0x177284;});})[_0x4d8c('0x1f')](function(){_0x40b286[_0x4d8c('0x28')](0xcc)[_0x4d8c('0x29')]();});}};}function handleEntityNotFound(_0x56beb0,_0x4fc82a){return function(_0x36d445){if(!_0x36d445){_0x56beb0[_0x4d8c('0x27')](0x194);}return _0x36d445;};}function handleError(_0x3e25f6,_0x4910ce){_0x4910ce=_0x4910ce||0x1f4;return function(_0x1b3244){logger[_0x4d8c('0x23')](_0x1b3244['stack']);if(_0x1b3244['name']){delete _0x1b3244[_0x4d8c('0x35')];}_0x3e25f6[_0x4d8c('0x28')](_0x4910ce)[_0x4d8c('0x36')](_0x1b3244);};}exports[_0x4d8c('0x37')]=function(_0x25f5e7,_0x5b784b){var _0x5a933a={'include':[{'model':db[_0x4d8c('0x38')],'as':_0x4d8c('0x39')}]},_0x35a173={},_0x4a9d39={'count':0x0,'rows':[]};var _0x7391aa=_[_0x4d8c('0x3a')](db[_0x4d8c('0x3b')]['rawAttributes'],function(_0x5585cc){return{'name':_0x5585cc[_0x4d8c('0x3c')],'type':_0x5585cc[_0x4d8c('0x3d')][_0x4d8c('0x3e')]};});_0x35a173[_0x4d8c('0x3f')]=_[_0x4d8c('0x3a')](_0x7391aa,_0x4d8c('0x35'));_0x35a173[_0x4d8c('0x40')]=_['keys'](_0x25f5e7[_0x4d8c('0x40')]);_0x35a173[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x35a173[_0x4d8c('0x3f')],_0x35a173[_0x4d8c('0x40')]);_0x5a933a['attributes']=_[_0x4d8c('0x42')](_0x35a173['model'],qs[_0x4d8c('0x43')](_0x25f5e7[_0x4d8c('0x40')][_0x4d8c('0x43')]));_0x5a933a[_0x4d8c('0x44')]=_0x5a933a['attributes'][_0x4d8c('0x45')]?_0x5a933a[_0x4d8c('0x44')]:_0x35a173[_0x4d8c('0x3f')];if(!_0x25f5e7[_0x4d8c('0x40')][_0x4d8c('0x46')](_0x4d8c('0x47'))){_0x5a933a[_0x4d8c('0x2c')]=qs[_0x4d8c('0x2c')](_0x25f5e7[_0x4d8c('0x40')][_0x4d8c('0x2c')]);_0x5a933a['offset']=qs[_0x4d8c('0x2a')](_0x25f5e7['query'][_0x4d8c('0x2a')]);}_0x5a933a[_0x4d8c('0x48')]=qs[_0x4d8c('0x49')](_0x25f5e7['query'][_0x4d8c('0x49')]);_0x5a933a[_0x4d8c('0x4a')]=qs[_0x4d8c('0x41')](_[_0x4d8c('0x4b')](_0x25f5e7[_0x4d8c('0x40')],_0x35a173['filters']),_0x7391aa);if(_0x25f5e7[_0x4d8c('0x40')][_0x4d8c('0x4c')]){_0x5a933a[_0x4d8c('0x4a')]=_[_0x4d8c('0x4d')](_0x5a933a[_0x4d8c('0x4a')],{'$or':_[_0x4d8c('0x3a')](_0x7391aa,function(_0x2b76b3){if(_0x2b76b3[_0x4d8c('0x3d')]!=='VIRTUAL'){var _0x158878={};_0x158878[_0x2b76b3[_0x4d8c('0x35')]]={'$like':'%'+_0x25f5e7[_0x4d8c('0x40')][_0x4d8c('0x4c')]+'%'};return _0x158878;}})});}_0x5a933a=_[_0x4d8c('0x4d')]({},_0x5a933a,_0x25f5e7['options']);var _0x4de5d2={'where':_0x5a933a[_0x4d8c('0x4a')]};return db['OpenchannelAccount'][_0x4d8c('0x2d')](_0x4de5d2)[_0x4d8c('0x1f')](function(_0x1307ff){_0x4a9d39[_0x4d8c('0x2d')]=_0x1307ff;if(_0x25f5e7[_0x4d8c('0x40')][_0x4d8c('0x4e')]){_0x5a933a[_0x4d8c('0x4f')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x5a933a);})[_0x4d8c('0x1f')](function(_0xb64a73){_0x4a9d39['rows']=_0xb64a73;return _0x4a9d39;})[_0x4d8c('0x1f')](respondWithFilteredResult(_0x5b784b,_0x5a933a))[_0x4d8c('0x50')](handleError(_0x5b784b,null));};exports['show']=function(_0x25877f,_0x5beb6e){var _0x4e6161={'raw':![],'where':{'id':_0x25877f['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3b24db={};_0x3b24db[_0x4d8c('0x3f')]=_[_0x4d8c('0x51')](db[_0x4d8c('0x3b')][_0x4d8c('0x52')]);_0x3b24db[_0x4d8c('0x40')]=_['keys'](_0x25877f['query']);_0x3b24db[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x3b24db[_0x4d8c('0x3f')],_0x3b24db[_0x4d8c('0x40')]);_0x4e6161['attributes']=_[_0x4d8c('0x42')](_0x3b24db['model'],qs['fields'](_0x25877f[_0x4d8c('0x40')]['fields']));_0x4e6161[_0x4d8c('0x44')]=_0x4e6161[_0x4d8c('0x44')][_0x4d8c('0x45')]?_0x4e6161['attributes']:_0x3b24db['model'];if(_0x25877f[_0x4d8c('0x40')][_0x4d8c('0x4e')]){_0x4e6161[_0x4d8c('0x4f')]=[{'all':!![]}];}_0x4e6161=_[_0x4d8c('0x4d')]({},_0x4e6161,_0x25877f[_0x4d8c('0x53')]);return db[_0x4d8c('0x3b')]['find'](_0x4e6161)[_0x4d8c('0x1f')](handleEntityNotFound(_0x5beb6e,null))[_0x4d8c('0x1f')](respondWithResult(_0x5beb6e,null))['catch'](handleError(_0x5beb6e,null));};exports[_0x4d8c('0x54')]=function(_0x52e507,_0x1b0d86){return db[_0x4d8c('0x3b')][_0x4d8c('0x54')](_0x52e507[_0x4d8c('0x55')],{})[_0x4d8c('0x1f')](function(_0x8f0f1e){var _0x18f161=_0x52e507[_0x4d8c('0x56')]['get']({'plain':!![]});if(!_0x18f161)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18f161['role']===_0x4d8c('0x56')){var _0x4c23c6=_0x8f0f1e[_0x4d8c('0x34')]({'plain':!![]});var _0x147c2b=_0x4d8c('0x57');return db[_0x4d8c('0x58')]['find']({'where':{'name':_0x147c2b,'userProfileId':_0x18f161[_0x4d8c('0x59')]},'raw':!![]})[_0x4d8c('0x1f')](function(_0xe53216){if(_0xe53216&&_0xe53216[_0x4d8c('0x5a')]===0x0){return db['UserProfileResource'][_0x4d8c('0x54')]({'name':_0x4c23c6[_0x4d8c('0x35')],'resourceId':_0x4c23c6['id'],'type':_0xe53216['name'],'sectionId':_0xe53216['id']},{})[_0x4d8c('0x1f')](function(){return _0x8f0f1e;});}else{return _0x8f0f1e;}})[_0x4d8c('0x50')](function(_0x2a2866){logger[_0x4d8c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a2866);throw _0x2a2866;});}return _0x8f0f1e;})['then'](respondWithResult(_0x1b0d86,0xc9))[_0x4d8c('0x50')](handleError(_0x1b0d86,null));};exports[_0x4d8c('0x32')]=function(_0xc3e0ee,_0xb6f254){if(_0xc3e0ee[_0x4d8c('0x55')]['id']){delete _0xc3e0ee['body']['id'];}return db[_0x4d8c('0x3b')][_0x4d8c('0x5b')]({'where':{'id':_0xc3e0ee[_0x4d8c('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x4d8c('0x39')}]})['then'](handleEntityNotFound(_0xb6f254,null))[_0x4d8c('0x1f')](saveUpdates(_0xc3e0ee[_0x4d8c('0x55')],null))[_0x4d8c('0x1f')](respondWithResult(_0xb6f254,null))[_0x4d8c('0x50')](handleError(_0xb6f254,null));};exports[_0x4d8c('0x33')]=function(_0x500efb,_0x1fdbb2){return db['OpenchannelAccount']['find']({'where':{'id':_0x500efb[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x1fdbb2,null))['then'](removeEntity(_0x1fdbb2,null))['catch'](handleError(_0x1fdbb2,null));};exports[_0x4d8c('0x5d')]=function(_0x335235,_0x4d415f){return db[_0x4d8c('0x3b')][_0x4d8c('0x5d')]()[_0x4d8c('0x1f')](respondWithResult(_0x4d415f,null))[_0x4d8c('0x50')](handleError(_0x4d415f,null));};exports[_0x4d8c('0x5e')]=function(_0x22e9b7,_0x21b4ae,_0x321708){if(_0x22e9b7['body']['id']){delete _0x22e9b7[_0x4d8c('0x55')]['id'];}return db[_0x4d8c('0x3b')][_0x4d8c('0x5b')]({'where':{'id':_0x22e9b7[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x21b4ae,null))[_0x4d8c('0x1f')](function(_0x38f058){if(_0x38f058){_0x22e9b7[_0x4d8c('0x55')][_0x4d8c('0x5f')]=_0x38f058['id'];return db[_0x4d8c('0x60')]['create'](_0x22e9b7[_0x4d8c('0x55')]);}})[_0x4d8c('0x1f')](respondWithResult(_0x21b4ae,null))['catch'](handleError(_0x21b4ae,null));};exports['getDispositions']=function(_0x1e7718,_0x306cce,_0x336271){var _0x1aa58a={'raw':![],'where':{}};var _0x4e3bae={};var _0x2e0a50={'count':0x0,'rows':[]};return db[_0x4d8c('0x3b')][_0x4d8c('0x61')]({'where':{'id':_0x1e7718['params']['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x306cce,null))['then'](function(_0x156a86){if(_0x156a86){_0x4e3bae[_0x4d8c('0x3f')]=_[_0x4d8c('0x51')](db[_0x4d8c('0x60')][_0x4d8c('0x52')]);_0x4e3bae[_0x4d8c('0x40')]=_['keys'](_0x1e7718['query']);_0x4e3bae[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x4e3bae[_0x4d8c('0x3f')],_0x4e3bae[_0x4d8c('0x40')]);_0x1aa58a[_0x4d8c('0x44')]=_[_0x4d8c('0x42')](_0x4e3bae[_0x4d8c('0x3f')],qs[_0x4d8c('0x43')](_0x1e7718['query'][_0x4d8c('0x43')]));_0x1aa58a['attributes']=_0x1aa58a[_0x4d8c('0x44')][_0x4d8c('0x45')]?_0x1aa58a[_0x4d8c('0x44')]:_0x4e3bae[_0x4d8c('0x3f')];if(!_0x1e7718[_0x4d8c('0x40')][_0x4d8c('0x46')](_0x4d8c('0x47'))){_0x1aa58a[_0x4d8c('0x2c')]=qs[_0x4d8c('0x2c')](_0x1e7718[_0x4d8c('0x40')]['limit']);_0x1aa58a[_0x4d8c('0x2a')]=qs[_0x4d8c('0x2a')](_0x1e7718[_0x4d8c('0x40')][_0x4d8c('0x2a')]);}_0x1aa58a[_0x4d8c('0x48')]=qs[_0x4d8c('0x49')](_0x1e7718[_0x4d8c('0x40')]['sort']);_0x1aa58a['where']=qs[_0x4d8c('0x41')](_['pick'](_0x1e7718[_0x4d8c('0x40')],_0x4e3bae[_0x4d8c('0x41')]));_0x1aa58a[_0x4d8c('0x4a')]['OpenchannelAccountId']=_0x156a86['id'];if(_0x1e7718['query']['filter']){_0x1aa58a[_0x4d8c('0x4a')]=_[_0x4d8c('0x4d')](_0x1aa58a['where'],{'$or':_[_0x4d8c('0x3a')](_0x1aa58a['attributes'],function(_0x5b7e99){var _0x42fe26={};_0x42fe26[_0x5b7e99]={'$like':'%'+_0x1e7718[_0x4d8c('0x40')][_0x4d8c('0x4c')]+'%'};return _0x42fe26;})});}_0x1aa58a=_[_0x4d8c('0x4d')]({},_0x1aa58a,_0x1e7718[_0x4d8c('0x53')]);return db[_0x4d8c('0x60')]['count']({'where':_0x1aa58a[_0x4d8c('0x4a')]})[_0x4d8c('0x1f')](function(_0x237127){_0x2e0a50[_0x4d8c('0x2d')]=_0x237127;if(_0x1e7718[_0x4d8c('0x40')][_0x4d8c('0x4e')]){_0x1aa58a['include']=[{'all':!![]}];}return db[_0x4d8c('0x60')][_0x4d8c('0x62')](_0x1aa58a);})['then'](function(_0x5b2243){_0x2e0a50[_0x4d8c('0x63')]=_0x5b2243;return _0x2e0a50;});}})[_0x4d8c('0x1f')](respondWithFilteredResult(_0x306cce,_0x1aa58a))[_0x4d8c('0x50')](handleError(_0x306cce,null));};exports[_0x4d8c('0x64')]=function(_0x13eb46,_0x4239e9,_0x4b0065){return db[_0x4d8c('0x3b')][_0x4d8c('0x5b')]({'where':{'id':_0x13eb46[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x4239e9,null))[_0x4d8c('0x1f')](function(_0x3704af){if(_0x3704af){return _0x3704af[_0x4d8c('0x64')](_0x13eb46['query'][_0x4d8c('0x65')]);}})[_0x4d8c('0x1f')](respondWithStatusCode(_0x4239e9,null))[_0x4d8c('0x50')](handleError(_0x4239e9,null));};exports[_0x4d8c('0x66')]=function(_0x50e02b,_0x1ef774,_0x8ac484){if(_0x50e02b[_0x4d8c('0x55')]['id']){delete _0x50e02b[_0x4d8c('0x55')]['id'];}return db[_0x4d8c('0x3b')][_0x4d8c('0x5b')]({'where':{'id':_0x50e02b[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x1ef774,null))[_0x4d8c('0x1f')](function(_0x1dbf5e){if(_0x1dbf5e){_0x50e02b[_0x4d8c('0x55')][_0x4d8c('0x5f')]=_0x1dbf5e['id'];return db['CannedAnswer'][_0x4d8c('0x54')](_0x50e02b[_0x4d8c('0x55')]);}})[_0x4d8c('0x1f')](respondWithResult(_0x1ef774,null))[_0x4d8c('0x50')](handleError(_0x1ef774,null));};exports['getAnswers']=function(_0x5c27ea,_0x12cba9,_0x3b989a){var _0x3784c1={'raw':![],'where':{}};var _0x54984d={};var _0x4e5295={'count':0x0,'rows':[]};return db[_0x4d8c('0x3b')][_0x4d8c('0x61')]({'where':{'id':_0x5c27ea[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x12cba9,null))[_0x4d8c('0x1f')](function(_0xb0984f){if(_0xb0984f){_0x54984d[_0x4d8c('0x3f')]=_[_0x4d8c('0x51')](db[_0x4d8c('0x67')][_0x4d8c('0x52')]);_0x54984d[_0x4d8c('0x40')]=_[_0x4d8c('0x51')](_0x5c27ea['query']);_0x54984d[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x54984d['model'],_0x54984d[_0x4d8c('0x40')]);_0x3784c1[_0x4d8c('0x44')]=_[_0x4d8c('0x42')](_0x54984d[_0x4d8c('0x3f')],qs[_0x4d8c('0x43')](_0x5c27ea[_0x4d8c('0x40')][_0x4d8c('0x43')]));_0x3784c1['attributes']=_0x3784c1['attributes'][_0x4d8c('0x45')]?_0x3784c1[_0x4d8c('0x44')]:_0x54984d['model'];if(!_0x5c27ea[_0x4d8c('0x40')]['hasOwnProperty'](_0x4d8c('0x47'))){_0x3784c1[_0x4d8c('0x2c')]=qs[_0x4d8c('0x2c')](_0x5c27ea[_0x4d8c('0x40')]['limit']);_0x3784c1[_0x4d8c('0x2a')]=qs[_0x4d8c('0x2a')](_0x5c27ea['query'][_0x4d8c('0x2a')]);}_0x3784c1[_0x4d8c('0x48')]=qs['sort'](_0x5c27ea[_0x4d8c('0x40')][_0x4d8c('0x49')]);_0x3784c1['where']=qs[_0x4d8c('0x41')](_['pick'](_0x5c27ea[_0x4d8c('0x40')],_0x54984d['filters']));_0x3784c1[_0x4d8c('0x4a')][_0x4d8c('0x5f')]=_0xb0984f['id'];if(_0x5c27ea[_0x4d8c('0x40')]['filter']){_0x3784c1[_0x4d8c('0x4a')]=_[_0x4d8c('0x4d')](_0x3784c1[_0x4d8c('0x4a')],{'$or':_[_0x4d8c('0x3a')](_0x3784c1[_0x4d8c('0x44')],function(_0x509e00){var _0x445c46={};_0x445c46[_0x509e00]={'$like':'%'+_0x5c27ea[_0x4d8c('0x40')][_0x4d8c('0x4c')]+'%'};return _0x445c46;})});}_0x3784c1=_[_0x4d8c('0x4d')]({},_0x3784c1,_0x5c27ea[_0x4d8c('0x53')]);return db[_0x4d8c('0x67')][_0x4d8c('0x2d')]({'where':_0x3784c1[_0x4d8c('0x4a')]})[_0x4d8c('0x1f')](function(_0x39bd8e){_0x4e5295['count']=_0x39bd8e;if(_0x5c27ea['query'][_0x4d8c('0x4e')]){_0x3784c1[_0x4d8c('0x4f')]=[{'all':!![]}];}return db[_0x4d8c('0x67')][_0x4d8c('0x62')](_0x3784c1);})[_0x4d8c('0x1f')](function(_0xfa3f71){_0x4e5295[_0x4d8c('0x63')]=_0xfa3f71;return _0x4e5295;});}})[_0x4d8c('0x1f')](respondWithFilteredResult(_0x12cba9,_0x3784c1))[_0x4d8c('0x50')](handleError(_0x12cba9,null));};exports[_0x4d8c('0x68')]=function(_0x445d46,_0x4e8b24,_0x5e1488){return db['OpenchannelAccount'][_0x4d8c('0x5b')]({'where':{'id':_0x445d46['params']['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x4e8b24,null))[_0x4d8c('0x1f')](function(_0x390589){if(_0x390589){return _0x390589[_0x4d8c('0x68')](_0x445d46[_0x4d8c('0x40')][_0x4d8c('0x65')]);}})[_0x4d8c('0x1f')](respondWithStatusCode(_0x4e8b24,null))[_0x4d8c('0x50')](handleError(_0x4e8b24,null));};exports[_0x4d8c('0x69')]=function(_0x33b903,_0x292069,_0x1c2add){var _0x528f69={'body':_0x33b903['body'],'channel':'openchannel'};var _0x2e389d=[];var _0x1148b3=[];var _0x402f01={};var _0x3a05f1=![];return db[_0x4d8c('0x6a')][_0x4d8c('0x5d')]()[_0x4d8c('0x1f')](function(_0x363eb9){if(!_0x363eb9){throw new db[(_0x4d8c('0x6b'))]['ValidationError'](_0x4d8c('0x6c'));}_0x2e389d=_[_0x4d8c('0x6d')](_[_0x4d8c('0x51')](_0x363eb9),[_0x4d8c('0x6e'),_0x4d8c('0x6f')]);_0x1148b3=_['difference'](_[_0x4d8c('0x51')](_0x363eb9),[_0x4d8c('0x6e'),_0x4d8c('0x6f'),_0x4d8c('0x70'),'ListId']);if(_0x33b903['body']['id']){delete _0x33b903[_0x4d8c('0x55')]['id'];}if(_[_0x4d8c('0x71')](_0x33b903[_0x4d8c('0x55')]['from'])){throw new db[(_0x4d8c('0x6b'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x55')])||_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x55')]===''){throw new db['Sequelize']['ValidationError'](_0x4d8c('0x72'));}if(_[_0x4d8c('0x71')](_0x33b903['body']['mapKey'])){throw new db[(_0x4d8c('0x6b'))][(_0x4d8c('0x73'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1148b3);}if(!_[_0x4d8c('0x74')](_0x1148b3,_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x75')])){throw new db[(_0x4d8c('0x6b'))][(_0x4d8c('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1148b3);}_0x402f01[_0x33b903['body'][_0x4d8c('0x75')]]=_0x33b903[_0x4d8c('0x55')]['from'];})[_0x4d8c('0x1f')](function(){return db[_0x4d8c('0x3b')]['find']({'where':{'id':_0x33b903[_0x4d8c('0x5c')]['id']},'include':[{'model':db[_0x4d8c('0x76')],'as':_0x4d8c('0x77'),'include':[{'model':db[_0x4d8c('0x6a')],'as':_0x4d8c('0x78'),'where':_0x402f01,'limit':0x1,'order':[[_0x4d8c('0x6f'),_0x4d8c('0x79')]]}]},{'model':db[_0x4d8c('0x7a')],'as':_0x4d8c('0x7b')}]});})[_0x4d8c('0x1f')](handleEntityNotFound(_0x292069,null))['then'](function(_0x51eed0){if(_0x51eed0&&_0x51eed0[_0x4d8c('0x77')]){_0x528f69[_0x4d8c('0x7c')]=_0x51eed0;_0x528f69[_0x4d8c('0x7d')]=_0x51eed0[_0x4d8c('0x7b')];_0x528f69[_0x4d8c('0x7e')]=_0x51eed0['List'];_0x528f69[_0x4d8c('0x7d')]=_[_0x4d8c('0x7f')](_0x528f69[_0x4d8c('0x7d')],[_0x4d8c('0x80')],['asc']);if(_0x528f69[_0x4d8c('0x7c')][_0x4d8c('0x7b')]){delete _0x528f69[_0x4d8c('0x7c')]['Applications'];}if(_0x528f69[_0x4d8c('0x7c')][_0x4d8c('0x77')]&&_0x528f69[_0x4d8c('0x7c')]['List'][_0x4d8c('0x78')][_0x4d8c('0x45')]){return _0x528f69[_0x4d8c('0x7c')]['List'][_0x4d8c('0x78')][0x0];}var _0x40e9d4=_[_0x4d8c('0x18')](_0x33b903['body'],{'firstName':_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x81')],'ListId':_0x51eed0[_0x4d8c('0x82')]});_0x40e9d4[_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x75')]]=_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x81')];return db[_0x4d8c('0x6a')][_0x4d8c('0x54')](_0x40e9d4,{'fields':_0x2e389d,'raw':!![]});}})['then'](handleEntityNotFound(_0x292069,null))[_0x4d8c('0x1f')](function(_0x12e447){_0x528f69[_0x4d8c('0x83')]=_0x12e447;if(_0x12e447){var _0x4ac773={'ContactId':_0x12e447['id'],'OpenchannelAccountId':_0x33b903[_0x4d8c('0x5c')]['id'],'from':(_0x12e447[_0x4d8c('0x84')]||'')+'\x20'+(_0x12e447['lastName']||'')};var _0x42997a={'OpenchannelAccountId':_0x33b903[_0x4d8c('0x5c')]['id'],'closed':![]};if(_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x85')]){_0x42997a[_0x4d8c('0x85')]=_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x85')];return db['OpenchannelInteraction']['find']({'where':_0x42997a})[_0x4d8c('0x1f')](function(_0x38ca75){if(_0x38ca75){return[_0x38ca75,![]];}_0x4ac773[_0x4d8c('0x85')]=_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x85')];_0x4ac773['externalUrl']=_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x86')];return db['OpenchannelInteraction'][_0x4d8c('0x54')](_0x4ac773)[_0x4d8c('0x1f')](function(_0xefd4a0){return[_0xefd4a0,!![]];});});}else{_0x42997a[_0x4d8c('0x85')]=null;}_0x42997a[_0x4d8c('0x87')]=_0x12e447['id'];return db[_0x4d8c('0x88')][_0x4d8c('0x5b')]({'where':_0x42997a})['then'](function(_0x424ff2){if(_0x424ff2){return[_0x424ff2,![]];}return db[_0x4d8c('0x88')][_0x4d8c('0x54')](_0x4ac773)[_0x4d8c('0x1f')](function(_0x1ff308){return[_0x1ff308,!![]];});});}})[_0x4d8c('0x89')](function(_0x562f3d,_0x118be9){if(_0x562f3d){_0x3a05f1=_0x118be9;if(!_0x118be9){var _0x54968d={'from':(_0x528f69[_0x4d8c('0x83')][_0x4d8c('0x84')]||'')+'\x20'+(_0x528f69['contact'][_0x4d8c('0x8a')]||'')};if(_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x85')]&&_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x8b')]&&_0x33b903['body'][_0x4d8c('0x85')]!=_0x33b903['body'][_0x4d8c('0x8b')]){_0x54968d[_0x4d8c('0x85')]=_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x8b')];}return _0x562f3d[_0x4d8c('0x32')](_0x54968d);}else{return _0x562f3d;}}})['then'](function(_0x3aea9f){_0x528f69[_0x4d8c('0x8c')]=_0x3aea9f[_0x4d8c('0x34')]({'plain':!![]});_0x528f69[_0x4d8c('0x8c')][_0x4d8c('0x8d')]=_0x3a05f1;if(_0x528f69[_0x4d8c('0x8c')][_0x4d8c('0x8d')]){if(_0x528f69[_0x4d8c('0x7c')][_0x4d8c('0x8e')]){_0x528f69[_0x4d8c('0x7d')]['push']({'id':0x0,'priority':_0x528f69[_0x4d8c('0x7d')][_0x4d8c('0x45')]+0x1,'app':_0x4d8c('0x8f'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x4d8c('0x90')][_0x4d8c('0x54')]({'body':_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x55')],'OpenchannelAccountId':_0x33b903[_0x4d8c('0x5c')]['id'],'OpenchannelInteractionId':_0x3aea9f['id'],'direction':'in','ContactId':_0x528f69[_0x4d8c('0x83')]['id'],'AttachmentId':_0x33b903[_0x4d8c('0x55')][_0x4d8c('0x91')]});})['then'](function(_0x3b2138){_0x528f69[_0x4d8c('0x24')]=_0x3b2138;if(_0x528f69[_0x4d8c('0x8c')][_0x4d8c('0x92')]){return db[_0x4d8c('0x93')]['find']({'attributes':['id',_0x4d8c('0x35')],'where':{'id':_0x528f69[_0x4d8c('0x8c')][_0x4d8c('0x92')]}})[_0x4d8c('0x1f')](function(_0x2eb00c){if(_0x2eb00c){_0x528f69[_0x4d8c('0x7d')][_0x4d8c('0x94')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2eb00c[_0x4d8c('0x35')]+','+(_0x528f69['account'][_0x4d8c('0x95')]||0xa),'interval':_0x4d8c('0x96')});_0x528f69[_0x4d8c('0x97')]=![];}return respondWithRpcPromise(_0x4d8c('0x98'),_0x4d8c('0x99'),_0x528f69);});}return respondWithRpcPromise(_0x4d8c('0x98'),_0x4d8c('0x99'),_0x528f69);})[_0x4d8c('0x1f')](function(_0x7f52d6){respondWithRpcPromise(_0x4d8c('0x9a'),_0x4d8c('0x9a'),{'event':_0x4d8c('0x69'),'message':_0x7f52d6},client9002);return _0x7f52d6;})[_0x4d8c('0x1f')](respondWithResult(_0x292069,null))['catch'](handleError(_0x292069,null));};exports[_0x4d8c('0x9b')]=function(_0x1e5cdd,_0x158c53){var _0x3a630d=_0x1e5cdd[_0x4d8c('0x5c')]['id'];var _0x1c72c3=_0x1e5cdd[_0x4d8c('0x55')];var _0xb3b381=0xc8;var _0x2c5992=null;return db[_0x4d8c('0x9c')][_0x4d8c('0x9d')]({'isolationLevel':db[_0x4d8c('0x9c')]['Transaction'][_0x4d8c('0x9e')][_0x4d8c('0x9f')]},function(_0x1872b3){return db[_0x4d8c('0x3b')][_0x4d8c('0x61')]({'where':{'id':_0x3a630d},'transaction':_0x1872b3})[_0x4d8c('0x1f')](function(_0x2120e5){if(_0x2120e5){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x3a630d},'transaction':_0x1872b3})[_0x4d8c('0x1f')](function(){var _0x5342bd=_['map'](_0x1c72c3,function(_0x311a06){_0x311a06[_0x4d8c('0x5f')]=_0x3a630d;return _0x311a06;});return db[_0x4d8c('0x7a')][_0x4d8c('0xa0')](_0x5342bd,{'transaction':_0x1872b3});});}else{_0xb3b381=0x194;_0x2c5992=[];}});})['then'](function(){if(_0xb3b381!==0x194){return db[_0x4d8c('0x7a')][_0x4d8c('0xa1')]({'where':{'OpenchannelAccountId':_0x3a630d},'order':'priority'})[_0x4d8c('0x1f')](function(_0x7a5f64){_0x2c5992=_0x7a5f64;});}})['catch'](function(_0x18388f){_0xb3b381=0x1f4;logger[_0x4d8c('0x23')](_0x18388f['stack']);if(_0x18388f[_0x4d8c('0x35')]){delete _0x18388f[_0x4d8c('0x35')];}_0x2c5992=_0x18388f;})['finally'](function(){if(_0x2c5992===null){_0x158c53['sendStatus'](_0xb3b381);}else{if(_0xb3b381===0x1f4){_0x158c53[_0x4d8c('0x28')](_0xb3b381)['send'](_0x2c5992);}else{_0x158c53[_0x4d8c('0x28')](_0xb3b381)[_0x4d8c('0x30')](_0x2c5992);}}});};exports[_0x4d8c('0xa2')]=function(_0x459553,_0x5572d3,_0x4002bf){var _0xb41fe2={};var _0x28ab93={};var _0x301fba;var _0xdc214b;return db[_0x4d8c('0x3b')]['findOne']({'where':{'id':_0x459553[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x5572d3,null))[_0x4d8c('0x1f')](function(_0x85be08){if(_0x85be08){_0x301fba=_0x85be08;_0x28ab93[_0x4d8c('0x3f')]=_['keys'](db[_0x4d8c('0x7a')][_0x4d8c('0x52')]);_0x28ab93[_0x4d8c('0x40')]=_['keys'](_0x459553['query']);_0x28ab93[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x28ab93[_0x4d8c('0x3f')],_0x28ab93[_0x4d8c('0x40')]);_0xb41fe2[_0x4d8c('0x44')]=_[_0x4d8c('0x42')](_0x28ab93['model'],qs['fields'](_0x459553[_0x4d8c('0x40')][_0x4d8c('0x43')]));_0xb41fe2['attributes']=_0xb41fe2['attributes'][_0x4d8c('0x45')]?_0xb41fe2[_0x4d8c('0x44')]:_0x28ab93['model'];_0xb41fe2[_0x4d8c('0x48')]=qs[_0x4d8c('0x49')](_0x459553['query']['sort']);_0xb41fe2[_0x4d8c('0x4a')]=qs[_0x4d8c('0x41')](_[_0x4d8c('0x4b')](_0x459553[_0x4d8c('0x40')],_0x28ab93[_0x4d8c('0x41')]));if(_0x459553[_0x4d8c('0x40')][_0x4d8c('0x4c')]){_0xb41fe2[_0x4d8c('0x4a')]=_[_0x4d8c('0x4d')](_0xb41fe2[_0x4d8c('0x4a')],{'$or':_['map'](_0xb41fe2['attributes'],function(_0x55b977){var _0x4665d4={};_0x4665d4[_0x55b977]={'$like':'%'+_0x459553[_0x4d8c('0x40')][_0x4d8c('0x4c')]+'%'};return _0x4665d4;})});}_0xb41fe2=_['merge']({},_0xb41fe2,_0x459553['options']);return _0x301fba[_0x4d8c('0xa2')](_0xb41fe2);}})[_0x4d8c('0x1f')](function(_0x20377b){if(_0x20377b){_0xdc214b=_0x20377b[_0x4d8c('0x45')];if(!_0x459553[_0x4d8c('0x40')][_0x4d8c('0x46')]('nolimit')){_0xb41fe2[_0x4d8c('0x2c')]=qs[_0x4d8c('0x2c')](_0x459553['query'][_0x4d8c('0x2c')]);_0xb41fe2[_0x4d8c('0x2a')]=qs[_0x4d8c('0x2a')](_0x459553[_0x4d8c('0x40')]['offset']);}return _0x301fba[_0x4d8c('0xa2')](_0xb41fe2);}})[_0x4d8c('0x1f')](function(_0x50c222){if(_0x50c222){return _0x50c222?{'count':_0xdc214b,'rows':_0x50c222}:null;}})[_0x4d8c('0x1f')](respondWithResult(_0x5572d3,null))[_0x4d8c('0x50')](handleError(_0x5572d3,null));};exports[_0x4d8c('0xa3')]=function(_0x430a01,_0x41dc96,_0x13b726){var _0x42c956={'raw':![],'where':{}};var _0x87f4d6={};var _0x3b1b20={'count':0x0,'rows':[]};return db[_0x4d8c('0x3b')]['findOne']({'where':{'id':_0x430a01[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x41dc96,null))[_0x4d8c('0x1f')](function(_0xc3cf58){if(_0xc3cf58){_0x87f4d6[_0x4d8c('0x3f')]=_['keys'](db[_0x4d8c('0x88')][_0x4d8c('0x52')]);_0x87f4d6['query']=_[_0x4d8c('0x51')](_0x430a01[_0x4d8c('0x40')]);_0x87f4d6[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x87f4d6[_0x4d8c('0x3f')],_0x87f4d6[_0x4d8c('0x40')]);_0x42c956[_0x4d8c('0x44')]=_[_0x4d8c('0x42')](_0x87f4d6['model'],qs['fields'](_0x430a01[_0x4d8c('0x40')][_0x4d8c('0x43')]));_0x42c956[_0x4d8c('0x44')]=_0x42c956[_0x4d8c('0x44')][_0x4d8c('0x45')]?_0x42c956[_0x4d8c('0x44')]:_0x87f4d6['model'];if(!_0x430a01['query']['hasOwnProperty']('nolimit')){_0x42c956[_0x4d8c('0x2c')]=qs['limit'](_0x430a01[_0x4d8c('0x40')][_0x4d8c('0x2c')]);_0x42c956['offset']=qs['offset'](_0x430a01[_0x4d8c('0x40')][_0x4d8c('0x2a')]);}_0x42c956[_0x4d8c('0x48')]=qs[_0x4d8c('0x49')](_0x430a01[_0x4d8c('0x40')]['sort']);_0x42c956['where']=qs[_0x4d8c('0x41')](_[_0x4d8c('0x4b')](_0x430a01[_0x4d8c('0x40')],_0x87f4d6[_0x4d8c('0x41')]));_0x42c956['where'][_0x4d8c('0x5f')]=_0xc3cf58['id'];if(_0x430a01[_0x4d8c('0x40')][_0x4d8c('0x4c')]){_0x42c956[_0x4d8c('0x4a')]=_['merge'](_0x42c956[_0x4d8c('0x4a')],{'$or':_[_0x4d8c('0x3a')](_0x42c956[_0x4d8c('0x44')],function(_0x2065f3){var _0x22bba2={};_0x22bba2[_0x2065f3]={'$like':'%'+_0x430a01['query'][_0x4d8c('0x4c')]+'%'};return _0x22bba2;})});}_0x42c956=_[_0x4d8c('0x4d')]({},_0x42c956,_0x430a01['options']);return db[_0x4d8c('0x88')][_0x4d8c('0x2d')]({'where':_0x42c956[_0x4d8c('0x4a')]})[_0x4d8c('0x1f')](function(_0x41de30){_0x3b1b20[_0x4d8c('0x2d')]=_0x41de30;if(_0x430a01[_0x4d8c('0x40')][_0x4d8c('0x4e')]){_0x42c956[_0x4d8c('0x4f')]=[{'model':db['CmContact'],'as':_0x4d8c('0xa4'),'required':![]},{'model':db['User'],'as':_0x4d8c('0xa5'),'attributes':[_0x4d8c('0x35'),_0x4d8c('0xa6'),_0x4d8c('0xa7')],'required':![]},{'model':db[_0x4d8c('0xa8')],'as':_0x4d8c('0xa9'),'attributes':['id',_0x4d8c('0x35'),'color'],'where':_0x430a01[_0x4d8c('0x40')][_0x4d8c('0xaa')]?{'id':_0x430a01[_0x4d8c('0x40')][_0x4d8c('0xaa')]}:undefined,'required':_0x430a01[_0x4d8c('0x40')][_0x4d8c('0xaa')]?!![]:![]}];}return db[_0x4d8c('0x88')]['findAll'](_0x42c956);})[_0x4d8c('0x1f')](function(_0x4321e4){_0x3b1b20[_0x4d8c('0x63')]=_0x4321e4;return _0x3b1b20;});}})['then'](respondWithFilteredResult(_0x41dc96,_0x42c956))[_0x4d8c('0x50')](handleError(_0x41dc96,null));};exports[_0x4d8c('0xab')]=function(_0x117f75,_0x34cb38,_0x3dd125){return db[_0x4d8c('0x3b')][_0x4d8c('0x5b')]({'where':{'id':_0x117f75[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x34cb38,null))[_0x4d8c('0x1f')](function(_0x4cbde4){if(_0x4cbde4){return _0x4cbde4[_0x4d8c('0xab')](_0x117f75[_0x4d8c('0x55')]['ids'],_[_0x4d8c('0xac')](_0x117f75[_0x4d8c('0x55')],[_0x4d8c('0x65'),'id'])||{})[_0x4d8c('0x89')](function(_0x5c9ed7){for(var _0x31cd65=0x0;_0x31cd65<_0x117f75[_0x4d8c('0x55')][_0x4d8c('0x65')][_0x4d8c('0x45')];_0x31cd65+=0x1){socket['emit'](_0x4d8c('0xad'),{'UserId':Number(_0x117f75['body'][_0x4d8c('0x65')][_0x31cd65]),'OpenchannelAccountId':Number(_0x117f75[_0x4d8c('0x5c')]['id'])});}return _0x5c9ed7;});}})[_0x4d8c('0x1f')](respondWithResult(_0x34cb38,null))[_0x4d8c('0x50')](handleError(_0x34cb38,null));};exports[_0x4d8c('0xae')]=function(_0x59784f,_0x4b302e,_0x511f0b){return db['OpenchannelAccount']['find']({'where':{'id':_0x59784f['params']['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x4b302e,null))[_0x4d8c('0x1f')](function(_0x7b7e78){if(_0x7b7e78){return _0x7b7e78['removeAgents'](_0x59784f[_0x4d8c('0x40')][_0x4d8c('0x65')])['then'](function(){if(_['isArray'](_0x59784f[_0x4d8c('0x40')][_0x4d8c('0x65')])){for(var _0x140da2=0x0;_0x140da2<_0x59784f['query'][_0x4d8c('0x65')]['length'];_0x140da2+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x59784f[_0x4d8c('0x40')][_0x4d8c('0x65')][_0x140da2]),'OpenchannelAccountId':Number(_0x59784f[_0x4d8c('0x5c')]['id'])});}}else{socket[_0x4d8c('0xaf')](_0x4d8c('0xb0'),{'UserId':Number(_0x59784f[_0x4d8c('0x40')][_0x4d8c('0x65')]),'OpenchannelAccountId':Number(_0x59784f[_0x4d8c('0x5c')]['id'])});}});}})[_0x4d8c('0x1f')](respondWithStatusCode(_0x4b302e,null))[_0x4d8c('0x50')](handleError(_0x4b302e,null));};exports[_0x4d8c('0xb1')]=function(_0x4cf343,_0x4d1590,_0x5a7cf7){var _0x6058={};var _0x300208={};var _0x2a9d09;var _0x403978;return db[_0x4d8c('0x3b')]['findOne']({'where':{'id':_0x4cf343[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x4d1590,null))[_0x4d8c('0x1f')](function(_0x2fa9d1){if(_0x2fa9d1){_0x2a9d09=_0x2fa9d1;_0x300208['model']=_[_0x4d8c('0x51')](db[_0x4d8c('0x93')][_0x4d8c('0x52')]);_0x300208['query']=_[_0x4d8c('0x51')](_0x4cf343['query']);_0x300208[_0x4d8c('0x41')]=_[_0x4d8c('0x42')](_0x300208[_0x4d8c('0x3f')],_0x300208['query']);_0x6058[_0x4d8c('0x44')]=_[_0x4d8c('0x42')](_0x300208[_0x4d8c('0x3f')],qs[_0x4d8c('0x43')](_0x4cf343[_0x4d8c('0x40')][_0x4d8c('0x43')]));_0x6058[_0x4d8c('0x44')]=_0x6058['attributes'][_0x4d8c('0x45')]?_0x6058['attributes']:_0x300208[_0x4d8c('0x3f')];_0x6058[_0x4d8c('0x48')]=qs['sort'](_0x4cf343[_0x4d8c('0x40')]['sort']);_0x6058[_0x4d8c('0x4a')]=qs[_0x4d8c('0x41')](_['pick'](_0x4cf343[_0x4d8c('0x40')],_0x300208[_0x4d8c('0x41')]));if(_0x4cf343[_0x4d8c('0x40')][_0x4d8c('0x4c')]){_0x6058[_0x4d8c('0x4a')]=_[_0x4d8c('0x4d')](_0x6058['where'],{'$or':_[_0x4d8c('0x3a')](_0x6058[_0x4d8c('0x44')],function(_0x178d58){var _0x1a6194={};_0x1a6194[_0x178d58]={'$like':'%'+_0x4cf343['query'][_0x4d8c('0x4c')]+'%'};return _0x1a6194;})});}_0x6058=_[_0x4d8c('0x4d')]({},_0x6058,_0x4cf343['options']);return _0x2a9d09[_0x4d8c('0xb1')](_0x6058);}})['then'](function(_0xcd2d72){if(_0xcd2d72){_0x403978=_0xcd2d72[_0x4d8c('0x45')];if(!_0x4cf343[_0x4d8c('0x40')][_0x4d8c('0x46')](_0x4d8c('0x47'))){_0x6058[_0x4d8c('0x2c')]=qs['limit'](_0x4cf343[_0x4d8c('0x40')][_0x4d8c('0x2c')]);_0x6058[_0x4d8c('0x2a')]=qs['offset'](_0x4cf343[_0x4d8c('0x40')]['offset']);}return _0x2a9d09[_0x4d8c('0xb1')](_0x6058);}})[_0x4d8c('0x1f')](function(_0x37c1ee){if(_0x37c1ee){return _0x37c1ee?{'count':_0x403978,'rows':_0x37c1ee}:null;}})[_0x4d8c('0x1f')](respondWithResult(_0x4d1590,null))[_0x4d8c('0x50')](handleError(_0x4d1590,null));};exports[_0x4d8c('0x36')]=function(_0xb63e0d,_0x308e87,_0x3ef7f7){var _0x4fff9d,_0x175c9a,_0xf136a;if(_['isNil'](_0xb63e0d[_0x4d8c('0x55')][_0x4d8c('0x55')])||_0xb63e0d[_0x4d8c('0x55')][_0x4d8c('0x55')]===''){throw new db['Sequelize'][(_0x4d8c('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4d8c('0x71')](_0xb63e0d[_0x4d8c('0x55')]['to'])){}_0x4fff9d=_0xb63e0d[_0x4d8c('0x55')]['to'];return db[_0x4d8c('0x3b')]['findOne']({'where':{'id':_0xb63e0d[_0x4d8c('0x5c')]['id']}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x308e87,null))[_0x4d8c('0x1f')](function(_0x33a405){if(_0x33a405){return db[_0x4d8c('0x3b')][_0x4d8c('0x5b')]({'where':{'id':_0x33a405['id']},'include':[{'model':db['CmList'],'as':_0x4d8c('0x77'),'include':[{'model':db['CmContact'],'as':_0x4d8c('0x78'),'where':{[_0x33a405[_0x4d8c('0x75')]]:_0x4fff9d},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4d8c('0x1f')](handleEntityNotFound(_0x308e87,null))[_0x4d8c('0x1f')](function(_0x22518a){if(_0x22518a&&_0x22518a[_0x4d8c('0x77')]){_0x175c9a=_0x22518a['get']({'plain':!![]});if(_0x175c9a['List']&&_0x175c9a[_0x4d8c('0x77')][_0x4d8c('0x78')][_0x4d8c('0x45')]){return _0x175c9a['List'][_0x4d8c('0x78')][0x0];}return db['CmContact']['create'](_['defaults'](_0xb63e0d[_0x4d8c('0x55')],{'firstName':_0x4fff9d,[_0x22518a[_0x4d8c('0x75')]]:_0x4fff9d,'phone':_0x4fff9d,'ListId':_0x175c9a[_0x4d8c('0x82')]}));}})[_0x4d8c('0x1f')](handleEntityNotFound(_0x308e87,null))[_0x4d8c('0x1f')](function(_0x2af007){if(_0x2af007){_0xf136a=_0x2af007;return db[_0x4d8c('0x88')][_0x4d8c('0x5b')]({'where':{'ContactId':_0xf136a['id'],'closed':![],'OpenchannelAccountId':_0x175c9a['id']}})[_0x4d8c('0x1f')](function(_0x17acd1){if(_0x17acd1){return[_0x17acd1,![]];}return db[_0x4d8c('0x88')][_0x4d8c('0x54')]({'UserId':_0xb63e0d[_0x4d8c('0x56')]['id'],'ContactId':_0xf136a['id'],'OpenchannelAccountId':_0x175c9a['id'],'lastMsgDirection':_0x4d8c('0xb2'),'Messages':[_['merge'](_0xb63e0d[_0x4d8c('0x55')],{'read':![],'body':_0xb63e0d[_0x4d8c('0x55')][_0x4d8c('0x55')],'OpenchannelAccountId':_0x175c9a['id'],'UserId':_0xb63e0d['user']['id'],'ContactId':_0xf136a['id']})]},{'include':[{'model':db[_0x4d8c('0x90')],'as':_0x4d8c('0xb3')}]})['then'](function(_0x5becf7){return[_0x5becf7,!![]];});});}})[_0x4d8c('0x89')](function(_0x330896,_0x337f4f){if(_0x337f4f){return _0x330896;}return db['OpenchannelMessage'][_0x4d8c('0x54')](_[_0x4d8c('0x4d')](_0xb63e0d[_0x4d8c('0x55')],{'read':![],'body':_0xb63e0d[_0x4d8c('0x55')][_0x4d8c('0x55')],'OpenchannelAccountId':_0x175c9a['id'],'OpenchannelInteractionId':_0x330896['id'],'UserId':_0xb63e0d[_0x4d8c('0x56')]['id'],'ContactId':_0xf136a['id']}))[_0x4d8c('0x1f')](function(_0x4e2408){_0x330896[_0x4d8c('0xb4')][_0x4d8c('0xb3')]=[];_0x330896[_0x4d8c('0xb4')][_0x4d8c('0xb3')]['push'](_0x4e2408['dataValues']);return _0x330896;});});}})[_0x4d8c('0x1f')](respondWithResult(_0x308e87,null))[_0x4d8c('0x50')](handleError(_0x308e87,null));}; \ No newline at end of file +var _0x8a52=['merge','VIRTUAL','options','includeAll','findAll','rows','show','include','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','find','params','describe','Disposition','getDispositions','findOne','pick','OpenchannelAccountId','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x8a52,0x132));var _0x28a5=function(_0x442013,_0x49692c){_0x442013=_0x442013-0x0;var _0x4653bf=_0x8a52[_0x442013];return _0x4653bf;};'use strict';var emlformat=require(_0x28a5('0x0'));var rimraf=require(_0x28a5('0x1'));var zipdir=require(_0x28a5('0x2'));var jsonpatch=require(_0x28a5('0x3'));var rp=require(_0x28a5('0x4'));var moment=require(_0x28a5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x28a5('0x6'));var util=require(_0x28a5('0x7'));var path=require(_0x28a5('0x8'));var sox=require(_0x28a5('0x9'));var csv=require(_0x28a5('0xa'));var ejs=require(_0x28a5('0xb'));var fs=require('fs');var fs_extra=require(_0x28a5('0xc'));var _=require(_0x28a5('0xd'));var squel=require(_0x28a5('0xe'));var crypto=require(_0x28a5('0xf'));var jsforce=require(_0x28a5('0x10'));var deskjs=require(_0x28a5('0x11'));var toCsv=require(_0x28a5('0xa'));var querystring=require('querystring');var Papa=require(_0x28a5('0x12'));var Redis=require('ioredis');var authService=require(_0x28a5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28a5('0x14'));var logger=require('../../config/logger')(_0x28a5('0x15'));var utils=require(_0x28a5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28a5('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x28a5('0x18')](config[_0x28a5('0x19')],{'host':_0x28a5('0x1a'),'port':0x18eb});var socket=require(_0x28a5('0x1b'))(new Redis(config['redis']));require(_0x28a5('0x1c'))[_0x28a5('0x1d')](socket);var jayson=require(_0x28a5('0x1e'));var client=jayson[_0x28a5('0x1f')][_0x28a5('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x28a5('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x57db7c,_0x272259,_0x2e1d4d,_0x2934c6){return new BPromise(function(_0x346721,_0x5a0b85){var _0x36375e=_0x2934c6||client;return _0x36375e[_0x28a5('0x21')](_0x57db7c,_0x2e1d4d)[_0x28a5('0x22')](function(_0x3e02cb){logger['info'](_0x28a5('0x23'),_0x272259,_0x28a5('0x24'));logger['debug'](_0x28a5('0x25'),_0x272259,_0x28a5('0x24'),JSON[_0x28a5('0x26')](_0x3e02cb));if(_0x3e02cb[_0x28a5('0x27')]){if(_0x3e02cb[_0x28a5('0x27')][_0x28a5('0x28')]===0x1f4){logger[_0x28a5('0x27')](_0x28a5('0x23'),_0x272259,_0x3e02cb[_0x28a5('0x27')][_0x28a5('0x29')]);return _0x5a0b85(_0x3e02cb[_0x28a5('0x27')]['message']);}logger[_0x28a5('0x27')](_0x28a5('0x23'),_0x272259,_0x3e02cb[_0x28a5('0x27')]['message']);return _0x346721(_0x3e02cb[_0x28a5('0x27')][_0x28a5('0x29')]);}else{logger[_0x28a5('0x2a')](_0x28a5('0x23'),_0x272259,'request\x20sent');_0x346721(_0x3e02cb[_0x28a5('0x2b')][_0x28a5('0x29')]);}})[_0x28a5('0x2c')](function(_0x4dab66){logger[_0x28a5('0x27')](_0x28a5('0x23'),_0x272259,_0x4dab66);_0x5a0b85(_0x4dab66);});});}function respondWithStatusCode(_0x52c511,_0x5c5943){_0x5c5943=_0x5c5943||0xcc;return function(_0x140456){if(_0x140456){return _0x52c511[_0x28a5('0x2d')](_0x5c5943);}return _0x52c511[_0x28a5('0x2e')](_0x5c5943)['end']();};}function respondWithResult(_0x266853,_0x361d79){_0x361d79=_0x361d79||0xc8;return function(_0x4928cd){if(_0x4928cd){return _0x266853[_0x28a5('0x2e')](_0x361d79)[_0x28a5('0x2f')](_0x4928cd);}};}function respondWithFilteredResult(_0xb1e1ce,_0x5d69d0){return function(_0x5297fc){if(_0x5297fc){var _0x11419d=typeof _0x5d69d0[_0x28a5('0x30')]==='undefined'&&typeof _0x5d69d0[_0x28a5('0x31')]===_0x28a5('0x32');var _0x1023bf=_0x5297fc[_0x28a5('0x33')];var _0x567999=_0x11419d?0x0:_0x5d69d0[_0x28a5('0x30')];var _0x212042=_0x11419d?_0x5297fc['count']:_0x5d69d0[_0x28a5('0x30')]+_0x5d69d0[_0x28a5('0x31')];var _0x36ae08;if(_0x212042>=_0x1023bf){_0x212042=_0x1023bf;_0x36ae08=0xc8;}else{_0x36ae08=0xce;}_0xb1e1ce['status'](_0x36ae08);return _0xb1e1ce['set']('Content-Range',_0x567999+'-'+_0x212042+'/'+_0x1023bf)[_0x28a5('0x2f')](_0x5297fc);}return null;};}function patchUpdates(_0x2c8f0c){return function(_0x4af899){try{jsonpatch[_0x28a5('0x34')](_0x4af899,_0x2c8f0c,!![]);}catch(_0x5776f9){return BPromise[_0x28a5('0x35')](_0x5776f9);}return _0x4af899[_0x28a5('0x36')]();};}function saveUpdates(_0x1ce766,_0x2e8689){return function(_0x3517b2){if(_0x3517b2){return _0x3517b2['update'](_0x1ce766)['then'](function(_0x144675){return _0x144675;});}return null;};}function removeEntity(_0x2409d7,_0x35c903){return function(_0x2d161f){if(_0x2d161f){return _0x2d161f[_0x28a5('0x37')]()[_0x28a5('0x22')](function(){var _0x3421fb=_0x2d161f[_0x28a5('0x38')]({'plain':!![]});var _0x212591=_0x28a5('0x39');return db[_0x28a5('0x3a')][_0x28a5('0x37')]({'where':{'type':_0x212591,'resourceId':_0x3421fb['id']}})[_0x28a5('0x22')](function(){return _0x2d161f;});})['then'](function(){_0x2409d7[_0x28a5('0x2e')](0xcc)[_0x28a5('0x3b')]();});}};}function handleEntityNotFound(_0x6e72b7,_0x4b94d2){return function(_0x3d164d){if(!_0x3d164d){_0x6e72b7[_0x28a5('0x2d')](0x194);}return _0x3d164d;};}function handleError(_0x930458,_0x4e2c6b){_0x4e2c6b=_0x4e2c6b||0x1f4;return function(_0x469116){logger[_0x28a5('0x27')](_0x469116[_0x28a5('0x3c')]);if(_0x469116['name']){delete _0x469116[_0x28a5('0x3d')];}_0x930458[_0x28a5('0x2e')](_0x4e2c6b)[_0x28a5('0x3e')](_0x469116);};}exports[_0x28a5('0x3f')]=function(_0xaec372,_0x296cde){var _0x67f926={'include':[{'model':db[_0x28a5('0x40')],'as':_0x28a5('0x41')}]},_0x2fae77={},_0x3cc30d={'count':0x0,'rows':[]};var _0x1c52e6=_[_0x28a5('0x42')](db[_0x28a5('0x43')][_0x28a5('0x44')],function(_0x363e3c){return{'name':_0x363e3c[_0x28a5('0x45')],'type':_0x363e3c[_0x28a5('0x46')][_0x28a5('0x47')]};});_0x2fae77[_0x28a5('0x48')]=_[_0x28a5('0x42')](_0x1c52e6,_0x28a5('0x3d'));_0x2fae77[_0x28a5('0x49')]=_[_0x28a5('0x4a')](_0xaec372[_0x28a5('0x49')]);_0x2fae77[_0x28a5('0x4b')]=_[_0x28a5('0x4c')](_0x2fae77['model'],_0x2fae77[_0x28a5('0x49')]);_0x67f926[_0x28a5('0x4d')]=_[_0x28a5('0x4c')](_0x2fae77[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0xaec372['query'][_0x28a5('0x4e')]));_0x67f926['attributes']=_0x67f926[_0x28a5('0x4d')][_0x28a5('0x4f')]?_0x67f926[_0x28a5('0x4d')]:_0x2fae77['model'];if(!_0xaec372[_0x28a5('0x49')][_0x28a5('0x50')](_0x28a5('0x51'))){_0x67f926[_0x28a5('0x31')]=qs['limit'](_0xaec372[_0x28a5('0x49')][_0x28a5('0x31')]);_0x67f926['offset']=qs[_0x28a5('0x30')](_0xaec372[_0x28a5('0x49')][_0x28a5('0x30')]);}_0x67f926[_0x28a5('0x52')]=qs[_0x28a5('0x53')](_0xaec372[_0x28a5('0x49')]['sort']);_0x67f926[_0x28a5('0x54')]=qs[_0x28a5('0x4b')](_['pick'](_0xaec372['query'],_0x2fae77['filters']),_0x1c52e6);if(_0xaec372[_0x28a5('0x49')][_0x28a5('0x55')]){_0x67f926[_0x28a5('0x54')]=_[_0x28a5('0x56')](_0x67f926[_0x28a5('0x54')],{'$or':_['map'](_0x1c52e6,function(_0x908225){if(_0x908225[_0x28a5('0x46')]!==_0x28a5('0x57')){var _0x586574={};_0x586574[_0x908225['name']]={'$like':'%'+_0xaec372[_0x28a5('0x49')][_0x28a5('0x55')]+'%'};return _0x586574;}})});}_0x67f926=_[_0x28a5('0x56')]({},_0x67f926,_0xaec372[_0x28a5('0x58')]);var _0x57677d={'where':_0x67f926[_0x28a5('0x54')]};return db['OpenchannelAccount'][_0x28a5('0x33')](_0x57677d)[_0x28a5('0x22')](function(_0x5efa7a){_0x3cc30d[_0x28a5('0x33')]=_0x5efa7a;if(_0xaec372[_0x28a5('0x49')][_0x28a5('0x59')]){_0x67f926['include']=[{'all':!![]}];}return db[_0x28a5('0x43')][_0x28a5('0x5a')](_0x67f926);})[_0x28a5('0x22')](function(_0x5718fd){_0x3cc30d[_0x28a5('0x5b')]=_0x5718fd;return _0x3cc30d;})[_0x28a5('0x22')](respondWithFilteredResult(_0x296cde,_0x67f926))[_0x28a5('0x2c')](handleError(_0x296cde,null));};exports[_0x28a5('0x5c')]=function(_0x158d66,_0xcd2790){var _0x4239fd={'raw':![],'where':{'id':_0x158d66['params']['id']},'include':[{'model':db[_0x28a5('0x40')],'as':_0x28a5('0x41')}]},_0x3a3fee={};_0x3a3fee[_0x28a5('0x48')]=_[_0x28a5('0x4a')](db['OpenchannelAccount']['rawAttributes']);_0x3a3fee[_0x28a5('0x49')]=_[_0x28a5('0x4a')](_0x158d66[_0x28a5('0x49')]);_0x3a3fee[_0x28a5('0x4b')]=_[_0x28a5('0x4c')](_0x3a3fee['model'],_0x3a3fee[_0x28a5('0x49')]);_0x4239fd[_0x28a5('0x4d')]=_[_0x28a5('0x4c')](_0x3a3fee[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0x158d66[_0x28a5('0x49')]['fields']));_0x4239fd[_0x28a5('0x4d')]=_0x4239fd['attributes']['length']?_0x4239fd['attributes']:_0x3a3fee[_0x28a5('0x48')];if(_0x158d66[_0x28a5('0x49')][_0x28a5('0x59')]){_0x4239fd[_0x28a5('0x5d')]=[{'all':!![]}];}_0x4239fd=_[_0x28a5('0x56')]({},_0x4239fd,_0x158d66[_0x28a5('0x58')]);return db[_0x28a5('0x43')]['find'](_0x4239fd)['then'](handleEntityNotFound(_0xcd2790,null))[_0x28a5('0x22')](respondWithResult(_0xcd2790,null))[_0x28a5('0x2c')](handleError(_0xcd2790,null));};exports[_0x28a5('0x5e')]=function(_0xf826ba,_0x1a32f2){return db['OpenchannelAccount'][_0x28a5('0x5e')](_0xf826ba[_0x28a5('0x5f')],{})[_0x28a5('0x22')](function(_0x19db61){var _0x118043=_0xf826ba[_0x28a5('0x60')][_0x28a5('0x38')]({'plain':!![]});if(!_0x118043)throw new Error(_0x28a5('0x61'));if(_0x118043[_0x28a5('0x62')]==='user'){var _0x3f53f9=_0x19db61[_0x28a5('0x38')]({'plain':!![]});var _0x491913='OpenchannelAccounts';return db[_0x28a5('0x63')]['find']({'where':{'name':_0x491913,'userProfileId':_0x118043[_0x28a5('0x64')]},'raw':!![]})['then'](function(_0x62b8c4){if(_0x62b8c4&&_0x62b8c4[_0x28a5('0x65')]===0x0){return db[_0x28a5('0x3a')][_0x28a5('0x5e')]({'name':_0x3f53f9[_0x28a5('0x3d')],'resourceId':_0x3f53f9['id'],'type':_0x62b8c4[_0x28a5('0x3d')],'sectionId':_0x62b8c4['id']},{})[_0x28a5('0x22')](function(){return _0x19db61;});}else{return _0x19db61;}})[_0x28a5('0x2c')](function(_0x5b8f7c){logger[_0x28a5('0x27')](_0x28a5('0x66'),_0x5b8f7c);throw _0x5b8f7c;});}return _0x19db61;})['then'](respondWithResult(_0x1a32f2,0xc9))[_0x28a5('0x2c')](handleError(_0x1a32f2,null));};exports[_0x28a5('0x67')]=function(_0x3f6216,_0x28c4ae){if(_0x3f6216['body']['id']){delete _0x3f6216[_0x28a5('0x5f')]['id'];}return db[_0x28a5('0x43')]['find']({'where':{'id':_0x3f6216['params']['id']},'include':[{'model':db['Pause'],'as':_0x28a5('0x41')}]})['then'](handleEntityNotFound(_0x28c4ae,null))['then'](saveUpdates(_0x3f6216[_0x28a5('0x5f')],null))[_0x28a5('0x22')](respondWithResult(_0x28c4ae,null))[_0x28a5('0x2c')](handleError(_0x28c4ae,null));};exports[_0x28a5('0x37')]=function(_0x45de6c,_0x3419eb){return db[_0x28a5('0x43')][_0x28a5('0x68')]({'where':{'id':_0x45de6c[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x3419eb,null))[_0x28a5('0x22')](removeEntity(_0x3419eb,null))[_0x28a5('0x2c')](handleError(_0x3419eb,null));};exports['describe']=function(_0x2ac5a3,_0x4ba7db){return db['OpenchannelAccount'][_0x28a5('0x6a')]()[_0x28a5('0x22')](respondWithResult(_0x4ba7db,null))['catch'](handleError(_0x4ba7db,null));};exports['addDisposition']=function(_0x24b118,_0xc37f71,_0x57e833){if(_0x24b118['body']['id']){delete _0x24b118[_0x28a5('0x5f')]['id'];}return db[_0x28a5('0x43')][_0x28a5('0x68')]({'where':{'id':_0x24b118[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0xc37f71,null))[_0x28a5('0x22')](function(_0xe319f){if(_0xe319f){_0x24b118[_0x28a5('0x5f')]['OpenchannelAccountId']=_0xe319f['id'];return db[_0x28a5('0x6b')]['create'](_0x24b118[_0x28a5('0x5f')]);}})[_0x28a5('0x22')](respondWithResult(_0xc37f71,null))[_0x28a5('0x2c')](handleError(_0xc37f71,null));};exports[_0x28a5('0x6c')]=function(_0x4e8235,_0xb9081f,_0x21e200){var _0xd1b186={'raw':![],'where':{}};var _0x9bb09a={};var _0x7fd3a9={'count':0x0,'rows':[]};return db[_0x28a5('0x43')][_0x28a5('0x6d')]({'where':{'id':_0x4e8235['params']['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0xb9081f,null))[_0x28a5('0x22')](function(_0x360d4f){if(_0x360d4f){_0x9bb09a['model']=_['keys'](db[_0x28a5('0x6b')][_0x28a5('0x44')]);_0x9bb09a[_0x28a5('0x49')]=_['keys'](_0x4e8235[_0x28a5('0x49')]);_0x9bb09a[_0x28a5('0x4b')]=_[_0x28a5('0x4c')](_0x9bb09a['model'],_0x9bb09a[_0x28a5('0x49')]);_0xd1b186[_0x28a5('0x4d')]=_[_0x28a5('0x4c')](_0x9bb09a[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0x4e8235[_0x28a5('0x49')][_0x28a5('0x4e')]));_0xd1b186[_0x28a5('0x4d')]=_0xd1b186[_0x28a5('0x4d')][_0x28a5('0x4f')]?_0xd1b186[_0x28a5('0x4d')]:_0x9bb09a[_0x28a5('0x48')];if(!_0x4e8235[_0x28a5('0x49')][_0x28a5('0x50')](_0x28a5('0x51'))){_0xd1b186['limit']=qs[_0x28a5('0x31')](_0x4e8235[_0x28a5('0x49')]['limit']);_0xd1b186[_0x28a5('0x30')]=qs[_0x28a5('0x30')](_0x4e8235['query'][_0x28a5('0x30')]);}_0xd1b186[_0x28a5('0x52')]=qs[_0x28a5('0x53')](_0x4e8235['query'][_0x28a5('0x53')]);_0xd1b186[_0x28a5('0x54')]=qs[_0x28a5('0x4b')](_[_0x28a5('0x6e')](_0x4e8235[_0x28a5('0x49')],_0x9bb09a[_0x28a5('0x4b')]));_0xd1b186[_0x28a5('0x54')][_0x28a5('0x6f')]=_0x360d4f['id'];if(_0x4e8235['query']['filter']){_0xd1b186['where']=_['merge'](_0xd1b186[_0x28a5('0x54')],{'$or':_[_0x28a5('0x42')](_0xd1b186['attributes'],function(_0x3b215e){var _0x110bbf={};_0x110bbf[_0x3b215e]={'$like':'%'+_0x4e8235[_0x28a5('0x49')][_0x28a5('0x55')]+'%'};return _0x110bbf;})});}_0xd1b186=_[_0x28a5('0x56')]({},_0xd1b186,_0x4e8235['options']);return db[_0x28a5('0x6b')][_0x28a5('0x33')]({'where':_0xd1b186[_0x28a5('0x54')]})['then'](function(_0x3a3813){_0x7fd3a9[_0x28a5('0x33')]=_0x3a3813;if(_0x4e8235[_0x28a5('0x49')][_0x28a5('0x59')]){_0xd1b186[_0x28a5('0x5d')]=[{'all':!![]}];}return db[_0x28a5('0x6b')][_0x28a5('0x5a')](_0xd1b186);})[_0x28a5('0x22')](function(_0x2426e0){_0x7fd3a9[_0x28a5('0x5b')]=_0x2426e0;return _0x7fd3a9;});}})[_0x28a5('0x22')](respondWithFilteredResult(_0xb9081f,_0xd1b186))[_0x28a5('0x2c')](handleError(_0xb9081f,null));};exports['removeDispositions']=function(_0x13a3ec,_0x157f84,_0x2a8ff0){return db[_0x28a5('0x43')][_0x28a5('0x68')]({'where':{'id':_0x13a3ec[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x157f84,null))[_0x28a5('0x22')](function(_0x496394){if(_0x496394){return _0x496394['removeDispositions'](_0x13a3ec['query'][_0x28a5('0x70')]);}})[_0x28a5('0x22')](respondWithStatusCode(_0x157f84,null))[_0x28a5('0x2c')](handleError(_0x157f84,null));};exports[_0x28a5('0x71')]=function(_0x184bd1,_0x1c0cce,_0x1d5a31){if(_0x184bd1[_0x28a5('0x5f')]['id']){delete _0x184bd1[_0x28a5('0x5f')]['id'];}return db[_0x28a5('0x43')]['find']({'where':{'id':_0x184bd1[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x1c0cce,null))[_0x28a5('0x22')](function(_0x42d672){if(_0x42d672){_0x184bd1[_0x28a5('0x5f')][_0x28a5('0x6f')]=_0x42d672['id'];return db[_0x28a5('0x72')][_0x28a5('0x5e')](_0x184bd1[_0x28a5('0x5f')]);}})[_0x28a5('0x22')](respondWithResult(_0x1c0cce,null))[_0x28a5('0x2c')](handleError(_0x1c0cce,null));};exports[_0x28a5('0x73')]=function(_0x3aa2cb,_0x3fe769,_0x6fa10e){var _0x5f357e={'raw':![],'where':{}};var _0x2465b5={};var _0x58c224={'count':0x0,'rows':[]};return db[_0x28a5('0x43')][_0x28a5('0x6d')]({'where':{'id':_0x3aa2cb[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x3fe769,null))[_0x28a5('0x22')](function(_0x4f7ee9){if(_0x4f7ee9){_0x2465b5[_0x28a5('0x48')]=_['keys'](db[_0x28a5('0x72')][_0x28a5('0x44')]);_0x2465b5[_0x28a5('0x49')]=_[_0x28a5('0x4a')](_0x3aa2cb[_0x28a5('0x49')]);_0x2465b5['filters']=_[_0x28a5('0x4c')](_0x2465b5[_0x28a5('0x48')],_0x2465b5[_0x28a5('0x49')]);_0x5f357e[_0x28a5('0x4d')]=_['intersection'](_0x2465b5[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0x3aa2cb[_0x28a5('0x49')][_0x28a5('0x4e')]));_0x5f357e['attributes']=_0x5f357e['attributes']['length']?_0x5f357e[_0x28a5('0x4d')]:_0x2465b5['model'];if(!_0x3aa2cb[_0x28a5('0x49')][_0x28a5('0x50')](_0x28a5('0x51'))){_0x5f357e[_0x28a5('0x31')]=qs['limit'](_0x3aa2cb[_0x28a5('0x49')][_0x28a5('0x31')]);_0x5f357e['offset']=qs['offset'](_0x3aa2cb['query'][_0x28a5('0x30')]);}_0x5f357e[_0x28a5('0x52')]=qs['sort'](_0x3aa2cb[_0x28a5('0x49')][_0x28a5('0x53')]);_0x5f357e['where']=qs[_0x28a5('0x4b')](_[_0x28a5('0x6e')](_0x3aa2cb[_0x28a5('0x49')],_0x2465b5[_0x28a5('0x4b')]));_0x5f357e[_0x28a5('0x54')][_0x28a5('0x6f')]=_0x4f7ee9['id'];if(_0x3aa2cb[_0x28a5('0x49')][_0x28a5('0x55')]){_0x5f357e[_0x28a5('0x54')]=_[_0x28a5('0x56')](_0x5f357e['where'],{'$or':_[_0x28a5('0x42')](_0x5f357e[_0x28a5('0x4d')],function(_0x5599f7){var _0x13caab={};_0x13caab[_0x5599f7]={'$like':'%'+_0x3aa2cb[_0x28a5('0x49')]['filter']+'%'};return _0x13caab;})});}_0x5f357e=_[_0x28a5('0x56')]({},_0x5f357e,_0x3aa2cb[_0x28a5('0x58')]);return db[_0x28a5('0x72')][_0x28a5('0x33')]({'where':_0x5f357e['where']})[_0x28a5('0x22')](function(_0x4c2808){_0x58c224[_0x28a5('0x33')]=_0x4c2808;if(_0x3aa2cb[_0x28a5('0x49')]['includeAll']){_0x5f357e[_0x28a5('0x5d')]=[{'all':!![]}];}return db[_0x28a5('0x72')][_0x28a5('0x5a')](_0x5f357e);})[_0x28a5('0x22')](function(_0x1c0088){_0x58c224[_0x28a5('0x5b')]=_0x1c0088;return _0x58c224;});}})[_0x28a5('0x22')](respondWithFilteredResult(_0x3fe769,_0x5f357e))[_0x28a5('0x2c')](handleError(_0x3fe769,null));};exports[_0x28a5('0x74')]=function(_0x426374,_0x1459c4,_0x43ed23){return db[_0x28a5('0x43')][_0x28a5('0x68')]({'where':{'id':_0x426374[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x1459c4,null))[_0x28a5('0x22')](function(_0x555bac){if(_0x555bac){return _0x555bac[_0x28a5('0x74')](_0x426374[_0x28a5('0x49')]['ids']);}})[_0x28a5('0x22')](respondWithStatusCode(_0x1459c4,null))[_0x28a5('0x2c')](handleError(_0x1459c4,null));};exports[_0x28a5('0x75')]=function(_0x54d7ce,_0x6cde1c,_0x360dbd){var _0x507c0a={'body':_0x54d7ce['body'],'channel':'openchannel'};var _0x394d2a=[];var _0x24acdf=[];var _0x39608e={};var _0x5ce19b=![];return db[_0x28a5('0x76')][_0x28a5('0x6a')]()['then'](function(_0xa0caf){if(!_0xa0caf){throw new db[(_0x28a5('0x77'))][(_0x28a5('0x78'))]('no\x20available\x20attributes');}_0x394d2a=_[_0x28a5('0x79')](_[_0x28a5('0x4a')](_0xa0caf),[_0x28a5('0x7a'),_0x28a5('0x7b')]);_0x24acdf=_[_0x28a5('0x79')](_[_0x28a5('0x4a')](_0xa0caf),[_0x28a5('0x7a'),_0x28a5('0x7b'),_0x28a5('0x7c'),_0x28a5('0x7d')]);if(_0x54d7ce['body']['id']){delete _0x54d7ce[_0x28a5('0x5f')]['id'];}if(_[_0x28a5('0x7e')](_0x54d7ce['body'][_0x28a5('0x7f')])){throw new db[(_0x28a5('0x77'))]['ValidationError'](_0x28a5('0x80'));}if(_[_0x28a5('0x7e')](_0x54d7ce[_0x28a5('0x5f')]['body'])||_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x5f')]===''){throw new db[(_0x28a5('0x77'))]['ValidationError'](_0x28a5('0x81'));}if(_[_0x28a5('0x7e')](_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x82')])){throw new db['Sequelize'][(_0x28a5('0x78'))](_0x28a5('0x83')+_0x24acdf);}if(!_[_0x28a5('0x84')](_0x24acdf,_0x54d7ce['body'][_0x28a5('0x82')])){throw new db[(_0x28a5('0x77'))][(_0x28a5('0x78'))](_0x28a5('0x85')+_0x24acdf);}_0x39608e[_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x82')]]=_0x54d7ce[_0x28a5('0x5f')]['from'];})[_0x28a5('0x22')](function(){return db['OpenchannelAccount'][_0x28a5('0x68')]({'where':{'id':_0x54d7ce[_0x28a5('0x69')]['id']},'include':[{'model':db['CmList'],'as':_0x28a5('0x86'),'include':[{'model':db['CmContact'],'as':_0x28a5('0x87'),'where':_0x39608e,'limit':0x1,'order':[[_0x28a5('0x7b'),'DESC']]}]},{'model':db[_0x28a5('0x88')],'as':_0x28a5('0x89')}]});})[_0x28a5('0x22')](handleEntityNotFound(_0x6cde1c,null))['then'](function(_0x4ee4cc){if(_0x4ee4cc&&_0x4ee4cc[_0x28a5('0x86')]){_0x507c0a[_0x28a5('0x8a')]=_0x4ee4cc;_0x507c0a[_0x28a5('0x8b')]=_0x4ee4cc['Applications'];_0x507c0a[_0x28a5('0x8c')]=_0x4ee4cc['List'];_0x507c0a[_0x28a5('0x8b')]=_[_0x28a5('0x8d')](_0x507c0a[_0x28a5('0x8b')],[_0x28a5('0x8e')],['asc']);if(_0x507c0a['account'][_0x28a5('0x89')]){delete _0x507c0a['account']['Applications'];}if(_0x507c0a[_0x28a5('0x8a')][_0x28a5('0x86')]&&_0x507c0a['account'][_0x28a5('0x86')][_0x28a5('0x87')][_0x28a5('0x4f')]){return _0x507c0a['account'][_0x28a5('0x86')][_0x28a5('0x87')][0x0];}var _0x3916a8=_[_0x28a5('0x18')](_0x54d7ce[_0x28a5('0x5f')],{'firstName':_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x7f')],'ListId':_0x4ee4cc[_0x28a5('0x7d')]});_0x3916a8[_0x54d7ce[_0x28a5('0x5f')]['mapKey']]=_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x7f')];return db[_0x28a5('0x76')]['create'](_0x3916a8,{'fields':_0x394d2a,'raw':!![]});}})[_0x28a5('0x22')](handleEntityNotFound(_0x6cde1c,null))[_0x28a5('0x22')](function(_0x3a318c){_0x507c0a[_0x28a5('0x8f')]=_0x3a318c;if(_0x3a318c){var _0x3d7048={'ContactId':_0x3a318c['id'],'OpenchannelAccountId':_0x54d7ce['params']['id'],'from':(_0x3a318c[_0x28a5('0x90')]||'')+'\x20'+(_0x3a318c[_0x28a5('0x91')]||'')};var _0x8212ce={'OpenchannelAccountId':_0x54d7ce['params']['id'],'closed':![]};if(_0x54d7ce[_0x28a5('0x5f')]['threadId']){_0x8212ce[_0x28a5('0x92')]=_0x54d7ce[_0x28a5('0x5f')]['threadId'];return db['OpenchannelInteraction'][_0x28a5('0x68')]({'where':_0x8212ce})[_0x28a5('0x22')](function(_0x4a024c){if(_0x4a024c){return[_0x4a024c,![]];}_0x3d7048[_0x28a5('0x92')]=_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x92')];_0x3d7048[_0x28a5('0x93')]=_0x54d7ce[_0x28a5('0x5f')]['externalUrl'];return db[_0x28a5('0x94')][_0x28a5('0x5e')](_0x3d7048)[_0x28a5('0x22')](function(_0x531fa2){return[_0x531fa2,!![]];});});}else{_0x8212ce['threadId']=null;}_0x8212ce[_0x28a5('0x95')]=_0x3a318c['id'];return db[_0x28a5('0x94')][_0x28a5('0x68')]({'where':_0x8212ce})['then'](function(_0x4b7e2e){if(_0x4b7e2e){return[_0x4b7e2e,![]];}return db['OpenchannelInteraction'][_0x28a5('0x5e')](_0x3d7048)[_0x28a5('0x22')](function(_0x709658){return[_0x709658,!![]];});});}})[_0x28a5('0x96')](function(_0x383014,_0x3c3423){if(_0x383014){_0x5ce19b=_0x3c3423;if(!_0x3c3423){var _0x5a4a2e={'from':(_0x507c0a['contact'][_0x28a5('0x90')]||'')+'\x20'+(_0x507c0a['contact']['lastName']||'')};if(_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x92')]&&_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x97')]&&_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0x92')]!=_0x54d7ce['body'][_0x28a5('0x97')]){_0x5a4a2e[_0x28a5('0x92')]=_0x54d7ce['body']['messageId'];}return _0x383014[_0x28a5('0x67')](_0x5a4a2e);}else{return _0x383014;}}})[_0x28a5('0x22')](function(_0x5a9e03){_0x507c0a[_0x28a5('0x98')]=_0x5a9e03[_0x28a5('0x38')]({'plain':!![]});_0x507c0a[_0x28a5('0x98')][_0x28a5('0x99')]=_0x5ce19b;if(_0x507c0a[_0x28a5('0x98')][_0x28a5('0x99')]){if(_0x507c0a[_0x28a5('0x8a')][_0x28a5('0x9a')]){_0x507c0a[_0x28a5('0x8b')][_0x28a5('0x9b')]({'id':0x0,'priority':_0x507c0a[_0x28a5('0x8b')]['length']+0x1,'app':_0x28a5('0x9c'),'appdata':_0x28a5('0x9d'),'interval':_0x28a5('0x9e')});}}return db[_0x28a5('0x9f')][_0x28a5('0x5e')]({'body':_0x54d7ce[_0x28a5('0x5f')]['body'],'OpenchannelAccountId':_0x54d7ce[_0x28a5('0x69')]['id'],'OpenchannelInteractionId':_0x5a9e03['id'],'direction':'in','ContactId':_0x507c0a[_0x28a5('0x8f')]['id'],'AttachmentId':_0x54d7ce[_0x28a5('0x5f')][_0x28a5('0xa0')]});})['then'](function(_0x480be4){_0x507c0a['message']=_0x480be4;if(_0x507c0a[_0x28a5('0x98')]['UserId']){return db[_0x28a5('0xa1')][_0x28a5('0x68')]({'attributes':['id','name'],'where':{'id':_0x507c0a[_0x28a5('0x98')][_0x28a5('0xa2')]}})[_0x28a5('0x22')](function(_0xcf756){if(_0xcf756){_0x507c0a[_0x28a5('0x8b')][_0x28a5('0xa3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xcf756[_0x28a5('0x3d')]+','+(_0x507c0a[_0x28a5('0x8a')][_0x28a5('0xa4')]||0xa),'interval':_0x28a5('0x9e')});_0x507c0a[_0x28a5('0xa5')]=![];}return respondWithRpcPromise(_0x28a5('0xa6'),_0x28a5('0xa7'),_0x507c0a);});}return respondWithRpcPromise('Start',_0x28a5('0xa7'),_0x507c0a);})[_0x28a5('0x22')](function(_0x28139b){respondWithRpcPromise(_0x28a5('0xa8'),_0x28a5('0xa8'),{'event':'notify','message':_0x28139b},client9002);return _0x28139b;})[_0x28a5('0x22')](respondWithResult(_0x6cde1c,null))['catch'](handleError(_0x6cde1c,null));};exports[_0x28a5('0xa9')]=function(_0x4b7dd5,_0x248916){var _0x26436e=_0x4b7dd5[_0x28a5('0x69')]['id'];var _0x20be8=_0x4b7dd5[_0x28a5('0x5f')];var _0x126ff=0xc8;var _0x2e348d=null;return db[_0x28a5('0xaa')]['transaction']({'isolationLevel':db[_0x28a5('0xaa')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x294213){return db[_0x28a5('0x43')][_0x28a5('0x6d')]({'where':{'id':_0x26436e},'transaction':_0x294213})[_0x28a5('0x22')](function(_0x36b1a4){if(_0x36b1a4){return db[_0x28a5('0x88')][_0x28a5('0x37')]({'where':{'OpenchannelAccountId':_0x26436e},'transaction':_0x294213})['then'](function(){var _0x4da560=_['map'](_0x20be8,function(_0x29c386){_0x29c386[_0x28a5('0x6f')]=_0x26436e;return _0x29c386;});return db['OpenchannelApplication'][_0x28a5('0xab')](_0x4da560,{'transaction':_0x294213});});}else{_0x126ff=0x194;_0x2e348d=[];}});})['then'](function(){if(_0x126ff!==0x194){return db[_0x28a5('0x88')][_0x28a5('0xac')]({'where':{'OpenchannelAccountId':_0x26436e},'order':_0x28a5('0x8e')})[_0x28a5('0x22')](function(_0x552584){_0x2e348d=_0x552584;});}})[_0x28a5('0x2c')](function(_0x5a602d){_0x126ff=0x1f4;logger[_0x28a5('0x27')](_0x5a602d[_0x28a5('0x3c')]);if(_0x5a602d[_0x28a5('0x3d')]){delete _0x5a602d[_0x28a5('0x3d')];}_0x2e348d=_0x5a602d;})['finally'](function(){if(_0x2e348d===null){_0x248916['sendStatus'](_0x126ff);}else{if(_0x126ff===0x1f4){_0x248916[_0x28a5('0x2e')](_0x126ff)[_0x28a5('0x3e')](_0x2e348d);}else{_0x248916[_0x28a5('0x2e')](_0x126ff)['json'](_0x2e348d);}}});};exports['getApplications']=function(_0x14aac8,_0x223d3c,_0x47fce2){var _0x27367b={};var _0xb218a3={};var _0x462c19;var _0x132d8e;return db['OpenchannelAccount'][_0x28a5('0x6d')]({'where':{'id':_0x14aac8[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x223d3c,null))[_0x28a5('0x22')](function(_0x4f6479){if(_0x4f6479){_0x462c19=_0x4f6479;_0xb218a3[_0x28a5('0x48')]=_['keys'](db[_0x28a5('0x88')]['rawAttributes']);_0xb218a3[_0x28a5('0x49')]=_['keys'](_0x14aac8[_0x28a5('0x49')]);_0xb218a3[_0x28a5('0x4b')]=_[_0x28a5('0x4c')](_0xb218a3[_0x28a5('0x48')],_0xb218a3['query']);_0x27367b[_0x28a5('0x4d')]=_[_0x28a5('0x4c')](_0xb218a3[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0x14aac8[_0x28a5('0x49')][_0x28a5('0x4e')]));_0x27367b[_0x28a5('0x4d')]=_0x27367b[_0x28a5('0x4d')]['length']?_0x27367b[_0x28a5('0x4d')]:_0xb218a3[_0x28a5('0x48')];_0x27367b[_0x28a5('0x52')]=qs[_0x28a5('0x53')](_0x14aac8['query'][_0x28a5('0x53')]);_0x27367b[_0x28a5('0x54')]=qs[_0x28a5('0x4b')](_['pick'](_0x14aac8[_0x28a5('0x49')],_0xb218a3[_0x28a5('0x4b')]));if(_0x14aac8[_0x28a5('0x49')][_0x28a5('0x55')]){_0x27367b[_0x28a5('0x54')]=_['merge'](_0x27367b[_0x28a5('0x54')],{'$or':_[_0x28a5('0x42')](_0x27367b[_0x28a5('0x4d')],function(_0x4a5964){var _0x32defe={};_0x32defe[_0x4a5964]={'$like':'%'+_0x14aac8['query']['filter']+'%'};return _0x32defe;})});}_0x27367b=_[_0x28a5('0x56')]({},_0x27367b,_0x14aac8['options']);return _0x462c19[_0x28a5('0xad')](_0x27367b);}})['then'](function(_0x293267){if(_0x293267){_0x132d8e=_0x293267['length'];if(!_0x14aac8['query'][_0x28a5('0x50')]('nolimit')){_0x27367b[_0x28a5('0x31')]=qs[_0x28a5('0x31')](_0x14aac8[_0x28a5('0x49')][_0x28a5('0x31')]);_0x27367b[_0x28a5('0x30')]=qs[_0x28a5('0x30')](_0x14aac8[_0x28a5('0x49')][_0x28a5('0x30')]);}return _0x462c19[_0x28a5('0xad')](_0x27367b);}})['then'](function(_0x312fef){if(_0x312fef){return _0x312fef?{'count':_0x132d8e,'rows':_0x312fef}:null;}})[_0x28a5('0x22')](respondWithResult(_0x223d3c,null))[_0x28a5('0x2c')](handleError(_0x223d3c,null));};exports[_0x28a5('0xae')]=function(_0x1d89c0,_0x55991d,_0x44924c){var _0x972331={'raw':![],'where':{}};var _0x4fe7b6={};var _0x3471a7={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x28a5('0x6d')]({'where':{'id':_0x1d89c0[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x55991d,null))[_0x28a5('0x22')](function(_0x12821e){if(_0x12821e){_0x4fe7b6[_0x28a5('0x48')]=_[_0x28a5('0x4a')](db[_0x28a5('0x94')][_0x28a5('0x44')]);_0x4fe7b6[_0x28a5('0x49')]=_[_0x28a5('0x4a')](_0x1d89c0[_0x28a5('0x49')]);_0x4fe7b6[_0x28a5('0x4b')]=_['intersection'](_0x4fe7b6[_0x28a5('0x48')],_0x4fe7b6['query']);_0x972331[_0x28a5('0x4d')]=_[_0x28a5('0x4c')](_0x4fe7b6[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0x1d89c0['query']['fields']));_0x972331[_0x28a5('0x4d')]=_0x972331[_0x28a5('0x4d')][_0x28a5('0x4f')]?_0x972331['attributes']:_0x4fe7b6[_0x28a5('0x48')];if(!_0x1d89c0[_0x28a5('0x49')][_0x28a5('0x50')](_0x28a5('0x51'))){_0x972331[_0x28a5('0x31')]=qs[_0x28a5('0x31')](_0x1d89c0[_0x28a5('0x49')][_0x28a5('0x31')]);_0x972331[_0x28a5('0x30')]=qs['offset'](_0x1d89c0[_0x28a5('0x49')][_0x28a5('0x30')]);}_0x972331['order']=qs[_0x28a5('0x53')](_0x1d89c0['query'][_0x28a5('0x53')]);_0x972331[_0x28a5('0x54')]=qs[_0x28a5('0x4b')](_[_0x28a5('0x6e')](_0x1d89c0[_0x28a5('0x49')],_0x4fe7b6['filters']));_0x972331[_0x28a5('0x54')][_0x28a5('0x6f')]=_0x12821e['id'];if(_0x1d89c0[_0x28a5('0x49')]['filter']){_0x972331[_0x28a5('0x54')]=_[_0x28a5('0x56')](_0x972331[_0x28a5('0x54')],{'$or':_[_0x28a5('0x42')](_0x972331['attributes'],function(_0xd4447){var _0x571264={};_0x571264[_0xd4447]={'$like':'%'+_0x1d89c0['query'][_0x28a5('0x55')]+'%'};return _0x571264;})});}_0x972331=_[_0x28a5('0x56')]({},_0x972331,_0x1d89c0[_0x28a5('0x58')]);return db[_0x28a5('0x94')][_0x28a5('0x33')]({'where':_0x972331[_0x28a5('0x54')]})[_0x28a5('0x22')](function(_0x318012){_0x3471a7[_0x28a5('0x33')]=_0x318012;if(_0x1d89c0['query'][_0x28a5('0x59')]){_0x972331[_0x28a5('0x5d')]=[{'model':db[_0x28a5('0x76')],'as':_0x28a5('0xaf'),'required':![]},{'model':db[_0x28a5('0xa1')],'as':_0x28a5('0xb0'),'attributes':[_0x28a5('0x3d'),_0x28a5('0xb1'),_0x28a5('0xb2')],'required':![]},{'model':db[_0x28a5('0xb3')],'as':_0x28a5('0xb4'),'attributes':['id',_0x28a5('0x3d'),_0x28a5('0xb5')],'where':_0x1d89c0[_0x28a5('0x49')][_0x28a5('0xb6')]?{'id':_0x1d89c0[_0x28a5('0x49')][_0x28a5('0xb6')]}:undefined,'required':_0x1d89c0['query'][_0x28a5('0xb6')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x28a5('0x5a')](_0x972331);})[_0x28a5('0x22')](function(_0x44b08d){_0x3471a7[_0x28a5('0x5b')]=_0x44b08d;return _0x3471a7;});}})[_0x28a5('0x22')](respondWithFilteredResult(_0x55991d,_0x972331))[_0x28a5('0x2c')](handleError(_0x55991d,null));};exports[_0x28a5('0xb7')]=function(_0x2d6302,_0x42a305,_0x1d79a0){return db[_0x28a5('0x43')][_0x28a5('0x68')]({'where':{'id':_0x2d6302['params']['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x42a305,null))[_0x28a5('0x22')](function(_0x4b35ca){if(_0x4b35ca){return _0x4b35ca[_0x28a5('0xb7')](_0x2d6302['body'][_0x28a5('0x70')],_[_0x28a5('0xb8')](_0x2d6302['body'],[_0x28a5('0x70'),'id'])||{})['spread'](function(_0xc4d5c2){for(var _0x4833f1=0x0;_0x4833f1<_0x2d6302[_0x28a5('0x5f')][_0x28a5('0x70')][_0x28a5('0x4f')];_0x4833f1+=0x1){socket[_0x28a5('0xb9')](_0x28a5('0xba'),{'UserId':Number(_0x2d6302[_0x28a5('0x5f')][_0x28a5('0x70')][_0x4833f1]),'OpenchannelAccountId':Number(_0x2d6302[_0x28a5('0x69')]['id'])});}return _0xc4d5c2;});}})[_0x28a5('0x22')](respondWithResult(_0x42a305,null))[_0x28a5('0x2c')](handleError(_0x42a305,null));};exports[_0x28a5('0xbb')]=function(_0x1b9b8d,_0x1551e9,_0x58402f){return db['OpenchannelAccount']['find']({'where':{'id':_0x1b9b8d[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x1551e9,null))[_0x28a5('0x22')](function(_0x2ddb5a){if(_0x2ddb5a){return _0x2ddb5a[_0x28a5('0xbb')](_0x1b9b8d['query'][_0x28a5('0x70')])[_0x28a5('0x22')](function(){if(_[_0x28a5('0xbc')](_0x1b9b8d[_0x28a5('0x49')]['ids'])){for(var _0x1cf320=0x0;_0x1cf320<_0x1b9b8d[_0x28a5('0x49')][_0x28a5('0x70')][_0x28a5('0x4f')];_0x1cf320+=0x1){socket['emit'](_0x28a5('0xbd'),{'UserId':Number(_0x1b9b8d['query']['ids'][_0x1cf320]),'OpenchannelAccountId':Number(_0x1b9b8d[_0x28a5('0x69')]['id'])});}}else{socket[_0x28a5('0xb9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1b9b8d[_0x28a5('0x49')][_0x28a5('0x70')]),'OpenchannelAccountId':Number(_0x1b9b8d['params']['id'])});}});}})[_0x28a5('0x22')](respondWithStatusCode(_0x1551e9,null))['catch'](handleError(_0x1551e9,null));};exports[_0x28a5('0xbe')]=function(_0x32ca6e,_0x3140ae,_0x14ff60){var _0x2ab687={};var _0x3f71ef={};var _0x2e603e;var _0x45fa60;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x32ca6e[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x3140ae,null))[_0x28a5('0x22')](function(_0x5c5a6b){if(_0x5c5a6b){_0x2e603e=_0x5c5a6b;_0x3f71ef[_0x28a5('0x48')]=_[_0x28a5('0x4a')](db[_0x28a5('0xa1')][_0x28a5('0x44')]);_0x3f71ef[_0x28a5('0x49')]=_[_0x28a5('0x4a')](_0x32ca6e['query']);_0x3f71ef['filters']=_[_0x28a5('0x4c')](_0x3f71ef[_0x28a5('0x48')],_0x3f71ef[_0x28a5('0x49')]);_0x2ab687['attributes']=_[_0x28a5('0x4c')](_0x3f71ef[_0x28a5('0x48')],qs[_0x28a5('0x4e')](_0x32ca6e[_0x28a5('0x49')][_0x28a5('0x4e')]));_0x2ab687[_0x28a5('0x4d')]=_0x2ab687[_0x28a5('0x4d')][_0x28a5('0x4f')]?_0x2ab687[_0x28a5('0x4d')]:_0x3f71ef['model'];_0x2ab687[_0x28a5('0x52')]=qs['sort'](_0x32ca6e['query'][_0x28a5('0x53')]);_0x2ab687[_0x28a5('0x54')]=qs['filters'](_[_0x28a5('0x6e')](_0x32ca6e[_0x28a5('0x49')],_0x3f71ef[_0x28a5('0x4b')]));if(_0x32ca6e[_0x28a5('0x49')][_0x28a5('0x55')]){_0x2ab687[_0x28a5('0x54')]=_[_0x28a5('0x56')](_0x2ab687[_0x28a5('0x54')],{'$or':_['map'](_0x2ab687[_0x28a5('0x4d')],function(_0x43b4b2){var _0x36ceb8={};_0x36ceb8[_0x43b4b2]={'$like':'%'+_0x32ca6e['query'][_0x28a5('0x55')]+'%'};return _0x36ceb8;})});}_0x2ab687=_[_0x28a5('0x56')]({},_0x2ab687,_0x32ca6e['options']);return _0x2e603e[_0x28a5('0xbe')](_0x2ab687);}})[_0x28a5('0x22')](function(_0x35af9d){if(_0x35af9d){_0x45fa60=_0x35af9d['length'];if(!_0x32ca6e['query']['hasOwnProperty']('nolimit')){_0x2ab687[_0x28a5('0x31')]=qs['limit'](_0x32ca6e[_0x28a5('0x49')][_0x28a5('0x31')]);_0x2ab687[_0x28a5('0x30')]=qs[_0x28a5('0x30')](_0x32ca6e[_0x28a5('0x49')][_0x28a5('0x30')]);}return _0x2e603e[_0x28a5('0xbe')](_0x2ab687);}})[_0x28a5('0x22')](function(_0x2c09ee){if(_0x2c09ee){return _0x2c09ee?{'count':_0x45fa60,'rows':_0x2c09ee}:null;}})[_0x28a5('0x22')](respondWithResult(_0x3140ae,null))['catch'](handleError(_0x3140ae,null));};exports[_0x28a5('0x3e')]=function(_0x3f1489,_0x43d370,_0x19d924){var _0x59e835,_0x1e8cf6,_0x54217d;if(_[_0x28a5('0x7e')](_0x3f1489[_0x28a5('0x5f')][_0x28a5('0x5f')])||_0x3f1489[_0x28a5('0x5f')][_0x28a5('0x5f')]===''){throw new db[(_0x28a5('0x77'))][(_0x28a5('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x28a5('0x7e')](_0x3f1489[_0x28a5('0x5f')]['to'])){}_0x59e835=_0x3f1489[_0x28a5('0x5f')]['to'];return db[_0x28a5('0x43')]['findOne']({'where':{'id':_0x3f1489[_0x28a5('0x69')]['id']}})[_0x28a5('0x22')](handleEntityNotFound(_0x43d370,null))['then'](function(_0xc2d9e3){if(_0xc2d9e3){return db[_0x28a5('0x43')][_0x28a5('0x68')]({'where':{'id':_0xc2d9e3['id']},'include':[{'model':db[_0x28a5('0xbf')],'as':'List','include':[{'model':db[_0x28a5('0x76')],'as':'Contacts','where':{[_0xc2d9e3[_0x28a5('0x82')]]:_0x59e835},'limit':0x1,'order':[[_0x28a5('0x7b'),_0x28a5('0xc0')]]}]}]})['then'](handleEntityNotFound(_0x43d370,null))[_0x28a5('0x22')](function(_0x3c6be9){if(_0x3c6be9&&_0x3c6be9[_0x28a5('0x86')]){_0x1e8cf6=_0x3c6be9['get']({'plain':!![]});if(_0x1e8cf6[_0x28a5('0x86')]&&_0x1e8cf6['List'][_0x28a5('0x87')]['length']){return _0x1e8cf6[_0x28a5('0x86')][_0x28a5('0x87')][0x0];}return db[_0x28a5('0x76')][_0x28a5('0x5e')](_['defaults'](_0x3f1489[_0x28a5('0x5f')],{'firstName':_0x59e835,[_0x3c6be9['mapKey']]:_0x59e835,'phone':_0x59e835,'ListId':_0x1e8cf6[_0x28a5('0x7d')]}));}})['then'](handleEntityNotFound(_0x43d370,null))['then'](function(_0x514fe9){if(_0x514fe9){_0x54217d=_0x514fe9;return db[_0x28a5('0x94')][_0x28a5('0x68')]({'where':{'ContactId':_0x54217d['id'],'closed':![],'OpenchannelAccountId':_0x1e8cf6['id']}})['then'](function(_0x5d7474){if(_0x5d7474){return[_0x5d7474,![]];}return db['OpenchannelInteraction'][_0x28a5('0x5e')]({'UserId':_0x3f1489[_0x28a5('0x60')]['id'],'ContactId':_0x54217d['id'],'OpenchannelAccountId':_0x1e8cf6['id'],'lastMsgDirection':_0x28a5('0xc1'),'Messages':[_[_0x28a5('0x56')](_0x3f1489[_0x28a5('0x5f')],{'read':![],'body':_0x3f1489[_0x28a5('0x5f')]['body'],'OpenchannelAccountId':_0x1e8cf6['id'],'UserId':_0x3f1489['user']['id'],'ContactId':_0x54217d['id']})]},{'include':[{'model':db[_0x28a5('0x9f')],'as':_0x28a5('0xc2')}]})[_0x28a5('0x22')](function(_0x4a5dfd){return[_0x4a5dfd,!![]];});});}})[_0x28a5('0x96')](function(_0x5e007f,_0x1305c5){if(_0x1305c5){return _0x5e007f;}return db['OpenchannelMessage'][_0x28a5('0x5e')](_['merge'](_0x3f1489[_0x28a5('0x5f')],{'read':![],'body':_0x3f1489[_0x28a5('0x5f')]['body'],'OpenchannelAccountId':_0x1e8cf6['id'],'OpenchannelInteractionId':_0x5e007f['id'],'UserId':_0x3f1489['user']['id'],'ContactId':_0x54217d['id']}))[_0x28a5('0x22')](function(_0x3fc0e9){_0x5e007f['dataValues'][_0x28a5('0xc2')]=[];_0x5e007f[_0x28a5('0xc3')][_0x28a5('0xc2')][_0x28a5('0x9b')](_0x3fc0e9['dataValues']);return _0x5e007f;});});}})['then'](respondWithResult(_0x43d370,null))[_0x28a5('0x2c')](handleError(_0x43d370,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5decf88..3ea6ac5 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 _0xac4a=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','events'];(function(_0x2e3e01,_0x591a1f){var _0x51f3f1=function(_0x34937e){while(--_0x34937e){_0x2e3e01['push'](_0x2e3e01['shift']());}};_0x51f3f1(++_0x591a1f);}(_0xac4a,0x13f));var _0xaac4=function(_0x325dca,_0x26f4c8){_0x325dca=_0x325dca-0x0;var _0x2debc3=_0xac4a[_0x325dca];return _0x2debc3;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var OpenchannelAccount=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){OpenchannelAccountEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);OpenchannelAccountEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2d07a7,_0x206ba0){var _0x1c977a=function(_0x304b36){while(--_0x304b36){_0x2d07a7['push'](_0x2d07a7['shift']());}};_0x1c977a(++_0x206ba0);}(_0x13f6,0x124));var _0x613f=function(_0x45ecb2,_0x121636){_0x45ecb2=_0x45ecb2-0x0;var _0x541ce6=_0x13f6[_0x45ecb2];return _0x541ce6;};'use strict';var EventEmitter=require(_0x613f('0x0'));var OpenchannelAccount=require(_0x613f('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){OpenchannelAccountEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);OpenchannelAccountEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 581ed9c..6b96058 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(_0x2786ea,_0x17f47c){var _0x121ae4=function(_0x5b2b06){while(--_0x5b2b06){_0x2786ea['push'](_0x2786ea['shift']());}};_0x121ae4(++_0x17f47c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x349b71,_0x2a10db){var _0x5e3097=function(_0x4ef847){while(--_0x4ef847){_0x349b71['push'](_0x349b71['shift']());}};_0x5e3097(++_0x2a10db);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 172cd22..19df969 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 _0xa571=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x37bce9,_0xaeffeb){var _0x68ff2a=function(_0x40c9c0){while(--_0x40c9c0){_0x37bce9['push'](_0x37bce9['shift']());}};_0x68ff2a(++_0xaeffeb);}(_0xa571,0x107));var _0x1a57=function(_0x54d528,_0x51d950){_0x54d528=_0x54d528-0x0;var _0x13ebf6=_0xa571[_0x54d528];return _0x13ebf6;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});config[_0x1a57('0xa')]=_[_0x1a57('0xb')](config[_0x1a57('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a57('0xc'))(new Redis(config[_0x1a57('0xa')]));require(_0x1a57('0xd'))['register'](socket);function respondWithRpcPromise(_0x3c8182,_0x1f7086,_0x4740ef){return new BPromise(function(_0x289dc0,_0x831937){return client[_0x1a57('0xe')](_0x3c8182,_0x4740ef)[_0x1a57('0xf')](function(_0x22c683){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1f7086,_0x1a57('0x10'));logger[_0x1a57('0x11')](_0x1a57('0x12'),_0x1f7086,'request\x20sent',JSON[_0x1a57('0x13')](_0x22c683));if(_0x22c683[_0x1a57('0x14')]){if(_0x22c683['error'][_0x1a57('0x15')]===0x1f4){logger['error'](_0x1a57('0x16'),_0x1f7086,_0x22c683[_0x1a57('0x14')][_0x1a57('0x17')]);return _0x831937(_0x22c683[_0x1a57('0x14')]['message']);}logger[_0x1a57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x1f7086,_0x22c683['error'][_0x1a57('0x17')]);return _0x289dc0(_0x22c683[_0x1a57('0x14')][_0x1a57('0x17')]);}else{logger['info'](_0x1a57('0x16'),_0x1f7086,_0x1a57('0x10'));_0x289dc0(_0x22c683[_0x1a57('0x18')]['message']);}})[_0x1a57('0x19')](function(_0x4262c8){logger[_0x1a57('0x14')](_0x1a57('0x16'),_0x1f7086,_0x4262c8);_0x831937(_0x4262c8);});});} \ No newline at end of file +var _0x24cf=['rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5a97a6,_0x434915){var _0x1807c6=function(_0x47202a){while(--_0x47202a){_0x5a97a6['push'](_0x5a97a6['shift']());}};_0x1807c6(++_0x434915);}(_0x24cf,0x1d5));var _0xf24c=function(_0x86a650,_0x271d3c){_0x86a650=_0x86a650-0x0;var _0x5d9919=_0x24cf[_0x86a650];return _0x5d9919;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xf24c('0x9')](config['redis'],{'host':_0xf24c('0xa'),'port':0x18eb});var socket=require(_0xf24c('0xb'))(new Redis(config[_0xf24c('0xc')]));require(_0xf24c('0xd'))['register'](socket);function respondWithRpcPromise(_0x4347ba,_0x37193c,_0x260dfd){return new BPromise(function(_0x21a4cc,_0x3bfc0f){return client[_0xf24c('0xe')](_0x4347ba,_0x260dfd)['then'](function(_0x13a62e){logger[_0xf24c('0xf')](_0xf24c('0x10'),_0x37193c,'request\x20sent');logger[_0xf24c('0x11')](_0xf24c('0x12'),_0x37193c,'request\x20sent',JSON['stringify'](_0x13a62e));if(_0x13a62e[_0xf24c('0x13')]){if(_0x13a62e['error'][_0xf24c('0x14')]===0x1f4){logger[_0xf24c('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x37193c,_0x13a62e[_0xf24c('0x13')][_0xf24c('0x15')]);return _0x3bfc0f(_0x13a62e[_0xf24c('0x13')][_0xf24c('0x15')]);}logger[_0xf24c('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x37193c,_0x13a62e['error'][_0xf24c('0x15')]);return _0x21a4cc(_0x13a62e[_0xf24c('0x13')]['message']);}else{logger[_0xf24c('0xf')](_0xf24c('0x10'),_0x37193c,_0xf24c('0x16'));_0x21a4cc(_0x13a62e[_0xf24c('0x17')][_0xf24c('0x15')]);}})[_0xf24c('0x18')](function(_0x36ceba){logger[_0xf24c('0x13')](_0xf24c('0x10'),_0x37193c,_0x36ceba);_0x3bfc0f(_0x36ceba);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 4399c10..e6d9581 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 _0x6d2e=['openchannelAccount:','save','remove','update','register','length'];(function(_0x1abf77,_0x30a758){var _0x6694ae=function(_0x268f92){while(--_0x268f92){_0x1abf77['push'](_0x1abf77['shift']());}};_0x6694ae(++_0x30a758);}(_0x6d2e,0x97));var _0xe6d2=function(_0x1b62b8,_0x3e78d9){_0x1b62b8=_0x1b62b8-0x0;var _0x47a5a0=_0x6d2e[_0x1b62b8];return _0x47a5a0;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xe6d2('0x0'),_0xe6d2('0x1'),_0xe6d2('0x2')];function createListener(_0x3ff4b6,_0x412889){return function(_0xf81df7){_0x412889['emit'](_0x3ff4b6,_0xf81df7);};}function removeListener(_0x2dee74,_0x5dc6e4){return function(){OpenchannelAccountEvents['removeListener'](_0x2dee74,_0x5dc6e4);};}exports[_0xe6d2('0x3')]=function(_0x2b4bf0){for(var _0x3c0fab=0x0,_0x4d9c9f=events[_0xe6d2('0x4')];_0x3c0fab<_0x4d9c9f;_0x3c0fab++){var _0x53906e=events[_0x3c0fab];var _0x2e227e=createListener(_0xe6d2('0x5')+_0x53906e,_0x2b4bf0);OpenchannelAccountEvents['on'](_0x53906e,_0x2e227e);}}; \ No newline at end of file +var _0x9234=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove','update'];(function(_0x494f0b,_0x523ddd){var _0x2e7c55=function(_0x548ea8){while(--_0x548ea8){_0x494f0b['push'](_0x494f0b['shift']());}};_0x2e7c55(++_0x523ddd);}(_0x9234,0x1bd));var _0x4923=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x9234[_0x118afa];return _0x167d76;};'use strict';var OpenchannelAccountEvents=require(_0x4923('0x0'));var events=['save',_0x4923('0x1'),_0x4923('0x2')];function createListener(_0x1f0d3a,_0x34915b){return function(_0x481178){_0x34915b[_0x4923('0x3')](_0x1f0d3a,_0x481178);};}function removeListener(_0x436ce1,_0x4bf615){return function(){OpenchannelAccountEvents[_0x4923('0x4')](_0x436ce1,_0x4bf615);};}exports[_0x4923('0x5')]=function(_0x526ad7){for(var _0x3c5e3f=0x0,_0x17b854=events[_0x4923('0x6')];_0x3c5e3f<_0x17b854;_0x3c5e3f++){var _0x2de396=events[_0x3c5e3f];var _0x548676=createListener(_0x4923('0x7')+_0x2de396,_0x526ad7);OpenchannelAccountEvents['on'](_0x2de396,_0x548676);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index efb4607..5afccdf 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 _0x6fef=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6fef,0x1d8));var _0xf6fe=function(_0x27c337,_0x5b9339){_0x27c337=_0x27c337-0x0;var _0x5b4d1b=_0x6fef[_0x27c337];return _0x5b4d1b;};'use strict';var multer=require(_0xf6fe('0x0'));var util=require(_0xf6fe('0x1'));var path=require(_0xf6fe('0x2'));var timeout=require('connect-timeout');var express=require(_0xf6fe('0x3'));var router=express[_0xf6fe('0x4')]();var fs_extra=require(_0xf6fe('0x5'));var auth=require(_0xf6fe('0x6'));var interaction=require(_0xf6fe('0x7'));var config=require(_0xf6fe('0x8'));var controller=require(_0xf6fe('0x9'));router[_0xf6fe('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6fe('0xa')](_0xf6fe('0xb'),auth[_0xf6fe('0xc')](),controller[_0xf6fe('0xd')]);router[_0xf6fe('0xe')]('/',auth[_0xf6fe('0xc')](),controller[_0xf6fe('0xf')]);router[_0xf6fe('0x10')]('/:id',auth[_0xf6fe('0xc')](),controller[_0xf6fe('0x11')]);router[_0xf6fe('0x12')]('/:id',auth[_0xf6fe('0xc')](),controller[_0xf6fe('0x13')]);module[_0xf6fe('0x14')]=router; \ No newline at end of file +var _0xa574=['get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller'];(function(_0x56056b,_0x555858){var _0xb4f44c=function(_0x46fc2d){while(--_0x46fc2d){_0x56056b['push'](_0x56056b['shift']());}};_0xb4f44c(++_0x555858);}(_0xa574,0x94));var _0x4a57=function(_0x592680,_0x513bfe){_0x592680=_0x592680-0x0;var _0x5974a2=_0xa574[_0x592680];return _0x5974a2;};'use strict';var multer=require(_0x4a57('0x0'));var util=require(_0x4a57('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4a57('0x2'));var interaction=require(_0x4a57('0x3'));var config=require(_0x4a57('0x4'));var controller=require(_0x4a57('0x5'));router[_0x4a57('0x6')]('/',auth[_0x4a57('0x7')](),controller['index']);router[_0x4a57('0x6')](_0x4a57('0x8'),auth[_0x4a57('0x7')](),controller['show']);router[_0x4a57('0x9')]('/',auth[_0x4a57('0x7')](),controller[_0x4a57('0xa')]);router['put'](_0x4a57('0x8'),auth[_0x4a57('0x7')](),controller[_0x4a57('0xb')]);router[_0x4a57('0xc')](_0x4a57('0x8'),auth[_0x4a57('0x7')](),controller[_0x4a57('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 18ec393..196296b 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 _0x313a=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5cef29,_0x1dcd21){var _0x54b53a=function(_0x2f35f4){while(--_0x2f35f4){_0x5cef29['push'](_0x5cef29['shift']());}};_0x54b53a(++_0x1dcd21);}(_0x313a,0xdb));var _0xa313=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x313a[_0x3e69ae];return _0x3d7f42;};'use strict';var Sequelize=require(_0xa313('0x0'));module[_0xa313('0x1')]={'priority':{'type':Sequelize[_0xa313('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa313('0x3')],'allowNull':![],'defaultValue':_0xa313('0x4')},'appdata':{'type':Sequelize[_0xa313('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa313('0x3')],'defaultValue':_0xa313('0x6')}}; \ No newline at end of file +var _0x58a3=['STRING','*,*,*,*','sequelize','exports','TEXT'];(function(_0x2483df,_0x5c06ec){var _0x2618c7=function(_0x34d5f6){while(--_0x34d5f6){_0x2483df['push'](_0x2483df['shift']());}};_0x2618c7(++_0x5c06ec);}(_0x58a3,0x19c));var _0x358a=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0x58a3[_0x5aef17];return _0x43f9d0;};'use strict';var Sequelize=require(_0x358a('0x0'));module[_0x358a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x358a('0x2')]()},'description':{'type':Sequelize[_0x358a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x358a('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 244426d..672c990 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 _0x8fe9=['rows','catch','show','params','include','find','create','body','update','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x279755,_0x42ad77){var _0x138178=function(_0x462033){while(--_0x462033){_0x279755['push'](_0x279755['shift']());}};_0x138178(++_0x42ad77);}(_0x8fe9,0x1d2));var _0x98fe=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x8fe9[_0x71e493];return _0x3d40ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x98fe('0x0'));var jsonpatch=require(_0x98fe('0x1'));var rp=require(_0x98fe('0x2'));var moment=require(_0x98fe('0x3'));var BPromise=require(_0x98fe('0x4'));var Mustache=require(_0x98fe('0x5'));var util=require(_0x98fe('0x6'));var path=require(_0x98fe('0x7'));var sox=require('sox');var csv=require(_0x98fe('0x8'));var ejs=require(_0x98fe('0x9'));var fs=require('fs');var fs_extra=require(_0x98fe('0xa'));var _=require(_0x98fe('0xb'));var squel=require(_0x98fe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x98fe('0xd'));var toCsv=require('to-csv');var querystring=require(_0x98fe('0xe'));var Papa=require(_0x98fe('0xf'));var Redis=require(_0x98fe('0x10'));var authService=require(_0x98fe('0x11'));var qs=require(_0x98fe('0x12'));var as=require(_0x98fe('0x13'));var hardwareService=require(_0x98fe('0x14'));var logger=require('../../config/logger')(_0x98fe('0x15'));var utils=require(_0x98fe('0x16'));var config=require(_0x98fe('0x17'));var licenseUtil=require(_0x98fe('0x18'));var db=require(_0x98fe('0x19'))['db'];function respondWithStatusCode(_0x39d240,_0x4b9c6d){_0x4b9c6d=_0x4b9c6d||0xcc;return function(_0x2d8b40){if(_0x2d8b40){return _0x39d240[_0x98fe('0x1a')](_0x4b9c6d);}return _0x39d240[_0x98fe('0x1b')](_0x4b9c6d)[_0x98fe('0x1c')]();};}function respondWithResult(_0x45d545,_0x3c3dbe){_0x3c3dbe=_0x3c3dbe||0xc8;return function(_0x17b592){if(_0x17b592){return _0x45d545[_0x98fe('0x1b')](_0x3c3dbe)[_0x98fe('0x1d')](_0x17b592);}};}function respondWithFilteredResult(_0x348663,_0x5bfcc8){return function(_0x6e8544){if(_0x6e8544){var _0x1b50c3=typeof _0x5bfcc8[_0x98fe('0x1e')]===_0x98fe('0x1f')&&typeof _0x5bfcc8['limit']==='undefined';var _0x464c9c=_0x6e8544[_0x98fe('0x20')];var _0x208293=_0x1b50c3?0x0:_0x5bfcc8[_0x98fe('0x1e')];var _0x3c994d=_0x1b50c3?_0x6e8544[_0x98fe('0x20')]:_0x5bfcc8['offset']+_0x5bfcc8[_0x98fe('0x21')];var _0x2c362a;if(_0x3c994d>=_0x464c9c){_0x3c994d=_0x464c9c;_0x2c362a=0xc8;}else{_0x2c362a=0xce;}_0x348663[_0x98fe('0x1b')](_0x2c362a);return _0x348663['set'](_0x98fe('0x22'),_0x208293+'-'+_0x3c994d+'/'+_0x464c9c)[_0x98fe('0x1d')](_0x6e8544);}return null;};}function patchUpdates(_0x3db232){return function(_0x471f6c){try{jsonpatch[_0x98fe('0x23')](_0x471f6c,_0x3db232,!![]);}catch(_0x42d7c2){return BPromise['reject'](_0x42d7c2);}return _0x471f6c[_0x98fe('0x24')]();};}function saveUpdates(_0x2471a0,_0x272049){return function(_0x2f308b){if(_0x2f308b){return _0x2f308b['update'](_0x2471a0)[_0x98fe('0x25')](function(_0x5a55ec){return _0x5a55ec;});}return null;};}function removeEntity(_0xaf9c1d,_0x583cc7){return function(_0x50bc93){if(_0x50bc93){return _0x50bc93['destroy']()[_0x98fe('0x25')](function(){_0xaf9c1d[_0x98fe('0x1b')](0xcc)[_0x98fe('0x1c')]();});}};}function handleEntityNotFound(_0x39a9ff,_0x436adc){return function(_0x12eb30){if(!_0x12eb30){_0x39a9ff[_0x98fe('0x1a')](0x194);}return _0x12eb30;};}function handleError(_0x5b9786,_0x3037db){_0x3037db=_0x3037db||0x1f4;return function(_0x4314b2){logger[_0x98fe('0x26')](_0x4314b2[_0x98fe('0x27')]);if(_0x4314b2['name']){delete _0x4314b2[_0x98fe('0x28')];}_0x5b9786[_0x98fe('0x1b')](_0x3037db)[_0x98fe('0x29')](_0x4314b2);};}exports['index']=function(_0x281ca4,_0x213e6b){var _0x3e8656={},_0xd5f749={},_0x279fe3={'count':0x0,'rows':[]};var _0x4979ce=_[_0x98fe('0x2a')](db[_0x98fe('0x2b')][_0x98fe('0x2c')],function(_0x4b262e){return{'name':_0x4b262e[_0x98fe('0x2d')],'type':_0x4b262e[_0x98fe('0x2e')][_0x98fe('0x2f')]};});_0xd5f749[_0x98fe('0x30')]=_['map'](_0x4979ce,'name');_0xd5f749[_0x98fe('0x31')]=_[_0x98fe('0x32')](_0x281ca4[_0x98fe('0x31')]);_0xd5f749[_0x98fe('0x33')]=_[_0x98fe('0x34')](_0xd5f749[_0x98fe('0x30')],_0xd5f749['query']);_0x3e8656[_0x98fe('0x35')]=_[_0x98fe('0x34')](_0xd5f749['model'],qs[_0x98fe('0x36')](_0x281ca4[_0x98fe('0x31')]['fields']));_0x3e8656[_0x98fe('0x35')]=_0x3e8656[_0x98fe('0x35')][_0x98fe('0x37')]?_0x3e8656['attributes']:_0xd5f749[_0x98fe('0x30')];if(!_0x281ca4[_0x98fe('0x31')]['hasOwnProperty'](_0x98fe('0x38'))){_0x3e8656[_0x98fe('0x21')]=qs[_0x98fe('0x21')](_0x281ca4[_0x98fe('0x31')][_0x98fe('0x21')]);_0x3e8656[_0x98fe('0x1e')]=qs['offset'](_0x281ca4['query'][_0x98fe('0x1e')]);}_0x3e8656['order']=qs['sort'](_0x281ca4[_0x98fe('0x31')][_0x98fe('0x39')]);_0x3e8656['where']=qs[_0x98fe('0x33')](_[_0x98fe('0x3a')](_0x281ca4[_0x98fe('0x31')],_0xd5f749[_0x98fe('0x33')]),_0x4979ce);if(_0x281ca4[_0x98fe('0x31')][_0x98fe('0x3b')]){_0x3e8656[_0x98fe('0x3c')]=_[_0x98fe('0x3d')](_0x3e8656[_0x98fe('0x3c')],{'$or':_['map'](_0x4979ce,function(_0x3c7fbc){if(_0x3c7fbc[_0x98fe('0x2e')]!==_0x98fe('0x3e')){var _0x5d9be0={};_0x5d9be0[_0x3c7fbc['name']]={'$like':'%'+_0x281ca4[_0x98fe('0x31')]['filter']+'%'};return _0x5d9be0;}})});}_0x3e8656=_['merge']({},_0x3e8656,_0x281ca4[_0x98fe('0x3f')]);var _0x5b0b98={'where':_0x3e8656[_0x98fe('0x3c')]};return db[_0x98fe('0x2b')][_0x98fe('0x20')](_0x5b0b98)['then'](function(_0x2e17a4){_0x279fe3['count']=_0x2e17a4;if(_0x281ca4[_0x98fe('0x31')][_0x98fe('0x40')]){_0x3e8656['include']=[{'all':!![]}];}return db[_0x98fe('0x2b')][_0x98fe('0x41')](_0x3e8656);})[_0x98fe('0x25')](function(_0x52b57b){_0x279fe3[_0x98fe('0x42')]=_0x52b57b;return _0x279fe3;})[_0x98fe('0x25')](respondWithFilteredResult(_0x213e6b,_0x3e8656))[_0x98fe('0x43')](handleError(_0x213e6b,null));};exports[_0x98fe('0x44')]=function(_0x1121a2,_0x10fd9b){var _0x2bac01={'raw':!![],'where':{'id':_0x1121a2[_0x98fe('0x45')]['id']}},_0x3d98a5={};_0x3d98a5['model']=_[_0x98fe('0x32')](db[_0x98fe('0x2b')]['rawAttributes']);_0x3d98a5[_0x98fe('0x31')]=_[_0x98fe('0x32')](_0x1121a2[_0x98fe('0x31')]);_0x3d98a5[_0x98fe('0x33')]=_['intersection'](_0x3d98a5[_0x98fe('0x30')],_0x3d98a5[_0x98fe('0x31')]);_0x2bac01[_0x98fe('0x35')]=_[_0x98fe('0x34')](_0x3d98a5[_0x98fe('0x30')],qs[_0x98fe('0x36')](_0x1121a2[_0x98fe('0x31')][_0x98fe('0x36')]));_0x2bac01[_0x98fe('0x35')]=_0x2bac01[_0x98fe('0x35')][_0x98fe('0x37')]?_0x2bac01[_0x98fe('0x35')]:_0x3d98a5[_0x98fe('0x30')];if(_0x1121a2[_0x98fe('0x31')][_0x98fe('0x40')]){_0x2bac01[_0x98fe('0x46')]=[{'all':!![]}];}_0x2bac01=_['merge']({},_0x2bac01,_0x1121a2[_0x98fe('0x3f')]);return db['OpenchannelApplication'][_0x98fe('0x47')](_0x2bac01)[_0x98fe('0x25')](handleEntityNotFound(_0x10fd9b,null))[_0x98fe('0x25')](respondWithResult(_0x10fd9b,null))[_0x98fe('0x43')](handleError(_0x10fd9b,null));};exports['create']=function(_0x4cc0e2,_0x1be9fc){return db['OpenchannelApplication'][_0x98fe('0x48')](_0x4cc0e2[_0x98fe('0x49')],{})[_0x98fe('0x25')](respondWithResult(_0x1be9fc,0xc9))[_0x98fe('0x43')](handleError(_0x1be9fc,null));};exports[_0x98fe('0x4a')]=function(_0x2f6dc9,_0x275dc2){if(_0x2f6dc9[_0x98fe('0x49')]['id']){delete _0x2f6dc9[_0x98fe('0x49')]['id'];}return db[_0x98fe('0x2b')][_0x98fe('0x47')]({'where':{'id':_0x2f6dc9[_0x98fe('0x45')]['id']}})['then'](handleEntityNotFound(_0x275dc2,null))[_0x98fe('0x25')](saveUpdates(_0x2f6dc9[_0x98fe('0x49')],null))['then'](respondWithResult(_0x275dc2,null))[_0x98fe('0x43')](handleError(_0x275dc2,null));};exports[_0x98fe('0x4b')]=function(_0x264af0,_0xfc7749){return db[_0x98fe('0x2b')][_0x98fe('0x47')]({'where':{'id':_0x264af0[_0x98fe('0x45')]['id']}})['then'](handleEntityNotFound(_0xfc7749,null))[_0x98fe('0x25')](removeEntity(_0xfc7749,null))['catch'](handleError(_0xfc7749,null));}; \ No newline at end of file +var _0xb088=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelApplication','then','include','findAll','rows','show','includeAll','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy'];(function(_0x355297,_0x439506){var _0x97ec5a=function(_0xf670a1){while(--_0xf670a1){_0x355297['push'](_0x355297['shift']());}};_0x97ec5a(++_0x439506);}(_0xb088,0x78));var _0x8b08=function(_0x316ce5,_0x1db52d){_0x316ce5=_0x316ce5-0x0;var _0x50f98a=_0xb088[_0x316ce5];return _0x50f98a;};'use strict';var emlformat=require(_0x8b08('0x0'));var rimraf=require(_0x8b08('0x1'));var zipdir=require(_0x8b08('0x2'));var jsonpatch=require(_0x8b08('0x3'));var rp=require(_0x8b08('0x4'));var moment=require(_0x8b08('0x5'));var BPromise=require(_0x8b08('0x6'));var Mustache=require(_0x8b08('0x7'));var util=require(_0x8b08('0x8'));var path=require(_0x8b08('0x9'));var sox=require('sox');var csv=require(_0x8b08('0xa'));var ejs=require(_0x8b08('0xb'));var fs=require('fs');var fs_extra=require(_0x8b08('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8b08('0xd'));var jsforce=require(_0x8b08('0xe'));var deskjs=require(_0x8b08('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8b08('0x10'));var Papa=require('papaparse');var Redis=require(_0x8b08('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8b08('0x12'));var hardwareService=require(_0x8b08('0x13'));var logger=require(_0x8b08('0x14'))(_0x8b08('0x15'));var utils=require(_0x8b08('0x16'));var config=require(_0x8b08('0x17'));var licenseUtil=require(_0x8b08('0x18'));var db=require(_0x8b08('0x19'))['db'];function respondWithStatusCode(_0x161d6c,_0x51030c){_0x51030c=_0x51030c||0xcc;return function(_0x59341e){if(_0x59341e){return _0x161d6c[_0x8b08('0x1a')](_0x51030c);}return _0x161d6c[_0x8b08('0x1b')](_0x51030c)[_0x8b08('0x1c')]();};}function respondWithResult(_0x1118c8,_0x5094e3){_0x5094e3=_0x5094e3||0xc8;return function(_0x17a752){if(_0x17a752){return _0x1118c8[_0x8b08('0x1b')](_0x5094e3)['json'](_0x17a752);}};}function respondWithFilteredResult(_0x17ccd5,_0x49a42a){return function(_0x5f3ddf){if(_0x5f3ddf){var _0x4b17f3=typeof _0x49a42a['offset']===_0x8b08('0x1d')&&typeof _0x49a42a[_0x8b08('0x1e')]===_0x8b08('0x1d');var _0x5d9750=_0x5f3ddf[_0x8b08('0x1f')];var _0x1a7b5f=_0x4b17f3?0x0:_0x49a42a[_0x8b08('0x20')];var _0x325d27=_0x4b17f3?_0x5f3ddf[_0x8b08('0x1f')]:_0x49a42a[_0x8b08('0x20')]+_0x49a42a[_0x8b08('0x1e')];var _0x4354cc;if(_0x325d27>=_0x5d9750){_0x325d27=_0x5d9750;_0x4354cc=0xc8;}else{_0x4354cc=0xce;}_0x17ccd5[_0x8b08('0x1b')](_0x4354cc);return _0x17ccd5[_0x8b08('0x21')](_0x8b08('0x22'),_0x1a7b5f+'-'+_0x325d27+'/'+_0x5d9750)[_0x8b08('0x23')](_0x5f3ddf);}return null;};}function patchUpdates(_0x58d96a){return function(_0x251973){try{jsonpatch[_0x8b08('0x24')](_0x251973,_0x58d96a,!![]);}catch(_0x917ecd){return BPromise[_0x8b08('0x25')](_0x917ecd);}return _0x251973[_0x8b08('0x26')]();};}function saveUpdates(_0x20d73b,_0x50edb4){return function(_0x2cde9a){if(_0x2cde9a){return _0x2cde9a['update'](_0x20d73b)['then'](function(_0x37cd2c){return _0x37cd2c;});}return null;};}function removeEntity(_0x320110,_0x3646d9){return function(_0xaf3598){if(_0xaf3598){return _0xaf3598[_0x8b08('0x27')]()['then'](function(){_0x320110['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589d7a,_0x38d190){return function(_0x28617c){if(!_0x28617c){_0x589d7a[_0x8b08('0x1a')](0x194);}return _0x28617c;};}function handleError(_0x3c3fb3,_0x274ae5){_0x274ae5=_0x274ae5||0x1f4;return function(_0x5948e7){logger[_0x8b08('0x28')](_0x5948e7[_0x8b08('0x29')]);if(_0x5948e7[_0x8b08('0x2a')]){delete _0x5948e7['name'];}_0x3c3fb3['status'](_0x274ae5)[_0x8b08('0x2b')](_0x5948e7);};}exports[_0x8b08('0x2c')]=function(_0x209756,_0x183f5e){var _0x14a14e={},_0x42103d={},_0x36bfb1={'count':0x0,'rows':[]};var _0x538290=_[_0x8b08('0x2d')](db['OpenchannelApplication'][_0x8b08('0x2e')],function(_0x7dbc){return{'name':_0x7dbc[_0x8b08('0x2f')],'type':_0x7dbc[_0x8b08('0x30')][_0x8b08('0x31')]};});_0x42103d[_0x8b08('0x32')]=_[_0x8b08('0x2d')](_0x538290,_0x8b08('0x2a'));_0x42103d[_0x8b08('0x33')]=_[_0x8b08('0x34')](_0x209756[_0x8b08('0x33')]);_0x42103d[_0x8b08('0x35')]=_['intersection'](_0x42103d[_0x8b08('0x32')],_0x42103d['query']);_0x14a14e[_0x8b08('0x36')]=_[_0x8b08('0x37')](_0x42103d[_0x8b08('0x32')],qs[_0x8b08('0x38')](_0x209756['query']['fields']));_0x14a14e[_0x8b08('0x36')]=_0x14a14e[_0x8b08('0x36')][_0x8b08('0x39')]?_0x14a14e[_0x8b08('0x36')]:_0x42103d[_0x8b08('0x32')];if(!_0x209756[_0x8b08('0x33')][_0x8b08('0x3a')](_0x8b08('0x3b'))){_0x14a14e[_0x8b08('0x1e')]=qs[_0x8b08('0x1e')](_0x209756[_0x8b08('0x33')][_0x8b08('0x1e')]);_0x14a14e[_0x8b08('0x20')]=qs[_0x8b08('0x20')](_0x209756[_0x8b08('0x33')][_0x8b08('0x20')]);}_0x14a14e['order']=qs[_0x8b08('0x3c')](_0x209756[_0x8b08('0x33')][_0x8b08('0x3c')]);_0x14a14e[_0x8b08('0x3d')]=qs[_0x8b08('0x35')](_[_0x8b08('0x3e')](_0x209756[_0x8b08('0x33')],_0x42103d[_0x8b08('0x35')]),_0x538290);if(_0x209756[_0x8b08('0x33')][_0x8b08('0x3f')]){_0x14a14e[_0x8b08('0x3d')]=_['merge'](_0x14a14e[_0x8b08('0x3d')],{'$or':_['map'](_0x538290,function(_0x34e558){if(_0x34e558[_0x8b08('0x30')]!==_0x8b08('0x40')){var _0x3ee343={};_0x3ee343[_0x34e558[_0x8b08('0x2a')]]={'$like':'%'+_0x209756[_0x8b08('0x33')]['filter']+'%'};return _0x3ee343;}})});}_0x14a14e=_[_0x8b08('0x41')]({},_0x14a14e,_0x209756[_0x8b08('0x42')]);var _0x5433ca={'where':_0x14a14e[_0x8b08('0x3d')]};return db[_0x8b08('0x43')][_0x8b08('0x1f')](_0x5433ca)[_0x8b08('0x44')](function(_0x1f9db1){_0x36bfb1[_0x8b08('0x1f')]=_0x1f9db1;if(_0x209756[_0x8b08('0x33')]['includeAll']){_0x14a14e[_0x8b08('0x45')]=[{'all':!![]}];}return db[_0x8b08('0x43')][_0x8b08('0x46')](_0x14a14e);})['then'](function(_0x23ad1e){_0x36bfb1[_0x8b08('0x47')]=_0x23ad1e;return _0x36bfb1;})[_0x8b08('0x44')](respondWithFilteredResult(_0x183f5e,_0x14a14e))['catch'](handleError(_0x183f5e,null));};exports[_0x8b08('0x48')]=function(_0x10eaf9,_0x6b29bb){var _0x1c3480={'raw':!![],'where':{'id':_0x10eaf9['params']['id']}},_0x5c37c3={};_0x5c37c3[_0x8b08('0x32')]=_[_0x8b08('0x34')](db['OpenchannelApplication'][_0x8b08('0x2e')]);_0x5c37c3[_0x8b08('0x33')]=_[_0x8b08('0x34')](_0x10eaf9['query']);_0x5c37c3[_0x8b08('0x35')]=_[_0x8b08('0x37')](_0x5c37c3[_0x8b08('0x32')],_0x5c37c3['query']);_0x1c3480[_0x8b08('0x36')]=_[_0x8b08('0x37')](_0x5c37c3[_0x8b08('0x32')],qs['fields'](_0x10eaf9[_0x8b08('0x33')][_0x8b08('0x38')]));_0x1c3480[_0x8b08('0x36')]=_0x1c3480[_0x8b08('0x36')]['length']?_0x1c3480['attributes']:_0x5c37c3[_0x8b08('0x32')];if(_0x10eaf9[_0x8b08('0x33')][_0x8b08('0x49')]){_0x1c3480[_0x8b08('0x45')]=[{'all':!![]}];}_0x1c3480=_[_0x8b08('0x41')]({},_0x1c3480,_0x10eaf9[_0x8b08('0x42')]);return db[_0x8b08('0x43')][_0x8b08('0x4a')](_0x1c3480)['then'](handleEntityNotFound(_0x6b29bb,null))[_0x8b08('0x44')](respondWithResult(_0x6b29bb,null))[_0x8b08('0x4b')](handleError(_0x6b29bb,null));};exports[_0x8b08('0x4c')]=function(_0x460030,_0x227f37){return db[_0x8b08('0x43')][_0x8b08('0x4c')](_0x460030[_0x8b08('0x4d')],{})[_0x8b08('0x44')](respondWithResult(_0x227f37,0xc9))[_0x8b08('0x4b')](handleError(_0x227f37,null));};exports[_0x8b08('0x4e')]=function(_0x30e245,_0x2953de){if(_0x30e245[_0x8b08('0x4d')]['id']){delete _0x30e245['body']['id'];}return db[_0x8b08('0x43')][_0x8b08('0x4a')]({'where':{'id':_0x30e245[_0x8b08('0x4f')]['id']}})[_0x8b08('0x44')](handleEntityNotFound(_0x2953de,null))[_0x8b08('0x44')](saveUpdates(_0x30e245['body'],null))[_0x8b08('0x44')](respondWithResult(_0x2953de,null))[_0x8b08('0x4b')](handleError(_0x2953de,null));};exports[_0x8b08('0x27')]=function(_0x50b175,_0x1e8b7a){return db[_0x8b08('0x43')][_0x8b08('0x4a')]({'where':{'id':_0x50b175['params']['id']}})[_0x8b08('0x44')](handleEntityNotFound(_0x1e8b7a,null))['then'](removeEntity(_0x1e8b7a,null))[_0x8b08('0x4b')](handleError(_0x1e8b7a,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 346bc9b..9f16755 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 _0x8464=['bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x85ebd8,_0x598e8c){var _0x1f3349=function(_0x7d967d){while(--_0x7d967d){_0x85ebd8['push'](_0x85ebd8['shift']());}};_0x1f3349(++_0x598e8c);}(_0x8464,0x193));var _0x4846=function(_0x1414f9,_0x37244c){_0x1414f9=_0x1414f9-0x0;var _0x33f351=_0x8464[_0x1414f9];return _0x33f351;};'use strict';var _=require(_0x4846('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4846('0x1'));var moment=require(_0x4846('0x2'));var BPromise=require(_0x4846('0x3'));var rp=require(_0x4846('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4846('0x5'));var config=require(_0x4846('0x6'));var attributes=require(_0x4846('0x7'));module[_0x4846('0x8')]=function(_0x3af2e9,_0x4d4844){return _0x3af2e9[_0x4846('0x9')](_0x4846('0xa'),attributes,{'tableName':_0x4846('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4846('0xc'),'collate':_0x4846('0xd')});}; \ No newline at end of file +var _0xac08=['util','../../config/logger','bluebird','rimraf','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x149016,_0x374450){var _0x326a70=function(_0x5ed00a){while(--_0x5ed00a){_0x149016['push'](_0x149016['shift']());}};_0x326a70(++_0x374450);}(_0xac08,0xe6));var _0x8ac0=function(_0x4cb60b,_0x390d9f){_0x4cb60b=_0x4cb60b-0x0;var _0x564ce6=_0xac08[_0x4cb60b];return _0x564ce6;};'use strict';var _=require(_0x8ac0('0x0'));var util=require(_0x8ac0('0x1'));var logger=require(_0x8ac0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8ac0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8ac0('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x8ac0('0x5')]=function(_0x27c3cd,_0x554ebf){return _0x27c3cd[_0x8ac0('0x6')](_0x8ac0('0x7'),attributes,{'tableName':_0x8ac0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ac0('0x9'),'collate':_0x8ac0('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 53ae612..9931fc8 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 _0xbc97=['OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xbc97,0xf2));var _0x7bc9=function(_0x3d94da,_0x471ea8){_0x3d94da=_0x3d94da-0x0;var _0x164dd5=_0xbc97[_0x3d94da];return _0x164dd5;};'use strict';var _=require(_0x7bc9('0x0'));var util=require('util');var moment=require(_0x7bc9('0x1'));var BPromise=require(_0x7bc9('0x2'));var rs=require(_0x7bc9('0x3'));var fs=require('fs');var Redis=require(_0x7bc9('0x4'));var db=require(_0x7bc9('0x5'))['db'];var utils=require(_0x7bc9('0x6'));var logger=require('../../config/logger')(_0x7bc9('0x7'));var config=require(_0x7bc9('0x8'));var jayson=require(_0x7bc9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc168,_0x46dd71,_0x428005){return new BPromise(function(_0x2af599,_0x5c7ce6){return client[_0x7bc9('0xa')](_0x3cc168,_0x428005)[_0x7bc9('0xb')](function(_0x309efb){logger[_0x7bc9('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x46dd71,_0x7bc9('0xd'));logger[_0x7bc9('0xe')](_0x7bc9('0xf'),_0x46dd71,_0x7bc9('0xd'),JSON[_0x7bc9('0x10')](_0x309efb));if(_0x309efb[_0x7bc9('0x11')]){if(_0x309efb[_0x7bc9('0x11')][_0x7bc9('0x12')]===0x1f4){logger[_0x7bc9('0x11')](_0x7bc9('0x13'),_0x46dd71,_0x309efb[_0x7bc9('0x11')][_0x7bc9('0x14')]);return _0x5c7ce6(_0x309efb[_0x7bc9('0x11')][_0x7bc9('0x14')]);}logger[_0x7bc9('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x46dd71,_0x309efb[_0x7bc9('0x11')]['message']);return _0x2af599(_0x309efb[_0x7bc9('0x11')][_0x7bc9('0x14')]);}else{logger['info'](_0x7bc9('0x13'),_0x46dd71,'request\x20sent');_0x2af599(_0x309efb[_0x7bc9('0x15')][_0x7bc9('0x14')]);}})['catch'](function(_0x399da4){logger[_0x7bc9('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x46dd71,_0x399da4);_0x5c7ce6(_0x399da4);});});}exports[_0x7bc9('0x16')]=function(_0x1b3015){var _0x5d803b=this;return new Promise(function(_0x32ca14,_0x6f5853){return db[_0x7bc9('0x17')]['update'](_0x1b3015[_0x7bc9('0x18')],{'raw':_0x1b3015[_0x7bc9('0x19')]?_0x1b3015['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3015['options']?_0x1b3015[_0x7bc9('0x19')]['where']||null:null,'attributes':_0x1b3015['options']?_0x1b3015[_0x7bc9('0x19')][_0x7bc9('0x1a')]||null:null,'limit':_0x1b3015['options']?_0x1b3015['options'][_0x7bc9('0x1b')]||null:null})['then'](function(_0xfc9d1f){logger[_0x7bc9('0xc')](_0x7bc9('0x16'),_0x1b3015);logger[_0x7bc9('0xe')]('UpdateOpenchannelApplication',_0x1b3015,JSON[_0x7bc9('0x10')](_0xfc9d1f));_0x32ca14(_0xfc9d1f);})[_0x7bc9('0x1c')](function(_0x2d440b){logger[_0x7bc9('0x11')](_0x7bc9('0x16'),_0x2d440b[_0x7bc9('0x14')],_0x1b3015);_0x6f5853(_0x5d803b[_0x7bc9('0x11')](0x1f4,_0x2d440b['message']));});});}; \ No newline at end of file +var _0x1103=['error','code','message','result','catch','UpdateOpenchannelApplication','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x28a062,_0x1d783e){var _0x9bfb9b=function(_0x329427){while(--_0x329427){_0x28a062['push'](_0x28a062['shift']());}};_0x9bfb9b(++_0x1d783e);}(_0x1103,0x184));var _0x3110=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1103[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3110('0x0'));var util=require(_0x3110('0x1'));var moment=require(_0x3110('0x2'));var BPromise=require(_0x3110('0x3'));var rs=require(_0x3110('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3110('0x5'));var logger=require(_0x3110('0x6'))(_0x3110('0x7'));var config=require(_0x3110('0x8'));var jayson=require(_0x3110('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6326,_0x6949b1,_0x39d534){return new BPromise(function(_0x222ce3,_0xb69724){return client[_0x3110('0xa')](_0x5c6326,_0x39d534)[_0x3110('0xb')](function(_0x3aa8a5){logger[_0x3110('0xc')](_0x3110('0xd'),_0x6949b1,_0x3110('0xe'));logger[_0x3110('0xf')](_0x3110('0x10'),_0x6949b1,_0x3110('0xe'),JSON[_0x3110('0x11')](_0x3aa8a5));if(_0x3aa8a5[_0x3110('0x12')]){if(_0x3aa8a5['error'][_0x3110('0x13')]===0x1f4){logger['error'](_0x3110('0xd'),_0x6949b1,_0x3aa8a5[_0x3110('0x12')]['message']);return _0xb69724(_0x3aa8a5[_0x3110('0x12')][_0x3110('0x14')]);}logger['error'](_0x3110('0xd'),_0x6949b1,_0x3aa8a5[_0x3110('0x12')][_0x3110('0x14')]);return _0x222ce3(_0x3aa8a5['error']['message']);}else{logger['info'](_0x3110('0xd'),_0x6949b1,_0x3110('0xe'));_0x222ce3(_0x3aa8a5[_0x3110('0x15')]['message']);}})[_0x3110('0x16')](function(_0x4078c0){logger[_0x3110('0x12')](_0x3110('0xd'),_0x6949b1,_0x4078c0);_0xb69724(_0x4078c0);});});}exports[_0x3110('0x17')]=function(_0x22e534){var _0x3f6e58=this;return new Promise(function(_0x3f87c1,_0xd798fe){return db['OpenchannelApplication']['update'](_0x22e534['body'],{'raw':_0x22e534[_0x3110('0x18')]?_0x22e534['options'][_0x3110('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22e534['options']?_0x22e534[_0x3110('0x18')][_0x3110('0x1a')]||null:null,'attributes':_0x22e534[_0x3110('0x18')]?_0x22e534[_0x3110('0x18')][_0x3110('0x1b')]||null:null,'limit':_0x22e534[_0x3110('0x18')]?_0x22e534[_0x3110('0x18')][_0x3110('0x1c')]||null:null})[_0x3110('0xb')](function(_0x48f485){logger[_0x3110('0xc')](_0x3110('0x17'),_0x22e534);logger['debug']('UpdateOpenchannelApplication',_0x22e534,JSON[_0x3110('0x11')](_0x48f485));_0x3f87c1(_0x48f485);})['catch'](function(_0x19d1d4){logger['error'](_0x3110('0x17'),_0x19d1d4[_0x3110('0x14')],_0x22e534);_0xd798fe(_0x3f6e58[_0x3110('0x12')](0x1f4,_0x19d1d4[_0x3110('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c2d5f0e..43ef222 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 _0x3e29=['addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','post','/:id/tags','tracked','openchannel'];(function(_0x5d649f,_0x1022f3){var _0x17e0fa=function(_0x1d7a6b){while(--_0x1d7a6b){_0x5d649f['push'](_0x5d649f['shift']());}};_0x17e0fa(++_0x1022f3);}(_0x3e29,0xef));var _0x93e2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3e29[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x93e2('0x0'));var util=require(_0x93e2('0x1'));var path=require(_0x93e2('0x2'));var timeout=require(_0x93e2('0x3'));var express=require('express');var router=express[_0x93e2('0x4')]();var fs_extra=require(_0x93e2('0x5'));var auth=require(_0x93e2('0x6'));var interaction=require(_0x93e2('0x7'));var config=require(_0x93e2('0x8'));var controller=require(_0x93e2('0x9'));router[_0x93e2('0xa')]('/',auth[_0x93e2('0xb')](),controller[_0x93e2('0xc')]);router['get'](_0x93e2('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x93e2('0xe'),auth[_0x93e2('0xb')](),controller[_0x93e2('0xf')]);router[_0x93e2('0xa')](_0x93e2('0x10'),auth['isAuthenticated'](),controller[_0x93e2('0x11')]);router['get']('/:id/download',auth[_0x93e2('0xb')](),controller['download']);router[_0x93e2('0x12')]('/',auth[_0x93e2('0xb')](),controller['create']);router[_0x93e2('0x12')](_0x93e2('0x10'),auth[_0x93e2('0xb')](),controller['addMessage']);router[_0x93e2('0x12')](_0x93e2('0x13'),auth[_0x93e2('0xb')](),interaction[_0x93e2('0x14')](_0x93e2('0x15'),'openchannelinteraction:addtags'),controller[_0x93e2('0x16')]);router['put']('/:id',auth[_0x93e2('0xb')](),interaction[_0x93e2('0x14')](_0x93e2('0x15'),_0x93e2('0x17')),controller[_0x93e2('0x18')]);router[_0x93e2('0x19')](_0x93e2('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x93e2('0x15'),_0x93e2('0x1a')),controller[_0x93e2('0x1b')]);router[_0x93e2('0x19')](_0x93e2('0x13'),auth[_0x93e2('0xb')](),controller[_0x93e2('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0709=['describe','/:id','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','multer','connect-timeout','fs-extra','./openchannelInteraction.controller','get','isAuthenticated','index'];(function(_0x46be92,_0x3a772b){var _0x459798=function(_0x573ff2){while(--_0x573ff2){_0x46be92['push'](_0x46be92['shift']());}};_0x459798(++_0x3a772b);}(_0x0709,0x1d4));var _0x9070=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x0709[_0x2d9e27];return _0xd35381;};'use strict';var multer=require(_0x9070('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9070('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9070('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9070('0x3'));router[_0x9070('0x4')]('/',auth[_0x9070('0x5')](),controller[_0x9070('0x6')]);router['get']('/describe',auth[_0x9070('0x5')](),controller[_0x9070('0x7')]);router[_0x9070('0x4')](_0x9070('0x8'),auth[_0x9070('0x5')](),controller['show']);router[_0x9070('0x4')](_0x9070('0x9'),auth[_0x9070('0x5')](),controller['getMessages']);router[_0x9070('0x4')](_0x9070('0xa'),auth[_0x9070('0x5')](),controller[_0x9070('0xb')]);router[_0x9070('0xc')]('/',auth[_0x9070('0x5')](),controller['create']);router[_0x9070('0xc')](_0x9070('0x9'),auth['isAuthenticated'](),controller[_0x9070('0xd')]);router[_0x9070('0xc')](_0x9070('0xe'),auth['isAuthenticated'](),interaction[_0x9070('0xf')]('openchannel',_0x9070('0x10')),controller[_0x9070('0x11')]);router[_0x9070('0x12')]('/:id',auth[_0x9070('0x5')](),interaction['tracked'](_0x9070('0x13'),_0x9070('0x14')),controller[_0x9070('0x15')]);router[_0x9070('0x16')](_0x9070('0x8'),auth[_0x9070('0x5')](),interaction['tracked']('openchannel',_0x9070('0x17')),controller['destroy']);router[_0x9070('0x16')]('/:id/tags',auth[_0x9070('0x5')](),controller[_0x9070('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index afda32f..47b623b 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 _0x6666=['out','BOOLEAN','sequelize','STRING','DATE','ENUM'];(function(_0x258df0,_0x31ce33){var _0x2a96fe=function(_0x2a93cf){while(--_0x2a93cf){_0x258df0['push'](_0x258df0['shift']());}};_0x2a96fe(++_0x31ce33);}(_0x6666,0x6e));var _0x6666=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x6666[_0x11f5ff];return _0x46eefb;};'use strict';var Sequelize=require(_0x6666('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6666('0x1')]},'thirdDisposition':{'type':Sequelize[_0x6666('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6666('0x1')]},'externalUrl':{'type':Sequelize[_0x6666('0x1')]},'lastMsgAt':{'type':Sequelize[_0x6666('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6666('0x3')]('in',_0x6666('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6666('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0x6666('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x279d=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x279d,0x1d8));var _0xd279=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x279d[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0xd279('0x0'));module[_0xd279('0x1')]={'closed':{'type':Sequelize[_0xd279('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd279('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd279('0x4')]},'note':{'type':Sequelize[_0xd279('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xd279('0x4')]},'externalUrl':{'type':Sequelize[_0xd279('0x4')]},'lastMsgAt':{'type':Sequelize[_0xd279('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd279('0x5')]('in',_0xd279('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd279('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xd279('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 a12e966..7a4c2a9 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 _0x6157=['i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','include','describe','addMessage','OpenchannelMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','omit','spread','emit','removeTags','download','unix','join','tmp','CmContact','attachments','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','Public','Private','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','root','server','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','update','destroy','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','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)','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','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END'];(function(_0x4568bc,_0x2b18fe){var _0x44f3db=function(_0x202b0c){while(--_0x202b0c){_0x4568bc['push'](_0x4568bc['shift']());}};_0x44f3db(++_0x2b18fe);}(_0x6157,0x13b));var _0x7615=function(_0x41e4ae,_0x484992){_0x41e4ae=_0x41e4ae-0x0;var _0x252671=_0x6157[_0x41e4ae];return _0x252671;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7615('0x0'));var zipdir=require(_0x7615('0x1'));var jsonpatch=require(_0x7615('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7615('0x3'));var Mustache=require(_0x7615('0x4'));var util=require('util');var path=require(_0x7615('0x5'));var sox=require(_0x7615('0x6'));var csv=require(_0x7615('0x7'));var ejs=require(_0x7615('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7615('0x9'));var squel=require('squel');var crypto=require(_0x7615('0xa'));var jsforce=require(_0x7615('0xb'));var deskjs=require(_0x7615('0xc'));var toCsv=require(_0x7615('0x7'));var querystring=require(_0x7615('0xd'));var Papa=require('papaparse');var Redis=require(_0x7615('0xe'));var authService=require(_0x7615('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7615('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x7615('0x11'));var logger=require(_0x7615('0x12'))('api');var utils=require(_0x7615('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7615('0x14'));var db=require(_0x7615('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7615('0x16'),'port':0x18eb});var socket=require(_0x7615('0x17'))(new Redis(config[_0x7615('0x18')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4a55c7,_0x185e28){_0x185e28=_0x185e28||0xcc;return function(_0x543d5c){if(_0x543d5c){return _0x4a55c7[_0x7615('0x19')](_0x185e28);}return _0x4a55c7[_0x7615('0x1a')](_0x185e28)['end']();};}function respondWithResult(_0x411ef7,_0x4e4422){_0x4e4422=_0x4e4422||0xc8;return function(_0x135ca7){if(_0x135ca7){return _0x411ef7[_0x7615('0x1a')](_0x4e4422)[_0x7615('0x1b')](_0x135ca7);}};}function respondWithFilteredResult(_0x35e544,_0x218d79){return function(_0xb4f471){if(_0xb4f471){var _0x527de9=typeof _0x218d79['offset']===_0x7615('0x1c')&&typeof _0x218d79[_0x7615('0x1d')]===_0x7615('0x1c');var _0x1dd95c=_0xb4f471[_0x7615('0x1e')];var _0x34162e=_0x527de9?0x0:_0x218d79[_0x7615('0x1f')];var _0x932511=_0x527de9?_0xb4f471['count']:_0x218d79['offset']+_0x218d79[_0x7615('0x1d')];var _0x106dc0;if(_0x932511>=_0x1dd95c){_0x932511=_0x1dd95c;_0x106dc0=0xc8;}else{_0x106dc0=0xce;}_0x35e544[_0x7615('0x1a')](_0x106dc0);return _0x35e544[_0x7615('0x20')]('Content-Range',_0x34162e+'-'+_0x932511+'/'+_0x1dd95c)[_0x7615('0x1b')](_0xb4f471);}return null;};}function patchUpdates(_0x17ebf2){return function(_0xb5f8ec){try{jsonpatch[_0x7615('0x21')](_0xb5f8ec,_0x17ebf2,!![]);}catch(_0x4d88aa){return BPromise['reject'](_0x4d88aa);}return _0xb5f8ec[_0x7615('0x22')]();};}function saveUpdates(_0xcde1ee,_0x359aef){return function(_0x2a01bd){if(_0x2a01bd){return _0x2a01bd[_0x7615('0x23')](_0xcde1ee)['then'](function(_0x4a72dc){return _0x4a72dc;});}return null;};}function removeEntity(_0xc1cf,_0x58b010){return function(_0x533090){if(_0x533090){return _0x533090[_0x7615('0x24')]()[_0x7615('0x25')](function(){_0xc1cf[_0x7615('0x1a')](0xcc)[_0x7615('0x26')]();});}};}function handleEntityNotFound(_0x152262,_0x408b9e){return function(_0x4a0831){if(!_0x4a0831){_0x152262[_0x7615('0x19')](0x194);}return _0x4a0831;};}function handleError(_0x13cd5c,_0x1e5f88){_0x1e5f88=_0x1e5f88||0x1f4;return function(_0x36aa24){logger[_0x7615('0x27')](_0x36aa24[_0x7615('0x28')]);if(_0x36aa24[_0x7615('0x29')]){delete _0x36aa24[_0x7615('0x29')];}_0x13cd5c[_0x7615('0x1a')](_0x1e5f88)[_0x7615('0x2a')](_0x36aa24);};}function getInteractionUsers(_0x3a8845,_0x937662){return new BPromise(function(_0x5d6b6c,_0xaac51c){try{if(_0x937662[_0x3a8845['id']]){_0x3a8845[_0x7615('0x2b')]=_[_0x7615('0x2c')](_0x937662[_0x3a8845['id']],function(_0x2eef6d){return{'id':_0x2eef6d['id'],'fullname':_0x2eef6d[_0x7615('0x2d')]};});}}catch(_0x4bfe7f){_0xaac51c(_0x4bfe7f);}_0x5d6b6c(_0x3a8845);});}function getInteractionTags(_0x5409e1,_0x53763e){return new BPromise(function(_0x1840d7,_0x39896c){try{if(_0x5409e1[_0x7615('0x2e')]){_0x5409e1[_0x7615('0x2f')]=[];_0x5409e1[_0x7615('0x2e')][_0x7615('0x30')](',')[_0x7615('0x31')](function(_0x358fce){_0x5409e1[_0x7615('0x2f')][_0x7615('0x32')](_0x53763e[_0x358fce]);});}delete _0x5409e1[_0x7615('0x2e')];}catch(_0xb7e0f4){_0x39896c(_0xb7e0f4);}_0x1840d7(_0x5409e1);});}function updateOpenchannelInteraction(_0x22adea,_0x1801ec,_0x12dc9b){return new BPromise(function(_0x39ec37,_0x24f6c3){return getInteractionUsers(_0x22adea,_0x12dc9b)[_0x7615('0x25')](function(_0x7ba5e3){return getInteractionTags(_0x7ba5e3,_0x1801ec);})[_0x7615('0x25')](function(_0x3ad069){_0x39ec37(_0x3ad069);})[_0x7615('0x33')](function(_0x2667b1){_0x24f6c3(_0x2667b1);});});}exports['index']=function(_0x44e4da,_0x5b66a1){var _0x1083b6={},_0x5b3554={},_0x27fa0c={'count':0x0,'rows':[]};var _0x424690=_[_0x7615('0x2c')](db[_0x7615('0x34')][_0x7615('0x35')],function(_0xc6684e){return{'name':_0xc6684e[_0x7615('0x36')],'type':_0xc6684e[_0x7615('0x37')][_0x7615('0x38')]};});_0x5b3554[_0x7615('0x39')]=_[_0x7615('0x2c')](_0x424690,_0x7615('0x29'));_0x5b3554[_0x7615('0x3a')]=_[_0x7615('0x3b')](_0x44e4da[_0x7615('0x3a')]);_0x5b3554[_0x7615('0x3c')]=_[_0x7615('0x3d')](_0x5b3554['model'],_0x5b3554[_0x7615('0x3a')]);_0x1083b6['attributes']=_['intersection'](_0x5b3554['model'],qs[_0x7615('0x3e')](_0x44e4da[_0x7615('0x3a')]['fields']));_0x1083b6[_0x7615('0x3f')]=_0x1083b6[_0x7615('0x3f')][_0x7615('0x40')]?_0x1083b6['attributes']:_0x5b3554['model'];if(!_0x44e4da['query'][_0x7615('0x41')](_0x7615('0x42'))){_0x1083b6[_0x7615('0x1d')]=qs['limit'](_0x44e4da['query'][_0x7615('0x1d')]);_0x1083b6[_0x7615('0x1f')]=qs['offset'](_0x44e4da[_0x7615('0x3a')][_0x7615('0x1f')]);}_0x1083b6['order']=qs[_0x7615('0x43')](_0x44e4da[_0x7615('0x3a')][_0x7615('0x43')]);_0x1083b6[_0x7615('0x44')]=qs[_0x7615('0x3c')](_[_0x7615('0x45')](_0x44e4da['query'],_0x5b3554[_0x7615('0x3c')]),_0x424690);var _0x518b26=[];var _0x565e18=squel[_0x7615('0x46')]()['field']('id')[_0x7615('0x47')](_0x7615('0x29'))[_0x7615('0x47')](_0x7615('0x48'))[_0x7615('0x49')]('tools_tags');var _0x422bc9=squel[_0x7615('0x46')]()[_0x7615('0x47')](_0x7615('0x4a'))['field']('u.fullname')[_0x7615('0x47')](_0x7615('0x4b'))['from'](_0x7615('0x4c'),'ui')[_0x7615('0x4d')](_0x7615('0x4e'),'u',_0x7615('0x4f'));var _0x40b51e=squel[_0x7615('0x46')]()[_0x7615('0x49')](_0x7615('0x50'),'i')[_0x7615('0x4d')]('cm_contacts','c',_0x7615('0x51'))[_0x7615('0x4d')](_0x7615('0x4e'),'o',_0x7615('0x52'))[_0x7615('0x4d')](_0x7615('0x53'),'a',_0x7615('0x54'))[_0x7615('0x4d')](_0x7615('0x55'),'me',_0x7615('0x56'))['left_join'](_0x7615('0x57'),'it',_0x7615('0x58'))[_0x7615('0x4d')](_0x7615('0x59'),'t',_0x7615('0x5a'));var _0x4a011c=squel[_0x7615('0x5b')]();var _0x3b13a0=[];var _0x4c4232=squel[_0x7615('0x5b')]();var _0x3385ed;if(_0x44e4da['query']['search']){_0x3385ed=as['parseSearch'](_0x44e4da['query'][_0x7615('0x5c')]);var _0x144493=_0x3385ed[_0x7615('0x5d')];for(var _0x7296ad=0x0;_0x7296ad<_0x3385ed[_0x7615('0x5e')][_0x7615('0x40')];_0x7296ad++){var _0x19d4b1=_0x3385ed[_0x7615('0x5e')][_0x7296ad];var _0x100698='i';var _0x463d2b=_[_0x7615('0x5f')](_0x424690,[_0x7615('0x29'),_0x19d4b1[_0x7615('0x47')]]);if(!_0x463d2b){switch(_0x19d4b1[_0x7615('0x47')]){case _0x7615('0x60'):if(_0x19d4b1[_0x7615('0x61')]==0x1){_0x40b51e[_0x7615('0x62')]('`'+_0x19d4b1[_0x7615('0x47')]+_0x7615('0x63'));}else{_0x40b51e[_0x7615('0x62')]('`'+_0x19d4b1[_0x7615('0x47')]+'`\x20>\x200');}break;case _0x7615('0x64'):if(_0x19d4b1['operator']===_0x7615('0x65')){if(_0x19d4b1[_0x7615('0x61')]['split']('\x20')[_0x7615('0x40')]>0x1){_0x4a011c[_0x144493](_0x7615('0x66'),qs[_0x7615('0x67')](_0x19d4b1[_0x7615('0x61')]),null);}else{var _0x388560='%'+_0x19d4b1[_0x7615('0x61')]+'%';_0x4a011c[_0x144493](_0x7615('0x68'),_0x388560,_0x388560,_0x388560);}}else{_0x463d2b=_['find'](_0x424690,[_0x7615('0x29'),_0x7615('0x69')]);_0x19d4b1[_0x7615('0x47')]=_0x7615('0x69');_0x1caa4d=as[_0x7615('0x6a')](_0x100698,_0x463d2b['type'],_0x19d4b1);_0x4a011c[_0x144493](_0x1caa4d[_0x7615('0x6b')],_0x1caa4d['value'][_0x7615('0x6c')],_0x1caa4d['value']['end']);}break;case _0x7615('0x6d'):var _0x3b4b36=_0x19d4b1['value'][_0x7615('0x30')](',')[_0x7615('0x2c')](function(_0xeb15b5){return Number(_0xeb15b5);});_0x3b4b36[_0x7615('0x31')](function(_0x58d3eb){_0x4c4232['or'](_0x7615('0x6e'),'%,'+_0x58d3eb+',%');});_0x3b13a0=_[_0x7615('0x6f')](_0x3b13a0,_0x3b4b36);break;case _0x7615('0x70'):if(_0x19d4b1[_0x7615('0x71')]===_0x7615('0x65')){_0x4a011c[_0x144493](_0x7615('0x72'),'%'+_0x19d4b1[_0x7615('0x61')]+'%',null);}else{_0x463d2b=_[_0x7615('0x5f')](_0x424690,['name',_0x7615('0x73')]);_0x19d4b1[_0x7615('0x47')]=_0x7615('0x73');_0x1caa4d=as[_0x7615('0x6a')](_0x100698,_0x463d2b['type'],_0x19d4b1);_0x4a011c[_0x144493](_0x1caa4d[_0x7615('0x6b')],_0x1caa4d[_0x7615('0x61')][_0x7615('0x6c')],_0x1caa4d[_0x7615('0x61')][_0x7615('0x26')]);}break;case _0x7615('0x74'):_0x1caa4d=as[_0x7615('0x6a')]('me',null,_0x19d4b1);_0x4a011c[_0x144493](_0x1caa4d[_0x7615('0x6b')],_0x1caa4d[_0x7615('0x61')]['start'],_0x1caa4d[_0x7615('0x61')][_0x7615('0x26')]);break;}}else{var _0x1caa4d=as[_0x7615('0x6a')](_0x100698,_0x463d2b[_0x7615('0x37')],_0x19d4b1);_0x4a011c[_0x144493](_0x1caa4d[_0x7615('0x6b')],_0x1caa4d[_0x7615('0x61')][_0x7615('0x6c')],_0x1caa4d[_0x7615('0x61')]['end']);}}}else{var _0xb6755c=_(_0x44e4da[_0x7615('0x3a')])['keys']()[_0x7615('0x2c')](function(_0x10500b){return _['some'](_0x424690,['name',_0x10500b])?_0x10500b:undefined;})[_0x7615('0x75')]()[_0x7615('0x61')]();if(!_[_0x7615('0x76')](_0xb6755c)){_0xb6755c[_0x7615('0x31')](function(_0x978eb3){if(_0x978eb3===_0x7615('0x77')){_0x40b51e[_0x7615('0x44')](_0x7615('0x78'),[][_0x7615('0x79')](_0x44e4da[_0x7615('0x3a')][_0x978eb3]));}else if(_0x978eb3==='createdAt'){var _0x509903=JSON[_0x7615('0x7a')](_0x44e4da['query'][_0x978eb3])[_0x7615('0x7b')];var _0x58fd32=JSON[_0x7615('0x7a')](_0x44e4da[_0x7615('0x3a')][_0x978eb3])['$lte'];_0x40b51e['where'](_0x7615('0x7c'),_0x509903,_0x58fd32);}else{if(_0x44e4da[_0x7615('0x3a')][_0x978eb3]==='null'){_0x40b51e[_0x7615('0x44')]('i.'+_0x978eb3+_0x7615('0x7d'));}else{_0x40b51e[_0x7615('0x44')]('i.'+_0x978eb3+_0x7615('0x7e'),_0x44e4da[_0x7615('0x3a')][_0x978eb3]);}}});}if(_0x44e4da[_0x7615('0x3a')][_0x7615('0x7f')]){if(_0x44e4da[_0x7615('0x3a')][_0x7615('0x7f')]==0x1){_0x40b51e['having'](_0x7615('0x80'));}else{_0x40b51e[_0x7615('0x62')](_0x7615('0x81'));}}if(_0x44e4da[_0x7615('0x3a')][_0x7615('0x82')]){_0x3b13a0=_[_0x7615('0x83')](_0x44e4da[_0x7615('0x3a')][_0x7615('0x82')])?_0x44e4da[_0x7615('0x3a')][_0x7615('0x82')]:new Array(_0x44e4da[_0x7615('0x3a')][_0x7615('0x82')]);_0x3b13a0[_0x7615('0x31')](function(_0x304eb9){_0x4c4232['or'](_0x7615('0x6e'),'%,'+_0x304eb9+',%');});}if(_0x44e4da['query'][_0x7615('0x84')]){var _0x4c4945=_0x44e4da[_0x7615('0x3a')][_0x7615('0x84')][_0x7615('0x85')]('\x5c','\x5c\x5c')[_0x7615('0x85')](/'/g,'\x27\x27');if(qs[_0x7615('0x86')](_0x4c4945)){_0x4a011c['or'](_0x7615('0x87'),_0x4c4945+'%');}else{_0x4a011c['or'](_0x7615('0x88'),qs[_0x7615('0x67')](_0x4c4945))['or'](_0x7615('0x89'),_0x4c4945+'%')['or'](_0x7615('0x8a'),_0x4c4945+'%');}}}_0x40b51e[_0x7615('0x44')](_0x4a011c);_0x40b51e['group'](_0x7615('0x8b'));var _0x35c065={'type':db[_0x7615('0x8c')][_0x7615('0x8d')][_0x7615('0x8e')],'raw':!![]};var _0x440e8a=_0x40b51e[_0x7615('0x8f')]();_0x440e8a['field'](_0x7615('0x8b'));_0x440e8a[_0x7615('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1083b6[_0x7615('0x90')]){_0x1083b6[_0x7615('0x90')][_0x7615('0x31')](function(_0x4a23c4){var _0x59f146=_0x4a23c4[0x0]==='contactName'?_0x4a23c4[0x0]:'i.'+_0x4a23c4[0x0];_0x40b51e[_0x7615('0x90')](_0x59f146,_0x4a23c4[0x1]===_0x7615('0x91')?![]:!![]);});}if(!_[_0x7615('0x76')](_0x3b13a0)){_0x40b51e[_0x7615('0x62')](_0x4c4232);_0x440e8a['where']('t.id\x20IN\x20?',_0x3b13a0);}BPromise[_0x7615('0x92')]()[_0x7615('0x25')](function(){if(!_0x3385ed){if(_0x44e4da[_0x7615('0x3a')]['OpenchannelAccountId'])return;_0x440e8a['where'](_0x7615('0x93'));_0x40b51e['where'](_0x7615('0x93'));return;}if(_0x44e4da[_0x7615('0x94')][_0x7615('0x95')]!==_0x7615('0x96'))return;return _0x44e4da[_0x7615('0x94')][_0x7615('0x97')]({'attributes':['id'],'raw':!![]})[_0x7615('0x25')](function(_0x5941b4){if(_[_0x7615('0x76')](_0x5941b4)){_0x440e8a[_0x7615('0x44')](_0x7615('0x98'));_0x40b51e[_0x7615('0x44')](_0x7615('0x98'));}else{_0x440e8a['where'](_0x7615('0x78'),_[_0x7615('0x2c')](_0x5941b4,'id'));_0x40b51e[_0x7615('0x44')](_0x7615('0x78'),_['map'](_0x5941b4,'id'));}});})[_0x7615('0x25')](function(){if(_0x44e4da[_0x7615('0x94')]['role']===_0x7615('0x96')&&!_0x3385ed&&!_0x44e4da[_0x7615('0x3a')]['OpenchannelAccountId'])return[];return db['sequelize'][_0x7615('0x3a')](_0x440e8a[_0x7615('0x99')](),_0x35c065);})[_0x7615('0x25')](function(_0x3919d6){_0x27fa0c[_0x7615('0x1e')]=_0x3919d6[_0x7615('0x40')];if(_0x27fa0c[_0x7615('0x1e')]===0x0)return[];return db[_0x7615('0x9a')]['query'](_0x565e18[_0x7615('0x99')](),_0x35c065)[_0x7615('0x25')](function(_0x36804b){_0x518b26=_[_0x7615('0x9b')](_0x36804b,'id');_0x35c065=_[_0x7615('0x9c')](_0x35c065,{'model':db[_0x7615('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44e4da['query'][_0x7615('0x3e')]){_0x1083b6[_0x7615('0x3f')]['forEach'](function(_0x871161){_0x40b51e[_0x7615('0x47')]('i.'+_0x871161);});}else{_0x40b51e[_0x7615('0x47')](_0x7615('0x9d'),_0x7615('0x60'));_0x40b51e['field'](_0x7615('0x9e'),_0x7615('0x9f'));_0x40b51e['field'](_0x7615('0xa0'),_0x7615('0xa1'));_0x40b51e[_0x7615('0x47')](_0x7615('0xa2'),'contactName');_0x40b51e[_0x7615('0x47')](_0x7615('0xa3'));_0x40b51e['field'](_0x7615('0xa4'),'Contact.firstName');_0x40b51e[_0x7615('0x47')](_0x7615('0xa5'),_0x7615('0xa6'));_0x40b51e[_0x7615('0x47')](_0x7615('0xa7'),_0x7615('0xa8'));_0x40b51e['field'](_0x7615('0xa9'),_0x7615('0xaa'));_0x40b51e[_0x7615('0x47')](_0x7615('0xab'),_0x7615('0xac'));_0x40b51e[_0x7615('0x47')]('c.fax',_0x7615('0xad'));_0x40b51e[_0x7615('0x47')]('o.fullname',_0x7615('0xae'));_0x40b51e['field'](_0x7615('0xaf'),_0x7615('0xb0'));_0x40b51e['field'](_0x7615('0xb1'),_0x7615('0x2e'));}if(_0x1083b6['limit'])_0x40b51e[_0x7615('0x1d')](_0x1083b6[_0x7615('0x1d')]);if(_0x1083b6[_0x7615('0x1f')])_0x40b51e['offset'](_0x1083b6[_0x7615('0x1f')]);return db[_0x7615('0x9a')][_0x7615('0x3a')](_0x40b51e['toString'](),_0x35c065);})[_0x7615('0x25')](function(_0x349a36){if(_0x349a36[_0x7615('0x40')]>0x0)_0x422bc9[_0x7615('0x44')](_0x7615('0xb2'),_[_0x7615('0x2c')](_0x349a36,'id'));return db['sequelize'][_0x7615('0x3a')](_0x422bc9['toString'](),_0x35c065)[_0x7615('0x25')](function(_0x16be53){var _0x53381f=_[_0x7615('0xb3')](_0x16be53,_0x7615('0xb4'));var _0x4a60a7=[];_0x349a36[_0x7615('0x31')](function(_0x2ec664){_0x4a60a7[_0x7615('0x32')](updateOpenchannelInteraction(_0x2ec664,_0x518b26,_0x53381f));});return BPromise[_0x7615('0xb5')](_0x4a60a7);});});})[_0x7615('0x25')](function(_0x44efc5){_0x27fa0c[_0x7615('0xb6')]=_0x44efc5;return _0x27fa0c;})['then'](respondWithFilteredResult(_0x5b66a1,_0x1083b6))[_0x7615('0x33')](handleError(_0x5b66a1,null));};exports[_0x7615('0xb7')]=function(_0x4df5cb,_0x20eab8){var _0x2007e1={};if(_0x4df5cb['query'][_0x7615('0x37')]&&_0x4df5cb[_0x7615('0x3a')]['type']==='from'){_0x2007e1[_0x7615('0x49')]=_0x4df5cb[_0x7615('0xb8')]['id'];}else{_0x2007e1['id']=_0x4df5cb['params']['id'];}var _0x5cf5c7={'raw':![],'where':_0x2007e1},_0x51c62f={};_0x51c62f[_0x7615('0x39')]=_[_0x7615('0x3b')](db[_0x7615('0x34')][_0x7615('0x35')]);_0x51c62f['query']=_[_0x7615('0x3b')](_0x4df5cb['query']);_0x51c62f[_0x7615('0x3c')]=_[_0x7615('0x3d')](_0x51c62f['model'],_0x51c62f[_0x7615('0x3a')]);_0x5cf5c7[_0x7615('0x3f')]=_[_0x7615('0x3d')](_0x51c62f[_0x7615('0x39')],qs[_0x7615('0x3e')](_0x4df5cb[_0x7615('0x3a')][_0x7615('0x3e')]));_0x5cf5c7[_0x7615('0x3f')]=_0x5cf5c7['attributes']['length']?_0x5cf5c7['attributes']:_0x51c62f[_0x7615('0x39')];if(_0x4df5cb[_0x7615('0x3a')]['includeAll']){_0x5cf5c7[_0x7615('0xb9')]=[{'all':!![]}];}_0x5cf5c7=_[_0x7615('0x9c')]({},_0x5cf5c7,_0x4df5cb['options']);return db[_0x7615('0x34')]['find'](_0x5cf5c7)['then'](handleEntityNotFound(_0x20eab8,null))[_0x7615('0x25')](respondWithResult(_0x20eab8,null))[_0x7615('0x33')](handleError(_0x20eab8,null));};exports['create']=function(_0x1ff455,_0x3ae7fa){return db[_0x7615('0x34')]['create'](_0x1ff455['body'],{})[_0x7615('0x25')](respondWithResult(_0x3ae7fa,0xc9))[_0x7615('0x33')](handleError(_0x3ae7fa,null));};exports[_0x7615('0x23')]=function(_0x4290e8,_0x2d5881){if(_0x4290e8[_0x7615('0x74')]['id']){delete _0x4290e8[_0x7615('0x74')]['id'];}return db['OpenchannelInteraction'][_0x7615('0x5f')]({'where':{'id':_0x4290e8[_0x7615('0xb8')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x2d5881,null))[_0x7615('0x25')](saveUpdates(_0x4290e8[_0x7615('0x74')],null))['then'](respondWithResult(_0x2d5881,null))[_0x7615('0x33')](handleError(_0x2d5881,null));};exports[_0x7615('0x24')]=function(_0x15b628,_0x27b9ff){return db[_0x7615('0x34')][_0x7615('0x5f')]({'where':{'id':_0x15b628[_0x7615('0xb8')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x27b9ff,null))['then'](removeEntity(_0x27b9ff,null))['catch'](handleError(_0x27b9ff,null));};exports[_0x7615('0xba')]=function(_0x35752a,_0x29befb){return db['OpenchannelInteraction'][_0x7615('0xba')]()[_0x7615('0x25')](respondWithResult(_0x29befb,null))['catch'](handleError(_0x29befb,null));};exports[_0x7615('0xbb')]=function(_0x434df7,_0x44903b,_0x4f4d41){return db[_0x7615('0xbc')][_0x7615('0x5f')]({'where':{'id':_0x434df7['params']['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x44903b,null))['then'](function(_0x343721){if(_0x343721){return _0x343721[_0x7615('0xbb')](_0x434df7[_0x7615('0x74')][_0x7615('0xbd')],_['omit'](_0x434df7[_0x7615('0x74')],[_0x7615('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x44903b,null))[_0x7615('0x33')](handleError(_0x44903b,null));};exports[_0x7615('0xbe')]=function(_0x321753,_0x341f88,_0x15c8a6){var _0x1d0182={'raw':![],'where':{}};var _0xd3f2f7={};var _0x2f7662={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x321753[_0x7615('0xb8')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x341f88,null))['then'](function(_0x292020){if(_0x292020){_0xd3f2f7[_0x7615('0x39')]=_[_0x7615('0x3b')](db[_0x7615('0xbc')][_0x7615('0x35')]);_0xd3f2f7[_0x7615('0x3a')]=_[_0x7615('0x3b')](_0x321753[_0x7615('0x3a')]);_0xd3f2f7['filters']=_[_0x7615('0x3d')](_0xd3f2f7[_0x7615('0x39')],_0xd3f2f7[_0x7615('0x3a')]);_0x1d0182['attributes']=_[_0x7615('0x3d')](_0xd3f2f7[_0x7615('0x39')],qs[_0x7615('0x3e')](_0x321753[_0x7615('0x3a')][_0x7615('0x3e')]));_0x1d0182[_0x7615('0x3f')]=_0x1d0182['attributes'][_0x7615('0x40')]?_0x1d0182[_0x7615('0x3f')]:_0xd3f2f7['model'];if(!_0x321753[_0x7615('0x3a')][_0x7615('0x41')]('nolimit')){_0x1d0182[_0x7615('0x1d')]=qs[_0x7615('0x1d')](_0x321753[_0x7615('0x3a')]['limit']);_0x1d0182[_0x7615('0x1f')]=qs[_0x7615('0x1f')](_0x321753[_0x7615('0x3a')]['offset']);}_0x1d0182[_0x7615('0x90')]=qs['sort'](_0x321753['query'][_0x7615('0x43')]);_0x1d0182[_0x7615('0x44')]=qs[_0x7615('0x3c')](_[_0x7615('0x45')](_0x321753['query'],_0xd3f2f7['filters']));_0x1d0182[_0x7615('0x44')][_0x7615('0xb4')]=_0x292020['id'];if(_0x321753['query'][_0x7615('0x84')]){_0x1d0182['where']=_[_0x7615('0x9c')](_0x1d0182[_0x7615('0x44')],{'$or':_['map'](_0x1d0182[_0x7615('0x3f')],function(_0xbeb2ba){var _0x20294b={};_0x20294b[_0xbeb2ba]={'$like':'%'+_0x321753[_0x7615('0x3a')][_0x7615('0x84')]+'%'};return _0x20294b;})});}if(_0x321753[_0x7615('0x3a')][_0x7615('0x7b')]){var _0x32d91e=_0x321753[_0x7615('0x3a')]['$gte']['split'](',');var _0x470e89={};_0x470e89[_0x32d91e[0x0]]={'$gte':moment(_0x32d91e[0x1])[_0x7615('0xbf')](_0x7615('0xc0'))};_0x1d0182[_0x7615('0x44')]=_[_0x7615('0x9c')](_0x1d0182[_0x7615('0x44')],_0x470e89);}_0x1d0182=_[_0x7615('0x9c')]({},_0x1d0182,_0x321753[_0x7615('0xc1')]);return db[_0x7615('0xbc')][_0x7615('0x1e')]({'where':_0x1d0182[_0x7615('0x44')]})['then'](function(_0x15ed70){_0x2f7662['count']=_0x15ed70;if(_0x321753[_0x7615('0x3a')][_0x7615('0xc2')]){_0x1d0182[_0x7615('0xb9')]=[{'all':!![]}];}return db[_0x7615('0xbc')][_0x7615('0xc3')](_0x1d0182);})[_0x7615('0x25')](function(_0x352408){_0x2f7662['rows']=_0x352408;return _0x2f7662;});}})[_0x7615('0x25')](respondWithFilteredResult(_0x341f88,_0x1d0182))[_0x7615('0x33')](handleError(_0x341f88,null));};exports[_0x7615('0xc4')]=function(_0x38eddb,_0x1b9586,_0x256555){return db[_0x7615('0x34')][_0x7615('0x5f')]({'where':{'id':_0x38eddb[_0x7615('0xb8')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x1b9586,null))[_0x7615('0x25')](function(_0x451fe2){if(_0x451fe2){return _0x451fe2['setTags'](_0x38eddb['body'][_0x7615('0xbd')],_[_0x7615('0xc5')](_0x38eddb[_0x7615('0x74')],[_0x7615('0xbd'),'id'])||{})[_0x7615('0xc6')](function(){return db[_0x7615('0x6d')]['findAll']({'attributes':['id',_0x7615('0x29'),_0x7615('0x48')],'where':{'id':_0x38eddb[_0x7615('0x74')][_0x7615('0xbd')]}});})['then'](function(_0x21269a){socket[_0x7615('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x38eddb[_0x7615('0xb8')]['id']),'tags':_0x21269a||[]});return{'id':Number(_0x38eddb[_0x7615('0xb8')]['id']),'tags':_0x21269a||[]};});}})[_0x7615('0x25')](respondWithResult(_0x1b9586,null))[_0x7615('0x33')](handleError(_0x1b9586,null));};exports[_0x7615('0xc8')]=function(_0x58fc8c,_0x5b4029,_0x5d981f){return db[_0x7615('0x34')][_0x7615('0x5f')]({'where':{'id':_0x58fc8c[_0x7615('0xb8')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x5b4029,null))[_0x7615('0x25')](function(_0x47527c){if(_0x47527c){return _0x47527c['removeTags'](_0x58fc8c[_0x7615('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x5b4029,null))[_0x7615('0x33')](handleError(_0x5b4029,null));};exports[_0x7615('0xc9')]=function(_0x2edd17,_0x5a797c){var _0x427b4e=moment()[_0x7615('0xca')]()[_0x7615('0x99')]();var _0x57d11d=path[_0x7615('0xcb')](config['root'],'server','files',_0x7615('0xcc'));var _0x11da85=path[_0x7615('0xcb')](config['root'],'server','files','attachments');var _0x4f36ad=path['join'](_0x57d11d,_0x427b4e);var _0x5f8d82=util['format']('transcript-%d-%s.zip',_0x2edd17[_0x7615('0xb8')]['id'],_0x427b4e);var _0x66ed23=path[_0x7615('0xcb')](_0x57d11d,_0x5f8d82);var _0x59a517=[];_0x59a517[_0x7615('0x32')]({'model':db[_0x7615('0x70')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x59a517[_0x7615('0x32')]({'model':db[_0x7615('0xcd')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x2edd17[_0x7615('0x3a')][_0x7615('0xce')]){_0x59a517[_0x7615('0x32')]({'model':db[_0x7615('0xcf')],'as':_0x7615('0xcf'),'raw':!![]});}var _0x1f35e4=[{'model':db['OpenchannelMessage'],'as':_0x7615('0xd0'),'attributes':['id',_0x7615('0x74'),_0x7615('0xd1'),_0x7615('0xd2'),_0x7615('0xd3'),_0x7615('0x7f')],'include':_0x59a517}];_0x1f35e4[_0x7615('0x32')]({'model':db[_0x7615('0xd4')],'as':_0x7615('0xd5'),'attributes':['id',_0x7615('0x29')]});_0x1f35e4[_0x7615('0x32')]({'model':db['User'],'as':_0x7615('0xd6'),'attributes':['id',_0x7615('0x2d')]});return db['OpenchannelInteraction'][_0x7615('0x5f')]({'where':{'id':_0x2edd17['params']['id']},'include':_0x1f35e4})[_0x7615('0x25')](handleEntityNotFound(_0x5a797c,null))['then'](function(_0x217c97){if(_0x217c97){var _0x58c713=_0x217c97[_0x7615('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x4f36ad);var _0x5b2231={'channel':_0x7615('0xd8'),'account':_0x58c713[_0x7615('0xd5')][_0x7615('0x29')],'agent':_0x58c713[_0x7615('0xd6')]?_0x58c713[_0x7615('0xd6')][_0x7615('0x2d')]:_0x7615('0xd9'),'createdAt':moment(_0x58c713[_0x7615('0xd1')])[_0x7615('0xbf')](_0x7615('0xc0'))[_0x7615('0x99')](),'closedAt':_0x58c713[_0x7615('0xda')]?moment(_0x58c713[_0x7615('0xdb')])[_0x7615('0xbf')](_0x7615('0xc0'))[_0x7615('0x99')]():'','disposition':_0x58c713[_0x7615('0xdc')],'visibility':_0x58c713['threadId']?_0x7615('0xdd'):_0x7615('0xde'),'messages':_(_0x58c713[_0x7615('0xd0')])['filter']({'secret':![]})[_0x7615('0x2c')](function(_0xd7f622){if(_0xd7f622[_0x7615('0xcf')]){var _0x1a71cd=path[_0x7615('0xcb')](_0x11da85,_0xd7f622['Attachment'][_0x7615('0xdf')]);if(fs[_0x7615('0xe0')](_0x1a71cd)){fs[_0x7615('0xe1')](_0x1a71cd)['pipe'](fs[_0x7615('0xe2')](path[_0x7615('0xcb')](_0x4f36ad,_0xd7f622[_0x7615('0xcf')][_0x7615('0xdf')])));}}return{'date':moment(_0xd7f622[_0x7615('0xd1')])['format'](_0x7615('0xc0'))[_0x7615('0x99')](),'sender':_0xd7f622['direction']===_0x7615('0xe3')?_0xd7f622[_0x7615('0x70')]?_0xd7f622['User']['fullname']:_0x7615('0xe4'):_0xd7f622['Contact']['firstName']+(_0xd7f622['Contact'][_0x7615('0xe5')]?'\x20'+_0xd7f622[_0x7615('0x64')]['lastName']:''),'body':_0xd7f622['Attachment']?_0xd7f622[_0x7615('0xcf')][_0x7615('0xdf')]:_0xd7f622[_0x7615('0x74')],'direction':_0xd7f622['direction']===_0x7615('0xe3')?'A':'C','secret':_0xd7f622[_0x7615('0xd3')],'read':_0xd7f622[_0x7615('0x7f')],'attachment':_0xd7f622[_0x7615('0xcf')]};})[_0x7615('0x61')]()};return ejs['renderFile'](path['join'](config[_0x7615('0xe6')],_0x7615('0xe7'),'views',_0x7615('0xe8')),{'interaction':_0x5b2231})[_0x7615('0x25')](function(_0x1e8bbb){var _0x530055=path[_0x7615('0xcb')](_0x4f36ad,_0x7615('0xe9')+_0x58c713['id']+'-'+_0x427b4e+_0x7615('0xea'));var _0x41e7df={'path':_0x530055,'channel':'Openchannel','interactionId':_0x58c713['id']};return pdf[_0x7615('0xeb')](_0x1e8bbb,_0x41e7df);})['then'](function(){return new BPromise(function(_0x39d4f2,_0x4a53cf){zipdir(_0x4f36ad,{'saveTo':_0x66ed23},function(_0x47b8e6,_0x96947d){if(_0x47b8e6)return _0x4a53cf(_0x47b8e6);return _0x39d4f2(_0x96947d);});})[_0x7615('0x25')](function(){return new BPromise(function(_0x111429,_0x4b6fc9){rimraf(_0x4f36ad,function(_0x2c990){if(_0x2c990)_0x4b6fc9(_0x2c990);return _0x111429();});});})[_0x7615('0x25')](function(){return _0x5a797c[_0x7615('0xc9')](_0x66ed23,_0x5f8d82,function(_0xc36f12){if(_0xc36f12){console[_0x7615('0xec')](_0x7615('0xed'),_0xc36f12);}else{fs[_0x7615('0xee')](_0x66ed23);}});});});}else{return _0x5a797c['sendStatus'](0xc8);}})[_0x7615('0x33')](handleError(_0x5a797c,null));}; \ No newline at end of file +var _0xbce1=['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','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','Users','Tags','split','catch','index','map','OpenchannelInteraction','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','expr','parseSearch','search','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','forEach','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','c.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','rawAttributes','nolimit','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','findAll','emit','removeTags','download','join','root','files','server','attachments','format','transcript-%d-%s.zip','fullname','CmContact','firstName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closed','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','out','System','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x4b62ba,_0x3887cc){var _0x3e621b=function(_0x477894){while(--_0x477894){_0x4b62ba['push'](_0x4b62ba['shift']());}};_0x3e621b(++_0x3887cc);}(_0xbce1,0xe2));var _0x1bce=function(_0x189886,_0x40f102){_0x189886=_0x189886-0x0;var _0x3ba5bb=_0xbce1[_0x189886];return _0x3ba5bb;};'use strict';var emlformat=require(_0x1bce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1bce('0x1'));var BPromise=require(_0x1bce('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1bce('0x3'));var sox=require(_0x1bce('0x4'));var csv=require(_0x1bce('0x5'));var ejs=require(_0x1bce('0x6'));var fs=require('fs');var fs_extra=require(_0x1bce('0x7'));var _=require(_0x1bce('0x8'));var squel=require(_0x1bce('0x9'));var crypto=require('crypto');var jsforce=require(_0x1bce('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1bce('0x5'));var querystring=require(_0x1bce('0xb'));var Papa=require(_0x1bce('0xc'));var Redis=require(_0x1bce('0xd'));var authService=require(_0x1bce('0xe'));var qs=require(_0x1bce('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x1bce('0x10'));var logger=require(_0x1bce('0x11'))(_0x1bce('0x12'));var utils=require(_0x1bce('0x13'));var config=require(_0x1bce('0x14'));var licenseUtil=require(_0x1bce('0x15'));var db=require(_0x1bce('0x16'))['db'];config[_0x1bce('0x17')]=_[_0x1bce('0x18')](config['redis'],{'host':_0x1bce('0x19'),'port':0x18eb});var socket=require(_0x1bce('0x1a'))(new Redis(config['redis']));require(_0x1bce('0x1b'))[_0x1bce('0x1c')](socket);function respondWithStatusCode(_0x4008f9,_0x573764){_0x573764=_0x573764||0xcc;return function(_0x1edd32){if(_0x1edd32){return _0x4008f9[_0x1bce('0x1d')](_0x573764);}return _0x4008f9['status'](_0x573764)[_0x1bce('0x1e')]();};}function respondWithResult(_0x987de8,_0x3e7430){_0x3e7430=_0x3e7430||0xc8;return function(_0x23ca57){if(_0x23ca57){return _0x987de8[_0x1bce('0x1f')](_0x3e7430)[_0x1bce('0x20')](_0x23ca57);}};}function respondWithFilteredResult(_0x2f2fdb,_0x2fb754){return function(_0xc397ea){if(_0xc397ea){var _0x5ded57=typeof _0x2fb754[_0x1bce('0x21')]===_0x1bce('0x22')&&typeof _0x2fb754[_0x1bce('0x23')]===_0x1bce('0x22');var _0x4f71a6=_0xc397ea[_0x1bce('0x24')];var _0x84e480=_0x5ded57?0x0:_0x2fb754[_0x1bce('0x21')];var _0x4de51d=_0x5ded57?_0xc397ea[_0x1bce('0x24')]:_0x2fb754[_0x1bce('0x21')]+_0x2fb754['limit'];var _0x57e8d6;if(_0x4de51d>=_0x4f71a6){_0x4de51d=_0x4f71a6;_0x57e8d6=0xc8;}else{_0x57e8d6=0xce;}_0x2f2fdb['status'](_0x57e8d6);return _0x2f2fdb[_0x1bce('0x25')](_0x1bce('0x26'),_0x84e480+'-'+_0x4de51d+'/'+_0x4f71a6)[_0x1bce('0x20')](_0xc397ea);}return null;};}function patchUpdates(_0x5a2856){return function(_0x5e9a49){try{jsonpatch[_0x1bce('0x27')](_0x5e9a49,_0x5a2856,!![]);}catch(_0x1ab079){return BPromise[_0x1bce('0x28')](_0x1ab079);}return _0x5e9a49[_0x1bce('0x29')]();};}function saveUpdates(_0x4bb340,_0x3d5c81){return function(_0x2edcde){if(_0x2edcde){return _0x2edcde[_0x1bce('0x2a')](_0x4bb340)[_0x1bce('0x2b')](function(_0x434b9c){return _0x434b9c;});}return null;};}function removeEntity(_0x3c751d,_0x51fa1a){return function(_0x2efe9e){if(_0x2efe9e){return _0x2efe9e[_0x1bce('0x2c')]()[_0x1bce('0x2b')](function(){_0x3c751d[_0x1bce('0x1f')](0xcc)[_0x1bce('0x1e')]();});}};}function handleEntityNotFound(_0x3b8f1e,_0x59b943){return function(_0x5dd09b){if(!_0x5dd09b){_0x3b8f1e['sendStatus'](0x194);}return _0x5dd09b;};}function handleError(_0x582de0,_0x39144d){_0x39144d=_0x39144d||0x1f4;return function(_0x184a54){logger['error'](_0x184a54[_0x1bce('0x2d')]);if(_0x184a54[_0x1bce('0x2e')]){delete _0x184a54['name'];}_0x582de0['status'](_0x39144d)[_0x1bce('0x2f')](_0x184a54);};}function getInteractionUsers(_0x5dacc2,_0x206731){return new BPromise(function(_0x2127cc,_0x55eaf9){try{if(_0x206731[_0x5dacc2['id']]){_0x5dacc2[_0x1bce('0x30')]=_['map'](_0x206731[_0x5dacc2['id']],function(_0x2654a6){return{'id':_0x2654a6['id'],'fullname':_0x2654a6['fullname']};});}}catch(_0x2da6ec){_0x55eaf9(_0x2da6ec);}_0x2127cc(_0x5dacc2);});}function getInteractionTags(_0xf4b7ae,_0x2d84f1){return new BPromise(function(_0x601fb0,_0x637049){try{if(_0xf4b7ae['TagIds']){_0xf4b7ae[_0x1bce('0x31')]=[];_0xf4b7ae['TagIds'][_0x1bce('0x32')](',')['forEach'](function(_0x555951){_0xf4b7ae[_0x1bce('0x31')]['push'](_0x2d84f1[_0x555951]);});}delete _0xf4b7ae['TagIds'];}catch(_0x24ac26){_0x637049(_0x24ac26);}_0x601fb0(_0xf4b7ae);});}function updateOpenchannelInteraction(_0x22158e,_0xcd7166,_0x334a12){return new BPromise(function(_0x253909,_0x4067c4){return getInteractionUsers(_0x22158e,_0x334a12)[_0x1bce('0x2b')](function(_0x35412c){return getInteractionTags(_0x35412c,_0xcd7166);})[_0x1bce('0x2b')](function(_0x1bbda9){_0x253909(_0x1bbda9);})[_0x1bce('0x33')](function(_0x4f7132){_0x4067c4(_0x4f7132);});});}exports[_0x1bce('0x34')]=function(_0x5dcb42,_0x3700b5){var _0x28cf8a={},_0x25f5e1={},_0xf651f0={'count':0x0,'rows':[]};var _0x23e9b9=_[_0x1bce('0x35')](db[_0x1bce('0x36')]['rawAttributes'],function(_0x43d4dd){return{'name':_0x43d4dd[_0x1bce('0x37')],'type':_0x43d4dd['type'][_0x1bce('0x38')]};});_0x25f5e1['model']=_['map'](_0x23e9b9,_0x1bce('0x2e'));_0x25f5e1[_0x1bce('0x39')]=_[_0x1bce('0x3a')](_0x5dcb42[_0x1bce('0x39')]);_0x25f5e1['filters']=_[_0x1bce('0x3b')](_0x25f5e1[_0x1bce('0x3c')],_0x25f5e1[_0x1bce('0x39')]);_0x28cf8a[_0x1bce('0x3d')]=_['intersection'](_0x25f5e1[_0x1bce('0x3c')],qs[_0x1bce('0x3e')](_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x3e')]));_0x28cf8a[_0x1bce('0x3d')]=_0x28cf8a[_0x1bce('0x3d')][_0x1bce('0x3f')]?_0x28cf8a[_0x1bce('0x3d')]:_0x25f5e1[_0x1bce('0x3c')];if(!_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x40')]('nolimit')){_0x28cf8a[_0x1bce('0x23')]=qs[_0x1bce('0x23')](_0x5dcb42[_0x1bce('0x39')]['limit']);_0x28cf8a['offset']=qs[_0x1bce('0x21')](_0x5dcb42['query']['offset']);}_0x28cf8a[_0x1bce('0x41')]=qs[_0x1bce('0x42')](_0x5dcb42['query'][_0x1bce('0x42')]);_0x28cf8a[_0x1bce('0x43')]=qs[_0x1bce('0x44')](_[_0x1bce('0x45')](_0x5dcb42[_0x1bce('0x39')],_0x25f5e1['filters']),_0x23e9b9);var _0x1b5023=[];var _0x2b9ba7=squel[_0x1bce('0x46')]()[_0x1bce('0x47')]('id')[_0x1bce('0x47')]('name')[_0x1bce('0x47')](_0x1bce('0x48'))[_0x1bce('0x49')](_0x1bce('0x4a'));var _0x6b0340=squel[_0x1bce('0x46')]()[_0x1bce('0x47')](_0x1bce('0x4b'))['field'](_0x1bce('0x4c'))['field'](_0x1bce('0x4d'))[_0x1bce('0x49')](_0x1bce('0x4e'),'ui')[_0x1bce('0x4f')](_0x1bce('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x2e030f=squel[_0x1bce('0x46')]()[_0x1bce('0x49')](_0x1bce('0x51'),'i')[_0x1bce('0x4f')](_0x1bce('0x52'),'c',_0x1bce('0x53'))[_0x1bce('0x4f')](_0x1bce('0x50'),'o',_0x1bce('0x54'))[_0x1bce('0x4f')](_0x1bce('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x1bce('0x4f')](_0x1bce('0x56'),'me',_0x1bce('0x57'))[_0x1bce('0x4f')](_0x1bce('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x1bce('0x4f')](_0x1bce('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x596fab=squel[_0x1bce('0x59')]();var _0x30add4=[];var _0x12f19f=squel[_0x1bce('0x59')]();var _0x3c0360;if(_0x5dcb42['query']['search']){_0x3c0360=as[_0x1bce('0x5a')](_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x5b')]);var _0x3f5ac1=_0x3c0360[_0x1bce('0x5c')];for(var _0x5564f2=0x0;_0x5564f2<_0x3c0360[_0x1bce('0x5d')][_0x1bce('0x3f')];_0x5564f2++){var _0x1be2a3=_0x3c0360['conditions'][_0x5564f2];var _0x5ac601='i';var _0x19db10=_['find'](_0x23e9b9,['name',_0x1be2a3[_0x1bce('0x47')]]);if(!_0x19db10){switch(_0x1be2a3[_0x1bce('0x47')]){case'unreadMessages':if(_0x1be2a3[_0x1bce('0x5e')]==0x1){_0x2e030f[_0x1bce('0x5f')]('`'+_0x1be2a3[_0x1bce('0x47')]+_0x1bce('0x60'));}else{_0x2e030f[_0x1bce('0x5f')]('`'+_0x1be2a3['field']+_0x1bce('0x61'));}break;case _0x1bce('0x62'):if(_0x1be2a3[_0x1bce('0x63')]===_0x1bce('0x64')){if(_0x1be2a3['value'][_0x1bce('0x32')]('\x20')['length']>0x1){_0x596fab[_0x3f5ac1](_0x1bce('0x65'),qs[_0x1bce('0x66')](_0x1be2a3[_0x1bce('0x5e')]),null);}else{var _0x5509f4='%'+_0x1be2a3[_0x1bce('0x5e')]+'%';_0x596fab[_0x3f5ac1](_0x1bce('0x67'),_0x5509f4,_0x5509f4,_0x5509f4);}}else{_0x19db10=_[_0x1bce('0x68')](_0x23e9b9,[_0x1bce('0x2e'),_0x1bce('0x69')]);_0x1be2a3[_0x1bce('0x47')]=_0x1bce('0x69');_0x40a5ce=as[_0x1bce('0x6a')](_0x5ac601,_0x19db10[_0x1bce('0x6b')],_0x1be2a3);_0x596fab[_0x3f5ac1](_0x40a5ce[_0x1bce('0x6c')],_0x40a5ce[_0x1bce('0x5e')][_0x1bce('0x6d')],_0x40a5ce['value']['end']);}break;case _0x1bce('0x6e'):var _0x5e7c36=_0x1be2a3[_0x1bce('0x5e')]['split'](',')[_0x1bce('0x35')](function(_0x21c93f){return Number(_0x21c93f);});_0x5e7c36['forEach'](function(_0x36f700){_0x12f19f['or'](_0x1bce('0x6f'),'%,'+_0x36f700+',%');});_0x30add4=_['union'](_0x30add4,_0x5e7c36);break;case _0x1bce('0x70'):if(_0x1be2a3[_0x1bce('0x63')]==='$substring'){_0x596fab[_0x3f5ac1](_0x1bce('0x71'),'%'+_0x1be2a3[_0x1bce('0x5e')]+'%',null);}else{_0x19db10=_[_0x1bce('0x68')](_0x23e9b9,[_0x1bce('0x2e'),_0x1bce('0x72')]);_0x1be2a3[_0x1bce('0x47')]=_0x1bce('0x72');_0x40a5ce=as[_0x1bce('0x6a')](_0x5ac601,_0x19db10['type'],_0x1be2a3);_0x596fab[_0x3f5ac1](_0x40a5ce[_0x1bce('0x6c')],_0x40a5ce[_0x1bce('0x5e')][_0x1bce('0x6d')],_0x40a5ce['value'][_0x1bce('0x1e')]);}break;case _0x1bce('0x73'):_0x40a5ce=as[_0x1bce('0x6a')]('me',null,_0x1be2a3);_0x596fab[_0x3f5ac1](_0x40a5ce[_0x1bce('0x6c')],_0x40a5ce[_0x1bce('0x5e')][_0x1bce('0x6d')],_0x40a5ce[_0x1bce('0x5e')][_0x1bce('0x1e')]);break;}}else{var _0x40a5ce=as[_0x1bce('0x6a')](_0x5ac601,_0x19db10[_0x1bce('0x6b')],_0x1be2a3);_0x596fab[_0x3f5ac1](_0x40a5ce['text'],_0x40a5ce['value'][_0x1bce('0x6d')],_0x40a5ce[_0x1bce('0x5e')]['end']);}}}else{var _0x88248e=_(_0x5dcb42[_0x1bce('0x39')])[_0x1bce('0x3a')]()['map'](function(_0x19bb2e){return _[_0x1bce('0x74')](_0x23e9b9,[_0x1bce('0x2e'),_0x19bb2e])?_0x19bb2e:undefined;})[_0x1bce('0x75')]()[_0x1bce('0x5e')]();if(!_[_0x1bce('0x76')](_0x88248e)){_0x88248e[_0x1bce('0x77')](function(_0x6c631a){if(_0x6c631a===_0x1bce('0x78')){_0x2e030f[_0x1bce('0x43')](_0x1bce('0x79'),[][_0x1bce('0x7a')](_0x5dcb42[_0x1bce('0x39')][_0x6c631a]));}else if(_0x6c631a===_0x1bce('0x7b')){var _0x32e1e3=JSON[_0x1bce('0x7c')](_0x5dcb42[_0x1bce('0x39')][_0x6c631a])[_0x1bce('0x7d')];var _0x4743c7=JSON[_0x1bce('0x7c')](_0x5dcb42[_0x1bce('0x39')][_0x6c631a])[_0x1bce('0x7e')];_0x2e030f['where'](_0x1bce('0x7f'),_0x32e1e3,_0x4743c7);}else{if(_0x5dcb42[_0x1bce('0x39')][_0x6c631a]==='null'){_0x2e030f[_0x1bce('0x43')]('i.'+_0x6c631a+_0x1bce('0x80'));}else{_0x2e030f[_0x1bce('0x43')]('i.'+_0x6c631a+_0x1bce('0x81'),_0x5dcb42[_0x1bce('0x39')][_0x6c631a]);}}});}if(_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x82')]){if(_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x82')]==0x1){_0x2e030f[_0x1bce('0x5f')](_0x1bce('0x83'));}else{_0x2e030f[_0x1bce('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x84')]){_0x30add4=_[_0x1bce('0x85')](_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x84')])?_0x5dcb42['query'][_0x1bce('0x84')]:new Array(_0x5dcb42[_0x1bce('0x39')]['tag']);_0x30add4[_0x1bce('0x77')](function(_0x2dac62){_0x12f19f['or'](_0x1bce('0x6f'),'%,'+_0x2dac62+',%');});}if(_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x86')]){var _0x1d9f61=_0x5dcb42['query'][_0x1bce('0x86')][_0x1bce('0x87')]('\x5c','\x5c\x5c')[_0x1bce('0x87')](/'/g,'\x27\x27');if(qs[_0x1bce('0x88')](_0x1d9f61)){_0x596fab['or'](_0x1bce('0x89'),_0x1d9f61+'%');}else{_0x596fab['or'](_0x1bce('0x8a'),qs[_0x1bce('0x66')](_0x1d9f61))['or'](_0x1bce('0x8b'),_0x1d9f61+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1d9f61+'%');}}}_0x2e030f[_0x1bce('0x43')](_0x596fab);_0x2e030f[_0x1bce('0x8c')](_0x1bce('0x8d'));var _0xa48a77={'type':db[_0x1bce('0x8e')][_0x1bce('0x8f')]['SELECT'],'raw':!![]};var _0x3b3023=_0x2e030f['clone']();_0x3b3023[_0x1bce('0x47')](_0x1bce('0x8d'));_0x3b3023[_0x1bce('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1bce('0x90'));if(_0x28cf8a[_0x1bce('0x41')]){_0x28cf8a[_0x1bce('0x41')][_0x1bce('0x77')](function(_0x3f9159){var _0x7a5846=_0x3f9159[0x0]===_0x1bce('0x91')?_0x3f9159[0x0]:'i.'+_0x3f9159[0x0];_0x2e030f['order'](_0x7a5846,_0x3f9159[0x1]===_0x1bce('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x30add4)){_0x2e030f[_0x1bce('0x5f')](_0x12f19f);_0x3b3023[_0x1bce('0x43')](_0x1bce('0x93'),_0x30add4);}BPromise[_0x1bce('0x94')]()['then'](function(){if(!_0x3c0360){if(_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x78')])return;_0x3b3023['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x2e030f['where'](_0x1bce('0x95'));return;}if(_0x5dcb42['user'][_0x1bce('0x96')]!==_0x1bce('0x97'))return;return _0x5dcb42[_0x1bce('0x98')][_0x1bce('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54b40d){if(_[_0x1bce('0x76')](_0x54b40d)){_0x3b3023[_0x1bce('0x43')](_0x1bce('0x9a'));_0x2e030f[_0x1bce('0x43')](_0x1bce('0x9a'));}else{_0x3b3023[_0x1bce('0x43')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x1bce('0x35')](_0x54b40d,'id'));_0x2e030f[_0x1bce('0x43')](_0x1bce('0x79'),_['map'](_0x54b40d,'id'));}});})[_0x1bce('0x2b')](function(){if(_0x5dcb42[_0x1bce('0x98')][_0x1bce('0x96')]===_0x1bce('0x97')&&!_0x3c0360&&!_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x78')])return[];return db[_0x1bce('0x9b')][_0x1bce('0x39')](_0x3b3023[_0x1bce('0x9c')](),_0xa48a77);})['then'](function(_0x773ff8){_0xf651f0[_0x1bce('0x24')]=_0x773ff8[_0x1bce('0x3f')];if(_0xf651f0['count']===0x0)return[];return db[_0x1bce('0x9b')][_0x1bce('0x39')](_0x2b9ba7[_0x1bce('0x9c')](),_0xa48a77)[_0x1bce('0x2b')](function(_0x8db682){_0x1b5023=_[_0x1bce('0x9d')](_0x8db682,'id');_0xa48a77=_[_0x1bce('0x9e')](_0xa48a77,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5dcb42[_0x1bce('0x39')][_0x1bce('0x3e')]){_0x28cf8a[_0x1bce('0x3d')][_0x1bce('0x77')](function(_0x1d525c){_0x2e030f['field']('i.'+_0x1d525c);});}else{_0x2e030f['field'](_0x1bce('0x9f'),_0x1bce('0x90'));_0x2e030f['field'](_0x1bce('0xa0'),'Account.key');_0x2e030f['field'](_0x1bce('0xa1'),'Account.mandatoryDisposition');_0x2e030f['field'](_0x1bce('0xa2'),_0x1bce('0x91'));_0x2e030f[_0x1bce('0x47')]('i.*');_0x2e030f['field'](_0x1bce('0xa3'),'Contact.firstName');_0x2e030f['field'](_0x1bce('0xa4'),'Contact.lastName');_0x2e030f['field'](_0x1bce('0xa5'),'Contact.email');_0x2e030f[_0x1bce('0x47')]('c.phone',_0x1bce('0xa6'));_0x2e030f[_0x1bce('0x47')]('c.mobile',_0x1bce('0xa7'));_0x2e030f['field']('c.fax',_0x1bce('0xa8'));_0x2e030f['field'](_0x1bce('0xa9'),_0x1bce('0xaa'));_0x2e030f[_0x1bce('0x47')](_0x1bce('0xab'),_0x1bce('0xac'));_0x2e030f[_0x1bce('0x47')](_0x1bce('0xad'),_0x1bce('0xae'));}if(_0x28cf8a[_0x1bce('0x23')])_0x2e030f[_0x1bce('0x23')](_0x28cf8a[_0x1bce('0x23')]);if(_0x28cf8a[_0x1bce('0x21')])_0x2e030f[_0x1bce('0x21')](_0x28cf8a[_0x1bce('0x21')]);return db['sequelize']['query'](_0x2e030f['toString'](),_0xa48a77);})[_0x1bce('0x2b')](function(_0x2af74d){if(_0x2af74d[_0x1bce('0x3f')]>0x0)_0x6b0340[_0x1bce('0x43')](_0x1bce('0xaf'),_[_0x1bce('0x35')](_0x2af74d,'id'));return db[_0x1bce('0x9b')][_0x1bce('0x39')](_0x6b0340['toString'](),_0xa48a77)[_0x1bce('0x2b')](function(_0x4e2a9b){var _0x336f81=_[_0x1bce('0xb0')](_0x4e2a9b,'OpenchannelInteractionId');var _0x1675fc=[];_0x2af74d[_0x1bce('0x77')](function(_0x4504ee){_0x1675fc[_0x1bce('0xb1')](updateOpenchannelInteraction(_0x4504ee,_0x1b5023,_0x336f81));});return BPromise['all'](_0x1675fc);});});})['then'](function(_0x5677bb){_0xf651f0[_0x1bce('0xb2')]=_0x5677bb;return _0xf651f0;})['then'](respondWithFilteredResult(_0x3700b5,_0x28cf8a))[_0x1bce('0x33')](handleError(_0x3700b5,null));};exports[_0x1bce('0xb3')]=function(_0x4bd4c0,_0x44c663){var _0x503bc2={};if(_0x4bd4c0[_0x1bce('0x39')][_0x1bce('0x6b')]&&_0x4bd4c0[_0x1bce('0x39')][_0x1bce('0x6b')]===_0x1bce('0x49')){_0x503bc2[_0x1bce('0x49')]=_0x4bd4c0['params']['id'];}else{_0x503bc2['id']=_0x4bd4c0[_0x1bce('0xb4')]['id'];}var _0x3841b3={'raw':![],'where':_0x503bc2},_0x46c598={};_0x46c598['model']=_['keys'](db[_0x1bce('0x36')]['rawAttributes']);_0x46c598[_0x1bce('0x39')]=_[_0x1bce('0x3a')](_0x4bd4c0[_0x1bce('0x39')]);_0x46c598[_0x1bce('0x44')]=_[_0x1bce('0x3b')](_0x46c598[_0x1bce('0x3c')],_0x46c598[_0x1bce('0x39')]);_0x3841b3['attributes']=_[_0x1bce('0x3b')](_0x46c598['model'],qs[_0x1bce('0x3e')](_0x4bd4c0[_0x1bce('0x39')]['fields']));_0x3841b3[_0x1bce('0x3d')]=_0x3841b3[_0x1bce('0x3d')][_0x1bce('0x3f')]?_0x3841b3[_0x1bce('0x3d')]:_0x46c598[_0x1bce('0x3c')];if(_0x4bd4c0[_0x1bce('0x39')][_0x1bce('0xb5')]){_0x3841b3[_0x1bce('0xb6')]=[{'all':!![]}];}_0x3841b3=_[_0x1bce('0x9e')]({},_0x3841b3,_0x4bd4c0[_0x1bce('0xb7')]);return db['OpenchannelInteraction'][_0x1bce('0x68')](_0x3841b3)['then'](handleEntityNotFound(_0x44c663,null))[_0x1bce('0x2b')](respondWithResult(_0x44c663,null))[_0x1bce('0x33')](handleError(_0x44c663,null));};exports[_0x1bce('0xb8')]=function(_0x194c4c,_0x4375d3){return db[_0x1bce('0x36')][_0x1bce('0xb8')](_0x194c4c[_0x1bce('0x73')],{})[_0x1bce('0x2b')](respondWithResult(_0x4375d3,0xc9))['catch'](handleError(_0x4375d3,null));};exports[_0x1bce('0x2a')]=function(_0x5eee15,_0xa5dcae){if(_0x5eee15['body']['id']){delete _0x5eee15[_0x1bce('0x73')]['id'];}return db[_0x1bce('0x36')][_0x1bce('0x68')]({'where':{'id':_0x5eee15['params']['id']}})['then'](handleEntityNotFound(_0xa5dcae,null))['then'](saveUpdates(_0x5eee15['body'],null))[_0x1bce('0x2b')](respondWithResult(_0xa5dcae,null))[_0x1bce('0x33')](handleError(_0xa5dcae,null));};exports['destroy']=function(_0x53ce7a,_0x162e77){return db[_0x1bce('0x36')][_0x1bce('0x68')]({'where':{'id':_0x53ce7a[_0x1bce('0xb4')]['id']}})['then'](handleEntityNotFound(_0x162e77,null))['then'](removeEntity(_0x162e77,null))[_0x1bce('0x33')](handleError(_0x162e77,null));};exports[_0x1bce('0xb9')]=function(_0x59eb28,_0x548ca9){return db[_0x1bce('0x36')][_0x1bce('0xb9')]()['then'](respondWithResult(_0x548ca9,null))['catch'](handleError(_0x548ca9,null));};exports[_0x1bce('0xba')]=function(_0x97d9e5,_0x58c08a,_0x287ad2){return db['OpenchannelMessage'][_0x1bce('0x68')]({'where':{'id':_0x97d9e5['params']['id']}})['then'](handleEntityNotFound(_0x58c08a,null))[_0x1bce('0x2b')](function(_0x28225e){if(_0x28225e){return _0x28225e['addMessage'](_0x97d9e5[_0x1bce('0x73')][_0x1bce('0xbb')],_[_0x1bce('0xbc')](_0x97d9e5[_0x1bce('0x73')],[_0x1bce('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x58c08a,null))[_0x1bce('0x33')](handleError(_0x58c08a,null));};exports[_0x1bce('0xbd')]=function(_0x215df1,_0x3a261b,_0x511e24){var _0xb2935b={'raw':![],'where':{}};var _0x1e6501={};var _0x4129e5={'count':0x0,'rows':[]};return db[_0x1bce('0x36')]['findOne']({'where':{'id':_0x215df1['params']['id']}})['then'](handleEntityNotFound(_0x3a261b,null))[_0x1bce('0x2b')](function(_0x467e0f){if(_0x467e0f){_0x1e6501['model']=_[_0x1bce('0x3a')](db[_0x1bce('0xbe')][_0x1bce('0xbf')]);_0x1e6501['query']=_['keys'](_0x215df1[_0x1bce('0x39')]);_0x1e6501[_0x1bce('0x44')]=_['intersection'](_0x1e6501[_0x1bce('0x3c')],_0x1e6501[_0x1bce('0x39')]);_0xb2935b[_0x1bce('0x3d')]=_[_0x1bce('0x3b')](_0x1e6501[_0x1bce('0x3c')],qs[_0x1bce('0x3e')](_0x215df1[_0x1bce('0x39')][_0x1bce('0x3e')]));_0xb2935b[_0x1bce('0x3d')]=_0xb2935b[_0x1bce('0x3d')][_0x1bce('0x3f')]?_0xb2935b['attributes']:_0x1e6501[_0x1bce('0x3c')];if(!_0x215df1[_0x1bce('0x39')]['hasOwnProperty'](_0x1bce('0xc0'))){_0xb2935b[_0x1bce('0x23')]=qs['limit'](_0x215df1[_0x1bce('0x39')]['limit']);_0xb2935b[_0x1bce('0x21')]=qs['offset'](_0x215df1['query'][_0x1bce('0x21')]);}_0xb2935b[_0x1bce('0x41')]=qs['sort'](_0x215df1[_0x1bce('0x39')]['sort']);_0xb2935b[_0x1bce('0x43')]=qs[_0x1bce('0x44')](_['pick'](_0x215df1[_0x1bce('0x39')],_0x1e6501[_0x1bce('0x44')]));_0xb2935b[_0x1bce('0x43')]['OpenchannelInteractionId']=_0x467e0f['id'];if(_0x215df1[_0x1bce('0x39')][_0x1bce('0x86')]){_0xb2935b[_0x1bce('0x43')]=_['merge'](_0xb2935b['where'],{'$or':_[_0x1bce('0x35')](_0xb2935b[_0x1bce('0x3d')],function(_0x2ecb0b){var _0x2c42f7={};_0x2c42f7[_0x2ecb0b]={'$like':'%'+_0x215df1[_0x1bce('0x39')][_0x1bce('0x86')]+'%'};return _0x2c42f7;})});}if(_0x215df1[_0x1bce('0x39')][_0x1bce('0x7d')]){var _0x3bd1a7=_0x215df1[_0x1bce('0x39')][_0x1bce('0x7d')][_0x1bce('0x32')](',');var _0x3dfa75={};_0x3dfa75[_0x3bd1a7[0x0]]={'$gte':moment(_0x3bd1a7[0x1])['format'](_0x1bce('0xc1'))};_0xb2935b[_0x1bce('0x43')]=_[_0x1bce('0x9e')](_0xb2935b[_0x1bce('0x43')],_0x3dfa75);}_0xb2935b=_[_0x1bce('0x9e')]({},_0xb2935b,_0x215df1[_0x1bce('0xb7')]);return db[_0x1bce('0xbe')][_0x1bce('0x24')]({'where':_0xb2935b[_0x1bce('0x43')]})[_0x1bce('0x2b')](function(_0x576fa2){_0x4129e5['count']=_0x576fa2;if(_0x215df1[_0x1bce('0x39')][_0x1bce('0xb5')]){_0xb2935b[_0x1bce('0xb6')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0xb2935b);})[_0x1bce('0x2b')](function(_0x5d6b4b){_0x4129e5[_0x1bce('0xb2')]=_0x5d6b4b;return _0x4129e5;});}})[_0x1bce('0x2b')](respondWithFilteredResult(_0x3a261b,_0xb2935b))[_0x1bce('0x33')](handleError(_0x3a261b,null));};exports['addTags']=function(_0x5d8225,_0x175e05,_0x2b6062){return db['OpenchannelInteraction'][_0x1bce('0x68')]({'where':{'id':_0x5d8225[_0x1bce('0xb4')]['id']}})[_0x1bce('0x2b')](handleEntityNotFound(_0x175e05,null))['then'](function(_0x4c26cb){if(_0x4c26cb){return _0x4c26cb[_0x1bce('0xc2')](_0x5d8225[_0x1bce('0x73')][_0x1bce('0xbb')],_[_0x1bce('0xbc')](_0x5d8225[_0x1bce('0x73')],[_0x1bce('0xbb'),'id'])||{})[_0x1bce('0xc3')](function(){return db[_0x1bce('0x6e')][_0x1bce('0xc4')]({'attributes':['id','name',_0x1bce('0x48')],'where':{'id':_0x5d8225[_0x1bce('0x73')][_0x1bce('0xbb')]}});})['then'](function(_0x210f57){socket[_0x1bce('0xc5')]('openchannelInteractionTags:save',{'id':Number(_0x5d8225['params']['id']),'tags':_0x210f57||[]});return{'id':Number(_0x5d8225[_0x1bce('0xb4')]['id']),'tags':_0x210f57||[]};});}})['then'](respondWithResult(_0x175e05,null))[_0x1bce('0x33')](handleError(_0x175e05,null));};exports[_0x1bce('0xc6')]=function(_0x4ac4e8,_0x40b4a2,_0x296165){return db[_0x1bce('0x36')][_0x1bce('0x68')]({'where':{'id':_0x4ac4e8[_0x1bce('0xb4')]['id']}})[_0x1bce('0x2b')](handleEntityNotFound(_0x40b4a2,null))['then'](function(_0x4c2295){if(_0x4c2295){return _0x4c2295['removeTags'](_0x4ac4e8[_0x1bce('0x39')][_0x1bce('0xbb')]);}})[_0x1bce('0x2b')](respondWithStatusCode(_0x40b4a2,null))['catch'](handleError(_0x40b4a2,null));};exports[_0x1bce('0xc7')]=function(_0x310502,_0x3466fd){var _0x307c8d=moment()['unix']()[_0x1bce('0x9c')]();var _0x38f615=path[_0x1bce('0xc8')](config[_0x1bce('0xc9')],'server',_0x1bce('0xca'),'tmp');var _0x3d3f3f=path[_0x1bce('0xc8')](config[_0x1bce('0xc9')],_0x1bce('0xcb'),'files',_0x1bce('0xcc'));var _0x5eab58=path['join'](_0x38f615,_0x307c8d);var _0x18187b=util[_0x1bce('0xcd')](_0x1bce('0xce'),_0x310502['params']['id'],_0x307c8d);var _0x90cf22=path[_0x1bce('0xc8')](_0x38f615,_0x18187b);var _0x15244d=[];_0x15244d['push']({'model':db[_0x1bce('0x70')],'as':_0x1bce('0x70'),'attributes':['id',_0x1bce('0xcf')],'raw':!![]});_0x15244d[_0x1bce('0xb1')]({'model':db[_0x1bce('0xd0')],'as':_0x1bce('0x62'),'attributes':['id',_0x1bce('0xd1'),'lastName'],'raw':!![]});if(_0x310502[_0x1bce('0x39')]['attachments']){_0x15244d['push']({'model':db[_0x1bce('0xd2')],'as':_0x1bce('0xd2'),'raw':!![]});}var _0x449e9c=[{'model':db[_0x1bce('0xbe')],'as':_0x1bce('0xd3'),'attributes':['id','body',_0x1bce('0x7b'),'direction',_0x1bce('0xd4'),_0x1bce('0x82')],'include':_0x15244d}];_0x449e9c['push']({'model':db[_0x1bce('0xd5')],'as':_0x1bce('0xd6'),'attributes':['id',_0x1bce('0x2e')]});_0x449e9c[_0x1bce('0xb1')]({'model':db[_0x1bce('0x70')],'as':_0x1bce('0xd7'),'attributes':['id',_0x1bce('0xcf')]});return db[_0x1bce('0x36')][_0x1bce('0x68')]({'where':{'id':_0x310502[_0x1bce('0xb4')]['id']},'include':_0x449e9c})[_0x1bce('0x2b')](handleEntityNotFound(_0x3466fd,null))[_0x1bce('0x2b')](function(_0x262b42){if(_0x262b42){var _0x34d04d=_0x262b42[_0x1bce('0xd8')]({'plain':!![]});fs[_0x1bce('0xd9')](_0x5eab58);var _0x4986d5={'channel':_0x1bce('0xda'),'account':_0x34d04d[_0x1bce('0xd6')][_0x1bce('0x2e')],'agent':_0x34d04d[_0x1bce('0xd7')]?_0x34d04d['Owner'][_0x1bce('0xcf')]:'N.A.','createdAt':moment(_0x34d04d[_0x1bce('0x7b')])[_0x1bce('0xcd')](_0x1bce('0xc1'))['toString'](),'closedAt':_0x34d04d[_0x1bce('0xdb')]?moment(_0x34d04d[_0x1bce('0xdc')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x1bce('0x9c')]():'','disposition':_0x34d04d['disposition'],'visibility':_0x34d04d[_0x1bce('0xdd')]?_0x1bce('0xde'):_0x1bce('0xdf'),'messages':_(_0x34d04d[_0x1bce('0xd3')])[_0x1bce('0x86')]({'secret':![]})[_0x1bce('0x35')](function(_0x114fc9){if(_0x114fc9[_0x1bce('0xd2')]){var _0x2a2074=path[_0x1bce('0xc8')](_0x3d3f3f,_0x114fc9[_0x1bce('0xd2')][_0x1bce('0xe0')]);if(fs[_0x1bce('0xe1')](_0x2a2074)){fs[_0x1bce('0xe2')](_0x2a2074)['pipe'](fs['createWriteStream'](path['join'](_0x5eab58,_0x114fc9[_0x1bce('0xd2')][_0x1bce('0xe0')])));}}return{'date':moment(_0x114fc9[_0x1bce('0x7b')])[_0x1bce('0xcd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1bce('0x9c')](),'sender':_0x114fc9['direction']===_0x1bce('0xe3')?_0x114fc9[_0x1bce('0x70')]?_0x114fc9[_0x1bce('0x70')][_0x1bce('0xcf')]:_0x1bce('0xe4'):_0x114fc9['Contact'][_0x1bce('0xd1')]+(_0x114fc9['Contact'][_0x1bce('0xe5')]?'\x20'+_0x114fc9[_0x1bce('0x62')]['lastName']:''),'body':_0x114fc9[_0x1bce('0xd2')]?_0x114fc9[_0x1bce('0xd2')]['basename']:_0x114fc9[_0x1bce('0x73')],'direction':_0x114fc9['direction']===_0x1bce('0xe3')?'A':'C','secret':_0x114fc9[_0x1bce('0xd4')],'read':_0x114fc9[_0x1bce('0x82')],'attachment':_0x114fc9['Attachment']};})[_0x1bce('0x5e')]()};return ejs[_0x1bce('0xe6')](path[_0x1bce('0xc8')](config[_0x1bce('0xc9')],_0x1bce('0xcb'),_0x1bce('0xe7'),'downloadInteraction.ejs'),{'interaction':_0x4986d5})[_0x1bce('0x2b')](function(_0xf51dca){var _0x48d5c9=path[_0x1bce('0xc8')](_0x5eab58,_0x1bce('0xe8')+_0x34d04d['id']+'-'+_0x307c8d+_0x1bce('0xe9'));var _0x784420={'path':_0x48d5c9,'channel':'Openchannel','interactionId':_0x34d04d['id']};return pdf[_0x1bce('0xea')](_0xf51dca,_0x784420);})['then'](function(){return new BPromise(function(_0x14d137,_0x52e299){zipdir(_0x5eab58,{'saveTo':_0x90cf22},function(_0x254d81,_0x1b536f){if(_0x254d81)return _0x52e299(_0x254d81);return _0x14d137(_0x1b536f);});})[_0x1bce('0x2b')](function(){return new BPromise(function(_0x12b057,_0x3ff141){rimraf(_0x5eab58,function(_0x5ccf4b){if(_0x5ccf4b)_0x3ff141(_0x5ccf4b);return _0x12b057();});});})[_0x1bce('0x2b')](function(){return _0x3466fd[_0x1bce('0xc7')](_0x90cf22,_0x18187b,function(_0x5e84fd){if(_0x5e84fd){console['log'](_0x1bce('0xeb'),_0x5e84fd);}else{fs[_0x1bce('0xec')](_0x90cf22);}});});});}else{return _0x3466fd[_0x1bce('0x1d')](0xc8);}})['catch'](handleError(_0x3466fd,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3fa74f4..57023dd 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 _0x55a1=['catch','hasOwnProperty','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x55a1,0x92));var _0x155a=function(_0x560917,_0x5882dc){_0x560917=_0x560917-0x0;var _0x269caf=_0x55a1[_0x560917];return _0x269caf;};'use strict';var EventEmitter=require(_0x155a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x155a('0x1'))['db'][_0x155a('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x155a('0x3')](0x0);var events={'afterCreate':_0x155a('0x4'),'afterUpdate':_0x155a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12d6ef){return function(_0x190a09,_0x26b27d,_0x3a1380){_0x190a09[_0x155a('0x6')]({'attributes':['id'],'raw':!![]})[_0x155a('0x7')](function(_0x4c63e2){_0x190a09['setDataValue'](_0x155a('0x8'),_0x4c63e2[_0x155a('0x9')](function(_0x533ecd){return{'id':_0x533ecd['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x190a09['id'],'direction':'in','read':![]},'raw':!![]});})[_0x155a('0x7')](function(_0xb3d4d1){_0x190a09[_0x155a('0xa')](_0x155a('0xb'),_0xb3d4d1[_0x155a('0xc')]);OpenchannelInteractionEvents['emit'](_0x12d6ef+':'+_0x190a09['id'],_0x190a09);OpenchannelInteractionEvents[_0x155a('0xd')](_0x12d6ef,_0x190a09);_0x3a1380(null);})[_0x155a('0xe')](_0x3a1380(null));};}for(var e in events){if(events[_0x155a('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x97e3=['save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x4c27f8,_0x2963eb){var _0x4be9c5=function(_0x551010){while(--_0x551010){_0x4c27f8['push'](_0x4c27f8['shift']());}};_0x4be9c5(++_0x2963eb);}(_0x97e3,0xd9));var _0x397e=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x97e3[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0x397e('0x0'));var OpenchannelInteraction=require(_0x397e('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x397e('0x1'))['db'][_0x397e('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x397e('0x3')](0x0);var events={'afterCreate':_0x397e('0x4'),'afterUpdate':'update','afterDestroy':_0x397e('0x5')};function emitEvent(_0x9d803a){return function(_0x29b7ce,_0x3c080,_0x28f267){_0x29b7ce[_0x397e('0x6')]({'attributes':['id'],'raw':!![]})[_0x397e('0x7')](function(_0x1b1862){_0x29b7ce[_0x397e('0x8')](_0x397e('0x9'),_0x1b1862[_0x397e('0xa')](function(_0x4e3157){return{'id':_0x4e3157['id']};}));return OpenchannelMessage[_0x397e('0xb')]({'where':{'OpenchannelInteractionId':_0x29b7ce['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x334ffa){_0x29b7ce['setDataValue'](_0x397e('0xc'),_0x334ffa['length']);OpenchannelInteractionEvents[_0x397e('0xd')](_0x9d803a+':'+_0x29b7ce['id'],_0x29b7ce);OpenchannelInteractionEvents[_0x397e('0xd')](_0x9d803a,_0x29b7ce);_0x28f267(null);})[_0x397e('0xe')](_0x28f267(null));};}for(var e in events){if(events[_0x397e('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x397e('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ef3b57e..fcd641b 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 _0x1a47=['util','api','moment','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','changed','closed'];(function(_0x4159f9,_0x25e251){var _0x1e39bc=function(_0x206cce){while(--_0x206cce){_0x4159f9['push'](_0x4159f9['shift']());}};_0x1e39bc(++_0x25e251);}(_0x1a47,0xe4));var _0x71a4=function(_0x43aef8,_0x47c147){_0x43aef8=_0x43aef8-0x0;var _0x191063=_0x1a47[_0x43aef8];return _0x191063;};'use strict';var _=require('lodash');var util=require(_0x71a4('0x0'));var logger=require('../../config/logger')(_0x71a4('0x1'));var moment=require(_0x71a4('0x2'));var BPromise=require(_0x71a4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x71a4('0x4'));var config=require(_0x71a4('0x5'));var attributes=require(_0x71a4('0x6'));module[_0x71a4('0x7')]=function(_0xb1ea16,_0x5463b0){return _0xb1ea16[_0x71a4('0x8')](_0x71a4('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x307632,_0x534c0c,_0x4b12d2){if(_0x307632[_0x71a4('0xa')](_0x71a4('0xb'))){_0x307632['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4b12d2(null,_0x307632);}}});}; \ No newline at end of file +var _0x37f8=['closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','utf8mb4','changed'];(function(_0x19bfe2,_0x1f0b83){var _0x588ca1=function(_0x475cdb){while(--_0x475cdb){_0x19bfe2['push'](_0x19bfe2['shift']());}};_0x588ca1(++_0x1f0b83);}(_0x37f8,0xb3));var _0x837f=function(_0x2de921,_0x5e86a9){_0x2de921=_0x2de921-0x0;var _0x11b551=_0x37f8[_0x2de921];return _0x11b551;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var logger=require(_0x837f('0x1'))(_0x837f('0x2'));var moment=require('moment');var BPromise=require(_0x837f('0x3'));var rp=require(_0x837f('0x4'));var fs=require('fs');var path=require(_0x837f('0x5'));var rimraf=require(_0x837f('0x6'));var config=require(_0x837f('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x837f('0x8')]=function(_0x16929c,_0x27db0f){return _0x16929c[_0x837f('0x9')](_0x837f('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x837f('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x12784e,_0x1ac89c,_0x5a94d4){if(_0x12784e[_0x837f('0xc')](_0x837f('0xd'))){_0x12784e['closedAt']=moment()[_0x837f('0xe')](_0x837f('0xf'));}_0x5a94d4(null,_0x12784e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 36eaf94..22b172f 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 _0x1002=['then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request'];(function(_0x4a5b32,_0x3c44c1){var _0x2a5143=function(_0x4791bf){while(--_0x4791bf){_0x4a5b32['push'](_0x4a5b32['shift']());}};_0x2a5143(++_0x3c44c1);}(_0x1002,0x10f));var _0x2100=function(_0x542dc4,_0x12ebbf){_0x542dc4=_0x542dc4-0x0;var _0xb6b802=_0x1002[_0x542dc4];return _0xb6b802;};'use strict';var _=require(_0x2100('0x0'));var util=require(_0x2100('0x1'));var moment=require(_0x2100('0x2'));var BPromise=require(_0x2100('0x3'));var rs=require(_0x2100('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2100('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2100('0x6'))(_0x2100('0x7'));var config=require(_0x2100('0x8'));var jayson=require(_0x2100('0x9'));var client=jayson[_0x2100('0xa')][_0x2100('0xb')]({'port':0x232a});config[_0x2100('0xc')]=_['defaults'](config[_0x2100('0xc')],{'host':_0x2100('0xd'),'port':0x18eb});var socket=require(_0x2100('0xe'))(new Redis(config[_0x2100('0xc')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5e97b1,_0x29c68c,_0x172143){return new BPromise(function(_0xefcee4,_0x3866c6){return client[_0x2100('0xf')](_0x5e97b1,_0x172143)[_0x2100('0x10')](function(_0x86750f){logger['info'](_0x2100('0x11'),_0x29c68c,'request\x20sent');logger[_0x2100('0x12')](_0x2100('0x13'),_0x29c68c,_0x2100('0x14'),JSON[_0x2100('0x15')](_0x86750f));if(_0x86750f[_0x2100('0x16')]){if(_0x86750f['error'][_0x2100('0x17')]===0x1f4){logger[_0x2100('0x16')](_0x2100('0x11'),_0x29c68c,_0x86750f[_0x2100('0x16')]['message']);return _0x3866c6(_0x86750f[_0x2100('0x16')][_0x2100('0x18')]);}logger[_0x2100('0x16')](_0x2100('0x11'),_0x29c68c,_0x86750f[_0x2100('0x16')][_0x2100('0x18')]);return _0xefcee4(_0x86750f[_0x2100('0x16')]['message']);}else{logger[_0x2100('0x19')](_0x2100('0x11'),_0x29c68c,_0x2100('0x14'));_0xefcee4(_0x86750f[_0x2100('0x1a')][_0x2100('0x18')]);}})[_0x2100('0x1b')](function(_0x5e3f04){logger[_0x2100('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x29c68c,_0x5e3f04);_0x3866c6(_0x5e3f04);});});}exports[_0x2100('0x1c')]=function(_0x44e0fa){var _0x571037=this;return new Promise(function(_0x24100b,_0x2cf851){return db[_0x2100('0x1d')]['update'](_0x44e0fa[_0x2100('0x1e')],{'raw':_0x44e0fa[_0x2100('0x1f')]?_0x44e0fa[_0x2100('0x1f')][_0x2100('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44e0fa[_0x2100('0x1f')]?_0x44e0fa[_0x2100('0x1f')][_0x2100('0x21')]||null:null,'attributes':_0x44e0fa[_0x2100('0x1f')]?_0x44e0fa['options'][_0x2100('0x22')]||null:null,'limit':_0x44e0fa['options']?_0x44e0fa['options'][_0x2100('0x23')]||null:null})[_0x2100('0x10')](function(_0x3964f8){logger[_0x2100('0x19')](_0x2100('0x1c'),_0x44e0fa);logger[_0x2100('0x12')](_0x2100('0x1c'),_0x44e0fa,JSON[_0x2100('0x15')](_0x3964f8));_0x24100b(_0x3964f8);})[_0x2100('0x1b')](function(_0xe63c6c){logger[_0x2100('0x16')]('UpdateOpenchannelInteraction',_0xe63c6c[_0x2100('0x18')],_0x44e0fa);_0x2cf851(_0x571037['error'](0x1f4,_0xe63c6c[_0x2100('0x18')]));});});};exports[_0x2100('0x24')]=function(_0x324471){return new Promise(function(_0x4ab295,_0x42bacd){return db[_0x2100('0x1d')][_0x2100('0x25')]({'where':_0x324471['options']?_0x324471[_0x2100('0x1f')]['where']||null:null})[_0x2100('0x10')](function(_0x4253d3){if(_0x4253d3){return _0x4253d3[_0x2100('0x26')](_0x324471[_0x2100('0x1e')][_0x2100('0x27')],_['omit'](_0x324471['body'],[_0x2100('0x27'),'id'])||{});}})['spread'](function(_0x1d2688){logger[_0x2100('0x19')]('AddTags',_0x324471);logger[_0x2100('0x12')](_0x2100('0x28'),_0x324471,JSON['stringify'](_0x1d2688));_0x4ab295(_0x1d2688);})[_0x2100('0x1b')](function(_0x45e22d){logger[_0x2100('0x16')](_0x2100('0x28'),_0x45e22d[_0x2100('0x18')],_0x324471);_0x42bacd(_this[_0x2100('0x16')](0x1f4,_0x45e22d['message']));});});}; \ No newline at end of file +var _0xe1a1=['addTags','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','OpenchannelInteraction','update','body','options','where','limit','catch','UpdateOpenchannelInteraction','find'];(function(_0x496e4f,_0x104d74){var _0x1899e0=function(_0x3b67c6){while(--_0x3b67c6){_0x496e4f['push'](_0x496e4f['shift']());}};_0x1899e0(++_0x104d74);}(_0xe1a1,0x11c));var _0x1e1a=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xe1a1[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x1e1a('0x0'));var util=require(_0x1e1a('0x1'));var moment=require(_0x1e1a('0x2'));var BPromise=require(_0x1e1a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e1a('0x4'));var db=require(_0x1e1a('0x5'))['db'];var utils=require(_0x1e1a('0x6'));var logger=require(_0x1e1a('0x7'))(_0x1e1a('0x8'));var config=require(_0x1e1a('0x9'));var jayson=require(_0x1e1a('0xa'));var client=jayson[_0x1e1a('0xb')][_0x1e1a('0xc')]({'port':0x232a});config[_0x1e1a('0xd')]=_[_0x1e1a('0xe')](config[_0x1e1a('0xd')],{'host':_0x1e1a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x1e1a('0x10')](socket);function respondWithRpcPromise(_0x414015,_0x38010f,_0x3b6fae){return new BPromise(function(_0x2ac799,_0x2687d9){return client['request'](_0x414015,_0x3b6fae)[_0x1e1a('0x11')](function(_0x3b5b0d){logger[_0x1e1a('0x12')](_0x1e1a('0x13'),_0x38010f,_0x1e1a('0x14'));logger[_0x1e1a('0x15')](_0x1e1a('0x16'),_0x38010f,_0x1e1a('0x14'),JSON[_0x1e1a('0x17')](_0x3b5b0d));if(_0x3b5b0d[_0x1e1a('0x18')]){if(_0x3b5b0d[_0x1e1a('0x18')]['code']===0x1f4){logger[_0x1e1a('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x38010f,_0x3b5b0d[_0x1e1a('0x18')]['message']);return _0x2687d9(_0x3b5b0d[_0x1e1a('0x18')][_0x1e1a('0x19')]);}logger[_0x1e1a('0x18')](_0x1e1a('0x13'),_0x38010f,_0x3b5b0d[_0x1e1a('0x18')][_0x1e1a('0x19')]);return _0x2ac799(_0x3b5b0d[_0x1e1a('0x18')][_0x1e1a('0x19')]);}else{logger['info'](_0x1e1a('0x13'),_0x38010f,_0x1e1a('0x14'));_0x2ac799(_0x3b5b0d[_0x1e1a('0x1a')]['message']);}})['catch'](function(_0x479052){logger[_0x1e1a('0x18')](_0x1e1a('0x13'),_0x38010f,_0x479052);_0x2687d9(_0x479052);});});}exports['UpdateOpenchannelInteraction']=function(_0x4ba230){var _0x5384c2=this;return new Promise(function(_0x343162,_0x43cbde){return db[_0x1e1a('0x1b')][_0x1e1a('0x1c')](_0x4ba230[_0x1e1a('0x1d')],{'raw':_0x4ba230[_0x1e1a('0x1e')]?_0x4ba230['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ba230[_0x1e1a('0x1e')]?_0x4ba230[_0x1e1a('0x1e')][_0x1e1a('0x1f')]||null:null,'attributes':_0x4ba230['options']?_0x4ba230[_0x1e1a('0x1e')]['attributes']||null:null,'limit':_0x4ba230['options']?_0x4ba230['options'][_0x1e1a('0x20')]||null:null})[_0x1e1a('0x11')](function(_0x3c0203){logger[_0x1e1a('0x12')]('UpdateOpenchannelInteraction',_0x4ba230);logger[_0x1e1a('0x15')]('UpdateOpenchannelInteraction',_0x4ba230,JSON[_0x1e1a('0x17')](_0x3c0203));_0x343162(_0x3c0203);})[_0x1e1a('0x21')](function(_0x380769){logger[_0x1e1a('0x18')](_0x1e1a('0x22'),_0x380769[_0x1e1a('0x19')],_0x4ba230);_0x43cbde(_0x5384c2['error'](0x1f4,_0x380769[_0x1e1a('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x3ea9c4){return new Promise(function(_0x42d138,_0x26dcbd){return db[_0x1e1a('0x1b')][_0x1e1a('0x23')]({'where':_0x3ea9c4[_0x1e1a('0x1e')]?_0x3ea9c4[_0x1e1a('0x1e')]['where']||null:null})['then'](function(_0x1597b5){if(_0x1597b5){return _0x1597b5[_0x1e1a('0x24')](_0x3ea9c4[_0x1e1a('0x1d')]['ids'],_[_0x1e1a('0x25')](_0x3ea9c4['body'],['ids','id'])||{});}})[_0x1e1a('0x26')](function(_0x49c4b6){logger[_0x1e1a('0x12')](_0x1e1a('0x27'),_0x3ea9c4);logger[_0x1e1a('0x15')](_0x1e1a('0x27'),_0x3ea9c4,JSON['stringify'](_0x49c4b6));_0x42d138(_0x49c4b6);})[_0x1e1a('0x21')](function(_0x2e89d0){logger[_0x1e1a('0x18')](_0x1e1a('0x27'),_0x2e89d0[_0x1e1a('0x19')],_0x3ea9c4);_0x26dcbd(_this[_0x1e1a('0x18')](0x1f4,_0x2e89d0[_0x1e1a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0cc329e..6813dc2 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 _0x1d4b=['length','./openchannelInteraction.events','save','update'];(function(_0x2d8f19,_0x390572){var _0x1adf43=function(_0x5eea7d){while(--_0x5eea7d){_0x2d8f19['push'](_0x2d8f19['shift']());}};_0x1adf43(++_0x390572);}(_0x1d4b,0x1d1));var _0xb1d4=function(_0x327dc3,_0x3e78d2){_0x327dc3=_0x327dc3-0x0;var _0x599437=_0x1d4b[_0x327dc3];return _0x599437;};'use strict';var OpenchannelInteractionEvents=require(_0xb1d4('0x0'));var events=[_0xb1d4('0x1'),'remove',_0xb1d4('0x2')];function createListener(_0x2e82bd,_0x77a4b2){return function(_0xe6fd32){_0x77a4b2['emit'](_0x2e82bd,_0xe6fd32);};}function removeListener(_0x141528,_0x34b69c){return function(){OpenchannelInteractionEvents['removeListener'](_0x141528,_0x34b69c);};}exports['register']=function(_0x89abdd){for(var _0xb62af7=0x0,_0x4fa912=events[_0xb1d4('0x3')];_0xb62af7<_0x4fa912;_0xb62af7++){var _0x4a0a35=events[_0xb62af7];var _0x5181e3=createListener('openchannelInteraction:'+_0x4a0a35,_0x89abdd);OpenchannelInteractionEvents['on'](_0x4a0a35,_0x5181e3);}}; \ No newline at end of file +var _0x02e4=['register','length','openchannelInteraction:','save','update','emit','removeListener'];(function(_0x47bbf7,_0x128376){var _0x5e1c19=function(_0xcd2c94){while(--_0xcd2c94){_0x47bbf7['push'](_0x47bbf7['shift']());}};_0x5e1c19(++_0x128376);}(_0x02e4,0xf1));var _0x402e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x02e4[_0x2c91e9];return _0x13f0ff;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x402e('0x0'),'remove',_0x402e('0x1')];function createListener(_0x283b50,_0x2225c7){return function(_0x1ecceb){_0x2225c7[_0x402e('0x2')](_0x283b50,_0x1ecceb);};}function removeListener(_0x5729fe,_0x4fd2b3){return function(){OpenchannelInteractionEvents[_0x402e('0x3')](_0x5729fe,_0x4fd2b3);};}exports[_0x402e('0x4')]=function(_0x27c249){for(var _0x59c4cb=0x0,_0x3fdb20=events[_0x402e('0x5')];_0x59c4cb<_0x3fdb20;_0x59c4cb++){var _0x89fab7=events[_0x59c4cb];var _0x238157=createListener(_0x402e('0x6')+_0x89fab7,_0x27c249);OpenchannelInteractionEvents['on'](_0x89fab7,_0x238157);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8717093..fc5777b 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x14b500,_0x564388){var _0x2be39f=function(_0x1d9445){while(--_0x1d9445){_0x14b500['push'](_0x14b500['shift']());}};_0x2be39f(++_0x564388);}(_0xe706,0xa3));var _0x6e70=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0xe706[_0x537bcd];return _0x6cc881;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x413961,_0x5f6898){var _0x4e5801=function(_0x401808){while(--_0x401808){_0x413961['push'](_0x413961['shift']());}};_0x4e5801(++_0x5f6898);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index be110ff..1e40a77 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 _0xdc91=['exports','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x1704d5,_0x1f1740){var _0x58b71d=function(_0x252c42){while(--_0x252c42){_0x1704d5['push'](_0x1704d5['shift']());}};_0x58b71d(++_0x1f1740);}(_0xdc91,0x8b));var _0x1dc9=function(_0x53d6f7,_0x125fb9){_0x53d6f7=_0x53d6f7-0x0;var _0x305bcc=_0xdc91[_0x53d6f7];return _0x305bcc;};'use strict';var Sequelize=require(_0x1dc9('0x0'));module[_0x1dc9('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1dc9('0x2')]('in',_0x1dc9('0x3')),'defaultValue':_0x1dc9('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1dc9('0x4')]},'providerName':{'type':Sequelize[_0x1dc9('0x5')]},'providerResponse':{'type':Sequelize[_0x1dc9('0x6')]}}; \ No newline at end of file +var _0x1b0e=['TEXT','medium','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x1b0e,0x132));var _0xe1b0=function(_0x42cede,_0x53a6f1){_0x42cede=_0x42cede-0x0;var _0x202a74=_0x1b0e[_0x42cede];return _0x202a74;};'use strict';var Sequelize=require(_0xe1b0('0x0'));module[_0xe1b0('0x1')]={'body':{'type':Sequelize[_0xe1b0('0x2')](_0xe1b0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xe1b0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe1b0('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe1b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 244c09f..f05581d 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 _0xb0d7=['merge','filter','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','accept','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','openchannel-interactions','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','contact','rejectmessage','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1b8d02,_0x5c17c9){var _0x50c726=function(_0x9426ff){while(--_0x9426ff){_0x1b8d02['push'](_0x1b8d02['shift']());}};_0x50c726(++_0x5c17c9);}(_0xb0d7,0xb0));var _0x7b0d=function(_0x53de58,_0xa52e8){_0x53de58=_0x53de58-0x0;var _0x338183=_0xb0d7[_0x53de58];return _0x338183;};'use strict';var emlformat=require(_0x7b0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b0d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b0d('0x2'));var moment=require('moment');var BPromise=require(_0x7b0d('0x3'));var Mustache=require(_0x7b0d('0x4'));var util=require(_0x7b0d('0x5'));var path=require(_0x7b0d('0x6'));var sox=require(_0x7b0d('0x7'));var csv=require(_0x7b0d('0x8'));var ejs=require(_0x7b0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b0d('0xa'));var squel=require(_0x7b0d('0xb'));var crypto=require(_0x7b0d('0xc'));var jsforce=require(_0x7b0d('0xd'));var deskjs=require(_0x7b0d('0xe'));var toCsv=require(_0x7b0d('0x8'));var querystring=require('querystring');var Papa=require(_0x7b0d('0xf'));var Redis=require(_0x7b0d('0x10'));var authService=require(_0x7b0d('0x11'));var qs=require(_0x7b0d('0x12'));var as=require(_0x7b0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b0d('0x14'))(_0x7b0d('0x15'));var utils=require('../../config/utils');var config=require(_0x7b0d('0x16'));var licenseUtil=require(_0x7b0d('0x17'));var db=require('../../mysqldb')['db'];config[_0x7b0d('0x18')]=_[_0x7b0d('0x19')](config[_0x7b0d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b0d('0x1a'))(new Redis(config['redis']));require(_0x7b0d('0x1b'))[_0x7b0d('0x1c')](socket);var jayson=require(_0x7b0d('0x1d'));var client=jayson[_0x7b0d('0x1e')][_0x7b0d('0x1f')]({'port':0x232c});var client9002=jayson[_0x7b0d('0x1e')][_0x7b0d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2812c7,_0x4a60e9,_0x3964d4,_0x42db90){return new BPromise(function(_0x8e7ad,_0x5549a1){var _0x42808a=_0x42db90||client;return _0x42808a[_0x7b0d('0x20')](_0x2812c7,_0x3964d4)[_0x7b0d('0x21')](function(_0x1bfef8){logger[_0x7b0d('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a60e9,_0x7b0d('0x23'));logger['debug'](_0x7b0d('0x24'),_0x4a60e9,'request\x20sent',JSON['stringify'](_0x1bfef8));if(_0x1bfef8['error']){if(_0x1bfef8[_0x7b0d('0x25')][_0x7b0d('0x26')]===0x1f4){logger[_0x7b0d('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a60e9,_0x1bfef8[_0x7b0d('0x25')][_0x7b0d('0x27')]);return _0x5549a1(_0x1bfef8[_0x7b0d('0x25')]['message']);}logger[_0x7b0d('0x25')](_0x7b0d('0x28'),_0x4a60e9,_0x1bfef8[_0x7b0d('0x25')][_0x7b0d('0x27')]);return _0x8e7ad(_0x1bfef8[_0x7b0d('0x25')]['message']);}else{logger[_0x7b0d('0x22')](_0x7b0d('0x28'),_0x4a60e9,'request\x20sent');_0x8e7ad(_0x1bfef8[_0x7b0d('0x29')]['message']);}})['catch'](function(_0xc474d8){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x4a60e9,_0xc474d8);_0x5549a1(_0xc474d8);});});}function respondWithStatusCode(_0x20390b,_0x21dce7){_0x21dce7=_0x21dce7||0xcc;return function(_0x2d3a98){if(_0x2d3a98){return _0x20390b['sendStatus'](_0x21dce7);}return _0x20390b[_0x7b0d('0x2a')](_0x21dce7)[_0x7b0d('0x2b')]();};}function respondWithResult(_0xb4d269,_0x8f0fb5){_0x8f0fb5=_0x8f0fb5||0xc8;return function(_0x28988a){if(_0x28988a){return _0xb4d269[_0x7b0d('0x2a')](_0x8f0fb5)[_0x7b0d('0x2c')](_0x28988a);}};}function respondWithFilteredResult(_0x4a0870,_0x396b36){return function(_0x567b87){if(_0x567b87){var _0x5210d6=typeof _0x396b36[_0x7b0d('0x2d')]==='undefined'&&typeof _0x396b36[_0x7b0d('0x2e')]==='undefined';var _0x388836=_0x567b87['count'];var _0x104ab3=_0x5210d6?0x0:_0x396b36[_0x7b0d('0x2d')];var _0x155869=_0x5210d6?_0x567b87[_0x7b0d('0x2f')]:_0x396b36[_0x7b0d('0x2d')]+_0x396b36[_0x7b0d('0x2e')];var _0x15a377;if(_0x155869>=_0x388836){_0x155869=_0x388836;_0x15a377=0xc8;}else{_0x15a377=0xce;}_0x4a0870[_0x7b0d('0x2a')](_0x15a377);return _0x4a0870[_0x7b0d('0x30')](_0x7b0d('0x31'),_0x104ab3+'-'+_0x155869+'/'+_0x388836)['json'](_0x567b87);}return null;};}function patchUpdates(_0x279118){return function(_0x1bebd9){try{jsonpatch['apply'](_0x1bebd9,_0x279118,!![]);}catch(_0x5641ee){return BPromise[_0x7b0d('0x32')](_0x5641ee);}return _0x1bebd9[_0x7b0d('0x33')]();};}function saveUpdates(_0x38bba5,_0x4d0e47){return function(_0x22d31f){if(_0x22d31f){return _0x22d31f[_0x7b0d('0x34')](_0x38bba5)['then'](function(_0x292b68){return _0x292b68;});}return null;};}function removeEntity(_0x3e6929,_0x5a9a98){return function(_0x20bf13){if(_0x20bf13){return _0x20bf13['destroy']()[_0x7b0d('0x21')](function(){_0x3e6929['status'](0xcc)[_0x7b0d('0x2b')]();});}};}function handleEntityNotFound(_0xd375c,_0x11e7f0){return function(_0x29d0cd){if(!_0x29d0cd){_0xd375c['sendStatus'](0x194);}return _0x29d0cd;};}function handleError(_0x189c23,_0x243a04){_0x243a04=_0x243a04||0x1f4;return function(_0x22366e){logger[_0x7b0d('0x25')](_0x22366e['stack']);if(_0x22366e[_0x7b0d('0x35')]){delete _0x22366e[_0x7b0d('0x35')];}_0x189c23[_0x7b0d('0x2a')](_0x243a04)[_0x7b0d('0x36')](_0x22366e);};}exports['index']=function(_0x9bffe4,_0x1f28be){var _0x411391={},_0x530c1b={},_0x2d1513={'count':0x0,'rows':[]};var _0x344812=_[_0x7b0d('0x37')](db[_0x7b0d('0x38')][_0x7b0d('0x39')],function(_0x145ee6){return{'name':_0x145ee6[_0x7b0d('0x3a')],'type':_0x145ee6[_0x7b0d('0x3b')]['key']};});_0x530c1b[_0x7b0d('0x3c')]=_['map'](_0x344812,_0x7b0d('0x35'));_0x530c1b['query']=_[_0x7b0d('0x3d')](_0x9bffe4[_0x7b0d('0x3e')]);_0x530c1b[_0x7b0d('0x3f')]=_[_0x7b0d('0x40')](_0x530c1b['model'],_0x530c1b[_0x7b0d('0x3e')]);_0x411391['attributes']=_['intersection'](_0x530c1b[_0x7b0d('0x3c')],qs[_0x7b0d('0x41')](_0x9bffe4[_0x7b0d('0x3e')]['fields']));_0x411391[_0x7b0d('0x42')]=_0x411391['attributes'][_0x7b0d('0x43')]?_0x411391['attributes']:_0x530c1b[_0x7b0d('0x3c')];if(!_0x9bffe4[_0x7b0d('0x3e')][_0x7b0d('0x44')](_0x7b0d('0x45'))){_0x411391[_0x7b0d('0x2e')]=qs[_0x7b0d('0x2e')](_0x9bffe4[_0x7b0d('0x3e')]['limit']);_0x411391[_0x7b0d('0x2d')]=qs[_0x7b0d('0x2d')](_0x9bffe4[_0x7b0d('0x3e')]['offset']);}_0x411391[_0x7b0d('0x46')]=qs[_0x7b0d('0x47')](_0x9bffe4[_0x7b0d('0x3e')][_0x7b0d('0x47')]);_0x411391[_0x7b0d('0x48')]=qs['filters'](_[_0x7b0d('0x49')](_0x9bffe4['query'],_0x530c1b[_0x7b0d('0x3f')]),_0x344812);if(_0x9bffe4[_0x7b0d('0x3e')]['filter']){_0x411391[_0x7b0d('0x48')]=_[_0x7b0d('0x4a')](_0x411391[_0x7b0d('0x48')],{'$or':_[_0x7b0d('0x37')](_0x344812,function(_0x3cd3b5){if(_0x3cd3b5[_0x7b0d('0x3b')]!=='VIRTUAL'){var _0x25b04e={};_0x25b04e[_0x3cd3b5[_0x7b0d('0x35')]]={'$like':'%'+_0x9bffe4[_0x7b0d('0x3e')][_0x7b0d('0x4b')]+'%'};return _0x25b04e;}})});}_0x411391=_[_0x7b0d('0x4a')]({},_0x411391,_0x9bffe4['options']);var _0x5d698d={'where':_0x411391[_0x7b0d('0x48')]};return db[_0x7b0d('0x38')][_0x7b0d('0x2f')](_0x5d698d)['then'](function(_0x3273bf){_0x2d1513[_0x7b0d('0x2f')]=_0x3273bf;if(_0x9bffe4[_0x7b0d('0x3e')][_0x7b0d('0x4c')]){_0x411391[_0x7b0d('0x4d')]=[{'all':!![]}];}return db[_0x7b0d('0x38')]['findAll'](_0x411391);})[_0x7b0d('0x21')](function(_0x3f2334){_0x2d1513[_0x7b0d('0x4e')]=_0x3f2334;return _0x2d1513;})[_0x7b0d('0x21')](respondWithFilteredResult(_0x1f28be,_0x411391))[_0x7b0d('0x4f')](handleError(_0x1f28be,null));};exports[_0x7b0d('0x50')]=function(_0x57cdde,_0x7b7348){var _0x494a6f={'raw':!![],'where':{'id':_0x57cdde[_0x7b0d('0x51')]['id']}},_0x577037={};_0x577037[_0x7b0d('0x3c')]=_['keys'](db[_0x7b0d('0x38')][_0x7b0d('0x39')]);_0x577037[_0x7b0d('0x3e')]=_[_0x7b0d('0x3d')](_0x57cdde[_0x7b0d('0x3e')]);_0x577037[_0x7b0d('0x3f')]=_[_0x7b0d('0x40')](_0x577037[_0x7b0d('0x3c')],_0x577037['query']);_0x494a6f[_0x7b0d('0x42')]=_['intersection'](_0x577037['model'],qs[_0x7b0d('0x41')](_0x57cdde[_0x7b0d('0x3e')][_0x7b0d('0x41')]));_0x494a6f[_0x7b0d('0x42')]=_0x494a6f[_0x7b0d('0x42')][_0x7b0d('0x43')]?_0x494a6f[_0x7b0d('0x42')]:_0x577037[_0x7b0d('0x3c')];if(_0x57cdde['query'][_0x7b0d('0x4c')]){_0x494a6f['include']=[{'all':!![]}];}_0x494a6f=_['merge']({},_0x494a6f,_0x57cdde['options']);return db[_0x7b0d('0x38')][_0x7b0d('0x52')](_0x494a6f)[_0x7b0d('0x21')](handleEntityNotFound(_0x7b7348,null))[_0x7b0d('0x21')](respondWithResult(_0x7b7348,null))[_0x7b0d('0x4f')](handleError(_0x7b7348,null));};exports[_0x7b0d('0x53')]=function(_0x430c90,_0x206044){return db[_0x7b0d('0x38')][_0x7b0d('0x53')](_0x430c90[_0x7b0d('0x54')],{})['then'](respondWithResult(_0x206044,0xc9))[_0x7b0d('0x4f')](handleError(_0x206044,null));};exports[_0x7b0d('0x34')]=function(_0x53018c,_0x4f00ae){if(_0x53018c['body']['id']){delete _0x53018c[_0x7b0d('0x54')]['id'];}return db['OpenchannelMessage'][_0x7b0d('0x52')]({'where':{'id':_0x53018c[_0x7b0d('0x51')]['id']}})[_0x7b0d('0x21')](handleEntityNotFound(_0x4f00ae,null))[_0x7b0d('0x21')](saveUpdates(_0x53018c['body'],null))['then'](respondWithResult(_0x4f00ae,null))[_0x7b0d('0x4f')](handleError(_0x4f00ae,null));};exports[_0x7b0d('0x55')]=function(_0x1c1e98,_0x312425){return db[_0x7b0d('0x38')][_0x7b0d('0x52')]({'where':{'id':_0x1c1e98[_0x7b0d('0x51')]['id']}})[_0x7b0d('0x21')](handleEntityNotFound(_0x312425,null))[_0x7b0d('0x21')](removeEntity(_0x312425,null))[_0x7b0d('0x4f')](handleError(_0x312425,null));};exports[_0x7b0d('0x56')]=function(_0x2b7bff,_0x28dd11){return db['OpenchannelMessage']['describe']()[_0x7b0d('0x21')](respondWithResult(_0x28dd11,null))[_0x7b0d('0x4f')](handleError(_0x28dd11,null));};var interaction_log=require(_0x7b0d('0x14'))('openchannel-interactions');exports[_0x7b0d('0x57')]=function(_0x21cecb,_0x2f4c34,_0x301f7e){var _0x5e53dc={'agent':{},'channel':'openchannel'};if(_0x21cecb[_0x7b0d('0x54')]['id']){delete _0x21cecb[_0x7b0d('0x54')]['id'];}_0x21cecb[_0x7b0d('0x54')][_0x7b0d('0x58')]=!![];_0x21cecb['body'][_0x7b0d('0x59')]=moment()[_0x7b0d('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x21cecb[_0x7b0d('0x54')][_0x7b0d('0x5b')]=_0x21cecb[_0x7b0d('0x54')][_0x7b0d('0x5b')]||_0x21cecb[_0x7b0d('0x5c')]['id'];_0x5e53dc[_0x7b0d('0x5d')]['id']=_0x21cecb[_0x7b0d('0x54')][_0x7b0d('0x5b')];return db[_0x7b0d('0x38')]['find']({'where':{'id':_0x21cecb[_0x7b0d('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f4c34,null))['then'](saveUpdates(_0x21cecb[_0x7b0d('0x54')],null))[_0x7b0d('0x21')](function(_0x226032){if(_0x226032){_0x5e53dc[_0x7b0d('0x27')]=_0x226032[_0x7b0d('0x5e')]({'plain':!![]});return db[_0x7b0d('0x5f')][_0x7b0d('0x52')]({'where':{'id':_0x226032[_0x7b0d('0x60')]}});}return null;})[_0x7b0d('0x21')](handleEntityNotFound(_0x2f4c34,null))[_0x7b0d('0x21')](function(_0x5a26ab){if(_0x5a26ab){return _0x5a26ab[_0x7b0d('0x34')]({'UserId':_0x21cecb[_0x7b0d('0x54')][_0x7b0d('0x5b')],'read1stAt':_[_0x7b0d('0x61')](_0x5a26ab[_0x7b0d('0x62')])?moment()[_0x7b0d('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7b0d('0x21')](function(_0x43c740){if(_0x43c740){_0x5e53dc[_0x7b0d('0x63')]=_0x43c740[_0x7b0d('0x5e')]({'plain':!![]});interaction_log[_0x7b0d('0x22')](_0x7b0d('0x64'),_0x21cecb[_0x7b0d('0x5c')]['id'],_0x21cecb[_0x7b0d('0x5c')][_0x7b0d('0x35')],_0x21cecb[_0x7b0d('0x5c')]['role'],_0x5e53dc['interaction']['id'],_0x21cecb[_0x7b0d('0x54')]?JSON[_0x7b0d('0x65')](_0x21cecb[_0x7b0d('0x54')]):_0x7b0d('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5e53dc);}return null;})[_0x7b0d('0x21')](function(_0x44e9f4){var _0x5bd9c7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44e9f4[_0x7b0d('0x27')][_0x7b0d('0x67')];return db['sequelize'][_0x7b0d('0x3e')](_0x5bd9c7,{'type':db[_0x7b0d('0x68')][_0x7b0d('0x69')][_0x7b0d('0x6a')],'raw':!![]})['then'](function(_0x2918d0){return _0x2918d0;});})[_0x7b0d('0x21')](function(_0xd6ad76){if(_0xd6ad76){_0x5e53dc[_0x7b0d('0x27')]['contact']=_0xd6ad76[0x0];if(!_0x21cecb['body'][_0x7b0d('0x5b')])return;return db[_0x7b0d('0x6b')][_0x7b0d('0x52')]({'where':{'id':_0x21cecb[_0x7b0d('0x54')]['UserId'],'role':_0x7b0d('0x5d')},'attributes':['id',_0x7b0d('0x35'),_0x7b0d('0x6c'),'email',_0x7b0d('0x6d')],'raw':!![]});}return null;})[_0x7b0d('0x21')](function(_0x3b76c1){if(!_0x3b76c1)return null;_0x5e53dc['message'][_0x7b0d('0x5d')]=_0x3b76c1;return _0x5e53dc;})[_0x7b0d('0x21')](function(_0x58c105){if(_0x58c105){if(_0x21cecb[_0x7b0d('0x54')][_0x7b0d('0x6e')]){_0x5e53dc[_0x7b0d('0x27')][_0x7b0d('0x6f')]=util[_0x7b0d('0x5a')](_0x7b0d('0x70'),_0x21cecb[_0x7b0d('0x5c')][_0x7b0d('0x35')]);_0x5e53dc[_0x7b0d('0x27')][_0x7b0d('0x71')]=_0x5e53dc[_0x7b0d('0x71')];_0x5e53dc[_0x7b0d('0x27')][_0x7b0d('0x72')]=_0x5e53dc[_0x7b0d('0x71')];_0x5e53dc[_0x7b0d('0x27')][_0x7b0d('0x73')]='accept';return respondWithRpcPromise(_0x7b0d('0x74'),_0x7b0d('0x74'),{'event':'acceptmessage','message':_0x5e53dc[_0x7b0d('0x27')]},client9002)['then'](function(){return _0x5e53dc;});}return _0x5e53dc;}return null;})[_0x7b0d('0x21')](respondWithResult(_0x2f4c34,null))['catch'](handleError(_0x2f4c34,null));};var interaction_log=require('../../config/logger')(_0x7b0d('0x75'));exports[_0x7b0d('0x32')]=function(_0x5d8add,_0x4cfba1,_0x4f58a4){var _0x1152f2={'agent':{},'channel':_0x7b0d('0x76')};if(_0x5d8add[_0x7b0d('0x54')]['id']){delete _0x5d8add[_0x7b0d('0x54')]['id'];}_0x5d8add['body'][_0x7b0d('0x5b')]=_0x5d8add[_0x7b0d('0x54')][_0x7b0d('0x5b')]||_0x5d8add[_0x7b0d('0x5c')]['id'];_0x1152f2[_0x7b0d('0x5d')]['id']=_0x5d8add[_0x7b0d('0x54')][_0x7b0d('0x5b')];return db[_0x7b0d('0x38')][_0x7b0d('0x52')]({'where':{'id':_0x5d8add['params']['id'],'UserId':null}})[_0x7b0d('0x21')](handleEntityNotFound(_0x4cfba1,null))[_0x7b0d('0x21')](function(_0x11b20c){if(_0x11b20c){_0x1152f2[_0x7b0d('0x27')]=_0x11b20c[_0x7b0d('0x5e')]({'plain':!![]});return db[_0x7b0d('0x5f')][_0x7b0d('0x52')]({'where':{'id':_0x11b20c[_0x7b0d('0x60')]}});}return null;})[_0x7b0d('0x21')](handleEntityNotFound(_0x4cfba1,null))['then'](function(_0x4f2a42){if(_0x4f2a42){_0x1152f2['interaction']=_0x4f2a42['get']({'plain':!![]});interaction_log['info'](_0x7b0d('0x77'),_0x5d8add['user']['id'],_0x5d8add[_0x7b0d('0x5c')][_0x7b0d('0x35')],_0x5d8add[_0x7b0d('0x5c')]['role'],_0x1152f2[_0x7b0d('0x63')]['id'],_0x5d8add[_0x7b0d('0x54')]?JSON[_0x7b0d('0x65')](_0x5d8add['body']):_0x7b0d('0x66'));return respondWithRpcPromise(_0x7b0d('0x78'),_0x7b0d('0x79'),_0x1152f2);}return null;})[_0x7b0d('0x21')](function(_0x3aeb79){var _0x11c0ce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3aeb79[_0x7b0d('0x27')][_0x7b0d('0x67')];return db[_0x7b0d('0x7a')][_0x7b0d('0x3e')](_0x11c0ce,{'type':db[_0x7b0d('0x68')][_0x7b0d('0x69')][_0x7b0d('0x6a')],'raw':!![]})['then'](function(_0x30de84){return _0x30de84;});})[_0x7b0d('0x21')](function(_0x19c7c2){if(_0x19c7c2){_0x1152f2['message'][_0x7b0d('0x7b')]=_0x19c7c2[0x0];if(!_0x5d8add[_0x7b0d('0x54')][_0x7b0d('0x5b')])return;return db[_0x7b0d('0x6b')][_0x7b0d('0x52')]({'where':{'id':_0x5d8add[_0x7b0d('0x54')][_0x7b0d('0x5b')],'role':'agent'},'attributes':['id',_0x7b0d('0x35'),_0x7b0d('0x6c'),'email',_0x7b0d('0x6d')],'raw':!![]});}return null;})[_0x7b0d('0x21')](function(_0x23228b){if(!_0x23228b)return null;_0x1152f2['message']['agent']=_0x23228b;return _0x1152f2;})[_0x7b0d('0x21')](function(_0xdc169e){if(_0xdc169e){_0xdc169e[_0x7b0d('0x27')]['interface']=util[_0x7b0d('0x5a')](_0x7b0d('0x70'),_0x5d8add[_0x7b0d('0x5c')][_0x7b0d('0x35')]);_0xdc169e['message'][_0x7b0d('0x71')]=_0x1152f2[_0x7b0d('0x71')];_0xdc169e[_0x7b0d('0x27')][_0x7b0d('0x72')]=_0x1152f2[_0x7b0d('0x71')];_0xdc169e[_0x7b0d('0x27')]['event']=_0x7b0d('0x32');respondWithRpcPromise(_0x7b0d('0x74'),_0x7b0d('0x74'),{'event':_0x7b0d('0x7c'),'message':_0xdc169e[_0x7b0d('0x27')]},client9002);return _0x1152f2;}return null;})['then'](respondWithResult(_0x4cfba1,null))[_0x7b0d('0x4f')](handleError(_0x4cfba1,null));}; \ No newline at end of file +var _0x5046=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','sendStatus','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','query','keys','filters','model','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','intersection','fields','length','options','find','body','params','describe','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','User','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT','fullname','email','internal','motionChannel','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x5046,0x6d));var _0x6504=function(_0x227829,_0x592438){_0x227829=_0x227829-0x0;var _0x20cb95=_0x5046[_0x227829];return _0x20cb95;};'use strict';var emlformat=require(_0x6504('0x0'));var rimraf=require(_0x6504('0x1'));var zipdir=require(_0x6504('0x2'));var jsonpatch=require(_0x6504('0x3'));var rp=require(_0x6504('0x4'));var moment=require(_0x6504('0x5'));var BPromise=require(_0x6504('0x6'));var Mustache=require(_0x6504('0x7'));var util=require(_0x6504('0x8'));var path=require(_0x6504('0x9'));var sox=require('sox');var csv=require(_0x6504('0xa'));var ejs=require(_0x6504('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6504('0xc'));var crypto=require('crypto');var jsforce=require(_0x6504('0xd'));var deskjs=require(_0x6504('0xe'));var toCsv=require(_0x6504('0xa'));var querystring=require(_0x6504('0xf'));var Papa=require(_0x6504('0x10'));var Redis=require(_0x6504('0x11'));var authService=require(_0x6504('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6504('0x13'));var hardwareService=require(_0x6504('0x14'));var logger=require(_0x6504('0x15'))(_0x6504('0x16'));var utils=require(_0x6504('0x17'));var config=require(_0x6504('0x18'));var licenseUtil=require(_0x6504('0x19'));var db=require(_0x6504('0x1a'))['db'];config['redis']=_['defaults'](config[_0x6504('0x1b')],{'host':_0x6504('0x1c'),'port':0x18eb});var socket=require(_0x6504('0x1d'))(new Redis(config['redis']));require(_0x6504('0x1e'))[_0x6504('0x1f')](socket);var jayson=require(_0x6504('0x20'));var client=jayson[_0x6504('0x21')][_0x6504('0x22')]({'port':0x232c});var client9002=jayson[_0x6504('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d3134,_0x3eda6f,_0xcaf81a,_0x399960){return new BPromise(function(_0xec89fa,_0x42ef7f){var _0x40ecbc=_0x399960||client;return _0x40ecbc['request'](_0x3d3134,_0xcaf81a)[_0x6504('0x23')](function(_0x513159){logger[_0x6504('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3eda6f,_0x6504('0x25'));logger[_0x6504('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3eda6f,_0x6504('0x25'),JSON[_0x6504('0x27')](_0x513159));if(_0x513159[_0x6504('0x28')]){if(_0x513159[_0x6504('0x28')][_0x6504('0x29')]===0x1f4){logger[_0x6504('0x28')](_0x6504('0x2a'),_0x3eda6f,_0x513159['error'][_0x6504('0x2b')]);return _0x42ef7f(_0x513159[_0x6504('0x28')][_0x6504('0x2b')]);}logger[_0x6504('0x28')](_0x6504('0x2a'),_0x3eda6f,_0x513159[_0x6504('0x28')][_0x6504('0x2b')]);return _0xec89fa(_0x513159[_0x6504('0x28')][_0x6504('0x2b')]);}else{logger['info'](_0x6504('0x2a'),_0x3eda6f,_0x6504('0x25'));_0xec89fa(_0x513159[_0x6504('0x2c')][_0x6504('0x2b')]);}})[_0x6504('0x2d')](function(_0x3f8b5c){logger[_0x6504('0x28')](_0x6504('0x2a'),_0x3eda6f,_0x3f8b5c);_0x42ef7f(_0x3f8b5c);});});}function respondWithStatusCode(_0x402a09,_0x310608){_0x310608=_0x310608||0xcc;return function(_0x291942){if(_0x291942){return _0x402a09['sendStatus'](_0x310608);}return _0x402a09[_0x6504('0x2e')](_0x310608)[_0x6504('0x2f')]();};}function respondWithResult(_0x3088f2,_0x31849d){_0x31849d=_0x31849d||0xc8;return function(_0x201eca){if(_0x201eca){return _0x3088f2[_0x6504('0x2e')](_0x31849d)[_0x6504('0x30')](_0x201eca);}};}function respondWithFilteredResult(_0x29f0d1,_0x23b30f){return function(_0x182107){if(_0x182107){var _0x21cb97=typeof _0x23b30f[_0x6504('0x31')]==='undefined'&&typeof _0x23b30f[_0x6504('0x32')]===_0x6504('0x33');var _0x25d8b2=_0x182107['count'];var _0x1e1274=_0x21cb97?0x0:_0x23b30f[_0x6504('0x31')];var _0x57fc43=_0x21cb97?_0x182107[_0x6504('0x34')]:_0x23b30f[_0x6504('0x31')]+_0x23b30f[_0x6504('0x32')];var _0x140856;if(_0x57fc43>=_0x25d8b2){_0x57fc43=_0x25d8b2;_0x140856=0xc8;}else{_0x140856=0xce;}_0x29f0d1['status'](_0x140856);return _0x29f0d1['set'](_0x6504('0x35'),_0x1e1274+'-'+_0x57fc43+'/'+_0x25d8b2)[_0x6504('0x30')](_0x182107);}return null;};}function patchUpdates(_0x16be29){return function(_0x342511){try{jsonpatch[_0x6504('0x36')](_0x342511,_0x16be29,!![]);}catch(_0x30798f){return BPromise[_0x6504('0x37')](_0x30798f);}return _0x342511['save']();};}function saveUpdates(_0x503e86,_0x28f246){return function(_0x40fa26){if(_0x40fa26){return _0x40fa26[_0x6504('0x38')](_0x503e86)['then'](function(_0x3a62e7){return _0x3a62e7;});}return null;};}function removeEntity(_0x2daa07,_0x1f7df4){return function(_0x29ed6c){if(_0x29ed6c){return _0x29ed6c[_0x6504('0x39')]()[_0x6504('0x23')](function(){_0x2daa07[_0x6504('0x2e')](0xcc)[_0x6504('0x2f')]();});}};}function handleEntityNotFound(_0x4a2d61,_0x27172d){return function(_0x4ea2ea){if(!_0x4ea2ea){_0x4a2d61[_0x6504('0x3a')](0x194);}return _0x4ea2ea;};}function handleError(_0x4471ba,_0x5939d4){_0x5939d4=_0x5939d4||0x1f4;return function(_0x2b9417){logger[_0x6504('0x28')](_0x2b9417['stack']);if(_0x2b9417[_0x6504('0x3b')]){delete _0x2b9417['name'];}_0x4471ba['status'](_0x5939d4)[_0x6504('0x3c')](_0x2b9417);};}exports[_0x6504('0x3d')]=function(_0x4809f7,_0x511318){var _0x4972cb={},_0x45eecf={},_0x40cf22={'count':0x0,'rows':[]};var _0x440826=_[_0x6504('0x3e')](db[_0x6504('0x3f')][_0x6504('0x40')],function(_0xc5a6c5){return{'name':_0xc5a6c5[_0x6504('0x41')],'type':_0xc5a6c5['type'][_0x6504('0x42')]};});_0x45eecf['model']=_[_0x6504('0x3e')](_0x440826,_0x6504('0x3b'));_0x45eecf[_0x6504('0x43')]=_[_0x6504('0x44')](_0x4809f7[_0x6504('0x43')]);_0x45eecf[_0x6504('0x45')]=_['intersection'](_0x45eecf[_0x6504('0x46')],_0x45eecf[_0x6504('0x43')]);_0x4972cb[_0x6504('0x47')]=_['intersection'](_0x45eecf[_0x6504('0x46')],qs['fields'](_0x4809f7['query']['fields']));_0x4972cb[_0x6504('0x47')]=_0x4972cb['attributes']['length']?_0x4972cb[_0x6504('0x47')]:_0x45eecf[_0x6504('0x46')];if(!_0x4809f7[_0x6504('0x43')][_0x6504('0x48')](_0x6504('0x49'))){_0x4972cb[_0x6504('0x32')]=qs[_0x6504('0x32')](_0x4809f7[_0x6504('0x43')][_0x6504('0x32')]);_0x4972cb[_0x6504('0x31')]=qs[_0x6504('0x31')](_0x4809f7['query'][_0x6504('0x31')]);}_0x4972cb[_0x6504('0x4a')]=qs[_0x6504('0x4b')](_0x4809f7['query']['sort']);_0x4972cb['where']=qs['filters'](_['pick'](_0x4809f7['query'],_0x45eecf[_0x6504('0x45')]),_0x440826);if(_0x4809f7['query'][_0x6504('0x4c')]){_0x4972cb[_0x6504('0x4d')]=_[_0x6504('0x4e')](_0x4972cb[_0x6504('0x4d')],{'$or':_['map'](_0x440826,function(_0x24b585){if(_0x24b585[_0x6504('0x4f')]!==_0x6504('0x50')){var _0x32a179={};_0x32a179[_0x24b585[_0x6504('0x3b')]]={'$like':'%'+_0x4809f7['query'][_0x6504('0x4c')]+'%'};return _0x32a179;}})});}_0x4972cb=_['merge']({},_0x4972cb,_0x4809f7['options']);var _0x328f19={'where':_0x4972cb['where']};return db['OpenchannelMessage'][_0x6504('0x34')](_0x328f19)[_0x6504('0x23')](function(_0x2fb33b){_0x40cf22[_0x6504('0x34')]=_0x2fb33b;if(_0x4809f7[_0x6504('0x43')][_0x6504('0x51')]){_0x4972cb[_0x6504('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6504('0x53')](_0x4972cb);})[_0x6504('0x23')](function(_0x268b6a){_0x40cf22[_0x6504('0x54')]=_0x268b6a;return _0x40cf22;})['then'](respondWithFilteredResult(_0x511318,_0x4972cb))[_0x6504('0x2d')](handleError(_0x511318,null));};exports[_0x6504('0x55')]=function(_0x2b3392,_0x4fa60e){var _0x27ba9a={'raw':!![],'where':{'id':_0x2b3392['params']['id']}},_0x2b462d={};_0x2b462d['model']=_[_0x6504('0x44')](db[_0x6504('0x3f')][_0x6504('0x40')]);_0x2b462d['query']=_[_0x6504('0x44')](_0x2b3392[_0x6504('0x43')]);_0x2b462d[_0x6504('0x45')]=_[_0x6504('0x56')](_0x2b462d[_0x6504('0x46')],_0x2b462d[_0x6504('0x43')]);_0x27ba9a[_0x6504('0x47')]=_['intersection'](_0x2b462d['model'],qs[_0x6504('0x57')](_0x2b3392[_0x6504('0x43')][_0x6504('0x57')]));_0x27ba9a[_0x6504('0x47')]=_0x27ba9a[_0x6504('0x47')][_0x6504('0x58')]?_0x27ba9a['attributes']:_0x2b462d['model'];if(_0x2b3392[_0x6504('0x43')]['includeAll']){_0x27ba9a[_0x6504('0x52')]=[{'all':!![]}];}_0x27ba9a=_['merge']({},_0x27ba9a,_0x2b3392[_0x6504('0x59')]);return db['OpenchannelMessage'][_0x6504('0x5a')](_0x27ba9a)['then'](handleEntityNotFound(_0x4fa60e,null))[_0x6504('0x23')](respondWithResult(_0x4fa60e,null))[_0x6504('0x2d')](handleError(_0x4fa60e,null));};exports['create']=function(_0x366527,_0x54afac){return db[_0x6504('0x3f')]['create'](_0x366527[_0x6504('0x5b')],{})[_0x6504('0x23')](respondWithResult(_0x54afac,0xc9))[_0x6504('0x2d')](handleError(_0x54afac,null));};exports[_0x6504('0x38')]=function(_0xee89dc,_0x2b1c65){if(_0xee89dc[_0x6504('0x5b')]['id']){delete _0xee89dc[_0x6504('0x5b')]['id'];}return db[_0x6504('0x3f')][_0x6504('0x5a')]({'where':{'id':_0xee89dc[_0x6504('0x5c')]['id']}})[_0x6504('0x23')](handleEntityNotFound(_0x2b1c65,null))[_0x6504('0x23')](saveUpdates(_0xee89dc[_0x6504('0x5b')],null))[_0x6504('0x23')](respondWithResult(_0x2b1c65,null))[_0x6504('0x2d')](handleError(_0x2b1c65,null));};exports['destroy']=function(_0x8a78e4,_0xeb0e13){return db[_0x6504('0x3f')][_0x6504('0x5a')]({'where':{'id':_0x8a78e4['params']['id']}})[_0x6504('0x23')](handleEntityNotFound(_0xeb0e13,null))[_0x6504('0x23')](removeEntity(_0xeb0e13,null))[_0x6504('0x2d')](handleError(_0xeb0e13,null));};exports['describe']=function(_0x23c7cd,_0x2073b0){return db['OpenchannelMessage'][_0x6504('0x5d')]()[_0x6504('0x23')](respondWithResult(_0x2073b0,null))[_0x6504('0x2d')](handleError(_0x2073b0,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x6504('0x5e')]=function(_0x1db268,_0x2480f0,_0x43ce9f){var _0x358391={'agent':{},'channel':_0x6504('0x5f')};if(_0x1db268[_0x6504('0x5b')]['id']){delete _0x1db268['body']['id'];}_0x1db268['body'][_0x6504('0x60')]=!![];_0x1db268['body'][_0x6504('0x61')]=moment()[_0x6504('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1db268[_0x6504('0x5b')][_0x6504('0x63')]=_0x1db268[_0x6504('0x5b')][_0x6504('0x63')]||_0x1db268[_0x6504('0x64')]['id'];_0x358391[_0x6504('0x65')]['id']=_0x1db268[_0x6504('0x5b')][_0x6504('0x63')];return db[_0x6504('0x3f')]['find']({'where':{'id':_0x1db268['params']['id'],'UserId':null}})[_0x6504('0x23')](handleEntityNotFound(_0x2480f0,null))[_0x6504('0x23')](saveUpdates(_0x1db268[_0x6504('0x5b')],null))[_0x6504('0x23')](function(_0x6d2d24){if(_0x6d2d24){_0x358391[_0x6504('0x2b')]=_0x6d2d24[_0x6504('0x66')]({'plain':!![]});return db[_0x6504('0x67')][_0x6504('0x5a')]({'where':{'id':_0x6d2d24[_0x6504('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x2480f0,null))[_0x6504('0x23')](function(_0x1a495a){if(_0x1a495a){return _0x1a495a[_0x6504('0x38')]({'UserId':_0x1db268[_0x6504('0x5b')][_0x6504('0x63')],'read1stAt':_[_0x6504('0x69')](_0x1a495a[_0x6504('0x6a')])?moment()[_0x6504('0x62')](_0x6504('0x6b')):undefined});}return null;})[_0x6504('0x23')](function(_0x59682d){if(_0x59682d){_0x358391[_0x6504('0x6c')]=_0x59682d[_0x6504('0x66')]({'plain':!![]});interaction_log[_0x6504('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1db268[_0x6504('0x64')]['id'],_0x1db268[_0x6504('0x64')][_0x6504('0x3b')],_0x1db268[_0x6504('0x64')][_0x6504('0x6d')],_0x358391[_0x6504('0x6c')]['id'],_0x1db268['body']?JSON[_0x6504('0x27')](_0x1db268[_0x6504('0x5b')]):_0x6504('0x6e'));return respondWithRpcPromise(_0x6504('0x6f'),_0x6504('0x70'),_0x358391);}return null;})[_0x6504('0x23')](function(_0x575f14){var _0x58a0aa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x575f14[_0x6504('0x2b')][_0x6504('0x71')];return db['sequelize'][_0x6504('0x43')](_0x58a0aa,{'type':db[_0x6504('0x72')][_0x6504('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x3e6858){return _0x3e6858;});})[_0x6504('0x23')](function(_0x262d23){if(_0x262d23){_0x358391[_0x6504('0x2b')][_0x6504('0x74')]=_0x262d23[0x0];if(!_0x1db268[_0x6504('0x5b')]['UserId'])return;return db[_0x6504('0x75')]['find']({'where':{'id':_0x1db268[_0x6504('0x5b')][_0x6504('0x63')],'role':'agent'},'attributes':['id',_0x6504('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x1dff1f){if(!_0x1dff1f)return null;_0x358391[_0x6504('0x2b')]['agent']=_0x1dff1f;return _0x358391;})[_0x6504('0x23')](function(_0xf2d206){if(_0xf2d206){if(_0x1db268[_0x6504('0x5b')][_0x6504('0x76')]){_0x358391['message'][_0x6504('0x77')]=util[_0x6504('0x62')](_0x6504('0x78'),_0x1db268['user'][_0x6504('0x3b')]);_0x358391[_0x6504('0x2b')][_0x6504('0x79')]=_0x358391[_0x6504('0x79')];_0x358391[_0x6504('0x2b')]['motionChannel']=_0x358391[_0x6504('0x79')];_0x358391[_0x6504('0x2b')][_0x6504('0x7a')]=_0x6504('0x5e');return respondWithRpcPromise(_0x6504('0x7b'),_0x6504('0x7b'),{'event':_0x6504('0x7c'),'message':_0x358391[_0x6504('0x2b')]},client9002)[_0x6504('0x23')](function(){return _0x358391;});}return _0x358391;}return null;})[_0x6504('0x23')](respondWithResult(_0x2480f0,null))[_0x6504('0x2d')](handleError(_0x2480f0,null));};var interaction_log=require(_0x6504('0x15'))(_0x6504('0x7d'));exports[_0x6504('0x37')]=function(_0x30cfdb,_0xaddeb7,_0x2f513d){var _0x2a58bd={'agent':{},'channel':_0x6504('0x5f')};if(_0x30cfdb['body']['id']){delete _0x30cfdb[_0x6504('0x5b')]['id'];}_0x30cfdb[_0x6504('0x5b')][_0x6504('0x63')]=_0x30cfdb[_0x6504('0x5b')][_0x6504('0x63')]||_0x30cfdb[_0x6504('0x64')]['id'];_0x2a58bd['agent']['id']=_0x30cfdb[_0x6504('0x5b')][_0x6504('0x63')];return db[_0x6504('0x3f')]['find']({'where':{'id':_0x30cfdb['params']['id'],'UserId':null}})[_0x6504('0x23')](handleEntityNotFound(_0xaddeb7,null))[_0x6504('0x23')](function(_0x14230c){if(_0x14230c){_0x2a58bd[_0x6504('0x2b')]=_0x14230c[_0x6504('0x66')]({'plain':!![]});return db[_0x6504('0x67')][_0x6504('0x5a')]({'where':{'id':_0x14230c[_0x6504('0x68')]}});}return null;})['then'](handleEntityNotFound(_0xaddeb7,null))[_0x6504('0x23')](function(_0x18435d){if(_0x18435d){_0x2a58bd['interaction']=_0x18435d[_0x6504('0x66')]({'plain':!![]});interaction_log[_0x6504('0x24')](_0x6504('0x7e'),_0x30cfdb[_0x6504('0x64')]['id'],_0x30cfdb[_0x6504('0x64')][_0x6504('0x3b')],_0x30cfdb[_0x6504('0x64')]['role'],_0x2a58bd['interaction']['id'],_0x30cfdb[_0x6504('0x5b')]?JSON[_0x6504('0x27')](_0x30cfdb[_0x6504('0x5b')]):_0x6504('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2a58bd);}return null;})[_0x6504('0x23')](function(_0x596243){var _0x25ff55='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x596243[_0x6504('0x2b')][_0x6504('0x71')];return db['sequelize'][_0x6504('0x43')](_0x25ff55,{'type':db[_0x6504('0x72')]['QueryTypes'][_0x6504('0x7f')],'raw':!![]})['then'](function(_0x3e5592){return _0x3e5592;});})['then'](function(_0x4d9e09){if(_0x4d9e09){_0x2a58bd['message'][_0x6504('0x74')]=_0x4d9e09[0x0];if(!_0x30cfdb[_0x6504('0x5b')][_0x6504('0x63')])return;return db['User']['find']({'where':{'id':_0x30cfdb[_0x6504('0x5b')][_0x6504('0x63')],'role':'agent'},'attributes':['id',_0x6504('0x3b'),_0x6504('0x80'),_0x6504('0x81'),_0x6504('0x82')],'raw':!![]});}return null;})[_0x6504('0x23')](function(_0x3511ce){if(!_0x3511ce)return null;_0x2a58bd['message'][_0x6504('0x65')]=_0x3511ce;return _0x2a58bd;})[_0x6504('0x23')](function(_0x283bae){if(_0x283bae){_0x283bae['message'][_0x6504('0x77')]=util[_0x6504('0x62')](_0x6504('0x78'),_0x30cfdb['user']['name']);_0x283bae[_0x6504('0x2b')]['channel']=_0x2a58bd[_0x6504('0x79')];_0x283bae[_0x6504('0x2b')][_0x6504('0x83')]=_0x2a58bd[_0x6504('0x79')];_0x283bae[_0x6504('0x2b')][_0x6504('0x7a')]=_0x6504('0x37');respondWithRpcPromise(_0x6504('0x7b'),_0x6504('0x7b'),{'event':'rejectmessage','message':_0x283bae['message']},client9002);return _0x2a58bd;}return null;})[_0x6504('0x23')](respondWithResult(_0xaddeb7,null))['catch'](handleError(_0xaddeb7,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ab1b8c5..3ab5d2d 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 _0xf789=['OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x15724a,_0x4b6ae4){var _0x81d9f3=function(_0x89f141){while(--_0x89f141){_0x15724a['push'](_0x15724a['shift']());}};_0x81d9f3(++_0x4b6ae4);}(_0xf789,0x14b));var _0x9f78=function(_0x156089,_0x41e825){_0x156089=_0x156089-0x0;var _0x3eca36=_0xf789[_0x156089];return _0x3eca36;};'use strict';var EventEmitter=require(_0x9f78('0x0'));var OpenchannelMessage=require(_0x9f78('0x1'))['db'][_0x9f78('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9f78('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f78('0x4'),'afterDestroy':_0x9f78('0x5')};function emitEvent(_0x545667){return function(_0x5211fb,_0x41ebff,_0x26c4bf){OpenchannelMessageEvents[_0x9f78('0x6')](_0x545667+':'+_0x5211fb['id'],_0x5211fb);OpenchannelMessageEvents[_0x9f78('0x6')](_0x545667,_0x5211fb);_0x26c4bf(null);};}for(var e in events){if(events[_0x9f78('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x9f78('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x8dcb=['exports','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4f83ac,_0x2d0a35){var _0x17c4e4=function(_0x1a094a){while(--_0x1a094a){_0x4f83ac['push'](_0x4f83ac['shift']());}};_0x17c4e4(++_0x2d0a35);}(_0x8dcb,0x131));var _0xb8dc=function(_0x5f458c,_0x382344){_0x5f458c=_0x5f458c-0x0;var _0x1f000f=_0x8dcb[_0x5f458c];return _0x1f000f;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb8dc('0x0')](0x0);var events={'afterCreate':_0xb8dc('0x1'),'afterUpdate':_0xb8dc('0x2'),'afterDestroy':_0xb8dc('0x3')};function emitEvent(_0x2c4cc2){return function(_0xeef593,_0x4d1766,_0x58fd0d){OpenchannelMessageEvents['emit'](_0x2c4cc2+':'+_0xeef593['id'],_0xeef593);OpenchannelMessageEvents[_0xb8dc('0x4')](_0x2c4cc2,_0xeef593);_0x58fd0d(null);};}for(var e in events){if(events[_0xb8dc('0x5')](e)){var event=events[e];OpenchannelMessage[_0xb8dc('0x6')](e,emitEvent(event));}}module[_0xb8dc('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 38d471d..c8ffed1 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 _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','direction','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4_unicode_ci'];(function(_0x86c7a2,_0x22cc38){var _0x7d602=function(_0x5a7759){while(--_0x5a7759){_0x86c7a2['push'](_0x86c7a2['shift']());}};_0x7d602(++_0x22cc38);}(_0x8f4c,0x113));var _0xc8f4=function(_0xac1d19,_0x447fa8){_0xac1d19=_0xac1d19-0x0;var _0x1133e0=_0x8f4c[_0xac1d19];return _0x1133e0;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xc')],'type':_0xc8f4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39ed63,_0x34f05f,_0x599de3){var _0x38c41b=_0x5208da[_0xc8f4('0xe')];var _0x2fba62=_0x39ed63[_0xc8f4('0xf')]({'plain':!![]});if(_0x2fba62['direction'][_0xc8f4('0x10')]()==='in'||_0x2fba62['direction'][_0xc8f4('0x10')]()===_0xc8f4('0x11')&&!_0x2fba62[_0xc8f4('0x12')]&&!_[_0xc8f4('0x13')](_0x2fba62[_0xc8f4('0x14')])){_0x38c41b['OpenchannelInteraction'][_0xc8f4('0x15')]({'where':{'id':_0x2fba62[_0xc8f4('0x16')]}})[_0xc8f4('0x17')](function(_0x14bc11){if(_0x14bc11){_0x14bc11[_0xc8f4('0x18')]({'lastMsgAt':_0x2fba62[_0xc8f4('0x19')],'lastMsgDirection':_0x2fba62['direction'][_0xc8f4('0x10')]()});}})[_0xc8f4('0x1a')](function(_0x1518a6){console[_0xc8f4('0x1b')](_0x1518a6);});}if(_0x2fba62[_0xc8f4('0x1c')]==='out'&&!_0x2fba62[_0xc8f4('0x12')]){var _0x4d2b77;_0x38c41b['CmContact'][_0xc8f4('0x1d')]()[_0xc8f4('0x17')](function(_0x108076){return _0x38c41b[_0xc8f4('0x1e')][_0xc8f4('0x1f')]({'where':{'id':_0x2fba62[_0xc8f4('0x20')]},'include':[{'model':_0x38c41b[_0xc8f4('0x21')],'as':_0xc8f4('0x22'),'where':{'id':_0x2fba62[_0xc8f4('0x16')]},'limit':0x1,'include':[{'model':_0x38c41b[_0xc8f4('0x23')],'as':_0xc8f4('0x24'),'attributes':_[_0xc8f4('0x25')](_0x108076)}]}]});})[_0xc8f4('0x17')](function(_0x5f3264){_0x4d2b77=_0x5f3264[_0xc8f4('0xf')]({'plain':!![]});if(_0x4d2b77&&_0x4d2b77[_0xc8f4('0x26')]){logger[_0xc8f4('0x27')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x2b'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x4d2b77['Interactions']&&_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x2c')]){_0x2fba62[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x4d2b77['Interactions'][0x0],_0xc8f4('0x24'));_0x2fba62['Contact']=_0x4d2b77[_0xc8f4('0x22')][0x0]['Contact'];}var _0x34f05f={'method':_0xc8f4('0x2f'),'uri':encodeURI(_0x4d2b77['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34f05f[_0xc8f4('0x30')]){case _0xc8f4('0x31'):_0x34f05f['qs']=_0x2fba62;break;case _0xc8f4('0x2f'):_0x34f05f[_0xc8f4('0xc')]=_0x2fba62;break;}return rp(_0x34f05f)['then'](function(_0x3db490){logger[_0xc8f4('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x32'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x3db490[_0xc8f4('0xc')][_0xc8f4('0x33')]&&_0x3db490['body'][_0xc8f4('0x33')]!=_0x2fba62[_0xc8f4('0x2d')][_0xc8f4('0x33')]){return _0x38c41b['OpenchannelInteraction'][_0xc8f4('0x18')]({'threadId':_0x3db490[_0xc8f4('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x2fba62['Interaction']['id']}});}else{return;}})['then'](function(){return _0x39ed63[_0xc8f4('0x18')]({'read':!![]});})[_0xc8f4('0x1a')](function(_0x2e9a2a){logger[_0xc8f4('0x1b')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x34')](_0x2e9a2a,{'showHidden':![],'depth':null}));_0x599de3();});}else{_0x599de3();}})[_0xc8f4('0x35')](function(){_0x599de3();});}else{_0x599de3();}}},'charset':'utf8mb4','collate':_0xc8f4('0x36')});}; \ No newline at end of file +var _0x0598=['util','api','request-promise','path','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','toLowerCase','direction','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','secret','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','get','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x208dea,_0x2ee608){var _0x5bf479=function(_0x28dbf9){while(--_0x28dbf9){_0x208dea['push'](_0x208dea['shift']());}};_0x5bf479(++_0x2ee608);}(_0x0598,0x92));var _0x8059=function(_0x263702,_0x2c7094){_0x263702=_0x263702-0x0;var _0xee64e0=_0x0598[_0x263702];return _0xee64e0;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[{'name':_0x8059('0x8'),'fields':[_0x8059('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d1010,_0x89dda1,_0x1bf5fd){var _0x336f85=_0xa7d7c1[_0x8059('0xa')];var _0x283b63=_0x4d1010['get']({'plain':!![]});if(_0x283b63['direction'][_0x8059('0xb')]()==='in'||_0x283b63[_0x8059('0xc')]['toLowerCase']()==='out'&&!_0x283b63['secret']&&!_[_0x8059('0xd')](_0x283b63[_0x8059('0xe')])){_0x336f85[_0x8059('0xf')][_0x8059('0x10')]({'where':{'id':_0x283b63[_0x8059('0x11')]}})['then'](function(_0x11218f){if(_0x11218f){_0x11218f['update']({'lastMsgAt':_0x283b63[_0x8059('0x12')],'lastMsgDirection':_0x283b63['direction'][_0x8059('0xb')]()});}})[_0x8059('0x13')](function(_0x4810fd){console['error'](_0x4810fd);});}if(_0x283b63['direction']==='out'&&!_0x283b63[_0x8059('0x14')]){var _0x239195;_0x336f85[_0x8059('0x15')][_0x8059('0x16')]()[_0x8059('0x17')](function(_0x4b6d55){return _0x336f85[_0x8059('0x18')][_0x8059('0x19')]({'where':{'id':_0x283b63[_0x8059('0x1a')]},'include':[{'model':_0x336f85[_0x8059('0xf')],'as':'Interactions','where':{'id':_0x283b63[_0x8059('0x11')]},'limit':0x1,'include':[{'model':_0x336f85['CmContact'],'as':_0x8059('0x1b'),'attributes':_['keys'](_0x4b6d55)}]}]});})[_0x8059('0x17')](function(_0x56d794){_0x239195=_0x56d794[_0x8059('0x1c')]({'plain':!![]});if(_0x239195&&_0x239195[_0x8059('0x1d')]){logger[_0x8059('0x1e')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8059('0x1f')](_0x8059('0x20'),_0x283b63['id'],_0x239195[_0x8059('0x1d')]));if(_0x239195[_0x8059('0x21')]&&_0x239195['Interactions'][_0x8059('0x22')]){_0x283b63[_0x8059('0x23')]=_[_0x8059('0x24')](_0x239195['Interactions'][0x0],_0x8059('0x1b'));_0x283b63[_0x8059('0x1b')]=_0x239195[_0x8059('0x21')][0x0][_0x8059('0x1b')];}var _0x89dda1={'method':_0x8059('0x25'),'uri':encodeURI(_0x239195[_0x8059('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x89dda1[_0x8059('0x26')]){case _0x8059('0x27'):_0x89dda1['qs']=_0x283b63;break;case _0x8059('0x25'):_0x89dda1['body']=_0x283b63;break;}return rp(_0x89dda1)[_0x8059('0x17')](function(_0x19b95a){logger[_0x8059('0x1e')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x8059('0x28'),_0x283b63['id'],_0x239195[_0x8059('0x1d')]));if(_0x19b95a[_0x8059('0x9')][_0x8059('0x29')]&&_0x19b95a['body'][_0x8059('0x29')]!=_0x283b63['Interaction'][_0x8059('0x29')]){return _0x336f85[_0x8059('0xf')]['update']({'threadId':_0x19b95a[_0x8059('0x9')][_0x8059('0x29')]},{'logging':!![],'where':{'id':_0x283b63[_0x8059('0x23')]['id']}});}else{return;}})[_0x8059('0x17')](function(){return _0x4d1010[_0x8059('0x2a')]({'read':!![]});})[_0x8059('0x13')](function(_0x46b6a1){logger[_0x8059('0x2b')]('OpenchannelMessage,\x20%s,\x20%s',_0x8059('0x2c'),util[_0x8059('0x2d')](_0x46b6a1,{'showHidden':![],'depth':null}));_0x1bf5fd();});}else{_0x1bf5fd();}})[_0x8059('0x2e')](function(){_0x1bf5fd();});}else{_0x1bf5fd();}}},'charset':_0x8059('0x2f'),'collate':_0x8059('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index f79a44e..27c224b 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 _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(_0x2e3292,_0x1d2ccd){var _0x5375b5=function(_0x541f44){while(--_0x541f44){_0x2e3292['push'](_0x2e3292['shift']());}};_0x5375b5(++_0x1d2ccd);}(_0xadb5,0xad));var _0x5adb=function(_0x17e320,_0x5170c9){_0x17e320=_0x17e320-0x0;var _0x55f79d=_0xadb5[_0x17e320];return _0x55f79d;};'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 +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x3672a0,_0x153ae2){var _0x30e913=function(_0x1b214a){while(--_0x1b214a){_0x3672a0['push'](_0x3672a0['shift']());}};_0x30e913(++_0x153ae2);}(_0x2ef3,0xba));var _0x32ef=function(_0x119a9b,_0x282f6d){_0x119a9b=_0x119a9b-0x0;var _0x49e1f9=_0x2ef3[_0x119a9b];return _0x49e1f9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 543b7a8..6fb16b9 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 _0x9b2c=['register','length','openchannelMessage:','save','remove','removeListener'];(function(_0x48ac40,_0x1e3beb){var _0x55df02=function(_0x5e27d6){while(--_0x5e27d6){_0x48ac40['push'](_0x48ac40['shift']());}};_0x55df02(++_0x1e3beb);}(_0x9b2c,0x189));var _0xc9b2=function(_0xd95342,_0xb75bf6){_0xd95342=_0xd95342-0x0;var _0x54d694=_0x9b2c[_0xd95342];return _0x54d694;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xc9b2('0x0'),_0xc9b2('0x1'),'update'];function createListener(_0x140704,_0x54dbb1){return function(_0x102cd6){_0x54dbb1['emit'](_0x140704,_0x102cd6);};}function removeListener(_0xdbbe00,_0x26a747){return function(){OpenchannelMessageEvents[_0xc9b2('0x2')](_0xdbbe00,_0x26a747);};}exports[_0xc9b2('0x3')]=function(_0x15be55){for(var _0x3e6343=0x0,_0x3ab6d0=events[_0xc9b2('0x4')];_0x3e6343<_0x3ab6d0;_0x3e6343++){var _0x440a3f=events[_0x3e6343];var _0x224ce6=createListener(_0xc9b2('0x5')+_0x440a3f,_0x15be55);OpenchannelMessageEvents['on'](_0x440a3f,_0x224ce6);}}; \ No newline at end of file +var _0x4aeb=['update','emit','length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x31061a,_0x5ab647){var _0x48d92a=function(_0x421130){while(--_0x421130){_0x31061a['push'](_0x31061a['shift']());}};_0x48d92a(++_0x5ab647);}(_0x4aeb,0x131));var _0xb4ae=function(_0x2b01a2,_0x3b4040){_0x2b01a2=_0x2b01a2-0x0;var _0xcce4ab=_0x4aeb[_0x2b01a2];return _0xcce4ab;};'use strict';var OpenchannelMessageEvents=require(_0xb4ae('0x0'));var events=[_0xb4ae('0x1'),_0xb4ae('0x2'),_0xb4ae('0x3')];function createListener(_0x5184ed,_0x24fb33){return function(_0x1102dc){_0x24fb33[_0xb4ae('0x4')](_0x5184ed,_0x1102dc);};}function removeListener(_0x4f784c,_0xeaf8fd){return function(){OpenchannelMessageEvents['removeListener'](_0x4f784c,_0xeaf8fd);};}exports['register']=function(_0x5063cb){for(var _0x5db0a1=0x0,_0x2dc696=events[_0xb4ae('0x5')];_0x5db0a1<_0x2dc696;_0x5db0a1++){var _0x490edf=events[_0x5db0a1];var _0x703f22=createListener(_0xb4ae('0x6')+_0x490edf,_0x5063cb);OpenchannelMessageEvents['on'](_0x490edf,_0x703f22);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index e40592d..840310c 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 _0x23fd=['removeTeams','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x23fd,0x99));var _0xd23f=function(_0x587d1f,_0x25c939){_0x587d1f=_0x587d1f-0x0;var _0x187cc9=_0x23fd[_0x587d1f];return _0x187cc9;};'use strict';var multer=require(_0xd23f('0x0'));var util=require('util');var path=require(_0xd23f('0x1'));var timeout=require(_0xd23f('0x2'));var express=require(_0xd23f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd23f('0x4'));var interaction=require(_0xd23f('0x5'));var config=require('../../config/environment');var controller=require(_0xd23f('0x6'));router[_0xd23f('0x7')]('/',auth[_0xd23f('0x8')](),controller[_0xd23f('0x9')]);router[_0xd23f('0x7')](_0xd23f('0xa'),auth[_0xd23f('0x8')](),controller[_0xd23f('0xb')]);router[_0xd23f('0x7')](_0xd23f('0xc'),auth[_0xd23f('0x8')](),controller[_0xd23f('0xd')]);router[_0xd23f('0x7')](_0xd23f('0xe'),auth['isAuthenticated'](),controller[_0xd23f('0xf')]);router['get'](_0xd23f('0x10'),auth[_0xd23f('0x8')](),controller[_0xd23f('0x11')]);router[_0xd23f('0x7')](_0xd23f('0x12'),auth[_0xd23f('0x8')](),controller[_0xd23f('0x13')]);router[_0xd23f('0x14')]('/',auth['isAuthenticated'](),controller[_0xd23f('0x15')]);router[_0xd23f('0x14')](_0xd23f('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0xd23f('0x14')](_0xd23f('0x12'),auth[_0xd23f('0x8')](),controller[_0xd23f('0x16')]);router[_0xd23f('0x17')]('/:id',auth[_0xd23f('0x8')](),controller[_0xd23f('0x18')]);router['delete'](_0xd23f('0xc'),auth[_0xd23f('0x8')](),controller[_0xd23f('0x19')]);router[_0xd23f('0x1a')](_0xd23f('0x10'),auth[_0xd23f('0x8')](),controller[_0xd23f('0x1b')]);router[_0xd23f('0x1a')](_0xd23f('0x12'),auth[_0xd23f('0x8')](),controller[_0xd23f('0x1c')]);module[_0xd23f('0x1d')]=router; \ No newline at end of file +var _0xa8aa=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','delete','/:id','removeTeams','removeAgents','exports'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa8aa,0xa8));var _0xaa8a=function(_0x125972,_0x47b7fb){_0x125972=_0x125972-0x0;var _0x5d94a5=_0xa8aa[_0x125972];return _0x5d94a5;};'use strict';var multer=require('multer');var util=require(_0xaa8a('0x0'));var path=require('path');var timeout=require(_0xaa8a('0x1'));var express=require(_0xaa8a('0x2'));var router=express[_0xaa8a('0x3')]();var fs_extra=require(_0xaa8a('0x4'));var auth=require(_0xaa8a('0x5'));var interaction=require(_0xaa8a('0x6'));var config=require('../../config/environment');var controller=require(_0xaa8a('0x7'));router[_0xaa8a('0x8')]('/',auth[_0xaa8a('0x9')](),controller[_0xaa8a('0xa')]);router[_0xaa8a('0x8')](_0xaa8a('0xb'),auth[_0xaa8a('0x9')](),controller['describe']);router[_0xaa8a('0x8')]('/:id',auth[_0xaa8a('0x9')](),controller[_0xaa8a('0xc')]);router['get'](_0xaa8a('0xd'),auth[_0xaa8a('0x9')](),controller[_0xaa8a('0xe')]);router[_0xaa8a('0x8')](_0xaa8a('0xf'),auth[_0xaa8a('0x9')](),controller[_0xaa8a('0x10')]);router[_0xaa8a('0x8')](_0xaa8a('0x11'),auth['isAuthenticated'](),controller[_0xaa8a('0x12')]);router[_0xaa8a('0x13')]('/',auth[_0xaa8a('0x9')](),controller[_0xaa8a('0x14')]);router[_0xaa8a('0x13')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xaa8a('0x13')](_0xaa8a('0x11'),auth[_0xaa8a('0x9')](),controller[_0xaa8a('0x15')]);router[_0xaa8a('0x16')]('/:id',auth[_0xaa8a('0x9')](),controller['update']);router[_0xaa8a('0x17')](_0xaa8a('0x18'),auth[_0xaa8a('0x9')](),controller['destroy']);router['delete'](_0xaa8a('0xf'),auth['isAuthenticated'](),controller[_0xaa8a('0x19')]);router[_0xaa8a('0x17')](_0xaa8a('0x11'),auth['isAuthenticated'](),controller[_0xaa8a('0x1a')]);module[_0xaa8a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index a3c13d2..5631787 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 _0x764a=['rrmemory','beepall','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x764a,0x80));var _0xa764=function(_0x4eb03a,_0x5edd9b){_0x4eb03a=_0x4eb03a-0x0;var _0x3b6857=_0x764a[_0x4eb03a];return _0x3b6857;};'use strict';var Sequelize=require(_0xa764('0x0'));module['exports']={'name':{'type':Sequelize[_0xa764('0x1')],'unique':_0xa764('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa764('0x1')]},'timeout':{'type':Sequelize[_0xa764('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa764('0x4')](_0xa764('0x5'),_0xa764('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x6a8c=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x4c7c93,_0x2f5ae8){var _0x2e91be=function(_0xfe01e){while(--_0xfe01e){_0x4c7c93['push'](_0x4c7c93['shift']());}};_0x2e91be(++_0x2f5ae8);}(_0x6a8c,0xde));var _0xc6a8=function(_0x210ff9,_0xabe311){_0x210ff9=_0x210ff9-0x0;var _0x6958a=_0x6a8c[_0x210ff9];return _0x6958a;};'use strict';var Sequelize=require(_0xc6a8('0x0'));module[_0xc6a8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc6a8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc6a8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc6a8('0x4')](_0xc6a8('0x5'),'beepall',_0xc6a8('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 66eb13c..9658240 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 _0x6dc4=['ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','spread','getAgents','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','OpenchannelQueues','UserProfileResource','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','flatMap','sequelize','forEach','userOpenchannelQueue:save','removeTeams','select','team_has_openchannel_queues'];(function(_0x5c3161,_0x13c1ca){var _0x13bb7c=function(_0x440d7e){while(--_0x440d7e){_0x5c3161['push'](_0x5c3161['shift']());}};_0x13bb7c(++_0x13c1ca);}(_0x6dc4,0x19d));var _0x46dc=function(_0x24a37a,_0x3a5f52){_0x24a37a=_0x24a37a-0x0;var _0x112a09=_0x6dc4[_0x24a37a];return _0x112a09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x46dc('0x0'));var rp=require(_0x46dc('0x1'));var moment=require(_0x46dc('0x2'));var BPromise=require(_0x46dc('0x3'));var Mustache=require('mustache');var util=require(_0x46dc('0x4'));var path=require(_0x46dc('0x5'));var sox=require(_0x46dc('0x6'));var csv=require(_0x46dc('0x7'));var ejs=require(_0x46dc('0x8'));var fs=require('fs');var fs_extra=require(_0x46dc('0x9'));var _=require(_0x46dc('0xa'));var squel=require(_0x46dc('0xb'));var crypto=require(_0x46dc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x46dc('0xd'));var toCsv=require(_0x46dc('0x7'));var querystring=require(_0x46dc('0xe'));var Papa=require('papaparse');var Redis=require(_0x46dc('0xf'));var authService=require(_0x46dc('0x10'));var qs=require(_0x46dc('0x11'));var as=require(_0x46dc('0x12'));var hardwareService=require(_0x46dc('0x13'));var logger=require(_0x46dc('0x14'))(_0x46dc('0x15'));var utils=require(_0x46dc('0x16'));var config=require(_0x46dc('0x17'));var licenseUtil=require(_0x46dc('0x18'));var db=require(_0x46dc('0x19'))['db'];config[_0x46dc('0x1a')]=_[_0x46dc('0x1b')](config[_0x46dc('0x1a')],{'host':_0x46dc('0x1c'),'port':0x18eb});var socket=require(_0x46dc('0x1d'))(new Redis(config['redis']));require(_0x46dc('0x1e'))[_0x46dc('0x1f')](socket);function respondWithStatusCode(_0x634a6a,_0x1e1280){_0x1e1280=_0x1e1280||0xcc;return function(_0x372b2d){if(_0x372b2d){return _0x634a6a[_0x46dc('0x20')](_0x1e1280);}return _0x634a6a[_0x46dc('0x21')](_0x1e1280)[_0x46dc('0x22')]();};}function respondWithResult(_0x408488,_0x2b947b){_0x2b947b=_0x2b947b||0xc8;return function(_0xe81274){if(_0xe81274){return _0x408488[_0x46dc('0x21')](_0x2b947b)[_0x46dc('0x23')](_0xe81274);}};}function respondWithFilteredResult(_0x37fafd,_0x42b821){return function(_0x4edaae){if(_0x4edaae){var _0x3892eb=typeof _0x42b821[_0x46dc('0x24')]===_0x46dc('0x25')&&typeof _0x42b821['limit']===_0x46dc('0x25');var _0x1c7241=_0x4edaae[_0x46dc('0x26')];var _0x27e1be=_0x3892eb?0x0:_0x42b821[_0x46dc('0x24')];var _0x33034a=_0x3892eb?_0x4edaae['count']:_0x42b821[_0x46dc('0x24')]+_0x42b821[_0x46dc('0x27')];var _0x5d6c21;if(_0x33034a>=_0x1c7241){_0x33034a=_0x1c7241;_0x5d6c21=0xc8;}else{_0x5d6c21=0xce;}_0x37fafd[_0x46dc('0x21')](_0x5d6c21);return _0x37fafd['set'](_0x46dc('0x28'),_0x27e1be+'-'+_0x33034a+'/'+_0x1c7241)[_0x46dc('0x23')](_0x4edaae);}return null;};}function patchUpdates(_0x3d497d){return function(_0x5cdc73){try{jsonpatch[_0x46dc('0x29')](_0x5cdc73,_0x3d497d,!![]);}catch(_0x5acd5a){return BPromise[_0x46dc('0x2a')](_0x5acd5a);}return _0x5cdc73['save']();};}function saveUpdates(_0x2dfb75,_0x5ad531){return function(_0xee4ec0){if(_0xee4ec0){return _0xee4ec0[_0x46dc('0x2b')](_0x2dfb75)['then'](function(_0x538f63){return _0x538f63;});}return null;};}function removeEntity(_0x925ae1,_0x47d12a){return function(_0x2be425){if(_0x2be425){return _0x2be425['destroy']()[_0x46dc('0x2c')](function(){var _0x14cd28=_0x2be425['get']({'plain':!![]});var _0x5c320e=_0x46dc('0x2d');return db[_0x46dc('0x2e')]['destroy']({'where':{'type':_0x5c320e,'resourceId':_0x14cd28['id']}})[_0x46dc('0x2c')](function(){return _0x2be425;});})['then'](function(){_0x925ae1['status'](0xcc)[_0x46dc('0x22')]();});}};}function handleEntityNotFound(_0x4a8818,_0x5bf944){return function(_0xafaabe){if(!_0xafaabe){_0x4a8818[_0x46dc('0x20')](0x194);}return _0xafaabe;};}function handleError(_0x39bebf,_0x4ed8a5){_0x4ed8a5=_0x4ed8a5||0x1f4;return function(_0x3cc6d5){logger['error'](_0x3cc6d5[_0x46dc('0x2f')]);if(_0x3cc6d5[_0x46dc('0x30')]){delete _0x3cc6d5['name'];}_0x39bebf[_0x46dc('0x21')](_0x4ed8a5)[_0x46dc('0x31')](_0x3cc6d5);};}exports[_0x46dc('0x32')]=function(_0x2f1226,_0x5daf91){var _0x1a070d={},_0xf5d498={},_0x247a6c={'count':0x0,'rows':[]};var _0x585072=_[_0x46dc('0x33')](db[_0x46dc('0x34')][_0x46dc('0x35')],function(_0x233477){return{'name':_0x233477[_0x46dc('0x36')],'type':_0x233477[_0x46dc('0x37')][_0x46dc('0x38')]};});_0xf5d498[_0x46dc('0x39')]=_['map'](_0x585072,'name');_0xf5d498[_0x46dc('0x3a')]=_[_0x46dc('0x3b')](_0x2f1226['query']);_0xf5d498[_0x46dc('0x3c')]=_[_0x46dc('0x3d')](_0xf5d498['model'],_0xf5d498[_0x46dc('0x3a')]);_0x1a070d[_0x46dc('0x3e')]=_['intersection'](_0xf5d498[_0x46dc('0x39')],qs[_0x46dc('0x3f')](_0x2f1226['query'][_0x46dc('0x3f')]));_0x1a070d['attributes']=_0x1a070d[_0x46dc('0x3e')][_0x46dc('0x40')]?_0x1a070d['attributes']:_0xf5d498[_0x46dc('0x39')];if(!_0x2f1226[_0x46dc('0x3a')][_0x46dc('0x41')]('nolimit')){_0x1a070d[_0x46dc('0x27')]=qs[_0x46dc('0x27')](_0x2f1226[_0x46dc('0x3a')][_0x46dc('0x27')]);_0x1a070d[_0x46dc('0x24')]=qs['offset'](_0x2f1226[_0x46dc('0x3a')]['offset']);}_0x1a070d[_0x46dc('0x42')]=qs[_0x46dc('0x43')](_0x2f1226[_0x46dc('0x3a')][_0x46dc('0x43')]);_0x1a070d['where']=qs[_0x46dc('0x3c')](_[_0x46dc('0x44')](_0x2f1226['query'],_0xf5d498[_0x46dc('0x3c')]),_0x585072);if(_0x2f1226['query'][_0x46dc('0x45')]){_0x1a070d[_0x46dc('0x46')]=_[_0x46dc('0x47')](_0x1a070d['where'],{'$or':_[_0x46dc('0x33')](_0x585072,function(_0x2c7fd1){if(_0x2c7fd1['type']!=='VIRTUAL'){var _0x518ca6={};_0x518ca6[_0x2c7fd1[_0x46dc('0x30')]]={'$like':'%'+_0x2f1226[_0x46dc('0x3a')][_0x46dc('0x45')]+'%'};return _0x518ca6;}})});}_0x1a070d=_['merge']({},_0x1a070d,_0x2f1226[_0x46dc('0x48')]);var _0x14fded={'where':_0x1a070d['where']};return db['OpenchannelQueue'][_0x46dc('0x26')](_0x14fded)[_0x46dc('0x2c')](function(_0x27fa01){_0x247a6c['count']=_0x27fa01;if(_0x2f1226[_0x46dc('0x3a')]['includeAll']){_0x1a070d[_0x46dc('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x46dc('0x4a')](_0x1a070d);})[_0x46dc('0x2c')](function(_0x248bef){_0x247a6c['rows']=_0x248bef;return _0x247a6c;})[_0x46dc('0x2c')](respondWithFilteredResult(_0x5daf91,_0x1a070d))[_0x46dc('0x4b')](handleError(_0x5daf91,null));};exports[_0x46dc('0x4c')]=function(_0x244182,_0x53c111){var _0x509935={'raw':!![],'where':{'id':_0x244182[_0x46dc('0x4d')]['id']}},_0x23d76b={};_0x23d76b[_0x46dc('0x39')]=_[_0x46dc('0x3b')](db[_0x46dc('0x34')][_0x46dc('0x35')]);_0x23d76b[_0x46dc('0x3a')]=_[_0x46dc('0x3b')](_0x244182[_0x46dc('0x3a')]);_0x23d76b['filters']=_['intersection'](_0x23d76b['model'],_0x23d76b[_0x46dc('0x3a')]);_0x509935[_0x46dc('0x3e')]=_[_0x46dc('0x3d')](_0x23d76b[_0x46dc('0x39')],qs[_0x46dc('0x3f')](_0x244182[_0x46dc('0x3a')][_0x46dc('0x3f')]));_0x509935[_0x46dc('0x3e')]=_0x509935[_0x46dc('0x3e')][_0x46dc('0x40')]?_0x509935['attributes']:_0x23d76b[_0x46dc('0x39')];if(_0x244182['query'][_0x46dc('0x4e')]){_0x509935[_0x46dc('0x49')]=[{'all':!![]}];}_0x509935=_[_0x46dc('0x47')]({},_0x509935,_0x244182[_0x46dc('0x48')]);return db[_0x46dc('0x34')][_0x46dc('0x4f')](_0x509935)[_0x46dc('0x2c')](handleEntityNotFound(_0x53c111,null))['then'](respondWithResult(_0x53c111,null))[_0x46dc('0x4b')](handleError(_0x53c111,null));};exports[_0x46dc('0x50')]=function(_0x4b18ab,_0x3cd62e){return db[_0x46dc('0x34')][_0x46dc('0x50')](_0x4b18ab[_0x46dc('0x51')],{})['then'](function(_0x3d2de3){var _0xf99328=_0x4b18ab[_0x46dc('0x52')][_0x46dc('0x53')]({'plain':!![]});if(!_0xf99328)throw new Error(_0x46dc('0x54'));if(_0xf99328['role']==='user'){var _0x9a07f2=_0x3d2de3[_0x46dc('0x53')]({'plain':!![]});var _0x35aaf5=_0x46dc('0x2d');return db['UserProfileSection'][_0x46dc('0x4f')]({'where':{'name':_0x35aaf5,'userProfileId':_0xf99328[_0x46dc('0x55')]},'raw':!![]})[_0x46dc('0x2c')](function(_0x5838bd){if(_0x5838bd&&_0x5838bd[_0x46dc('0x56')]===0x0){return db[_0x46dc('0x2e')][_0x46dc('0x50')]({'name':_0x9a07f2['name'],'resourceId':_0x9a07f2['id'],'type':_0x5838bd[_0x46dc('0x30')],'sectionId':_0x5838bd['id']},{})[_0x46dc('0x2c')](function(){return _0x3d2de3;});}else{return _0x3d2de3;}})[_0x46dc('0x4b')](function(_0x421980){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x421980);throw _0x421980;});}return _0x3d2de3;})[_0x46dc('0x2c')](respondWithResult(_0x3cd62e,0xc9))['catch'](handleError(_0x3cd62e,null));};exports[_0x46dc('0x2b')]=function(_0x55f388,_0x2ab527){if(_0x55f388[_0x46dc('0x51')]['id']){delete _0x55f388[_0x46dc('0x51')]['id'];}return db[_0x46dc('0x34')][_0x46dc('0x4f')]({'where':{'id':_0x55f388[_0x46dc('0x4d')]['id']}})[_0x46dc('0x2c')](handleEntityNotFound(_0x2ab527,null))[_0x46dc('0x2c')](saveUpdates(_0x55f388[_0x46dc('0x51')],null))[_0x46dc('0x2c')](respondWithResult(_0x2ab527,null))[_0x46dc('0x4b')](handleError(_0x2ab527,null));};exports['destroy']=function(_0x364dbd,_0xb5a59){return db[_0x46dc('0x34')][_0x46dc('0x4f')]({'where':{'id':_0x364dbd[_0x46dc('0x4d')]['id']}})[_0x46dc('0x2c')](handleEntityNotFound(_0xb5a59,null))[_0x46dc('0x2c')](removeEntity(_0xb5a59,null))['catch'](handleError(_0xb5a59,null));};exports[_0x46dc('0x57')]=function(_0x654879,_0x5132fc){return db[_0x46dc('0x34')][_0x46dc('0x57')]()['then'](respondWithResult(_0x5132fc,null))[_0x46dc('0x4b')](handleError(_0x5132fc,null));};exports['getMembers']=function(_0x1c9356,_0x42e922,_0x27a22f){var _0xd8d475={'raw':!![],'where':{}},_0x25f565={},_0x4ace3b;return db['OpenchannelQueue'][_0x46dc('0x58')]({'where':{'id':_0x1c9356[_0x46dc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42e922,null))[_0x46dc('0x2c')](function(_0x31c5c7){if(_0x31c5c7){_0x4ace3b=_0x31c5c7['get']({'plain':!![]});_0x25f565[_0x46dc('0x39')]=_[_0x46dc('0x3b')](db[_0x46dc('0x59')][_0x46dc('0x35')]);_0x25f565[_0x46dc('0x3a')]=_[_0x46dc('0x3b')](_0x1c9356[_0x46dc('0x3a')]);_0x25f565[_0x46dc('0x3c')]=_[_0x46dc('0x3d')](_0x25f565[_0x46dc('0x39')],_0x25f565[_0x46dc('0x3a')]);_0xd8d475[_0x46dc('0x3e')]=_['intersection'](_0x25f565['model'],qs[_0x46dc('0x3f')](_0x1c9356[_0x46dc('0x3a')]['fields']));_0xd8d475['attributes']=_0xd8d475[_0x46dc('0x3e')][_0x46dc('0x40')]?_0xd8d475[_0x46dc('0x3e')]:_0x25f565['model'];if(!_0x1c9356[_0x46dc('0x3a')][_0x46dc('0x41')](_0x46dc('0x5a'))){_0xd8d475['limit']=qs[_0x46dc('0x27')](_0x1c9356['query'][_0x46dc('0x27')]);_0xd8d475[_0x46dc('0x24')]=qs['offset'](_0x1c9356[_0x46dc('0x3a')][_0x46dc('0x24')]);}_0xd8d475[_0x46dc('0x42')]=qs['sort'](_0x1c9356[_0x46dc('0x3a')]['sort']);_0xd8d475[_0x46dc('0x46')]=qs[_0x46dc('0x3c')](_['pick'](_0x1c9356[_0x46dc('0x3a')],_0x25f565[_0x46dc('0x3c')]));_0xd8d475[_0x46dc('0x46')][_0x46dc('0x5b')]=_0x31c5c7['id'];if(_0x1c9356['query'][_0x46dc('0x45')]){_0xd8d475[_0x46dc('0x46')]=_[_0x46dc('0x47')](_0xd8d475['where'],{'$or':_[_0x46dc('0x33')](_0xd8d475[_0x46dc('0x3e')],function(_0x1f165f){var _0x10e077={};_0x10e077[_0x1f165f]={'$like':'%'+_0x1c9356['query'][_0x46dc('0x45')]+'%'};return _0x10e077;})});}_0xd8d475=_[_0x46dc('0x47')]({},_0xd8d475,_0x1c9356[_0x46dc('0x48')]);return db['UserOpenchannelQueue'][_0x46dc('0x4a')](_0xd8d475);}})[_0x46dc('0x2c')](function(_0x4b370a){if(_0x4b370a){return db[_0x46dc('0x5c')][_0x46dc('0x5d')]({'where':{'id':_[_0x46dc('0x33')](_0x4b370a,_0x46dc('0x5e')),'role':_0x46dc('0x5f')},'attributes':['id',_0x46dc('0x30'),_0x46dc('0x60'),_0x46dc('0x61'),'createdAt']});}})[_0x46dc('0x2c')](function(_0x1b8533){if(_0x1b8533){return{'count':_0x1b8533[_0x46dc('0x26')],'rows':_[_0x46dc('0x33')](_0x1b8533[_0x46dc('0x62')],function(_0x207cd1){return{'membername':_0x207cd1[_0x46dc('0x30')],'UserId':_0x207cd1['id'],'queue_name':_0x4ace3b[_0x46dc('0x30')],'OpenchannelQueueId':_0x4ace3b['id'],'interface':util[_0x46dc('0x63')](_0x46dc('0x64'),_0x46dc('0x65'),_0x207cd1[_0x46dc('0x30')]),'penalty':0x0,'paused':_0x207cd1[_0x46dc('0x60')],'createdAt':_0x207cd1[_0x46dc('0x66')],'updatedAt':_0x207cd1[_0x46dc('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x46dc('0x2c')](respondWithFilteredResult(_0x42e922,_0xd8d475))[_0x46dc('0x4b')](handleError(_0x42e922,null));};exports[_0x46dc('0x67')]=function(_0x1a4762,_0x1d9494,_0x8d079){var _0xce2d0e={};var _0x24be88={};var _0x4ba679;var _0x3a0eb8;return db[_0x46dc('0x34')][_0x46dc('0x58')]({'where':{'id':_0x1a4762[_0x46dc('0x4d')]['id']}})[_0x46dc('0x2c')](handleEntityNotFound(_0x1d9494,null))[_0x46dc('0x2c')](function(_0x168926){if(_0x168926){_0x4ba679=_0x168926;_0x24be88[_0x46dc('0x39')]=_[_0x46dc('0x3b')](db[_0x46dc('0x68')][_0x46dc('0x35')]);_0x24be88[_0x46dc('0x3a')]=_[_0x46dc('0x3b')](_0x1a4762[_0x46dc('0x3a')]);_0x24be88[_0x46dc('0x3c')]=_[_0x46dc('0x3d')](_0x24be88[_0x46dc('0x39')],_0x24be88[_0x46dc('0x3a')]);_0xce2d0e['attributes']=_[_0x46dc('0x3d')](_0x24be88[_0x46dc('0x39')],qs[_0x46dc('0x3f')](_0x1a4762[_0x46dc('0x3a')]['fields']));_0xce2d0e['attributes']=_0xce2d0e[_0x46dc('0x3e')][_0x46dc('0x40')]?_0xce2d0e[_0x46dc('0x3e')]:_0x24be88[_0x46dc('0x39')];_0xce2d0e[_0x46dc('0x42')]=qs['sort'](_0x1a4762['query'][_0x46dc('0x43')]);_0xce2d0e[_0x46dc('0x46')]=qs[_0x46dc('0x3c')](_[_0x46dc('0x44')](_0x1a4762[_0x46dc('0x3a')],_0x24be88[_0x46dc('0x3c')]));if(_0x1a4762[_0x46dc('0x3a')][_0x46dc('0x45')]){_0xce2d0e['where']=_[_0x46dc('0x47')](_0xce2d0e['where'],{'$or':_[_0x46dc('0x33')](_0xce2d0e[_0x46dc('0x3e')],function(_0x5789a9){var _0x5e699e={};_0x5e699e[_0x5789a9]={'$like':'%'+_0x1a4762[_0x46dc('0x3a')][_0x46dc('0x45')]+'%'};return _0x5e699e;})});}_0xce2d0e=_['merge']({},_0xce2d0e,_0x1a4762[_0x46dc('0x48')]);return _0x4ba679[_0x46dc('0x67')](_0xce2d0e);}})[_0x46dc('0x2c')](function(_0xcb78ef){if(_0xcb78ef){_0x3a0eb8=_0xcb78ef['length'];if(!_0x1a4762[_0x46dc('0x3a')][_0x46dc('0x41')](_0x46dc('0x5a'))){_0xce2d0e[_0x46dc('0x27')]=qs[_0x46dc('0x27')](_0x1a4762['query'][_0x46dc('0x27')]);_0xce2d0e[_0x46dc('0x24')]=qs[_0x46dc('0x24')](_0x1a4762[_0x46dc('0x3a')][_0x46dc('0x24')]);}return _0x4ba679[_0x46dc('0x67')](_0xce2d0e);}})[_0x46dc('0x2c')](function(_0x30f9b4){if(_0x30f9b4){return _0x30f9b4?{'count':_0x3a0eb8,'rows':_0x30f9b4}:null;}})[_0x46dc('0x2c')](respondWithResult(_0x1d9494,null))[_0x46dc('0x4b')](handleError(_0x1d9494,null));};exports[_0x46dc('0x69')]=function(_0x18798a,_0x7b66bd,_0x35e404){var _0x4145ca=_0x18798a['body'][_0x46dc('0x6a')];return db[_0x46dc('0x68')][_0x46dc('0x4a')]({'where':{'id':_0x4145ca},'attributes':['id'],'include':[{'model':db[_0x46dc('0x5c')],'as':_0x46dc('0x6b'),'attributes':['id',_0x46dc('0x30'),'online','voicePause','interface'],'raw':!![]}]})[_0x46dc('0x2c')](function(_0x20f0a3){if(_0x20f0a3){var _0x3618d4=_[_0x46dc('0x6c')](_0x20f0a3,function(_0x38f0b2){var _0x338fa9=_0x38f0b2[_0x46dc('0x53')]({'plain':!![]});return _0x338fa9['Agents'];});return db[_0x46dc('0x34')]['find']({'where':{'id':_0x18798a[_0x46dc('0x4d')]['id']}})[_0x46dc('0x2c')](function(_0x4d95eb){return db[_0x46dc('0x6d')]['transaction'](function(_0x7d9859){return _0x4d95eb[_0x46dc('0x69')](_0x4145ca,{'transaction':_0x7d9859})[_0x46dc('0x2c')](function(){return BPromise['each'](_0x3618d4,function(_0x2ed3d9){return db[_0x46dc('0x59')]['findOrCreate']({'where':{'UserId':_0x2ed3d9['id'],'OpenchannelQueueId':_0x18798a[_0x46dc('0x4d')]['id']},'transaction':_0x7d9859});});})[_0x46dc('0x2c')](function(){_0x3618d4[_0x46dc('0x6e')](function(_0x2a3549){socket['emit'](_0x46dc('0x6f'),{'UserId':_0x2a3549['id'],'OpenchannelQueueId':_0x4d95eb['id']});});});});});}})[_0x46dc('0x2c')](respondWithStatusCode(_0x7b66bd,null))['catch'](handleError(_0x7b66bd,null));};exports[_0x46dc('0x70')]=function(_0x2b0f02,_0x24c9cb,_0x32cc6f){return db[_0x46dc('0x68')][_0x46dc('0x4a')]({'where':{'id':_0x2b0f02[_0x46dc('0x3a')][_0x46dc('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x46dc('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x46dc('0x2c')](handleEntityNotFound(_0x24c9cb,null))[_0x46dc('0x2c')](function(_0xdb046){var _0x5a9a34=_[_0x46dc('0x33')](_0xdb046,'id');var _0xce9f44=[];var _0x38a443=[];var _0x125a63=squel[_0x46dc('0x71')]();_0x125a63['field']('tq.TeamId')['from'](_0x46dc('0x72'),'tq')['join']('user_has_teams','ut',_0x46dc('0x73'))[_0x46dc('0x46')](_0x46dc('0x74'),_0x2b0f02['params']['id']);for(var _0x42c549=0x0;_0x42c549<_0xdb046[_0x46dc('0x40')];_0x42c549+=0x1){let _0x357c35=_0xdb046[_0x42c549];for(var _0x570e0c=0x0;_0x570e0c<_0x357c35[_0x46dc('0x6b')][_0x46dc('0x40')];_0x570e0c+=0x1){let _0x5bf8c6=_0x357c35['Agents'][_0x570e0c];var _0x386702=_0x125a63[_0x46dc('0x75')]();_0x386702[_0x46dc('0x46')]('ut.UserId\x20=\x20?',_0x5bf8c6['id']);_0x38a443['push'](db[_0x46dc('0x6d')]['query'](_0x386702['toString'](),{'type':db[_0x46dc('0x6d')][_0x46dc('0x76')]['SELECT']})[_0x46dc('0x2c')](function(_0x206e93){if(_0x206e93['length']===0x1){return _0x5bf8c6['id'];}else{var _0x2c2361=_[_0x46dc('0x77')](_['map'](_0x206e93,_0x46dc('0x78')),function(_0x16098c){return _[_0x46dc('0x79')](_0x5a9a34,_0x16098c);});if(_0x2c2361){return _0x5bf8c6['id'];}}}));}}return BPromise[_0x46dc('0x7a')](_0x38a443)['then'](function(_0x14f8c4){_0xce9f44=_(_0xce9f44)[_0x46dc('0x7b')](_0x14f8c4)['compact']()[_0x46dc('0x7c')]();return db[_0x46dc('0x34')][_0x46dc('0x4f')]({'where':{'id':_0x2b0f02[_0x46dc('0x4d')]['id']}})['then'](function(_0x1da554){return db[_0x46dc('0x6d')]['transaction'](function(_0x110e17){return _0x1da554['removeTeams'](_0x2b0f02['query'][_0x46dc('0x6a')],{'transaction':_0x110e17})[_0x46dc('0x2c')](function(){if(!_[_0x46dc('0x7d')](_0xce9f44)){return _0x1da554[_0x46dc('0x7e')](_0xce9f44,{'transaction':_0x110e17});}})[_0x46dc('0x2c')](function(){_0xce9f44['forEach'](function(_0x1bd9f9){socket[_0x46dc('0x7f')](_0x46dc('0x80'),{'UserId':_0x1bd9f9,'OpenchannelQueueId':_0x1da554['id']});});});});});});})[_0x46dc('0x2c')](respondWithStatusCode(_0x24c9cb,null))['catch'](handleError(_0x24c9cb,null));};exports['addAgents']=function(_0x4699cd,_0xcf974c,_0xd0508f){return db['OpenchannelQueue'][_0x46dc('0x4f')]({'where':{'id':_0x4699cd['params']['id']}})[_0x46dc('0x2c')](handleEntityNotFound(_0xcf974c,null))[_0x46dc('0x2c')](function(_0x4023aa){if(_0x4023aa){return _0x4023aa['addAgents'](_0x4699cd[_0x46dc('0x51')][_0x46dc('0x6a')],_[_0x46dc('0x81')](_0x4699cd[_0x46dc('0x51')],[_0x46dc('0x6a'),'id'])||{})[_0x46dc('0x82')](function(_0x2dfb4e){for(var _0x50c415=0x0;_0x50c415<_0x4699cd[_0x46dc('0x51')][_0x46dc('0x6a')][_0x46dc('0x40')];_0x50c415+=0x1){socket[_0x46dc('0x7f')]('userOpenchannelQueue:save',{'UserId':Number(_0x4699cd[_0x46dc('0x51')][_0x46dc('0x6a')][_0x50c415]),'OpenchannelQueueId':Number(_0x4699cd['params']['id'])});}return _0x2dfb4e;});}})[_0x46dc('0x2c')](respondWithResult(_0xcf974c,null))[_0x46dc('0x4b')](handleError(_0xcf974c,null));};exports['removeAgents']=function(_0x5a163d,_0x1c1b2b,_0x5cda1e){return db['OpenchannelQueue'][_0x46dc('0x4f')]({'where':{'id':_0x5a163d[_0x46dc('0x4d')]['id']}})[_0x46dc('0x2c')](handleEntityNotFound(_0x1c1b2b,null))[_0x46dc('0x2c')](function(_0x5780d4){if(_0x5780d4){return _0x5780d4[_0x46dc('0x7e')](_0x5a163d[_0x46dc('0x3a')][_0x46dc('0x6a')])['then'](function(){if(_['isArray'](_0x5a163d[_0x46dc('0x3a')][_0x46dc('0x6a')])){for(var _0x9834cb=0x0;_0x9834cb<_0x5a163d[_0x46dc('0x3a')][_0x46dc('0x6a')][_0x46dc('0x40')];_0x9834cb+=0x1){socket[_0x46dc('0x7f')](_0x46dc('0x80'),{'UserId':Number(_0x5a163d[_0x46dc('0x3a')]['ids'][_0x9834cb]),'OpenchannelQueueId':Number(_0x5a163d['params']['id'])});}}else{socket['emit'](_0x46dc('0x80'),{'UserId':Number(_0x5a163d[_0x46dc('0x3a')][_0x46dc('0x6a')]),'OpenchannelQueueId':Number(_0x5a163d[_0x46dc('0x4d')]['id'])});}});}})[_0x46dc('0x2c')](respondWithStatusCode(_0x1c1b2b,null))[_0x46dc('0x4b')](handleError(_0x1c1b2b,null));};exports[_0x46dc('0x83')]=function(_0x15cf46,_0x266153,_0x453c72){var _0x2a4b5b={};var _0x4e7fc6={};var _0x25d832;var _0x5bf0e4;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x15cf46[_0x46dc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x266153,null))[_0x46dc('0x2c')](function(_0xb2b5f2){if(_0xb2b5f2){_0x25d832=_0xb2b5f2;_0x4e7fc6[_0x46dc('0x39')]=_[_0x46dc('0x3b')](db[_0x46dc('0x5c')][_0x46dc('0x35')]);_0x4e7fc6[_0x46dc('0x3a')]=_[_0x46dc('0x3b')](_0x15cf46['query']);_0x4e7fc6[_0x46dc('0x3c')]=_[_0x46dc('0x3d')](_0x4e7fc6[_0x46dc('0x39')],_0x4e7fc6['query']);_0x2a4b5b[_0x46dc('0x3e')]=_[_0x46dc('0x3d')](_0x4e7fc6[_0x46dc('0x39')],qs[_0x46dc('0x3f')](_0x15cf46[_0x46dc('0x3a')][_0x46dc('0x3f')]));_0x2a4b5b[_0x46dc('0x3e')]=_0x2a4b5b['attributes']['length']?_0x2a4b5b[_0x46dc('0x3e')]:_0x4e7fc6[_0x46dc('0x39')];_0x2a4b5b['order']=qs['sort'](_0x15cf46['query'][_0x46dc('0x43')]);_0x2a4b5b[_0x46dc('0x46')]=qs[_0x46dc('0x3c')](_[_0x46dc('0x44')](_0x15cf46['query'],_0x4e7fc6[_0x46dc('0x3c')]));if(_0x15cf46[_0x46dc('0x3a')][_0x46dc('0x45')]){_0x2a4b5b[_0x46dc('0x46')]=_[_0x46dc('0x47')](_0x2a4b5b[_0x46dc('0x46')],{'$or':_['map'](_0x2a4b5b[_0x46dc('0x3e')],function(_0x2d17c2){var _0x25a596={};_0x25a596[_0x2d17c2]={'$like':'%'+_0x15cf46[_0x46dc('0x3a')][_0x46dc('0x45')]+'%'};return _0x25a596;})});}_0x2a4b5b=_[_0x46dc('0x47')]({},_0x2a4b5b,_0x15cf46[_0x46dc('0x48')]);return _0x25d832['getAgents'](_0x2a4b5b);}})[_0x46dc('0x2c')](function(_0x2763d4){if(_0x2763d4){_0x5bf0e4=_0x2763d4[_0x46dc('0x40')];if(!_0x15cf46['query'][_0x46dc('0x41')]('nolimit')){_0x2a4b5b[_0x46dc('0x27')]=qs[_0x46dc('0x27')](_0x15cf46[_0x46dc('0x3a')]['limit']);_0x2a4b5b['offset']=qs[_0x46dc('0x24')](_0x15cf46['query']['offset']);}return _0x25d832['getAgents'](_0x2a4b5b);}})[_0x46dc('0x2c')](function(_0x35f80f){if(_0x35f80f){return _0x35f80f?{'count':_0x5bf0e4,'rows':_0x35f80f}:null;}})[_0x46dc('0x2c')](respondWithResult(_0x266153,null))[_0x46dc('0x4b')](handleError(_0x266153,null));}; \ No newline at end of file +var _0xce6e=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','sequelize','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelQueue','findAll','rows','catch','show','rawAttributes'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0xce6e,0x15e));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xece6('0x0'));var zipdir=require(_0xece6('0x1'));var jsonpatch=require(_0xece6('0x2'));var rp=require('request-promise');var moment=require(_0xece6('0x3'));var BPromise=require(_0xece6('0x4'));var Mustache=require(_0xece6('0x5'));var util=require('util');var path=require('path');var sox=require(_0xece6('0x6'));var csv=require(_0xece6('0x7'));var ejs=require(_0xece6('0x8'));var fs=require('fs');var fs_extra=require(_0xece6('0x9'));var _=require(_0xece6('0xa'));var squel=require(_0xece6('0xb'));var crypto=require(_0xece6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xece6('0x7'));var querystring=require(_0xece6('0xd'));var Papa=require(_0xece6('0xe'));var Redis=require(_0xece6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xece6('0x10'));var as=require(_0xece6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xece6('0x12'));var utils=require(_0xece6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xece6('0x14')]=_['defaults'](config['redis'],{'host':_0xece6('0x15'),'port':0x18eb});var socket=require(_0xece6('0x16'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xece6('0x17')](socket);function respondWithStatusCode(_0x4f337f,_0x4acbf4){_0x4acbf4=_0x4acbf4||0xcc;return function(_0x5cf04f){if(_0x5cf04f){return _0x4f337f[_0xece6('0x18')](_0x4acbf4);}return _0x4f337f[_0xece6('0x19')](_0x4acbf4)[_0xece6('0x1a')]();};}function respondWithResult(_0xb941fd,_0x556830){_0x556830=_0x556830||0xc8;return function(_0x32d3b8){if(_0x32d3b8){return _0xb941fd[_0xece6('0x19')](_0x556830)[_0xece6('0x1b')](_0x32d3b8);}};}function respondWithFilteredResult(_0x4691ec,_0x30a7e1){return function(_0x4d65e5){if(_0x4d65e5){var _0x2b430c=typeof _0x30a7e1['offset']===_0xece6('0x1c')&&typeof _0x30a7e1['limit']==='undefined';var _0x40fc3b=_0x4d65e5[_0xece6('0x1d')];var _0x35245e=_0x2b430c?0x0:_0x30a7e1['offset'];var _0x16f5e3=_0x2b430c?_0x4d65e5['count']:_0x30a7e1['offset']+_0x30a7e1[_0xece6('0x1e')];var _0x6f5999;if(_0x16f5e3>=_0x40fc3b){_0x16f5e3=_0x40fc3b;_0x6f5999=0xc8;}else{_0x6f5999=0xce;}_0x4691ec[_0xece6('0x19')](_0x6f5999);return _0x4691ec[_0xece6('0x1f')](_0xece6('0x20'),_0x35245e+'-'+_0x16f5e3+'/'+_0x40fc3b)['json'](_0x4d65e5);}return null;};}function patchUpdates(_0xc7e9db){return function(_0x3f737a){try{jsonpatch[_0xece6('0x21')](_0x3f737a,_0xc7e9db,!![]);}catch(_0x1798ae){return BPromise[_0xece6('0x22')](_0x1798ae);}return _0x3f737a[_0xece6('0x23')]();};}function saveUpdates(_0xf0b2c8,_0x29081d){return function(_0x57d84d){if(_0x57d84d){return _0x57d84d['update'](_0xf0b2c8)[_0xece6('0x24')](function(_0x2cb6c7){return _0x2cb6c7;});}return null;};}function removeEntity(_0x2369a8,_0x5641b8){return function(_0x28df65){if(_0x28df65){return _0x28df65[_0xece6('0x25')]()[_0xece6('0x24')](function(){var _0x19e62a=_0x28df65[_0xece6('0x26')]({'plain':!![]});var _0x331cb6='OpenchannelQueues';return db[_0xece6('0x27')][_0xece6('0x25')]({'where':{'type':_0x331cb6,'resourceId':_0x19e62a['id']}})[_0xece6('0x24')](function(){return _0x28df65;});})['then'](function(){_0x2369a8[_0xece6('0x19')](0xcc)[_0xece6('0x1a')]();});}};}function handleEntityNotFound(_0x12365f,_0x330b7b){return function(_0x4e31a7){if(!_0x4e31a7){_0x12365f['sendStatus'](0x194);}return _0x4e31a7;};}function handleError(_0x40e8c3,_0x29d5cb){_0x29d5cb=_0x29d5cb||0x1f4;return function(_0x13a774){logger['error'](_0x13a774['stack']);if(_0x13a774['name']){delete _0x13a774[_0xece6('0x28')];}_0x40e8c3['status'](_0x29d5cb)[_0xece6('0x29')](_0x13a774);};}exports[_0xece6('0x2a')]=function(_0x105d2b,_0x1954c3){var _0x254b9b={},_0x527c28={},_0x1d4617={'count':0x0,'rows':[]};var _0x512c9f=_[_0xece6('0x2b')](db['OpenchannelQueue']['rawAttributes'],function(_0x8e291c){return{'name':_0x8e291c[_0xece6('0x2c')],'type':_0x8e291c[_0xece6('0x2d')][_0xece6('0x2e')]};});_0x527c28['model']=_[_0xece6('0x2b')](_0x512c9f,'name');_0x527c28[_0xece6('0x2f')]=_[_0xece6('0x30')](_0x105d2b[_0xece6('0x2f')]);_0x527c28[_0xece6('0x31')]=_[_0xece6('0x32')](_0x527c28[_0xece6('0x33')],_0x527c28[_0xece6('0x2f')]);_0x254b9b[_0xece6('0x34')]=_[_0xece6('0x32')](_0x527c28[_0xece6('0x33')],qs[_0xece6('0x35')](_0x105d2b[_0xece6('0x2f')]['fields']));_0x254b9b[_0xece6('0x34')]=_0x254b9b['attributes'][_0xece6('0x36')]?_0x254b9b[_0xece6('0x34')]:_0x527c28['model'];if(!_0x105d2b[_0xece6('0x2f')][_0xece6('0x37')](_0xece6('0x38'))){_0x254b9b[_0xece6('0x1e')]=qs[_0xece6('0x1e')](_0x105d2b[_0xece6('0x2f')][_0xece6('0x1e')]);_0x254b9b[_0xece6('0x39')]=qs['offset'](_0x105d2b[_0xece6('0x2f')][_0xece6('0x39')]);}_0x254b9b[_0xece6('0x3a')]=qs[_0xece6('0x3b')](_0x105d2b[_0xece6('0x2f')][_0xece6('0x3b')]);_0x254b9b[_0xece6('0x3c')]=qs[_0xece6('0x31')](_['pick'](_0x105d2b['query'],_0x527c28[_0xece6('0x31')]),_0x512c9f);if(_0x105d2b[_0xece6('0x2f')][_0xece6('0x3d')]){_0x254b9b[_0xece6('0x3c')]=_[_0xece6('0x3e')](_0x254b9b['where'],{'$or':_[_0xece6('0x2b')](_0x512c9f,function(_0x59f5e3){if(_0x59f5e3[_0xece6('0x2d')]!==_0xece6('0x3f')){var _0x3cf069={};_0x3cf069[_0x59f5e3[_0xece6('0x28')]]={'$like':'%'+_0x105d2b['query'][_0xece6('0x3d')]+'%'};return _0x3cf069;}})});}_0x254b9b=_[_0xece6('0x3e')]({},_0x254b9b,_0x105d2b[_0xece6('0x40')]);var _0x589c44={'where':_0x254b9b[_0xece6('0x3c')]};return db['OpenchannelQueue']['count'](_0x589c44)[_0xece6('0x24')](function(_0x13b623){_0x1d4617[_0xece6('0x1d')]=_0x13b623;if(_0x105d2b[_0xece6('0x2f')][_0xece6('0x41')]){_0x254b9b[_0xece6('0x42')]=[{'all':!![]}];}return db[_0xece6('0x43')][_0xece6('0x44')](_0x254b9b);})[_0xece6('0x24')](function(_0x1f4df1){_0x1d4617[_0xece6('0x45')]=_0x1f4df1;return _0x1d4617;})['then'](respondWithFilteredResult(_0x1954c3,_0x254b9b))[_0xece6('0x46')](handleError(_0x1954c3,null));};exports[_0xece6('0x47')]=function(_0x2718c9,_0xb806a6){var _0x2ad70c={'raw':!![],'where':{'id':_0x2718c9['params']['id']}},_0x1b382f={};_0x1b382f['model']=_[_0xece6('0x30')](db[_0xece6('0x43')][_0xece6('0x48')]);_0x1b382f[_0xece6('0x2f')]=_[_0xece6('0x30')](_0x2718c9['query']);_0x1b382f['filters']=_[_0xece6('0x32')](_0x1b382f[_0xece6('0x33')],_0x1b382f['query']);_0x2ad70c[_0xece6('0x34')]=_[_0xece6('0x32')](_0x1b382f[_0xece6('0x33')],qs[_0xece6('0x35')](_0x2718c9[_0xece6('0x2f')]['fields']));_0x2ad70c[_0xece6('0x34')]=_0x2ad70c[_0xece6('0x34')][_0xece6('0x36')]?_0x2ad70c['attributes']:_0x1b382f['model'];if(_0x2718c9[_0xece6('0x2f')][_0xece6('0x41')]){_0x2ad70c[_0xece6('0x42')]=[{'all':!![]}];}_0x2ad70c=_['merge']({},_0x2ad70c,_0x2718c9[_0xece6('0x40')]);return db['OpenchannelQueue'][_0xece6('0x49')](_0x2ad70c)[_0xece6('0x24')](handleEntityNotFound(_0xb806a6,null))[_0xece6('0x24')](respondWithResult(_0xb806a6,null))[_0xece6('0x46')](handleError(_0xb806a6,null));};exports[_0xece6('0x4a')]=function(_0x5746f6,_0x257de1){return db[_0xece6('0x43')]['create'](_0x5746f6[_0xece6('0x4b')],{})[_0xece6('0x24')](function(_0x221b50){var _0x517fdc=_0x5746f6[_0xece6('0x4c')][_0xece6('0x26')]({'plain':!![]});if(!_0x517fdc)throw new Error(_0xece6('0x4d'));if(_0x517fdc['role']===_0xece6('0x4c')){var _0x5d8577=_0x221b50['get']({'plain':!![]});var _0x23e0b5=_0xece6('0x4e');return db[_0xece6('0x4f')][_0xece6('0x49')]({'where':{'name':_0x23e0b5,'userProfileId':_0x517fdc[_0xece6('0x50')]},'raw':!![]})['then'](function(_0x46ca50){if(_0x46ca50&&_0x46ca50[_0xece6('0x51')]===0x0){return db[_0xece6('0x27')][_0xece6('0x4a')]({'name':_0x5d8577[_0xece6('0x28')],'resourceId':_0x5d8577['id'],'type':_0x46ca50['name'],'sectionId':_0x46ca50['id']},{})[_0xece6('0x24')](function(){return _0x221b50;});}else{return _0x221b50;}})[_0xece6('0x46')](function(_0x222026){logger[_0xece6('0x52')](_0xece6('0x53'),_0x222026);throw _0x222026;});}return _0x221b50;})[_0xece6('0x24')](respondWithResult(_0x257de1,0xc9))[_0xece6('0x46')](handleError(_0x257de1,null));};exports[_0xece6('0x54')]=function(_0x56b064,_0x26cfdb){if(_0x56b064['body']['id']){delete _0x56b064['body']['id'];}return db[_0xece6('0x43')][_0xece6('0x49')]({'where':{'id':_0x56b064[_0xece6('0x55')]['id']}})[_0xece6('0x24')](handleEntityNotFound(_0x26cfdb,null))[_0xece6('0x24')](saveUpdates(_0x56b064[_0xece6('0x4b')],null))[_0xece6('0x24')](respondWithResult(_0x26cfdb,null))[_0xece6('0x46')](handleError(_0x26cfdb,null));};exports['destroy']=function(_0x7178c7,_0x57742c){return db[_0xece6('0x43')][_0xece6('0x49')]({'where':{'id':_0x7178c7[_0xece6('0x55')]['id']}})[_0xece6('0x24')](handleEntityNotFound(_0x57742c,null))[_0xece6('0x24')](removeEntity(_0x57742c,null))[_0xece6('0x46')](handleError(_0x57742c,null));};exports[_0xece6('0x56')]=function(_0x111a38,_0x415f4b){return db[_0xece6('0x43')][_0xece6('0x56')]()[_0xece6('0x24')](respondWithResult(_0x415f4b,null))['catch'](handleError(_0x415f4b,null));};exports['getMembers']=function(_0x184c4f,_0x5e7c45,_0xb6940c){var _0x3fee36={'raw':!![],'where':{}},_0x2cfce3={},_0x3beb49;return db['OpenchannelQueue'][_0xece6('0x57')]({'where':{'id':_0x184c4f['params']['id']}})[_0xece6('0x24')](handleEntityNotFound(_0x5e7c45,null))['then'](function(_0x33f48d){if(_0x33f48d){_0x3beb49=_0x33f48d[_0xece6('0x26')]({'plain':!![]});_0x2cfce3[_0xece6('0x33')]=_[_0xece6('0x30')](db[_0xece6('0x58')][_0xece6('0x48')]);_0x2cfce3['query']=_[_0xece6('0x30')](_0x184c4f[_0xece6('0x2f')]);_0x2cfce3['filters']=_[_0xece6('0x32')](_0x2cfce3['model'],_0x2cfce3['query']);_0x3fee36[_0xece6('0x34')]=_[_0xece6('0x32')](_0x2cfce3[_0xece6('0x33')],qs[_0xece6('0x35')](_0x184c4f[_0xece6('0x2f')]['fields']));_0x3fee36[_0xece6('0x34')]=_0x3fee36[_0xece6('0x34')][_0xece6('0x36')]?_0x3fee36[_0xece6('0x34')]:_0x2cfce3['model'];if(!_0x184c4f[_0xece6('0x2f')][_0xece6('0x37')](_0xece6('0x38'))){_0x3fee36[_0xece6('0x1e')]=qs['limit'](_0x184c4f[_0xece6('0x2f')]['limit']);_0x3fee36[_0xece6('0x39')]=qs['offset'](_0x184c4f[_0xece6('0x2f')][_0xece6('0x39')]);}_0x3fee36[_0xece6('0x3a')]=qs[_0xece6('0x3b')](_0x184c4f[_0xece6('0x2f')][_0xece6('0x3b')]);_0x3fee36[_0xece6('0x3c')]=qs[_0xece6('0x31')](_[_0xece6('0x59')](_0x184c4f[_0xece6('0x2f')],_0x2cfce3['filters']));_0x3fee36[_0xece6('0x3c')][_0xece6('0x5a')]=_0x33f48d['id'];if(_0x184c4f[_0xece6('0x2f')][_0xece6('0x3d')]){_0x3fee36['where']=_[_0xece6('0x3e')](_0x3fee36[_0xece6('0x3c')],{'$or':_[_0xece6('0x2b')](_0x3fee36[_0xece6('0x34')],function(_0x276679){var _0x27d3e1={};_0x27d3e1[_0x276679]={'$like':'%'+_0x184c4f[_0xece6('0x2f')][_0xece6('0x3d')]+'%'};return _0x27d3e1;})});}_0x3fee36=_[_0xece6('0x3e')]({},_0x3fee36,_0x184c4f[_0xece6('0x40')]);return db[_0xece6('0x58')]['findAll'](_0x3fee36);}})['then'](function(_0x509451){if(_0x509451){return db[_0xece6('0x5b')][_0xece6('0x5c')]({'where':{'id':_['map'](_0x509451,_0xece6('0x5d')),'role':_0xece6('0x5e')},'attributes':['id',_0xece6('0x28'),_0xece6('0x5f'),_0xece6('0x60'),_0xece6('0x61')]});}})['then'](function(_0x341de2){if(_0x341de2){return{'count':_0x341de2[_0xece6('0x1d')],'rows':_[_0xece6('0x2b')](_0x341de2[_0xece6('0x45')],function(_0x38c01a){return{'membername':_0x38c01a['name'],'UserId':_0x38c01a['id'],'queue_name':_0x3beb49[_0xece6('0x28')],'OpenchannelQueueId':_0x3beb49['id'],'interface':util[_0xece6('0x62')](_0xece6('0x63'),_0xece6('0x64'),_0x38c01a[_0xece6('0x28')]),'penalty':0x0,'paused':_0x38c01a[_0xece6('0x5f')],'createdAt':_0x38c01a['createdAt'],'updatedAt':_0x38c01a[_0xece6('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xece6('0x24')](respondWithFilteredResult(_0x5e7c45,_0x3fee36))[_0xece6('0x46')](handleError(_0x5e7c45,null));};exports[_0xece6('0x65')]=function(_0x4d6cd8,_0x5c3bf5,_0x1165da){var _0x529a9a={};var _0x53b53d={};var _0x13bd6f;var _0x1fc350;return db[_0xece6('0x43')][_0xece6('0x57')]({'where':{'id':_0x4d6cd8[_0xece6('0x55')]['id']}})[_0xece6('0x24')](handleEntityNotFound(_0x5c3bf5,null))[_0xece6('0x24')](function(_0x32ad32){if(_0x32ad32){_0x13bd6f=_0x32ad32;_0x53b53d['model']=_[_0xece6('0x30')](db[_0xece6('0x66')]['rawAttributes']);_0x53b53d[_0xece6('0x2f')]=_[_0xece6('0x30')](_0x4d6cd8[_0xece6('0x2f')]);_0x53b53d['filters']=_[_0xece6('0x32')](_0x53b53d[_0xece6('0x33')],_0x53b53d['query']);_0x529a9a[_0xece6('0x34')]=_[_0xece6('0x32')](_0x53b53d[_0xece6('0x33')],qs[_0xece6('0x35')](_0x4d6cd8['query'][_0xece6('0x35')]));_0x529a9a['attributes']=_0x529a9a['attributes']['length']?_0x529a9a[_0xece6('0x34')]:_0x53b53d['model'];_0x529a9a['order']=qs[_0xece6('0x3b')](_0x4d6cd8[_0xece6('0x2f')][_0xece6('0x3b')]);_0x529a9a[_0xece6('0x3c')]=qs['filters'](_[_0xece6('0x59')](_0x4d6cd8[_0xece6('0x2f')],_0x53b53d[_0xece6('0x31')]));if(_0x4d6cd8['query'][_0xece6('0x3d')]){_0x529a9a[_0xece6('0x3c')]=_[_0xece6('0x3e')](_0x529a9a[_0xece6('0x3c')],{'$or':_[_0xece6('0x2b')](_0x529a9a[_0xece6('0x34')],function(_0x215551){var _0x90b63c={};_0x90b63c[_0x215551]={'$like':'%'+_0x4d6cd8[_0xece6('0x2f')][_0xece6('0x3d')]+'%'};return _0x90b63c;})});}_0x529a9a=_[_0xece6('0x3e')]({},_0x529a9a,_0x4d6cd8[_0xece6('0x40')]);return _0x13bd6f[_0xece6('0x65')](_0x529a9a);}})[_0xece6('0x24')](function(_0x148077){if(_0x148077){_0x1fc350=_0x148077['length'];if(!_0x4d6cd8['query'][_0xece6('0x37')]('nolimit')){_0x529a9a[_0xece6('0x1e')]=qs[_0xece6('0x1e')](_0x4d6cd8['query'][_0xece6('0x1e')]);_0x529a9a['offset']=qs[_0xece6('0x39')](_0x4d6cd8[_0xece6('0x2f')]['offset']);}return _0x13bd6f['getTeams'](_0x529a9a);}})[_0xece6('0x24')](function(_0x4971fb){if(_0x4971fb){return _0x4971fb?{'count':_0x1fc350,'rows':_0x4971fb}:null;}})[_0xece6('0x24')](respondWithResult(_0x5c3bf5,null))['catch'](handleError(_0x5c3bf5,null));};exports[_0xece6('0x67')]=function(_0x2eeb20,_0x14ab4a,_0xe9ac12){var _0x5cb972=_0x2eeb20[_0xece6('0x4b')]['ids'];return db['Team'][_0xece6('0x44')]({'where':{'id':_0x5cb972},'attributes':['id'],'include':[{'model':db[_0xece6('0x5b')],'as':_0xece6('0x68'),'attributes':['id',_0xece6('0x28'),_0xece6('0x69'),_0xece6('0x6a'),_0xece6('0x6b')],'raw':!![]}]})[_0xece6('0x24')](function(_0x75def8){if(_0x75def8){var _0x1f8d36=_['flatMap'](_0x75def8,function(_0x915fb4){var _0xa2f7fc=_0x915fb4[_0xece6('0x26')]({'plain':!![]});return _0xa2f7fc[_0xece6('0x68')];});return db[_0xece6('0x43')][_0xece6('0x49')]({'where':{'id':_0x2eeb20[_0xece6('0x55')]['id']}})[_0xece6('0x24')](function(_0x444ae3){return db[_0xece6('0x6c')]['transaction'](function(_0x160786){return _0x444ae3['addTeams'](_0x5cb972,{'transaction':_0x160786})[_0xece6('0x24')](function(){return BPromise['each'](_0x1f8d36,function(_0x27b07e){return db[_0xece6('0x58')]['findOrCreate']({'where':{'UserId':_0x27b07e['id'],'OpenchannelQueueId':_0x2eeb20['params']['id']},'transaction':_0x160786});});})['then'](function(){_0x1f8d36[_0xece6('0x6d')](function(_0x2c2f2f){socket[_0xece6('0x6e')](_0xece6('0x6f'),{'UserId':_0x2c2f2f['id'],'OpenchannelQueueId':_0x444ae3['id']});});});});});}})[_0xece6('0x24')](respondWithStatusCode(_0x14ab4a,null))['catch'](handleError(_0x14ab4a,null));};exports[_0xece6('0x70')]=function(_0x440cf7,_0xdcb2bb,_0x4fb177){return db['Team'][_0xece6('0x44')]({'where':{'id':_0x440cf7[_0xece6('0x2f')][_0xece6('0x71')]},'attributes':['id'],'include':[{'model':db[_0xece6('0x5b')],'as':_0xece6('0x68'),'attributes':['id'],'raw':!![]}]})[_0xece6('0x24')](handleEntityNotFound(_0xdcb2bb,null))[_0xece6('0x24')](function(_0xc6ff50){var _0x1abfe9=_[_0xece6('0x2b')](_0xc6ff50,'id');var _0x275937=[];var _0xab16fd=[];var _0x5bb38d=squel[_0xece6('0x72')]();_0x5bb38d[_0xece6('0x73')](_0xece6('0x74'))[_0xece6('0x75')](_0xece6('0x76'),'tq')['join'](_0xece6('0x77'),'ut',_0xece6('0x78'))['where'](_0xece6('0x79'),_0x440cf7['params']['id']);for(var _0xf9870a=0x0;_0xf9870a<_0xc6ff50[_0xece6('0x36')];_0xf9870a+=0x1){let _0xd92d49=_0xc6ff50[_0xf9870a];for(var _0x2dd547=0x0;_0x2dd547<_0xd92d49[_0xece6('0x68')][_0xece6('0x36')];_0x2dd547+=0x1){let _0x567db1=_0xd92d49[_0xece6('0x68')][_0x2dd547];var _0x1a15fd=_0x5bb38d[_0xece6('0x7a')]();_0x1a15fd[_0xece6('0x3c')](_0xece6('0x7b'),_0x567db1['id']);_0xab16fd[_0xece6('0x7c')](db[_0xece6('0x6c')][_0xece6('0x2f')](_0x1a15fd[_0xece6('0x7d')](),{'type':db[_0xece6('0x6c')][_0xece6('0x7e')][_0xece6('0x7f')]})['then'](function(_0x34e8e1){if(_0x34e8e1[_0xece6('0x36')]===0x1){return _0x567db1['id'];}else{var _0x5cb78e=_[_0xece6('0x80')](_[_0xece6('0x2b')](_0x34e8e1,'TeamId'),function(_0x13acea){return _[_0xece6('0x81')](_0x1abfe9,_0x13acea);});if(_0x5cb78e){return _0x567db1['id'];}}}));}}return BPromise['all'](_0xab16fd)[_0xece6('0x24')](function(_0x26f329){_0x275937=_(_0x275937)[_0xece6('0x82')](_0x26f329)[_0xece6('0x83')]()['value']();return db['OpenchannelQueue'][_0xece6('0x49')]({'where':{'id':_0x440cf7[_0xece6('0x55')]['id']}})[_0xece6('0x24')](function(_0x1ca6a1){return db[_0xece6('0x6c')][_0xece6('0x84')](function(_0x44d1a2){return _0x1ca6a1[_0xece6('0x70')](_0x440cf7[_0xece6('0x2f')][_0xece6('0x71')],{'transaction':_0x44d1a2})[_0xece6('0x24')](function(){if(!_[_0xece6('0x85')](_0x275937)){return _0x1ca6a1[_0xece6('0x86')](_0x275937,{'transaction':_0x44d1a2});}})[_0xece6('0x24')](function(){_0x275937['forEach'](function(_0x318812){socket[_0xece6('0x6e')](_0xece6('0x87'),{'UserId':_0x318812,'OpenchannelQueueId':_0x1ca6a1['id']});});});});});});})['then'](respondWithStatusCode(_0xdcb2bb,null))[_0xece6('0x46')](handleError(_0xdcb2bb,null));};exports[_0xece6('0x88')]=function(_0x42d7d2,_0x55ad03,_0x33d687){return db[_0xece6('0x43')][_0xece6('0x49')]({'where':{'id':_0x42d7d2[_0xece6('0x55')]['id']}})[_0xece6('0x24')](handleEntityNotFound(_0x55ad03,null))[_0xece6('0x24')](function(_0x9ad5b2){if(_0x9ad5b2){return _0x9ad5b2[_0xece6('0x88')](_0x42d7d2['body'][_0xece6('0x71')],_[_0xece6('0x89')](_0x42d7d2[_0xece6('0x4b')],['ids','id'])||{})[_0xece6('0x8a')](function(_0x3e78fc){for(var _0x262670=0x0;_0x262670<_0x42d7d2[_0xece6('0x4b')][_0xece6('0x71')][_0xece6('0x36')];_0x262670+=0x1){socket[_0xece6('0x6e')](_0xece6('0x6f'),{'UserId':Number(_0x42d7d2['body'][_0xece6('0x71')][_0x262670]),'OpenchannelQueueId':Number(_0x42d7d2[_0xece6('0x55')]['id'])});}return _0x3e78fc;});}})[_0xece6('0x24')](respondWithResult(_0x55ad03,null))['catch'](handleError(_0x55ad03,null));};exports['removeAgents']=function(_0x2becb2,_0x54e72c,_0x579650){return db[_0xece6('0x43')]['find']({'where':{'id':_0x2becb2[_0xece6('0x55')]['id']}})[_0xece6('0x24')](handleEntityNotFound(_0x54e72c,null))[_0xece6('0x24')](function(_0x148331){if(_0x148331){return _0x148331[_0xece6('0x86')](_0x2becb2[_0xece6('0x2f')][_0xece6('0x71')])[_0xece6('0x24')](function(){if(_[_0xece6('0x8b')](_0x2becb2['query'][_0xece6('0x71')])){for(var _0x2bd5fd=0x0;_0x2bd5fd<_0x2becb2['query'][_0xece6('0x71')]['length'];_0x2bd5fd+=0x1){socket[_0xece6('0x6e')](_0xece6('0x87'),{'UserId':Number(_0x2becb2['query'][_0xece6('0x71')][_0x2bd5fd]),'OpenchannelQueueId':Number(_0x2becb2[_0xece6('0x55')]['id'])});}}else{socket[_0xece6('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2becb2['query'][_0xece6('0x71')]),'OpenchannelQueueId':Number(_0x2becb2[_0xece6('0x55')]['id'])});}});}})[_0xece6('0x24')](respondWithStatusCode(_0x54e72c,null))[_0xece6('0x46')](handleError(_0x54e72c,null));};exports['getAgents']=function(_0x27b7ee,_0xb5d01a,_0x3fad90){var _0x262b33={};var _0x5d1f9c={};var _0xf89324;var _0x2f8d45;return db[_0xece6('0x43')][_0xece6('0x57')]({'where':{'id':_0x27b7ee[_0xece6('0x55')]['id']}})['then'](handleEntityNotFound(_0xb5d01a,null))[_0xece6('0x24')](function(_0x372f30){if(_0x372f30){_0xf89324=_0x372f30;_0x5d1f9c['model']=_[_0xece6('0x30')](db[_0xece6('0x5b')][_0xece6('0x48')]);_0x5d1f9c['query']=_[_0xece6('0x30')](_0x27b7ee[_0xece6('0x2f')]);_0x5d1f9c[_0xece6('0x31')]=_[_0xece6('0x32')](_0x5d1f9c[_0xece6('0x33')],_0x5d1f9c[_0xece6('0x2f')]);_0x262b33[_0xece6('0x34')]=_[_0xece6('0x32')](_0x5d1f9c[_0xece6('0x33')],qs['fields'](_0x27b7ee[_0xece6('0x2f')][_0xece6('0x35')]));_0x262b33[_0xece6('0x34')]=_0x262b33[_0xece6('0x34')][_0xece6('0x36')]?_0x262b33[_0xece6('0x34')]:_0x5d1f9c[_0xece6('0x33')];_0x262b33[_0xece6('0x3a')]=qs[_0xece6('0x3b')](_0x27b7ee[_0xece6('0x2f')][_0xece6('0x3b')]);_0x262b33[_0xece6('0x3c')]=qs[_0xece6('0x31')](_['pick'](_0x27b7ee[_0xece6('0x2f')],_0x5d1f9c[_0xece6('0x31')]));if(_0x27b7ee['query']['filter']){_0x262b33[_0xece6('0x3c')]=_[_0xece6('0x3e')](_0x262b33[_0xece6('0x3c')],{'$or':_[_0xece6('0x2b')](_0x262b33[_0xece6('0x34')],function(_0x4164d5){var _0x272cd8={};_0x272cd8[_0x4164d5]={'$like':'%'+_0x27b7ee['query'][_0xece6('0x3d')]+'%'};return _0x272cd8;})});}_0x262b33=_[_0xece6('0x3e')]({},_0x262b33,_0x27b7ee[_0xece6('0x40')]);return _0xf89324[_0xece6('0x8c')](_0x262b33);}})[_0xece6('0x24')](function(_0x3d9ff9){if(_0x3d9ff9){_0x2f8d45=_0x3d9ff9[_0xece6('0x36')];if(!_0x27b7ee[_0xece6('0x2f')][_0xece6('0x37')]('nolimit')){_0x262b33[_0xece6('0x1e')]=qs['limit'](_0x27b7ee[_0xece6('0x2f')][_0xece6('0x1e')]);_0x262b33[_0xece6('0x39')]=qs[_0xece6('0x39')](_0x27b7ee['query'][_0xece6('0x39')]);}return _0xf89324[_0xece6('0x8c')](_0x262b33);}})['then'](function(_0x4fd387){if(_0x4fd387){return _0x4fd387?{'count':_0x2f8d45,'rows':_0x4fd387}:null;}})[_0xece6('0x24')](respondWithResult(_0xb5d01a,null))[_0xece6('0x46')](handleError(_0xb5d01a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d57661d..078ed7f 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 _0x81aa=['emit','hasOwnProperty','setMaxListeners','save','update'];(function(_0x58ffe2,_0x3198b3){var _0x561be7=function(_0x3dd6f0){while(--_0x3dd6f0){_0x58ffe2['push'](_0x58ffe2['shift']());}};_0x561be7(++_0x3198b3);}(_0x81aa,0xd9));var _0xa81a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x81aa[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa81a('0x0')](0x0);var events={'afterCreate':_0xa81a('0x1'),'afterUpdate':_0xa81a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x21cee7){return function(_0x57091c,_0x30cef8,_0x414473){OpenchannelQueueEvents['emit'](_0x21cee7+':'+_0x57091c['id'],_0x57091c);OpenchannelQueueEvents[_0xa81a('0x3')](_0x21cee7,_0x57091c);_0x414473(null);};}for(var e in events){if(events[_0xa81a('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x1811=['save','update','remove','emit','hasOwnProperty','exports','events','OpenchannelQueue','setMaxListeners'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0x1811,0x1da));var _0x1181=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x1811[_0x2bf888];return _0x3038d6;};'use strict';var EventEmitter=require(_0x1181('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x1181('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1181('0x2')](0x0);var events={'afterCreate':_0x1181('0x3'),'afterUpdate':_0x1181('0x4'),'afterDestroy':_0x1181('0x5')};function emitEvent(_0x2fe4f7){return function(_0x5b0b8e,_0x42e378,_0x80f6b7){OpenchannelQueueEvents['emit'](_0x2fe4f7+':'+_0x5b0b8e['id'],_0x5b0b8e);OpenchannelQueueEvents[_0x1181('0x6')](_0x2fe4f7,_0x5b0b8e);_0x80f6b7(null);};}for(var e in events){if(events[_0x1181('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x1181('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index d63f4cb..988d843 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 _0x1435=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50148e,_0x4c99c7){var _0x446e9d=function(_0x42a9ed){while(--_0x42a9ed){_0x50148e['push'](_0x50148e['shift']());}};_0x446e9d(++_0x4c99c7);}(_0x1435,0xae));var _0x5143=function(_0x33e31d,_0x5c1641){_0x33e31d=_0x33e31d-0x0;var _0x43cc52=_0x1435[_0x33e31d];return _0x43cc52;};'use strict';var _=require(_0x5143('0x0'));var util=require(_0x5143('0x1'));var logger=require(_0x5143('0x2'))(_0x5143('0x3'));var moment=require(_0x5143('0x4'));var BPromise=require(_0x5143('0x5'));var rp=require(_0x5143('0x6'));var fs=require('fs');var path=require(_0x5143('0x7'));var rimraf=require(_0x5143('0x8'));var config=require(_0x5143('0x9'));var attributes=require(_0x5143('0xa'));module[_0x5143('0xb')]=function(_0x13002a,_0x32028c){return _0x13002a[_0x5143('0xc')](_0x5143('0xd'),attributes,{'tableName':_0x5143('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa50e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x2a053e,_0x5e5b6d){var _0x177a02=function(_0x2232d1){while(--_0x2232d1){_0x2a053e['push'](_0x2a053e['shift']());}};_0x177a02(++_0x5e5b6d);}(_0xa50e,0x114));var _0xea50=function(_0x450e3f,_0x345d5a){_0x450e3f=_0x450e3f-0x0;var _0x210b98=_0xa50e[_0x450e3f];return _0x210b98;};'use strict';var _=require('lodash');var util=require(_0xea50('0x0'));var logger=require(_0xea50('0x1'))(_0xea50('0x2'));var moment=require('moment');var BPromise=require(_0xea50('0x3'));var rp=require(_0xea50('0x4'));var fs=require('fs');var path=require(_0xea50('0x5'));var rimraf=require(_0xea50('0x6'));var config=require('../../config/environment');var attributes=require(_0xea50('0x7'));module[_0xea50('0x8')]=function(_0x14bfe8,_0x5b26c7){return _0x14bfe8[_0xea50('0x9')](_0xea50('0xa'),attributes,{'tableName':_0xea50('0xb'),'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 95f9767..2ecb967 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 _0x0e7c=['raw','where','limit','include','model','attributes','map','catch','ShowOpenchannelQueue','find','then','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options'];(function(_0x260f83,_0x514732){var _0xe51971=function(_0x194435){while(--_0x194435){_0x260f83['push'](_0x260f83['shift']());}};_0xe51971(++_0x514732);}(_0x0e7c,0x187));var _0xc0e7=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x0e7c[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0xc0e7('0x0'));var util=require(_0xc0e7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc0e7('0x2'));var fs=require('fs');var Redis=require(_0xc0e7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0e7('0x4'));var logger=require(_0xc0e7('0x5'))(_0xc0e7('0x6'));var config=require('../../config/environment');var jayson=require(_0xc0e7('0x7'));var client=jayson[_0xc0e7('0x8')]['http']({'port':0x232a});config[_0xc0e7('0x9')]=_[_0xc0e7('0xa')](config[_0xc0e7('0x9')],{'host':_0xc0e7('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc0e7('0x9')]));require('./openchannelQueue.socket')[_0xc0e7('0xc')](socket);function respondWithRpcPromise(_0x16c87d,_0x4f3f9,_0x2733ee){return new BPromise(function(_0x557e7a,_0x144242){return client['request'](_0x16c87d,_0x2733ee)['then'](function(_0x2ebe13){logger[_0xc0e7('0xd')](_0xc0e7('0xe'),_0x4f3f9,_0xc0e7('0xf'));logger[_0xc0e7('0x10')](_0xc0e7('0x11'),_0x4f3f9,_0xc0e7('0xf'),JSON[_0xc0e7('0x12')](_0x2ebe13));if(_0x2ebe13[_0xc0e7('0x13')]){if(_0x2ebe13[_0xc0e7('0x13')][_0xc0e7('0x14')]===0x1f4){logger[_0xc0e7('0x13')](_0xc0e7('0xe'),_0x4f3f9,_0x2ebe13['error'][_0xc0e7('0x15')]);return _0x144242(_0x2ebe13[_0xc0e7('0x13')][_0xc0e7('0x15')]);}logger[_0xc0e7('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4f3f9,_0x2ebe13[_0xc0e7('0x13')]['message']);return _0x557e7a(_0x2ebe13[_0xc0e7('0x13')][_0xc0e7('0x15')]);}else{logger[_0xc0e7('0xd')](_0xc0e7('0xe'),_0x4f3f9,_0xc0e7('0xf'));_0x557e7a(_0x2ebe13[_0xc0e7('0x16')][_0xc0e7('0x15')]);}})['catch'](function(_0x33d312){logger[_0xc0e7('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4f3f9,_0x33d312);_0x144242(_0x33d312);});});}exports[_0xc0e7('0x17')]=function(_0x53dae2){var _0x32658e=this;return new Promise(function(_0x3e12db,_0x2b45cd){return db[_0xc0e7('0x18')][_0xc0e7('0x19')]({'raw':_0x53dae2[_0xc0e7('0x1a')]?_0x53dae2[_0xc0e7('0x1a')][_0xc0e7('0x1b')]===undefined?!![]:![]:!![],'where':_0x53dae2[_0xc0e7('0x1a')]?_0x53dae2[_0xc0e7('0x1a')][_0xc0e7('0x1c')]||null:null,'attributes':_0x53dae2['options']?_0x53dae2[_0xc0e7('0x1a')]['attributes']||null:null,'limit':_0x53dae2[_0xc0e7('0x1a')]?_0x53dae2[_0xc0e7('0x1a')][_0xc0e7('0x1d')]||null:null,'include':_0x53dae2['options']?_0x53dae2[_0xc0e7('0x1a')]['include']?_['map'](_0x53dae2[_0xc0e7('0x1a')][_0xc0e7('0x1e')],function(_0x40c89b){return{'model':db[_0x40c89b[_0xc0e7('0x1f')]],'as':_0x40c89b['as'],'attributes':_0x40c89b[_0xc0e7('0x20')],'include':_0x40c89b[_0xc0e7('0x1e')]?_[_0xc0e7('0x21')](_0x40c89b[_0xc0e7('0x1e')],function(_0x18d1c1){return{'model':db[_0x18d1c1['model']],'as':_0x18d1c1['as'],'attributes':_0x18d1c1[_0xc0e7('0x20')],'include':_0x18d1c1[_0xc0e7('0x1e')]?_[_0xc0e7('0x21')](_0x18d1c1['include'],function(_0x224387){return{'model':db[_0x224387[_0xc0e7('0x1f')]],'as':_0x224387['as'],'attributes':_0x224387['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x517bc0){logger[_0xc0e7('0xd')](_0xc0e7('0x17'),_0x53dae2);logger[_0xc0e7('0x10')]('GetOpenchannelQueue',_0x53dae2,JSON[_0xc0e7('0x12')](_0x517bc0));_0x3e12db(_0x517bc0);})[_0xc0e7('0x22')](function(_0x340f37){logger[_0xc0e7('0x13')](_0xc0e7('0x17'),_0x340f37['message'],_0x53dae2);_0x2b45cd(_0x32658e[_0xc0e7('0x13')](0x1f4,_0x340f37[_0xc0e7('0x15')]));});});};exports[_0xc0e7('0x23')]=function(_0xfbaf63){var _0x4c5f34=this;return new Promise(function(_0x1784a9,_0xf7ad02){return db[_0xc0e7('0x18')][_0xc0e7('0x24')]({'raw':_0xfbaf63['options']?_0xfbaf63[_0xc0e7('0x1a')][_0xc0e7('0x1b')]===undefined?!![]:![]:!![],'where':_0xfbaf63[_0xc0e7('0x1a')]?_0xfbaf63[_0xc0e7('0x1a')][_0xc0e7('0x1c')]||null:null,'attributes':_0xfbaf63[_0xc0e7('0x1a')]?_0xfbaf63['options'][_0xc0e7('0x20')]||null:null,'include':_0xfbaf63['options']?_0xfbaf63[_0xc0e7('0x1a')][_0xc0e7('0x1e')]?_['map'](_0xfbaf63[_0xc0e7('0x1a')][_0xc0e7('0x1e')],function(_0x2ed414){return{'model':db[_0x2ed414[_0xc0e7('0x1f')]],'as':_0x2ed414['as'],'attributes':_0x2ed414[_0xc0e7('0x20')],'include':_0x2ed414[_0xc0e7('0x1e')]?_[_0xc0e7('0x21')](_0x2ed414[_0xc0e7('0x1e')],function(_0x552cdd){return{'model':db[_0x552cdd[_0xc0e7('0x1f')]],'as':_0x552cdd['as'],'attributes':_0x552cdd[_0xc0e7('0x20')],'include':_0x552cdd[_0xc0e7('0x1e')]?_[_0xc0e7('0x21')](_0x552cdd[_0xc0e7('0x1e')],function(_0x50f5d4){return{'model':db[_0x50f5d4[_0xc0e7('0x1f')]],'as':_0x50f5d4['as'],'attributes':_0x50f5d4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc0e7('0x25')](function(_0x25c0e2){logger[_0xc0e7('0xd')](_0xc0e7('0x23'),_0xfbaf63);logger['debug'](_0xc0e7('0x23'),_0xfbaf63,JSON[_0xc0e7('0x12')](_0x25c0e2));_0x1784a9(_0x25c0e2);})[_0xc0e7('0x22')](function(_0x867c7b){logger['error'](_0xc0e7('0x23'),_0x867c7b[_0xc0e7('0x15')],_0xfbaf63);_0xf7ad02(_0x4c5f34['error'](0x1f4,_0x867c7b[_0xc0e7('0x15')]));});});}; \ No newline at end of file +var _0xf25d=['debug','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','options','where','attributes','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','info','request\x20sent'];(function(_0x44624a,_0x300434){var _0x462245=function(_0x3aface){while(--_0x3aface){_0x44624a['push'](_0x44624a['shift']());}};_0x462245(++_0x300434);}(_0xf25d,0x8c));var _0xdf25=function(_0x57ee76,_0x130268){_0x57ee76=_0x57ee76-0x0;var _0x376e0e=_0xf25d[_0x57ee76];return _0x376e0e;};'use strict';var _=require('lodash');var util=require(_0xdf25('0x0'));var moment=require(_0xdf25('0x1'));var BPromise=require(_0xdf25('0x2'));var rs=require(_0xdf25('0x3'));var fs=require('fs');var Redis=require(_0xdf25('0x4'));var db=require(_0xdf25('0x5'))['db'];var utils=require(_0xdf25('0x6'));var logger=require(_0xdf25('0x7'))(_0xdf25('0x8'));var config=require(_0xdf25('0x9'));var jayson=require(_0xdf25('0xa'));var client=jayson[_0xdf25('0xb')][_0xdf25('0xc')]({'port':0x232a});config[_0xdf25('0xd')]=_['defaults'](config[_0xdf25('0xd')],{'host':_0xdf25('0xe'),'port':0x18eb});var socket=require(_0xdf25('0xf'))(new Redis(config[_0xdf25('0xd')]));require(_0xdf25('0x10'))[_0xdf25('0x11')](socket);function respondWithRpcPromise(_0x95344f,_0x3f619f,_0x3a733d){return new BPromise(function(_0x3fc273,_0x4120ae){return client['request'](_0x95344f,_0x3a733d)['then'](function(_0x3ba4bf){logger[_0xdf25('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x3f619f,_0xdf25('0x13'));logger[_0xdf25('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3f619f,_0xdf25('0x13'),JSON['stringify'](_0x3ba4bf));if(_0x3ba4bf[_0xdf25('0x15')]){if(_0x3ba4bf[_0xdf25('0x15')][_0xdf25('0x16')]===0x1f4){logger[_0xdf25('0x15')](_0xdf25('0x17'),_0x3f619f,_0x3ba4bf[_0xdf25('0x15')][_0xdf25('0x18')]);return _0x4120ae(_0x3ba4bf[_0xdf25('0x15')][_0xdf25('0x18')]);}logger[_0xdf25('0x15')](_0xdf25('0x17'),_0x3f619f,_0x3ba4bf['error'][_0xdf25('0x18')]);return _0x3fc273(_0x3ba4bf['error']['message']);}else{logger[_0xdf25('0x12')](_0xdf25('0x17'),_0x3f619f,'request\x20sent');_0x3fc273(_0x3ba4bf[_0xdf25('0x19')][_0xdf25('0x18')]);}})[_0xdf25('0x1a')](function(_0x24a023){logger['error'](_0xdf25('0x17'),_0x3f619f,_0x24a023);_0x4120ae(_0x24a023);});});}exports['GetOpenchannelQueue']=function(_0x2d38ac){var _0x256b17=this;return new Promise(function(_0x4360ea,_0x21ad60){return db[_0xdf25('0x1b')]['findAll']({'raw':_0x2d38ac[_0xdf25('0x1c')]?_0x2d38ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d38ac[_0xdf25('0x1c')]?_0x2d38ac[_0xdf25('0x1c')][_0xdf25('0x1d')]||null:null,'attributes':_0x2d38ac[_0xdf25('0x1c')]?_0x2d38ac[_0xdf25('0x1c')][_0xdf25('0x1e')]||null:null,'limit':_0x2d38ac[_0xdf25('0x1c')]?_0x2d38ac[_0xdf25('0x1c')]['limit']||null:null,'include':_0x2d38ac[_0xdf25('0x1c')]?_0x2d38ac[_0xdf25('0x1c')][_0xdf25('0x1f')]?_[_0xdf25('0x20')](_0x2d38ac[_0xdf25('0x1c')][_0xdf25('0x1f')],function(_0x2125ed){return{'model':db[_0x2125ed['model']],'as':_0x2125ed['as'],'attributes':_0x2125ed[_0xdf25('0x1e')],'include':_0x2125ed[_0xdf25('0x1f')]?_[_0xdf25('0x20')](_0x2125ed[_0xdf25('0x1f')],function(_0x27580e){return{'model':db[_0x27580e['model']],'as':_0x27580e['as'],'attributes':_0x27580e[_0xdf25('0x1e')],'include':_0x27580e[_0xdf25('0x1f')]?_[_0xdf25('0x20')](_0x27580e[_0xdf25('0x1f')],function(_0x8949ba){return{'model':db[_0x8949ba[_0xdf25('0x21')]],'as':_0x8949ba['as'],'attributes':_0x8949ba[_0xdf25('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bca94){logger[_0xdf25('0x12')]('GetOpenchannelQueue',_0x2d38ac);logger[_0xdf25('0x14')](_0xdf25('0x22'),_0x2d38ac,JSON[_0xdf25('0x23')](_0x1bca94));_0x4360ea(_0x1bca94);})[_0xdf25('0x1a')](function(_0xd3e18e){logger[_0xdf25('0x15')]('GetOpenchannelQueue',_0xd3e18e['message'],_0x2d38ac);_0x21ad60(_0x256b17[_0xdf25('0x15')](0x1f4,_0xd3e18e[_0xdf25('0x18')]));});});};exports[_0xdf25('0x24')]=function(_0x1832aa){var _0x75f1d2=this;return new Promise(function(_0x117232,_0x21291c){return db[_0xdf25('0x1b')][_0xdf25('0x25')]({'raw':_0x1832aa['options']?_0x1832aa[_0xdf25('0x1c')][_0xdf25('0x26')]===undefined?!![]:![]:!![],'where':_0x1832aa[_0xdf25('0x1c')]?_0x1832aa[_0xdf25('0x1c')][_0xdf25('0x1d')]||null:null,'attributes':_0x1832aa[_0xdf25('0x1c')]?_0x1832aa['options'][_0xdf25('0x1e')]||null:null,'include':_0x1832aa[_0xdf25('0x1c')]?_0x1832aa['options']['include']?_[_0xdf25('0x20')](_0x1832aa[_0xdf25('0x1c')]['include'],function(_0x279815){return{'model':db[_0x279815[_0xdf25('0x21')]],'as':_0x279815['as'],'attributes':_0x279815[_0xdf25('0x1e')],'include':_0x279815['include']?_[_0xdf25('0x20')](_0x279815['include'],function(_0x2433b3){return{'model':db[_0x2433b3[_0xdf25('0x21')]],'as':_0x2433b3['as'],'attributes':_0x2433b3[_0xdf25('0x1e')],'include':_0x2433b3[_0xdf25('0x1f')]?_['map'](_0x2433b3[_0xdf25('0x1f')],function(_0x41209a){return{'model':db[_0x41209a['model']],'as':_0x41209a['as'],'attributes':_0x41209a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf25('0x27')](function(_0x235e48){logger[_0xdf25('0x12')](_0xdf25('0x24'),_0x1832aa);logger[_0xdf25('0x14')]('ShowOpenchannelQueue',_0x1832aa,JSON['stringify'](_0x235e48));_0x117232(_0x235e48);})[_0xdf25('0x1a')](function(_0x2a0c2b){logger['error'](_0xdf25('0x24'),_0x2a0c2b['message'],_0x1832aa);_0x21291c(_0x75f1d2['error'](0x1f4,_0x2a0c2b[_0xdf25('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index a848b2e..1461830 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 _0xc8f8=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update'];(function(_0xc52ae9,_0x2fe373){var _0x4a95b6=function(_0x28f58d){while(--_0x28f58d){_0xc52ae9['push'](_0xc52ae9['shift']());}};_0x4a95b6(++_0x2fe373);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xc8f8[_0x24f31b];return _0x488401;};'use strict';var OpenchannelQueueEvents=require(_0x8c8f('0x0'));var events=[_0x8c8f('0x1'),_0x8c8f('0x2'),_0x8c8f('0x3')];function createListener(_0x4e942c,_0x35014b){return function(_0x191cc8){_0x35014b['emit'](_0x4e942c,_0x191cc8);};}function removeListener(_0x264aa4,_0x40f46f){return function(){OpenchannelQueueEvents[_0x8c8f('0x4')](_0x264aa4,_0x40f46f);};}exports[_0x8c8f('0x5')]=function(_0x3bb625){for(var _0x224773=0x0,_0x3e6347=events[_0x8c8f('0x6')];_0x224773<_0x3e6347;_0x224773++){var _0x3ecf76=events[_0x224773];var _0x2172c8=createListener(_0x8c8f('0x7')+_0x3ecf76,_0x3bb625);OpenchannelQueueEvents['on'](_0x3ecf76,_0x2172c8);}}; \ No newline at end of file +var _0x24ff=['save','remove','update','emit','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x4d9195,_0x253869){var _0x49ab29=function(_0x55d451){while(--_0x55d451){_0x4d9195['push'](_0x4d9195['shift']());}};_0x49ab29(++_0x253869);}(_0x24ff,0x147));var _0xf24f=function(_0x4ac07a,_0x192301){_0x4ac07a=_0x4ac07a-0x0;var _0x5941e2=_0x24ff[_0x4ac07a];return _0x5941e2;};'use strict';var OpenchannelQueueEvents=require(_0xf24f('0x0'));var events=[_0xf24f('0x1'),_0xf24f('0x2'),_0xf24f('0x3')];function createListener(_0x1242ae,_0xb412d7){return function(_0x5285ca){_0xb412d7[_0xf24f('0x4')](_0x1242ae,_0x5285ca);};}function removeListener(_0x5067d4,_0x463e49){return function(){OpenchannelQueueEvents['removeListener'](_0x5067d4,_0x463e49);};}exports[_0xf24f('0x5')]=function(_0x4a7fc0){for(var _0x205ca8=0x0,_0x4b6c90=events[_0xf24f('0x6')];_0x205ca8<_0x4b6c90;_0x205ca8++){var _0x1b0c4a=events[_0x205ca8];var _0x1f857e=createListener(_0xf24f('0x7')+_0x1b0c4a,_0x4a7fc0);OpenchannelQueueEvents['on'](_0x1b0c4a,_0x1f857e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index f6f9ec5..f5f339c 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 _0x9928=['./openchannelQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xdf7e00,_0x3ced74){var _0x135654=function(_0x101c81){while(--_0x101c81){_0xdf7e00['push'](_0xdf7e00['shift']());}};_0x135654(++_0x3ced74);}(_0x9928,0x124));var _0x8992=function(_0x2170b1,_0x5c99e9){_0x2170b1=_0x2170b1-0x0;var _0x4be2c3=_0x9928[_0x2170b1];return _0x4be2c3;};'use strict';var multer=require(_0x8992('0x0'));var util=require(_0x8992('0x1'));var path=require(_0x8992('0x2'));var timeout=require(_0x8992('0x3'));var express=require(_0x8992('0x4'));var router=express[_0x8992('0x5')]();var fs_extra=require(_0x8992('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8992('0x7'));var config=require('../../config/environment');var controller=require(_0x8992('0x8'));router[_0x8992('0x9')]('/',auth[_0x8992('0xa')](),controller['index']);router[_0x8992('0x9')]('/describe',auth[_0x8992('0xa')](),controller[_0x8992('0xb')]);router['get'](_0x8992('0xc'),auth['isAuthenticated'](),controller[_0x8992('0xd')]);router[_0x8992('0xe')]('/',auth[_0x8992('0xa')](),controller[_0x8992('0xf')]);router[_0x8992('0x10')]('/:id',auth[_0x8992('0xa')](),controller[_0x8992('0x11')]);router[_0x8992('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8992('0x13')]=router; \ No newline at end of file +var _0x3b22=['Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x894e6,_0x14fb7e){var _0x6dd357=function(_0x171dbe){while(--_0x171dbe){_0x894e6['push'](_0x894e6['shift']());}};_0x6dd357(++_0x14fb7e);}(_0x3b22,0xd8));var _0x23b2=function(_0x349915,_0x124261){_0x349915=_0x349915-0x0;var _0x8be4f3=_0x3b22[_0x349915];return _0x8be4f3;};'use strict';var multer=require(_0x23b2('0x0'));var util=require(_0x23b2('0x1'));var path=require(_0x23b2('0x2'));var timeout=require(_0x23b2('0x3'));var express=require('express');var router=express[_0x23b2('0x4')]();var fs_extra=require(_0x23b2('0x5'));var auth=require(_0x23b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x23b2('0x7'));var controller=require(_0x23b2('0x8'));router[_0x23b2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x23b2('0x9')](_0x23b2('0xa'),auth[_0x23b2('0xb')](),controller[_0x23b2('0xc')]);router['get'](_0x23b2('0xd'),auth[_0x23b2('0xb')](),controller['show']);router[_0x23b2('0xe')]('/',auth['isAuthenticated'](),controller[_0x23b2('0xf')]);router[_0x23b2('0x10')](_0x23b2('0xd'),auth[_0x23b2('0xb')](),controller[_0x23b2('0x11')]);router[_0x23b2('0x12')](_0x23b2('0xd'),auth[_0x23b2('0xb')](),controller['destroy']);module[_0x23b2('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 79a5594..8da291d 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 _0xd324=['DATE','moment','sequelize','exports','STRING'];(function(_0x445a51,_0x1b82ba){var _0x25e133=function(_0x3c24b5){while(--_0x3c24b5){_0x445a51['push'](_0x445a51['shift']());}};_0x25e133(++_0x1b82ba);}(_0xd324,0x137));var _0x4d32=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0xd324[_0x2adfb1];return _0xa52d45;};'use strict';var moment=require(_0x4d32('0x0'));var Sequelize=require(_0x4d32('0x1'));module[_0x4d32('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4d32('0x3')]},'joinAt':{'type':Sequelize[_0x4d32('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4d32('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8eee=['STRING','DATE','moment','sequelize','exports'];(function(_0x57ee1d,_0x54111b){var _0x12a933=function(_0x5c9d92){while(--_0x5c9d92){_0x57ee1d['push'](_0x57ee1d['shift']());}};_0x12a933(++_0x54111b);}(_0x8eee,0xed));var _0xe8ee=function(_0x4081a5,_0x27e9e2){_0x4081a5=_0x4081a5-0x0;var _0x59f5d9=_0x8eee[_0x4081a5];return _0x59f5d9;};'use strict';var moment=require(_0xe8ee('0x0'));var Sequelize=require(_0xe8ee('0x1'));module[_0xe8ee('0x2')]={'uniqueid':{'type':Sequelize[_0xe8ee('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe8ee('0x3')]},'joinAt':{'type':Sequelize[_0xe8ee('0x4')]},'leaveAt':{'type':Sequelize[_0xe8ee('0x4')]},'acceptAt':{'type':Sequelize[_0xe8ee('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe8ee('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 58ee6af..ab019a9 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 _0xc6c5=['sox','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','mustache','path'];(function(_0x3046da,_0x599123){var _0x467db2=function(_0x17aa26){while(--_0x17aa26){_0x3046da['push'](_0x3046da['shift']());}};_0x467db2(++_0x599123);}(_0xc6c5,0x1ec));var _0x5c6c=function(_0x1295ac,_0x1fcba0){_0x1295ac=_0x1295ac-0x0;var _0xc07978=_0xc6c5[_0x1295ac];return _0xc07978;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c6c('0x0'));var zipdir=require(_0x5c6c('0x1'));var jsonpatch=require(_0x5c6c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c6c('0x3'));var util=require('util');var path=require(_0x5c6c('0x4'));var sox=require(_0x5c6c('0x5'));var csv=require('to-csv');var ejs=require(_0x5c6c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c6c('0x7'));var squel=require(_0x5c6c('0x8'));var crypto=require(_0x5c6c('0x9'));var jsforce=require(_0x5c6c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c6c('0xb'));var authService=require(_0x5c6c('0xc'));var qs=require(_0x5c6c('0xd'));var as=require(_0x5c6c('0xe'));var hardwareService=require(_0x5c6c('0xf'));var logger=require(_0x5c6c('0x10'))('api');var utils=require(_0x5c6c('0x11'));var config=require(_0x5c6c('0x12'));var licenseUtil=require(_0x5c6c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bdfda,_0x34719b){_0x34719b=_0x34719b||0xcc;return function(_0x3f740c){if(_0x3f740c){return _0x2bdfda[_0x5c6c('0x14')](_0x34719b);}return _0x2bdfda['status'](_0x34719b)['end']();};}function respondWithResult(_0x1ff5e6,_0x200473){_0x200473=_0x200473||0xc8;return function(_0x19efd6){if(_0x19efd6){return _0x1ff5e6[_0x5c6c('0x15')](_0x200473)[_0x5c6c('0x16')](_0x19efd6);}};}function respondWithFilteredResult(_0x126282,_0x23232f){return function(_0x282e24){if(_0x282e24){var _0x47a624=typeof _0x23232f[_0x5c6c('0x17')]===_0x5c6c('0x18')&&typeof _0x23232f[_0x5c6c('0x19')]===_0x5c6c('0x18');var _0x4cf0e7=_0x282e24[_0x5c6c('0x1a')];var _0xb5365c=_0x47a624?0x0:_0x23232f[_0x5c6c('0x17')];var _0x287d30=_0x47a624?_0x282e24[_0x5c6c('0x1a')]:_0x23232f[_0x5c6c('0x17')]+_0x23232f[_0x5c6c('0x19')];var _0x5acf84;if(_0x287d30>=_0x4cf0e7){_0x287d30=_0x4cf0e7;_0x5acf84=0xc8;}else{_0x5acf84=0xce;}_0x126282[_0x5c6c('0x15')](_0x5acf84);return _0x126282[_0x5c6c('0x1b')]('Content-Range',_0xb5365c+'-'+_0x287d30+'/'+_0x4cf0e7)['json'](_0x282e24);}return null;};}function patchUpdates(_0x43c25c){return function(_0x7b62cc){try{jsonpatch[_0x5c6c('0x1c')](_0x7b62cc,_0x43c25c,!![]);}catch(_0x2148aa){return BPromise[_0x5c6c('0x1d')](_0x2148aa);}return _0x7b62cc[_0x5c6c('0x1e')]();};}function saveUpdates(_0x4b8dd1,_0x3b7d6e){return function(_0x358e05){if(_0x358e05){return _0x358e05[_0x5c6c('0x1f')](_0x4b8dd1)[_0x5c6c('0x20')](function(_0x2a56c4){return _0x2a56c4;});}return null;};}function removeEntity(_0x1c11fa,_0x3b8b4c){return function(_0x122d9f){if(_0x122d9f){return _0x122d9f[_0x5c6c('0x21')]()[_0x5c6c('0x20')](function(){_0x1c11fa[_0x5c6c('0x15')](0xcc)[_0x5c6c('0x22')]();});}};}function handleEntityNotFound(_0x4c0345,_0x2089a7){return function(_0x1816b9){if(!_0x1816b9){_0x4c0345[_0x5c6c('0x14')](0x194);}return _0x1816b9;};}function handleError(_0x2bef54,_0x245de3){_0x245de3=_0x245de3||0x1f4;return function(_0x338bc0){logger[_0x5c6c('0x23')](_0x338bc0[_0x5c6c('0x24')]);if(_0x338bc0[_0x5c6c('0x25')]){delete _0x338bc0['name'];}_0x2bef54[_0x5c6c('0x15')](_0x245de3)[_0x5c6c('0x26')](_0x338bc0);};}exports[_0x5c6c('0x27')]=function(_0x2487bf,_0x4e5c56){var _0x559743={},_0xb1ebbb={},_0x59c9d7={'count':0x0,'rows':[]};var _0x13fd93=_[_0x5c6c('0x28')](db[_0x5c6c('0x29')][_0x5c6c('0x2a')],function(_0x4962e6){return{'name':_0x4962e6[_0x5c6c('0x2b')],'type':_0x4962e6[_0x5c6c('0x2c')][_0x5c6c('0x2d')]};});_0xb1ebbb['model']=_[_0x5c6c('0x28')](_0x13fd93,_0x5c6c('0x25'));_0xb1ebbb['query']=_[_0x5c6c('0x2e')](_0x2487bf[_0x5c6c('0x2f')]);_0xb1ebbb[_0x5c6c('0x30')]=_[_0x5c6c('0x31')](_0xb1ebbb['model'],_0xb1ebbb[_0x5c6c('0x2f')]);_0x559743['attributes']=_[_0x5c6c('0x31')](_0xb1ebbb[_0x5c6c('0x32')],qs[_0x5c6c('0x33')](_0x2487bf['query'][_0x5c6c('0x33')]));_0x559743[_0x5c6c('0x34')]=_0x559743[_0x5c6c('0x34')][_0x5c6c('0x35')]?_0x559743[_0x5c6c('0x34')]:_0xb1ebbb[_0x5c6c('0x32')];if(!_0x2487bf[_0x5c6c('0x2f')]['hasOwnProperty']('nolimit')){_0x559743[_0x5c6c('0x19')]=qs['limit'](_0x2487bf[_0x5c6c('0x2f')][_0x5c6c('0x19')]);_0x559743[_0x5c6c('0x17')]=qs[_0x5c6c('0x17')](_0x2487bf[_0x5c6c('0x2f')][_0x5c6c('0x17')]);}_0x559743[_0x5c6c('0x36')]=qs[_0x5c6c('0x37')](_0x2487bf[_0x5c6c('0x2f')][_0x5c6c('0x37')]);_0x559743[_0x5c6c('0x38')]=qs[_0x5c6c('0x30')](_['pick'](_0x2487bf[_0x5c6c('0x2f')],_0xb1ebbb[_0x5c6c('0x30')]),_0x13fd93);if(_0x2487bf[_0x5c6c('0x2f')][_0x5c6c('0x39')]){_0x559743[_0x5c6c('0x38')]=_[_0x5c6c('0x3a')](_0x559743[_0x5c6c('0x38')],{'$or':_[_0x5c6c('0x28')](_0x13fd93,function(_0x544a06){if(_0x544a06[_0x5c6c('0x2c')]!==_0x5c6c('0x3b')){var _0x586937={};_0x586937[_0x544a06['name']]={'$like':'%'+_0x2487bf[_0x5c6c('0x2f')][_0x5c6c('0x39')]+'%'};return _0x586937;}})});}_0x559743=_[_0x5c6c('0x3a')]({},_0x559743,_0x2487bf['options']);var _0x5ba060={'where':_0x559743[_0x5c6c('0x38')]};return db['OpenchannelQueueReport'][_0x5c6c('0x1a')](_0x5ba060)[_0x5c6c('0x20')](function(_0x4c21c5){_0x59c9d7[_0x5c6c('0x1a')]=_0x4c21c5;if(_0x2487bf[_0x5c6c('0x2f')][_0x5c6c('0x3c')]){_0x559743[_0x5c6c('0x3d')]=[{'all':!![]}];}return db[_0x5c6c('0x29')][_0x5c6c('0x3e')](_0x559743);})[_0x5c6c('0x20')](function(_0x1d99a0){_0x59c9d7[_0x5c6c('0x3f')]=_0x1d99a0;return _0x59c9d7;})[_0x5c6c('0x20')](respondWithFilteredResult(_0x4e5c56,_0x559743))[_0x5c6c('0x40')](handleError(_0x4e5c56,null));};exports[_0x5c6c('0x41')]=function(_0x2f6a41,_0x372ecd){var _0x2bfe9c={'raw':!![],'where':{'id':_0x2f6a41[_0x5c6c('0x42')]['id']}},_0x2e83ed={};_0x2e83ed['model']=_[_0x5c6c('0x2e')](db[_0x5c6c('0x29')][_0x5c6c('0x2a')]);_0x2e83ed[_0x5c6c('0x2f')]=_['keys'](_0x2f6a41[_0x5c6c('0x2f')]);_0x2e83ed['filters']=_[_0x5c6c('0x31')](_0x2e83ed[_0x5c6c('0x32')],_0x2e83ed['query']);_0x2bfe9c[_0x5c6c('0x34')]=_['intersection'](_0x2e83ed['model'],qs[_0x5c6c('0x33')](_0x2f6a41[_0x5c6c('0x2f')]['fields']));_0x2bfe9c[_0x5c6c('0x34')]=_0x2bfe9c[_0x5c6c('0x34')][_0x5c6c('0x35')]?_0x2bfe9c[_0x5c6c('0x34')]:_0x2e83ed[_0x5c6c('0x32')];if(_0x2f6a41[_0x5c6c('0x2f')][_0x5c6c('0x3c')]){_0x2bfe9c[_0x5c6c('0x3d')]=[{'all':!![]}];}_0x2bfe9c=_['merge']({},_0x2bfe9c,_0x2f6a41['options']);return db[_0x5c6c('0x29')][_0x5c6c('0x43')](_0x2bfe9c)[_0x5c6c('0x20')](handleEntityNotFound(_0x372ecd,null))[_0x5c6c('0x20')](respondWithResult(_0x372ecd,null))[_0x5c6c('0x40')](handleError(_0x372ecd,null));};exports['create']=function(_0x98b843,_0x433c96){return db['OpenchannelQueueReport'][_0x5c6c('0x44')](_0x98b843[_0x5c6c('0x45')],{})[_0x5c6c('0x20')](respondWithResult(_0x433c96,0xc9))[_0x5c6c('0x40')](handleError(_0x433c96,null));};exports[_0x5c6c('0x1f')]=function(_0x3c6ff4,_0x17cde6){if(_0x3c6ff4['body']['id']){delete _0x3c6ff4[_0x5c6c('0x45')]['id'];}return db[_0x5c6c('0x29')][_0x5c6c('0x43')]({'where':{'id':_0x3c6ff4['params']['id']}})[_0x5c6c('0x20')](handleEntityNotFound(_0x17cde6,null))['then'](saveUpdates(_0x3c6ff4[_0x5c6c('0x45')],null))[_0x5c6c('0x20')](respondWithResult(_0x17cde6,null))[_0x5c6c('0x40')](handleError(_0x17cde6,null));};exports[_0x5c6c('0x21')]=function(_0x533c09,_0x62970){return db[_0x5c6c('0x29')][_0x5c6c('0x43')]({'where':{'id':_0x533c09[_0x5c6c('0x42')]['id']}})[_0x5c6c('0x20')](handleEntityNotFound(_0x62970,null))[_0x5c6c('0x20')](removeEntity(_0x62970,null))[_0x5c6c('0x40')](handleError(_0x62970,null));};exports[_0x5c6c('0x46')]=function(_0x2aa93b,_0x32dd77){return db[_0x5c6c('0x29')][_0x5c6c('0x46')]()['then'](respondWithResult(_0x32dd77,null))[_0x5c6c('0x40')](handleError(_0x32dd77,null));}; \ No newline at end of file +var _0xa4f3=['OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','json','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x2689b9,_0x17c877){var _0x2f3a94=function(_0x2b8dc9){while(--_0x2b8dc9){_0x2689b9['push'](_0x2689b9['shift']());}};_0x2f3a94(++_0x17c877);}(_0xa4f3,0x102));var _0x3a4f=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa4f3[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0x3a4f('0x0'));var rimraf=require(_0x3a4f('0x1'));var zipdir=require(_0x3a4f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a4f('0x3'));var moment=require(_0x3a4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a4f('0x5'));var util=require(_0x3a4f('0x6'));var path=require(_0x3a4f('0x7'));var sox=require(_0x3a4f('0x8'));var csv=require(_0x3a4f('0x9'));var ejs=require(_0x3a4f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a4f('0xb'));var squel=require('squel');var crypto=require(_0x3a4f('0xc'));var jsforce=require(_0x3a4f('0xd'));var deskjs=require(_0x3a4f('0xe'));var toCsv=require(_0x3a4f('0x9'));var querystring=require(_0x3a4f('0xf'));var Papa=require(_0x3a4f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a4f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a4f('0x12'));var logger=require(_0x3a4f('0x13'))(_0x3a4f('0x14'));var utils=require(_0x3a4f('0x15'));var config=require(_0x3a4f('0x16'));var licenseUtil=require(_0x3a4f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44aaf5,_0x544a97){_0x544a97=_0x544a97||0xcc;return function(_0x49db37){if(_0x49db37){return _0x44aaf5[_0x3a4f('0x18')](_0x544a97);}return _0x44aaf5[_0x3a4f('0x19')](_0x544a97)['end']();};}function respondWithResult(_0x29a2d2,_0x423954){_0x423954=_0x423954||0xc8;return function(_0x389a0e){if(_0x389a0e){return _0x29a2d2[_0x3a4f('0x19')](_0x423954)['json'](_0x389a0e);}};}function respondWithFilteredResult(_0x2cb613,_0x1c8eef){return function(_0x1717fc){if(_0x1717fc){var _0x2f00d2=typeof _0x1c8eef[_0x3a4f('0x1a')]===_0x3a4f('0x1b')&&typeof _0x1c8eef['limit']===_0x3a4f('0x1b');var _0x4ebe26=_0x1717fc[_0x3a4f('0x1c')];var _0x202a14=_0x2f00d2?0x0:_0x1c8eef[_0x3a4f('0x1a')];var _0x32983e=_0x2f00d2?_0x1717fc['count']:_0x1c8eef['offset']+_0x1c8eef[_0x3a4f('0x1d')];var _0x536330;if(_0x32983e>=_0x4ebe26){_0x32983e=_0x4ebe26;_0x536330=0xc8;}else{_0x536330=0xce;}_0x2cb613[_0x3a4f('0x19')](_0x536330);return _0x2cb613['set']('Content-Range',_0x202a14+'-'+_0x32983e+'/'+_0x4ebe26)[_0x3a4f('0x1e')](_0x1717fc);}return null;};}function patchUpdates(_0x5a27ff){return function(_0x7904d4){try{jsonpatch[_0x3a4f('0x1f')](_0x7904d4,_0x5a27ff,!![]);}catch(_0x316424){return BPromise[_0x3a4f('0x20')](_0x316424);}return _0x7904d4[_0x3a4f('0x21')]();};}function saveUpdates(_0x336fb0,_0x1a2b4b){return function(_0x1499c4){if(_0x1499c4){return _0x1499c4['update'](_0x336fb0)[_0x3a4f('0x22')](function(_0x297089){return _0x297089;});}return null;};}function removeEntity(_0x36308f,_0x56d4d7){return function(_0x51f3b4){if(_0x51f3b4){return _0x51f3b4[_0x3a4f('0x23')]()[_0x3a4f('0x22')](function(){_0x36308f[_0x3a4f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x557205,_0xc8abba){return function(_0x529a1c){if(!_0x529a1c){_0x557205[_0x3a4f('0x18')](0x194);}return _0x529a1c;};}function handleError(_0x4c3491,_0x3d7f5e){_0x3d7f5e=_0x3d7f5e||0x1f4;return function(_0xf7c9d7){logger[_0x3a4f('0x24')](_0xf7c9d7[_0x3a4f('0x25')]);if(_0xf7c9d7[_0x3a4f('0x26')]){delete _0xf7c9d7['name'];}_0x4c3491[_0x3a4f('0x19')](_0x3d7f5e)[_0x3a4f('0x27')](_0xf7c9d7);};}exports[_0x3a4f('0x28')]=function(_0x228950,_0xea45c3){var _0x201e55={},_0x567d21={},_0x18e752={'count':0x0,'rows':[]};var _0x5b2f30=_[_0x3a4f('0x29')](db[_0x3a4f('0x2a')][_0x3a4f('0x2b')],function(_0x53725f){return{'name':_0x53725f[_0x3a4f('0x2c')],'type':_0x53725f[_0x3a4f('0x2d')][_0x3a4f('0x2e')]};});_0x567d21[_0x3a4f('0x2f')]=_[_0x3a4f('0x29')](_0x5b2f30,'name');_0x567d21[_0x3a4f('0x30')]=_[_0x3a4f('0x31')](_0x228950[_0x3a4f('0x30')]);_0x567d21['filters']=_[_0x3a4f('0x32')](_0x567d21[_0x3a4f('0x2f')],_0x567d21[_0x3a4f('0x30')]);_0x201e55['attributes']=_[_0x3a4f('0x32')](_0x567d21[_0x3a4f('0x2f')],qs[_0x3a4f('0x33')](_0x228950[_0x3a4f('0x30')][_0x3a4f('0x33')]));_0x201e55[_0x3a4f('0x34')]=_0x201e55[_0x3a4f('0x34')][_0x3a4f('0x35')]?_0x201e55[_0x3a4f('0x34')]:_0x567d21[_0x3a4f('0x2f')];if(!_0x228950[_0x3a4f('0x30')][_0x3a4f('0x36')](_0x3a4f('0x37'))){_0x201e55[_0x3a4f('0x1d')]=qs[_0x3a4f('0x1d')](_0x228950['query'][_0x3a4f('0x1d')]);_0x201e55[_0x3a4f('0x1a')]=qs[_0x3a4f('0x1a')](_0x228950[_0x3a4f('0x30')][_0x3a4f('0x1a')]);}_0x201e55['order']=qs['sort'](_0x228950[_0x3a4f('0x30')][_0x3a4f('0x38')]);_0x201e55[_0x3a4f('0x39')]=qs[_0x3a4f('0x3a')](_[_0x3a4f('0x3b')](_0x228950['query'],_0x567d21[_0x3a4f('0x3a')]),_0x5b2f30);if(_0x228950['query'][_0x3a4f('0x3c')]){_0x201e55[_0x3a4f('0x39')]=_[_0x3a4f('0x3d')](_0x201e55[_0x3a4f('0x39')],{'$or':_[_0x3a4f('0x29')](_0x5b2f30,function(_0x559ac7){if(_0x559ac7[_0x3a4f('0x2d')]!=='VIRTUAL'){var _0x142ed6={};_0x142ed6[_0x559ac7['name']]={'$like':'%'+_0x228950[_0x3a4f('0x30')][_0x3a4f('0x3c')]+'%'};return _0x142ed6;}})});}_0x201e55=_[_0x3a4f('0x3d')]({},_0x201e55,_0x228950['options']);var _0xe40001={'where':_0x201e55[_0x3a4f('0x39')]};return db['OpenchannelQueueReport'][_0x3a4f('0x1c')](_0xe40001)['then'](function(_0x1eb140){_0x18e752[_0x3a4f('0x1c')]=_0x1eb140;if(_0x228950['query'][_0x3a4f('0x3e')]){_0x201e55[_0x3a4f('0x3f')]=[{'all':!![]}];}return db[_0x3a4f('0x2a')][_0x3a4f('0x40')](_0x201e55);})[_0x3a4f('0x22')](function(_0x5b1240){_0x18e752[_0x3a4f('0x41')]=_0x5b1240;return _0x18e752;})[_0x3a4f('0x22')](respondWithFilteredResult(_0xea45c3,_0x201e55))[_0x3a4f('0x42')](handleError(_0xea45c3,null));};exports[_0x3a4f('0x43')]=function(_0x57b43d,_0x2c0ccf){var _0x3d0541={'raw':!![],'where':{'id':_0x57b43d[_0x3a4f('0x44')]['id']}},_0x1995d2={};_0x1995d2[_0x3a4f('0x2f')]=_[_0x3a4f('0x31')](db[_0x3a4f('0x2a')]['rawAttributes']);_0x1995d2[_0x3a4f('0x30')]=_[_0x3a4f('0x31')](_0x57b43d['query']);_0x1995d2[_0x3a4f('0x3a')]=_[_0x3a4f('0x32')](_0x1995d2['model'],_0x1995d2[_0x3a4f('0x30')]);_0x3d0541[_0x3a4f('0x34')]=_[_0x3a4f('0x32')](_0x1995d2[_0x3a4f('0x2f')],qs[_0x3a4f('0x33')](_0x57b43d[_0x3a4f('0x30')][_0x3a4f('0x33')]));_0x3d0541[_0x3a4f('0x34')]=_0x3d0541[_0x3a4f('0x34')]['length']?_0x3d0541[_0x3a4f('0x34')]:_0x1995d2[_0x3a4f('0x2f')];if(_0x57b43d['query']['includeAll']){_0x3d0541['include']=[{'all':!![]}];}_0x3d0541=_['merge']({},_0x3d0541,_0x57b43d[_0x3a4f('0x45')]);return db[_0x3a4f('0x2a')][_0x3a4f('0x46')](_0x3d0541)['then'](handleEntityNotFound(_0x2c0ccf,null))[_0x3a4f('0x22')](respondWithResult(_0x2c0ccf,null))[_0x3a4f('0x42')](handleError(_0x2c0ccf,null));};exports[_0x3a4f('0x47')]=function(_0x3c3f3c,_0x26272c){return db[_0x3a4f('0x2a')][_0x3a4f('0x47')](_0x3c3f3c[_0x3a4f('0x48')],{})[_0x3a4f('0x22')](respondWithResult(_0x26272c,0xc9))[_0x3a4f('0x42')](handleError(_0x26272c,null));};exports[_0x3a4f('0x49')]=function(_0x5e5652,_0x41342e){if(_0x5e5652[_0x3a4f('0x48')]['id']){delete _0x5e5652[_0x3a4f('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x3a4f('0x46')]({'where':{'id':_0x5e5652[_0x3a4f('0x44')]['id']}})[_0x3a4f('0x22')](handleEntityNotFound(_0x41342e,null))[_0x3a4f('0x22')](saveUpdates(_0x5e5652[_0x3a4f('0x48')],null))[_0x3a4f('0x22')](respondWithResult(_0x41342e,null))['catch'](handleError(_0x41342e,null));};exports[_0x3a4f('0x23')]=function(_0x395e29,_0x209107){return db[_0x3a4f('0x2a')]['find']({'where':{'id':_0x395e29['params']['id']}})[_0x3a4f('0x22')](handleEntityNotFound(_0x209107,null))[_0x3a4f('0x22')](removeEntity(_0x209107,null))[_0x3a4f('0x42')](handleError(_0x209107,null));};exports[_0x3a4f('0x4a')]=function(_0x79b924,_0x2e6e45){return db[_0x3a4f('0x2a')]['describe']()[_0x3a4f('0x22')](respondWithResult(_0x2e6e45,null))['catch'](handleError(_0x2e6e45,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index e6855f4..71fc398 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0xf04d,_0x443b73){var _0x573af7=function(_0x437fc0){while(--_0x437fc0){_0xf04d['push'](_0xf04d['shift']());}};_0x573af7(++_0x443b73);}(_0x7a54,0x106));var _0x47a5=function(_0x13b1eb,_0x49e5fb){_0x13b1eb=_0x13b1eb-0x0;var _0x16b1f3=_0x7a54[_0x13b1eb];return _0x16b1f3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x814b,0x1a2));var _0xb814=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0x814b[_0x9adcd6];return _0xdf8ff2;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 08fd488..c45121f 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 _0xd914=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','UpdateOpenchannelQueueReport','update','attributes','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x564608,_0x3dfdc7){var _0x197419=function(_0x29b71e){while(--_0x29b71e){_0x564608['push'](_0x564608['shift']());}};_0x197419(++_0x3dfdc7);}(_0xd914,0x17f));var _0x4d91=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0xd914[_0x1f239e];return _0x826971;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});}exports[_0x4d91('0x16')]=function(_0x44b9a7){var _0x4cfa40=this;return new Promise(function(_0x350e23,_0x3b579b){return db[_0x4d91('0x17')]['create'](_0x44b9a7[_0x4d91('0x18')],{'raw':_0x44b9a7[_0x4d91('0x19')]?_0x44b9a7[_0x4d91('0x19')][_0x4d91('0x1a')]===undefined?!![]:![]:!![]})[_0x4d91('0x1b')](function(_0x40cde4){logger[_0x4d91('0xc')](_0x4d91('0x16'),_0x44b9a7);logger[_0x4d91('0xf')](_0x4d91('0x16'),_0x44b9a7,JSON['stringify'](_0x40cde4));_0x350e23(_0x40cde4);})[_0x4d91('0x15')](function(_0x5f5236){logger['error'](_0x4d91('0x16'),_0x5f5236[_0x4d91('0x13')],_0x44b9a7);_0x3b579b(_0x4cfa40[_0x4d91('0x11')](0x1f4,_0x5f5236[_0x4d91('0x13')]));});});};exports[_0x4d91('0x1c')]=function(_0x12b722){var _0x100cd4=this;return new Promise(function(_0x123606,_0x55356b){return db['OpenchannelQueueReport'][_0x4d91('0x1d')](_0x12b722[_0x4d91('0x18')],{'raw':_0x12b722[_0x4d91('0x19')]?_0x12b722[_0x4d91('0x19')][_0x4d91('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12b722[_0x4d91('0x19')]?_0x12b722[_0x4d91('0x19')]['where']||null:null,'attributes':_0x12b722[_0x4d91('0x19')]?_0x12b722[_0x4d91('0x19')][_0x4d91('0x1e')]||null:null,'limit':_0x12b722['options']?_0x12b722['options'][_0x4d91('0x1f')]||null:null})[_0x4d91('0x1b')](function(_0x5ed948){logger['info'](_0x4d91('0x1c'),_0x12b722);logger[_0x4d91('0xf')](_0x4d91('0x1c'),_0x12b722,JSON[_0x4d91('0x20')](_0x5ed948));_0x123606(_0x5ed948);})['catch'](function(_0x2587a1){logger[_0x4d91('0x11')](_0x4d91('0x1c'),_0x2587a1[_0x4d91('0x13')],_0x12b722);_0x55356b(_0x100cd4[_0x4d91('0x11')](0x1f4,_0x2587a1[_0x4d91('0x13')]));});});}; \ No newline at end of file +var _0x97c1=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelQueueReport','create','body','options','raw','then','CreateOpenchannelQueueReport','debug','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash'];(function(_0x13a190,_0x4026c7){var _0x23c5be=function(_0xf6062d){while(--_0xf6062d){_0x13a190['push'](_0x13a190['shift']());}};_0x23c5be(++_0x4026c7);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateOpenchannelQueueReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});};exports[_0x197c('0x1b')]=function(_0x2a1310){var _0x37b040=this;return new Promise(function(_0x25486a,_0x5f4a02){return db[_0x197c('0x13')][_0x197c('0x1c')](_0x2a1310[_0x197c('0x15')],{'raw':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1310['options']?_0x2a1310['options'][_0x197c('0x1d')]||null:null,'attributes':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x1e')]||null:null,'limit':_0x2a1310[_0x197c('0x16')]?_0x2a1310[_0x197c('0x16')][_0x197c('0x1f')]||null:null})[_0x197c('0x18')](function(_0x2b6154){logger[_0x197c('0xa')](_0x197c('0x1b'),_0x2a1310);logger['debug']('UpdateOpenchannelQueueReport',_0x2a1310,JSON['stringify'](_0x2b6154));_0x25486a(_0x2b6154);})['catch'](function(_0x5f7425){logger['error'](_0x197c('0x1b'),_0x5f7425[_0x197c('0x10')],_0x2a1310);_0x5f4a02(_0x37b040['error'](0x1f4,_0x5f7425[_0x197c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b31a01a..f347e55 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 _0x3b4b=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post'];(function(_0x4b20a7,_0x47c51a){var _0x56d193=function(_0x5e4b96){while(--_0x5e4b96){_0x4b20a7['push'](_0x4b20a7['shift']());}};_0x56d193(++_0x47c51a);}(_0x3b4b,0x11a));var _0xb3b4=function(_0x2bea74,_0x536532){_0x2bea74=_0x2bea74-0x0;var _0x5ae6af=_0x3b4b[_0x2bea74];return _0x5ae6af;};'use strict';var multer=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var path=require(_0xb3b4('0x2'));var timeout=require(_0xb3b4('0x3'));var express=require(_0xb3b4('0x4'));var router=express[_0xb3b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b4('0x6'));var interaction=require(_0xb3b4('0x7'));var config=require(_0xb3b4('0x8'));var controller=require(_0xb3b4('0x9'));router[_0xb3b4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb3b4('0xb'),auth['isAuthenticated'](),controller[_0xb3b4('0xc')]);router[_0xb3b4('0xa')](_0xb3b4('0xd'),auth[_0xb3b4('0xe')](),controller[_0xb3b4('0xf')]);router[_0xb3b4('0x10')]('/',auth[_0xb3b4('0xe')](),controller[_0xb3b4('0x11')]);router[_0xb3b4('0x12')](_0xb3b4('0xd'),auth['isAuthenticated'](),controller[_0xb3b4('0x13')]);router[_0xb3b4('0x14')](_0xb3b4('0xd'),auth[_0xb3b4('0xe')](),controller[_0xb3b4('0x15')]);module[_0xb3b4('0x16')]=router; \ No newline at end of file +var _0xcf86=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x3c73d1,_0x2c5b98){var _0x200bba=function(_0x23c557){while(--_0x23c557){_0x3c73d1['push'](_0x3c73d1['shift']());}};_0x200bba(++_0x2c5b98);}(_0xcf86,0x141));var _0x6cf8=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xcf86[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x6cf8('0x0'));var util=require(_0x6cf8('0x1'));var path=require(_0x6cf8('0x2'));var timeout=require(_0x6cf8('0x3'));var express=require(_0x6cf8('0x4'));var router=express[_0x6cf8('0x5')]();var fs_extra=require(_0x6cf8('0x6'));var auth=require(_0x6cf8('0x7'));var interaction=require(_0x6cf8('0x8'));var config=require(_0x6cf8('0x9'));var controller=require(_0x6cf8('0xa'));router[_0x6cf8('0xb')]('/',auth[_0x6cf8('0xc')](),controller[_0x6cf8('0xd')]);router['get'](_0x6cf8('0xe'),auth[_0x6cf8('0xc')](),controller['describe']);router[_0x6cf8('0xb')](_0x6cf8('0xf'),auth[_0x6cf8('0xc')](),controller[_0x6cf8('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6cf8('0x11')]);router[_0x6cf8('0x12')](_0x6cf8('0xf'),auth[_0x6cf8('0xc')](),controller[_0x6cf8('0x13')]);router[_0x6cf8('0x14')](_0x6cf8('0xf'),auth[_0x6cf8('0xc')](),controller[_0x6cf8('0x15')]);module[_0x6cf8('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6837956..30c8bcc 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x133673,_0x3b50c9){var _0x6ac4cc=function(_0xefca69){while(--_0xefca69){_0x133673['push'](_0x133673['shift']());}};_0x6ac4cc(++_0x3b50c9);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x43e830,_0x10c3fc){var _0x4841e3=function(_0x57ecfb){while(--_0x57ecfb){_0x43e830['push'](_0x43e830['shift']());}};_0x4841e3(++_0x10c3fc);}(_0xedd9,0xfc));var _0x9edd=function(_0x15676f,_0x13aebf){_0x15676f=_0x15676f-0x0;var _0x5db035=_0xedd9[_0x15676f];return _0x5db035;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 089d10e..5762732 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 _0x05f4=['find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','type','VIRTUAL','filter','options','OpenchannelTransferReport','include','findAll','rows','catch','keys','includeAll','merge'];(function(_0x2dd5f2,_0xc2426d){var _0xf3d324=function(_0x536ab2){while(--_0x536ab2){_0x2dd5f2['push'](_0x2dd5f2['shift']());}};_0xf3d324(++_0xc2426d);}(_0x05f4,0xe9));var _0x405f=function(_0x5ef37c,_0x2df5ff){_0x5ef37c=_0x5ef37c-0x0;var _0x308937=_0x05f4[_0x5ef37c];return _0x308937;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x405f('0x0'));var jsonpatch=require(_0x405f('0x1'));var rp=require(_0x405f('0x2'));var moment=require(_0x405f('0x3'));var BPromise=require(_0x405f('0x4'));var Mustache=require(_0x405f('0x5'));var util=require('util');var path=require(_0x405f('0x6'));var sox=require(_0x405f('0x7'));var csv=require(_0x405f('0x8'));var ejs=require(_0x405f('0x9'));var fs=require('fs');var fs_extra=require(_0x405f('0xa'));var _=require(_0x405f('0xb'));var squel=require(_0x405f('0xc'));var crypto=require(_0x405f('0xd'));var jsforce=require(_0x405f('0xe'));var deskjs=require(_0x405f('0xf'));var toCsv=require(_0x405f('0x8'));var querystring=require('querystring');var Papa=require(_0x405f('0x10'));var Redis=require('ioredis');var authService=require(_0x405f('0x11'));var qs=require(_0x405f('0x12'));var as=require(_0x405f('0x13'));var hardwareService=require(_0x405f('0x14'));var logger=require(_0x405f('0x15'))(_0x405f('0x16'));var utils=require(_0x405f('0x17'));var config=require(_0x405f('0x18'));var licenseUtil=require(_0x405f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b634f,_0x518c78){_0x518c78=_0x518c78||0xcc;return function(_0x26edbb){if(_0x26edbb){return _0x4b634f[_0x405f('0x1a')](_0x518c78);}return _0x4b634f[_0x405f('0x1b')](_0x518c78)['end']();};}function respondWithResult(_0xaaa3ce,_0x5c65d5){_0x5c65d5=_0x5c65d5||0xc8;return function(_0x87f05f){if(_0x87f05f){return _0xaaa3ce[_0x405f('0x1b')](_0x5c65d5)[_0x405f('0x1c')](_0x87f05f);}};}function respondWithFilteredResult(_0xf4e42d,_0x5b87c7){return function(_0x238534){if(_0x238534){var _0x3e5e46=typeof _0x5b87c7[_0x405f('0x1d')]===_0x405f('0x1e')&&typeof _0x5b87c7[_0x405f('0x1f')]===_0x405f('0x1e');var _0x16d67d=_0x238534[_0x405f('0x20')];var _0x26f47f=_0x3e5e46?0x0:_0x5b87c7[_0x405f('0x1d')];var _0x2e4903=_0x3e5e46?_0x238534[_0x405f('0x20')]:_0x5b87c7['offset']+_0x5b87c7[_0x405f('0x1f')];var _0x3aa394;if(_0x2e4903>=_0x16d67d){_0x2e4903=_0x16d67d;_0x3aa394=0xc8;}else{_0x3aa394=0xce;}_0xf4e42d['status'](_0x3aa394);return _0xf4e42d[_0x405f('0x21')](_0x405f('0x22'),_0x26f47f+'-'+_0x2e4903+'/'+_0x16d67d)['json'](_0x238534);}return null;};}function patchUpdates(_0x57ee9f){return function(_0x41e46a){try{jsonpatch['apply'](_0x41e46a,_0x57ee9f,!![]);}catch(_0x4540ef){return BPromise[_0x405f('0x23')](_0x4540ef);}return _0x41e46a['save']();};}function saveUpdates(_0x296852,_0x2aff80){return function(_0x1a9c87){if(_0x1a9c87){return _0x1a9c87[_0x405f('0x24')](_0x296852)[_0x405f('0x25')](function(_0x6c56aa){return _0x6c56aa;});}return null;};}function removeEntity(_0x20e672,_0x13fbcc){return function(_0x1d1497){if(_0x1d1497){return _0x1d1497[_0x405f('0x26')]()[_0x405f('0x25')](function(){_0x20e672[_0x405f('0x1b')](0xcc)[_0x405f('0x27')]();});}};}function handleEntityNotFound(_0x5865fe,_0x34ba80){return function(_0x442c95){if(!_0x442c95){_0x5865fe[_0x405f('0x1a')](0x194);}return _0x442c95;};}function handleError(_0x5ec0fd,_0x19af84){_0x19af84=_0x19af84||0x1f4;return function(_0x3aadd8){logger[_0x405f('0x28')](_0x3aadd8['stack']);if(_0x3aadd8[_0x405f('0x29')]){delete _0x3aadd8[_0x405f('0x29')];}_0x5ec0fd[_0x405f('0x1b')](_0x19af84)[_0x405f('0x2a')](_0x3aadd8);};}exports[_0x405f('0x2b')]=function(_0x10b040,_0x3fffef){var _0x55ce8b={},_0x333d59={},_0x36f0e8={'count':0x0,'rows':[]};var _0x3f4181=_[_0x405f('0x2c')](db['OpenchannelTransferReport'][_0x405f('0x2d')],function(_0x50c425){return{'name':_0x50c425[_0x405f('0x2e')],'type':_0x50c425['type']['key']};});_0x333d59['model']=_[_0x405f('0x2c')](_0x3f4181,_0x405f('0x29'));_0x333d59[_0x405f('0x2f')]=_['keys'](_0x10b040[_0x405f('0x2f')]);_0x333d59['filters']=_[_0x405f('0x30')](_0x333d59['model'],_0x333d59[_0x405f('0x2f')]);_0x55ce8b[_0x405f('0x31')]=_[_0x405f('0x30')](_0x333d59[_0x405f('0x32')],qs['fields'](_0x10b040[_0x405f('0x2f')][_0x405f('0x33')]));_0x55ce8b['attributes']=_0x55ce8b[_0x405f('0x31')][_0x405f('0x34')]?_0x55ce8b['attributes']:_0x333d59[_0x405f('0x32')];if(!_0x10b040[_0x405f('0x2f')][_0x405f('0x35')](_0x405f('0x36'))){_0x55ce8b[_0x405f('0x1f')]=qs[_0x405f('0x1f')](_0x10b040[_0x405f('0x2f')][_0x405f('0x1f')]);_0x55ce8b[_0x405f('0x1d')]=qs[_0x405f('0x1d')](_0x10b040[_0x405f('0x2f')][_0x405f('0x1d')]);}_0x55ce8b['order']=qs[_0x405f('0x37')](_0x10b040[_0x405f('0x2f')][_0x405f('0x37')]);_0x55ce8b[_0x405f('0x38')]=qs['filters'](_[_0x405f('0x39')](_0x10b040[_0x405f('0x2f')],_0x333d59[_0x405f('0x3a')]),_0x3f4181);if(_0x10b040[_0x405f('0x2f')]['filter']){_0x55ce8b[_0x405f('0x38')]=_['merge'](_0x55ce8b[_0x405f('0x38')],{'$or':_['map'](_0x3f4181,function(_0x2e6413){if(_0x2e6413[_0x405f('0x3b')]!==_0x405f('0x3c')){var _0x4fa4e9={};_0x4fa4e9[_0x2e6413[_0x405f('0x29')]]={'$like':'%'+_0x10b040['query'][_0x405f('0x3d')]+'%'};return _0x4fa4e9;}})});}_0x55ce8b=_['merge']({},_0x55ce8b,_0x10b040[_0x405f('0x3e')]);var _0x550640={'where':_0x55ce8b[_0x405f('0x38')]};return db[_0x405f('0x3f')]['count'](_0x550640)['then'](function(_0x3a4b23){_0x36f0e8[_0x405f('0x20')]=_0x3a4b23;if(_0x10b040['query']['includeAll']){_0x55ce8b[_0x405f('0x40')]=[{'all':!![]}];}return db[_0x405f('0x3f')][_0x405f('0x41')](_0x55ce8b);})['then'](function(_0x8c4168){_0x36f0e8[_0x405f('0x42')]=_0x8c4168;return _0x36f0e8;})['then'](respondWithFilteredResult(_0x3fffef,_0x55ce8b))[_0x405f('0x43')](handleError(_0x3fffef,null));};exports['show']=function(_0x2e27f3,_0x6b3726){var _0x13e17f={'raw':!![],'where':{'id':_0x2e27f3['params']['id']}},_0x1fa133={};_0x1fa133[_0x405f('0x32')]=_[_0x405f('0x44')](db[_0x405f('0x3f')][_0x405f('0x2d')]);_0x1fa133[_0x405f('0x2f')]=_['keys'](_0x2e27f3['query']);_0x1fa133[_0x405f('0x3a')]=_[_0x405f('0x30')](_0x1fa133[_0x405f('0x32')],_0x1fa133[_0x405f('0x2f')]);_0x13e17f['attributes']=_[_0x405f('0x30')](_0x1fa133[_0x405f('0x32')],qs[_0x405f('0x33')](_0x2e27f3[_0x405f('0x2f')][_0x405f('0x33')]));_0x13e17f[_0x405f('0x31')]=_0x13e17f[_0x405f('0x31')][_0x405f('0x34')]?_0x13e17f['attributes']:_0x1fa133['model'];if(_0x2e27f3['query'][_0x405f('0x45')]){_0x13e17f[_0x405f('0x40')]=[{'all':!![]}];}_0x13e17f=_[_0x405f('0x46')]({},_0x13e17f,_0x2e27f3[_0x405f('0x3e')]);return db[_0x405f('0x3f')][_0x405f('0x47')](_0x13e17f)[_0x405f('0x25')](handleEntityNotFound(_0x6b3726,null))[_0x405f('0x25')](respondWithResult(_0x6b3726,null))[_0x405f('0x43')](handleError(_0x6b3726,null));};exports[_0x405f('0x48')]=function(_0x583df5,_0x259545){return db['OpenchannelTransferReport'][_0x405f('0x48')](_0x583df5[_0x405f('0x49')],{})[_0x405f('0x25')](respondWithResult(_0x259545,0xc9))[_0x405f('0x43')](handleError(_0x259545,null));};exports[_0x405f('0x24')]=function(_0x164e79,_0x3c84be){if(_0x164e79[_0x405f('0x49')]['id']){delete _0x164e79[_0x405f('0x49')]['id'];}return db[_0x405f('0x3f')][_0x405f('0x47')]({'where':{'id':_0x164e79[_0x405f('0x4a')]['id']}})[_0x405f('0x25')](handleEntityNotFound(_0x3c84be,null))[_0x405f('0x25')](saveUpdates(_0x164e79['body'],null))['then'](respondWithResult(_0x3c84be,null))[_0x405f('0x43')](handleError(_0x3c84be,null));};exports[_0x405f('0x26')]=function(_0x33a86d,_0x3a8acf){return db[_0x405f('0x3f')][_0x405f('0x47')]({'where':{'id':_0x33a86d['params']['id']}})[_0x405f('0x25')](handleEntityNotFound(_0x3a8acf,null))[_0x405f('0x25')](removeEntity(_0x3a8acf,null))[_0x405f('0x43')](handleError(_0x3a8acf,null));};exports['describe']=function(_0x5dd62a,_0x1ea06a){return db[_0x405f('0x3f')][_0x405f('0x4b')]()[_0x405f('0x25')](respondWithResult(_0x1ea06a,null))[_0x405f('0x43')](handleError(_0x1ea06a,null));}; \ No newline at end of file +var _0xd011=['limit','count','Content-Range','apply','reject','update','then','error','name','send','map','OpenchannelTransferReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0xd011,0xc6));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1d01('0x0'));var rimraf=require(_0x1d01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d01('0x2'));var rp=require(_0x1d01('0x3'));var moment=require(_0x1d01('0x4'));var BPromise=require(_0x1d01('0x5'));var Mustache=require(_0x1d01('0x6'));var util=require(_0x1d01('0x7'));var path=require(_0x1d01('0x8'));var sox=require(_0x1d01('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d01('0xa'));var _=require(_0x1d01('0xb'));var squel=require(_0x1d01('0xc'));var crypto=require(_0x1d01('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d01('0xe'));var toCsv=require(_0x1d01('0xf'));var querystring=require(_0x1d01('0x10'));var Papa=require(_0x1d01('0x11'));var Redis=require(_0x1d01('0x12'));var authService=require(_0x1d01('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d01('0x14'));var logger=require(_0x1d01('0x15'))(_0x1d01('0x16'));var utils=require(_0x1d01('0x17'));var config=require(_0x1d01('0x18'));var licenseUtil=require(_0x1d01('0x19'));var db=require(_0x1d01('0x1a'))['db'];function respondWithStatusCode(_0x3752b2,_0x241982){_0x241982=_0x241982||0xcc;return function(_0x81105a){if(_0x81105a){return _0x3752b2[_0x1d01('0x1b')](_0x241982);}return _0x3752b2['status'](_0x241982)[_0x1d01('0x1c')]();};}function respondWithResult(_0x46bfc3,_0x323232){_0x323232=_0x323232||0xc8;return function(_0x2caf14){if(_0x2caf14){return _0x46bfc3[_0x1d01('0x1d')](_0x323232)[_0x1d01('0x1e')](_0x2caf14);}};}function respondWithFilteredResult(_0x506f8c,_0x170154){return function(_0x12d5ad){if(_0x12d5ad){var _0x4d5fda=typeof _0x170154[_0x1d01('0x1f')]===_0x1d01('0x20')&&typeof _0x170154[_0x1d01('0x21')]===_0x1d01('0x20');var _0x4a355f=_0x12d5ad[_0x1d01('0x22')];var _0x23d48a=_0x4d5fda?0x0:_0x170154[_0x1d01('0x1f')];var _0x17ca66=_0x4d5fda?_0x12d5ad[_0x1d01('0x22')]:_0x170154[_0x1d01('0x1f')]+_0x170154['limit'];var _0x5dca3f;if(_0x17ca66>=_0x4a355f){_0x17ca66=_0x4a355f;_0x5dca3f=0xc8;}else{_0x5dca3f=0xce;}_0x506f8c[_0x1d01('0x1d')](_0x5dca3f);return _0x506f8c['set'](_0x1d01('0x23'),_0x23d48a+'-'+_0x17ca66+'/'+_0x4a355f)[_0x1d01('0x1e')](_0x12d5ad);}return null;};}function patchUpdates(_0x3d3c49){return function(_0x24f68a){try{jsonpatch[_0x1d01('0x24')](_0x24f68a,_0x3d3c49,!![]);}catch(_0x269baf){return BPromise[_0x1d01('0x25')](_0x269baf);}return _0x24f68a['save']();};}function saveUpdates(_0x32e65f,_0x529bb0){return function(_0x467426){if(_0x467426){return _0x467426[_0x1d01('0x26')](_0x32e65f)[_0x1d01('0x27')](function(_0x3e0427){return _0x3e0427;});}return null;};}function removeEntity(_0x55f407,_0x48f404){return function(_0x374bb5){if(_0x374bb5){return _0x374bb5['destroy']()[_0x1d01('0x27')](function(){_0x55f407[_0x1d01('0x1d')](0xcc)[_0x1d01('0x1c')]();});}};}function handleEntityNotFound(_0x5ea95c,_0x1299a2){return function(_0x3efda5){if(!_0x3efda5){_0x5ea95c[_0x1d01('0x1b')](0x194);}return _0x3efda5;};}function handleError(_0xf838d8,_0x539a6b){_0x539a6b=_0x539a6b||0x1f4;return function(_0xd2717f){logger[_0x1d01('0x28')](_0xd2717f['stack']);if(_0xd2717f[_0x1d01('0x29')]){delete _0xd2717f[_0x1d01('0x29')];}_0xf838d8[_0x1d01('0x1d')](_0x539a6b)[_0x1d01('0x2a')](_0xd2717f);};}exports['index']=function(_0x5cd055,_0x4cf52a){var _0x530c00={},_0x3bc4a0={},_0xc8f743={'count':0x0,'rows':[]};var _0x41b79e=_[_0x1d01('0x2b')](db[_0x1d01('0x2c')]['rawAttributes'],function(_0x3acc98){return{'name':_0x3acc98[_0x1d01('0x2d')],'type':_0x3acc98[_0x1d01('0x2e')][_0x1d01('0x2f')]};});_0x3bc4a0['model']=_[_0x1d01('0x2b')](_0x41b79e,_0x1d01('0x29'));_0x3bc4a0['query']=_[_0x1d01('0x30')](_0x5cd055[_0x1d01('0x31')]);_0x3bc4a0[_0x1d01('0x32')]=_[_0x1d01('0x33')](_0x3bc4a0[_0x1d01('0x34')],_0x3bc4a0['query']);_0x530c00[_0x1d01('0x35')]=_[_0x1d01('0x33')](_0x3bc4a0[_0x1d01('0x34')],qs[_0x1d01('0x36')](_0x5cd055['query'][_0x1d01('0x36')]));_0x530c00[_0x1d01('0x35')]=_0x530c00[_0x1d01('0x35')]['length']?_0x530c00[_0x1d01('0x35')]:_0x3bc4a0[_0x1d01('0x34')];if(!_0x5cd055[_0x1d01('0x31')][_0x1d01('0x37')]('nolimit')){_0x530c00[_0x1d01('0x21')]=qs[_0x1d01('0x21')](_0x5cd055[_0x1d01('0x31')]['limit']);_0x530c00[_0x1d01('0x1f')]=qs[_0x1d01('0x1f')](_0x5cd055[_0x1d01('0x31')][_0x1d01('0x1f')]);}_0x530c00[_0x1d01('0x38')]=qs[_0x1d01('0x39')](_0x5cd055[_0x1d01('0x31')][_0x1d01('0x39')]);_0x530c00[_0x1d01('0x3a')]=qs[_0x1d01('0x32')](_[_0x1d01('0x3b')](_0x5cd055[_0x1d01('0x31')],_0x3bc4a0[_0x1d01('0x32')]),_0x41b79e);if(_0x5cd055[_0x1d01('0x31')]['filter']){_0x530c00[_0x1d01('0x3a')]=_[_0x1d01('0x3c')](_0x530c00[_0x1d01('0x3a')],{'$or':_[_0x1d01('0x2b')](_0x41b79e,function(_0x3534ba){if(_0x3534ba[_0x1d01('0x2e')]!==_0x1d01('0x3d')){var _0x513726={};_0x513726[_0x3534ba[_0x1d01('0x29')]]={'$like':'%'+_0x5cd055[_0x1d01('0x31')][_0x1d01('0x3e')]+'%'};return _0x513726;}})});}_0x530c00=_[_0x1d01('0x3c')]({},_0x530c00,_0x5cd055[_0x1d01('0x3f')]);var _0x266c33={'where':_0x530c00[_0x1d01('0x3a')]};return db[_0x1d01('0x2c')][_0x1d01('0x22')](_0x266c33)[_0x1d01('0x27')](function(_0x18b689){_0xc8f743['count']=_0x18b689;if(_0x5cd055[_0x1d01('0x31')][_0x1d01('0x40')]){_0x530c00[_0x1d01('0x41')]=[{'all':!![]}];}return db[_0x1d01('0x2c')][_0x1d01('0x42')](_0x530c00);})[_0x1d01('0x27')](function(_0x110e20){_0xc8f743[_0x1d01('0x43')]=_0x110e20;return _0xc8f743;})[_0x1d01('0x27')](respondWithFilteredResult(_0x4cf52a,_0x530c00))['catch'](handleError(_0x4cf52a,null));};exports[_0x1d01('0x44')]=function(_0x257df4,_0x26d4c2){var _0x5055d9={'raw':!![],'where':{'id':_0x257df4[_0x1d01('0x45')]['id']}},_0x3d6f56={};_0x3d6f56[_0x1d01('0x34')]=_[_0x1d01('0x30')](db[_0x1d01('0x2c')][_0x1d01('0x46')]);_0x3d6f56[_0x1d01('0x31')]=_[_0x1d01('0x30')](_0x257df4[_0x1d01('0x31')]);_0x3d6f56[_0x1d01('0x32')]=_['intersection'](_0x3d6f56[_0x1d01('0x34')],_0x3d6f56[_0x1d01('0x31')]);_0x5055d9[_0x1d01('0x35')]=_[_0x1d01('0x33')](_0x3d6f56[_0x1d01('0x34')],qs[_0x1d01('0x36')](_0x257df4[_0x1d01('0x31')][_0x1d01('0x36')]));_0x5055d9[_0x1d01('0x35')]=_0x5055d9[_0x1d01('0x35')]['length']?_0x5055d9['attributes']:_0x3d6f56[_0x1d01('0x34')];if(_0x257df4['query'][_0x1d01('0x40')]){_0x5055d9[_0x1d01('0x41')]=[{'all':!![]}];}_0x5055d9=_['merge']({},_0x5055d9,_0x257df4[_0x1d01('0x3f')]);return db[_0x1d01('0x2c')][_0x1d01('0x47')](_0x5055d9)['then'](handleEntityNotFound(_0x26d4c2,null))[_0x1d01('0x27')](respondWithResult(_0x26d4c2,null))[_0x1d01('0x48')](handleError(_0x26d4c2,null));};exports[_0x1d01('0x49')]=function(_0xa80655,_0xb4981b){return db['OpenchannelTransferReport'][_0x1d01('0x49')](_0xa80655[_0x1d01('0x4a')],{})[_0x1d01('0x27')](respondWithResult(_0xb4981b,0xc9))['catch'](handleError(_0xb4981b,null));};exports[_0x1d01('0x26')]=function(_0x3fb5f7,_0x34d880){if(_0x3fb5f7[_0x1d01('0x4a')]['id']){delete _0x3fb5f7[_0x1d01('0x4a')]['id'];}return db[_0x1d01('0x2c')][_0x1d01('0x47')]({'where':{'id':_0x3fb5f7[_0x1d01('0x45')]['id']}})[_0x1d01('0x27')](handleEntityNotFound(_0x34d880,null))[_0x1d01('0x27')](saveUpdates(_0x3fb5f7[_0x1d01('0x4a')],null))[_0x1d01('0x27')](respondWithResult(_0x34d880,null))['catch'](handleError(_0x34d880,null));};exports[_0x1d01('0x4b')]=function(_0x3e0241,_0x3a2e8e){return db[_0x1d01('0x2c')]['find']({'where':{'id':_0x3e0241['params']['id']}})[_0x1d01('0x27')](handleEntityNotFound(_0x3a2e8e,null))['then'](removeEntity(_0x3a2e8e,null))[_0x1d01('0x48')](handleError(_0x3a2e8e,null));};exports[_0x1d01('0x4c')]=function(_0x4c9bdd,_0x448391){return db[_0x1d01('0x2c')][_0x1d01('0x4c')]()[_0x1d01('0x27')](respondWithResult(_0x448391,null))[_0x1d01('0x48')](handleError(_0x448391,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index c5fd108..70961ca 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 _0x0bec=['report_openchannel_transfer','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x0bec,0x1d5));var _0xc0be=function(_0x529709,_0x96c38f){_0x529709=_0x529709-0x0;var _0x3b5dc2=_0x0bec[_0x529709];return _0x3b5dc2;};'use strict';var _=require(_0xc0be('0x0'));var util=require(_0xc0be('0x1'));var logger=require(_0xc0be('0x2'))(_0xc0be('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc0be('0x4'));var fs=require('fs');var path=require(_0xc0be('0x5'));var rimraf=require(_0xc0be('0x6'));var config=require(_0xc0be('0x7'));var attributes=require(_0xc0be('0x8'));module['exports']=function(_0x6f031b,_0x1932ba){return _0x6f031b[_0xc0be('0x9')](_0xc0be('0xa'),attributes,{'tableName':_0xc0be('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd407=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd407,0x7c));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d40('0x0'));var util=require(_0x7d40('0x1'));var logger=require('../../config/logger')(_0x7d40('0x2'));var moment=require(_0x7d40('0x3'));var BPromise=require(_0x7d40('0x4'));var rp=require(_0x7d40('0x5'));var fs=require('fs');var path=require(_0x7d40('0x6'));var rimraf=require('rimraf');var config=require(_0x7d40('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x4054f2,_0x5ca617){return _0x4054f2[_0x7d40('0x8')](_0x7d40('0x9'),attributes,{'tableName':_0x7d40('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7d40('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 35d04fd..926b3b6 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 _0x689c=['then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x35ec7a,_0x54e8d8){var _0x3adba7=function(_0x5ab49a){while(--_0x5ab49a){_0x35ec7a['push'](_0x35ec7a['shift']());}};_0x3adba7(++_0x54e8d8);}(_0x689c,0x9e));var _0xc689=function(_0x3f104d,_0x345675){_0x3f104d=_0x3f104d-0x0;var _0x5c6e42=_0x689c[_0x3f104d];return _0x5c6e42;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc689('0x0'));var BPromise=require(_0xc689('0x1'));var rs=require(_0xc689('0x2'));var fs=require('fs');var Redis=require(_0xc689('0x3'));var db=require(_0xc689('0x4'))['db'];var utils=require(_0xc689('0x5'));var logger=require('../../config/logger')(_0xc689('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc689('0x7')][_0xc689('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9f8a,_0xedb406,_0x2e7400){return new BPromise(function(_0x57f82f,_0x17ff9c){return client[_0xc689('0x9')](_0x2b9f8a,_0x2e7400)[_0xc689('0xa')](function(_0x4a6c06){logger[_0xc689('0xb')](_0xc689('0xc'),_0xedb406,_0xc689('0xd'));logger[_0xc689('0xe')](_0xc689('0xf'),_0xedb406,_0xc689('0xd'),JSON[_0xc689('0x10')](_0x4a6c06));if(_0x4a6c06[_0xc689('0x11')]){if(_0x4a6c06[_0xc689('0x11')][_0xc689('0x12')]===0x1f4){logger[_0xc689('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xedb406,_0x4a6c06[_0xc689('0x11')]['message']);return _0x17ff9c(_0x4a6c06[_0xc689('0x11')][_0xc689('0x13')]);}logger[_0xc689('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xedb406,_0x4a6c06[_0xc689('0x11')][_0xc689('0x13')]);return _0x57f82f(_0x4a6c06['error'][_0xc689('0x13')]);}else{logger[_0xc689('0xb')](_0xc689('0xc'),_0xedb406,_0xc689('0xd'));_0x57f82f(_0x4a6c06['result']['message']);}})[_0xc689('0x14')](function(_0x214ca0){logger[_0xc689('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xedb406,_0x214ca0);_0x17ff9c(_0x214ca0);});});} \ No newline at end of file +var _0x44e8=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug'];(function(_0x223716,_0x4a68a3){var _0x27ecf2=function(_0x588661){while(--_0x588661){_0x223716['push'](_0x223716['shift']());}};_0x27ecf2(++_0x4a68a3);}(_0x44e8,0xd7));var _0x844e=function(_0x23038a,_0x11b431){_0x23038a=_0x23038a-0x0;var _0x71b285=_0x44e8[_0x23038a];return _0x71b285;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x844e('0x1'));var rs=require(_0x844e('0x2'));var fs=require('fs');var Redis=require(_0x844e('0x3'));var db=require(_0x844e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x844e('0x5'))(_0x844e('0x6'));var config=require(_0x844e('0x7'));var jayson=require(_0x844e('0x8'));var client=jayson['client'][_0x844e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238796,_0x1706b3,_0x11cbd6){return new BPromise(function(_0x571b91,_0x31ab50){return client[_0x844e('0xa')](_0x238796,_0x11cbd6)[_0x844e('0xb')](function(_0x134672){logger[_0x844e('0xc')](_0x844e('0xd'),_0x1706b3,'request\x20sent');logger[_0x844e('0xe')](_0x844e('0xf'),_0x1706b3,_0x844e('0x10'),JSON[_0x844e('0x11')](_0x134672));if(_0x134672[_0x844e('0x12')]){if(_0x134672[_0x844e('0x12')][_0x844e('0x13')]===0x1f4){logger['error'](_0x844e('0xd'),_0x1706b3,_0x134672[_0x844e('0x12')]['message']);return _0x31ab50(_0x134672[_0x844e('0x12')][_0x844e('0x14')]);}logger['error'](_0x844e('0xd'),_0x1706b3,_0x134672[_0x844e('0x12')][_0x844e('0x14')]);return _0x571b91(_0x134672['error'][_0x844e('0x14')]);}else{logger[_0x844e('0xc')](_0x844e('0xd'),_0x1706b3,_0x844e('0x10'));_0x571b91(_0x134672[_0x844e('0x15')][_0x844e('0x14')]);}})[_0x844e('0x16')](function(_0x5506ef){logger['error'](_0x844e('0xd'),_0x1706b3,_0x5506ef);_0x31ab50(_0x5506ef);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 281831a..64c40cd 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 _0xaf3d=['put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','index','get','/:id','post','create'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xaf3d,0x135));var _0xdaf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf3d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdaf3('0x0'));var util=require(_0xdaf3('0x1'));var path=require(_0xdaf3('0x2'));var timeout=require(_0xdaf3('0x3'));var express=require('express');var router=express[_0xdaf3('0x4')]();var fs_extra=require(_0xdaf3('0x5'));var auth=require(_0xdaf3('0x6'));var interaction=require(_0xdaf3('0x7'));var config=require('../../config/environment');var controller=require(_0xdaf3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdaf3('0x9')]);router[_0xdaf3('0xa')](_0xdaf3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdaf3('0xc')]('/',auth['isAuthenticated'](),controller[_0xdaf3('0xd')]);router[_0xdaf3('0xe')]('/:id',auth[_0xdaf3('0xf')](),controller[_0xdaf3('0x10')]);router[_0xdaf3('0x11')](_0xdaf3('0xb'),auth[_0xdaf3('0xf')](),controller[_0xdaf3('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfdf4=['index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0xfdf4,0xe6));var _0x4fdf=function(_0x237f45,_0x45987a){_0x237f45=_0x237f45-0x0;var _0x268b78=_0xfdf4[_0x237f45];return _0x268b78;};'use strict';var multer=require(_0x4fdf('0x0'));var util=require(_0x4fdf('0x1'));var path=require(_0x4fdf('0x2'));var timeout=require(_0x4fdf('0x3'));var express=require(_0x4fdf('0x4'));var router=express[_0x4fdf('0x5')]();var fs_extra=require(_0x4fdf('0x6'));var auth=require(_0x4fdf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4fdf('0x8'));var controller=require(_0x4fdf('0x9'));router[_0x4fdf('0xa')]('/',auth[_0x4fdf('0xb')](),controller[_0x4fdf('0xc')]);router['get']('/:id',auth[_0x4fdf('0xb')](),controller[_0x4fdf('0xd')]);router[_0x4fdf('0xe')]('/',auth['isAuthenticated'](),controller[_0x4fdf('0xf')]);router[_0x4fdf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4fdf('0x11')]);router[_0x4fdf('0x12')](_0x4fdf('0x13'),auth[_0x4fdf('0xb')](),controller[_0x4fdf('0x14')]);module[_0x4fdf('0x15')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 05aa763..9e88ce0 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 _0xbeae=['STRING','exports','name'];(function(_0x3419ac,_0x411b11){var _0x565e67=function(_0x1f044c){while(--_0x1f044c){_0x3419ac['push'](_0x3419ac['shift']());}};_0x565e67(++_0x411b11);}(_0xbeae,0x82));var _0xebea=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0xbeae[_0xea35d1];return _0x1d7a7c;};'use strict';var Sequelize=require('sequelize');module[_0xebea('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xebea('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xebea('0x2')]}}; \ No newline at end of file +var _0x573a=['name','sequelize','exports','STRING'];(function(_0x3e2e82,_0x369bbe){var _0xba15aa=function(_0x4ac6d4){while(--_0x4ac6d4){_0x3e2e82['push'](_0x3e2e82['shift']());}};_0xba15aa(++_0x369bbe);}(_0x573a,0x105));var _0xa573=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x573a[_0x15dbca];return _0x326533;};'use strict';var Sequelize=require(_0xa573('0x0'));module[_0xa573('0x1')]={'name':{'type':Sequelize[_0xa573('0x2')],'unique':_0xa573('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index a4886de..c04012c 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 _0x0c71=['model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Pauses','error','stack','name','index','map','Pause','rawAttributes','type','key'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x0c71,0x16b));var _0x10c7=function(_0xbd7b5a,_0x499aae){_0xbd7b5a=_0xbd7b5a-0x0;var _0xe7d138=_0x0c71[_0xbd7b5a];return _0xe7d138;};'use strict';var emlformat=require(_0x10c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10c7('0x1'));var jsonpatch=require(_0x10c7('0x2'));var rp=require(_0x10c7('0x3'));var moment=require(_0x10c7('0x4'));var BPromise=require(_0x10c7('0x5'));var Mustache=require('mustache');var util=require(_0x10c7('0x6'));var path=require(_0x10c7('0x7'));var sox=require(_0x10c7('0x8'));var csv=require(_0x10c7('0x9'));var ejs=require(_0x10c7('0xa'));var fs=require('fs');var fs_extra=require(_0x10c7('0xb'));var _=require(_0x10c7('0xc'));var squel=require(_0x10c7('0xd'));var crypto=require('crypto');var jsforce=require(_0x10c7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x10c7('0x9'));var querystring=require(_0x10c7('0xf'));var Papa=require(_0x10c7('0x10'));var Redis=require(_0x10c7('0x11'));var authService=require(_0x10c7('0x12'));var qs=require(_0x10c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10c7('0x14'));var logger=require(_0x10c7('0x15'))(_0x10c7('0x16'));var utils=require('../../config/utils');var config=require(_0x10c7('0x17'));var licenseUtil=require(_0x10c7('0x18'));var db=require(_0x10c7('0x19'))['db'];function respondWithStatusCode(_0x99cbd,_0x1298fb){_0x1298fb=_0x1298fb||0xcc;return function(_0xf91724){if(_0xf91724){return _0x99cbd[_0x10c7('0x1a')](_0x1298fb);}return _0x99cbd[_0x10c7('0x1b')](_0x1298fb)[_0x10c7('0x1c')]();};}function respondWithResult(_0x3d60db,_0x5674f0){_0x5674f0=_0x5674f0||0xc8;return function(_0x4d1f52){if(_0x4d1f52){return _0x3d60db['status'](_0x5674f0)[_0x10c7('0x1d')](_0x4d1f52);}};}function respondWithFilteredResult(_0x4f2856,_0x22079f){return function(_0xd14e41){if(_0xd14e41){var _0x38d6f3=typeof _0x22079f['offset']===_0x10c7('0x1e')&&typeof _0x22079f[_0x10c7('0x1f')]===_0x10c7('0x1e');var _0x24d3d8=_0xd14e41[_0x10c7('0x20')];var _0x277693=_0x38d6f3?0x0:_0x22079f['offset'];var _0x450655=_0x38d6f3?_0xd14e41[_0x10c7('0x20')]:_0x22079f[_0x10c7('0x21')]+_0x22079f[_0x10c7('0x1f')];var _0xf91e63;if(_0x450655>=_0x24d3d8){_0x450655=_0x24d3d8;_0xf91e63=0xc8;}else{_0xf91e63=0xce;}_0x4f2856[_0x10c7('0x1b')](_0xf91e63);return _0x4f2856[_0x10c7('0x22')]('Content-Range',_0x277693+'-'+_0x450655+'/'+_0x24d3d8)[_0x10c7('0x1d')](_0xd14e41);}return null;};}function patchUpdates(_0x1d97d0){return function(_0x210c50){try{jsonpatch[_0x10c7('0x23')](_0x210c50,_0x1d97d0,!![]);}catch(_0x414f6c){return BPromise[_0x10c7('0x24')](_0x414f6c);}return _0x210c50[_0x10c7('0x25')]();};}function saveUpdates(_0x51186c,_0x40eb6d){return function(_0x674103){if(_0x674103){return _0x674103[_0x10c7('0x26')](_0x51186c)[_0x10c7('0x27')](function(_0x5b8ba2){return _0x5b8ba2;});}return null;};}function removeEntity(_0x8ac71c,_0x2f9d2a){return function(_0x1970e4){if(_0x1970e4){return _0x1970e4[_0x10c7('0x28')]()[_0x10c7('0x27')](function(){var _0x5c5675=_0x1970e4[_0x10c7('0x29')]({'plain':!![]});var _0x321ce8=_0x10c7('0x2a');return db['UserProfileResource'][_0x10c7('0x28')]({'where':{'type':_0x321ce8,'resourceId':_0x5c5675['id']}})['then'](function(){return _0x1970e4;});})[_0x10c7('0x27')](function(){_0x8ac71c['status'](0xcc)[_0x10c7('0x1c')]();});}};}function handleEntityNotFound(_0x348c82,_0x56a55b){return function(_0x9be7ba){if(!_0x9be7ba){_0x348c82['sendStatus'](0x194);}return _0x9be7ba;};}function handleError(_0x5e18d3,_0x4a5d9d){_0x4a5d9d=_0x4a5d9d||0x1f4;return function(_0x2527ee){logger[_0x10c7('0x2b')](_0x2527ee[_0x10c7('0x2c')]);if(_0x2527ee[_0x10c7('0x2d')]){delete _0x2527ee[_0x10c7('0x2d')];}_0x5e18d3[_0x10c7('0x1b')](_0x4a5d9d)['send'](_0x2527ee);};}exports[_0x10c7('0x2e')]=function(_0x5efb4b,_0x27a83b){var _0x6d5e8e={},_0x3fb99e={},_0x5c85c9={'count':0x0,'rows':[]};var _0x39889e=_[_0x10c7('0x2f')](db[_0x10c7('0x30')][_0x10c7('0x31')],function(_0x1b9532){return{'name':_0x1b9532['fieldName'],'type':_0x1b9532[_0x10c7('0x32')][_0x10c7('0x33')]};});_0x3fb99e[_0x10c7('0x34')]=_[_0x10c7('0x2f')](_0x39889e,_0x10c7('0x2d'));_0x3fb99e[_0x10c7('0x35')]=_[_0x10c7('0x36')](_0x5efb4b[_0x10c7('0x35')]);_0x3fb99e['filters']=_['intersection'](_0x3fb99e[_0x10c7('0x34')],_0x3fb99e['query']);_0x6d5e8e[_0x10c7('0x37')]=_[_0x10c7('0x38')](_0x3fb99e[_0x10c7('0x34')],qs['fields'](_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x39')]));_0x6d5e8e['attributes']=_0x6d5e8e['attributes']['length']?_0x6d5e8e['attributes']:_0x3fb99e[_0x10c7('0x34')];if(!_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x3a')](_0x10c7('0x3b'))){_0x6d5e8e[_0x10c7('0x1f')]=qs[_0x10c7('0x1f')](_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x1f')]);_0x6d5e8e[_0x10c7('0x21')]=qs['offset'](_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x21')]);}_0x6d5e8e['order']=qs[_0x10c7('0x3c')](_0x5efb4b[_0x10c7('0x35')]['sort']);_0x6d5e8e['where']=qs[_0x10c7('0x3d')](_[_0x10c7('0x3e')](_0x5efb4b[_0x10c7('0x35')],_0x3fb99e[_0x10c7('0x3d')]),_0x39889e);if(_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x3f')]){_0x6d5e8e[_0x10c7('0x40')]=_[_0x10c7('0x41')](_0x6d5e8e[_0x10c7('0x40')],{'$or':_[_0x10c7('0x2f')](_0x39889e,function(_0x34b30b){if(_0x34b30b[_0x10c7('0x32')]!==_0x10c7('0x42')){var _0x4e783b={};_0x4e783b[_0x34b30b[_0x10c7('0x2d')]]={'$like':'%'+_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x3f')]+'%'};return _0x4e783b;}})});}_0x6d5e8e=_[_0x10c7('0x41')]({},_0x6d5e8e,_0x5efb4b[_0x10c7('0x43')]);var _0x1ce078={'where':_0x6d5e8e['where']};return db[_0x10c7('0x30')][_0x10c7('0x20')](_0x1ce078)[_0x10c7('0x27')](function(_0x595193){_0x5c85c9[_0x10c7('0x20')]=_0x595193;if(_0x5efb4b[_0x10c7('0x35')][_0x10c7('0x44')]){_0x6d5e8e[_0x10c7('0x45')]=[{'all':!![]}];}return db[_0x10c7('0x30')]['findAll'](_0x6d5e8e);})[_0x10c7('0x27')](function(_0x772b43){_0x5c85c9['rows']=_0x772b43;return _0x5c85c9;})[_0x10c7('0x27')](respondWithFilteredResult(_0x27a83b,_0x6d5e8e))['catch'](handleError(_0x27a83b,null));};exports['show']=function(_0x97a44b,_0x417fb2){var _0x362bb3={'raw':!![],'where':{'id':_0x97a44b[_0x10c7('0x46')]['id']}},_0x5515f2={};_0x5515f2[_0x10c7('0x34')]=_['keys'](db['Pause'][_0x10c7('0x31')]);_0x5515f2['query']=_[_0x10c7('0x36')](_0x97a44b[_0x10c7('0x35')]);_0x5515f2[_0x10c7('0x3d')]=_[_0x10c7('0x38')](_0x5515f2[_0x10c7('0x34')],_0x5515f2[_0x10c7('0x35')]);_0x362bb3['attributes']=_[_0x10c7('0x38')](_0x5515f2[_0x10c7('0x34')],qs[_0x10c7('0x39')](_0x97a44b[_0x10c7('0x35')][_0x10c7('0x39')]));_0x362bb3[_0x10c7('0x37')]=_0x362bb3[_0x10c7('0x37')][_0x10c7('0x47')]?_0x362bb3[_0x10c7('0x37')]:_0x5515f2[_0x10c7('0x34')];if(_0x97a44b['query'][_0x10c7('0x44')]){_0x362bb3[_0x10c7('0x45')]=[{'all':!![]}];}_0x362bb3=_[_0x10c7('0x41')]({},_0x362bb3,_0x97a44b['options']);return db[_0x10c7('0x30')][_0x10c7('0x48')](_0x362bb3)[_0x10c7('0x27')](handleEntityNotFound(_0x417fb2,null))[_0x10c7('0x27')](respondWithResult(_0x417fb2,null))[_0x10c7('0x49')](handleError(_0x417fb2,null));};exports[_0x10c7('0x4a')]=function(_0x1aabfa,_0xa96808){return db['Pause'][_0x10c7('0x4a')](_0x1aabfa[_0x10c7('0x4b')],{})[_0x10c7('0x27')](function(_0x488453){var _0x4149d6=_0x1aabfa[_0x10c7('0x4c')][_0x10c7('0x29')]({'plain':!![]});if(!_0x4149d6)throw new Error(_0x10c7('0x4d'));if(_0x4149d6[_0x10c7('0x4e')]==='user'){var _0x3c0c5a=_0x488453[_0x10c7('0x29')]({'plain':!![]});var _0x15bc34=_0x10c7('0x2a');return db[_0x10c7('0x4f')]['find']({'where':{'name':_0x15bc34,'userProfileId':_0x4149d6[_0x10c7('0x50')]},'raw':!![]})[_0x10c7('0x27')](function(_0x4d5e1f){if(_0x4d5e1f&&_0x4d5e1f[_0x10c7('0x51')]===0x0){return db[_0x10c7('0x52')][_0x10c7('0x4a')]({'name':_0x3c0c5a[_0x10c7('0x2d')],'resourceId':_0x3c0c5a['id'],'type':_0x4d5e1f['name'],'sectionId':_0x4d5e1f['id']},{})[_0x10c7('0x27')](function(){return _0x488453;});}else{return _0x488453;}})[_0x10c7('0x49')](function(_0x25d7ae){logger[_0x10c7('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25d7ae);throw _0x25d7ae;});}return _0x488453;})['then'](respondWithResult(_0xa96808,0xc9))[_0x10c7('0x49')](handleError(_0xa96808,null));};exports[_0x10c7('0x26')]=function(_0x3affab,_0x2ec2a3){if(_0x3affab[_0x10c7('0x4b')]['id']){delete _0x3affab[_0x10c7('0x4b')]['id'];}return db[_0x10c7('0x30')]['find']({'where':{'id':_0x3affab[_0x10c7('0x46')]['id']}})[_0x10c7('0x27')](handleEntityNotFound(_0x2ec2a3,null))[_0x10c7('0x27')](saveUpdates(_0x3affab[_0x10c7('0x4b')],null))[_0x10c7('0x27')](respondWithResult(_0x2ec2a3,null))[_0x10c7('0x49')](handleError(_0x2ec2a3,null));};exports[_0x10c7('0x28')]=function(_0x5206b6,_0x3ef8b3){return db['Pause']['find']({'where':{'id':_0x5206b6[_0x10c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ef8b3,null))['then'](removeEntity(_0x3ef8b3,null))[_0x10c7('0x49')](handleError(_0x3ef8b3,null));}; \ No newline at end of file +var _0x49c2=['VIRTUAL','merge','options','include','Pause','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','Content-Range','apply','reject','update','then','destroy','get','sendStatus','error','stack','name','send','index','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type'];(function(_0x1fc4b8,_0x56613e){var _0x160ab5=function(_0x54f071){while(--_0x54f071){_0x1fc4b8['push'](_0x1fc4b8['shift']());}};_0x160ab5(++_0x56613e);}(_0x49c2,0x1a5));var _0x249c=function(_0xfe6edc,_0x38ff55){_0xfe6edc=_0xfe6edc-0x0;var _0x433261=_0x49c2[_0xfe6edc];return _0x433261;};'use strict';var emlformat=require(_0x249c('0x0'));var rimraf=require(_0x249c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x249c('0x2'));var moment=require('moment');var BPromise=require(_0x249c('0x3'));var Mustache=require(_0x249c('0x4'));var util=require(_0x249c('0x5'));var path=require(_0x249c('0x6'));var sox=require(_0x249c('0x7'));var csv=require('to-csv');var ejs=require(_0x249c('0x8'));var fs=require('fs');var fs_extra=require(_0x249c('0x9'));var _=require('lodash');var squel=require(_0x249c('0xa'));var crypto=require('crypto');var jsforce=require(_0x249c('0xb'));var deskjs=require(_0x249c('0xc'));var toCsv=require(_0x249c('0xd'));var querystring=require('querystring');var Papa=require(_0x249c('0xe'));var Redis=require('ioredis');var authService=require(_0x249c('0xf'));var qs=require(_0x249c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x249c('0x11'));var logger=require(_0x249c('0x12'))(_0x249c('0x13'));var utils=require(_0x249c('0x14'));var config=require(_0x249c('0x15'));var licenseUtil=require(_0x249c('0x16'));var db=require(_0x249c('0x17'))['db'];function respondWithStatusCode(_0x5ce193,_0x4e56d4){_0x4e56d4=_0x4e56d4||0xcc;return function(_0x485b48){if(_0x485b48){return _0x5ce193['sendStatus'](_0x4e56d4);}return _0x5ce193[_0x249c('0x18')](_0x4e56d4)['end']();};}function respondWithResult(_0x1f4189,_0x52ec41){_0x52ec41=_0x52ec41||0xc8;return function(_0xdc781a){if(_0xdc781a){return _0x1f4189[_0x249c('0x18')](_0x52ec41)[_0x249c('0x19')](_0xdc781a);}};}function respondWithFilteredResult(_0x31f9b9,_0x47c383){return function(_0x1450b8){if(_0x1450b8){var _0x5e5344=typeof _0x47c383[_0x249c('0x1a')]==='undefined'&&typeof _0x47c383['limit']==='undefined';var _0x38d52c=_0x1450b8[_0x249c('0x1b')];var _0x38ca8d=_0x5e5344?0x0:_0x47c383[_0x249c('0x1a')];var _0x38273b=_0x5e5344?_0x1450b8[_0x249c('0x1b')]:_0x47c383[_0x249c('0x1a')]+_0x47c383[_0x249c('0x1c')];var _0x1e468c;if(_0x38273b>=_0x38d52c){_0x38273b=_0x38d52c;_0x1e468c=0xc8;}else{_0x1e468c=0xce;}_0x31f9b9['status'](_0x1e468c);return _0x31f9b9['set'](_0x249c('0x1d'),_0x38ca8d+'-'+_0x38273b+'/'+_0x38d52c)[_0x249c('0x19')](_0x1450b8);}return null;};}function patchUpdates(_0x91f7a3){return function(_0x1fff6d){try{jsonpatch[_0x249c('0x1e')](_0x1fff6d,_0x91f7a3,!![]);}catch(_0x4808af){return BPromise[_0x249c('0x1f')](_0x4808af);}return _0x1fff6d['save']();};}function saveUpdates(_0xd9f4e8,_0x17f85a){return function(_0x229623){if(_0x229623){return _0x229623[_0x249c('0x20')](_0xd9f4e8)[_0x249c('0x21')](function(_0x3bedea){return _0x3bedea;});}return null;};}function removeEntity(_0x178b00,_0x4a8a63){return function(_0x3a2175){if(_0x3a2175){return _0x3a2175[_0x249c('0x22')]()['then'](function(){var _0x3efc1a=_0x3a2175[_0x249c('0x23')]({'plain':!![]});var _0x42616d='Pauses';return db['UserProfileResource'][_0x249c('0x22')]({'where':{'type':_0x42616d,'resourceId':_0x3efc1a['id']}})[_0x249c('0x21')](function(){return _0x3a2175;});})['then'](function(){_0x178b00['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cdd5a,_0x4c8595){return function(_0x2d2721){if(!_0x2d2721){_0x5cdd5a[_0x249c('0x24')](0x194);}return _0x2d2721;};}function handleError(_0x3518dc,_0x44bd8e){_0x44bd8e=_0x44bd8e||0x1f4;return function(_0x4a8a2f){logger[_0x249c('0x25')](_0x4a8a2f[_0x249c('0x26')]);if(_0x4a8a2f[_0x249c('0x27')]){delete _0x4a8a2f['name'];}_0x3518dc[_0x249c('0x18')](_0x44bd8e)[_0x249c('0x28')](_0x4a8a2f);};}exports[_0x249c('0x29')]=function(_0x27b995,_0x308a25){var _0x3b783c={},_0x30709f={},_0x217973={'count':0x0,'rows':[]};var _0x455496=_['map'](db['Pause']['rawAttributes'],function(_0x5e2503){return{'name':_0x5e2503['fieldName'],'type':_0x5e2503['type'][_0x249c('0x2a')]};});_0x30709f[_0x249c('0x2b')]=_['map'](_0x455496,'name');_0x30709f[_0x249c('0x2c')]=_[_0x249c('0x2d')](_0x27b995[_0x249c('0x2c')]);_0x30709f[_0x249c('0x2e')]=_[_0x249c('0x2f')](_0x30709f['model'],_0x30709f[_0x249c('0x2c')]);_0x3b783c[_0x249c('0x30')]=_[_0x249c('0x2f')](_0x30709f[_0x249c('0x2b')],qs['fields'](_0x27b995['query'][_0x249c('0x31')]));_0x3b783c['attributes']=_0x3b783c[_0x249c('0x30')][_0x249c('0x32')]?_0x3b783c[_0x249c('0x30')]:_0x30709f[_0x249c('0x2b')];if(!_0x27b995[_0x249c('0x2c')][_0x249c('0x33')](_0x249c('0x34'))){_0x3b783c['limit']=qs['limit'](_0x27b995[_0x249c('0x2c')][_0x249c('0x1c')]);_0x3b783c[_0x249c('0x1a')]=qs['offset'](_0x27b995['query'][_0x249c('0x1a')]);}_0x3b783c[_0x249c('0x35')]=qs[_0x249c('0x36')](_0x27b995['query'][_0x249c('0x36')]);_0x3b783c['where']=qs[_0x249c('0x2e')](_[_0x249c('0x37')](_0x27b995[_0x249c('0x2c')],_0x30709f['filters']),_0x455496);if(_0x27b995[_0x249c('0x2c')][_0x249c('0x38')]){_0x3b783c[_0x249c('0x39')]=_['merge'](_0x3b783c[_0x249c('0x39')],{'$or':_['map'](_0x455496,function(_0x4123d0){if(_0x4123d0[_0x249c('0x3a')]!==_0x249c('0x3b')){var _0x1846f6={};_0x1846f6[_0x4123d0['name']]={'$like':'%'+_0x27b995['query'][_0x249c('0x38')]+'%'};return _0x1846f6;}})});}_0x3b783c=_[_0x249c('0x3c')]({},_0x3b783c,_0x27b995[_0x249c('0x3d')]);var _0x368ab8={'where':_0x3b783c[_0x249c('0x39')]};return db['Pause']['count'](_0x368ab8)['then'](function(_0x5bc631){_0x217973[_0x249c('0x1b')]=_0x5bc631;if(_0x27b995[_0x249c('0x2c')]['includeAll']){_0x3b783c[_0x249c('0x3e')]=[{'all':!![]}];}return db[_0x249c('0x3f')][_0x249c('0x40')](_0x3b783c);})['then'](function(_0x34324b){_0x217973[_0x249c('0x41')]=_0x34324b;return _0x217973;})['then'](respondWithFilteredResult(_0x308a25,_0x3b783c))[_0x249c('0x42')](handleError(_0x308a25,null));};exports[_0x249c('0x43')]=function(_0x3efb3c,_0x5129cf){var _0x5825c6={'raw':!![],'where':{'id':_0x3efb3c[_0x249c('0x44')]['id']}},_0x3e71d0={};_0x3e71d0['model']=_['keys'](db[_0x249c('0x3f')][_0x249c('0x45')]);_0x3e71d0['query']=_['keys'](_0x3efb3c['query']);_0x3e71d0[_0x249c('0x2e')]=_[_0x249c('0x2f')](_0x3e71d0[_0x249c('0x2b')],_0x3e71d0[_0x249c('0x2c')]);_0x5825c6[_0x249c('0x30')]=_[_0x249c('0x2f')](_0x3e71d0[_0x249c('0x2b')],qs['fields'](_0x3efb3c[_0x249c('0x2c')][_0x249c('0x31')]));_0x5825c6[_0x249c('0x30')]=_0x5825c6[_0x249c('0x30')]['length']?_0x5825c6[_0x249c('0x30')]:_0x3e71d0[_0x249c('0x2b')];if(_0x3efb3c[_0x249c('0x2c')][_0x249c('0x46')]){_0x5825c6[_0x249c('0x3e')]=[{'all':!![]}];}_0x5825c6=_[_0x249c('0x3c')]({},_0x5825c6,_0x3efb3c['options']);return db['Pause'][_0x249c('0x47')](_0x5825c6)[_0x249c('0x21')](handleEntityNotFound(_0x5129cf,null))['then'](respondWithResult(_0x5129cf,null))['catch'](handleError(_0x5129cf,null));};exports[_0x249c('0x48')]=function(_0x2316ba,_0x5ef827){return db['Pause'][_0x249c('0x48')](_0x2316ba['body'],{})['then'](function(_0x456645){var _0x570eae=_0x2316ba['user']['get']({'plain':!![]});if(!_0x570eae)throw new Error(_0x249c('0x49'));if(_0x570eae['role']==='user'){var _0x29b59d=_0x456645['get']({'plain':!![]});var _0x4b1a5f=_0x249c('0x4a');return db[_0x249c('0x4b')][_0x249c('0x47')]({'where':{'name':_0x4b1a5f,'userProfileId':_0x570eae[_0x249c('0x4c')]},'raw':!![]})[_0x249c('0x21')](function(_0x33eeda){if(_0x33eeda&&_0x33eeda[_0x249c('0x4d')]===0x0){return db['UserProfileResource'][_0x249c('0x48')]({'name':_0x29b59d['name'],'resourceId':_0x29b59d['id'],'type':_0x33eeda['name'],'sectionId':_0x33eeda['id']},{})['then'](function(){return _0x456645;});}else{return _0x456645;}})[_0x249c('0x42')](function(_0x34f2ff){logger[_0x249c('0x25')](_0x249c('0x4e'),_0x34f2ff);throw _0x34f2ff;});}return _0x456645;})['then'](respondWithResult(_0x5ef827,0xc9))[_0x249c('0x42')](handleError(_0x5ef827,null));};exports['update']=function(_0x27e727,_0x24a334){if(_0x27e727[_0x249c('0x4f')]['id']){delete _0x27e727[_0x249c('0x4f')]['id'];}return db['Pause'][_0x249c('0x47')]({'where':{'id':_0x27e727[_0x249c('0x44')]['id']}})[_0x249c('0x21')](handleEntityNotFound(_0x24a334,null))[_0x249c('0x21')](saveUpdates(_0x27e727[_0x249c('0x4f')],null))['then'](respondWithResult(_0x24a334,null))[_0x249c('0x42')](handleError(_0x24a334,null));};exports[_0x249c('0x22')]=function(_0x53b7a4,_0x4b3e17){return db[_0x249c('0x3f')][_0x249c('0x47')]({'where':{'id':_0x53b7a4[_0x249c('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b3e17,null))[_0x249c('0x21')](removeEntity(_0x4b3e17,null))[_0x249c('0x42')](handleError(_0x4b3e17,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 8163900..9308e19 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x432269,_0x4ae9c7){var _0x42a2dd=function(_0x3920d3){while(--_0x3920d3){_0x432269['push'](_0x432269['shift']());}};_0x42a2dd(++_0x4ae9c7);}(_0xe14b,0x93));var _0xbe14=function(_0xd0bb91,_0x308c50){_0xd0bb91=_0xd0bb91-0x0;var _0x1c192a=_0xe14b[_0xd0bb91];return _0x1c192a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x48317f,_0x12895a){_0x48317f=_0x48317f-0x0;var _0x4d1cce=_0x7fbe[_0x48317f];return _0x4d1cce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','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 f4ec1d3..6d9010c 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(_0x131553,_0x3481b0){var _0x29c951=function(_0x347cf0){while(--_0x347cf0){_0x131553['push'](_0x131553['shift']());}};_0x29c951(++_0x3481b0);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a1256,_0x1fe2db){_0x3a1256=_0x3a1256-0x0;var _0x1bd352=_0xb10b[_0x3a1256];return _0x1bd352;};'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(_0x5ce89d,_0x3b4a3f){var _0x40f313=function(_0x567eea){while(--_0x567eea){_0x5ce89d['push'](_0x5ce89d['shift']());}};_0x40f313(++_0x3b4a3f);}(_0xb10b,0x12a));var _0xbb10=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0xb10b[_0xdd0313];return _0x2bd7e8;};'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 4c02e50..3346b77 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 _0x0c02=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/:id','show','/:id/download','join','root','server/files/plugins','replace','format','%s-%s%s','basename','originalname','extname','now','post','single','file','upload','/webhook','update','delete','exports'];(function(_0x2eff23,_0x355c23){var _0x3e521b=function(_0x3a242a){while(--_0x3a242a){_0x2eff23['push'](_0x2eff23['shift']());}};_0x3e521b(++_0x355c23);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0x9')](_0x20c0('0xe'),auth[_0x20c0('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52eb0d,_0x578592,_0x56770a){_0x56770a(null,path[_0x20c0('0xf')](config[_0x20c0('0x10')],_0x20c0('0x11')));},'filename':function(_0x207b1e,_0x4ed79e,_0x56fa09){_0x4ed79e['originalname']=_0x4ed79e['originalname'][_0x20c0('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56fa09(null,util[_0x20c0('0x13')](_0x20c0('0x14'),path[_0x20c0('0x15')](_0x4ed79e[_0x20c0('0x16')],path[_0x20c0('0x17')](_0x4ed79e[_0x20c0('0x16')])),Date[_0x20c0('0x18')](),path[_0x20c0('0x17')](_0x4ed79e['originalname'])));}})});router[_0x20c0('0x19')]('/',upload[_0x20c0('0x1a')](_0x20c0('0x1b')),controller[_0x20c0('0x1c')]);router[_0x20c0('0x19')](_0x20c0('0x1d'),controller['webhookPost']);router['put']('/:id',auth[_0x20c0('0xa')](),controller[_0x20c0('0x1e')]);router[_0x20c0('0x1f')](_0x20c0('0xc'),auth['isAuthenticated'](),controller[_0x20c0('0x1f')]);module[_0x20c0('0x20')]=router; \ No newline at end of file +var _0x04de=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','/webhook','webhookGet','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','webhookPost'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x04de,0x107));var _0xe04d=function(_0xe2a838,_0x5f0561){_0xe2a838=_0xe2a838-0x0;var _0x3f4d4d=_0x04de[_0xe2a838];return _0x3f4d4d;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),controller[_0xe04d('0xc')]);router[_0xe04d('0xd')](_0xe04d('0xe'),auth[_0xe04d('0xf')](),controller[_0xe04d('0x10')]);router[_0xe04d('0xd')](_0xe04d('0x11'),auth['isAuthenticated'](),controller[_0xe04d('0x12')]);var upload=multer({'storage':multer[_0xe04d('0x13')]({'destination':function(_0x2576b2,_0x30c46b,_0xad5c34){_0xad5c34(null,path[_0xe04d('0x14')](config[_0xe04d('0x15')],_0xe04d('0x16')));},'filename':function(_0x3ccdc8,_0x53f59a,_0x8bf2d2){_0x53f59a[_0xe04d('0x17')]=_0x53f59a[_0xe04d('0x17')][_0xe04d('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x8bf2d2(null,util[_0xe04d('0x19')](_0xe04d('0x1a'),path[_0xe04d('0x1b')](_0x53f59a[_0xe04d('0x17')],path[_0xe04d('0x1c')](_0x53f59a[_0xe04d('0x17')])),Date[_0xe04d('0x1d')](),path[_0xe04d('0x1c')](_0x53f59a['originalname'])));}})});router[_0xe04d('0x1e')]('/',upload['single'](_0xe04d('0x1f')),controller['upload']);router[_0xe04d('0x1e')](_0xe04d('0xb'),controller[_0xe04d('0x20')]);router[_0xe04d('0x21')](_0xe04d('0xe'),auth[_0xe04d('0xf')](),controller[_0xe04d('0x22')]);router[_0xe04d('0x23')](_0xe04d('0xe'),auth['isAuthenticated'](),controller[_0xe04d('0x23')]);module[_0xe04d('0x24')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 8836192..c1dbbff 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 _0x0575=['exports','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x0575,0x70));var _0x5057=function(_0x2238ce,_0x31646b){_0x2238ce=_0x2238ce-0x0;var _0x2fd738=_0x0575[_0x2238ce];return _0x2fd738;};'use strict';var Sequelize=require('sequelize');module[_0x5057('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x5057('0x1'),_0x5057('0x2'))},'description':{'type':Sequelize[_0x5057('0x3')]},'version':{'type':Sequelize[_0x5057('0x3')]},'path':{'type':Sequelize[_0x5057('0x4')],'comment':_0x5057('0x5')},'active':{'type':Sequelize[_0x5057('0x6')],'defaultValue':0x0,'comment':_0x5057('0x7')},'sidebar':{'type':Sequelize[_0x5057('0x8')](_0x5057('0x9'),_0x5057('0xa'),_0x5057('0xb'),_0x5057('0xc')),'defaultValue':_0x5057('0xb'),'comment':_0x5057('0xd')},'icon':{'type':Sequelize[_0x5057('0x4')]},'adminUrl':{'type':Sequelize[_0x5057('0x4')]},'agentUrl':{'type':Sequelize[_0x5057('0x4')]},'scriptName':{'type':Sequelize[_0x5057('0x4')]},'scriptPath':{'type':Sequelize[_0x5057('0x4')]}}; \ No newline at end of file +var _0x392a=['adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','html','script','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x1e58e1,_0x204823){var _0xa081f9=function(_0x16317c){while(--_0x16317c){_0x1e58e1['push'](_0x1e58e1['shift']());}};_0xa081f9(++_0x204823);}(_0x392a,0xe0));var _0xa392=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x392a[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0xa392('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa392('0x1'),_0xa392('0x2'))},'description':{'type':Sequelize[_0xa392('0x3')]},'version':{'type':Sequelize[_0xa392('0x3')]},'path':{'type':Sequelize[_0xa392('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xa392('0x5')],'defaultValue':0x0,'comment':_0xa392('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0xa392('0x7'),'agentOnly',_0xa392('0x8'),_0xa392('0x9')),'defaultValue':_0xa392('0x8'),'comment':_0xa392('0xa')},'icon':{'type':Sequelize[_0xa392('0x4')]},'adminUrl':{'type':Sequelize[_0xa392('0x4')]},'agentUrl':{'type':Sequelize[_0xa392('0x4')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xa392('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5cf4242..21ba917 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 _0x82a3=['user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','format','%s%s','headers','content-length','content-type','set','endsWith','download','statusCode','webhookPost','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','name','send','index','map','Plugin','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','findAll','rows','show','options','find','catch','params','path','join','root','%s.zip','basename','createWriteStream','zip','warning','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','server/files/plugins','dirname','node_modules/**/*','finalize','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','version','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x8bfca0,_0x564c3e){var _0x1b39aa=function(_0xbecb85){while(--_0xbecb85){_0x8bfca0['push'](_0x8bfca0['shift']());}};_0x1b39aa(++_0x564c3e);}(_0x82a3,0xb8));var _0x382a=function(_0x3550e8,_0x424fea){_0x3550e8=_0x3550e8-0x0;var _0x18eb61=_0x82a3[_0x3550e8];return _0x18eb61;};'use strict';var emlformat=require(_0x382a('0x0'));var rimraf=require(_0x382a('0x1'));var zipdir=require(_0x382a('0x2'));var jsonpatch=require(_0x382a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x382a('0x4'));var util=require(_0x382a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x382a('0x6'));var ejs=require(_0x382a('0x7'));var fs=require('fs');var fs_extra=require(_0x382a('0x8'));var _=require(_0x382a('0x9'));var squel=require(_0x382a('0xa'));var crypto=require(_0x382a('0xb'));var jsforce=require(_0x382a('0xc'));var deskjs=require(_0x382a('0xd'));var toCsv=require(_0x382a('0x6'));var querystring=require(_0x382a('0xe'));var Papa=require(_0x382a('0xf'));var extract=require(_0x382a('0x10'));var rimraf=require(_0x382a('0x1'));var archiver=require(_0x382a('0x11'));var Redis=require(_0x382a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x382a('0x13'));var hardwareService=require(_0x382a('0x14'));var logger=require(_0x382a('0x15'))(_0x382a('0x16'));var utils=require(_0x382a('0x17'));var config=require(_0x382a('0x18'));var licenseUtil=require(_0x382a('0x19'));var db=require('../../mysqldb')['db'];config[_0x382a('0x1a')]=_[_0x382a('0x1b')](config['redis'],{'host':_0x382a('0x1c'),'port':0x18eb});var socket=require(_0x382a('0x1d'))(new Redis(config[_0x382a('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x373417,_0x570376){_0x570376=_0x570376||0xcc;return function(_0xd2c24e){if(_0xd2c24e){return _0x373417['sendStatus'](_0x570376);}return _0x373417['status'](_0x570376)[_0x382a('0x1e')]();};}function respondWithResult(_0x309141,_0x22b39c){_0x22b39c=_0x22b39c||0xc8;return function(_0x5983fe){if(_0x5983fe){return _0x309141[_0x382a('0x1f')](_0x22b39c)[_0x382a('0x20')](_0x5983fe);}};}function respondWithFilteredResult(_0x39d73e,_0x50e409){return function(_0x11391){if(_0x11391){var _0x4172a8=typeof _0x50e409[_0x382a('0x21')]===_0x382a('0x22')&&typeof _0x50e409['limit']===_0x382a('0x22');var _0x15f0d4=_0x11391['count'];var _0x251a9f=_0x4172a8?0x0:_0x50e409['offset'];var _0x100f76=_0x4172a8?_0x11391[_0x382a('0x23')]:_0x50e409[_0x382a('0x21')]+_0x50e409[_0x382a('0x24')];var _0x2414b5;if(_0x100f76>=_0x15f0d4){_0x100f76=_0x15f0d4;_0x2414b5=0xc8;}else{_0x2414b5=0xce;}_0x39d73e['status'](_0x2414b5);return _0x39d73e['set'](_0x382a('0x25'),_0x251a9f+'-'+_0x100f76+'/'+_0x15f0d4)['json'](_0x11391);}return null;};}function patchUpdates(_0x4a11ce){return function(_0x3ab697){try{jsonpatch[_0x382a('0x26')](_0x3ab697,_0x4a11ce,!![]);}catch(_0x47d0fe){return BPromise['reject'](_0x47d0fe);}return _0x3ab697['save']();};}function saveUpdates(_0x2f68a0,_0x2e2907){return function(_0x577507){if(_0x577507){return _0x577507[_0x382a('0x27')](_0x2f68a0)[_0x382a('0x28')](function(_0x3d4c08){return _0x3d4c08;});}return null;};}function removeEntity(_0x48af06,_0xdceea0){return function(_0x362c4c){if(_0x362c4c){return _0x362c4c[_0x382a('0x29')]()[_0x382a('0x28')](function(){var _0x28fbba=_0x362c4c[_0x382a('0x2a')]({'plain':!![]});var _0x2e1e2c=_0x382a('0x2b');return db[_0x382a('0x2c')][_0x382a('0x29')]({'where':{'type':_0x2e1e2c,'resourceId':_0x28fbba['id']}})[_0x382a('0x28')](function(){return _0x362c4c;});})[_0x382a('0x28')](function(){_0x48af06[_0x382a('0x1f')](0xcc)[_0x382a('0x1e')]();});}};}function handleEntityNotFound(_0x3d8ec6,_0x160986){return function(_0x382a35){if(!_0x382a35){_0x3d8ec6[_0x382a('0x2d')](0x194);}return _0x382a35;};}function handleError(_0x1582e9,_0x38c6bc){_0x38c6bc=_0x38c6bc||0x1f4;return function(_0x14a934){logger['error'](_0x14a934['stack']);if(_0x14a934['name']){delete _0x14a934[_0x382a('0x2e')];}_0x1582e9[_0x382a('0x1f')](_0x38c6bc)[_0x382a('0x2f')](_0x14a934);};}exports[_0x382a('0x30')]=function(_0x349393,_0x38054b){var _0x6c8596={},_0x15d829={},_0x2e7f2c={'count':0x0,'rows':[]};var _0x3211d2=_[_0x382a('0x31')](db[_0x382a('0x32')]['rawAttributes'],function(_0x19cf98){return{'name':_0x19cf98[_0x382a('0x33')],'type':_0x19cf98[_0x382a('0x34')][_0x382a('0x35')]};});_0x15d829[_0x382a('0x36')]=_['map'](_0x3211d2,_0x382a('0x2e'));_0x15d829[_0x382a('0x37')]=_[_0x382a('0x38')](_0x349393[_0x382a('0x37')]);_0x15d829['filters']=_[_0x382a('0x39')](_0x15d829['model'],_0x15d829[_0x382a('0x37')]);_0x6c8596[_0x382a('0x3a')]=_[_0x382a('0x39')](_0x15d829[_0x382a('0x36')],qs['fields'](_0x349393[_0x382a('0x37')][_0x382a('0x3b')]));_0x6c8596[_0x382a('0x3a')]=_0x6c8596[_0x382a('0x3a')][_0x382a('0x3c')]?_0x6c8596[_0x382a('0x3a')]:_0x15d829[_0x382a('0x36')];if(!_0x349393['query'][_0x382a('0x3d')]('nolimit')){_0x6c8596[_0x382a('0x24')]=qs['limit'](_0x349393[_0x382a('0x37')][_0x382a('0x24')]);_0x6c8596[_0x382a('0x21')]=qs[_0x382a('0x21')](_0x349393[_0x382a('0x37')]['offset']);}_0x6c8596[_0x382a('0x3e')]=qs[_0x382a('0x3f')](_0x349393[_0x382a('0x37')][_0x382a('0x3f')]);_0x6c8596[_0x382a('0x40')]=qs['filters'](_['pick'](_0x349393['query'],_0x15d829[_0x382a('0x41')]),_0x3211d2);if(_0x349393[_0x382a('0x37')][_0x382a('0x42')]){_0x6c8596['where']=_['merge'](_0x6c8596['where'],{'$or':_[_0x382a('0x31')](_0x3211d2,function(_0x34f0f7){if(_0x34f0f7[_0x382a('0x34')]!==_0x382a('0x43')){var _0x23086e={};_0x23086e[_0x34f0f7[_0x382a('0x2e')]]={'$like':'%'+_0x349393[_0x382a('0x37')][_0x382a('0x42')]+'%'};return _0x23086e;}})});}_0x6c8596=_[_0x382a('0x44')]({},_0x6c8596,_0x349393['options']);var _0x528a7a={'where':_0x6c8596[_0x382a('0x40')]};return db[_0x382a('0x32')][_0x382a('0x23')](_0x528a7a)['then'](function(_0x3d52d2){_0x2e7f2c[_0x382a('0x23')]=_0x3d52d2;if(_0x349393[_0x382a('0x37')][_0x382a('0x45')]){_0x6c8596['include']=[{'all':!![]}];}return db[_0x382a('0x32')][_0x382a('0x46')](_0x6c8596);})[_0x382a('0x28')](function(_0x472578){_0x2e7f2c[_0x382a('0x47')]=_0x472578;return _0x2e7f2c;})[_0x382a('0x28')](respondWithFilteredResult(_0x38054b,_0x6c8596))['catch'](handleError(_0x38054b,null));};exports[_0x382a('0x48')]=function(_0x5ee182,_0x4cba01){var _0x38dba2={'raw':!![],'where':{'id':_0x5ee182['params']['id']}},_0x13628d={};_0x13628d[_0x382a('0x36')]=_[_0x382a('0x38')](db[_0x382a('0x32')]['rawAttributes']);_0x13628d['query']=_[_0x382a('0x38')](_0x5ee182[_0x382a('0x37')]);_0x13628d['filters']=_[_0x382a('0x39')](_0x13628d['model'],_0x13628d[_0x382a('0x37')]);_0x38dba2[_0x382a('0x3a')]=_[_0x382a('0x39')](_0x13628d['model'],qs[_0x382a('0x3b')](_0x5ee182[_0x382a('0x37')][_0x382a('0x3b')]));_0x38dba2[_0x382a('0x3a')]=_0x38dba2[_0x382a('0x3a')][_0x382a('0x3c')]?_0x38dba2['attributes']:_0x13628d['model'];if(_0x5ee182[_0x382a('0x37')]['includeAll']){_0x38dba2['include']=[{'all':!![]}];}_0x38dba2=_[_0x382a('0x44')]({},_0x38dba2,_0x5ee182[_0x382a('0x49')]);return db[_0x382a('0x32')][_0x382a('0x4a')](_0x38dba2)[_0x382a('0x28')](handleEntityNotFound(_0x4cba01,null))[_0x382a('0x28')](respondWithResult(_0x4cba01,null))[_0x382a('0x4b')](handleError(_0x4cba01,null));};exports['download']=function(_0x3392d2,_0x1bb3c0,_0x431e92){return db[_0x382a('0x32')]['find']({'where':{'id':_0x3392d2[_0x382a('0x4c')]['id']},'attributes':['name',_0x382a('0x4d')],'raw':!![]})[_0x382a('0x28')](handleEntityNotFound(_0x1bb3c0,null))[_0x382a('0x28')](function(_0x4d69f5){if(_0x4d69f5){var _0x5820f1=path[_0x382a('0x4e')](config[_0x382a('0x4f')],'server/files/plugins',util['format'](_0x382a('0x50'),path[_0x382a('0x51')](_0x4d69f5[_0x382a('0x4d')])));var _0xa6520d=fs[_0x382a('0x52')](_0x5820f1);var _0x4cece9=archiver(_0x382a('0x53'),{'zlib':{'level':0x9}});_0x4cece9['on'](_0x382a('0x54'),function(_0x38da15){if(_0x38da15[_0x382a('0x55')]==='ENOENT'){logger[_0x382a('0x56')](_0x38da15);}else{throw new db[(_0x382a('0x57'))][(_0x382a('0x58'))](_0x382a('0x59'));}});_0x4cece9['on'](_0x382a('0x56'),function(_0x4d1dc8){throw new db['Sequelize'][(_0x382a('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x4cece9['pipe'](_0xa6520d);_0x4cece9['glob'](_0x382a('0x5a'),{'cwd':path[_0x382a('0x4e')](config[_0x382a('0x4f')],_0x382a('0x5b'),path[_0x382a('0x5c')](_0x4d69f5[_0x382a('0x4d')])),'ignore':[path[_0x382a('0x4e')](path[_0x382a('0x51')](_0x4d69f5['path']),_0x382a('0x5d')),path[_0x382a('0x4e')](path[_0x382a('0x51')](_0x4d69f5[_0x382a('0x4d')]),'attachments/**/*')],'nodir':!![]})[_0x382a('0x5e')]();_0xa6520d['on']('close',function(){if(!fs['existsSync'](_0x5820f1)){throw new db[(_0x382a('0x57'))][(_0x382a('0x58'))](_0x382a('0x5f'));}return _0x1bb3c0['download'](_0x5820f1,util['format']('%s.zip',path[_0x382a('0x51')](_0x4d69f5[_0x382a('0x4d')])),function(_0x43706f){if(_0x43706f){throw new db[(_0x382a('0x57'))][(_0x382a('0x58'))](_0x382a('0x60'));}fs[_0x382a('0x61')](_0x5820f1);logger[_0x382a('0x62')]('Download\x20completed');logger[_0x382a('0x62')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x1bb3c0,null));};exports[_0x382a('0x63')]=function(_0x2e0ead,_0x14591f,_0x26cdb6){var _0x3ee96c=path[_0x382a('0x51')](_0x2e0ead[_0x382a('0x64')][_0x382a('0x65')],path[_0x382a('0x66')](_0x2e0ead[_0x382a('0x64')]['filename']));var _0x19d979=path['join'](config[_0x382a('0x4f')],_0x382a('0x5b'),_0x2e0ead[_0x382a('0x64')][_0x382a('0x65')]);var _0x3e5abe=path[_0x382a('0x4e')](config[_0x382a('0x4f')],'server/files/plugins',_0x3ee96c);logger[_0x382a('0x62')]('Plugin\x20upload\x20filepath:\x20%s',_0x19d979);logger[_0x382a('0x62')](_0x382a('0x67'),_0x3e5abe);try{fs[_0x382a('0x68')](_0x19d979,parseInt('0777',0x8));extract(_0x19d979,{'dir':_0x3e5abe},function(_0x12d751){if(_0x12d751){logger[_0x382a('0x56')](_0x12d751);handleError(_0x12d751,!![]);};var _0xb21d61=fs[_0x382a('0x69')](_0x3e5abe);if(_0xb21d61[_0x382a('0x3c')]>0x1){removeReferences(_0x19d979,_0x3e5abe);logger[_0x382a('0x56')](_0x382a('0x6a'));return _0x26cdb6(new Error(_0x382a('0x6a')));}var _0x192f1f=fs[_0x382a('0x6b')](path[_0x382a('0x4e')](_0x3e5abe,_0xb21d61[0x0]));if(_0x192f1f[_0x382a('0x6c')]()){removeReferences(_0x19d979,_0x3e5abe);logger['error']('Invalid\x20plugin\x20structure');return _0x26cdb6(new Error(_0x382a('0x6a')));}if(_0x192f1f[_0x382a('0x6d')]()){var _0x92992c=fs['readdirSync'](path[_0x382a('0x4e')](_0x3e5abe,_0xb21d61[0x0]));if(_0x92992c[_0x382a('0x3c')]===0x0){removeReferences(_0x19d979,_0x3e5abe);logger[_0x382a('0x56')]('Invalid\x20plugin\x20structure');return _0x26cdb6(new Error(_0x382a('0x6a')));}var _0x346df8=_0x92992c[_0x382a('0x6e')](function(_0x536404){return _0x536404===_0x382a('0x6f');});if(!_0x346df8){return _0x26cdb6(new Error(_0x382a('0x70')));}var _0x961565=fs['readFileSync'](path[_0x382a('0x4e')](_0x3e5abe,_0xb21d61[0x0],_0x382a('0x6f')));var _0xb41cc6=JSON[_0x382a('0x71')](_0x961565);if(_0x382a('0x22')==typeof _0xb41cc6[_0x382a('0x2e')]){return _0x26cdb6(new Error(_0x382a('0x72')));}if('undefined'==typeof _0xb41cc6[_0x382a('0x34')]){return _0x26cdb6(new Error(_0x382a('0x73')));}if(_0x382a('0x22')==typeof _0xb41cc6['version']){return _0x26cdb6(new Error(_0x382a('0x74')));}if('undefined'==typeof _0xb41cc6[_0x382a('0x75')]){return _0x26cdb6(new Error(_0x382a('0x76')));}if(_0xb41cc6[_0x382a('0x34')]===_0x382a('0x77')){if(_0x382a('0x22')==typeof _0xb41cc6['parameters'][_0x382a('0x78')]){return _0x26cdb6(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x382a('0x22')==typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x78')][_0x382a('0x79')]&&'undefined'==typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x78')][_0x382a('0x7a')]){return _0x26cdb6(new Error(_0x382a('0x7b')));}}else if(_0xb41cc6[_0x382a('0x34')]==='script'){if(_0x382a('0x22')==typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x7c')]){return _0x26cdb6(new Error(_0x382a('0x7d')));}if(_0x382a('0x22')==typeof _0xb41cc6['parameters'][_0x382a('0x7e')]){return _0x26cdb6(new Error(_0x382a('0x7f')));}}else{return _0x26cdb6(new Error(_0x382a('0x80')));}var _0x2fd937=_0xb41cc6[_0x382a('0x2e')];var _0xd571f6=_0xb41cc6[_0x382a('0x81')];var _0x4e9743=_0xb41cc6[_0x382a('0x34')];var _0x377cdf=_0xb41cc6[_0x382a('0x82')]?_0xb41cc6[_0x382a('0x82')]:_0x382a('0x83');var _0x94995b=_0xb41cc6[_0x382a('0x84')]?_0xb41cc6['icon']:'icon-apps';var _0x2a95cc='';var _0x2c94f5='';var _0x281085='';var _0x5418b0='';var _0x590a21=_0xb41cc6[_0x382a('0x85')];if(_0x4e9743===_0x382a('0x77')){if(_0x382a('0x22')!=typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x78')]['admin']){var _0x2712ae=_0xb41cc6[_0x382a('0x75')][_0x382a('0x78')][_0x382a('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x382a('0x86')](_0x2712ae)){_0x2a95cc=path[_0x382a('0x4e')](_0x382a('0x87'),_0x3ee96c,_0xb21d61[0x0],_0x2712ae);}else{_0x2a95cc=_0x2712ae;}}else{logger[_0x382a('0x62')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0xb41cc6['parameters']['views']['agent']){var _0x24e738=_0xb41cc6['parameters'][_0x382a('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x382a('0x86')](_0x24e738)){_0x2c94f5=path[_0x382a('0x4e')](_0x382a('0x87'),_0x3ee96c,_0xb21d61[0x0],_0x24e738);}else{_0x2c94f5=_0x24e738;}}else{logger[_0x382a('0x62')](_0x382a('0x88'));}}else if(_0x4e9743==='script'){_0x281085=_0xb41cc6[_0x382a('0x75')][_0x382a('0x7c')];_0x5418b0=_0xb41cc6[_0x382a('0x75')][_0x382a('0x7e')];if(_0x382a('0x22')!=typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x78')]){if('undefined'!=typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x78')][_0x382a('0x79')]){var _0x2712ae=_0xb41cc6[_0x382a('0x75')][_0x382a('0x78')][_0x382a('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x382a('0x86')](_0x2712ae)){_0x2a95cc=path[_0x382a('0x4e')](_0x382a('0x87'),_0x3ee96c,_0xb21d61[0x0],_0x2712ae);}else{_0x2a95cc=_0x2712ae;}}if(_0x382a('0x22')!=typeof _0xb41cc6[_0x382a('0x75')][_0x382a('0x78')]['agent']){var _0x24e738=_0xb41cc6[_0x382a('0x75')][_0x382a('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x382a('0x86')](_0x24e738)){_0x2c94f5=path['join'](_0x382a('0x87'),_0x3ee96c,_0xb21d61[0x0],_0x24e738);}else{_0x2c94f5=_0x24e738;}}}}var _0x3f6f36={'name':_0x2fd937,'description':_0xd571f6,'path':path[_0x382a('0x4e')](_0x3ee96c,_0xb21d61[0x0]),'type':_0x4e9743,'sidebar':_0x377cdf,'icon':_0x94995b,'adminUrl':_0x2a95cc,'agentUrl':_0x2c94f5,'scriptName':_0x281085,'scriptPath':_0x5418b0,'version':_0x590a21};removeReferences(_0x19d979,null);return db[_0x382a('0x32')][_0x382a('0x89')](_0x3f6f36)[_0x382a('0x28')](function(_0x1f898f){var _0x272672={'role':_0x2e0ead[_0x382a('0x8a')]['role'],'userProfileId':_0x2e0ead[_0x382a('0x8a')][_0x382a('0x8b')]};if(!_0x272672)throw new Error(_0x382a('0x8c'));if(_0x272672[_0x382a('0x8d')]===_0x382a('0x8e')){var _0x3648b2=_0x1f898f[_0x382a('0x2a')]({'plain':!![]});return db[_0x382a('0x8f')][_0x382a('0x4a')]({'where':{'name':_0x382a('0x2b'),'userProfileId':_0x272672['userProfileId']},'raw':!![]})[_0x382a('0x28')](function(_0xa2bb01){if(_0xa2bb01&&_0xa2bb01[_0x382a('0x90')]===0x0){return db[_0x382a('0x2c')][_0x382a('0x89')]({'name':_0x3648b2[_0x382a('0x2e')],'resourceId':_0x3648b2['id'],'type':_0xa2bb01['name'],'sectionId':_0xa2bb01['id']},{})[_0x382a('0x28')](function(){return _0x1f898f;});}else{return _0x1f898f;}})[_0x382a('0x4b')](function(_0x86db32){logger[_0x382a('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x86db32);throw _0x86db32;});}return _0x1f898f;})[_0x382a('0x28')](respondWithResult(_0x14591f,null))['catch'](handleError(_0x14591f,null));}});}catch(_0x342433){_0x14591f[_0x382a('0x1f')](0x1f4)[_0x382a('0x2f')](_0x342433);}};function removeReferences(_0x41a14f,_0x4213a2){try{if(_0x41a14f){fs['unlinkSync'](_0x41a14f);logger[_0x382a('0x62')](_0x382a('0x91'));}if(_0x4213a2){rimraf(_0x4213a2,function(){});logger[_0x382a('0x62')]('Extracted\x20folder\x20removed');}}catch(_0x515d29){logger['error'](_0x515d29);}}exports[_0x382a('0x27')]=function(_0x3ae84a,_0x5eb132,_0x54aa03){return db[_0x382a('0x32')][_0x382a('0x4a')]({'where':{'id':_0x3ae84a[_0x382a('0x4c')]['id']}})[_0x382a('0x28')](handleEntityNotFound(_0x5eb132,null))[_0x382a('0x28')](saveUpdates(_0x3ae84a[_0x382a('0x8a')],null))['then'](respondWithResult(_0x5eb132,null))[_0x382a('0x4b')](handleError(_0x5eb132,null));};exports['delete']=function(_0x45621e,_0x5ab402,_0x2b38c3){return db[_0x382a('0x32')]['find']({'where':{'id':_0x45621e[_0x382a('0x4c')]['id']}})[_0x382a('0x28')](function(_0xab6329){if(_0xab6329){return _0xab6329[_0x382a('0x29')]();}})[_0x382a('0x28')](function(_0x58611e){rimraf(path['join'](config[_0x382a('0x4f')],_0x382a('0x5b'),path[_0x382a('0x5c')](_0x58611e[_0x382a('0x4d')])),function(){});return _0x58611e;})[_0x382a('0x28')](handleEntityNotFound(_0x5ab402,null))['then'](respondWithStatusCode(_0x5ab402,null))[_0x382a('0x4b')](handleError(_0x5ab402,null));};exports['webhookGet']=function(_0x6e5d34,_0xe905f4,_0x5ef122){return BPromise[_0x382a('0x92')]()['then'](function(){if(!_0x6e5d34[_0x382a('0x37')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x6e5d34['query']['port']){throw new Error(_0x382a('0x93'));}var _0x5dd9d0=_0x6e5d34['query'][_0x382a('0x94')]?_0x6e5d34[_0x382a('0x37')][_0x382a('0x94')]+':'+_0x6e5d34['query'][_0x382a('0x95')]:'http://localhost:'+_0x6e5d34[_0x382a('0x37')][_0x382a('0x95')];var _0x51feaf=_0x6e5d34[_0x382a('0x37')][_0x382a('0x20')]?_0x6e5d34['query'][_0x382a('0x20')]:!![];var _0x581054=_0x6e5d34[_0x382a('0x37')][_0x382a('0x96')]?_0x6e5d34['query']['encoding']:null;var _0x3af13d={'method':_0x6e5d34[_0x382a('0x97')],'uri':util[_0x382a('0x98')](_0x382a('0x99'),_0x5dd9d0,_0x6e5d34[_0x382a('0x37')][_0x382a('0x4d')]),'json':_0x51feaf,'resolveWithFullResponse':!![],'encoding':_0x581054,'qs':_0x6e5d34['query']};if(_0x6e5d34['headers']){_0x3af13d[_0x382a('0x9a')]=_0x6e5d34[_0x382a('0x9a')];if(_0x3af13d[_0x382a('0x9a')][_0x382a('0x9b')]){delete _0x3af13d[_0x382a('0x9a')][_0x382a('0x9b')];}}if(_0x3af13d[_0x382a('0x9a')][_0x382a('0x9c')]){delete _0x3af13d[_0x382a('0x9a')][_0x382a('0x9c')];}return rp(_0x3af13d);})['then'](function(_0x152acc){if(_0x152acc){_0xe905f4[_0x382a('0x9d')](_0x152acc['headers']);logger[_0x382a('0x62')](_0x152acc[_0x382a('0x8a')]);if(_[_0x382a('0x9e')](_0x6e5d34[_0x382a('0x37')]['path'],_0x382a('0x9f'))&&_0x152acc[_0x382a('0xa0')]==0x1f4){return _0xe905f4[_0x382a('0x2d')](_0x152acc[_0x382a('0xa0')]);}else{return _0xe905f4[_0x382a('0x1f')](_0x152acc[_0x382a('0xa0')])['send'](_0x152acc['body']);}}else{return _0xe905f4[_0x382a('0x2d')](0xc8);}})[_0x382a('0x4b')](handleError(_0xe905f4,null));};exports[_0x382a('0xa1')]=function(_0x1cf0c9,_0x545cb2,_0x137cbd){return BPromise[_0x382a('0x92')]()[_0x382a('0x28')](function(){if(!_0x1cf0c9[_0x382a('0x37')][_0x382a('0x4d')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1cf0c9[_0x382a('0x37')]['port']){throw new Error(_0x382a('0x93'));}var _0x5e7ade=_0x1cf0c9[_0x382a('0x37')][_0x382a('0x94')]?_0x1cf0c9[_0x382a('0x37')][_0x382a('0x94')]+':'+_0x1cf0c9[_0x382a('0x37')]['port']:_0x382a('0xa2')+_0x1cf0c9[_0x382a('0x37')][_0x382a('0x95')];var _0xb3c3a7=_0x1cf0c9['query'][_0x382a('0x20')]?_0x1cf0c9[_0x382a('0x37')][_0x382a('0x20')]:!![];var _0x31b78f=_0x1cf0c9[_0x382a('0x37')][_0x382a('0x96')]?_0x1cf0c9[_0x382a('0x37')][_0x382a('0x96')]:null;var _0x5c5935={'method':_0x1cf0c9[_0x382a('0x97')],'uri':util['format'](_0x382a('0x99'),_0x5e7ade,_0x1cf0c9[_0x382a('0x37')][_0x382a('0x4d')]),'json':_0xb3c3a7,'resolveWithFullResponse':!![],'encoding':_0x31b78f,'body':_0x1cf0c9[_0x382a('0x8a')]};if(_0x1cf0c9[_0x382a('0x9a')]){_0x5c5935['headers']=_0x1cf0c9[_0x382a('0x9a')];if(_0x5c5935['headers'][_0x382a('0x9b')]){delete _0x5c5935[_0x382a('0x9a')]['content-length'];}}if(_0x5c5935[_0x382a('0x9a')][_0x382a('0x9c')]){delete _0x5c5935[_0x382a('0x9a')][_0x382a('0x9c')];}return rp(_0x5c5935);})[_0x382a('0x28')](function(_0x8597d1){if(_0x8597d1){_0x545cb2[_0x382a('0x9d')](_0x8597d1[_0x382a('0x9a')]);logger[_0x382a('0x62')](_0x8597d1[_0x382a('0x8a')]);return _0x545cb2['status'](_0x8597d1[_0x382a('0xa0')])[_0x382a('0x2f')](_0x8597d1[_0x382a('0x8a')]);}else{return _0x545cb2[_0x382a('0x2d')](0xc8);}})[_0x382a('0x4b')](handleError(_0x545cb2,null));}; \ No newline at end of file +var _0xa350=['filter','Plugin','include','findAll','rows','show','params','includeAll','catch','download','find','join','root','server/files/plugins','format','zip','warning','code','Error','Sequelize','pipe','**/*','dirname','basename','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','length','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','statusCode','webhookPost','method','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge'];(function(_0x28f83d,_0x2a52f1){var _0x3627de=function(_0x41ac1a){while(--_0x41ac1a){_0x28f83d['push'](_0x28f83d['shift']());}};_0x3627de(++_0x2a52f1);}(_0xa350,0x105));var _0x0a35=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xa350[_0x44bcb0];return _0xfaf881;};'use strict';var emlformat=require(_0x0a35('0x0'));var rimraf=require(_0x0a35('0x1'));var zipdir=require(_0x0a35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0a35('0x3'));var Mustache=require('mustache');var util=require(_0x0a35('0x4'));var path=require(_0x0a35('0x5'));var sox=require(_0x0a35('0x6'));var csv=require('to-csv');var ejs=require(_0x0a35('0x7'));var fs=require('fs');var fs_extra=require(_0x0a35('0x8'));var _=require('lodash');var squel=require(_0x0a35('0x9'));var crypto=require(_0x0a35('0xa'));var jsforce=require(_0x0a35('0xb'));var deskjs=require(_0x0a35('0xc'));var toCsv=require(_0x0a35('0xd'));var querystring=require(_0x0a35('0xe'));var Papa=require(_0x0a35('0xf'));var extract=require(_0x0a35('0x10'));var rimraf=require(_0x0a35('0x1'));var archiver=require(_0x0a35('0x11'));var Redis=require(_0x0a35('0x12'));var authService=require(_0x0a35('0x13'));var qs=require(_0x0a35('0x14'));var as=require(_0x0a35('0x15'));var hardwareService=require(_0x0a35('0x16'));var logger=require(_0x0a35('0x17'))(_0x0a35('0x18'));var utils=require('../../config/utils');var config=require(_0x0a35('0x19'));var licenseUtil=require(_0x0a35('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a35('0x1b')](config[_0x0a35('0x1c')],{'host':_0x0a35('0x1d'),'port':0x18eb});var socket=require(_0x0a35('0x1e'))(new Redis(config[_0x0a35('0x1c')]));require(_0x0a35('0x1f'))['register'](socket);function respondWithStatusCode(_0xa8e9aa,_0x23ff6e){_0x23ff6e=_0x23ff6e||0xcc;return function(_0x4ead5e){if(_0x4ead5e){return _0xa8e9aa[_0x0a35('0x20')](_0x23ff6e);}return _0xa8e9aa[_0x0a35('0x21')](_0x23ff6e)['end']();};}function respondWithResult(_0x342fb4,_0x539b15){_0x539b15=_0x539b15||0xc8;return function(_0x1bdc9e){if(_0x1bdc9e){return _0x342fb4[_0x0a35('0x21')](_0x539b15)[_0x0a35('0x22')](_0x1bdc9e);}};}function respondWithFilteredResult(_0x4a4ff2,_0x49ebca){return function(_0x1f7db8){if(_0x1f7db8){var _0x81be63=typeof _0x49ebca[_0x0a35('0x23')]===_0x0a35('0x24')&&typeof _0x49ebca[_0x0a35('0x25')]===_0x0a35('0x24');var _0x516e32=_0x1f7db8['count'];var _0x6087e4=_0x81be63?0x0:_0x49ebca['offset'];var _0x4d672a=_0x81be63?_0x1f7db8[_0x0a35('0x26')]:_0x49ebca[_0x0a35('0x23')]+_0x49ebca[_0x0a35('0x25')];var _0x2b8bb3;if(_0x4d672a>=_0x516e32){_0x4d672a=_0x516e32;_0x2b8bb3=0xc8;}else{_0x2b8bb3=0xce;}_0x4a4ff2[_0x0a35('0x21')](_0x2b8bb3);return _0x4a4ff2[_0x0a35('0x27')](_0x0a35('0x28'),_0x6087e4+'-'+_0x4d672a+'/'+_0x516e32)[_0x0a35('0x22')](_0x1f7db8);}return null;};}function patchUpdates(_0x559067){return function(_0x1af1a5){try{jsonpatch['apply'](_0x1af1a5,_0x559067,!![]);}catch(_0x7dad80){return BPromise['reject'](_0x7dad80);}return _0x1af1a5[_0x0a35('0x29')]();};}function saveUpdates(_0x21daec,_0x439da2){return function(_0x4dfb75){if(_0x4dfb75){return _0x4dfb75[_0x0a35('0x2a')](_0x21daec)[_0x0a35('0x2b')](function(_0x3f5ca7){return _0x3f5ca7;});}return null;};}function removeEntity(_0x530861,_0x2232dd){return function(_0x144243){if(_0x144243){return _0x144243[_0x0a35('0x2c')]()['then'](function(){var _0x3ccb90=_0x144243[_0x0a35('0x2d')]({'plain':!![]});var _0x1d1a2b='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x1d1a2b,'resourceId':_0x3ccb90['id']}})[_0x0a35('0x2b')](function(){return _0x144243;});})[_0x0a35('0x2b')](function(){_0x530861[_0x0a35('0x21')](0xcc)[_0x0a35('0x2e')]();});}};}function handleEntityNotFound(_0x57a679,_0x17e0f8){return function(_0x5dae1f){if(!_0x5dae1f){_0x57a679[_0x0a35('0x20')](0x194);}return _0x5dae1f;};}function handleError(_0x315f66,_0x751b6d){_0x751b6d=_0x751b6d||0x1f4;return function(_0x207bc7){logger[_0x0a35('0x2f')](_0x207bc7[_0x0a35('0x30')]);if(_0x207bc7[_0x0a35('0x31')]){delete _0x207bc7[_0x0a35('0x31')];}_0x315f66[_0x0a35('0x21')](_0x751b6d)[_0x0a35('0x32')](_0x207bc7);};}exports['index']=function(_0x1d9c3d,_0xf0dbbe){var _0x433725={},_0x410abe={},_0x4cfabb={'count':0x0,'rows':[]};var _0x47a5c8=_['map'](db['Plugin'][_0x0a35('0x33')],function(_0x21e2e2){return{'name':_0x21e2e2[_0x0a35('0x34')],'type':_0x21e2e2[_0x0a35('0x35')][_0x0a35('0x36')]};});_0x410abe[_0x0a35('0x37')]=_[_0x0a35('0x38')](_0x47a5c8,'name');_0x410abe[_0x0a35('0x39')]=_[_0x0a35('0x3a')](_0x1d9c3d['query']);_0x410abe[_0x0a35('0x3b')]=_[_0x0a35('0x3c')](_0x410abe[_0x0a35('0x37')],_0x410abe['query']);_0x433725[_0x0a35('0x3d')]=_[_0x0a35('0x3c')](_0x410abe[_0x0a35('0x37')],qs[_0x0a35('0x3e')](_0x1d9c3d[_0x0a35('0x39')][_0x0a35('0x3e')]));_0x433725['attributes']=_0x433725['attributes']['length']?_0x433725['attributes']:_0x410abe[_0x0a35('0x37')];if(!_0x1d9c3d[_0x0a35('0x39')]['hasOwnProperty'](_0x0a35('0x3f'))){_0x433725[_0x0a35('0x25')]=qs[_0x0a35('0x25')](_0x1d9c3d[_0x0a35('0x39')][_0x0a35('0x25')]);_0x433725[_0x0a35('0x23')]=qs[_0x0a35('0x23')](_0x1d9c3d[_0x0a35('0x39')][_0x0a35('0x23')]);}_0x433725[_0x0a35('0x40')]=qs['sort'](_0x1d9c3d['query'][_0x0a35('0x41')]);_0x433725[_0x0a35('0x42')]=qs[_0x0a35('0x3b')](_[_0x0a35('0x43')](_0x1d9c3d[_0x0a35('0x39')],_0x410abe[_0x0a35('0x3b')]),_0x47a5c8);if(_0x1d9c3d[_0x0a35('0x39')]['filter']){_0x433725[_0x0a35('0x42')]=_[_0x0a35('0x44')](_0x433725['where'],{'$or':_[_0x0a35('0x38')](_0x47a5c8,function(_0x4f12ce){if(_0x4f12ce[_0x0a35('0x35')]!=='VIRTUAL'){var _0x2270fb={};_0x2270fb[_0x4f12ce['name']]={'$like':'%'+_0x1d9c3d['query'][_0x0a35('0x45')]+'%'};return _0x2270fb;}})});}_0x433725=_[_0x0a35('0x44')]({},_0x433725,_0x1d9c3d['options']);var _0x5844d4={'where':_0x433725[_0x0a35('0x42')]};return db[_0x0a35('0x46')]['count'](_0x5844d4)['then'](function(_0x257522){_0x4cfabb[_0x0a35('0x26')]=_0x257522;if(_0x1d9c3d['query']['includeAll']){_0x433725[_0x0a35('0x47')]=[{'all':!![]}];}return db[_0x0a35('0x46')][_0x0a35('0x48')](_0x433725);})[_0x0a35('0x2b')](function(_0x3a9b1c){_0x4cfabb[_0x0a35('0x49')]=_0x3a9b1c;return _0x4cfabb;})[_0x0a35('0x2b')](respondWithFilteredResult(_0xf0dbbe,_0x433725))['catch'](handleError(_0xf0dbbe,null));};exports[_0x0a35('0x4a')]=function(_0x554c0e,_0x5b7e2e){var _0xa280cb={'raw':!![],'where':{'id':_0x554c0e[_0x0a35('0x4b')]['id']}},_0x4a78b7={};_0x4a78b7[_0x0a35('0x37')]=_[_0x0a35('0x3a')](db[_0x0a35('0x46')]['rawAttributes']);_0x4a78b7['query']=_[_0x0a35('0x3a')](_0x554c0e['query']);_0x4a78b7['filters']=_['intersection'](_0x4a78b7[_0x0a35('0x37')],_0x4a78b7[_0x0a35('0x39')]);_0xa280cb[_0x0a35('0x3d')]=_[_0x0a35('0x3c')](_0x4a78b7['model'],qs[_0x0a35('0x3e')](_0x554c0e['query'][_0x0a35('0x3e')]));_0xa280cb[_0x0a35('0x3d')]=_0xa280cb[_0x0a35('0x3d')]['length']?_0xa280cb[_0x0a35('0x3d')]:_0x4a78b7[_0x0a35('0x37')];if(_0x554c0e[_0x0a35('0x39')][_0x0a35('0x4c')]){_0xa280cb[_0x0a35('0x47')]=[{'all':!![]}];}_0xa280cb=_[_0x0a35('0x44')]({},_0xa280cb,_0x554c0e['options']);return db[_0x0a35('0x46')]['find'](_0xa280cb)[_0x0a35('0x2b')](handleEntityNotFound(_0x5b7e2e,null))[_0x0a35('0x2b')](respondWithResult(_0x5b7e2e,null))[_0x0a35('0x4d')](handleError(_0x5b7e2e,null));};exports[_0x0a35('0x4e')]=function(_0x2f7a2e,_0xc2148,_0x1923c0){return db[_0x0a35('0x46')][_0x0a35('0x4f')]({'where':{'id':_0x2f7a2e[_0x0a35('0x4b')]['id']},'attributes':[_0x0a35('0x31'),_0x0a35('0x5')],'raw':!![]})[_0x0a35('0x2b')](handleEntityNotFound(_0xc2148,null))[_0x0a35('0x2b')](function(_0x9c8951){if(_0x9c8951){var _0x44686a=path[_0x0a35('0x50')](config[_0x0a35('0x51')],_0x0a35('0x52'),util[_0x0a35('0x53')]('%s.zip',path['basename'](_0x9c8951['path'])));var _0x395466=fs['createWriteStream'](_0x44686a);var _0x51b759=archiver(_0x0a35('0x54'),{'zlib':{'level':0x9}});_0x51b759['on'](_0x0a35('0x55'),function(_0x5d2424){if(_0x5d2424[_0x0a35('0x56')]==='ENOENT'){logger[_0x0a35('0x2f')](_0x5d2424);}else{throw new db['Sequelize'][(_0x0a35('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x51b759['on']('error',function(_0x1ee918){throw new db[(_0x0a35('0x58'))][(_0x0a35('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x51b759[_0x0a35('0x59')](_0x395466);_0x51b759['glob'](_0x0a35('0x5a'),{'cwd':path[_0x0a35('0x50')](config[_0x0a35('0x51')],'server/files/plugins',path[_0x0a35('0x5b')](_0x9c8951[_0x0a35('0x5')])),'ignore':[path[_0x0a35('0x50')](path[_0x0a35('0x5c')](_0x9c8951[_0x0a35('0x5')]),_0x0a35('0x5d')),path[_0x0a35('0x50')](path['basename'](_0x9c8951['path']),_0x0a35('0x5e'))],'nodir':!![]})['finalize']();_0x395466['on'](_0x0a35('0x5f'),function(){if(!fs[_0x0a35('0x60')](_0x44686a)){throw new db[(_0x0a35('0x58'))][(_0x0a35('0x57'))](_0x0a35('0x61'));}return _0xc2148[_0x0a35('0x4e')](_0x44686a,util['format'](_0x0a35('0x62'),path[_0x0a35('0x5c')](_0x9c8951[_0x0a35('0x5')])),function(_0x3f1498){if(_0x3f1498){throw new db[(_0x0a35('0x58'))][(_0x0a35('0x57'))](_0x0a35('0x63'));}fs['unlinkSync'](_0x44686a);logger[_0x0a35('0x64')]('Download\x20completed');logger['info'](_0x0a35('0x65'));});});}return null;})['catch'](handleError(_0xc2148,null));};exports[_0x0a35('0x66')]=function(_0x32d73c,_0x5b8b5d,_0x997e37){var _0x1b68a1=path[_0x0a35('0x5c')](_0x32d73c[_0x0a35('0x67')][_0x0a35('0x68')],path['extname'](_0x32d73c[_0x0a35('0x67')]['filename']));var _0x15e2a8=path['join'](config[_0x0a35('0x51')],_0x0a35('0x52'),_0x32d73c[_0x0a35('0x67')]['filename']);var _0x10694a=path[_0x0a35('0x50')](config['root'],_0x0a35('0x52'),_0x1b68a1);logger[_0x0a35('0x64')](_0x0a35('0x69'),_0x15e2a8);logger[_0x0a35('0x64')](_0x0a35('0x6a'),_0x10694a);try{fs[_0x0a35('0x6b')](_0x15e2a8,parseInt(_0x0a35('0x6c'),0x8));extract(_0x15e2a8,{'dir':_0x10694a},function(_0x6f3664){if(_0x6f3664){logger[_0x0a35('0x2f')](_0x6f3664);handleError(_0x6f3664,!![]);};var _0x1d0ef2=fs['readdirSync'](_0x10694a);if(_0x1d0ef2[_0x0a35('0x6d')]>0x1){removeReferences(_0x15e2a8,_0x10694a);logger[_0x0a35('0x2f')](_0x0a35('0x6e'));return _0x997e37(new Error(_0x0a35('0x6e')));}var _0xeb0e29=fs[_0x0a35('0x6f')](path[_0x0a35('0x50')](_0x10694a,_0x1d0ef2[0x0]));if(_0xeb0e29['isFile']()){removeReferences(_0x15e2a8,_0x10694a);logger[_0x0a35('0x2f')](_0x0a35('0x6e'));return _0x997e37(new Error(_0x0a35('0x6e')));}if(_0xeb0e29[_0x0a35('0x70')]()){var _0x441338=fs[_0x0a35('0x71')](path[_0x0a35('0x50')](_0x10694a,_0x1d0ef2[0x0]));if(_0x441338['length']===0x0){removeReferences(_0x15e2a8,_0x10694a);logger['error'](_0x0a35('0x6e'));return _0x997e37(new Error(_0x0a35('0x6e')));}var _0x2069df=_0x441338['some'](function(_0x16e007){return _0x16e007===_0x0a35('0x72');});if(!_0x2069df){return _0x997e37(new Error(_0x0a35('0x73')));}var _0x595e23=fs[_0x0a35('0x74')](path[_0x0a35('0x50')](_0x10694a,_0x1d0ef2[0x0],_0x0a35('0x72')));var _0x41cb45=JSON[_0x0a35('0x75')](_0x595e23);if('undefined'==typeof _0x41cb45['name']){return _0x997e37(new Error(_0x0a35('0x76')));}if('undefined'==typeof _0x41cb45['type']){return _0x997e37(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x0a35('0x24')==typeof _0x41cb45['version']){return _0x997e37(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x0a35('0x24')==typeof _0x41cb45[_0x0a35('0x77')]){return _0x997e37(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x41cb45[_0x0a35('0x35')]===_0x0a35('0x78')){if(_0x0a35('0x24')==typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x79')]){return _0x997e37(new Error(_0x0a35('0x7a')));}if('undefined'==typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x79')][_0x0a35('0x7b')]&&_0x0a35('0x24')==typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x79')][_0x0a35('0x7c')]){return _0x997e37(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x41cb45['type']===_0x0a35('0x7d')){if(_0x0a35('0x24')==typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x7e')]){return _0x997e37(new Error(_0x0a35('0x7f')));}if(_0x0a35('0x24')==typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x80')]){return _0x997e37(new Error(_0x0a35('0x81')));}}else{return _0x997e37(new Error(_0x0a35('0x82')));}var _0x43932d=_0x41cb45[_0x0a35('0x31')];var _0x369e12=_0x41cb45['description'];var _0x232b0f=_0x41cb45[_0x0a35('0x35')];var _0x2ee923=_0x41cb45[_0x0a35('0x83')]?_0x41cb45['sidebar']:'always';var _0x5da859=_0x41cb45[_0x0a35('0x84')]?_0x41cb45[_0x0a35('0x84')]:_0x0a35('0x85');var _0x5b75d9='';var _0x3eba99='';var _0xfe018f='';var _0x6c2fbf='';var _0x24bf39=_0x41cb45[_0x0a35('0x86')];if(_0x232b0f==='html'){if('undefined'!=typeof _0x41cb45['parameters'][_0x0a35('0x79')][_0x0a35('0x7b')]){var _0x4d58f1=_0x41cb45['parameters']['views'][_0x0a35('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x0a35('0x87')](_0x4d58f1)){_0x5b75d9=path[_0x0a35('0x50')](_0x0a35('0x88'),_0x1b68a1,_0x1d0ef2[0x0],_0x4d58f1);}else{_0x5b75d9=_0x4d58f1;}}else{logger[_0x0a35('0x64')](_0x0a35('0x89'));}if(_0x0a35('0x24')!=typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x79')]['agent']){var _0x3eacdf=_0x41cb45[_0x0a35('0x77')][_0x0a35('0x79')][_0x0a35('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x0a35('0x87')](_0x3eacdf)){_0x3eba99=path['join']('plugins',_0x1b68a1,_0x1d0ef2[0x0],_0x3eacdf);}else{_0x3eba99=_0x3eacdf;}}else{logger[_0x0a35('0x64')](_0x0a35('0x8a'));}}else if(_0x232b0f===_0x0a35('0x7d')){_0xfe018f=_0x41cb45[_0x0a35('0x77')][_0x0a35('0x7e')];_0x6c2fbf=_0x41cb45[_0x0a35('0x77')]['scriptPath'];if(_0x0a35('0x24')!=typeof _0x41cb45[_0x0a35('0x77')]['views']){if(_0x0a35('0x24')!=typeof _0x41cb45['parameters'][_0x0a35('0x79')][_0x0a35('0x7b')]){var _0x4d58f1=_0x41cb45['parameters'][_0x0a35('0x79')][_0x0a35('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x0a35('0x87')](_0x4d58f1)){_0x5b75d9=path[_0x0a35('0x50')](_0x0a35('0x88'),_0x1b68a1,_0x1d0ef2[0x0],_0x4d58f1);}else{_0x5b75d9=_0x4d58f1;}}if('undefined'!=typeof _0x41cb45[_0x0a35('0x77')][_0x0a35('0x79')]['agent']){var _0x3eacdf=_0x41cb45['parameters'][_0x0a35('0x79')][_0x0a35('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3eacdf)){_0x3eba99=path[_0x0a35('0x50')]('plugins',_0x1b68a1,_0x1d0ef2[0x0],_0x3eacdf);}else{_0x3eba99=_0x3eacdf;}}}}var _0x119509={'name':_0x43932d,'description':_0x369e12,'path':path[_0x0a35('0x50')](_0x1b68a1,_0x1d0ef2[0x0]),'type':_0x232b0f,'sidebar':_0x2ee923,'icon':_0x5da859,'adminUrl':_0x5b75d9,'agentUrl':_0x3eba99,'scriptName':_0xfe018f,'scriptPath':_0x6c2fbf,'version':_0x24bf39};removeReferences(_0x15e2a8,null);return db[_0x0a35('0x46')]['create'](_0x119509)['then'](function(_0x2f0005){var _0xd36271={'role':_0x32d73c[_0x0a35('0x8b')][_0x0a35('0x8c')],'userProfileId':_0x32d73c[_0x0a35('0x8b')][_0x0a35('0x8d')]};if(!_0xd36271)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd36271[_0x0a35('0x8c')]===_0x0a35('0x8e')){var _0x14fcff=_0x2f0005['get']({'plain':!![]});return db[_0x0a35('0x8f')][_0x0a35('0x4f')]({'where':{'name':'Plugins','userProfileId':_0xd36271[_0x0a35('0x8d')]},'raw':!![]})[_0x0a35('0x2b')](function(_0x18ee84){if(_0x18ee84&&_0x18ee84[_0x0a35('0x90')]===0x0){return db['UserProfileResource'][_0x0a35('0x91')]({'name':_0x14fcff[_0x0a35('0x31')],'resourceId':_0x14fcff['id'],'type':_0x18ee84['name'],'sectionId':_0x18ee84['id']},{})['then'](function(){return _0x2f0005;});}else{return _0x2f0005;}})[_0x0a35('0x4d')](function(_0x280f08){logger[_0x0a35('0x2f')](_0x0a35('0x92'),_0x280f08);throw _0x280f08;});}return _0x2f0005;})[_0x0a35('0x2b')](respondWithResult(_0x5b8b5d,null))[_0x0a35('0x4d')](handleError(_0x5b8b5d,null));}});}catch(_0x1009c8){_0x5b8b5d[_0x0a35('0x21')](0x1f4)[_0x0a35('0x32')](_0x1009c8);}};function removeReferences(_0x97e71f,_0x460cd3){try{if(_0x97e71f){fs[_0x0a35('0x93')](_0x97e71f);logger[_0x0a35('0x64')]('Zip\x20archive\x20removed');}if(_0x460cd3){rimraf(_0x460cd3,function(){});logger['info'](_0x0a35('0x94'));}}catch(_0x1d61b5){logger[_0x0a35('0x2f')](_0x1d61b5);}}exports[_0x0a35('0x2a')]=function(_0x2878db,_0x12532e,_0x5a84f4){return db[_0x0a35('0x46')][_0x0a35('0x4f')]({'where':{'id':_0x2878db[_0x0a35('0x4b')]['id']}})[_0x0a35('0x2b')](handleEntityNotFound(_0x12532e,null))['then'](saveUpdates(_0x2878db['body'],null))[_0x0a35('0x2b')](respondWithResult(_0x12532e,null))[_0x0a35('0x4d')](handleError(_0x12532e,null));};exports[_0x0a35('0x95')]=function(_0x4dea11,_0x3abf87,_0x149a2d){return db[_0x0a35('0x46')][_0x0a35('0x4f')]({'where':{'id':_0x4dea11[_0x0a35('0x4b')]['id']}})[_0x0a35('0x2b')](function(_0x5cb25c){if(_0x5cb25c){return _0x5cb25c['destroy']();}})[_0x0a35('0x2b')](function(_0x2466f0){rimraf(path['join'](config['root'],_0x0a35('0x52'),path[_0x0a35('0x5b')](_0x2466f0[_0x0a35('0x5')])),function(){});return _0x2466f0;})['then'](handleEntityNotFound(_0x3abf87,null))['then'](respondWithStatusCode(_0x3abf87,null))['catch'](handleError(_0x3abf87,null));};exports[_0x0a35('0x96')]=function(_0x1f6c88,_0x275a33,_0x3c02ec){return BPromise[_0x0a35('0x97')]()[_0x0a35('0x2b')](function(){if(!_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x5')]){throw new Error(_0x0a35('0x98'));}if(!_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x99')]){throw new Error(_0x0a35('0x9a'));}var _0x42ceb0=_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x9b')]?_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x9b')]+':'+_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x99')]:_0x0a35('0x9c')+_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x99')];var _0x45b579=_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x22')]?_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x22')]:!![];var _0x1fa764=_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x9d')]?_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x9d')]:null;var _0x2eac7c={'method':_0x1f6c88['method'],'uri':util['format'](_0x0a35('0x9e'),_0x42ceb0,_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x5')]),'json':_0x45b579,'resolveWithFullResponse':!![],'encoding':_0x1fa764,'qs':_0x1f6c88['query']};if(_0x1f6c88['headers']){_0x2eac7c['headers']=_0x1f6c88[_0x0a35('0x9f')];if(_0x2eac7c['headers'][_0x0a35('0xa0')]){delete _0x2eac7c[_0x0a35('0x9f')]['content-length'];}}if(_0x2eac7c[_0x0a35('0x9f')][_0x0a35('0xa1')]){delete _0x2eac7c[_0x0a35('0x9f')][_0x0a35('0xa1')];}return rp(_0x2eac7c);})[_0x0a35('0x2b')](function(_0x1ee85a){if(_0x1ee85a){_0x275a33[_0x0a35('0x27')](_0x1ee85a[_0x0a35('0x9f')]);logger[_0x0a35('0x64')](_0x1ee85a[_0x0a35('0x8b')]);if(_['endsWith'](_0x1f6c88[_0x0a35('0x39')][_0x0a35('0x5')],_0x0a35('0x4e'))&&_0x1ee85a[_0x0a35('0xa2')]==0x1f4){return _0x275a33[_0x0a35('0x20')](_0x1ee85a[_0x0a35('0xa2')]);}else{return _0x275a33[_0x0a35('0x21')](_0x1ee85a[_0x0a35('0xa2')])[_0x0a35('0x32')](_0x1ee85a['body']);}}else{return _0x275a33[_0x0a35('0x20')](0xc8);}})[_0x0a35('0x4d')](handleError(_0x275a33,null));};exports[_0x0a35('0xa3')]=function(_0x4f5e1d,_0x38d32e,_0x5f371f){return BPromise[_0x0a35('0x97')]()['then'](function(){if(!_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x5')]){throw new Error(_0x0a35('0x98'));}if(!_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x99')]){throw new Error(_0x0a35('0x9a'));}var _0x468694=_0x4f5e1d['query'][_0x0a35('0x9b')]?_0x4f5e1d['query'][_0x0a35('0x9b')]+':'+_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x99')]:_0x0a35('0x9c')+_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x99')];var _0x191fa3=_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x22')]?_0x4f5e1d[_0x0a35('0x39')]['json']:!![];var _0x304fb8=_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x9d')]?_0x4f5e1d[_0x0a35('0x39')]['encoding']:null;var _0x42c9bf={'method':_0x4f5e1d[_0x0a35('0xa4')],'uri':util['format']('%s%s',_0x468694,_0x4f5e1d[_0x0a35('0x39')][_0x0a35('0x5')]),'json':_0x191fa3,'resolveWithFullResponse':!![],'encoding':_0x304fb8,'body':_0x4f5e1d['body']};if(_0x4f5e1d[_0x0a35('0x9f')]){_0x42c9bf[_0x0a35('0x9f')]=_0x4f5e1d[_0x0a35('0x9f')];if(_0x42c9bf[_0x0a35('0x9f')]['content-length']){delete _0x42c9bf['headers'][_0x0a35('0xa0')];}}if(_0x42c9bf['headers'][_0x0a35('0xa1')]){delete _0x42c9bf[_0x0a35('0x9f')]['content-type'];}return rp(_0x42c9bf);})[_0x0a35('0x2b')](function(_0x2f57d5){if(_0x2f57d5){_0x38d32e[_0x0a35('0x27')](_0x2f57d5[_0x0a35('0x9f')]);logger[_0x0a35('0x64')](_0x2f57d5[_0x0a35('0x8b')]);return _0x38d32e[_0x0a35('0x21')](_0x2f57d5[_0x0a35('0xa2')])['send'](_0x2f57d5[_0x0a35('0x8b')]);}else{return _0x38d32e[_0x0a35('0x20')](0xc8);}})[_0x0a35('0x4d')](handleError(_0x38d32e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1f06976..3f8e31d 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 _0x30bc=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin','save'];(function(_0x50bc00,_0x432907){var _0x5dacd9=function(_0x24b7b5){while(--_0x24b7b5){_0x50bc00['push'](_0x50bc00['shift']());}};_0x5dacd9(++_0x432907);}(_0x30bc,0x149));var _0xc30b=function(_0x587ac3,_0x2cf4be){_0x587ac3=_0x587ac3-0x0;var _0x4364f3=_0x30bc[_0x587ac3];return _0x4364f3;};'use strict';var EventEmitter=require(_0xc30b('0x0'));var Plugin=require(_0xc30b('0x1'))['db'][_0xc30b('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc30b('0x3'),'afterUpdate':_0xc30b('0x4'),'afterDestroy':_0xc30b('0x5')};function emitEvent(_0x357709){return function(_0x27c814,_0x2419e3,_0xa238d0){PluginEvents[_0xc30b('0x6')](_0x357709+':'+_0x27c814['id'],_0x27c814);PluginEvents[_0xc30b('0x6')](_0x357709,_0x27c814);_0xa238d0(null);};}for(var e in events){if(events[_0xc30b('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xc30b('0x8')]=PluginEvents; \ No newline at end of file +var _0xfc65=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x5f095a,_0x46da77){_0x5f095a=_0x5f095a-0x0;var _0x1d85fd=_0xfc65[_0x5f095a];return _0x1d85fd;};'use strict';var EventEmitter=require(_0x5fc6('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x5fc6('0x1')](0x0);var events={'afterCreate':_0x5fc6('0x2'),'afterUpdate':_0x5fc6('0x3'),'afterDestroy':_0x5fc6('0x4')};function emitEvent(_0x3c542a){return function(_0x34b758,_0x22a8ad,_0xcdd520){PluginEvents[_0x5fc6('0x5')](_0x3c542a+':'+_0x34b758['id'],_0x34b758);PluginEvents[_0x5fc6('0x5')](_0x3c542a,_0x34b758);_0xcdd520(null);};}for(var e in events){if(events[_0x5fc6('0x6')](e)){var event=events[e];Plugin[_0x5fc6('0x7')](e,emitEvent(event));}}module[_0x5fc6('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index ce717e3..de11bb7 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 _0x9dec=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./plugin.attributes','exports','define','Plugin','lodash'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9dec,0x1d3));var _0xc9de=function(_0xfccde7,_0x464911){_0xfccde7=_0xfccde7-0x0;var _0x5295a2=_0x9dec[_0xfccde7];return _0x5295a2;};'use strict';var _=require(_0xc9de('0x0'));var util=require('util');var logger=require(_0xc9de('0x1'))(_0xc9de('0x2'));var moment=require(_0xc9de('0x3'));var BPromise=require(_0xc9de('0x4'));var rp=require(_0xc9de('0x5'));var fs=require('fs');var path=require(_0xc9de('0x6'));var rimraf=require(_0xc9de('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9de('0x8'));module[_0xc9de('0x9')]=function(_0x193ae3,_0x40148e){return _0x193ae3[_0xc9de('0xa')](_0xc9de('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd089=['bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','Plugin','util','../../config/logger','api','moment'];(function(_0xfc0d38,_0xf199d){var _0x5f604=function(_0xe9d3e2){while(--_0xe9d3e2){_0xfc0d38['push'](_0xfc0d38['shift']());}};_0x5f604(++_0xf199d);}(_0xd089,0x167));var _0x9d08=function(_0x315ae4,_0x459eb0){_0x315ae4=_0x315ae4-0x0;var _0x889488=_0xd089[_0x315ae4];return _0x889488;};'use strict';var _=require('lodash');var util=require(_0x9d08('0x0'));var logger=require(_0x9d08('0x1'))(_0x9d08('0x2'));var moment=require(_0x9d08('0x3'));var BPromise=require(_0x9d08('0x4'));var rp=require(_0x9d08('0x5'));var fs=require('fs');var path=require(_0x9d08('0x6'));var rimraf=require(_0x9d08('0x7'));var config=require(_0x9d08('0x8'));var attributes=require(_0x9d08('0x9'));module['exports']=function(_0xcce2ce,_0x57c5e5){return _0xcce2ce['define'](_0x9d08('0xa'),attributes,{'tableName':'plugins','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 8cc0a8c..47bb1c1 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 _0x9529=['create','body','options','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin'];(function(_0x341e35,_0x5b5a8b){var _0x2b308c=function(_0x1b7055){while(--_0x1b7055){_0x341e35['push'](_0x341e35['shift']());}};_0x2b308c(++_0x5b5a8b);}(_0x9529,0x1f1));var _0x9952=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9529[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9952('0x0'));var util=require(_0x9952('0x1'));var moment=require('moment');var BPromise=require(_0x9952('0x2'));var rs=require(_0x9952('0x3'));var fs=require('fs');var Redis=require(_0x9952('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9952('0x5'));var logger=require('../../config/logger')(_0x9952('0x6'));var config=require(_0x9952('0x7'));var jayson=require(_0x9952('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x9952('0x9')]=_['defaults'](config[_0x9952('0x9')],{'host':_0x9952('0xa'),'port':0x18eb});var socket=require(_0x9952('0xb'))(new Redis(config[_0x9952('0x9')]));require('./plugin.socket')[_0x9952('0xc')](socket);function respondWithRpcPromise(_0x54a8bc,_0x241970,_0x5ebedb){return new BPromise(function(_0xf2115,_0x5809d0){return client['request'](_0x54a8bc,_0x5ebedb)[_0x9952('0xd')](function(_0x4df278){logger[_0x9952('0xe')](_0x9952('0xf'),_0x241970,_0x9952('0x10'));logger['debug'](_0x9952('0x11'),_0x241970,_0x9952('0x10'),JSON['stringify'](_0x4df278));if(_0x4df278[_0x9952('0x12')]){if(_0x4df278[_0x9952('0x12')][_0x9952('0x13')]===0x1f4){logger['error'](_0x9952('0xf'),_0x241970,_0x4df278[_0x9952('0x12')]['message']);return _0x5809d0(_0x4df278[_0x9952('0x12')][_0x9952('0x14')]);}logger[_0x9952('0x12')](_0x9952('0xf'),_0x241970,_0x4df278[_0x9952('0x12')][_0x9952('0x14')]);return _0xf2115(_0x4df278['error'][_0x9952('0x14')]);}else{logger[_0x9952('0xe')]('Plugin,\x20%s,\x20%s',_0x241970,_0x9952('0x10'));_0xf2115(_0x4df278[_0x9952('0x15')][_0x9952('0x14')]);}})[_0x9952('0x16')](function(_0x5b89a7){logger[_0x9952('0x12')](_0x9952('0xf'),_0x241970,_0x5b89a7);_0x5809d0(_0x5b89a7);});});}exports[_0x9952('0x17')]=function(_0xcd321f){var _0xc7d594=this;return new Promise(function(_0x5802fa,_0xa68fa5){return db[_0x9952('0x18')][_0x9952('0x19')](_0xcd321f[_0x9952('0x1a')],{'raw':_0xcd321f[_0x9952('0x1b')]?_0xcd321f[_0x9952('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x9952('0xd')](function(_0x14d4ac){logger['info']('CreatePlugin',_0xcd321f);logger[_0x9952('0x1c')](_0x9952('0x17'),_0xcd321f,JSON['stringify'](_0x14d4ac));_0x5802fa(_0x14d4ac);})[_0x9952('0x16')](function(_0x9aa9bd){logger[_0x9952('0x12')](_0x9952('0x17'),_0x9aa9bd[_0x9952('0x14')],_0xcd321f);_0xa68fa5(_0xc7d594['error'](0x1f4,_0x9aa9bd[_0x9952('0x14')]));});});}; \ No newline at end of file +var _0x3906=['Plugin,\x20%s,\x20%s,\x20%s','error','code','message','Plugin','create','body','options','raw','CreatePlugin','stringify','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x3906,0x69));var _0x6390=function(_0x2d6e8a,_0x2b51b0){_0x2d6e8a=_0x2d6e8a-0x0;var _0x4ee588=_0x3906[_0x2d6e8a];return _0x4ee588;};'use strict';var _=require('lodash');var util=require(_0x6390('0x0'));var moment=require(_0x6390('0x1'));var BPromise=require(_0x6390('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6390('0x3'));var db=require(_0x6390('0x4'))['db'];var utils=require(_0x6390('0x5'));var logger=require('../../config/logger')(_0x6390('0x6'));var config=require(_0x6390('0x7'));var jayson=require(_0x6390('0x8'));var client=jayson[_0x6390('0x9')]['http']({'port':0x232a});config[_0x6390('0xa')]=_[_0x6390('0xb')](config[_0x6390('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6390('0xa')]));require('./plugin.socket')[_0x6390('0xc')](socket);function respondWithRpcPromise(_0x49c7a2,_0x3d744b,_0x5b0c09){return new BPromise(function(_0x2a4ca1,_0x18e77c){return client[_0x6390('0xd')](_0x49c7a2,_0x5b0c09)[_0x6390('0xe')](function(_0xbfa85a){logger[_0x6390('0xf')](_0x6390('0x10'),_0x3d744b,_0x6390('0x11'));logger[_0x6390('0x12')](_0x6390('0x13'),_0x3d744b,_0x6390('0x11'),JSON['stringify'](_0xbfa85a));if(_0xbfa85a['error']){if(_0xbfa85a[_0x6390('0x14')][_0x6390('0x15')]===0x1f4){logger['error'](_0x6390('0x10'),_0x3d744b,_0xbfa85a['error'][_0x6390('0x16')]);return _0x18e77c(_0xbfa85a[_0x6390('0x14')]['message']);}logger[_0x6390('0x14')](_0x6390('0x10'),_0x3d744b,_0xbfa85a[_0x6390('0x14')][_0x6390('0x16')]);return _0x2a4ca1(_0xbfa85a[_0x6390('0x14')][_0x6390('0x16')]);}else{logger['info'](_0x6390('0x10'),_0x3d744b,_0x6390('0x11'));_0x2a4ca1(_0xbfa85a['result'][_0x6390('0x16')]);}})['catch'](function(_0x263f5b){logger[_0x6390('0x14')]('Plugin,\x20%s,\x20%s',_0x3d744b,_0x263f5b);_0x18e77c(_0x263f5b);});});}exports['CreatePlugin']=function(_0x137943){var _0x6ae8ac=this;return new Promise(function(_0x34682e,_0x1cd948){return db[_0x6390('0x17')][_0x6390('0x18')](_0x137943[_0x6390('0x19')],{'raw':_0x137943['options']?_0x137943[_0x6390('0x1a')][_0x6390('0x1b')]===undefined?!![]:![]:!![]})[_0x6390('0xe')](function(_0x2125a9){logger['info'](_0x6390('0x1c'),_0x137943);logger[_0x6390('0x12')](_0x6390('0x1c'),_0x137943,JSON[_0x6390('0x1d')](_0x2125a9));_0x34682e(_0x2125a9);})[_0x6390('0x1e')](function(_0xc5b2aa){logger[_0x6390('0x14')](_0x6390('0x1c'),_0xc5b2aa[_0x6390('0x16')],_0x137943);_0x1cd948(_0x6ae8ac[_0x6390('0x14')](0x1f4,_0xc5b2aa[_0x6390('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 84dc80b..9b542ca 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 _0x1c5e=['removeListener','register','length','plugin:','./plugin.events','remove','emit'];(function(_0x1ad328,_0x1ea631){var _0x345ec1=function(_0x34feb5){while(--_0x34feb5){_0x1ad328['push'](_0x1ad328['shift']());}};_0x345ec1(++_0x1ea631);}(_0x1c5e,0x1bd));var _0xe1c5=function(_0x44a329,_0x45f280){_0x44a329=_0x44a329-0x0;var _0x45f2a3=_0x1c5e[_0x44a329];return _0x45f2a3;};'use strict';var PluginEvents=require(_0xe1c5('0x0'));var events=['save',_0xe1c5('0x1'),'update'];function createListener(_0x5996e9,_0x58e1d3){return function(_0x29a933){_0x58e1d3[_0xe1c5('0x2')](_0x5996e9,_0x29a933);};}function removeListener(_0x3d04ec,_0x4a8b53){return function(){PluginEvents[_0xe1c5('0x3')](_0x3d04ec,_0x4a8b53);};}exports[_0xe1c5('0x4')]=function(_0x3bcd9){for(var _0x5eb38a=0x0,_0x5099b2=events[_0xe1c5('0x5')];_0x5eb38a<_0x5099b2;_0x5eb38a++){var _0x84a865=events[_0x5eb38a];var _0x401239=createListener(_0xe1c5('0x6')+_0x84a865,_0x3bcd9);PluginEvents['on'](_0x84a865,_0x401239);}}; \ No newline at end of file +var _0x2a8a=['update','removeListener','length','plugin:','./plugin.events','remove'];(function(_0x1d69ce,_0x42a6c7){var _0x3284d7=function(_0x316688){while(--_0x316688){_0x1d69ce['push'](_0x1d69ce['shift']());}};_0x3284d7(++_0x42a6c7);}(_0x2a8a,0xf4));var _0xa2a8=function(_0x19689a,_0xbce5c6){_0x19689a=_0x19689a-0x0;var _0x2cebd3=_0x2a8a[_0x19689a];return _0x2cebd3;};'use strict';var PluginEvents=require(_0xa2a8('0x0'));var events=['save',_0xa2a8('0x1'),_0xa2a8('0x2')];function createListener(_0xe7717,_0x5363ee){return function(_0x281834){_0x5363ee['emit'](_0xe7717,_0x281834);};}function removeListener(_0x4a5980,_0x39224f){return function(){PluginEvents[_0xa2a8('0x3')](_0x4a5980,_0x39224f);};}exports['register']=function(_0x13e461){for(var _0x1dac84=0x0,_0x15af97=events[_0xa2a8('0x4')];_0x1dac84<_0x15af97;_0x1dac84++){var _0x3ab888=events[_0x1dac84];var _0x4ebbeb=createListener(_0xa2a8('0x5')+_0x3ab888,_0x13e461);PluginEvents['on'](_0x3ab888,_0x4ebbeb);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 5a74f5b..782769d 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(_0x48d1ff,_0x244979){var _0x54cd32=function(_0x1fd5d5){while(--_0x1fd5d5){_0x48d1ff['push'](_0x48d1ff['shift']());}};_0x54cd32(++_0x244979);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x1e31e0,_0x41444b){var _0x63bdc0=function(_0x12ff0d){while(--_0x12ff0d){_0x1e31e0['push'](_0x1e31e0['shift']());}};_0x63bdc0(++_0x41444b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 675b11f..c2844b7 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 _0xe706=['dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','express','motion2','then','catch','params','create','body','script','join','../../files/plugins','cwd'];(function(_0x58d7de,_0x4798b5){var _0x1f94c8=function(_0x59e888){while(--_0x59e888){_0x58d7de['push'](_0x58d7de['shift']());}};_0x1f94c8(++_0x4798b5);}(_0xe706,0xa3));var _0x6e70=function(_0x2d120a,_0x5e4d33){_0x2d120a=_0x2d120a-0x0;var _0x205747=_0xe706[_0x2d120a];return _0x205747;};'use strict';var _=require(_0x6e70('0x0'));var pm2=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var path=require(_0x6e70('0x3'));var exec=require(_0x6e70('0x4'))[_0x6e70('0x5')];var BPromise=require(_0x6e70('0x6'));function handleEntityNotFound(_0x142c27,_0x2164a4){return function(_0x376a8d){if(!_0x376a8d){_0x142c27[_0x6e70('0x7')](0x194);;}return _0x376a8d;};}function respondWithResult(_0x1b0389,_0x4381d1){_0x4381d1=_0x4381d1||0xc8;return function(_0x36357b){if(_0x36357b){return _0x1b0389[_0x6e70('0x8')](_0x4381d1)[_0x6e70('0x9')](_0x36357b);}return null;};}function handleError(_0x188ed3,_0x3c4843){_0x3c4843=_0x3c4843||0x1f4;return function(_0x449b48){logger[_0x6e70('0xa')](_0x449b48[_0x6e70('0xb')]);if(_0x449b48[_0x6e70('0xc')]){delete _0x449b48[_0x6e70('0xc')];}_0x188ed3[_0x6e70('0x8')](_0x3c4843)[_0x6e70('0xd')](_0x449b48);};}function execChildProcess(){return new BPromise(function(_0x37b3e0,_0x4600f9){exec('npm\x20install',function(_0x47f6b2,_0x3594c1,_0x15a1a5){logger[_0x6e70('0xe')](_0x3594c1);logger[_0x6e70('0xe')](_0x15a1a5);if(_0x47f6b2){logger[_0x6e70('0xa')](_0x47f6b2);return _0x4600f9(_0x47f6b2);}return _0x37b3e0(_0x3594c1);});});}exports[_0x6e70('0xf')]=function(_0xa1eb74,_0x181005){return pm2['list']()['then'](function(_0x48bc72){if(_0x48bc72){var _0x257e81=_['reject'](_0x48bc72,function(_0x53aed0){return _0x53aed0[_0x6e70('0xc')]===_0x6e70('0x10')||_0x53aed0['name']===_0x6e70('0x11');});return{'rows':_0x257e81,'count':_0x257e81['length']};}return null;})[_0x6e70('0x12')](respondWithResult(_0x181005,null))[_0x6e70('0x13')](handleError(_0x181005,null));};exports['show']=function(_0x49029f,_0x3bd572){return pm2['describe'](_0x49029f[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](respondWithResult(_0x3bd572,null))['then'](handleEntityNotFound(_0x3bd572,null))['catch'](handleError(_0x3bd572,null));};exports[_0x6e70('0x15')]=function(_0x208e21,_0x2368eb){if(_0x208e21[_0x6e70('0x16')][_0x6e70('0xc')]&&_0x208e21[_0x6e70('0x16')][_0x6e70('0x17')]){var _0x44a49f=path[_0x6e70('0x18')](__dirname,_0x6e70('0x19'),_0x208e21['body'][_0x6e70('0x17')]);var _0x344b65=process[_0x6e70('0x1a')]();process['chdir'](path[_0x6e70('0x1b')](_0x44a49f));return execChildProcess()[_0x6e70('0x12')](function(_0x3337a6){process['chdir'](_0x344b65);return pm2[_0x6e70('0x1c')]({'name':_0x208e21['body']['name'],'script':_0x44a49f});})['then'](function(_0x41e352){pm2[_0x6e70('0x1d')]();return _0x41e352[0x0];})['then'](respondWithResult(_0x2368eb,0xc9))[_0x6e70('0x13')](handleError(_0x2368eb,null));}else{return _0x2368eb[_0x6e70('0x8')](0x1f4)['send']({'message':_0x6e70('0x1e')});}};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){if(_0x2bb231['body']['id']){delete _0x2bb231[_0x6e70('0x16')]['id'];}var _0x3af17f={'online':_0x6e70('0x20'),'stopped':_0x6e70('0x21')};if(_0x3af17f[_0x6e70('0x22')](_0x2bb231['body'][_0x6e70('0x8')])){return pm2[_0x3af17f[_0x2bb231[_0x6e70('0x16')][_0x6e70('0x8')]]](_0x2bb231[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](respondWithResult(_0x4a67ac,0xc8))[_0x6e70('0x13')](handleError(_0x4a67ac,null));}else{return _0x4a67ac[_0x6e70('0x8')](0x1f4)[_0x6e70('0xd')]({'message':_0x6e70('0x23')});}};exports[_0x6e70('0x24')]=function(_0x4b1229,_0x1b27d8){if(_0x4b1229['body']['id']){delete _0x4b1229[_0x6e70('0x16')]['id'];}if(_0x4b1229['params']['id']){return pm2[_0x6e70('0x25')](_0x4b1229[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](function(_0x56f6f7){pm2[_0x6e70('0x1d')]();return _0x56f6f7[0x0];})[_0x6e70('0x12')](respondWithResult(_0x1b27d8,null))['catch'](handleError(_0x1b27d8,null));}else{return _0x1b27d8[_0x6e70('0x8')](0x1f4)[_0x6e70('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x44a3=['hasOwnProperty','params','Unknown\x20status','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','send','info','index','list','then','reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop'];(function(_0x168cde,_0x52cb36){var _0x16615b=function(_0x106a36){while(--_0x106a36){_0x168cde['push'](_0x168cde['shift']());}};_0x16615b(++_0x52cb36);}(_0x44a3,0x1a9));var _0x344a=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x44a3[_0x235f49];return _0x551139;};'use strict';var _=require(_0x344a('0x0'));var pm2=require(_0x344a('0x1'));var logger=require(_0x344a('0x2'))(_0x344a('0x3'));var path=require(_0x344a('0x4'));var exec=require(_0x344a('0x5'))[_0x344a('0x6')];var BPromise=require(_0x344a('0x7'));function handleEntityNotFound(_0x528a13,_0x23004c){return function(_0x1bc716){if(!_0x1bc716){_0x528a13[_0x344a('0x8')](0x194);;}return _0x1bc716;};}function respondWithResult(_0x28b51e,_0x39984a){_0x39984a=_0x39984a||0xc8;return function(_0x504bd1){if(_0x504bd1){return _0x28b51e['status'](_0x39984a)['json'](_0x504bd1);}return null;};}function handleError(_0x484661,_0x475dab){_0x475dab=_0x475dab||0x1f4;return function(_0x2f9486){logger[_0x344a('0x9')](_0x2f9486[_0x344a('0xa')]);if(_0x2f9486[_0x344a('0xb')]){delete _0x2f9486['name'];}_0x484661[_0x344a('0xc')](_0x475dab)[_0x344a('0xd')](_0x2f9486);};}function execChildProcess(){return new BPromise(function(_0x559406,_0x2734ec){exec('npm\x20install',function(_0x397476,_0x5e6c98,_0xd53a4f){logger[_0x344a('0xe')](_0x5e6c98);logger['info'](_0xd53a4f);if(_0x397476){logger['error'](_0x397476);return _0x2734ec(_0x397476);}return _0x559406(_0x5e6c98);});});}exports[_0x344a('0xf')]=function(_0x2ad7eb,_0x3a974e){return pm2[_0x344a('0x10')]()[_0x344a('0x11')](function(_0x133ad4){if(_0x133ad4){var _0x4ee562=_[_0x344a('0x12')](_0x133ad4,function(_0x2360e9){return _0x2360e9[_0x344a('0xb')]===_0x344a('0x13')||_0x2360e9['name']==='motion2';});return{'rows':_0x4ee562,'count':_0x4ee562[_0x344a('0x14')]};}return null;})[_0x344a('0x11')](respondWithResult(_0x3a974e,null))[_0x344a('0x15')](handleError(_0x3a974e,null));};exports[_0x344a('0x16')]=function(_0x48b3ab,_0x397de6){return pm2[_0x344a('0x17')](_0x48b3ab['params']['id'])[_0x344a('0x11')](respondWithResult(_0x397de6,null))[_0x344a('0x11')](handleEntityNotFound(_0x397de6,null))[_0x344a('0x15')](handleError(_0x397de6,null));};exports[_0x344a('0x18')]=function(_0x13b382,_0x43fa0f){if(_0x13b382[_0x344a('0x19')][_0x344a('0xb')]&&_0x13b382[_0x344a('0x19')][_0x344a('0x1a')]){var _0x4b3552=path[_0x344a('0x1b')](__dirname,_0x344a('0x1c'),_0x13b382[_0x344a('0x19')][_0x344a('0x1a')]);var _0x240be3=process[_0x344a('0x1d')]();process[_0x344a('0x1e')](path[_0x344a('0x1f')](_0x4b3552));return execChildProcess()[_0x344a('0x11')](function(_0x27f527){process[_0x344a('0x1e')](_0x240be3);return pm2[_0x344a('0x20')]({'name':_0x13b382[_0x344a('0x19')][_0x344a('0xb')],'script':_0x4b3552});})['then'](function(_0x6ccfba){pm2['dump']();return _0x6ccfba[0x0];})[_0x344a('0x11')](respondWithResult(_0x43fa0f,0xc9))['catch'](handleError(_0x43fa0f,null));}else{return _0x43fa0f[_0x344a('0xc')](0x1f4)[_0x344a('0xd')]({'message':_0x344a('0x21')});}};exports[_0x344a('0x22')]=function(_0x26f059,_0x28749b){if(_0x26f059[_0x344a('0x19')]['id']){delete _0x26f059[_0x344a('0x19')]['id'];}var _0x4f2499={'online':_0x344a('0x23'),'stopped':_0x344a('0x24')};if(_0x4f2499[_0x344a('0x25')](_0x26f059[_0x344a('0x19')][_0x344a('0xc')])){return pm2[_0x4f2499[_0x26f059[_0x344a('0x19')]['status']]](_0x26f059[_0x344a('0x26')]['id'])['then'](respondWithResult(_0x28749b,0xc8))['catch'](handleError(_0x28749b,null));}else{return _0x28749b[_0x344a('0xc')](0x1f4)[_0x344a('0xd')]({'message':_0x344a('0x27')});}};exports['destroy']=function(_0x5cd9c6,_0x5cafd2){if(_0x5cd9c6[_0x344a('0x19')]['id']){delete _0x5cd9c6[_0x344a('0x19')]['id'];}if(_0x5cd9c6[_0x344a('0x26')]['id']){return pm2['delete'](_0x5cd9c6[_0x344a('0x26')]['id'])[_0x344a('0x11')](function(_0x71f3ec){pm2[_0x344a('0x28')]();return _0x71f3ec[0x0];})[_0x344a('0x11')](respondWithResult(_0x5cafd2,null))[_0x344a('0x15')](handleError(_0x5cafd2,null));}else{return _0x5cafd2[_0x344a('0xc')](0x1f4)['send']({'message':_0x344a('0x29')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 760efa8..a2bc439 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 _0x66bb=['Router','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x395661,_0x4164d8){var _0x1a8c7b=function(_0x27ac60){while(--_0x27ac60){_0x395661['push'](_0x395661['shift']());}};_0x1a8c7b(++_0x4164d8);}(_0x66bb,0x1a6));var _0xb66b=function(_0x46ca3d,_0x360bad){_0x46ca3d=_0x46ca3d-0x0;var _0x3c195e=_0x66bb[_0x46ca3d];return _0x3c195e;};'use strict';var express=require(_0xb66b('0x0'));var router=express[_0xb66b('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xb66b('0x2'));router[_0xb66b('0x3')](_0xb66b('0x4'),auth[_0xb66b('0x5')](),controller[_0xb66b('0x6')]);router[_0xb66b('0x3')](_0xb66b('0x7'),auth[_0xb66b('0x5')](),controller['getQueues']);module[_0xb66b('0x8')]=router; \ No newline at end of file +var _0x6eb7=['Router','./realtime.controller','get','isAuthenticated','getAgents','/queues','getQueues','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6eb7,0x1b8));var _0x76eb=function(_0x38e96c,_0xd8a5d7){_0x38e96c=_0x38e96c-0x0;var _0x24d030=_0x6eb7[_0x38e96c];return _0x24d030;};'use strict';var express=require('express');var router=express[_0x76eb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x76eb('0x1'));router[_0x76eb('0x2')]('/agents',auth[_0x76eb('0x3')](),controller[_0x76eb('0x4')]);router[_0x76eb('0x2')](_0x76eb('0x5'),auth[_0x76eb('0x3')](),controller[_0x76eb('0x6')]);module[_0x76eb('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b8eb700..4f23487 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 _0x4124=['agent','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','chat','sms','openchannel','fax','channel','toLowerCase','Queue','key','QueueCampaigns','Queues','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','limit','undefined','count','set','json','name','status','send','Agents','then','error','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','find','merge','pick','length','busy','some','connectedlinenum','internal','toString','getMembers','accountcode','online','User','findAll','QueueId','UserId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','filter','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','getAgents','userpic','lastLoginAt','pauseType','lastPauseAt','address','openchannelPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','routealias','resolve','map','rawAttributes','fieldName','type','query','role','getOptions','raw','user'];(function(_0x28315b,_0x3072c1){var _0x457d71=function(_0x4b8aaa){while(--_0x4b8aaa){_0x28315b['push'](_0x28315b['shift']());}};_0x457d71(++_0x3072c1);}(_0x4124,0x140));var _0x4412=function(_0x3ebfc7,_0x183b2a){_0x3ebfc7=_0x3ebfc7-0x0;var _0x90d54f=_0x4124[_0x3ebfc7];return _0x90d54f;};'use strict';var util=require(_0x4412('0x0'));var _=require(_0x4412('0x1'));var jayson=require(_0x4412('0x2'));var qs=require(_0x4412('0x3'));var logger=require(_0x4412('0x4'))(_0x4412('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x4412('0x6')][_0x4412('0x7')]({'port':0x232a});var routingClient=jayson[_0x4412('0x6')][_0x4412('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x49759c,_0xab7a0a){return function(_0x5b45e3){if(_0x5b45e3){var _0x244a36=typeof _0xab7a0a[_0x4412('0x8')]==='undefined'&&typeof _0xab7a0a[_0x4412('0x9')]===_0x4412('0xa');var _0x302b1=_0x5b45e3[_0x4412('0xb')];var _0x4419f9=_0x244a36?0x0:_0xab7a0a[_0x4412('0x8')];var _0x3eef47=_0x244a36?_0x5b45e3[_0x4412('0xb')]:_0xab7a0a[_0x4412('0x8')]+_0xab7a0a[_0x4412('0x9')];var _0x1270ae;if(_0x3eef47>=_0x302b1){_0x3eef47=_0x302b1;_0x1270ae=0xc8;}else{_0x1270ae=0xce;}_0x49759c['status'](_0x1270ae);return _0x49759c[_0x4412('0xc')]('Content-Range',_0x4419f9+'-'+_0x3eef47+'/'+_0x302b1)[_0x4412('0xd')](_0x5b45e3);}return null;};}function handleError(_0x19a87b,_0x3aede3){_0x3aede3=_0x3aede3||0x1f4;return function(_0x24ad1c){logger['error'](_0x24ad1c['stack']);if(_0x24ad1c['name']){delete _0x24ad1c[_0x4412('0xe')];}_0x19a87b[_0x4412('0xf')](_0x3aede3)[_0x4412('0x10')](_0x24ad1c);};}function getRealtimeAgents(){return new Promise(function(_0x4488d0,_0x34f94e){return amiClient['request'](_0x4412('0x11'),{})[_0x4412('0x12')](function(_0x333049){if(_0x333049[_0x4412('0x13')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x57d213=_0x333049[_0x4412('0x14')];return routingClient[_0x4412('0x15')](_0x4412('0x11'),{})[_0x4412('0x12')](function(_0x66f8d7){if(_0x66f8d7[_0x4412('0x13')])throw new Error(_0x4412('0x16'));var _0x4530a2=_0x66f8d7['result'];return _0x4488d0(_['merge']({},_0x57d213,_0x4530a2));});})[_0x4412('0x17')](function(_0x3de20e){_0x34f94e(_0x3de20e);});});}function getRealtimeQueues(_0x1ad980,_0x5ed9f9){return new Promise(function(_0x48e29a,_0x3e4049){var _0x55ef30=_0x5ed9f9===_0x4412('0x18')?amiClient:routingClient;return _0x55ef30[_0x4412('0x15')](_[_0x4412('0x19')](_0x5ed9f9)+'Queues',_0x1ad980)[_0x4412('0x12')](function(_0x207742){if(_0x207742['error'])throw new Error(util[_0x4412('0x1a')](_0x4412('0x1b'),_0x5ed9f9));return _0x48e29a(_0x207742[_0x4412('0x14')]);})[_0x4412('0x17')](function(_0x126b71){_0x3e4049(_0x126b71);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3846e2,_0x181b65){return amiClient[_0x4412('0x15')]('VoiceQueuesChannels',{})[_0x4412('0x12')](function(_0x4f70eb){if(_0x4f70eb[_0x4412('0x13')])throw new Error(_0x4412('0x1c'));return _0x3846e2(_0x4f70eb[_0x4412('0x14')]);})[_0x4412('0x17')](function(_0x208d69){_0x181b65(_0x208d69);});});}function initializeQueues(_0x53cd33,_0x13afb1,_0x421589,_0x1a216e){var _0x115360=[_0x4412('0x1d'),_0x4412('0x1e'),_0x4412('0x1f'),_0x4412('0x20'),_0x4412('0x21')];if(_0x421589===_0x4412('0x18')&&_0x1a216e===_0x4412('0x22')){_0x115360[_0x4412('0x23')](_0x4412('0x24'),_0x4412('0x25'),_0x4412('0x26'),'dialActive','dialMethod',_0x4412('0x27'),_0x4412('0x28'),_0x4412('0x29'),'erlangCalls',_0x4412('0x2a'),'erlangAbandonmentRate',_0x4412('0x2b'),_0x4412('0x2c'),_0x4412('0x2d'),_0x4412('0x2e'),_0x4412('0x2f'),_0x4412('0x30'),_0x4412('0x31'),_0x4412('0x32'),_0x4412('0x33'),_0x4412('0x34'),_0x4412('0x35'));}return _0x53cd33['map'](function(_0x9c29d8){var _0x3e48d0=_0x9c29d8[_0x4412('0x36')]({'plain':!![]});_0x3e48d0[_0x4412('0x37')]=[];_0x3e48d0[_0x4412('0x21')]=0x0;_0x3e48d0[_0x4412('0x38')]=0x0;_0x3e48d0[_0x4412('0x1d')]=0x0;_0x3e48d0[_0x4412('0x1e')]=0x0;_0x3e48d0[_0x4412('0x1f')]=0x0;if(_0x421589===_0x4412('0x18')){_0x3e48d0[_0x4412('0x20')]=0x0;_0x3e48d0['busy']=0x0;if(_0x1a216e===_0x4412('0x22')){_0x3e48d0[_0x4412('0x24')]=0x0;_0x3e48d0[_0x4412('0x25')]=0x0;}}var _0x35b5f0=_[_0x4412('0x39')](_0x13afb1,['id',_0x3e48d0['id']]);if(_0x35b5f0)_[_0x4412('0x3a')](_0x3e48d0,_[_0x4412('0x3b')](_0x35b5f0,_0x115360));return _0x3e48d0;});}function updateAgentVoiceStatus(_0x482528,_0x486ef3,_0x2c4172){var _0x3a752b=_['filter'](_0x2c4172,['queue',_0x486ef3[_0x4412('0xe')]]);if(_0x3a752b[_0x4412('0x3c')]===0x0)return _0x482528[_0x4412('0x3d')]=!![];if(_[_0x4412('0x3e')](_0x3a752b,[_0x4412('0x3f'),_0x482528[_0x4412('0x40')][_0x4412('0x41')]()]))return _0x482528[_0x4412('0x20')]=!![];if(!_0x482528[_0x4412('0x20')])return _0x482528[_0x4412('0x3d')]=!![];}function getVoiceQueueAgents(_0x1af004,_0x5bbbe4,_0x164a5f,_0x3191d5){var _0x279edd=_[_0x4412('0x39')](_0x5bbbe4,['id',_0x1af004['id']]);if(!_0x279edd)return _0x1af004;return _0x279edd[_0x4412('0x42')]({'raw':!![]})[_0x4412('0x12')](function(_0x19fca5){for(var _0x1bb146=0x0;_0x1bb146<_0x19fca5[_0x4412('0x3c')];_0x1bb146++){var _0x154bea=_[_0x4412('0x39')](_0x164a5f,['id',_0x19fca5[_0x1bb146]['UserId']]);if(!_0x154bea){_0x154bea={'id':_0x19fca5[_0x1bb146]['UserId'],'name':_0x19fca5[_0x1bb146]['UserId'],'accountcode':'','online':![]};}var _0x25c21c={'id':_0x154bea['id'],'name':_0x154bea[_0x4412('0xe')],'internal':_0x154bea[_0x4412('0x43')],'online':Boolean(_0x154bea[_0x4412('0x44')]),'paused':Boolean(_0x19fca5[_0x1bb146][_0x4412('0x21')])};if(_0x154bea['voiceStatus']==='talking')updateAgentVoiceStatus(_0x25c21c,_0x1af004,_0x3191d5);if(_0x25c21c['online'])_0x1af004['loggedInDb']++;if(_0x25c21c[_0x4412('0x3d')])_0x1af004[_0x4412('0x3d')]++;if(_0x25c21c[_0x4412('0x21')]&&!_0x25c21c['busy']&&!_0x25c21c['talking'])_0x1af004[_0x4412('0x21')]++;_0x1af004[_0x4412('0x37')][_0x4412('0x23')](_0x25c21c);}return _0x1af004;});}function getQueueAgents(_0x405d0e,_0x485868,_0x8cfc0a){var _0x19c639=_0x4412('0x45')+_[_0x4412('0x19')](_0x8cfc0a)+'Queue';var _0x431aa2=_0x8cfc0a+'Pause';return db[_0x19c639][_0x4412('0x46')]({'where':{[_['startCase'](_0x8cfc0a)+_0x4412('0x47')]:_0x405d0e['id']},'raw':!![]})[_0x4412('0x12')](function(_0x172995){for(var _0x40dfcb=0x0;_0x40dfcb<_0x172995[_0x4412('0x3c')];_0x40dfcb++){var _0x59c1db=_[_0x4412('0x39')](_0x485868,['id',_0x172995[_0x40dfcb][_0x4412('0x48')]]);if(!_0x59c1db){_0x59c1db={'id':_0x172995[_0x40dfcb][_0x4412('0x48')],'name':_0x172995[_0x40dfcb][_0x4412('0x48')],'online':![],['pauseField']:![]};}var _0x26b94e={'id':_0x59c1db['id'],'name':_0x59c1db[_0x4412('0xe')],'online':Boolean(_0x59c1db['online']),'paused':Boolean(_0x59c1db[_0x431aa2])};if(_0x26b94e[_0x4412('0x44')])_0x405d0e[_0x4412('0x38')]++;_0x405d0e[_0x4412('0x37')][_0x4412('0x23')](_0x26b94e);}return _0x405d0e;});}function isIdle(_0x30646a){return _0x30646a===_0x4412('0x49')||_0x30646a===_0x4412('0x4a')||_0x30646a===_0x4412('0x4b')||_0x30646a===_0x4412('0x4c')||_[_0x4412('0x4d')](_0x30646a);}function isAgentPaused(_0x5e1af9,_0x222bcc){var _0x4e5fe0=[_0x5e1af9[_0x4412('0x4e')],_0x5e1af9[_0x4412('0x4f')],_0x5e1af9[_0x4412('0x50')],_0x5e1af9['openchannelPause'],_0x5e1af9[_0x4412('0x51')],_0x5e1af9[_0x4412('0x52')],_0x5e1af9[_0x4412('0x53')]];if(!_0x222bcc)return _[_0x4412('0x54')](_0x4e5fe0);var _0x55aef3=_[_0x4412('0x55')](_0x4e5fe0);return _0x55aef3[_0x4412('0x3c')]>0x0&&_0x55aef3[_0x4412('0x3c')]<_0x4e5fe0[_0x4412('0x3c')]?!![]:![];}function isAgentIdle(_0x3af824){if(_0x3af824[_0x4412('0x56')]!==_0x4412('0x49')&&_0x3af824['voicePause']){_0x3af824[_0x4412('0x56')]=_0x4412('0x57');return![];}return _[_0x4412('0x54')]([_0x3af824[_0x4412('0x58')],_0x3af824[_0x4412('0x59')],_0x3af824[_0x4412('0x5a')],_0x3af824[_0x4412('0x5b')],_0x3af824['smsStatus'],_0x3af824[_0x4412('0x56')],_0x3af824[_0x4412('0x5c')]],isIdle);}function getAgentStatus(_0x3319ff){var _0x1af181='unknown';if(isAgentPaused(_0x3319ff))_0x1af181=_0x4412('0x57');else if(isAgentPaused(_0x3319ff,!![]))_0x1af181='*pause';else if(isAgentIdle(_0x3319ff))_0x1af181=_0x4412('0x49');else _0x1af181=_0x4412('0x3d');return _0x1af181;}exports[_0x4412('0x5d')]=function(_0x37902e,_0x50b907){var _0x1d7392={'count':0x0,'rows':[]},_0x77c380={},_0x3822cf,_0x5dcfc6,_0x3b1f8f=[_0x4412('0x5e'),_0x4412('0x44'),_0x4412('0x5f'),'lastPauseAt',_0x4412('0x60'),_0x4412('0x61'),_0x4412('0x40'),_0x4412('0x62'),_0x4412('0x4e'),_0x4412('0x63'),'mailPause','smsPause','whatsappPause',_0x4412('0x4f'),_0x4412('0x52'),_0x4412('0x64'),_0x4412('0x65'),_0x4412('0x66'),_0x4412('0x67'),'whatsappCapacity',_0x4412('0x68'),_0x4412('0x69'),_0x4412('0x6a'),'mailCurrentCapacity','smsCurrentCapacity',_0x4412('0x6b'),'faxCurrentCapacity',_0x4412('0x58'),'openchannelStatus','mailStatus',_0x4412('0x6c'),_0x4412('0x5c'),_0x4412('0x59'),_0x4412('0x56'),_0x4412('0x6d'),'openchannelStatusTime',_0x4412('0x6e'),_0x4412('0x6f'),_0x4412('0x70'),'faxStatusTime','voiceStatusTime',_0x4412('0x71'),_0x4412('0x72'),'screenrecording',_0x4412('0x73'),'phoneBarEnableAutomaticScreenRecording',_0x4412('0x74')],_0x16fb73=['chatPause',_0x4412('0x63'),_0x4412('0x50'),_0x4412('0x51'),_0x4412('0x53'),_0x4412('0x4f'),_0x4412('0x52'),_0x4412('0x44')];Promise[_0x4412('0x75')]()['then'](function(){var _0xbc7fae=_[_0x4412('0x76')](db['User'][_0x4412('0x77')],function(_0x18d316){return{'name':_0x18d316[_0x4412('0x78')],'type':_0x18d316[_0x4412('0x79')]['key']};});_0x37902e[_0x4412('0x7a')][_0x4412('0x7b')]='agent';_0x37902e[_0x4412('0x7a')]['online']=!![];_0x77c380=qs[_0x4412('0x7c')](_0xbc7fae,_0x37902e);_0x77c380[_0x4412('0x7d')]=!![];if(_0x37902e['user']['role']==='user'){var _0x53903c={'params':{'id':_0x37902e[_0x4412('0x7e')]['userProfileId']},'query':{'section':'Agents','role':_0x4412('0x7f'),'online':!![],'nolimit':_0x37902e[_0x4412('0x7a')][_0x4412('0x80')],'sort':_0x37902e[_0x4412('0x7a')][_0x4412('0x81')],'filter':_0x37902e[_0x4412('0x7a')]['filter']},'raw':!![]};return db[_0x4412('0x82')][_0x4412('0x83')](_0x53903c);}return db['User'][_0x4412('0x84')](_0x77c380);})[_0x4412('0x12')](function(_0x36b4a8){_0x1d7392[_0x4412('0xb')]=_0x36b4a8[_0x4412('0xb')];_0x3822cf=_0x36b4a8[_0x4412('0x85')];return getRealtimeAgents();})[_0x4412('0x12')](function(_0x380ce5){_0x5dcfc6=_0x380ce5['rows'];return _0x3822cf[_0x4412('0x76')](function(_0x475025){var _0x10689f=_[_0x4412('0x39')](_0x5dcfc6,['id',_0x475025['id']]);if(_0x10689f)_[_0x4412('0x3a')](_0x475025,_[_0x4412('0x3b')](_[_0x4412('0x86')](_0x10689f,_0x16fb73),_0x3b1f8f));_0x475025[_0x4412('0x87')]=getAgentStatus(_0x475025);return _0x475025;});})['then'](function(_0x4ca712){if(_0x37902e['query'][_0x4412('0x88')]){var _0x302fbf=_['filter'](_0x4ca712,[_0x4412('0x87'),_0x37902e['query'][_0x4412('0x88')]]);if(_0x37902e[_0x4412('0x7a')][_0x4412('0x89')]){_0x302fbf=_[_0x4412('0x55')](_0x302fbf,[_0x4412('0x60'),_0x37902e[_0x4412('0x7a')][_0x4412('0x89')]]);}}_0x1d7392[_0x4412('0x85')]=_0x302fbf||_0x4ca712;return _0x1d7392;})[_0x4412('0x12')](respondWithFilteredResult(_0x50b907,_0x77c380))[_0x4412('0x17')](handleError(_0x50b907,null));};exports[_0x4412('0x8a')]=function(_0x155d89,_0xf18f0f){var _0x12510c=['mail',_0x4412('0x8b'),_0x4412('0x8c'),_0x4412('0x8d'),_0x4412('0x8e'),'whatsapp',_0x4412('0x18')];var _0x2575b5={'count':0x0,'rows':[]},_0x312634={},_0x1cce0e,_0x39766c,_0x127a9e,_0x7f5fe6,_0x5ba949;Promise['resolve']()[_0x4412('0x12')](function(){if(_0x155d89[_0x4412('0x7a')][_0x4412('0x8f')]){if(!_['includes'](_0x12510c,_0x155d89[_0x4412('0x7a')][_0x4412('0x8f')]['toLowerCase']()))throw new Error('Invalid\x20channel');_0x1cce0e=_0x155d89['query'][_0x4412('0x8f')][_0x4412('0x90')]();}var _0x39012a=_[_0x4412('0x19')](_0x1cce0e)+_0x4412('0x91');var _0x224e0a=_[_0x4412('0x76')](db[_0x39012a][_0x4412('0x77')],function(_0x52a6d0){return{'name':_0x52a6d0['fieldName'],'type':_0x52a6d0[_0x4412('0x79')][_0x4412('0x92')]};});_0x312634=qs[_0x4412('0x7c')](_0x224e0a,_0x155d89);if(_0x155d89[_0x4412('0x7e')][_0x4412('0x7b')]===_0x4412('0x7e')){var _0x4a680a={'params':{'id':_0x155d89[_0x4412('0x7e')]['userProfileId']},'query':{'section':_0x1cce0e===_0x4412('0x18')&&_0x155d89[_0x4412('0x7a')][_0x4412('0x79')]===_0x4412('0x22')?_0x4412('0x93'):_[_0x4412('0x19')](_0x1cce0e)+_0x4412('0x94'),'type':_0x155d89[_0x4412('0x7a')][_0x4412('0x79')],'nolimit':!![],'sort':_0x4412('0xe'),'filter':_0x155d89['query']['filter']}};return db[_0x4412('0x82')]['getResources'](_0x4a680a);}return db[_0x39012a][_0x4412('0x84')](_0x312634);})['then'](function(_0x299dc6){_0x2575b5[_0x4412('0xb')]=_0x299dc6[_0x4412('0xb')];_0x39766c=_0x299dc6[_0x4412('0x85')];return getRealtimeQueues(_0x155d89,_0x1cce0e);})[_0x4412('0x12')](function(_0x9ce2cc){_0x7f5fe6=_0x9ce2cc[_0x4412('0x85')];return getRealtimeAgents();})[_0x4412('0x12')](function(_0x1043eb){_0x127a9e=_0x1043eb[_0x4412('0x85')];if(_0x1cce0e!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x4412('0x12')](function(_0xf9a06a){_0x5ba949=_0xf9a06a?_0xf9a06a[_0x4412('0x85')]:[];return initializeQueues(_0x39766c,_0x7f5fe6,_0x1cce0e,_0x155d89[_0x4412('0x7a')][_0x4412('0x79')]);})['then'](function(_0x25c04d){var _0x833155=_0x25c04d['map'](function(_0x3b00bd){if(_0x1cce0e===_0x4412('0x18'))return getVoiceQueueAgents(_0x3b00bd,_0x39766c,_0x127a9e,_0x5ba949);else return getQueueAgents(_0x3b00bd,_0x127a9e,_0x1cce0e);});return Promise['all'](_0x833155);})['then'](function(_0x290725){_0x2575b5['rows']=_0x290725;return _0x2575b5;})[_0x4412('0x12')](respondWithFilteredResult(_0xf18f0f,_0x312634))[_0x4412('0x17')](handleError(_0xf18f0f,null));}; \ No newline at end of file +var _0xad76=['error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','Queues','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','filter','toString','getMembers','length','UserId','accountcode','online','voiceStatus','Queue','Pause','findAll','idle','unknown','unavailable','isNil','chatPause','faxPause','mailPause','openchannelPause','whatsappPause','voicePause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','lastLoginAt','lastPauseAt','pauseType','internal','address','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','User','fieldName','key','query','role','agent','getOptions','raw','user','sort','UserProfile','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','includes','channel','Invalid\x20channel','toLowerCase','startCase','type','userProfileId','QueueCampaigns','getResources','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','count','limit','status','set','Content-Range'];(function(_0x5e3193,_0x14ad99){var _0x27d8ae=function(_0x5d36e6){while(--_0x5d36e6){_0x5e3193['push'](_0x5e3193['shift']());}};_0x27d8ae(++_0x14ad99);}(_0xad76,0x1b4));var _0x6ad7=function(_0x5aa168,_0x3de82a){_0x5aa168=_0x5aa168-0x0;var _0x147dd0=_0xad76[_0x5aa168];return _0x147dd0;};'use strict';var util=require(_0x6ad7('0x0'));var _=require('lodash');var jayson=require(_0x6ad7('0x1'));var qs=require(_0x6ad7('0x2'));var logger=require(_0x6ad7('0x3'))(_0x6ad7('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x6ad7('0x5')][_0x6ad7('0x6')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x914f44,_0x1ac269){return function(_0x118e78){if(_0x118e78){var _0x3817cf=typeof _0x1ac269[_0x6ad7('0x7')]===_0x6ad7('0x8')&&typeof _0x1ac269['limit']==='undefined';var _0x565d3b=_0x118e78[_0x6ad7('0x9')];var _0x3d1bf4=_0x3817cf?0x0:_0x1ac269[_0x6ad7('0x7')];var _0x13dd80=_0x3817cf?_0x118e78[_0x6ad7('0x9')]:_0x1ac269['offset']+_0x1ac269[_0x6ad7('0xa')];var _0x38d890;if(_0x13dd80>=_0x565d3b){_0x13dd80=_0x565d3b;_0x38d890=0xc8;}else{_0x38d890=0xce;}_0x914f44[_0x6ad7('0xb')](_0x38d890);return _0x914f44[_0x6ad7('0xc')](_0x6ad7('0xd'),_0x3d1bf4+'-'+_0x13dd80+'/'+_0x565d3b)['json'](_0x118e78);}return null;};}function handleError(_0x31ebaf,_0x5bdca6){_0x5bdca6=_0x5bdca6||0x1f4;return function(_0x34de02){logger[_0x6ad7('0xe')](_0x34de02[_0x6ad7('0xf')]);if(_0x34de02[_0x6ad7('0x10')]){delete _0x34de02[_0x6ad7('0x10')];}_0x31ebaf['status'](_0x5bdca6)[_0x6ad7('0x11')](_0x34de02);};}function getRealtimeAgents(){return new Promise(function(_0xfd7f13,_0x32dec4){return amiClient[_0x6ad7('0x12')](_0x6ad7('0x13'),{})[_0x6ad7('0x14')](function(_0x4d5e04){if(_0x4d5e04[_0x6ad7('0xe')])throw new Error(_0x6ad7('0x15'));var _0x33867c=_0x4d5e04[_0x6ad7('0x16')];return routingClient[_0x6ad7('0x12')]('Agents',{})['then'](function(_0x2ff708){if(_0x2ff708[_0x6ad7('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x3e1f42=_0x2ff708['result'];return _0xfd7f13(_[_0x6ad7('0x17')]({},_0x33867c,_0x3e1f42));});})[_0x6ad7('0x18')](function(_0x93b715){_0x32dec4(_0x93b715);});});}function getRealtimeQueues(_0x48d4aa,_0x7869b8){return new Promise(function(_0x3d0066,_0x477af1){var _0x188689=_0x7869b8===_0x6ad7('0x19')?amiClient:routingClient;return _0x188689[_0x6ad7('0x12')](_['startCase'](_0x7869b8)+_0x6ad7('0x1a'),_0x48d4aa)[_0x6ad7('0x14')](function(_0x33013b){if(_0x33013b[_0x6ad7('0xe')])throw new Error(util[_0x6ad7('0x1b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x7869b8));return _0x3d0066(_0x33013b[_0x6ad7('0x16')]);})['catch'](function(_0x3f414c){_0x477af1(_0x3f414c);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x29febf,_0x56ef63){return amiClient[_0x6ad7('0x12')](_0x6ad7('0x1c'),{})[_0x6ad7('0x14')](function(_0x1a2f69){if(_0x1a2f69[_0x6ad7('0xe')])throw new Error(_0x6ad7('0x1d'));return _0x29febf(_0x1a2f69['result']);})[_0x6ad7('0x18')](function(_0x43248c){_0x56ef63(_0x43248c);});});}function initializeQueues(_0x5b3763,_0x5eb8c9,_0x49a9b7,_0x2b8320){var _0x3fa57c=[_0x6ad7('0x1e'),_0x6ad7('0x1f'),_0x6ad7('0x20'),_0x6ad7('0x21'),_0x6ad7('0x22')];if(_0x49a9b7===_0x6ad7('0x19')&&_0x2b8320===_0x6ad7('0x23')){_0x3fa57c[_0x6ad7('0x24')](_0x6ad7('0x25'),_0x6ad7('0x26'),_0x6ad7('0x27'),_0x6ad7('0x28'),_0x6ad7('0x29'),'Trunk',_0x6ad7('0x2a'),_0x6ad7('0x2b'),_0x6ad7('0x2c'),'erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x6ad7('0x2d'),_0x6ad7('0x2e'),'predictiveIntervalTotalCalls',_0x6ad7('0x2f'),'predictiveIntervalDroppedCallsTimeout',_0x6ad7('0x30'),_0x6ad7('0x31'),_0x6ad7('0x32'));}return _0x5b3763[_0x6ad7('0x33')](function(_0xa3d821){var _0x87b6ee=_0xa3d821[_0x6ad7('0x34')]({'plain':!![]});_0x87b6ee[_0x6ad7('0x35')]=[];_0x87b6ee['paused']=0x0;_0x87b6ee[_0x6ad7('0x36')]=0x0;_0x87b6ee[_0x6ad7('0x1e')]=0x0;_0x87b6ee[_0x6ad7('0x1f')]=0x0;_0x87b6ee[_0x6ad7('0x20')]=0x0;if(_0x49a9b7===_0x6ad7('0x19')){_0x87b6ee[_0x6ad7('0x21')]=0x0;_0x87b6ee[_0x6ad7('0x37')]=0x0;if(_0x2b8320===_0x6ad7('0x23')){_0x87b6ee[_0x6ad7('0x25')]=0x0;_0x87b6ee[_0x6ad7('0x26')]=0x0;}}var _0x448cd2=_[_0x6ad7('0x38')](_0x5eb8c9,['id',_0x87b6ee['id']]);if(_0x448cd2)_['merge'](_0x87b6ee,_['pick'](_0x448cd2,_0x3fa57c));return _0x87b6ee;});}function updateAgentVoiceStatus(_0x1038c9,_0x3f141e,_0x1dcfe1){var _0x1a28a1=_[_0x6ad7('0x39')](_0x1dcfe1,['queue',_0x3f141e[_0x6ad7('0x10')]]);if(_0x1a28a1['length']===0x0)return _0x1038c9[_0x6ad7('0x37')]=!![];if(_['some'](_0x1a28a1,['connectedlinenum',_0x1038c9['internal'][_0x6ad7('0x3a')]()]))return _0x1038c9[_0x6ad7('0x21')]=!![];if(!_0x1038c9['talking'])return _0x1038c9['busy']=!![];}function getVoiceQueueAgents(_0x396179,_0x18ddf5,_0xcf3c8f,_0x2c51d2){var _0x5b8445=_['find'](_0x18ddf5,['id',_0x396179['id']]);if(!_0x5b8445)return _0x396179;return _0x5b8445[_0x6ad7('0x3b')]({'raw':!![]})['then'](function(_0x4a0b0f){for(var _0x1bd6b3=0x0;_0x1bd6b3<_0x4a0b0f[_0x6ad7('0x3c')];_0x1bd6b3++){var _0x2e22ab=_['find'](_0xcf3c8f,['id',_0x4a0b0f[_0x1bd6b3][_0x6ad7('0x3d')]]);if(!_0x2e22ab){_0x2e22ab={'id':_0x4a0b0f[_0x1bd6b3][_0x6ad7('0x3d')],'name':_0x4a0b0f[_0x1bd6b3][_0x6ad7('0x3d')],'accountcode':'','online':![]};}var _0x236bb1={'id':_0x2e22ab['id'],'name':_0x2e22ab[_0x6ad7('0x10')],'internal':_0x2e22ab[_0x6ad7('0x3e')],'online':Boolean(_0x2e22ab[_0x6ad7('0x3f')]),'paused':Boolean(_0x4a0b0f[_0x1bd6b3][_0x6ad7('0x22')])};if(_0x2e22ab[_0x6ad7('0x40')]===_0x6ad7('0x21'))updateAgentVoiceStatus(_0x236bb1,_0x396179,_0x2c51d2);if(_0x236bb1['online'])_0x396179[_0x6ad7('0x36')]++;if(_0x236bb1[_0x6ad7('0x37')])_0x396179[_0x6ad7('0x37')]++;if(_0x236bb1[_0x6ad7('0x22')]&&!_0x236bb1['busy']&&!_0x236bb1['talking'])_0x396179[_0x6ad7('0x22')]++;_0x396179[_0x6ad7('0x35')][_0x6ad7('0x24')](_0x236bb1);}return _0x396179;});}function getQueueAgents(_0x71c4e5,_0x670b39,_0x11e6d5){var _0x2752f4='User'+_['startCase'](_0x11e6d5)+_0x6ad7('0x41');var _0x17e444=_0x11e6d5+_0x6ad7('0x42');return db[_0x2752f4][_0x6ad7('0x43')]({'where':{[_['startCase'](_0x11e6d5)+'QueueId']:_0x71c4e5['id']},'raw':!![]})[_0x6ad7('0x14')](function(_0x44910a){for(var _0x847dee=0x0;_0x847dee<_0x44910a[_0x6ad7('0x3c')];_0x847dee++){var _0x23520c=_[_0x6ad7('0x38')](_0x670b39,['id',_0x44910a[_0x847dee][_0x6ad7('0x3d')]]);if(!_0x23520c){_0x23520c={'id':_0x44910a[_0x847dee][_0x6ad7('0x3d')],'name':_0x44910a[_0x847dee]['UserId'],'online':![],['pauseField']:![]};}var _0x63ded3={'id':_0x23520c['id'],'name':_0x23520c[_0x6ad7('0x10')],'online':Boolean(_0x23520c[_0x6ad7('0x3f')]),'paused':Boolean(_0x23520c[_0x17e444])};if(_0x63ded3['online'])_0x71c4e5[_0x6ad7('0x36')]++;_0x71c4e5[_0x6ad7('0x35')]['push'](_0x63ded3);}return _0x71c4e5;});}function isIdle(_0x4d5194){return _0x4d5194===_0x6ad7('0x44')||_0x4d5194===_0x6ad7('0x45')||_0x4d5194===_0x6ad7('0x46')||_0x4d5194==='ringing'||_[_0x6ad7('0x47')](_0x4d5194);}function isAgentPaused(_0x1d8cac,_0x465f52){var _0x3460dc=[_0x1d8cac[_0x6ad7('0x48')],_0x1d8cac[_0x6ad7('0x49')],_0x1d8cac[_0x6ad7('0x4a')],_0x1d8cac[_0x6ad7('0x4b')],_0x1d8cac['smsPause'],_0x1d8cac['voicePause'],_0x1d8cac[_0x6ad7('0x4c')]];if(!_0x465f52)return _['every'](_0x3460dc);var _0x1e26ab=_[_0x6ad7('0x39')](_0x3460dc);return _0x1e26ab[_0x6ad7('0x3c')]>0x0&&_0x1e26ab[_0x6ad7('0x3c')]<_0x3460dc[_0x6ad7('0x3c')]?!![]:![];}function isAgentIdle(_0x149ced){if(_0x149ced['voiceStatus']!==_0x6ad7('0x44')&&_0x149ced[_0x6ad7('0x4d')]){_0x149ced[_0x6ad7('0x40')]='pause';return![];}return _[_0x6ad7('0x4e')]([_0x149ced[_0x6ad7('0x4f')],_0x149ced[_0x6ad7('0x50')],_0x149ced[_0x6ad7('0x51')],_0x149ced[_0x6ad7('0x52')],_0x149ced[_0x6ad7('0x53')],_0x149ced[_0x6ad7('0x40')],_0x149ced[_0x6ad7('0x54')]],isIdle);}function getAgentStatus(_0x4461f7){var _0x219360=_0x6ad7('0x45');if(isAgentPaused(_0x4461f7))_0x219360='pause';else if(isAgentPaused(_0x4461f7,!![]))_0x219360=_0x6ad7('0x55');else if(isAgentIdle(_0x4461f7))_0x219360=_0x6ad7('0x44');else _0x219360=_0x6ad7('0x37');return _0x219360;}exports[_0x6ad7('0x56')]=function(_0x4ebce0,_0x365739){var _0x449226={'count':0x0,'rows':[]},_0x26e592={},_0x45b92b,_0x5e6eba,_0x1922f0=['userpic','online',_0x6ad7('0x57'),_0x6ad7('0x58'),_0x6ad7('0x59'),_0x6ad7('0x58'),_0x6ad7('0x5a'),_0x6ad7('0x5b'),_0x6ad7('0x48'),_0x6ad7('0x4b'),_0x6ad7('0x4a'),_0x6ad7('0x5c'),_0x6ad7('0x4c'),_0x6ad7('0x49'),_0x6ad7('0x4d'),_0x6ad7('0x5d'),_0x6ad7('0x5e'),_0x6ad7('0x5f'),_0x6ad7('0x60'),_0x6ad7('0x61'),_0x6ad7('0x62'),_0x6ad7('0x63'),_0x6ad7('0x64'),_0x6ad7('0x65'),_0x6ad7('0x66'),_0x6ad7('0x67'),'faxCurrentCapacity',_0x6ad7('0x4f'),_0x6ad7('0x52'),_0x6ad7('0x51'),_0x6ad7('0x53'),_0x6ad7('0x54'),_0x6ad7('0x50'),'voiceStatus',_0x6ad7('0x68'),'openchannelStatusTime',_0x6ad7('0x69'),_0x6ad7('0x6a'),_0x6ad7('0x6b'),_0x6ad7('0x6c'),_0x6ad7('0x6d'),_0x6ad7('0x6e'),_0x6ad7('0x6f'),_0x6ad7('0x70'),_0x6ad7('0x71'),_0x6ad7('0x72'),_0x6ad7('0x73')],_0x530634=['chatPause','openchannelPause','mailPause',_0x6ad7('0x5c'),_0x6ad7('0x4c'),'faxPause',_0x6ad7('0x4d'),'online'];Promise[_0x6ad7('0x74')]()[_0x6ad7('0x14')](function(){var _0x5a48f8=_[_0x6ad7('0x33')](db[_0x6ad7('0x75')]['rawAttributes'],function(_0x4c191c){return{'name':_0x4c191c[_0x6ad7('0x76')],'type':_0x4c191c['type'][_0x6ad7('0x77')]};});_0x4ebce0[_0x6ad7('0x78')][_0x6ad7('0x79')]=_0x6ad7('0x7a');_0x4ebce0['query'][_0x6ad7('0x3f')]=!![];_0x26e592=qs[_0x6ad7('0x7b')](_0x5a48f8,_0x4ebce0);_0x26e592[_0x6ad7('0x7c')]=!![];if(_0x4ebce0[_0x6ad7('0x7d')]['role']==='user'){var _0x3f292c={'params':{'id':_0x4ebce0['user']['userProfileId']},'query':{'section':'Agents','role':_0x6ad7('0x7a'),'online':!![],'nolimit':_0x4ebce0[_0x6ad7('0x78')]['nolimit'],'sort':_0x4ebce0['query'][_0x6ad7('0x7e')],'filter':_0x4ebce0['query'][_0x6ad7('0x39')]},'raw':!![]};return db[_0x6ad7('0x7f')]['getResources'](_0x3f292c);}return db[_0x6ad7('0x75')][_0x6ad7('0x80')](_0x26e592);})[_0x6ad7('0x14')](function(_0x4fdf37){_0x449226['count']=_0x4fdf37[_0x6ad7('0x9')];_0x45b92b=_0x4fdf37['rows'];return getRealtimeAgents();})[_0x6ad7('0x14')](function(_0x5025ad){_0x5e6eba=_0x5025ad[_0x6ad7('0x81')];return _0x45b92b[_0x6ad7('0x33')](function(_0x227f25){var _0x35f8ab=_[_0x6ad7('0x38')](_0x5e6eba,['id',_0x227f25['id']]);if(_0x35f8ab)_[_0x6ad7('0x17')](_0x227f25,_['pick'](_[_0x6ad7('0x82')](_0x35f8ab,_0x530634),_0x1922f0));_0x227f25[_0x6ad7('0x83')]=getAgentStatus(_0x227f25);return _0x227f25;});})[_0x6ad7('0x14')](function(_0x4534e5){if(_0x4ebce0[_0x6ad7('0x78')][_0x6ad7('0x84')]){var _0x5aaf90=_['filter'](_0x4534e5,['globalStatus',_0x4ebce0['query'][_0x6ad7('0x84')]]);if(_0x4ebce0['query']['pauseTypeFilter']){_0x5aaf90=_[_0x6ad7('0x39')](_0x5aaf90,['pauseType',_0x4ebce0[_0x6ad7('0x78')][_0x6ad7('0x85')]]);}}_0x449226[_0x6ad7('0x81')]=_0x5aaf90||_0x4534e5;return _0x449226;})[_0x6ad7('0x14')](respondWithFilteredResult(_0x365739,_0x26e592))['catch'](handleError(_0x365739,null));};exports[_0x6ad7('0x86')]=function(_0x29f685,_0x368913){var _0x302a8d=[_0x6ad7('0x87'),_0x6ad7('0x88'),_0x6ad7('0x89'),_0x6ad7('0x8a'),_0x6ad7('0x8b'),'whatsapp','voice'];var _0x3a2985={'count':0x0,'rows':[]},_0x15e7a3={},_0x3c42c0,_0x7d0e5a,_0x35145f,_0x4f4316,_0x5f79d0;Promise['resolve']()[_0x6ad7('0x14')](function(){if(_0x29f685[_0x6ad7('0x78')]['channel']){if(!_[_0x6ad7('0x8c')](_0x302a8d,_0x29f685[_0x6ad7('0x78')][_0x6ad7('0x8d')]['toLowerCase']()))throw new Error(_0x6ad7('0x8e'));_0x3c42c0=_0x29f685['query'][_0x6ad7('0x8d')][_0x6ad7('0x8f')]();}var _0x112eaf=_[_0x6ad7('0x90')](_0x3c42c0)+_0x6ad7('0x41');var _0x54629e=_['map'](db[_0x112eaf]['rawAttributes'],function(_0x7564cf){return{'name':_0x7564cf[_0x6ad7('0x76')],'type':_0x7564cf[_0x6ad7('0x91')][_0x6ad7('0x77')]};});_0x15e7a3=qs[_0x6ad7('0x7b')](_0x54629e,_0x29f685);if(_0x29f685[_0x6ad7('0x7d')][_0x6ad7('0x79')]===_0x6ad7('0x7d')){var _0x595265={'params':{'id':_0x29f685[_0x6ad7('0x7d')][_0x6ad7('0x92')]},'query':{'section':_0x3c42c0===_0x6ad7('0x19')&&_0x29f685['query'][_0x6ad7('0x91')]===_0x6ad7('0x23')?_0x6ad7('0x93'):_[_0x6ad7('0x90')](_0x3c42c0)+_0x6ad7('0x1a'),'type':_0x29f685[_0x6ad7('0x78')]['type'],'nolimit':!![],'sort':'name','filter':_0x29f685[_0x6ad7('0x78')]['filter']}};return db[_0x6ad7('0x7f')][_0x6ad7('0x94')](_0x595265);}return db[_0x112eaf]['findAndCountAll'](_0x15e7a3);})['then'](function(_0x2c1aaa){_0x3a2985[_0x6ad7('0x9')]=_0x2c1aaa[_0x6ad7('0x9')];_0x7d0e5a=_0x2c1aaa[_0x6ad7('0x81')];return getRealtimeQueues(_0x29f685,_0x3c42c0);})[_0x6ad7('0x14')](function(_0x3e955b){_0x4f4316=_0x3e955b[_0x6ad7('0x81')];return getRealtimeAgents();})[_0x6ad7('0x14')](function(_0x5e7feb){_0x35145f=_0x5e7feb[_0x6ad7('0x81')];if(_0x3c42c0!=_0x6ad7('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0x6ad7('0x14')](function(_0x2273c9){_0x5f79d0=_0x2273c9?_0x2273c9[_0x6ad7('0x81')]:[];return initializeQueues(_0x7d0e5a,_0x4f4316,_0x3c42c0,_0x29f685['query']['type']);})[_0x6ad7('0x14')](function(_0x2ab0ff){var _0x1892e5=_0x2ab0ff[_0x6ad7('0x33')](function(_0x590e1e){if(_0x3c42c0===_0x6ad7('0x19'))return getVoiceQueueAgents(_0x590e1e,_0x7d0e5a,_0x35145f,_0x5f79d0);else return getQueueAgents(_0x590e1e,_0x35145f,_0x3c42c0);});return Promise[_0x6ad7('0x95')](_0x1892e5);})[_0x6ad7('0x14')](function(_0x33aa50){_0x3a2985[_0x6ad7('0x81')]=_0x33aa50;return _0x3a2985;})['then'](respondWithFilteredResult(_0x368913,_0x15e7a3))[_0x6ad7('0x18')](handleError(_0x368913,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2341187..2ffcc51 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x330418,_0xc74fe0){var _0x29edcc=function(_0x3d2c8e){while(--_0x3d2c8e){_0x330418['push'](_0x330418['shift']());}};_0x29edcc(++_0xc74fe0);}(_0x70e0,0x17b));var _0x070e=function(_0x158819,_0x49527b){_0x158819=_0x158819-0x0;var _0x2907be=_0x70e0[_0x158819];return _0x2907be;};'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(_0x5e9994,_0x44a5e5){var _0x10da51=function(_0x5c4142){while(--_0x5c4142){_0x5e9994['push'](_0x5e9994['shift']());}};_0x10da51(++_0x44a5e5);}(_0xedd9,0xfc));var _0x9edd=function(_0x50f84a,_0xe5a726){_0x50f84a=_0x50f84a-0x0;var _0x2da266=_0xedd9[_0x50f84a];return _0x2da266;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index afbc898..271bc8b 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 _0x4677=['DATE','sequelize','INTEGER','STRING'];(function(_0x400694,_0x47f806){var _0x3ff9ad=function(_0x38bc15){while(--_0x38bc15){_0x400694['push'](_0x400694['shift']());}};_0x3ff9ad(++_0x47f806);}(_0x4677,0x155));var _0x7467=function(_0x1853a0,_0x59b9a4){_0x1853a0=_0x1853a0-0x0;var _0xe870b3=_0x4677[_0x1853a0];return _0xe870b3;};'use strict';var Sequelize=require(_0x7467('0x0'));module['exports']={'state':{'type':Sequelize[_0x7467('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7467('0x2')]},'scheduledat':{'type':Sequelize[_0x7467('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7467('0x3')]},'responsetime':{'type':Sequelize[_0x7467('0x3')]},'ringtime':{'type':Sequelize[_0x7467('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7467('0x2')]},'campaigntype':{'type':Sequelize[_0x7467('0x2')]},'membername':{'type':Sequelize[_0x7467('0x2')]}}; \ No newline at end of file +var _0x6b4e=['exports','DATE','INTEGER','STRING'];(function(_0x3a9bf0,_0x574cf9){var _0x2a5439=function(_0x2be103){while(--_0x2be103){_0x3a9bf0['push'](_0x3a9bf0['shift']());}};_0x2a5439(++_0x574cf9);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x904399,_0x437f69){_0x904399=_0x904399-0x0;var _0x209f6b=_0x6b4e[_0x904399];return _0x209f6b;};'use strict';var Sequelize=require('sequelize');module[_0xe6b4('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe6b4('0x1')]},'responsetime':{'type':Sequelize[_0xe6b4('0x1')]},'ringtime':{'type':Sequelize[_0xe6b4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe6b4('0x3')]},'campaigntype':{'type':Sequelize[_0xe6b4('0x3')]},'membername':{'type':Sequelize[_0xe6b4('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 244bbf2..6e606ab 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 _0x812a=['./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x27d4d6,_0x3adbcb){var _0x5dd2c6=function(_0x13622c){while(--_0x13622c){_0x27d4d6['push'](_0x27d4d6['shift']());}};_0x5dd2c6(++_0x3adbcb);}(_0x812a,0x1f3));var _0xa812=function(_0x44dbd5,_0x319b14){_0x44dbd5=_0x44dbd5-0x0;var _0x3bfb2b=_0x812a[_0x44dbd5];return _0x3bfb2b;};'use strict';var _=require(_0xa812('0x0'));var util=require(_0xa812('0x1'));var logger=require('../../config/logger')(_0xa812('0x2'));var moment=require('moment');var BPromise=require(_0xa812('0x3'));var rp=require(_0xa812('0x4'));var fs=require('fs');var path=require(_0xa812('0x5'));var rimraf=require(_0xa812('0x6'));var config=require('../../config/environment');var attributes=require(_0xa812('0x7'));module['exports']=function(_0x5b1a8f,_0x4169d8){return _0x5b1a8f[_0xa812('0x8')](_0xa812('0x9'),attributes,{'tableName':_0xa812('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad0b=['rimraf','../../config/environment','./reportAgentPreview.attributes','define','api','bluebird'];(function(_0x5a5ee1,_0x5c4b8f){var _0x5d4807=function(_0x3c4521){while(--_0x3c4521){_0x5a5ee1['push'](_0x5a5ee1['shift']());}};_0x5d4807(++_0x5c4b8f);}(_0xad0b,0x1ea));var _0xbad0=function(_0x5214e3,_0x5ce08d){_0x5214e3=_0x5214e3-0x0;var _0x142074=_0xad0b[_0x5214e3];return _0x142074;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbad0('0x0'));var moment=require('moment');var BPromise=require(_0xbad0('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbad0('0x2'));var config=require(_0xbad0('0x3'));var attributes=require(_0xbad0('0x4'));module['exports']=function(_0x3fc46a,_0x1e33b3){return _0x3fc46a[_0xbad0('0x5')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 12f672e..38ae088 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 _0xd5a0=['stringify','error','code','message','result','ReportAgentPreview','body','options','CreateReportAgentPreview','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0xd5a0,0x1ae));var _0x0d5a=function(_0x367301,_0x591c28){_0x367301=_0x367301-0x0;var _0xda1391=_0xd5a0[_0x367301];return _0xda1391;};'use strict';var _=require(_0x0d5a('0x0'));var util=require(_0x0d5a('0x1'));var moment=require(_0x0d5a('0x2'));var BPromise=require(_0x0d5a('0x3'));var rs=require(_0x0d5a('0x4'));var fs=require('fs');var Redis=require(_0x0d5a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d5a('0x6'));var logger=require(_0x0d5a('0x7'))(_0x0d5a('0x8'));var config=require('../../config/environment');var jayson=require(_0x0d5a('0x9'));var client=jayson[_0x0d5a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc1f88c,_0x2da592,_0x175aca){return new BPromise(function(_0x11c755,_0x5e6a96){return client[_0x0d5a('0xb')](_0xc1f88c,_0x175aca)[_0x0d5a('0xc')](function(_0x1289f8){logger[_0x0d5a('0xd')](_0x0d5a('0xe'),_0x2da592,_0x0d5a('0xf'));logger[_0x0d5a('0x10')](_0x0d5a('0x11'),_0x2da592,_0x0d5a('0xf'),JSON[_0x0d5a('0x12')](_0x1289f8));if(_0x1289f8['error']){if(_0x1289f8[_0x0d5a('0x13')][_0x0d5a('0x14')]===0x1f4){logger[_0x0d5a('0x13')](_0x0d5a('0xe'),_0x2da592,_0x1289f8[_0x0d5a('0x13')]['message']);return _0x5e6a96(_0x1289f8[_0x0d5a('0x13')][_0x0d5a('0x15')]);}logger[_0x0d5a('0x13')](_0x0d5a('0xe'),_0x2da592,_0x1289f8[_0x0d5a('0x13')][_0x0d5a('0x15')]);return _0x11c755(_0x1289f8['error'][_0x0d5a('0x15')]);}else{logger[_0x0d5a('0xd')](_0x0d5a('0xe'),_0x2da592,_0x0d5a('0xf'));_0x11c755(_0x1289f8[_0x0d5a('0x16')][_0x0d5a('0x15')]);}})['catch'](function(_0x420f5e){logger[_0x0d5a('0x13')](_0x0d5a('0xe'),_0x2da592,_0x420f5e);_0x5e6a96(_0x420f5e);});});}exports['CreateReportAgentPreview']=function(_0x248d0e){var _0x32caaf=this;return new Promise(function(_0x311097,_0x48c264){return db[_0x0d5a('0x17')]['create'](_0x248d0e[_0x0d5a('0x18')],{'raw':_0x248d0e[_0x0d5a('0x19')]?_0x248d0e[_0x0d5a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d5a('0xc')](function(_0x21bfc9){logger[_0x0d5a('0xd')](_0x0d5a('0x1a'),_0x248d0e);logger[_0x0d5a('0x10')](_0x0d5a('0x1a'),_0x248d0e,JSON['stringify'](_0x21bfc9));_0x311097(_0x21bfc9);})[_0x0d5a('0x1b')](function(_0x5d821a){logger[_0x0d5a('0x13')](_0x0d5a('0x1a'),_0x5d821a[_0x0d5a('0x15')],_0x248d0e);_0x48c264(_0x32caaf[_0x0d5a('0x13')](0x1f4,_0x5d821a[_0x0d5a('0x15')]));});});}; \ No newline at end of file +var _0x0774=['stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','catch','ReportAgentPreview','create','body','raw','CreateReportAgentPreview'];(function(_0x73e5b0,_0x241ec0){var _0x23ed6f=function(_0x12825c){while(--_0x12825c){_0x73e5b0['push'](_0x73e5b0['shift']());}};_0x23ed6f(++_0x241ec0);}(_0x0774,0x105));var _0x4077=function(_0x546304,_0x50b057){_0x546304=_0x546304-0x0;var _0x2da5dc=_0x0774[_0x546304];return _0x2da5dc;};'use strict';var _=require('lodash');var util=require(_0x4077('0x0'));var moment=require(_0x4077('0x1'));var BPromise=require(_0x4077('0x2'));var rs=require(_0x4077('0x3'));var fs=require('fs');var Redis=require(_0x4077('0x4'));var db=require(_0x4077('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4077('0x6'));var config=require(_0x4077('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4077('0x8')][_0x4077('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf6286,_0x586a11,_0x3fa3ac){return new BPromise(function(_0x4154c4,_0x23e4bd){return client[_0x4077('0xa')](_0xf6286,_0x3fa3ac)['then'](function(_0x4b87eb){logger['info'](_0x4077('0xb'),_0x586a11,'request\x20sent');logger[_0x4077('0xc')](_0x4077('0xd'),_0x586a11,'request\x20sent',JSON['stringify'](_0x4b87eb));if(_0x4b87eb['error']){if(_0x4b87eb[_0x4077('0xe')][_0x4077('0xf')]===0x1f4){logger[_0x4077('0xe')](_0x4077('0xb'),_0x586a11,_0x4b87eb[_0x4077('0xe')][_0x4077('0x10')]);return _0x23e4bd(_0x4b87eb[_0x4077('0xe')][_0x4077('0x10')]);}logger[_0x4077('0xe')](_0x4077('0xb'),_0x586a11,_0x4b87eb['error']['message']);return _0x4154c4(_0x4b87eb['error'][_0x4077('0x10')]);}else{logger[_0x4077('0x11')](_0x4077('0xb'),_0x586a11,_0x4077('0x12'));_0x4154c4(_0x4b87eb['result']['message']);}})[_0x4077('0x13')](function(_0xea6592){logger[_0x4077('0xe')](_0x4077('0xb'),_0x586a11,_0xea6592);_0x23e4bd(_0xea6592);});});}exports['CreateReportAgentPreview']=function(_0xf78586){var _0x119ed9=this;return new Promise(function(_0x7aa6c1,_0x1b007e){return db[_0x4077('0x14')][_0x4077('0x15')](_0xf78586[_0x4077('0x16')],{'raw':_0xf78586['options']?_0xf78586['options'][_0x4077('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5ec647){logger[_0x4077('0x11')](_0x4077('0x18'),_0xf78586);logger[_0x4077('0xc')](_0x4077('0x18'),_0xf78586,JSON[_0x4077('0x19')](_0x5ec647));_0x7aa6c1(_0x5ec647);})['catch'](function(_0x307351){logger[_0x4077('0xe')](_0x4077('0x18'),_0x307351[_0x4077('0x10')],_0xf78586);_0x1b007e(_0x119ed9['error'](0x1f4,_0x307351['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a8e123b..b06732c 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 _0x8c4c=['/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','/outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','whatsapp','/sms/queues/:id','showSmsQueues','multer','util','express','Router','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x8c4c,0x8c));var _0xc8c4=function(_0x10b4d5,_0xb482f9){_0x10b4d5=_0x10b4d5-0x0;var _0x5441c1=_0x8c4c[_0x10b4d5];return _0x5441c1;};'use strict';var multer=require(_0xc8c4('0x0'));var util=require(_0xc8c4('0x1'));var path=require('path');var express=require(_0xc8c4('0x2'));var router=express[_0xc8c4('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xc8c4('0x4')](_0xc8c4('0x5'),auth['isAuthenticated'](),controller[_0xc8c4('0x6')]);router['get'](_0xc8c4('0x7'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x9')]);router[_0xc8c4('0x4')](_0xc8c4('0xa'),auth[_0xc8c4('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0xc8c4('0x4')](_0xc8c4('0xb'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0xc')]);router[_0xc8c4('0x4')](_0xc8c4('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xc8c4('0x4')](_0xc8c4('0xe'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0xf')]);router[_0xc8c4('0x4')](_0xc8c4('0x10'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x11')]);router['get']('/openchannel/queues',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x12')]);router[_0xc8c4('0x4')]('/sms/queues',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x13')]);router[_0xc8c4('0x4')](_0xc8c4('0x14'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x15')]);router[_0xc8c4('0x4')](_0xc8c4('0x16'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x17')]);router[_0xc8c4('0x4')](_0xc8c4('0x18'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x19')]);router['get']('/voice/queues/channels',auth[_0xc8c4('0x8')](),controller['voiceQueuesChannels']);router[_0xc8c4('0x4')](_0xc8c4('0x1a'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x1b')]);router[_0xc8c4('0x4')](_0xc8c4('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router['get'](_0xc8c4('0x1d'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x1e')]);router[_0xc8c4('0x4')]('/voice/queues/:id',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x1f')]);router[_0xc8c4('0x20')](_0xc8c4('0x21'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xc8c4('0x4')](_0xc8c4('0x22'),auth['isAuthenticated'](),controller['outbound']);router['get']('/outbound/channels',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x23')]);router[_0xc8c4('0x4')](_0xc8c4('0x24'),auth['isAuthenticated'](),controller[_0xc8c4('0x25')]);router[_0xc8c4('0x20')](_0xc8c4('0x26'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x27')]);router[_0xc8c4('0x4')](_0xc8c4('0x28'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x29')]);router[_0xc8c4('0x4')](_0xc8c4('0x2a'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x2b')]);router[_0xc8c4('0x4')](_0xc8c4('0x2c'),auth['isAuthenticated'](),controller[_0xc8c4('0x2d')]);router[_0xc8c4('0x4')](_0xc8c4('0x2e'),auth[_0xc8c4('0x8')](),controller['faxAccounts']);router[_0xc8c4('0x4')](_0xc8c4('0x2f'),auth['isAuthenticated'](),controller[_0xc8c4('0x30')]);router[_0xc8c4('0x4')](_0xc8c4('0x31'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x32')]);router[_0xc8c4('0x4')](_0xc8c4('0x33'),auth[_0xc8c4('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0xc8c4('0x4')](_0xc8c4('0x34'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x35')]);router[_0xc8c4('0x4')]('/sms/queues/waitinginteractions',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x36')]);router[_0xc8c4('0x4')](_0xc8c4('0x37'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x38')]);router[_0xc8c4('0x4')]('/fax/queues/waitinginteractions',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x39')]);router[_0xc8c4('0x3a')](_0xc8c4('0x3b'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3c')](_0xc8c4('0x3d')));router[_0xc8c4('0x4')]('/mail/queues/:id',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3e')]);router['post'](_0xc8c4('0x3f'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3c')](_0xc8c4('0x40')));router[_0xc8c4('0x4')](_0xc8c4('0x41'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x42')]);router['post'](_0xc8c4('0x43'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3c')](_0xc8c4('0x44')));router[_0xc8c4('0x4')](_0xc8c4('0x45'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x46')]);router[_0xc8c4('0x3a')]('/openchannel/queues/:id/notify',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3c')](_0xc8c4('0x47')));router[_0xc8c4('0x4')](_0xc8c4('0x48'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x49')]);router[_0xc8c4('0x3a')]('/sms/queues/:id/notify',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3c')](_0xc8c4('0x4a')));router['post']('/whatsapp/queues/:id/notify',auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x3c')](_0xc8c4('0x4b')));router['get'](_0xc8c4('0x4c'),auth[_0xc8c4('0x8')](),controller[_0xc8c4('0x4d')]);router[_0xc8c4('0x4')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth[_0xc8c4('0x8')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0xf151=['outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','trunks','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id','showFaxQueues','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xf151,0xab));var _0x1f15=function(_0x58d071,_0x2af569){_0x58d071=_0x58d071-0x0;var _0x45e7fa=_0xf151[_0x58d071];return _0x45e7fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f15('0x0'));var express=require(_0x1f15('0x1'));var router=express[_0x1f15('0x2')]();var auth=require(_0x1f15('0x3'));var controller=require(_0x1f15('0x4'));router[_0x1f15('0x5')](_0x1f15('0x6'),auth[_0x1f15('0x7')](),controller['voiceChannels']);router[_0x1f15('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x1f15('0x5')](_0x1f15('0x8'),auth[_0x1f15('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0x1f15('0x5')](_0x1f15('0x9'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x1f15('0x5')](_0x1f15('0xa'),auth[_0x1f15('0x7')](),controller[_0x1f15('0xb')]);router['get'](_0x1f15('0xc'),auth[_0x1f15('0x7')](),controller[_0x1f15('0xd')]);router[_0x1f15('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x1f15('0xe')]);router[_0x1f15('0x5')](_0x1f15('0xf'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x10')]);router[_0x1f15('0x5')]('/sms/queues',auth[_0x1f15('0x7')](),controller[_0x1f15('0x11')]);router[_0x1f15('0x5')](_0x1f15('0x12'),auth['isAuthenticated'](),controller[_0x1f15('0x13')]);router['get'](_0x1f15('0x14'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x15')]);router['get']('/voice/queues/preview/:id',auth[_0x1f15('0x7')](),controller[_0x1f15('0x16')]);router[_0x1f15('0x5')]('/voice/queues/channels',auth[_0x1f15('0x7')](),controller['voiceQueuesChannels']);router[_0x1f15('0x5')](_0x1f15('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x1f15('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x1f15('0x7')](),controller[_0x1f15('0x18')]);router[_0x1f15('0x5')](_0x1f15('0x19'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x1a')]);router[_0x1f15('0x5')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x1f15('0x1b')]);router[_0x1f15('0x1c')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x1f15('0x1d')]);router[_0x1f15('0x5')](_0x1f15('0x1e'),auth['isAuthenticated'](),controller[_0x1f15('0x1f')]);router[_0x1f15('0x5')](_0x1f15('0x20'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x21')]);router[_0x1f15('0x5')](_0x1f15('0x22'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x23')]);router['put'](_0x1f15('0x24'),auth['isAuthenticated'](),controller[_0x1f15('0x25')]);router[_0x1f15('0x5')]('/telephones',auth[_0x1f15('0x7')](),controller[_0x1f15('0x26')]);router[_0x1f15('0x5')]('/trunks',auth[_0x1f15('0x7')](),controller[_0x1f15('0x27')]);router[_0x1f15('0x5')]('/campaigns',auth[_0x1f15('0x7')](),controller['campaigns']);router[_0x1f15('0x5')]('/fax/accounts',auth[_0x1f15('0x7')](),controller[_0x1f15('0x28')]);router[_0x1f15('0x5')](_0x1f15('0x29'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x2a')]);router[_0x1f15('0x5')](_0x1f15('0x2b'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x1f15('0x5')](_0x1f15('0x2c'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x2d')]);router[_0x1f15('0x5')](_0x1f15('0x2e'),auth['isAuthenticated'](),controller[_0x1f15('0x2f')]);router[_0x1f15('0x5')](_0x1f15('0x30'),auth[_0x1f15('0x7')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x1f15('0x31')]);router[_0x1f15('0x5')](_0x1f15('0x32'),auth[_0x1f15('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0x1f15('0x33')]('/mail/queues/:id/notify',auth[_0x1f15('0x7')](),controller[_0x1f15('0x34')](_0x1f15('0x35')));router[_0x1f15('0x5')](_0x1f15('0x36'),auth[_0x1f15('0x7')](),controller['showMailQueues']);router[_0x1f15('0x33')](_0x1f15('0x37'),auth['isAuthenticated'](),controller[_0x1f15('0x34')](_0x1f15('0x38')));router[_0x1f15('0x5')]('/chat/queues/:id',auth[_0x1f15('0x7')](),controller[_0x1f15('0x39')]);router['post']('/fax/queues/:id/notify',auth[_0x1f15('0x7')](),controller[_0x1f15('0x34')]('fax'));router[_0x1f15('0x5')](_0x1f15('0x3a'),auth['isAuthenticated'](),controller[_0x1f15('0x3b')]);router[_0x1f15('0x33')]('/openchannel/queues/:id/notify',auth[_0x1f15('0x7')](),controller['queueNotify']('openchannel'));router['get']('/openchannel/queues/:id',auth[_0x1f15('0x7')](),controller[_0x1f15('0x3c')]);router[_0x1f15('0x33')](_0x1f15('0x3d'),auth[_0x1f15('0x7')](),controller['queueNotify']('sms'));router[_0x1f15('0x33')]('/whatsapp/queues/:id/notify',auth[_0x1f15('0x7')](),controller['queueNotify'](_0x1f15('0x3e')));router[_0x1f15('0x5')](_0x1f15('0x3f'),auth[_0x1f15('0x7')](),controller['showSmsQueues']);router[_0x1f15('0x5')](_0x1f15('0x40'),auth[_0x1f15('0x7')](),controller[_0x1f15('0x41')]);router['post'](_0x1f15('0x42'),auth[_0x1f15('0x7')](),controller['agentNotify']);module[_0x1f15('0x43')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index fa19326..5d25a07 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 _0xd6d6=['capacity','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','indexOf','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','create','Start','*,*,*,*','agentNotify','channel','capitalize','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','error','code','message','status','json','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','internal'];(function(_0x3523cb,_0x511b5c){var _0x54efd9=function(_0x48ee79){while(--_0x48ee79){_0x3523cb['push'](_0x3523cb['shift']());}};_0x54efd9(++_0x511b5c);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x373213,_0x4319c8){_0x373213=_0x373213-0x0;var _0x586a72=_0xd6d6[_0x373213];return _0x586a72;};'use strict';var BPromise=require(_0x6d6d('0x0'));var moment=require(_0x6d6d('0x1'));var _=require(_0x6d6d('0x2'));var util=require(_0x6d6d('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6d6d('0x4'))(_0x6d6d('0x5'));var jayson=require(_0x6d6d('0x6'));var amiClient=jayson[_0x6d6d('0x7')][_0x6d6d('0x8')]({'port':0x232a});var mailClient=jayson[_0x6d6d('0x7')][_0x6d6d('0x8')]({'port':0x232b});var routingClient=jayson['client'][_0x6d6d('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){var _0x3e69a4=_0x18f824?_0x18f824:amiClient;return _0x3e69a4['request'](_0x1bf731,_0x44f83d)['then'](function(_0x404c88){if(_0x404c88[_0x6d6d('0x9')]){if(_0x404c88[_0x6d6d('0x9')][_0x6d6d('0xa')]===0x1f4){return _0x408f88(_0x404c88[_0x6d6d('0x9')]['message']);}return _0xd49f57(_0x404c88[_0x6d6d('0x9')][_0x6d6d('0xb')]);}else{_0xd49f57(_0x404c88['result']);}})['catch'](function(_0x176618){_0x408f88(_0x176618);});});}function respondWithResult(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xc8;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0xc')](_0xe61c36)[_0x6d6d('0xd')](_0x3f8542);}return _0x32146d[_0x6d6d('0xe')](0x194);};}function handleError(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0x1f4;return function(_0xd09ea7){logger[_0x6d6d('0x9')](_0xd09ea7[_0x6d6d('0xf')]);if(_0xd09ea7[_0x6d6d('0x10')]){delete _0xd09ea7[_0x6d6d('0x10')];}_0x2cb2dd['status'](_0x5f4154)[_0x6d6d('0x11')](_0xd09ea7);};}function findById(_0x587338){return function(_0x27830d){if(!_[_0x6d6d('0x12')](_0x587338)&&!_[_0x6d6d('0x12')](_0x27830d)&&!_['isNil'](_0x27830d['rows'])){return _[_0x6d6d('0x13')](_0x27830d[_0x6d6d('0x14')],function(_0x2b59d4){return _0x2b59d4['id']==_0x587338;});}return null;};}exports[_0x6d6d('0x15')]=function(_0x51fff6,_0x554392){return respondWithRpcPromise(_0x6d6d('0x16'),_0x51fff6['query'])[_0x6d6d('0x17')](respondWithResult(_0x554392,null))[_0x6d6d('0x18')](handleError(_0x554392,null));};exports[_0x6d6d('0x19')]=function(_0x450352,_0x40d35b){return respondWithRpcPromise(_0x6d6d('0x1a'),_[_0x6d6d('0x1b')](_0x450352[_0x6d6d('0x1c')],_0x450352[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x40d35b,null))[_0x6d6d('0x18')](handleError(_0x40d35b,null));};exports[_0x6d6d('0x1e')]=function(_0x466a29,_0x21b95d){return respondWithRpcPromise(_0x6d6d('0x1f'),_[_0x6d6d('0x1b')](_0x466a29[_0x6d6d('0x1c')],_0x466a29['params']))[_0x6d6d('0x17')](respondWithResult(_0x21b95d,null))[_0x6d6d('0x18')](handleError(_0x21b95d,null));};exports[_0x6d6d('0x20')]=function(_0x97ec9e,_0xf0df7f){return respondWithRpcPromise(_0x6d6d('0x21'),_0x97ec9e['query'])[_0x6d6d('0x17')](respondWithResult(_0xf0df7f,null))[_0x6d6d('0x18')](handleError(_0xf0df7f,null));};exports[_0x6d6d('0x22')]=function(_0x126ac8,_0x25c121){return respondWithRpcPromise(_0x6d6d('0x21'),_0x126ac8[_0x6d6d('0x1c')])['then'](findById(_0x126ac8[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x25c121,null))['catch'](handleError(_0x25c121,null));};exports['updateVoiceQueue']=function(_0x3edcce,_0x5273cd){return respondWithRpcPromise(_0x6d6d('0x23'),_['merge'](_0x3edcce[_0x6d6d('0x24')],_0x3edcce[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x5273cd,null))[_0x6d6d('0x18')](handleError(_0x5273cd,null));};exports[_0x6d6d('0x25')]=function(_0x428c17,_0xdda3f2){return respondWithRpcPromise(_0x6d6d('0x26'),_[_0x6d6d('0x1b')](_0x428c17[_0x6d6d('0x1c')],_0x428c17['params']))[_0x6d6d('0x17')](respondWithResult(_0xdda3f2,null))['catch'](handleError(_0xdda3f2,null));};exports[_0x6d6d('0x27')]=function(_0x1ea9b2,_0xf527da){return respondWithRpcPromise(_0x6d6d('0x28'),_0x1ea9b2['query'])[_0x6d6d('0x17')](respondWithResult(_0xf527da,null))['catch'](handleError(_0xf527da,null));};exports[_0x6d6d('0x29')]=function(_0x219fd4,_0x5be8da){return respondWithRpcPromise(_0x6d6d('0x2a'),_[_0x6d6d('0x1b')](_0x219fd4[_0x6d6d('0x1c')],_0x219fd4[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x5be8da,null))[_0x6d6d('0x18')](handleError(_0x5be8da,null));};exports[_0x6d6d('0x2b')]=function(_0x2d524d,_0x243555){return respondWithRpcPromise(_0x6d6d('0x2c'),_[_0x6d6d('0x1b')](_0x2d524d[_0x6d6d('0x1c')],_0x2d524d[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x243555,null))['catch'](handleError(_0x243555,null));};exports[_0x6d6d('0x2d')]=function(_0xf98bfa,_0x3e2415){return respondWithRpcPromise(_0x6d6d('0x2e'),_['merge'](_0xf98bfa['query'],_0xf98bfa[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x3e2415,null))[_0x6d6d('0x18')](handleError(_0x3e2415,null));};exports['outbound']=function(_0x2a3f67,_0x2607c1){return respondWithRpcPromise(_0x6d6d('0x2f'),_0x2a3f67[_0x6d6d('0x1c')])['then'](respondWithResult(_0x2607c1,null))['catch'](handleError(_0x2607c1,null));};exports['outboundChannels']=function(_0x62620d,_0x4196f0){return respondWithRpcPromise(_0x6d6d('0x30'),_0x62620d[_0x6d6d('0x1c')])['then'](respondWithResult(_0x4196f0,null))[_0x6d6d('0x18')](handleError(_0x4196f0,null));};exports[_0x6d6d('0x31')]=function(_0x344f6f,_0x3c6d23){var _0x3d632c;return respondWithRpcPromise(_0x6d6d('0x32'),_0x344f6f['query'])[_0x6d6d('0x17')](function(_0x3c7292){_0x3d632c=_0x3c7292;return respondWithRpcPromise(_0x6d6d('0x32'),_0x344f6f[_0x6d6d('0x1c')],routingClient);})[_0x6d6d('0x17')](function(_0x3e27b7){return _[_0x6d6d('0x1b')]({},_0x3e27b7,_0x3d632c);})['then'](respondWithResult(_0x3c6d23,null))[_0x6d6d('0x18')](handleError(_0x3c6d23,null));};exports[_0x6d6d('0x33')]=function(_0x16e177,_0x2107e0){if(_0x16e177[_0x6d6d('0x24')]&&_0x16e177['body'][_0x6d6d('0x34')]&&_0x16e177[_0x6d6d('0x35')]&&_0x16e177['user'][_0x6d6d('0x10')]){for(var _0x50dc17 in _0x16e177[_0x6d6d('0x24')][_0x6d6d('0x34')]){if(_0x16e177['body'][_0x6d6d('0x34')][_0x6d6d('0x36')](_0x50dc17)){db[_0x6d6d('0x37')][_0x6d6d('0x38')]({'where':{'channel':_0x50dc17,'membername':_0x16e177[_0x6d6d('0x35')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x16e177[_0x6d6d('0x24')]['interaction'][_0x50dc17]&&_0x16e177['body'][_0x6d6d('0x34')][_0x50dc17][_0x6d6d('0x39')]?{'$notIn':_0x16e177[_0x6d6d('0x24')]['interaction'][_0x50dc17]}:{'$ne':null}}})[_0x6d6d('0x17')](function(_0x4cff80){var _0x1a2d4c=moment()[_0x6d6d('0x3a')](_0x6d6d('0x3b'));for(var _0x4606eb=0x0,_0x75f298=_0x4cff80[_0x6d6d('0x39')];_0x4606eb<_0x75f298;_0x4606eb+=0x1){_0x4cff80[_0x4606eb][_0x6d6d('0x3c')]({'exitAt':_0x1a2d4c});}});for(var _0x5c0495=0x0;_0x5c0495<_0x16e177[_0x6d6d('0x24')][_0x6d6d('0x34')][_0x50dc17][_0x6d6d('0x39')];_0x5c0495+=0x1){db[_0x6d6d('0x37')][_0x6d6d('0x3d')]({'where':{'channel':_0x50dc17,'membername':_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x10')],'type':_0x6d6d('0x3e'),'uniqueid':_0x16e177[_0x6d6d('0x24')]['interaction'][_0x50dc17][_0x5c0495],'exitAt':null},'defaults':{'channel':_0x50dc17,'membername':_0x16e177['user'][_0x6d6d('0x10')],'interface':_[_0x6d6d('0x12')](_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x3f')])?util[_0x6d6d('0x3a')]('SIP/%s',_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x10')]):_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x3f')],'type':_0x6d6d('0x3e'),'enterAt':moment()[_0x6d6d('0x3a')](_0x6d6d('0x3b')),'role':_0x6d6d('0x40'),'internal':_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x41')],'uniqueid':_0x16e177[_0x6d6d('0x24')][_0x6d6d('0x34')][_0x50dc17][_0x5c0495]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x16e177[_0x6d6d('0x1d')]['id'],'capacity':_0x16e177[_0x6d6d('0x24')][_0x6d6d('0x42')]},routingClient)[_0x6d6d('0x17')](respondWithResult(_0x2107e0,null))[_0x6d6d('0x18')](handleError(_0x2107e0,null));};exports['telephones']=function(_0x38c307,_0x36bc5a){return respondWithRpcPromise(_0x6d6d('0x43'),_0x38c307['query'])['then'](respondWithResult(_0x36bc5a,null))[_0x6d6d('0x18')](handleError(_0x36bc5a,null));};exports['trunks']=function(_0x3ea57e,_0x995fe2){return respondWithRpcPromise(_0x6d6d('0x44'),_0x3ea57e[_0x6d6d('0x1c')])[_0x6d6d('0x17')](respondWithResult(_0x995fe2,null))[_0x6d6d('0x18')](handleError(_0x995fe2,null));};exports[_0x6d6d('0x45')]=function(_0x26c23a,_0x1a8f33){return respondWithRpcPromise(_0x6d6d('0x46'),_0x26c23a['query'])[_0x6d6d('0x17')](respondWithResult(_0x1a8f33,null))[_0x6d6d('0x18')](handleError(_0x1a8f33,null));};exports[_0x6d6d('0x47')]=function(_0x8000b6,_0x1f98d4){return respondWithRpcPromise(_0x6d6d('0x48'),_0x8000b6[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0x1f98d4,null))['catch'](handleError(_0x1f98d4,null));};exports[_0x6d6d('0x49')]=function(_0x122865,_0x5cc644){return respondWithRpcPromise(_0x6d6d('0x48'),_0x122865[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](findById(_0x122865[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x5cc644,null))[_0x6d6d('0x18')](handleError(_0x5cc644,null));};exports[_0x6d6d('0x4a')]=function(_0x1ef7fb,_0x2abd8c){return respondWithRpcPromise(_0x6d6d('0x4b'),_0x1ef7fb[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x2abd8c,null))[_0x6d6d('0x18')](handleError(_0x2abd8c,null));};exports[_0x6d6d('0x4c')]=function(_0x3065ea,_0x50d8dd){return respondWithRpcPromise(_0x6d6d('0x4b'),_0x3065ea[_0x6d6d('0x1c')],routingClient)['then'](findById(_0x3065ea[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x50d8dd,null))[_0x6d6d('0x18')](handleError(_0x50d8dd,null));};exports[_0x6d6d('0x4d')]=function(_0x2d61cc,_0xd0a573){return respondWithRpcPromise(_0x6d6d('0x4e'),_0x2d61cc[_0x6d6d('0x1c')],mailClient)[_0x6d6d('0x17')](respondWithResult(_0xd0a573,null))['catch'](handleError(_0xd0a573,null));};exports['openchannelQueues']=function(_0x22c3a1,_0x325fe2){return respondWithRpcPromise(_0x6d6d('0x4f'),_0x22c3a1['query'],routingClient)['then'](respondWithResult(_0x325fe2,null))[_0x6d6d('0x18')](handleError(_0x325fe2,null));};exports['showOpenchannelQueues']=function(_0x30badc,_0x5b6f58){return respondWithRpcPromise(_0x6d6d('0x4f'),_0x30badc[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](findById(_0x30badc[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x5b6f58,null))[_0x6d6d('0x18')](handleError(_0x5b6f58,null));};exports['smsQueues']=function(_0x41e576,_0x5eb78f){return respondWithRpcPromise(_0x6d6d('0x50'),_0x41e576['query'],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x5eb78f,null))[_0x6d6d('0x18')](handleError(_0x5eb78f,null));};exports[_0x6d6d('0x51')]=function(_0xa71db1,_0x29b68b){return respondWithRpcPromise(_0x6d6d('0x50'),_0xa71db1[_0x6d6d('0x1c')],routingClient)['then'](findById(_0xa71db1['params']['id']))[_0x6d6d('0x17')](respondWithResult(_0x29b68b,null))['catch'](handleError(_0x29b68b,null));};exports[_0x6d6d('0x52')]=function(_0x53b77a,_0xe19d23){return respondWithRpcPromise(_0x6d6d('0x53'),_0x53b77a[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0xe19d23,null))[_0x6d6d('0x18')](handleError(_0xe19d23,null));};exports[_0x6d6d('0x54')]=function(_0x5dd3b0,_0x3cedc0){return respondWithRpcPromise(_0x6d6d('0x53'),_0x5dd3b0[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](findById(_0x5dd3b0[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x3cedc0,null))[_0x6d6d('0x18')](handleError(_0x3cedc0,null));};exports['faxQueues']=function(_0x3fa820,_0x4ec43e){return respondWithRpcPromise(_0x6d6d('0x55'),_0x3fa820[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x4ec43e,null))[_0x6d6d('0x18')](handleError(_0x4ec43e,null));};exports[_0x6d6d('0x56')]=function(_0x1d1d1d,_0x56feda){return respondWithRpcPromise(_0x6d6d('0x55'),_0x1d1d1d[_0x6d6d('0x1c')],routingClient)['then'](findById(_0x1d1d1d['params']['id']))[_0x6d6d('0x17')](respondWithResult(_0x56feda,null))['catch'](handleError(_0x56feda,null));};exports['faxAccounts']=function(_0x5b6ca7,_0x1e3b17){return respondWithRpcPromise(_0x6d6d('0x57'),_0x5b6ca7[_0x6d6d('0x1c')])[_0x6d6d('0x17')](respondWithResult(_0x1e3b17,null))[_0x6d6d('0x18')](handleError(_0x1e3b17,null));};exports[_0x6d6d('0x58')]=function(_0x4d4083,_0x48472d){return respondWithRpcPromise(_0x6d6d('0x59'),_0x4d4083['query'],routingClient)['then'](respondWithResult(_0x48472d,null))['catch'](handleError(_0x48472d,null));};exports[_0x6d6d('0x5a')]=function(_0x5cd494,_0x45a374){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x5cd494[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x45a374,null))['catch'](handleError(_0x45a374,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x167d0c,_0x202bf6){return respondWithRpcPromise(_0x6d6d('0x5b'),_0x167d0c[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0x202bf6,null))[_0x6d6d('0x18')](handleError(_0x202bf6,null));};exports[_0x6d6d('0x5c')]=function(_0x1fb21d,_0x2b53eb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1fb21d[_0x6d6d('0x1c')],routingClient)['then'](function(_0x4b6594){if(_0x1fb21d['query'][_0x6d6d('0x5d')]!==undefined){var _0x5bcfbd=_(_0x4b6594[_0x6d6d('0x14')])[_0x6d6d('0x5e')]([_0x1fb21d[_0x6d6d('0x1c')]['type'],_0x1fb21d['params']['id']])[_0x6d6d('0x5f')](_0x6d6d('0x60'))['uniq']()['value']();return _0x4b6594[_0x6d6d('0x14')][_0x6d6d('0x5e')](function(_0x14feba){return _0x5bcfbd[_0x6d6d('0x61')](_0x14feba[_0x6d6d('0x60')])>-0x1;});}else{return _0x4b6594[_0x6d6d('0x14')][_0x6d6d('0x5e')](function(_0x52f758){return _0x52f758['queue_id']===parseInt(_0x1fb21d['params']['id']);});}})['then'](respondWithResult(_0x2b53eb,null))['catch'](handleError(_0x2b53eb,null));};exports['smsQueuesWaitingInteractions']=function(_0x87dd34,_0x21e5a8){return respondWithRpcPromise(_0x6d6d('0x62'),_0x87dd34[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0x21e5a8,null))['catch'](handleError(_0x21e5a8,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x39b34e,_0xfbad7a){return respondWithRpcPromise(_0x6d6d('0x63'),_0x39b34e[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0xfbad7a,null))['catch'](handleError(_0xfbad7a,null));};exports[_0x6d6d('0x64')]=function(_0x1e1c4e,_0x478ed4){return respondWithRpcPromise(_0x6d6d('0x65'),_0x1e1c4e[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x478ed4,null))[_0x6d6d('0x18')](handleError(_0x478ed4,null));};exports[_0x6d6d('0x66')]=function(_0x581027){return function(_0xf5586f,_0x50eea6){var _0x39f986,_0x5885c5;var _0x108108=_['capitalize'](_0x581027);var _0x445196=_0x581027===_0x6d6d('0x67')?_0x6d6d('0x68'):_0x6d6d('0x69');return db[_0x108108+_0x6d6d('0x6a')][_0x6d6d('0x6b')]({'raw':!![],'where':{'id':_0xf5586f[_0x6d6d('0x1d')]['id']}})[_0x6d6d('0x17')](function(_0x139a7){if(_[_0x6d6d('0x12')](_0x139a7)){throw new Error(_0x108108+_0x6d6d('0x6c'));}_0x39f986=_0x139a7;return db[_0x108108+_0x6d6d('0x6d')][_0x6d6d('0x6b')]({'where':{'id':_0xf5586f[_0x6d6d('0x24')][_0x6d6d('0x6e')]},'include':[{'model':db[_0x108108+_0x6d6d('0x6f')],'as':'Interaction'},{'model':db[_0x108108+_0x445196],'as':'Account'}]});})[_0x6d6d('0x17')](function(_0x5a7b23){if(_[_0x6d6d('0x12')](_0x5a7b23)){throw new Error(_0x108108+_0x6d6d('0x70'));}_0x5885c5=_0x5a7b23;return _0x5a7b23['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1d2668={'uniqueid':_0x581027+'.'+_0x5885c5['id']+'.'+_0x5885c5['Interaction']['id'],'FromUserId':_0xf5586f[_0x6d6d('0x35')]['id'],'type':_0x6d6d('0x71')};_0x1d2668[_0x108108+_0x6d6d('0x72')]=_0x5885c5['id'];_0x1d2668[_0x108108+_0x6d6d('0x73')]=_0x5885c5[_0x6d6d('0x6f')]['id'];_0x1d2668[_0x6d6d('0x74')+_0x108108+_0x445196+'Id']=_0x5885c5[_0x6d6d('0x69')]['id'];_0x1d2668['To'+_0x108108+_0x6d6d('0x75')]=_0x39f986['id'];return db[_0x108108+'TransferReport'][_0x6d6d('0x76')](_0x1d2668);})[_0x6d6d('0x17')](function(){return respondWithRpcPromise(_0x6d6d('0x77'),{'channel':_0x581027,'interaction':_0x5885c5['Interaction'],'message':_0x5885c5,'account':_0x5885c5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x6d6d('0x71'),'appdata':_0x39f986[_0x6d6d('0x10')]+','+(_0x5885c5[_0x6d6d('0x69')]['queueTransferTimeout']||0x12c),'interval':_0x6d6d('0x78')}]},routingClient);})[_0x6d6d('0x17')](respondWithResult(_0x50eea6,null))['catch'](handleError(_0x50eea6,null));};};exports[_0x6d6d('0x79')]=function(_0x721d98,_0xa8ec98){var _0x155edb,_0x21057d;if(_['isNil'](_0x721d98[_0x6d6d('0x24')][_0x6d6d('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x56825d=_0x721d98[_0x6d6d('0x24')][_0x6d6d('0x7a')];var _0xe80727=_[_0x6d6d('0x7b')](_0x56825d);var _0x5a8974=_0x56825d===_0x6d6d('0x67')?'Website':_0x6d6d('0x69');return db[_0x6d6d('0x7c')][_0x6d6d('0x6b')]({'raw':!![],'where':{'id':_0x721d98[_0x6d6d('0x1d')]['id'],'role':_0x6d6d('0x40')}})[_0x6d6d('0x17')](function(_0x39c1a5){if(_[_0x6d6d('0x12')](_0x39c1a5)){throw new Error(_0x6d6d('0x7d'));}_0x155edb=_0x39c1a5;return db[_0xe80727+_0x6d6d('0x6d')][_0x6d6d('0x6b')]({'where':{'id':_0x721d98[_0x6d6d('0x24')][_0x6d6d('0x6e')]},'include':[{'model':db[_0xe80727+_0x6d6d('0x6f')],'as':_0x6d6d('0x6f')},{'model':db[_0xe80727+_0x5a8974],'as':_0x6d6d('0x69')}]});})[_0x6d6d('0x17')](function(_0xccbc07){if(_[_0x6d6d('0x12')](_0xccbc07)){throw new Error(_0xe80727+_0x6d6d('0x70'));}_0x21057d=_0xccbc07;return _0xccbc07['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3445f5={'uniqueid':_0x56825d+'.'+_0x21057d['id']+'.'+_0x21057d[_0x6d6d('0x6f')]['id'],'FromUserId':_0x721d98[_0x6d6d('0x35')]['id'],'type':_0x6d6d('0x71'),'ToUserId':_0x155edb['id']};_0x3445f5[_0xe80727+_0x6d6d('0x72')]=_0x21057d['id'];_0x3445f5[_0xe80727+_0x6d6d('0x73')]=_0x21057d[_0x6d6d('0x6f')]['id'];_0x3445f5[_0x6d6d('0x74')+_0xe80727+_0x5a8974+'Id']=_0x21057d[_0x6d6d('0x69')]['id'];return db[_0xe80727+_0x6d6d('0x7e')][_0x6d6d('0x76')](_0x3445f5);})[_0x6d6d('0x17')](function(){return respondWithRpcPromise(_0x6d6d('0x77'),{'channel':_0x56825d,'interaction':_0x21057d[_0x6d6d('0x6f')],'message':_0x21057d,'account':_0x21057d[_0x6d6d('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x155edb[_0x6d6d('0x10')]+','+(_0x21057d[_0x6d6d('0x69')][_0x6d6d('0x7f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0xa8ec98,null))['catch'](handleError(_0xa8ec98,null));}; \ No newline at end of file +var _0x5fd1=['findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise','client','http','then','error','message','result','catch','status','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes'];(function(_0x5a12ff,_0x2e18db){var _0x285f8d=function(_0x431de4){while(--_0x431de4){_0x5a12ff['push'](_0x5a12ff['shift']());}};_0x285f8d(++_0x2e18db);}(_0x5fd1,0x155));var _0x15fd=function(_0x208aa6,_0x67e085){_0x208aa6=_0x208aa6-0x0;var _0xd7bf3=_0x5fd1[_0x208aa6];return _0xd7bf3;};'use strict';var BPromise=require(_0x15fd('0x0'));var moment=require('moment');var _=require(_0x15fd('0x1'));var util=require(_0x15fd('0x2'));var db=require(_0x15fd('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x15fd('0x4'));var amiClient=jayson[_0x15fd('0x5')][_0x15fd('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x15fd('0x6')]({'port':0x232b});var routingClient=jayson[_0x15fd('0x5')][_0x15fd('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){var _0x19806f=_0x534e63?_0x534e63:amiClient;return _0x19806f['request'](_0x2e88bf,_0x225728)[_0x15fd('0x7')](function(_0x5c9c63){if(_0x5c9c63[_0x15fd('0x8')]){if(_0x5c9c63[_0x15fd('0x8')]['code']===0x1f4){return _0x1ee117(_0x5c9c63['error']['message']);}return _0x210e90(_0x5c9c63[_0x15fd('0x8')][_0x15fd('0x9')]);}else{_0x210e90(_0x5c9c63[_0x15fd('0xa')]);}})[_0x15fd('0xb')](function(_0x311138){_0x1ee117(_0x311138);});});}function respondWithResult(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xc8;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0xc')](_0x346ab1)['json'](_0x2660db);}return _0x2e18ec['sendStatus'](0x194);};}function handleError(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0x1f4;return function(_0x135a15){logger[_0x15fd('0x8')](_0x135a15[_0x15fd('0xd')]);if(_0x135a15[_0x15fd('0xe')]){delete _0x135a15[_0x15fd('0xe')];}_0x5784a3[_0x15fd('0xc')](_0x3fda60)[_0x15fd('0xf')](_0x135a15);};}function findById(_0x5aae13){return function(_0x4c7080){if(!_[_0x15fd('0x10')](_0x5aae13)&&!_['isNil'](_0x4c7080)&&!_[_0x15fd('0x10')](_0x4c7080['rows'])){return _[_0x15fd('0x11')](_0x4c7080[_0x15fd('0x12')],function(_0x855bae){return _0x855bae['id']==_0x5aae13;});}return null;};}exports['voiceChannels']=function(_0x367c36,_0x2ad0de){return respondWithRpcPromise(_0x15fd('0x13'),_0x367c36[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x2ad0de,null))[_0x15fd('0xb')](handleError(_0x2ad0de,null));};exports[_0x15fd('0x15')]=function(_0x2f46f1,_0x1b8b9f){return respondWithRpcPromise(_0x15fd('0x16'),_[_0x15fd('0x17')](_0x2f46f1['query'],_0x2f46f1['params']))[_0x15fd('0x7')](respondWithResult(_0x1b8b9f,null))[_0x15fd('0xb')](handleError(_0x1b8b9f,null));};exports[_0x15fd('0x18')]=function(_0x118a2b,_0x24bdaf){return respondWithRpcPromise(_0x15fd('0x19'),_[_0x15fd('0x17')](_0x118a2b['query'],_0x118a2b[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x24bdaf,null))[_0x15fd('0xb')](handleError(_0x24bdaf,null));};exports['voiceQueues']=function(_0x27528f,_0x49062f){return respondWithRpcPromise(_0x15fd('0x1b'),_0x27528f[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x49062f,null))['catch'](handleError(_0x49062f,null));};exports[_0x15fd('0x1c')]=function(_0x1cbf2c,_0x24c541){return respondWithRpcPromise('VoiceQueues',_0x1cbf2c[_0x15fd('0x14')])['then'](findById(_0x1cbf2c[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x24c541,null))[_0x15fd('0xb')](handleError(_0x24c541,null));};exports[_0x15fd('0x1d')]=function(_0x233ed3,_0x6c213b){return respondWithRpcPromise(_0x15fd('0x1e'),_[_0x15fd('0x17')](_0x233ed3[_0x15fd('0x1f')],_0x233ed3[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x6c213b,null))['catch'](handleError(_0x6c213b,null));};exports[_0x15fd('0x20')]=function(_0x2fe61e,_0x50381a){return respondWithRpcPromise(_0x15fd('0x21'),_[_0x15fd('0x17')](_0x2fe61e['query'],_0x2fe61e[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x50381a,null))['catch'](handleError(_0x50381a,null));};exports[_0x15fd('0x22')]=function(_0x199647,_0x582af2){return respondWithRpcPromise(_0x15fd('0x23'),_0x199647[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x582af2,null))['catch'](handleError(_0x582af2,null));};exports[_0x15fd('0x24')]=function(_0x7ac52b,_0x4228ea){return respondWithRpcPromise(_0x15fd('0x25'),_['merge'](_0x7ac52b[_0x15fd('0x14')],_0x7ac52b[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x4228ea,null))[_0x15fd('0xb')](handleError(_0x4228ea,null));};exports[_0x15fd('0x26')]=function(_0x296a0c,_0x4d9ff5){return respondWithRpcPromise(_0x15fd('0x27'),_[_0x15fd('0x17')](_0x296a0c['query'],_0x296a0c[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x4d9ff5,null))[_0x15fd('0xb')](handleError(_0x4d9ff5,null));};exports['voiceQueuesChannelRedirect']=function(_0x25d34e,_0x309851){return respondWithRpcPromise(_0x15fd('0x28'),_[_0x15fd('0x17')](_0x25d34e[_0x15fd('0x14')],_0x25d34e[_0x15fd('0x1a')]))['then'](respondWithResult(_0x309851,null))['catch'](handleError(_0x309851,null));};exports['outbound']=function(_0x340d17,_0x289710){return respondWithRpcPromise(_0x15fd('0x29'),_0x340d17['query'])['then'](respondWithResult(_0x289710,null))[_0x15fd('0xb')](handleError(_0x289710,null));};exports['outboundChannels']=function(_0x4f1c84,_0x4c1aa8){return respondWithRpcPromise(_0x15fd('0x2a'),_0x4f1c84[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x4c1aa8,null))['catch'](handleError(_0x4c1aa8,null));};exports[_0x15fd('0x2b')]=function(_0x3a10e2,_0xd85d3e){var _0x5beb6e;return respondWithRpcPromise(_0x15fd('0x2c'),_0x3a10e2[_0x15fd('0x14')])[_0x15fd('0x7')](function(_0xe18038){_0x5beb6e=_0xe18038;return respondWithRpcPromise(_0x15fd('0x2c'),_0x3a10e2[_0x15fd('0x14')],routingClient);})[_0x15fd('0x7')](function(_0x12a894){return _[_0x15fd('0x17')]({},_0x12a894,_0x5beb6e);})['then'](respondWithResult(_0xd85d3e,null))[_0x15fd('0xb')](handleError(_0xd85d3e,null));};exports[_0x15fd('0x2d')]=function(_0x180433,_0x304736){if(_0x180433[_0x15fd('0x1f')]&&_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]&&_0x180433[_0x15fd('0x2f')]&&_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')]){for(var _0x2eb6b6 in _0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]){if(_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]['hasOwnProperty'](_0x2eb6b6)){db[_0x15fd('0x30')][_0x15fd('0x31')]({'where':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'type':_0x15fd('0x32'),'exitAt':null,'uniqueid':_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6]&&_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6]['length']?{'$notIn':_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6]}:{'$ne':null}}})[_0x15fd('0x7')](function(_0x2741d4){var _0x5e4b62=moment()[_0x15fd('0x33')](_0x15fd('0x34'));for(var _0x131eb4=0x0,_0x2611ba=_0x2741d4[_0x15fd('0x35')];_0x131eb4<_0x2611ba;_0x131eb4+=0x1){_0x2741d4[_0x131eb4][_0x15fd('0x36')]({'exitAt':_0x5e4b62});}});for(var _0x494f83=0x0;_0x494f83<_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6][_0x15fd('0x35')];_0x494f83+=0x1){db[_0x15fd('0x30')][_0x15fd('0x37')]({'where':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'type':_0x15fd('0x32'),'uniqueid':_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6][_0x494f83],'exitAt':null},'defaults':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'interface':_['isNil'](_0x180433[_0x15fd('0x2f')]['interface'])?util[_0x15fd('0x33')](_0x15fd('0x38'),_0x180433[_0x15fd('0x2f')]['name']):_0x180433[_0x15fd('0x2f')][_0x15fd('0x39')],'type':_0x15fd('0x32'),'enterAt':moment()[_0x15fd('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x15fd('0x3a'),'internal':_0x180433[_0x15fd('0x2f')][_0x15fd('0x3b')],'uniqueid':_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6][_0x494f83]}});}}}}return respondWithRpcPromise(_0x15fd('0x3c'),{'id':_0x180433[_0x15fd('0x1a')]['id'],'capacity':_0x180433['body']['capacity']},routingClient)['then'](respondWithResult(_0x304736,null))[_0x15fd('0xb')](handleError(_0x304736,null));};exports[_0x15fd('0x3d')]=function(_0x366c49,_0x10cf04){return respondWithRpcPromise(_0x15fd('0x3e'),_0x366c49[_0x15fd('0x14')])['then'](respondWithResult(_0x10cf04,null))[_0x15fd('0xb')](handleError(_0x10cf04,null));};exports[_0x15fd('0x3f')]=function(_0xbb16ef,_0x516b25){return respondWithRpcPromise(_0x15fd('0x40'),_0xbb16ef['query'])[_0x15fd('0x7')](respondWithResult(_0x516b25,null))[_0x15fd('0xb')](handleError(_0x516b25,null));};exports[_0x15fd('0x41')]=function(_0x42d4de,_0x332df7){return respondWithRpcPromise(_0x15fd('0x42'),_0x42d4de[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x332df7,null))[_0x15fd('0xb')](handleError(_0x332df7,null));};exports[_0x15fd('0x43')]=function(_0x1491a3,_0x36eaf7){return respondWithRpcPromise(_0x15fd('0x44'),_0x1491a3['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x36eaf7,null))['catch'](handleError(_0x36eaf7,null));};exports[_0x15fd('0x45')]=function(_0x509aef,_0x25bdea){return respondWithRpcPromise(_0x15fd('0x44'),_0x509aef[_0x15fd('0x14')],routingClient)['then'](findById(_0x509aef['params']['id']))[_0x15fd('0x7')](respondWithResult(_0x25bdea,null))[_0x15fd('0xb')](handleError(_0x25bdea,null));};exports[_0x15fd('0x46')]=function(_0x30ab06,_0x5d94b3){return respondWithRpcPromise(_0x15fd('0x47'),_0x30ab06[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x5d94b3,null))[_0x15fd('0xb')](handleError(_0x5d94b3,null));};exports[_0x15fd('0x48')]=function(_0x321fe7,_0x59b3b4){return respondWithRpcPromise(_0x15fd('0x47'),_0x321fe7[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x321fe7[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x59b3b4,null))[_0x15fd('0xb')](handleError(_0x59b3b4,null));};exports['mailAccounts']=function(_0x4f2a17,_0x149b20){return respondWithRpcPromise(_0x15fd('0x49'),_0x4f2a17['query'],mailClient)[_0x15fd('0x7')](respondWithResult(_0x149b20,null))[_0x15fd('0xb')](handleError(_0x149b20,null));};exports['openchannelQueues']=function(_0x285fd5,_0x4626ac){return respondWithRpcPromise(_0x15fd('0x4a'),_0x285fd5['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x4626ac,null))[_0x15fd('0xb')](handleError(_0x4626ac,null));};exports[_0x15fd('0x4b')]=function(_0x2db860,_0xa206b){return respondWithRpcPromise(_0x15fd('0x4a'),_0x2db860[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x2db860[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0xa206b,null))['catch'](handleError(_0xa206b,null));};exports[_0x15fd('0x4c')]=function(_0x3a26c8,_0x5b720b){return respondWithRpcPromise('SmsQueues',_0x3a26c8[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x5b720b,null))[_0x15fd('0xb')](handleError(_0x5b720b,null));};exports[_0x15fd('0x4d')]=function(_0x12fd6c,_0x1b6f59){return respondWithRpcPromise('SmsQueues',_0x12fd6c[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x12fd6c[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x1b6f59,null))[_0x15fd('0xb')](handleError(_0x1b6f59,null));};exports[_0x15fd('0x4e')]=function(_0xf27ab4,_0x1fe6cb){return respondWithRpcPromise(_0x15fd('0x4f'),_0xf27ab4[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x1fe6cb,null))['catch'](handleError(_0x1fe6cb,null));};exports['showWhatsappQueues']=function(_0x8a8198,_0x24ea9b){return respondWithRpcPromise(_0x15fd('0x4f'),_0x8a8198[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x8a8198[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x24ea9b,null))['catch'](handleError(_0x24ea9b,null));};exports[_0x15fd('0x50')]=function(_0x5de222,_0xc8931e){return respondWithRpcPromise('FaxQueues',_0x5de222[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0xc8931e,null))[_0x15fd('0xb')](handleError(_0xc8931e,null));};exports[_0x15fd('0x51')]=function(_0x4390bc,_0x3d40f3){return respondWithRpcPromise(_0x15fd('0x52'),_0x4390bc[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x4390bc[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x3d40f3,null))['catch'](handleError(_0x3d40f3,null));};exports['faxAccounts']=function(_0x1ca245,_0x239a06){return respondWithRpcPromise(_0x15fd('0x53'),_0x1ca245['query'])[_0x15fd('0x7')](respondWithResult(_0x239a06,null))[_0x15fd('0xb')](handleError(_0x239a06,null));};exports[_0x15fd('0x54')]=function(_0x56cf8c,_0x3bf85b){return respondWithRpcPromise(_0x15fd('0x55'),_0x56cf8c['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x3bf85b,null))['catch'](handleError(_0x3bf85b,null));};exports[_0x15fd('0x56')]=function(_0x40a8e9,_0x74f311){return respondWithRpcPromise(_0x15fd('0x57'),_0x40a8e9[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x74f311,null))[_0x15fd('0xb')](handleError(_0x74f311,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x3c4ffa,_0x4a165f){return respondWithRpcPromise(_0x15fd('0x58'),_0x3c4ffa[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x4a165f,null))[_0x15fd('0xb')](handleError(_0x4a165f,null));};exports[_0x15fd('0x59')]=function(_0x47f39a,_0x484cd1){return respondWithRpcPromise(_0x15fd('0x58'),_0x47f39a['query'],routingClient)[_0x15fd('0x7')](function(_0x2feba1){if(_0x47f39a[_0x15fd('0x14')][_0x15fd('0x5a')]!==undefined){var _0x2d1c93=_(_0x2feba1['rows'])[_0x15fd('0x5b')]([_0x47f39a[_0x15fd('0x14')]['type'],_0x47f39a[_0x15fd('0x1a')]['id']])[_0x15fd('0x5c')](_0x15fd('0x5d'))[_0x15fd('0x5e')]()[_0x15fd('0x5f')]();return _0x2feba1[_0x15fd('0x12')][_0x15fd('0x5b')](function(_0x39b777){return _0x2d1c93[_0x15fd('0x60')](_0x39b777[_0x15fd('0x5d')])>-0x1;});}else{return _0x2feba1[_0x15fd('0x12')][_0x15fd('0x5b')](function(_0x273311){return _0x273311[_0x15fd('0x5d')]===parseInt(_0x47f39a['params']['id']);});}})[_0x15fd('0x7')](respondWithResult(_0x484cd1,null))['catch'](handleError(_0x484cd1,null));};exports[_0x15fd('0x61')]=function(_0x43d0b0,_0x3bfa0b){return respondWithRpcPromise(_0x15fd('0x62'),_0x43d0b0['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x3bfa0b,null))[_0x15fd('0xb')](handleError(_0x3bfa0b,null));};exports[_0x15fd('0x63')]=function(_0x873778,_0x4accfd){return respondWithRpcPromise(_0x15fd('0x64'),_0x873778[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x4accfd,null))[_0x15fd('0xb')](handleError(_0x4accfd,null));};exports[_0x15fd('0x65')]=function(_0x128ee3,_0x57089a){return respondWithRpcPromise(_0x15fd('0x66'),_0x128ee3[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x57089a,null))[_0x15fd('0xb')](handleError(_0x57089a,null));};exports[_0x15fd('0x67')]=function(_0x2d24a2){return function(_0x4e36c0,_0x2b7737){var _0x15a645,_0x32a2a0;var _0x3bd3fb=_[_0x15fd('0x68')](_0x2d24a2);var _0x55e9dd=_0x2d24a2===_0x15fd('0x69')?_0x15fd('0x6a'):_0x15fd('0x6b');return db[_0x3bd3fb+_0x15fd('0x6c')][_0x15fd('0x6d')]({'raw':!![],'where':{'id':_0x4e36c0['params']['id']}})['then'](function(_0x3017c6){if(_[_0x15fd('0x10')](_0x3017c6)){throw new Error(_0x3bd3fb+_0x15fd('0x6e'));}_0x15a645=_0x3017c6;return db[_0x3bd3fb+_0x15fd('0x6f')][_0x15fd('0x6d')]({'where':{'id':_0x4e36c0[_0x15fd('0x1f')][_0x15fd('0x70')]},'include':[{'model':db[_0x3bd3fb+_0x15fd('0x71')],'as':_0x15fd('0x71')},{'model':db[_0x3bd3fb+_0x55e9dd],'as':'Account'}]});})[_0x15fd('0x7')](function(_0x23d547){if(_['isNil'](_0x23d547)){throw new Error(_0x3bd3fb+_0x15fd('0x72'));}_0x32a2a0=_0x23d547;return _0x23d547[_0x15fd('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x15fd('0x7')](function(){var _0x35ad47={'uniqueid':_0x2d24a2+'.'+_0x32a2a0['id']+'.'+_0x32a2a0['Interaction']['id'],'FromUserId':_0x4e36c0[_0x15fd('0x2f')]['id'],'type':_0x15fd('0x74')};_0x35ad47[_0x3bd3fb+'MessageId']=_0x32a2a0['id'];_0x35ad47[_0x3bd3fb+_0x15fd('0x75')]=_0x32a2a0[_0x15fd('0x71')]['id'];_0x35ad47[_0x15fd('0x76')+_0x3bd3fb+_0x55e9dd+'Id']=_0x32a2a0['Account']['id'];_0x35ad47['To'+_0x3bd3fb+_0x15fd('0x77')]=_0x15a645['id'];return db[_0x3bd3fb+_0x15fd('0x78')][_0x15fd('0x79')](_0x35ad47);})[_0x15fd('0x7')](function(){return respondWithRpcPromise(_0x15fd('0x7a'),{'channel':_0x2d24a2,'interaction':_0x32a2a0[_0x15fd('0x71')],'message':_0x32a2a0,'account':_0x32a2a0[_0x15fd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x15fd('0x74'),'appdata':_0x15a645['name']+','+(_0x32a2a0[_0x15fd('0x6b')][_0x15fd('0x7b')]||0x12c),'interval':_0x15fd('0x7c')}]},routingClient);})[_0x15fd('0x7')](respondWithResult(_0x2b7737,null))[_0x15fd('0xb')](handleError(_0x2b7737,null));};};exports[_0x15fd('0x7d')]=function(_0x3ebb13,_0x939bfd){var _0x3a4731,_0x264a98;if(_[_0x15fd('0x10')](_0x3ebb13[_0x15fd('0x1f')][_0x15fd('0x7e')])){throw new Error(_0x15fd('0x7f'));}var _0x4221df=_0x3ebb13[_0x15fd('0x1f')][_0x15fd('0x7e')];var _0x255dd5=_[_0x15fd('0x68')](_0x4221df);var _0x178dac=_0x4221df===_0x15fd('0x69')?_0x15fd('0x6a'):_0x15fd('0x6b');return db[_0x15fd('0x80')][_0x15fd('0x6d')]({'raw':!![],'where':{'id':_0x3ebb13[_0x15fd('0x1a')]['id'],'role':'agent'}})[_0x15fd('0x7')](function(_0x39e232){if(_['isNil'](_0x39e232)){throw new Error(_0x15fd('0x81'));}_0x3a4731=_0x39e232;return db[_0x255dd5+_0x15fd('0x6f')][_0x15fd('0x6d')]({'where':{'id':_0x3ebb13[_0x15fd('0x1f')]['messageId']},'include':[{'model':db[_0x255dd5+'Interaction'],'as':_0x15fd('0x71')},{'model':db[_0x255dd5+_0x178dac],'as':'Account'}]});})[_0x15fd('0x7')](function(_0x3e47fe){if(_[_0x15fd('0x10')](_0x3e47fe)){throw new Error(_0x255dd5+_0x15fd('0x72'));}_0x264a98=_0x3e47fe;return _0x3e47fe[_0x15fd('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x15fd('0x7')](function(){var _0x1bd38c={'uniqueid':_0x4221df+'.'+_0x264a98['id']+'.'+_0x264a98['Interaction']['id'],'FromUserId':_0x3ebb13['user']['id'],'type':_0x15fd('0x74'),'ToUserId':_0x3a4731['id']};_0x1bd38c[_0x255dd5+_0x15fd('0x82')]=_0x264a98['id'];_0x1bd38c[_0x255dd5+_0x15fd('0x75')]=_0x264a98[_0x15fd('0x71')]['id'];_0x1bd38c[_0x15fd('0x76')+_0x255dd5+_0x178dac+'Id']=_0x264a98[_0x15fd('0x6b')]['id'];return db[_0x255dd5+'TransferReport']['create'](_0x1bd38c);})[_0x15fd('0x7')](function(){return respondWithRpcPromise(_0x15fd('0x7a'),{'channel':_0x4221df,'interaction':_0x264a98[_0x15fd('0x71')],'message':_0x264a98,'account':_0x264a98[_0x15fd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x15fd('0x3a'),'appdata':_0x3a4731[_0x15fd('0xe')]+','+(_0x264a98['Account'][_0x15fd('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x15fd('0x7')](respondWithResult(_0x939bfd,null))[_0x15fd('0xb')](handleError(_0x939bfd,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f55c350..9805324 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 _0xc5ab=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/run','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x142b3f,_0x3dd08d){var _0x2dfbe0=function(_0x3ba851){while(--_0x3ba851){_0x142b3f['push'](_0x142b3f['shift']());}};_0x2dfbe0(++_0x3dd08d);}(_0xc5ab,0x12e));var _0xbc5a=function(_0xe21603,_0x4d76c7){_0xe21603=_0xe21603-0x0;var _0x3bca95=_0xc5ab[_0xe21603];return _0x3bca95;};'use strict';var multer=require(_0xbc5a('0x0'));var util=require(_0xbc5a('0x1'));var path=require(_0xbc5a('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc5a('0x3'));var router=express['Router']();var fs_extra=require(_0xbc5a('0x4'));var auth=require(_0xbc5a('0x5'));var interaction=require(_0xbc5a('0x6'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0xbc5a('0x7')]('/',auth['isAuthenticated'](),controller[_0xbc5a('0x8')]);router[_0xbc5a('0x7')](_0xbc5a('0x9'),auth[_0xbc5a('0xa')](),controller['show']);router[_0xbc5a('0x7')](_0xbc5a('0xb'),auth[_0xbc5a('0xa')](),controller['run']);router[_0xbc5a('0xc')]('/',auth[_0xbc5a('0xa')](),controller[_0xbc5a('0xd')]);router[_0xbc5a('0xe')](_0xbc5a('0x9'),auth[_0xbc5a('0xa')](),controller[_0xbc5a('0xf')]);router[_0xbc5a('0x10')](_0xbc5a('0x9'),auth['isAuthenticated'](),controller[_0xbc5a('0x11')]);module[_0xbc5a('0x12')]=router; \ No newline at end of file +var _0xac7d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','put','destroy','exports','util','path','connect-timeout'];(function(_0x5815e8,_0x5183c1){var _0x30fbb1=function(_0x3066d2){while(--_0x3066d2){_0x5815e8['push'](_0x5815e8['shift']());}};_0x30fbb1(++_0x5183c1);}(_0xac7d,0x18d));var _0xdac7=function(_0x6a84b,_0x5570a7){_0x6a84b=_0x6a84b-0x0;var _0x55b6eb=_0xac7d[_0x6a84b];return _0x55b6eb;};'use strict';var multer=require('multer');var util=require(_0xdac7('0x0'));var path=require(_0xdac7('0x1'));var timeout=require(_0xdac7('0x2'));var express=require(_0xdac7('0x3'));var router=express[_0xdac7('0x4')]();var fs_extra=require(_0xdac7('0x5'));var auth=require(_0xdac7('0x6'));var interaction=require(_0xdac7('0x7'));var config=require(_0xdac7('0x8'));var controller=require(_0xdac7('0x9'));router[_0xdac7('0xa')]('/',auth[_0xdac7('0xb')](),controller[_0xdac7('0xc')]);router[_0xdac7('0xa')](_0xdac7('0xd'),auth[_0xdac7('0xb')](),controller[_0xdac7('0xe')]);router[_0xdac7('0xa')](_0xdac7('0xf'),auth[_0xdac7('0xb')](),controller[_0xdac7('0x10')]);router['post']('/',auth[_0xdac7('0xb')](),controller['create']);router[_0xdac7('0x11')](_0xdac7('0xd'),auth[_0xdac7('0xb')](),controller['update']);router['delete']('/:id',auth[_0xdac7('0xb')](),controller[_0xdac7('0x12')]);module[_0xdac7('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index e9d4a09..8cac164 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 _0x4f3e=['custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','years','months','days','hours','minutes','ENUM','pdf','xlsx','default'];(function(_0x3624b5,_0x1c37bc){var _0x4362d9=function(_0x1cf263){while(--_0x1cf263){_0x3624b5['push'](_0x3624b5['shift']());}};_0x4362d9(++_0x1c37bc);}(_0x4f3e,0x82));var _0xe4f3=function(_0x352e3f,_0xed658f){_0x352e3f=_0x352e3f-0x0;var _0x32c146=_0x4f3e[_0x352e3f];return _0x32c146;};'use strict';var Sequelize=require('sequelize');module[_0xe4f3('0x0')]={'name':{'type':Sequelize[_0xe4f3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe4f3('0x1')]},'active':{'type':Sequelize[_0xe4f3('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe4f3('0x1')],'allowNull':![],'defaultValue':_0xe4f3('0x3')},'startAt':{'type':Sequelize[_0xe4f3('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xe4f3('0x5'),'quarters',_0xe4f3('0x6'),'weeks',_0xe4f3('0x7'),_0xe4f3('0x8'),_0xe4f3('0x9')),'allowNull':![],'defaultValue':_0xe4f3('0x7')},'output':{'type':Sequelize[_0xe4f3('0xa')]('csv',_0xe4f3('0xb'),_0xe4f3('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xe4f3('0xa')]('custom',_0xe4f3('0xd')),'allowNull':![],'defaultValue':_0xe4f3('0xe')},'sendMail':{'type':Sequelize[_0xe4f3('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe4f3('0x1')]},'cc':{'type':Sequelize[_0xe4f3('0xf')]},'bcc':{'type':Sequelize[_0xe4f3('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xe4f3('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x38a8=['minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours'];(function(_0x491ea8,_0xa60dba){var _0x1b33b2=function(_0x17244f){while(--_0x17244f){_0x491ea8['push'](_0x491ea8['shift']());}};_0x1b33b2(++_0xa60dba);}(_0x38a8,0x181));var _0x838a=function(_0x255be9,_0x3345d9){_0x255be9=_0x255be9-0x0;var _0x34fedf=_0x38a8[_0x255be9];return _0x34fedf;};'use strict';var Sequelize=require(_0x838a('0x0'));module[_0x838a('0x1')]={'name':{'type':Sequelize[_0x838a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x838a('0x2')]},'active':{'type':Sequelize[_0x838a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x838a('0x2')],'allowNull':![],'defaultValue':_0x838a('0x4')},'startAt':{'type':Sequelize[_0x838a('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x838a('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x838a('0x7')](_0x838a('0x8'),_0x838a('0x9'),_0x838a('0xa'),_0x838a('0xb'),_0x838a('0xc'),_0x838a('0xd'),_0x838a('0xe')),'allowNull':![],'defaultValue':_0x838a('0xc')},'output':{'type':Sequelize[_0x838a('0x7')](_0x838a('0xf'),_0x838a('0x10'),_0x838a('0x11')),'allowNull':![],'defaultValue':_0x838a('0xf')},'type':{'type':Sequelize[_0x838a('0x7')](_0x838a('0x12'),_0x838a('0x13')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x838a('0x2')]},'cc':{'type':Sequelize[_0x838a('0x14')]},'bcc':{'type':Sequelize[_0x838a('0x14')]},'sendIfEmpty':{'type':Sequelize[_0x838a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 596aa2b..c254843 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 _0x2b42=['undefined','limit','count','apply','reject','save','destroy','Scheduler','UserProfileResource','then','end','error','name','index','map','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','Schedule','findAll','rows','show','params','includeAll','find','catch','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x2b42,0x8e));var _0x22b4=function(_0x2dc5b7,_0x3837ba){_0x2dc5b7=_0x2dc5b7-0x0;var _0x4edb5b=_0x2b42[_0x2dc5b7];return _0x4edb5b;};'use strict';var emlformat=require(_0x22b4('0x0'));var rimraf=require(_0x22b4('0x1'));var zipdir=require(_0x22b4('0x2'));var jsonpatch=require(_0x22b4('0x3'));var rp=require(_0x22b4('0x4'));var moment=require(_0x22b4('0x5'));var BPromise=require(_0x22b4('0x6'));var Mustache=require(_0x22b4('0x7'));var util=require(_0x22b4('0x8'));var path=require(_0x22b4('0x9'));var sox=require('sox');var csv=require(_0x22b4('0xa'));var ejs=require(_0x22b4('0xb'));var fs=require('fs');var fs_extra=require(_0x22b4('0xc'));var _=require(_0x22b4('0xd'));var squel=require('squel');var crypto=require(_0x22b4('0xe'));var jsforce=require(_0x22b4('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x22b4('0x10'));var Redis=require('ioredis');var authService=require(_0x22b4('0x11'));var qs=require(_0x22b4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22b4('0x13'));var logger=require(_0x22b4('0x14'))(_0x22b4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x22b4('0x16'));var db=require(_0x22b4('0x17'))['db'];function respondWithStatusCode(_0x44f1d3,_0x5c4e49){_0x5c4e49=_0x5c4e49||0xcc;return function(_0x4db115){if(_0x4db115){return _0x44f1d3[_0x22b4('0x18')](_0x5c4e49);}return _0x44f1d3[_0x22b4('0x19')](_0x5c4e49)['end']();};}function respondWithResult(_0x2aa675,_0x3e4897){_0x3e4897=_0x3e4897||0xc8;return function(_0x628ffd){if(_0x628ffd){return _0x2aa675[_0x22b4('0x19')](_0x3e4897)[_0x22b4('0x1a')](_0x628ffd);}};}function respondWithFilteredResult(_0x45e7cb,_0x59a05b){return function(_0x31d5c8){if(_0x31d5c8){var _0x218d68=typeof _0x59a05b[_0x22b4('0x1b')]===_0x22b4('0x1c')&&typeof _0x59a05b[_0x22b4('0x1d')]===_0x22b4('0x1c');var _0x423b17=_0x31d5c8[_0x22b4('0x1e')];var _0x591b00=_0x218d68?0x0:_0x59a05b[_0x22b4('0x1b')];var _0x5c859d=_0x218d68?_0x31d5c8['count']:_0x59a05b[_0x22b4('0x1b')]+_0x59a05b[_0x22b4('0x1d')];var _0x1a5dc0;if(_0x5c859d>=_0x423b17){_0x5c859d=_0x423b17;_0x1a5dc0=0xc8;}else{_0x1a5dc0=0xce;}_0x45e7cb[_0x22b4('0x19')](_0x1a5dc0);return _0x45e7cb['set']('Content-Range',_0x591b00+'-'+_0x5c859d+'/'+_0x423b17)[_0x22b4('0x1a')](_0x31d5c8);}return null;};}function patchUpdates(_0x59e670){return function(_0x484447){try{jsonpatch[_0x22b4('0x1f')](_0x484447,_0x59e670,!![]);}catch(_0x143e53){return BPromise[_0x22b4('0x20')](_0x143e53);}return _0x484447[_0x22b4('0x21')]();};}function saveUpdates(_0x45cad6,_0x4eec23){return function(_0x56c706){if(_0x56c706){return _0x56c706['update'](_0x45cad6)['then'](function(_0x48a7ba){return _0x48a7ba;});}return null;};}function removeEntity(_0x682570,_0x300f47){return function(_0x33cd3f){if(_0x33cd3f){return _0x33cd3f[_0x22b4('0x22')]()['then'](function(){var _0x14223c=_0x33cd3f['get']({'plain':!![]});var _0xfaa8b6=_0x22b4('0x23');return db[_0x22b4('0x24')]['destroy']({'where':{'type':_0xfaa8b6,'resourceId':_0x14223c['id']}})['then'](function(){return _0x33cd3f;});})[_0x22b4('0x25')](function(){_0x682570[_0x22b4('0x19')](0xcc)[_0x22b4('0x26')]();});}};}function handleEntityNotFound(_0x31038f,_0x1a895f){return function(_0x46b1c5){if(!_0x46b1c5){_0x31038f[_0x22b4('0x18')](0x194);}return _0x46b1c5;};}function handleError(_0x11abe8,_0x11cf75){_0x11cf75=_0x11cf75||0x1f4;return function(_0x5f2e07){logger[_0x22b4('0x27')](_0x5f2e07['stack']);if(_0x5f2e07['name']){delete _0x5f2e07[_0x22b4('0x28')];}_0x11abe8['status'](_0x11cf75)['send'](_0x5f2e07);};}exports[_0x22b4('0x29')]=function(_0x1ae20b,_0x7e2461){var _0x852dda={},_0xebedce={},_0xc20a97={'count':0x0,'rows':[]};var _0x1f2341=_[_0x22b4('0x2a')](db['Schedule'][_0x22b4('0x2b')],function(_0x2674ac){return{'name':_0x2674ac['fieldName'],'type':_0x2674ac[_0x22b4('0x2c')][_0x22b4('0x2d')]};});_0xebedce[_0x22b4('0x2e')]=_[_0x22b4('0x2a')](_0x1f2341,_0x22b4('0x28'));_0xebedce['query']=_[_0x22b4('0x2f')](_0x1ae20b['query']);_0xebedce['filters']=_[_0x22b4('0x30')](_0xebedce['model'],_0xebedce[_0x22b4('0x31')]);_0x852dda[_0x22b4('0x32')]=_[_0x22b4('0x30')](_0xebedce[_0x22b4('0x2e')],qs[_0x22b4('0x33')](_0x1ae20b['query']['fields']));_0x852dda[_0x22b4('0x32')]=_0x852dda[_0x22b4('0x32')][_0x22b4('0x34')]?_0x852dda[_0x22b4('0x32')]:_0xebedce[_0x22b4('0x2e')];if(!_0x1ae20b[_0x22b4('0x31')][_0x22b4('0x35')](_0x22b4('0x36'))){_0x852dda['limit']=qs[_0x22b4('0x1d')](_0x1ae20b[_0x22b4('0x31')][_0x22b4('0x1d')]);_0x852dda['offset']=qs[_0x22b4('0x1b')](_0x1ae20b['query'][_0x22b4('0x1b')]);}_0x852dda[_0x22b4('0x37')]=qs[_0x22b4('0x38')](_0x1ae20b[_0x22b4('0x31')][_0x22b4('0x38')]);_0x852dda['where']=qs[_0x22b4('0x39')](_[_0x22b4('0x3a')](_0x1ae20b[_0x22b4('0x31')],_0xebedce[_0x22b4('0x39')]),_0x1f2341);if(_0x1ae20b['query'][_0x22b4('0x3b')]){_0x852dda[_0x22b4('0x3c')]=_['merge'](_0x852dda[_0x22b4('0x3c')],{'$or':_['map'](_0x1f2341,function(_0x34cb73){if(_0x34cb73[_0x22b4('0x2c')]!==_0x22b4('0x3d')){var _0xcb0e6c={};_0xcb0e6c[_0x34cb73[_0x22b4('0x28')]]={'$like':'%'+_0x1ae20b[_0x22b4('0x31')][_0x22b4('0x3b')]+'%'};return _0xcb0e6c;}})});}_0x852dda=_[_0x22b4('0x3e')]({},_0x852dda,_0x1ae20b[_0x22b4('0x3f')]);var _0xb185d4={'where':_0x852dda[_0x22b4('0x3c')]};return db['Schedule'][_0x22b4('0x1e')](_0xb185d4)[_0x22b4('0x25')](function(_0x4e9a49){_0xc20a97[_0x22b4('0x1e')]=_0x4e9a49;if(_0x1ae20b[_0x22b4('0x31')]['includeAll']){_0x852dda[_0x22b4('0x40')]=[{'all':!![]}];}return db[_0x22b4('0x41')][_0x22b4('0x42')](_0x852dda);})['then'](function(_0x487084){_0xc20a97[_0x22b4('0x43')]=_0x487084;return _0xc20a97;})[_0x22b4('0x25')](respondWithFilteredResult(_0x7e2461,_0x852dda))['catch'](handleError(_0x7e2461,null));};exports[_0x22b4('0x44')]=function(_0x4cf51d,_0x3c88cd){var _0x23c6b2={'raw':![],'where':{'id':_0x4cf51d[_0x22b4('0x45')]['id']}},_0x120045={};_0x120045[_0x22b4('0x2e')]=_[_0x22b4('0x2f')](db[_0x22b4('0x41')][_0x22b4('0x2b')]);_0x120045['query']=_[_0x22b4('0x2f')](_0x4cf51d[_0x22b4('0x31')]);_0x120045[_0x22b4('0x39')]=_[_0x22b4('0x30')](_0x120045[_0x22b4('0x2e')],_0x120045[_0x22b4('0x31')]);_0x23c6b2[_0x22b4('0x32')]=_[_0x22b4('0x30')](_0x120045[_0x22b4('0x2e')],qs[_0x22b4('0x33')](_0x4cf51d['query'][_0x22b4('0x33')]));_0x23c6b2[_0x22b4('0x32')]=_0x23c6b2['attributes'][_0x22b4('0x34')]?_0x23c6b2[_0x22b4('0x32')]:_0x120045[_0x22b4('0x2e')];if(_0x4cf51d[_0x22b4('0x31')][_0x22b4('0x46')]){_0x23c6b2[_0x22b4('0x40')]=[{'all':!![]}];}_0x23c6b2=_[_0x22b4('0x3e')]({},_0x23c6b2,_0x4cf51d[_0x22b4('0x3f')]);return db[_0x22b4('0x41')][_0x22b4('0x47')](_0x23c6b2)[_0x22b4('0x25')](handleEntityNotFound(_0x3c88cd,null))[_0x22b4('0x25')](respondWithResult(_0x3c88cd,null))[_0x22b4('0x48')](handleError(_0x3c88cd,null));};exports['create']=function(_0x9c2d3f,_0x45243c){return db[_0x22b4('0x41')]['create'](_0x9c2d3f[_0x22b4('0x49')],{})[_0x22b4('0x25')](function(_0xb759c6){var _0x385533=_0x9c2d3f[_0x22b4('0x4a')][_0x22b4('0x4b')]({'plain':!![]});if(!_0x385533)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x385533[_0x22b4('0x4c')]===_0x22b4('0x4a')){var _0x3b2275=_0xb759c6[_0x22b4('0x4b')]({'plain':!![]});var _0x266abb=_0x22b4('0x23');return db[_0x22b4('0x4d')][_0x22b4('0x47')]({'where':{'name':_0x266abb,'userProfileId':_0x385533[_0x22b4('0x4e')]},'raw':!![]})[_0x22b4('0x25')](function(_0x3656a8){if(_0x3656a8&&_0x3656a8[_0x22b4('0x4f')]===0x0){return db[_0x22b4('0x24')][_0x22b4('0x50')]({'name':_0x3b2275[_0x22b4('0x28')],'resourceId':_0x3b2275['id'],'type':_0x3656a8['name'],'sectionId':_0x3656a8['id']},{})[_0x22b4('0x25')](function(){return _0xb759c6;});}else{return _0xb759c6;}})[_0x22b4('0x48')](function(_0x3d1e76){logger[_0x22b4('0x27')](_0x22b4('0x51'),_0x3d1e76);throw _0x3d1e76;});}return _0xb759c6;})[_0x22b4('0x25')](respondWithResult(_0x45243c,0xc9))[_0x22b4('0x48')](handleError(_0x45243c,null));};exports[_0x22b4('0x52')]=function(_0x31532e,_0x16da35){if(_0x31532e[_0x22b4('0x49')]['id']){delete _0x31532e[_0x22b4('0x49')]['id'];}return db[_0x22b4('0x41')][_0x22b4('0x47')]({'where':{'id':_0x31532e['params']['id']}})[_0x22b4('0x25')](handleEntityNotFound(_0x16da35,null))[_0x22b4('0x25')](saveUpdates(_0x31532e[_0x22b4('0x49')],null))[_0x22b4('0x25')](respondWithResult(_0x16da35,null))['catch'](handleError(_0x16da35,null));};exports[_0x22b4('0x22')]=function(_0x57cd2b,_0x3912b7){return db[_0x22b4('0x41')][_0x22b4('0x47')]({'where':{'id':_0x57cd2b[_0x22b4('0x45')]['id']}})[_0x22b4('0x25')](handleEntityNotFound(_0x3912b7,null))[_0x22b4('0x25')](removeEntity(_0x3912b7,null))['catch'](handleError(_0x3912b7,null));};exports[_0x22b4('0x53')]=function(_0xab3f24,_0x2c4502,_0x854af8){var _0x2a9665=require(_0x22b4('0x54'));return db[_0x22b4('0x41')][_0x22b4('0x47')]({'where':{'id':_0xab3f24['params']['id']},'raw':!![]})[_0x22b4('0x25')](handleEntityNotFound(_0x2c4502,null))[_0x22b4('0x25')](function(){_0x2a9665[_0x22b4('0x53')](_0xab3f24['params']['id']);})[_0x22b4('0x25')](respondWithStatusCode(_0x2c4502,null))[_0x22b4('0x48')](handleError(_0x2c4502,null));}; \ No newline at end of file +var _0x3f1e=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','Scheduler','destroy','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','options','catch','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','run','../../config/schedule','eml-format','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3f1e,0x17c));var _0xe3f1=function(_0x4191ee,_0x3532a1){_0x4191ee=_0x4191ee-0x0;var _0x219d6f=_0x3f1e[_0x4191ee];return _0x219d6f;};'use strict';var emlformat=require(_0xe3f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe3f1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe3f1('0x2'));var Mustache=require(_0xe3f1('0x3'));var util=require('util');var path=require(_0xe3f1('0x4'));var sox=require('sox');var csv=require(_0xe3f1('0x5'));var ejs=require(_0xe3f1('0x6'));var fs=require('fs');var fs_extra=require(_0xe3f1('0x7'));var _=require('lodash');var squel=require(_0xe3f1('0x8'));var crypto=require('crypto');var jsforce=require(_0xe3f1('0x9'));var deskjs=require(_0xe3f1('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe3f1('0xb'));var Papa=require(_0xe3f1('0xc'));var Redis=require('ioredis');var authService=require(_0xe3f1('0xd'));var qs=require(_0xe3f1('0xe'));var as=require(_0xe3f1('0xf'));var hardwareService=require(_0xe3f1('0x10'));var logger=require(_0xe3f1('0x11'))(_0xe3f1('0x12'));var utils=require(_0xe3f1('0x13'));var config=require(_0xe3f1('0x14'));var licenseUtil=require(_0xe3f1('0x15'));var db=require(_0xe3f1('0x16'))['db'];function respondWithStatusCode(_0x57c3b8,_0x527adc){_0x527adc=_0x527adc||0xcc;return function(_0x54ecde){if(_0x54ecde){return _0x57c3b8['sendStatus'](_0x527adc);}return _0x57c3b8[_0xe3f1('0x17')](_0x527adc)['end']();};}function respondWithResult(_0x53b5ac,_0x3570d4){_0x3570d4=_0x3570d4||0xc8;return function(_0x360cc6){if(_0x360cc6){return _0x53b5ac[_0xe3f1('0x17')](_0x3570d4)[_0xe3f1('0x18')](_0x360cc6);}};}function respondWithFilteredResult(_0x529dd2,_0x12ae3b){return function(_0x3d547c){if(_0x3d547c){var _0x52e5f1=typeof _0x12ae3b[_0xe3f1('0x19')]===_0xe3f1('0x1a')&&typeof _0x12ae3b[_0xe3f1('0x1b')]===_0xe3f1('0x1a');var _0x4994ed=_0x3d547c[_0xe3f1('0x1c')];var _0x53ff61=_0x52e5f1?0x0:_0x12ae3b[_0xe3f1('0x19')];var _0x16cb1d=_0x52e5f1?_0x3d547c[_0xe3f1('0x1c')]:_0x12ae3b[_0xe3f1('0x19')]+_0x12ae3b[_0xe3f1('0x1b')];var _0x341089;if(_0x16cb1d>=_0x4994ed){_0x16cb1d=_0x4994ed;_0x341089=0xc8;}else{_0x341089=0xce;}_0x529dd2[_0xe3f1('0x17')](_0x341089);return _0x529dd2[_0xe3f1('0x1d')](_0xe3f1('0x1e'),_0x53ff61+'-'+_0x16cb1d+'/'+_0x4994ed)[_0xe3f1('0x18')](_0x3d547c);}return null;};}function patchUpdates(_0x47580d){return function(_0x7c7baf){try{jsonpatch[_0xe3f1('0x1f')](_0x7c7baf,_0x47580d,!![]);}catch(_0x422f77){return BPromise['reject'](_0x422f77);}return _0x7c7baf['save']();};}function saveUpdates(_0x50df87,_0x8a36a4){return function(_0x5df09f){if(_0x5df09f){return _0x5df09f[_0xe3f1('0x20')](_0x50df87)[_0xe3f1('0x21')](function(_0x3ab1d8){return _0x3ab1d8;});}return null;};}function removeEntity(_0x5c193a,_0x573fdd){return function(_0x36db69){if(_0x36db69){return _0x36db69['destroy']()[_0xe3f1('0x21')](function(){var _0x17978f=_0x36db69[_0xe3f1('0x22')]({'plain':!![]});var _0x546a99=_0xe3f1('0x23');return db['UserProfileResource'][_0xe3f1('0x24')]({'where':{'type':_0x546a99,'resourceId':_0x17978f['id']}})[_0xe3f1('0x21')](function(){return _0x36db69;});})[_0xe3f1('0x21')](function(){_0x5c193a[_0xe3f1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b411,_0x2eb29d){return function(_0x5c44a1){if(!_0x5c44a1){_0x13b411['sendStatus'](0x194);}return _0x5c44a1;};}function handleError(_0x409628,_0xfd0dc1){_0xfd0dc1=_0xfd0dc1||0x1f4;return function(_0x32753a){logger[_0xe3f1('0x25')](_0x32753a[_0xe3f1('0x26')]);if(_0x32753a['name']){delete _0x32753a[_0xe3f1('0x27')];}_0x409628[_0xe3f1('0x17')](_0xfd0dc1)[_0xe3f1('0x28')](_0x32753a);};}exports[_0xe3f1('0x29')]=function(_0x26c550,_0x5dc7ce){var _0x57cba1={},_0x4689a6={},_0x5a41ab={'count':0x0,'rows':[]};var _0x43cdd6=_[_0xe3f1('0x2a')](db[_0xe3f1('0x2b')][_0xe3f1('0x2c')],function(_0x554ecc){return{'name':_0x554ecc[_0xe3f1('0x2d')],'type':_0x554ecc[_0xe3f1('0x2e')]['key']};});_0x4689a6['model']=_[_0xe3f1('0x2a')](_0x43cdd6,_0xe3f1('0x27'));_0x4689a6[_0xe3f1('0x2f')]=_[_0xe3f1('0x30')](_0x26c550['query']);_0x4689a6[_0xe3f1('0x31')]=_[_0xe3f1('0x32')](_0x4689a6['model'],_0x4689a6[_0xe3f1('0x2f')]);_0x57cba1[_0xe3f1('0x33')]=_[_0xe3f1('0x32')](_0x4689a6[_0xe3f1('0x34')],qs[_0xe3f1('0x35')](_0x26c550[_0xe3f1('0x2f')][_0xe3f1('0x35')]));_0x57cba1['attributes']=_0x57cba1[_0xe3f1('0x33')][_0xe3f1('0x36')]?_0x57cba1[_0xe3f1('0x33')]:_0x4689a6[_0xe3f1('0x34')];if(!_0x26c550[_0xe3f1('0x2f')]['hasOwnProperty']('nolimit')){_0x57cba1[_0xe3f1('0x1b')]=qs[_0xe3f1('0x1b')](_0x26c550[_0xe3f1('0x2f')][_0xe3f1('0x1b')]);_0x57cba1['offset']=qs[_0xe3f1('0x19')](_0x26c550[_0xe3f1('0x2f')]['offset']);}_0x57cba1['order']=qs['sort'](_0x26c550[_0xe3f1('0x2f')][_0xe3f1('0x37')]);_0x57cba1[_0xe3f1('0x38')]=qs['filters'](_[_0xe3f1('0x39')](_0x26c550[_0xe3f1('0x2f')],_0x4689a6[_0xe3f1('0x31')]),_0x43cdd6);if(_0x26c550[_0xe3f1('0x2f')]['filter']){_0x57cba1[_0xe3f1('0x38')]=_['merge'](_0x57cba1[_0xe3f1('0x38')],{'$or':_[_0xe3f1('0x2a')](_0x43cdd6,function(_0x5865c6){if(_0x5865c6[_0xe3f1('0x2e')]!==_0xe3f1('0x3a')){var _0x2df898={};_0x2df898[_0x5865c6[_0xe3f1('0x27')]]={'$like':'%'+_0x26c550[_0xe3f1('0x2f')][_0xe3f1('0x3b')]+'%'};return _0x2df898;}})});}_0x57cba1=_[_0xe3f1('0x3c')]({},_0x57cba1,_0x26c550['options']);var _0x54302f={'where':_0x57cba1[_0xe3f1('0x38')]};return db[_0xe3f1('0x2b')][_0xe3f1('0x1c')](_0x54302f)[_0xe3f1('0x21')](function(_0x265498){_0x5a41ab[_0xe3f1('0x1c')]=_0x265498;if(_0x26c550['query'][_0xe3f1('0x3d')]){_0x57cba1[_0xe3f1('0x3e')]=[{'all':!![]}];}return db[_0xe3f1('0x2b')][_0xe3f1('0x3f')](_0x57cba1);})[_0xe3f1('0x21')](function(_0x23c138){_0x5a41ab[_0xe3f1('0x40')]=_0x23c138;return _0x5a41ab;})[_0xe3f1('0x21')](respondWithFilteredResult(_0x5dc7ce,_0x57cba1))['catch'](handleError(_0x5dc7ce,null));};exports[_0xe3f1('0x41')]=function(_0xbd3944,_0xd6c8d2){var _0xf3023e={'raw':![],'where':{'id':_0xbd3944['params']['id']}},_0x2ab418={};_0x2ab418[_0xe3f1('0x34')]=_['keys'](db['Schedule']['rawAttributes']);_0x2ab418[_0xe3f1('0x2f')]=_['keys'](_0xbd3944[_0xe3f1('0x2f')]);_0x2ab418[_0xe3f1('0x31')]=_['intersection'](_0x2ab418[_0xe3f1('0x34')],_0x2ab418[_0xe3f1('0x2f')]);_0xf3023e[_0xe3f1('0x33')]=_[_0xe3f1('0x32')](_0x2ab418[_0xe3f1('0x34')],qs[_0xe3f1('0x35')](_0xbd3944[_0xe3f1('0x2f')][_0xe3f1('0x35')]));_0xf3023e[_0xe3f1('0x33')]=_0xf3023e[_0xe3f1('0x33')][_0xe3f1('0x36')]?_0xf3023e[_0xe3f1('0x33')]:_0x2ab418[_0xe3f1('0x34')];if(_0xbd3944[_0xe3f1('0x2f')][_0xe3f1('0x3d')]){_0xf3023e[_0xe3f1('0x3e')]=[{'all':!![]}];}_0xf3023e=_[_0xe3f1('0x3c')]({},_0xf3023e,_0xbd3944[_0xe3f1('0x42')]);return db[_0xe3f1('0x2b')]['find'](_0xf3023e)['then'](handleEntityNotFound(_0xd6c8d2,null))[_0xe3f1('0x21')](respondWithResult(_0xd6c8d2,null))[_0xe3f1('0x43')](handleError(_0xd6c8d2,null));};exports[_0xe3f1('0x44')]=function(_0x3489f0,_0x325090){return db[_0xe3f1('0x2b')]['create'](_0x3489f0[_0xe3f1('0x45')],{})[_0xe3f1('0x21')](function(_0x43c1cc){var _0x3e6b1e=_0x3489f0[_0xe3f1('0x46')]['get']({'plain':!![]});if(!_0x3e6b1e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e6b1e[_0xe3f1('0x47')]===_0xe3f1('0x46')){var _0x1dd7d7=_0x43c1cc[_0xe3f1('0x22')]({'plain':!![]});var _0x4fa223=_0xe3f1('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x4fa223,'userProfileId':_0x3e6b1e['userProfileId']},'raw':!![]})[_0xe3f1('0x21')](function(_0x1d2aa5){if(_0x1d2aa5&&_0x1d2aa5[_0xe3f1('0x48')]===0x0){return db[_0xe3f1('0x49')]['create']({'name':_0x1dd7d7['name'],'resourceId':_0x1dd7d7['id'],'type':_0x1d2aa5[_0xe3f1('0x27')],'sectionId':_0x1d2aa5['id']},{})[_0xe3f1('0x21')](function(){return _0x43c1cc;});}else{return _0x43c1cc;}})['catch'](function(_0x28aaba){logger[_0xe3f1('0x25')](_0xe3f1('0x4a'),_0x28aaba);throw _0x28aaba;});}return _0x43c1cc;})[_0xe3f1('0x21')](respondWithResult(_0x325090,0xc9))[_0xe3f1('0x43')](handleError(_0x325090,null));};exports[_0xe3f1('0x20')]=function(_0x5005be,_0x39a0d2){if(_0x5005be[_0xe3f1('0x45')]['id']){delete _0x5005be['body']['id'];}return db[_0xe3f1('0x2b')][_0xe3f1('0x4b')]({'where':{'id':_0x5005be[_0xe3f1('0x4c')]['id']}})[_0xe3f1('0x21')](handleEntityNotFound(_0x39a0d2,null))[_0xe3f1('0x21')](saveUpdates(_0x5005be[_0xe3f1('0x45')],null))[_0xe3f1('0x21')](respondWithResult(_0x39a0d2,null))['catch'](handleError(_0x39a0d2,null));};exports[_0xe3f1('0x24')]=function(_0x2a0bd6,_0xb215d3){return db['Schedule'][_0xe3f1('0x4b')]({'where':{'id':_0x2a0bd6[_0xe3f1('0x4c')]['id']}})[_0xe3f1('0x21')](handleEntityNotFound(_0xb215d3,null))[_0xe3f1('0x21')](removeEntity(_0xb215d3,null))[_0xe3f1('0x43')](handleError(_0xb215d3,null));};exports[_0xe3f1('0x4d')]=function(_0x49c5db,_0x7d487d,_0x4a078f){var _0x55b0fb=require(_0xe3f1('0x4e'));return db[_0xe3f1('0x2b')][_0xe3f1('0x4b')]({'where':{'id':_0x49c5db[_0xe3f1('0x4c')]['id']},'raw':!![]})[_0xe3f1('0x21')](handleEntityNotFound(_0x7d487d,null))[_0xe3f1('0x21')](function(){_0x55b0fb[_0xe3f1('0x4d')](_0x49c5db[_0xe3f1('0x4c')]['id']);})[_0xe3f1('0x21')](respondWithStatusCode(_0x7d487d,null))[_0xe3f1('0x43')](handleError(_0x7d487d,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index eaa3ec2..fb94997 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 _0x10fe=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','Schedule','tools_schedules'];(function(_0x2ddc05,_0x688d2f){var _0xc3f512=function(_0x2dd26f){while(--_0x2dd26f){_0x2ddc05['push'](_0x2ddc05['shift']());}};_0xc3f512(++_0x688d2f);}(_0x10fe,0x105));var _0xe10f=function(_0x973d52,_0x20bce6){_0x973d52=_0x973d52-0x0;var _0x5a599b=_0x10fe[_0x973d52];return _0x5a599b;};'use strict';var _=require(_0xe10f('0x0'));var util=require(_0xe10f('0x1'));var logger=require(_0xe10f('0x2'))(_0xe10f('0x3'));var moment=require(_0xe10f('0x4'));var BPromise=require(_0xe10f('0x5'));var rp=require(_0xe10f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./schedule.attributes');module['exports']=function(_0x8e4cea,_0x3f07e7){return _0x8e4cea['define'](_0xe10f('0x7'),attributes,{'tableName':_0xe10f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e36=['./schedule.attributes','exports','define','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x308254,_0x443348){var _0x56772f=function(_0x2961e6){while(--_0x2961e6){_0x308254['push'](_0x308254['shift']());}};_0x56772f(++_0x443348);}(_0x8e36,0x108));var _0x68e3=function(_0x1fa7f3,_0x114da3){_0x1fa7f3=_0x1fa7f3-0x0;var _0x189ba9=_0x8e36[_0x1fa7f3];return _0x189ba9;};'use strict';var _=require('lodash');var util=require(_0x68e3('0x0'));var logger=require(_0x68e3('0x1'))(_0x68e3('0x2'));var moment=require(_0x68e3('0x3'));var BPromise=require(_0x68e3('0x4'));var rp=require(_0x68e3('0x5'));var fs=require('fs');var path=require(_0x68e3('0x6'));var rimraf=require(_0x68e3('0x7'));var config=require(_0x68e3('0x8'));var attributes=require(_0x68e3('0x9'));module[_0x68e3('0xa')]=function(_0x18977f,_0x18e6e7){return _0x18977f[_0x68e3('0xb')]('Schedule',attributes,{'tableName':_0x68e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 82c4b81..161981d 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 _0x9f25=['request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf8ef4a,_0x34a9d5){var _0x1869c9=function(_0x130a7e){while(--_0x130a7e){_0xf8ef4a['push'](_0xf8ef4a['shift']());}};_0x1869c9(++_0x34a9d5);}(_0x9f25,0x1ae));var _0x59f2=function(_0x515232,_0x3de920){_0x515232=_0x515232-0x0;var _0x45685c=_0x9f25[_0x515232];return _0x45685c;};'use strict';var _=require(_0x59f2('0x0'));var util=require('util');var moment=require(_0x59f2('0x1'));var BPromise=require(_0x59f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59f2('0x3'));var db=require(_0x59f2('0x4'))['db'];var utils=require(_0x59f2('0x5'));var logger=require(_0x59f2('0x6'))(_0x59f2('0x7'));var config=require(_0x59f2('0x8'));var jayson=require(_0x59f2('0x9'));var client=jayson[_0x59f2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6a71,_0x3aa1fd,_0x8fab38){return new BPromise(function(_0x48a60e,_0x5a6819){return client[_0x59f2('0xb')](_0x1f6a71,_0x8fab38)['then'](function(_0x5cf31b){logger[_0x59f2('0xc')](_0x59f2('0xd'),_0x3aa1fd,_0x59f2('0xe'));logger[_0x59f2('0xf')](_0x59f2('0x10'),_0x3aa1fd,_0x59f2('0xe'),JSON['stringify'](_0x5cf31b));if(_0x5cf31b[_0x59f2('0x11')]){if(_0x5cf31b[_0x59f2('0x11')]['code']===0x1f4){logger['error'](_0x59f2('0xd'),_0x3aa1fd,_0x5cf31b[_0x59f2('0x11')]['message']);return _0x5a6819(_0x5cf31b[_0x59f2('0x11')][_0x59f2('0x12')]);}logger[_0x59f2('0x11')](_0x59f2('0xd'),_0x3aa1fd,_0x5cf31b[_0x59f2('0x11')][_0x59f2('0x12')]);return _0x48a60e(_0x5cf31b[_0x59f2('0x11')][_0x59f2('0x12')]);}else{logger[_0x59f2('0xc')](_0x59f2('0xd'),_0x3aa1fd,_0x59f2('0xe'));_0x48a60e(_0x5cf31b[_0x59f2('0x13')]['message']);}})[_0x59f2('0x14')](function(_0x4bb40c){logger[_0x59f2('0x11')]('Schedule,\x20%s,\x20%s',_0x3aa1fd,_0x4bb40c);_0x5a6819(_0x4bb40c);});});} \ No newline at end of file +var _0x2f73=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x34d8f9,_0x3889ed){var _0x4a3792=function(_0xe685fb){while(--_0xe685fb){_0x34d8f9['push'](_0x34d8f9['shift']());}};_0x4a3792(++_0x3889ed);}(_0x2f73,0x102));var _0x32f7=function(_0x31a755,_0x203ce1){_0x31a755=_0x31a755-0x0;var _0x4aa72b=_0x2f73[_0x31a755];return _0x4aa72b;};'use strict';var _=require(_0x32f7('0x0'));var util=require(_0x32f7('0x1'));var moment=require(_0x32f7('0x2'));var BPromise=require(_0x32f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x32f7('0x5'));var logger=require(_0x32f7('0x6'))(_0x32f7('0x7'));var config=require(_0x32f7('0x8'));var jayson=require(_0x32f7('0x9'));var client=jayson[_0x32f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56c554,_0x4d4b91,_0x4d18ba){return new BPromise(function(_0x398ed4,_0x2250ef){return client[_0x32f7('0xb')](_0x56c554,_0x4d18ba)[_0x32f7('0xc')](function(_0x2374e3){logger[_0x32f7('0xd')](_0x32f7('0xe'),_0x4d4b91,_0x32f7('0xf'));logger[_0x32f7('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4d4b91,'request\x20sent',JSON[_0x32f7('0x11')](_0x2374e3));if(_0x2374e3[_0x32f7('0x12')]){if(_0x2374e3[_0x32f7('0x12')][_0x32f7('0x13')]===0x1f4){logger[_0x32f7('0x12')](_0x32f7('0xe'),_0x4d4b91,_0x2374e3[_0x32f7('0x12')][_0x32f7('0x14')]);return _0x2250ef(_0x2374e3[_0x32f7('0x12')][_0x32f7('0x14')]);}logger[_0x32f7('0x12')](_0x32f7('0xe'),_0x4d4b91,_0x2374e3[_0x32f7('0x12')][_0x32f7('0x14')]);return _0x398ed4(_0x2374e3[_0x32f7('0x12')][_0x32f7('0x14')]);}else{logger[_0x32f7('0xd')](_0x32f7('0xe'),_0x4d4b91,_0x32f7('0xf'));_0x398ed4(_0x2374e3[_0x32f7('0x15')][_0x32f7('0x14')]);}})['catch'](function(_0x5cbaea){logger[_0x32f7('0x12')](_0x32f7('0xe'),_0x4d4b91,_0x5cbaea);_0x2250ef(_0x5cbaea);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index a8c2036..7585105 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 _0x4bb9=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','describe','/:id','/:id/download','download','post','create','destroy','exports','multer'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x4bb9,0x17b));var _0x94bb=function(_0x1928b0,_0x376040){_0x1928b0=_0x1928b0-0x0;var _0x259304=_0x4bb9[_0x1928b0];return _0x259304;};'use strict';var multer=require(_0x94bb('0x0'));var util=require(_0x94bb('0x1'));var path=require(_0x94bb('0x2'));var timeout=require(_0x94bb('0x3'));var express=require(_0x94bb('0x4'));var router=express['Router']();var fs_extra=require(_0x94bb('0x5'));var auth=require(_0x94bb('0x6'));var interaction=require(_0x94bb('0x7'));var config=require(_0x94bb('0x8'));var controller=require(_0x94bb('0x9'));router['get']('/',auth[_0x94bb('0xa')](),controller['index']);router[_0x94bb('0xb')]('/describe',auth[_0x94bb('0xa')](),controller[_0x94bb('0xc')]);router['get'](_0x94bb('0xd'),auth[_0x94bb('0xa')](),controller['show']);router['get'](_0x94bb('0xe'),auth['isAuthenticated'](),controller[_0x94bb('0xf')]);router[_0x94bb('0x10')]('/',auth[_0x94bb('0xa')](),controller[_0x94bb('0x11')]);router['put'](_0x94bb('0xd'),auth[_0x94bb('0xa')](),controller['update']);router['delete'](_0x94bb('0xd'),auth['isAuthenticated'](),controller[_0x94bb('0x12')]);module[_0x94bb('0x13')]=router; \ No newline at end of file +var _0x88fd=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','update','delete','destroy','exports'];(function(_0x5207e4,_0x3c95ea){var _0x4f0ed6=function(_0x3df5d7){while(--_0x3df5d7){_0x5207e4['push'](_0x5207e4['shift']());}};_0x4f0ed6(++_0x3c95ea);}(_0x88fd,0x17a));var _0xd88f=function(_0x391edd,_0x12a302){_0x391edd=_0x391edd-0x0;var _0x4c3fee=_0x88fd[_0x391edd];return _0x4c3fee;};'use strict';var multer=require(_0xd88f('0x0'));var util=require(_0xd88f('0x1'));var path=require(_0xd88f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd88f('0x3')]();var fs_extra=require(_0xd88f('0x4'));var auth=require(_0xd88f('0x5'));var interaction=require(_0xd88f('0x6'));var config=require(_0xd88f('0x7'));var controller=require(_0xd88f('0x8'));router['get']('/',auth[_0xd88f('0x9')](),controller['index']);router[_0xd88f('0xa')]('/describe',auth[_0xd88f('0x9')](),controller['describe']);router[_0xd88f('0xa')](_0xd88f('0xb'),auth[_0xd88f('0x9')](),controller[_0xd88f('0xc')]);router[_0xd88f('0xa')](_0xd88f('0xd'),auth['isAuthenticated'](),controller[_0xd88f('0xe')]);router[_0xd88f('0xf')]('/',auth[_0xd88f('0x9')](),controller[_0xd88f('0x10')]);router['put'](_0xd88f('0xb'),auth[_0xd88f('0x9')](),controller[_0xd88f('0x11')]);router[_0xd88f('0x12')](_0xd88f('0xb'),auth['isAuthenticated'](),controller[_0xd88f('0x13')]);module[_0xd88f('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b2a7f69..b8d2493 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 _0xda2d=['replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','toString','format','MM-DD-YYYY\x20HH:mm','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING'];(function(_0x4e71ac,_0x42aced){var _0x11d76c=function(_0xcf5279){while(--_0xcf5279){_0x4e71ac['push'](_0x4e71ac['shift']());}};_0x11d76c(++_0x42aced);}(_0xda2d,0x102));var _0xdda2=function(_0xdb0935,_0xfd8ce){_0xdb0935=_0xdb0935-0x0;var _0x23a799=_0xda2d[_0xdb0935];return _0x23a799;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var config=require(_0xdda2('0x2'));module[_0xdda2('0x3')]={'format':{'type':Sequelize[_0xdda2('0x4')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0xdda2('0x5')](_0xdda2('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xdda2('0x7')]},'channel':{'type':Sequelize[_0xdda2('0x7')]},'value':{'type':Sequelize[_0xdda2('0x7')],'set':function(_0xf38e58){var _0x2f55dc=_0xf38e58[_0xdda2('0x8')](/\\/g,'/');this[_0xdda2('0x9')](_0xdda2('0x6'),_0x2f55dc);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdda2('0xa')],'set':function(_0x22c6e5){this['setDataValue'](_0xdda2('0xb'),moment()[_0xdda2('0xc')](_0x22c6e5,'ms'));this[_0xdda2('0x9')](_0xdda2('0xd'),moment());this[_0xdda2('0x9')](_0xdda2('0xe'),_0x22c6e5);}},'startedAt':{'type':Sequelize[_0xdda2('0xf')],'get':function(){return moment(this[_0xdda2('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xdda2('0x10')]();}},'closedAt':{'type':Sequelize[_0xdda2('0xf')],'get':function(){return moment(this[_0xdda2('0x5')](_0xdda2('0xd')))[_0xdda2('0x11')](_0xdda2('0x12'))[_0xdda2('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdda2('0x5')]('createdAt'))[_0xdda2('0x11')](_0xdda2('0x12'))[_0xdda2('0x10')]();}},'updatedAt':{'type':Sequelize[_0xdda2('0xf')],'get':function(){return moment(this[_0xdda2('0x5')]('updatedAt'))['format'](_0xdda2('0x12'))['toString']();}}}; \ No newline at end of file +var _0xc648=['setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc648,0x171));var _0x8c64=function(_0x125d09,_0x1b3a6a){_0x125d09=_0x125d09-0x0;var _0x18808e=_0xc648[_0x125d09];return _0x18808e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8c64('0x0'));var path=require(_0x8c64('0x1'));var config=require(_0x8c64('0x2'));module[_0x8c64('0x3')]={'format':{'type':Sequelize[_0x8c64('0x4')],'get':function(){return this[_0x8c64('0x5')](_0x8c64('0x6'))?path['extname'](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x8c64('0x7')]},'channel':{'type':Sequelize[_0x8c64('0x7')]},'value':{'type':Sequelize[_0x8c64('0x7')],'set':function(_0x1be93f){var _0x507d58=_0x1be93f[_0x8c64('0x8')](/\\/g,'/');this[_0x8c64('0x9')](_0x8c64('0x6'),_0x507d58);}},'rating':{'type':Sequelize[_0x8c64('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8c64('0xa')],'set':function(_0x5e78c4){this[_0x8c64('0x9')](_0x8c64('0xb'),moment()['subtract'](_0x5e78c4,'ms'));this[_0x8c64('0x9')](_0x8c64('0xc'),moment());this[_0x8c64('0x9')](_0x8c64('0xd'),_0x5e78c4);}},'startedAt':{'type':Sequelize[_0x8c64('0xe')],'get':function(){return moment(this[_0x8c64('0x5')](_0x8c64('0xb')))[_0x8c64('0xf')](_0x8c64('0x10'))[_0x8c64('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8c64('0x5')](_0x8c64('0xc')))[_0x8c64('0xf')](_0x8c64('0x10'))[_0x8c64('0x11')]();}},'createdAt':{'type':Sequelize[_0x8c64('0xe')],'get':function(){return moment(this[_0x8c64('0x5')]('createdAt'))[_0x8c64('0xf')](_0x8c64('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0x8c64('0xe')],'get':function(){return moment(this[_0x8c64('0x5')]('updatedAt'))[_0x8c64('0xf')](_0x8c64('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9e16b1d..58174eb 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 _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x473b90,_0x5ad619){var _0x48c675=function(_0x3a1e8c){while(--_0x3a1e8c){_0x473b90['push'](_0x473b90['shift']());}};_0x48c675(++_0x5ad619);}(_0xb458,0x103));var _0x8b45=function(_0x266951,_0x34be2a){_0x266951=_0x266951-0x0;var _0x2f6bfd=_0xb458[_0x266951];return _0x2f6bfd;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));}; \ No newline at end of file +var _0xeec6=['options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','find','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ScreenRecording','rawAttributes','fieldName','type','model','format','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge'];(function(_0x5586b2,_0x132f74){var _0x197558=function(_0x2acd59){while(--_0x2acd59){_0x5586b2['push'](_0x5586b2['shift']());}};_0x197558(++_0x132f74);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0xeec6[_0x5da0d9];return _0x4b6d2f;};'use strict';var emlformat=require(_0x6eec('0x0'));var rimraf=require(_0x6eec('0x1'));var zipdir=require(_0x6eec('0x2'));var jsonpatch=require(_0x6eec('0x3'));var rp=require('request-promise');var moment=require(_0x6eec('0x4'));var BPromise=require(_0x6eec('0x5'));var Mustache=require(_0x6eec('0x6'));var util=require(_0x6eec('0x7'));var path=require(_0x6eec('0x8'));var sox=require(_0x6eec('0x9'));var csv=require('to-csv');var ejs=require(_0x6eec('0xa'));var fs=require('fs');var fs_extra=require(_0x6eec('0xb'));var _=require('lodash');var squel=require(_0x6eec('0xc'));var crypto=require(_0x6eec('0xd'));var jsforce=require(_0x6eec('0xe'));var deskjs=require(_0x6eec('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6eec('0x10'));var Papa=require(_0x6eec('0x11'));var Redis=require(_0x6eec('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eec('0x13'));var logger=require(_0x6eec('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6eec('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6eec('0x16'))['db'];function respondWithStatusCode(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xcc;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0x17')](_0x162db1);}return _0x3387c2['status'](_0x162db1)[_0x6eec('0x18')]();};}function respondWithResult(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0xc8;return function(_0xc35914){if(_0xc35914){return _0x3b2972[_0x6eec('0x19')](_0x462dbb)[_0x6eec('0x1a')](_0xc35914);}};}function respondWithFilteredResult(_0x345852,_0x393271){return function(_0x34a7fc){if(_0x34a7fc){var _0x2ac797=typeof _0x393271['offset']===_0x6eec('0x1b')&&typeof _0x393271['limit']===_0x6eec('0x1b');var _0x45aa3f=_0x34a7fc['count'];var _0x3ee353=_0x2ac797?0x0:_0x393271[_0x6eec('0x1c')];var _0xb1eab7=_0x2ac797?_0x34a7fc['count']:_0x393271[_0x6eec('0x1c')]+_0x393271[_0x6eec('0x1d')];var _0x3c7152;if(_0xb1eab7>=_0x45aa3f){_0xb1eab7=_0x45aa3f;_0x3c7152=0xc8;}else{_0x3c7152=0xce;}_0x345852[_0x6eec('0x19')](_0x3c7152);return _0x345852[_0x6eec('0x1e')](_0x6eec('0x1f'),_0x3ee353+'-'+_0xb1eab7+'/'+_0x45aa3f)['json'](_0x34a7fc);}return null;};}function patchUpdates(_0x328693){return function(_0x2f843e){try{jsonpatch[_0x6eec('0x20')](_0x2f843e,_0x328693,!![]);}catch(_0x34522a){return BPromise[_0x6eec('0x21')](_0x34522a);}return _0x2f843e[_0x6eec('0x22')]();};}function saveUpdates(_0x52f941,_0x6e40b3){return function(_0x852d08){if(_0x852d08){return _0x852d08[_0x6eec('0x23')](_0x52f941)[_0x6eec('0x24')](function(_0x409b26){return _0x409b26;});}return null;};}function removeEntity(_0x13863c,_0x573249){return function(_0x384586){if(_0x384586){return _0x384586[_0x6eec('0x25')]()[_0x6eec('0x24')](function(){_0x13863c[_0x6eec('0x19')](0xcc)[_0x6eec('0x18')]();});}};}function handleEntityNotFound(_0x1f386c,_0x29879c){return function(_0x20bed3){if(!_0x20bed3){_0x1f386c[_0x6eec('0x17')](0x194);}return _0x20bed3;};}function handleError(_0x58f95c,_0x1d750c){_0x1d750c=_0x1d750c||0x1f4;return function(_0x44b31c){logger[_0x6eec('0x26')](_0x44b31c[_0x6eec('0x27')]);if(_0x44b31c['name']){delete _0x44b31c[_0x6eec('0x28')];}_0x58f95c[_0x6eec('0x19')](_0x1d750c)['send'](_0x44b31c);};}exports['index']=function(_0x3240c3,_0x47ed95){var _0x20a130={},_0xede270={},_0x3bbdf8={'count':0x0,'rows':[]};var _0x34bdea=_[_0x6eec('0x29')](db[_0x6eec('0x2a')][_0x6eec('0x2b')],function(_0x33e4a1){return{'name':_0x33e4a1[_0x6eec('0x2c')],'type':_0x33e4a1[_0x6eec('0x2d')]['key']};});_0xede270[_0x6eec('0x2e')]=_['differenceBy'](_[_0x6eec('0x29')](_0x34bdea,_0x6eec('0x28')),[_0x6eec('0x2f')]);_0xede270['query']=_['keys'](_0x3240c3['query']);_0xede270[_0x6eec('0x30')]=_[_0x6eec('0x31')](_0xede270[_0x6eec('0x2e')],_0xede270[_0x6eec('0x32')]);_0x20a130[_0x6eec('0x33')]=_[_0x6eec('0x31')](_0xede270[_0x6eec('0x2e')],qs[_0x6eec('0x34')](_0x3240c3[_0x6eec('0x32')][_0x6eec('0x34')]));_0x20a130[_0x6eec('0x33')]=_0x20a130[_0x6eec('0x33')]['length']?_0x20a130[_0x6eec('0x33')]:_0xede270[_0x6eec('0x2e')];if(!_0x3240c3[_0x6eec('0x32')]['hasOwnProperty'](_0x6eec('0x35'))){_0x20a130[_0x6eec('0x1d')]=qs[_0x6eec('0x1d')](_0x3240c3[_0x6eec('0x32')][_0x6eec('0x1d')]);_0x20a130[_0x6eec('0x1c')]=qs['offset'](_0x3240c3[_0x6eec('0x32')][_0x6eec('0x1c')]);}_0x20a130[_0x6eec('0x36')]=qs['sort'](_0x3240c3['query'][_0x6eec('0x37')]);_0x20a130[_0x6eec('0x38')]=qs[_0x6eec('0x30')](_[_0x6eec('0x39')](_0x3240c3[_0x6eec('0x32')],_0xede270['filters']),_0x34bdea);if(_0x3240c3[_0x6eec('0x32')][_0x6eec('0x3a')]){_0x20a130[_0x6eec('0x38')]=_[_0x6eec('0x3b')](_0x20a130[_0x6eec('0x38')],{'$or':_[_0x6eec('0x29')](_0x34bdea,function(_0x36cfe1){if(_0x36cfe1[_0x6eec('0x2d')]!=='VIRTUAL'){var _0x2f7a75={};_0x2f7a75[_0x36cfe1[_0x6eec('0x28')]]={'$like':'%'+_0x3240c3['query']['filter']+'%'};return _0x2f7a75;}})});}_0x20a130=_[_0x6eec('0x3b')]({},_0x20a130,_0x3240c3[_0x6eec('0x3c')]);var _0xf056e0={'where':_0x20a130[_0x6eec('0x38')]};return db['ScreenRecording']['count'](_0xf056e0)[_0x6eec('0x24')](function(_0x48fbf6){_0x3bbdf8['count']=_0x48fbf6;if(_0x3240c3[_0x6eec('0x32')][_0x6eec('0x3d')]){_0x20a130[_0x6eec('0x3e')]=[{'all':!![]}];}return db[_0x6eec('0x2a')][_0x6eec('0x3f')](_0x20a130);})['then'](function(_0x931bcf){_0x3bbdf8[_0x6eec('0x40')]=_0x931bcf;return _0x3bbdf8;})['then'](respondWithFilteredResult(_0x47ed95,_0x20a130))[_0x6eec('0x41')](handleError(_0x47ed95,null));};exports[_0x6eec('0x42')]=function(_0x5028a2,_0x2d39bf){var _0x44d75d={'raw':![],'where':{'id':_0x5028a2[_0x6eec('0x43')]['id']}},_0x4e3b1e={};_0x4e3b1e[_0x6eec('0x2e')]=_[_0x6eec('0x44')](db[_0x6eec('0x2a')]['rawAttributes']);_0x4e3b1e[_0x6eec('0x32')]=_[_0x6eec('0x44')](_0x5028a2[_0x6eec('0x32')]);_0x4e3b1e[_0x6eec('0x30')]=_[_0x6eec('0x31')](_0x4e3b1e['model'],_0x4e3b1e['query']);_0x44d75d[_0x6eec('0x33')]=_[_0x6eec('0x31')](_0x4e3b1e[_0x6eec('0x2e')],qs[_0x6eec('0x34')](_0x5028a2[_0x6eec('0x32')]['fields']));_0x44d75d[_0x6eec('0x33')]=_0x44d75d['attributes'][_0x6eec('0x45')]?_0x44d75d[_0x6eec('0x33')]:_0x4e3b1e[_0x6eec('0x2e')];if(_0x5028a2['query'][_0x6eec('0x3d')]){_0x44d75d[_0x6eec('0x3e')]=[{'all':!![]}];}_0x44d75d=_[_0x6eec('0x3b')]({},_0x44d75d,_0x5028a2[_0x6eec('0x3c')]);return db[_0x6eec('0x2a')]['find'](_0x44d75d)[_0x6eec('0x24')](handleEntityNotFound(_0x2d39bf,null))['then'](respondWithResult(_0x2d39bf,null))['catch'](handleError(_0x2d39bf,null));};exports[_0x6eec('0x46')]=function(_0x535d96,_0x245a1b){return db[_0x6eec('0x2a')][_0x6eec('0x46')](_0x535d96['body'],{})['then'](respondWithResult(_0x245a1b,0xc9))[_0x6eec('0x41')](handleError(_0x245a1b,null));};exports[_0x6eec('0x23')]=function(_0x1d6626,_0x2d0fc0){if(_0x1d6626[_0x6eec('0x47')]['id']){delete _0x1d6626[_0x6eec('0x47')]['id'];}delete _0x1d6626[_0x6eec('0x47')][_0x6eec('0x48')];delete _0x1d6626[_0x6eec('0x47')][_0x6eec('0x49')];delete _0x1d6626['body']['closedAt'];delete _0x1d6626[_0x6eec('0x47')][_0x6eec('0x4a')];return db[_0x6eec('0x2a')]['find']({'where':{'id':_0x1d6626[_0x6eec('0x43')]['id']}})[_0x6eec('0x24')](handleEntityNotFound(_0x2d0fc0,null))[_0x6eec('0x24')](saveUpdates(_0x1d6626[_0x6eec('0x47')],null))[_0x6eec('0x24')](respondWithResult(_0x2d0fc0,null))[_0x6eec('0x41')](handleError(_0x2d0fc0,null));};exports[_0x6eec('0x4b')]=function(_0x413de9,_0x5a6e05){return db[_0x6eec('0x2a')][_0x6eec('0x4b')]()[_0x6eec('0x24')](respondWithResult(_0x5a6e05,null))[_0x6eec('0x41')](handleError(_0x5a6e05,null));};exports['download']=function(_0x51fd37,_0x50436d,_0x36c49b){var _0x32b289=require(_0x6eec('0x4c'));var _0x1de626=![];var _0x5178f5={};if(_0x51fd37['query'][_0x6eec('0x2d')]&&_0x51fd37[_0x6eec('0x32')][_0x6eec('0x2d')]==='uniqueid'){_0x5178f5[_0x6eec('0x4d')]=_0x51fd37[_0x6eec('0x43')]['id'];}else{_0x5178f5['id']=_0x51fd37[_0x6eec('0x43')]['id'];}return db[_0x6eec('0x2a')][_0x6eec('0x4e')]({'where':_0x5178f5,'attributes':['id',_0x6eec('0x4a')],'raw':!![]})[_0x6eec('0x24')](handleEntityNotFound(_0x50436d,null))[_0x6eec('0x24')](function(_0x45fed3){if(_0x45fed3){var _0x4e921a=path[_0x6eec('0x4f')](config['root'],_0x6eec('0x50'),_0x45fed3[_0x6eec('0x4a')]);var _0x424962=util[_0x6eec('0x2f')](_0x6eec('0x51'),_0x4e921a);if(fs[_0x6eec('0x52')](_0x424962)){_0x1de626=!![];return _0x32b289[_0x6eec('0x53')](_0x424962,_0x4e921a,config['secrets'][_0x6eec('0x54')])['then'](function(){return _0x45fed3;});}return _0x45fed3;}})[_0x6eec('0x24')](function(_0x5c905f){if(_0x5c905f){var _0x237324=path[_0x6eec('0x4f')](config[_0x6eec('0x55')],_0x6eec('0x50'),_0x5c905f[_0x6eec('0x4a')]);if(!fs[_0x6eec('0x52')](_0x237324)){throw new db[(_0x6eec('0x56'))][(_0x6eec('0x57'))](_0x6eec('0x58'));}if(_0x5c905f[_0x6eec('0x59')]){return _0x50436d['download'](_0x237324,_0x5c905f['filename']+path[_0x6eec('0x5a')](_0x237324),function(){if(_0x1de626){fs[_0x6eec('0x5b')](_0x237324);}});}else{return _0x50436d[_0x6eec('0x5c')](_0x237324,function(_0x2c0644){if(_0x1de626){fs[_0x6eec('0x5b')](_0x237324);}});}}})['catch'](function(_0x1d8fb1){if(_0x1d8fb1[_0x6eec('0x5d')]==='ScreenRecording\x20not\x20found'){_0x50436d['status'](0x194)['send'](_0x6eec('0x5e'));}else{return handleError(_0x50436d,null);}});};exports[_0x6eec('0x25')]=function(_0x4cf859,_0x1d2baf){return db[_0x6eec('0x2a')]['find']({'where':{'id':_0x4cf859[_0x6eec('0x43')]['id']}})[_0x6eec('0x24')](function(_0xc852b3){if(_[_0x6eec('0x5f')](_0xc852b3)){throw new ReferenceError('Entity\x20not\x20found');}return _0xc852b3;})['then'](function(_0x54fcd0){var _0x1230fc=path[_0x6eec('0x4f')](config[_0x6eec('0x55')],_0x6eec('0x50'),_0x54fcd0[_0x6eec('0x4a')]);logger[_0x6eec('0x60')](_0x6eec('0x61'),_0x1230fc);if(!_[_0x6eec('0x5f')](_0x54fcd0[_0x6eec('0x4a')])&&fs[_0x6eec('0x52')](_0x1230fc)){logger[_0x6eec('0x60')](_0x6eec('0x62')+_0x1230fc+_0x6eec('0x63'));fs[_0x6eec('0x64')](_0x1230fc);}_0x1230fc=_0x1230fc+_0x6eec('0x65');if(!_[_0x6eec('0x5f')](_0x54fcd0['value'])&&fs[_0x6eec('0x52')](_0x1230fc)){logger[_0x6eec('0x60')]('File:\x20\x22'+_0x1230fc+_0x6eec('0x63'));fs[_0x6eec('0x64')](_0x1230fc);}return _0x54fcd0;})['then'](function(_0x7dd727){if(!_0x7dd727)throw new InternalError();return _0x7dd727[_0x6eec('0x25')]();})[_0x6eec('0x24')](function(){_0x1d2baf[_0x6eec('0x19')](0xcc)['end']();})[_0x6eec('0x41')](handleError(_0x1d2baf,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index f680288..c632828 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 _0xdc72=['util','api','request-promise','path','../../config/environment','./screenRecording.attributes','ScreenRecording','interactionid'];(function(_0x40e402,_0x1e59cd){var _0x4738d7=function(_0xfc213d){while(--_0xfc213d){_0x40e402['push'](_0x40e402['shift']());}};_0x4738d7(++_0x1e59cd);}(_0xdc72,0x158));var _0x2dc7=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdc72[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x2dc7('0x0'));var logger=require('../../config/logger')(_0x2dc7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2dc7('0x2'));var fs=require('fs');var path=require(_0x2dc7('0x3'));var rimraf=require('rimraf');var config=require(_0x2dc7('0x4'));var attributes=require(_0x2dc7('0x5'));module['exports']=function(_0x12c895,_0x269c7b){return _0x12c895['define'](_0x2dc7('0x6'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x2dc7('0x7'),'fields':[_0x2dc7('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31a1=['../../config/logger','api','moment','bluebird','request-promise','path','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x31a1,0x6e));var _0x131a=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x31a1[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x131a('0x0'));var util=require(_0x131a('0x1'));var logger=require(_0x131a('0x2'))(_0x131a('0x3'));var moment=require(_0x131a('0x4'));var BPromise=require(_0x131a('0x5'));var rp=require(_0x131a('0x6'));var fs=require('fs');var path=require(_0x131a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x131a('0x8'));module[_0x131a('0x9')]=function(_0x90d868,_0x3f9733){return _0x90d868[_0x131a('0xa')](_0x131a('0xb'),attributes,{'tableName':_0x131a('0xc'),'paranoid':![],'indexes':[{'name':_0x131a('0xd'),'fields':[_0x131a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 554eb98..66c7d5e 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 _0x48f5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s','error','message','result','util','moment','bluebird'];(function(_0x22b76a,_0x213e46){var _0xdfadd9=function(_0x57e7bb){while(--_0x57e7bb){_0x22b76a['push'](_0x22b76a['shift']());}};_0xdfadd9(++_0x213e46);}(_0x48f5,0xf9));var _0x548f=function(_0x2c03d4,_0x5b5e50){_0x2c03d4=_0x2c03d4-0x0;var _0x3a3ac=_0x48f5[_0x2c03d4];return _0x3a3ac;};'use strict';var _=require('lodash');var util=require(_0x548f('0x0'));var moment=require(_0x548f('0x1'));var BPromise=require(_0x548f('0x2'));var rs=require(_0x548f('0x3'));var fs=require('fs');var Redis=require(_0x548f('0x4'));var db=require(_0x548f('0x5'))['db'];var utils=require(_0x548f('0x6'));var logger=require(_0x548f('0x7'))(_0x548f('0x8'));var config=require(_0x548f('0x9'));var jayson=require(_0x548f('0xa'));var client=jayson['client'][_0x548f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4938cf,_0x5b51ca,_0x21e584){return new BPromise(function(_0x5c68a6,_0x57ff23){return client[_0x548f('0xc')](_0x4938cf,_0x21e584)[_0x548f('0xd')](function(_0x236805){logger[_0x548f('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x5b51ca,_0x548f('0xf'));logger['debug'](_0x548f('0x10'),_0x5b51ca,_0x548f('0xf'),JSON['stringify'](_0x236805));if(_0x236805['error']){if(_0x236805['error']['code']===0x1f4){logger['error'](_0x548f('0x11'),_0x5b51ca,_0x236805[_0x548f('0x12')][_0x548f('0x13')]);return _0x57ff23(_0x236805[_0x548f('0x12')][_0x548f('0x13')]);}logger[_0x548f('0x12')](_0x548f('0x11'),_0x5b51ca,_0x236805[_0x548f('0x12')][_0x548f('0x13')]);return _0x5c68a6(_0x236805[_0x548f('0x12')][_0x548f('0x13')]);}else{logger['info'](_0x548f('0x11'),_0x5b51ca,_0x548f('0xf'));_0x5c68a6(_0x236805[_0x548f('0x14')][_0x548f('0x13')]);}})['catch'](function(_0x590ac7){logger[_0x548f('0x12')](_0x548f('0x11'),_0x5b51ca,_0x590ac7);_0x57ff23(_0x590ac7);});});} \ No newline at end of file +var _0xd965=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x262ee7,_0x52ee92){var _0x1dc842=function(_0x4bf54a){while(--_0x4bf54a){_0x262ee7['push'](_0x262ee7['shift']());}};_0x1dc842(++_0x52ee92);}(_0xd965,0x1a4));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d96('0x0'));var util=require(_0x5d96('0x1'));var moment=require(_0x5d96('0x2'));var BPromise=require(_0x5d96('0x3'));var rs=require(_0x5d96('0x4'));var fs=require('fs');var Redis=require(_0x5d96('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d96('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d96('0x7'));var jayson=require(_0x5d96('0x8'));var client=jayson['client'][_0x5d96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21b0bb,_0x595ad3,_0x582ee3){return new BPromise(function(_0x27184c,_0x3498a6){return client[_0x5d96('0xa')](_0x21b0bb,_0x582ee3)[_0x5d96('0xb')](function(_0x40a385){logger['info'](_0x5d96('0xc'),_0x595ad3,_0x5d96('0xd'));logger[_0x5d96('0xe')](_0x5d96('0xf'),_0x595ad3,'request\x20sent',JSON[_0x5d96('0x10')](_0x40a385));if(_0x40a385[_0x5d96('0x11')]){if(_0x40a385['error'][_0x5d96('0x12')]===0x1f4){logger[_0x5d96('0x11')](_0x5d96('0xc'),_0x595ad3,_0x40a385[_0x5d96('0x11')][_0x5d96('0x13')]);return _0x3498a6(_0x40a385['error'][_0x5d96('0x13')]);}logger[_0x5d96('0x11')](_0x5d96('0xc'),_0x595ad3,_0x40a385[_0x5d96('0x11')][_0x5d96('0x13')]);return _0x27184c(_0x40a385[_0x5d96('0x11')][_0x5d96('0x13')]);}else{logger[_0x5d96('0x14')](_0x5d96('0xc'),_0x595ad3,_0x5d96('0xd'));_0x27184c(_0x40a385[_0x5d96('0x15')]['message']);}})['catch'](function(_0x286bbf){logger[_0x5d96('0x11')](_0x5d96('0xc'),_0x595ad3,_0x286bbf);_0x3498a6(_0x286bbf);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 2bef885..7221228 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 _0xdab2=['%s%s','logo','extname','originalname','post','/:id/logo','single','file','logologin','/:id/logo_login','preferred','addPreferred','favicon','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','getDate','/:id','show','getLogo','getLogoLogin','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format'];(function(_0x4711db,_0x9d87c7){var _0x34c5dd=function(_0xde1e0f){while(--_0xde1e0f){_0x4711db['push'](_0x4711db['shift']());}};_0x34c5dd(++_0x9d87c7);}(_0xdab2,0xb0));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var path=require(_0x2dab('0x2'));var timeout=require(_0x2dab('0x3'));var express=require('express');var router=express[_0x2dab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2dab('0x5'));var interaction=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var controller=require('./setting.controller');router['get']('/',auth[_0x2dab('0x8')](),controller[_0x2dab('0x9')]);router[_0x2dab('0xa')]('/now',controller[_0x2dab('0xb')]);router[_0x2dab('0xa')](_0x2dab('0xc'),controller[_0x2dab('0xd')]);router[_0x2dab('0xa')]('/:id/logo',controller[_0x2dab('0xe')]);router['get']('/:id/logo_login',controller[_0x2dab('0xf')]);router[_0x2dab('0xa')]('/:id/gdpr',controller['gdpr']);router[_0x2dab('0xa')](_0x2dab('0x10'),controller[_0x2dab('0x11')]);router[_0x2dab('0xa')]('/:id/favicon',controller[_0x2dab('0x12')]);var upload=multer({'storage':multer[_0x2dab('0x13')]({'destination':function(_0x311611,_0x549051,_0x2a87d7){_0x2a87d7(null,path[_0x2dab('0x14')](config[_0x2dab('0x15')],_0x2dab('0x16')));},'filename':function(_0x5aa0d7,_0x40200b,_0x17b5de){_0x17b5de(null,util[_0x2dab('0x17')](_0x2dab('0x18'),_0x2dab('0x19'),path[_0x2dab('0x1a')](_0x40200b[_0x2dab('0x1b')])));}})});router[_0x2dab('0x1c')](_0x2dab('0x1d'),upload[_0x2dab('0x1e')](_0x2dab('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x2dab('0x13')]({'destination':function(_0x2d438b,_0x2951d4,_0x375dde){_0x375dde(null,path[_0x2dab('0x14')](config[_0x2dab('0x15')],_0x2dab('0x16')));},'filename':function(_0x2bf3d2,_0x337d86,_0x12d232){_0x12d232(null,util[_0x2dab('0x17')](_0x2dab('0x18'),_0x2dab('0x20'),path['extname'](_0x337d86[_0x2dab('0x1b')])));}})});router['post'](_0x2dab('0x21'),upload[_0x2dab('0x1e')](_0x2dab('0x1f')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x2dab('0x13')]({'destination':function(_0x16b0cc,_0x1128eb,_0x2eeb90){_0x2eeb90(null,path[_0x2dab('0x14')](config[_0x2dab('0x15')],'server/files/images/logos/'));},'filename':function(_0x431704,_0x131f7e,_0x5dfbc9){_0x5dfbc9(null,util[_0x2dab('0x17')](_0x2dab('0x18'),_0x2dab('0x22'),path[_0x2dab('0x1a')](_0x131f7e[_0x2dab('0x1b')])));}})});router[_0x2dab('0x1c')](_0x2dab('0x10'),upload[_0x2dab('0x1e')](_0x2dab('0x1f')),controller[_0x2dab('0x23')]);var upload=multer({'storage':multer[_0x2dab('0x13')]({'destination':function(_0xcccca9,_0x1dd5c9,_0x42ebcf){_0x42ebcf(null,path[_0x2dab('0x14')](config[_0x2dab('0x15')],_0x2dab('0x16')));},'filename':function(_0x510721,_0x508fe6,_0x1f2583){_0x1f2583(null,util[_0x2dab('0x17')](_0x2dab('0x18'),_0x2dab('0x24'),path[_0x2dab('0x1a')](_0x508fe6[_0x2dab('0x1b')])));}})});router['post']('/:id/favicon',upload[_0x2dab('0x1e')](_0x2dab('0x1f')),controller['addFavicon']);router[_0x2dab('0x25')]('/:id',auth[_0x2dab('0x8')](),controller[_0x2dab('0x26')]);module[_0x2dab('0x27')]=router; \ No newline at end of file +var _0x3d8e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','format','%s%s','logo','extname','originalname','post','file','addLogo','join','root','server/files/images/logos/','logologin','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','exports','multer','path','connect-timeout','express'];(function(_0x110c7c,_0x5c7106){var _0x58c09d=function(_0x16a7c0){while(--_0x16a7c0){_0x110c7c['push'](_0x110c7c['shift']());}};_0x58c09d(++_0x5c7106);}(_0x3d8e,0xd8));var _0xe3d8=function(_0x5b1b07,_0x119df6){_0x5b1b07=_0x5b1b07-0x0;var _0x59fbbc=_0x3d8e[_0x5b1b07];return _0x59fbbc;};'use strict';var multer=require(_0xe3d8('0x0'));var util=require('util');var path=require(_0xe3d8('0x1'));var timeout=require(_0xe3d8('0x2'));var express=require(_0xe3d8('0x3'));var router=express[_0xe3d8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe3d8('0x5'));var interaction=require(_0xe3d8('0x6'));var config=require(_0xe3d8('0x7'));var controller=require(_0xe3d8('0x8'));router[_0xe3d8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe3d8('0x9')](_0xe3d8('0xa'),controller['getDate']);router['get'](_0xe3d8('0xb'),controller[_0xe3d8('0xc')]);router[_0xe3d8('0x9')](_0xe3d8('0xd'),controller[_0xe3d8('0xe')]);router[_0xe3d8('0x9')](_0xe3d8('0xf'),controller[_0xe3d8('0x10')]);router[_0xe3d8('0x9')](_0xe3d8('0x11'),controller[_0xe3d8('0x12')]);router['get'](_0xe3d8('0x13'),controller[_0xe3d8('0x14')]);router[_0xe3d8('0x9')](_0xe3d8('0x15'),controller[_0xe3d8('0x16')]);var upload=multer({'storage':multer[_0xe3d8('0x17')]({'destination':function(_0xeb29ca,_0x50cef5,_0x12be57){_0x12be57(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x5cf562,_0x641042,_0x994223){_0x994223(null,util[_0xe3d8('0x18')](_0xe3d8('0x19'),_0xe3d8('0x1a'),path[_0xe3d8('0x1b')](_0x641042[_0xe3d8('0x1c')])));}})});router[_0xe3d8('0x1d')](_0xe3d8('0xd'),upload['single'](_0xe3d8('0x1e')),controller[_0xe3d8('0x1f')]);var upload=multer({'storage':multer[_0xe3d8('0x17')]({'destination':function(_0x12b64e,_0x2d42ab,_0x49d07a){_0x49d07a(null,path[_0xe3d8('0x20')](config[_0xe3d8('0x21')],_0xe3d8('0x22')));},'filename':function(_0x483ab7,_0x3532af,_0x524cf5){_0x524cf5(null,util[_0xe3d8('0x18')](_0xe3d8('0x19'),_0xe3d8('0x23'),path['extname'](_0x3532af[_0xe3d8('0x1c')])));}})});router['post'](_0xe3d8('0xf'),upload['single']('file'),controller[_0xe3d8('0x24')]);var upload=multer({'storage':multer[_0xe3d8('0x17')]({'destination':function(_0x202f0f,_0x4ad208,_0x28dc5d){_0x28dc5d(null,path[_0xe3d8('0x20')](config[_0xe3d8('0x21')],_0xe3d8('0x22')));},'filename':function(_0x3f6ae4,_0x3fcfae,_0x5d982a){_0x5d982a(null,util[_0xe3d8('0x18')](_0xe3d8('0x19'),_0xe3d8('0x25'),path[_0xe3d8('0x1b')](_0x3fcfae[_0xe3d8('0x1c')])));}})});router['post']('/:id/preferred',upload['single']('file'),controller[_0xe3d8('0x26')]);var upload=multer({'storage':multer[_0xe3d8('0x17')]({'destination':function(_0x428ce4,_0x5b515e,_0x465e97){_0x465e97(null,path['join'](config[_0xe3d8('0x21')],'server/files/images/logos/'));},'filename':function(_0x1538d9,_0x1fb0f9,_0x423a5a){_0x423a5a(null,util[_0xe3d8('0x18')](_0xe3d8('0x19'),_0xe3d8('0x27'),path[_0xe3d8('0x1b')](_0x1fb0f9['originalname'])));}})});router['post'](_0xe3d8('0x15'),upload['single'](_0xe3d8('0x1e')),controller[_0xe3d8('0x28')]);router[_0xe3d8('0x29')](_0xe3d8('0xb'),auth[_0xe3d8('0x2a')](),controller['update']);module[_0xe3d8('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index a52ab74..a7950bd 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 _0x80b9=['UNSIGNED','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x55ce48,_0x109771){var _0x43f3bf=function(_0x1e0dd9){while(--_0x1e0dd9){_0x55ce48['push'](_0x55ce48['shift']());}};_0x43f3bf(++_0x109771);}(_0x80b9,0x1d5));var _0x980b=function(_0x2cc8a1,_0x2035fb){_0x2cc8a1=_0x2cc8a1-0x0;var _0x378003=_0x80b9[_0x2cc8a1];return _0x378003;};'use strict';var Sequelize=require('sequelize');module[_0x980b('0x0')]={'min_internal':{'type':Sequelize[_0x980b('0x1')](0xb),'unique':_0x980b('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x980b('0x1')](0xb),'unique':_0x980b('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x980b('0x4')],'defaultValue':_0x980b('0x5')},'logo':{'type':Sequelize[_0x980b('0x4')]},'defaultLogo':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x980b('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x980b('0x4')]},'turnusername':{'type':Sequelize[_0x980b('0x4')]},'turnpassword':{'type':Sequelize[_0x980b('0x4')]},'pageTitle':{'type':Sequelize[_0x980b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x980b('0x7')},'enableEmailPreview':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x980b('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x980b('0x1')]},'transcribeRegion':{'type':Sequelize[_0x980b('0x4')]},'sentiment':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x980b('0x1')]},'sentimentRegion':{'type':Sequelize[_0x980b('0x4')]},'language':{'type':Sequelize[_0x980b('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x980b('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x980b('0x1')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x980b('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x980b('0x1')](0x2)[_0x980b('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x980b('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x980b('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x980b('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xadb1=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','exports','INTEGER','min_internal','min_mailbox'];(function(_0x3c8959,_0x1925ba){var _0x4e852e=function(_0x5d23e3){while(--_0x5d23e3){_0x3c8959['push'](_0x3c8959['shift']());}};_0x4e852e(++_0x1925ba);}(_0xadb1,0x182));var _0x1adb=function(_0x41d276,_0x447506){_0x41d276=_0x41d276-0x0;var _0xc82ed7=_0xadb1[_0x41d276];return _0xc82ed7;};'use strict';var Sequelize=require('sequelize');module[_0x1adb('0x0')]={'min_internal':{'type':Sequelize[_0x1adb('0x1')](0xb),'unique':_0x1adb('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1adb('0x1')](0xb),'unique':_0x1adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1adb('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1adb('0x4')],'defaultValue':_0x1adb('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x1adb('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x1adb('0x4')]},'turnusername':{'type':Sequelize[_0x1adb('0x4')]},'turnpassword':{'type':Sequelize[_0x1adb('0x4')]},'pageTitle':{'type':Sequelize[_0x1adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1adb('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1adb('0x4')],'defaultValue':_0x1adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1adb('0x4')],'defaultValue':_0x1adb('0x8')},'chatTimeout':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1adb('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1adb('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x1adb('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1adb('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1adb('0x4')]},'language':{'type':Sequelize[_0x1adb('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x1adb('0x1')](0x2)[_0x1adb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1adb('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1adb('0x1')](0x2)[_0x1adb('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1adb('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1adb('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x1adb('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index f56ed74..fd890ed 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 _0x4b99=['toLower','join','default_logo.svg','default','upperFirst','Sequelize','getLogoLogin','favicon','default_loginLogo.svg','custom','ValidationError','\x20not\x20found','download','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','Setting','includeAll','include','show','params','find','body','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','logo','existsSync','root'];(function(_0x44c340,_0x575719){var _0x2cd080=function(_0x1109ea){while(--_0x1109ea){_0x44c340['push'](_0x44c340['shift']());}};_0x2cd080(++_0x575719);}(_0x4b99,0x107));var _0x94b9=function(_0x1e7e18,_0x4539d7){_0x1e7e18=_0x1e7e18-0x0;var _0x19d7d3=_0x4b99[_0x1e7e18];return _0x19d7d3;};'use strict';var emlformat=require(_0x94b9('0x0'));var rimraf=require(_0x94b9('0x1'));var zipdir=require(_0x94b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x94b9('0x3'));var BPromise=require(_0x94b9('0x4'));var Mustache=require('mustache');var util=require(_0x94b9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x94b9('0x6'));var ejs=require(_0x94b9('0x7'));var fs=require('fs');var fs_extra=require(_0x94b9('0x8'));var _=require(_0x94b9('0x9'));var squel=require(_0x94b9('0xa'));var crypto=require('crypto');var jsforce=require(_0x94b9('0xb'));var deskjs=require(_0x94b9('0xc'));var toCsv=require(_0x94b9('0x6'));var querystring=require('querystring');var Papa=require(_0x94b9('0xd'));var Redis=require('ioredis');var authService=require(_0x94b9('0xe'));var qs=require(_0x94b9('0xf'));var as=require(_0x94b9('0x10'));var hardwareService=require(_0x94b9('0x11'));var logger=require(_0x94b9('0x12'))(_0x94b9('0x13'));var utils=require(_0x94b9('0x14'));var config=require(_0x94b9('0x15'));var licenseUtil=require(_0x94b9('0x16'));var db=require(_0x94b9('0x17'))['db'];var jayson=require(_0x94b9('0x18'));var client=jayson[_0x94b9('0x19')][_0x94b9('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1232a,_0x52b54a,_0x4c639f,_0x424934){return new BPromise(function(_0x5341e3,_0x42a5fb){var _0x93012f=_0x424934||client;return _0x93012f['request'](_0x1232a,_0x4c639f)[_0x94b9('0x1b')](function(_0xf9cf71){logger['info']('Setting,\x20%s,\x20%s',_0x52b54a,_0x94b9('0x1c'));logger[_0x94b9('0x1d')](_0x94b9('0x1e'),_0x52b54a,_0x94b9('0x1c'),JSON[_0x94b9('0x1f')](_0xf9cf71));if(_0xf9cf71['error']){if(_0xf9cf71[_0x94b9('0x20')][_0x94b9('0x21')]===0x1f4){logger['error'](_0x94b9('0x22'),_0x52b54a,_0xf9cf71['error'][_0x94b9('0x23')]);return _0x42a5fb(_0xf9cf71[_0x94b9('0x20')][_0x94b9('0x23')]);}logger[_0x94b9('0x20')](_0x94b9('0x22'),_0x52b54a,_0xf9cf71[_0x94b9('0x20')][_0x94b9('0x23')]);return _0x5341e3(_0xf9cf71['error'][_0x94b9('0x23')]);}else{logger[_0x94b9('0x24')](_0x94b9('0x22'),_0x52b54a,_0x94b9('0x1c'));_0x5341e3(_0xf9cf71[_0x94b9('0x25')]['message']);}})[_0x94b9('0x26')](function(_0x29dad6){logger[_0x94b9('0x20')](_0x94b9('0x22'),_0x52b54a,_0x29dad6);_0x42a5fb(_0x29dad6);});});}function respondWithStatusCode(_0x3f0f02,_0x22b3dc){_0x22b3dc=_0x22b3dc||0xcc;return function(_0x14edb3){if(_0x14edb3){return _0x3f0f02['sendStatus'](_0x22b3dc);}return _0x3f0f02[_0x94b9('0x27')](_0x22b3dc)[_0x94b9('0x28')]();};}function respondWithResult(_0x356ed9,_0x33366a){_0x33366a=_0x33366a||0xc8;return function(_0x25aca4){if(_0x25aca4){return _0x356ed9[_0x94b9('0x27')](_0x33366a)[_0x94b9('0x29')](_0x25aca4);}};}function respondWithFilteredResult(_0x14cba7,_0x53bb4d){return function(_0x480fb8){if(_0x480fb8){var _0x51514e=typeof _0x53bb4d[_0x94b9('0x2a')]===_0x94b9('0x2b')&&typeof _0x53bb4d['limit']===_0x94b9('0x2b');var _0x2b5a48=_0x480fb8[_0x94b9('0x2c')];var _0x2ce868=_0x51514e?0x0:_0x53bb4d[_0x94b9('0x2a')];var _0xabf559=_0x51514e?_0x480fb8[_0x94b9('0x2c')]:_0x53bb4d[_0x94b9('0x2a')]+_0x53bb4d[_0x94b9('0x2d')];var _0x592e73;if(_0xabf559>=_0x2b5a48){_0xabf559=_0x2b5a48;_0x592e73=0xc8;}else{_0x592e73=0xce;}_0x14cba7['status'](_0x592e73);return _0x14cba7['set'](_0x94b9('0x2e'),_0x2ce868+'-'+_0xabf559+'/'+_0x2b5a48)['json'](_0x480fb8);}return null;};}function patchUpdates(_0x509370){return function(_0x566c02){try{jsonpatch[_0x94b9('0x2f')](_0x566c02,_0x509370,!![]);}catch(_0x5ce4fe){return BPromise['reject'](_0x5ce4fe);}return _0x566c02[_0x94b9('0x30')]();};}function saveUpdates(_0x2b797b,_0x3c9c93){return function(_0x5c0aca){if(_0x5c0aca){return _0x5c0aca[_0x94b9('0x31')](_0x2b797b)[_0x94b9('0x1b')](function(_0x14c607){return _0x14c607;});}return null;};}function removeEntity(_0x25acab,_0x15a8dc){return function(_0x5a8737){if(_0x5a8737){return _0x5a8737['destroy']()[_0x94b9('0x1b')](function(){_0x25acab['status'](0xcc)[_0x94b9('0x28')]();});}};}function handleEntityNotFound(_0x58e286,_0xb91a00){return function(_0xd520f){if(!_0xd520f){_0x58e286['sendStatus'](0x194);}return _0xd520f;};}function handleError(_0x3e265d,_0xf60f82){_0xf60f82=_0xf60f82||0x1f4;return function(_0x4f52e5){logger[_0x94b9('0x20')](_0x4f52e5[_0x94b9('0x32')]);if(_0x4f52e5[_0x94b9('0x33')]){delete _0x4f52e5[_0x94b9('0x33')];}_0x3e265d[_0x94b9('0x27')](_0xf60f82)[_0x94b9('0x34')](_0x4f52e5);};}exports[_0x94b9('0x35')]=function(_0x44f93b,_0x459ae8){var _0x260398={},_0x27659f={},_0x4cde3e={'count':0x0,'rows':[]};var _0x94973e=_['map'](db['Setting'][_0x94b9('0x36')],function(_0x7ad2ab){return{'name':_0x7ad2ab[_0x94b9('0x37')],'type':_0x7ad2ab[_0x94b9('0x38')]['key']};});_0x27659f[_0x94b9('0x39')]=_['map'](_0x94973e,_0x94b9('0x33'));_0x27659f[_0x94b9('0x3a')]=_[_0x94b9('0x3b')](_0x44f93b[_0x94b9('0x3a')]);_0x27659f[_0x94b9('0x3c')]=_[_0x94b9('0x3d')](_0x27659f[_0x94b9('0x39')],_0x27659f[_0x94b9('0x3a')]);_0x260398['attributes']=_[_0x94b9('0x3d')](_0x27659f[_0x94b9('0x39')],qs[_0x94b9('0x3e')](_0x44f93b[_0x94b9('0x3a')][_0x94b9('0x3e')]));_0x260398[_0x94b9('0x3f')]=_0x260398[_0x94b9('0x3f')][_0x94b9('0x40')]?_0x260398[_0x94b9('0x3f')]:_0x27659f[_0x94b9('0x39')];if(!_0x44f93b['query']['hasOwnProperty'](_0x94b9('0x41'))){_0x260398[_0x94b9('0x2d')]=qs[_0x94b9('0x2d')](_0x44f93b[_0x94b9('0x3a')][_0x94b9('0x2d')]);_0x260398[_0x94b9('0x2a')]=qs[_0x94b9('0x2a')](_0x44f93b[_0x94b9('0x3a')][_0x94b9('0x2a')]);}_0x260398['order']=qs['sort'](_0x44f93b[_0x94b9('0x3a')][_0x94b9('0x42')]);_0x260398[_0x94b9('0x43')]=qs[_0x94b9('0x3c')](_[_0x94b9('0x44')](_0x44f93b[_0x94b9('0x3a')],_0x27659f['filters']),_0x94973e);if(_0x44f93b['query'][_0x94b9('0x45')]){_0x260398[_0x94b9('0x43')]=_[_0x94b9('0x46')](_0x260398['where'],{'$or':_[_0x94b9('0x47')](_0x94973e,function(_0x3b9629){if(_0x3b9629[_0x94b9('0x38')]!==_0x94b9('0x48')){var _0x47bd2a={};_0x47bd2a[_0x3b9629[_0x94b9('0x33')]]={'$like':'%'+_0x44f93b[_0x94b9('0x3a')][_0x94b9('0x45')]+'%'};return _0x47bd2a;}})});}_0x260398=_[_0x94b9('0x46')]({},_0x260398,_0x44f93b['options']);var _0x56d11a={'where':_0x260398[_0x94b9('0x43')]};return db[_0x94b9('0x49')][_0x94b9('0x2c')](_0x56d11a)[_0x94b9('0x1b')](function(_0x19530c){_0x4cde3e[_0x94b9('0x2c')]=_0x19530c;if(_0x44f93b[_0x94b9('0x3a')][_0x94b9('0x4a')]){_0x260398[_0x94b9('0x4b')]=[{'all':!![]}];}return db[_0x94b9('0x49')]['findAll'](_0x260398);})[_0x94b9('0x1b')](function(_0x3d6805){_0x4cde3e['rows']=_0x3d6805;return _0x4cde3e;})['then'](respondWithFilteredResult(_0x459ae8,_0x260398))[_0x94b9('0x26')](handleError(_0x459ae8,null));};exports[_0x94b9('0x4c')]=function(_0x1a790e,_0x2b3763){var _0x221662={'raw':![],'where':{'id':_0x1a790e[_0x94b9('0x4d')]['id']}},_0x4e80e4={};_0x4e80e4[_0x94b9('0x39')]=_['keys'](db['Setting'][_0x94b9('0x36')]);_0x4e80e4[_0x94b9('0x3a')]=_['keys'](_0x1a790e[_0x94b9('0x3a')]);_0x4e80e4[_0x94b9('0x3c')]=_[_0x94b9('0x3d')](_0x4e80e4[_0x94b9('0x39')],_0x4e80e4[_0x94b9('0x3a')]);_0x221662[_0x94b9('0x3f')]=_[_0x94b9('0x3d')](_0x4e80e4[_0x94b9('0x39')],qs[_0x94b9('0x3e')](_0x1a790e['query'][_0x94b9('0x3e')]));_0x221662[_0x94b9('0x3f')]=_0x221662[_0x94b9('0x3f')][_0x94b9('0x40')]?_0x221662[_0x94b9('0x3f')]:_0x4e80e4['model'];if(_0x1a790e['query'][_0x94b9('0x4a')]){_0x221662[_0x94b9('0x4b')]=[{'all':!![]}];}_0x221662=_['merge']({},_0x221662,_0x1a790e['options']);return db[_0x94b9('0x49')][_0x94b9('0x4e')](_0x221662)[_0x94b9('0x1b')](handleEntityNotFound(_0x2b3763,null))['then'](respondWithResult(_0x2b3763,null))[_0x94b9('0x26')](handleError(_0x2b3763,null));};exports['update']=function(_0x1227f3,_0x294d3b){if(_0x1227f3[_0x94b9('0x4f')]['id']){delete _0x1227f3[_0x94b9('0x4f')]['id'];}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x1227f3[_0x94b9('0x4d')]['id']}})[_0x94b9('0x1b')](handleEntityNotFound(_0x294d3b,null))[_0x94b9('0x1b')](saveUpdates(_0x1227f3[_0x94b9('0x4f')],null))[_0x94b9('0x1b')](respondWithResult(_0x294d3b,null))['catch'](handleError(_0x294d3b,null));};exports['addLogo']=function(_0x5844d2,_0x1b1516,_0x3c34ec){if(_0x5844d2['file']&&_0x5844d2[_0x94b9('0x50')][_0x94b9('0x51')]){_0x5844d2['body']['logo']=_0x5844d2[_0x94b9('0x50')][_0x94b9('0x51')];}return db['Setting'][_0x94b9('0x4e')]({'where':{'id':_0x5844d2[_0x94b9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1b1516,null))[_0x94b9('0x1b')](saveUpdates(_0x5844d2['body'],null))['then'](respondWithResult(_0x1b1516,null))[_0x94b9('0x26')](handleError(_0x1b1516,null));};exports[_0x94b9('0x52')]=function(_0x43f139,_0x4985d9,_0x2f19ef){if(_0x43f139[_0x94b9('0x50')]&&_0x43f139['file'][_0x94b9('0x51')]){_0x43f139[_0x94b9('0x4f')][_0x94b9('0x53')]=_0x43f139[_0x94b9('0x50')][_0x94b9('0x51')];}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x43f139['params']['id']}})['then'](handleEntityNotFound(_0x4985d9,null))['then'](saveUpdates(_0x43f139[_0x94b9('0x4f')],null))[_0x94b9('0x1b')](respondWithResult(_0x4985d9,null))['catch'](handleError(_0x4985d9,null));};var utilLicense=require(_0x94b9('0x16'));exports[_0x94b9('0x54')]=function(_0x3a1c5a,_0x296e28,_0x10a7dc){var _0x17d756=_0x94b9('0x55');var _0x572aef={'custom':![]};return utilLicense[_0x94b9('0x56')]()['then'](function(_0x34fc47){if(_0x34fc47){_0x572aef=_0x34fc47;}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x3a1c5a[_0x94b9('0x4d')]['id']},'attributes':['logo',_0x94b9('0x53'),_0x94b9('0x57'),'favicon',_0x94b9('0x58'),_0x94b9('0x59'),'defaultPreferred',_0x94b9('0x5a')],'raw':!![]});})[_0x94b9('0x1b')](handleEntityNotFound(_0x296e28,null))[_0x94b9('0x1b')](function(_0x3d7e50){if(_0x3d7e50){var _0x519acc=_0x3d7e50[_0x94b9('0x5b')]&&fs[_0x94b9('0x5c')](path['join'](config[_0x94b9('0x5d')],_0x17d756,_[_0x94b9('0x5e')](_0x3d7e50[_0x94b9('0x5b')])))?path[_0x94b9('0x5f')](config[_0x94b9('0x5d')],_0x17d756,_['toLower'](_0x3d7e50[_0x94b9('0x5b')])):path['join'](config[_0x94b9('0x5d')],_0x17d756,_[_0x94b9('0x5e')](_0x94b9('0x60')));var _0x210e13=_0x94b9('0x61')+_[_0x94b9('0x62')](_0x94b9('0x5b'));if(_0x3d7e50[_0x210e13]||!_0x572aef['custom']){_0x519acc=path['join'](config[_0x94b9('0x5d')],_0x17d756,_[_0x94b9('0x5e')](_0x94b9('0x60')));}if(!fs[_0x94b9('0x5c')](_0x519acc)){throw new db[(_0x94b9('0x63'))]['ValidationError'](_[_0x94b9('0x62')](_0x94b9('0x5b'))+'\x20not\x20found');}return _0x296e28['download'](_0x519acc);}})[_0x94b9('0x26')](handleError(_0x296e28,null));};var utilLicense=require(_0x94b9('0x16'));exports[_0x94b9('0x64')]=function(_0x1928bb,_0x22a2a0,_0x3915df){var _0x377159=_0x94b9('0x55');var _0x4cca6f={'custom':![]};return utilLicense[_0x94b9('0x56')]()[_0x94b9('0x1b')](function(_0x2427ca){if(_0x2427ca){_0x4cca6f=_0x2427ca;}return db['Setting'][_0x94b9('0x4e')]({'where':{'id':_0x1928bb['params']['id']},'attributes':[_0x94b9('0x5b'),_0x94b9('0x53'),'preferred',_0x94b9('0x65'),_0x94b9('0x58'),_0x94b9('0x59'),'defaultPreferred',_0x94b9('0x5a')],'raw':!![]});})[_0x94b9('0x1b')](handleEntityNotFound(_0x22a2a0,null))[_0x94b9('0x1b')](function(_0x963509){if(_0x963509){var _0xceef33=_0x963509[_0x94b9('0x53')]&&fs[_0x94b9('0x5c')](path['join'](config[_0x94b9('0x5d')],_0x377159,_[_0x94b9('0x5e')](_0x963509[_0x94b9('0x53')])))?path['join'](config['root'],_0x377159,_['toLower'](_0x963509[_0x94b9('0x53')])):path[_0x94b9('0x5f')](config['root'],_0x377159,_[_0x94b9('0x5e')](_0x94b9('0x66')));var _0x47614a=_0x94b9('0x61')+_[_0x94b9('0x62')](_0x94b9('0x53'));if(_0x963509[_0x47614a]||!_0x4cca6f[_0x94b9('0x67')]){_0xceef33=path[_0x94b9('0x5f')](config[_0x94b9('0x5d')],_0x377159,_['toLower'](_0x94b9('0x66')));}if(!fs['existsSync'](_0xceef33)){throw new db['Sequelize'][(_0x94b9('0x68'))](_[_0x94b9('0x62')]('loginLogo')+_0x94b9('0x69'));}return _0x22a2a0[_0x94b9('0x6a')](_0xceef33);}})['catch'](handleError(_0x22a2a0,null));};exports[_0x94b9('0x6b')]=function(_0xa4eebc,_0x1f2e7e){return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0xa4eebc['params']['id']},'attributes':[_0x94b9('0x6c')]})[_0x94b9('0x1b')](respondWithResult(_0x1f2e7e,null))[_0x94b9('0x26')](handleError(_0x1f2e7e,null));};exports[_0x94b9('0x6d')]=function(_0x359cda,_0x2977ad,_0x34dff2){if(_0x359cda[_0x94b9('0x50')]&&_0x359cda[_0x94b9('0x50')][_0x94b9('0x51')]){_0x359cda['body'][_0x94b9('0x57')]=_0x359cda[_0x94b9('0x50')][_0x94b9('0x51')];}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x359cda[_0x94b9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2977ad,null))[_0x94b9('0x1b')](saveUpdates(_0x359cda['body'],null))['then'](respondWithResult(_0x2977ad,null))[_0x94b9('0x26')](handleError(_0x2977ad,null));};var utilLicense=require(_0x94b9('0x16'));exports[_0x94b9('0x6e')]=function(_0x1319a8,_0x11a6a2,_0x2b4f9f){var _0x5075ac=_0x94b9('0x55');var _0x4d0e94={'custom':![]};return utilLicense[_0x94b9('0x56')]()['then'](function(_0x468cb8){if(_0x468cb8){_0x4d0e94=_0x468cb8;}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x1319a8[_0x94b9('0x4d')]['id']},'attributes':[_0x94b9('0x5b'),_0x94b9('0x53'),_0x94b9('0x57'),_0x94b9('0x65'),_0x94b9('0x58'),_0x94b9('0x59'),_0x94b9('0x6f'),'defaultFavicon'],'raw':!![]});})[_0x94b9('0x1b')](handleEntityNotFound(_0x11a6a2,null))['then'](function(_0x40dc50){if(_0x40dc50){var _0x37ca96=_0x40dc50['preferred']&&fs[_0x94b9('0x5c')](path[_0x94b9('0x5f')](config['root'],_0x5075ac,_['toLower'](_0x40dc50[_0x94b9('0x57')])))?path[_0x94b9('0x5f')](config['root'],_0x5075ac,_[_0x94b9('0x5e')](_0x40dc50['preferred'])):path[_0x94b9('0x5f')](config[_0x94b9('0x5d')],_0x5075ac,_['toLower'](_0x94b9('0x70')));var _0x400979='default'+_[_0x94b9('0x62')](_0x94b9('0x57'));if(_0x40dc50[_0x400979]||!_0x4d0e94['custom']||!_0x4d0e94[_0x94b9('0x57')]){_0x37ca96=path['join'](config['root'],_0x5075ac,_['toLower']('default_preferred.png'));}if(!fs[_0x94b9('0x5c')](_0x37ca96)){throw new db['Sequelize']['ValidationError'](_[_0x94b9('0x62')](_0x94b9('0x57'))+'\x20not\x20found');}return _0x11a6a2['download'](_0x37ca96);}})[_0x94b9('0x26')](handleError(_0x11a6a2,null));};exports[_0x94b9('0x71')]=function(_0x22ef2e,_0x30aea3,_0x1dea03){if(_0x22ef2e[_0x94b9('0x50')]&&_0x22ef2e[_0x94b9('0x50')][_0x94b9('0x51')]){_0x22ef2e[_0x94b9('0x4f')][_0x94b9('0x65')]=_0x22ef2e['file'][_0x94b9('0x51')];}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x22ef2e[_0x94b9('0x4d')]['id']}})[_0x94b9('0x1b')](handleEntityNotFound(_0x30aea3,null))['then'](saveUpdates(_0x22ef2e['body'],null))[_0x94b9('0x1b')](respondWithResult(_0x30aea3,null))[_0x94b9('0x26')](handleError(_0x30aea3,null));};var utilLicense=require(_0x94b9('0x16'));exports[_0x94b9('0x72')]=function(_0x1f00ef,_0x4eb7ea,_0x3df719){var _0x2a8875=_0x94b9('0x55');var _0x3c5c7a={'custom':![]};return utilLicense[_0x94b9('0x56')]()['then'](function(_0xce58fa){if(_0xce58fa){_0x3c5c7a=_0xce58fa;}return db[_0x94b9('0x49')][_0x94b9('0x4e')]({'where':{'id':_0x1f00ef[_0x94b9('0x4d')]['id']},'attributes':['logo',_0x94b9('0x53'),_0x94b9('0x57'),'favicon',_0x94b9('0x58'),_0x94b9('0x59'),'defaultPreferred',_0x94b9('0x5a')],'raw':!![]});})[_0x94b9('0x1b')](handleEntityNotFound(_0x4eb7ea,null))[_0x94b9('0x1b')](function(_0x201241){if(_0x201241){var _0x3ea6e6=_0x201241[_0x94b9('0x65')]&&fs[_0x94b9('0x5c')](path['join'](config[_0x94b9('0x5d')],_0x2a8875,_[_0x94b9('0x5e')](_0x201241[_0x94b9('0x65')])))?path['join'](config[_0x94b9('0x5d')],_0x2a8875,_[_0x94b9('0x5e')](_0x201241[_0x94b9('0x65')])):path[_0x94b9('0x5f')](config['root'],_0x2a8875,_[_0x94b9('0x5e')]('default_favicon.ico'));var _0x332e7d=_0x94b9('0x61')+_['upperFirst']('favicon');if(_0x201241[_0x332e7d]||!_0x3c5c7a[_0x94b9('0x67')]){_0x3ea6e6=path[_0x94b9('0x5f')](config['root'],_0x2a8875,_[_0x94b9('0x5e')](_0x94b9('0x73')));}if(!fs[_0x94b9('0x5c')](_0x3ea6e6)){throw new db[(_0x94b9('0x63'))][(_0x94b9('0x68'))](_[_0x94b9('0x62')](_0x94b9('0x65'))+_0x94b9('0x69'));}return _0x4eb7ea[_0x94b9('0x6a')](_0x3ea6e6);}})[_0x94b9('0x26')](handleError(_0x4eb7ea,null));};exports['getDate']=function(_0x52c15b,_0x1c5f58){var _0x33863d={'offset':moment()[_0x94b9('0x74')]()};_0x33863d['now']=moment()[_0x94b9('0x74')](_0x33863d[_0x94b9('0x2a')])[_0x94b9('0x75')](_0x94b9('0x76'));return _0x1c5f58[_0x94b9('0x27')](0xc8)['send'](_0x33863d);}; \ No newline at end of file +var _0xe4ef=['utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','params','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','ValidationError','addFavicon','getFavicon','default_favicon.ico','getDate'];(function(_0x38a8bd,_0x49a80b){var _0x2c0d77=function(_0x313b15){while(--_0x313b15){_0x38a8bd['push'](_0x38a8bd['shift']());}};_0x2c0d77(++_0x49a80b);}(_0xe4ef,0x17b));var _0xfe4e=function(_0x268eda,_0x141c64){_0x268eda=_0x268eda-0x0;var _0x2304cd=_0xe4ef[_0x268eda];return _0x2304cd;};'use strict';var emlformat=require(_0xfe4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe4e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe4e('0x2'));var moment=require(_0xfe4e('0x3'));var BPromise=require(_0xfe4e('0x4'));var Mustache=require(_0xfe4e('0x5'));var util=require(_0xfe4e('0x6'));var path=require(_0xfe4e('0x7'));var sox=require(_0xfe4e('0x8'));var csv=require(_0xfe4e('0x9'));var ejs=require(_0xfe4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe4e('0xb'));var squel=require('squel');var crypto=require(_0xfe4e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfe4e('0xd'));var toCsv=require(_0xfe4e('0x9'));var querystring=require('querystring');var Papa=require(_0xfe4e('0xe'));var Redis=require(_0xfe4e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfe4e('0x10'));var as=require(_0xfe4e('0x11'));var hardwareService=require(_0xfe4e('0x12'));var logger=require(_0xfe4e('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfe4e('0x14'));var db=require(_0xfe4e('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfe4e('0x16')][_0xfe4e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xfba888,_0x30a62e,_0x1da2f1,_0x50b19d){return new BPromise(function(_0x86c1b6,_0x107dbc){var _0x4d1bef=_0x50b19d||client;return _0x4d1bef[_0xfe4e('0x18')](_0xfba888,_0x1da2f1)['then'](function(_0x422c88){logger[_0xfe4e('0x19')](_0xfe4e('0x1a'),_0x30a62e,_0xfe4e('0x1b'));logger[_0xfe4e('0x1c')](_0xfe4e('0x1d'),_0x30a62e,'request\x20sent',JSON['stringify'](_0x422c88));if(_0x422c88['error']){if(_0x422c88[_0xfe4e('0x1e')][_0xfe4e('0x1f')]===0x1f4){logger[_0xfe4e('0x1e')]('Setting,\x20%s,\x20%s',_0x30a62e,_0x422c88[_0xfe4e('0x1e')][_0xfe4e('0x20')]);return _0x107dbc(_0x422c88['error'][_0xfe4e('0x20')]);}logger[_0xfe4e('0x1e')]('Setting,\x20%s,\x20%s',_0x30a62e,_0x422c88[_0xfe4e('0x1e')][_0xfe4e('0x20')]);return _0x86c1b6(_0x422c88['error'][_0xfe4e('0x20')]);}else{logger[_0xfe4e('0x19')](_0xfe4e('0x1a'),_0x30a62e,'request\x20sent');_0x86c1b6(_0x422c88[_0xfe4e('0x21')]['message']);}})['catch'](function(_0x5e57f9){logger[_0xfe4e('0x1e')](_0xfe4e('0x1a'),_0x30a62e,_0x5e57f9);_0x107dbc(_0x5e57f9);});});}function respondWithStatusCode(_0xd2a820,_0x13330b){_0x13330b=_0x13330b||0xcc;return function(_0x234ea6){if(_0x234ea6){return _0xd2a820['sendStatus'](_0x13330b);}return _0xd2a820['status'](_0x13330b)['end']();};}function respondWithResult(_0x2a3a79,_0x5afc1a){_0x5afc1a=_0x5afc1a||0xc8;return function(_0x4fec2d){if(_0x4fec2d){return _0x2a3a79[_0xfe4e('0x22')](_0x5afc1a)[_0xfe4e('0x23')](_0x4fec2d);}};}function respondWithFilteredResult(_0x2d11d1,_0x3652d0){return function(_0x1bf68f){if(_0x1bf68f){var _0x431c9c=typeof _0x3652d0[_0xfe4e('0x24')]===_0xfe4e('0x25')&&typeof _0x3652d0[_0xfe4e('0x26')]===_0xfe4e('0x25');var _0x43b907=_0x1bf68f['count'];var _0x43779e=_0x431c9c?0x0:_0x3652d0['offset'];var _0x179818=_0x431c9c?_0x1bf68f[_0xfe4e('0x27')]:_0x3652d0[_0xfe4e('0x24')]+_0x3652d0[_0xfe4e('0x26')];var _0x229699;if(_0x179818>=_0x43b907){_0x179818=_0x43b907;_0x229699=0xc8;}else{_0x229699=0xce;}_0x2d11d1[_0xfe4e('0x22')](_0x229699);return _0x2d11d1[_0xfe4e('0x28')](_0xfe4e('0x29'),_0x43779e+'-'+_0x179818+'/'+_0x43b907)[_0xfe4e('0x23')](_0x1bf68f);}return null;};}function patchUpdates(_0x304769){return function(_0x4a4248){try{jsonpatch['apply'](_0x4a4248,_0x304769,!![]);}catch(_0x108bbe){return BPromise[_0xfe4e('0x2a')](_0x108bbe);}return _0x4a4248[_0xfe4e('0x2b')]();};}function saveUpdates(_0x3f268c,_0xc018e0){return function(_0x3d298a){if(_0x3d298a){return _0x3d298a[_0xfe4e('0x2c')](_0x3f268c)['then'](function(_0x3dd618){return _0x3dd618;});}return null;};}function removeEntity(_0x49c6de,_0x360c94){return function(_0x125a7a){if(_0x125a7a){return _0x125a7a[_0xfe4e('0x2d')]()[_0xfe4e('0x2e')](function(){_0x49c6de[_0xfe4e('0x22')](0xcc)[_0xfe4e('0x2f')]();});}};}function handleEntityNotFound(_0x1901f8,_0x353eca){return function(_0x442d08){if(!_0x442d08){_0x1901f8[_0xfe4e('0x30')](0x194);}return _0x442d08;};}function handleError(_0x1e6183,_0x5a984c){_0x5a984c=_0x5a984c||0x1f4;return function(_0x6fe5e){logger[_0xfe4e('0x1e')](_0x6fe5e[_0xfe4e('0x31')]);if(_0x6fe5e['name']){delete _0x6fe5e[_0xfe4e('0x32')];}_0x1e6183[_0xfe4e('0x22')](_0x5a984c)[_0xfe4e('0x33')](_0x6fe5e);};}exports[_0xfe4e('0x34')]=function(_0x14f3c9,_0x396833){var _0x28ebaa={},_0x4f204b={},_0x1e8530={'count':0x0,'rows':[]};var _0x5889c9=_[_0xfe4e('0x35')](db[_0xfe4e('0x36')][_0xfe4e('0x37')],function(_0x15e6f){return{'name':_0x15e6f[_0xfe4e('0x38')],'type':_0x15e6f[_0xfe4e('0x39')][_0xfe4e('0x3a')]};});_0x4f204b[_0xfe4e('0x3b')]=_[_0xfe4e('0x35')](_0x5889c9,_0xfe4e('0x32'));_0x4f204b[_0xfe4e('0x3c')]=_[_0xfe4e('0x3d')](_0x14f3c9[_0xfe4e('0x3c')]);_0x4f204b['filters']=_['intersection'](_0x4f204b[_0xfe4e('0x3b')],_0x4f204b[_0xfe4e('0x3c')]);_0x28ebaa[_0xfe4e('0x3e')]=_[_0xfe4e('0x3f')](_0x4f204b[_0xfe4e('0x3b')],qs['fields'](_0x14f3c9[_0xfe4e('0x3c')][_0xfe4e('0x40')]));_0x28ebaa['attributes']=_0x28ebaa[_0xfe4e('0x3e')][_0xfe4e('0x41')]?_0x28ebaa[_0xfe4e('0x3e')]:_0x4f204b[_0xfe4e('0x3b')];if(!_0x14f3c9[_0xfe4e('0x3c')]['hasOwnProperty'](_0xfe4e('0x42'))){_0x28ebaa['limit']=qs['limit'](_0x14f3c9[_0xfe4e('0x3c')][_0xfe4e('0x26')]);_0x28ebaa[_0xfe4e('0x24')]=qs['offset'](_0x14f3c9[_0xfe4e('0x3c')]['offset']);}_0x28ebaa['order']=qs[_0xfe4e('0x43')](_0x14f3c9[_0xfe4e('0x3c')][_0xfe4e('0x43')]);_0x28ebaa[_0xfe4e('0x44')]=qs[_0xfe4e('0x45')](_[_0xfe4e('0x46')](_0x14f3c9[_0xfe4e('0x3c')],_0x4f204b[_0xfe4e('0x45')]),_0x5889c9);if(_0x14f3c9[_0xfe4e('0x3c')]['filter']){_0x28ebaa[_0xfe4e('0x44')]=_[_0xfe4e('0x47')](_0x28ebaa[_0xfe4e('0x44')],{'$or':_[_0xfe4e('0x35')](_0x5889c9,function(_0x29da1b){if(_0x29da1b['type']!==_0xfe4e('0x48')){var _0x575c60={};_0x575c60[_0x29da1b[_0xfe4e('0x32')]]={'$like':'%'+_0x14f3c9['query'][_0xfe4e('0x49')]+'%'};return _0x575c60;}})});}_0x28ebaa=_[_0xfe4e('0x47')]({},_0x28ebaa,_0x14f3c9['options']);var _0x2f022b={'where':_0x28ebaa[_0xfe4e('0x44')]};return db[_0xfe4e('0x36')][_0xfe4e('0x27')](_0x2f022b)[_0xfe4e('0x2e')](function(_0x207943){_0x1e8530[_0xfe4e('0x27')]=_0x207943;if(_0x14f3c9[_0xfe4e('0x3c')][_0xfe4e('0x4a')]){_0x28ebaa[_0xfe4e('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xfe4e('0x4c')](_0x28ebaa);})[_0xfe4e('0x2e')](function(_0x21e90d){_0x1e8530[_0xfe4e('0x4d')]=_0x21e90d;return _0x1e8530;})[_0xfe4e('0x2e')](respondWithFilteredResult(_0x396833,_0x28ebaa))[_0xfe4e('0x4e')](handleError(_0x396833,null));};exports[_0xfe4e('0x4f')]=function(_0x5e3a79,_0x2eb10a){var _0x263f70={'raw':![],'where':{'id':_0x5e3a79['params']['id']}},_0x420323={};_0x420323[_0xfe4e('0x3b')]=_[_0xfe4e('0x3d')](db[_0xfe4e('0x36')][_0xfe4e('0x37')]);_0x420323[_0xfe4e('0x3c')]=_[_0xfe4e('0x3d')](_0x5e3a79[_0xfe4e('0x3c')]);_0x420323['filters']=_[_0xfe4e('0x3f')](_0x420323['model'],_0x420323[_0xfe4e('0x3c')]);_0x263f70[_0xfe4e('0x3e')]=_[_0xfe4e('0x3f')](_0x420323[_0xfe4e('0x3b')],qs[_0xfe4e('0x40')](_0x5e3a79[_0xfe4e('0x3c')]['fields']));_0x263f70['attributes']=_0x263f70[_0xfe4e('0x3e')][_0xfe4e('0x41')]?_0x263f70[_0xfe4e('0x3e')]:_0x420323[_0xfe4e('0x3b')];if(_0x5e3a79[_0xfe4e('0x3c')][_0xfe4e('0x4a')]){_0x263f70[_0xfe4e('0x4b')]=[{'all':!![]}];}_0x263f70=_[_0xfe4e('0x47')]({},_0x263f70,_0x5e3a79[_0xfe4e('0x50')]);return db['Setting'][_0xfe4e('0x51')](_0x263f70)[_0xfe4e('0x2e')](handleEntityNotFound(_0x2eb10a,null))['then'](respondWithResult(_0x2eb10a,null))[_0xfe4e('0x4e')](handleError(_0x2eb10a,null));};exports[_0xfe4e('0x2c')]=function(_0x243c74,_0x339a44){if(_0x243c74['body']['id']){delete _0x243c74['body']['id'];}return db[_0xfe4e('0x36')][_0xfe4e('0x51')]({'where':{'id':_0x243c74[_0xfe4e('0x52')]['id']}})[_0xfe4e('0x2e')](handleEntityNotFound(_0x339a44,null))[_0xfe4e('0x2e')](saveUpdates(_0x243c74[_0xfe4e('0x53')],null))[_0xfe4e('0x2e')](respondWithResult(_0x339a44,null))[_0xfe4e('0x4e')](handleError(_0x339a44,null));};exports[_0xfe4e('0x54')]=function(_0x164b07,_0xd7359f,_0x100442){if(_0x164b07[_0xfe4e('0x55')]&&_0x164b07[_0xfe4e('0x55')]['filename']){_0x164b07['body'][_0xfe4e('0x56')]=_0x164b07[_0xfe4e('0x55')][_0xfe4e('0x57')];}return db[_0xfe4e('0x36')][_0xfe4e('0x51')]({'where':{'id':_0x164b07[_0xfe4e('0x52')]['id']}})['then'](handleEntityNotFound(_0xd7359f,null))[_0xfe4e('0x2e')](saveUpdates(_0x164b07[_0xfe4e('0x53')],null))[_0xfe4e('0x2e')](respondWithResult(_0xd7359f,null))[_0xfe4e('0x4e')](handleError(_0xd7359f,null));};exports[_0xfe4e('0x58')]=function(_0x48b46b,_0x426552,_0x2f04aa){if(_0x48b46b[_0xfe4e('0x55')]&&_0x48b46b[_0xfe4e('0x55')]['filename']){_0x48b46b[_0xfe4e('0x53')][_0xfe4e('0x59')]=_0x48b46b[_0xfe4e('0x55')][_0xfe4e('0x57')];}return db[_0xfe4e('0x36')]['find']({'where':{'id':_0x48b46b[_0xfe4e('0x52')]['id']}})['then'](handleEntityNotFound(_0x426552,null))[_0xfe4e('0x2e')](saveUpdates(_0x48b46b['body'],null))[_0xfe4e('0x2e')](respondWithResult(_0x426552,null))[_0xfe4e('0x4e')](handleError(_0x426552,null));};var utilLicense=require(_0xfe4e('0x14'));exports['getLogo']=function(_0x196bf8,_0x3d10ef,_0x2a8e1b){var _0x1b6fde=_0xfe4e('0x5a');var _0x5e68b8={'custom':![]};return utilLicense[_0xfe4e('0x5b')]()[_0xfe4e('0x2e')](function(_0x2a81f0){if(_0x2a81f0){_0x5e68b8=_0x2a81f0;}return db[_0xfe4e('0x36')]['find']({'where':{'id':_0x196bf8[_0xfe4e('0x52')]['id']},'attributes':['logo',_0xfe4e('0x59'),_0xfe4e('0x5c'),_0xfe4e('0x5d'),_0xfe4e('0x5e'),_0xfe4e('0x5f'),_0xfe4e('0x60'),_0xfe4e('0x61')],'raw':!![]});})[_0xfe4e('0x2e')](handleEntityNotFound(_0x3d10ef,null))[_0xfe4e('0x2e')](function(_0x5c90a5){if(_0x5c90a5){var _0x5561b8=_0x5c90a5['logo']&&fs['existsSync'](path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x1b6fde,_['toLower'](_0x5c90a5[_0xfe4e('0x56')])))?path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x1b6fde,_[_0xfe4e('0x64')](_0x5c90a5[_0xfe4e('0x56')])):path['join'](config[_0xfe4e('0x63')],_0x1b6fde,_[_0xfe4e('0x64')](_0xfe4e('0x65')));var _0x556200=_0xfe4e('0x66')+_[_0xfe4e('0x67')](_0xfe4e('0x56'));if(_0x5c90a5[_0x556200]||!_0x5e68b8[_0xfe4e('0x68')]){_0x5561b8=path['join'](config[_0xfe4e('0x63')],_0x1b6fde,_[_0xfe4e('0x64')]('default_logo.svg'));}if(!fs[_0xfe4e('0x69')](_0x5561b8)){throw new db[(_0xfe4e('0x6a'))]['ValidationError'](_['upperFirst']('logo')+_0xfe4e('0x6b'));}return _0x3d10ef[_0xfe4e('0x6c')](_0x5561b8);}})[_0xfe4e('0x4e')](handleError(_0x3d10ef,null));};var utilLicense=require(_0xfe4e('0x14'));exports[_0xfe4e('0x6d')]=function(_0x3bf3e4,_0x51f172,_0x44fd71){var _0x3576f9=_0xfe4e('0x5a');var _0x493523={'custom':![]};return utilLicense[_0xfe4e('0x5b')]()[_0xfe4e('0x2e')](function(_0x12385f){if(_0x12385f){_0x493523=_0x12385f;}return db['Setting'][_0xfe4e('0x51')]({'where':{'id':_0x3bf3e4[_0xfe4e('0x52')]['id']},'attributes':[_0xfe4e('0x56'),_0xfe4e('0x59'),_0xfe4e('0x5c'),_0xfe4e('0x5d'),_0xfe4e('0x5e'),_0xfe4e('0x5f'),_0xfe4e('0x60'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x51f172,null))[_0xfe4e('0x2e')](function(_0x41ecad){if(_0x41ecad){var _0x25789d=_0x41ecad['loginLogo']&&fs[_0xfe4e('0x69')](path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x3576f9,_[_0xfe4e('0x64')](_0x41ecad[_0xfe4e('0x59')])))?path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x3576f9,_[_0xfe4e('0x64')](_0x41ecad[_0xfe4e('0x59')])):path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x3576f9,_['toLower'](_0xfe4e('0x6e')));var _0x55f7f8='default'+_[_0xfe4e('0x67')]('loginLogo');if(_0x41ecad[_0x55f7f8]||!_0x493523[_0xfe4e('0x68')]){_0x25789d=path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x3576f9,_[_0xfe4e('0x64')]('default_loginLogo.svg'));}if(!fs[_0xfe4e('0x69')](_0x25789d)){throw new db['Sequelize']['ValidationError'](_[_0xfe4e('0x67')](_0xfe4e('0x59'))+_0xfe4e('0x6b'));}return _0x51f172[_0xfe4e('0x6c')](_0x25789d);}})[_0xfe4e('0x4e')](handleError(_0x51f172,null));};exports[_0xfe4e('0x6f')]=function(_0x9f3da0,_0x187eda){return db[_0xfe4e('0x36')][_0xfe4e('0x51')]({'where':{'id':_0x9f3da0[_0xfe4e('0x52')]['id']},'attributes':[_0xfe4e('0x70')]})['then'](respondWithResult(_0x187eda,null))[_0xfe4e('0x4e')](handleError(_0x187eda,null));};exports[_0xfe4e('0x71')]=function(_0x481e00,_0x5013df,_0x534b50){if(_0x481e00[_0xfe4e('0x55')]&&_0x481e00[_0xfe4e('0x55')][_0xfe4e('0x57')]){_0x481e00[_0xfe4e('0x53')][_0xfe4e('0x5c')]=_0x481e00[_0xfe4e('0x55')][_0xfe4e('0x57')];}return db[_0xfe4e('0x36')][_0xfe4e('0x51')]({'where':{'id':_0x481e00['params']['id']}})[_0xfe4e('0x2e')](handleEntityNotFound(_0x5013df,null))[_0xfe4e('0x2e')](saveUpdates(_0x481e00['body'],null))[_0xfe4e('0x2e')](respondWithResult(_0x5013df,null))[_0xfe4e('0x4e')](handleError(_0x5013df,null));};var utilLicense=require(_0xfe4e('0x14'));exports[_0xfe4e('0x72')]=function(_0x559494,_0x75326f,_0x250522){var _0x397729=_0xfe4e('0x5a');var _0x50d94f={'custom':![]};return utilLicense[_0xfe4e('0x5b')]()[_0xfe4e('0x2e')](function(_0x392542){if(_0x392542){_0x50d94f=_0x392542;}return db[_0xfe4e('0x36')][_0xfe4e('0x51')]({'where':{'id':_0x559494['params']['id']},'attributes':['logo',_0xfe4e('0x59'),_0xfe4e('0x5c'),'favicon','defaultLogo',_0xfe4e('0x5f'),'defaultPreferred',_0xfe4e('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x75326f,null))[_0xfe4e('0x2e')](function(_0x111d8a){if(_0x111d8a){var _0x366acb=_0x111d8a[_0xfe4e('0x5c')]&&fs[_0xfe4e('0x69')](path['join'](config['root'],_0x397729,_[_0xfe4e('0x64')](_0x111d8a['preferred'])))?path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x397729,_[_0xfe4e('0x64')](_0x111d8a[_0xfe4e('0x5c')])):path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x397729,_[_0xfe4e('0x64')](_0xfe4e('0x73')));var _0x170797=_0xfe4e('0x66')+_['upperFirst'](_0xfe4e('0x5c'));if(_0x111d8a[_0x170797]||!_0x50d94f[_0xfe4e('0x68')]||!_0x50d94f[_0xfe4e('0x5c')]){_0x366acb=path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x397729,_[_0xfe4e('0x64')](_0xfe4e('0x73')));}if(!fs[_0xfe4e('0x69')](_0x366acb)){throw new db['Sequelize'][(_0xfe4e('0x74'))](_['upperFirst'](_0xfe4e('0x5c'))+_0xfe4e('0x6b'));}return _0x75326f['download'](_0x366acb);}})[_0xfe4e('0x4e')](handleError(_0x75326f,null));};exports[_0xfe4e('0x75')]=function(_0x3cada4,_0x206f8a,_0x7f2d30){if(_0x3cada4['file']&&_0x3cada4[_0xfe4e('0x55')][_0xfe4e('0x57')]){_0x3cada4[_0xfe4e('0x53')][_0xfe4e('0x5d')]=_0x3cada4['file']['filename'];}return db[_0xfe4e('0x36')][_0xfe4e('0x51')]({'where':{'id':_0x3cada4['params']['id']}})['then'](handleEntityNotFound(_0x206f8a,null))[_0xfe4e('0x2e')](saveUpdates(_0x3cada4[_0xfe4e('0x53')],null))[_0xfe4e('0x2e')](respondWithResult(_0x206f8a,null))[_0xfe4e('0x4e')](handleError(_0x206f8a,null));};var utilLicense=require('../../config/license/util');exports[_0xfe4e('0x76')]=function(_0x4d9fa2,_0x4ac78d,_0x4f9c2d){var _0x5d9997=_0xfe4e('0x5a');var _0x2beb7a={'custom':![]};return utilLicense['getLicense']()[_0xfe4e('0x2e')](function(_0x1ecf43){if(_0x1ecf43){_0x2beb7a=_0x1ecf43;}return db['Setting'][_0xfe4e('0x51')]({'where':{'id':_0x4d9fa2[_0xfe4e('0x52')]['id']},'attributes':['logo',_0xfe4e('0x59'),_0xfe4e('0x5c'),_0xfe4e('0x5d'),_0xfe4e('0x5e'),_0xfe4e('0x5f'),_0xfe4e('0x60'),_0xfe4e('0x61')],'raw':!![]});})[_0xfe4e('0x2e')](handleEntityNotFound(_0x4ac78d,null))[_0xfe4e('0x2e')](function(_0x57d14c){if(_0x57d14c){var _0x1723a0=_0x57d14c[_0xfe4e('0x5d')]&&fs[_0xfe4e('0x69')](path['join'](config['root'],_0x5d9997,_[_0xfe4e('0x64')](_0x57d14c['favicon'])))?path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x5d9997,_[_0xfe4e('0x64')](_0x57d14c[_0xfe4e('0x5d')])):path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x5d9997,_[_0xfe4e('0x64')](_0xfe4e('0x77')));var _0xe961fd=_0xfe4e('0x66')+_[_0xfe4e('0x67')](_0xfe4e('0x5d'));if(_0x57d14c[_0xe961fd]||!_0x2beb7a['custom']){_0x1723a0=path[_0xfe4e('0x62')](config[_0xfe4e('0x63')],_0x5d9997,_[_0xfe4e('0x64')](_0xfe4e('0x77')));}if(!fs[_0xfe4e('0x69')](_0x1723a0)){throw new db[(_0xfe4e('0x6a'))][(_0xfe4e('0x74'))](_[_0xfe4e('0x67')](_0xfe4e('0x5d'))+_0xfe4e('0x6b'));}return _0x4ac78d[_0xfe4e('0x6c')](_0x1723a0);}})['catch'](handleError(_0x4ac78d,null));};exports[_0xfe4e('0x78')]=function(_0x339a88,_0x46f2a7){var _0x31c83b={'offset':moment()[_0xfe4e('0x79')]()};_0x31c83b[_0xfe4e('0x7a')]=moment()['utcOffset'](_0x31c83b[_0xfe4e('0x24')])[_0xfe4e('0x7b')](_0xfe4e('0x7c'));return _0x46f2a7[_0xfe4e('0x22')](0xc8)[_0xfe4e('0x33')](_0x31c83b);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4ea61fd..1f3cf5c 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','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(_0x1b74cc,_0x490310){var _0x108b73=function(_0x5b2058){while(--_0x5b2058){_0x1b74cc['push'](_0x1b74cc['shift']());}};_0x108b73(++_0x490310);}(_0xedd9,0xfc));var _0x9edd=function(_0x175e51,_0x5667e9){_0x175e51=_0x175e51-0x0;var _0x94782f=_0xedd9[_0x175e51];return _0x94782f;};'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 986e386..c608381 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 _0x0913=['map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','raw','options','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0913,0x1c3));var _0x3091=function(_0x1b932b,_0x2c14fe){_0x1b932b=_0x1b932b-0x0;var _0x119173=_0x0913[_0x1b932b];return _0x119173;};'use strict';var _=require('lodash');var util=require(_0x3091('0x0'));var moment=require(_0x3091('0x1'));var BPromise=require(_0x3091('0x2'));var rs=require(_0x3091('0x3'));var fs=require('fs');var Redis=require(_0x3091('0x4'));var db=require(_0x3091('0x5'))['db'];var utils=require(_0x3091('0x6'));var logger=require('../../config/logger')(_0x3091('0x7'));var config=require(_0x3091('0x8'));var jayson=require(_0x3091('0x9'));var client=jayson[_0x3091('0xa')][_0x3091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9fb4e9,_0x16388a,_0x552581){return new BPromise(function(_0x1947e4,_0x82eaa1){return client[_0x3091('0xc')](_0x9fb4e9,_0x552581)[_0x3091('0xd')](function(_0x11c7a9){logger[_0x3091('0xe')]('Setting,\x20%s,\x20%s',_0x16388a,_0x3091('0xf'));logger[_0x3091('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x16388a,_0x3091('0xf'),JSON[_0x3091('0x11')](_0x11c7a9));if(_0x11c7a9[_0x3091('0x12')]){if(_0x11c7a9[_0x3091('0x12')]['code']===0x1f4){logger[_0x3091('0x12')](_0x3091('0x13'),_0x16388a,_0x11c7a9[_0x3091('0x12')]['message']);return _0x82eaa1(_0x11c7a9[_0x3091('0x12')][_0x3091('0x14')]);}logger['error']('Setting,\x20%s,\x20%s',_0x16388a,_0x11c7a9[_0x3091('0x12')]['message']);return _0x1947e4(_0x11c7a9['error'][_0x3091('0x14')]);}else{logger['info'](_0x3091('0x13'),_0x16388a,_0x3091('0xf'));_0x1947e4(_0x11c7a9[_0x3091('0x15')][_0x3091('0x14')]);}})[_0x3091('0x16')](function(_0x2ea460){logger[_0x3091('0x12')](_0x3091('0x13'),_0x16388a,_0x2ea460);_0x82eaa1(_0x2ea460);});});}exports[_0x3091('0x17')]=function(_0x35e8c6){var _0x1b5f83=this;return new Promise(function(_0x563e07,_0x43cca5){return db[_0x3091('0x18')][_0x3091('0x19')]({'raw':_0x35e8c6['options']?_0x35e8c6['options'][_0x3091('0x1a')]===undefined?!![]:![]:!![],'where':_0x35e8c6[_0x3091('0x1b')]?_0x35e8c6[_0x3091('0x1b')]['where']||null:null,'attributes':_0x35e8c6[_0x3091('0x1b')]?_0x35e8c6[_0x3091('0x1b')]['attributes']||null:null,'include':_0x35e8c6[_0x3091('0x1b')]?_0x35e8c6['options'][_0x3091('0x1c')]?_[_0x3091('0x1d')](_0x35e8c6['options'][_0x3091('0x1c')],function(_0x482abf){return{'model':db[_0x482abf[_0x3091('0x1e')]],'as':_0x482abf['as'],'attributes':_0x482abf[_0x3091('0x1f')],'include':_0x482abf[_0x3091('0x1c')]?_[_0x3091('0x1d')](_0x482abf[_0x3091('0x1c')],function(_0x3a649e){return{'model':db[_0x3a649e[_0x3091('0x1e')]],'as':_0x3a649e['as'],'attributes':_0x3a649e[_0x3091('0x1f')],'include':_0x3a649e[_0x3091('0x1c')]?_[_0x3091('0x1d')](_0x3a649e[_0x3091('0x1c')],function(_0x210321){return{'model':db[_0x210321['model']],'as':_0x210321['as'],'attributes':_0x210321['attributes']};}):[]};}):[]};}):[]:[]})[_0x3091('0xd')](function(_0x2a664c){logger['info'](_0x3091('0x17'),_0x35e8c6);logger[_0x3091('0x10')](_0x3091('0x17'),_0x35e8c6,JSON[_0x3091('0x11')](_0x2a664c));_0x563e07(_0x2a664c);})[_0x3091('0x16')](function(_0x38dd38){logger[_0x3091('0x12')](_0x3091('0x17'),_0x38dd38[_0x3091('0x14')],_0x35e8c6);_0x43cca5(_0x1b5f83[_0x3091('0x12')](0x1f4,_0x38dd38[_0x3091('0x14')]));});});}; \ No newline at end of file +var _0xbe02=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','find','options','raw','attributes','include','map','model','catch','lodash','util'];(function(_0xd85cba,_0xee35b4){var _0x3cfbfe=function(_0x25e960){while(--_0x25e960){_0xd85cba['push'](_0xd85cba['shift']());}};_0x3cfbfe(++_0xee35b4);}(_0xbe02,0xd7));var _0x2be0=function(_0x397919,_0x310ee6){_0x397919=_0x397919-0x0;var _0x5675b4=_0xbe02[_0x397919];return _0x5675b4;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require(_0x2be0('0x4'));var fs=require('fs');var Redis=require(_0x2be0('0x5'));var db=require(_0x2be0('0x6'))['db'];var utils=require(_0x2be0('0x7'));var logger=require(_0x2be0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2be0('0x9'));var client=jayson[_0x2be0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x797ea4,_0x4f7f07,_0x2e2e79){return new BPromise(function(_0x44945b,_0xea2cba){return client[_0x2be0('0xb')](_0x797ea4,_0x2e2e79)[_0x2be0('0xc')](function(_0x467192){logger[_0x2be0('0xd')]('Setting,\x20%s,\x20%s',_0x4f7f07,'request\x20sent');logger[_0x2be0('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x4f7f07,_0x2be0('0xf'),JSON[_0x2be0('0x10')](_0x467192));if(_0x467192[_0x2be0('0x11')]){if(_0x467192[_0x2be0('0x11')]['code']===0x1f4){logger['error'](_0x2be0('0x12'),_0x4f7f07,_0x467192[_0x2be0('0x11')][_0x2be0('0x13')]);return _0xea2cba(_0x467192[_0x2be0('0x11')][_0x2be0('0x13')]);}logger[_0x2be0('0x11')](_0x2be0('0x12'),_0x4f7f07,_0x467192[_0x2be0('0x11')][_0x2be0('0x13')]);return _0x44945b(_0x467192[_0x2be0('0x11')][_0x2be0('0x13')]);}else{logger['info'](_0x2be0('0x12'),_0x4f7f07,_0x2be0('0xf'));_0x44945b(_0x467192[_0x2be0('0x14')][_0x2be0('0x13')]);}})['catch'](function(_0x132825){logger[_0x2be0('0x11')]('Setting,\x20%s,\x20%s',_0x4f7f07,_0x132825);_0xea2cba(_0x132825);});});}exports[_0x2be0('0x15')]=function(_0x562fd2){var _0x9429d9=this;return new Promise(function(_0x3017ac,_0x4ffc29){return db[_0x2be0('0x16')][_0x2be0('0x17')]({'raw':_0x562fd2['options']?_0x562fd2[_0x2be0('0x18')][_0x2be0('0x19')]===undefined?!![]:![]:!![],'where':_0x562fd2[_0x2be0('0x18')]?_0x562fd2[_0x2be0('0x18')]['where']||null:null,'attributes':_0x562fd2[_0x2be0('0x18')]?_0x562fd2[_0x2be0('0x18')][_0x2be0('0x1a')]||null:null,'include':_0x562fd2[_0x2be0('0x18')]?_0x562fd2[_0x2be0('0x18')][_0x2be0('0x1b')]?_[_0x2be0('0x1c')](_0x562fd2[_0x2be0('0x18')][_0x2be0('0x1b')],function(_0x240547){return{'model':db[_0x240547[_0x2be0('0x1d')]],'as':_0x240547['as'],'attributes':_0x240547[_0x2be0('0x1a')],'include':_0x240547[_0x2be0('0x1b')]?_[_0x2be0('0x1c')](_0x240547[_0x2be0('0x1b')],function(_0x2188f3){return{'model':db[_0x2188f3[_0x2be0('0x1d')]],'as':_0x2188f3['as'],'attributes':_0x2188f3[_0x2be0('0x1a')],'include':_0x2188f3['include']?_['map'](_0x2188f3[_0x2be0('0x1b')],function(_0x277cc9){return{'model':db[_0x277cc9[_0x2be0('0x1d')]],'as':_0x277cc9['as'],'attributes':_0x277cc9[_0x2be0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbeb426){logger[_0x2be0('0xd')](_0x2be0('0x15'),_0x562fd2);logger['debug'](_0x2be0('0x15'),_0x562fd2,JSON[_0x2be0('0x10')](_0xbeb426));_0x3017ac(_0xbeb426);})[_0x2be0('0x1e')](function(_0x1a4e8e){logger[_0x2be0('0x11')]('ShowSetting',_0x1a4e8e[_0x2be0('0x13')],_0x562fd2);_0x4ffc29(_0x9429d9[_0x2be0('0x11')](0x1f4,_0x1a4e8e[_0x2be0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 006162c..8972f9e 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 _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x2f3ce9,_0x4ef9e8){var _0xf13f93=function(_0x212d28){while(--_0x212d28){_0x2f3ce9['push'](_0x2f3ce9['shift']());}};_0xf13f93(++_0x4ef9e8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0x5fc3[_0x3a4318];return _0x36d746;};'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/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x1d8734,_0x25834b){var _0x322410=function(_0x138356){while(--_0x138356){_0x1d8734['push'](_0x1d8734['shift']());}};_0x322410(++_0x25834b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x19aa04,_0x6a30c1){_0x19aa04=_0x19aa04-0x0;var _0x499e4a=_0x8ef6[_0x19aa04];return _0x499e4a;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index b123aa7..fc6bc5f 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 _0x0a80=['clickatell','bandwidth','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','plivo'];(function(_0x5a42d9,_0x2d397e){var _0x190cf2=function(_0x57430a){while(--_0x57430a){_0x5a42d9['push'](_0x5a42d9['shift']());}};_0x190cf2(++_0x2d397e);}(_0x0a80,0x14e));var _0x00a8=function(_0x1591ae,_0x978913){_0x1591ae=_0x1591ae-0x0;var _0x3fdc74=_0x0a80[_0x1591ae];return _0x3fdc74;};'use strict';var Sequelize=require(_0x00a8('0x0'));var rs=require(_0x00a8('0x1'));module[_0x00a8('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x00a8('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x00a8('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x00a8('0x4')],'defaultValue':function(){return rs[_0x00a8('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x00a8('0x6')](_0x00a8('0x7'),_0x00a8('0x8'),_0x00a8('0x9'),'clicksend',_0x00a8('0xa'),_0x00a8('0xb'),_0x00a8('0xc'),_0x00a8('0xd'),_0x00a8('0xe'),_0x00a8('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x00a8('0x4')]},'smsMethod':{'type':Sequelize[_0x00a8('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x00a8('0x4')]},'password':{'type':Sequelize[_0x00a8('0x4')]},'apiKey':{'type':Sequelize[_0x00a8('0x4')]},'applicationId':{'type':Sequelize[_0x00a8('0x4')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x00a8('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x00a8('0x4')]},'notificationTemplate':{'type':Sequelize[_0x00a8('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x00a8('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x00a8('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x00a8('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x00a8('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x00a8('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x00a8('0x12')],'comment':_0x00a8('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x00a8('0x11')],'defaultValue':![],'comment':_0x00a8('0x14'),'set':function(_0x105522){if(!_0x105522)this[_0x00a8('0x15')](_0x00a8('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x105522);}}}; \ No newline at end of file +var _0x8cea=['STRING','ENUM','twilio','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x8cea,0x9f));var _0xa8ce=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x8cea[_0x4884a7];return _0x56b60e;};'use strict';var Sequelize=require(_0xa8ce('0x0'));var rs=require(_0xa8ce('0x1'));module[_0xa8ce('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa8ce('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa8ce('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa8ce('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xa8ce('0x3')]},'type':{'type':Sequelize[_0xa8ce('0x4')](_0xa8ce('0x5'),'skebby',_0xa8ce('0x6'),_0xa8ce('0x7'),'plivo',_0xa8ce('0x8'),_0xa8ce('0x9'),_0xa8ce('0xa'),_0xa8ce('0xb'),_0xa8ce('0xc'))},'accountSid':{'type':Sequelize[_0xa8ce('0x3')]},'authId':{'type':Sequelize[_0xa8ce('0x3')]},'authToken':{'type':Sequelize[_0xa8ce('0x3')]},'smsMethod':{'type':Sequelize[_0xa8ce('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa8ce('0x3')]},'password':{'type':Sequelize[_0xa8ce('0x3')]},'apiKey':{'type':Sequelize[_0xa8ce('0x3')]},'applicationId':{'type':Sequelize[_0xa8ce('0x3')]},'accountId':{'type':Sequelize[_0xa8ce('0x3')]},'senderString':{'type':Sequelize[_0xa8ce('0x3')]},'deliveryReport':{'type':Sequelize[_0xa8ce('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa8ce('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa8ce('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa8ce('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa8ce('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa8ce('0xe')],'comment':_0xa8ce('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xa8ce('0xd')],'defaultValue':![],'comment':_0xa8ce('0x10'),'set':function(_0x56da82){if(!_0x56da82)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa8ce('0x11'),_0x56da82);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 591be5e..3be1b14 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 _0xf487=['SmsAccounts','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','SmsAccount','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','describe','addDisposition','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','\x0a','sequelize','READ_COMMITTED','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','status_code','groupName','DELIVERED','clickatell','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','spread','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','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','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','get'];(function(_0x54b892,_0x2a3009){var _0x1256e1=function(_0x32278b){while(--_0x32278b){_0x54b892['push'](_0x54b892['shift']());}};_0x1256e1(++_0x2a3009);}(_0xf487,0x19c));var _0x7f48=function(_0xb8e645,_0x778225){_0xb8e645=_0xb8e645-0x0;var _0x1c9456=_0xf487[_0xb8e645];return _0x1c9456;};'use strict';var emlformat=require(_0x7f48('0x0'));var rimraf=require(_0x7f48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f48('0x2'));var rp=require('request-promise');var moment=require(_0x7f48('0x3'));var BPromise=require(_0x7f48('0x4'));var Mustache=require(_0x7f48('0x5'));var util=require(_0x7f48('0x6'));var path=require(_0x7f48('0x7'));var sox=require(_0x7f48('0x8'));var csv=require(_0x7f48('0x9'));var ejs=require(_0x7f48('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f48('0xb'));var squel=require(_0x7f48('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f48('0xd'));var deskjs=require(_0x7f48('0xe'));var toCsv=require(_0x7f48('0x9'));var querystring=require(_0x7f48('0xf'));var Papa=require(_0x7f48('0x10'));var Redis=require('ioredis');var authService=require(_0x7f48('0x11'));var qs=require(_0x7f48('0x12'));var as=require(_0x7f48('0x13'));var hardwareService=require(_0x7f48('0x14'));var logger=require('../../config/logger')(_0x7f48('0x15'));var utils=require(_0x7f48('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f48('0x17'));var db=require(_0x7f48('0x18'))['db'];config['redis']=_[_0x7f48('0x19')](config[_0x7f48('0x1a')],{'host':_0x7f48('0x1b'),'port':0x18eb});var socket=require(_0x7f48('0x1c'))(new Redis(config[_0x7f48('0x1a')]));require(_0x7f48('0x1d'))[_0x7f48('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7f48('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x5cc6b3,_0x149315,_0x18d22a,_0x18efd5){return new BPromise(function(_0x5b8f17,_0x1fd381){var _0x3b1749=_0x18efd5||client;return _0x3b1749[_0x7f48('0x20')](_0x5cc6b3,_0x18d22a)[_0x7f48('0x21')](function(_0x1b827e){logger['info'](_0x7f48('0x22'),_0x149315,'request\x20sent');logger[_0x7f48('0x23')](_0x7f48('0x24'),_0x149315,_0x7f48('0x25'),JSON[_0x7f48('0x26')](_0x1b827e));if(_0x1b827e['error']){if(_0x1b827e[_0x7f48('0x27')][_0x7f48('0x28')]===0x1f4){logger[_0x7f48('0x27')](_0x7f48('0x22'),_0x149315,_0x1b827e['error'][_0x7f48('0x29')]);return _0x1fd381(_0x1b827e['error'][_0x7f48('0x29')]);}logger[_0x7f48('0x27')](_0x7f48('0x22'),_0x149315,_0x1b827e[_0x7f48('0x27')][_0x7f48('0x29')]);return _0x5b8f17(_0x1b827e[_0x7f48('0x27')]['message']);}else{logger[_0x7f48('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x149315,_0x7f48('0x25'));_0x5b8f17(_0x1b827e[_0x7f48('0x2b')][_0x7f48('0x29')]);}})[_0x7f48('0x2c')](function(_0x487761){logger['error'](_0x7f48('0x22'),_0x149315,_0x487761);_0x1fd381(_0x487761);});});}function respondWithStatusCode(_0x118dea,_0x280db1){_0x280db1=_0x280db1||0xcc;return function(_0x3a23c4){if(_0x3a23c4){return _0x118dea[_0x7f48('0x2d')](_0x280db1);}return _0x118dea[_0x7f48('0x2e')](_0x280db1)[_0x7f48('0x2f')]();};}function respondWithResult(_0x582837,_0x185c60){_0x185c60=_0x185c60||0xc8;return function(_0x1d461b){if(_0x1d461b){return _0x582837[_0x7f48('0x2e')](_0x185c60)['json'](_0x1d461b);}};}function respondWithFilteredResult(_0x1e6b2f,_0x24cf48){return function(_0x50e7a6){if(_0x50e7a6){var _0x12e1a8=typeof _0x24cf48[_0x7f48('0x30')]==='undefined'&&typeof _0x24cf48[_0x7f48('0x31')]===_0x7f48('0x32');var _0x365094=_0x50e7a6['count'];var _0x537021=_0x12e1a8?0x0:_0x24cf48[_0x7f48('0x30')];var _0xa9fd3d=_0x12e1a8?_0x50e7a6[_0x7f48('0x33')]:_0x24cf48[_0x7f48('0x30')]+_0x24cf48['limit'];var _0x2c1919;if(_0xa9fd3d>=_0x365094){_0xa9fd3d=_0x365094;_0x2c1919=0xc8;}else{_0x2c1919=0xce;}_0x1e6b2f['status'](_0x2c1919);return _0x1e6b2f[_0x7f48('0x34')]('Content-Range',_0x537021+'-'+_0xa9fd3d+'/'+_0x365094)[_0x7f48('0x35')](_0x50e7a6);}return null;};}function patchUpdates(_0xb8e448){return function(_0x40bf67){try{jsonpatch[_0x7f48('0x36')](_0x40bf67,_0xb8e448,!![]);}catch(_0x2468b4){return BPromise[_0x7f48('0x37')](_0x2468b4);}return _0x40bf67[_0x7f48('0x38')]();};}function saveUpdates(_0x5e483e,_0x1ba560){return function(_0x3240d8){if(_0x3240d8){return _0x3240d8[_0x7f48('0x39')](_0x5e483e)[_0x7f48('0x21')](function(_0xb9114c){return _0xb9114c;});}return null;};}function removeEntity(_0x38ef3c,_0x19dbe6){return function(_0x22dd78){if(_0x22dd78){return _0x22dd78[_0x7f48('0x3a')]()[_0x7f48('0x21')](function(){var _0x448cb1=_0x22dd78[_0x7f48('0x3b')]({'plain':!![]});var _0x358403=_0x7f48('0x3c');return db['UserProfileResource'][_0x7f48('0x3a')]({'where':{'type':_0x358403,'resourceId':_0x448cb1['id']}})[_0x7f48('0x21')](function(){return _0x22dd78;});})[_0x7f48('0x21')](function(){_0x38ef3c[_0x7f48('0x2e')](0xcc)[_0x7f48('0x2f')]();});}};}function handleEntityNotFound(_0x5f46a9,_0x9e73dd){return function(_0x4ae267){if(!_0x4ae267){_0x5f46a9['sendStatus'](0x194);}return _0x4ae267;};}function handleError(_0xc7c39a,_0x1e265c){_0x1e265c=_0x1e265c||0x1f4;return function(_0x2c409e){logger[_0x7f48('0x27')](_0x2c409e[_0x7f48('0x3d')]);if(_0x2c409e[_0x7f48('0x3e')]){delete _0x2c409e[_0x7f48('0x3e')];}_0xc7c39a[_0x7f48('0x2e')](_0x1e265c)['send'](_0x2c409e);};}exports['index']=function(_0x237c14,_0x218f0b){var _0x867ec6={'include':[{'model':db[_0x7f48('0x3f')],'as':_0x7f48('0x40')}]},_0x1a9d28={},_0x137bbe={'count':0x0,'rows':[]};var _0x22b345=_[_0x7f48('0x41')](db['SmsAccount'][_0x7f48('0x42')],function(_0x19f715){return{'name':_0x19f715[_0x7f48('0x43')],'type':_0x19f715[_0x7f48('0x44')][_0x7f48('0x45')]};});_0x1a9d28['model']=_['map'](_0x22b345,_0x7f48('0x3e'));_0x1a9d28['query']=_[_0x7f48('0x46')](_0x237c14[_0x7f48('0x47')]);_0x1a9d28[_0x7f48('0x48')]=_[_0x7f48('0x49')](_0x1a9d28[_0x7f48('0x4a')],_0x1a9d28[_0x7f48('0x47')]);_0x867ec6[_0x7f48('0x4b')]=_[_0x7f48('0x49')](_0x1a9d28[_0x7f48('0x4a')],qs[_0x7f48('0x4c')](_0x237c14['query']['fields']));_0x867ec6[_0x7f48('0x4b')]=_0x867ec6['attributes'][_0x7f48('0x4d')]?_0x867ec6['attributes']:_0x1a9d28[_0x7f48('0x4a')];if(!_0x237c14[_0x7f48('0x47')][_0x7f48('0x4e')](_0x7f48('0x4f'))){_0x867ec6[_0x7f48('0x31')]=qs[_0x7f48('0x31')](_0x237c14[_0x7f48('0x47')][_0x7f48('0x31')]);_0x867ec6[_0x7f48('0x30')]=qs[_0x7f48('0x30')](_0x237c14[_0x7f48('0x47')][_0x7f48('0x30')]);}_0x867ec6[_0x7f48('0x50')]=qs['sort'](_0x237c14['query'][_0x7f48('0x51')]);_0x867ec6['where']=qs[_0x7f48('0x48')](_[_0x7f48('0x52')](_0x237c14[_0x7f48('0x47')],_0x1a9d28[_0x7f48('0x48')]),_0x22b345);if(_0x237c14[_0x7f48('0x47')]['filter']){_0x867ec6[_0x7f48('0x53')]=_[_0x7f48('0x54')](_0x867ec6['where'],{'$or':_[_0x7f48('0x41')](_0x22b345,function(_0x18d3bc){if(_0x18d3bc['type']!==_0x7f48('0x55')){var _0x1d5d2c={};_0x1d5d2c[_0x18d3bc[_0x7f48('0x3e')]]={'$like':'%'+_0x237c14[_0x7f48('0x47')][_0x7f48('0x56')]+'%'};return _0x1d5d2c;}})});}_0x867ec6=_['merge']({},_0x867ec6,_0x237c14['options']);var _0x19a114={'where':_0x867ec6['where']};return db['SmsAccount'][_0x7f48('0x33')](_0x19a114)[_0x7f48('0x21')](function(_0x1995cf){_0x137bbe['count']=_0x1995cf;if(_0x237c14[_0x7f48('0x47')][_0x7f48('0x57')]){_0x867ec6[_0x7f48('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0x7f48('0x59')](_0x867ec6);})[_0x7f48('0x21')](function(_0x24d259){_0x137bbe[_0x7f48('0x5a')]=_0x24d259;return _0x137bbe;})[_0x7f48('0x21')](respondWithFilteredResult(_0x218f0b,_0x867ec6))[_0x7f48('0x2c')](handleError(_0x218f0b,null));};exports[_0x7f48('0x5b')]=function(_0x3d3f7a,_0x27fe0b){var _0x4c5cde={'raw':![],'where':{'id':_0x3d3f7a[_0x7f48('0x5c')]['id']},'include':[{'model':db[_0x7f48('0x3f')],'as':_0x7f48('0x40')}]},_0x1395e7={};_0x1395e7[_0x7f48('0x4a')]=_[_0x7f48('0x46')](db[_0x7f48('0x5d')][_0x7f48('0x42')]);_0x1395e7['query']=_[_0x7f48('0x46')](_0x3d3f7a['query']);_0x1395e7[_0x7f48('0x48')]=_[_0x7f48('0x49')](_0x1395e7[_0x7f48('0x4a')],_0x1395e7[_0x7f48('0x47')]);_0x4c5cde[_0x7f48('0x4b')]=_[_0x7f48('0x49')](_0x1395e7[_0x7f48('0x4a')],qs[_0x7f48('0x4c')](_0x3d3f7a[_0x7f48('0x47')][_0x7f48('0x4c')]));_0x4c5cde[_0x7f48('0x4b')]=_0x4c5cde[_0x7f48('0x4b')][_0x7f48('0x4d')]?_0x4c5cde[_0x7f48('0x4b')]:_0x1395e7[_0x7f48('0x4a')];if(_0x3d3f7a[_0x7f48('0x47')][_0x7f48('0x57')]){_0x4c5cde[_0x7f48('0x58')]=[{'all':!![]}];}_0x4c5cde=_[_0x7f48('0x54')]({},_0x4c5cde,_0x3d3f7a['options']);return db[_0x7f48('0x5d')][_0x7f48('0x5e')](_0x4c5cde)[_0x7f48('0x21')](handleEntityNotFound(_0x27fe0b,null))[_0x7f48('0x21')](respondWithResult(_0x27fe0b,null))[_0x7f48('0x2c')](handleError(_0x27fe0b,null));};exports[_0x7f48('0x5f')]=function(_0x2752c7,_0x69b8e2){return db[_0x7f48('0x5d')]['create'](_0x2752c7['body'],{})[_0x7f48('0x21')](function(_0x3e2f40){var _0x51203a=_0x2752c7[_0x7f48('0x60')]['get']({'plain':!![]});if(!_0x51203a)throw new Error(_0x7f48('0x61'));if(_0x51203a[_0x7f48('0x62')]===_0x7f48('0x60')){var _0x220b36=_0x3e2f40['get']({'plain':!![]});var _0xcf5a26=_0x7f48('0x3c');return db[_0x7f48('0x63')]['find']({'where':{'name':_0xcf5a26,'userProfileId':_0x51203a[_0x7f48('0x64')]},'raw':!![]})[_0x7f48('0x21')](function(_0x12f57e){if(_0x12f57e&&_0x12f57e[_0x7f48('0x65')]===0x0){return db[_0x7f48('0x66')][_0x7f48('0x5f')]({'name':_0x220b36[_0x7f48('0x3e')],'resourceId':_0x220b36['id'],'type':_0x12f57e[_0x7f48('0x3e')],'sectionId':_0x12f57e['id']},{})[_0x7f48('0x21')](function(){return _0x3e2f40;});}else{return _0x3e2f40;}})['catch'](function(_0x500c04){logger[_0x7f48('0x27')](_0x7f48('0x67'),_0x500c04);throw _0x500c04;});}return _0x3e2f40;})[_0x7f48('0x21')](respondWithResult(_0x69b8e2,0xc9))['catch'](handleError(_0x69b8e2,null));};exports[_0x7f48('0x39')]=function(_0x314c4e,_0x1520d5){if(_0x314c4e['body']['id']){delete _0x314c4e[_0x7f48('0x68')]['id'];}return db['SmsAccount'][_0x7f48('0x5e')]({'where':{'id':_0x314c4e[_0x7f48('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x7f48('0x40')}]})[_0x7f48('0x21')](handleEntityNotFound(_0x1520d5,null))['then'](saveUpdates(_0x314c4e['body'],null))[_0x7f48('0x21')](respondWithResult(_0x1520d5,null))['catch'](handleError(_0x1520d5,null));};exports[_0x7f48('0x3a')]=function(_0x5805c7,_0x33dd2f){return db[_0x7f48('0x5d')]['find']({'where':{'id':_0x5805c7[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x33dd2f,null))['then'](removeEntity(_0x33dd2f,null))['catch'](handleError(_0x33dd2f,null));};exports[_0x7f48('0x69')]=function(_0x244ede,_0xcd1309){return db['SmsAccount'][_0x7f48('0x69')]()[_0x7f48('0x21')](respondWithResult(_0xcd1309,null))['catch'](handleError(_0xcd1309,null));};exports[_0x7f48('0x6a')]=function(_0x2cd8fa,_0x18f731,_0x2d0bd9){if(_0x2cd8fa[_0x7f48('0x68')]['id']){delete _0x2cd8fa['body']['id'];}return db[_0x7f48('0x5d')]['find']({'where':{'id':_0x2cd8fa[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x18f731,null))[_0x7f48('0x21')](function(_0x32f49a){if(_0x32f49a){_0x2cd8fa[_0x7f48('0x68')]['SmsAccountId']=_0x32f49a['id'];return db[_0x7f48('0x6b')][_0x7f48('0x5f')](_0x2cd8fa['body']);}})['then'](respondWithResult(_0x18f731,null))[_0x7f48('0x2c')](handleError(_0x18f731,null));};exports[_0x7f48('0x6c')]=function(_0x4c1965,_0x2f2034,_0x3864ed){var _0x46a102={'raw':![],'where':{}};var _0x2eed03={};var _0x3a58c4={'count':0x0,'rows':[]};return db[_0x7f48('0x5d')][_0x7f48('0x6d')]({'where':{'id':_0x4c1965[_0x7f48('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f2034,null))[_0x7f48('0x21')](function(_0x1da428){if(_0x1da428){_0x2eed03['model']=_['keys'](db[_0x7f48('0x6b')][_0x7f48('0x42')]);_0x2eed03[_0x7f48('0x47')]=_['keys'](_0x4c1965[_0x7f48('0x47')]);_0x2eed03[_0x7f48('0x48')]=_[_0x7f48('0x49')](_0x2eed03[_0x7f48('0x4a')],_0x2eed03[_0x7f48('0x47')]);_0x46a102[_0x7f48('0x4b')]=_[_0x7f48('0x49')](_0x2eed03['model'],qs[_0x7f48('0x4c')](_0x4c1965[_0x7f48('0x47')][_0x7f48('0x4c')]));_0x46a102[_0x7f48('0x4b')]=_0x46a102['attributes'][_0x7f48('0x4d')]?_0x46a102[_0x7f48('0x4b')]:_0x2eed03[_0x7f48('0x4a')];if(!_0x4c1965['query'][_0x7f48('0x4e')](_0x7f48('0x4f'))){_0x46a102['limit']=qs[_0x7f48('0x31')](_0x4c1965[_0x7f48('0x47')][_0x7f48('0x31')]);_0x46a102['offset']=qs[_0x7f48('0x30')](_0x4c1965[_0x7f48('0x47')][_0x7f48('0x30')]);}_0x46a102[_0x7f48('0x50')]=qs[_0x7f48('0x51')](_0x4c1965[_0x7f48('0x47')][_0x7f48('0x51')]);_0x46a102[_0x7f48('0x53')]=qs[_0x7f48('0x48')](_[_0x7f48('0x52')](_0x4c1965[_0x7f48('0x47')],_0x2eed03['filters']));_0x46a102[_0x7f48('0x53')]['SmsAccountId']=_0x1da428['id'];if(_0x4c1965[_0x7f48('0x47')][_0x7f48('0x56')]){_0x46a102['where']=_[_0x7f48('0x54')](_0x46a102[_0x7f48('0x53')],{'$or':_[_0x7f48('0x41')](_0x46a102[_0x7f48('0x4b')],function(_0x17e493){var _0x3c631e={};_0x3c631e[_0x17e493]={'$like':'%'+_0x4c1965[_0x7f48('0x47')][_0x7f48('0x56')]+'%'};return _0x3c631e;})});}_0x46a102=_['merge']({},_0x46a102,_0x4c1965[_0x7f48('0x6e')]);return db[_0x7f48('0x6b')]['count']({'where':_0x46a102['where']})['then'](function(_0x41877f){_0x3a58c4[_0x7f48('0x33')]=_0x41877f;if(_0x4c1965[_0x7f48('0x47')][_0x7f48('0x57')]){_0x46a102[_0x7f48('0x58')]=[{'all':!![]}];}return db[_0x7f48('0x6b')][_0x7f48('0x59')](_0x46a102);})['then'](function(_0x86914a){_0x3a58c4[_0x7f48('0x5a')]=_0x86914a;return _0x3a58c4;});}})[_0x7f48('0x21')](respondWithFilteredResult(_0x2f2034,_0x46a102))[_0x7f48('0x2c')](handleError(_0x2f2034,null));};exports[_0x7f48('0x6f')]=function(_0x2239ef,_0x24a94f,_0xd24224){return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0x2239ef[_0x7f48('0x5c')]['id']}})['then'](handleEntityNotFound(_0x24a94f,null))[_0x7f48('0x21')](function(_0x686c15){if(_0x686c15){return _0x686c15[_0x7f48('0x6f')](_0x2239ef[_0x7f48('0x47')][_0x7f48('0x70')]);}})[_0x7f48('0x21')](respondWithStatusCode(_0x24a94f,null))[_0x7f48('0x2c')](handleError(_0x24a94f,null));};exports[_0x7f48('0x71')]=function(_0x50d6ac,_0x28ab56,_0x3ac32d){if(_0x50d6ac[_0x7f48('0x68')]['id']){delete _0x50d6ac['body']['id'];}return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0x50d6ac['params']['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x28ab56,null))[_0x7f48('0x21')](function(_0x28e9b2){if(_0x28e9b2){_0x50d6ac[_0x7f48('0x68')][_0x7f48('0x72')]=_0x28e9b2['id'];return db[_0x7f48('0x73')][_0x7f48('0x5f')](_0x50d6ac[_0x7f48('0x68')]);}})['then'](respondWithResult(_0x28ab56,null))[_0x7f48('0x2c')](handleError(_0x28ab56,null));};exports[_0x7f48('0x74')]=function(_0x60739a,_0x23a932,_0xce1b71){var _0x456c4f={'raw':![],'where':{}};var _0x47cb59={};var _0x46018c={'count':0x0,'rows':[]};return db[_0x7f48('0x5d')][_0x7f48('0x6d')]({'where':{'id':_0x60739a[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x23a932,null))['then'](function(_0x4a58dd){if(_0x4a58dd){_0x47cb59['model']=_[_0x7f48('0x46')](db[_0x7f48('0x73')][_0x7f48('0x42')]);_0x47cb59[_0x7f48('0x47')]=_[_0x7f48('0x46')](_0x60739a['query']);_0x47cb59['filters']=_['intersection'](_0x47cb59[_0x7f48('0x4a')],_0x47cb59[_0x7f48('0x47')]);_0x456c4f[_0x7f48('0x4b')]=_[_0x7f48('0x49')](_0x47cb59[_0x7f48('0x4a')],qs[_0x7f48('0x4c')](_0x60739a[_0x7f48('0x47')][_0x7f48('0x4c')]));_0x456c4f['attributes']=_0x456c4f['attributes'][_0x7f48('0x4d')]?_0x456c4f[_0x7f48('0x4b')]:_0x47cb59[_0x7f48('0x4a')];if(!_0x60739a[_0x7f48('0x47')][_0x7f48('0x4e')](_0x7f48('0x4f'))){_0x456c4f[_0x7f48('0x31')]=qs[_0x7f48('0x31')](_0x60739a['query'][_0x7f48('0x31')]);_0x456c4f[_0x7f48('0x30')]=qs['offset'](_0x60739a[_0x7f48('0x47')][_0x7f48('0x30')]);}_0x456c4f['order']=qs[_0x7f48('0x51')](_0x60739a[_0x7f48('0x47')][_0x7f48('0x51')]);_0x456c4f['where']=qs['filters'](_[_0x7f48('0x52')](_0x60739a[_0x7f48('0x47')],_0x47cb59['filters']));_0x456c4f['where'][_0x7f48('0x72')]=_0x4a58dd['id'];if(_0x60739a[_0x7f48('0x47')][_0x7f48('0x56')]){_0x456c4f['where']=_['merge'](_0x456c4f[_0x7f48('0x53')],{'$or':_['map'](_0x456c4f[_0x7f48('0x4b')],function(_0x599607){var _0xde0b7c={};_0xde0b7c[_0x599607]={'$like':'%'+_0x60739a[_0x7f48('0x47')][_0x7f48('0x56')]+'%'};return _0xde0b7c;})});}_0x456c4f=_[_0x7f48('0x54')]({},_0x456c4f,_0x60739a[_0x7f48('0x6e')]);return db[_0x7f48('0x73')][_0x7f48('0x33')]({'where':_0x456c4f[_0x7f48('0x53')]})[_0x7f48('0x21')](function(_0x15bcc4){_0x46018c[_0x7f48('0x33')]=_0x15bcc4;if(_0x60739a[_0x7f48('0x47')][_0x7f48('0x57')]){_0x456c4f[_0x7f48('0x58')]=[{'all':!![]}];}return db[_0x7f48('0x73')][_0x7f48('0x59')](_0x456c4f);})['then'](function(_0x3cff64){_0x46018c['rows']=_0x3cff64;return _0x46018c;});}})[_0x7f48('0x21')](respondWithFilteredResult(_0x23a932,_0x456c4f))['catch'](handleError(_0x23a932,null));};exports['removeAnswers']=function(_0x3afa83,_0x3ab4f1,_0x1c510a){return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0x3afa83[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x3ab4f1,null))[_0x7f48('0x21')](function(_0x3cbc9a){if(_0x3cbc9a){return _0x3cbc9a[_0x7f48('0x75')](_0x3afa83['query']['ids']);}})[_0x7f48('0x21')](respondWithStatusCode(_0x3ab4f1,null))['catch'](handleError(_0x3ab4f1,null));};exports[_0x7f48('0x76')]=function(_0xdecab7,_0x1f11cf,_0x45d91e){var _0x53acda={'channel':_0x7f48('0x77')};var _0x30c64=[];var _0x2fce54=[];var _0x41219e={};return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0xdecab7[_0x7f48('0x5c')]['id']},'include':[{'model':db[_0x7f48('0x78')],'as':_0x7f48('0x79')}]})['then'](handleEntityNotFound(_0x1f11cf,null))[_0x7f48('0x21')](function(_0x348f56){_0x53acda[_0x7f48('0x7a')]=_0x348f56;_0x53acda['applications']=_['orderBy'](_0x348f56[_0x7f48('0x79')],['priority'],[_0x7f48('0x7b')]);if(_0x53acda[_0x7f48('0x7a')][_0x7f48('0x79')]){delete _0x53acda['account']['Applications'];}return db[_0x7f48('0x7c')][_0x7f48('0x69')]();})[_0x7f48('0x21')](function(_0x31022a){if(!_0x31022a){throw new db[(_0x7f48('0x7d'))][(_0x7f48('0x7e'))](_0x7f48('0x7f'));}_0x30c64=_[_0x7f48('0x80')](_['keys'](_0x31022a),['createdAt','updatedAt']);_0x2fce54=_['difference'](_[_0x7f48('0x46')](_0x31022a),[_0x7f48('0x81'),_0x7f48('0x82'),_0x7f48('0x83'),_0x7f48('0x84')]);_0x53acda[_0x7f48('0x68')]={'mapKey':_0x7f48('0x85')};if(_0x53acda['account'][_0x7f48('0x44')]){switch(_0x53acda[_0x7f48('0x7a')][_0x7f48('0x44')]){case _0x7f48('0x86'):_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')]=_0xdecab7[_0x7f48('0x68')]['From'];_0x53acda[_0x7f48('0x68')][_0x7f48('0x68')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x88')];_0x53acda[_0x7f48('0x68')][_0x7f48('0x89')]=_0xdecab7['body'][_0x7f48('0x8a')];break;case _0x7f48('0x8b'):_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')]='+'+_0xdecab7[_0x7f48('0x68')]['sender'];_0x53acda['body'][_0x7f48('0x68')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x8c')];break;case _0x7f48('0x8d'):_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')]=_0xdecab7['body'][_0x7f48('0x87')];_0x53acda[_0x7f48('0x68')][_0x7f48('0x68')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x29')];break;case _0x7f48('0x8e'):_0x53acda['body']['from']=_0xdecab7['body'][_0x7f48('0x87')];_0x53acda[_0x7f48('0x68')]['body']=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x68')];_0x53acda[_0x7f48('0x68')][_0x7f48('0x89')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x8f')];break;case _0x7f48('0x90'):_0x53acda['body'][_0x7f48('0x87')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x91')];_0x53acda[_0x7f48('0x68')][_0x7f48('0x68')]=_0xdecab7['body'][_0x7f48('0x92')];_0x53acda[_0x7f48('0x68')][_0x7f48('0x89')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x93')];break;case _0x7f48('0x94'):_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')]='+'+_0xdecab7[_0x7f48('0x68')]['results'][0x0][_0x7f48('0x87')];_0x53acda['body']['body']=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x95')][0x0][_0x7f48('0x8c')];_0x53acda[_0x7f48('0x68')][_0x7f48('0x89')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x95')][0x0][_0x7f48('0x89')];break;case'csc':_0x53acda['body'][_0x7f48('0x87')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x96')];_0x53acda[_0x7f48('0x68')]['body']=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x97')][_0x7f48('0x29')];break;case'clickatell':_0x53acda[_0x7f48('0x68')]['from']=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x98')];_0x53acda['body']['body']=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x8c')];_0x53acda['body'][_0x7f48('0x89')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x99')];break;case _0x7f48('0x9a'):_0x53acda[_0x7f48('0x68')]['messageId']=_0xdecab7[_0x7f48('0x68')][0x0][_0x7f48('0x29')]['id'];_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')]=_0xdecab7[_0x7f48('0x68')][0x0]['message'][_0x7f48('0x87')];_0x53acda[_0x7f48('0x68')]['body']=_0xdecab7['body'][0x0][_0x7f48('0x29')][_0x7f48('0x8c')];break;case _0x7f48('0x9b'):_0x53acda['body'][_0x7f48('0x87')]=_0xdecab7[_0x7f48('0x68')]['from'];_0x53acda[_0x7f48('0x68')][_0x7f48('0x68')]=_0xdecab7['body']['message'];_0x53acda[_0x7f48('0x68')][_0x7f48('0x89')]=_0xdecab7[_0x7f48('0x68')][_0x7f48('0x9c')];break;}}if(_0x53acda[_0x7f48('0x68')]['id']){delete _0x53acda[_0x7f48('0x68')]['id'];}if(_[_0x7f48('0x9d')](_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')])){throw new db[(_0x7f48('0x7d'))][(_0x7f48('0x7e'))](_0x7f48('0x9e'));}if(_[_0x7f48('0x9d')](_0x53acda[_0x7f48('0x68')][_0x7f48('0x68')])||_0x53acda['body'][_0x7f48('0x68')]===''){throw new db[(_0x7f48('0x7d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7f48('0x9d')](_0x53acda['body'][_0x7f48('0x9f')])){throw new db[(_0x7f48('0x7d'))]['ValidationError'](_0x7f48('0xa0')+_0x2fce54);}if(!_[_0x7f48('0xa1')](_0x2fce54,_0x53acda['body'][_0x7f48('0x9f')])){throw new db['Sequelize'][(_0x7f48('0x7e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2fce54);}_0x41219e[_0x53acda[_0x7f48('0x68')]['mapKey']]=_0x53acda[_0x7f48('0x68')]['from'];return db[_0x7f48('0xa2')][_0x7f48('0x5e')]({'where':{'id':_0x53acda[_0x7f48('0x7a')][_0x7f48('0x84')]},'include':[{'model':db['CmContact'],'as':_0x7f48('0xa3'),'where':_0x41219e,'limit':0x1,'order':[[_0x7f48('0x82'),'DESC']]}]});})['then'](handleEntityNotFound(_0x1f11cf,null))[_0x7f48('0x21')](function(_0x2f1b8c){if(_0x2f1b8c){_0x53acda[_0x7f48('0xa4')]=_[_0x7f48('0xa5')](_0x2f1b8c,[_0x7f48('0xa3')]);if(_0x2f1b8c['Contacts'][_0x7f48('0x4d')]){return _0x2f1b8c['Contacts'][0x0];}var _0x5a8932=_['defaults'](_0x53acda[_0x7f48('0x68')],{'firstName':_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')],'ListId':_0x2f1b8c['id']});_0x5a8932[_0x53acda[_0x7f48('0x68')][_0x7f48('0x9f')]]=_0x53acda[_0x7f48('0x68')][_0x7f48('0x87')];return db['CmContact']['create'](_0x5a8932,{'fields':_0x30c64,'raw':!![]});}})[_0x7f48('0x21')](handleEntityNotFound(_0x1f11cf,null))[_0x7f48('0x21')](function(_0x163787){if(_0x163787){_0x53acda[_0x7f48('0xa6')]=_0x163787;var _0x4106c0={'ContactId':_0x163787['id'],'phone':_0x53acda[_0x7f48('0x68')]['from'],'SmsAccountId':_0xdecab7[_0x7f48('0x5c')]['id']};var _0x5e8b5a={'ContactId':_0x163787['id'],'SmsAccountId':_0xdecab7[_0x7f48('0x5c')]['id'],'closed':![]};return db[_0x7f48('0xa7')][_0x7f48('0x5e')]({'where':_0x5e8b5a})['then'](function(_0x232319){if(_0x232319){return[_0x232319,![]];}return db[_0x7f48('0xa7')][_0x7f48('0x5f')](_0x4106c0)['then'](function(_0x36c3f4){return[_0x36c3f4,!![]];});});}})['spread'](function(_0x148a24,_0xa8ed99){_0x53acda[_0x7f48('0xa8')]=_0x148a24['get']({'plain':!![]});_0x53acda[_0x7f48('0xa8')][_0x7f48('0xa9')]=![];if(_0xa8ed99){if(_0x53acda[_0x7f48('0x7a')][_0x7f48('0xaa')]){_0x53acda[_0x7f48('0xab')][_0x7f48('0xac')]({'id':0x0,'priority':_0x53acda[_0x7f48('0xab')][_0x7f48('0x4d')]+0x1,'app':_0x7f48('0xad'),'appdata':_0x7f48('0xae'),'interval':_0x7f48('0xaf')});}_0x53acda[_0x7f48('0xa8')][_0x7f48('0xa9')]=!![];}return db[_0x7f48('0xb0')][_0x7f48('0x5f')]({'phone':_0x53acda['body'][_0x7f48('0x87')],'messageId':_0x53acda[_0x7f48('0x68')][_0x7f48('0x89')],'body':_0x53acda[_0x7f48('0x68')][_0x7f48('0x68')],'SmsAccountId':_0xdecab7[_0x7f48('0x5c')]['id'],'SmsInteractionId':_0x148a24['id'],'direction':'in','ContactId':_0x148a24[_0x7f48('0xb1')],'AttachmentId':_0x53acda[_0x7f48('0x68')][_0x7f48('0xb2')]});})[_0x7f48('0x21')](function(_0x4a5381){_0x53acda[_0x7f48('0x29')]=_0x4a5381;if(_0x53acda['interaction'][_0x7f48('0xb3')]){return db[_0x7f48('0xb4')]['find']({'attributes':['id',_0x7f48('0x3e')],'where':{'id':_0x53acda[_0x7f48('0xa8')][_0x7f48('0xb3')]}})['then'](function(_0x2d6b64){if(_0x2d6b64){_0x53acda['applications'][_0x7f48('0xb5')]({'id':0x0,'priority':0x0,'app':_0x7f48('0xb6'),'appdata':_0x2d6b64[_0x7f48('0x3e')]+','+(_0x53acda[_0x7f48('0x7a')]['waitForTheAssignedAgent']||0xa),'interval':_0x7f48('0xaf')});}return respondWithRpcPromise(_0x7f48('0xb7'),_0x7f48('0xb8'),_0x53acda);});}return respondWithRpcPromise(_0x7f48('0xb7'),'startRouting',_0x53acda);})[_0x7f48('0x21')](function(_0x585c9d){if(_0x585c9d){var _0x391e4b=0xc8;var _0x5d65ad=_0x7f48('0xb9');logger[_0x7f48('0x2a')](_0x7f48('0x24'),_0x5d65ad,_0x391e4b,'entity\x20found');logger[_0x7f48('0x23')](_0x7f48('0xba'),_0x5d65ad,_0x391e4b,_0x7f48('0xbb'),JSON[_0x7f48('0x26')](_0x585c9d));if(_0x53acda[_0x7f48('0x7a')][_0x7f48('0x44')]==='twilio'){return _0x1f11cf[_0x7f48('0x2e')](_0x391e4b)['set'](_0x7f48('0xbc'),_0x7f48('0xbd'))[_0x7f48('0xbe')](_0x7f48('0xbf'));}else{return _0x1f11cf[_0x7f48('0x2e')](_0x391e4b)['json'](_0x585c9d);}}})[_0x7f48('0x2c')](handleError(_0x1f11cf,null));};exports['addApplications']=function(_0x2076dd,_0x41294b){var _0x895377=_0x2076dd['params']['id'];var _0x202a1f=_0x2076dd[_0x7f48('0x68')];var _0x4a7193=0xc8;var _0x508ca3=null;return db[_0x7f48('0xc0')]['transaction']({'isolationLevel':db[_0x7f48('0xc0')]['Transaction']['ISOLATION_LEVELS'][_0x7f48('0xc1')]},function(_0x54d018){return db[_0x7f48('0x5d')][_0x7f48('0x6d')]({'where':{'id':_0x895377},'transaction':_0x54d018})[_0x7f48('0x21')](function(_0x1ac6c7){if(_0x1ac6c7){return db[_0x7f48('0x78')]['destroy']({'where':{'SmsAccountId':_0x895377},'transaction':_0x54d018})[_0x7f48('0x21')](function(){var _0x3c932f=_[_0x7f48('0x41')](_0x202a1f,function(_0x23c72b){_0x23c72b[_0x7f48('0x72')]=_0x895377;return _0x23c72b;});return db[_0x7f48('0x78')]['bulkCreate'](_0x3c932f,{'transaction':_0x54d018});});}else{_0x4a7193=0x194;_0x508ca3=[];}});})[_0x7f48('0x21')](function(){if(_0x4a7193!==0x194){return db[_0x7f48('0x78')]['findAndCountAll']({'where':{'SmsAccountId':_0x895377},'order':_0x7f48('0xc2')})[_0x7f48('0x21')](function(_0x52d71a){_0x508ca3=_0x52d71a;});}})[_0x7f48('0x2c')](function(_0x3a42c1){_0x4a7193=0x1f4;logger[_0x7f48('0x27')](_0x3a42c1[_0x7f48('0x3d')]);if(_0x3a42c1[_0x7f48('0x3e')]){delete _0x3a42c1[_0x7f48('0x3e')];}_0x508ca3=_0x3a42c1;})[_0x7f48('0xc3')](function(){if(_0x508ca3===null){_0x41294b[_0x7f48('0x2d')](_0x4a7193);}else{if(_0x4a7193===0x1f4){_0x41294b[_0x7f48('0x2e')](_0x4a7193)[_0x7f48('0xbe')](_0x508ca3);}else{_0x41294b['status'](_0x4a7193)['json'](_0x508ca3);}}});};exports[_0x7f48('0xc4')]=function(_0x2459df,_0x289eb2,_0x4c0687){var _0x38098c={};var _0x5d4e82={};var _0x412ebd;var _0x952589;return db[_0x7f48('0x5d')][_0x7f48('0x6d')]({'where':{'id':_0x2459df[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x289eb2,null))['then'](function(_0x388c55){if(_0x388c55){_0x412ebd=_0x388c55;_0x5d4e82['model']=_[_0x7f48('0x46')](db[_0x7f48('0x78')][_0x7f48('0x42')]);_0x5d4e82['query']=_[_0x7f48('0x46')](_0x2459df[_0x7f48('0x47')]);_0x5d4e82[_0x7f48('0x48')]=_[_0x7f48('0x49')](_0x5d4e82['model'],_0x5d4e82[_0x7f48('0x47')]);_0x38098c[_0x7f48('0x4b')]=_[_0x7f48('0x49')](_0x5d4e82[_0x7f48('0x4a')],qs[_0x7f48('0x4c')](_0x2459df[_0x7f48('0x47')][_0x7f48('0x4c')]));_0x38098c[_0x7f48('0x4b')]=_0x38098c['attributes']['length']?_0x38098c[_0x7f48('0x4b')]:_0x5d4e82[_0x7f48('0x4a')];_0x38098c[_0x7f48('0x50')]=qs[_0x7f48('0x51')](_0x2459df[_0x7f48('0x47')][_0x7f48('0x51')]);_0x38098c[_0x7f48('0x53')]=qs[_0x7f48('0x48')](_[_0x7f48('0x52')](_0x2459df[_0x7f48('0x47')],_0x5d4e82[_0x7f48('0x48')]));if(_0x2459df[_0x7f48('0x47')]['filter']){_0x38098c[_0x7f48('0x53')]=_[_0x7f48('0x54')](_0x38098c[_0x7f48('0x53')],{'$or':_[_0x7f48('0x41')](_0x38098c[_0x7f48('0x4b')],function(_0x125864){var _0x466aca={};_0x466aca[_0x125864]={'$like':'%'+_0x2459df[_0x7f48('0x47')][_0x7f48('0x56')]+'%'};return _0x466aca;})});}_0x38098c=_['merge']({},_0x38098c,_0x2459df[_0x7f48('0x6e')]);return _0x412ebd[_0x7f48('0xc4')](_0x38098c);}})[_0x7f48('0x21')](function(_0x16250e){if(_0x16250e){_0x952589=_0x16250e[_0x7f48('0x4d')];if(!_0x2459df[_0x7f48('0x47')][_0x7f48('0x4e')](_0x7f48('0x4f'))){_0x38098c['limit']=qs['limit'](_0x2459df[_0x7f48('0x47')][_0x7f48('0x31')]);_0x38098c['offset']=qs[_0x7f48('0x30')](_0x2459df[_0x7f48('0x47')][_0x7f48('0x30')]);}return _0x412ebd[_0x7f48('0xc4')](_0x38098c);}})[_0x7f48('0x21')](function(_0x98745f){if(_0x98745f){return _0x98745f?{'count':_0x952589,'rows':_0x98745f}:null;}})[_0x7f48('0x21')](respondWithResult(_0x289eb2,null))[_0x7f48('0x2c')](handleError(_0x289eb2,null));};exports[_0x7f48('0xc5')]=function(_0x34139f,_0xba210f,_0x112f6c){var _0x2b49a8={'raw':![],'where':{}};var _0x44cc6c={};var _0x1e618d={'count':0x0,'rows':[]};return db[_0x7f48('0x5d')]['findOne']({'where':{'id':_0x34139f[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0xba210f,null))['then'](function(_0x4a0608){if(_0x4a0608){_0x44cc6c['model']=_['keys'](db[_0x7f48('0xa7')][_0x7f48('0x42')]);_0x44cc6c[_0x7f48('0x47')]=_[_0x7f48('0x46')](_0x34139f[_0x7f48('0x47')]);_0x44cc6c[_0x7f48('0x48')]=_[_0x7f48('0x49')](_0x44cc6c[_0x7f48('0x4a')],_0x44cc6c[_0x7f48('0x47')]);_0x2b49a8[_0x7f48('0x4b')]=_['intersection'](_0x44cc6c[_0x7f48('0x4a')],qs['fields'](_0x34139f[_0x7f48('0x47')][_0x7f48('0x4c')]));_0x2b49a8['attributes']=_0x2b49a8[_0x7f48('0x4b')][_0x7f48('0x4d')]?_0x2b49a8[_0x7f48('0x4b')]:_0x44cc6c[_0x7f48('0x4a')];if(!_0x34139f[_0x7f48('0x47')][_0x7f48('0x4e')](_0x7f48('0x4f'))){_0x2b49a8['limit']=qs[_0x7f48('0x31')](_0x34139f[_0x7f48('0x47')][_0x7f48('0x31')]);_0x2b49a8[_0x7f48('0x30')]=qs['offset'](_0x34139f[_0x7f48('0x47')][_0x7f48('0x30')]);}_0x2b49a8[_0x7f48('0x50')]=qs[_0x7f48('0x51')](_0x34139f[_0x7f48('0x47')][_0x7f48('0x51')]);_0x2b49a8[_0x7f48('0x53')]=qs[_0x7f48('0x48')](_[_0x7f48('0x52')](_0x34139f[_0x7f48('0x47')],_0x44cc6c[_0x7f48('0x48')]));_0x2b49a8[_0x7f48('0x53')][_0x7f48('0x72')]=_0x4a0608['id'];if(_0x34139f[_0x7f48('0x47')]['filter']){_0x2b49a8[_0x7f48('0x53')]=_[_0x7f48('0x54')](_0x2b49a8['where'],{'$or':_[_0x7f48('0x41')](_0x2b49a8[_0x7f48('0x4b')],function(_0x4dbf89){var _0x58919b={};_0x58919b[_0x4dbf89]={'$like':'%'+_0x34139f[_0x7f48('0x47')]['filter']+'%'};return _0x58919b;})});}_0x2b49a8=_[_0x7f48('0x54')]({},_0x2b49a8,_0x34139f[_0x7f48('0x6e')]);return db[_0x7f48('0xa7')][_0x7f48('0x33')]({'where':_0x2b49a8[_0x7f48('0x53')]})[_0x7f48('0x21')](function(_0x528d23){_0x1e618d[_0x7f48('0x33')]=_0x528d23;if(_0x34139f[_0x7f48('0x47')]['includeAll']){_0x2b49a8['include']=[{'model':db[_0x7f48('0x7c')],'as':_0x7f48('0xc6'),'required':![]},{'model':db[_0x7f48('0xb4')],'as':_0x7f48('0xc7'),'attributes':[_0x7f48('0x3e'),_0x7f48('0xc8'),'internal'],'required':![]},{'model':db[_0x7f48('0xc9')],'as':_0x7f48('0xca'),'attributes':['id',_0x7f48('0x3e'),_0x7f48('0xcb')],'where':_0x34139f[_0x7f48('0x47')][_0x7f48('0xcc')]?{'id':_0x34139f['query'][_0x7f48('0xcc')]}:undefined,'required':_0x34139f[_0x7f48('0x47')]['tag']?!![]:![]}];}return db[_0x7f48('0xa7')][_0x7f48('0x59')](_0x2b49a8);})['then'](function(_0x74646e){_0x1e618d[_0x7f48('0x5a')]=_0x74646e;return _0x1e618d;});}})['then'](respondWithFilteredResult(_0xba210f,_0x2b49a8))[_0x7f48('0x2c')](handleError(_0xba210f,null));};exports['send']=function(_0x14826a,_0x59d9da,_0x1a584c){var _0x6c9dbc,_0x1ed3bc,_0x22e1d5;if(_[_0x7f48('0x9d')](_0x14826a[_0x7f48('0x68')][_0x7f48('0x68')])||_0x14826a['body'][_0x7f48('0x68')]===''){throw new db[(_0x7f48('0x7d'))][(_0x7f48('0x7e'))](_0x7f48('0xcd'));}if(_['isNil'](_0x14826a['body']['to'])){throw new db[(_0x7f48('0x7d'))][(_0x7f48('0x7e'))](_0x7f48('0xce'));}_0x6c9dbc=_0x14826a[_0x7f48('0x68')]['to'];return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0x14826a[_0x7f48('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x7f48('0xcf'),'include':[{'model':db[_0x7f48('0x7c')],'as':_0x7f48('0xa3'),'where':{'mobile':_0x6c9dbc},'limit':0x1,'order':[[_0x7f48('0x82'),_0x7f48('0xd0')]]}]}]})[_0x7f48('0x21')](handleEntityNotFound(_0x59d9da,null))[_0x7f48('0x21')](function(_0x4ac09b){if(_0x4ac09b&&_0x4ac09b[_0x7f48('0xcf')]){_0x1ed3bc=_0x4ac09b['get']({'plain':!![]});if(_0x1ed3bc[_0x7f48('0xcf')]&&_0x1ed3bc['List'][_0x7f48('0xa3')][_0x7f48('0x4d')]){return _0x1ed3bc[_0x7f48('0xcf')][_0x7f48('0xa3')][0x0];}return db[_0x7f48('0x7c')][_0x7f48('0x5f')](_[_0x7f48('0x19')](_0x14826a[_0x7f48('0x68')],{'firstName':_0x6c9dbc,'mobile':_0x6c9dbc,'phone':_0x6c9dbc,'ListId':_0x1ed3bc[_0x7f48('0x84')]}));}})['then'](handleEntityNotFound(_0x59d9da,null))['then'](function(_0x1cb880){if(_0x1cb880){_0x22e1d5=_0x1cb880;return db[_0x7f48('0xa7')]['find']({'where':{'ContactId':_0x22e1d5['id'],'closed':![],'SmsAccountId':_0x1ed3bc['id']}})[_0x7f48('0x21')](function(_0x2e3550){if(_0x2e3550){return[_0x2e3550,![]];}return db[_0x7f48('0xa7')]['create']({'UserId':_0x14826a[_0x7f48('0x60')]['id'],'ContactId':_0x22e1d5['id'],'SmsAccountId':_0x1ed3bc['id'],'phone':_0x6c9dbc,'firstMsgDirection':'out','Messages':[_['merge'](_0x14826a[_0x7f48('0x68')],{'read':![],'body':_0x14826a[_0x7f48('0x68')][_0x7f48('0x68')],'phone':_0x6c9dbc,'SmsAccountId':_0x1ed3bc['id'],'UserId':_0x14826a[_0x7f48('0x60')]['id'],'ContactId':_0x22e1d5['id']})]},{'include':[{'model':db[_0x7f48('0xb0')],'as':_0x7f48('0xd1')}]})[_0x7f48('0x21')](function(_0x42a297){return[_0x42a297,!![]];});});}})['spread'](function(_0x26883a,_0x4b97b8){if(_0x4b97b8){return _0x26883a;}return db['SmsMessage'][_0x7f48('0x5f')](_[_0x7f48('0x54')](_0x14826a[_0x7f48('0x68')],{'read':![],'body':_0x14826a[_0x7f48('0x68')]['body'],'phone':_0x6c9dbc,'SmsAccountId':_0x1ed3bc['id'],'SmsInteractionId':_0x26883a['id'],'UserId':_0x14826a['user']['id'],'ContactId':_0x22e1d5['id']}))[_0x7f48('0x21')](function(_0x164dda){_0x26883a['dataValues'][_0x7f48('0xd1')]=[];_0x26883a[_0x7f48('0xd2')][_0x7f48('0xd1')][_0x7f48('0xac')](_0x164dda[_0x7f48('0xd2')]);return _0x26883a;});})[_0x7f48('0x21')](respondWithResult(_0x59d9da,null))['catch'](handleError(_0x59d9da,null));};exports[_0x7f48('0x2e')]=function(_0x238d7f,_0x29b825,_0x55cc64){if(_0x238d7f[_0x7f48('0x68')]['id']){delete _0x238d7f[_0x7f48('0x68')]['id'];}var _0x44eadf,_0x81fbe8,_0x181b0c;return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0x238d7f[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x29b825,null))[_0x7f48('0x21')](function(_0x524337){if(_0x524337){_0x181b0c=_0x524337;logger[_0x7f48('0x23')](_0x7f48('0x24'),_0x7f48('0x2e'),_0x7f48('0xd3'),_0x524337[_0x7f48('0x44')],util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));switch(_0x524337[_0x7f48('0x44')]){case _0x7f48('0x8b'):if(_0x238d7f['body'][_0x7f48('0xd5')]&&_0x238d7f['body']['status']){_0x81fbe8=_0x238d7f[_0x7f48('0x68')]['status'];return db[_0x7f48('0xb0')][_0x7f48('0x5e')]({'where':{'messageId':_0x238d7f['body'][_0x7f48('0xd5')]}});}break;case'connectel':if(_0x238d7f[_0x7f48('0x68')]['requestid']&&_0x238d7f[_0x7f48('0x68')]['statusInt']){_0x81fbe8=_0x238d7f[_0x7f48('0x68')][_0x7f48('0xd6')];return db[_0x7f48('0xb0')]['find']({'where':{'messageId':_0x238d7f[_0x7f48('0x68')]['requestid']}});}break;case'clicksend':if(_0x238d7f['body'][_0x7f48('0x8f')]&&_0x238d7f[_0x7f48('0x68')][_0x7f48('0xd7')]){_0x81fbe8=_0x238d7f['body'][_0x7f48('0xd7')];return db[_0x7f48('0xb0')][_0x7f48('0x5e')]({'where':{'messageId':_0x238d7f[_0x7f48('0x68')][_0x7f48('0x8f')]}});}break;case'infobip':var _0x436f28=_0x238d7f['body'][_0x7f48('0x95')][0x0];if(_0x436f28['messageId']&&_0x436f28['status'][_0x7f48('0xd8')]===_0x7f48('0xd9')){_0x81fbe8=_0x436f28[_0x7f48('0x2e')][_0x7f48('0xd8')];return db[_0x7f48('0xb0')]['find']({'where':{'messageId':_0x436f28['messageId']}});}break;case _0x7f48('0xda'):if(_0x238d7f[_0x7f48('0x68')][_0x7f48('0x89')]&&_0x238d7f['body'][_0x7f48('0x2e')]){_0x81fbe8=_0x238d7f[_0x7f48('0x68')]['status'];return db[_0x7f48('0xb0')][_0x7f48('0x5e')]({'where':{'messageId':_0x238d7f[_0x7f48('0x68')]['messageId']}});}break;case _0x7f48('0x9a'):if(_0x238d7f[_0x7f48('0x68')][0x0][_0x7f48('0x29')]['id']){_0x81fbe8=_0x238d7f['body'][0x0][_0x7f48('0x44')];return db[_0x7f48('0xb0')]['find']({'where':{'messageId':_0x238d7f[_0x7f48('0x68')][0x0][_0x7f48('0x29')]['id']}});}break;case _0x7f48('0x9b'):if(_0x238d7f[_0x7f48('0x68')][_0x7f48('0xdb')]&&_0x238d7f[_0x7f48('0x68')][_0x7f48('0x2e')]){_0x81fbe8=_0x238d7f[_0x7f48('0x68')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x238d7f[_0x7f48('0x68')][_0x7f48('0xdb')]}});}break;}}})[_0x7f48('0x21')](handleEntityNotFound(_0x29b825,null))[_0x7f48('0x21')](function(_0x30061d){if(_0x30061d){_0x44eadf=_0x30061d;switch(_0x181b0c[_0x7f48('0x44')]){case _0x7f48('0x8b'):if(_0x81fbe8===_0x7f48('0xd9')){return _0x44eadf['update']({'read':!![]});}else{logger[_0x7f48('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7f48('0x2e'),_0x7f48('0x8b'),util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;case _0x7f48('0x8d'):if(_0x81fbe8==='1'){return _0x44eadf['update']({'read':!![]});}else{logger[_0x7f48('0x27')](_0x7f48('0x24'),_0x7f48('0x2e'),_0x7f48('0x8b'),util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;case _0x7f48('0x8e'):if(!_0x238d7f[_0x7f48('0x68')]['error_code']&&_0x81fbe8>=0xc8&&_0x81fbe8<=0xce){return _0x44eadf['update']({'read':!![]});}else{logger[_0x7f48('0x27')](_0x7f48('0x24'),_0x7f48('0x2e'),'clicksend',util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;case _0x7f48('0x94'):var _0xee6e0e=_0x238d7f[_0x7f48('0x68')][_0x7f48('0x95')][0x0];if(_0xee6e0e[_0x7f48('0x2e')]['groupName']===_0x7f48('0xd9')){return _0x44eadf['update']({'read':!![]});}else{logger[_0x7f48('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7f48('0x2e'),_0x7f48('0x94'),util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;case _0x7f48('0xda'):if(_0x81fbe8==_0x7f48('0xdc')||_0x81fbe8==_0x7f48('0xdd')){return _0x44eadf['update']({'read':!![]});}else{logger[_0x7f48('0x27')](_0x7f48('0x24'),_0x7f48('0x2e'),_0x7f48('0xda'),util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;case _0x7f48('0x9a'):if(_0x81fbe8==_0x7f48('0xde')){return _0x44eadf[_0x7f48('0x39')]({'read':!![]});}else{logger[_0x7f48('0x27')](_0x7f48('0x24'),'status',_0x7f48('0x9a'),util['inspect'](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;case _0x7f48('0x9b'):if(_0x81fbe8===_0x7f48('0xdf')||_0x81fbe8===_0x7f48('0xe0')){return _0x44eadf[_0x7f48('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7f48('0x2e'),_0x7f48('0x9b'),util[_0x7f48('0xd4')](_0x238d7f[_0x7f48('0x68')],{'showHidden':![],'depth':null}));}break;}return _0x44eadf;}})[_0x7f48('0x21')](respondWithResult(_0x29b825,null))[_0x7f48('0x2c')](handleError(_0x29b825,null));};exports[_0x7f48('0xe1')]=function(_0x4a52eb,_0x3f56ba,_0x2d5c86){var _0x3172e0,_0x37c655,_0x51b645;return db[_0x7f48('0x5d')]['find']({'where':{'id':_0x4a52eb[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x3f56ba,null))[_0x7f48('0x21')](function(_0x50a024){if(_0x50a024){_0x51b645=_0x50a024;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7f48('0x2e'),_0x7f48('0xd3'),_0x50a024['type'],util[_0x7f48('0xd4')](_0x4a52eb[_0x7f48('0x47')],{'showHidden':![],'depth':null}));switch(_0x50a024['type']){case _0x7f48('0xe2'):if(_0x4a52eb[_0x7f48('0x47')][_0x7f48('0xe3')]&&_0x4a52eb[_0x7f48('0x47')][_0x7f48('0xe4')]){_0x37c655=_0x4a52eb['query'][_0x7f48('0xe4')];return db[_0x7f48('0xb0')]['find']({'where':{'messageId':_0x4a52eb[_0x7f48('0x47')][_0x7f48('0xe3')]}});}break;}}})[_0x7f48('0x21')](handleEntityNotFound(_0x3f56ba,null))[_0x7f48('0x21')](function(_0x2d7134){if(_0x2d7134){_0x3172e0=_0x2d7134;switch(_0x51b645[_0x7f48('0x44')]){case _0x7f48('0xe2'):if(_0x37c655==='2'||_0x37c655==='6'){return _0x3172e0[_0x7f48('0x39')]({'read':!![]});}else{logger['error'](_0x7f48('0x24'),_0x7f48('0x2e'),_0x7f48('0xe2'),util[_0x7f48('0xd4')](_0x4a52eb[_0x7f48('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x3172e0;}})['then'](respondWithResult(_0x3f56ba,null))[_0x7f48('0x2c')](handleError(_0x3f56ba,null));};exports[_0x7f48('0xe5')]=function(_0x5c040f,_0x2fee8e,_0x27e6f3){return db[_0x7f48('0x5d')]['find']({'where':{'id':_0x5c040f[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x2fee8e,null))[_0x7f48('0x21')](function(_0x4845a4){if(_0x4845a4){return _0x4845a4['addAgents'](_0x5c040f[_0x7f48('0x68')]['ids'],_[_0x7f48('0xa5')](_0x5c040f[_0x7f48('0x68')],[_0x7f48('0x70'),'id'])||{})[_0x7f48('0xe6')](function(_0x2a6b63){for(var _0x4b2ac6=0x0;_0x4b2ac6<_0x5c040f[_0x7f48('0x68')][_0x7f48('0x70')]['length'];_0x4b2ac6+=0x1){socket['emit'](_0x7f48('0xe7'),{'UserId':Number(_0x5c040f[_0x7f48('0x68')]['ids'][_0x4b2ac6]),'SmsAccountId':Number(_0x5c040f[_0x7f48('0x5c')]['id'])});}return _0x2a6b63;});}})[_0x7f48('0x21')](respondWithResult(_0x2fee8e,null))[_0x7f48('0x2c')](handleError(_0x2fee8e,null));};exports[_0x7f48('0xe8')]=function(_0x5cc22a,_0x1a344b,_0x3e89cb){return db[_0x7f48('0x5d')][_0x7f48('0x5e')]({'where':{'id':_0x5cc22a[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x1a344b,null))[_0x7f48('0x21')](function(_0x181163){if(_0x181163){return _0x181163[_0x7f48('0xe8')](_0x5cc22a['query'][_0x7f48('0x70')])[_0x7f48('0x21')](function(){if(_['isArray'](_0x5cc22a[_0x7f48('0x47')][_0x7f48('0x70')])){for(var _0x26698e=0x0;_0x26698e<_0x5cc22a[_0x7f48('0x47')][_0x7f48('0x70')][_0x7f48('0x4d')];_0x26698e+=0x1){socket[_0x7f48('0xe9')](_0x7f48('0xea'),{'UserId':Number(_0x5cc22a['query']['ids'][_0x26698e]),'SmsAccountId':Number(_0x5cc22a['params']['id'])});}}else{socket['emit'](_0x7f48('0xea'),{'UserId':Number(_0x5cc22a[_0x7f48('0x47')][_0x7f48('0x70')]),'SmsAccountId':Number(_0x5cc22a[_0x7f48('0x5c')]['id'])});}});}})[_0x7f48('0x21')](respondWithStatusCode(_0x1a344b,null))[_0x7f48('0x2c')](handleError(_0x1a344b,null));};exports['getAgents']=function(_0x18619a,_0x114c64,_0x15885f){var _0x367eab={};var _0x22ee81={};var _0x47a3ef;var _0xc379d4;return db['SmsAccount'][_0x7f48('0x6d')]({'where':{'id':_0x18619a[_0x7f48('0x5c')]['id']}})[_0x7f48('0x21')](handleEntityNotFound(_0x114c64,null))['then'](function(_0x95eadb){if(_0x95eadb){_0x47a3ef=_0x95eadb;_0x22ee81[_0x7f48('0x4a')]=_[_0x7f48('0x46')](db[_0x7f48('0xb4')][_0x7f48('0x42')]);_0x22ee81['query']=_[_0x7f48('0x46')](_0x18619a[_0x7f48('0x47')]);_0x22ee81[_0x7f48('0x48')]=_[_0x7f48('0x49')](_0x22ee81[_0x7f48('0x4a')],_0x22ee81[_0x7f48('0x47')]);_0x367eab[_0x7f48('0x4b')]=_[_0x7f48('0x49')](_0x22ee81[_0x7f48('0x4a')],qs[_0x7f48('0x4c')](_0x18619a[_0x7f48('0x47')]['fields']));_0x367eab[_0x7f48('0x4b')]=_0x367eab['attributes'][_0x7f48('0x4d')]?_0x367eab[_0x7f48('0x4b')]:_0x22ee81['model'];_0x367eab[_0x7f48('0x50')]=qs[_0x7f48('0x51')](_0x18619a['query'][_0x7f48('0x51')]);_0x367eab[_0x7f48('0x53')]=qs[_0x7f48('0x48')](_[_0x7f48('0x52')](_0x18619a['query'],_0x22ee81[_0x7f48('0x48')]));if(_0x18619a[_0x7f48('0x47')][_0x7f48('0x56')]){_0x367eab[_0x7f48('0x53')]=_[_0x7f48('0x54')](_0x367eab[_0x7f48('0x53')],{'$or':_['map'](_0x367eab[_0x7f48('0x4b')],function(_0x5c0ec6){var _0x265610={};_0x265610[_0x5c0ec6]={'$like':'%'+_0x18619a[_0x7f48('0x47')]['filter']+'%'};return _0x265610;})});}_0x367eab=_['merge']({},_0x367eab,_0x18619a[_0x7f48('0x6e')]);return _0x47a3ef[_0x7f48('0xeb')](_0x367eab);}})[_0x7f48('0x21')](function(_0x4da90d){if(_0x4da90d){_0xc379d4=_0x4da90d[_0x7f48('0x4d')];if(!_0x18619a[_0x7f48('0x47')][_0x7f48('0x4e')]('nolimit')){_0x367eab['limit']=qs[_0x7f48('0x31')](_0x18619a['query'][_0x7f48('0x31')]);_0x367eab['offset']=qs[_0x7f48('0x30')](_0x18619a[_0x7f48('0x47')][_0x7f48('0x30')]);}return _0x47a3ef['getAgents'](_0x367eab);}})[_0x7f48('0x21')](function(_0x192d58){if(_0x192d58){return _0x192d58?{'count':_0xc379d4,'rows':_0x192d58}:null;}})[_0x7f48('0x21')](respondWithResult(_0x114c64,null))[_0x7f48('0x2c')](handleError(_0x114c64,null));}; \ No newline at end of file +var _0x6545=['SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','merge','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','CannedAnswer','removeAnswers','sms','SmsApplication','orderBy','Applications','priority','asc','account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','sender','clicksend','plivo','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','set','text/xml','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','destroy','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','statusInt','requestid','message_id','status_code','groupName','clickatell','DELIVERED','error_code','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','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','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','get'];(function(_0x5547ca,_0x5ed831){var _0x125f19=function(_0x4f9fc4){while(--_0x4f9fc4){_0x5547ca['push'](_0x5547ca['shift']());}};_0x125f19(++_0x5ed831);}(_0x6545,0xa9));var _0x5654=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6545[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5654('0x0'));var rimraf=require(_0x5654('0x1'));var zipdir=require(_0x5654('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5654('0x3'));var moment=require('moment');var BPromise=require(_0x5654('0x4'));var Mustache=require(_0x5654('0x5'));var util=require('util');var path=require(_0x5654('0x6'));var sox=require('sox');var csv=require(_0x5654('0x7'));var ejs=require(_0x5654('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5654('0x9'));var squel=require(_0x5654('0xa'));var crypto=require(_0x5654('0xb'));var jsforce=require(_0x5654('0xc'));var deskjs=require(_0x5654('0xd'));var toCsv=require(_0x5654('0x7'));var querystring=require('querystring');var Papa=require(_0x5654('0xe'));var Redis=require(_0x5654('0xf'));var authService=require(_0x5654('0x10'));var qs=require(_0x5654('0x11'));var as=require(_0x5654('0x12'));var hardwareService=require(_0x5654('0x13'));var logger=require('../../config/logger')(_0x5654('0x14'));var utils=require(_0x5654('0x15'));var config=require(_0x5654('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5654('0x17')]=_[_0x5654('0x18')](config[_0x5654('0x17')],{'host':_0x5654('0x19'),'port':0x18eb});var socket=require(_0x5654('0x1a'))(new Redis(config[_0x5654('0x17')]));require(_0x5654('0x1b'))[_0x5654('0x1c')](socket);var jayson=require(_0x5654('0x1d'));var client=jayson[_0x5654('0x1e')][_0x5654('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2d22d7,_0x9fa4bf,_0x3c9024,_0x1b8d76){return new BPromise(function(_0x5eaaac,_0x9843fc){var _0x441091=_0x1b8d76||client;return _0x441091[_0x5654('0x20')](_0x2d22d7,_0x3c9024)[_0x5654('0x21')](function(_0x2df80c){logger[_0x5654('0x22')](_0x5654('0x23'),_0x9fa4bf,_0x5654('0x24'));logger[_0x5654('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9fa4bf,_0x5654('0x24'),JSON[_0x5654('0x26')](_0x2df80c));if(_0x2df80c[_0x5654('0x27')]){if(_0x2df80c[_0x5654('0x27')][_0x5654('0x28')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x9fa4bf,_0x2df80c[_0x5654('0x27')][_0x5654('0x29')]);return _0x9843fc(_0x2df80c[_0x5654('0x27')][_0x5654('0x29')]);}logger[_0x5654('0x27')](_0x5654('0x23'),_0x9fa4bf,_0x2df80c[_0x5654('0x27')]['message']);return _0x5eaaac(_0x2df80c[_0x5654('0x27')][_0x5654('0x29')]);}else{logger[_0x5654('0x22')](_0x5654('0x23'),_0x9fa4bf,_0x5654('0x24'));_0x5eaaac(_0x2df80c['result'][_0x5654('0x29')]);}})[_0x5654('0x2a')](function(_0x33f67b){logger['error'](_0x5654('0x23'),_0x9fa4bf,_0x33f67b);_0x9843fc(_0x33f67b);});});}function respondWithStatusCode(_0x292ab3,_0x5c00ec){_0x5c00ec=_0x5c00ec||0xcc;return function(_0x5b0b14){if(_0x5b0b14){return _0x292ab3[_0x5654('0x2b')](_0x5c00ec);}return _0x292ab3[_0x5654('0x2c')](_0x5c00ec)[_0x5654('0x2d')]();};}function respondWithResult(_0x5f50df,_0x1cffa6){_0x1cffa6=_0x1cffa6||0xc8;return function(_0x5c0fa9){if(_0x5c0fa9){return _0x5f50df[_0x5654('0x2c')](_0x1cffa6)['json'](_0x5c0fa9);}};}function respondWithFilteredResult(_0x62b2e2,_0x416ed9){return function(_0x3d1e5b){if(_0x3d1e5b){var _0x30f162=typeof _0x416ed9[_0x5654('0x2e')]==='undefined'&&typeof _0x416ed9['limit']===_0x5654('0x2f');var _0x13342e=_0x3d1e5b[_0x5654('0x30')];var _0x21707e=_0x30f162?0x0:_0x416ed9[_0x5654('0x2e')];var _0x576da3=_0x30f162?_0x3d1e5b[_0x5654('0x30')]:_0x416ed9[_0x5654('0x2e')]+_0x416ed9['limit'];var _0x42880c;if(_0x576da3>=_0x13342e){_0x576da3=_0x13342e;_0x42880c=0xc8;}else{_0x42880c=0xce;}_0x62b2e2['status'](_0x42880c);return _0x62b2e2['set'](_0x5654('0x31'),_0x21707e+'-'+_0x576da3+'/'+_0x13342e)[_0x5654('0x32')](_0x3d1e5b);}return null;};}function patchUpdates(_0x107d96){return function(_0x28e3f0){try{jsonpatch[_0x5654('0x33')](_0x28e3f0,_0x107d96,!![]);}catch(_0x1a0fbc){return BPromise[_0x5654('0x34')](_0x1a0fbc);}return _0x28e3f0['save']();};}function saveUpdates(_0x3e8156,_0x15afc2){return function(_0x21dc5a){if(_0x21dc5a){return _0x21dc5a['update'](_0x3e8156)[_0x5654('0x21')](function(_0x1dadeb){return _0x1dadeb;});}return null;};}function removeEntity(_0x18afcc,_0x3dee02){return function(_0x2f8d6a){if(_0x2f8d6a){return _0x2f8d6a['destroy']()[_0x5654('0x21')](function(){var _0x3ec453=_0x2f8d6a[_0x5654('0x35')]({'plain':!![]});var _0x276159=_0x5654('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x276159,'resourceId':_0x3ec453['id']}})[_0x5654('0x21')](function(){return _0x2f8d6a;});})['then'](function(){_0x18afcc[_0x5654('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4163cc,_0x1b5f75){return function(_0xb07ef7){if(!_0xb07ef7){_0x4163cc[_0x5654('0x2b')](0x194);}return _0xb07ef7;};}function handleError(_0x3d731b,_0x7a4a1a){_0x7a4a1a=_0x7a4a1a||0x1f4;return function(_0x507243){logger[_0x5654('0x27')](_0x507243[_0x5654('0x37')]);if(_0x507243[_0x5654('0x38')]){delete _0x507243[_0x5654('0x38')];}_0x3d731b[_0x5654('0x2c')](_0x7a4a1a)[_0x5654('0x39')](_0x507243);};}exports[_0x5654('0x3a')]=function(_0x1b86f2,_0xb320a){var _0x33c452={'include':[{'model':db[_0x5654('0x3b')],'as':_0x5654('0x3c')}]},_0x506c79={},_0x31eabf={'count':0x0,'rows':[]};var _0x42692d=_['map'](db[_0x5654('0x3d')]['rawAttributes'],function(_0x5db57){return{'name':_0x5db57[_0x5654('0x3e')],'type':_0x5db57[_0x5654('0x3f')][_0x5654('0x40')]};});_0x506c79[_0x5654('0x41')]=_[_0x5654('0x42')](_0x42692d,_0x5654('0x38'));_0x506c79['query']=_[_0x5654('0x43')](_0x1b86f2[_0x5654('0x44')]);_0x506c79[_0x5654('0x45')]=_[_0x5654('0x46')](_0x506c79[_0x5654('0x41')],_0x506c79[_0x5654('0x44')]);_0x33c452['attributes']=_['intersection'](_0x506c79[_0x5654('0x41')],qs[_0x5654('0x47')](_0x1b86f2['query']['fields']));_0x33c452[_0x5654('0x48')]=_0x33c452[_0x5654('0x48')][_0x5654('0x49')]?_0x33c452[_0x5654('0x48')]:_0x506c79[_0x5654('0x41')];if(!_0x1b86f2[_0x5654('0x44')][_0x5654('0x4a')](_0x5654('0x4b'))){_0x33c452[_0x5654('0x4c')]=qs[_0x5654('0x4c')](_0x1b86f2[_0x5654('0x44')][_0x5654('0x4c')]);_0x33c452[_0x5654('0x2e')]=qs['offset'](_0x1b86f2[_0x5654('0x44')][_0x5654('0x2e')]);}_0x33c452[_0x5654('0x4d')]=qs[_0x5654('0x4e')](_0x1b86f2['query'][_0x5654('0x4e')]);_0x33c452[_0x5654('0x4f')]=qs[_0x5654('0x45')](_[_0x5654('0x50')](_0x1b86f2['query'],_0x506c79[_0x5654('0x45')]),_0x42692d);if(_0x1b86f2[_0x5654('0x44')]['filter']){_0x33c452[_0x5654('0x4f')]=_['merge'](_0x33c452[_0x5654('0x4f')],{'$or':_[_0x5654('0x42')](_0x42692d,function(_0x19fd41){if(_0x19fd41[_0x5654('0x3f')]!==_0x5654('0x51')){var _0x25c6ef={};_0x25c6ef[_0x19fd41['name']]={'$like':'%'+_0x1b86f2[_0x5654('0x44')][_0x5654('0x52')]+'%'};return _0x25c6ef;}})});}_0x33c452=_['merge']({},_0x33c452,_0x1b86f2[_0x5654('0x53')]);var _0x560197={'where':_0x33c452[_0x5654('0x4f')]};return db[_0x5654('0x3d')]['count'](_0x560197)[_0x5654('0x21')](function(_0x11e93b){_0x31eabf[_0x5654('0x30')]=_0x11e93b;if(_0x1b86f2[_0x5654('0x44')][_0x5654('0x54')]){_0x33c452[_0x5654('0x55')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x33c452);})[_0x5654('0x21')](function(_0x449c93){_0x31eabf[_0x5654('0x56')]=_0x449c93;return _0x31eabf;})[_0x5654('0x21')](respondWithFilteredResult(_0xb320a,_0x33c452))[_0x5654('0x2a')](handleError(_0xb320a,null));};exports[_0x5654('0x57')]=function(_0x6490e5,_0x185e99){var _0x2f4a5e={'raw':![],'where':{'id':_0x6490e5[_0x5654('0x58')]['id']},'include':[{'model':db[_0x5654('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3f7026={};_0x3f7026[_0x5654('0x41')]=_['keys'](db[_0x5654('0x3d')][_0x5654('0x59')]);_0x3f7026[_0x5654('0x44')]=_[_0x5654('0x43')](_0x6490e5[_0x5654('0x44')]);_0x3f7026['filters']=_[_0x5654('0x46')](_0x3f7026['model'],_0x3f7026['query']);_0x2f4a5e[_0x5654('0x48')]=_[_0x5654('0x46')](_0x3f7026[_0x5654('0x41')],qs[_0x5654('0x47')](_0x6490e5['query'][_0x5654('0x47')]));_0x2f4a5e[_0x5654('0x48')]=_0x2f4a5e['attributes'][_0x5654('0x49')]?_0x2f4a5e[_0x5654('0x48')]:_0x3f7026[_0x5654('0x41')];if(_0x6490e5[_0x5654('0x44')][_0x5654('0x54')]){_0x2f4a5e[_0x5654('0x55')]=[{'all':!![]}];}_0x2f4a5e=_[_0x5654('0x5a')]({},_0x2f4a5e,_0x6490e5['options']);return db['SmsAccount'][_0x5654('0x5b')](_0x2f4a5e)[_0x5654('0x21')](handleEntityNotFound(_0x185e99,null))[_0x5654('0x21')](respondWithResult(_0x185e99,null))[_0x5654('0x2a')](handleError(_0x185e99,null));};exports[_0x5654('0x5c')]=function(_0x2fdcc1,_0x4412bb){return db['SmsAccount'][_0x5654('0x5c')](_0x2fdcc1[_0x5654('0x5d')],{})[_0x5654('0x21')](function(_0x137ba7){var _0x3e7686=_0x2fdcc1[_0x5654('0x5e')][_0x5654('0x35')]({'plain':!![]});if(!_0x3e7686)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e7686[_0x5654('0x5f')]===_0x5654('0x5e')){var _0x5a908d=_0x137ba7[_0x5654('0x35')]({'plain':!![]});var _0x32b9b3=_0x5654('0x36');return db[_0x5654('0x60')][_0x5654('0x5b')]({'where':{'name':_0x32b9b3,'userProfileId':_0x3e7686[_0x5654('0x61')]},'raw':!![]})[_0x5654('0x21')](function(_0x17a5f6){if(_0x17a5f6&&_0x17a5f6['autoAssociation']===0x0){return db[_0x5654('0x62')]['create']({'name':_0x5a908d[_0x5654('0x38')],'resourceId':_0x5a908d['id'],'type':_0x17a5f6['name'],'sectionId':_0x17a5f6['id']},{})[_0x5654('0x21')](function(){return _0x137ba7;});}else{return _0x137ba7;}})[_0x5654('0x2a')](function(_0x1d51ab){logger[_0x5654('0x27')](_0x5654('0x63'),_0x1d51ab);throw _0x1d51ab;});}return _0x137ba7;})[_0x5654('0x21')](respondWithResult(_0x4412bb,0xc9))[_0x5654('0x2a')](handleError(_0x4412bb,null));};exports[_0x5654('0x64')]=function(_0xbf0a94,_0x2ca676){if(_0xbf0a94['body']['id']){delete _0xbf0a94[_0x5654('0x5d')]['id'];}return db[_0x5654('0x3d')]['find']({'where':{'id':_0xbf0a94[_0x5654('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x5654('0x3c')}]})['then'](handleEntityNotFound(_0x2ca676,null))['then'](saveUpdates(_0xbf0a94[_0x5654('0x5d')],null))[_0x5654('0x21')](respondWithResult(_0x2ca676,null))[_0x5654('0x2a')](handleError(_0x2ca676,null));};exports['destroy']=function(_0x3f053b,_0x2adf7b){return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x3f053b['params']['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x2adf7b,null))[_0x5654('0x21')](removeEntity(_0x2adf7b,null))['catch'](handleError(_0x2adf7b,null));};exports['describe']=function(_0x53a343,_0x5d3b77){return db[_0x5654('0x3d')][_0x5654('0x65')]()[_0x5654('0x21')](respondWithResult(_0x5d3b77,null))['catch'](handleError(_0x5d3b77,null));};exports['addDisposition']=function(_0x159fab,_0x15cfaf,_0x508694){if(_0x159fab['body']['id']){delete _0x159fab[_0x5654('0x5d')]['id'];}return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x159fab[_0x5654('0x58')]['id']}})['then'](handleEntityNotFound(_0x15cfaf,null))[_0x5654('0x21')](function(_0x59c7c8){if(_0x59c7c8){_0x159fab[_0x5654('0x5d')][_0x5654('0x66')]=_0x59c7c8['id'];return db[_0x5654('0x67')][_0x5654('0x5c')](_0x159fab[_0x5654('0x5d')]);}})[_0x5654('0x21')](respondWithResult(_0x15cfaf,null))[_0x5654('0x2a')](handleError(_0x15cfaf,null));};exports[_0x5654('0x68')]=function(_0x41519e,_0x37e33b,_0xe2774c){var _0x453aae={'raw':![],'where':{}};var _0x55ea3c={};var _0x2dd1f1={'count':0x0,'rows':[]};return db[_0x5654('0x3d')][_0x5654('0x69')]({'where':{'id':_0x41519e[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x37e33b,null))[_0x5654('0x21')](function(_0x3bd18f){if(_0x3bd18f){_0x55ea3c[_0x5654('0x41')]=_[_0x5654('0x43')](db['Disposition'][_0x5654('0x59')]);_0x55ea3c[_0x5654('0x44')]=_[_0x5654('0x43')](_0x41519e['query']);_0x55ea3c[_0x5654('0x45')]=_[_0x5654('0x46')](_0x55ea3c[_0x5654('0x41')],_0x55ea3c[_0x5654('0x44')]);_0x453aae[_0x5654('0x48')]=_[_0x5654('0x46')](_0x55ea3c[_0x5654('0x41')],qs['fields'](_0x41519e[_0x5654('0x44')][_0x5654('0x47')]));_0x453aae['attributes']=_0x453aae[_0x5654('0x48')][_0x5654('0x49')]?_0x453aae['attributes']:_0x55ea3c['model'];if(!_0x41519e[_0x5654('0x44')]['hasOwnProperty'](_0x5654('0x4b'))){_0x453aae[_0x5654('0x4c')]=qs['limit'](_0x41519e[_0x5654('0x44')][_0x5654('0x4c')]);_0x453aae[_0x5654('0x2e')]=qs[_0x5654('0x2e')](_0x41519e[_0x5654('0x44')][_0x5654('0x2e')]);}_0x453aae['order']=qs[_0x5654('0x4e')](_0x41519e[_0x5654('0x44')][_0x5654('0x4e')]);_0x453aae[_0x5654('0x4f')]=qs[_0x5654('0x45')](_[_0x5654('0x50')](_0x41519e[_0x5654('0x44')],_0x55ea3c['filters']));_0x453aae[_0x5654('0x4f')][_0x5654('0x66')]=_0x3bd18f['id'];if(_0x41519e[_0x5654('0x44')][_0x5654('0x52')]){_0x453aae[_0x5654('0x4f')]=_[_0x5654('0x5a')](_0x453aae[_0x5654('0x4f')],{'$or':_['map'](_0x453aae['attributes'],function(_0x54c75d){var _0x58bec1={};_0x58bec1[_0x54c75d]={'$like':'%'+_0x41519e['query'][_0x5654('0x52')]+'%'};return _0x58bec1;})});}_0x453aae=_[_0x5654('0x5a')]({},_0x453aae,_0x41519e[_0x5654('0x53')]);return db[_0x5654('0x67')]['count']({'where':_0x453aae['where']})[_0x5654('0x21')](function(_0x345d74){_0x2dd1f1[_0x5654('0x30')]=_0x345d74;if(_0x41519e[_0x5654('0x44')][_0x5654('0x54')]){_0x453aae[_0x5654('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x5654('0x6a')](_0x453aae);})[_0x5654('0x21')](function(_0x17de82){_0x2dd1f1[_0x5654('0x56')]=_0x17de82;return _0x2dd1f1;});}})[_0x5654('0x21')](respondWithFilteredResult(_0x37e33b,_0x453aae))[_0x5654('0x2a')](handleError(_0x37e33b,null));};exports[_0x5654('0x6b')]=function(_0x53f72e,_0x189107,_0x5e9642){return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x53f72e[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x189107,null))[_0x5654('0x21')](function(_0x3be7f5){if(_0x3be7f5){return _0x3be7f5[_0x5654('0x6b')](_0x53f72e[_0x5654('0x44')][_0x5654('0x6c')]);}})['then'](respondWithStatusCode(_0x189107,null))[_0x5654('0x2a')](handleError(_0x189107,null));};exports['addAnswer']=function(_0x5e873d,_0x387d65,_0x270e3b){if(_0x5e873d[_0x5654('0x5d')]['id']){delete _0x5e873d[_0x5654('0x5d')]['id'];}return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x5e873d[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x387d65,null))[_0x5654('0x21')](function(_0xa7347b){if(_0xa7347b){_0x5e873d[_0x5654('0x5d')]['SmsAccountId']=_0xa7347b['id'];return db['CannedAnswer'][_0x5654('0x5c')](_0x5e873d[_0x5654('0x5d')]);}})[_0x5654('0x21')](respondWithResult(_0x387d65,null))[_0x5654('0x2a')](handleError(_0x387d65,null));};exports['getAnswers']=function(_0x3efd47,_0x41c3e0,_0x38896f){var _0x381a05={'raw':![],'where':{}};var _0x104cc3={};var _0x6b7551={'count':0x0,'rows':[]};return db[_0x5654('0x3d')][_0x5654('0x69')]({'where':{'id':_0x3efd47[_0x5654('0x58')]['id']}})['then'](handleEntityNotFound(_0x41c3e0,null))[_0x5654('0x21')](function(_0x1637ad){if(_0x1637ad){_0x104cc3[_0x5654('0x41')]=_[_0x5654('0x43')](db['CannedAnswer'][_0x5654('0x59')]);_0x104cc3[_0x5654('0x44')]=_[_0x5654('0x43')](_0x3efd47[_0x5654('0x44')]);_0x104cc3['filters']=_[_0x5654('0x46')](_0x104cc3[_0x5654('0x41')],_0x104cc3[_0x5654('0x44')]);_0x381a05[_0x5654('0x48')]=_[_0x5654('0x46')](_0x104cc3[_0x5654('0x41')],qs['fields'](_0x3efd47['query'][_0x5654('0x47')]));_0x381a05[_0x5654('0x48')]=_0x381a05[_0x5654('0x48')][_0x5654('0x49')]?_0x381a05[_0x5654('0x48')]:_0x104cc3['model'];if(!_0x3efd47[_0x5654('0x44')]['hasOwnProperty'](_0x5654('0x4b'))){_0x381a05[_0x5654('0x4c')]=qs[_0x5654('0x4c')](_0x3efd47[_0x5654('0x44')][_0x5654('0x4c')]);_0x381a05[_0x5654('0x2e')]=qs['offset'](_0x3efd47[_0x5654('0x44')][_0x5654('0x2e')]);}_0x381a05[_0x5654('0x4d')]=qs[_0x5654('0x4e')](_0x3efd47[_0x5654('0x44')][_0x5654('0x4e')]);_0x381a05[_0x5654('0x4f')]=qs[_0x5654('0x45')](_[_0x5654('0x50')](_0x3efd47[_0x5654('0x44')],_0x104cc3[_0x5654('0x45')]));_0x381a05[_0x5654('0x4f')][_0x5654('0x66')]=_0x1637ad['id'];if(_0x3efd47[_0x5654('0x44')][_0x5654('0x52')]){_0x381a05[_0x5654('0x4f')]=_[_0x5654('0x5a')](_0x381a05[_0x5654('0x4f')],{'$or':_[_0x5654('0x42')](_0x381a05[_0x5654('0x48')],function(_0x4cdf3e){var _0x576e72={};_0x576e72[_0x4cdf3e]={'$like':'%'+_0x3efd47[_0x5654('0x44')]['filter']+'%'};return _0x576e72;})});}_0x381a05=_[_0x5654('0x5a')]({},_0x381a05,_0x3efd47[_0x5654('0x53')]);return db[_0x5654('0x6d')][_0x5654('0x30')]({'where':_0x381a05['where']})['then'](function(_0x2118a8){_0x6b7551[_0x5654('0x30')]=_0x2118a8;if(_0x3efd47[_0x5654('0x44')]['includeAll']){_0x381a05['include']=[{'all':!![]}];}return db[_0x5654('0x6d')][_0x5654('0x6a')](_0x381a05);})['then'](function(_0x1fa799){_0x6b7551[_0x5654('0x56')]=_0x1fa799;return _0x6b7551;});}})[_0x5654('0x21')](respondWithFilteredResult(_0x41c3e0,_0x381a05))[_0x5654('0x2a')](handleError(_0x41c3e0,null));};exports[_0x5654('0x6e')]=function(_0xcf3e9c,_0x58d1bd,_0x1afca1){return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0xcf3e9c[_0x5654('0x58')]['id']}})['then'](handleEntityNotFound(_0x58d1bd,null))[_0x5654('0x21')](function(_0xd75f27){if(_0xd75f27){return _0xd75f27[_0x5654('0x6e')](_0xcf3e9c[_0x5654('0x44')][_0x5654('0x6c')]);}})[_0x5654('0x21')](respondWithStatusCode(_0x58d1bd,null))[_0x5654('0x2a')](handleError(_0x58d1bd,null));};exports['notify']=function(_0x18b487,_0x8570dd,_0x5c1e53){var _0x2422af={'channel':_0x5654('0x6f')};var _0xf1c001=[];var _0x5ec420=[];var _0x30a5a8={};return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x18b487[_0x5654('0x58')]['id']},'include':[{'model':db[_0x5654('0x70')],'as':'Applications'}]})[_0x5654('0x21')](handleEntityNotFound(_0x8570dd,null))[_0x5654('0x21')](function(_0x1081ea){_0x2422af['account']=_0x1081ea;_0x2422af['applications']=_[_0x5654('0x71')](_0x1081ea[_0x5654('0x72')],[_0x5654('0x73')],[_0x5654('0x74')]);if(_0x2422af[_0x5654('0x75')]['Applications']){delete _0x2422af[_0x5654('0x75')][_0x5654('0x72')];}return db[_0x5654('0x76')][_0x5654('0x65')]();})[_0x5654('0x21')](function(_0x254f6d){if(!_0x254f6d){throw new db[(_0x5654('0x77'))][(_0x5654('0x78'))]('no\x20available\x20attributes');}_0xf1c001=_[_0x5654('0x79')](_[_0x5654('0x43')](_0x254f6d),[_0x5654('0x7a'),'updatedAt']);_0x5ec420=_['difference'](_['keys'](_0x254f6d),['createdAt',_0x5654('0x7b'),_0x5654('0x7c'),'ListId']);_0x2422af[_0x5654('0x5d')]={'mapKey':_0x5654('0x7d')};if(_0x2422af[_0x5654('0x75')][_0x5654('0x3f')]){switch(_0x2422af[_0x5654('0x75')][_0x5654('0x3f')]){case _0x5654('0x7e'):_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x80')];_0x2422af[_0x5654('0x5d')][_0x5654('0x5d')]=_0x18b487['body'][_0x5654('0x81')];_0x2422af[_0x5654('0x5d')][_0x5654('0x82')]=_0x18b487['body']['MessageSid'];break;case _0x5654('0x83'):_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]='+'+_0x18b487[_0x5654('0x5d')][_0x5654('0x84')];_0x2422af['body'][_0x5654('0x5d')]=_0x18b487[_0x5654('0x5d')]['text'];break;case'connectel':_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x7f')];_0x2422af[_0x5654('0x5d')][_0x5654('0x5d')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x29')];break;case _0x5654('0x85'):_0x2422af['body'][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')]['from'];_0x2422af['body'][_0x5654('0x5d')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x5d')];_0x2422af[_0x5654('0x5d')][_0x5654('0x82')]=_0x18b487[_0x5654('0x5d')]['message_id'];break;case _0x5654('0x86'):_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x80')];_0x2422af['body'][_0x5654('0x5d')]=_0x18b487[_0x5654('0x5d')]['Text'];_0x2422af[_0x5654('0x5d')][_0x5654('0x82')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x87')];break;case _0x5654('0x88'):_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]='+'+_0x18b487['body'][_0x5654('0x89')][0x0][_0x5654('0x7f')];_0x2422af['body'][_0x5654('0x5d')]=_0x18b487[_0x5654('0x5d')]['results'][0x0][_0x5654('0x8a')];_0x2422af['body'][_0x5654('0x82')]=_0x18b487[_0x5654('0x5d')]['results'][0x0][_0x5654('0x82')];break;case _0x5654('0x8b'):_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x8c')];_0x2422af[_0x5654('0x5d')][_0x5654('0x5d')]=_0x18b487['body'][_0x5654('0x8d')]['message'];break;case'clickatell':_0x2422af['body'][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')]['fromNumber'];_0x2422af['body'][_0x5654('0x5d')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x8a')];_0x2422af[_0x5654('0x5d')]['messageId']=_0x18b487[_0x5654('0x5d')][_0x5654('0x8e')];break;case _0x5654('0x8f'):_0x2422af[_0x5654('0x5d')]['messageId']=_0x18b487[_0x5654('0x5d')][0x0][_0x5654('0x29')]['id'];_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]=_0x18b487[_0x5654('0x5d')][0x0][_0x5654('0x29')][_0x5654('0x7f')];_0x2422af['body']['body']=_0x18b487[_0x5654('0x5d')][0x0][_0x5654('0x29')][_0x5654('0x8a')];break;case _0x5654('0x90'):_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')]=_0x18b487['body'][_0x5654('0x7f')];_0x2422af['body'][_0x5654('0x5d')]=_0x18b487['body'][_0x5654('0x29')];_0x2422af[_0x5654('0x5d')][_0x5654('0x82')]=_0x18b487[_0x5654('0x5d')][_0x5654('0x91')];break;}}if(_0x2422af[_0x5654('0x5d')]['id']){delete _0x2422af[_0x5654('0x5d')]['id'];}if(_[_0x5654('0x92')](_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')])){throw new db[(_0x5654('0x77'))][(_0x5654('0x78'))](_0x5654('0x93'));}if(_[_0x5654('0x92')](_0x2422af[_0x5654('0x5d')][_0x5654('0x5d')])||_0x2422af[_0x5654('0x5d')][_0x5654('0x5d')]===''){throw new db[(_0x5654('0x77'))][(_0x5654('0x78'))](_0x5654('0x94'));}if(_[_0x5654('0x92')](_0x2422af[_0x5654('0x5d')][_0x5654('0x95')])){throw new db[(_0x5654('0x77'))][(_0x5654('0x78'))](_0x5654('0x96')+_0x5ec420);}if(!_['includes'](_0x5ec420,_0x2422af[_0x5654('0x5d')][_0x5654('0x95')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ec420);}_0x30a5a8[_0x2422af[_0x5654('0x5d')][_0x5654('0x95')]]=_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')];return db[_0x5654('0x97')][_0x5654('0x5b')]({'where':{'id':_0x2422af[_0x5654('0x75')][_0x5654('0x98')]},'include':[{'model':db['CmContact'],'as':_0x5654('0x99'),'where':_0x30a5a8,'limit':0x1,'order':[[_0x5654('0x7b'),_0x5654('0x9a')]]}]});})[_0x5654('0x21')](handleEntityNotFound(_0x8570dd,null))[_0x5654('0x21')](function(_0x1ceabc){if(_0x1ceabc){_0x2422af[_0x5654('0x9b')]=_[_0x5654('0x9c')](_0x1ceabc,[_0x5654('0x99')]);if(_0x1ceabc[_0x5654('0x99')][_0x5654('0x49')]){return _0x1ceabc['Contacts'][0x0];}var _0xc9dce6=_[_0x5654('0x18')](_0x2422af['body'],{'firstName':_0x2422af[_0x5654('0x5d')]['from'],'ListId':_0x1ceabc['id']});_0xc9dce6[_0x2422af['body']['mapKey']]=_0x2422af[_0x5654('0x5d')]['from'];return db[_0x5654('0x76')][_0x5654('0x5c')](_0xc9dce6,{'fields':_0xf1c001,'raw':!![]});}})[_0x5654('0x21')](handleEntityNotFound(_0x8570dd,null))[_0x5654('0x21')](function(_0x22c9ce){if(_0x22c9ce){_0x2422af['contact']=_0x22c9ce;var _0x390baf={'ContactId':_0x22c9ce['id'],'phone':_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')],'SmsAccountId':_0x18b487[_0x5654('0x58')]['id']};var _0x21bee5={'ContactId':_0x22c9ce['id'],'SmsAccountId':_0x18b487['params']['id'],'closed':![]};return db[_0x5654('0x9d')]['find']({'where':_0x21bee5})[_0x5654('0x21')](function(_0x5edab5){if(_0x5edab5){return[_0x5edab5,![]];}return db['SmsInteraction'][_0x5654('0x5c')](_0x390baf)[_0x5654('0x21')](function(_0x11ab23){return[_0x11ab23,!![]];});});}})[_0x5654('0x9e')](function(_0x35af02,_0x4c698a){_0x2422af[_0x5654('0x9f')]=_0x35af02['get']({'plain':!![]});_0x2422af['interaction'][_0x5654('0xa0')]=![];if(_0x4c698a){if(_0x2422af[_0x5654('0x75')][_0x5654('0xa1')]){_0x2422af[_0x5654('0xa2')][_0x5654('0xa3')]({'id':0x0,'priority':_0x2422af[_0x5654('0xa2')][_0x5654('0x49')]+0x1,'app':_0x5654('0xa4'),'appdata':_0x5654('0xa5'),'interval':'*,*,*,*'});}_0x2422af['interaction'][_0x5654('0xa0')]=!![];}return db[_0x5654('0xa6')]['create']({'phone':_0x2422af[_0x5654('0x5d')][_0x5654('0x7f')],'messageId':_0x2422af['body'][_0x5654('0x82')],'body':_0x2422af[_0x5654('0x5d')][_0x5654('0x5d')],'SmsAccountId':_0x18b487[_0x5654('0x58')]['id'],'SmsInteractionId':_0x35af02['id'],'direction':'in','ContactId':_0x35af02[_0x5654('0xa7')],'AttachmentId':_0x2422af[_0x5654('0x5d')][_0x5654('0xa8')]});})[_0x5654('0x21')](function(_0x2c8fbc){_0x2422af[_0x5654('0x29')]=_0x2c8fbc;if(_0x2422af['interaction'][_0x5654('0xa9')]){return db['User'][_0x5654('0x5b')]({'attributes':['id',_0x5654('0x38')],'where':{'id':_0x2422af[_0x5654('0x9f')][_0x5654('0xa9')]}})[_0x5654('0x21')](function(_0x44f6a6){if(_0x44f6a6){_0x2422af[_0x5654('0xa2')][_0x5654('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x44f6a6[_0x5654('0x38')]+','+(_0x2422af[_0x5654('0x75')][_0x5654('0xab')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5654('0xac'),_0x5654('0xad'),_0x2422af);});}return respondWithRpcPromise(_0x5654('0xac'),'startRouting',_0x2422af);})[_0x5654('0x21')](function(_0x2a853e){if(_0x2a853e){var _0x5103f8=0xc8;var _0x4f05c6=_0x5654('0xae');logger['info'](_0x5654('0xaf'),_0x4f05c6,_0x5103f8,_0x5654('0xb0'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4f05c6,_0x5103f8,_0x5654('0xb0'),JSON[_0x5654('0x26')](_0x2a853e));if(_0x2422af[_0x5654('0x75')]['type']===_0x5654('0x7e')){return _0x8570dd[_0x5654('0x2c')](_0x5103f8)[_0x5654('0xb1')]('Content-Type',_0x5654('0xb2'))[_0x5654('0x39')]('\x0a');}else{return _0x8570dd[_0x5654('0x2c')](_0x5103f8)[_0x5654('0x32')](_0x2a853e);}}})[_0x5654('0x2a')](handleError(_0x8570dd,null));};exports[_0x5654('0xb3')]=function(_0x481cb1,_0x9d46e9){var _0x128abe=_0x481cb1[_0x5654('0x58')]['id'];var _0x4ce5be=_0x481cb1[_0x5654('0x5d')];var _0x5d565a=0xc8;var _0x2e84e6=null;return db[_0x5654('0xb4')][_0x5654('0xb5')]({'isolationLevel':db[_0x5654('0xb4')]['Transaction'][_0x5654('0xb6')][_0x5654('0xb7')]},function(_0x26f299){return db[_0x5654('0x3d')][_0x5654('0x69')]({'where':{'id':_0x128abe},'transaction':_0x26f299})[_0x5654('0x21')](function(_0x3a2dbb){if(_0x3a2dbb){return db[_0x5654('0x70')][_0x5654('0xb8')]({'where':{'SmsAccountId':_0x128abe},'transaction':_0x26f299})['then'](function(){var _0x39262d=_[_0x5654('0x42')](_0x4ce5be,function(_0x5e7d0a){_0x5e7d0a[_0x5654('0x66')]=_0x128abe;return _0x5e7d0a;});return db['SmsApplication']['bulkCreate'](_0x39262d,{'transaction':_0x26f299});});}else{_0x5d565a=0x194;_0x2e84e6=[];}});})[_0x5654('0x21')](function(){if(_0x5d565a!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x128abe},'order':'priority'})[_0x5654('0x21')](function(_0x2c5e4e){_0x2e84e6=_0x2c5e4e;});}})['catch'](function(_0x438679){_0x5d565a=0x1f4;logger[_0x5654('0x27')](_0x438679[_0x5654('0x37')]);if(_0x438679[_0x5654('0x38')]){delete _0x438679['name'];}_0x2e84e6=_0x438679;})[_0x5654('0xb9')](function(){if(_0x2e84e6===null){_0x9d46e9[_0x5654('0x2b')](_0x5d565a);}else{if(_0x5d565a===0x1f4){_0x9d46e9[_0x5654('0x2c')](_0x5d565a)[_0x5654('0x39')](_0x2e84e6);}else{_0x9d46e9[_0x5654('0x2c')](_0x5d565a)[_0x5654('0x32')](_0x2e84e6);}}});};exports['getApplications']=function(_0x5be350,_0x3c3841,_0x5996f6){var _0x2c8829={};var _0x43dfe3={};var _0x3e8a4c;var _0x3eabf9;return db['SmsAccount'][_0x5654('0x69')]({'where':{'id':_0x5be350[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x3c3841,null))[_0x5654('0x21')](function(_0x599be1){if(_0x599be1){_0x3e8a4c=_0x599be1;_0x43dfe3['model']=_[_0x5654('0x43')](db[_0x5654('0x70')]['rawAttributes']);_0x43dfe3[_0x5654('0x44')]=_[_0x5654('0x43')](_0x5be350[_0x5654('0x44')]);_0x43dfe3[_0x5654('0x45')]=_['intersection'](_0x43dfe3[_0x5654('0x41')],_0x43dfe3[_0x5654('0x44')]);_0x2c8829[_0x5654('0x48')]=_[_0x5654('0x46')](_0x43dfe3[_0x5654('0x41')],qs['fields'](_0x5be350['query'][_0x5654('0x47')]));_0x2c8829[_0x5654('0x48')]=_0x2c8829['attributes'][_0x5654('0x49')]?_0x2c8829[_0x5654('0x48')]:_0x43dfe3['model'];_0x2c8829[_0x5654('0x4d')]=qs[_0x5654('0x4e')](_0x5be350['query'][_0x5654('0x4e')]);_0x2c8829[_0x5654('0x4f')]=qs[_0x5654('0x45')](_[_0x5654('0x50')](_0x5be350[_0x5654('0x44')],_0x43dfe3['filters']));if(_0x5be350[_0x5654('0x44')]['filter']){_0x2c8829['where']=_[_0x5654('0x5a')](_0x2c8829[_0x5654('0x4f')],{'$or':_[_0x5654('0x42')](_0x2c8829[_0x5654('0x48')],function(_0x178a34){var _0x3fd7a2={};_0x3fd7a2[_0x178a34]={'$like':'%'+_0x5be350[_0x5654('0x44')]['filter']+'%'};return _0x3fd7a2;})});}_0x2c8829=_[_0x5654('0x5a')]({},_0x2c8829,_0x5be350[_0x5654('0x53')]);return _0x3e8a4c['getApplications'](_0x2c8829);}})[_0x5654('0x21')](function(_0x2cea99){if(_0x2cea99){_0x3eabf9=_0x2cea99[_0x5654('0x49')];if(!_0x5be350[_0x5654('0x44')][_0x5654('0x4a')](_0x5654('0x4b'))){_0x2c8829[_0x5654('0x4c')]=qs[_0x5654('0x4c')](_0x5be350[_0x5654('0x44')][_0x5654('0x4c')]);_0x2c8829[_0x5654('0x2e')]=qs[_0x5654('0x2e')](_0x5be350['query'][_0x5654('0x2e')]);}return _0x3e8a4c[_0x5654('0xba')](_0x2c8829);}})['then'](function(_0x48efbb){if(_0x48efbb){return _0x48efbb?{'count':_0x3eabf9,'rows':_0x48efbb}:null;}})[_0x5654('0x21')](respondWithResult(_0x3c3841,null))[_0x5654('0x2a')](handleError(_0x3c3841,null));};exports[_0x5654('0xbb')]=function(_0x54f672,_0x22caca,_0x13cebe){var _0x224fee={'raw':![],'where':{}};var _0x1a5ef3={};var _0x2ebefd={'count':0x0,'rows':[]};return db[_0x5654('0x3d')][_0x5654('0x69')]({'where':{'id':_0x54f672[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x22caca,null))['then'](function(_0x52b773){if(_0x52b773){_0x1a5ef3[_0x5654('0x41')]=_[_0x5654('0x43')](db['SmsInteraction'][_0x5654('0x59')]);_0x1a5ef3[_0x5654('0x44')]=_[_0x5654('0x43')](_0x54f672[_0x5654('0x44')]);_0x1a5ef3[_0x5654('0x45')]=_['intersection'](_0x1a5ef3['model'],_0x1a5ef3[_0x5654('0x44')]);_0x224fee[_0x5654('0x48')]=_[_0x5654('0x46')](_0x1a5ef3['model'],qs['fields'](_0x54f672[_0x5654('0x44')][_0x5654('0x47')]));_0x224fee['attributes']=_0x224fee[_0x5654('0x48')][_0x5654('0x49')]?_0x224fee[_0x5654('0x48')]:_0x1a5ef3['model'];if(!_0x54f672[_0x5654('0x44')][_0x5654('0x4a')](_0x5654('0x4b'))){_0x224fee[_0x5654('0x4c')]=qs[_0x5654('0x4c')](_0x54f672[_0x5654('0x44')][_0x5654('0x4c')]);_0x224fee[_0x5654('0x2e')]=qs['offset'](_0x54f672[_0x5654('0x44')][_0x5654('0x2e')]);}_0x224fee['order']=qs[_0x5654('0x4e')](_0x54f672['query']['sort']);_0x224fee[_0x5654('0x4f')]=qs[_0x5654('0x45')](_['pick'](_0x54f672[_0x5654('0x44')],_0x1a5ef3['filters']));_0x224fee['where'][_0x5654('0x66')]=_0x52b773['id'];if(_0x54f672[_0x5654('0x44')]['filter']){_0x224fee[_0x5654('0x4f')]=_[_0x5654('0x5a')](_0x224fee['where'],{'$or':_[_0x5654('0x42')](_0x224fee[_0x5654('0x48')],function(_0x242c36){var _0x492f8e={};_0x492f8e[_0x242c36]={'$like':'%'+_0x54f672['query'][_0x5654('0x52')]+'%'};return _0x492f8e;})});}_0x224fee=_[_0x5654('0x5a')]({},_0x224fee,_0x54f672[_0x5654('0x53')]);return db[_0x5654('0x9d')][_0x5654('0x30')]({'where':_0x224fee[_0x5654('0x4f')]})[_0x5654('0x21')](function(_0x4bcfc3){_0x2ebefd['count']=_0x4bcfc3;if(_0x54f672[_0x5654('0x44')][_0x5654('0x54')]){_0x224fee[_0x5654('0x55')]=[{'model':db[_0x5654('0x76')],'as':_0x5654('0xbc'),'required':![]},{'model':db[_0x5654('0xbd')],'as':'Owner','attributes':[_0x5654('0x38'),_0x5654('0xbe'),_0x5654('0xbf')],'required':![]},{'model':db[_0x5654('0xc0')],'as':_0x5654('0xc1'),'attributes':['id',_0x5654('0x38'),'color'],'where':_0x54f672[_0x5654('0x44')]['tag']?{'id':_0x54f672[_0x5654('0x44')][_0x5654('0xc2')]}:undefined,'required':_0x54f672['query']['tag']?!![]:![]}];}return db['SmsInteraction'][_0x5654('0x6a')](_0x224fee);})['then'](function(_0x26d1e2){_0x2ebefd[_0x5654('0x56')]=_0x26d1e2;return _0x2ebefd;});}})[_0x5654('0x21')](respondWithFilteredResult(_0x22caca,_0x224fee))[_0x5654('0x2a')](handleError(_0x22caca,null));};exports['send']=function(_0x219ba4,_0x5b3d7b,_0x50f9b1){var _0x16a5b8,_0x41d645,_0x181607;if(_[_0x5654('0x92')](_0x219ba4[_0x5654('0x5d')][_0x5654('0x5d')])||_0x219ba4[_0x5654('0x5d')][_0x5654('0x5d')]===''){throw new db[(_0x5654('0x77'))][(_0x5654('0x78'))](_0x5654('0x94'));}if(_['isNil'](_0x219ba4[_0x5654('0x5d')]['to'])){throw new db[(_0x5654('0x77'))][(_0x5654('0x78'))](_0x5654('0xc3'));}_0x16a5b8=_0x219ba4['body']['to'];return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x219ba4[_0x5654('0x58')]['id']},'include':[{'model':db[_0x5654('0x97')],'as':_0x5654('0xc4'),'include':[{'model':db[_0x5654('0x76')],'as':_0x5654('0x99'),'where':{'mobile':_0x16a5b8},'limit':0x1,'order':[[_0x5654('0x7b'),_0x5654('0x9a')]]}]}]})[_0x5654('0x21')](handleEntityNotFound(_0x5b3d7b,null))[_0x5654('0x21')](function(_0x402d0d){if(_0x402d0d&&_0x402d0d[_0x5654('0xc4')]){_0x41d645=_0x402d0d[_0x5654('0x35')]({'plain':!![]});if(_0x41d645[_0x5654('0xc4')]&&_0x41d645[_0x5654('0xc4')][_0x5654('0x99')][_0x5654('0x49')]){return _0x41d645[_0x5654('0xc4')][_0x5654('0x99')][0x0];}return db[_0x5654('0x76')][_0x5654('0x5c')](_[_0x5654('0x18')](_0x219ba4[_0x5654('0x5d')],{'firstName':_0x16a5b8,'mobile':_0x16a5b8,'phone':_0x16a5b8,'ListId':_0x41d645[_0x5654('0x98')]}));}})[_0x5654('0x21')](handleEntityNotFound(_0x5b3d7b,null))['then'](function(_0x7be219){if(_0x7be219){_0x181607=_0x7be219;return db[_0x5654('0x9d')]['find']({'where':{'ContactId':_0x181607['id'],'closed':![],'SmsAccountId':_0x41d645['id']}})['then'](function(_0x2e47e5){if(_0x2e47e5){return[_0x2e47e5,![]];}return db['SmsInteraction'][_0x5654('0x5c')]({'UserId':_0x219ba4[_0x5654('0x5e')]['id'],'ContactId':_0x181607['id'],'SmsAccountId':_0x41d645['id'],'phone':_0x16a5b8,'firstMsgDirection':'out','Messages':[_[_0x5654('0x5a')](_0x219ba4[_0x5654('0x5d')],{'read':![],'body':_0x219ba4[_0x5654('0x5d')][_0x5654('0x5d')],'phone':_0x16a5b8,'SmsAccountId':_0x41d645['id'],'UserId':_0x219ba4['user']['id'],'ContactId':_0x181607['id']})]},{'include':[{'model':db[_0x5654('0xa6')],'as':_0x5654('0xc5')}]})[_0x5654('0x21')](function(_0x3aa791){return[_0x3aa791,!![]];});});}})[_0x5654('0x9e')](function(_0x504a42,_0x40931b){if(_0x40931b){return _0x504a42;}return db[_0x5654('0xa6')]['create'](_['merge'](_0x219ba4[_0x5654('0x5d')],{'read':![],'body':_0x219ba4[_0x5654('0x5d')]['body'],'phone':_0x16a5b8,'SmsAccountId':_0x41d645['id'],'SmsInteractionId':_0x504a42['id'],'UserId':_0x219ba4[_0x5654('0x5e')]['id'],'ContactId':_0x181607['id']}))[_0x5654('0x21')](function(_0x2a89c2){_0x504a42[_0x5654('0xc6')][_0x5654('0xc5')]=[];_0x504a42['dataValues'][_0x5654('0xc5')][_0x5654('0xa3')](_0x2a89c2['dataValues']);return _0x504a42;});})[_0x5654('0x21')](respondWithResult(_0x5b3d7b,null))['catch'](handleError(_0x5b3d7b,null));};exports[_0x5654('0x2c')]=function(_0x42d453,_0x18bc57,_0x166df8){if(_0x42d453[_0x5654('0x5d')]['id']){delete _0x42d453[_0x5654('0x5d')]['id'];}var _0x590af1,_0x5d70d7,_0x2cbdfd;return db[_0x5654('0x3d')]['find']({'where':{'id':_0x42d453['params']['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x18bc57,null))[_0x5654('0x21')](function(_0x659aa6){if(_0x659aa6){_0x2cbdfd=_0x659aa6;logger[_0x5654('0x25')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0xc7'),_0x659aa6['type'],util[_0x5654('0xc8')](_0x42d453['body'],{'showHidden':![],'depth':null}));switch(_0x659aa6['type']){case _0x5654('0x83'):if(_0x42d453['body'][_0x5654('0xc9')]&&_0x42d453[_0x5654('0x5d')][_0x5654('0x2c')]){_0x5d70d7=_0x42d453[_0x5654('0x5d')][_0x5654('0x2c')];return db['SmsMessage'][_0x5654('0x5b')]({'where':{'messageId':_0x42d453[_0x5654('0x5d')][_0x5654('0xc9')]}});}break;case _0x5654('0xca'):if(_0x42d453['body']['requestid']&&_0x42d453[_0x5654('0x5d')]['statusInt']){_0x5d70d7=_0x42d453[_0x5654('0x5d')][_0x5654('0xcb')];return db[_0x5654('0xa6')]['find']({'where':{'messageId':_0x42d453[_0x5654('0x5d')][_0x5654('0xcc')]}});}break;case _0x5654('0x85'):if(_0x42d453[_0x5654('0x5d')][_0x5654('0xcd')]&&_0x42d453[_0x5654('0x5d')][_0x5654('0xce')]){_0x5d70d7=_0x42d453[_0x5654('0x5d')]['status_code'];return db[_0x5654('0xa6')][_0x5654('0x5b')]({'where':{'messageId':_0x42d453[_0x5654('0x5d')]['message_id']}});}break;case _0x5654('0x88'):var _0x40ea84=_0x42d453[_0x5654('0x5d')][_0x5654('0x89')][0x0];if(_0x40ea84['messageId']&&_0x40ea84[_0x5654('0x2c')]['groupName']==='DELIVERED'){_0x5d70d7=_0x40ea84[_0x5654('0x2c')][_0x5654('0xcf')];return db[_0x5654('0xa6')][_0x5654('0x5b')]({'where':{'messageId':_0x40ea84[_0x5654('0x82')]}});}break;case _0x5654('0xd0'):if(_0x42d453[_0x5654('0x5d')]['messageId']&&_0x42d453[_0x5654('0x5d')][_0x5654('0x2c')]){_0x5d70d7=_0x42d453[_0x5654('0x5d')][_0x5654('0x2c')];return db[_0x5654('0xa6')][_0x5654('0x5b')]({'where':{'messageId':_0x42d453[_0x5654('0x5d')][_0x5654('0x82')]}});}break;case _0x5654('0x8f'):if(_0x42d453['body'][0x0][_0x5654('0x29')]['id']){_0x5d70d7=_0x42d453[_0x5654('0x5d')][0x0][_0x5654('0x3f')];return db[_0x5654('0xa6')][_0x5654('0x5b')]({'where':{'messageId':_0x42d453[_0x5654('0x5d')][0x0][_0x5654('0x29')]['id']}});}break;case _0x5654('0x90'):if(_0x42d453[_0x5654('0x5d')]['redif']&&_0x42d453[_0x5654('0x5d')][_0x5654('0x2c')]){_0x5d70d7=_0x42d453[_0x5654('0x5d')]['status'];return db[_0x5654('0xa6')]['find']({'where':{'messageId':_0x42d453[_0x5654('0x5d')]['redif']}});}break;}}})[_0x5654('0x21')](handleEntityNotFound(_0x18bc57,null))[_0x5654('0x21')](function(_0x57cf12){if(_0x57cf12){_0x590af1=_0x57cf12;switch(_0x2cbdfd['type']){case _0x5654('0x83'):if(_0x5d70d7===_0x5654('0xd1')){return _0x590af1[_0x5654('0x64')]({'read':!![]});}else{logger[_0x5654('0x27')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0x83'),util[_0x5654('0xc8')](_0x42d453['body'],{'showHidden':![],'depth':null}));}break;case _0x5654('0xca'):if(_0x5d70d7==='1'){return _0x590af1['update']({'read':!![]});}else{logger[_0x5654('0x27')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0x83'),util['inspect'](_0x42d453[_0x5654('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5654('0x85'):if(!_0x42d453[_0x5654('0x5d')][_0x5654('0xd2')]&&_0x5d70d7>=0xc8&&_0x5d70d7<=0xce){return _0x590af1[_0x5654('0x64')]({'read':!![]});}else{logger[_0x5654('0x27')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0x85'),util[_0x5654('0xc8')](_0x42d453['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x37aa4c=_0x42d453[_0x5654('0x5d')]['results'][0x0];if(_0x37aa4c[_0x5654('0x2c')][_0x5654('0xcf')]===_0x5654('0xd1')){return _0x590af1['update']({'read':!![]});}else{logger['error'](_0x5654('0xaf'),'status',_0x5654('0x88'),util[_0x5654('0xc8')](_0x42d453['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x5d70d7=='DELIVERED_TO_GATEWAY'||_0x5d70d7=='RECEIVED_BY_RECIPIENT'){return _0x590af1['update']({'read':!![]});}else{logger[_0x5654('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5654('0xd0'),util[_0x5654('0xc8')](_0x42d453[_0x5654('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5654('0x8f'):if(_0x5d70d7==_0x5654('0xd3')){return _0x590af1[_0x5654('0x64')]({'read':!![]});}else{logger[_0x5654('0x27')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0x8f'),util[_0x5654('0xc8')](_0x42d453['body'],{'showHidden':![],'depth':null}));}break;case _0x5654('0x90'):if(_0x5d70d7===_0x5654('0xd4')||_0x5d70d7===_0x5654('0xd5')){return _0x590af1[_0x5654('0x64')]({'read':!![]});}else{logger[_0x5654('0x27')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0x90'),util['inspect'](_0x42d453[_0x5654('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x590af1;}})[_0x5654('0x21')](respondWithResult(_0x18bc57,null))[_0x5654('0x2a')](handleError(_0x18bc57,null));};exports[_0x5654('0xd6')]=function(_0xea428d,_0x29e50e,_0x1c845f){var _0xc3d558,_0x53790c,_0x56c7b0;return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0xea428d[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x29e50e,null))[_0x5654('0x21')](function(_0x35ed2b){if(_0x35ed2b){_0x56c7b0=_0x35ed2b;logger[_0x5654('0x25')](_0x5654('0xaf'),_0x5654('0x2c'),_0x5654('0xc7'),_0x35ed2b['type'],util[_0x5654('0xc8')](_0xea428d[_0x5654('0x44')],{'showHidden':![],'depth':null}));switch(_0x35ed2b[_0x5654('0x3f')]){case _0x5654('0x8b'):if(_0xea428d[_0x5654('0x44')][_0x5654('0xd7')]&&_0xea428d['query'][_0x5654('0xd8')]){_0x53790c=_0xea428d['query'][_0x5654('0xd8')];return db[_0x5654('0xa6')]['find']({'where':{'messageId':_0xea428d[_0x5654('0x44')][_0x5654('0xd7')]}});}break;}}})[_0x5654('0x21')](handleEntityNotFound(_0x29e50e,null))['then'](function(_0x80822e){if(_0x80822e){_0xc3d558=_0x80822e;switch(_0x56c7b0[_0x5654('0x3f')]){case _0x5654('0x8b'):if(_0x53790c==='2'||_0x53790c==='6'){return _0xc3d558[_0x5654('0x64')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5654('0x2c'),_0x5654('0x8b'),util[_0x5654('0xc8')](_0xea428d[_0x5654('0x44')],{'showHidden':![],'depth':null}));};break;}return _0xc3d558;}})[_0x5654('0x21')](respondWithResult(_0x29e50e,null))[_0x5654('0x2a')](handleError(_0x29e50e,null));};exports[_0x5654('0xd9')]=function(_0x3eab0a,_0x1d677a,_0x66cf1f){return db['SmsAccount']['find']({'where':{'id':_0x3eab0a[_0x5654('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d677a,null))[_0x5654('0x21')](function(_0x35b8e0){if(_0x35b8e0){return _0x35b8e0['addAgents'](_0x3eab0a['body']['ids'],_[_0x5654('0x9c')](_0x3eab0a[_0x5654('0x5d')],[_0x5654('0x6c'),'id'])||{})['spread'](function(_0x1105c5){for(var _0x5f55a4=0x0;_0x5f55a4<_0x3eab0a[_0x5654('0x5d')][_0x5654('0x6c')]['length'];_0x5f55a4+=0x1){socket[_0x5654('0xda')](_0x5654('0xdb'),{'UserId':Number(_0x3eab0a[_0x5654('0x5d')][_0x5654('0x6c')][_0x5f55a4]),'SmsAccountId':Number(_0x3eab0a[_0x5654('0x58')]['id'])});}return _0x1105c5;});}})[_0x5654('0x21')](respondWithResult(_0x1d677a,null))['catch'](handleError(_0x1d677a,null));};exports[_0x5654('0xdc')]=function(_0x2ff2c,_0x2c4875,_0x16d35b){return db[_0x5654('0x3d')][_0x5654('0x5b')]({'where':{'id':_0x2ff2c[_0x5654('0x58')]['id']}})[_0x5654('0x21')](handleEntityNotFound(_0x2c4875,null))[_0x5654('0x21')](function(_0x572b29){if(_0x572b29){return _0x572b29[_0x5654('0xdc')](_0x2ff2c['query'][_0x5654('0x6c')])[_0x5654('0x21')](function(){if(_['isArray'](_0x2ff2c[_0x5654('0x44')][_0x5654('0x6c')])){for(var _0x218da7=0x0;_0x218da7<_0x2ff2c[_0x5654('0x44')]['ids'][_0x5654('0x49')];_0x218da7+=0x1){socket[_0x5654('0xda')](_0x5654('0xdd'),{'UserId':Number(_0x2ff2c[_0x5654('0x44')]['ids'][_0x218da7]),'SmsAccountId':Number(_0x2ff2c[_0x5654('0x58')]['id'])});}}else{socket[_0x5654('0xda')](_0x5654('0xdd'),{'UserId':Number(_0x2ff2c[_0x5654('0x44')][_0x5654('0x6c')]),'SmsAccountId':Number(_0x2ff2c['params']['id'])});}});}})[_0x5654('0x21')](respondWithStatusCode(_0x2c4875,null))['catch'](handleError(_0x2c4875,null));};exports[_0x5654('0xde')]=function(_0x4c91cc,_0xb17844,_0x17b568){var _0x34fadd={};var _0x475037={};var _0x479023;var _0x5a0b98;return db['SmsAccount']['findOne']({'where':{'id':_0x4c91cc['params']['id']}})[_0x5654('0x21')](handleEntityNotFound(_0xb17844,null))[_0x5654('0x21')](function(_0x2780fd){if(_0x2780fd){_0x479023=_0x2780fd;_0x475037[_0x5654('0x41')]=_[_0x5654('0x43')](db[_0x5654('0xbd')]['rawAttributes']);_0x475037[_0x5654('0x44')]=_[_0x5654('0x43')](_0x4c91cc[_0x5654('0x44')]);_0x475037[_0x5654('0x45')]=_[_0x5654('0x46')](_0x475037[_0x5654('0x41')],_0x475037[_0x5654('0x44')]);_0x34fadd[_0x5654('0x48')]=_[_0x5654('0x46')](_0x475037[_0x5654('0x41')],qs['fields'](_0x4c91cc['query'][_0x5654('0x47')]));_0x34fadd[_0x5654('0x48')]=_0x34fadd['attributes'][_0x5654('0x49')]?_0x34fadd[_0x5654('0x48')]:_0x475037['model'];_0x34fadd[_0x5654('0x4d')]=qs[_0x5654('0x4e')](_0x4c91cc['query']['sort']);_0x34fadd['where']=qs[_0x5654('0x45')](_[_0x5654('0x50')](_0x4c91cc[_0x5654('0x44')],_0x475037[_0x5654('0x45')]));if(_0x4c91cc[_0x5654('0x44')][_0x5654('0x52')]){_0x34fadd[_0x5654('0x4f')]=_['merge'](_0x34fadd[_0x5654('0x4f')],{'$or':_[_0x5654('0x42')](_0x34fadd['attributes'],function(_0x57d51c){var _0x39a36d={};_0x39a36d[_0x57d51c]={'$like':'%'+_0x4c91cc['query']['filter']+'%'};return _0x39a36d;})});}_0x34fadd=_[_0x5654('0x5a')]({},_0x34fadd,_0x4c91cc[_0x5654('0x53')]);return _0x479023['getAgents'](_0x34fadd);}})[_0x5654('0x21')](function(_0x14acb2){if(_0x14acb2){_0x5a0b98=_0x14acb2[_0x5654('0x49')];if(!_0x4c91cc[_0x5654('0x44')][_0x5654('0x4a')](_0x5654('0x4b'))){_0x34fadd[_0x5654('0x4c')]=qs[_0x5654('0x4c')](_0x4c91cc[_0x5654('0x44')]['limit']);_0x34fadd[_0x5654('0x2e')]=qs[_0x5654('0x2e')](_0x4c91cc[_0x5654('0x44')][_0x5654('0x2e')]);}return _0x479023[_0x5654('0xde')](_0x34fadd);}})['then'](function(_0x14f6f3){if(_0x14f6f3){return _0x14f6f3?{'count':_0x5a0b98,'rows':_0x14f6f3}:null;}})[_0x5654('0x21')](respondWithResult(_0xb17844,null))[_0x5654('0x2a')](handleError(_0xb17844,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index e0e8c11..d440cef 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 _0xa594=['events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0xa594,0x168));var _0x4a59=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0xa594[_0x1a3e23];return _0x5ee0d8;};'use strict';var EventEmitter=require(_0x4a59('0x0'));var SmsAccount=require(_0x4a59('0x1'))['db'][_0x4a59('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4a59('0x3')](0x0);var events={'afterCreate':_0x4a59('0x4'),'afterUpdate':'update','afterDestroy':_0x4a59('0x5')};function emitEvent(_0x4b50a1){return function(_0x27024d,_0x1bdc1e,_0x2686dc){SmsAccountEvents[_0x4a59('0x6')](_0x4b50a1+':'+_0x27024d['id'],_0x27024d);SmsAccountEvents[_0x4a59('0x6')](_0x4b50a1,_0x27024d);_0x2686dc(null);};}for(var e in events){if(events[_0x4a59('0x7')](e)){var event=events[e];SmsAccount[_0x4a59('0x8')](e,emitEvent(event));}}module[_0x4a59('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x6abd=['remove','hasOwnProperty','exports','SmsAccount','setMaxListeners','save','update'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0x6abd,0x1e6));var _0xd6ab=function(_0x220ac2,_0x1e1f32){_0x220ac2=_0x220ac2-0x0;var _0xd722a4=_0x6abd[_0x220ac2];return _0xd722a4;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xd6ab('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd6ab('0x1')](0x0);var events={'afterCreate':_0xd6ab('0x2'),'afterUpdate':_0xd6ab('0x3'),'afterDestroy':_0xd6ab('0x4')};function emitEvent(_0x2996ae){return function(_0xa80b6b,_0x25fa07,_0x3f6203){SmsAccountEvents['emit'](_0x2996ae+':'+_0xa80b6b['id'],_0xa80b6b);SmsAccountEvents['emit'](_0x2996ae,_0xa80b6b);_0x3f6203(null);};}for(var e in events){if(events[_0xd6ab('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xd6ab('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index e1203fd..184a720 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 _0x7714=['request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x48188f,_0x162d0c){var _0x30fb2e=function(_0x30bfc8){while(--_0x30bfc8){_0x48188f['push'](_0x48188f['shift']());}};_0x30fb2e(++_0x162d0c);}(_0x7714,0x7d));var _0x4771=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7714[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4771('0x0'));var util=require(_0x4771('0x1'));var logger=require(_0x4771('0x2'))(_0x4771('0x3'));var moment=require(_0x4771('0x4'));var BPromise=require('bluebird');var rp=require(_0x4771('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4771('0x6'));var config=require(_0x4771('0x7'));var attributes=require(_0x4771('0x8'));module[_0x4771('0x9')]=function(_0x45828f,_0x26555e){return _0x45828f[_0x4771('0xa')](_0x4771('0xb'),attributes,{'tableName':_0x4771('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42ce=['request-promise','path','exports','define','sms_accounts','lodash','util','api','moment','bluebird'];(function(_0x37dbbc,_0x16d813){var _0x5f41c7=function(_0x5e7eab){while(--_0x5e7eab){_0x37dbbc['push'](_0x37dbbc['shift']());}};_0x5f41c7(++_0x16d813);}(_0x42ce,0x1bd));var _0xe42c=function(_0x885eff,_0x555809){_0x885eff=_0x885eff-0x0;var _0x17819f=_0x42ce[_0x885eff];return _0x17819f;};'use strict';var _=require(_0xe42c('0x0'));var util=require(_0xe42c('0x1'));var logger=require('../../config/logger')(_0xe42c('0x2'));var moment=require(_0xe42c('0x3'));var BPromise=require(_0xe42c('0x4'));var rp=require(_0xe42c('0x5'));var fs=require('fs');var path=require(_0xe42c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xe42c('0x7')]=function(_0x266030,_0x2749c3){return _0x266030[_0xe42c('0x8')]('SmsAccount',attributes,{'tableName':_0xe42c('0x9'),'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 4775d4a..678ae4f 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 _0x2a93=['attributes','include','model','map','ShowSmsAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','find','options','raw','where'];(function(_0x1d5e90,_0x17b363){var _0x455861=function(_0x3b4ae0){while(--_0x3b4ae0){_0x1d5e90['push'](_0x1d5e90['shift']());}};_0x455861(++_0x17b363);}(_0x2a93,0x16d));var _0x32a9=function(_0x1a4c39,_0x22b9be){_0x1a4c39=_0x1a4c39-0x0;var _0x174630=_0x2a93[_0x1a4c39];return _0x174630;};'use strict';var _=require('lodash');var util=require(_0x32a9('0x0'));var moment=require(_0x32a9('0x1'));var BPromise=require(_0x32a9('0x2'));var rs=require(_0x32a9('0x3'));var fs=require('fs');var Redis=require(_0x32a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x32a9('0x5'));var logger=require('../../config/logger')(_0x32a9('0x6'));var config=require(_0x32a9('0x7'));var jayson=require(_0x32a9('0x8'));var client=jayson[_0x32a9('0x9')][_0x32a9('0xa')]({'port':0x232a});config['redis']=_[_0x32a9('0xb')](config['redis'],{'host':_0x32a9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32a9('0xd')]));require(_0x32a9('0xe'))[_0x32a9('0xf')](socket);function respondWithRpcPromise(_0x31f56e,_0x4f75e3,_0x507cf1){return new BPromise(function(_0x1aff20,_0x4115d2){return client[_0x32a9('0x10')](_0x31f56e,_0x507cf1)['then'](function(_0x17fc39){logger[_0x32a9('0x11')](_0x32a9('0x12'),_0x4f75e3,_0x32a9('0x13'));logger[_0x32a9('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4f75e3,_0x32a9('0x13'),JSON[_0x32a9('0x15')](_0x17fc39));if(_0x17fc39[_0x32a9('0x16')]){if(_0x17fc39[_0x32a9('0x16')][_0x32a9('0x17')]===0x1f4){logger['error'](_0x32a9('0x12'),_0x4f75e3,_0x17fc39['error']['message']);return _0x4115d2(_0x17fc39[_0x32a9('0x16')][_0x32a9('0x18')]);}logger[_0x32a9('0x16')]('SmsAccount,\x20%s,\x20%s',_0x4f75e3,_0x17fc39['error']['message']);return _0x1aff20(_0x17fc39[_0x32a9('0x16')][_0x32a9('0x18')]);}else{logger[_0x32a9('0x11')](_0x32a9('0x12'),_0x4f75e3,'request\x20sent');_0x1aff20(_0x17fc39[_0x32a9('0x19')][_0x32a9('0x18')]);}})[_0x32a9('0x1a')](function(_0x53c9c1){logger['error'](_0x32a9('0x12'),_0x4f75e3,_0x53c9c1);_0x4115d2(_0x53c9c1);});});}exports['ShowSmsAccount']=function(_0x4f50ba){var _0xdd2361=this;return new Promise(function(_0x109e2e,_0x239560){return db['SmsAccount'][_0x32a9('0x1b')]({'raw':_0x4f50ba[_0x32a9('0x1c')]?_0x4f50ba[_0x32a9('0x1c')][_0x32a9('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f50ba[_0x32a9('0x1c')]?_0x4f50ba['options'][_0x32a9('0x1e')]||null:null,'attributes':_0x4f50ba['options']?_0x4f50ba[_0x32a9('0x1c')][_0x32a9('0x1f')]||null:null,'include':_0x4f50ba['options']?_0x4f50ba['options'][_0x32a9('0x20')]?_['map'](_0x4f50ba['options'][_0x32a9('0x20')],function(_0x4e48ff){return{'model':db[_0x4e48ff[_0x32a9('0x21')]],'as':_0x4e48ff['as'],'attributes':_0x4e48ff[_0x32a9('0x1f')],'include':_0x4e48ff[_0x32a9('0x20')]?_['map'](_0x4e48ff[_0x32a9('0x20')],function(_0x4c97dd){return{'model':db[_0x4c97dd[_0x32a9('0x21')]],'as':_0x4c97dd['as'],'attributes':_0x4c97dd[_0x32a9('0x1f')],'include':_0x4c97dd[_0x32a9('0x20')]?_[_0x32a9('0x22')](_0x4c97dd[_0x32a9('0x20')],function(_0x336f53){return{'model':db[_0x336f53[_0x32a9('0x21')]],'as':_0x336f53['as'],'attributes':_0x336f53[_0x32a9('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27ed2e){logger[_0x32a9('0x11')]('ShowSmsAccount',_0x4f50ba);logger[_0x32a9('0x14')](_0x32a9('0x23'),_0x4f50ba,JSON[_0x32a9('0x15')](_0x27ed2e));_0x109e2e(_0x27ed2e);})[_0x32a9('0x1a')](function(_0x3c458d){logger[_0x32a9('0x16')](_0x32a9('0x23'),_0x3c458d['message'],_0x4f50ba);_0x239560(_0xdd2361[_0x32a9('0x16')](0x1f4,_0x3c458d[_0x32a9('0x18')]));});});}; \ No newline at end of file +var _0x6469=['result','catch','ShowSmsAccount','options','raw','where','include','model','attributes','map','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x329d4a,_0x156662){var _0x44e734=function(_0x2d5b41){while(--_0x2d5b41){_0x329d4a['push'](_0x329d4a['shift']());}};_0x44e734(++_0x156662);}(_0x6469,0xf2));var _0x9646=function(_0xf839b8,_0x1432fe){_0xf839b8=_0xf839b8-0x0;var _0x19c6f0=_0x6469[_0xf839b8];return _0x19c6f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9646('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9646('0x1'))['db'];var utils=require(_0x9646('0x2'));var logger=require(_0x9646('0x3'))(_0x9646('0x4'));var config=require('../../config/environment');var jayson=require(_0x9646('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x9646('0x6')]=_['defaults'](config['redis'],{'host':_0x9646('0x7'),'port':0x18eb});var socket=require(_0x9646('0x8'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2b2d92,_0x536087,_0x170e44){return new BPromise(function(_0x127a07,_0x122b7c){return client[_0x9646('0x9')](_0x2b2d92,_0x170e44)[_0x9646('0xa')](function(_0x33865f){logger[_0x9646('0xb')](_0x9646('0xc'),_0x536087,_0x9646('0xd'));logger[_0x9646('0xe')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x536087,'request\x20sent',JSON[_0x9646('0xf')](_0x33865f));if(_0x33865f['error']){if(_0x33865f[_0x9646('0x10')][_0x9646('0x11')]===0x1f4){logger[_0x9646('0x10')]('SmsAccount,\x20%s,\x20%s',_0x536087,_0x33865f[_0x9646('0x10')][_0x9646('0x12')]);return _0x122b7c(_0x33865f[_0x9646('0x10')][_0x9646('0x12')]);}logger[_0x9646('0x10')](_0x9646('0xc'),_0x536087,_0x33865f[_0x9646('0x10')][_0x9646('0x12')]);return _0x127a07(_0x33865f[_0x9646('0x10')][_0x9646('0x12')]);}else{logger[_0x9646('0xb')](_0x9646('0xc'),_0x536087,_0x9646('0xd'));_0x127a07(_0x33865f[_0x9646('0x13')][_0x9646('0x12')]);}})[_0x9646('0x14')](function(_0x2974dd){logger[_0x9646('0x10')]('SmsAccount,\x20%s,\x20%s',_0x536087,_0x2974dd);_0x122b7c(_0x2974dd);});});}exports[_0x9646('0x15')]=function(_0x2f2c66){var _0x266748=this;return new Promise(function(_0x18402b,_0xfb3319){return db['SmsAccount']['find']({'raw':_0x2f2c66[_0x9646('0x16')]?_0x2f2c66[_0x9646('0x16')][_0x9646('0x17')]===undefined?!![]:![]:!![],'where':_0x2f2c66[_0x9646('0x16')]?_0x2f2c66['options'][_0x9646('0x18')]||null:null,'attributes':_0x2f2c66[_0x9646('0x16')]?_0x2f2c66[_0x9646('0x16')]['attributes']||null:null,'include':_0x2f2c66[_0x9646('0x16')]?_0x2f2c66[_0x9646('0x16')][_0x9646('0x19')]?_['map'](_0x2f2c66[_0x9646('0x16')][_0x9646('0x19')],function(_0x7c6830){return{'model':db[_0x7c6830[_0x9646('0x1a')]],'as':_0x7c6830['as'],'attributes':_0x7c6830[_0x9646('0x1b')],'include':_0x7c6830['include']?_[_0x9646('0x1c')](_0x7c6830[_0x9646('0x19')],function(_0x14b028){return{'model':db[_0x14b028[_0x9646('0x1a')]],'as':_0x14b028['as'],'attributes':_0x14b028[_0x9646('0x1b')],'include':_0x14b028['include']?_[_0x9646('0x1c')](_0x14b028[_0x9646('0x19')],function(_0x44043f){return{'model':db[_0x44043f['model']],'as':_0x44043f['as'],'attributes':_0x44043f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x29d11c){logger['info']('ShowSmsAccount',_0x2f2c66);logger[_0x9646('0xe')]('ShowSmsAccount',_0x2f2c66,JSON['stringify'](_0x29d11c));_0x18402b(_0x29d11c);})[_0x9646('0x14')](function(_0x40f3dc){logger[_0x9646('0x10')]('ShowSmsAccount',_0x40f3dc[_0x9646('0x12')],_0x2f2c66);_0xfb3319(_0x266748[_0x9646('0x10')](0x1f4,_0x40f3dc[_0x9646('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 2a249b2..34fd548 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 f366283..45b027d 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(_0x2330fd,_0x56e9c7){var _0x5c1eba=function(_0x517719){while(--_0x517719){_0x2330fd['push'](_0x2330fd['shift']());}};_0x5c1eba(++_0x56e9c7);}(_0x3e74,0x175));var _0x43e7=function(_0x4f53c0,_0x128e61){_0x4f53c0=_0x4f53c0-0x0;var _0x381747=_0x3e74[_0x4f53c0];return _0x381747;};'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(_0x11c6a5,_0x32690b){var _0x263b7e=function(_0x2d0ce1){while(--_0x2d0ce1){_0x11c6a5['push'](_0x11c6a5['shift']());}};_0x263b7e(++_0x32690b);}(_0x55ca,0x126));var _0xa55c=function(_0x12ca7a,_0x3295bf){_0x12ca7a=_0x12ca7a-0x0;var _0x2249df=_0x55ca[_0x12ca7a];return _0x2249df;};'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 b3d087a..8733df7 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 _0x7286=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x1f62e4,_0x24435f){var _0x50014b=function(_0x1b4685){while(--_0x1b4685){_0x1f62e4['push'](_0x1f62e4['shift']());}};_0x50014b(++_0x24435f);}(_0x7286,0xd5));var _0x6728=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7286[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x6728('0x0'));module[_0x6728('0x1')]={'priority':{'type':Sequelize[_0x6728('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6728('0x3')},'appdata':{'type':Sequelize[_0x6728('0x4')]()},'description':{'type':Sequelize[_0x6728('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6728('0x6')}}; \ No newline at end of file +var _0x68a2=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x68a2,0x1a8));var _0x268a=function(_0x56fa4b,_0x25ad54){_0x56fa4b=_0x56fa4b-0x0;var _0x3b0eb5=_0x68a2[_0x56fa4b];return _0x3b0eb5;};'use strict';var Sequelize=require(_0x268a('0x0'));module[_0x268a('0x1')]={'priority':{'type':Sequelize[_0x268a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x268a('0x3')},'appdata':{'type':Sequelize[_0x268a('0x4')]()},'description':{'type':Sequelize[_0x268a('0x5')]},'interval':{'type':Sequelize[_0x268a('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index aa77656..ee5b3ca 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 _0xc512=['filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsApplication','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters'];(function(_0x5b1c9c,_0x47981a){var _0x977fd3=function(_0x41e449){while(--_0x41e449){_0x5b1c9c['push'](_0x5b1c9c['shift']());}};_0x977fd3(++_0x47981a);}(_0xc512,0x12b));var _0x2c51=function(_0x44c73d,_0x486a49){_0x44c73d=_0x44c73d-0x0;var _0xe2b045=_0xc512[_0x44c73d];return _0xe2b045;};'use strict';var emlformat=require(_0x2c51('0x0'));var rimraf=require(_0x2c51('0x1'));var zipdir=require(_0x2c51('0x2'));var jsonpatch=require(_0x2c51('0x3'));var rp=require(_0x2c51('0x4'));var moment=require(_0x2c51('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c51('0x6'));var util=require(_0x2c51('0x7'));var path=require(_0x2c51('0x8'));var sox=require(_0x2c51('0x9'));var csv=require(_0x2c51('0xa'));var ejs=require(_0x2c51('0xb'));var fs=require('fs');var fs_extra=require(_0x2c51('0xc'));var _=require(_0x2c51('0xd'));var squel=require('squel');var crypto=require(_0x2c51('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2c51('0xa'));var querystring=require(_0x2c51('0xf'));var Papa=require(_0x2c51('0x10'));var Redis=require(_0x2c51('0x11'));var authService=require(_0x2c51('0x12'));var qs=require(_0x2c51('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c51('0x14'));var logger=require(_0x2c51('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c51('0x16'))['db'];function respondWithStatusCode(_0x631390,_0x1d8d78){_0x1d8d78=_0x1d8d78||0xcc;return function(_0x29552e){if(_0x29552e){return _0x631390[_0x2c51('0x17')](_0x1d8d78);}return _0x631390[_0x2c51('0x18')](_0x1d8d78)['end']();};}function respondWithResult(_0x35982f,_0x3728b7){_0x3728b7=_0x3728b7||0xc8;return function(_0x5ef152){if(_0x5ef152){return _0x35982f[_0x2c51('0x18')](_0x3728b7)['json'](_0x5ef152);}};}function respondWithFilteredResult(_0x19f783,_0x57ea18){return function(_0x30d2ab){if(_0x30d2ab){var _0x778d71=typeof _0x57ea18[_0x2c51('0x19')]===_0x2c51('0x1a')&&typeof _0x57ea18['limit']===_0x2c51('0x1a');var _0x3719f5=_0x30d2ab[_0x2c51('0x1b')];var _0x52188c=_0x778d71?0x0:_0x57ea18[_0x2c51('0x19')];var _0x3a6ebe=_0x778d71?_0x30d2ab[_0x2c51('0x1b')]:_0x57ea18[_0x2c51('0x19')]+_0x57ea18[_0x2c51('0x1c')];var _0xbac8ee;if(_0x3a6ebe>=_0x3719f5){_0x3a6ebe=_0x3719f5;_0xbac8ee=0xc8;}else{_0xbac8ee=0xce;}_0x19f783[_0x2c51('0x18')](_0xbac8ee);return _0x19f783[_0x2c51('0x1d')]('Content-Range',_0x52188c+'-'+_0x3a6ebe+'/'+_0x3719f5)['json'](_0x30d2ab);}return null;};}function patchUpdates(_0x223c45){return function(_0x19ba24){try{jsonpatch[_0x2c51('0x1e')](_0x19ba24,_0x223c45,!![]);}catch(_0x43f62e){return BPromise[_0x2c51('0x1f')](_0x43f62e);}return _0x19ba24[_0x2c51('0x20')]();};}function saveUpdates(_0x42b86d,_0x4909ee){return function(_0x4d7851){if(_0x4d7851){return _0x4d7851[_0x2c51('0x21')](_0x42b86d)[_0x2c51('0x22')](function(_0xafc28){return _0xafc28;});}return null;};}function removeEntity(_0x24a611,_0x9fce90){return function(_0x47179e){if(_0x47179e){return _0x47179e[_0x2c51('0x23')]()[_0x2c51('0x22')](function(){_0x24a611['status'](0xcc)[_0x2c51('0x24')]();});}};}function handleEntityNotFound(_0x2fe33d,_0x2b1f14){return function(_0x2aa9f9){if(!_0x2aa9f9){_0x2fe33d[_0x2c51('0x17')](0x194);}return _0x2aa9f9;};}function handleError(_0x2f6e12,_0x34afe0){_0x34afe0=_0x34afe0||0x1f4;return function(_0x448ebc){logger[_0x2c51('0x25')](_0x448ebc[_0x2c51('0x26')]);if(_0x448ebc[_0x2c51('0x27')]){delete _0x448ebc['name'];}_0x2f6e12[_0x2c51('0x18')](_0x34afe0)[_0x2c51('0x28')](_0x448ebc);};}exports[_0x2c51('0x29')]=function(_0xe6a521,_0x40ae78){var _0x5d3101={},_0x1be518={},_0x20a09b={'count':0x0,'rows':[]};var _0x6d41c8=_[_0x2c51('0x2a')](db[_0x2c51('0x2b')]['rawAttributes'],function(_0x3cc370){return{'name':_0x3cc370['fieldName'],'type':_0x3cc370['type'][_0x2c51('0x2c')]};});_0x1be518[_0x2c51('0x2d')]=_[_0x2c51('0x2a')](_0x6d41c8,_0x2c51('0x27'));_0x1be518['query']=_[_0x2c51('0x2e')](_0xe6a521[_0x2c51('0x2f')]);_0x1be518['filters']=_['intersection'](_0x1be518[_0x2c51('0x2d')],_0x1be518[_0x2c51('0x2f')]);_0x5d3101[_0x2c51('0x30')]=_[_0x2c51('0x31')](_0x1be518[_0x2c51('0x2d')],qs[_0x2c51('0x32')](_0xe6a521[_0x2c51('0x2f')]['fields']));_0x5d3101[_0x2c51('0x30')]=_0x5d3101['attributes'][_0x2c51('0x33')]?_0x5d3101[_0x2c51('0x30')]:_0x1be518[_0x2c51('0x2d')];if(!_0xe6a521[_0x2c51('0x2f')][_0x2c51('0x34')](_0x2c51('0x35'))){_0x5d3101[_0x2c51('0x1c')]=qs[_0x2c51('0x1c')](_0xe6a521[_0x2c51('0x2f')][_0x2c51('0x1c')]);_0x5d3101[_0x2c51('0x19')]=qs['offset'](_0xe6a521['query'][_0x2c51('0x19')]);}_0x5d3101['order']=qs[_0x2c51('0x36')](_0xe6a521[_0x2c51('0x2f')]['sort']);_0x5d3101['where']=qs['filters'](_['pick'](_0xe6a521['query'],_0x1be518[_0x2c51('0x37')]),_0x6d41c8);if(_0xe6a521[_0x2c51('0x2f')][_0x2c51('0x38')]){_0x5d3101[_0x2c51('0x39')]=_[_0x2c51('0x3a')](_0x5d3101[_0x2c51('0x39')],{'$or':_[_0x2c51('0x2a')](_0x6d41c8,function(_0x23e101){if(_0x23e101[_0x2c51('0x3b')]!==_0x2c51('0x3c')){var _0x323e2e={};_0x323e2e[_0x23e101[_0x2c51('0x27')]]={'$like':'%'+_0xe6a521['query'][_0x2c51('0x38')]+'%'};return _0x323e2e;}})});}_0x5d3101=_['merge']({},_0x5d3101,_0xe6a521['options']);var _0x40a19c={'where':_0x5d3101[_0x2c51('0x39')]};return db['SmsApplication'][_0x2c51('0x1b')](_0x40a19c)['then'](function(_0x5ade4e){_0x20a09b[_0x2c51('0x1b')]=_0x5ade4e;if(_0xe6a521[_0x2c51('0x2f')][_0x2c51('0x3d')]){_0x5d3101[_0x2c51('0x3e')]=[{'all':!![]}];}return db[_0x2c51('0x2b')][_0x2c51('0x3f')](_0x5d3101);})[_0x2c51('0x22')](function(_0x2807e3){_0x20a09b[_0x2c51('0x40')]=_0x2807e3;return _0x20a09b;})[_0x2c51('0x22')](respondWithFilteredResult(_0x40ae78,_0x5d3101))['catch'](handleError(_0x40ae78,null));};exports['show']=function(_0x47530c,_0x2fa742){var _0xbea6d4={'raw':!![],'where':{'id':_0x47530c[_0x2c51('0x41')]['id']}},_0x279d58={};_0x279d58[_0x2c51('0x2d')]=_['keys'](db['SmsApplication'][_0x2c51('0x42')]);_0x279d58[_0x2c51('0x2f')]=_['keys'](_0x47530c[_0x2c51('0x2f')]);_0x279d58[_0x2c51('0x37')]=_[_0x2c51('0x31')](_0x279d58['model'],_0x279d58[_0x2c51('0x2f')]);_0xbea6d4[_0x2c51('0x30')]=_[_0x2c51('0x31')](_0x279d58[_0x2c51('0x2d')],qs[_0x2c51('0x32')](_0x47530c[_0x2c51('0x2f')]['fields']));_0xbea6d4['attributes']=_0xbea6d4[_0x2c51('0x30')][_0x2c51('0x33')]?_0xbea6d4['attributes']:_0x279d58[_0x2c51('0x2d')];if(_0x47530c['query']['includeAll']){_0xbea6d4[_0x2c51('0x3e')]=[{'all':!![]}];}_0xbea6d4=_[_0x2c51('0x3a')]({},_0xbea6d4,_0x47530c['options']);return db[_0x2c51('0x2b')][_0x2c51('0x43')](_0xbea6d4)[_0x2c51('0x22')](handleEntityNotFound(_0x2fa742,null))['then'](respondWithResult(_0x2fa742,null))['catch'](handleError(_0x2fa742,null));};exports['create']=function(_0x13fd99,_0x4c4944){return db['SmsApplication'][_0x2c51('0x44')](_0x13fd99[_0x2c51('0x45')],{})[_0x2c51('0x22')](respondWithResult(_0x4c4944,0xc9))[_0x2c51('0x46')](handleError(_0x4c4944,null));};exports[_0x2c51('0x21')]=function(_0x382b40,_0x49b163){if(_0x382b40['body']['id']){delete _0x382b40['body']['id'];}return db[_0x2c51('0x2b')][_0x2c51('0x43')]({'where':{'id':_0x382b40[_0x2c51('0x41')]['id']}})[_0x2c51('0x22')](handleEntityNotFound(_0x49b163,null))[_0x2c51('0x22')](saveUpdates(_0x382b40[_0x2c51('0x45')],null))[_0x2c51('0x22')](respondWithResult(_0x49b163,null))[_0x2c51('0x46')](handleError(_0x49b163,null));};exports[_0x2c51('0x23')]=function(_0x22609d,_0x31cf57){return db['SmsApplication'][_0x2c51('0x43')]({'where':{'id':_0x22609d[_0x2c51('0x41')]['id']}})[_0x2c51('0x22')](handleEntityNotFound(_0x31cf57,null))[_0x2c51('0x22')](removeEntity(_0x31cf57,null))[_0x2c51('0x46')](handleError(_0x31cf57,null));}; \ No newline at end of file +var _0xa05a=['fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','SmsApplication','include','rows','catch','params','includeAll','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa05a,0x1cc));var _0xaa05=function(_0x3745cc,_0x344e7b){_0x3745cc=_0x3745cc-0x0;var _0x4914d9=_0xa05a[_0x3745cc];return _0x4914d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa05('0x0'));var zipdir=require(_0xaa05('0x1'));var jsonpatch=require(_0xaa05('0x2'));var rp=require('request-promise');var moment=require(_0xaa05('0x3'));var BPromise=require(_0xaa05('0x4'));var Mustache=require(_0xaa05('0x5'));var util=require(_0xaa05('0x6'));var path=require(_0xaa05('0x7'));var sox=require(_0xaa05('0x8'));var csv=require(_0xaa05('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa05('0xa'));var _=require(_0xaa05('0xb'));var squel=require(_0xaa05('0xc'));var crypto=require(_0xaa05('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa05('0xe'));var toCsv=require(_0xaa05('0x9'));var querystring=require(_0xaa05('0xf'));var Papa=require(_0xaa05('0x10'));var Redis=require(_0xaa05('0x11'));var authService=require(_0xaa05('0x12'));var qs=require(_0xaa05('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa05('0x14'));var logger=require(_0xaa05('0x15'))('api');var utils=require(_0xaa05('0x16'));var config=require(_0xaa05('0x17'));var licenseUtil=require(_0xaa05('0x18'));var db=require(_0xaa05('0x19'))['db'];function respondWithStatusCode(_0x386167,_0x56796c){_0x56796c=_0x56796c||0xcc;return function(_0x50af35){if(_0x50af35){return _0x386167[_0xaa05('0x1a')](_0x56796c);}return _0x386167['status'](_0x56796c)[_0xaa05('0x1b')]();};}function respondWithResult(_0x17c4c4,_0xc88d60){_0xc88d60=_0xc88d60||0xc8;return function(_0x21fc35){if(_0x21fc35){return _0x17c4c4[_0xaa05('0x1c')](_0xc88d60)[_0xaa05('0x1d')](_0x21fc35);}};}function respondWithFilteredResult(_0x62d890,_0x9d4173){return function(_0x13456b){if(_0x13456b){var _0x200200=typeof _0x9d4173[_0xaa05('0x1e')]==='undefined'&&typeof _0x9d4173[_0xaa05('0x1f')]===_0xaa05('0x20');var _0x16ef68=_0x13456b[_0xaa05('0x21')];var _0x42e93d=_0x200200?0x0:_0x9d4173[_0xaa05('0x1e')];var _0x16c53f=_0x200200?_0x13456b[_0xaa05('0x21')]:_0x9d4173[_0xaa05('0x1e')]+_0x9d4173['limit'];var _0x157361;if(_0x16c53f>=_0x16ef68){_0x16c53f=_0x16ef68;_0x157361=0xc8;}else{_0x157361=0xce;}_0x62d890[_0xaa05('0x1c')](_0x157361);return _0x62d890['set'](_0xaa05('0x22'),_0x42e93d+'-'+_0x16c53f+'/'+_0x16ef68)[_0xaa05('0x1d')](_0x13456b);}return null;};}function patchUpdates(_0x2a41f3){return function(_0x542883){try{jsonpatch['apply'](_0x542883,_0x2a41f3,!![]);}catch(_0x1eab16){return BPromise[_0xaa05('0x23')](_0x1eab16);}return _0x542883[_0xaa05('0x24')]();};}function saveUpdates(_0x362eaa,_0x4cb93d){return function(_0x107cac){if(_0x107cac){return _0x107cac['update'](_0x362eaa)[_0xaa05('0x25')](function(_0x15dd75){return _0x15dd75;});}return null;};}function removeEntity(_0x12e658,_0x22b791){return function(_0x37efb6){if(_0x37efb6){return _0x37efb6[_0xaa05('0x26')]()[_0xaa05('0x25')](function(){_0x12e658[_0xaa05('0x1c')](0xcc)[_0xaa05('0x1b')]();});}};}function handleEntityNotFound(_0x459e71,_0x201cb0){return function(_0x5c5462){if(!_0x5c5462){_0x459e71['sendStatus'](0x194);}return _0x5c5462;};}function handleError(_0x3452c1,_0x11c31f){_0x11c31f=_0x11c31f||0x1f4;return function(_0xa94249){logger[_0xaa05('0x27')](_0xa94249[_0xaa05('0x28')]);if(_0xa94249[_0xaa05('0x29')]){delete _0xa94249[_0xaa05('0x29')];}_0x3452c1[_0xaa05('0x1c')](_0x11c31f)[_0xaa05('0x2a')](_0xa94249);};}exports[_0xaa05('0x2b')]=function(_0x351bb9,_0x4b882b){var _0x4f1b65={},_0x1df079={},_0x36edab={'count':0x0,'rows':[]};var _0x45cdcb=_[_0xaa05('0x2c')](db['SmsApplication'][_0xaa05('0x2d')],function(_0x51cc33){return{'name':_0x51cc33['fieldName'],'type':_0x51cc33[_0xaa05('0x2e')]['key']};});_0x1df079[_0xaa05('0x2f')]=_[_0xaa05('0x2c')](_0x45cdcb,_0xaa05('0x29'));_0x1df079[_0xaa05('0x30')]=_[_0xaa05('0x31')](_0x351bb9[_0xaa05('0x30')]);_0x1df079['filters']=_[_0xaa05('0x32')](_0x1df079[_0xaa05('0x2f')],_0x1df079['query']);_0x4f1b65['attributes']=_[_0xaa05('0x32')](_0x1df079['model'],qs[_0xaa05('0x33')](_0x351bb9[_0xaa05('0x30')][_0xaa05('0x33')]));_0x4f1b65[_0xaa05('0x34')]=_0x4f1b65[_0xaa05('0x34')][_0xaa05('0x35')]?_0x4f1b65[_0xaa05('0x34')]:_0x1df079[_0xaa05('0x2f')];if(!_0x351bb9['query'][_0xaa05('0x36')]('nolimit')){_0x4f1b65[_0xaa05('0x1f')]=qs[_0xaa05('0x1f')](_0x351bb9['query'][_0xaa05('0x1f')]);_0x4f1b65[_0xaa05('0x1e')]=qs[_0xaa05('0x1e')](_0x351bb9['query'][_0xaa05('0x1e')]);}_0x4f1b65[_0xaa05('0x37')]=qs[_0xaa05('0x38')](_0x351bb9[_0xaa05('0x30')]['sort']);_0x4f1b65[_0xaa05('0x39')]=qs['filters'](_[_0xaa05('0x3a')](_0x351bb9['query'],_0x1df079[_0xaa05('0x3b')]),_0x45cdcb);if(_0x351bb9[_0xaa05('0x30')][_0xaa05('0x3c')]){_0x4f1b65[_0xaa05('0x39')]=_[_0xaa05('0x3d')](_0x4f1b65['where'],{'$or':_[_0xaa05('0x2c')](_0x45cdcb,function(_0x2c0c69){if(_0x2c0c69[_0xaa05('0x2e')]!=='VIRTUAL'){var _0x340729={};_0x340729[_0x2c0c69[_0xaa05('0x29')]]={'$like':'%'+_0x351bb9['query'][_0xaa05('0x3c')]+'%'};return _0x340729;}})});}_0x4f1b65=_[_0xaa05('0x3d')]({},_0x4f1b65,_0x351bb9[_0xaa05('0x3e')]);var _0x482976={'where':_0x4f1b65[_0xaa05('0x39')]};return db[_0xaa05('0x3f')]['count'](_0x482976)[_0xaa05('0x25')](function(_0x2ca71c){_0x36edab[_0xaa05('0x21')]=_0x2ca71c;if(_0x351bb9[_0xaa05('0x30')]['includeAll']){_0x4f1b65[_0xaa05('0x40')]=[{'all':!![]}];}return db[_0xaa05('0x3f')]['findAll'](_0x4f1b65);})['then'](function(_0x17eeb5){_0x36edab[_0xaa05('0x41')]=_0x17eeb5;return _0x36edab;})['then'](respondWithFilteredResult(_0x4b882b,_0x4f1b65))[_0xaa05('0x42')](handleError(_0x4b882b,null));};exports['show']=function(_0x43595e,_0x32731b){var _0x674d62={'raw':!![],'where':{'id':_0x43595e[_0xaa05('0x43')]['id']}},_0x2a2b46={};_0x2a2b46[_0xaa05('0x2f')]=_[_0xaa05('0x31')](db[_0xaa05('0x3f')][_0xaa05('0x2d')]);_0x2a2b46['query']=_['keys'](_0x43595e['query']);_0x2a2b46['filters']=_[_0xaa05('0x32')](_0x2a2b46[_0xaa05('0x2f')],_0x2a2b46[_0xaa05('0x30')]);_0x674d62[_0xaa05('0x34')]=_[_0xaa05('0x32')](_0x2a2b46[_0xaa05('0x2f')],qs[_0xaa05('0x33')](_0x43595e['query']['fields']));_0x674d62['attributes']=_0x674d62[_0xaa05('0x34')]['length']?_0x674d62[_0xaa05('0x34')]:_0x2a2b46['model'];if(_0x43595e[_0xaa05('0x30')][_0xaa05('0x44')]){_0x674d62[_0xaa05('0x40')]=[{'all':!![]}];}_0x674d62=_[_0xaa05('0x3d')]({},_0x674d62,_0x43595e[_0xaa05('0x3e')]);return db[_0xaa05('0x3f')][_0xaa05('0x45')](_0x674d62)[_0xaa05('0x25')](handleEntityNotFound(_0x32731b,null))[_0xaa05('0x25')](respondWithResult(_0x32731b,null))[_0xaa05('0x42')](handleError(_0x32731b,null));};exports[_0xaa05('0x46')]=function(_0x1ab1ce,_0x5438c6){return db['SmsApplication'][_0xaa05('0x46')](_0x1ab1ce[_0xaa05('0x47')],{})[_0xaa05('0x25')](respondWithResult(_0x5438c6,0xc9))['catch'](handleError(_0x5438c6,null));};exports[_0xaa05('0x48')]=function(_0x5a7776,_0x1331e8){if(_0x5a7776[_0xaa05('0x47')]['id']){delete _0x5a7776['body']['id'];}return db[_0xaa05('0x3f')][_0xaa05('0x45')]({'where':{'id':_0x5a7776[_0xaa05('0x43')]['id']}})['then'](handleEntityNotFound(_0x1331e8,null))[_0xaa05('0x25')](saveUpdates(_0x5a7776[_0xaa05('0x47')],null))[_0xaa05('0x25')](respondWithResult(_0x1331e8,null))['catch'](handleError(_0x1331e8,null));};exports[_0xaa05('0x26')]=function(_0x5e636c,_0x185aa7){return db[_0xaa05('0x3f')][_0xaa05('0x45')]({'where':{'id':_0x5e636c['params']['id']}})[_0xaa05('0x25')](handleEntityNotFound(_0x185aa7,null))[_0xaa05('0x25')](removeEntity(_0x185aa7,null))[_0xaa05('0x42')](handleError(_0x185aa7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c49035e..4e024d3 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 _0x4af4=['rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5b7e35,_0x5708cd){var _0x87e43e=function(_0x315482){while(--_0x315482){_0x5b7e35['push'](_0x5b7e35['shift']());}};_0x87e43e(++_0x5708cd);}(_0x4af4,0x13f));var _0x44af=function(_0x7bf0de,_0x41ba36){_0x7bf0de=_0x7bf0de-0x0;var _0x50b2f1=_0x4af4[_0x7bf0de];return _0x50b2f1;};'use strict';var _=require(_0x44af('0x0'));var util=require(_0x44af('0x1'));var logger=require(_0x44af('0x2'))('api');var moment=require(_0x44af('0x3'));var BPromise=require(_0x44af('0x4'));var rp=require(_0x44af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44af('0x6'));var config=require('../../config/environment');var attributes=require(_0x44af('0x7'));module[_0x44af('0x8')]=function(_0x5481ab,_0x4d37c4){return _0x5481ab[_0x44af('0x9')](_0x44af('0xa'),attributes,{'tableName':_0x44af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x44af('0xc')});}; \ No newline at end of file +var _0xf074=['../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','rimraf'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0xf074,0x134));var _0x4f07=function(_0x286855,_0x2747ad){_0x286855=_0x286855-0x0;var _0x3644c9=_0xf074[_0x286855];return _0x3644c9;};'use strict';var _=require(_0x4f07('0x0'));var util=require(_0x4f07('0x1'));var logger=require('../../config/logger')(_0x4f07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4f07('0x3'));var config=require(_0x4f07('0x4'));var attributes=require(_0x4f07('0x5'));module[_0x4f07('0x6')]=function(_0x236ef1,_0x58575b){return _0x236ef1[_0x4f07('0x7')](_0x4f07('0x8'),attributes,{'tableName':_0x4f07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f07('0xa'),'collate':_0x4f07('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 7f12711..5118392 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 _0x0570=['request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x0570,0x172));var _0x0057=function(_0x14bc16,_0x40e918){_0x14bc16=_0x14bc16-0x0;var _0x215a0b=_0x0570[_0x14bc16];return _0x215a0b;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5096e2,_0xc86734,_0x529f55){return new BPromise(function(_0x15d424,_0x2f9d7f){return client[_0x0057('0xa')](_0x5096e2,_0x529f55)[_0x0057('0xb')](function(_0x29b7c6){logger['info'](_0x0057('0xc'),_0xc86734,_0x0057('0xd'));logger[_0x0057('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'),JSON[_0x0057('0xf')](_0x29b7c6));if(_0x29b7c6['error']){if(_0x29b7c6['error'][_0x0057('0x10')]===0x1f4){logger[_0x0057('0x11')](_0x0057('0xc'),_0xc86734,_0x29b7c6['error'][_0x0057('0x12')]);return _0x2f9d7f(_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);}logger[_0x0057('0x11')]('SmsApplication,\x20%s,\x20%s',_0xc86734,_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);return _0x15d424(_0x29b7c6['error'][_0x0057('0x12')]);}else{logger[_0x0057('0x13')]('SmsApplication,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'));_0x15d424(_0x29b7c6['result'][_0x0057('0x12')]);}})['catch'](function(_0x4be851){logger[_0x0057('0x11')]('SmsApplication,\x20%s,\x20%s',_0xc86734,_0x4be851);_0x2f9d7f(_0x4be851);});});} \ No newline at end of file +var _0x3a6d=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x3a6d,0x143));var _0xd3a6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a6d[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('SmsApplication,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('SmsApplication,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f0af403..97c4f96 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 _0xd8b0=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x5a2264,_0x4d0937){var _0x5898d4=function(_0xf1d29b){while(--_0xf1d29b){_0x5a2264['push'](_0x5a2264['shift']());}};_0x5898d4(++_0x4d0937);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./smsInteraction.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('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/download',auth[_0x0d8b('0x7')](),controller['download']);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0xf')](_0x0d8b('0x12'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15')),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x17')),controller['update']);router[_0x0d8b('0x18')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x19')),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x18')]('/:id/tags',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x1b')]);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0xb688=['destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','sms'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb688,0xcf));var _0x8b68=function(_0x5d6b41,_0x3d1c8f){_0x5d6b41=_0x5d6b41-0x0;var _0x1c2dd6=_0xb688[_0x5d6b41];return _0x1c2dd6;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x14')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x16')]);router[_0x8b68('0x14')]('/:id/tags',auth[_0x8b68('0xc')](),interaction['tracked']('sms',_0x8b68('0x17')),controller[_0x8b68('0x18')]);router[_0x8b68('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x8b68('0x1a')]('sms',_0x8b68('0x1b')),controller[_0x8b68('0x1c')]);router[_0x8b68('0x1d')](_0x8b68('0xe'),auth['isAuthenticated'](),interaction[_0x8b68('0x1a')](_0x8b68('0x1e'),'smsinteraction:destroy'),controller[_0x8b68('0x1f')]);router[_0x8b68('0x1d')](_0x8b68('0x20'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index e12ee44..825d324 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 _0x93bb=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x3e17d0,_0x3499a6){var _0x519802=function(_0x22a945){while(--_0x22a945){_0x3e17d0['push'](_0x3e17d0['shift']());}};_0x519802(++_0x3499a6);}(_0x93bb,0x135));var _0xb93b=function(_0x3e9fe1,_0x4731ed){_0x3e9fe1=_0x3e9fe1-0x0;var _0x3d5ce4=_0x93bb[_0x3e9fe1];return _0x3d5ce4;};'use strict';var Sequelize=require(_0xb93b('0x0'));var moment=require(_0xb93b('0x1'));module[_0xb93b('0x2')]={'closed':{'type':Sequelize[_0xb93b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb93b('0x4')]},'disposition':{'type':Sequelize[_0xb93b('0x5')]},'secondDisposition':{'type':Sequelize[_0xb93b('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb93b('0x5')]},'note':{'type':Sequelize[_0xb93b('0x5')]},'phone':{'type':Sequelize[_0xb93b('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb93b('0x6')]('in',_0xb93b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb93b('0x6')]('in',_0xb93b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe35c=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x454589,_0x3e852e){var _0x468c5c=function(_0xa5b1f5){while(--_0xa5b1f5){_0x454589['push'](_0x454589['shift']());}};_0x468c5c(++_0x3e852e);}(_0xe35c,0x146));var _0xce35=function(_0xf7e079,_0xbb4833){_0xf7e079=_0xf7e079-0x0;var _0xea321=_0xe35c[_0xf7e079];return _0xea321;};'use strict';var Sequelize=require(_0xce35('0x0'));var moment=require(_0xce35('0x1'));module[_0xce35('0x2')]={'closed':{'type':Sequelize[_0xce35('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xce35('0x4')]},'disposition':{'type':Sequelize[_0xce35('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xce35('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xce35('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xce35('0x6')]('in',_0xce35('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xce35('0x6')]('in',_0xce35('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xce35('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 75eab43..c8851a9 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 _0xebea=['SmsAccount','Account','Owner','get','Sms','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','push','map','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','split','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','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','body','some','compact','isEmpty','SmsAccountId','concat','createdAt','parse','$lte','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','catch','show','SmsInteraction','rawAttributes','includeAll','include','create','params','describe','SmsMessage','addMessage','ids','getMessages','findOne','$gte','format','options','addTags','setTags','omit','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','User','CmContact','Contact','lastName','Messages','direction','secret'];(function(_0x139a24,_0x21a778){var _0x37d8c8=function(_0x33f55c){while(--_0x33f55c){_0x139a24['push'](_0x139a24['shift']());}};_0x37d8c8(++_0x21a778);}(_0xebea,0xec));var _0xaebe=function(_0x369f6e,_0xbc1e89){_0x369f6e=_0x369f6e-0x0;var _0x1e971e=_0xebea[_0x369f6e];return _0x1e971e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaebe('0x0'));var rp=require(_0xaebe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaebe('0x2'));var util=require(_0xaebe('0x3'));var path=require('path');var sox=require(_0xaebe('0x4'));var csv=require(_0xaebe('0x5'));var ejs=require(_0xaebe('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaebe('0x7'));var squel=require(_0xaebe('0x8'));var crypto=require(_0xaebe('0x9'));var jsforce=require(_0xaebe('0xa'));var deskjs=require(_0xaebe('0xb'));var toCsv=require(_0xaebe('0x5'));var querystring=require(_0xaebe('0xc'));var Papa=require('papaparse');var Redis=require(_0xaebe('0xd'));var authService=require(_0xaebe('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xaebe('0xf'));var hardwareService=require(_0xaebe('0x10'));var logger=require(_0xaebe('0x11'))(_0xaebe('0x12'));var utils=require(_0xaebe('0x13'));var config=require(_0xaebe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaebe('0x15'))['db'];config['redis']=_[_0xaebe('0x16')](config['redis'],{'host':_0xaebe('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaebe('0x18')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2f3596,_0x33f839){_0x33f839=_0x33f839||0xcc;return function(_0x4724dd){if(_0x4724dd){return _0x2f3596[_0xaebe('0x19')](_0x33f839);}return _0x2f3596['status'](_0x33f839)[_0xaebe('0x1a')]();};}function respondWithResult(_0x5a7110,_0x48a0a4){_0x48a0a4=_0x48a0a4||0xc8;return function(_0x521971){if(_0x521971){return _0x5a7110['status'](_0x48a0a4)[_0xaebe('0x1b')](_0x521971);}};}function respondWithFilteredResult(_0x2c6534,_0x25134d){return function(_0x2819d9){if(_0x2819d9){var _0x18b1cf=typeof _0x25134d[_0xaebe('0x1c')]==='undefined'&&typeof _0x25134d['limit']===_0xaebe('0x1d');var _0x573b08=_0x2819d9[_0xaebe('0x1e')];var _0x443912=_0x18b1cf?0x0:_0x25134d[_0xaebe('0x1c')];var _0x443fb9=_0x18b1cf?_0x2819d9[_0xaebe('0x1e')]:_0x25134d[_0xaebe('0x1c')]+_0x25134d[_0xaebe('0x1f')];var _0x1b904b;if(_0x443fb9>=_0x573b08){_0x443fb9=_0x573b08;_0x1b904b=0xc8;}else{_0x1b904b=0xce;}_0x2c6534[_0xaebe('0x20')](_0x1b904b);return _0x2c6534[_0xaebe('0x21')](_0xaebe('0x22'),_0x443912+'-'+_0x443fb9+'/'+_0x573b08)[_0xaebe('0x1b')](_0x2819d9);}return null;};}function patchUpdates(_0x11818f){return function(_0xb01a74){try{jsonpatch[_0xaebe('0x23')](_0xb01a74,_0x11818f,!![]);}catch(_0x271ac2){return BPromise[_0xaebe('0x24')](_0x271ac2);}return _0xb01a74[_0xaebe('0x25')]();};}function saveUpdates(_0x439549,_0x2ac33a){return function(_0x3d02db){if(_0x3d02db){return _0x3d02db[_0xaebe('0x26')](_0x439549)[_0xaebe('0x27')](function(_0x15c9a3){return _0x15c9a3;});}return null;};}function removeEntity(_0x49b26a,_0x312b70){return function(_0x738028){if(_0x738028){return _0x738028[_0xaebe('0x28')]()[_0xaebe('0x27')](function(){_0x49b26a[_0xaebe('0x20')](0xcc)[_0xaebe('0x1a')]();});}};}function handleEntityNotFound(_0x59431f,_0x18330d){return function(_0x33b0e4){if(!_0x33b0e4){_0x59431f[_0xaebe('0x19')](0x194);}return _0x33b0e4;};}function handleError(_0x27991d,_0x172a83){_0x172a83=_0x172a83||0x1f4;return function(_0x4e6311){logger['error'](_0x4e6311[_0xaebe('0x29')]);if(_0x4e6311[_0xaebe('0x2a')]){delete _0x4e6311['name'];}_0x27991d['status'](_0x172a83)[_0xaebe('0x2b')](_0x4e6311);};}function getInteractionUsers(_0x2b66cf,_0xaf55b){return new BPromise(function(_0x361346,_0x18ee39){try{if(_0xaf55b[_0x2b66cf['id']]){_0x2b66cf[_0xaebe('0x2c')]=_['map'](_0xaf55b[_0x2b66cf['id']],function(_0x4c19de){return{'id':_0x4c19de['id'],'fullname':_0x4c19de[_0xaebe('0x2d')]};});}}catch(_0x1909ec){_0x18ee39(_0x1909ec);}_0x361346(_0x2b66cf);});}function getInteractionTags(_0x458255,_0x12d60e){return new BPromise(function(_0x394a93,_0x53d457){try{if(_0x458255[_0xaebe('0x2e')]){_0x458255['Tags']=[];_0x458255[_0xaebe('0x2e')]['split'](',')['forEach'](function(_0x5dc482){_0x458255[_0xaebe('0x2f')][_0xaebe('0x30')](_0x12d60e[_0x5dc482]);});}delete _0x458255['TagIds'];}catch(_0x478fb8){_0x53d457(_0x478fb8);}_0x394a93(_0x458255);});}function updateSmsInteraction(_0x981d43,_0x2aad35,_0x1e3d3d){return new BPromise(function(_0x3d4b29,_0x5e041f){return getInteractionUsers(_0x981d43,_0x1e3d3d)['then'](function(_0x74e33f){return getInteractionTags(_0x74e33f,_0x2aad35);})['then'](function(_0xd796b5){_0x3d4b29(_0xd796b5);})['catch'](function(_0x54e0d8){_0x5e041f(_0x54e0d8);});});}exports['index']=function(_0x4b8997,_0x3d9a3b){var _0x565023={},_0x41381e={},_0x587b33={'count':0x0,'rows':[]};var _0x294194=_[_0xaebe('0x31')](db['SmsInteraction']['rawAttributes'],function(_0x24c984){return{'name':_0x24c984[_0xaebe('0x32')],'type':_0x24c984[_0xaebe('0x33')]['key']};});_0x41381e['model']=_[_0xaebe('0x31')](_0x294194,_0xaebe('0x2a'));_0x41381e[_0xaebe('0x34')]=_[_0xaebe('0x35')](_0x4b8997['query']);_0x41381e[_0xaebe('0x36')]=_['intersection'](_0x41381e['model'],_0x41381e['query']);_0x565023['attributes']=_[_0xaebe('0x37')](_0x41381e[_0xaebe('0x38')],qs[_0xaebe('0x39')](_0x4b8997[_0xaebe('0x34')][_0xaebe('0x39')]));_0x565023[_0xaebe('0x3a')]=_0x565023[_0xaebe('0x3a')][_0xaebe('0x3b')]?_0x565023[_0xaebe('0x3a')]:_0x41381e[_0xaebe('0x38')];if(!_0x4b8997[_0xaebe('0x34')][_0xaebe('0x3c')](_0xaebe('0x3d'))){_0x565023[_0xaebe('0x1f')]=qs['limit'](_0x4b8997[_0xaebe('0x34')][_0xaebe('0x1f')]);_0x565023[_0xaebe('0x1c')]=qs[_0xaebe('0x1c')](_0x4b8997[_0xaebe('0x34')][_0xaebe('0x1c')]);}_0x565023[_0xaebe('0x3e')]=qs[_0xaebe('0x3f')](_0x4b8997['query'][_0xaebe('0x3f')]);_0x565023[_0xaebe('0x40')]=qs['filters'](_[_0xaebe('0x41')](_0x4b8997[_0xaebe('0x34')],_0x41381e[_0xaebe('0x36')]),_0x294194);var _0x280d94=[];var _0x32f75c=squel['select']()[_0xaebe('0x42')]('id')[_0xaebe('0x42')]('name')[_0xaebe('0x42')](_0xaebe('0x43'))[_0xaebe('0x44')]('tools_tags');var _0x19a2f6=squel[_0xaebe('0x45')]()[_0xaebe('0x42')](_0xaebe('0x46'))['field'](_0xaebe('0x47'))[_0xaebe('0x42')](_0xaebe('0x48'))[_0xaebe('0x44')](_0xaebe('0x49'),'ui')[_0xaebe('0x4a')]('users','u',_0xaebe('0x4b'));var _0x28a5ed=squel[_0xaebe('0x45')]()[_0xaebe('0x44')](_0xaebe('0x4c'),'i')[_0xaebe('0x4a')]('cm_contacts','c',_0xaebe('0x4d'))['left_join'](_0xaebe('0x4e'),'o',_0xaebe('0x4f'))[_0xaebe('0x4a')](_0xaebe('0x50'),'a',_0xaebe('0x51'))[_0xaebe('0x4a')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0xaebe('0x4a')](_0xaebe('0x52'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5cbfcb=squel[_0xaebe('0x53')]();var _0x22cf38=[];var _0x48ed4a=squel[_0xaebe('0x53')]();var _0x1b6caa;if(_0x4b8997[_0xaebe('0x34')][_0xaebe('0x54')]){_0x1b6caa=as['parseSearch'](_0x4b8997[_0xaebe('0x34')][_0xaebe('0x54')]);var _0xe7b3f7=_0x1b6caa[_0xaebe('0x55')];for(var _0x344104=0x0;_0x344104<_0x1b6caa[_0xaebe('0x56')][_0xaebe('0x3b')];_0x344104++){var _0x4ee411=_0x1b6caa[_0xaebe('0x56')][_0x344104];var _0x30c920='i';var _0x48f5e1=_[_0xaebe('0x57')](_0x294194,['name',_0x4ee411[_0xaebe('0x42')]]);if(!_0x48f5e1){switch(_0x4ee411[_0xaebe('0x42')]){case _0xaebe('0x58'):if(_0x4ee411[_0xaebe('0x59')]==0x1){_0x28a5ed[_0xaebe('0x5a')]('`'+_0x4ee411[_0xaebe('0x42')]+_0xaebe('0x5b'));}else{_0x28a5ed[_0xaebe('0x5a')]('`'+_0x4ee411[_0xaebe('0x42')]+'`\x20>\x200');}break;case'Contact':if(_0x4ee411[_0xaebe('0x5c')]===_0xaebe('0x5d')){if(_0x4ee411['value'][_0xaebe('0x5e')]('\x20')[_0xaebe('0x3b')]>0x1){_0x5cbfcb[_0xe7b3f7](_0xaebe('0x5f'),qs[_0xaebe('0x60')](_0x4ee411[_0xaebe('0x59')]),null);}else{var _0x3fb95c='%'+_0x4ee411[_0xaebe('0x59')]+'%';_0x5cbfcb[_0xe7b3f7](_0xaebe('0x61'),_0x3fb95c,_0x3fb95c,_0x3fb95c);}}else{_0x48f5e1=_[_0xaebe('0x57')](_0x294194,[_0xaebe('0x2a'),'ContactId']);_0x4ee411[_0xaebe('0x42')]=_0xaebe('0x62');_0xb0399=as['buildExpression'](_0x30c920,_0x48f5e1[_0xaebe('0x33')],_0x4ee411);_0x5cbfcb[_0xe7b3f7](_0xb0399[_0xaebe('0x63')],_0xb0399[_0xaebe('0x59')]['start'],_0xb0399['value'][_0xaebe('0x1a')]);}break;case _0xaebe('0x64'):var _0x503fad=_0x4ee411[_0xaebe('0x59')][_0xaebe('0x5e')](',')[_0xaebe('0x31')](function(_0x46bd03){return Number(_0x46bd03);});_0x503fad[_0xaebe('0x65')](function(_0x2419a9){_0x48ed4a['or'](_0xaebe('0x66'),'%,'+_0x2419a9+',%');});_0x22cf38=_['union'](_0x22cf38,_0x503fad);break;case'User':if(_0x4ee411[_0xaebe('0x5c')]===_0xaebe('0x5d')){_0x5cbfcb[_0xe7b3f7](_0xaebe('0x67'),'%'+_0x4ee411[_0xaebe('0x59')]+'%',null);}else{_0x48f5e1=_['find'](_0x294194,['name',_0xaebe('0x68')]);_0x4ee411[_0xaebe('0x42')]='UserId';_0xb0399=as[_0xaebe('0x69')](_0x30c920,_0x48f5e1[_0xaebe('0x33')],_0x4ee411);_0x5cbfcb[_0xe7b3f7](_0xb0399[_0xaebe('0x63')],_0xb0399[_0xaebe('0x59')][_0xaebe('0x6a')],_0xb0399[_0xaebe('0x59')][_0xaebe('0x1a')]);}break;case _0xaebe('0x6b'):_0xb0399=as[_0xaebe('0x69')]('me',null,_0x4ee411);_0x5cbfcb[_0xe7b3f7](_0xb0399[_0xaebe('0x63')],_0xb0399[_0xaebe('0x59')]['start'],_0xb0399['value'][_0xaebe('0x1a')]);break;}}else{var _0xb0399=as['buildExpression'](_0x30c920,_0x48f5e1['type'],_0x4ee411);_0x5cbfcb[_0xe7b3f7](_0xb0399[_0xaebe('0x63')],_0xb0399['value'][_0xaebe('0x6a')],_0xb0399[_0xaebe('0x59')][_0xaebe('0x1a')]);}}}else{var _0x738e8f=_(_0x4b8997[_0xaebe('0x34')])['keys']()[_0xaebe('0x31')](function(_0x2e44bd){return _[_0xaebe('0x6c')](_0x294194,[_0xaebe('0x2a'),_0x2e44bd])?_0x2e44bd:undefined;})[_0xaebe('0x6d')]()[_0xaebe('0x59')]();if(!_[_0xaebe('0x6e')](_0x738e8f)){_0x738e8f[_0xaebe('0x65')](function(_0x167795){if(_0x167795===_0xaebe('0x6f')){_0x28a5ed['where']('i.SmsAccountId\x20IN\x20?',[][_0xaebe('0x70')](_0x4b8997[_0xaebe('0x34')][_0x167795]));}else if(_0x167795===_0xaebe('0x71')){var _0x787dbb=JSON[_0xaebe('0x72')](_0x4b8997[_0xaebe('0x34')][_0x167795])['$gte'];var _0x3c4b81=JSON['parse'](_0x4b8997[_0xaebe('0x34')][_0x167795])[_0xaebe('0x73')];_0x28a5ed[_0xaebe('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x787dbb,_0x3c4b81);}else{if(_0x4b8997[_0xaebe('0x34')][_0x167795]==='null'){_0x28a5ed[_0xaebe('0x40')]('i.'+_0x167795+'\x20IS\x20NULL');}else{_0x28a5ed[_0xaebe('0x40')]('i.'+_0x167795+'\x20=\x20?',_0x4b8997['query'][_0x167795]);}}});}if(_0x4b8997['query'][_0xaebe('0x74')]){if(_0x4b8997[_0xaebe('0x34')]['read']==0x1){_0x28a5ed[_0xaebe('0x5a')](_0xaebe('0x75'));}else{_0x28a5ed['having'](_0xaebe('0x76'));}}if(_0x4b8997[_0xaebe('0x34')][_0xaebe('0x77')]){_0x22cf38=_[_0xaebe('0x78')](_0x4b8997['query'][_0xaebe('0x77')])?_0x4b8997[_0xaebe('0x34')][_0xaebe('0x77')]:new Array(_0x4b8997[_0xaebe('0x34')][_0xaebe('0x77')]);_0x22cf38[_0xaebe('0x65')](function(_0x3d254e){_0x48ed4a['or'](_0xaebe('0x66'),'%,'+_0x3d254e+',%');});}if(_0x4b8997[_0xaebe('0x34')][_0xaebe('0x79')]){var _0x286679=_0x4b8997[_0xaebe('0x34')][_0xaebe('0x79')][_0xaebe('0x7a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xaebe('0x7b')](_0x286679)){_0x5cbfcb['or'](_0xaebe('0x7c'),_0x286679+'%')['or'](_0xaebe('0x7d'),_0x286679+'%');}else{_0x5cbfcb['or'](_0xaebe('0x7e'),qs[_0xaebe('0x60')](_0x286679))['or'](_0xaebe('0x7f'),_0x286679+'%');}}}_0x28a5ed['where'](_0x5cbfcb);_0x28a5ed[_0xaebe('0x80')](_0xaebe('0x81'));var _0x4c7a4c={'type':db[_0xaebe('0x82')][_0xaebe('0x83')][_0xaebe('0x84')],'raw':!![]};var _0x2c37b8=_0x28a5ed[_0xaebe('0x85')]();_0x2c37b8['field'](_0xaebe('0x81'));_0x2c37b8[_0xaebe('0x42')](_0xaebe('0x86'),_0xaebe('0x58'));if(_0x565023[_0xaebe('0x3e')]){_0x565023[_0xaebe('0x3e')][_0xaebe('0x65')](function(_0x101b36){var _0x2a226f=_0x101b36[0x0]===_0xaebe('0x87')?_0x101b36[0x0]:'i.'+_0x101b36[0x0];_0x28a5ed[_0xaebe('0x3e')](_0x2a226f,_0x101b36[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x22cf38)){_0x28a5ed[_0xaebe('0x5a')](_0x48ed4a);_0x2c37b8[_0xaebe('0x40')](_0xaebe('0x88'),_0x22cf38);}BPromise['resolve']()['then'](function(){if(!_0x1b6caa){if(_0x4b8997[_0xaebe('0x34')]['SmsAccountId'])return;_0x2c37b8['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x28a5ed[_0xaebe('0x40')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4b8997[_0xaebe('0x89')]['role']!=='agent')return;return _0x4b8997['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xaebe('0x27')](function(_0x4778f3){if(_['isEmpty'](_0x4778f3)){_0x2c37b8['where'](_0xaebe('0x8a'));_0x28a5ed[_0xaebe('0x40')](_0xaebe('0x8a'));}else{_0x2c37b8[_0xaebe('0x40')](_0xaebe('0x8b'),_[_0xaebe('0x31')](_0x4778f3,'id'));_0x28a5ed[_0xaebe('0x40')](_0xaebe('0x8b'),_['map'](_0x4778f3,'id'));}});})[_0xaebe('0x27')](function(){if(_0x4b8997[_0xaebe('0x89')]['role']===_0xaebe('0x8c')&&!_0x1b6caa&&!_0x4b8997['query']['SmsAccountId'])return[];return db[_0xaebe('0x8d')]['query'](_0x2c37b8[_0xaebe('0x8e')](),_0x4c7a4c);})['then'](function(_0x9dc210){_0x587b33[_0xaebe('0x1e')]=_0x9dc210[_0xaebe('0x3b')];if(_0x587b33['count']===0x0)return[];return db[_0xaebe('0x8d')][_0xaebe('0x34')](_0x32f75c['toString'](),_0x4c7a4c)[_0xaebe('0x27')](function(_0x486675){_0x280d94=_[_0xaebe('0x8f')](_0x486675,'id');_0x4c7a4c=_[_0xaebe('0x90')](_0x4c7a4c,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b8997['query']['fields']){_0x565023[_0xaebe('0x3a')]['forEach'](function(_0xa48a56){_0x28a5ed[_0xaebe('0x42')]('i.'+_0xa48a56);});}else{_0x28a5ed['field'](_0xaebe('0x86'),_0xaebe('0x58'));_0x28a5ed[_0xaebe('0x42')](_0xaebe('0x91'),_0xaebe('0x92'));_0x28a5ed[_0xaebe('0x42')](_0xaebe('0x93'),'Account.mandatoryDisposition');_0x28a5ed[_0xaebe('0x42')](_0xaebe('0x94'),_0xaebe('0x87'));_0x28a5ed['field'](_0xaebe('0x95'));_0x28a5ed[_0xaebe('0x42')](_0xaebe('0x96'),_0xaebe('0x97'));_0x28a5ed['field'](_0xaebe('0x98'),_0xaebe('0x99'));_0x28a5ed['field'](_0xaebe('0x9a'),_0xaebe('0x9b'));_0x28a5ed[_0xaebe('0x42')]('c.phone',_0xaebe('0x9c'));_0x28a5ed[_0xaebe('0x42')]('c.mobile',_0xaebe('0x9d'));_0x28a5ed[_0xaebe('0x42')]('c.fax',_0xaebe('0x9e'));_0x28a5ed[_0xaebe('0x42')]('o.fullname',_0xaebe('0x9f'));_0x28a5ed[_0xaebe('0x42')]('o.internal','Owner.internal');_0x28a5ed[_0xaebe('0x42')](_0xaebe('0xa0'),_0xaebe('0x2e'));}if(_0x565023[_0xaebe('0x1f')])_0x28a5ed[_0xaebe('0x1f')](_0x565023[_0xaebe('0x1f')]);if(_0x565023[_0xaebe('0x1c')])_0x28a5ed[_0xaebe('0x1c')](_0x565023[_0xaebe('0x1c')]);return db['sequelize'][_0xaebe('0x34')](_0x28a5ed[_0xaebe('0x8e')](),_0x4c7a4c);})[_0xaebe('0x27')](function(_0xed3c98){if(_0xed3c98[_0xaebe('0x3b')]>0x0)_0x19a2f6[_0xaebe('0x40')]('ui.SmsInteractionId\x20IN\x20?',_[_0xaebe('0x31')](_0xed3c98,'id'));return db[_0xaebe('0x8d')][_0xaebe('0x34')](_0x19a2f6[_0xaebe('0x8e')](),_0x4c7a4c)[_0xaebe('0x27')](function(_0x369ce2){var _0x3df6a0=_[_0xaebe('0xa1')](_0x369ce2,_0xaebe('0xa2'));var _0x36c45e=[];_0xed3c98['forEach'](function(_0x389d99){_0x36c45e[_0xaebe('0x30')](updateSmsInteraction(_0x389d99,_0x280d94,_0x3df6a0));});return BPromise[_0xaebe('0xa3')](_0x36c45e);});});})[_0xaebe('0x27')](function(_0x19d8fb){_0x587b33[_0xaebe('0xa4')]=_0x19d8fb;return _0x587b33;})['then'](respondWithFilteredResult(_0x3d9a3b,_0x565023))[_0xaebe('0xa5')](handleError(_0x3d9a3b,null));};exports[_0xaebe('0xa6')]=function(_0x9eaac7,_0x35ce25){var _0x458e30={'raw':![],'where':{'id':_0x9eaac7['params']['id']}},_0x13d8d1={};_0x13d8d1['model']=_[_0xaebe('0x35')](db[_0xaebe('0xa7')][_0xaebe('0xa8')]);_0x13d8d1[_0xaebe('0x34')]=_[_0xaebe('0x35')](_0x9eaac7[_0xaebe('0x34')]);_0x13d8d1['filters']=_[_0xaebe('0x37')](_0x13d8d1[_0xaebe('0x38')],_0x13d8d1['query']);_0x458e30[_0xaebe('0x3a')]=_[_0xaebe('0x37')](_0x13d8d1['model'],qs['fields'](_0x9eaac7[_0xaebe('0x34')]['fields']));_0x458e30['attributes']=_0x458e30[_0xaebe('0x3a')][_0xaebe('0x3b')]?_0x458e30[_0xaebe('0x3a')]:_0x13d8d1[_0xaebe('0x38')];if(_0x9eaac7[_0xaebe('0x34')][_0xaebe('0xa9')]){_0x458e30[_0xaebe('0xaa')]=[{'all':!![]}];}_0x458e30=_[_0xaebe('0x90')]({},_0x458e30,_0x9eaac7['options']);return db['SmsInteraction'][_0xaebe('0x57')](_0x458e30)['then'](handleEntityNotFound(_0x35ce25,null))[_0xaebe('0x27')](respondWithResult(_0x35ce25,null))[_0xaebe('0xa5')](handleError(_0x35ce25,null));};exports['create']=function(_0x1ab80a,_0x1543f1){return db[_0xaebe('0xa7')][_0xaebe('0xab')](_0x1ab80a['body'],{})['then'](respondWithResult(_0x1543f1,0xc9))[_0xaebe('0xa5')](handleError(_0x1543f1,null));};exports[_0xaebe('0x26')]=function(_0x32ec42,_0x4e03e6){if(_0x32ec42['body']['id']){delete _0x32ec42[_0xaebe('0x6b')]['id'];}return db[_0xaebe('0xa7')][_0xaebe('0x57')]({'where':{'id':_0x32ec42[_0xaebe('0xac')]['id']}})['then'](handleEntityNotFound(_0x4e03e6,null))[_0xaebe('0x27')](saveUpdates(_0x32ec42[_0xaebe('0x6b')],null))['then'](respondWithResult(_0x4e03e6,null))[_0xaebe('0xa5')](handleError(_0x4e03e6,null));};exports[_0xaebe('0x28')]=function(_0x567314,_0x5f2e09){return db[_0xaebe('0xa7')][_0xaebe('0x57')]({'where':{'id':_0x567314[_0xaebe('0xac')]['id']}})['then'](handleEntityNotFound(_0x5f2e09,null))[_0xaebe('0x27')](removeEntity(_0x5f2e09,null))['catch'](handleError(_0x5f2e09,null));};exports[_0xaebe('0xad')]=function(_0x31c931,_0x5d5a88){return db[_0xaebe('0xa7')][_0xaebe('0xad')]()[_0xaebe('0x27')](respondWithResult(_0x5d5a88,null))[_0xaebe('0xa5')](handleError(_0x5d5a88,null));};exports['addMessage']=function(_0x31ee41,_0x26b24b,_0x5cd04b){return db[_0xaebe('0xae')][_0xaebe('0x57')]({'where':{'id':_0x31ee41[_0xaebe('0xac')]['id']}})[_0xaebe('0x27')](handleEntityNotFound(_0x26b24b,null))[_0xaebe('0x27')](function(_0x3e9211){if(_0x3e9211){return _0x3e9211[_0xaebe('0xaf')](_0x31ee41['body'][_0xaebe('0xb0')],_['omit'](_0x31ee41['body'],[_0xaebe('0xb0'),'id'])||{});}})[_0xaebe('0x27')](respondWithResult(_0x26b24b,null))[_0xaebe('0xa5')](handleError(_0x26b24b,null));};exports[_0xaebe('0xb1')]=function(_0x7c4531,_0x421fc2,_0x33b756){var _0x85b7ba={'raw':![],'where':{}};var _0x552819={};var _0x55e0a6={'count':0x0,'rows':[]};return db[_0xaebe('0xa7')][_0xaebe('0xb2')]({'where':{'id':_0x7c4531[_0xaebe('0xac')]['id']}})[_0xaebe('0x27')](handleEntityNotFound(_0x421fc2,null))[_0xaebe('0x27')](function(_0x34891f){if(_0x34891f){_0x552819['model']=_[_0xaebe('0x35')](db[_0xaebe('0xae')][_0xaebe('0xa8')]);_0x552819[_0xaebe('0x34')]=_[_0xaebe('0x35')](_0x7c4531[_0xaebe('0x34')]);_0x552819[_0xaebe('0x36')]=_['intersection'](_0x552819[_0xaebe('0x38')],_0x552819[_0xaebe('0x34')]);_0x85b7ba[_0xaebe('0x3a')]=_[_0xaebe('0x37')](_0x552819['model'],qs[_0xaebe('0x39')](_0x7c4531[_0xaebe('0x34')]['fields']));_0x85b7ba[_0xaebe('0x3a')]=_0x85b7ba[_0xaebe('0x3a')][_0xaebe('0x3b')]?_0x85b7ba[_0xaebe('0x3a')]:_0x552819[_0xaebe('0x38')];if(!_0x7c4531[_0xaebe('0x34')][_0xaebe('0x3c')](_0xaebe('0x3d'))){_0x85b7ba[_0xaebe('0x1f')]=qs[_0xaebe('0x1f')](_0x7c4531[_0xaebe('0x34')]['limit']);_0x85b7ba[_0xaebe('0x1c')]=qs[_0xaebe('0x1c')](_0x7c4531[_0xaebe('0x34')][_0xaebe('0x1c')]);}_0x85b7ba[_0xaebe('0x3e')]=qs[_0xaebe('0x3f')](_0x7c4531[_0xaebe('0x34')][_0xaebe('0x3f')]);_0x85b7ba[_0xaebe('0x40')]=qs['filters'](_['pick'](_0x7c4531[_0xaebe('0x34')],_0x552819['filters']));_0x85b7ba['where']['SmsInteractionId']=_0x34891f['id'];if(_0x7c4531[_0xaebe('0x34')][_0xaebe('0x79')]){_0x85b7ba[_0xaebe('0x40')]=_['merge'](_0x85b7ba[_0xaebe('0x40')],{'$or':_['map'](_0x85b7ba[_0xaebe('0x3a')],function(_0x4112ca){var _0x28186c={};_0x28186c[_0x4112ca]={'$like':'%'+_0x7c4531[_0xaebe('0x34')][_0xaebe('0x79')]+'%'};return _0x28186c;})});}if(_0x7c4531[_0xaebe('0x34')][_0xaebe('0xb3')]){var _0x2b5a22=_0x7c4531[_0xaebe('0x34')][_0xaebe('0xb3')][_0xaebe('0x5e')](',');var _0x55468c={};_0x55468c[_0x2b5a22[0x0]]={'$gte':moment(_0x2b5a22[0x1])[_0xaebe('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x85b7ba['where']=_[_0xaebe('0x90')](_0x85b7ba[_0xaebe('0x40')],_0x55468c);}_0x85b7ba=_['merge']({},_0x85b7ba,_0x7c4531[_0xaebe('0xb5')]);return db[_0xaebe('0xae')]['count']({'where':_0x85b7ba['where']})['then'](function(_0x47d8fb){_0x55e0a6[_0xaebe('0x1e')]=_0x47d8fb;if(_0x7c4531[_0xaebe('0x34')]['includeAll']){_0x85b7ba['include']=[{'all':!![]}];}return db[_0xaebe('0xae')]['findAll'](_0x85b7ba);})[_0xaebe('0x27')](function(_0x4054bd){_0x55e0a6[_0xaebe('0xa4')]=_0x4054bd;return _0x55e0a6;});}})[_0xaebe('0x27')](respondWithFilteredResult(_0x421fc2,_0x85b7ba))[_0xaebe('0xa5')](handleError(_0x421fc2,null));};exports[_0xaebe('0xb6')]=function(_0x3b30d5,_0x58b0bf,_0x47320e){return db[_0xaebe('0xa7')][_0xaebe('0x57')]({'where':{'id':_0x3b30d5[_0xaebe('0xac')]['id']}})[_0xaebe('0x27')](handleEntityNotFound(_0x58b0bf,null))[_0xaebe('0x27')](function(_0x36fd38){if(_0x36fd38){return _0x36fd38[_0xaebe('0xb7')](_0x3b30d5[_0xaebe('0x6b')][_0xaebe('0xb0')],_[_0xaebe('0xb8')](_0x3b30d5[_0xaebe('0x6b')],[_0xaebe('0xb0'),'id'])||{})['spread'](function(){return db[_0xaebe('0x64')]['findAll']({'attributes':['id',_0xaebe('0x2a'),_0xaebe('0x43')],'where':{'id':_0x3b30d5[_0xaebe('0x6b')]['ids']}});})[_0xaebe('0x27')](function(_0x1d5049){socket[_0xaebe('0xb9')]('smsInteractionTags:save',{'id':Number(_0x3b30d5[_0xaebe('0xac')]['id']),'tags':_0x1d5049||[]});return{'id':Number(_0x3b30d5[_0xaebe('0xac')]['id']),'tags':_0x1d5049||[]};});}})['then'](respondWithResult(_0x58b0bf,null))[_0xaebe('0xa5')](handleError(_0x58b0bf,null));};exports['removeTags']=function(_0x398415,_0x5c932a,_0x8ad61d){return db[_0xaebe('0xa7')]['find']({'where':{'id':_0x398415[_0xaebe('0xac')]['id']}})[_0xaebe('0x27')](handleEntityNotFound(_0x5c932a,null))[_0xaebe('0x27')](function(_0x1cc1d8){if(_0x1cc1d8){return _0x1cc1d8[_0xaebe('0xba')](_0x398415['query'][_0xaebe('0xb0')]);}})[_0xaebe('0x27')](respondWithStatusCode(_0x5c932a,null))[_0xaebe('0xa5')](handleError(_0x5c932a,null));};exports[_0xaebe('0xbb')]=function(_0x165eb2,_0x1eb24e){var _0x2b658b=moment()[_0xaebe('0xbc')]()[_0xaebe('0x8e')]();var _0xc09329=path[_0xaebe('0xbd')](config[_0xaebe('0xbe')],_0xaebe('0xbf'),'files',_0xaebe('0xc0'));var _0x389934=path[_0xaebe('0xbd')](config[_0xaebe('0xbe')],_0xaebe('0xbf'),_0xaebe('0xc1'),_0xaebe('0xc2'));var _0x18484b=path[_0xaebe('0xbd')](_0xc09329,_0x2b658b);var _0x4dd1db=util[_0xaebe('0xb4')]('transcript-%d-%s.zip',_0x165eb2[_0xaebe('0xac')]['id'],_0x2b658b);var _0x356eed=path[_0xaebe('0xbd')](_0xc09329,_0x4dd1db);var _0x2ce2a4=[];_0x2ce2a4[_0xaebe('0x30')]({'model':db[_0xaebe('0xc3')],'as':_0xaebe('0xc3'),'attributes':['id',_0xaebe('0x2d')],'raw':!![]});_0x2ce2a4[_0xaebe('0x30')]({'model':db[_0xaebe('0xc4')],'as':_0xaebe('0xc5'),'attributes':['id','firstName',_0xaebe('0xc6')],'raw':!![]});var _0x1f4462=[{'model':db[_0xaebe('0xae')],'as':_0xaebe('0xc7'),'attributes':['id',_0xaebe('0x6b'),_0xaebe('0x71'),_0xaebe('0xc8'),_0xaebe('0xc9'),'read'],'include':_0x2ce2a4}];_0x1f4462[_0xaebe('0x30')]({'model':db[_0xaebe('0xca')],'as':_0xaebe('0xcb'),'attributes':['id',_0xaebe('0x2a')]});_0x1f4462[_0xaebe('0x30')]({'model':db[_0xaebe('0xc3')],'as':_0xaebe('0xcc'),'attributes':['id',_0xaebe('0x2d')]});return db[_0xaebe('0xa7')][_0xaebe('0x57')]({'where':{'id':_0x165eb2['params']['id']},'include':_0x1f4462})[_0xaebe('0x27')](handleEntityNotFound(_0x1eb24e,null))[_0xaebe('0x27')](function(_0x2dc4e9){if(_0x2dc4e9){var _0x4a124d=_0x2dc4e9[_0xaebe('0xcd')]({'plain':!![]});fs['mkdirSync'](_0x18484b);var _0x3e2f62={'channel':_0xaebe('0xce'),'account':_0x4a124d[_0xaebe('0xcb')][_0xaebe('0x2a')],'agent':_0x4a124d[_0xaebe('0xcc')]?_0x4a124d[_0xaebe('0xcc')][_0xaebe('0x2d')]:'N.A.','createdAt':moment(_0x4a124d[_0xaebe('0x71')])[_0xaebe('0xb4')](_0xaebe('0xcf'))[_0xaebe('0x8e')](),'closedAt':_0x4a124d[_0xaebe('0xd0')]?moment(_0x4a124d[_0xaebe('0xd1')])[_0xaebe('0xb4')](_0xaebe('0xcf'))[_0xaebe('0x8e')]():'','disposition':_0x4a124d[_0xaebe('0xd2')],'messages':_(_0x4a124d[_0xaebe('0xc7')])[_0xaebe('0x79')]({'secret':![]})[_0xaebe('0x31')](function(_0x5b3311){return{'date':moment(_0x5b3311[_0xaebe('0x71')])[_0xaebe('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xaebe('0x8e')](),'sender':_0x5b3311[_0xaebe('0xc8')]===_0xaebe('0xd3')?_0x5b3311['User']?_0x5b3311[_0xaebe('0xc3')][_0xaebe('0x2d')]:'System':_0x5b3311['Contact']['firstName']+(_0x5b3311[_0xaebe('0xc5')][_0xaebe('0xc6')]?'\x20'+_0x5b3311[_0xaebe('0xc5')][_0xaebe('0xc6')]:''),'body':_0x5b3311[_0xaebe('0x6b')],'direction':_0x5b3311[_0xaebe('0xc8')]===_0xaebe('0xd3')?'A':'C','secret':_0x5b3311[_0xaebe('0xc9')],'read':_0x5b3311[_0xaebe('0x74')]};})[_0xaebe('0x59')]()};return ejs['renderFile'](path[_0xaebe('0xbd')](config[_0xaebe('0xbe')],_0xaebe('0xbf'),_0xaebe('0xd4'),_0xaebe('0xd5')),{'interaction':_0x3e2f62})[_0xaebe('0x27')](function(_0x52cb37){var _0xd33b1=path['join'](_0x18484b,_0xaebe('0xd6')+_0x4a124d['id']+'-'+_0x2b658b+_0xaebe('0xd7'));var _0x379d4e={'path':_0xd33b1,'channel':'Sms','interactionId':_0x4a124d['id']};return pdf[_0xaebe('0xd8')](_0x52cb37,_0x379d4e);})[_0xaebe('0x27')](function(){return new BPromise(function(_0x370744,_0x11686a){zipdir(_0x18484b,{'saveTo':_0x356eed},function(_0x3b837c,_0x289262){if(_0x3b837c)return _0x11686a(_0x3b837c);return _0x370744(_0x289262);});})[_0xaebe('0x27')](function(){return new BPromise(function(_0x29d05b,_0x1649ae){rimraf(_0x18484b,function(_0x3d2799){if(_0x3d2799)_0x1649ae(_0x3d2799);return _0x29d05b();});});})[_0xaebe('0x27')](function(){return _0x1eb24e[_0xaebe('0xbb')](_0x356eed,_0x4dd1db,function(_0x3498a5){if(_0x3498a5){console[_0xaebe('0xd9')]('err',_0x3498a5);}else{fs[_0xaebe('0xda')](_0x356eed);}});});});}else{return _0x1eb24e[_0xaebe('0x19')](0xc8);}})[_0xaebe('0xa5')](handleError(_0x1eb24e,null));}; \ No newline at end of file +var _0xfbf1=['ui.SmsInteractionId','from','user_has_sms_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','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`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','Sequelize','QueryTypes','SELECT','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\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','Contact.firstName','Contact.email','c.phone','Contact.phone','Contact.fax','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','rows','show','params','include','options','catch','create','update','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','SmsAccount','get','mkdirSync','Account','Owner','N.A.','closed','disposition','out','System','secret','views','transcript-','.pdf','Sms','log','err','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','fs-extra','squel','querystring','papaparse','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','./smsInteraction.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','Users','map','fullname','TagIds','split','forEach','index','SmsInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','tools_tags','u.id','u.fullname'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xfbf1,0x16b));var _0x1fbf=function(_0x39aa7f,_0x15a055){_0x39aa7f=_0x39aa7f-0x0;var _0xe16b14=_0xfbf1[_0x39aa7f];return _0xe16b14;};'use strict';var emlformat=require(_0x1fbf('0x0'));var rimraf=require(_0x1fbf('0x1'));var zipdir=require(_0x1fbf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fbf('0x3'));var moment=require(_0x1fbf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1fbf('0x5'));var util=require('util');var path=require(_0x1fbf('0x6'));var sox=require('sox');var csv=require(_0x1fbf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fbf('0x8'));var _=require('lodash');var squel=require(_0x1fbf('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1fbf('0x7'));var querystring=require(_0x1fbf('0xa'));var Papa=require(_0x1fbf('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1fbf('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fbf('0xd'))(_0x1fbf('0xe'));var utils=require(_0x1fbf('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x1fbf('0x10'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fbf('0x11')]));require(_0x1fbf('0x12'))[_0x1fbf('0x13')](socket);function respondWithStatusCode(_0x45bd0a,_0x46ccd6){_0x46ccd6=_0x46ccd6||0xcc;return function(_0x8f0ace){if(_0x8f0ace){return _0x45bd0a[_0x1fbf('0x14')](_0x46ccd6);}return _0x45bd0a['status'](_0x46ccd6)[_0x1fbf('0x15')]();};}function respondWithResult(_0xa342b,_0x3dde1c){_0x3dde1c=_0x3dde1c||0xc8;return function(_0x4f6a51){if(_0x4f6a51){return _0xa342b[_0x1fbf('0x16')](_0x3dde1c)['json'](_0x4f6a51);}};}function respondWithFilteredResult(_0x24e4d1,_0x4049de){return function(_0x3a5305){if(_0x3a5305){var _0x5e2692=typeof _0x4049de[_0x1fbf('0x17')]==='undefined'&&typeof _0x4049de['limit']===_0x1fbf('0x18');var _0x40164e=_0x3a5305[_0x1fbf('0x19')];var _0x3b8b8b=_0x5e2692?0x0:_0x4049de[_0x1fbf('0x17')];var _0x40e196=_0x5e2692?_0x3a5305[_0x1fbf('0x19')]:_0x4049de[_0x1fbf('0x17')]+_0x4049de[_0x1fbf('0x1a')];var _0x510281;if(_0x40e196>=_0x40164e){_0x40e196=_0x40164e;_0x510281=0xc8;}else{_0x510281=0xce;}_0x24e4d1[_0x1fbf('0x16')](_0x510281);return _0x24e4d1[_0x1fbf('0x1b')](_0x1fbf('0x1c'),_0x3b8b8b+'-'+_0x40e196+'/'+_0x40164e)[_0x1fbf('0x1d')](_0x3a5305);}return null;};}function patchUpdates(_0x3222d2){return function(_0x57c445){try{jsonpatch[_0x1fbf('0x1e')](_0x57c445,_0x3222d2,!![]);}catch(_0x58570e){return BPromise[_0x1fbf('0x1f')](_0x58570e);}return _0x57c445[_0x1fbf('0x20')]();};}function saveUpdates(_0x624bb4,_0x3a3e5e){return function(_0x5dcf6e){if(_0x5dcf6e){return _0x5dcf6e['update'](_0x624bb4)[_0x1fbf('0x21')](function(_0x5aa2bf){return _0x5aa2bf;});}return null;};}function removeEntity(_0x4ceae6,_0x4357e0){return function(_0x2c790f){if(_0x2c790f){return _0x2c790f[_0x1fbf('0x22')]()[_0x1fbf('0x21')](function(){_0x4ceae6[_0x1fbf('0x16')](0xcc)[_0x1fbf('0x15')]();});}};}function handleEntityNotFound(_0x3bb62c,_0x4315aa){return function(_0x116bf9){if(!_0x116bf9){_0x3bb62c[_0x1fbf('0x14')](0x194);}return _0x116bf9;};}function handleError(_0x55ccd8,_0x4d31bc){_0x4d31bc=_0x4d31bc||0x1f4;return function(_0x42a982){logger[_0x1fbf('0x23')](_0x42a982['stack']);if(_0x42a982[_0x1fbf('0x24')]){delete _0x42a982[_0x1fbf('0x24')];}_0x55ccd8['status'](_0x4d31bc)[_0x1fbf('0x25')](_0x42a982);};}function getInteractionUsers(_0x3c406a,_0x11c20a){return new BPromise(function(_0x144f90,_0x452f8d){try{if(_0x11c20a[_0x3c406a['id']]){_0x3c406a[_0x1fbf('0x26')]=_[_0x1fbf('0x27')](_0x11c20a[_0x3c406a['id']],function(_0x18472f){return{'id':_0x18472f['id'],'fullname':_0x18472f[_0x1fbf('0x28')]};});}}catch(_0x99a0c0){_0x452f8d(_0x99a0c0);}_0x144f90(_0x3c406a);});}function getInteractionTags(_0x3e3ae4,_0x31eae2){return new BPromise(function(_0x1fe165,_0x1045df){try{if(_0x3e3ae4[_0x1fbf('0x29')]){_0x3e3ae4['Tags']=[];_0x3e3ae4[_0x1fbf('0x29')][_0x1fbf('0x2a')](',')[_0x1fbf('0x2b')](function(_0x1bcb28){_0x3e3ae4['Tags']['push'](_0x31eae2[_0x1bcb28]);});}delete _0x3e3ae4[_0x1fbf('0x29')];}catch(_0xf58e8f){_0x1045df(_0xf58e8f);}_0x1fe165(_0x3e3ae4);});}function updateSmsInteraction(_0x1ed798,_0x434376,_0x57aff4){return new BPromise(function(_0x4d18af,_0x53f7c1){return getInteractionUsers(_0x1ed798,_0x57aff4)[_0x1fbf('0x21')](function(_0x8973aa){return getInteractionTags(_0x8973aa,_0x434376);})[_0x1fbf('0x21')](function(_0x4d28b7){_0x4d18af(_0x4d28b7);})['catch'](function(_0xc1c64e){_0x53f7c1(_0xc1c64e);});});}exports[_0x1fbf('0x2c')]=function(_0x17da08,_0x2d81dc){var _0x5235e4={},_0x15fca4={},_0x38c6d1={'count':0x0,'rows':[]};var _0x2b40d6=_[_0x1fbf('0x27')](db[_0x1fbf('0x2d')][_0x1fbf('0x2e')],function(_0x3d28d2){return{'name':_0x3d28d2[_0x1fbf('0x2f')],'type':_0x3d28d2[_0x1fbf('0x30')]['key']};});_0x15fca4[_0x1fbf('0x31')]=_[_0x1fbf('0x27')](_0x2b40d6,_0x1fbf('0x24'));_0x15fca4[_0x1fbf('0x32')]=_[_0x1fbf('0x33')](_0x17da08[_0x1fbf('0x32')]);_0x15fca4[_0x1fbf('0x34')]=_[_0x1fbf('0x35')](_0x15fca4[_0x1fbf('0x31')],_0x15fca4[_0x1fbf('0x32')]);_0x5235e4[_0x1fbf('0x36')]=_[_0x1fbf('0x35')](_0x15fca4['model'],qs['fields'](_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x37')]));_0x5235e4['attributes']=_0x5235e4[_0x1fbf('0x36')][_0x1fbf('0x38')]?_0x5235e4[_0x1fbf('0x36')]:_0x15fca4['model'];if(!_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x39')]('nolimit')){_0x5235e4['limit']=qs['limit'](_0x17da08['query'][_0x1fbf('0x1a')]);_0x5235e4[_0x1fbf('0x17')]=qs['offset'](_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x17')]);}_0x5235e4[_0x1fbf('0x3a')]=qs[_0x1fbf('0x3b')](_0x17da08['query']['sort']);_0x5235e4[_0x1fbf('0x3c')]=qs[_0x1fbf('0x34')](_['pick'](_0x17da08[_0x1fbf('0x32')],_0x15fca4['filters']),_0x2b40d6);var _0x195aa1=[];var _0x24a109=squel[_0x1fbf('0x3d')]()['field']('id')['field'](_0x1fbf('0x24'))[_0x1fbf('0x3e')](_0x1fbf('0x3f'))['from'](_0x1fbf('0x40'));var _0x49dcb5=squel['select']()[_0x1fbf('0x3e')](_0x1fbf('0x41'))['field'](_0x1fbf('0x42'))[_0x1fbf('0x3e')](_0x1fbf('0x43'))[_0x1fbf('0x44')](_0x1fbf('0x45'),'ui')[_0x1fbf('0x46')](_0x1fbf('0x47'),'u',_0x1fbf('0x48'));var _0x1df6c8=squel[_0x1fbf('0x3d')]()[_0x1fbf('0x44')]('sms_interactions','i')[_0x1fbf('0x46')](_0x1fbf('0x49'),'c',_0x1fbf('0x4a'))['left_join'](_0x1fbf('0x47'),'o',_0x1fbf('0x4b'))['left_join'](_0x1fbf('0x4c'),'a',_0x1fbf('0x4d'))['left_join'](_0x1fbf('0x4e'),'me',_0x1fbf('0x4f'))[_0x1fbf('0x46')]('sms_interaction_has_tags','it',_0x1fbf('0x50'))[_0x1fbf('0x46')](_0x1fbf('0x40'),'t',_0x1fbf('0x51'));var _0x48f460=squel[_0x1fbf('0x52')]();var _0x452f01=[];var _0x3c577b=squel[_0x1fbf('0x52')]();var _0x4f0c05;if(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x53')]){_0x4f0c05=as[_0x1fbf('0x54')](_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x53')]);var _0x5b6ce6=_0x4f0c05[_0x1fbf('0x55')];for(var _0x572871=0x0;_0x572871<_0x4f0c05[_0x1fbf('0x56')][_0x1fbf('0x38')];_0x572871++){var _0x14ce3d=_0x4f0c05[_0x1fbf('0x56')][_0x572871];var _0x4eb2ce='i';var _0x142a6c=_['find'](_0x2b40d6,[_0x1fbf('0x24'),_0x14ce3d[_0x1fbf('0x3e')]]);if(!_0x142a6c){switch(_0x14ce3d['field']){case _0x1fbf('0x57'):if(_0x14ce3d['value']==0x1){_0x1df6c8['having']('`'+_0x14ce3d['field']+'`\x20=\x200');}else{_0x1df6c8[_0x1fbf('0x58')]('`'+_0x14ce3d[_0x1fbf('0x3e')]+_0x1fbf('0x59'));}break;case _0x1fbf('0x5a'):if(_0x14ce3d[_0x1fbf('0x5b')]===_0x1fbf('0x5c')){if(_0x14ce3d[_0x1fbf('0x5d')][_0x1fbf('0x2a')]('\x20')[_0x1fbf('0x38')]>0x1){_0x48f460[_0x5b6ce6](_0x1fbf('0x5e'),qs[_0x1fbf('0x5f')](_0x14ce3d[_0x1fbf('0x5d')]),null);}else{var _0x59299d='%'+_0x14ce3d[_0x1fbf('0x5d')]+'%';_0x48f460[_0x5b6ce6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x59299d,_0x59299d,_0x59299d);}}else{_0x142a6c=_[_0x1fbf('0x60')](_0x2b40d6,[_0x1fbf('0x24'),_0x1fbf('0x61')]);_0x14ce3d[_0x1fbf('0x3e')]=_0x1fbf('0x61');_0x548fc5=as[_0x1fbf('0x62')](_0x4eb2ce,_0x142a6c['type'],_0x14ce3d);_0x48f460[_0x5b6ce6](_0x548fc5[_0x1fbf('0x63')],_0x548fc5[_0x1fbf('0x5d')][_0x1fbf('0x64')],_0x548fc5[_0x1fbf('0x5d')][_0x1fbf('0x15')]);}break;case'Tag':var _0x2590ba=_0x14ce3d[_0x1fbf('0x5d')]['split'](',')['map'](function(_0x491f59){return Number(_0x491f59);});_0x2590ba[_0x1fbf('0x2b')](function(_0x457cd0){_0x3c577b['or'](_0x1fbf('0x65'),'%,'+_0x457cd0+',%');});_0x452f01=_['union'](_0x452f01,_0x2590ba);break;case _0x1fbf('0x66'):if(_0x14ce3d[_0x1fbf('0x5b')]===_0x1fbf('0x5c')){_0x48f460[_0x5b6ce6](_0x1fbf('0x67'),'%'+_0x14ce3d[_0x1fbf('0x5d')]+'%',null);}else{_0x142a6c=_[_0x1fbf('0x60')](_0x2b40d6,[_0x1fbf('0x24'),_0x1fbf('0x68')]);_0x14ce3d[_0x1fbf('0x3e')]=_0x1fbf('0x68');_0x548fc5=as[_0x1fbf('0x62')](_0x4eb2ce,_0x142a6c[_0x1fbf('0x30')],_0x14ce3d);_0x48f460[_0x5b6ce6](_0x548fc5[_0x1fbf('0x63')],_0x548fc5[_0x1fbf('0x5d')][_0x1fbf('0x64')],_0x548fc5['value'][_0x1fbf('0x15')]);}break;case _0x1fbf('0x69'):_0x548fc5=as[_0x1fbf('0x62')]('me',null,_0x14ce3d);_0x48f460[_0x5b6ce6](_0x548fc5['text'],_0x548fc5[_0x1fbf('0x5d')]['start'],_0x548fc5['value'][_0x1fbf('0x15')]);break;}}else{var _0x548fc5=as[_0x1fbf('0x62')](_0x4eb2ce,_0x142a6c[_0x1fbf('0x30')],_0x14ce3d);_0x48f460[_0x5b6ce6](_0x548fc5[_0x1fbf('0x63')],_0x548fc5[_0x1fbf('0x5d')]['start'],_0x548fc5[_0x1fbf('0x5d')][_0x1fbf('0x15')]);}}}else{var _0x612870=_(_0x17da08[_0x1fbf('0x32')])[_0x1fbf('0x33')]()[_0x1fbf('0x27')](function(_0x34e216){return _[_0x1fbf('0x6a')](_0x2b40d6,['name',_0x34e216])?_0x34e216:undefined;})[_0x1fbf('0x6b')]()['value']();if(!_[_0x1fbf('0x6c')](_0x612870)){_0x612870[_0x1fbf('0x2b')](function(_0x128979){if(_0x128979===_0x1fbf('0x6d')){_0x1df6c8[_0x1fbf('0x3c')](_0x1fbf('0x6e'),[][_0x1fbf('0x6f')](_0x17da08[_0x1fbf('0x32')][_0x128979]));}else if(_0x128979===_0x1fbf('0x70')){var _0x384a4d=JSON[_0x1fbf('0x71')](_0x17da08[_0x1fbf('0x32')][_0x128979])[_0x1fbf('0x72')];var _0x2fad46=JSON[_0x1fbf('0x71')](_0x17da08[_0x1fbf('0x32')][_0x128979])['$lte'];_0x1df6c8['where'](_0x1fbf('0x73'),_0x384a4d,_0x2fad46);}else{if(_0x17da08[_0x1fbf('0x32')][_0x128979]==='null'){_0x1df6c8[_0x1fbf('0x3c')]('i.'+_0x128979+_0x1fbf('0x74'));}else{_0x1df6c8[_0x1fbf('0x3c')]('i.'+_0x128979+_0x1fbf('0x75'),_0x17da08[_0x1fbf('0x32')][_0x128979]);}}});}if(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x76')]){if(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x76')]==0x1){_0x1df6c8[_0x1fbf('0x58')](_0x1fbf('0x77'));}else{_0x1df6c8['having']('`unreadMessages`\x20>\x200');}}if(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x78')]){_0x452f01=_[_0x1fbf('0x79')](_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x78')])?_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x78')]:new Array(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x78')]);_0x452f01['forEach'](function(_0x40c3ae){_0x3c577b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x40c3ae+',%');});}if(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x7a')]){var _0x18bea9=_0x17da08[_0x1fbf('0x32')]['filter'][_0x1fbf('0x7b')]('\x5c','\x5c\x5c')[_0x1fbf('0x7b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x18bea9)){_0x48f460['or'](_0x1fbf('0x7c'),_0x18bea9+'%')['or'](_0x1fbf('0x7d'),_0x18bea9+'%');}else{_0x48f460['or'](_0x1fbf('0x7e'),qs[_0x1fbf('0x5f')](_0x18bea9))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x18bea9+'%');}}}_0x1df6c8[_0x1fbf('0x3c')](_0x48f460);_0x1df6c8[_0x1fbf('0x7f')]('i.id');var _0x14b8e0={'type':db[_0x1fbf('0x80')][_0x1fbf('0x81')][_0x1fbf('0x82')],'raw':!![]};var _0x39bbb3=_0x1df6c8['clone']();_0x39bbb3[_0x1fbf('0x3e')]('i.id');_0x39bbb3[_0x1fbf('0x3e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1fbf('0x57'));if(_0x5235e4[_0x1fbf('0x3a')]){_0x5235e4[_0x1fbf('0x3a')][_0x1fbf('0x2b')](function(_0x127ea9){var _0x3ba552=_0x127ea9[0x0]===_0x1fbf('0x83')?_0x127ea9[0x0]:'i.'+_0x127ea9[0x0];_0x1df6c8[_0x1fbf('0x3a')](_0x3ba552,_0x127ea9[0x1]===_0x1fbf('0x84')?![]:!![]);});}if(!_['isEmpty'](_0x452f01)){_0x1df6c8[_0x1fbf('0x58')](_0x3c577b);_0x39bbb3[_0x1fbf('0x3c')]('t.id\x20IN\x20?',_0x452f01);}BPromise[_0x1fbf('0x85')]()[_0x1fbf('0x21')](function(){if(!_0x4f0c05){if(_0x17da08['query']['SmsAccountId'])return;_0x39bbb3[_0x1fbf('0x3c')](_0x1fbf('0x86'));_0x1df6c8[_0x1fbf('0x3c')](_0x1fbf('0x86'));return;}if(_0x17da08[_0x1fbf('0x87')][_0x1fbf('0x88')]!==_0x1fbf('0x89'))return;return _0x17da08[_0x1fbf('0x87')][_0x1fbf('0x8a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29bc5c){if(_[_0x1fbf('0x6c')](_0x29bc5c)){_0x39bbb3['where'](_0x1fbf('0x8b'));_0x1df6c8[_0x1fbf('0x3c')](_0x1fbf('0x8b'));}else{_0x39bbb3[_0x1fbf('0x3c')](_0x1fbf('0x6e'),_[_0x1fbf('0x27')](_0x29bc5c,'id'));_0x1df6c8[_0x1fbf('0x3c')](_0x1fbf('0x6e'),_[_0x1fbf('0x27')](_0x29bc5c,'id'));}});})['then'](function(){if(_0x17da08[_0x1fbf('0x87')][_0x1fbf('0x88')]===_0x1fbf('0x89')&&!_0x4f0c05&&!_0x17da08[_0x1fbf('0x32')]['SmsAccountId'])return[];return db[_0x1fbf('0x8c')][_0x1fbf('0x32')](_0x39bbb3['toString'](),_0x14b8e0);})['then'](function(_0x51a0f4){_0x38c6d1[_0x1fbf('0x19')]=_0x51a0f4[_0x1fbf('0x38')];if(_0x38c6d1[_0x1fbf('0x19')]===0x0)return[];return db[_0x1fbf('0x8c')][_0x1fbf('0x32')](_0x24a109[_0x1fbf('0x8d')](),_0x14b8e0)[_0x1fbf('0x21')](function(_0x1fea15){_0x195aa1=_[_0x1fbf('0x8e')](_0x1fea15,'id');_0x14b8e0=_[_0x1fbf('0x8f')](_0x14b8e0,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17da08[_0x1fbf('0x32')][_0x1fbf('0x37')]){_0x5235e4[_0x1fbf('0x36')][_0x1fbf('0x2b')](function(_0x50e600){_0x1df6c8['field']('i.'+_0x50e600);});}else{_0x1df6c8[_0x1fbf('0x3e')](_0x1fbf('0x90'),_0x1fbf('0x57'));_0x1df6c8['field'](_0x1fbf('0x91'),_0x1fbf('0x92'));_0x1df6c8['field'](_0x1fbf('0x93'),_0x1fbf('0x94'));_0x1df6c8[_0x1fbf('0x3e')]('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',_0x1fbf('0x83'));_0x1df6c8['field']('i.*');_0x1df6c8[_0x1fbf('0x3e')]('c.firstName',_0x1fbf('0x95'));_0x1df6c8[_0x1fbf('0x3e')]('c.lastName','Contact.lastName');_0x1df6c8['field']('c.email',_0x1fbf('0x96'));_0x1df6c8['field'](_0x1fbf('0x97'),_0x1fbf('0x98'));_0x1df6c8[_0x1fbf('0x3e')]('c.mobile','Contact.mobile');_0x1df6c8[_0x1fbf('0x3e')]('c.fax',_0x1fbf('0x99'));_0x1df6c8[_0x1fbf('0x3e')]('o.fullname','Owner.fullname');_0x1df6c8[_0x1fbf('0x3e')]('o.internal',_0x1fbf('0x9a'));_0x1df6c8[_0x1fbf('0x3e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1fbf('0x29'));}if(_0x5235e4[_0x1fbf('0x1a')])_0x1df6c8[_0x1fbf('0x1a')](_0x5235e4[_0x1fbf('0x1a')]);if(_0x5235e4[_0x1fbf('0x17')])_0x1df6c8['offset'](_0x5235e4['offset']);return db[_0x1fbf('0x8c')][_0x1fbf('0x32')](_0x1df6c8[_0x1fbf('0x8d')](),_0x14b8e0);})[_0x1fbf('0x21')](function(_0x3c10c6){if(_0x3c10c6[_0x1fbf('0x38')]>0x0)_0x49dcb5[_0x1fbf('0x3c')](_0x1fbf('0x9b'),_[_0x1fbf('0x27')](_0x3c10c6,'id'));return db['sequelize'][_0x1fbf('0x32')](_0x49dcb5[_0x1fbf('0x8d')](),_0x14b8e0)['then'](function(_0x20029d){var _0x2b4680=_[_0x1fbf('0x9c')](_0x20029d,_0x1fbf('0x9d'));var _0x131e39=[];_0x3c10c6[_0x1fbf('0x2b')](function(_0xc08340){_0x131e39[_0x1fbf('0x9e')](updateSmsInteraction(_0xc08340,_0x195aa1,_0x2b4680));});return BPromise['all'](_0x131e39);});});})[_0x1fbf('0x21')](function(_0x3fada6){_0x38c6d1[_0x1fbf('0x9f')]=_0x3fada6;return _0x38c6d1;})[_0x1fbf('0x21')](respondWithFilteredResult(_0x2d81dc,_0x5235e4))['catch'](handleError(_0x2d81dc,null));};exports[_0x1fbf('0xa0')]=function(_0x247f21,_0x1c4f06){var _0x41b141={'raw':![],'where':{'id':_0x247f21[_0x1fbf('0xa1')]['id']}},_0x1aa498={};_0x1aa498[_0x1fbf('0x31')]=_[_0x1fbf('0x33')](db[_0x1fbf('0x2d')]['rawAttributes']);_0x1aa498[_0x1fbf('0x32')]=_[_0x1fbf('0x33')](_0x247f21[_0x1fbf('0x32')]);_0x1aa498[_0x1fbf('0x34')]=_['intersection'](_0x1aa498[_0x1fbf('0x31')],_0x1aa498[_0x1fbf('0x32')]);_0x41b141[_0x1fbf('0x36')]=_['intersection'](_0x1aa498[_0x1fbf('0x31')],qs[_0x1fbf('0x37')](_0x247f21['query'][_0x1fbf('0x37')]));_0x41b141['attributes']=_0x41b141[_0x1fbf('0x36')][_0x1fbf('0x38')]?_0x41b141[_0x1fbf('0x36')]:_0x1aa498[_0x1fbf('0x31')];if(_0x247f21[_0x1fbf('0x32')]['includeAll']){_0x41b141[_0x1fbf('0xa2')]=[{'all':!![]}];}_0x41b141=_[_0x1fbf('0x8f')]({},_0x41b141,_0x247f21[_0x1fbf('0xa3')]);return db[_0x1fbf('0x2d')][_0x1fbf('0x60')](_0x41b141)['then'](handleEntityNotFound(_0x1c4f06,null))[_0x1fbf('0x21')](respondWithResult(_0x1c4f06,null))[_0x1fbf('0xa4')](handleError(_0x1c4f06,null));};exports[_0x1fbf('0xa5')]=function(_0x52d8ac,_0x31339a){return db[_0x1fbf('0x2d')]['create'](_0x52d8ac['body'],{})[_0x1fbf('0x21')](respondWithResult(_0x31339a,0xc9))[_0x1fbf('0xa4')](handleError(_0x31339a,null));};exports[_0x1fbf('0xa6')]=function(_0x120fe4,_0x4a1ae1){if(_0x120fe4[_0x1fbf('0x69')]['id']){delete _0x120fe4[_0x1fbf('0x69')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x120fe4['params']['id']}})['then'](handleEntityNotFound(_0x4a1ae1,null))[_0x1fbf('0x21')](saveUpdates(_0x120fe4[_0x1fbf('0x69')],null))[_0x1fbf('0x21')](respondWithResult(_0x4a1ae1,null))[_0x1fbf('0xa4')](handleError(_0x4a1ae1,null));};exports['destroy']=function(_0x298020,_0x159180){return db[_0x1fbf('0x2d')]['find']({'where':{'id':_0x298020[_0x1fbf('0xa1')]['id']}})['then'](handleEntityNotFound(_0x159180,null))['then'](removeEntity(_0x159180,null))['catch'](handleError(_0x159180,null));};exports[_0x1fbf('0xa7')]=function(_0x522a33,_0xa97683){return db[_0x1fbf('0x2d')][_0x1fbf('0xa7')]()[_0x1fbf('0x21')](respondWithResult(_0xa97683,null))[_0x1fbf('0xa4')](handleError(_0xa97683,null));};exports[_0x1fbf('0xa8')]=function(_0x3bdcae,_0x7f1049,_0x15856d){return db[_0x1fbf('0xa9')][_0x1fbf('0x60')]({'where':{'id':_0x3bdcae[_0x1fbf('0xa1')]['id']}})[_0x1fbf('0x21')](handleEntityNotFound(_0x7f1049,null))[_0x1fbf('0x21')](function(_0x323046){if(_0x323046){return _0x323046[_0x1fbf('0xa8')](_0x3bdcae['body'][_0x1fbf('0xaa')],_[_0x1fbf('0xab')](_0x3bdcae[_0x1fbf('0x69')],[_0x1fbf('0xaa'),'id'])||{});}})[_0x1fbf('0x21')](respondWithResult(_0x7f1049,null))['catch'](handleError(_0x7f1049,null));};exports[_0x1fbf('0xac')]=function(_0x3d0b8e,_0x1c3c40,_0x2a6b03){var _0xa9e329={'raw':![],'where':{}};var _0x2170aa={};var _0x466d2c={'count':0x0,'rows':[]};return db[_0x1fbf('0x2d')][_0x1fbf('0xad')]({'where':{'id':_0x3d0b8e[_0x1fbf('0xa1')]['id']}})[_0x1fbf('0x21')](handleEntityNotFound(_0x1c3c40,null))[_0x1fbf('0x21')](function(_0x3846f0){if(_0x3846f0){_0x2170aa[_0x1fbf('0x31')]=_[_0x1fbf('0x33')](db[_0x1fbf('0xa9')][_0x1fbf('0x2e')]);_0x2170aa['query']=_['keys'](_0x3d0b8e['query']);_0x2170aa['filters']=_['intersection'](_0x2170aa[_0x1fbf('0x31')],_0x2170aa[_0x1fbf('0x32')]);_0xa9e329[_0x1fbf('0x36')]=_['intersection'](_0x2170aa[_0x1fbf('0x31')],qs['fields'](_0x3d0b8e[_0x1fbf('0x32')]['fields']));_0xa9e329[_0x1fbf('0x36')]=_0xa9e329[_0x1fbf('0x36')][_0x1fbf('0x38')]?_0xa9e329[_0x1fbf('0x36')]:_0x2170aa[_0x1fbf('0x31')];if(!_0x3d0b8e[_0x1fbf('0x32')]['hasOwnProperty']('nolimit')){_0xa9e329[_0x1fbf('0x1a')]=qs[_0x1fbf('0x1a')](_0x3d0b8e['query']['limit']);_0xa9e329['offset']=qs['offset'](_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0x17')]);}_0xa9e329[_0x1fbf('0x3a')]=qs['sort'](_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0x3b')]);_0xa9e329[_0x1fbf('0x3c')]=qs[_0x1fbf('0x34')](_[_0x1fbf('0xae')](_0x3d0b8e[_0x1fbf('0x32')],_0x2170aa[_0x1fbf('0x34')]));_0xa9e329['where'][_0x1fbf('0x9d')]=_0x3846f0['id'];if(_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0x7a')]){_0xa9e329[_0x1fbf('0x3c')]=_[_0x1fbf('0x8f')](_0xa9e329['where'],{'$or':_[_0x1fbf('0x27')](_0xa9e329[_0x1fbf('0x36')],function(_0x374aa9){var _0x4c57e4={};_0x4c57e4[_0x374aa9]={'$like':'%'+_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0x7a')]+'%'};return _0x4c57e4;})});}if(_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0x72')]){var _0x25f34e=_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0x72')]['split'](',');var _0x450d39={};_0x450d39[_0x25f34e[0x0]]={'$gte':moment(_0x25f34e[0x1])[_0x1fbf('0xaf')](_0x1fbf('0xb0'))};_0xa9e329['where']=_[_0x1fbf('0x8f')](_0xa9e329[_0x1fbf('0x3c')],_0x450d39);}_0xa9e329=_['merge']({},_0xa9e329,_0x3d0b8e['options']);return db[_0x1fbf('0xa9')][_0x1fbf('0x19')]({'where':_0xa9e329[_0x1fbf('0x3c')]})[_0x1fbf('0x21')](function(_0x565898){_0x466d2c[_0x1fbf('0x19')]=_0x565898;if(_0x3d0b8e[_0x1fbf('0x32')][_0x1fbf('0xb1')]){_0xa9e329[_0x1fbf('0xa2')]=[{'all':!![]}];}return db[_0x1fbf('0xa9')][_0x1fbf('0xb2')](_0xa9e329);})['then'](function(_0x4c0a43){_0x466d2c[_0x1fbf('0x9f')]=_0x4c0a43;return _0x466d2c;});}})[_0x1fbf('0x21')](respondWithFilteredResult(_0x1c3c40,_0xa9e329))[_0x1fbf('0xa4')](handleError(_0x1c3c40,null));};exports[_0x1fbf('0xb3')]=function(_0x3de80e,_0x1fac10,_0x45bc2f){return db['SmsInteraction'][_0x1fbf('0x60')]({'where':{'id':_0x3de80e[_0x1fbf('0xa1')]['id']}})[_0x1fbf('0x21')](handleEntityNotFound(_0x1fac10,null))[_0x1fbf('0x21')](function(_0x466ef4){if(_0x466ef4){return _0x466ef4[_0x1fbf('0xb4')](_0x3de80e['body'][_0x1fbf('0xaa')],_[_0x1fbf('0xab')](_0x3de80e[_0x1fbf('0x69')],['ids','id'])||{})[_0x1fbf('0xb5')](function(){return db['Tag'][_0x1fbf('0xb2')]({'attributes':['id',_0x1fbf('0x24'),_0x1fbf('0x3f')],'where':{'id':_0x3de80e['body'][_0x1fbf('0xaa')]}});})[_0x1fbf('0x21')](function(_0x372a4a){socket[_0x1fbf('0xb6')](_0x1fbf('0xb7'),{'id':Number(_0x3de80e['params']['id']),'tags':_0x372a4a||[]});return{'id':Number(_0x3de80e[_0x1fbf('0xa1')]['id']),'tags':_0x372a4a||[]};});}})['then'](respondWithResult(_0x1fac10,null))[_0x1fbf('0xa4')](handleError(_0x1fac10,null));};exports[_0x1fbf('0xb8')]=function(_0x51573e,_0x2df110,_0x2d8939){return db[_0x1fbf('0x2d')]['find']({'where':{'id':_0x51573e[_0x1fbf('0xa1')]['id']}})[_0x1fbf('0x21')](handleEntityNotFound(_0x2df110,null))['then'](function(_0x1aa393){if(_0x1aa393){return _0x1aa393[_0x1fbf('0xb8')](_0x51573e[_0x1fbf('0x32')]['ids']);}})[_0x1fbf('0x21')](respondWithStatusCode(_0x2df110,null))[_0x1fbf('0xa4')](handleError(_0x2df110,null));};exports[_0x1fbf('0xb9')]=function(_0x54846f,_0x4f062c){var _0x522364=moment()['unix']()[_0x1fbf('0x8d')]();var _0x518c7=path[_0x1fbf('0xba')](config[_0x1fbf('0xbb')],_0x1fbf('0xbc'),_0x1fbf('0xbd'),_0x1fbf('0xbe'));var _0x34c341=path[_0x1fbf('0xba')](config[_0x1fbf('0xbb')],_0x1fbf('0xbc'),_0x1fbf('0xbd'),_0x1fbf('0xbf'));var _0x3edc39=path[_0x1fbf('0xba')](_0x518c7,_0x522364);var _0x4671cd=util[_0x1fbf('0xaf')](_0x1fbf('0xc0'),_0x54846f[_0x1fbf('0xa1')]['id'],_0x522364);var _0x51342f=path['join'](_0x518c7,_0x4671cd);var _0x176341=[];_0x176341[_0x1fbf('0x9e')]({'model':db[_0x1fbf('0x66')],'as':_0x1fbf('0x66'),'attributes':['id',_0x1fbf('0x28')],'raw':!![]});_0x176341['push']({'model':db[_0x1fbf('0xc1')],'as':_0x1fbf('0x5a'),'attributes':['id',_0x1fbf('0xc2'),_0x1fbf('0xc3')],'raw':!![]});var _0x2579d8=[{'model':db[_0x1fbf('0xa9')],'as':_0x1fbf('0xc4'),'attributes':['id',_0x1fbf('0x69'),_0x1fbf('0x70'),_0x1fbf('0xc5'),'secret',_0x1fbf('0x76')],'include':_0x176341}];_0x2579d8[_0x1fbf('0x9e')]({'model':db[_0x1fbf('0xc6')],'as':'Account','attributes':['id',_0x1fbf('0x24')]});_0x2579d8[_0x1fbf('0x9e')]({'model':db[_0x1fbf('0x66')],'as':'Owner','attributes':['id',_0x1fbf('0x28')]});return db['SmsInteraction'][_0x1fbf('0x60')]({'where':{'id':_0x54846f[_0x1fbf('0xa1')]['id']},'include':_0x2579d8})['then'](handleEntityNotFound(_0x4f062c,null))[_0x1fbf('0x21')](function(_0x2a820a){if(_0x2a820a){var _0x40bdda=_0x2a820a[_0x1fbf('0xc7')]({'plain':!![]});fs[_0x1fbf('0xc8')](_0x3edc39);var _0x12705c={'channel':'Sms','account':_0x40bdda[_0x1fbf('0xc9')][_0x1fbf('0x24')],'agent':_0x40bdda[_0x1fbf('0xca')]?_0x40bdda[_0x1fbf('0xca')][_0x1fbf('0x28')]:_0x1fbf('0xcb'),'createdAt':moment(_0x40bdda['createdAt'])['format'](_0x1fbf('0xb0'))[_0x1fbf('0x8d')](),'closedAt':_0x40bdda[_0x1fbf('0xcc')]?moment(_0x40bdda['closedAt'])[_0x1fbf('0xaf')](_0x1fbf('0xb0'))[_0x1fbf('0x8d')]():'','disposition':_0x40bdda[_0x1fbf('0xcd')],'messages':_(_0x40bdda[_0x1fbf('0xc4')])['filter']({'secret':![]})[_0x1fbf('0x27')](function(_0x545fcc){return{'date':moment(_0x545fcc[_0x1fbf('0x70')])[_0x1fbf('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1fbf('0x8d')](),'sender':_0x545fcc[_0x1fbf('0xc5')]===_0x1fbf('0xce')?_0x545fcc[_0x1fbf('0x66')]?_0x545fcc[_0x1fbf('0x66')][_0x1fbf('0x28')]:_0x1fbf('0xcf'):_0x545fcc['Contact']['firstName']+(_0x545fcc[_0x1fbf('0x5a')]['lastName']?'\x20'+_0x545fcc['Contact'][_0x1fbf('0xc3')]:''),'body':_0x545fcc[_0x1fbf('0x69')],'direction':_0x545fcc['direction']==='out'?'A':'C','secret':_0x545fcc[_0x1fbf('0xd0')],'read':_0x545fcc[_0x1fbf('0x76')]};})[_0x1fbf('0x5d')]()};return ejs['renderFile'](path[_0x1fbf('0xba')](config[_0x1fbf('0xbb')],_0x1fbf('0xbc'),_0x1fbf('0xd1'),'downloadInteraction.ejs'),{'interaction':_0x12705c})['then'](function(_0x23ee90){var _0x4fac30=path[_0x1fbf('0xba')](_0x3edc39,_0x1fbf('0xd2')+_0x40bdda['id']+'-'+_0x522364+_0x1fbf('0xd3'));var _0x2cb052={'path':_0x4fac30,'channel':_0x1fbf('0xd4'),'interactionId':_0x40bdda['id']};return pdf['createPdfFromHTML'](_0x23ee90,_0x2cb052);})[_0x1fbf('0x21')](function(){return new BPromise(function(_0x139d72,_0x2f36af){zipdir(_0x3edc39,{'saveTo':_0x51342f},function(_0x321236,_0x31b2f9){if(_0x321236)return _0x2f36af(_0x321236);return _0x139d72(_0x31b2f9);});})['then'](function(){return new BPromise(function(_0x4614c3,_0x36ea63){rimraf(_0x3edc39,function(_0x212493){if(_0x212493)_0x36ea63(_0x212493);return _0x4614c3();});});})[_0x1fbf('0x21')](function(){return _0x4f062c['download'](_0x51342f,_0x4671cd,function(_0x9438b6){if(_0x9438b6){console[_0x1fbf('0xd5')](_0x1fbf('0xd6'),_0x9438b6);}else{fs['unlinkSync'](_0x51342f);}});});});}else{return _0x4f062c[_0x1fbf('0x14')](0xc8);}})['catch'](handleError(_0x4f062c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 73bbe93..83ef30a 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 _0xd4f4=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x3490e8,_0x361121){var _0x131d43=function(_0x1ffd44){while(--_0x1ffd44){_0x3490e8['push'](_0x3490e8['shift']());}};_0x131d43(++_0x361121);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x2c2c88,_0x53da6c){_0x2c2c88=_0x2c2c88-0x0;var _0x2344c7=_0xd4f4[_0x2c2c88];return _0x2344c7;};'use strict';var EventEmitter=require(_0x4d4f('0x0'));var SmsInteraction=require(_0x4d4f('0x1'))['db'][_0x4d4f('0x2')];var SmsMessage=require(_0x4d4f('0x1'))['db'][_0x4d4f('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4d4f('0x4')](0x0);var events={'afterCreate':_0x4d4f('0x5'),'afterUpdate':_0x4d4f('0x6'),'afterDestroy':_0x4d4f('0x7')};function emitEvent(_0xa53cb8){return function(_0x15585,_0x5a98c7,_0x5f451b){_0x15585['getUsers']({'attributes':['id'],'raw':!![]})[_0x4d4f('0x8')](function(_0xecc103){_0x15585[_0x4d4f('0x9')](_0x4d4f('0xa'),_0xecc103[_0x4d4f('0xb')](function(_0x3c70b9){return{'id':_0x3c70b9['id']};}));return SmsMessage[_0x4d4f('0xc')]({'where':{'SmsInteractionId':_0x15585['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4d4f('0x8')](function(_0x385597){_0x15585[_0x4d4f('0x9')](_0x4d4f('0xd'),_0x385597[_0x4d4f('0xe')]);SmsInteractionEvents[_0x4d4f('0xf')](_0xa53cb8+':'+_0x15585['id'],_0x15585);SmsInteractionEvents[_0x4d4f('0xf')](_0xa53cb8,_0x15585);_0x5f451b(null);})[_0x4d4f('0x10')](_0x5f451b(null));};}for(var e in events){if(events[_0x4d4f('0x11')](e)){var event=events[e];SmsInteraction[_0x4d4f('0x12')](e,emitEvent(event));}}module[_0x4d4f('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x4b6b48,_0xb7af42){var _0x4481a2=function(_0x46346b){while(--_0x46346b){_0x4b6b48['push'](_0x4b6b48['shift']());}};_0x4481a2(++_0xb7af42);}(_0x236c,0x155));var _0xc236=function(_0x5106f3,_0x51257b){_0x5106f3=_0x5106f3-0x0;var _0x22eca0=_0x236c[_0x5106f3];return _0x22eca0;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 5d3ea2d..6f43e8f 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 _0x018b=['define','SmsInteraction','closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./smsInteraction.attributes','exports'];(function(_0xcfd202,_0x14b6cf){var _0xac4f4c=function(_0x1266f6){while(--_0x1266f6){_0xcfd202['push'](_0xcfd202['shift']());}};_0xac4f4c(++_0x14b6cf);}(_0x018b,0x101));var _0xb018=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x018b[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xb018('0x0'));var util=require(_0xb018('0x1'));var logger=require(_0xb018('0x2'))('api');var moment=require(_0xb018('0x3'));var BPromise=require(_0xb018('0x4'));var rp=require(_0xb018('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb018('0x6'));var config=require('../../config/environment');var attributes=require(_0xb018('0x7'));module[_0xb018('0x8')]=function(_0x50c8d1,_0xc7ffa2){return _0x50c8d1[_0xb018('0x9')](_0xb018('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x448dda,_0x5c9b0e,_0x125ba2){if(_0x448dda['changed'](_0xb018('0xb'))){_0x448dda[_0xb018('0xc')]=moment()[_0xb018('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x125ba2(null,_0x448dda);}}});}; \ No newline at end of file +var _0x8f74=['SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define'];(function(_0x4801bd,_0x368071){var _0x3cf6fc=function(_0x4d376c){while(--_0x4d376c){_0x4801bd['push'](_0x4801bd['shift']());}};_0x3cf6fc(++_0x368071);}(_0x8f74,0x1c1));var _0x48f7=function(_0x385d5f,_0x43c178){_0x385d5f=_0x385d5f-0x0;var _0x17dcd8=_0x8f74[_0x385d5f];return _0x17dcd8;};'use strict';var _=require(_0x48f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x48f7('0x1'));var moment=require(_0x48f7('0x2'));var BPromise=require('bluebird');var rp=require(_0x48f7('0x3'));var fs=require('fs');var path=require(_0x48f7('0x4'));var rimraf=require(_0x48f7('0x5'));var config=require(_0x48f7('0x6'));var attributes=require(_0x48f7('0x7'));module[_0x48f7('0x8')]=function(_0x53167b,_0x3b37a5){return _0x53167b[_0x48f7('0x9')](_0x48f7('0xa'),attributes,{'tableName':_0x48f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x583012,_0x2f9020,_0x3b7118){if(_0x583012[_0x48f7('0xc')](_0x48f7('0xd'))){_0x583012[_0x48f7('0xe')]=moment()[_0x48f7('0xf')](_0x48f7('0x10'));}_0x3b7118(null,_0x583012);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 77da987..040a745 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 _0x0063=['message','result','catch','SmsInteraction','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0063,0x1e9));var _0x3006=function(_0x62285f,_0xa96107){_0x62285f=_0x62285f-0x0;var _0xdd87a5=_0x0063[_0x62285f];return _0xdd87a5;};'use strict';var _=require(_0x3006('0x0'));var util=require(_0x3006('0x1'));var moment=require(_0x3006('0x2'));var BPromise=require(_0x3006('0x3'));var rs=require(_0x3006('0x4'));var fs=require('fs');var Redis=require(_0x3006('0x5'));var db=require(_0x3006('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3006('0x7'))(_0x3006('0x8'));var config=require(_0x3006('0x9'));var jayson=require(_0x3006('0xa'));var client=jayson[_0x3006('0xb')][_0x3006('0xc')]({'port':0x232a});config[_0x3006('0xd')]=_[_0x3006('0xe')](config['redis'],{'host':_0x3006('0xf'),'port':0x18eb});var socket=require(_0x3006('0x10'))(new Redis(config[_0x3006('0xd')]));require('./smsInteraction.socket')[_0x3006('0x11')](socket);function respondWithRpcPromise(_0x59032e,_0x306548,_0x332546){return new BPromise(function(_0x98403a,_0x2f2405){return client[_0x3006('0x12')](_0x59032e,_0x332546)[_0x3006('0x13')](function(_0x34c6bf){logger[_0x3006('0x14')](_0x3006('0x15'),_0x306548,_0x3006('0x16'));logger[_0x3006('0x17')](_0x3006('0x18'),_0x306548,'request\x20sent',JSON[_0x3006('0x19')](_0x34c6bf));if(_0x34c6bf['error']){if(_0x34c6bf[_0x3006('0x1a')]['code']===0x1f4){logger[_0x3006('0x1a')](_0x3006('0x15'),_0x306548,_0x34c6bf[_0x3006('0x1a')]['message']);return _0x2f2405(_0x34c6bf['error'][_0x3006('0x1b')]);}logger[_0x3006('0x1a')](_0x3006('0x15'),_0x306548,_0x34c6bf[_0x3006('0x1a')][_0x3006('0x1b')]);return _0x98403a(_0x34c6bf[_0x3006('0x1a')][_0x3006('0x1b')]);}else{logger['info'](_0x3006('0x15'),_0x306548,_0x3006('0x16'));_0x98403a(_0x34c6bf[_0x3006('0x1c')][_0x3006('0x1b')]);}})[_0x3006('0x1d')](function(_0x5e818e){logger[_0x3006('0x1a')](_0x3006('0x15'),_0x306548,_0x5e818e);_0x2f2405(_0x5e818e);});});}exports['UpdateSmsInteraction']=function(_0x37475a){var _0x5dd6e0=this;return new Promise(function(_0x1d9035,_0x281276){return db[_0x3006('0x1e')][_0x3006('0x1f')](_0x37475a[_0x3006('0x20')],{'raw':_0x37475a[_0x3006('0x21')]?_0x37475a[_0x3006('0x21')][_0x3006('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37475a[_0x3006('0x21')]?_0x37475a[_0x3006('0x21')][_0x3006('0x23')]||null:null,'attributes':_0x37475a[_0x3006('0x21')]?_0x37475a[_0x3006('0x21')][_0x3006('0x24')]||null:null,'limit':_0x37475a[_0x3006('0x21')]?_0x37475a['options'][_0x3006('0x25')]||null:null})[_0x3006('0x13')](function(_0x55b43a){logger['info'](_0x3006('0x26'),_0x37475a);logger[_0x3006('0x17')](_0x3006('0x26'),_0x37475a,JSON[_0x3006('0x19')](_0x55b43a));_0x1d9035(_0x55b43a);})[_0x3006('0x1d')](function(_0x354f41){logger[_0x3006('0x1a')](_0x3006('0x26'),_0x354f41['message'],_0x37475a);_0x281276(_0x5dd6e0[_0x3006('0x1a')](0x1f4,_0x354f41[_0x3006('0x1b')]));});});};exports['AddTagsToSmsInteraction']=function(_0x12e58a){return new Promise(function(_0x209fca,_0x49ba5d){return db['SmsInteraction'][_0x3006('0x27')]({'where':_0x12e58a['options']?_0x12e58a[_0x3006('0x21')]['where']||null:null})[_0x3006('0x13')](function(_0x29bf4c){if(_0x29bf4c){return _0x29bf4c['addTags'](_0x12e58a[_0x3006('0x20')][_0x3006('0x28')],_[_0x3006('0x29')](_0x12e58a['body'],['ids','id'])||{});}})['spread'](function(_0x2b63a5){logger['info']('AddTags',_0x12e58a);logger[_0x3006('0x17')](_0x3006('0x2a'),_0x12e58a,JSON[_0x3006('0x19')](_0x2b63a5));_0x209fca(_0x2b63a5);})[_0x3006('0x1d')](function(_0x7d1900){logger['error'](_0x3006('0x2a'),_0x7d1900[_0x3006('0x1b')],_0x12e58a);_0x49ba5d(_this[_0x3006('0x1a')](0x1f4,_0x7d1900['message']));});});}; \ No newline at end of file +var _0xc3d9=['SmsInteraction','body','options','raw','limit','debug','catch','AddTagsToSmsInteraction','find','addTags','omit','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UpdateSmsInteraction'];(function(_0x50b82c,_0x234c32){var _0x4c0301=function(_0x5cf230){while(--_0x5cf230){_0x50b82c['push'](_0x50b82c['shift']());}};_0x4c0301(++_0x234c32);}(_0xc3d9,0xe0));var _0x9c3d=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xc3d9[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0x9c3d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9c3d('0x1'));var rs=require(_0x9c3d('0x2'));var fs=require('fs');var Redis=require(_0x9c3d('0x3'));var db=require(_0x9c3d('0x4'))['db'];var utils=require(_0x9c3d('0x5'));var logger=require(_0x9c3d('0x6'))(_0x9c3d('0x7'));var config=require(_0x9c3d('0x8'));var jayson=require(_0x9c3d('0x9'));var client=jayson[_0x9c3d('0xa')][_0x9c3d('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x9c3d('0xc'),'port':0x18eb});var socket=require(_0x9c3d('0xd'))(new Redis(config[_0x9c3d('0xe')]));require(_0x9c3d('0xf'))[_0x9c3d('0x10')](socket);function respondWithRpcPromise(_0xe3e536,_0x19c453,_0x218ac1){return new BPromise(function(_0x268fcc,_0x474e03){return client[_0x9c3d('0x11')](_0xe3e536,_0x218ac1)[_0x9c3d('0x12')](function(_0x2107df){logger['info'](_0x9c3d('0x13'),_0x19c453,_0x9c3d('0x14'));logger['debug'](_0x9c3d('0x15'),_0x19c453,'request\x20sent',JSON[_0x9c3d('0x16')](_0x2107df));if(_0x2107df[_0x9c3d('0x17')]){if(_0x2107df[_0x9c3d('0x17')]['code']===0x1f4){logger['error'](_0x9c3d('0x13'),_0x19c453,_0x2107df[_0x9c3d('0x17')][_0x9c3d('0x18')]);return _0x474e03(_0x2107df[_0x9c3d('0x17')][_0x9c3d('0x18')]);}logger[_0x9c3d('0x17')](_0x9c3d('0x13'),_0x19c453,_0x2107df[_0x9c3d('0x17')]['message']);return _0x268fcc(_0x2107df[_0x9c3d('0x17')][_0x9c3d('0x18')]);}else{logger[_0x9c3d('0x19')](_0x9c3d('0x13'),_0x19c453,_0x9c3d('0x14'));_0x268fcc(_0x2107df[_0x9c3d('0x1a')][_0x9c3d('0x18')]);}})['catch'](function(_0x5e3370){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x19c453,_0x5e3370);_0x474e03(_0x5e3370);});});}exports[_0x9c3d('0x1b')]=function(_0x450fa8){var _0x616caf=this;return new Promise(function(_0x4f87ea,_0x4968f2){return db[_0x9c3d('0x1c')]['update'](_0x450fa8[_0x9c3d('0x1d')],{'raw':_0x450fa8[_0x9c3d('0x1e')]?_0x450fa8['options'][_0x9c3d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450fa8[_0x9c3d('0x1e')]?_0x450fa8[_0x9c3d('0x1e')]['where']||null:null,'attributes':_0x450fa8[_0x9c3d('0x1e')]?_0x450fa8[_0x9c3d('0x1e')]['attributes']||null:null,'limit':_0x450fa8[_0x9c3d('0x1e')]?_0x450fa8[_0x9c3d('0x1e')][_0x9c3d('0x20')]||null:null})[_0x9c3d('0x12')](function(_0x474a3a){logger[_0x9c3d('0x19')](_0x9c3d('0x1b'),_0x450fa8);logger[_0x9c3d('0x21')](_0x9c3d('0x1b'),_0x450fa8,JSON['stringify'](_0x474a3a));_0x4f87ea(_0x474a3a);})[_0x9c3d('0x22')](function(_0x571c88){logger['error'](_0x9c3d('0x1b'),_0x571c88[_0x9c3d('0x18')],_0x450fa8);_0x4968f2(_0x616caf[_0x9c3d('0x17')](0x1f4,_0x571c88[_0x9c3d('0x18')]));});});};exports[_0x9c3d('0x23')]=function(_0x53c07b){return new Promise(function(_0x3b8246,_0x6c722c){return db[_0x9c3d('0x1c')][_0x9c3d('0x24')]({'where':_0x53c07b[_0x9c3d('0x1e')]?_0x53c07b[_0x9c3d('0x1e')]['where']||null:null})[_0x9c3d('0x12')](function(_0x4da676){if(_0x4da676){return _0x4da676[_0x9c3d('0x25')](_0x53c07b['body']['ids'],_[_0x9c3d('0x26')](_0x53c07b[_0x9c3d('0x1d')],[_0x9c3d('0x27'),'id'])||{});}})[_0x9c3d('0x28')](function(_0x1a2474){logger[_0x9c3d('0x19')](_0x9c3d('0x29'),_0x53c07b);logger[_0x9c3d('0x21')](_0x9c3d('0x29'),_0x53c07b,JSON[_0x9c3d('0x16')](_0x1a2474));_0x3b8246(_0x1a2474);})['catch'](function(_0x2fb8c3){logger[_0x9c3d('0x17')](_0x9c3d('0x29'),_0x2fb8c3[_0x9c3d('0x18')],_0x53c07b);_0x6c722c(_this[_0x9c3d('0x17')](0x1f4,_0x2fb8c3[_0x9c3d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8332676..e52105d 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 _0xb61b=['smsInteraction:','./smsInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0xb61b,0x139));var _0xbb61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb61b[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require(_0xbb61('0x0'));var events=[_0xbb61('0x1'),_0xbb61('0x2'),_0xbb61('0x3')];function createListener(_0x5b5b9d,_0x28bf50){return function(_0x5349fc){_0x28bf50['emit'](_0x5b5b9d,_0x5349fc);};}function removeListener(_0x4d5dd4,_0x316e8d){return function(){SmsInteractionEvents[_0xbb61('0x4')](_0x4d5dd4,_0x316e8d);};}exports[_0xbb61('0x5')]=function(_0x4ed3cc){for(var _0x50dbe3=0x0,_0x22700a=events[_0xbb61('0x6')];_0x50dbe3<_0x22700a;_0x50dbe3++){var _0x25f88a=events[_0x50dbe3];var _0x36e8ff=createListener(_0xbb61('0x7')+_0x25f88a,_0x4ed3cc);SmsInteractionEvents['on'](_0x25f88a,_0x36e8ff);}}; \ No newline at end of file +var _0x838f=['emit','register','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x3a4d28,_0x3c5eda){var _0x32c5bd=function(_0x17cbe){while(--_0x17cbe){_0x3a4d28['push'](_0x3a4d28['shift']());}};_0x32c5bd(++_0x3c5eda);}(_0x838f,0xd5));var _0xf838=function(_0x286bbe,_0x4d7bab){_0x286bbe=_0x286bbe-0x0;var _0x3a48bc=_0x838f[_0x286bbe];return _0x3a48bc;};'use strict';var SmsInteractionEvents=require(_0xf838('0x0'));var events=['save',_0xf838('0x1'),_0xf838('0x2')];function createListener(_0x466ce7,_0x2f786d){return function(_0x27a234){_0x2f786d[_0xf838('0x3')](_0x466ce7,_0x27a234);};}function removeListener(_0x349e49,_0x4f4818){return function(){SmsInteractionEvents['removeListener'](_0x349e49,_0x4f4818);};}exports[_0xf838('0x4')]=function(_0x3f670a){for(var _0x4fb4c9=0x0,_0x36de1c=events['length'];_0x4fb4c9<_0x36de1c;_0x4fb4c9++){var _0x5786fd=events[_0x4fb4c9];var _0x174383=createListener(_0xf838('0x5')+_0x5786fd,_0x3f670a);SmsInteractionEvents['on'](_0x5786fd,_0x174383);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 4d357e8..7912bcd 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 _0x8482=['accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','post','tracked','sms','smsmessage:create','create','status','put','/:id','update','/:id/accept'];(function(_0x4ceaa8,_0x452176){var _0x94bff6=function(_0x2b24b3){while(--_0x2b24b3){_0x4ceaa8['push'](_0x4ceaa8['shift']());}};_0x94bff6(++_0x452176);}(_0x8482,0x1a9));var _0x2848=function(_0x1a94de,_0x5e6501){_0x1a94de=_0x1a94de-0x0;var _0x743996=_0x8482[_0x1a94de];return _0x743996;};'use strict';var multer=require(_0x2848('0x0'));var util=require(_0x2848('0x1'));var path=require(_0x2848('0x2'));var timeout=require(_0x2848('0x3'));var express=require(_0x2848('0x4'));var router=express[_0x2848('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2848('0x6'));var interaction=require(_0x2848('0x7'));var config=require(_0x2848('0x8'));var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2848('0x9')]);router['get'](_0x2848('0xa'),auth[_0x2848('0xb')](),controller[_0x2848('0xc')]);router[_0x2848('0xd')]('/:id',auth[_0x2848('0xb')](),controller[_0x2848('0xe')]);router[_0x2848('0xf')]('/',auth[_0x2848('0xb')](),interaction[_0x2848('0x10')](_0x2848('0x11'),_0x2848('0x12')),controller[_0x2848('0x13')]);router['post']('/:id/status',controller[_0x2848('0x14')]);router[_0x2848('0x15')](_0x2848('0x16'),auth[_0x2848('0xb')](),controller[_0x2848('0x17')]);router['put'](_0x2848('0x18'),auth[_0x2848('0xb')](),controller[_0x2848('0x19')]);router['put'](_0x2848('0x1a'),auth['isAuthenticated'](),controller['reject']);router[_0x2848('0x1b')](_0x2848('0x16'),auth[_0x2848('0xb')](),controller[_0x2848('0x1c')]);module[_0x2848('0x1d')]=router; \ No newline at end of file +var _0xe29f=['accept','/:id/reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','/describe','describe','get','show','post','sms','create','/:id/status','put','/:id','update','/:id/accept'];(function(_0x28518c,_0x5dabb0){var _0x8e3945=function(_0x5eb25f){while(--_0x5eb25f){_0x28518c['push'](_0x28518c['shift']());}};_0x8e3945(++_0x5dabb0);}(_0xe29f,0x1a4));var _0xfe29=function(_0x18f63b,_0x21427a){_0x18f63b=_0x18f63b-0x0;var _0x3ce85f=_0xe29f[_0x18f63b];return _0x3ce85f;};'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('fs-extra');var auth=require(_0xfe29('0x5'));var interaction=require(_0xfe29('0x6'));var config=require('../../config/environment');var controller=require(_0xfe29('0x7'));router['get']('/',auth[_0xfe29('0x8')](),controller[_0xfe29('0x9')]);router['get'](_0xfe29('0xa'),auth['isAuthenticated'](),controller[_0xfe29('0xb')]);router[_0xfe29('0xc')]('/:id',auth[_0xfe29('0x8')](),controller[_0xfe29('0xd')]);router[_0xfe29('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xfe29('0xf'),'smsmessage:create'),controller[_0xfe29('0x10')]);router[_0xfe29('0xe')](_0xfe29('0x11'),controller['status']);router[_0xfe29('0x12')](_0xfe29('0x13'),auth[_0xfe29('0x8')](),controller[_0xfe29('0x14')]);router[_0xfe29('0x12')](_0xfe29('0x15'),auth[_0xfe29('0x8')](),controller[_0xfe29('0x16')]);router[_0xfe29('0x12')](_0xfe29('0x17'),auth[_0xfe29('0x8')](),controller['reject']);router[_0xfe29('0x18')](_0xfe29('0x13'),auth[_0xfe29('0x8')](),controller[_0xfe29('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 06c5c6b..13d1fa8 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 _0x71f8=['TEXT','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x297aac,_0x575584){var _0x36d6a1=function(_0x4c9763){while(--_0x4c9763){_0x297aac['push'](_0x297aac['shift']());}};_0x36d6a1(++_0x575584);}(_0x71f8,0x1ae));var _0x871f=function(_0x1b2b02,_0x3e3c49){_0x1b2b02=_0x1b2b02-0x0;var _0x173b44=_0x71f8[_0x1b2b02];return _0x173b44;};'use strict';var Sequelize=require(_0x871f('0x0'));module[_0x871f('0x1')]={'body':{'type':Sequelize[_0x871f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x871f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x871f('0x4')]('in',_0x871f('0x5')),'defaultValue':_0x871f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x871f('0x6')](0xbe)},'phone':{'type':Sequelize[_0x871f('0x6')]},'readAt':{'type':Sequelize[_0x871f('0x7')]},'secret':{'type':Sequelize[_0x871f('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x871f('0x6')]},'providerResponse':{'type':Sequelize[_0x871f('0x2')]}}; \ No newline at end of file +var _0xa234=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3db6b3,_0x46cf9e){var _0x15dfa3=function(_0x459fba){while(--_0x459fba){_0x3db6b3['push'](_0x3db6b3['shift']());}};_0x15dfa3(++_0x46cf9e);}(_0xa234,0x99));var _0x4a23=function(_0x4a2c69,_0x2afe7a){_0x4a2c69=_0x4a2c69-0x0;var _0x527f8a=_0xa234[_0x4a2c69];return _0x527f8a;};'use strict';var Sequelize=require(_0x4a23('0x0'));module[_0x4a23('0x1')]={'body':{'type':Sequelize[_0x4a23('0x2')](_0x4a23('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4a23('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4a23('0x5')]('in',_0x4a23('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x4a23('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4a23('0x7')]},'providerResponse':{'type':Sequelize[_0x4a23('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 7f92018..f7ff85f 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 _0x9962=['get','SmsInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteractionId','fullname','motionChannel','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','client','http','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','sms-interactions','accept','sms','read','format','UserId','agent'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x9962,0xb8));var _0x2996=function(_0xb2751d,_0x2b682b){_0xb2751d=_0xb2751d-0x0;var _0x1f42eb=_0x9962[_0xb2751d];return _0x1f42eb;};'use strict';var emlformat=require(_0x2996('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2996('0x1'));var jsonpatch=require(_0x2996('0x2'));var rp=require(_0x2996('0x3'));var moment=require('moment');var BPromise=require(_0x2996('0x4'));var Mustache=require('mustache');var util=require(_0x2996('0x5'));var path=require(_0x2996('0x6'));var sox=require('sox');var csv=require(_0x2996('0x7'));var ejs=require(_0x2996('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2996('0x9'));var squel=require(_0x2996('0xa'));var crypto=require(_0x2996('0xb'));var jsforce=require(_0x2996('0xc'));var deskjs=require(_0x2996('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2996('0xe'));var Papa=require('papaparse');var Redis=require(_0x2996('0xf'));var authService=require(_0x2996('0x10'));var qs=require(_0x2996('0x11'));var as=require(_0x2996('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2996('0x13'))(_0x2996('0x14'));var utils=require(_0x2996('0x15'));var config=require(_0x2996('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2996('0x17'))['db'];config[_0x2996('0x18')]=_[_0x2996('0x19')](config[_0x2996('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2996('0x1a'))(new Redis(config['redis']));require(_0x2996('0x1b'))[_0x2996('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2996('0x1d')][_0x2996('0x1e')]({'port':0x232c});var client9002=jayson[_0x2996('0x1d')][_0x2996('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xc267fb,_0xb50801,_0x311270,_0x51762b){return new BPromise(function(_0x4e5d53,_0x369b06){var _0x5d8236=_0x51762b||client;return _0x5d8236['request'](_0xc267fb,_0x311270)['then'](function(_0x31c5ca){logger[_0x2996('0x1f')]('SmsMessage,\x20%s,\x20%s',_0xb50801,_0x2996('0x20'));logger[_0x2996('0x21')](_0x2996('0x22'),_0xb50801,_0x2996('0x20'),JSON[_0x2996('0x23')](_0x31c5ca));if(_0x31c5ca[_0x2996('0x24')]){if(_0x31c5ca[_0x2996('0x24')][_0x2996('0x25')]===0x1f4){logger[_0x2996('0x24')](_0x2996('0x26'),_0xb50801,_0x31c5ca['error'][_0x2996('0x27')]);return _0x369b06(_0x31c5ca[_0x2996('0x24')][_0x2996('0x27')]);}logger[_0x2996('0x24')](_0x2996('0x26'),_0xb50801,_0x31c5ca['error'][_0x2996('0x27')]);return _0x4e5d53(_0x31c5ca[_0x2996('0x24')][_0x2996('0x27')]);}else{logger['info'](_0x2996('0x26'),_0xb50801,_0x2996('0x20'));_0x4e5d53(_0x31c5ca[_0x2996('0x28')]['message']);}})[_0x2996('0x29')](function(_0x88f1c5){logger[_0x2996('0x24')]('SmsMessage,\x20%s,\x20%s',_0xb50801,_0x88f1c5);_0x369b06(_0x88f1c5);});});}function respondWithStatusCode(_0x3c9303,_0x15ab22){_0x15ab22=_0x15ab22||0xcc;return function(_0x5636eb){if(_0x5636eb){return _0x3c9303[_0x2996('0x2a')](_0x15ab22);}return _0x3c9303[_0x2996('0x2b')](_0x15ab22)[_0x2996('0x2c')]();};}function respondWithResult(_0x3e7400,_0x52b693){_0x52b693=_0x52b693||0xc8;return function(_0x37d01e){if(_0x37d01e){return _0x3e7400[_0x2996('0x2b')](_0x52b693)['json'](_0x37d01e);}};}function respondWithFilteredResult(_0x52b2e6,_0x12959f){return function(_0x4941c3){if(_0x4941c3){var _0x3adddd=typeof _0x12959f[_0x2996('0x2d')]===_0x2996('0x2e')&&typeof _0x12959f[_0x2996('0x2f')]==='undefined';var _0x575670=_0x4941c3[_0x2996('0x30')];var _0xbfcf64=_0x3adddd?0x0:_0x12959f[_0x2996('0x2d')];var _0x165d39=_0x3adddd?_0x4941c3[_0x2996('0x30')]:_0x12959f[_0x2996('0x2d')]+_0x12959f[_0x2996('0x2f')];var _0x396493;if(_0x165d39>=_0x575670){_0x165d39=_0x575670;_0x396493=0xc8;}else{_0x396493=0xce;}_0x52b2e6['status'](_0x396493);return _0x52b2e6[_0x2996('0x31')](_0x2996('0x32'),_0xbfcf64+'-'+_0x165d39+'/'+_0x575670)['json'](_0x4941c3);}return null;};}function patchUpdates(_0x4710f5){return function(_0x5c3cb3){try{jsonpatch[_0x2996('0x33')](_0x5c3cb3,_0x4710f5,!![]);}catch(_0x4fc326){return BPromise[_0x2996('0x34')](_0x4fc326);}return _0x5c3cb3['save']();};}function saveUpdates(_0x5b5b46,_0x424826){return function(_0x523c48){if(_0x523c48){return _0x523c48[_0x2996('0x35')](_0x5b5b46)[_0x2996('0x36')](function(_0x546e29){return _0x546e29;});}return null;};}function removeEntity(_0x7761b7,_0x79f70f){return function(_0x685bf0){if(_0x685bf0){return _0x685bf0[_0x2996('0x37')]()[_0x2996('0x36')](function(){_0x7761b7[_0x2996('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eecb9,_0x3adcac){return function(_0x289e98){if(!_0x289e98){_0x5eecb9[_0x2996('0x2a')](0x194);}return _0x289e98;};}function handleError(_0x12a208,_0x39c2cc){_0x39c2cc=_0x39c2cc||0x1f4;return function(_0xfbc26a){logger['error'](_0xfbc26a[_0x2996('0x38')]);if(_0xfbc26a[_0x2996('0x39')]){delete _0xfbc26a['name'];}_0x12a208['status'](_0x39c2cc)[_0x2996('0x3a')](_0xfbc26a);};}exports[_0x2996('0x3b')]=function(_0x506f83,_0x3cdfae){var _0x2b62f0={},_0x380387={},_0xcb6000={'count':0x0,'rows':[]};var _0x18f3b5=_[_0x2996('0x3c')](db[_0x2996('0x3d')][_0x2996('0x3e')],function(_0x4fb862){return{'name':_0x4fb862[_0x2996('0x3f')],'type':_0x4fb862[_0x2996('0x40')][_0x2996('0x41')]};});_0x380387['model']=_[_0x2996('0x3c')](_0x18f3b5,'name');_0x380387[_0x2996('0x42')]=_[_0x2996('0x43')](_0x506f83[_0x2996('0x42')]);_0x380387[_0x2996('0x44')]=_[_0x2996('0x45')](_0x380387[_0x2996('0x46')],_0x380387[_0x2996('0x42')]);_0x2b62f0[_0x2996('0x47')]=_[_0x2996('0x45')](_0x380387[_0x2996('0x46')],qs['fields'](_0x506f83[_0x2996('0x42')][_0x2996('0x48')]));_0x2b62f0[_0x2996('0x47')]=_0x2b62f0['attributes'][_0x2996('0x49')]?_0x2b62f0['attributes']:_0x380387['model'];if(!_0x506f83[_0x2996('0x42')][_0x2996('0x4a')](_0x2996('0x4b'))){_0x2b62f0['limit']=qs[_0x2996('0x2f')](_0x506f83[_0x2996('0x42')][_0x2996('0x2f')]);_0x2b62f0[_0x2996('0x2d')]=qs[_0x2996('0x2d')](_0x506f83[_0x2996('0x42')]['offset']);}_0x2b62f0['order']=qs[_0x2996('0x4c')](_0x506f83[_0x2996('0x42')][_0x2996('0x4c')]);_0x2b62f0[_0x2996('0x4d')]=qs[_0x2996('0x44')](_[_0x2996('0x4e')](_0x506f83[_0x2996('0x42')],_0x380387[_0x2996('0x44')]),_0x18f3b5);if(_0x506f83['query']['filter']){_0x2b62f0['where']=_[_0x2996('0x4f')](_0x2b62f0[_0x2996('0x4d')],{'$or':_['map'](_0x18f3b5,function(_0x91bb00){if(_0x91bb00[_0x2996('0x40')]!==_0x2996('0x50')){var _0x5b4253={};_0x5b4253[_0x91bb00[_0x2996('0x39')]]={'$like':'%'+_0x506f83[_0x2996('0x42')][_0x2996('0x51')]+'%'};return _0x5b4253;}})});}_0x2b62f0=_[_0x2996('0x4f')]({},_0x2b62f0,_0x506f83[_0x2996('0x52')]);var _0x248f76={'where':_0x2b62f0[_0x2996('0x4d')]};return db[_0x2996('0x3d')][_0x2996('0x30')](_0x248f76)[_0x2996('0x36')](function(_0x47da08){_0xcb6000['count']=_0x47da08;if(_0x506f83['query'][_0x2996('0x53')]){_0x2b62f0[_0x2996('0x54')]=[{'all':!![]}];}return db[_0x2996('0x3d')][_0x2996('0x55')](_0x2b62f0);})[_0x2996('0x36')](function(_0x1a7212){_0xcb6000[_0x2996('0x56')]=_0x1a7212;return _0xcb6000;})[_0x2996('0x36')](respondWithFilteredResult(_0x3cdfae,_0x2b62f0))[_0x2996('0x29')](handleError(_0x3cdfae,null));};exports[_0x2996('0x57')]=function(_0x48a168,_0x4a4ff0){var _0x40ebb3={'raw':!![],'where':{'id':_0x48a168[_0x2996('0x58')]['id']}},_0x2bd093={};_0x2bd093[_0x2996('0x46')]=_[_0x2996('0x43')](db[_0x2996('0x3d')][_0x2996('0x3e')]);_0x2bd093['query']=_[_0x2996('0x43')](_0x48a168[_0x2996('0x42')]);_0x2bd093[_0x2996('0x44')]=_[_0x2996('0x45')](_0x2bd093[_0x2996('0x46')],_0x2bd093[_0x2996('0x42')]);_0x40ebb3['attributes']=_[_0x2996('0x45')](_0x2bd093[_0x2996('0x46')],qs[_0x2996('0x48')](_0x48a168[_0x2996('0x42')]['fields']));_0x40ebb3['attributes']=_0x40ebb3[_0x2996('0x47')][_0x2996('0x49')]?_0x40ebb3[_0x2996('0x47')]:_0x2bd093[_0x2996('0x46')];if(_0x48a168['query']['includeAll']){_0x40ebb3['include']=[{'all':!![]}];}_0x40ebb3=_[_0x2996('0x4f')]({},_0x40ebb3,_0x48a168[_0x2996('0x52')]);return db[_0x2996('0x3d')]['find'](_0x40ebb3)[_0x2996('0x36')](handleEntityNotFound(_0x4a4ff0,null))[_0x2996('0x36')](respondWithResult(_0x4a4ff0,null))[_0x2996('0x29')](handleError(_0x4a4ff0,null));};exports[_0x2996('0x59')]=function(_0x4ddb77,_0x110461){return db[_0x2996('0x3d')][_0x2996('0x59')](_0x4ddb77[_0x2996('0x5a')],{})[_0x2996('0x36')](respondWithResult(_0x110461,0xc9))['catch'](handleError(_0x110461,null));};exports[_0x2996('0x35')]=function(_0x1da797,_0x10314b){if(_0x1da797[_0x2996('0x5a')]['id']){delete _0x1da797[_0x2996('0x5a')]['id'];}return db[_0x2996('0x3d')][_0x2996('0x5b')]({'where':{'id':_0x1da797[_0x2996('0x58')]['id']}})[_0x2996('0x36')](handleEntityNotFound(_0x10314b,null))[_0x2996('0x36')](saveUpdates(_0x1da797['body'],null))[_0x2996('0x36')](respondWithResult(_0x10314b,null))[_0x2996('0x29')](handleError(_0x10314b,null));};exports[_0x2996('0x37')]=function(_0x3764d1,_0x63424f){return db[_0x2996('0x3d')]['find']({'where':{'id':_0x3764d1['params']['id']}})[_0x2996('0x36')](handleEntityNotFound(_0x63424f,null))[_0x2996('0x36')](removeEntity(_0x63424f,null))[_0x2996('0x29')](handleError(_0x63424f,null));};exports[_0x2996('0x5c')]=function(_0x4bf78b,_0xe54c03){return db[_0x2996('0x3d')][_0x2996('0x5c')]()[_0x2996('0x36')](respondWithResult(_0xe54c03,null))[_0x2996('0x29')](handleError(_0xe54c03,null));};var interaction_log=require('../../config/logger')(_0x2996('0x5d'));exports[_0x2996('0x5e')]=function(_0x213ab2,_0x3563eb,_0xc7b050){var _0x562bcd={'agent':{},'channel':_0x2996('0x5f')};if(_0x213ab2[_0x2996('0x5a')]['id']){delete _0x213ab2['body']['id'];}_0x213ab2[_0x2996('0x5a')][_0x2996('0x60')]=!![];_0x213ab2[_0x2996('0x5a')]['readAt']=moment()[_0x2996('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x213ab2[_0x2996('0x5a')][_0x2996('0x62')]=_0x213ab2['body'][_0x2996('0x62')]||_0x213ab2['user']['id'];_0x562bcd[_0x2996('0x63')]['id']=_0x213ab2['body'][_0x2996('0x62')];return db[_0x2996('0x3d')][_0x2996('0x5b')]({'where':{'id':_0x213ab2[_0x2996('0x58')]['id'],'UserId':null}})[_0x2996('0x36')](handleEntityNotFound(_0x3563eb,null))[_0x2996('0x36')](saveUpdates(_0x213ab2[_0x2996('0x5a')],null))['then'](function(_0x1d677e){if(_0x1d677e){_0x562bcd[_0x2996('0x27')]=_0x1d677e[_0x2996('0x64')]({'plain':!![]});return db[_0x2996('0x65')][_0x2996('0x5b')]({'where':{'id':_0x1d677e['SmsInteractionId']}});}return null;})[_0x2996('0x36')](handleEntityNotFound(_0x3563eb,null))[_0x2996('0x36')](function(_0x451177){if(_0x451177){return _0x451177[_0x2996('0x35')]({'UserId':_0x213ab2[_0x2996('0x5a')][_0x2996('0x62')],'read1stAt':_[_0x2996('0x66')](_0x451177['read1stAt'])?moment()[_0x2996('0x61')](_0x2996('0x67')):undefined});}return null;})[_0x2996('0x36')](function(_0x24e3a0){if(_0x24e3a0){_0x562bcd['interaction']=_0x24e3a0[_0x2996('0x64')]({'plain':!![]});interaction_log[_0x2996('0x1f')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x213ab2[_0x2996('0x68')]['id'],_0x213ab2[_0x2996('0x68')][_0x2996('0x39')],_0x213ab2[_0x2996('0x68')][_0x2996('0x69')],_0x562bcd[_0x2996('0x6a')]['id'],_0x213ab2[_0x2996('0x5a')]?JSON['stringify'](_0x213ab2['body']):_0x2996('0x6b'));return respondWithRpcPromise(_0x2996('0x6c'),_0x2996('0x6d'),_0x562bcd);}return null;})['then'](function(_0x2537ab){var _0x1a28fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2537ab['message'][_0x2996('0x6e')];return db[_0x2996('0x6f')][_0x2996('0x42')](_0x1a28fa,{'type':db[_0x2996('0x70')][_0x2996('0x71')][_0x2996('0x72')],'raw':!![]})[_0x2996('0x36')](function(_0x52ffd4){return _0x52ffd4;});})[_0x2996('0x36')](function(_0x1ca2dd){if(_0x1ca2dd){_0x562bcd['message']['contact']=_0x1ca2dd[0x0];if(!_0x213ab2[_0x2996('0x5a')][_0x2996('0x62')])return;return db['User']['find']({'where':{'id':_0x213ab2[_0x2996('0x5a')][_0x2996('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0x2996('0x73'),_0x2996('0x74')],'raw':!![]});}return null;})['then'](function(_0x2316cf){if(!_0x2316cf)return null;_0x562bcd['message'][_0x2996('0x63')]=_0x2316cf;return _0x562bcd;})[_0x2996('0x36')](function(_0x20c2ad){if(_0x20c2ad){if(_0x213ab2[_0x2996('0x5a')]['manual']){_0x562bcd['message'][_0x2996('0x75')]=util[_0x2996('0x61')](_0x2996('0x76'),_0x213ab2[_0x2996('0x68')][_0x2996('0x39')]);_0x562bcd[_0x2996('0x27')][_0x2996('0x77')]=_0x562bcd[_0x2996('0x77')];_0x562bcd[_0x2996('0x27')]['motionChannel']=_0x562bcd[_0x2996('0x77')];_0x562bcd[_0x2996('0x27')][_0x2996('0x78')]='accept';return respondWithRpcPromise(_0x2996('0x79'),'EventManager',{'event':_0x2996('0x7a'),'message':_0x562bcd['message']},client9002)[_0x2996('0x36')](function(){return _0x562bcd;});}return _0x562bcd;}return null;})[_0x2996('0x36')](respondWithResult(_0x3563eb,null))[_0x2996('0x29')](handleError(_0x3563eb,null));};var interaction_log=require('../../config/logger')(_0x2996('0x5d'));exports[_0x2996('0x34')]=function(_0x288646,_0x24c665,_0x4091a5){var _0x322ca0={'agent':{},'channel':'sms'};if(_0x288646[_0x2996('0x5a')]['id']){delete _0x288646[_0x2996('0x5a')]['id'];}_0x288646['body'][_0x2996('0x62')]=_0x288646[_0x2996('0x5a')][_0x2996('0x62')]||_0x288646['user']['id'];_0x322ca0[_0x2996('0x63')]['id']=_0x288646[_0x2996('0x5a')]['UserId'];return db[_0x2996('0x3d')][_0x2996('0x5b')]({'where':{'id':_0x288646['params']['id'],'UserId':null}})[_0x2996('0x36')](handleEntityNotFound(_0x24c665,null))['then'](function(_0x3fc268){if(_0x3fc268){_0x322ca0[_0x2996('0x27')]=_0x3fc268[_0x2996('0x64')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3fc268[_0x2996('0x7b')]}});}return null;})[_0x2996('0x36')](handleEntityNotFound(_0x24c665,null))[_0x2996('0x36')](function(_0x56f3cb){if(_0x56f3cb){_0x322ca0[_0x2996('0x6a')]=_0x56f3cb[_0x2996('0x64')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x288646[_0x2996('0x68')]['id'],_0x288646['user']['name'],_0x288646[_0x2996('0x68')][_0x2996('0x69')],_0x322ca0['interaction']['id'],_0x288646[_0x2996('0x5a')]?JSON[_0x2996('0x23')](_0x288646['body']):_0x2996('0x6b'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x322ca0);}return null;})[_0x2996('0x36')](function(_0x46fe84){var _0x4b05a3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46fe84[_0x2996('0x27')][_0x2996('0x6e')];return db[_0x2996('0x6f')][_0x2996('0x42')](_0x4b05a3,{'type':db[_0x2996('0x70')][_0x2996('0x71')][_0x2996('0x72')],'raw':!![]})['then'](function(_0x49ce4f){return _0x49ce4f;});})[_0x2996('0x36')](function(_0xa2dcda){if(_0xa2dcda){_0x322ca0[_0x2996('0x27')]['contact']=_0xa2dcda[0x0];if(!_0x288646[_0x2996('0x5a')]['UserId'])return;return db['User']['find']({'where':{'id':_0x288646[_0x2996('0x5a')][_0x2996('0x62')],'role':'agent'},'attributes':['id',_0x2996('0x39'),_0x2996('0x7c'),_0x2996('0x73'),_0x2996('0x74')],'raw':!![]});}return null;})[_0x2996('0x36')](function(_0x3aac20){if(!_0x3aac20)return null;_0x322ca0[_0x2996('0x27')]['agent']=_0x3aac20;return _0x322ca0;})['then'](function(_0x22ce26){if(_0x22ce26){_0x22ce26[_0x2996('0x27')]['interface']=util[_0x2996('0x61')]('SIP/%s',_0x288646[_0x2996('0x68')]['name']);_0x22ce26[_0x2996('0x27')][_0x2996('0x77')]=_0x322ca0[_0x2996('0x77')];_0x22ce26[_0x2996('0x27')][_0x2996('0x7d')]=_0x322ca0[_0x2996('0x77')];_0x22ce26[_0x2996('0x27')][_0x2996('0x78')]=_0x2996('0x34');respondWithRpcPromise('EventManager',_0x2996('0x79'),{'event':'rejectmessage','message':_0x22ce26[_0x2996('0x27')]},client9002);return _0x322ca0;}return null;})[_0x2996('0x36')](respondWithResult(_0x24c665,null))[_0x2996('0x29')](handleError(_0x24c665,null));};exports[_0x2996('0x2b')]=function(_0x4db020,_0xa268ee,_0x36977a){if(_0x4db020[_0x2996('0x5a')]['id']){delete _0x4db020[_0x2996('0x5a')]['id'];}var _0x2253f9;return db[_0x2996('0x3d')][_0x2996('0x5b')]({'where':{'id':_0x4db020[_0x2996('0x58')]['id']}})[_0x2996('0x36')](handleEntityNotFound(_0xa268ee,null))[_0x2996('0x36')](function(_0x2eb2dc){if(_0x2eb2dc){_0x2253f9=_0x2eb2dc;return db['SmsAccount'][_0x2996('0x5b')]({'where':{'id':_0x2eb2dc['SmsAccountId']}});}})[_0x2996('0x36')](handleEntityNotFound(_0xa268ee,null))[_0x2996('0x36')](function(_0x17c177){if(_0x17c177){logger[_0x2996('0x21')](_0x2996('0x22'),'status',_0x2996('0x7e'),_0x17c177[_0x2996('0x40')],util[_0x2996('0x7f')](_0x4db020[_0x2996('0x5a')],{'showHidden':![],'depth':null}));switch(_0x17c177[_0x2996('0x40')]){case'twilio':if(_0x4db020[_0x2996('0x5a')]['MessageSid']&&_0x4db020[_0x2996('0x5a')][_0x2996('0x80')]===_0x2253f9[_0x2996('0x81')]){return _0x2253f9[_0x2996('0x35')]({'read':!![]});}else{logger['error'](_0x2996('0x82'),_0x2996('0x2b'),_0x2996('0x83'),util[_0x2996('0x7f')](_0x4db020[_0x2996('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2996('0x84'):if(_0x4db020[_0x2996('0x5a')]['MessageUUID']&&_0x4db020[_0x2996('0x5a')][_0x2996('0x85')]===_0x2253f9['messageId']&&_[_0x2996('0x86')](['sent',_0x2996('0x87')],_0x4db020[_0x2996('0x5a')][_0x2996('0x88')])>=0x0){return _0x2253f9[_0x2996('0x35')]({'read':!![]});}else{logger[_0x2996('0x24')](_0x2996('0x82'),'status',_0x2996('0x89'),util[_0x2996('0x7f')](_0x4db020['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xa5fbd5=_0x4db020[_0x2996('0x5a')][_0x2996('0x8a')][0x0];if(_0xa5fbd5[_0x2996('0x2b')][_0x2996('0x8b')]===_0x2996('0x8c')){return _0x2253f9[_0x2996('0x35')]({'read':!![]});}else{logger['error'](_0x2996('0x82'),_0x2996('0x2b'),_0x2996('0x8d'),util['inspect'](_0x4db020[_0x2996('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2253f9;}})['then'](respondWithResult(_0xa268ee,null))[_0x2996('0x29')](handleError(_0xa268ee,null));}; \ No newline at end of file +var _0x8c28=['delivered','Status','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','destroy','stack','name','send','SmsMessage','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','filters','find','create','body','describe','sms-interactions','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','internal','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID'];(function(_0x4997f4,_0x184696){var _0x231d76=function(_0x159b4b){while(--_0x159b4b){_0x4997f4['push'](_0x4997f4['shift']());}};_0x231d76(++_0x184696);}(_0x8c28,0x1c8));var _0x88c2=function(_0x19e699,_0x466613){_0x19e699=_0x19e699-0x0;var _0x50902b=_0x8c28[_0x19e699];return _0x50902b;};'use strict';var emlformat=require(_0x88c2('0x0'));var rimraf=require(_0x88c2('0x1'));var zipdir=require(_0x88c2('0x2'));var jsonpatch=require(_0x88c2('0x3'));var rp=require('request-promise');var moment=require(_0x88c2('0x4'));var BPromise=require(_0x88c2('0x5'));var Mustache=require('mustache');var util=require(_0x88c2('0x6'));var path=require(_0x88c2('0x7'));var sox=require(_0x88c2('0x8'));var csv=require(_0x88c2('0x9'));var ejs=require(_0x88c2('0xa'));var fs=require('fs');var fs_extra=require(_0x88c2('0xb'));var _=require('lodash');var squel=require(_0x88c2('0xc'));var crypto=require(_0x88c2('0xd'));var jsforce=require(_0x88c2('0xe'));var deskjs=require(_0x88c2('0xf'));var toCsv=require(_0x88c2('0x9'));var querystring=require(_0x88c2('0x10'));var Papa=require(_0x88c2('0x11'));var Redis=require(_0x88c2('0x12'));var authService=require(_0x88c2('0x13'));var qs=require(_0x88c2('0x14'));var as=require(_0x88c2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88c2('0x16'))('api');var utils=require(_0x88c2('0x17'));var config=require(_0x88c2('0x18'));var licenseUtil=require(_0x88c2('0x19'));var db=require(_0x88c2('0x1a'))['db'];config[_0x88c2('0x1b')]=_['defaults'](config[_0x88c2('0x1b')],{'host':_0x88c2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88c2('0x1b')]));require(_0x88c2('0x1d'))[_0x88c2('0x1e')](socket);var jayson=require(_0x88c2('0x1f'));var client=jayson[_0x88c2('0x20')][_0x88c2('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x88c2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3eebc2,_0x5d50c6,_0x443bbc,_0xf5bc9b){return new BPromise(function(_0x46f0f4,_0x445b8c){var _0x51084c=_0xf5bc9b||client;return _0x51084c[_0x88c2('0x22')](_0x3eebc2,_0x443bbc)[_0x88c2('0x23')](function(_0x315859){logger[_0x88c2('0x24')](_0x88c2('0x25'),_0x5d50c6,_0x88c2('0x26'));logger['debug'](_0x88c2('0x27'),_0x5d50c6,_0x88c2('0x26'),JSON[_0x88c2('0x28')](_0x315859));if(_0x315859[_0x88c2('0x29')]){if(_0x315859[_0x88c2('0x29')][_0x88c2('0x2a')]===0x1f4){logger['error'](_0x88c2('0x25'),_0x5d50c6,_0x315859[_0x88c2('0x29')][_0x88c2('0x2b')]);return _0x445b8c(_0x315859[_0x88c2('0x29')]['message']);}logger[_0x88c2('0x29')](_0x88c2('0x25'),_0x5d50c6,_0x315859[_0x88c2('0x29')][_0x88c2('0x2b')]);return _0x46f0f4(_0x315859['error'][_0x88c2('0x2b')]);}else{logger[_0x88c2('0x24')](_0x88c2('0x25'),_0x5d50c6,_0x88c2('0x26'));_0x46f0f4(_0x315859[_0x88c2('0x2c')][_0x88c2('0x2b')]);}})['catch'](function(_0x1af98c){logger[_0x88c2('0x29')](_0x88c2('0x25'),_0x5d50c6,_0x1af98c);_0x445b8c(_0x1af98c);});});}function respondWithStatusCode(_0x37f725,_0x12416c){_0x12416c=_0x12416c||0xcc;return function(_0x45cfdb){if(_0x45cfdb){return _0x37f725[_0x88c2('0x2d')](_0x12416c);}return _0x37f725[_0x88c2('0x2e')](_0x12416c)[_0x88c2('0x2f')]();};}function respondWithResult(_0xb8718a,_0x379dac){_0x379dac=_0x379dac||0xc8;return function(_0x18e3f4){if(_0x18e3f4){return _0xb8718a[_0x88c2('0x2e')](_0x379dac)[_0x88c2('0x30')](_0x18e3f4);}};}function respondWithFilteredResult(_0x29c39a,_0x157bc8){return function(_0x4448d4){if(_0x4448d4){var _0x3d706b=typeof _0x157bc8[_0x88c2('0x31')]===_0x88c2('0x32')&&typeof _0x157bc8[_0x88c2('0x33')]===_0x88c2('0x32');var _0x92cbad=_0x4448d4['count'];var _0x208e47=_0x3d706b?0x0:_0x157bc8['offset'];var _0x33be39=_0x3d706b?_0x4448d4['count']:_0x157bc8[_0x88c2('0x31')]+_0x157bc8[_0x88c2('0x33')];var _0x1428e1;if(_0x33be39>=_0x92cbad){_0x33be39=_0x92cbad;_0x1428e1=0xc8;}else{_0x1428e1=0xce;}_0x29c39a['status'](_0x1428e1);return _0x29c39a['set'](_0x88c2('0x34'),_0x208e47+'-'+_0x33be39+'/'+_0x92cbad)['json'](_0x4448d4);}return null;};}function patchUpdates(_0x34f7cb){return function(_0x30c8eb){try{jsonpatch[_0x88c2('0x35')](_0x30c8eb,_0x34f7cb,!![]);}catch(_0x148a49){return BPromise['reject'](_0x148a49);}return _0x30c8eb[_0x88c2('0x36')]();};}function saveUpdates(_0x1d7fbc,_0x29c7b8){return function(_0x25532d){if(_0x25532d){return _0x25532d[_0x88c2('0x37')](_0x1d7fbc)[_0x88c2('0x23')](function(_0x3c1150){return _0x3c1150;});}return null;};}function removeEntity(_0x3e8638,_0x34abcb){return function(_0x29b823){if(_0x29b823){return _0x29b823[_0x88c2('0x38')]()[_0x88c2('0x23')](function(){_0x3e8638[_0x88c2('0x2e')](0xcc)[_0x88c2('0x2f')]();});}};}function handleEntityNotFound(_0x3aa4f4,_0x52360a){return function(_0x42e0d9){if(!_0x42e0d9){_0x3aa4f4[_0x88c2('0x2d')](0x194);}return _0x42e0d9;};}function handleError(_0x4f4705,_0x2390e4){_0x2390e4=_0x2390e4||0x1f4;return function(_0x4c4fe2){logger[_0x88c2('0x29')](_0x4c4fe2[_0x88c2('0x39')]);if(_0x4c4fe2[_0x88c2('0x3a')]){delete _0x4c4fe2[_0x88c2('0x3a')];}_0x4f4705[_0x88c2('0x2e')](_0x2390e4)[_0x88c2('0x3b')](_0x4c4fe2);};}exports['index']=function(_0x570077,_0x51bb0f){var _0x150e4e={},_0x200b5f={},_0x4d178d={'count':0x0,'rows':[]};var _0x5e8b4a=_['map'](db[_0x88c2('0x3c')]['rawAttributes'],function(_0x3bc421){return{'name':_0x3bc421[_0x88c2('0x3d')],'type':_0x3bc421['type'][_0x88c2('0x3e')]};});_0x200b5f['model']=_[_0x88c2('0x3f')](_0x5e8b4a,_0x88c2('0x3a'));_0x200b5f[_0x88c2('0x40')]=_[_0x88c2('0x41')](_0x570077[_0x88c2('0x40')]);_0x200b5f['filters']=_[_0x88c2('0x42')](_0x200b5f[_0x88c2('0x43')],_0x200b5f[_0x88c2('0x40')]);_0x150e4e[_0x88c2('0x44')]=_['intersection'](_0x200b5f['model'],qs['fields'](_0x570077[_0x88c2('0x40')][_0x88c2('0x45')]));_0x150e4e[_0x88c2('0x44')]=_0x150e4e['attributes'][_0x88c2('0x46')]?_0x150e4e['attributes']:_0x200b5f[_0x88c2('0x43')];if(!_0x570077[_0x88c2('0x40')][_0x88c2('0x47')](_0x88c2('0x48'))){_0x150e4e[_0x88c2('0x33')]=qs['limit'](_0x570077[_0x88c2('0x40')][_0x88c2('0x33')]);_0x150e4e[_0x88c2('0x31')]=qs['offset'](_0x570077[_0x88c2('0x40')]['offset']);}_0x150e4e[_0x88c2('0x49')]=qs[_0x88c2('0x4a')](_0x570077[_0x88c2('0x40')][_0x88c2('0x4a')]);_0x150e4e[_0x88c2('0x4b')]=qs['filters'](_[_0x88c2('0x4c')](_0x570077[_0x88c2('0x40')],_0x200b5f['filters']),_0x5e8b4a);if(_0x570077[_0x88c2('0x40')][_0x88c2('0x4d')]){_0x150e4e[_0x88c2('0x4b')]=_[_0x88c2('0x4e')](_0x150e4e[_0x88c2('0x4b')],{'$or':_['map'](_0x5e8b4a,function(_0x2540e9){if(_0x2540e9[_0x88c2('0x4f')]!==_0x88c2('0x50')){var _0x5d777f={};_0x5d777f[_0x2540e9[_0x88c2('0x3a')]]={'$like':'%'+_0x570077[_0x88c2('0x40')][_0x88c2('0x4d')]+'%'};return _0x5d777f;}})});}_0x150e4e=_[_0x88c2('0x4e')]({},_0x150e4e,_0x570077[_0x88c2('0x51')]);var _0x454788={'where':_0x150e4e['where']};return db[_0x88c2('0x3c')]['count'](_0x454788)['then'](function(_0x53aad4){_0x4d178d[_0x88c2('0x52')]=_0x53aad4;if(_0x570077[_0x88c2('0x40')][_0x88c2('0x53')]){_0x150e4e[_0x88c2('0x54')]=[{'all':!![]}];}return db[_0x88c2('0x3c')][_0x88c2('0x55')](_0x150e4e);})['then'](function(_0x1e045e){_0x4d178d['rows']=_0x1e045e;return _0x4d178d;})['then'](respondWithFilteredResult(_0x51bb0f,_0x150e4e))[_0x88c2('0x56')](handleError(_0x51bb0f,null));};exports[_0x88c2('0x57')]=function(_0x5457dc,_0x3c20a1){var _0xc190e3={'raw':!![],'where':{'id':_0x5457dc[_0x88c2('0x58')]['id']}},_0xbf5ba7={};_0xbf5ba7[_0x88c2('0x43')]=_[_0x88c2('0x41')](db[_0x88c2('0x3c')]['rawAttributes']);_0xbf5ba7[_0x88c2('0x40')]=_[_0x88c2('0x41')](_0x5457dc[_0x88c2('0x40')]);_0xbf5ba7[_0x88c2('0x59')]=_[_0x88c2('0x42')](_0xbf5ba7['model'],_0xbf5ba7['query']);_0xc190e3['attributes']=_['intersection'](_0xbf5ba7['model'],qs[_0x88c2('0x45')](_0x5457dc['query'][_0x88c2('0x45')]));_0xc190e3['attributes']=_0xc190e3[_0x88c2('0x44')][_0x88c2('0x46')]?_0xc190e3[_0x88c2('0x44')]:_0xbf5ba7[_0x88c2('0x43')];if(_0x5457dc[_0x88c2('0x40')]['includeAll']){_0xc190e3[_0x88c2('0x54')]=[{'all':!![]}];}_0xc190e3=_[_0x88c2('0x4e')]({},_0xc190e3,_0x5457dc[_0x88c2('0x51')]);return db[_0x88c2('0x3c')][_0x88c2('0x5a')](_0xc190e3)[_0x88c2('0x23')](handleEntityNotFound(_0x3c20a1,null))[_0x88c2('0x23')](respondWithResult(_0x3c20a1,null))[_0x88c2('0x56')](handleError(_0x3c20a1,null));};exports[_0x88c2('0x5b')]=function(_0x4150b0,_0x149f2d){return db[_0x88c2('0x3c')][_0x88c2('0x5b')](_0x4150b0[_0x88c2('0x5c')],{})['then'](respondWithResult(_0x149f2d,0xc9))[_0x88c2('0x56')](handleError(_0x149f2d,null));};exports[_0x88c2('0x37')]=function(_0x3af3a0,_0xe9cac2){if(_0x3af3a0[_0x88c2('0x5c')]['id']){delete _0x3af3a0[_0x88c2('0x5c')]['id'];}return db['SmsMessage'][_0x88c2('0x5a')]({'where':{'id':_0x3af3a0[_0x88c2('0x58')]['id']}})['then'](handleEntityNotFound(_0xe9cac2,null))[_0x88c2('0x23')](saveUpdates(_0x3af3a0[_0x88c2('0x5c')],null))[_0x88c2('0x23')](respondWithResult(_0xe9cac2,null))[_0x88c2('0x56')](handleError(_0xe9cac2,null));};exports['destroy']=function(_0x5ad859,_0x56ebcb){return db[_0x88c2('0x3c')][_0x88c2('0x5a')]({'where':{'id':_0x5ad859[_0x88c2('0x58')]['id']}})[_0x88c2('0x23')](handleEntityNotFound(_0x56ebcb,null))['then'](removeEntity(_0x56ebcb,null))[_0x88c2('0x56')](handleError(_0x56ebcb,null));};exports[_0x88c2('0x5d')]=function(_0x4e017c,_0x24596a){return db['SmsMessage']['describe']()[_0x88c2('0x23')](respondWithResult(_0x24596a,null))[_0x88c2('0x56')](handleError(_0x24596a,null));};var interaction_log=require(_0x88c2('0x16'))(_0x88c2('0x5e'));exports['accept']=function(_0x21b94c,_0x1eea29,_0x3fde5c){var _0x4efddc={'agent':{},'channel':_0x88c2('0x5f')};if(_0x21b94c[_0x88c2('0x5c')]['id']){delete _0x21b94c[_0x88c2('0x5c')]['id'];}_0x21b94c[_0x88c2('0x5c')][_0x88c2('0x60')]=!![];_0x21b94c[_0x88c2('0x5c')][_0x88c2('0x61')]=moment()['format'](_0x88c2('0x62'));_0x21b94c['body'][_0x88c2('0x63')]=_0x21b94c[_0x88c2('0x5c')]['UserId']||_0x21b94c[_0x88c2('0x64')]['id'];_0x4efddc[_0x88c2('0x65')]['id']=_0x21b94c['body'][_0x88c2('0x63')];return db[_0x88c2('0x3c')][_0x88c2('0x5a')]({'where':{'id':_0x21b94c[_0x88c2('0x58')]['id'],'UserId':null}})[_0x88c2('0x23')](handleEntityNotFound(_0x1eea29,null))[_0x88c2('0x23')](saveUpdates(_0x21b94c[_0x88c2('0x5c')],null))[_0x88c2('0x23')](function(_0x59f017){if(_0x59f017){_0x4efddc[_0x88c2('0x2b')]=_0x59f017[_0x88c2('0x66')]({'plain':!![]});return db['SmsInteraction'][_0x88c2('0x5a')]({'where':{'id':_0x59f017['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1eea29,null))[_0x88c2('0x23')](function(_0x331ea7){if(_0x331ea7){return _0x331ea7[_0x88c2('0x37')]({'UserId':_0x21b94c['body']['UserId'],'read1stAt':_[_0x88c2('0x67')](_0x331ea7[_0x88c2('0x68')])?moment()[_0x88c2('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x88c2('0x23')](function(_0x1b5452){if(_0x1b5452){_0x4efddc[_0x88c2('0x6a')]=_0x1b5452[_0x88c2('0x66')]({'plain':!![]});interaction_log[_0x88c2('0x24')](_0x88c2('0x6b'),_0x21b94c[_0x88c2('0x64')]['id'],_0x21b94c[_0x88c2('0x64')][_0x88c2('0x3a')],_0x21b94c[_0x88c2('0x64')][_0x88c2('0x6c')],_0x4efddc[_0x88c2('0x6a')]['id'],_0x21b94c[_0x88c2('0x5c')]?JSON[_0x88c2('0x28')](_0x21b94c['body']):'null');return respondWithRpcPromise(_0x88c2('0x6d'),_0x88c2('0x6e'),_0x4efddc);}return null;})[_0x88c2('0x23')](function(_0x3cb85d){var _0x597181='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cb85d[_0x88c2('0x2b')][_0x88c2('0x6f')];return db['sequelize'][_0x88c2('0x40')](_0x597181,{'type':db[_0x88c2('0x70')][_0x88c2('0x71')][_0x88c2('0x72')],'raw':!![]})[_0x88c2('0x23')](function(_0xceea14){return _0xceea14;});})[_0x88c2('0x23')](function(_0x52cf5a){if(_0x52cf5a){_0x4efddc['message'][_0x88c2('0x73')]=_0x52cf5a[0x0];if(!_0x21b94c[_0x88c2('0x5c')][_0x88c2('0x63')])return;return db[_0x88c2('0x74')][_0x88c2('0x5a')]({'where':{'id':_0x21b94c[_0x88c2('0x5c')][_0x88c2('0x63')],'role':'agent'},'attributes':['id',_0x88c2('0x3a'),_0x88c2('0x75'),_0x88c2('0x76'),'internal'],'raw':!![]});}return null;})[_0x88c2('0x23')](function(_0x31124f){if(!_0x31124f)return null;_0x4efddc[_0x88c2('0x2b')][_0x88c2('0x65')]=_0x31124f;return _0x4efddc;})['then'](function(_0x2096bb){if(_0x2096bb){if(_0x21b94c['body']['manual']){_0x4efddc[_0x88c2('0x2b')][_0x88c2('0x77')]=util[_0x88c2('0x69')](_0x88c2('0x78'),_0x21b94c[_0x88c2('0x64')][_0x88c2('0x3a')]);_0x4efddc[_0x88c2('0x2b')][_0x88c2('0x79')]=_0x4efddc[_0x88c2('0x79')];_0x4efddc[_0x88c2('0x2b')][_0x88c2('0x7a')]=_0x4efddc[_0x88c2('0x79')];_0x4efddc[_0x88c2('0x2b')][_0x88c2('0x7b')]='accept';return respondWithRpcPromise(_0x88c2('0x7c'),'EventManager',{'event':_0x88c2('0x7d'),'message':_0x4efddc[_0x88c2('0x2b')]},client9002)['then'](function(){return _0x4efddc;});}return _0x4efddc;}return null;})[_0x88c2('0x23')](respondWithResult(_0x1eea29,null))[_0x88c2('0x56')](handleError(_0x1eea29,null));};var interaction_log=require(_0x88c2('0x16'))(_0x88c2('0x5e'));exports[_0x88c2('0x7e')]=function(_0x515d3c,_0x48eae1,_0x15646a){var _0x3898af={'agent':{},'channel':_0x88c2('0x5f')};if(_0x515d3c[_0x88c2('0x5c')]['id']){delete _0x515d3c[_0x88c2('0x5c')]['id'];}_0x515d3c[_0x88c2('0x5c')][_0x88c2('0x63')]=_0x515d3c[_0x88c2('0x5c')][_0x88c2('0x63')]||_0x515d3c[_0x88c2('0x64')]['id'];_0x3898af[_0x88c2('0x65')]['id']=_0x515d3c['body']['UserId'];return db['SmsMessage'][_0x88c2('0x5a')]({'where':{'id':_0x515d3c[_0x88c2('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48eae1,null))['then'](function(_0x46d0c5){if(_0x46d0c5){_0x3898af[_0x88c2('0x2b')]=_0x46d0c5[_0x88c2('0x66')]({'plain':!![]});return db[_0x88c2('0x7f')][_0x88c2('0x5a')]({'where':{'id':_0x46d0c5['SmsInteractionId']}});}return null;})[_0x88c2('0x23')](handleEntityNotFound(_0x48eae1,null))['then'](function(_0x39353e){if(_0x39353e){_0x3898af[_0x88c2('0x6a')]=_0x39353e['get']({'plain':!![]});interaction_log[_0x88c2('0x24')](_0x88c2('0x80'),_0x515d3c[_0x88c2('0x64')]['id'],_0x515d3c[_0x88c2('0x64')]['name'],_0x515d3c[_0x88c2('0x64')]['role'],_0x3898af[_0x88c2('0x6a')]['id'],_0x515d3c[_0x88c2('0x5c')]?JSON['stringify'](_0x515d3c[_0x88c2('0x5c')]):'null');return respondWithRpcPromise('RejectMessage',_0x88c2('0x81'),_0x3898af);}return null;})[_0x88c2('0x23')](function(_0x16ec08){var _0x20b1da=_0x88c2('0x82')+_0x16ec08[_0x88c2('0x2b')][_0x88c2('0x6f')];return db[_0x88c2('0x83')][_0x88c2('0x40')](_0x20b1da,{'type':db[_0x88c2('0x70')][_0x88c2('0x71')][_0x88c2('0x72')],'raw':!![]})[_0x88c2('0x23')](function(_0x554060){return _0x554060;});})[_0x88c2('0x23')](function(_0xe24175){if(_0xe24175){_0x3898af[_0x88c2('0x2b')][_0x88c2('0x73')]=_0xe24175[0x0];if(!_0x515d3c['body'][_0x88c2('0x63')])return;return db[_0x88c2('0x74')][_0x88c2('0x5a')]({'where':{'id':_0x515d3c[_0x88c2('0x5c')][_0x88c2('0x63')],'role':_0x88c2('0x65')},'attributes':['id',_0x88c2('0x3a'),'fullname',_0x88c2('0x76'),_0x88c2('0x84')],'raw':!![]});}return null;})[_0x88c2('0x23')](function(_0x5067fd){if(!_0x5067fd)return null;_0x3898af[_0x88c2('0x2b')]['agent']=_0x5067fd;return _0x3898af;})[_0x88c2('0x23')](function(_0x454f0e){if(_0x454f0e){_0x454f0e[_0x88c2('0x2b')][_0x88c2('0x77')]=util[_0x88c2('0x69')]('SIP/%s',_0x515d3c[_0x88c2('0x64')][_0x88c2('0x3a')]);_0x454f0e[_0x88c2('0x2b')][_0x88c2('0x79')]=_0x3898af['channel'];_0x454f0e[_0x88c2('0x2b')][_0x88c2('0x7a')]=_0x3898af[_0x88c2('0x79')];_0x454f0e['message']['event']=_0x88c2('0x7e');respondWithRpcPromise(_0x88c2('0x7c'),_0x88c2('0x7c'),{'event':'rejectmessage','message':_0x454f0e[_0x88c2('0x2b')]},client9002);return _0x3898af;}return null;})[_0x88c2('0x23')](respondWithResult(_0x48eae1,null))[_0x88c2('0x56')](handleError(_0x48eae1,null));};exports['status']=function(_0x6fe7f6,_0x497bcd,_0x66f792){if(_0x6fe7f6[_0x88c2('0x5c')]['id']){delete _0x6fe7f6['body']['id'];}var _0xbf398f;return db[_0x88c2('0x3c')][_0x88c2('0x5a')]({'where':{'id':_0x6fe7f6[_0x88c2('0x58')]['id']}})['then'](handleEntityNotFound(_0x497bcd,null))[_0x88c2('0x23')](function(_0x2f15e8){if(_0x2f15e8){_0xbf398f=_0x2f15e8;return db[_0x88c2('0x85')]['find']({'where':{'id':_0x2f15e8[_0x88c2('0x86')]}});}})[_0x88c2('0x23')](handleEntityNotFound(_0x497bcd,null))['then'](function(_0x43a66f){if(_0x43a66f){logger[_0x88c2('0x87')](_0x88c2('0x27'),'status',_0x88c2('0x88'),_0x43a66f['type'],util[_0x88c2('0x89')](_0x6fe7f6[_0x88c2('0x5c')],{'showHidden':![],'depth':null}));switch(_0x43a66f[_0x88c2('0x4f')]){case _0x88c2('0x8a'):if(_0x6fe7f6[_0x88c2('0x5c')]['MessageSid']&&_0x6fe7f6[_0x88c2('0x5c')][_0x88c2('0x8b')]===_0xbf398f[_0x88c2('0x8c')]){return _0xbf398f[_0x88c2('0x37')]({'read':!![]});}else{logger[_0x88c2('0x29')](_0x88c2('0x8d'),_0x88c2('0x2e'),_0x88c2('0x8a'),util[_0x88c2('0x89')](_0x6fe7f6[_0x88c2('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x88c2('0x8e'):if(_0x6fe7f6[_0x88c2('0x5c')][_0x88c2('0x8f')]&&_0x6fe7f6['body'][_0x88c2('0x8f')]===_0xbf398f[_0x88c2('0x8c')]&&_['indexOf'](['sent',_0x88c2('0x90')],_0x6fe7f6[_0x88c2('0x5c')][_0x88c2('0x91')])>=0x0){return _0xbf398f[_0x88c2('0x37')]({'read':!![]});}else{logger[_0x88c2('0x29')](_0x88c2('0x8d'),_0x88c2('0x2e'),'plivio',util[_0x88c2('0x89')](_0x6fe7f6[_0x88c2('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x88c2('0x92'):var _0x58fe5d=_0x6fe7f6[_0x88c2('0x5c')][_0x88c2('0x93')][0x0];if(_0x58fe5d[_0x88c2('0x2e')][_0x88c2('0x94')]===_0x88c2('0x95')){return _0xbf398f[_0x88c2('0x37')]({'read':!![]});}else{logger[_0x88c2('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x88c2('0x89')](_0x6fe7f6['body'],{'showHidden':![],'depth':null}));}break;}return _0xbf398f;}})['then'](respondWithResult(_0x497bcd,null))[_0x88c2('0x56')](handleError(_0x497bcd,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1f27e3e..9653a33 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 _0x659e=['exports','events','save','remove','emit','hasOwnProperty','hook'];(function(_0x596c5c,_0x57a91b){var _0x1df9bc=function(_0x1eb6bc){while(--_0x1eb6bc){_0x596c5c['push'](_0x596c5c['shift']());}};_0x1df9bc(++_0x57a91b);}(_0x659e,0x86));var _0xe659=function(_0x78bf5b,_0x1e0d01){_0x78bf5b=_0x78bf5b-0x0;var _0x3a63fd=_0x659e[_0x78bf5b];return _0x3a63fd;};'use strict';var EventEmitter=require(_0xe659('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe659('0x1'),'afterUpdate':'update','afterDestroy':_0xe659('0x2')};function emitEvent(_0x4e98f3){return function(_0x257e17,_0x3eedba,_0x27a7a2){SmsMessageEvents['emit'](_0x4e98f3+':'+_0x257e17['id'],_0x257e17);SmsMessageEvents[_0xe659('0x3')](_0x4e98f3,_0x257e17);_0x27a7a2(null);};}for(var e in events){if(events[_0xe659('0x4')](e)){var event=events[e];SmsMessage[_0xe659('0x5')](e,emitEvent(event));}}module[_0xe659('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x75a2=['remove','emit','hasOwnProperty','exports','events','setMaxListeners','update'];(function(_0x549079,_0x534529){var _0xb1f888=function(_0x4e8a0b){while(--_0x4e8a0b){_0x549079['push'](_0x549079['shift']());}};_0xb1f888(++_0x534529);}(_0x75a2,0x162));var _0x275a=function(_0xa9579d,_0x2729bf){_0xa9579d=_0xa9579d-0x0;var _0x5c5716=_0x75a2[_0xa9579d];return _0x5c5716;};'use strict';var EventEmitter=require(_0x275a('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x275a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x275a('0x2'),'afterDestroy':_0x275a('0x3')};function emitEvent(_0x31b3ca){return function(_0x54a3e6,_0x541d05,_0xeff7e4){SmsMessageEvents[_0x275a('0x4')](_0x31b3ca+':'+_0x54a3e6['id'],_0x54a3e6);SmsMessageEvents[_0x275a('0x4')](_0x31b3ca,_0x54a3e6);_0xeff7e4(null);};}for(var e in events){if(events[_0x275a('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x275a('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 2a93b4a..a9a418a 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 _0x3a4d=['refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','GET','sms','POST','user_key','session_key','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','sender','text','keys','sort','apiKey','createHash','digest','hex','signature=','csc','Missing\x20parameters:\x20apiKey','UTF-8','clickatell','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','/messages','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr'];(function(_0x595619,_0x3b7ea6){var _0x30a1e4=function(_0x354040){while(--_0x354040){_0x595619['push'](_0x595619['shift']());}};_0x30a1e4(++_0x3b7ea6);}(_0x3a4d,0x1d2));var _0xd3a4=function(_0x1eaf9a,_0x4a10c3){_0x1eaf9a=_0x1eaf9a-0x0;var _0x1fbedb=_0x3a4d[_0x1eaf9a];return _0x1fbedb;};'use strict';var _=require(_0xd3a4('0x0'));var util=require(_0xd3a4('0x1'));var logger=require(_0xd3a4('0x2'))(_0xd3a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3a4('0x4'));var fs=require('fs');var path=require(_0xd3a4('0x5'));var rimraf=require(_0xd3a4('0x6'));var config=require(_0xd3a4('0x7'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x41ae90,_0x5d9ddb){return _0x41ae90['define'](_0xd3a4('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd3a4('0x9'),'fields':['messageId']},{'name':_0xd3a4('0xa'),'fields':[_0xd3a4('0xb')],'type':_0xd3a4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x10037d,_0x3b30ae,_0x42b6ab){var _0xc25738=_0x41ae90[_0xd3a4('0xd')];var _0x113ccf=_0x10037d[_0xd3a4('0xe')]({'plain':!![]});if(_0x113ccf[_0xd3a4('0xf')][_0xd3a4('0x10')]()==='in'||_0x113ccf[_0xd3a4('0xf')][_0xd3a4('0x10')]()==='out'&&!_0x113ccf[_0xd3a4('0x11')]&&!_[_0xd3a4('0x12')](_0x113ccf[_0xd3a4('0x13')])&&!_[_0xd3a4('0x12')](_0x113ccf[_0xd3a4('0x14')])){_0xc25738['SmsInteraction'][_0xd3a4('0x15')]({'where':{'id':_0x113ccf[_0xd3a4('0x14')]}})[_0xd3a4('0x16')](function(_0x11a4e5){if(_0x11a4e5){_0x11a4e5[_0xd3a4('0x17')]({'lastMsgAt':_0x113ccf[_0xd3a4('0x18')],'lastMsgDirection':_0x113ccf[_0xd3a4('0xf')]['toLowerCase']()});}})[_0xd3a4('0x19')](function(_0x36c11e){console[_0xd3a4('0x1a')](_0x36c11e);});}if(_0x113ccf['direction']===_0xd3a4('0x1b')&&!_0x113ccf[_0xd3a4('0x11')]){var _0x5102e7;_0xc25738[_0xd3a4('0x1c')][_0xd3a4('0x1d')]({'where':{'id':_0x113ccf[_0xd3a4('0x1e')]},'raw':!![]})[_0xd3a4('0x16')](function(_0x23775f){_0x5102e7=_0x23775f;if(_0x5102e7&&_0x5102e7[_0xd3a4('0x1f')]){switch(_0x5102e7[_0xd3a4('0x1f')]){case _0xd3a4('0x20'):var _0x8b2571=require('twilio');if(_0x5102e7[_0xd3a4('0x21')]&&_0x5102e7['authToken']&&_0x5102e7['phone']){var _0x37670a=new _0x8b2571(_0x5102e7[_0xd3a4('0x21')],_0x5102e7['authToken']);_0x37670a['messages'][_0xd3a4('0x22')]({'body':_0x113ccf['body'],'to':_0x113ccf[_0xd3a4('0x23')],'from':_0x5102e7['phone'],'statusCallback':_0x5102e7[_0xd3a4('0x24')]+_0xd3a4('0x25')+_0x113ccf['id']+_0xd3a4('0x26')+_0x5102e7[_0xd3a4('0x27')]})[_0xd3a4('0x16')](function(_0x3b2438){if(_0x3b2438[_0xd3a4('0x28')]){return _0x10037d[_0xd3a4('0x17')]({'messageId':_0x3b2438[_0xd3a4('0x28')]});}})['catch'](function(_0x4800fe){logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util[_0xd3a4('0x29')](_0x4800fe,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x2c4ce6=_0xd3a4('0x2c');if(_0x5102e7[_0xd3a4('0x2d')]&&_0x5102e7[_0xd3a4('0x2e')]){var _0x3be3c6={'recipient':[_0x113ccf['phone']],'message':_0x113ccf[_0xd3a4('0xb')],'message_type':_0x5102e7[_0xd3a4('0x2f')]};if(_0x5102e7['smsMethod']&&_0x5102e7[_0xd3a4('0x2f')]!=='SI'){_0x3be3c6['sender']=_0x5102e7['phone'];}var _0x479cba={'url':_0x2c4ce6+'login?username='+_0x5102e7[_0xd3a4('0x2d')]+'&password='+_0x5102e7[_0xd3a4('0x2e')],'method':_0xd3a4('0x30')};rp(_0x479cba)[_0xd3a4('0x16')](function(_0x5f73b2){var _0x5088af=_0x5f73b2['split'](';');var _0xa7da3={'user_key':_0x5088af[0x0],'session_key':_0x5088af[0x1]};_0x479cba={'url':_0x2c4ce6+_0xd3a4('0x31'),'method':_0xd3a4('0x32'),'headers':{'user_key':_0xa7da3[_0xd3a4('0x33')],'Session_key':_0xa7da3[_0xd3a4('0x34')]},'json':!![],'body':_0x3be3c6};return rp(_0x479cba);})[_0xd3a4('0x16')](function(_0xddbcd0){if(_0xddbcd0['total_sent']>=0x1){var _0x2faf0a={'messageId':_0xddbcd0['internal_order_id']};if(_0x5102e7['smsMethod']!=='GP'||!_0x5102e7[_0xd3a4('0x35')]){_0x2faf0a[_0xd3a4('0x36')]=!![];}return _0x10037d[_0xd3a4('0x17')](_0x2faf0a);}else{return logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'skebby',util[_0xd3a4('0x29')](_0xddbcd0,{'showHidden':![],'depth':null}));}})[_0xd3a4('0x19')](function(_0x11fa35){return logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x37'),util[_0xd3a4('0x29')](_0x11fa35,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a4('0x2b'),_0xd3a4('0x37'),_0xd3a4('0x38'));}break;case _0xd3a4('0x39'):if(_0x5102e7['authToken']){var _0x26a54a={'recipient':_0x113ccf[_0xd3a4('0x23')],'message':_0x113ccf[_0xd3a4('0xb')],'sender':_0x5102e7[_0xd3a4('0x3a')]||_0x5102e7[_0xd3a4('0x23')],'authorization':_0x5102e7[_0xd3a4('0x3b')]};var _0x3b30ae={'method':_0xd3a4('0x32'),'uri':_0xd3a4('0x3c'),'body':_0x26a54a,'json':!![]};rp(_0x3b30ae)[_0xd3a4('0x16')](function(_0x1f1231){var _0x2dd3e4={'messageId':_0x1f1231[_0xd3a4('0x3d')]};if(!_0x5102e7[_0xd3a4('0x35')]){_0x2dd3e4[_0xd3a4('0x36')]=!![];}return _0x10037d[_0xd3a4('0x17')](_0x2dd3e4);})['catch'](function(_0xa9bfa9){logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a4('0x2b'),'connectel',util[_0xd3a4('0x29')](_0xa9bfa9,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xd3a4('0x3e'):if(_0x5102e7['username']&&_0x5102e7[_0xd3a4('0x2e')]){var _0x26a54a={'messages':[{'source':_0xd3a4('0x3f'),'to':_0x113ccf[_0xd3a4('0x23')],'body':_0x113ccf[_0xd3a4('0xb')],'from':_0x5102e7[_0xd3a4('0x3a')]||_0x5102e7[_0xd3a4('0x23')]}]};var _0x4a78a0=util[_0xd3a4('0x40')]('%s:%s',_0x5102e7['username'],_0x5102e7[_0xd3a4('0x2e')]);var _0x3b30ae={'method':_0xd3a4('0x32'),'uri':_0xd3a4('0x41'),'body':_0x26a54a,'headers':{'Authorization':util[_0xd3a4('0x40')](_0xd3a4('0x42'),new Buffer(_0x4a78a0)[_0xd3a4('0x43')](_0xd3a4('0x44')))},'json':!![]};rp(_0x3b30ae)[_0xd3a4('0x16')](function(_0x4e5a84){if(_0x4e5a84[_0xd3a4('0x45')]>=0xc8&&_0x4e5a84[_0xd3a4('0x45')]<=0xce){if(_0x4e5a84[_0xd3a4('0x46')]&&_0x4e5a84['data'][_0xd3a4('0x47')]>0x0){var _0x301cbe=_[_0xd3a4('0x48')](_0x4e5a84[_0xd3a4('0x46')][_0xd3a4('0x49')]);var _0x191c34={'messageId':_0x301cbe[_0xd3a4('0x4a')]};if(!_0x5102e7[_0xd3a4('0x35')]){_0x191c34[_0xd3a4('0x36')]=!![];}return _0x10037d[_0xd3a4('0x17')](_0x191c34);}else{logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),'afterCreate',_0xd3a4('0x4b'),util['inspect'](_0x4e5a84,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'clickSend',util['inspect'](_0x4e5a84,{'showHidden':![],'depth':null}));}})[_0xd3a4('0x19')](function(_0x2ba7f7){logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),'afterCreate',_0xd3a4('0x4b'),util[_0xd3a4('0x29')](_0x2ba7f7,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x4b'),_0xd3a4('0x38'));}break;case'plivo':if(_0x5102e7[_0xd3a4('0x4c')]&&_0x5102e7[_0xd3a4('0x3b')]){var _0x26a54a={'dst':_0x113ccf[_0xd3a4('0x23')],'text':_0x113ccf[_0xd3a4('0xb')],'src':_0x5102e7[_0xd3a4('0x3a')]||_0x5102e7[_0xd3a4('0x23')],'url':_0x5102e7['remote']+_0xd3a4('0x25')+_0x113ccf['id']+_0xd3a4('0x26')+_0x5102e7[_0xd3a4('0x27')]};var _0x4a78a0=util[_0xd3a4('0x40')]('%s:%s',_0x5102e7[_0xd3a4('0x4c')],_0x5102e7[_0xd3a4('0x3b')]);var _0x3b30ae={'method':_0xd3a4('0x32'),'uri':util[_0xd3a4('0x40')](_0xd3a4('0x4d'),_0x5102e7['authId']),'body':_0x26a54a,'headers':{'Authorization':util[_0xd3a4('0x40')](_0xd3a4('0x42'),new Buffer(_0x4a78a0)[_0xd3a4('0x43')](_0xd3a4('0x44')))},'json':!![]};rp(_0x3b30ae)[_0xd3a4('0x16')](function(_0x13bb4e){var _0xbce715={'messageId':_0x13bb4e[_0xd3a4('0x4e')][0x0]};return _0x10037d[_0xd3a4('0x17')](_0xbce715);})['catch'](function(_0x554d88){logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'plivo',util[_0xd3a4('0x29')](_0x554d88,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a4('0x2b'),'plivo',_0xd3a4('0x4f'));}break;case _0xd3a4('0x50'):if(_0x5102e7['username']&&_0x5102e7[_0xd3a4('0x2e')]){if(_0x5102e7[_0xd3a4('0x51')]){var _0x306a5c={'method':_0xd3a4('0x32'),'uri':_0x5102e7['baseUrl']+_0xd3a4('0x52'),'body':{'username':_0x5102e7[_0xd3a4('0x2d')],'password':_0x5102e7[_0xd3a4('0x2e')]},'json':!![]};return rp(_0x306a5c)[_0xd3a4('0x16')](function(_0x2f415c){var _0x237eee={'method':_0xd3a4('0x32'),'uri':_0x5102e7[_0xd3a4('0x51')]+_0xd3a4('0x53'),'body':{'messages':[{'from':_0x5102e7[_0xd3a4('0x23')],'destinations':[{'to':_0x113ccf[_0xd3a4('0x23')]}],'text':_0x113ccf[_0xd3a4('0xb')],'notifyUrl':_0x5102e7[_0xd3a4('0x24')]+_0xd3a4('0x25')+_0x113ccf['id']+_0xd3a4('0x26')+_0x5102e7[_0xd3a4('0x27')],'notifyContentType':_0xd3a4('0x54'),'callbackData':_0x5102e7[_0xd3a4('0x23')]+';'+_0x113ccf[_0xd3a4('0xb')]}]},'headers':{'Authorization':_0xd3a4('0x55')+_0x2f415c['token']},'json':!![]};return rp(_0x237eee)[_0xd3a4('0x16')](function(_0x4683b4){if(_0x4683b4['messages']){var _0x3aeaa2={'messageId':_0x4683b4[_0xd3a4('0x49')][0x0][_0xd3a4('0x9')]};if(!_0x5102e7['deliveryReport']){_0x3aeaa2[_0xd3a4('0x36')]=!![];}return _0x10037d[_0xd3a4('0x17')](_0x3aeaa2);}else{return logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'infobip',util[_0xd3a4('0x29')](_0x4683b4,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x934357){return logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'infobip',util['inspect'](_0x934357,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x50'),_0xd3a4('0x56'));}}else{logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x50'),_0xd3a4('0x38'));}break;case'csc':var _0x6ef473=require(_0xd3a4('0x57'));if(_0x5102e7['apiKey']){var _0x2bbe89={};_0x2bbe89['login']=_0x5102e7[_0xd3a4('0x2d')];_0x2bbe89[_0xd3a4('0x23')]=_0x113ccf[_0xd3a4('0x23')];_0x2bbe89[_0xd3a4('0x58')]=_0x5102e7[_0xd3a4('0x23')];_0x2bbe89[_0xd3a4('0x59')]=_0x113ccf[_0xd3a4('0xb')];_0x2bbe89['timestamp']=+new Date();var _0x18af6b='';var _0x2dfc30='';var _0x34c517=Object[_0xd3a4('0x5a')](_0x2bbe89);_0x34c517[_0xd3a4('0x5b')]();for(var _0x56fb6b=0x0;_0x56fb6b<_0x34c517['length'];_0x56fb6b++){if(_0x18af6b!=''){_0x18af6b+='&';}_0x18af6b+=_0x34c517[_0x56fb6b]+'='+encodeURIComponent(_0x2bbe89[_0x34c517[_0x56fb6b]]);_0x2dfc30+=_0x2bbe89[_0x34c517[_0x56fb6b]];}_0x2dfc30+=_0x5102e7[_0xd3a4('0x5c')];_0x2dfc30=_0x6ef473[_0xd3a4('0x5d')]('md5')[_0xd3a4('0x17')](_0x2dfc30)[_0xd3a4('0x5e')](_0xd3a4('0x5f'));if(_0x18af6b!==''){_0x18af6b+='&';}_0x18af6b+=_0xd3a4('0x60')+_0x2dfc30;var _0x479cba={'method':'GET','uri':_0x5102e7[_0xd3a4('0x51')]+'/external/get/send.php?'+_0x18af6b,'json':!![]};return rp(_0x479cba)['then'](function(_0x512640){var _0x212dbe=Object[_0xd3a4('0x5a')](_0x512640);if(_0x512640[_0x212dbe[0x0]][_0xd3a4('0x1a')]&&parseInt(_0x512640[_0x212dbe[0x0]][_0xd3a4('0x1a')])===0x0){var _0x4c314c={'messageId':_0x512640[_0x212dbe[0x0]]['id_sms']};if(!_0x5102e7['deliveryReport']){_0x4c314c[_0xd3a4('0x36')]=!![];}return _0x10037d[_0xd3a4('0x17')](_0x4c314c);}else{return logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x61'),util[_0xd3a4('0x29')](_0x512640['error'],{'showHidden':![],'depth':null}));}})[_0xd3a4('0x19')](function(_0x2473e2){return logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),'csc',util[_0xd3a4('0x29')](_0x2473e2,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x61'),_0xd3a4('0x62'));}break;case'clickatell':if(_0x5102e7[_0xd3a4('0x5c')]){var _0x5f3d24={'method':_0xd3a4('0x32'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x5102e7[_0xd3a4('0x5c')]},'body':{'content':_0x113ccf[_0xd3a4('0xb')],'to':[_0x113ccf[_0xd3a4('0x23')]],'from':_0x5102e7[_0xd3a4('0x23')],'binary':![],'clientMessageId':'uuid','charset':_0xd3a4('0x63')},'json':!![]};rp(_0x5f3d24)[_0xd3a4('0x16')](function(_0x451b3c){if(!_0x451b3c[_0xd3a4('0x1a')]){var _0x33cc11={'messageId':_0x451b3c['messages'][0x0]['apiMessageId']};if(!_0x5102e7[_0xd3a4('0x35')]){_0x33cc11['read']=!![];}return _0x10037d['update'](_0x33cc11);}else{return logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x64'),util['inspect'](_0x451b3c[_0xd3a4('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x384766){return logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a4('0x2b'),_0xd3a4('0x64'),util[_0xd3a4('0x29')](_0x384766,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd3a4('0x64'),'Missing\x20parameters:\x20apiKey');}break;case _0xd3a4('0x65'):if(_0x5102e7['username']&&_0x5102e7[_0xd3a4('0x2e')]){var _0x4a78a0=util[_0xd3a4('0x40')](_0xd3a4('0x66'),_0x5102e7['username'],_0x5102e7[_0xd3a4('0x2e')]);var _0x3b30ae={'method':_0xd3a4('0x32'),'uri':_0xd3a4('0x67')+_0x5102e7['accountId']+_0xd3a4('0x68'),'body':{'to':[_0x113ccf[_0xd3a4('0x23')]],'text':_0x113ccf[_0xd3a4('0xb')],'from':_0x5102e7[_0xd3a4('0x23')],'applicationId':_0x5102e7['applicationId']},'headers':{'Authorization':util[_0xd3a4('0x40')](_0xd3a4('0x42'),new Buffer(_0x4a78a0)[_0xd3a4('0x43')](_0xd3a4('0x44')))},'json':!![]};rp(_0x3b30ae)[_0xd3a4('0x16')](function(_0x43dee0){if(_0x43dee0['id']){var _0x2f0626={'messageId':_0x43dee0['id']};return _0x10037d[_0xd3a4('0x17')](_0x2f0626);}else{logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x65'),util[_0xd3a4('0x29')](_0x43dee0,{'showHidden':![],'depth':null}));}})['catch'](function(_0x17f7c7){logger['error'](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x65'),util[_0xd3a4('0x29')](_0x17f7c7,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),'afterCreate',_0xd3a4('0x65'),_0xd3a4('0x38'));}break;case'intelepeer':if(_0x5102e7['apiKey']){var _0x1d9cfa={};var _0x479cba={'method':_0xd3a4('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xd3a4('0x69')+_0x5102e7[_0xd3a4('0x5c')],'Content-Type':_0xd3a4('0x54')},'body':{'from':_0x5102e7['phone'],'to':_0x113ccf[_0xd3a4('0x23')],'text':_0x113ccf[_0xd3a4('0xb')]},'json':!![]};return rp(_0x479cba)[_0xd3a4('0x16')](function(_0x5cca0a){if(_0x5cca0a[_0xd3a4('0x6a')]==0xca){_0x1d9cfa[_0xd3a4('0x6b')]=_0x5cca0a;var _0x44bff3={'method':_0xd3a4('0x32'),'uri':_0xd3a4('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x5102e7[_0xd3a4('0x5c')],'Content-Type':_0xd3a4('0x54')},'body':{'refid':_0x1d9cfa['message'][_0xd3a4('0x6d')]},'json':!![]};return rp(_0x44bff3)[_0xd3a4('0x16')](function(_0x582df9){_0x1d9cfa['status']=_0x582df9;var _0x1d8e0e={'messageId':_0x1d9cfa[_0xd3a4('0x6b')][_0xd3a4('0x6d')],'read':!![]};return _0x10037d[_0xd3a4('0x17')](_0x1d8e0e);});}else{return logger[_0xd3a4('0x1a')](_0xd3a4('0x2a'),_0xd3a4('0x2b'),_0xd3a4('0x6e'),util[_0xd3a4('0x29')](_0x5cca0a,{'showHidden':![],'depth':null}));}})[_0xd3a4('0x19')](function(_0x12a60c){return logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a4('0x2b'),_0xd3a4('0x6e'),util[_0xd3a4('0x29')](_0x12a60c,{'showHidden':![],'depth':null}));});}else{return logger[_0xd3a4('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a4('0x2b'),_0xd3a4('0x6e'),_0xd3a4('0x6f'));}break;}}})[_0xd3a4('0x70')](function(){_0x42b6ab();});}else{_0x42b6ab();}}},'charset':_0xd3a4('0x71'),'collate':_0xd3a4('0x72')});}; \ No newline at end of file +var _0x2547=['user_key','session_key','deliveryReport','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login','timestamp','sort','length','createHash','md5','digest','signature=','GET','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','clickatell','uuid','bandwidth','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','username','&password=','split','sms'];(function(_0x46f942,_0x2c8cd0){var _0x5e9ac4=function(_0x5552b4){while(--_0x5552b4){_0x46f942['push'](_0x46f942['shift']());}};_0x5e9ac4(++_0x2c8cd0);}(_0x2547,0x13d));var _0x7254=function(_0x2405c1,_0x1bf0bf){_0x2405c1=_0x2405c1-0x0;var _0x192d4c=_0x2547[_0x2405c1];return _0x192d4c;};'use strict';var _=require(_0x7254('0x0'));var util=require(_0x7254('0x1'));var logger=require(_0x7254('0x2'))(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var rp=require(_0x7254('0x6'));var fs=require('fs');var path=require(_0x7254('0x7'));var rimraf=require(_0x7254('0x8'));var config=require(_0x7254('0x9'));var attributes=require(_0x7254('0xa'));module[_0x7254('0xb')]=function(_0x24e992,_0x103a5f){return _0x24e992[_0x7254('0xc')](_0x7254('0xd'),attributes,{'tableName':_0x7254('0xe'),'paranoid':![],'indexes':[{'name':_0x7254('0xf'),'fields':[_0x7254('0xf')]},{'name':_0x7254('0x10'),'fields':[_0x7254('0x11')],'type':_0x7254('0x12')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14ba14,_0x4148c1,_0x5c9146){var _0x575b82=_0x24e992[_0x7254('0x13')];var _0x660f60=_0x14ba14[_0x7254('0x14')]({'plain':!![]});if(_0x660f60[_0x7254('0x15')]['toLowerCase']()==='in'||_0x660f60['direction'][_0x7254('0x16')]()===_0x7254('0x17')&&!_0x660f60[_0x7254('0x18')]&&!_[_0x7254('0x19')](_0x660f60[_0x7254('0x1a')])&&!_[_0x7254('0x19')](_0x660f60[_0x7254('0x1b')])){_0x575b82[_0x7254('0x1c')][_0x7254('0x1d')]({'where':{'id':_0x660f60[_0x7254('0x1b')]}})[_0x7254('0x1e')](function(_0x46a640){if(_0x46a640){_0x46a640[_0x7254('0x1f')]({'lastMsgAt':_0x660f60[_0x7254('0x20')],'lastMsgDirection':_0x660f60['direction']['toLowerCase']()});}})[_0x7254('0x21')](function(_0xb045c){console[_0x7254('0x22')](_0xb045c);});}if(_0x660f60[_0x7254('0x15')]===_0x7254('0x17')&&!_0x660f60['secret']){var _0x54bb6b;_0x575b82[_0x7254('0x23')]['find']({'where':{'id':_0x660f60[_0x7254('0x24')]},'raw':!![]})[_0x7254('0x1e')](function(_0x4f044c){_0x54bb6b=_0x4f044c;if(_0x54bb6b&&_0x54bb6b[_0x7254('0x25')]){switch(_0x54bb6b['type']){case'twilio':var _0x3662e2=require(_0x7254('0x26'));if(_0x54bb6b['accountSid']&&_0x54bb6b[_0x7254('0x27')]&&_0x54bb6b['phone']){var _0x2d5b86=new _0x3662e2(_0x54bb6b['accountSid'],_0x54bb6b[_0x7254('0x27')]);_0x2d5b86[_0x7254('0x28')][_0x7254('0x29')]({'body':_0x660f60[_0x7254('0x11')],'to':_0x660f60['phone'],'from':_0x54bb6b[_0x7254('0x2a')],'statusCallback':_0x54bb6b[_0x7254('0x2b')]+_0x7254('0x2c')+_0x660f60['id']+_0x7254('0x2d')+_0x54bb6b[_0x7254('0x2e')]})[_0x7254('0x1e')](function(_0x2a9815){if(_0x2a9815[_0x7254('0x2f')]){return _0x14ba14[_0x7254('0x1f')]({'messageId':_0x2a9815[_0x7254('0x2f')]});}})['catch'](function(_0x5dea80){logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x26'),util[_0x7254('0x32')](_0x5dea80,{'showHidden':![],'depth':null}));});}else{logger[_0x7254('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7254('0x31'),_0x7254('0x26'),_0x7254('0x33'));}break;case _0x7254('0x34'):var _0x54539c='https://api.skebby.it/API/v1.0/REST/';if(_0x54bb6b['username']&&_0x54bb6b[_0x7254('0x35')]){var _0x4c9dc2={'recipient':[_0x660f60[_0x7254('0x2a')]],'message':_0x660f60[_0x7254('0x11')],'message_type':_0x54bb6b[_0x7254('0x36')]};if(_0x54bb6b[_0x7254('0x36')]&&_0x54bb6b[_0x7254('0x36')]!=='SI'){_0x4c9dc2[_0x7254('0x37')]=_0x54bb6b[_0x7254('0x2a')];}var _0x25ea8d={'url':_0x54539c+_0x7254('0x38')+_0x54bb6b[_0x7254('0x39')]+_0x7254('0x3a')+_0x54bb6b[_0x7254('0x35')],'method':'GET'};rp(_0x25ea8d)['then'](function(_0x328269){var _0x5927de=_0x328269[_0x7254('0x3b')](';');var _0x5a262e={'user_key':_0x5927de[0x0],'session_key':_0x5927de[0x1]};_0x25ea8d={'url':_0x54539c+_0x7254('0x3c'),'method':'POST','headers':{'user_key':_0x5a262e[_0x7254('0x3d')],'Session_key':_0x5a262e[_0x7254('0x3e')]},'json':!![],'body':_0x4c9dc2};return rp(_0x25ea8d);})[_0x7254('0x1e')](function(_0x1846af){if(_0x1846af['total_sent']>=0x1){var _0x4665d2={'messageId':_0x1846af['internal_order_id']};if(_0x54bb6b[_0x7254('0x36')]!=='GP'||!_0x54bb6b[_0x7254('0x3f')]){_0x4665d2['read']=!![];}return _0x14ba14[_0x7254('0x1f')](_0x4665d2);}else{return logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),'skebby',util[_0x7254('0x32')](_0x1846af,{'showHidden':![],'depth':null}));}})['catch'](function(_0x37c1f2){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7254('0x31'),_0x7254('0x34'),util[_0x7254('0x32')](_0x37c1f2,{'showHidden':![],'depth':null}));});}else{logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x7254('0x40'):if(_0x54bb6b['authToken']){var _0x2b170c={'recipient':_0x660f60[_0x7254('0x2a')],'message':_0x660f60[_0x7254('0x11')],'sender':_0x54bb6b[_0x7254('0x41')]||_0x54bb6b['phone'],'authorization':_0x54bb6b[_0x7254('0x27')]};var _0x4148c1={'method':_0x7254('0x42'),'uri':_0x7254('0x43'),'body':_0x2b170c,'json':!![]};rp(_0x4148c1)['then'](function(_0x34910c){var _0xdabf78={'messageId':_0x34910c[_0x7254('0x44')]};if(!_0x54bb6b['deliveryReport']){_0xdabf78[_0x7254('0x45')]=!![];}return _0x14ba14[_0x7254('0x1f')](_0xdabf78);})['catch'](function(_0x4fee05){logger['error'](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x40'),util[_0x7254('0x32')](_0x4fee05,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7254('0x30'),'afterCreate',_0x7254('0x40'),_0x7254('0x46'));}break;case'clicksend':if(_0x54bb6b[_0x7254('0x39')]&&_0x54bb6b[_0x7254('0x35')]){var _0x2b170c={'messages':[{'source':_0x7254('0x47'),'to':_0x660f60['phone'],'body':_0x660f60[_0x7254('0x11')],'from':_0x54bb6b[_0x7254('0x41')]||_0x54bb6b[_0x7254('0x2a')]}]};var _0x4db065=util[_0x7254('0x48')](_0x7254('0x49'),_0x54bb6b[_0x7254('0x39')],_0x54bb6b['password']);var _0x4148c1={'method':_0x7254('0x42'),'uri':_0x7254('0x4a'),'body':_0x2b170c,'headers':{'Authorization':util[_0x7254('0x48')]('Basic\x20%s',new Buffer(_0x4db065)[_0x7254('0x4b')](_0x7254('0x4c')))},'json':!![]};rp(_0x4148c1)['then'](function(_0x11766c){if(_0x11766c[_0x7254('0x4d')]>=0xc8&&_0x11766c[_0x7254('0x4d')]<=0xce){if(_0x11766c[_0x7254('0x4e')]&&_0x11766c['data'][_0x7254('0x4f')]>0x0){var _0x5b472f=_[_0x7254('0x50')](_0x11766c[_0x7254('0x4e')]['messages']);var _0x5ab7c0={'messageId':_0x5b472f[_0x7254('0x51')]};if(!_0x54bb6b[_0x7254('0x3f')]){_0x5ab7c0['read']=!![];}return _0x14ba14[_0x7254('0x1f')](_0x5ab7c0);}else{logger[_0x7254('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x7254('0x32')](_0x11766c,{'showHidden':![],'depth':null}));}}else{logger[_0x7254('0x22')](_0x7254('0x30'),'afterCreate','clickSend',util['inspect'](_0x11766c,{'showHidden':![],'depth':null}));}})[_0x7254('0x21')](function(_0x30f989){logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x52'),util['inspect'](_0x30f989,{'showHidden':![],'depth':null}));});}else{logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x7254('0x53'):if(_0x54bb6b[_0x7254('0x54')]&&_0x54bb6b['authToken']){var _0x2b170c={'dst':_0x660f60[_0x7254('0x2a')],'text':_0x660f60['body'],'src':_0x54bb6b[_0x7254('0x41')]||_0x54bb6b[_0x7254('0x2a')],'url':_0x54bb6b[_0x7254('0x2b')]+_0x7254('0x2c')+_0x660f60['id']+_0x7254('0x2d')+_0x54bb6b[_0x7254('0x2e')]};var _0x4db065=util['format'](_0x7254('0x49'),_0x54bb6b['authId'],_0x54bb6b[_0x7254('0x27')]);var _0x4148c1={'method':_0x7254('0x42'),'uri':util[_0x7254('0x48')](_0x7254('0x55'),_0x54bb6b[_0x7254('0x54')]),'body':_0x2b170c,'headers':{'Authorization':util[_0x7254('0x48')](_0x7254('0x56'),new Buffer(_0x4db065)['toString']('base64'))},'json':!![]};rp(_0x4148c1)[_0x7254('0x1e')](function(_0x2796ec){var _0x2f0fab={'messageId':_0x2796ec[_0x7254('0x57')][0x0]};return _0x14ba14['update'](_0x2f0fab);})[_0x7254('0x21')](function(_0xcbf77c){logger['error'](_0x7254('0x30'),_0x7254('0x31'),'plivo',util['inspect'](_0xcbf77c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7254('0x30'),_0x7254('0x31'),'plivo',_0x7254('0x58'));}break;case'infobip':if(_0x54bb6b[_0x7254('0x39')]&&_0x54bb6b[_0x7254('0x35')]){if(_0x54bb6b[_0x7254('0x59')]){var _0x2943cf={'method':_0x7254('0x42'),'uri':_0x54bb6b['baseUrl']+_0x7254('0x5a'),'body':{'username':_0x54bb6b[_0x7254('0x39')],'password':_0x54bb6b['password']},'json':!![]};return rp(_0x2943cf)[_0x7254('0x1e')](function(_0xe9f96a){var _0x161270={'method':'POST','uri':_0x54bb6b[_0x7254('0x59')]+_0x7254('0x5b'),'body':{'messages':[{'from':_0x54bb6b[_0x7254('0x2a')],'destinations':[{'to':_0x660f60['phone']}],'text':_0x660f60['body'],'notifyUrl':_0x54bb6b[_0x7254('0x2b')]+_0x7254('0x2c')+_0x660f60['id']+_0x7254('0x2d')+_0x54bb6b[_0x7254('0x2e')],'notifyContentType':_0x7254('0x5c'),'callbackData':_0x54bb6b['phone']+';'+_0x660f60[_0x7254('0x11')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xe9f96a[_0x7254('0x2e')]},'json':!![]};return rp(_0x161270)[_0x7254('0x1e')](function(_0x99c2c2){if(_0x99c2c2[_0x7254('0x28')]){var _0x2bee26={'messageId':_0x99c2c2['messages'][0x0][_0x7254('0xf')]};if(!_0x54bb6b[_0x7254('0x3f')]){_0x2bee26[_0x7254('0x45')]=!![];}return _0x14ba14[_0x7254('0x1f')](_0x2bee26);}else{return logger['error'](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x5d'),util[_0x7254('0x32')](_0x99c2c2,{'showHidden':![],'depth':null}));}});})[_0x7254('0x21')](function(_0xeb4c9){return logger[_0x7254('0x22')](_0x7254('0x30'),'afterCreate',_0x7254('0x5d'),util[_0x7254('0x32')](_0xeb4c9,{'showHidden':![],'depth':null}));});}else{logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x5d'),_0x7254('0x5e'));}}else{logger[_0x7254('0x22')](_0x7254('0x30'),'afterCreate',_0x7254('0x5d'),_0x7254('0x5f'));}break;case _0x7254('0x60'):var _0x21f0ee=require(_0x7254('0x61'));if(_0x54bb6b[_0x7254('0x62')]){var _0x4fc5a={};_0x4fc5a[_0x7254('0x63')]=_0x54bb6b[_0x7254('0x39')];_0x4fc5a[_0x7254('0x2a')]=_0x660f60[_0x7254('0x2a')];_0x4fc5a[_0x7254('0x37')]=_0x54bb6b[_0x7254('0x2a')];_0x4fc5a['text']=_0x660f60[_0x7254('0x11')];_0x4fc5a[_0x7254('0x64')]=+new Date();var _0x50c342='';var _0x2d0934='';var _0x47c95b=Object['keys'](_0x4fc5a);_0x47c95b[_0x7254('0x65')]();for(var _0x3c3bc9=0x0;_0x3c3bc9<_0x47c95b[_0x7254('0x66')];_0x3c3bc9++){if(_0x50c342!=''){_0x50c342+='&';}_0x50c342+=_0x47c95b[_0x3c3bc9]+'='+encodeURIComponent(_0x4fc5a[_0x47c95b[_0x3c3bc9]]);_0x2d0934+=_0x4fc5a[_0x47c95b[_0x3c3bc9]];}_0x2d0934+=_0x54bb6b[_0x7254('0x62')];_0x2d0934=_0x21f0ee[_0x7254('0x67')](_0x7254('0x68'))['update'](_0x2d0934)[_0x7254('0x69')]('hex');if(_0x50c342!==''){_0x50c342+='&';}_0x50c342+=_0x7254('0x6a')+_0x2d0934;var _0x25ea8d={'method':_0x7254('0x6b'),'uri':_0x54bb6b[_0x7254('0x59')]+_0x7254('0x6c')+_0x50c342,'json':!![]};return rp(_0x25ea8d)['then'](function(_0x53fd1b){var _0x49d596=Object[_0x7254('0x6d')](_0x53fd1b);if(_0x53fd1b[_0x49d596[0x0]][_0x7254('0x22')]&&parseInt(_0x53fd1b[_0x49d596[0x0]][_0x7254('0x22')])===0x0){var _0x5dacc6={'messageId':_0x53fd1b[_0x49d596[0x0]]['id_sms']};if(!_0x54bb6b['deliveryReport']){_0x5dacc6['read']=!![];}return _0x14ba14['update'](_0x5dacc6);}else{return logger[_0x7254('0x22')](_0x7254('0x30'),'afterCreate','csc',util[_0x7254('0x32')](_0x53fd1b['error'],{'showHidden':![],'depth':null}));}})[_0x7254('0x21')](function(_0x52016b){return logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x60'),util[_0x7254('0x32')](_0x52016b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',_0x7254('0x6e'));}break;case _0x7254('0x6f'):if(_0x54bb6b['apiKey']){var _0x32dbc4={'method':_0x7254('0x42'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x54bb6b[_0x7254('0x62')]},'body':{'content':_0x660f60['body'],'to':[_0x660f60[_0x7254('0x2a')]],'from':_0x54bb6b[_0x7254('0x2a')],'binary':![],'clientMessageId':_0x7254('0x70'),'charset':'UTF-8'},'json':!![]};rp(_0x32dbc4)[_0x7254('0x1e')](function(_0x187aaa){if(!_0x187aaa['error']){var _0x2fdf3d={'messageId':_0x187aaa[_0x7254('0x28')][0x0]['apiMessageId']};if(!_0x54bb6b[_0x7254('0x3f')]){_0x2fdf3d[_0x7254('0x45')]=!![];}return _0x14ba14[_0x7254('0x1f')](_0x2fdf3d);}else{return logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x6f'),util[_0x7254('0x32')](_0x187aaa[_0x7254('0x22')],{'showHidden':![],'depth':null}));}})[_0x7254('0x21')](function(_0x331b36){return logger[_0x7254('0x22')](_0x7254('0x30'),'afterCreate',_0x7254('0x6f'),util[_0x7254('0x32')](_0x331b36,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x6f'),_0x7254('0x6e'));}break;case _0x7254('0x71'):if(_0x54bb6b[_0x7254('0x39')]&&_0x54bb6b['password']){var _0x4db065=util[_0x7254('0x48')](_0x7254('0x49'),_0x54bb6b[_0x7254('0x39')],_0x54bb6b[_0x7254('0x35')]);var _0x4148c1={'method':_0x7254('0x42'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x54bb6b[_0x7254('0x72')]+'/messages','body':{'to':[_0x660f60[_0x7254('0x2a')]],'text':_0x660f60[_0x7254('0x11')],'from':_0x54bb6b['phone'],'applicationId':_0x54bb6b[_0x7254('0x73')]},'headers':{'Authorization':util['format'](_0x7254('0x56'),new Buffer(_0x4db065)[_0x7254('0x4b')]('base64'))},'json':!![]};rp(_0x4148c1)[_0x7254('0x1e')](function(_0x1a608c){if(_0x1a608c['id']){var _0x576cc8={'messageId':_0x1a608c['id']};return _0x14ba14[_0x7254('0x1f')](_0x576cc8);}else{logger[_0x7254('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7254('0x71'),util['inspect'](_0x1a608c,{'showHidden':![],'depth':null}));}})[_0x7254('0x21')](function(_0x7e7397){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7254('0x71'),util[_0x7254('0x32')](_0x7e7397,{'showHidden':![],'depth':null}));});}else{logger[_0x7254('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7254('0x31'),'bandwidth',_0x7254('0x5f'));}break;case _0x7254('0x74'):if(_0x54bb6b[_0x7254('0x62')]){var _0x221649={};var _0x25ea8d={'method':_0x7254('0x42'),'uri':_0x7254('0x75'),'headers':{'Authorization':_0x7254('0x76')+_0x54bb6b[_0x7254('0x62')],'Content-Type':'application/json'},'body':{'from':_0x54bb6b[_0x7254('0x2a')],'to':_0x660f60[_0x7254('0x2a')],'text':_0x660f60[_0x7254('0x11')]},'json':!![]};return rp(_0x25ea8d)[_0x7254('0x1e')](function(_0x1f0b08){if(_0x1f0b08[_0x7254('0x77')]==0xca){_0x221649['message']=_0x1f0b08;var _0xaf3956={'method':_0x7254('0x42'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x7254('0x76')+_0x54bb6b[_0x7254('0x62')],'Content-Type':_0x7254('0x5c')},'body':{'refid':_0x221649[_0x7254('0x78')][_0x7254('0x79')]},'json':!![]};return rp(_0xaf3956)[_0x7254('0x1e')](function(_0x5a223e){_0x221649[_0x7254('0x7a')]=_0x5a223e;var _0x4f7a78={'messageId':_0x221649[_0x7254('0x78')][_0x7254('0x79')],'read':!![]};return _0x14ba14[_0x7254('0x1f')](_0x4f7a78);});}else{return logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x74'),util[_0x7254('0x32')](_0x1f0b08,{'showHidden':![],'depth':null}));}})[_0x7254('0x21')](function(_0x5d1ec6){return logger[_0x7254('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7254('0x31'),_0x7254('0x74'),util[_0x7254('0x32')](_0x5d1ec6,{'showHidden':![],'depth':null}));});}else{return logger[_0x7254('0x22')](_0x7254('0x30'),_0x7254('0x31'),_0x7254('0x74'),_0x7254('0x7b'));}break;}}})[_0x7254('0x7c')](function(){_0x5c9146();});}else{_0x5c9146();}}},'charset':_0x7254('0x7d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a5d0ce4..3424c0c 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 _0x7986=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsMessage.socket','register','request','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d7f63,_0xd99851){var _0x1d91eb=function(_0x24f08e){while(--_0x24f08e){_0x4d7f63['push'](_0x4d7f63['shift']());}};_0x1d91eb(++_0xd99851);}(_0x7986,0x110));var _0x6798=function(_0x1b5e0e,_0x36d1ce){_0x1b5e0e=_0x1b5e0e-0x0;var _0x16ed35=_0x7986[_0x1b5e0e];return _0x16ed35;};'use strict';var _=require(_0x6798('0x0'));var util=require(_0x6798('0x1'));var moment=require(_0x6798('0x2'));var BPromise=require(_0x6798('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6798('0x4'));var db=require(_0x6798('0x5'))['db'];var utils=require(_0x6798('0x6'));var logger=require(_0x6798('0x7'))('rpc');var config=require(_0x6798('0x8'));var jayson=require(_0x6798('0x9'));var client=jayson[_0x6798('0xa')][_0x6798('0xb')]({'port':0x232a});config[_0x6798('0xc')]=_[_0x6798('0xd')](config[_0x6798('0xc')],{'host':_0x6798('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6798('0xc')]));require(_0x6798('0xf'))[_0x6798('0x10')](socket);function respondWithRpcPromise(_0x5b87ee,_0x6636d,_0x3bd709){return new BPromise(function(_0x70851b,_0x2cc747){return client[_0x6798('0x11')](_0x5b87ee,_0x3bd709)[_0x6798('0x12')](function(_0x19b252){logger[_0x6798('0x13')]('SmsMessage,\x20%s,\x20%s',_0x6636d,_0x6798('0x14'));logger['debug'](_0x6798('0x15'),_0x6636d,_0x6798('0x14'),JSON[_0x6798('0x16')](_0x19b252));if(_0x19b252[_0x6798('0x17')]){if(_0x19b252[_0x6798('0x17')]['code']===0x1f4){logger['error'](_0x6798('0x18'),_0x6636d,_0x19b252[_0x6798('0x17')]['message']);return _0x2cc747(_0x19b252[_0x6798('0x17')][_0x6798('0x19')]);}logger['error'](_0x6798('0x18'),_0x6636d,_0x19b252[_0x6798('0x17')][_0x6798('0x19')]);return _0x70851b(_0x19b252[_0x6798('0x17')][_0x6798('0x19')]);}else{logger[_0x6798('0x13')](_0x6798('0x18'),_0x6636d,'request\x20sent');_0x70851b(_0x19b252[_0x6798('0x1a')]['message']);}})[_0x6798('0x1b')](function(_0xd32d31){logger[_0x6798('0x17')](_0x6798('0x18'),_0x6636d,_0xd32d31);_0x2cc747(_0xd32d31);});});}exports[_0x6798('0x1c')]=function(_0x5160d9){var _0x24e290=this;return new Promise(function(_0x18b210,_0x2f1db8){return db[_0x6798('0x1d')][_0x6798('0x1e')](_0x5160d9[_0x6798('0x1f')],{'raw':_0x5160d9['options']?_0x5160d9[_0x6798('0x20')][_0x6798('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x260693){logger[_0x6798('0x13')](_0x6798('0x1c'),_0x5160d9);logger[_0x6798('0x22')]('CreateSmsMessage',_0x5160d9,JSON[_0x6798('0x16')](_0x260693));_0x18b210(_0x260693);})['catch'](function(_0x51c9f8){logger[_0x6798('0x17')](_0x6798('0x1c'),_0x51c9f8['message'],_0x5160d9);_0x2f1db8(_0x24e290[_0x6798('0x17')](0x1f4,_0x51c9f8['message']));});});}; \ No newline at end of file +var _0xa6c6=['socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','stringify','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost'];(function(_0x31cbc7,_0x1970aa){var _0xfe2ac8=function(_0x8f94ee){while(--_0x8f94ee){_0x31cbc7['push'](_0x31cbc7['shift']());}};_0xfe2ac8(++_0x1970aa);}(_0xa6c6,0x12a));var _0x6a6c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa6c6[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x6a6c('0x0'));var moment=require('moment');var BPromise=require(_0x6a6c('0x1'));var rs=require(_0x6a6c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a6c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a6c('0x4'))(_0x6a6c('0x5'));var config=require(_0x6a6c('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x6a6c('0x7')]=_[_0x6a6c('0x8')](config[_0x6a6c('0x7')],{'host':_0x6a6c('0x9'),'port':0x18eb});var socket=require(_0x6a6c('0xa'))(new Redis(config[_0x6a6c('0x7')]));require(_0x6a6c('0xb'))['register'](socket);function respondWithRpcPromise(_0xcace9e,_0x26ae13,_0x5209f0){return new BPromise(function(_0x4ffb13,_0xbac898){return client[_0x6a6c('0xc')](_0xcace9e,_0x5209f0)[_0x6a6c('0xd')](function(_0x2567d9){logger['info'](_0x6a6c('0xe'),_0x26ae13,_0x6a6c('0xf'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x26ae13,'request\x20sent',JSON['stringify'](_0x2567d9));if(_0x2567d9['error']){if(_0x2567d9[_0x6a6c('0x10')]['code']===0x1f4){logger['error'](_0x6a6c('0xe'),_0x26ae13,_0x2567d9[_0x6a6c('0x10')][_0x6a6c('0x11')]);return _0xbac898(_0x2567d9[_0x6a6c('0x10')]['message']);}logger[_0x6a6c('0x10')](_0x6a6c('0xe'),_0x26ae13,_0x2567d9['error']['message']);return _0x4ffb13(_0x2567d9[_0x6a6c('0x10')][_0x6a6c('0x11')]);}else{logger[_0x6a6c('0x12')]('SmsMessage,\x20%s,\x20%s',_0x26ae13,'request\x20sent');_0x4ffb13(_0x2567d9['result']['message']);}})[_0x6a6c('0x13')](function(_0x30e7e8){logger['error'](_0x6a6c('0xe'),_0x26ae13,_0x30e7e8);_0xbac898(_0x30e7e8);});});}exports[_0x6a6c('0x14')]=function(_0x4d6660){var _0x1e9bf5=this;return new Promise(function(_0x135e9e,_0x2497c9){return db[_0x6a6c('0x15')][_0x6a6c('0x16')](_0x4d6660[_0x6a6c('0x17')],{'raw':_0x4d6660['options']?_0x4d6660[_0x6a6c('0x18')][_0x6a6c('0x19')]===undefined?!![]:![]:!![]})[_0x6a6c('0xd')](function(_0x41bfef){logger[_0x6a6c('0x12')](_0x6a6c('0x14'),_0x4d6660);logger[_0x6a6c('0x1a')]('CreateSmsMessage',_0x4d6660,JSON[_0x6a6c('0x1b')](_0x41bfef));_0x135e9e(_0x41bfef);})[_0x6a6c('0x13')](function(_0x1e1b40){logger[_0x6a6c('0x10')](_0x6a6c('0x14'),_0x1e1b40[_0x6a6c('0x11')],_0x4d6660);_0x2497c9(_0x1e9bf5[_0x6a6c('0x10')](0x1f4,_0x1e1b40[_0x6a6c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index a4ef868..c924d73 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 _0x89e5=['register','length','smsMessage:','save','remove','update','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89e5,0xab));var _0x589e=function(_0xf65a53,_0x439279){_0xf65a53=_0xf65a53-0x0;var _0x2fa5d4=_0x89e5[_0xf65a53];return _0x2fa5d4;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x589e('0x0'),_0x589e('0x1'),_0x589e('0x2')];function createListener(_0x2e6a4e,_0x54fc43){return function(_0x4d6623){_0x54fc43['emit'](_0x2e6a4e,_0x4d6623);};}function removeListener(_0x37355f,_0x1a64a7){return function(){SmsMessageEvents[_0x589e('0x3')](_0x37355f,_0x1a64a7);};}exports[_0x589e('0x4')]=function(_0x1005de){for(var _0x576c00=0x0,_0x2845ff=events[_0x589e('0x5')];_0x576c00<_0x2845ff;_0x576c00++){var _0x278a0d=events[_0x576c00];var _0x11f2e4=createListener(_0x589e('0x6')+_0x278a0d,_0x1005de);SmsMessageEvents['on'](_0x278a0d,_0x11f2e4);}}; \ No newline at end of file +var _0x1746=['smsMessage:','remove','emit','removeListener','register','length'];(function(_0x63c4cb,_0x42b9d3){var _0x4de065=function(_0x51cdd5){while(--_0x51cdd5){_0x63c4cb['push'](_0x63c4cb['shift']());}};_0x4de065(++_0x42b9d3);}(_0x1746,0x73));var _0x6174=function(_0x2de2d4,_0x35ec46){_0x2de2d4=_0x2de2d4-0x0;var _0x5d2d32=_0x1746[_0x2de2d4];return _0x5d2d32;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x6174('0x0'),'update'];function createListener(_0x24481f,_0x1cd0a8){return function(_0x4fe98d){_0x1cd0a8[_0x6174('0x1')](_0x24481f,_0x4fe98d);};}function removeListener(_0x4b026c,_0x8b7daf){return function(){SmsMessageEvents[_0x6174('0x2')](_0x4b026c,_0x8b7daf);};}exports[_0x6174('0x3')]=function(_0xbb9c23){for(var _0x951437=0x0,_0xd83ad7=events[_0x6174('0x4')];_0x951437<_0xd83ad7;_0x951437++){var _0x2f35a5=events[_0x951437];var _0x3b2815=createListener(_0x6174('0x5')+_0x2f35a5,_0xbb9c23);SmsMessageEvents['on'](_0x2f35a5,_0x3b2815);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9e89e03..8f20102 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 _0x5178=['/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x18bb31,_0x422c3d){var _0x4530b6=function(_0x352ffe){while(--_0x352ffe){_0x18bb31['push'](_0x18bb31['shift']());}};_0x4530b6(++_0x422c3d);}(_0x5178,0x171));var _0x8517=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5178[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./smsQueue.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0x7')](_0x8517('0xd'),auth['isAuthenticated'](),controller[_0x8517('0xe')]);router[_0x8517('0x7')](_0x8517('0xf'),auth[_0x8517('0xa')](),controller[_0x8517('0x10')]);router[_0x8517('0x7')](_0x8517('0x11'),auth[_0x8517('0xa')](),controller['getAgents']);router[_0x8517('0x12')]('/',auth[_0x8517('0xa')](),controller[_0x8517('0x13')]);router[_0x8517('0x12')](_0x8517('0xf'),auth['isAuthenticated'](),controller[_0x8517('0x14')]);router[_0x8517('0x12')](_0x8517('0x11'),auth[_0x8517('0xa')](),controller[_0x8517('0x15')]);router[_0x8517('0x16')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x17')]);router[_0x8517('0x18')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller['destroy']);router[_0x8517('0x18')](_0x8517('0xf'),auth[_0x8517('0xa')](),controller[_0x8517('0x19')]);router[_0x8517('0x18')](_0x8517('0x11'),auth[_0x8517('0xa')](),controller['removeAgents']);module[_0x8517('0x1a')]=router; \ No newline at end of file +var _0x640c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','delete','removeTeams','removeAgents','multer','connect-timeout'];(function(_0x9b0ba3,_0x42c135){var _0x3c633f=function(_0x10efb7){while(--_0x10efb7){_0x9b0ba3['push'](_0x9b0ba3['shift']());}};_0x3c633f(++_0x42c135);}(_0x640c,0x1b1));var _0xc640=function(_0x1e9df3,_0x3ec5ea){_0x1e9df3=_0x1e9df3-0x0;var _0x4ae252=_0x640c[_0x1e9df3];return _0x4ae252;};'use strict';var multer=require(_0xc640('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc640('0x1'));var express=require(_0xc640('0x2'));var router=express['Router']();var fs_extra=require(_0xc640('0x3'));var auth=require(_0xc640('0x4'));var interaction=require(_0xc640('0x5'));var config=require(_0xc640('0x6'));var controller=require(_0xc640('0x7'));router[_0xc640('0x8')]('/',auth[_0xc640('0x9')](),controller[_0xc640('0xa')]);router['get']('/describe',auth[_0xc640('0x9')](),controller[_0xc640('0xb')]);router[_0xc640('0x8')](_0xc640('0xc'),auth['isAuthenticated'](),controller[_0xc640('0xd')]);router[_0xc640('0x8')](_0xc640('0xe'),auth[_0xc640('0x9')](),controller[_0xc640('0xf')]);router[_0xc640('0x8')](_0xc640('0x10'),auth[_0xc640('0x9')](),controller[_0xc640('0x11')]);router[_0xc640('0x8')](_0xc640('0x12'),auth[_0xc640('0x9')](),controller[_0xc640('0x13')]);router[_0xc640('0x14')]('/',auth[_0xc640('0x9')](),controller[_0xc640('0x15')]);router[_0xc640('0x14')]('/:id/teams',auth[_0xc640('0x9')](),controller[_0xc640('0x16')]);router[_0xc640('0x14')](_0xc640('0x12'),auth[_0xc640('0x9')](),controller[_0xc640('0x17')]);router['put'](_0xc640('0xc'),auth[_0xc640('0x9')](),controller[_0xc640('0x18')]);router['delete'](_0xc640('0xc'),auth[_0xc640('0x9')](),controller[_0xc640('0x19')]);router[_0xc640('0x1a')](_0xc640('0x10'),auth[_0xc640('0x9')](),controller[_0xc640('0x1b')]);router[_0xc640('0x1a')](_0xc640('0x12'),auth[_0xc640('0x9')](),controller[_0xc640('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 62f8b15..cc21cdc 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 _0xbfbb=['ENUM','rrmemory','beepall','roundrobin','exports','name','STRING'];(function(_0x708cfa,_0x413d56){var _0x2418ca=function(_0x215ea2){while(--_0x215ea2){_0x708cfa['push'](_0x708cfa['shift']());}};_0x2418ca(++_0x413d56);}(_0xbfbb,0x1af));var _0xbbfb=function(_0x3599fc,_0x175bdb){_0x3599fc=_0x3599fc-0x0;var _0x2fbfbb=_0xbfbb[_0x3599fc];return _0x2fbfbb;};'use strict';var Sequelize=require('sequelize');module[_0xbbfb('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbbfb('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbbfb('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbbfb('0x3')](_0xbbfb('0x4'),_0xbbfb('0x5'),_0xbbfb('0x6'))}}; \ No newline at end of file +var _0xf39b=['STRING','name','INTEGER','ENUM','beepall','sequelize'];(function(_0x3fd6f4,_0x11fe83){var _0xe0d23c=function(_0x521db2){while(--_0x521db2){_0x3fd6f4['push'](_0x3fd6f4['shift']());}};_0xe0d23c(++_0x11fe83);}(_0xf39b,0xad));var _0xbf39=function(_0x518f23,_0x50756c){_0x518f23=_0x518f23-0x0;var _0x5b095e=_0xf39b[_0x518f23];return _0x5b095e;};'use strict';var Sequelize=require(_0xbf39('0x0'));module['exports']={'name':{'type':Sequelize[_0xbf39('0x1')],'unique':_0xbf39('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbf39('0x1')]},'timeout':{'type':Sequelize[_0xbf39('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbf39('0x4')]('rrmemory',_0xbf39('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d37ef33..5b6a5e5 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 _0xc6df=['each','findOrCreate','emit','removeTeams','User','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','QueryTypes','TeamId','includes','all','value','transaction','forEach','userSmsQueue:remove','userSmsQueue:save','removeAgents','getAgents','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','error','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','SmsQueue','includeAll','findAll','rows','catch','show','keys','options','find','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','UserId','agent','smsPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','flatMap','sequelize'];(function(_0x4eb37f,_0x3ea89f){var _0x1867eb=function(_0x300d21){while(--_0x300d21){_0x4eb37f['push'](_0x4eb37f['shift']());}};_0x1867eb(++_0x3ea89f);}(_0xc6df,0x115));var _0xfc6d=function(_0x4f4ad8,_0x1d3af0){_0x4f4ad8=_0x4f4ad8-0x0;var _0x306bed=_0xc6df[_0x4f4ad8];return _0x306bed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfc6d('0x0'));var jsonpatch=require(_0xfc6d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc6d('0x2'));var Mustache=require(_0xfc6d('0x3'));var util=require(_0xfc6d('0x4'));var path=require(_0xfc6d('0x5'));var sox=require(_0xfc6d('0x6'));var csv=require(_0xfc6d('0x7'));var ejs=require(_0xfc6d('0x8'));var fs=require('fs');var fs_extra=require(_0xfc6d('0x9'));var _=require('lodash');var squel=require(_0xfc6d('0xa'));var crypto=require(_0xfc6d('0xb'));var jsforce=require(_0xfc6d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfc6d('0xd'));var Papa=require(_0xfc6d('0xe'));var Redis=require('ioredis');var authService=require(_0xfc6d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfc6d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc6d('0x11'))(_0xfc6d('0x12'));var utils=require(_0xfc6d('0x13'));var config=require(_0xfc6d('0x14'));var licenseUtil=require(_0xfc6d('0x15'));var db=require(_0xfc6d('0x16'))['db'];config['redis']=_[_0xfc6d('0x17')](config[_0xfc6d('0x18')],{'host':_0xfc6d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc6d('0x1a'))[_0xfc6d('0x1b')](socket);function respondWithStatusCode(_0x1f9647,_0x34d185){_0x34d185=_0x34d185||0xcc;return function(_0x2aded3){if(_0x2aded3){return _0x1f9647[_0xfc6d('0x1c')](_0x34d185);}return _0x1f9647[_0xfc6d('0x1d')](_0x34d185)[_0xfc6d('0x1e')]();};}function respondWithResult(_0x456ab9,_0xddc345){_0xddc345=_0xddc345||0xc8;return function(_0x39756c){if(_0x39756c){return _0x456ab9[_0xfc6d('0x1d')](_0xddc345)[_0xfc6d('0x1f')](_0x39756c);}};}function respondWithFilteredResult(_0xc71c18,_0x148fe9){return function(_0x56cc8f){if(_0x56cc8f){var _0x8b8ceb=typeof _0x148fe9['offset']===_0xfc6d('0x20')&&typeof _0x148fe9[_0xfc6d('0x21')]===_0xfc6d('0x20');var _0x2a28dd=_0x56cc8f[_0xfc6d('0x22')];var _0xef77a=_0x8b8ceb?0x0:_0x148fe9['offset'];var _0x12b269=_0x8b8ceb?_0x56cc8f[_0xfc6d('0x22')]:_0x148fe9['offset']+_0x148fe9[_0xfc6d('0x21')];var _0x56f774;if(_0x12b269>=_0x2a28dd){_0x12b269=_0x2a28dd;_0x56f774=0xc8;}else{_0x56f774=0xce;}_0xc71c18[_0xfc6d('0x1d')](_0x56f774);return _0xc71c18[_0xfc6d('0x23')](_0xfc6d('0x24'),_0xef77a+'-'+_0x12b269+'/'+_0x2a28dd)['json'](_0x56cc8f);}return null;};}function patchUpdates(_0x43460c){return function(_0x1ae383){try{jsonpatch[_0xfc6d('0x25')](_0x1ae383,_0x43460c,!![]);}catch(_0x1a1831){return BPromise[_0xfc6d('0x26')](_0x1a1831);}return _0x1ae383[_0xfc6d('0x27')]();};}function saveUpdates(_0x103c44,_0x51c784){return function(_0x1a528c){if(_0x1a528c){return _0x1a528c['update'](_0x103c44)[_0xfc6d('0x28')](function(_0x494bd9){return _0x494bd9;});}return null;};}function removeEntity(_0x31fa6f,_0x551bee){return function(_0x1196fb){if(_0x1196fb){return _0x1196fb[_0xfc6d('0x29')]()[_0xfc6d('0x28')](function(){var _0x5bb04f=_0x1196fb[_0xfc6d('0x2a')]({'plain':!![]});var _0x41fa4b=_0xfc6d('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x41fa4b,'resourceId':_0x5bb04f['id']}})[_0xfc6d('0x28')](function(){return _0x1196fb;});})[_0xfc6d('0x28')](function(){_0x31fa6f[_0xfc6d('0x1d')](0xcc)[_0xfc6d('0x1e')]();});}};}function handleEntityNotFound(_0x26cda6,_0x3fd304){return function(_0x5a2172){if(!_0x5a2172){_0x26cda6[_0xfc6d('0x1c')](0x194);}return _0x5a2172;};}function handleError(_0x437bc7,_0x44cd67){_0x44cd67=_0x44cd67||0x1f4;return function(_0x2efa24){logger[_0xfc6d('0x2c')](_0x2efa24['stack']);if(_0x2efa24[_0xfc6d('0x2d')]){delete _0x2efa24['name'];}_0x437bc7['status'](_0x44cd67)['send'](_0x2efa24);};}exports[_0xfc6d('0x2e')]=function(_0x348e9a,_0x44b137){var _0x3a571c={},_0x594b19={},_0x69acf9={'count':0x0,'rows':[]};var _0x1915c4=_[_0xfc6d('0x2f')](db['SmsQueue'][_0xfc6d('0x30')],function(_0x5a7e1f){return{'name':_0x5a7e1f[_0xfc6d('0x31')],'type':_0x5a7e1f[_0xfc6d('0x32')][_0xfc6d('0x33')]};});_0x594b19[_0xfc6d('0x34')]=_['map'](_0x1915c4,_0xfc6d('0x2d'));_0x594b19[_0xfc6d('0x35')]=_['keys'](_0x348e9a[_0xfc6d('0x35')]);_0x594b19[_0xfc6d('0x36')]=_[_0xfc6d('0x37')](_0x594b19[_0xfc6d('0x34')],_0x594b19[_0xfc6d('0x35')]);_0x3a571c['attributes']=_[_0xfc6d('0x37')](_0x594b19[_0xfc6d('0x34')],qs[_0xfc6d('0x38')](_0x348e9a[_0xfc6d('0x35')][_0xfc6d('0x38')]));_0x3a571c[_0xfc6d('0x39')]=_0x3a571c['attributes'][_0xfc6d('0x3a')]?_0x3a571c[_0xfc6d('0x39')]:_0x594b19[_0xfc6d('0x34')];if(!_0x348e9a[_0xfc6d('0x35')][_0xfc6d('0x3b')](_0xfc6d('0x3c'))){_0x3a571c[_0xfc6d('0x21')]=qs[_0xfc6d('0x21')](_0x348e9a['query'][_0xfc6d('0x21')]);_0x3a571c[_0xfc6d('0x3d')]=qs['offset'](_0x348e9a[_0xfc6d('0x35')]['offset']);}_0x3a571c[_0xfc6d('0x3e')]=qs[_0xfc6d('0x3f')](_0x348e9a[_0xfc6d('0x35')][_0xfc6d('0x3f')]);_0x3a571c[_0xfc6d('0x40')]=qs[_0xfc6d('0x36')](_[_0xfc6d('0x41')](_0x348e9a['query'],_0x594b19[_0xfc6d('0x36')]),_0x1915c4);if(_0x348e9a[_0xfc6d('0x35')][_0xfc6d('0x42')]){_0x3a571c['where']=_['merge'](_0x3a571c[_0xfc6d('0x40')],{'$or':_[_0xfc6d('0x2f')](_0x1915c4,function(_0x4d52ae){if(_0x4d52ae['type']!==_0xfc6d('0x43')){var _0x22bb19={};_0x22bb19[_0x4d52ae[_0xfc6d('0x2d')]]={'$like':'%'+_0x348e9a['query'][_0xfc6d('0x42')]+'%'};return _0x22bb19;}})});}_0x3a571c=_[_0xfc6d('0x44')]({},_0x3a571c,_0x348e9a['options']);var _0x12c11c={'where':_0x3a571c['where']};return db[_0xfc6d('0x45')][_0xfc6d('0x22')](_0x12c11c)[_0xfc6d('0x28')](function(_0xc11cd7){_0x69acf9[_0xfc6d('0x22')]=_0xc11cd7;if(_0x348e9a[_0xfc6d('0x35')][_0xfc6d('0x46')]){_0x3a571c['include']=[{'all':!![]}];}return db[_0xfc6d('0x45')][_0xfc6d('0x47')](_0x3a571c);})[_0xfc6d('0x28')](function(_0x21cf02){_0x69acf9[_0xfc6d('0x48')]=_0x21cf02;return _0x69acf9;})['then'](respondWithFilteredResult(_0x44b137,_0x3a571c))[_0xfc6d('0x49')](handleError(_0x44b137,null));};exports[_0xfc6d('0x4a')]=function(_0x5b2060,_0x4cce17){var _0x1ef72a={'raw':!![],'where':{'id':_0x5b2060['params']['id']}},_0x4f621e={};_0x4f621e[_0xfc6d('0x34')]=_[_0xfc6d('0x4b')](db[_0xfc6d('0x45')]['rawAttributes']);_0x4f621e[_0xfc6d('0x35')]=_[_0xfc6d('0x4b')](_0x5b2060[_0xfc6d('0x35')]);_0x4f621e[_0xfc6d('0x36')]=_[_0xfc6d('0x37')](_0x4f621e[_0xfc6d('0x34')],_0x4f621e[_0xfc6d('0x35')]);_0x1ef72a['attributes']=_[_0xfc6d('0x37')](_0x4f621e[_0xfc6d('0x34')],qs[_0xfc6d('0x38')](_0x5b2060[_0xfc6d('0x35')][_0xfc6d('0x38')]));_0x1ef72a[_0xfc6d('0x39')]=_0x1ef72a[_0xfc6d('0x39')][_0xfc6d('0x3a')]?_0x1ef72a[_0xfc6d('0x39')]:_0x4f621e['model'];if(_0x5b2060[_0xfc6d('0x35')][_0xfc6d('0x46')]){_0x1ef72a['include']=[{'all':!![]}];}_0x1ef72a=_[_0xfc6d('0x44')]({},_0x1ef72a,_0x5b2060[_0xfc6d('0x4c')]);return db['SmsQueue'][_0xfc6d('0x4d')](_0x1ef72a)[_0xfc6d('0x28')](handleEntityNotFound(_0x4cce17,null))[_0xfc6d('0x28')](respondWithResult(_0x4cce17,null))[_0xfc6d('0x49')](handleError(_0x4cce17,null));};exports[_0xfc6d('0x4e')]=function(_0x15d21e,_0x169d73){return db['SmsQueue'][_0xfc6d('0x4e')](_0x15d21e[_0xfc6d('0x4f')],{})[_0xfc6d('0x28')](function(_0x180736){var _0x55dfa1=_0x15d21e[_0xfc6d('0x50')][_0xfc6d('0x2a')]({'plain':!![]});if(!_0x55dfa1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55dfa1[_0xfc6d('0x51')]===_0xfc6d('0x50')){var _0x31528f=_0x180736[_0xfc6d('0x2a')]({'plain':!![]});var _0xd9b89d=_0xfc6d('0x2b');return db['UserProfileSection'][_0xfc6d('0x4d')]({'where':{'name':_0xd9b89d,'userProfileId':_0x55dfa1['userProfileId']},'raw':!![]})[_0xfc6d('0x28')](function(_0x386d24){if(_0x386d24&&_0x386d24[_0xfc6d('0x52')]===0x0){return db[_0xfc6d('0x53')][_0xfc6d('0x4e')]({'name':_0x31528f['name'],'resourceId':_0x31528f['id'],'type':_0x386d24['name'],'sectionId':_0x386d24['id']},{})[_0xfc6d('0x28')](function(){return _0x180736;});}else{return _0x180736;}})[_0xfc6d('0x49')](function(_0xfbc0){logger[_0xfc6d('0x2c')](_0xfc6d('0x54'),_0xfbc0);throw _0xfbc0;});}return _0x180736;})['then'](respondWithResult(_0x169d73,0xc9))['catch'](handleError(_0x169d73,null));};exports['update']=function(_0x2551f,_0x25ec50){if(_0x2551f['body']['id']){delete _0x2551f['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x2551f[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](handleEntityNotFound(_0x25ec50,null))[_0xfc6d('0x28')](saveUpdates(_0x2551f['body'],null))[_0xfc6d('0x28')](respondWithResult(_0x25ec50,null))['catch'](handleError(_0x25ec50,null));};exports[_0xfc6d('0x29')]=function(_0x26816b,_0xd6fb6a){return db[_0xfc6d('0x45')]['find']({'where':{'id':_0x26816b[_0xfc6d('0x55')]['id']}})['then'](handleEntityNotFound(_0xd6fb6a,null))['then'](removeEntity(_0xd6fb6a,null))[_0xfc6d('0x49')](handleError(_0xd6fb6a,null));};exports['describe']=function(_0x196377,_0x456e98){return db['SmsQueue'][_0xfc6d('0x56')]()[_0xfc6d('0x28')](respondWithResult(_0x456e98,null))[_0xfc6d('0x49')](handleError(_0x456e98,null));};exports[_0xfc6d('0x57')]=function(_0x24f054,_0x15690d,_0x4f7c2b){var _0x32e4cd={'raw':!![],'where':{}},_0x3cf16e={},_0x14b3c0;return db[_0xfc6d('0x45')][_0xfc6d('0x58')]({'where':{'id':_0x24f054[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](handleEntityNotFound(_0x15690d,null))[_0xfc6d('0x28')](function(_0x17bac4){if(_0x17bac4){_0x14b3c0=_0x17bac4[_0xfc6d('0x2a')]({'plain':!![]});_0x3cf16e[_0xfc6d('0x34')]=_[_0xfc6d('0x4b')](db[_0xfc6d('0x59')][_0xfc6d('0x30')]);_0x3cf16e['query']=_[_0xfc6d('0x4b')](_0x24f054[_0xfc6d('0x35')]);_0x3cf16e[_0xfc6d('0x36')]=_[_0xfc6d('0x37')](_0x3cf16e[_0xfc6d('0x34')],_0x3cf16e[_0xfc6d('0x35')]);_0x32e4cd[_0xfc6d('0x39')]=_[_0xfc6d('0x37')](_0x3cf16e['model'],qs[_0xfc6d('0x38')](_0x24f054[_0xfc6d('0x35')][_0xfc6d('0x38')]));_0x32e4cd[_0xfc6d('0x39')]=_0x32e4cd[_0xfc6d('0x39')]['length']?_0x32e4cd[_0xfc6d('0x39')]:_0x3cf16e[_0xfc6d('0x34')];if(!_0x24f054[_0xfc6d('0x35')]['hasOwnProperty'](_0xfc6d('0x3c'))){_0x32e4cd[_0xfc6d('0x21')]=qs[_0xfc6d('0x21')](_0x24f054['query']['limit']);_0x32e4cd['offset']=qs[_0xfc6d('0x3d')](_0x24f054[_0xfc6d('0x35')][_0xfc6d('0x3d')]);}_0x32e4cd['order']=qs[_0xfc6d('0x3f')](_0x24f054[_0xfc6d('0x35')][_0xfc6d('0x3f')]);_0x32e4cd['where']=qs[_0xfc6d('0x36')](_[_0xfc6d('0x41')](_0x24f054['query'],_0x3cf16e['filters']));_0x32e4cd[_0xfc6d('0x40')]['SmsQueueId']=_0x17bac4['id'];if(_0x24f054[_0xfc6d('0x35')]['filter']){_0x32e4cd['where']=_[_0xfc6d('0x44')](_0x32e4cd['where'],{'$or':_['map'](_0x32e4cd[_0xfc6d('0x39')],function(_0x51d540){var _0x16e2f1={};_0x16e2f1[_0x51d540]={'$like':'%'+_0x24f054['query'][_0xfc6d('0x42')]+'%'};return _0x16e2f1;})});}_0x32e4cd=_[_0xfc6d('0x44')]({},_0x32e4cd,_0x24f054[_0xfc6d('0x4c')]);return db[_0xfc6d('0x59')][_0xfc6d('0x47')](_0x32e4cd);}})[_0xfc6d('0x28')](function(_0x4b17d8){if(_0x4b17d8){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x4b17d8,_0xfc6d('0x5a')),'role':_0xfc6d('0x5b')},'attributes':['id',_0xfc6d('0x2d'),_0xfc6d('0x5c'),_0xfc6d('0x5d'),_0xfc6d('0x5e')]});}})[_0xfc6d('0x28')](function(_0x2352d8){if(_0x2352d8){return{'count':_0x2352d8[_0xfc6d('0x22')],'rows':_[_0xfc6d('0x2f')](_0x2352d8[_0xfc6d('0x48')],function(_0x96f12){return{'membername':_0x96f12[_0xfc6d('0x2d')],'UserId':_0x96f12['id'],'queue_name':_0x14b3c0[_0xfc6d('0x2d')],'SmsQueueId':_0x14b3c0['id'],'interface':util['format']('%s/%s',_0xfc6d('0x5f'),_0x96f12[_0xfc6d('0x2d')]),'penalty':0x0,'paused':_0x96f12[_0xfc6d('0x5c')],'createdAt':_0x96f12['createdAt'],'updatedAt':_0x96f12[_0xfc6d('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfc6d('0x28')](respondWithFilteredResult(_0x15690d,_0x32e4cd))[_0xfc6d('0x49')](handleError(_0x15690d,null));};exports[_0xfc6d('0x60')]=function(_0x44107b,_0x1fdefb,_0x12932d){var _0x1f347a={};var _0x458674={};var _0x229f69;var _0x8057bf;return db[_0xfc6d('0x45')][_0xfc6d('0x58')]({'where':{'id':_0x44107b[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](handleEntityNotFound(_0x1fdefb,null))[_0xfc6d('0x28')](function(_0x160dce){if(_0x160dce){_0x229f69=_0x160dce;_0x458674[_0xfc6d('0x34')]=_[_0xfc6d('0x4b')](db[_0xfc6d('0x61')][_0xfc6d('0x30')]);_0x458674[_0xfc6d('0x35')]=_[_0xfc6d('0x4b')](_0x44107b[_0xfc6d('0x35')]);_0x458674[_0xfc6d('0x36')]=_[_0xfc6d('0x37')](_0x458674['model'],_0x458674[_0xfc6d('0x35')]);_0x1f347a['attributes']=_[_0xfc6d('0x37')](_0x458674[_0xfc6d('0x34')],qs[_0xfc6d('0x38')](_0x44107b['query'][_0xfc6d('0x38')]));_0x1f347a[_0xfc6d('0x39')]=_0x1f347a['attributes'][_0xfc6d('0x3a')]?_0x1f347a[_0xfc6d('0x39')]:_0x458674[_0xfc6d('0x34')];_0x1f347a[_0xfc6d('0x3e')]=qs[_0xfc6d('0x3f')](_0x44107b[_0xfc6d('0x35')]['sort']);_0x1f347a[_0xfc6d('0x40')]=qs[_0xfc6d('0x36')](_[_0xfc6d('0x41')](_0x44107b[_0xfc6d('0x35')],_0x458674[_0xfc6d('0x36')]));if(_0x44107b[_0xfc6d('0x35')]['filter']){_0x1f347a[_0xfc6d('0x40')]=_[_0xfc6d('0x44')](_0x1f347a[_0xfc6d('0x40')],{'$or':_[_0xfc6d('0x2f')](_0x1f347a['attributes'],function(_0x23e213){var _0x1eeb1e={};_0x1eeb1e[_0x23e213]={'$like':'%'+_0x44107b[_0xfc6d('0x35')]['filter']+'%'};return _0x1eeb1e;})});}_0x1f347a=_[_0xfc6d('0x44')]({},_0x1f347a,_0x44107b[_0xfc6d('0x4c')]);return _0x229f69[_0xfc6d('0x60')](_0x1f347a);}})[_0xfc6d('0x28')](function(_0x33d921){if(_0x33d921){_0x8057bf=_0x33d921[_0xfc6d('0x3a')];if(!_0x44107b[_0xfc6d('0x35')]['hasOwnProperty'](_0xfc6d('0x3c'))){_0x1f347a['limit']=qs[_0xfc6d('0x21')](_0x44107b[_0xfc6d('0x35')]['limit']);_0x1f347a[_0xfc6d('0x3d')]=qs[_0xfc6d('0x3d')](_0x44107b[_0xfc6d('0x35')][_0xfc6d('0x3d')]);}return _0x229f69[_0xfc6d('0x60')](_0x1f347a);}})[_0xfc6d('0x28')](function(_0x31477d){if(_0x31477d){return _0x31477d?{'count':_0x8057bf,'rows':_0x31477d}:null;}})[_0xfc6d('0x28')](respondWithResult(_0x1fdefb,null))['catch'](handleError(_0x1fdefb,null));};exports[_0xfc6d('0x62')]=function(_0x48331c,_0x4e150f,_0x632d72){var _0x50127c=_0x48331c[_0xfc6d('0x4f')][_0xfc6d('0x63')];return db[_0xfc6d('0x61')][_0xfc6d('0x47')]({'where':{'id':_0x50127c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfc6d('0x64'),'attributes':['id',_0xfc6d('0x2d'),_0xfc6d('0x65'),'voicePause','interface'],'raw':!![]}]})[_0xfc6d('0x28')](function(_0x340e40){if(_0x340e40){var _0x59f723=_[_0xfc6d('0x66')](_0x340e40,function(_0x531eda){var _0x290beb=_0x531eda['get']({'plain':!![]});return _0x290beb[_0xfc6d('0x64')];});return db[_0xfc6d('0x45')][_0xfc6d('0x4d')]({'where':{'id':_0x48331c[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](function(_0x442a3d){return db[_0xfc6d('0x67')]['transaction'](function(_0x579bf4){return _0x442a3d['addTeams'](_0x50127c,{'transaction':_0x579bf4})[_0xfc6d('0x28')](function(){return BPromise[_0xfc6d('0x68')](_0x59f723,function(_0x5b5192){return db['UserSmsQueue'][_0xfc6d('0x69')]({'where':{'UserId':_0x5b5192['id'],'SmsQueueId':_0x48331c[_0xfc6d('0x55')]['id']},'transaction':_0x579bf4});});})[_0xfc6d('0x28')](function(){_0x59f723['forEach'](function(_0x28c37a){socket[_0xfc6d('0x6a')]('userSmsQueue:save',{'UserId':_0x28c37a['id'],'SmsQueueId':_0x442a3d['id']});});});});});}})[_0xfc6d('0x28')](respondWithStatusCode(_0x4e150f,null))['catch'](handleError(_0x4e150f,null));};exports[_0xfc6d('0x6b')]=function(_0x424e81,_0x83c38d,_0x481224){return db['Team'][_0xfc6d('0x47')]({'where':{'id':_0x424e81[_0xfc6d('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfc6d('0x6c')],'as':_0xfc6d('0x64'),'attributes':['id'],'raw':!![]}]})[_0xfc6d('0x28')](handleEntityNotFound(_0x83c38d,null))['then'](function(_0x19dbb){var _0x1b3e9a=_[_0xfc6d('0x2f')](_0x19dbb,'id');var _0x2c3424=[];var _0x53dca1=[];var _0x417bd0=squel[_0xfc6d('0x6d')]();_0x417bd0[_0xfc6d('0x6e')](_0xfc6d('0x6f'))['from']('team_has_sms_queues','tq')[_0xfc6d('0x70')]('user_has_teams','ut',_0xfc6d('0x71'))[_0xfc6d('0x40')](_0xfc6d('0x72'),_0x424e81[_0xfc6d('0x55')]['id']);for(var _0x270aa0=0x0;_0x270aa0<_0x19dbb[_0xfc6d('0x3a')];_0x270aa0+=0x1){let _0xce28b4=_0x19dbb[_0x270aa0];for(var _0x14f112=0x0;_0x14f112<_0xce28b4[_0xfc6d('0x64')][_0xfc6d('0x3a')];_0x14f112+=0x1){let _0x44964d=_0xce28b4[_0xfc6d('0x64')][_0x14f112];var _0xea2fa8=_0x417bd0[_0xfc6d('0x73')]();_0xea2fa8[_0xfc6d('0x40')]('ut.UserId\x20=\x20?',_0x44964d['id']);_0x53dca1['push'](db['sequelize'][_0xfc6d('0x35')](_0xea2fa8['toString'](),{'type':db[_0xfc6d('0x67')][_0xfc6d('0x74')]['SELECT']})[_0xfc6d('0x28')](function(_0x360cf8){if(_0x360cf8[_0xfc6d('0x3a')]===0x1){return _0x44964d['id'];}else{var _0x9f816=_['every'](_[_0xfc6d('0x2f')](_0x360cf8,_0xfc6d('0x75')),function(_0x472690){return _[_0xfc6d('0x76')](_0x1b3e9a,_0x472690);});if(_0x9f816){return _0x44964d['id'];}}}));}}return BPromise[_0xfc6d('0x77')](_0x53dca1)[_0xfc6d('0x28')](function(_0xf297fa){_0x2c3424=_(_0x2c3424)['union'](_0xf297fa)['compact']()[_0xfc6d('0x78')]();return db['SmsQueue'][_0xfc6d('0x4d')]({'where':{'id':_0x424e81[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](function(_0x128723){return db[_0xfc6d('0x67')][_0xfc6d('0x79')](function(_0x3ccc53){return _0x128723[_0xfc6d('0x6b')](_0x424e81[_0xfc6d('0x35')][_0xfc6d('0x63')],{'transaction':_0x3ccc53})[_0xfc6d('0x28')](function(){if(!_['isEmpty'](_0x2c3424)){return _0x128723['removeAgents'](_0x2c3424,{'transaction':_0x3ccc53});}})['then'](function(){_0x2c3424[_0xfc6d('0x7a')](function(_0x46007b){socket[_0xfc6d('0x6a')](_0xfc6d('0x7b'),{'UserId':_0x46007b,'SmsQueueId':_0x128723['id']});});});});});});})[_0xfc6d('0x28')](respondWithStatusCode(_0x83c38d,null))[_0xfc6d('0x49')](handleError(_0x83c38d,null));};exports['addAgents']=function(_0x2e0746,_0xe6a8b1,_0x480eb9){return db['SmsQueue'][_0xfc6d('0x4d')]({'where':{'id':_0x2e0746[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](handleEntityNotFound(_0xe6a8b1,null))[_0xfc6d('0x28')](function(_0x109ebc){if(_0x109ebc){return _0x109ebc['addAgents'](_0x2e0746['body'][_0xfc6d('0x63')],_['omit'](_0x2e0746[_0xfc6d('0x4f')],['ids','id'])||{})['spread'](function(_0x4bd7a2){for(var _0x31a58e=0x0;_0x31a58e<_0x2e0746[_0xfc6d('0x4f')][_0xfc6d('0x63')]['length'];_0x31a58e+=0x1){socket[_0xfc6d('0x6a')](_0xfc6d('0x7c'),{'UserId':Number(_0x2e0746[_0xfc6d('0x4f')][_0xfc6d('0x63')][_0x31a58e]),'SmsQueueId':Number(_0x2e0746[_0xfc6d('0x55')]['id'])});}return _0x4bd7a2;});}})[_0xfc6d('0x28')](respondWithResult(_0xe6a8b1,null))[_0xfc6d('0x49')](handleError(_0xe6a8b1,null));};exports[_0xfc6d('0x7d')]=function(_0x45deda,_0x1d1a32,_0x3d0b3a){return db[_0xfc6d('0x45')]['find']({'where':{'id':_0x45deda[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](handleEntityNotFound(_0x1d1a32,null))[_0xfc6d('0x28')](function(_0x1b07f5){if(_0x1b07f5){return _0x1b07f5[_0xfc6d('0x7d')](_0x45deda[_0xfc6d('0x35')][_0xfc6d('0x63')])[_0xfc6d('0x28')](function(){if(_['isArray'](_0x45deda[_0xfc6d('0x35')]['ids'])){for(var _0x9ad8f1=0x0;_0x9ad8f1<_0x45deda[_0xfc6d('0x35')]['ids']['length'];_0x9ad8f1+=0x1){socket[_0xfc6d('0x6a')](_0xfc6d('0x7b'),{'UserId':Number(_0x45deda[_0xfc6d('0x35')][_0xfc6d('0x63')][_0x9ad8f1]),'SmsQueueId':Number(_0x45deda['params']['id'])});}}else{socket['emit'](_0xfc6d('0x7b'),{'UserId':Number(_0x45deda[_0xfc6d('0x35')][_0xfc6d('0x63')]),'SmsQueueId':Number(_0x45deda[_0xfc6d('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1d1a32,null))[_0xfc6d('0x49')](handleError(_0x1d1a32,null));};exports['getAgents']=function(_0x2a7710,_0x4ef620,_0x4869c8){var _0xff9976={};var _0x6b206c={};var _0x51e7ac;var _0x2db068;return db[_0xfc6d('0x45')][_0xfc6d('0x58')]({'where':{'id':_0x2a7710[_0xfc6d('0x55')]['id']}})[_0xfc6d('0x28')](handleEntityNotFound(_0x4ef620,null))[_0xfc6d('0x28')](function(_0x3ef0d5){if(_0x3ef0d5){_0x51e7ac=_0x3ef0d5;_0x6b206c[_0xfc6d('0x34')]=_['keys'](db['User'][_0xfc6d('0x30')]);_0x6b206c[_0xfc6d('0x35')]=_['keys'](_0x2a7710[_0xfc6d('0x35')]);_0x6b206c['filters']=_['intersection'](_0x6b206c[_0xfc6d('0x34')],_0x6b206c[_0xfc6d('0x35')]);_0xff9976[_0xfc6d('0x39')]=_[_0xfc6d('0x37')](_0x6b206c[_0xfc6d('0x34')],qs['fields'](_0x2a7710[_0xfc6d('0x35')][_0xfc6d('0x38')]));_0xff9976[_0xfc6d('0x39')]=_0xff9976[_0xfc6d('0x39')][_0xfc6d('0x3a')]?_0xff9976[_0xfc6d('0x39')]:_0x6b206c[_0xfc6d('0x34')];_0xff9976[_0xfc6d('0x3e')]=qs['sort'](_0x2a7710['query']['sort']);_0xff9976[_0xfc6d('0x40')]=qs[_0xfc6d('0x36')](_[_0xfc6d('0x41')](_0x2a7710[_0xfc6d('0x35')],_0x6b206c[_0xfc6d('0x36')]));if(_0x2a7710['query'][_0xfc6d('0x42')]){_0xff9976[_0xfc6d('0x40')]=_[_0xfc6d('0x44')](_0xff9976[_0xfc6d('0x40')],{'$or':_[_0xfc6d('0x2f')](_0xff9976[_0xfc6d('0x39')],function(_0x4d44dc){var _0xb59e19={};_0xb59e19[_0x4d44dc]={'$like':'%'+_0x2a7710[_0xfc6d('0x35')]['filter']+'%'};return _0xb59e19;})});}_0xff9976=_[_0xfc6d('0x44')]({},_0xff9976,_0x2a7710[_0xfc6d('0x4c')]);return _0x51e7ac['getAgents'](_0xff9976);}})[_0xfc6d('0x28')](function(_0xc746bc){if(_0xc746bc){_0x2db068=_0xc746bc[_0xfc6d('0x3a')];if(!_0x2a7710[_0xfc6d('0x35')]['hasOwnProperty'](_0xfc6d('0x3c'))){_0xff9976[_0xfc6d('0x21')]=qs['limit'](_0x2a7710[_0xfc6d('0x35')][_0xfc6d('0x21')]);_0xff9976[_0xfc6d('0x3d')]=qs['offset'](_0x2a7710[_0xfc6d('0x35')][_0xfc6d('0x3d')]);}return _0x51e7ac[_0xfc6d('0x7e')](_0xff9976);}})[_0xfc6d('0x28')](function(_0x4f4d73){if(_0x4f4d73){return _0x4f4d73?{'count':_0x2db068,'rows':_0x4f4d73}:null;}})['then'](respondWithResult(_0x4ef620,null))[_0xfc6d('0x49')](handleError(_0x4ef620,null));}; \ No newline at end of file +var _0x8bd2=['smsPause','getTeams','Team','addTeams','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','emit','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserSmsQueue','SmsQueueId','options','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP'];(function(_0x19d4fe,_0x16e0e4){var _0x19e238=function(_0x112eda){while(--_0x112eda){_0x19d4fe['push'](_0x19d4fe['shift']());}};_0x19e238(++_0x16e0e4);}(_0x8bd2,0x1d3));var _0x28bd=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x8bd2[_0x344a3f];return _0x264712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28bd('0x0'));var zipdir=require(_0x28bd('0x1'));var jsonpatch=require(_0x28bd('0x2'));var rp=require('request-promise');var moment=require(_0x28bd('0x3'));var BPromise=require(_0x28bd('0x4'));var Mustache=require(_0x28bd('0x5'));var util=require(_0x28bd('0x6'));var path=require(_0x28bd('0x7'));var sox=require(_0x28bd('0x8'));var csv=require(_0x28bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28bd('0xa'));var _=require(_0x28bd('0xb'));var squel=require(_0x28bd('0xc'));var crypto=require('crypto');var jsforce=require(_0x28bd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x28bd('0x9'));var querystring=require(_0x28bd('0xe'));var Papa=require('papaparse');var Redis=require(_0x28bd('0xf'));var authService=require(_0x28bd('0x10'));var qs=require(_0x28bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28bd('0x12'));var logger=require(_0x28bd('0x13'))(_0x28bd('0x14'));var utils=require(_0x28bd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x28bd('0x16')]=_[_0x28bd('0x17')](config[_0x28bd('0x16')],{'host':_0x28bd('0x18'),'port':0x18eb});var socket=require(_0x28bd('0x19'))(new Redis(config[_0x28bd('0x16')]));require(_0x28bd('0x1a'))[_0x28bd('0x1b')](socket);function respondWithStatusCode(_0x5043c5,_0xbc376a){_0xbc376a=_0xbc376a||0xcc;return function(_0x323de2){if(_0x323de2){return _0x5043c5[_0x28bd('0x1c')](_0xbc376a);}return _0x5043c5['status'](_0xbc376a)['end']();};}function respondWithResult(_0x137f72,_0x749afb){_0x749afb=_0x749afb||0xc8;return function(_0x208628){if(_0x208628){return _0x137f72[_0x28bd('0x1d')](_0x749afb)[_0x28bd('0x1e')](_0x208628);}};}function respondWithFilteredResult(_0x28b35d,_0x36558f){return function(_0x5e3cd8){if(_0x5e3cd8){var _0x403930=typeof _0x36558f[_0x28bd('0x1f')]===_0x28bd('0x20')&&typeof _0x36558f[_0x28bd('0x21')]===_0x28bd('0x20');var _0x115b05=_0x5e3cd8[_0x28bd('0x22')];var _0x2005c6=_0x403930?0x0:_0x36558f[_0x28bd('0x1f')];var _0x28a287=_0x403930?_0x5e3cd8[_0x28bd('0x22')]:_0x36558f[_0x28bd('0x1f')]+_0x36558f[_0x28bd('0x21')];var _0x2fe87c;if(_0x28a287>=_0x115b05){_0x28a287=_0x115b05;_0x2fe87c=0xc8;}else{_0x2fe87c=0xce;}_0x28b35d[_0x28bd('0x1d')](_0x2fe87c);return _0x28b35d[_0x28bd('0x23')](_0x28bd('0x24'),_0x2005c6+'-'+_0x28a287+'/'+_0x115b05)[_0x28bd('0x1e')](_0x5e3cd8);}return null;};}function patchUpdates(_0x61b1c5){return function(_0x2b62c4){try{jsonpatch[_0x28bd('0x25')](_0x2b62c4,_0x61b1c5,!![]);}catch(_0x4ae545){return BPromise[_0x28bd('0x26')](_0x4ae545);}return _0x2b62c4[_0x28bd('0x27')]();};}function saveUpdates(_0x260d66,_0x1c427c){return function(_0x21d81c){if(_0x21d81c){return _0x21d81c[_0x28bd('0x28')](_0x260d66)[_0x28bd('0x29')](function(_0x4c8fa5){return _0x4c8fa5;});}return null;};}function removeEntity(_0xf1c745,_0x54a285){return function(_0x233b7d){if(_0x233b7d){return _0x233b7d[_0x28bd('0x2a')]()[_0x28bd('0x29')](function(){var _0x1e5cb6=_0x233b7d['get']({'plain':!![]});var _0x311eb7=_0x28bd('0x2b');return db[_0x28bd('0x2c')][_0x28bd('0x2a')]({'where':{'type':_0x311eb7,'resourceId':_0x1e5cb6['id']}})['then'](function(){return _0x233b7d;});})[_0x28bd('0x29')](function(){_0xf1c745['status'](0xcc)[_0x28bd('0x2d')]();});}};}function handleEntityNotFound(_0x3ea1c1,_0xeefade){return function(_0x309208){if(!_0x309208){_0x3ea1c1['sendStatus'](0x194);}return _0x309208;};}function handleError(_0x549fa1,_0x340fae){_0x340fae=_0x340fae||0x1f4;return function(_0x43937a){logger[_0x28bd('0x2e')](_0x43937a[_0x28bd('0x2f')]);if(_0x43937a[_0x28bd('0x30')]){delete _0x43937a[_0x28bd('0x30')];}_0x549fa1[_0x28bd('0x1d')](_0x340fae)[_0x28bd('0x31')](_0x43937a);};}exports[_0x28bd('0x32')]=function(_0x3b8bb3,_0x184a7c){var _0x550855={},_0x333dc6={},_0x1bb2d9={'count':0x0,'rows':[]};var _0x187e57=_[_0x28bd('0x33')](db[_0x28bd('0x34')][_0x28bd('0x35')],function(_0x26e379){return{'name':_0x26e379['fieldName'],'type':_0x26e379[_0x28bd('0x36')][_0x28bd('0x37')]};});_0x333dc6[_0x28bd('0x38')]=_[_0x28bd('0x33')](_0x187e57,'name');_0x333dc6[_0x28bd('0x39')]=_[_0x28bd('0x3a')](_0x3b8bb3[_0x28bd('0x39')]);_0x333dc6['filters']=_[_0x28bd('0x3b')](_0x333dc6[_0x28bd('0x38')],_0x333dc6[_0x28bd('0x39')]);_0x550855[_0x28bd('0x3c')]=_[_0x28bd('0x3b')](_0x333dc6[_0x28bd('0x38')],qs[_0x28bd('0x3d')](_0x3b8bb3['query'][_0x28bd('0x3d')]));_0x550855['attributes']=_0x550855[_0x28bd('0x3c')][_0x28bd('0x3e')]?_0x550855['attributes']:_0x333dc6['model'];if(!_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x3f')](_0x28bd('0x40'))){_0x550855[_0x28bd('0x21')]=qs[_0x28bd('0x21')](_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x21')]);_0x550855[_0x28bd('0x1f')]=qs[_0x28bd('0x1f')](_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x1f')]);}_0x550855[_0x28bd('0x41')]=qs[_0x28bd('0x42')](_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x42')]);_0x550855[_0x28bd('0x43')]=qs[_0x28bd('0x44')](_[_0x28bd('0x45')](_0x3b8bb3[_0x28bd('0x39')],_0x333dc6[_0x28bd('0x44')]),_0x187e57);if(_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x46')]){_0x550855[_0x28bd('0x43')]=_[_0x28bd('0x47')](_0x550855[_0x28bd('0x43')],{'$or':_[_0x28bd('0x33')](_0x187e57,function(_0x55d2b2){if(_0x55d2b2[_0x28bd('0x36')]!==_0x28bd('0x48')){var _0x395bf4={};_0x395bf4[_0x55d2b2[_0x28bd('0x30')]]={'$like':'%'+_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x46')]+'%'};return _0x395bf4;}})});}_0x550855=_[_0x28bd('0x47')]({},_0x550855,_0x3b8bb3['options']);var _0x44d4b2={'where':_0x550855['where']};return db['SmsQueue'][_0x28bd('0x22')](_0x44d4b2)['then'](function(_0xb73d57){_0x1bb2d9[_0x28bd('0x22')]=_0xb73d57;if(_0x3b8bb3[_0x28bd('0x39')][_0x28bd('0x49')]){_0x550855[_0x28bd('0x4a')]=[{'all':!![]}];}return db['SmsQueue'][_0x28bd('0x4b')](_0x550855);})[_0x28bd('0x29')](function(_0x1aff8c){_0x1bb2d9['rows']=_0x1aff8c;return _0x1bb2d9;})['then'](respondWithFilteredResult(_0x184a7c,_0x550855))[_0x28bd('0x4c')](handleError(_0x184a7c,null));};exports[_0x28bd('0x4d')]=function(_0x284371,_0xd94dc){var _0x121565={'raw':!![],'where':{'id':_0x284371[_0x28bd('0x4e')]['id']}},_0x3cc1f4={};_0x3cc1f4[_0x28bd('0x38')]=_[_0x28bd('0x3a')](db['SmsQueue'][_0x28bd('0x35')]);_0x3cc1f4[_0x28bd('0x39')]=_[_0x28bd('0x3a')](_0x284371[_0x28bd('0x39')]);_0x3cc1f4[_0x28bd('0x44')]=_['intersection'](_0x3cc1f4['model'],_0x3cc1f4[_0x28bd('0x39')]);_0x121565['attributes']=_[_0x28bd('0x3b')](_0x3cc1f4[_0x28bd('0x38')],qs[_0x28bd('0x3d')](_0x284371[_0x28bd('0x39')][_0x28bd('0x3d')]));_0x121565[_0x28bd('0x3c')]=_0x121565[_0x28bd('0x3c')]['length']?_0x121565[_0x28bd('0x3c')]:_0x3cc1f4['model'];if(_0x284371[_0x28bd('0x39')][_0x28bd('0x49')]){_0x121565[_0x28bd('0x4a')]=[{'all':!![]}];}_0x121565=_[_0x28bd('0x47')]({},_0x121565,_0x284371['options']);return db[_0x28bd('0x34')][_0x28bd('0x4f')](_0x121565)[_0x28bd('0x29')](handleEntityNotFound(_0xd94dc,null))['then'](respondWithResult(_0xd94dc,null))[_0x28bd('0x4c')](handleError(_0xd94dc,null));};exports[_0x28bd('0x50')]=function(_0x43c7ee,_0x4964bd){return db['SmsQueue'][_0x28bd('0x50')](_0x43c7ee[_0x28bd('0x51')],{})[_0x28bd('0x29')](function(_0x49aee1){var _0x426816=_0x43c7ee[_0x28bd('0x52')][_0x28bd('0x53')]({'plain':!![]});if(!_0x426816)throw new Error(_0x28bd('0x54'));if(_0x426816[_0x28bd('0x55')]===_0x28bd('0x52')){var _0x51a7c0=_0x49aee1[_0x28bd('0x53')]({'plain':!![]});var _0x269587='SmsQueues';return db[_0x28bd('0x56')][_0x28bd('0x4f')]({'where':{'name':_0x269587,'userProfileId':_0x426816[_0x28bd('0x57')]},'raw':!![]})[_0x28bd('0x29')](function(_0x2eb3b1){if(_0x2eb3b1&&_0x2eb3b1[_0x28bd('0x58')]===0x0){return db[_0x28bd('0x2c')]['create']({'name':_0x51a7c0[_0x28bd('0x30')],'resourceId':_0x51a7c0['id'],'type':_0x2eb3b1[_0x28bd('0x30')],'sectionId':_0x2eb3b1['id']},{})[_0x28bd('0x29')](function(){return _0x49aee1;});}else{return _0x49aee1;}})['catch'](function(_0x5590c7){logger[_0x28bd('0x2e')](_0x28bd('0x59'),_0x5590c7);throw _0x5590c7;});}return _0x49aee1;})[_0x28bd('0x29')](respondWithResult(_0x4964bd,0xc9))[_0x28bd('0x4c')](handleError(_0x4964bd,null));};exports['update']=function(_0x2b2d24,_0x6270a7){if(_0x2b2d24['body']['id']){delete _0x2b2d24[_0x28bd('0x51')]['id'];}return db[_0x28bd('0x34')][_0x28bd('0x4f')]({'where':{'id':_0x2b2d24[_0x28bd('0x4e')]['id']}})[_0x28bd('0x29')](handleEntityNotFound(_0x6270a7,null))[_0x28bd('0x29')](saveUpdates(_0x2b2d24[_0x28bd('0x51')],null))[_0x28bd('0x29')](respondWithResult(_0x6270a7,null))[_0x28bd('0x4c')](handleError(_0x6270a7,null));};exports[_0x28bd('0x2a')]=function(_0xa4b6bb,_0xbd31bc){return db[_0x28bd('0x34')][_0x28bd('0x4f')]({'where':{'id':_0xa4b6bb[_0x28bd('0x4e')]['id']}})['then'](handleEntityNotFound(_0xbd31bc,null))[_0x28bd('0x29')](removeEntity(_0xbd31bc,null))[_0x28bd('0x4c')](handleError(_0xbd31bc,null));};exports[_0x28bd('0x5a')]=function(_0x301554,_0x155dd0){return db[_0x28bd('0x34')]['describe']()[_0x28bd('0x29')](respondWithResult(_0x155dd0,null))[_0x28bd('0x4c')](handleError(_0x155dd0,null));};exports['getMembers']=function(_0x5ecde7,_0x5e6464,_0x3bc821){var _0x28434a={'raw':!![],'where':{}},_0x5a0604={},_0xcbe631;return db[_0x28bd('0x34')][_0x28bd('0x5b')]({'where':{'id':_0x5ecde7[_0x28bd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e6464,null))[_0x28bd('0x29')](function(_0xf7236e){if(_0xf7236e){_0xcbe631=_0xf7236e[_0x28bd('0x53')]({'plain':!![]});_0x5a0604[_0x28bd('0x38')]=_[_0x28bd('0x3a')](db[_0x28bd('0x5c')][_0x28bd('0x35')]);_0x5a0604[_0x28bd('0x39')]=_[_0x28bd('0x3a')](_0x5ecde7[_0x28bd('0x39')]);_0x5a0604['filters']=_[_0x28bd('0x3b')](_0x5a0604[_0x28bd('0x38')],_0x5a0604['query']);_0x28434a[_0x28bd('0x3c')]=_[_0x28bd('0x3b')](_0x5a0604['model'],qs[_0x28bd('0x3d')](_0x5ecde7[_0x28bd('0x39')][_0x28bd('0x3d')]));_0x28434a['attributes']=_0x28434a['attributes'][_0x28bd('0x3e')]?_0x28434a[_0x28bd('0x3c')]:_0x5a0604[_0x28bd('0x38')];if(!_0x5ecde7['query'][_0x28bd('0x3f')]('nolimit')){_0x28434a[_0x28bd('0x21')]=qs[_0x28bd('0x21')](_0x5ecde7[_0x28bd('0x39')][_0x28bd('0x21')]);_0x28434a[_0x28bd('0x1f')]=qs['offset'](_0x5ecde7['query'][_0x28bd('0x1f')]);}_0x28434a['order']=qs[_0x28bd('0x42')](_0x5ecde7[_0x28bd('0x39')][_0x28bd('0x42')]);_0x28434a[_0x28bd('0x43')]=qs['filters'](_['pick'](_0x5ecde7[_0x28bd('0x39')],_0x5a0604[_0x28bd('0x44')]));_0x28434a[_0x28bd('0x43')][_0x28bd('0x5d')]=_0xf7236e['id'];if(_0x5ecde7['query'][_0x28bd('0x46')]){_0x28434a[_0x28bd('0x43')]=_[_0x28bd('0x47')](_0x28434a[_0x28bd('0x43')],{'$or':_[_0x28bd('0x33')](_0x28434a[_0x28bd('0x3c')],function(_0x533288){var _0xc2cd1b={};_0xc2cd1b[_0x533288]={'$like':'%'+_0x5ecde7['query'][_0x28bd('0x46')]+'%'};return _0xc2cd1b;})});}_0x28434a=_['merge']({},_0x28434a,_0x5ecde7[_0x28bd('0x5e')]);return db['UserSmsQueue'][_0x28bd('0x4b')](_0x28434a);}})[_0x28bd('0x29')](function(_0x41fdd5){if(_0x41fdd5){return db[_0x28bd('0x5f')][_0x28bd('0x60')]({'where':{'id':_[_0x28bd('0x33')](_0x41fdd5,_0x28bd('0x61')),'role':_0x28bd('0x62')},'attributes':['id',_0x28bd('0x30'),'smsPause',_0x28bd('0x63'),_0x28bd('0x64')]});}})[_0x28bd('0x29')](function(_0x18c874){if(_0x18c874){return{'count':_0x18c874[_0x28bd('0x22')],'rows':_[_0x28bd('0x33')](_0x18c874[_0x28bd('0x65')],function(_0x5ba448){return{'membername':_0x5ba448[_0x28bd('0x30')],'UserId':_0x5ba448['id'],'queue_name':_0xcbe631['name'],'SmsQueueId':_0xcbe631['id'],'interface':util[_0x28bd('0x66')](_0x28bd('0x67'),_0x28bd('0x68'),_0x5ba448[_0x28bd('0x30')]),'penalty':0x0,'paused':_0x5ba448[_0x28bd('0x69')],'createdAt':_0x5ba448['createdAt'],'updatedAt':_0x5ba448[_0x28bd('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x28bd('0x29')](respondWithFilteredResult(_0x5e6464,_0x28434a))['catch'](handleError(_0x5e6464,null));};exports[_0x28bd('0x6a')]=function(_0x37e0b8,_0x19f3a5,_0x1a7289){var _0x5707c6={};var _0xa74a2e={};var _0x201623;var _0xcf7f6a;return db[_0x28bd('0x34')][_0x28bd('0x5b')]({'where':{'id':_0x37e0b8[_0x28bd('0x4e')]['id']}})[_0x28bd('0x29')](handleEntityNotFound(_0x19f3a5,null))[_0x28bd('0x29')](function(_0x51fe20){if(_0x51fe20){_0x201623=_0x51fe20;_0xa74a2e[_0x28bd('0x38')]=_[_0x28bd('0x3a')](db[_0x28bd('0x6b')][_0x28bd('0x35')]);_0xa74a2e[_0x28bd('0x39')]=_[_0x28bd('0x3a')](_0x37e0b8[_0x28bd('0x39')]);_0xa74a2e[_0x28bd('0x44')]=_[_0x28bd('0x3b')](_0xa74a2e['model'],_0xa74a2e[_0x28bd('0x39')]);_0x5707c6[_0x28bd('0x3c')]=_[_0x28bd('0x3b')](_0xa74a2e[_0x28bd('0x38')],qs[_0x28bd('0x3d')](_0x37e0b8['query']['fields']));_0x5707c6[_0x28bd('0x3c')]=_0x5707c6['attributes'][_0x28bd('0x3e')]?_0x5707c6['attributes']:_0xa74a2e[_0x28bd('0x38')];_0x5707c6[_0x28bd('0x41')]=qs[_0x28bd('0x42')](_0x37e0b8[_0x28bd('0x39')][_0x28bd('0x42')]);_0x5707c6['where']=qs[_0x28bd('0x44')](_[_0x28bd('0x45')](_0x37e0b8['query'],_0xa74a2e[_0x28bd('0x44')]));if(_0x37e0b8['query'][_0x28bd('0x46')]){_0x5707c6['where']=_[_0x28bd('0x47')](_0x5707c6[_0x28bd('0x43')],{'$or':_[_0x28bd('0x33')](_0x5707c6[_0x28bd('0x3c')],function(_0x2d88b6){var _0x4e7b94={};_0x4e7b94[_0x2d88b6]={'$like':'%'+_0x37e0b8[_0x28bd('0x39')][_0x28bd('0x46')]+'%'};return _0x4e7b94;})});}_0x5707c6=_[_0x28bd('0x47')]({},_0x5707c6,_0x37e0b8[_0x28bd('0x5e')]);return _0x201623[_0x28bd('0x6a')](_0x5707c6);}})[_0x28bd('0x29')](function(_0x2749f9){if(_0x2749f9){_0xcf7f6a=_0x2749f9['length'];if(!_0x37e0b8[_0x28bd('0x39')]['hasOwnProperty'](_0x28bd('0x40'))){_0x5707c6['limit']=qs[_0x28bd('0x21')](_0x37e0b8[_0x28bd('0x39')][_0x28bd('0x21')]);_0x5707c6[_0x28bd('0x1f')]=qs[_0x28bd('0x1f')](_0x37e0b8[_0x28bd('0x39')]['offset']);}return _0x201623[_0x28bd('0x6a')](_0x5707c6);}})[_0x28bd('0x29')](function(_0xf46dcc){if(_0xf46dcc){return _0xf46dcc?{'count':_0xcf7f6a,'rows':_0xf46dcc}:null;}})[_0x28bd('0x29')](respondWithResult(_0x19f3a5,null))[_0x28bd('0x4c')](handleError(_0x19f3a5,null));};exports[_0x28bd('0x6c')]=function(_0x1926e8,_0x19ea65,_0x31370a){var _0x5ed236=_0x1926e8[_0x28bd('0x51')][_0x28bd('0x6d')];return db[_0x28bd('0x6b')][_0x28bd('0x4b')]({'where':{'id':_0x5ed236},'attributes':['id'],'include':[{'model':db[_0x28bd('0x5f')],'as':_0x28bd('0x6e'),'attributes':['id',_0x28bd('0x30'),_0x28bd('0x6f'),'voicePause',_0x28bd('0x70')],'raw':!![]}]})['then'](function(_0x4028d2){if(_0x4028d2){var _0x4c267b=_['flatMap'](_0x4028d2,function(_0x59b13b){var _0xa3cc48=_0x59b13b[_0x28bd('0x53')]({'plain':!![]});return _0xa3cc48['Agents'];});return db[_0x28bd('0x34')]['find']({'where':{'id':_0x1926e8['params']['id']}})[_0x28bd('0x29')](function(_0x16e8ef){return db[_0x28bd('0x71')][_0x28bd('0x72')](function(_0x3770e6){return _0x16e8ef['addTeams'](_0x5ed236,{'transaction':_0x3770e6})['then'](function(){return BPromise[_0x28bd('0x73')](_0x4c267b,function(_0x2cb742){return db[_0x28bd('0x5c')][_0x28bd('0x74')]({'where':{'UserId':_0x2cb742['id'],'SmsQueueId':_0x1926e8[_0x28bd('0x4e')]['id']},'transaction':_0x3770e6});});})[_0x28bd('0x29')](function(){_0x4c267b['forEach'](function(_0x250b2d){socket[_0x28bd('0x75')]('userSmsQueue:save',{'UserId':_0x250b2d['id'],'SmsQueueId':_0x16e8ef['id']});});});});});}})[_0x28bd('0x29')](respondWithStatusCode(_0x19ea65,null))[_0x28bd('0x4c')](handleError(_0x19ea65,null));};exports[_0x28bd('0x76')]=function(_0x16815a,_0x107017,_0x9489f3){return db[_0x28bd('0x6b')][_0x28bd('0x4b')]({'where':{'id':_0x16815a['query'][_0x28bd('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x28bd('0x5f')],'as':_0x28bd('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x28bd('0x29')](handleEntityNotFound(_0x107017,null))['then'](function(_0x3a7438){var _0x7a92b3=_['map'](_0x3a7438,'id');var _0x23965a=[];var _0x28801e=[];var _0x56e111=squel['select']();_0x56e111['field'](_0x28bd('0x77'))[_0x28bd('0x78')](_0x28bd('0x79'),'tq')[_0x28bd('0x7a')](_0x28bd('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x28bd('0x43')](_0x28bd('0x7c'),_0x16815a[_0x28bd('0x4e')]['id']);for(var _0x2bc29d=0x0;_0x2bc29d<_0x3a7438[_0x28bd('0x3e')];_0x2bc29d+=0x1){let _0x148340=_0x3a7438[_0x2bc29d];for(var _0x39bb81=0x0;_0x39bb81<_0x148340[_0x28bd('0x6e')][_0x28bd('0x3e')];_0x39bb81+=0x1){let _0x27e6c3=_0x148340[_0x28bd('0x6e')][_0x39bb81];var _0x5bb791=_0x56e111[_0x28bd('0x7d')]();_0x5bb791[_0x28bd('0x43')](_0x28bd('0x7e'),_0x27e6c3['id']);_0x28801e[_0x28bd('0x7f')](db[_0x28bd('0x71')]['query'](_0x5bb791['toString'](),{'type':db[_0x28bd('0x71')][_0x28bd('0x80')][_0x28bd('0x81')]})[_0x28bd('0x29')](function(_0x1bdae1){if(_0x1bdae1[_0x28bd('0x3e')]===0x1){return _0x27e6c3['id'];}else{var _0x1bafa5=_[_0x28bd('0x82')](_['map'](_0x1bdae1,_0x28bd('0x83')),function(_0x311a5c){return _[_0x28bd('0x84')](_0x7a92b3,_0x311a5c);});if(_0x1bafa5){return _0x27e6c3['id'];}}}));}}return BPromise['all'](_0x28801e)['then'](function(_0x5c72b9){_0x23965a=_(_0x23965a)['union'](_0x5c72b9)['compact']()[_0x28bd('0x85')]();return db[_0x28bd('0x34')][_0x28bd('0x4f')]({'where':{'id':_0x16815a[_0x28bd('0x4e')]['id']}})[_0x28bd('0x29')](function(_0x1b845e){return db[_0x28bd('0x71')][_0x28bd('0x72')](function(_0x3e3c31){return _0x1b845e[_0x28bd('0x76')](_0x16815a[_0x28bd('0x39')][_0x28bd('0x6d')],{'transaction':_0x3e3c31})[_0x28bd('0x29')](function(){if(!_[_0x28bd('0x86')](_0x23965a)){return _0x1b845e[_0x28bd('0x87')](_0x23965a,{'transaction':_0x3e3c31});}})['then'](function(){_0x23965a[_0x28bd('0x88')](function(_0x400ab4){socket[_0x28bd('0x75')](_0x28bd('0x89'),{'UserId':_0x400ab4,'SmsQueueId':_0x1b845e['id']});});});});});});})[_0x28bd('0x29')](respondWithStatusCode(_0x107017,null))[_0x28bd('0x4c')](handleError(_0x107017,null));};exports[_0x28bd('0x8a')]=function(_0x42bd47,_0x3427af,_0x532b3c){return db[_0x28bd('0x34')][_0x28bd('0x4f')]({'where':{'id':_0x42bd47[_0x28bd('0x4e')]['id']}})[_0x28bd('0x29')](handleEntityNotFound(_0x3427af,null))[_0x28bd('0x29')](function(_0x413b7e){if(_0x413b7e){return _0x413b7e[_0x28bd('0x8a')](_0x42bd47[_0x28bd('0x51')][_0x28bd('0x6d')],_[_0x28bd('0x8b')](_0x42bd47[_0x28bd('0x51')],[_0x28bd('0x6d'),'id'])||{})[_0x28bd('0x8c')](function(_0x14f675){for(var _0x15bf11=0x0;_0x15bf11<_0x42bd47[_0x28bd('0x51')][_0x28bd('0x6d')][_0x28bd('0x3e')];_0x15bf11+=0x1){socket[_0x28bd('0x75')]('userSmsQueue:save',{'UserId':Number(_0x42bd47[_0x28bd('0x51')][_0x28bd('0x6d')][_0x15bf11]),'SmsQueueId':Number(_0x42bd47[_0x28bd('0x4e')]['id'])});}return _0x14f675;});}})[_0x28bd('0x29')](respondWithResult(_0x3427af,null))[_0x28bd('0x4c')](handleError(_0x3427af,null));};exports[_0x28bd('0x87')]=function(_0x2a02c9,_0x3dc9f0,_0xfc03a4){return db[_0x28bd('0x34')][_0x28bd('0x4f')]({'where':{'id':_0x2a02c9[_0x28bd('0x4e')]['id']}})[_0x28bd('0x29')](handleEntityNotFound(_0x3dc9f0,null))[_0x28bd('0x29')](function(_0x638ba){if(_0x638ba){return _0x638ba[_0x28bd('0x87')](_0x2a02c9[_0x28bd('0x39')][_0x28bd('0x6d')])[_0x28bd('0x29')](function(){if(_[_0x28bd('0x8d')](_0x2a02c9[_0x28bd('0x39')][_0x28bd('0x6d')])){for(var _0x109bef=0x0;_0x109bef<_0x2a02c9[_0x28bd('0x39')][_0x28bd('0x6d')]['length'];_0x109bef+=0x1){socket[_0x28bd('0x75')](_0x28bd('0x89'),{'UserId':Number(_0x2a02c9['query'][_0x28bd('0x6d')][_0x109bef]),'SmsQueueId':Number(_0x2a02c9[_0x28bd('0x4e')]['id'])});}}else{socket[_0x28bd('0x75')]('userSmsQueue:remove',{'UserId':Number(_0x2a02c9[_0x28bd('0x39')][_0x28bd('0x6d')]),'SmsQueueId':Number(_0x2a02c9[_0x28bd('0x4e')]['id'])});}});}})[_0x28bd('0x29')](respondWithStatusCode(_0x3dc9f0,null))[_0x28bd('0x4c')](handleError(_0x3dc9f0,null));};exports[_0x28bd('0x8e')]=function(_0x2d69ce,_0x5b2834,_0x546b8c){var _0x1f7fd2={};var _0x14da31={};var _0x21dad6;var _0x1d5870;return db[_0x28bd('0x34')][_0x28bd('0x5b')]({'where':{'id':_0x2d69ce[_0x28bd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5b2834,null))[_0x28bd('0x29')](function(_0x1a4947){if(_0x1a4947){_0x21dad6=_0x1a4947;_0x14da31[_0x28bd('0x38')]=_[_0x28bd('0x3a')](db['User'][_0x28bd('0x35')]);_0x14da31[_0x28bd('0x39')]=_[_0x28bd('0x3a')](_0x2d69ce[_0x28bd('0x39')]);_0x14da31[_0x28bd('0x44')]=_[_0x28bd('0x3b')](_0x14da31[_0x28bd('0x38')],_0x14da31['query']);_0x1f7fd2['attributes']=_['intersection'](_0x14da31['model'],qs[_0x28bd('0x3d')](_0x2d69ce[_0x28bd('0x39')][_0x28bd('0x3d')]));_0x1f7fd2[_0x28bd('0x3c')]=_0x1f7fd2['attributes']['length']?_0x1f7fd2['attributes']:_0x14da31[_0x28bd('0x38')];_0x1f7fd2[_0x28bd('0x41')]=qs[_0x28bd('0x42')](_0x2d69ce[_0x28bd('0x39')]['sort']);_0x1f7fd2[_0x28bd('0x43')]=qs[_0x28bd('0x44')](_[_0x28bd('0x45')](_0x2d69ce[_0x28bd('0x39')],_0x14da31[_0x28bd('0x44')]));if(_0x2d69ce[_0x28bd('0x39')][_0x28bd('0x46')]){_0x1f7fd2['where']=_[_0x28bd('0x47')](_0x1f7fd2[_0x28bd('0x43')],{'$or':_[_0x28bd('0x33')](_0x1f7fd2[_0x28bd('0x3c')],function(_0x28a097){var _0x488d02={};_0x488d02[_0x28a097]={'$like':'%'+_0x2d69ce[_0x28bd('0x39')]['filter']+'%'};return _0x488d02;})});}_0x1f7fd2=_['merge']({},_0x1f7fd2,_0x2d69ce[_0x28bd('0x5e')]);return _0x21dad6['getAgents'](_0x1f7fd2);}})[_0x28bd('0x29')](function(_0x5a8d31){if(_0x5a8d31){_0x1d5870=_0x5a8d31['length'];if(!_0x2d69ce[_0x28bd('0x39')]['hasOwnProperty'](_0x28bd('0x40'))){_0x1f7fd2[_0x28bd('0x21')]=qs[_0x28bd('0x21')](_0x2d69ce[_0x28bd('0x39')][_0x28bd('0x21')]);_0x1f7fd2['offset']=qs[_0x28bd('0x1f')](_0x2d69ce[_0x28bd('0x39')][_0x28bd('0x1f')]);}return _0x21dad6['getAgents'](_0x1f7fd2);}})[_0x28bd('0x29')](function(_0x1cf425){if(_0x1cf425){return _0x1cf425?{'count':_0x1d5870,'rows':_0x1cf425}:null;}})[_0x28bd('0x29')](respondWithResult(_0x5b2834,null))[_0x28bd('0x4c')](handleError(_0x5b2834,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 0076d4e..d6d108c 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 _0x1393=['../../mysqldb','SmsQueue','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x1393,0xef));var _0x3139=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1393[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x3139('0x0'));var SmsQueue=require(_0x3139('0x1'))['db'][_0x3139('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3139('0x3'),'afterDestroy':_0x3139('0x4')};function emitEvent(_0x4bb553){return function(_0x24bda4,_0x2d90fb,_0x1ab944){SmsQueueEvents[_0x3139('0x5')](_0x4bb553+':'+_0x24bda4['id'],_0x24bda4);SmsQueueEvents[_0x3139('0x5')](_0x4bb553,_0x24bda4);_0x1ab944(null);};}for(var e in events){if(events[_0x3139('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x3139('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x1113=['save','emit','hook','events','SmsQueue','setMaxListeners'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x1113,0x135));var _0x3111=function(_0xd6c010,_0x5355e6){_0xd6c010=_0xd6c010-0x0;var _0x15893b=_0x1113[_0xd6c010];return _0x15893b;};'use strict';var EventEmitter=require(_0x3111('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x3111('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3111('0x2')](0x0);var events={'afterCreate':_0x3111('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x542193){return function(_0x54e389,_0x51e0d0,_0x4e8543){SmsQueueEvents[_0x3111('0x4')](_0x542193+':'+_0x54e389['id'],_0x54e389);SmsQueueEvents[_0x3111('0x4')](_0x542193,_0x54e389);_0x4e8543(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x3111('0x5')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index edbfdaa..5cdf214 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 _0x65db=['rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','api','bluebird','request-promise','path'];(function(_0x2d6ca3,_0x365b82){var _0x515138=function(_0x420548){while(--_0x420548){_0x2d6ca3['push'](_0x2d6ca3['shift']());}};_0x515138(++_0x365b82);}(_0x65db,0xed));var _0xb65d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x65db[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb65d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb65d('0x1'));var moment=require('moment');var BPromise=require(_0xb65d('0x2'));var rp=require(_0xb65d('0x3'));var fs=require('fs');var path=require(_0xb65d('0x4'));var rimraf=require(_0xb65d('0x5'));var config=require(_0xb65d('0x6'));var attributes=require(_0xb65d('0x7'));module[_0xb65d('0x8')]=function(_0x44ccbd,_0x5e0ade){return _0x44ccbd['define'](_0xb65d('0x9'),attributes,{'tableName':_0xb65d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2074=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x2074,0x10f));var _0x4207=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x2074[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x4207('0x0'));var util=require(_0x4207('0x1'));var logger=require(_0x4207('0x2'))(_0x4207('0x3'));var moment=require(_0x4207('0x4'));var BPromise=require('bluebird');var rp=require(_0x4207('0x5'));var fs=require('fs');var path=require(_0x4207('0x6'));var rimraf=require(_0x4207('0x7'));var config=require(_0x4207('0x8'));var attributes=require('./smsQueue.attributes');module[_0x4207('0x9')]=function(_0x4e8eeb,_0x3cf8fc){return _0x4e8eeb[_0x4207('0xa')](_0x4207('0xb'),attributes,{'tableName':_0x4207('0xc'),'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 eb25a45..a99cb02 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 _0xac66=['GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','model','map','debug','ShowSmsQueue','raw','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x154044,_0x3d296a){var _0x49ec50=function(_0x13bc99){while(--_0x13bc99){_0x154044['push'](_0x154044['shift']());}};_0x49ec50(++_0x3d296a);}(_0xac66,0x1bb));var _0x6ac6=function(_0x41b2ca,_0x22333a){_0x41b2ca=_0x41b2ca-0x0;var _0x538655=_0xac66[_0x41b2ca];return _0x538655;};'use strict';var _=require('lodash');var util=require(_0x6ac6('0x0'));var moment=require(_0x6ac6('0x1'));var BPromise=require(_0x6ac6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ac6('0x3'));var db=require(_0x6ac6('0x4'))['db'];var utils=require(_0x6ac6('0x5'));var logger=require(_0x6ac6('0x6'))('rpc');var config=require(_0x6ac6('0x7'));var jayson=require(_0x6ac6('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x6ac6('0x9')](config['redis'],{'host':_0x6ac6('0xa'),'port':0x18eb});var socket=require(_0x6ac6('0xb'))(new Redis(config[_0x6ac6('0xc')]));require(_0x6ac6('0xd'))[_0x6ac6('0xe')](socket);function respondWithRpcPromise(_0x4e9c20,_0x1d948c,_0x26d507){return new BPromise(function(_0x4ace2a,_0x5f3066){return client[_0x6ac6('0xf')](_0x4e9c20,_0x26d507)['then'](function(_0x2d3cba){logger[_0x6ac6('0x10')](_0x6ac6('0x11'),_0x1d948c,_0x6ac6('0x12'));logger['debug'](_0x6ac6('0x13'),_0x1d948c,_0x6ac6('0x12'),JSON[_0x6ac6('0x14')](_0x2d3cba));if(_0x2d3cba[_0x6ac6('0x15')]){if(_0x2d3cba[_0x6ac6('0x15')]['code']===0x1f4){logger[_0x6ac6('0x15')](_0x6ac6('0x11'),_0x1d948c,_0x2d3cba[_0x6ac6('0x15')][_0x6ac6('0x16')]);return _0x5f3066(_0x2d3cba[_0x6ac6('0x15')][_0x6ac6('0x16')]);}logger['error'](_0x6ac6('0x11'),_0x1d948c,_0x2d3cba['error']['message']);return _0x4ace2a(_0x2d3cba[_0x6ac6('0x15')][_0x6ac6('0x16')]);}else{logger[_0x6ac6('0x10')](_0x6ac6('0x11'),_0x1d948c,_0x6ac6('0x12'));_0x4ace2a(_0x2d3cba[_0x6ac6('0x17')][_0x6ac6('0x16')]);}})[_0x6ac6('0x18')](function(_0x21673b){logger[_0x6ac6('0x15')](_0x6ac6('0x11'),_0x1d948c,_0x21673b);_0x5f3066(_0x21673b);});});}exports[_0x6ac6('0x19')]=function(_0x28163c){var _0xcccb26=this;return new Promise(function(_0x2aa4ac,_0x3f3566){return db[_0x6ac6('0x1a')][_0x6ac6('0x1b')]({'raw':_0x28163c[_0x6ac6('0x1c')]?_0x28163c[_0x6ac6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x28163c['options']?_0x28163c[_0x6ac6('0x1c')][_0x6ac6('0x1d')]||null:null,'attributes':_0x28163c['options']?_0x28163c[_0x6ac6('0x1c')][_0x6ac6('0x1e')]||null:null,'limit':_0x28163c[_0x6ac6('0x1c')]?_0x28163c['options'][_0x6ac6('0x1f')]||null:null,'include':_0x28163c[_0x6ac6('0x1c')]?_0x28163c[_0x6ac6('0x1c')][_0x6ac6('0x20')]?_['map'](_0x28163c[_0x6ac6('0x1c')][_0x6ac6('0x20')],function(_0x43deb7){return{'model':db[_0x43deb7[_0x6ac6('0x21')]],'as':_0x43deb7['as'],'attributes':_0x43deb7['attributes'],'include':_0x43deb7['include']?_[_0x6ac6('0x22')](_0x43deb7[_0x6ac6('0x20')],function(_0x1ad2e0){return{'model':db[_0x1ad2e0[_0x6ac6('0x21')]],'as':_0x1ad2e0['as'],'attributes':_0x1ad2e0[_0x6ac6('0x1e')],'include':_0x1ad2e0[_0x6ac6('0x20')]?_[_0x6ac6('0x22')](_0x1ad2e0[_0x6ac6('0x20')],function(_0x3f772c){return{'model':db[_0x3f772c[_0x6ac6('0x21')]],'as':_0x3f772c['as'],'attributes':_0x3f772c[_0x6ac6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x729ff6){logger[_0x6ac6('0x10')](_0x6ac6('0x19'),_0x28163c);logger[_0x6ac6('0x23')](_0x6ac6('0x19'),_0x28163c,JSON[_0x6ac6('0x14')](_0x729ff6));_0x2aa4ac(_0x729ff6);})[_0x6ac6('0x18')](function(_0x16475d){logger[_0x6ac6('0x15')](_0x6ac6('0x19'),_0x16475d['message'],_0x28163c);_0x3f3566(_0xcccb26[_0x6ac6('0x15')](0x1f4,_0x16475d['message']));});});};exports[_0x6ac6('0x24')]=function(_0x2128de){var _0x16ceb4=this;return new Promise(function(_0x133844,_0x1d128b){return db[_0x6ac6('0x1a')]['find']({'raw':_0x2128de['options']?_0x2128de['options'][_0x6ac6('0x25')]===undefined?!![]:![]:!![],'where':_0x2128de['options']?_0x2128de[_0x6ac6('0x1c')][_0x6ac6('0x1d')]||null:null,'attributes':_0x2128de[_0x6ac6('0x1c')]?_0x2128de[_0x6ac6('0x1c')][_0x6ac6('0x1e')]||null:null,'include':_0x2128de[_0x6ac6('0x1c')]?_0x2128de[_0x6ac6('0x1c')][_0x6ac6('0x20')]?_['map'](_0x2128de['options'][_0x6ac6('0x20')],function(_0x551f2e){return{'model':db[_0x551f2e[_0x6ac6('0x21')]],'as':_0x551f2e['as'],'attributes':_0x551f2e[_0x6ac6('0x1e')],'include':_0x551f2e[_0x6ac6('0x20')]?_['map'](_0x551f2e['include'],function(_0x29415f){return{'model':db[_0x29415f[_0x6ac6('0x21')]],'as':_0x29415f['as'],'attributes':_0x29415f[_0x6ac6('0x1e')],'include':_0x29415f[_0x6ac6('0x20')]?_[_0x6ac6('0x22')](_0x29415f[_0x6ac6('0x20')],function(_0x59fb65){return{'model':db[_0x59fb65['model']],'as':_0x59fb65['as'],'attributes':_0x59fb65['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ac6('0x26')](function(_0x30a179){logger[_0x6ac6('0x10')]('ShowSmsQueue',_0x2128de);logger[_0x6ac6('0x23')](_0x6ac6('0x24'),_0x2128de,JSON['stringify'](_0x30a179));_0x133844(_0x30a179);})['catch'](function(_0x443a24){logger[_0x6ac6('0x15')](_0x6ac6('0x24'),_0x443a24[_0x6ac6('0x16')],_0x2128de);_0x1d128b(_0x16ceb4['error'](0x1f4,_0x443a24['message']));});});}; \ No newline at end of file +var _0x4a8a=['error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','debug','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4a8a,0x18d));var _0xa4a8=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x4a8a[_0x148c09];return _0x18e613;};'use strict';var _=require(_0xa4a8('0x0'));var util=require('util');var moment=require(_0xa4a8('0x1'));var BPromise=require(_0xa4a8('0x2'));var rs=require(_0xa4a8('0x3'));var fs=require('fs');var Redis=require(_0xa4a8('0x4'));var db=require(_0xa4a8('0x5'))['db'];var utils=require(_0xa4a8('0x6'));var logger=require(_0xa4a8('0x7'))(_0xa4a8('0x8'));var config=require(_0xa4a8('0x9'));var jayson=require(_0xa4a8('0xa'));var client=jayson[_0xa4a8('0xb')][_0xa4a8('0xc')]({'port':0x232a});config[_0xa4a8('0xd')]=_[_0xa4a8('0xe')](config[_0xa4a8('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4a8('0xf'))(new Redis(config[_0xa4a8('0xd')]));require(_0xa4a8('0x10'))['register'](socket);function respondWithRpcPromise(_0x3c5454,_0x560814,_0x66ef07){return new BPromise(function(_0x4b0a8d,_0x1b47a8){return client[_0xa4a8('0x11')](_0x3c5454,_0x66ef07)[_0xa4a8('0x12')](function(_0x571f8b){logger['info'](_0xa4a8('0x13'),_0x560814,_0xa4a8('0x14'));logger['debug'](_0xa4a8('0x15'),_0x560814,_0xa4a8('0x14'),JSON[_0xa4a8('0x16')](_0x571f8b));if(_0x571f8b[_0xa4a8('0x17')]){if(_0x571f8b['error'][_0xa4a8('0x18')]===0x1f4){logger[_0xa4a8('0x17')](_0xa4a8('0x13'),_0x560814,_0x571f8b[_0xa4a8('0x17')]['message']);return _0x1b47a8(_0x571f8b[_0xa4a8('0x17')]['message']);}logger['error'](_0xa4a8('0x13'),_0x560814,_0x571f8b[_0xa4a8('0x17')][_0xa4a8('0x19')]);return _0x4b0a8d(_0x571f8b[_0xa4a8('0x17')]['message']);}else{logger['info'](_0xa4a8('0x13'),_0x560814,'request\x20sent');_0x4b0a8d(_0x571f8b[_0xa4a8('0x1a')][_0xa4a8('0x19')]);}})[_0xa4a8('0x1b')](function(_0x1c2d0c){logger[_0xa4a8('0x17')](_0xa4a8('0x13'),_0x560814,_0x1c2d0c);_0x1b47a8(_0x1c2d0c);});});}exports[_0xa4a8('0x1c')]=function(_0xc4a6b8){var _0x10952c=this;return new Promise(function(_0x572587,_0x565f1d){return db[_0xa4a8('0x1d')][_0xa4a8('0x1e')]({'raw':_0xc4a6b8[_0xa4a8('0x1f')]?_0xc4a6b8[_0xa4a8('0x1f')][_0xa4a8('0x20')]===undefined?!![]:![]:!![],'where':_0xc4a6b8[_0xa4a8('0x1f')]?_0xc4a6b8[_0xa4a8('0x1f')][_0xa4a8('0x21')]||null:null,'attributes':_0xc4a6b8[_0xa4a8('0x1f')]?_0xc4a6b8[_0xa4a8('0x1f')][_0xa4a8('0x22')]||null:null,'limit':_0xc4a6b8[_0xa4a8('0x1f')]?_0xc4a6b8[_0xa4a8('0x1f')][_0xa4a8('0x23')]||null:null,'include':_0xc4a6b8[_0xa4a8('0x1f')]?_0xc4a6b8[_0xa4a8('0x1f')][_0xa4a8('0x24')]?_['map'](_0xc4a6b8[_0xa4a8('0x1f')][_0xa4a8('0x24')],function(_0x47f467){return{'model':db[_0x47f467[_0xa4a8('0x25')]],'as':_0x47f467['as'],'attributes':_0x47f467['attributes'],'include':_0x47f467[_0xa4a8('0x24')]?_[_0xa4a8('0x26')](_0x47f467[_0xa4a8('0x24')],function(_0x11841c){return{'model':db[_0x11841c['model']],'as':_0x11841c['as'],'attributes':_0x11841c[_0xa4a8('0x22')],'include':_0x11841c[_0xa4a8('0x24')]?_['map'](_0x11841c[_0xa4a8('0x24')],function(_0x3ecc31){return{'model':db[_0x3ecc31['model']],'as':_0x3ecc31['as'],'attributes':_0x3ecc31[_0xa4a8('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa4a8('0x12')](function(_0x26e7fe){logger[_0xa4a8('0x27')]('GetSmsQueue',_0xc4a6b8);logger[_0xa4a8('0x28')](_0xa4a8('0x1c'),_0xc4a6b8,JSON[_0xa4a8('0x16')](_0x26e7fe));_0x572587(_0x26e7fe);})[_0xa4a8('0x1b')](function(_0x5ec8be){logger[_0xa4a8('0x17')](_0xa4a8('0x1c'),_0x5ec8be[_0xa4a8('0x19')],_0xc4a6b8);_0x565f1d(_0x10952c[_0xa4a8('0x17')](0x1f4,_0x5ec8be[_0xa4a8('0x19')]));});});};exports[_0xa4a8('0x29')]=function(_0x37ef07){var _0x2612c5=this;return new Promise(function(_0x50ffcb,_0x4faebf){return db[_0xa4a8('0x1d')]['find']({'raw':_0x37ef07['options']?_0x37ef07['options'][_0xa4a8('0x20')]===undefined?!![]:![]:!![],'where':_0x37ef07['options']?_0x37ef07['options'][_0xa4a8('0x21')]||null:null,'attributes':_0x37ef07['options']?_0x37ef07[_0xa4a8('0x1f')]['attributes']||null:null,'include':_0x37ef07[_0xa4a8('0x1f')]?_0x37ef07[_0xa4a8('0x1f')][_0xa4a8('0x24')]?_['map'](_0x37ef07[_0xa4a8('0x1f')][_0xa4a8('0x24')],function(_0x1387aa){return{'model':db[_0x1387aa[_0xa4a8('0x25')]],'as':_0x1387aa['as'],'attributes':_0x1387aa[_0xa4a8('0x22')],'include':_0x1387aa['include']?_['map'](_0x1387aa[_0xa4a8('0x24')],function(_0x1ff8dd){return{'model':db[_0x1ff8dd['model']],'as':_0x1ff8dd['as'],'attributes':_0x1ff8dd['attributes'],'include':_0x1ff8dd[_0xa4a8('0x24')]?_[_0xa4a8('0x26')](_0x1ff8dd[_0xa4a8('0x24')],function(_0x310a7e){return{'model':db[_0x310a7e[_0xa4a8('0x25')]],'as':_0x310a7e['as'],'attributes':_0x310a7e[_0xa4a8('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x151b2c){logger[_0xa4a8('0x27')](_0xa4a8('0x29'),_0x37ef07);logger[_0xa4a8('0x28')](_0xa4a8('0x29'),_0x37ef07,JSON['stringify'](_0x151b2c));_0x50ffcb(_0x151b2c);})['catch'](function(_0x3e8889){logger[_0xa4a8('0x17')](_0xa4a8('0x29'),_0x3e8889[_0xa4a8('0x19')],_0x37ef07);_0x4faebf(_0x2612c5[_0xa4a8('0x17')](0x1f4,_0x3e8889['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 70f41b2..fcfd1e8 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 _0x22f2=['./smsQueue.events','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x3a63ff,_0x1463e0){var _0x3181f5=function(_0x3b6c9c){while(--_0x3b6c9c){_0x3a63ff['push'](_0x3a63ff['shift']());}};_0x3181f5(++_0x1463e0);}(_0x22f2,0xd8));var _0x222f=function(_0x2f7460,_0x4b2665){_0x2f7460=_0x2f7460-0x0;var _0x5cf6d6=_0x22f2[_0x2f7460];return _0x5cf6d6;};'use strict';var SmsQueueEvents=require(_0x222f('0x0'));var events=['save',_0x222f('0x1'),_0x222f('0x2')];function createListener(_0x54c799,_0xaf5236){return function(_0x52bb41){_0xaf5236[_0x222f('0x3')](_0x54c799,_0x52bb41);};}function removeListener(_0x9f320d,_0x3cf51b){return function(){SmsQueueEvents[_0x222f('0x4')](_0x9f320d,_0x3cf51b);};}exports[_0x222f('0x5')]=function(_0x12a50c){for(var _0x46a824=0x0,_0x3d6bd1=events[_0x222f('0x6')];_0x46a824<_0x3d6bd1;_0x46a824++){var _0x5650d7=events[_0x46a824];var _0x1fa890=createListener(_0x222f('0x7')+_0x5650d7,_0x12a50c);SmsQueueEvents['on'](_0x5650d7,_0x1fa890);}}; \ No newline at end of file +var _0xc54c=['register','length','smsQueue:','./smsQueue.events','remove','update','emit'];(function(_0x591988,_0x1b90b2){var _0x4ee5ad=function(_0x5308c2){while(--_0x5308c2){_0x591988['push'](_0x591988['shift']());}};_0x4ee5ad(++_0x1b90b2);}(_0xc54c,0x81));var _0xcc54=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xc54c[_0x17a32f];return _0x15a293;};'use strict';var SmsQueueEvents=require(_0xcc54('0x0'));var events=['save',_0xcc54('0x1'),_0xcc54('0x2')];function createListener(_0xabf936,_0x2b2956){return function(_0x17ae41){_0x2b2956[_0xcc54('0x3')](_0xabf936,_0x17ae41);};}function removeListener(_0x8e1b6f,_0x4da2e0){return function(){SmsQueueEvents['removeListener'](_0x8e1b6f,_0x4da2e0);};}exports[_0xcc54('0x4')]=function(_0x1d5366){for(var _0x266c3d=0x0,_0x2519f3=events[_0xcc54('0x5')];_0x266c3d<_0x2519f3;_0x266c3d++){var _0x43c5d0=events[_0x266c3d];var _0x22035f=createListener(_0xcc54('0x6')+_0x43c5d0,_0x1d5366);SmsQueueEvents['on'](_0x43c5d0,_0x22035f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ae035a1..28d5c78 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 _0x7722=['create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x7722,0x14e));var _0x2772=function(_0x346f62,_0x5079bc){_0x346f62=_0x346f62-0x0;var _0x1783a8=_0x7722[_0x346f62];return _0x1783a8;};'use strict';var multer=require(_0x2772('0x0'));var util=require(_0x2772('0x1'));var path=require(_0x2772('0x2'));var timeout=require(_0x2772('0x3'));var express=require(_0x2772('0x4'));var router=express[_0x2772('0x5')]();var fs_extra=require(_0x2772('0x6'));var auth=require(_0x2772('0x7'));var interaction=require(_0x2772('0x8'));var config=require('../../config/environment');var controller=require(_0x2772('0x9'));router['get']('/',auth[_0x2772('0xa')](),controller[_0x2772('0xb')]);router[_0x2772('0xc')](_0x2772('0xd'),auth[_0x2772('0xa')](),controller[_0x2772('0xe')]);router[_0x2772('0xc')](_0x2772('0xf'),auth[_0x2772('0xa')](),controller[_0x2772('0x10')]);router[_0x2772('0x11')]('/',auth[_0x2772('0xa')](),controller[_0x2772('0x12')]);router[_0x2772('0x13')](_0x2772('0xf'),auth[_0x2772('0xa')](),controller['update']);router[_0x2772('0x14')](_0x2772('0xf'),auth[_0x2772('0xa')](),controller['destroy']);module[_0x2772('0x15')]=router; \ No newline at end of file +var _0xb6a6=['/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x52a891,_0x1b86e7){var _0x4f9415=function(_0x1b21c0){while(--_0x1b21c0){_0x52a891['push'](_0x52a891['shift']());}};_0x4f9415(++_0x1b86e7);}(_0xb6a6,0x1ed));var _0x6b6a=function(_0x49270c,_0x5efc87){_0x49270c=_0x49270c-0x0;var _0x369a7a=_0xb6a6[_0x49270c];return _0x369a7a;};'use strict';var multer=require('multer');var util=require(_0x6b6a('0x0'));var path=require(_0x6b6a('0x1'));var timeout=require(_0x6b6a('0x2'));var express=require(_0x6b6a('0x3'));var router=express['Router']();var fs_extra=require(_0x6b6a('0x4'));var auth=require(_0x6b6a('0x5'));var interaction=require(_0x6b6a('0x6'));var config=require(_0x6b6a('0x7'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0x6b6a('0x8')](),controller[_0x6b6a('0x9')]);router[_0x6b6a('0xa')](_0x6b6a('0xb'),auth[_0x6b6a('0x8')](),controller[_0x6b6a('0xc')]);router['get']('/:id',auth[_0x6b6a('0x8')](),controller[_0x6b6a('0xd')]);router[_0x6b6a('0xe')]('/',auth['isAuthenticated'](),controller[_0x6b6a('0xf')]);router['put'](_0x6b6a('0x10'),auth[_0x6b6a('0x8')](),controller[_0x6b6a('0x11')]);router[_0x6b6a('0x12')](_0x6b6a('0x10'),auth[_0x6b6a('0x8')](),controller[_0x6b6a('0x13')]);module[_0x6b6a('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index d7a38b1..bff5a44 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 _0xb7a7=['STRING','DATE','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xb7a7,0x98));var _0x7b7a=function(_0x490d16,_0x453426){_0x490d16=_0x490d16-0x0;var _0x5a3fbb=_0xb7a7[_0x490d16];return _0x5a3fbb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7b7a('0x0')]={'uniqueid':{'type':Sequelize[_0x7b7a('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7b7a('0x1')]},'joinAt':{'type':Sequelize[_0x7b7a('0x2')]},'leaveAt':{'type':Sequelize[_0x7b7a('0x2')]},'acceptAt':{'type':Sequelize[_0x7b7a('0x2')]},'exitAt':{'type':Sequelize[_0x7b7a('0x2')]},'reason':{'type':Sequelize[_0x7b7a('0x1')]}}; \ No newline at end of file +var _0x3e86=['sequelize','exports','STRING','DATE','moment'];(function(_0x4279e1,_0x39cda4){var _0x1e33ea=function(_0x5b00ea){while(--_0x5b00ea){_0x4279e1['push'](_0x4279e1['shift']());}};_0x1e33ea(++_0x39cda4);}(_0x3e86,0x1c6));var _0x63e8=function(_0x594fb0,_0x4accb9){_0x594fb0=_0x594fb0-0x0;var _0x3cd003=_0x3e86[_0x594fb0];return _0x3cd003;};'use strict';var moment=require(_0x63e8('0x0'));var Sequelize=require(_0x63e8('0x1'));module[_0x63e8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x63e8('0x3')]},'joinAt':{'type':Sequelize[_0x63e8('0x4')]},'leaveAt':{'type':Sequelize[_0x63e8('0x4')]},'acceptAt':{'type':Sequelize[_0x63e8('0x4')]},'exitAt':{'type':Sequelize[_0x63e8('0x4')]},'reason':{'type':Sequelize[_0x63e8('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index fbfb355..871ebd9 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 _0x0ec2=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','save','destroy','error','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x1b7e48,_0x1b9d3b){var _0x10b0b5=function(_0x3de716){while(--_0x3de716){_0x1b7e48['push'](_0x1b7e48['shift']());}};_0x10b0b5(++_0x1b9d3b);}(_0x0ec2,0x1c5));var _0x20ec=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x0ec2[_0x595bd1];return _0xd0344f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20ec('0x0'));var zipdir=require(_0x20ec('0x1'));var jsonpatch=require(_0x20ec('0x2'));var rp=require(_0x20ec('0x3'));var moment=require('moment');var BPromise=require(_0x20ec('0x4'));var Mustache=require('mustache');var util=require(_0x20ec('0x5'));var path=require(_0x20ec('0x6'));var sox=require(_0x20ec('0x7'));var csv=require('to-csv');var ejs=require(_0x20ec('0x8'));var fs=require('fs');var fs_extra=require(_0x20ec('0x9'));var _=require(_0x20ec('0xa'));var squel=require(_0x20ec('0xb'));var crypto=require('crypto');var jsforce=require(_0x20ec('0xc'));var deskjs=require(_0x20ec('0xd'));var toCsv=require(_0x20ec('0xe'));var querystring=require('querystring');var Papa=require(_0x20ec('0xf'));var Redis=require('ioredis');var authService=require(_0x20ec('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x20ec('0x11'));var hardwareService=require(_0x20ec('0x12'));var logger=require('../../config/logger')(_0x20ec('0x13'));var utils=require('../../config/utils');var config=require(_0x20ec('0x14'));var licenseUtil=require(_0x20ec('0x15'));var db=require(_0x20ec('0x16'))['db'];function respondWithStatusCode(_0x42f907,_0x569049){_0x569049=_0x569049||0xcc;return function(_0x3d1f33){if(_0x3d1f33){return _0x42f907[_0x20ec('0x17')](_0x569049);}return _0x42f907['status'](_0x569049)[_0x20ec('0x18')]();};}function respondWithResult(_0x1cebfb,_0x30a940){_0x30a940=_0x30a940||0xc8;return function(_0x4b0525){if(_0x4b0525){return _0x1cebfb[_0x20ec('0x19')](_0x30a940)[_0x20ec('0x1a')](_0x4b0525);}};}function respondWithFilteredResult(_0x2ebe4e,_0x2faa3c){return function(_0x3522ca){if(_0x3522ca){var _0x2f31ba=typeof _0x2faa3c[_0x20ec('0x1b')]==='undefined'&&typeof _0x2faa3c[_0x20ec('0x1c')]==='undefined';var _0x3138e7=_0x3522ca[_0x20ec('0x1d')];var _0x553dde=_0x2f31ba?0x0:_0x2faa3c['offset'];var _0x4078a5=_0x2f31ba?_0x3522ca[_0x20ec('0x1d')]:_0x2faa3c[_0x20ec('0x1b')]+_0x2faa3c[_0x20ec('0x1c')];var _0x1e36b8;if(_0x4078a5>=_0x3138e7){_0x4078a5=_0x3138e7;_0x1e36b8=0xc8;}else{_0x1e36b8=0xce;}_0x2ebe4e['status'](_0x1e36b8);return _0x2ebe4e[_0x20ec('0x1e')](_0x20ec('0x1f'),_0x553dde+'-'+_0x4078a5+'/'+_0x3138e7)[_0x20ec('0x1a')](_0x3522ca);}return null;};}function patchUpdates(_0x2f3ed3){return function(_0x212972){try{jsonpatch['apply'](_0x212972,_0x2f3ed3,!![]);}catch(_0x3e150a){return BPromise['reject'](_0x3e150a);}return _0x212972[_0x20ec('0x20')]();};}function saveUpdates(_0x310975,_0x538d3e){return function(_0x343a7a){if(_0x343a7a){return _0x343a7a['update'](_0x310975)['then'](function(_0x176367){return _0x176367;});}return null;};}function removeEntity(_0xb3f911,_0x598e7f){return function(_0x2a27b7){if(_0x2a27b7){return _0x2a27b7[_0x20ec('0x21')]()['then'](function(){_0xb3f911[_0x20ec('0x19')](0xcc)[_0x20ec('0x18')]();});}};}function handleEntityNotFound(_0x2ab0d8,_0x359dc8){return function(_0x2ec968){if(!_0x2ec968){_0x2ab0d8['sendStatus'](0x194);}return _0x2ec968;};}function handleError(_0x2c1297,_0x34b377){_0x34b377=_0x34b377||0x1f4;return function(_0xbaa03){logger[_0x20ec('0x22')](_0xbaa03['stack']);if(_0xbaa03['name']){delete _0xbaa03[_0x20ec('0x23')];}_0x2c1297['status'](_0x34b377)['send'](_0xbaa03);};}exports[_0x20ec('0x24')]=function(_0x2a3159,_0xf4b85f){var _0x245b66={},_0x5ef5e2={},_0x3354d3={'count':0x0,'rows':[]};var _0x7f4f49=_[_0x20ec('0x25')](db[_0x20ec('0x26')][_0x20ec('0x27')],function(_0x169843){return{'name':_0x169843[_0x20ec('0x28')],'type':_0x169843[_0x20ec('0x29')][_0x20ec('0x2a')]};});_0x5ef5e2[_0x20ec('0x2b')]=_[_0x20ec('0x25')](_0x7f4f49,_0x20ec('0x23'));_0x5ef5e2[_0x20ec('0x2c')]=_[_0x20ec('0x2d')](_0x2a3159[_0x20ec('0x2c')]);_0x5ef5e2[_0x20ec('0x2e')]=_[_0x20ec('0x2f')](_0x5ef5e2[_0x20ec('0x2b')],_0x5ef5e2[_0x20ec('0x2c')]);_0x245b66['attributes']=_[_0x20ec('0x2f')](_0x5ef5e2[_0x20ec('0x2b')],qs[_0x20ec('0x30')](_0x2a3159[_0x20ec('0x2c')]['fields']));_0x245b66[_0x20ec('0x31')]=_0x245b66[_0x20ec('0x31')][_0x20ec('0x32')]?_0x245b66[_0x20ec('0x31')]:_0x5ef5e2[_0x20ec('0x2b')];if(!_0x2a3159[_0x20ec('0x2c')][_0x20ec('0x33')](_0x20ec('0x34'))){_0x245b66[_0x20ec('0x1c')]=qs[_0x20ec('0x1c')](_0x2a3159[_0x20ec('0x2c')][_0x20ec('0x1c')]);_0x245b66['offset']=qs['offset'](_0x2a3159[_0x20ec('0x2c')][_0x20ec('0x1b')]);}_0x245b66['order']=qs['sort'](_0x2a3159[_0x20ec('0x2c')][_0x20ec('0x35')]);_0x245b66[_0x20ec('0x36')]=qs[_0x20ec('0x2e')](_[_0x20ec('0x37')](_0x2a3159['query'],_0x5ef5e2['filters']),_0x7f4f49);if(_0x2a3159[_0x20ec('0x2c')][_0x20ec('0x38')]){_0x245b66[_0x20ec('0x36')]=_[_0x20ec('0x39')](_0x245b66['where'],{'$or':_[_0x20ec('0x25')](_0x7f4f49,function(_0x24fe59){if(_0x24fe59[_0x20ec('0x29')]!=='VIRTUAL'){var _0x5b1302={};_0x5b1302[_0x24fe59[_0x20ec('0x23')]]={'$like':'%'+_0x2a3159[_0x20ec('0x2c')][_0x20ec('0x38')]+'%'};return _0x5b1302;}})});}_0x245b66=_['merge']({},_0x245b66,_0x2a3159[_0x20ec('0x3a')]);var _0x126111={'where':_0x245b66['where']};return db[_0x20ec('0x26')][_0x20ec('0x1d')](_0x126111)[_0x20ec('0x3b')](function(_0x200ad8){_0x3354d3[_0x20ec('0x1d')]=_0x200ad8;if(_0x2a3159['query'][_0x20ec('0x3c')]){_0x245b66[_0x20ec('0x3d')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x20ec('0x3e')](_0x245b66);})[_0x20ec('0x3b')](function(_0x16ad01){_0x3354d3[_0x20ec('0x3f')]=_0x16ad01;return _0x3354d3;})[_0x20ec('0x3b')](respondWithFilteredResult(_0xf4b85f,_0x245b66))[_0x20ec('0x40')](handleError(_0xf4b85f,null));};exports[_0x20ec('0x41')]=function(_0x4f8772,_0x413fa3){var _0x3d55fe={'raw':!![],'where':{'id':_0x4f8772[_0x20ec('0x42')]['id']}},_0x311b71={};_0x311b71[_0x20ec('0x2b')]=_['keys'](db['SmsQueueReport'][_0x20ec('0x27')]);_0x311b71['query']=_['keys'](_0x4f8772['query']);_0x311b71['filters']=_[_0x20ec('0x2f')](_0x311b71[_0x20ec('0x2b')],_0x311b71[_0x20ec('0x2c')]);_0x3d55fe[_0x20ec('0x31')]=_[_0x20ec('0x2f')](_0x311b71['model'],qs['fields'](_0x4f8772[_0x20ec('0x2c')][_0x20ec('0x30')]));_0x3d55fe[_0x20ec('0x31')]=_0x3d55fe['attributes']['length']?_0x3d55fe[_0x20ec('0x31')]:_0x311b71['model'];if(_0x4f8772[_0x20ec('0x2c')]['includeAll']){_0x3d55fe[_0x20ec('0x3d')]=[{'all':!![]}];}_0x3d55fe=_['merge']({},_0x3d55fe,_0x4f8772[_0x20ec('0x3a')]);return db[_0x20ec('0x26')]['find'](_0x3d55fe)['then'](handleEntityNotFound(_0x413fa3,null))[_0x20ec('0x3b')](respondWithResult(_0x413fa3,null))[_0x20ec('0x40')](handleError(_0x413fa3,null));};exports[_0x20ec('0x43')]=function(_0x1df0d2,_0x5ed122){return db[_0x20ec('0x26')][_0x20ec('0x43')](_0x1df0d2[_0x20ec('0x44')],{})[_0x20ec('0x3b')](respondWithResult(_0x5ed122,0xc9))['catch'](handleError(_0x5ed122,null));};exports[_0x20ec('0x45')]=function(_0x50dd48,_0x3ced84){if(_0x50dd48['body']['id']){delete _0x50dd48[_0x20ec('0x44')]['id'];}return db[_0x20ec('0x26')]['find']({'where':{'id':_0x50dd48['params']['id']}})[_0x20ec('0x3b')](handleEntityNotFound(_0x3ced84,null))[_0x20ec('0x3b')](saveUpdates(_0x50dd48[_0x20ec('0x44')],null))[_0x20ec('0x3b')](respondWithResult(_0x3ced84,null))[_0x20ec('0x40')](handleError(_0x3ced84,null));};exports[_0x20ec('0x21')]=function(_0x252ef7,_0x8e1a9e){return db[_0x20ec('0x26')][_0x20ec('0x46')]({'where':{'id':_0x252ef7[_0x20ec('0x42')]['id']}})[_0x20ec('0x3b')](handleEntityNotFound(_0x8e1a9e,null))[_0x20ec('0x3b')](removeEntity(_0x8e1a9e,null))[_0x20ec('0x40')](handleError(_0x8e1a9e,null));};exports[_0x20ec('0x47')]=function(_0x25a377,_0x2ae93c){return db[_0x20ec('0x26')][_0x20ec('0x47')]()[_0x20ec('0x3b')](respondWithResult(_0x2ae93c,null))['catch'](handleError(_0x2ae93c,null));}; \ No newline at end of file +var _0x7d39=['catch','show','keys','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','type','key','query','intersection','model','attributes','fields','length','order','sort','filters','filter','where','merge','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','rows'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x7d39,0x1b7));var _0x97d3=function(_0x4925ce,_0x539796){_0x4925ce=_0x4925ce-0x0;var _0x21c37d=_0x7d39[_0x4925ce];return _0x21c37d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97d3('0x0'));var zipdir=require(_0x97d3('0x1'));var jsonpatch=require(_0x97d3('0x2'));var rp=require(_0x97d3('0x3'));var moment=require(_0x97d3('0x4'));var BPromise=require(_0x97d3('0x5'));var Mustache=require(_0x97d3('0x6'));var util=require(_0x97d3('0x7'));var path=require(_0x97d3('0x8'));var sox=require('sox');var csv=require(_0x97d3('0x9'));var ejs=require(_0x97d3('0xa'));var fs=require('fs');var fs_extra=require(_0x97d3('0xb'));var _=require(_0x97d3('0xc'));var squel=require(_0x97d3('0xd'));var crypto=require(_0x97d3('0xe'));var jsforce=require(_0x97d3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x97d3('0x9'));var querystring=require('querystring');var Papa=require(_0x97d3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x97d3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97d3('0x12'));var utils=require(_0x97d3('0x13'));var config=require(_0x97d3('0x14'));var licenseUtil=require(_0x97d3('0x15'));var db=require(_0x97d3('0x16'))['db'];function respondWithStatusCode(_0x1b1402,_0x297c54){_0x297c54=_0x297c54||0xcc;return function(_0x503453){if(_0x503453){return _0x1b1402[_0x97d3('0x17')](_0x297c54);}return _0x1b1402[_0x97d3('0x18')](_0x297c54)[_0x97d3('0x19')]();};}function respondWithResult(_0x24b388,_0x6ad03d){_0x6ad03d=_0x6ad03d||0xc8;return function(_0x58273d){if(_0x58273d){return _0x24b388['status'](_0x6ad03d)[_0x97d3('0x1a')](_0x58273d);}};}function respondWithFilteredResult(_0x498c50,_0x560fc5){return function(_0x542a64){if(_0x542a64){var _0x2448b0=typeof _0x560fc5[_0x97d3('0x1b')]==='undefined'&&typeof _0x560fc5['limit']===_0x97d3('0x1c');var _0x3456e2=_0x542a64[_0x97d3('0x1d')];var _0x4db494=_0x2448b0?0x0:_0x560fc5[_0x97d3('0x1b')];var _0x17379f=_0x2448b0?_0x542a64[_0x97d3('0x1d')]:_0x560fc5['offset']+_0x560fc5[_0x97d3('0x1e')];var _0xe1fd4a;if(_0x17379f>=_0x3456e2){_0x17379f=_0x3456e2;_0xe1fd4a=0xc8;}else{_0xe1fd4a=0xce;}_0x498c50[_0x97d3('0x18')](_0xe1fd4a);return _0x498c50[_0x97d3('0x1f')](_0x97d3('0x20'),_0x4db494+'-'+_0x17379f+'/'+_0x3456e2)[_0x97d3('0x1a')](_0x542a64);}return null;};}function patchUpdates(_0x2f39cb){return function(_0x5795ab){try{jsonpatch[_0x97d3('0x21')](_0x5795ab,_0x2f39cb,!![]);}catch(_0x50ae4c){return BPromise[_0x97d3('0x22')](_0x50ae4c);}return _0x5795ab[_0x97d3('0x23')]();};}function saveUpdates(_0x5db7cd,_0x4a1dc7){return function(_0x4cb245){if(_0x4cb245){return _0x4cb245[_0x97d3('0x24')](_0x5db7cd)[_0x97d3('0x25')](function(_0x551f11){return _0x551f11;});}return null;};}function removeEntity(_0x51c9cd,_0x45ba5e){return function(_0x46a156){if(_0x46a156){return _0x46a156[_0x97d3('0x26')]()['then'](function(){_0x51c9cd[_0x97d3('0x18')](0xcc)[_0x97d3('0x19')]();});}};}function handleEntityNotFound(_0x5d1471,_0x6c5f6a){return function(_0x181122){if(!_0x181122){_0x5d1471[_0x97d3('0x17')](0x194);}return _0x181122;};}function handleError(_0x19d58c,_0x24cc82){_0x24cc82=_0x24cc82||0x1f4;return function(_0x3bae90){logger['error'](_0x3bae90['stack']);if(_0x3bae90[_0x97d3('0x27')]){delete _0x3bae90[_0x97d3('0x27')];}_0x19d58c[_0x97d3('0x18')](_0x24cc82)[_0x97d3('0x28')](_0x3bae90);};}exports[_0x97d3('0x29')]=function(_0x32d18a,_0x5876b8){var _0x1ab9ac={},_0x3e4db4={},_0x3d87cf={'count':0x0,'rows':[]};var _0x1e384a=_[_0x97d3('0x2a')](db['SmsQueueReport'][_0x97d3('0x2b')],function(_0x4143d7){return{'name':_0x4143d7['fieldName'],'type':_0x4143d7[_0x97d3('0x2c')][_0x97d3('0x2d')]};});_0x3e4db4['model']=_[_0x97d3('0x2a')](_0x1e384a,_0x97d3('0x27'));_0x3e4db4[_0x97d3('0x2e')]=_['keys'](_0x32d18a['query']);_0x3e4db4['filters']=_[_0x97d3('0x2f')](_0x3e4db4[_0x97d3('0x30')],_0x3e4db4[_0x97d3('0x2e')]);_0x1ab9ac[_0x97d3('0x31')]=_[_0x97d3('0x2f')](_0x3e4db4[_0x97d3('0x30')],qs['fields'](_0x32d18a['query'][_0x97d3('0x32')]));_0x1ab9ac[_0x97d3('0x31')]=_0x1ab9ac[_0x97d3('0x31')][_0x97d3('0x33')]?_0x1ab9ac[_0x97d3('0x31')]:_0x3e4db4[_0x97d3('0x30')];if(!_0x32d18a[_0x97d3('0x2e')]['hasOwnProperty']('nolimit')){_0x1ab9ac[_0x97d3('0x1e')]=qs[_0x97d3('0x1e')](_0x32d18a[_0x97d3('0x2e')]['limit']);_0x1ab9ac[_0x97d3('0x1b')]=qs[_0x97d3('0x1b')](_0x32d18a['query']['offset']);}_0x1ab9ac[_0x97d3('0x34')]=qs[_0x97d3('0x35')](_0x32d18a[_0x97d3('0x2e')][_0x97d3('0x35')]);_0x1ab9ac['where']=qs[_0x97d3('0x36')](_['pick'](_0x32d18a[_0x97d3('0x2e')],_0x3e4db4['filters']),_0x1e384a);if(_0x32d18a[_0x97d3('0x2e')][_0x97d3('0x37')]){_0x1ab9ac[_0x97d3('0x38')]=_[_0x97d3('0x39')](_0x1ab9ac['where'],{'$or':_['map'](_0x1e384a,function(_0x36dcba){if(_0x36dcba['type']!==_0x97d3('0x3a')){var _0x47f653={};_0x47f653[_0x36dcba[_0x97d3('0x27')]]={'$like':'%'+_0x32d18a[_0x97d3('0x2e')][_0x97d3('0x37')]+'%'};return _0x47f653;}})});}_0x1ab9ac=_[_0x97d3('0x39')]({},_0x1ab9ac,_0x32d18a[_0x97d3('0x3b')]);var _0x1565ba={'where':_0x1ab9ac['where']};return db[_0x97d3('0x3c')][_0x97d3('0x1d')](_0x1565ba)[_0x97d3('0x25')](function(_0x2f3907){_0x3d87cf['count']=_0x2f3907;if(_0x32d18a[_0x97d3('0x2e')][_0x97d3('0x3d')]){_0x1ab9ac[_0x97d3('0x3e')]=[{'all':!![]}];}return db[_0x97d3('0x3c')][_0x97d3('0x3f')](_0x1ab9ac);})[_0x97d3('0x25')](function(_0x1b44b0){_0x3d87cf[_0x97d3('0x40')]=_0x1b44b0;return _0x3d87cf;})['then'](respondWithFilteredResult(_0x5876b8,_0x1ab9ac))[_0x97d3('0x41')](handleError(_0x5876b8,null));};exports[_0x97d3('0x42')]=function(_0x286965,_0x1755a7){var _0x2ae9f6={'raw':!![],'where':{'id':_0x286965['params']['id']}},_0x2ced3a={};_0x2ced3a[_0x97d3('0x30')]=_[_0x97d3('0x43')](db[_0x97d3('0x3c')][_0x97d3('0x2b')]);_0x2ced3a[_0x97d3('0x2e')]=_[_0x97d3('0x43')](_0x286965[_0x97d3('0x2e')]);_0x2ced3a[_0x97d3('0x36')]=_['intersection'](_0x2ced3a[_0x97d3('0x30')],_0x2ced3a[_0x97d3('0x2e')]);_0x2ae9f6[_0x97d3('0x31')]=_[_0x97d3('0x2f')](_0x2ced3a[_0x97d3('0x30')],qs[_0x97d3('0x32')](_0x286965['query'][_0x97d3('0x32')]));_0x2ae9f6[_0x97d3('0x31')]=_0x2ae9f6['attributes'][_0x97d3('0x33')]?_0x2ae9f6['attributes']:_0x2ced3a[_0x97d3('0x30')];if(_0x286965['query']['includeAll']){_0x2ae9f6[_0x97d3('0x3e')]=[{'all':!![]}];}_0x2ae9f6=_['merge']({},_0x2ae9f6,_0x286965[_0x97d3('0x3b')]);return db[_0x97d3('0x3c')]['find'](_0x2ae9f6)[_0x97d3('0x25')](handleEntityNotFound(_0x1755a7,null))[_0x97d3('0x25')](respondWithResult(_0x1755a7,null))[_0x97d3('0x41')](handleError(_0x1755a7,null));};exports[_0x97d3('0x44')]=function(_0x3d4c41,_0x50eedc){return db[_0x97d3('0x3c')][_0x97d3('0x44')](_0x3d4c41['body'],{})[_0x97d3('0x25')](respondWithResult(_0x50eedc,0xc9))[_0x97d3('0x41')](handleError(_0x50eedc,null));};exports[_0x97d3('0x24')]=function(_0x3c6090,_0x10996e){if(_0x3c6090[_0x97d3('0x45')]['id']){delete _0x3c6090[_0x97d3('0x45')]['id'];}return db[_0x97d3('0x3c')]['find']({'where':{'id':_0x3c6090[_0x97d3('0x46')]['id']}})[_0x97d3('0x25')](handleEntityNotFound(_0x10996e,null))[_0x97d3('0x25')](saveUpdates(_0x3c6090[_0x97d3('0x45')],null))[_0x97d3('0x25')](respondWithResult(_0x10996e,null))['catch'](handleError(_0x10996e,null));};exports[_0x97d3('0x26')]=function(_0x339948,_0x2e8f20){return db[_0x97d3('0x3c')]['find']({'where':{'id':_0x339948[_0x97d3('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e8f20,null))[_0x97d3('0x25')](removeEntity(_0x2e8f20,null))[_0x97d3('0x41')](handleError(_0x2e8f20,null));};exports[_0x97d3('0x47')]=function(_0x1a7173,_0x4683e2){return db[_0x97d3('0x3c')]['describe']()[_0x97d3('0x25')](respondWithResult(_0x4683e2,null))[_0x97d3('0x41')](handleError(_0x4683e2,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3a7cad9..33b9b73 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x183fe4,_0x5dd922){var _0x47ad57=function(_0x22e837){while(--_0x22e837){_0x183fe4['push'](_0x183fe4['shift']());}};_0x47ad57(++_0x5dd922);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0xcb91[_0xa1e3ca];return _0x5005ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3d6e29,_0xba80b4){var _0x3ea1a8=function(_0x1bde7e){while(--_0x1bde7e){_0x3d6e29['push'](_0x3d6e29['shift']());}};_0x3ea1a8(++_0xba80b4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0xcb91[_0x622035];return _0x326cf2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1b9b709..469046c 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 _0x98a5=['then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','limit','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0xbccf,_0x5f3f74){var _0x24c504=function(_0x1442a0){while(--_0x1442a0){_0xbccf['push'](_0xbccf['shift']());}};_0x24c504(++_0x5f3f74);}(_0x98a5,0xcf));var _0x598a=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x98a5[_0x30182f];return _0x5207db;};'use strict';var _=require(_0x598a('0x0'));var util=require(_0x598a('0x1'));var moment=require('moment');var BPromise=require(_0x598a('0x2'));var rs=require(_0x598a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x598a('0x4'));var logger=require(_0x598a('0x5'))(_0x598a('0x6'));var config=require(_0x598a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x598a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1830cc,_0x1d52d8,_0x1ab9eb){return new BPromise(function(_0x25ea5e,_0x7d4201){return client[_0x598a('0x9')](_0x1830cc,_0x1ab9eb)[_0x598a('0xa')](function(_0x57c4ff){logger[_0x598a('0xb')](_0x598a('0xc'),_0x1d52d8,'request\x20sent');logger[_0x598a('0xd')](_0x598a('0xe'),_0x1d52d8,_0x598a('0xf'),JSON[_0x598a('0x10')](_0x57c4ff));if(_0x57c4ff[_0x598a('0x11')]){if(_0x57c4ff[_0x598a('0x11')]['code']===0x1f4){logger['error'](_0x598a('0xc'),_0x1d52d8,_0x57c4ff[_0x598a('0x11')][_0x598a('0x12')]);return _0x7d4201(_0x57c4ff[_0x598a('0x11')][_0x598a('0x12')]);}logger[_0x598a('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1d52d8,_0x57c4ff['error'][_0x598a('0x12')]);return _0x25ea5e(_0x57c4ff[_0x598a('0x11')]['message']);}else{logger['info'](_0x598a('0xc'),_0x1d52d8,_0x598a('0xf'));_0x25ea5e(_0x57c4ff[_0x598a('0x13')][_0x598a('0x12')]);}})['catch'](function(_0x5e7b47){logger[_0x598a('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1d52d8,_0x5e7b47);_0x7d4201(_0x5e7b47);});});}exports[_0x598a('0x14')]=function(_0x48c1d6){var _0x378796=this;return new Promise(function(_0x350c60,_0x6e9b82){return db[_0x598a('0x15')][_0x598a('0x16')](_0x48c1d6[_0x598a('0x17')],{'raw':_0x48c1d6[_0x598a('0x18')]?_0x48c1d6['options'][_0x598a('0x19')]===undefined?!![]:![]:!![]})[_0x598a('0xa')](function(_0xbb2596){logger['info'](_0x598a('0x14'),_0x48c1d6);logger['debug']('CreateSmsQueueReport',_0x48c1d6,JSON[_0x598a('0x10')](_0xbb2596));_0x350c60(_0xbb2596);})['catch'](function(_0x34a79f){logger[_0x598a('0x11')](_0x598a('0x14'),_0x34a79f[_0x598a('0x12')],_0x48c1d6);_0x6e9b82(_0x378796['error'](0x1f4,_0x34a79f[_0x598a('0x12')]));});});};exports[_0x598a('0x1a')]=function(_0x4be70c){var _0x106a54=this;return new Promise(function(_0x528ff1,_0x48ede7){return db[_0x598a('0x15')][_0x598a('0x1b')](_0x4be70c[_0x598a('0x17')],{'raw':_0x4be70c[_0x598a('0x18')]?_0x4be70c[_0x598a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4be70c[_0x598a('0x18')]?_0x4be70c['options'][_0x598a('0x1c')]||null:null,'attributes':_0x4be70c[_0x598a('0x18')]?_0x4be70c[_0x598a('0x18')]['attributes']||null:null,'limit':_0x4be70c[_0x598a('0x18')]?_0x4be70c['options'][_0x598a('0x1d')]||null:null})[_0x598a('0xa')](function(_0x5a036a){logger['info'](_0x598a('0x1a'),_0x4be70c);logger['debug'](_0x598a('0x1a'),_0x4be70c,JSON['stringify'](_0x5a036a));_0x528ff1(_0x5a036a);})[_0x598a('0x1e')](function(_0x2a07f8){logger[_0x598a('0x11')](_0x598a('0x1a'),_0x2a07f8[_0x598a('0x12')],_0x4be70c);_0x48ede7(_0x106a54['error'](0x1f4,_0x2a07f8[_0x598a('0x12')]));});});}; \ No newline at end of file +var _0x2fc2=['debug','catch','UpdateSmsQueueReport','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','then'];(function(_0x2939dc,_0x301dd9){var _0xac1e39=function(_0xa69432){while(--_0xa69432){_0x2939dc['push'](_0x2939dc['shift']());}};_0xac1e39(++_0x301dd9);}(_0x2fc2,0x17b));var _0x22fc=function(_0x47abd3,_0x162334){_0x47abd3=_0x47abd3-0x0;var _0x318331=_0x2fc2[_0x47abd3];return _0x318331;};'use strict';var _=require(_0x22fc('0x0'));var util=require(_0x22fc('0x1'));var moment=require(_0x22fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x22fc('0x3'));var fs=require('fs');var Redis=require(_0x22fc('0x4'));var db=require(_0x22fc('0x5'))['db'];var utils=require(_0x22fc('0x6'));var logger=require(_0x22fc('0x7'))(_0x22fc('0x8'));var config=require(_0x22fc('0x9'));var jayson=require(_0x22fc('0xa'));var client=jayson[_0x22fc('0xb')][_0x22fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc8e5bb,_0x142d25,_0x579b00){return new BPromise(function(_0x1fa228,_0x4d1591){return client[_0x22fc('0xd')](_0xc8e5bb,_0x579b00)['then'](function(_0x1d3cae){logger['info'](_0x22fc('0xe'),_0x142d25,_0x22fc('0xf'));logger['debug'](_0x22fc('0x10'),_0x142d25,_0x22fc('0xf'),JSON[_0x22fc('0x11')](_0x1d3cae));if(_0x1d3cae[_0x22fc('0x12')]){if(_0x1d3cae[_0x22fc('0x12')]['code']===0x1f4){logger[_0x22fc('0x12')](_0x22fc('0xe'),_0x142d25,_0x1d3cae[_0x22fc('0x12')][_0x22fc('0x13')]);return _0x4d1591(_0x1d3cae[_0x22fc('0x12')][_0x22fc('0x13')]);}logger['error'](_0x22fc('0xe'),_0x142d25,_0x1d3cae[_0x22fc('0x12')][_0x22fc('0x13')]);return _0x1fa228(_0x1d3cae[_0x22fc('0x12')][_0x22fc('0x13')]);}else{logger[_0x22fc('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x142d25,_0x22fc('0xf'));_0x1fa228(_0x1d3cae[_0x22fc('0x15')][_0x22fc('0x13')]);}})['catch'](function(_0x9e5f85){logger['error'](_0x22fc('0xe'),_0x142d25,_0x9e5f85);_0x4d1591(_0x9e5f85);});});}exports[_0x22fc('0x16')]=function(_0x5f6dba){var _0x53dac5=this;return new Promise(function(_0x46c561,_0x1231b6){return db[_0x22fc('0x17')][_0x22fc('0x18')](_0x5f6dba[_0x22fc('0x19')],{'raw':_0x5f6dba[_0x22fc('0x1a')]?_0x5f6dba['options'][_0x22fc('0x1b')]===undefined?!![]:![]:!![]})[_0x22fc('0x1c')](function(_0x382b18){logger['info']('CreateSmsQueueReport',_0x5f6dba);logger[_0x22fc('0x1d')](_0x22fc('0x16'),_0x5f6dba,JSON[_0x22fc('0x11')](_0x382b18));_0x46c561(_0x382b18);})[_0x22fc('0x1e')](function(_0x19a46f){logger[_0x22fc('0x12')](_0x22fc('0x16'),_0x19a46f['message'],_0x5f6dba);_0x1231b6(_0x53dac5[_0x22fc('0x12')](0x1f4,_0x19a46f[_0x22fc('0x13')]));});});};exports[_0x22fc('0x1f')]=function(_0x179f9c){var _0x193f70=this;return new Promise(function(_0x57d384,_0x1a1324){return db[_0x22fc('0x17')]['update'](_0x179f9c[_0x22fc('0x19')],{'raw':_0x179f9c['options']?_0x179f9c[_0x22fc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x179f9c[_0x22fc('0x1a')]?_0x179f9c[_0x22fc('0x1a')][_0x22fc('0x20')]||null:null,'attributes':_0x179f9c[_0x22fc('0x1a')]?_0x179f9c[_0x22fc('0x1a')][_0x22fc('0x21')]||null:null,'limit':_0x179f9c[_0x22fc('0x1a')]?_0x179f9c[_0x22fc('0x1a')]['limit']||null:null})[_0x22fc('0x1c')](function(_0x549c88){logger[_0x22fc('0x14')](_0x22fc('0x1f'),_0x179f9c);logger[_0x22fc('0x1d')]('UpdateSmsQueueReport',_0x179f9c,JSON[_0x22fc('0x11')](_0x549c88));_0x57d384(_0x549c88);})['catch'](function(_0x3fd74f){logger[_0x22fc('0x12')]('UpdateSmsQueueReport',_0x3fd74f[_0x22fc('0x13')],_0x179f9c);_0x1a1324(_0x193f70[_0x22fc('0x12')](0x1f4,_0x3fd74f[_0x22fc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index efad6f6..43ca303 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 _0xb717=['put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','show','create'];(function(_0x516d88,_0x27df32){var _0x27050a=function(_0x27bbd5){while(--_0x27bbd5){_0x516d88['push'](_0x516d88['shift']());}};_0x27050a(++_0x27df32);}(_0xb717,0x1b4));var _0x7b71=function(_0x5d0be8,_0x3fd219){_0x5d0be8=_0x5d0be8-0x0;var _0x389704=_0xb717[_0x5d0be8];return _0x389704;};'use strict';var multer=require(_0x7b71('0x0'));var util=require('util');var path=require(_0x7b71('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b71('0x2'));var router=express[_0x7b71('0x3')]();var fs_extra=require(_0x7b71('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var controller=require(_0x7b71('0x7'));router[_0x7b71('0x8')]('/',auth[_0x7b71('0x9')](),controller['index']);router[_0x7b71('0x8')](_0x7b71('0xa'),auth[_0x7b71('0x9')](),controller[_0x7b71('0xb')]);router[_0x7b71('0x8')]('/:id',auth[_0x7b71('0x9')](),controller[_0x7b71('0xc')]);router['post']('/',auth[_0x7b71('0x9')](),controller[_0x7b71('0xd')]);router[_0x7b71('0xe')]('/:id',auth[_0x7b71('0x9')](),controller['update']);router[_0x7b71('0xf')]('/:id',auth[_0x7b71('0x9')](),controller[_0x7b71('0x10')]);module[_0x7b71('0x11')]=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','multer','util','path'];(function(_0x25e9f3,_0x4528d0){var _0x46534=function(_0x574c23){while(--_0x574c23){_0x25e9f3['push'](_0x25e9f3['shift']());}};_0x46534(++_0x4528d0);}(_0xb138,0x1dd));var _0x8b13=function(_0x27fd77,_0x4ed23f){_0x27fd77=_0x27fd77-0x0;var _0x48a372=_0xb138[_0x27fd77];return _0x48a372;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xb')]);router['get'](_0x8b13('0xc'),auth[_0x8b13('0xa')](),controller[_0x8b13('0xd')]);router['get'](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['show']);router['post']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xf')]);router[_0x8b13('0x10')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['update']);router[_0x8b13('0x11')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller[_0x8b13('0x12')]);module[_0x8b13('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b1c0e19..6126002 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x22df4d,_0xa4790a){var _0x6a2020=function(_0x215c88){while(--_0x215c88){_0x22df4d['push'](_0x22df4d['shift']());}};_0x6a2020(++_0xa4790a);}(_0x34e8,0x12c));var _0x834e=function(_0x4842f3,_0x433662){_0x4842f3=_0x4842f3-0x0;var _0xefec13=_0x34e8[_0x4842f3];return _0xefec13;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2b7bab,_0x17ca89){var _0x363e1e=function(_0x427d16){while(--_0x427d16){_0x2b7bab['push'](_0x2b7bab['shift']());}};_0x363e1e(++_0x17ca89);}(_0x70e0,0x17b));var _0x070e=function(_0x4f4d82,_0x40d861){_0x4f4d82=_0x4f4d82-0x0;var _0x43fd8c=_0x70e0[_0x4f4d82];return _0x43fd8c;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index c30d4ef..1164d32 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 _0x94ad=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','Content-Range','apply','reject','save','then','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x30ff2e,_0x780796){var _0x299aca=function(_0x4bc1fd){while(--_0x4bc1fd){_0x30ff2e['push'](_0x30ff2e['shift']());}};_0x299aca(++_0x780796);}(_0x94ad,0x7f));var _0xd94a=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x94ad[_0x1a9204];return _0x17ca68;};'use strict';var emlformat=require(_0xd94a('0x0'));var rimraf=require(_0xd94a('0x1'));var zipdir=require(_0xd94a('0x2'));var jsonpatch=require(_0xd94a('0x3'));var rp=require(_0xd94a('0x4'));var moment=require('moment');var BPromise=require(_0xd94a('0x5'));var Mustache=require(_0xd94a('0x6'));var util=require(_0xd94a('0x7'));var path=require(_0xd94a('0x8'));var sox=require(_0xd94a('0x9'));var csv=require(_0xd94a('0xa'));var ejs=require(_0xd94a('0xb'));var fs=require('fs');var fs_extra=require(_0xd94a('0xc'));var _=require('lodash');var squel=require(_0xd94a('0xd'));var crypto=require(_0xd94a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd94a('0xf'));var Redis=require(_0xd94a('0x10'));var authService=require(_0xd94a('0x11'));var qs=require(_0xd94a('0x12'));var as=require(_0xd94a('0x13'));var hardwareService=require(_0xd94a('0x14'));var logger=require(_0xd94a('0x15'))('api');var utils=require(_0xd94a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd94a('0x17'));var db=require(_0xd94a('0x18'))['db'];function respondWithStatusCode(_0xea1fdf,_0xc9aaa7){_0xc9aaa7=_0xc9aaa7||0xcc;return function(_0x1f03dd){if(_0x1f03dd){return _0xea1fdf[_0xd94a('0x19')](_0xc9aaa7);}return _0xea1fdf['status'](_0xc9aaa7)[_0xd94a('0x1a')]();};}function respondWithResult(_0x3ed985,_0x40dafd){_0x40dafd=_0x40dafd||0xc8;return function(_0x2f2436){if(_0x2f2436){return _0x3ed985[_0xd94a('0x1b')](_0x40dafd)['json'](_0x2f2436);}};}function respondWithFilteredResult(_0x1b3f78,_0x1070a7){return function(_0x4d6fca){if(_0x4d6fca){var _0x3f8b69=typeof _0x1070a7[_0xd94a('0x1c')]==='undefined'&&typeof _0x1070a7[_0xd94a('0x1d')]==='undefined';var _0x4d5e67=_0x4d6fca[_0xd94a('0x1e')];var _0x9f5886=_0x3f8b69?0x0:_0x1070a7['offset'];var _0x1a4c12=_0x3f8b69?_0x4d6fca[_0xd94a('0x1e')]:_0x1070a7[_0xd94a('0x1c')]+_0x1070a7[_0xd94a('0x1d')];var _0x23042c;if(_0x1a4c12>=_0x4d5e67){_0x1a4c12=_0x4d5e67;_0x23042c=0xc8;}else{_0x23042c=0xce;}_0x1b3f78[_0xd94a('0x1b')](_0x23042c);return _0x1b3f78['set'](_0xd94a('0x1f'),_0x9f5886+'-'+_0x1a4c12+'/'+_0x4d5e67)['json'](_0x4d6fca);}return null;};}function patchUpdates(_0x337682){return function(_0x4c47a4){try{jsonpatch[_0xd94a('0x20')](_0x4c47a4,_0x337682,!![]);}catch(_0x9f1e59){return BPromise[_0xd94a('0x21')](_0x9f1e59);}return _0x4c47a4[_0xd94a('0x22')]();};}function saveUpdates(_0x32da05,_0x3b5084){return function(_0x530e05){if(_0x530e05){return _0x530e05['update'](_0x32da05)['then'](function(_0x546362){return _0x546362;});}return null;};}function removeEntity(_0x58bcf5,_0x58ff26){return function(_0x316c0a){if(_0x316c0a){return _0x316c0a['destroy']()[_0xd94a('0x23')](function(){_0x58bcf5['status'](0xcc)[_0xd94a('0x1a')]();});}};}function handleEntityNotFound(_0x378cd4,_0x47686d){return function(_0x1abfeb){if(!_0x1abfeb){_0x378cd4[_0xd94a('0x19')](0x194);}return _0x1abfeb;};}function handleError(_0x42052c,_0x336bf4){_0x336bf4=_0x336bf4||0x1f4;return function(_0x670be7){logger['error'](_0x670be7[_0xd94a('0x24')]);if(_0x670be7[_0xd94a('0x25')]){delete _0x670be7[_0xd94a('0x25')];}_0x42052c[_0xd94a('0x1b')](_0x336bf4)['send'](_0x670be7);};}exports[_0xd94a('0x26')]=function(_0x1f7504,_0x50cbea){var _0x2619d9={},_0x57872f={},_0x2d56e7={'count':0x0,'rows':[]};var _0x1be302=_[_0xd94a('0x27')](db[_0xd94a('0x28')][_0xd94a('0x29')],function(_0x95cc1d){return{'name':_0x95cc1d[_0xd94a('0x2a')],'type':_0x95cc1d[_0xd94a('0x2b')]['key']};});_0x57872f['model']=_[_0xd94a('0x27')](_0x1be302,_0xd94a('0x25'));_0x57872f[_0xd94a('0x2c')]=_[_0xd94a('0x2d')](_0x1f7504[_0xd94a('0x2c')]);_0x57872f['filters']=_[_0xd94a('0x2e')](_0x57872f[_0xd94a('0x2f')],_0x57872f[_0xd94a('0x2c')]);_0x2619d9['attributes']=_[_0xd94a('0x2e')](_0x57872f[_0xd94a('0x2f')],qs[_0xd94a('0x30')](_0x1f7504[_0xd94a('0x2c')]['fields']));_0x2619d9['attributes']=_0x2619d9[_0xd94a('0x31')][_0xd94a('0x32')]?_0x2619d9[_0xd94a('0x31')]:_0x57872f[_0xd94a('0x2f')];if(!_0x1f7504[_0xd94a('0x2c')][_0xd94a('0x33')](_0xd94a('0x34'))){_0x2619d9[_0xd94a('0x1d')]=qs['limit'](_0x1f7504[_0xd94a('0x2c')]['limit']);_0x2619d9[_0xd94a('0x1c')]=qs[_0xd94a('0x1c')](_0x1f7504[_0xd94a('0x2c')][_0xd94a('0x1c')]);}_0x2619d9[_0xd94a('0x35')]=qs[_0xd94a('0x36')](_0x1f7504[_0xd94a('0x2c')]['sort']);_0x2619d9[_0xd94a('0x37')]=qs[_0xd94a('0x38')](_[_0xd94a('0x39')](_0x1f7504[_0xd94a('0x2c')],_0x57872f[_0xd94a('0x38')]),_0x1be302);if(_0x1f7504[_0xd94a('0x2c')][_0xd94a('0x3a')]){_0x2619d9[_0xd94a('0x37')]=_[_0xd94a('0x3b')](_0x2619d9[_0xd94a('0x37')],{'$or':_['map'](_0x1be302,function(_0x11f466){if(_0x11f466['type']!=='VIRTUAL'){var _0x6a33df={};_0x6a33df[_0x11f466[_0xd94a('0x25')]]={'$like':'%'+_0x1f7504['query'][_0xd94a('0x3a')]+'%'};return _0x6a33df;}})});}_0x2619d9=_[_0xd94a('0x3b')]({},_0x2619d9,_0x1f7504[_0xd94a('0x3c')]);var _0xd7737={'where':_0x2619d9[_0xd94a('0x37')]};return db[_0xd94a('0x28')]['count'](_0xd7737)[_0xd94a('0x23')](function(_0xcff7a2){_0x2d56e7[_0xd94a('0x1e')]=_0xcff7a2;if(_0x1f7504[_0xd94a('0x2c')][_0xd94a('0x3d')]){_0x2619d9[_0xd94a('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xd94a('0x3f')](_0x2619d9);})[_0xd94a('0x23')](function(_0x38d024){_0x2d56e7[_0xd94a('0x40')]=_0x38d024;return _0x2d56e7;})['then'](respondWithFilteredResult(_0x50cbea,_0x2619d9))[_0xd94a('0x41')](handleError(_0x50cbea,null));};exports[_0xd94a('0x42')]=function(_0x40aa9c,_0x423bca){var _0x4eed74={'raw':!![],'where':{'id':_0x40aa9c[_0xd94a('0x43')]['id']}},_0x2f79f0={};_0x2f79f0['model']=_[_0xd94a('0x2d')](db[_0xd94a('0x28')]['rawAttributes']);_0x2f79f0[_0xd94a('0x2c')]=_[_0xd94a('0x2d')](_0x40aa9c['query']);_0x2f79f0[_0xd94a('0x38')]=_['intersection'](_0x2f79f0[_0xd94a('0x2f')],_0x2f79f0[_0xd94a('0x2c')]);_0x4eed74[_0xd94a('0x31')]=_[_0xd94a('0x2e')](_0x2f79f0[_0xd94a('0x2f')],qs[_0xd94a('0x30')](_0x40aa9c[_0xd94a('0x2c')][_0xd94a('0x30')]));_0x4eed74[_0xd94a('0x31')]=_0x4eed74[_0xd94a('0x31')][_0xd94a('0x32')]?_0x4eed74[_0xd94a('0x31')]:_0x2f79f0['model'];if(_0x40aa9c[_0xd94a('0x2c')]['includeAll']){_0x4eed74[_0xd94a('0x3e')]=[{'all':!![]}];}_0x4eed74=_['merge']({},_0x4eed74,_0x40aa9c[_0xd94a('0x3c')]);return db[_0xd94a('0x28')][_0xd94a('0x44')](_0x4eed74)[_0xd94a('0x23')](handleEntityNotFound(_0x423bca,null))[_0xd94a('0x23')](respondWithResult(_0x423bca,null))[_0xd94a('0x41')](handleError(_0x423bca,null));};exports['create']=function(_0x3f12e9,_0x2460bf){return db[_0xd94a('0x28')][_0xd94a('0x45')](_0x3f12e9[_0xd94a('0x46')],{})[_0xd94a('0x23')](respondWithResult(_0x2460bf,0xc9))[_0xd94a('0x41')](handleError(_0x2460bf,null));};exports[_0xd94a('0x47')]=function(_0x256c02,_0x57fbd5){if(_0x256c02[_0xd94a('0x46')]['id']){delete _0x256c02[_0xd94a('0x46')]['id'];}return db[_0xd94a('0x28')][_0xd94a('0x44')]({'where':{'id':_0x256c02[_0xd94a('0x43')]['id']}})[_0xd94a('0x23')](handleEntityNotFound(_0x57fbd5,null))[_0xd94a('0x23')](saveUpdates(_0x256c02[_0xd94a('0x46')],null))[_0xd94a('0x23')](respondWithResult(_0x57fbd5,null))[_0xd94a('0x41')](handleError(_0x57fbd5,null));};exports['destroy']=function(_0x5819dd,_0x668735){return db[_0xd94a('0x28')][_0xd94a('0x44')]({'where':{'id':_0x5819dd[_0xd94a('0x43')]['id']}})[_0xd94a('0x23')](handleEntityNotFound(_0x668735,null))['then'](removeEntity(_0x668735,null))['catch'](handleError(_0x668735,null));};exports[_0xd94a('0x48')]=function(_0x31a307,_0x1c6b02){return db[_0xd94a('0x28')][_0xd94a('0x48')]()[_0xd94a('0x23')](respondWithResult(_0x1c6b02,null))[_0xd94a('0x41')](handleError(_0x1c6b02,null));}; \ No newline at end of file +var _0x5135=['include','rows','catch','show','fields','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','offset','limit','undefined','count','status','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll'];(function(_0x4486cc,_0x26f7de){var _0x4d930b=function(_0x593214){while(--_0x593214){_0x4486cc['push'](_0x4486cc['shift']());}};_0x4d930b(++_0x26f7de);}(_0x5135,0xeb));var _0x5513=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x5135[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x5513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5513('0x1'));var jsonpatch=require(_0x5513('0x2'));var rp=require(_0x5513('0x3'));var moment=require('moment');var BPromise=require(_0x5513('0x4'));var Mustache=require(_0x5513('0x5'));var util=require(_0x5513('0x6'));var path=require(_0x5513('0x7'));var sox=require(_0x5513('0x8'));var csv=require(_0x5513('0x9'));var ejs=require(_0x5513('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5513('0xb'));var crypto=require(_0x5513('0xc'));var jsforce=require(_0x5513('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5513('0xe'));var Papa=require('papaparse');var Redis=require(_0x5513('0xf'));var authService=require(_0x5513('0x10'));var qs=require(_0x5513('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5513('0x12'));var logger=require(_0x5513('0x13'))(_0x5513('0x14'));var utils=require(_0x5513('0x15'));var config=require(_0x5513('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5513('0x17'))['db'];function respondWithStatusCode(_0x523ddc,_0xb18660){_0xb18660=_0xb18660||0xcc;return function(_0x4de785){if(_0x4de785){return _0x523ddc['sendStatus'](_0xb18660);}return _0x523ddc['status'](_0xb18660)['end']();};}function respondWithResult(_0x316e05,_0x2b01f6){_0x2b01f6=_0x2b01f6||0xc8;return function(_0x54d45d){if(_0x54d45d){return _0x316e05['status'](_0x2b01f6)[_0x5513('0x18')](_0x54d45d);}};}function respondWithFilteredResult(_0x5080e3,_0x2e0235){return function(_0x268795){if(_0x268795){var _0x11e21a=typeof _0x2e0235[_0x5513('0x19')]==='undefined'&&typeof _0x2e0235[_0x5513('0x1a')]===_0x5513('0x1b');var _0x12ff3d=_0x268795['count'];var _0x26ce5a=_0x11e21a?0x0:_0x2e0235['offset'];var _0x5d333c=_0x11e21a?_0x268795[_0x5513('0x1c')]:_0x2e0235['offset']+_0x2e0235[_0x5513('0x1a')];var _0x5102ae;if(_0x5d333c>=_0x12ff3d){_0x5d333c=_0x12ff3d;_0x5102ae=0xc8;}else{_0x5102ae=0xce;}_0x5080e3[_0x5513('0x1d')](_0x5102ae);return _0x5080e3['set'](_0x5513('0x1e'),_0x26ce5a+'-'+_0x5d333c+'/'+_0x12ff3d)[_0x5513('0x18')](_0x268795);}return null;};}function patchUpdates(_0x2788a4){return function(_0x356bf7){try{jsonpatch[_0x5513('0x1f')](_0x356bf7,_0x2788a4,!![]);}catch(_0x5586b4){return BPromise[_0x5513('0x20')](_0x5586b4);}return _0x356bf7['save']();};}function saveUpdates(_0x11fc20,_0x44aa8f){return function(_0x33c3f6){if(_0x33c3f6){return _0x33c3f6[_0x5513('0x21')](_0x11fc20)[_0x5513('0x22')](function(_0x2358f7){return _0x2358f7;});}return null;};}function removeEntity(_0x2839d2,_0x36b138){return function(_0x5dbe82){if(_0x5dbe82){return _0x5dbe82[_0x5513('0x23')]()[_0x5513('0x22')](function(){_0x2839d2[_0x5513('0x1d')](0xcc)[_0x5513('0x24')]();});}};}function handleEntityNotFound(_0x32fa37,_0x14f1da){return function(_0x10ab82){if(!_0x10ab82){_0x32fa37[_0x5513('0x25')](0x194);}return _0x10ab82;};}function handleError(_0x28b309,_0x22f7e8){_0x22f7e8=_0x22f7e8||0x1f4;return function(_0x4fdc2c){logger[_0x5513('0x26')](_0x4fdc2c[_0x5513('0x27')]);if(_0x4fdc2c[_0x5513('0x28')]){delete _0x4fdc2c[_0x5513('0x28')];}_0x28b309['status'](_0x22f7e8)[_0x5513('0x29')](_0x4fdc2c);};}exports[_0x5513('0x2a')]=function(_0x437617,_0x415b05){var _0x58b697={},_0x250c42={},_0x2d0dee={'count':0x0,'rows':[]};var _0x56daa5=_[_0x5513('0x2b')](db[_0x5513('0x2c')][_0x5513('0x2d')],function(_0x387ad0){return{'name':_0x387ad0[_0x5513('0x2e')],'type':_0x387ad0[_0x5513('0x2f')][_0x5513('0x30')]};});_0x250c42[_0x5513('0x31')]=_[_0x5513('0x2b')](_0x56daa5,_0x5513('0x28'));_0x250c42[_0x5513('0x32')]=_[_0x5513('0x33')](_0x437617[_0x5513('0x32')]);_0x250c42[_0x5513('0x34')]=_['intersection'](_0x250c42[_0x5513('0x31')],_0x250c42[_0x5513('0x32')]);_0x58b697['attributes']=_[_0x5513('0x35')](_0x250c42[_0x5513('0x31')],qs['fields'](_0x437617[_0x5513('0x32')]['fields']));_0x58b697[_0x5513('0x36')]=_0x58b697[_0x5513('0x36')][_0x5513('0x37')]?_0x58b697[_0x5513('0x36')]:_0x250c42[_0x5513('0x31')];if(!_0x437617[_0x5513('0x32')][_0x5513('0x38')](_0x5513('0x39'))){_0x58b697[_0x5513('0x1a')]=qs[_0x5513('0x1a')](_0x437617['query'][_0x5513('0x1a')]);_0x58b697['offset']=qs[_0x5513('0x19')](_0x437617[_0x5513('0x32')][_0x5513('0x19')]);}_0x58b697[_0x5513('0x3a')]=qs[_0x5513('0x3b')](_0x437617[_0x5513('0x32')]['sort']);_0x58b697[_0x5513('0x3c')]=qs[_0x5513('0x34')](_['pick'](_0x437617[_0x5513('0x32')],_0x250c42['filters']),_0x56daa5);if(_0x437617[_0x5513('0x32')][_0x5513('0x3d')]){_0x58b697[_0x5513('0x3c')]=_['merge'](_0x58b697['where'],{'$or':_[_0x5513('0x2b')](_0x56daa5,function(_0x689f9e){if(_0x689f9e[_0x5513('0x2f')]!=='VIRTUAL'){var _0x3f2652={};_0x3f2652[_0x689f9e[_0x5513('0x28')]]={'$like':'%'+_0x437617['query']['filter']+'%'};return _0x3f2652;}})});}_0x58b697=_[_0x5513('0x3e')]({},_0x58b697,_0x437617[_0x5513('0x3f')]);var _0x5dcf07={'where':_0x58b697[_0x5513('0x3c')]};return db[_0x5513('0x2c')][_0x5513('0x1c')](_0x5dcf07)[_0x5513('0x22')](function(_0x1478a1){_0x2d0dee['count']=_0x1478a1;if(_0x437617[_0x5513('0x32')][_0x5513('0x40')]){_0x58b697[_0x5513('0x41')]=[{'all':!![]}];}return db[_0x5513('0x2c')]['findAll'](_0x58b697);})['then'](function(_0x4f6c92){_0x2d0dee[_0x5513('0x42')]=_0x4f6c92;return _0x2d0dee;})[_0x5513('0x22')](respondWithFilteredResult(_0x415b05,_0x58b697))[_0x5513('0x43')](handleError(_0x415b05,null));};exports[_0x5513('0x44')]=function(_0x3d2c28,_0x5ec24f){var _0x38a063={'raw':!![],'where':{'id':_0x3d2c28['params']['id']}},_0x56bdc0={};_0x56bdc0[_0x5513('0x31')]=_['keys'](db[_0x5513('0x2c')][_0x5513('0x2d')]);_0x56bdc0[_0x5513('0x32')]=_[_0x5513('0x33')](_0x3d2c28['query']);_0x56bdc0[_0x5513('0x34')]=_['intersection'](_0x56bdc0[_0x5513('0x31')],_0x56bdc0[_0x5513('0x32')]);_0x38a063[_0x5513('0x36')]=_[_0x5513('0x35')](_0x56bdc0[_0x5513('0x31')],qs[_0x5513('0x45')](_0x3d2c28[_0x5513('0x32')][_0x5513('0x45')]));_0x38a063['attributes']=_0x38a063[_0x5513('0x36')][_0x5513('0x37')]?_0x38a063['attributes']:_0x56bdc0[_0x5513('0x31')];if(_0x3d2c28[_0x5513('0x32')][_0x5513('0x40')]){_0x38a063[_0x5513('0x41')]=[{'all':!![]}];}_0x38a063=_[_0x5513('0x3e')]({},_0x38a063,_0x3d2c28[_0x5513('0x3f')]);return db[_0x5513('0x2c')][_0x5513('0x46')](_0x38a063)[_0x5513('0x22')](handleEntityNotFound(_0x5ec24f,null))['then'](respondWithResult(_0x5ec24f,null))[_0x5513('0x43')](handleError(_0x5ec24f,null));};exports[_0x5513('0x47')]=function(_0x557a94,_0xef7f31){return db[_0x5513('0x2c')][_0x5513('0x47')](_0x557a94[_0x5513('0x48')],{})[_0x5513('0x22')](respondWithResult(_0xef7f31,0xc9))[_0x5513('0x43')](handleError(_0xef7f31,null));};exports[_0x5513('0x21')]=function(_0x47def7,_0x5df2dc){if(_0x47def7[_0x5513('0x48')]['id']){delete _0x47def7[_0x5513('0x48')]['id'];}return db['SmsTransferReport'][_0x5513('0x46')]({'where':{'id':_0x47def7[_0x5513('0x49')]['id']}})[_0x5513('0x22')](handleEntityNotFound(_0x5df2dc,null))[_0x5513('0x22')](saveUpdates(_0x47def7[_0x5513('0x48')],null))['then'](respondWithResult(_0x5df2dc,null))[_0x5513('0x43')](handleError(_0x5df2dc,null));};exports[_0x5513('0x23')]=function(_0x48b239,_0xd58433){return db[_0x5513('0x2c')][_0x5513('0x46')]({'where':{'id':_0x48b239[_0x5513('0x49')]['id']}})[_0x5513('0x22')](handleEntityNotFound(_0xd58433,null))[_0x5513('0x22')](removeEntity(_0xd58433,null))[_0x5513('0x43')](handleError(_0xd58433,null));};exports['describe']=function(_0xd2c789,_0x43aa8d){return db[_0x5513('0x2c')][_0x5513('0x4a')]()['then'](respondWithResult(_0x43aa8d,null))[_0x5513('0x43')](handleError(_0x43aa8d,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 9e38ecd..205e1d9 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 _0x1618=['request-promise','path','rimraf','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x1618,0x7f));var _0x8161=function(_0x1a3feb,_0x26f810){_0x1a3feb=_0x1a3feb-0x0;var _0x4f6ce0=_0x1618[_0x1a3feb];return _0x4f6ce0;};'use strict';var _=require(_0x8161('0x0'));var util=require(_0x8161('0x1'));var logger=require(_0x8161('0x2'))(_0x8161('0x3'));var moment=require('moment');var BPromise=require(_0x8161('0x4'));var rp=require(_0x8161('0x5'));var fs=require('fs');var path=require(_0x8161('0x6'));var rimraf=require(_0x8161('0x7'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x43075f,_0x5735c8){return _0x43075f[_0x8161('0x8')](_0x8161('0x9'),attributes,{'tableName':_0x8161('0xa'),'paranoid':![],'indexes':[{'name':_0x8161('0xb'),'fields':[_0x8161('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb420=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x24cda0,_0x27b7a2){var _0x12e03c=function(_0x241733){while(--_0x241733){_0x24cda0['push'](_0x24cda0['shift']());}};_0x12e03c(++_0x27b7a2);}(_0xb420,0x6a));var _0x0b42=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb420[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0b42('0x0'));var util=require('util');var logger=require(_0x0b42('0x1'))(_0x0b42('0x2'));var moment=require(_0x0b42('0x3'));var BPromise=require(_0x0b42('0x4'));var rp=require(_0x0b42('0x5'));var fs=require('fs');var path=require(_0x0b42('0x6'));var rimraf=require(_0x0b42('0x7'));var config=require(_0x0b42('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x239207,_0x38b797){return _0x239207[_0x0b42('0x9')](_0x0b42('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x0b42('0xb'),'fields':[_0x0b42('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 cc47c07..9b524cd 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 _0xc23a=['jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../config/logger','../../config/environment'];(function(_0xa164dd,_0x3f3f6b){var _0x2389c0=function(_0xe7c11b){while(--_0xe7c11b){_0xa164dd['push'](_0xa164dd['shift']());}};_0x2389c0(++_0x3f3f6b);}(_0xc23a,0xd2));var _0xac23=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xc23a[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require('lodash');var util=require(_0xac23('0x0'));var moment=require(_0xac23('0x1'));var BPromise=require(_0xac23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac23('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac23('0x4'))('rpc');var config=require(_0xac23('0x5'));var jayson=require(_0xac23('0x6'));var client=jayson[_0xac23('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47b021,_0x44b7d2,_0x3b6647){return new BPromise(function(_0x20342c,_0x5b2705){return client[_0xac23('0x8')](_0x47b021,_0x3b6647)[_0xac23('0x9')](function(_0x3f5fa6){logger[_0xac23('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x44b7d2,'request\x20sent');logger['debug'](_0xac23('0xb'),_0x44b7d2,_0xac23('0xc'),JSON['stringify'](_0x3f5fa6));if(_0x3f5fa6[_0xac23('0xd')]){if(_0x3f5fa6[_0xac23('0xd')][_0xac23('0xe')]===0x1f4){logger[_0xac23('0xd')](_0xac23('0xf'),_0x44b7d2,_0x3f5fa6[_0xac23('0xd')][_0xac23('0x10')]);return _0x5b2705(_0x3f5fa6[_0xac23('0xd')][_0xac23('0x10')]);}logger[_0xac23('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x44b7d2,_0x3f5fa6[_0xac23('0xd')][_0xac23('0x10')]);return _0x20342c(_0x3f5fa6['error']['message']);}else{logger[_0xac23('0xa')](_0xac23('0xf'),_0x44b7d2,_0xac23('0xc'));_0x20342c(_0x3f5fa6['result'][_0xac23('0x10')]);}})[_0xac23('0x11')](function(_0xaf49de){logger[_0xac23('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x44b7d2,_0xaf49de);_0x5b2705(_0xaf49de);});});} \ No newline at end of file +var _0x6bdc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x56652a,_0x1f1bd8){_0x56652a=_0x56652a-0x0;var _0x1ee8d9=_0x6bdc[_0x56652a];return _0x1ee8d9;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var moment=require(_0xc6bd('0x2'));var BPromise=require(_0xc6bd('0x3'));var rs=require(_0xc6bd('0x4'));var fs=require('fs');var Redis=require(_0xc6bd('0x5'));var db=require(_0xc6bd('0x6'))['db'];var utils=require(_0xc6bd('0x7'));var logger=require(_0xc6bd('0x8'))(_0xc6bd('0x9'));var config=require('../../config/environment');var jayson=require(_0xc6bd('0xa'));var client=jayson[_0xc6bd('0xb')][_0xc6bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f5327,_0x2c1c68,_0x8bd379){return new BPromise(function(_0x5ca385,_0x374067){return client[_0xc6bd('0xd')](_0x3f5327,_0x8bd379)[_0xc6bd('0xe')](function(_0x5e92e8){logger['info'](_0xc6bd('0xf'),_0x2c1c68,'request\x20sent');logger[_0xc6bd('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c1c68,_0xc6bd('0x11'),JSON[_0xc6bd('0x12')](_0x5e92e8));if(_0x5e92e8[_0xc6bd('0x13')]){if(_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x14')]===0x1f4){logger[_0xc6bd('0x13')](_0xc6bd('0xf'),_0x2c1c68,_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x15')]);return _0x374067(_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x15')]);}logger[_0xc6bd('0x13')](_0xc6bd('0xf'),_0x2c1c68,_0x5e92e8[_0xc6bd('0x13')]['message']);return _0x5ca385(_0x5e92e8[_0xc6bd('0x13')]['message']);}else{logger['info'](_0xc6bd('0xf'),_0x2c1c68,_0xc6bd('0x11'));_0x5ca385(_0x5e92e8[_0xc6bd('0x16')][_0xc6bd('0x15')]);}})[_0xc6bd('0x17')](function(_0x5795bc){logger['error'](_0xc6bd('0xf'),_0x2c1c68,_0x5795bc);_0x374067(_0x5795bc);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 361b77e..5de9876 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 _0x9ce4=['create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','now','single','file'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x9ce4,0x139));var _0x49ce=function(_0x51244e,_0x24c7e6){_0x51244e=_0x51244e-0x0;var _0x58d71c=_0x9ce4[_0x51244e];return _0x58d71c;};'use strict';var multer=require(_0x49ce('0x0'));var util=require('util');var path=require(_0x49ce('0x1'));var timeout=require('connect-timeout');var express=require(_0x49ce('0x2'));var router=express[_0x49ce('0x3')]();var fs_extra=require(_0x49ce('0x4'));var auth=require(_0x49ce('0x5'));var interaction=require(_0x49ce('0x6'));var config=require(_0x49ce('0x7'));var controller=require('./sound.controller');router[_0x49ce('0x8')]('/',auth[_0x49ce('0x9')](),controller['index']);router[_0x49ce('0x8')](_0x49ce('0xa'),auth['isAuthenticated'](),controller[_0x49ce('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x49ce('0xc')]);var upload=multer({'storage':multer[_0x49ce('0xd')]({'destination':function(_0x4fddfb,_0x265946,_0x4c7428){_0x4c7428(null,path['join'](config[_0x49ce('0xe')],_0x49ce('0xf')));},'filename':function(_0x307f0d,_0x5d1a13,_0x35a707){_0x5d1a13['originalname']=_0x5d1a13[_0x49ce('0x10')][_0x49ce('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35a707(null,util[_0x49ce('0x12')](_0x49ce('0x13'),path['basename'](_0x5d1a13[_0x49ce('0x10')],path['extname'](_0x5d1a13[_0x49ce('0x10')])),Date[_0x49ce('0x14')](),path['extname'](_0x5d1a13[_0x49ce('0x10')])));}})});router['post']('/',upload[_0x49ce('0x15')](_0x49ce('0x16')),controller[_0x49ce('0x17')]);router[_0x49ce('0x18')](_0x49ce('0xa'),auth[_0x49ce('0x9')](),controller[_0x49ce('0x19')]);router[_0x49ce('0x1a')](_0x49ce('0xa'),auth['isAuthenticated'](),controller[_0x49ce('0x1a')]);module[_0x49ce('0x1b')]=router; \ No newline at end of file +var _0x778e=['extname','post','single','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','format'];(function(_0x10b2d5,_0x5a7743){var _0x14b8d1=function(_0x3b888c){while(--_0x3b888c){_0x10b2d5['push'](_0x10b2d5['shift']());}};_0x14b8d1(++_0x5a7743);}(_0x778e,0x132));var _0xe778=function(_0x325e2b,_0x1d672a){_0x325e2b=_0x325e2b-0x0;var _0x3186a5=_0x778e[_0x325e2b];return _0x3186a5;};'use strict';var multer=require(_0xe778('0x0'));var util=require(_0xe778('0x1'));var path=require(_0xe778('0x2'));var timeout=require(_0xe778('0x3'));var express=require(_0xe778('0x4'));var router=express['Router']();var fs_extra=require(_0xe778('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe778('0x6'));var config=require(_0xe778('0x7'));var controller=require(_0xe778('0x8'));router[_0xe778('0x9')]('/',auth[_0xe778('0xa')](),controller['index']);router[_0xe778('0x9')](_0xe778('0xb'),auth[_0xe778('0xa')](),controller[_0xe778('0xc')]);router[_0xe778('0x9')](_0xe778('0xd'),auth[_0xe778('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xe778('0xe')]({'destination':function(_0x37c6d1,_0x3726da,_0x134f5c){_0x134f5c(null,path[_0xe778('0xf')](config['root'],_0xe778('0x10')));},'filename':function(_0x344732,_0x2f03a5,_0x4ea563){_0x2f03a5[_0xe778('0x11')]=_0x2f03a5[_0xe778('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ea563(null,util[_0xe778('0x12')]('%s-%s%s',path['basename'](_0x2f03a5[_0xe778('0x11')],path[_0xe778('0x13')](_0x2f03a5[_0xe778('0x11')])),Date['now'](),path[_0xe778('0x13')](_0x2f03a5[_0xe778('0x11')])));}})});router[_0xe778('0x14')]('/',upload[_0xe778('0x15')]('file'),controller['create']);router[_0xe778('0x16')](_0xe778('0xb'),auth[_0xe778('0xa')](),controller[_0xe778('0x17')]);router[_0xe778('0x18')](_0xe778('0xb'),auth[_0xe778('0xa')](),controller[_0xe778('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c7fba60..339d5f4 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 _0xa884=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x2287c7,_0x43f8bf){var _0x5be5ea=function(_0x991d28){while(--_0x991d28){_0x2287c7['push'](_0x2287c7['shift']());}};_0x5be5ea(++_0x43f8bf);}(_0xa884,0x180));var _0x4a88=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0xa884[_0x4a7e98];return _0x27d10d;};'use strict';var Sequelize=require(_0x4a88('0x0'));module[_0x4a88('0x1')]={'name':{'type':Sequelize[_0x4a88('0x2')],'unique':_0x4a88('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4a88('0x2')]},'display_name':{'type':Sequelize[_0x4a88('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x4a88('0x4')]},'original_sampleCount':{'type':Sequelize[_0x4a88('0x5')]},'original_channelCount':{'type':Sequelize[_0x4a88('0x6')]},'original_bitRate':{'type':Sequelize[_0x4a88('0x5')]},'original_sampleRate':{'type':Sequelize[_0x4a88('0x6')]},'converted_format':{'type':Sequelize[_0x4a88('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x4a88('0x5')]},'converted_channelCount':{'type':Sequelize[_0x4a88('0x6')]},'converted_bitRate':{'type':Sequelize[_0x4a88('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x4a88('0x6')]}}; \ No newline at end of file +var _0x309e=['FLOAT','sequelize','exports','STRING','name','BIGINT','INTEGER'];(function(_0xc2c358,_0x5ad405){var _0x54cc3b=function(_0x2d8713){while(--_0x2d8713){_0xc2c358['push'](_0xc2c358['shift']());}};_0x54cc3b(++_0x5ad405);}(_0x309e,0x6a));var _0xe309=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x309e[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xe309('0x0'));module[_0xe309('0x1')]={'name':{'type':Sequelize[_0xe309('0x2')],'unique':_0xe309('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xe309('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe309('0x2')]},'original_format':{'type':Sequelize[_0xe309('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xe309('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xe309('0x4')]},'original_sampleRate':{'type':Sequelize[_0xe309('0x5')]},'converted_format':{'type':Sequelize[_0xe309('0x2')]},'converted_duration':{'type':Sequelize[_0xe309('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xe309('0x4')]},'converted_channelCount':{'type':Sequelize[_0xe309('0x5')]},'converted_bitRate':{'type':Sequelize[_0xe309('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xe309('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 5a89717..f7cc90a 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 _0x58f3=['download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','extname','file','originalname','filename','wav','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','map','Sound','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','find'];(function(_0x335c0d,_0xf71ef8){var _0x323287=function(_0x1a909f){while(--_0x1a909f){_0x335c0d['push'](_0x335c0d['shift']());}};_0x323287(++_0xf71ef8);}(_0x58f3,0x1a7));var _0x358f=function(_0x350dbe,_0x2c9a6e){_0x350dbe=_0x350dbe-0x0;var _0x7ce25b=_0x58f3[_0x350dbe];return _0x7ce25b;};'use strict';var emlformat=require(_0x358f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x358f('0x1'));var moment=require(_0x358f('0x2'));var BPromise=require(_0x358f('0x3'));var Mustache=require(_0x358f('0x4'));var util=require('util');var path=require(_0x358f('0x5'));var sox=require(_0x358f('0x6'));var csv=require(_0x358f('0x7'));var ejs=require(_0x358f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x358f('0x9'));var squel=require(_0x358f('0xa'));var crypto=require(_0x358f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x358f('0xc'));var toCsv=require(_0x358f('0x7'));var querystring=require(_0x358f('0xd'));var Papa=require(_0x358f('0xe'));var Redis=require(_0x358f('0xf'));var authService=require(_0x358f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x358f('0x11'))(_0x358f('0x12'));var utils=require('../../config/utils');var config=require(_0x358f('0x13'));var licenseUtil=require(_0x358f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x99d2a7,_0x5c8d12){_0x5c8d12=_0x5c8d12||0xcc;return function(_0x499b7f){if(_0x499b7f){return _0x99d2a7[_0x358f('0x15')](_0x5c8d12);}return _0x99d2a7[_0x358f('0x16')](_0x5c8d12)[_0x358f('0x17')]();};}function respondWithResult(_0x358b49,_0x497141){_0x497141=_0x497141||0xc8;return function(_0x7da8a8){if(_0x7da8a8){return _0x358b49['status'](_0x497141)['json'](_0x7da8a8);}};}function respondWithFilteredResult(_0x122832,_0x31d2f){return function(_0x3137b8){if(_0x3137b8){var _0x5644cb=typeof _0x31d2f['offset']===_0x358f('0x18')&&typeof _0x31d2f['limit']===_0x358f('0x18');var _0x1cffcb=_0x3137b8[_0x358f('0x19')];var _0xd4884c=_0x5644cb?0x0:_0x31d2f[_0x358f('0x1a')];var _0x5f1029=_0x5644cb?_0x3137b8[_0x358f('0x19')]:_0x31d2f[_0x358f('0x1a')]+_0x31d2f[_0x358f('0x1b')];var _0x482583;if(_0x5f1029>=_0x1cffcb){_0x5f1029=_0x1cffcb;_0x482583=0xc8;}else{_0x482583=0xce;}_0x122832[_0x358f('0x16')](_0x482583);return _0x122832[_0x358f('0x1c')](_0x358f('0x1d'),_0xd4884c+'-'+_0x5f1029+'/'+_0x1cffcb)[_0x358f('0x1e')](_0x3137b8);}return null;};}function patchUpdates(_0x5d21f0){return function(_0xc6fc61){try{jsonpatch[_0x358f('0x1f')](_0xc6fc61,_0x5d21f0,!![]);}catch(_0x47a006){return BPromise[_0x358f('0x20')](_0x47a006);}return _0xc6fc61[_0x358f('0x21')]();};}function saveUpdates(_0x89cc86,_0x11ef5e){return function(_0xc4a9c1){if(_0xc4a9c1){return _0xc4a9c1[_0x358f('0x22')](_0x89cc86)['then'](function(_0x56c2bd){return _0x56c2bd;});}return null;};}function removeEntity(_0x302fbd,_0x5c5564){return function(_0x2074c2){if(_0x2074c2){return _0x2074c2[_0x358f('0x23')]()[_0x358f('0x24')](function(){var _0x27cce9=_0x2074c2[_0x358f('0x25')]({'plain':!![]});var _0x4fe114=_0x358f('0x26');return db[_0x358f('0x27')][_0x358f('0x23')]({'where':{'type':_0x4fe114,'resourceId':_0x27cce9['id']}})[_0x358f('0x24')](function(){return _0x2074c2;});})[_0x358f('0x24')](function(){_0x302fbd[_0x358f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274135,_0x2f7ffb){return function(_0x755cb4){if(!_0x755cb4){_0x274135[_0x358f('0x15')](0x194);}return _0x755cb4;};}function handleError(_0x560af4,_0x2cd5db){_0x2cd5db=_0x2cd5db||0x1f4;return function(_0x205b66){logger[_0x358f('0x28')](_0x205b66[_0x358f('0x29')]);if(_0x205b66[_0x358f('0x2a')]){delete _0x205b66[_0x358f('0x2a')];}_0x560af4[_0x358f('0x16')](_0x2cd5db)[_0x358f('0x2b')](_0x205b66);};}exports['index']=function(_0x3620e0,_0x160578){var _0x14bec9={},_0x20b592={},_0x315969={'count':0x0,'rows':[]};var _0x8be70d=_[_0x358f('0x2c')](db[_0x358f('0x2d')][_0x358f('0x2e')],function(_0x1fa30f){return{'name':_0x1fa30f['fieldName'],'type':_0x1fa30f[_0x358f('0x2f')][_0x358f('0x30')]};});_0x20b592[_0x358f('0x31')]=_['map'](_0x8be70d,'name');_0x20b592[_0x358f('0x32')]=_[_0x358f('0x33')](_0x3620e0[_0x358f('0x32')]);_0x20b592[_0x358f('0x34')]=_[_0x358f('0x35')](_0x20b592[_0x358f('0x31')],_0x20b592[_0x358f('0x32')]);_0x14bec9[_0x358f('0x36')]=_[_0x358f('0x35')](_0x20b592[_0x358f('0x31')],qs['fields'](_0x3620e0[_0x358f('0x32')][_0x358f('0x37')]));_0x14bec9[_0x358f('0x36')]=_0x14bec9[_0x358f('0x36')]['length']?_0x14bec9[_0x358f('0x36')]:_0x20b592[_0x358f('0x31')];if(!_0x3620e0['query'][_0x358f('0x38')](_0x358f('0x39'))){_0x14bec9[_0x358f('0x1b')]=qs['limit'](_0x3620e0[_0x358f('0x32')][_0x358f('0x1b')]);_0x14bec9[_0x358f('0x1a')]=qs['offset'](_0x3620e0[_0x358f('0x32')][_0x358f('0x1a')]);}_0x14bec9[_0x358f('0x3a')]=qs[_0x358f('0x3b')](_0x3620e0[_0x358f('0x32')][_0x358f('0x3b')]);_0x14bec9[_0x358f('0x3c')]=qs[_0x358f('0x34')](_[_0x358f('0x3d')](_0x3620e0[_0x358f('0x32')],_0x20b592['filters']),_0x8be70d);if(_0x3620e0[_0x358f('0x32')][_0x358f('0x3e')]){_0x14bec9[_0x358f('0x3c')]=_[_0x358f('0x3f')](_0x14bec9['where'],{'$or':_[_0x358f('0x2c')](_0x8be70d,function(_0x4c956b){if(_0x4c956b[_0x358f('0x2f')]!=='VIRTUAL'){var _0x4a60ec={};_0x4a60ec[_0x4c956b['name']]={'$like':'%'+_0x3620e0[_0x358f('0x32')][_0x358f('0x3e')]+'%'};return _0x4a60ec;}})});}_0x14bec9=_[_0x358f('0x3f')]({},_0x14bec9,_0x3620e0[_0x358f('0x40')]);var _0x8fb7a={'where':_0x14bec9['where']};return db[_0x358f('0x2d')]['count'](_0x8fb7a)['then'](function(_0x2f7d47){_0x315969[_0x358f('0x19')]=_0x2f7d47;if(_0x3620e0['query']['includeAll']){_0x14bec9[_0x358f('0x41')]=[{'all':!![]}];}return db['Sound'][_0x358f('0x42')](_0x14bec9);})[_0x358f('0x24')](function(_0x243961){_0x315969[_0x358f('0x43')]=_0x243961;return _0x315969;})['then'](respondWithFilteredResult(_0x160578,_0x14bec9))[_0x358f('0x44')](handleError(_0x160578,null));};exports[_0x358f('0x45')]=function(_0x432069,_0x169b28){var _0x5ea9ba={'raw':!![],'where':{'id':_0x432069[_0x358f('0x46')]['id']}},_0x823542={};_0x823542['model']=_[_0x358f('0x33')](db['Sound'][_0x358f('0x2e')]);_0x823542[_0x358f('0x32')]=_[_0x358f('0x33')](_0x432069[_0x358f('0x32')]);_0x823542[_0x358f('0x34')]=_[_0x358f('0x35')](_0x823542['model'],_0x823542[_0x358f('0x32')]);_0x5ea9ba[_0x358f('0x36')]=_['intersection'](_0x823542[_0x358f('0x31')],qs[_0x358f('0x37')](_0x432069[_0x358f('0x32')]['fields']));_0x5ea9ba['attributes']=_0x5ea9ba[_0x358f('0x36')][_0x358f('0x47')]?_0x5ea9ba[_0x358f('0x36')]:_0x823542[_0x358f('0x31')];if(_0x432069['query']['includeAll']){_0x5ea9ba[_0x358f('0x41')]=[{'all':!![]}];}_0x5ea9ba=_[_0x358f('0x3f')]({},_0x5ea9ba,_0x432069[_0x358f('0x40')]);return db[_0x358f('0x2d')][_0x358f('0x48')](_0x5ea9ba)[_0x358f('0x24')](handleEntityNotFound(_0x169b28,null))[_0x358f('0x24')](respondWithResult(_0x169b28,null))[_0x358f('0x44')](handleError(_0x169b28,null));};exports[_0x358f('0x49')]=function(_0x2533d6,_0x2a145a,_0x2303f1){return db[_0x358f('0x2d')][_0x358f('0x48')]({'where':{'id':_0x2533d6[_0x358f('0x46')]['id']},'attributes':[_0x358f('0x2a'),_0x358f('0x4a'),_0x358f('0x4b')],'raw':!![]})[_0x358f('0x24')](handleEntityNotFound(_0x2a145a,null))[_0x358f('0x24')](function(_0x3fe786){if(_0x3fe786){if(!fs[_0x358f('0x4c')](path['join'](config[_0x358f('0x4d')],_0x358f('0x4e'),_0x3fe786[_0x358f('0x4a')]+'.'+_0x3fe786[_0x358f('0x4b')]))){throw new db[(_0x358f('0x4f'))][(_0x358f('0x50'))](_0x358f('0x51'));}return _0x2a145a[_0x358f('0x49')](path[_0x358f('0x52')](config[_0x358f('0x4d')],'server/files/sounds/converted',util[_0x358f('0x53')](_0x358f('0x54'),_0x3fe786['save_name'],_0x3fe786[_0x358f('0x4b')])),util[_0x358f('0x53')](_0x358f('0x54'),_0x3fe786['name'],_0x3fe786[_0x358f('0x4b')]));}return null;})['catch'](handleError(_0x2a145a,null));};exports[_0x358f('0x55')]=function(_0x44ecbd,_0x38f094,_0x2d33ea){var _0x1910a8={'name':path['basename'](_0x44ecbd['file']['originalname'],path[_0x358f('0x56')](_0x44ecbd[_0x358f('0x57')][_0x358f('0x58')])),'save_name':path['basename'](_0x44ecbd['file'][_0x358f('0x59')],path[_0x358f('0x56')](_0x44ecbd[_0x358f('0x57')][_0x358f('0x59')])),'original_format':path[_0x358f('0x56')](_0x44ecbd[_0x358f('0x57')][_0x358f('0x58')])['substring'](0x1),'converted_format':_0x358f('0x5a')};var _0x4ced33=path[_0x358f('0x52')](config[_0x358f('0x4d')],'server/files/sounds/original',_0x44ecbd[_0x358f('0x57')]['filename']);var _0x593ece=path[_0x358f('0x52')](config[_0x358f('0x4d')],_0x358f('0x4e'),util[_0x358f('0x53')](_0x358f('0x54'),path[_0x358f('0x5b')](_0x44ecbd['file'][_0x358f('0x59')],path[_0x358f('0x56')](_0x44ecbd[_0x358f('0x57')]['filename'])),_0x1910a8[_0x358f('0x4b')]));logger[_0x358f('0x5c')]('Sound\x20upload\x20filepath:\x20%s',_0x4ced33);logger[_0x358f('0x5c')](_0x358f('0x5d'),_0x593ece);try{fs[_0x358f('0x5e')](_0x4ced33,parseInt(_0x358f('0x5f'),0x8));var _0x6171f1=sox[_0x358f('0x60')](_0x4ced33,_0x593ece,{'sampleRate':0x1f40,'format':_0x358f('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6171f1['on']('error',function(_0x125f3d){fs['unlinkSync'](_0x4ced33);_0x38f094['status'](0x1f4)['send'](_0x125f3d);});_0x6171f1['on'](_0x358f('0x61'),function(_0x439322){_0x1910a8['original_duration']=isNaN(_0x439322[_0x358f('0x62')])?null:_0x439322['duration']*0x3e8;_0x1910a8[_0x358f('0x63')]=isNaN(_0x439322[_0x358f('0x64')])?null:_0x439322[_0x358f('0x64')];_0x1910a8[_0x358f('0x65')]=isNaN(_0x439322[_0x358f('0x66')])?null:_0x439322['channelCount'];_0x1910a8[_0x358f('0x67')]=isNaN(_0x439322['bitRate'])?null:_0x439322[_0x358f('0x68')];_0x1910a8['original_sampleRate']=isNaN(_0x439322[_0x358f('0x69')])?null:_0x439322['sampleRate'];});_0x6171f1['on']('dest',function(_0xc5b5b){_0x1910a8['converted_duration']=isNaN(_0xc5b5b[_0x358f('0x62')])?null:_0xc5b5b[_0x358f('0x62')]*0x3e8;_0x1910a8[_0x358f('0x6a')]=isNaN(_0xc5b5b['sampleCount'])?null:_0xc5b5b[_0x358f('0x64')];_0x1910a8[_0x358f('0x6b')]=isNaN(_0xc5b5b[_0x358f('0x66')])?null:_0xc5b5b[_0x358f('0x66')];_0x1910a8[_0x358f('0x6c')]=isNaN(_0xc5b5b[_0x358f('0x68')])?null:_0xc5b5b[_0x358f('0x68')];_0x1910a8[_0x358f('0x6d')]=isNaN(_0xc5b5b[_0x358f('0x69')])?null:_0xc5b5b[_0x358f('0x69')];});_0x6171f1['on'](_0x358f('0x17'),function(){fs[_0x358f('0x5e')](_0x593ece,parseInt(_0x358f('0x5f'),0x8));return db[_0x358f('0x2d')][_0x358f('0x55')](_0x1910a8)[_0x358f('0x24')](function(_0x3b8cd1){var _0x68acef={'role':_0x44ecbd[_0x358f('0x6e')][_0x358f('0x6f')],'userProfileId':_0x44ecbd['body'][_0x358f('0x70')]};if(!_0x68acef)throw new Error(_0x358f('0x71'));if(_0x68acef[_0x358f('0x6f')]===_0x358f('0x72')){var _0x531c29=_0x3b8cd1[_0x358f('0x25')]({'plain':!![]});return db[_0x358f('0x73')][_0x358f('0x48')]({'where':{'name':_0x358f('0x26'),'userProfileId':_0x68acef[_0x358f('0x70')]},'raw':!![]})[_0x358f('0x24')](function(_0x384af3){if(_0x384af3&&_0x384af3[_0x358f('0x74')]===0x0){return db['UserProfileResource'][_0x358f('0x55')]({'name':_0x531c29[_0x358f('0x2a')],'resourceId':_0x531c29['id'],'type':_0x384af3[_0x358f('0x2a')],'sectionId':_0x384af3['id']},{})['then'](function(){return _0x3b8cd1;});}else{return _0x3b8cd1;}})[_0x358f('0x44')](function(_0x2ce597){logger[_0x358f('0x28')](_0x358f('0x75'),_0x2ce597);throw _0x2ce597;});}return _0x3b8cd1;})[_0x358f('0x24')](respondWithResult(_0x38f094,null))['catch'](handleError(_0x38f094,null));});_0x6171f1[_0x358f('0x76')]();}catch(_0x4be090){_0x38f094['status'](0x1f4)[_0x358f('0x2b')](_0x4be090);}};exports[_0x358f('0x22')]=function(_0x5b0322,_0x4cc873,_0x27d60f){return db['Sound'][_0x358f('0x48')]({'where':{'id':_0x5b0322[_0x358f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cc873,null))[_0x358f('0x24')](saveUpdates(_[_0x358f('0x3d')](_0x5b0322['body'],[_0x358f('0x2a'),_0x358f('0x77')]),null))[_0x358f('0x24')](respondWithResult(_0x4cc873,null))[_0x358f('0x44')](handleError(_0x4cc873,null));};exports[_0x358f('0x78')]=function(_0x466ffb,_0x269168,_0x148953){return db[_0x358f('0x2d')][_0x358f('0x48')]({'where':{'id':_0x466ffb[_0x358f('0x46')]['id']}})[_0x358f('0x24')](function(_0x20d47d){if(_0x20d47d){return _0x20d47d[_0x358f('0x23')]();}})[_0x358f('0x24')](function(_0x4dcb90){var _0x4bd13c=path[_0x358f('0x52')](config[_0x358f('0x4d')],_0x358f('0x79'),util[_0x358f('0x53')](_0x358f('0x54'),_0x4dcb90[_0x358f('0x4a')],_0x4dcb90[_0x358f('0x7a')]));var _0x2ec834=path['join'](config[_0x358f('0x4d')],_0x358f('0x4e'),util[_0x358f('0x53')](_0x358f('0x54'),_0x4dcb90[_0x358f('0x4a')],_0x4dcb90[_0x358f('0x4b')]));fs['unlinkSync'](_0x4bd13c);fs[_0x358f('0x7b')](_0x2ec834);return _0x4dcb90;})[_0x358f('0x24')](function(_0x2e9e76){if(_0x2e9e76){return _0x269168[_0x358f('0x16')](0xcc)['end']();}})[_0x358f('0x24')](handleEntityNotFound(_0x269168,null))[_0x358f('0x44')](handleError(_0x269168,null));}; \ No newline at end of file +var _0xf9cf=['then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','params','catch','find','save_name','converted_format','existsSync','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','join','root','%s.%s','create','basename','extname','file','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','send','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_sampleCount','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','start','description','format','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update'];(function(_0xf38552,_0x1fcf41){var _0x2c7528=function(_0xc81e3a){while(--_0xc81e3a){_0xf38552['push'](_0xf38552['shift']());}};_0x2c7528(++_0x1fcf41);}(_0xf9cf,0x140));var _0xff9c=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0xf9cf[_0x187399];return _0x40fa92;};'use strict';var emlformat=require(_0xff9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff9c('0x1'));var jsonpatch=require(_0xff9c('0x2'));var rp=require(_0xff9c('0x3'));var moment=require(_0xff9c('0x4'));var BPromise=require(_0xff9c('0x5'));var Mustache=require(_0xff9c('0x6'));var util=require(_0xff9c('0x7'));var path=require(_0xff9c('0x8'));var sox=require('sox');var csv=require(_0xff9c('0x9'));var ejs=require(_0xff9c('0xa'));var fs=require('fs');var fs_extra=require(_0xff9c('0xb'));var _=require('lodash');var squel=require(_0xff9c('0xc'));var crypto=require('crypto');var jsforce=require(_0xff9c('0xd'));var deskjs=require(_0xff9c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff9c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xff9c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff9c('0x11'))(_0xff9c('0x12'));var utils=require(_0xff9c('0x13'));var config=require(_0xff9c('0x14'));var licenseUtil=require(_0xff9c('0x15'));var db=require(_0xff9c('0x16'))['db'];function respondWithStatusCode(_0x1f88d6,_0x31e813){_0x31e813=_0x31e813||0xcc;return function(_0x5eb6b9){if(_0x5eb6b9){return _0x1f88d6['sendStatus'](_0x31e813);}return _0x1f88d6[_0xff9c('0x17')](_0x31e813)[_0xff9c('0x18')]();};}function respondWithResult(_0x4de035,_0x2a0618){_0x2a0618=_0x2a0618||0xc8;return function(_0x50afb3){if(_0x50afb3){return _0x4de035['status'](_0x2a0618)[_0xff9c('0x19')](_0x50afb3);}};}function respondWithFilteredResult(_0x31cb40,_0x146fa2){return function(_0x30f3a4){if(_0x30f3a4){var _0x2b0d88=typeof _0x146fa2[_0xff9c('0x1a')]==='undefined'&&typeof _0x146fa2[_0xff9c('0x1b')]===_0xff9c('0x1c');var _0x55205c=_0x30f3a4['count'];var _0x1dab3=_0x2b0d88?0x0:_0x146fa2['offset'];var _0x2dca8e=_0x2b0d88?_0x30f3a4[_0xff9c('0x1d')]:_0x146fa2['offset']+_0x146fa2[_0xff9c('0x1b')];var _0x5b9770;if(_0x2dca8e>=_0x55205c){_0x2dca8e=_0x55205c;_0x5b9770=0xc8;}else{_0x5b9770=0xce;}_0x31cb40[_0xff9c('0x17')](_0x5b9770);return _0x31cb40['set'](_0xff9c('0x1e'),_0x1dab3+'-'+_0x2dca8e+'/'+_0x55205c)[_0xff9c('0x19')](_0x30f3a4);}return null;};}function patchUpdates(_0x275562){return function(_0x1dba01){try{jsonpatch['apply'](_0x1dba01,_0x275562,!![]);}catch(_0x265e8c){return BPromise[_0xff9c('0x1f')](_0x265e8c);}return _0x1dba01[_0xff9c('0x20')]();};}function saveUpdates(_0x53e7b8,_0xd8e677){return function(_0x25cb6f){if(_0x25cb6f){return _0x25cb6f[_0xff9c('0x21')](_0x53e7b8)[_0xff9c('0x22')](function(_0x2aa245){return _0x2aa245;});}return null;};}function removeEntity(_0x3200c6,_0x1a3592){return function(_0x25e01e){if(_0x25e01e){return _0x25e01e[_0xff9c('0x23')]()[_0xff9c('0x22')](function(){var _0x58f94b=_0x25e01e[_0xff9c('0x24')]({'plain':!![]});var _0x208448=_0xff9c('0x25');return db[_0xff9c('0x26')][_0xff9c('0x23')]({'where':{'type':_0x208448,'resourceId':_0x58f94b['id']}})[_0xff9c('0x22')](function(){return _0x25e01e;});})[_0xff9c('0x22')](function(){_0x3200c6[_0xff9c('0x17')](0xcc)[_0xff9c('0x18')]();});}};}function handleEntityNotFound(_0x2b8206,_0x2c7357){return function(_0x15714c){if(!_0x15714c){_0x2b8206[_0xff9c('0x27')](0x194);}return _0x15714c;};}function handleError(_0x2e76c7,_0x1d296a){_0x1d296a=_0x1d296a||0x1f4;return function(_0x33c99d){logger[_0xff9c('0x28')](_0x33c99d[_0xff9c('0x29')]);if(_0x33c99d['name']){delete _0x33c99d[_0xff9c('0x2a')];}_0x2e76c7[_0xff9c('0x17')](_0x1d296a)['send'](_0x33c99d);};}exports[_0xff9c('0x2b')]=function(_0x17cf11,_0x55248a){var _0x3cacce={},_0x1884aa={},_0x4b5a69={'count':0x0,'rows':[]};var _0x1e82fb=_[_0xff9c('0x2c')](db[_0xff9c('0x2d')][_0xff9c('0x2e')],function(_0x558cf7){return{'name':_0x558cf7[_0xff9c('0x2f')],'type':_0x558cf7[_0xff9c('0x30')]['key']};});_0x1884aa[_0xff9c('0x31')]=_[_0xff9c('0x2c')](_0x1e82fb,_0xff9c('0x2a'));_0x1884aa[_0xff9c('0x32')]=_[_0xff9c('0x33')](_0x17cf11[_0xff9c('0x32')]);_0x1884aa[_0xff9c('0x34')]=_[_0xff9c('0x35')](_0x1884aa[_0xff9c('0x31')],_0x1884aa[_0xff9c('0x32')]);_0x3cacce[_0xff9c('0x36')]=_[_0xff9c('0x35')](_0x1884aa[_0xff9c('0x31')],qs[_0xff9c('0x37')](_0x17cf11['query'][_0xff9c('0x37')]));_0x3cacce['attributes']=_0x3cacce[_0xff9c('0x36')][_0xff9c('0x38')]?_0x3cacce['attributes']:_0x1884aa['model'];if(!_0x17cf11[_0xff9c('0x32')]['hasOwnProperty']('nolimit')){_0x3cacce[_0xff9c('0x1b')]=qs['limit'](_0x17cf11['query'][_0xff9c('0x1b')]);_0x3cacce[_0xff9c('0x1a')]=qs['offset'](_0x17cf11['query'][_0xff9c('0x1a')]);}_0x3cacce[_0xff9c('0x39')]=qs['sort'](_0x17cf11[_0xff9c('0x32')]['sort']);_0x3cacce[_0xff9c('0x3a')]=qs[_0xff9c('0x34')](_[_0xff9c('0x3b')](_0x17cf11[_0xff9c('0x32')],_0x1884aa[_0xff9c('0x34')]),_0x1e82fb);if(_0x17cf11['query']['filter']){_0x3cacce[_0xff9c('0x3a')]=_[_0xff9c('0x3c')](_0x3cacce[_0xff9c('0x3a')],{'$or':_['map'](_0x1e82fb,function(_0x1a79bf){if(_0x1a79bf[_0xff9c('0x30')]!==_0xff9c('0x3d')){var _0x13eaa2={};_0x13eaa2[_0x1a79bf[_0xff9c('0x2a')]]={'$like':'%'+_0x17cf11[_0xff9c('0x32')][_0xff9c('0x3e')]+'%'};return _0x13eaa2;}})});}_0x3cacce=_['merge']({},_0x3cacce,_0x17cf11['options']);var _0x3f8ca1={'where':_0x3cacce[_0xff9c('0x3a')]};return db['Sound'][_0xff9c('0x1d')](_0x3f8ca1)[_0xff9c('0x22')](function(_0x54bb8f){_0x4b5a69[_0xff9c('0x1d')]=_0x54bb8f;if(_0x17cf11[_0xff9c('0x32')]['includeAll']){_0x3cacce[_0xff9c('0x3f')]=[{'all':!![]}];}return db[_0xff9c('0x2d')][_0xff9c('0x40')](_0x3cacce);})[_0xff9c('0x22')](function(_0x4203bd){_0x4b5a69[_0xff9c('0x41')]=_0x4203bd;return _0x4b5a69;})[_0xff9c('0x22')](respondWithFilteredResult(_0x55248a,_0x3cacce))['catch'](handleError(_0x55248a,null));};exports[_0xff9c('0x42')]=function(_0x3b408d,_0x4c579c){var _0x3a174e={'raw':!![],'where':{'id':_0x3b408d[_0xff9c('0x43')]['id']}},_0x1601c5={};_0x1601c5[_0xff9c('0x31')]=_[_0xff9c('0x33')](db[_0xff9c('0x2d')]['rawAttributes']);_0x1601c5[_0xff9c('0x32')]=_[_0xff9c('0x33')](_0x3b408d[_0xff9c('0x32')]);_0x1601c5[_0xff9c('0x34')]=_[_0xff9c('0x35')](_0x1601c5[_0xff9c('0x31')],_0x1601c5['query']);_0x3a174e[_0xff9c('0x36')]=_[_0xff9c('0x35')](_0x1601c5[_0xff9c('0x31')],qs['fields'](_0x3b408d[_0xff9c('0x32')]['fields']));_0x3a174e['attributes']=_0x3a174e[_0xff9c('0x36')][_0xff9c('0x38')]?_0x3a174e['attributes']:_0x1601c5[_0xff9c('0x31')];if(_0x3b408d[_0xff9c('0x32')]['includeAll']){_0x3a174e[_0xff9c('0x3f')]=[{'all':!![]}];}_0x3a174e=_[_0xff9c('0x3c')]({},_0x3a174e,_0x3b408d['options']);return db[_0xff9c('0x2d')]['find'](_0x3a174e)['then'](handleEntityNotFound(_0x4c579c,null))[_0xff9c('0x22')](respondWithResult(_0x4c579c,null))[_0xff9c('0x44')](handleError(_0x4c579c,null));};exports['download']=function(_0x467509,_0x5c5a54,_0x2c040f){return db[_0xff9c('0x2d')][_0xff9c('0x45')]({'where':{'id':_0x467509['params']['id']},'attributes':[_0xff9c('0x2a'),_0xff9c('0x46'),_0xff9c('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x5c5a54,null))[_0xff9c('0x22')](function(_0x383419){if(_0x383419){if(!fs[_0xff9c('0x48')](path['join'](config['root'],_0xff9c('0x49'),_0x383419[_0xff9c('0x46')]+'.'+_0x383419['converted_format']))){throw new db[(_0xff9c('0x4a'))][(_0xff9c('0x4b'))](_0xff9c('0x4c'));}return _0x5c5a54[_0xff9c('0x4d')](path[_0xff9c('0x4e')](config[_0xff9c('0x4f')],_0xff9c('0x49'),util['format']('%s.%s',_0x383419['save_name'],_0x383419[_0xff9c('0x47')])),util['format'](_0xff9c('0x50'),_0x383419[_0xff9c('0x2a')],_0x383419[_0xff9c('0x47')]));}return null;})[_0xff9c('0x44')](handleError(_0x5c5a54,null));};exports[_0xff9c('0x51')]=function(_0x57c08e,_0x4e9f41,_0x4f486c){var _0x124acf={'name':path[_0xff9c('0x52')](_0x57c08e['file']['originalname'],path[_0xff9c('0x53')](_0x57c08e[_0xff9c('0x54')][_0xff9c('0x55')])),'save_name':path[_0xff9c('0x52')](_0x57c08e[_0xff9c('0x54')][_0xff9c('0x56')],path['extname'](_0x57c08e['file'][_0xff9c('0x56')])),'original_format':path[_0xff9c('0x53')](_0x57c08e['file'][_0xff9c('0x55')])[_0xff9c('0x57')](0x1),'converted_format':'wav'};var _0x1d5441=path[_0xff9c('0x4e')](config[_0xff9c('0x4f')],_0xff9c('0x58'),_0x57c08e[_0xff9c('0x54')]['filename']);var _0x5f1e39=path[_0xff9c('0x4e')](config['root'],_0xff9c('0x49'),util['format'](_0xff9c('0x50'),path[_0xff9c('0x52')](_0x57c08e[_0xff9c('0x54')][_0xff9c('0x56')],path[_0xff9c('0x53')](_0x57c08e['file'][_0xff9c('0x56')])),_0x124acf['converted_format']));logger[_0xff9c('0x59')](_0xff9c('0x5a'),_0x1d5441);logger[_0xff9c('0x59')](_0xff9c('0x5b'),_0x5f1e39);try{fs[_0xff9c('0x5c')](_0x1d5441,parseInt(_0xff9c('0x5d'),0x8));var _0x5cf2ab=sox[_0xff9c('0x5e')](_0x1d5441,_0x5f1e39,{'sampleRate':0x1f40,'format':_0xff9c('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5cf2ab['on']('error',function(_0xad6255){fs[_0xff9c('0x60')](_0x1d5441);_0x4e9f41['status'](0x1f4)[_0xff9c('0x61')](_0xad6255);});_0x5cf2ab['on']('src',function(_0x276287){_0x124acf['original_duration']=isNaN(_0x276287[_0xff9c('0x62')])?null:_0x276287[_0xff9c('0x62')]*0x3e8;_0x124acf[_0xff9c('0x63')]=isNaN(_0x276287[_0xff9c('0x64')])?null:_0x276287[_0xff9c('0x64')];_0x124acf[_0xff9c('0x65')]=isNaN(_0x276287[_0xff9c('0x66')])?null:_0x276287['channelCount'];_0x124acf[_0xff9c('0x67')]=isNaN(_0x276287[_0xff9c('0x68')])?null:_0x276287[_0xff9c('0x68')];_0x124acf['original_sampleRate']=isNaN(_0x276287[_0xff9c('0x69')])?null:_0x276287[_0xff9c('0x69')];});_0x5cf2ab['on']('dest',function(_0x4718bf){_0x124acf['converted_duration']=isNaN(_0x4718bf[_0xff9c('0x62')])?null:_0x4718bf[_0xff9c('0x62')]*0x3e8;_0x124acf[_0xff9c('0x6a')]=isNaN(_0x4718bf[_0xff9c('0x64')])?null:_0x4718bf[_0xff9c('0x64')];_0x124acf['converted_channelCount']=isNaN(_0x4718bf[_0xff9c('0x66')])?null:_0x4718bf['channelCount'];_0x124acf['converted_bitRate']=isNaN(_0x4718bf[_0xff9c('0x68')])?null:_0x4718bf[_0xff9c('0x68')];_0x124acf[_0xff9c('0x6b')]=isNaN(_0x4718bf[_0xff9c('0x69')])?null:_0x4718bf[_0xff9c('0x69')];});_0x5cf2ab['on'](_0xff9c('0x18'),function(){fs[_0xff9c('0x5c')](_0x5f1e39,parseInt('0777',0x8));return db[_0xff9c('0x2d')][_0xff9c('0x51')](_0x124acf)[_0xff9c('0x22')](function(_0x14157e){var _0x1ddce1={'role':_0x57c08e[_0xff9c('0x6c')][_0xff9c('0x6d')],'userProfileId':_0x57c08e[_0xff9c('0x6c')]['userProfileId']};if(!_0x1ddce1)throw new Error(_0xff9c('0x6e'));if(_0x1ddce1[_0xff9c('0x6d')]===_0xff9c('0x6f')){var _0x409fba=_0x14157e[_0xff9c('0x24')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xff9c('0x25'),'userProfileId':_0x1ddce1[_0xff9c('0x70')]},'raw':!![]})[_0xff9c('0x22')](function(_0x4200b6){if(_0x4200b6&&_0x4200b6[_0xff9c('0x71')]===0x0){return db[_0xff9c('0x26')][_0xff9c('0x51')]({'name':_0x409fba[_0xff9c('0x2a')],'resourceId':_0x409fba['id'],'type':_0x4200b6['name'],'sectionId':_0x4200b6['id']},{})['then'](function(){return _0x14157e;});}else{return _0x14157e;}})['catch'](function(_0xb316bd){logger[_0xff9c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb316bd);throw _0xb316bd;});}return _0x14157e;})[_0xff9c('0x22')](respondWithResult(_0x4e9f41,null))[_0xff9c('0x44')](handleError(_0x4e9f41,null));});_0x5cf2ab[_0xff9c('0x72')]();}catch(_0xe925a1){_0x4e9f41[_0xff9c('0x17')](0x1f4)['send'](_0xe925a1);}};exports[_0xff9c('0x21')]=function(_0xa574b8,_0x9d2b85,_0x494026){return db[_0xff9c('0x2d')]['find']({'where':{'id':_0xa574b8[_0xff9c('0x43')]['id']}})[_0xff9c('0x22')](handleEntityNotFound(_0x9d2b85,null))[_0xff9c('0x22')](saveUpdates(_['pick'](_0xa574b8['body'],[_0xff9c('0x2a'),_0xff9c('0x73')]),null))[_0xff9c('0x22')](respondWithResult(_0x9d2b85,null))[_0xff9c('0x44')](handleError(_0x9d2b85,null));};exports['delete']=function(_0x595b22,_0x2c70c8,_0x405533){return db[_0xff9c('0x2d')][_0xff9c('0x45')]({'where':{'id':_0x595b22[_0xff9c('0x43')]['id']}})[_0xff9c('0x22')](function(_0x365281){if(_0x365281){return _0x365281[_0xff9c('0x23')]();}})[_0xff9c('0x22')](function(_0x3bae0e){var _0x39f3a9=path[_0xff9c('0x4e')](config[_0xff9c('0x4f')],_0xff9c('0x58'),util[_0xff9c('0x74')](_0xff9c('0x50'),_0x3bae0e['save_name'],_0x3bae0e[_0xff9c('0x75')]));var _0x427a58=path[_0xff9c('0x4e')](config['root'],_0xff9c('0x49'),util[_0xff9c('0x74')](_0xff9c('0x50'),_0x3bae0e[_0xff9c('0x46')],_0x3bae0e[_0xff9c('0x47')]));fs[_0xff9c('0x60')](_0x39f3a9);fs[_0xff9c('0x60')](_0x427a58);return _0x3bae0e;})[_0xff9c('0x22')](function(_0x3040e8){if(_0x3040e8){return _0x2c70c8[_0xff9c('0x17')](0xcc)[_0xff9c('0x18')]();}})[_0xff9c('0x22')](handleEntityNotFound(_0x2c70c8,null))[_0xff9c('0x44')](handleError(_0x2c70c8,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a9c752d..a447250 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 _0x5949=['../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x17249c,_0x168d62){var _0x324e7b=function(_0x1b1397){while(--_0x1b1397){_0x17249c['push'](_0x17249c['shift']());}};_0x324e7b(++_0x168d62);}(_0x5949,0x1d3));var _0x9594=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x5949[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x9594('0x0'));var util=require('util');var logger=require(_0x9594('0x1'))(_0x9594('0x2'));var moment=require(_0x9594('0x3'));var BPromise=require('bluebird');var rp=require(_0x9594('0x4'));var fs=require('fs');var path=require(_0x9594('0x5'));var rimraf=require('rimraf');var config=require(_0x9594('0x6'));var attributes=require(_0x9594('0x7'));module['exports']=function(_0x1ae184,_0x4664f3){return _0x1ae184[_0x9594('0x8')](_0x9594('0x9'),attributes,{'tableName':_0x9594('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbab4=['bluebird','rimraf','../../config/environment','./sound.attributes','define','Sound','lodash','util','../../config/logger','api'];(function(_0xbbdd8a,_0x4a89c1){var _0x4c0ec8=function(_0x381a12){while(--_0x381a12){_0xbbdd8a['push'](_0xbbdd8a['shift']());}};_0x4c0ec8(++_0x4a89c1);}(_0xbab4,0x114));var _0x4bab=function(_0x5ca334,_0x2f58b4){_0x5ca334=_0x5ca334-0x0;var _0x41f640=_0xbab4[_0x5ca334];return _0x41f640;};'use strict';var _=require(_0x4bab('0x0'));var util=require(_0x4bab('0x1'));var logger=require(_0x4bab('0x2'))(_0x4bab('0x3'));var moment=require('moment');var BPromise=require(_0x4bab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4bab('0x5'));var config=require(_0x4bab('0x6'));var attributes=require(_0x4bab('0x7'));module['exports']=function(_0xe3d5f4,_0x265e48){return _0xe3d5f4[_0x4bab('0x8')](_0x4bab('0x9'),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 8a20f40..e0722e9 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 _0x5e72=['where','attributes','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','ShowSound','Sound','find','options','raw'];(function(_0xea9a9d,_0x4dc821){var _0x5ec330=function(_0x3c59f0){while(--_0x3c59f0){_0xea9a9d['push'](_0xea9a9d['shift']());}};_0x5ec330(++_0x4dc821);}(_0x5e72,0xde));var _0x25e7=function(_0x2c6ad5,_0x15e816){_0x2c6ad5=_0x2c6ad5-0x0;var _0x5e9f19=_0x5e72[_0x2c6ad5];return _0x5e9f19;};'use strict';var _=require(_0x25e7('0x0'));var util=require(_0x25e7('0x1'));var moment=require(_0x25e7('0x2'));var BPromise=require(_0x25e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25e7('0x4'));var db=require(_0x25e7('0x5'))['db'];var utils=require(_0x25e7('0x6'));var logger=require(_0x25e7('0x7'))(_0x25e7('0x8'));var config=require('../../config/environment');var jayson=require(_0x25e7('0x9'));var client=jayson['client'][_0x25e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16ccc8,_0x453eba,_0x5a10d0){return new BPromise(function(_0x59fc5e,_0x5437e5){return client[_0x25e7('0xb')](_0x16ccc8,_0x5a10d0)['then'](function(_0x1b1e76){logger[_0x25e7('0xc')](_0x25e7('0xd'),_0x453eba,'request\x20sent');logger[_0x25e7('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x453eba,'request\x20sent',JSON[_0x25e7('0xf')](_0x1b1e76));if(_0x1b1e76[_0x25e7('0x10')]){if(_0x1b1e76[_0x25e7('0x10')]['code']===0x1f4){logger['error'](_0x25e7('0xd'),_0x453eba,_0x1b1e76['error']['message']);return _0x5437e5(_0x1b1e76[_0x25e7('0x10')]['message']);}logger[_0x25e7('0x10')](_0x25e7('0xd'),_0x453eba,_0x1b1e76[_0x25e7('0x10')]['message']);return _0x59fc5e(_0x1b1e76[_0x25e7('0x10')][_0x25e7('0x11')]);}else{logger[_0x25e7('0xc')](_0x25e7('0xd'),_0x453eba,_0x25e7('0x12'));_0x59fc5e(_0x1b1e76[_0x25e7('0x13')][_0x25e7('0x11')]);}})[_0x25e7('0x14')](function(_0x5dbd00){logger[_0x25e7('0x10')](_0x25e7('0xd'),_0x453eba,_0x5dbd00);_0x5437e5(_0x5dbd00);});});}exports[_0x25e7('0x15')]=function(_0x43f2ac){var _0x2f81b9=this;return new Promise(function(_0x29cf84,_0x427534){return db[_0x25e7('0x16')][_0x25e7('0x17')]({'raw':_0x43f2ac[_0x25e7('0x18')]?_0x43f2ac['options'][_0x25e7('0x19')]===undefined?!![]:![]:!![],'where':_0x43f2ac[_0x25e7('0x18')]?_0x43f2ac[_0x25e7('0x18')][_0x25e7('0x1a')]||null:null,'attributes':_0x43f2ac[_0x25e7('0x18')]?_0x43f2ac['options'][_0x25e7('0x1b')]||null:null,'include':_0x43f2ac['options']?_0x43f2ac['options'][_0x25e7('0x1c')]?_['map'](_0x43f2ac[_0x25e7('0x18')][_0x25e7('0x1c')],function(_0x46a48a){return{'model':db[_0x46a48a[_0x25e7('0x1d')]],'as':_0x46a48a['as'],'attributes':_0x46a48a[_0x25e7('0x1b')],'include':_0x46a48a[_0x25e7('0x1c')]?_[_0x25e7('0x1e')](_0x46a48a[_0x25e7('0x1c')],function(_0x145460){return{'model':db[_0x145460[_0x25e7('0x1d')]],'as':_0x145460['as'],'attributes':_0x145460[_0x25e7('0x1b')],'include':_0x145460[_0x25e7('0x1c')]?_[_0x25e7('0x1e')](_0x145460['include'],function(_0xaf1ac8){return{'model':db[_0xaf1ac8[_0x25e7('0x1d')]],'as':_0xaf1ac8['as'],'attributes':_0xaf1ac8[_0x25e7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa778d2){logger[_0x25e7('0xc')](_0x25e7('0x15'),_0x43f2ac);logger['debug'](_0x25e7('0x15'),_0x43f2ac,JSON[_0x25e7('0xf')](_0xa778d2));_0x29cf84(_0xa778d2);})[_0x25e7('0x14')](function(_0x5a014a){logger[_0x25e7('0x10')](_0x25e7('0x15'),_0x5a014a['message'],_0x43f2ac);_0x427534(_0x2f81b9[_0x25e7('0x10')](0x1f4,_0x5a014a[_0x25e7('0x11')]));});});}; \ No newline at end of file +var _0x9426=['stringify','error','code','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','debug','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x4eb00b,_0x22adaf){var _0x2dd4bf=function(_0x5e3d6e){while(--_0x5e3d6e){_0x4eb00b['push'](_0x4eb00b['shift']());}};_0x2dd4bf(++_0x22adaf);}(_0x9426,0xa1));var _0x6942=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9426[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6942('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6942('0x1'));var fs=require('fs');var Redis=require(_0x6942('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6942('0x3'));var logger=require(_0x6942('0x4'))('rpc');var config=require(_0x6942('0x5'));var jayson=require(_0x6942('0x6'));var client=jayson[_0x6942('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3588,_0xac7dc9,_0xa77b76){return new BPromise(function(_0x514192,_0x379f7e){return client['request'](_0x1f3588,_0xa77b76)[_0x6942('0x8')](function(_0x2d4135){logger[_0x6942('0x9')](_0x6942('0xa'),_0xac7dc9,_0x6942('0xb'));logger['debug'](_0x6942('0xc'),_0xac7dc9,_0x6942('0xb'),JSON[_0x6942('0xd')](_0x2d4135));if(_0x2d4135[_0x6942('0xe')]){if(_0x2d4135[_0x6942('0xe')][_0x6942('0xf')]===0x1f4){logger['error'](_0x6942('0xa'),_0xac7dc9,_0x2d4135[_0x6942('0xe')][_0x6942('0x10')]);return _0x379f7e(_0x2d4135['error'][_0x6942('0x10')]);}logger[_0x6942('0xe')]('Sound,\x20%s,\x20%s',_0xac7dc9,_0x2d4135[_0x6942('0xe')][_0x6942('0x10')]);return _0x514192(_0x2d4135[_0x6942('0xe')][_0x6942('0x10')]);}else{logger['info'](_0x6942('0xa'),_0xac7dc9,'request\x20sent');_0x514192(_0x2d4135[_0x6942('0x11')][_0x6942('0x10')]);}})[_0x6942('0x12')](function(_0x35cf23){logger[_0x6942('0xe')](_0x6942('0xa'),_0xac7dc9,_0x35cf23);_0x379f7e(_0x35cf23);});});}exports[_0x6942('0x13')]=function(_0x3e8e9e){var _0x264661=this;return new Promise(function(_0xd1c13c,_0x1681ae){return db['Sound'][_0x6942('0x14')]({'raw':_0x3e8e9e[_0x6942('0x15')]?_0x3e8e9e['options'][_0x6942('0x16')]===undefined?!![]:![]:!![],'where':_0x3e8e9e[_0x6942('0x15')]?_0x3e8e9e[_0x6942('0x15')][_0x6942('0x17')]||null:null,'attributes':_0x3e8e9e[_0x6942('0x15')]?_0x3e8e9e[_0x6942('0x15')][_0x6942('0x18')]||null:null,'include':_0x3e8e9e['options']?_0x3e8e9e[_0x6942('0x15')][_0x6942('0x19')]?_[_0x6942('0x1a')](_0x3e8e9e[_0x6942('0x15')][_0x6942('0x19')],function(_0xe6d7af){return{'model':db[_0xe6d7af['model']],'as':_0xe6d7af['as'],'attributes':_0xe6d7af[_0x6942('0x18')],'include':_0xe6d7af[_0x6942('0x19')]?_['map'](_0xe6d7af[_0x6942('0x19')],function(_0x1a019c){return{'model':db[_0x1a019c[_0x6942('0x1b')]],'as':_0x1a019c['as'],'attributes':_0x1a019c['attributes'],'include':_0x1a019c[_0x6942('0x19')]?_['map'](_0x1a019c[_0x6942('0x19')],function(_0x10bc02){return{'model':db[_0x10bc02[_0x6942('0x1b')]],'as':_0x10bc02['as'],'attributes':_0x10bc02['attributes']};}):[]};}):[]};}):[]:[]})[_0x6942('0x8')](function(_0x465955){logger[_0x6942('0x9')](_0x6942('0x13'),_0x3e8e9e);logger[_0x6942('0x1c')](_0x6942('0x13'),_0x3e8e9e,JSON['stringify'](_0x465955));_0xd1c13c(_0x465955);})[_0x6942('0x12')](function(_0x52035a){logger['error'](_0x6942('0x13'),_0x52035a[_0x6942('0x10')],_0x3e8e9e);_0x1681ae(_0x264661[_0x6942('0xe')](0x1f4,_0x52035a[_0x6942('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 5f9999b..4bc4ad9 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0x4fc2,0x111));var _0x24fc=function(_0x37de50,_0x27f82a){_0x37de50=_0x37de50-0x0;var _0x2c37dc=_0x4fc2[_0x37de50];return _0x2c37dc;};'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')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x218208,_0x39f542){var _0x4f3536=function(_0xf778b0){while(--_0xf778b0){_0x218208['push'](_0x218208['shift']());}};_0x4f3536(++_0x39f542);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a9d4bc7..349323d 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 _0x3eeb=['exports','STRING','medium','out','TEXT'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x3eeb,0x1f4));var _0xb3ee=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3eeb[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0xb3ee('0x0')]={'uniqueid':{'type':Sequelize[_0xb3ee('0x1')]},'body':{'type':Sequelize['TEXT'](_0xb3ee('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb3ee('0x3')),'defaultValue':_0xb3ee('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb3ee('0x1')]},'providerResponse':{'type':Sequelize[_0xb3ee('0x4')]}}; \ No newline at end of file +var _0xd75f=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xd75f,0xd0));var _0xfd75=function(_0x76e96b,_0xfbb7cb){_0x76e96b=_0x76e96b-0x0;var _0x3e71fb=_0xd75f[_0x76e96b];return _0x3e71fb;};'use strict';var Sequelize=require(_0xfd75('0x0'));module[_0xfd75('0x1')]={'uniqueid':{'type':Sequelize[_0xfd75('0x2')]},'body':{'type':Sequelize[_0xfd75('0x3')](_0xfd75('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xfd75('0x5')]('in','out'),'defaultValue':_0xfd75('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xfd75('0x2')]},'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 66bd1fd..727c2bd 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 _0x7dbc=['find','catch','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','length','options'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x7dbc,0xe0));var _0xc7db=function(_0x49ceb5,_0x40e27f){_0x49ceb5=_0x49ceb5-0x0;var _0x4cba36=_0x7dbc[_0x49ceb5];return _0x4cba36;};'use strict';var emlformat=require(_0xc7db('0x0'));var rimraf=require(_0xc7db('0x1'));var zipdir=require(_0xc7db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7db('0x3'));var moment=require(_0xc7db('0x4'));var BPromise=require(_0xc7db('0x5'));var Mustache=require(_0xc7db('0x6'));var util=require('util');var path=require(_0xc7db('0x7'));var sox=require(_0xc7db('0x8'));var csv=require('to-csv');var ejs=require(_0xc7db('0x9'));var fs=require('fs');var fs_extra=require(_0xc7db('0xa'));var _=require(_0xc7db('0xb'));var squel=require(_0xc7db('0xc'));var crypto=require(_0xc7db('0xd'));var jsforce=require(_0xc7db('0xe'));var deskjs=require(_0xc7db('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc7db('0x10'));var Redis=require('ioredis');var authService=require(_0xc7db('0x11'));var qs=require(_0xc7db('0x12'));var as=require(_0xc7db('0x13'));var hardwareService=require(_0xc7db('0x14'));var logger=require(_0xc7db('0x15'))(_0xc7db('0x16'));var utils=require(_0xc7db('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc7db('0x18'))['db'];function respondWithStatusCode(_0x59f868,_0x35a109){_0x35a109=_0x35a109||0xcc;return function(_0x23a7d1){if(_0x23a7d1){return _0x59f868[_0xc7db('0x19')](_0x35a109);}return _0x59f868['status'](_0x35a109)[_0xc7db('0x1a')]();};}function respondWithResult(_0x2d3612,_0x269faf){_0x269faf=_0x269faf||0xc8;return function(_0x4b4a99){if(_0x4b4a99){return _0x2d3612[_0xc7db('0x1b')](_0x269faf)[_0xc7db('0x1c')](_0x4b4a99);}};}function respondWithFilteredResult(_0x14a3a,_0x35476f){return function(_0x3c1182){if(_0x3c1182){var _0x559576=typeof _0x35476f[_0xc7db('0x1d')]===_0xc7db('0x1e')&&typeof _0x35476f['limit']===_0xc7db('0x1e');var _0x4911e2=_0x3c1182[_0xc7db('0x1f')];var _0x1d84d1=_0x559576?0x0:_0x35476f[_0xc7db('0x1d')];var _0x5402ce=_0x559576?_0x3c1182[_0xc7db('0x1f')]:_0x35476f[_0xc7db('0x1d')]+_0x35476f[_0xc7db('0x20')];var _0x3cf7ba;if(_0x5402ce>=_0x4911e2){_0x5402ce=_0x4911e2;_0x3cf7ba=0xc8;}else{_0x3cf7ba=0xce;}_0x14a3a[_0xc7db('0x1b')](_0x3cf7ba);return _0x14a3a[_0xc7db('0x21')]('Content-Range',_0x1d84d1+'-'+_0x5402ce+'/'+_0x4911e2)[_0xc7db('0x1c')](_0x3c1182);}return null;};}function patchUpdates(_0x435c9b){return function(_0x289f3c){try{jsonpatch[_0xc7db('0x22')](_0x289f3c,_0x435c9b,!![]);}catch(_0x594713){return BPromise[_0xc7db('0x23')](_0x594713);}return _0x289f3c['save']();};}function saveUpdates(_0x93f620,_0x5d93c2){return function(_0x315b50){if(_0x315b50){return _0x315b50[_0xc7db('0x24')](_0x93f620)[_0xc7db('0x25')](function(_0x3e8b2c){return _0x3e8b2c;});}return null;};}function removeEntity(_0x5c7e28,_0x515c17){return function(_0x538d0d){if(_0x538d0d){return _0x538d0d['destroy']()[_0xc7db('0x25')](function(){_0x5c7e28['status'](0xcc)[_0xc7db('0x1a')]();});}};}function handleEntityNotFound(_0x4d74af,_0x1ee37b){return function(_0x4ff194){if(!_0x4ff194){_0x4d74af[_0xc7db('0x19')](0x194);}return _0x4ff194;};}function handleError(_0x588f61,_0x9367a5){_0x9367a5=_0x9367a5||0x1f4;return function(_0x8fef5b){logger[_0xc7db('0x26')](_0x8fef5b['stack']);if(_0x8fef5b[_0xc7db('0x27')]){delete _0x8fef5b[_0xc7db('0x27')];}_0x588f61[_0xc7db('0x1b')](_0x9367a5)[_0xc7db('0x28')](_0x8fef5b);};}exports['index']=function(_0x2e39cd,_0x55b65c){var _0x6960b3={},_0x3c022c={},_0x3dfe95={'count':0x0,'rows':[]};var _0x4287f5=_[_0xc7db('0x29')](db[_0xc7db('0x2a')][_0xc7db('0x2b')],function(_0x36d206){return{'name':_0x36d206[_0xc7db('0x2c')],'type':_0x36d206[_0xc7db('0x2d')][_0xc7db('0x2e')]};});_0x3c022c[_0xc7db('0x2f')]=_[_0xc7db('0x29')](_0x4287f5,'name');_0x3c022c[_0xc7db('0x30')]=_['keys'](_0x2e39cd[_0xc7db('0x30')]);_0x3c022c[_0xc7db('0x31')]=_[_0xc7db('0x32')](_0x3c022c[_0xc7db('0x2f')],_0x3c022c[_0xc7db('0x30')]);_0x6960b3[_0xc7db('0x33')]=_['intersection'](_0x3c022c['model'],qs[_0xc7db('0x34')](_0x2e39cd[_0xc7db('0x30')]['fields']));_0x6960b3[_0xc7db('0x33')]=_0x6960b3[_0xc7db('0x33')]['length']?_0x6960b3[_0xc7db('0x33')]:_0x3c022c['model'];if(!_0x2e39cd[_0xc7db('0x30')]['hasOwnProperty']('nolimit')){_0x6960b3[_0xc7db('0x20')]=qs[_0xc7db('0x20')](_0x2e39cd[_0xc7db('0x30')][_0xc7db('0x20')]);_0x6960b3['offset']=qs['offset'](_0x2e39cd[_0xc7db('0x30')][_0xc7db('0x1d')]);}_0x6960b3[_0xc7db('0x35')]=qs[_0xc7db('0x36')](_0x2e39cd[_0xc7db('0x30')][_0xc7db('0x36')]);_0x6960b3['where']=qs[_0xc7db('0x31')](_[_0xc7db('0x37')](_0x2e39cd[_0xc7db('0x30')],_0x3c022c[_0xc7db('0x31')]),_0x4287f5);if(_0x2e39cd['query'][_0xc7db('0x38')]){_0x6960b3[_0xc7db('0x39')]=_[_0xc7db('0x3a')](_0x6960b3['where'],{'$or':_[_0xc7db('0x29')](_0x4287f5,function(_0x1f0b3b){if(_0x1f0b3b[_0xc7db('0x2d')]!==_0xc7db('0x3b')){var _0x563a09={};_0x563a09[_0x1f0b3b['name']]={'$like':'%'+_0x2e39cd[_0xc7db('0x30')][_0xc7db('0x38')]+'%'};return _0x563a09;}})});}_0x6960b3=_[_0xc7db('0x3a')]({},_0x6960b3,_0x2e39cd['options']);var _0x2ce99d={'where':_0x6960b3[_0xc7db('0x39')]};return db[_0xc7db('0x2a')]['count'](_0x2ce99d)[_0xc7db('0x25')](function(_0x4315d1){_0x3dfe95[_0xc7db('0x1f')]=_0x4315d1;if(_0x2e39cd[_0xc7db('0x30')][_0xc7db('0x3c')]){_0x6960b3[_0xc7db('0x3d')]=[{'all':!![]}];}return db['SquareMessage'][_0xc7db('0x3e')](_0x6960b3);})[_0xc7db('0x25')](function(_0x566056){_0x3dfe95['rows']=_0x566056;return _0x3dfe95;})[_0xc7db('0x25')](respondWithFilteredResult(_0x55b65c,_0x6960b3))['catch'](handleError(_0x55b65c,null));};exports[_0xc7db('0x3f')]=function(_0x1ea862,_0x2a6f01){var _0xb482ab={'raw':!![],'where':{'id':_0x1ea862[_0xc7db('0x40')]['id']}},_0x1d8217={};_0x1d8217['model']=_[_0xc7db('0x41')](db[_0xc7db('0x2a')][_0xc7db('0x2b')]);_0x1d8217[_0xc7db('0x30')]=_['keys'](_0x1ea862[_0xc7db('0x30')]);_0x1d8217[_0xc7db('0x31')]=_[_0xc7db('0x32')](_0x1d8217[_0xc7db('0x2f')],_0x1d8217[_0xc7db('0x30')]);_0xb482ab['attributes']=_[_0xc7db('0x32')](_0x1d8217['model'],qs[_0xc7db('0x34')](_0x1ea862[_0xc7db('0x30')]['fields']));_0xb482ab['attributes']=_0xb482ab[_0xc7db('0x33')][_0xc7db('0x42')]?_0xb482ab[_0xc7db('0x33')]:_0x1d8217[_0xc7db('0x2f')];if(_0x1ea862['query'][_0xc7db('0x3c')]){_0xb482ab['include']=[{'all':!![]}];}_0xb482ab=_[_0xc7db('0x3a')]({},_0xb482ab,_0x1ea862[_0xc7db('0x43')]);return db[_0xc7db('0x2a')][_0xc7db('0x44')](_0xb482ab)[_0xc7db('0x25')](handleEntityNotFound(_0x2a6f01,null))[_0xc7db('0x25')](respondWithResult(_0x2a6f01,null))[_0xc7db('0x45')](handleError(_0x2a6f01,null));};exports[_0xc7db('0x46')]=function(_0x2ba160,_0x37b262){return db[_0xc7db('0x2a')][_0xc7db('0x46')](_0x2ba160[_0xc7db('0x47')],{})['then'](respondWithResult(_0x37b262,0xc9))['catch'](handleError(_0x37b262,null));};exports[_0xc7db('0x24')]=function(_0x3216a7,_0x2adc6a){if(_0x3216a7['body']['id']){delete _0x3216a7['body']['id'];}return db[_0xc7db('0x2a')][_0xc7db('0x44')]({'where':{'id':_0x3216a7[_0xc7db('0x40')]['id']}})['then'](handleEntityNotFound(_0x2adc6a,null))[_0xc7db('0x25')](saveUpdates(_0x3216a7[_0xc7db('0x47')],null))['then'](respondWithResult(_0x2adc6a,null))[_0xc7db('0x45')](handleError(_0x2adc6a,null));};exports[_0xc7db('0x48')]=function(_0x5705a1,_0x50fa3e){return db[_0xc7db('0x2a')][_0xc7db('0x44')]({'where':{'id':_0x5705a1[_0xc7db('0x40')]['id']}})[_0xc7db('0x25')](handleEntityNotFound(_0x50fa3e,null))['then'](removeEntity(_0x50fa3e,null))[_0xc7db('0x45')](handleError(_0x50fa3e,null));}; \ No newline at end of file +var _0xc17f=['filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','key','map','query','keys'];(function(_0x510ed2,_0x568a66){var _0x2aa3d0=function(_0x498a75){while(--_0x498a75){_0x510ed2['push'](_0x510ed2['shift']());}};_0x2aa3d0(++_0x568a66);}(_0xc17f,0xae));var _0xfc17=function(_0x189f6f,_0x3d21a2){_0x189f6f=_0x189f6f-0x0;var _0x26ed6b=_0xc17f[_0x189f6f];return _0x26ed6b;};'use strict';var emlformat=require(_0xfc17('0x0'));var rimraf=require(_0xfc17('0x1'));var zipdir=require(_0xfc17('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc17('0x3'));var moment=require(_0xfc17('0x4'));var BPromise=require(_0xfc17('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc17('0x6'));var sox=require('sox');var csv=require(_0xfc17('0x7'));var ejs=require(_0xfc17('0x8'));var fs=require('fs');var fs_extra=require(_0xfc17('0x9'));var _=require(_0xfc17('0xa'));var squel=require(_0xfc17('0xb'));var crypto=require(_0xfc17('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfc17('0xd'));var toCsv=require(_0xfc17('0x7'));var querystring=require(_0xfc17('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc17('0xf'));var authService=require(_0xfc17('0x10'));var qs=require(_0xfc17('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc17('0x12'))(_0xfc17('0x13'));var utils=require(_0xfc17('0x14'));var config=require(_0xfc17('0x15'));var licenseUtil=require(_0xfc17('0x16'));var db=require(_0xfc17('0x17'))['db'];function respondWithStatusCode(_0x411880,_0x2d491c){_0x2d491c=_0x2d491c||0xcc;return function(_0x4e6067){if(_0x4e6067){return _0x411880[_0xfc17('0x18')](_0x2d491c);}return _0x411880['status'](_0x2d491c)[_0xfc17('0x19')]();};}function respondWithResult(_0x254d92,_0x47ac02){_0x47ac02=_0x47ac02||0xc8;return function(_0x37c1c2){if(_0x37c1c2){return _0x254d92[_0xfc17('0x1a')](_0x47ac02)[_0xfc17('0x1b')](_0x37c1c2);}};}function respondWithFilteredResult(_0x1b958b,_0x1c2e8b){return function(_0x385460){if(_0x385460){var _0x267704=typeof _0x1c2e8b[_0xfc17('0x1c')]===_0xfc17('0x1d')&&typeof _0x1c2e8b[_0xfc17('0x1e')]===_0xfc17('0x1d');var _0x1c9223=_0x385460['count'];var _0x4ed1e0=_0x267704?0x0:_0x1c2e8b['offset'];var _0x42ca04=_0x267704?_0x385460[_0xfc17('0x1f')]:_0x1c2e8b[_0xfc17('0x1c')]+_0x1c2e8b['limit'];var _0x556944;if(_0x42ca04>=_0x1c9223){_0x42ca04=_0x1c9223;_0x556944=0xc8;}else{_0x556944=0xce;}_0x1b958b[_0xfc17('0x1a')](_0x556944);return _0x1b958b[_0xfc17('0x20')](_0xfc17('0x21'),_0x4ed1e0+'-'+_0x42ca04+'/'+_0x1c9223)[_0xfc17('0x1b')](_0x385460);}return null;};}function patchUpdates(_0x224bb5){return function(_0x2b62a3){try{jsonpatch[_0xfc17('0x22')](_0x2b62a3,_0x224bb5,!![]);}catch(_0x3ecbf9){return BPromise[_0xfc17('0x23')](_0x3ecbf9);}return _0x2b62a3[_0xfc17('0x24')]();};}function saveUpdates(_0x5e47c6,_0x24d715){return function(_0x34d5f6){if(_0x34d5f6){return _0x34d5f6[_0xfc17('0x25')](_0x5e47c6)[_0xfc17('0x26')](function(_0x47438c){return _0x47438c;});}return null;};}function removeEntity(_0x33d6aa,_0x5a5520){return function(_0x1e5354){if(_0x1e5354){return _0x1e5354['destroy']()['then'](function(){_0x33d6aa[_0xfc17('0x1a')](0xcc)[_0xfc17('0x19')]();});}};}function handleEntityNotFound(_0x38767d,_0x58dc61){return function(_0x55d6c0){if(!_0x55d6c0){_0x38767d[_0xfc17('0x18')](0x194);}return _0x55d6c0;};}function handleError(_0x59209e,_0x52aedc){_0x52aedc=_0x52aedc||0x1f4;return function(_0xd25fd3){logger[_0xfc17('0x27')](_0xd25fd3[_0xfc17('0x28')]);if(_0xd25fd3[_0xfc17('0x29')]){delete _0xd25fd3[_0xfc17('0x29')];}_0x59209e['status'](_0x52aedc)[_0xfc17('0x2a')](_0xd25fd3);};}exports[_0xfc17('0x2b')]=function(_0x3f3cbb,_0x3c9dda){var _0x22766d={},_0x1a474d={},_0x45dcab={'count':0x0,'rows':[]};var _0x27fee4=_['map'](db[_0xfc17('0x2c')][_0xfc17('0x2d')],function(_0x4697d5){return{'name':_0x4697d5[_0xfc17('0x2e')],'type':_0x4697d5['type'][_0xfc17('0x2f')]};});_0x1a474d['model']=_[_0xfc17('0x30')](_0x27fee4,_0xfc17('0x29'));_0x1a474d[_0xfc17('0x31')]=_[_0xfc17('0x32')](_0x3f3cbb[_0xfc17('0x31')]);_0x1a474d[_0xfc17('0x33')]=_[_0xfc17('0x34')](_0x1a474d['model'],_0x1a474d[_0xfc17('0x31')]);_0x22766d['attributes']=_[_0xfc17('0x34')](_0x1a474d[_0xfc17('0x35')],qs[_0xfc17('0x36')](_0x3f3cbb[_0xfc17('0x31')][_0xfc17('0x36')]));_0x22766d['attributes']=_0x22766d[_0xfc17('0x37')]['length']?_0x22766d['attributes']:_0x1a474d[_0xfc17('0x35')];if(!_0x3f3cbb[_0xfc17('0x31')][_0xfc17('0x38')](_0xfc17('0x39'))){_0x22766d[_0xfc17('0x1e')]=qs[_0xfc17('0x1e')](_0x3f3cbb[_0xfc17('0x31')][_0xfc17('0x1e')]);_0x22766d[_0xfc17('0x1c')]=qs[_0xfc17('0x1c')](_0x3f3cbb['query'][_0xfc17('0x1c')]);}_0x22766d[_0xfc17('0x3a')]=qs[_0xfc17('0x3b')](_0x3f3cbb[_0xfc17('0x31')][_0xfc17('0x3b')]);_0x22766d[_0xfc17('0x3c')]=qs[_0xfc17('0x33')](_[_0xfc17('0x3d')](_0x3f3cbb['query'],_0x1a474d['filters']),_0x27fee4);if(_0x3f3cbb[_0xfc17('0x31')][_0xfc17('0x3e')]){_0x22766d[_0xfc17('0x3c')]=_[_0xfc17('0x3f')](_0x22766d['where'],{'$or':_[_0xfc17('0x30')](_0x27fee4,function(_0x152a4d){if(_0x152a4d['type']!==_0xfc17('0x40')){var _0x25251a={};_0x25251a[_0x152a4d['name']]={'$like':'%'+_0x3f3cbb[_0xfc17('0x31')][_0xfc17('0x3e')]+'%'};return _0x25251a;}})});}_0x22766d=_[_0xfc17('0x3f')]({},_0x22766d,_0x3f3cbb[_0xfc17('0x41')]);var _0x457a3d={'where':_0x22766d[_0xfc17('0x3c')]};return db[_0xfc17('0x2c')][_0xfc17('0x1f')](_0x457a3d)['then'](function(_0x6ccd7e){_0x45dcab[_0xfc17('0x1f')]=_0x6ccd7e;if(_0x3f3cbb['query']['includeAll']){_0x22766d[_0xfc17('0x42')]=[{'all':!![]}];}return db[_0xfc17('0x2c')][_0xfc17('0x43')](_0x22766d);})[_0xfc17('0x26')](function(_0x7f7f17){_0x45dcab[_0xfc17('0x44')]=_0x7f7f17;return _0x45dcab;})[_0xfc17('0x26')](respondWithFilteredResult(_0x3c9dda,_0x22766d))[_0xfc17('0x45')](handleError(_0x3c9dda,null));};exports['show']=function(_0x42daee,_0x3f76ff){var _0x557067={'raw':!![],'where':{'id':_0x42daee[_0xfc17('0x46')]['id']}},_0x89ead8={};_0x89ead8[_0xfc17('0x35')]=_[_0xfc17('0x32')](db[_0xfc17('0x2c')][_0xfc17('0x2d')]);_0x89ead8['query']=_[_0xfc17('0x32')](_0x42daee[_0xfc17('0x31')]);_0x89ead8[_0xfc17('0x33')]=_[_0xfc17('0x34')](_0x89ead8['model'],_0x89ead8['query']);_0x557067[_0xfc17('0x37')]=_['intersection'](_0x89ead8['model'],qs['fields'](_0x42daee[_0xfc17('0x31')][_0xfc17('0x36')]));_0x557067[_0xfc17('0x37')]=_0x557067[_0xfc17('0x37')]['length']?_0x557067[_0xfc17('0x37')]:_0x89ead8[_0xfc17('0x35')];if(_0x42daee[_0xfc17('0x31')]['includeAll']){_0x557067['include']=[{'all':!![]}];}_0x557067=_[_0xfc17('0x3f')]({},_0x557067,_0x42daee[_0xfc17('0x41')]);return db[_0xfc17('0x2c')][_0xfc17('0x47')](_0x557067)[_0xfc17('0x26')](handleEntityNotFound(_0x3f76ff,null))[_0xfc17('0x26')](respondWithResult(_0x3f76ff,null))['catch'](handleError(_0x3f76ff,null));};exports[_0xfc17('0x48')]=function(_0x2ef857,_0x18a96a){return db['SquareMessage'][_0xfc17('0x48')](_0x2ef857['body'],{})['then'](respondWithResult(_0x18a96a,0xc9))['catch'](handleError(_0x18a96a,null));};exports[_0xfc17('0x25')]=function(_0x29ce48,_0x5671bc){if(_0x29ce48[_0xfc17('0x49')]['id']){delete _0x29ce48['body']['id'];}return db['SquareMessage'][_0xfc17('0x47')]({'where':{'id':_0x29ce48[_0xfc17('0x46')]['id']}})[_0xfc17('0x26')](handleEntityNotFound(_0x5671bc,null))[_0xfc17('0x26')](saveUpdates(_0x29ce48['body'],null))[_0xfc17('0x26')](respondWithResult(_0x5671bc,null))['catch'](handleError(_0x5671bc,null));};exports[_0xfc17('0x4a')]=function(_0x326a87,_0x19d42d){return db[_0xfc17('0x2c')][_0xfc17('0x47')]({'where':{'id':_0x326a87[_0xfc17('0x46')]['id']}})[_0xfc17('0x26')](handleEntityNotFound(_0x19d42d,null))[_0xfc17('0x26')](removeEntity(_0x19d42d,null))[_0xfc17('0x45')](handleError(_0x19d42d,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index de5052a..8a68371 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 _0x14ac=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','SquareMessage'];(function(_0x2d169a,_0x4c4b89){var _0x185c16=function(_0x505080){while(--_0x505080){_0x2d169a['push'](_0x2d169a['shift']());}};_0x185c16(++_0x4c4b89);}(_0x14ac,0x136));var _0xc14a=function(_0x454876,_0x580571){_0x454876=_0x454876-0x0;var _0x1084e6=_0x14ac[_0x454876];return _0x1084e6;};'use strict';var _=require(_0xc14a('0x0'));var util=require(_0xc14a('0x1'));var logger=require(_0xc14a('0x2'))('api');var moment=require(_0xc14a('0x3'));var BPromise=require(_0xc14a('0x4'));var rp=require(_0xc14a('0x5'));var fs=require('fs');var path=require(_0xc14a('0x6'));var rimraf=require('rimraf');var config=require(_0xc14a('0x7'));var attributes=require('./squareMessage.attributes');module[_0xc14a('0x8')]=function(_0x164540,_0x424e05){return _0x164540['define'](_0xc14a('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19cf=['path','../../config/environment','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3a8c7e,_0x47a6b1){var _0x23daa7=function(_0x1dc292){while(--_0x1dc292){_0x3a8c7e['push'](_0x3a8c7e['shift']());}};_0x23daa7(++_0x47a6b1);}(_0x19cf,0x124));var _0xf19c=function(_0x2f09d2,_0x1f5269){_0x2f09d2=_0x2f09d2-0x0;var _0x91c0b5=_0x19cf[_0x2f09d2];return _0x91c0b5;};'use strict';var _=require(_0xf19c('0x0'));var util=require('util');var logger=require(_0xf19c('0x1'))(_0xf19c('0x2'));var moment=require(_0xf19c('0x3'));var BPromise=require(_0xf19c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf19c('0x5'));var rimraf=require('rimraf');var config=require(_0xf19c('0x6'));var attributes=require('./squareMessage.attributes');module[_0xf19c('0x7')]=function(_0x550c9e,_0xd508e9){return _0x550c9e[_0xf19c('0x8')](_0xf19c('0x9'),attributes,{'tableName':_0xf19c('0xa'),'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 6cc8f56..cfde75e 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 _0x7bb5=['raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','options'];(function(_0x43e176,_0x4bb6fd){var _0x3dab41=function(_0x16b6a6){while(--_0x16b6a6){_0x43e176['push'](_0x43e176['shift']());}};_0x3dab41(++_0x4bb6fd);}(_0x7bb5,0x197));var _0x57bb=function(_0x21b0a0,_0x239de2){_0x21b0a0=_0x21b0a0-0x0;var _0x1ec7aa=_0x7bb5[_0x21b0a0];return _0x1ec7aa;};'use strict';var _=require(_0x57bb('0x0'));var util=require(_0x57bb('0x1'));var moment=require(_0x57bb('0x2'));var BPromise=require(_0x57bb('0x3'));var rs=require(_0x57bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57bb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x57bb('0x6'))('rpc');var config=require(_0x57bb('0x7'));var jayson=require(_0x57bb('0x8'));var client=jayson[_0x57bb('0x9')][_0x57bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x418d60,_0x642688,_0x32a194){return new BPromise(function(_0x2c3bb0,_0x584d45){return client[_0x57bb('0xb')](_0x418d60,_0x32a194)[_0x57bb('0xc')](function(_0xc3a300){logger[_0x57bb('0xd')](_0x57bb('0xe'),_0x642688,_0x57bb('0xf'));logger[_0x57bb('0x10')](_0x57bb('0x11'),_0x642688,_0x57bb('0xf'),JSON[_0x57bb('0x12')](_0xc3a300));if(_0xc3a300['error']){if(_0xc3a300['error']['code']===0x1f4){logger[_0x57bb('0x13')](_0x57bb('0xe'),_0x642688,_0xc3a300[_0x57bb('0x13')][_0x57bb('0x14')]);return _0x584d45(_0xc3a300[_0x57bb('0x13')][_0x57bb('0x14')]);}logger[_0x57bb('0x13')]('SquareMessage,\x20%s,\x20%s',_0x642688,_0xc3a300['error']['message']);return _0x2c3bb0(_0xc3a300[_0x57bb('0x13')][_0x57bb('0x14')]);}else{logger[_0x57bb('0xd')](_0x57bb('0xe'),_0x642688,_0x57bb('0xf'));_0x2c3bb0(_0xc3a300[_0x57bb('0x15')][_0x57bb('0x14')]);}})[_0x57bb('0x16')](function(_0x4e8287){logger['error'](_0x57bb('0xe'),_0x642688,_0x4e8287);_0x584d45(_0x4e8287);});});}exports['CreateSquareMessage']=function(_0x346d53){var _0x2ff47f=this;return new Promise(function(_0x4ae77c,_0xe535c4){return db['SquareMessage'][_0x57bb('0x17')](_0x346d53['body'],{'raw':_0x346d53[_0x57bb('0x18')]?_0x346d53[_0x57bb('0x18')][_0x57bb('0x19')]===undefined?!![]:![]:!![]})[_0x57bb('0xc')](function(_0x4a0fd1){logger[_0x57bb('0xd')](_0x57bb('0x1a'),_0x346d53);logger[_0x57bb('0x10')](_0x57bb('0x1a'),_0x346d53,JSON[_0x57bb('0x12')](_0x4a0fd1));_0x4ae77c(_0x4a0fd1);})[_0x57bb('0x16')](function(_0x3933e1){logger[_0x57bb('0x13')](_0x57bb('0x1a'),_0x3933e1[_0x57bb('0x14')],_0x346d53);_0xe535c4(_0x2ff47f[_0x57bb('0x13')](0x1f4,_0x3933e1['message']));});});}; \ No newline at end of file +var _0x2664=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','options','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x2664,0x1c5));var _0x4266=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2664[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4266('0x0'));var util=require(_0x4266('0x1'));var moment=require(_0x4266('0x2'));var BPromise=require(_0x4266('0x3'));var rs=require(_0x4266('0x4'));var fs=require('fs');var Redis=require(_0x4266('0x5'));var db=require(_0x4266('0x6'))['db'];var utils=require(_0x4266('0x7'));var logger=require(_0x4266('0x8'))(_0x4266('0x9'));var config=require(_0x4266('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4266('0xb')][_0x4266('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x517508,_0x328c6b,_0x1643cd){return new BPromise(function(_0x34aa02,_0x25cf39){return client[_0x4266('0xd')](_0x517508,_0x1643cd)[_0x4266('0xe')](function(_0x413217){logger[_0x4266('0xf')]('SquareMessage,\x20%s,\x20%s',_0x328c6b,_0x4266('0x10'));logger[_0x4266('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x328c6b,_0x4266('0x10'),JSON[_0x4266('0x12')](_0x413217));if(_0x413217['error']){if(_0x413217[_0x4266('0x13')]['code']===0x1f4){logger[_0x4266('0x13')](_0x4266('0x14'),_0x328c6b,_0x413217[_0x4266('0x13')][_0x4266('0x15')]);return _0x25cf39(_0x413217[_0x4266('0x13')][_0x4266('0x15')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x328c6b,_0x413217[_0x4266('0x13')][_0x4266('0x15')]);return _0x34aa02(_0x413217[_0x4266('0x13')]['message']);}else{logger[_0x4266('0xf')]('SquareMessage,\x20%s,\x20%s',_0x328c6b,'request\x20sent');_0x34aa02(_0x413217[_0x4266('0x16')][_0x4266('0x15')]);}})[_0x4266('0x17')](function(_0xac474f){logger['error'](_0x4266('0x14'),_0x328c6b,_0xac474f);_0x25cf39(_0xac474f);});});}exports[_0x4266('0x18')]=function(_0x4d5fe3){var _0x135318=this;return new Promise(function(_0x359cbe,_0x31d5e9){return db['SquareMessage'][_0x4266('0x19')](_0x4d5fe3['body'],{'raw':_0x4d5fe3[_0x4266('0x1a')]?_0x4d5fe3[_0x4266('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4266('0xe')](function(_0x4939c5){logger[_0x4266('0xf')](_0x4266('0x18'),_0x4d5fe3);logger[_0x4266('0x11')](_0x4266('0x18'),_0x4d5fe3,JSON['stringify'](_0x4939c5));_0x359cbe(_0x4939c5);})[_0x4266('0x17')](function(_0x5802e8){logger[_0x4266('0x13')]('CreateSquareMessage',_0x5802e8['message'],_0x4d5fe3);_0x31d5e9(_0x135318[_0x4266('0x13')](0x1f4,_0x5802e8[_0x4266('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 6470be8..1a45f1f 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 _0xbde9=['delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','15s','test','create'];(function(_0x5a9ff0,_0x473e4e){var _0x4b5e03=function(_0x444a72){while(--_0x444a72){_0x5a9ff0['push'](_0x5a9ff0['shift']());}};_0x4b5e03(++_0x473e4e);}(_0xbde9,0x193));var _0x9bde=function(_0x101f97,_0x5bb72e){_0x101f97=_0x101f97-0x0;var _0x137bcb=_0xbde9[_0x101f97];return _0x137bcb;};'use strict';var multer=require('multer');var util=require(_0x9bde('0x0'));var path=require(_0x9bde('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bde('0x2')]();var fs_extra=require(_0x9bde('0x3'));var auth=require(_0x9bde('0x4'));var interaction=require(_0x9bde('0x5'));var config=require(_0x9bde('0x6'));var controller=require(_0x9bde('0x7'));router[_0x9bde('0x8')]('/',auth['isAuthenticated'](),controller[_0x9bde('0x9')]);router['get'](_0x9bde('0xa'),auth[_0x9bde('0xb')](),controller[_0x9bde('0xc')]);router[_0x9bde('0x8')](_0x9bde('0xd'),auth['isAuthenticated'](),timeout(_0x9bde('0xe')),controller[_0x9bde('0xf')]);router['post']('/',auth[_0x9bde('0xb')](),controller[_0x9bde('0x10')]);router['put'](_0x9bde('0xa'),auth[_0x9bde('0xb')](),controller['update']);router[_0x9bde('0x11')](_0x9bde('0xa'),auth[_0x9bde('0xb')](),controller[_0x9bde('0x12')]);module[_0x9bde('0x13')]=router; \ No newline at end of file +var _0x5a83=['test','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','15s'];(function(_0x52deea,_0xf4db2a){var _0xe693a7=function(_0x2ec86c){while(--_0x2ec86c){_0x52deea['push'](_0x52deea['shift']());}};_0xe693a7(++_0xf4db2a);}(_0x5a83,0xe8));var _0x35a8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5a83[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x35a8('0x0'));var util=require(_0x35a8('0x1'));var path=require(_0x35a8('0x2'));var timeout=require(_0x35a8('0x3'));var express=require(_0x35a8('0x4'));var router=express[_0x35a8('0x5')]();var fs_extra=require(_0x35a8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x35a8('0x7'));var config=require(_0x35a8('0x8'));var controller=require(_0x35a8('0x9'));router[_0x35a8('0xa')]('/',auth['isAuthenticated'](),controller[_0x35a8('0xb')]);router[_0x35a8('0xa')](_0x35a8('0xc'),auth[_0x35a8('0xd')](),controller['show']);router[_0x35a8('0xa')]('/:id/test',auth['isAuthenticated'](),timeout(_0x35a8('0xe')),controller[_0x35a8('0xf')]);router['post']('/',auth[_0x35a8('0xd')](),controller['create']);router[_0x35a8('0x10')]('/:id',auth[_0x35a8('0xd')](),controller[_0x35a8('0x11')]);router[_0x35a8('0x12')](_0x35a8('0xc'),auth[_0x35a8('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 0e60bb9..d3b7c6e 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 _0x52f4=['sequelize','name','STRING'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x52f4,0x1e6));var _0x452f=function(_0x329a1f,_0x4e4ad4){_0x329a1f=_0x329a1f-0x0;var _0x13065a=_0x52f4[_0x329a1f];return _0x13065a;};'use strict';var Sequelize=require(_0x452f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x452f('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x452f('0x2')]}}; \ No newline at end of file +var _0x278c=['exports','name','STRING','sequelize'];(function(_0xc2a78b,_0x31feb1){var _0x10391d=function(_0x14aa57){while(--_0x14aa57){_0xc2a78b['push'](_0xc2a78b['shift']());}};_0x10391d(++_0x31feb1);}(_0x278c,0x77));var _0xc278=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x278c[_0x2fdf82];return _0x2382f5;};'use strict';var Sequelize=require(_0xc278('0x0'));module[_0xc278('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc278('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xc278('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index bb36410..ad1266a 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 _0xf82f=['intersection','model','fields','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','include','rows','catch','show','params','keys','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','then','destroy','ODBC','UserProfileResource','error','name','index','map','SquareOdbc','rawAttributes','fieldName','key','query','attributes'];(function(_0x12a85c,_0x53c833){var _0x2c24ab=function(_0x3e3bd6){while(--_0x3e3bd6){_0x12a85c['push'](_0x12a85c['shift']());}};_0x2c24ab(++_0x53c833);}(_0xf82f,0x110));var _0xff82=function(_0x5667ea,_0x306995){_0x5667ea=_0x5667ea-0x0;var _0x58ab91=_0xf82f[_0x5667ea];return _0x58ab91;};'use strict';var emlformat=require(_0xff82('0x0'));var rimraf=require(_0xff82('0x1'));var zipdir=require(_0xff82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff82('0x3'));var BPromise=require(_0xff82('0x4'));var Mustache=require(_0xff82('0x5'));var util=require(_0xff82('0x6'));var path=require('path');var sox=require(_0xff82('0x7'));var csv=require(_0xff82('0x8'));var ejs=require(_0xff82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff82('0xa'));var squel=require(_0xff82('0xb'));var crypto=require(_0xff82('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xff82('0xd'));var toCsv=require(_0xff82('0x8'));var querystring=require(_0xff82('0xe'));var Papa=require('papaparse');var Redis=require(_0xff82('0xf'));var authService=require(_0xff82('0x10'));var qs=require(_0xff82('0x11'));var as=require(_0xff82('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xff82('0x13'));var config=require(_0xff82('0x14'));var licenseUtil=require(_0xff82('0x15'));var db=require(_0xff82('0x16'))['db'];function respondWithStatusCode(_0xcdffcf,_0x26aa3b){_0x26aa3b=_0x26aa3b||0xcc;return function(_0x5c0bbf){if(_0x5c0bbf){return _0xcdffcf['sendStatus'](_0x26aa3b);}return _0xcdffcf[_0xff82('0x17')](_0x26aa3b)[_0xff82('0x18')]();};}function respondWithResult(_0x203d4d,_0x5edf29){_0x5edf29=_0x5edf29||0xc8;return function(_0x15f7a4){if(_0x15f7a4){return _0x203d4d[_0xff82('0x17')](_0x5edf29)[_0xff82('0x19')](_0x15f7a4);}};}function respondWithFilteredResult(_0x333eb4,_0x535a57){return function(_0x1db78e){if(_0x1db78e){var _0x34bca0=typeof _0x535a57[_0xff82('0x1a')]===_0xff82('0x1b')&&typeof _0x535a57[_0xff82('0x1c')]===_0xff82('0x1b');var _0x645814=_0x1db78e['count'];var _0x50980f=_0x34bca0?0x0:_0x535a57[_0xff82('0x1a')];var _0x4ec575=_0x34bca0?_0x1db78e[_0xff82('0x1d')]:_0x535a57[_0xff82('0x1a')]+_0x535a57['limit'];var _0x51eca1;if(_0x4ec575>=_0x645814){_0x4ec575=_0x645814;_0x51eca1=0xc8;}else{_0x51eca1=0xce;}_0x333eb4[_0xff82('0x17')](_0x51eca1);return _0x333eb4['set']('Content-Range',_0x50980f+'-'+_0x4ec575+'/'+_0x645814)[_0xff82('0x19')](_0x1db78e);}return null;};}function patchUpdates(_0x462ba4){return function(_0x4259ee){try{jsonpatch['apply'](_0x4259ee,_0x462ba4,!![]);}catch(_0x4969b3){return BPromise['reject'](_0x4969b3);}return _0x4259ee['save']();};}function saveUpdates(_0x5c4ef1,_0x195cc2){return function(_0x36cb2f){if(_0x36cb2f){return _0x36cb2f['update'](_0x5c4ef1)[_0xff82('0x1e')](function(_0x6bb0fa){return _0x6bb0fa;});}return null;};}function removeEntity(_0x2717dd,_0xb00ee3){return function(_0xf6d2a){if(_0xf6d2a){return _0xf6d2a[_0xff82('0x1f')]()[_0xff82('0x1e')](function(){var _0x461df3=_0xf6d2a['get']({'plain':!![]});var _0x17b092=_0xff82('0x20');return db[_0xff82('0x21')]['destroy']({'where':{'type':_0x17b092,'resourceId':_0x461df3['id']}})['then'](function(){return _0xf6d2a;});})[_0xff82('0x1e')](function(){_0x2717dd[_0xff82('0x17')](0xcc)[_0xff82('0x18')]();});}};}function handleEntityNotFound(_0x34483e,_0x40aa62){return function(_0x33aab0){if(!_0x33aab0){_0x34483e['sendStatus'](0x194);}return _0x33aab0;};}function handleError(_0x2cd679,_0xe9744b){_0xe9744b=_0xe9744b||0x1f4;return function(_0x2e18fe){logger[_0xff82('0x22')](_0x2e18fe['stack']);if(_0x2e18fe[_0xff82('0x23')]){delete _0x2e18fe[_0xff82('0x23')];}_0x2cd679[_0xff82('0x17')](_0xe9744b)['send'](_0x2e18fe);};}exports[_0xff82('0x24')]=function(_0x1d34e7,_0x1e045f){var _0x22e4e7={},_0x19b499={},_0x5ab8c1={'count':0x0,'rows':[]};var _0xc0c311=_[_0xff82('0x25')](db[_0xff82('0x26')][_0xff82('0x27')],function(_0x5207f6){return{'name':_0x5207f6[_0xff82('0x28')],'type':_0x5207f6['type'][_0xff82('0x29')]};});_0x19b499['model']=_[_0xff82('0x25')](_0xc0c311,_0xff82('0x23'));_0x19b499[_0xff82('0x2a')]=_['keys'](_0x1d34e7[_0xff82('0x2a')]);_0x19b499['filters']=_['intersection'](_0x19b499['model'],_0x19b499[_0xff82('0x2a')]);_0x22e4e7[_0xff82('0x2b')]=_[_0xff82('0x2c')](_0x19b499[_0xff82('0x2d')],qs['fields'](_0x1d34e7[_0xff82('0x2a')][_0xff82('0x2e')]));_0x22e4e7[_0xff82('0x2b')]=_0x22e4e7[_0xff82('0x2b')]['length']?_0x22e4e7[_0xff82('0x2b')]:_0x19b499[_0xff82('0x2d')];if(!_0x1d34e7[_0xff82('0x2a')]['hasOwnProperty'](_0xff82('0x2f'))){_0x22e4e7[_0xff82('0x1c')]=qs[_0xff82('0x1c')](_0x1d34e7[_0xff82('0x2a')][_0xff82('0x1c')]);_0x22e4e7[_0xff82('0x1a')]=qs[_0xff82('0x1a')](_0x1d34e7['query'][_0xff82('0x1a')]);}_0x22e4e7[_0xff82('0x30')]=qs['sort'](_0x1d34e7[_0xff82('0x2a')][_0xff82('0x31')]);_0x22e4e7[_0xff82('0x32')]=qs[_0xff82('0x33')](_[_0xff82('0x34')](_0x1d34e7['query'],_0x19b499[_0xff82('0x33')]),_0xc0c311);if(_0x1d34e7[_0xff82('0x2a')]['filter']){_0x22e4e7['where']=_[_0xff82('0x35')](_0x22e4e7[_0xff82('0x32')],{'$or':_[_0xff82('0x25')](_0xc0c311,function(_0x5c7479){if(_0x5c7479[_0xff82('0x36')]!==_0xff82('0x37')){var _0x26c088={};_0x26c088[_0x5c7479['name']]={'$like':'%'+_0x1d34e7[_0xff82('0x2a')]['filter']+'%'};return _0x26c088;}})});}_0x22e4e7=_[_0xff82('0x35')]({},_0x22e4e7,_0x1d34e7[_0xff82('0x38')]);var _0x1f31f0={'where':_0x22e4e7[_0xff82('0x32')]};return db['SquareOdbc'][_0xff82('0x1d')](_0x1f31f0)[_0xff82('0x1e')](function(_0x3e265c){_0x5ab8c1[_0xff82('0x1d')]=_0x3e265c;if(_0x1d34e7[_0xff82('0x2a')]['includeAll']){_0x22e4e7[_0xff82('0x39')]=[{'all':!![]}];}return db[_0xff82('0x26')]['findAll'](_0x22e4e7);})['then'](function(_0x53b06a){_0x5ab8c1[_0xff82('0x3a')]=_0x53b06a;return _0x5ab8c1;})['then'](respondWithFilteredResult(_0x1e045f,_0x22e4e7))[_0xff82('0x3b')](handleError(_0x1e045f,null));};exports[_0xff82('0x3c')]=function(_0x47dd74,_0x21418e){var _0x26c495={'raw':!![],'where':{'id':_0x47dd74[_0xff82('0x3d')]['id']}},_0x40ee48={};_0x40ee48['model']=_[_0xff82('0x3e')](db['SquareOdbc'][_0xff82('0x27')]);_0x40ee48[_0xff82('0x2a')]=_['keys'](_0x47dd74['query']);_0x40ee48[_0xff82('0x33')]=_[_0xff82('0x2c')](_0x40ee48['model'],_0x40ee48['query']);_0x26c495[_0xff82('0x2b')]=_[_0xff82('0x2c')](_0x40ee48['model'],qs[_0xff82('0x2e')](_0x47dd74[_0xff82('0x2a')][_0xff82('0x2e')]));_0x26c495[_0xff82('0x2b')]=_0x26c495[_0xff82('0x2b')][_0xff82('0x3f')]?_0x26c495[_0xff82('0x2b')]:_0x40ee48[_0xff82('0x2d')];if(_0x47dd74['query'][_0xff82('0x40')]){_0x26c495['include']=[{'all':!![]}];}_0x26c495=_[_0xff82('0x35')]({},_0x26c495,_0x47dd74[_0xff82('0x38')]);return db[_0xff82('0x26')][_0xff82('0x41')](_0x26c495)[_0xff82('0x1e')](handleEntityNotFound(_0x21418e,null))[_0xff82('0x1e')](respondWithResult(_0x21418e,null))[_0xff82('0x3b')](handleError(_0x21418e,null));};exports[_0xff82('0x42')]=function(_0x23dc15,_0x5c459a){return db[_0xff82('0x26')][_0xff82('0x42')](_0x23dc15[_0xff82('0x43')],{})[_0xff82('0x1e')](function(_0x315ffb){var _0x3d54aa=_0x23dc15['user'][_0xff82('0x44')]({'plain':!![]});if(!_0x3d54aa)throw new Error(_0xff82('0x45'));if(_0x3d54aa['role']===_0xff82('0x46')){var _0x298f2d=_0x315ffb['get']({'plain':!![]});var _0x45c3f6=_0xff82('0x20');return db[_0xff82('0x47')][_0xff82('0x41')]({'where':{'name':_0x45c3f6,'userProfileId':_0x3d54aa[_0xff82('0x48')]},'raw':!![]})[_0xff82('0x1e')](function(_0x335776){if(_0x335776&&_0x335776['autoAssociation']===0x0){return db[_0xff82('0x21')][_0xff82('0x42')]({'name':_0x298f2d['name'],'resourceId':_0x298f2d['id'],'type':_0x335776['name'],'sectionId':_0x335776['id']},{})[_0xff82('0x1e')](function(){return _0x315ffb;});}else{return _0x315ffb;}})[_0xff82('0x3b')](function(_0x3e19e6){logger[_0xff82('0x22')](_0xff82('0x49'),_0x3e19e6);throw _0x3e19e6;});}return _0x315ffb;})[_0xff82('0x1e')](respondWithResult(_0x5c459a,0xc9))[_0xff82('0x3b')](handleError(_0x5c459a,null));};exports[_0xff82('0x4a')]=function(_0x231424,_0x4c541d){if(_0x231424['body']['id']){delete _0x231424[_0xff82('0x43')]['id'];}return db['SquareOdbc'][_0xff82('0x41')]({'where':{'id':_0x231424[_0xff82('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4c541d,null))[_0xff82('0x1e')](saveUpdates(_0x231424[_0xff82('0x43')],null))[_0xff82('0x1e')](respondWithResult(_0x4c541d,null))[_0xff82('0x3b')](handleError(_0x4c541d,null));};exports[_0xff82('0x1f')]=function(_0x570a5a,_0x487abe){return db['SquareOdbc']['find']({'where':{'id':_0x570a5a['params']['id']}})['then'](handleEntityNotFound(_0x487abe,null))[_0xff82('0x1e')](removeEntity(_0x487abe,null))[_0xff82('0x3b')](handleError(_0x487abe,null));};exports[_0xff82('0x4b')]=function(_0x4a0da8,_0x56f8d6,_0x378681){var _0xf63954;return db[_0xff82('0x26')][_0xff82('0x41')]({'where':{'id':_0x4a0da8[_0xff82('0x3d')]['id']},'attributes':['id',_0xff82('0x4c')]})['then'](handleEntityNotFound(_0x56f8d6,null))[_0xff82('0x1e')](function(_0x1bdef7){if(_0x1bdef7){var _0x56fdb4=require(_0xff82('0x4d'))();_0x56fdb4['openSync'](_0x1bdef7[_0xff82('0x4c')]);_0x56fdb4[_0xff82('0x4e')]();return _0x1bdef7;}})[_0xff82('0x1e')](respondWithResult(_0x56f8d6,null))['catch'](handleError(_0x56f8d6,null));}; \ No newline at end of file +var _0x473e=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','params','includeAll','include','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','ODBC','UserProfileResource','sendStatus','error','name','send','SquareOdbc','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model'];(function(_0x186c1b,_0x293b73){var _0x15bfe2=function(_0x453ed1){while(--_0x453ed1){_0x186c1b['push'](_0x186c1b['shift']());}};_0x15bfe2(++_0x293b73);}(_0x473e,0x77));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe473('0x0'));var rimraf=require(_0xe473('0x1'));var zipdir=require(_0xe473('0x2'));var jsonpatch=require(_0xe473('0x3'));var rp=require(_0xe473('0x4'));var moment=require(_0xe473('0x5'));var BPromise=require(_0xe473('0x6'));var Mustache=require(_0xe473('0x7'));var util=require(_0xe473('0x8'));var path=require('path');var sox=require(_0xe473('0x9'));var csv=require(_0xe473('0xa'));var ejs=require(_0xe473('0xb'));var fs=require('fs');var fs_extra=require(_0xe473('0xc'));var _=require(_0xe473('0xd'));var squel=require(_0xe473('0xe'));var crypto=require(_0xe473('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe473('0x10'));var toCsv=require(_0xe473('0xa'));var querystring=require(_0xe473('0x11'));var Papa=require(_0xe473('0x12'));var Redis=require(_0xe473('0x13'));var authService=require(_0xe473('0x14'));var qs=require(_0xe473('0x15'));var as=require(_0xe473('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe473('0x17'))('api');var utils=require(_0xe473('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe473('0x19'));var db=require(_0xe473('0x1a'))['db'];function respondWithStatusCode(_0x2253c3,_0x5a4635){_0x5a4635=_0x5a4635||0xcc;return function(_0x2f071d){if(_0x2f071d){return _0x2253c3['sendStatus'](_0x5a4635);}return _0x2253c3[_0xe473('0x1b')](_0x5a4635)[_0xe473('0x1c')]();};}function respondWithResult(_0x2e2106,_0x344068){_0x344068=_0x344068||0xc8;return function(_0x11b982){if(_0x11b982){return _0x2e2106[_0xe473('0x1b')](_0x344068)[_0xe473('0x1d')](_0x11b982);}};}function respondWithFilteredResult(_0x4b841b,_0x34a1c5){return function(_0x371cea){if(_0x371cea){var _0x4d9eb2=typeof _0x34a1c5[_0xe473('0x1e')]===_0xe473('0x1f')&&typeof _0x34a1c5[_0xe473('0x20')]===_0xe473('0x1f');var _0x224a0f=_0x371cea[_0xe473('0x21')];var _0x4e5d66=_0x4d9eb2?0x0:_0x34a1c5['offset'];var _0x4b4fb8=_0x4d9eb2?_0x371cea[_0xe473('0x21')]:_0x34a1c5['offset']+_0x34a1c5[_0xe473('0x20')];var _0x58201c;if(_0x4b4fb8>=_0x224a0f){_0x4b4fb8=_0x224a0f;_0x58201c=0xc8;}else{_0x58201c=0xce;}_0x4b841b[_0xe473('0x1b')](_0x58201c);return _0x4b841b['set'](_0xe473('0x22'),_0x4e5d66+'-'+_0x4b4fb8+'/'+_0x224a0f)[_0xe473('0x1d')](_0x371cea);}return null;};}function patchUpdates(_0x6034b0){return function(_0x35f8ca){try{jsonpatch['apply'](_0x35f8ca,_0x6034b0,!![]);}catch(_0x2fd2e8){return BPromise[_0xe473('0x23')](_0x2fd2e8);}return _0x35f8ca[_0xe473('0x24')]();};}function saveUpdates(_0x435555,_0xd735ff){return function(_0x41a857){if(_0x41a857){return _0x41a857[_0xe473('0x25')](_0x435555)[_0xe473('0x26')](function(_0x4dec7f){return _0x4dec7f;});}return null;};}function removeEntity(_0x43d862,_0x3f036b){return function(_0x181561){if(_0x181561){return _0x181561[_0xe473('0x27')]()[_0xe473('0x26')](function(){var _0x188f3c=_0x181561['get']({'plain':!![]});var _0x23afa9=_0xe473('0x28');return db[_0xe473('0x29')]['destroy']({'where':{'type':_0x23afa9,'resourceId':_0x188f3c['id']}})[_0xe473('0x26')](function(){return _0x181561;});})[_0xe473('0x26')](function(){_0x43d862[_0xe473('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7bca51,_0x1532a4){return function(_0x47ec5a){if(!_0x47ec5a){_0x7bca51[_0xe473('0x2a')](0x194);}return _0x47ec5a;};}function handleError(_0x517c3f,_0xd350b3){_0xd350b3=_0xd350b3||0x1f4;return function(_0x37a8a3){logger[_0xe473('0x2b')](_0x37a8a3['stack']);if(_0x37a8a3[_0xe473('0x2c')]){delete _0x37a8a3[_0xe473('0x2c')];}_0x517c3f[_0xe473('0x1b')](_0xd350b3)[_0xe473('0x2d')](_0x37a8a3);};}exports['index']=function(_0x16bb4c,_0x356610){var _0x13c844={},_0x13becb={},_0x54fe97={'count':0x0,'rows':[]};var _0x28a5fb=_['map'](db[_0xe473('0x2e')][_0xe473('0x2f')],function(_0x8f30d3){return{'name':_0x8f30d3[_0xe473('0x30')],'type':_0x8f30d3[_0xe473('0x31')][_0xe473('0x32')]};});_0x13becb['model']=_[_0xe473('0x33')](_0x28a5fb,_0xe473('0x2c'));_0x13becb[_0xe473('0x34')]=_[_0xe473('0x35')](_0x16bb4c[_0xe473('0x34')]);_0x13becb[_0xe473('0x36')]=_[_0xe473('0x37')](_0x13becb[_0xe473('0x38')],_0x13becb[_0xe473('0x34')]);_0x13c844['attributes']=_[_0xe473('0x37')](_0x13becb[_0xe473('0x38')],qs[_0xe473('0x39')](_0x16bb4c[_0xe473('0x34')][_0xe473('0x39')]));_0x13c844[_0xe473('0x3a')]=_0x13c844[_0xe473('0x3a')][_0xe473('0x3b')]?_0x13c844[_0xe473('0x3a')]:_0x13becb['model'];if(!_0x16bb4c[_0xe473('0x34')][_0xe473('0x3c')](_0xe473('0x3d'))){_0x13c844[_0xe473('0x20')]=qs[_0xe473('0x20')](_0x16bb4c[_0xe473('0x34')][_0xe473('0x20')]);_0x13c844[_0xe473('0x1e')]=qs[_0xe473('0x1e')](_0x16bb4c['query'][_0xe473('0x1e')]);}_0x13c844[_0xe473('0x3e')]=qs[_0xe473('0x3f')](_0x16bb4c['query'][_0xe473('0x3f')]);_0x13c844[_0xe473('0x40')]=qs[_0xe473('0x36')](_[_0xe473('0x41')](_0x16bb4c[_0xe473('0x34')],_0x13becb['filters']),_0x28a5fb);if(_0x16bb4c[_0xe473('0x34')][_0xe473('0x42')]){_0x13c844['where']=_[_0xe473('0x43')](_0x13c844['where'],{'$or':_[_0xe473('0x33')](_0x28a5fb,function(_0x4dd51c){if(_0x4dd51c[_0xe473('0x31')]!=='VIRTUAL'){var _0x5646e4={};_0x5646e4[_0x4dd51c[_0xe473('0x2c')]]={'$like':'%'+_0x16bb4c[_0xe473('0x34')][_0xe473('0x42')]+'%'};return _0x5646e4;}})});}_0x13c844=_[_0xe473('0x43')]({},_0x13c844,_0x16bb4c[_0xe473('0x44')]);var _0x10ab27={'where':_0x13c844['where']};return db[_0xe473('0x2e')]['count'](_0x10ab27)[_0xe473('0x26')](function(_0x3d5003){_0x54fe97[_0xe473('0x21')]=_0x3d5003;if(_0x16bb4c['query']['includeAll']){_0x13c844['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xe473('0x45')](_0x13c844);})[_0xe473('0x26')](function(_0x375116){_0x54fe97['rows']=_0x375116;return _0x54fe97;})[_0xe473('0x26')](respondWithFilteredResult(_0x356610,_0x13c844))[_0xe473('0x46')](handleError(_0x356610,null));};exports['show']=function(_0x479438,_0x4d2587){var _0x2da3cd={'raw':!![],'where':{'id':_0x479438[_0xe473('0x47')]['id']}},_0x2895fc={};_0x2895fc[_0xe473('0x38')]=_[_0xe473('0x35')](db['SquareOdbc']['rawAttributes']);_0x2895fc[_0xe473('0x34')]=_[_0xe473('0x35')](_0x479438[_0xe473('0x34')]);_0x2895fc[_0xe473('0x36')]=_[_0xe473('0x37')](_0x2895fc[_0xe473('0x38')],_0x2895fc[_0xe473('0x34')]);_0x2da3cd[_0xe473('0x3a')]=_['intersection'](_0x2895fc['model'],qs[_0xe473('0x39')](_0x479438['query'][_0xe473('0x39')]));_0x2da3cd['attributes']=_0x2da3cd[_0xe473('0x3a')][_0xe473('0x3b')]?_0x2da3cd[_0xe473('0x3a')]:_0x2895fc[_0xe473('0x38')];if(_0x479438[_0xe473('0x34')][_0xe473('0x48')]){_0x2da3cd[_0xe473('0x49')]=[{'all':!![]}];}_0x2da3cd=_[_0xe473('0x43')]({},_0x2da3cd,_0x479438[_0xe473('0x44')]);return db[_0xe473('0x2e')]['find'](_0x2da3cd)[_0xe473('0x26')](handleEntityNotFound(_0x4d2587,null))[_0xe473('0x26')](respondWithResult(_0x4d2587,null))[_0xe473('0x46')](handleError(_0x4d2587,null));};exports['create']=function(_0x56a587,_0x1b69d0){return db[_0xe473('0x2e')]['create'](_0x56a587[_0xe473('0x4a')],{})['then'](function(_0x21e105){var _0x352fee=_0x56a587[_0xe473('0x4b')][_0xe473('0x4c')]({'plain':!![]});if(!_0x352fee)throw new Error(_0xe473('0x4d'));if(_0x352fee[_0xe473('0x4e')]==='user'){var _0x3f02d0=_0x21e105[_0xe473('0x4c')]({'plain':!![]});var _0x2c93ad=_0xe473('0x28');return db[_0xe473('0x4f')][_0xe473('0x50')]({'where':{'name':_0x2c93ad,'userProfileId':_0x352fee['userProfileId']},'raw':!![]})[_0xe473('0x26')](function(_0x21bef1){if(_0x21bef1&&_0x21bef1[_0xe473('0x51')]===0x0){return db['UserProfileResource'][_0xe473('0x52')]({'name':_0x3f02d0[_0xe473('0x2c')],'resourceId':_0x3f02d0['id'],'type':_0x21bef1[_0xe473('0x2c')],'sectionId':_0x21bef1['id']},{})[_0xe473('0x26')](function(){return _0x21e105;});}else{return _0x21e105;}})[_0xe473('0x46')](function(_0x5a8529){logger[_0xe473('0x2b')](_0xe473('0x53'),_0x5a8529);throw _0x5a8529;});}return _0x21e105;})['then'](respondWithResult(_0x1b69d0,0xc9))['catch'](handleError(_0x1b69d0,null));};exports[_0xe473('0x25')]=function(_0x9e6087,_0x274719){if(_0x9e6087[_0xe473('0x4a')]['id']){delete _0x9e6087['body']['id'];}return db[_0xe473('0x2e')][_0xe473('0x50')]({'where':{'id':_0x9e6087[_0xe473('0x47')]['id']}})[_0xe473('0x26')](handleEntityNotFound(_0x274719,null))[_0xe473('0x26')](saveUpdates(_0x9e6087[_0xe473('0x4a')],null))[_0xe473('0x26')](respondWithResult(_0x274719,null))[_0xe473('0x46')](handleError(_0x274719,null));};exports[_0xe473('0x27')]=function(_0x900524,_0x2461e2){return db['SquareOdbc'][_0xe473('0x50')]({'where':{'id':_0x900524[_0xe473('0x47')]['id']}})[_0xe473('0x26')](handleEntityNotFound(_0x2461e2,null))[_0xe473('0x26')](removeEntity(_0x2461e2,null))[_0xe473('0x46')](handleError(_0x2461e2,null));};exports[_0xe473('0x54')]=function(_0x21f0b5,_0x3dab47,_0x36f8bf){var _0x124def;return db[_0xe473('0x2e')][_0xe473('0x50')]({'where':{'id':_0x21f0b5[_0xe473('0x47')]['id']},'attributes':['id',_0xe473('0x55')]})[_0xe473('0x26')](handleEntityNotFound(_0x3dab47,null))['then'](function(_0x3e820d){if(_0x3e820d){var _0x99377d=require('odbc')();_0x99377d[_0xe473('0x56')](_0x3e820d[_0xe473('0x55')]);_0x99377d[_0xe473('0x57')]();return _0x3e820d;}})['then'](respondWithResult(_0x3dab47,null))['catch'](handleError(_0x3dab47,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bcfb1e5..88ddc44 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 _0x8caf=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x8caf,0x110));var _0xf8ca=function(_0x4d6e55,_0x59afcc){_0x4d6e55=_0x4d6e55-0x0;var _0x2184c6=_0x8caf[_0x4d6e55];return _0x2184c6;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var logger=require(_0xf8ca('0x1'))(_0xf8ca('0x2'));var moment=require(_0xf8ca('0x3'));var BPromise=require(_0xf8ca('0x4'));var rp=require(_0xf8ca('0x5'));var fs=require('fs');var path=require(_0xf8ca('0x6'));var rimraf=require(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var attributes=require(_0xf8ca('0x9'));module[_0xf8ca('0xa')]=function(_0x4af48d,_0xfbc9e2){return _0x4af48d[_0xf8ca('0xb')](_0xf8ca('0xc'),attributes,{'tableName':_0xf8ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x496a=['api','moment','path','rimraf','exports','square_odbc','lodash','../../config/logger'];(function(_0xdb4e73,_0x30b446){var _0x4578b4=function(_0x119eb5){while(--_0x119eb5){_0xdb4e73['push'](_0xdb4e73['shift']());}};_0x4578b4(++_0x30b446);}(_0x496a,0x96));var _0xa496=function(_0x4554bc,_0x4ec379){_0x4554bc=_0x4554bc-0x0;var _0x23a820=_0x496a[_0x4554bc];return _0x23a820;};'use strict';var _=require(_0xa496('0x0'));var util=require('util');var logger=require(_0xa496('0x1'))(_0xa496('0x2'));var moment=require(_0xa496('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa496('0x4'));var rimraf=require(_0xa496('0x5'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0xa496('0x6')]=function(_0x45283a,_0x16eb93){return _0x45283a['define']('SquareOdbc',attributes,{'tableName':_0xa496('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 9d6adf2..11f7f00 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 _0x23c5=['debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareOdbc','SquareOdbc','raw','options','where','attributes','include','map','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x2e4300,_0x239e27){var _0x2e2e05=function(_0x299c34){while(--_0x299c34){_0x2e4300['push'](_0x2e4300['shift']());}};_0x2e2e05(++_0x239e27);}(_0x23c5,0x91));var _0x523c=function(_0x2a9cc4,_0x6a0306){_0x2a9cc4=_0x2a9cc4-0x0;var _0x1005a8=_0x23c5[_0x2a9cc4];return _0x1005a8;};'use strict';var _=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var moment=require(_0x523c('0x2'));var BPromise=require(_0x523c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x523c('0x4'));var db=require(_0x523c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x523c('0x6'))(_0x523c('0x7'));var config=require(_0x523c('0x8'));var jayson=require(_0x523c('0x9'));var client=jayson[_0x523c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd4db7f,_0x43fa52,_0x31645f){return new BPromise(function(_0x4382a3,_0x10ec4e){return client[_0x523c('0xb')](_0xd4db7f,_0x31645f)['then'](function(_0xf1749f){logger[_0x523c('0xc')](_0x523c('0xd'),_0x43fa52,_0x523c('0xe'));logger[_0x523c('0xf')](_0x523c('0x10'),_0x43fa52,_0x523c('0xe'),JSON[_0x523c('0x11')](_0xf1749f));if(_0xf1749f[_0x523c('0x12')]){if(_0xf1749f['error']['code']===0x1f4){logger[_0x523c('0x12')](_0x523c('0xd'),_0x43fa52,_0xf1749f[_0x523c('0x12')][_0x523c('0x13')]);return _0x10ec4e(_0xf1749f[_0x523c('0x12')][_0x523c('0x13')]);}logger['error'](_0x523c('0xd'),_0x43fa52,_0xf1749f[_0x523c('0x12')]['message']);return _0x4382a3(_0xf1749f[_0x523c('0x12')][_0x523c('0x13')]);}else{logger['info'](_0x523c('0xd'),_0x43fa52,'request\x20sent');_0x4382a3(_0xf1749f[_0x523c('0x14')]['message']);}})[_0x523c('0x15')](function(_0x2f047c){logger[_0x523c('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x43fa52,_0x2f047c);_0x10ec4e(_0x2f047c);});});}exports[_0x523c('0x16')]=function(_0x5f4bbc){var _0x35cf90=this;return new Promise(function(_0x3d5f6c,_0x2bbb02){return db[_0x523c('0x17')]['find']({'raw':_0x5f4bbc['options']?_0x5f4bbc['options'][_0x523c('0x18')]===undefined?!![]:![]:!![],'where':_0x5f4bbc[_0x523c('0x19')]?_0x5f4bbc[_0x523c('0x19')][_0x523c('0x1a')]||null:null,'attributes':_0x5f4bbc['options']?_0x5f4bbc[_0x523c('0x19')][_0x523c('0x1b')]||null:null,'include':_0x5f4bbc[_0x523c('0x19')]?_0x5f4bbc[_0x523c('0x19')][_0x523c('0x1c')]?_[_0x523c('0x1d')](_0x5f4bbc[_0x523c('0x19')][_0x523c('0x1c')],function(_0x1af2b8){return{'model':db[_0x1af2b8[_0x523c('0x1e')]],'as':_0x1af2b8['as'],'attributes':_0x1af2b8['attributes'],'include':_0x1af2b8[_0x523c('0x1c')]?_[_0x523c('0x1d')](_0x1af2b8[_0x523c('0x1c')],function(_0x3c1b1b){return{'model':db[_0x3c1b1b[_0x523c('0x1e')]],'as':_0x3c1b1b['as'],'attributes':_0x3c1b1b[_0x523c('0x1b')],'include':_0x3c1b1b['include']?_[_0x523c('0x1d')](_0x3c1b1b[_0x523c('0x1c')],function(_0x137236){return{'model':db[_0x137236['model']],'as':_0x137236['as'],'attributes':_0x137236[_0x523c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x523c('0x1f')](function(_0x2c42c6){logger[_0x523c('0xc')](_0x523c('0x16'),_0x5f4bbc);logger[_0x523c('0xf')](_0x523c('0x16'),_0x5f4bbc,JSON[_0x523c('0x11')](_0x2c42c6));_0x3d5f6c(_0x2c42c6);})[_0x523c('0x15')](function(_0x4d6ac2){logger[_0x523c('0x12')](_0x523c('0x16'),_0x4d6ac2[_0x523c('0x13')],_0x5f4bbc);_0x2bbb02(_0x35cf90[_0x523c('0x12')](0x1f4,_0x4d6ac2['message']));});});}; \ No newline at end of file +var _0x4009=['client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSquareOdbc','find','options','raw','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x4009,0x1d5));var _0x9400=function(_0x157ee6,_0x1edf7c){_0x157ee6=_0x157ee6-0x0;var _0x4915af=_0x4009[_0x157ee6];return _0x4915af;};'use strict';var _=require(_0x9400('0x0'));var util=require(_0x9400('0x1'));var moment=require(_0x9400('0x2'));var BPromise=require(_0x9400('0x3'));var rs=require(_0x9400('0x4'));var fs=require('fs');var Redis=require(_0x9400('0x5'));var db=require(_0x9400('0x6'))['db'];var utils=require(_0x9400('0x7'));var logger=require(_0x9400('0x8'))(_0x9400('0x9'));var config=require('../../config/environment');var jayson=require(_0x9400('0xa'));var client=jayson[_0x9400('0xb')][_0x9400('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d73aa,_0x52a353,_0x1eb298){return new BPromise(function(_0x41501,_0x187c99){return client[_0x9400('0xd')](_0x5d73aa,_0x1eb298)[_0x9400('0xe')](function(_0x108d1c){logger[_0x9400('0xf')](_0x9400('0x10'),_0x52a353,_0x9400('0x11'));logger['debug'](_0x9400('0x12'),_0x52a353,_0x9400('0x11'),JSON['stringify'](_0x108d1c));if(_0x108d1c[_0x9400('0x13')]){if(_0x108d1c['error'][_0x9400('0x14')]===0x1f4){logger[_0x9400('0x13')](_0x9400('0x10'),_0x52a353,_0x108d1c['error'][_0x9400('0x15')]);return _0x187c99(_0x108d1c[_0x9400('0x13')][_0x9400('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x52a353,_0x108d1c[_0x9400('0x13')][_0x9400('0x15')]);return _0x41501(_0x108d1c[_0x9400('0x13')][_0x9400('0x15')]);}else{logger[_0x9400('0xf')](_0x9400('0x10'),_0x52a353,_0x9400('0x11'));_0x41501(_0x108d1c[_0x9400('0x16')]['message']);}})['catch'](function(_0x434453){logger[_0x9400('0x13')](_0x9400('0x10'),_0x52a353,_0x434453);_0x187c99(_0x434453);});});}exports[_0x9400('0x17')]=function(_0x54510a){var _0x27bcbd=this;return new Promise(function(_0xb11e93,_0x444316){return db['SquareOdbc'][_0x9400('0x18')]({'raw':_0x54510a[_0x9400('0x19')]?_0x54510a['options'][_0x9400('0x1a')]===undefined?!![]:![]:!![],'where':_0x54510a['options']?_0x54510a['options']['where']||null:null,'attributes':_0x54510a[_0x9400('0x19')]?_0x54510a['options']['attributes']||null:null,'include':_0x54510a[_0x9400('0x19')]?_0x54510a[_0x9400('0x19')][_0x9400('0x1b')]?_[_0x9400('0x1c')](_0x54510a[_0x9400('0x19')][_0x9400('0x1b')],function(_0x40685e){return{'model':db[_0x40685e[_0x9400('0x1d')]],'as':_0x40685e['as'],'attributes':_0x40685e['attributes'],'include':_0x40685e[_0x9400('0x1b')]?_[_0x9400('0x1c')](_0x40685e[_0x9400('0x1b')],function(_0x18f702){return{'model':db[_0x18f702[_0x9400('0x1d')]],'as':_0x18f702['as'],'attributes':_0x18f702[_0x9400('0x1e')],'include':_0x18f702[_0x9400('0x1b')]?_[_0x9400('0x1c')](_0x18f702['include'],function(_0xfe3d54){return{'model':db[_0xfe3d54[_0x9400('0x1d')]],'as':_0xfe3d54['as'],'attributes':_0xfe3d54[_0x9400('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x161013){logger['info'](_0x9400('0x17'),_0x54510a);logger['debug'](_0x9400('0x17'),_0x54510a,JSON[_0x9400('0x1f')](_0x161013));_0xb11e93(_0x161013);})['catch'](function(_0x240eb5){logger[_0x9400('0x13')](_0x9400('0x17'),_0x240eb5[_0x9400('0x15')],_0x54510a);_0x444316(_0x27bcbd[_0x9400('0x13')](0x1f4,_0x240eb5[_0x9400('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e064196..af0415c 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 _0xa88f=['create','put','/:id','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','show','/:id/users','post'];(function(_0x54b91c,_0x5e727d){var _0x141d88=function(_0x275aed){while(--_0x275aed){_0x54b91c['push'](_0x54b91c['shift']());}};_0x141d88(++_0x5e727d);}(_0xa88f,0x182));var _0xfa88=function(_0x5e3a44,_0x33cf4d){_0x5e3a44=_0x5e3a44-0x0;var _0x220cc0=_0xa88f[_0x5e3a44];return _0x220cc0;};'use strict';var multer=require(_0xfa88('0x0'));var util=require(_0xfa88('0x1'));var path=require(_0xfa88('0x2'));var timeout=require(_0xfa88('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfa88('0x4'));var auth=require(_0xfa88('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa88('0x6'));var controller=require(_0xfa88('0x7'));router[_0xfa88('0x8')]('/',auth[_0xfa88('0x9')](),controller['index']);router['get']('/:id',auth[_0xfa88('0x9')](),controller[_0xfa88('0xa')]);router[_0xfa88('0x8')](_0xfa88('0xb'),auth['isAuthenticated'](),controller['getUsers']);router[_0xfa88('0xc')]('/',auth[_0xfa88('0x9')](),controller[_0xfa88('0xd')]);router['post'](_0xfa88('0xb'),auth[_0xfa88('0x9')](),controller['addUsers']);router[_0xfa88('0xe')](_0xfa88('0xf'),auth[_0xfa88('0x9')](),controller[_0xfa88('0x10')]);router[_0xfa88('0x11')](_0xfa88('0xf'),auth['isAuthenticated'](),controller[_0xfa88('0x12')]);router['delete'](_0xfa88('0xb'),auth['isAuthenticated'](),controller[_0xfa88('0x13')]);module[_0xfa88('0x14')]=router; \ No newline at end of file +var _0x0447=['removeUsers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','put','delete','/:id','destroy'];(function(_0x1504b8,_0x48980d){var _0x1b2f16=function(_0x13ee7a){while(--_0x13ee7a){_0x1504b8['push'](_0x1504b8['shift']());}};_0x1b2f16(++_0x48980d);}(_0x0447,0x8b));var _0x7044=function(_0x509e05,_0x23c205){_0x509e05=_0x509e05-0x0;var _0x2adacf=_0x0447[_0x509e05];return _0x2adacf;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express['Router']();var fs_extra=require(_0x7044('0x5'));var auth=require(_0x7044('0x6'));var interaction=require(_0x7044('0x7'));var config=require(_0x7044('0x8'));var controller=require(_0x7044('0x9'));router[_0x7044('0xa')]('/',auth[_0x7044('0xb')](),controller[_0x7044('0xc')]);router[_0x7044('0xa')]('/:id',auth[_0x7044('0xb')](),controller[_0x7044('0xd')]);router[_0x7044('0xa')](_0x7044('0xe'),auth['isAuthenticated'](),controller[_0x7044('0xf')]);router[_0x7044('0x10')]('/',auth['isAuthenticated'](),controller[_0x7044('0x11')]);router[_0x7044('0x10')](_0x7044('0xe'),auth[_0x7044('0xb')](),controller['addUsers']);router[_0x7044('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7044('0x13')](_0x7044('0x14'),auth[_0x7044('0xb')](),controller[_0x7044('0x15')]);router['delete']('/:id/users',auth[_0x7044('0xb')](),controller[_0x7044('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index f32b871..ea00ae0 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 _0xf590=['TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE','sequelize','STRING'];(function(_0x395bd8,_0x28d18a){var _0xa47af=function(_0x10b354){while(--_0x10b354){_0x395bd8['push'](_0x395bd8['shift']());}};_0xa47af(++_0x28d18a);}(_0xf590,0x1e2));var _0x0f59=function(_0x40f31d,_0x166318){_0x40f31d=_0x40f31d-0x0;var _0x10d4e4=_0xf590[_0x40f31d];return _0x10d4e4;};'use strict';var Sequelize=require(_0x0f59('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f59('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0f59('0x1')]},'notes':{'type':Sequelize[_0x0f59('0x2')]},'preproduction':{'type':Sequelize[_0x0f59('0x3')](_0x0f59('0x4')),'get':function(){if(this[_0x0f59('0x5')](_0x0f59('0x6'))){return this[_0x0f59('0x5')](_0x0f59('0x6'))['toString'](_0x0f59('0x7'));}}},'production':{'type':Sequelize[_0x0f59('0x3')](_0x0f59('0x4')),'get':function(){if(this['getDataValue'](_0x0f59('0x8'))){return this[_0x0f59('0x5')]('production')[_0x0f59('0x9')](_0x0f59('0x7'));}}},'savedAt':{'type':Sequelize[_0x0f59('0xa')]},'publishedAt':{'type':Sequelize[_0x0f59('0xa')]}}; \ No newline at end of file +var _0xe0c9=['TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8','DATE','exports','name','STRING'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe0c9,0x1e9));var _0x9e0c=function(_0x458bfe,_0x59159b){_0x458bfe=_0x458bfe-0x0;var _0x483aab=_0xe0c9[_0x458bfe];return _0x483aab;};'use strict';var Sequelize=require('sequelize');module[_0x9e0c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9e0c('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x9e0c('0x2')]},'notes':{'type':Sequelize[_0x9e0c('0x3')]},'preproduction':{'type':Sequelize[_0x9e0c('0x4')](_0x9e0c('0x5')),'get':function(){if(this[_0x9e0c('0x6')](_0x9e0c('0x7'))){return this[_0x9e0c('0x6')](_0x9e0c('0x7'))[_0x9e0c('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x9e0c('0x4')](_0x9e0c('0x5')),'get':function(){if(this[_0x9e0c('0x6')](_0x9e0c('0x9'))){return this[_0x9e0c('0x6')](_0x9e0c('0x9'))['toString'](_0x9e0c('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x9e0c('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 15eb6c7..ce3ae83 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 _0xc4d8=['SquareProjects','UserProfileResource','error','name','index','map','SquareProject','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','update','body','addUsers','ids','omit','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','./squareProject.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xc4d8,0x198));var _0x8c4d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xc4d8[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0x8c4d('0x0'));var rimraf=require(_0x8c4d('0x1'));var zipdir=require(_0x8c4d('0x2'));var jsonpatch=require(_0x8c4d('0x3'));var rp=require('request-promise');var moment=require(_0x8c4d('0x4'));var BPromise=require(_0x8c4d('0x5'));var Mustache=require(_0x8c4d('0x6'));var util=require('util');var path=require(_0x8c4d('0x7'));var sox=require(_0x8c4d('0x8'));var csv=require(_0x8c4d('0x9'));var ejs=require(_0x8c4d('0xa'));var fs=require('fs');var fs_extra=require(_0x8c4d('0xb'));var _=require(_0x8c4d('0xc'));var squel=require(_0x8c4d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c4d('0xe'));var toCsv=require(_0x8c4d('0x9'));var querystring=require('querystring');var Papa=require(_0x8c4d('0xf'));var Redis=require(_0x8c4d('0x10'));var authService=require(_0x8c4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8c4d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c4d('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8c4d('0x14'));var db=require(_0x8c4d('0x15'))['db'];config['redis']=_['defaults'](config[_0x8c4d('0x16')],{'host':_0x8c4d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8c4d('0x18'))[_0x8c4d('0x19')](socket);function respondWithStatusCode(_0x53bf43,_0x2b4b50){_0x2b4b50=_0x2b4b50||0xcc;return function(_0x1a1793){if(_0x1a1793){return _0x53bf43[_0x8c4d('0x1a')](_0x2b4b50);}return _0x53bf43[_0x8c4d('0x1b')](_0x2b4b50)[_0x8c4d('0x1c')]();};}function respondWithResult(_0x13920c,_0x501a15){_0x501a15=_0x501a15||0xc8;return function(_0x16a1d7){if(_0x16a1d7){return _0x13920c[_0x8c4d('0x1b')](_0x501a15)['json'](_0x16a1d7);}};}function respondWithFilteredResult(_0x50fe36,_0xc1528e){return function(_0x104603){if(_0x104603){var _0x58d437=typeof _0xc1528e[_0x8c4d('0x1d')]===_0x8c4d('0x1e')&&typeof _0xc1528e[_0x8c4d('0x1f')]===_0x8c4d('0x1e');var _0x39c6c5=_0x104603[_0x8c4d('0x20')];var _0x18b36b=_0x58d437?0x0:_0xc1528e['offset'];var _0x2d1dc3=_0x58d437?_0x104603[_0x8c4d('0x20')]:_0xc1528e[_0x8c4d('0x1d')]+_0xc1528e['limit'];var _0x534bd3;if(_0x2d1dc3>=_0x39c6c5){_0x2d1dc3=_0x39c6c5;_0x534bd3=0xc8;}else{_0x534bd3=0xce;}_0x50fe36[_0x8c4d('0x1b')](_0x534bd3);return _0x50fe36[_0x8c4d('0x21')](_0x8c4d('0x22'),_0x18b36b+'-'+_0x2d1dc3+'/'+_0x39c6c5)[_0x8c4d('0x23')](_0x104603);}return null;};}function patchUpdates(_0x12c6b9){return function(_0x2249d0){try{jsonpatch[_0x8c4d('0x24')](_0x2249d0,_0x12c6b9,!![]);}catch(_0xe721b1){return BPromise[_0x8c4d('0x25')](_0xe721b1);}return _0x2249d0[_0x8c4d('0x26')]();};}function saveUpdates(_0xc5c27e,_0x405f85){return function(_0x159afc){if(_0x159afc){return _0x159afc['update'](_0xc5c27e)[_0x8c4d('0x27')](function(_0x293f7c){return _0x293f7c;});}return null;};}function removeEntity(_0x4d3d70,_0x523e13){return function(_0x1a67bc){if(_0x1a67bc){return _0x1a67bc[_0x8c4d('0x28')]()[_0x8c4d('0x27')](function(){var _0x7dd9e4=_0x1a67bc[_0x8c4d('0x29')]({'plain':!![]});var _0x24aac2=_0x8c4d('0x2a');return db[_0x8c4d('0x2b')]['destroy']({'where':{'type':_0x24aac2,'resourceId':_0x7dd9e4['id']}})[_0x8c4d('0x27')](function(){return _0x1a67bc;});})[_0x8c4d('0x27')](function(){_0x4d3d70[_0x8c4d('0x1b')](0xcc)[_0x8c4d('0x1c')]();});}};}function handleEntityNotFound(_0x47562d,_0x194571){return function(_0x2fb44c){if(!_0x2fb44c){_0x47562d[_0x8c4d('0x1a')](0x194);}return _0x2fb44c;};}function handleError(_0x55ffcf,_0x334330){_0x334330=_0x334330||0x1f4;return function(_0x29b89e){logger[_0x8c4d('0x2c')](_0x29b89e['stack']);if(_0x29b89e['name']){delete _0x29b89e[_0x8c4d('0x2d')];}_0x55ffcf[_0x8c4d('0x1b')](_0x334330)['send'](_0x29b89e);};}exports[_0x8c4d('0x2e')]=function(_0x57b162,_0x111d35){var _0xb4b6a0={},_0x32fb6c={},_0x56cb19={'count':0x0,'rows':[]};var _0x13269d=_[_0x8c4d('0x2f')](db[_0x8c4d('0x30')][_0x8c4d('0x31')],function(_0x31cb05){return{'name':_0x31cb05['fieldName'],'type':_0x31cb05['type'][_0x8c4d('0x32')]};});_0x32fb6c[_0x8c4d('0x33')]=_[_0x8c4d('0x2f')](_0x13269d,_0x8c4d('0x2d'));_0x32fb6c[_0x8c4d('0x34')]=_[_0x8c4d('0x35')](_0x57b162[_0x8c4d('0x34')]);_0x32fb6c['filters']=_[_0x8c4d('0x36')](_0x32fb6c[_0x8c4d('0x33')],_0x32fb6c['query']);_0xb4b6a0[_0x8c4d('0x37')]=_[_0x8c4d('0x36')](_0x32fb6c[_0x8c4d('0x33')],qs[_0x8c4d('0x38')](_0x57b162[_0x8c4d('0x34')][_0x8c4d('0x38')]));_0xb4b6a0[_0x8c4d('0x37')]=_0xb4b6a0[_0x8c4d('0x37')][_0x8c4d('0x39')]?_0xb4b6a0[_0x8c4d('0x37')]:_0x32fb6c[_0x8c4d('0x33')];if(!_0x57b162[_0x8c4d('0x34')]['hasOwnProperty']('nolimit')){_0xb4b6a0['limit']=qs['limit'](_0x57b162['query']['limit']);_0xb4b6a0['offset']=qs[_0x8c4d('0x1d')](_0x57b162[_0x8c4d('0x34')][_0x8c4d('0x1d')]);}_0xb4b6a0[_0x8c4d('0x3a')]=qs[_0x8c4d('0x3b')](_0x57b162[_0x8c4d('0x34')][_0x8c4d('0x3b')]);_0xb4b6a0[_0x8c4d('0x3c')]=qs[_0x8c4d('0x3d')](_[_0x8c4d('0x3e')](_0x57b162[_0x8c4d('0x34')],_0x32fb6c[_0x8c4d('0x3d')]),_0x13269d);if(_0x57b162[_0x8c4d('0x34')][_0x8c4d('0x3f')]){_0xb4b6a0[_0x8c4d('0x3c')]=_[_0x8c4d('0x40')](_0xb4b6a0[_0x8c4d('0x3c')],{'$or':_[_0x8c4d('0x2f')](_0x13269d,function(_0x2d394b){if(_0x2d394b['type']!==_0x8c4d('0x41')){var _0xa75cd8={};_0xa75cd8[_0x2d394b[_0x8c4d('0x2d')]]={'$like':'%'+_0x57b162['query'][_0x8c4d('0x3f')]+'%'};return _0xa75cd8;}})});}_0xb4b6a0=_[_0x8c4d('0x40')]({},_0xb4b6a0,_0x57b162[_0x8c4d('0x42')]);var _0x124660={'where':_0xb4b6a0[_0x8c4d('0x3c')]};return db[_0x8c4d('0x30')][_0x8c4d('0x20')](_0x124660)[_0x8c4d('0x27')](function(_0x474f3d){_0x56cb19[_0x8c4d('0x20')]=_0x474f3d;if(_0x57b162[_0x8c4d('0x34')][_0x8c4d('0x43')]){_0xb4b6a0[_0x8c4d('0x44')]=[{'all':!![]}];}return db[_0x8c4d('0x30')]['findAll'](_0xb4b6a0);})['then'](function(_0x5bf6e4){_0x56cb19[_0x8c4d('0x45')]=_0x5bf6e4;return _0x56cb19;})[_0x8c4d('0x27')](respondWithFilteredResult(_0x111d35,_0xb4b6a0))[_0x8c4d('0x46')](handleError(_0x111d35,null));};exports[_0x8c4d('0x47')]=function(_0x22d689,_0x28bfdc){var _0x2dc226={'raw':![],'where':{'id':_0x22d689[_0x8c4d('0x48')]['id']}},_0x4098e4={};_0x4098e4[_0x8c4d('0x33')]=_[_0x8c4d('0x35')](db[_0x8c4d('0x30')][_0x8c4d('0x31')]);_0x4098e4[_0x8c4d('0x34')]=_[_0x8c4d('0x35')](_0x22d689[_0x8c4d('0x34')]);_0x4098e4['filters']=_[_0x8c4d('0x36')](_0x4098e4[_0x8c4d('0x33')],_0x4098e4['query']);_0x2dc226[_0x8c4d('0x37')]=_['intersection'](_0x4098e4[_0x8c4d('0x33')],qs[_0x8c4d('0x38')](_0x22d689['query']['fields']));_0x2dc226['attributes']=_0x2dc226[_0x8c4d('0x37')]['length']?_0x2dc226['attributes']:_0x4098e4[_0x8c4d('0x33')];if(_0x22d689[_0x8c4d('0x34')][_0x8c4d('0x43')]){_0x2dc226[_0x8c4d('0x44')]=[{'all':!![]}];}_0x2dc226=_[_0x8c4d('0x40')]({},_0x2dc226,_0x22d689[_0x8c4d('0x42')]);return db['SquareProject'][_0x8c4d('0x49')](_0x2dc226)[_0x8c4d('0x27')](handleEntityNotFound(_0x28bfdc,null))[_0x8c4d('0x27')](respondWithResult(_0x28bfdc,null))[_0x8c4d('0x46')](handleError(_0x28bfdc,null));};exports[_0x8c4d('0x4a')]=function(_0x41d5ec,_0x1707dc){return db[_0x8c4d('0x30')]['create'](_0x41d5ec['body'],{})[_0x8c4d('0x27')](function(_0x1e6171){var _0x565449=_0x41d5ec[_0x8c4d('0x4b')][_0x8c4d('0x29')]({'plain':!![]});if(!_0x565449)throw new Error(_0x8c4d('0x4c'));if(_0x565449['role']===_0x8c4d('0x4b')){var _0x139537=_0x1e6171[_0x8c4d('0x29')]({'plain':!![]});var _0x1ab6ef=_0x8c4d('0x2a');return db[_0x8c4d('0x4d')][_0x8c4d('0x49')]({'where':{'name':_0x1ab6ef,'userProfileId':_0x565449['userProfileId']},'raw':!![]})[_0x8c4d('0x27')](function(_0x175bf0){if(_0x175bf0&&_0x175bf0[_0x8c4d('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x139537[_0x8c4d('0x2d')],'resourceId':_0x139537['id'],'type':_0x175bf0[_0x8c4d('0x2d')],'sectionId':_0x175bf0['id']},{})[_0x8c4d('0x27')](function(){return _0x1e6171;});}else{return _0x1e6171;}})['catch'](function(_0xc1988d){logger[_0x8c4d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc1988d);throw _0xc1988d;});}return _0x1e6171;})[_0x8c4d('0x27')](respondWithResult(_0x1707dc,0xc9))[_0x8c4d('0x46')](handleError(_0x1707dc,null));};exports[_0x8c4d('0x4f')]=function(_0x293d4e,_0x29d600){if(_0x293d4e['body']['id']){delete _0x293d4e['body']['id'];}return db[_0x8c4d('0x30')][_0x8c4d('0x49')]({'where':{'id':_0x293d4e[_0x8c4d('0x48')]['id']}})[_0x8c4d('0x27')](handleEntityNotFound(_0x29d600,null))['then'](saveUpdates(_0x293d4e[_0x8c4d('0x50')],null))[_0x8c4d('0x27')](respondWithResult(_0x29d600,null))[_0x8c4d('0x46')](handleError(_0x29d600,null));};exports[_0x8c4d('0x28')]=function(_0x814a72,_0x38275c){return db[_0x8c4d('0x30')][_0x8c4d('0x49')]({'where':{'id':_0x814a72[_0x8c4d('0x48')]['id']}})[_0x8c4d('0x27')](handleEntityNotFound(_0x38275c,null))[_0x8c4d('0x27')](removeEntity(_0x38275c,null))['catch'](handleError(_0x38275c,null));};exports[_0x8c4d('0x51')]=function(_0x398316,_0x559b10,_0x3e6af6){return db[_0x8c4d('0x30')][_0x8c4d('0x49')]({'where':{'id':_0x398316[_0x8c4d('0x48')]['id']}})[_0x8c4d('0x27')](handleEntityNotFound(_0x559b10,null))['then'](function(_0x2f3304){if(_0x2f3304){return _0x2f3304['addUsers'](_0x398316[_0x8c4d('0x50')][_0x8c4d('0x52')],_[_0x8c4d('0x53')](_0x398316[_0x8c4d('0x50')],[_0x8c4d('0x52'),'id'])||{});}})[_0x8c4d('0x27')](respondWithResult(_0x559b10,null))[_0x8c4d('0x46')](handleError(_0x559b10,null));};exports['removeUsers']=function(_0x3ea4c8,_0x7bb217,_0x183015){return db[_0x8c4d('0x30')]['find']({'where':{'id':_0x3ea4c8[_0x8c4d('0x48')]['id']}})[_0x8c4d('0x27')](handleEntityNotFound(_0x7bb217,null))[_0x8c4d('0x27')](function(_0x5b12ef){if(_0x5b12ef){return _0x5b12ef['removeUsers'](_0x3ea4c8[_0x8c4d('0x34')][_0x8c4d('0x52')])[_0x8c4d('0x27')](function(){if(_['isArray'](_0x3ea4c8[_0x8c4d('0x34')][_0x8c4d('0x52')])){for(var _0x4c6773=0x0;_0x4c6773<_0x3ea4c8[_0x8c4d('0x34')][_0x8c4d('0x52')]['length'];_0x4c6773+=0x1){socket[_0x8c4d('0x54')](_0x8c4d('0x55'),{'UserId':Number(_0x3ea4c8['query'][_0x8c4d('0x52')][_0x4c6773]),'SquareProjectId':Number(_0x3ea4c8[_0x8c4d('0x48')]['id'])});}}else{socket[_0x8c4d('0x54')](_0x8c4d('0x55'),{'UserId':Number(_0x3ea4c8[_0x8c4d('0x34')][_0x8c4d('0x52')]),'SquareProjectId':Number(_0x3ea4c8[_0x8c4d('0x48')]['id'])});}});}})[_0x8c4d('0x27')](respondWithStatusCode(_0x7bb217,null))[_0x8c4d('0x46')](handleError(_0x7bb217,null));};exports[_0x8c4d('0x56')]=function(_0x17e98a,_0x27d525,_0x4acc29){var _0x129188={};var _0x4a18fd={};var _0x2ec91a;var _0x5f336c;return db['SquareProject'][_0x8c4d('0x57')]({'where':{'id':_0x17e98a[_0x8c4d('0x48')]['id']}})[_0x8c4d('0x27')](handleEntityNotFound(_0x27d525,null))[_0x8c4d('0x27')](function(_0x233388){if(_0x233388){_0x2ec91a=_0x233388;_0x4a18fd[_0x8c4d('0x33')]=_['keys'](db[_0x8c4d('0x58')]['rawAttributes']);_0x4a18fd[_0x8c4d('0x34')]=_[_0x8c4d('0x35')](_0x17e98a[_0x8c4d('0x34')]);_0x4a18fd[_0x8c4d('0x3d')]=_[_0x8c4d('0x36')](_0x4a18fd[_0x8c4d('0x33')],_0x4a18fd['query']);_0x129188['attributes']=_[_0x8c4d('0x36')](_0x4a18fd[_0x8c4d('0x33')],qs[_0x8c4d('0x38')](_0x17e98a['query'][_0x8c4d('0x38')]));_0x129188[_0x8c4d('0x37')]=_0x129188['attributes'][_0x8c4d('0x39')]?_0x129188['attributes']:_0x4a18fd[_0x8c4d('0x33')];_0x129188[_0x8c4d('0x3a')]=qs[_0x8c4d('0x3b')](_0x17e98a['query'][_0x8c4d('0x3b')]);_0x129188[_0x8c4d('0x3c')]=qs['filters'](_[_0x8c4d('0x3e')](_0x17e98a['query'],_0x4a18fd[_0x8c4d('0x3d')]));if(_0x17e98a[_0x8c4d('0x34')][_0x8c4d('0x3f')]){_0x129188[_0x8c4d('0x3c')]=_[_0x8c4d('0x40')](_0x129188[_0x8c4d('0x3c')],{'$or':_['map'](_0x129188[_0x8c4d('0x37')],function(_0x3efad2){var _0x544e0c={};_0x544e0c[_0x3efad2]={'$like':'%'+_0x17e98a[_0x8c4d('0x34')][_0x8c4d('0x3f')]+'%'};return _0x544e0c;})});}_0x129188=_[_0x8c4d('0x40')]({},_0x129188,_0x17e98a[_0x8c4d('0x42')]);return _0x2ec91a['getUsers'](_0x129188);}})[_0x8c4d('0x27')](function(_0x3b3d71){if(_0x3b3d71){_0x5f336c=_0x3b3d71[_0x8c4d('0x39')];if(!_0x17e98a['query']['hasOwnProperty'](_0x8c4d('0x59'))){_0x129188[_0x8c4d('0x1f')]=qs['limit'](_0x17e98a[_0x8c4d('0x34')][_0x8c4d('0x1f')]);_0x129188[_0x8c4d('0x1d')]=qs[_0x8c4d('0x1d')](_0x17e98a[_0x8c4d('0x34')][_0x8c4d('0x1d')]);}return _0x2ec91a['getUsers'](_0x129188);}})[_0x8c4d('0x27')](function(_0x55325d){if(_0x55325d){return _0x55325d?{'count':_0x5f336c,'rows':_0x55325d}:null;}})[_0x8c4d('0x27')](respondWithResult(_0x27d525,null))['catch'](handleError(_0x27d525,null));}; \ No newline at end of file +var _0x97fd=['query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','rimraf','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','end','status','json','offset','limit','undefined','count','set','apply','save','update','destroy','get','SquareProjects','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model'];(function(_0x52fe6b,_0x20e7f5){var _0xbcc46c=function(_0x2d9e28){while(--_0x2d9e28){_0x52fe6b['push'](_0x52fe6b['shift']());}};_0xbcc46c(++_0x20e7f5);}(_0x97fd,0x145));var _0xd97f=function(_0x11187c,_0x35b046){_0x11187c=_0x11187c-0x0;var _0x547b2d=_0x97fd[_0x11187c];return _0x547b2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd97f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd97f('0x1'));var BPromise=require(_0xd97f('0x2'));var Mustache=require(_0xd97f('0x3'));var util=require(_0xd97f('0x4'));var path=require('path');var sox=require(_0xd97f('0x5'));var csv=require(_0xd97f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd97f('0x7'));var _=require('lodash');var squel=require(_0xd97f('0x8'));var crypto=require(_0xd97f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd97f('0xa'));var toCsv=require(_0xd97f('0x6'));var querystring=require(_0xd97f('0xb'));var Papa=require('papaparse');var Redis=require(_0xd97f('0xc'));var authService=require(_0xd97f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd97f('0xe'));var hardwareService=require(_0xd97f('0xf'));var logger=require(_0xd97f('0x10'))(_0xd97f('0x11'));var utils=require(_0xd97f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd97f('0x13'));var db=require(_0xd97f('0x14'))['db'];config['redis']=_[_0xd97f('0x15')](config[_0xd97f('0x16')],{'host':_0xd97f('0x17'),'port':0x18eb});var socket=require(_0xd97f('0x18'))(new Redis(config[_0xd97f('0x16')]));require(_0xd97f('0x19'))[_0xd97f('0x1a')](socket);function respondWithStatusCode(_0x37152f,_0x2cc2ff){_0x2cc2ff=_0x2cc2ff||0xcc;return function(_0x1416fc){if(_0x1416fc){return _0x37152f['sendStatus'](_0x2cc2ff);}return _0x37152f['status'](_0x2cc2ff)[_0xd97f('0x1b')]();};}function respondWithResult(_0x36fda7,_0x328897){_0x328897=_0x328897||0xc8;return function(_0x11ba9d){if(_0x11ba9d){return _0x36fda7[_0xd97f('0x1c')](_0x328897)[_0xd97f('0x1d')](_0x11ba9d);}};}function respondWithFilteredResult(_0x240eed,_0x1b2f7a){return function(_0x544531){if(_0x544531){var _0x23851e=typeof _0x1b2f7a[_0xd97f('0x1e')]==='undefined'&&typeof _0x1b2f7a[_0xd97f('0x1f')]===_0xd97f('0x20');var _0x55b5b4=_0x544531[_0xd97f('0x21')];var _0xaeec51=_0x23851e?0x0:_0x1b2f7a[_0xd97f('0x1e')];var _0x218281=_0x23851e?_0x544531['count']:_0x1b2f7a[_0xd97f('0x1e')]+_0x1b2f7a['limit'];var _0x502656;if(_0x218281>=_0x55b5b4){_0x218281=_0x55b5b4;_0x502656=0xc8;}else{_0x502656=0xce;}_0x240eed['status'](_0x502656);return _0x240eed[_0xd97f('0x22')]('Content-Range',_0xaeec51+'-'+_0x218281+'/'+_0x55b5b4)['json'](_0x544531);}return null;};}function patchUpdates(_0x34425a){return function(_0x539959){try{jsonpatch[_0xd97f('0x23')](_0x539959,_0x34425a,!![]);}catch(_0xe85608){return BPromise['reject'](_0xe85608);}return _0x539959[_0xd97f('0x24')]();};}function saveUpdates(_0x1f5739,_0x535caa){return function(_0x398ae3){if(_0x398ae3){return _0x398ae3[_0xd97f('0x25')](_0x1f5739)['then'](function(_0x39b329){return _0x39b329;});}return null;};}function removeEntity(_0x507df2,_0x1609f1){return function(_0x2436b4){if(_0x2436b4){return _0x2436b4[_0xd97f('0x26')]()['then'](function(){var _0xeece42=_0x2436b4[_0xd97f('0x27')]({'plain':!![]});var _0x4e9635=_0xd97f('0x28');return db[_0xd97f('0x29')][_0xd97f('0x26')]({'where':{'type':_0x4e9635,'resourceId':_0xeece42['id']}})[_0xd97f('0x2a')](function(){return _0x2436b4;});})[_0xd97f('0x2a')](function(){_0x507df2[_0xd97f('0x1c')](0xcc)[_0xd97f('0x1b')]();});}};}function handleEntityNotFound(_0x6c520e,_0x1d2f81){return function(_0x5c0d36){if(!_0x5c0d36){_0x6c520e[_0xd97f('0x2b')](0x194);}return _0x5c0d36;};}function handleError(_0x48a166,_0x2202f5){_0x2202f5=_0x2202f5||0x1f4;return function(_0x3c2dd2){logger[_0xd97f('0x2c')](_0x3c2dd2[_0xd97f('0x2d')]);if(_0x3c2dd2[_0xd97f('0x2e')]){delete _0x3c2dd2[_0xd97f('0x2e')];}_0x48a166[_0xd97f('0x1c')](_0x2202f5)[_0xd97f('0x2f')](_0x3c2dd2);};}exports[_0xd97f('0x30')]=function(_0x25e978,_0x118217){var _0x22ccdb={},_0x1f2820={},_0x161118={'count':0x0,'rows':[]};var _0x31c8c8=_[_0xd97f('0x31')](db[_0xd97f('0x32')][_0xd97f('0x33')],function(_0x548c78){return{'name':_0x548c78[_0xd97f('0x34')],'type':_0x548c78[_0xd97f('0x35')]['key']};});_0x1f2820[_0xd97f('0x36')]=_[_0xd97f('0x31')](_0x31c8c8,_0xd97f('0x2e'));_0x1f2820[_0xd97f('0x37')]=_['keys'](_0x25e978[_0xd97f('0x37')]);_0x1f2820[_0xd97f('0x38')]=_[_0xd97f('0x39')](_0x1f2820[_0xd97f('0x36')],_0x1f2820[_0xd97f('0x37')]);_0x22ccdb['attributes']=_[_0xd97f('0x39')](_0x1f2820[_0xd97f('0x36')],qs[_0xd97f('0x3a')](_0x25e978[_0xd97f('0x37')][_0xd97f('0x3a')]));_0x22ccdb[_0xd97f('0x3b')]=_0x22ccdb[_0xd97f('0x3b')]['length']?_0x22ccdb[_0xd97f('0x3b')]:_0x1f2820['model'];if(!_0x25e978[_0xd97f('0x37')][_0xd97f('0x3c')](_0xd97f('0x3d'))){_0x22ccdb[_0xd97f('0x1f')]=qs['limit'](_0x25e978[_0xd97f('0x37')]['limit']);_0x22ccdb['offset']=qs[_0xd97f('0x1e')](_0x25e978[_0xd97f('0x37')][_0xd97f('0x1e')]);}_0x22ccdb['order']=qs['sort'](_0x25e978[_0xd97f('0x37')][_0xd97f('0x3e')]);_0x22ccdb[_0xd97f('0x3f')]=qs[_0xd97f('0x38')](_[_0xd97f('0x40')](_0x25e978[_0xd97f('0x37')],_0x1f2820[_0xd97f('0x38')]),_0x31c8c8);if(_0x25e978[_0xd97f('0x37')][_0xd97f('0x41')]){_0x22ccdb[_0xd97f('0x3f')]=_[_0xd97f('0x42')](_0x22ccdb[_0xd97f('0x3f')],{'$or':_[_0xd97f('0x31')](_0x31c8c8,function(_0x2071e5){if(_0x2071e5[_0xd97f('0x35')]!==_0xd97f('0x43')){var _0x11e06e={};_0x11e06e[_0x2071e5['name']]={'$like':'%'+_0x25e978[_0xd97f('0x37')]['filter']+'%'};return _0x11e06e;}})});}_0x22ccdb=_[_0xd97f('0x42')]({},_0x22ccdb,_0x25e978[_0xd97f('0x44')]);var _0xa89a6d={'where':_0x22ccdb['where']};return db[_0xd97f('0x32')][_0xd97f('0x21')](_0xa89a6d)[_0xd97f('0x2a')](function(_0x569cd6){_0x161118[_0xd97f('0x21')]=_0x569cd6;if(_0x25e978[_0xd97f('0x37')][_0xd97f('0x45')]){_0x22ccdb[_0xd97f('0x46')]=[{'all':!![]}];}return db[_0xd97f('0x32')][_0xd97f('0x47')](_0x22ccdb);})[_0xd97f('0x2a')](function(_0x493e84){_0x161118[_0xd97f('0x48')]=_0x493e84;return _0x161118;})[_0xd97f('0x2a')](respondWithFilteredResult(_0x118217,_0x22ccdb))[_0xd97f('0x49')](handleError(_0x118217,null));};exports['show']=function(_0x2d1ee7,_0x3fabc9){var _0x4aa435={'raw':![],'where':{'id':_0x2d1ee7[_0xd97f('0x4a')]['id']}},_0x2a0028={};_0x2a0028['model']=_[_0xd97f('0x4b')](db[_0xd97f('0x32')]['rawAttributes']);_0x2a0028[_0xd97f('0x37')]=_[_0xd97f('0x4b')](_0x2d1ee7[_0xd97f('0x37')]);_0x2a0028[_0xd97f('0x38')]=_['intersection'](_0x2a0028['model'],_0x2a0028['query']);_0x4aa435[_0xd97f('0x3b')]=_[_0xd97f('0x39')](_0x2a0028[_0xd97f('0x36')],qs[_0xd97f('0x3a')](_0x2d1ee7[_0xd97f('0x37')][_0xd97f('0x3a')]));_0x4aa435[_0xd97f('0x3b')]=_0x4aa435[_0xd97f('0x3b')][_0xd97f('0x4c')]?_0x4aa435[_0xd97f('0x3b')]:_0x2a0028[_0xd97f('0x36')];if(_0x2d1ee7['query'][_0xd97f('0x45')]){_0x4aa435['include']=[{'all':!![]}];}_0x4aa435=_[_0xd97f('0x42')]({},_0x4aa435,_0x2d1ee7[_0xd97f('0x44')]);return db[_0xd97f('0x32')][_0xd97f('0x4d')](_0x4aa435)[_0xd97f('0x2a')](handleEntityNotFound(_0x3fabc9,null))[_0xd97f('0x2a')](respondWithResult(_0x3fabc9,null))['catch'](handleError(_0x3fabc9,null));};exports[_0xd97f('0x4e')]=function(_0x19aab0,_0x27e9be){return db[_0xd97f('0x32')][_0xd97f('0x4e')](_0x19aab0[_0xd97f('0x4f')],{})[_0xd97f('0x2a')](function(_0x50b8b7){var _0x588801=_0x19aab0[_0xd97f('0x50')][_0xd97f('0x27')]({'plain':!![]});if(!_0x588801)throw new Error(_0xd97f('0x51'));if(_0x588801['role']==='user'){var _0x12aec5=_0x50b8b7[_0xd97f('0x27')]({'plain':!![]});var _0x5701e2=_0xd97f('0x28');return db[_0xd97f('0x52')][_0xd97f('0x4d')]({'where':{'name':_0x5701e2,'userProfileId':_0x588801['userProfileId']},'raw':!![]})[_0xd97f('0x2a')](function(_0x55813e){if(_0x55813e&&_0x55813e[_0xd97f('0x53')]===0x0){return db[_0xd97f('0x29')]['create']({'name':_0x12aec5[_0xd97f('0x2e')],'resourceId':_0x12aec5['id'],'type':_0x55813e[_0xd97f('0x2e')],'sectionId':_0x55813e['id']},{})['then'](function(){return _0x50b8b7;});}else{return _0x50b8b7;}})['catch'](function(_0x429fcf){logger['error'](_0xd97f('0x54'),_0x429fcf);throw _0x429fcf;});}return _0x50b8b7;})[_0xd97f('0x2a')](respondWithResult(_0x27e9be,0xc9))['catch'](handleError(_0x27e9be,null));};exports['update']=function(_0x5386db,_0x319c72){if(_0x5386db[_0xd97f('0x4f')]['id']){delete _0x5386db[_0xd97f('0x4f')]['id'];}return db['SquareProject'][_0xd97f('0x4d')]({'where':{'id':_0x5386db[_0xd97f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x319c72,null))[_0xd97f('0x2a')](saveUpdates(_0x5386db[_0xd97f('0x4f')],null))[_0xd97f('0x2a')](respondWithResult(_0x319c72,null))[_0xd97f('0x49')](handleError(_0x319c72,null));};exports['destroy']=function(_0x1c0e13,_0x1d6d63){return db[_0xd97f('0x32')][_0xd97f('0x4d')]({'where':{'id':_0x1c0e13[_0xd97f('0x4a')]['id']}})[_0xd97f('0x2a')](handleEntityNotFound(_0x1d6d63,null))[_0xd97f('0x2a')](removeEntity(_0x1d6d63,null))[_0xd97f('0x49')](handleError(_0x1d6d63,null));};exports[_0xd97f('0x55')]=function(_0x32de86,_0x488194,_0x26ae13){return db['SquareProject'][_0xd97f('0x4d')]({'where':{'id':_0x32de86['params']['id']}})[_0xd97f('0x2a')](handleEntityNotFound(_0x488194,null))[_0xd97f('0x2a')](function(_0x47a27e){if(_0x47a27e){return _0x47a27e[_0xd97f('0x55')](_0x32de86[_0xd97f('0x4f')][_0xd97f('0x56')],_[_0xd97f('0x57')](_0x32de86[_0xd97f('0x4f')],[_0xd97f('0x56'),'id'])||{});}})[_0xd97f('0x2a')](respondWithResult(_0x488194,null))[_0xd97f('0x49')](handleError(_0x488194,null));};exports['removeUsers']=function(_0x4bc414,_0x262adc,_0x56a29a){return db[_0xd97f('0x32')][_0xd97f('0x4d')]({'where':{'id':_0x4bc414['params']['id']}})['then'](handleEntityNotFound(_0x262adc,null))['then'](function(_0x582c4){if(_0x582c4){return _0x582c4['removeUsers'](_0x4bc414[_0xd97f('0x37')][_0xd97f('0x56')])[_0xd97f('0x2a')](function(){if(_[_0xd97f('0x58')](_0x4bc414[_0xd97f('0x37')][_0xd97f('0x56')])){for(var _0x3b828f=0x0;_0x3b828f<_0x4bc414[_0xd97f('0x37')][_0xd97f('0x56')][_0xd97f('0x4c')];_0x3b828f+=0x1){socket[_0xd97f('0x59')](_0xd97f('0x5a'),{'UserId':Number(_0x4bc414[_0xd97f('0x37')][_0xd97f('0x56')][_0x3b828f]),'SquareProjectId':Number(_0x4bc414[_0xd97f('0x4a')]['id'])});}}else{socket[_0xd97f('0x59')]('userSquareProject:remove',{'UserId':Number(_0x4bc414[_0xd97f('0x37')][_0xd97f('0x56')]),'SquareProjectId':Number(_0x4bc414['params']['id'])});}});}})[_0xd97f('0x2a')](respondWithStatusCode(_0x262adc,null))['catch'](handleError(_0x262adc,null));};exports[_0xd97f('0x5b')]=function(_0x13dfa8,_0x1ce846,_0x517fcd){var _0x1e4021={};var _0x48feeb={};var _0x4cd188;var _0x4dcd74;return db[_0xd97f('0x32')][_0xd97f('0x5c')]({'where':{'id':_0x13dfa8['params']['id']}})['then'](handleEntityNotFound(_0x1ce846,null))[_0xd97f('0x2a')](function(_0x2ecec7){if(_0x2ecec7){_0x4cd188=_0x2ecec7;_0x48feeb[_0xd97f('0x36')]=_[_0xd97f('0x4b')](db[_0xd97f('0x5d')][_0xd97f('0x33')]);_0x48feeb['query']=_[_0xd97f('0x4b')](_0x13dfa8['query']);_0x48feeb[_0xd97f('0x38')]=_[_0xd97f('0x39')](_0x48feeb[_0xd97f('0x36')],_0x48feeb['query']);_0x1e4021[_0xd97f('0x3b')]=_[_0xd97f('0x39')](_0x48feeb[_0xd97f('0x36')],qs[_0xd97f('0x3a')](_0x13dfa8[_0xd97f('0x37')][_0xd97f('0x3a')]));_0x1e4021[_0xd97f('0x3b')]=_0x1e4021[_0xd97f('0x3b')][_0xd97f('0x4c')]?_0x1e4021[_0xd97f('0x3b')]:_0x48feeb['model'];_0x1e4021[_0xd97f('0x5e')]=qs[_0xd97f('0x3e')](_0x13dfa8[_0xd97f('0x37')][_0xd97f('0x3e')]);_0x1e4021[_0xd97f('0x3f')]=qs[_0xd97f('0x38')](_[_0xd97f('0x40')](_0x13dfa8['query'],_0x48feeb[_0xd97f('0x38')]));if(_0x13dfa8[_0xd97f('0x37')][_0xd97f('0x41')]){_0x1e4021[_0xd97f('0x3f')]=_[_0xd97f('0x42')](_0x1e4021[_0xd97f('0x3f')],{'$or':_[_0xd97f('0x31')](_0x1e4021[_0xd97f('0x3b')],function(_0x1e0b6f){var _0x23ec32={};_0x23ec32[_0x1e0b6f]={'$like':'%'+_0x13dfa8[_0xd97f('0x37')][_0xd97f('0x41')]+'%'};return _0x23ec32;})});}_0x1e4021=_[_0xd97f('0x42')]({},_0x1e4021,_0x13dfa8[_0xd97f('0x44')]);return _0x4cd188[_0xd97f('0x5b')](_0x1e4021);}})[_0xd97f('0x2a')](function(_0x41243f){if(_0x41243f){_0x4dcd74=_0x41243f[_0xd97f('0x4c')];if(!_0x13dfa8['query'][_0xd97f('0x3c')](_0xd97f('0x3d'))){_0x1e4021[_0xd97f('0x1f')]=qs['limit'](_0x13dfa8[_0xd97f('0x37')][_0xd97f('0x1f')]);_0x1e4021[_0xd97f('0x1e')]=qs[_0xd97f('0x1e')](_0x13dfa8[_0xd97f('0x37')][_0xd97f('0x1e')]);}return _0x4cd188[_0xd97f('0x5b')](_0x1e4021);}})['then'](function(_0x155b74){if(_0x155b74){return _0x155b74?{'count':_0x4dcd74,'rows':_0x155b74}:null;}})[_0xd97f('0x2a')](respondWithResult(_0x1ce846,null))[_0xd97f('0x49')](handleError(_0x1ce846,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 02c99cd..41e9146 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 _0xa787=['remove','emit','hook','events','SquareProject','setMaxListeners'];(function(_0xc5bfcb,_0x5b09cd){var _0x10cdb5=function(_0x4f7001){while(--_0x4f7001){_0xc5bfcb['push'](_0xc5bfcb['shift']());}};_0x10cdb5(++_0x5b09cd);}(_0xa787,0xe1));var _0x7a78=function(_0x3f562e,_0x43c4ee){_0x3f562e=_0x3f562e-0x0;var _0x519a1d=_0xa787[_0x3f562e];return _0x519a1d;};'use strict';var EventEmitter=require(_0x7a78('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7a78('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7a78('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7a78('0x3')};function emitEvent(_0x10685c){return function(_0x1db78d,_0x4a5172,_0x13a528){SquareProjectEvents['emit'](_0x10685c+':'+_0x1db78d['id'],_0x1db78d);SquareProjectEvents[_0x7a78('0x4')](_0x10685c,_0x1db78d);_0x13a528(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7a78('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xf69e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x489bee,_0x277e64){var _0x48a800=function(_0x27b255){while(--_0x27b255){_0x489bee['push'](_0x489bee['shift']());}};_0x48a800(++_0x277e64);}(_0xf69e,0x17f));var _0xef69=function(_0x479950,_0x3b8765){_0x479950=_0x479950-0x0;var _0x5c5f2c=_0xf69e[_0x479950];return _0x5c5f2c;};'use strict';var EventEmitter=require(_0xef69('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xef69('0x1')](0x0);var events={'afterCreate':_0xef69('0x2'),'afterUpdate':_0xef69('0x3'),'afterDestroy':_0xef69('0x4')};function emitEvent(_0x5573b9){return function(_0x6234ec,_0x142f21,_0xeeb930){SquareProjectEvents[_0xef69('0x5')](_0x5573b9+':'+_0x6234ec['id'],_0x6234ec);SquareProjectEvents['emit'](_0x5573b9,_0x6234ec);_0xeeb930(null);};}for(var e in events){if(events[_0xef69('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xef69('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index aa141a3..b1691f7 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 _0xccdb=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','square_projects','changed','savedAt','format','production','publishedAt'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0xccdb,0x99));var _0xbccd=function(_0x14c346,_0x3f9df3){_0x14c346=_0x14c346-0x0;var _0x224862=_0xccdb[_0x14c346];return _0x224862;};'use strict';var _=require(_0xbccd('0x0'));var util=require('util');var logger=require(_0xbccd('0x1'))(_0xbccd('0x2'));var moment=require(_0xbccd('0x3'));var BPromise=require(_0xbccd('0x4'));var rp=require(_0xbccd('0x5'));var fs=require('fs');var path=require(_0xbccd('0x6'));var rimraf=require(_0xbccd('0x7'));var config=require(_0xbccd('0x8'));var attributes=require('./squareProject.attributes');module[_0xbccd('0x9')]=function(_0x1eeff5,_0x2955cb){return _0x1eeff5[_0xbccd('0xa')]('SquareProject',attributes,{'tableName':_0xbccd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d8f96,_0x46d376,_0x1b2c75){if(_0x2d8f96[_0xbccd('0xc')]('preproduction')){_0x2d8f96[_0xbccd('0xd')]=moment()[_0xbccd('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2d8f96[_0xbccd('0xc')](_0xbccd('0xf'))){_0x2d8f96[_0xbccd('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1b2c75(null,_0x2d8f96);}}});}; \ No newline at end of file +var _0xd4bd=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash'];(function(_0x26af9a,_0x44f808){var _0x4560cc=function(_0x475377){while(--_0x475377){_0x26af9a['push'](_0x26af9a['shift']());}};_0x4560cc(++_0x44f808);}(_0xd4bd,0x1a3));var _0xdd4b=function(_0x5df9ae,_0xd5d635){_0x5df9ae=_0x5df9ae-0x0;var _0x377c9a=_0xd4bd[_0x5df9ae];return _0x377c9a;};'use strict';var _=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var logger=require(_0xdd4b('0x2'))('api');var moment=require(_0xdd4b('0x3'));var BPromise=require(_0xdd4b('0x4'));var rp=require(_0xdd4b('0x5'));var fs=require('fs');var path=require(_0xdd4b('0x6'));var rimraf=require(_0xdd4b('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd4b('0x8'));module[_0xdd4b('0x9')]=function(_0x7593a5,_0x557068){return _0x7593a5[_0xdd4b('0xa')](_0xdd4b('0xb'),attributes,{'tableName':_0xdd4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13cd47,_0x2b9c22,_0x2a2652){if(_0x13cd47[_0xdd4b('0xd')](_0xdd4b('0xe'))){_0x13cd47[_0xdd4b('0xf')]=moment()[_0xdd4b('0x10')](_0xdd4b('0x11'));}if(_0x13cd47[_0xdd4b('0xd')](_0xdd4b('0x12'))){_0x13cd47[_0xdd4b('0x13')]=moment()['format'](_0xdd4b('0x11'));}_0x2a2652(null,_0x13cd47);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a1970c2..8b41d9b 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 _0xd74a=['./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareProject','options','raw','where','attributes','include','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter'];(function(_0x404279,_0x2affd9){var _0x39a8a2=function(_0x59f512){while(--_0x59f512){_0x404279['push'](_0x404279['shift']());}};_0x39a8a2(++_0x2affd9);}(_0xd74a,0x77));var _0xad74=function(_0x12f681,_0x1e2e29){_0x12f681=_0x12f681-0x0;var _0x10b0c0=_0xd74a[_0x12f681];return _0x10b0c0;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var moment=require(_0xad74('0x2'));var BPromise=require(_0xad74('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad74('0x4'));var db=require(_0xad74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xad74('0x6'))(_0xad74('0x7'));var config=require('../../config/environment');var jayson=require(_0xad74('0x8'));var client=jayson[_0xad74('0x9')]['http']({'port':0x232a});config[_0xad74('0xa')]=_['defaults'](config['redis'],{'host':_0xad74('0xb'),'port':0x18eb});var socket=require(_0xad74('0xc'))(new Redis(config['redis']));require(_0xad74('0xd'))[_0xad74('0xe')](socket);function respondWithRpcPromise(_0x6c07a,_0x22832d,_0x45c412){return new BPromise(function(_0x137405,_0x3f6860){return client['request'](_0x6c07a,_0x45c412)[_0xad74('0xf')](function(_0x50f300){logger[_0xad74('0x10')](_0xad74('0x11'),_0x22832d,_0xad74('0x12'));logger[_0xad74('0x13')](_0xad74('0x14'),_0x22832d,'request\x20sent',JSON[_0xad74('0x15')](_0x50f300));if(_0x50f300[_0xad74('0x16')]){if(_0x50f300[_0xad74('0x16')][_0xad74('0x17')]===0x1f4){logger[_0xad74('0x16')](_0xad74('0x11'),_0x22832d,_0x50f300[_0xad74('0x16')][_0xad74('0x18')]);return _0x3f6860(_0x50f300['error'][_0xad74('0x18')]);}logger[_0xad74('0x16')](_0xad74('0x11'),_0x22832d,_0x50f300[_0xad74('0x16')][_0xad74('0x18')]);return _0x137405(_0x50f300[_0xad74('0x16')]['message']);}else{logger[_0xad74('0x10')]('SquareProject,\x20%s,\x20%s',_0x22832d,_0xad74('0x12'));_0x137405(_0x50f300['result'][_0xad74('0x18')]);}})[_0xad74('0x19')](function(_0x3fc881){logger[_0xad74('0x16')](_0xad74('0x11'),_0x22832d,_0x3fc881);_0x3f6860(_0x3fc881);});});}exports[_0xad74('0x1a')]=function(_0x58779c){var _0x1028a7=this;return new Promise(function(_0x2f61ba,_0x28e7aa){return db['SquareProject']['find']({'raw':_0x58779c[_0xad74('0x1b')]?_0x58779c[_0xad74('0x1b')][_0xad74('0x1c')]===undefined?!![]:![]:!![],'where':_0x58779c[_0xad74('0x1b')]?_0x58779c[_0xad74('0x1b')][_0xad74('0x1d')]||null:null,'attributes':_0x58779c['options']?_0x58779c[_0xad74('0x1b')][_0xad74('0x1e')]||null:null,'include':_0x58779c['options']?_0x58779c[_0xad74('0x1b')]['include']?_['map'](_0x58779c['options'][_0xad74('0x1f')],function(_0x2fc84b){return{'model':db[_0x2fc84b['model']],'as':_0x2fc84b['as'],'attributes':_0x2fc84b[_0xad74('0x1e')],'include':_0x2fc84b['include']?_[_0xad74('0x20')](_0x2fc84b[_0xad74('0x1f')],function(_0x19fc8e){return{'model':db[_0x19fc8e['model']],'as':_0x19fc8e['as'],'attributes':_0x19fc8e[_0xad74('0x1e')],'include':_0x19fc8e[_0xad74('0x1f')]?_[_0xad74('0x20')](_0x19fc8e[_0xad74('0x1f')],function(_0x5bfc07){return{'model':db[_0x5bfc07['model']],'as':_0x5bfc07['as'],'attributes':_0x5bfc07[_0xad74('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xad74('0xf')](function(_0x2014bc){logger['info'](_0xad74('0x1a'),_0x58779c);logger[_0xad74('0x13')](_0xad74('0x1a'),_0x58779c,JSON[_0xad74('0x15')](_0x2014bc));_0x2f61ba(_0x2014bc);})[_0xad74('0x19')](function(_0x1ab53c){logger[_0xad74('0x16')]('ShowSquareProject',_0x1ab53c[_0xad74('0x18')],_0x58779c);_0x28e7aa(_0x1028a7['error'](0x1f4,_0x1ab53c[_0xad74('0x18')]));});});}; \ No newline at end of file +var _0xd541=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd541,0x15e));var _0x1d54=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0xd541[_0x250071];return _0x34e574;};'use strict';var _=require('lodash');var util=require(_0x1d54('0x0'));var moment=require(_0x1d54('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d54('0x2'));var fs=require('fs');var Redis=require(_0x1d54('0x3'));var db=require(_0x1d54('0x4'))['db'];var utils=require(_0x1d54('0x5'));var logger=require('../../config/logger')(_0x1d54('0x6'));var config=require(_0x1d54('0x7'));var jayson=require(_0x1d54('0x8'));var client=jayson[_0x1d54('0x9')]['http']({'port':0x232a});config[_0x1d54('0xa')]=_[_0x1d54('0xb')](config[_0x1d54('0xa')],{'host':_0x1d54('0xc'),'port':0x18eb});var socket=require(_0x1d54('0xd'))(new Redis(config[_0x1d54('0xa')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x26f84a,_0x4d5a3c,_0x5bad71){return new BPromise(function(_0x6990bf,_0x34dfc8){return client['request'](_0x26f84a,_0x5bad71)[_0x1d54('0xe')](function(_0x431d7b){logger[_0x1d54('0xf')](_0x1d54('0x10'),_0x4d5a3c,_0x1d54('0x11'));logger[_0x1d54('0x12')](_0x1d54('0x13'),_0x4d5a3c,'request\x20sent',JSON['stringify'](_0x431d7b));if(_0x431d7b[_0x1d54('0x14')]){if(_0x431d7b[_0x1d54('0x14')][_0x1d54('0x15')]===0x1f4){logger['error'](_0x1d54('0x10'),_0x4d5a3c,_0x431d7b[_0x1d54('0x14')]['message']);return _0x34dfc8(_0x431d7b[_0x1d54('0x14')][_0x1d54('0x16')]);}logger['error'](_0x1d54('0x10'),_0x4d5a3c,_0x431d7b['error'][_0x1d54('0x16')]);return _0x6990bf(_0x431d7b[_0x1d54('0x14')][_0x1d54('0x16')]);}else{logger[_0x1d54('0xf')](_0x1d54('0x10'),_0x4d5a3c,_0x1d54('0x11'));_0x6990bf(_0x431d7b[_0x1d54('0x17')]['message']);}})['catch'](function(_0x22a215){logger[_0x1d54('0x14')]('SquareProject,\x20%s,\x20%s',_0x4d5a3c,_0x22a215);_0x34dfc8(_0x22a215);});});}exports[_0x1d54('0x18')]=function(_0xe13adc){var _0x331997=this;return new Promise(function(_0x35b85e,_0x248f31){return db[_0x1d54('0x19')][_0x1d54('0x1a')]({'raw':_0xe13adc[_0x1d54('0x1b')]?_0xe13adc[_0x1d54('0x1b')][_0x1d54('0x1c')]===undefined?!![]:![]:!![],'where':_0xe13adc[_0x1d54('0x1b')]?_0xe13adc[_0x1d54('0x1b')][_0x1d54('0x1d')]||null:null,'attributes':_0xe13adc[_0x1d54('0x1b')]?_0xe13adc[_0x1d54('0x1b')][_0x1d54('0x1e')]||null:null,'include':_0xe13adc['options']?_0xe13adc[_0x1d54('0x1b')][_0x1d54('0x1f')]?_[_0x1d54('0x20')](_0xe13adc['options']['include'],function(_0x33e0ef){return{'model':db[_0x33e0ef[_0x1d54('0x21')]],'as':_0x33e0ef['as'],'attributes':_0x33e0ef[_0x1d54('0x1e')],'include':_0x33e0ef[_0x1d54('0x1f')]?_[_0x1d54('0x20')](_0x33e0ef[_0x1d54('0x1f')],function(_0x55c3e7){return{'model':db[_0x55c3e7[_0x1d54('0x21')]],'as':_0x55c3e7['as'],'attributes':_0x55c3e7[_0x1d54('0x1e')],'include':_0x55c3e7[_0x1d54('0x1f')]?_[_0x1d54('0x20')](_0x55c3e7[_0x1d54('0x1f')],function(_0x3e0f2b){return{'model':db[_0x3e0f2b[_0x1d54('0x21')]],'as':_0x3e0f2b['as'],'attributes':_0x3e0f2b[_0x1d54('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1d54('0xe')](function(_0x11de7a){logger[_0x1d54('0xf')](_0x1d54('0x18'),_0xe13adc);logger[_0x1d54('0x12')](_0x1d54('0x18'),_0xe13adc,JSON[_0x1d54('0x22')](_0x11de7a));_0x35b85e(_0x11de7a);})['catch'](function(_0x207709){logger[_0x1d54('0x14')](_0x1d54('0x18'),_0x207709[_0x1d54('0x16')],_0xe13adc);_0x248f31(_0x331997[_0x1d54('0x14')](0x1f4,_0x207709[_0x1d54('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e0dd49e..7ac08e8 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 _0x175a=['register','length','save','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x175a,0x194));var _0xa175=function(_0x2e787a,_0x297399){_0x2e787a=_0x2e787a-0x0;var _0x49dbdb=_0x175a[_0x2e787a];return _0x49dbdb;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xa175('0x0'),'remove',_0xa175('0x1')];function createListener(_0xef197b,_0x92aab1){return function(_0x1f7239){_0x92aab1[_0xa175('0x2')](_0xef197b,_0x1f7239);};}function removeListener(_0x4d160a,_0x1b83d2){return function(){SquareProjectEvents[_0xa175('0x3')](_0x4d160a,_0x1b83d2);};}exports[_0xa175('0x4')]=function(_0x510f89){for(var _0x143a81=0x0,_0xebd533=events[_0xa175('0x5')];_0x143a81<_0xebd533;_0x143a81++){var _0x3e6c4b=events[_0x143a81];var _0x811cf4=createListener('squareProject:'+_0x3e6c4b,_0x510f89);SquareProjectEvents['on'](_0x3e6c4b,_0x811cf4);}}; \ No newline at end of file +var _0x0938=['register','length','squareProject:','./squareProject.events','save','emit','removeListener'];(function(_0x535c2f,_0x32c84b){var _0x1503fb=function(_0x5c62a2){while(--_0x5c62a2){_0x535c2f['push'](_0x535c2f['shift']());}};_0x1503fb(++_0x32c84b);}(_0x0938,0x130));var _0x8093=function(_0x32016a,_0x36f6cd){_0x32016a=_0x32016a-0x0;var _0x16c69e=_0x0938[_0x32016a];return _0x16c69e;};'use strict';var SquareProjectEvents=require(_0x8093('0x0'));var events=[_0x8093('0x1'),'remove','update'];function createListener(_0x642255,_0x3af560){return function(_0x438aca){_0x3af560[_0x8093('0x2')](_0x642255,_0x438aca);};}function removeListener(_0x4c3e45,_0x1787e6){return function(){SquareProjectEvents[_0x8093('0x3')](_0x4c3e45,_0x1787e6);};}exports[_0x8093('0x4')]=function(_0x1f8371){for(var _0x58a766=0x0,_0x3849ee=events[_0x8093('0x5')];_0x58a766<_0x3849ee;_0x58a766++){var _0xb806df=events[_0x58a766];var _0x227a87=createListener(_0x8093('0x6')+_0xb806df,_0x1f8371);SquareProjectEvents['on'](_0xb806df,_0x227a87);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 8121312..badd0c3 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0xaf93d7,_0x569b9c){var _0x5177c0=function(_0x52200e){while(--_0x52200e){_0xaf93d7['push'](_0xaf93d7['shift']());}};_0x5177c0(++_0x569b9c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2f50b6,_0xd09fe3){_0x2f50b6=_0x2f50b6-0x0;var _0x54b027=_0x7fbe[_0x2f50b6];return _0x54b027;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x4c4633,_0x1f0ce6){var _0x313590=function(_0x5ee631){while(--_0x5ee631){_0x4c4633['push'](_0x4c4633['shift']());}};_0x313590(++_0x1f0ce6);}(_0x814b,0x1a2));var _0xb814=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x814b[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index cdb7c1f..c7f5178 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 _0x5fc3=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x5fc3[_0x57cb4f];return _0x29bb45;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x35fc('0x2')]},'calleridname':{'type':Sequelize[_0x35fc('0x2')]},'context':{'type':Sequelize[_0x35fc('0x2')]},'extension':{'type':Sequelize[_0x35fc('0x2')]},'priority':{'type':Sequelize[_0x35fc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x35fc('0x2')]},'projectName':{'type':Sequelize[_0x35fc('0x2')]},'saveName':{'type':Sequelize[_0x35fc('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x35fc('0x3')],'get':function(){var _0x508b32='';var _0x16e153=this[_0x35fc('0x4')](_0x35fc('0x5'));if(_0x16e153){_0x508b32=_0x16e153[_0x35fc('0x6')](_0x16e153[_0x35fc('0x7')]('.'));}return _0x508b32;}}}; \ No newline at end of file +var _0xdc97=['savePath','substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1d46c8,_0x3766c1){_0x1d46c8=_0x1d46c8-0x0;var _0x39a27d=_0xdc97[_0x1d46c8];return _0x39a27d;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'uniqueid':{'type':Sequelize[_0x7dc9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7dc9('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7dc9('0x2')]},'priority':{'type':Sequelize[_0x7dc9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7dc9('0x2')]},'projectName':{'type':Sequelize[_0x7dc9('0x2')]},'saveName':{'type':Sequelize[_0x7dc9('0x2')]},'filename':{'type':Sequelize[_0x7dc9('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7dc9('0x3')],'get':function(){var _0x4f91c7='';var _0x4b3229=this[_0x7dc9('0x4')](_0x7dc9('0x5'));if(_0x4b3229){_0x4f91c7=_0x4b3229[_0x7dc9('0x6')](_0x4b3229[_0x7dc9('0x7')]('.'));}return _0x4f91c7;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7dede7e..74b82fc 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 _0xde8b=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','intersection','create','body','download','uniqueid','params','filename','format','existsSync','secrets','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xde8b,0x101));var _0xbde8=function(_0x3c81c4,_0x382921){_0x3c81c4=_0x3c81c4-0x0;var _0x3d848d=_0xde8b[_0x3c81c4];return _0x3d848d;};'use strict';var emlformat=require(_0xbde8('0x0'));var rimraf=require(_0xbde8('0x1'));var zipdir=require(_0xbde8('0x2'));var jsonpatch=require(_0xbde8('0x3'));var rp=require('request-promise');var moment=require(_0xbde8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbde8('0x5'));var util=require(_0xbde8('0x6'));var path=require('path');var sox=require(_0xbde8('0x7'));var csv=require(_0xbde8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbde8('0x9'));var _=require(_0xbde8('0xa'));var squel=require(_0xbde8('0xb'));var crypto=require('crypto');var jsforce=require(_0xbde8('0xc'));var deskjs=require(_0xbde8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbde8('0xe'));var Redis=require(_0xbde8('0xf'));var authService=require(_0xbde8('0x10'));var qs=require(_0xbde8('0x11'));var as=require(_0xbde8('0x12'));var hardwareService=require(_0xbde8('0x13'));var logger=require(_0xbde8('0x14'))(_0xbde8('0x15'));var utils=require('../../config/utils');var config=require(_0xbde8('0x16'));var licenseUtil=require(_0xbde8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x138e0d,_0xcd6334){_0xcd6334=_0xcd6334||0xcc;return function(_0x40bf59){if(_0x40bf59){return _0x138e0d['sendStatus'](_0xcd6334);}return _0x138e0d[_0xbde8('0x18')](_0xcd6334)['end']();};}function respondWithResult(_0x8420b9,_0x16c8e2){_0x16c8e2=_0x16c8e2||0xc8;return function(_0x41bf8d){if(_0x41bf8d){return _0x8420b9[_0xbde8('0x18')](_0x16c8e2)[_0xbde8('0x19')](_0x41bf8d);}};}function respondWithFilteredResult(_0x326196,_0x263602){return function(_0x27643a){if(_0x27643a){var _0x373c30=typeof _0x263602[_0xbde8('0x1a')]===_0xbde8('0x1b')&&typeof _0x263602['limit']===_0xbde8('0x1b');var _0x2c747c=_0x27643a['count'];var _0x514fe7=_0x373c30?0x0:_0x263602['offset'];var _0x10c33d=_0x373c30?_0x27643a[_0xbde8('0x1c')]:_0x263602['offset']+_0x263602[_0xbde8('0x1d')];var _0x124d89;if(_0x10c33d>=_0x2c747c){_0x10c33d=_0x2c747c;_0x124d89=0xc8;}else{_0x124d89=0xce;}_0x326196['status'](_0x124d89);return _0x326196[_0xbde8('0x1e')](_0xbde8('0x1f'),_0x514fe7+'-'+_0x10c33d+'/'+_0x2c747c)[_0xbde8('0x19')](_0x27643a);}return null;};}function patchUpdates(_0x1d6586){return function(_0x15956d){try{jsonpatch[_0xbde8('0x20')](_0x15956d,_0x1d6586,!![]);}catch(_0x4081f9){return BPromise[_0xbde8('0x21')](_0x4081f9);}return _0x15956d['save']();};}function saveUpdates(_0x423f34,_0x1a49fc){return function(_0x1e646b){if(_0x1e646b){return _0x1e646b[_0xbde8('0x22')](_0x423f34)[_0xbde8('0x23')](function(_0x2b09dd){return _0x2b09dd;});}return null;};}function removeEntity(_0x4359c5,_0x57677e){return function(_0x44812c){if(_0x44812c){return _0x44812c[_0xbde8('0x24')]()[_0xbde8('0x23')](function(){_0x4359c5['status'](0xcc)[_0xbde8('0x25')]();});}};}function handleEntityNotFound(_0x18e964,_0xf38a12){return function(_0x375265){if(!_0x375265){_0x18e964[_0xbde8('0x26')](0x194);}return _0x375265;};}function handleError(_0x30166f,_0x560514){_0x560514=_0x560514||0x1f4;return function(_0x36457a){logger[_0xbde8('0x27')](_0x36457a[_0xbde8('0x28')]);if(_0x36457a[_0xbde8('0x29')]){delete _0x36457a['name'];}_0x30166f['status'](_0x560514)[_0xbde8('0x2a')](_0x36457a);};}exports['index']=function(_0x5c7f85,_0x49a842){var _0x449e3f={},_0x12cc19={},_0x2723d1={'count':0x0,'rows':[]};var _0x1bbd3a=_[_0xbde8('0x2b')](db[_0xbde8('0x2c')][_0xbde8('0x2d')],function(_0xad45a3){return{'name':_0xad45a3[_0xbde8('0x2e')],'type':_0xad45a3[_0xbde8('0x2f')][_0xbde8('0x30')]};});_0x12cc19['model']=_['map'](_0x1bbd3a,'name');_0x12cc19['query']=_[_0xbde8('0x31')](_0x5c7f85[_0xbde8('0x32')]);_0x12cc19[_0xbde8('0x33')]=_['intersection'](_0x12cc19[_0xbde8('0x34')],_0x12cc19['query']);_0x449e3f[_0xbde8('0x35')]=_['intersection'](_0x12cc19[_0xbde8('0x34')],qs[_0xbde8('0x36')](_0x5c7f85[_0xbde8('0x32')][_0xbde8('0x36')]));_0x449e3f[_0xbde8('0x35')]=_0x449e3f[_0xbde8('0x35')][_0xbde8('0x37')]?_0x449e3f[_0xbde8('0x35')]:_0x12cc19[_0xbde8('0x34')];if(!_0x5c7f85[_0xbde8('0x32')][_0xbde8('0x38')]('nolimit')){_0x449e3f['limit']=qs[_0xbde8('0x1d')](_0x5c7f85[_0xbde8('0x32')][_0xbde8('0x1d')]);_0x449e3f[_0xbde8('0x1a')]=qs[_0xbde8('0x1a')](_0x5c7f85['query'][_0xbde8('0x1a')]);}_0x449e3f[_0xbde8('0x39')]=qs['sort'](_0x5c7f85[_0xbde8('0x32')]['sort']);_0x449e3f[_0xbde8('0x3a')]=qs['filters'](_[_0xbde8('0x3b')](_0x5c7f85[_0xbde8('0x32')],_0x12cc19[_0xbde8('0x33')]),_0x1bbd3a);if(_0x5c7f85[_0xbde8('0x32')][_0xbde8('0x3c')]){_0x449e3f[_0xbde8('0x3a')]=_[_0xbde8('0x3d')](_0x449e3f[_0xbde8('0x3a')],{'$or':_[_0xbde8('0x2b')](_0x1bbd3a,function(_0x27bea7){if(_0x27bea7[_0xbde8('0x2f')]!==_0xbde8('0x3e')){var _0x41c91f={};_0x41c91f[_0x27bea7[_0xbde8('0x29')]]={'$like':'%'+_0x5c7f85[_0xbde8('0x32')][_0xbde8('0x3c')]+'%'};return _0x41c91f;}})});}_0x449e3f=_['merge']({},_0x449e3f,_0x5c7f85[_0xbde8('0x3f')]);var _0x1eacb3={'where':_0x449e3f['where']};return db[_0xbde8('0x2c')][_0xbde8('0x1c')](_0x1eacb3)[_0xbde8('0x23')](function(_0x5466cd){_0x2723d1[_0xbde8('0x1c')]=_0x5466cd;if(_0x5c7f85['query'][_0xbde8('0x40')]){_0x449e3f[_0xbde8('0x41')]=[{'all':!![]}];}return db[_0xbde8('0x2c')]['findAll'](_0x449e3f);})[_0xbde8('0x23')](function(_0x5f0f51){_0x2723d1[_0xbde8('0x42')]=_0x5f0f51;return _0x2723d1;})['then'](respondWithFilteredResult(_0x49a842,_0x449e3f))[_0xbde8('0x43')](handleError(_0x49a842,null));};exports['show']=function(_0x4026bb,_0x14b758){var _0x519cf8={'raw':!![],'where':{'id':_0x4026bb['params']['id']}},_0x291d5c={};_0x291d5c[_0xbde8('0x34')]=_['keys'](db[_0xbde8('0x2c')]['rawAttributes']);_0x291d5c[_0xbde8('0x32')]=_['keys'](_0x4026bb[_0xbde8('0x32')]);_0x291d5c[_0xbde8('0x33')]=_[_0xbde8('0x44')](_0x291d5c[_0xbde8('0x34')],_0x291d5c[_0xbde8('0x32')]);_0x519cf8[_0xbde8('0x35')]=_['intersection'](_0x291d5c['model'],qs[_0xbde8('0x36')](_0x4026bb[_0xbde8('0x32')][_0xbde8('0x36')]));_0x519cf8[_0xbde8('0x35')]=_0x519cf8[_0xbde8('0x35')][_0xbde8('0x37')]?_0x519cf8[_0xbde8('0x35')]:_0x291d5c['model'];if(_0x4026bb['query']['includeAll']){_0x519cf8[_0xbde8('0x41')]=[{'all':!![]}];}_0x519cf8=_[_0xbde8('0x3d')]({},_0x519cf8,_0x4026bb['options']);return db[_0xbde8('0x2c')]['find'](_0x519cf8)[_0xbde8('0x23')](handleEntityNotFound(_0x14b758,null))[_0xbde8('0x23')](respondWithResult(_0x14b758,null))[_0xbde8('0x43')](handleError(_0x14b758,null));};exports[_0xbde8('0x45')]=function(_0x17392b,_0x166bb1){return db['SquareRecording'][_0xbde8('0x45')](_0x17392b[_0xbde8('0x46')],{})[_0xbde8('0x23')](respondWithResult(_0x166bb1,0xc9))[_0xbde8('0x43')](handleError(_0x166bb1,null));};exports[_0xbde8('0x22')]=function(_0x2c0011,_0x3b1b2e){if(_0x2c0011[_0xbde8('0x46')]['id']){delete _0x2c0011['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x2c0011['params']['id']}})['then'](handleEntityNotFound(_0x3b1b2e,null))['then'](saveUpdates(_0x2c0011[_0xbde8('0x46')],null))[_0xbde8('0x23')](respondWithResult(_0x3b1b2e,null))['catch'](handleError(_0x3b1b2e,null));};exports[_0xbde8('0x47')]=function(_0xeb9af2,_0x5445d8,_0x40b5b5){var _0x2dea09=require('../../components/encryptor');var _0x3b239e=![];var _0x26ba42={};if(_0xeb9af2[_0xbde8('0x32')]['type']&&_0xeb9af2[_0xbde8('0x32')][_0xbde8('0x2f')]===_0xbde8('0x48')){_0x26ba42['uniqueid']=_0xeb9af2[_0xbde8('0x49')]['id'];}else{_0x26ba42['id']=_0xeb9af2['params']['id'];}return db[_0xbde8('0x2c')]['find']({'where':_0x26ba42,'attributes':['id','savePath',_0xbde8('0x4a')],'raw':!![]})[_0xbde8('0x23')](handleEntityNotFound(_0x5445d8,null))[_0xbde8('0x23')](function(_0x2241a7){if(_0x2241a7){var _0xc254c5=_0x2241a7['savePath'];var _0x187ede=util[_0xbde8('0x4b')]('%s.cypher',_0xc254c5);if(fs[_0xbde8('0x4c')](_0x187ede)){_0x3b239e=!![];return _0x2dea09['decryptFile'](_0x187ede,_0xc254c5,config[_0xbde8('0x4d')][_0xbde8('0x4e')])[_0xbde8('0x23')](function(){return _0x2241a7;});}return _0x2241a7;}})['then'](function(_0x9cd0b7){if(_0x9cd0b7){var _0x28066e=_0x9cd0b7[_0xbde8('0x4f')];if(!fs[_0xbde8('0x4c')](_0x28066e)){throw new db[(_0xbde8('0x50'))][(_0xbde8('0x51'))](_0xbde8('0x52'));}if(_0x9cd0b7['filename']){return _0x5445d8[_0xbde8('0x47')](_0x28066e,_0x9cd0b7['filename']+path[_0xbde8('0x53')](_0x28066e),function(){if(_0x3b239e){fs[_0xbde8('0x54')](_0x28066e);}});}else{return _0x5445d8[_0xbde8('0x47')](_0x28066e,function(_0x1fa959){if(_0x3b239e){fs[_0xbde8('0x54')](_0x28066e);}});}}})[_0xbde8('0x43')](function(_0x43dc60){if(_0x43dc60[_0xbde8('0x55')]===_0xbde8('0x52')){_0x5445d8[_0xbde8('0x18')](0x194)[_0xbde8('0x2a')](_0xbde8('0x56'));}else{return handleError(_0x5445d8,null);}});};exports['destroy']=function(_0x8b026,_0x219975){return db[_0xbde8('0x2c')]['find']({'where':{'id':_0x8b026[_0xbde8('0x49')]['id']}})['then'](function(_0x1646eb){if(_[_0xbde8('0x57')](_0x1646eb)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1646eb;})[_0xbde8('0x23')](function(_0x3551d3){var _0x4b5b28=_0x3551d3[_0xbde8('0x4f')];logger[_0xbde8('0x58')](_0xbde8('0x59'),_0x4b5b28);if(!_[_0xbde8('0x57')](_0x3551d3[_0xbde8('0x4f')])&&fs[_0xbde8('0x4c')](_0x4b5b28)){logger[_0xbde8('0x58')](_0xbde8('0x5a')+_0x4b5b28+_0xbde8('0x5b'));fs[_0xbde8('0x5c')](_0x4b5b28);}_0x4b5b28=_0x4b5b28+_0xbde8('0x5d');if(!_[_0xbde8('0x57')](_0x3551d3[_0xbde8('0x4f')])&&fs[_0xbde8('0x4c')](_0x4b5b28)){logger[_0xbde8('0x58')]('File:\x20\x22'+_0x4b5b28+_0xbde8('0x5b'));fs[_0xbde8('0x5c')](_0x4b5b28);}return _0x3551d3;})[_0xbde8('0x23')](function(_0x35e754){if(!_0x35e754)throw new InternalError();return _0x35e754[_0xbde8('0x24')]();})['then'](function(){_0x219975[_0xbde8('0x18')](0xcc)['end']();})['catch'](handleError(_0x219975,null));}; \ No newline at end of file +var _0x09f8=['params','find','catch','create','body','update','download','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','destroy','isNil','Entity\x20not\x20found','info','existsSync','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','fast-json-patch','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','reject','then','status','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x2afeb7,_0x19f636){var _0x30a96b=function(_0x430dc4){while(--_0x430dc4){_0x2afeb7['push'](_0x2afeb7['shift']());}};_0x30a96b(++_0x19f636);}(_0x09f8,0x1ad));var _0x809f=function(_0x107ab2,_0x4c939c){_0x107ab2=_0x107ab2-0x0;var _0xea52e0=_0x09f8[_0x107ab2];return _0xea52e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x809f('0x0'));var rp=require('request-promise');var moment=require(_0x809f('0x1'));var BPromise=require(_0x809f('0x2'));var Mustache=require(_0x809f('0x3'));var util=require(_0x809f('0x4'));var path=require(_0x809f('0x5'));var sox=require(_0x809f('0x6'));var csv=require(_0x809f('0x7'));var ejs=require(_0x809f('0x8'));var fs=require('fs');var fs_extra=require(_0x809f('0x9'));var _=require(_0x809f('0xa'));var squel=require(_0x809f('0xb'));var crypto=require(_0x809f('0xc'));var jsforce=require(_0x809f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x809f('0x7'));var querystring=require(_0x809f('0xe'));var Papa=require(_0x809f('0xf'));var Redis=require(_0x809f('0x10'));var authService=require(_0x809f('0x11'));var qs=require(_0x809f('0x12'));var as=require(_0x809f('0x13'));var hardwareService=require(_0x809f('0x14'));var logger=require('../../config/logger')(_0x809f('0x15'));var utils=require(_0x809f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x809f('0x17'));var db=require(_0x809f('0x18'))['db'];function respondWithStatusCode(_0x4d60e6,_0x2cf17c){_0x2cf17c=_0x2cf17c||0xcc;return function(_0x388cf3){if(_0x388cf3){return _0x4d60e6[_0x809f('0x19')](_0x2cf17c);}return _0x4d60e6['status'](_0x2cf17c)[_0x809f('0x1a')]();};}function respondWithResult(_0x5dda7f,_0x30b28e){_0x30b28e=_0x30b28e||0xc8;return function(_0x4e5a54){if(_0x4e5a54){return _0x5dda7f['status'](_0x30b28e)[_0x809f('0x1b')](_0x4e5a54);}};}function respondWithFilteredResult(_0x2edbab,_0x580fb7){return function(_0x504963){if(_0x504963){var _0x3ef614=typeof _0x580fb7[_0x809f('0x1c')]===_0x809f('0x1d')&&typeof _0x580fb7['limit']===_0x809f('0x1d');var _0x22bf88=_0x504963[_0x809f('0x1e')];var _0x27b73c=_0x3ef614?0x0:_0x580fb7['offset'];var _0x4b255c=_0x3ef614?_0x504963[_0x809f('0x1e')]:_0x580fb7[_0x809f('0x1c')]+_0x580fb7['limit'];var _0x14720b;if(_0x4b255c>=_0x22bf88){_0x4b255c=_0x22bf88;_0x14720b=0xc8;}else{_0x14720b=0xce;}_0x2edbab['status'](_0x14720b);return _0x2edbab[_0x809f('0x1f')](_0x809f('0x20'),_0x27b73c+'-'+_0x4b255c+'/'+_0x22bf88)['json'](_0x504963);}return null;};}function patchUpdates(_0x42a103){return function(_0x3f0027){try{jsonpatch['apply'](_0x3f0027,_0x42a103,!![]);}catch(_0x332b43){return BPromise[_0x809f('0x21')](_0x332b43);}return _0x3f0027['save']();};}function saveUpdates(_0x4fc9d8,_0x3ce0bf){return function(_0x3b2c04){if(_0x3b2c04){return _0x3b2c04['update'](_0x4fc9d8)[_0x809f('0x22')](function(_0x3e4a69){return _0x3e4a69;});}return null;};}function removeEntity(_0x3b3b86,_0x1bc5da){return function(_0x4ca601){if(_0x4ca601){return _0x4ca601['destroy']()[_0x809f('0x22')](function(){_0x3b3b86[_0x809f('0x23')](0xcc)[_0x809f('0x1a')]();});}};}function handleEntityNotFound(_0x2bc56c,_0x403383){return function(_0x195c9a){if(!_0x195c9a){_0x2bc56c[_0x809f('0x19')](0x194);}return _0x195c9a;};}function handleError(_0x199c27,_0x358437){_0x358437=_0x358437||0x1f4;return function(_0x4b2133){logger[_0x809f('0x24')](_0x4b2133[_0x809f('0x25')]);if(_0x4b2133[_0x809f('0x26')]){delete _0x4b2133[_0x809f('0x26')];}_0x199c27[_0x809f('0x23')](_0x358437)[_0x809f('0x27')](_0x4b2133);};}exports[_0x809f('0x28')]=function(_0x4b55ee,_0x51288d){var _0x3a9469={},_0x5e6366={},_0x321113={'count':0x0,'rows':[]};var _0x2278b3=_[_0x809f('0x29')](db[_0x809f('0x2a')][_0x809f('0x2b')],function(_0x11ec79){return{'name':_0x11ec79[_0x809f('0x2c')],'type':_0x11ec79['type'][_0x809f('0x2d')]};});_0x5e6366[_0x809f('0x2e')]=_['map'](_0x2278b3,_0x809f('0x26'));_0x5e6366[_0x809f('0x2f')]=_[_0x809f('0x30')](_0x4b55ee[_0x809f('0x2f')]);_0x5e6366['filters']=_[_0x809f('0x31')](_0x5e6366[_0x809f('0x2e')],_0x5e6366[_0x809f('0x2f')]);_0x3a9469['attributes']=_[_0x809f('0x31')](_0x5e6366['model'],qs[_0x809f('0x32')](_0x4b55ee[_0x809f('0x2f')][_0x809f('0x32')]));_0x3a9469['attributes']=_0x3a9469[_0x809f('0x33')][_0x809f('0x34')]?_0x3a9469[_0x809f('0x33')]:_0x5e6366[_0x809f('0x2e')];if(!_0x4b55ee[_0x809f('0x2f')][_0x809f('0x35')](_0x809f('0x36'))){_0x3a9469[_0x809f('0x37')]=qs['limit'](_0x4b55ee[_0x809f('0x2f')][_0x809f('0x37')]);_0x3a9469['offset']=qs[_0x809f('0x1c')](_0x4b55ee[_0x809f('0x2f')][_0x809f('0x1c')]);}_0x3a9469[_0x809f('0x38')]=qs[_0x809f('0x39')](_0x4b55ee[_0x809f('0x2f')][_0x809f('0x39')]);_0x3a9469[_0x809f('0x3a')]=qs[_0x809f('0x3b')](_[_0x809f('0x3c')](_0x4b55ee[_0x809f('0x2f')],_0x5e6366['filters']),_0x2278b3);if(_0x4b55ee[_0x809f('0x2f')][_0x809f('0x3d')]){_0x3a9469[_0x809f('0x3a')]=_[_0x809f('0x3e')](_0x3a9469[_0x809f('0x3a')],{'$or':_[_0x809f('0x29')](_0x2278b3,function(_0x5227bc){if(_0x5227bc[_0x809f('0x3f')]!==_0x809f('0x40')){var _0x5eed7e={};_0x5eed7e[_0x5227bc[_0x809f('0x26')]]={'$like':'%'+_0x4b55ee['query']['filter']+'%'};return _0x5eed7e;}})});}_0x3a9469=_[_0x809f('0x3e')]({},_0x3a9469,_0x4b55ee[_0x809f('0x41')]);var _0x18eda1={'where':_0x3a9469[_0x809f('0x3a')]};return db[_0x809f('0x2a')][_0x809f('0x1e')](_0x18eda1)[_0x809f('0x22')](function(_0x505f9f){_0x321113['count']=_0x505f9f;if(_0x4b55ee[_0x809f('0x2f')][_0x809f('0x42')]){_0x3a9469[_0x809f('0x43')]=[{'all':!![]}];}return db[_0x809f('0x2a')][_0x809f('0x44')](_0x3a9469);})[_0x809f('0x22')](function(_0x4b9b36){_0x321113[_0x809f('0x45')]=_0x4b9b36;return _0x321113;})[_0x809f('0x22')](respondWithFilteredResult(_0x51288d,_0x3a9469))['catch'](handleError(_0x51288d,null));};exports[_0x809f('0x46')]=function(_0x59b4d0,_0x5cad4d){var _0x1015a3={'raw':!![],'where':{'id':_0x59b4d0[_0x809f('0x47')]['id']}},_0x1c8f30={};_0x1c8f30['model']=_[_0x809f('0x30')](db[_0x809f('0x2a')]['rawAttributes']);_0x1c8f30[_0x809f('0x2f')]=_[_0x809f('0x30')](_0x59b4d0[_0x809f('0x2f')]);_0x1c8f30['filters']=_[_0x809f('0x31')](_0x1c8f30[_0x809f('0x2e')],_0x1c8f30['query']);_0x1015a3['attributes']=_[_0x809f('0x31')](_0x1c8f30[_0x809f('0x2e')],qs['fields'](_0x59b4d0[_0x809f('0x2f')][_0x809f('0x32')]));_0x1015a3[_0x809f('0x33')]=_0x1015a3[_0x809f('0x33')]['length']?_0x1015a3[_0x809f('0x33')]:_0x1c8f30[_0x809f('0x2e')];if(_0x59b4d0[_0x809f('0x2f')][_0x809f('0x42')]){_0x1015a3[_0x809f('0x43')]=[{'all':!![]}];}_0x1015a3=_[_0x809f('0x3e')]({},_0x1015a3,_0x59b4d0[_0x809f('0x41')]);return db['SquareRecording'][_0x809f('0x48')](_0x1015a3)['then'](handleEntityNotFound(_0x5cad4d,null))[_0x809f('0x22')](respondWithResult(_0x5cad4d,null))[_0x809f('0x49')](handleError(_0x5cad4d,null));};exports['create']=function(_0x3dae02,_0x2080c9){return db[_0x809f('0x2a')][_0x809f('0x4a')](_0x3dae02[_0x809f('0x4b')],{})[_0x809f('0x22')](respondWithResult(_0x2080c9,0xc9))['catch'](handleError(_0x2080c9,null));};exports[_0x809f('0x4c')]=function(_0xb1e68b,_0x15b7b7){if(_0xb1e68b[_0x809f('0x4b')]['id']){delete _0xb1e68b[_0x809f('0x4b')]['id'];}return db['SquareRecording'][_0x809f('0x48')]({'where':{'id':_0xb1e68b[_0x809f('0x47')]['id']}})[_0x809f('0x22')](handleEntityNotFound(_0x15b7b7,null))['then'](saveUpdates(_0xb1e68b['body'],null))['then'](respondWithResult(_0x15b7b7,null))[_0x809f('0x49')](handleError(_0x15b7b7,null));};exports[_0x809f('0x4d')]=function(_0xeab2b2,_0x10f305,_0xd08df8){var _0x55e5b3=require('../../components/encryptor');var _0x3474a9=![];var _0x571789={};if(_0xeab2b2[_0x809f('0x2f')]['type']&&_0xeab2b2[_0x809f('0x2f')]['type']==='uniqueid'){_0x571789[_0x809f('0x4e')]=_0xeab2b2[_0x809f('0x47')]['id'];}else{_0x571789['id']=_0xeab2b2['params']['id'];}return db[_0x809f('0x2a')][_0x809f('0x48')]({'where':_0x571789,'attributes':['id',_0x809f('0x4f'),_0x809f('0x50')],'raw':!![]})[_0x809f('0x22')](handleEntityNotFound(_0x10f305,null))['then'](function(_0x2f4db5){if(_0x2f4db5){var _0x5853e3=_0x2f4db5[_0x809f('0x4f')];var _0x258b52=util[_0x809f('0x51')](_0x809f('0x52'),_0x5853e3);if(fs['existsSync'](_0x258b52)){_0x3474a9=!![];return _0x55e5b3[_0x809f('0x53')](_0x258b52,_0x5853e3,config[_0x809f('0x54')][_0x809f('0x55')])[_0x809f('0x22')](function(){return _0x2f4db5;});}return _0x2f4db5;}})[_0x809f('0x22')](function(_0x151bca){if(_0x151bca){var _0x106305=_0x151bca['savePath'];if(!fs['existsSync'](_0x106305)){throw new db['Sequelize'][(_0x809f('0x56'))](_0x809f('0x57'));}if(_0x151bca['filename']){return _0x10f305['download'](_0x106305,_0x151bca['filename']+path[_0x809f('0x58')](_0x106305),function(){if(_0x3474a9){fs[_0x809f('0x59')](_0x106305);}});}else{return _0x10f305[_0x809f('0x4d')](_0x106305,function(_0x1842b1){if(_0x3474a9){fs['unlink'](_0x106305);}});}}})[_0x809f('0x49')](function(_0x3a906c){if(_0x3a906c[_0x809f('0x5a')]==='SquareRecording\x20not\x20found'){_0x10f305[_0x809f('0x23')](0x194)[_0x809f('0x27')]('Not\x20found');}else{return handleError(_0x10f305,null);}});};exports[_0x809f('0x5b')]=function(_0x2a93f8,_0xacc371){return db[_0x809f('0x2a')][_0x809f('0x48')]({'where':{'id':_0x2a93f8['params']['id']}})[_0x809f('0x22')](function(_0x36ef44){if(_[_0x809f('0x5c')](_0x36ef44)){throw new ReferenceError(_0x809f('0x5d'));}return _0x36ef44;})[_0x809f('0x22')](function(_0xfdff04){var _0x1f26bb=_0xfdff04['savePath'];logger[_0x809f('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f26bb);if(!_[_0x809f('0x5c')](_0xfdff04[_0x809f('0x4f')])&&fs[_0x809f('0x5f')](_0x1f26bb)){logger[_0x809f('0x5e')](_0x809f('0x60')+_0x1f26bb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x809f('0x61')](_0x1f26bb);}_0x1f26bb=_0x1f26bb+_0x809f('0x62');if(!_[_0x809f('0x5c')](_0xfdff04[_0x809f('0x4f')])&&fs[_0x809f('0x5f')](_0x1f26bb)){logger['info']('File:\x20\x22'+_0x1f26bb+_0x809f('0x63'));fs[_0x809f('0x61')](_0x1f26bb);}return _0xfdff04;})[_0x809f('0x22')](function(_0x513591){if(!_0x513591)throw new InternalError();return _0x513591[_0x809f('0x5b')]();})[_0x809f('0x22')](function(){_0xacc371[_0x809f('0x23')](0xcc)[_0x809f('0x1a')]();})[_0x809f('0x49')](handleError(_0xacc371,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0c947ae..7037396 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 _0xbd36=['./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0xbd36,0x65));var _0x6bd3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xbd36[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x6bd3('0x0'));var util=require(_0x6bd3('0x1'));var logger=require(_0x6bd3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6bd3('0x3'));var rp=require(_0x6bd3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bd3('0x5'));var config=require(_0x6bd3('0x6'));var attributes=require(_0x6bd3('0x7'));module[_0x6bd3('0x8')]=function(_0x4f9f7e,_0x193bb4){return _0x4f9f7e[_0x6bd3('0x9')](_0x6bd3('0xa'),attributes,{'tableName':_0x6bd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4b6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','util','../../config/logger','api','moment'];(function(_0x5131b6,_0x53ec79){var _0x33d854=function(_0x58cfcf){while(--_0x58cfcf){_0x5131b6['push'](_0x5131b6['shift']());}};_0x33d854(++_0x53ec79);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x12bd9b,_0x1531c5){_0x12bd9b=_0x12bd9b-0x0;var _0x3fa95f=_0xb4b6[_0x12bd9b];return _0x3fa95f;};'use strict';var _=require('lodash');var util=require(_0x6b4b('0x0'));var logger=require(_0x6b4b('0x1'))(_0x6b4b('0x2'));var moment=require(_0x6b4b('0x3'));var BPromise=require(_0x6b4b('0x4'));var rp=require(_0x6b4b('0x5'));var fs=require('fs');var path=require(_0x6b4b('0x6'));var rimraf=require(_0x6b4b('0x7'));var config=require(_0x6b4b('0x8'));var attributes=require('./squareRecording.attributes');module[_0x6b4b('0x9')]=function(_0x49e81c,_0x3915de){return _0x49e81c[_0x6b4b('0xa')](_0x6b4b('0xb'),attributes,{'tableName':_0x6b4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index b1f573f..cf8372a 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 _0xa857=['stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../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','result','catch','CreateSquareRecording','SquareRecording','create','options','raw'];(function(_0x5db322,_0x3693ad){var _0x92d27=function(_0x61097d){while(--_0x61097d){_0x5db322['push'](_0x5db322['shift']());}};_0x92d27(++_0x3693ad);}(_0xa857,0x1bb));var _0x7a85=function(_0x367196,_0xecc8fd){_0x367196=_0x367196-0x0;var _0x18756b=_0xa857[_0x367196];return _0x18756b;};'use strict';var _=require(_0x7a85('0x0'));var util=require(_0x7a85('0x1'));var moment=require('moment');var BPromise=require(_0x7a85('0x2'));var rs=require(_0x7a85('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a85('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7a85('0x5'));var jayson=require(_0x7a85('0x6'));var client=jayson['client'][_0x7a85('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f0877,_0x340d51,_0x505f83){return new BPromise(function(_0x1b1c7b,_0x41b3c){return client[_0x7a85('0x8')](_0x4f0877,_0x505f83)[_0x7a85('0x9')](function(_0x5dceb1){logger[_0x7a85('0xa')](_0x7a85('0xb'),_0x340d51,_0x7a85('0xc'));logger[_0x7a85('0xd')](_0x7a85('0xe'),_0x340d51,_0x7a85('0xc'),JSON['stringify'](_0x5dceb1));if(_0x5dceb1[_0x7a85('0xf')]){if(_0x5dceb1[_0x7a85('0xf')][_0x7a85('0x10')]===0x1f4){logger[_0x7a85('0xf')](_0x7a85('0xb'),_0x340d51,_0x5dceb1[_0x7a85('0xf')]['message']);return _0x41b3c(_0x5dceb1[_0x7a85('0xf')]['message']);}logger[_0x7a85('0xf')](_0x7a85('0xb'),_0x340d51,_0x5dceb1[_0x7a85('0xf')][_0x7a85('0x11')]);return _0x1b1c7b(_0x5dceb1[_0x7a85('0xf')][_0x7a85('0x11')]);}else{logger['info'](_0x7a85('0xb'),_0x340d51,_0x7a85('0xc'));_0x1b1c7b(_0x5dceb1[_0x7a85('0x12')]['message']);}})[_0x7a85('0x13')](function(_0x36da2d){logger['error'](_0x7a85('0xb'),_0x340d51,_0x36da2d);_0x41b3c(_0x36da2d);});});}exports[_0x7a85('0x14')]=function(_0xaf1e7d){var _0x4c70d4=this;return new Promise(function(_0x2c572e,_0x38ac09){return db[_0x7a85('0x15')][_0x7a85('0x16')](_0xaf1e7d['body'],{'raw':_0xaf1e7d['options']?_0xaf1e7d[_0x7a85('0x17')][_0x7a85('0x18')]===undefined?!![]:![]:!![]})[_0x7a85('0x9')](function(_0x2eeb6a){logger[_0x7a85('0xa')](_0x7a85('0x14'),_0xaf1e7d);logger[_0x7a85('0xd')]('CreateSquareRecording',_0xaf1e7d,JSON[_0x7a85('0x19')](_0x2eeb6a));_0x2c572e(_0x2eeb6a);})[_0x7a85('0x13')](function(_0x51fa09){logger[_0x7a85('0xf')](_0x7a85('0x14'),_0x51fa09['message'],_0xaf1e7d);_0x38ac09(_0x4c70d4[_0x7a85('0xf')](0x1f4,_0x51fa09['message']));});});}; \ No newline at end of file +var _0x954d=['raw','then','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','catch','CreateSquareRecording','SquareRecording','options'];(function(_0x527733,_0x4266c1){var _0x20cf91=function(_0x139e39){while(--_0x139e39){_0x527733['push'](_0x527733['shift']());}};_0x20cf91(++_0x4266c1);}(_0x954d,0xd1));var _0xd954=function(_0x33392d,_0x43d006){_0x33392d=_0x33392d-0x0;var _0x3fe2d5=_0x954d[_0x33392d];return _0x3fe2d5;};'use strict';var _=require('lodash');var util=require(_0xd954('0x0'));var moment=require('moment');var BPromise=require(_0xd954('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd954('0x2'))['db'];var utils=require(_0xd954('0x3'));var logger=require('../../config/logger')(_0xd954('0x4'));var config=require(_0xd954('0x5'));var jayson=require(_0xd954('0x6'));var client=jayson[_0xd954('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ddc49,_0x30551c,_0x1f21b0){return new BPromise(function(_0xdbac30,_0x3982d5){return client[_0xd954('0x8')](_0x4ddc49,_0x1f21b0)['then'](function(_0x19e8de){logger[_0xd954('0x9')]('SquareRecording,\x20%s,\x20%s',_0x30551c,_0xd954('0xa'));logger[_0xd954('0xb')](_0xd954('0xc'),_0x30551c,'request\x20sent',JSON[_0xd954('0xd')](_0x19e8de));if(_0x19e8de[_0xd954('0xe')]){if(_0x19e8de[_0xd954('0xe')]['code']===0x1f4){logger[_0xd954('0xe')](_0xd954('0xf'),_0x30551c,_0x19e8de[_0xd954('0xe')][_0xd954('0x10')]);return _0x3982d5(_0x19e8de[_0xd954('0xe')][_0xd954('0x10')]);}logger[_0xd954('0xe')](_0xd954('0xf'),_0x30551c,_0x19e8de[_0xd954('0xe')]['message']);return _0xdbac30(_0x19e8de[_0xd954('0xe')][_0xd954('0x10')]);}else{logger[_0xd954('0x9')](_0xd954('0xf'),_0x30551c,'request\x20sent');_0xdbac30(_0x19e8de['result'][_0xd954('0x10')]);}})[_0xd954('0x11')](function(_0x210efb){logger[_0xd954('0xe')](_0xd954('0xf'),_0x30551c,_0x210efb);_0x3982d5(_0x210efb);});});}exports[_0xd954('0x12')]=function(_0x22f6d4){var _0xfc6833=this;return new Promise(function(_0x320485,_0x47bc4f){return db[_0xd954('0x13')]['create'](_0x22f6d4['body'],{'raw':_0x22f6d4[_0xd954('0x14')]?_0x22f6d4[_0xd954('0x14')][_0xd954('0x15')]===undefined?!![]:![]:!![]})[_0xd954('0x16')](function(_0x26c356){logger['info'](_0xd954('0x12'),_0x22f6d4);logger[_0xd954('0xb')]('CreateSquareRecording',_0x22f6d4,JSON[_0xd954('0xd')](_0x26c356));_0x320485(_0x26c356);})[_0xd954('0x11')](function(_0x2690b7){logger['error']('CreateSquareRecording',_0x2690b7[_0xd954('0x10')],_0x22f6d4);_0x47bc4f(_0xfc6833[_0xd954('0xe')](0x1f4,_0x2690b7[_0xd954('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6417949..26a2dad 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 _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(_0x16a317,_0x43d3f7){var _0x1ef1cf=function(_0x35baff){while(--_0x35baff){_0x16a317['push'](_0x16a317['shift']());}};_0x1ef1cf(++_0x43d3f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.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 _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(_0xf59719,_0x15731b){var _0x14a5a2=function(_0x2c3fb5){while(--_0x2c3fb5){_0xf59719['push'](_0xf59719['shift']());}};_0x14a5a2(++_0x15731b);}(_0xe706,0xa3));var _0x6e70=function(_0x414810,_0x5e924d){_0x414810=_0x414810-0x0;var _0x2d4df5=_0xe706[_0x414810];return _0x2d4df5;};'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 38ae274..1e5863b 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 _0x57b2=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0x57b2,0xda));var _0x257b=function(_0x4ea62e,_0x1edc84){_0x4ea62e=_0x4ea62e-0x0;var _0x2069d9=_0x57b2[_0x4ea62e];return _0x2069d9;};'use strict';var Sequelize=require(_0x257b('0x0'));module[_0x257b('0x1')]={'network':{'type':Sequelize[_0x257b('0x2')]},'network_script':{'type':Sequelize[_0x257b('0x2')]},'request':{'type':Sequelize[_0x257b('0x2')]},'channel':{'type':Sequelize[_0x257b('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x257b('0x2')]},'uniqueid':{'type':Sequelize[_0x257b('0x2')]},'version':{'type':Sequelize[_0x257b('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x257b('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x257b('0x2')]},'rdnis':{'type':Sequelize[_0x257b('0x2')]},'context':{'type':Sequelize[_0x257b('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x257b('0x2')]},'enhanced':{'type':Sequelize[_0x257b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x257b('0x2')]},'project_name':{'type':Sequelize[_0x257b('0x2')]},'joinAt':{'type':Sequelize[_0x257b('0x3')]},'leaveAt':{'type':Sequelize[_0x257b('0x3')]},'bot':{'type':Sequelize[_0x257b('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xa8d0=['exports','STRING','DATE','BOOLEAN'];(function(_0x447a15,_0xd2e541){var _0x44180b=function(_0x157c7d){while(--_0x157c7d){_0x447a15['push'](_0x447a15['shift']());}};_0x44180b(++_0xd2e541);}(_0xa8d0,0x11c));var _0x0a8d=function(_0x16c66c,_0x239f3a){_0x16c66c=_0x16c66c-0x0;var _0x17e9d7=_0xa8d0[_0x16c66c];return _0x17e9d7;};'use strict';var Sequelize=require('sequelize');module[_0x0a8d('0x0')]={'network':{'type':Sequelize[_0x0a8d('0x1')]},'network_script':{'type':Sequelize[_0x0a8d('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0a8d('0x1')]},'language':{'type':Sequelize[_0x0a8d('0x1')]},'type':{'type':Sequelize[_0x0a8d('0x1')]},'uniqueid':{'type':Sequelize[_0x0a8d('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0a8d('0x1')]},'calleridname':{'type':Sequelize[_0x0a8d('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x0a8d('0x1')]},'callington':{'type':Sequelize[_0x0a8d('0x1')]},'callingtns':{'type':Sequelize[_0x0a8d('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x0a8d('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0a8d('0x1')]},'priority':{'type':Sequelize[_0x0a8d('0x1')]},'enhanced':{'type':Sequelize[_0x0a8d('0x1')]},'accountcode':{'type':Sequelize[_0x0a8d('0x1')]},'threadid':{'type':Sequelize[_0x0a8d('0x1')]},'project_name':{'type':Sequelize[_0x0a8d('0x1')]},'joinAt':{'type':Sequelize[_0x0a8d('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x0a8d('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 7104fb3..35f608e 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 _0x4e6f=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','SquareReport','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x834d91,_0x329507){var _0x4e0193=function(_0x58e72e){while(--_0x58e72e){_0x834d91['push'](_0x834d91['shift']());}};_0x4e0193(++_0x329507);}(_0x4e6f,0xda));var _0xf4e6=function(_0x484273,_0x1f71bf){_0x484273=_0x484273-0x0;var _0x297c9c=_0x4e6f[_0x484273];return _0x297c9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4e6('0x1'));var rp=require(_0xf4e6('0x2'));var moment=require(_0xf4e6('0x3'));var BPromise=require(_0xf4e6('0x4'));var Mustache=require(_0xf4e6('0x5'));var util=require(_0xf4e6('0x6'));var path=require(_0xf4e6('0x7'));var sox=require(_0xf4e6('0x8'));var csv=require(_0xf4e6('0x9'));var ejs=require(_0xf4e6('0xa'));var fs=require('fs');var fs_extra=require(_0xf4e6('0xb'));var _=require('lodash');var squel=require(_0xf4e6('0xc'));var crypto=require(_0xf4e6('0xd'));var jsforce=require(_0xf4e6('0xe'));var deskjs=require(_0xf4e6('0xf'));var toCsv=require(_0xf4e6('0x9'));var querystring=require(_0xf4e6('0x10'));var Papa=require(_0xf4e6('0x11'));var Redis=require(_0xf4e6('0x12'));var authService=require(_0xf4e6('0x13'));var qs=require(_0xf4e6('0x14'));var as=require(_0xf4e6('0x15'));var hardwareService=require(_0xf4e6('0x16'));var logger=require(_0xf4e6('0x17'))('api');var utils=require(_0xf4e6('0x18'));var config=require(_0xf4e6('0x19'));var licenseUtil=require(_0xf4e6('0x1a'));var db=require(_0xf4e6('0x1b'))['db'];function respondWithStatusCode(_0x3d2f62,_0x453810){_0x453810=_0x453810||0xcc;return function(_0x53dac1){if(_0x53dac1){return _0x3d2f62['sendStatus'](_0x453810);}return _0x3d2f62[_0xf4e6('0x1c')](_0x453810)[_0xf4e6('0x1d')]();};}function respondWithResult(_0x45725c,_0x4d2cb8){_0x4d2cb8=_0x4d2cb8||0xc8;return function(_0x2701d5){if(_0x2701d5){return _0x45725c['status'](_0x4d2cb8)[_0xf4e6('0x1e')](_0x2701d5);}};}function respondWithFilteredResult(_0x18c279,_0xe3780e){return function(_0x129b32){if(_0x129b32){var _0x3bcf8d=typeof _0xe3780e['offset']===_0xf4e6('0x1f')&&typeof _0xe3780e[_0xf4e6('0x20')]===_0xf4e6('0x1f');var _0x5e2d5b=_0x129b32[_0xf4e6('0x21')];var _0x25b6f5=_0x3bcf8d?0x0:_0xe3780e[_0xf4e6('0x22')];var _0x4d5431=_0x3bcf8d?_0x129b32['count']:_0xe3780e[_0xf4e6('0x22')]+_0xe3780e[_0xf4e6('0x20')];var _0x3fff7b;if(_0x4d5431>=_0x5e2d5b){_0x4d5431=_0x5e2d5b;_0x3fff7b=0xc8;}else{_0x3fff7b=0xce;}_0x18c279[_0xf4e6('0x1c')](_0x3fff7b);return _0x18c279['set'](_0xf4e6('0x23'),_0x25b6f5+'-'+_0x4d5431+'/'+_0x5e2d5b)[_0xf4e6('0x1e')](_0x129b32);}return null;};}function patchUpdates(_0xf54eab){return function(_0x3a3cb1){try{jsonpatch[_0xf4e6('0x24')](_0x3a3cb1,_0xf54eab,!![]);}catch(_0xb9df17){return BPromise[_0xf4e6('0x25')](_0xb9df17);}return _0x3a3cb1[_0xf4e6('0x26')]();};}function saveUpdates(_0x2d1d3d,_0x53946c){return function(_0x3d4071){if(_0x3d4071){return _0x3d4071['update'](_0x2d1d3d)[_0xf4e6('0x27')](function(_0x2bfa9e){return _0x2bfa9e;});}return null;};}function removeEntity(_0x476da5,_0x3025a1){return function(_0x4f30a4){if(_0x4f30a4){return _0x4f30a4[_0xf4e6('0x28')]()[_0xf4e6('0x27')](function(){_0x476da5[_0xf4e6('0x1c')](0xcc)[_0xf4e6('0x1d')]();});}};}function handleEntityNotFound(_0x41f1ce,_0x19198b){return function(_0x55df1e){if(!_0x55df1e){_0x41f1ce[_0xf4e6('0x29')](0x194);}return _0x55df1e;};}function handleError(_0x33d12d,_0x35b007){_0x35b007=_0x35b007||0x1f4;return function(_0x4891c1){logger[_0xf4e6('0x2a')](_0x4891c1['stack']);if(_0x4891c1[_0xf4e6('0x2b')]){delete _0x4891c1[_0xf4e6('0x2b')];}_0x33d12d[_0xf4e6('0x1c')](_0x35b007)[_0xf4e6('0x2c')](_0x4891c1);};}exports[_0xf4e6('0x2d')]=function(_0x59458d,_0x26efe){var _0x41553c={},_0x4d196c={},_0xf05946={'count':0x0,'rows':[]};var _0x40fdf8=_[_0xf4e6('0x2e')](db[_0xf4e6('0x2f')][_0xf4e6('0x30')],function(_0x398c2f){return{'name':_0x398c2f['fieldName'],'type':_0x398c2f[_0xf4e6('0x31')][_0xf4e6('0x32')]};});_0x4d196c['model']=_['map'](_0x40fdf8,'name');_0x4d196c[_0xf4e6('0x33')]=_[_0xf4e6('0x34')](_0x59458d[_0xf4e6('0x33')]);_0x4d196c['filters']=_[_0xf4e6('0x35')](_0x4d196c[_0xf4e6('0x36')],_0x4d196c['query']);_0x41553c['attributes']=_['intersection'](_0x4d196c[_0xf4e6('0x36')],qs[_0xf4e6('0x37')](_0x59458d[_0xf4e6('0x33')][_0xf4e6('0x37')]));_0x41553c['attributes']=_0x41553c[_0xf4e6('0x38')][_0xf4e6('0x39')]?_0x41553c[_0xf4e6('0x38')]:_0x4d196c[_0xf4e6('0x36')];if(!_0x59458d[_0xf4e6('0x33')][_0xf4e6('0x3a')](_0xf4e6('0x3b'))){_0x41553c['limit']=qs[_0xf4e6('0x20')](_0x59458d[_0xf4e6('0x33')][_0xf4e6('0x20')]);_0x41553c[_0xf4e6('0x22')]=qs['offset'](_0x59458d[_0xf4e6('0x33')][_0xf4e6('0x22')]);}_0x41553c[_0xf4e6('0x3c')]=qs[_0xf4e6('0x3d')](_0x59458d[_0xf4e6('0x33')]['sort']);_0x41553c[_0xf4e6('0x3e')]=qs[_0xf4e6('0x3f')](_[_0xf4e6('0x40')](_0x59458d[_0xf4e6('0x33')],_0x4d196c[_0xf4e6('0x3f')]),_0x40fdf8);if(_0x59458d[_0xf4e6('0x33')]['filter']){_0x41553c[_0xf4e6('0x3e')]=_[_0xf4e6('0x41')](_0x41553c['where'],{'$or':_[_0xf4e6('0x2e')](_0x40fdf8,function(_0x30df64){if(_0x30df64[_0xf4e6('0x31')]!==_0xf4e6('0x42')){var _0x3bb98c={};_0x3bb98c[_0x30df64[_0xf4e6('0x2b')]]={'$like':'%'+_0x59458d['query'][_0xf4e6('0x43')]+'%'};return _0x3bb98c;}})});}_0x41553c=_[_0xf4e6('0x41')]({},_0x41553c,_0x59458d['options']);var _0xc95373={'where':_0x41553c[_0xf4e6('0x3e')]};return db[_0xf4e6('0x2f')][_0xf4e6('0x21')](_0xc95373)['then'](function(_0x51e87d){_0xf05946[_0xf4e6('0x21')]=_0x51e87d;if(_0x59458d[_0xf4e6('0x33')][_0xf4e6('0x44')]){_0x41553c[_0xf4e6('0x45')]=[{'all':!![]}];}return db[_0xf4e6('0x2f')][_0xf4e6('0x46')](_0x41553c);})[_0xf4e6('0x27')](function(_0xc7e31d){_0xf05946[_0xf4e6('0x47')]=_0xc7e31d;return _0xf05946;})['then'](respondWithFilteredResult(_0x26efe,_0x41553c))[_0xf4e6('0x48')](handleError(_0x26efe,null));};exports[_0xf4e6('0x49')]=function(_0x1b23f3,_0x4176cb){var _0x3779ac={'raw':!![],'where':{'id':_0x1b23f3['params']['id']}},_0x43d66f={};_0x43d66f['model']=_[_0xf4e6('0x34')](db['SquareReport'][_0xf4e6('0x30')]);_0x43d66f[_0xf4e6('0x33')]=_[_0xf4e6('0x34')](_0x1b23f3[_0xf4e6('0x33')]);_0x43d66f[_0xf4e6('0x3f')]=_[_0xf4e6('0x35')](_0x43d66f[_0xf4e6('0x36')],_0x43d66f['query']);_0x3779ac[_0xf4e6('0x38')]=_[_0xf4e6('0x35')](_0x43d66f['model'],qs[_0xf4e6('0x37')](_0x1b23f3[_0xf4e6('0x33')][_0xf4e6('0x37')]));_0x3779ac[_0xf4e6('0x38')]=_0x3779ac[_0xf4e6('0x38')][_0xf4e6('0x39')]?_0x3779ac[_0xf4e6('0x38')]:_0x43d66f[_0xf4e6('0x36')];if(_0x1b23f3[_0xf4e6('0x33')]['includeAll']){_0x3779ac[_0xf4e6('0x45')]=[{'all':!![]}];}_0x3779ac=_[_0xf4e6('0x41')]({},_0x3779ac,_0x1b23f3['options']);return db[_0xf4e6('0x2f')][_0xf4e6('0x4a')](_0x3779ac)['then'](handleEntityNotFound(_0x4176cb,null))[_0xf4e6('0x27')](respondWithResult(_0x4176cb,null))[_0xf4e6('0x48')](handleError(_0x4176cb,null));};exports['create']=function(_0x54205e,_0x3fe4b3){return db[_0xf4e6('0x2f')][_0xf4e6('0x4b')](_0x54205e[_0xf4e6('0x4c')],{})['then'](respondWithResult(_0x3fe4b3,0xc9))[_0xf4e6('0x48')](handleError(_0x3fe4b3,null));};exports[_0xf4e6('0x4d')]=function(_0x4d3168,_0x26570e){if(_0x4d3168[_0xf4e6('0x4c')]['id']){delete _0x4d3168[_0xf4e6('0x4c')]['id'];}return db[_0xf4e6('0x2f')][_0xf4e6('0x4a')]({'where':{'id':_0x4d3168[_0xf4e6('0x4e')]['id']}})[_0xf4e6('0x27')](handleEntityNotFound(_0x26570e,null))[_0xf4e6('0x27')](saveUpdates(_0x4d3168[_0xf4e6('0x4c')],null))[_0xf4e6('0x27')](respondWithResult(_0x26570e,null))[_0xf4e6('0x48')](handleError(_0x26570e,null));};exports['destroy']=function(_0x508909,_0x44b2f4){return db[_0xf4e6('0x2f')][_0xf4e6('0x4a')]({'where':{'id':_0x508909[_0xf4e6('0x4e')]['id']}})[_0xf4e6('0x27')](handleEntityNotFound(_0x44b2f4,null))['then'](removeEntity(_0x44b2f4,null))['catch'](handleError(_0x44b2f4,null));};exports[_0xf4e6('0x4f')]=function(_0x21bc44,_0x4abe48){return db[_0xf4e6('0x2f')]['describe']()[_0xf4e6('0x27')](respondWithResult(_0x4abe48,null))[_0xf4e6('0x48')](handleError(_0x4abe48,null));}; \ No newline at end of file +var _0xcb26=['limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x493564,_0x19f94d){var _0x530218=function(_0x1e5eb2){while(--_0x1e5eb2){_0x493564['push'](_0x493564['shift']());}};_0x530218(++_0x19f94d);}(_0xcb26,0x1d4));var _0x6cb2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xcb26[_0x1b4b23];return _0x2a325b;};'use strict';var emlformat=require(_0x6cb2('0x0'));var rimraf=require(_0x6cb2('0x1'));var zipdir=require(_0x6cb2('0x2'));var jsonpatch=require(_0x6cb2('0x3'));var rp=require(_0x6cb2('0x4'));var moment=require(_0x6cb2('0x5'));var BPromise=require(_0x6cb2('0x6'));var Mustache=require(_0x6cb2('0x7'));var util=require(_0x6cb2('0x8'));var path=require(_0x6cb2('0x9'));var sox=require('sox');var csv=require(_0x6cb2('0xa'));var ejs=require(_0x6cb2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cb2('0xc'));var squel=require(_0x6cb2('0xd'));var crypto=require('crypto');var jsforce=require(_0x6cb2('0xe'));var deskjs=require(_0x6cb2('0xf'));var toCsv=require(_0x6cb2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cb2('0x10'));var as=require(_0x6cb2('0x11'));var hardwareService=require(_0x6cb2('0x12'));var logger=require('../../config/logger')(_0x6cb2('0x13'));var utils=require(_0x6cb2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6cb2('0x15'));var db=require(_0x6cb2('0x16'))['db'];function respondWithStatusCode(_0x45c59f,_0x4734a4){_0x4734a4=_0x4734a4||0xcc;return function(_0x2eca49){if(_0x2eca49){return _0x45c59f[_0x6cb2('0x17')](_0x4734a4);}return _0x45c59f[_0x6cb2('0x18')](_0x4734a4)[_0x6cb2('0x19')]();};}function respondWithResult(_0x2b7c83,_0x11ac24){_0x11ac24=_0x11ac24||0xc8;return function(_0x2eb460){if(_0x2eb460){return _0x2b7c83[_0x6cb2('0x18')](_0x11ac24)[_0x6cb2('0x1a')](_0x2eb460);}};}function respondWithFilteredResult(_0xd5603,_0x799a18){return function(_0x590129){if(_0x590129){var _0x33c129=typeof _0x799a18[_0x6cb2('0x1b')]===_0x6cb2('0x1c')&&typeof _0x799a18[_0x6cb2('0x1d')]==='undefined';var _0x214297=_0x590129[_0x6cb2('0x1e')];var _0x4a203b=_0x33c129?0x0:_0x799a18[_0x6cb2('0x1b')];var _0x43bf4d=_0x33c129?_0x590129['count']:_0x799a18[_0x6cb2('0x1b')]+_0x799a18[_0x6cb2('0x1d')];var _0x2bd10f;if(_0x43bf4d>=_0x214297){_0x43bf4d=_0x214297;_0x2bd10f=0xc8;}else{_0x2bd10f=0xce;}_0xd5603['status'](_0x2bd10f);return _0xd5603[_0x6cb2('0x1f')](_0x6cb2('0x20'),_0x4a203b+'-'+_0x43bf4d+'/'+_0x214297)['json'](_0x590129);}return null;};}function patchUpdates(_0x27851e){return function(_0x1932ae){try{jsonpatch['apply'](_0x1932ae,_0x27851e,!![]);}catch(_0x27d5bb){return BPromise['reject'](_0x27d5bb);}return _0x1932ae[_0x6cb2('0x21')]();};}function saveUpdates(_0x2b8eac,_0x36f5b8){return function(_0x27882b){if(_0x27882b){return _0x27882b[_0x6cb2('0x22')](_0x2b8eac)[_0x6cb2('0x23')](function(_0x1a7d72){return _0x1a7d72;});}return null;};}function removeEntity(_0x20981b,_0x6e6385){return function(_0x33d399){if(_0x33d399){return _0x33d399[_0x6cb2('0x24')]()[_0x6cb2('0x23')](function(){_0x20981b[_0x6cb2('0x18')](0xcc)[_0x6cb2('0x19')]();});}};}function handleEntityNotFound(_0x1537cf,_0xcc79b4){return function(_0x32cb53){if(!_0x32cb53){_0x1537cf['sendStatus'](0x194);}return _0x32cb53;};}function handleError(_0x115427,_0x24a4a1){_0x24a4a1=_0x24a4a1||0x1f4;return function(_0x40f49d){logger['error'](_0x40f49d[_0x6cb2('0x25')]);if(_0x40f49d['name']){delete _0x40f49d[_0x6cb2('0x26')];}_0x115427[_0x6cb2('0x18')](_0x24a4a1)[_0x6cb2('0x27')](_0x40f49d);};}exports[_0x6cb2('0x28')]=function(_0x39f2a5,_0x422a80){var _0x2a1a89={},_0x589a57={},_0x16bf4e={'count':0x0,'rows':[]};var _0x4c07b7=_[_0x6cb2('0x29')](db[_0x6cb2('0x2a')]['rawAttributes'],function(_0xa1b794){return{'name':_0xa1b794[_0x6cb2('0x2b')],'type':_0xa1b794[_0x6cb2('0x2c')][_0x6cb2('0x2d')]};});_0x589a57[_0x6cb2('0x2e')]=_[_0x6cb2('0x29')](_0x4c07b7,_0x6cb2('0x26'));_0x589a57[_0x6cb2('0x2f')]=_[_0x6cb2('0x30')](_0x39f2a5[_0x6cb2('0x2f')]);_0x589a57[_0x6cb2('0x31')]=_[_0x6cb2('0x32')](_0x589a57[_0x6cb2('0x2e')],_0x589a57[_0x6cb2('0x2f')]);_0x2a1a89[_0x6cb2('0x33')]=_[_0x6cb2('0x32')](_0x589a57[_0x6cb2('0x2e')],qs[_0x6cb2('0x34')](_0x39f2a5[_0x6cb2('0x2f')][_0x6cb2('0x34')]));_0x2a1a89[_0x6cb2('0x33')]=_0x2a1a89[_0x6cb2('0x33')][_0x6cb2('0x35')]?_0x2a1a89[_0x6cb2('0x33')]:_0x589a57['model'];if(!_0x39f2a5[_0x6cb2('0x2f')]['hasOwnProperty'](_0x6cb2('0x36'))){_0x2a1a89[_0x6cb2('0x1d')]=qs['limit'](_0x39f2a5[_0x6cb2('0x2f')][_0x6cb2('0x1d')]);_0x2a1a89[_0x6cb2('0x1b')]=qs[_0x6cb2('0x1b')](_0x39f2a5[_0x6cb2('0x2f')][_0x6cb2('0x1b')]);}_0x2a1a89['order']=qs['sort'](_0x39f2a5[_0x6cb2('0x2f')][_0x6cb2('0x37')]);_0x2a1a89[_0x6cb2('0x38')]=qs[_0x6cb2('0x31')](_['pick'](_0x39f2a5[_0x6cb2('0x2f')],_0x589a57[_0x6cb2('0x31')]),_0x4c07b7);if(_0x39f2a5[_0x6cb2('0x2f')][_0x6cb2('0x39')]){_0x2a1a89[_0x6cb2('0x38')]=_[_0x6cb2('0x3a')](_0x2a1a89[_0x6cb2('0x38')],{'$or':_[_0x6cb2('0x29')](_0x4c07b7,function(_0x1b2429){if(_0x1b2429[_0x6cb2('0x2c')]!=='VIRTUAL'){var _0x305c42={};_0x305c42[_0x1b2429[_0x6cb2('0x26')]]={'$like':'%'+_0x39f2a5[_0x6cb2('0x2f')][_0x6cb2('0x39')]+'%'};return _0x305c42;}})});}_0x2a1a89=_[_0x6cb2('0x3a')]({},_0x2a1a89,_0x39f2a5['options']);var _0x240c07={'where':_0x2a1a89[_0x6cb2('0x38')]};return db[_0x6cb2('0x2a')]['count'](_0x240c07)[_0x6cb2('0x23')](function(_0x304d66){_0x16bf4e['count']=_0x304d66;if(_0x39f2a5[_0x6cb2('0x2f')]['includeAll']){_0x2a1a89[_0x6cb2('0x3b')]=[{'all':!![]}];}return db[_0x6cb2('0x2a')][_0x6cb2('0x3c')](_0x2a1a89);})[_0x6cb2('0x23')](function(_0x52ecf3){_0x16bf4e[_0x6cb2('0x3d')]=_0x52ecf3;return _0x16bf4e;})[_0x6cb2('0x23')](respondWithFilteredResult(_0x422a80,_0x2a1a89))[_0x6cb2('0x3e')](handleError(_0x422a80,null));};exports[_0x6cb2('0x3f')]=function(_0x41e72c,_0x36b267){var _0xd62e62={'raw':!![],'where':{'id':_0x41e72c[_0x6cb2('0x40')]['id']}},_0x813168={};_0x813168[_0x6cb2('0x2e')]=_[_0x6cb2('0x30')](db['SquareReport'][_0x6cb2('0x41')]);_0x813168['query']=_[_0x6cb2('0x30')](_0x41e72c['query']);_0x813168[_0x6cb2('0x31')]=_[_0x6cb2('0x32')](_0x813168[_0x6cb2('0x2e')],_0x813168[_0x6cb2('0x2f')]);_0xd62e62['attributes']=_['intersection'](_0x813168[_0x6cb2('0x2e')],qs[_0x6cb2('0x34')](_0x41e72c[_0x6cb2('0x2f')][_0x6cb2('0x34')]));_0xd62e62[_0x6cb2('0x33')]=_0xd62e62[_0x6cb2('0x33')][_0x6cb2('0x35')]?_0xd62e62[_0x6cb2('0x33')]:_0x813168[_0x6cb2('0x2e')];if(_0x41e72c[_0x6cb2('0x2f')][_0x6cb2('0x42')]){_0xd62e62[_0x6cb2('0x3b')]=[{'all':!![]}];}_0xd62e62=_['merge']({},_0xd62e62,_0x41e72c['options']);return db[_0x6cb2('0x2a')][_0x6cb2('0x43')](_0xd62e62)[_0x6cb2('0x23')](handleEntityNotFound(_0x36b267,null))[_0x6cb2('0x23')](respondWithResult(_0x36b267,null))['catch'](handleError(_0x36b267,null));};exports[_0x6cb2('0x44')]=function(_0xcf8834,_0x3f5d7b){return db[_0x6cb2('0x2a')][_0x6cb2('0x44')](_0xcf8834[_0x6cb2('0x45')],{})[_0x6cb2('0x23')](respondWithResult(_0x3f5d7b,0xc9))[_0x6cb2('0x3e')](handleError(_0x3f5d7b,null));};exports['update']=function(_0x2438d4,_0x4aff28){if(_0x2438d4[_0x6cb2('0x45')]['id']){delete _0x2438d4[_0x6cb2('0x45')]['id'];}return db[_0x6cb2('0x2a')][_0x6cb2('0x43')]({'where':{'id':_0x2438d4[_0x6cb2('0x40')]['id']}})[_0x6cb2('0x23')](handleEntityNotFound(_0x4aff28,null))[_0x6cb2('0x23')](saveUpdates(_0x2438d4[_0x6cb2('0x45')],null))[_0x6cb2('0x23')](respondWithResult(_0x4aff28,null))['catch'](handleError(_0x4aff28,null));};exports[_0x6cb2('0x24')]=function(_0x30a75f,_0x2fedc7){return db[_0x6cb2('0x2a')][_0x6cb2('0x43')]({'where':{'id':_0x30a75f[_0x6cb2('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fedc7,null))[_0x6cb2('0x23')](removeEntity(_0x2fedc7,null))[_0x6cb2('0x3e')](handleError(_0x2fedc7,null));};exports[_0x6cb2('0x46')]=function(_0xb5b1b0,_0x3edf58){return db[_0x6cb2('0x2a')][_0x6cb2('0x46')]()['then'](respondWithResult(_0x3edf58,null))[_0x6cb2('0x3e')](handleError(_0x3edf58,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e9c17dc..4ce6a19 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 _0xa82c=['SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','bluebird','path','rimraf','./squareReport.attributes','exports','define'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0xa82c,0x123));var _0xca82=function(_0x10a07d,_0x11ce6e){_0x10a07d=_0x10a07d-0x0;var _0x45d7ec=_0xa82c[_0x10a07d];return _0x45d7ec;};'use strict';var _=require(_0xca82('0x0'));var util=require('util');var logger=require(_0xca82('0x1'))('api');var moment=require('moment');var BPromise=require(_0xca82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca82('0x3'));var rimraf=require(_0xca82('0x4'));var config=require('../../config/environment');var attributes=require(_0xca82('0x5'));module[_0xca82('0x6')]=function(_0x3b08a0,_0x114661){return _0x3b08a0[_0xca82('0x7')](_0xca82('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xca82('0x9'),'fields':[_0xca82('0xa'),_0xca82('0xb')]},{'name':_0xca82('0xc'),'fields':[_0xca82('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x633e=['rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4f0432,_0xa6ee3b){var _0x114638=function(_0x489b3f){while(--_0x489b3f){_0x4f0432['push'](_0x4f0432['shift']());}};_0x114638(++_0xa6ee3b);}(_0x633e,0xae));var _0xe633=function(_0x486efa,_0x5b9404){_0x486efa=_0x486efa-0x0;var _0x1529c6=_0x633e[_0x486efa];return _0x1529c6;};'use strict';var _=require(_0xe633('0x0'));var util=require(_0xe633('0x1'));var logger=require(_0xe633('0x2'))(_0xe633('0x3'));var moment=require(_0xe633('0x4'));var BPromise=require(_0xe633('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe633('0x6'));var config=require(_0xe633('0x7'));var attributes=require(_0xe633('0x8'));module['exports']=function(_0x52f5c0,_0x4eb8c6){return _0x52f5c0[_0xe633('0x9')](_0xe633('0xa'),attributes,{'tableName':_0xe633('0xb'),'paranoid':![],'indexes':[{'name':_0xe633('0xc'),'fields':[_0xe633('0xd'),'project_name']},{'name':_0xe633('0xe'),'fields':[_0xe633('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 9700ba2..1fcbb87 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 _0xfcbb=['options','then','stringify','SquareReport','update','raw','where','attributes','UpdateSquareReport','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateSquareReport','create','body'];(function(_0x52dd39,_0xdb90a5){var _0x1d4076=function(_0x19c184){while(--_0x19c184){_0x52dd39['push'](_0x52dd39['shift']());}};_0x1d4076(++_0xdb90a5);}(_0xfcbb,0x8e));var _0xbfcb=function(_0x5550ef,_0x9d2e90){_0x5550ef=_0x5550ef-0x0;var _0x287bae=_0xfcbb[_0x5550ef];return _0x287bae;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require(_0xbfcb('0x3'));var rs=require(_0xbfcb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfcb('0x7'));var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4856d1,_0x4c8fef,_0x24c167){return new BPromise(function(_0x243ca8,_0x4bfd4e){return client[_0xbfcb('0xa')](_0x4856d1,_0x24c167)['then'](function(_0x118665){logger['info'](_0xbfcb('0xb'),_0x4c8fef,'request\x20sent');logger[_0xbfcb('0xc')](_0xbfcb('0xd'),_0x4c8fef,_0xbfcb('0xe'),JSON['stringify'](_0x118665));if(_0x118665[_0xbfcb('0xf')]){if(_0x118665[_0xbfcb('0xf')][_0xbfcb('0x10')]===0x1f4){logger[_0xbfcb('0xf')]('SquareReport,\x20%s,\x20%s',_0x4c8fef,_0x118665[_0xbfcb('0xf')][_0xbfcb('0x11')]);return _0x4bfd4e(_0x118665[_0xbfcb('0xf')][_0xbfcb('0x11')]);}logger['error'](_0xbfcb('0xb'),_0x4c8fef,_0x118665[_0xbfcb('0xf')][_0xbfcb('0x11')]);return _0x243ca8(_0x118665[_0xbfcb('0xf')][_0xbfcb('0x11')]);}else{logger[_0xbfcb('0x12')](_0xbfcb('0xb'),_0x4c8fef,_0xbfcb('0xe'));_0x243ca8(_0x118665[_0xbfcb('0x13')][_0xbfcb('0x11')]);}})['catch'](function(_0x56ac5b){logger[_0xbfcb('0xf')](_0xbfcb('0xb'),_0x4c8fef,_0x56ac5b);_0x4bfd4e(_0x56ac5b);});});}exports[_0xbfcb('0x14')]=function(_0x4273e8){var _0x526163=this;return new Promise(function(_0x196772,_0x27917e){return db['SquareReport'][_0xbfcb('0x15')](_0x4273e8[_0xbfcb('0x16')],{'raw':_0x4273e8[_0xbfcb('0x17')]?_0x4273e8[_0xbfcb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0x18')](function(_0x38b14d){logger['info'](_0xbfcb('0x14'),_0x4273e8);logger['debug'](_0xbfcb('0x14'),_0x4273e8,JSON[_0xbfcb('0x19')](_0x38b14d));_0x196772(_0x38b14d);})['catch'](function(_0x53bf91){logger[_0xbfcb('0xf')](_0xbfcb('0x14'),_0x53bf91[_0xbfcb('0x11')],_0x4273e8);_0x27917e(_0x526163[_0xbfcb('0xf')](0x1f4,_0x53bf91[_0xbfcb('0x11')]));});});};exports['UpdateSquareReport']=function(_0x497cae){var _0x39bab9=this;return new Promise(function(_0x230d33,_0x12badc){return db[_0xbfcb('0x1a')][_0xbfcb('0x1b')](_0x497cae[_0xbfcb('0x16')],{'raw':_0x497cae[_0xbfcb('0x17')]?_0x497cae[_0xbfcb('0x17')][_0xbfcb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x497cae[_0xbfcb('0x17')]?_0x497cae['options'][_0xbfcb('0x1d')]||null:null,'attributes':_0x497cae['options']?_0x497cae['options'][_0xbfcb('0x1e')]||null:null,'limit':_0x497cae['options']?_0x497cae['options']['limit']||null:null})[_0xbfcb('0x18')](function(_0x42acc6){logger[_0xbfcb('0x12')]('UpdateSquareReport',_0x497cae);logger['debug'](_0xbfcb('0x1f'),_0x497cae,JSON[_0xbfcb('0x19')](_0x42acc6));_0x230d33(_0x42acc6);})[_0xbfcb('0x20')](function(_0x2df743){logger['error'](_0xbfcb('0x1f'),_0x2df743[_0xbfcb('0x11')],_0x497cae);_0x12badc(_0x39bab9[_0xbfcb('0xf')](0x1f4,_0x2df743['message']));});});}; \ No newline at end of file +var _0x9795=['attributes','limit','UpdateSquareReport','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareReport','SquareReport','create','options','raw','then','catch','body'];(function(_0x5f584a,_0x47f064){var _0x3788d9=function(_0x29c10b){while(--_0x29c10b){_0x5f584a['push'](_0x5f584a['shift']());}};_0x3788d9(++_0x47f064);}(_0x9795,0x19a));var _0x5979=function(_0x422fbb,_0x404b42){_0x422fbb=_0x422fbb-0x0;var _0x57b265=_0x9795[_0x422fbb];return _0x57b265;};'use strict';var _=require(_0x5979('0x0'));var util=require('util');var moment=require(_0x5979('0x1'));var BPromise=require(_0x5979('0x2'));var rs=require(_0x5979('0x3'));var fs=require('fs');var Redis=require(_0x5979('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5979('0x5'))(_0x5979('0x6'));var config=require(_0x5979('0x7'));var jayson=require(_0x5979('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5384c1,_0x2ec1e5,_0x48e348){return new BPromise(function(_0x48663e,_0x213b92){return client['request'](_0x5384c1,_0x48e348)['then'](function(_0x41706a){logger[_0x5979('0x9')](_0x5979('0xa'),_0x2ec1e5,_0x5979('0xb'));logger[_0x5979('0xc')](_0x5979('0xd'),_0x2ec1e5,_0x5979('0xb'),JSON['stringify'](_0x41706a));if(_0x41706a[_0x5979('0xe')]){if(_0x41706a[_0x5979('0xe')]['code']===0x1f4){logger['error'](_0x5979('0xa'),_0x2ec1e5,_0x41706a[_0x5979('0xe')]['message']);return _0x213b92(_0x41706a[_0x5979('0xe')][_0x5979('0xf')]);}logger['error'](_0x5979('0xa'),_0x2ec1e5,_0x41706a[_0x5979('0xe')][_0x5979('0xf')]);return _0x48663e(_0x41706a[_0x5979('0xe')][_0x5979('0xf')]);}else{logger['info'](_0x5979('0xa'),_0x2ec1e5,_0x5979('0xb'));_0x48663e(_0x41706a[_0x5979('0x10')]['message']);}})['catch'](function(_0x479e05){logger[_0x5979('0xe')](_0x5979('0xa'),_0x2ec1e5,_0x479e05);_0x213b92(_0x479e05);});});}exports[_0x5979('0x11')]=function(_0x86c23e){var _0x5a4ddf=this;return new Promise(function(_0x1e1d0b,_0x4844b5){return db[_0x5979('0x12')][_0x5979('0x13')](_0x86c23e['body'],{'raw':_0x86c23e['options']?_0x86c23e[_0x5979('0x14')][_0x5979('0x15')]===undefined?!![]:![]:!![]})[_0x5979('0x16')](function(_0x127d0c){logger[_0x5979('0x9')](_0x5979('0x11'),_0x86c23e);logger['debug'](_0x5979('0x11'),_0x86c23e,JSON['stringify'](_0x127d0c));_0x1e1d0b(_0x127d0c);})[_0x5979('0x17')](function(_0x1a414f){logger[_0x5979('0xe')](_0x5979('0x11'),_0x1a414f['message'],_0x86c23e);_0x4844b5(_0x5a4ddf[_0x5979('0xe')](0x1f4,_0x1a414f[_0x5979('0xf')]));});});};exports['UpdateSquareReport']=function(_0x428b8f){var _0x49e757=this;return new Promise(function(_0x33f290,_0x354d50){return db[_0x5979('0x12')]['update'](_0x428b8f[_0x5979('0x18')],{'raw':_0x428b8f[_0x5979('0x14')]?_0x428b8f[_0x5979('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x428b8f[_0x5979('0x14')]?_0x428b8f['options']['where']||null:null,'attributes':_0x428b8f['options']?_0x428b8f[_0x5979('0x14')][_0x5979('0x19')]||null:null,'limit':_0x428b8f[_0x5979('0x14')]?_0x428b8f[_0x5979('0x14')][_0x5979('0x1a')]||null:null})['then'](function(_0x35ed5d){logger[_0x5979('0x9')]('UpdateSquareReport',_0x428b8f);logger[_0x5979('0xc')](_0x5979('0x1b'),_0x428b8f,JSON[_0x5979('0x1c')](_0x35ed5d));_0x33f290(_0x35ed5d);})[_0x5979('0x17')](function(_0x4ddbd4){logger['error'](_0x5979('0x1b'),_0x4ddbd4[_0x5979('0xf')],_0x428b8f);_0x354d50(_0x49e757[_0x5979('0xe')](0x1f4,_0x4ddbd4[_0x5979('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b1f8b98..a6e8c14 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 _0x577a=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','destroy'];(function(_0x2f20f8,_0x54a3f2){var _0xfcb1b7=function(_0xfd0c0d){while(--_0xfd0c0d){_0x2f20f8['push'](_0x2f20f8['shift']());}};_0xfcb1b7(++_0x54a3f2);}(_0x577a,0x190));var _0xa577=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x577a[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0xa577('0x0'));var util=require(_0xa577('0x1'));var path=require('path');var timeout=require(_0xa577('0x2'));var express=require(_0xa577('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa577('0x4'));var interaction=require(_0xa577('0x5'));var config=require(_0xa577('0x6'));var controller=require(_0xa577('0x7'));router[_0xa577('0x8')]('/',auth[_0xa577('0x9')](),controller['index']);router[_0xa577('0x8')](_0xa577('0xa'),auth[_0xa577('0x9')](),controller[_0xa577('0xb')]);router[_0xa577('0x8')](_0xa577('0xc'),auth[_0xa577('0x9')](),controller[_0xa577('0xd')]);router[_0xa577('0xe')]('/',auth[_0xa577('0x9')](),controller[_0xa577('0xf')]);router[_0xa577('0x10')](_0xa577('0xc'),auth[_0xa577('0x9')](),controller['update']);router['delete']('/:id',auth[_0xa577('0x9')](),controller[_0xa577('0x11')]);module[_0xa577('0x12')]=router; \ No newline at end of file +var _0xed07=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete'];(function(_0x2577d9,_0x8f2f28){var _0x36fe58=function(_0xbba849){while(--_0xbba849){_0x2577d9['push'](_0x2577d9['shift']());}};_0x36fe58(++_0x8f2f28);}(_0xed07,0x1d0));var _0x7ed0=function(_0x5439eb,_0x2a0bc6){_0x5439eb=_0x5439eb-0x0;var _0x5f17fa=_0xed07[_0x5439eb];return _0x5f17fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7ed0('0x0'));var timeout=require(_0x7ed0('0x1'));var express=require(_0x7ed0('0x2'));var router=express[_0x7ed0('0x3')]();var fs_extra=require(_0x7ed0('0x4'));var auth=require(_0x7ed0('0x5'));var interaction=require(_0x7ed0('0x6'));var config=require(_0x7ed0('0x7'));var controller=require(_0x7ed0('0x8'));router[_0x7ed0('0x9')]('/',auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xb')]);router[_0x7ed0('0x9')]('/describe',auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xc')]);router['get'](_0x7ed0('0xd'),auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xe')]);router['post']('/',auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xf')]);router[_0x7ed0('0x10')](_0x7ed0('0xd'),auth[_0x7ed0('0xa')](),controller[_0x7ed0('0x11')]);router[_0x7ed0('0x12')](_0x7ed0('0xd'),auth['isAuthenticated'](),controller[_0x7ed0('0x13')]);module[_0x7ed0('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index b09e4f3..a1daaef 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 _0xbc7a=['STRING','TEXT','exports'];(function(_0x33ab62,_0x47c87e){var _0x3da597=function(_0x5b2184){while(--_0x5b2184){_0x33ab62['push'](_0x33ab62['shift']());}};_0x3da597(++_0x47c87e);}(_0xbc7a,0x1dc));var _0xabc7=function(_0xe3a3f4,_0x399f60){_0xe3a3f4=_0xe3a3f4-0x0;var _0x176c69=_0xbc7a[_0xe3a3f4];return _0x176c69;};'use strict';var Sequelize=require('sequelize');module[_0xabc7('0x0')]={'uniqueid':{'type':Sequelize[_0xabc7('0x1')]},'node':{'type':Sequelize[_0xabc7('0x1')]},'application':{'type':Sequelize[_0xabc7('0x1')]},'data':{'type':Sequelize[_0xabc7('0x2')]},'project_name':{'type':Sequelize[_0xabc7('0x1')]},'callerid':{'type':Sequelize[_0xabc7('0x1')]}}; \ No newline at end of file +var _0x3105=['STRING','sequelize','exports'];(function(_0x526354,_0x541f56){var _0x33600d=function(_0x1a3c93){while(--_0x1a3c93){_0x526354['push'](_0x526354['shift']());}};_0x33600d(++_0x541f56);}(_0x3105,0x1ae));var _0x5310=function(_0x509246,_0x13403b){_0x509246=_0x509246-0x0;var _0x1db16e=_0x3105[_0x509246];return _0x1db16e;};'use strict';var Sequelize=require(_0x5310('0x0'));module[_0x5310('0x1')]={'uniqueid':{'type':Sequelize[_0x5310('0x2')]},'node':{'type':Sequelize[_0x5310('0x2')]},'application':{'type':Sequelize[_0x5310('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x5310('0x2')]},'callerid':{'type':Sequelize[_0x5310('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9b7688f..b96d6da 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 _0x81d5=['key','model','keys','intersection','query','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','status','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x81d5,0x17d));var _0x581d=function(_0x1c4501,_0x45d368){_0x1c4501=_0x1c4501-0x0;var _0x22a8f6=_0x81d5[_0x1c4501];return _0x22a8f6;};'use strict';var emlformat=require(_0x581d('0x0'));var rimraf=require(_0x581d('0x1'));var zipdir=require(_0x581d('0x2'));var jsonpatch=require(_0x581d('0x3'));var rp=require(_0x581d('0x4'));var moment=require('moment');var BPromise=require(_0x581d('0x5'));var Mustache=require(_0x581d('0x6'));var util=require(_0x581d('0x7'));var path=require('path');var sox=require(_0x581d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x581d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x581d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x581d('0xb'));var querystring=require('querystring');var Papa=require(_0x581d('0xc'));var Redis=require(_0x581d('0xd'));var authService=require(_0x581d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x581d('0xf'));var hardwareService=require(_0x581d('0x10'));var logger=require(_0x581d('0x11'))(_0x581d('0x12'));var utils=require('../../config/utils');var config=require(_0x581d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x581d('0x14'))['db'];function respondWithStatusCode(_0x1c929a,_0x5f5c5a){_0x5f5c5a=_0x5f5c5a||0xcc;return function(_0x11d6f1){if(_0x11d6f1){return _0x1c929a[_0x581d('0x15')](_0x5f5c5a);}return _0x1c929a['status'](_0x5f5c5a)[_0x581d('0x16')]();};}function respondWithResult(_0x4be634,_0x405942){_0x405942=_0x405942||0xc8;return function(_0x11fae1){if(_0x11fae1){return _0x4be634['status'](_0x405942)['json'](_0x11fae1);}};}function respondWithFilteredResult(_0x39d2e6,_0x227637){return function(_0x5c9237){if(_0x5c9237){var _0x327aa4=typeof _0x227637[_0x581d('0x17')]===_0x581d('0x18')&&typeof _0x227637['limit']===_0x581d('0x18');var _0x121c6c=_0x5c9237[_0x581d('0x19')];var _0x2c1858=_0x327aa4?0x0:_0x227637['offset'];var _0xbe67ce=_0x327aa4?_0x5c9237[_0x581d('0x19')]:_0x227637[_0x581d('0x17')]+_0x227637[_0x581d('0x1a')];var _0x2654eb;if(_0xbe67ce>=_0x121c6c){_0xbe67ce=_0x121c6c;_0x2654eb=0xc8;}else{_0x2654eb=0xce;}_0x39d2e6['status'](_0x2654eb);return _0x39d2e6[_0x581d('0x1b')](_0x581d('0x1c'),_0x2c1858+'-'+_0xbe67ce+'/'+_0x121c6c)[_0x581d('0x1d')](_0x5c9237);}return null;};}function patchUpdates(_0x4f8cdb){return function(_0x907e03){try{jsonpatch[_0x581d('0x1e')](_0x907e03,_0x4f8cdb,!![]);}catch(_0x29de15){return BPromise[_0x581d('0x1f')](_0x29de15);}return _0x907e03['save']();};}function saveUpdates(_0x152ebc,_0x54c477){return function(_0x4a4355){if(_0x4a4355){return _0x4a4355[_0x581d('0x20')](_0x152ebc)[_0x581d('0x21')](function(_0x502ffb){return _0x502ffb;});}return null;};}function removeEntity(_0x1c630f,_0x549ede){return function(_0x2a32e5){if(_0x2a32e5){return _0x2a32e5[_0x581d('0x22')]()[_0x581d('0x21')](function(){_0x1c630f[_0x581d('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d560,_0x42f72e){return function(_0x50d2e0){if(!_0x50d2e0){_0x54d560[_0x581d('0x15')](0x194);}return _0x50d2e0;};}function handleError(_0x27aca3,_0x196a98){_0x196a98=_0x196a98||0x1f4;return function(_0xfe59ba){logger[_0x581d('0x24')](_0xfe59ba['stack']);if(_0xfe59ba['name']){delete _0xfe59ba[_0x581d('0x25')];}_0x27aca3[_0x581d('0x23')](_0x196a98)[_0x581d('0x26')](_0xfe59ba);};}exports[_0x581d('0x27')]=function(_0xcc19e9,_0x7caf97){var _0x472cf7={},_0x39fdf3={},_0x2df4a4={'count':0x0,'rows':[]};var _0x4550c3=_[_0x581d('0x28')](db[_0x581d('0x29')][_0x581d('0x2a')],function(_0x398433){return{'name':_0x398433[_0x581d('0x2b')],'type':_0x398433[_0x581d('0x2c')][_0x581d('0x2d')]};});_0x39fdf3[_0x581d('0x2e')]=_['map'](_0x4550c3,_0x581d('0x25'));_0x39fdf3['query']=_[_0x581d('0x2f')](_0xcc19e9['query']);_0x39fdf3['filters']=_[_0x581d('0x30')](_0x39fdf3[_0x581d('0x2e')],_0x39fdf3[_0x581d('0x31')]);_0x472cf7['attributes']=_[_0x581d('0x30')](_0x39fdf3[_0x581d('0x2e')],qs[_0x581d('0x32')](_0xcc19e9[_0x581d('0x31')]['fields']));_0x472cf7[_0x581d('0x33')]=_0x472cf7[_0x581d('0x33')][_0x581d('0x34')]?_0x472cf7[_0x581d('0x33')]:_0x39fdf3[_0x581d('0x2e')];if(!_0xcc19e9['query']['hasOwnProperty'](_0x581d('0x35'))){_0x472cf7[_0x581d('0x1a')]=qs[_0x581d('0x1a')](_0xcc19e9[_0x581d('0x31')][_0x581d('0x1a')]);_0x472cf7[_0x581d('0x17')]=qs[_0x581d('0x17')](_0xcc19e9[_0x581d('0x31')][_0x581d('0x17')]);}_0x472cf7['order']=qs[_0x581d('0x36')](_0xcc19e9['query'][_0x581d('0x36')]);_0x472cf7[_0x581d('0x37')]=qs['filters'](_[_0x581d('0x38')](_0xcc19e9[_0x581d('0x31')],_0x39fdf3[_0x581d('0x39')]),_0x4550c3);if(_0xcc19e9[_0x581d('0x31')][_0x581d('0x3a')]){_0x472cf7[_0x581d('0x37')]=_[_0x581d('0x3b')](_0x472cf7[_0x581d('0x37')],{'$or':_[_0x581d('0x28')](_0x4550c3,function(_0x3b0119){if(_0x3b0119[_0x581d('0x2c')]!=='VIRTUAL'){var _0xaeb1e6={};_0xaeb1e6[_0x3b0119['name']]={'$like':'%'+_0xcc19e9['query']['filter']+'%'};return _0xaeb1e6;}})});}_0x472cf7=_['merge']({},_0x472cf7,_0xcc19e9[_0x581d('0x3c')]);var _0xb09e1={'where':_0x472cf7[_0x581d('0x37')]};return db['SquareDetailsReport']['count'](_0xb09e1)[_0x581d('0x21')](function(_0x4c60c0){_0x2df4a4['count']=_0x4c60c0;if(_0xcc19e9[_0x581d('0x31')][_0x581d('0x3d')]){_0x472cf7[_0x581d('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x581d('0x3f')](_0x472cf7);})[_0x581d('0x21')](function(_0x1276fd){_0x2df4a4[_0x581d('0x40')]=_0x1276fd;return _0x2df4a4;})[_0x581d('0x21')](respondWithFilteredResult(_0x7caf97,_0x472cf7))[_0x581d('0x41')](handleError(_0x7caf97,null));};exports['show']=function(_0x11d8ea,_0x21d74a){var _0x37f625={'raw':!![],'where':{'id':_0x11d8ea[_0x581d('0x42')]['id']}},_0x23ed8b={};_0x23ed8b[_0x581d('0x2e')]=_[_0x581d('0x2f')](db[_0x581d('0x29')][_0x581d('0x2a')]);_0x23ed8b[_0x581d('0x31')]=_['keys'](_0x11d8ea[_0x581d('0x31')]);_0x23ed8b[_0x581d('0x39')]=_[_0x581d('0x30')](_0x23ed8b[_0x581d('0x2e')],_0x23ed8b[_0x581d('0x31')]);_0x37f625[_0x581d('0x33')]=_['intersection'](_0x23ed8b[_0x581d('0x2e')],qs['fields'](_0x11d8ea[_0x581d('0x31')][_0x581d('0x32')]));_0x37f625[_0x581d('0x33')]=_0x37f625[_0x581d('0x33')][_0x581d('0x34')]?_0x37f625['attributes']:_0x23ed8b[_0x581d('0x2e')];if(_0x11d8ea['query'][_0x581d('0x3d')]){_0x37f625['include']=[{'all':!![]}];}_0x37f625=_[_0x581d('0x3b')]({},_0x37f625,_0x11d8ea['options']);return db[_0x581d('0x29')]['find'](_0x37f625)[_0x581d('0x21')](handleEntityNotFound(_0x21d74a,null))[_0x581d('0x21')](respondWithResult(_0x21d74a,null))[_0x581d('0x41')](handleError(_0x21d74a,null));};exports['create']=function(_0x13d6dd,_0x583609){return db[_0x581d('0x29')][_0x581d('0x43')](_0x13d6dd[_0x581d('0x44')],{})['then'](respondWithResult(_0x583609,0xc9))[_0x581d('0x41')](handleError(_0x583609,null));};exports[_0x581d('0x20')]=function(_0x4899c2,_0x53c6fc){if(_0x4899c2[_0x581d('0x44')]['id']){delete _0x4899c2[_0x581d('0x44')]['id'];}return db[_0x581d('0x29')][_0x581d('0x45')]({'where':{'id':_0x4899c2[_0x581d('0x42')]['id']}})[_0x581d('0x21')](handleEntityNotFound(_0x53c6fc,null))[_0x581d('0x21')](saveUpdates(_0x4899c2[_0x581d('0x44')],null))[_0x581d('0x21')](respondWithResult(_0x53c6fc,null))[_0x581d('0x41')](handleError(_0x53c6fc,null));};exports[_0x581d('0x22')]=function(_0x38ea46,_0x402c62){return db['SquareDetailsReport'][_0x581d('0x45')]({'where':{'id':_0x38ea46[_0x581d('0x42')]['id']}})[_0x581d('0x21')](handleEntityNotFound(_0x402c62,null))['then'](removeEntity(_0x402c62,null))[_0x581d('0x41')](handleError(_0x402c62,null));};exports[_0x581d('0x46')]=function(_0x5000fe,_0x44d989){return db[_0x581d('0x29')][_0x581d('0x46')]()[_0x581d('0x21')](respondWithResult(_0x44d989,null))[_0x581d('0x41')](handleError(_0x44d989,null));}; \ No newline at end of file +var _0x05a6=['catch','show','params','keys','merge','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SquareDetailsReport','includeAll','findAll','rows'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x05a6,0xde));var _0x605a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x05a6[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x605a('0x0'));var rimraf=require(_0x605a('0x1'));var zipdir=require(_0x605a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x605a('0x3'));var moment=require('moment');var BPromise=require(_0x605a('0x4'));var Mustache=require(_0x605a('0x5'));var util=require(_0x605a('0x6'));var path=require(_0x605a('0x7'));var sox=require(_0x605a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x605a('0x9'));var _=require(_0x605a('0xa'));var squel=require(_0x605a('0xb'));var crypto=require(_0x605a('0xc'));var jsforce=require(_0x605a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x605a('0xe'));var Redis=require(_0x605a('0xf'));var authService=require(_0x605a('0x10'));var qs=require(_0x605a('0x11'));var as=require(_0x605a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x605a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x605a('0x14'));var db=require(_0x605a('0x15'))['db'];function respondWithStatusCode(_0x953d46,_0x4811a5){_0x4811a5=_0x4811a5||0xcc;return function(_0x4331f7){if(_0x4331f7){return _0x953d46[_0x605a('0x16')](_0x4811a5);}return _0x953d46[_0x605a('0x17')](_0x4811a5)[_0x605a('0x18')]();};}function respondWithResult(_0x140b1a,_0x2631db){_0x2631db=_0x2631db||0xc8;return function(_0x5e80b9){if(_0x5e80b9){return _0x140b1a['status'](_0x2631db)['json'](_0x5e80b9);}};}function respondWithFilteredResult(_0x33edab,_0x831c80){return function(_0x9b3d12){if(_0x9b3d12){var _0xb69a35=typeof _0x831c80[_0x605a('0x19')]===_0x605a('0x1a')&&typeof _0x831c80[_0x605a('0x1b')]==='undefined';var _0x48f832=_0x9b3d12[_0x605a('0x1c')];var _0x39abfb=_0xb69a35?0x0:_0x831c80['offset'];var _0x16b6ab=_0xb69a35?_0x9b3d12[_0x605a('0x1c')]:_0x831c80['offset']+_0x831c80[_0x605a('0x1b')];var _0x1804e2;if(_0x16b6ab>=_0x48f832){_0x16b6ab=_0x48f832;_0x1804e2=0xc8;}else{_0x1804e2=0xce;}_0x33edab[_0x605a('0x17')](_0x1804e2);return _0x33edab[_0x605a('0x1d')](_0x605a('0x1e'),_0x39abfb+'-'+_0x16b6ab+'/'+_0x48f832)[_0x605a('0x1f')](_0x9b3d12);}return null;};}function patchUpdates(_0x8e660e){return function(_0x1aeecc){try{jsonpatch['apply'](_0x1aeecc,_0x8e660e,!![]);}catch(_0x5d960e){return BPromise[_0x605a('0x20')](_0x5d960e);}return _0x1aeecc[_0x605a('0x21')]();};}function saveUpdates(_0x59b307,_0x2fb01a){return function(_0x8b182){if(_0x8b182){return _0x8b182[_0x605a('0x22')](_0x59b307)[_0x605a('0x23')](function(_0x2c9b5a){return _0x2c9b5a;});}return null;};}function removeEntity(_0x53f1ec,_0x1e87e0){return function(_0x53aeb0){if(_0x53aeb0){return _0x53aeb0['destroy']()['then'](function(){_0x53f1ec[_0x605a('0x17')](0xcc)[_0x605a('0x18')]();});}};}function handleEntityNotFound(_0x11e92c,_0xe3000f){return function(_0x1c9801){if(!_0x1c9801){_0x11e92c['sendStatus'](0x194);}return _0x1c9801;};}function handleError(_0x2e6d9e,_0x55bde7){_0x55bde7=_0x55bde7||0x1f4;return function(_0x336686){logger['error'](_0x336686['stack']);if(_0x336686[_0x605a('0x24')]){delete _0x336686[_0x605a('0x24')];}_0x2e6d9e['status'](_0x55bde7)[_0x605a('0x25')](_0x336686);};}exports[_0x605a('0x26')]=function(_0x6322ce,_0x12a231){var _0x35b227={},_0x30601b={},_0xaa483={'count':0x0,'rows':[]};var _0x4757f3=_[_0x605a('0x27')](db['SquareDetailsReport'][_0x605a('0x28')],function(_0x5a3530){return{'name':_0x5a3530['fieldName'],'type':_0x5a3530[_0x605a('0x29')]['key']};});_0x30601b[_0x605a('0x2a')]=_[_0x605a('0x27')](_0x4757f3,_0x605a('0x24'));_0x30601b['query']=_['keys'](_0x6322ce[_0x605a('0x2b')]);_0x30601b[_0x605a('0x2c')]=_[_0x605a('0x2d')](_0x30601b[_0x605a('0x2a')],_0x30601b[_0x605a('0x2b')]);_0x35b227['attributes']=_[_0x605a('0x2d')](_0x30601b[_0x605a('0x2a')],qs[_0x605a('0x2e')](_0x6322ce['query'][_0x605a('0x2e')]));_0x35b227[_0x605a('0x2f')]=_0x35b227[_0x605a('0x2f')][_0x605a('0x30')]?_0x35b227['attributes']:_0x30601b[_0x605a('0x2a')];if(!_0x6322ce['query'][_0x605a('0x31')](_0x605a('0x32'))){_0x35b227[_0x605a('0x1b')]=qs[_0x605a('0x1b')](_0x6322ce[_0x605a('0x2b')]['limit']);_0x35b227[_0x605a('0x19')]=qs['offset'](_0x6322ce[_0x605a('0x2b')][_0x605a('0x19')]);}_0x35b227[_0x605a('0x33')]=qs[_0x605a('0x34')](_0x6322ce[_0x605a('0x2b')][_0x605a('0x34')]);_0x35b227[_0x605a('0x35')]=qs[_0x605a('0x2c')](_[_0x605a('0x36')](_0x6322ce[_0x605a('0x2b')],_0x30601b[_0x605a('0x2c')]),_0x4757f3);if(_0x6322ce['query'][_0x605a('0x37')]){_0x35b227[_0x605a('0x35')]=_['merge'](_0x35b227[_0x605a('0x35')],{'$or':_[_0x605a('0x27')](_0x4757f3,function(_0x557e71){if(_0x557e71[_0x605a('0x29')]!==_0x605a('0x38')){var _0x19b088={};_0x19b088[_0x557e71[_0x605a('0x24')]]={'$like':'%'+_0x6322ce['query'][_0x605a('0x37')]+'%'};return _0x19b088;}})});}_0x35b227=_['merge']({},_0x35b227,_0x6322ce[_0x605a('0x39')]);var _0x57e784={'where':_0x35b227['where']};return db[_0x605a('0x3a')][_0x605a('0x1c')](_0x57e784)[_0x605a('0x23')](function(_0x37989d){_0xaa483[_0x605a('0x1c')]=_0x37989d;if(_0x6322ce[_0x605a('0x2b')][_0x605a('0x3b')]){_0x35b227['include']=[{'all':!![]}];}return db[_0x605a('0x3a')][_0x605a('0x3c')](_0x35b227);})['then'](function(_0x51d44d){_0xaa483[_0x605a('0x3d')]=_0x51d44d;return _0xaa483;})['then'](respondWithFilteredResult(_0x12a231,_0x35b227))[_0x605a('0x3e')](handleError(_0x12a231,null));};exports[_0x605a('0x3f')]=function(_0x48194f,_0x25d54c){var _0x203806={'raw':!![],'where':{'id':_0x48194f[_0x605a('0x40')]['id']}},_0x428acb={};_0x428acb['model']=_['keys'](db[_0x605a('0x3a')][_0x605a('0x28')]);_0x428acb[_0x605a('0x2b')]=_[_0x605a('0x41')](_0x48194f[_0x605a('0x2b')]);_0x428acb[_0x605a('0x2c')]=_[_0x605a('0x2d')](_0x428acb[_0x605a('0x2a')],_0x428acb[_0x605a('0x2b')]);_0x203806[_0x605a('0x2f')]=_[_0x605a('0x2d')](_0x428acb[_0x605a('0x2a')],qs[_0x605a('0x2e')](_0x48194f['query']['fields']));_0x203806[_0x605a('0x2f')]=_0x203806['attributes'][_0x605a('0x30')]?_0x203806[_0x605a('0x2f')]:_0x428acb[_0x605a('0x2a')];if(_0x48194f[_0x605a('0x2b')]['includeAll']){_0x203806['include']=[{'all':!![]}];}_0x203806=_[_0x605a('0x42')]({},_0x203806,_0x48194f['options']);return db[_0x605a('0x3a')]['find'](_0x203806)[_0x605a('0x23')](handleEntityNotFound(_0x25d54c,null))['then'](respondWithResult(_0x25d54c,null))[_0x605a('0x3e')](handleError(_0x25d54c,null));};exports[_0x605a('0x43')]=function(_0x1f07a7,_0x526f18){return db['SquareDetailsReport'][_0x605a('0x43')](_0x1f07a7['body'],{})[_0x605a('0x23')](respondWithResult(_0x526f18,0xc9))[_0x605a('0x3e')](handleError(_0x526f18,null));};exports[_0x605a('0x22')]=function(_0x4ac993,_0x1b4a50){if(_0x4ac993[_0x605a('0x44')]['id']){delete _0x4ac993[_0x605a('0x44')]['id'];}return db[_0x605a('0x3a')][_0x605a('0x45')]({'where':{'id':_0x4ac993[_0x605a('0x40')]['id']}})[_0x605a('0x23')](handleEntityNotFound(_0x1b4a50,null))[_0x605a('0x23')](saveUpdates(_0x4ac993[_0x605a('0x44')],null))[_0x605a('0x23')](respondWithResult(_0x1b4a50,null))[_0x605a('0x3e')](handleError(_0x1b4a50,null));};exports['destroy']=function(_0x3b4d00,_0x112605){return db[_0x605a('0x3a')]['find']({'where':{'id':_0x3b4d00[_0x605a('0x40')]['id']}})[_0x605a('0x23')](handleEntityNotFound(_0x112605,null))[_0x605a('0x23')](removeEntity(_0x112605,null))[_0x605a('0x3e')](handleError(_0x112605,null));};exports[_0x605a('0x46')]=function(_0x493a92,_0x537c4a){return db[_0x605a('0x3a')][_0x605a('0x46')]()['then'](respondWithResult(_0x537c4a,null))[_0x605a('0x3e')](handleError(_0x537c4a,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 0b89974..f9adb2f 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 _0xece0=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','report_square_details','lodash'];(function(_0x1b258a,_0x481d57){var _0x514815=function(_0x3f8408){while(--_0x3f8408){_0x1b258a['push'](_0x1b258a['shift']());}};_0x514815(++_0x481d57);}(_0xece0,0x9b));var _0x0ece=function(_0xc465f5,_0xa9c358){_0xc465f5=_0xc465f5-0x0;var _0x3dd839=_0xece0[_0xc465f5];return _0x3dd839;};'use strict';var _=require(_0x0ece('0x0'));var util=require(_0x0ece('0x1'));var logger=require(_0x0ece('0x2'))(_0x0ece('0x3'));var moment=require('moment');var BPromise=require(_0x0ece('0x4'));var rp=require(_0x0ece('0x5'));var fs=require('fs');var path=require(_0x0ece('0x6'));var rimraf=require(_0x0ece('0x7'));var config=require(_0x0ece('0x8'));var attributes=require(_0x0ece('0x9'));module['exports']=function(_0x420d8a,_0x76853d){return _0x420d8a[_0x0ece('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x0ece('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x514a=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1803de,_0xa127d0){var _0x458b70=function(_0x49cc0){while(--_0x49cc0){_0x1803de['push'](_0x1803de['shift']());}};_0x458b70(++_0xa127d0);}(_0x514a,0x19e));var _0xa514=function(_0x21fda1,_0xdecb5d){_0x21fda1=_0x21fda1-0x0;var _0x4908ce=_0x514a[_0x21fda1];return _0x4908ce;};'use strict';var _=require(_0xa514('0x0'));var util=require('util');var logger=require(_0xa514('0x1'))('api');var moment=require(_0xa514('0x2'));var BPromise=require(_0xa514('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa514('0x4'));var rimraf=require(_0xa514('0x5'));var config=require(_0xa514('0x6'));var attributes=require(_0xa514('0x7'));module[_0xa514('0x8')]=function(_0x1269a4,_0x1f2a97){return _0x1269a4[_0xa514('0x9')](_0xa514('0xa'),attributes,{'tableName':_0xa514('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 3f07f92..bf18d27 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 _0x4f7b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','raw','CreateSquareDetailsReport','debug','lodash'];(function(_0xbf0f77,_0x1bbdbb){var _0x5d1f05=function(_0x5689cc){while(--_0x5689cc){_0xbf0f77['push'](_0xbf0f77['shift']());}};_0x5d1f05(++_0x1bbdbb);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x14935e,_0x5437f2){_0x14935e=_0x14935e-0x0;var _0x1f1c0d=_0x4f7b[_0x14935e];return _0x1f1c0d;};'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);});});}exports['CreateSquareDetailsReport']=function(_0x53b135){var _0x3a78b7=this;return new Promise(function(_0x22e273,_0x4b93fc){return db[_0xb4f7('0x17')][_0xb4f7('0x18')](_0x53b135[_0xb4f7('0x19')],{'raw':_0x53b135['options']?_0x53b135['options'][_0xb4f7('0x1a')]===undefined?!![]:![]:!![]})[_0xb4f7('0xc')](function(_0x5cc40e){logger[_0xb4f7('0xd')](_0xb4f7('0x1b'),_0x53b135);logger[_0xb4f7('0x1c')](_0xb4f7('0x1b'),_0x53b135,JSON['stringify'](_0x5cc40e));_0x22e273(_0x5cc40e);})[_0xb4f7('0x16')](function(_0x56bac5){logger[_0xb4f7('0x12')](_0xb4f7('0x1b'),_0x56bac5[_0xb4f7('0x14')],_0x53b135);_0x4b93fc(_0x3a78b7[_0xb4f7('0x12')](0x1f4,_0x56bac5[_0xb4f7('0x14')]));});});}; \ No newline at end of file +var _0x693f=['code','message','info','SquareDetailsReport,\x20%s,\x20%s','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','request\x20sent','stringify','error'];(function(_0x1b55ab,_0x1a4d8f){var _0x2a2391=function(_0xe0a483){while(--_0xe0a483){_0x1b55ab['push'](_0x1b55ab['shift']());}};_0x2a2391(++_0x1a4d8f);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require(_0xf693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf693('0x4'));var db=require(_0xf693('0x5'))['db'];var utils=require(_0xf693('0x6'));var logger=require(_0xf693('0x7'))(_0xf693('0x8'));var config=require(_0xf693('0x9'));var jayson=require(_0xf693('0xa'));var client=jayson['client'][_0xf693('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33305c,_0x5b91c5,_0x22f362){return new BPromise(function(_0x594505,_0x38e78a){return client['request'](_0x33305c,_0x22f362)[_0xf693('0xc')](function(_0x17075d){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,'request\x20sent');logger[_0xf693('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5b91c5,_0xf693('0xe'),JSON[_0xf693('0xf')](_0x17075d));if(_0x17075d[_0xf693('0x10')]){if(_0x17075d[_0xf693('0x10')][_0xf693('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,_0x17075d[_0xf693('0x10')][_0xf693('0x12')]);return _0x38e78a(_0x17075d['error'][_0xf693('0x12')]);}logger[_0xf693('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,_0x17075d['error'][_0xf693('0x12')]);return _0x594505(_0x17075d[_0xf693('0x10')][_0xf693('0x12')]);}else{logger[_0xf693('0x13')](_0xf693('0x14'),_0x5b91c5,'request\x20sent');_0x594505(_0x17075d[_0xf693('0x15')][_0xf693('0x12')]);}})[_0xf693('0x16')](function(_0x2a5e1b){logger[_0xf693('0x10')](_0xf693('0x14'),_0x5b91c5,_0x2a5e1b);_0x38e78a(_0x2a5e1b);});});}exports['CreateSquareDetailsReport']=function(_0x5e02e0){var _0x4a5964=this;return new Promise(function(_0x2474d4,_0xf4d20e){return db[_0xf693('0x17')][_0xf693('0x18')](_0x5e02e0[_0xf693('0x19')],{'raw':_0x5e02e0['options']?_0x5e02e0[_0xf693('0x1a')][_0xf693('0x1b')]===undefined?!![]:![]:!![]})[_0xf693('0xc')](function(_0x31b887){logger[_0xf693('0x13')](_0xf693('0x1c'),_0x5e02e0);logger[_0xf693('0xd')](_0xf693('0x1c'),_0x5e02e0,JSON['stringify'](_0x31b887));_0x2474d4(_0x31b887);})[_0xf693('0x16')](function(_0x1188c6){logger[_0xf693('0x10')](_0xf693('0x1c'),_0x1188c6[_0xf693('0x12')],_0x5e02e0);_0xf4d20e(_0x4a5964[_0xf693('0x10')](0x1f4,_0x1188c6[_0xf693('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index fe12839..771d1c6 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 _0x6a6c=['./system.controller','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','../../components/auth/service'];(function(_0x464c0b,_0xffa439){var _0x413bd4=function(_0x4a001d){while(--_0x4a001d){_0x464c0b['push'](_0x464c0b['shift']());}};_0x413bd4(++_0xffa439);}(_0x6a6c,0x106));var _0xc6a6=function(_0x3c5e68,_0x1f14c7){_0x3c5e68=_0x3c5e68-0x0;var _0x296855=_0x6a6c[_0x3c5e68];return _0x296855;};'use strict';var express=require(_0xc6a6('0x0'));var router=express['Router']();var auth=require(_0xc6a6('0x1'));var controller=require(_0xc6a6('0x2'));router['get']('/',auth[_0xc6a6('0x3')](),controller[_0xc6a6('0x4')]);router['get'](_0xc6a6('0x5'),auth['isAuthenticated'](),controller[_0xc6a6('0x6')]);module[_0xc6a6('0x7')]=router; \ No newline at end of file +var _0xb3e2=['exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x554673,_0x17bd28){var _0x52cf06=function(_0x2ade08){while(--_0x2ade08){_0x554673['push'](_0x554673['shift']());}};_0x52cf06(++_0x17bd28);}(_0xb3e2,0x19f));var _0x2b3e=function(_0x33846c,_0x30ffc2){_0x33846c=_0x33846c-0x0;var _0x50e4d4=_0xb3e2[_0x33846c];return _0x50e4d4;};'use strict';var express=require(_0x2b3e('0x0'));var router=express[_0x2b3e('0x1')]();var auth=require(_0x2b3e('0x2'));var controller=require(_0x2b3e('0x3'));router[_0x2b3e('0x4')]('/',auth[_0x2b3e('0x5')](),controller[_0x2b3e('0x6')]);router['get'](_0x2b3e('0x7'),auth['isAuthenticated'](),controller['killProcess']);module[_0x2b3e('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c1e4d5f..4311d4a 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 _0xe1d8=['catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','getAllData','then','json'];(function(_0x5e3af8,_0x145192){var _0x42b122=function(_0x12b7ba){while(--_0x12b7ba){_0x5e3af8['push'](_0x5e3af8['shift']());}};_0x42b122(++_0x145192);}(_0xe1d8,0x1bd));var _0x8e1d=function(_0xbc21d0,_0x52cea0){_0xbc21d0=_0xbc21d0-0x0;var _0xb1cccc=_0xe1d8[_0xbc21d0];return _0xb1cccc;};'use strict';var info=require(_0x8e1d('0x0'));var exec=require(_0x8e1d('0x1'))[_0x8e1d('0x2')];var logger=require(_0x8e1d('0x3'))('api');var util=require(_0x8e1d('0x4'));var BPromise=require(_0x8e1d('0x5'));var _=require('lodash');function handleError(_0x1dab73,_0x285062,_0x1c9ea3){_0x285062=_0x285062||0x1f4;return function(_0x3a968d){logger[_0x8e1d('0x6')](_0x8e1d('0x7'),_0x1c9ea3,_0x285062,util['inspect'](_0x3a968d,{'showHidden':![],'depth':null}));delete _0x3a968d['name'];_0x1dab73[_0x8e1d('0x8')](_0x285062)[_0x8e1d('0x9')](_0x3a968d);};}exports[_0x8e1d('0xa')]=function(_0x2a80e2,_0x21fe1e){return info[_0x8e1d('0xb')]()[_0x8e1d('0xc')](function(_0x185c24){return _0x21fe1e[_0x8e1d('0x8')](0xc8)[_0x8e1d('0xd')](_0x185c24);})[_0x8e1d('0xe')](function(_0x2c2d92){return _0x21fe1e[_0x8e1d('0x8')](0x1f4)[_0x8e1d('0xd')](_0x2c2d92);});};exports[_0x8e1d('0xf')]=function(_0x68da87,_0x4a540e){var _0x2f7a07=[_0x8e1d('0x10')];return new BPromise(function(_0x12c12e,_0x452b4c){return exec(util['format'](_0x8e1d('0x11'),_0x68da87[_0x8e1d('0x12')][_0x8e1d('0x13')]),function(_0x5405ef,_0x54f29d,_0x5da2dd){if(_0x5405ef){return _0x452b4c(_0x5405ef);}return _0x12c12e(_0x54f29d);});})['then'](function(_0x113fd2){var _0x4b4c13=![];var _0x24a614=_0x113fd2[_0x8e1d('0x14')](/\n/);for(var _0xc4d4a0=0x0,_0x5ca081=_0x2f7a07[_0x8e1d('0x15')];_0xc4d4a0<_0x5ca081,_0x4b4c13===![];_0xc4d4a0+=0x1){if(_0x113fd2['indexOf'](_0x2f7a07[_0xc4d4a0])>=0x0){_0x4b4c13=!![];}}if(!_0x4b4c13){throw new Error(util[_0x8e1d('0x16')](_0x8e1d('0x17'),_0x68da87[_0x8e1d('0x12')][_0x8e1d('0x13')]));}process[_0x8e1d('0x18')](_0x68da87[_0x8e1d('0x12')]['pid'],_0x8e1d('0x19'));return _0x4a540e[_0x8e1d('0x8')](0xc8)[_0x8e1d('0xd')]({'message':util[_0x8e1d('0x16')](_0x8e1d('0x1a'),_0x68da87[_0x8e1d('0x12')][_0x8e1d('0x13')])});})[_0x8e1d('0xe')](handleError(_0x4a540e,null,_0x8e1d('0xf')));}; \ No newline at end of file +var _0xca15=['then','catch','json','killProcess','components/import/cm','format','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData'];(function(_0x5e049c,_0x51573c){var _0x74aef5=function(_0x1b7b6d){while(--_0x1b7b6d){_0x5e049c['push'](_0x5e049c['shift']());}};_0x74aef5(++_0x51573c);}(_0xca15,0x83));var _0x5ca1=function(_0x581865,_0x447163){_0x581865=_0x581865-0x0;var _0x3a3a18=_0xca15[_0x581865];return _0x3a3a18;};'use strict';var info=require(_0x5ca1('0x0'));var exec=require(_0x5ca1('0x1'))['exec'];var logger=require(_0x5ca1('0x2'))(_0x5ca1('0x3'));var util=require(_0x5ca1('0x4'));var BPromise=require(_0x5ca1('0x5'));var _=require(_0x5ca1('0x6'));function handleError(_0x42dbd8,_0x37b2fb,_0x1d1cf5){_0x37b2fb=_0x37b2fb||0x1f4;return function(_0x433981){logger[_0x5ca1('0x7')](_0x5ca1('0x8'),_0x1d1cf5,_0x37b2fb,util[_0x5ca1('0x9')](_0x433981,{'showHidden':![],'depth':null}));delete _0x433981['name'];_0x42dbd8[_0x5ca1('0xa')](_0x37b2fb)[_0x5ca1('0xb')](_0x433981);};}exports[_0x5ca1('0xc')]=function(_0x55e77f,_0x2d5068){return info[_0x5ca1('0xd')]()[_0x5ca1('0xe')](function(_0x5a2b42){return _0x2d5068[_0x5ca1('0xa')](0xc8)['json'](_0x5a2b42);})[_0x5ca1('0xf')](function(_0x5cdb1d){return _0x2d5068['status'](0x1f4)[_0x5ca1('0x10')](_0x5cdb1d);});};exports[_0x5ca1('0x11')]=function(_0x257315,_0x38c1ef){var _0x2ed06b=[_0x5ca1('0x12')];return new BPromise(function(_0x22e010,_0xefc312){return exec(util[_0x5ca1('0x13')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x257315[_0x5ca1('0x14')]['pid']),function(_0x2bf279,_0x1cfb4e,_0x4c8944){if(_0x2bf279){return _0xefc312(_0x2bf279);}return _0x22e010(_0x1cfb4e);});})[_0x5ca1('0xe')](function(_0x16019f){var _0x3510=![];var _0x237acd=_0x16019f[_0x5ca1('0x15')](/\n/);for(var _0x382fa6=0x0,_0x7e0237=_0x2ed06b[_0x5ca1('0x16')];_0x382fa6<_0x7e0237,_0x3510===![];_0x382fa6+=0x1){if(_0x16019f[_0x5ca1('0x17')](_0x2ed06b[_0x382fa6])>=0x0){_0x3510=!![];}}if(!_0x3510){throw new Error(util[_0x5ca1('0x13')](_0x5ca1('0x18'),_0x257315[_0x5ca1('0x14')][_0x5ca1('0x19')]));}process[_0x5ca1('0x1a')](_0x257315[_0x5ca1('0x14')]['pid'],_0x5ca1('0x1b'));return _0x38c1ef[_0x5ca1('0xa')](0xc8)[_0x5ca1('0x10')]({'message':util[_0x5ca1('0x13')](_0x5ca1('0x1c'),_0x257315[_0x5ca1('0x14')][_0x5ca1('0x19')])});})[_0x5ca1('0xf')](handleError(_0x38c1ef,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 1728d4a..9b5cb0b 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 _0xe070=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer'];(function(_0x4c541d,_0xd59ba){var _0x1bacf4=function(_0x99d2af){while(--_0x99d2af){_0x4c541d['push'](_0x4c541d['shift']());}};_0x1bacf4(++_0xd59ba);}(_0xe070,0x167));var _0x0e07=function(_0x294b6,_0x2907ae){_0x294b6=_0x294b6-0x0;var _0x38bb97=_0xe070[_0x294b6];return _0x38bb97;};'use strict';var multer=require(_0x0e07('0x0'));var util=require(_0x0e07('0x1'));var path=require(_0x0e07('0x2'));var timeout=require(_0x0e07('0x3'));var express=require(_0x0e07('0x4'));var router=express[_0x0e07('0x5')]();var fs_extra=require(_0x0e07('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e07('0x7'));var controller=require('./tag.controller');router[_0x0e07('0x8')]('/',auth[_0x0e07('0x9')](),controller[_0x0e07('0xa')]);router[_0x0e07('0x8')](_0x0e07('0xb'),auth[_0x0e07('0x9')](),controller[_0x0e07('0xc')]);router[_0x0e07('0xd')]('/',auth['isAuthenticated'](),controller[_0x0e07('0xe')]);router['put'](_0x0e07('0xb'),auth[_0x0e07('0x9')](),controller[_0x0e07('0xf')]);router[_0x0e07('0x10')](_0x0e07('0xb'),auth[_0x0e07('0x9')](),controller['destroy']);module[_0x0e07('0x11')]=router; \ No newline at end of file +var _0x6002=['isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','index','get','/:id'];(function(_0x28052c,_0x147ac9){var _0x8c5be2=function(_0x378976){while(--_0x378976){_0x28052c['push'](_0x28052c['shift']());}};_0x8c5be2(++_0x147ac9);}(_0x6002,0xfe));var _0x2600=function(_0x2ab16b,_0x35bef0){_0x2ab16b=_0x2ab16b-0x0;var _0xa8b60f=_0x6002[_0x2ab16b];return _0xa8b60f;};'use strict';var multer=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var path=require(_0x2600('0x2'));var timeout=require(_0x2600('0x3'));var express=require(_0x2600('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2600('0x5'));var interaction=require(_0x2600('0x6'));var config=require(_0x2600('0x7'));var controller=require(_0x2600('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2600('0x9')]);router[_0x2600('0xa')](_0x2600('0xb'),auth[_0x2600('0xc')](),controller[_0x2600('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2600('0xe')](_0x2600('0xb'),auth[_0x2600('0xc')](),controller[_0x2600('0xf')]);router[_0x2600('0x10')](_0x2600('0xb'),auth[_0x2600('0xc')](),controller[_0x2600('0x11')]);module[_0x2600('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 2e46be9..47f9196 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 _0xc2da=['sequelize','STRING'];(function(_0x1e748d,_0x39e766){var _0x1cd8ed=function(_0x5618a4){while(--_0x5618a4){_0x1e748d['push'](_0x1e748d['shift']());}};_0x1cd8ed(++_0x39e766);}(_0xc2da,0x124));var _0xac2d=function(_0x274d06,_0x15c8f8){_0x274d06=_0x274d06-0x0;var _0x4ae5f9=_0xc2da[_0x274d06];return _0x4ae5f9;};'use strict';var Sequelize=require(_0xac2d('0x0'));module['exports']={'name':{'type':Sequelize[_0xac2d('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xac2d('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xac2d('0x1')]}}; \ No newline at end of file +var _0x2032=['#0091EA','exports','STRING','name'];(function(_0x6a6d27,_0x34a92e){var _0x1d5fb6=function(_0x9567ff){while(--_0x9567ff){_0x6a6d27['push'](_0x6a6d27['shift']());}};_0x1d5fb6(++_0x34a92e);}(_0x2032,0xd9));var _0x2203=function(_0x3940e4,_0x5ababd){_0x3940e4=_0x3940e4-0x0;var _0x1cbbd8=_0x2032[_0x3940e4];return _0x1cbbd8;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'unique':_0x2203('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x3')},'description':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index e6f4161..8e9b634 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 _0x04b8=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Tags','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x46fc28,_0x4746fb){var _0x5888fe=function(_0x3cec18){while(--_0x3cec18){_0x46fc28['push'](_0x46fc28['shift']());}};_0x5888fe(++_0x4746fb);}(_0x04b8,0x159));var _0x804b=function(_0x48d4e5,_0x45a903){_0x48d4e5=_0x48d4e5-0x0;var _0x1b1f21=_0x04b8[_0x48d4e5];return _0x1b1f21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['Tag'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['Tag'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['Tag']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Tags';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));}; \ No newline at end of file +var _0x1b73=['map','Tag','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index'];(function(_0x2c574e,_0x491053){var _0x1101f7=function(_0x5285c2){while(--_0x5285c2){_0x2c574e['push'](_0x2c574e['shift']());}};_0x1101f7(++_0x491053);}(_0x1b73,0x1d5));var _0x31b7=function(_0x1d64ca,_0x57811b){_0x1d64ca=_0x1d64ca-0x0;var _0x10692b=_0x1b73[_0x1d64ca];return _0x10692b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){var _0x35a51f=_0x3b0eff[_0x31b7('0x28')]({'plain':!![]});var _0x2c993b='Tags';return db[_0x31b7('0x29')]['destroy']({'where':{'type':_0x2c993b,'resourceId':_0x35a51f['id']}})[_0x31b7('0x27')](function(){return _0x3b0eff;});})[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0xffacb,_0x128865){return function(_0x21ab03){if(!_0x21ab03){_0xffacb[_0x31b7('0x1a')](0x194);}return _0x21ab03;};}function handleError(_0x4e58e5,_0x47ef33){_0x47ef33=_0x47ef33||0x1f4;return function(_0x503549){logger[_0x31b7('0x2a')](_0x503549[_0x31b7('0x2b')]);if(_0x503549[_0x31b7('0x2c')]){delete _0x503549['name'];}_0x4e58e5[_0x31b7('0x1b')](_0x47ef33)[_0x31b7('0x2d')](_0x503549);};}exports[_0x31b7('0x2e')]=function(_0x277273,_0x58a87e){var _0x5b0ed2={},_0x34c62a={},_0x4b5cf9={'count':0x0,'rows':[]};var _0x574dfe=_[_0x31b7('0x2f')](db[_0x31b7('0x30')][_0x31b7('0x31')],function(_0x35f83c){return{'name':_0x35f83c['fieldName'],'type':_0x35f83c['type'][_0x31b7('0x32')]};});_0x34c62a[_0x31b7('0x33')]=_[_0x31b7('0x2f')](_0x574dfe,_0x31b7('0x2c'));_0x34c62a[_0x31b7('0x34')]=_['keys'](_0x277273['query']);_0x34c62a[_0x31b7('0x35')]=_[_0x31b7('0x36')](_0x34c62a['model'],_0x34c62a[_0x31b7('0x34')]);_0x5b0ed2[_0x31b7('0x37')]=_['intersection'](_0x34c62a[_0x31b7('0x33')],qs[_0x31b7('0x38')](_0x277273[_0x31b7('0x34')][_0x31b7('0x38')]));_0x5b0ed2[_0x31b7('0x37')]=_0x5b0ed2[_0x31b7('0x37')][_0x31b7('0x39')]?_0x5b0ed2[_0x31b7('0x37')]:_0x34c62a[_0x31b7('0x33')];if(!_0x277273[_0x31b7('0x34')][_0x31b7('0x3a')](_0x31b7('0x3b'))){_0x5b0ed2[_0x31b7('0x1e')]=qs['limit'](_0x277273['query'][_0x31b7('0x1e')]);_0x5b0ed2[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x277273[_0x31b7('0x34')][_0x31b7('0x20')]);}_0x5b0ed2[_0x31b7('0x3c')]=qs[_0x31b7('0x3d')](_0x277273[_0x31b7('0x34')][_0x31b7('0x3d')]);_0x5b0ed2[_0x31b7('0x3e')]=qs['filters'](_[_0x31b7('0x3f')](_0x277273[_0x31b7('0x34')],_0x34c62a[_0x31b7('0x35')]),_0x574dfe);if(_0x277273[_0x31b7('0x34')]['filter']){_0x5b0ed2[_0x31b7('0x3e')]=_[_0x31b7('0x40')](_0x5b0ed2['where'],{'$or':_[_0x31b7('0x2f')](_0x574dfe,function(_0x5724fa){if(_0x5724fa['type']!==_0x31b7('0x41')){var _0x10e82c={};_0x10e82c[_0x5724fa[_0x31b7('0x2c')]]={'$like':'%'+_0x277273[_0x31b7('0x34')][_0x31b7('0x42')]+'%'};return _0x10e82c;}})});}_0x5b0ed2=_['merge']({},_0x5b0ed2,_0x277273[_0x31b7('0x43')]);var _0x5d01ee={'where':_0x5b0ed2['where']};return db['Tag'][_0x31b7('0x1f')](_0x5d01ee)[_0x31b7('0x27')](function(_0x1527b3){_0x4b5cf9[_0x31b7('0x1f')]=_0x1527b3;if(_0x277273[_0x31b7('0x34')]['includeAll']){_0x5b0ed2[_0x31b7('0x44')]=[{'all':!![]}];}return db['Tag'][_0x31b7('0x45')](_0x5b0ed2);})[_0x31b7('0x27')](function(_0x41c92e){_0x4b5cf9[_0x31b7('0x46')]=_0x41c92e;return _0x4b5cf9;})['then'](respondWithFilteredResult(_0x58a87e,_0x5b0ed2))[_0x31b7('0x47')](handleError(_0x58a87e,null));};exports[_0x31b7('0x48')]=function(_0x1046fb,_0x4b3d24){var _0x31fd89={'raw':!![],'where':{'id':_0x1046fb[_0x31b7('0x49')]['id']}},_0x51918d={};_0x51918d[_0x31b7('0x33')]=_['keys'](db[_0x31b7('0x30')][_0x31b7('0x31')]);_0x51918d[_0x31b7('0x34')]=_[_0x31b7('0x4a')](_0x1046fb['query']);_0x51918d[_0x31b7('0x35')]=_['intersection'](_0x51918d['model'],_0x51918d[_0x31b7('0x34')]);_0x31fd89[_0x31b7('0x37')]=_[_0x31b7('0x36')](_0x51918d[_0x31b7('0x33')],qs['fields'](_0x1046fb[_0x31b7('0x34')][_0x31b7('0x38')]));_0x31fd89['attributes']=_0x31fd89[_0x31b7('0x37')][_0x31b7('0x39')]?_0x31fd89[_0x31b7('0x37')]:_0x51918d['model'];if(_0x1046fb[_0x31b7('0x34')][_0x31b7('0x4b')]){_0x31fd89[_0x31b7('0x44')]=[{'all':!![]}];}_0x31fd89=_[_0x31b7('0x40')]({},_0x31fd89,_0x1046fb[_0x31b7('0x43')]);return db[_0x31b7('0x30')][_0x31b7('0x4c')](_0x31fd89)[_0x31b7('0x27')](handleEntityNotFound(_0x4b3d24,null))['then'](respondWithResult(_0x4b3d24,null))[_0x31b7('0x47')](handleError(_0x4b3d24,null));};exports['create']=function(_0x5a72ee,_0x22cc77){return db[_0x31b7('0x30')][_0x31b7('0x4d')](_0x5a72ee[_0x31b7('0x4e')],{})['then'](function(_0x322798){var _0x18556b=_0x5a72ee[_0x31b7('0x4f')]['get']({'plain':!![]});if(!_0x18556b)throw new Error(_0x31b7('0x50'));if(_0x18556b[_0x31b7('0x51')]===_0x31b7('0x4f')){var _0x3b5868=_0x322798[_0x31b7('0x28')]({'plain':!![]});var _0x309077=_0x31b7('0x52');return db[_0x31b7('0x53')]['find']({'where':{'name':_0x309077,'userProfileId':_0x18556b['userProfileId']},'raw':!![]})[_0x31b7('0x27')](function(_0x1d55e6){if(_0x1d55e6&&_0x1d55e6[_0x31b7('0x54')]===0x0){return db[_0x31b7('0x29')]['create']({'name':_0x3b5868['name'],'resourceId':_0x3b5868['id'],'type':_0x1d55e6[_0x31b7('0x2c')],'sectionId':_0x1d55e6['id']},{})[_0x31b7('0x27')](function(){return _0x322798;});}else{return _0x322798;}})[_0x31b7('0x47')](function(_0x5ea605){logger[_0x31b7('0x2a')](_0x31b7('0x55'),_0x5ea605);throw _0x5ea605;});}return _0x322798;})[_0x31b7('0x27')](respondWithResult(_0x22cc77,0xc9))[_0x31b7('0x47')](handleError(_0x22cc77,null));};exports['update']=function(_0x535a3c,_0x43c1ee){if(_0x535a3c[_0x31b7('0x4e')]['id']){delete _0x535a3c[_0x31b7('0x4e')]['id'];}return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x535a3c[_0x31b7('0x49')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x43c1ee,null))[_0x31b7('0x27')](saveUpdates(_0x535a3c[_0x31b7('0x4e')],null))[_0x31b7('0x27')](respondWithResult(_0x43c1ee,null))['catch'](handleError(_0x43c1ee,null));};exports['destroy']=function(_0x4bd00d,_0x954c){return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x4bd00d['params']['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x954c,null))[_0x31b7('0x27')](removeEntity(_0x954c,null))[_0x31b7('0x47')](handleError(_0x954c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 1401d4a..3c783e8 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 _0x0028=['request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util','api','moment','bluebird'];(function(_0x23c561,_0x5b56a8){var _0x26608c=function(_0x47c152){while(--_0x47c152){_0x23c561['push'](_0x23c561['shift']());}};_0x26608c(++_0x5b56a8);}(_0x0028,0x15b));var _0x8002=function(_0xab39a,_0x9d1016){_0xab39a=_0xab39a-0x0;var _0x17bbe2=_0x0028[_0xab39a];return _0x17bbe2;};'use strict';var _=require('lodash');var util=require(_0x8002('0x0'));var logger=require('../../config/logger')(_0x8002('0x1'));var moment=require(_0x8002('0x2'));var BPromise=require(_0x8002('0x3'));var rp=require(_0x8002('0x4'));var fs=require('fs');var path=require(_0x8002('0x5'));var rimraf=require(_0x8002('0x6'));var config=require(_0x8002('0x7'));var attributes=require(_0x8002('0x8'));module[_0x8002('0x9')]=function(_0x57d062,_0x42df7f){return _0x57d062[_0x8002('0xa')](_0x8002('0xb'),attributes,{'tableName':_0x8002('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x819d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x819d,0xc2));var _0xd819=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x819d[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xd819('0x0'));var util=require('util');var logger=require(_0xd819('0x1'))(_0xd819('0x2'));var moment=require(_0xd819('0x3'));var BPromise=require(_0xd819('0x4'));var rp=require(_0xd819('0x5'));var fs=require('fs');var path=require(_0xd819('0x6'));var rimraf=require(_0xd819('0x7'));var config=require(_0xd819('0x8'));var attributes=require(_0xd819('0x9'));module[_0xd819('0xa')]=function(_0x563680,_0x38f11a){return _0x563680[_0xd819('0xb')](_0xd819('0xc'),attributes,{'tableName':_0xd819('0xd'),'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 326c2d9..0867cc4 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 _0xf3be=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','http','Tag,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xf3be,0x1e1));var _0xef3b=function(_0x14b72e,_0x11a00b){_0x14b72e=_0x14b72e-0x0;var _0xbad82a=_0xf3be[_0x14b72e];return _0xbad82a;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var moment=require(_0xef3b('0x2'));var BPromise=require(_0xef3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef3b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xef3b('0x5'));var jayson=require(_0xef3b('0x6'));var client=jayson['client'][_0xef3b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f7873,_0x17e70a,_0x19191a){return new BPromise(function(_0x47069a,_0x3a36db){return client['request'](_0x3f7873,_0x19191a)['then'](function(_0x273a7d){logger['info'](_0xef3b('0x8'),_0x17e70a,_0xef3b('0x9'));logger[_0xef3b('0xa')]('Tag,\x20%s,\x20%s,\x20%s',_0x17e70a,_0xef3b('0x9'),JSON['stringify'](_0x273a7d));if(_0x273a7d[_0xef3b('0xb')]){if(_0x273a7d[_0xef3b('0xb')][_0xef3b('0xc')]===0x1f4){logger[_0xef3b('0xb')](_0xef3b('0x8'),_0x17e70a,_0x273a7d[_0xef3b('0xb')][_0xef3b('0xd')]);return _0x3a36db(_0x273a7d[_0xef3b('0xb')][_0xef3b('0xd')]);}logger[_0xef3b('0xb')]('Tag,\x20%s,\x20%s',_0x17e70a,_0x273a7d['error'][_0xef3b('0xd')]);return _0x47069a(_0x273a7d[_0xef3b('0xb')][_0xef3b('0xd')]);}else{logger[_0xef3b('0xe')](_0xef3b('0x8'),_0x17e70a,'request\x20sent');_0x47069a(_0x273a7d[_0xef3b('0xf')][_0xef3b('0xd')]);}})[_0xef3b('0x10')](function(_0x3c96a6){logger[_0xef3b('0xb')]('Tag,\x20%s,\x20%s',_0x17e70a,_0x3c96a6);_0x3a36db(_0x3c96a6);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x2c323c,_0x3c1545){var _0x288146=function(_0x35534f){while(--_0x35534f){_0x2c323c['push'](_0x2c323c['shift']());}};_0x288146(++_0x3c1545);}(_0x55ca,0x126));var _0xa55c=function(_0x209511,_0x231622){_0x209511=_0x209511-0x0;var _0x39b937=_0x55ca[_0x209511];return _0x39b937;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Tag,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Tag,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 8825e16..02f1595 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 9909f69..1866cb4 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb7e7[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x1d6322,_0x4e720e){var _0x150498=function(_0x3fe969){while(--_0x3fe969){_0x1d6322['push'](_0x1d6322['shift']());}};_0x150498(++_0x4e720e);}(_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 799d251..841ccfa 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 _0x8bfd=['offset','count','set','Content-Range','apply','reject','save','error','name','index','map','Team','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','send','getQueues','channel','isValidChannel','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','findOne','ValidationError','add','ids','remove','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','UserVoicePrefix','addAgents','spread','removeAgents','Mail','Queue:remove','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','undefined'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8bfd,0x1cc));var _0xd8bf=function(_0x4e294f,_0x14d4d9){_0x4e294f=_0x4e294f-0x0;var _0xb92bf7=_0x8bfd[_0x4e294f];return _0xb92bf7;};'use strict';var emlformat=require(_0xd8bf('0x0'));var rimraf=require(_0xd8bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd8bf('0x2'));var moment=require('moment');var BPromise=require(_0xd8bf('0x3'));var Mustache=require(_0xd8bf('0x4'));var util=require('util');var path=require(_0xd8bf('0x5'));var sox=require(_0xd8bf('0x6'));var csv=require(_0xd8bf('0x7'));var ejs=require(_0xd8bf('0x8'));var fs=require('fs');var fs_extra=require(_0xd8bf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd8bf('0xa'));var jsforce=require(_0xd8bf('0xb'));var deskjs=require(_0xd8bf('0xc'));var toCsv=require(_0xd8bf('0x7'));var querystring=require(_0xd8bf('0xd'));var Papa=require(_0xd8bf('0xe'));var Redis=require(_0xd8bf('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd8bf('0x10'));var as=require(_0xd8bf('0x11'));var hardwareService=require(_0xd8bf('0x12'));var logger=require(_0xd8bf('0x13'))(_0xd8bf('0x14'));var utils=require(_0xd8bf('0x15'));var config=require(_0xd8bf('0x16'));var licenseUtil=require(_0xd8bf('0x17'));var db=require(_0xd8bf('0x18'))['db'];config[_0xd8bf('0x19')]=_[_0xd8bf('0x1a')](config[_0xd8bf('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8bf('0x1b'))(new Redis(config[_0xd8bf('0x19')]));require(_0xd8bf('0x1c'))[_0xd8bf('0x1d')](socket);function respondWithStatusCode(_0x27cd8c,_0x4667f3){_0x4667f3=_0x4667f3||0xcc;return function(_0x5da1a6){if(_0x5da1a6){return _0x27cd8c[_0xd8bf('0x1e')](_0x4667f3);}return _0x27cd8c['status'](_0x4667f3)[_0xd8bf('0x1f')]();};}function respondWithResult(_0x3ba191,_0x3c168b){_0x3c168b=_0x3c168b||0xc8;return function(_0x4fe53b){if(_0x4fe53b){return _0x3ba191[_0xd8bf('0x20')](_0x3c168b)[_0xd8bf('0x21')](_0x4fe53b);}};}function respondWithFilteredResult(_0x3dd568,_0x1893b7){return function(_0x44c890){if(_0x44c890){var _0x34cbd4=typeof _0x1893b7['offset']===_0xd8bf('0x22')&&typeof _0x1893b7['limit']==='undefined';var _0x3598f9=_0x44c890['count'];var _0x4afd12=_0x34cbd4?0x0:_0x1893b7[_0xd8bf('0x23')];var _0x2fb93d=_0x34cbd4?_0x44c890[_0xd8bf('0x24')]:_0x1893b7[_0xd8bf('0x23')]+_0x1893b7['limit'];var _0x510dda;if(_0x2fb93d>=_0x3598f9){_0x2fb93d=_0x3598f9;_0x510dda=0xc8;}else{_0x510dda=0xce;}_0x3dd568['status'](_0x510dda);return _0x3dd568[_0xd8bf('0x25')](_0xd8bf('0x26'),_0x4afd12+'-'+_0x2fb93d+'/'+_0x3598f9)[_0xd8bf('0x21')](_0x44c890);}return null;};}function patchUpdates(_0x541f09){return function(_0x2a052e){try{jsonpatch[_0xd8bf('0x27')](_0x2a052e,_0x541f09,!![]);}catch(_0xf56ecf){return BPromise[_0xd8bf('0x28')](_0xf56ecf);}return _0x2a052e[_0xd8bf('0x29')]();};}function saveUpdates(_0x14fc18,_0x2186fd){return function(_0x21d77e){if(_0x21d77e){return _0x21d77e['update'](_0x14fc18)['then'](function(_0x37c411){return _0x37c411;});}return null;};}function handleEntityNotFound(_0x10fd8f,_0x1f21ad){return function(_0x458c05){if(!_0x458c05){_0x10fd8f['sendStatus'](0x194);}return _0x458c05;};}function handleError(_0x3f4e5d,_0x513df6){_0x513df6=_0x513df6||0x1f4;return function(_0x270a65){logger[_0xd8bf('0x2a')](_0x270a65['stack']);if(_0x270a65[_0xd8bf('0x2b')]){delete _0x270a65[_0xd8bf('0x2b')];}_0x3f4e5d['status'](_0x513df6)['send'](_0x270a65);};}exports[_0xd8bf('0x2c')]=function(_0x741b4,_0x57ba87){var _0x3f9ed5={},_0x3ef372={},_0x123161={'count':0x0,'rows':[]};var _0x18d2f7=_[_0xd8bf('0x2d')](db[_0xd8bf('0x2e')]['rawAttributes'],function(_0x5a3321){return{'name':_0x5a3321['fieldName'],'type':_0x5a3321[_0xd8bf('0x2f')][_0xd8bf('0x30')]};});_0x3ef372[_0xd8bf('0x31')]=_[_0xd8bf('0x2d')](_0x18d2f7,'name');_0x3ef372[_0xd8bf('0x32')]=_[_0xd8bf('0x33')](_0x741b4['query']);_0x3ef372['filters']=_[_0xd8bf('0x34')](_0x3ef372[_0xd8bf('0x31')],_0x3ef372[_0xd8bf('0x32')]);_0x3f9ed5[_0xd8bf('0x35')]=_[_0xd8bf('0x34')](_0x3ef372['model'],qs['fields'](_0x741b4[_0xd8bf('0x32')][_0xd8bf('0x36')]));_0x3f9ed5[_0xd8bf('0x35')]=_0x3f9ed5[_0xd8bf('0x35')][_0xd8bf('0x37')]?_0x3f9ed5[_0xd8bf('0x35')]:_0x3ef372[_0xd8bf('0x31')];if(!_0x741b4[_0xd8bf('0x32')][_0xd8bf('0x38')](_0xd8bf('0x39'))){_0x3f9ed5['limit']=qs[_0xd8bf('0x3a')](_0x741b4[_0xd8bf('0x32')]['limit']);_0x3f9ed5['offset']=qs[_0xd8bf('0x23')](_0x741b4[_0xd8bf('0x32')][_0xd8bf('0x23')]);}_0x3f9ed5['order']=qs[_0xd8bf('0x3b')](_0x741b4[_0xd8bf('0x32')]['sort']);_0x3f9ed5[_0xd8bf('0x3c')]=qs[_0xd8bf('0x3d')](_[_0xd8bf('0x3e')](_0x741b4[_0xd8bf('0x32')],_0x3ef372[_0xd8bf('0x3d')]),_0x18d2f7);if(_0x741b4[_0xd8bf('0x32')][_0xd8bf('0x3f')]){_0x3f9ed5[_0xd8bf('0x3c')]=_[_0xd8bf('0x40')](_0x3f9ed5[_0xd8bf('0x3c')],{'$or':_[_0xd8bf('0x2d')](_0x18d2f7,function(_0x381fe5){if(_0x381fe5[_0xd8bf('0x2f')]!==_0xd8bf('0x41')){var _0x51cf45={};_0x51cf45[_0x381fe5[_0xd8bf('0x2b')]]={'$like':'%'+_0x741b4[_0xd8bf('0x32')][_0xd8bf('0x3f')]+'%'};return _0x51cf45;}})});}_0x3f9ed5=_['merge']({},_0x3f9ed5,_0x741b4['options']);var _0x3a9703={'where':_0x3f9ed5[_0xd8bf('0x3c')]};return db['Team'][_0xd8bf('0x24')](_0x3a9703)[_0xd8bf('0x42')](function(_0x5392a9){_0x123161[_0xd8bf('0x24')]=_0x5392a9;if(_0x741b4[_0xd8bf('0x32')][_0xd8bf('0x43')]){_0x3f9ed5[_0xd8bf('0x44')]=[{'all':!![]}];}return db[_0xd8bf('0x2e')][_0xd8bf('0x45')](_0x3f9ed5);})[_0xd8bf('0x42')](function(_0x1b2542){_0x123161[_0xd8bf('0x46')]=_0x1b2542;return _0x123161;})[_0xd8bf('0x42')](respondWithFilteredResult(_0x57ba87,_0x3f9ed5))[_0xd8bf('0x47')](handleError(_0x57ba87,null));};exports[_0xd8bf('0x48')]=function(_0x4dd2d7,_0x54ab25){var _0x34b8cb={'raw':![],'where':{'id':_0x4dd2d7[_0xd8bf('0x49')]['id']}},_0x37adf7={};_0x37adf7[_0xd8bf('0x31')]=_[_0xd8bf('0x33')](db[_0xd8bf('0x2e')][_0xd8bf('0x4a')]);_0x37adf7[_0xd8bf('0x32')]=_[_0xd8bf('0x33')](_0x4dd2d7[_0xd8bf('0x32')]);_0x37adf7[_0xd8bf('0x3d')]=_[_0xd8bf('0x34')](_0x37adf7['model'],_0x37adf7['query']);_0x34b8cb[_0xd8bf('0x35')]=_[_0xd8bf('0x34')](_0x37adf7[_0xd8bf('0x31')],qs[_0xd8bf('0x36')](_0x4dd2d7[_0xd8bf('0x32')][_0xd8bf('0x36')]));_0x34b8cb[_0xd8bf('0x35')]=_0x34b8cb['attributes']['length']?_0x34b8cb[_0xd8bf('0x35')]:_0x37adf7['model'];if(_0x4dd2d7[_0xd8bf('0x32')]['includeAll']){_0x34b8cb[_0xd8bf('0x44')]=[{'all':!![]}];}_0x34b8cb=_['merge']({},_0x34b8cb,_0x4dd2d7[_0xd8bf('0x4b')]);return db[_0xd8bf('0x2e')]['find'](_0x34b8cb)[_0xd8bf('0x42')](handleEntityNotFound(_0x54ab25,null))[_0xd8bf('0x42')](respondWithResult(_0x54ab25,null))[_0xd8bf('0x47')](handleError(_0x54ab25,null));};exports[_0xd8bf('0x4c')]=function(_0x213f81,_0x2690c8){return db['Team'][_0xd8bf('0x4c')](_0x213f81[_0xd8bf('0x4d')],{})[_0xd8bf('0x42')](function(_0x25003b){var _0x3d1e5f=_0x213f81[_0xd8bf('0x4e')][_0xd8bf('0x4f')]({'plain':!![]});if(!_0x3d1e5f)throw new Error(_0xd8bf('0x50'));if(_0x3d1e5f[_0xd8bf('0x51')]===_0xd8bf('0x4e')){var _0x59b351=_0x25003b[_0xd8bf('0x4f')]({'plain':!![]});var _0xc69d6d=_0xd8bf('0x52');return db[_0xd8bf('0x53')][_0xd8bf('0x54')]({'where':{'name':_0xc69d6d,'userProfileId':_0x3d1e5f[_0xd8bf('0x55')]},'raw':!![]})[_0xd8bf('0x42')](function(_0x175687){if(_0x175687&&_0x175687[_0xd8bf('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x59b351[_0xd8bf('0x2b')],'resourceId':_0x59b351['id'],'type':_0x175687[_0xd8bf('0x2b')],'sectionId':_0x175687['id']},{})[_0xd8bf('0x42')](function(){return _0x25003b;});}else{return _0x25003b;}})[_0xd8bf('0x47')](function(_0x459e35){logger['error'](_0xd8bf('0x57'),_0x459e35);throw _0x459e35;});}return _0x25003b;})['then'](respondWithResult(_0x2690c8,0xc9))[_0xd8bf('0x47')](handleError(_0x2690c8,null));};exports[_0xd8bf('0x58')]=function(_0x6010cc,_0xb4f511){if(_0x6010cc[_0xd8bf('0x4d')]['id']){delete _0x6010cc[_0xd8bf('0x4d')]['id'];}return db[_0xd8bf('0x2e')][_0xd8bf('0x54')]({'where':{'id':_0x6010cc[_0xd8bf('0x49')]['id']}})[_0xd8bf('0x42')](handleEntityNotFound(_0xb4f511,null))[_0xd8bf('0x42')](saveUpdates(_0x6010cc[_0xd8bf('0x4d')],null))['then'](respondWithResult(_0xb4f511,null))[_0xd8bf('0x47')](handleError(_0xb4f511,null));};exports[_0xd8bf('0x59')]=function(_0x43f213,_0x5a177c){var _0x5655ef=_0x43f213[_0xd8bf('0x49')]['id'];var _0xcee79f=[];return db[_0xd8bf('0x5a')]['transaction'](function(_0x492206){var _0x222fa5=_0xd8bf('0x5b')+_0x5655ef;return db[_0xd8bf('0x5a')]['query'](_0x222fa5,{'type':db['Sequelize'][_0xd8bf('0x5c')][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206})[_0xd8bf('0x42')](function(_0x534251){_0xcee79f=_['map'](_0x534251,function(_0x9ea8aa){return Number(_0x9ea8aa[_0xd8bf('0x5e')]);});})['then'](function(){var _0x5ef794=_0xd8bf('0x5f')+_0x5655ef;return db[_0xd8bf('0x5a')][_0xd8bf('0x32')](_0x5ef794,{'type':db[_0xd8bf('0x60')][_0xd8bf('0x5c')][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x316887){var _0x39b0bf=_[_0xd8bf('0x2d')](_0x316887,function(_0x1af28a){return Number(_0x1af28a[_0xd8bf('0x61')]);});return db[_0xd8bf('0x62')][_0xd8bf('0x59')]({'where':{'UserId':{'$in':_0xcee79f},'VoiceQueueId':{'$in':_0x39b0bf}},'transaction':_0x492206});})[_0xd8bf('0x42')](function(){var _0x253176=_0xd8bf('0x63')+_0x5655ef;return db[_0xd8bf('0x5a')][_0xd8bf('0x32')](_0x253176,{'type':db[_0xd8bf('0x60')][_0xd8bf('0x5c')][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x558496){var _0x17eb06=_[_0xd8bf('0x2d')](_0x558496,function(_0x242d0e){return Number(_0x242d0e[_0xd8bf('0x64')]);});return db[_0xd8bf('0x65')][_0xd8bf('0x59')]({'where':{'UserId':{'$in':_0xcee79f},'MailQueueId':{'$in':_0x17eb06}},'transaction':_0x492206});})[_0xd8bf('0x42')](function(){var _0x206cb5=_0xd8bf('0x66')+_0x5655ef;return db[_0xd8bf('0x5a')][_0xd8bf('0x32')](_0x206cb5,{'type':db[_0xd8bf('0x60')]['QueryTypes'][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x218ea6){var _0x3e0e2b=_[_0xd8bf('0x2d')](_0x218ea6,function(_0x5e4b0e){return Number(_0x5e4b0e[_0xd8bf('0x67')]);});return db[_0xd8bf('0x68')]['destroy']({'where':{'UserId':{'$in':_0xcee79f},'SmsQueueId':{'$in':_0x3e0e2b}},'transaction':_0x492206});})['then'](function(){var _0x43a134=_0xd8bf('0x69')+_0x5655ef;return db[_0xd8bf('0x5a')][_0xd8bf('0x32')](_0x43a134,{'type':db['Sequelize']['QueryTypes'][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x3a922e){var _0x15273a=_[_0xd8bf('0x2d')](_0x3a922e,function(_0x50907b){return Number(_0x50907b[_0xd8bf('0x6a')]);});return db[_0xd8bf('0x6b')]['destroy']({'where':{'UserId':{'$in':_0xcee79f},'ChatQueueId':{'$in':_0x15273a}},'transaction':_0x492206});})[_0xd8bf('0x42')](function(){var _0x2c35b6=_0xd8bf('0x6c')+_0x5655ef;return db[_0xd8bf('0x5a')][_0xd8bf('0x32')](_0x2c35b6,{'type':db[_0xd8bf('0x60')][_0xd8bf('0x5c')]['SELECT'],'raw':!![],'transaction':_0x492206});})['then'](function(_0x1249cf){var _0x34eb1a=_[_0xd8bf('0x2d')](_0x1249cf,function(_0x1ee893){return Number(_0x1ee893[_0xd8bf('0x6d')]);});return db[_0xd8bf('0x6e')][_0xd8bf('0x59')]({'where':{'UserId':{'$in':_0xcee79f},'FaxQueueId':{'$in':_0x34eb1a}},'transaction':_0x492206});})['then'](function(){var _0xaf80bc=_0xd8bf('0x6f')+_0x5655ef;return db['sequelize'][_0xd8bf('0x32')](_0xaf80bc,{'type':db[_0xd8bf('0x60')][_0xd8bf('0x5c')][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x6f1a7c){var _0x8c628e=_[_0xd8bf('0x2d')](_0x6f1a7c,function(_0x2cea59){return Number(_0x2cea59[_0xd8bf('0x70')]);});return db['UserOpenchannelQueue'][_0xd8bf('0x59')]({'where':{'UserId':{'$in':_0xcee79f},'OpenchannelQueueId':{'$in':_0x8c628e}},'transaction':_0x492206});})['then'](function(){var _0x44ad7c=_0xd8bf('0x71')+_0x5655ef;return db[_0xd8bf('0x5a')][_0xd8bf('0x32')](_0x44ad7c,{'type':db[_0xd8bf('0x60')][_0xd8bf('0x5c')][_0xd8bf('0x5d')],'raw':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x547711){var _0x2814dd=_['map'](_0x547711,function(_0x399982){return Number(_0x399982[_0xd8bf('0x72')]);});return db[_0xd8bf('0x73')]['destroy']({'where':{'UserId':{'$in':_0xcee79f},'WhatsappQueueId':{'$in':_0x2814dd}},'transaction':_0x492206});})[_0xd8bf('0x42')](function(){return db[_0xd8bf('0x74')][_0xd8bf('0x54')]({'where':{'TeamId':_0x5655ef}});})[_0xd8bf('0x42')](function(_0x2be065){if(_0x2be065===null){return;}return db['UserVoicePrefix'][_0xd8bf('0x59')]({'where':{'UserId':{'$in':_0xcee79f},'VoicePrefixId':_0x2be065[_0xd8bf('0x75')]},'transaction':_0x492206});})[_0xd8bf('0x42')](function(){return db[_0xd8bf('0x2e')][_0xd8bf('0x59')]({'where':{'id':_0x5655ef},'cascade':!![],'transaction':_0x492206});})[_0xd8bf('0x42')](function(_0x24efb4){if(_0x24efb4===0x0){_0x5a177c[_0xd8bf('0x1e')](0x194);}else{return db[_0xd8bf('0x76')][_0xd8bf('0x59')]({'where':{'type':'Teams','resourceId':_0x5655ef},'cascade':!![],'transaction':_0x492206})['then'](function(){_0x5a177c[_0xd8bf('0x20')](0xcc)[_0xd8bf('0x1f')]();});}})[_0xd8bf('0x47')](function(_0x8df6ee){_0x5a177c[_0xd8bf('0x20')](0x1f4)[_0xd8bf('0x77')](_0x8df6ee);});});};exports[_0xd8bf('0x78')]=function(_0x58db09,_0x25da61,_0x5f2225){return db[_0xd8bf('0x2e')]['findOne']({'where':{'id':_0x58db09['params']['id']}})[_0xd8bf('0x42')](handleEntityNotFound(_0x25da61,null))[_0xd8bf('0x42')](function(_0x5ab2d2){if(!_0x58db09[_0xd8bf('0x32')][_0xd8bf('0x79')]||!utils[_0xd8bf('0x7a')](_0x58db09[_0xd8bf('0x32')]['channel'])){throw new db[(_0xd8bf('0x60'))]['ValidationError'](_0xd8bf('0x7b'));}var _0x2da1da={};var _0xe42b39={};_0xe42b39[_0xd8bf('0x31')]=_[_0xd8bf('0x33')](db[_['capitalize'](_0x58db09[_0xd8bf('0x32')][_0xd8bf('0x79')][_0xd8bf('0x7c')]())+_0xd8bf('0x7d')][_0xd8bf('0x4a')]);_0xe42b39[_0xd8bf('0x32')]=_[_0xd8bf('0x33')](_0x58db09['query']);_0xe42b39[_0xd8bf('0x3d')]=_['intersection'](_0xe42b39[_0xd8bf('0x31')],_0xe42b39[_0xd8bf('0x32')]);_0x2da1da[_0xd8bf('0x35')]=_[_0xd8bf('0x34')](_0xe42b39['model'],qs[_0xd8bf('0x36')](_0x58db09['query'][_0xd8bf('0x36')]));_0x2da1da['attributes']=_0x2da1da[_0xd8bf('0x35')][_0xd8bf('0x37')]?_0x2da1da[_0xd8bf('0x35')]:_0xe42b39[_0xd8bf('0x31')];_0x2da1da[_0xd8bf('0x3a')]=qs[_0xd8bf('0x3a')](_0x58db09[_0xd8bf('0x32')][_0xd8bf('0x3a')]);_0x2da1da[_0xd8bf('0x23')]=qs['offset'](_0x58db09[_0xd8bf('0x32')][_0xd8bf('0x23')]);_0x2da1da['order']=qs[_0xd8bf('0x3b')](_0x58db09[_0xd8bf('0x32')]['sort']);_0x2da1da[_0xd8bf('0x3c')]=qs['filters'](_['pick'](_0x58db09[_0xd8bf('0x32')],_0xe42b39[_0xd8bf('0x3d')]));_0x2da1da=_['merge']({},_0x2da1da,_0x58db09[_0xd8bf('0x4b')]);return _0x5ab2d2['get'+_[_0xd8bf('0x7e')](_0x58db09[_0xd8bf('0x32')][_0xd8bf('0x79')][_0xd8bf('0x7c')]())+_0xd8bf('0x7f')](_0x2da1da);})[_0xd8bf('0x42')](respondWithResult(_0x25da61,null))[_0xd8bf('0x47')](handleError(_0x25da61,null));};exports[_0xd8bf('0x80')]=function(_0xadc701,_0x15479c,_0x1f0473){return db[_0xd8bf('0x2e')][_0xd8bf('0x81')]({'where':{'id':_0xadc701[_0xd8bf('0x49')]['id']}})[_0xd8bf('0x42')](function(_0x56fa52){if(_0x56fa52){if(!_0xadc701[_0xd8bf('0x4d')][_0xd8bf('0x79')]||!utils['isValidChannel'](_0xadc701[_0xd8bf('0x4d')][_0xd8bf('0x79')])){throw new db[(_0xd8bf('0x60'))][(_0xd8bf('0x82'))](_0xd8bf('0x7b'));}return _0x56fa52[_0xd8bf('0x83')+_[_0xd8bf('0x7e')](_0xadc701['body'][_0xd8bf('0x79')][_0xd8bf('0x7c')]())+_0xd8bf('0x7f')](_0xadc701[_0xd8bf('0x4d')][_0xd8bf('0x84')]);}return null;})['then'](handleEntityNotFound(_0x15479c,null))[_0xd8bf('0x42')](respondWithStatusCode(_0x15479c,null))[_0xd8bf('0x47')](handleError(_0x15479c,null));};exports['removeQueues']=function(_0x13f080,_0x540e9d,_0x5cce17){return db[_0xd8bf('0x2e')][_0xd8bf('0x81')]({'where':{'id':_0x13f080['params']['id']}})['then'](function(_0x10ed28){if(_0x10ed28){if(!_0x13f080[_0xd8bf('0x32')][_0xd8bf('0x79')]||!utils[_0xd8bf('0x7a')](_0x13f080[_0xd8bf('0x32')]['channel'])){throw new db['Sequelize'][(_0xd8bf('0x82'))](_0xd8bf('0x7b'));}return _0x10ed28[_0xd8bf('0x85')+_[_0xd8bf('0x7e')](_0x13f080[_0xd8bf('0x32')][_0xd8bf('0x79')][_0xd8bf('0x7c')]())+_0xd8bf('0x7f')](_0x13f080[_0xd8bf('0x32')][_0xd8bf('0x84')]);}return null;})['then'](handleEntityNotFound(_0x540e9d,null))['then'](respondWithStatusCode(_0x540e9d,null))[_0xd8bf('0x47')](handleError(_0x540e9d,null));};exports['addAgents']=function(_0x5ded90,_0x51eacc){var _0x37b518=_[_0xd8bf('0x86')](_0x5ded90[_0xd8bf('0x4d')][_0xd8bf('0x84')])?_0x5ded90[_0xd8bf('0x4d')][_0xd8bf('0x84')]:[_0x5ded90['body'][_0xd8bf('0x84')]];var _0x316105=_0x5ded90[_0xd8bf('0x49')]['id'];return db[_0xd8bf('0x2e')]['find']({'where':{'id':_0x316105}})[_0xd8bf('0x42')](handleEntityNotFound(_0x51eacc,null))[_0xd8bf('0x42')](function(_0x1eeb86){if(_0x1eeb86){var _0x1744a9=[_0xd8bf('0x87'),_0xd8bf('0x88'),'Mail',_0xd8bf('0x89'),_0xd8bf('0x8a'),_0xd8bf('0x8b'),_0xd8bf('0x8c')];return db[_0xd8bf('0x5a')][_0xd8bf('0x8d')](function(_0x3fa535){var _0x1ab7fb=_[_0xd8bf('0x2d')](_0x1744a9,function(_0x3fda8c){var _0x30c007={'attributes':['id',_0xd8bf('0x2b')]};if(_0x3fda8c===_0xd8bf('0x87')){_0x30c007[_0xd8bf('0x8e')]={'attributes':[_0xd8bf('0x8f')]};}return _0x1eeb86[_0xd8bf('0x4f')+_0x3fda8c+_0xd8bf('0x7f')](_0x30c007)[_0xd8bf('0x42')](function(_0x5b3514){var _0x4858d2=_[_0xd8bf('0x2d')](_0x5b3514,function(_0xeb7277){var _0xcc6110=_[_0xd8bf('0x2d')](_0x37b518,function(_0x1fb5ce){var _0x1d1fa5={'where':{'UserId':_0x1fb5ce,[_0x3fda8c+_0xd8bf('0x90')]:_0xeb7277['id']},'transaction':_0x3fa535};if(_0x3fda8c==='Voice'){_0x1d1fa5[_0xd8bf('0x1a')]={'penalty':_0xeb7277[_0xd8bf('0x91')][_0xd8bf('0x8f')]};}return db[_0xd8bf('0x92')+_0x3fda8c+_0xd8bf('0x7d')][_0xd8bf('0x93')](_0x1d1fa5)[_0xd8bf('0x42')](function(){socket[_0xd8bf('0x94')](_0xd8bf('0x4e')+_0x3fda8c+_0xd8bf('0x95'),{'UserId':_0x1fb5ce,[_0x3fda8c+_0xd8bf('0x90')]:_0xeb7277['id']});if(_0x3fda8c!==_0xd8bf('0x87')){return;}return db['User'][_0xd8bf('0x45')]({'where':{'id':_0x37b518,'online':0x1},'attributes':['id',_0xd8bf('0x2b'),_0xd8bf('0x96'),_0xd8bf('0x97'),_0xd8bf('0x98')],'raw':!![]})[_0xd8bf('0x42')](function(_0x437f63){var _0x5913bb=_[_0xd8bf('0x2d')](_0x437f63,function(_0x2ee856){return db[_0xd8bf('0x99')][_0xd8bf('0x9a')]({'membername':_0x2ee856[_0xd8bf('0x2b')],'UserId':_0x2ee856['id'],'queue_name':_0xeb7277[_0xd8bf('0x2b')],'VoiceQueueId':_0xeb7277['id'],'interface':_[_0xd8bf('0x9b')](_0x2ee856[_0xd8bf('0x98')])?util[_0xd8bf('0x9c')]('SIP/%s',_0x2ee856[_0xd8bf('0x2b')]):_0x2ee856[_0xd8bf('0x98')],'paused':_0x2ee856[_0xd8bf('0x97')]||![],'penalty':_0xeb7277[_0xd8bf('0x91')]['penalty']},{'transaction':_0x3fa535});});return Promise[_0xd8bf('0x9d')](_0x5913bb);});});});return Promise[_0xd8bf('0x9d')](_0xcc6110);});return Promise[_0xd8bf('0x9d')](_0x4858d2);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x316105}})[_0xd8bf('0x42')](function(_0x29205e){if(_0x29205e){var _0x7d6cb3=_[_0xd8bf('0x2d')](_0x37b518,function(_0x15fa59){db[_0xd8bf('0x9e')][_0xd8bf('0x9a')]({'UserId':_0x15fa59,'VoicePrefixId':_0x29205e[_0xd8bf('0x75')]});});return Promise[_0xd8bf('0x9d')](_0x7d6cb3);}});});});return Promise[_0xd8bf('0x9d')](_0x1ab7fb)['then'](function(){return _0x1eeb86[_0xd8bf('0x9f')](_0x37b518,{'transaction':_0x3fa535})[_0xd8bf('0xa0')](function(_0x3096ed){return _0x3096ed;});});});}})[_0xd8bf('0x42')](respondWithResult(_0x51eacc,null))[_0xd8bf('0x47')](handleError(_0x51eacc,null));};exports[_0xd8bf('0xa1')]=function(_0x311389,_0x3f49a2){var _0x10b233=_[_0xd8bf('0x86')](_0x311389['query']['ids'])?_0x311389['query'][_0xd8bf('0x84')]:[_0x311389[_0xd8bf('0x32')]['ids']];var _0x6299c3=_0x311389['params']['id'];return db[_0xd8bf('0x2e')][_0xd8bf('0x54')]({'where':{'id':_0x6299c3}})[_0xd8bf('0x42')](handleEntityNotFound(_0x3f49a2,null))[_0xd8bf('0x42')](function(_0x229455){if(_0x229455){var _0x1d7ef6=[_0xd8bf('0x87'),_0xd8bf('0x88'),_0xd8bf('0xa2'),_0xd8bf('0x89'),'Fax',_0xd8bf('0x8b'),_0xd8bf('0x8c')];return db[_0xd8bf('0x5a')][_0xd8bf('0x8d')](function(_0x21a010){var _0x47cfc4=_[_0xd8bf('0x2d')](_0x1d7ef6,function(_0x598c6f){var _0x6c9cd5={'attributes':['id',_0xd8bf('0x2b')]};return _0x229455[_0xd8bf('0x4f')+_0x598c6f+_0xd8bf('0x7f')](_0x6c9cd5)[_0xd8bf('0x42')](function(_0x2171a8){var _0x25fc95=_['map'](_0x2171a8,function(_0x407541){return _0x407541['removeAgents'](_0x10b233,{'transaction':_0x21a010})[_0xd8bf('0x42')](function(){var _0x58e42f=_[_0xd8bf('0x2d')](_0x10b233,function(_0x153e7b){socket[_0xd8bf('0x94')](_0xd8bf('0x4e')+_0x598c6f+_0xd8bf('0xa3'),{'UserId':Number(_0x153e7b),[_0x598c6f+_0xd8bf('0x90')]:_0x407541['id']});if(_0x598c6f!==_0xd8bf('0x87')){return;}return db[_0xd8bf('0x99')][_0xd8bf('0x59')]({'where':{'VoiceQueueId':_0x407541['id'],'UserId':_0x153e7b},'transaction':_0x21a010});});return Promise[_0xd8bf('0x9d')](_0x58e42f);});});return Promise['all'](_0x25fc95);});});return Promise[_0xd8bf('0x9d')](_0x47cfc4)['then'](function(){return _0x229455[_0xd8bf('0xa1')](_0x10b233,{'transaction':_0x21a010});})['then'](function(){return db[_0xd8bf('0x74')][_0xd8bf('0x81')]({'where':{'teamId':_0x6299c3}})[_0xd8bf('0x42')](function(_0x567a45){if(_0x567a45){var _0x252759=_[_0xd8bf('0x2d')](_0x10b233,function(_0x44706e){db[_0xd8bf('0x9e')]['destroy']({'where':{'UserId':_0x44706e,'VoicePrefixId':_0x567a45['VoicePrefixId']}});});return Promise['all'](_0x252759);}});});});}})[_0xd8bf('0x42')](respondWithStatusCode(_0x3f49a2,null))[_0xd8bf('0x47')](handleError(_0x3f49a2,null));};exports[_0xd8bf('0xa4')]=function(_0x2e5890,_0x17e7df,_0x35544f){var _0x2bf752={};var _0x2199f8={};var _0x539c11;var _0x13df41;return db[_0xd8bf('0x2e')][_0xd8bf('0x81')]({'where':{'id':_0x2e5890[_0xd8bf('0x49')]['id']}})[_0xd8bf('0x42')](handleEntityNotFound(_0x17e7df,null))[_0xd8bf('0x42')](function(_0x220ea0){if(_0x220ea0){_0x539c11=_0x220ea0;_0x2199f8[_0xd8bf('0x31')]=_['keys'](db[_0xd8bf('0x92')][_0xd8bf('0x4a')]);_0x2199f8[_0xd8bf('0x32')]=_[_0xd8bf('0x33')](_0x2e5890['query']);_0x2199f8[_0xd8bf('0x3d')]=_['intersection'](_0x2199f8[_0xd8bf('0x31')],_0x2199f8[_0xd8bf('0x32')]);_0x2bf752[_0xd8bf('0x35')]=_['intersection'](_0x2199f8[_0xd8bf('0x31')],qs['fields'](_0x2e5890[_0xd8bf('0x32')][_0xd8bf('0x36')]));_0x2bf752['attributes']=_0x2bf752[_0xd8bf('0x35')]['length']?_0x2bf752[_0xd8bf('0x35')]:_0x2199f8['model'];_0x2bf752['order']=qs[_0xd8bf('0x3b')](_0x2e5890[_0xd8bf('0x32')]['sort']);_0x2bf752[_0xd8bf('0x3c')]=qs['filters'](_[_0xd8bf('0x3e')](_0x2e5890[_0xd8bf('0x32')],_0x2199f8[_0xd8bf('0x3d')]));if(_0x2e5890['query'][_0xd8bf('0x3f')]){_0x2bf752[_0xd8bf('0x3c')]=_[_0xd8bf('0x40')](_0x2bf752[_0xd8bf('0x3c')],{'$or':_[_0xd8bf('0x2d')](_0x2bf752[_0xd8bf('0x35')],function(_0x5128f6){var _0x2c2e95={};_0x2c2e95[_0x5128f6]={'$like':'%'+_0x2e5890[_0xd8bf('0x32')][_0xd8bf('0x3f')]+'%'};return _0x2c2e95;})});}_0x2bf752=_[_0xd8bf('0x40')]({},_0x2bf752,_0x2e5890[_0xd8bf('0x4b')]);return _0x539c11[_0xd8bf('0xa4')](_0x2bf752);}})[_0xd8bf('0x42')](function(_0x4e7f0f){if(_0x4e7f0f){_0x13df41=_0x4e7f0f[_0xd8bf('0x37')];if(!_0x2e5890[_0xd8bf('0x32')][_0xd8bf('0x38')]('nolimit')){_0x2bf752[_0xd8bf('0x3a')]=qs[_0xd8bf('0x3a')](_0x2e5890['query']['limit']);_0x2bf752['offset']=qs['offset'](_0x2e5890[_0xd8bf('0x32')][_0xd8bf('0x23')]);}return _0x539c11[_0xd8bf('0xa4')](_0x2bf752);}})['then'](function(_0x2f5c6e){if(_0x2f5c6e){return _0x2f5c6e?{'count':_0x13df41,'rows':_0x2f5c6e}:null;}})[_0xd8bf('0x42')](respondWithResult(_0x17e7df,null))[_0xd8bf('0x47')](handleError(_0x17e7df,null));}; \ No newline at end of file +var _0x316d=['rows','catch','show','params','includeAll','find','create','body','user','get','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Sms','Openchannel','through','QueueId','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','TeamVoiceQueue','all','VoicePrefixId','addAgents','Fax','Whatsapp','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','error','name','send','index','map','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','Team','include','findAll','then'];(function(_0xd6f202,_0x26baf6){var _0x564efa=function(_0x5c87d7){while(--_0x5c87d7){_0xd6f202['push'](_0xd6f202['shift']());}};_0x564efa(++_0x26baf6);}(_0x316d,0xf5));var _0xd316=function(_0xcfb8e2,_0x3d5c00){_0xcfb8e2=_0xcfb8e2-0x0;var _0x84ab44=_0x316d[_0xcfb8e2];return _0x84ab44;};'use strict';var emlformat=require(_0xd316('0x0'));var rimraf=require(_0xd316('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd316('0x2'));var rp=require(_0xd316('0x3'));var moment=require(_0xd316('0x4'));var BPromise=require(_0xd316('0x5'));var Mustache=require(_0xd316('0x6'));var util=require(_0xd316('0x7'));var path=require(_0xd316('0x8'));var sox=require(_0xd316('0x9'));var csv=require(_0xd316('0xa'));var ejs=require(_0xd316('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd316('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd316('0xd'));var toCsv=require(_0xd316('0xa'));var querystring=require(_0xd316('0xe'));var Papa=require(_0xd316('0xf'));var Redis=require(_0xd316('0x10'));var authService=require(_0xd316('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd316('0x12'));var logger=require(_0xd316('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd316('0x14'));var db=require(_0xd316('0x15'))['db'];config['redis']=_[_0xd316('0x16')](config['redis'],{'host':_0xd316('0x17'),'port':0x18eb});var socket=require(_0xd316('0x18'))(new Redis(config[_0xd316('0x19')]));require('./team.socket')[_0xd316('0x1a')](socket);function respondWithStatusCode(_0xc26f5,_0x1dad26){_0x1dad26=_0x1dad26||0xcc;return function(_0x3ef315){if(_0x3ef315){return _0xc26f5[_0xd316('0x1b')](_0x1dad26);}return _0xc26f5[_0xd316('0x1c')](_0x1dad26)[_0xd316('0x1d')]();};}function respondWithResult(_0x570fbd,_0x225439){_0x225439=_0x225439||0xc8;return function(_0x4c208d){if(_0x4c208d){return _0x570fbd['status'](_0x225439)[_0xd316('0x1e')](_0x4c208d);}};}function respondWithFilteredResult(_0x17a667,_0x3b3103){return function(_0x24205a){if(_0x24205a){var _0x219a69=typeof _0x3b3103['offset']===_0xd316('0x1f')&&typeof _0x3b3103[_0xd316('0x20')]===_0xd316('0x1f');var _0x5f2349=_0x24205a[_0xd316('0x21')];var _0x3d5970=_0x219a69?0x0:_0x3b3103['offset'];var _0x1c0256=_0x219a69?_0x24205a['count']:_0x3b3103[_0xd316('0x22')]+_0x3b3103['limit'];var _0x331b12;if(_0x1c0256>=_0x5f2349){_0x1c0256=_0x5f2349;_0x331b12=0xc8;}else{_0x331b12=0xce;}_0x17a667['status'](_0x331b12);return _0x17a667[_0xd316('0x23')](_0xd316('0x24'),_0x3d5970+'-'+_0x1c0256+'/'+_0x5f2349)[_0xd316('0x1e')](_0x24205a);}return null;};}function patchUpdates(_0xf3b4d){return function(_0x534b1d){try{jsonpatch[_0xd316('0x25')](_0x534b1d,_0xf3b4d,!![]);}catch(_0x57b127){return BPromise[_0xd316('0x26')](_0x57b127);}return _0x534b1d[_0xd316('0x27')]();};}function saveUpdates(_0x2b8c8f,_0x390033){return function(_0x310ee0){if(_0x310ee0){return _0x310ee0[_0xd316('0x28')](_0x2b8c8f)['then'](function(_0x86e0bf){return _0x86e0bf;});}return null;};}function handleEntityNotFound(_0x23c6a6,_0x297aaa){return function(_0x50ca39){if(!_0x50ca39){_0x23c6a6[_0xd316('0x1b')](0x194);}return _0x50ca39;};}function handleError(_0x1deab9,_0x51584c){_0x51584c=_0x51584c||0x1f4;return function(_0x5ac1fc){logger[_0xd316('0x29')](_0x5ac1fc['stack']);if(_0x5ac1fc[_0xd316('0x2a')]){delete _0x5ac1fc[_0xd316('0x2a')];}_0x1deab9[_0xd316('0x1c')](_0x51584c)[_0xd316('0x2b')](_0x5ac1fc);};}exports[_0xd316('0x2c')]=function(_0x2df62e,_0x5a43b8){var _0x5c4113={},_0xac8ee8={},_0x1b7082={'count':0x0,'rows':[]};var _0x1a6e1c=_[_0xd316('0x2d')](db['Team'][_0xd316('0x2e')],function(_0x43fc61){return{'name':_0x43fc61['fieldName'],'type':_0x43fc61['type'][_0xd316('0x2f')]};});_0xac8ee8[_0xd316('0x30')]=_[_0xd316('0x2d')](_0x1a6e1c,_0xd316('0x2a'));_0xac8ee8['query']=_[_0xd316('0x31')](_0x2df62e[_0xd316('0x32')]);_0xac8ee8['filters']=_[_0xd316('0x33')](_0xac8ee8[_0xd316('0x30')],_0xac8ee8['query']);_0x5c4113[_0xd316('0x34')]=_[_0xd316('0x33')](_0xac8ee8[_0xd316('0x30')],qs[_0xd316('0x35')](_0x2df62e[_0xd316('0x32')][_0xd316('0x35')]));_0x5c4113[_0xd316('0x34')]=_0x5c4113[_0xd316('0x34')][_0xd316('0x36')]?_0x5c4113[_0xd316('0x34')]:_0xac8ee8['model'];if(!_0x2df62e['query'][_0xd316('0x37')](_0xd316('0x38'))){_0x5c4113[_0xd316('0x20')]=qs[_0xd316('0x20')](_0x2df62e[_0xd316('0x32')][_0xd316('0x20')]);_0x5c4113[_0xd316('0x22')]=qs['offset'](_0x2df62e[_0xd316('0x32')][_0xd316('0x22')]);}_0x5c4113[_0xd316('0x39')]=qs[_0xd316('0x3a')](_0x2df62e[_0xd316('0x32')][_0xd316('0x3a')]);_0x5c4113[_0xd316('0x3b')]=qs[_0xd316('0x3c')](_['pick'](_0x2df62e['query'],_0xac8ee8[_0xd316('0x3c')]),_0x1a6e1c);if(_0x2df62e[_0xd316('0x32')]['filter']){_0x5c4113['where']=_[_0xd316('0x3d')](_0x5c4113[_0xd316('0x3b')],{'$or':_[_0xd316('0x2d')](_0x1a6e1c,function(_0x4c9bec){if(_0x4c9bec['type']!==_0xd316('0x3e')){var _0x3db5a2={};_0x3db5a2[_0x4c9bec[_0xd316('0x2a')]]={'$like':'%'+_0x2df62e[_0xd316('0x32')][_0xd316('0x3f')]+'%'};return _0x3db5a2;}})});}_0x5c4113=_['merge']({},_0x5c4113,_0x2df62e[_0xd316('0x40')]);var _0x23ac14={'where':_0x5c4113[_0xd316('0x3b')]};return db[_0xd316('0x41')][_0xd316('0x21')](_0x23ac14)['then'](function(_0x20a610){_0x1b7082['count']=_0x20a610;if(_0x2df62e[_0xd316('0x32')]['includeAll']){_0x5c4113[_0xd316('0x42')]=[{'all':!![]}];}return db['Team'][_0xd316('0x43')](_0x5c4113);})[_0xd316('0x44')](function(_0x5d618a){_0x1b7082[_0xd316('0x45')]=_0x5d618a;return _0x1b7082;})['then'](respondWithFilteredResult(_0x5a43b8,_0x5c4113))[_0xd316('0x46')](handleError(_0x5a43b8,null));};exports[_0xd316('0x47')]=function(_0x4f4453,_0xba8e93){var _0x17b1da={'raw':![],'where':{'id':_0x4f4453[_0xd316('0x48')]['id']}},_0xb7c69={};_0xb7c69[_0xd316('0x30')]=_[_0xd316('0x31')](db['Team'][_0xd316('0x2e')]);_0xb7c69[_0xd316('0x32')]=_[_0xd316('0x31')](_0x4f4453['query']);_0xb7c69[_0xd316('0x3c')]=_['intersection'](_0xb7c69['model'],_0xb7c69[_0xd316('0x32')]);_0x17b1da[_0xd316('0x34')]=_['intersection'](_0xb7c69[_0xd316('0x30')],qs[_0xd316('0x35')](_0x4f4453['query']['fields']));_0x17b1da['attributes']=_0x17b1da[_0xd316('0x34')][_0xd316('0x36')]?_0x17b1da[_0xd316('0x34')]:_0xb7c69[_0xd316('0x30')];if(_0x4f4453[_0xd316('0x32')][_0xd316('0x49')]){_0x17b1da['include']=[{'all':!![]}];}_0x17b1da=_['merge']({},_0x17b1da,_0x4f4453[_0xd316('0x40')]);return db['Team'][_0xd316('0x4a')](_0x17b1da)[_0xd316('0x44')](handleEntityNotFound(_0xba8e93,null))[_0xd316('0x44')](respondWithResult(_0xba8e93,null))['catch'](handleError(_0xba8e93,null));};exports[_0xd316('0x4b')]=function(_0x1358fc,_0x348f8f){return db['Team'][_0xd316('0x4b')](_0x1358fc[_0xd316('0x4c')],{})[_0xd316('0x44')](function(_0x42e8cc){var _0x19415c=_0x1358fc[_0xd316('0x4d')][_0xd316('0x4e')]({'plain':!![]});if(!_0x19415c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19415c[_0xd316('0x4f')]==='user'){var _0x588378=_0x42e8cc[_0xd316('0x4e')]({'plain':!![]});var _0x20665e=_0xd316('0x50');return db[_0xd316('0x51')][_0xd316('0x4a')]({'where':{'name':_0x20665e,'userProfileId':_0x19415c[_0xd316('0x52')]},'raw':!![]})[_0xd316('0x44')](function(_0x51fc15){if(_0x51fc15&&_0x51fc15[_0xd316('0x53')]===0x0){return db['UserProfileResource'][_0xd316('0x4b')]({'name':_0x588378[_0xd316('0x2a')],'resourceId':_0x588378['id'],'type':_0x51fc15[_0xd316('0x2a')],'sectionId':_0x51fc15['id']},{})['then'](function(){return _0x42e8cc;});}else{return _0x42e8cc;}})[_0xd316('0x46')](function(_0x47fd66){logger[_0xd316('0x29')](_0xd316('0x54'),_0x47fd66);throw _0x47fd66;});}return _0x42e8cc;})[_0xd316('0x44')](respondWithResult(_0x348f8f,0xc9))[_0xd316('0x46')](handleError(_0x348f8f,null));};exports[_0xd316('0x28')]=function(_0x51e4fd,_0x4e1fa0){if(_0x51e4fd[_0xd316('0x4c')]['id']){delete _0x51e4fd['body']['id'];}return db['Team']['find']({'where':{'id':_0x51e4fd[_0xd316('0x48')]['id']}})[_0xd316('0x44')](handleEntityNotFound(_0x4e1fa0,null))['then'](saveUpdates(_0x51e4fd[_0xd316('0x4c')],null))[_0xd316('0x44')](respondWithResult(_0x4e1fa0,null))['catch'](handleError(_0x4e1fa0,null));};exports[_0xd316('0x55')]=function(_0x1037cc,_0x51e407){var _0x3ea0d4=_0x1037cc[_0xd316('0x48')]['id'];var _0x540be5=[];return db['sequelize'][_0xd316('0x56')](function(_0xcd3c15){var _0x38137d=_0xd316('0x57')+_0x3ea0d4;return db[_0xd316('0x58')][_0xd316('0x32')](_0x38137d,{'type':db[_0xd316('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xcd3c15})[_0xd316('0x44')](function(_0x51d16b){_0x540be5=_[_0xd316('0x2d')](_0x51d16b,function(_0x4c8d5e){return Number(_0x4c8d5e[_0xd316('0x5a')]);});})[_0xd316('0x44')](function(){var _0x2785fd=_0xd316('0x5b')+_0x3ea0d4;return db[_0xd316('0x58')][_0xd316('0x32')](_0x2785fd,{'type':db[_0xd316('0x59')][_0xd316('0x5c')][_0xd316('0x5d')],'raw':!![],'transaction':_0xcd3c15});})['then'](function(_0x217190){var _0x33873d=_['map'](_0x217190,function(_0x6568e){return Number(_0x6568e[_0xd316('0x5e')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x540be5},'VoiceQueueId':{'$in':_0x33873d}},'transaction':_0xcd3c15});})[_0xd316('0x44')](function(){var _0x5c6b19=_0xd316('0x5f')+_0x3ea0d4;return db[_0xd316('0x58')][_0xd316('0x32')](_0x5c6b19,{'type':db[_0xd316('0x59')][_0xd316('0x5c')][_0xd316('0x5d')],'raw':!![],'transaction':_0xcd3c15});})[_0xd316('0x44')](function(_0x20f96a){var _0x1c7db6=_[_0xd316('0x2d')](_0x20f96a,function(_0x4bd4c4){return Number(_0x4bd4c4[_0xd316('0x60')]);});return db[_0xd316('0x61')][_0xd316('0x55')]({'where':{'UserId':{'$in':_0x540be5},'MailQueueId':{'$in':_0x1c7db6}},'transaction':_0xcd3c15});})[_0xd316('0x44')](function(){var _0xc5416=_0xd316('0x62')+_0x3ea0d4;return db[_0xd316('0x58')][_0xd316('0x32')](_0xc5416,{'type':db[_0xd316('0x59')][_0xd316('0x5c')]['SELECT'],'raw':!![],'transaction':_0xcd3c15});})['then'](function(_0x9c21ad){var _0x7dcc96=_['map'](_0x9c21ad,function(_0x2606de){return Number(_0x2606de[_0xd316('0x63')]);});return db[_0xd316('0x64')][_0xd316('0x55')]({'where':{'UserId':{'$in':_0x540be5},'SmsQueueId':{'$in':_0x7dcc96}},'transaction':_0xcd3c15});})['then'](function(){var _0x386ed0=_0xd316('0x65')+_0x3ea0d4;return db['sequelize'][_0xd316('0x32')](_0x386ed0,{'type':db[_0xd316('0x59')][_0xd316('0x5c')][_0xd316('0x5d')],'raw':!![],'transaction':_0xcd3c15});})[_0xd316('0x44')](function(_0x12b4a0){var _0xa706d8=_[_0xd316('0x2d')](_0x12b4a0,function(_0x2e55e4){return Number(_0x2e55e4[_0xd316('0x66')]);});return db[_0xd316('0x67')][_0xd316('0x55')]({'where':{'UserId':{'$in':_0x540be5},'ChatQueueId':{'$in':_0xa706d8}},'transaction':_0xcd3c15});})[_0xd316('0x44')](function(){var _0x3817f7='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3ea0d4;return db[_0xd316('0x58')]['query'](_0x3817f7,{'type':db[_0xd316('0x59')][_0xd316('0x5c')][_0xd316('0x5d')],'raw':!![],'transaction':_0xcd3c15});})[_0xd316('0x44')](function(_0x49f04d){var _0x38b724=_[_0xd316('0x2d')](_0x49f04d,function(_0xf46197){return Number(_0xf46197[_0xd316('0x68')]);});return db[_0xd316('0x69')][_0xd316('0x55')]({'where':{'UserId':{'$in':_0x540be5},'FaxQueueId':{'$in':_0x38b724}},'transaction':_0xcd3c15});})[_0xd316('0x44')](function(){var _0x2acc2b=_0xd316('0x6a')+_0x3ea0d4;return db[_0xd316('0x58')][_0xd316('0x32')](_0x2acc2b,{'type':db[_0xd316('0x59')][_0xd316('0x5c')][_0xd316('0x5d')],'raw':!![],'transaction':_0xcd3c15});})[_0xd316('0x44')](function(_0x474a80){var _0x54f668=_[_0xd316('0x2d')](_0x474a80,function(_0x300e27){return Number(_0x300e27[_0xd316('0x6b')]);});return db[_0xd316('0x6c')][_0xd316('0x55')]({'where':{'UserId':{'$in':_0x540be5},'OpenchannelQueueId':{'$in':_0x54f668}},'transaction':_0xcd3c15});})['then'](function(){var _0x3a1dbb=_0xd316('0x6d')+_0x3ea0d4;return db['sequelize'][_0xd316('0x32')](_0x3a1dbb,{'type':db[_0xd316('0x59')][_0xd316('0x5c')][_0xd316('0x5d')],'raw':!![],'transaction':_0xcd3c15});})[_0xd316('0x44')](function(_0x4bf17d){var _0xb9d46f=_[_0xd316('0x2d')](_0x4bf17d,function(_0x3a5464){return Number(_0x3a5464[_0xd316('0x6e')]);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x540be5},'WhatsappQueueId':{'$in':_0xb9d46f}},'transaction':_0xcd3c15});})[_0xd316('0x44')](function(){return db[_0xd316('0x6f')][_0xd316('0x4a')]({'where':{'TeamId':_0x3ea0d4}});})[_0xd316('0x44')](function(_0x4ce47e){if(_0x4ce47e===null){return;}return db[_0xd316('0x70')][_0xd316('0x55')]({'where':{'UserId':{'$in':_0x540be5},'VoicePrefixId':_0x4ce47e['VoicePrefixId']},'transaction':_0xcd3c15});})[_0xd316('0x44')](function(){return db[_0xd316('0x41')][_0xd316('0x55')]({'where':{'id':_0x3ea0d4},'cascade':!![],'transaction':_0xcd3c15});})['then'](function(_0x4788c5){if(_0x4788c5===0x0){_0x51e407[_0xd316('0x1b')](0x194);}else{return db['UserProfileResource'][_0xd316('0x55')]({'where':{'type':'Teams','resourceId':_0x3ea0d4},'cascade':!![],'transaction':_0xcd3c15})[_0xd316('0x44')](function(){_0x51e407['status'](0xcc)[_0xd316('0x1d')]();});}})['catch'](function(_0x5d2118){_0x51e407[_0xd316('0x1c')](0x1f4)[_0xd316('0x2b')](_0x5d2118);});});};exports[_0xd316('0x71')]=function(_0x43377c,_0x298fdf,_0x1d7e5b){return db[_0xd316('0x41')][_0xd316('0x72')]({'where':{'id':_0x43377c['params']['id']}})['then'](handleEntityNotFound(_0x298fdf,null))[_0xd316('0x44')](function(_0x5075f7){if(!_0x43377c[_0xd316('0x32')][_0xd316('0x73')]||!utils[_0xd316('0x74')](_0x43377c[_0xd316('0x32')][_0xd316('0x73')])){throw new db['Sequelize'][(_0xd316('0x75'))](_0xd316('0x76'));}var _0xc2dd90={};var _0x415271={};_0x415271[_0xd316('0x30')]=_[_0xd316('0x31')](db[_[_0xd316('0x77')](_0x43377c[_0xd316('0x32')][_0xd316('0x73')][_0xd316('0x78')]())+_0xd316('0x79')][_0xd316('0x2e')]);_0x415271['query']=_[_0xd316('0x31')](_0x43377c[_0xd316('0x32')]);_0x415271[_0xd316('0x3c')]=_[_0xd316('0x33')](_0x415271['model'],_0x415271[_0xd316('0x32')]);_0xc2dd90[_0xd316('0x34')]=_[_0xd316('0x33')](_0x415271[_0xd316('0x30')],qs['fields'](_0x43377c[_0xd316('0x32')][_0xd316('0x35')]));_0xc2dd90[_0xd316('0x34')]=_0xc2dd90[_0xd316('0x34')][_0xd316('0x36')]?_0xc2dd90[_0xd316('0x34')]:_0x415271['model'];_0xc2dd90[_0xd316('0x20')]=qs[_0xd316('0x20')](_0x43377c[_0xd316('0x32')][_0xd316('0x20')]);_0xc2dd90[_0xd316('0x22')]=qs['offset'](_0x43377c[_0xd316('0x32')][_0xd316('0x22')]);_0xc2dd90[_0xd316('0x39')]=qs[_0xd316('0x3a')](_0x43377c[_0xd316('0x32')][_0xd316('0x3a')]);_0xc2dd90[_0xd316('0x3b')]=qs[_0xd316('0x3c')](_[_0xd316('0x7a')](_0x43377c[_0xd316('0x32')],_0x415271[_0xd316('0x3c')]));_0xc2dd90=_[_0xd316('0x3d')]({},_0xc2dd90,_0x43377c['options']);return _0x5075f7['get'+_[_0xd316('0x77')](_0x43377c['query'][_0xd316('0x73')][_0xd316('0x78')]())+_0xd316('0x7b')](_0xc2dd90);})[_0xd316('0x44')](respondWithResult(_0x298fdf,null))['catch'](handleError(_0x298fdf,null));};exports[_0xd316('0x7c')]=function(_0x51f427,_0x2536e1,_0x5b99d7){return db['Team'][_0xd316('0x72')]({'where':{'id':_0x51f427[_0xd316('0x48')]['id']}})[_0xd316('0x44')](function(_0x1df681){if(_0x1df681){if(!_0x51f427[_0xd316('0x4c')]['channel']||!utils['isValidChannel'](_0x51f427[_0xd316('0x4c')][_0xd316('0x73')])){throw new db[(_0xd316('0x59'))][(_0xd316('0x75'))](_0xd316('0x76'));}return _0x1df681[_0xd316('0x7d')+_[_0xd316('0x77')](_0x51f427['body'][_0xd316('0x73')][_0xd316('0x78')]())+_0xd316('0x7b')](_0x51f427['body'][_0xd316('0x7e')]);}return null;})[_0xd316('0x44')](handleEntityNotFound(_0x2536e1,null))[_0xd316('0x44')](respondWithStatusCode(_0x2536e1,null))[_0xd316('0x46')](handleError(_0x2536e1,null));};exports[_0xd316('0x7f')]=function(_0x555bce,_0x5d2f85,_0x296e43){return db[_0xd316('0x41')]['findOne']({'where':{'id':_0x555bce['params']['id']}})['then'](function(_0x1e1c9f){if(_0x1e1c9f){if(!_0x555bce[_0xd316('0x32')][_0xd316('0x73')]||!utils[_0xd316('0x74')](_0x555bce[_0xd316('0x32')][_0xd316('0x73')])){throw new db['Sequelize']['ValidationError'](_0xd316('0x76'));}return _0x1e1c9f[_0xd316('0x80')+_[_0xd316('0x77')](_0x555bce['query'][_0xd316('0x73')][_0xd316('0x78')]())+_0xd316('0x7b')](_0x555bce['query'][_0xd316('0x7e')]);}return null;})[_0xd316('0x44')](handleEntityNotFound(_0x5d2f85,null))['then'](respondWithStatusCode(_0x5d2f85,null))[_0xd316('0x46')](handleError(_0x5d2f85,null));};exports['addAgents']=function(_0x4ac1bd,_0x49672b){var _0x346f87=_[_0xd316('0x81')](_0x4ac1bd['body'][_0xd316('0x7e')])?_0x4ac1bd[_0xd316('0x4c')][_0xd316('0x7e')]:[_0x4ac1bd[_0xd316('0x4c')][_0xd316('0x7e')]];var _0x279db3=_0x4ac1bd[_0xd316('0x48')]['id'];return db[_0xd316('0x41')][_0xd316('0x4a')]({'where':{'id':_0x279db3}})[_0xd316('0x44')](handleEntityNotFound(_0x49672b,null))[_0xd316('0x44')](function(_0x2c6d4b){if(_0x2c6d4b){var _0x4c7e63=[_0xd316('0x82'),_0xd316('0x83'),_0xd316('0x84'),_0xd316('0x85'),'Fax',_0xd316('0x86'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x22941d){var _0x49e6e8=_[_0xd316('0x2d')](_0x4c7e63,function(_0x105b2d){var _0x2ac769={'attributes':['id',_0xd316('0x2a')]};if(_0x105b2d===_0xd316('0x82')){_0x2ac769[_0xd316('0x87')]={'attributes':['penalty']};}return _0x2c6d4b[_0xd316('0x4e')+_0x105b2d+_0xd316('0x7b')](_0x2ac769)[_0xd316('0x44')](function(_0x4123a5){var _0x375fe6=_[_0xd316('0x2d')](_0x4123a5,function(_0x462f5d){var _0x4638f3=_[_0xd316('0x2d')](_0x346f87,function(_0x1704dd){var _0x12c958={'where':{'UserId':_0x1704dd,[_0x105b2d+_0xd316('0x88')]:_0x462f5d['id']},'transaction':_0x22941d};if(_0x105b2d===_0xd316('0x82')){_0x12c958[_0xd316('0x16')]={'penalty':_0x462f5d['TeamVoiceQueue'][_0xd316('0x89')]};}return db[_0xd316('0x8a')+_0x105b2d+_0xd316('0x79')][_0xd316('0x8b')](_0x12c958)[_0xd316('0x44')](function(){socket[_0xd316('0x8c')](_0xd316('0x4d')+_0x105b2d+_0xd316('0x8d'),{'UserId':_0x1704dd,[_0x105b2d+'QueueId']:_0x462f5d['id']});if(_0x105b2d!==_0xd316('0x82')){return;}return db['User'][_0xd316('0x43')]({'where':{'id':_0x346f87,'online':0x1},'attributes':['id',_0xd316('0x2a'),_0xd316('0x8e'),_0xd316('0x8f'),_0xd316('0x90')],'raw':!![]})[_0xd316('0x44')](function(_0x2766b7){var _0x136aeb=_['map'](_0x2766b7,function(_0x59bd68){return db[_0xd316('0x91')][_0xd316('0x92')]({'membername':_0x59bd68[_0xd316('0x2a')],'UserId':_0x59bd68['id'],'queue_name':_0x462f5d[_0xd316('0x2a')],'VoiceQueueId':_0x462f5d['id'],'interface':_[_0xd316('0x93')](_0x59bd68[_0xd316('0x90')])?util['format'](_0xd316('0x94'),_0x59bd68['name']):_0x59bd68[_0xd316('0x90')],'paused':_0x59bd68[_0xd316('0x8f')]||![],'penalty':_0x462f5d[_0xd316('0x95')]['penalty']},{'transaction':_0x22941d});});return Promise['all'](_0x136aeb);});});});return Promise[_0xd316('0x96')](_0x4638f3);});return Promise[_0xd316('0x96')](_0x375fe6);})[_0xd316('0x44')](function(){return db[_0xd316('0x6f')][_0xd316('0x72')]({'where':{'teamId':_0x279db3}})[_0xd316('0x44')](function(_0x4e00e1){if(_0x4e00e1){var _0x31a4d6=_[_0xd316('0x2d')](_0x346f87,function(_0x514344){db[_0xd316('0x70')][_0xd316('0x92')]({'UserId':_0x514344,'VoicePrefixId':_0x4e00e1[_0xd316('0x97')]});});return Promise[_0xd316('0x96')](_0x31a4d6);}});});});return Promise[_0xd316('0x96')](_0x49e6e8)['then'](function(){return _0x2c6d4b[_0xd316('0x98')](_0x346f87,{'transaction':_0x22941d})['spread'](function(_0x21df13){return _0x21df13;});});});}})[_0xd316('0x44')](respondWithResult(_0x49672b,null))[_0xd316('0x46')](handleError(_0x49672b,null));};exports['removeAgents']=function(_0x5bbcbd,_0x471bc9){var _0x5f5c83=_[_0xd316('0x81')](_0x5bbcbd[_0xd316('0x32')][_0xd316('0x7e')])?_0x5bbcbd[_0xd316('0x32')][_0xd316('0x7e')]:[_0x5bbcbd[_0xd316('0x32')][_0xd316('0x7e')]];var _0x3497b9=_0x5bbcbd[_0xd316('0x48')]['id'];return db[_0xd316('0x41')][_0xd316('0x4a')]({'where':{'id':_0x3497b9}})[_0xd316('0x44')](handleEntityNotFound(_0x471bc9,null))[_0xd316('0x44')](function(_0x858878){if(_0x858878){var _0x1c5c9e=[_0xd316('0x82'),_0xd316('0x83'),'Mail','Sms',_0xd316('0x99'),_0xd316('0x86'),_0xd316('0x9a')];return db[_0xd316('0x58')][_0xd316('0x56')](function(_0x4231bd){var _0xf97bc9=_['map'](_0x1c5c9e,function(_0x28b853){var _0x4bb355={'attributes':['id',_0xd316('0x2a')]};return _0x858878[_0xd316('0x4e')+_0x28b853+_0xd316('0x7b')](_0x4bb355)['then'](function(_0xdb795c){var _0x17f780=_[_0xd316('0x2d')](_0xdb795c,function(_0x50f411){return _0x50f411[_0xd316('0x9b')](_0x5f5c83,{'transaction':_0x4231bd})['then'](function(){var _0x5b0976=_[_0xd316('0x2d')](_0x5f5c83,function(_0x1a5bf1){socket[_0xd316('0x8c')](_0xd316('0x4d')+_0x28b853+'Queue:remove',{'UserId':Number(_0x1a5bf1),[_0x28b853+'QueueId']:_0x50f411['id']});if(_0x28b853!==_0xd316('0x82')){return;}return db[_0xd316('0x91')][_0xd316('0x55')]({'where':{'VoiceQueueId':_0x50f411['id'],'UserId':_0x1a5bf1},'transaction':_0x4231bd});});return Promise['all'](_0x5b0976);});});return Promise[_0xd316('0x96')](_0x17f780);});});return Promise[_0xd316('0x96')](_0xf97bc9)[_0xd316('0x44')](function(){return _0x858878[_0xd316('0x9b')](_0x5f5c83,{'transaction':_0x4231bd});})[_0xd316('0x44')](function(){return db[_0xd316('0x6f')][_0xd316('0x72')]({'where':{'teamId':_0x3497b9}})[_0xd316('0x44')](function(_0x523e54){if(_0x523e54){var _0x418d6f=_[_0xd316('0x2d')](_0x5f5c83,function(_0x130a69){db['UserVoicePrefix'][_0xd316('0x55')]({'where':{'UserId':_0x130a69,'VoicePrefixId':_0x523e54[_0xd316('0x97')]}});});return Promise[_0xd316('0x96')](_0x418d6f);}});});});}})[_0xd316('0x44')](respondWithStatusCode(_0x471bc9,null))[_0xd316('0x46')](handleError(_0x471bc9,null));};exports['getAgents']=function(_0x2b462e,_0xf1145b,_0x4538a7){var _0x9c6a22={};var _0x2589d4={};var _0x2c4322;var _0x3774e2;return db[_0xd316('0x41')]['findOne']({'where':{'id':_0x2b462e[_0xd316('0x48')]['id']}})[_0xd316('0x44')](handleEntityNotFound(_0xf1145b,null))['then'](function(_0x3464f6){if(_0x3464f6){_0x2c4322=_0x3464f6;_0x2589d4[_0xd316('0x30')]=_[_0xd316('0x31')](db[_0xd316('0x8a')][_0xd316('0x2e')]);_0x2589d4[_0xd316('0x32')]=_['keys'](_0x2b462e[_0xd316('0x32')]);_0x2589d4[_0xd316('0x3c')]=_[_0xd316('0x33')](_0x2589d4[_0xd316('0x30')],_0x2589d4[_0xd316('0x32')]);_0x9c6a22[_0xd316('0x34')]=_['intersection'](_0x2589d4[_0xd316('0x30')],qs[_0xd316('0x35')](_0x2b462e[_0xd316('0x32')][_0xd316('0x35')]));_0x9c6a22[_0xd316('0x34')]=_0x9c6a22['attributes'][_0xd316('0x36')]?_0x9c6a22[_0xd316('0x34')]:_0x2589d4[_0xd316('0x30')];_0x9c6a22[_0xd316('0x39')]=qs[_0xd316('0x3a')](_0x2b462e[_0xd316('0x32')][_0xd316('0x3a')]);_0x9c6a22['where']=qs['filters'](_[_0xd316('0x7a')](_0x2b462e[_0xd316('0x32')],_0x2589d4[_0xd316('0x3c')]));if(_0x2b462e[_0xd316('0x32')]['filter']){_0x9c6a22[_0xd316('0x3b')]=_[_0xd316('0x3d')](_0x9c6a22['where'],{'$or':_['map'](_0x9c6a22[_0xd316('0x34')],function(_0xc84ed6){var _0x17598c={};_0x17598c[_0xc84ed6]={'$like':'%'+_0x2b462e[_0xd316('0x32')][_0xd316('0x3f')]+'%'};return _0x17598c;})});}_0x9c6a22=_[_0xd316('0x3d')]({},_0x9c6a22,_0x2b462e[_0xd316('0x40')]);return _0x2c4322[_0xd316('0x9c')](_0x9c6a22);}})[_0xd316('0x44')](function(_0x55221c){if(_0x55221c){_0x3774e2=_0x55221c[_0xd316('0x36')];if(!_0x2b462e[_0xd316('0x32')]['hasOwnProperty'](_0xd316('0x38'))){_0x9c6a22[_0xd316('0x20')]=qs[_0xd316('0x20')](_0x2b462e[_0xd316('0x32')][_0xd316('0x20')]);_0x9c6a22['offset']=qs[_0xd316('0x22')](_0x2b462e[_0xd316('0x32')][_0xd316('0x22')]);}return _0x2c4322[_0xd316('0x9c')](_0x9c6a22);}})['then'](function(_0xc6f063){if(_0xc6f063){return _0xc6f063?{'count':_0x3774e2,'rows':_0xc6f063}:null;}})['then'](respondWithResult(_0xf1145b,null))[_0xd316('0x46')](handleError(_0xf1145b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0462c3c..5047c44 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 _0x02d1=['hook','events','../../mysqldb','Team','setMaxListeners','save','remove','emit'];(function(_0x85c64f,_0x54b56e){var _0x2ca230=function(_0x2e46e7){while(--_0x2e46e7){_0x85c64f['push'](_0x85c64f['shift']());}};_0x2ca230(++_0x54b56e);}(_0x02d1,0x1a9));var _0x102d=function(_0x24541e,_0x1e5c22){_0x24541e=_0x24541e-0x0;var _0x50a6ea=_0x02d1[_0x24541e];return _0x50a6ea;};'use strict';var EventEmitter=require(_0x102d('0x0'));var Team=require(_0x102d('0x1'))['db'][_0x102d('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x102d('0x3')](0x0);var events={'afterCreate':_0x102d('0x4'),'afterUpdate':'update','afterDestroy':_0x102d('0x5')};function emitEvent(_0x5ca666){return function(_0x3d66de,_0x50b794,_0x19c3bd){TeamEvents[_0x102d('0x6')](_0x5ca666+':'+_0x3d66de['id'],_0x3d66de);TeamEvents[_0x102d('0x6')](_0x5ca666,_0x3d66de);_0x19c3bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x102d('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xfd7d=['../../mysqldb','Team','save','remove','hook','events'];(function(_0x43f50b,_0x34b4b9){var _0x3119fb=function(_0x147168){while(--_0x147168){_0x43f50b['push'](_0x43f50b['shift']());}};_0x3119fb(++_0x34b4b9);}(_0xfd7d,0x71));var _0xdfd7=function(_0x20463f,_0x4cc37a){_0x20463f=_0x20463f-0x0;var _0x143ee4=_0xfd7d[_0x20463f];return _0x143ee4;};'use strict';var EventEmitter=require(_0xdfd7('0x0'));var Team=require(_0xdfd7('0x1'))['db'][_0xdfd7('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdfd7('0x3'),'afterUpdate':'update','afterDestroy':_0xdfd7('0x4')};function emitEvent(_0x2fd529){return function(_0x2b0eb5,_0x5975eb,_0x984899){TeamEvents['emit'](_0x2fd529+':'+_0x2b0eb5['id'],_0x2b0eb5);TeamEvents['emit'](_0x2fd529,_0x2b0eb5);_0x984899(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xdfd7('0x5')](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 93b02c7..9d5c312 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 _0x3d74=['request-promise','path','rimraf','./team.attributes','exports','define','Team','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5ac892,_0x128629){var _0x422f58=function(_0x156c0b){while(--_0x156c0b){_0x5ac892['push'](_0x5ac892['shift']());}};_0x422f58(++_0x128629);}(_0x3d74,0x187));var _0x43d7=function(_0x1ecfab,_0x28d406){_0x1ecfab=_0x1ecfab-0x0;var _0x1d10b9=_0x3d74[_0x1ecfab];return _0x1d10b9;};'use strict';var _=require(_0x43d7('0x0'));var util=require(_0x43d7('0x1'));var logger=require(_0x43d7('0x2'))('api');var moment=require(_0x43d7('0x3'));var BPromise=require(_0x43d7('0x4'));var rp=require(_0x43d7('0x5'));var fs=require('fs');var path=require(_0x43d7('0x6'));var rimraf=require(_0x43d7('0x7'));var config=require('../../config/environment');var attributes=require(_0x43d7('0x8'));module[_0x43d7('0x9')]=function(_0x36254d,_0x1bed0d){return _0x36254d[_0x43d7('0xa')](_0x43d7('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4a7=['path','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x48ca1e,_0xfd60e9){var _0x1f1b64=function(_0x1c8a81){while(--_0x1c8a81){_0x48ca1e['push'](_0x48ca1e['shift']());}};_0x1f1b64(++_0xfd60e9);}(_0xa4a7,0x1b6));var _0x7a4a=function(_0x22a297,_0x39a370){_0x22a297=_0x22a297-0x0;var _0x594577=_0xa4a7[_0x22a297];return _0x594577;};'use strict';var _=require(_0x7a4a('0x0'));var util=require(_0x7a4a('0x1'));var logger=require(_0x7a4a('0x2'))(_0x7a4a('0x3'));var moment=require('moment');var BPromise=require(_0x7a4a('0x4'));var rp=require(_0x7a4a('0x5'));var fs=require('fs');var path=require(_0x7a4a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7a4a('0x7'));module[_0x7a4a('0x8')]=function(_0x3a37cc,_0x21fe9f){return _0x3a37cc[_0x7a4a('0x9')](_0x7a4a('0xa'),attributes,{'tableName':_0x7a4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1730671..5619340 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 _0xec2e=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3ff4fd,_0x5735fc){var _0x339ed0=function(_0x3014c5){while(--_0x3014c5){_0x3ff4fd['push'](_0x3ff4fd['shift']());}};_0x339ed0(++_0x5735fc);}(_0xec2e,0x131));var _0xeec2=function(_0x11efc4,_0xb27f15){_0x11efc4=_0x11efc4-0x0;var _0x2a291f=_0xec2e[_0x11efc4];return _0x2a291f;};'use strict';var _=require(_0xeec2('0x0'));var util=require(_0xeec2('0x1'));var moment=require('moment');var BPromise=require(_0xeec2('0x2'));var rs=require(_0xeec2('0x3'));var fs=require('fs');var Redis=require(_0xeec2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeec2('0x5'));var logger=require(_0xeec2('0x6'))(_0xeec2('0x7'));var config=require(_0xeec2('0x8'));var jayson=require(_0xeec2('0x9'));var client=jayson[_0xeec2('0xa')]['http']({'port':0x232a});config['redis']=_[_0xeec2('0xb')](config[_0xeec2('0xc')],{'host':_0xeec2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeec2('0xc')]));require('./team.socket')[_0xeec2('0xe')](socket);function respondWithRpcPromise(_0x327147,_0x26eaa8,_0x1ab9cf){return new BPromise(function(_0x557b56,_0xbb4550){return client[_0xeec2('0xf')](_0x327147,_0x1ab9cf)[_0xeec2('0x10')](function(_0x351686){logger[_0xeec2('0x11')](_0xeec2('0x12'),_0x26eaa8,_0xeec2('0x13'));logger[_0xeec2('0x14')](_0xeec2('0x15'),_0x26eaa8,_0xeec2('0x13'),JSON[_0xeec2('0x16')](_0x351686));if(_0x351686[_0xeec2('0x17')]){if(_0x351686['error'][_0xeec2('0x18')]===0x1f4){logger[_0xeec2('0x17')](_0xeec2('0x12'),_0x26eaa8,_0x351686[_0xeec2('0x17')][_0xeec2('0x19')]);return _0xbb4550(_0x351686[_0xeec2('0x17')][_0xeec2('0x19')]);}logger['error']('Team,\x20%s,\x20%s',_0x26eaa8,_0x351686['error'][_0xeec2('0x19')]);return _0x557b56(_0x351686[_0xeec2('0x17')]['message']);}else{logger[_0xeec2('0x11')](_0xeec2('0x12'),_0x26eaa8,_0xeec2('0x13'));_0x557b56(_0x351686['result'][_0xeec2('0x19')]);}})['catch'](function(_0x51ca7d){logger[_0xeec2('0x17')]('Team,\x20%s,\x20%s',_0x26eaa8,_0x51ca7d);_0xbb4550(_0x51ca7d);});});} \ No newline at end of file +var _0xd92d=['info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','Team,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xd92d,0x12d));var _0xdd92=function(_0x26166b,_0x1d2fb6){_0x26166b=_0x26166b-0x0;var _0x470ac3=_0xd92d[_0x26166b];return _0x470ac3;};'use strict';var _=require('lodash');var util=require(_0xdd92('0x0'));var moment=require(_0xdd92('0x1'));var BPromise=require(_0xdd92('0x2'));var rs=require(_0xdd92('0x3'));var fs=require('fs');var Redis=require(_0xdd92('0x4'));var db=require(_0xdd92('0x5'))['db'];var utils=require(_0xdd92('0x6'));var logger=require(_0xdd92('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdd92('0x8'));var client=jayson[_0xdd92('0x9')][_0xdd92('0xa')]({'port':0x232a});config[_0xdd92('0xb')]=_[_0xdd92('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdd92('0xd'))(new Redis(config[_0xdd92('0xb')]));require('./team.socket')[_0xdd92('0xe')](socket);function respondWithRpcPromise(_0x58a542,_0x2d9e8b,_0x126752){return new BPromise(function(_0x4316e4,_0x46f159){return client[_0xdd92('0xf')](_0x58a542,_0x126752)[_0xdd92('0x10')](function(_0x1ab554){logger['info'](_0xdd92('0x11'),_0x2d9e8b,'request\x20sent');logger[_0xdd92('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x2d9e8b,'request\x20sent',JSON[_0xdd92('0x13')](_0x1ab554));if(_0x1ab554[_0xdd92('0x14')]){if(_0x1ab554[_0xdd92('0x14')][_0xdd92('0x15')]===0x1f4){logger[_0xdd92('0x14')](_0xdd92('0x11'),_0x2d9e8b,_0x1ab554[_0xdd92('0x14')][_0xdd92('0x16')]);return _0x46f159(_0x1ab554['error']['message']);}logger[_0xdd92('0x14')](_0xdd92('0x11'),_0x2d9e8b,_0x1ab554['error'][_0xdd92('0x16')]);return _0x4316e4(_0x1ab554['error'][_0xdd92('0x16')]);}else{logger[_0xdd92('0x17')]('Team,\x20%s,\x20%s',_0x2d9e8b,_0xdd92('0x18'));_0x4316e4(_0x1ab554[_0xdd92('0x19')]['message']);}})[_0xdd92('0x1a')](function(_0x58d5c3){logger[_0xdd92('0x14')]('Team,\x20%s,\x20%s',_0x2d9e8b,_0x58d5c3);_0x46f159(_0x58d5c3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f92d35f..43860e7 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 _0x00a4=['remove','update','register','length','team:','./team.events','save'];(function(_0x30584f,_0x4a1f96){var _0x2a31e1=function(_0x48af74){while(--_0x48af74){_0x30584f['push'](_0x30584f['shift']());}};_0x2a31e1(++_0x4a1f96);}(_0x00a4,0x186));var _0x400a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00a4[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0x400a('0x0'));var events=[_0x400a('0x1'),_0x400a('0x2'),_0x400a('0x3')];function createListener(_0x9fa510,_0x5497b9){return function(_0xad3e58){_0x5497b9['emit'](_0x9fa510,_0xad3e58);};}function removeListener(_0x2fb315,_0x2e4b08){return function(){TeamEvents['removeListener'](_0x2fb315,_0x2e4b08);};}exports[_0x400a('0x4')]=function(_0x4ebca3){for(var _0x480c80=0x0,_0x209c30=events[_0x400a('0x5')];_0x480c80<_0x209c30;_0x480c80++){var _0xbc350=events[_0x480c80];var _0x38772e=createListener(_0x400a('0x6')+_0xbc350,_0x4ebca3);TeamEvents['on'](_0xbc350,_0x38772e);}}; \ No newline at end of file +var _0xd5fe=['save','update','length','./team.events'];(function(_0x296994,_0xa61895){var _0x3241ca=function(_0xe0e1bf){while(--_0xe0e1bf){_0x296994['push'](_0x296994['shift']());}};_0x3241ca(++_0xa61895);}(_0xd5fe,0x1ab));var _0xed5f=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0xd5fe[_0x33a694];return _0x41ff01;};'use strict';var TeamEvents=require(_0xed5f('0x0'));var events=[_0xed5f('0x1'),'remove',_0xed5f('0x2')];function createListener(_0x4b2d3c,_0x1d5b5b){return function(_0x48623b){_0x1d5b5b['emit'](_0x4b2d3c,_0x48623b);};}function removeListener(_0x465679,_0x26ef12){return function(){TeamEvents['removeListener'](_0x465679,_0x26ef12);};}exports['register']=function(_0x467a03){for(var _0x20a6b9=0x0,_0x3a98a7=events[_0xed5f('0x3')];_0x20a6b9<_0x3a98a7;_0x20a6b9++){var _0x21f73a=events[_0x20a6b9];var _0x2c1ae3=createListener('team:'+_0x21f73a,_0x467a03);TeamEvents['on'](_0x21f73a,_0x2c1ae3);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 37db419..af03383 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f68=['exports','INTEGER'];(function(_0x3560c2,_0x3c08f4){var _0x3dc26b=function(_0x3610c0){while(--_0x3610c0){_0x3560c2['push'](_0x3560c2['shift']());}};_0x3dc26b(++_0x3c08f4);}(_0x2f68,0x9a));var _0x82f6=function(_0x4c9fc3,_0x27fb35){_0x4c9fc3=_0x4c9fc3-0x0;var _0x5a8e1d=_0x2f68[_0x4c9fc3];return _0x5a8e1d;};'use strict';var Sequelize=require('sequelize');module[_0x82f6('0x0')]={'TeamId':{'type':Sequelize[_0x82f6('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x82f6('0x1')]}}; \ No newline at end of file +var _0x97a2=['INTEGER','sequelize'];(function(_0xc0f3d0,_0x4cfe98){var _0x1798ba=function(_0xa3446d){while(--_0xa3446d){_0xc0f3d0['push'](_0xc0f3d0['shift']());}};_0x1798ba(++_0x4cfe98);}(_0x97a2,0x1b1));var _0x297a=function(_0x599f70,_0xfabb6c){_0x599f70=_0x599f70-0x0;var _0x5d52db=_0x97a2[_0x599f70];return _0x5d52db;};'use strict';var Sequelize=require(_0x297a('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x297a('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x297a('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 76d9406..bd987b2 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc901=['TeamVoicePrefix','team_has_voice_prefixes','lodash','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define'];(function(_0x4eed04,_0x310fe4){var _0x473c4f=function(_0x26d5d3){while(--_0x26d5d3){_0x4eed04['push'](_0x4eed04['shift']());}};_0x473c4f(++_0x310fe4);}(_0xc901,0x142));var _0x1c90=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc901[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c90('0x1'));var rp=require(_0x1c90('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c90('0x3'));var config=require(_0x1c90('0x4'));var attributes=require(_0x1c90('0x5'));module[_0x1c90('0x6')]=function(_0x1c9021,_0x14eb4f){return _0x1c9021[_0x1c90('0x7')](_0x1c90('0x8'),attributes,{'tableName':_0x1c90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf4c=['moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x3a03bc,_0x17630d){_0x3a03bc=_0x3a03bc-0x0;var _0x2068e6=_0xaf4c[_0x3a03bc];return _0x2068e6;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ba9c386..6f2ba76 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ec129,_0x2b64b1){var _0x51793f=function(_0x36612b){while(--_0x36612b){_0x4ec129['push'](_0x4ec129['shift']());}};_0x51793f(++_0x2b64b1);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x55be16,_0x3f04e5){var _0x2917ea=function(_0x26bfed){while(--_0x26bfed){_0x55be16['push'](_0x55be16['shift']());}};_0x2917ea(++_0x3f04e5);}(_0xe706,0xa3));var _0x6e70=function(_0x3116d6,_0x2d574f){_0x3116d6=_0x3116d6-0x0;var _0x18729d=_0xe706[_0x3116d6];return _0x18729d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 59ddcf7..831d070 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 _0x8c73=['exports'];(function(_0x2c87dc,_0x139292){var _0x2b78ec=function(_0x1bb48a){while(--_0x1bb48a){_0x2c87dc['push'](_0x2c87dc['shift']());}};_0x2b78ec(++_0x139292);}(_0x8c73,0x183));var _0x38c7=function(_0x57ac3b,_0x32e884){_0x57ac3b=_0x57ac3b-0x0;var _0x4204c9=_0x8c73[_0x57ac3b];return _0x4204c9;};'use strict';var Sequelize=require('sequelize');module[_0x38c7('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x43bd=['sequelize','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43bd,0x1dd));var _0xd43b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x43bd[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xd43b('0x0'));module[_0xd43b('0x1')]={'penalty':{'type':Sequelize[_0xd43b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 2572910..20893bd 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 _0xac21=['team_has_voice_queues','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','TeamVoiceQueue'];(function(_0x2bbb2d,_0x1601b4){var _0x1ceda9=function(_0xd4a0c8){while(--_0xd4a0c8){_0x2bbb2d['push'](_0x2bbb2d['shift']());}};_0x1ceda9(++_0x1601b4);}(_0xac21,0x1af));var _0x1ac2=function(_0x328e5c,_0x434353){_0x328e5c=_0x328e5c-0x0;var _0x4ffe18=_0xac21[_0x328e5c];return _0x4ffe18;};'use strict';var _=require('lodash');var util=require(_0x1ac2('0x0'));var logger=require(_0x1ac2('0x1'))('api');var moment=require(_0x1ac2('0x2'));var BPromise=require('bluebird');var rp=require(_0x1ac2('0x3'));var fs=require('fs');var path=require(_0x1ac2('0x4'));var rimraf=require('rimraf');var config=require(_0x1ac2('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0x1ac2('0x6')]=function(_0x21a183,_0x2c4cf2){return _0x21a183[_0x1ac2('0x7')](_0x1ac2('0x8'),attributes,{'tableName':_0x1ac2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x789eb1,_0x463a8d){var _0x2ddfc1=function(_0xac8c0){while(--_0xac8c0){_0x789eb1['push'](_0x789eb1['shift']());}};_0x2ddfc1(++_0x463a8d);}(_0xac31,0xca));var _0x1ac3=function(_0x92664b,_0x11fa7d){_0x92664b=_0x92664b-0x0;var _0x3a3570=_0xac31[_0x92664b];return _0x3a3570;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'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 2cff112..7a62df4 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 _0x48a9=['client','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b1b4d,_0x588687){var _0x3ed783=function(_0x1ad7b2){while(--_0x1ad7b2){_0x2b1b4d['push'](_0x2b1b4d['shift']());}};_0x3ed783(++_0x588687);}(_0x48a9,0x8a));var _0x948a=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0x48a9[_0xe6e78c];return _0x2a09c8;};'use strict';var _=require('lodash');var util=require(_0x948a('0x0'));var moment=require(_0x948a('0x1'));var BPromise=require(_0x948a('0x2'));var rs=require(_0x948a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x948a('0x4'));var logger=require(_0x948a('0x5'))(_0x948a('0x6'));var config=require(_0x948a('0x7'));var jayson=require(_0x948a('0x8'));var client=jayson[_0x948a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24e52c,_0x2a8b7f,_0x5f40a1){return new BPromise(function(_0x208ccf,_0x1f793c){return client[_0x948a('0xa')](_0x24e52c,_0x5f40a1)[_0x948a('0xb')](function(_0x49eb9c){logger['info'](_0x948a('0xc'),_0x2a8b7f,_0x948a('0xd'));logger[_0x948a('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2a8b7f,'request\x20sent',JSON[_0x948a('0xf')](_0x49eb9c));if(_0x49eb9c[_0x948a('0x10')]){if(_0x49eb9c[_0x948a('0x10')][_0x948a('0x11')]===0x1f4){logger[_0x948a('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2a8b7f,_0x49eb9c[_0x948a('0x10')][_0x948a('0x12')]);return _0x1f793c(_0x49eb9c[_0x948a('0x10')][_0x948a('0x12')]);}logger[_0x948a('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2a8b7f,_0x49eb9c[_0x948a('0x10')][_0x948a('0x12')]);return _0x208ccf(_0x49eb9c[_0x948a('0x10')][_0x948a('0x12')]);}else{logger[_0x948a('0x13')](_0x948a('0xc'),_0x2a8b7f,_0x948a('0xd'));_0x208ccf(_0x49eb9c['result'][_0x948a('0x12')]);}})[_0x948a('0x14')](function(_0x229bcb){logger[_0x948a('0x10')](_0x948a('0xc'),_0x2a8b7f,_0x229bcb);_0x1f793c(_0x229bcb);});});} \ No newline at end of file +var _0xbc47=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3beb8c,_0x546195){var _0x2ba821=function(_0x50fe6e){while(--_0x50fe6e){_0x3beb8c['push'](_0x3beb8c['shift']());}};_0x2ba821(++_0x546195);}(_0xbc47,0x7a));var _0x7bc4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xbc47[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x7bc4('0x0'));var util=require(_0x7bc4('0x1'));var moment=require(_0x7bc4('0x2'));var BPromise=require(_0x7bc4('0x3'));var rs=require(_0x7bc4('0x4'));var fs=require('fs');var Redis=require(_0x7bc4('0x5'));var db=require(_0x7bc4('0x6'))['db'];var utils=require(_0x7bc4('0x7'));var logger=require(_0x7bc4('0x8'))(_0x7bc4('0x9'));var config=require(_0x7bc4('0xa'));var jayson=require(_0x7bc4('0xb'));var client=jayson[_0x7bc4('0xc')][_0x7bc4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x44b112,_0xef6235,_0x2245e6){return new BPromise(function(_0x591cd8,_0x32e819){return client[_0x7bc4('0xe')](_0x44b112,_0x2245e6)[_0x7bc4('0xf')](function(_0x5bfcf6){logger[_0x7bc4('0x10')](_0x7bc4('0x11'),_0xef6235,_0x7bc4('0x12'));logger[_0x7bc4('0x13')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0xef6235,_0x7bc4('0x12'),JSON[_0x7bc4('0x14')](_0x5bfcf6));if(_0x5bfcf6[_0x7bc4('0x15')]){if(_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x16')]===0x1f4){logger[_0x7bc4('0x15')](_0x7bc4('0x11'),_0xef6235,_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x17')]);return _0x32e819(_0x5bfcf6[_0x7bc4('0x15')]['message']);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0xef6235,_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x17')]);return _0x591cd8(_0x5bfcf6['error'][_0x7bc4('0x17')]);}else{logger['info'](_0x7bc4('0x11'),_0xef6235,_0x7bc4('0x12'));_0x591cd8(_0x5bfcf6['result'][_0x7bc4('0x17')]);}})[_0x7bc4('0x18')](function(_0x8b66c6){logger[_0x7bc4('0x15')]('TeamVoiceQueue,\x20%s,\x20%s',_0xef6235,_0x8b66c6);_0x32e819(_0x8b66c6);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index faa5d27..c48c1a7 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 _0x78f4=['isAuthenticated','index','/:id','post','create','put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x1c9ce8,_0x5f4a9f){var _0x265023=function(_0x52b54d){while(--_0x52b54d){_0x1c9ce8['push'](_0x1c9ce8['shift']());}};_0x265023(++_0x5f4a9f);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x478f('0x0'));var path=require(_0x478f('0x1'));var timeout=require(_0x478f('0x2'));var express=require(_0x478f('0x3'));var router=express['Router']();var fs_extra=require(_0x478f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x478f('0x5'));var config=require(_0x478f('0x6'));var controller=require(_0x478f('0x7'));router['get']('/',auth[_0x478f('0x8')](),controller[_0x478f('0x9')]);router['get'](_0x478f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x478f('0xb')]('/',auth['isAuthenticated'](),controller[_0x478f('0xc')]);router[_0x478f('0xd')](_0x478f('0xa'),auth[_0x478f('0x8')](),controller['update']);router['delete'](_0x478f('0xa'),auth[_0x478f('0x8')](),controller[_0x478f('0xe')]);module[_0x478f('0xf')]=router; \ No newline at end of file +var _0xd916=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./template.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd916,0x18a));var _0x6d91=function(_0x10c1a8,_0x5062a0){_0x10c1a8=_0x10c1a8-0x0;var _0x54bd1a=_0xd916[_0x10c1a8];return _0x54bd1a;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var fs_extra=require(_0x6d91('0x5'));var auth=require(_0x6d91('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d91('0x7'));router[_0x6d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d91('0x9')]);router[_0x6d91('0x8')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0xc')]);router[_0x6d91('0xd')]('/',auth[_0x6d91('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6d91('0xe')]);router[_0x6d91('0xf')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index ec2f3e8..0d8be2a 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 _0x988d=['TEXT','sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x988d,0x8e));var _0xd988=function(_0x80196d,_0x552875){_0x80196d=_0x80196d-0x0;var _0x28e74e=_0x988d[_0x80196d];return _0x28e74e;};'use strict';var Sequelize=require(_0xd988('0x0'));module['exports']={'name':{'type':Sequelize[_0xd988('0x1')]},'description':{'type':Sequelize[_0xd988('0x1')]},'html':{'type':Sequelize[_0xd988('0x2')]}}; \ No newline at end of file +var _0x85dc=['TEXT','sequelize','exports','STRING'];(function(_0xc8cd07,_0x231d09){var _0x4f40d6=function(_0x3dbfbb){while(--_0x3dbfbb){_0xc8cd07['push'](_0xc8cd07['shift']());}};_0x4f40d6(++_0x231d09);}(_0x85dc,0x85));var _0xc85d=function(_0x4b3af5,_0x1d42eb){_0x4b3af5=_0x4b3af5-0x0;var _0x4dc5a7=_0x85dc[_0x4b3af5];return _0x4dc5a7;};'use strict';var Sequelize=require(_0xc85d('0x0'));module[_0xc85d('0x1')]={'name':{'type':Sequelize[_0xc85d('0x2')]},'description':{'type':Sequelize[_0xc85d('0x2')]},'html':{'type':Sequelize[_0xc85d('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6b92aa0..2285f68 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 _0x65c8=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','reject','save','update','then','get','destroy','end','sendStatus','error','stack','name','index','Template','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4b59c8,_0x368de0){var _0x3a1ef1=function(_0x2f4d3e){while(--_0x2f4d3e){_0x4b59c8['push'](_0x4b59c8['shift']());}};_0x3a1ef1(++_0x368de0);}(_0x65c8,0x1c4));var _0x865c=function(_0x59db5e,_0x2d271e){_0x59db5e=_0x59db5e-0x0;var _0x3c5c41=_0x65c8[_0x59db5e];return _0x3c5c41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x865c('0x0'));var zipdir=require(_0x865c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x865c('0x2'));var BPromise=require(_0x865c('0x3'));var Mustache=require(_0x865c('0x4'));var util=require(_0x865c('0x5'));var path=require('path');var sox=require(_0x865c('0x6'));var csv=require(_0x865c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x865c('0x8'));var _=require(_0x865c('0x9'));var squel=require(_0x865c('0xa'));var crypto=require(_0x865c('0xb'));var jsforce=require(_0x865c('0xc'));var deskjs=require(_0x865c('0xd'));var toCsv=require(_0x865c('0x7'));var querystring=require(_0x865c('0xe'));var Papa=require(_0x865c('0xf'));var Redis=require(_0x865c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x865c('0x11'));var as=require(_0x865c('0x12'));var hardwareService=require(_0x865c('0x13'));var logger=require(_0x865c('0x14'))('api');var utils=require(_0x865c('0x15'));var config=require(_0x865c('0x16'));var licenseUtil=require(_0x865c('0x17'));var db=require(_0x865c('0x18'))['db'];function respondWithStatusCode(_0x48f5d0,_0xe1d605){_0xe1d605=_0xe1d605||0xcc;return function(_0x112680){if(_0x112680){return _0x48f5d0['sendStatus'](_0xe1d605);}return _0x48f5d0[_0x865c('0x19')](_0xe1d605)['end']();};}function respondWithResult(_0x14588b,_0x2c2ca4){_0x2c2ca4=_0x2c2ca4||0xc8;return function(_0x8d52a){if(_0x8d52a){return _0x14588b[_0x865c('0x19')](_0x2c2ca4)['json'](_0x8d52a);}};}function respondWithFilteredResult(_0xfe5af6,_0xef1990){return function(_0x2e608a){if(_0x2e608a){var _0x158c82=typeof _0xef1990[_0x865c('0x1a')]==='undefined'&&typeof _0xef1990[_0x865c('0x1b')]===_0x865c('0x1c');var _0x1f0187=_0x2e608a['count'];var _0x5def0e=_0x158c82?0x0:_0xef1990['offset'];var _0x53b55e=_0x158c82?_0x2e608a[_0x865c('0x1d')]:_0xef1990[_0x865c('0x1a')]+_0xef1990[_0x865c('0x1b')];var _0x37b4b4;if(_0x53b55e>=_0x1f0187){_0x53b55e=_0x1f0187;_0x37b4b4=0xc8;}else{_0x37b4b4=0xce;}_0xfe5af6[_0x865c('0x19')](_0x37b4b4);return _0xfe5af6[_0x865c('0x1e')]('Content-Range',_0x5def0e+'-'+_0x53b55e+'/'+_0x1f0187)['json'](_0x2e608a);}return null;};}function patchUpdates(_0x529e01){return function(_0x998671){try{jsonpatch['apply'](_0x998671,_0x529e01,!![]);}catch(_0x253958){return BPromise[_0x865c('0x1f')](_0x253958);}return _0x998671[_0x865c('0x20')]();};}function saveUpdates(_0x11eb49,_0x926912){return function(_0x708faa){if(_0x708faa){return _0x708faa[_0x865c('0x21')](_0x11eb49)[_0x865c('0x22')](function(_0x370225){return _0x370225;});}return null;};}function removeEntity(_0x20c6f9,_0x3b9a1f){return function(_0x46cc0c){if(_0x46cc0c){return _0x46cc0c['destroy']()[_0x865c('0x22')](function(){var _0x26f2ec=_0x46cc0c[_0x865c('0x23')]({'plain':!![]});var _0x37950a='Templates';return db['UserProfileResource'][_0x865c('0x24')]({'where':{'type':_0x37950a,'resourceId':_0x26f2ec['id']}})[_0x865c('0x22')](function(){return _0x46cc0c;});})[_0x865c('0x22')](function(){_0x20c6f9[_0x865c('0x19')](0xcc)[_0x865c('0x25')]();});}};}function handleEntityNotFound(_0x1739a3,_0x9da1c6){return function(_0x46d7eb){if(!_0x46d7eb){_0x1739a3[_0x865c('0x26')](0x194);}return _0x46d7eb;};}function handleError(_0x869fd0,_0x312935){_0x312935=_0x312935||0x1f4;return function(_0x29dbe6){logger[_0x865c('0x27')](_0x29dbe6[_0x865c('0x28')]);if(_0x29dbe6[_0x865c('0x29')]){delete _0x29dbe6[_0x865c('0x29')];}_0x869fd0['status'](_0x312935)['send'](_0x29dbe6);};}exports[_0x865c('0x2a')]=function(_0x4e281c,_0x116682){var _0x321491={},_0x5bc163={},_0x1adec7={'count':0x0,'rows':[]};var _0x2923bd=_['map'](db[_0x865c('0x2b')][_0x865c('0x2c')],function(_0x3a0235){return{'name':_0x3a0235[_0x865c('0x2d')],'type':_0x3a0235[_0x865c('0x2e')][_0x865c('0x2f')]};});_0x5bc163[_0x865c('0x30')]=_[_0x865c('0x31')](_0x2923bd,_0x865c('0x29'));_0x5bc163[_0x865c('0x32')]=_['keys'](_0x4e281c[_0x865c('0x32')]);_0x5bc163[_0x865c('0x33')]=_[_0x865c('0x34')](_0x5bc163[_0x865c('0x30')],_0x5bc163[_0x865c('0x32')]);_0x321491[_0x865c('0x35')]=_[_0x865c('0x34')](_0x5bc163['model'],qs['fields'](_0x4e281c[_0x865c('0x32')][_0x865c('0x36')]));_0x321491[_0x865c('0x35')]=_0x321491[_0x865c('0x35')][_0x865c('0x37')]?_0x321491[_0x865c('0x35')]:_0x5bc163[_0x865c('0x30')];if(!_0x4e281c[_0x865c('0x32')][_0x865c('0x38')](_0x865c('0x39'))){_0x321491['limit']=qs[_0x865c('0x1b')](_0x4e281c[_0x865c('0x32')][_0x865c('0x1b')]);_0x321491['offset']=qs[_0x865c('0x1a')](_0x4e281c[_0x865c('0x32')][_0x865c('0x1a')]);}_0x321491[_0x865c('0x3a')]=qs[_0x865c('0x3b')](_0x4e281c[_0x865c('0x32')][_0x865c('0x3b')]);_0x321491[_0x865c('0x3c')]=qs['filters'](_[_0x865c('0x3d')](_0x4e281c[_0x865c('0x32')],_0x5bc163[_0x865c('0x33')]),_0x2923bd);if(_0x4e281c[_0x865c('0x32')][_0x865c('0x3e')]){_0x321491[_0x865c('0x3c')]=_[_0x865c('0x3f')](_0x321491[_0x865c('0x3c')],{'$or':_[_0x865c('0x31')](_0x2923bd,function(_0x276da9){if(_0x276da9['type']!==_0x865c('0x40')){var _0x4dffb3={};_0x4dffb3[_0x276da9[_0x865c('0x29')]]={'$like':'%'+_0x4e281c['query'][_0x865c('0x3e')]+'%'};return _0x4dffb3;}})});}_0x321491=_[_0x865c('0x3f')]({},_0x321491,_0x4e281c[_0x865c('0x41')]);var _0x53ed51={'where':_0x321491[_0x865c('0x3c')]};return db[_0x865c('0x2b')][_0x865c('0x1d')](_0x53ed51)[_0x865c('0x22')](function(_0x1b0f4e){_0x1adec7[_0x865c('0x1d')]=_0x1b0f4e;if(_0x4e281c[_0x865c('0x32')][_0x865c('0x42')]){_0x321491[_0x865c('0x43')]=[{'all':!![]}];}return db[_0x865c('0x2b')][_0x865c('0x44')](_0x321491);})[_0x865c('0x22')](function(_0x553a11){_0x1adec7[_0x865c('0x45')]=_0x553a11;return _0x1adec7;})[_0x865c('0x22')](respondWithFilteredResult(_0x116682,_0x321491))[_0x865c('0x46')](handleError(_0x116682,null));};exports[_0x865c('0x47')]=function(_0x501cb5,_0x46be64){var _0x54e73d={'raw':!![],'where':{'id':_0x501cb5[_0x865c('0x48')]['id']}},_0x42b932={};_0x42b932['model']=_[_0x865c('0x49')](db[_0x865c('0x2b')][_0x865c('0x2c')]);_0x42b932[_0x865c('0x32')]=_[_0x865c('0x49')](_0x501cb5[_0x865c('0x32')]);_0x42b932[_0x865c('0x33')]=_[_0x865c('0x34')](_0x42b932['model'],_0x42b932[_0x865c('0x32')]);_0x54e73d[_0x865c('0x35')]=_[_0x865c('0x34')](_0x42b932[_0x865c('0x30')],qs[_0x865c('0x36')](_0x501cb5['query'][_0x865c('0x36')]));_0x54e73d[_0x865c('0x35')]=_0x54e73d[_0x865c('0x35')][_0x865c('0x37')]?_0x54e73d['attributes']:_0x42b932['model'];if(_0x501cb5[_0x865c('0x32')][_0x865c('0x42')]){_0x54e73d['include']=[{'all':!![]}];}_0x54e73d=_[_0x865c('0x3f')]({},_0x54e73d,_0x501cb5[_0x865c('0x41')]);return db[_0x865c('0x2b')][_0x865c('0x4a')](_0x54e73d)[_0x865c('0x22')](handleEntityNotFound(_0x46be64,null))[_0x865c('0x22')](respondWithResult(_0x46be64,null))[_0x865c('0x46')](handleError(_0x46be64,null));};exports['create']=function(_0x131f65,_0x1469e2){return db[_0x865c('0x2b')][_0x865c('0x4b')](_0x131f65[_0x865c('0x4c')],{})[_0x865c('0x22')](function(_0x215d4c){var _0xaeb2df=_0x131f65[_0x865c('0x4d')]['get']({'plain':!![]});if(!_0xaeb2df)throw new Error(_0x865c('0x4e'));if(_0xaeb2df[_0x865c('0x4f')]===_0x865c('0x4d')){var _0x3ede02=_0x215d4c['get']({'plain':!![]});var _0x10a838=_0x865c('0x50');return db[_0x865c('0x51')][_0x865c('0x4a')]({'where':{'name':_0x10a838,'userProfileId':_0xaeb2df[_0x865c('0x52')]},'raw':!![]})[_0x865c('0x22')](function(_0x27c9cc){if(_0x27c9cc&&_0x27c9cc[_0x865c('0x53')]===0x0){return db[_0x865c('0x54')][_0x865c('0x4b')]({'name':_0x3ede02['name'],'resourceId':_0x3ede02['id'],'type':_0x27c9cc['name'],'sectionId':_0x27c9cc['id']},{})[_0x865c('0x22')](function(){return _0x215d4c;});}else{return _0x215d4c;}})[_0x865c('0x46')](function(_0x23e282){logger[_0x865c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23e282);throw _0x23e282;});}return _0x215d4c;})['then'](respondWithResult(_0x1469e2,0xc9))[_0x865c('0x46')](handleError(_0x1469e2,null));};exports[_0x865c('0x21')]=function(_0x11eb70,_0x161fd6){if(_0x11eb70[_0x865c('0x4c')]['id']){delete _0x11eb70['body']['id'];}return db[_0x865c('0x2b')]['find']({'where':{'id':_0x11eb70[_0x865c('0x48')]['id']}})[_0x865c('0x22')](handleEntityNotFound(_0x161fd6,null))[_0x865c('0x22')](saveUpdates(_0x11eb70[_0x865c('0x4c')],null))[_0x865c('0x22')](respondWithResult(_0x161fd6,null))[_0x865c('0x46')](handleError(_0x161fd6,null));};exports[_0x865c('0x24')]=function(_0xd105d5,_0x53386b){return db[_0x865c('0x2b')][_0x865c('0x4a')]({'where':{'id':_0xd105d5[_0x865c('0x48')]['id']}})['then'](handleEntityNotFound(_0x53386b,null))[_0x865c('0x22')](removeEntity(_0x53386b,null))['catch'](handleError(_0x53386b,null));}; \ No newline at end of file +var _0x072c=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','destroy','error','stack','name','send','index','Template','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','params','includeAll','find','create','body','user','role','Templates','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x7f8299,_0x3c5cfe){var _0x2edacc=function(_0x3abe75){while(--_0x3abe75){_0x7f8299['push'](_0x7f8299['shift']());}};_0x2edacc(++_0x3c5cfe);}(_0x072c,0x179));var _0xc072=function(_0x3144ba,_0x21608b){_0x3144ba=_0x3144ba-0x0;var _0x189350=_0x072c[_0x3144ba];return _0x189350;};'use strict';var emlformat=require(_0xc072('0x0'));var rimraf=require(_0xc072('0x1'));var zipdir=require(_0xc072('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc072('0x3'));var moment=require(_0xc072('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc072('0x5'));var util=require('util');var path=require(_0xc072('0x6'));var sox=require(_0xc072('0x7'));var csv=require(_0xc072('0x8'));var ejs=require(_0xc072('0x9'));var fs=require('fs');var fs_extra=require(_0xc072('0xa'));var _=require('lodash');var squel=require(_0xc072('0xb'));var crypto=require(_0xc072('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc072('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc072('0xe'));var Papa=require(_0xc072('0xf'));var Redis=require(_0xc072('0x10'));var authService=require(_0xc072('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc072('0x12'));var logger=require(_0xc072('0x13'))('api');var utils=require(_0xc072('0x14'));var config=require(_0xc072('0x15'));var licenseUtil=require(_0xc072('0x16'));var db=require(_0xc072('0x17'))['db'];function respondWithStatusCode(_0x30e8dd,_0x5dac84){_0x5dac84=_0x5dac84||0xcc;return function(_0x3e5faa){if(_0x3e5faa){return _0x30e8dd[_0xc072('0x18')](_0x5dac84);}return _0x30e8dd[_0xc072('0x19')](_0x5dac84)[_0xc072('0x1a')]();};}function respondWithResult(_0x21c7ca,_0x23ca8e){_0x23ca8e=_0x23ca8e||0xc8;return function(_0x3f51a8){if(_0x3f51a8){return _0x21c7ca[_0xc072('0x19')](_0x23ca8e)[_0xc072('0x1b')](_0x3f51a8);}};}function respondWithFilteredResult(_0x7865e7,_0x27edc7){return function(_0x20f737){if(_0x20f737){var _0x5c7604=typeof _0x27edc7[_0xc072('0x1c')]===_0xc072('0x1d')&&typeof _0x27edc7[_0xc072('0x1e')]===_0xc072('0x1d');var _0x348965=_0x20f737[_0xc072('0x1f')];var _0x15fb99=_0x5c7604?0x0:_0x27edc7[_0xc072('0x1c')];var _0x392923=_0x5c7604?_0x20f737[_0xc072('0x1f')]:_0x27edc7['offset']+_0x27edc7[_0xc072('0x1e')];var _0x3c1e0f;if(_0x392923>=_0x348965){_0x392923=_0x348965;_0x3c1e0f=0xc8;}else{_0x3c1e0f=0xce;}_0x7865e7[_0xc072('0x19')](_0x3c1e0f);return _0x7865e7[_0xc072('0x20')](_0xc072('0x21'),_0x15fb99+'-'+_0x392923+'/'+_0x348965)[_0xc072('0x1b')](_0x20f737);}return null;};}function patchUpdates(_0x237788){return function(_0x3c48eb){try{jsonpatch[_0xc072('0x22')](_0x3c48eb,_0x237788,!![]);}catch(_0x601fbb){return BPromise[_0xc072('0x23')](_0x601fbb);}return _0x3c48eb[_0xc072('0x24')]();};}function saveUpdates(_0x5c5e53,_0x5f47ff){return function(_0x5b813d){if(_0x5b813d){return _0x5b813d[_0xc072('0x25')](_0x5c5e53)[_0xc072('0x26')](function(_0x23432f){return _0x23432f;});}return null;};}function removeEntity(_0x4007c2,_0x33047d){return function(_0x20a644){if(_0x20a644){return _0x20a644['destroy']()[_0xc072('0x26')](function(){var _0x424d64=_0x20a644[_0xc072('0x27')]({'plain':!![]});var _0x2ca628='Templates';return db['UserProfileResource'][_0xc072('0x28')]({'where':{'type':_0x2ca628,'resourceId':_0x424d64['id']}})[_0xc072('0x26')](function(){return _0x20a644;});})[_0xc072('0x26')](function(){_0x4007c2['status'](0xcc)[_0xc072('0x1a')]();});}};}function handleEntityNotFound(_0x2e9e53,_0x550248){return function(_0x2c034e){if(!_0x2c034e){_0x2e9e53['sendStatus'](0x194);}return _0x2c034e;};}function handleError(_0x45187f,_0x1f8cd1){_0x1f8cd1=_0x1f8cd1||0x1f4;return function(_0x54b5e1){logger[_0xc072('0x29')](_0x54b5e1[_0xc072('0x2a')]);if(_0x54b5e1[_0xc072('0x2b')]){delete _0x54b5e1[_0xc072('0x2b')];}_0x45187f[_0xc072('0x19')](_0x1f8cd1)[_0xc072('0x2c')](_0x54b5e1);};}exports[_0xc072('0x2d')]=function(_0x54ab84,_0x57e44e){var _0x77c463={},_0x156268={},_0x327ff0={'count':0x0,'rows':[]};var _0x5b5319=_['map'](db[_0xc072('0x2e')][_0xc072('0x2f')],function(_0x1db5b7){return{'name':_0x1db5b7['fieldName'],'type':_0x1db5b7['type'][_0xc072('0x30')]};});_0x156268[_0xc072('0x31')]=_[_0xc072('0x32')](_0x5b5319,_0xc072('0x2b'));_0x156268[_0xc072('0x33')]=_[_0xc072('0x34')](_0x54ab84[_0xc072('0x33')]);_0x156268[_0xc072('0x35')]=_[_0xc072('0x36')](_0x156268[_0xc072('0x31')],_0x156268['query']);_0x77c463[_0xc072('0x37')]=_['intersection'](_0x156268[_0xc072('0x31')],qs[_0xc072('0x38')](_0x54ab84[_0xc072('0x33')][_0xc072('0x38')]));_0x77c463[_0xc072('0x37')]=_0x77c463['attributes'][_0xc072('0x39')]?_0x77c463[_0xc072('0x37')]:_0x156268['model'];if(!_0x54ab84['query']['hasOwnProperty'](_0xc072('0x3a'))){_0x77c463[_0xc072('0x1e')]=qs['limit'](_0x54ab84[_0xc072('0x33')]['limit']);_0x77c463[_0xc072('0x1c')]=qs[_0xc072('0x1c')](_0x54ab84['query'][_0xc072('0x1c')]);}_0x77c463[_0xc072('0x3b')]=qs[_0xc072('0x3c')](_0x54ab84['query'][_0xc072('0x3c')]);_0x77c463[_0xc072('0x3d')]=qs[_0xc072('0x35')](_[_0xc072('0x3e')](_0x54ab84[_0xc072('0x33')],_0x156268[_0xc072('0x35')]),_0x5b5319);if(_0x54ab84[_0xc072('0x33')][_0xc072('0x3f')]){_0x77c463[_0xc072('0x3d')]=_[_0xc072('0x40')](_0x77c463['where'],{'$or':_[_0xc072('0x32')](_0x5b5319,function(_0x84f966){if(_0x84f966['type']!==_0xc072('0x41')){var _0xa75fa9={};_0xa75fa9[_0x84f966[_0xc072('0x2b')]]={'$like':'%'+_0x54ab84[_0xc072('0x33')][_0xc072('0x3f')]+'%'};return _0xa75fa9;}})});}_0x77c463=_[_0xc072('0x40')]({},_0x77c463,_0x54ab84[_0xc072('0x42')]);var _0x226fe6={'where':_0x77c463[_0xc072('0x3d')]};return db[_0xc072('0x2e')]['count'](_0x226fe6)[_0xc072('0x26')](function(_0x53c6db){_0x327ff0['count']=_0x53c6db;if(_0x54ab84[_0xc072('0x33')]['includeAll']){_0x77c463[_0xc072('0x43')]=[{'all':!![]}];}return db[_0xc072('0x2e')]['findAll'](_0x77c463);})['then'](function(_0x13a50d){_0x327ff0[_0xc072('0x44')]=_0x13a50d;return _0x327ff0;})['then'](respondWithFilteredResult(_0x57e44e,_0x77c463))['catch'](handleError(_0x57e44e,null));};exports['show']=function(_0x3378d0,_0x3af41e){var _0x52d75f={'raw':!![],'where':{'id':_0x3378d0[_0xc072('0x45')]['id']}},_0x17db61={};_0x17db61[_0xc072('0x31')]=_[_0xc072('0x34')](db['Template']['rawAttributes']);_0x17db61[_0xc072('0x33')]=_[_0xc072('0x34')](_0x3378d0[_0xc072('0x33')]);_0x17db61[_0xc072('0x35')]=_[_0xc072('0x36')](_0x17db61[_0xc072('0x31')],_0x17db61[_0xc072('0x33')]);_0x52d75f['attributes']=_[_0xc072('0x36')](_0x17db61[_0xc072('0x31')],qs['fields'](_0x3378d0['query'][_0xc072('0x38')]));_0x52d75f[_0xc072('0x37')]=_0x52d75f[_0xc072('0x37')][_0xc072('0x39')]?_0x52d75f['attributes']:_0x17db61[_0xc072('0x31')];if(_0x3378d0['query'][_0xc072('0x46')]){_0x52d75f[_0xc072('0x43')]=[{'all':!![]}];}_0x52d75f=_['merge']({},_0x52d75f,_0x3378d0[_0xc072('0x42')]);return db['Template'][_0xc072('0x47')](_0x52d75f)['then'](handleEntityNotFound(_0x3af41e,null))['then'](respondWithResult(_0x3af41e,null))['catch'](handleError(_0x3af41e,null));};exports[_0xc072('0x48')]=function(_0x185191,_0x18761d){return db[_0xc072('0x2e')][_0xc072('0x48')](_0x185191[_0xc072('0x49')],{})[_0xc072('0x26')](function(_0x1789b0){var _0x5091c2=_0x185191[_0xc072('0x4a')][_0xc072('0x27')]({'plain':!![]});if(!_0x5091c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5091c2[_0xc072('0x4b')]==='user'){var _0x21a3aa=_0x1789b0[_0xc072('0x27')]({'plain':!![]});var _0x17e289=_0xc072('0x4c');return db['UserProfileSection'][_0xc072('0x47')]({'where':{'name':_0x17e289,'userProfileId':_0x5091c2[_0xc072('0x4d')]},'raw':!![]})['then'](function(_0x166fa2){if(_0x166fa2&&_0x166fa2[_0xc072('0x4e')]===0x0){return db['UserProfileResource'][_0xc072('0x48')]({'name':_0x21a3aa[_0xc072('0x2b')],'resourceId':_0x21a3aa['id'],'type':_0x166fa2[_0xc072('0x2b')],'sectionId':_0x166fa2['id']},{})[_0xc072('0x26')](function(){return _0x1789b0;});}else{return _0x1789b0;}})['catch'](function(_0x3ee35f){logger[_0xc072('0x29')](_0xc072('0x4f'),_0x3ee35f);throw _0x3ee35f;});}return _0x1789b0;})[_0xc072('0x26')](respondWithResult(_0x18761d,0xc9))['catch'](handleError(_0x18761d,null));};exports[_0xc072('0x25')]=function(_0x561984,_0xd57364){if(_0x561984['body']['id']){delete _0x561984[_0xc072('0x49')]['id'];}return db[_0xc072('0x2e')][_0xc072('0x47')]({'where':{'id':_0x561984[_0xc072('0x45')]['id']}})['then'](handleEntityNotFound(_0xd57364,null))[_0xc072('0x26')](saveUpdates(_0x561984[_0xc072('0x49')],null))['then'](respondWithResult(_0xd57364,null))[_0xc072('0x50')](handleError(_0xd57364,null));};exports['destroy']=function(_0x1c1209,_0x150c50){return db['Template'][_0xc072('0x47')]({'where':{'id':_0x1c1209[_0xc072('0x45')]['id']}})[_0xc072('0x26')](handleEntityNotFound(_0x150c50,null))['then'](removeEntity(_0x150c50,null))['catch'](handleError(_0x150c50,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b583d55..1fa049b 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 _0x67de=['exports','define','Template','tools_templates','lodash','util','moment','bluebird','request-promise','path','rimraf','./template.attributes'];(function(_0x2b1854,_0x5b9509){var _0x5e5707=function(_0x94cce2){while(--_0x94cce2){_0x2b1854['push'](_0x2b1854['shift']());}};_0x5e5707(++_0x5b9509);}(_0x67de,0x16c));var _0xe67d=function(_0x4360db,_0x5626ec){_0x4360db=_0x4360db-0x0;var _0x4e8eec=_0x67de[_0x4360db];return _0x4e8eec;};'use strict';var _=require(_0xe67d('0x0'));var util=require(_0xe67d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe67d('0x2'));var BPromise=require(_0xe67d('0x3'));var rp=require(_0xe67d('0x4'));var fs=require('fs');var path=require(_0xe67d('0x5'));var rimraf=require(_0xe67d('0x6'));var config=require('../../config/environment');var attributes=require(_0xe67d('0x7'));module[_0xe67d('0x8')]=function(_0x15db86,_0x5e7e8d){return _0x15db86[_0xe67d('0x9')](_0xe67d('0xa'),attributes,{'tableName':_0xe67d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x916c=['lodash','api','bluebird','path','rimraf','../../config/environment','./template.attributes','define'];(function(_0x1b929f,_0x16d163){var _0x1f090b=function(_0x355f64){while(--_0x355f64){_0x1b929f['push'](_0x1b929f['shift']());}};_0x1f090b(++_0x16d163);}(_0x916c,0x198));var _0xc916=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x916c[_0x33975c];return _0x1c15ab;};'use strict';var _=require(_0xc916('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc916('0x1'));var moment=require('moment');var BPromise=require(_0xc916('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc916('0x3'));var rimraf=require(_0xc916('0x4'));var config=require(_0xc916('0x5'));var attributes=require(_0xc916('0x6'));module['exports']=function(_0x47f68e,_0xcca130){return _0x47f68e[_0xc916('0x7')]('Template',attributes,{'tableName':'tools_templates','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 787be61..aee04bc 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 _0x5a93=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','limit','map','include','model','attributes','then','lodash'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0x5a93,0x149));var _0x35a9=function(_0x2d076f,_0x3d855d){_0x2d076f=_0x2d076f-0x0;var _0xd76d02=_0x5a93[_0x2d076f];return _0xd76d02;};'use strict';var _=require(_0x35a9('0x0'));var util=require(_0x35a9('0x1'));var moment=require(_0x35a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x35a9('0x3'));var fs=require('fs');var Redis=require(_0x35a9('0x4'));var db=require(_0x35a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x35a9('0x6'))('rpc');var config=require(_0x35a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x35a9('0x8')][_0x35a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24e77f,_0xe97f5,_0x521c31){return new BPromise(function(_0x23a364,_0x34d9dd){return client[_0x35a9('0xa')](_0x24e77f,_0x521c31)['then'](function(_0x46958d){logger[_0x35a9('0xb')](_0x35a9('0xc'),_0xe97f5,'request\x20sent');logger[_0x35a9('0xd')](_0x35a9('0xe'),_0xe97f5,_0x35a9('0xf'),JSON[_0x35a9('0x10')](_0x46958d));if(_0x46958d[_0x35a9('0x11')]){if(_0x46958d[_0x35a9('0x11')][_0x35a9('0x12')]===0x1f4){logger[_0x35a9('0x11')](_0x35a9('0xc'),_0xe97f5,_0x46958d[_0x35a9('0x11')][_0x35a9('0x13')]);return _0x34d9dd(_0x46958d['error'][_0x35a9('0x13')]);}logger[_0x35a9('0x11')](_0x35a9('0xc'),_0xe97f5,_0x46958d[_0x35a9('0x11')]['message']);return _0x23a364(_0x46958d['error'][_0x35a9('0x13')]);}else{logger[_0x35a9('0xb')](_0x35a9('0xc'),_0xe97f5,'request\x20sent');_0x23a364(_0x46958d[_0x35a9('0x14')][_0x35a9('0x13')]);}})[_0x35a9('0x15')](function(_0xa5d4be){logger[_0x35a9('0x11')](_0x35a9('0xc'),_0xe97f5,_0xa5d4be);_0x34d9dd(_0xa5d4be);});});}exports[_0x35a9('0x16')]=function(_0x1fe6a5){var _0x4a73a4=this;return new Promise(function(_0x5b49f3,_0x339d74){return db[_0x35a9('0x17')][_0x35a9('0x18')]({'raw':_0x1fe6a5[_0x35a9('0x19')]?_0x1fe6a5[_0x35a9('0x19')][_0x35a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fe6a5[_0x35a9('0x19')]?_0x1fe6a5[_0x35a9('0x19')]['where']||null:null,'attributes':_0x1fe6a5[_0x35a9('0x19')]?_0x1fe6a5[_0x35a9('0x19')]['attributes']||null:null,'limit':_0x1fe6a5['options']?_0x1fe6a5[_0x35a9('0x19')][_0x35a9('0x1b')]||null:null,'include':_0x1fe6a5[_0x35a9('0x19')]?_0x1fe6a5['options']['include']?_[_0x35a9('0x1c')](_0x1fe6a5[_0x35a9('0x19')][_0x35a9('0x1d')],function(_0x33673a){return{'model':db[_0x33673a[_0x35a9('0x1e')]],'as':_0x33673a['as'],'attributes':_0x33673a['attributes'],'include':_0x33673a['include']?_['map'](_0x33673a['include'],function(_0x571124){return{'model':db[_0x571124[_0x35a9('0x1e')]],'as':_0x571124['as'],'attributes':_0x571124[_0x35a9('0x1f')],'include':_0x571124[_0x35a9('0x1d')]?_[_0x35a9('0x1c')](_0x571124[_0x35a9('0x1d')],function(_0x369fe9){return{'model':db[_0x369fe9['model']],'as':_0x369fe9['as'],'attributes':_0x369fe9[_0x35a9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x35a9('0x20')](function(_0x611cb4){logger[_0x35a9('0xb')](_0x35a9('0x16'),_0x1fe6a5);logger['debug'](_0x35a9('0x16'),_0x1fe6a5,JSON[_0x35a9('0x10')](_0x611cb4));_0x5b49f3(_0x611cb4);})[_0x35a9('0x15')](function(_0x3cfa8b){logger[_0x35a9('0x11')](_0x35a9('0x16'),_0x3cfa8b['message'],_0x1fe6a5);_0x339d74(_0x4a73a4[_0x35a9('0x11')](0x1f4,_0x3cfa8b[_0x35a9('0x13')]));});});}; \ No newline at end of file +var _0x4759=['info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1b3b2d,_0xb140a9){var _0x5a0034=function(_0x55e367){while(--_0x55e367){_0x1b3b2d['push'](_0x1b3b2d['shift']());}};_0x5a0034(++_0xb140a9);}(_0x4759,0x13c));var _0x9475=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x4759[_0x26bcec];return _0x1049dc;};'use strict';var _=require(_0x9475('0x0'));var util=require(_0x9475('0x1'));var moment=require(_0x9475('0x2'));var BPromise=require(_0x9475('0x3'));var rs=require(_0x9475('0x4'));var fs=require('fs');var Redis=require(_0x9475('0x5'));var db=require(_0x9475('0x6'))['db'];var utils=require(_0x9475('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9475('0x8'));var jayson=require(_0x9475('0x9'));var client=jayson[_0x9475('0xa')][_0x9475('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a771b,_0x370c85,_0x243398){return new BPromise(function(_0x931a7b,_0x251720){return client[_0x9475('0xc')](_0x5a771b,_0x243398)[_0x9475('0xd')](function(_0x58986d){logger[_0x9475('0xe')](_0x9475('0xf'),_0x370c85,_0x9475('0x10'));logger[_0x9475('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x370c85,_0x9475('0x10'),JSON[_0x9475('0x12')](_0x58986d));if(_0x58986d['error']){if(_0x58986d['error'][_0x9475('0x13')]===0x1f4){logger[_0x9475('0x14')](_0x9475('0xf'),_0x370c85,_0x58986d[_0x9475('0x14')][_0x9475('0x15')]);return _0x251720(_0x58986d[_0x9475('0x14')][_0x9475('0x15')]);}logger['error'](_0x9475('0xf'),_0x370c85,_0x58986d[_0x9475('0x14')][_0x9475('0x15')]);return _0x931a7b(_0x58986d['error'][_0x9475('0x15')]);}else{logger[_0x9475('0xe')](_0x9475('0xf'),_0x370c85,_0x9475('0x10'));_0x931a7b(_0x58986d[_0x9475('0x16')][_0x9475('0x15')]);}})[_0x9475('0x17')](function(_0x15ae1c){logger[_0x9475('0x14')]('Template,\x20%s,\x20%s',_0x370c85,_0x15ae1c);_0x251720(_0x15ae1c);});});}exports[_0x9475('0x18')]=function(_0x4dbb1c){var _0x55e971=this;return new Promise(function(_0x1f56b1,_0x5e273e){return db[_0x9475('0x19')][_0x9475('0x1a')]({'raw':_0x4dbb1c[_0x9475('0x1b')]?_0x4dbb1c[_0x9475('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4dbb1c[_0x9475('0x1b')]?_0x4dbb1c[_0x9475('0x1b')][_0x9475('0x1c')]||null:null,'attributes':_0x4dbb1c['options']?_0x4dbb1c[_0x9475('0x1b')][_0x9475('0x1d')]||null:null,'limit':_0x4dbb1c[_0x9475('0x1b')]?_0x4dbb1c[_0x9475('0x1b')]['limit']||null:null,'include':_0x4dbb1c[_0x9475('0x1b')]?_0x4dbb1c[_0x9475('0x1b')]['include']?_[_0x9475('0x1e')](_0x4dbb1c['options'][_0x9475('0x1f')],function(_0x3f7a74){return{'model':db[_0x3f7a74[_0x9475('0x20')]],'as':_0x3f7a74['as'],'attributes':_0x3f7a74[_0x9475('0x1d')],'include':_0x3f7a74[_0x9475('0x1f')]?_['map'](_0x3f7a74[_0x9475('0x1f')],function(_0x496200){return{'model':db[_0x496200[_0x9475('0x20')]],'as':_0x496200['as'],'attributes':_0x496200['attributes'],'include':_0x496200[_0x9475('0x1f')]?_[_0x9475('0x1e')](_0x496200[_0x9475('0x1f')],function(_0x97ed46){return{'model':db[_0x97ed46[_0x9475('0x20')]],'as':_0x97ed46['as'],'attributes':_0x97ed46[_0x9475('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9475('0xd')](function(_0x1147b8){logger[_0x9475('0xe')](_0x9475('0x18'),_0x4dbb1c);logger[_0x9475('0x11')]('GetTemplate',_0x4dbb1c,JSON[_0x9475('0x12')](_0x1147b8));_0x1f56b1(_0x1147b8);})[_0x9475('0x17')](function(_0x1e75d0){logger[_0x9475('0x14')]('GetTemplate',_0x1e75d0[_0x9475('0x15')],_0x4dbb1c);_0x5e273e(_0x55e971[_0x9475('0x14')](0x1f4,_0x1e75d0['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 4ef2a34..8c90af4 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 _0x45e2=['/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/any_conditions','getAnyConditions','post','create'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x45e2,0x1a0));var _0x245e=function(_0x2c6038,_0x34a92f){_0x2c6038=_0x2c6038-0x0;var _0x2d6429=_0x45e2[_0x2c6038];return _0x2d6429;};'use strict';var multer=require('multer');var util=require(_0x245e('0x0'));var path=require(_0x245e('0x1'));var timeout=require('connect-timeout');var express=require(_0x245e('0x2'));var router=express[_0x245e('0x3')]();var fs_extra=require(_0x245e('0x4'));var auth=require(_0x245e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x245e('0x6'));var controller=require('./trigger.controller');router[_0x245e('0x7')]('/',auth['isAuthenticated'](),controller[_0x245e('0x8')]);router[_0x245e('0x7')](_0x245e('0x9'),auth[_0x245e('0xa')](),controller[_0x245e('0xb')]);router[_0x245e('0x7')]('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router[_0x245e('0x7')](_0x245e('0xc'),auth[_0x245e('0xa')](),controller[_0x245e('0xd')]);router[_0x245e('0x7')]('/:id/actions',auth[_0x245e('0xa')](),controller['getActions']);router[_0x245e('0xe')]('/',auth[_0x245e('0xa')](),controller[_0x245e('0xf')]);router[_0x245e('0xe')](_0x245e('0x10'),auth[_0x245e('0xa')](),controller[_0x245e('0x11')]);router['post'](_0x245e('0xc'),auth[_0x245e('0xa')](),controller[_0x245e('0x12')]);router['post'](_0x245e('0x13'),auth[_0x245e('0xa')](),controller[_0x245e('0x14')]);router['put'](_0x245e('0x9'),auth[_0x245e('0xa')](),controller[_0x245e('0x15')]);router['delete'](_0x245e('0x9'),auth[_0x245e('0xa')](),controller[_0x245e('0x16')]);module[_0x245e('0x17')]=router; \ No newline at end of file +var _0x9256=['multer','express','../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','index','get','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAction','/:id','update','delete','exports'];(function(_0x3c54b9,_0xd31ada){var _0x1aa820=function(_0x5e3462){while(--_0x5e3462){_0x3c54b9['push'](_0x3c54b9['shift']());}};_0x1aa820(++_0xd31ada);}(_0x9256,0xa8));var _0x6925=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9256[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6925('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6925('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6925('0x2'));var interaction=require(_0x6925('0x3'));var config=require('../../config/environment');var controller=require(_0x6925('0x4'));router['get']('/',auth[_0x6925('0x5')](),controller[_0x6925('0x6')]);router['get']('/:id',auth[_0x6925('0x5')](),controller['show']);router[_0x6925('0x7')](_0x6925('0x8'),auth[_0x6925('0x5')](),controller[_0x6925('0x9')]);router[_0x6925('0x7')](_0x6925('0xa'),auth[_0x6925('0x5')](),controller[_0x6925('0xb')]);router['get'](_0x6925('0xc'),auth[_0x6925('0x5')](),controller[_0x6925('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6925('0xe')]);router[_0x6925('0xf')](_0x6925('0x8'),auth[_0x6925('0x5')](),controller['addAllCondition']);router[_0x6925('0xf')](_0x6925('0xa'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x6925('0xf')](_0x6925('0xc'),auth[_0x6925('0x5')](),controller[_0x6925('0x10')]);router['put'](_0x6925('0x11'),auth[_0x6925('0x5')](),controller[_0x6925('0x12')]);router[_0x6925('0x13')](_0x6925('0x11'),auth[_0x6925('0x5')](),controller['destroy']);module[_0x6925('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index f4c770b..ba89465 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 _0xd264=['exports','STRING','BOOLEAN'];(function(_0x3e62b8,_0x5afc38){var _0x34dcc7=function(_0x13f1ca){while(--_0x13f1ca){_0x3e62b8['push'](_0x3e62b8['shift']());}};_0x34dcc7(++_0x5afc38);}(_0xd264,0xdb));var _0x4d26=function(_0x2fe89e,_0x30517e){_0x2fe89e=_0x2fe89e-0x0;var _0x5d2648=_0xd264[_0x2fe89e];return _0x5d2648;};'use strict';var Sequelize=require('sequelize');module[_0x4d26('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4d26('0x1')]},'description':{'type':Sequelize[_0x4d26('0x1')]},'status':{'type':Sequelize[_0x4d26('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe4e1=['sequelize','STRING'];(function(_0x3eca5a,_0x20d490){var _0x15470e=function(_0x219cc6){while(--_0x219cc6){_0x3eca5a['push'](_0x3eca5a['shift']());}};_0x15470e(++_0x20d490);}(_0xe4e1,0xe8));var _0x1e4e=function(_0xc7f5ef,_0x4cc153){_0xc7f5ef=_0xc7f5ef-0x0;var _0x3b1099=_0xe4e1[_0xc7f5ef];return _0x3b1099;};'use strict';var Sequelize=require(_0x1e4e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1e4e('0x1')]},'description':{'type':Sequelize[_0x1e4e('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e8806c2..e4e2073 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 _0xfdd3=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','apply','reject','update','destroy','then','Triggers','sendStatus','error','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','catch','show','params','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId'];(function(_0x5d0004,_0x4bcb9a){var _0x4be732=function(_0x30e2f4){while(--_0x30e2f4){_0x5d0004['push'](_0x5d0004['shift']());}};_0x4be732(++_0x4bcb9a);}(_0xfdd3,0x1ef));var _0x3fdd=function(_0x1aa1c9,_0x4595e0){_0x1aa1c9=_0x1aa1c9-0x0;var _0x2f347d=_0xfdd3[_0x1aa1c9];return _0x2f347d;};'use strict';var emlformat=require(_0x3fdd('0x0'));var rimraf=require(_0x3fdd('0x1'));var zipdir=require(_0x3fdd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fdd('0x3'));var moment=require(_0x3fdd('0x4'));var BPromise=require(_0x3fdd('0x5'));var Mustache=require(_0x3fdd('0x6'));var util=require(_0x3fdd('0x7'));var path=require(_0x3fdd('0x8'));var sox=require('sox');var csv=require(_0x3fdd('0x9'));var ejs=require(_0x3fdd('0xa'));var fs=require('fs');var fs_extra=require(_0x3fdd('0xb'));var _=require(_0x3fdd('0xc'));var squel=require(_0x3fdd('0xd'));var crypto=require(_0x3fdd('0xe'));var jsforce=require(_0x3fdd('0xf'));var deskjs=require(_0x3fdd('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3fdd('0x11'));var Papa=require(_0x3fdd('0x12'));var Redis=require('ioredis');var authService=require(_0x3fdd('0x13'));var qs=require(_0x3fdd('0x14'));var as=require(_0x3fdd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fdd('0x16'))(_0x3fdd('0x17'));var utils=require(_0x3fdd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3fdd('0x19'));var db=require(_0x3fdd('0x1a'))['db'];function respondWithStatusCode(_0x443ac0,_0x169e25){_0x169e25=_0x169e25||0xcc;return function(_0x278b09){if(_0x278b09){return _0x443ac0['sendStatus'](_0x169e25);}return _0x443ac0['status'](_0x169e25)[_0x3fdd('0x1b')]();};}function respondWithResult(_0x3bd311,_0x1f7ffb){_0x1f7ffb=_0x1f7ffb||0xc8;return function(_0x473e09){if(_0x473e09){return _0x3bd311['status'](_0x1f7ffb)[_0x3fdd('0x1c')](_0x473e09);}};}function respondWithFilteredResult(_0x2d5e0,_0x3cec1c){return function(_0x3af9db){if(_0x3af9db){var _0x4071e0=typeof _0x3cec1c[_0x3fdd('0x1d')]==='undefined'&&typeof _0x3cec1c[_0x3fdd('0x1e')]==='undefined';var _0x115495=_0x3af9db[_0x3fdd('0x1f')];var _0x568c3f=_0x4071e0?0x0:_0x3cec1c[_0x3fdd('0x1d')];var _0x27922b=_0x4071e0?_0x3af9db[_0x3fdd('0x1f')]:_0x3cec1c['offset']+_0x3cec1c[_0x3fdd('0x1e')];var _0x16fab8;if(_0x27922b>=_0x115495){_0x27922b=_0x115495;_0x16fab8=0xc8;}else{_0x16fab8=0xce;}_0x2d5e0[_0x3fdd('0x20')](_0x16fab8);return _0x2d5e0['set']('Content-Range',_0x568c3f+'-'+_0x27922b+'/'+_0x115495)[_0x3fdd('0x1c')](_0x3af9db);}return null;};}function patchUpdates(_0x50caa0){return function(_0x5a41a7){try{jsonpatch[_0x3fdd('0x21')](_0x5a41a7,_0x50caa0,!![]);}catch(_0xf21ed6){return BPromise[_0x3fdd('0x22')](_0xf21ed6);}return _0x5a41a7['save']();};}function saveUpdates(_0x1be449,_0x10e9af){return function(_0x488c34){if(_0x488c34){return _0x488c34[_0x3fdd('0x23')](_0x1be449)['then'](function(_0x4a7da3){return _0x4a7da3;});}return null;};}function removeEntity(_0x30f678,_0xe36ba5){return function(_0x15d305){if(_0x15d305){return _0x15d305[_0x3fdd('0x24')]()[_0x3fdd('0x25')](function(){var _0x32edc6=_0x15d305['get']({'plain':!![]});var _0x3b35e5=_0x3fdd('0x26');return db['UserProfileResource'][_0x3fdd('0x24')]({'where':{'type':_0x3b35e5,'resourceId':_0x32edc6['id']}})[_0x3fdd('0x25')](function(){return _0x15d305;});})['then'](function(){_0x30f678[_0x3fdd('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea741,_0x197b93){return function(_0xd4e4de){if(!_0xd4e4de){_0x1ea741[_0x3fdd('0x27')](0x194);}return _0xd4e4de;};}function handleError(_0x66975a,_0x392da5){_0x392da5=_0x392da5||0x1f4;return function(_0xcd7f67){logger[_0x3fdd('0x28')](_0xcd7f67['stack']);if(_0xcd7f67['name']){delete _0xcd7f67[_0x3fdd('0x29')];}_0x66975a['status'](_0x392da5)[_0x3fdd('0x2a')](_0xcd7f67);};}exports[_0x3fdd('0x2b')]=function(_0x32b77c,_0x4e2c10){var _0x54fa97={},_0x7d62e0={},_0x39eb7f={'count':0x0,'rows':[]};var _0x1e6547=_['map'](db['Trigger'][_0x3fdd('0x2c')],function(_0x588475){return{'name':_0x588475[_0x3fdd('0x2d')],'type':_0x588475[_0x3fdd('0x2e')]['key']};});_0x7d62e0[_0x3fdd('0x2f')]=_[_0x3fdd('0x30')](_0x1e6547,_0x3fdd('0x29'));_0x7d62e0[_0x3fdd('0x31')]=_['keys'](_0x32b77c[_0x3fdd('0x31')]);_0x7d62e0[_0x3fdd('0x32')]=_[_0x3fdd('0x33')](_0x7d62e0[_0x3fdd('0x2f')],_0x7d62e0[_0x3fdd('0x31')]);_0x54fa97[_0x3fdd('0x34')]=_[_0x3fdd('0x33')](_0x7d62e0[_0x3fdd('0x2f')],qs['fields'](_0x32b77c[_0x3fdd('0x31')][_0x3fdd('0x35')]));_0x54fa97[_0x3fdd('0x34')]=_0x54fa97[_0x3fdd('0x34')][_0x3fdd('0x36')]?_0x54fa97['attributes']:_0x7d62e0[_0x3fdd('0x2f')];if(!_0x32b77c[_0x3fdd('0x31')]['hasOwnProperty'](_0x3fdd('0x37'))){_0x54fa97['limit']=qs[_0x3fdd('0x1e')](_0x32b77c[_0x3fdd('0x31')][_0x3fdd('0x1e')]);_0x54fa97[_0x3fdd('0x1d')]=qs['offset'](_0x32b77c[_0x3fdd('0x31')][_0x3fdd('0x1d')]);}_0x54fa97[_0x3fdd('0x38')]=qs[_0x3fdd('0x39')](_0x32b77c[_0x3fdd('0x31')][_0x3fdd('0x39')]);_0x54fa97[_0x3fdd('0x3a')]=qs['filters'](_[_0x3fdd('0x3b')](_0x32b77c[_0x3fdd('0x31')],_0x7d62e0['filters']),_0x1e6547);if(_0x32b77c['query'][_0x3fdd('0x3c')]){_0x54fa97[_0x3fdd('0x3a')]=_[_0x3fdd('0x3d')](_0x54fa97['where'],{'$or':_[_0x3fdd('0x30')](_0x1e6547,function(_0x94174c){if(_0x94174c['type']!==_0x3fdd('0x3e')){var _0x4356b5={};_0x4356b5[_0x94174c[_0x3fdd('0x29')]]={'$like':'%'+_0x32b77c[_0x3fdd('0x31')]['filter']+'%'};return _0x4356b5;}})});}_0x54fa97=_[_0x3fdd('0x3d')]({},_0x54fa97,_0x32b77c[_0x3fdd('0x3f')]);var _0x57e6b7={'where':_0x54fa97['where']};return db[_0x3fdd('0x40')]['count'](_0x57e6b7)[_0x3fdd('0x25')](function(_0x3b31a6){_0x39eb7f[_0x3fdd('0x1f')]=_0x3b31a6;if(_0x32b77c[_0x3fdd('0x31')][_0x3fdd('0x41')]){_0x54fa97[_0x3fdd('0x42')]=[{'all':!![]}];}return db[_0x3fdd('0x40')][_0x3fdd('0x43')](_0x54fa97);})[_0x3fdd('0x25')](function(_0x591ba7){_0x39eb7f['rows']=_0x591ba7;return _0x39eb7f;})[_0x3fdd('0x25')](respondWithFilteredResult(_0x4e2c10,_0x54fa97))[_0x3fdd('0x44')](handleError(_0x4e2c10,null));};exports[_0x3fdd('0x45')]=function(_0x332733,_0x344ee5){var _0x37962c={'raw':![],'where':{'id':_0x332733[_0x3fdd('0x46')]['id']}},_0x5843fb={};_0x5843fb['model']=_[_0x3fdd('0x47')](db['Trigger'][_0x3fdd('0x2c')]);_0x5843fb[_0x3fdd('0x31')]=_[_0x3fdd('0x47')](_0x332733[_0x3fdd('0x31')]);_0x5843fb[_0x3fdd('0x32')]=_[_0x3fdd('0x33')](_0x5843fb[_0x3fdd('0x2f')],_0x5843fb[_0x3fdd('0x31')]);_0x37962c[_0x3fdd('0x34')]=_[_0x3fdd('0x33')](_0x5843fb[_0x3fdd('0x2f')],qs['fields'](_0x332733[_0x3fdd('0x31')][_0x3fdd('0x35')]));_0x37962c['attributes']=_0x37962c[_0x3fdd('0x34')][_0x3fdd('0x36')]?_0x37962c[_0x3fdd('0x34')]:_0x5843fb[_0x3fdd('0x2f')];if(_0x332733[_0x3fdd('0x31')][_0x3fdd('0x41')]){_0x37962c[_0x3fdd('0x42')]=[{'all':!![]}];}_0x37962c=_['merge']({},_0x37962c,_0x332733[_0x3fdd('0x3f')]);return db[_0x3fdd('0x40')][_0x3fdd('0x48')](_0x37962c)[_0x3fdd('0x25')](handleEntityNotFound(_0x344ee5,null))[_0x3fdd('0x25')](respondWithResult(_0x344ee5,null))[_0x3fdd('0x44')](handleError(_0x344ee5,null));};exports['create']=function(_0x5a793b,_0x24bd83){return db['Trigger'][_0x3fdd('0x49')](_0x5a793b[_0x3fdd('0x4a')],{})[_0x3fdd('0x25')](function(_0x3dfb90){var _0x1ef4f4=_0x5a793b['user'][_0x3fdd('0x4b')]({'plain':!![]});if(!_0x1ef4f4)throw new Error(_0x3fdd('0x4c'));if(_0x1ef4f4[_0x3fdd('0x4d')]===_0x3fdd('0x4e')){var _0xeeebca=_0x3dfb90[_0x3fdd('0x4b')]({'plain':!![]});var _0x10631a='Triggers';return db[_0x3fdd('0x4f')][_0x3fdd('0x48')]({'where':{'name':_0x10631a,'userProfileId':_0x1ef4f4[_0x3fdd('0x50')]},'raw':!![]})[_0x3fdd('0x25')](function(_0x4cf4f2){if(_0x4cf4f2&&_0x4cf4f2[_0x3fdd('0x51')]===0x0){return db[_0x3fdd('0x52')][_0x3fdd('0x49')]({'name':_0xeeebca[_0x3fdd('0x29')],'resourceId':_0xeeebca['id'],'type':_0x4cf4f2[_0x3fdd('0x29')],'sectionId':_0x4cf4f2['id']},{})['then'](function(){return _0x3dfb90;});}else{return _0x3dfb90;}})[_0x3fdd('0x44')](function(_0x41ac2d){logger[_0x3fdd('0x28')](_0x3fdd('0x53'),_0x41ac2d);throw _0x41ac2d;});}return _0x3dfb90;})['then'](respondWithResult(_0x24bd83,0xc9))['catch'](handleError(_0x24bd83,null));};exports[_0x3fdd('0x23')]=function(_0x50695a,_0x24ee91){if(_0x50695a[_0x3fdd('0x4a')]['id']){delete _0x50695a[_0x3fdd('0x4a')]['id'];}return db[_0x3fdd('0x40')][_0x3fdd('0x48')]({'where':{'id':_0x50695a[_0x3fdd('0x46')]['id']}})[_0x3fdd('0x25')](handleEntityNotFound(_0x24ee91,null))[_0x3fdd('0x25')](saveUpdates(_0x50695a['body'],null))[_0x3fdd('0x25')](respondWithResult(_0x24ee91,null))[_0x3fdd('0x44')](handleError(_0x24ee91,null));};exports['destroy']=function(_0x478422,_0x3b7257){return db[_0x3fdd('0x40')][_0x3fdd('0x48')]({'where':{'id':_0x478422[_0x3fdd('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b7257,null))[_0x3fdd('0x25')](removeEntity(_0x3b7257,null))[_0x3fdd('0x44')](handleError(_0x3b7257,null));};exports['addAllCondition']=function(_0x56ee1c,_0x41b2c6,_0xfcb351){if(_0x56ee1c[_0x3fdd('0x4a')]['id']){delete _0x56ee1c[_0x3fdd('0x4a')]['id'];}return db[_0x3fdd('0x40')][_0x3fdd('0x48')]({'where':{'id':_0x56ee1c[_0x3fdd('0x46')]['id']}})[_0x3fdd('0x25')](handleEntityNotFound(_0x41b2c6,null))[_0x3fdd('0x25')](function(_0x27791b){if(_0x27791b){_0x56ee1c[_0x3fdd('0x4a')][_0x3fdd('0x54')]=_0x27791b['id'];return db[_0x3fdd('0x55')][_0x3fdd('0x49')](_0x56ee1c[_0x3fdd('0x4a')]);}})['then'](respondWithResult(_0x41b2c6,null))[_0x3fdd('0x44')](handleError(_0x41b2c6,null));};exports[_0x3fdd('0x56')]=function(_0x9235bd,_0x5295ed,_0x2583b8){if(_0x9235bd[_0x3fdd('0x4a')]['id']){delete _0x9235bd[_0x3fdd('0x4a')]['id'];}return db['Trigger'][_0x3fdd('0x48')]({'where':{'id':_0x9235bd[_0x3fdd('0x46')]['id']}})[_0x3fdd('0x25')](handleEntityNotFound(_0x5295ed,null))[_0x3fdd('0x25')](function(_0x3cf2a1){if(_0x3cf2a1){_0x9235bd['body'][_0x3fdd('0x57')]=_0x3cf2a1['id'];return db[_0x3fdd('0x55')]['create'](_0x9235bd[_0x3fdd('0x4a')]);}})[_0x3fdd('0x25')](respondWithResult(_0x5295ed,null))['catch'](handleError(_0x5295ed,null));};exports[_0x3fdd('0x58')]=function(_0x107328,_0x4316b4,_0x13d7ca){var _0x40a67c={};var _0x1df36b={};var _0xb8eb60;var _0x48facd;return db['Trigger'][_0x3fdd('0x59')]({'where':{'id':_0x107328[_0x3fdd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4316b4,null))['then'](function(_0x36364e){if(_0x36364e){_0xb8eb60=_0x36364e;_0x1df36b[_0x3fdd('0x2f')]=_[_0x3fdd('0x47')](db[_0x3fdd('0x55')][_0x3fdd('0x2c')]);_0x1df36b[_0x3fdd('0x31')]=_[_0x3fdd('0x47')](_0x107328[_0x3fdd('0x31')]);_0x1df36b[_0x3fdd('0x32')]=_['intersection'](_0x1df36b['model'],_0x1df36b[_0x3fdd('0x31')]);_0x40a67c['attributes']=_[_0x3fdd('0x33')](_0x1df36b[_0x3fdd('0x2f')],qs['fields'](_0x107328[_0x3fdd('0x31')][_0x3fdd('0x35')]));_0x40a67c[_0x3fdd('0x34')]=_0x40a67c['attributes'][_0x3fdd('0x36')]?_0x40a67c['attributes']:_0x1df36b[_0x3fdd('0x2f')];_0x40a67c[_0x3fdd('0x38')]=qs['sort'](_0x107328[_0x3fdd('0x31')][_0x3fdd('0x39')]);_0x40a67c[_0x3fdd('0x3a')]=qs[_0x3fdd('0x32')](_[_0x3fdd('0x3b')](_0x107328['query'],_0x1df36b[_0x3fdd('0x32')]));if(_0x107328[_0x3fdd('0x31')][_0x3fdd('0x3c')]){_0x40a67c[_0x3fdd('0x3a')]=_[_0x3fdd('0x3d')](_0x40a67c[_0x3fdd('0x3a')],{'$or':_[_0x3fdd('0x30')](_0x40a67c[_0x3fdd('0x34')],function(_0x498bdb){var _0x3735a8={};_0x3735a8[_0x498bdb]={'$like':'%'+_0x107328[_0x3fdd('0x31')][_0x3fdd('0x3c')]+'%'};return _0x3735a8;})});}_0x40a67c=_[_0x3fdd('0x3d')]({},_0x40a67c,_0x107328[_0x3fdd('0x3f')]);return _0xb8eb60['getAllConditions'](_0x40a67c);}})[_0x3fdd('0x25')](function(_0x6f49b6){if(_0x6f49b6){_0x48facd=_0x6f49b6['length'];if(!_0x107328['query']['hasOwnProperty'](_0x3fdd('0x37'))){_0x40a67c[_0x3fdd('0x1e')]=qs[_0x3fdd('0x1e')](_0x107328['query'][_0x3fdd('0x1e')]);_0x40a67c[_0x3fdd('0x1d')]=qs[_0x3fdd('0x1d')](_0x107328['query']['offset']);}return _0xb8eb60['getAllConditions'](_0x40a67c);}})['then'](function(_0xeb3715){if(_0xeb3715){return _0xeb3715?{'count':_0x48facd,'rows':_0xeb3715}:null;}})[_0x3fdd('0x25')](respondWithResult(_0x4316b4,null))[_0x3fdd('0x44')](handleError(_0x4316b4,null));};exports['getAnyConditions']=function(_0x499922,_0x2f4167,_0x30bd0a){var _0x1c3cb2={};var _0x5ebd48={};var _0xf4731d;var _0x5714ce;return db[_0x3fdd('0x40')]['findOne']({'where':{'id':_0x499922[_0x3fdd('0x46')]['id']}})[_0x3fdd('0x25')](handleEntityNotFound(_0x2f4167,null))[_0x3fdd('0x25')](function(_0x1a6457){if(_0x1a6457){_0xf4731d=_0x1a6457;_0x5ebd48[_0x3fdd('0x2f')]=_['keys'](db[_0x3fdd('0x55')][_0x3fdd('0x2c')]);_0x5ebd48['query']=_['keys'](_0x499922[_0x3fdd('0x31')]);_0x5ebd48[_0x3fdd('0x32')]=_['intersection'](_0x5ebd48[_0x3fdd('0x2f')],_0x5ebd48[_0x3fdd('0x31')]);_0x1c3cb2['attributes']=_[_0x3fdd('0x33')](_0x5ebd48['model'],qs[_0x3fdd('0x35')](_0x499922[_0x3fdd('0x31')][_0x3fdd('0x35')]));_0x1c3cb2[_0x3fdd('0x34')]=_0x1c3cb2[_0x3fdd('0x34')][_0x3fdd('0x36')]?_0x1c3cb2[_0x3fdd('0x34')]:_0x5ebd48[_0x3fdd('0x2f')];_0x1c3cb2[_0x3fdd('0x38')]=qs[_0x3fdd('0x39')](_0x499922[_0x3fdd('0x31')][_0x3fdd('0x39')]);_0x1c3cb2['where']=qs[_0x3fdd('0x32')](_['pick'](_0x499922['query'],_0x5ebd48[_0x3fdd('0x32')]));if(_0x499922[_0x3fdd('0x31')][_0x3fdd('0x3c')]){_0x1c3cb2['where']=_['merge'](_0x1c3cb2[_0x3fdd('0x3a')],{'$or':_[_0x3fdd('0x30')](_0x1c3cb2[_0x3fdd('0x34')],function(_0x52a265){var _0x468b79={};_0x468b79[_0x52a265]={'$like':'%'+_0x499922[_0x3fdd('0x31')]['filter']+'%'};return _0x468b79;})});}_0x1c3cb2=_[_0x3fdd('0x3d')]({},_0x1c3cb2,_0x499922[_0x3fdd('0x3f')]);return _0xf4731d['getAnyConditions'](_0x1c3cb2);}})['then'](function(_0x490ae9){if(_0x490ae9){_0x5714ce=_0x490ae9['length'];if(!_0x499922['query'][_0x3fdd('0x5a')]('nolimit')){_0x1c3cb2[_0x3fdd('0x1e')]=qs[_0x3fdd('0x1e')](_0x499922['query'][_0x3fdd('0x1e')]);_0x1c3cb2[_0x3fdd('0x1d')]=qs[_0x3fdd('0x1d')](_0x499922[_0x3fdd('0x31')][_0x3fdd('0x1d')]);}return _0xf4731d[_0x3fdd('0x5b')](_0x1c3cb2);}})[_0x3fdd('0x25')](function(_0x2a9942){if(_0x2a9942){return _0x2a9942?{'count':_0x5714ce,'rows':_0x2a9942}:null;}})[_0x3fdd('0x25')](respondWithResult(_0x2f4167,null))[_0x3fdd('0x44')](handleError(_0x2f4167,null));};exports[_0x3fdd('0x5c')]=function(_0x462ab6,_0xf9e039,_0x1c7f06){if(_0x462ab6[_0x3fdd('0x4a')]['id']){delete _0x462ab6['body']['id'];}return db[_0x3fdd('0x40')]['find']({'where':{'id':_0x462ab6[_0x3fdd('0x46')]['id']}})[_0x3fdd('0x25')](handleEntityNotFound(_0xf9e039,null))[_0x3fdd('0x25')](function(_0x381b41){if(_0x381b41){_0x462ab6['body'][_0x3fdd('0x5d')]=_0x381b41['id'];return db[_0x3fdd('0x5e')][_0x3fdd('0x49')](_0x462ab6['body']);}})[_0x3fdd('0x25')](respondWithResult(_0xf9e039,null))['catch'](handleError(_0xf9e039,null));};exports[_0x3fdd('0x5f')]=function(_0x553db1,_0x5e4553,_0x2f7a62){var _0x22186b={};var _0x31f1a5={};var _0x51c73f;var _0x2e45bc;return db['Trigger'][_0x3fdd('0x59')]({'where':{'id':_0x553db1[_0x3fdd('0x46')]['id']}})[_0x3fdd('0x25')](handleEntityNotFound(_0x5e4553,null))[_0x3fdd('0x25')](function(_0x38ddcc){if(_0x38ddcc){_0x51c73f=_0x38ddcc;_0x31f1a5[_0x3fdd('0x2f')]=_['keys'](db[_0x3fdd('0x5e')]['rawAttributes']);_0x31f1a5[_0x3fdd('0x31')]=_[_0x3fdd('0x47')](_0x553db1[_0x3fdd('0x31')]);_0x31f1a5[_0x3fdd('0x32')]=_[_0x3fdd('0x33')](_0x31f1a5[_0x3fdd('0x2f')],_0x31f1a5[_0x3fdd('0x31')]);_0x22186b['attributes']=_['intersection'](_0x31f1a5[_0x3fdd('0x2f')],qs[_0x3fdd('0x35')](_0x553db1[_0x3fdd('0x31')]['fields']));_0x22186b[_0x3fdd('0x34')]=_0x22186b[_0x3fdd('0x34')]['length']?_0x22186b[_0x3fdd('0x34')]:_0x31f1a5[_0x3fdd('0x2f')];_0x22186b[_0x3fdd('0x38')]=qs['sort'](_0x553db1['query'][_0x3fdd('0x39')]);_0x22186b[_0x3fdd('0x3a')]=qs[_0x3fdd('0x32')](_[_0x3fdd('0x3b')](_0x553db1[_0x3fdd('0x31')],_0x31f1a5[_0x3fdd('0x32')]));if(_0x553db1['query'][_0x3fdd('0x3c')]){_0x22186b[_0x3fdd('0x3a')]=_[_0x3fdd('0x3d')](_0x22186b[_0x3fdd('0x3a')],{'$or':_[_0x3fdd('0x30')](_0x22186b[_0x3fdd('0x34')],function(_0x2ef25a){var _0x5ea883={};_0x5ea883[_0x2ef25a]={'$like':'%'+_0x553db1[_0x3fdd('0x31')]['filter']+'%'};return _0x5ea883;})});}_0x22186b=_[_0x3fdd('0x3d')]({},_0x22186b,_0x553db1[_0x3fdd('0x3f')]);return _0x51c73f[_0x3fdd('0x5f')](_0x22186b);}})[_0x3fdd('0x25')](function(_0x227c7b){if(_0x227c7b){_0x2e45bc=_0x227c7b['length'];if(!_0x553db1['query'][_0x3fdd('0x5a')](_0x3fdd('0x37'))){_0x22186b[_0x3fdd('0x1e')]=qs[_0x3fdd('0x1e')](_0x553db1[_0x3fdd('0x31')][_0x3fdd('0x1e')]);_0x22186b[_0x3fdd('0x1d')]=qs[_0x3fdd('0x1d')](_0x553db1[_0x3fdd('0x31')]['offset']);}return _0x51c73f[_0x3fdd('0x5f')](_0x22186b);}})[_0x3fdd('0x25')](function(_0x23b207){if(_0x23b207){return _0x23b207?{'count':_0x2e45bc,'rows':_0x23b207}:null;}})[_0x3fdd('0x25')](respondWithResult(_0x5e4553,null))['catch'](handleError(_0x5e4553,null));}; \ No newline at end of file +var _0x8244=['sort','pick','filter','where','merge','options','Trigger','includeAll','include','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','reject','save','then','get','Triggers','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order'];(function(_0x4c5844,_0x466cba){var _0x43ae37=function(_0x4f2809){while(--_0x4f2809){_0x4c5844['push'](_0x4c5844['shift']());}};_0x43ae37(++_0x466cba);}(_0x8244,0xd5));var _0x4824=function(_0x3c27b5,_0x30a26c){_0x3c27b5=_0x3c27b5-0x0;var _0x5c9929=_0x8244[_0x3c27b5];return _0x5c9929;};'use strict';var emlformat=require(_0x4824('0x0'));var rimraf=require(_0x4824('0x1'));var zipdir=require(_0x4824('0x2'));var jsonpatch=require(_0x4824('0x3'));var rp=require(_0x4824('0x4'));var moment=require(_0x4824('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4824('0x6'));var path=require(_0x4824('0x7'));var sox=require(_0x4824('0x8'));var csv=require(_0x4824('0x9'));var ejs=require(_0x4824('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4824('0xb'));var squel=require('squel');var crypto=require(_0x4824('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4824('0xd'));var toCsv=require(_0x4824('0x9'));var querystring=require(_0x4824('0xe'));var Papa=require('papaparse');var Redis=require(_0x4824('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4824('0x10'));var as=require(_0x4824('0x11'));var hardwareService=require(_0x4824('0x12'));var logger=require('../../config/logger')(_0x4824('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4824('0x14'));var db=require(_0x4824('0x15'))['db'];function respondWithStatusCode(_0x5130f9,_0x37efa6){_0x37efa6=_0x37efa6||0xcc;return function(_0x4b4a04){if(_0x4b4a04){return _0x5130f9[_0x4824('0x16')](_0x37efa6);}return _0x5130f9[_0x4824('0x17')](_0x37efa6)[_0x4824('0x18')]();};}function respondWithResult(_0x4ac358,_0x2315ab){_0x2315ab=_0x2315ab||0xc8;return function(_0x2ae4f4){if(_0x2ae4f4){return _0x4ac358[_0x4824('0x17')](_0x2315ab)['json'](_0x2ae4f4);}};}function respondWithFilteredResult(_0x18e452,_0x299614){return function(_0x56f893){if(_0x56f893){var _0x1b5272=typeof _0x299614['offset']===_0x4824('0x19')&&typeof _0x299614[_0x4824('0x1a')]==='undefined';var _0x4601ca=_0x56f893['count'];var _0x484407=_0x1b5272?0x0:_0x299614[_0x4824('0x1b')];var _0x348897=_0x1b5272?_0x56f893[_0x4824('0x1c')]:_0x299614[_0x4824('0x1b')]+_0x299614[_0x4824('0x1a')];var _0x43c786;if(_0x348897>=_0x4601ca){_0x348897=_0x4601ca;_0x43c786=0xc8;}else{_0x43c786=0xce;}_0x18e452[_0x4824('0x17')](_0x43c786);return _0x18e452[_0x4824('0x1d')](_0x4824('0x1e'),_0x484407+'-'+_0x348897+'/'+_0x4601ca)['json'](_0x56f893);}return null;};}function patchUpdates(_0x3c48b3){return function(_0x2f9caa){try{jsonpatch['apply'](_0x2f9caa,_0x3c48b3,!![]);}catch(_0x3148d0){return BPromise[_0x4824('0x1f')](_0x3148d0);}return _0x2f9caa[_0x4824('0x20')]();};}function saveUpdates(_0x44ee95,_0x1e8738){return function(_0x588234){if(_0x588234){return _0x588234['update'](_0x44ee95)[_0x4824('0x21')](function(_0x5c8546){return _0x5c8546;});}return null;};}function removeEntity(_0x4e219f,_0x14694a){return function(_0x13332a){if(_0x13332a){return _0x13332a['destroy']()[_0x4824('0x21')](function(){var _0x464496=_0x13332a[_0x4824('0x22')]({'plain':!![]});var _0x966236=_0x4824('0x23');return db[_0x4824('0x24')][_0x4824('0x25')]({'where':{'type':_0x966236,'resourceId':_0x464496['id']}})[_0x4824('0x21')](function(){return _0x13332a;});})[_0x4824('0x21')](function(){_0x4e219f['status'](0xcc)[_0x4824('0x18')]();});}};}function handleEntityNotFound(_0x2908d6,_0x29f251){return function(_0x1df758){if(!_0x1df758){_0x2908d6[_0x4824('0x16')](0x194);}return _0x1df758;};}function handleError(_0x2598c3,_0x2e5a7f){_0x2e5a7f=_0x2e5a7f||0x1f4;return function(_0x189b3d){logger[_0x4824('0x26')](_0x189b3d['stack']);if(_0x189b3d[_0x4824('0x27')]){delete _0x189b3d[_0x4824('0x27')];}_0x2598c3[_0x4824('0x17')](_0x2e5a7f)[_0x4824('0x28')](_0x189b3d);};}exports[_0x4824('0x29')]=function(_0x33d367,_0x4c423a){var _0x51f5ce={},_0x42cb26={},_0x53cd27={'count':0x0,'rows':[]};var _0x3ca4bc=_[_0x4824('0x2a')](db['Trigger'][_0x4824('0x2b')],function(_0x101e41){return{'name':_0x101e41[_0x4824('0x2c')],'type':_0x101e41[_0x4824('0x2d')][_0x4824('0x2e')]};});_0x42cb26['model']=_[_0x4824('0x2a')](_0x3ca4bc,_0x4824('0x27'));_0x42cb26[_0x4824('0x2f')]=_[_0x4824('0x30')](_0x33d367['query']);_0x42cb26[_0x4824('0x31')]=_[_0x4824('0x32')](_0x42cb26[_0x4824('0x33')],_0x42cb26[_0x4824('0x2f')]);_0x51f5ce[_0x4824('0x34')]=_['intersection'](_0x42cb26[_0x4824('0x33')],qs['fields'](_0x33d367[_0x4824('0x2f')][_0x4824('0x35')]));_0x51f5ce[_0x4824('0x34')]=_0x51f5ce[_0x4824('0x34')][_0x4824('0x36')]?_0x51f5ce[_0x4824('0x34')]:_0x42cb26['model'];if(!_0x33d367[_0x4824('0x2f')][_0x4824('0x37')]('nolimit')){_0x51f5ce[_0x4824('0x1a')]=qs[_0x4824('0x1a')](_0x33d367[_0x4824('0x2f')][_0x4824('0x1a')]);_0x51f5ce[_0x4824('0x1b')]=qs[_0x4824('0x1b')](_0x33d367[_0x4824('0x2f')]['offset']);}_0x51f5ce[_0x4824('0x38')]=qs[_0x4824('0x39')](_0x33d367[_0x4824('0x2f')]['sort']);_0x51f5ce['where']=qs[_0x4824('0x31')](_[_0x4824('0x3a')](_0x33d367[_0x4824('0x2f')],_0x42cb26[_0x4824('0x31')]),_0x3ca4bc);if(_0x33d367[_0x4824('0x2f')][_0x4824('0x3b')]){_0x51f5ce[_0x4824('0x3c')]=_[_0x4824('0x3d')](_0x51f5ce[_0x4824('0x3c')],{'$or':_[_0x4824('0x2a')](_0x3ca4bc,function(_0x505559){if(_0x505559[_0x4824('0x2d')]!=='VIRTUAL'){var _0x4a5d6e={};_0x4a5d6e[_0x505559['name']]={'$like':'%'+_0x33d367[_0x4824('0x2f')][_0x4824('0x3b')]+'%'};return _0x4a5d6e;}})});}_0x51f5ce=_['merge']({},_0x51f5ce,_0x33d367[_0x4824('0x3e')]);var _0x39b2ff={'where':_0x51f5ce['where']};return db[_0x4824('0x3f')][_0x4824('0x1c')](_0x39b2ff)[_0x4824('0x21')](function(_0x4bc134){_0x53cd27['count']=_0x4bc134;if(_0x33d367['query'][_0x4824('0x40')]){_0x51f5ce[_0x4824('0x41')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x51f5ce);})[_0x4824('0x21')](function(_0x105388){_0x53cd27[_0x4824('0x42')]=_0x105388;return _0x53cd27;})['then'](respondWithFilteredResult(_0x4c423a,_0x51f5ce))[_0x4824('0x43')](handleError(_0x4c423a,null));};exports[_0x4824('0x44')]=function(_0x2e4e7d,_0x11274e){var _0x1b1108={'raw':![],'where':{'id':_0x2e4e7d[_0x4824('0x45')]['id']}},_0x3d4b54={};_0x3d4b54[_0x4824('0x33')]=_['keys'](db['Trigger'][_0x4824('0x2b')]);_0x3d4b54[_0x4824('0x2f')]=_[_0x4824('0x30')](_0x2e4e7d[_0x4824('0x2f')]);_0x3d4b54[_0x4824('0x31')]=_[_0x4824('0x32')](_0x3d4b54['model'],_0x3d4b54[_0x4824('0x2f')]);_0x1b1108[_0x4824('0x34')]=_[_0x4824('0x32')](_0x3d4b54[_0x4824('0x33')],qs[_0x4824('0x35')](_0x2e4e7d[_0x4824('0x2f')][_0x4824('0x35')]));_0x1b1108[_0x4824('0x34')]=_0x1b1108[_0x4824('0x34')][_0x4824('0x36')]?_0x1b1108[_0x4824('0x34')]:_0x3d4b54['model'];if(_0x2e4e7d[_0x4824('0x2f')][_0x4824('0x40')]){_0x1b1108[_0x4824('0x41')]=[{'all':!![]}];}_0x1b1108=_[_0x4824('0x3d')]({},_0x1b1108,_0x2e4e7d[_0x4824('0x3e')]);return db[_0x4824('0x3f')][_0x4824('0x46')](_0x1b1108)[_0x4824('0x21')](handleEntityNotFound(_0x11274e,null))[_0x4824('0x21')](respondWithResult(_0x11274e,null))[_0x4824('0x43')](handleError(_0x11274e,null));};exports['create']=function(_0x3b2a9f,_0x337258){return db['Trigger'][_0x4824('0x47')](_0x3b2a9f[_0x4824('0x48')],{})[_0x4824('0x21')](function(_0x2cb078){var _0x2fee29=_0x3b2a9f['user'][_0x4824('0x22')]({'plain':!![]});if(!_0x2fee29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fee29[_0x4824('0x49')]===_0x4824('0x4a')){var _0x1f841e=_0x2cb078[_0x4824('0x22')]({'plain':!![]});var _0x15824e=_0x4824('0x23');return db[_0x4824('0x4b')][_0x4824('0x46')]({'where':{'name':_0x15824e,'userProfileId':_0x2fee29[_0x4824('0x4c')]},'raw':!![]})[_0x4824('0x21')](function(_0x1ff524){if(_0x1ff524&&_0x1ff524[_0x4824('0x4d')]===0x0){return db[_0x4824('0x24')]['create']({'name':_0x1f841e['name'],'resourceId':_0x1f841e['id'],'type':_0x1ff524[_0x4824('0x27')],'sectionId':_0x1ff524['id']},{})[_0x4824('0x21')](function(){return _0x2cb078;});}else{return _0x2cb078;}})[_0x4824('0x43')](function(_0x3ec73f){logger[_0x4824('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ec73f);throw _0x3ec73f;});}return _0x2cb078;})[_0x4824('0x21')](respondWithResult(_0x337258,0xc9))[_0x4824('0x43')](handleError(_0x337258,null));};exports['update']=function(_0x594d49,_0x2e2807){if(_0x594d49[_0x4824('0x48')]['id']){delete _0x594d49[_0x4824('0x48')]['id'];}return db[_0x4824('0x3f')][_0x4824('0x46')]({'where':{'id':_0x594d49[_0x4824('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e2807,null))[_0x4824('0x21')](saveUpdates(_0x594d49['body'],null))[_0x4824('0x21')](respondWithResult(_0x2e2807,null))[_0x4824('0x43')](handleError(_0x2e2807,null));};exports[_0x4824('0x25')]=function(_0x397b14,_0x57d8){return db[_0x4824('0x3f')][_0x4824('0x46')]({'where':{'id':_0x397b14[_0x4824('0x45')]['id']}})[_0x4824('0x21')](handleEntityNotFound(_0x57d8,null))[_0x4824('0x21')](removeEntity(_0x57d8,null))['catch'](handleError(_0x57d8,null));};exports[_0x4824('0x4e')]=function(_0x469b24,_0x38002c,_0x3fbc0a){if(_0x469b24[_0x4824('0x48')]['id']){delete _0x469b24['body']['id'];}return db[_0x4824('0x3f')][_0x4824('0x46')]({'where':{'id':_0x469b24[_0x4824('0x45')]['id']}})['then'](handleEntityNotFound(_0x38002c,null))[_0x4824('0x21')](function(_0x51d3b0){if(_0x51d3b0){_0x469b24[_0x4824('0x48')][_0x4824('0x4f')]=_0x51d3b0['id'];return db[_0x4824('0x50')][_0x4824('0x47')](_0x469b24[_0x4824('0x48')]);}})[_0x4824('0x21')](respondWithResult(_0x38002c,null))[_0x4824('0x43')](handleError(_0x38002c,null));};exports[_0x4824('0x51')]=function(_0x34efd3,_0x760eb9,_0x246bff){if(_0x34efd3[_0x4824('0x48')]['id']){delete _0x34efd3['body']['id'];}return db[_0x4824('0x3f')][_0x4824('0x46')]({'where':{'id':_0x34efd3['params']['id']}})[_0x4824('0x21')](handleEntityNotFound(_0x760eb9,null))[_0x4824('0x21')](function(_0x809c9b){if(_0x809c9b){_0x34efd3[_0x4824('0x48')]['TriggerAnyId']=_0x809c9b['id'];return db[_0x4824('0x50')]['create'](_0x34efd3[_0x4824('0x48')]);}})['then'](respondWithResult(_0x760eb9,null))[_0x4824('0x43')](handleError(_0x760eb9,null));};exports[_0x4824('0x52')]=function(_0x6fdfe3,_0x1f072b,_0x5c0015){var _0x3376fa={};var _0x2a13c1={};var _0x3a8942;var _0x4b19bf;return db[_0x4824('0x3f')][_0x4824('0x53')]({'where':{'id':_0x6fdfe3[_0x4824('0x45')]['id']}})[_0x4824('0x21')](handleEntityNotFound(_0x1f072b,null))[_0x4824('0x21')](function(_0x4d6244){if(_0x4d6244){_0x3a8942=_0x4d6244;_0x2a13c1[_0x4824('0x33')]=_[_0x4824('0x30')](db[_0x4824('0x50')]['rawAttributes']);_0x2a13c1['query']=_['keys'](_0x6fdfe3['query']);_0x2a13c1[_0x4824('0x31')]=_['intersection'](_0x2a13c1[_0x4824('0x33')],_0x2a13c1[_0x4824('0x2f')]);_0x3376fa['attributes']=_[_0x4824('0x32')](_0x2a13c1[_0x4824('0x33')],qs[_0x4824('0x35')](_0x6fdfe3[_0x4824('0x2f')][_0x4824('0x35')]));_0x3376fa['attributes']=_0x3376fa[_0x4824('0x34')][_0x4824('0x36')]?_0x3376fa[_0x4824('0x34')]:_0x2a13c1[_0x4824('0x33')];_0x3376fa[_0x4824('0x38')]=qs[_0x4824('0x39')](_0x6fdfe3[_0x4824('0x2f')][_0x4824('0x39')]);_0x3376fa['where']=qs[_0x4824('0x31')](_['pick'](_0x6fdfe3[_0x4824('0x2f')],_0x2a13c1[_0x4824('0x31')]));if(_0x6fdfe3[_0x4824('0x2f')][_0x4824('0x3b')]){_0x3376fa[_0x4824('0x3c')]=_[_0x4824('0x3d')](_0x3376fa[_0x4824('0x3c')],{'$or':_[_0x4824('0x2a')](_0x3376fa[_0x4824('0x34')],function(_0xb4043d){var _0x28fd88={};_0x28fd88[_0xb4043d]={'$like':'%'+_0x6fdfe3['query'][_0x4824('0x3b')]+'%'};return _0x28fd88;})});}_0x3376fa=_[_0x4824('0x3d')]({},_0x3376fa,_0x6fdfe3[_0x4824('0x3e')]);return _0x3a8942[_0x4824('0x52')](_0x3376fa);}})['then'](function(_0x255ebc){if(_0x255ebc){_0x4b19bf=_0x255ebc['length'];if(!_0x6fdfe3[_0x4824('0x2f')][_0x4824('0x37')](_0x4824('0x54'))){_0x3376fa[_0x4824('0x1a')]=qs['limit'](_0x6fdfe3[_0x4824('0x2f')][_0x4824('0x1a')]);_0x3376fa['offset']=qs[_0x4824('0x1b')](_0x6fdfe3[_0x4824('0x2f')][_0x4824('0x1b')]);}return _0x3a8942[_0x4824('0x52')](_0x3376fa);}})[_0x4824('0x21')](function(_0x213078){if(_0x213078){return _0x213078?{'count':_0x4b19bf,'rows':_0x213078}:null;}})['then'](respondWithResult(_0x1f072b,null))[_0x4824('0x43')](handleError(_0x1f072b,null));};exports['getAnyConditions']=function(_0x3dcb20,_0x6e64fe,_0x159b44){var _0xb1e9e9={};var _0xeac23={};var _0x5bac05;var _0x51eabb;return db[_0x4824('0x3f')]['findOne']({'where':{'id':_0x3dcb20[_0x4824('0x45')]['id']}})[_0x4824('0x21')](handleEntityNotFound(_0x6e64fe,null))[_0x4824('0x21')](function(_0x3d34fc){if(_0x3d34fc){_0x5bac05=_0x3d34fc;_0xeac23[_0x4824('0x33')]=_[_0x4824('0x30')](db['Condition']['rawAttributes']);_0xeac23[_0x4824('0x2f')]=_[_0x4824('0x30')](_0x3dcb20['query']);_0xeac23[_0x4824('0x31')]=_[_0x4824('0x32')](_0xeac23[_0x4824('0x33')],_0xeac23[_0x4824('0x2f')]);_0xb1e9e9[_0x4824('0x34')]=_[_0x4824('0x32')](_0xeac23[_0x4824('0x33')],qs[_0x4824('0x35')](_0x3dcb20[_0x4824('0x2f')][_0x4824('0x35')]));_0xb1e9e9[_0x4824('0x34')]=_0xb1e9e9['attributes']['length']?_0xb1e9e9['attributes']:_0xeac23[_0x4824('0x33')];_0xb1e9e9[_0x4824('0x38')]=qs[_0x4824('0x39')](_0x3dcb20[_0x4824('0x2f')][_0x4824('0x39')]);_0xb1e9e9['where']=qs[_0x4824('0x31')](_[_0x4824('0x3a')](_0x3dcb20[_0x4824('0x2f')],_0xeac23[_0x4824('0x31')]));if(_0x3dcb20[_0x4824('0x2f')][_0x4824('0x3b')]){_0xb1e9e9[_0x4824('0x3c')]=_[_0x4824('0x3d')](_0xb1e9e9[_0x4824('0x3c')],{'$or':_['map'](_0xb1e9e9[_0x4824('0x34')],function(_0x536c40){var _0x44023b={};_0x44023b[_0x536c40]={'$like':'%'+_0x3dcb20['query'][_0x4824('0x3b')]+'%'};return _0x44023b;})});}_0xb1e9e9=_[_0x4824('0x3d')]({},_0xb1e9e9,_0x3dcb20['options']);return _0x5bac05[_0x4824('0x55')](_0xb1e9e9);}})['then'](function(_0x5d091c){if(_0x5d091c){_0x51eabb=_0x5d091c[_0x4824('0x36')];if(!_0x3dcb20[_0x4824('0x2f')][_0x4824('0x37')](_0x4824('0x54'))){_0xb1e9e9[_0x4824('0x1a')]=qs[_0x4824('0x1a')](_0x3dcb20[_0x4824('0x2f')][_0x4824('0x1a')]);_0xb1e9e9[_0x4824('0x1b')]=qs[_0x4824('0x1b')](_0x3dcb20[_0x4824('0x2f')]['offset']);}return _0x5bac05[_0x4824('0x55')](_0xb1e9e9);}})[_0x4824('0x21')](function(_0x113f74){if(_0x113f74){return _0x113f74?{'count':_0x51eabb,'rows':_0x113f74}:null;}})['then'](respondWithResult(_0x6e64fe,null))['catch'](handleError(_0x6e64fe,null));};exports[_0x4824('0x56')]=function(_0x149f3e,_0x184c8f,_0x52b89c){if(_0x149f3e['body']['id']){delete _0x149f3e['body']['id'];}return db[_0x4824('0x3f')][_0x4824('0x46')]({'where':{'id':_0x149f3e['params']['id']}})[_0x4824('0x21')](handleEntityNotFound(_0x184c8f,null))[_0x4824('0x21')](function(_0x154dda){if(_0x154dda){_0x149f3e[_0x4824('0x48')][_0x4824('0x57')]=_0x154dda['id'];return db[_0x4824('0x58')][_0x4824('0x47')](_0x149f3e[_0x4824('0x48')]);}})[_0x4824('0x21')](respondWithResult(_0x184c8f,null))[_0x4824('0x43')](handleError(_0x184c8f,null));};exports[_0x4824('0x59')]=function(_0x199473,_0x49d543,_0x114ae2){var _0x479bcf={};var _0x53f6a9={};var _0x91d23d;var _0x52e14d;return db['Trigger'][_0x4824('0x53')]({'where':{'id':_0x199473[_0x4824('0x45')]['id']}})[_0x4824('0x21')](handleEntityNotFound(_0x49d543,null))[_0x4824('0x21')](function(_0xb8637f){if(_0xb8637f){_0x91d23d=_0xb8637f;_0x53f6a9[_0x4824('0x33')]=_['keys'](db[_0x4824('0x58')][_0x4824('0x2b')]);_0x53f6a9['query']=_[_0x4824('0x30')](_0x199473[_0x4824('0x2f')]);_0x53f6a9['filters']=_[_0x4824('0x32')](_0x53f6a9['model'],_0x53f6a9[_0x4824('0x2f')]);_0x479bcf[_0x4824('0x34')]=_[_0x4824('0x32')](_0x53f6a9[_0x4824('0x33')],qs['fields'](_0x199473[_0x4824('0x2f')]['fields']));_0x479bcf['attributes']=_0x479bcf[_0x4824('0x34')][_0x4824('0x36')]?_0x479bcf['attributes']:_0x53f6a9[_0x4824('0x33')];_0x479bcf[_0x4824('0x38')]=qs[_0x4824('0x39')](_0x199473['query'][_0x4824('0x39')]);_0x479bcf[_0x4824('0x3c')]=qs[_0x4824('0x31')](_['pick'](_0x199473['query'],_0x53f6a9[_0x4824('0x31')]));if(_0x199473['query'][_0x4824('0x3b')]){_0x479bcf[_0x4824('0x3c')]=_[_0x4824('0x3d')](_0x479bcf[_0x4824('0x3c')],{'$or':_[_0x4824('0x2a')](_0x479bcf['attributes'],function(_0x170341){var _0xd24ba6={};_0xd24ba6[_0x170341]={'$like':'%'+_0x199473['query'][_0x4824('0x3b')]+'%'};return _0xd24ba6;})});}_0x479bcf=_[_0x4824('0x3d')]({},_0x479bcf,_0x199473[_0x4824('0x3e')]);return _0x91d23d[_0x4824('0x59')](_0x479bcf);}})[_0x4824('0x21')](function(_0x217887){if(_0x217887){_0x52e14d=_0x217887['length'];if(!_0x199473[_0x4824('0x2f')]['hasOwnProperty'](_0x4824('0x54'))){_0x479bcf[_0x4824('0x1a')]=qs['limit'](_0x199473[_0x4824('0x2f')][_0x4824('0x1a')]);_0x479bcf['offset']=qs[_0x4824('0x1b')](_0x199473[_0x4824('0x2f')][_0x4824('0x1b')]);}return _0x91d23d[_0x4824('0x59')](_0x479bcf);}})[_0x4824('0x21')](function(_0x273ef2){if(_0x273ef2){return _0x273ef2?{'count':_0x52e14d,'rows':_0x273ef2}:null;}})['then'](respondWithResult(_0x49d543,null))[_0x4824('0x43')](handleError(_0x49d543,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d2c0b0d..9534080 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 _0xcb99=['../../config/logger','bluebird','request-promise','path','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash'];(function(_0x148c43,_0x21432f){var _0x25c6df=function(_0x6a54df){while(--_0x6a54df){_0x148c43['push'](_0x148c43['shift']());}};_0x25c6df(++_0x21432f);}(_0xcb99,0x8b));var _0x9cb9=function(_0x4cde9e,_0x57150a){_0x4cde9e=_0x4cde9e-0x0;var _0x38df0c=_0xcb99[_0x4cde9e];return _0x38df0c;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require(_0x9cb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cb9('0x2'));var rp=require(_0x9cb9('0x3'));var fs=require('fs');var path=require(_0x9cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module['exports']=function(_0x214b72,_0x509cfc){return _0x214b72[_0x9cb9('0x7')](_0x9cb9('0x8'),attributes,{'tableName':_0x9cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26c2=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Trigger','api','moment'];(function(_0x50fb87,_0x18c574){var _0xb25000=function(_0x24a211){while(--_0x24a211){_0x50fb87['push'](_0x50fb87['shift']());}};_0xb25000(++_0x18c574);}(_0x26c2,0x130));var _0x226c=function(_0x464f93,_0x1683b3){_0x464f93=_0x464f93-0x0;var _0x263e89=_0x26c2[_0x464f93];return _0x263e89;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x226c('0x0'));var moment=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var rp=require(_0x226c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var attributes=require('./trigger.attributes');module[_0x226c('0x6')]=function(_0xb40fbd,_0x21ed3a){return _0xb40fbd[_0x226c('0x7')](_0x226c('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 96d61b8..97d6e8f 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 _0x168f=['find','then','ShowTrigger','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trigger,\x20%s,\x20%s','GetTrigger','options','raw','where','attributes','include','map','model','Trigger'];(function(_0xd6e5ca,_0x410def){var _0x35ff64=function(_0x4981f1){while(--_0x4981f1){_0xd6e5ca['push'](_0xd6e5ca['shift']());}};_0x35ff64(++_0x410def);}(_0x168f,0x70));var _0xf168=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x168f[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0xf168('0x0'));var util=require(_0xf168('0x1'));var moment=require(_0xf168('0x2'));var BPromise=require(_0xf168('0x3'));var rs=require(_0xf168('0x4'));var fs=require('fs');var Redis=require(_0xf168('0x5'));var db=require(_0xf168('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf168('0x7'))(_0xf168('0x8'));var config=require(_0xf168('0x9'));var jayson=require(_0xf168('0xa'));var client=jayson[_0xf168('0xb')][_0xf168('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d8398,_0x198d2a,_0x2cf497){return new BPromise(function(_0x5a3425,_0x504c49){return client[_0xf168('0xd')](_0x1d8398,_0x2cf497)['then'](function(_0xe18a86){logger[_0xf168('0xe')]('Trigger,\x20%s,\x20%s',_0x198d2a,'request\x20sent');logger[_0xf168('0xf')](_0xf168('0x10'),_0x198d2a,_0xf168('0x11'),JSON[_0xf168('0x12')](_0xe18a86));if(_0xe18a86['error']){if(_0xe18a86[_0xf168('0x13')][_0xf168('0x14')]===0x1f4){logger[_0xf168('0x13')]('Trigger,\x20%s,\x20%s',_0x198d2a,_0xe18a86[_0xf168('0x13')][_0xf168('0x15')]);return _0x504c49(_0xe18a86[_0xf168('0x13')]['message']);}logger[_0xf168('0x13')](_0xf168('0x16'),_0x198d2a,_0xe18a86['error'][_0xf168('0x15')]);return _0x5a3425(_0xe18a86[_0xf168('0x13')][_0xf168('0x15')]);}else{logger['info'](_0xf168('0x16'),_0x198d2a,_0xf168('0x11'));_0x5a3425(_0xe18a86['result'][_0xf168('0x15')]);}})['catch'](function(_0x746440){logger[_0xf168('0x13')](_0xf168('0x16'),_0x198d2a,_0x746440);_0x504c49(_0x746440);});});}exports[_0xf168('0x17')]=function(_0x38a17b){var _0x39b1bb=this;return new Promise(function(_0xcc13,_0x5d926d){return db['Trigger']['findAll']({'raw':_0x38a17b[_0xf168('0x18')]?_0x38a17b[_0xf168('0x18')][_0xf168('0x19')]===undefined?!![]:![]:!![],'where':_0x38a17b[_0xf168('0x18')]?_0x38a17b[_0xf168('0x18')][_0xf168('0x1a')]||null:null,'attributes':_0x38a17b['options']?_0x38a17b[_0xf168('0x18')][_0xf168('0x1b')]||null:null,'limit':_0x38a17b['options']?_0x38a17b[_0xf168('0x18')]['limit']||null:null,'include':_0x38a17b[_0xf168('0x18')]?_0x38a17b['options'][_0xf168('0x1c')]?_[_0xf168('0x1d')](_0x38a17b[_0xf168('0x18')]['include'],function(_0x15a556){return{'model':db[_0x15a556[_0xf168('0x1e')]],'as':_0x15a556['as'],'attributes':_0x15a556[_0xf168('0x1b')],'include':_0x15a556[_0xf168('0x1c')]?_[_0xf168('0x1d')](_0x15a556['include'],function(_0xcf92c3){return{'model':db[_0xcf92c3['model']],'as':_0xcf92c3['as'],'attributes':_0xcf92c3[_0xf168('0x1b')],'include':_0xcf92c3[_0xf168('0x1c')]?_[_0xf168('0x1d')](_0xcf92c3[_0xf168('0x1c')],function(_0x1cc2f6){return{'model':db[_0x1cc2f6[_0xf168('0x1e')]],'as':_0x1cc2f6['as'],'attributes':_0x1cc2f6[_0xf168('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ddb9a){logger[_0xf168('0xe')](_0xf168('0x17'),_0x38a17b);logger[_0xf168('0xf')](_0xf168('0x17'),_0x38a17b,JSON[_0xf168('0x12')](_0x5ddb9a));_0xcc13(_0x5ddb9a);})['catch'](function(_0xc3e54e){logger[_0xf168('0x13')](_0xf168('0x17'),_0xc3e54e[_0xf168('0x15')],_0x38a17b);_0x5d926d(_0x39b1bb[_0xf168('0x13')](0x1f4,_0xc3e54e[_0xf168('0x15')]));});});};exports['ShowTrigger']=function(_0xdc8d71){var _0x12f1ab=this;return new Promise(function(_0x10b6cc,_0x5cd9a0){return db[_0xf168('0x1f')][_0xf168('0x20')]({'raw':_0xdc8d71['options']?_0xdc8d71[_0xf168('0x18')][_0xf168('0x19')]===undefined?!![]:![]:!![],'where':_0xdc8d71[_0xf168('0x18')]?_0xdc8d71['options'][_0xf168('0x1a')]||null:null,'attributes':_0xdc8d71['options']?_0xdc8d71['options'][_0xf168('0x1b')]||null:null,'include':_0xdc8d71[_0xf168('0x18')]?_0xdc8d71[_0xf168('0x18')][_0xf168('0x1c')]?_[_0xf168('0x1d')](_0xdc8d71[_0xf168('0x18')]['include'],function(_0x231174){return{'model':db[_0x231174['model']],'as':_0x231174['as'],'attributes':_0x231174[_0xf168('0x1b')],'include':_0x231174[_0xf168('0x1c')]?_[_0xf168('0x1d')](_0x231174[_0xf168('0x1c')],function(_0x58dbba){return{'model':db[_0x58dbba[_0xf168('0x1e')]],'as':_0x58dbba['as'],'attributes':_0x58dbba[_0xf168('0x1b')],'include':_0x58dbba[_0xf168('0x1c')]?_['map'](_0x58dbba[_0xf168('0x1c')],function(_0xd95c92){return{'model':db[_0xd95c92[_0xf168('0x1e')]],'as':_0xd95c92['as'],'attributes':_0xd95c92['attributes']};}):[]};}):[]};}):[]:[]})[_0xf168('0x21')](function(_0x1a2e68){logger[_0xf168('0xe')]('ShowTrigger',_0xdc8d71);logger['debug'](_0xf168('0x22'),_0xdc8d71,JSON['stringify'](_0x1a2e68));_0x10b6cc(_0x1a2e68);})[_0xf168('0x23')](function(_0x5ad672){logger['error'](_0xf168('0x22'),_0x5ad672[_0xf168('0x15')],_0xdc8d71);_0x5cd9a0(_0x12f1ab[_0xf168('0x13')](0x1f4,_0x5ad672[_0xf168('0x15')]));});});}; \ No newline at end of file +var _0x4080=['randomstring','ioredis','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','include','map','model','then','ShowTrigger','raw','lodash','util','moment','bluebird'];(function(_0x5ac06f,_0x143f82){var _0xc77293=function(_0x289066){while(--_0x289066){_0x5ac06f['push'](_0x5ac06f['shift']());}};_0xc77293(++_0x143f82);}(_0x4080,0x84));var _0x0408=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x4080[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x0408('0x0'));var util=require(_0x0408('0x1'));var moment=require(_0x0408('0x2'));var BPromise=require(_0x0408('0x3'));var rs=require(_0x0408('0x4'));var fs=require('fs');var Redis=require(_0x0408('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0408('0x6'));var config=require(_0x0408('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0408('0x8')][_0x0408('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3614ce,_0x3c0efe,_0x2ea735){return new BPromise(function(_0x20c9ef,_0x27a260){return client[_0x0408('0xa')](_0x3614ce,_0x2ea735)['then'](function(_0x5ee3e8){logger[_0x0408('0xb')]('Trigger,\x20%s,\x20%s',_0x3c0efe,_0x0408('0xc'));logger[_0x0408('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3c0efe,_0x0408('0xc'),JSON[_0x0408('0xe')](_0x5ee3e8));if(_0x5ee3e8[_0x0408('0xf')]){if(_0x5ee3e8[_0x0408('0xf')][_0x0408('0x10')]===0x1f4){logger[_0x0408('0xf')](_0x0408('0x11'),_0x3c0efe,_0x5ee3e8[_0x0408('0xf')][_0x0408('0x12')]);return _0x27a260(_0x5ee3e8['error'][_0x0408('0x12')]);}logger[_0x0408('0xf')](_0x0408('0x11'),_0x3c0efe,_0x5ee3e8['error'][_0x0408('0x12')]);return _0x20c9ef(_0x5ee3e8[_0x0408('0xf')]['message']);}else{logger[_0x0408('0xb')](_0x0408('0x11'),_0x3c0efe,'request\x20sent');_0x20c9ef(_0x5ee3e8[_0x0408('0x13')][_0x0408('0x12')]);}})[_0x0408('0x14')](function(_0x475ffe){logger[_0x0408('0xf')](_0x0408('0x11'),_0x3c0efe,_0x475ffe);_0x27a260(_0x475ffe);});});}exports[_0x0408('0x15')]=function(_0x14f973){var _0x4de2bf=this;return new Promise(function(_0x5e138c,_0x238fde){return db[_0x0408('0x16')][_0x0408('0x17')]({'raw':_0x14f973[_0x0408('0x18')]?_0x14f973[_0x0408('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x14f973[_0x0408('0x18')]?_0x14f973[_0x0408('0x18')][_0x0408('0x19')]||null:null,'attributes':_0x14f973[_0x0408('0x18')]?_0x14f973[_0x0408('0x18')][_0x0408('0x1a')]||null:null,'limit':_0x14f973[_0x0408('0x18')]?_0x14f973['options'][_0x0408('0x1b')]||null:null,'include':_0x14f973[_0x0408('0x18')]?_0x14f973['options'][_0x0408('0x1c')]?_[_0x0408('0x1d')](_0x14f973['options'][_0x0408('0x1c')],function(_0xc0c829){return{'model':db[_0xc0c829[_0x0408('0x1e')]],'as':_0xc0c829['as'],'attributes':_0xc0c829[_0x0408('0x1a')],'include':_0xc0c829[_0x0408('0x1c')]?_[_0x0408('0x1d')](_0xc0c829[_0x0408('0x1c')],function(_0x4d0d0e){return{'model':db[_0x4d0d0e['model']],'as':_0x4d0d0e['as'],'attributes':_0x4d0d0e[_0x0408('0x1a')],'include':_0x4d0d0e[_0x0408('0x1c')]?_[_0x0408('0x1d')](_0x4d0d0e[_0x0408('0x1c')],function(_0x2a1823){return{'model':db[_0x2a1823[_0x0408('0x1e')]],'as':_0x2a1823['as'],'attributes':_0x2a1823[_0x0408('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0408('0x1f')](function(_0x19ddd5){logger[_0x0408('0xb')](_0x0408('0x15'),_0x14f973);logger['debug']('GetTrigger',_0x14f973,JSON['stringify'](_0x19ddd5));_0x5e138c(_0x19ddd5);})['catch'](function(_0x2c3bba){logger[_0x0408('0xf')](_0x0408('0x15'),_0x2c3bba[_0x0408('0x12')],_0x14f973);_0x238fde(_0x4de2bf[_0x0408('0xf')](0x1f4,_0x2c3bba[_0x0408('0x12')]));});});};exports[_0x0408('0x20')]=function(_0x324833){var _0x22a605=this;return new Promise(function(_0x3bf8c9,_0x162411){return db[_0x0408('0x16')]['find']({'raw':_0x324833[_0x0408('0x18')]?_0x324833['options'][_0x0408('0x21')]===undefined?!![]:![]:!![],'where':_0x324833[_0x0408('0x18')]?_0x324833[_0x0408('0x18')][_0x0408('0x19')]||null:null,'attributes':_0x324833['options']?_0x324833[_0x0408('0x18')][_0x0408('0x1a')]||null:null,'include':_0x324833[_0x0408('0x18')]?_0x324833['options'][_0x0408('0x1c')]?_[_0x0408('0x1d')](_0x324833[_0x0408('0x18')][_0x0408('0x1c')],function(_0x57835f){return{'model':db[_0x57835f[_0x0408('0x1e')]],'as':_0x57835f['as'],'attributes':_0x57835f['attributes'],'include':_0x57835f['include']?_[_0x0408('0x1d')](_0x57835f[_0x0408('0x1c')],function(_0x2d1ba7){return{'model':db[_0x2d1ba7[_0x0408('0x1e')]],'as':_0x2d1ba7['as'],'attributes':_0x2d1ba7['attributes'],'include':_0x2d1ba7['include']?_[_0x0408('0x1d')](_0x2d1ba7['include'],function(_0x4c98da){return{'model':db[_0x4c98da[_0x0408('0x1e')]],'as':_0x4c98da['as'],'attributes':_0x4c98da[_0x0408('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0408('0x1f')](function(_0x50cf97){logger[_0x0408('0xb')](_0x0408('0x20'),_0x324833);logger[_0x0408('0xd')]('ShowTrigger',_0x324833,JSON['stringify'](_0x50cf97));_0x3bf8c9(_0x50cf97);})[_0x0408('0x14')](function(_0x482171){logger['error'](_0x0408('0x20'),_0x482171[_0x0408('0x12')],_0x324833);_0x162411(_0x22a605[_0x0408('0xf')](0x1f4,_0x482171[_0x0408('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 0b32bc1..a19b057 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 _0xde9a=['update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','clone','create','put'];(function(_0x3c6a82,_0x1e904d){var _0x4d4dcc=function(_0x1d3c97){while(--_0x1d3c97){_0x3c6a82['push'](_0x3c6a82['shift']());}};_0x4d4dcc(++_0x1e904d);}(_0xde9a,0x13d));var _0xade9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xde9a[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xade9('0x0'));var util=require(_0xade9('0x1'));var path=require(_0xade9('0x2'));var timeout=require(_0xade9('0x3'));var express=require('express');var router=express[_0xade9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xade9('0x5'));var interaction=require(_0xade9('0x6'));var config=require(_0xade9('0x7'));var controller=require(_0xade9('0x8'));router['get']('/',auth[_0xade9('0x9')](),controller[_0xade9('0xa')]);router[_0xade9('0xb')](_0xade9('0xc'),auth['isAuthenticated'](),controller[_0xade9('0xd')]);router[_0xade9('0xe')](_0xade9('0xf'),auth[_0xade9('0x9')](),controller[_0xade9('0x10')]);router[_0xade9('0xe')]('/',auth[_0xade9('0x9')](),controller[_0xade9('0x11')]);router[_0xade9('0x12')](_0xade9('0xc'),auth[_0xade9('0x9')](),controller[_0xade9('0x13')]);router['delete']('/:id',auth[_0xade9('0x9')](),controller['destroy']);module[_0xade9('0x14')]=router; \ No newline at end of file +var _0x1fc6=['express','Router','fs-extra','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','clone','create','put','update','delete','destroy','multer','path'];(function(_0x58d9a4,_0x16165c){var _0x1479b5=function(_0x22adc0){while(--_0x22adc0){_0x58d9a4['push'](_0x58d9a4['shift']());}};_0x1479b5(++_0x16165c);}(_0x1fc6,0x154));var _0x61fc=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x1fc6[_0x3f00ee];return _0x18a07e;};'use strict';var multer=require(_0x61fc('0x0'));var util=require('util');var path=require(_0x61fc('0x1'));var timeout=require('connect-timeout');var express=require(_0x61fc('0x2'));var router=express[_0x61fc('0x3')]();var fs_extra=require(_0x61fc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x61fc('0x5'));var controller=require(_0x61fc('0x6'));router[_0x61fc('0x7')]('/',auth['isAuthenticated'](),controller[_0x61fc('0x8')]);router[_0x61fc('0x7')](_0x61fc('0x9'),auth[_0x61fc('0xa')](),controller[_0x61fc('0xb')]);router[_0x61fc('0xc')]('/:id/clone',auth['isAuthenticated'](),controller[_0x61fc('0xd')]);router[_0x61fc('0xc')]('/',auth[_0x61fc('0xa')](),controller[_0x61fc('0xe')]);router[_0x61fc('0xf')](_0x61fc('0x9'),auth[_0x61fc('0xa')](),controller[_0x61fc('0x10')]);router[_0x61fc('0x11')](_0x61fc('0x9'),auth[_0x61fc('0xa')](),controller[_0x61fc('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a7448f8..41e5ab6 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 _0xc4c1=['originate','INTEGER','uac','uas','fingerprint','certificate','active','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','rfc2833','nonat','yes','force_rport,comedia','nat','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','always','accept','refuse'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xc4c1,0xa2));var _0x1c4c=function(_0x547533,_0x870c79){_0x547533=_0x547533-0x0;var _0x12eac2=_0xc4c1[_0x547533];return _0x12eac2;};'use strict';var Sequelize=require(_0x1c4c('0x0'));module[_0x1c4c('0x1')]={'name':{'type':Sequelize[_0x1c4c('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x4'),_0x1c4c('0x5'),_0x1c4c('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1c4c('0x2')],'allowNull':![],'defaultValue':_0x1c4c('0x7')},'callingpres':{'type':Sequelize[_0x1c4c('0x3')]('ALLOWED_NOT_SCREENED',_0x1c4c('0x8'),_0x1c4c('0x9'),_0x1c4c('0xa'),'PROHIB_NOT_SCREENED',_0x1c4c('0xb'),'PROHIB_FAILED_SCREEN',_0x1c4c('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x1c4c('0x2')]},'remotesecret':{'type':Sequelize[_0x1c4c('0x2')]},'transport':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':_0x1c4c('0xd'),'set':function(_0x3236f7){this[_0x1c4c('0xe')](_0x1c4c('0xf'),_0x3236f7?_0x3236f7[_0x1c4c('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x1c4c('0xf'))?this['getDataValue']('transport')[_0x1c4c('0x11')](','):null;},'comment':_0x1c4c('0x12')},'dtmfmode':{'type':Sequelize[_0x1c4c('0x3')]('rfc2833','info',_0x1c4c('0x13'),_0x1c4c('0x14'),'auto'),'defaultValue':_0x1c4c('0x15')},'directmedia':{'type':Sequelize[_0x1c4c('0x3')]('yes','no',_0x1c4c('0x16'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1c4c('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':_0x1c4c('0x18'),'set':function(_0x2c4457){this['setDataValue'](_0x1c4c('0x19'),_0x2c4457?_0x2c4457[_0x1c4c('0x10')](','):null);},'get':function(){return this[_0x1c4c('0x1a')](_0x1c4c('0x19'))?this[_0x1c4c('0x1a')]('nat')[_0x1c4c('0x11')](','):null;},'comment':_0x1c4c('0x1b')},'callgroup':{'type':Sequelize[_0x1c4c('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x1c4c('0x2')]},'language':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1c4c('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x1c4c('0x2')],'allowNull':![],'defaultValue':_0x1c4c('0x1c'),'set':function(_0x4d06a3){this[_0x1c4c('0xe')](_0x1c4c('0x1d'),_0x4d06a3?_0x4d06a3[_0x1c4c('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x1c4c('0x1a')](_0x1c4c('0x1d'))?this[_0x1c4c('0x1a')](_0x1c4c('0x1d'))[_0x1c4c('0x11')](';'):null;},'comment':_0x1c4c('0x1e')},'autoframing':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'insecure':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':_0x1c4c('0x1f'),'set':function(_0x79ef38){this['setDataValue'](_0x1c4c('0x20'),_0x79ef38?_0x79ef38[_0x1c4c('0x10')](','):null);},'get':function(){return this[_0x1c4c('0x1a')]('insecure')?this[_0x1c4c('0x1a')](_0x1c4c('0x20'))[_0x1c4c('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1c4c('0x3')]('yes','no',_0x1c4c('0x21'))},'promiscredir':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':_0x1c4c('0x22')},'amaflags':{'type':Sequelize[_0x1c4c('0x2')]},'callcounter':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x1c4c('0x2')]},'template':{'type':Sequelize[_0x1c4c('0x2')]},'videosupport':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no',_0x1c4c('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'mailbox':{'type':Sequelize[_0x1c4c('0x2')]},'session_timers':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x24'),_0x1c4c('0x25'),_0x1c4c('0x26'))},'session_expires':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x28'),_0x1c4c('0x29')),'defaultValue':_0x1c4c('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x1c4c('0x2')]},'fromdomain':{'type':Sequelize[_0x1c4c('0x2')]},'fromuser':{'type':Sequelize[_0x1c4c('0x2')]},'port':{'type':Sequelize[_0x1c4c('0x27')](0x5)},'qualify':{'type':Sequelize[_0x1c4c('0x3')]('yes','no'),'defaultValue':_0x1c4c('0x17')},'keepalive':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x1c4c('0x2')]},'defaultuser':{'type':Sequelize[_0x1c4c('0x2')]},'rtptimeout':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x1c4c('0x2')]},'timert1':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'timerb':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x1c4c('0x2')]},'contactdeny':{'type':Sequelize[_0x1c4c('0x2')]},'contactacl':{'type':Sequelize[_0x1c4c('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1c4c('0x17'),'no')},'force_avp':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'icesupport':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x1c4c('0x17'),'no',_0x1c4c('0x2a'),_0x1c4c('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x1c4c('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1c4c('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x1c4c('0x2')]},'dtlscipher':{'type':Sequelize[_0x1c4c('0x2')]},'dtlscafile':{'type':Sequelize[_0x1c4c('0x2')]},'dtlscapath':{'type':Sequelize[_0x1c4c('0x2')]},'dtlssetup':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x2c'),'passive',_0x1c4c('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1c4c('0x2')]},'usereqphone':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1c4c('0x2')]},'recordofffeature':{'type':Sequelize[_0x1c4c('0x2')]},'call_limit':{'type':Sequelize[_0x1c4c('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x1c4c('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x1c4c('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x1c4c('0x2')]},'mohinterpret':{'type':Sequelize[_0x1c4c('0x2')]},'mohsuggest':{'type':Sequelize[_0x1c4c('0x2')]},'parkinglot':{'type':Sequelize[_0x1c4c('0x2')]},'description':{'type':Sequelize[_0x1c4c('0x2')]},'host':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':_0x1c4c('0x2e')},'canreinvite':{'type':Sequelize[_0x1c4c('0x3')](_0x1c4c('0x17'),'no',_0x1c4c('0x16'),_0x1c4c('0x2f'),_0x1c4c('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1c4c('0x2')]},'otherFields':{'type':Sequelize[_0x1c4c('0x2')]},'active':{'type':Sequelize[_0x1c4c('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1c4c('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x0460=['never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','passive','dynamic','update,nonat','sequelize','exports','name','friend','peer','STRING','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','info','shortinfo','rfc2833','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x836a73,_0x351d8e){var _0x539820=function(_0x3f073d){while(--_0x3f073d){_0x836a73['push'](_0x836a73['shift']());}};_0x539820(++_0x351d8e);}(_0x0460,0x108));var _0x0046=function(_0x151073,_0x54ac1e){_0x151073=_0x151073-0x0;var _0x372d58=_0x0460[_0x151073];return _0x372d58;};'use strict';var Sequelize=require(_0x0046('0x0'));module[_0x0046('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0046('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0046('0x3'),'user',_0x0046('0x4')),'allowNull':![],'defaultValue':_0x0046('0x3')},'context':{'type':Sequelize[_0x0046('0x5')],'allowNull':![],'defaultValue':_0x0046('0x6')},'callingpres':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x8'),_0x0046('0x9'),_0x0046('0xa'),_0x0046('0xb'),_0x0046('0xc'),_0x0046('0xd'),_0x0046('0xe'),_0x0046('0xf'))},'deny':{'type':Sequelize[_0x0046('0x5')]},'permit':{'type':Sequelize[_0x0046('0x5')]},'secret':{'type':Sequelize[_0x0046('0x5')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0046('0x5')],'defaultValue':_0x0046('0x10'),'set':function(_0xe3b85b){this['setDataValue'](_0x0046('0x11'),_0xe3b85b?_0xe3b85b[_0x0046('0x12')](','):null);},'get':function(){return this[_0x0046('0x13')](_0x0046('0x11'))?this[_0x0046('0x13')](_0x0046('0x11'))[_0x0046('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0046('0x7')]('rfc2833',_0x0046('0x15'),_0x0046('0x16'),'inband','auto'),'defaultValue':_0x0046('0x17')},'directmedia':{'type':Sequelize[_0x0046('0x7')]('yes','no',_0x0046('0x18'),_0x0046('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0046('0x5')]},'directmediadeny':{'type':Sequelize[_0x0046('0x5')]},'nat':{'type':Sequelize[_0x0046('0x5')],'defaultValue':_0x0046('0x1b'),'set':function(_0x1d6640){this['setDataValue']('nat',_0x1d6640?_0x1d6640['join'](','):null);},'get':function(){return this[_0x0046('0x13')](_0x0046('0x1c'))?this[_0x0046('0x13')](_0x0046('0x1c'))['split'](','):null;},'comment':_0x0046('0x1d')},'callgroup':{'type':Sequelize[_0x0046('0x5')]},'namedcallgroup':{'type':Sequelize[_0x0046('0x5')]},'pickupgroup':{'type':Sequelize[_0x0046('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x0046('0x5')]},'language':{'type':Sequelize[_0x0046('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0046('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0046('0x5')],'defaultValue':_0x0046('0x1e')},'allow':{'type':Sequelize[_0x0046('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1a5e2d){this[_0x0046('0x1f')]('allow',_0x1a5e2d?_0x1a5e2d[_0x0046('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x0046('0x13')](_0x0046('0x20'))?this[_0x0046('0x13')](_0x0046('0x20'))[_0x0046('0x14')](';'):null;},'comment':_0x0046('0x21')},'autoframing':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'insecure':{'type':Sequelize[_0x0046('0x5')],'defaultValue':'port,invite','set':function(_0x54abbe){this['setDataValue'](_0x0046('0x22'),_0x54abbe?_0x54abbe['join'](','):null);},'get':function(){return this[_0x0046('0x13')](_0x0046('0x22'))?this[_0x0046('0x13')](_0x0046('0x22'))[_0x0046('0x14')](','):null;},'comment':_0x0046('0x23')},'trustrpid':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0046('0x7')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no',_0x0046('0x24'))},'promiscredir':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x0046('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x0046('0x25')](0xb)},'setvar':{'type':Sequelize[_0x0046('0x5')]},'callerid':{'type':Sequelize[_0x0046('0x5')],'defaultValue':_0x0046('0x26')},'amaflags':{'type':Sequelize[_0x0046('0x5')]},'callcounter':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no'),'defaultValue':_0x0046('0x1a')},'busylevel':{'type':Sequelize[_0x0046('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x0046('0x7')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x0046('0x5')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no',_0x0046('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'mailbox':{'type':Sequelize[_0x0046('0x5')]},'session_timers':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x28'),_0x0046('0x29'),_0x0046('0x2a'))},'session_expires':{'type':Sequelize[_0x0046('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x0046('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x2b'),_0x0046('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x0046('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0046('0x5')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0046('0x25')](0x5)},'qualify':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no'),'defaultValue':_0x0046('0x1a')},'keepalive':{'type':Sequelize[_0x0046('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0046('0x5')]},'rtptimeout':{'type':Sequelize[_0x0046('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0046('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0046('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no',_0x0046('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0046('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x0046('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0046('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0046('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x0046('0x5')]},'contactacl':{'type':Sequelize[_0x0046('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x0046('0x5')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x0046('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x0046('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x0046('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0046('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no','fingerprint',_0x0046('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x0046('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0046('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x0046('0x5')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x0046('0x5')]},'dtlssetup':{'type':Sequelize[_0x0046('0x7')]('active',_0x0046('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0046('0x5')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x0046('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x0046('0x7')](_0x0046('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x0046('0x5')]},'parkinglot':{'type':Sequelize[_0x0046('0x5')]},'description':{'type':Sequelize[_0x0046('0x5')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x0046('0x30')},'canreinvite':{'type':Sequelize[_0x0046('0x7')]('yes','no',_0x0046('0x18'),_0x0046('0x19'),_0x0046('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0046('0x5')]},'otherFields':{'type':Sequelize[_0x0046('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0046('0x5')],'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 b828b77..3493040 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 _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x4b0c54,_0x14d188){var _0x211778=function(_0x41b870){while(--_0x41b870){_0x4b0c54['push'](_0x4b0c54['shift']());}};_0x211778(++_0x14d188);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4d85b0,_0x5dc6a5){_0x4d85b0=_0x4d85b0-0x0;var _0x53296f=_0xd6d6[_0x4d85b0];return _0x53296f;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file +var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x81bd,0x7c));var _0xd81b=function(_0x5676df,_0x14d122){_0x5676df=_0x5676df-0x0;var _0x1fb878=_0x81bd[_0x5676df];return _0x1fb878;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8430c6d..715fc3d 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 _0x21bd=['define','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x5a3d95,_0x16bee6){var _0x2928e9=function(_0x56ed85){while(--_0x56ed85){_0x5a3d95['push'](_0x5a3d95['shift']());}};_0x2928e9(++_0x16bee6);}(_0x21bd,0x191));var _0xd21b=function(_0x38f039,_0x5abebc){_0x38f039=_0x38f039-0x0;var _0x47e137=_0x21bd[_0x38f039];return _0x47e137;};'use strict';var _=require(_0xd21b('0x0'));var util=require(_0xd21b('0x1'));var logger=require('../../config/logger')(_0xd21b('0x2'));var moment=require('moment');var BPromise=require(_0xd21b('0x3'));var rp=require(_0xd21b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd21b('0x5'));var config=require(_0xd21b('0x6'));var attributes=require(_0xd21b('0x7'));module[_0xd21b('0x8')]=function(_0x6123a2,_0xdbf872){return _0x6123a2[_0xd21b('0x9')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb36=['../../config/environment','./trunk.attributes','define','Trunk','lodash','api','moment','request-promise','rimraf'];(function(_0xfdec06,_0x9fa2f4){var _0x58a539=function(_0xfc799c){while(--_0xfc799c){_0xfdec06['push'](_0xfdec06['shift']());}};_0x58a539(++_0x9fa2f4);}(_0xdb36,0x136));var _0x6db3=function(_0x57bc05,_0x443fdc){_0x57bc05=_0x57bc05-0x0;var _0x12eaf6=_0xdb36[_0x57bc05];return _0x12eaf6;};'use strict';var _=require(_0x6db3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6db3('0x1'));var moment=require(_0x6db3('0x2'));var BPromise=require('bluebird');var rp=require(_0x6db3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6db3('0x4'));var config=require(_0x6db3('0x5'));var attributes=require(_0x6db3('0x6'));module['exports']=function(_0x69d618,_0x4fbd58){return _0x69d618[_0x6db3('0x7')](_0x6db3('0x8'),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 7b76995..a344cf4 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 _0x5da1=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','Trunk','options','where','limit','include','model','attributes','map','then','GetTrunk','ShowTrunk','find','raw','bluebird'];(function(_0x250795,_0x1cd430){var _0x1cbb0f=function(_0x16c609){while(--_0x16c609){_0x250795['push'](_0x250795['shift']());}};_0x1cbb0f(++_0x1cd430);}(_0x5da1,0xbf));var _0x15da=function(_0x327f25,_0x127af0){_0x327f25=_0x327f25-0x0;var _0x9c721f=_0x5da1[_0x327f25];return _0x9c721f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x15da('0x0'));var rs=require(_0x15da('0x1'));var fs=require('fs');var Redis=require(_0x15da('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x15da('0x3'));var logger=require('../../config/logger')(_0x15da('0x4'));var config=require(_0x15da('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x15da('0x6')][_0x15da('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb73a7b,_0x2993cc,_0x2372ad){return new BPromise(function(_0x140a5b,_0x1be731){return client[_0x15da('0x8')](_0xb73a7b,_0x2372ad)['then'](function(_0x347661){logger[_0x15da('0x9')]('Trunk,\x20%s,\x20%s',_0x2993cc,_0x15da('0xa'));logger[_0x15da('0xb')](_0x15da('0xc'),_0x2993cc,'request\x20sent',JSON[_0x15da('0xd')](_0x347661));if(_0x347661['error']){if(_0x347661[_0x15da('0xe')]['code']===0x1f4){logger[_0x15da('0xe')](_0x15da('0xf'),_0x2993cc,_0x347661['error'][_0x15da('0x10')]);return _0x1be731(_0x347661[_0x15da('0xe')][_0x15da('0x10')]);}logger[_0x15da('0xe')](_0x15da('0xf'),_0x2993cc,_0x347661[_0x15da('0xe')][_0x15da('0x10')]);return _0x140a5b(_0x347661['error'][_0x15da('0x10')]);}else{logger[_0x15da('0x9')](_0x15da('0xf'),_0x2993cc,_0x15da('0xa'));_0x140a5b(_0x347661[_0x15da('0x11')][_0x15da('0x10')]);}})[_0x15da('0x12')](function(_0x133cb1){logger[_0x15da('0xe')](_0x15da('0xf'),_0x2993cc,_0x133cb1);_0x1be731(_0x133cb1);});});}exports['GetTrunk']=function(_0xeb0b75){var _0x294921=this;return new Promise(function(_0x56bbf6,_0x408c67){return db[_0x15da('0x13')]['findAll']({'raw':_0xeb0b75[_0x15da('0x14')]?_0xeb0b75[_0x15da('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xeb0b75['options']?_0xeb0b75[_0x15da('0x14')][_0x15da('0x15')]||null:null,'attributes':_0xeb0b75[_0x15da('0x14')]?_0xeb0b75[_0x15da('0x14')]['attributes']||null:null,'limit':_0xeb0b75[_0x15da('0x14')]?_0xeb0b75[_0x15da('0x14')][_0x15da('0x16')]||null:null,'include':_0xeb0b75['options']?_0xeb0b75[_0x15da('0x14')][_0x15da('0x17')]?_['map'](_0xeb0b75['options'][_0x15da('0x17')],function(_0xa9d36e){return{'model':db[_0xa9d36e[_0x15da('0x18')]],'as':_0xa9d36e['as'],'attributes':_0xa9d36e[_0x15da('0x19')],'include':_0xa9d36e['include']?_[_0x15da('0x1a')](_0xa9d36e[_0x15da('0x17')],function(_0x5df1c3){return{'model':db[_0x5df1c3[_0x15da('0x18')]],'as':_0x5df1c3['as'],'attributes':_0x5df1c3[_0x15da('0x19')],'include':_0x5df1c3[_0x15da('0x17')]?_[_0x15da('0x1a')](_0x5df1c3[_0x15da('0x17')],function(_0x47f069){return{'model':db[_0x47f069[_0x15da('0x18')]],'as':_0x47f069['as'],'attributes':_0x47f069[_0x15da('0x19')]};}):[]};}):[]};}):[]:[]})[_0x15da('0x1b')](function(_0x54d3e3){logger['info'](_0x15da('0x1c'),_0xeb0b75);logger[_0x15da('0xb')]('GetTrunk',_0xeb0b75,JSON['stringify'](_0x54d3e3));_0x56bbf6(_0x54d3e3);})['catch'](function(_0x387c6f){logger[_0x15da('0xe')]('GetTrunk',_0x387c6f[_0x15da('0x10')],_0xeb0b75);_0x408c67(_0x294921[_0x15da('0xe')](0x1f4,_0x387c6f[_0x15da('0x10')]));});});};exports[_0x15da('0x1d')]=function(_0x360b45){var _0x3814cc=this;return new Promise(function(_0x164332,_0x19217d){return db['Trunk'][_0x15da('0x1e')]({'raw':_0x360b45[_0x15da('0x14')]?_0x360b45[_0x15da('0x14')][_0x15da('0x1f')]===undefined?!![]:![]:!![],'where':_0x360b45[_0x15da('0x14')]?_0x360b45[_0x15da('0x14')][_0x15da('0x15')]||null:null,'attributes':_0x360b45[_0x15da('0x14')]?_0x360b45[_0x15da('0x14')][_0x15da('0x19')]||null:null,'include':_0x360b45[_0x15da('0x14')]?_0x360b45[_0x15da('0x14')][_0x15da('0x17')]?_[_0x15da('0x1a')](_0x360b45[_0x15da('0x14')][_0x15da('0x17')],function(_0xbce05b){return{'model':db[_0xbce05b['model']],'as':_0xbce05b['as'],'attributes':_0xbce05b['attributes'],'include':_0xbce05b['include']?_[_0x15da('0x1a')](_0xbce05b['include'],function(_0x47c3f0){return{'model':db[_0x47c3f0[_0x15da('0x18')]],'as':_0x47c3f0['as'],'attributes':_0x47c3f0[_0x15da('0x19')],'include':_0x47c3f0[_0x15da('0x17')]?_[_0x15da('0x1a')](_0x47c3f0['include'],function(_0x5bd510){return{'model':db[_0x5bd510[_0x15da('0x18')]],'as':_0x5bd510['as'],'attributes':_0x5bd510[_0x15da('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e5709){logger[_0x15da('0x9')]('ShowTrunk',_0x360b45);logger[_0x15da('0xb')](_0x15da('0x1d'),_0x360b45,JSON['stringify'](_0x5e5709));_0x164332(_0x5e5709);})['catch'](function(_0xf3e09){logger[_0x15da('0xe')](_0x15da('0x1d'),_0xf3e09[_0x15da('0x10')],_0x360b45);_0x19217d(_0x3814cc[_0x15da('0xe')](0x1f4,_0xf3e09['message']));});});}; \ No newline at end of file +var _0x2648=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','model','map','ShowTrunk','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x4b958,_0x2daa9a){var _0x3472af=function(_0x56df9c){while(--_0x56df9c){_0x4b958['push'](_0x4b958['shift']());}};_0x3472af(++_0x2daa9a);}(_0x2648,0x9e));var _0x8264=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2648[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8264('0x0'));var BPromise=require(_0x8264('0x1'));var rs=require(_0x8264('0x2'));var fs=require('fs');var Redis=require(_0x8264('0x3'));var db=require(_0x8264('0x4'))['db'];var utils=require(_0x8264('0x5'));var logger=require(_0x8264('0x6'))(_0x8264('0x7'));var config=require('../../config/environment');var jayson=require(_0x8264('0x8'));var client=jayson['client'][_0x8264('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32cb4a,_0x24c3ef,_0x1197ed){return new BPromise(function(_0x489b2a,_0x55e768){return client[_0x8264('0xa')](_0x32cb4a,_0x1197ed)[_0x8264('0xb')](function(_0x425dcb){logger[_0x8264('0xc')](_0x8264('0xd'),_0x24c3ef,_0x8264('0xe'));logger[_0x8264('0xf')](_0x8264('0x10'),_0x24c3ef,_0x8264('0xe'),JSON[_0x8264('0x11')](_0x425dcb));if(_0x425dcb[_0x8264('0x12')]){if(_0x425dcb[_0x8264('0x12')]['code']===0x1f4){logger[_0x8264('0x12')]('Trunk,\x20%s,\x20%s',_0x24c3ef,_0x425dcb[_0x8264('0x12')][_0x8264('0x13')]);return _0x55e768(_0x425dcb['error'][_0x8264('0x13')]);}logger[_0x8264('0x12')]('Trunk,\x20%s,\x20%s',_0x24c3ef,_0x425dcb[_0x8264('0x12')]['message']);return _0x489b2a(_0x425dcb[_0x8264('0x12')]['message']);}else{logger[_0x8264('0xc')](_0x8264('0xd'),_0x24c3ef,_0x8264('0xe'));_0x489b2a(_0x425dcb[_0x8264('0x14')][_0x8264('0x13')]);}})[_0x8264('0x15')](function(_0x2a4f88){logger[_0x8264('0x12')](_0x8264('0xd'),_0x24c3ef,_0x2a4f88);_0x55e768(_0x2a4f88);});});}exports[_0x8264('0x16')]=function(_0x79acaf){var _0x545d64=this;return new Promise(function(_0xb532f0,_0xecbe2d){return db[_0x8264('0x17')][_0x8264('0x18')]({'raw':_0x79acaf[_0x8264('0x19')]?_0x79acaf[_0x8264('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x79acaf[_0x8264('0x19')]?_0x79acaf[_0x8264('0x19')][_0x8264('0x1a')]||null:null,'attributes':_0x79acaf['options']?_0x79acaf[_0x8264('0x19')][_0x8264('0x1b')]||null:null,'limit':_0x79acaf['options']?_0x79acaf[_0x8264('0x19')][_0x8264('0x1c')]||null:null,'include':_0x79acaf[_0x8264('0x19')]?_0x79acaf[_0x8264('0x19')][_0x8264('0x1d')]?_['map'](_0x79acaf[_0x8264('0x19')]['include'],function(_0x15b158){return{'model':db[_0x15b158[_0x8264('0x1e')]],'as':_0x15b158['as'],'attributes':_0x15b158[_0x8264('0x1b')],'include':_0x15b158[_0x8264('0x1d')]?_[_0x8264('0x1f')](_0x15b158[_0x8264('0x1d')],function(_0x4f02cd){return{'model':db[_0x4f02cd[_0x8264('0x1e')]],'as':_0x4f02cd['as'],'attributes':_0x4f02cd[_0x8264('0x1b')],'include':_0x4f02cd[_0x8264('0x1d')]?_[_0x8264('0x1f')](_0x4f02cd['include'],function(_0x479f20){return{'model':db[_0x479f20['model']],'as':_0x479f20['as'],'attributes':_0x479f20[_0x8264('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8264('0xb')](function(_0x55b387){logger['info'](_0x8264('0x16'),_0x79acaf);logger['debug'](_0x8264('0x16'),_0x79acaf,JSON[_0x8264('0x11')](_0x55b387));_0xb532f0(_0x55b387);})['catch'](function(_0xea8376){logger[_0x8264('0x12')](_0x8264('0x16'),_0xea8376[_0x8264('0x13')],_0x79acaf);_0xecbe2d(_0x545d64[_0x8264('0x12')](0x1f4,_0xea8376[_0x8264('0x13')]));});});};exports[_0x8264('0x20')]=function(_0x48d567){var _0x51a9a0=this;return new Promise(function(_0x2bde7f,_0x2e4d87){return db['Trunk'][_0x8264('0x21')]({'raw':_0x48d567[_0x8264('0x19')]?_0x48d567[_0x8264('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x48d567['options']?_0x48d567['options']['where']||null:null,'attributes':_0x48d567[_0x8264('0x19')]?_0x48d567[_0x8264('0x19')][_0x8264('0x1b')]||null:null,'include':_0x48d567[_0x8264('0x19')]?_0x48d567[_0x8264('0x19')]['include']?_[_0x8264('0x1f')](_0x48d567[_0x8264('0x19')][_0x8264('0x1d')],function(_0x492d4d){return{'model':db[_0x492d4d[_0x8264('0x1e')]],'as':_0x492d4d['as'],'attributes':_0x492d4d['attributes'],'include':_0x492d4d['include']?_[_0x8264('0x1f')](_0x492d4d[_0x8264('0x1d')],function(_0x18bd2f){return{'model':db[_0x18bd2f[_0x8264('0x1e')]],'as':_0x18bd2f['as'],'attributes':_0x18bd2f[_0x8264('0x1b')],'include':_0x18bd2f['include']?_[_0x8264('0x1f')](_0x18bd2f[_0x8264('0x1d')],function(_0x4b0f2e){return{'model':db[_0x4b0f2e[_0x8264('0x1e')]],'as':_0x4b0f2e['as'],'attributes':_0x4b0f2e[_0x8264('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8264('0xb')](function(_0x1a64a9){logger[_0x8264('0xc')](_0x8264('0x20'),_0x48d567);logger[_0x8264('0xf')]('ShowTrunk',_0x48d567,JSON['stringify'](_0x1a64a9));_0x2bde7f(_0x1a64a9);})[_0x8264('0x15')](function(_0x3f0860){logger['error'](_0x8264('0x20'),_0x3f0860['message'],_0x48d567);_0x2e4d87(_0x51a9a0[_0x8264('0x12')](0x1f4,_0x3f0860[_0x8264('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 25dcd43..0f079d6 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 _0x355b=['addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','join','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x355b,0x175));var _0xb355=function(_0x21c7cc,_0x508133){_0x21c7cc=_0x21c7cc-0x0;var _0x4c8924=_0x355b[_0x21c7cc];return _0x4c8924;};'use strict';var multer=require(_0xb355('0x0'));var util=require(_0xb355('0x1'));var path=require(_0xb355('0x2'));var timeout=require(_0xb355('0x3'));var express=require(_0xb355('0x4'));var router=express[_0xb355('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb355('0x6'));var interaction=require(_0xb355('0x7'));var config=require(_0xb355('0x8'));var controller=require(_0xb355('0x9'));router[_0xb355('0xa')]('/',auth[_0xb355('0xb')](),controller[_0xb355('0xc')]);router[_0xb355('0xa')](_0xb355('0xd'),auth[_0xb355('0xb')](),controller[_0xb355('0xe')]);router['get']('/whoami',auth[_0xb355('0xb')](),controller[_0xb355('0xf')]);router[_0xb355('0xa')](_0xb355('0x10'),auth[_0xb355('0xb')](),controller[_0xb355('0x11')]);router['get'](_0xb355('0x12'),auth[_0xb355('0xb')](),controller['show']);router[_0xb355('0xa')](_0xb355('0x13'),controller[_0xb355('0x14')]);router['get']('/:id/open_tabs',auth[_0xb355('0xb')](),controller[_0xb355('0x15')]);router['get']('/:id/contacts',auth[_0xb355('0xb')](),controller[_0xb355('0x16')]);router['get'](_0xb355('0x17'),auth[_0xb355('0xb')](),controller[_0xb355('0x18')]);router[_0xb355('0xa')](_0xb355('0x19'),auth[_0xb355('0xb')](),controller[_0xb355('0x1a')]);router[_0xb355('0xa')](_0xb355('0x1b'),auth['isAuthenticated'](),controller['getGroups']);router[_0xb355('0xa')](_0xb355('0x1c'),auth[_0xb355('0xb')](),controller[_0xb355('0x1d')]);router[_0xb355('0xa')](_0xb355('0x1e'),auth[_0xb355('0xb')](),controller[_0xb355('0x1f')]);router[_0xb355('0xa')](_0xb355('0x20'),auth[_0xb355('0xb')](),controller[_0xb355('0x21')]);router[_0xb355('0xa')](_0xb355('0x22'),auth[_0xb355('0xb')](),controller[_0xb355('0x23')]);router[_0xb355('0xa')](_0xb355('0x24'),auth['isAuthenticated'](),controller[_0xb355('0x25')]);router['get'](_0xb355('0x26'),auth['isAuthenticated'](),controller[_0xb355('0x27')]);router[_0xb355('0xa')](_0xb355('0x28'),auth['isAuthenticated'](),controller['getFaxInteractions']);router['get'](_0xb355('0x29'),auth[_0xb355('0xb')](),controller[_0xb355('0x2a')]);router[_0xb355('0xa')](_0xb355('0x2b'),auth[_0xb355('0xb')](),controller['getTeams']);router[_0xb355('0xa')]('/:id/lists',auth[_0xb355('0xb')](),controller['getLists']);router[_0xb355('0xa')]('/:id/agents',auth[_0xb355('0xb')](),controller[_0xb355('0x2c')]);router[_0xb355('0xa')](_0xb355('0x2d'),auth[_0xb355('0xb')](),controller[_0xb355('0x2e')]);router[_0xb355('0xa')](_0xb355('0x2f'),auth[_0xb355('0xb')](),controller[_0xb355('0x30')]);router[_0xb355('0xa')](_0xb355('0x31'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xb355('0xa')](_0xb355('0x32'),auth['isAuthenticated'](),controller[_0xb355('0x33')]);router[_0xb355('0xa')](_0xb355('0x34'),auth[_0xb355('0xb')](),controller[_0xb355('0x35')]);router['get'](_0xb355('0x36'),auth[_0xb355('0xb')](),controller[_0xb355('0x37')]);router[_0xb355('0xa')]('/:id/whatsapp_accounts',auth[_0xb355('0xb')](),controller[_0xb355('0x38')]);router['get'](_0xb355('0x39'),auth[_0xb355('0xb')](),controller['getSquareProjects']);router[_0xb355('0xa')](_0xb355('0x3a'),auth[_0xb355('0xb')](),controller[_0xb355('0x3b')]);router['get'](_0xb355('0x3c'),auth['isAuthenticated'](),controller[_0xb355('0x3d')]);router[_0xb355('0x3e')]('/:id/contacts',auth[_0xb355('0xb')](),controller[_0xb355('0x3f')]);router[_0xb355('0x3e')]('/',auth[_0xb355('0xb')](),controller[_0xb355('0x40')]);router['post'](_0xb355('0x41'),auth[_0xb355('0xb')](),controller['bulkCreate']);router['post'](_0xb355('0x17'),auth['isAuthenticated'](),controller[_0xb355('0x42')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c3022,_0x2a2e71,_0x4ca1c4){_0x4ca1c4(null,path[_0xb355('0x43')](config['root'],_0xb355('0x44')));},'filename':function(_0xe4e8df,_0x5e3978,_0x34c0a5){_0x34c0a5(null,util[_0xb355('0x45')](_0xb355('0x46'),Date['now'](),_0x5e3978[_0xb355('0x47')]));}})});router[_0xb355('0x3e')](_0xb355('0x13'),upload[_0xb355('0x48')](_0xb355('0x49')),controller[_0xb355('0x4a')]);router['post'](_0xb355('0x4b'),auth[_0xb355('0xb')](),controller[_0xb355('0x4c')]);router[_0xb355('0x3e')](_0xb355('0x4d'),auth[_0xb355('0xb')](),controller['logout']);router['post'](_0xb355('0x4e'),auth[_0xb355('0xb')](),controller[_0xb355('0x4f')]);router[_0xb355('0x3e')](_0xb355('0x50'),auth[_0xb355('0xb')](),controller[_0xb355('0x51')]);router[_0xb355('0x3e')](_0xb355('0x2b'),auth['isAuthenticated'](),controller['addTeams']);router[_0xb355('0x3e')](_0xb355('0x52'),auth[_0xb355('0xb')](),controller[_0xb355('0x53')]);router[_0xb355('0x3e')](_0xb355('0x54'),auth[_0xb355('0xb')](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth[_0xb355('0xb')](),controller[_0xb355('0x55')]);router['post'](_0xb355('0x56'),auth[_0xb355('0xb')](),controller[_0xb355('0x57')]);router[_0xb355('0x3e')](_0xb355('0x58'),auth[_0xb355('0xb')](),controller[_0xb355('0x59')]);router[_0xb355('0x3e')](_0xb355('0x5a'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xb355('0x3e')](_0xb355('0x2f'),auth[_0xb355('0xb')](),controller[_0xb355('0x5b')]);router[_0xb355('0x3e')](_0xb355('0x31'),auth[_0xb355('0xb')](),controller['addMailAccounts']);router[_0xb355('0x3e')](_0xb355('0x32'),auth[_0xb355('0xb')](),controller[_0xb355('0x5c')]);router[_0xb355('0x3e')](_0xb355('0x34'),auth['isAuthenticated'](),controller[_0xb355('0x5d')]);router[_0xb355('0x3e')](_0xb355('0x36'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xb355('0x3e')](_0xb355('0x5e'),auth[_0xb355('0xb')](),controller[_0xb355('0x5f')]);router['post']('/:id/square_projects',auth[_0xb355('0xb')](),controller[_0xb355('0x60')]);router[_0xb355('0x3e')](_0xb355('0x3c'),auth[_0xb355('0xb')](),controller[_0xb355('0x61')]);router[_0xb355('0x62')]('/:id',auth[_0xb355('0xb')](),controller[_0xb355('0x63')]);router['put'](_0xb355('0x64'),auth['isAuthenticated'](),controller['changePassword']);router['delete']('/:id/queues',auth[_0xb355('0xb')](),controller[_0xb355('0x65')]);router[_0xb355('0x66')](_0xb355('0x2b'),auth[_0xb355('0xb')](),controller[_0xb355('0x67')]);router['delete'](_0xb355('0x12'),auth[_0xb355('0xb')](),controller[_0xb355('0x68')]);router[_0xb355('0x66')](_0xb355('0x52'),auth[_0xb355('0xb')](),controller[_0xb355('0x69')]);router[_0xb355('0x66')](_0xb355('0x54'),auth[_0xb355('0xb')](),controller['removeMailInteractions']);router[_0xb355('0x66')]('/:id/fax_interactions',auth[_0xb355('0xb')](),controller[_0xb355('0x6a')]);router[_0xb355('0x66')](_0xb355('0x56'),auth[_0xb355('0xb')](),controller[_0xb355('0x6b')]);router['delete']('/:id/openchannel_interactions',auth[_0xb355('0xb')](),controller['removeOpenchannelInteractions']);router[_0xb355('0x66')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0xb355('0x6c')]);router[_0xb355('0x66')](_0xb355('0x2f'),auth[_0xb355('0xb')](),controller[_0xb355('0x6d')]);router['delete'](_0xb355('0x31'),auth[_0xb355('0xb')](),controller['removeMailAccounts']);router[_0xb355('0x66')]('/:id/openchannel_accounts',auth[_0xb355('0xb')](),controller[_0xb355('0x6e')]);router[_0xb355('0x66')](_0xb355('0x34'),auth['isAuthenticated'](),controller[_0xb355('0x6f')]);router[_0xb355('0x66')](_0xb355('0x36'),auth['isAuthenticated'](),controller['removeChatWebsites']);router['delete']('/:id/whatsapp_accounts',auth[_0xb355('0xb')](),controller[_0xb355('0x70')]);router[_0xb355('0x66')]('/:id/square_projects',auth[_0xb355('0xb')](),controller['removeSquareProjects']);router['delete'](_0xb355('0x3c'),auth['isAuthenticated'](),controller[_0xb355('0x71')]);module['exports']=router; \ No newline at end of file +var _0x5499=['/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','/:id/queues','diskStorage','root','server/files/images/','format','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addMailAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/square_projects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','/describe','isAuthenticated','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getQueues','getVoiceQueuesRt','getGroups','getRecordings','getScreenRecordings','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects'];(function(_0x2ce364,_0x5b17b1){var _0x2d4a34=function(_0x353731){while(--_0x353731){_0x2ce364['push'](_0x2ce364['shift']());}};_0x2d4a34(++_0x5b17b1);}(_0x5499,0x117));var _0x9549=function(_0xca6909,_0x31d421){_0xca6909=_0xca6909-0x0;var _0x44d08e=_0x5499[_0xca6909];return _0x44d08e;};'use strict';var multer=require(_0x9549('0x0'));var util=require(_0x9549('0x1'));var path=require(_0x9549('0x2'));var timeout=require(_0x9549('0x3'));var express=require('express');var router=express[_0x9549('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9549('0x5'));var interaction=require(_0x9549('0x6'));var config=require('../../config/environment');var controller=require(_0x9549('0x7'));router[_0x9549('0x8')]('/',auth['isAuthenticated'](),controller[_0x9549('0x9')]);router[_0x9549('0x8')](_0x9549('0xa'),auth[_0x9549('0xb')](),controller['describe']);router[_0x9549('0x8')](_0x9549('0xc'),auth[_0x9549('0xb')](),controller[_0x9549('0xd')]);router['get'](_0x9549('0xe'),auth[_0x9549('0xb')](),controller[_0x9549('0xf')]);router[_0x9549('0x8')](_0x9549('0x10'),auth[_0x9549('0xb')](),controller[_0x9549('0x11')]);router[_0x9549('0x8')](_0x9549('0x12'),controller[_0x9549('0x13')]);router['get'](_0x9549('0x14'),auth[_0x9549('0xb')](),controller['getOpenTabs']);router[_0x9549('0x8')](_0x9549('0x15'),auth[_0x9549('0xb')](),controller['getContacts']);router[_0x9549('0x8')]('/:id/queues',auth[_0x9549('0xb')](),controller[_0x9549('0x16')]);router[_0x9549('0x8')]('/:id/queues_rt',auth[_0x9549('0xb')](),controller[_0x9549('0x17')]);router[_0x9549('0x8')]('/:id/groups',auth[_0x9549('0xb')](),controller[_0x9549('0x18')]);router[_0x9549('0x8')]('/:id/recordings',auth[_0x9549('0xb')](),controller[_0x9549('0x19')]);router[_0x9549('0x8')]('/:id/screen_recordings',auth[_0x9549('0xb')](),controller[_0x9549('0x1a')]);router[_0x9549('0x8')]('/:id/chat/interactions',auth[_0x9549('0xb')](),controller['getChatInteractions']);router[_0x9549('0x8')]('/:id/openchannel/interactions',auth[_0x9549('0xb')](),controller[_0x9549('0x1b')]);router[_0x9549('0x8')](_0x9549('0x1c'),auth[_0x9549('0xb')](),controller['getMailInteractions']);router['get'](_0x9549('0x1d'),auth['isAuthenticated'](),controller[_0x9549('0x1e')]);router[_0x9549('0x8')](_0x9549('0x1f'),auth[_0x9549('0xb')](),controller[_0x9549('0x20')]);router[_0x9549('0x8')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x9549('0x21')]);router['get'](_0x9549('0x22'),auth[_0x9549('0xb')](),controller[_0x9549('0x23')]);router['get'](_0x9549('0x24'),auth['isAuthenticated'](),controller['getLists']);router[_0x9549('0x8')](_0x9549('0x25'),auth['isAuthenticated'](),controller[_0x9549('0x26')]);router[_0x9549('0x8')](_0x9549('0x27'),auth[_0x9549('0xb')](),controller[_0x9549('0x28')]);router[_0x9549('0x8')](_0x9549('0x29'),auth[_0x9549('0xb')](),controller[_0x9549('0x2a')]);router['get'](_0x9549('0x2b'),auth[_0x9549('0xb')](),controller[_0x9549('0x2c')]);router[_0x9549('0x8')](_0x9549('0x2d'),auth[_0x9549('0xb')](),controller['getOpenchannelAccounts']);router[_0x9549('0x8')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x9549('0x2e')]);router['get']('/:id/chat_websites',auth[_0x9549('0xb')](),controller[_0x9549('0x2f')]);router[_0x9549('0x8')](_0x9549('0x30'),auth['isAuthenticated'](),controller[_0x9549('0x31')]);router['get']('/:id/square_projects',auth[_0x9549('0xb')](),controller[_0x9549('0x32')]);router[_0x9549('0x8')](_0x9549('0x33'),auth['isAuthenticated'](),controller[_0x9549('0x34')]);router[_0x9549('0x8')](_0x9549('0x35'),auth[_0x9549('0xb')](),controller[_0x9549('0x36')]);router[_0x9549('0x37')](_0x9549('0x15'),auth[_0x9549('0xb')](),controller[_0x9549('0x38')]);router[_0x9549('0x37')]('/',auth[_0x9549('0xb')](),controller['create']);router['post'](_0x9549('0x39'),auth[_0x9549('0xb')](),controller[_0x9549('0x3a')]);router['post'](_0x9549('0x3b'),auth[_0x9549('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x9549('0x3c')]({'destination':function(_0x30abe1,_0x1350f7,_0x1050e3){_0x1050e3(null,path['join'](config[_0x9549('0x3d')],_0x9549('0x3e')));},'filename':function(_0x383d29,_0x5ba6ad,_0x42c6f2){_0x42c6f2(null,util[_0x9549('0x3f')]('%s-%s',Date['now'](),_0x5ba6ad[_0x9549('0x40')]));}})});router['post']('/:id/avatar',upload[_0x9549('0x41')](_0x9549('0x42')),controller[_0x9549('0x43')]);router[_0x9549('0x37')](_0x9549('0x44'),auth[_0x9549('0xb')](),controller[_0x9549('0x45')]);router[_0x9549('0x37')]('/:id/logout',auth[_0x9549('0xb')](),controller[_0x9549('0x46')]);router[_0x9549('0x37')](_0x9549('0x47'),auth[_0x9549('0xb')](),controller[_0x9549('0x48')]);router[_0x9549('0x37')](_0x9549('0x49'),auth[_0x9549('0xb')](),controller[_0x9549('0x4a')]);router[_0x9549('0x37')]('/:id/teams',auth[_0x9549('0xb')](),controller['addTeams']);router[_0x9549('0x37')](_0x9549('0x4b'),auth[_0x9549('0xb')](),controller[_0x9549('0x4c')]);router['post'](_0x9549('0x4d'),auth[_0x9549('0xb')](),controller[_0x9549('0x4e')]);router[_0x9549('0x37')](_0x9549('0x4f'),auth[_0x9549('0xb')](),controller[_0x9549('0x50')]);router[_0x9549('0x37')](_0x9549('0x51'),auth[_0x9549('0xb')](),controller[_0x9549('0x52')]);router[_0x9549('0x37')](_0x9549('0x53'),auth['isAuthenticated'](),controller[_0x9549('0x54')]);router['post'](_0x9549('0x55'),auth[_0x9549('0xb')](),controller['addWhatsappInteractions']);router[_0x9549('0x37')](_0x9549('0x29'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x9549('0x2b'),auth[_0x9549('0xb')](),controller[_0x9549('0x56')]);router['post'](_0x9549('0x2d'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x9549('0x37')](_0x9549('0x57'),auth['isAuthenticated'](),controller[_0x9549('0x58')]);router['post'](_0x9549('0x59'),auth[_0x9549('0xb')](),controller[_0x9549('0x5a')]);router[_0x9549('0x37')](_0x9549('0x30'),auth[_0x9549('0xb')](),controller[_0x9549('0x5b')]);router[_0x9549('0x37')](_0x9549('0x5c'),auth[_0x9549('0xb')](),controller['addSquareProjects']);router[_0x9549('0x37')](_0x9549('0x35'),auth[_0x9549('0xb')](),controller[_0x9549('0x5d')]);router[_0x9549('0x5e')](_0x9549('0x10'),auth['isAuthenticated'](),controller[_0x9549('0x5f')]);router['put'](_0x9549('0x60'),auth[_0x9549('0xb')](),controller[_0x9549('0x61')]);router[_0x9549('0x62')]('/:id/queues',auth[_0x9549('0xb')](),controller[_0x9549('0x63')]);router['delete'](_0x9549('0x22'),auth[_0x9549('0xb')](),controller[_0x9549('0x64')]);router[_0x9549('0x62')](_0x9549('0x10'),auth[_0x9549('0xb')](),controller[_0x9549('0x65')]);router[_0x9549('0x62')](_0x9549('0x4b'),auth[_0x9549('0xb')](),controller[_0x9549('0x66')]);router[_0x9549('0x62')]('/:id/mail_interactions',auth[_0x9549('0xb')](),controller['removeMailInteractions']);router[_0x9549('0x62')]('/:id/fax_interactions',auth[_0x9549('0xb')](),controller[_0x9549('0x67')]);router[_0x9549('0x62')](_0x9549('0x51'),auth[_0x9549('0xb')](),controller['removeSmsInteractions']);router[_0x9549('0x62')](_0x9549('0x53'),auth[_0x9549('0xb')](),controller[_0x9549('0x68')]);router[_0x9549('0x62')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x9549('0x69')]);router[_0x9549('0x62')](_0x9549('0x29'),auth[_0x9549('0xb')](),controller['removeFaxAccounts']);router[_0x9549('0x62')](_0x9549('0x2b'),auth[_0x9549('0xb')](),controller['removeMailAccounts']);router[_0x9549('0x62')](_0x9549('0x2d'),auth[_0x9549('0xb')](),controller[_0x9549('0x6a')]);router[_0x9549('0x62')](_0x9549('0x57'),auth[_0x9549('0xb')](),controller['removeSmsAccounts']);router[_0x9549('0x62')]('/:id/chat_websites',auth[_0x9549('0xb')](),controller['removeChatWebsites']);router[_0x9549('0x62')](_0x9549('0x30'),auth[_0x9549('0xb')](),controller[_0x9549('0x6b')]);router[_0x9549('0x62')](_0x9549('0x5c'),auth[_0x9549('0xb')](),controller[_0x9549('0x6c')]);router[_0x9549('0x62')](_0x9549('0x35'),auth[_0x9549('0xb')](),controller['removeApiKey']);module[_0x9549('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 831bdb1..caec6c3 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 _0xb377=['util','lodash','exports','STRING','name','setDataValue','defaultuser','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','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]','\x22\x22\x20<>','accept','refuse','originate','uas','fingerprint','active','passive','actpass','nonat','update,nonat','TEXT','showWebBar','get','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment'];(function(_0x48ad97,_0x588ecf){var _0x40f742=function(_0x48c0b9){while(--_0x48c0b9){_0x48ad97['push'](_0x48ad97['shift']());}};_0x40f742(++_0x588ecf);}(_0xb377,0x1b6));var _0x7b37=function(_0x42f0c8,_0x1222e8){_0x42f0c8=_0x42f0c8-0x0;var _0x5a943f=_0xb377[_0x42f0c8];return _0x5a943f;};'use strict';var Sequelize=require(_0x7b37('0x0'));var moment=require(_0x7b37('0x1'));var util=require(_0x7b37('0x2'));var _=require(_0x7b37('0x3'));module[_0x7b37('0x4')]={'name':{'type':Sequelize[_0x7b37('0x5')],'allowNull':![],'unique':_0x7b37('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3c4851){this[_0x7b37('0x7')](_0x7b37('0x6'),_0x3c4851);this[_0x7b37('0x7')](_0x7b37('0x8'),_0x3c4851);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x409d34){this['setDataValue']('fullname',_0x409d34);this[_0x7b37('0x7')](_0x7b37('0x9'),util[_0x7b37('0xa')](_0x7b37('0xb'),_0x409d34,this[_0x7b37('0xc')](_0x7b37('0xd'))));}},'alias':{'type':Sequelize[_0x7b37('0x5')]},'email':{'type':Sequelize[_0x7b37('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x22e0a9){if(_0x22e0a9){this[_0x7b37('0x7')]('email',_0x22e0a9['toLowerCase']());}}},'role':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0xf'),_0x7b37('0x10'),_0x7b37('0x11'),_0x7b37('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x7b37('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x7b37('0x5')],'defaultValue':_0x7b37('0x13')},'internal':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':![],'unique':_0x7b37('0xd'),'set':function(_0x1a381a){this[_0x7b37('0x7')](_0x7b37('0xd'),_0x1a381a);this[_0x7b37('0x7')](_0x7b37('0x15'),_0x1a381a);this[_0x7b37('0x7')](_0x7b37('0x9'),util['format']('\x22%s\x22\x20<%s>',this[_0x7b37('0xc')]('fullname'),_0x1a381a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7b37('0x5')]},'mobile':{'type':Sequelize[_0x7b37('0x5')]},'address':{'type':Sequelize[_0x7b37('0x5')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x7b37('0x5')]},'city':{'type':Sequelize[_0x7b37('0x5')]},'country':{'type':Sequelize[_0x7b37('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x7b37('0x17')},'lastPauseAt':{'type':Sequelize[_0x7b37('0x18')]},'chatCapacity':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x7b37('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![],'defaultValue':_0x7b37('0x19')},'ipaddr':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x7b37('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x1a'),_0x7b37('0x10'),_0x7b37('0x1b')),'allowNull':!![],'defaultValue':_0x7b37('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7b37('0x1c')},'callingpres':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x1d'),_0x7b37('0x1e'),'ALLOWED_FAILED_SCREEN',_0x7b37('0x1f'),_0x7b37('0x20'),_0x7b37('0x21'),_0x7b37('0x22'),_0x7b37('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7b37('0x24'),'set':function(_0x1710f3){this[_0x7b37('0x7')]('transport',_0x1710f3?_0x1710f3[_0x7b37('0x25')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x7b37('0xc')](_0x7b37('0x26'))['split'](','):null;},'comment':_0x7b37('0x27')},'dtmfmode':{'type':Sequelize[_0x7b37('0xe')]('rfc2833','info',_0x7b37('0x28'),'inband','auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x7b37('0xe')]('yes','no','nonat',_0x7b37('0x29'),_0x7b37('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x33606f){this[_0x7b37('0x7')](_0x7b37('0x2c'),_0x33606f?_0x33606f[_0x7b37('0x25')](','):null);},'get':function(){return this[_0x7b37('0xc')](_0x7b37('0x2c'))?this[_0x7b37('0xc')](_0x7b37('0x2c'))['split'](','):null;},'comment':_0x7b37('0x2d')},'callgroup':{'type':Sequelize[_0x7b37('0x5')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x7b37('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x7b37('0x5')]},'language':{'type':Sequelize[_0x7b37('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7b37('0x5')]},'disallow':{'type':Sequelize[_0x7b37('0x5')],'allowNull':![],'defaultValue':_0x7b37('0x2e')},'allow':{'type':Sequelize[_0x7b37('0x5')],'allowNull':![],'defaultValue':_0x7b37('0x2f'),'set':function(_0x2e9062){this[_0x7b37('0x7')]('allow',_0x2e9062?_0x2e9062[_0x7b37('0x25')](';'):_0x7b37('0x2f'));},'get':function(){return this[_0x7b37('0xc')](_0x7b37('0x30'))?this[_0x7b37('0xc')](_0x7b37('0x30'))[_0x7b37('0x31')](';'):null;},'comment':_0x7b37('0x32')},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![],'set':function(_0x212b41){this[_0x7b37('0x7')](_0x7b37('0x33'),_0x212b41?_0x212b41[_0x7b37('0x25')](','):null);},'get':function(){return this[_0x7b37('0xc')](_0x7b37('0x33'))?this[_0x7b37('0xc')](_0x7b37('0x33'))[_0x7b37('0x31')](','):null;},'comment':_0x7b37('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7b37('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x7b37('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x7b37('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![],'defaultValue':_0x7b37('0x35')},'amaflags':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x7b37('0x2b')},'busylevel':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x7b37('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x36'),_0x7b37('0x37'),_0x7b37('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0x7b37('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x7b37('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x7b37('0x2b')},'keepalive':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7b37('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x7b37('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x7b37('0xe')]('yes','no',_0x7b37('0x3a'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x3b'),_0x7b37('0x3c'),_0x7b37('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x7b37('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7b37('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no',_0x7b37('0x3e'),'update',_0x7b37('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x7b37('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x7b37('0x18')]},'passwordResetAt':{'type':Sequelize[_0x7b37('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x7b37('0x40')]},'showWebBar':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0,'set':function(_0x3a0e8e){this[_0x7b37('0x7')](_0x7b37('0x41'),_0x3a0e8e);var _0xc18f8a=this[_0x7b37('0x42')]({'plain':!![]});switch(_0x3a0e8e){case 0x0:case 0x1:var _0x39047f=_0xc18f8a[_0x7b37('0x26')]?_['isArray'](_0xc18f8a[_0x7b37('0x26')])?_0xc18f8a['transport'][_0x7b37('0x25')]():_0xc18f8a[_0x7b37('0x26')]:_0x7b37('0x24');if(_0x39047f===_0x7b37('0x43')){_0x39047f=_0x7b37('0x24');}this[_0x7b37('0x7')](_0x7b37('0x26'),_0x39047f);this['setDataValue'](_0x7b37('0x44'),'no');this[_0x7b37('0x7')](_0x7b37('0x45'),null);this[_0x7b37('0x7')](_0x7b37('0x46'),null);this[_0x7b37('0x7')](_0x7b37('0x47'),null);this['setDataValue'](_0x7b37('0x48'),null);this[_0x7b37('0x7')](_0x7b37('0x49'),null);this[_0x7b37('0x7')](_0x7b37('0x4a'),null);this[_0x7b37('0x7')](_0x7b37('0x4b'),null);this['setDataValue'](_0x7b37('0x4c'),null);this[_0x7b37('0x7')](_0x7b37('0x4d'),'no');break;case 0x2:this[_0x7b37('0x7')](_0x7b37('0x26'),'wss');this[_0x7b37('0x7')](_0x7b37('0x44'),_0x7b37('0x2b'));this['setDataValue'](_0x7b37('0x45'),_0x7b37('0x2b'));this[_0x7b37('0x7')](_0x7b37('0x46'),'yes');this[_0x7b37('0x7')](_0x7b37('0x47'),_0x7b37('0x2b'));this[_0x7b37('0x7')]('dtlsenable',_0x7b37('0x2b'));this[_0x7b37('0x7')](_0x7b37('0x49'),'no');this[_0x7b37('0x7')]('dtlssetup',_0x7b37('0x3d'));this[_0x7b37('0x7')](_0x7b37('0x4b'),_0xc18f8a[_0x7b37('0x4b')]||'/etc/pki/tls/certs/motion.crt');this[_0x7b37('0x7')](_0x7b37('0x4c'),_0xc18f8a['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0x7b37('0x7')](_0x7b37('0x4d'),_0x7b37('0x2b'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xa52a15){this[_0x7b37('0x7')](_0x7b37('0x4e'),_0xa52a15?_0xa52a15[_0x7b37('0x25')](','):[]);},'get':function(){return this[_0x7b37('0xc')](_0x7b37('0x4e'))?_[_0x7b37('0x4f')](this[_0x7b37('0xc')]('permissions')[_0x7b37('0x31')](','),function(_0x120387){return parseInt(_0x120387,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x7b37('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x7b37('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x7b37('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7b37('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x7b37('0xe')](_0x7b37('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x7b37('0x50')],'get':function(){return this[_0x7b37('0xc')](_0x7b37('0x51'))?this[_0x7b37('0xc')](_0x7b37('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x7b37('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x7b37('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![],'set':function(_0x4ffd44){if(typeof _0x4ffd44===_0x7b37('0x52')){var _0x4306e0=_0x4ffd44==='1'?!![]:_0x4ffd44==='0'?![]:_0x4ffd44==='true'?!![]:_0x4ffd44===_0x7b37('0x53')?![]:![];this['setDataValue'](_0x7b37('0x54'),_0x4306e0);}else{this['setDataValue'](_0x7b37('0x54'),_0x4ffd44);}}},'blocked':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![],'set':function(_0x3e9198){this[_0x7b37('0x7')](_0x7b37('0x55'),_0x3e9198);if(_0x3e9198===!![]){this[_0x7b37('0x7')](_0x7b37('0x56'),moment());this[_0x7b37('0x7')]('loginAttempts',0x0);}else{this[_0x7b37('0x7')](_0x7b37('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x7b37('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x7b37('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x7b37('0x14')](0x5)[_0x7b37('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x7b37('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x3248=['blocked','blockedAt','loginAttempts','UNSIGNED','moment','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','user','agent','telephone','local','INTEGER','accountcode','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','peer','friend','from-sip','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','uac','uas','fingerprint','certificate','passive','actpass','nonat','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','dtlsenable','dtlsverify','dtlssetup','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording'];(function(_0x5dee21,_0x14e777){var _0x39b257=function(_0x5bfd9d){while(--_0x5bfd9d){_0x5dee21['push'](_0x5dee21['shift']());}};_0x39b257(++_0x14e777);}(_0x3248,0x1bc));var _0x8324=function(_0x5a5598,_0x37c82e){_0x5a5598=_0x5a5598-0x0;var _0x77087b=_0x3248[_0x5a5598];return _0x77087b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8324('0x0'));var util=require('util');var _=require('lodash');module[_0x8324('0x1')]={'name':{'type':Sequelize[_0x8324('0x2')],'allowNull':![],'unique':_0x8324('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x970bee){this[_0x8324('0x4')](_0x8324('0x3'),_0x970bee);this['setDataValue'](_0x8324('0x5'),_0x970bee);},'comment':_0x8324('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x25ee7a){this[_0x8324('0x4')](_0x8324('0x7'),_0x25ee7a);this[_0x8324('0x4')]('callerid',util[_0x8324('0x8')](_0x8324('0x9'),_0x25ee7a,this[_0x8324('0xa')](_0x8324('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8324('0x2')],'allowNull':![],'unique':_0x8324('0xc'),'validate':{'isEmail':!![]},'set':function(_0x4f61a4){if(_0x4f61a4){this[_0x8324('0x4')](_0x8324('0xc'),_0x4f61a4['toLowerCase']());}}},'role':{'type':Sequelize['ENUM']('admin',_0x8324('0xd'),_0x8324('0xe'),_0x8324('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x8324('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x8324('0x10')},'internal':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':![],'unique':_0x8324('0xb'),'set':function(_0x13a81f){this[_0x8324('0x4')]('internal',_0x13a81f);this[_0x8324('0x4')](_0x8324('0x12'),_0x13a81f);this[_0x8324('0x4')](_0x8324('0x13'),util[_0x8324('0x8')]('\x22%s\x22\x20<%s>',this[_0x8324('0xa')](_0x8324('0x7')),_0x13a81f));}},'salt':{'type':Sequelize[_0x8324('0x2')]},'phone':{'type':Sequelize[_0x8324('0x2')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8324('0x2')]},'country':{'type':Sequelize[_0x8324('0x2')]},'online':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x8324('0x15')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8324('0x2')],'defaultValue':_0x8324('0x16')},'lastPauseAt':{'type':Sequelize[_0x8324('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8324('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8324('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8324('0x17')},'ipaddr':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x8324('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend',_0x8324('0xd'),_0x8324('0x18')),'allowNull':!![],'defaultValue':_0x8324('0x19')},'context':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![],'defaultValue':_0x8324('0x1a')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x8324('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x8324('0x1c'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x8324('0x1d')),'allowNull':!![]},'deny':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![],'defaultValue':_0x8324('0x1e'),'set':function(_0x509589){this[_0x8324('0x4')](_0x8324('0x1f'),_0x509589?_0x509589[_0x8324('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x8324('0x1f'))?this[_0x8324('0xa')]('transport')[_0x8324('0x21')](','):null;},'comment':_0x8324('0x22')},'dtmfmode':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x24'),_0x8324('0x25'),_0x8324('0x26'),_0x8324('0x27'),_0x8324('0x28')),'allowNull':!![],'defaultValue':_0x8324('0x24')},'directmedia':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no','nonat',_0x8324('0x2a'),_0x8324('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x1f37b7){this[_0x8324('0x4')](_0x8324('0x2c'),_0x1f37b7?_0x1f37b7[_0x8324('0x20')](','):null);},'get':function(){return this[_0x8324('0xa')](_0x8324('0x2c'))?this[_0x8324('0xa')](_0x8324('0x2c'))['split'](','):null;},'comment':_0x8324('0x2d')},'callgroup':{'type':Sequelize[_0x8324('0x2')]},'namedcallgroup':{'type':Sequelize[_0x8324('0x2')]},'pickupgroup':{'type':Sequelize[_0x8324('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x8324('0x2')]},'language':{'type':Sequelize[_0x8324('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8324('0x2')]},'disallow':{'type':Sequelize[_0x8324('0x2')],'allowNull':![],'defaultValue':_0x8324('0x2e')},'allow':{'type':Sequelize[_0x8324('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3ecc37){this[_0x8324('0x4')](_0x8324('0x2f'),_0x3ecc37?_0x3ecc37['join'](';'):_0x8324('0x30'));},'get':function(){return this[_0x8324('0xa')](_0x8324('0x2f'))?this['getDataValue'](_0x8324('0x2f'))[_0x8324('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![],'set':function(_0x47f5a0){this[_0x8324('0x4')](_0x8324('0x31'),_0x47f5a0?_0x47f5a0[_0x8324('0x20')](','):null);},'get':function(){return this[_0x8324('0xa')](_0x8324('0x31'))?this[_0x8324('0xa')](_0x8324('0x31'))['split'](','):null;},'comment':_0x8324('0x32')},'trustrpid':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x8324('0x29'),'no',_0x8324('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8324('0x23')]('yes','no'),'allowNull':!![],'defaultValue':_0x8324('0x29')},'busylevel':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8324('0x23')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8324('0x23')]('yes','no',_0x8324('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x8324('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x35'),_0x8324('0x36')),'allowNull':!![],'defaultValue':_0x8324('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':_0x8324('0x29')},'keepalive':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8324('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x8324('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no',_0x8324('0x37'),_0x8324('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8324('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8324('0x23')]('active',_0x8324('0x39'),_0x8324('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x8324('0x29'),'no',_0x8324('0x3b'),'update',_0x8324('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8324('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0x8324('0x15')]},'passwordResetAt':{'type':Sequelize[_0x8324('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8324('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2263a3){this['setDataValue'](_0x8324('0x3e'),_0x2263a3);var _0x854eb1=this[_0x8324('0x3f')]({'plain':!![]});switch(_0x2263a3){case 0x0:case 0x1:var _0x3288d6=_0x854eb1[_0x8324('0x1f')]?_[_0x8324('0x40')](_0x854eb1[_0x8324('0x1f')])?_0x854eb1[_0x8324('0x1f')][_0x8324('0x20')]():_0x854eb1[_0x8324('0x1f')]:_0x8324('0x1e');if(_0x3288d6===_0x8324('0x41')){_0x3288d6=_0x8324('0x1e');}this['setDataValue'](_0x8324('0x1f'),_0x3288d6);this['setDataValue'](_0x8324('0x42'),'no');this[_0x8324('0x4')]('avpf',null);this[_0x8324('0x4')](_0x8324('0x43'),null);this[_0x8324('0x4')](_0x8324('0x44'),null);this[_0x8324('0x4')]('dtlsenable',null);this['setDataValue']('dtlsverify',null);this[_0x8324('0x4')]('dtlssetup',null);this[_0x8324('0x4')](_0x8324('0x45'),null);this['setDataValue'](_0x8324('0x46'),null);this[_0x8324('0x4')](_0x8324('0x47'),'no');break;case 0x2:this['setDataValue']('transport','wss');this[_0x8324('0x4')](_0x8324('0x42'),_0x8324('0x29'));this['setDataValue'](_0x8324('0x48'),'yes');this[_0x8324('0x4')](_0x8324('0x43'),'yes');this[_0x8324('0x4')](_0x8324('0x44'),_0x8324('0x29'));this[_0x8324('0x4')](_0x8324('0x49'),_0x8324('0x29'));this[_0x8324('0x4')](_0x8324('0x4a'),'no');this[_0x8324('0x4')](_0x8324('0x4b'),'actpass');this[_0x8324('0x4')]('dtlscertfile',_0x854eb1[_0x8324('0x45')]||'/etc/pki/tls/certs/motion.crt');this[_0x8324('0x4')]('dtlsprivatekey',_0x854eb1[_0x8324('0x46')]||_0x8324('0x4c'));this[_0x8324('0x4')](_0x8324('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x8324('0x3d')],'set':function(_0x4d6188){this[_0x8324('0x4')](_0x8324('0x4d'),_0x4d6188?_0x4d6188[_0x8324('0x20')](','):[]);},'get':function(){return this[_0x8324('0xa')]('permissions')?_['map'](this[_0x8324('0xa')](_0x8324('0x4d'))['split'](','),function(_0x38026c){return parseInt(_0x38026c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8324('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8324('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8324('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x8324('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8324('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x8324('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8324('0x23')](_0x8324('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x8324('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8324('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8324('0x4e')],'get':function(){return this[_0x8324('0xa')](_0x8324('0x4f'))?this[_0x8324('0xa')](_0x8324('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0x8324('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8324('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![],'set':function(_0x4c2743){if(typeof _0x4c2743===_0x8324('0x50')){var _0x1e4fbe=_0x4c2743==='1'?!![]:_0x4c2743==='0'?![]:_0x4c2743===_0x8324('0x51')?!![]:_0x4c2743===_0x8324('0x52')?![]:![];this[_0x8324('0x4')](_0x8324('0x53'),_0x1e4fbe);}else{this['setDataValue'](_0x8324('0x53'),_0x4c2743);}}},'blocked':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![],'set':function(_0x432770){this[_0x8324('0x4')](_0x8324('0x54'),_0x432770);if(_0x432770===!![]){this['setDataValue'](_0x8324('0x55'),moment());this[_0x8324('0x4')](_0x8324('0x56'),0x0);}else{this['setDataValue'](_0x8324('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x8324('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x8324('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8324('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8324('0x14')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a121d3d..f5c005a 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 _0x47c5=['telephone','filter','ignore','map','value','includes','stack','name','send','rawAttributes','fieldName','salt','where','User','query','includeAll','include','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','password','intersection','fields','options','find','true','update','body','describe','addContacts','ids','internal','Setting','findById','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','fullname','email','permissions','101','113','110','104','105','108','109','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','isEmpty','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','format','each','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Unknown\x20channel','remove','Queue:remove','voice','addAvatar','file','filename','root','userpic','download','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','filters','order','sort','pick','CmList','List','Tag','color','tag','nolimit','limit','getContacts','getQueues','Queue','merge','Unknown\x20role','hasOwnProperty','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','count','getScreenRecordings','ScreenRecording','UserId','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','isMiddleware','resolve','QueuePause','pause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','faxPause','openchannelPause','pauseType','lastPauseAt','%s%s','manual','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','Sms','Whatsapp','getFaxQueues','Fax','Openchannel','transaction','addAgent','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','getVoiceQueues','getWhatsappQueues','flatten','removeAgent','UserVoicePrefix','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','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','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','firstName','phone','Contact','getApiKey','retrieveApiKey','token','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','VoiceQueue','inbound','lower','col','asc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','slice','charAt','toUpperCase','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','toString','moment','bluebird','util','path','lodash','squel','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','set','Content-Range','destroy','get','role','admin','user','Agents','agent','Telephones'];(function(_0xcfa01e,_0x145474){var _0x57d785=function(_0x1d81ab){while(--_0x1d81ab){_0xcfa01e['push'](_0xcfa01e['shift']());}};_0x57d785(++_0x145474);}(_0x47c5,0x165));var _0x547c=function(_0x2083fe,_0x12799f){_0x2083fe=_0x2083fe-0x0;var _0x33d6cd=_0x47c5[_0x2083fe];return _0x33d6cd;};'use strict';var moment=require(_0x547c('0x0'));var BPromise=require(_0x547c('0x1'));var util=require(_0x547c('0x2'));var path=require(_0x547c('0x3'));var fs=require('fs');var _=require(_0x547c('0x4'));var squel=require(_0x547c('0x5'));var jayson=require('jayson/promise');var Redis=require(_0x547c('0x6'));var authService=require(_0x547c('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x547c('0x8'))(_0x547c('0x9'));var utils=require('../../config/utils');var config=require(_0x547c('0xa'));var licenseUtil=require(_0x547c('0xb'));var db=require(_0x547c('0xc'))['db'];var socket=require(_0x547c('0xd'))(new Redis(config[_0x547c('0xe')]));require(_0x547c('0xf'))[_0x547c('0x10')](socket);config[_0x547c('0xe')]=_[_0x547c('0x11')](config[_0x547c('0xe')],{'host':_0x547c('0x12'),'port':0x18eb});var client=jayson[_0x547c('0x13')][_0x547c('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2455e9,_0x386e2c,_0x8addbe,_0x44ab17){return new BPromise(function(_0x549bf0,_0x13a103){var _0x39dce7=_0x44ab17||client;return _0x39dce7['request'](_0x2455e9,_0x8addbe)[_0x547c('0x15')](function(_0x201d95){logger[_0x547c('0x16')](_0x547c('0x17'),_0x386e2c,_0x547c('0x18'));logger[_0x547c('0x19')](_0x547c('0x1a'),_0x386e2c,_0x547c('0x18'),JSON[_0x547c('0x1b')](_0x201d95));if(_0x201d95[_0x547c('0x1c')]){if(_0x201d95[_0x547c('0x1c')][_0x547c('0x1d')]===0x1f4){logger[_0x547c('0x1c')](_0x547c('0x17'),_0x386e2c,_0x201d95[_0x547c('0x1c')][_0x547c('0x1e')]);return _0x13a103(_0x201d95[_0x547c('0x1c')][_0x547c('0x1e')]);}logger['error']('User,\x20%s,\x20%s',_0x386e2c,_0x201d95[_0x547c('0x1c')][_0x547c('0x1e')]);return _0x549bf0(_0x201d95[_0x547c('0x1c')]['message']);}else{logger[_0x547c('0x16')](_0x547c('0x17'),_0x386e2c,_0x547c('0x18'));_0x549bf0(_0x201d95['result'][_0x547c('0x1e')]);}})[_0x547c('0x1f')](function(_0x496c38){logger['error'](_0x547c('0x17'),_0x386e2c,_0x496c38);_0x13a103(_0x496c38);});});}function respondWithStatusCode(_0x4ce2a6,_0x4f20c1){_0x4f20c1=_0x4f20c1||0xcc;return function(_0x11e709){if(_0x11e709){return _0x4ce2a6[_0x547c('0x20')](_0x4f20c1);}return _0x4ce2a6['status'](_0x4f20c1)[_0x547c('0x21')]();};}function respondWithResult(_0x17fd97,_0x436e67){_0x436e67=_0x436e67||0xc8;return function(_0x4c718c){if(_0x4c718c){return _0x17fd97[_0x547c('0x22')](_0x436e67)[_0x547c('0x23')](_0x4c718c);}};}function respondWithFilteredResult(_0x470694,_0x26823c){return function(_0x1f3581){if(_0x1f3581){var _0x2663bc=typeof _0x26823c[_0x547c('0x24')]===_0x547c('0x25')&&typeof _0x26823c['limit']===_0x547c('0x25');var _0x4c66b9=_0x1f3581['count'];var _0x4855fd=_0x2663bc?0x0:_0x26823c['offset'];var _0x2c725d=_0x2663bc?_0x1f3581['count']:_0x26823c[_0x547c('0x24')]+_0x26823c['limit'];var _0x3ea493;if(_0x2c725d>=_0x4c66b9){_0x2c725d=_0x4c66b9;_0x3ea493=0xc8;}else{_0x3ea493=0xce;}_0x470694['status'](_0x3ea493);return _0x470694[_0x547c('0x26')](_0x547c('0x27'),_0x4855fd+'-'+_0x2c725d+'/'+_0x4c66b9)[_0x547c('0x23')](_0x1f3581);}return null;};}function saveUpdates(_0x30a96c){return function(_0x198afb){if(_0x198afb){return _0x198afb['update'](_0x30a96c)['then'](function(_0x28c282){return _0x28c282;});}return null;};}function removeEntity(_0x54de6f){return function(_0x303b57){if(_0x303b57){return _0x303b57[_0x547c('0x28')]()[_0x547c('0x15')](function(){var _0x1695be=_0x303b57[_0x547c('0x29')]({'plain':!![]});if(_0x1695be[_0x547c('0x2a')]===_0x547c('0x2b'))return;var _0x4d4dbd=[{'name':'Users','value':_0x547c('0x2c'),'ignore':!![]},{'name':_0x547c('0x2d'),'value':_0x547c('0x2e'),'ignore':![]},{'name':_0x547c('0x2f'),'value':_0x547c('0x30'),'ignore':![]}];var _0x18d7c1=_(_0x4d4dbd)[_0x547c('0x31')](_0x547c('0x32'))[_0x547c('0x33')](_0x547c('0x34'))[_0x547c('0x34')]();if(_[_0x547c('0x35')](_0x18d7c1,_0x1695be[_0x547c('0x2a')])){return;}var _0x385275=_['find'](_0x4d4dbd,[_0x547c('0x34'),_0x1695be['role']])['name'];return db['UserProfileResource'][_0x547c('0x28')]({'where':{'type':_0x385275,'resourceId':_0x1695be['id']}})[_0x547c('0x15')](function(){return _0x303b57;});})[_0x547c('0x15')](function(){_0x54de6f[_0x547c('0x22')](0xcc)[_0x547c('0x21')]();});}};}function handleEntityNotFound(_0x45f724){return function(_0x5c920e){if(!_0x5c920e){_0x45f724['sendStatus'](0x194);}return _0x5c920e;};}function handleError(_0x5ea2c7,_0xb51625){_0xb51625=_0xb51625||0x1f4;return function(_0x338b6b){logger[_0x547c('0x1c')](_0x338b6b[_0x547c('0x36')]);if(_0x338b6b[_0x547c('0x37')]){delete _0x338b6b[_0x547c('0x37')];}_0x5ea2c7['status'](_0xb51625)[_0x547c('0x38')](_0x338b6b);};}exports['index']=function(_0x32308f,_0x18fcc5){var _0x5b80f4={},_0x380705={'count':0x0,'rows':[]};var _0x5c57ae=_(db['User'][_0x547c('0x39')])[_0x547c('0x33')](function(_0x36bffe){return{'name':_0x36bffe[_0x547c('0x3a')],'type':_0x36bffe['type']['key']};})[_0x547c('0x31')](function(_0x1e8dd0){return!_[_0x547c('0x35')](['password',_0x547c('0x3b')],_0x1e8dd0[_0x547c('0x37')]);})[_0x547c('0x34')]();_0x5b80f4=qs['getOptions'](_0x5c57ae,_0x32308f);var _0x40184f={'where':_0x5b80f4[_0x547c('0x3c')]};return db[_0x547c('0x3d')]['count'](_0x40184f)[_0x547c('0x15')](function(_0xc28dc0){_0x380705['count']=_0xc28dc0;if(_0x32308f[_0x547c('0x3e')][_0x547c('0x3f')]){_0x5b80f4[_0x547c('0x40')]=[{'all':!![]}];}if(!_['includes'](_0x5b80f4[_0x547c('0x41')],'id')){_0x5b80f4['attributes'][_0x547c('0x42')]('id');}return db['User'][_0x547c('0x43')](_0x5b80f4);})[_0x547c('0x15')](function(_0x3d37d7){_0x380705[_0x547c('0x44')]=_0x3d37d7;if(_0x32308f[_0x547c('0x3e')][_0x547c('0x45')]==='true'){var _0x4ccbcf=[];for(var _0x1457ab=0x0;_0x1457ab<_0x380705[_0x547c('0x44')][_0x547c('0x46')];_0x1457ab++){_0x4ccbcf['push'](get_open_tabs(_0x547c('0x47'),_0x380705[_0x547c('0x44')][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x49'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x4a'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x4b'),_0x380705[_0x547c('0x44')][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf['push'](get_open_tabs(_0x547c('0x4c'),_0x380705['rows'][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf['push'](get_open_tabs(_0x547c('0x4d'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));}return BPromise[_0x547c('0x4e')](_0x4ccbcf)[_0x547c('0x15')](function(_0xa005cc){return _0x380705;});}else{return _0x380705;}})[_0x547c('0x15')](respondWithFilteredResult(_0x18fcc5,_0x5b80f4))['catch'](handleError(_0x18fcc5,null));};exports[_0x547c('0x4f')]=function(_0x484ede,_0x5649b6){var _0x4d4a92={'raw':![],'where':{'id':_0x484ede[_0x547c('0x50')]['id']}},_0x91fa04={};_0x91fa04[_0x547c('0x51')]=_[_0x547c('0x52')](_[_0x547c('0x53')](db[_0x547c('0x3d')][_0x547c('0x39')]),[_0x547c('0x54'),_0x547c('0x3b')]);_0x91fa04[_0x547c('0x3e')]=_[_0x547c('0x53')](_0x484ede['query']);_0x91fa04['filters']=_[_0x547c('0x55')](_0x91fa04[_0x547c('0x51')],_0x91fa04['query']);_0x4d4a92[_0x547c('0x41')]=_[_0x547c('0x55')](_0x91fa04[_0x547c('0x51')],qs[_0x547c('0x56')](_0x484ede[_0x547c('0x3e')][_0x547c('0x56')]));_0x4d4a92['attributes']=_0x4d4a92[_0x547c('0x41')]['length']?_0x4d4a92[_0x547c('0x41')]:_0x91fa04[_0x547c('0x51')];if(_0x484ede[_0x547c('0x3e')]['includeAll']){_0x4d4a92[_0x547c('0x40')]=[{'all':!![]}];}_0x4d4a92=_['merge']({},_0x4d4a92,_0x484ede[_0x547c('0x57')]);if(!_[_0x547c('0x35')](_0x4d4a92['attributes'],'id')){_0x4d4a92[_0x547c('0x41')][_0x547c('0x42')]('id');}return db[_0x547c('0x3d')][_0x547c('0x58')](_0x4d4a92)[_0x547c('0x15')](handleEntityNotFound(_0x5649b6,null))[_0x547c('0x15')](function(_0x224040){var _0x4a42d1=[];values=_0x224040;if(_0x484ede[_0x547c('0x3e')]['openTabs']===_0x547c('0x59')){_0x4a42d1[_0x547c('0x42')](get_open_tabs(_0x547c('0x47'),_0x224040[_0x547c('0x48')]));_0x4a42d1[_0x547c('0x42')](get_open_tabs('sms',_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4c'),_0x224040[_0x547c('0x48')]));_0x4a42d1[_0x547c('0x42')](get_open_tabs(_0x547c('0x4d'),_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4a'),_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4b'),_0x224040[_0x547c('0x48')]));return BPromise[_0x547c('0x4e')](_0x4a42d1);}else{return values;}})[_0x547c('0x15')](function(_0x53fed6){return values;})['then'](respondWithResult(_0x5649b6,null))['catch'](handleError(_0x5649b6,null));};exports[_0x547c('0x5a')]=function(_0x455467,_0x5e0e21){if(_0x455467[_0x547c('0x5b')]['id']){delete _0x455467['body']['id'];}delete _0x455467[_0x547c('0x5b')][_0x547c('0x2a')];return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x455467[_0x547c('0x50')]['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x5e0e21,null))[_0x547c('0x15')](saveUpdates(_0x455467['body'],null))['then'](respondWithResult(_0x5e0e21,null))[_0x547c('0x1f')](handleError(_0x5e0e21,null));};exports[_0x547c('0x5c')]=function(_0x3105cb,_0x64bf1e){return db[_0x547c('0x3d')]['describe']()['then'](respondWithResult(_0x64bf1e,null))['catch'](handleError(_0x64bf1e,null));};exports['addContacts']=function(_0x5d6c7f,_0x16ebb7){return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x5d6c7f['params']['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x16ebb7,null))[_0x547c('0x15')](function(_0x1d9666){if(_0x1d9666){return _0x1d9666[_0x547c('0x5d')](_0x5d6c7f['body']['ids'],_['omit'](_0x5d6c7f[_0x547c('0x5b')],[_0x547c('0x5e'),'id'])||{});}})[_0x547c('0x15')](respondWithResult(_0x16ebb7,null))[_0x547c('0x1f')](handleError(_0x16ebb7,null));};function validateUser(_0x345192){return new BPromise(function(_0x4dd4dc,_0x4e0da1){if(_0x345192[_0x547c('0x5f')])return _0x4dd4dc(_0x345192);return db[_0x547c('0x60')][_0x547c('0x61')](0x1)[_0x547c('0x15')](function(_0xa0fd35){if(_0xa0fd35['securePassword'])authService['validatePasswordPattern'](_0x345192['password']);db[_0x547c('0x3d')]['max'](_0x547c('0x5f'))[_0x547c('0x15')](function(_0x3d9ff6){if(_['isNil'](_0x3d9ff6)){_0x345192['internal']=_0xa0fd35[_0x547c('0x62')]||0x1;return;}if(_[_0x547c('0x63')](_0xa0fd35[_0x547c('0x62')])||_0xa0fd35[_0x547c('0x62')]===_0x3d9ff6){_0x345192[_0x547c('0x5f')]=_0x3d9ff6+0x1;return;}if(_0xa0fd35[_0x547c('0x62')]>_0x3d9ff6){_0x345192[_0x547c('0x5f')]=_0xa0fd35['min_internal'];return;}return db[_0x547c('0x64')][_0x547c('0x3e')](_0x547c('0x65'),{'type':db[_0x547c('0x64')][_0x547c('0x66')][_0x547c('0x67')]})[_0x547c('0x15')](function(_0x4066ce){if(_0x4066ce&&_0x4066ce['length']){for(var _0x1fa11a=0x0,_0x284fb7=_0x4066ce[_0x547c('0x46')];_0x1fa11a<_0x284fb7&&_[_0x547c('0x63')](_0x345192['internal']);_0x1fa11a++){if(_0xa0fd35[_0x547c('0x62')]<=_0x4066ce[_0x1fa11a][_0x547c('0x68')]){_0x345192[_0x547c('0x5f')]=_0x4066ce[_0x1fa11a]['from'];}else if(_0xa0fd35['min_internal']>_0x4066ce[_0x1fa11a]['from']&&_0xa0fd35[_0x547c('0x62')]<=_0x4066ce[_0x1fa11a]['to']){_0x345192[_0x547c('0x5f')]=_0xa0fd35[_0x547c('0x62')];}}}if(_['isNil'](_0x345192[_0x547c('0x5f')])){_0x345192[_0x547c('0x5f')]=_0x3d9ff6+0x1;}return _0x4dd4dc(_0x345192);});});})[_0x547c('0x1f')](function(_0x24a8f7){_0x4e0da1(_0x24a8f7);});});}function updateUser(_0x590e5f){return new BPromise(function(_0x482afb,_0x6b4445){try{if(_0x590e5f['voicemail']){_0x590e5f[_0x547c('0x69')]=_0x590e5f[_0x547c('0x5f')];_0x590e5f['VoiceMail']={'mailbox':_0x590e5f[_0x547c('0x5f')],'password':_0x590e5f['password'],'fullname':_0x590e5f[_0x547c('0x6a')],'email':_0x590e5f[_0x547c('0x6b')]};}if(_0x590e5f['role']===_0x547c('0x2e')){if(!_0x590e5f[_0x547c('0x6c')])_0x590e5f[_0x547c('0x6c')]=[_0x547c('0x6d'),'102','103',_0x547c('0x6e'),_0x547c('0x6f'),_0x547c('0x70'),_0x547c('0x71'),'106','107',_0x547c('0x72'),_0x547c('0x73'),_0x547c('0x74'),_0x547c('0x75'),_0x547c('0x76'),_0x547c('0x77')];}_0x482afb(_0x590e5f);}catch(_0x1e9026){_0x6b4445(_0x1e9026);}});}exports[_0x547c('0x78')]=function(_0x42ef60,_0x91bbf){if(_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]===_0x547c('0x2e'))throw new Error('Unauthorized');if(_0x42ef60['body']['role']===_0x547c('0x2c')&&_0x42ef60['user']['role']!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x42ef60['body'][_0x547c('0x2a')]===_0x547c('0x2b')&&_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]!=='admin'){throw new Error(_0x547c('0x79'));}return licenseUtil[_0x547c('0x7a')]([_0x42ef60['body']])['then'](function(){return validateUser(_0x42ef60[_0x547c('0x5b')]);})[_0x547c('0x15')](function(_0x2fecce){return updateUser(_0x2fecce)[_0x547c('0x15')](function(_0x204aad){if(_0x204aad[_0x547c('0x2a')]===_0x547c('0x2b')){_0x204aad[_0x547c('0x7b')]=_0x42ef60['user'][_0x547c('0x7b')];delete _0x204aad[_0x547c('0x7c')];}return _0x204aad;});})[_0x547c('0x15')](function(_0x5c2e3c){return db[_0x547c('0x3d')][_0x547c('0x78')](_0x5c2e3c,{'include':[{'model':db[_0x547c('0x7d')],'as':_0x547c('0x7d')}]});})[_0x547c('0x15')](function(_0x10c1a7){if(_0x42ef60[_0x547c('0x5b')][_0x547c('0x2a')]===_0x547c('0x2c'))return _0x10c1a7;if(_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]!==_0x547c('0x2c'))return _0x10c1a7;return db[_0x547c('0x7e')][_0x547c('0x58')]({'where':{'name':_0x10c1a7['role']===_0x547c('0x2e')?_0x547c('0x2d'):_0x547c('0x2f'),'userProfileId':_0x42ef60['user'][_0x547c('0x7c')]},'raw':!![]})[_0x547c('0x15')](function(_0x185176){if(!_0x185176||_0x185176[_0x547c('0x7f')]!=0x0)return _0x10c1a7;return db[_0x547c('0x80')][_0x547c('0x78')]({'name':_0x10c1a7[_0x547c('0x37')],'resourceId':_0x10c1a7['id'],'type':_0x185176[_0x547c('0x37')],'sectionId':_0x185176['id']},{})[_0x547c('0x15')](function(){return _0x10c1a7;});})[_0x547c('0x1f')](function(_0x224f62){logger[_0x547c('0x1c')](_0x547c('0x81'),_0x224f62);throw _0x224f62;});})['then'](respondWithResult(_0x91bbf,0xc9))['catch'](handleError(_0x91bbf,null));};exports['bulkCreate']=function(_0x588e2b,_0x5bafab){var _0x4b09fb=_0x588e2b[_0x547c('0x5b')];var _0x3bf455=[];if(_0x588e2b[_0x547c('0x2c')][_0x547c('0x2a')]==='agent')throw new Error(_0x547c('0x82'));if(_[_0x547c('0x83')](_0x4b09fb,[_0x547c('0x2a'),'user'])&&_0x588e2b[_0x547c('0x2c')][_0x547c('0x2a')]!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x4b09fb,['role',_0x547c('0x2b')])&&_0x588e2b['user'][_0x547c('0x2a')]!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x547c('0x7a')](_0x4b09fb)[_0x547c('0x15')](function(){return validateUser(_0x4b09fb[0x0]);})[_0x547c('0x15')](function(){for(var _0x3f54cf=0x1;_0x3f54cf<_0x4b09fb[_0x547c('0x46')];_0x3f54cf++){var _0x5a067c=_0x4b09fb[_0x3f54cf-0x1][_0x547c('0x5f')];if(!_0x4b09fb[_0x3f54cf]['internal'])_0x4b09fb[_0x3f54cf][_0x547c('0x5f')]=_0x5a067c+0x1;_0x3bf455[_0x547c('0x42')](validateUser(_0x4b09fb[_0x3f54cf]));}return BPromise[_0x547c('0x4e')](_0x3bf455);})[_0x547c('0x15')](function(){_0x3bf455=[];for(var _0x4e8596=0x0;_0x4e8596<_0x4b09fb[_0x547c('0x46')];_0x4e8596++){_0x3bf455['push'](updateUser(_0x4b09fb[_0x4e8596]));}return BPromise[_0x547c('0x4e')](_0x3bf455);})[_0x547c('0x15')](function(){return BPromise['each'](_0x4b09fb,function(_0x348ef8){return db['User'][_0x547c('0x78')](_0x348ef8,{'include':[{'model':db[_0x547c('0x7d')],'as':_0x547c('0x7d')}]})[_0x547c('0x15')](function(_0x55411b){_0x348ef8['id']=_0x55411b['id'];return _0x348ef8;});});})[_0x547c('0x15')](function(_0x311cb8){if(_0x588e2b[_0x547c('0x5b')][_0x547c('0x2a')]===_0x547c('0x2c'))return _0x311cb8;if(_0x588e2b['user'][_0x547c('0x2a')]!==_0x547c('0x2c'))return _0x311cb8;var _0x28cbee=_['some'](_0x311cb8,function(_0xcf70f8){return _0xcf70f8[_0x547c('0x2a')]===_0x547c('0x2e')||_0xcf70f8[_0x547c('0x2a')]==='telephone';});if(!_0x28cbee)return _0x311cb8;return db[_0x547c('0x7e')]['findAll']({'where':{'name':{'$or':[_0x547c('0x2d'),'Telephones']},'userProfileId':_0x588e2b[_0x547c('0x2c')][_0x547c('0x7c')]},'raw':!![]})[_0x547c('0x15')](function(_0x27b3ff){if(_[_0x547c('0x84')](_0x27b3ff)||!_[_0x547c('0x83')](_0x27b3ff,['autoAssociation',0x0]))return _0x311cb8;_0x3bf455=[];var _0x481894=_(_0x27b3ff)['map'](function(_0x449255){if(_0x449255[_0x547c('0x7f')]===0x1)return;return _0x449255[_0x547c('0x37')]===_0x547c('0x2d')?'agent':_0x547c('0x30');})['compact']()[_0x547c('0x34')]();for(var _0xad8038=0x0;_0xad8038<_0x311cb8[_0x547c('0x46')];_0xad8038++){if(!_[_0x547c('0x35')](_0x481894,_0x311cb8[_0xad8038][_0x547c('0x2a')]))return;var _0x15778c=_0x311cb8[_0xad8038]['role']===_0x547c('0x2e')?'Agents':_0x547c('0x2f');_0x3bf455[_0x547c('0x42')](db['UserProfileResource'][_0x547c('0x78')]({'name':_0x311cb8[_0xad8038][_0x547c('0x37')],'resourceId':_0x311cb8[_0xad8038]['id'],'type':_0x15778c,'sectionId':_[_0x547c('0x58')](_0x27b3ff,[_0x547c('0x37'),_0x15778c])['id']},{}));}return BPromise[_0x547c('0x4e')](_0x3bf455);});})[_0x547c('0x15')](respondWithResult(_0x5bafab,0xc9))[_0x547c('0x1f')](handleError(_0x5bafab,null));};exports['changePassword']=function(_0xcdd93f,_0x1e242f){if(_0xcdd93f[_0x547c('0x5b')]['id']){delete _0xcdd93f['body']['id'];}return db[_0x547c('0x3d')]['find']({'where':{'id':_0xcdd93f[_0x547c('0x50')]['id']}})['then'](function(_0x44b5e9){if(!_0x44b5e9)return null;if(_0x44b5e9['id']===_0xcdd93f[_0x547c('0x2c')]['id']){if(!_0xcdd93f[_0x547c('0x5b')][_0x547c('0x85')]||!_0xcdd93f['body'][_0x547c('0x86')]){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x89'));}if(!_0x44b5e9['authenticate'](_0xcdd93f['body'][_0x547c('0x85')])){throw new db[(_0x547c('0x87'))]['ValidationError'](_0x547c('0x8a'));}if(_0xcdd93f['body']['oldPassword']===_0xcdd93f['body'][_0x547c('0x86')]){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x8b'));}}else if(_0xcdd93f['user'][_0x547c('0x2a')]===_0x547c('0x2b')){if(!_0xcdd93f[_0x547c('0x5b')]['newPassword']){throw new db[(_0x547c('0x87'))]['ValidationError'](_0x547c('0x8c'));}}else if(_0xcdd93f[_0x547c('0x2c')][_0x547c('0x2a')]==='user'){if(!_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')]){throw new db['Sequelize'][(_0x547c('0x88'))](_0x547c('0x8c'));}if(_0x44b5e9[_0x547c('0x2a')]!==_0x547c('0x2e')){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x82'));}}else{throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x82'));}return _0x44b5e9;})['then'](handleEntityNotFound(_0x1e242f,null))['then'](function(_0x4267e3){return db['Setting'][_0x547c('0x8d')]({'attributes':['id','securePassword',_0x547c('0x8e'),_0x547c('0x8f')]})[_0x547c('0x15')](function(_0x39cb92){if(_0x39cb92[_0x547c('0x90')])authService[_0x547c('0x91')](_0xcdd93f[_0x547c('0x5b')]['newPassword']);if(!_0x39cb92[_0x547c('0x8e')]||!_0x4267e3[_0x547c('0x92')])return _0x4267e3;authService[_0x547c('0x93')](_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')],_0x4267e3[_0x547c('0x92')],_0x39cb92[_0x547c('0x8f')]);return _0x4267e3;})[_0x547c('0x15')](saveUpdates({'password':_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')],'passwordResetAt':_0xcdd93f[_0x547c('0x2c')]['id']==_0xcdd93f[_0x547c('0x50')]['id']?moment():null,'previousPasswords':authService[_0x547c('0x94')](_0xcdd93f['body'][_0x547c('0x86')],_0x4267e3[_0x547c('0x92')])},null));})[_0x547c('0x15')](respondWithResult(_0x1e242f,null))[_0x547c('0x1f')](handleError(_0x1e242f,null));};exports[_0x547c('0x95')]=function(_0x11e9fd,_0x35b426){var _0x3fae07=_0x11e9fd['body'][_0x547c('0x96')];return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x11e9fd['params']['id']},'attributes':['id','name',_0x547c('0x2a'),_0x547c('0x97'),_0x547c('0x98'),_0x547c('0x99'),_0x547c('0x9a')]})[_0x547c('0x15')](handleEntityNotFound(_0x35b426,null))[_0x547c('0x15')](function(_0xb541a7){if(_0xb541a7){if(!utils['isValidChannel'](_0x3fae07)){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))]('Unknown\x20channel');}return _0xb541a7[_0x547c('0x9b')+_[_0x547c('0x9c')](_0x3fae07[_0x547c('0x9d')]())+_0x547c('0x9e')](_0x11e9fd['body'][_0x547c('0x5e')],{'penalty':_0x11e9fd[_0x547c('0x5b')][_0x547c('0x9f')]||0x0})[_0x547c('0xa0')](function(_0x21938c){for(var _0x2c0a98=0x0;_0x2c0a98<_0x11e9fd[_0x547c('0x5b')]['ids'][_0x547c('0x46')];_0x2c0a98+=0x1){var _0x1564b8={'UserId':Number(_0x11e9fd[_0x547c('0x50')]['id'])};_0x1564b8[_[_0x547c('0x9c')](_0x3fae07['toLowerCase']())+_0x547c('0xa1')]=Number(_0x11e9fd['body']['ids'][_0x2c0a98]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_['capitalize'](_0x3fae07[_0x547c('0x9d')]())+_0x547c('0xa3'),_0x1564b8);}return _0x21938c;})[_0x547c('0x15')](function(){if(_0x3fae07==='voice'){return db['VoiceQueue'][_0x547c('0x43')]({'where':{'id':_0x11e9fd['body'][_0x547c('0x5e')]||[]},'raw':!![],'attributes':['id',_0x547c('0x37')]});}})[_0x547c('0x15')](function(_0x4cb529){var _0x4a2612=_0xb541a7[_0x547c('0x29')]({'plain':!![]});var _0xea7f3f=[];if(_0x3fae07==='voice'&&_0x4a2612[_0x547c('0x2a')]===_0x547c('0x2e')&&_0x4a2612['online']){for(var _0x1764f2=0x0;_0x1764f2<_0x4cb529[_0x547c('0x46')];_0x1764f2+=0x1){_0xea7f3f[_0x547c('0x42')]({'membername':_0x4a2612['name'],'UserId':_0x4a2612['id'],'queue_name':_0x4cb529[_0x1764f2][_0x547c('0x37')],'VoiceQueueId':_0x4cb529[_0x1764f2]['id'],'interface':_['isNil'](_0x4a2612['interface'])?util[_0x547c('0xa4')]('SIP/%s',_0x4a2612[_0x547c('0x37')]):_0x4a2612['interface'],'paused':_0x4a2612[_0x547c('0x99')]||![],'penalty':_0x11e9fd['body'][_0x547c('0x9f')]||0x0});}return BPromise[_0x547c('0xa5')](_0xea7f3f,function(_0x2a1bbf){return db[_0x547c('0xa6')][_0x547c('0xa7')](_0x2a1bbf);});}return _0xb541a7;});}})[_0x547c('0x15')](respondWithStatusCode(_0x35b426,null))[_0x547c('0x1f')](handleError(_0x35b426,null));};exports[_0x547c('0xa8')]=function(_0x54fb86,_0x2a560a){var _0x3131af;return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x54fb86[_0x547c('0x50')]['id']},'attributes':['id',_0x547c('0x37'),_0x547c('0x2a')]})[_0x547c('0x15')](handleEntityNotFound(_0x2a560a,null))[_0x547c('0x15')](function(_0x9e9307){if(_0x9e9307){_0x3131af=_0x9e9307;if(!_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')]||!utils[_0x547c('0xa9')](_0x54fb86[_0x547c('0x3e')]['channel'])){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0xaa'));}return _0x9e9307[_0x547c('0xab')+_['capitalize'](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+_0x547c('0x9e')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')]);}})[_0x547c('0x15')](function(_0xecf19c){if(_['isArray'](_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')])){for(var _0x17520a=0x0;_0x17520a<_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')][_0x547c('0x46')];_0x17520a+=0x1){var _0x3b20e9={'UserId':Number(_0x54fb86[_0x547c('0x50')]['id'])};_0x3b20e9[_[_0x547c('0x9c')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+'QueueId']=Number(_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')][_0x17520a]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_[_0x547c('0x9c')](_0x54fb86['query']['channel'][_0x547c('0x9d')]())+_0x547c('0xac'),_0x3b20e9);}}else{var _0x3b20e9={'UserId':Number(_0x54fb86['params']['id'])};_0x3b20e9[_[_0x547c('0x9c')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+_0x547c('0xa1')]=Number(_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_['capitalize'](_0x54fb86['query'][_0x547c('0x96')][_0x547c('0x9d')]())+'Queue:remove',_0x3b20e9);}return _0xecf19c;})[_0x547c('0x15')](function(){if(_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')]===_0x547c('0xad')){return db[_0x547c('0xa6')][_0x547c('0x28')]({'where':{'UserId':_0x54fb86[_0x547c('0x50')]['id'],'VoiceQueueId':_0x54fb86[_0x547c('0x3e')]['ids']},'individualHooks':!![]})['then'](function(){return _0x3131af;});}return _0x3131af;})[_0x547c('0x15')](respondWithStatusCode(_0x2a560a,null))['catch'](handleError(_0x2a560a,null));};exports[_0x547c('0xae')]=function(_0x3d9a66,_0x592246){_0x3d9a66[_0x547c('0x5b')]['userpic']=_0x3d9a66[_0x547c('0xaf')][_0x547c('0xb0')];return db['User'][_0x547c('0x58')]({'where':{'id':_0x3d9a66[_0x547c('0x50')]['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x592246,null))[_0x547c('0x15')](saveUpdates(_0x3d9a66[_0x547c('0x5b')],null))[_0x547c('0x15')](respondWithResult(_0x592246,null))[_0x547c('0x1f')](handleError(_0x592246,null));};exports['getAvatar']=function(_0x4c7336,_0x21c274){var _0x2a0b2b=path['join'](config[_0x547c('0xb1')],'server/files/images/logos/default_profile.png');return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x4c7336[_0x547c('0x50')]['id']},'attributes':['id',_0x547c('0xb2')],'raw':!![]})['then'](handleEntityNotFound(_0x21c274,null))[_0x547c('0x15')](function(_0x434d03){if(_0x434d03){if(_[_0x547c('0x63')](_0x434d03['userpic'])){return _0x21c274[_0x547c('0xb3')](_0x2a0b2b);}else{if(!fs['existsSync'](path[_0x547c('0xb4')](config[_0x547c('0xb1')],_0x547c('0xb5'),_0x434d03[_0x547c('0xb2')]))){return _0x21c274[_0x547c('0xb3')](_0x2a0b2b);}return _0x21c274[_0x547c('0xb3')](path[_0x547c('0xb4')](config[_0x547c('0xb1')],'server/files/images/',_0x434d03['userpic']));}}})[_0x547c('0x1f')](handleError(_0x21c274,null));};exports[_0x547c('0xb6')]=function(_0x5e70bc,_0x352781){return db[_0x547c('0x3d')]['find']({'where':{'id':_0x5e70bc['params']['id']},'attributes':['id']})[_0x547c('0x15')](handleEntityNotFound(_0x352781,null))[_0x547c('0x15')](function(_0x3cdca2){var _0xf2d9a7=[];values=_0x3cdca2['dataValues'];_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x47'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs('sms',_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4c'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4d'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4a'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4b'),_0x3cdca2[_0x547c('0x48')]));return BPromise[_0x547c('0x4e')](_0xf2d9a7);})['then'](function(_0x5b28f7){var _0x307b25=[];if(_0x5b28f7){for(var _0x4e4a63=0x0;_0x4e4a63=_0x20a161){_0x29abdb=_0x20a161;_0x28f710=0xc8;}else{_0x28f710=0xce;}_0x524e42['status'](_0x28f710);return _0x524e42[_0x65f6('0x22')](_0x65f6('0x23'),_0x5cb131+'-'+_0x29abdb+'/'+_0x20a161)[_0x65f6('0x1d')](_0x471a33);}return null;};}function saveUpdates(_0x559330){return function(_0x4ac04b){if(_0x4ac04b){return _0x4ac04b['update'](_0x559330)[_0x65f6('0x24')](function(_0x3c032f){return _0x3c032f;});}return null;};}function removeEntity(_0x4344b3){return function(_0x408ccc){if(_0x408ccc){return _0x408ccc[_0x65f6('0x25')]()[_0x65f6('0x24')](function(){var _0x144e55=_0x408ccc['get']({'plain':!![]});if(_0x144e55['role']===_0x65f6('0x26'))return;var _0x27e284=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x65f6('0x27'),'value':_0x65f6('0x28'),'ignore':![]},{'name':_0x65f6('0x29'),'value':_0x65f6('0x2a'),'ignore':![]}];var _0x1217fd=_(_0x27e284)[_0x65f6('0x2b')]('ignore')[_0x65f6('0x2c')](_0x65f6('0x2d'))[_0x65f6('0x2d')]();if(_['includes'](_0x1217fd,_0x144e55[_0x65f6('0x2e')])){return;}var _0x2a7aa8=_[_0x65f6('0x2f')](_0x27e284,[_0x65f6('0x2d'),_0x144e55[_0x65f6('0x2e')]])[_0x65f6('0x30')];return db['UserProfileResource'][_0x65f6('0x25')]({'where':{'type':_0x2a7aa8,'resourceId':_0x144e55['id']}})[_0x65f6('0x24')](function(){return _0x408ccc;});})['then'](function(){_0x4344b3[_0x65f6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b403b){return function(_0x50494b){if(!_0x50494b){_0x2b403b[_0x65f6('0x1b')](0x194);}return _0x50494b;};}function handleError(_0x24f7fd,_0x5ce050){_0x5ce050=_0x5ce050||0x1f4;return function(_0x12dee6){logger[_0x65f6('0x18')](_0x12dee6[_0x65f6('0x31')]);if(_0x12dee6['name']){delete _0x12dee6['name'];}_0x24f7fd[_0x65f6('0x1c')](_0x5ce050)['send'](_0x12dee6);};}exports[_0x65f6('0x32')]=function(_0x4e6653,_0x22d760){var _0x2b9675={},_0x5e97f1={'count':0x0,'rows':[]};var _0x44b809=_(db['User']['rawAttributes'])[_0x65f6('0x2c')](function(_0x44f0f7){return{'name':_0x44f0f7[_0x65f6('0x33')],'type':_0x44f0f7[_0x65f6('0x34')][_0x65f6('0x35')]};})[_0x65f6('0x2b')](function(_0x1a55da){return!_[_0x65f6('0x36')](['password',_0x65f6('0x37')],_0x1a55da['name']);})[_0x65f6('0x2d')]();_0x2b9675=qs[_0x65f6('0x38')](_0x44b809,_0x4e6653);var _0x4ba7db={'where':_0x2b9675[_0x65f6('0x39')]};return db['User'][_0x65f6('0x21')](_0x4ba7db)[_0x65f6('0x24')](function(_0x413819){_0x5e97f1[_0x65f6('0x21')]=_0x413819;if(_0x4e6653[_0x65f6('0x3a')][_0x65f6('0x3b')]){_0x2b9675[_0x65f6('0x3c')]=[{'all':!![]}];}if(!_[_0x65f6('0x36')](_0x2b9675[_0x65f6('0x3d')],'id')){_0x2b9675['attributes'][_0x65f6('0x3e')]('id');}return db[_0x65f6('0x3f')][_0x65f6('0x40')](_0x2b9675);})[_0x65f6('0x24')](function(_0x83e2d9){_0x5e97f1[_0x65f6('0x41')]=_0x83e2d9;if(_0x4e6653[_0x65f6('0x3a')][_0x65f6('0x42')]===_0x65f6('0x43')){var _0x2abbed=[];for(var _0xcf19da=0x0;_0xcf19da<_0x5e97f1[_0x65f6('0x41')][_0x65f6('0x44')];_0xcf19da++){_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da]['dataValues']));_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed['push'](get_open_tabs(_0x65f6('0x48'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed['push'](get_open_tabs(_0x65f6('0x49'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed[_0x65f6('0x3e')](get_open_tabs('openchannel',_0x5e97f1[_0x65f6('0x41')][_0xcf19da]['dataValues']));_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x4a'),_0x5e97f1['rows'][_0xcf19da][_0x65f6('0x47')]));}return BPromise['all'](_0x2abbed)[_0x65f6('0x24')](function(_0x4d9b76){return _0x5e97f1;});}else{return _0x5e97f1;}})[_0x65f6('0x24')](respondWithFilteredResult(_0x22d760,_0x2b9675))[_0x65f6('0x1a')](handleError(_0x22d760,null));};exports[_0x65f6('0x4b')]=function(_0x3837b2,_0x4d30c5){var _0x51bf6c={'raw':![],'where':{'id':_0x3837b2[_0x65f6('0x4c')]['id']}},_0x198e2f={};_0x198e2f[_0x65f6('0x4d')]=_[_0x65f6('0x4e')](_[_0x65f6('0x4f')](db[_0x65f6('0x3f')][_0x65f6('0x50')]),[_0x65f6('0x51'),_0x65f6('0x37')]);_0x198e2f['query']=_[_0x65f6('0x4f')](_0x3837b2[_0x65f6('0x3a')]);_0x198e2f[_0x65f6('0x52')]=_['intersection'](_0x198e2f[_0x65f6('0x4d')],_0x198e2f[_0x65f6('0x3a')]);_0x51bf6c['attributes']=_[_0x65f6('0x53')](_0x198e2f[_0x65f6('0x4d')],qs['fields'](_0x3837b2[_0x65f6('0x3a')]['fields']));_0x51bf6c[_0x65f6('0x3d')]=_0x51bf6c[_0x65f6('0x3d')][_0x65f6('0x44')]?_0x51bf6c['attributes']:_0x198e2f[_0x65f6('0x4d')];if(_0x3837b2[_0x65f6('0x3a')]['includeAll']){_0x51bf6c[_0x65f6('0x3c')]=[{'all':!![]}];}_0x51bf6c=_[_0x65f6('0x54')]({},_0x51bf6c,_0x3837b2['options']);if(!_[_0x65f6('0x36')](_0x51bf6c[_0x65f6('0x3d')],'id')){_0x51bf6c[_0x65f6('0x3d')][_0x65f6('0x3e')]('id');}return db[_0x65f6('0x3f')][_0x65f6('0x2f')](_0x51bf6c)[_0x65f6('0x24')](handleEntityNotFound(_0x4d30c5,null))[_0x65f6('0x24')](function(_0x4f69d8){var _0x52c5a4=[];values=_0x4f69d8;if(_0x3837b2['query'][_0x65f6('0x42')]===_0x65f6('0x43')){_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x4f69d8['dataValues']));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4['push'](get_open_tabs(_0x65f6('0x55'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs('whatsapp',_0x4f69d8['dataValues']));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x48'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x49'),_0x4f69d8[_0x65f6('0x47')]));return BPromise[_0x65f6('0x56')](_0x52c5a4);}else{return values;}})[_0x65f6('0x24')](function(_0x2d8b5b){return values;})[_0x65f6('0x24')](respondWithResult(_0x4d30c5,null))[_0x65f6('0x1a')](handleError(_0x4d30c5,null));};exports[_0x65f6('0x57')]=function(_0x30adee,_0x3e3143){if(_0x30adee['body']['id']){delete _0x30adee[_0x65f6('0x58')]['id'];}delete _0x30adee[_0x65f6('0x58')][_0x65f6('0x2e')];return db['User'][_0x65f6('0x2f')]({'where':{'id':_0x30adee[_0x65f6('0x4c')]['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x3e3143,null))[_0x65f6('0x24')](saveUpdates(_0x30adee['body'],null))[_0x65f6('0x24')](respondWithResult(_0x3e3143,null))[_0x65f6('0x1a')](handleError(_0x3e3143,null));};exports[_0x65f6('0x59')]=function(_0x3e0d8b,_0x553ff0){return db[_0x65f6('0x3f')][_0x65f6('0x59')]()['then'](respondWithResult(_0x553ff0,null))[_0x65f6('0x1a')](handleError(_0x553ff0,null));};exports[_0x65f6('0x5a')]=function(_0x36c316,_0x51549d){return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x36c316[_0x65f6('0x4c')]['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x51549d,null))[_0x65f6('0x24')](function(_0x334fa1){if(_0x334fa1){return _0x334fa1['addContacts'](_0x36c316['body']['ids'],_[_0x65f6('0x5b')](_0x36c316[_0x65f6('0x58')],[_0x65f6('0x5c'),'id'])||{});}})[_0x65f6('0x24')](respondWithResult(_0x51549d,null))[_0x65f6('0x1a')](handleError(_0x51549d,null));};function validateUser(_0x304cf9){return new BPromise(function(_0x4c5cd2,_0xfbfebc){if(_0x304cf9[_0x65f6('0x5d')])return _0x4c5cd2(_0x304cf9);return db['Setting'][_0x65f6('0x5e')](0x1)[_0x65f6('0x24')](function(_0x477489){if(_0x477489['securePassword'])authService[_0x65f6('0x5f')](_0x304cf9[_0x65f6('0x51')]);db['User'][_0x65f6('0x60')](_0x65f6('0x5d'))[_0x65f6('0x24')](function(_0x417b44){if(_[_0x65f6('0x61')](_0x417b44)){_0x304cf9[_0x65f6('0x5d')]=_0x477489[_0x65f6('0x62')]||0x1;return;}if(_['isNil'](_0x477489['min_internal'])||_0x477489[_0x65f6('0x62')]===_0x417b44){_0x304cf9[_0x65f6('0x5d')]=_0x417b44+0x1;return;}if(_0x477489['min_internal']>_0x417b44){_0x304cf9[_0x65f6('0x5d')]=_0x477489['min_internal'];return;}return db[_0x65f6('0x63')]['query'](_0x65f6('0x64'),{'type':db[_0x65f6('0x63')][_0x65f6('0x65')][_0x65f6('0x66')]})[_0x65f6('0x24')](function(_0x264e6c){if(_0x264e6c&&_0x264e6c[_0x65f6('0x44')]){for(var _0x1cc66a=0x0,_0x2405a7=_0x264e6c['length'];_0x1cc66a<_0x2405a7&&_['isNil'](_0x304cf9[_0x65f6('0x5d')]);_0x1cc66a++){if(_0x477489[_0x65f6('0x62')]<=_0x264e6c[_0x1cc66a][_0x65f6('0x67')]){_0x304cf9['internal']=_0x264e6c[_0x1cc66a]['from'];}else if(_0x477489[_0x65f6('0x62')]>_0x264e6c[_0x1cc66a][_0x65f6('0x67')]&&_0x477489[_0x65f6('0x62')]<=_0x264e6c[_0x1cc66a]['to']){_0x304cf9[_0x65f6('0x5d')]=_0x477489[_0x65f6('0x62')];}}}if(_[_0x65f6('0x61')](_0x304cf9['internal'])){_0x304cf9['internal']=_0x417b44+0x1;}return _0x4c5cd2(_0x304cf9);});});})[_0x65f6('0x1a')](function(_0x244f30){_0xfbfebc(_0x244f30);});});}function updateUser(_0x5543bc){return new BPromise(function(_0x219bf8,_0x4a8b60){try{if(_0x5543bc[_0x65f6('0x68')]){_0x5543bc[_0x65f6('0x69')]=_0x5543bc[_0x65f6('0x5d')];_0x5543bc[_0x65f6('0x6a')]={'mailbox':_0x5543bc['internal'],'password':_0x5543bc[_0x65f6('0x51')],'fullname':_0x5543bc[_0x65f6('0x6b')],'email':_0x5543bc[_0x65f6('0x6c')]};}if(_0x5543bc['role']==='agent'){if(!_0x5543bc[_0x65f6('0x6d')])_0x5543bc['permissions']=[_0x65f6('0x6e'),_0x65f6('0x6f'),_0x65f6('0x70'),_0x65f6('0x71'),'110','104','105',_0x65f6('0x72'),_0x65f6('0x73'),_0x65f6('0x74'),'109',_0x65f6('0x75'),_0x65f6('0x76'),_0x65f6('0x77'),'115'];}_0x219bf8(_0x5543bc);}catch(_0x40d0f7){_0x4a8b60(_0x40d0f7);}});}exports[_0x65f6('0x78')]=function(_0x4a3eab,_0x758e80){if(_0x4a3eab[_0x65f6('0x79')]['role']===_0x65f6('0x28'))throw new Error('Unauthorized');if(_0x4a3eab[_0x65f6('0x58')]['role']===_0x65f6('0x79')&&_0x4a3eab[_0x65f6('0x79')]['role']!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7a'));}if(_0x4a3eab[_0x65f6('0x58')][_0x65f6('0x2e')]===_0x65f6('0x26')&&_0x4a3eab[_0x65f6('0x79')][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7b'));}return licenseUtil[_0x65f6('0x7c')]([_0x4a3eab[_0x65f6('0x58')]])['then'](function(){return validateUser(_0x4a3eab[_0x65f6('0x58')]);})[_0x65f6('0x24')](function(_0x15c8b7){return updateUser(_0x15c8b7)[_0x65f6('0x24')](function(_0x5694f9){if(_0x5694f9[_0x65f6('0x2e')]===_0x65f6('0x26')){_0x5694f9['settingsEnabled']=_0x4a3eab[_0x65f6('0x79')]['settingsEnabled'];delete _0x5694f9[_0x65f6('0x7d')];}return _0x5694f9;});})['then'](function(_0x31f6c1){return db[_0x65f6('0x3f')]['create'](_0x31f6c1,{'include':[{'model':db['VoiceMail'],'as':_0x65f6('0x6a')}]});})[_0x65f6('0x24')](function(_0x5158c9){if(_0x4a3eab[_0x65f6('0x58')][_0x65f6('0x2e')]===_0x65f6('0x79'))return _0x5158c9;if(_0x4a3eab['user'][_0x65f6('0x2e')]!==_0x65f6('0x79'))return _0x5158c9;return db['UserProfileSection'][_0x65f6('0x2f')]({'where':{'name':_0x5158c9['role']===_0x65f6('0x28')?'Agents':'Telephones','userProfileId':_0x4a3eab[_0x65f6('0x79')][_0x65f6('0x7d')]},'raw':!![]})[_0x65f6('0x24')](function(_0xc82d69){if(!_0xc82d69||_0xc82d69[_0x65f6('0x7e')]!=0x0)return _0x5158c9;return db[_0x65f6('0x7f')][_0x65f6('0x78')]({'name':_0x5158c9[_0x65f6('0x30')],'resourceId':_0x5158c9['id'],'type':_0xc82d69['name'],'sectionId':_0xc82d69['id']},{})['then'](function(){return _0x5158c9;});})[_0x65f6('0x1a')](function(_0x590801){logger[_0x65f6('0x18')](_0x65f6('0x80'),_0x590801);throw _0x590801;});})[_0x65f6('0x24')](respondWithResult(_0x758e80,0xc9))[_0x65f6('0x1a')](handleError(_0x758e80,null));};exports[_0x65f6('0x81')]=function(_0x56bd9d,_0x398cac){var _0x257247=_0x56bd9d[_0x65f6('0x58')];var _0x576ecd=[];if(_0x56bd9d[_0x65f6('0x79')][_0x65f6('0x2e')]===_0x65f6('0x28'))throw new Error(_0x65f6('0x82'));if(_[_0x65f6('0x83')](_0x257247,[_0x65f6('0x2e'),'user'])&&_0x56bd9d['user'][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7a'));}if(_[_0x65f6('0x83')](_0x257247,['role','admin'])&&_0x56bd9d[_0x65f6('0x79')][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x84'));}return licenseUtil[_0x65f6('0x7c')](_0x257247)[_0x65f6('0x24')](function(){return validateUser(_0x257247[0x0]);})['then'](function(){for(var _0x4d607a=0x1;_0x4d607a<_0x257247['length'];_0x4d607a++){var _0x2c59f6=_0x257247[_0x4d607a-0x1][_0x65f6('0x5d')];if(!_0x257247[_0x4d607a][_0x65f6('0x5d')])_0x257247[_0x4d607a][_0x65f6('0x5d')]=_0x2c59f6+0x1;_0x576ecd['push'](validateUser(_0x257247[_0x4d607a]));}return BPromise['all'](_0x576ecd);})[_0x65f6('0x24')](function(){_0x576ecd=[];for(var _0x27e44b=0x0;_0x27e44b<_0x257247['length'];_0x27e44b++){_0x576ecd[_0x65f6('0x3e')](updateUser(_0x257247[_0x27e44b]));}return BPromise['all'](_0x576ecd);})[_0x65f6('0x24')](function(){return BPromise['each'](_0x257247,function(_0x3a30ed){return db[_0x65f6('0x3f')]['create'](_0x3a30ed,{'include':[{'model':db[_0x65f6('0x6a')],'as':_0x65f6('0x6a')}]})[_0x65f6('0x24')](function(_0x9f6e0c){_0x3a30ed['id']=_0x9f6e0c['id'];return _0x3a30ed;});});})[_0x65f6('0x24')](function(_0x144db0){if(_0x56bd9d['body'][_0x65f6('0x2e')]==='user')return _0x144db0;if(_0x56bd9d[_0x65f6('0x79')]['role']!==_0x65f6('0x79'))return _0x144db0;var _0x3528be=_[_0x65f6('0x83')](_0x144db0,function(_0x41e59a){return _0x41e59a['role']===_0x65f6('0x28')||_0x41e59a[_0x65f6('0x2e')]===_0x65f6('0x2a');});if(!_0x3528be)return _0x144db0;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x65f6('0x27'),_0x65f6('0x29')]},'userProfileId':_0x56bd9d['user'][_0x65f6('0x7d')]},'raw':!![]})[_0x65f6('0x24')](function(_0x2837fb){if(_['isEmpty'](_0x2837fb)||!_[_0x65f6('0x83')](_0x2837fb,[_0x65f6('0x7e'),0x0]))return _0x144db0;_0x576ecd=[];var _0x5df361=_(_0x2837fb)[_0x65f6('0x2c')](function(_0x7136bc){if(_0x7136bc[_0x65f6('0x7e')]===0x1)return;return _0x7136bc['name']===_0x65f6('0x27')?_0x65f6('0x28'):_0x65f6('0x2a');})['compact']()[_0x65f6('0x2d')]();for(var _0x4febfa=0x0;_0x4febfa<_0x144db0[_0x65f6('0x44')];_0x4febfa++){if(!_[_0x65f6('0x36')](_0x5df361,_0x144db0[_0x4febfa][_0x65f6('0x2e')]))return;var _0x22be6e=_0x144db0[_0x4febfa][_0x65f6('0x2e')]===_0x65f6('0x28')?'Agents':_0x65f6('0x29');_0x576ecd[_0x65f6('0x3e')](db[_0x65f6('0x7f')][_0x65f6('0x78')]({'name':_0x144db0[_0x4febfa][_0x65f6('0x30')],'resourceId':_0x144db0[_0x4febfa]['id'],'type':_0x22be6e,'sectionId':_['find'](_0x2837fb,['name',_0x22be6e])['id']},{}));}return BPromise['all'](_0x576ecd);});})[_0x65f6('0x24')](respondWithResult(_0x398cac,0xc9))[_0x65f6('0x1a')](handleError(_0x398cac,null));};exports[_0x65f6('0x85')]=function(_0x59b715,_0x151cee){if(_0x59b715['body']['id']){delete _0x59b715['body']['id'];}return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x59b715['params']['id']}})[_0x65f6('0x24')](function(_0x3c5053){if(!_0x3c5053)return null;if(_0x3c5053['id']===_0x59b715[_0x65f6('0x79')]['id']){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x86')]||!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x8a'));}if(!_0x3c5053[_0x65f6('0x8b')](_0x59b715[_0x65f6('0x58')]['oldPassword'])){throw new db[(_0x65f6('0x88'))]['ValidationError']('Wrong\x20credentials');}if(_0x59b715[_0x65f6('0x58')][_0x65f6('0x86')]===_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db['Sequelize'][(_0x65f6('0x89'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x59b715['user'][_0x65f6('0x2e')]===_0x65f6('0x26')){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x59b715[_0x65f6('0x79')]['role']===_0x65f6('0x79')){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db['Sequelize'][(_0x65f6('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3c5053['role']!==_0x65f6('0x28')){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x82'));}}else{throw new db[(_0x65f6('0x88'))]['ValidationError'](_0x65f6('0x82'));}return _0x3c5053;})[_0x65f6('0x24')](handleEntityNotFound(_0x151cee,null))[_0x65f6('0x24')](function(_0x223409){return db['Setting'][_0x65f6('0x8c')]({'attributes':['id',_0x65f6('0x8d'),_0x65f6('0x8e'),_0x65f6('0x8f')]})[_0x65f6('0x24')](function(_0x1438f5){if(_0x1438f5[_0x65f6('0x8d')])authService[_0x65f6('0x5f')](_0x59b715['body'][_0x65f6('0x87')]);if(!_0x1438f5[_0x65f6('0x8e')]||!_0x223409[_0x65f6('0x90')])return _0x223409;authService[_0x65f6('0x91')](_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')],_0x223409['previousPasswords'],_0x1438f5[_0x65f6('0x8f')]);return _0x223409;})[_0x65f6('0x24')](saveUpdates({'password':_0x59b715['body'][_0x65f6('0x87')],'passwordResetAt':_0x59b715['user']['id']==_0x59b715[_0x65f6('0x4c')]['id']?moment():null,'previousPasswords':authService[_0x65f6('0x92')](_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')],_0x223409[_0x65f6('0x90')])},null));})['then'](respondWithResult(_0x151cee,null))[_0x65f6('0x1a')](handleError(_0x151cee,null));};exports[_0x65f6('0x93')]=function(_0x2394eb,_0x31870f){var _0x99ca39=_0x2394eb['body']['channel'];return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x2394eb[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0x30'),'role','online','loginInPause',_0x65f6('0x94'),_0x65f6('0x95')]})[_0x65f6('0x24')](handleEntityNotFound(_0x31870f,null))['then'](function(_0x12730b){if(_0x12730b){if(!utils[_0x65f6('0x96')](_0x99ca39)){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x97'));}return _0x12730b['add'+_[_0x65f6('0x98')](_0x99ca39[_0x65f6('0x99')]())+'Queues'](_0x2394eb['body'][_0x65f6('0x5c')],{'penalty':_0x2394eb[_0x65f6('0x58')][_0x65f6('0x9a')]||0x0})[_0x65f6('0x9b')](function(_0x17bbc9){for(var _0x57dffb=0x0;_0x57dffb<_0x2394eb[_0x65f6('0x58')]['ids'][_0x65f6('0x44')];_0x57dffb+=0x1){var _0x5d181a={'UserId':Number(_0x2394eb[_0x65f6('0x4c')]['id'])};_0x5d181a[_['capitalize'](_0x99ca39[_0x65f6('0x99')]())+'QueueId']=Number(_0x2394eb[_0x65f6('0x58')][_0x65f6('0x5c')][_0x57dffb]);socket['emit']('user'+_[_0x65f6('0x98')](_0x99ca39[_0x65f6('0x99')]())+_0x65f6('0x9c'),_0x5d181a);}return _0x17bbc9;})[_0x65f6('0x24')](function(){if(_0x99ca39===_0x65f6('0x9d')){return db[_0x65f6('0x9e')][_0x65f6('0x40')]({'where':{'id':_0x2394eb[_0x65f6('0x58')][_0x65f6('0x5c')]||[]},'raw':!![],'attributes':['id',_0x65f6('0x30')]});}})[_0x65f6('0x24')](function(_0x6babec){var _0x264d8b=_0x12730b[_0x65f6('0x9f')]({'plain':!![]});var _0x377855=[];if(_0x99ca39===_0x65f6('0x9d')&&_0x264d8b[_0x65f6('0x2e')]==='agent'&&_0x264d8b[_0x65f6('0xa0')]){for(var _0x91d7bf=0x0;_0x91d7bf<_0x6babec[_0x65f6('0x44')];_0x91d7bf+=0x1){_0x377855[_0x65f6('0x3e')]({'membername':_0x264d8b[_0x65f6('0x30')],'UserId':_0x264d8b['id'],'queue_name':_0x6babec[_0x91d7bf][_0x65f6('0x30')],'VoiceQueueId':_0x6babec[_0x91d7bf]['id'],'interface':_[_0x65f6('0x61')](_0x264d8b[_0x65f6('0x95')])?util[_0x65f6('0xa1')]('SIP/%s',_0x264d8b[_0x65f6('0x30')]):_0x264d8b[_0x65f6('0x95')],'paused':_0x264d8b[_0x65f6('0x94')]||![],'penalty':_0x2394eb[_0x65f6('0x58')]['penalty']||0x0});}return BPromise[_0x65f6('0xa2')](_0x377855,function(_0x39dedf){return db['UserVoiceQueueRt'][_0x65f6('0xa3')](_0x39dedf);});}return _0x12730b;});}})[_0x65f6('0x24')](respondWithStatusCode(_0x31870f,null))[_0x65f6('0x1a')](handleError(_0x31870f,null));};exports[_0x65f6('0xa4')]=function(_0x2b89d5,_0x409dd7){var _0x5f068a;return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x2b89d5[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0x30'),'role']})['then'](handleEntityNotFound(_0x409dd7,null))['then'](function(_0x83e627){if(_0x83e627){_0x5f068a=_0x83e627;if(!_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')]||!utils[_0x65f6('0x96')](_0x2b89d5[_0x65f6('0x3a')]['channel'])){throw new db['Sequelize'][(_0x65f6('0x89'))](_0x65f6('0x97'));}return _0x83e627[_0x65f6('0xa6')+_['capitalize'](_0x2b89d5['query'][_0x65f6('0xa5')]['toLowerCase']())+_0x65f6('0xa7')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')]);}})[_0x65f6('0x24')](function(_0x4632d0){if(_[_0x65f6('0xa8')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')])){for(var _0x8f7173=0x0;_0x8f7173<_0x2b89d5['query'][_0x65f6('0x5c')][_0x65f6('0x44')];_0x8f7173+=0x1){var _0x28b9f4={'UserId':Number(_0x2b89d5[_0x65f6('0x4c')]['id'])};_0x28b9f4[_['capitalize'](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')][_0x65f6('0x99')]())+'QueueId']=Number(_0x2b89d5[_0x65f6('0x3a')]['ids'][_0x8f7173]);socket['emit'](_0x65f6('0x79')+_[_0x65f6('0x98')](_0x2b89d5['query'][_0x65f6('0xa5')]['toLowerCase']())+_0x65f6('0xa9'),_0x28b9f4);}}else{var _0x28b9f4={'UserId':Number(_0x2b89d5[_0x65f6('0x4c')]['id'])};_0x28b9f4[_[_0x65f6('0x98')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')][_0x65f6('0x99')]())+_0x65f6('0xaa')]=Number(_0x2b89d5['query'][_0x65f6('0x5c')]);socket[_0x65f6('0xab')](_0x65f6('0x79')+_[_0x65f6('0x98')](_0x2b89d5[_0x65f6('0x3a')]['channel'][_0x65f6('0x99')]())+'Queue:remove',_0x28b9f4);}return _0x4632d0;})[_0x65f6('0x24')](function(){if(_0x2b89d5['query'][_0x65f6('0xa5')]===_0x65f6('0x9d')){return db[_0x65f6('0xac')][_0x65f6('0x25')]({'where':{'UserId':_0x2b89d5[_0x65f6('0x4c')]['id'],'VoiceQueueId':_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')]},'individualHooks':!![]})[_0x65f6('0x24')](function(){return _0x5f068a;});}return _0x5f068a;})[_0x65f6('0x24')](respondWithStatusCode(_0x409dd7,null))[_0x65f6('0x1a')](handleError(_0x409dd7,null));};exports[_0x65f6('0xad')]=function(_0x2eb04c,_0x3739fd){_0x2eb04c[_0x65f6('0x58')][_0x65f6('0xae')]=_0x2eb04c[_0x65f6('0xaf')][_0x65f6('0xb0')];return db['User'][_0x65f6('0x2f')]({'where':{'id':_0x2eb04c['params']['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x3739fd,null))[_0x65f6('0x24')](saveUpdates(_0x2eb04c[_0x65f6('0x58')],null))[_0x65f6('0x24')](respondWithResult(_0x3739fd,null))[_0x65f6('0x1a')](handleError(_0x3739fd,null));};exports[_0x65f6('0xb1')]=function(_0x5afc8c,_0xb55829){var _0x1ac0bd=path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb4'));return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x5afc8c[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0xae')],'raw':!![]})[_0x65f6('0x24')](handleEntityNotFound(_0xb55829,null))[_0x65f6('0x24')](function(_0x4ecd83){if(_0x4ecd83){if(_['isNil'](_0x4ecd83[_0x65f6('0xae')])){return _0xb55829[_0x65f6('0xb5')](_0x1ac0bd);}else{if(!fs[_0x65f6('0xb6')](path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb7'),_0x4ecd83[_0x65f6('0xae')]))){return _0xb55829['download'](_0x1ac0bd);}return _0xb55829[_0x65f6('0xb5')](path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb7'),_0x4ecd83[_0x65f6('0xae')]));}}})[_0x65f6('0x1a')](handleError(_0xb55829,null));};exports[_0x65f6('0xb8')]=function(_0x47274e,_0x253c2e){return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x47274e[_0x65f6('0x4c')]['id']},'attributes':['id']})[_0x65f6('0x24')](handleEntityNotFound(_0x253c2e,null))['then'](function(_0x59d9d5){var _0x56e0c0=[];values=_0x59d9d5[_0x65f6('0x47')];_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x59d9d5['dataValues']));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0['push'](get_open_tabs(_0x65f6('0x55'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0['push'](get_open_tabs(_0x65f6('0x4a'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs('fax',_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x49'),_0x59d9d5[_0x65f6('0x47')]));return BPromise[_0x65f6('0x56')](_0x56e0c0);})[_0x65f6('0x24')](function(_0x2558e8){var _0xa5af18=[];if(_0x2558e8){for(var _0x51474e=0x0;_0x51474e=_0x541feb[_0xcd74('0x51')]){throw new Error(_0xcd74('0x52'));}})[_0xcd74('0xf')](function(){if(_0x531af8){return db[_0xcd74('0x2a')][_0xcd74('0x53')]({'where':{'membername':_0x531af8[_0xcd74('0x27')]},'individualHooks':!![]});}})[_0xcd74('0xf')](function(){if(_0x531af8){return _0x531af8[_0xcd74('0x54')]({'raw':!![]});}})[_0xcd74('0xf')](function(_0x393aff){if(_0x531af8){if(_0x393aff){var _0x308a61=[];_0x16e39e=_0x393aff;if(_0x16e39e['length']){for(var _0x5bd1b3=0x0;_0x5bd1b3<_0x16e39e[_0xcd74('0x2d')];_0x5bd1b3++){_0x308a61[_0xcd74('0x31')](db[_0xcd74('0x2a')][_0xcd74('0x55')]({'membername':_0x531af8[_0xcd74('0x27')],'UserId':_0x531af8['id'],'queue_name':_0x16e39e[_0x5bd1b3][_0xcd74('0x27')],'VoiceQueueId':_0x16e39e[_0x5bd1b3]['id'],'interface':_0x32d13a,'paused':_0x531af8[_0xcd74('0x4d')]||![],'penalty':_0x16e39e[_0x5bd1b3][_0xcd74('0x56')]||0x0}));}return BPromise['all'](_0x308a61);}}}})[_0xcd74('0xf')](function(){if(_0x531af8){return db[_0xcd74('0x2c')][_0xcd74('0x1a')]({'where':{'membername':_0x531af8[_0xcd74('0x27')],'exitAt':null}});}})[_0xcd74('0xf')](function(_0xcd31e4){if(_0x531af8){if(_0xcd31e4&&_0xcd31e4[_0xcd74('0x2d')]){var _0x3c0950=[];_0xcd31e4[_0xcd74('0x30')](function(_0x3ea999){_0x3c0950[_0xcd74('0x31')](_0x3ea999[_0xcd74('0x2b')]({'exitAt':moment()[_0xcd74('0x34')](_0xcd74('0x2e'))}));});return BPromise[_0xcd74('0x49')](_0x3c0950);}}})[_0xcd74('0xf')](function(_0x3e2a54){if(_0x531af8){var _0x44736b=[];var _0x4752f3=[];var _0x39125c=utils[_0xcd74('0x57')]();var _0x59954f={'membername':_0x531af8[_0xcd74('0x27')],'interface':_0x32d13a,'enterAt':moment()['format'](_0xcd74('0x2e')),'role':_0x531af8[_0xcd74('0x28')],'internal':_0x531af8[_0xcd74('0x29')]};_0x39125c[_0xcd74('0x30')](function(_0x5d9cab){_0x44736b[_0xcd74('0x31')](_[_0xcd74('0x58')]({'channel':_0x5d9cab,'type':_0xcd74('0x59'),'data1':_0xcd74('0x5a'),'data2':_0x32d13a},_0x59954f));if(_0x531af8['loginInPause']){_0x4752f3[_0xcd74('0x31')](_['merge']({'channel':_0x5d9cab,'type':_0xcd74('0x36'),'data1':_0xcd74('0x5b')},_0x59954f));}});return db[_0xcd74('0x2c')][_0xcd74('0x3b')](_0x44736b[_0xcd74('0x5c')](_0x4752f3),{'individualHooks':!![]});}})[_0xcd74('0xf')](function(){if(_0x531af8){return _0x531af8['update']({'online':!![],'lastLoginAt':moment()['format'](_0xcd74('0x2e')),'voicePause':_0x531af8[_0xcd74('0x4d')]||![],'mailPause':_0x531af8[_0xcd74('0x4d')]||![],'chatPause':_0x531af8[_0xcd74('0x4d')]||![],'faxPause':_0x531af8[_0xcd74('0x4d')]||![],'smsPause':_0x531af8[_0xcd74('0x4d')]||![],'openchannelPause':_0x531af8[_0xcd74('0x4d')]||![],'pauseType':_0x531af8[_0xcd74('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0xcd74('0x2e')),'interface':_0x32d13a});}})[_0xcd74('0xf')](function(_0x2c9617){_0x3eed6d(_0x2c9617);})[_0xcd74('0x19')](function(_0x12e429){_0x39d0cd(_0x5a7046[_0xcd74('0x15')](0x1f4,_0x12e429[_0xcd74('0x17')]));});});}; \ No newline at end of file +var _0xdadb=['include','map','model','then','stringify','catch','ShowUser','find','where','PauseUser','role','interface','MemberReport','name','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','format','DEFAULT\x20PAUSE','internal','body','update','UnpauseUser','findOne','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','PAUSE','system','mail','sms','openchannel','whatsapp','channel','set','push','destroy','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','info','result','GetUser','User','findAll','options','raw','limit','attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdadb,0x153));var _0xbdad=function(_0x58c771,_0xc44bfe){_0x58c771=_0x58c771-0x0;var _0x158f38=_0xdadb[_0x58c771];return _0x158f38;};'use strict';var _=require(_0xbdad('0x0'));var util=require(_0xbdad('0x1'));var moment=require(_0xbdad('0x2'));var BPromise=require(_0xbdad('0x3'));var rs=require(_0xbdad('0x4'));var fs=require('fs');var Redis=require(_0xbdad('0x5'));var db=require(_0xbdad('0x6'))['db'];var utils=require(_0xbdad('0x7'));var logger=require(_0xbdad('0x8'))(_0xbdad('0x9'));var config=require('../../config/environment');var jayson=require(_0xbdad('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xbdad('0xb')]=_[_0xbdad('0xc')](config[_0xbdad('0xb')],{'host':_0xbdad('0xd'),'port':0x18eb});var socket=require(_0xbdad('0xe'))(new Redis(config['redis']));require(_0xbdad('0xf'))[_0xbdad('0x10')](socket);function respondWithRpcPromise(_0xcfda01,_0x4c7002,_0x2a727a){return new BPromise(function(_0x4ca905,_0x2d0c82){return client[_0xbdad('0x11')](_0xcfda01,_0x2a727a)['then'](function(_0x40c13b){logger['info'](_0xbdad('0x12'),_0x4c7002,_0xbdad('0x13'));logger[_0xbdad('0x14')](_0xbdad('0x15'),_0x4c7002,_0xbdad('0x13'),JSON['stringify'](_0x40c13b));if(_0x40c13b[_0xbdad('0x16')]){if(_0x40c13b[_0xbdad('0x16')]['code']===0x1f4){logger['error'](_0xbdad('0x12'),_0x4c7002,_0x40c13b[_0xbdad('0x16')][_0xbdad('0x17')]);return _0x2d0c82(_0x40c13b[_0xbdad('0x16')]['message']);}logger[_0xbdad('0x16')](_0xbdad('0x12'),_0x4c7002,_0x40c13b['error']['message']);return _0x4ca905(_0x40c13b[_0xbdad('0x16')][_0xbdad('0x17')]);}else{logger[_0xbdad('0x18')](_0xbdad('0x12'),_0x4c7002,_0xbdad('0x13'));_0x4ca905(_0x40c13b[_0xbdad('0x19')][_0xbdad('0x17')]);}})['catch'](function(_0x4906cb){logger[_0xbdad('0x16')]('User,\x20%s,\x20%s',_0x4c7002,_0x4906cb);_0x2d0c82(_0x4906cb);});});}exports[_0xbdad('0x1a')]=function(_0x2a7ff6){var _0x38f8b6=this;return new Promise(function(_0x5e929f,_0x702af){return db[_0xbdad('0x1b')][_0xbdad('0x1c')]({'raw':_0x2a7ff6[_0xbdad('0x1d')]?_0x2a7ff6[_0xbdad('0x1d')][_0xbdad('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a7ff6['options']?_0x2a7ff6[_0xbdad('0x1d')]['where']||null:null,'attributes':_0x2a7ff6[_0xbdad('0x1d')]?_0x2a7ff6[_0xbdad('0x1d')]['attributes']||null:null,'limit':_0x2a7ff6[_0xbdad('0x1d')]?_0x2a7ff6[_0xbdad('0x1d')][_0xbdad('0x1f')]||null:null,'include':_0x2a7ff6[_0xbdad('0x1d')]?_0x2a7ff6[_0xbdad('0x1d')]['include']?_['map'](_0x2a7ff6['options']['include'],function(_0xf9101a){return{'model':db[_0xf9101a['model']],'as':_0xf9101a['as'],'attributes':_0xf9101a[_0xbdad('0x20')],'include':_0xf9101a[_0xbdad('0x21')]?_[_0xbdad('0x22')](_0xf9101a[_0xbdad('0x21')],function(_0x5df782){return{'model':db[_0x5df782[_0xbdad('0x23')]],'as':_0x5df782['as'],'attributes':_0x5df782[_0xbdad('0x20')],'include':_0x5df782['include']?_[_0xbdad('0x22')](_0x5df782[_0xbdad('0x21')],function(_0x3a79e9){return{'model':db[_0x3a79e9[_0xbdad('0x23')]],'as':_0x3a79e9['as'],'attributes':_0x3a79e9['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdad('0x24')](function(_0x55ee35){logger['info']('GetUser',_0x2a7ff6);logger[_0xbdad('0x14')](_0xbdad('0x1a'),_0x2a7ff6,JSON[_0xbdad('0x25')](_0x55ee35));_0x5e929f(_0x55ee35);})[_0xbdad('0x26')](function(_0x4e3ef2){logger['error'](_0xbdad('0x1a'),_0x4e3ef2[_0xbdad('0x17')],_0x2a7ff6);_0x702af(_0x38f8b6[_0xbdad('0x16')](0x1f4,_0x4e3ef2[_0xbdad('0x17')]));});});};exports[_0xbdad('0x27')]=function(_0x117ed3){var _0x7fb2b=this;return new Promise(function(_0x2e47fa,_0x5e7645){return db[_0xbdad('0x1b')][_0xbdad('0x28')]({'raw':_0x117ed3[_0xbdad('0x1d')]?_0x117ed3['options'][_0xbdad('0x1e')]===undefined?!![]:![]:!![],'where':_0x117ed3[_0xbdad('0x1d')]?_0x117ed3[_0xbdad('0x1d')][_0xbdad('0x29')]||null:null,'attributes':_0x117ed3[_0xbdad('0x1d')]?_0x117ed3[_0xbdad('0x1d')][_0xbdad('0x20')]||null:null,'include':_0x117ed3[_0xbdad('0x1d')]?_0x117ed3[_0xbdad('0x1d')][_0xbdad('0x21')]?_['map'](_0x117ed3[_0xbdad('0x1d')][_0xbdad('0x21')],function(_0x579bc6){return{'model':db[_0x579bc6[_0xbdad('0x23')]],'as':_0x579bc6['as'],'attributes':_0x579bc6[_0xbdad('0x20')],'include':_0x579bc6[_0xbdad('0x21')]?_[_0xbdad('0x22')](_0x579bc6[_0xbdad('0x21')],function(_0x2f23bb){return{'model':db[_0x2f23bb[_0xbdad('0x23')]],'as':_0x2f23bb['as'],'attributes':_0x2f23bb[_0xbdad('0x20')],'include':_0x2f23bb[_0xbdad('0x21')]?_['map'](_0x2f23bb[_0xbdad('0x21')],function(_0x1f1aef){return{'model':db[_0x1f1aef[_0xbdad('0x23')]],'as':_0x1f1aef['as'],'attributes':_0x1f1aef[_0xbdad('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbdad('0x24')](function(_0x35afc9){logger[_0xbdad('0x18')](_0xbdad('0x27'),_0x117ed3);logger[_0xbdad('0x14')](_0xbdad('0x27'),_0x117ed3,JSON['stringify'](_0x35afc9));_0x2e47fa(_0x35afc9);})[_0xbdad('0x26')](function(_0x5b7afd){logger[_0xbdad('0x16')]('ShowUser',_0x5b7afd[_0xbdad('0x17')],_0x117ed3);_0x5e7645(_0x7fb2b[_0xbdad('0x16')](0x1f4,_0x5b7afd[_0xbdad('0x17')]));});});};exports[_0xbdad('0x2a')]=function(_0x1433e5){var _0x975cf7=this;return new Promise(function(_0x35b868,_0x14daff){var _0x43acbd;return db[_0xbdad('0x1b')][_0xbdad('0x28')]({'where':_0x1433e5[_0xbdad('0x1d')][_0xbdad('0x29')]||{},'attributes':['id','name',_0xbdad('0x2b'),'internal',_0xbdad('0x2c')]})[_0xbdad('0x24')](function(_0x110663){if(_0x110663){_0x43acbd=_0x110663;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x43acbd['id']},'individualHooks':!![]});}})[_0xbdad('0x24')](function(){if(_0x43acbd){return db[_0xbdad('0x2d')][_0xbdad('0x1c')]({'where':{'membername':_0x43acbd[_0xbdad('0x2e')],'type':'PAUSE','exitAt':null}});}})[_0xbdad('0x24')](function(_0x342d69){if(_0x43acbd){if(_0x342d69&&_0x342d69[_0xbdad('0x2f')]){var _0x476690=moment()['format'](_0xbdad('0x30'));for(var _0x5a61f2=0x0,_0x35f591=_0x342d69['length'];_0x5a61f2<_0x35f591;_0x5a61f2++){_0x342d69[_0x5a61f2][_0xbdad('0x31')]({'exitAt':_0x476690});}}}})[_0xbdad('0x24')](function(){if(_0x43acbd){var _0x1abeab=[];var _0x5d8a7a=utils[_0xbdad('0x32')]();_0x5d8a7a[_0xbdad('0x33')](function(_0x5c9640){_0x1abeab['push']({'channel':_0x5c9640,'membername':_0x43acbd[_0xbdad('0x2e')],'interface':_[_0xbdad('0x34')](_0x43acbd[_0xbdad('0x2c')])?util[_0xbdad('0x35')]('SIP/%s',_0x43acbd[_0xbdad('0x2e')]):_0x43acbd[_0xbdad('0x2c')],'type':'PAUSE','enterAt':moment()[_0xbdad('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1433e5['body']['type']||_0xbdad('0x36'),'role':_0x43acbd[_0xbdad('0x2b')],'internal':_0x43acbd[_0xbdad('0x37')],'uniqueid':_0x1433e5[_0xbdad('0x38')]['uniqueid']||null});});return db[_0xbdad('0x2d')]['bulkCreate'](_0x1abeab,{'individualHooks':!![]});}})['then'](function(){if(_0x43acbd){return _0x43acbd[_0xbdad('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1433e5[_0xbdad('0x38')]['type']||_0xbdad('0x36'),'lastPauseAt':moment()[_0xbdad('0x35')](_0xbdad('0x30'))});}})['then'](function(_0x33fca9){_0x35b868(_0x33fca9);})['catch'](function(_0x317a9f){_0x14daff(_0x975cf7['error'](0x1f4,_0x317a9f['message']));});});};exports[_0xbdad('0x3a')]=function(_0x354074){var _0x2e7b31=this;return new Promise(function(_0x318a96,_0x12eefb){var _0x221dc6;return db[_0xbdad('0x1b')][_0xbdad('0x3b')]({'where':_0x354074[_0xbdad('0x1d')][_0xbdad('0x29')]||{},'attributes':['id','name']})['then'](function(_0x34c906){if(_0x34c906){_0x221dc6=_0x34c906;if(_0x354074[_0xbdad('0x38')]['channel']&&!utils[_0xbdad('0x3c')](_0x354074[_0xbdad('0x38')]['channel'])){throw new Error(_0xbdad('0x3d'));}switch(_0x354074[_0xbdad('0x38')]['channel']){case _0xbdad('0x3e'):return db[_0xbdad('0x3f')][_0xbdad('0x39')]({'paused':0x0},{'where':{'UserId':_0x221dc6['id']}})[_0xbdad('0x24')](function(){return db['MemberReport'][_0xbdad('0x28')]({'where':{'channel':_0x354074[_0xbdad('0x38')]['channel'],'membername':_0x221dc6[_0xbdad('0x2e')],'type':_0xbdad('0x40'),'exitAt':null}});})[_0xbdad('0x24')](function(_0x12e1c6){if(_0x12e1c6){return _0x12e1c6[_0xbdad('0x39')]({'exitAt':moment()[_0xbdad('0x35')](_0xbdad('0x30')),'data2':_0xbdad('0x41')},{'individualHooks':!![]});}return null;})[_0xbdad('0x24')](function(){return _0x221dc6[_0xbdad('0x39')]({'voicePause':![]});});case _0xbdad('0x42'):case'chat':case'fax':case _0xbdad('0x43'):case _0xbdad('0x44'):case _0xbdad('0x45'):return db[_0xbdad('0x2d')][_0xbdad('0x28')]({'where':{'channel':_0x354074[_0xbdad('0x38')][_0xbdad('0x46')],'membername':_0x221dc6[_0xbdad('0x2e')],'type':'PAUSE','exitAt':null}})[_0xbdad('0x24')](function(_0x29d71){return _0x29d71[_0xbdad('0x39')]({'exitAt':moment()[_0xbdad('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xbdad('0x24')](function(){var _0x46dc4d={};_[_0xbdad('0x47')](_0x46dc4d,util[_0xbdad('0x35')]('%s%s',_0x354074[_0xbdad('0x38')][_0xbdad('0x46')],'Pause'),![]);return _0x221dc6[_0xbdad('0x39')](_0x46dc4d);});default:return db[_0xbdad('0x3f')][_0xbdad('0x39')]({'paused':0x0},{'where':{'UserId':_0x221dc6['id']}})[_0xbdad('0x24')](function(){return db[_0xbdad('0x2d')][_0xbdad('0x1c')]({'where':{'membername':_0x221dc6[_0xbdad('0x2e')],'type':_0xbdad('0x40'),'exitAt':null}});})['then'](function(_0x30af0e){var _0x4ce917=[];_0x30af0e[_0xbdad('0x33')](function(_0x4c0152){_0x4ce917[_0xbdad('0x48')](_0x4c0152[_0xbdad('0x39')]({'exitAt':moment()['format'](_0xbdad('0x30')),'data2':_0xbdad('0x41')}));});return BPromise['all'](_0x4ce917);})['then'](function(){return _0x221dc6[_0xbdad('0x39')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xbdad('0x24')](function(_0x5d598c){_0x318a96(_0x5d598c);})['catch'](function(_0xa9f083){_0x12eefb(_0x2e7b31[_0xbdad('0x16')](0x1f4,_0xa9f083[_0xbdad('0x17')]));});});};exports['LogoutUser']=function(_0x5c96ba){var _0x50fe29=this;return new Promise(function(_0x3222ae,_0x11384c){var _0x2b4446;return db[_0xbdad('0x1b')]['findOne']({'where':_0x5c96ba[_0xbdad('0x1d')]['where']||{},'attributes':['id',_0xbdad('0x2e')]})[_0xbdad('0x24')](function(_0x54e22b){if(_0x54e22b){_0x2b4446=_0x54e22b;return db[_0xbdad('0x3f')][_0xbdad('0x49')]({'where':{'membername':_0x2b4446[_0xbdad('0x2e')]},'individualHooks':!![]});}})[_0xbdad('0x24')](function(){if(_0x2b4446){return db[_0xbdad('0x2d')]['findAll']({'where':{'membername':_0x2b4446[_0xbdad('0x2e')],'exitAt':null}});}})[_0xbdad('0x24')](function(_0x13b4e2){if(_0x2b4446){if(_0x13b4e2&&_0x13b4e2[_0xbdad('0x2f')]){var _0x341639=[];_0x13b4e2[_0xbdad('0x33')](function(_0xe4fd7c){_0x341639['push'](_0xe4fd7c['update']({'exitAt':moment()['format'](_0xbdad('0x30'))}));});return BPromise[_0xbdad('0x4a')](_0x341639);}}})[_0xbdad('0x24')](function(){if(_0x2b4446){return _0x2b4446[_0xbdad('0x39')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbdad('0x24')](function(_0x34a026){_0x3222ae(_0x34a026);})[_0xbdad('0x26')](function(_0x1654a2){_0x11384c(_0x50fe29[_0xbdad('0x16')](0x1f4,_0x1654a2['message']));});});};exports[_0xbdad('0x4b')]=function(_0x4938dc){var _0xad3e67=this;return new Promise(function(_0x3e9245,_0x2b6f9e){var _0x3c93da;var _0x14ed9f;var _0x4e4d0a;var _0x927acf;return db['User']['findOne']({'where':_0x4938dc[_0xbdad('0x1d')][_0xbdad('0x29')]||{},'attributes':['id',_0xbdad('0x2e'),_0xbdad('0x2b'),_0xbdad('0x4c'),_0xbdad('0x4d'),_0xbdad('0x37'),_0xbdad('0x4e'),_0xbdad('0x2c')]})[_0xbdad('0x24')](function(_0x1ddb8f){if(_0x1ddb8f){_0x3c93da=_0x1ddb8f;_0x927acf=_0x4938dc['body'][_0xbdad('0x2c')]?_0x4938dc[_0xbdad('0x38')]['interface']:util[_0xbdad('0x35')](_0xbdad('0x4f'),_0x3c93da[_0xbdad('0x2e')]);return db['User'][_0xbdad('0x50')]({'where':{'role':_0xbdad('0x51'),'online':!![],'id':{'$ne':_0x3c93da['id']}}});}})[_0xbdad('0x24')](function(_0xf8afc2){if(_0xf8afc2){_0x4e4d0a=_0xf8afc2;return require(_0xbdad('0x52'))['getLicense']();}})[_0xbdad('0x24')](function(_0x17bb46){if(_0x17bb46&&_0x17bb46[_0xbdad('0x53')]&&_0x4e4d0a>=_0x17bb46['agents']){throw new Error(_0xbdad('0x54'));}})[_0xbdad('0x24')](function(){if(_0x3c93da){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x3c93da[_0xbdad('0x2e')]},'individualHooks':!![]});}})[_0xbdad('0x24')](function(){if(_0x3c93da){return _0x3c93da[_0xbdad('0x55')]({'raw':!![]});}})[_0xbdad('0x24')](function(_0x1ef23b){if(_0x3c93da){if(_0x1ef23b){var _0xa2f0f9=[];_0x14ed9f=_0x1ef23b;if(_0x14ed9f[_0xbdad('0x2f')]){for(var _0x233388=0x0;_0x233388<_0x14ed9f['length'];_0x233388++){_0xa2f0f9[_0xbdad('0x48')](db['UserVoiceQueueRt'][_0xbdad('0x56')]({'membername':_0x3c93da[_0xbdad('0x2e')],'UserId':_0x3c93da['id'],'queue_name':_0x14ed9f[_0x233388][_0xbdad('0x2e')],'VoiceQueueId':_0x14ed9f[_0x233388]['id'],'interface':_0x927acf,'paused':_0x3c93da[_0xbdad('0x4e')]||![],'penalty':_0x14ed9f[_0x233388][_0xbdad('0x57')]||0x0}));}return BPromise['all'](_0xa2f0f9);}}}})[_0xbdad('0x24')](function(){if(_0x3c93da){return db['MemberReport']['findAll']({'where':{'membername':_0x3c93da[_0xbdad('0x2e')],'exitAt':null}});}})[_0xbdad('0x24')](function(_0xe5a914){if(_0x3c93da){if(_0xe5a914&&_0xe5a914[_0xbdad('0x2f')]){var _0x44fe13=[];_0xe5a914[_0xbdad('0x33')](function(_0x270c91){_0x44fe13['push'](_0x270c91[_0xbdad('0x39')]({'exitAt':moment()['format'](_0xbdad('0x30'))}));});return BPromise['all'](_0x44fe13);}}})[_0xbdad('0x24')](function(_0x35d8b6){if(_0x3c93da){var _0x5369c7=[];var _0x5374f1=[];var _0x24aab9=utils[_0xbdad('0x32')]();var _0x2b6992={'membername':_0x3c93da[_0xbdad('0x2e')],'interface':_0x927acf,'enterAt':moment()[_0xbdad('0x35')](_0xbdad('0x30')),'role':_0x3c93da[_0xbdad('0x2b')],'internal':_0x3c93da[_0xbdad('0x37')]};_0x24aab9['forEach'](function(_0x20844b){_0x5369c7['push'](_[_0xbdad('0x58')]({'channel':_0x20844b,'type':_0xbdad('0x59'),'data1':_0xbdad('0x5a'),'data2':_0x927acf},_0x2b6992));if(_0x3c93da['loginInPause']){_0x5374f1[_0xbdad('0x48')](_[_0xbdad('0x58')]({'channel':_0x20844b,'type':_0xbdad('0x40'),'data1':_0xbdad('0x5b')},_0x2b6992));}});return db['MemberReport'][_0xbdad('0x5c')](_0x5369c7['concat'](_0x5374f1),{'individualHooks':!![]});}})[_0xbdad('0x24')](function(){if(_0x3c93da){return _0x3c93da['update']({'online':!![],'lastLoginAt':moment()[_0xbdad('0x35')](_0xbdad('0x30')),'voicePause':_0x3c93da['loginInPause']||![],'mailPause':_0x3c93da[_0xbdad('0x4e')]||![],'chatPause':_0x3c93da['loginInPause']||![],'faxPause':_0x3c93da[_0xbdad('0x4e')]||![],'smsPause':_0x3c93da[_0xbdad('0x4e')]||![],'openchannelPause':_0x3c93da[_0xbdad('0x4e')]||![],'pauseType':_0x3c93da[_0xbdad('0x4e')]?_0xbdad('0x5b'):null,'lastPauseAt':moment()[_0xbdad('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x927acf});}})[_0xbdad('0x24')](function(_0x175e80){_0x3e9245(_0x175e80);})[_0xbdad('0x26')](function(_0x3ae34b){_0x2b6f9e(_0xad3e67[_0xbdad('0x16')](0x1f4,_0x3ae34b[_0xbdad('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a02ccee..b436020 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 _0x63ae=['save','remove','update','emit','removeListener','register','length','user:','./user.events'];(function(_0x52bf10,_0x5e72fb){var _0x32d8fd=function(_0xa8e67d){while(--_0xa8e67d){_0x52bf10['push'](_0x52bf10['shift']());}};_0x32d8fd(++_0x5e72fb);}(_0x63ae,0x167));var _0xe63a=function(_0x197cca,_0x343c2c){_0x197cca=_0x197cca-0x0;var _0x3b3962=_0x63ae[_0x197cca];return _0x3b3962;};'use strict';var UserEvents=require(_0xe63a('0x0'));var events=[_0xe63a('0x1'),_0xe63a('0x2'),_0xe63a('0x3')];function createListener(_0x5cc91b,_0xe07eaa){return function(_0x350761){_0xe07eaa[_0xe63a('0x4')](_0x5cc91b,_0x350761);};}function removeListener(_0x3b1019,_0x285e88){return function(){UserEvents[_0xe63a('0x5')](_0x3b1019,_0x285e88);};}exports[_0xe63a('0x6')]=function(_0x45fe6d){for(var _0x3b6338=0x0,_0x3749d2=events[_0xe63a('0x7')];_0x3b6338<_0x3749d2;_0x3b6338++){var _0x2bef2a=events[_0x3b6338];var _0x19025d=createListener(_0xe63a('0x8')+_0x2bef2a,_0x45fe6d);UserEvents['on'](_0x2bef2a,_0x19025d);}}; \ No newline at end of file +var _0xd1bd=['removeListener','register','user:','save','remove','update','emit'];(function(_0x51b1f8,_0xf16bfa){var _0x30049f=function(_0x34f27f){while(--_0x34f27f){_0x51b1f8['push'](_0x51b1f8['shift']());}};_0x30049f(++_0xf16bfa);}(_0xd1bd,0x1c3));var _0xdd1b=function(_0x21f61a,_0x6d927b){_0x21f61a=_0x21f61a-0x0;var _0x5dad4f=_0xd1bd[_0x21f61a];return _0x5dad4f;};'use strict';var UserEvents=require('./user.events');var events=[_0xdd1b('0x0'),_0xdd1b('0x1'),_0xdd1b('0x2')];function createListener(_0x1c34fe,_0x2a9ad3){return function(_0x52fe22){_0x2a9ad3[_0xdd1b('0x3')](_0x1c34fe,_0x52fe22);};}function removeListener(_0x3a5d43,_0x93319f){return function(){UserEvents[_0xdd1b('0x4')](_0x3a5d43,_0x93319f);};}exports[_0xdd1b('0x5')]=function(_0xd31e3b){for(var _0x17b7ab=0x0,_0x118d1d=events['length'];_0x17b7ab<_0x118d1d;_0x17b7ab++){var _0x1f842d=events[_0x17b7ab];var _0x4442a9=createListener(_0xdd1b('0x6')+_0x1f842d,_0xd31e3b);UserEvents['on'](_0x1f842d,_0x4442a9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index e2883bb..b026c9e 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x28bfdc,_0x50fd27){var _0x25bf45=function(_0x17f94a){while(--_0x17f94a){_0x28bfdc['push'](_0x28bfdc['shift']());}};_0x25bf45(++_0x50fd27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5b96f6,_0x26fe54){var _0xe67cd8=function(_0x585ce5){while(--_0x585ce5){_0x5b96f6['push'](_0x5b96f6['shift']());}};_0xe67cd8(++_0x26fe54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 042ba4c..54d9177 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 _0x6eed=['sequelize','exports','INTEGER'];(function(_0x3fa294,_0x1b910c){var _0x1b2971=function(_0x5c2199){while(--_0x5c2199){_0x3fa294['push'](_0x3fa294['shift']());}};_0x1b2971(++_0x1b910c);}(_0x6eed,0xff));var _0xd6ee=function(_0x4c91a2,_0x276f4c){_0x4c91a2=_0x4c91a2-0x0;var _0x39ef08=_0x6eed[_0x4c91a2];return _0x39ef08;};'use strict';var Sequelize=require(_0xd6ee('0x0'));module[_0xd6ee('0x1')]={'penalty':{'type':Sequelize[_0xd6ee('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb5b5=['INTEGER','sequelize'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xb5b5,0xc5));var _0x5b5b=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xb5b5[_0x25bca6];return _0x3f8d02;};'use strict';var Sequelize=require(_0x5b5b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5b5b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 589867d..eeecfef 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 _0x7d5d=['user_has_chat_queues','lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','UserChatQueue'];(function(_0x35805e,_0x309cca){var _0x2f52ad=function(_0x2edd70){while(--_0x2edd70){_0x35805e['push'](_0x35805e['shift']());}};_0x2f52ad(++_0x309cca);}(_0x7d5d,0x105));var _0xd7d5=function(_0x48d737,_0x338ed9){_0x48d737=_0x48d737-0x0;var _0x12e5c8=_0x7d5d[_0x48d737];return _0x12e5c8;};'use strict';var _=require(_0xd7d5('0x0'));var util=require('util');var logger=require(_0xd7d5('0x1'))(_0xd7d5('0x2'));var moment=require('moment');var BPromise=require(_0xd7d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7d5('0x4'));var rimraf=require(_0xd7d5('0x5'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0xd7d5('0x6')]=function(_0x5a1020,_0x35f412){return _0x5a1020[_0xd7d5('0x7')](_0xd7d5('0x8'),attributes,{'tableName':_0xd7d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bf9=['exports','UserChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes'];(function(_0x5a48fd,_0xefc08e){var _0x5c005d=function(_0x11cfd7){while(--_0x11cfd7){_0x5a48fd['push'](_0x5a48fd['shift']());}};_0x5c005d(++_0xefc08e);}(_0x6bf9,0x1b2));var _0x96bf=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x6bf9[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x96bf('0x0'));var util=require(_0x96bf('0x1'));var logger=require(_0x96bf('0x2'))(_0x96bf('0x3'));var moment=require(_0x96bf('0x4'));var BPromise=require(_0x96bf('0x5'));var rp=require(_0x96bf('0x6'));var fs=require('fs');var path=require(_0x96bf('0x7'));var rimraf=require('rimraf');var config=require(_0x96bf('0x8'));var attributes=require(_0x96bf('0x9'));module[_0x96bf('0xa')]=function(_0x4f602d,_0xa4da91){return _0x4f602d['define'](_0x96bf('0xb'),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 1d7aae4..42861dd 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 _0xc2af=['client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1bd9a3,_0xef44db){var _0x243ae9=function(_0x388ea3){while(--_0x388ea3){_0x1bd9a3['push'](_0x1bd9a3['shift']());}};_0x243ae9(++_0xef44db);}(_0xc2af,0x8a));var _0xfc2a=function(_0x2a0a90,_0x3cd454){_0x2a0a90=_0x2a0a90-0x0;var _0x14be87=_0xc2af[_0x2a0a90];return _0x14be87;};'use strict';var _=require('lodash');var util=require(_0xfc2a('0x0'));var moment=require(_0xfc2a('0x1'));var BPromise=require(_0xfc2a('0x2'));var rs=require(_0xfc2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc2a('0x4'))['db'];var utils=require(_0xfc2a('0x5'));var logger=require(_0xfc2a('0x6'))('rpc');var config=require(_0xfc2a('0x7'));var jayson=require(_0xfc2a('0x8'));var client=jayson[_0xfc2a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13b5cc,_0x5b91d0,_0x2b4247){return new BPromise(function(_0x108e57,_0x365142){return client[_0xfc2a('0xa')](_0x13b5cc,_0x2b4247)[_0xfc2a('0xb')](function(_0x9f575c){logger[_0xfc2a('0xc')](_0xfc2a('0xd'),_0x5b91d0,_0xfc2a('0xe'));logger[_0xfc2a('0xf')](_0xfc2a('0x10'),_0x5b91d0,_0xfc2a('0xe'),JSON[_0xfc2a('0x11')](_0x9f575c));if(_0x9f575c[_0xfc2a('0x12')]){if(_0x9f575c['error'][_0xfc2a('0x13')]===0x1f4){logger[_0xfc2a('0x12')](_0xfc2a('0xd'),_0x5b91d0,_0x9f575c['error'][_0xfc2a('0x14')]);return _0x365142(_0x9f575c[_0xfc2a('0x12')][_0xfc2a('0x14')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5b91d0,_0x9f575c[_0xfc2a('0x12')][_0xfc2a('0x14')]);return _0x108e57(_0x9f575c[_0xfc2a('0x12')]['message']);}else{logger[_0xfc2a('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x5b91d0,_0xfc2a('0xe'));_0x108e57(_0x9f575c['result'][_0xfc2a('0x14')]);}})['catch'](function(_0x32daaa){logger[_0xfc2a('0x12')](_0xfc2a('0xd'),_0x5b91d0,_0x32daaa);_0x365142(_0x32daaa);});});} \ No newline at end of file +var _0x1e9e=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x423ca9,_0xd4bf74){var _0x474f5c=function(_0x21b351){while(--_0x21b351){_0x423ca9['push'](_0x423ca9['shift']());}};_0x474f5c(++_0xd4bf74);}(_0x1e9e,0x137));var _0xe1e9=function(_0x521552,_0x1b8e48){_0x521552=_0x521552-0x0;var _0x14486b=_0x1e9e[_0x521552];return _0x14486b;};'use strict';var _=require(_0xe1e9('0x0'));var util=require(_0xe1e9('0x1'));var moment=require(_0xe1e9('0x2'));var BPromise=require(_0xe1e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1e9('0x5'));var logger=require(_0xe1e9('0x6'))('rpc');var config=require(_0xe1e9('0x7'));var jayson=require(_0xe1e9('0x8'));var client=jayson[_0xe1e9('0x9')][_0xe1e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x199c1a,_0x1ed4fb,_0x4bb1c8){return new BPromise(function(_0x33a16c,_0x20c2d3){return client[_0xe1e9('0xb')](_0x199c1a,_0x4bb1c8)[_0xe1e9('0xc')](function(_0x3e90b6){logger[_0xe1e9('0xd')](_0xe1e9('0xe'),_0x1ed4fb,_0xe1e9('0xf'));logger[_0xe1e9('0x10')](_0xe1e9('0x11'),_0x1ed4fb,'request\x20sent',JSON[_0xe1e9('0x12')](_0x3e90b6));if(_0x3e90b6[_0xe1e9('0x13')]){if(_0x3e90b6[_0xe1e9('0x13')][_0xe1e9('0x14')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x1ed4fb,_0x3e90b6[_0xe1e9('0x13')][_0xe1e9('0x15')]);return _0x20c2d3(_0x3e90b6[_0xe1e9('0x13')]['message']);}logger[_0xe1e9('0x13')](_0xe1e9('0xe'),_0x1ed4fb,_0x3e90b6['error'][_0xe1e9('0x15')]);return _0x33a16c(_0x3e90b6['error'][_0xe1e9('0x15')]);}else{logger['info'](_0xe1e9('0xe'),_0x1ed4fb,_0xe1e9('0xf'));_0x33a16c(_0x3e90b6['result']['message']);}})[_0xe1e9('0x16')](function(_0x22ad67){logger[_0xe1e9('0x13')](_0xe1e9('0xe'),_0x1ed4fb,_0x22ad67);_0x20c2d3(_0x22ad67);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 6d9b129..42ce90d 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2d68c6,_0x2c58e2){var _0x5a8739=function(_0x22fd26){while(--_0x22fd26){_0x2d68c6['push'](_0x2d68c6['shift']());}};_0x5a8739(++_0x2c58e2);}(_0xedd9,0xfc));var _0x9edd=function(_0xc4b332,_0x29bda0){_0xc4b332=_0xc4b332-0x0;var _0x30cc64=_0xedd9[_0xc4b332];return _0x30cc64;};'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(_0x26d6f0,_0x2892a4){var _0xee56cf=function(_0x3ee9f2){while(--_0x3ee9f2){_0x26d6f0['push'](_0x26d6f0['shift']());}};_0xee56cf(++_0x2892a4);}(_0xe706,0xa3));var _0x6e70=function(_0xf7ff4,_0x543a19){_0xf7ff4=_0xf7ff4-0x0;var _0x554e6a=_0xe706[_0xf7ff4];return _0x554e6a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index fcec8c3..0257abc 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 _0xfba6=['sequelize','exports','INTEGER'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0xfba6,0x16b));var _0x6fba=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xfba6[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x6fba('0x0'));module[_0x6fba('0x1')]={'penalty':{'type':Sequelize[_0x6fba('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6fba('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5958=['exports','INTEGER'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0x5958,0x1ae));var _0x8595=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x5958[_0xb0de07];return _0x4633d8;};'use strict';var Sequelize=require('sequelize');module[_0x8595('0x0')]={'penalty':{'type':Sequelize[_0x8595('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8595('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8307b6e..e595ae2 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 _0x659c=['rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4ddb9d,_0x34982e){var _0x15b56a=function(_0x241ca6){while(--_0x241ca6){_0x4ddb9d['push'](_0x4ddb9d['shift']());}};_0x15b56a(++_0x34982e);}(_0x659c,0x13d));var _0xc659=function(_0x17df1b,_0x4cf1d7){_0x17df1b=_0x17df1b-0x0;var _0x297263=_0x659c[_0x17df1b];return _0x297263;};'use strict';var _=require(_0xc659('0x0'));var util=require(_0xc659('0x1'));var logger=require('../../config/logger')(_0xc659('0x2'));var moment=require(_0xc659('0x3'));var BPromise=require(_0xc659('0x4'));var rp=require(_0xc659('0x5'));var fs=require('fs');var path=require(_0xc659('0x6'));var rimraf=require(_0xc659('0x7'));var config=require(_0xc659('0x8'));var attributes=require(_0xc659('0x9'));module['exports']=function(_0x4835b3,_0x1392fc){return _0x4835b3[_0xc659('0xa')](_0xc659('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e97=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4e97,0xe4));var _0x74e9=function(_0xa931b1,_0x74292e){_0xa931b1=_0xa931b1-0x0;var _0x1de53d=_0x4e97[_0xa931b1];return _0x1de53d;};'use strict';var _=require(_0x74e9('0x0'));var util=require('util');var logger=require(_0x74e9('0x1'))(_0x74e9('0x2'));var moment=require('moment');var BPromise=require(_0x74e9('0x3'));var rp=require(_0x74e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74e9('0x5'));var config=require(_0x74e9('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x74e9('0x7')]=function(_0x3bd6b2,_0xf6054){return _0x3bd6b2[_0x74e9('0x8')]('UserFaxQueue',attributes,{'tableName':_0x74e9('0x9'),'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 55f9ee3..4725864 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 _0x56df=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x56df,0x191));var _0xf56d=function(_0x579607,_0x57290a){_0x579607=_0x579607-0x0;var _0x405c2d=_0x56df[_0x579607];return _0x405c2d;};'use strict';var _=require(_0xf56d('0x0'));var util=require('util');var moment=require(_0xf56d('0x1'));var BPromise=require(_0xf56d('0x2'));var rs=require(_0xf56d('0x3'));var fs=require('fs');var Redis=require(_0xf56d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf56d('0x5'))(_0xf56d('0x6'));var config=require(_0xf56d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf56d('0x8')][_0xf56d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36fcb6,_0x3da1c2,_0x58602d){return new BPromise(function(_0x2bdbaf,_0x410f5b){return client[_0xf56d('0xa')](_0x36fcb6,_0x58602d)[_0xf56d('0xb')](function(_0x23a74f){logger[_0xf56d('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x3da1c2,_0xf56d('0xd'));logger[_0xf56d('0xe')](_0xf56d('0xf'),_0x3da1c2,_0xf56d('0xd'),JSON[_0xf56d('0x10')](_0x23a74f));if(_0x23a74f['error']){if(_0x23a74f[_0xf56d('0x11')][_0xf56d('0x12')]===0x1f4){logger[_0xf56d('0x11')](_0xf56d('0x13'),_0x3da1c2,_0x23a74f[_0xf56d('0x11')][_0xf56d('0x14')]);return _0x410f5b(_0x23a74f[_0xf56d('0x11')][_0xf56d('0x14')]);}logger['error'](_0xf56d('0x13'),_0x3da1c2,_0x23a74f[_0xf56d('0x11')][_0xf56d('0x14')]);return _0x2bdbaf(_0x23a74f[_0xf56d('0x11')][_0xf56d('0x14')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x3da1c2,_0xf56d('0xd'));_0x2bdbaf(_0x23a74f[_0xf56d('0x15')]['message']);}})[_0xf56d('0x16')](function(_0x47c9ba){logger[_0xf56d('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3da1c2,_0x47c9ba);_0x410f5b(_0x47c9ba);});});} \ No newline at end of file +var _0xaf23=['request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x57ce7f,_0x348232){var _0x2d4c4b=function(_0x586866){while(--_0x586866){_0x57ce7f['push'](_0x57ce7f['shift']());}};_0x2d4c4b(++_0x348232);}(_0xaf23,0x8a));var _0x3af2=function(_0x54cfa4,_0x2d41ac){_0x54cfa4=_0x54cfa4-0x0;var _0x26ecf5=_0xaf23[_0x54cfa4];return _0x26ecf5;};'use strict';var _=require(_0x3af2('0x0'));var util=require(_0x3af2('0x1'));var moment=require(_0x3af2('0x2'));var BPromise=require(_0x3af2('0x3'));var rs=require(_0x3af2('0x4'));var fs=require('fs');var Redis=require(_0x3af2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3af2('0x6'));var logger=require(_0x3af2('0x7'))(_0x3af2('0x8'));var config=require(_0x3af2('0x9'));var jayson=require(_0x3af2('0xa'));var client=jayson[_0x3af2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x559663,_0x29ebaf,_0xe93b43){return new BPromise(function(_0x4e7dc5,_0x566079){return client[_0x3af2('0xc')](_0x559663,_0xe93b43)[_0x3af2('0xd')](function(_0x75ac53){logger[_0x3af2('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x29ebaf,_0x3af2('0xf'));logger[_0x3af2('0x10')](_0x3af2('0x11'),_0x29ebaf,_0x3af2('0xf'),JSON[_0x3af2('0x12')](_0x75ac53));if(_0x75ac53[_0x3af2('0x13')]){if(_0x75ac53['error'][_0x3af2('0x14')]===0x1f4){logger[_0x3af2('0x13')](_0x3af2('0x15'),_0x29ebaf,_0x75ac53[_0x3af2('0x13')][_0x3af2('0x16')]);return _0x566079(_0x75ac53[_0x3af2('0x13')][_0x3af2('0x16')]);}logger[_0x3af2('0x13')](_0x3af2('0x15'),_0x29ebaf,_0x75ac53['error'][_0x3af2('0x16')]);return _0x4e7dc5(_0x75ac53[_0x3af2('0x13')][_0x3af2('0x16')]);}else{logger[_0x3af2('0xe')](_0x3af2('0x15'),_0x29ebaf,_0x3af2('0xf'));_0x4e7dc5(_0x75ac53[_0x3af2('0x17')][_0x3af2('0x16')]);}})[_0x3af2('0x18')](function(_0x6cf9d8){logger[_0x3af2('0x13')](_0x3af2('0x15'),_0x29ebaf,_0x6cf9d8);_0x566079(_0x6cf9d8);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7423125..c14f05f 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4af42d,_0x226c6d){var _0x14b54f=function(_0x107076){while(--_0x107076){_0x4af42d['push'](_0x4af42d['shift']());}};_0x14b54f(++_0x226c6d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x382393,_0x3d4ef3){var _0x516d29=function(_0x48545f){while(--_0x48545f){_0x382393['push'](_0x382393['shift']());}};_0x516d29(++_0x3d4ef3);}(_0x70e0,0x17b));var _0x070e=function(_0x3c37d3,_0x506c8a){_0x3c37d3=_0x3c37d3-0x0;var _0x1cb85a=_0x70e0[_0x3c37d3];return _0x1cb85a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 412551a..08a24bc 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 _0x12f1=['sequelize','INTEGER'];(function(_0x42f9a1,_0x229b92){var _0x2c3462=function(_0x54425c){while(--_0x54425c){_0x42f9a1['push'](_0x42f9a1['shift']());}};_0x2c3462(++_0x229b92);}(_0x12f1,0xf4));var _0x112f=function(_0x1f6704,_0x106f36){_0x1f6704=_0x1f6704-0x0;var _0x4acab6=_0x12f1[_0x1f6704];return _0x4acab6;};'use strict';var Sequelize=require(_0x112f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x112f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe685=['INTEGER'];(function(_0x4f873a,_0x5030a){var _0xd9a7df=function(_0x8728a){while(--_0x8728a){_0x4f873a['push'](_0x4f873a['shift']());}};_0xd9a7df(++_0x5030a);}(_0xe685,0x133));var _0x5e68=function(_0x454b59,_0x308697){_0x454b59=_0x454b59-0x0;var _0x4b8f43=_0xe685[_0x454b59];return _0x4b8f43;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5e68('0x0')],'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 512b7eb..f176c0e 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 _0xb424=['exports','define','UserMailQueue','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x44975e,_0x31f91d){var _0x50b79f=function(_0x276aa3){while(--_0x276aa3){_0x44975e['push'](_0x44975e['shift']());}};_0x50b79f(++_0x31f91d);}(_0xb424,0x153));var _0x4b42=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xb424[_0x57f8c0];return _0x117f08;};'use strict';var _=require(_0x4b42('0x0'));var util=require(_0x4b42('0x1'));var logger=require('../../config/logger')(_0x4b42('0x2'));var moment=require('moment');var BPromise=require(_0x4b42('0x3'));var rp=require(_0x4b42('0x4'));var fs=require('fs');var path=require(_0x4b42('0x5'));var rimraf=require(_0x4b42('0x6'));var config=require(_0x4b42('0x7'));var attributes=require(_0x4b42('0x8'));module[_0x4b42('0x9')]=function(_0x2f587b,_0x5dabb8){return _0x2f587b[_0x4b42('0xa')](_0x4b42('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ec9=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue'];(function(_0x34dcbb,_0x1981b9){var _0xe39056=function(_0xf8348d){while(--_0xf8348d){_0x34dcbb['push'](_0x34dcbb['shift']());}};_0xe39056(++_0x1981b9);}(_0x3ec9,0xfd));var _0x93ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ec9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x93ec('0x0'));var logger=require(_0x93ec('0x1'))(_0x93ec('0x2'));var moment=require(_0x93ec('0x3'));var BPromise=require(_0x93ec('0x4'));var rp=require(_0x93ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93ec('0x6'));var config=require(_0x93ec('0x7'));var attributes=require(_0x93ec('0x8'));module['exports']=function(_0x7c8081,_0x17c607){return _0x7c8081[_0x93ec('0x9')](_0x93ec('0xa'),attributes,{'tableName':'user_has_mail_queues','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 7769faa..fdc4302 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x3392cc,_0x1ece67){var _0x15e209=function(_0x5bf6d6){while(--_0x5bf6d6){_0x3392cc['push'](_0x3392cc['shift']());}};_0x15e209(++_0x1ece67);}(_0xe14b,0x93));var _0xbe14=function(_0x55dc89,_0x249353){_0x55dc89=_0x55dc89-0x0;var _0x2984ef=_0xe14b[_0x55dc89];return _0x2984ef;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index f103e66..e0c89eb 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 _0xd373=['sendUserNotification','exports','multer','path','express','fs-extra','../../components/auth/service','./userNotification.controller','post','isAuthenticated'];(function(_0x287d51,_0x46b59f){var _0x3709c7=function(_0x57180f){while(--_0x57180f){_0x287d51['push'](_0x287d51['shift']());}};_0x3709c7(++_0x46b59f);}(_0xd373,0x156));var _0x3d37=function(_0x996c9a,_0x35a5b2){_0x996c9a=_0x996c9a-0x0;var _0x1e8eeb=_0xd373[_0x996c9a];return _0x1e8eeb;};'use strict';var multer=require(_0x3d37('0x0'));var util=require('util');var path=require(_0x3d37('0x1'));var timeout=require('connect-timeout');var express=require(_0x3d37('0x2'));var router=express['Router']();var fs_extra=require(_0x3d37('0x3'));var auth=require(_0x3d37('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3d37('0x5'));router[_0x3d37('0x6')]('/',auth[_0x3d37('0x7')](),controller[_0x3d37('0x8')]);module[_0x3d37('0x9')]=router; \ No newline at end of file +var _0x99a2=['fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','util','path','Router'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x99a2,0x115));var _0x299a=function(_0x4fda10,_0x13d395){_0x4fda10=_0x4fda10-0x0;var _0x57e74f=_0x99a2[_0x4fda10];return _0x57e74f;};'use strict';var multer=require('multer');var util=require(_0x299a('0x0'));var path=require(_0x299a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x299a('0x2')]();var fs_extra=require(_0x299a('0x3'));var auth=require(_0x299a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x299a('0x5'));var controller=require(_0x299a('0x6'));router[_0x299a('0x7')]('/',auth['isAuthenticated'](),controller[_0x299a('0x8')]);module[_0x299a('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 91c4276..54d873b 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 _0x20f1=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1fc184,_0x557630){var _0x5d39fc=function(_0x21c01e){while(--_0x21c01e){_0x1fc184['push'](_0x1fc184['shift']());}};_0x5d39fc(++_0x557630);}(_0x20f1,0x144));var _0x120f=function(_0x46fac6,_0x4b3498){_0x46fac6=_0x46fac6-0x0;var _0x20a2ba=_0x20f1[_0x46fac6];return _0x20a2ba;};'use strict';var Sequelize=require('sequelize');module[_0x120f('0x0')]={'body':{'type':Sequelize[_0x120f('0x1')]},'senderName':{'type':Sequelize[_0x120f('0x2')]},'recipientsId':{'type':Sequelize[_0x120f('0x1')]},'recipientsDescription':{'type':Sequelize[_0x120f('0x2')]},'beep':{'type':Sequelize[_0x120f('0x3')]}}; \ No newline at end of file +var _0x3131=['STRING','sequelize','exports','TEXT'];(function(_0x5dfbf0,_0x121c7a){var _0x48f28=function(_0x5e5e43){while(--_0x5e5e43){_0x5dfbf0['push'](_0x5dfbf0['shift']());}};_0x48f28(++_0x121c7a);}(_0x3131,0x159));var _0x1313=function(_0x4fce0b,_0x2d6fdd){_0x4fce0b=_0x4fce0b-0x0;var _0x42380f=_0x3131[_0x4fce0b];return _0x42380f;};'use strict';var Sequelize=require(_0x1313('0x0'));module[_0x1313('0x1')]={'body':{'type':Sequelize[_0x1313('0x2')]},'senderName':{'type':Sequelize[_0x1313('0x3')]},'recipientsId':{'type':Sequelize[_0x1313('0x2')]},'recipientsDescription':{'type':Sequelize[_0x1313('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8c43ba9..443ccab 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 _0x1987=['getAgents','map','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','undefined','limit','offset','count','set','apply','reject','then','destroy','sendStatus','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','html','startCase','union','ids','replace','queue','Queue','push','all','findOne'];(function(_0x2d19ea,_0x51e0bf){var _0x543c09=function(_0x4c0d11){while(--_0x4c0d11){_0x2d19ea['push'](_0x2d19ea['shift']());}};_0x543c09(++_0x51e0bf);}(_0x1987,0x1e2));var _0x7198=function(_0x4aebb8,_0x4da00f){_0x4aebb8=_0x4aebb8-0x0;var _0xc5356a=_0x1987[_0x4aebb8];return _0xc5356a;};'use strict';var emlformat=require(_0x7198('0x0'));var rimraf=require(_0x7198('0x1'));var zipdir=require(_0x7198('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7198('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7198('0x4'));var util=require(_0x7198('0x5'));var path=require(_0x7198('0x6'));var sox=require(_0x7198('0x7'));var csv=require(_0x7198('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7198('0x9'));var _=require(_0x7198('0xa'));var squel=require(_0x7198('0xb'));var crypto=require(_0x7198('0xc'));var jsforce=require(_0x7198('0xd'));var deskjs=require(_0x7198('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7198('0xf'));var Papa=require(_0x7198('0x10'));var Redis=require(_0x7198('0x11'));var authService=require(_0x7198('0x12'));var qs=require(_0x7198('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7198('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7198('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7198('0x16'))['db'];config[_0x7198('0x17')]=_[_0x7198('0x18')](config[_0x7198('0x17')],{'host':_0x7198('0x19'),'port':0x18eb});var socket=require(_0x7198('0x1a'))(new Redis(config['redis']));require(_0x7198('0x1b'))[_0x7198('0x1c')](socket);function respondWithStatusCode(_0x47ea0d,_0x215cfe){_0x215cfe=_0x215cfe||0xcc;return function(_0x4eac85){if(_0x4eac85){return _0x47ea0d['sendStatus'](_0x215cfe);}return _0x47ea0d[_0x7198('0x1d')](_0x215cfe)[_0x7198('0x1e')]();};}function respondWithResult(_0x268541,_0x41387d){_0x41387d=_0x41387d||0xc8;return function(_0x205c28){if(_0x205c28){return _0x268541['status'](_0x41387d)[_0x7198('0x1f')](_0x205c28);}};}function respondWithFilteredResult(_0x523e1e,_0xd53f57){return function(_0x553584){if(_0x553584){var _0x1e252d=typeof _0xd53f57['offset']===_0x7198('0x20')&&typeof _0xd53f57[_0x7198('0x21')]===_0x7198('0x20');var _0x52acad=_0x553584['count'];var _0x50b668=_0x1e252d?0x0:_0xd53f57[_0x7198('0x22')];var _0x1b7274=_0x1e252d?_0x553584[_0x7198('0x23')]:_0xd53f57[_0x7198('0x22')]+_0xd53f57[_0x7198('0x21')];var _0x5c4c67;if(_0x1b7274>=_0x52acad){_0x1b7274=_0x52acad;_0x5c4c67=0xc8;}else{_0x5c4c67=0xce;}_0x523e1e[_0x7198('0x1d')](_0x5c4c67);return _0x523e1e[_0x7198('0x24')]('Content-Range',_0x50b668+'-'+_0x1b7274+'/'+_0x52acad)[_0x7198('0x1f')](_0x553584);}return null;};}function patchUpdates(_0x5d6827){return function(_0x4eaa9d){try{jsonpatch[_0x7198('0x25')](_0x4eaa9d,_0x5d6827,!![]);}catch(_0x5dfa1d){return BPromise[_0x7198('0x26')](_0x5dfa1d);}return _0x4eaa9d['save']();};}function saveUpdates(_0x1c42b2,_0x3d682f){return function(_0x470835){if(_0x470835){return _0x470835['update'](_0x1c42b2)[_0x7198('0x27')](function(_0x515bbb){return _0x515bbb;});}return null;};}function removeEntity(_0x49b074,_0x33bcc5){return function(_0x27bd49){if(_0x27bd49){return _0x27bd49[_0x7198('0x28')]()[_0x7198('0x27')](function(){_0x49b074[_0x7198('0x1d')](0xcc)[_0x7198('0x1e')]();});}};}function handleEntityNotFound(_0x23cc0c,_0x16a1ff){return function(_0x292d98){if(!_0x292d98){_0x23cc0c[_0x7198('0x29')](0x194);}return _0x292d98;};}function handleError(_0x695c81,_0x422350){_0x422350=_0x422350||0x1f4;return function(_0x1f59b6){logger['error'](_0x1f59b6[_0x7198('0x2a')]);if(_0x1f59b6['name']){delete _0x1f59b6[_0x7198('0x2b')];}_0x695c81[_0x7198('0x1d')](_0x422350)['send'](_0x1f59b6);};}exports[_0x7198('0x2c')]=function(_0x4fffb4,_0x3d7331,_0x22763e){if(!_0x4fffb4[_0x7198('0x2d')][_0x7198('0x2e')](_0x7198('0x2f'))&&!_0x4fffb4[_0x7198('0x2d')][_0x7198('0x2e')](_0x7198('0x30'))){throw new db[(_0x7198('0x31'))][(_0x7198('0x32'))](_0x7198('0x33'));}else{if(_0x4fffb4['body'][_0x7198('0x2e')]('TemplateId')&&!_0x4fffb4[_0x7198('0x2d')][_0x7198('0x2e')](_0x7198('0x34'))){throw new db[(_0x7198('0x31'))][(_0x7198('0x32'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4fffb4[_0x7198('0x2d')]['hasOwnProperty'](_0x7198('0x35'))){throw new db[(_0x7198('0x31'))]['ValidationError'](_0x7198('0x36'));}else{try{var _0x538830=JSON[_0x7198('0x37')](_0x4fffb4[_0x7198('0x2d')][_0x7198('0x35')]);}catch(_0x545da6){logger[_0x7198('0x38')](_0x545da6);throw new db[(_0x7198('0x31'))]['ValidationError'](_0x7198('0x39'));}var _0x4df5f9=[_0x7198('0x3a'),_0x7198('0x3b'),_0x7198('0x3c'),_0x7198('0x3d'),_0x7198('0x3e'),_0x7198('0x3f'),'whatsappqueue','team',_0x7198('0x40')];if(_['some'](_0x538830,function(_0x2e2674){return!_[_0x7198('0x41')](_0x4df5f9,_0x2e2674[_0x7198('0x42')]['toLowerCase']());})){throw new db[(_0x7198('0x31'))][(_0x7198('0x32'))](_0x7198('0x43'));}}}var _0x138b05={};_0x138b05[_0x7198('0x44')]=_0x4fffb4['body'][_0x7198('0x2e')]('senderName')?_0x4fffb4[_0x7198('0x2d')][_0x7198('0x44')]:_0x4fffb4[_0x7198('0x40')][_0x7198('0x45')];_0x138b05[_0x7198('0x46')]=_[_0x7198('0x47')](_0x4fffb4['body']['recipientsDescription'])?null:_0x4fffb4[_0x7198('0x2d')][_0x7198('0x46')];_0x138b05[_0x7198('0x48')]=_0x4fffb4['body'][_0x7198('0x48')]||![];_0x138b05[_0x7198('0x49')]=_0x4fffb4[_0x7198('0x40')]['id'];return getContent(_0x4fffb4[_0x7198('0x2d')])['then'](function(_0x252ed5){_0x138b05['body']=_0x252ed5;return getRecipients(_0x538830);})['then'](function(_0x354ec2){_0x138b05[_0x7198('0x4a')]=_[_0x7198('0x4b')](_0x354ec2)['join'](',');return db['sequelize'][_0x7198('0x4c')](function(_0x2b5e25){return db[_0x7198('0x4d')][_0x7198('0x4e')](_0x138b05,{'raw':!![],'transaction':_0x2b5e25})[_0x7198('0x27')](function(_0x583511){var _0x2b0273={'sender':_0x138b05[_0x7198('0x44')],'description':_0x138b05[_0x7198('0x46')],'content':_0x138b05['body'],'beep':_0x138b05[_0x7198('0x48')]};_0x354ec2[_0x7198('0x4f')](function(_0x57d664){_0x2b0273[_0x7198('0x50')]=_0x57d664;socket['emit'](_0x7198('0x51'),_0x2b0273);});return _0x583511;});});})['then'](respondWithResult(_0x3d7331,0xc9))[_0x7198('0x52')](handleError(_0x3d7331,null));};function getContent(_0x3018d0){return new BPromise(function(_0x49df4b,_0x1994bd){if(_0x3018d0[_0x7198('0x2f')]){_0x49df4b(_0x3018d0['text']);return;}return db[_0x7198('0x53')]['findOne']({'attributes':[_0x7198('0x54')],'where':{'id':_0x3018d0[_0x7198('0x30')]},'raw':!![]})[_0x7198('0x27')](function(_0x1c630d){if(!_0x1c630d)throw new db['Sequelize'][(_0x7198('0x32'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x501d6e=Mustache['render'](_0x1c630d[_0x7198('0x54')],_0x3018d0[_0x7198('0x34')]);_0x49df4b(_0x501d6e);})[_0x7198('0x52')](function(_0x16194b){_0x1994bd(_0x16194b);});});}function getRecipients(_0x96073e){return new BPromise(function(_0x57beea,_0x2806a3){var _0x19804d=[];var _0x27b3c9=[];_0x96073e[_0x7198('0x4f')](function(_0x3989da){var _0x2990bc=_[_0x7198('0x55')](_0x3989da[_0x7198('0x42')]['toLowerCase']());if(_0x2990bc==='User'){_0x19804d=_[_0x7198('0x56')](_0x19804d,_0x3989da[_0x7198('0x57')]);}else{if(_[_0x7198('0x41')](_0x2990bc,'queue'))_0x2990bc=_0x2990bc[_0x7198('0x58')](_0x7198('0x59'),_0x7198('0x5a'));_0x3989da['ids']['forEach'](function(_0x31cec6){_0x27b3c9[_0x7198('0x5b')](getAgents(_0x2990bc,_0x31cec6));});}});return BPromise[_0x7198('0x5c')](_0x27b3c9)[_0x7198('0x27')](function(_0x1745c2){_0x19804d=_[_0x7198('0x56')](_0x19804d,_['flatten'](_0x1745c2));_0x57beea(_0x19804d);})[_0x7198('0x52')](function(_0x3918a2){_0x2806a3(_0x3918a2);});});}function getAgents(_0xde3611,_0x1c2e72){return new BPromise(function(_0x26c8d8,_0x11c13b){return db[_0xde3611][_0x7198('0x5d')]({'where':{'id':_0x1c2e72}})['then'](function(_0x3402f5){return _0x3402f5[_0x7198('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x286e22){var _0x4db443=_[_0x7198('0x5f')](_0x286e22,'id');_0x26c8d8(_0x4db443);});})[_0x7198('0x52')](function(_0x5c6178){_0x11c13b(_0x5c6178);});});} \ No newline at end of file +var _0x9240=['limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','body','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','startCase','User','union','includes','queue','replace','ids','push','all','flatten','catch','getAgents','map','eml-format','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9240,0x1c2));var _0x0924=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9240[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0x0924('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(_0x0924('0x1'));var Mustache=require(_0x0924('0x2'));var util=require(_0x0924('0x3'));var path=require(_0x0924('0x4'));var sox=require(_0x0924('0x5'));var csv=require('to-csv');var ejs=require(_0x0924('0x6'));var fs=require('fs');var fs_extra=require(_0x0924('0x7'));var _=require(_0x0924('0x8'));var squel=require('squel');var crypto=require(_0x0924('0x9'));var jsforce=require(_0x0924('0xa'));var deskjs=require(_0x0924('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0924('0xc'));var Papa=require('papaparse');var Redis=require(_0x0924('0xd'));var authService=require(_0x0924('0xe'));var qs=require(_0x0924('0xf'));var as=require(_0x0924('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0924('0x11'))(_0x0924('0x12'));var utils=require(_0x0924('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0924('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0924('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0924('0x16'))[_0x0924('0x17')](socket);function respondWithStatusCode(_0x52097e,_0x585030){_0x585030=_0x585030||0xcc;return function(_0x483769){if(_0x483769){return _0x52097e[_0x0924('0x18')](_0x585030);}return _0x52097e[_0x0924('0x19')](_0x585030)[_0x0924('0x1a')]();};}function respondWithResult(_0x3b0b17,_0x5eb724){_0x5eb724=_0x5eb724||0xc8;return function(_0x42ec4a){if(_0x42ec4a){return _0x3b0b17['status'](_0x5eb724)[_0x0924('0x1b')](_0x42ec4a);}};}function respondWithFilteredResult(_0x34811a,_0x995c85){return function(_0xec1b0f){if(_0xec1b0f){var _0x1928d6=typeof _0x995c85[_0x0924('0x1c')]===_0x0924('0x1d')&&typeof _0x995c85[_0x0924('0x1e')]==='undefined';var _0x1286c3=_0xec1b0f['count'];var _0x43e3ac=_0x1928d6?0x0:_0x995c85['offset'];var _0x29556d=_0x1928d6?_0xec1b0f[_0x0924('0x1f')]:_0x995c85[_0x0924('0x1c')]+_0x995c85['limit'];var _0x541cb2;if(_0x29556d>=_0x1286c3){_0x29556d=_0x1286c3;_0x541cb2=0xc8;}else{_0x541cb2=0xce;}_0x34811a[_0x0924('0x19')](_0x541cb2);return _0x34811a[_0x0924('0x20')](_0x0924('0x21'),_0x43e3ac+'-'+_0x29556d+'/'+_0x1286c3)['json'](_0xec1b0f);}return null;};}function patchUpdates(_0x20fcf3){return function(_0x10ff10){try{jsonpatch[_0x0924('0x22')](_0x10ff10,_0x20fcf3,!![]);}catch(_0x2cc097){return BPromise[_0x0924('0x23')](_0x2cc097);}return _0x10ff10[_0x0924('0x24')]();};}function saveUpdates(_0x61aa24,_0x291fe3){return function(_0x1aefad){if(_0x1aefad){return _0x1aefad['update'](_0x61aa24)['then'](function(_0x5c87a6){return _0x5c87a6;});}return null;};}function removeEntity(_0x5cb413,_0x44cab1){return function(_0x5271d1){if(_0x5271d1){return _0x5271d1['destroy']()[_0x0924('0x25')](function(){_0x5cb413['status'](0xcc)[_0x0924('0x1a')]();});}};}function handleEntityNotFound(_0x2a60d6,_0x26e23b){return function(_0x41d379){if(!_0x41d379){_0x2a60d6[_0x0924('0x18')](0x194);}return _0x41d379;};}function handleError(_0x4423eb,_0xc0b2ef){_0xc0b2ef=_0xc0b2ef||0x1f4;return function(_0x51e68c){logger['error'](_0x51e68c[_0x0924('0x26')]);if(_0x51e68c[_0x0924('0x27')]){delete _0x51e68c[_0x0924('0x27')];}_0x4423eb[_0x0924('0x19')](_0xc0b2ef)[_0x0924('0x28')](_0x51e68c);};}exports['sendUserNotification']=function(_0x1be7ee,_0x599064,_0x3f3eb1){if(!_0x1be7ee[_0x0924('0x29')][_0x0924('0x2a')]('text')&&!_0x1be7ee['body'][_0x0924('0x2a')](_0x0924('0x2b'))){throw new db['Sequelize'][(_0x0924('0x2c'))](_0x0924('0x2d'));}else{if(_0x1be7ee['body'][_0x0924('0x2a')]('TemplateId')&&!_0x1be7ee[_0x0924('0x29')][_0x0924('0x2a')]('view')){throw new db['Sequelize'][(_0x0924('0x2c'))](_0x0924('0x2e'));}if(!_0x1be7ee[_0x0924('0x29')][_0x0924('0x2a')](_0x0924('0x2f'))){throw new db[(_0x0924('0x30'))][(_0x0924('0x2c'))](_0x0924('0x31'));}else{try{var _0x239150=JSON[_0x0924('0x32')](_0x1be7ee[_0x0924('0x29')][_0x0924('0x2f')]);}catch(_0x4621ed){logger[_0x0924('0x33')](_0x4621ed);throw new db[(_0x0924('0x30'))][(_0x0924('0x2c'))](_0x0924('0x34'));}var _0x5c4718=['chatqueue',_0x0924('0x35'),_0x0924('0x36'),'openchannelqueue','smsqueue',_0x0924('0x37'),_0x0924('0x38'),_0x0924('0x39'),_0x0924('0x3a')];if(_[_0x0924('0x3b')](_0x239150,function(_0x4f04e0){return!_['includes'](_0x5c4718,_0x4f04e0[_0x0924('0x3c')][_0x0924('0x3d')]());})){throw new db['Sequelize'][(_0x0924('0x2c'))](_0x0924('0x3e'));}}}var _0x14f24d={};_0x14f24d[_0x0924('0x3f')]=_0x1be7ee[_0x0924('0x29')]['hasOwnProperty'](_0x0924('0x3f'))?_0x1be7ee[_0x0924('0x29')]['senderName']:_0x1be7ee['user']['fullname'];_0x14f24d[_0x0924('0x40')]=_['isEmpty'](_0x1be7ee[_0x0924('0x29')]['recipientsDescription'])?null:_0x1be7ee['body'][_0x0924('0x40')];_0x14f24d['beep']=_0x1be7ee[_0x0924('0x29')][_0x0924('0x41')]||![];_0x14f24d[_0x0924('0x42')]=_0x1be7ee[_0x0924('0x3a')]['id'];return getContent(_0x1be7ee[_0x0924('0x29')])[_0x0924('0x25')](function(_0x599f82){_0x14f24d[_0x0924('0x29')]=_0x599f82;return getRecipients(_0x239150);})[_0x0924('0x25')](function(_0x24737e){_0x14f24d[_0x0924('0x43')]=_[_0x0924('0x44')](_0x24737e)['join'](',');return db[_0x0924('0x45')][_0x0924('0x46')](function(_0x45bf9d){return db[_0x0924('0x47')][_0x0924('0x48')](_0x14f24d,{'raw':!![],'transaction':_0x45bf9d})[_0x0924('0x25')](function(_0x357f80){var _0x36c4de={'sender':_0x14f24d[_0x0924('0x3f')],'description':_0x14f24d[_0x0924('0x40')],'content':_0x14f24d['body'],'beep':_0x14f24d['beep']};_0x24737e[_0x0924('0x49')](function(_0x5acd8f){_0x36c4de['recipient']=_0x5acd8f;socket[_0x0924('0x4a')](_0x0924('0x4b'),_0x36c4de);});return _0x357f80;});});})['then'](respondWithResult(_0x599064,0xc9))['catch'](handleError(_0x599064,null));};function getContent(_0x4770e4){return new BPromise(function(_0x597493,_0xebf1e0){if(_0x4770e4[_0x0924('0x4c')]){_0x597493(_0x4770e4[_0x0924('0x4c')]);return;}return db[_0x0924('0x4d')][_0x0924('0x4e')]({'attributes':['html'],'where':{'id':_0x4770e4[_0x0924('0x2b')]},'raw':!![]})['then'](function(_0x51b656){if(!_0x51b656)throw new db[(_0x0924('0x30'))][(_0x0924('0x2c'))](_0x0924('0x4f'));var _0x29223b=Mustache[_0x0924('0x50')](_0x51b656[_0x0924('0x51')],_0x4770e4[_0x0924('0x52')]);_0x597493(_0x29223b);})['catch'](function(_0x224056){_0xebf1e0(_0x224056);});});}function getRecipients(_0x48f1b8){return new BPromise(function(_0x14ff97,_0x1f71ca){var _0x5f4501=[];var _0x5d9558=[];_0x48f1b8[_0x0924('0x49')](function(_0xcc8975){var _0x6b9ee7=_[_0x0924('0x53')](_0xcc8975[_0x0924('0x3c')]['toLowerCase']());if(_0x6b9ee7===_0x0924('0x54')){_0x5f4501=_[_0x0924('0x55')](_0x5f4501,_0xcc8975['ids']);}else{if(_[_0x0924('0x56')](_0x6b9ee7,_0x0924('0x57')))_0x6b9ee7=_0x6b9ee7[_0x0924('0x58')](_0x0924('0x57'),'Queue');_0xcc8975[_0x0924('0x59')][_0x0924('0x49')](function(_0x1bbd65){_0x5d9558[_0x0924('0x5a')](getAgents(_0x6b9ee7,_0x1bbd65));});}});return BPromise[_0x0924('0x5b')](_0x5d9558)[_0x0924('0x25')](function(_0x143f85){_0x5f4501=_['union'](_0x5f4501,_[_0x0924('0x5c')](_0x143f85));_0x14ff97(_0x5f4501);})[_0x0924('0x5d')](function(_0x26eae0){_0x1f71ca(_0x26eae0);});});}function getAgents(_0x1b4ca3,_0x1cc9a9){return new BPromise(function(_0xb95528,_0x433318){return db[_0x1b4ca3][_0x0924('0x4e')]({'where':{'id':_0x1cc9a9}})[_0x0924('0x25')](function(_0x46f50e){return _0x46f50e[_0x0924('0x5e')]({'attributes':['id'],'raw':!![]})[_0x0924('0x25')](function(_0x4e6da2){var _0x10ff4b=_[_0x0924('0x5f')](_0x4e6da2,'id');_0xb95528(_0x10ff4b);});})[_0x0924('0x5d')](function(_0x399b62){_0x433318(_0x399b62);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 02ca78a..bff976d 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 _0xc9ac=['../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x26390f,_0x5e1005){var _0x3d9d11=function(_0x3402e0){while(--_0x3402e0){_0x26390f['push'](_0x26390f['shift']());}};_0x3d9d11(++_0x5e1005);}(_0xc9ac,0x1e9));var _0xcc9a=function(_0xfdedab,_0x7e0a3d){_0xfdedab=_0xfdedab-0x0;var _0x29d28d=_0xc9ac[_0xfdedab];return _0x29d28d;};'use strict';var EventEmitter=require(_0xcc9a('0x0'));var UserNotification=require(_0xcc9a('0x1'))['db'][_0xcc9a('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcc9a('0x3')](0x0);var events={'afterCreate':_0xcc9a('0x4'),'afterUpdate':_0xcc9a('0x5'),'afterDestroy':_0xcc9a('0x6')};function emitEvent(_0x4754e4){return function(_0x52249b,_0x1ff481,_0x3b4647){UserNotificationEvents['emit'](_0x4754e4+':'+_0x52249b['id'],_0x52249b);UserNotificationEvents[_0xcc9a('0x7')](_0x4754e4,_0x52249b);_0x3b4647(null);};}for(var e in events){if(events[_0xcc9a('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xcc9a('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x0007=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x22a6a0,_0x4860dc){var _0x3ddd0d=function(_0x551ee3){while(--_0x551ee3){_0x22a6a0['push'](_0x22a6a0['shift']());}};_0x3ddd0d(++_0x4860dc);}(_0x0007,0x1ab));var _0x7000=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0007[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0x7000('0x0'));var UserNotification=require(_0x7000('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7000('0x2')](0x0);var events={'afterCreate':_0x7000('0x3'),'afterUpdate':_0x7000('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2dd2f8){return function(_0x4c3b00,_0x562db2,_0x2c898c){UserNotificationEvents[_0x7000('0x5')](_0x2dd2f8+':'+_0x4c3b00['id'],_0x4c3b00);UserNotificationEvents[_0x7000('0x5')](_0x2dd2f8,_0x4c3b00);_0x2c898c(null);};}for(var e in events){if(events[_0x7000('0x6')](e)){var event=events[e];UserNotification[_0x7000('0x7')](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 72c08dc..6833362 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 _0x713e=['define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','./userNotification.attributes','exports'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x713e,0x147));var _0xe713=function(_0x2230fc,_0x4e16c0){_0x2230fc=_0x2230fc-0x0;var _0xf47695=_0x713e[_0x2230fc];return _0xf47695;};'use strict';var _=require(_0xe713('0x0'));var util=require(_0xe713('0x1'));var logger=require(_0xe713('0x2'))(_0xe713('0x3'));var moment=require('moment');var BPromise=require(_0xe713('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe713('0x5'));var rimraf=require(_0xe713('0x6'));var config=require('../../config/environment');var attributes=require(_0xe713('0x7'));module[_0xe713('0x8')]=function(_0x47f3ea,_0x1cb55a){return _0x47f3ea[_0xe713('0x9')](_0xe713('0xa'),attributes,{'tableName':_0xe713('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe713('0xc'),'collate':_0xe713('0xd')});}; \ No newline at end of file +var _0x5ddc=['userNotifications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x5ddc,0x80));var _0xc5dd=function(_0x590007,_0x393f71){_0x590007=_0x590007-0x0;var _0x476358=_0x5ddc[_0x590007];return _0x476358;};'use strict';var _=require(_0xc5dd('0x0'));var util=require(_0xc5dd('0x1'));var logger=require('../../config/logger')(_0xc5dd('0x2'));var moment=require(_0xc5dd('0x3'));var BPromise=require(_0xc5dd('0x4'));var rp=require(_0xc5dd('0x5'));var fs=require('fs');var path=require(_0xc5dd('0x6'));var rimraf=require(_0xc5dd('0x7'));var config=require('../../config/environment');var attributes=require(_0xc5dd('0x8'));module[_0xc5dd('0x9')]=function(_0x491174,_0x3f4c3f){return _0x491174[_0xc5dd('0xa')](_0xc5dd('0xb'),attributes,{'tableName':_0xc5dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc5dd('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 12c4937..4aaa7ef 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 _0x1473=['message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49534f,_0xa81c15){var _0x1f3663=function(_0x4e23d9){while(--_0x4e23d9){_0x49534f['push'](_0x49534f['shift']());}};_0x1f3663(++_0xa81c15);}(_0x1473,0x111));var _0x3147=function(_0x17838e,_0x3579f4){_0x17838e=_0x17838e-0x0;var _0x350b25=_0x1473[_0x17838e];return _0x350b25;};'use strict';var _=require(_0x3147('0x0'));var util=require(_0x3147('0x1'));var moment=require(_0x3147('0x2'));var BPromise=require(_0x3147('0x3'));var rs=require(_0x3147('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3147('0x5'));var logger=require(_0x3147('0x6'))(_0x3147('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3147('0x8')][_0x3147('0x9')]({'port':0x232a});config['redis']=_[_0x3147('0xa')](config['redis'],{'host':_0x3147('0xb'),'port':0x18eb});var socket=require(_0x3147('0xc'))(new Redis(config[_0x3147('0xd')]));require(_0x3147('0xe'))[_0x3147('0xf')](socket);function respondWithRpcPromise(_0x57e12d,_0x2b0669,_0x28fc18){return new BPromise(function(_0x5dbe13,_0x413079){return client[_0x3147('0x10')](_0x57e12d,_0x28fc18)['then'](function(_0x24ff34){logger[_0x3147('0x11')](_0x3147('0x12'),_0x2b0669,'request\x20sent');logger[_0x3147('0x13')](_0x3147('0x14'),_0x2b0669,'request\x20sent',JSON[_0x3147('0x15')](_0x24ff34));if(_0x24ff34[_0x3147('0x16')]){if(_0x24ff34[_0x3147('0x16')][_0x3147('0x17')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x2b0669,_0x24ff34['error']['message']);return _0x413079(_0x24ff34[_0x3147('0x16')][_0x3147('0x18')]);}logger[_0x3147('0x16')](_0x3147('0x12'),_0x2b0669,_0x24ff34['error']['message']);return _0x5dbe13(_0x24ff34[_0x3147('0x16')][_0x3147('0x18')]);}else{logger[_0x3147('0x11')](_0x3147('0x12'),_0x2b0669,_0x3147('0x19'));_0x5dbe13(_0x24ff34['result']['message']);}})[_0x3147('0x1a')](function(_0x4f4289){logger[_0x3147('0x16')](_0x3147('0x12'),_0x2b0669,_0x4f4289);_0x413079(_0x4f4289);});});} \ No newline at end of file +var _0xde2f=['socket.io-emitter','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x1286d5,_0x5c2870){var _0x1e06b0=function(_0x337496){while(--_0x337496){_0x1286d5['push'](_0x1286d5['shift']());}};_0x1e06b0(++_0x5c2870);}(_0xde2f,0x113));var _0xfde2=function(_0x3bf978,_0x317464){_0x3bf978=_0x3bf978-0x0;var _0x3620d5=_0xde2f[_0x3bf978];return _0x3620d5;};'use strict';var _=require(_0xfde2('0x0'));var util=require(_0xfde2('0x1'));var moment=require(_0xfde2('0x2'));var BPromise=require(_0xfde2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfde2('0x4'));var db=require(_0xfde2('0x5'))['db'];var utils=require(_0xfde2('0x6'));var logger=require(_0xfde2('0x7'))(_0xfde2('0x8'));var config=require(_0xfde2('0x9'));var jayson=require(_0xfde2('0xa'));var client=jayson[_0xfde2('0xb')][_0xfde2('0xc')]({'port':0x232a});config[_0xfde2('0xd')]=_[_0xfde2('0xe')](config[_0xfde2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xfde2('0xf'))(new Redis(config[_0xfde2('0xd')]));require(_0xfde2('0x10'))[_0xfde2('0x11')](socket);function respondWithRpcPromise(_0x43a470,_0xbb3f,_0x31ff7e){return new BPromise(function(_0x3797c7,_0x3780a6){return client['request'](_0x43a470,_0x31ff7e)[_0xfde2('0x12')](function(_0x1ef0c8){logger[_0xfde2('0x13')](_0xfde2('0x14'),_0xbb3f,'request\x20sent');logger[_0xfde2('0x15')](_0xfde2('0x16'),_0xbb3f,_0xfde2('0x17'),JSON[_0xfde2('0x18')](_0x1ef0c8));if(_0x1ef0c8['error']){if(_0x1ef0c8[_0xfde2('0x19')][_0xfde2('0x1a')]===0x1f4){logger[_0xfde2('0x19')]('UserNotification,\x20%s,\x20%s',_0xbb3f,_0x1ef0c8[_0xfde2('0x19')][_0xfde2('0x1b')]);return _0x3780a6(_0x1ef0c8[_0xfde2('0x19')][_0xfde2('0x1b')]);}logger[_0xfde2('0x19')](_0xfde2('0x14'),_0xbb3f,_0x1ef0c8[_0xfde2('0x19')][_0xfde2('0x1b')]);return _0x3797c7(_0x1ef0c8[_0xfde2('0x19')][_0xfde2('0x1b')]);}else{logger[_0xfde2('0x13')]('UserNotification,\x20%s,\x20%s',_0xbb3f,_0xfde2('0x17'));_0x3797c7(_0x1ef0c8[_0xfde2('0x1c')]['message']);}})['catch'](function(_0x5259c7){logger[_0xfde2('0x19')](_0xfde2('0x14'),_0xbb3f,_0x5259c7);_0x3780a6(_0x5259c7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 87127a6..160008e 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 _0xde87=['userNotification:','./userNotification.events','save','update','emit','register','length'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xde87,0x104));var _0x7de8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xde87[_0x2c91e9];return _0x13f0ff;};'use strict';var UserNotificationEvents=require(_0x7de8('0x0'));var events=[_0x7de8('0x1'),'remove',_0x7de8('0x2')];function createListener(_0x1daba6,_0x1e9fee){return function(_0x941e00){_0x1e9fee[_0x7de8('0x3')](_0x1daba6,_0x941e00);};}function removeListener(_0x4d8e00,_0x3ab433){return function(){UserNotificationEvents['removeListener'](_0x4d8e00,_0x3ab433);};}exports[_0x7de8('0x4')]=function(_0x2e4539){for(var _0x30642c=0x0,_0x3dbd67=events[_0x7de8('0x5')];_0x30642c<_0x3dbd67;_0x30642c++){var _0x42cd17=events[_0x30642c];var _0x18294a=createListener(_0x7de8('0x6')+_0x42cd17,_0x2e4539);UserNotificationEvents['on'](_0x42cd17,_0x18294a);}}; \ No newline at end of file +var _0x57bb=['register','./userNotification.events','save','emit'];(function(_0x2b442f,_0x228b30){var _0x148860=function(_0xd07b02){while(--_0xd07b02){_0x2b442f['push'](_0x2b442f['shift']());}};_0x148860(++_0x228b30);}(_0x57bb,0x115));var _0xb57b=function(_0x15ef16,_0x24a45f){_0x15ef16=_0x15ef16-0x0;var _0x1ab6a1=_0x57bb[_0x15ef16];return _0x1ab6a1;};'use strict';var UserNotificationEvents=require(_0xb57b('0x0'));var events=[_0xb57b('0x1'),'remove','update'];function createListener(_0x22158d,_0x2e925e){return function(_0x2400bf){_0x2e925e[_0xb57b('0x2')](_0x22158d,_0x2400bf);};}function removeListener(_0x8b24c8,_0x27b135){return function(){UserNotificationEvents['removeListener'](_0x8b24c8,_0x27b135);};}exports[_0xb57b('0x3')]=function(_0x3670d0){for(var _0x14b500=0x0,_0x3d8f47=events['length'];_0x14b500<_0x3d8f47;_0x14b500++){var _0x18b4dc=events[_0x14b500];var _0xac2329=createListener('userNotification:'+_0x18b4dc,_0x3670d0);UserNotificationEvents['on'](_0x18b4dc,_0xac2329);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6833ac7..a43999b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5ea7ee,_0x54c21e){var _0x17e9cd=function(_0x30858a){while(--_0x30858a){_0x5ea7ee['push'](_0x5ea7ee['shift']());}};_0x17e9cd(++_0x54c21e);}(_0xedd9,0xfc));var _0x9edd=function(_0x30e2b1,_0x248f08){_0x30e2b1=_0x30e2b1-0x0;var _0x4724e9=_0xedd9[_0x30e2b1];return _0x4724e9;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 437532a..cae5506 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 _0x7021=['sequelize','INTEGER'];(function(_0x5afc19,_0x39efb2){var _0x18704b=function(_0x3c48fb){while(--_0x3c48fb){_0x5afc19['push'](_0x5afc19['shift']());}};_0x18704b(++_0x39efb2);}(_0x7021,0x136));var _0x1702=function(_0x28e502,_0x3e36c5){_0x28e502=_0x28e502-0x0;var _0x2fd662=_0x7021[_0x28e502];return _0x2fd662;};'use strict';var Sequelize=require(_0x1702('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1702('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa8f1=['exports','INTEGER'];(function(_0x34ab75,_0x396009){var _0x2ab6ef=function(_0x3e6682){while(--_0x3e6682){_0x34ab75['push'](_0x34ab75['shift']());}};_0x2ab6ef(++_0x396009);}(_0xa8f1,0x19e));var _0x1a8f=function(_0x2978a1,_0x1a2c9d){_0x2978a1=_0x2978a1-0x0;var _0x13e04c=_0xa8f1[_0x2978a1];return _0x13e04c;};'use strict';var Sequelize=require('sequelize');module[_0x1a8f('0x0')]={'penalty':{'type':Sequelize[_0x1a8f('0x1')],'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 5c64c8e..7eff262 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 _0x732a=['UserOpenchannelQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x448de1,_0x2b5cf9){var _0x54a88d=function(_0x17f58a){while(--_0x17f58a){_0x448de1['push'](_0x448de1['shift']());}};_0x54a88d(++_0x2b5cf9);}(_0x732a,0xd1));var _0xa732=function(_0x3d4a2b,_0xca71a8){_0x3d4a2b=_0x3d4a2b-0x0;var _0x5c55c6=_0x732a[_0x3d4a2b];return _0x5c55c6;};'use strict';var _=require(_0xa732('0x0'));var util=require('util');var logger=require(_0xa732('0x1'))(_0xa732('0x2'));var moment=require(_0xa732('0x3'));var BPromise=require(_0xa732('0x4'));var rp=require(_0xa732('0x5'));var fs=require('fs');var path=require(_0xa732('0x6'));var rimraf=require(_0xa732('0x7'));var config=require(_0xa732('0x8'));var attributes=require(_0xa732('0x9'));module[_0xa732('0xa')]=function(_0x44808b,_0x4219d8){return _0x44808b[_0xa732('0xb')](_0xa732('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc67f=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','user_has_openchannel_queues','lodash','../../config/logger','api','moment'];(function(_0x260751,_0x3aa56a){var _0xaee64b=function(_0x63f081){while(--_0x63f081){_0x260751['push'](_0x260751['shift']());}};_0xaee64b(++_0x3aa56a);}(_0xc67f,0xa1));var _0xfc67=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc67f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc67('0x0'));var util=require('util');var logger=require(_0xfc67('0x1'))(_0xfc67('0x2'));var moment=require(_0xfc67('0x3'));var BPromise=require(_0xfc67('0x4'));var rp=require(_0xfc67('0x5'));var fs=require('fs');var path=require(_0xfc67('0x6'));var rimraf=require(_0xfc67('0x7'));var config=require(_0xfc67('0x8'));var attributes=require(_0xfc67('0x9'));module['exports']=function(_0x522f97,_0x4518c8){return _0x522f97['define']('UserOpenchannelQueue',attributes,{'tableName':_0xfc67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index ca5feab..dc22ac0 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 _0xcc5a=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x22d5fa,_0xcd5364){var _0x5a4cfb=function(_0x2511fc){while(--_0x2511fc){_0x22d5fa['push'](_0x22d5fa['shift']());}};_0x5a4cfb(++_0xcd5364);}(_0xcc5a,0x1e6));var _0xacc5=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0xcc5a[_0x2af053];return _0x4b4001;};'use strict';var _=require(_0xacc5('0x0'));var util=require(_0xacc5('0x1'));var moment=require(_0xacc5('0x2'));var BPromise=require('bluebird');var rs=require(_0xacc5('0x3'));var fs=require('fs');var Redis=require(_0xacc5('0x4'));var db=require(_0xacc5('0x5'))['db'];var utils=require(_0xacc5('0x6'));var logger=require(_0xacc5('0x7'))('rpc');var config=require(_0xacc5('0x8'));var jayson=require(_0xacc5('0x9'));var client=jayson['client'][_0xacc5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f0b,_0x3ef05e,_0x18a0eb){return new BPromise(function(_0x43fc74,_0x31327d){return client[_0xacc5('0xb')](_0x5e7f0b,_0x18a0eb)['then'](function(_0x3e0629){logger['info'](_0xacc5('0xc'),_0x3ef05e,_0xacc5('0xd'));logger[_0xacc5('0xe')](_0xacc5('0xf'),_0x3ef05e,_0xacc5('0xd'),JSON[_0xacc5('0x10')](_0x3e0629));if(_0x3e0629['error']){if(_0x3e0629[_0xacc5('0x11')][_0xacc5('0x12')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x3ef05e,_0x3e0629[_0xacc5('0x11')][_0xacc5('0x13')]);return _0x31327d(_0x3e0629[_0xacc5('0x11')][_0xacc5('0x13')]);}logger['error'](_0xacc5('0xc'),_0x3ef05e,_0x3e0629[_0xacc5('0x11')][_0xacc5('0x13')]);return _0x43fc74(_0x3e0629[_0xacc5('0x11')][_0xacc5('0x13')]);}else{logger[_0xacc5('0x14')](_0xacc5('0xc'),_0x3ef05e,_0xacc5('0xd'));_0x43fc74(_0x3e0629[_0xacc5('0x15')][_0xacc5('0x13')]);}})[_0xacc5('0x16')](function(_0x2c00cd){logger[_0xacc5('0x11')](_0xacc5('0xc'),_0x3ef05e,_0x2c00cd);_0x31327d(_0x2c00cd);});});} \ No newline at end of file +var _0x486e=['UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x17c7ed,_0x47a96e){var _0x5c6eca=function(_0x23004f){while(--_0x23004f){_0x17c7ed['push'](_0x17c7ed['shift']());}};_0x5c6eca(++_0x47a96e);}(_0x486e,0xb2));var _0xe486=function(_0x2fd000,_0x4a0643){_0x2fd000=_0x2fd000-0x0;var _0xf77905=_0x486e[_0x2fd000];return _0xf77905;};'use strict';var _=require(_0xe486('0x0'));var util=require(_0xe486('0x1'));var moment=require('moment');var BPromise=require(_0xe486('0x2'));var rs=require(_0xe486('0x3'));var fs=require('fs');var Redis=require(_0xe486('0x4'));var db=require(_0xe486('0x5'))['db'];var utils=require(_0xe486('0x6'));var logger=require(_0xe486('0x7'))(_0xe486('0x8'));var config=require(_0xe486('0x9'));var jayson=require(_0xe486('0xa'));var client=jayson[_0xe486('0xb')][_0xe486('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fac5d,_0x2d0712,_0xea849d){return new BPromise(function(_0x8a85c7,_0x2114a5){return client[_0xe486('0xd')](_0x4fac5d,_0xea849d)[_0xe486('0xe')](function(_0x42c4b3){logger[_0xe486('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2d0712,'request\x20sent');logger[_0xe486('0x10')](_0xe486('0x11'),_0x2d0712,_0xe486('0x12'),JSON[_0xe486('0x13')](_0x42c4b3));if(_0x42c4b3[_0xe486('0x14')]){if(_0x42c4b3[_0xe486('0x14')][_0xe486('0x15')]===0x1f4){logger[_0xe486('0x14')](_0xe486('0x16'),_0x2d0712,_0x42c4b3['error']['message']);return _0x2114a5(_0x42c4b3[_0xe486('0x14')][_0xe486('0x17')]);}logger[_0xe486('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2d0712,_0x42c4b3['error'][_0xe486('0x17')]);return _0x8a85c7(_0x42c4b3['error'][_0xe486('0x17')]);}else{logger[_0xe486('0xf')](_0xe486('0x16'),_0x2d0712,_0xe486('0x12'));_0x8a85c7(_0x42c4b3['result']['message']);}})[_0xe486('0x18')](function(_0x21fca9){logger['error'](_0xe486('0x16'),_0x2d0712,_0x21fca9);_0x2114a5(_0x21fca9);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7f8f7e3..a904524 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 _0x78f0=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','/:id/resources','getResources','create','post','/:id/clone','clone','addResources','put','update','delete','destroy','removeSections','exports'];(function(_0x5be319,_0x4b13d7){var _0x3fd826=function(_0x2c0677){while(--_0x2c0677){_0x5be319['push'](_0x5be319['shift']());}};_0x3fd826(++_0x4b13d7);}(_0x78f0,0x1dc));var _0x078f=function(_0x5e08c4,_0xe605a3){_0x5e08c4=_0x5e08c4-0x0;var _0x2761b8=_0x78f0[_0x5e08c4];return _0x2761b8;};'use strict';var multer=require('multer');var util=require(_0x078f('0x0'));var path=require(_0x078f('0x1'));var timeout=require(_0x078f('0x2'));var express=require(_0x078f('0x3'));var router=express[_0x078f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x078f('0x5'));var config=require(_0x078f('0x6'));var controller=require(_0x078f('0x7'));router[_0x078f('0x8')]('/',auth[_0x078f('0x9')](),controller[_0x078f('0xa')]);router['get'](_0x078f('0xb'),auth[_0x078f('0x9')](),controller['describe']);router[_0x078f('0x8')](_0x078f('0xc'),auth[_0x078f('0x9')](),controller[_0x078f('0xd')]);router[_0x078f('0x8')](_0x078f('0xe'),auth[_0x078f('0x9')](),controller['getSections']);router['get'](_0x078f('0xf'),auth[_0x078f('0x9')](),controller[_0x078f('0x10')]);router['post']('/',auth[_0x078f('0x9')](),controller[_0x078f('0x11')]);router[_0x078f('0x12')](_0x078f('0x13'),auth[_0x078f('0x9')](),controller[_0x078f('0x14')]);router['post'](_0x078f('0xe'),auth[_0x078f('0x9')](),controller['addSections']);router[_0x078f('0x12')](_0x078f('0xf'),auth[_0x078f('0x9')](),controller[_0x078f('0x15')]);router[_0x078f('0x16')](_0x078f('0xc'),auth[_0x078f('0x9')](),controller[_0x078f('0x17')]);router[_0x078f('0x18')]('/:id',auth[_0x078f('0x9')](),controller[_0x078f('0x19')]);router['delete'](_0x078f('0xe'),auth[_0x078f('0x9')](),controller[_0x078f('0x1a')]);router[_0x078f('0x18')]('/:id/resources',auth[_0x078f('0x9')](),controller['removeResources']);module[_0x078f('0x1b')]=router; \ No newline at end of file +var _0x0848=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','describe','get','/:id','show','getSections','/:id/resources','getResources','post','/:id/clone','/:id/sections','addResources','update','delete','destroy','removeSections','exports','multer','util','path'];(function(_0x1cbbcd,_0x2807c3){var _0x28cffb=function(_0x466c3e){while(--_0x466c3e){_0x1cbbcd['push'](_0x1cbbcd['shift']());}};_0x28cffb(++_0x2807c3);}(_0x0848,0x1ad));var _0x8084=function(_0x1c9b37,_0x33fa45){_0x1c9b37=_0x1c9b37-0x0;var _0x43ef9c=_0x0848[_0x1c9b37];return _0x43ef9c;};'use strict';var multer=require(_0x8084('0x0'));var util=require(_0x8084('0x1'));var path=require(_0x8084('0x2'));var timeout=require(_0x8084('0x3'));var express=require('express');var router=express[_0x8084('0x4')]();var fs_extra=require(_0x8084('0x5'));var auth=require(_0x8084('0x6'));var interaction=require(_0x8084('0x7'));var config=require(_0x8084('0x8'));var controller=require(_0x8084('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x8084('0xa')](),controller[_0x8084('0xb')]);router[_0x8084('0xc')](_0x8084('0xd'),auth[_0x8084('0xa')](),controller[_0x8084('0xe')]);router[_0x8084('0xc')]('/:id/sections',auth[_0x8084('0xa')](),controller[_0x8084('0xf')]);router[_0x8084('0xc')](_0x8084('0x10'),auth['isAuthenticated'](),controller[_0x8084('0x11')]);router['post']('/',auth[_0x8084('0xa')](),controller['create']);router[_0x8084('0x12')](_0x8084('0x13'),auth['isAuthenticated'](),controller['clone']);router[_0x8084('0x12')](_0x8084('0x14'),auth[_0x8084('0xa')](),controller['addSections']);router[_0x8084('0x12')](_0x8084('0x10'),auth['isAuthenticated'](),controller[_0x8084('0x15')]);router['put'](_0x8084('0xd'),auth[_0x8084('0xa')](),controller[_0x8084('0x16')]);router[_0x8084('0x17')](_0x8084('0xd'),auth['isAuthenticated'](),controller[_0x8084('0x18')]);router['delete'](_0x8084('0x14'),auth['isAuthenticated'](),controller[_0x8084('0x19')]);router['delete']('/:id/resources',auth['isAuthenticated'](),controller['removeResources']);module[_0x8084('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 756753f..b13ee35 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 _0x857c=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x857c,0x111));var _0xc857=function(_0x593022,_0x5054a7){_0x593022=_0x593022-0x0;var _0x4f40a6=_0x857c[_0x593022];return _0x4f40a6;};'use strict';var Sequelize=require(_0xc857('0x0'));module[_0xc857('0x1')]={'name':{'type':Sequelize[_0xc857('0x2')],'allowNull':![],'unique':_0xc857('0x3')},'crudPermissions':{'type':Sequelize[_0xc857('0x2')],'set':function(_0x1fe39a){this[_0xc857('0x4')](_0xc857('0x5'),_0x1fe39a?_0x1fe39a[_0xc857('0x6')](''):[]);},'get':function(){return this[_0xc857('0x7')](_0xc857('0x5'))?this[_0xc857('0x7')](_0xc857('0x5'))[_0xc857('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc857('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc857('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc857('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc857('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc857('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc857('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc857('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd8d5=['BOOLEAN','exports','STRING','name','setDataValue','getDataValue','crudPermissions','split'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd8d5,0x1d1));var _0x5d8d=function(_0xc927dc,_0x2b4b8d){_0xc927dc=_0xc927dc-0x0;var _0x5ed50f=_0xd8d5[_0xc927dc];return _0x5ed50f;};'use strict';var Sequelize=require('sequelize');module[_0x5d8d('0x0')]={'name':{'type':Sequelize[_0x5d8d('0x1')],'allowNull':![],'unique':_0x5d8d('0x2')},'crudPermissions':{'type':Sequelize[_0x5d8d('0x1')],'set':function(_0x393933){this[_0x5d8d('0x3')]('crudPermissions',_0x393933?_0x393933['join'](''):[]);},'get':function(){return this[_0x5d8d('0x4')]('crudPermissions')?this[_0x5d8d('0x4')](_0x5d8d('0x5'))[_0x5d8d('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x5d8d('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5d8d('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index dc59c1f..5b96aef 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 _0xdf94=['fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','keys','include','options','find','create','body','clone','params','rawAttributes','get','omit','updatedAt','crudPermissions','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','createdAt','sectionId','update','describe','transaction','userProfileId','Resources','push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','resourceId','Plugin','forEach','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','UserProfile','type','key','model','query','filters','intersection'];(function(_0x5dac1d,_0x50f69a){var _0x69241b=function(_0x5f084a){while(--_0x5f084a){_0x5dac1d['push'](_0x5dac1d['shift']());}};_0x69241b(++_0x50f69a);}(_0xdf94,0xad));var _0x4df9=function(_0x1ac3ff,_0x3d8f18){_0x1ac3ff=_0x1ac3ff-0x0;var _0x2ef2f7=_0xdf94[_0x1ac3ff];return _0x2ef2f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4df9('0x0'));var zipdir=require(_0x4df9('0x1'));var jsonpatch=require(_0x4df9('0x2'));var rp=require(_0x4df9('0x3'));var moment=require(_0x4df9('0x4'));var BPromise=require(_0x4df9('0x5'));var Mustache=require(_0x4df9('0x6'));var util=require(_0x4df9('0x7'));var path=require(_0x4df9('0x8'));var sox=require(_0x4df9('0x9'));var csv=require(_0x4df9('0xa'));var ejs=require(_0x4df9('0xb'));var fs=require('fs');var fs_extra=require(_0x4df9('0xc'));var _=require(_0x4df9('0xd'));var squel=require(_0x4df9('0xe'));var crypto=require(_0x4df9('0xf'));var jsforce=require(_0x4df9('0x10'));var deskjs=require(_0x4df9('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4df9('0x12'));var Papa=require(_0x4df9('0x13'));var Redis=require(_0x4df9('0x14'));var authService=require(_0x4df9('0x15'));var qs=require(_0x4df9('0x16'));var as=require(_0x4df9('0x17'));var hardwareService=require(_0x4df9('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x4df9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4df9('0x1a'));var db=require(_0x4df9('0x1b'))['db'];config[_0x4df9('0x1c')]=_[_0x4df9('0x1d')](config['redis'],{'host':_0x4df9('0x1e'),'port':0x18eb});var socket=require(_0x4df9('0x1f'))(new Redis(config[_0x4df9('0x1c')]));require('./userProfile.socket')[_0x4df9('0x20')](socket);function respondWithStatusCode(_0x1a35ef,_0xc141bb){_0xc141bb=_0xc141bb||0xcc;return function(_0x4fe068){if(_0x4fe068){return _0x1a35ef[_0x4df9('0x21')](_0xc141bb);}return _0x1a35ef['status'](_0xc141bb)[_0x4df9('0x22')]();};}function respondWithResult(_0x260d04,_0x412752){_0x412752=_0x412752||0xc8;return function(_0x3e2add){if(_0x3e2add){return _0x260d04['status'](_0x412752)[_0x4df9('0x23')](_0x3e2add);}};}function respondWithFilteredResult(_0x36ef28,_0x10852a){return function(_0x59d4e9){if(_0x59d4e9){var _0xa9d338=typeof _0x10852a['offset']===_0x4df9('0x24')&&typeof _0x10852a[_0x4df9('0x25')]===_0x4df9('0x24');var _0x1fe11a=_0x59d4e9[_0x4df9('0x26')];var _0x58233e=_0xa9d338?0x0:_0x10852a['offset'];var _0x4b7b6d=_0xa9d338?_0x59d4e9[_0x4df9('0x26')]:_0x10852a[_0x4df9('0x27')]+_0x10852a[_0x4df9('0x25')];var _0x434afe;if(_0x4b7b6d>=_0x1fe11a){_0x4b7b6d=_0x1fe11a;_0x434afe=0xc8;}else{_0x434afe=0xce;}_0x36ef28[_0x4df9('0x28')](_0x434afe);return _0x36ef28[_0x4df9('0x29')](_0x4df9('0x2a'),_0x58233e+'-'+_0x4b7b6d+'/'+_0x1fe11a)['json'](_0x59d4e9);}return null;};}function patchUpdates(_0xc03aea){return function(_0x60de39){try{jsonpatch[_0x4df9('0x2b')](_0x60de39,_0xc03aea,!![]);}catch(_0x446d8a){return BPromise[_0x4df9('0x2c')](_0x446d8a);}return _0x60de39['save']();};}function saveUpdates(_0x316f5c,_0x3473cc){return function(_0x55dfcd){if(_0x55dfcd){return _0x55dfcd['update'](_0x316f5c)[_0x4df9('0x2d')](function(_0x2ba01c){return _0x2ba01c;});}return null;};}function removeEntity(_0x4c7d68,_0x4234d1){return function(_0x427c43){if(_0x427c43){return _0x427c43[_0x4df9('0x2e')]()[_0x4df9('0x2d')](function(){_0x4c7d68[_0x4df9('0x28')](0xcc)[_0x4df9('0x22')]();});}};}function handleEntityNotFound(_0x5e4f21,_0x10d7f6){return function(_0x38c7a9){if(!_0x38c7a9){_0x5e4f21['sendStatus'](0x194);}return _0x38c7a9;};}function handleError(_0x12790c,_0x23b032){_0x23b032=_0x23b032||0x1f4;return function(_0x4138a2){logger[_0x4df9('0x2f')](_0x4138a2['stack']);if(_0x4138a2[_0x4df9('0x30')]){delete _0x4138a2[_0x4df9('0x30')];}_0x12790c[_0x4df9('0x28')](_0x23b032)[_0x4df9('0x31')](_0x4138a2);};}exports[_0x4df9('0x32')]=function(_0x298b15,_0x3ee40a){var _0x42aa30={},_0x52b346={},_0x150b6a={'count':0x0,'rows':[]};var _0x3079f4=_[_0x4df9('0x33')](db[_0x4df9('0x34')]['rawAttributes'],function(_0x24de38){return{'name':_0x24de38['fieldName'],'type':_0x24de38[_0x4df9('0x35')][_0x4df9('0x36')]};});_0x52b346[_0x4df9('0x37')]=_['map'](_0x3079f4,'name');_0x52b346['query']=_['keys'](_0x298b15[_0x4df9('0x38')]);_0x52b346[_0x4df9('0x39')]=_['intersection'](_0x52b346['model'],_0x52b346[_0x4df9('0x38')]);_0x42aa30['attributes']=_[_0x4df9('0x3a')](_0x52b346['model'],qs[_0x4df9('0x3b')](_0x298b15[_0x4df9('0x38')]['fields']));_0x42aa30['attributes']=_0x42aa30[_0x4df9('0x3c')][_0x4df9('0x3d')]?_0x42aa30[_0x4df9('0x3c')]:_0x52b346[_0x4df9('0x37')];if(!_0x298b15[_0x4df9('0x38')]['hasOwnProperty']('nolimit')){_0x42aa30[_0x4df9('0x25')]=qs[_0x4df9('0x25')](_0x298b15[_0x4df9('0x38')][_0x4df9('0x25')]);_0x42aa30[_0x4df9('0x27')]=qs[_0x4df9('0x27')](_0x298b15[_0x4df9('0x38')][_0x4df9('0x27')]);}_0x42aa30['order']=qs[_0x4df9('0x3e')](_0x298b15[_0x4df9('0x38')][_0x4df9('0x3e')]);_0x42aa30[_0x4df9('0x3f')]=qs[_0x4df9('0x39')](_[_0x4df9('0x40')](_0x298b15['query'],_0x52b346[_0x4df9('0x39')]),_0x3079f4);if(_0x298b15[_0x4df9('0x38')][_0x4df9('0x41')]){_0x42aa30[_0x4df9('0x3f')]=_[_0x4df9('0x42')](_0x42aa30[_0x4df9('0x3f')],{'$or':_['map'](_0x3079f4,function(_0x4af4a9){if(_0x4af4a9[_0x4df9('0x35')]!==_0x4df9('0x43')){var _0x5cc651={};_0x5cc651[_0x4af4a9[_0x4df9('0x30')]]={'$like':'%'+_0x298b15[_0x4df9('0x38')][_0x4df9('0x41')]+'%'};return _0x5cc651;}})});}_0x42aa30=_['merge']({},_0x42aa30,_0x298b15['options']);var _0x18f8ac={'where':_0x42aa30[_0x4df9('0x3f')]};return db[_0x4df9('0x34')][_0x4df9('0x26')](_0x18f8ac)[_0x4df9('0x2d')](function(_0x5cd4ce){_0x150b6a[_0x4df9('0x26')]=_0x5cd4ce;if(_0x298b15[_0x4df9('0x38')][_0x4df9('0x44')]){_0x42aa30['include']=[{'all':!![]}];}return db[_0x4df9('0x34')][_0x4df9('0x45')](_0x42aa30);})[_0x4df9('0x2d')](function(_0x54dfbc){_0x150b6a[_0x4df9('0x46')]=_0x54dfbc;return _0x150b6a;})[_0x4df9('0x2d')](respondWithFilteredResult(_0x3ee40a,_0x42aa30))[_0x4df9('0x47')](handleError(_0x3ee40a,null));};exports['show']=function(_0x1252b4,_0x32c823){var _0x1c706b={'raw':![],'where':{'id':_0x1252b4['params']['id']}},_0x56949d={};_0x56949d[_0x4df9('0x37')]=_[_0x4df9('0x48')](db[_0x4df9('0x34')]['rawAttributes']);_0x56949d[_0x4df9('0x38')]=_[_0x4df9('0x48')](_0x1252b4['query']);_0x56949d[_0x4df9('0x39')]=_[_0x4df9('0x3a')](_0x56949d[_0x4df9('0x37')],_0x56949d[_0x4df9('0x38')]);_0x1c706b[_0x4df9('0x3c')]=_[_0x4df9('0x3a')](_0x56949d[_0x4df9('0x37')],qs[_0x4df9('0x3b')](_0x1252b4[_0x4df9('0x38')]['fields']));_0x1c706b[_0x4df9('0x3c')]=_0x1c706b[_0x4df9('0x3c')]['length']?_0x1c706b['attributes']:_0x56949d[_0x4df9('0x37')];if(_0x1252b4['query']['includeAll']){_0x1c706b[_0x4df9('0x49')]=[{'all':!![]}];}_0x1c706b=_[_0x4df9('0x42')]({},_0x1c706b,_0x1252b4[_0x4df9('0x4a')]);return db['UserProfile'][_0x4df9('0x4b')](_0x1c706b)['then'](handleEntityNotFound(_0x32c823,null))[_0x4df9('0x2d')](respondWithResult(_0x32c823,null))[_0x4df9('0x47')](handleError(_0x32c823,null));};exports[_0x4df9('0x4c')]=function(_0x59db64,_0x320407){return db['UserProfile'][_0x4df9('0x4c')](_0x59db64[_0x4df9('0x4d')],{})['then'](respondWithResult(_0x320407,0xc9))[_0x4df9('0x47')](handleError(_0x320407,null));};exports[_0x4df9('0x4e')]=function(_0xd77f49,_0x474446){var _0x42634d={'where':{'id':_0xd77f49[_0x4df9('0x4f')]['id']}},_0x588690={};_0x588690[_0x4df9('0x37')]=_[_0x4df9('0x48')](db[_0x4df9('0x34')][_0x4df9('0x50')]);_0x42634d[_0x4df9('0x3c')]=_[_0x4df9('0x3a')](_0x588690['model'],qs[_0x4df9('0x3b')](_0xd77f49[_0x4df9('0x38')][_0x4df9('0x3b')]));_0x42634d[_0x4df9('0x3c')]=_0x42634d[_0x4df9('0x3c')][_0x4df9('0x3d')]?_0x42634d[_0x4df9('0x3c')]:_0x588690[_0x4df9('0x37')];if(_0xd77f49[_0x4df9('0x38')][_0x4df9('0x44')]){_0x42634d['include']=[{'all':!![]}];}_0x42634d=_['merge']({},_0x42634d,_0xd77f49[_0x4df9('0x4a')]);return db[_0x4df9('0x34')]['find'](_0x42634d)[_0x4df9('0x2d')](handleEntityNotFound(_0x474446,null))['then'](function(_0x318ee8){if(_0x318ee8){var _0x11ce31=_0x318ee8[_0x4df9('0x51')]({'plain':!![]});_0x11ce31=qs[_0x4df9('0x52')](_0x11ce31,['id','createdAt',_0x4df9('0x53'),_0x4df9('0x54')]);_0xd77f49['body']=_['omit'](_0xd77f49['body'],['id','createdAt',_0x4df9('0x53')]);return db[_0x4df9('0x55')]['transaction'](function(_0xd19834){return db[_0x4df9('0x34')][_0x4df9('0x4c')](_[_0x4df9('0x42')](_0x11ce31,_0xd77f49['body']),{'include':_0xd77f49[_0x4df9('0x38')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xd19834})[_0x4df9('0x2d')](function(_0x337b24){var _0x94d1e9=_0x337b24[_0x4df9('0x51')]({'plain':!![]});return db[_0x4df9('0x56')][_0x4df9('0x45')]({'where':{'userProfileId':_0xd77f49[_0x4df9('0x4f')]['id']},'raw':!![]})[_0x4df9('0x2d')](function(_0x368bc1){if(_0x368bc1){return BPromise[_0x4df9('0x57')](_0x368bc1,function(_0x1d4c1f){return new BPromise(function(_0x2bbd45,_0x593a2d){if(_0x1d4c1f[_0x4df9('0x58')]===null||_0x1d4c1f['autoAssociation']===0x1)_0x2bbd45(null);return db[_0x4df9('0x59')][_0x4df9('0x45')]({'where':{'sectionId':_0x1d4c1f['id']},'raw':!![]})[_0x4df9('0x2d')](function(_0x2e6c07){var _0x3408d7=_[_0x4df9('0x33')](_0x2e6c07,function(_0x434a1e){return qs['omit'](_0x434a1e,['id',_0x4df9('0x5a'),'updatedAt',_0x4df9('0x5b')]);});_0x2bbd45(_0x3408d7);})[_0x4df9('0x47')](function(_0x4f6676){_0x593a2d(_0x4f6676);});})[_0x4df9('0x2d')](function(_0x1905d9){var _0xbeacd5=qs['omit'](_0x1d4c1f,['id',_0x4df9('0x5a'),'updatedAt']);_0xbeacd5['userProfileId']=_0x94d1e9['id'];if(_0x1905d9)_0xbeacd5['Resources']=_0x1905d9;return _0xbeacd5;})[_0x4df9('0x2d')](function(_0x17dee4){return db[_0x4df9('0x56')][_0x4df9('0x4c')](_0x17dee4,{'include':[{'model':db[_0x4df9('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0xd19834});});})[_0x4df9('0x2d')](function(){return _0x94d1e9;});}});});});}})[_0x4df9('0x2d')](respondWithResult(_0x474446,0xc9))[_0x4df9('0x47')](handleError(_0x474446,null));};exports[_0x4df9('0x5c')]=function(_0x50c1ad,_0x227aa9){if(_0x50c1ad[_0x4df9('0x4d')]['id']){delete _0x50c1ad[_0x4df9('0x4d')]['id'];}return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x50c1ad[_0x4df9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x227aa9,null))[_0x4df9('0x2d')](saveUpdates(_0x50c1ad[_0x4df9('0x4d')],null))[_0x4df9('0x2d')](respondWithResult(_0x227aa9,null))[_0x4df9('0x47')](handleError(_0x227aa9,null));};exports[_0x4df9('0x2e')]=function(_0x287be7,_0x4f4206){return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x287be7[_0x4df9('0x4f')]['id']}})[_0x4df9('0x2d')](handleEntityNotFound(_0x4f4206,null))['then'](removeEntity(_0x4f4206,null))['catch'](handleError(_0x4f4206,null));};exports['describe']=function(_0x2bc042,_0x2d6bc5){return db[_0x4df9('0x34')][_0x4df9('0x5d')]()['then'](respondWithResult(_0x2d6bc5,null))[_0x4df9('0x47')](handleError(_0x2d6bc5,null));};exports['addSections']=function(_0x57d77c,_0x1c92a6){var _0x4a72ac=_0x57d77c['body'];return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x57d77c[_0x4df9('0x4f')]['id']}})[_0x4df9('0x2d')](handleEntityNotFound(_0x1c92a6,null))['then'](function(_0x268249){if(_0x268249){return db[_0x4df9('0x55')][_0x4df9('0x5e')](function(_0x4ec06c){return db[_0x4df9('0x56')]['destroy']({'where':{'userProfileId':_0x57d77c[_0x4df9('0x4f')]['id'],'sectionId':_['map'](_0x4a72ac,function(_0x2096cf){return _0x2096cf['sectionId'];})},'transaction':_0x4ec06c})[_0x4df9('0x2d')](function(){var _0x589dfe=_[_0x4df9('0x33')](_0x4a72ac,function(_0x1597ac){_0x1597ac[_0x4df9('0x5f')]=_0x57d77c['params']['id'];return _0x1597ac;});var _0x47d2b0=[];return BPromise['each'](_0x589dfe,function(_0x2da014){return db['UserProfileSection'][_0x4df9('0x4c')](_0x2da014,{'include':[{'model':db[_0x4df9('0x59')],'as':_0x4df9('0x60')}],'raw':!![],'transaction':_0x4ec06c})[_0x4df9('0x2d')](function(_0x599cd2){_0x47d2b0[_0x4df9('0x61')](_0x599cd2[_0x4df9('0x51')]({'plain':!![]}));});})[_0x4df9('0x2d')](function(){return _0x47d2b0;});});});}})['then'](function(_0x31a057){return _0x31a057;})[_0x4df9('0x2d')](respondWithResult(_0x1c92a6,null))['catch'](handleError(_0x1c92a6,null));};exports['removeSections']=function(_0x2e7c28,_0x26a6bd){var _0x46323d;return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x2e7c28['params']['id']},'attributes':['id',_0x4df9('0x30')]})[_0x4df9('0x2d')](handleEntityNotFound(_0x26a6bd,null))[_0x4df9('0x2d')](function(_0x13a719){if(_0x13a719){_0x46323d=_0x13a719;return db['UserProfileSection'][_0x4df9('0x2e')]({'where':{'userProfileId':_0x2e7c28[_0x4df9('0x4f')]['id'],'sectionId':_0x2e7c28[_0x4df9('0x38')][_0x4df9('0x62')]}});}})[_0x4df9('0x2d')](function(){return _0x46323d;})[_0x4df9('0x2d')](respondWithStatusCode(_0x26a6bd,null))[_0x4df9('0x47')](handleError(_0x26a6bd,null));};exports[_0x4df9('0x63')]=function(_0x50d9a9,_0xbb9ee5){var _0x1f2c81=[];var _0x20c0c0=[];return db[_0x4df9('0x56')][_0x4df9('0x45')]({'where':{'userProfileId':_0x50d9a9['params']['id']},'raw':!![]})['then'](function(_0x24b969){_0x1f2c81=_[_0x4df9('0x41')](_0x24b969,function(_0xeeed17){return _0xeeed17[_0x4df9('0x64')]===0x1||_[_0x4df9('0x65')]([0x3eb,0x709],_0xeeed17[_0x4df9('0x5b')]);});if(!_[_0x4df9('0x66')](_0x1f2c81)){return _[_0x4df9('0x33')](_0x1f2c81,function(_0x59ad0e){return _0x59ad0e[_0x4df9('0x5b')];});}else{return;}})[_0x4df9('0x2d')](function(_0x35936b){if(_0x35936b)_0x20c0c0=_0x35936b;if(_['includes'](_0x20c0c0,0x64)){var _0xfb1164=_[_0x4df9('0x4b')](_0x1f2c81,{'sectionId':0x64});return hasDefaultDashboard(_0xfb1164)['then'](function(_0x5593de){return _['map'](_0x1f2c81,function(_0x38feda){if(_0x38feda['sectionId']===0x64){_0x38feda[_0x4df9('0x67')]=_0x5593de;}return _0x38feda;});});}else{return;}})[_0x4df9('0x2d')](function(_0x3d9e31){if(_0x3d9e31)_0x1f2c81=_0x3d9e31;if(_['includes'](_0x20c0c0,0x3eb)){var _0x41208e=_[_0x4df9('0x4b')](_0x1f2c81,{'sectionId':0x3eb});return getCustomDashboards(_0x41208e)[_0x4df9('0x2d')](function(_0x2bbf14){return _['map'](_0x1f2c81,function(_0x2ba2c9){if(_0x41208e['enabled']){if(_0x2ba2c9['sectionId']===0x3eb){_0x2ba2c9[_0x4df9('0x67')]=_0x2bbf14;}}else{if(_0x2ba2c9[_0x4df9('0x5b')]===0x64){_0x2ba2c9[_0x4df9('0x67')]=_0x2bbf14;}}return _0x2ba2c9;});});}else{return;}})[_0x4df9('0x2d')](function(_0xbf286e){if(_0xbf286e)_0x1f2c81=_0xbf286e;if(_[_0x4df9('0x65')](_0x20c0c0,0x709)){var _0x3c1c27=_[_0x4df9('0x4b')](_0x1f2c81,{'sectionId':0x709});return getPlugins(_0x3c1c27)['then'](function(_0xe5c6e7){if(_0x3c1c27[_0x4df9('0x64')]){return _[_0x4df9('0x33')](_0x1f2c81,function(_0x123442){if(_0x123442[_0x4df9('0x5b')]===0x709){_0x123442[_0x4df9('0x67')]=_0xe5c6e7;}return _0x123442;});}else{var _0x577654={'sectionId':0x76c,'enabled':0x1,'subsections':_0xe5c6e7};var _0x21d78c=_[_0x4df9('0x33')](_0x1f2c81);_0x21d78c['push'](_0x577654);return _0x21d78c;}});}else{return;}})[_0x4df9('0x2d')](function(_0x524daa){if(_0x524daa)_0x1f2c81=_0x524daa;return _[_0x4df9('0x41')](_0x1f2c81,[_0x4df9('0x64'),0x1]);})[_0x4df9('0x2d')](respondWithResult(_0xbb9ee5,null))[_0x4df9('0x47')](handleError(_0xbb9ee5,null));};function hasDefaultDashboard(_0x2a6114){var _0x4e1dd6=[0x65];return new BPromise(function(_0x184ab6,_0x2be881){try{if(_0x2a6114[_0x4df9('0x58')]){_0x184ab6(_0x4e1dd6);}else{return db['UserProfileResource'][_0x4df9('0x68')]({'where':{'sectionId':_0x2a6114['id']},'raw':!![]})['then'](function(_0x2d2716){_0x2d2716?_0x184ab6(_0x4e1dd6):_0x184ab6();});}}catch(_0xc2e724){_0x2be881(_0xc2e724);}});}function getCustomDashboards(_0x408fa2){var _0x136210=[];return new BPromise(function(_0xad5d2d,_0x298ffd){try{if(_0x408fa2[_0x4df9('0x58')]){return db[_0x4df9('0x69')][_0x4df9('0x45')]({'raw':!![]})[_0x4df9('0x2d')](function(_0x4d4d53){_0x4d4d53['forEach'](function(_0x1ef32b){_0x136210[_0x4df9('0x61')](_0x1ef32b['id']+0x1869f);});_0xad5d2d(_0x136210);});}else{return db[_0x4df9('0x59')][_0x4df9('0x45')]({'where':{'sectionId':_0x408fa2['id']},'raw':!![]})[_0x4df9('0x2d')](function(_0x43abfa){_0x43abfa['forEach'](function(_0x2ebc02){_0x136210['push'](_0x2ebc02[_0x4df9('0x6a')]+0x1869f);});_0xad5d2d(_0x136210);});}}catch(_0x2213e2){_0x298ffd(_0x2213e2);}});}function getPlugins(_0x41d27f){var _0x183871=[];return new BPromise(function(_0x358b5e,_0x5e7e19){try{if(_0x41d27f[_0x4df9('0x58')]){return db[_0x4df9('0x6b')][_0x4df9('0x45')]({'raw':!![]})['then'](function(_0x5db2d7){_0x5db2d7['forEach'](function(_0x19c048){_0x183871['push'](_0x19c048['id']+0x15b38);});_0x358b5e(_0x183871);});}else{return db[_0x4df9('0x59')][_0x4df9('0x45')]({'where':{'sectionId':_0x41d27f['id']},'raw':!![]})[_0x4df9('0x2d')](function(_0x13aa5d){_0x13aa5d[_0x4df9('0x6c')](function(_0x33894b){_0x183871[_0x4df9('0x61')](_0x33894b[_0x4df9('0x6a')]+0x15b38);});_0x358b5e(_0x183871);});}}catch(_0x3b9af6){_0x5e7e19(_0x3b9af6);}});}exports[_0x4df9('0x6d')]=function(_0x412e00,_0x222c4e){return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x412e00[_0x4df9('0x4f')]['id']}})[_0x4df9('0x2d')](handleEntityNotFound(_0x222c4e,null))[_0x4df9('0x2d')](function(_0xf4ff1e){if(_0xf4ff1e){return db[_0x4df9('0x55')][_0x4df9('0x5e')](function(_0x431ff1){return db[_0x4df9('0x56')]['findAll']({'where':{'userProfileId':_0x412e00[_0x4df9('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0x4df9('0x2d')](function(_0x207c1b){if(_0x207c1b){return db[_0x4df9('0x56')][_0x4df9('0x2e')]({'where':{'userProfileId':_0x412e00[_0x4df9('0x4f')]['id'],'id':_[_0x4df9('0x33')](_0x207c1b,function(_0x152450){return _0x152450['id'];})},'transaction':_0x431ff1});}})[_0x4df9('0x2d')](function(_0x10467c){var _0x442858=_['map'](_0x412e00[_0x4df9('0x4d')],function(_0x4c344e){_0x4c344e[_0x4df9('0x5f')]=_0x412e00['params']['id'];return _0x4c344e;});return db[_0x4df9('0x56')][_0x4df9('0x6e')](_0x442858,{'raw':!![],'transaction':_0x431ff1});})['then'](function(_0x42d45f){var _0x10cb17=_[_0x4df9('0x41')](_[_0x4df9('0x33')](_0x42d45f,function(_0x3d4780){return _0x3d4780[_0x4df9('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x10cb17){return db[_0x4df9('0x56')][_0x4df9('0x45')]({'where':{'userProfileId':_0x412e00[_0x4df9('0x4f')]['id'],'sectionId':_['map'](_0x10cb17,function(_0x3b1f45){return _0x3b1f45['sectionId'];})},'attributes':['id',_0x4df9('0x5b')],'raw':!![]})['then'](function(_0x3b8476){var _0x4ba64f=_['map'](_0x412e00[_0x4df9('0x4d')],function(_0x4a8f80){_0x4a8f80['userProfileId']=_0x412e00[_0x4df9('0x4f')]['id'];return _0x4a8f80;});return db[_0x4df9('0x59')][_0x4df9('0x6e')](_0x4ba64f,{'raw':!![],'transaction':_0x431ff1});});}})[_0x4df9('0x47')](handleError(_0x222c4e,null));});}})[_0x4df9('0x2d')](function(_0x1e9bba){var _0x289ed3=_[_0x4df9('0x33')](_0x1e9bba,function(_0x1a7534){return _0x1a7534[_0x4df9('0x51')]({'plain':!![]});});})['then'](respondWithResult(_0x222c4e,null))['catch'](handleError(_0x222c4e,null));};exports[_0x4df9('0x6f')]=function(_0x447893,_0x25b116,_0x2e9f46){return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x447893['params']['id']}})[_0x4df9('0x2d')](handleEntityNotFound(_0x25b116,null))[_0x4df9('0x2d')](function(_0x59551c){if(_0x59551c){return _0x59551c['removeResources'](_0x447893[_0x4df9('0x38')][_0x4df9('0x62')]);}})[_0x4df9('0x2d')](respondWithStatusCode(_0x25b116,null))[_0x4df9('0x47')](handleError(_0x25b116,null));};exports['getResources']=function(_0x5321a0,_0x39c616){var _0x5c54b4={};if(!_0x5321a0[_0x4df9('0x38')][_0x4df9('0x70')])throw new Error(_0x4df9('0x71'));if(!_0x5321a0[_0x4df9('0x38')][_0x4df9('0x72')](_0x4df9('0x73'))){_0x5c54b4['limit']=qs[_0x4df9('0x25')](_0x5321a0[_0x4df9('0x38')][_0x4df9('0x25')]);_0x5c54b4[_0x4df9('0x27')]=qs['offset'](_0x5321a0[_0x4df9('0x38')]['offset']);}return db[_0x4df9('0x34')][_0x4df9('0x4b')]({'where':{'id':_0x5321a0['params']['id']}})[_0x4df9('0x2d')](function(_0x16c310){if(!_0x16c310)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5321a0['params']['id']);return db[_0x4df9('0x34')]['getResources'](_0x5321a0);})['then'](respondWithFilteredResult(_0x39c616,_0x5c54b4))['catch'](handleError(_0x39c616,null));}; \ No newline at end of file +var _0xd98a=['sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','params','include','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xd98a,0xfc));var _0xad98=function(_0x519bac,_0x3aa55c){_0x519bac=_0x519bac-0x0;var _0x2a4d79=_0xd98a[_0x519bac];return _0x2a4d79;};'use strict';var emlformat=require(_0xad98('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xad98('0x1'));var rp=require(_0xad98('0x2'));var moment=require(_0xad98('0x3'));var BPromise=require(_0xad98('0x4'));var Mustache=require(_0xad98('0x5'));var util=require(_0xad98('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xad98('0x7'));var ejs=require(_0xad98('0x8'));var fs=require('fs');var fs_extra=require(_0xad98('0x9'));var _=require(_0xad98('0xa'));var squel=require(_0xad98('0xb'));var crypto=require('crypto');var jsforce=require(_0xad98('0xc'));var deskjs=require(_0xad98('0xd'));var toCsv=require('to-csv');var querystring=require(_0xad98('0xe'));var Papa=require('papaparse');var Redis=require(_0xad98('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad98('0x10'));var logger=require(_0xad98('0x11'))(_0xad98('0x12'));var utils=require(_0xad98('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad98('0x14'))['db'];config[_0xad98('0x15')]=_[_0xad98('0x16')](config[_0xad98('0x15')],{'host':_0xad98('0x17'),'port':0x18eb});var socket=require(_0xad98('0x18'))(new Redis(config[_0xad98('0x15')]));require(_0xad98('0x19'))[_0xad98('0x1a')](socket);function respondWithStatusCode(_0x5b2df6,_0x18886f){_0x18886f=_0x18886f||0xcc;return function(_0x3747eb){if(_0x3747eb){return _0x5b2df6[_0xad98('0x1b')](_0x18886f);}return _0x5b2df6[_0xad98('0x1c')](_0x18886f)[_0xad98('0x1d')]();};}function respondWithResult(_0x2b3ee3,_0x2ebb87){_0x2ebb87=_0x2ebb87||0xc8;return function(_0x41647d){if(_0x41647d){return _0x2b3ee3[_0xad98('0x1c')](_0x2ebb87)['json'](_0x41647d);}};}function respondWithFilteredResult(_0x533d76,_0x237c23){return function(_0x5a3d09){if(_0x5a3d09){var _0x19d355=typeof _0x237c23[_0xad98('0x1e')]===_0xad98('0x1f')&&typeof _0x237c23[_0xad98('0x20')]===_0xad98('0x1f');var _0x17f502=_0x5a3d09[_0xad98('0x21')];var _0xa4e810=_0x19d355?0x0:_0x237c23['offset'];var _0x4ef532=_0x19d355?_0x5a3d09[_0xad98('0x21')]:_0x237c23['offset']+_0x237c23[_0xad98('0x20')];var _0x2180dc;if(_0x4ef532>=_0x17f502){_0x4ef532=_0x17f502;_0x2180dc=0xc8;}else{_0x2180dc=0xce;}_0x533d76[_0xad98('0x1c')](_0x2180dc);return _0x533d76[_0xad98('0x22')](_0xad98('0x23'),_0xa4e810+'-'+_0x4ef532+'/'+_0x17f502)[_0xad98('0x24')](_0x5a3d09);}return null;};}function patchUpdates(_0x28ce36){return function(_0x167236){try{jsonpatch[_0xad98('0x25')](_0x167236,_0x28ce36,!![]);}catch(_0x46be4e){return BPromise[_0xad98('0x26')](_0x46be4e);}return _0x167236[_0xad98('0x27')]();};}function saveUpdates(_0x25c80f,_0x5295ef){return function(_0x4532b5){if(_0x4532b5){return _0x4532b5[_0xad98('0x28')](_0x25c80f)[_0xad98('0x29')](function(_0xf48fe4){return _0xf48fe4;});}return null;};}function removeEntity(_0x536907,_0x590b77){return function(_0x276898){if(_0x276898){return _0x276898[_0xad98('0x2a')]()[_0xad98('0x29')](function(){_0x536907[_0xad98('0x1c')](0xcc)[_0xad98('0x1d')]();});}};}function handleEntityNotFound(_0x1d18e3,_0x1a84df){return function(_0x53e5fc){if(!_0x53e5fc){_0x1d18e3[_0xad98('0x1b')](0x194);}return _0x53e5fc;};}function handleError(_0xbab2f1,_0x6db390){_0x6db390=_0x6db390||0x1f4;return function(_0x115d3f){logger[_0xad98('0x2b')](_0x115d3f[_0xad98('0x2c')]);if(_0x115d3f[_0xad98('0x2d')]){delete _0x115d3f[_0xad98('0x2d')];}_0xbab2f1['status'](_0x6db390)[_0xad98('0x2e')](_0x115d3f);};}exports[_0xad98('0x2f')]=function(_0x38f5ac,_0x5a1a98){var _0x5f7aa6={},_0x2d04dd={},_0x2e0601={'count':0x0,'rows':[]};var _0x214aef=_['map'](db[_0xad98('0x30')][_0xad98('0x31')],function(_0x397a87){return{'name':_0x397a87[_0xad98('0x32')],'type':_0x397a87['type'][_0xad98('0x33')]};});_0x2d04dd[_0xad98('0x34')]=_[_0xad98('0x35')](_0x214aef,_0xad98('0x2d'));_0x2d04dd['query']=_[_0xad98('0x36')](_0x38f5ac[_0xad98('0x37')]);_0x2d04dd[_0xad98('0x38')]=_['intersection'](_0x2d04dd[_0xad98('0x34')],_0x2d04dd[_0xad98('0x37')]);_0x5f7aa6[_0xad98('0x39')]=_[_0xad98('0x3a')](_0x2d04dd['model'],qs[_0xad98('0x3b')](_0x38f5ac[_0xad98('0x37')][_0xad98('0x3b')]));_0x5f7aa6['attributes']=_0x5f7aa6[_0xad98('0x39')][_0xad98('0x3c')]?_0x5f7aa6[_0xad98('0x39')]:_0x2d04dd['model'];if(!_0x38f5ac['query'][_0xad98('0x3d')]('nolimit')){_0x5f7aa6['limit']=qs[_0xad98('0x20')](_0x38f5ac['query']['limit']);_0x5f7aa6[_0xad98('0x1e')]=qs[_0xad98('0x1e')](_0x38f5ac[_0xad98('0x37')][_0xad98('0x1e')]);}_0x5f7aa6[_0xad98('0x3e')]=qs[_0xad98('0x3f')](_0x38f5ac['query'][_0xad98('0x3f')]);_0x5f7aa6[_0xad98('0x40')]=qs[_0xad98('0x38')](_[_0xad98('0x41')](_0x38f5ac['query'],_0x2d04dd[_0xad98('0x38')]),_0x214aef);if(_0x38f5ac[_0xad98('0x37')][_0xad98('0x42')]){_0x5f7aa6[_0xad98('0x40')]=_[_0xad98('0x43')](_0x5f7aa6[_0xad98('0x40')],{'$or':_[_0xad98('0x35')](_0x214aef,function(_0x39df1d){if(_0x39df1d[_0xad98('0x44')]!=='VIRTUAL'){var _0x5153af={};_0x5153af[_0x39df1d['name']]={'$like':'%'+_0x38f5ac[_0xad98('0x37')][_0xad98('0x42')]+'%'};return _0x5153af;}})});}_0x5f7aa6=_[_0xad98('0x43')]({},_0x5f7aa6,_0x38f5ac[_0xad98('0x45')]);var _0x2146fc={'where':_0x5f7aa6['where']};return db['UserProfile'][_0xad98('0x21')](_0x2146fc)[_0xad98('0x29')](function(_0x1006d9){_0x2e0601[_0xad98('0x21')]=_0x1006d9;if(_0x38f5ac[_0xad98('0x37')][_0xad98('0x46')]){_0x5f7aa6['include']=[{'all':!![]}];}return db['UserProfile'][_0xad98('0x47')](_0x5f7aa6);})[_0xad98('0x29')](function(_0x329e55){_0x2e0601[_0xad98('0x48')]=_0x329e55;return _0x2e0601;})['then'](respondWithFilteredResult(_0x5a1a98,_0x5f7aa6))[_0xad98('0x49')](handleError(_0x5a1a98,null));};exports['show']=function(_0x5aab38,_0x49cdcf){var _0x3f3fc7={'raw':![],'where':{'id':_0x5aab38[_0xad98('0x4a')]['id']}},_0x1cec28={};_0x1cec28[_0xad98('0x34')]=_[_0xad98('0x36')](db[_0xad98('0x30')][_0xad98('0x31')]);_0x1cec28['query']=_['keys'](_0x5aab38[_0xad98('0x37')]);_0x1cec28['filters']=_[_0xad98('0x3a')](_0x1cec28[_0xad98('0x34')],_0x1cec28['query']);_0x3f3fc7['attributes']=_['intersection'](_0x1cec28[_0xad98('0x34')],qs[_0xad98('0x3b')](_0x5aab38['query'][_0xad98('0x3b')]));_0x3f3fc7['attributes']=_0x3f3fc7[_0xad98('0x39')]['length']?_0x3f3fc7[_0xad98('0x39')]:_0x1cec28[_0xad98('0x34')];if(_0x5aab38[_0xad98('0x37')][_0xad98('0x46')]){_0x3f3fc7[_0xad98('0x4b')]=[{'all':!![]}];}_0x3f3fc7=_[_0xad98('0x43')]({},_0x3f3fc7,_0x5aab38['options']);return db[_0xad98('0x30')][_0xad98('0x4c')](_0x3f3fc7)[_0xad98('0x29')](handleEntityNotFound(_0x49cdcf,null))[_0xad98('0x29')](respondWithResult(_0x49cdcf,null))[_0xad98('0x49')](handleError(_0x49cdcf,null));};exports[_0xad98('0x4d')]=function(_0x153312,_0x3c05dc){return db['UserProfile'][_0xad98('0x4d')](_0x153312[_0xad98('0x4e')],{})[_0xad98('0x29')](respondWithResult(_0x3c05dc,0xc9))['catch'](handleError(_0x3c05dc,null));};exports['clone']=function(_0x5ba434,_0x175f02){var _0xfe63fd={'where':{'id':_0x5ba434[_0xad98('0x4a')]['id']}},_0x2f2f38={};_0x2f2f38[_0xad98('0x34')]=_[_0xad98('0x36')](db[_0xad98('0x30')]['rawAttributes']);_0xfe63fd[_0xad98('0x39')]=_['intersection'](_0x2f2f38[_0xad98('0x34')],qs['fields'](_0x5ba434[_0xad98('0x37')][_0xad98('0x3b')]));_0xfe63fd['attributes']=_0xfe63fd['attributes'][_0xad98('0x3c')]?_0xfe63fd['attributes']:_0x2f2f38[_0xad98('0x34')];if(_0x5ba434[_0xad98('0x37')][_0xad98('0x46')]){_0xfe63fd['include']=[{'all':!![]}];}_0xfe63fd=_[_0xad98('0x43')]({},_0xfe63fd,_0x5ba434[_0xad98('0x45')]);return db[_0xad98('0x30')][_0xad98('0x4c')](_0xfe63fd)[_0xad98('0x29')](handleEntityNotFound(_0x175f02,null))[_0xad98('0x29')](function(_0x488968){if(_0x488968){var _0x17fcf6=_0x488968[_0xad98('0x4f')]({'plain':!![]});_0x17fcf6=qs[_0xad98('0x50')](_0x17fcf6,['id',_0xad98('0x51'),_0xad98('0x52'),_0xad98('0x53')]);_0x5ba434[_0xad98('0x4e')]=_[_0xad98('0x50')](_0x5ba434['body'],['id',_0xad98('0x51'),_0xad98('0x52')]);return db[_0xad98('0x54')][_0xad98('0x55')](function(_0x411ac7){return db[_0xad98('0x30')][_0xad98('0x4d')](_['merge'](_0x17fcf6,_0x5ba434['body']),{'include':_0x5ba434[_0xad98('0x37')][_0xad98('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x411ac7})['then'](function(_0x54ad4d){var _0x5d6496=_0x54ad4d['get']({'plain':!![]});return db[_0xad98('0x56')][_0xad98('0x47')]({'where':{'userProfileId':_0x5ba434[_0xad98('0x4a')]['id']},'raw':!![]})[_0xad98('0x29')](function(_0x23e201){if(_0x23e201){return BPromise[_0xad98('0x57')](_0x23e201,function(_0x231dd1){return new BPromise(function(_0x5e2ff8,_0x9db662){if(_0x231dd1[_0xad98('0x58')]===null||_0x231dd1[_0xad98('0x58')]===0x1)_0x5e2ff8(null);return db[_0xad98('0x59')][_0xad98('0x47')]({'where':{'sectionId':_0x231dd1['id']},'raw':!![]})[_0xad98('0x29')](function(_0x525a27){var _0xec9415=_['map'](_0x525a27,function(_0x456709){return qs['omit'](_0x456709,['id',_0xad98('0x51'),'updatedAt',_0xad98('0x5a')]);});_0x5e2ff8(_0xec9415);})[_0xad98('0x49')](function(_0x2d5df4){_0x9db662(_0x2d5df4);});})[_0xad98('0x29')](function(_0x4b9efd){var _0x1f8ce9=qs[_0xad98('0x50')](_0x231dd1,['id',_0xad98('0x51'),_0xad98('0x52')]);_0x1f8ce9[_0xad98('0x5b')]=_0x5d6496['id'];if(_0x4b9efd)_0x1f8ce9['Resources']=_0x4b9efd;return _0x1f8ce9;})[_0xad98('0x29')](function(_0x38b267){return db[_0xad98('0x56')][_0xad98('0x4d')](_0x38b267,{'include':[{'model':db[_0xad98('0x59')],'as':_0xad98('0x5c')}],'raw':!![],'transaction':_0x411ac7});});})[_0xad98('0x29')](function(){return _0x5d6496;});}});});});}})[_0xad98('0x29')](respondWithResult(_0x175f02,0xc9))['catch'](handleError(_0x175f02,null));};exports[_0xad98('0x28')]=function(_0x1b3a92,_0x446b23){if(_0x1b3a92[_0xad98('0x4e')]['id']){delete _0x1b3a92[_0xad98('0x4e')]['id'];}return db[_0xad98('0x30')][_0xad98('0x4c')]({'where':{'id':_0x1b3a92[_0xad98('0x4a')]['id']}})[_0xad98('0x29')](handleEntityNotFound(_0x446b23,null))[_0xad98('0x29')](saveUpdates(_0x1b3a92[_0xad98('0x4e')],null))[_0xad98('0x29')](respondWithResult(_0x446b23,null))['catch'](handleError(_0x446b23,null));};exports[_0xad98('0x2a')]=function(_0x57f92c,_0x2fa596){return db['UserProfile'][_0xad98('0x4c')]({'where':{'id':_0x57f92c[_0xad98('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fa596,null))[_0xad98('0x29')](removeEntity(_0x2fa596,null))[_0xad98('0x49')](handleError(_0x2fa596,null));};exports[_0xad98('0x5d')]=function(_0x2b916b,_0x4605c2){return db['UserProfile'][_0xad98('0x5d')]()['then'](respondWithResult(_0x4605c2,null))[_0xad98('0x49')](handleError(_0x4605c2,null));};exports[_0xad98('0x5e')]=function(_0x5e11d4,_0x217b2b){var _0x24333d=_0x5e11d4['body'];return db[_0xad98('0x30')]['find']({'where':{'id':_0x5e11d4[_0xad98('0x4a')]['id']}})[_0xad98('0x29')](handleEntityNotFound(_0x217b2b,null))[_0xad98('0x29')](function(_0x189271){if(_0x189271){return db['sequelize'][_0xad98('0x55')](function(_0x51d4c0){return db[_0xad98('0x56')][_0xad98('0x2a')]({'where':{'userProfileId':_0x5e11d4[_0xad98('0x4a')]['id'],'sectionId':_[_0xad98('0x35')](_0x24333d,function(_0x39786f){return _0x39786f[_0xad98('0x5a')];})},'transaction':_0x51d4c0})[_0xad98('0x29')](function(){var _0x3eb146=_[_0xad98('0x35')](_0x24333d,function(_0x2c6526){_0x2c6526['userProfileId']=_0x5e11d4['params']['id'];return _0x2c6526;});var _0x4723f5=[];return BPromise[_0xad98('0x57')](_0x3eb146,function(_0x362b69){return db[_0xad98('0x56')][_0xad98('0x4d')](_0x362b69,{'include':[{'model':db[_0xad98('0x59')],'as':_0xad98('0x5c')}],'raw':!![],'transaction':_0x51d4c0})[_0xad98('0x29')](function(_0x514f95){_0x4723f5[_0xad98('0x5f')](_0x514f95[_0xad98('0x4f')]({'plain':!![]}));});})[_0xad98('0x29')](function(){return _0x4723f5;});});});}})[_0xad98('0x29')](function(_0x1fd0ca){return _0x1fd0ca;})[_0xad98('0x29')](respondWithResult(_0x217b2b,null))[_0xad98('0x49')](handleError(_0x217b2b,null));};exports[_0xad98('0x60')]=function(_0x1e6b17,_0x3c3592){var _0x4f0acd;return db[_0xad98('0x30')][_0xad98('0x4c')]({'where':{'id':_0x1e6b17['params']['id']},'attributes':['id',_0xad98('0x2d')]})[_0xad98('0x29')](handleEntityNotFound(_0x3c3592,null))[_0xad98('0x29')](function(_0x55cfd1){if(_0x55cfd1){_0x4f0acd=_0x55cfd1;return db['UserProfileSection'][_0xad98('0x2a')]({'where':{'userProfileId':_0x1e6b17[_0xad98('0x4a')]['id'],'sectionId':_0x1e6b17[_0xad98('0x37')][_0xad98('0x61')]}});}})[_0xad98('0x29')](function(){return _0x4f0acd;})['then'](respondWithStatusCode(_0x3c3592,null))['catch'](handleError(_0x3c3592,null));};exports[_0xad98('0x62')]=function(_0x96abf8,_0x2330af){var _0x4ee30d=[];var _0x313a01=[];return db['UserProfileSection'][_0xad98('0x47')]({'where':{'userProfileId':_0x96abf8[_0xad98('0x4a')]['id']},'raw':!![]})[_0xad98('0x29')](function(_0x3439c0){_0x4ee30d=_[_0xad98('0x42')](_0x3439c0,function(_0x317446){return _0x317446[_0xad98('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x317446[_0xad98('0x5a')]);});if(!_[_0xad98('0x64')](_0x4ee30d)){return _[_0xad98('0x35')](_0x4ee30d,function(_0x2928e6){return _0x2928e6['sectionId'];});}else{return;}})[_0xad98('0x29')](function(_0x29e8df){if(_0x29e8df)_0x313a01=_0x29e8df;if(_['includes'](_0x313a01,0x64)){var _0x309d51=_['find'](_0x4ee30d,{'sectionId':0x64});return hasDefaultDashboard(_0x309d51)[_0xad98('0x29')](function(_0x2baf5a){return _['map'](_0x4ee30d,function(_0x1ffdb8){if(_0x1ffdb8[_0xad98('0x5a')]===0x64){_0x1ffdb8[_0xad98('0x65')]=_0x2baf5a;}return _0x1ffdb8;});});}else{return;}})['then'](function(_0x35315b){if(_0x35315b)_0x4ee30d=_0x35315b;if(_[_0xad98('0x66')](_0x313a01,0x3eb)){var _0xe16962=_['find'](_0x4ee30d,{'sectionId':0x3eb});return getCustomDashboards(_0xe16962)['then'](function(_0xa42193){return _['map'](_0x4ee30d,function(_0x1859b2){if(_0xe16962[_0xad98('0x63')]){if(_0x1859b2[_0xad98('0x5a')]===0x3eb){_0x1859b2[_0xad98('0x65')]=_0xa42193;}}else{if(_0x1859b2[_0xad98('0x5a')]===0x64){_0x1859b2['subsections']=_0xa42193;}}return _0x1859b2;});});}else{return;}})[_0xad98('0x29')](function(_0x1cf1d7){if(_0x1cf1d7)_0x4ee30d=_0x1cf1d7;if(_[_0xad98('0x66')](_0x313a01,0x709)){var _0x18eef9=_['find'](_0x4ee30d,{'sectionId':0x709});return getPlugins(_0x18eef9)[_0xad98('0x29')](function(_0x139513){if(_0x18eef9[_0xad98('0x63')]){return _[_0xad98('0x35')](_0x4ee30d,function(_0x58ab57){if(_0x58ab57['sectionId']===0x709){_0x58ab57['subsections']=_0x139513;}return _0x58ab57;});}else{var _0x41d951={'sectionId':0x76c,'enabled':0x1,'subsections':_0x139513};var _0x3d3f40=_[_0xad98('0x35')](_0x4ee30d);_0x3d3f40[_0xad98('0x5f')](_0x41d951);return _0x3d3f40;}});}else{return;}})[_0xad98('0x29')](function(_0x3189c8){if(_0x3189c8)_0x4ee30d=_0x3189c8;return _[_0xad98('0x42')](_0x4ee30d,[_0xad98('0x63'),0x1]);})[_0xad98('0x29')](respondWithResult(_0x2330af,null))['catch'](handleError(_0x2330af,null));};function hasDefaultDashboard(_0x2961b2){var _0x42337e=[0x65];return new BPromise(function(_0x5695b1,_0x1d0b27){try{if(_0x2961b2[_0xad98('0x58')]){_0x5695b1(_0x42337e);}else{return db['UserProfileResource'][_0xad98('0x67')]({'where':{'sectionId':_0x2961b2['id']},'raw':!![]})['then'](function(_0x264809){_0x264809?_0x5695b1(_0x42337e):_0x5695b1();});}}catch(_0x21c2aa){_0x1d0b27(_0x21c2aa);}});}function getCustomDashboards(_0x3ffc96){var _0x8cc5c3=[];return new BPromise(function(_0x3b4059,_0x2dbd08){try{if(_0x3ffc96['autoAssociation']){return db[_0xad98('0x68')]['findAll']({'raw':!![]})[_0xad98('0x29')](function(_0x5ecabf){_0x5ecabf[_0xad98('0x69')](function(_0x1052e7){_0x8cc5c3[_0xad98('0x5f')](_0x1052e7['id']+0x1869f);});_0x3b4059(_0x8cc5c3);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3ffc96['id']},'raw':!![]})[_0xad98('0x29')](function(_0x2dcc92){_0x2dcc92[_0xad98('0x69')](function(_0x1aa4fd){_0x8cc5c3['push'](_0x1aa4fd[_0xad98('0x6a')]+0x1869f);});_0x3b4059(_0x8cc5c3);});}}catch(_0x3e977d){_0x2dbd08(_0x3e977d);}});}function getPlugins(_0x467cae){var _0x1412c1=[];return new BPromise(function(_0x48f476,_0x2e00dc){try{if(_0x467cae[_0xad98('0x58')]){return db[_0xad98('0x6b')]['findAll']({'raw':!![]})['then'](function(_0x3e9694){_0x3e9694[_0xad98('0x69')](function(_0x518c86){_0x1412c1['push'](_0x518c86['id']+0x15b38);});_0x48f476(_0x1412c1);});}else{return db[_0xad98('0x59')][_0xad98('0x47')]({'where':{'sectionId':_0x467cae['id']},'raw':!![]})[_0xad98('0x29')](function(_0x434f27){_0x434f27[_0xad98('0x69')](function(_0x2c1a93){_0x1412c1[_0xad98('0x5f')](_0x2c1a93['resourceId']+0x15b38);});_0x48f476(_0x1412c1);});}}catch(_0x229f21){_0x2e00dc(_0x229f21);}});}exports[_0xad98('0x6c')]=function(_0x442303,_0x289a1d){return db[_0xad98('0x30')]['find']({'where':{'id':_0x442303['params']['id']}})[_0xad98('0x29')](handleEntityNotFound(_0x289a1d,null))[_0xad98('0x29')](function(_0x25bc81){if(_0x25bc81){return db['sequelize']['transaction'](function(_0x405fb1){return db[_0xad98('0x56')][_0xad98('0x47')]({'where':{'userProfileId':_0x442303[_0xad98('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xad98('0x29')](function(_0x323947){if(_0x323947){return db[_0xad98('0x56')][_0xad98('0x2a')]({'where':{'userProfileId':_0x442303[_0xad98('0x4a')]['id'],'id':_['map'](_0x323947,function(_0x41b028){return _0x41b028['id'];})},'transaction':_0x405fb1});}})[_0xad98('0x29')](function(_0x24931a){var _0x161962=_[_0xad98('0x35')](_0x442303[_0xad98('0x4e')],function(_0x2a1e26){_0x2a1e26[_0xad98('0x5b')]=_0x442303[_0xad98('0x4a')]['id'];return _0x2a1e26;});return db[_0xad98('0x56')]['bulkCreate'](_0x161962,{'raw':!![],'transaction':_0x405fb1});})[_0xad98('0x29')](function(_0x6cdf84){var _0xeadbf5=_[_0xad98('0x42')](_[_0xad98('0x35')](_0x6cdf84,function(_0x45539c){return _0x45539c[_0xad98('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0xeadbf5){return db[_0xad98('0x56')][_0xad98('0x47')]({'where':{'userProfileId':_0x442303[_0xad98('0x4a')]['id'],'sectionId':_[_0xad98('0x35')](_0xeadbf5,function(_0x34c59a){return _0x34c59a['sectionId'];})},'attributes':['id',_0xad98('0x5a')],'raw':!![]})[_0xad98('0x29')](function(_0x15d8b4){var _0xbc8f00=_[_0xad98('0x35')](_0x442303[_0xad98('0x4e')],function(_0x135148){_0x135148[_0xad98('0x5b')]=_0x442303['params']['id'];return _0x135148;});return db[_0xad98('0x59')][_0xad98('0x6d')](_0xbc8f00,{'raw':!![],'transaction':_0x405fb1});});}})[_0xad98('0x49')](handleError(_0x289a1d,null));});}})[_0xad98('0x29')](function(_0x323040){var _0x1c1124=_[_0xad98('0x35')](_0x323040,function(_0x84a419){return _0x84a419['get']({'plain':!![]});});})[_0xad98('0x29')](respondWithResult(_0x289a1d,null))[_0xad98('0x49')](handleError(_0x289a1d,null));};exports['removeResources']=function(_0x8ba4b9,_0x2527a8,_0x1f2ac9){return db['UserProfile']['find']({'where':{'id':_0x8ba4b9[_0xad98('0x4a')]['id']}})[_0xad98('0x29')](handleEntityNotFound(_0x2527a8,null))['then'](function(_0x11854d){if(_0x11854d){return _0x11854d['removeResources'](_0x8ba4b9[_0xad98('0x37')][_0xad98('0x61')]);}})[_0xad98('0x29')](respondWithStatusCode(_0x2527a8,null))[_0xad98('0x49')](handleError(_0x2527a8,null));};exports[_0xad98('0x6e')]=function(_0x187381,_0x263da3){var _0x17cbef={};if(!_0x187381[_0xad98('0x37')][_0xad98('0x6f')])throw new Error(_0xad98('0x70'));if(!_0x187381[_0xad98('0x37')][_0xad98('0x3d')](_0xad98('0x71'))){_0x17cbef['limit']=qs[_0xad98('0x20')](_0x187381[_0xad98('0x37')][_0xad98('0x20')]);_0x17cbef[_0xad98('0x1e')]=qs['offset'](_0x187381[_0xad98('0x37')][_0xad98('0x1e')]);}return db[_0xad98('0x30')][_0xad98('0x4c')]({'where':{'id':_0x187381[_0xad98('0x4a')]['id']}})[_0xad98('0x29')](function(_0x3a89b9){if(!_0x3a89b9)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x187381[_0xad98('0x4a')]['id']);return db['UserProfile'][_0xad98('0x6e')](_0x187381);})[_0xad98('0x29')](respondWithFilteredResult(_0x263da3,_0x17cbef))[_0xad98('0x49')](handleError(_0x263da3,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index bb20b50..7819d78 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 _0xad5f=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1b1ce5,_0x508743){var _0x432ff6=function(_0x28fd31){while(--_0x28fd31){_0x1b1ce5['push'](_0x1b1ce5['shift']());}};_0x432ff6(++_0x508743);}(_0xad5f,0x1a8));var _0xfad5=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xad5f[_0x15bc81];return _0x59440e;};'use strict';var EventEmitter=require(_0xfad5('0x0'));var UserProfile=require(_0xfad5('0x1'))['db'][_0xfad5('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xfad5('0x3')](0x0);var events={'afterCreate':_0xfad5('0x4'),'afterUpdate':_0xfad5('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcc61b1){return function(_0x316561,_0x1ae06d,_0x2da73e){UserProfileEvents[_0xfad5('0x6')](_0xcc61b1+':'+_0x316561['id'],_0x316561);UserProfileEvents[_0xfad5('0x6')](_0xcc61b1,_0x316561);_0x2da73e(null);};}for(var e in events){if(events[_0xfad5('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xfad5('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x66c7=['UserProfile','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x49630d,_0x1a9f1d){var _0x4a38f7=function(_0x2d09f9){while(--_0x2d09f9){_0x49630d['push'](_0x49630d['shift']());}};_0x4a38f7(++_0x1a9f1d);}(_0x66c7,0x15c));var _0x766c=function(_0x1982c4,_0x1f46e6){_0x1982c4=_0x1982c4-0x0;var _0x5dce03=_0x66c7[_0x1982c4];return _0x5dce03;};'use strict';var EventEmitter=require(_0x766c('0x0'));var UserProfile=require(_0x766c('0x1'))['db'][_0x766c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x766c('0x3'),'afterUpdate':_0x766c('0x4'),'afterDestroy':_0x766c('0x5')};function emitEvent(_0x1cf5c1){return function(_0x1b2a8e,_0x2b4c75,_0x4fa5e4){UserProfileEvents[_0x766c('0x6')](_0x1cf5c1+':'+_0x1b2a8e['id'],_0x1b2a8e);UserProfileEvents[_0x766c('0x6')](_0x1cf5c1,_0x1b2a8e);_0x4fa5e4(null);};}for(var e in events){if(events[_0x766c('0x7')](e)){var event=events[e];UserProfile[_0x766c('0x8')](e,emitEvent(event));}}module[_0x766c('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 16700d8..e7923fb 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 _0x7046=['ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','role','Telephones','User','telephone','VoiceQueues','inbound','queue','outbound','musiconholds','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','WhatsappQueue','WhatsappAccount','teams','Team','queuecampaigns','VoiceQueue','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','reportId','AnalyticMetric','charAt','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','UserProfile','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','keys','intersection','attributes','fields','limit','offset','order','sort','filters','pick','key','foreignKey','forEach','merge','includeAll','reportType','custom','count','rows','Tags','tag','Tag','color','include','openTabs','true','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','associatedResources','map','catch','field','model','findAll','then','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','projects','JscriptyProject','CmContact','ListId','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x6704('0x0'));var attributes=require(_0x6704('0x1'));var qs=require(_0x6704('0x2'));var squel=require(_0x6704('0x3'));module['exports']=function(_0x1fd895){var _0x4399c6=_0x1fd895[_0x6704('0x4')];function _0x5258e7(_0x1e9b2a,_0x35bcc6){return new Promise(function(_0x3f4169,_0x626a14){if(!_0x35bcc6)return _0x3f4169(null);var _0x2917be=_0x35bcc6['filter']?{[_0x35bcc6[_0x6704('0x5')]['field']]:_0x35bcc6['filter'][_0x6704('0x6')]}:undefined;return _0x4399c6[_0x1e9b2a]['findAll']({'where':_0x2917be,'raw':!![]})['then'](function(_0x3ca599){_0x35bcc6[_0x6704('0x7')]=_[_0x6704('0x8')](_0x3ca599,'id');_0x3f4169(_0x35bcc6);})[_0x6704('0x9')](function(_0x356687){_0x626a14(_0x356687);});});}function _0x40d57d(_0x3dfda4,_0x426715){return new Promise(function(_0x58cc09,_0x2c8b0f){var _0x29e6f7=_0x3dfda4['filter']?{[_0x3dfda4[_0x6704('0x5')][_0x6704('0xa')]]:_0x3dfda4[_0x6704('0x5')][_0x6704('0x6')]}:undefined;return _0x4399c6[_0x3dfda4[_0x6704('0xb')]][_0x6704('0xc')]({'where':_0x29e6f7,'raw':!![]})[_0x6704('0xd')](function(_0x2da4df){_0x426715[_0x6704('0x7')]=_['map'](_0x2da4df,function(_0x168258){return _0x168258[_0x6704('0xe')];});_0x58cc09(_0x426715);})[_0x6704('0x9')](function(_0x4fef80){_0x2c8b0f(_0x4fef80);});});}function _0x11782a(_0x244537,_0x3e7d1f,_0x29fa46){if(!_0x3e7d1f)return Promise[_0x6704('0xf')](null);return new Promise(function(_0x5adb35,_0x1e5f6e){return _0x4399c6[_0x6704('0x10')][_0x6704('0xc')]({'where':{'sectionId':_0x3e7d1f['id']},'raw':!![]})[_0x6704('0xd')](function(_0x344ed9){if(_0x244537['field']&&_0x244537[_0x6704('0xa')]!=='id'){_0x3e7d1f[_0x6704('0x7')]=_[_0x6704('0x8')](_0x344ed9,function(_0x156106){return _0x156106[_0x244537[_0x6704('0xa')]];});}else{if(_0x29fa46===_0x6704('0x11')){_0x3e7d1f[_0x6704('0x7')]=_['map'](_0x344ed9,function(_0x1df6d7){return{'id':_0x1df6d7[_0x6704('0x12')],'type':_0x1df6d7[_0x6704('0x13')]};});}else{_0x3e7d1f['associatedResources']=_['map'](_0x344ed9,function(_0x48d829){return _0x48d829[_0x6704('0x12')];});}}_0x5adb35(_0x3e7d1f);})[_0x6704('0x9')](function(_0x4ecf4c){_0x1e5f6e(_0x4ecf4c);});});}function _0x41f89e(_0x56d1e1,_0xf2c459){var _0xabb97a={'parentSections':[]};switch(_0x56d1e1[_0x6704('0x14')]()){case _0x6704('0x15'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x17');break;case _0x6704('0x18'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x19');break;case _0x6704('0x1a'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x1b');_0xabb97a[_0x6704('0x1c')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x6704('0x1d')}];break;case _0x6704('0x1e'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x1f');break;case'contacts':_0xabb97a[_0x6704('0x16')]=_0x6704('0x20');_0xabb97a['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x6704('0x21')}];break;case'lists':_0xabb97a[_0x6704('0x16')]='CmList';break;case'companies':_0xabb97a[_0x6704('0x16')]=_0x6704('0x22');break;case _0x6704('0x23'):_0xabb97a['childModel']=_0x6704('0x24');break;case _0x6704('0x25'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x26');break;case _0x6704('0x27'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x28');break;case _0x6704('0x29'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x2a');break;case _0x6704('0x2b'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x2c');break;case _0x6704('0x2d'):case _0x6704('0x2e'):case _0x6704('0x2f'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x30');break;case _0x6704('0x31'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x32');break;case _0x6704('0x33'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x34');break;case _0x6704('0x35'):_0xabb97a['childModel']='VoiceRecording';_0xabb97a['parentSections']=[{'name':_0x6704('0x36'),'field':_0x6704('0xe'),'foreignKey':_0x6704('0x37'),'model':'User','filter':{'field':_0x6704('0x38'),'value':['agent']}},{'name':_0x6704('0x39'),'field':_0x6704('0xe'),'foreignKey':_0x6704('0x37'),'model':_0x6704('0x3a'),'filter':{'field':_0x6704('0x38'),'value':[_0x6704('0x3b')]}},{'name':_0x6704('0x3c'),'field':_0x6704('0xe'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x6704('0x13'),'value':[_0x6704('0x3d')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x6704('0x3e'),'model':'VoiceQueue','filter':{'field':_0x6704('0x13'),'value':[_0x6704('0x3f')]}}];break;case _0x6704('0x40'):_0xabb97a[_0x6704('0x16')]='VoiceMusicOnHold';break;case _0x6704('0x41'):_0xabb97a[_0x6704('0x16')]='VoiceChanSpy';break;case _0x6704('0x42'):_0xabb97a['childModel']=_0x6704('0x43');break;case _0x6704('0x44'):_0xabb97a[_0x6704('0x16')]='Campaign';break;case _0x6704('0x45'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x46');break;case'mailaccounts':_0xabb97a[_0x6704('0x16')]=_0x6704('0x47');break;case _0x6704('0x48'):_0xabb97a[_0x6704('0x16')]='MailSubstatus';break;case _0x6704('0x49'):_0xabb97a['childModel']=_0x6704('0x4a');break;case _0x6704('0x4b'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x4c');break;case'smsqueues':_0xabb97a['childModel']='SmsQueue';break;case _0x6704('0x4d'):_0xabb97a['childModel']=_0x6704('0x4e');break;case'whatsappqueues':_0xabb97a[_0x6704('0x16')]=_0x6704('0x4f');break;case'whatsappaccounts':_0xabb97a[_0x6704('0x16')]=_0x6704('0x50');break;case _0x6704('0x51'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x52');break;case'voicequeues':case _0x6704('0x53'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x54');if(_0xf2c459){_0xabb97a[_0x6704('0x1c')]=[{'name':_0x6704('0x3c')},{'name':'QueueCampaigns'}];}break;case _0x6704('0x55'):case'agents':case _0x6704('0x56'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x3a');if(_0xf2c459){_0xabb97a[_0x6704('0x1c')]=[{'name':_0x6704('0x57'),'filter':{'field':'role','value':[_0x6704('0x58'),_0x6704('0x59')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6704('0x39')}];}break;case _0x6704('0x5a'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x5b');break;case _0x6704('0x5c'):_0xabb97a[_0x6704('0x16')]='SalesforceAccount';break;case _0x6704('0x5d'):_0xabb97a['childModel']=_0x6704('0x5e');break;case'sugarcrmaccounts':_0xabb97a[_0x6704('0x16')]='SugarcrmAccount';break;case'deskaccounts':_0xabb97a[_0x6704('0x16')]=_0x6704('0x5f');break;case _0x6704('0x60'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x61');break;case _0x6704('0x62'):_0xabb97a['childModel']='User';break;case _0x6704('0x63'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x64');break;case _0x6704('0x65'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x66');break;case _0x6704('0x67'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x68');break;case _0x6704('0x69'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x6a');break;case _0x6704('0x6b'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x6c');break;case _0x6704('0x6d'):_0xabb97a[_0x6704('0x16')]='Schedule';break;case'sounds':_0xabb97a[_0x6704('0x16')]=_0x6704('0x6e');break;case _0x6704('0x6f'):_0xabb97a[_0x6704('0x16')]='Tag';break;case _0x6704('0x70'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x71');break;case _0x6704('0x72'):_0xabb97a['childModel']=_0x6704('0x73');break;case _0x6704('0x74'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x75');break;case'variables':_0xabb97a['childModel']=_0x6704('0x76');break;case _0x6704('0x77'):_0xabb97a[_0x6704('0x16')]=_0x6704('0x78');break;case _0x6704('0x79'):_0xabb97a[_0x6704('0x16')]='AnalyticExtractedReport';_0xabb97a[_0x6704('0x1c')]=[{'name':'Reports','field':'id','foreignKey':_0x6704('0x7a')}];break;case'metrics':_0xabb97a['childModel']=_0x6704('0x7b');break;}return _0xabb97a;}function _0x2d1603(_0x18003e,_0xedf7ac){var _0x1514c5=_0x18003e[_0x6704('0x7c')](0x0)['toUpperCase']()+_0x18003e['slice'](0x1);var _0x46c386={'type':_0x4399c6[_0x6704('0x7d')][_0x6704('0x7e')][_0x6704('0x7f')],'raw':!![]};return new Promise(function(_0x3d6c5b,_0x15131a){var _0x5759ca=squel[_0x6704('0x80')]()[_0x6704('0xa')](_0x6704('0x81')+_0x1514c5+_0x6704('0x82'),'id')[_0x6704('0xa')](_0x6704('0x83'))[_0x6704('0x84')]('user_has_'+_0x18003e+'_interactions','ui')[_0x6704('0x85')](_0x6704('0x86'),_0xedf7ac['id']);return _0x4399c6[_0x6704('0x87')]['query'](_0x5759ca['toString'](),_0x46c386)[_0x6704('0xd')](function(_0x334ddb){_0xedf7ac[_0x1514c5+_0x6704('0x88')]=_0x334ddb;_0x3d6c5b(_0x334ddb);})[_0x6704('0x9')](function(_0x5d6f52){_0x15131a(_0x5d6f52);});});}return _0x1fd895[_0x6704('0x89')](_0x6704('0x8a'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4e3626){var _0x27b424={'raw':![],'where':{}};var _0x270e9e={};var _0x3f93f2={'count':0x0,'rows':[]};var _0x2d9b2f=_0x4e3626[_0x6704('0x8b')][_0x6704('0x8c')];var _0x295b2f=_0x4e3626['query'][_0x6704('0x8d')]||![];var _0x40f1f8=_0x41f89e(_0x2d9b2f,_0x295b2f);if(!_0x40f1f8[_0x6704('0x16')])throw new Error(_0x6704('0x8e')+_0x2d9b2f+'\x27');var _0x1ea6b2=[{'name':_0x2d9b2f}];if(!_[_0x6704('0x8f')](_0x40f1f8[_0x6704('0x1c')]))_0x1ea6b2=_0x40f1f8[_0x6704('0x1c')];var _0x1b81d6=[];for(var _0x3e99c6=0x0;_0x3e99c6<_0x1ea6b2[_0x6704('0x90')];_0x3e99c6++){_0x1b81d6[_0x6704('0x91')](_0x4399c6[_0x6704('0x92')][_0x6704('0x93')]({'where':{'userProfileId':_0x4e3626[_0x6704('0x94')]['id'],'name':_0x1ea6b2[_0x3e99c6][_0x6704('0xe')]},'raw':!![]}));}return Promise[_0x6704('0x95')](_0x1b81d6)[_0x6704('0xd')](function(_0x202ec0){var _0x58c74f=_[_0x6704('0x5')](_0x202ec0,function(_0x74daa4){return _0x74daa4?_0x74daa4:undefined;});var _0xb8b952=_[_0x6704('0x5')](_0x1ea6b2,['ignore',!![]]);var _0x51e599=_[_0x6704('0x8f')](_0x58c74f)&&_['isEmpty'](_0xb8b952)?null:_['union'](_0xb8b952,_0x58c74f);if(!_0x51e599)return null;var _0x1fb2d4=[];for(var _0x4e4f30=0x0;_0x4e4f30<_0x51e599[_0x6704('0x90')];_0x4e4f30++){var _0x574d48=_[_0x6704('0x93')](_0x1ea6b2,function(_0x57c55d){return _0x51e599[_0x4e4f30]?_0x57c55d[_0x6704('0xe')]===_0x51e599[_0x4e4f30][_0x6704('0xe')]:null;});if(_0x574d48){if(_0x51e599[_0x4e4f30][_0x6704('0x96')]){_0x1fb2d4['push'](_0x5258e7(_0x40f1f8['childModel'],_0x51e599[_0x4e4f30]));}else{if(!_0x51e599[_0x4e4f30][_0x6704('0x97')]){_0x1fb2d4['push'](_0x11782a(_0x574d48,_0x51e599[_0x4e4f30],_0x40f1f8[_0x6704('0x16')]));}else{if(_0x574d48['model']){_0x1fb2d4[_0x6704('0x91')](_0x40d57d(_0x574d48,_0x51e599[_0x4e4f30]));}}}}}return Promise[_0x6704('0x95')](_0x1fb2d4);})[_0x6704('0xd')](function(_0x1d0388){var _0x1b131a=_0x1d0388;var _0x12d9fc=null;if(_0x1b131a){_0x12d9fc=_0x1b131a[_0x6704('0x90')]===0x1?_0x1b131a[0x0]:null;}if(!_0x12d9fc&&!_0x1b131a)return _0x3f93f2;var _0x2e08dc=_0x4399c6[_0x40f1f8['childModel']]['rawAttributes'];_0x270e9e[_0x6704('0xb')]=_[_0x6704('0x98')](_0x2e08dc);_0x270e9e[_0x6704('0x8b')]=_[_0x6704('0x98')](_0x4e3626[_0x6704('0x8b')]);_0x270e9e['filters']=_[_0x6704('0x99')](_0x270e9e[_0x6704('0xb')],_0x270e9e[_0x6704('0x8b')]);_0x27b424[_0x6704('0x9a')]=_[_0x6704('0x99')](_0x270e9e['model'],qs[_0x6704('0x9b')](_0x4e3626[_0x6704('0x8b')][_0x6704('0x9b')]));_0x27b424['attributes']=_0x27b424['attributes'][_0x6704('0x90')]?_0x27b424[_0x6704('0x9a')]:_0x270e9e[_0x6704('0xb')];if(!_0x4e3626[_0x6704('0x8b')]['hasOwnProperty']('nolimit')){_0x27b424['limit']=qs[_0x6704('0x9c')](_0x4e3626[_0x6704('0x8b')]['limit']);_0x27b424['offset']=qs[_0x6704('0x9d')](_0x4e3626[_0x6704('0x8b')][_0x6704('0x9d')]);}_0x27b424[_0x6704('0x9e')]=qs[_0x6704('0x9f')](_0x4e3626['query'][_0x6704('0x9f')]);_0x27b424[_0x6704('0x85')]=qs[_0x6704('0xa0')](_[_0x6704('0xa1')](_0x4e3626[_0x6704('0x8b')],_0x270e9e[_0x6704('0xa0')]));if(_0x4e3626[_0x6704('0x8b')][_0x6704('0x5')]){_0x27b424[_0x6704('0x85')]=_['merge'](_0x27b424[_0x6704('0x85')],{'$or':_[_0x6704('0x8')](_0x2e08dc,function(_0x361f12){if(_0x361f12[_0x6704('0x13')][_0x6704('0xa2')]!=='VIRTUAL'){var _0x370e44={};_0x370e44[_0x361f12['field']]={'$like':'%'+_0x4e3626[_0x6704('0x8b')][_0x6704('0x5')]+'%'};return _0x370e44;}})});}var _0x39bdeb=[];var _0x35eba8=null;var _0x2f778e={};if(_0x12d9fc){_0x35eba8=_[_0x6704('0x93')](_0x1ea6b2,[_0x6704('0xe'),_0x12d9fc[_0x6704('0xe')]]);if(_0x35eba8['field']){_0x2f778e={};if(_0x40f1f8['childModel']===_0x6704('0x11')){_0x2f778e[_0x35eba8[_0x6704('0xa3')]]=_[_0x6704('0x8')](_0x12d9fc[_0x6704('0x7')],'id');}else{_0x2f778e[_0x35eba8[_0x6704('0xa3')]]=_0x12d9fc[_0x6704('0x7')];}_0x39bdeb['push'](_0x2f778e);}else{_0x27b424[_0x6704('0x85')]['id']=_0x12d9fc['associatedResources'];}}else{for(var _0x39483b=0x0;_0x39483b<_0x1b131a[_0x6704('0x90')];_0x39483b++){_0x35eba8=_[_0x6704('0x93')](_0x1ea6b2,[_0x6704('0xe'),_0x1b131a[_0x39483b][_0x6704('0xe')]]);if(_0x35eba8[_0x6704('0xa')]){_0x2f778e={};_0x2f778e[_0x35eba8[_0x6704('0xa3')]]=_0x1b131a[_0x39483b][_0x6704('0x7')];_0x39bdeb[_0x6704('0x91')](_0x2f778e);}else{if(!_0x27b424['where']['id'])_0x27b424[_0x6704('0x85')]['id']=[];_0x1b131a[_0x39483b][_0x6704('0x7')][_0x6704('0xa4')](function(_0x4f03f0){_0x27b424[_0x6704('0x85')]['id'][_0x6704('0x91')](_0x4f03f0);});}}}if(!_[_0x6704('0x8f')](_0x39bdeb)){_0x27b424[_0x6704('0x85')]=_['merge'](_0x27b424['where'],{'$and':{'$or':_0x39bdeb}});}_0x27b424=_[_0x6704('0xa5')]({},_0x27b424,_0x4e3626['options']);if(_0x12d9fc&&!_0x12d9fc[_0x6704('0x97')]&&_0x40f1f8[_0x6704('0x16')]===_0x6704('0x11')){if(_0x4e3626['query'][_0x6704('0xa6')]){_0x27b424['include']=[{'all':!![]}];}return _0x4399c6[_0x40f1f8[_0x6704('0x16')]][_0x6704('0xc')](_0x27b424)[_0x6704('0xd')](function(_0x586f77){var _0x48c6bd=[];_0x586f77['forEach'](function(_0x14d04a){var _0x33659d;switch(_0x14d04a[_0x6704('0xa7')]){case'default':_0x33659d=_[_0x6704('0x93')](_0x12d9fc['associatedResources'],function(_0x2761b5){return _0x2761b5['id']===_0x14d04a['reportId']&&_0x2761b5[_0x6704('0x13')]==='DefaultReports';});break;case _0x6704('0xa8'):_0x33659d=_[_0x6704('0x93')](_0x12d9fc['associatedResources'],function(_0x31dd63){return _0x31dd63['id']===_0x14d04a[_0x6704('0x7a')]&&_0x31dd63[_0x6704('0x13')]==='CustomReports';});break;}if(_0x33659d)_0x48c6bd['push'](_0x14d04a);});_0x3f93f2[_0x6704('0xa9')]=_0x48c6bd[_0x6704('0x90')];_0x3f93f2[_0x6704('0xaa')]=_0x48c6bd;return _0x3f93f2;});}else{return _0x4399c6[_0x40f1f8[_0x6704('0x16')]][_0x6704('0xa9')]({'where':_0x27b424[_0x6704('0x85')]})[_0x6704('0xd')](function(_0x51420d){_0x3f93f2[_0x6704('0xa9')]=_0x51420d;if(_0x4e3626[_0x6704('0x8b')][_0x6704('0xa6')]){if(_0x40f1f8[_0x6704('0x16')]===_0x6704('0x20')){_0x27b424['include']=[{'model':_0x4399c6['Tag'],'as':_0x6704('0xab'),'attributes':['id','name','color'],'required':_0x4e3626[_0x6704('0x8b')][_0x6704('0xac')]?!![]:![]},{'model':_0x4399c6[_0x6704('0xad')],'as':'ThroughTags','attributes':['id',_0x6704('0xe'),_0x6704('0xae')],'through':_0x4e3626[_0x6704('0x8b')][_0x6704('0xac')]?{'attributes':[],'where':{'TagId':_0x4e3626[_0x6704('0x8b')][_0x6704('0xac')]||undefined}}:{},'required':_0x4e3626[_0x6704('0x8b')][_0x6704('0xac')]?!![]:![]}];}else{_0x27b424[_0x6704('0xaf')]=[{'all':!![]}];}}return _0x4399c6[_0x40f1f8[_0x6704('0x16')]][_0x6704('0xc')](_0x27b424);})[_0x6704('0xd')](function(_0x27727e){_0x3f93f2[_0x6704('0xaa')]=_0x27727e;if(_0x2d9b2f===_0x6704('0x36')&&_0x4e3626[_0x6704('0x8b')][_0x6704('0xb0')]===_0x6704('0xb1')){var _0x583faa=[];for(var _0x1c5af4=0x0;_0x1c5af4<_0x3f93f2[_0x6704('0xaa')]['length'];_0x1c5af4++){_0x583faa[_0x6704('0x91')](_0x2d1603('chat',_0x3f93f2[_0x6704('0xaa')][_0x1c5af4]['dataValues']));_0x583faa['push'](_0x2d1603('sms',_0x3f93f2[_0x6704('0xaa')][_0x1c5af4][_0x6704('0xb2')]));_0x583faa['push'](_0x2d1603(_0x6704('0xb3'),_0x3f93f2[_0x6704('0xaa')][_0x1c5af4][_0x6704('0xb2')]));_0x583faa['push'](_0x2d1603('mail',_0x3f93f2[_0x6704('0xaa')][_0x1c5af4][_0x6704('0xb2')]));_0x583faa[_0x6704('0x91')](_0x2d1603(_0x6704('0xb4'),_0x3f93f2[_0x6704('0xaa')][_0x1c5af4][_0x6704('0xb2')]));_0x583faa[_0x6704('0x91')](_0x2d1603(_0x6704('0xb5'),_0x3f93f2[_0x6704('0xaa')][_0x1c5af4][_0x6704('0xb2')]));}return Promise[_0x6704('0x95')](_0x583faa)[_0x6704('0xd')](function(){return _0x3f93f2;});}return _0x3f93f2;});}});}}});}; \ No newline at end of file +var _0x7278=['CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','extractedreports','Reports','reportId','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','toString','OpenTabs','define','UserProfile','query','section','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','union','find','ignore','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','merge','key','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','associatedResources','map','catch','findAll','then','name','resolve','UserProfileResource','resourceId','type','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','CmContact','Lists','ListId','lists','CmList','globalcustomfields'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7278,0x161));var _0x8727=function(_0x3528f3,_0x1131d1){_0x3528f3=_0x3528f3-0x0;var _0x382bb2=_0x7278[_0x3528f3];return _0x382bb2;};'use strict';var _=require(_0x8727('0x0'));var attributes=require(_0x8727('0x1'));var qs=require(_0x8727('0x2'));var squel=require(_0x8727('0x3'));module[_0x8727('0x4')]=function(_0x5822da){var _0x1ddbe9=_0x5822da[_0x8727('0x5')];function _0x6007de(_0x221021,_0x2df052){return new Promise(function(_0xfd8084,_0x180b71){if(!_0x2df052)return _0xfd8084(null);var _0x5549d5=_0x2df052[_0x8727('0x6')]?{[_0x2df052[_0x8727('0x6')][_0x8727('0x7')]]:_0x2df052[_0x8727('0x6')][_0x8727('0x8')]}:undefined;return _0x1ddbe9[_0x221021]['findAll']({'where':_0x5549d5,'raw':!![]})['then'](function(_0x4df6f8){_0x2df052[_0x8727('0x9')]=_[_0x8727('0xa')](_0x4df6f8,'id');_0xfd8084(_0x2df052);})[_0x8727('0xb')](function(_0x280fb3){_0x180b71(_0x280fb3);});});}function _0x3ff244(_0x344490,_0x550796){return new Promise(function(_0xefa0bf,_0x4af9d2){var _0x2c382d=_0x344490[_0x8727('0x6')]?{[_0x344490[_0x8727('0x6')]['field']]:_0x344490[_0x8727('0x6')][_0x8727('0x8')]}:undefined;return _0x1ddbe9[_0x344490['model']][_0x8727('0xc')]({'where':_0x2c382d,'raw':!![]})[_0x8727('0xd')](function(_0x47c29d){_0x550796[_0x8727('0x9')]=_[_0x8727('0xa')](_0x47c29d,function(_0x3d84db){return _0x3d84db[_0x8727('0xe')];});_0xefa0bf(_0x550796);})[_0x8727('0xb')](function(_0x11c828){_0x4af9d2(_0x11c828);});});}function _0x88857c(_0x4842a0,_0x17baba,_0x1f9538){if(!_0x17baba)return Promise[_0x8727('0xf')](null);return new Promise(function(_0x2f6e1d,_0x112f04){return _0x1ddbe9[_0x8727('0x10')]['findAll']({'where':{'sectionId':_0x17baba['id']},'raw':!![]})['then'](function(_0x1a90ed){if(_0x4842a0['field']&&_0x4842a0[_0x8727('0x7')]!=='id'){_0x17baba[_0x8727('0x9')]=_[_0x8727('0xa')](_0x1a90ed,function(_0x22e6c9){return _0x22e6c9[_0x4842a0[_0x8727('0x7')]];});}else{if(_0x1f9538==='AnalyticExtractedReport'){_0x17baba[_0x8727('0x9')]=_[_0x8727('0xa')](_0x1a90ed,function(_0x8cde82){return{'id':_0x8cde82[_0x8727('0x11')],'type':_0x8cde82[_0x8727('0x12')]};});}else{_0x17baba[_0x8727('0x9')]=_[_0x8727('0xa')](_0x1a90ed,function(_0x441cc0){return _0x441cc0[_0x8727('0x11')];});}}_0x2f6e1d(_0x17baba);})[_0x8727('0xb')](function(_0x268a13){_0x112f04(_0x268a13);});});}function _0x1a69d5(_0x4c699b,_0x464a32){var _0x3d3592={'parentSections':[]};switch(_0x4c699b['toLowerCase']()){case'squareprojects':_0x3d3592[_0x8727('0x13')]=_0x8727('0x14');break;case _0x8727('0x15'):_0x3d3592['childModel']=_0x8727('0x16');break;case _0x8727('0x17'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x18');_0x3d3592[_0x8727('0x19')]=[{'name':_0x8727('0x1a'),'field':_0x8727('0xe'),'foreignKey':_0x8727('0x1b')}];break;case'projects':_0x3d3592[_0x8727('0x13')]=_0x8727('0x1c');break;case'contacts':_0x3d3592[_0x8727('0x13')]=_0x8727('0x1d');_0x3d3592[_0x8727('0x19')]=[{'name':_0x8727('0x1e'),'field':'id','foreignKey':_0x8727('0x1f')}];break;case _0x8727('0x20'):_0x3d3592['childModel']=_0x8727('0x21');break;case'companies':_0x3d3592[_0x8727('0x13')]='CmCompany';break;case _0x8727('0x22'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x23');break;case _0x8727('0x24'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x25');break;case _0x8727('0x26'):_0x3d3592['childModel']=_0x8727('0x27');break;case _0x8727('0x28'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x29');break;case _0x8727('0x2a'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x2b');break;case _0x8727('0x2c'):case _0x8727('0x2d'):case _0x8727('0x2e'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x2f');break;case'contexts':_0x3d3592['childModel']=_0x8727('0x30');break;case _0x8727('0x31'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x32');break;case'voicerecordings':_0x3d3592[_0x8727('0x13')]=_0x8727('0x33');_0x3d3592[_0x8727('0x19')]=[{'name':_0x8727('0x34'),'field':_0x8727('0xe'),'foreignKey':'membername','model':_0x8727('0x35'),'filter':{'field':_0x8727('0x36'),'value':[_0x8727('0x37')]}},{'name':_0x8727('0x38'),'field':_0x8727('0xe'),'foreignKey':_0x8727('0x39'),'model':_0x8727('0x35'),'filter':{'field':_0x8727('0x36'),'value':[_0x8727('0x3a')]}},{'name':_0x8727('0x3b'),'field':_0x8727('0xe'),'foreignKey':_0x8727('0x3c'),'model':'VoiceQueue','filter':{'field':_0x8727('0x12'),'value':[_0x8727('0x3d')]}},{'name':_0x8727('0x3e'),'field':_0x8727('0xe'),'foreignKey':_0x8727('0x3c'),'model':_0x8727('0x3f'),'filter':{'field':_0x8727('0x12'),'value':[_0x8727('0x40')]}}];break;case _0x8727('0x41'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x42');break;case _0x8727('0x43'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x44');break;case'voiceprefixes':_0x3d3592[_0x8727('0x13')]=_0x8727('0x45');break;case _0x8727('0x46'):_0x3d3592['childModel']=_0x8727('0x47');break;case _0x8727('0x48'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x49');break;case'mailaccounts':_0x3d3592[_0x8727('0x13')]=_0x8727('0x4a');break;case _0x8727('0x4b'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x4c');break;case _0x8727('0x4d'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x4e');break;case _0x8727('0x4f'):_0x3d3592[_0x8727('0x13')]='OpenchannelAccount';break;case _0x8727('0x50'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x51');break;case _0x8727('0x52'):_0x3d3592[_0x8727('0x13')]='SmsAccount';break;case _0x8727('0x53'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x54');break;case'whatsappaccounts':_0x3d3592[_0x8727('0x13')]=_0x8727('0x55');break;case _0x8727('0x56'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x57');break;case _0x8727('0x58'):case'queuecampaigns':_0x3d3592[_0x8727('0x13')]=_0x8727('0x3f');if(_0x464a32){_0x3d3592[_0x8727('0x19')]=[{'name':'VoiceQueues'},{'name':_0x8727('0x3e')}];}break;case _0x8727('0x59'):case _0x8727('0x5a'):case _0x8727('0x5b'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x35');if(_0x464a32){_0x3d3592[_0x8727('0x19')]=[{'name':'Users','filter':{'field':_0x8727('0x36'),'value':[_0x8727('0x5c'),_0x8727('0x5d')]},'ignore':!![]},{'name':_0x8727('0x34')},{'name':_0x8727('0x38')}];}break;case _0x8727('0x5e'):_0x3d3592[_0x8727('0x13')]='ZendeskAccount';break;case _0x8727('0x5f'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x60');break;case'freshdeskaccounts':_0x3d3592[_0x8727('0x13')]=_0x8727('0x61');break;case _0x8727('0x62'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x63');break;case _0x8727('0x64'):_0x3d3592[_0x8727('0x13')]='DeskAccount';break;case _0x8727('0x65'):_0x3d3592['childModel']=_0x8727('0x66');break;case _0x8727('0x67'):_0x3d3592['childModel']=_0x8727('0x35');break;case _0x8727('0x68'):_0x3d3592[_0x8727('0x13')]='CannedAnswer';break;case'dispositions':_0x3d3592[_0x8727('0x13')]=_0x8727('0x69');break;case _0x8727('0x6a'):_0x3d3592['childModel']=_0x8727('0x6b');break;case _0x8727('0x6c'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x6d');break;case _0x8727('0x6e'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x6f');break;case _0x8727('0x70'):_0x3d3592['childModel']=_0x8727('0x71');break;case _0x8727('0x72'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x73');break;case'tags':_0x3d3592[_0x8727('0x13')]=_0x8727('0x74');break;case _0x8727('0x75'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x76');break;case _0x8727('0x77'):_0x3d3592[_0x8727('0x13')]=_0x8727('0x78');break;case'trunks':_0x3d3592[_0x8727('0x13')]=_0x8727('0x79');break;case _0x8727('0x7a'):_0x3d3592['childModel']=_0x8727('0x7b');break;case'plugins':_0x3d3592[_0x8727('0x13')]='Plugin';break;case _0x8727('0x7c'):_0x3d3592[_0x8727('0x13')]='AnalyticExtractedReport';_0x3d3592[_0x8727('0x19')]=[{'name':_0x8727('0x7d'),'field':'id','foreignKey':_0x8727('0x7e')}];break;case'metrics':_0x3d3592['childModel']='AnalyticMetric';break;}return _0x3d3592;}function _0x5c4240(_0x3ac29a,_0x41fdad){var _0x2eaccc=_0x3ac29a[_0x8727('0x7f')](0x0)[_0x8727('0x80')]()+_0x3ac29a['slice'](0x1);var _0x4f6204={'type':_0x1ddbe9[_0x8727('0x81')][_0x8727('0x82')][_0x8727('0x83')],'raw':!![]};return new Promise(function(_0x11441a,_0x407518){var _0x11b2cf=squel[_0x8727('0x84')]()[_0x8727('0x7')](_0x8727('0x85')+_0x2eaccc+_0x8727('0x86'),'id')[_0x8727('0x7')](_0x8727('0x87'))['from'](_0x8727('0x88')+_0x3ac29a+_0x8727('0x89'),'ui')['where']('ui.UserId\x20=\x20?',_0x41fdad['id']);return _0x1ddbe9['sequelize']['query'](_0x11b2cf[_0x8727('0x8a')](),_0x4f6204)[_0x8727('0xd')](function(_0x5b79cb){_0x41fdad[_0x2eaccc+_0x8727('0x8b')]=_0x5b79cb;_0x11441a(_0x5b79cb);})[_0x8727('0xb')](function(_0x104e96){_0x407518(_0x104e96);});});}return _0x5822da[_0x8727('0x8c')](_0x8727('0x8d'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x375f34){var _0x50cdf6={'raw':![],'where':{}};var _0x1f8187={};var _0x3e048e={'count':0x0,'rows':[]};var _0x2b8a7c=_0x375f34[_0x8727('0x8e')][_0x8727('0x8f')];var _0x190f0d=_0x375f34[_0x8727('0x8e')]['mergeResources']||![];var _0x2dc488=_0x1a69d5(_0x2b8a7c,_0x190f0d);if(!_0x2dc488[_0x8727('0x13')])throw new Error(_0x8727('0x90')+_0x2b8a7c+'\x27');var _0x59070d=[{'name':_0x2b8a7c}];if(!_[_0x8727('0x91')](_0x2dc488['parentSections']))_0x59070d=_0x2dc488[_0x8727('0x19')];var _0x1e8cba=[];for(var _0xb8e231=0x0;_0xb8e231<_0x59070d[_0x8727('0x92')];_0xb8e231++){_0x1e8cba[_0x8727('0x93')](_0x1ddbe9['UserProfileSection']['find']({'where':{'userProfileId':_0x375f34[_0x8727('0x94')]['id'],'name':_0x59070d[_0xb8e231][_0x8727('0xe')]},'raw':!![]}));}return Promise[_0x8727('0x95')](_0x1e8cba)[_0x8727('0xd')](function(_0xf024bd){var _0x485c6e=_[_0x8727('0x6')](_0xf024bd,function(_0x56a275){return _0x56a275?_0x56a275:undefined;});var _0x24196b=_['filter'](_0x59070d,['ignore',!![]]);var _0x3994a6=_[_0x8727('0x91')](_0x485c6e)&&_[_0x8727('0x91')](_0x24196b)?null:_[_0x8727('0x96')](_0x24196b,_0x485c6e);if(!_0x3994a6)return null;var _0x2a92d6=[];for(var _0x5c0c1b=0x0;_0x5c0c1b<_0x3994a6['length'];_0x5c0c1b++){var _0x1a16f8=_[_0x8727('0x97')](_0x59070d,function(_0x5b8641){return _0x3994a6[_0x5c0c1b]?_0x5b8641[_0x8727('0xe')]===_0x3994a6[_0x5c0c1b][_0x8727('0xe')]:null;});if(_0x1a16f8){if(_0x3994a6[_0x5c0c1b][_0x8727('0x98')]){_0x2a92d6[_0x8727('0x93')](_0x6007de(_0x2dc488['childModel'],_0x3994a6[_0x5c0c1b]));}else{if(!_0x3994a6[_0x5c0c1b][_0x8727('0x99')]){_0x2a92d6[_0x8727('0x93')](_0x88857c(_0x1a16f8,_0x3994a6[_0x5c0c1b],_0x2dc488[_0x8727('0x13')]));}else{if(_0x1a16f8[_0x8727('0x9a')]){_0x2a92d6[_0x8727('0x93')](_0x3ff244(_0x1a16f8,_0x3994a6[_0x5c0c1b]));}}}}}return Promise[_0x8727('0x95')](_0x2a92d6);})[_0x8727('0xd')](function(_0x4a75ec){var _0x52bf43=_0x4a75ec;var _0x581c41=null;if(_0x52bf43){_0x581c41=_0x52bf43[_0x8727('0x92')]===0x1?_0x52bf43[0x0]:null;}if(!_0x581c41&&!_0x52bf43)return _0x3e048e;var _0x1a826a=_0x1ddbe9[_0x2dc488[_0x8727('0x13')]][_0x8727('0x9b')];_0x1f8187[_0x8727('0x9a')]=_[_0x8727('0x9c')](_0x1a826a);_0x1f8187[_0x8727('0x8e')]=_[_0x8727('0x9c')](_0x375f34[_0x8727('0x8e')]);_0x1f8187[_0x8727('0x9d')]=_[_0x8727('0x9e')](_0x1f8187[_0x8727('0x9a')],_0x1f8187[_0x8727('0x8e')]);_0x50cdf6[_0x8727('0x9f')]=_[_0x8727('0x9e')](_0x1f8187['model'],qs['fields'](_0x375f34['query'][_0x8727('0xa0')]));_0x50cdf6[_0x8727('0x9f')]=_0x50cdf6['attributes'][_0x8727('0x92')]?_0x50cdf6[_0x8727('0x9f')]:_0x1f8187[_0x8727('0x9a')];if(!_0x375f34['query'][_0x8727('0xa1')]('nolimit')){_0x50cdf6[_0x8727('0xa2')]=qs[_0x8727('0xa2')](_0x375f34[_0x8727('0x8e')]['limit']);_0x50cdf6['offset']=qs[_0x8727('0xa3')](_0x375f34[_0x8727('0x8e')][_0x8727('0xa3')]);}_0x50cdf6[_0x8727('0xa4')]=qs[_0x8727('0xa5')](_0x375f34[_0x8727('0x8e')][_0x8727('0xa5')]);_0x50cdf6[_0x8727('0xa6')]=qs['filters'](_['pick'](_0x375f34['query'],_0x1f8187[_0x8727('0x9d')]));if(_0x375f34[_0x8727('0x8e')][_0x8727('0x6')]){_0x50cdf6['where']=_[_0x8727('0xa7')](_0x50cdf6[_0x8727('0xa6')],{'$or':_['map'](_0x1a826a,function(_0x1474ba){if(_0x1474ba[_0x8727('0x12')][_0x8727('0xa8')]!==_0x8727('0xa9')){var _0x1b9f53={};_0x1b9f53[_0x1474ba[_0x8727('0x7')]]={'$like':'%'+_0x375f34[_0x8727('0x8e')][_0x8727('0x6')]+'%'};return _0x1b9f53;}})});}var _0x345190=[];var _0x120652=null;var _0x57cca3={};if(_0x581c41){_0x120652=_[_0x8727('0x97')](_0x59070d,[_0x8727('0xe'),_0x581c41[_0x8727('0xe')]]);if(_0x120652[_0x8727('0x7')]){_0x57cca3={};if(_0x2dc488[_0x8727('0x13')]===_0x8727('0xaa')){_0x57cca3[_0x120652[_0x8727('0xab')]]=_[_0x8727('0xa')](_0x581c41[_0x8727('0x9')],'id');}else{_0x57cca3[_0x120652[_0x8727('0xab')]]=_0x581c41[_0x8727('0x9')];}_0x345190[_0x8727('0x93')](_0x57cca3);}else{_0x50cdf6['where']['id']=_0x581c41[_0x8727('0x9')];}}else{for(var _0x41084c=0x0;_0x41084c<_0x52bf43['length'];_0x41084c++){_0x120652=_['find'](_0x59070d,[_0x8727('0xe'),_0x52bf43[_0x41084c][_0x8727('0xe')]]);if(_0x120652[_0x8727('0x7')]){_0x57cca3={};_0x57cca3[_0x120652[_0x8727('0xab')]]=_0x52bf43[_0x41084c][_0x8727('0x9')];_0x345190['push'](_0x57cca3);}else{if(!_0x50cdf6[_0x8727('0xa6')]['id'])_0x50cdf6[_0x8727('0xa6')]['id']=[];_0x52bf43[_0x41084c]['associatedResources'][_0x8727('0xac')](function(_0x5603e7){_0x50cdf6[_0x8727('0xa6')]['id'][_0x8727('0x93')](_0x5603e7);});}}}if(!_['isEmpty'](_0x345190)){_0x50cdf6['where']=_[_0x8727('0xa7')](_0x50cdf6[_0x8727('0xa6')],{'$and':{'$or':_0x345190}});}_0x50cdf6=_[_0x8727('0xa7')]({},_0x50cdf6,_0x375f34['options']);if(_0x581c41&&!_0x581c41[_0x8727('0x99')]&&_0x2dc488[_0x8727('0x13')]===_0x8727('0xaa')){if(_0x375f34['query'][_0x8727('0xad')]){_0x50cdf6[_0x8727('0xae')]=[{'all':!![]}];}return _0x1ddbe9[_0x2dc488[_0x8727('0x13')]][_0x8727('0xc')](_0x50cdf6)['then'](function(_0x4de489){var _0x5b2519=[];_0x4de489[_0x8727('0xac')](function(_0x29d89e){var _0x3dcb05;switch(_0x29d89e[_0x8727('0xaf')]){case _0x8727('0xb0'):_0x3dcb05=_[_0x8727('0x97')](_0x581c41[_0x8727('0x9')],function(_0x200b3a){return _0x200b3a['id']===_0x29d89e[_0x8727('0x7e')]&&_0x200b3a[_0x8727('0x12')]===_0x8727('0xb1');});break;case _0x8727('0xb2'):_0x3dcb05=_[_0x8727('0x97')](_0x581c41['associatedResources'],function(_0x3ef076){return _0x3ef076['id']===_0x29d89e[_0x8727('0x7e')]&&_0x3ef076[_0x8727('0x12')]===_0x8727('0xb3');});break;}if(_0x3dcb05)_0x5b2519[_0x8727('0x93')](_0x29d89e);});_0x3e048e[_0x8727('0xb4')]=_0x5b2519[_0x8727('0x92')];_0x3e048e[_0x8727('0xb5')]=_0x5b2519;return _0x3e048e;});}else{return _0x1ddbe9[_0x2dc488[_0x8727('0x13')]]['count']({'where':_0x50cdf6[_0x8727('0xa6')]})['then'](function(_0x311f51){_0x3e048e[_0x8727('0xb4')]=_0x311f51;if(_0x375f34[_0x8727('0x8e')][_0x8727('0xad')]){if(_0x2dc488[_0x8727('0x13')]===_0x8727('0x1d')){_0x50cdf6[_0x8727('0xae')]=[{'model':_0x1ddbe9[_0x8727('0x74')],'as':_0x8727('0xb6'),'attributes':['id',_0x8727('0xe'),_0x8727('0xb7')],'required':_0x375f34['query']['tag']?!![]:![]},{'model':_0x1ddbe9[_0x8727('0x74')],'as':_0x8727('0xb8'),'attributes':['id','name',_0x8727('0xb7')],'through':_0x375f34['query'][_0x8727('0xb9')]?{'attributes':[],'where':{'TagId':_0x375f34[_0x8727('0x8e')][_0x8727('0xb9')]||undefined}}:{},'required':_0x375f34[_0x8727('0x8e')][_0x8727('0xb9')]?!![]:![]}];}else{_0x50cdf6['include']=[{'all':!![]}];}}return _0x1ddbe9[_0x2dc488[_0x8727('0x13')]][_0x8727('0xc')](_0x50cdf6);})[_0x8727('0xd')](function(_0x2016fa){_0x3e048e[_0x8727('0xb5')]=_0x2016fa;if(_0x2b8a7c==='Agents'&&_0x375f34['query'][_0x8727('0xba')]===_0x8727('0xbb')){var _0x113943=[];for(var _0x8e37d0=0x0;_0x8e37d0<_0x3e048e[_0x8727('0xb5')][_0x8727('0x92')];_0x8e37d0++){_0x113943[_0x8727('0x93')](_0x5c4240(_0x8727('0xbc'),_0x3e048e['rows'][_0x8e37d0][_0x8727('0xbd')]));_0x113943[_0x8727('0x93')](_0x5c4240(_0x8727('0xbe'),_0x3e048e['rows'][_0x8e37d0][_0x8727('0xbd')]));_0x113943[_0x8727('0x93')](_0x5c4240(_0x8727('0xbf'),_0x3e048e[_0x8727('0xb5')][_0x8e37d0]['dataValues']));_0x113943[_0x8727('0x93')](_0x5c4240(_0x8727('0xc0'),_0x3e048e[_0x8727('0xb5')][_0x8e37d0][_0x8727('0xbd')]));_0x113943[_0x8727('0x93')](_0x5c4240(_0x8727('0xc1'),_0x3e048e['rows'][_0x8e37d0][_0x8727('0xbd')]));_0x113943[_0x8727('0x93')](_0x5c4240('whatsapp',_0x3e048e[_0x8727('0xb5')][_0x8e37d0][_0x8727('0xbd')]));}return Promise[_0x8727('0x95')](_0x113943)[_0x8727('0xd')](function(){return _0x3e048e;});}return _0x3e048e;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index c727da5..35ba1e0 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 _0x07d7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ae592,_0x57a8c2){var _0x518200=function(_0x14a517){while(--_0x14a517){_0x2ae592['push'](_0x2ae592['shift']());}};_0x518200(++_0x57a8c2);}(_0x07d7,0x85));var _0x707d=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x07d7[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var moment=require(_0x707d('0x2'));var BPromise=require(_0x707d('0x3'));var rs=require(_0x707d('0x4'));var fs=require('fs');var Redis=require(_0x707d('0x5'));var db=require(_0x707d('0x6'))['db'];var utils=require(_0x707d('0x7'));var logger=require(_0x707d('0x8'))(_0x707d('0x9'));var config=require(_0x707d('0xa'));var jayson=require(_0x707d('0xb'));var client=jayson[_0x707d('0xc')][_0x707d('0xd')]({'port':0x232a});config[_0x707d('0xe')]=_[_0x707d('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x707d('0x10'))(new Redis(config[_0x707d('0xe')]));require(_0x707d('0x11'))[_0x707d('0x12')](socket);function respondWithRpcPromise(_0x51750,_0x5af425,_0x3f45f5){return new BPromise(function(_0x107bc3,_0xd87d5d){return client['request'](_0x51750,_0x3f45f5)[_0x707d('0x13')](function(_0x355ce4){logger[_0x707d('0x14')]('UserProfile,\x20%s,\x20%s',_0x5af425,'request\x20sent');logger['debug'](_0x707d('0x15'),_0x5af425,_0x707d('0x16'),JSON[_0x707d('0x17')](_0x355ce4));if(_0x355ce4['error']){if(_0x355ce4[_0x707d('0x18')]['code']===0x1f4){logger[_0x707d('0x18')](_0x707d('0x19'),_0x5af425,_0x355ce4['error']['message']);return _0xd87d5d(_0x355ce4[_0x707d('0x18')]['message']);}logger[_0x707d('0x18')](_0x707d('0x19'),_0x5af425,_0x355ce4[_0x707d('0x18')][_0x707d('0x1a')]);return _0x107bc3(_0x355ce4[_0x707d('0x18')][_0x707d('0x1a')]);}else{logger[_0x707d('0x14')]('UserProfile,\x20%s,\x20%s',_0x5af425,_0x707d('0x16'));_0x107bc3(_0x355ce4[_0x707d('0x1b')][_0x707d('0x1a')]);}})['catch'](function(_0x291864){logger[_0x707d('0x18')](_0x707d('0x19'),_0x5af425,_0x291864);_0xd87d5d(_0x291864);});});} \ No newline at end of file +var _0x6dc0=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','UserProfile,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x390707,_0x48a308){var _0x1ed937=function(_0x3fca92){while(--_0x3fca92){_0x390707['push'](_0x390707['shift']());}};_0x1ed937(++_0x48a308);}(_0x6dc0,0xb6));var _0x06dc=function(_0x103e3e,_0x11a925){_0x103e3e=_0x103e3e-0x0;var _0x1c7ab6=_0x6dc0[_0x103e3e];return _0x1c7ab6;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});config[_0x06dc('0xa')]=_[_0x06dc('0xb')](config[_0x06dc('0xa')],{'host':_0x06dc('0xc'),'port':0x18eb});var socket=require(_0x06dc('0xd'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x128ea7,_0x1f2041,_0x4ec0aa){return new BPromise(function(_0x45693d,_0x1e7abd){return client[_0x06dc('0xe')](_0x128ea7,_0x4ec0aa)[_0x06dc('0xf')](function(_0x4fa7fc){logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x1f2041,'request\x20sent',JSON[_0x06dc('0x12')](_0x4fa7fc));if(_0x4fa7fc['error']){if(_0x4fa7fc['error']['code']===0x1f4){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc[_0x06dc('0x13')]['message']);return _0x1e7abd(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc['error'][_0x06dc('0x14')]);return _0x45693d(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}else{logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');_0x45693d(_0x4fa7fc[_0x06dc('0x15')][_0x06dc('0x14')]);}})[_0x06dc('0x16')](function(_0xc658ea){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0xc658ea);_0x1e7abd(_0xc658ea);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 8950d5c..91a3b8a 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 _0x9bc4=['./userProfile.events','save','update','register','length','userProfile:'];(function(_0x44d124,_0x51fceb){var _0xb8fb6f=function(_0x3fa0be){while(--_0x3fa0be){_0x44d124['push'](_0x44d124['shift']());}};_0xb8fb6f(++_0x51fceb);}(_0x9bc4,0xc6));var _0x49bc=function(_0x3d88df,_0x48c8bc){_0x3d88df=_0x3d88df-0x0;var _0x408b81=_0x9bc4[_0x3d88df];return _0x408b81;};'use strict';var UserProfileEvents=require(_0x49bc('0x0'));var events=[_0x49bc('0x1'),'remove',_0x49bc('0x2')];function createListener(_0xf56e77,_0x45d867){return function(_0x16b878){_0x45d867['emit'](_0xf56e77,_0x16b878);};}function removeListener(_0x100d45,_0x553d0f){return function(){UserProfileEvents['removeListener'](_0x100d45,_0x553d0f);};}exports[_0x49bc('0x3')]=function(_0x4fb1dd){for(var _0x91096d=0x0,_0x19b940=events[_0x49bc('0x4')];_0x91096d<_0x19b940;_0x91096d++){var _0x1f6f6b=events[_0x91096d];var _0x5c1c40=createListener(_0x49bc('0x5')+_0x1f6f6b,_0x4fb1dd);UserProfileEvents['on'](_0x1f6f6b,_0x5c1c40);}}; \ No newline at end of file +var _0xfb42=['register','length','userProfile:','./userProfile.events','remove','update','emit','removeListener'];(function(_0x5a77fb,_0x2d2d59){var _0x6ca4fb=function(_0x428777){while(--_0x428777){_0x5a77fb['push'](_0x5a77fb['shift']());}};_0x6ca4fb(++_0x2d2d59);}(_0xfb42,0x8b));var _0x2fb4=function(_0x32e00e,_0x28ecb2){_0x32e00e=_0x32e00e-0x0;var _0x4fc827=_0xfb42[_0x32e00e];return _0x4fc827;};'use strict';var UserProfileEvents=require(_0x2fb4('0x0'));var events=['save',_0x2fb4('0x1'),_0x2fb4('0x2')];function createListener(_0x46f864,_0x5b00b3){return function(_0x247d32){_0x5b00b3[_0x2fb4('0x3')](_0x46f864,_0x247d32);};}function removeListener(_0x4c10eb,_0x73dc70){return function(){UserProfileEvents[_0x2fb4('0x4')](_0x4c10eb,_0x73dc70);};}exports[_0x2fb4('0x5')]=function(_0x4f745b){for(var _0xe06c5a=0x0,_0x2db335=events[_0x2fb4('0x6')];_0xe06c5a<_0x2db335;_0xe06c5a++){var _0x3d9ff3=events[_0xe06c5a];var _0x3a040f=createListener(_0x2fb4('0x7')+_0x3d9ff3,_0x4f745b);UserProfileEvents['on'](_0x3d9ff3,_0x3a040f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0e08232..f4af16b 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 _0x4b2c=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update'];(function(_0x4021b4,_0x1f8f62){var _0x3597ec=function(_0x3a10b1){while(--_0x3a10b1){_0x4021b4['push'](_0x4021b4['shift']());}};_0x3597ec(++_0x1f8f62);}(_0x4b2c,0x13d));var _0xc4b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b2c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc4b2('0x0'));var util=require(_0xc4b2('0x1'));var path=require('path');var timeout=require(_0xc4b2('0x2'));var express=require(_0xc4b2('0x3'));var router=express[_0xc4b2('0x4')]();var fs_extra=require(_0xc4b2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc4b2('0x6'));var config=require(_0xc4b2('0x7'));var controller=require(_0xc4b2('0x8'));router[_0xc4b2('0x9')]('/',auth['isAuthenticated'](),controller[_0xc4b2('0xa')]);router[_0xc4b2('0x9')](_0xc4b2('0xb'),auth[_0xc4b2('0xc')](),controller[_0xc4b2('0xd')]);router[_0xc4b2('0x9')](_0xc4b2('0xe'),auth['isAuthenticated'](),controller[_0xc4b2('0xf')]);router['post']('/',auth[_0xc4b2('0xc')](),controller[_0xc4b2('0x10')]);router[_0xc4b2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc4b2('0x12')]);router[_0xc4b2('0x13')](_0xc4b2('0xe'),auth[_0xc4b2('0xc')](),controller[_0xc4b2('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2441=['update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x40c2f2,_0x2fad0a){var _0x4427fc=function(_0x56b214){while(--_0x56b214){_0x40c2f2['push'](_0x40c2f2['shift']());}};_0x4427fc(++_0x2fad0a);}(_0x2441,0xff));var _0x1244=function(_0x2e5ba7,_0x40ec06){_0x2e5ba7=_0x2e5ba7-0x0;var _0x531729=_0x2441[_0x2e5ba7];return _0x531729;};'use strict';var multer=require(_0x1244('0x0'));var util=require(_0x1244('0x1'));var path=require(_0x1244('0x2'));var timeout=require(_0x1244('0x3'));var express=require('express');var router=express[_0x1244('0x4')]();var fs_extra=require(_0x1244('0x5'));var auth=require(_0x1244('0x6'));var interaction=require(_0x1244('0x7'));var config=require(_0x1244('0x8'));var controller=require('./userProfileResource.controller');router[_0x1244('0x9')]('/',auth[_0x1244('0xa')](),controller[_0x1244('0xb')]);router[_0x1244('0x9')](_0x1244('0xc'),auth[_0x1244('0xa')](),controller[_0x1244('0xd')]);router[_0x1244('0x9')](_0x1244('0xe'),auth[_0x1244('0xa')](),controller['show']);router[_0x1244('0xf')]('/',auth[_0x1244('0xa')](),controller[_0x1244('0x10')]);router[_0x1244('0x11')](_0x1244('0xe'),auth[_0x1244('0xa')](),controller[_0x1244('0x12')]);router[_0x1244('0x13')](_0x1244('0xe'),auth[_0x1244('0xa')](),controller[_0x1244('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 c317072..5e0971c 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 _0xc31c=['exports','STRING','INTEGER','sequelize'];(function(_0x32ebb4,_0x407cc0){var _0x24d383=function(_0x545166){while(--_0x545166){_0x32ebb4['push'](_0x32ebb4['shift']());}};_0x24d383(++_0x407cc0);}(_0xc31c,0x1a7));var _0xcc31=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xc31c[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0xcc31('0x0'));module[_0xcc31('0x1')]={'name':{'type':Sequelize[_0xcc31('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcc31('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xcc31('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8004=['INTEGER','sequelize','exports','STRING'];(function(_0x48cce6,_0x47fb27){var _0xc9fa9c=function(_0x4e1bc7){while(--_0x4e1bc7){_0x48cce6['push'](_0x48cce6['shift']());}};_0xc9fa9c(++_0x47fb27);}(_0x8004,0x145));var _0x4800=function(_0x2d8f46,_0x1ab3f3){_0x2d8f46=_0x2d8f46-0x0;var _0x4619ea=_0x8004[_0x2d8f46];return _0x4619ea;};'use strict';var Sequelize=require(_0x4800('0x0'));module[_0x4800('0x1')]={'name':{'type':Sequelize[_0x4800('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4800('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4800('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 0c3cbcc..1cc6ee7 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 _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x233b65,_0x438922){var _0xcc12a0=function(_0x32280f){while(--_0x32280f){_0x233b65['push'](_0x233b65['shift']());}};_0xcc12a0(++_0x438922);}(_0xafc4,0x69));var _0x4afc=function(_0x1a61bc,_0x33b349){_0x1a61bc=_0x1a61bc-0x0;var _0x47f9c3=_0xafc4[_0x1a61bc];return _0x47f9c3;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file +var _0x57ca=['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','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x1549a3,_0x5c3777){var _0x5a820f=function(_0xa29210){while(--_0xa29210){_0x1549a3['push'](_0x1549a3['shift']());}};_0x5a820f(++_0x5c3777);}(_0x57ca,0x108));var _0xa57c=function(_0x1b2b68,_0xc82bb9){_0x1b2b68=_0x1b2b68-0x0;var _0x374f4a=_0x57ca[_0x1b2b68];return _0x374f4a;};'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['UserProfileResource']['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['UserProfileResource'][_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));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a15c201..4e2d60f 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 _0x09ae=['rimraf','../../config/environment','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1a13b1,_0x4d1d25){var _0x395e05=function(_0x209692){while(--_0x209692){_0x1a13b1['push'](_0x1a13b1['shift']());}};_0x395e05(++_0x4d1d25);}(_0x09ae,0xd9));var _0xe09a=function(_0x3e24fe,_0x28f5e5){_0x3e24fe=_0x3e24fe-0x0;var _0x8e5265=_0x09ae[_0x3e24fe];return _0x8e5265;};'use strict';var _=require(_0xe09a('0x0'));var util=require('util');var logger=require(_0xe09a('0x1'))(_0xe09a('0x2'));var moment=require(_0xe09a('0x3'));var BPromise=require(_0xe09a('0x4'));var rp=require(_0xe09a('0x5'));var fs=require('fs');var path=require(_0xe09a('0x6'));var rimraf=require(_0xe09a('0x7'));var config=require(_0xe09a('0x8'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x154fec,_0x4cdcde){return _0x154fec[_0xe09a('0x9')](_0xe09a('0xa'),attributes,{'tableName':_0xe09a('0xb'),'paranoid':![],'indexes':[{'name':_0xe09a('0xc'),'fields':['resourceId',_0xe09a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc94a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','util'];(function(_0x3688d5,_0x51d2b7){var _0x3013c4=function(_0x5b3b4c){while(--_0x5b3b4c){_0x3688d5['push'](_0x3688d5['shift']());}};_0x3013c4(++_0x51d2b7);}(_0xc94a,0x13a));var _0xac94=function(_0x564bc9,_0x4eb703){_0x564bc9=_0x564bc9-0x0;var _0x1b2067=_0xc94a[_0x564bc9];return _0x1b2067;};'use strict';var _=require('lodash');var util=require(_0xac94('0x0'));var logger=require(_0xac94('0x1'))(_0xac94('0x2'));var moment=require(_0xac94('0x3'));var BPromise=require(_0xac94('0x4'));var rp=require(_0xac94('0x5'));var fs=require('fs');var path=require(_0xac94('0x6'));var rimraf=require('rimraf');var config=require(_0xac94('0x7'));var attributes=require(_0xac94('0x8'));module[_0xac94('0x9')]=function(_0x4a3f3c,_0x1590d0){return _0x4a3f3c[_0xac94('0xa')](_0xac94('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xac94('0xc'),'fields':[_0xac94('0xd'),_0xac94('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 901f26d..405f7c5 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 _0x2820=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','request'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2820,0xb2));var _0x0282=function(_0x1a1c9d,_0x47a9c1){_0x1a1c9d=_0x1a1c9d-0x0;var _0x2f0080=_0x2820[_0x1a1c9d];return _0x2f0080;};'use strict';var _=require(_0x0282('0x0'));var util=require(_0x0282('0x1'));var moment=require('moment');var BPromise=require(_0x0282('0x2'));var rs=require(_0x0282('0x3'));var fs=require('fs');var Redis=require(_0x0282('0x4'));var db=require(_0x0282('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0282('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0282('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37425a,_0x210cd4,_0x27c8f3){return new BPromise(function(_0x33b344,_0x118d2d){return client[_0x0282('0x8')](_0x37425a,_0x27c8f3)['then'](function(_0x31af80){logger[_0x0282('0x9')](_0x0282('0xa'),_0x210cd4,_0x0282('0xb'));logger[_0x0282('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x210cd4,'request\x20sent',JSON[_0x0282('0xd')](_0x31af80));if(_0x31af80['error']){if(_0x31af80[_0x0282('0xe')]['code']===0x1f4){logger[_0x0282('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x210cd4,_0x31af80[_0x0282('0xe')][_0x0282('0xf')]);return _0x118d2d(_0x31af80[_0x0282('0xe')][_0x0282('0xf')]);}logger[_0x0282('0xe')](_0x0282('0xa'),_0x210cd4,_0x31af80['error'][_0x0282('0xf')]);return _0x33b344(_0x31af80[_0x0282('0xe')][_0x0282('0xf')]);}else{logger[_0x0282('0x9')](_0x0282('0xa'),_0x210cd4,_0x0282('0xb'));_0x33b344(_0x31af80['result'][_0x0282('0xf')]);}})[_0x0282('0x10')](function(_0x463f9b){logger[_0x0282('0xe')](_0x0282('0xa'),_0x210cd4,_0x463f9b);_0x118d2d(_0x463f9b);});});} \ No newline at end of file +var _0xc65a=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0xc65a,0xfa));var _0xac65=function(_0x1b4239,_0x265dd1){_0x1b4239=_0x1b4239-0x0;var _0x31bc7a=_0xc65a[_0x1b4239];return _0x31bc7a;};'use strict';var _=require(_0xac65('0x0'));var util=require('util');var moment=require(_0xac65('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac65('0x2'));var db=require(_0xac65('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xac65('0x4'))(_0xac65('0x5'));var config=require('../../config/environment');var jayson=require(_0xac65('0x6'));var client=jayson[_0xac65('0x7')][_0xac65('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13cbd6,_0x5d5816,_0x205a29){return new BPromise(function(_0x3d9a4f,_0x392254){return client['request'](_0x13cbd6,_0x205a29)[_0xac65('0x9')](function(_0x26f593){logger[_0xac65('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x5d5816,_0xac65('0xb'));logger[_0xac65('0xc')](_0xac65('0xd'),_0x5d5816,_0xac65('0xb'),JSON[_0xac65('0xe')](_0x26f593));if(_0x26f593[_0xac65('0xf')]){if(_0x26f593['error'][_0xac65('0x10')]===0x1f4){logger[_0xac65('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5d5816,_0x26f593[_0xac65('0xf')][_0xac65('0x11')]);return _0x392254(_0x26f593['error'][_0xac65('0x11')]);}logger[_0xac65('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5d5816,_0x26f593[_0xac65('0xf')][_0xac65('0x11')]);return _0x3d9a4f(_0x26f593[_0xac65('0xf')][_0xac65('0x11')]);}else{logger['info'](_0xac65('0x12'),_0x5d5816,_0xac65('0xb'));_0x3d9a4f(_0x26f593[_0xac65('0x13')][_0xac65('0x11')]);}})[_0xac65('0x14')](function(_0x25131c){logger[_0xac65('0xf')](_0xac65('0x12'),_0x5d5816,_0x25131c);_0x392254(_0x25131c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1bc0ef1..e6a025a 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 _0x024a=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','destroy'];(function(_0x54761f,_0x48099c){var _0xad4732=function(_0x408f08){while(--_0x408f08){_0x54761f['push'](_0x54761f['shift']());}};_0xad4732(++_0x48099c);}(_0x024a,0x119));var _0xa024=function(_0x5f0c6f,_0x1d77bb){_0x5f0c6f=_0x5f0c6f-0x0;var _0x3d727c=_0x024a[_0x5f0c6f];return _0x3d727c;};'use strict';var multer=require(_0xa024('0x0'));var util=require('util');var path=require(_0xa024('0x1'));var timeout=require(_0xa024('0x2'));var express=require('express');var router=express[_0xa024('0x3')]();var fs_extra=require(_0xa024('0x4'));var auth=require(_0xa024('0x5'));var interaction=require(_0xa024('0x6'));var config=require(_0xa024('0x7'));var controller=require('./userProfileSection.controller');router[_0xa024('0x8')]('/',auth['isAuthenticated'](),controller[_0xa024('0x9')]);router[_0xa024('0x8')](_0xa024('0xa'),auth[_0xa024('0xb')](),controller[_0xa024('0xc')]);router[_0xa024('0x8')]('/:id',auth[_0xa024('0xb')](),controller['show']);router[_0xa024('0xd')]('/',auth[_0xa024('0xb')](),controller[_0xa024('0xe')]);router[_0xa024('0xf')](_0xa024('0x10'),auth['isAuthenticated'](),controller[_0xa024('0x11')]);router['delete'](_0xa024('0x10'),auth['isAuthenticated'](),controller[_0xa024('0x12')]);module[_0xa024('0x13')]=router; \ No newline at end of file +var _0x3b83=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x236095,_0x5b9394){var _0x1195a4=function(_0x2bc207){while(--_0x2bc207){_0x236095['push'](_0x236095['shift']());}};_0x1195a4(++_0x5b9394);}(_0x3b83,0x1ea));var _0x33b8=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x3b83[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0x33b8('0x0'));var util=require('util');var path=require(_0x33b8('0x1'));var timeout=require(_0x33b8('0x2'));var express=require('express');var router=express[_0x33b8('0x3')]();var fs_extra=require(_0x33b8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x33b8('0x5'));var config=require(_0x33b8('0x6'));var controller=require('./userProfileSection.controller');router[_0x33b8('0x7')]('/',auth[_0x33b8('0x8')](),controller[_0x33b8('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x33b8('0xa')]);router[_0x33b8('0x7')](_0x33b8('0xb'),auth[_0x33b8('0x8')](),controller['show']);router[_0x33b8('0xc')]('/',auth[_0x33b8('0x8')](),controller[_0x33b8('0xd')]);router[_0x33b8('0xe')]('/:id',auth[_0x33b8('0x8')](),controller[_0x33b8('0xf')]);router['delete'](_0x33b8('0xb'),auth[_0x33b8('0x8')](),controller[_0x33b8('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 650ed9b..5dd2afb 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x065e=['crudPermissions','getDataValue','split','sequelize','INTEGER','BOOLEAN','setDataValue'];(function(_0x7d6fed,_0x334864){var _0x32d9e8=function(_0x53fb6f){while(--_0x53fb6f){_0x7d6fed['push'](_0x7d6fed['shift']());}};_0x32d9e8(++_0x334864);}(_0x065e,0x1a7));var _0xe065=function(_0x27660b,_0x14148f){_0x27660b=_0x27660b-0x0;var _0xbc5762=_0x065e[_0x27660b];return _0xbc5762;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe065('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe065('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4964fa){this[_0xe065('0x3')](_0xe065('0x4'),_0x4964fa?_0x4964fa['join'](''):[]);},'get':function(){return this[_0xe065('0x5')](_0xe065('0x4'))?this[_0xe065('0x5')]('crudPermissions')[_0xe065('0x6')](''):[];}}}; \ No newline at end of file +var _0x93e9=['crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x35d0ef,_0x227730){var _0x26cf06=function(_0x2f04c8){while(--_0x2f04c8){_0x35d0ef['push'](_0x35d0ef['shift']());}};_0x26cf06(++_0x227730);}(_0x93e9,0xcc));var _0x993e=function(_0x3bf7e5,_0xc51291){_0x3bf7e5=_0x3bf7e5-0x0;var _0x3cfc0a=_0x93e9[_0x3bf7e5];return _0x3cfc0a;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x993e('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x55f739){this[_0x993e('0x5')](_0x993e('0x6'),_0x55f739?_0x55f739[_0x993e('0x7')](''):[]);},'get':function(){return this[_0x993e('0x8')](_0x993e('0x6'))?this[_0x993e('0x8')](_0x993e('0x6'))[_0x993e('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 8703f64..dc575a1 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 _0x662c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','UserProfileSection','fieldName','type','keys','filters','model','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2ee70f,_0x49223c){var _0x33e1a3=function(_0x5ce18a){while(--_0x5ce18a){_0x2ee70f['push'](_0x2ee70f['shift']());}};_0x33e1a3(++_0x49223c);}(_0x662c,0x83));var _0xc662=function(_0xa28183,_0x3922c7){_0xa28183=_0xa28183-0x0;var _0x36c609=_0x662c[_0xa28183];return _0x36c609;};'use strict';var emlformat=require(_0xc662('0x0'));var rimraf=require(_0xc662('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc662('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc662('0x3'));var Mustache=require(_0xc662('0x4'));var util=require(_0xc662('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc662('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc662('0x7'));var _=require('lodash');var squel=require(_0xc662('0x8'));var crypto=require(_0xc662('0x9'));var jsforce=require(_0xc662('0xa'));var deskjs=require(_0xc662('0xb'));var toCsv=require(_0xc662('0x6'));var querystring=require('querystring');var Papa=require(_0xc662('0xc'));var Redis=require(_0xc662('0xd'));var authService=require(_0xc662('0xe'));var qs=require(_0xc662('0xf'));var as=require(_0xc662('0x10'));var hardwareService=require(_0xc662('0x11'));var logger=require(_0xc662('0x12'))(_0xc662('0x13'));var utils=require(_0xc662('0x14'));var config=require(_0xc662('0x15'));var licenseUtil=require(_0xc662('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x354ec2,_0x59809c){_0x59809c=_0x59809c||0xcc;return function(_0x510ffe){if(_0x510ffe){return _0x354ec2[_0xc662('0x17')](_0x59809c);}return _0x354ec2[_0xc662('0x18')](_0x59809c)[_0xc662('0x19')]();};}function respondWithResult(_0x32c56f,_0x51786b){_0x51786b=_0x51786b||0xc8;return function(_0x108f9e){if(_0x108f9e){return _0x32c56f[_0xc662('0x18')](_0x51786b)['json'](_0x108f9e);}};}function respondWithFilteredResult(_0x2ff5c1,_0x4e1943){return function(_0x53db43){if(_0x53db43){var _0x5c5502=typeof _0x4e1943[_0xc662('0x1a')]===_0xc662('0x1b')&&typeof _0x4e1943[_0xc662('0x1c')]===_0xc662('0x1b');var _0x57ffab=_0x53db43[_0xc662('0x1d')];var _0x3262af=_0x5c5502?0x0:_0x4e1943[_0xc662('0x1a')];var _0x293a7b=_0x5c5502?_0x53db43[_0xc662('0x1d')]:_0x4e1943[_0xc662('0x1a')]+_0x4e1943[_0xc662('0x1c')];var _0x2620b7;if(_0x293a7b>=_0x57ffab){_0x293a7b=_0x57ffab;_0x2620b7=0xc8;}else{_0x2620b7=0xce;}_0x2ff5c1[_0xc662('0x18')](_0x2620b7);return _0x2ff5c1[_0xc662('0x1e')](_0xc662('0x1f'),_0x3262af+'-'+_0x293a7b+'/'+_0x57ffab)[_0xc662('0x20')](_0x53db43);}return null;};}function patchUpdates(_0xf61436){return function(_0x530127){try{jsonpatch[_0xc662('0x21')](_0x530127,_0xf61436,!![]);}catch(_0x2d4250){return BPromise['reject'](_0x2d4250);}return _0x530127[_0xc662('0x22')]();};}function saveUpdates(_0xd6ce83,_0x4609b1){return function(_0x82a293){if(_0x82a293){return _0x82a293[_0xc662('0x23')](_0xd6ce83)[_0xc662('0x24')](function(_0x3dcf32){return _0x3dcf32;});}return null;};}function removeEntity(_0x246231,_0x204e19){return function(_0x337b9b){if(_0x337b9b){return _0x337b9b[_0xc662('0x25')]()[_0xc662('0x24')](function(){_0x246231[_0xc662('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2ca0,_0x9d257d){return function(_0x5ec1ff){if(!_0x5ec1ff){_0x1b2ca0[_0xc662('0x17')](0x194);}return _0x5ec1ff;};}function handleError(_0x60a2dd,_0x1f708e){_0x1f708e=_0x1f708e||0x1f4;return function(_0xd0d4c3){logger['error'](_0xd0d4c3[_0xc662('0x26')]);if(_0xd0d4c3[_0xc662('0x27')]){delete _0xd0d4c3['name'];}_0x60a2dd[_0xc662('0x18')](_0x1f708e)[_0xc662('0x28')](_0xd0d4c3);};}exports[_0xc662('0x29')]=function(_0x5b911d,_0x296304){var _0x3e13f0={},_0x43c889={},_0x1b9d9d={'count':0x0,'rows':[]};var _0x53d057=_[_0xc662('0x2a')](db[_0xc662('0x2b')]['rawAttributes'],function(_0x2deb29){return{'name':_0x2deb29[_0xc662('0x2c')],'type':_0x2deb29[_0xc662('0x2d')]['key']};});_0x43c889['model']=_['map'](_0x53d057,_0xc662('0x27'));_0x43c889['query']=_[_0xc662('0x2e')](_0x5b911d['query']);_0x43c889[_0xc662('0x2f')]=_['intersection'](_0x43c889[_0xc662('0x30')],_0x43c889['query']);_0x3e13f0['attributes']=_[_0xc662('0x31')](_0x43c889['model'],qs[_0xc662('0x32')](_0x5b911d[_0xc662('0x33')][_0xc662('0x32')]));_0x3e13f0[_0xc662('0x34')]=_0x3e13f0[_0xc662('0x34')][_0xc662('0x35')]?_0x3e13f0[_0xc662('0x34')]:_0x43c889[_0xc662('0x30')];if(!_0x5b911d[_0xc662('0x33')][_0xc662('0x36')](_0xc662('0x37'))){_0x3e13f0[_0xc662('0x1c')]=qs[_0xc662('0x1c')](_0x5b911d[_0xc662('0x33')][_0xc662('0x1c')]);_0x3e13f0[_0xc662('0x1a')]=qs['offset'](_0x5b911d['query'][_0xc662('0x1a')]);}_0x3e13f0[_0xc662('0x38')]=qs['sort'](_0x5b911d[_0xc662('0x33')][_0xc662('0x39')]);_0x3e13f0[_0xc662('0x3a')]=qs[_0xc662('0x2f')](_[_0xc662('0x3b')](_0x5b911d['query'],_0x43c889[_0xc662('0x2f')]),_0x53d057);if(_0x5b911d[_0xc662('0x33')][_0xc662('0x3c')]){_0x3e13f0[_0xc662('0x3a')]=_[_0xc662('0x3d')](_0x3e13f0[_0xc662('0x3a')],{'$or':_[_0xc662('0x2a')](_0x53d057,function(_0x1ee762){if(_0x1ee762[_0xc662('0x2d')]!=='VIRTUAL'){var _0x11f449={};_0x11f449[_0x1ee762[_0xc662('0x27')]]={'$like':'%'+_0x5b911d[_0xc662('0x33')][_0xc662('0x3c')]+'%'};return _0x11f449;}})});}_0x3e13f0=_[_0xc662('0x3d')]({},_0x3e13f0,_0x5b911d['options']);var _0xae678d={'where':_0x3e13f0[_0xc662('0x3a')]};return db['UserProfileSection']['count'](_0xae678d)['then'](function(_0x2c99eb){_0x1b9d9d[_0xc662('0x1d')]=_0x2c99eb;if(_0x5b911d[_0xc662('0x33')][_0xc662('0x3e')]){_0x3e13f0['include']=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x3e13f0);})[_0xc662('0x24')](function(_0x506984){_0x1b9d9d[_0xc662('0x3f')]=_0x506984;return _0x1b9d9d;})[_0xc662('0x24')](respondWithFilteredResult(_0x296304,_0x3e13f0))[_0xc662('0x40')](handleError(_0x296304,null));};exports[_0xc662('0x41')]=function(_0x470b94,_0x158ce3){var _0x30fc66={'raw':![],'where':{'id':_0x470b94[_0xc662('0x42')]['id']}},_0x4815f0={};_0x4815f0[_0xc662('0x30')]=_[_0xc662('0x2e')](db['UserProfileSection'][_0xc662('0x43')]);_0x4815f0[_0xc662('0x33')]=_['keys'](_0x470b94[_0xc662('0x33')]);_0x4815f0[_0xc662('0x2f')]=_[_0xc662('0x31')](_0x4815f0[_0xc662('0x30')],_0x4815f0[_0xc662('0x33')]);_0x30fc66[_0xc662('0x34')]=_[_0xc662('0x31')](_0x4815f0[_0xc662('0x30')],qs['fields'](_0x470b94[_0xc662('0x33')][_0xc662('0x32')]));_0x30fc66[_0xc662('0x34')]=_0x30fc66[_0xc662('0x34')]['length']?_0x30fc66[_0xc662('0x34')]:_0x4815f0[_0xc662('0x30')];if(_0x470b94[_0xc662('0x33')][_0xc662('0x3e')]){_0x30fc66[_0xc662('0x44')]=[{'all':!![]}];}_0x30fc66=_[_0xc662('0x3d')]({},_0x30fc66,_0x470b94[_0xc662('0x45')]);return db['UserProfileSection'][_0xc662('0x46')](_0x30fc66)[_0xc662('0x24')](handleEntityNotFound(_0x158ce3,null))['then'](respondWithResult(_0x158ce3,null))['catch'](handleError(_0x158ce3,null));};exports[_0xc662('0x47')]=function(_0x5882c2,_0x58ce65){return db[_0xc662('0x2b')][_0xc662('0x47')](_0x5882c2[_0xc662('0x48')],{})[_0xc662('0x24')](respondWithResult(_0x58ce65,0xc9))[_0xc662('0x40')](handleError(_0x58ce65,null));};exports['update']=function(_0x50d69e,_0x4cda8c){if(_0x50d69e[_0xc662('0x48')]['id']){delete _0x50d69e[_0xc662('0x48')]['id'];}return db[_0xc662('0x2b')]['find']({'where':{'id':_0x50d69e[_0xc662('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cda8c,null))[_0xc662('0x24')](saveUpdates(_0x50d69e[_0xc662('0x48')],null))['then'](respondWithResult(_0x4cda8c,null))[_0xc662('0x40')](handleError(_0x4cda8c,null));};exports[_0xc662('0x25')]=function(_0x57d3ee,_0x1824ba){return db['UserProfileSection']['find']({'where':{'id':_0x57d3ee[_0xc662('0x42')]['id']}})[_0xc662('0x24')](handleEntityNotFound(_0x1824ba,null))[_0xc662('0x24')](removeEntity(_0x1824ba,null))[_0xc662('0x40')](handleError(_0x1824ba,null));};exports['describe']=function(_0x9300ec,_0x167a60){return db[_0xc662('0x2b')][_0xc662('0x49')]()['then'](respondWithResult(_0x167a60,null))[_0xc662('0x40')](handleError(_0x167a60,null));}; \ No newline at end of file +var _0x7c9c=['apply','reject','destroy','then','name','send','index','UserProfileSection','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','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','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x4a00d0,_0x2f31d8){var _0x4c43ef=function(_0x13d8c6){while(--_0x13d8c6){_0x4a00d0['push'](_0x4a00d0['shift']());}};_0x4c43ef(++_0x2f31d8);}(_0x7c9c,0x150));var _0xc7c9=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x7c9c[_0x4f4d19];return _0x27a258;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7c9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7c9('0x1'));var rp=require(_0xc7c9('0x2'));var moment=require(_0xc7c9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc7c9('0x4'));var util=require(_0xc7c9('0x5'));var path=require(_0xc7c9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc7c9('0x7'));var fs=require('fs');var fs_extra=require(_0xc7c9('0x8'));var _=require(_0xc7c9('0x9'));var squel=require('squel');var crypto=require(_0xc7c9('0xa'));var jsforce=require(_0xc7c9('0xb'));var deskjs=require(_0xc7c9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc7c9('0xd'));var Papa=require(_0xc7c9('0xe'));var Redis=require(_0xc7c9('0xf'));var authService=require(_0xc7c9('0x10'));var qs=require(_0xc7c9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7c9('0x12'));var logger=require(_0xc7c9('0x13'))(_0xc7c9('0x14'));var utils=require(_0xc7c9('0x15'));var config=require(_0xc7c9('0x16'));var licenseUtil=require(_0xc7c9('0x17'));var db=require(_0xc7c9('0x18'))['db'];function respondWithStatusCode(_0x10fecc,_0x5d075d){_0x5d075d=_0x5d075d||0xcc;return function(_0x65236b){if(_0x65236b){return _0x10fecc[_0xc7c9('0x19')](_0x5d075d);}return _0x10fecc[_0xc7c9('0x1a')](_0x5d075d)['end']();};}function respondWithResult(_0x59b771,_0x119181){_0x119181=_0x119181||0xc8;return function(_0x36c910){if(_0x36c910){return _0x59b771[_0xc7c9('0x1a')](_0x119181)[_0xc7c9('0x1b')](_0x36c910);}};}function respondWithFilteredResult(_0x25ff46,_0x1608f3){return function(_0x40c384){if(_0x40c384){var _0x3cce3b=typeof _0x1608f3[_0xc7c9('0x1c')]===_0xc7c9('0x1d')&&typeof _0x1608f3['limit']===_0xc7c9('0x1d');var _0x5c7be0=_0x40c384['count'];var _0x298691=_0x3cce3b?0x0:_0x1608f3['offset'];var _0x5015b8=_0x3cce3b?_0x40c384[_0xc7c9('0x1e')]:_0x1608f3[_0xc7c9('0x1c')]+_0x1608f3[_0xc7c9('0x1f')];var _0x2518f1;if(_0x5015b8>=_0x5c7be0){_0x5015b8=_0x5c7be0;_0x2518f1=0xc8;}else{_0x2518f1=0xce;}_0x25ff46[_0xc7c9('0x1a')](_0x2518f1);return _0x25ff46[_0xc7c9('0x20')](_0xc7c9('0x21'),_0x298691+'-'+_0x5015b8+'/'+_0x5c7be0)[_0xc7c9('0x1b')](_0x40c384);}return null;};}function patchUpdates(_0x1952df){return function(_0x2f55a1){try{jsonpatch[_0xc7c9('0x22')](_0x2f55a1,_0x1952df,!![]);}catch(_0x2d5f07){return BPromise[_0xc7c9('0x23')](_0x2d5f07);}return _0x2f55a1['save']();};}function saveUpdates(_0x1b7707,_0x207de7){return function(_0xd99555){if(_0xd99555){return _0xd99555['update'](_0x1b7707)['then'](function(_0x1d16ce){return _0x1d16ce;});}return null;};}function removeEntity(_0x3aecfc,_0x24b55c){return function(_0x3d8163){if(_0x3d8163){return _0x3d8163[_0xc7c9('0x24')]()[_0xc7c9('0x25')](function(){_0x3aecfc[_0xc7c9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5888,_0x5c8835){return function(_0x2e8c93){if(!_0x2e8c93){_0x1c5888[_0xc7c9('0x19')](0x194);}return _0x2e8c93;};}function handleError(_0x2a7fcc,_0x18db79){_0x18db79=_0x18db79||0x1f4;return function(_0x40b82a){logger['error'](_0x40b82a['stack']);if(_0x40b82a[_0xc7c9('0x26')]){delete _0x40b82a[_0xc7c9('0x26')];}_0x2a7fcc['status'](_0x18db79)[_0xc7c9('0x27')](_0x40b82a);};}exports[_0xc7c9('0x28')]=function(_0x3b0205,_0x1fc4e5){var _0x58d153={},_0x1cdb53={},_0x3bd168={'count':0x0,'rows':[]};var _0x5d52b1=_['map'](db[_0xc7c9('0x29')]['rawAttributes'],function(_0x2083a8){return{'name':_0x2083a8[_0xc7c9('0x2a')],'type':_0x2083a8[_0xc7c9('0x2b')][_0xc7c9('0x2c')]};});_0x1cdb53[_0xc7c9('0x2d')]=_[_0xc7c9('0x2e')](_0x5d52b1,_0xc7c9('0x26'));_0x1cdb53[_0xc7c9('0x2f')]=_[_0xc7c9('0x30')](_0x3b0205[_0xc7c9('0x2f')]);_0x1cdb53[_0xc7c9('0x31')]=_[_0xc7c9('0x32')](_0x1cdb53[_0xc7c9('0x2d')],_0x1cdb53['query']);_0x58d153[_0xc7c9('0x33')]=_[_0xc7c9('0x32')](_0x1cdb53[_0xc7c9('0x2d')],qs[_0xc7c9('0x34')](_0x3b0205[_0xc7c9('0x2f')][_0xc7c9('0x34')]));_0x58d153[_0xc7c9('0x33')]=_0x58d153['attributes'][_0xc7c9('0x35')]?_0x58d153['attributes']:_0x1cdb53['model'];if(!_0x3b0205['query'][_0xc7c9('0x36')](_0xc7c9('0x37'))){_0x58d153['limit']=qs['limit'](_0x3b0205[_0xc7c9('0x2f')][_0xc7c9('0x1f')]);_0x58d153[_0xc7c9('0x1c')]=qs[_0xc7c9('0x1c')](_0x3b0205[_0xc7c9('0x2f')][_0xc7c9('0x1c')]);}_0x58d153[_0xc7c9('0x38')]=qs[_0xc7c9('0x39')](_0x3b0205[_0xc7c9('0x2f')][_0xc7c9('0x39')]);_0x58d153[_0xc7c9('0x3a')]=qs['filters'](_['pick'](_0x3b0205[_0xc7c9('0x2f')],_0x1cdb53[_0xc7c9('0x31')]),_0x5d52b1);if(_0x3b0205['query']['filter']){_0x58d153[_0xc7c9('0x3a')]=_[_0xc7c9('0x3b')](_0x58d153[_0xc7c9('0x3a')],{'$or':_['map'](_0x5d52b1,function(_0x3a292f){if(_0x3a292f[_0xc7c9('0x2b')]!==_0xc7c9('0x3c')){var _0x536799={};_0x536799[_0x3a292f['name']]={'$like':'%'+_0x3b0205['query'][_0xc7c9('0x3d')]+'%'};return _0x536799;}})});}_0x58d153=_[_0xc7c9('0x3b')]({},_0x58d153,_0x3b0205[_0xc7c9('0x3e')]);var _0x5a5791={'where':_0x58d153[_0xc7c9('0x3a')]};return db[_0xc7c9('0x29')][_0xc7c9('0x1e')](_0x5a5791)[_0xc7c9('0x25')](function(_0x5f1b71){_0x3bd168[_0xc7c9('0x1e')]=_0x5f1b71;if(_0x3b0205[_0xc7c9('0x2f')]['includeAll']){_0x58d153[_0xc7c9('0x3f')]=[{'all':!![]}];}return db[_0xc7c9('0x29')][_0xc7c9('0x40')](_0x58d153);})['then'](function(_0x35939d){_0x3bd168['rows']=_0x35939d;return _0x3bd168;})[_0xc7c9('0x25')](respondWithFilteredResult(_0x1fc4e5,_0x58d153))[_0xc7c9('0x41')](handleError(_0x1fc4e5,null));};exports[_0xc7c9('0x42')]=function(_0x49ea76,_0x248f8e){var _0x53cddf={'raw':![],'where':{'id':_0x49ea76[_0xc7c9('0x43')]['id']}},_0x1a58cc={};_0x1a58cc[_0xc7c9('0x2d')]=_['keys'](db[_0xc7c9('0x29')][_0xc7c9('0x44')]);_0x1a58cc[_0xc7c9('0x2f')]=_[_0xc7c9('0x30')](_0x49ea76[_0xc7c9('0x2f')]);_0x1a58cc[_0xc7c9('0x31')]=_[_0xc7c9('0x32')](_0x1a58cc[_0xc7c9('0x2d')],_0x1a58cc[_0xc7c9('0x2f')]);_0x53cddf[_0xc7c9('0x33')]=_['intersection'](_0x1a58cc[_0xc7c9('0x2d')],qs[_0xc7c9('0x34')](_0x49ea76[_0xc7c9('0x2f')][_0xc7c9('0x34')]));_0x53cddf[_0xc7c9('0x33')]=_0x53cddf[_0xc7c9('0x33')]['length']?_0x53cddf[_0xc7c9('0x33')]:_0x1a58cc[_0xc7c9('0x2d')];if(_0x49ea76['query'][_0xc7c9('0x45')]){_0x53cddf[_0xc7c9('0x3f')]=[{'all':!![]}];}_0x53cddf=_[_0xc7c9('0x3b')]({},_0x53cddf,_0x49ea76[_0xc7c9('0x3e')]);return db[_0xc7c9('0x29')][_0xc7c9('0x46')](_0x53cddf)[_0xc7c9('0x25')](handleEntityNotFound(_0x248f8e,null))[_0xc7c9('0x25')](respondWithResult(_0x248f8e,null))['catch'](handleError(_0x248f8e,null));};exports[_0xc7c9('0x47')]=function(_0x1dbbe8,_0x5bdd72){return db[_0xc7c9('0x29')]['create'](_0x1dbbe8['body'],{})[_0xc7c9('0x25')](respondWithResult(_0x5bdd72,0xc9))[_0xc7c9('0x41')](handleError(_0x5bdd72,null));};exports['update']=function(_0x5b987b,_0x3e449a){if(_0x5b987b[_0xc7c9('0x48')]['id']){delete _0x5b987b[_0xc7c9('0x48')]['id'];}return db[_0xc7c9('0x29')]['find']({'where':{'id':_0x5b987b[_0xc7c9('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e449a,null))['then'](saveUpdates(_0x5b987b[_0xc7c9('0x48')],null))['then'](respondWithResult(_0x3e449a,null))['catch'](handleError(_0x3e449a,null));};exports['destroy']=function(_0x1f9d67,_0x27f44f){return db['UserProfileSection'][_0xc7c9('0x46')]({'where':{'id':_0x1f9d67[_0xc7c9('0x43')]['id']}})['then'](handleEntityNotFound(_0x27f44f,null))['then'](removeEntity(_0x27f44f,null))[_0xc7c9('0x41')](handleError(_0x27f44f,null));};exports[_0xc7c9('0x49')]=function(_0x155851,_0x28b4f1){return db['UserProfileSection'][_0xc7c9('0x49')]()['then'](respondWithResult(_0x28b4f1,null))[_0xc7c9('0x41')](handleError(_0x28b4f1,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5bf91aa..cad1e2a 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 _0xf95c=['../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','lodash','bluebird','rimraf'];(function(_0xc03885,_0x1751d2){var _0x111b91=function(_0x117899){while(--_0x117899){_0xc03885['push'](_0xc03885['shift']());}};_0x111b91(++_0x1751d2);}(_0xf95c,0x17d));var _0xcf95=function(_0x4a32a3,_0x4cdefb){_0x4a32a3=_0x4a32a3-0x0;var _0x212820=_0xf95c[_0x4a32a3];return _0x212820;};'use strict';var _=require(_0xcf95('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcf95('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcf95('0x2'));var config=require(_0xcf95('0x3'));var attributes=require('./userProfileSection.attributes');module[_0xcf95('0x4')]=function(_0x297616,_0x39b1bc){return _0x297616[_0xcf95('0x5')](_0xcf95('0x6'),attributes,{'tableName':_0xcf95('0x7'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb28=['./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x1728eb,_0x2cc598){var _0xddba26=function(_0x33d368){while(--_0x33d368){_0x1728eb['push'](_0x1728eb['shift']());}};_0xddba26(++_0x2cc598);}(_0xfb28,0x10a));var _0x8fb2=function(_0x478a47,_0x12e619){_0x478a47=_0x478a47-0x0;var _0x4a15dd=_0xfb28[_0x478a47];return _0x4a15dd;};'use strict';var _=require(_0x8fb2('0x0'));var util=require(_0x8fb2('0x1'));var logger=require(_0x8fb2('0x2'))('api');var moment=require(_0x8fb2('0x3'));var BPromise=require(_0x8fb2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fb2('0x5'));var rimraf=require('rimraf');var config=require(_0x8fb2('0x6'));var attributes=require(_0x8fb2('0x7'));module[_0x8fb2('0x8')]=function(_0x4c8a59,_0x489fed){return _0x4c8a59[_0x8fb2('0x9')]('UserProfileSection',attributes,{'tableName':_0x8fb2('0xa'),'paranoid':![],'indexes':[{'name':_0x8fb2('0xb'),'fields':['sectionId',_0x8fb2('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 3de1f08..0e88cbd 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 _0xb7d8=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7d8,0x163));var _0x8b7d=function(_0x2a5f06,_0x177bbe){_0x2a5f06=_0x2a5f06-0x0;var _0x38c62d=_0xb7d8[_0x2a5f06];return _0x38c62d;};'use strict';var _=require(_0x8b7d('0x0'));var util=require(_0x8b7d('0x1'));var moment=require('moment');var BPromise=require(_0x8b7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b7d('0x3'))['db'];var utils=require(_0x8b7d('0x4'));var logger=require('../../config/logger')(_0x8b7d('0x5'));var config=require(_0x8b7d('0x6'));var jayson=require(_0x8b7d('0x7'));var client=jayson[_0x8b7d('0x8')][_0x8b7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31b4c8,_0x1b4c27,_0x5d69ed){return new BPromise(function(_0x4da93c,_0x20b3bb){return client[_0x8b7d('0xa')](_0x31b4c8,_0x5d69ed)[_0x8b7d('0xb')](function(_0x266fc2){logger[_0x8b7d('0xc')](_0x8b7d('0xd'),_0x1b4c27,_0x8b7d('0xe'));logger['debug'](_0x8b7d('0xf'),_0x1b4c27,_0x8b7d('0xe'),JSON[_0x8b7d('0x10')](_0x266fc2));if(_0x266fc2[_0x8b7d('0x11')]){if(_0x266fc2['error']['code']===0x1f4){logger['error'](_0x8b7d('0xd'),_0x1b4c27,_0x266fc2['error'][_0x8b7d('0x12')]);return _0x20b3bb(_0x266fc2['error'][_0x8b7d('0x12')]);}logger['error'](_0x8b7d('0xd'),_0x1b4c27,_0x266fc2[_0x8b7d('0x11')][_0x8b7d('0x12')]);return _0x4da93c(_0x266fc2[_0x8b7d('0x11')][_0x8b7d('0x12')]);}else{logger[_0x8b7d('0xc')](_0x8b7d('0xd'),_0x1b4c27,_0x8b7d('0xe'));_0x4da93c(_0x266fc2[_0x8b7d('0x13')][_0x8b7d('0x12')]);}})['catch'](function(_0x335f2f){logger[_0x8b7d('0x11')](_0x8b7d('0xd'),_0x1b4c27,_0x335f2f);_0x20b3bb(_0x335f2f);});});} \ No newline at end of file +var _0xd62b=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd62b,0xdd));var _0xbd62=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0xd62b[_0x1505e5];return _0x5b1dcd;};'use strict';var _=require(_0xbd62('0x0'));var util=require(_0xbd62('0x1'));var moment=require(_0xbd62('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd62('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd62('0x4'))(_0xbd62('0x5'));var config=require(_0xbd62('0x6'));var jayson=require(_0xbd62('0x7'));var client=jayson[_0xbd62('0x8')][_0xbd62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ca240,_0x2faf6e,_0x1cc65c){return new BPromise(function(_0x30cf69,_0x39a00f){return client['request'](_0x2ca240,_0x1cc65c)[_0xbd62('0xa')](function(_0x1762b5){logger[_0xbd62('0xb')](_0xbd62('0xc'),_0x2faf6e,_0xbd62('0xd'));logger[_0xbd62('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2faf6e,'request\x20sent',JSON[_0xbd62('0xf')](_0x1762b5));if(_0x1762b5[_0xbd62('0x10')]){if(_0x1762b5[_0xbd62('0x10')][_0xbd62('0x11')]===0x1f4){logger[_0xbd62('0x10')](_0xbd62('0xc'),_0x2faf6e,_0x1762b5[_0xbd62('0x10')][_0xbd62('0x12')]);return _0x39a00f(_0x1762b5[_0xbd62('0x10')][_0xbd62('0x12')]);}logger['error'](_0xbd62('0xc'),_0x2faf6e,_0x1762b5['error'][_0xbd62('0x12')]);return _0x30cf69(_0x1762b5[_0xbd62('0x10')]['message']);}else{logger[_0xbd62('0xb')](_0xbd62('0xc'),_0x2faf6e,_0xbd62('0xd'));_0x30cf69(_0x1762b5[_0xbd62('0x13')]['message']);}})[_0xbd62('0x14')](function(_0x3a5c37){logger[_0xbd62('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2faf6e,_0x3a5c37);_0x39a00f(_0x3a5c37);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 04638cc..e90f7bd 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4d0729,_0x5d82f6){var _0x568d5c=function(_0x161c29){while(--_0x161c29){_0x4d0729['push'](_0x4d0729['shift']());}};_0x568d5c(++_0x5d82f6);}(_0x70e0,0x17b));var _0x070e=function(_0xb743d9,_0x328cd6){_0xb743d9=_0xb743d9-0x0;var _0x332cd5=_0x70e0[_0xb743d9];return _0x332cd5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x34c037,_0x2588dc){var _0x132386=function(_0xbb8d79){while(--_0xbb8d79){_0x34c037['push'](_0x34c037['shift']());}};_0x132386(++_0x2588dc);}(_0x70e0,0x17b));var _0x070e=function(_0x4b1ef5,_0x4144b){_0x4b1ef5=_0x4b1ef5-0x0;var _0x4ecfb9=_0x70e0[_0x4b1ef5];return _0x4ecfb9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d806def..42a720b 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 _0xa2c5=['exports','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa2c5,0x7a));var _0x5a2c=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa2c5[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require('sequelize');module[_0x5a2c('0x0')]={'penalty':{'type':Sequelize[_0x5a2c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1ebf=['exports','INTEGER','sequelize'];(function(_0x4a2fde,_0xfb92ae){var _0x1042c3=function(_0x1ff498){while(--_0x1ff498){_0x4a2fde['push'](_0x4a2fde['shift']());}};_0x1042c3(++_0xfb92ae);}(_0x1ebf,0x110));var _0xf1eb=function(_0x1cd5b3,_0x288f7d){_0x1cd5b3=_0x1cd5b3-0x0;var _0x3a93ac=_0x1ebf[_0x1cd5b3];return _0x3a93ac;};'use strict';var Sequelize=require(_0xf1eb('0x0'));module[_0xf1eb('0x1')]={'penalty':{'type':Sequelize[_0xf1eb('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 27f772b..63eb039 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 _0x1189=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5920b4,_0x1f5fc4){var _0x41deae=function(_0x11fe8b){while(--_0x11fe8b){_0x5920b4['push'](_0x5920b4['shift']());}};_0x41deae(++_0x1f5fc4);}(_0x1189,0x17f));var _0x9118=function(_0x3d0698,_0x78f414){_0x3d0698=_0x3d0698-0x0;var _0x42dcb9=_0x1189[_0x3d0698];return _0x42dcb9;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var logger=require(_0x9118('0x2'))(_0x9118('0x3'));var moment=require('moment');var BPromise=require(_0x9118('0x4'));var rp=require(_0x9118('0x5'));var fs=require('fs');var path=require(_0x9118('0x6'));var rimraf=require(_0x9118('0x7'));var config=require(_0x9118('0x8'));var attributes=require(_0x9118('0x9'));module[_0x9118('0xa')]=function(_0x499ee5,_0x124b4a){return _0x499ee5[_0x9118('0xb')](_0x9118('0xc'),attributes,{'tableName':_0x9118('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf55=['util','api','moment','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0xdf55,0x83));var _0x5df5=function(_0x399131,_0x2db855){_0x399131=_0x399131-0x0;var _0xce76e2=_0xdf55[_0x399131];return _0xce76e2;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));module[_0x5df5('0x8')]=function(_0x27ec86,_0x476e21){return _0x27ec86[_0x5df5('0x9')](_0x5df5('0xa'),attributes,{'tableName':_0x5df5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 23e7237..6c829de 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 _0xa720=['catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message'];(function(_0x24abec,_0x30ff71){var _0x132716=function(_0x124d3f){while(--_0x124d3f){_0x24abec['push'](_0x24abec['shift']());}};_0x132716(++_0x30ff71);}(_0xa720,0x135));var _0x0a72=function(_0x1838ad,_0x2073cd){_0x1838ad=_0x1838ad-0x0;var _0x3169d7=_0xa720[_0x1838ad];return _0x3169d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0a72('0x0'));var BPromise=require(_0x0a72('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a72('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a72('0x3'));var logger=require(_0x0a72('0x4'))(_0x0a72('0x5'));var config=require(_0x0a72('0x6'));var jayson=require(_0x0a72('0x7'));var client=jayson[_0x0a72('0x8')][_0x0a72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42945c,_0x4e13b8,_0x5273b2){return new BPromise(function(_0x288b61,_0x2f9048){return client[_0x0a72('0xa')](_0x42945c,_0x5273b2)[_0x0a72('0xb')](function(_0x3251fe){logger[_0x0a72('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x4e13b8,'request\x20sent');logger[_0x0a72('0xd')](_0x0a72('0xe'),_0x4e13b8,_0x0a72('0xf'),JSON[_0x0a72('0x10')](_0x3251fe));if(_0x3251fe['error']){if(_0x3251fe[_0x0a72('0x11')][_0x0a72('0x12')]===0x1f4){logger[_0x0a72('0x11')](_0x0a72('0x13'),_0x4e13b8,_0x3251fe['error']['message']);return _0x2f9048(_0x3251fe['error'][_0x0a72('0x14')]);}logger[_0x0a72('0x11')](_0x0a72('0x13'),_0x4e13b8,_0x3251fe['error']['message']);return _0x288b61(_0x3251fe['error'][_0x0a72('0x14')]);}else{logger[_0x0a72('0xc')](_0x0a72('0x13'),_0x4e13b8,_0x0a72('0xf'));_0x288b61(_0x3251fe['result'][_0x0a72('0x14')]);}})[_0x0a72('0x15')](function(_0x4abaf7){logger[_0x0a72('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x4e13b8,_0x4abaf7);_0x2f9048(_0x4abaf7);});});} \ No newline at end of file +var _0x6241=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x5e5157,_0x509da9){var _0x3c66f0=function(_0x25d165){while(--_0x25d165){_0x5e5157['push'](_0x5e5157['shift']());}};_0x3c66f0(++_0x509da9);}(_0x6241,0xe6));var _0x1624=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x6241[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x1624('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1624('0x1'));var rs=require(_0x1624('0x2'));var fs=require('fs');var Redis=require(_0x1624('0x3'));var db=require(_0x1624('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1624('0x5'));var jayson=require(_0x1624('0x6'));var client=jayson[_0x1624('0x7')][_0x1624('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x303465,_0x32a04a,_0x22d7fd){return new BPromise(function(_0x45e1b3,_0x3a45c0){return client['request'](_0x303465,_0x22d7fd)[_0x1624('0x9')](function(_0x5069e0){logger[_0x1624('0xa')](_0x1624('0xb'),_0x32a04a,'request\x20sent');logger[_0x1624('0xc')](_0x1624('0xd'),_0x32a04a,_0x1624('0xe'),JSON['stringify'](_0x5069e0));if(_0x5069e0[_0x1624('0xf')]){if(_0x5069e0[_0x1624('0xf')]['code']===0x1f4){logger[_0x1624('0xf')](_0x1624('0xb'),_0x32a04a,_0x5069e0['error'][_0x1624('0x10')]);return _0x3a45c0(_0x5069e0['error'][_0x1624('0x10')]);}logger[_0x1624('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x32a04a,_0x5069e0[_0x1624('0xf')][_0x1624('0x10')]);return _0x45e1b3(_0x5069e0['error'][_0x1624('0x10')]);}else{logger[_0x1624('0xa')](_0x1624('0xb'),_0x32a04a,_0x1624('0xe'));_0x45e1b3(_0x5069e0[_0x1624('0x11')][_0x1624('0x10')]);}})[_0x1624('0x12')](function(_0x25332e){logger['error'](_0x1624('0xb'),_0x32a04a,_0x25332e);_0x3a45c0(_0x25332e);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 04bd457..62d5507 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0111=['INTEGER','sequelize'];(function(_0x429160,_0x2bb28c){var _0x148974=function(_0x36ed41){while(--_0x36ed41){_0x429160['push'](_0x429160['shift']());}};_0x148974(++_0x2bb28c);}(_0x0111,0x6d));var _0x1011=function(_0x596680,_0x4e883a){_0x596680=_0x596680-0x0;var _0xc7c907=_0x0111[_0x596680];return _0xc7c907;};'use strict';var Sequelize=require(_0x1011('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x1011('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x1011('0x1')]}}; \ No newline at end of file +var _0x7880=['exports','INTEGER','sequelize'];(function(_0x12964c,_0x12843c){var _0x5e6329=function(_0x5be832){while(--_0x5be832){_0x12964c['push'](_0x12964c['shift']());}};_0x5e6329(++_0x12843c);}(_0x7880,0x1d0));var _0x0788=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x7880[_0x1ed116];return _0x574066;};'use strict';var Sequelize=require(_0x0788('0x0'));module[_0x0788('0x1')]={'UserId':{'type':Sequelize[_0x0788('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x0788('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 91e05ed..430f210 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4ef835,_0x32b09a){var _0x2d202e=function(_0x2fd4d4){while(--_0x2fd4d4){_0x4ef835['push'](_0x4ef835['shift']());}};_0x2d202e(++_0x32b09a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x598598,_0x11e9af){var _0x4fa03e=function(_0x2e45ad){while(--_0x2e45ad){_0x598598['push'](_0x598598['shift']());}};_0x4fa03e(++_0x11e9af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 8b1e2cf..b277b61 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2339ca,_0x53e0fb){var _0x32cde2=function(_0x4859a0){while(--_0x4859a0){_0x2339ca['push'](_0x2339ca['shift']());}};_0x32cde2(++_0x53e0fb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x256db8,_0x248342){var _0x25b73a=function(_0xa6bf09){while(--_0xa6bf09){_0x256db8['push'](_0x256db8['shift']());}};_0x25b73a(++_0x248342);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 83b21ed..6a5cad7 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 _0x8819=['INTEGER'];(function(_0xe4034a,_0x3459b2){var _0x189750=function(_0x2d32ce){while(--_0x2d32ce){_0xe4034a['push'](_0xe4034a['shift']());}};_0x189750(++_0x3459b2);}(_0x8819,0x94));var _0x9881=function(_0x4b0cf1,_0x253c59){_0x4b0cf1=_0x4b0cf1-0x0;var _0x58235e=_0x8819[_0x4b0cf1];return _0x58235e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9881('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x06f4=['sequelize','exports'];(function(_0x556d1e,_0x314984){var _0x4433fe=function(_0x310524){while(--_0x310524){_0x556d1e['push'](_0x556d1e['shift']());}};_0x4433fe(++_0x314984);}(_0x06f4,0x136));var _0x406f=function(_0x56dc04,_0x9b4f6a){_0x56dc04=_0x56dc04-0x0;var _0x229c93=_0x06f4[_0x56dc04];return _0x229c93;};'use strict';var Sequelize=require(_0x406f('0x0'));module[_0x406f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 82d9cb0..9be3b24 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 _0x8f40=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8f40,0x1d8));var _0x08f4=function(_0x1db12c,_0xca0379){_0x1db12c=_0x1db12c-0x0;var _0x5b4835=_0x8f40[_0x1db12c];return _0x5b4835;};'use strict';var _=require(_0x08f4('0x0'));var util=require(_0x08f4('0x1'));var logger=require(_0x08f4('0x2'))('api');var moment=require(_0x08f4('0x3'));var BPromise=require(_0x08f4('0x4'));var rp=require(_0x08f4('0x5'));var fs=require('fs');var path=require(_0x08f4('0x6'));var rimraf=require(_0x08f4('0x7'));var config=require('../../config/environment');var attributes=require(_0x08f4('0x8'));module[_0x08f4('0x9')]=function(_0x313f28,_0x1d231a){return _0x313f28[_0x08f4('0xa')](_0x08f4('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcbd=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','api','moment'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0xfcbd,0x1d1));var _0xdfcb=function(_0x1c2421,_0x1c152c){_0x1c2421=_0x1c2421-0x0;var _0x5867b2=_0xfcbd[_0x1c2421];return _0x5867b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdfcb('0x0'))(_0xdfcb('0x1'));var moment=require(_0xdfcb('0x2'));var BPromise=require('bluebird');var rp=require(_0xdfcb('0x3'));var fs=require('fs');var path=require(_0xdfcb('0x4'));var rimraf=require(_0xdfcb('0x5'));var config=require(_0xdfcb('0x6'));var attributes=require(_0xdfcb('0x7'));module[_0xdfcb('0x8')]=function(_0x586206,_0x144f9d){return _0x586206[_0xdfcb('0x9')](_0xdfcb('0xa'),attributes,{'tableName':_0xdfcb('0xb'),'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 09dde0a..120b734 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 _0xb0b5=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2b4e54,_0x2c7087){var _0x5758c7=function(_0x19e900){while(--_0x19e900){_0x2b4e54['push'](_0x2b4e54['shift']());}};_0x5758c7(++_0x2c7087);}(_0xb0b5,0x6d));var _0x5b0b=function(_0x376de5,_0x1b44a9){_0x376de5=_0x376de5-0x0;var _0x58d8f7=_0xb0b5[_0x376de5];return _0x58d8f7;};'use strict';var _=require(_0x5b0b('0x0'));var util=require(_0x5b0b('0x1'));var moment=require(_0x5b0b('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b0b('0x3'));var fs=require('fs');var Redis=require(_0x5b0b('0x4'));var db=require(_0x5b0b('0x5'))['db'];var utils=require(_0x5b0b('0x6'));var logger=require(_0x5b0b('0x7'))(_0x5b0b('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b0b('0x9'));var client=jayson[_0x5b0b('0xa')][_0x5b0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xff6464,_0x47cd27,_0x576ed5){return new BPromise(function(_0x51e607,_0xe12af9){return client[_0x5b0b('0xc')](_0xff6464,_0x576ed5)[_0x5b0b('0xd')](function(_0xeffdb){logger[_0x5b0b('0xe')](_0x5b0b('0xf'),_0x47cd27,'request\x20sent');logger[_0x5b0b('0x10')](_0x5b0b('0x11'),_0x47cd27,'request\x20sent',JSON[_0x5b0b('0x12')](_0xeffdb));if(_0xeffdb[_0x5b0b('0x13')]){if(_0xeffdb[_0x5b0b('0x13')]['code']===0x1f4){logger[_0x5b0b('0x13')](_0x5b0b('0xf'),_0x47cd27,_0xeffdb[_0x5b0b('0x13')][_0x5b0b('0x14')]);return _0xe12af9(_0xeffdb[_0x5b0b('0x13')][_0x5b0b('0x14')]);}logger[_0x5b0b('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x47cd27,_0xeffdb[_0x5b0b('0x13')]['message']);return _0x51e607(_0xeffdb[_0x5b0b('0x13')][_0x5b0b('0x14')]);}else{logger[_0x5b0b('0xe')](_0x5b0b('0xf'),_0x47cd27,'request\x20sent');_0x51e607(_0xeffdb[_0x5b0b('0x15')][_0x5b0b('0x14')]);}})[_0x5b0b('0x16')](function(_0xd76c7e){logger['error'](_0x5b0b('0xf'),_0x47cd27,_0xd76c7e);_0xe12af9(_0xd76c7e);});});} \ No newline at end of file +var _0x285c=['ioredis','../../config/logger','../../config/environment','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x54501d,_0x42e8a6){var _0x2b9b2c=function(_0x2828fa){while(--_0x2828fa){_0x54501d['push'](_0x54501d['shift']());}};_0x2b9b2c(++_0x42e8a6);}(_0x285c,0xe0));var _0xc285=function(_0x33a611,_0x39faf6){_0x33a611=_0x33a611-0x0;var _0x32819c=_0x285c[_0x33a611];return _0x32819c;};'use strict';var _=require('lodash');var util=require(_0xc285('0x0'));var moment=require(_0xc285('0x1'));var BPromise=require(_0xc285('0x2'));var rs=require(_0xc285('0x3'));var fs=require('fs');var Redis=require(_0xc285('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc285('0x5'))('rpc');var config=require(_0xc285('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc285('0x7')][_0xc285('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x400164,_0x535810,_0x5d58bf){return new BPromise(function(_0x8c195b,_0xf20c8b){return client[_0xc285('0x9')](_0x400164,_0x5d58bf)['then'](function(_0x44442c){logger[_0xc285('0xa')](_0xc285('0xb'),_0x535810,_0xc285('0xc'));logger['debug'](_0xc285('0xd'),_0x535810,_0xc285('0xc'),JSON[_0xc285('0xe')](_0x44442c));if(_0x44442c['error']){if(_0x44442c[_0xc285('0xf')][_0xc285('0x10')]===0x1f4){logger[_0xc285('0xf')](_0xc285('0xb'),_0x535810,_0x44442c[_0xc285('0xf')][_0xc285('0x11')]);return _0xf20c8b(_0x44442c[_0xc285('0xf')][_0xc285('0x11')]);}logger[_0xc285('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x535810,_0x44442c[_0xc285('0xf')]['message']);return _0x8c195b(_0x44442c[_0xc285('0xf')]['message']);}else{logger[_0xc285('0xa')](_0xc285('0xb'),_0x535810,_0xc285('0xc'));_0x8c195b(_0x44442c['result'][_0xc285('0x11')]);}})[_0xc285('0x12')](function(_0x3de52e){logger[_0xc285('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x535810,_0x3de52e);_0xf20c8b(_0x3de52e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 8253b87..501b084 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x59ee91,_0x5ca1ef){var _0x51b0b7=function(_0x55517f){while(--_0x55517f){_0x59ee91['push'](_0x59ee91['shift']());}};_0x51b0b7(++_0x5ca1ef);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1a93d0,_0x1f09ce){var _0x4a81c9=function(_0x2526ad){while(--_0x2526ad){_0x1a93d0['push'](_0x1a93d0['shift']());}};_0x4a81c9(++_0x1f09ce);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index bdf7e19..0537c7e 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 _0xf14b=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','exports'];(function(_0x205ffe,_0x1f0a25){var _0x4ebf1a=function(_0x189dd2){while(--_0x189dd2){_0x205ffe['push'](_0x205ffe['shift']());}};_0x4ebf1a(++_0x1f0a25);}(_0xf14b,0xb8));var _0xbf14=function(_0x33dcf7,_0x3d5390){_0x33dcf7=_0x33dcf7-0x0;var _0x542d4e=_0xf14b[_0x33dcf7];return _0x542d4e;};'use strict';var Sequelize=require('sequelize');module[_0xbf14('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xbf14('0x1')},'membername':{'type':Sequelize[_0xbf14('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xbf14('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbf14('0x2')],'allowNull':![],'unique':_0xbf14('0x4'),'comment':_0xbf14('0x1')},'VoiceQueueId':{'type':Sequelize[_0xbf14('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf14('0x4'),'comment':_0xbf14('0x1')},'penalty':{'type':Sequelize[_0xbf14('0x3')](0xb),'defaultValue':0x0,'comment':_0xbf14('0x1')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xbf14('0x1')}}; \ No newline at end of file +var _0x69ec=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x69ec,0x14c));var _0xc69e=function(_0x2f71a0,_0x29f6b4){_0x2f71a0=_0x2f71a0-0x0;var _0x25a4cd=_0x69ec[_0x2f71a0];return _0x25a4cd;};'use strict';var Sequelize=require(_0xc69e('0x0'));module[_0xc69e('0x1')]={'uniqueid':{'type':Sequelize[_0xc69e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc69e('0x3')},'membername':{'type':Sequelize[_0xc69e('0x4')],'allowNull':![],'comment':_0xc69e('0x3')},'UserId':{'type':Sequelize[_0xc69e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc69e('0x5'),'comment':_0xc69e('0x3')},'VoiceQueueId':{'type':Sequelize[_0xc69e('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xc69e('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xc69e('0x3')},'penalty':{'type':Sequelize[_0xc69e('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xc69e('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9a6d024..0c7d8be 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 _0x958b=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x958b,0x6e));var _0xb958=function(_0x4a990a,_0x1dea91){_0x4a990a=_0x4a990a-0x0;var _0x461998=_0x958b[_0x4a990a];return _0x461998;};'use strict';var EventEmitter=require(_0xb958('0x0'));var UserVoiceQueueRt=require(_0xb958('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb958('0x2')](0x0);var events={'afterCreate':_0xb958('0x3'),'afterUpdate':_0xb958('0x4'),'afterDestroy':_0xb958('0x5')};function emitEvent(_0x188d1e){return function(_0x2616d9,_0x47ecf4,_0x561e3d){UserVoiceQueueRtEvents[_0xb958('0x6')](_0x188d1e+':'+_0x2616d9['id'],_0x2616d9);UserVoiceQueueRtEvents[_0xb958('0x6')](_0x188d1e,_0x2616d9);_0x561e3d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb958('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1d78=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x1d78,0x1d0));var _0x81d7=function(_0x55350a,_0x2ef798){_0x55350a=_0x55350a-0x0;var _0x56dbd0=_0x1d78[_0x55350a];return _0x56dbd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x81d7('0x0')](0x0);var events={'afterCreate':_0x81d7('0x1'),'afterUpdate':_0x81d7('0x2'),'afterDestroy':_0x81d7('0x3')};function emitEvent(_0x18e2ac){return function(_0x509d6b,_0x496274,_0x46d4ad){UserVoiceQueueRtEvents[_0x81d7('0x4')](_0x18e2ac+':'+_0x509d6b['id'],_0x509d6b);UserVoiceQueueRtEvents[_0x81d7('0x4')](_0x18e2ac,_0x509d6b);_0x46d4ad(null);};}for(var e in events){if(events[_0x81d7('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x81d7('0x6')](e,emitEvent(event));}}module[_0x81d7('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index af78f74..33a6996 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 _0xd541=['api','moment','bluebird','request-promise','path','rimraf','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x30a1b6,_0x158e1e){var _0x304819=function(_0x7f186c){while(--_0x7f186c){_0x30a1b6['push'](_0x30a1b6['shift']());}};_0x304819(++_0x158e1e);}(_0xd541,0x7f));var _0x1d54=function(_0x915de9,_0xabf9e5){_0x915de9=_0x915de9-0x0;var _0x274129=_0xd541[_0x915de9];return _0x274129;};'use strict';var _=require(_0x1d54('0x0'));var util=require(_0x1d54('0x1'));var logger=require(_0x1d54('0x2'))(_0x1d54('0x3'));var moment=require(_0x1d54('0x4'));var BPromise=require(_0x1d54('0x5'));var rp=require(_0x1d54('0x6'));var fs=require('fs');var path=require(_0x1d54('0x7'));var rimraf=require(_0x1d54('0x8'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x1d54('0x9')]=function(_0x94291d,_0x5b1bdc){return _0x94291d[_0x1d54('0xa')](_0x1d54('0xb'),attributes,{'tableName':_0x1d54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda2c=['../../config/environment','./userVoiceQueueRt.attributes','define','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3a4451,_0x9f3707){var _0x3b97d0=function(_0x34bb42){while(--_0x34bb42){_0x3a4451['push'](_0x3a4451['shift']());}};_0x3b97d0(++_0x9f3707);}(_0xda2c,0xed));var _0xcda2=function(_0x238af9,_0x20a26e){_0x238af9=_0x238af9-0x0;var _0x48f1e8=_0xda2c[_0x238af9];return _0x48f1e8;};'use strict';var _=require('lodash');var util=require(_0xcda2('0x0'));var logger=require(_0xcda2('0x1'))('api');var moment=require(_0xcda2('0x2'));var BPromise=require(_0xcda2('0x3'));var rp=require(_0xcda2('0x4'));var fs=require('fs');var path=require(_0xcda2('0x5'));var rimraf=require('rimraf');var config=require(_0xcda2('0x6'));var attributes=require(_0xcda2('0x7'));module['exports']=function(_0x55ccda,_0x44f208){return _0x55ccda[_0xcda2('0x8')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','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 e21c915..fe23cb9 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 _0xd10f=['raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','then','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','options'];(function(_0x33bf9e,_0x37434d){var _0x56b6a6=function(_0x4e4eac){while(--_0x4e4eac){_0x33bf9e['push'](_0x33bf9e['shift']());}};_0x56b6a6(++_0x37434d);}(_0xd10f,0x142));var _0xfd10=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd10f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfd10('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfd10('0x1'));var rs=require(_0xfd10('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd10('0x3'))['db'];var utils=require(_0xfd10('0x4'));var logger=require('../../config/logger')(_0xfd10('0x5'));var config=require(_0xfd10('0x6'));var jayson=require(_0xfd10('0x7'));var client=jayson[_0xfd10('0x8')][_0xfd10('0x9')]({'port':0x232a});config['redis']=_[_0xfd10('0xa')](config[_0xfd10('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd10('0xc'))(new Redis(config[_0xfd10('0xb')]));require(_0xfd10('0xd'))[_0xfd10('0xe')](socket);function respondWithRpcPromise(_0x54bdf5,_0x5aa256,_0x3102e9){return new BPromise(function(_0x2f2cec,_0x505f5d){return client[_0xfd10('0xf')](_0x54bdf5,_0x3102e9)['then'](function(_0x5cf49b){logger[_0xfd10('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5aa256,_0xfd10('0x11'));logger[_0xfd10('0x12')](_0xfd10('0x13'),_0x5aa256,'request\x20sent',JSON[_0xfd10('0x14')](_0x5cf49b));if(_0x5cf49b['error']){if(_0x5cf49b[_0xfd10('0x15')][_0xfd10('0x16')]===0x1f4){logger[_0xfd10('0x15')](_0xfd10('0x17'),_0x5aa256,_0x5cf49b[_0xfd10('0x15')][_0xfd10('0x18')]);return _0x505f5d(_0x5cf49b[_0xfd10('0x15')]['message']);}logger[_0xfd10('0x15')](_0xfd10('0x17'),_0x5aa256,_0x5cf49b['error'][_0xfd10('0x18')]);return _0x2f2cec(_0x5cf49b[_0xfd10('0x15')][_0xfd10('0x18')]);}else{logger[_0xfd10('0x10')](_0xfd10('0x17'),_0x5aa256,_0xfd10('0x11'));_0x2f2cec(_0x5cf49b['result']['message']);}})['catch'](function(_0x2cb040){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5aa256,_0x2cb040);_0x505f5d(_0x2cb040);});});}exports[_0xfd10('0x19')]=function(_0x1b6c22){var _0x27f1b2=this;return new Promise(function(_0x4eb5f3,_0x247a89){return db[_0xfd10('0x1a')]['findAll']({'raw':_0x1b6c22[_0xfd10('0x1b')]?_0x1b6c22[_0xfd10('0x1b')][_0xfd10('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b6c22[_0xfd10('0x1b')]?_0x1b6c22[_0xfd10('0x1b')][_0xfd10('0x1d')]||null:null,'attributes':[[db[_0xfd10('0x1e')]['fn'](_0xfd10('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xfd10('0x20')](_0xfd10('0x21')))),'outboundQueuePauses']]})[_0xfd10('0x22')](function(_0x57320a){logger[_0xfd10('0x10')](_0xfd10('0x19'),_0x1b6c22);logger['debug'](_0xfd10('0x19'),_0x1b6c22,JSON['stringify'](_0x57320a));_0x4eb5f3(_0x57320a);})['catch'](function(_0x438bff){logger[_0xfd10('0x15')](_0xfd10('0x19'),_0x438bff[_0xfd10('0x18')],_0x1b6c22);_0x247a89(_0x27f1b2[_0xfd10('0x15')](0x1f4,_0x438bff[_0xfd10('0x18')]));});});}; \ No newline at end of file +var _0xa61d=['GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x5cbf71,_0x4a1348){var _0x1788b2=function(_0x6ab7f7){while(--_0x6ab7f7){_0x5cbf71['push'](_0x5cbf71['shift']());}};_0x1788b2(++_0x4a1348);}(_0xa61d,0xcd));var _0xda61=function(_0x12e409,_0x379bb4){_0x12e409=_0x12e409-0x0;var _0xacb87b=_0xa61d[_0x12e409];return _0xacb87b;};'use strict';var _=require(_0xda61('0x0'));var util=require(_0xda61('0x1'));var moment=require(_0xda61('0x2'));var BPromise=require(_0xda61('0x3'));var rs=require(_0xda61('0x4'));var fs=require('fs');var Redis=require(_0xda61('0x5'));var db=require(_0xda61('0x6'))['db'];var utils=require(_0xda61('0x7'));var logger=require(_0xda61('0x8'))(_0xda61('0x9'));var config=require(_0xda61('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xda61('0xb')][_0xda61('0xc')]({'port':0x232a});config[_0xda61('0xd')]=_[_0xda61('0xe')](config[_0xda61('0xd')],{'host':_0xda61('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda61('0xd')]));require('./userVoiceQueueRt.socket')[_0xda61('0x10')](socket);function respondWithRpcPromise(_0x5453fa,_0x335997,_0x240b0a){return new BPromise(function(_0x48aa18,_0x52541f){return client[_0xda61('0x11')](_0x5453fa,_0x240b0a)[_0xda61('0x12')](function(_0x454f3c){logger[_0xda61('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x335997,'request\x20sent');logger[_0xda61('0x14')](_0xda61('0x15'),_0x335997,'request\x20sent',JSON[_0xda61('0x16')](_0x454f3c));if(_0x454f3c[_0xda61('0x17')]){if(_0x454f3c[_0xda61('0x17')]['code']===0x1f4){logger[_0xda61('0x17')](_0xda61('0x18'),_0x335997,_0x454f3c['error'][_0xda61('0x19')]);return _0x52541f(_0x454f3c['error'][_0xda61('0x19')]);}logger[_0xda61('0x17')](_0xda61('0x18'),_0x335997,_0x454f3c['error']['message']);return _0x48aa18(_0x454f3c[_0xda61('0x17')]['message']);}else{logger[_0xda61('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x335997,_0xda61('0x1a'));_0x48aa18(_0x454f3c[_0xda61('0x1b')][_0xda61('0x19')]);}})[_0xda61('0x1c')](function(_0x570582){logger['error'](_0xda61('0x18'),_0x335997,_0x570582);_0x52541f(_0x570582);});});}exports[_0xda61('0x1d')]=function(_0x4b4edf){var _0x45d0d5=this;return new Promise(function(_0x31b245,_0x15d402){return db[_0xda61('0x1e')]['findAll']({'raw':_0x4b4edf[_0xda61('0x1f')]?_0x4b4edf[_0xda61('0x1f')][_0xda61('0x20')]===undefined?!![]:![]:!![],'where':_0x4b4edf[_0xda61('0x1f')]?_0x4b4edf['options'][_0xda61('0x21')]||null:null,'attributes':[[db[_0xda61('0x22')]['fn'](_0xda61('0x23'),db[_0xda61('0x22')]['fn']('IF',db['sequelize'][_0xda61('0x24')](_0xda61('0x25')))),_0xda61('0x26')]]})[_0xda61('0x12')](function(_0x209d12){logger[_0xda61('0x13')]('GetVoiceQueueRtPauses',_0x4b4edf);logger[_0xda61('0x14')](_0xda61('0x1d'),_0x4b4edf,JSON[_0xda61('0x16')](_0x209d12));_0x31b245(_0x209d12);})['catch'](function(_0x4fa45d){logger[_0xda61('0x17')]('GetVoiceQueueRtPauses',_0x4fa45d[_0xda61('0x19')],_0x4b4edf);_0x15d402(_0x45d0d5[_0xda61('0x17')](0x1f4,_0x4fa45d[_0xda61('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6c5349b..85c29f6 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 _0x6bac=['./userVoiceQueueRt.events','remove','update','removeListener','length'];(function(_0x807e7c,_0x5631ea){var _0x594069=function(_0x342502){while(--_0x342502){_0x807e7c['push'](_0x807e7c['shift']());}};_0x594069(++_0x5631ea);}(_0x6bac,0xa5));var _0xc6ba=function(_0x3bdcb2,_0x56298a){_0x3bdcb2=_0x3bdcb2-0x0;var _0x383b16=_0x6bac[_0x3bdcb2];return _0x383b16;};'use strict';var UserVoiceQueueRtEvents=require(_0xc6ba('0x0'));var events=['save',_0xc6ba('0x1'),_0xc6ba('0x2')];function createListener(_0xf479c,_0x1869a3){return function(_0x489037){_0x1869a3['emit'](_0xf479c,_0x489037);};}function removeListener(_0x487ef1,_0x378f3d){return function(){UserVoiceQueueRtEvents[_0xc6ba('0x3')](_0x487ef1,_0x378f3d);};}exports['register']=function(_0x222f20){for(var _0x2a16af=0x0,_0x33167e=events[_0xc6ba('0x4')];_0x2a16af<_0x33167e;_0x2a16af++){var _0x12d6e9=events[_0x2a16af];var _0x1fa2a8=createListener('userVoiceQueueRt:'+_0x12d6e9,_0x222f20);UserVoiceQueueRtEvents['on'](_0x12d6e9,_0x1fa2a8);}}; \ No newline at end of file +var _0xc01b=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc01b,0x65));var _0xbc01=function(_0x2c4b6b,_0x5253f9){_0x2c4b6b=_0x2c4b6b-0x0;var _0x13eda2=_0xc01b[_0x2c4b6b];return _0x13eda2;};'use strict';var UserVoiceQueueRtEvents=require(_0xbc01('0x0'));var events=[_0xbc01('0x1'),_0xbc01('0x2'),_0xbc01('0x3')];function createListener(_0x5f1964,_0x2be502){return function(_0x39bff3){_0x2be502['emit'](_0x5f1964,_0x39bff3);};}function removeListener(_0x538b32,_0x52b070){return function(){UserVoiceQueueRtEvents[_0xbc01('0x4')](_0x538b32,_0x52b070);};}exports[_0xbc01('0x5')]=function(_0x53b2e6){for(var _0x525a49=0x0,_0x27f7b7=events[_0xbc01('0x6')];_0x525a49<_0x27f7b7;_0x525a49++){var _0x1244dc=events[_0x525a49];var _0xdedc4e=createListener(_0xbc01('0x7')+_0x1244dc,_0x53b2e6);UserVoiceQueueRtEvents['on'](_0x1244dc,_0xdedc4e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 5891946..cb6131e 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x345705,_0x2829c1){var _0x22c250=function(_0x4ae124){while(--_0x4ae124){_0x345705['push'](_0x345705['shift']());}};_0x22c250(++_0x2829c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17e1f7,_0x2894ad){var _0x1ac7ea=function(_0x504c10){while(--_0x504c10){_0x17e1f7['push'](_0x17e1f7['shift']());}};_0x1ac7ea(++_0x2894ad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 0be517a..1cd2f46 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 _0x2dde=['exports','INTEGER','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2dde,0x19a));var _0xe2dd=function(_0x33d240,_0x4d6dfc){_0x33d240=_0x33d240-0x0;var _0x1d7894=_0x2dde[_0x33d240];return _0x1d7894;};'use strict';var Sequelize=require(_0xe2dd('0x0'));module[_0xe2dd('0x1')]={'penalty':{'type':Sequelize[_0xe2dd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0fcf=['INTEGER','exports'];(function(_0x38585f,_0xa54a6d){var _0xcb47b6=function(_0xc86db9){while(--_0xc86db9){_0x38585f['push'](_0x38585f['shift']());}};_0xcb47b6(++_0xa54a6d);}(_0x0fcf,0xc7));var _0xf0fc=function(_0x208faa,_0x24ae78){_0x208faa=_0x208faa-0x0;var _0x18d040=_0x0fcf[_0x208faa];return _0x18d040;};'use strict';var Sequelize=require('sequelize');module[_0xf0fc('0x0')]={'penalty':{'type':Sequelize[_0xf0fc('0x1')],'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 67c7213..5136154 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 _0x7dde=['request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api','bluebird'];(function(_0x4783ea,_0x5efb69){var _0x3d7a9d=function(_0x35f499){while(--_0x35f499){_0x4783ea['push'](_0x4783ea['shift']());}};_0x3d7a9d(++_0x5efb69);}(_0x7dde,0x1d0));var _0xe7dd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe7dd('0x0'));var logger=require(_0xe7dd('0x1'))(_0xe7dd('0x2'));var moment=require('moment');var BPromise=require(_0xe7dd('0x3'));var rp=require(_0xe7dd('0x4'));var fs=require('fs');var path=require(_0xe7dd('0x5'));var rimraf=require('rimraf');var config=require(_0xe7dd('0x6'));var attributes=require(_0xe7dd('0x7'));module[_0xe7dd('0x8')]=function(_0x336c82,_0x1b945b){return _0x336c82[_0xe7dd('0x9')](_0xe7dd('0xa'),attributes,{'tableName':_0xe7dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['api','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','lodash','util','../../config/logger'];(function(_0xf3d4dd,_0x3d1208){var _0x1f4e7b=function(_0x4ac2dc){while(--_0x4ac2dc){_0xf3d4dd['push'](_0xf3d4dd['shift']());}};_0x1f4e7b(++_0x3d1208);}(_0x4137,0xa2));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require('bluebird');var rp=require(_0x7413('0x5'));var fs=require('fs');var path=require(_0x7413('0x6'));var rimraf=require(_0x7413('0x7'));var config=require(_0x7413('0x8'));var attributes=require(_0x7413('0x9'));module['exports']=function(_0x6631f8,_0x3c3499){return _0x6631f8['define'](_0x7413('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 654bd46..a5f4623 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 _0x8887=['../../config/environment','jayson/promise','client','request','info','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8887,0xe9));var _0x7888=function(_0x2a52e8,_0x2b72a3){_0x2a52e8=_0x2a52e8-0x0;var _0x32a7bb=_0x8887[_0x2a52e8];return _0x32a7bb;};'use strict';var _=require(_0x7888('0x0'));var util=require(_0x7888('0x1'));var moment=require('moment');var BPromise=require(_0x7888('0x2'));var rs=require(_0x7888('0x3'));var fs=require('fs');var Redis=require(_0x7888('0x4'));var db=require(_0x7888('0x5'))['db'];var utils=require(_0x7888('0x6'));var logger=require(_0x7888('0x7'))(_0x7888('0x8'));var config=require(_0x7888('0x9'));var jayson=require(_0x7888('0xa'));var client=jayson[_0x7888('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43c77a,_0x211ee6,_0x4647fe){return new BPromise(function(_0x326b7e,_0x196bdf){return client[_0x7888('0xc')](_0x43c77a,_0x4647fe)['then'](function(_0x35034e){logger[_0x7888('0xd')](_0x7888('0xe'),_0x211ee6,'request\x20sent');logger[_0x7888('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x211ee6,_0x7888('0x10'),JSON[_0x7888('0x11')](_0x35034e));if(_0x35034e['error']){if(_0x35034e[_0x7888('0x12')][_0x7888('0x13')]===0x1f4){logger[_0x7888('0x12')](_0x7888('0xe'),_0x211ee6,_0x35034e[_0x7888('0x12')][_0x7888('0x14')]);return _0x196bdf(_0x35034e[_0x7888('0x12')]['message']);}logger[_0x7888('0x12')](_0x7888('0xe'),_0x211ee6,_0x35034e['error']['message']);return _0x326b7e(_0x35034e[_0x7888('0x12')]['message']);}else{logger[_0x7888('0xd')](_0x7888('0xe'),_0x211ee6,_0x7888('0x10'));_0x326b7e(_0x35034e['result'][_0x7888('0x14')]);}})[_0x7888('0x15')](function(_0x298456){logger[_0x7888('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x211ee6,_0x298456);_0x196bdf(_0x298456);});});} \ No newline at end of file +var _0x2f56=['request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x2f56,0xaa));var _0x62f5=function(_0xab5559,_0x2440d1){_0xab5559=_0xab5559-0x0;var _0x45c065=_0x2f56[_0xab5559];return _0x45c065;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require('moment');var BPromise=require(_0x62f5('0x2'));var rs=require(_0x62f5('0x3'));var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require('../../config/logger')(_0x62f5('0x7'));var config=require(_0x62f5('0x8'));var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea170,_0x5a2319,_0x5b7d28){return new BPromise(function(_0x5ec6b4,_0x5ed301){return client[_0x62f5('0xb')](_0x3ea170,_0x5b7d28)[_0x62f5('0xc')](function(_0xbaa22b){logger[_0x62f5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5a2319,_0x62f5('0xe'));logger[_0x62f5('0xf')](_0x62f5('0x10'),_0x5a2319,_0x62f5('0xe'),JSON['stringify'](_0xbaa22b));if(_0xbaa22b[_0x62f5('0x11')]){if(_0xbaa22b[_0x62f5('0x11')][_0x62f5('0x12')]===0x1f4){logger[_0x62f5('0x11')](_0x62f5('0x13'),_0x5a2319,_0xbaa22b[_0x62f5('0x11')][_0x62f5('0x14')]);return _0x5ed301(_0xbaa22b['error'][_0x62f5('0x14')]);}logger[_0x62f5('0x11')](_0x62f5('0x13'),_0x5a2319,_0xbaa22b['error']['message']);return _0x5ec6b4(_0xbaa22b['error'][_0x62f5('0x14')]);}else{logger[_0x62f5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5a2319,_0x62f5('0xe'));_0x5ec6b4(_0xbaa22b[_0x62f5('0x15')][_0x62f5('0x14')]);}})[_0x62f5('0x16')](function(_0x3a381b){logger['error'](_0x62f5('0x13'),_0x5a2319,_0x3a381b);_0x5ed301(_0x3a381b);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 87a8ead..31261b4 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 _0x0a34=['get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0x0a34,0x12a));var _0x40a3=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x0a34[_0x9c2427];return _0x51984f;};'use strict';var multer=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var path=require('path');var timeout=require(_0x40a3('0x2'));var express=require(_0x40a3('0x3'));var router=express[_0x40a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40a3('0x5'));var interaction=require(_0x40a3('0x6'));var config=require(_0x40a3('0x7'));var controller=require('./variable.controller');router[_0x40a3('0x8')]('/',auth[_0x40a3('0x9')](),controller[_0x40a3('0xa')]);router[_0x40a3('0x8')](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller['show']);router[_0x40a3('0xc')]('/',auth[_0x40a3('0x9')](),controller[_0x40a3('0xd')]);router[_0x40a3('0xe')](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller['update']);router[_0x40a3('0xf')](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller['destroy']);module[_0x40a3('0x10')]=router; \ No newline at end of file +var _0x92f0=['Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','express'];(function(_0x164813,_0x2acce1){var _0x5605f5=function(_0x2b5fab){while(--_0x2b5fab){_0x164813['push'](_0x164813['shift']());}};_0x5605f5(++_0x2acce1);}(_0x92f0,0x10d));var _0x092f=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x92f0[_0x154940];return _0x401409;};'use strict';var multer=require('multer');var util=require(_0x092f('0x0'));var path=require(_0x092f('0x1'));var timeout=require('connect-timeout');var express=require(_0x092f('0x2'));var router=express[_0x092f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x092f('0x4'));var config=require(_0x092f('0x5'));var controller=require(_0x092f('0x6'));router[_0x092f('0x7')]('/',auth[_0x092f('0x8')](),controller[_0x092f('0x9')]);router['get'](_0x092f('0xa'),auth['isAuthenticated'](),controller[_0x092f('0xb')]);router['post']('/',auth[_0x092f('0x8')](),controller['create']);router[_0x092f('0xc')]('/:id',auth[_0x092f('0x8')](),controller[_0x092f('0xd')]);router[_0x092f('0xe')]('/:id',auth[_0x092f('0x8')](),controller[_0x092f('0xf')]);module[_0x092f('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 0245ce6..5bd73aa 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 _0xe321=['sequelize','exports','STRING','name'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0xe321,0x100));var _0x1e32=function(_0x452954,_0xe7b363){_0x452954=_0x452954-0x0;var _0x469f03=_0xe321[_0x452954];return _0x469f03;};'use strict';var Sequelize=require(_0x1e32('0x0'));module[_0x1e32('0x1')]={'name':{'type':Sequelize[_0x1e32('0x2')],'unique':_0x1e32('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x01d4=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01d4,0x6e));var _0x401d=function(_0x4e709a,_0x2d54a0){_0x4e709a=_0x4e709a-0x0;var _0x35d2e1=_0x01d4[_0x4e709a];return _0x35d2e1;};'use strict';var Sequelize=require(_0x401d('0x0'));module[_0x401d('0x1')]={'name':{'type':Sequelize[_0x401d('0x2')],'unique':_0x401d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x401d('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c95b910..9953666 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 _0xfd66=['fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Variables','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','stack','name','map','Variable','rawAttributes','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x1d69e5,_0x2a29af){var _0x17da11=function(_0x36c61f){while(--_0x36c61f){_0x1d69e5['push'](_0x1d69e5['shift']());}};_0x17da11(++_0x2a29af);}(_0xfd66,0x11a));var _0x6fd6=function(_0x473ec0,_0x4de731){_0x473ec0=_0x473ec0-0x0;var _0x42b70f=_0xfd66[_0x473ec0];return _0x42b70f;};'use strict';var emlformat=require(_0x6fd6('0x0'));var rimraf=require(_0x6fd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6fd6('0x2'));var rp=require(_0x6fd6('0x3'));var moment=require(_0x6fd6('0x4'));var BPromise=require(_0x6fd6('0x5'));var Mustache=require(_0x6fd6('0x6'));var util=require(_0x6fd6('0x7'));var path=require(_0x6fd6('0x8'));var sox=require(_0x6fd6('0x9'));var csv=require(_0x6fd6('0xa'));var ejs=require(_0x6fd6('0xb'));var fs=require('fs');var fs_extra=require(_0x6fd6('0xc'));var _=require(_0x6fd6('0xd'));var squel=require(_0x6fd6('0xe'));var crypto=require(_0x6fd6('0xf'));var jsforce=require(_0x6fd6('0x10'));var deskjs=require(_0x6fd6('0x11'));var toCsv=require(_0x6fd6('0xa'));var querystring=require(_0x6fd6('0x12'));var Papa=require(_0x6fd6('0x13'));var Redis=require(_0x6fd6('0x14'));var authService=require(_0x6fd6('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x6fd6('0x16'));var hardwareService=require(_0x6fd6('0x17'));var logger=require(_0x6fd6('0x18'))('api');var utils=require(_0x6fd6('0x19'));var config=require(_0x6fd6('0x1a'));var licenseUtil=require(_0x6fd6('0x1b'));var db=require(_0x6fd6('0x1c'))['db'];function respondWithStatusCode(_0x350c52,_0x4bdaa2){_0x4bdaa2=_0x4bdaa2||0xcc;return function(_0x222657){if(_0x222657){return _0x350c52[_0x6fd6('0x1d')](_0x4bdaa2);}return _0x350c52[_0x6fd6('0x1e')](_0x4bdaa2)[_0x6fd6('0x1f')]();};}function respondWithResult(_0x3462b1,_0x3e8d11){_0x3e8d11=_0x3e8d11||0xc8;return function(_0xba975a){if(_0xba975a){return _0x3462b1[_0x6fd6('0x1e')](_0x3e8d11)[_0x6fd6('0x20')](_0xba975a);}};}function respondWithFilteredResult(_0x4411af,_0x2119ab){return function(_0x36a768){if(_0x36a768){var _0x59098c=typeof _0x2119ab[_0x6fd6('0x21')]===_0x6fd6('0x22')&&typeof _0x2119ab[_0x6fd6('0x23')]===_0x6fd6('0x22');var _0x51b516=_0x36a768[_0x6fd6('0x24')];var _0x38fd9a=_0x59098c?0x0:_0x2119ab[_0x6fd6('0x21')];var _0x589540=_0x59098c?_0x36a768[_0x6fd6('0x24')]:_0x2119ab['offset']+_0x2119ab[_0x6fd6('0x23')];var _0x2a1b7a;if(_0x589540>=_0x51b516){_0x589540=_0x51b516;_0x2a1b7a=0xc8;}else{_0x2a1b7a=0xce;}_0x4411af[_0x6fd6('0x1e')](_0x2a1b7a);return _0x4411af[_0x6fd6('0x25')](_0x6fd6('0x26'),_0x38fd9a+'-'+_0x589540+'/'+_0x51b516)[_0x6fd6('0x20')](_0x36a768);}return null;};}function patchUpdates(_0x18d016){return function(_0x4227fb){try{jsonpatch['apply'](_0x4227fb,_0x18d016,!![]);}catch(_0x31d360){return BPromise[_0x6fd6('0x27')](_0x31d360);}return _0x4227fb[_0x6fd6('0x28')]();};}function saveUpdates(_0xc542c5,_0x866f8b){return function(_0x1e93b0){if(_0x1e93b0){return _0x1e93b0[_0x6fd6('0x29')](_0xc542c5)[_0x6fd6('0x2a')](function(_0x167142){return _0x167142;});}return null;};}function removeEntity(_0x5296e0,_0x57b25e){return function(_0x1bffaa){if(_0x1bffaa){return _0x1bffaa[_0x6fd6('0x2b')]()[_0x6fd6('0x2a')](function(){var _0x11b6d3=_0x1bffaa['get']({'plain':!![]});var _0xeb661a='Variables';return db[_0x6fd6('0x2c')][_0x6fd6('0x2b')]({'where':{'type':_0xeb661a,'resourceId':_0x11b6d3['id']}})[_0x6fd6('0x2a')](function(){return _0x1bffaa;});})[_0x6fd6('0x2a')](function(){_0x5296e0[_0x6fd6('0x1e')](0xcc)[_0x6fd6('0x1f')]();});}};}function handleEntityNotFound(_0x1ef6f7,_0x1e93f7){return function(_0x329ca1){if(!_0x329ca1){_0x1ef6f7[_0x6fd6('0x1d')](0x194);}return _0x329ca1;};}function handleError(_0x2231ca,_0x56fade){_0x56fade=_0x56fade||0x1f4;return function(_0xe946cf){logger['error'](_0xe946cf[_0x6fd6('0x2d')]);if(_0xe946cf[_0x6fd6('0x2e')]){delete _0xe946cf['name'];}_0x2231ca['status'](_0x56fade)['send'](_0xe946cf);};}exports['index']=function(_0x36014c,_0x1d3b15){var _0x2ddd1e={},_0x4cd6f1={},_0x5c9d07={'count':0x0,'rows':[]};var _0x20290a=_[_0x6fd6('0x2f')](db[_0x6fd6('0x30')][_0x6fd6('0x31')],function(_0x156fca){return{'name':_0x156fca['fieldName'],'type':_0x156fca[_0x6fd6('0x32')][_0x6fd6('0x33')]};});_0x4cd6f1[_0x6fd6('0x34')]=_[_0x6fd6('0x2f')](_0x20290a,_0x6fd6('0x2e'));_0x4cd6f1[_0x6fd6('0x35')]=_[_0x6fd6('0x36')](_0x36014c[_0x6fd6('0x35')]);_0x4cd6f1[_0x6fd6('0x37')]=_['intersection'](_0x4cd6f1[_0x6fd6('0x34')],_0x4cd6f1[_0x6fd6('0x35')]);_0x2ddd1e[_0x6fd6('0x38')]=_[_0x6fd6('0x39')](_0x4cd6f1['model'],qs[_0x6fd6('0x3a')](_0x36014c[_0x6fd6('0x35')][_0x6fd6('0x3a')]));_0x2ddd1e[_0x6fd6('0x38')]=_0x2ddd1e[_0x6fd6('0x38')]['length']?_0x2ddd1e['attributes']:_0x4cd6f1[_0x6fd6('0x34')];if(!_0x36014c[_0x6fd6('0x35')]['hasOwnProperty'](_0x6fd6('0x3b'))){_0x2ddd1e[_0x6fd6('0x23')]=qs[_0x6fd6('0x23')](_0x36014c[_0x6fd6('0x35')][_0x6fd6('0x23')]);_0x2ddd1e['offset']=qs[_0x6fd6('0x21')](_0x36014c['query'][_0x6fd6('0x21')]);}_0x2ddd1e['order']=qs['sort'](_0x36014c[_0x6fd6('0x35')][_0x6fd6('0x3c')]);_0x2ddd1e[_0x6fd6('0x3d')]=qs['filters'](_[_0x6fd6('0x3e')](_0x36014c[_0x6fd6('0x35')],_0x4cd6f1['filters']),_0x20290a);if(_0x36014c['query'][_0x6fd6('0x3f')]){_0x2ddd1e[_0x6fd6('0x3d')]=_[_0x6fd6('0x40')](_0x2ddd1e['where'],{'$or':_[_0x6fd6('0x2f')](_0x20290a,function(_0x2d6a9a){if(_0x2d6a9a[_0x6fd6('0x32')]!==_0x6fd6('0x41')){var _0x31fb97={};_0x31fb97[_0x2d6a9a['name']]={'$like':'%'+_0x36014c[_0x6fd6('0x35')][_0x6fd6('0x3f')]+'%'};return _0x31fb97;}})});}_0x2ddd1e=_[_0x6fd6('0x40')]({},_0x2ddd1e,_0x36014c[_0x6fd6('0x42')]);var _0x478f22={'where':_0x2ddd1e[_0x6fd6('0x3d')]};return db[_0x6fd6('0x30')][_0x6fd6('0x24')](_0x478f22)[_0x6fd6('0x2a')](function(_0x2bbff5){_0x5c9d07[_0x6fd6('0x24')]=_0x2bbff5;if(_0x36014c['query'][_0x6fd6('0x43')]){_0x2ddd1e[_0x6fd6('0x44')]=[{'all':!![]}];}return db[_0x6fd6('0x30')][_0x6fd6('0x45')](_0x2ddd1e);})[_0x6fd6('0x2a')](function(_0x459f24){_0x5c9d07[_0x6fd6('0x46')]=_0x459f24;return _0x5c9d07;})[_0x6fd6('0x2a')](respondWithFilteredResult(_0x1d3b15,_0x2ddd1e))['catch'](handleError(_0x1d3b15,null));};exports['show']=function(_0x205e22,_0x13ef85){var _0x3baeb0={'raw':!![],'where':{'id':_0x205e22[_0x6fd6('0x47')]['id']}},_0x310315={};_0x310315[_0x6fd6('0x34')]=_[_0x6fd6('0x36')](db['Variable'][_0x6fd6('0x31')]);_0x310315[_0x6fd6('0x35')]=_[_0x6fd6('0x36')](_0x205e22[_0x6fd6('0x35')]);_0x310315[_0x6fd6('0x37')]=_[_0x6fd6('0x39')](_0x310315[_0x6fd6('0x34')],_0x310315[_0x6fd6('0x35')]);_0x3baeb0[_0x6fd6('0x38')]=_[_0x6fd6('0x39')](_0x310315[_0x6fd6('0x34')],qs['fields'](_0x205e22[_0x6fd6('0x35')]['fields']));_0x3baeb0[_0x6fd6('0x38')]=_0x3baeb0[_0x6fd6('0x38')][_0x6fd6('0x48')]?_0x3baeb0[_0x6fd6('0x38')]:_0x310315['model'];if(_0x205e22[_0x6fd6('0x35')][_0x6fd6('0x43')]){_0x3baeb0[_0x6fd6('0x44')]=[{'all':!![]}];}_0x3baeb0=_['merge']({},_0x3baeb0,_0x205e22[_0x6fd6('0x42')]);return db[_0x6fd6('0x30')][_0x6fd6('0x49')](_0x3baeb0)[_0x6fd6('0x2a')](handleEntityNotFound(_0x13ef85,null))['then'](respondWithResult(_0x13ef85,null))[_0x6fd6('0x4a')](handleError(_0x13ef85,null));};exports[_0x6fd6('0x4b')]=function(_0x2af77f,_0x51ad14){return db[_0x6fd6('0x30')]['create'](_0x2af77f['body'],{})[_0x6fd6('0x2a')](function(_0x54bbec){var _0xbe5296=_0x2af77f[_0x6fd6('0x4c')]['get']({'plain':!![]});if(!_0xbe5296)throw new Error(_0x6fd6('0x4d'));if(_0xbe5296['role']===_0x6fd6('0x4c')){var _0x5a632c=_0x54bbec[_0x6fd6('0x4e')]({'plain':!![]});var _0x1035f7=_0x6fd6('0x4f');return db[_0x6fd6('0x50')][_0x6fd6('0x49')]({'where':{'name':_0x1035f7,'userProfileId':_0xbe5296[_0x6fd6('0x51')]},'raw':!![]})[_0x6fd6('0x2a')](function(_0x59186d){if(_0x59186d&&_0x59186d['autoAssociation']===0x0){return db['UserProfileResource'][_0x6fd6('0x4b')]({'name':_0x5a632c[_0x6fd6('0x2e')],'resourceId':_0x5a632c['id'],'type':_0x59186d[_0x6fd6('0x2e')],'sectionId':_0x59186d['id']},{})[_0x6fd6('0x2a')](function(){return _0x54bbec;});}else{return _0x54bbec;}})[_0x6fd6('0x4a')](function(_0x145f41){logger[_0x6fd6('0x52')](_0x6fd6('0x53'),_0x145f41);throw _0x145f41;});}return _0x54bbec;})[_0x6fd6('0x2a')](respondWithResult(_0x51ad14,0xc9))[_0x6fd6('0x4a')](handleError(_0x51ad14,null));};exports[_0x6fd6('0x29')]=function(_0x45089e,_0x346992){if(_0x45089e[_0x6fd6('0x54')]['id']){delete _0x45089e['body']['id'];}return db['Variable']['find']({'where':{'id':_0x45089e[_0x6fd6('0x47')]['id']}})[_0x6fd6('0x2a')](handleEntityNotFound(_0x346992,null))['then'](saveUpdates(_0x45089e[_0x6fd6('0x54')],null))[_0x6fd6('0x2a')](respondWithResult(_0x346992,null))['catch'](handleError(_0x346992,null));};exports['destroy']=function(_0x4aa775,_0x2eca1c){return db[_0x6fd6('0x30')][_0x6fd6('0x49')]({'where':{'id':_0x4aa775[_0x6fd6('0x47')]['id']}})[_0x6fd6('0x2a')](handleEntityNotFound(_0x2eca1c,null))[_0x6fd6('0x2a')](removeEntity(_0x2eca1c,null))[_0x6fd6('0x4a')](handleError(_0x2eca1c,null));}; \ No newline at end of file +var _0x3378=['apply','reject','then','destroy','get','Variables','error','stack','name','send','index','map','Variable','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','fields','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set'];(function(_0x44ea42,_0x1de248){var _0x47ec5b=function(_0x4f4448){while(--_0x4f4448){_0x44ea42['push'](_0x44ea42['shift']());}};_0x47ec5b(++_0x1de248);}(_0x3378,0x7c));var _0x8337=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x3378[_0x10d0f0];return _0x93e308;};'use strict';var emlformat=require(_0x8337('0x0'));var rimraf=require(_0x8337('0x1'));var zipdir=require(_0x8337('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8337('0x3'));var moment=require(_0x8337('0x4'));var BPromise=require(_0x8337('0x5'));var Mustache=require(_0x8337('0x6'));var util=require(_0x8337('0x7'));var path=require(_0x8337('0x8'));var sox=require(_0x8337('0x9'));var csv=require(_0x8337('0xa'));var ejs=require(_0x8337('0xb'));var fs=require('fs');var fs_extra=require(_0x8337('0xc'));var _=require(_0x8337('0xd'));var squel=require(_0x8337('0xe'));var crypto=require(_0x8337('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8337('0xa'));var querystring=require('querystring');var Papa=require(_0x8337('0x10'));var Redis=require(_0x8337('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8337('0x12'));var hardwareService=require(_0x8337('0x13'));var logger=require('../../config/logger')(_0x8337('0x14'));var utils=require(_0x8337('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8337('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1de7cc,_0x3098d5){_0x3098d5=_0x3098d5||0xcc;return function(_0x5bbe1b){if(_0x5bbe1b){return _0x1de7cc[_0x8337('0x17')](_0x3098d5);}return _0x1de7cc[_0x8337('0x18')](_0x3098d5)[_0x8337('0x19')]();};}function respondWithResult(_0x2aab9f,_0x23bd83){_0x23bd83=_0x23bd83||0xc8;return function(_0x230e71){if(_0x230e71){return _0x2aab9f[_0x8337('0x18')](_0x23bd83)[_0x8337('0x1a')](_0x230e71);}};}function respondWithFilteredResult(_0x202fc1,_0x188053){return function(_0x516088){if(_0x516088){var _0x240b7d=typeof _0x188053['offset']==='undefined'&&typeof _0x188053[_0x8337('0x1b')]===_0x8337('0x1c');var _0x3b9354=_0x516088[_0x8337('0x1d')];var _0x40dd58=_0x240b7d?0x0:_0x188053[_0x8337('0x1e')];var _0x4768c7=_0x240b7d?_0x516088[_0x8337('0x1d')]:_0x188053[_0x8337('0x1e')]+_0x188053[_0x8337('0x1b')];var _0x33dd92;if(_0x4768c7>=_0x3b9354){_0x4768c7=_0x3b9354;_0x33dd92=0xc8;}else{_0x33dd92=0xce;}_0x202fc1['status'](_0x33dd92);return _0x202fc1[_0x8337('0x1f')]('Content-Range',_0x40dd58+'-'+_0x4768c7+'/'+_0x3b9354)[_0x8337('0x1a')](_0x516088);}return null;};}function patchUpdates(_0x21f0b5){return function(_0x54d59b){try{jsonpatch[_0x8337('0x20')](_0x54d59b,_0x21f0b5,!![]);}catch(_0x4ab338){return BPromise[_0x8337('0x21')](_0x4ab338);}return _0x54d59b['save']();};}function saveUpdates(_0x3f95a0,_0x179293){return function(_0x4126a4){if(_0x4126a4){return _0x4126a4['update'](_0x3f95a0)[_0x8337('0x22')](function(_0x1df41a){return _0x1df41a;});}return null;};}function removeEntity(_0x11812d,_0x3d15a4){return function(_0xc92530){if(_0xc92530){return _0xc92530[_0x8337('0x23')]()[_0x8337('0x22')](function(){var _0x519649=_0xc92530[_0x8337('0x24')]({'plain':!![]});var _0x346f7d=_0x8337('0x25');return db['UserProfileResource'][_0x8337('0x23')]({'where':{'type':_0x346f7d,'resourceId':_0x519649['id']}})[_0x8337('0x22')](function(){return _0xc92530;});})[_0x8337('0x22')](function(){_0x11812d['status'](0xcc)[_0x8337('0x19')]();});}};}function handleEntityNotFound(_0x5a6cb6,_0x32ed5d){return function(_0x4406e9){if(!_0x4406e9){_0x5a6cb6[_0x8337('0x17')](0x194);}return _0x4406e9;};}function handleError(_0x22fb94,_0x4319ba){_0x4319ba=_0x4319ba||0x1f4;return function(_0x3112be){logger[_0x8337('0x26')](_0x3112be[_0x8337('0x27')]);if(_0x3112be[_0x8337('0x28')]){delete _0x3112be[_0x8337('0x28')];}_0x22fb94[_0x8337('0x18')](_0x4319ba)[_0x8337('0x29')](_0x3112be);};}exports[_0x8337('0x2a')]=function(_0x59644b,_0x5f0ca6){var _0x57fa84={},_0xe97126={},_0x3f7705={'count':0x0,'rows':[]};var _0x105d64=_[_0x8337('0x2b')](db[_0x8337('0x2c')]['rawAttributes'],function(_0x5f3f36){return{'name':_0x5f3f36['fieldName'],'type':_0x5f3f36['type']['key']};});_0xe97126[_0x8337('0x2d')]=_[_0x8337('0x2b')](_0x105d64,_0x8337('0x28'));_0xe97126[_0x8337('0x2e')]=_[_0x8337('0x2f')](_0x59644b[_0x8337('0x2e')]);_0xe97126[_0x8337('0x30')]=_[_0x8337('0x31')](_0xe97126[_0x8337('0x2d')],_0xe97126[_0x8337('0x2e')]);_0x57fa84[_0x8337('0x32')]=_[_0x8337('0x31')](_0xe97126[_0x8337('0x2d')],qs['fields'](_0x59644b[_0x8337('0x2e')]['fields']));_0x57fa84['attributes']=_0x57fa84[_0x8337('0x32')][_0x8337('0x33')]?_0x57fa84['attributes']:_0xe97126[_0x8337('0x2d')];if(!_0x59644b[_0x8337('0x2e')][_0x8337('0x34')](_0x8337('0x35'))){_0x57fa84['limit']=qs[_0x8337('0x1b')](_0x59644b[_0x8337('0x2e')]['limit']);_0x57fa84[_0x8337('0x1e')]=qs[_0x8337('0x1e')](_0x59644b[_0x8337('0x2e')][_0x8337('0x1e')]);}_0x57fa84[_0x8337('0x36')]=qs[_0x8337('0x37')](_0x59644b[_0x8337('0x2e')]['sort']);_0x57fa84[_0x8337('0x38')]=qs[_0x8337('0x30')](_['pick'](_0x59644b[_0x8337('0x2e')],_0xe97126[_0x8337('0x30')]),_0x105d64);if(_0x59644b[_0x8337('0x2e')][_0x8337('0x39')]){_0x57fa84[_0x8337('0x38')]=_[_0x8337('0x3a')](_0x57fa84[_0x8337('0x38')],{'$or':_[_0x8337('0x2b')](_0x105d64,function(_0x2cda75){if(_0x2cda75[_0x8337('0x3b')]!==_0x8337('0x3c')){var _0x55a067={};_0x55a067[_0x2cda75['name']]={'$like':'%'+_0x59644b[_0x8337('0x2e')][_0x8337('0x39')]+'%'};return _0x55a067;}})});}_0x57fa84=_[_0x8337('0x3a')]({},_0x57fa84,_0x59644b['options']);var _0x2b8ca1={'where':_0x57fa84[_0x8337('0x38')]};return db[_0x8337('0x2c')]['count'](_0x2b8ca1)[_0x8337('0x22')](function(_0x22d503){_0x3f7705[_0x8337('0x1d')]=_0x22d503;if(_0x59644b['query'][_0x8337('0x3d')]){_0x57fa84[_0x8337('0x3e')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x57fa84);})['then'](function(_0x531928){_0x3f7705[_0x8337('0x3f')]=_0x531928;return _0x3f7705;})[_0x8337('0x22')](respondWithFilteredResult(_0x5f0ca6,_0x57fa84))[_0x8337('0x40')](handleError(_0x5f0ca6,null));};exports[_0x8337('0x41')]=function(_0x1c069e,_0x3e9aa5){var _0x55c316={'raw':!![],'where':{'id':_0x1c069e[_0x8337('0x42')]['id']}},_0x260b6e={};_0x260b6e['model']=_[_0x8337('0x2f')](db[_0x8337('0x2c')]['rawAttributes']);_0x260b6e['query']=_[_0x8337('0x2f')](_0x1c069e[_0x8337('0x2e')]);_0x260b6e[_0x8337('0x30')]=_[_0x8337('0x31')](_0x260b6e[_0x8337('0x2d')],_0x260b6e[_0x8337('0x2e')]);_0x55c316[_0x8337('0x32')]=_[_0x8337('0x31')](_0x260b6e[_0x8337('0x2d')],qs[_0x8337('0x43')](_0x1c069e[_0x8337('0x2e')][_0x8337('0x43')]));_0x55c316[_0x8337('0x32')]=_0x55c316['attributes'][_0x8337('0x33')]?_0x55c316[_0x8337('0x32')]:_0x260b6e[_0x8337('0x2d')];if(_0x1c069e[_0x8337('0x2e')][_0x8337('0x3d')]){_0x55c316[_0x8337('0x3e')]=[{'all':!![]}];}_0x55c316=_['merge']({},_0x55c316,_0x1c069e['options']);return db['Variable'][_0x8337('0x44')](_0x55c316)['then'](handleEntityNotFound(_0x3e9aa5,null))[_0x8337('0x22')](respondWithResult(_0x3e9aa5,null))['catch'](handleError(_0x3e9aa5,null));};exports[_0x8337('0x45')]=function(_0x5eb8c1,_0x2b855c){return db[_0x8337('0x2c')][_0x8337('0x45')](_0x5eb8c1[_0x8337('0x46')],{})['then'](function(_0x1acae8){var _0x482c1a=_0x5eb8c1['user'][_0x8337('0x24')]({'plain':!![]});if(!_0x482c1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482c1a[_0x8337('0x47')]==='user'){var _0x4ed5da=_0x1acae8['get']({'plain':!![]});var _0x5afc7d=_0x8337('0x25');return db[_0x8337('0x48')][_0x8337('0x44')]({'where':{'name':_0x5afc7d,'userProfileId':_0x482c1a[_0x8337('0x49')]},'raw':!![]})['then'](function(_0x4f1e61){if(_0x4f1e61&&_0x4f1e61[_0x8337('0x4a')]===0x0){return db[_0x8337('0x4b')][_0x8337('0x45')]({'name':_0x4ed5da[_0x8337('0x28')],'resourceId':_0x4ed5da['id'],'type':_0x4f1e61['name'],'sectionId':_0x4f1e61['id']},{})[_0x8337('0x22')](function(){return _0x1acae8;});}else{return _0x1acae8;}})[_0x8337('0x40')](function(_0x413129){logger['error'](_0x8337('0x4c'),_0x413129);throw _0x413129;});}return _0x1acae8;})[_0x8337('0x22')](respondWithResult(_0x2b855c,0xc9))[_0x8337('0x40')](handleError(_0x2b855c,null));};exports[_0x8337('0x4d')]=function(_0x13d280,_0x2f8890){if(_0x13d280[_0x8337('0x46')]['id']){delete _0x13d280[_0x8337('0x46')]['id'];}return db[_0x8337('0x2c')][_0x8337('0x44')]({'where':{'id':_0x13d280[_0x8337('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f8890,null))[_0x8337('0x22')](saveUpdates(_0x13d280[_0x8337('0x46')],null))[_0x8337('0x22')](respondWithResult(_0x2f8890,null))[_0x8337('0x40')](handleError(_0x2f8890,null));};exports[_0x8337('0x23')]=function(_0x459f0f,_0x38035e){return db['Variable']['find']({'where':{'id':_0x459f0f[_0x8337('0x42')]['id']}})[_0x8337('0x22')](handleEntityNotFound(_0x38035e,null))[_0x8337('0x22')](removeEntity(_0x38035e,null))[_0x8337('0x40')](handleError(_0x38035e,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 43304ac..516bbc5 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 _0x28af=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Variable','util','api','moment'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0x28af,0x76));var _0xf28a=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x28af[_0x5a6de2];return _0x2c0525;};'use strict';var _=require('lodash');var util=require(_0xf28a('0x0'));var logger=require('../../config/logger')(_0xf28a('0x1'));var moment=require(_0xf28a('0x2'));var BPromise=require(_0xf28a('0x3'));var rp=require(_0xf28a('0x4'));var fs=require('fs');var path=require(_0xf28a('0x5'));var rimraf=require(_0xf28a('0x6'));var config=require(_0xf28a('0x7'));var attributes=require('./variable.attributes');module[_0xf28a('0x8')]=function(_0x4173d8,_0x378711){return _0x4173d8[_0xf28a('0x9')](_0xf28a('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf1=['request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45016e,_0x9517fb){var _0x260948=function(_0x400896){while(--_0x400896){_0x45016e['push'](_0x45016e['shift']());}};_0x260948(++_0x9517fb);}(_0xdbf1,0x1d6));var _0x1dbf=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xdbf1[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x1dbf('0x0'));var util=require(_0x1dbf('0x1'));var logger=require(_0x1dbf('0x2'))(_0x1dbf('0x3'));var moment=require(_0x1dbf('0x4'));var BPromise=require(_0x1dbf('0x5'));var rp=require(_0x1dbf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dbf('0x7'));var config=require(_0x1dbf('0x8'));var attributes=require(_0x1dbf('0x9'));module[_0x1dbf('0xa')]=function(_0x13fef8,_0x2e1c3e){return _0x13fef8[_0x1dbf('0xb')](_0x1dbf('0xc'),attributes,{'tableName':_0x1dbf('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 cbfa7ef..f23b8f8 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x3ec791,_0x539637){var _0x209fd4=function(_0x224cf0){while(--_0x224cf0){_0x3ec791['push'](_0x3ec791['shift']());}};_0x209fd4(++_0x539637);}(_0x7217,0x19e));var _0x7721=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7217[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x3aeea1,_0x4cfbb9){var _0x424cc1=function(_0x5bf082){while(--_0x5bf082){_0x3aeea1['push'](_0x3aeea1['shift']());}};_0x424cc1(++_0x4cfbb9);}(_0x3e74,0x175));var _0x43e7=function(_0x2905ce,_0x13b1cf){_0x2905ce=_0x2905ce-0x0;var _0x147715=_0x3e74[_0x2905ce];return _0x147715;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index fcd9731..cbbd5f5 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 _0x911d=['/reset','reset','/restart','restart','/migrations','migrations','express','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x320fce,_0x7ed677){var _0x24587e=function(_0x51c9ac){while(--_0x51c9ac){_0x320fce['push'](_0x320fce['shift']());}};_0x24587e(++_0x7ed677);}(_0x911d,0x114));var _0xd911=function(_0x59dc07,_0x13221a){_0x59dc07=_0x59dc07-0x0;var _0x14e62b=_0x911d[_0x59dc07];return _0x14e62b;};'use strict';var express=require(_0xd911('0x0'));var router=express['Router']();var auth=require(_0xd911('0x1'));var controller=require(_0xd911('0x2'));router['get']('/',controller[_0xd911('0x3')]);router[_0xd911('0x4')](_0xd911('0x5'),auth[_0xd911('0x6')](),auth[_0xd911('0x7')](),controller[_0xd911('0x8')]);router[_0xd911('0x4')](_0xd911('0x9'),auth[_0xd911('0x6')](),auth[_0xd911('0x7')](),controller[_0xd911('0xa')]);router['get']('/pull',auth['isAuthenticated'](),auth[_0xd911('0x7')](),controller['pull']);router[_0xd911('0x4')](_0xd911('0xb'),auth[_0xd911('0x6')](),controller[_0xd911('0xc')]);router[_0xd911('0x4')](_0xd911('0xd'),controller[_0xd911('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2fac=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0x51f75d,_0x223876){var _0x2c14d7=function(_0x4ce3bd){while(--_0x4ce3bd){_0x51f75d['push'](_0x51f75d['shift']());}};_0x2c14d7(++_0x223876);}(_0x2fac,0xb3));var _0xc2fa=function(_0x5e14d1,_0x4e2800){_0x5e14d1=_0x5e14d1-0x0;var _0x329bb4=_0x2fac[_0x5e14d1];return _0x329bb4;};'use strict';var express=require(_0xc2fa('0x0'));var router=express[_0xc2fa('0x1')]();var auth=require(_0xc2fa('0x2'));var controller=require(_0xc2fa('0x3'));router[_0xc2fa('0x4')]('/',controller[_0xc2fa('0x5')]);router[_0xc2fa('0x4')](_0xc2fa('0x6'),auth[_0xc2fa('0x7')](),auth[_0xc2fa('0x8')](),controller[_0xc2fa('0x9')]);router['get'](_0xc2fa('0xa'),auth[_0xc2fa('0x7')](),auth[_0xc2fa('0x8')](),controller[_0xc2fa('0xb')]);router[_0xc2fa('0x4')](_0xc2fa('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xc2fa('0xd')]);router[_0xc2fa('0x4')](_0xc2fa('0xe'),auth[_0xc2fa('0x7')](),controller[_0xc2fa('0xf')]);router['get'](_0xc2fa('0x10'),controller[_0xc2fa('0x11')]);module[_0xc2fa('0x12')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cf5f1f2..1b0b9c5 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 _0xf5b9=['Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','git\x20fetch','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','server','length','.js','push','sequelize','Migration','constructor'];(function(_0x50ef1f,_0x3b4135){var _0x4eb802=function(_0x51eb1a){while(--_0x51eb1a){_0x50ef1f['push'](_0x50ef1f['shift']());}};_0x4eb802(++_0x3b4135);}(_0xf5b9,0xe0));var _0x9f5b=function(_0x5a85fb,_0x3d9527){_0x5a85fb=_0x5a85fb-0x0;var _0x3dfbfa=_0xf5b9[_0x5a85fb];return _0x3dfbfa;};'use strict';var Umzug=require(_0x9f5b('0x0'));var path=require(_0x9f5b('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9f5b('0x2'))(module,_0x9f5b('0x3'));var compareVersions=require(_0x9f5b('0x4'));var exec=require(_0x9f5b('0x5'))[_0x9f5b('0x6')];var db=require(_0x9f5b('0x7'))['db'];var config=require(_0x9f5b('0x8'));var pm2=require(_0x9f5b('0x9'));var logger=require(_0x9f5b('0xa'))(_0x9f5b('0xb'));var git=require(_0x9f5b('0xc'))(config[_0x9f5b('0xd')]);exports[_0x9f5b('0xe')]=function(_0x22aa59,_0x3b7d85){var _0x4ea8c8={'current':module[_0x9f5b('0xf')][_0x9f5b('0x3')],'phonebar':0x2};if(_0x22aa59[_0x9f5b('0x10')]&&_0x22aa59[_0x9f5b('0x10')][_0x9f5b('0x11')]){return git[_0x9f5b('0x12')]()[_0x9f5b('0x13')](function(_0x4159ba,_0x25739e){_0x4ea8c8[_0x9f5b('0x11')]=(_0x4159ba?module[_0x9f5b('0xf')]['version']:_0x25739e[_0x9f5b('0x11')])||_0x9f5b('0x14');return _0x3b7d85[_0x9f5b('0x15')](0xc8)['json'](_0x4ea8c8);});}else{return _0x3b7d85[_0x9f5b('0x15')](0xc8)[_0x9f5b('0x16')](_0x4ea8c8);}};exports['fetch']=function(_0x86b489,_0x4675a2){return git[_0x9f5b('0x12')]([_0x9f5b('0x17'),_0x9f5b('0x18')],function(_0x1c88af){if(_0x1c88af){logger[_0x9f5b('0x19')](_0x1c88af);return _0x4675a2[_0x9f5b('0x15')](0x1f4)['json'](_0x1c88af);}logger['info'](_0x9f5b('0x1a'));return _0x4675a2[_0x9f5b('0x15')](0xc8)[_0x9f5b('0x16')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x51a250,_0x463d93){return git[_0x9f5b('0x1b')]([_0x9f5b('0x1c'),'FETCH_HEAD'],function(_0x1fbc0a){if(_0x1fbc0a){logger[_0x9f5b('0x19')](_0x1fbc0a);return _0x463d93[_0x9f5b('0x15')](0x1f4)['json'](_0x1fbc0a);}logger[_0x9f5b('0x1d')](_0x9f5b('0x1e'));return _0x463d93[_0x9f5b('0x15')](0xc8)['json']({'output':_0x9f5b('0x1f')});});};exports['pull']=function(_0x52ec8c,_0x3fa39e){exec('npm\x20install\x20--production',function(_0x3fdf51,_0x182da7,_0x4ecf73){logger[_0x9f5b('0x1d')](_0x182da7);logger[_0x9f5b('0x1d')](_0x4ecf73);if(_0x3fdf51){logger[_0x9f5b('0x19')](_0x3fdf51);return _0x3fa39e['status'](0x1f4)['json'](_0x3fdf51);}return _0x3fa39e[_0x9f5b('0x15')](0xc8)[_0x9f5b('0x16')]({'output':_0x182da7});});};exports['restart']=function(_0x407180,_0x1d97bf){return pm2[_0x9f5b('0x20')](_0x9f5b('0x21'))[_0x9f5b('0x22')](function(_0x49ffdd){logger[_0x9f5b('0x1d')](_0x9f5b('0x23'),_0x49ffdd);return _0x1d97bf[_0x9f5b('0x15')](0xc8)['json']({'output':_0x9f5b('0x24')});})[_0x9f5b('0x25')](function(_0x25fc3d){logger[_0x9f5b('0x19')](_0x25fc3d);return _0x1d97bf[_0x9f5b('0x15')](0x1f4)[_0x9f5b('0x16')](_0x25fc3d);});};exports[_0x9f5b('0x26')]=function(_0x2a99f1,_0x1fdcd2){var _0x1de610=fs['readdirSync'](path['join'](config[_0x9f5b('0xd')],_0x9f5b('0x27'),_0x9f5b('0x26')));var _0x1f6905=[];for(var _0x2cd305=0x0;_0x2cd305<_0x1de610[_0x9f5b('0x28')];_0x2cd305++){var _0x2ea44b=_0x1de610[_0x2cd305]['replace'](_0x9f5b('0x29'),'');if(compareVersions(module[_0x9f5b('0xf')][_0x9f5b('0x3')],_0x2ea44b)===-0x1){_0x1f6905[_0x9f5b('0x2a')](_0x2ea44b);}}if(_0x1f6905[_0x9f5b('0x28')]){var _0x4889cf=_0x1f6905['sort'](compareVersions);var _0x23f757=new Umzug({'storage':_0x9f5b('0x2b'),'storageOptions':{'model':db[_0x9f5b('0x2c')],'modelName':_0x9f5b('0x2c'),'columnName':_0x9f5b('0x3')},'migrations':{'params':[db[_0x9f5b('0x2b')]['getQueryInterface'](),db[_0x9f5b('0x2b')][_0x9f5b('0x2d')],function(){throw new Error(_0x9f5b('0x2e'));}],'path':path['join'](config[_0x9f5b('0xd')],_0x9f5b('0x27'),'migrations'),'pattern':/\.js$/}});_0x23f757['up']({'migrations':_[_0x9f5b('0x2f')](_0x4889cf,function(_0x2bf9d9){return _0x2bf9d9+_0x9f5b('0x29');})})['then'](function(){return _0x1fdcd2[_0x9f5b('0x15')](0xc8)[_0x9f5b('0x16')]({'output':_0x9f5b('0x30')+module['exports'][_0x9f5b('0x3')]+_0x9f5b('0x31')+_[_0x9f5b('0x32')](_0x4889cf),'migrations':_[_0x9f5b('0x33')](_0x4889cf)});})[_0x9f5b('0x25')](function(_0x3a1b7f){if(_0x3a1b7f instanceof db[_0x9f5b('0x2b')][_0x9f5b('0x34')]){return _0x1fdcd2[_0x9f5b('0x15')](0xc8)[_0x9f5b('0x16')]({'output':_0x9f5b('0x35')});}else{return _0x1fdcd2[_0x9f5b('0x15')](0x1f4)[_0x9f5b('0x16')](_0x3a1b7f);}});}else{return _0x1fdcd2[_0x9f5b('0x15')](0xc8)['json']({'output':_0x9f5b('0x35')});}}; \ No newline at end of file +var _0x9652=['update','simple-git','root','index','query','latest','fetch','tags','exports','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger'];(function(_0x48a21a,_0xbb6a8e){var _0x43c031=function(_0x33d3c4){while(--_0x33d3c4){_0x48a21a['push'](_0x48a21a['shift']());}};_0x43c031(++_0xbb6a8e);}(_0x9652,0x147));var _0x2965=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0x9652[_0x2b2b33];return _0x229157;};'use strict';var Umzug=require('umzug');var path=require(_0x2965('0x0'));var fs=require('fs');var _=require(_0x2965('0x1'));var pkginfo=require(_0x2965('0x2'))(module,_0x2965('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x2965('0x4'))[_0x2965('0x5')];var db=require(_0x2965('0x6'))['db'];var config=require(_0x2965('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x2965('0x8'))(_0x2965('0x9'));var git=require(_0x2965('0xa'))(config[_0x2965('0xb')]);exports[_0x2965('0xc')]=function(_0x478676,_0x5be305){var _0x1695ec={'current':module['exports'][_0x2965('0x3')],'phonebar':0x2};if(_0x478676[_0x2965('0xd')]&&_0x478676[_0x2965('0xd')][_0x2965('0xe')]){return git[_0x2965('0xf')]()[_0x2965('0x10')](function(_0x45cf8e,_0x3a0989){_0x1695ec['latest']=(_0x45cf8e?module[_0x2965('0x11')]['version']:_0x3a0989['latest'])||_0x2965('0x12');return _0x5be305[_0x2965('0x13')](0xc8)[_0x2965('0x14')](_0x1695ec);});}else{return _0x5be305[_0x2965('0x13')](0xc8)[_0x2965('0x14')](_0x1695ec);}};exports[_0x2965('0xf')]=function(_0x168d6c,_0x50bb2a){return git[_0x2965('0xf')](['origin',_0x2965('0x15')],function(_0x1e92a9){if(_0x1e92a9){logger[_0x2965('0x16')](_0x1e92a9);return _0x50bb2a['status'](0x1f4)[_0x2965('0x14')](_0x1e92a9);}logger[_0x2965('0x17')](_0x2965('0x18'));return _0x50bb2a[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':_0x2965('0x19')});});};exports[_0x2965('0x1a')]=function(_0x35ae24,_0x1638bd){return git[_0x2965('0x1a')]([_0x2965('0x1b'),'FETCH_HEAD'],function(_0x26add0){if(_0x26add0){logger[_0x2965('0x16')](_0x26add0);return _0x1638bd[_0x2965('0x13')](0x1f4)['json'](_0x26add0);}logger[_0x2965('0x17')](_0x2965('0x1c'));return _0x1638bd[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':_0x2965('0x1d')});});};exports[_0x2965('0x1e')]=function(_0x21c4fe,_0x268831){exec(_0x2965('0x1f'),function(_0x30fc4e,_0x4191b2,_0x19ad1c){logger[_0x2965('0x17')](_0x4191b2);logger[_0x2965('0x17')](_0x19ad1c);if(_0x30fc4e){logger[_0x2965('0x16')](_0x30fc4e);return _0x268831[_0x2965('0x13')](0x1f4)[_0x2965('0x14')](_0x30fc4e);}return _0x268831[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':_0x4191b2});});};exports[_0x2965('0x20')]=function(_0x59b0d7,_0xa7cec8){return pm2['restart'](_0x2965('0x21'))[_0x2965('0x22')](function(_0x225210){logger[_0x2965('0x17')](_0x2965('0x23'),_0x225210);return _0xa7cec8[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x2965('0x24')](function(_0x1c1304){logger['error'](_0x1c1304);return _0xa7cec8[_0x2965('0x13')](0x1f4)['json'](_0x1c1304);});};exports[_0x2965('0x25')]=function(_0x417356,_0x2aad06){var _0x8942a5=fs[_0x2965('0x26')](path[_0x2965('0x27')](config['root'],_0x2965('0x28'),_0x2965('0x25')));var _0x1a5f5e=[];for(var _0x3597f2=0x0;_0x3597f2<_0x8942a5[_0x2965('0x29')];_0x3597f2++){var _0x4ccea6=_0x8942a5[_0x3597f2][_0x2965('0x2a')](_0x2965('0x2b'),'');if(compareVersions(module[_0x2965('0x11')][_0x2965('0x3')],_0x4ccea6)===-0x1){_0x1a5f5e['push'](_0x4ccea6);}}if(_0x1a5f5e[_0x2965('0x29')]){var _0x293bdd=_0x1a5f5e[_0x2965('0x2c')](compareVersions);var _0x3e4e06=new Umzug({'storage':_0x2965('0x2d'),'storageOptions':{'model':db[_0x2965('0x2e')],'modelName':_0x2965('0x2e'),'columnName':_0x2965('0x3')},'migrations':{'params':[db[_0x2965('0x2d')][_0x2965('0x2f')](),db[_0x2965('0x2d')][_0x2965('0x30')],function(){throw new Error(_0x2965('0x31'));}],'path':path[_0x2965('0x27')](config[_0x2965('0xb')],_0x2965('0x28'),_0x2965('0x25')),'pattern':/\.js$/}});_0x3e4e06['up']({'migrations':_[_0x2965('0x32')](_0x293bdd,function(_0x5d62da){return _0x5d62da+_0x2965('0x2b');})})[_0x2965('0x22')](function(){return _0x2aad06[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':_0x2965('0x33')+module['exports'][_0x2965('0x3')]+_0x2965('0x34')+_[_0x2965('0x35')](_0x293bdd),'migrations':_['join'](_0x293bdd)});})[_0x2965('0x24')](function(_0xc010a7){if(_0xc010a7 instanceof db[_0x2965('0x2d')][_0x2965('0x36')]){return _0x2aad06[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':_0x2965('0x37')});}else{return _0x2aad06[_0x2965('0x13')](0x1f4)[_0x2965('0x14')](_0xc010a7);}});}else{return _0x2aad06[_0x2965('0x13')](0xc8)[_0x2965('0x14')]({'output':_0x2965('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f53ed52..c4f6436 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 _0x8beb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x8beb,0xed));var _0xb8be=function(_0x538403,_0x42e0ec){_0x538403=_0x538403-0x0;var _0x23ffe2=_0x8beb[_0x538403];return _0x23ffe2;};'use strict';var multer=require(_0xb8be('0x0'));var util=require(_0xb8be('0x1'));var path=require(_0xb8be('0x2'));var timeout=require('connect-timeout');var express=require(_0xb8be('0x3'));var router=express[_0xb8be('0x4')]();var fs_extra=require(_0xb8be('0x5'));var auth=require(_0xb8be('0x6'));var interaction=require(_0xb8be('0x7'));var config=require(_0xb8be('0x8'));var controller=require(_0xb8be('0x9'));router[_0xb8be('0xa')]('/',auth['isAuthenticated'](),controller[_0xb8be('0xb')]);router['get'](_0xb8be('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb8be('0xd'),auth[_0xb8be('0xe')](),controller[_0xb8be('0xf')]);router['post']('/',auth[_0xb8be('0xe')](),controller[_0xb8be('0x10')]);router[_0xb8be('0x11')](_0xb8be('0xd'),auth[_0xb8be('0xe')](),controller[_0xb8be('0x12')]);router[_0xb8be('0x13')](_0xb8be('0xd'),auth['isAuthenticated'](),controller[_0xb8be('0x14')]);module[_0xb8be('0x15')]=router; \ No newline at end of file +var _0x6c0c=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2594e0,_0x1ee198){var _0x1eadb9=function(_0x52a325){while(--_0x52a325){_0x2594e0['push'](_0x2594e0['shift']());}};_0x1eadb9(++_0x1ee198);}(_0x6c0c,0x6c));var _0xc6c0=function(_0x874297,_0x86c796){_0x874297=_0x874297-0x0;var _0x74d63e=_0x6c0c[_0x874297];return _0x74d63e;};'use strict';var multer=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var path=require('path');var timeout=require(_0xc6c0('0x2'));var express=require(_0xc6c0('0x3'));var router=express[_0xc6c0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc6c0('0x5'));var interaction=require(_0xc6c0('0x6'));var config=require(_0xc6c0('0x7'));var controller=require(_0xc6c0('0x8'));router[_0xc6c0('0x9')]('/',auth[_0xc6c0('0xa')](),controller[_0xc6c0('0xb')]);router[_0xc6c0('0x9')]('/describe',auth[_0xc6c0('0xa')](),controller[_0xc6c0('0xc')]);router[_0xc6c0('0x9')](_0xc6c0('0xd'),auth[_0xc6c0('0xa')](),controller[_0xc6c0('0xe')]);router['post']('/',auth[_0xc6c0('0xa')](),controller['create']);router['put']('/:id',auth[_0xc6c0('0xa')](),controller[_0xc6c0('0xf')]);router[_0xc6c0('0x10')](_0xc6c0('0xd'),auth[_0xc6c0('0xa')](),controller[_0xc6c0('0x11')]);module[_0xc6c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 6c19ce0..19af274 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 _0xd732=['DATE','BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x5daf94,_0x4be0b8){var _0x4a0f80=function(_0x5978ec){while(--_0x5978ec){_0x5daf94['push'](_0x5daf94['shift']());}};_0x4a0f80(++_0x4be0b8);}(_0xd732,0x18e));var _0x2d73=function(_0x11969d,_0x5ea23b){_0x11969d=_0x11969d-0x0;var _0x27762c=_0xd732[_0x11969d];return _0x27762c;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'type':{'type':Sequelize[_0x2d73('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2d73('0x1')]},'queue':{'type':Sequelize[_0x2d73('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x2d73('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x2d73('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x2d73('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2d73('0x4')]},'agentacw':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2d73('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2d73('0x1')]},'channel':{'type':Sequelize[_0x2d73('0x1')]},'channelstate':{'type':Sequelize[_0x2d73('0x4')]},'channelstatedesc':{'type':Sequelize[_0x2d73('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2d73('0x1')]},'language':{'type':Sequelize[_0x2d73('0x1')]},'accountcode':{'type':Sequelize[_0x2d73('0x1')]},'context':{'type':Sequelize[_0x2d73('0x1')]},'exten':{'type':Sequelize[_0x2d73('0x1')]},'priority':{'type':Sequelize[_0x2d73('0x1')]},'destchannel':{'type':Sequelize[_0x2d73('0x1')]},'destchannelstate':{'type':Sequelize[_0x2d73('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2d73('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2d73('0x1')]},'destcalleridname':{'type':Sequelize[_0x2d73('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2d73('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2d73('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2d73('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2d73('0x1')]},'destuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2d73('0x1')]},'transfer':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'agententerreason':{'type':Sequelize[_0x2d73('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5d4e=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x2e6260,_0x199acf){var _0x45239d=function(_0x3deb13){while(--_0x3deb13){_0x2e6260['push'](_0x2e6260['shift']());}};_0x45239d(++_0x199acf);}(_0x5d4e,0x138));var _0xe5d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5d4e[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xe5d4('0x0')]={'type':{'type':Sequelize[_0xe5d4('0x1')]},'uniqueid':{'type':Sequelize[_0xe5d4('0x1')]},'calleridnum':{'type':Sequelize[_0xe5d4('0x1')]},'calleridname':{'type':Sequelize[_0xe5d4('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe5d4('0x1')]},'membername':{'type':Sequelize[_0xe5d4('0x1')]},'agentcalledAt':{'type':Sequelize[_0xe5d4('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xe5d4('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe5d4('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe5d4('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe5d4('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe5d4('0x4')]},'agentacw':{'type':Sequelize[_0xe5d4('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe5d4('0x4')]},'reason':{'type':Sequelize[_0xe5d4('0x1')]},'lastevent':{'type':Sequelize[_0xe5d4('0x1')]},'channel':{'type':Sequelize[_0xe5d4('0x1')]},'channelstate':{'type':Sequelize[_0xe5d4('0x4')]},'channelstatedesc':{'type':Sequelize[_0xe5d4('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe5d4('0x1')]},'accountcode':{'type':Sequelize[_0xe5d4('0x1')]},'context':{'type':Sequelize[_0xe5d4('0x1')]},'exten':{'type':Sequelize[_0xe5d4('0x1')]},'priority':{'type':Sequelize[_0xe5d4('0x1')]},'destchannel':{'type':Sequelize[_0xe5d4('0x1')]},'destchannelstate':{'type':Sequelize[_0xe5d4('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe5d4('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe5d4('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe5d4('0x1')]},'destlanguage':{'type':Sequelize[_0xe5d4('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe5d4('0x1')]},'destexten':{'type':Sequelize[_0xe5d4('0x1')]},'destpriority':{'type':Sequelize[_0xe5d4('0x1')]},'destuniqueid':{'type':Sequelize[_0xe5d4('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe5d4('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xe5d4('0x1')]},'transfer':{'type':Sequelize[_0xe5d4('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe5d4('0x1')],'comment':_0xe5d4('0x5')},'transferexten':{'type':Sequelize[_0xe5d4('0x1')]},'transferuniqueid':{'type':Sequelize[_0xe5d4('0x1')]},'agententerreason':{'type':Sequelize[_0xe5d4('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 3cfb796..1845804 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 34e6607..a7ce4a0 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 _0xca8d=['report_agent','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x5e2949,_0x15bfcd){var _0x6469fb=function(_0x157878){while(--_0x157878){_0x5e2949['push'](_0x5e2949['shift']());}};_0x6469fb(++_0x15bfcd);}(_0xca8d,0x172));var _0xdca8=function(_0x2385fc,_0x4c17b4){_0x2385fc=_0x2385fc-0x0;var _0x5e7e2e=_0xca8d[_0x2385fc];return _0x5e7e2e;};'use strict';var _=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var logger=require(_0xdca8('0x2'))(_0xdca8('0x3'));var moment=require(_0xdca8('0x4'));var BPromise=require(_0xdca8('0x5'));var rp=require(_0xdca8('0x6'));var fs=require('fs');var path=require(_0xdca8('0x7'));var rimraf=require(_0xdca8('0x8'));var config=require(_0xdca8('0x9'));var attributes=require(_0xdca8('0xa'));module[_0xdca8('0xb')]=function(_0x4d6383,_0x3366d5){return _0x4d6383[_0xdca8('0xc')](_0xdca8('0xd'),attributes,{'tableName':_0xdca8('0xe'),'paranoid':![],'indexes':[{'fields':[_0xdca8('0xf'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd13e=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xd13e,0x193));var _0xed13=function(_0x6557c1,_0x2a13b2){_0x6557c1=_0x6557c1-0x0;var _0x5322f8=_0xd13e[_0x6557c1];return _0x5322f8;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var logger=require(_0xed13('0x2'))(_0xed13('0x3'));var moment=require('moment');var BPromise=require(_0xed13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed13('0x5'));var rimraf=require('rimraf');var config=require(_0xed13('0x6'));var attributes=require(_0xed13('0x7'));module['exports']=function(_0x50de44,_0x5142bd){return _0x50de44[_0xed13('0x8')](_0xed13('0x9'),attributes,{'tableName':_0xed13('0xa'),'paranoid':![],'indexes':[{'fields':[_0xed13('0xb'),_0xed13('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2818ebc..a88fd3f 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 _0xe9c6=['catch','UpdateVoiceAgentReport','update','where','limit','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','create','body','options','info','debug'];(function(_0x398b3d,_0x2f497e){var _0x20b1cf=function(_0x23a3ea){while(--_0x23a3ea){_0x398b3d['push'](_0x398b3d['shift']());}};_0x20b1cf(++_0x2f497e);}(_0xe9c6,0xa6));var _0x6e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6e9c('0x0'));var util=require('util');var moment=require(_0x6e9c('0x1'));var BPromise=require(_0x6e9c('0x2'));var rs=require(_0x6e9c('0x3'));var fs=require('fs');var Redis=require(_0x6e9c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e9c('0x5'));var logger=require(_0x6e9c('0x6'))(_0x6e9c('0x7'));var config=require(_0x6e9c('0x8'));var jayson=require(_0x6e9c('0x9'));var client=jayson[_0x6e9c('0xa')][_0x6e9c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43cf33,_0x24fb6b,_0x2250da){return new BPromise(function(_0x4ef64d,_0x526cae){return client[_0x6e9c('0xc')](_0x43cf33,_0x2250da)[_0x6e9c('0xd')](function(_0x3ac16c){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x24fb6b,_0x6e9c('0xe'));logger['debug'](_0x6e9c('0xf'),_0x24fb6b,_0x6e9c('0xe'),JSON['stringify'](_0x3ac16c));if(_0x3ac16c[_0x6e9c('0x10')]){if(_0x3ac16c['error']['code']===0x1f4){logger[_0x6e9c('0x10')](_0x6e9c('0x11'),_0x24fb6b,_0x3ac16c[_0x6e9c('0x10')][_0x6e9c('0x12')]);return _0x526cae(_0x3ac16c['error'][_0x6e9c('0x12')]);}logger[_0x6e9c('0x10')](_0x6e9c('0x11'),_0x24fb6b,_0x3ac16c[_0x6e9c('0x10')][_0x6e9c('0x12')]);return _0x4ef64d(_0x3ac16c[_0x6e9c('0x10')][_0x6e9c('0x12')]);}else{logger['info'](_0x6e9c('0x11'),_0x24fb6b,_0x6e9c('0xe'));_0x4ef64d(_0x3ac16c[_0x6e9c('0x13')][_0x6e9c('0x12')]);}})['catch'](function(_0x1991b3){logger[_0x6e9c('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x24fb6b,_0x1991b3);_0x526cae(_0x1991b3);});});}exports[_0x6e9c('0x14')]=function(_0x18859b){var _0x382b7a=this;return new Promise(function(_0x32e59e,_0x555669){return db['VoiceAgentReport'][_0x6e9c('0x15')](_0x18859b[_0x6e9c('0x16')],{'raw':_0x18859b['options']?_0x18859b[_0x6e9c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x6e9c('0xd')](function(_0xcc0684){logger[_0x6e9c('0x18')]('CreateVoiceAgentReport',_0x18859b);logger[_0x6e9c('0x19')](_0x6e9c('0x14'),_0x18859b,JSON['stringify'](_0xcc0684));_0x32e59e(_0xcc0684);})[_0x6e9c('0x1a')](function(_0x1380da){logger['error'](_0x6e9c('0x14'),_0x1380da[_0x6e9c('0x12')],_0x18859b);_0x555669(_0x382b7a['error'](0x1f4,_0x1380da[_0x6e9c('0x12')]));});});};exports[_0x6e9c('0x1b')]=function(_0x283341){var _0x5692bb=this;return new Promise(function(_0x49b910,_0x3fdb52){return db['VoiceAgentReport'][_0x6e9c('0x1c')](_0x283341[_0x6e9c('0x16')],{'raw':_0x283341[_0x6e9c('0x17')]?_0x283341['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x283341[_0x6e9c('0x17')]?_0x283341[_0x6e9c('0x17')][_0x6e9c('0x1d')]||null:null,'attributes':_0x283341['options']?_0x283341['options']['attributes']||null:null,'limit':_0x283341[_0x6e9c('0x17')]?_0x283341[_0x6e9c('0x17')][_0x6e9c('0x1e')]||null:null})[_0x6e9c('0xd')](function(_0x2053fd){logger[_0x6e9c('0x18')]('UpdateVoiceAgentReport',_0x283341);logger['debug'](_0x6e9c('0x1b'),_0x283341,JSON[_0x6e9c('0x1f')](_0x2053fd));_0x49b910(_0x2053fd);})['catch'](function(_0x28941a){logger[_0x6e9c('0x10')](_0x6e9c('0x1b'),_0x28941a['message'],_0x283341);_0x3fdb52(_0x5692bb[_0x6e9c('0x10')](0x1f4,_0x28941a[_0x6e9c('0x12')]));});});}; \ No newline at end of file +var _0x5c10=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','VoiceAgentReport','body','options','raw','then','CreateVoiceAgentReport','debug','catch','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x15938f,_0x1ddbc5){var _0x3e4b60=function(_0x13388f){while(--_0x13388f){_0x15938f['push'](_0x15938f['shift']());}};_0x3e4b60(++_0x1ddbc5);}(_0x5c10,0x64));var _0x05c1=function(_0x1d1b74,_0x2794cc){_0x1d1b74=_0x1d1b74-0x0;var _0x5d5b8c=_0x5c10[_0x1d1b74];return _0x5d5b8c;};'use strict';var _=require(_0x05c1('0x0'));var util=require(_0x05c1('0x1'));var moment=require(_0x05c1('0x2'));var BPromise=require(_0x05c1('0x3'));var rs=require(_0x05c1('0x4'));var fs=require('fs');var Redis=require(_0x05c1('0x5'));var db=require(_0x05c1('0x6'))['db'];var utils=require(_0x05c1('0x7'));var logger=require(_0x05c1('0x8'))(_0x05c1('0x9'));var config=require(_0x05c1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x05c1('0xb')][_0x05c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x147943,_0x20f3f0,_0x1df709){return new BPromise(function(_0x5b2826,_0x562620){return client[_0x05c1('0xd')](_0x147943,_0x1df709)['then'](function(_0x2b3fe8){logger[_0x05c1('0xe')](_0x05c1('0xf'),_0x20f3f0,'request\x20sent');logger['debug'](_0x05c1('0x10'),_0x20f3f0,'request\x20sent',JSON[_0x05c1('0x11')](_0x2b3fe8));if(_0x2b3fe8[_0x05c1('0x12')]){if(_0x2b3fe8[_0x05c1('0x12')]['code']===0x1f4){logger[_0x05c1('0x12')](_0x05c1('0xf'),_0x20f3f0,_0x2b3fe8[_0x05c1('0x12')][_0x05c1('0x13')]);return _0x562620(_0x2b3fe8['error'][_0x05c1('0x13')]);}logger[_0x05c1('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x20f3f0,_0x2b3fe8[_0x05c1('0x12')][_0x05c1('0x13')]);return _0x5b2826(_0x2b3fe8[_0x05c1('0x12')][_0x05c1('0x13')]);}else{logger[_0x05c1('0xe')](_0x05c1('0xf'),_0x20f3f0,_0x05c1('0x14'));_0x5b2826(_0x2b3fe8[_0x05c1('0x15')][_0x05c1('0x13')]);}})['catch'](function(_0x8a28d3){logger[_0x05c1('0x12')](_0x05c1('0xf'),_0x20f3f0,_0x8a28d3);_0x562620(_0x8a28d3);});});}exports['CreateVoiceAgentReport']=function(_0x400ab2){var _0x53216c=this;return new Promise(function(_0x3fc82e,_0x2b91dd){return db[_0x05c1('0x16')]['create'](_0x400ab2[_0x05c1('0x17')],{'raw':_0x400ab2[_0x05c1('0x18')]?_0x400ab2[_0x05c1('0x18')][_0x05c1('0x19')]===undefined?!![]:![]:!![]})[_0x05c1('0x1a')](function(_0x1eedb6){logger[_0x05c1('0xe')](_0x05c1('0x1b'),_0x400ab2);logger[_0x05c1('0x1c')](_0x05c1('0x1b'),_0x400ab2,JSON['stringify'](_0x1eedb6));_0x3fc82e(_0x1eedb6);})[_0x05c1('0x1d')](function(_0x12de16){logger[_0x05c1('0x12')](_0x05c1('0x1b'),_0x12de16['message'],_0x400ab2);_0x2b91dd(_0x53216c[_0x05c1('0x12')](0x1f4,_0x12de16['message']));});});};exports[_0x05c1('0x1e')]=function(_0x465b81){var _0xb29dda=this;return new Promise(function(_0x45eace,_0x10b24b){return db[_0x05c1('0x16')][_0x05c1('0x1f')](_0x465b81[_0x05c1('0x17')],{'raw':_0x465b81[_0x05c1('0x18')]?_0x465b81[_0x05c1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x465b81[_0x05c1('0x18')]?_0x465b81['options'][_0x05c1('0x20')]||null:null,'attributes':_0x465b81[_0x05c1('0x18')]?_0x465b81[_0x05c1('0x18')][_0x05c1('0x21')]||null:null,'limit':_0x465b81['options']?_0x465b81['options'][_0x05c1('0x22')]||null:null})[_0x05c1('0x1a')](function(_0xe705cc){logger[_0x05c1('0xe')]('UpdateVoiceAgentReport',_0x465b81);logger[_0x05c1('0x1c')](_0x05c1('0x1e'),_0x465b81,JSON[_0x05c1('0x11')](_0xe705cc));_0x45eace(_0xe705cc);})[_0x05c1('0x1d')](function(_0x2781fe){logger[_0x05c1('0x12')]('UpdateVoiceAgentReport',_0x2781fe[_0x05c1('0x13')],_0x465b81);_0x10b24b(_0xb29dda[_0x05c1('0x12')](0x1f4,_0x2781fe[_0x05c1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 1ed0870..ead8566 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 _0xdb94=['/describe','/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get'];(function(_0x566fe3,_0x50afaa){var _0x1c1961=function(_0x339799){while(--_0x339799){_0x566fe3['push'](_0x566fe3['shift']());}};_0x1c1961(++_0x50afaa);}(_0xdb94,0xe5));var _0x4db9=function(_0x4b62e4,_0x2996d4){_0x4b62e4=_0x4b62e4-0x0;var _0x260287=_0xdb94[_0x4b62e4];return _0x260287;};'use strict';var multer=require('multer');var util=require(_0x4db9('0x0'));var path=require(_0x4db9('0x1'));var timeout=require('connect-timeout');var express=require(_0x4db9('0x2'));var router=express[_0x4db9('0x3')]();var fs_extra=require(_0x4db9('0x4'));var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0x9')]);router[_0x4db9('0xa')](_0x4db9('0xb'),auth[_0x4db9('0x8')](),controller['describe']);router[_0x4db9('0xa')](_0x4db9('0xc'),auth[_0x4db9('0x8')](),controller[_0x4db9('0xd')]);router[_0x4db9('0xe')]('/',auth['isAuthenticated'](),controller[_0x4db9('0xf')]);router[_0x4db9('0x10')](_0x4db9('0xc'),auth[_0x4db9('0x8')](),controller[_0x4db9('0x11')]);router[_0x4db9('0x12')]('/:id',auth[_0x4db9('0x8')](),controller[_0x4db9('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5089=['show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x5089,0x1bb));var _0x9508=function(_0x188703,_0x596b26){_0x188703=_0x188703-0x0;var _0x1a0c81=_0x5089[_0x188703];return _0x1a0c81;};'use strict';var multer=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var path=require('path');var timeout=require(_0x9508('0x2'));var express=require(_0x9508('0x3'));var router=express[_0x9508('0x4')]();var fs_extra=require(_0x9508('0x5'));var auth=require(_0x9508('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9508('0x7'));var controller=require('./voiceCallReport.controller');router[_0x9508('0x8')]('/',auth[_0x9508('0x9')](),controller[_0x9508('0xa')]);router['get'](_0x9508('0xb'),auth[_0x9508('0x9')](),controller['describe']);router[_0x9508('0x8')](_0x9508('0xc'),auth['isAuthenticated'](),controller[_0x9508('0xd')]);router['post']('/',auth[_0x9508('0x9')](),controller[_0x9508('0xe')]);router[_0x9508('0xf')](_0x9508('0xc'),auth[_0x9508('0x9')](),controller[_0x9508('0x10')]);router['delete'](_0x9508('0xc'),auth['isAuthenticated'](),controller[_0x9508('0x11')]);module[_0x9508('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 bf0fa4d..332832e 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 _0x7dd1=['inbound','internal','outbound','inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','ENUM'];(function(_0x179adf,_0x22e426){var _0x47f91b=function(_0x41f26d){while(--_0x41f26d){_0x179adf['push'](_0x179adf['shift']());}};_0x47f91b(++_0x22e426);}(_0x7dd1,0x169));var _0x17dd=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x7dd1[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0x17dd('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x17dd('0x1')](_0x17dd('0x2'),_0x17dd('0x3'),_0x17dd('0x4'),_0x17dd('0x5'),_0x17dd('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x17dd('0x7')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x17dd('0x7')]},'destinationcontext':{'type':Sequelize[_0x17dd('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x17dd('0x7')]},'destinationchannel':{'type':Sequelize[_0x17dd('0x7')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x17dd('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x17dd('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x17dd('0xa')]},'billableseconds':{'type':Sequelize[_0x17dd('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x17dd('0x7')]},'amaflags':{'type':Sequelize[_0x17dd('0x7')]},'userfield':{'type':Sequelize[_0x17dd('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x17dd('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x17dd('0x7')]},'routeid':{'type':Sequelize[_0x17dd('0xa')]},'sipcallid':{'type':Sequelize[_0x17dd('0x7')]}}; \ No newline at end of file +var _0xa02f=['outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound'];(function(_0x474fa2,_0x12a597){var _0x5f1d48=function(_0x4f686f){while(--_0x4f686f){_0x474fa2['push'](_0x474fa2['shift']());}};_0x5f1d48(++_0x12a597);}(_0xa02f,0xce));var _0xfa02=function(_0x2eaeba,_0xfcd067){_0x2eaeba=_0x2eaeba-0x0;var _0x98593a=_0xa02f[_0x2eaeba];return _0x98593a;};'use strict';var Sequelize=require('sequelize');module[_0xfa02('0x0')]={'uniqueid':{'type':Sequelize[_0xfa02('0x1')]},'type':{'type':Sequelize[_0xfa02('0x2')](_0xfa02('0x3'),'internal',_0xfa02('0x4'),'inbound-fax',_0xfa02('0x5'),_0xfa02('0x6'))},'tag':{'type':Sequelize[_0xfa02('0x1')]},'accountcode':{'type':Sequelize[_0xfa02('0x1')]},'source':{'type':Sequelize[_0xfa02('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xfa02('0x1')]},'callerid':{'type':Sequelize[_0xfa02('0x1')]},'channel':{'type':Sequelize[_0xfa02('0x1')]},'destinationchannel':{'type':Sequelize[_0xfa02('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xfa02('0x7')]},'starttime':{'type':Sequelize[_0xfa02('0x8')]},'systemanswertime':{'type':Sequelize[_0xfa02('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfa02('0x8')]},'duration':{'type':Sequelize[_0xfa02('0x9')]},'billableseconds':{'type':Sequelize[_0xfa02('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfa02('0x1')]},'amaflags':{'type':Sequelize[_0xfa02('0x1')]},'userfield':{'type':Sequelize[_0xfa02('0x1')]},'userDisposition':{'type':Sequelize[_0xfa02('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xfa02('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xfa02('0x1')]},'note':{'type':Sequelize[_0xfa02('0x1')]},'prefix':{'type':Sequelize[_0xfa02('0x1')]},'routeid':{'type':Sequelize[_0xfa02('0x9')]},'sipcallid':{'type':Sequelize[_0xfa02('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 5616f74..0a250b8 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 _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(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x2ef3,0xba));var _0x32ef=function(_0x3e95a3,_0x1afdf5){_0x3e95a3=_0x3e95a3-0x0;var _0x35134f=_0x2ef3[_0x3e95a3];return _0x35134f;};'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 +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d6544,_0x4a7c58){_0x1d6544=_0x1d6544-0x0;var _0x27ec38=_0x5f2f[_0x1d6544];return _0x27ec38;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 6bde9d4..4dd53d3 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 _0x83b2=['exports','define','VoiceCallReport','report_call','uniqueid','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2f11f2,_0x4bfb64){var _0x2d4576=function(_0x28e205){while(--_0x28e205){_0x2f11f2['push'](_0x2f11f2['shift']());}};_0x2d4576(++_0x4bfb64);}(_0x83b2,0xb9));var _0x283b=function(_0x3247c2,_0x4e8966){_0x3247c2=_0x3247c2-0x0;var _0x55fd39=_0x83b2[_0x3247c2];return _0x55fd39;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x283b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x283b('0x1'));var fs=require('fs');var path=require(_0x283b('0x2'));var rimraf=require(_0x283b('0x3'));var config=require(_0x283b('0x4'));var attributes=require('./voiceCallReport.attributes');module[_0x283b('0x5')]=function(_0x540ae3,_0x1064a0){return _0x540ae3[_0x283b('0x6')](_0x283b('0x7'),attributes,{'tableName':_0x283b('0x8'),'paranoid':![],'indexes':[{'fields':[_0x283b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b79=['bluebird','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b79,0x6b));var _0x96b7=function(_0x1f4dbd,_0x7ab732){_0x1f4dbd=_0x1f4dbd-0x0;var _0x3c1f36=_0x6b79[_0x1f4dbd];return _0x3c1f36;};'use strict';var _=require('lodash');var util=require(_0x96b7('0x0'));var logger=require(_0x96b7('0x1'))(_0x96b7('0x2'));var moment=require('moment');var BPromise=require(_0x96b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x96b7('0x4'));var attributes=require('./voiceCallReport.attributes');module[_0x96b7('0x5')]=function(_0x46a27b,_0x5ed618){return _0x46a27b[_0x96b7('0x6')](_0x96b7('0x7'),attributes,{'tableName':_0x96b7('0x8'),'paranoid':![],'indexes':[{'fields':[_0x96b7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 50a096e..514d2cc 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 _0xb40f=['../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','debug','CreateVoiceCallReport','VoiceCallReport','create','UpdateVoiceCallReport','body','bluebird','randomstring','ioredis'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xb40f,0x89));var _0xfb40=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0xb40f[_0x21f931];return _0x3f083c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfb40('0x0'));var rs=require(_0xfb40('0x1'));var fs=require('fs');var Redis=require(_0xfb40('0x2'));var db=require(_0xfb40('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfb40('0x4'));var jayson=require(_0xfb40('0x5'));var client=jayson[_0xfb40('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38a86c,_0x34715a,_0x541788){return new BPromise(function(_0x2dbff2,_0x688632){return client[_0xfb40('0x7')](_0x38a86c,_0x541788)[_0xfb40('0x8')](function(_0x25b568){logger[_0xfb40('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x34715a,'request\x20sent');logger['debug'](_0xfb40('0xa'),_0x34715a,_0xfb40('0xb'),JSON[_0xfb40('0xc')](_0x25b568));if(_0x25b568[_0xfb40('0xd')]){if(_0x25b568[_0xfb40('0xd')][_0xfb40('0xe')]===0x1f4){logger[_0xfb40('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x34715a,_0x25b568[_0xfb40('0xd')]['message']);return _0x688632(_0x25b568[_0xfb40('0xd')][_0xfb40('0xf')]);}logger[_0xfb40('0xd')](_0xfb40('0x10'),_0x34715a,_0x25b568[_0xfb40('0xd')][_0xfb40('0xf')]);return _0x2dbff2(_0x25b568[_0xfb40('0xd')]['message']);}else{logger[_0xfb40('0x9')](_0xfb40('0x10'),_0x34715a,_0xfb40('0xb'));_0x2dbff2(_0x25b568[_0xfb40('0x11')][_0xfb40('0xf')]);}})[_0xfb40('0x12')](function(_0x52d566){logger[_0xfb40('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x34715a,_0x52d566);_0x688632(_0x52d566);});});}exports[_0xfb40('0x13')]=function(_0xc42d14){var _0x3957b9=this;return new Promise(function(_0x486159,_0x5c3b41){return db['VoiceCallReport'][_0xfb40('0x14')]({'raw':_0xc42d14[_0xfb40('0x15')]?_0xc42d14[_0xfb40('0x15')][_0xfb40('0x16')]===undefined?!![]:![]:!![],'where':_0xc42d14[_0xfb40('0x15')]?_0xc42d14[_0xfb40('0x15')][_0xfb40('0x17')]||null:null,'attributes':_0xc42d14[_0xfb40('0x15')]?_0xc42d14[_0xfb40('0x15')][_0xfb40('0x18')]||null:null,'limit':_0xc42d14[_0xfb40('0x15')]?_0xc42d14[_0xfb40('0x15')][_0xfb40('0x19')]||null:null,'include':_0xc42d14[_0xfb40('0x15')]?_0xc42d14[_0xfb40('0x15')]['include']?_[_0xfb40('0x1a')](_0xc42d14[_0xfb40('0x15')][_0xfb40('0x1b')],function(_0x5aa3bd){return{'model':db[_0x5aa3bd['model']],'as':_0x5aa3bd['as'],'attributes':_0x5aa3bd[_0xfb40('0x18')],'include':_0x5aa3bd['include']?_[_0xfb40('0x1a')](_0x5aa3bd[_0xfb40('0x1b')],function(_0x4b51b8){return{'model':db[_0x4b51b8[_0xfb40('0x1c')]],'as':_0x4b51b8['as'],'attributes':_0x4b51b8['attributes'],'include':_0x4b51b8[_0xfb40('0x1b')]?_[_0xfb40('0x1a')](_0x4b51b8[_0xfb40('0x1b')],function(_0x318246){return{'model':db[_0x318246[_0xfb40('0x1c')]],'as':_0x318246['as'],'attributes':_0x318246['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x343654){logger[_0xfb40('0x9')](_0xfb40('0x13'),_0xc42d14);logger[_0xfb40('0x1d')](_0xfb40('0x13'),_0xc42d14,JSON[_0xfb40('0xc')](_0x343654));_0x486159(_0x343654);})[_0xfb40('0x12')](function(_0x5da976){logger[_0xfb40('0xd')](_0xfb40('0x13'),_0x5da976[_0xfb40('0xf')],_0xc42d14);_0x5c3b41(_0x3957b9['error'](0x1f4,_0x5da976[_0xfb40('0xf')]));});});};exports[_0xfb40('0x1e')]=function(_0x4367e3){var _0x32f943=this;return new Promise(function(_0x397fb7,_0x5da170){return db[_0xfb40('0x1f')][_0xfb40('0x20')](_0x4367e3['body'],{'raw':_0x4367e3[_0xfb40('0x15')]?_0x4367e3[_0xfb40('0x15')][_0xfb40('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x537b46){logger[_0xfb40('0x9')](_0xfb40('0x1e'),_0x4367e3);logger[_0xfb40('0x1d')](_0xfb40('0x1e'),_0x4367e3,JSON[_0xfb40('0xc')](_0x537b46));_0x397fb7(_0x537b46);})[_0xfb40('0x12')](function(_0x4c5e9e){logger[_0xfb40('0xd')]('CreateVoiceCallReport',_0x4c5e9e['message'],_0x4367e3);_0x5da170(_0x32f943[_0xfb40('0xd')](0x1f4,_0x4c5e9e['message']));});});};exports[_0xfb40('0x21')]=function(_0x2a09c9){var _0x1cfc94=this;return new Promise(function(_0x53abe6,_0x43d0a3){return db[_0xfb40('0x1f')]['update'](_0x2a09c9[_0xfb40('0x22')],{'raw':_0x2a09c9[_0xfb40('0x15')]?_0x2a09c9[_0xfb40('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a09c9[_0xfb40('0x15')]?_0x2a09c9[_0xfb40('0x15')][_0xfb40('0x17')]||null:null,'attributes':_0x2a09c9['options']?_0x2a09c9['options'][_0xfb40('0x18')]||null:null,'limit':_0x2a09c9[_0xfb40('0x15')]?_0x2a09c9[_0xfb40('0x15')]['limit']||null:null})['then'](function(_0x37003a){logger[_0xfb40('0x9')]('UpdateVoiceCallReport',_0x2a09c9);logger[_0xfb40('0x1d')](_0xfb40('0x21'),_0x2a09c9,JSON[_0xfb40('0xc')](_0x37003a));_0x53abe6(_0x37003a);})['catch'](function(_0x57f52a){logger['error'](_0xfb40('0x21'),_0x57f52a[_0xfb40('0xf')],_0x2a09c9);_0x43d0a3(_0x1cfc94[_0xfb40('0xd')](0x1f4,_0x57f52a[_0xfb40('0xf')]));});});}; \ No newline at end of file +var _0xefde=['GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','VoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceCallReport,\x20%s,\x20%s','info','result'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xefde,0x143));var _0xeefd=function(_0x3610c9,_0x209072){_0x3610c9=_0x3610c9-0x0;var _0x27af85=_0xefde[_0x3610c9];return _0x27af85;};'use strict';var _=require(_0xeefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeefd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeefd('0x2'))['db'];var utils=require(_0xeefd('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xeefd('0x4'));var jayson=require(_0xeefd('0x5'));var client=jayson[_0xeefd('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x377c82,_0x1ff643,_0x81c50){return new BPromise(function(_0x477c38,_0x327ba7){return client['request'](_0x377c82,_0x81c50)[_0xeefd('0x7')](function(_0x12e26d){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x1ff643,_0xeefd('0x8'));logger[_0xeefd('0x9')](_0xeefd('0xa'),_0x1ff643,_0xeefd('0x8'),JSON[_0xeefd('0xb')](_0x12e26d));if(_0x12e26d[_0xeefd('0xc')]){if(_0x12e26d['error']['code']===0x1f4){logger[_0xeefd('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1ff643,_0x12e26d[_0xeefd('0xc')]['message']);return _0x327ba7(_0x12e26d['error'][_0xeefd('0xd')]);}logger[_0xeefd('0xc')](_0xeefd('0xe'),_0x1ff643,_0x12e26d[_0xeefd('0xc')][_0xeefd('0xd')]);return _0x477c38(_0x12e26d['error'][_0xeefd('0xd')]);}else{logger[_0xeefd('0xf')](_0xeefd('0xe'),_0x1ff643,_0xeefd('0x8'));_0x477c38(_0x12e26d[_0xeefd('0x10')][_0xeefd('0xd')]);}})['catch'](function(_0x1c51d7){logger[_0xeefd('0xc')](_0xeefd('0xe'),_0x1ff643,_0x1c51d7);_0x327ba7(_0x1c51d7);});});}exports[_0xeefd('0x11')]=function(_0x45b6a0){var _0x4e30d9=this;return new Promise(function(_0x3a24a6,_0x54eda1){return db['VoiceCallReport'][_0xeefd('0x12')]({'raw':_0x45b6a0[_0xeefd('0x13')]?_0x45b6a0[_0xeefd('0x13')][_0xeefd('0x14')]===undefined?!![]:![]:!![],'where':_0x45b6a0[_0xeefd('0x13')]?_0x45b6a0[_0xeefd('0x13')][_0xeefd('0x15')]||null:null,'attributes':_0x45b6a0[_0xeefd('0x13')]?_0x45b6a0[_0xeefd('0x13')][_0xeefd('0x16')]||null:null,'limit':_0x45b6a0[_0xeefd('0x13')]?_0x45b6a0[_0xeefd('0x13')][_0xeefd('0x17')]||null:null,'include':_0x45b6a0[_0xeefd('0x13')]?_0x45b6a0[_0xeefd('0x13')][_0xeefd('0x18')]?_[_0xeefd('0x19')](_0x45b6a0[_0xeefd('0x13')][_0xeefd('0x18')],function(_0x1d347c){return{'model':db[_0x1d347c[_0xeefd('0x1a')]],'as':_0x1d347c['as'],'attributes':_0x1d347c[_0xeefd('0x16')],'include':_0x1d347c['include']?_[_0xeefd('0x19')](_0x1d347c[_0xeefd('0x18')],function(_0x22a223){return{'model':db[_0x22a223[_0xeefd('0x1a')]],'as':_0x22a223['as'],'attributes':_0x22a223[_0xeefd('0x16')],'include':_0x22a223[_0xeefd('0x18')]?_[_0xeefd('0x19')](_0x22a223['include'],function(_0x807f4c){return{'model':db[_0x807f4c[_0xeefd('0x1a')]],'as':_0x807f4c['as'],'attributes':_0x807f4c[_0xeefd('0x16')]};}):[]};}):[]};}):[]:[]})[_0xeefd('0x7')](function(_0x2f6e60){logger['info'](_0xeefd('0x11'),_0x45b6a0);logger['debug'](_0xeefd('0x11'),_0x45b6a0,JSON[_0xeefd('0xb')](_0x2f6e60));_0x3a24a6(_0x2f6e60);})[_0xeefd('0x1b')](function(_0x366d28){logger[_0xeefd('0xc')](_0xeefd('0x11'),_0x366d28[_0xeefd('0xd')],_0x45b6a0);_0x54eda1(_0x4e30d9[_0xeefd('0xc')](0x1f4,_0x366d28['message']));});});};exports['CreateVoiceCallReport']=function(_0x47e91e){var _0x3f8b8c=this;return new Promise(function(_0x4e8a52,_0x17074a){return db[_0xeefd('0x1c')][_0xeefd('0x1d')](_0x47e91e[_0xeefd('0x1e')],{'raw':_0x47e91e[_0xeefd('0x13')]?_0x47e91e[_0xeefd('0x13')][_0xeefd('0x14')]===undefined?!![]:![]:!![]})[_0xeefd('0x7')](function(_0x25fde2){logger[_0xeefd('0xf')](_0xeefd('0x1f'),_0x47e91e);logger[_0xeefd('0x9')]('CreateVoiceCallReport',_0x47e91e,JSON[_0xeefd('0xb')](_0x25fde2));_0x4e8a52(_0x25fde2);})['catch'](function(_0x3fd4c0){logger['error'](_0xeefd('0x1f'),_0x3fd4c0[_0xeefd('0xd')],_0x47e91e);_0x17074a(_0x3f8b8c[_0xeefd('0xc')](0x1f4,_0x3fd4c0[_0xeefd('0xd')]));});});};exports[_0xeefd('0x20')]=function(_0x511b86){var _0x40f9d9=this;return new Promise(function(_0x427d20,_0x19772f){return db[_0xeefd('0x1c')][_0xeefd('0x21')](_0x511b86[_0xeefd('0x1e')],{'raw':_0x511b86[_0xeefd('0x13')]?_0x511b86[_0xeefd('0x13')][_0xeefd('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x511b86[_0xeefd('0x13')]?_0x511b86[_0xeefd('0x13')][_0xeefd('0x15')]||null:null,'attributes':_0x511b86[_0xeefd('0x13')]?_0x511b86[_0xeefd('0x13')]['attributes']||null:null,'limit':_0x511b86['options']?_0x511b86[_0xeefd('0x13')][_0xeefd('0x17')]||null:null})['then'](function(_0x501147){logger[_0xeefd('0xf')](_0xeefd('0x20'),_0x511b86);logger['debug'](_0xeefd('0x20'),_0x511b86,JSON[_0xeefd('0xb')](_0x501147));_0x427d20(_0x501147);})[_0xeefd('0x1b')](function(_0x5635d9){logger[_0xeefd('0xc')](_0xeefd('0x20'),_0x5635d9[_0xeefd('0xd')],_0x511b86);_0x19772f(_0x40f9d9[_0xeefd('0xc')](0x1f4,_0x5635d9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index b170665..7b633fa 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 _0x2fbc=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x322306,_0x31fc80){var _0x4f9152=function(_0x565bbf){while(--_0x565bbf){_0x322306['push'](_0x322306['shift']());}};_0x4f9152(++_0x31fc80);}(_0x2fbc,0x75));var _0xc2fb=function(_0x4ea491,_0x24e7d4){_0x4ea491=_0x4ea491-0x0;var _0x2d95fd=_0x2fbc[_0x4ea491];return _0x2d95fd;};'use strict';var multer=require(_0xc2fb('0x0'));var util=require(_0xc2fb('0x1'));var path=require('path');var timeout=require(_0xc2fb('0x2'));var express=require(_0xc2fb('0x3'));var router=express['Router']();var fs_extra=require(_0xc2fb('0x4'));var auth=require(_0xc2fb('0x5'));var interaction=require(_0xc2fb('0x6'));var config=require(_0xc2fb('0x7'));var controller=require(_0xc2fb('0x8'));router[_0xc2fb('0x9')]('/',auth[_0xc2fb('0xa')](),controller[_0xc2fb('0xb')]);router['get'](_0xc2fb('0xc'),auth[_0xc2fb('0xa')](),controller[_0xc2fb('0xd')]);router[_0xc2fb('0xe')]('/',auth[_0xc2fb('0xa')](),controller[_0xc2fb('0xf')]);router[_0xc2fb('0x10')]('/:id',auth[_0xc2fb('0xa')](),controller[_0xc2fb('0x11')]);router[_0xc2fb('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc2fb('0x13')]=router; \ No newline at end of file +var _0x8e44=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0xf0f7ba,_0x48be70){var _0x44382c=function(_0x5b746c){while(--_0x5b746c){_0xf0f7ba['push'](_0xf0f7ba['shift']());}};_0x44382c(++_0x48be70);}(_0x8e44,0xe6));var _0x48e4=function(_0x9571f9,_0x5a7460){_0x9571f9=_0x9571f9-0x0;var _0x5cd19b=_0x8e44[_0x9571f9];return _0x5cd19b;};'use strict';var multer=require(_0x48e4('0x0'));var util=require(_0x48e4('0x1'));var path=require('path');var timeout=require(_0x48e4('0x2'));var express=require(_0x48e4('0x3'));var router=express[_0x48e4('0x4')]();var fs_extra=require(_0x48e4('0x5'));var auth=require(_0x48e4('0x6'));var interaction=require(_0x48e4('0x7'));var config=require(_0x48e4('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x48e4('0x9')]('/',auth[_0x48e4('0xa')](),controller['index']);router[_0x48e4('0x9')](_0x48e4('0xb'),auth['isAuthenticated'](),controller[_0x48e4('0xc')]);router[_0x48e4('0xd')]('/',auth[_0x48e4('0xa')](),controller[_0x48e4('0xe')]);router[_0x48e4('0xf')](_0x48e4('0xb'),auth['isAuthenticated'](),controller[_0x48e4('0x10')]);router['delete'](_0x48e4('0xb'),auth[_0x48e4('0xa')](),controller[_0x48e4('0x11')]);module[_0x48e4('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3a50ca5..a8ce196 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 _0x8484=['BOOLEAN','sequelize','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8484,0x184));var _0x4848=function(_0x3b2cf1,_0x30990c){_0x3b2cf1=_0x3b2cf1-0x0;var _0x1b21fc=_0x8484[_0x3b2cf1];return _0x1b21fc;};'use strict';var Sequelize=require(_0x4848('0x0'));module['exports']={'name':{'type':Sequelize[_0x4848('0x1')]},'prefix':{'type':Sequelize[_0x4848('0x1')],'unique':_0x4848('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x4848('0x1')],'set':function(_0x32ce94){this[_0x4848('0x3')](_0x4848('0x4'),_0x32ce94?_0x32ce94[_0x4848('0x5')](''):[]);},'get':function(){return this[_0x4848('0x6')](_0x4848('0x4'))?this[_0x4848('0x6')](_0x4848('0x4'))[_0x4848('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x4848('0x1')]},'record':{'type':Sequelize[_0x4848('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4848('0x1')]},'description':{'type':Sequelize[_0x4848('0x1')]}}; \ No newline at end of file +var _0x5dc5=['exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN'];(function(_0x5e8350,_0x37e282){var _0x4daa1b=function(_0x137c19){while(--_0x137c19){_0x5e8350['push'](_0x5e8350['shift']());}};_0x4daa1b(++_0x37e282);}(_0x5dc5,0x105));var _0x55dc=function(_0x32499f,_0x122c45){_0x32499f=_0x32499f-0x0;var _0x12b323=_0x5dc5[_0x32499f];return _0x12b323;};'use strict';var Sequelize=require('sequelize');module[_0x55dc('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x55dc('0x1')],'unique':_0x55dc('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x115598){this[_0x55dc('0x3')](_0x55dc('0x4'),_0x115598?_0x115598[_0x55dc('0x5')](''):[]);},'get':function(){return this[_0x55dc('0x6')](_0x55dc('0x4'))?this[_0x55dc('0x6')](_0x55dc('0x4'))[_0x55dc('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x55dc('0x1')]},'record':{'type':Sequelize[_0x55dc('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x55dc('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 467a4b1..f987664 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 _0x2f38=['request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','ChanSpies','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoiceChanSpy','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','fast-json-patch'];(function(_0x1e473e,_0x5c7afe){var _0x6ab232=function(_0xcb468f){while(--_0xcb468f){_0x1e473e['push'](_0x1e473e['shift']());}};_0x6ab232(++_0x5c7afe);}(_0x2f38,0x1a7));var _0x82f3=function(_0x592203,_0x52d106){_0x592203=_0x592203-0x0;var _0x4e38b9=_0x2f38[_0x592203];return _0x4e38b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82f3('0x1'));var rp=require(_0x82f3('0x2'));var moment=require(_0x82f3('0x3'));var BPromise=require(_0x82f3('0x4'));var Mustache=require(_0x82f3('0x5'));var util=require(_0x82f3('0x6'));var path=require('path');var sox=require(_0x82f3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82f3('0x8'));var _=require(_0x82f3('0x9'));var squel=require(_0x82f3('0xa'));var crypto=require(_0x82f3('0xb'));var jsforce=require(_0x82f3('0xc'));var deskjs=require(_0x82f3('0xd'));var toCsv=require(_0x82f3('0xe'));var querystring=require(_0x82f3('0xf'));var Papa=require(_0x82f3('0x10'));var Redis=require(_0x82f3('0x11'));var authService=require(_0x82f3('0x12'));var qs=require(_0x82f3('0x13'));var as=require(_0x82f3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x82f3('0x15'))(_0x82f3('0x16'));var utils=require(_0x82f3('0x17'));var config=require(_0x82f3('0x18'));var licenseUtil=require(_0x82f3('0x19'));var db=require(_0x82f3('0x1a'))['db'];function respondWithStatusCode(_0x34333c,_0x52a044){_0x52a044=_0x52a044||0xcc;return function(_0x561868){if(_0x561868){return _0x34333c[_0x82f3('0x1b')](_0x52a044);}return _0x34333c[_0x82f3('0x1c')](_0x52a044)['end']();};}function respondWithResult(_0x18d4b5,_0x2cca50){_0x2cca50=_0x2cca50||0xc8;return function(_0x3d34b2){if(_0x3d34b2){return _0x18d4b5[_0x82f3('0x1c')](_0x2cca50)[_0x82f3('0x1d')](_0x3d34b2);}};}function respondWithFilteredResult(_0x40df3d,_0x4ad50f){return function(_0x2621ae){if(_0x2621ae){var _0x2cafd6=typeof _0x4ad50f[_0x82f3('0x1e')]===_0x82f3('0x1f')&&typeof _0x4ad50f[_0x82f3('0x20')]===_0x82f3('0x1f');var _0x4ad7c3=_0x2621ae['count'];var _0x2a06bf=_0x2cafd6?0x0:_0x4ad50f[_0x82f3('0x1e')];var _0x15c508=_0x2cafd6?_0x2621ae[_0x82f3('0x21')]:_0x4ad50f[_0x82f3('0x1e')]+_0x4ad50f[_0x82f3('0x20')];var _0x571804;if(_0x15c508>=_0x4ad7c3){_0x15c508=_0x4ad7c3;_0x571804=0xc8;}else{_0x571804=0xce;}_0x40df3d['status'](_0x571804);return _0x40df3d[_0x82f3('0x22')](_0x82f3('0x23'),_0x2a06bf+'-'+_0x15c508+'/'+_0x4ad7c3)['json'](_0x2621ae);}return null;};}function patchUpdates(_0x5d1120){return function(_0xe0c596){try{jsonpatch[_0x82f3('0x24')](_0xe0c596,_0x5d1120,!![]);}catch(_0x2ea839){return BPromise[_0x82f3('0x25')](_0x2ea839);}return _0xe0c596[_0x82f3('0x26')]();};}function saveUpdates(_0x115b92,_0x25f3b8){return function(_0x11d076){if(_0x11d076){return _0x11d076['update'](_0x115b92)[_0x82f3('0x27')](function(_0xd4ff59){return _0xd4ff59;});}return null;};}function removeEntity(_0x5ddf8c,_0x5a5070){return function(_0x2144a7){if(_0x2144a7){return _0x2144a7['destroy']()[_0x82f3('0x27')](function(){var _0x42344c=_0x2144a7[_0x82f3('0x28')]({'plain':!![]});var _0x4d861b=_0x82f3('0x29');return db[_0x82f3('0x2a')][_0x82f3('0x2b')]({'where':{'type':_0x4d861b,'resourceId':_0x42344c['id']}})[_0x82f3('0x27')](function(){return _0x2144a7;});})[_0x82f3('0x27')](function(){_0x5ddf8c['status'](0xcc)[_0x82f3('0x2c')]();});}};}function handleEntityNotFound(_0x3c8980,_0xd09d09){return function(_0x4fe4ca){if(!_0x4fe4ca){_0x3c8980[_0x82f3('0x1b')](0x194);}return _0x4fe4ca;};}function handleError(_0x411ccc,_0x32dccc){_0x32dccc=_0x32dccc||0x1f4;return function(_0x2352ab){logger[_0x82f3('0x2d')](_0x2352ab[_0x82f3('0x2e')]);if(_0x2352ab[_0x82f3('0x2f')]){delete _0x2352ab[_0x82f3('0x2f')];}_0x411ccc[_0x82f3('0x1c')](_0x32dccc)[_0x82f3('0x30')](_0x2352ab);};}exports[_0x82f3('0x31')]=function(_0x365630,_0x20442f){var _0x1b0f43={},_0x398b36={},_0x447636={'count':0x0,'rows':[]};var _0x1c28a6=_[_0x82f3('0x32')](db[_0x82f3('0x33')]['rawAttributes'],function(_0x29a715){return{'name':_0x29a715['fieldName'],'type':_0x29a715[_0x82f3('0x34')][_0x82f3('0x35')]};});_0x398b36[_0x82f3('0x36')]=_[_0x82f3('0x32')](_0x1c28a6,_0x82f3('0x2f'));_0x398b36['query']=_[_0x82f3('0x37')](_0x365630[_0x82f3('0x38')]);_0x398b36[_0x82f3('0x39')]=_[_0x82f3('0x3a')](_0x398b36[_0x82f3('0x36')],_0x398b36['query']);_0x1b0f43[_0x82f3('0x3b')]=_['intersection'](_0x398b36[_0x82f3('0x36')],qs['fields'](_0x365630[_0x82f3('0x38')][_0x82f3('0x3c')]));_0x1b0f43[_0x82f3('0x3b')]=_0x1b0f43['attributes']['length']?_0x1b0f43['attributes']:_0x398b36[_0x82f3('0x36')];if(!_0x365630[_0x82f3('0x38')][_0x82f3('0x3d')](_0x82f3('0x3e'))){_0x1b0f43[_0x82f3('0x20')]=qs[_0x82f3('0x20')](_0x365630[_0x82f3('0x38')][_0x82f3('0x20')]);_0x1b0f43['offset']=qs[_0x82f3('0x1e')](_0x365630[_0x82f3('0x38')][_0x82f3('0x1e')]);}_0x1b0f43['order']=qs[_0x82f3('0x3f')](_0x365630[_0x82f3('0x38')][_0x82f3('0x3f')]);_0x1b0f43[_0x82f3('0x40')]=qs['filters'](_[_0x82f3('0x41')](_0x365630[_0x82f3('0x38')],_0x398b36['filters']),_0x1c28a6);if(_0x365630[_0x82f3('0x38')]['filter']){_0x1b0f43[_0x82f3('0x40')]=_[_0x82f3('0x42')](_0x1b0f43[_0x82f3('0x40')],{'$or':_[_0x82f3('0x32')](_0x1c28a6,function(_0xe07b69){if(_0xe07b69[_0x82f3('0x34')]!==_0x82f3('0x43')){var _0x3e6cb5={};_0x3e6cb5[_0xe07b69['name']]={'$like':'%'+_0x365630[_0x82f3('0x38')]['filter']+'%'};return _0x3e6cb5;}})});}_0x1b0f43=_['merge']({},_0x1b0f43,_0x365630[_0x82f3('0x44')]);var _0x15492a={'where':_0x1b0f43[_0x82f3('0x40')]};return db['VoiceChanSpy'][_0x82f3('0x21')](_0x15492a)[_0x82f3('0x27')](function(_0x13e177){_0x447636[_0x82f3('0x21')]=_0x13e177;if(_0x365630[_0x82f3('0x38')]['includeAll']){_0x1b0f43[_0x82f3('0x45')]=[{'all':!![]}];}return db[_0x82f3('0x33')][_0x82f3('0x46')](_0x1b0f43);})[_0x82f3('0x27')](function(_0x1cc602){_0x447636[_0x82f3('0x47')]=_0x1cc602;return _0x447636;})[_0x82f3('0x27')](respondWithFilteredResult(_0x20442f,_0x1b0f43))[_0x82f3('0x48')](handleError(_0x20442f,null));};exports[_0x82f3('0x49')]=function(_0x4d1f50,_0x30e656){var _0xc1723b={'raw':![],'where':{'id':_0x4d1f50['params']['id']}},_0x271923={};_0x271923[_0x82f3('0x36')]=_[_0x82f3('0x37')](db[_0x82f3('0x33')][_0x82f3('0x4a')]);_0x271923['query']=_[_0x82f3('0x37')](_0x4d1f50[_0x82f3('0x38')]);_0x271923['filters']=_[_0x82f3('0x3a')](_0x271923['model'],_0x271923[_0x82f3('0x38')]);_0xc1723b[_0x82f3('0x3b')]=_[_0x82f3('0x3a')](_0x271923[_0x82f3('0x36')],qs[_0x82f3('0x3c')](_0x4d1f50[_0x82f3('0x38')][_0x82f3('0x3c')]));_0xc1723b[_0x82f3('0x3b')]=_0xc1723b[_0x82f3('0x3b')][_0x82f3('0x4b')]?_0xc1723b[_0x82f3('0x3b')]:_0x271923[_0x82f3('0x36')];if(_0x4d1f50[_0x82f3('0x38')][_0x82f3('0x4c')]){_0xc1723b[_0x82f3('0x45')]=[{'all':!![]}];}_0xc1723b=_[_0x82f3('0x42')]({},_0xc1723b,_0x4d1f50['options']);return db['VoiceChanSpy']['find'](_0xc1723b)['then'](handleEntityNotFound(_0x30e656,null))['then'](respondWithResult(_0x30e656,null))['catch'](handleError(_0x30e656,null));};exports['create']=function(_0x3d7be3,_0xe1634b){return db[_0x82f3('0x33')]['create'](_0x3d7be3[_0x82f3('0x4d')],{})[_0x82f3('0x27')](function(_0x3a1773){var _0x45f8a6=_0x3d7be3[_0x82f3('0x4e')][_0x82f3('0x28')]({'plain':!![]});if(!_0x45f8a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45f8a6[_0x82f3('0x4f')]===_0x82f3('0x4e')){var _0x3a578b=_0x3a1773['get']({'plain':!![]});var _0x381630=_0x82f3('0x29');return db[_0x82f3('0x50')]['find']({'where':{'name':_0x381630,'userProfileId':_0x45f8a6[_0x82f3('0x51')]},'raw':!![]})[_0x82f3('0x27')](function(_0x3a2160){if(_0x3a2160&&_0x3a2160[_0x82f3('0x52')]===0x0){return db[_0x82f3('0x2a')]['create']({'name':_0x3a578b[_0x82f3('0x2f')],'resourceId':_0x3a578b['id'],'type':_0x3a2160[_0x82f3('0x2f')],'sectionId':_0x3a2160['id']},{})[_0x82f3('0x27')](function(){return _0x3a1773;});}else{return _0x3a1773;}})[_0x82f3('0x48')](function(_0x116356){logger[_0x82f3('0x2d')](_0x82f3('0x53'),_0x116356);throw _0x116356;});}return _0x3a1773;})[_0x82f3('0x27')](respondWithResult(_0xe1634b,0xc9))[_0x82f3('0x48')](handleError(_0xe1634b,null));};exports['update']=function(_0x2549ad,_0x1557ae){if(_0x2549ad[_0x82f3('0x4d')]['id']){delete _0x2549ad[_0x82f3('0x4d')]['id'];}return db[_0x82f3('0x33')]['find']({'where':{'id':_0x2549ad[_0x82f3('0x54')]['id']}})[_0x82f3('0x27')](handleEntityNotFound(_0x1557ae,null))[_0x82f3('0x27')](saveUpdates(_0x2549ad['body'],null))[_0x82f3('0x27')](respondWithResult(_0x1557ae,null))[_0x82f3('0x48')](handleError(_0x1557ae,null));};exports[_0x82f3('0x2b')]=function(_0x55085d,_0x150a67){return db[_0x82f3('0x33')]['find']({'where':{'id':_0x55085d[_0x82f3('0x54')]['id']}})[_0x82f3('0x27')](handleEntityNotFound(_0x150a67,null))[_0x82f3('0x27')](removeEntity(_0x150a67,null))[_0x82f3('0x48')](handleError(_0x150a67,null));}; \ No newline at end of file +var _0x6931=['params','eml-format','rimraf','request-promise','moment','bluebird','util','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','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','name','index','map','VoiceChanSpy','type','key','keys','query','filters','intersection','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','attributes','fields','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x439774,_0xcac95f){var _0x4ff486=function(_0x2b4545){while(--_0x2b4545){_0x439774['push'](_0x439774['shift']());}};_0x4ff486(++_0xcac95f);}(_0x6931,0xa5));var _0x1693=function(_0x3c70dc,_0x8faa3d){_0x3c70dc=_0x3c70dc-0x0;var _0x40a7f7=_0x6931[_0x3c70dc];return _0x40a7f7;};'use strict';var emlformat=require(_0x1693('0x0'));var rimraf=require(_0x1693('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1693('0x2'));var moment=require(_0x1693('0x3'));var BPromise=require(_0x1693('0x4'));var Mustache=require('mustache');var util=require(_0x1693('0x5'));var path=require(_0x1693('0x6'));var sox=require(_0x1693('0x7'));var csv=require('to-csv');var ejs=require(_0x1693('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1693('0x9'));var squel=require(_0x1693('0xa'));var crypto=require(_0x1693('0xb'));var jsforce=require(_0x1693('0xc'));var deskjs=require(_0x1693('0xd'));var toCsv=require(_0x1693('0xe'));var querystring=require(_0x1693('0xf'));var Papa=require(_0x1693('0x10'));var Redis=require(_0x1693('0x11'));var authService=require(_0x1693('0x12'));var qs=require(_0x1693('0x13'));var as=require(_0x1693('0x14'));var hardwareService=require(_0x1693('0x15'));var logger=require(_0x1693('0x16'))(_0x1693('0x17'));var utils=require(_0x1693('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1693('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c34d1,_0x25d9fb){_0x25d9fb=_0x25d9fb||0xcc;return function(_0x541657){if(_0x541657){return _0x2c34d1[_0x1693('0x1a')](_0x25d9fb);}return _0x2c34d1[_0x1693('0x1b')](_0x25d9fb)[_0x1693('0x1c')]();};}function respondWithResult(_0x517e4a,_0x418da9){_0x418da9=_0x418da9||0xc8;return function(_0x35814f){if(_0x35814f){return _0x517e4a[_0x1693('0x1b')](_0x418da9)[_0x1693('0x1d')](_0x35814f);}};}function respondWithFilteredResult(_0x24f7f8,_0x11fc25){return function(_0x4313f1){if(_0x4313f1){var _0x3ac840=typeof _0x11fc25[_0x1693('0x1e')]===_0x1693('0x1f')&&typeof _0x11fc25['limit']===_0x1693('0x1f');var _0x56739d=_0x4313f1[_0x1693('0x20')];var _0x20906b=_0x3ac840?0x0:_0x11fc25[_0x1693('0x1e')];var _0x410c3b=_0x3ac840?_0x4313f1[_0x1693('0x20')]:_0x11fc25[_0x1693('0x1e')]+_0x11fc25[_0x1693('0x21')];var _0x3afc96;if(_0x410c3b>=_0x56739d){_0x410c3b=_0x56739d;_0x3afc96=0xc8;}else{_0x3afc96=0xce;}_0x24f7f8[_0x1693('0x1b')](_0x3afc96);return _0x24f7f8[_0x1693('0x22')](_0x1693('0x23'),_0x20906b+'-'+_0x410c3b+'/'+_0x56739d)[_0x1693('0x1d')](_0x4313f1);}return null;};}function patchUpdates(_0x17c613){return function(_0x3fe732){try{jsonpatch[_0x1693('0x24')](_0x3fe732,_0x17c613,!![]);}catch(_0xfe3ad3){return BPromise['reject'](_0xfe3ad3);}return _0x3fe732[_0x1693('0x25')]();};}function saveUpdates(_0x27ecde,_0x5332ae){return function(_0x28bbc6){if(_0x28bbc6){return _0x28bbc6[_0x1693('0x26')](_0x27ecde)[_0x1693('0x27')](function(_0x1309ac){return _0x1309ac;});}return null;};}function removeEntity(_0xff18f,_0x588ebe){return function(_0x28749b){if(_0x28749b){return _0x28749b[_0x1693('0x28')]()[_0x1693('0x27')](function(){var _0x4e5d82=_0x28749b[_0x1693('0x29')]({'plain':!![]});var _0x28a1cc='ChanSpies';return db[_0x1693('0x2a')][_0x1693('0x28')]({'where':{'type':_0x28a1cc,'resourceId':_0x4e5d82['id']}})['then'](function(){return _0x28749b;});})['then'](function(){_0xff18f['status'](0xcc)[_0x1693('0x1c')]();});}};}function handleEntityNotFound(_0x54617a,_0xd92bb6){return function(_0x3ee757){if(!_0x3ee757){_0x54617a[_0x1693('0x1a')](0x194);}return _0x3ee757;};}function handleError(_0x2226a2,_0x58e601){_0x58e601=_0x58e601||0x1f4;return function(_0x1b3354){logger[_0x1693('0x2b')](_0x1b3354['stack']);if(_0x1b3354[_0x1693('0x2c')]){delete _0x1b3354[_0x1693('0x2c')];}_0x2226a2[_0x1693('0x1b')](_0x58e601)['send'](_0x1b3354);};}exports[_0x1693('0x2d')]=function(_0x1655b5,_0x33ecf5){var _0x85bd1f={},_0x11fa1d={},_0x46c281={'count':0x0,'rows':[]};var _0x160708=_[_0x1693('0x2e')](db[_0x1693('0x2f')]['rawAttributes'],function(_0x54c0ce){return{'name':_0x54c0ce['fieldName'],'type':_0x54c0ce[_0x1693('0x30')][_0x1693('0x31')]};});_0x11fa1d['model']=_[_0x1693('0x2e')](_0x160708,_0x1693('0x2c'));_0x11fa1d['query']=_[_0x1693('0x32')](_0x1655b5[_0x1693('0x33')]);_0x11fa1d[_0x1693('0x34')]=_[_0x1693('0x35')](_0x11fa1d['model'],_0x11fa1d[_0x1693('0x33')]);_0x85bd1f['attributes']=_[_0x1693('0x35')](_0x11fa1d[_0x1693('0x36')],qs['fields'](_0x1655b5[_0x1693('0x33')]['fields']));_0x85bd1f['attributes']=_0x85bd1f['attributes']['length']?_0x85bd1f['attributes']:_0x11fa1d[_0x1693('0x36')];if(!_0x1655b5[_0x1693('0x33')][_0x1693('0x37')]('nolimit')){_0x85bd1f[_0x1693('0x21')]=qs[_0x1693('0x21')](_0x1655b5[_0x1693('0x33')][_0x1693('0x21')]);_0x85bd1f[_0x1693('0x1e')]=qs[_0x1693('0x1e')](_0x1655b5['query'][_0x1693('0x1e')]);}_0x85bd1f[_0x1693('0x38')]=qs[_0x1693('0x39')](_0x1655b5[_0x1693('0x33')]['sort']);_0x85bd1f[_0x1693('0x3a')]=qs['filters'](_[_0x1693('0x3b')](_0x1655b5[_0x1693('0x33')],_0x11fa1d[_0x1693('0x34')]),_0x160708);if(_0x1655b5[_0x1693('0x33')][_0x1693('0x3c')]){_0x85bd1f[_0x1693('0x3a')]=_[_0x1693('0x3d')](_0x85bd1f[_0x1693('0x3a')],{'$or':_['map'](_0x160708,function(_0x4f09ad){if(_0x4f09ad[_0x1693('0x30')]!==_0x1693('0x3e')){var _0x4a1871={};_0x4a1871[_0x4f09ad[_0x1693('0x2c')]]={'$like':'%'+_0x1655b5[_0x1693('0x33')][_0x1693('0x3c')]+'%'};return _0x4a1871;}})});}_0x85bd1f=_[_0x1693('0x3d')]({},_0x85bd1f,_0x1655b5[_0x1693('0x3f')]);var _0x573880={'where':_0x85bd1f[_0x1693('0x3a')]};return db[_0x1693('0x2f')]['count'](_0x573880)[_0x1693('0x27')](function(_0x287272){_0x46c281[_0x1693('0x20')]=_0x287272;if(_0x1655b5[_0x1693('0x33')][_0x1693('0x40')]){_0x85bd1f['include']=[{'all':!![]}];}return db[_0x1693('0x2f')][_0x1693('0x41')](_0x85bd1f);})[_0x1693('0x27')](function(_0x1ca464){_0x46c281[_0x1693('0x42')]=_0x1ca464;return _0x46c281;})[_0x1693('0x27')](respondWithFilteredResult(_0x33ecf5,_0x85bd1f))['catch'](handleError(_0x33ecf5,null));};exports[_0x1693('0x43')]=function(_0x44925e,_0x41400d){var _0x1479d9={'raw':![],'where':{'id':_0x44925e['params']['id']}},_0x597293={};_0x597293[_0x1693('0x36')]=_[_0x1693('0x32')](db[_0x1693('0x2f')]['rawAttributes']);_0x597293[_0x1693('0x33')]=_[_0x1693('0x32')](_0x44925e[_0x1693('0x33')]);_0x597293[_0x1693('0x34')]=_[_0x1693('0x35')](_0x597293['model'],_0x597293[_0x1693('0x33')]);_0x1479d9[_0x1693('0x44')]=_['intersection'](_0x597293[_0x1693('0x36')],qs[_0x1693('0x45')](_0x44925e[_0x1693('0x33')][_0x1693('0x45')]));_0x1479d9[_0x1693('0x44')]=_0x1479d9['attributes'][_0x1693('0x46')]?_0x1479d9['attributes']:_0x597293[_0x1693('0x36')];if(_0x44925e[_0x1693('0x33')][_0x1693('0x40')]){_0x1479d9[_0x1693('0x47')]=[{'all':!![]}];}_0x1479d9=_[_0x1693('0x3d')]({},_0x1479d9,_0x44925e[_0x1693('0x3f')]);return db[_0x1693('0x2f')][_0x1693('0x48')](_0x1479d9)[_0x1693('0x27')](handleEntityNotFound(_0x41400d,null))['then'](respondWithResult(_0x41400d,null))['catch'](handleError(_0x41400d,null));};exports['create']=function(_0x7d723a,_0x36b9f1){return db['VoiceChanSpy'][_0x1693('0x49')](_0x7d723a['body'],{})[_0x1693('0x27')](function(_0x342ebd){var _0x1439e8=_0x7d723a[_0x1693('0x4a')][_0x1693('0x29')]({'plain':!![]});if(!_0x1439e8)throw new Error(_0x1693('0x4b'));if(_0x1439e8['role']===_0x1693('0x4a')){var _0xb4406d=_0x342ebd['get']({'plain':!![]});var _0x231101='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x231101,'userProfileId':_0x1439e8[_0x1693('0x4c')]},'raw':!![]})[_0x1693('0x27')](function(_0x401f28){if(_0x401f28&&_0x401f28[_0x1693('0x4d')]===0x0){return db['UserProfileResource'][_0x1693('0x49')]({'name':_0xb4406d[_0x1693('0x2c')],'resourceId':_0xb4406d['id'],'type':_0x401f28[_0x1693('0x2c')],'sectionId':_0x401f28['id']},{})['then'](function(){return _0x342ebd;});}else{return _0x342ebd;}})[_0x1693('0x4e')](function(_0x460e39){logger[_0x1693('0x2b')](_0x1693('0x4f'),_0x460e39);throw _0x460e39;});}return _0x342ebd;})[_0x1693('0x27')](respondWithResult(_0x36b9f1,0xc9))[_0x1693('0x4e')](handleError(_0x36b9f1,null));};exports[_0x1693('0x26')]=function(_0xcc9619,_0x53c73b){if(_0xcc9619[_0x1693('0x50')]['id']){delete _0xcc9619[_0x1693('0x50')]['id'];}return db['VoiceChanSpy'][_0x1693('0x48')]({'where':{'id':_0xcc9619[_0x1693('0x51')]['id']}})[_0x1693('0x27')](handleEntityNotFound(_0x53c73b,null))[_0x1693('0x27')](saveUpdates(_0xcc9619[_0x1693('0x50')],null))[_0x1693('0x27')](respondWithResult(_0x53c73b,null))[_0x1693('0x4e')](handleError(_0x53c73b,null));};exports[_0x1693('0x28')]=function(_0x59b73b,_0x142fd0){return db[_0x1693('0x2f')][_0x1693('0x48')]({'where':{'id':_0x59b73b[_0x1693('0x51')]['id']}})[_0x1693('0x27')](handleEntityNotFound(_0x142fd0,null))[_0x1693('0x27')](removeEntity(_0x142fd0,null))[_0x1693('0x4e')](handleError(_0x142fd0,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e14129b..ef6b43f 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 _0xf3e3=['chanspy','record','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','then','exports','models','define','VoiceExtension','bulkCreate','catch','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','Set','CDR(type)=%s'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf3e3,0xb3));var _0x3f3e=function(_0x56595f,_0x5cc021){_0x56595f=_0x56595f-0x0;var _0x3b4687=_0xf3e3[_0x56595f];return _0x3b4687;};'use strict';var _=require(_0x3f3e('0x0'));var util=require('util');var BPromise=require(_0x3f3e('0x1'));var attributes=require(_0x3f3e('0x2'));var getUserApplications=function(_0x2278f5,_0x3d8509,_0x3cbb06){var _0x3a937a=0x1;var _0x456cd4=[];var _0xf5018c={'context':_0x3d8509[_0x3f3e('0x3')]||_0x3f3e('0x4'),'exten':util[_0x3f3e('0x5')]('%s%s',_0x2278f5[_0x3f3e('0x6')],_0x3cbb06),'type':_0x3f3e('0x7'),'isApp':![],'ChanSpyId':_0x2278f5['id'],'UserId':_0x3d8509['id']};_0x456cd4[_0x3f3e('0x8')](_['merge']({'app':_0x3f3e('0x9'),'appdata':util['format'](_0x3f3e('0xa'),_0x3f3e('0xb')),'priority':_0x3a937a++},_0xf5018c));if(_0x2278f5[_0x3f3e('0xc')]){_0x456cd4['push'](_[_0x3f3e('0xd')]({'app':'MixMonitor','appdata':util['format'](_0x3f3e('0xe'),_0x2278f5[_0x3f3e('0xf')]),'priority':_0x3a937a++},_0xf5018c));}if(_0x2278f5[_0x3f3e('0x10')]){_0x456cd4[_0x3f3e('0x8')](_['merge']({'app':_0x3f3e('0x11'),'appdata':_0x2278f5[_0x3f3e('0x12')],'priority':_0x3a937a++},_0xf5018c));}_0x456cd4[_0x3f3e('0x8')](_[_0x3f3e('0xd')]({'app':_0x3f3e('0x13'),'appdata':util['format'](_0x3f3e('0x14'),_0x3d8509[_0x3f3e('0x15')],_0x2278f5[_0x3f3e('0x16')]?_0x2278f5['options'][_0x3f3e('0x17')](''):''),'priority':_0x3a937a++},_0xf5018c));if(_0x2278f5[_0x3f3e('0xc')]){_0x456cd4[_0x3f3e('0x8')](_[_0x3f3e('0xd')]({'app':_0x3f3e('0x18'),'priority':_0x3a937a++},_0xf5018c));}return _0x456cd4;};var getChanSpyApplications=function(_0x4e89b6,_0x3701ff){var _0x1bc4f3=[];for(var _0x11ea28=0x0,_0x401c61=0x1;_0x11ea28<_0x3701ff[_0x3f3e('0x19')];_0x11ea28++,_0x401c61=0x1){_0x1bc4f3=_0x1bc4f3[_0x3f3e('0x1a')](getUserApplications(_0x4e89b6,_0x3701ff[_0x11ea28],_0x3701ff[_0x11ea28][_0x3f3e('0x1b')]));if(_0x3701ff[_0x11ea28][_0x3f3e('0x1b')]!=_0x3701ff[_0x11ea28][_0x3f3e('0x15')]){_0x1bc4f3=_0x1bc4f3[_0x3f3e('0x1a')](getUserApplications(_0x4e89b6,_0x3701ff[_0x11ea28],_0x3701ff[_0x11ea28]['name']));}}return _0x1bc4f3;};var getChanSpyPromise=function(_0x1bcb64,_0x5197e8){return new BPromise(function(_0x34572d,_0xc3960f){return _0x1bcb64[_0x3f3e('0x1c')][_0x3f3e('0x1d')]({'attributes':['id',_0x3f3e('0x15'),_0x3f3e('0x1b')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x3f3e('0x1e')](function(_0x1fdb94){if(_0x1fdb94){return _0x34572d(getChanSpyApplications(_0x5197e8,_0x1fdb94));}return _0x34572d([]);})['catch'](function(_0x41c464){_0xc3960f(_0x41c464);});});};module[_0x3f3e('0x1f')]=function(_0x978641,_0x4036bb){var _0x487078=_0x978641[_0x3f3e('0x20')];return _0x978641[_0x3f3e('0x21')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16ba70,_0x38f29c,_0x249bf2){return getChanSpyPromise(_0x487078,_0x16ba70)[_0x3f3e('0x1e')](function(_0x6f38f0){if(_0x6f38f0&&_0x6f38f0['length']){return _0x487078[_0x3f3e('0x22')][_0x3f3e('0x23')](_0x6f38f0);}})['then'](function(){_0x249bf2();})[_0x3f3e('0x24')](function(_0x252815){_0x249bf2(_0x252815);});},'afterUpdate':function(_0x42daf1,_0x3c1bf4,_0x355fa2){return _0x487078[_0x3f3e('0x22')][_0x3f3e('0x25')]({'where':{'ChanSpyId':_0x42daf1['id']}})[_0x3f3e('0x1e')](function(){return getChanSpyPromise(_0x487078,_0x42daf1);})['then'](function(_0x543c88){if(_0x543c88&&_0x543c88[_0x3f3e('0x19')]){return _0x487078[_0x3f3e('0x22')]['bulkCreate'](_0x543c88);}})[_0x3f3e('0x1e')](function(){_0x355fa2();})[_0x3f3e('0x24')](function(_0x5ba687){_0x355fa2(_0x5ba687);});},'afterDestroy':function(_0xa91659,_0x224288,_0x3fe403){return _0x487078[_0x3f3e('0x22')][_0x3f3e('0x25')]({'where':{'ChanSpyId':_0xa91659['id']}})['then'](function(){_0x3fe403();})[_0x3f3e('0x24')](function(_0x369456){_0x3fe403(_0x369456);});}}});}; \ No newline at end of file +var _0x7909=['agent','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','context','from-sip','format','%s%s','prefix','system','push','merge','Set','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','StopMixMonitor','length','internal'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x7909,0x89));var _0x9790=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7909[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x9790('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x481faf,_0xc1d6f2,_0x2ab465){var _0x2cc0d1=0x1;var _0x3a8dd9=[];var _0x2857d0={'context':_0xc1d6f2[_0x9790('0x1')]||_0x9790('0x2'),'exten':util[_0x9790('0x3')](_0x9790('0x4'),_0x481faf[_0x9790('0x5')],_0x2ab465),'type':_0x9790('0x6'),'isApp':![],'ChanSpyId':_0x481faf['id'],'UserId':_0xc1d6f2['id']};_0x3a8dd9[_0x9790('0x7')](_[_0x9790('0x8')]({'app':_0x9790('0x9'),'appdata':util[_0x9790('0x3')]('CDR(type)=%s',_0x9790('0xa')),'priority':_0x2cc0d1++},_0x2857d0));if(_0x481faf['record']){_0x3a8dd9[_0x9790('0x7')](_['merge']({'app':_0x9790('0xb'),'appdata':util['format'](_0x9790('0xc'),_0x481faf[_0x9790('0xd')]),'priority':_0x2cc0d1++},_0x2857d0));}if(_0x481faf[_0x9790('0xe')]){_0x3a8dd9[_0x9790('0x7')](_[_0x9790('0x8')]({'app':_0x9790('0xf'),'appdata':_0x481faf[_0x9790('0x10')],'priority':_0x2cc0d1++},_0x2857d0));}_0x3a8dd9[_0x9790('0x7')](_[_0x9790('0x8')]({'app':_0x9790('0x11'),'appdata':util[_0x9790('0x3')](_0x9790('0x12'),_0xc1d6f2[_0x9790('0x13')],_0x481faf['options']?_0x481faf['options']['join'](''):''),'priority':_0x2cc0d1++},_0x2857d0));if(_0x481faf['record']){_0x3a8dd9[_0x9790('0x7')](_[_0x9790('0x8')]({'app':_0x9790('0x14'),'priority':_0x2cc0d1++},_0x2857d0));}return _0x3a8dd9;};var getChanSpyApplications=function(_0x5ed517,_0x388ca7){var _0xcd4d31=[];for(var _0x44b48b=0x0,_0x389238=0x1;_0x44b48b<_0x388ca7[_0x9790('0x15')];_0x44b48b++,_0x389238=0x1){_0xcd4d31=_0xcd4d31['concat'](getUserApplications(_0x5ed517,_0x388ca7[_0x44b48b],_0x388ca7[_0x44b48b][_0x9790('0x16')]));if(_0x388ca7[_0x44b48b]['internal']!=_0x388ca7[_0x44b48b][_0x9790('0x13')]){_0xcd4d31=_0xcd4d31['concat'](getUserApplications(_0x5ed517,_0x388ca7[_0x44b48b],_0x388ca7[_0x44b48b][_0x9790('0x13')]));}}return _0xcd4d31;};var getChanSpyPromise=function(_0x450492,_0x5a5484){return new BPromise(function(_0x5cf437,_0x5684ee){return _0x450492['User']['findAll']({'attributes':['id',_0x9790('0x13'),'internal'],'where':{'role':_0x9790('0x17'),'chanspy':!![]},'raw':!![]})[_0x9790('0x18')](function(_0x3b408e){if(_0x3b408e){return _0x5cf437(getChanSpyApplications(_0x5a5484,_0x3b408e));}return _0x5cf437([]);})[_0x9790('0x19')](function(_0x49bcc1){_0x5684ee(_0x49bcc1);});});};module[_0x9790('0x1a')]=function(_0x42e7aa,_0xd7af7a){var _0x2803f2=_0x42e7aa['models'];return _0x42e7aa['define'](_0x9790('0x1b'),attributes,{'tableName':_0x9790('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x59ec16,_0x3b1720,_0xc9d63b){return getChanSpyPromise(_0x2803f2,_0x59ec16)[_0x9790('0x18')](function(_0xc2db5b){if(_0xc2db5b&&_0xc2db5b[_0x9790('0x15')]){return _0x2803f2[_0x9790('0x1d')][_0x9790('0x1e')](_0xc2db5b);}})[_0x9790('0x18')](function(){_0xc9d63b();})[_0x9790('0x19')](function(_0x2ae2d5){_0xc9d63b(_0x2ae2d5);});},'afterUpdate':function(_0x650f52,_0x5103bd,_0xf78339){return _0x2803f2[_0x9790('0x1d')]['destroy']({'where':{'ChanSpyId':_0x650f52['id']}})[_0x9790('0x18')](function(){return getChanSpyPromise(_0x2803f2,_0x650f52);})[_0x9790('0x18')](function(_0x557159){if(_0x557159&&_0x557159[_0x9790('0x15')]){return _0x2803f2[_0x9790('0x1d')]['bulkCreate'](_0x557159);}})[_0x9790('0x18')](function(){_0xf78339();})[_0x9790('0x19')](function(_0x3d57b8){_0xf78339(_0x3d57b8);});},'afterDestroy':function(_0x546a2b,_0x26048b,_0x422d65){return _0x2803f2[_0x9790('0x1d')][_0x9790('0x1f')]({'where':{'ChanSpyId':_0x546a2b['id']}})[_0x9790('0x18')](function(){_0x422d65();})[_0x9790('0x19')](function(_0x24fb44){_0x422d65(_0x24fb44);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 23eb2f2..892162b 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 _0x180f=['result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x59a269,_0x2a4a95){var _0x559199=function(_0x366c14){while(--_0x366c14){_0x59a269['push'](_0x59a269['shift']());}};_0x559199(++_0x2a4a95);}(_0x180f,0xf3));var _0xf180=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x180f[_0x12b83d];return _0x1fd39d;};'use strict';var _=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var moment=require('moment');var BPromise=require(_0xf180('0x2'));var rs=require(_0xf180('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf180('0x4'))['db'];var utils=require(_0xf180('0x5'));var logger=require(_0xf180('0x6'))(_0xf180('0x7'));var config=require(_0xf180('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf180('0x9')][_0xf180('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x513113,_0x47d87b,_0x1d6ca7){return new BPromise(function(_0x303412,_0x342a02){return client[_0xf180('0xb')](_0x513113,_0x1d6ca7)[_0xf180('0xc')](function(_0x4390be){logger[_0xf180('0xd')](_0xf180('0xe'),_0x47d87b,_0xf180('0xf'));logger['debug'](_0xf180('0x10'),_0x47d87b,_0xf180('0xf'),JSON[_0xf180('0x11')](_0x4390be));if(_0x4390be[_0xf180('0x12')]){if(_0x4390be[_0xf180('0x12')][_0xf180('0x13')]===0x1f4){logger[_0xf180('0x12')](_0xf180('0xe'),_0x47d87b,_0x4390be[_0xf180('0x12')][_0xf180('0x14')]);return _0x342a02(_0x4390be[_0xf180('0x12')]['message']);}logger[_0xf180('0x12')](_0xf180('0xe'),_0x47d87b,_0x4390be[_0xf180('0x12')][_0xf180('0x14')]);return _0x303412(_0x4390be['error'][_0xf180('0x14')]);}else{logger[_0xf180('0xd')](_0xf180('0xe'),_0x47d87b,'request\x20sent');_0x303412(_0x4390be[_0xf180('0x15')][_0xf180('0x14')]);}})['catch'](function(_0x115b86){logger[_0xf180('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x47d87b,_0x115b86);_0x342a02(_0x115b86);});});} \ No newline at end of file +var _0x7980=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x145075,_0x202545){var _0x34bbd0=function(_0x275815){while(--_0x275815){_0x145075['push'](_0x145075['shift']());}};_0x34bbd0(++_0x202545);}(_0x7980,0xab));var _0x0798=function(_0x2ad8c6,_0x2f1975){_0x2ad8c6=_0x2ad8c6-0x0;var _0x11f93c=_0x7980[_0x2ad8c6];return _0x11f93c;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index cadad77..a45d5f0 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 _0x73c6=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0x73c6,0xb0));var _0x673c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x73c6[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x673c('0x0'));var util=require(_0x673c('0x1'));var path=require('path');var timeout=require(_0x673c('0x2'));var express=require(_0x673c('0x3'));var router=express['Router']();var fs_extra=require(_0x673c('0x4'));var auth=require(_0x673c('0x5'));var interaction=require(_0x673c('0x6'));var config=require('../../config/environment');var controller=require(_0x673c('0x7'));router[_0x673c('0x8')]('/',auth[_0x673c('0x9')](),controller[_0x673c('0xa')]);router['get'](_0x673c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x673c('0xc')]('/',auth[_0x673c('0x9')](),controller[_0x673c('0xd')]);router[_0x673c('0xe')](_0x673c('0xb'),auth[_0x673c('0x9')](),controller[_0x673c('0xf')]);router[_0x673c('0x10')](_0x673c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x673c('0x11')]=router; \ No newline at end of file +var _0x4efe=['update','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create'];(function(_0x246b48,_0x35a292){var _0x3ba4d8=function(_0x4aed5d){while(--_0x4aed5d){_0x246b48['push'](_0x246b48['shift']());}};_0x3ba4d8(++_0x35a292);}(_0x4efe,0x195));var _0xe4ef=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x4efe[_0xee3051];return _0x139e81;};'use strict';var multer=require('multer');var util=require(_0xe4ef('0x0'));var path=require(_0xe4ef('0x1'));var timeout=require('connect-timeout');var express=require(_0xe4ef('0x2'));var router=express[_0xe4ef('0x3')]();var fs_extra=require(_0xe4ef('0x4'));var auth=require(_0xe4ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe4ef('0x6'));var controller=require('./voiceContext.controller');router[_0xe4ef('0x7')]('/',auth[_0xe4ef('0x8')](),controller['index']);router[_0xe4ef('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe4ef('0x9')]);router['post']('/',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xa')]);router['put']('/:id',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xb')]);router[_0xe4ef('0xc')](_0xe4ef('0xd'),auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xe')]);module[_0xe4ef('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 8f563c9..e156fc5 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 _0xe515=['exports','STRING','name','BOOLEAN'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xe515,0xf0));var _0x5e51=function(_0x35cc8e,_0x506fa6){_0x35cc8e=_0x35cc8e-0x0;var _0x5b80f0=_0xe515[_0x35cc8e];return _0x5b80f0;};'use strict';var Sequelize=require('sequelize');module[_0x5e51('0x0')]={'name':{'type':Sequelize[_0x5e51('0x1')],'unique':_0x5e51('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5e51('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8577=['exports','name','STRING','BOOLEAN','sequelize'];(function(_0x3039fa,_0x44d432){var _0x43d24b=function(_0x519fbe){while(--_0x519fbe){_0x3039fa['push'](_0x3039fa['shift']());}};_0x43d24b(++_0x44d432);}(_0x8577,0x153));var _0x7857=function(_0x461322,_0x573961){_0x461322=_0x461322-0x0;var _0x6ca08d=_0x8577[_0x461322];return _0x6ca08d;};'use strict';var Sequelize=require(_0x7857('0x0'));module[_0x7857('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7857('0x2')},'description':{'type':Sequelize[_0x7857('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7857('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 510eb1a..63d5355 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 _0x8cfb=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','filter','where','merge','options','VoiceContext','includeAll','findAll','rows','show','params','fields','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','send'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x8cfb,0x89));var _0xb8cf=function(_0x6c8b9b,_0xc36fb5){_0x6c8b9b=_0x6c8b9b-0x0;var _0x3c9b08=_0x8cfb[_0x6c8b9b];return _0x3c9b08;};'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(_0xb8cf('0x0'));var moment=require(_0xb8cf('0x1'));var BPromise=require(_0xb8cf('0x2'));var Mustache=require('mustache');var util=require(_0xb8cf('0x3'));var path=require('path');var sox=require(_0xb8cf('0x4'));var csv=require(_0xb8cf('0x5'));var ejs=require(_0xb8cf('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8cf('0x7'));var squel=require(_0xb8cf('0x8'));var crypto=require(_0xb8cf('0x9'));var jsforce=require(_0xb8cf('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb8cf('0x5'));var querystring=require(_0xb8cf('0xb'));var Papa=require(_0xb8cf('0xc'));var Redis=require(_0xb8cf('0xd'));var authService=require(_0xb8cf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb8cf('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb8cf('0x10'));var utils=require(_0xb8cf('0x11'));var config=require(_0xb8cf('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8cf('0x13'))['db'];var jayson=require(_0xb8cf('0x14'));var client=jayson[_0xb8cf('0x15')][_0xb8cf('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x1b6401,_0x49700c,_0x530c97,_0x313a36){return new BPromise(function(_0x3f0e7b,_0x4feda8){var _0x5817af=_0x313a36||client;return _0x5817af[_0xb8cf('0x17')](_0x1b6401,_0x530c97)[_0xb8cf('0x18')](function(_0x141922){logger[_0xb8cf('0x19')](_0xb8cf('0x1a'),_0x49700c,_0xb8cf('0x1b'));logger[_0xb8cf('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x49700c,'request\x20sent',JSON[_0xb8cf('0x1d')](_0x141922));if(_0x141922[_0xb8cf('0x1e')]){if(_0x141922['error']['code']===0x1f4){logger[_0xb8cf('0x1e')](_0xb8cf('0x1a'),_0x49700c,_0x141922[_0xb8cf('0x1e')][_0xb8cf('0x1f')]);return _0x4feda8(_0x141922[_0xb8cf('0x1e')][_0xb8cf('0x1f')]);}logger[_0xb8cf('0x1e')](_0xb8cf('0x1a'),_0x49700c,_0x141922[_0xb8cf('0x1e')][_0xb8cf('0x1f')]);return _0x3f0e7b(_0x141922[_0xb8cf('0x1e')][_0xb8cf('0x1f')]);}else{logger[_0xb8cf('0x19')](_0xb8cf('0x1a'),_0x49700c,_0xb8cf('0x1b'));_0x3f0e7b(_0x141922[_0xb8cf('0x20')][_0xb8cf('0x1f')]);}})[_0xb8cf('0x21')](function(_0x5d3988){logger[_0xb8cf('0x1e')](_0xb8cf('0x1a'),_0x49700c,_0x5d3988);_0x4feda8(_0x5d3988);});});}function respondWithStatusCode(_0x847da4,_0x1b0124){_0x1b0124=_0x1b0124||0xcc;return function(_0x257906){if(_0x257906){return _0x847da4[_0xb8cf('0x22')](_0x1b0124);}return _0x847da4['status'](_0x1b0124)['end']();};}function respondWithResult(_0x3215a2,_0x81e785){_0x81e785=_0x81e785||0xc8;return function(_0x42f523){if(_0x42f523){return _0x3215a2[_0xb8cf('0x23')](_0x81e785)[_0xb8cf('0x24')](_0x42f523);}};}function respondWithFilteredResult(_0x4bc401,_0x266fca){return function(_0x3477cc){if(_0x3477cc){var _0x25b5b8=typeof _0x266fca[_0xb8cf('0x25')]==='undefined'&&typeof _0x266fca[_0xb8cf('0x26')]===_0xb8cf('0x27');var _0x492f92=_0x3477cc[_0xb8cf('0x28')];var _0x2a2be5=_0x25b5b8?0x0:_0x266fca['offset'];var _0x4087c0=_0x25b5b8?_0x3477cc[_0xb8cf('0x28')]:_0x266fca['offset']+_0x266fca[_0xb8cf('0x26')];var _0x4c96eb;if(_0x4087c0>=_0x492f92){_0x4087c0=_0x492f92;_0x4c96eb=0xc8;}else{_0x4c96eb=0xce;}_0x4bc401[_0xb8cf('0x23')](_0x4c96eb);return _0x4bc401['set'](_0xb8cf('0x29'),_0x2a2be5+'-'+_0x4087c0+'/'+_0x492f92)['json'](_0x3477cc);}return null;};}function patchUpdates(_0x5728c4){return function(_0x3a9ded){try{jsonpatch[_0xb8cf('0x2a')](_0x3a9ded,_0x5728c4,!![]);}catch(_0x56344c){return BPromise['reject'](_0x56344c);}return _0x3a9ded[_0xb8cf('0x2b')]();};}function saveUpdates(_0x5f5c72,_0x3b4d06){return function(_0x5831fa){if(_0x5831fa){return _0x5831fa[_0xb8cf('0x2c')](_0x5f5c72)[_0xb8cf('0x18')](function(_0x42523c){return _0x42523c;});}return null;};}function removeEntity(_0x50da29,_0x57a960){return function(_0xd15dfa){if(_0xd15dfa){return _0xd15dfa[_0xb8cf('0x2d')]()[_0xb8cf('0x18')](function(){var _0xb95ec6=_0xd15dfa[_0xb8cf('0x2e')]({'plain':!![]});var _0x34e506=_0xb8cf('0x2f');return db[_0xb8cf('0x30')][_0xb8cf('0x2d')]({'where':{'type':_0x34e506,'resourceId':_0xb95ec6['id']}})[_0xb8cf('0x18')](function(){return _0xd15dfa;});})[_0xb8cf('0x18')](function(){_0x50da29[_0xb8cf('0x23')](0xcc)[_0xb8cf('0x31')]();});}};}function handleEntityNotFound(_0x35855c,_0x3d2bf8){return function(_0x28b25b){if(!_0x28b25b){_0x35855c[_0xb8cf('0x22')](0x194);}return _0x28b25b;};}function handleError(_0x18082f,_0x180b84){_0x180b84=_0x180b84||0x1f4;return function(_0x4c8e5a){logger[_0xb8cf('0x1e')](_0x4c8e5a[_0xb8cf('0x32')]);if(_0x4c8e5a[_0xb8cf('0x33')]){delete _0x4c8e5a['name'];}_0x18082f[_0xb8cf('0x23')](_0x180b84)[_0xb8cf('0x34')](_0x4c8e5a);};}exports['index']=function(_0x31bc8e,_0x5301b1){var _0x3f984c={},_0x2a3449={},_0x544abc={'count':0x0,'rows':[]};var _0x3ee2e0=_[_0xb8cf('0x35')](db['VoiceContext'][_0xb8cf('0x36')],function(_0x1146b5){return{'name':_0x1146b5[_0xb8cf('0x37')],'type':_0x1146b5[_0xb8cf('0x38')][_0xb8cf('0x39')]};});_0x2a3449[_0xb8cf('0x3a')]=_[_0xb8cf('0x35')](_0x3ee2e0,_0xb8cf('0x33'));_0x2a3449[_0xb8cf('0x3b')]=_[_0xb8cf('0x3c')](_0x31bc8e[_0xb8cf('0x3b')]);_0x2a3449[_0xb8cf('0x3d')]=_[_0xb8cf('0x3e')](_0x2a3449[_0xb8cf('0x3a')],_0x2a3449[_0xb8cf('0x3b')]);_0x3f984c[_0xb8cf('0x3f')]=_[_0xb8cf('0x3e')](_0x2a3449[_0xb8cf('0x3a')],qs['fields'](_0x31bc8e[_0xb8cf('0x3b')]['fields']));_0x3f984c[_0xb8cf('0x3f')]=_0x3f984c[_0xb8cf('0x3f')]['length']?_0x3f984c['attributes']:_0x2a3449[_0xb8cf('0x3a')];if(!_0x31bc8e[_0xb8cf('0x3b')]['hasOwnProperty'](_0xb8cf('0x40'))){_0x3f984c[_0xb8cf('0x26')]=qs[_0xb8cf('0x26')](_0x31bc8e[_0xb8cf('0x3b')][_0xb8cf('0x26')]);_0x3f984c[_0xb8cf('0x25')]=qs[_0xb8cf('0x25')](_0x31bc8e[_0xb8cf('0x3b')]['offset']);}_0x3f984c[_0xb8cf('0x41')]=qs['sort'](_0x31bc8e[_0xb8cf('0x3b')]['sort']);_0x3f984c['where']=qs['filters'](_['pick'](_0x31bc8e[_0xb8cf('0x3b')],_0x2a3449['filters']),_0x3ee2e0);if(_0x31bc8e[_0xb8cf('0x3b')][_0xb8cf('0x42')]){_0x3f984c[_0xb8cf('0x43')]=_[_0xb8cf('0x44')](_0x3f984c['where'],{'$or':_[_0xb8cf('0x35')](_0x3ee2e0,function(_0x68108e){if(_0x68108e[_0xb8cf('0x38')]!=='VIRTUAL'){var _0x84bf8={};_0x84bf8[_0x68108e[_0xb8cf('0x33')]]={'$like':'%'+_0x31bc8e[_0xb8cf('0x3b')]['filter']+'%'};return _0x84bf8;}})});}_0x3f984c=_[_0xb8cf('0x44')]({},_0x3f984c,_0x31bc8e[_0xb8cf('0x45')]);var _0x386442={'where':_0x3f984c[_0xb8cf('0x43')]};return db[_0xb8cf('0x46')][_0xb8cf('0x28')](_0x386442)[_0xb8cf('0x18')](function(_0x13506f){_0x544abc[_0xb8cf('0x28')]=_0x13506f;if(_0x31bc8e[_0xb8cf('0x3b')][_0xb8cf('0x47')]){_0x3f984c['include']=[{'all':!![]}];}return db[_0xb8cf('0x46')][_0xb8cf('0x48')](_0x3f984c);})['then'](function(_0x572ad7){_0x544abc[_0xb8cf('0x49')]=_0x572ad7;return _0x544abc;})[_0xb8cf('0x18')](respondWithFilteredResult(_0x5301b1,_0x3f984c))[_0xb8cf('0x21')](handleError(_0x5301b1,null));};exports[_0xb8cf('0x4a')]=function(_0x2e5914,_0x1f9798){var _0xe4b204={'raw':![],'where':{'id':_0x2e5914[_0xb8cf('0x4b')]['id']}},_0x422714={};_0x422714[_0xb8cf('0x3a')]=_['keys'](db['VoiceContext'][_0xb8cf('0x36')]);_0x422714[_0xb8cf('0x3b')]=_[_0xb8cf('0x3c')](_0x2e5914[_0xb8cf('0x3b')]);_0x422714['filters']=_[_0xb8cf('0x3e')](_0x422714[_0xb8cf('0x3a')],_0x422714[_0xb8cf('0x3b')]);_0xe4b204[_0xb8cf('0x3f')]=_[_0xb8cf('0x3e')](_0x422714['model'],qs[_0xb8cf('0x4c')](_0x2e5914[_0xb8cf('0x3b')][_0xb8cf('0x4c')]));_0xe4b204[_0xb8cf('0x3f')]=_0xe4b204[_0xb8cf('0x3f')]['length']?_0xe4b204['attributes']:_0x422714[_0xb8cf('0x3a')];if(_0x2e5914[_0xb8cf('0x3b')][_0xb8cf('0x47')]){_0xe4b204[_0xb8cf('0x4d')]=[{'all':!![]}];}_0xe4b204=_[_0xb8cf('0x44')]({},_0xe4b204,_0x2e5914[_0xb8cf('0x45')]);return db[_0xb8cf('0x46')][_0xb8cf('0x4e')](_0xe4b204)[_0xb8cf('0x18')](handleEntityNotFound(_0x1f9798,null))[_0xb8cf('0x18')](respondWithResult(_0x1f9798,null))['catch'](handleError(_0x1f9798,null));};exports[_0xb8cf('0x4f')]=function(_0x550de9,_0x50e8d8,_0x1ac76a){var _0x398aeb;return db[_0xb8cf('0x46')][_0xb8cf('0x4f')](_0x550de9[_0xb8cf('0x50')],{'raw':!![]})[_0xb8cf('0x18')](function(_0x5545e7){_0x398aeb=_0x5545e7;return db['VoiceContext'][_0xb8cf('0x48')]({'raw':!![]});})[_0xb8cf('0x18')](function(_0x74d590){var _0x3d6a0f=fs[_0xb8cf('0x51')](path[_0xb8cf('0x52')](config[_0xb8cf('0x53')],_0xb8cf('0x54')),_0xb8cf('0x55'));var _0x362143=ejs['render'](_0x3d6a0f,{'contexts':_0x74d590||[]});fs[_0xb8cf('0x56')](_0xb8cf('0x57'),_0x362143);})[_0xb8cf('0x18')](function(){return respondWithRpcPromise('Reload',_0xb8cf('0x4f'),{'module':_0xb8cf('0x58')});})[_0xb8cf('0x18')](function(){var _0x50ead6=_0x550de9[_0xb8cf('0x59')][_0xb8cf('0x2e')]({'plain':!![]});if(!_0x50ead6)throw new Error(_0xb8cf('0x5a'));if(_0x50ead6[_0xb8cf('0x5b')]===_0xb8cf('0x59')){var _0x47d7cf=_0x398aeb[_0xb8cf('0x2e')]({'plain':!![]});return db['UserProfileSection'][_0xb8cf('0x4e')]({'where':{'name':_0xb8cf('0x2f'),'userProfileId':_0x50ead6['userProfileId']},'raw':!![]})[_0xb8cf('0x18')](function(_0xa49e2e){if(_0xa49e2e&&_0xa49e2e[_0xb8cf('0x5c')]===0x0){return db[_0xb8cf('0x30')][_0xb8cf('0x4f')]({'name':_0x47d7cf[_0xb8cf('0x33')],'resourceId':_0x47d7cf['id'],'type':_0xa49e2e[_0xb8cf('0x33')],'sectionId':_0xa49e2e['id']},{})['then'](function(){return _0x398aeb;});}else{return _0x398aeb;}})[_0xb8cf('0x21')](function(_0x184a4e){logger['error'](_0xb8cf('0x5d'),_0x184a4e);throw _0x184a4e;});}return _0x398aeb;})[_0xb8cf('0x18')](respondWithResult(_0x50e8d8,0xc9))[_0xb8cf('0x21')](handleError(_0x50e8d8,null));};exports[_0xb8cf('0x2c')]=function(_0x41c670,_0x4000f6,_0x2c7cad){var _0x30dfee;return db['VoiceContext']['find']({'where':{'id':_0x41c670[_0xb8cf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4000f6,null))['then'](saveUpdates(_0x41c670['body'],null))[_0xb8cf('0x18')](function(_0x3c9b35){if(_0x3c9b35){_0x30dfee=_0x3c9b35;return db['VoiceContext'][_0xb8cf('0x48')]({'raw':!![]});}})[_0xb8cf('0x18')](function(_0x2026f3){var _0x4f9ca4=fs[_0xb8cf('0x51')](path[_0xb8cf('0x52')](config[_0xb8cf('0x53')],_0xb8cf('0x54')),_0xb8cf('0x55'));var _0x42915a=ejs[_0xb8cf('0x5e')](_0x4f9ca4,{'contexts':_0x2026f3||[]});fs[_0xb8cf('0x56')](_0xb8cf('0x57'),_0x42915a);})[_0xb8cf('0x18')](function(){return respondWithRpcPromise('Reload',_0xb8cf('0x2c'),{'module':'chan_sip.so'});})['then'](function(){return _0x30dfee;})[_0xb8cf('0x18')](respondWithResult(_0x4000f6,null))[_0xb8cf('0x21')](handleError(_0x4000f6,null));};exports['destroy']=function(_0x321349,_0x55fe7d,_0x50277e){var _0xaf2b95;return db['VoiceContext'][_0xb8cf('0x4e')]({'where':{'id':_0x321349[_0xb8cf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55fe7d,null))[_0xb8cf('0x18')](removeEntity(_0x55fe7d,null))[_0xb8cf('0x18')](function(){return db[_0xb8cf('0x46')][_0xb8cf('0x48')]({'raw':!![]});})[_0xb8cf('0x18')](function(_0x2ca129){var _0x4ba8b8=fs['readFileSync'](path[_0xb8cf('0x52')](config[_0xb8cf('0x53')],_0xb8cf('0x54')),_0xb8cf('0x55'));var _0x5c08da=ejs['render'](_0x4ba8b8,{'contexts':_0x2ca129});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x5c08da);return respondWithRpcPromise('Reload',_0xb8cf('0x2d'),{'module':_0xb8cf('0x58')});})[_0xb8cf('0x21')](handleError(_0x55fe7d,null));}; \ No newline at end of file +var _0xf41f=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','writeFileSync','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','limit','order','sort','where','pick','filter','merge','options','include','VoiceContext','findAll','rows','show','params','length','includeAll','find','create','body','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so'];(function(_0x40cfc0,_0x339d91){var _0x413853=function(_0xcb9890){while(--_0xcb9890){_0x40cfc0['push'](_0x40cfc0['shift']());}};_0x413853(++_0x339d91);}(_0xf41f,0xd5));var _0xff41=function(_0x4c0def,_0x3e1a9d){_0x4c0def=_0x4c0def-0x0;var _0x34910d=_0xf41f[_0x4c0def];return _0x34910d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xff41('0x1'));var moment=require(_0xff41('0x2'));var BPromise=require(_0xff41('0x3'));var Mustache=require(_0xff41('0x4'));var util=require('util');var path=require(_0xff41('0x5'));var sox=require(_0xff41('0x6'));var csv=require(_0xff41('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff41('0x8'));var _=require(_0xff41('0x9'));var squel=require('squel');var crypto=require(_0xff41('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff41('0x7'));var querystring=require(_0xff41('0xb'));var Papa=require(_0xff41('0xc'));var Redis=require(_0xff41('0xd'));var authService=require(_0xff41('0xe'));var qs=require(_0xff41('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff41('0x10'));var logger=require(_0xff41('0x11'))(_0xff41('0x12'));var utils=require(_0xff41('0x13'));var config=require(_0xff41('0x14'));var licenseUtil=require(_0xff41('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xff41('0x16')][_0xff41('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x153630,_0x1c1e1a,_0x3b86b9,_0x3259d3){return new BPromise(function(_0x216844,_0x4ebca1){var _0x5bf953=_0x3259d3||client;return _0x5bf953[_0xff41('0x18')](_0x153630,_0x3b86b9)[_0xff41('0x19')](function(_0x47faa3){logger[_0xff41('0x1a')](_0xff41('0x1b'),_0x1c1e1a,_0xff41('0x1c'));logger[_0xff41('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1c1e1a,'request\x20sent',JSON[_0xff41('0x1e')](_0x47faa3));if(_0x47faa3[_0xff41('0x1f')]){if(_0x47faa3[_0xff41('0x1f')]['code']===0x1f4){logger['error'](_0xff41('0x1b'),_0x1c1e1a,_0x47faa3[_0xff41('0x1f')][_0xff41('0x20')]);return _0x4ebca1(_0x47faa3['error']['message']);}logger['error'](_0xff41('0x1b'),_0x1c1e1a,_0x47faa3[_0xff41('0x1f')]['message']);return _0x216844(_0x47faa3['error'][_0xff41('0x20')]);}else{logger[_0xff41('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x1c1e1a,_0xff41('0x1c'));_0x216844(_0x47faa3[_0xff41('0x21')]['message']);}})[_0xff41('0x22')](function(_0x1db301){logger[_0xff41('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x1c1e1a,_0x1db301);_0x4ebca1(_0x1db301);});});}function respondWithStatusCode(_0x3c2c1b,_0x4d350e){_0x4d350e=_0x4d350e||0xcc;return function(_0x396a5f){if(_0x396a5f){return _0x3c2c1b['sendStatus'](_0x4d350e);}return _0x3c2c1b['status'](_0x4d350e)[_0xff41('0x23')]();};}function respondWithResult(_0x2b524f,_0x326d9c){_0x326d9c=_0x326d9c||0xc8;return function(_0x14bc1c){if(_0x14bc1c){return _0x2b524f[_0xff41('0x24')](_0x326d9c)['json'](_0x14bc1c);}};}function respondWithFilteredResult(_0x26eb82,_0x43d650){return function(_0x52dc6f){if(_0x52dc6f){var _0x4b30ee=typeof _0x43d650[_0xff41('0x25')]===_0xff41('0x26')&&typeof _0x43d650['limit']===_0xff41('0x26');var _0x3ccbf6=_0x52dc6f[_0xff41('0x27')];var _0x100c6f=_0x4b30ee?0x0:_0x43d650[_0xff41('0x25')];var _0x2cfa61=_0x4b30ee?_0x52dc6f[_0xff41('0x27')]:_0x43d650[_0xff41('0x25')]+_0x43d650['limit'];var _0x514d79;if(_0x2cfa61>=_0x3ccbf6){_0x2cfa61=_0x3ccbf6;_0x514d79=0xc8;}else{_0x514d79=0xce;}_0x26eb82[_0xff41('0x24')](_0x514d79);return _0x26eb82[_0xff41('0x28')](_0xff41('0x29'),_0x100c6f+'-'+_0x2cfa61+'/'+_0x3ccbf6)[_0xff41('0x2a')](_0x52dc6f);}return null;};}function patchUpdates(_0x4c401e){return function(_0x54cd09){try{jsonpatch[_0xff41('0x2b')](_0x54cd09,_0x4c401e,!![]);}catch(_0x39b40f){return BPromise[_0xff41('0x2c')](_0x39b40f);}return _0x54cd09[_0xff41('0x2d')]();};}function saveUpdates(_0x3eedf5,_0x397af3){return function(_0x5c2836){if(_0x5c2836){return _0x5c2836[_0xff41('0x2e')](_0x3eedf5)[_0xff41('0x19')](function(_0x4907c0){return _0x4907c0;});}return null;};}function removeEntity(_0x1c54f3,_0x471d1c){return function(_0x32ac58){if(_0x32ac58){return _0x32ac58['destroy']()[_0xff41('0x19')](function(){var _0x45531d=_0x32ac58[_0xff41('0x2f')]({'plain':!![]});var _0x23dca9='Contexts';return db[_0xff41('0x30')][_0xff41('0x31')]({'where':{'type':_0x23dca9,'resourceId':_0x45531d['id']}})['then'](function(){return _0x32ac58;});})['then'](function(){_0x1c54f3['status'](0xcc)[_0xff41('0x23')]();});}};}function handleEntityNotFound(_0x460727,_0x1d0042){return function(_0x252847){if(!_0x252847){_0x460727[_0xff41('0x32')](0x194);}return _0x252847;};}function handleError(_0x34146c,_0x43ffae){_0x43ffae=_0x43ffae||0x1f4;return function(_0x2266be){logger['error'](_0x2266be[_0xff41('0x33')]);if(_0x2266be[_0xff41('0x34')]){delete _0x2266be[_0xff41('0x34')];}_0x34146c[_0xff41('0x24')](_0x43ffae)[_0xff41('0x35')](_0x2266be);};}exports['index']=function(_0x2681fd,_0x258efa){var _0x5e7ce9={},_0x4979ef={},_0x38668f={'count':0x0,'rows':[]};var _0x40ce6d=_[_0xff41('0x36')](db['VoiceContext'][_0xff41('0x37')],function(_0x1401c1){return{'name':_0x1401c1[_0xff41('0x38')],'type':_0x1401c1[_0xff41('0x39')][_0xff41('0x3a')]};});_0x4979ef[_0xff41('0x3b')]=_[_0xff41('0x36')](_0x40ce6d,_0xff41('0x34'));_0x4979ef[_0xff41('0x3c')]=_[_0xff41('0x3d')](_0x2681fd[_0xff41('0x3c')]);_0x4979ef[_0xff41('0x3e')]=_[_0xff41('0x3f')](_0x4979ef[_0xff41('0x3b')],_0x4979ef[_0xff41('0x3c')]);_0x5e7ce9[_0xff41('0x40')]=_[_0xff41('0x3f')](_0x4979ef[_0xff41('0x3b')],qs[_0xff41('0x41')](_0x2681fd[_0xff41('0x3c')][_0xff41('0x41')]));_0x5e7ce9[_0xff41('0x40')]=_0x5e7ce9['attributes']['length']?_0x5e7ce9[_0xff41('0x40')]:_0x4979ef[_0xff41('0x3b')];if(!_0x2681fd[_0xff41('0x3c')]['hasOwnProperty']('nolimit')){_0x5e7ce9[_0xff41('0x42')]=qs[_0xff41('0x42')](_0x2681fd['query'][_0xff41('0x42')]);_0x5e7ce9['offset']=qs[_0xff41('0x25')](_0x2681fd[_0xff41('0x3c')]['offset']);}_0x5e7ce9[_0xff41('0x43')]=qs[_0xff41('0x44')](_0x2681fd['query'][_0xff41('0x44')]);_0x5e7ce9[_0xff41('0x45')]=qs['filters'](_[_0xff41('0x46')](_0x2681fd[_0xff41('0x3c')],_0x4979ef[_0xff41('0x3e')]),_0x40ce6d);if(_0x2681fd[_0xff41('0x3c')]['filter']){_0x5e7ce9[_0xff41('0x45')]=_['merge'](_0x5e7ce9[_0xff41('0x45')],{'$or':_[_0xff41('0x36')](_0x40ce6d,function(_0x2f9bb4){if(_0x2f9bb4[_0xff41('0x39')]!=='VIRTUAL'){var _0x1e671f={};_0x1e671f[_0x2f9bb4['name']]={'$like':'%'+_0x2681fd[_0xff41('0x3c')][_0xff41('0x47')]+'%'};return _0x1e671f;}})});}_0x5e7ce9=_[_0xff41('0x48')]({},_0x5e7ce9,_0x2681fd[_0xff41('0x49')]);var _0x4fa01c={'where':_0x5e7ce9['where']};return db['VoiceContext'][_0xff41('0x27')](_0x4fa01c)['then'](function(_0x4b4a6b){_0x38668f[_0xff41('0x27')]=_0x4b4a6b;if(_0x2681fd[_0xff41('0x3c')]['includeAll']){_0x5e7ce9[_0xff41('0x4a')]=[{'all':!![]}];}return db[_0xff41('0x4b')][_0xff41('0x4c')](_0x5e7ce9);})['then'](function(_0x560417){_0x38668f[_0xff41('0x4d')]=_0x560417;return _0x38668f;})[_0xff41('0x19')](respondWithFilteredResult(_0x258efa,_0x5e7ce9))[_0xff41('0x22')](handleError(_0x258efa,null));};exports[_0xff41('0x4e')]=function(_0x5b3e3d,_0x50935f){var _0x35e64b={'raw':![],'where':{'id':_0x5b3e3d[_0xff41('0x4f')]['id']}},_0x32ba7e={};_0x32ba7e[_0xff41('0x3b')]=_[_0xff41('0x3d')](db[_0xff41('0x4b')][_0xff41('0x37')]);_0x32ba7e[_0xff41('0x3c')]=_[_0xff41('0x3d')](_0x5b3e3d['query']);_0x32ba7e['filters']=_[_0xff41('0x3f')](_0x32ba7e['model'],_0x32ba7e[_0xff41('0x3c')]);_0x35e64b[_0xff41('0x40')]=_[_0xff41('0x3f')](_0x32ba7e[_0xff41('0x3b')],qs['fields'](_0x5b3e3d[_0xff41('0x3c')][_0xff41('0x41')]));_0x35e64b[_0xff41('0x40')]=_0x35e64b[_0xff41('0x40')][_0xff41('0x50')]?_0x35e64b[_0xff41('0x40')]:_0x32ba7e['model'];if(_0x5b3e3d['query'][_0xff41('0x51')]){_0x35e64b[_0xff41('0x4a')]=[{'all':!![]}];}_0x35e64b=_[_0xff41('0x48')]({},_0x35e64b,_0x5b3e3d[_0xff41('0x49')]);return db['VoiceContext'][_0xff41('0x52')](_0x35e64b)[_0xff41('0x19')](handleEntityNotFound(_0x50935f,null))[_0xff41('0x19')](respondWithResult(_0x50935f,null))[_0xff41('0x22')](handleError(_0x50935f,null));};exports[_0xff41('0x53')]=function(_0x49c5b6,_0x12506a,_0x3a8849){var _0x13336e;return db['VoiceContext'][_0xff41('0x53')](_0x49c5b6[_0xff41('0x54')],{'raw':!![]})['then'](function(_0xdb47c5){_0x13336e=_0xdb47c5;return db[_0xff41('0x4b')]['findAll']({'raw':!![]});})[_0xff41('0x19')](function(_0x4766f6){var _0x346620=fs[_0xff41('0x55')](path[_0xff41('0x56')](config[_0xff41('0x57')],'server/files/templates/context.ejs'),_0xff41('0x58'));var _0x49d9f3=ejs[_0xff41('0x59')](_0x346620,{'contexts':_0x4766f6||[]});fs['writeFileSync'](_0xff41('0x5a'),_0x49d9f3);})[_0xff41('0x19')](function(){return respondWithRpcPromise(_0xff41('0x5b'),'create',{'module':_0xff41('0x5c')});})[_0xff41('0x19')](function(){var _0x4ce319=_0x49c5b6['user'][_0xff41('0x2f')]({'plain':!![]});if(!_0x4ce319)throw new Error(_0xff41('0x5d'));if(_0x4ce319[_0xff41('0x5e')]===_0xff41('0x5f')){var _0x24f25e=_0x13336e[_0xff41('0x2f')]({'plain':!![]});return db[_0xff41('0x60')][_0xff41('0x52')]({'where':{'name':_0xff41('0x61'),'userProfileId':_0x4ce319[_0xff41('0x62')]},'raw':!![]})[_0xff41('0x19')](function(_0x222c63){if(_0x222c63&&_0x222c63['autoAssociation']===0x0){return db[_0xff41('0x30')]['create']({'name':_0x24f25e[_0xff41('0x34')],'resourceId':_0x24f25e['id'],'type':_0x222c63[_0xff41('0x34')],'sectionId':_0x222c63['id']},{})['then'](function(){return _0x13336e;});}else{return _0x13336e;}})[_0xff41('0x22')](function(_0x3b281f){logger[_0xff41('0x1f')](_0xff41('0x63'),_0x3b281f);throw _0x3b281f;});}return _0x13336e;})[_0xff41('0x19')](respondWithResult(_0x12506a,0xc9))['catch'](handleError(_0x12506a,null));};exports['update']=function(_0x31290f,_0x480d37,_0x5e2d1a){var _0x396e89;return db[_0xff41('0x4b')][_0xff41('0x52')]({'where':{'id':_0x31290f[_0xff41('0x4f')]['id']}})[_0xff41('0x19')](handleEntityNotFound(_0x480d37,null))[_0xff41('0x19')](saveUpdates(_0x31290f['body'],null))['then'](function(_0x69220c){if(_0x69220c){_0x396e89=_0x69220c;return db[_0xff41('0x4b')][_0xff41('0x4c')]({'raw':!![]});}})[_0xff41('0x19')](function(_0x53d718){var _0x579888=fs[_0xff41('0x55')](path[_0xff41('0x56')](config[_0xff41('0x57')],_0xff41('0x64')),_0xff41('0x58'));var _0x5282e4=ejs[_0xff41('0x59')](_0x579888,{'contexts':_0x53d718||[]});fs[_0xff41('0x65')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5282e4);})[_0xff41('0x19')](function(){return respondWithRpcPromise(_0xff41('0x5b'),_0xff41('0x2e'),{'module':'chan_sip.so'});})[_0xff41('0x19')](function(){return _0x396e89;})[_0xff41('0x19')](respondWithResult(_0x480d37,null))['catch'](handleError(_0x480d37,null));};exports['destroy']=function(_0x324bfa,_0x5910c1,_0x14f551){var _0x410835;return db[_0xff41('0x4b')]['find']({'where':{'id':_0x324bfa[_0xff41('0x4f')]['id']}})[_0xff41('0x19')](handleEntityNotFound(_0x5910c1,null))[_0xff41('0x19')](removeEntity(_0x5910c1,null))[_0xff41('0x19')](function(){return db[_0xff41('0x4b')][_0xff41('0x4c')]({'raw':!![]});})['then'](function(_0x2ce416){var _0x56146b=fs[_0xff41('0x55')](path[_0xff41('0x56')](config['root'],_0xff41('0x64')),_0xff41('0x58'));var _0x25f351=ejs['render'](_0x56146b,{'contexts':_0x2ce416});fs['writeFileSync'](_0xff41('0x5a'),_0x25f351);return respondWithRpcPromise('Reload',_0xff41('0x31'),{'module':_0xff41('0x5c')});})[_0xff41('0x22')](handleError(_0x5910c1,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 02d219e..6e2517f 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 _0xb7d4=['bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','../../config/logger','moment'];(function(_0xe3590d,_0x18007a){var _0x574fad=function(_0x38f586){while(--_0x38f586){_0xe3590d['push'](_0xe3590d['shift']());}};_0x574fad(++_0x18007a);}(_0xb7d4,0x1ec));var _0x4b7d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb7d4[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4b7d('0x0'));var util=require('util');var logger=require(_0x4b7d('0x1'))('api');var moment=require(_0x4b7d('0x2'));var BPromise=require(_0x4b7d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b7d('0x4'));var rimraf=require(_0x4b7d('0x5'));var config=require(_0x4b7d('0x6'));var attributes=require(_0x4b7d('0x7'));module[_0x4b7d('0x8')]=function(_0x5c9ad9,_0x47c7c8){return _0x5c9ad9[_0x4b7d('0x9')](_0x4b7d('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4703=['VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','request-promise','path','./voiceContext.attributes','exports'];(function(_0x1a6269,_0x5deea5){var _0x536f68=function(_0x5911ce){while(--_0x5911ce){_0x1a6269['push'](_0x1a6269['shift']());}};_0x536f68(++_0x5deea5);}(_0x4703,0xbd));var _0x3470=function(_0x386cd2,_0xe877b7){_0x386cd2=_0x386cd2-0x0;var _0x17c5aa=_0x4703[_0x386cd2];return _0x17c5aa;};'use strict';var _=require(_0x3470('0x0'));var util=require(_0x3470('0x1'));var logger=require(_0x3470('0x2'))(_0x3470('0x3'));var moment=require(_0x3470('0x4'));var BPromise=require('bluebird');var rp=require(_0x3470('0x5'));var fs=require('fs');var path=require(_0x3470('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3470('0x7'));module[_0x3470('0x8')]=function(_0x472033,_0x457627){return _0x472033['define'](_0x3470('0x9'),attributes,{'tableName':_0x3470('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index f7e83f2..576a875 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 _0x586b=['stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x3fb8af,_0x4dd3ae){var _0x5a9ab2=function(_0xe6a20c){while(--_0xe6a20c){_0x3fb8af['push'](_0x3fb8af['shift']());}};_0x5a9ab2(++_0x4dd3ae);}(_0x586b,0x1bb));var _0xb586=function(_0x3b8dae,_0x402f1d){_0x3b8dae=_0x3b8dae-0x0;var _0x2d2ba9=_0x586b[_0x3b8dae];return _0x2d2ba9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb586('0x0'));var BPromise=require(_0xb586('0x1'));var rs=require(_0xb586('0x2'));var fs=require('fs');var Redis=require(_0xb586('0x3'));var db=require(_0xb586('0x4'))['db'];var utils=require(_0xb586('0x5'));var logger=require(_0xb586('0x6'))(_0xb586('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb586('0x8')][_0xb586('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ca980,_0x1b5450,_0x37b9a5){return new BPromise(function(_0x5a4dbf,_0x4c00ff){return client[_0xb586('0xa')](_0x3ca980,_0x37b9a5)[_0xb586('0xb')](function(_0xbb48a6){logger[_0xb586('0xc')](_0xb586('0xd'),_0x1b5450,_0xb586('0xe'));logger[_0xb586('0xf')](_0xb586('0x10'),_0x1b5450,'request\x20sent',JSON[_0xb586('0x11')](_0xbb48a6));if(_0xbb48a6['error']){if(_0xbb48a6[_0xb586('0x12')][_0xb586('0x13')]===0x1f4){logger[_0xb586('0x12')]('VoiceContext,\x20%s,\x20%s',_0x1b5450,_0xbb48a6[_0xb586('0x12')][_0xb586('0x14')]);return _0x4c00ff(_0xbb48a6[_0xb586('0x12')][_0xb586('0x14')]);}logger['error'](_0xb586('0xd'),_0x1b5450,_0xbb48a6['error'][_0xb586('0x14')]);return _0x5a4dbf(_0xbb48a6[_0xb586('0x12')][_0xb586('0x14')]);}else{logger[_0xb586('0xc')](_0xb586('0xd'),_0x1b5450,_0xb586('0xe'));_0x5a4dbf(_0xbb48a6[_0xb586('0x15')][_0xb586('0x14')]);}})[_0xb586('0x16')](function(_0x1fad76){logger['error'](_0xb586('0xd'),_0x1b5450,_0x1fad76);_0x4c00ff(_0x1fad76);});});} \ No newline at end of file +var _0xfe36=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x3f5210,_0x32f195){var _0x53c3ab=function(_0x341fa0){while(--_0x341fa0){_0x3f5210['push'](_0x3f5210['shift']());}};_0x53c3ab(++_0x32f195);}(_0xfe36,0x1b6));var _0x6fe3=function(_0x1dddab,_0x429d9c){_0x1dddab=_0x1dddab-0x0;var _0x3b29b9=_0xfe36[_0x1dddab];return _0x3b29b9;};'use strict';var _=require(_0x6fe3('0x0'));var util=require(_0x6fe3('0x1'));var moment=require('moment');var BPromise=require(_0x6fe3('0x2'));var rs=require(_0x6fe3('0x3'));var fs=require('fs');var Redis=require(_0x6fe3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fe3('0x5'));var logger=require(_0x6fe3('0x6'))(_0x6fe3('0x7'));var config=require(_0x6fe3('0x8'));var jayson=require(_0x6fe3('0x9'));var client=jayson[_0x6fe3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ef797,_0x36998c,_0x373ed8){return new BPromise(function(_0x3b725c,_0x55e152){return client[_0x6fe3('0xb')](_0x5ef797,_0x373ed8)[_0x6fe3('0xc')](function(_0x5242de){logger[_0x6fe3('0xd')](_0x6fe3('0xe'),_0x36998c,_0x6fe3('0xf'));logger[_0x6fe3('0x10')](_0x6fe3('0x11'),_0x36998c,_0x6fe3('0xf'),JSON[_0x6fe3('0x12')](_0x5242de));if(_0x5242de['error']){if(_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x14')]===0x1f4){logger[_0x6fe3('0x13')](_0x6fe3('0xe'),_0x36998c,_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x15')]);return _0x55e152(_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x15')]);}logger[_0x6fe3('0x13')](_0x6fe3('0xe'),_0x36998c,_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x15')]);return _0x3b725c(_0x5242de['error']['message']);}else{logger[_0x6fe3('0xd')]('VoiceContext,\x20%s,\x20%s',_0x36998c,_0x6fe3('0xf'));_0x3b725c(_0x5242de[_0x6fe3('0x16')][_0x6fe3('0x15')]);}})[_0x6fe3('0x17')](function(_0x5dea64){logger[_0x6fe3('0x13')](_0x6fe3('0xe'),_0x36998c,_0x5dea64);_0x55e152(_0x5dea64);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f8a6f40..adfe839 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 _0xcb7f=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a9d87,_0x2cc20f){var _0x1ad978=function(_0x37673c){while(--_0x37673c){_0x4a9d87['push'](_0x4a9d87['shift']());}};_0x1ad978(++_0x2cc20f);}(_0xcb7f,0x1c3));var _0xfcb7=function(_0x5a7fe2,_0x4f0161){_0x5a7fe2=_0x5a7fe2-0x0;var _0x3834da=_0xcb7f[_0x5a7fe2];return _0x3834da;};'use strict';var multer=require(_0xfcb7('0x0'));var util=require(_0xfcb7('0x1'));var path=require(_0xfcb7('0x2'));var timeout=require(_0xfcb7('0x3'));var express=require(_0xfcb7('0x4'));var router=express[_0xfcb7('0x5')]();var fs_extra=require(_0xfcb7('0x6'));var auth=require(_0xfcb7('0x7'));var interaction=require(_0xfcb7('0x8'));var config=require(_0xfcb7('0x9'));var controller=require(_0xfcb7('0xa'));router[_0xfcb7('0xb')]('/',auth[_0xfcb7('0xc')](),controller[_0xfcb7('0xd')]);router[_0xfcb7('0xb')](_0xfcb7('0xe'),auth[_0xfcb7('0xc')](),controller['describe']);router[_0xfcb7('0xb')](_0xfcb7('0xf'),auth[_0xfcb7('0xc')](),controller[_0xfcb7('0x10')]);router[_0xfcb7('0x11')]('/',auth[_0xfcb7('0xc')](),controller[_0xfcb7('0x12')]);router[_0xfcb7('0x13')](_0xfcb7('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xfcb7('0x14')](_0xfcb7('0xf'),auth['isAuthenticated'](),controller[_0xfcb7('0x15')]);module[_0xfcb7('0x16')]=router; \ No newline at end of file +var _0x847d=['/describe','describe','/:id','show','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x386503,_0x47c6c3){var _0x66c2e3=function(_0x42d0f6){while(--_0x42d0f6){_0x386503['push'](_0x386503['shift']());}};_0x66c2e3(++_0x47c6c3);}(_0x847d,0x14a));var _0xd847=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x847d[_0x225f50];return _0x19d003;};'use strict';var multer=require('multer');var util=require(_0xd847('0x0'));var path=require(_0xd847('0x1'));var timeout=require(_0xd847('0x2'));var express=require('express');var router=express[_0xd847('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd847('0x4'));var interaction=require(_0xd847('0x5'));var config=require('../../config/environment');var controller=require(_0xd847('0x6'));router[_0xd847('0x7')]('/',auth[_0xd847('0x8')](),controller[_0xd847('0x9')]);router['get'](_0xd847('0xa'),auth[_0xd847('0x8')](),controller[_0xd847('0xb')]);router[_0xd847('0x7')](_0xd847('0xc'),auth[_0xd847('0x8')](),controller[_0xd847('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd847('0xc'),auth[_0xd847('0x8')](),controller[_0xd847('0xe')]);router['delete']('/:id',auth[_0xd847('0x8')](),controller[_0xd847('0xf')]);module[_0xd847('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index b53c054..f16792e 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 _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x3f969e,_0xf0a1){var _0x3c080b=function(_0x1f7590){while(--_0x1f7590){_0x3f969e['push'](_0x3f969e['shift']());}};_0x3c080b(++_0xf0a1);}(_0x98a8,0x12c));var _0x898a=function(_0xaa3390,_0x435677){_0xaa3390=_0xaa3390-0x0;var _0x3d0a66=_0x98a8[_0xaa3390];return _0x3d0a66;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file +var _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x5b7c6d,_0xccee71){var _0xe96506=function(_0x5b5b30){while(--_0x5b5b30){_0x5b7c6d['push'](_0x5b7c6d['shift']());}};_0xe96506(++_0xccee71);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 5ff3b37..f11b157 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 _0xfdbf=['stack','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','rawAttributes','length','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdbf,0x6f));var _0xffdb=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xfdbf[_0x4b174a];return _0x3cd7bf;};'use strict';var emlformat=require(_0xffdb('0x0'));var rimraf=require(_0xffdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffdb('0x2'));var rp=require('request-promise');var moment=require(_0xffdb('0x3'));var BPromise=require(_0xffdb('0x4'));var Mustache=require(_0xffdb('0x5'));var util=require('util');var path=require(_0xffdb('0x6'));var sox=require(_0xffdb('0x7'));var csv=require('to-csv');var ejs=require(_0xffdb('0x8'));var fs=require('fs');var fs_extra=require(_0xffdb('0x9'));var _=require(_0xffdb('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xffdb('0xb'));var deskjs=require(_0xffdb('0xc'));var toCsv=require(_0xffdb('0xd'));var querystring=require(_0xffdb('0xe'));var Papa=require('papaparse');var Redis=require(_0xffdb('0xf'));var authService=require(_0xffdb('0x10'));var qs=require(_0xffdb('0x11'));var as=require(_0xffdb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffdb('0x13'))(_0xffdb('0x14'));var utils=require(_0xffdb('0x15'));var config=require(_0xffdb('0x16'));var licenseUtil=require(_0xffdb('0x17'));var db=require(_0xffdb('0x18'))['db'];function respondWithStatusCode(_0x51bf9a,_0x178ae2){_0x178ae2=_0x178ae2||0xcc;return function(_0x5990fa){if(_0x5990fa){return _0x51bf9a[_0xffdb('0x19')](_0x178ae2);}return _0x51bf9a['status'](_0x178ae2)[_0xffdb('0x1a')]();};}function respondWithResult(_0x2f1a35,_0xce5242){_0xce5242=_0xce5242||0xc8;return function(_0x592da8){if(_0x592da8){return _0x2f1a35[_0xffdb('0x1b')](_0xce5242)[_0xffdb('0x1c')](_0x592da8);}};}function respondWithFilteredResult(_0x248066,_0x515ede){return function(_0x5d623c){if(_0x5d623c){var _0x201968=typeof _0x515ede[_0xffdb('0x1d')]===_0xffdb('0x1e')&&typeof _0x515ede['limit']===_0xffdb('0x1e');var _0x346ae4=_0x5d623c[_0xffdb('0x1f')];var _0x5ab951=_0x201968?0x0:_0x515ede[_0xffdb('0x1d')];var _0x461912=_0x201968?_0x5d623c[_0xffdb('0x1f')]:_0x515ede['offset']+_0x515ede[_0xffdb('0x20')];var _0x187af3;if(_0x461912>=_0x346ae4){_0x461912=_0x346ae4;_0x187af3=0xc8;}else{_0x187af3=0xce;}_0x248066[_0xffdb('0x1b')](_0x187af3);return _0x248066[_0xffdb('0x21')](_0xffdb('0x22'),_0x5ab951+'-'+_0x461912+'/'+_0x346ae4)['json'](_0x5d623c);}return null;};}function patchUpdates(_0x2fbd8f){return function(_0x305050){try{jsonpatch[_0xffdb('0x23')](_0x305050,_0x2fbd8f,!![]);}catch(_0x40acfb){return BPromise[_0xffdb('0x24')](_0x40acfb);}return _0x305050[_0xffdb('0x25')]();};}function saveUpdates(_0x918613,_0x592401){return function(_0x5d9c46){if(_0x5d9c46){return _0x5d9c46[_0xffdb('0x26')](_0x918613)[_0xffdb('0x27')](function(_0x400532){return _0x400532;});}return null;};}function removeEntity(_0x5600d3,_0x176ea3){return function(_0x319100){if(_0x319100){return _0x319100[_0xffdb('0x28')]()[_0xffdb('0x27')](function(){_0x5600d3[_0xffdb('0x1b')](0xcc)[_0xffdb('0x1a')]();});}};}function handleEntityNotFound(_0x37baf2,_0x3438eb){return function(_0x38a700){if(!_0x38a700){_0x37baf2['sendStatus'](0x194);}return _0x38a700;};}function handleError(_0x59f741,_0x51ec8f){_0x51ec8f=_0x51ec8f||0x1f4;return function(_0x251980){logger['error'](_0x251980[_0xffdb('0x29')]);if(_0x251980[_0xffdb('0x2a')]){delete _0x251980[_0xffdb('0x2a')];}_0x59f741['status'](_0x51ec8f)[_0xffdb('0x2b')](_0x251980);};}exports['index']=function(_0x47315e,_0x181439){var _0x261a07={},_0x3c5720={},_0x5d0539={'count':0x0,'rows':[]};var _0x754eb0=_[_0xffdb('0x2c')](db[_0xffdb('0x2d')]['rawAttributes'],function(_0x2a7f8e){return{'name':_0x2a7f8e[_0xffdb('0x2e')],'type':_0x2a7f8e[_0xffdb('0x2f')][_0xffdb('0x30')]};});_0x3c5720[_0xffdb('0x31')]=_[_0xffdb('0x2c')](_0x754eb0,'name');_0x3c5720[_0xffdb('0x32')]=_[_0xffdb('0x33')](_0x47315e['query']);_0x3c5720['filters']=_[_0xffdb('0x34')](_0x3c5720[_0xffdb('0x31')],_0x3c5720[_0xffdb('0x32')]);_0x261a07[_0xffdb('0x35')]=_['intersection'](_0x3c5720['model'],qs[_0xffdb('0x36')](_0x47315e[_0xffdb('0x32')][_0xffdb('0x36')]));_0x261a07[_0xffdb('0x35')]=_0x261a07[_0xffdb('0x35')]['length']?_0x261a07[_0xffdb('0x35')]:_0x3c5720[_0xffdb('0x31')];if(!_0x47315e[_0xffdb('0x32')][_0xffdb('0x37')]('nolimit')){_0x261a07[_0xffdb('0x20')]=qs[_0xffdb('0x20')](_0x47315e[_0xffdb('0x32')]['limit']);_0x261a07[_0xffdb('0x1d')]=qs[_0xffdb('0x1d')](_0x47315e[_0xffdb('0x32')][_0xffdb('0x1d')]);}_0x261a07[_0xffdb('0x38')]=qs[_0xffdb('0x39')](_0x47315e['query'][_0xffdb('0x39')]);_0x261a07[_0xffdb('0x3a')]=qs[_0xffdb('0x3b')](_[_0xffdb('0x3c')](_0x47315e[_0xffdb('0x32')],_0x3c5720[_0xffdb('0x3b')]),_0x754eb0);if(_0x47315e['query'][_0xffdb('0x3d')]){_0x261a07[_0xffdb('0x3a')]=_[_0xffdb('0x3e')](_0x261a07['where'],{'$or':_[_0xffdb('0x2c')](_0x754eb0,function(_0x19f07f){if(_0x19f07f[_0xffdb('0x2f')]!==_0xffdb('0x3f')){var _0x95793c={};_0x95793c[_0x19f07f[_0xffdb('0x2a')]]={'$like':'%'+_0x47315e[_0xffdb('0x32')]['filter']+'%'};return _0x95793c;}})});}_0x261a07=_['merge']({},_0x261a07,_0x47315e['options']);var _0x112d16={'where':_0x261a07[_0xffdb('0x3a')]};return db[_0xffdb('0x2d')]['count'](_0x112d16)[_0xffdb('0x27')](function(_0x4fc803){_0x5d0539[_0xffdb('0x1f')]=_0x4fc803;if(_0x47315e[_0xffdb('0x32')]['includeAll']){_0x261a07['include']=[{'all':!![]}];}return db[_0xffdb('0x2d')][_0xffdb('0x40')](_0x261a07);})[_0xffdb('0x27')](function(_0xbf7a9){_0x5d0539[_0xffdb('0x41')]=_0xbf7a9;return _0x5d0539;})[_0xffdb('0x27')](respondWithFilteredResult(_0x181439,_0x261a07))[_0xffdb('0x42')](handleError(_0x181439,null));};exports[_0xffdb('0x43')]=function(_0x1eed5d,_0x250b53){var _0x50c3e4={'raw':!![],'where':{'id':_0x1eed5d['params']['id']}},_0x329ff8={};_0x329ff8[_0xffdb('0x31')]=_[_0xffdb('0x33')](db[_0xffdb('0x2d')][_0xffdb('0x44')]);_0x329ff8[_0xffdb('0x32')]=_[_0xffdb('0x33')](_0x1eed5d['query']);_0x329ff8[_0xffdb('0x3b')]=_['intersection'](_0x329ff8[_0xffdb('0x31')],_0x329ff8[_0xffdb('0x32')]);_0x50c3e4[_0xffdb('0x35')]=_[_0xffdb('0x34')](_0x329ff8[_0xffdb('0x31')],qs['fields'](_0x1eed5d[_0xffdb('0x32')][_0xffdb('0x36')]));_0x50c3e4[_0xffdb('0x35')]=_0x50c3e4[_0xffdb('0x35')][_0xffdb('0x45')]?_0x50c3e4[_0xffdb('0x35')]:_0x329ff8['model'];if(_0x1eed5d[_0xffdb('0x32')]['includeAll']){_0x50c3e4['include']=[{'all':!![]}];}_0x50c3e4=_['merge']({},_0x50c3e4,_0x1eed5d[_0xffdb('0x46')]);return db['VoiceDialReport'][_0xffdb('0x47')](_0x50c3e4)[_0xffdb('0x27')](handleEntityNotFound(_0x250b53,null))['then'](respondWithResult(_0x250b53,null))['catch'](handleError(_0x250b53,null));};exports[_0xffdb('0x48')]=function(_0x2ce6af,_0x28141f){return db[_0xffdb('0x2d')][_0xffdb('0x48')](_0x2ce6af[_0xffdb('0x49')],{})[_0xffdb('0x27')](respondWithResult(_0x28141f,0xc9))[_0xffdb('0x42')](handleError(_0x28141f,null));};exports[_0xffdb('0x26')]=function(_0x48ffc7,_0x59f369){if(_0x48ffc7[_0xffdb('0x49')]['id']){delete _0x48ffc7[_0xffdb('0x49')]['id'];}return db[_0xffdb('0x2d')][_0xffdb('0x47')]({'where':{'id':_0x48ffc7[_0xffdb('0x4a')]['id']}})[_0xffdb('0x27')](handleEntityNotFound(_0x59f369,null))[_0xffdb('0x27')](saveUpdates(_0x48ffc7[_0xffdb('0x49')],null))[_0xffdb('0x27')](respondWithResult(_0x59f369,null))[_0xffdb('0x42')](handleError(_0x59f369,null));};exports[_0xffdb('0x28')]=function(_0x11cb37,_0x56e9e9){return db[_0xffdb('0x2d')][_0xffdb('0x47')]({'where':{'id':_0x11cb37[_0xffdb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56e9e9,null))[_0xffdb('0x27')](removeEntity(_0x56e9e9,null))['catch'](handleError(_0x56e9e9,null));};exports[_0xffdb('0x4b')]=function(_0x43f64f,_0x129fe6){return db[_0xffdb('0x2d')][_0xffdb('0x4b')]()[_0xffdb('0x27')](respondWithResult(_0x129fe6,null))['catch'](handleError(_0x129fe6,null));}; \ No newline at end of file +var _0xb3ac=['find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','VoiceDialReport','includeAll','include','catch','show','params'];(function(_0x32917a,_0x3559ea){var _0x1881e1=function(_0x56730d){while(--_0x56730d){_0x32917a['push'](_0x32917a['shift']());}};_0x1881e1(++_0x3559ea);}(_0xb3ac,0x1e0));var _0xcb3a=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xb3ac[_0x3c504b];return _0x2e5354;};'use strict';var emlformat=require(_0xcb3a('0x0'));var rimraf=require(_0xcb3a('0x1'));var zipdir=require(_0xcb3a('0x2'));var jsonpatch=require(_0xcb3a('0x3'));var rp=require(_0xcb3a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcb3a('0x5'));var util=require('util');var path=require(_0xcb3a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb3a('0x7'));var squel=require(_0xcb3a('0x8'));var crypto=require(_0xcb3a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xcb3a('0xa'));var toCsv=require(_0xcb3a('0xb'));var querystring=require(_0xcb3a('0xc'));var Papa=require('papaparse');var Redis=require(_0xcb3a('0xd'));var authService=require(_0xcb3a('0xe'));var qs=require(_0xcb3a('0xf'));var as=require(_0xcb3a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb3a('0x11'))(_0xcb3a('0x12'));var utils=require(_0xcb3a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcb3a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5eb22b,_0x43e247){_0x43e247=_0x43e247||0xcc;return function(_0x3f6cb5){if(_0x3f6cb5){return _0x5eb22b[_0xcb3a('0x15')](_0x43e247);}return _0x5eb22b[_0xcb3a('0x16')](_0x43e247)[_0xcb3a('0x17')]();};}function respondWithResult(_0x51fbed,_0x18a68b){_0x18a68b=_0x18a68b||0xc8;return function(_0x2fee3e){if(_0x2fee3e){return _0x51fbed[_0xcb3a('0x16')](_0x18a68b)[_0xcb3a('0x18')](_0x2fee3e);}};}function respondWithFilteredResult(_0x2c2469,_0x21d565){return function(_0x42da2f){if(_0x42da2f){var _0x38ce2d=typeof _0x21d565['offset']==='undefined'&&typeof _0x21d565[_0xcb3a('0x19')]===_0xcb3a('0x1a');var _0x4fa6d1=_0x42da2f[_0xcb3a('0x1b')];var _0x148e8b=_0x38ce2d?0x0:_0x21d565[_0xcb3a('0x1c')];var _0x1acc34=_0x38ce2d?_0x42da2f[_0xcb3a('0x1b')]:_0x21d565[_0xcb3a('0x1c')]+_0x21d565[_0xcb3a('0x19')];var _0x5d4561;if(_0x1acc34>=_0x4fa6d1){_0x1acc34=_0x4fa6d1;_0x5d4561=0xc8;}else{_0x5d4561=0xce;}_0x2c2469[_0xcb3a('0x16')](_0x5d4561);return _0x2c2469['set'](_0xcb3a('0x1d'),_0x148e8b+'-'+_0x1acc34+'/'+_0x4fa6d1)[_0xcb3a('0x18')](_0x42da2f);}return null;};}function patchUpdates(_0x198e96){return function(_0x18459b){try{jsonpatch['apply'](_0x18459b,_0x198e96,!![]);}catch(_0x503f40){return BPromise['reject'](_0x503f40);}return _0x18459b[_0xcb3a('0x1e')]();};}function saveUpdates(_0x52ed0c,_0x47fd86){return function(_0x38e327){if(_0x38e327){return _0x38e327[_0xcb3a('0x1f')](_0x52ed0c)[_0xcb3a('0x20')](function(_0x4ae948){return _0x4ae948;});}return null;};}function removeEntity(_0x5a9264,_0x5917c3){return function(_0x488c0b){if(_0x488c0b){return _0x488c0b[_0xcb3a('0x21')]()[_0xcb3a('0x20')](function(){_0x5a9264[_0xcb3a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x255b42,_0x9348eb){return function(_0x55784b){if(!_0x55784b){_0x255b42[_0xcb3a('0x15')](0x194);}return _0x55784b;};}function handleError(_0x2ed043,_0x2fe8b0){_0x2fe8b0=_0x2fe8b0||0x1f4;return function(_0x5a4efa){logger['error'](_0x5a4efa[_0xcb3a('0x22')]);if(_0x5a4efa[_0xcb3a('0x23')]){delete _0x5a4efa[_0xcb3a('0x23')];}_0x2ed043['status'](_0x2fe8b0)[_0xcb3a('0x24')](_0x5a4efa);};}exports['index']=function(_0x2d7f45,_0xb847ea){var _0x94ce31={},_0x2e466c={},_0x22efcb={'count':0x0,'rows':[]};var _0x4c3a50=_[_0xcb3a('0x25')](db['VoiceDialReport'][_0xcb3a('0x26')],function(_0x2a4bc8){return{'name':_0x2a4bc8[_0xcb3a('0x27')],'type':_0x2a4bc8['type']['key']};});_0x2e466c[_0xcb3a('0x28')]=_[_0xcb3a('0x25')](_0x4c3a50,_0xcb3a('0x23'));_0x2e466c['query']=_[_0xcb3a('0x29')](_0x2d7f45[_0xcb3a('0x2a')]);_0x2e466c[_0xcb3a('0x2b')]=_[_0xcb3a('0x2c')](_0x2e466c[_0xcb3a('0x28')],_0x2e466c['query']);_0x94ce31[_0xcb3a('0x2d')]=_[_0xcb3a('0x2c')](_0x2e466c['model'],qs['fields'](_0x2d7f45[_0xcb3a('0x2a')][_0xcb3a('0x2e')]));_0x94ce31[_0xcb3a('0x2d')]=_0x94ce31['attributes'][_0xcb3a('0x2f')]?_0x94ce31['attributes']:_0x2e466c[_0xcb3a('0x28')];if(!_0x2d7f45[_0xcb3a('0x2a')][_0xcb3a('0x30')](_0xcb3a('0x31'))){_0x94ce31[_0xcb3a('0x19')]=qs[_0xcb3a('0x19')](_0x2d7f45[_0xcb3a('0x2a')][_0xcb3a('0x19')]);_0x94ce31['offset']=qs[_0xcb3a('0x1c')](_0x2d7f45[_0xcb3a('0x2a')][_0xcb3a('0x1c')]);}_0x94ce31['order']=qs[_0xcb3a('0x32')](_0x2d7f45['query']['sort']);_0x94ce31[_0xcb3a('0x33')]=qs[_0xcb3a('0x2b')](_[_0xcb3a('0x34')](_0x2d7f45[_0xcb3a('0x2a')],_0x2e466c[_0xcb3a('0x2b')]),_0x4c3a50);if(_0x2d7f45[_0xcb3a('0x2a')]['filter']){_0x94ce31['where']=_[_0xcb3a('0x35')](_0x94ce31['where'],{'$or':_[_0xcb3a('0x25')](_0x4c3a50,function(_0x1ce27f){if(_0x1ce27f[_0xcb3a('0x36')]!==_0xcb3a('0x37')){var _0x25b356={};_0x25b356[_0x1ce27f[_0xcb3a('0x23')]]={'$like':'%'+_0x2d7f45['query'][_0xcb3a('0x38')]+'%'};return _0x25b356;}})});}_0x94ce31=_['merge']({},_0x94ce31,_0x2d7f45[_0xcb3a('0x39')]);var _0x38c546={'where':_0x94ce31[_0xcb3a('0x33')]};return db[_0xcb3a('0x3a')]['count'](_0x38c546)[_0xcb3a('0x20')](function(_0x396c4b){_0x22efcb[_0xcb3a('0x1b')]=_0x396c4b;if(_0x2d7f45[_0xcb3a('0x2a')][_0xcb3a('0x3b')]){_0x94ce31[_0xcb3a('0x3c')]=[{'all':!![]}];}return db[_0xcb3a('0x3a')]['findAll'](_0x94ce31);})[_0xcb3a('0x20')](function(_0x1b301f){_0x22efcb['rows']=_0x1b301f;return _0x22efcb;})[_0xcb3a('0x20')](respondWithFilteredResult(_0xb847ea,_0x94ce31))[_0xcb3a('0x3d')](handleError(_0xb847ea,null));};exports[_0xcb3a('0x3e')]=function(_0x1bb764,_0x2483f1){var _0x1d7f47={'raw':!![],'where':{'id':_0x1bb764[_0xcb3a('0x3f')]['id']}},_0x51afcf={};_0x51afcf[_0xcb3a('0x28')]=_['keys'](db[_0xcb3a('0x3a')][_0xcb3a('0x26')]);_0x51afcf[_0xcb3a('0x2a')]=_['keys'](_0x1bb764[_0xcb3a('0x2a')]);_0x51afcf[_0xcb3a('0x2b')]=_[_0xcb3a('0x2c')](_0x51afcf['model'],_0x51afcf[_0xcb3a('0x2a')]);_0x1d7f47[_0xcb3a('0x2d')]=_[_0xcb3a('0x2c')](_0x51afcf[_0xcb3a('0x28')],qs['fields'](_0x1bb764['query'][_0xcb3a('0x2e')]));_0x1d7f47[_0xcb3a('0x2d')]=_0x1d7f47['attributes']['length']?_0x1d7f47[_0xcb3a('0x2d')]:_0x51afcf[_0xcb3a('0x28')];if(_0x1bb764['query'][_0xcb3a('0x3b')]){_0x1d7f47[_0xcb3a('0x3c')]=[{'all':!![]}];}_0x1d7f47=_[_0xcb3a('0x35')]({},_0x1d7f47,_0x1bb764[_0xcb3a('0x39')]);return db[_0xcb3a('0x3a')][_0xcb3a('0x40')](_0x1d7f47)[_0xcb3a('0x20')](handleEntityNotFound(_0x2483f1,null))['then'](respondWithResult(_0x2483f1,null))[_0xcb3a('0x3d')](handleError(_0x2483f1,null));};exports[_0xcb3a('0x41')]=function(_0x37db9b,_0xecb50d){return db[_0xcb3a('0x3a')][_0xcb3a('0x41')](_0x37db9b['body'],{})[_0xcb3a('0x20')](respondWithResult(_0xecb50d,0xc9))['catch'](handleError(_0xecb50d,null));};exports['update']=function(_0x2b3543,_0x51b0d8){if(_0x2b3543[_0xcb3a('0x42')]['id']){delete _0x2b3543[_0xcb3a('0x42')]['id'];}return db[_0xcb3a('0x3a')][_0xcb3a('0x40')]({'where':{'id':_0x2b3543[_0xcb3a('0x3f')]['id']}})[_0xcb3a('0x20')](handleEntityNotFound(_0x51b0d8,null))['then'](saveUpdates(_0x2b3543['body'],null))[_0xcb3a('0x20')](respondWithResult(_0x51b0d8,null))[_0xcb3a('0x3d')](handleError(_0x51b0d8,null));};exports[_0xcb3a('0x21')]=function(_0x2e04b0,_0x215303){return db[_0xcb3a('0x3a')][_0xcb3a('0x40')]({'where':{'id':_0x2e04b0[_0xcb3a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x215303,null))[_0xcb3a('0x20')](removeEntity(_0x215303,null))[_0xcb3a('0x3d')](handleError(_0x215303,null));};exports[_0xcb3a('0x43')]=function(_0x41c4bc,_0x46892a){return db[_0xcb3a('0x3a')]['describe']()[_0xcb3a('0x20')](respondWithResult(_0x46892a,null))[_0xcb3a('0x3d')](handleError(_0x46892a,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index d6f2dd0..06bde1b 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 _0x1e5f=['rimraf','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3a2bbb,_0x332504){var _0x2889ed=function(_0x6c7bd4){while(--_0x6c7bd4){_0x3a2bbb['push'](_0x3a2bbb['shift']());}};_0x2889ed(++_0x332504);}(_0x1e5f,0xae));var _0xf1e5=function(_0x4b7d87,_0x238711){_0x4b7d87=_0x4b7d87-0x0;var _0x3b9f82=_0x1e5f[_0x4b7d87];return _0x3b9f82;};'use strict';var _=require(_0xf1e5('0x0'));var util=require(_0xf1e5('0x1'));var logger=require(_0xf1e5('0x2'))(_0xf1e5('0x3'));var moment=require(_0xf1e5('0x4'));var BPromise=require(_0xf1e5('0x5'));var rp=require(_0xf1e5('0x6'));var fs=require('fs');var path=require(_0xf1e5('0x7'));var rimraf=require(_0xf1e5('0x8'));var config=require('../../config/environment');var attributes=require(_0xf1e5('0x9'));module['exports']=function(_0x4bd832,_0x32be29){return _0x4bd832[_0xf1e5('0xa')](_0xf1e5('0xb'),attributes,{'tableName':_0xf1e5('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x433b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api'];(function(_0x551b29,_0x2570e2){var _0x1871a2=function(_0x5ef7ee){while(--_0x5ef7ee){_0x551b29['push'](_0x551b29['shift']());}};_0x1871a2(++_0x2570e2);}(_0x433b,0x15c));var _0xb433=function(_0x2bf5d1,_0x14e28f){_0x2bf5d1=_0x2bf5d1-0x0;var _0x3472c6=_0x433b[_0x2bf5d1];return _0x3472c6;};'use strict';var _=require('lodash');var util=require(_0xb433('0x0'));var logger=require(_0xb433('0x1'))(_0xb433('0x2'));var moment=require(_0xb433('0x3'));var BPromise=require(_0xb433('0x4'));var rp=require(_0xb433('0x5'));var fs=require('fs');var path=require(_0xb433('0x6'));var rimraf=require(_0xb433('0x7'));var config=require(_0xb433('0x8'));var attributes=require(_0xb433('0x9'));module['exports']=function(_0x6798ff,_0x391bb3){return _0x6798ff['define'](_0xb433('0xa'),attributes,{'tableName':_0xb433('0xb'),'paranoid':![],'indexes':[{'fields':[_0xb433('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 1c4a201..47fa203 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 _0xebd2=['message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','update','raw','limit','UpdateVoiceDialReport','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x213fa0,_0x308862){var _0x5668a6=function(_0x160cea){while(--_0x160cea){_0x213fa0['push'](_0x213fa0['shift']());}};_0x5668a6(++_0x308862);}(_0xebd2,0xc6));var _0x2ebd=function(_0x4e36c9,_0x56520f){_0x4e36c9=_0x4e36c9-0x0;var _0x33092c=_0xebd2[_0x4e36c9];return _0x33092c;};'use strict';var _=require('lodash');var util=require(_0x2ebd('0x0'));var moment=require(_0x2ebd('0x1'));var BPromise=require(_0x2ebd('0x2'));var rs=require(_0x2ebd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ebd('0x4'))['db'];var utils=require(_0x2ebd('0x5'));var logger=require(_0x2ebd('0x6'))('rpc');var config=require(_0x2ebd('0x7'));var jayson=require(_0x2ebd('0x8'));var client=jayson['client'][_0x2ebd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x243434,_0x2d81d0,_0x4c284e){return new BPromise(function(_0x11561b,_0x791b5){return client['request'](_0x243434,_0x4c284e)[_0x2ebd('0xa')](function(_0x227e44){logger[_0x2ebd('0xb')](_0x2ebd('0xc'),_0x2d81d0,_0x2ebd('0xd'));logger[_0x2ebd('0xe')](_0x2ebd('0xf'),_0x2d81d0,_0x2ebd('0xd'),JSON[_0x2ebd('0x10')](_0x227e44));if(_0x227e44[_0x2ebd('0x11')]){if(_0x227e44[_0x2ebd('0x11')][_0x2ebd('0x12')]===0x1f4){logger[_0x2ebd('0x11')](_0x2ebd('0xc'),_0x2d81d0,_0x227e44[_0x2ebd('0x11')][_0x2ebd('0x13')]);return _0x791b5(_0x227e44[_0x2ebd('0x11')][_0x2ebd('0x13')]);}logger[_0x2ebd('0x11')](_0x2ebd('0xc'),_0x2d81d0,_0x227e44[_0x2ebd('0x11')][_0x2ebd('0x13')]);return _0x11561b(_0x227e44[_0x2ebd('0x11')][_0x2ebd('0x13')]);}else{logger[_0x2ebd('0xb')](_0x2ebd('0xc'),_0x2d81d0,_0x2ebd('0xd'));_0x11561b(_0x227e44[_0x2ebd('0x14')]['message']);}})['catch'](function(_0x3714ad){logger[_0x2ebd('0x11')](_0x2ebd('0xc'),_0x2d81d0,_0x3714ad);_0x791b5(_0x3714ad);});});}exports[_0x2ebd('0x15')]=function(_0x582776){var _0x38b111=this;return new Promise(function(_0x10777f,_0x4bde6d){return db[_0x2ebd('0x16')][_0x2ebd('0x17')](_0x582776[_0x2ebd('0x18')],{'raw':_0x582776[_0x2ebd('0x19')]?_0x582776['options']['raw']===undefined?!![]:![]:!![]})[_0x2ebd('0xa')](function(_0x1f6f14){logger[_0x2ebd('0xb')](_0x2ebd('0x15'),_0x582776);logger[_0x2ebd('0xe')](_0x2ebd('0x15'),_0x582776,JSON['stringify'](_0x1f6f14));_0x10777f(_0x1f6f14);})['catch'](function(_0xb2f07){logger[_0x2ebd('0x11')](_0x2ebd('0x15'),_0xb2f07[_0x2ebd('0x13')],_0x582776);_0x4bde6d(_0x38b111[_0x2ebd('0x11')](0x1f4,_0xb2f07[_0x2ebd('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x7d6eff){var _0x1e2118=this;return new Promise(function(_0x453a18,_0x4640d1){return db[_0x2ebd('0x16')][_0x2ebd('0x1a')](_0x7d6eff[_0x2ebd('0x18')],{'raw':_0x7d6eff[_0x2ebd('0x19')]?_0x7d6eff['options'][_0x2ebd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7d6eff[_0x2ebd('0x19')]?_0x7d6eff['options']['where']||null:null,'attributes':_0x7d6eff[_0x2ebd('0x19')]?_0x7d6eff[_0x2ebd('0x19')]['attributes']||null:null,'limit':_0x7d6eff[_0x2ebd('0x19')]?_0x7d6eff[_0x2ebd('0x19')][_0x2ebd('0x1c')]||null:null})[_0x2ebd('0xa')](function(_0x1f0073){logger[_0x2ebd('0xb')](_0x2ebd('0x1d'),_0x7d6eff);logger[_0x2ebd('0xe')](_0x2ebd('0x1d'),_0x7d6eff,JSON[_0x2ebd('0x10')](_0x1f0073));_0x453a18(_0x1f0073);})[_0x2ebd('0x1e')](function(_0x17e096){logger[_0x2ebd('0x11')](_0x2ebd('0x1d'),_0x17e096[_0x2ebd('0x13')],_0x7d6eff);_0x4640d1(_0x1e2118[_0x2ebd('0x11')](0x1f4,_0x17e096['message']));});});}; \ No newline at end of file +var _0x32e8=['limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','update','where','attributes'];(function(_0xbdf03f,_0x595215){var _0x2bbe9e=function(_0x59fbd4){while(--_0x59fbd4){_0xbdf03f['push'](_0xbdf03f['shift']());}};_0x2bbe9e(++_0x595215);}(_0x32e8,0x9c));var _0x832e=function(_0x346953,_0x47fcd7){_0x346953=_0x346953-0x0;var _0xfc29cf=_0x32e8[_0x346953];return _0xfc29cf;};'use strict';var _=require(_0x832e('0x0'));var util=require(_0x832e('0x1'));var moment=require(_0x832e('0x2'));var BPromise=require(_0x832e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x832e('0x4'))['db'];var utils=require(_0x832e('0x5'));var logger=require(_0x832e('0x6'))('rpc');var config=require(_0x832e('0x7'));var jayson=require(_0x832e('0x8'));var client=jayson['client'][_0x832e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca4613,_0x45d387,_0x5aea45){return new BPromise(function(_0x48ffdd,_0xc7a50e){return client['request'](_0xca4613,_0x5aea45)[_0x832e('0xa')](function(_0x36078e){logger[_0x832e('0xb')](_0x832e('0xc'),_0x45d387,_0x832e('0xd'));logger[_0x832e('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x45d387,'request\x20sent',JSON[_0x832e('0xf')](_0x36078e));if(_0x36078e[_0x832e('0x10')]){if(_0x36078e[_0x832e('0x10')][_0x832e('0x11')]===0x1f4){logger[_0x832e('0x10')](_0x832e('0xc'),_0x45d387,_0x36078e[_0x832e('0x10')][_0x832e('0x12')]);return _0xc7a50e(_0x36078e[_0x832e('0x10')]['message']);}logger[_0x832e('0x10')](_0x832e('0xc'),_0x45d387,_0x36078e['error'][_0x832e('0x12')]);return _0x48ffdd(_0x36078e[_0x832e('0x10')][_0x832e('0x12')]);}else{logger['info'](_0x832e('0xc'),_0x45d387,'request\x20sent');_0x48ffdd(_0x36078e['result'][_0x832e('0x12')]);}})['catch'](function(_0x18efa3){logger['error'](_0x832e('0xc'),_0x45d387,_0x18efa3);_0xc7a50e(_0x18efa3);});});}exports[_0x832e('0x13')]=function(_0x51ae35){var _0x56d528=this;return new Promise(function(_0x59f63b,_0x5cf120){return db[_0x832e('0x14')][_0x832e('0x15')](_0x51ae35[_0x832e('0x16')],{'raw':_0x51ae35[_0x832e('0x17')]?_0x51ae35[_0x832e('0x17')][_0x832e('0x18')]===undefined?!![]:![]:!![]})[_0x832e('0xa')](function(_0x113909){logger[_0x832e('0xb')](_0x832e('0x13'),_0x51ae35);logger[_0x832e('0xe')]('CreateVoiceDialReport',_0x51ae35,JSON[_0x832e('0xf')](_0x113909));_0x59f63b(_0x113909);})[_0x832e('0x19')](function(_0x5b440f){logger[_0x832e('0x10')](_0x832e('0x13'),_0x5b440f[_0x832e('0x12')],_0x51ae35);_0x5cf120(_0x56d528['error'](0x1f4,_0x5b440f[_0x832e('0x12')]));});});};exports[_0x832e('0x1a')]=function(_0x20e68e){var _0x48648c=this;return new Promise(function(_0x265948,_0x561f65){return db[_0x832e('0x14')][_0x832e('0x1b')](_0x20e68e[_0x832e('0x16')],{'raw':_0x20e68e['options']?_0x20e68e[_0x832e('0x17')][_0x832e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20e68e[_0x832e('0x17')]?_0x20e68e['options'][_0x832e('0x1c')]||null:null,'attributes':_0x20e68e[_0x832e('0x17')]?_0x20e68e[_0x832e('0x17')][_0x832e('0x1d')]||null:null,'limit':_0x20e68e['options']?_0x20e68e['options'][_0x832e('0x1e')]||null:null})[_0x832e('0xa')](function(_0x1b5173){logger[_0x832e('0xb')]('UpdateVoiceDialReport',_0x20e68e);logger[_0x832e('0xe')](_0x832e('0x1a'),_0x20e68e,JSON['stringify'](_0x1b5173));_0x265948(_0x1b5173);})['catch'](function(_0x38784e){logger['error'](_0x832e('0x1a'),_0x38784e['message'],_0x20e68e);_0x561f65(_0x48648c[_0x832e('0x10')](0x1f4,_0x38784e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c235f1a..231060f 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 _0x8582=['show','post','create','addApplications','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x184249,_0x1ea42d){var _0x503127=function(_0x124301){while(--_0x124301){_0x184249['push'](_0x184249['shift']());}};_0x503127(++_0x1ea42d);}(_0x8582,0x16f));var _0x2858=function(_0x36461a,_0x3077b8){_0x36461a=_0x36461a-0x0;var _0x117ee4=_0x8582[_0x36461a];return _0x117ee4;};'use strict';var multer=require(_0x2858('0x0'));var util=require(_0x2858('0x1'));var path=require(_0x2858('0x2'));var timeout=require(_0x2858('0x3'));var express=require(_0x2858('0x4'));var router=express[_0x2858('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2858('0x6'));var interaction=require(_0x2858('0x7'));var config=require(_0x2858('0x8'));var controller=require('./voiceExtension.controller');router[_0x2858('0x9')]('/',auth[_0x2858('0xa')](),controller[_0x2858('0xb')]);router[_0x2858('0x9')](_0x2858('0xc'),auth[_0x2858('0xa')](),controller[_0x2858('0xd')]);router[_0x2858('0xe')]('/',auth[_0x2858('0xa')](),controller[_0x2858('0xf')]);router[_0x2858('0xe')]('/:id/applications',auth[_0x2858('0xa')](),controller[_0x2858('0x10')]);router['put'](_0x2858('0xc'),auth[_0x2858('0xa')](),controller['update']);router[_0x2858('0x11')](_0x2858('0xc'),auth[_0x2858('0xa')](),controller[_0x2858('0x12')]);module[_0x2858('0x13')]=router; \ No newline at end of file +var _0xeeca=['create','/:id/applications','addApplications','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post'];(function(_0x214bc8,_0x1a0646){var _0x1bbb3d=function(_0x3021e9){while(--_0x3021e9){_0x214bc8['push'](_0x214bc8['shift']());}};_0x1bbb3d(++_0x1a0646);}(_0xeeca,0xe4));var _0xaeec=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xeeca[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0xaeec('0x0'));var util=require(_0xaeec('0x1'));var path=require(_0xaeec('0x2'));var timeout=require('connect-timeout');var express=require(_0xaeec('0x3'));var router=express[_0xaeec('0x4')]();var fs_extra=require(_0xaeec('0x5'));var auth=require(_0xaeec('0x6'));var interaction=require(_0xaeec('0x7'));var config=require(_0xaeec('0x8'));var controller=require('./voiceExtension.controller');router[_0xaeec('0x9')]('/',auth['isAuthenticated'](),controller[_0xaeec('0xa')]);router[_0xaeec('0x9')]('/:id',auth[_0xaeec('0xb')](),controller[_0xaeec('0xc')]);router[_0xaeec('0xd')]('/',auth['isAuthenticated'](),controller[_0xaeec('0xe')]);router[_0xaeec('0xd')](_0xaeec('0xf'),auth[_0xaeec('0xb')](),controller[_0xaeec('0x10')]);router[_0xaeec('0x11')](_0xaeec('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xaeec('0x13')](_0xaeec('0x12'),auth[_0xaeec('0xb')](),controller[_0xaeec('0x14')]);module[_0xaeec('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a5dbc93..df44025 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 _0xb816=['NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','exports','STRING','compositeIndex'];(function(_0x5b0f22,_0x375e8c){var _0x29d496=function(_0x5469cb){while(--_0x5469cb){_0x5b0f22['push'](_0x5b0f22['shift']());}};_0x29d496(++_0x375e8c);}(_0xb816,0x66));var _0x6b81=function(_0x703ffa,_0x5c60f7){_0x703ffa=_0x703ffa-0x0;var _0xb3b2f7=_0xb816[_0x703ffa];return _0xb3b2f7;};'use strict';var Sequelize=require('sequelize');module[_0x6b81('0x0')]={'context':{'type':Sequelize[_0x6b81('0x1')],'allowNull':![],'unique':_0x6b81('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6b81('0x2')},'priority':{'type':Sequelize[_0x6b81('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x6b81('0x2')},'tag':{'type':Sequelize[_0x6b81('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6b81('0x1')],'allowNull':![],'defaultValue':_0x6b81('0x3')},'appdata':{'type':Sequelize[_0x6b81('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6b81('0x4')]('inbound',_0x6b81('0x5'),_0x6b81('0x6'),_0x6b81('0x7'),_0x6b81('0x8'),'system',_0x6b81('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x6b81('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b81('0xa')},'IntervalId':{'type':Sequelize[_0x6b81('0xb')]},'isApp':{'type':Sequelize[_0x6b81('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6b81('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6b81('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6b81('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6b81('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x6b81('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6b81('0xd')],'get':function(_0xc3a0d0){return this['getDataValue'](_0x6b81('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xe323=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system'];(function(_0x1fedfe,_0x1c8f22){var _0x55303d=function(_0x2e77b9){while(--_0x2e77b9){_0x1fedfe['push'](_0x1fedfe['shift']());}};_0x55303d(++_0x1c8f22);}(_0xe323,0x15d));var _0x3e32=function(_0x2ec3e9,_0x121cf2){_0x2ec3e9=_0x2ec3e9-0x0;var _0x4a6a67=_0xe323[_0x2ec3e9];return _0x4a6a67;};'use strict';var Sequelize=require(_0x3e32('0x0'));module[_0x3e32('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3e32('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3e32('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x3e32('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x3e32('0x2')},'tag':{'type':Sequelize[_0x3e32('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x3e32('0x3')],'allowNull':![],'defaultValue':_0x3e32('0x4')},'appdata':{'type':Sequelize[_0x3e32('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3e32('0x5')](_0x3e32('0x6'),_0x3e32('0x7'),_0x3e32('0x8'),_0x3e32('0x9'),'outbound-fax',_0x3e32('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x3e32('0x3')]},'interval':{'type':Sequelize[_0x3e32('0x3')],'allowNull':![],'defaultValue':_0x3e32('0xb')},'IntervalId':{'type':Sequelize[_0x3e32('0xc')]},'isApp':{'type':Sequelize[_0x3e32('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3e32('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x3e32('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3e32('0xc')]},'recordingFormat':{'type':Sequelize[_0x3e32('0x3')],'defaultValue':_0x3e32('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x3e32('0xf')],'get':function(_0x370d82){return this[_0x3e32('0x10')](_0x3e32('0x11'));}},'alias':{'type':Sequelize[_0x3e32('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index f30b0e5..817477f 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 _0xaaf9=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','include','findAll','rows','show','params','rawAttributes','keys','options','catch','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','findAndCountAll','priority','stack','finally','lodash','ioredis','../../config/logger','api','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','then','get','InboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceExtension','fieldName','model','query','filters','intersection'];(function(_0x118a88,_0x166f95){var _0x5a5ae7=function(_0x180b2d){while(--_0x180b2d){_0x118a88['push'](_0x118a88['shift']());}};_0x5a5ae7(++_0x166f95);}(_0xaaf9,0x8d));var _0x9aaf=function(_0x67fb40,_0x56a4f0){_0x67fb40=_0x67fb40-0x0;var _0x42386=_0xaaf9[_0x67fb40];return _0x42386;};'use strict';var _=require(_0x9aaf('0x0'));var Redis=require(_0x9aaf('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x9aaf('0x2'))(_0x9aaf('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9aaf('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x9aaf('0x5'))(new Redis(config[_0x9aaf('0x4')]));require(_0x9aaf('0x6'))[_0x9aaf('0x7')](socket);function respondWithStatusCode(_0x110784,_0x45ec6c){_0x45ec6c=_0x45ec6c||0xcc;return function(_0x3f622d){if(_0x3f622d){return _0x110784[_0x9aaf('0x8')](_0x45ec6c);}return _0x110784[_0x9aaf('0x9')](_0x45ec6c)[_0x9aaf('0xa')]();};}function respondWithResult(_0x2086a9,_0x160b56){_0x160b56=_0x160b56||0xc8;return function(_0x440e74){if(_0x440e74){return _0x2086a9[_0x9aaf('0x9')](_0x160b56)[_0x9aaf('0xb')](_0x440e74);}};}function respondWithFilteredResult(_0x54b584,_0x192380){return function(_0x1c6a3f){if(_0x1c6a3f){var _0x15d390=typeof _0x192380[_0x9aaf('0xc')]===_0x9aaf('0xd')&&typeof _0x192380['limit']==='undefined';var _0x2d969a=_0x1c6a3f[_0x9aaf('0xe')];var _0x39c7ff=_0x15d390?0x0:_0x192380[_0x9aaf('0xc')];var _0x27eb4d=_0x15d390?_0x1c6a3f[_0x9aaf('0xe')]:_0x192380[_0x9aaf('0xc')]+_0x192380[_0x9aaf('0xf')];var _0x4f6fd3;if(_0x27eb4d>=_0x2d969a){_0x27eb4d=_0x2d969a;_0x4f6fd3=0xc8;}else{_0x4f6fd3=0xce;}_0x54b584[_0x9aaf('0x9')](_0x4f6fd3);return _0x54b584['set'](_0x9aaf('0x10'),_0x39c7ff+'-'+_0x27eb4d+'/'+_0x2d969a)[_0x9aaf('0xb')](_0x1c6a3f);}return null;};}function removeEntity(_0x43b8c8){return function(_0x20637f){if(_0x20637f){return _0x20637f[_0x9aaf('0x11')]()[_0x9aaf('0x12')](function(){var _0x50b256=_0x20637f[_0x9aaf('0x13')]({'plain':!![]});var _0x3574f7=[{'name':_0x9aaf('0x14'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x9aaf('0x15'),'ignore':![]},{'name':_0x9aaf('0x16'),'value':_0x9aaf('0x17'),'ignore':![]}];var _0x402806=_(_0x3574f7)[_0x9aaf('0x18')]('ignore')[_0x9aaf('0x19')](_0x9aaf('0x1a'))[_0x9aaf('0x1a')]();if(_[_0x9aaf('0x1b')](_0x402806,_0x50b256[_0x9aaf('0x1c')])){return;}var _0x44c9d1=_[_0x9aaf('0x1d')](_0x3574f7,[_0x9aaf('0x1a'),_0x50b256[_0x9aaf('0x1c')]])[_0x9aaf('0x1e')];return db[_0x9aaf('0x1f')][_0x9aaf('0x11')]({'where':{'type':_0x44c9d1,'resourceId':_0x50b256['id']}})[_0x9aaf('0x12')](function(){return _0x20637f;});})[_0x9aaf('0x12')](function(){_0x43b8c8[_0x9aaf('0x9')](0xcc)[_0x9aaf('0xa')]();});}};}function handleEntityNotFound(_0x14ed70){return function(_0x1fd662){if(!_0x1fd662){_0x14ed70[_0x9aaf('0x8')](0x194);}return _0x1fd662;};}function handleError(_0x1b123f,_0x5162b4){_0x5162b4=_0x5162b4||0x1f4;return function(_0x134b73){logger[_0x9aaf('0x20')](_0x134b73['stack']);if(_0x134b73['name']){delete _0x134b73[_0x9aaf('0x1e')];}_0x1b123f['status'](_0x5162b4)[_0x9aaf('0x21')](_0x134b73);};}exports[_0x9aaf('0x22')]=function(_0x278d6d,_0x806cfd){var _0x290e36={},_0x2b25e2={},_0x4f554e={'count':0x0,'rows':[]};var _0x2b3981=_['map'](db[_0x9aaf('0x23')]['rawAttributes'],function(_0x9d84d2){return{'name':_0x9d84d2[_0x9aaf('0x24')],'type':_0x9d84d2[_0x9aaf('0x1c')]['key']};});_0x2b25e2[_0x9aaf('0x25')]=_[_0x9aaf('0x19')](_0x2b3981,_0x9aaf('0x1e'));_0x2b25e2[_0x9aaf('0x26')]=_['keys'](_0x278d6d[_0x9aaf('0x26')]);_0x2b25e2[_0x9aaf('0x27')]=_[_0x9aaf('0x28')](_0x2b25e2[_0x9aaf('0x25')],_0x2b25e2[_0x9aaf('0x26')]);_0x290e36['attributes']=_[_0x9aaf('0x28')](_0x2b25e2['model'],qs[_0x9aaf('0x29')](_0x278d6d['query'][_0x9aaf('0x29')]));_0x290e36[_0x9aaf('0x2a')]=_0x290e36[_0x9aaf('0x2a')][_0x9aaf('0x2b')]?_0x290e36['attributes']:_0x2b25e2[_0x9aaf('0x25')];if(!_0x278d6d[_0x9aaf('0x26')][_0x9aaf('0x2c')](_0x9aaf('0x2d'))){_0x290e36[_0x9aaf('0xf')]=qs[_0x9aaf('0xf')](_0x278d6d[_0x9aaf('0x26')][_0x9aaf('0xf')]);_0x290e36['offset']=qs[_0x9aaf('0xc')](_0x278d6d[_0x9aaf('0x26')][_0x9aaf('0xc')]);}_0x290e36[_0x9aaf('0x2e')]=qs[_0x9aaf('0x2f')](_0x278d6d[_0x9aaf('0x26')]['sort']);_0x290e36[_0x9aaf('0x30')]=qs[_0x9aaf('0x27')](_[_0x9aaf('0x31')](_0x278d6d[_0x9aaf('0x26')],_0x2b25e2[_0x9aaf('0x27')]),_0x2b3981);if(_0x278d6d['query']['filter']){_0x290e36[_0x9aaf('0x30')]=_['merge'](_0x290e36[_0x9aaf('0x30')],{'$or':_[_0x9aaf('0x19')](_0x2b3981,function(_0x2c6b31){if(_0x2c6b31[_0x9aaf('0x1c')]!==_0x9aaf('0x32')){var _0x15d281={};_0x15d281[_0x2c6b31[_0x9aaf('0x1e')]]={'$like':'%'+_0x278d6d[_0x9aaf('0x26')]['filter']+'%'};return _0x15d281;}})});}_0x290e36=_[_0x9aaf('0x33')]({},_0x290e36,_0x278d6d['options']);var _0x5d64f2={'where':_0x290e36[_0x9aaf('0x30')]};return db['VoiceExtension'][_0x9aaf('0xe')](_0x5d64f2)[_0x9aaf('0x12')](function(_0x43af88){_0x4f554e[_0x9aaf('0xe')]=_0x43af88;if(_0x278d6d['query']['includeAll']){_0x290e36[_0x9aaf('0x34')]=[{'all':!![]}];}return db[_0x9aaf('0x23')][_0x9aaf('0x35')](_0x290e36);})['then'](function(_0x527dde){_0x4f554e[_0x9aaf('0x36')]=_0x527dde;return _0x4f554e;})[_0x9aaf('0x12')](respondWithFilteredResult(_0x806cfd,_0x290e36))['catch'](handleError(_0x806cfd,null));};exports[_0x9aaf('0x37')]=function(_0x2e164d,_0x267948){var _0x4fa0f2={'raw':![],'where':{'id':_0x2e164d[_0x9aaf('0x38')]['id']}},_0x4fe9f={};_0x4fe9f[_0x9aaf('0x25')]=_['keys'](db['VoiceExtension'][_0x9aaf('0x39')]);_0x4fe9f[_0x9aaf('0x26')]=_[_0x9aaf('0x3a')](_0x2e164d[_0x9aaf('0x26')]);_0x4fe9f[_0x9aaf('0x27')]=_[_0x9aaf('0x28')](_0x4fe9f[_0x9aaf('0x25')],_0x4fe9f[_0x9aaf('0x26')]);_0x4fa0f2[_0x9aaf('0x2a')]=_['intersection'](_0x4fe9f[_0x9aaf('0x25')],qs[_0x9aaf('0x29')](_0x2e164d[_0x9aaf('0x26')]['fields']));_0x4fa0f2[_0x9aaf('0x2a')]=_0x4fa0f2[_0x9aaf('0x2a')][_0x9aaf('0x2b')]?_0x4fa0f2[_0x9aaf('0x2a')]:_0x4fe9f[_0x9aaf('0x25')];if(_0x2e164d['query']['includeAll']){_0x4fa0f2[_0x9aaf('0x34')]=[{'all':!![]}];}_0x4fa0f2=_['merge']({},_0x4fa0f2,_0x2e164d[_0x9aaf('0x3b')]);return db['VoiceExtension'][_0x9aaf('0x1d')](_0x4fa0f2)['then'](handleEntityNotFound(_0x267948,null))[_0x9aaf('0x12')](respondWithResult(_0x267948,null))['catch'](handleError(_0x267948,null));};exports[_0x9aaf('0x11')]=function(_0x562ec1,_0x41b5bb){return db[_0x9aaf('0x23')][_0x9aaf('0x1d')]({'where':{'id':_0x562ec1[_0x9aaf('0x38')]['id']}})[_0x9aaf('0x12')](handleEntityNotFound(_0x41b5bb,null))[_0x9aaf('0x12')](removeEntity(_0x41b5bb,null))[_0x9aaf('0x3c')](handleError(_0x41b5bb,null));};exports[_0x9aaf('0x3d')]=function(_0x592f42,_0x29465d){if(_0x592f42[_0x9aaf('0x3e')][_0x9aaf('0x1c')]==='outbound'&&!_['startsWith'](_0x592f42[_0x9aaf('0x3e')][_0x9aaf('0x3f')],'_')){_0x592f42[_0x9aaf('0x3e')][_0x9aaf('0x3f')]='_'[_0x9aaf('0x40')](_0x592f42[_0x9aaf('0x3e')][_0x9aaf('0x3f')]);}return db[_0x9aaf('0x23')][_0x9aaf('0x3d')](_0x592f42[_0x9aaf('0x3e')],{'raw':![]})[_0x9aaf('0x12')](function(_0x9b79e9){var _0x3be242=_0x592f42[_0x9aaf('0x41')][_0x9aaf('0x13')]({'plain':!![]});if(!_0x3be242)throw new Error(_0x9aaf('0x42'));if(_0x3be242[_0x9aaf('0x43')]===_0x9aaf('0x41')){var _0x3799da=_0x9b79e9['get']({'plain':!![]});var _0x5e2b09=[{'name':_0x9aaf('0x14'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x9aaf('0x15')},{'name':'InternalRoutes','value':_0x9aaf('0x17')}];var _0x4360a2=_[_0x9aaf('0x1d')](_0x5e2b09,[_0x9aaf('0x1a'),_0x3799da[_0x9aaf('0x1c')]])[_0x9aaf('0x1e')];return db[_0x9aaf('0x44')][_0x9aaf('0x1d')]({'where':{'name':_0x4360a2,'userProfileId':_0x3be242[_0x9aaf('0x45')]},'raw':!![]})[_0x9aaf('0x12')](function(_0x263bbe){if(_0x263bbe&&_0x263bbe[_0x9aaf('0x46')]===0x0){return db[_0x9aaf('0x1f')][_0x9aaf('0x3d')]({'name':_0x3799da['name'],'resourceId':_0x3799da['id'],'type':_0x263bbe[_0x9aaf('0x1e')],'sectionId':_0x263bbe['id']},{})[_0x9aaf('0x12')](function(){return _0x9b79e9;});}else{return _0x9b79e9;}})[_0x9aaf('0x3c')](function(_0x5362a2){logger[_0x9aaf('0x20')](_0x9aaf('0x47'),_0x5362a2);throw _0x5362a2;});}return _0x9b79e9;})[_0x9aaf('0x12')](respondWithResult(_0x29465d,0xc9))[_0x9aaf('0x3c')](handleError(_0x29465d,null));};exports[_0x9aaf('0x48')]=function(_0x574636,_0x44251d){if(_0x574636[_0x9aaf('0x3e')]['id']){delete _0x574636[_0x9aaf('0x3e')]['id'];}return db['VoiceExtension'][_0x9aaf('0x1d')]({'where':{'id':_0x574636[_0x9aaf('0x38')]['id']}})[_0x9aaf('0x12')](handleEntityNotFound(_0x44251d,null))[_0x9aaf('0x12')](function(_0x483b95){if(_0x483b95){return db['VoiceExtension']['update'](_[_0x9aaf('0x31')](_0x574636['body'],[_0x9aaf('0x3f'),'context',_0x9aaf('0x49'),_0x9aaf('0x4a'),_0x9aaf('0x4b'),_0x9aaf('0x4c'),_0x9aaf('0x4d')]),{'where':{'context':_0x483b95[_0x9aaf('0x4e')],'exten':_0x483b95[_0x9aaf('0x3f')]},'individualHooks':!![]})[_0x9aaf('0x12')](function(_0x3ae513){return _0x3ae513;});}return null;})[_0x9aaf('0x12')](respondWithStatusCode(_0x44251d,null))[_0x9aaf('0x3c')](handleError(_0x44251d,null));};exports[_0x9aaf('0x4f')]=function(_0x8efd5,_0x15b1ea){var _0x471073=_0x8efd5[_0x9aaf('0x38')]['id'];var _0x2ae580=_0x8efd5['body'];var _0x3d6319=0xc8;var _0x6bdca3=null;return db[_0x9aaf('0x50')][_0x9aaf('0x51')]({'isolationLevel':db[_0x9aaf('0x50')][_0x9aaf('0x52')][_0x9aaf('0x53')]['READ_COMMITTED']},function(_0x32dac0){return db[_0x9aaf('0x23')][_0x9aaf('0x54')]({'where':{'id':_0x471073},'transaction':_0x32dac0})[_0x9aaf('0x12')](function(_0xcf0cc3){if(_0xcf0cc3){return db[_0x9aaf('0x23')][_0x9aaf('0x11')]({'where':{'VoiceExtensionId':_0x471073},'transaction':_0x32dac0})[_0x9aaf('0x12')](function(){var _0x4b9e65=_['map'](_0x2ae580,function(_0x26c98a){_0x26c98a[_0x9aaf('0x55')]=_0x471073;_0x26c98a[_0x9aaf('0x56')]=!![];return _0x26c98a;});return _0xcf0cc3['createRouting'](_0x4b9e65);})[_0x9aaf('0x12')](function(_0x700ac3){return db['VoiceExtension']['bulkCreate'](_0x700ac3,{'transaction':_0x32dac0});});}else{_0x3d6319=0x194;_0x6bdca3=[];}});})[_0x9aaf('0x12')](function(){if(_0x3d6319!==0x194){return db['VoiceExtension'][_0x9aaf('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x471073},'order':_0x9aaf('0x58')})[_0x9aaf('0x12')](function(_0x42c8cc){_0x6bdca3=_0x42c8cc;});}})['catch'](function(_0x2ad6cf){_0x3d6319=0x1f4;logger[_0x9aaf('0x20')](_0x2ad6cf[_0x9aaf('0x59')]);if(_0x2ad6cf[_0x9aaf('0x1e')]){delete _0x2ad6cf[_0x9aaf('0x1e')];}_0x6bdca3=_0x2ad6cf;})[_0x9aaf('0x5a')](function(){if(_0x6bdca3===null){_0x15b1ea[_0x9aaf('0x8')](_0x3d6319);}else{if(_0x3d6319===0x1f4){_0x15b1ea[_0x9aaf('0x9')](_0x3d6319)[_0x9aaf('0x21')](_0x6bdca3);}else{_0x15b1ea[_0x9aaf('0x9')](_0x3d6319)[_0x9aaf('0xb')](_0x6bdca3);}}});}; \ No newline at end of file +var _0x37e0=['lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','filter','map','value','includes','type','find','name','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','create','outbound','startsWith','body','exten','concat','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','cutdigits','mandatoryDisposition','sequelize','transaction','Transaction','findOne','VoiceExtensionId','isApp','findAndCountAll','error','finally'];(function(_0x1153de,_0x423cab){var _0x2d001e=function(_0x3148c6){while(--_0x3148c6){_0x1153de['push'](_0x1153de['shift']());}};_0x2d001e(++_0x423cab);}(_0x37e0,0x10e));var _0x037e=function(_0x59f6f5,_0x146cbd){_0x59f6f5=_0x59f6f5-0x0;var _0x523c08=_0x37e0[_0x59f6f5];return _0x523c08;};'use strict';var _=require(_0x037e('0x0'));var Redis=require(_0x037e('0x1'));var qs=require(_0x037e('0x2'));var logger=require(_0x037e('0x3'))(_0x037e('0x4'));var config=require('../../config/environment');var db=require(_0x037e('0x5'))['db'];config[_0x037e('0x6')]=_[_0x037e('0x7')](config[_0x037e('0x6')],{'host':_0x037e('0x8'),'port':0x18eb});var socket=require(_0x037e('0x9'))(new Redis(config[_0x037e('0x6')]));require(_0x037e('0xa'))[_0x037e('0xb')](socket);function respondWithStatusCode(_0x1fc571,_0x34c474){_0x34c474=_0x34c474||0xcc;return function(_0x184c18){if(_0x184c18){return _0x1fc571[_0x037e('0xc')](_0x34c474);}return _0x1fc571[_0x037e('0xd')](_0x34c474)[_0x037e('0xe')]();};}function respondWithResult(_0x44b1a3,_0x24b1cc){_0x24b1cc=_0x24b1cc||0xc8;return function(_0x575425){if(_0x575425){return _0x44b1a3[_0x037e('0xd')](_0x24b1cc)[_0x037e('0xf')](_0x575425);}};}function respondWithFilteredResult(_0x137215,_0x1273af){return function(_0x4a912c){if(_0x4a912c){var _0x53a218=typeof _0x1273af[_0x037e('0x10')]===_0x037e('0x11')&&typeof _0x1273af[_0x037e('0x12')]===_0x037e('0x11');var _0x476d29=_0x4a912c[_0x037e('0x13')];var _0x1a667c=_0x53a218?0x0:_0x1273af[_0x037e('0x10')];var _0x16bfc7=_0x53a218?_0x4a912c[_0x037e('0x13')]:_0x1273af[_0x037e('0x10')]+_0x1273af['limit'];var _0xf2826b;if(_0x16bfc7>=_0x476d29){_0x16bfc7=_0x476d29;_0xf2826b=0xc8;}else{_0xf2826b=0xce;}_0x137215[_0x037e('0xd')](_0xf2826b);return _0x137215[_0x037e('0x14')](_0x037e('0x15'),_0x1a667c+'-'+_0x16bfc7+'/'+_0x476d29)[_0x037e('0xf')](_0x4a912c);}return null;};}function removeEntity(_0x298d8f){return function(_0x2969fb){if(_0x2969fb){return _0x2969fb[_0x037e('0x16')]()[_0x037e('0x17')](function(){var _0x2d7019=_0x2969fb[_0x037e('0x18')]({'plain':!![]});var _0x21fc45=[{'name':_0x037e('0x19'),'value':_0x037e('0x1a'),'ignore':![]},{'name':_0x037e('0x1b'),'value':'outbound','ignore':![]},{'name':_0x037e('0x1c'),'value':'internal','ignore':![]}];var _0x3daf4a=_(_0x21fc45)[_0x037e('0x1d')]('ignore')[_0x037e('0x1e')]('value')[_0x037e('0x1f')]();if(_[_0x037e('0x20')](_0x3daf4a,_0x2d7019[_0x037e('0x21')])){return;}var _0x594f66=_[_0x037e('0x22')](_0x21fc45,[_0x037e('0x1f'),_0x2d7019[_0x037e('0x21')]])[_0x037e('0x23')];return db['UserProfileResource'][_0x037e('0x16')]({'where':{'type':_0x594f66,'resourceId':_0x2d7019['id']}})['then'](function(){return _0x2969fb;});})[_0x037e('0x17')](function(){_0x298d8f[_0x037e('0xd')](0xcc)[_0x037e('0xe')]();});}};}function handleEntityNotFound(_0x123d37){return function(_0x5e76fe){if(!_0x5e76fe){_0x123d37[_0x037e('0xc')](0x194);}return _0x5e76fe;};}function handleError(_0x5123ee,_0x219d3f){_0x219d3f=_0x219d3f||0x1f4;return function(_0x710a9c){logger['error'](_0x710a9c[_0x037e('0x24')]);if(_0x710a9c[_0x037e('0x23')]){delete _0x710a9c[_0x037e('0x23')];}_0x5123ee['status'](_0x219d3f)[_0x037e('0x25')](_0x710a9c);};}exports[_0x037e('0x26')]=function(_0x21b28a,_0x3d616f){var _0x1127b1={},_0x365f59={},_0x9ae2c9={'count':0x0,'rows':[]};var _0x49e37e=_[_0x037e('0x1e')](db[_0x037e('0x27')][_0x037e('0x28')],function(_0x2ab642){return{'name':_0x2ab642[_0x037e('0x29')],'type':_0x2ab642[_0x037e('0x21')][_0x037e('0x2a')]};});_0x365f59[_0x037e('0x2b')]=_[_0x037e('0x1e')](_0x49e37e,_0x037e('0x23'));_0x365f59[_0x037e('0x2c')]=_[_0x037e('0x2d')](_0x21b28a[_0x037e('0x2c')]);_0x365f59[_0x037e('0x2e')]=_[_0x037e('0x2f')](_0x365f59[_0x037e('0x2b')],_0x365f59[_0x037e('0x2c')]);_0x1127b1['attributes']=_[_0x037e('0x2f')](_0x365f59[_0x037e('0x2b')],qs['fields'](_0x21b28a[_0x037e('0x2c')][_0x037e('0x30')]));_0x1127b1[_0x037e('0x31')]=_0x1127b1[_0x037e('0x31')][_0x037e('0x32')]?_0x1127b1['attributes']:_0x365f59[_0x037e('0x2b')];if(!_0x21b28a[_0x037e('0x2c')]['hasOwnProperty'](_0x037e('0x33'))){_0x1127b1[_0x037e('0x12')]=qs[_0x037e('0x12')](_0x21b28a[_0x037e('0x2c')][_0x037e('0x12')]);_0x1127b1[_0x037e('0x10')]=qs[_0x037e('0x10')](_0x21b28a[_0x037e('0x2c')][_0x037e('0x10')]);}_0x1127b1[_0x037e('0x34')]=qs[_0x037e('0x35')](_0x21b28a['query'][_0x037e('0x35')]);_0x1127b1[_0x037e('0x36')]=qs['filters'](_[_0x037e('0x37')](_0x21b28a[_0x037e('0x2c')],_0x365f59['filters']),_0x49e37e);if(_0x21b28a['query']['filter']){_0x1127b1[_0x037e('0x36')]=_[_0x037e('0x38')](_0x1127b1[_0x037e('0x36')],{'$or':_[_0x037e('0x1e')](_0x49e37e,function(_0x285159){if(_0x285159['type']!==_0x037e('0x39')){var _0x27bfd6={};_0x27bfd6[_0x285159['name']]={'$like':'%'+_0x21b28a[_0x037e('0x2c')][_0x037e('0x1d')]+'%'};return _0x27bfd6;}})});}_0x1127b1=_[_0x037e('0x38')]({},_0x1127b1,_0x21b28a['options']);var _0x3a872f={'where':_0x1127b1['where']};return db[_0x037e('0x27')]['count'](_0x3a872f)[_0x037e('0x17')](function(_0x40c629){_0x9ae2c9[_0x037e('0x13')]=_0x40c629;if(_0x21b28a['query']['includeAll']){_0x1127b1[_0x037e('0x3a')]=[{'all':!![]}];}return db[_0x037e('0x27')][_0x037e('0x3b')](_0x1127b1);})[_0x037e('0x17')](function(_0x57872b){_0x9ae2c9['rows']=_0x57872b;return _0x9ae2c9;})['then'](respondWithFilteredResult(_0x3d616f,_0x1127b1))[_0x037e('0x3c')](handleError(_0x3d616f,null));};exports[_0x037e('0x3d')]=function(_0xd07a80,_0xc86477){var _0x2bb451={'raw':![],'where':{'id':_0xd07a80[_0x037e('0x3e')]['id']}},_0xdc58a4={};_0xdc58a4[_0x037e('0x2b')]=_[_0x037e('0x2d')](db[_0x037e('0x27')][_0x037e('0x28')]);_0xdc58a4[_0x037e('0x2c')]=_[_0x037e('0x2d')](_0xd07a80[_0x037e('0x2c')]);_0xdc58a4[_0x037e('0x2e')]=_[_0x037e('0x2f')](_0xdc58a4[_0x037e('0x2b')],_0xdc58a4[_0x037e('0x2c')]);_0x2bb451[_0x037e('0x31')]=_[_0x037e('0x2f')](_0xdc58a4[_0x037e('0x2b')],qs[_0x037e('0x30')](_0xd07a80[_0x037e('0x2c')][_0x037e('0x30')]));_0x2bb451[_0x037e('0x31')]=_0x2bb451[_0x037e('0x31')][_0x037e('0x32')]?_0x2bb451['attributes']:_0xdc58a4[_0x037e('0x2b')];if(_0xd07a80[_0x037e('0x2c')][_0x037e('0x3f')]){_0x2bb451[_0x037e('0x3a')]=[{'all':!![]}];}_0x2bb451=_[_0x037e('0x38')]({},_0x2bb451,_0xd07a80[_0x037e('0x40')]);return db['VoiceExtension'][_0x037e('0x22')](_0x2bb451)[_0x037e('0x17')](handleEntityNotFound(_0xc86477,null))['then'](respondWithResult(_0xc86477,null))[_0x037e('0x3c')](handleError(_0xc86477,null));};exports[_0x037e('0x16')]=function(_0x41a7ee,_0x814cda){return db[_0x037e('0x27')][_0x037e('0x22')]({'where':{'id':_0x41a7ee[_0x037e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x814cda,null))[_0x037e('0x17')](removeEntity(_0x814cda,null))[_0x037e('0x3c')](handleError(_0x814cda,null));};exports[_0x037e('0x41')]=function(_0x2d908c,_0x30cebc){if(_0x2d908c['body'][_0x037e('0x21')]===_0x037e('0x42')&&!_[_0x037e('0x43')](_0x2d908c[_0x037e('0x44')][_0x037e('0x45')],'_')){_0x2d908c[_0x037e('0x44')][_0x037e('0x45')]='_'[_0x037e('0x46')](_0x2d908c[_0x037e('0x44')][_0x037e('0x45')]);}return db[_0x037e('0x27')][_0x037e('0x41')](_0x2d908c[_0x037e('0x44')],{'raw':![]})['then'](function(_0x2169d6){var _0x582828=_0x2d908c[_0x037e('0x47')]['get']({'plain':!![]});if(!_0x582828)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x582828[_0x037e('0x48')]===_0x037e('0x47')){var _0xfca745=_0x2169d6[_0x037e('0x18')]({'plain':!![]});var _0x50c111=[{'name':_0x037e('0x19'),'value':_0x037e('0x1a')},{'name':_0x037e('0x1b'),'value':'outbound'},{'name':_0x037e('0x1c'),'value':'internal'}];var _0x5647b3=_['find'](_0x50c111,[_0x037e('0x1f'),_0xfca745[_0x037e('0x21')]])[_0x037e('0x23')];return db[_0x037e('0x49')][_0x037e('0x22')]({'where':{'name':_0x5647b3,'userProfileId':_0x582828[_0x037e('0x4a')]},'raw':!![]})[_0x037e('0x17')](function(_0x33a85b){if(_0x33a85b&&_0x33a85b[_0x037e('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0xfca745[_0x037e('0x23')],'resourceId':_0xfca745['id'],'type':_0x33a85b[_0x037e('0x23')],'sectionId':_0x33a85b['id']},{})[_0x037e('0x17')](function(){return _0x2169d6;});}else{return _0x2169d6;}})[_0x037e('0x3c')](function(_0x352721){logger['error'](_0x037e('0x4c'),_0x352721);throw _0x352721;});}return _0x2169d6;})[_0x037e('0x17')](respondWithResult(_0x30cebc,0xc9))['catch'](handleError(_0x30cebc,null));};exports[_0x037e('0x4d')]=function(_0x4ade31,_0x5a5f5d){if(_0x4ade31[_0x037e('0x44')]['id']){delete _0x4ade31[_0x037e('0x44')]['id'];}return db[_0x037e('0x27')]['find']({'where':{'id':_0x4ade31['params']['id']}})[_0x037e('0x17')](handleEntityNotFound(_0x5a5f5d,null))[_0x037e('0x17')](function(_0x2f71b7){if(_0x2f71b7){return db[_0x037e('0x27')]['update'](_[_0x037e('0x37')](_0x4ade31[_0x037e('0x44')],['exten','context','description',_0x037e('0x4e'),_0x037e('0x4f'),_0x037e('0x50'),'alias']),{'where':{'context':_0x2f71b7['context'],'exten':_0x2f71b7['exten']},'individualHooks':!![]})[_0x037e('0x17')](function(_0x25b078){return _0x25b078;});}return null;})[_0x037e('0x17')](respondWithStatusCode(_0x5a5f5d,null))[_0x037e('0x3c')](handleError(_0x5a5f5d,null));};exports['addApplications']=function(_0x5856e4,_0x14354a){var _0x19cd85=_0x5856e4[_0x037e('0x3e')]['id'];var _0x4f49e4=_0x5856e4[_0x037e('0x44')];var _0x1b7cb8=0xc8;var _0x3eab9e=null;return db[_0x037e('0x51')][_0x037e('0x52')]({'isolationLevel':db[_0x037e('0x51')][_0x037e('0x53')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x28c42c){return db['VoiceExtension'][_0x037e('0x54')]({'where':{'id':_0x19cd85},'transaction':_0x28c42c})['then'](function(_0x56df13){if(_0x56df13){return db[_0x037e('0x27')][_0x037e('0x16')]({'where':{'VoiceExtensionId':_0x19cd85},'transaction':_0x28c42c})[_0x037e('0x17')](function(){var _0x5f1530=_[_0x037e('0x1e')](_0x4f49e4,function(_0x21ff34){_0x21ff34[_0x037e('0x55')]=_0x19cd85;_0x21ff34[_0x037e('0x56')]=!![];return _0x21ff34;});return _0x56df13['createRouting'](_0x5f1530);})[_0x037e('0x17')](function(_0xeb9f6){return db[_0x037e('0x27')]['bulkCreate'](_0xeb9f6,{'transaction':_0x28c42c});});}else{_0x1b7cb8=0x194;_0x3eab9e=[];}});})['then'](function(){if(_0x1b7cb8!==0x194){return db[_0x037e('0x27')][_0x037e('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x19cd85},'order':'priority'})[_0x037e('0x17')](function(_0x314f19){_0x3eab9e=_0x314f19;});}})[_0x037e('0x3c')](function(_0x3d4549){_0x1b7cb8=0x1f4;logger[_0x037e('0x58')](_0x3d4549['stack']);if(_0x3d4549[_0x037e('0x23')]){delete _0x3d4549[_0x037e('0x23')];}_0x3eab9e=_0x3d4549;})[_0x037e('0x59')](function(){if(_0x3eab9e===null){_0x14354a[_0x037e('0xc')](_0x1b7cb8);}else{if(_0x1b7cb8===0x1f4){_0x14354a['status'](_0x1b7cb8)[_0x037e('0x25')](_0x3eab9e);}else{_0x14354a[_0x037e('0xd')](_0x1b7cb8)['json'](_0x3eab9e);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index aecec6a..3168070 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 _0x70a0=['update','remove','emit','hasOwnProperty','exports','VoiceExtension','setMaxListeners','save'];(function(_0x5ea2cf,_0x2e9f5b){var _0x5df1b2=function(_0x2c25fd){while(--_0x2c25fd){_0x5ea2cf['push'](_0x5ea2cf['shift']());}};_0x5df1b2(++_0x2e9f5b);}(_0x70a0,0x17d));var _0x070a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x70a0[_0x47fd36];return _0x21a0fc;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x070a('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x070a('0x1')](0x0);var events={'afterCreate':_0x070a('0x2'),'afterUpdate':_0x070a('0x3'),'afterDestroy':_0x070a('0x4')};function emitEvent(_0x1dd002){return function(_0x1fc4e0,_0x5d6d0f,_0x46bd0e){VoiceExtensionEvents[_0x070a('0x5')](_0x1dd002+':'+_0x1fc4e0['id'],_0x1fc4e0);VoiceExtensionEvents[_0x070a('0x5')](_0x1dd002,_0x1fc4e0);_0x46bd0e(null);};}for(var e in events){if(events[_0x070a('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x070a('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0f10=['save','update','exports','VoiceExtension','setMaxListeners'];(function(_0x150f00,_0x4a8f3d){var _0x3e90d5=function(_0x119bf3){while(--_0x119bf3){_0x150f00['push'](_0x150f00['shift']());}};_0x3e90d5(++_0x4a8f3d);}(_0x0f10,0xdf));var _0x00f1=function(_0x4648bd,_0xd18d06){_0x4648bd=_0x4648bd-0x0;var _0x4641b7=_0x0f10[_0x4648bd];return _0x4641b7;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x00f1('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x00f1('0x1')](0x0);var events={'afterCreate':_0x00f1('0x2'),'afterUpdate':_0x00f1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x201c00){return function(_0x3dcba6,_0x46841b,_0x17fab8){VoiceExtensionEvents['emit'](_0x201c00+':'+_0x3dcba6['id'],_0x3dcba6);VoiceExtensionEvents['emit'](_0x201c00,_0x3dcba6);_0x17fab8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x00f1('0x4')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 16845a6..f27ff94 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 _0x3561=['${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','name','param','phone','prefix','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','then','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','length','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','lodash','exports','models','type','Set','CDR(type)=','context','alias','CDR(routeAlias)=','inbound','exten','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits'];(function(_0x87b4f1,_0x397a1c){var _0x3c1012=function(_0x37bd2a){while(--_0x37bd2a){_0x87b4f1['push'](_0x87b4f1['shift']());}};_0x3c1012(++_0x397a1c);}(_0x3561,0x94));var _0x1356=function(_0x18ea7c,_0x1c1fc6){_0x18ea7c=_0x18ea7c-0x0;var _0xe92280=_0x3561[_0x18ea7c];return _0xe92280;};'use strict';var _=require(_0x1356('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x1356('0x1')]=function(_0x23a086){var _0x8ef5f=_0x23a086[_0x1356('0x2')];function _0x442fbc(_0x313999){var _0x1634de=0x2;var _0x116ff0=[{'type':_0x313999[_0x1356('0x3')],'app':_0x1356('0x4'),'appdata':_0x1356('0x5')+_0x313999[_0x1356('0x3')],'context':_0x313999[_0x1356('0x6')],'exten':_0x313999['exten'],'priority':_0x1634de++,'VoiceExtensionId':_0x313999['id']},{'type':_0x313999[_0x1356('0x3')],'app':_0x313999[_0x1356('0x7')]?_0x1356('0x4'):'NoOp','appdata':_0x313999['alias']?_0x1356('0x8')+_0x313999[_0x1356('0x7')]:'No\x20alias\x20set','context':_0x313999[_0x1356('0x6')],'exten':_0x313999['exten'],'priority':_0x1634de++,'VoiceExtensionId':_0x313999['id']}];if(_0x313999[_0x1356('0x3')]===_0x1356('0x9')){_0x116ff0['push']({'type':_0x1356('0x9'),'app':_0x1356('0x4'),'appdata':'CDR(routeid)='+_0x313999['id'],'context':_0x313999[_0x1356('0x6')],'exten':_0x313999[_0x1356('0xa')],'priority':_0x1634de++,'VoiceExtensionId':_0x313999['id']});}_0x116ff0[_0x1356('0xb')]({'type':_0x313999[_0x1356('0x3')],'app':_0x1356('0x4'),'appdata':_0x1356('0xc'),'context':_0x313999[_0x1356('0x6')],'exten':_0x313999[_0x1356('0xa')],'priority':_0x1634de++,'VoiceExtensionId':_0x313999['id']},{'type':_0x313999[_0x1356('0x3')],'app':_0x1356('0x4'),'appdata':_0x1356('0xd'),'context':_0x313999[_0x1356('0x6')],'exten':_0x313999[_0x1356('0xa')],'priority':_0x1634de++,'VoiceExtensionId':_0x313999['id']},{'type':_0x313999['type'],'app':'Set','appdata':_0x1356('0xe'),'context':_0x313999[_0x1356('0x6')],'exten':_0x313999[_0x1356('0xa')],'priority':_0x1634de++,'VoiceExtensionId':_0x313999['id']});return _0x116ff0;}function _0x5cecb2(_0x23a1ef){var _0x3645c0=0x2;var _0x39f708=[{'type':_0x1356('0xf'),'app':_0x1356('0x4'),'appdata':_0x1356('0x10'),'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':_0x23a1ef[_0x1356('0x7')]?_0x1356('0x4'):_0x1356('0x11'),'appdata':_0x23a1ef[_0x1356('0x7')]?'CDR(routeAlias)='+_0x23a1ef[_0x1356('0x7')]:'No\x20alias\x20set','context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef['exten'],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':_0x1356('0x4'),'appdata':_0x1356('0x12')+(_0x23a1ef[_0x1356('0x13')]?_0x1356('0x14')+_0x23a1ef[_0x1356('0x13')]+'}':'${EXTEN}'),'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':'outbound','app':_0x1356('0x4'),'appdata':_0x1356('0x15')+_0x23a1ef['id'],'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef['exten'],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':_0x1356('0x16'),'appdata':_0x1356('0x17')+(_0x3645c0+0x2)+_0x1356('0x18')+(_0x3645c0+0x1)+')','context':_0x23a1ef['context'],'exten':_0x23a1ef['exten'],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':'Set','appdata':_0x23a1ef[_0x1356('0x13')]?_0x1356('0x19')+_0x23a1ef[_0x1356('0x13')]+'}':_0x1356('0x1a'),'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef['exten'],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':_0x1356('0x4'),'appdata':_0x1356('0xc'),'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':'Set','appdata':_0x1356('0xd'),'context':_0x23a1ef['context'],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':'outbound','app':'Set','appdata':_0x1356('0xe'),'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef['exten'],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':_0x1356('0x4'),'appdata':_0x1356('0x1b')+_0x23a1ef['id'],'context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']}];if(_0x23a1ef[_0x1356('0x1c')](_0x1356('0x1d'))&&_0x23a1ef['recordingFormat']!==_0x1356('0x1e')){_0x39f708[_0x1356('0xb')]({'type':_0x1356('0xf'),'app':_0x1356('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x23a1ef[_0x1356('0x6')],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']},{'type':_0x1356('0xf'),'app':_0x1356('0x4'),'appdata':_0x1356('0x1f')+_0x23a1ef['recordingFormat']||_0x1356('0x20'),'context':_0x23a1ef['context'],'exten':_0x23a1ef[_0x1356('0xa')],'priority':_0x3645c0++,'VoiceExtensionId':_0x23a1ef['id']});}return _0x39f708;}function _0x438260(_0x36ee41,_0x2acf0d){var _0x39e321=[{'name':_0x1356('0x21'),'param':0x0},{'name':_0x1356('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':_0x1356('0x23'),'param':0x3}];var _0x1d206d={};var _0x198291=_0x2acf0d[_0x1356('0x24')](',');var _0x57c1ff=[];for(var _0x1ea4b4=0x0;_0x1ea4b4<_0x39e321['length'];_0x1ea4b4++){switch(_0x39e321[_0x1ea4b4][_0x1356('0x25')]){case'trunk':_0x1d206d[_0x1356('0x21')]=_0x198291[_0x39e321[_0x1ea4b4][_0x1356('0x26')]]['split']('/')[0x1];_0x1d206d[_0x1356('0x27')]=_0x198291[_0x39e321[_0x1ea4b4]['param']][_0x1356('0x24')]('/')[0x2];_0x1d206d[_0x1356('0x28')]=_0x1d206d[_0x1356('0x27')]?_0x1d206d[_0x1356('0x27')]['split']('$')[0x0]:undefined;_0x1d206d[_0x1356('0x27')]=_0x36ee41['cutdigits']?(_0x1d206d[_0x1356('0x28')]||'')+_0x1356('0x14')+_0x36ee41[_0x1356('0x13')]+'}':(_0x1d206d[_0x1356('0x28')]||'')+_0x1356('0x29');_0x57c1ff[_0x39e321[_0x1ea4b4][_0x1356('0x26')]]=[_0x1356('0x2a'),_0x1d206d[_0x1356('0x21')],_0x1d206d[_0x1356('0x27')]][_0x1356('0x2b')]('/');break;case _0x1356('0x2c'):_0x1d206d[_0x1356('0x2c')]=_0x198291[_0x39e321[_0x1ea4b4][_0x1356('0x26')]];if(_0x36ee41[_0x1356('0x1d')]!=='none'){if(_0x1d206d[_0x1356('0x2c')][_0x1356('0x2d')](_0x1356('0x2e'))<0x0){_0x1d206d[_0x1356('0x2c')]+=_0x1356('0x2e');}}else{_0x1d206d[_0x1356('0x2c')]=_0x1d206d[_0x1356('0x2c')][_0x1356('0x2f')]('U(xcally-mixmonitor-context)','');}_0x57c1ff[_0x39e321[_0x1ea4b4]['param']]=_0x1d206d[_0x1356('0x2c')];break;default:_0x57c1ff[_0x39e321[_0x1ea4b4][_0x1356('0x26')]]=_0x198291[_0x39e321[_0x1ea4b4]['param']];}}return _0x57c1ff[_0x1356('0x2b')](',');}function _0x3615b9(_0x2aaddb,_0x185116,_0x2c608c){return new Promise(function(_0x4ab592,_0x30d2c3){var _0x2680d7=[];if(_['isEmpty'](_0x185116))return _0x4ab592(_0x2680d7);_0x8ef5f[_0x1356('0x30')]['findAll']({'attributes':['id',_0x1356('0x31'),_0x1356('0x32')],'raw':!![]})[_0x1356('0x33')](function(_0x1ead19){for(var _0x443d49=0x0,_0x5e39fe=0x0;_0x443d49<_0x185116['length'];_0x443d49++,_0x5e39fe=0x0){var _0x3338f1=_0x185116[_0x443d49];var _0x186908=[];var _0x416708=[];delete _0x3338f1['id'];if(_0x3338f1[_0x1356('0x31')]!==_0x1356('0x34')){_0x3338f1[_0x1356('0x35')]=[_0x3338f1['interval']];}else{_0x3338f1[_0x1356('0x35')]=_0x3338f1['IntervalId']?_['map'](_[_0x1356('0x36')](_0x1ead19,{'IntervalId':_0x3338f1[_0x1356('0x32')]}),_0x1356('0x31')):[];}_0x3338f1[_0x1356('0x6')]=_0x2aaddb['context'];_0x3338f1[_0x1356('0xa')]=_0x2aaddb[_0x1356('0xa')];if(_0x3338f1[_0x1356('0x3')])_0x3338f1[_0x1356('0x3')]=_0x3338f1['type']['toLowerCase']();if(_0x2aaddb[_0x1356('0x3')]===_0x1356('0xf')){if(_0x3338f1[_0x1356('0x1c')](_0x1356('0x37'))&&_0x3338f1[_0x1356('0x37')]&&_0x3338f1[_0x1356('0x37')]!=='--'){_0x186908['push']({'type':_0x3338f1[_0x1356('0x3')][_0x1356('0x38')](),'app':'Set','appdata':_0x1356('0x39')+_0x3338f1[_0x1356('0x37')],'context':_0x2aaddb[_0x1356('0x6')],'exten':_0x2aaddb[_0x1356('0xa')],'priority':_0x3338f1['intervals']['length']+_0x2c608c+_0x5e39fe++,'VoiceExtensionId':_0x2aaddb['id']});}_0x186908['push']({'type':_0x3338f1[_0x1356('0x3')]['toLowerCase'](),'app':_0x1356('0x16'),'appdata':_0x1356('0x3a')+(_0x3338f1[_0x1356('0x3b')]?'Set(CALLERID(all)='+_0x3338f1[_0x1356('0x3b')]+')':_0x1356('0x3c')),'context':_0x2aaddb[_0x1356('0x6')],'exten':_0x2aaddb[_0x1356('0xa')],'priority':_0x3338f1[_0x1356('0x35')][_0x1356('0x3d')]+_0x2c608c+_0x5e39fe++,'VoiceExtensionId':_0x2aaddb['id']});}else{if(_0x3338f1['hasOwnProperty']('answer')){if([_0x1356('0x3e'),_0x1356('0x3f')][_0x1356('0x40')](_0x3338f1[_0x1356('0x41')][_0x1356('0x38')]())&&_0x3338f1[_0x1356('0x42')]!==_0x1356('0x43')){if(_0x3338f1['answer']){_0x186908[_0x1356('0xb')]({'type':_0x3338f1[_0x1356('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0x1356('0x44'),'context':_0x2aaddb[_0x1356('0x6')],'exten':_0x2aaddb[_0x1356('0xa')],'priority':_0x3338f1[_0x1356('0x35')][_0x1356('0x3d')]+_0x2c608c+_0x5e39fe++,'VoiceExtensionId':_0x2aaddb['id']});_0x186908[_0x1356('0xb')]({'type':_0x3338f1[_0x1356('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x1356('0x45'),'context':_0x2aaddb[_0x1356('0x6')],'exten':_0x2aaddb[_0x1356('0xa')],'priority':_0x3338f1[_0x1356('0x35')]['length']+_0x2c608c+_0x5e39fe++,'VoiceExtensionId':_0x2aaddb['id']});}else{_0x186908[_0x1356('0xb')]({'type':_0x3338f1[_0x1356('0x3')][_0x1356('0x38')](),'app':_0x1356('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2aaddb[_0x1356('0x6')],'exten':_0x2aaddb['exten'],'priority':_0x3338f1[_0x1356('0x35')][_0x1356('0x3d')]+_0x2c608c+_0x5e39fe++,'VoiceExtensionId':_0x2aaddb['id']});_0x186908[_0x1356('0xb')]({'type':_0x3338f1[_0x1356('0x3')][_0x1356('0x38')](),'app':_0x1356('0x4'),'appdata':_0x1356('0x46'),'context':_0x2aaddb[_0x1356('0x6')],'exten':_0x2aaddb[_0x1356('0xa')],'priority':_0x3338f1['intervals'][_0x1356('0x3d')]+_0x2c608c+_0x5e39fe++,'VoiceExtensionId':_0x2aaddb['id']});}}}}for(var _0x21d280=0x0;_0x21d280<_0x3338f1[_0x1356('0x35')]['length'];_0x21d280++){var _0x3f2a4d=_0x2c608c+_0x3338f1[_0x1356('0x35')][_0x1356('0x3d')];var _0xc852e8=_0x21d280===_0x3338f1['intervals'][_0x1356('0x3d')]-0x1?_0x2c608c+_0x186908[_0x1356('0x3d')]+_0x416708[_0x1356('0x3d')]+0x2:_0x2c608c+_0x21d280+0x1;_0x186908[_0x1356('0x47')](_0x21d280,0x0,{'type':_0x2aaddb[_0x1356('0x3')],'app':_0x1356('0x48'),'appdata':_0x3338f1[_0x1356('0x35')][_0x21d280]+'?'+_0x2aaddb[_0x1356('0x6')]+',${EXTEN},'+_0x3f2a4d+':'+_0x2aaddb['context']+_0x1356('0x49')+_0xc852e8,'exten':_0x2aaddb['exten'],'context':_0x2aaddb[_0x1356('0x6')],'priority':_0x2c608c+_0x21d280,'VoiceExtensionId':_0x2aaddb['id']});}if(_0x3338f1['appType']===_0x1356('0x4a'))_0x3338f1[_0x1356('0x4b')]=_0x438260(_0x2aaddb,_0x3338f1['appdata']);_0x3338f1[_0x1356('0x4c')]=_0x186908[_0x1356('0x3d')]?_[_0x1356('0x4d')](_0x186908)[_0x1356('0x4c')]+0x1:_0x2c608c;_0x2680d7=_[_0x1356('0x4e')](_0x2680d7,_0x186908,[_0x3338f1],_0x416708);_0x2c608c=_[_0x1356('0x4d')](_0x2680d7)[_0x1356('0x4c')]+0x1;}return _0x4ab592(_0x2680d7);})[_0x1356('0x4f')](function(_0x594792){_0x30d2c3(_0x594792);});});}return _0x23a086[_0x1356('0x50')](_0x1356('0x51'),attributes,{'tableName':_0x1356('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x20ab6e){var _0x139072=this[_0x1356('0x53')]({'plain':!![]});var _0x590483=_0x139072[_0x1356('0x3')]===_0x1356('0xf')?_0x5cecb2(_0x139072):_0x442fbc(_0x139072);return _0x3615b9(_0x139072,_0x20ab6e,_['last'](_0x590483)[_0x1356('0x4c')]+0x1)[_0x1356('0x33')](function(_0x54a3c5){var _0x13174b=_[_0x1356('0x4e')](_0x590483,_0x54a3c5);_0x13174b[_0x1356('0xb')]({'type':_0x139072['type'],'app':'Hangup','exten':_0x139072[_0x1356('0xa')],'context':_0x139072['context'],'priority':_[_0x1356('0x4d')](_0x13174b)['priority']+0x1,'VoiceExtensionId':_0x139072['id']});return _0x13174b;});}}});}; \ No newline at end of file +var _0x55ca=['${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','split','name','param','phone','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','then','length','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','catch','define','VoiceExtension','voice_extensions','last','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','alias','NoOp','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:'];(function(_0x494cc1,_0x2d53e1){var _0x10650c=function(_0x368d5f){while(--_0x368d5f){_0x494cc1['push'](_0x494cc1['shift']());}};_0x10650c(++_0x2d53e1);}(_0x55ca,0x126));var _0xa55c=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x55ca[_0x4f0e62];return _0x117ab8;};'use strict';var _=require(_0xa55c('0x0'));var attributes=require(_0xa55c('0x1'));module['exports']=function(_0x5edc58){var _0x49875a=_0x5edc58[_0xa55c('0x2')];function _0x267ea0(_0x5dc716){var _0x3b478a=0x2;var _0x2db02a=[{'type':_0x5dc716[_0xa55c('0x3')],'app':_0xa55c('0x4'),'appdata':_0xa55c('0x5')+_0x5dc716[_0xa55c('0x3')],'context':_0x5dc716[_0xa55c('0x6')],'exten':_0x5dc716['exten'],'priority':_0x3b478a++,'VoiceExtensionId':_0x5dc716['id']},{'type':_0x5dc716[_0xa55c('0x3')],'app':_0x5dc716[_0xa55c('0x7')]?'Set':_0xa55c('0x8'),'appdata':_0x5dc716[_0xa55c('0x7')]?'CDR(routeAlias)='+_0x5dc716['alias']:_0xa55c('0x9'),'context':_0x5dc716[_0xa55c('0x6')],'exten':_0x5dc716[_0xa55c('0xa')],'priority':_0x3b478a++,'VoiceExtensionId':_0x5dc716['id']}];if(_0x5dc716[_0xa55c('0x3')]===_0xa55c('0xb')){_0x2db02a[_0xa55c('0xc')]({'type':_0xa55c('0xb'),'app':_0xa55c('0x4'),'appdata':_0xa55c('0xd')+_0x5dc716['id'],'context':_0x5dc716[_0xa55c('0x6')],'exten':_0x5dc716['exten'],'priority':_0x3b478a++,'VoiceExtensionId':_0x5dc716['id']});}_0x2db02a['push']({'type':_0x5dc716[_0xa55c('0x3')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5dc716['context'],'exten':_0x5dc716[_0xa55c('0xa')],'priority':_0x3b478a++,'VoiceExtensionId':_0x5dc716['id']},{'type':_0x5dc716[_0xa55c('0x3')],'app':_0xa55c('0x4'),'appdata':_0xa55c('0xe'),'context':_0x5dc716[_0xa55c('0x6')],'exten':_0x5dc716[_0xa55c('0xa')],'priority':_0x3b478a++,'VoiceExtensionId':_0x5dc716['id']},{'type':_0x5dc716['type'],'app':_0xa55c('0x4'),'appdata':_0xa55c('0xf'),'context':_0x5dc716[_0xa55c('0x6')],'exten':_0x5dc716[_0xa55c('0xa')],'priority':_0x3b478a++,'VoiceExtensionId':_0x5dc716['id']});return _0x2db02a;}function _0x1c4cfd(_0x3ae86b){var _0x51590e=0x2;var _0x2d09d8=[{'type':_0xa55c('0x10'),'app':'Set','appdata':_0xa55c('0x11'),'context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':_0x3ae86b[_0xa55c('0x7')]?_0xa55c('0x4'):'NoOp','appdata':_0x3ae86b['alias']?_0xa55c('0x12')+_0x3ae86b[_0xa55c('0x7')]:_0xa55c('0x9'),'context':_0x3ae86b['context'],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':'Set','appdata':_0xa55c('0x13')+(_0x3ae86b[_0xa55c('0x14')]?_0xa55c('0x15')+_0x3ae86b[_0xa55c('0x14')]+'}':_0xa55c('0x16')),'context':_0x3ae86b['context'],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':'outbound','app':'Set','appdata':'CDR(routeid)='+_0x3ae86b['id'],'context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b['exten'],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':_0xa55c('0x17'),'appdata':_0xa55c('0x18')+(_0x51590e+0x2)+_0xa55c('0x19')+(_0x51590e+0x1)+')','context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':_0xa55c('0x4'),'appdata':_0x3ae86b[_0xa55c('0x14')]?_0xa55c('0x1a')+_0x3ae86b[_0xa55c('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':_0xa55c('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':_0xa55c('0x4'),'appdata':_0xa55c('0xe'),'context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b['exten'],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':'Set','appdata':_0xa55c('0xf'),'context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':'Set','appdata':_0xa55c('0x1b')+_0x3ae86b['id'],'context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']}];if(_0x3ae86b[_0xa55c('0x1c')](_0xa55c('0x1d'))&&_0x3ae86b[_0xa55c('0x1d')]!==_0xa55c('0x1e')){_0x2d09d8[_0xa55c('0xc')]({'type':_0xa55c('0x10'),'app':_0xa55c('0x4'),'appdata':_0xa55c('0x1f'),'context':_0x3ae86b['context'],'exten':_0x3ae86b['exten'],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']},{'type':_0xa55c('0x10'),'app':_0xa55c('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3ae86b[_0xa55c('0x1d')]||_0xa55c('0x20'),'context':_0x3ae86b[_0xa55c('0x6')],'exten':_0x3ae86b[_0xa55c('0xa')],'priority':_0x51590e++,'VoiceExtensionId':_0x3ae86b['id']});}return _0x2d09d8;}function _0x30d4f8(_0x38ff96,_0x3ce1b3){var _0x222d4b=[{'name':_0xa55c('0x21'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x3fd75f={};var _0x18e00e=_0x3ce1b3[_0xa55c('0x22')](',');var _0x5802e4=[];for(var _0x768408=0x0;_0x768408<_0x222d4b['length'];_0x768408++){switch(_0x222d4b[_0x768408][_0xa55c('0x23')]){case'trunk':_0x3fd75f[_0xa55c('0x21')]=_0x18e00e[_0x222d4b[_0x768408][_0xa55c('0x24')]][_0xa55c('0x22')]('/')[0x1];_0x3fd75f['phone']=_0x18e00e[_0x222d4b[_0x768408][_0xa55c('0x24')]][_0xa55c('0x22')]('/')[0x2];_0x3fd75f['prefix']=_0x3fd75f[_0xa55c('0x25')]?_0x3fd75f[_0xa55c('0x25')]['split']('$')[0x0]:undefined;_0x3fd75f['phone']=_0x38ff96[_0xa55c('0x14')]?(_0x3fd75f['prefix']||'')+_0xa55c('0x15')+_0x38ff96[_0xa55c('0x14')]+'}':(_0x3fd75f['prefix']||'')+'${EXTEN}';_0x5802e4[_0x222d4b[_0x768408]['param']]=['SIP',_0x3fd75f[_0xa55c('0x21')],_0x3fd75f[_0xa55c('0x25')]][_0xa55c('0x26')]('/');break;case _0xa55c('0x27'):_0x3fd75f[_0xa55c('0x27')]=_0x18e00e[_0x222d4b[_0x768408]['param']];if(_0x38ff96[_0xa55c('0x1d')]!==_0xa55c('0x1e')){if(_0x3fd75f[_0xa55c('0x27')][_0xa55c('0x28')](_0xa55c('0x29'))<0x0){_0x3fd75f[_0xa55c('0x27')]+='U(xcally-mixmonitor-context)';}}else{_0x3fd75f[_0xa55c('0x27')]=_0x3fd75f['options']['replace'](_0xa55c('0x29'),'');}_0x5802e4[_0x222d4b[_0x768408][_0xa55c('0x24')]]=_0x3fd75f['options'];break;default:_0x5802e4[_0x222d4b[_0x768408][_0xa55c('0x24')]]=_0x18e00e[_0x222d4b[_0x768408]['param']];}}return _0x5802e4['join'](',');}function _0x2f8449(_0x3fea03,_0x1630ac,_0x540337){return new Promise(function(_0x1b2708,_0xd5a006){var _0x5d9d5d=[];if(_[_0xa55c('0x2a')](_0x1630ac))return _0x1b2708(_0x5d9d5d);_0x49875a['Interval'][_0xa55c('0x2b')]({'attributes':['id',_0xa55c('0x2c'),'IntervalId'],'raw':!![]})[_0xa55c('0x2d')](function(_0x1dae70){for(var _0x5d834d=0x0,_0x40c352=0x0;_0x5d834d<_0x1630ac[_0xa55c('0x2e')];_0x5d834d++,_0x40c352=0x0){var _0x204767=_0x1630ac[_0x5d834d];var _0x59a6c8=[];var _0x334f52=[];delete _0x204767['id'];if(_0x204767['interval']!==_0xa55c('0x2f')){_0x204767[_0xa55c('0x30')]=[_0x204767[_0xa55c('0x2c')]];}else{_0x204767['intervals']=_0x204767[_0xa55c('0x31')]?_[_0xa55c('0x32')](_['filter'](_0x1dae70,{'IntervalId':_0x204767[_0xa55c('0x31')]}),_0xa55c('0x2c')):[];}_0x204767['context']=_0x3fea03[_0xa55c('0x6')];_0x204767[_0xa55c('0xa')]=_0x3fea03['exten'];if(_0x204767[_0xa55c('0x3')])_0x204767[_0xa55c('0x3')]=_0x204767[_0xa55c('0x3')][_0xa55c('0x33')]();if(_0x3fea03['type']===_0xa55c('0x10')){if(_0x204767['hasOwnProperty'](_0xa55c('0x34'))&&_0x204767[_0xa55c('0x34')]&&_0x204767[_0xa55c('0x34')]!=='--'){_0x59a6c8['push']({'type':_0x204767[_0xa55c('0x3')][_0xa55c('0x33')](),'app':'Set','appdata':_0xa55c('0x35')+_0x204767[_0xa55c('0x34')],'context':_0x3fea03[_0xa55c('0x6')],'exten':_0x3fea03[_0xa55c('0xa')],'priority':_0x204767[_0xa55c('0x30')][_0xa55c('0x2e')]+_0x540337+_0x40c352++,'VoiceExtensionId':_0x3fea03['id']});}_0x59a6c8[_0xa55c('0xc')]({'type':_0x204767[_0xa55c('0x3')][_0xa55c('0x33')](),'app':_0xa55c('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x204767[_0xa55c('0x36')]?_0xa55c('0x37')+_0x204767[_0xa55c('0x36')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3fea03[_0xa55c('0x6')],'exten':_0x3fea03[_0xa55c('0xa')],'priority':_0x204767['intervals'][_0xa55c('0x2e')]+_0x540337+_0x40c352++,'VoiceExtensionId':_0x3fea03['id']});}else{if(_0x204767['hasOwnProperty'](_0xa55c('0x38'))){if([_0xa55c('0x39'),_0xa55c('0x3a')][_0xa55c('0x3b')](_0x204767[_0xa55c('0x3c')]['toLowerCase']())&&_0x204767[_0xa55c('0x3d')]!==_0xa55c('0x3e')){if(_0x204767['answer']){_0x59a6c8[_0xa55c('0xc')]({'type':_0x204767[_0xa55c('0x3')][_0xa55c('0x33')](),'app':_0xa55c('0x17'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3fea03['context'],'exten':_0x3fea03[_0xa55c('0xa')],'priority':_0x204767[_0xa55c('0x30')][_0xa55c('0x2e')]+_0x540337+_0x40c352++,'VoiceExtensionId':_0x3fea03['id']});_0x59a6c8[_0xa55c('0xc')]({'type':_0x204767['type'][_0xa55c('0x33')](),'app':'Set','appdata':_0xa55c('0x3f'),'context':_0x3fea03[_0xa55c('0x6')],'exten':_0x3fea03[_0xa55c('0xa')],'priority':_0x204767[_0xa55c('0x30')][_0xa55c('0x2e')]+_0x540337+_0x40c352++,'VoiceExtensionId':_0x3fea03['id']});}else{_0x59a6c8['push']({'type':_0x204767[_0xa55c('0x3')]['toLowerCase'](),'app':_0xa55c('0x17'),'appdata':_0xa55c('0x40'),'context':_0x3fea03[_0xa55c('0x6')],'exten':_0x3fea03[_0xa55c('0xa')],'priority':_0x204767[_0xa55c('0x30')][_0xa55c('0x2e')]+_0x540337+_0x40c352++,'VoiceExtensionId':_0x3fea03['id']});_0x59a6c8[_0xa55c('0xc')]({'type':_0x204767['type'][_0xa55c('0x33')](),'app':_0xa55c('0x4'),'appdata':_0xa55c('0x41'),'context':_0x3fea03[_0xa55c('0x6')],'exten':_0x3fea03[_0xa55c('0xa')],'priority':_0x204767['intervals'][_0xa55c('0x2e')]+_0x540337+_0x40c352++,'VoiceExtensionId':_0x3fea03['id']});}}}}for(var _0x3cd40d=0x0;_0x3cd40d<_0x204767[_0xa55c('0x30')][_0xa55c('0x2e')];_0x3cd40d++){var _0x3cbb63=_0x540337+_0x204767['intervals'][_0xa55c('0x2e')];var _0x21725b=_0x3cd40d===_0x204767[_0xa55c('0x30')][_0xa55c('0x2e')]-0x1?_0x540337+_0x59a6c8[_0xa55c('0x2e')]+_0x334f52['length']+0x2:_0x540337+_0x3cd40d+0x1;_0x59a6c8[_0xa55c('0x42')](_0x3cd40d,0x0,{'type':_0x3fea03['type'],'app':_0xa55c('0x43'),'appdata':_0x204767['intervals'][_0x3cd40d]+'?'+_0x3fea03[_0xa55c('0x6')]+',${EXTEN},'+_0x3cbb63+':'+_0x3fea03[_0xa55c('0x6')]+_0xa55c('0x44')+_0x21725b,'exten':_0x3fea03[_0xa55c('0xa')],'context':_0x3fea03[_0xa55c('0x6')],'priority':_0x540337+_0x3cd40d,'VoiceExtensionId':_0x3fea03['id']});}if(_0x204767[_0xa55c('0x3d')]===_0xa55c('0x45'))_0x204767[_0xa55c('0x46')]=_0x30d4f8(_0x3fea03,_0x204767[_0xa55c('0x46')]);_0x204767[_0xa55c('0x47')]=_0x59a6c8[_0xa55c('0x2e')]?_['last'](_0x59a6c8)[_0xa55c('0x47')]+0x1:_0x540337;_0x5d9d5d=_[_0xa55c('0x48')](_0x5d9d5d,_0x59a6c8,[_0x204767],_0x334f52);_0x540337=_['last'](_0x5d9d5d)[_0xa55c('0x47')]+0x1;}return _0x1b2708(_0x5d9d5d);})[_0xa55c('0x49')](function(_0x3e3b4b){_0xd5a006(_0x3e3b4b);});});}return _0x5edc58[_0xa55c('0x4a')](_0xa55c('0x4b'),attributes,{'tableName':_0xa55c('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3cef1f){var _0x202191=this['get']({'plain':!![]});var _0x1dfaf7=_0x202191[_0xa55c('0x3')]===_0xa55c('0x10')?_0x1c4cfd(_0x202191):_0x267ea0(_0x202191);return _0x2f8449(_0x202191,_0x3cef1f,_[_0xa55c('0x4d')](_0x1dfaf7)[_0xa55c('0x47')]+0x1)[_0xa55c('0x2d')](function(_0x2f1237){var _0x4249c1=_[_0xa55c('0x48')](_0x1dfaf7,_0x2f1237);_0x4249c1['push']({'type':_0x202191[_0xa55c('0x3')],'app':_0xa55c('0x4e'),'exten':_0x202191[_0xa55c('0xa')],'context':_0x202191[_0xa55c('0x6')],'priority':_[_0xa55c('0x4d')](_0x4249c1)[_0xa55c('0x47')]+0x1,'VoiceExtensionId':_0x202191['id']});return _0x4249c1;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 14e7c77..35aa055 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 _0x9576=['attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where'];(function(_0x5e4b35,_0x4d0efd){var _0x220bde=function(_0xa4f167){while(--_0xa4f167){_0x5e4b35['push'](_0x5e4b35['shift']());}};_0x220bde(++_0x4d0efd);}(_0x9576,0x182));var _0x6957=function(_0x4238e3,_0x5bbe65){_0x4238e3=_0x4238e3-0x0;var _0x1545c1=_0x9576[_0x4238e3];return _0x1545c1;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var moment=require(_0x6957('0x2'));var BPromise=require(_0x6957('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6957('0x4'))['db'];var utils=require(_0x6957('0x5'));var logger=require(_0x6957('0x6'))(_0x6957('0x7'));var config=require(_0x6957('0x8'));var jayson=require(_0x6957('0x9'));var client=jayson[_0x6957('0xa')]['http']({'port':0x232a});config[_0x6957('0xb')]=_[_0x6957('0xc')](config[_0x6957('0xb')],{'host':_0x6957('0xd'),'port':0x18eb});var socket=require(_0x6957('0xe'))(new Redis(config[_0x6957('0xb')]));require('./voiceExtension.socket')[_0x6957('0xf')](socket);function respondWithRpcPromise(_0x1dded8,_0x483af0,_0x55078f){return new BPromise(function(_0x3e0520,_0x25c338){return client[_0x6957('0x10')](_0x1dded8,_0x55078f)[_0x6957('0x11')](function(_0x3e2f16){logger[_0x6957('0x12')](_0x6957('0x13'),_0x483af0,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x483af0,_0x6957('0x14'),JSON[_0x6957('0x15')](_0x3e2f16));if(_0x3e2f16[_0x6957('0x16')]){if(_0x3e2f16[_0x6957('0x16')][_0x6957('0x17')]===0x1f4){logger[_0x6957('0x16')](_0x6957('0x13'),_0x483af0,_0x3e2f16['error']['message']);return _0x25c338(_0x3e2f16['error'][_0x6957('0x18')]);}logger[_0x6957('0x16')](_0x6957('0x13'),_0x483af0,_0x3e2f16[_0x6957('0x16')]['message']);return _0x3e0520(_0x3e2f16[_0x6957('0x16')]['message']);}else{logger[_0x6957('0x12')](_0x6957('0x13'),_0x483af0,'request\x20sent');_0x3e0520(_0x3e2f16[_0x6957('0x19')][_0x6957('0x18')]);}})[_0x6957('0x1a')](function(_0x4c527c){logger[_0x6957('0x16')](_0x6957('0x13'),_0x483af0,_0x4c527c);_0x25c338(_0x4c527c);});});}exports[_0x6957('0x1b')]=function(_0x135893){var _0x1ce753=this;return new Promise(function(_0x26d3fd,_0x35ee5b){return db[_0x6957('0x1c')]['findAll']({'raw':_0x135893['options']?_0x135893[_0x6957('0x1d')][_0x6957('0x1e')]===undefined?!![]:![]:!![],'where':_0x135893[_0x6957('0x1d')]?_0x135893[_0x6957('0x1d')][_0x6957('0x1f')]||null:null,'attributes':_0x135893[_0x6957('0x1d')]?_0x135893[_0x6957('0x1d')][_0x6957('0x20')]||null:null,'limit':_0x135893['options']?_0x135893[_0x6957('0x1d')][_0x6957('0x21')]||null:null,'include':_0x135893[_0x6957('0x1d')]?_0x135893[_0x6957('0x1d')]['include']?_['map'](_0x135893[_0x6957('0x1d')][_0x6957('0x22')],function(_0x5c4e49){return{'model':db[_0x5c4e49['model']],'as':_0x5c4e49['as'],'attributes':_0x5c4e49[_0x6957('0x20')],'include':_0x5c4e49[_0x6957('0x22')]?_[_0x6957('0x23')](_0x5c4e49['include'],function(_0x330015){return{'model':db[_0x330015[_0x6957('0x24')]],'as':_0x330015['as'],'attributes':_0x330015[_0x6957('0x20')],'include':_0x330015[_0x6957('0x22')]?_[_0x6957('0x23')](_0x330015[_0x6957('0x22')],function(_0x2d33ef){return{'model':db[_0x2d33ef[_0x6957('0x24')]],'as':_0x2d33ef['as'],'attributes':_0x2d33ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x6957('0x11')](function(_0x3a6e07){logger[_0x6957('0x12')](_0x6957('0x1b'),_0x135893);logger[_0x6957('0x25')](_0x6957('0x1b'),_0x135893,JSON[_0x6957('0x15')](_0x3a6e07));_0x26d3fd(_0x3a6e07);})[_0x6957('0x1a')](function(_0x1300b1){logger[_0x6957('0x16')](_0x6957('0x1b'),_0x1300b1['message'],_0x135893);_0x35ee5b(_0x1ce753['error'](0x1f4,_0x1300b1[_0x6957('0x18')]));});});}; \ No newline at end of file +var _0xb091=['http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceExtension,\x20%s,\x20%s','info','catch','VoiceExtension','findAll','options','raw','limit','include','map','attributes','model','GetVoiceExtension','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client'];(function(_0x4879da,_0x5250f8){var _0x10936e=function(_0x20b6a5){while(--_0x20b6a5){_0x4879da['push'](_0x4879da['shift']());}};_0x10936e(++_0x5250f8);}(_0xb091,0x16e));var _0x1b09=function(_0xf7f188,_0x238d65){_0xf7f188=_0xf7f188-0x0;var _0x158664=_0xb091[_0xf7f188];return _0x158664;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});config[_0x1b09('0x9')]=_['defaults'](config[_0x1b09('0x9')],{'host':_0x1b09('0xa'),'port':0x18eb});var socket=require(_0x1b09('0xb'))(new Redis(config[_0x1b09('0x9')]));require(_0x1b09('0xc'))[_0x1b09('0xd')](socket);function respondWithRpcPromise(_0x211f05,_0x124d02,_0x3249a1){return new BPromise(function(_0x36aa1b,_0x14dac6){return client['request'](_0x211f05,_0x3249a1)[_0x1b09('0xe')](function(_0x894b73){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x124d02,_0x1b09('0xf'));logger[_0x1b09('0x10')](_0x1b09('0x11'),_0x124d02,_0x1b09('0xf'),JSON[_0x1b09('0x12')](_0x894b73));if(_0x894b73[_0x1b09('0x13')]){if(_0x894b73[_0x1b09('0x13')]['code']===0x1f4){logger[_0x1b09('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x14dac6(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}logger[_0x1b09('0x13')](_0x1b09('0x15'),_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x36aa1b(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}else{logger[_0x1b09('0x16')](_0x1b09('0x15'),_0x124d02,_0x1b09('0xf'));_0x36aa1b(_0x894b73['result'][_0x1b09('0x14')]);}})[_0x1b09('0x17')](function(_0x5483ef){logger['error'](_0x1b09('0x15'),_0x124d02,_0x5483ef);_0x14dac6(_0x5483ef);});});}exports['GetVoiceExtension']=function(_0x267b5e){var _0x5bb127=this;return new Promise(function(_0x136697,_0x4b2eab){return db[_0x1b09('0x18')][_0x1b09('0x19')]({'raw':_0x267b5e[_0x1b09('0x1a')]?_0x267b5e[_0x1b09('0x1a')][_0x1b09('0x1b')]===undefined?!![]:![]:!![],'where':_0x267b5e[_0x1b09('0x1a')]?_0x267b5e['options']['where']||null:null,'attributes':_0x267b5e[_0x1b09('0x1a')]?_0x267b5e[_0x1b09('0x1a')]['attributes']||null:null,'limit':_0x267b5e[_0x1b09('0x1a')]?_0x267b5e[_0x1b09('0x1a')][_0x1b09('0x1c')]||null:null,'include':_0x267b5e[_0x1b09('0x1a')]?_0x267b5e['options'][_0x1b09('0x1d')]?_[_0x1b09('0x1e')](_0x267b5e['options'][_0x1b09('0x1d')],function(_0x472d30){return{'model':db[_0x472d30['model']],'as':_0x472d30['as'],'attributes':_0x472d30[_0x1b09('0x1f')],'include':_0x472d30[_0x1b09('0x1d')]?_[_0x1b09('0x1e')](_0x472d30[_0x1b09('0x1d')],function(_0x547fbb){return{'model':db[_0x547fbb[_0x1b09('0x20')]],'as':_0x547fbb['as'],'attributes':_0x547fbb[_0x1b09('0x1f')],'include':_0x547fbb['include']?_[_0x1b09('0x1e')](_0x547fbb[_0x1b09('0x1d')],function(_0x26befb){return{'model':db[_0x26befb[_0x1b09('0x20')]],'as':_0x26befb['as'],'attributes':_0x26befb[_0x1b09('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1b09('0xe')](function(_0x34620f){logger['info'](_0x1b09('0x21'),_0x267b5e);logger[_0x1b09('0x10')]('GetVoiceExtension',_0x267b5e,JSON[_0x1b09('0x12')](_0x34620f));_0x136697(_0x34620f);})[_0x1b09('0x17')](function(_0x1b98da){logger[_0x1b09('0x13')](_0x1b09('0x21'),_0x1b98da['message'],_0x267b5e);_0x4b2eab(_0x5bb127[_0x1b09('0x13')](0x1f4,_0x1b98da['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index c1727ce..479794a 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x3c4016,_0x2e220f){var _0x3cebbd=function(_0x101bb1){while(--_0x101bb1){_0x3c4016['push'](_0x3c4016['shift']());}};_0x3cebbd(++_0x2e220f);}(_0xe14b,0x93));var _0xbe14=function(_0xa6e5b1,_0x200c10){_0xa6e5b1=_0xa6e5b1-0x0;var _0xdaa9d=_0xe14b[_0xa6e5b1];return _0xdaa9d;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x53b25a,_0x1e661f){var _0x167f0f=function(_0x347225){while(--_0x347225){_0x53b25a['push'](_0x53b25a['shift']());}};_0x167f0f(++_0x1e661f);}(_0x1261,0x144));var _0x1126=function(_0x28db86,_0x45d20f){_0x28db86=_0x28db86-0x0;var _0x3b0ae7=_0x1261[_0x28db86];return _0x3b0ae7;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 95ac1b3..eb62088 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x41cac0,_0x289ce0){var _0x31ce45=function(_0x4f2b5a){while(--_0x4f2b5a){_0x41cac0['push'](_0x41cac0['shift']());}};_0x31ce45(++_0x289ce0);}(_0x5fab,0x177));var _0xb5fa=function(_0xed8833,_0x2a801e){_0xed8833=_0xed8833-0x0;var _0x42a79d=_0x5fab[_0xed8833];return _0x42a79d;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3a6d=['/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','post','create'];(function(_0x5721a9,_0x921857){var _0x2b9f2e=function(_0x363b98){while(--_0x363b98){_0x5721a9['push'](_0x5721a9['shift']());}};_0x2b9f2e(++_0x921857);}(_0x3a6d,0x143));var _0xd3a6=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x3a6d[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/:id',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x10')]);router['put'](_0xd3a6('0x11'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x12')]);router[_0xd3a6('0x13')](_0xd3a6('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index af0cee2..2ae258d 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 _0x7d32=['getDataValue','fullname','\x20-\x20','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x2b3da1,_0x504774){var _0x378c89=function(_0x7e727b){while(--_0x7e727b){_0x2b3da1['push'](_0x2b3da1['shift']());}};_0x378c89(++_0x504774);}(_0x7d32,0x7a));var _0x27d3=function(_0x35689e,_0x13e116){_0x35689e=_0x35689e-0x0;var _0x352b85=_0x7d32[_0x35689e];return _0x352b85;};'use strict';var Sequelize=require('sequelize');module[_0x27d3('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x27d3('0x1'),'unique':_0x27d3('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x27d3('0x3')]},'email':{'type':Sequelize[_0x27d3('0x3')],'validate':{'isEmail':!![]},'set':function(_0x19163e){this[_0x27d3('0x4')](_0x27d3('0x5'),typeof _0x19163e===_0x27d3('0x6')&&_0x19163e[_0x27d3('0x7')]()?_0x19163e['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x27d3('0x3')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':_0x27d3('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x27d3('0x3')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x27d3('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x27d3('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':_0x27d3('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x27d3('0x8')](_0x27d3('0x9'),'no'),'defaultValue':_0x27d3('0x9'),'allowNull':![]},'stamp':{'type':_0x27d3('0xb')},'emailsubject':{'type':Sequelize[_0x27d3('0x3')]},'emailbody':{'type':Sequelize[_0x27d3('0x3')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x27d3('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x27d3('0xd')],'get':function(){return this[_0x27d3('0xe')](_0x27d3('0xf'))+_0x27d3('0x10')+this[_0x27d3('0xe')]('mailbox');}}}; \ No newline at end of file +var _0x14af=['trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x4d7819,_0x5699d6){var _0x54badf=function(_0x689313){while(--_0x689313){_0x4d7819['push'](_0x4d7819['shift']());}};_0x54badf(++_0x5699d6);}(_0x14af,0x168));var _0xf14a=function(_0x3a145e,_0x2136df){_0x3a145e=_0x3a145e-0x0;var _0x14d264=_0x14af[_0x3a145e];return _0x14d264;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf14a('0x0')],'defaultValue':_0xf14a('0x1'),'unique':_0xf14a('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf14a('0x0')]},'fullname':{'type':Sequelize[_0xf14a('0x0')]},'email':{'type':Sequelize[_0xf14a('0x0')],'validate':{'isEmail':!![]},'set':function(_0xa44f54){this[_0xf14a('0x3')]('email',typeof _0xa44f54==='string'&&_0xa44f54[_0xf14a('0x4')]()?_0xa44f54[_0xf14a('0x4')]():null);}},'pager':{'type':Sequelize[_0xf14a('0x0')]},'tz':{'type':Sequelize[_0xf14a('0x0')],'defaultValue':_0xf14a('0x5')},'attach':{'type':Sequelize[_0xf14a('0x6')]('yes','no'),'defaultValue':_0xf14a('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':_0xf14a('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf14a('0x0')]},'callback':{'type':Sequelize[_0xf14a('0x0')]},'review':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xf14a('0x7'),'no'),'defaultValue':_0xf14a('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf14a('0x6')](_0xf14a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xf14a('0x7'),'no'),'defaultValue':_0xf14a('0x7'),'allowNull':![]},'stamp':{'type':_0xf14a('0x8')},'emailsubject':{'type':Sequelize[_0xf14a('0x0')]},'emailbody':{'type':Sequelize[_0xf14a('0x0')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf14a('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf14a('0xa')],'get':function(){return this[_0xf14a('0xb')]('fullname')+_0xf14a('0xc')+this[_0xf14a('0xb')](_0xf14a('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a374426..4be1b6b 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 _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x307ce2,_0x25f321){var _0x2d9de8=function(_0x4a860c){while(--_0x4a860c){_0x307ce2['push'](_0x307ce2['shift']());}};_0x2d9de8(++_0x25f321);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));}; \ No newline at end of file +var _0xac4a=['querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','VoiceMail','include','findAll','rows','catch','includeAll','create','body','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce'];(function(_0x50e052,_0x11ee9c){var _0xf3a25c=function(_0x320288){while(--_0x320288){_0x50e052['push'](_0x50e052['shift']());}};_0xf3a25c(++_0x11ee9c);}(_0xac4a,0x13f));var _0xaac4=function(_0x2d1f59,_0x5ae988){_0x2d1f59=_0x2d1f59-0x0;var _0x2872d4=_0xac4a[_0x2d1f59];return _0x2872d4;};'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(){var _0xb2577b=_0x4f10ec['get']({'plain':!![]});var _0x24186b='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x24186b,'resourceId':_0xb2577b['id']}})['then'](function(){return _0x4f10ec;});})[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)[_0xaac4('0x24')]();});}};}function handleEntityNotFound(_0xe93120,_0x3c1445){return function(_0x249a5d){if(!_0x249a5d){_0xe93120[_0xaac4('0x15')](0x194);}return _0x249a5d;};}function handleError(_0x2d68b6,_0x2f36ad){_0x2f36ad=_0x2f36ad||0x1f4;return function(_0x386c9b){logger['error'](_0x386c9b[_0xaac4('0x25')]);if(_0x386c9b[_0xaac4('0x26')]){delete _0x386c9b[_0xaac4('0x26')];}_0x2d68b6[_0xaac4('0x16')](_0x2f36ad)[_0xaac4('0x27')](_0x386c9b);};}exports[_0xaac4('0x28')]=function(_0x5e469a,_0xcf6c1){var _0x5d2c9a={},_0x2df7e3={},_0xab5d04={'count':0x0,'rows':[]};var _0x182343=_[_0xaac4('0x29')](db['VoiceMail']['rawAttributes'],function(_0x58f748){return{'name':_0x58f748[_0xaac4('0x2a')],'type':_0x58f748[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x2df7e3[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0x182343,_0xaac4('0x26'));_0x2df7e3[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x5e469a[_0xaac4('0x2e')]);_0x2df7e3[_0xaac4('0x30')]=_[_0xaac4('0x31')](_0x2df7e3[_0xaac4('0x2d')],_0x2df7e3[_0xaac4('0x2e')]);_0x5d2c9a[_0xaac4('0x32')]=_[_0xaac4('0x31')](_0x2df7e3['model'],qs['fields'](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x5d2c9a[_0xaac4('0x32')]=_0x5d2c9a['attributes'][_0xaac4('0x34')]?_0x5d2c9a[_0xaac4('0x32')]:_0x2df7e3[_0xaac4('0x2d')];if(!_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x35')](_0xaac4('0x36'))){_0x5d2c9a[_0xaac4('0x1a')]=qs['limit'](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x5d2c9a[_0xaac4('0x18')]=qs['offset'](_0x5e469a[_0xaac4('0x2e')]['offset']);}_0x5d2c9a['order']=qs[_0xaac4('0x37')](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x5d2c9a['where']=qs['filters'](_[_0xaac4('0x38')](_0x5e469a[_0xaac4('0x2e')],_0x2df7e3[_0xaac4('0x30')]),_0x182343);if(_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x39')]){_0x5d2c9a[_0xaac4('0x3a')]=_['merge'](_0x5d2c9a['where'],{'$or':_[_0xaac4('0x29')](_0x182343,function(_0x3b2b72){if(_0x3b2b72['type']!==_0xaac4('0x3b')){var _0xdea3a0={};_0xdea3a0[_0x3b2b72[_0xaac4('0x26')]]={'$like':'%'+_0x5e469a['query'][_0xaac4('0x39')]+'%'};return _0xdea3a0;}})});}_0x5d2c9a=_[_0xaac4('0x3c')]({},_0x5d2c9a,_0x5e469a[_0xaac4('0x3d')]);var _0x5bc387={'where':_0x5d2c9a[_0xaac4('0x3a')]};return db[_0xaac4('0x3e')][_0xaac4('0x1b')](_0x5bc387)[_0xaac4('0x23')](function(_0x51e59d){_0xab5d04[_0xaac4('0x1b')]=_0x51e59d;if(_0x5e469a['query']['includeAll']){_0x5d2c9a[_0xaac4('0x3f')]=[{'all':!![]}];}return db[_0xaac4('0x3e')][_0xaac4('0x40')](_0x5d2c9a);})[_0xaac4('0x23')](function(_0x43bc12){_0xab5d04[_0xaac4('0x41')]=_0x43bc12;return _0xab5d04;})[_0xaac4('0x23')](respondWithFilteredResult(_0xcf6c1,_0x5d2c9a))[_0xaac4('0x42')](handleError(_0xcf6c1,null));};exports['show']=function(_0x15191a,_0x36ac31){var _0x1fea3d={'raw':!![],'where':{'id':_0x15191a['params']['id']}},_0x2bba0c={};_0x2bba0c[_0xaac4('0x2d')]=_[_0xaac4('0x2f')](db[_0xaac4('0x3e')]['rawAttributes']);_0x2bba0c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x15191a[_0xaac4('0x2e')]);_0x2bba0c[_0xaac4('0x30')]=_['intersection'](_0x2bba0c[_0xaac4('0x2d')],_0x2bba0c[_0xaac4('0x2e')]);_0x1fea3d[_0xaac4('0x32')]=_['intersection'](_0x2bba0c[_0xaac4('0x2d')],qs[_0xaac4('0x33')](_0x15191a[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x1fea3d[_0xaac4('0x32')]=_0x1fea3d[_0xaac4('0x32')][_0xaac4('0x34')]?_0x1fea3d[_0xaac4('0x32')]:_0x2bba0c[_0xaac4('0x2d')];if(_0x15191a['query'][_0xaac4('0x43')]){_0x1fea3d[_0xaac4('0x3f')]=[{'all':!![]}];}_0x1fea3d=_[_0xaac4('0x3c')]({},_0x1fea3d,_0x15191a[_0xaac4('0x3d')]);return db[_0xaac4('0x3e')]['find'](_0x1fea3d)['then'](handleEntityNotFound(_0x36ac31,null))[_0xaac4('0x23')](respondWithResult(_0x36ac31,null))[_0xaac4('0x42')](handleError(_0x36ac31,null));};exports[_0xaac4('0x44')]=function(_0x16c7f4,_0x5f33ea){return db[_0xaac4('0x3e')]['create'](_0x16c7f4[_0xaac4('0x45')],{})[_0xaac4('0x23')](function(_0x487203){var _0x282de3=_0x16c7f4[_0xaac4('0x46')][_0xaac4('0x47')]({'plain':!![]});if(!_0x282de3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x282de3['role']===_0xaac4('0x46')){var _0x2c1751=_0x487203[_0xaac4('0x47')]({'plain':!![]});var _0xb32d1d=_0xaac4('0x48');return db[_0xaac4('0x49')]['find']({'where':{'name':_0xb32d1d,'userProfileId':_0x282de3[_0xaac4('0x4a')]},'raw':!![]})[_0xaac4('0x23')](function(_0x1c9979){if(_0x1c9979&&_0x1c9979[_0xaac4('0x4b')]===0x0){return db['UserProfileResource'][_0xaac4('0x44')]({'name':_0x2c1751['name'],'resourceId':_0x2c1751['id'],'type':_0x1c9979[_0xaac4('0x26')],'sectionId':_0x1c9979['id']},{})[_0xaac4('0x23')](function(){return _0x487203;});}else{return _0x487203;}})[_0xaac4('0x42')](function(_0x3922a0){logger[_0xaac4('0x4c')](_0xaac4('0x4d'),_0x3922a0);throw _0x3922a0;});}return _0x487203;})[_0xaac4('0x23')](respondWithResult(_0x5f33ea,0xc9))[_0xaac4('0x42')](handleError(_0x5f33ea,null));};exports[_0xaac4('0x21')]=function(_0x1b9219,_0x1a637e){if(_0x1b9219[_0xaac4('0x45')]['id']){delete _0x1b9219[_0xaac4('0x45')]['id'];}return db[_0xaac4('0x3e')]['find']({'where':{'id':_0x1b9219[_0xaac4('0x4e')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x1a637e,null))[_0xaac4('0x23')](saveUpdates(_0x1b9219[_0xaac4('0x45')],null))[_0xaac4('0x23')](respondWithResult(_0x1a637e,null))[_0xaac4('0x42')](handleError(_0x1a637e,null));};exports[_0xaac4('0x22')]=function(_0x46082d,_0x5e8928){return db[_0xaac4('0x3e')]['find']({'where':{'id':_0x46082d[_0xaac4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e8928,null))[_0xaac4('0x23')](removeEntity(_0x5e8928,null))['catch'](handleError(_0x5e8928,null));};exports['getMessages']=function(_0x19764c,_0x3a4e29,_0x48ae39){return db[_0xaac4('0x3e')][_0xaac4('0x4f')]({'where':{'id':_0x19764c[_0xaac4('0x4e')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x3a4e29,null))[_0xaac4('0x23')](function(_0x19d9c1){var _0x5d38bc;var _0x346f4c={},_0x586a10={};_0x586a10[_0xaac4('0x2d')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x586a10[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x19764c[_0xaac4('0x2e')]);_0x586a10[_0xaac4('0x30')]=_['intersection'](_0x586a10[_0xaac4('0x2d')],_0x586a10[_0xaac4('0x2e')]);_0x346f4c[_0xaac4('0x32')]=_['intersection'](_0x586a10[_0xaac4('0x2d')],qs[_0xaac4('0x33')](_0x19764c[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x346f4c[_0xaac4('0x32')]=_0x346f4c[_0xaac4('0x32')][_0xaac4('0x34')]?_0x346f4c['attributes']:_0x586a10['model'];if(!_0x19764c[_0xaac4('0x2e')]['hasOwnProperty']('nolimit')){_0x346f4c[_0xaac4('0x1a')]=qs['limit'](_0x19764c[_0xaac4('0x2e')]['limit']);_0x346f4c[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x19764c['query']['offset']);}_0x346f4c['order']=qs['sort'](_0x19764c[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x346f4c[_0xaac4('0x3a')]=qs[_0xaac4('0x30')](_['pick'](_0x19764c[_0xaac4('0x2e')],_0x586a10[_0xaac4('0x30')]));if(_0x19764c[_0xaac4('0x2e')][_0xaac4('0x39')]){_0x346f4c[_0xaac4('0x3a')]=_[_0xaac4('0x3c')](_0x346f4c[_0xaac4('0x3a')],{'$or':_[_0xaac4('0x29')](_0x346f4c[_0xaac4('0x32')],function(_0x40271c){var _0x43aeee={};_0x43aeee[_0x40271c]={'$like':'%'+_0x19764c['query']['filter']+'%'};return _0x43aeee;})});}_0x346f4c[_0xaac4('0x3a')]=_['merge'](_0x346f4c['where'],{'mailboxuser':_0x19d9c1[_0xaac4('0x50')]});_0x346f4c=_['merge']({},_0x346f4c,_0x19764c[_0xaac4('0x3d')]);return db[_0xaac4('0x51')][_0xaac4('0x52')](_0x346f4c)[_0xaac4('0x23')](respondWithFilteredResult(_0x3a4e29,_0x346f4c));})['catch'](handleError(_0x3a4e29,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 54b89a0..3261814 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 _0xb8ec=['mailbox_context','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMail.attributes','exports','define','voice_voicemail'];(function(_0x215011,_0x4e2944){var _0xac34f5=function(_0xa33287){while(--_0xa33287){_0x215011['push'](_0x215011['shift']());}};_0xac34f5(++_0x4e2944);}(_0xb8ec,0x72));var _0xcb8e=function(_0x33cd6f,_0x240861){_0x33cd6f=_0x33cd6f-0x0;var _0x2c07eb=_0xb8ec[_0x33cd6f];return _0x2c07eb;};'use strict';var _=require(_0xcb8e('0x0'));var util=require(_0xcb8e('0x1'));var logger=require(_0xcb8e('0x2'))(_0xcb8e('0x3'));var moment=require(_0xcb8e('0x4'));var BPromise=require(_0xcb8e('0x5'));var rp=require(_0xcb8e('0x6'));var fs=require('fs');var path=require(_0xcb8e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb8e('0x8'));module[_0xcb8e('0x9')]=function(_0x121501,_0x3506b3){return _0x121501[_0xcb8e('0xa')]('VoiceMail',attributes,{'tableName':_0xcb8e('0xb'),'paranoid':![],'indexes':[{'name':_0xcb8e('0xc'),'fields':['mailbox',_0xcb8e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f0a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util'];(function(_0x424501,_0x371c1a){var _0x57f251=function(_0x24ec6c){while(--_0x24ec6c){_0x424501['push'](_0x424501['shift']());}};_0x57f251(++_0x371c1a);}(_0x5f0a,0x86));var _0xa5f0=function(_0x782bc0,_0x2247f8){_0x782bc0=_0x782bc0-0x0;var _0x500efc=_0x5f0a[_0x782bc0];return _0x500efc;};'use strict';var _=require(_0xa5f0('0x0'));var util=require(_0xa5f0('0x1'));var logger=require(_0xa5f0('0x2'))(_0xa5f0('0x3'));var moment=require(_0xa5f0('0x4'));var BPromise=require('bluebird');var rp=require(_0xa5f0('0x5'));var fs=require('fs');var path=require(_0xa5f0('0x6'));var rimraf=require(_0xa5f0('0x7'));var config=require(_0xa5f0('0x8'));var attributes=require(_0xa5f0('0x9'));module[_0xa5f0('0xa')]=function(_0x9a4139,_0x19c207){return _0x9a4139[_0xa5f0('0xb')](_0xa5f0('0xc'),attributes,{'tableName':_0xa5f0('0xd'),'paranoid':![],'indexes':[{'name':_0xa5f0('0xe'),'fields':[_0xa5f0('0xf'),_0xa5f0('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 688be5f..efcf79f 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 _0xfe4f=['../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe4f,0x1d7));var _0xffe4=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0xfe4f[_0x3b085];return _0x476a57;};'use strict';var _=require(_0xffe4('0x0'));var util=require(_0xffe4('0x1'));var moment=require(_0xffe4('0x2'));var BPromise=require(_0xffe4('0x3'));var rs=require(_0xffe4('0x4'));var fs=require('fs');var Redis=require(_0xffe4('0x5'));var db=require(_0xffe4('0x6'))['db'];var utils=require(_0xffe4('0x7'));var logger=require('../../config/logger')(_0xffe4('0x8'));var config=require(_0xffe4('0x9'));var jayson=require(_0xffe4('0xa'));var client=jayson['client'][_0xffe4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5155a0,_0x1caf2b,_0x46dfb4){return new BPromise(function(_0x2155e3,_0x3fd8f3){return client[_0xffe4('0xc')](_0x5155a0,_0x46dfb4)[_0xffe4('0xd')](function(_0xe893a){logger['info'](_0xffe4('0xe'),_0x1caf2b,_0xffe4('0xf'));logger[_0xffe4('0x10')](_0xffe4('0x11'),_0x1caf2b,'request\x20sent',JSON[_0xffe4('0x12')](_0xe893a));if(_0xe893a[_0xffe4('0x13')]){if(_0xe893a['error'][_0xffe4('0x14')]===0x1f4){logger[_0xffe4('0x13')](_0xffe4('0xe'),_0x1caf2b,_0xe893a[_0xffe4('0x13')][_0xffe4('0x15')]);return _0x3fd8f3(_0xe893a['error'][_0xffe4('0x15')]);}logger[_0xffe4('0x13')](_0xffe4('0xe'),_0x1caf2b,_0xe893a[_0xffe4('0x13')][_0xffe4('0x15')]);return _0x2155e3(_0xe893a[_0xffe4('0x13')][_0xffe4('0x15')]);}else{logger[_0xffe4('0x16')](_0xffe4('0xe'),_0x1caf2b,_0xffe4('0xf'));_0x2155e3(_0xe893a['result'][_0xffe4('0x15')]);}})[_0xffe4('0x17')](function(_0x1fc931){logger[_0xffe4('0x13')](_0xffe4('0xe'),_0x1caf2b,_0x1fc931);_0x3fd8f3(_0x1fc931);});});} \ No newline at end of file +var _0xa339=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x2cfbf2,_0x1addfd){var _0x1b41f0=function(_0x539393){while(--_0x539393){_0x2cfbf2['push'](_0x2cfbf2['shift']());}};_0x1b41f0(++_0x1addfd);}(_0xa339,0x84));var _0x9a33=function(_0x521aa0,_0x1a71c2){_0x521aa0=_0x521aa0-0x0;var _0x2e102c=_0xa339[_0x521aa0];return _0x2e102c;};'use strict';var _=require(_0x9a33('0x0'));var util=require(_0x9a33('0x1'));var moment=require(_0x9a33('0x2'));var BPromise=require(_0x9a33('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a33('0x4'));var db=require(_0x9a33('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a33('0x6'))(_0x9a33('0x7'));var config=require(_0x9a33('0x8'));var jayson=require(_0x9a33('0x9'));var client=jayson[_0x9a33('0xa')][_0x9a33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244b11,_0x2fefb3,_0x5a858c){return new BPromise(function(_0x5951ad,_0x356a4c){return client[_0x9a33('0xc')](_0x244b11,_0x5a858c)[_0x9a33('0xd')](function(_0x3ff583){logger[_0x9a33('0xe')](_0x9a33('0xf'),_0x2fefb3,'request\x20sent');logger[_0x9a33('0x10')](_0x9a33('0x11'),_0x2fefb3,_0x9a33('0x12'),JSON[_0x9a33('0x13')](_0x3ff583));if(_0x3ff583[_0x9a33('0x14')]){if(_0x3ff583[_0x9a33('0x14')][_0x9a33('0x15')]===0x1f4){logger[_0x9a33('0x14')](_0x9a33('0xf'),_0x2fefb3,_0x3ff583[_0x9a33('0x14')]['message']);return _0x356a4c(_0x3ff583[_0x9a33('0x14')]['message']);}logger[_0x9a33('0x14')]('VoiceMail,\x20%s,\x20%s',_0x2fefb3,_0x3ff583[_0x9a33('0x14')][_0x9a33('0x16')]);return _0x5951ad(_0x3ff583[_0x9a33('0x14')][_0x9a33('0x16')]);}else{logger[_0x9a33('0xe')]('VoiceMail,\x20%s,\x20%s',_0x2fefb3,_0x9a33('0x12'));_0x5951ad(_0x3ff583[_0x9a33('0x17')][_0x9a33('0x16')]);}})[_0x9a33('0x18')](function(_0x13fb73){logger[_0x9a33('0x14')](_0x9a33('0xf'),_0x2fefb3,_0x13fb73);_0x356a4c(_0x13fb73);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 4497b2c..f4730a5 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 _0xd32c=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','download','post','put','update'];(function(_0x14d770,_0x1f606c){var _0x51c915=function(_0x43c7aa){while(--_0x43c7aa){_0x14d770['push'](_0x14d770['shift']());}};_0x51c915(++_0x1f606c);}(_0xd32c,0x1ca));var _0xcd32=function(_0x3938d2,_0x8e9793){_0x3938d2=_0x3938d2-0x0;var _0x45513c=_0xd32c[_0x3938d2];return _0x45513c;};'use strict';var multer=require(_0xcd32('0x0'));var util=require('util');var path=require(_0xcd32('0x1'));var timeout=require(_0xcd32('0x2'));var express=require(_0xcd32('0x3'));var router=express[_0xcd32('0x4')]();var fs_extra=require(_0xcd32('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd32('0x6'));var config=require('../../config/environment');var controller=require(_0xcd32('0x7'));router['get']('/',auth[_0xcd32('0x8')](),controller[_0xcd32('0x9')]);router[_0xcd32('0xa')](_0xcd32('0xb'),auth[_0xcd32('0x8')](),controller[_0xcd32('0xc')]);router[_0xcd32('0xa')]('/:id/download',auth[_0xcd32('0x8')](),controller[_0xcd32('0xd')]);router[_0xcd32('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcd32('0xf')](_0xcd32('0xb'),auth[_0xcd32('0x8')](),controller[_0xcd32('0x10')]);router[_0xcd32('0x11')](_0xcd32('0xb'),auth[_0xcd32('0x8')](),controller[_0xcd32('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9337=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','put','update','delete'];(function(_0x296b8a,_0x3c8ee5){var _0x363614=function(_0x343576){while(--_0x343576){_0x296b8a['push'](_0x296b8a['shift']());}};_0x363614(++_0x3c8ee5);}(_0x9337,0x17e));var _0x7933=function(_0x2b9415,_0x25ade6){_0x2b9415=_0x2b9415-0x0;var _0x319dd6=_0x9337[_0x2b9415];return _0x319dd6;};'use strict';var multer=require('multer');var util=require(_0x7933('0x0'));var path=require(_0x7933('0x1'));var timeout=require('connect-timeout');var express=require(_0x7933('0x2'));var router=express[_0x7933('0x3')]();var fs_extra=require(_0x7933('0x4'));var auth=require(_0x7933('0x5'));var interaction=require(_0x7933('0x6'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x7933('0x7')]('/',auth[_0x7933('0x8')](),controller[_0x7933('0x9')]);router[_0x7933('0x7')](_0x7933('0xa'),auth[_0x7933('0x8')](),controller[_0x7933('0xb')]);router[_0x7933('0x7')](_0x7933('0xc'),auth[_0x7933('0x8')](),controller[_0x7933('0xd')]);router['post']('/',auth[_0x7933('0x8')](),controller['create']);router[_0x7933('0xe')](_0x7933('0xa'),auth[_0x7933('0x8')](),controller[_0x7933('0xf')]);router[_0x7933('0x10')](_0x7933('0xa'),auth['isAuthenticated'](),controller[_0x7933('0x11')]);module[_0x7933('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 68cf5be..f33a50f 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 _0x0194=['long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0194,0x8b));var _0x4019=function(_0x21b762,_0x177969){_0x21b762=_0x21b762-0x0;var _0x5afbfc=_0x0194[_0x21b762];return _0x5afbfc;};'use strict';var Sequelize=require(_0x4019('0x0'));module[_0x4019('0x1')]={'name':{'type':Sequelize[_0x4019('0x2')],'get':function(_0xcfaa8f){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x4019('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x4019('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4019('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x4019('0x6')](_0x4019('0x7'))}}; \ No newline at end of file +var _0x48be=['STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x104c73,_0xdf3c57){var _0x3d340d=function(_0x109166){while(--_0x109166){_0x104c73['push'](_0x104c73['shift']());}};_0x3d340d(++_0xdf3c57);}(_0x48be,0xe5));var _0xe48b=function(_0x3919dc,_0x2c4996){_0x3919dc=_0x3919dc-0x0;var _0x349f4f=_0x48be[_0x3919dc];return _0x349f4f;};'use strict';var Sequelize=require(_0xe48b('0x0'));module[_0xe48b('0x1')]={'name':{'type':Sequelize[_0xe48b('0x2')],'get':function(_0xabbf80){return this[_0xe48b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xe48b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xe48b('0x6')](_0xe48b('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe48b('0x5')],'defaultValue':''},'stamp':{'type':_0xe48b('0x8'),'defaultValue':Sequelize['literal']('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 4eefd2a..7eacf70 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 _0x1901=['squel','jsforce','papaparse','ioredis','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','VoiceMailMessage','rawAttributes','type','key','differenceBy','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','count','then','include','findAll','params','fields','includeAll','find','catch','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash'];(function(_0x1bc95c,_0x109aec){var _0x1a9fdc=function(_0x3d73f8){while(--_0x3d73f8){_0x1bc95c['push'](_0x1bc95c['shift']());}};_0x1a9fdc(++_0x109aec);}(_0x1901,0xdc));var _0x1190=function(_0x45df8d,_0x53af38){_0x45df8d=_0x45df8d-0x0;var _0xd06396=_0x1901[_0x45df8d];return _0xd06396;};'use strict';var emlformat=require(_0x1190('0x0'));var rimraf=require(_0x1190('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1190('0x2'));var rp=require(_0x1190('0x3'));var moment=require(_0x1190('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1190('0x5'));var util=require(_0x1190('0x6'));var path=require(_0x1190('0x7'));var sox=require('sox');var csv=require(_0x1190('0x8'));var ejs=require(_0x1190('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1190('0xa'));var squel=require(_0x1190('0xb'));var crypto=require('crypto');var jsforce=require(_0x1190('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1190('0x8'));var querystring=require('querystring');var Papa=require(_0x1190('0xd'));var Redis=require(_0x1190('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1190('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x1190('0x10'));var licenseUtil=require(_0x1190('0x11'));var db=require(_0x1190('0x12'))['db'];function respondWithStatusCode(_0x491567,_0x133481){_0x133481=_0x133481||0xcc;return function(_0x2d1982){if(_0x2d1982){return _0x491567[_0x1190('0x13')](_0x133481);}return _0x491567[_0x1190('0x14')](_0x133481)[_0x1190('0x15')]();};}function respondWithResult(_0x402bfc,_0xe8dc3c){_0xe8dc3c=_0xe8dc3c||0xc8;return function(_0x5d35e2){if(_0x5d35e2){return _0x402bfc['status'](_0xe8dc3c)[_0x1190('0x16')](_0x5d35e2);}};}function respondWithFilteredResult(_0x11bc84,_0x120bfb){return function(_0xa28060){if(_0xa28060){var _0x485eaa=typeof _0x120bfb['offset']===_0x1190('0x17')&&typeof _0x120bfb['limit']===_0x1190('0x17');var _0x5c5b4c=_0xa28060['count'];var _0x44b295=_0x485eaa?0x0:_0x120bfb[_0x1190('0x18')];var _0x15d13b=_0x485eaa?_0xa28060['count']:_0x120bfb['offset']+_0x120bfb[_0x1190('0x19')];var _0x4b8326;if(_0x15d13b>=_0x5c5b4c){_0x15d13b=_0x5c5b4c;_0x4b8326=0xc8;}else{_0x4b8326=0xce;}_0x11bc84[_0x1190('0x14')](_0x4b8326);return _0x11bc84[_0x1190('0x1a')](_0x1190('0x1b'),_0x44b295+'-'+_0x15d13b+'/'+_0x5c5b4c)[_0x1190('0x16')](_0xa28060);}return null;};}function patchUpdates(_0x1b221a){return function(_0xad9629){try{jsonpatch[_0x1190('0x1c')](_0xad9629,_0x1b221a,!![]);}catch(_0x1505eb){return BPromise['reject'](_0x1505eb);}return _0xad9629[_0x1190('0x1d')]();};}function saveUpdates(_0x3d027a,_0x155c7b){return function(_0x5c8c3f){if(_0x5c8c3f){return _0x5c8c3f[_0x1190('0x1e')](_0x3d027a)['then'](function(_0x823779){return _0x823779;});}return null;};}function removeEntity(_0x253ad7,_0x45b812){return function(_0x30c42a){if(_0x30c42a){return _0x30c42a[_0x1190('0x1f')]()['then'](function(){_0x253ad7['status'](0xcc)[_0x1190('0x15')]();});}};}function handleEntityNotFound(_0x501aab,_0x2351e2){return function(_0x2ad840){if(!_0x2ad840){_0x501aab[_0x1190('0x13')](0x194);}return _0x2ad840;};}function handleError(_0x5f1b54,_0xaac15e){_0xaac15e=_0xaac15e||0x1f4;return function(_0x479260){logger['error'](_0x479260[_0x1190('0x20')]);if(_0x479260[_0x1190('0x21')]){delete _0x479260[_0x1190('0x21')];}_0x5f1b54[_0x1190('0x14')](_0xaac15e)[_0x1190('0x22')](_0x479260);};}exports[_0x1190('0x23')]=function(_0x48e510,_0x326568){var _0x12e368={},_0x592b14={},_0x1b4f09={'count':0x0,'rows':[]};var _0x36871c=_[_0x1190('0x24')](db[_0x1190('0x25')][_0x1190('0x26')],function(_0x55638d){return{'name':_0x55638d['fieldName'],'type':_0x55638d[_0x1190('0x27')][_0x1190('0x28')]};});_0x592b14['model']=_[_0x1190('0x29')](_[_0x1190('0x24')](_0x36871c,_0x1190('0x21')),['name']);_0x592b14[_0x1190('0x2a')]=_[_0x1190('0x2b')](_0x48e510[_0x1190('0x2a')]);_0x592b14[_0x1190('0x2c')]=_[_0x1190('0x2d')](_0x592b14[_0x1190('0x2e')],_0x592b14['query']);_0x12e368[_0x1190('0x2f')]=_['intersection'](_0x592b14['model'],qs['fields'](_0x48e510[_0x1190('0x2a')]['fields']));_0x12e368[_0x1190('0x2f')]=_0x12e368['attributes'][_0x1190('0x30')]?_0x12e368[_0x1190('0x2f')]:_0x592b14['model'];if(!_0x48e510[_0x1190('0x2a')][_0x1190('0x31')](_0x1190('0x32'))){_0x12e368[_0x1190('0x19')]=qs[_0x1190('0x19')](_0x48e510['query']['limit']);_0x12e368[_0x1190('0x18')]=qs[_0x1190('0x18')](_0x48e510['query'][_0x1190('0x18')]);}_0x12e368[_0x1190('0x33')]=qs[_0x1190('0x34')](_0x48e510['query'][_0x1190('0x34')]);_0x12e368['where']=qs[_0x1190('0x2c')](_['pick'](_0x48e510[_0x1190('0x2a')],_0x592b14[_0x1190('0x2c')]),_0x36871c);if(_0x48e510[_0x1190('0x2a')][_0x1190('0x35')]){_0x12e368[_0x1190('0x36')]=_[_0x1190('0x37')](_0x12e368['where'],{'$or':_[_0x1190('0x24')](_0x36871c,function(_0x25e393){if(_0x25e393[_0x1190('0x27')]!=='VIRTUAL'){var _0x10f9cd={};_0x10f9cd[_0x25e393[_0x1190('0x21')]]={'$like':'%'+_0x48e510[_0x1190('0x2a')][_0x1190('0x35')]+'%'};return _0x10f9cd;}})});}_0x12e368=_[_0x1190('0x37')]({},_0x12e368,_0x48e510[_0x1190('0x38')]);var _0x564776={'where':_0x12e368['where']};return db[_0x1190('0x25')][_0x1190('0x39')](_0x564776)[_0x1190('0x3a')](function(_0x448d74){_0x1b4f09[_0x1190('0x39')]=_0x448d74;if(_0x48e510[_0x1190('0x2a')]['includeAll']){_0x12e368[_0x1190('0x3b')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x1190('0x3c')](_0x12e368);})[_0x1190('0x3a')](function(_0x427a7a){_0x1b4f09['rows']=_0x427a7a;return _0x1b4f09;})[_0x1190('0x3a')](respondWithFilteredResult(_0x326568,_0x12e368))['catch'](handleError(_0x326568,null));};exports['show']=function(_0x1a1b99,_0x2690d2){var _0x38b19e={'raw':!![],'where':{'id':_0x1a1b99[_0x1190('0x3d')]['id']}},_0x520dcf={};_0x520dcf['model']=_['keys'](db[_0x1190('0x25')][_0x1190('0x26')]);_0x520dcf['query']=_[_0x1190('0x2b')](_0x1a1b99[_0x1190('0x2a')]);_0x520dcf[_0x1190('0x2c')]=_[_0x1190('0x2d')](_0x520dcf[_0x1190('0x2e')],_0x520dcf[_0x1190('0x2a')]);_0x38b19e[_0x1190('0x2f')]=_['intersection'](_0x520dcf[_0x1190('0x2e')],qs[_0x1190('0x3e')](_0x1a1b99[_0x1190('0x2a')][_0x1190('0x3e')]));_0x38b19e[_0x1190('0x2f')]=_0x38b19e[_0x1190('0x2f')][_0x1190('0x30')]?_0x38b19e[_0x1190('0x2f')]:_0x520dcf['model'];if(_0x1a1b99[_0x1190('0x2a')][_0x1190('0x3f')]){_0x38b19e[_0x1190('0x3b')]=[{'all':!![]}];}_0x38b19e=_['merge']({},_0x38b19e,_0x1a1b99[_0x1190('0x38')]);return db['VoiceMailMessage'][_0x1190('0x40')](_0x38b19e)[_0x1190('0x3a')](handleEntityNotFound(_0x2690d2,null))[_0x1190('0x3a')](respondWithResult(_0x2690d2,null))[_0x1190('0x41')](handleError(_0x2690d2,null));};exports[_0x1190('0x42')]=function(_0x5783c4,_0x1e45a0){return db[_0x1190('0x25')][_0x1190('0x42')](_0x5783c4[_0x1190('0x43')],{})[_0x1190('0x3a')](respondWithResult(_0x1e45a0,0xc9))[_0x1190('0x41')](handleError(_0x1e45a0,null));};exports[_0x1190('0x1e')]=function(_0x2473ee,_0x3d7d48){if(_0x2473ee['body']['id']){delete _0x2473ee[_0x1190('0x43')]['id'];}return db[_0x1190('0x25')]['find']({'where':{'id':_0x2473ee['params']['id']}})['then'](handleEntityNotFound(_0x3d7d48,null))[_0x1190('0x3a')](saveUpdates(_0x2473ee[_0x1190('0x43')],null))[_0x1190('0x3a')](respondWithResult(_0x3d7d48,null))[_0x1190('0x41')](handleError(_0x3d7d48,null));};exports[_0x1190('0x1f')]=function(_0x10ac87,_0x57499e){return db[_0x1190('0x25')][_0x1190('0x40')]({'where':{'id':_0x10ac87['params']['id']}})[_0x1190('0x3a')](handleEntityNotFound(_0x57499e,null))[_0x1190('0x3a')](removeEntity(_0x57499e,null))[_0x1190('0x41')](handleError(_0x57499e,null));};exports[_0x1190('0x44')]=function(_0x3c72cb,_0x29d003,_0x414396){return db['VoiceMailMessage'][_0x1190('0x40')]({'where':{'id':_0x3c72cb[_0x1190('0x3d')]['id']},'attributes':['id','recording','msg_id']})[_0x1190('0x3a')](handleEntityNotFound(_0x29d003,null))[_0x1190('0x3a')](function(_0x20e86b){if(_0x20e86b){if(!_0x20e86b[_0x1190('0x45')]){throw new db[(_0x1190('0x46'))][(_0x1190('0x47'))](_0x1190('0x48'));}var _0xca259a={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x20e86b['msg_id']){_0xca259a[_0x1190('0x49')]=_0x1190('0x4a')+_0x20e86b[_0x1190('0x4b')]+_0x1190('0x4c');}_0x29d003[_0x1190('0x1a')](_0xca259a);return _0x29d003['send'](new Buffer(_0x20e86b[_0x1190('0x45')]));}})[_0x1190('0x41')](handleError(_0x29d003,null));}; \ No newline at end of file +var _0x7440=['name','send','index','map','VoiceMailMessage','type','differenceBy','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','length','create','body','find','recording','msg_id','Sequelize','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7440,0x79));var _0x0744=function(_0x5b2b54,_0x43f514){_0x5b2b54=_0x5b2b54-0x0;var _0x175745=_0x7440[_0x5b2b54];return _0x175745;};'use strict';var emlformat=require(_0x0744('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0744('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0744('0x2'));var moment=require(_0x0744('0x3'));var BPromise=require(_0x0744('0x4'));var Mustache=require('mustache');var util=require(_0x0744('0x5'));var path=require(_0x0744('0x6'));var sox=require(_0x0744('0x7'));var csv=require(_0x0744('0x8'));var ejs=require(_0x0744('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0744('0xa'));var squel=require(_0x0744('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0744('0x8'));var querystring=require(_0x0744('0xc'));var Papa=require('papaparse');var Redis=require(_0x0744('0xd'));var authService=require(_0x0744('0xe'));var qs=require(_0x0744('0xf'));var as=require(_0x0744('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0744('0x11'))('api');var utils=require(_0x0744('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0744('0x13'));var db=require(_0x0744('0x14'))['db'];function respondWithStatusCode(_0x21372c,_0x51566f){_0x51566f=_0x51566f||0xcc;return function(_0x23798a){if(_0x23798a){return _0x21372c['sendStatus'](_0x51566f);}return _0x21372c['status'](_0x51566f)[_0x0744('0x15')]();};}function respondWithResult(_0x4c6411,_0x37531a){_0x37531a=_0x37531a||0xc8;return function(_0xdd09e6){if(_0xdd09e6){return _0x4c6411[_0x0744('0x16')](_0x37531a)['json'](_0xdd09e6);}};}function respondWithFilteredResult(_0x3bd90e,_0x21b9f5){return function(_0x55e961){if(_0x55e961){var _0x19cf60=typeof _0x21b9f5[_0x0744('0x17')]==='undefined'&&typeof _0x21b9f5['limit']===_0x0744('0x18');var _0x48f69b=_0x55e961[_0x0744('0x19')];var _0x50beab=_0x19cf60?0x0:_0x21b9f5[_0x0744('0x17')];var _0x22550d=_0x19cf60?_0x55e961[_0x0744('0x19')]:_0x21b9f5['offset']+_0x21b9f5[_0x0744('0x1a')];var _0x40c6bb;if(_0x22550d>=_0x48f69b){_0x22550d=_0x48f69b;_0x40c6bb=0xc8;}else{_0x40c6bb=0xce;}_0x3bd90e[_0x0744('0x16')](_0x40c6bb);return _0x3bd90e[_0x0744('0x1b')](_0x0744('0x1c'),_0x50beab+'-'+_0x22550d+'/'+_0x48f69b)[_0x0744('0x1d')](_0x55e961);}return null;};}function patchUpdates(_0x31afd1){return function(_0x4d945b){try{jsonpatch[_0x0744('0x1e')](_0x4d945b,_0x31afd1,!![]);}catch(_0x22d327){return BPromise[_0x0744('0x1f')](_0x22d327);}return _0x4d945b['save']();};}function saveUpdates(_0x4d26dd,_0x4389fc){return function(_0x4b64b3){if(_0x4b64b3){return _0x4b64b3[_0x0744('0x20')](_0x4d26dd)[_0x0744('0x21')](function(_0x271c21){return _0x271c21;});}return null;};}function removeEntity(_0x37af79,_0x1e4712){return function(_0x13bace){if(_0x13bace){return _0x13bace[_0x0744('0x22')]()[_0x0744('0x21')](function(){_0x37af79['status'](0xcc)[_0x0744('0x15')]();});}};}function handleEntityNotFound(_0x240663,_0x3c0d4a){return function(_0x5d49c1){if(!_0x5d49c1){_0x240663[_0x0744('0x23')](0x194);}return _0x5d49c1;};}function handleError(_0x4c2d3d,_0x29cf96){_0x29cf96=_0x29cf96||0x1f4;return function(_0x56650c){logger['error'](_0x56650c[_0x0744('0x24')]);if(_0x56650c[_0x0744('0x25')]){delete _0x56650c[_0x0744('0x25')];}_0x4c2d3d[_0x0744('0x16')](_0x29cf96)[_0x0744('0x26')](_0x56650c);};}exports[_0x0744('0x27')]=function(_0x283578,_0x1c12c6){var _0x238116={},_0x11411d={},_0x516410={'count':0x0,'rows':[]};var _0x319502=_[_0x0744('0x28')](db[_0x0744('0x29')]['rawAttributes'],function(_0x3ca66d){return{'name':_0x3ca66d['fieldName'],'type':_0x3ca66d[_0x0744('0x2a')]['key']};});_0x11411d['model']=_[_0x0744('0x2b')](_[_0x0744('0x28')](_0x319502,_0x0744('0x25')),[_0x0744('0x25')]);_0x11411d[_0x0744('0x2c')]=_['keys'](_0x283578[_0x0744('0x2c')]);_0x11411d[_0x0744('0x2d')]=_[_0x0744('0x2e')](_0x11411d['model'],_0x11411d[_0x0744('0x2c')]);_0x238116[_0x0744('0x2f')]=_['intersection'](_0x11411d['model'],qs[_0x0744('0x30')](_0x283578[_0x0744('0x2c')][_0x0744('0x30')]));_0x238116['attributes']=_0x238116[_0x0744('0x2f')]['length']?_0x238116[_0x0744('0x2f')]:_0x11411d[_0x0744('0x31')];if(!_0x283578['query'][_0x0744('0x32')](_0x0744('0x33'))){_0x238116[_0x0744('0x1a')]=qs[_0x0744('0x1a')](_0x283578[_0x0744('0x2c')][_0x0744('0x1a')]);_0x238116['offset']=qs[_0x0744('0x17')](_0x283578[_0x0744('0x2c')][_0x0744('0x17')]);}_0x238116[_0x0744('0x34')]=qs[_0x0744('0x35')](_0x283578[_0x0744('0x2c')][_0x0744('0x35')]);_0x238116[_0x0744('0x36')]=qs['filters'](_[_0x0744('0x37')](_0x283578[_0x0744('0x2c')],_0x11411d[_0x0744('0x2d')]),_0x319502);if(_0x283578[_0x0744('0x2c')]['filter']){_0x238116[_0x0744('0x36')]=_[_0x0744('0x38')](_0x238116[_0x0744('0x36')],{'$or':_['map'](_0x319502,function(_0x4181b6){if(_0x4181b6['type']!==_0x0744('0x39')){var _0x262f20={};_0x262f20[_0x4181b6['name']]={'$like':'%'+_0x283578[_0x0744('0x2c')][_0x0744('0x3a')]+'%'};return _0x262f20;}})});}_0x238116=_[_0x0744('0x38')]({},_0x238116,_0x283578[_0x0744('0x3b')]);var _0x36c2cb={'where':_0x238116[_0x0744('0x36')]};return db[_0x0744('0x29')]['count'](_0x36c2cb)[_0x0744('0x21')](function(_0x39f57c){_0x516410[_0x0744('0x19')]=_0x39f57c;if(_0x283578['query'][_0x0744('0x3c')]){_0x238116[_0x0744('0x3d')]=[{'all':!![]}];}return db[_0x0744('0x29')]['findAll'](_0x238116);})[_0x0744('0x21')](function(_0x536fa3){_0x516410[_0x0744('0x3e')]=_0x536fa3;return _0x516410;})[_0x0744('0x21')](respondWithFilteredResult(_0x1c12c6,_0x238116))[_0x0744('0x3f')](handleError(_0x1c12c6,null));};exports[_0x0744('0x40')]=function(_0x54745c,_0x2c7aa3){var _0x2c4e1a={'raw':!![],'where':{'id':_0x54745c[_0x0744('0x41')]['id']}},_0x3df976={};_0x3df976[_0x0744('0x31')]=_['keys'](db[_0x0744('0x29')][_0x0744('0x42')]);_0x3df976[_0x0744('0x2c')]=_[_0x0744('0x43')](_0x54745c[_0x0744('0x2c')]);_0x3df976[_0x0744('0x2d')]=_[_0x0744('0x2e')](_0x3df976[_0x0744('0x31')],_0x3df976[_0x0744('0x2c')]);_0x2c4e1a[_0x0744('0x2f')]=_['intersection'](_0x3df976['model'],qs[_0x0744('0x30')](_0x54745c['query'][_0x0744('0x30')]));_0x2c4e1a['attributes']=_0x2c4e1a[_0x0744('0x2f')][_0x0744('0x44')]?_0x2c4e1a[_0x0744('0x2f')]:_0x3df976['model'];if(_0x54745c[_0x0744('0x2c')]['includeAll']){_0x2c4e1a[_0x0744('0x3d')]=[{'all':!![]}];}_0x2c4e1a=_[_0x0744('0x38')]({},_0x2c4e1a,_0x54745c[_0x0744('0x3b')]);return db[_0x0744('0x29')]['find'](_0x2c4e1a)[_0x0744('0x21')](handleEntityNotFound(_0x2c7aa3,null))[_0x0744('0x21')](respondWithResult(_0x2c7aa3,null))[_0x0744('0x3f')](handleError(_0x2c7aa3,null));};exports[_0x0744('0x45')]=function(_0x185724,_0x34d744){return db['VoiceMailMessage']['create'](_0x185724[_0x0744('0x46')],{})[_0x0744('0x21')](respondWithResult(_0x34d744,0xc9))[_0x0744('0x3f')](handleError(_0x34d744,null));};exports[_0x0744('0x20')]=function(_0x128acb,_0x591718){if(_0x128acb[_0x0744('0x46')]['id']){delete _0x128acb['body']['id'];}return db['VoiceMailMessage'][_0x0744('0x47')]({'where':{'id':_0x128acb['params']['id']}})[_0x0744('0x21')](handleEntityNotFound(_0x591718,null))[_0x0744('0x21')](saveUpdates(_0x128acb[_0x0744('0x46')],null))['then'](respondWithResult(_0x591718,null))[_0x0744('0x3f')](handleError(_0x591718,null));};exports[_0x0744('0x22')]=function(_0x4958f7,_0x2b7fb7){return db['VoiceMailMessage'][_0x0744('0x47')]({'where':{'id':_0x4958f7[_0x0744('0x41')]['id']}})[_0x0744('0x21')](handleEntityNotFound(_0x2b7fb7,null))[_0x0744('0x21')](removeEntity(_0x2b7fb7,null))[_0x0744('0x3f')](handleError(_0x2b7fb7,null));};exports['download']=function(_0x36fb6a,_0x4f65b8,_0xbfd955){return db[_0x0744('0x29')][_0x0744('0x47')]({'where':{'id':_0x36fb6a[_0x0744('0x41')]['id']},'attributes':['id',_0x0744('0x48'),_0x0744('0x49')]})['then'](handleEntityNotFound(_0x4f65b8,null))[_0x0744('0x21')](function(_0x3fa4c6){if(_0x3fa4c6){if(!_0x3fa4c6[_0x0744('0x48')]){throw new db[(_0x0744('0x4a'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x299024={'Content-Type':_0x0744('0x4b'),'Content-Disposition':_0x0744('0x4c')};if(_0x3fa4c6['msg_id']){_0x299024[_0x0744('0x4d')]=_0x0744('0x4e')+_0x3fa4c6[_0x0744('0x49')]+'.wav\x22';}_0x4f65b8[_0x0744('0x1b')](_0x299024);return _0x4f65b8[_0x0744('0x26')](new Buffer(_0x3fa4c6[_0x0744('0x48')]));}})[_0x0744('0x3f')](handleError(_0x4f65b8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 39e1f72..f78eba5 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 _0xa2d4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa2d4,0x194));var _0x4a2d=function(_0x5c4bdf,_0x4b1de5){_0x5c4bdf=_0x5c4bdf-0x0;var _0x34cae2=_0xa2d4[_0x5c4bdf];return _0x34cae2;};'use strict';var _=require(_0x4a2d('0x0'));var util=require(_0x4a2d('0x1'));var logger=require(_0x4a2d('0x2'))(_0x4a2d('0x3'));var moment=require(_0x4a2d('0x4'));var BPromise=require(_0x4a2d('0x5'));var rp=require(_0x4a2d('0x6'));var fs=require('fs');var path=require(_0x4a2d('0x7'));var rimraf=require(_0x4a2d('0x8'));var config=require(_0x4a2d('0x9'));var attributes=require(_0x4a2d('0xa'));module[_0x4a2d('0xb')]=function(_0x367671,_0x4055bb){return _0x367671[_0x4a2d('0xc')](_0x4a2d('0xd'),attributes,{'tableName':_0x4a2d('0xe'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x82ef=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x82ef,0xa7));var _0xf82e=function(_0x758159,_0x418777){_0x758159=_0x758159-0x0;var _0x3a788f=_0x82ef[_0x758159];return _0x3a788f;};'use strict';var _=require('lodash');var util=require(_0xf82e('0x0'));var logger=require(_0xf82e('0x1'))(_0xf82e('0x2'));var moment=require('moment');var BPromise=require(_0xf82e('0x3'));var rp=require(_0xf82e('0x4'));var fs=require('fs');var path=require(_0xf82e('0x5'));var rimraf=require(_0xf82e('0x6'));var config=require(_0xf82e('0x7'));var attributes=require(_0xf82e('0x8'));module[_0xf82e('0x9')]=function(_0x53f102,_0x199207){return _0x53f102[_0xf82e('0xa')](_0xf82e('0xb'),attributes,{'tableName':_0xf82e('0xc'),'paranoid':![],'indexes':[{'name':_0xf82e('0xd'),'fields':[_0xf82e('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 34a93fe..ac2918e 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 _0x3b4b=['code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b5fc7,_0x3f9d04){var _0x2e711e=function(_0x9a589a){while(--_0x9a589a){_0x5b5fc7['push'](_0x5b5fc7['shift']());}};_0x2e711e(++_0x3f9d04);}(_0x3b4b,0xbc));var _0xb3b4=function(_0x425d83,_0x236601){_0x425d83=_0x425d83-0x0;var _0x344b8b=_0x3b4b[_0x425d83];return _0x344b8b;};'use strict';var _=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var moment=require('moment');var BPromise=require(_0xb3b4('0x2'));var rs=require(_0xb3b4('0x3'));var fs=require('fs');var Redis=require(_0xb3b4('0x4'));var db=require(_0xb3b4('0x5'))['db'];var utils=require(_0xb3b4('0x6'));var logger=require(_0xb3b4('0x7'))('rpc');var config=require(_0xb3b4('0x8'));var jayson=require(_0xb3b4('0x9'));var client=jayson[_0xb3b4('0xa')][_0xb3b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3291,_0x5b663e,_0x41365b){return new BPromise(function(_0x2fe46d,_0x3371cb){return client[_0xb3b4('0xc')](_0x5d3291,_0x41365b)['then'](function(_0x3ca08b){logger['info'](_0xb3b4('0xd'),_0x5b663e,_0xb3b4('0xe'));logger[_0xb3b4('0xf')](_0xb3b4('0x10'),_0x5b663e,'request\x20sent',JSON[_0xb3b4('0x11')](_0x3ca08b));if(_0x3ca08b[_0xb3b4('0x12')]){if(_0x3ca08b[_0xb3b4('0x12')][_0xb3b4('0x13')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5b663e,_0x3ca08b[_0xb3b4('0x12')][_0xb3b4('0x14')]);return _0x3371cb(_0x3ca08b[_0xb3b4('0x12')]['message']);}logger['error'](_0xb3b4('0xd'),_0x5b663e,_0x3ca08b[_0xb3b4('0x12')][_0xb3b4('0x14')]);return _0x2fe46d(_0x3ca08b[_0xb3b4('0x12')][_0xb3b4('0x14')]);}else{logger[_0xb3b4('0x15')](_0xb3b4('0xd'),_0x5b663e,_0xb3b4('0xe'));_0x2fe46d(_0x3ca08b[_0xb3b4('0x16')][_0xb3b4('0x14')]);}})['catch'](function(_0x24d9c5){logger[_0xb3b4('0x12')](_0xb3b4('0xd'),_0x5b663e,_0x24d9c5);_0x3371cb(_0x24d9c5);});});} \ No newline at end of file +var _0x94e9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3a9a8a,_0x1d4ecf){var _0x2e597f=function(_0x4d08b1){while(--_0x4d08b1){_0x3a9a8a['push'](_0x3a9a8a['shift']());}};_0x2e597f(++_0x1d4ecf);}(_0x94e9,0x103));var _0x994e=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0x94e9[_0x32f05c];return _0x4307ed;};'use strict';var _=require(_0x994e('0x0'));var util=require(_0x994e('0x1'));var moment=require(_0x994e('0x2'));var BPromise=require(_0x994e('0x3'));var rs=require(_0x994e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x994e('0x5'));var logger=require(_0x994e('0x6'))(_0x994e('0x7'));var config=require(_0x994e('0x8'));var jayson=require(_0x994e('0x9'));var client=jayson['client'][_0x994e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5064e1,_0x4810fd,_0x1d8c74){return new BPromise(function(_0x36f2df,_0x1109d6){return client['request'](_0x5064e1,_0x1d8c74)[_0x994e('0xb')](function(_0x22a935){logger['info'](_0x994e('0xc'),_0x4810fd,_0x994e('0xd'));logger[_0x994e('0xe')](_0x994e('0xf'),_0x4810fd,_0x994e('0xd'),JSON[_0x994e('0x10')](_0x22a935));if(_0x22a935['error']){if(_0x22a935[_0x994e('0x11')][_0x994e('0x12')]===0x1f4){logger[_0x994e('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x4810fd,_0x22a935[_0x994e('0x11')][_0x994e('0x13')]);return _0x1109d6(_0x22a935[_0x994e('0x11')][_0x994e('0x13')]);}logger['error'](_0x994e('0xc'),_0x4810fd,_0x22a935['error'][_0x994e('0x13')]);return _0x36f2df(_0x22a935[_0x994e('0x11')]['message']);}else{logger['info'](_0x994e('0xc'),_0x4810fd,'request\x20sent');_0x36f2df(_0x22a935[_0x994e('0x14')][_0x994e('0x13')]);}})[_0x994e('0x15')](function(_0xa2adfd){logger[_0x994e('0x11')](_0x994e('0xc'),_0x4810fd,_0xa2adfd);_0x1109d6(_0xa2adfd);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f539099..4a9dd7e 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 _0xfe83=['removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','getSounds','post','/:id/sounds','addSound','update','delete','/:id/sounds/:id2'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xfe83,0x1b2));var _0x3fe8=function(_0x232d65,_0x1bbaa9){_0x232d65=_0x232d65-0x0;var _0x2c33c2=_0xfe83[_0x232d65];return _0x2c33c2;};'use strict';var multer=require('multer');var util=require(_0x3fe8('0x0'));var path=require(_0x3fe8('0x1'));var timeout=require(_0x3fe8('0x2'));var express=require(_0x3fe8('0x3'));var router=express[_0x3fe8('0x4')]();var fs_extra=require(_0x3fe8('0x5'));var auth=require(_0x3fe8('0x6'));var interaction=require(_0x3fe8('0x7'));var config=require(_0x3fe8('0x8'));var controller=require(_0x3fe8('0x9'));router[_0x3fe8('0xa')]('/',auth[_0x3fe8('0xb')](),controller[_0x3fe8('0xc')]);router['get'](_0x3fe8('0xd'),auth[_0x3fe8('0xb')](),controller[_0x3fe8('0xe')]);router['get']('/:id/sounds',auth['isAuthenticated'](),controller[_0x3fe8('0xf')]);router[_0x3fe8('0x10')]('/',auth[_0x3fe8('0xb')](),controller['create']);router[_0x3fe8('0x10')](_0x3fe8('0x11'),auth[_0x3fe8('0xb')](),controller[_0x3fe8('0x12')]);router['put'](_0x3fe8('0xd'),auth['isAuthenticated'](),controller[_0x3fe8('0x13')]);router[_0x3fe8('0x14')]('/:id',auth[_0x3fe8('0xb')](),controller['destroy']);router[_0x3fe8('0x14')](_0x3fe8('0x15'),auth['isAuthenticated'](),controller[_0x3fe8('0x16')]);module[_0x3fe8('0x17')]=router; \ No newline at end of file +var _0xe9e2=['/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x476e56,_0x4cbcf8){var _0x3846c8=function(_0x158500){while(--_0x158500){_0x476e56['push'](_0x476e56['shift']());}};_0x3846c8(++_0x4cbcf8);}(_0xe9e2,0xff));var _0x2e9e=function(_0x5782a3,_0x2d54f3){_0x5782a3=_0x5782a3-0x0;var _0x5dcae1=_0xe9e2[_0x5782a3];return _0x5dcae1;};'use strict';var multer=require(_0x2e9e('0x0'));var util=require(_0x2e9e('0x1'));var path=require(_0x2e9e('0x2'));var timeout=require(_0x2e9e('0x3'));var express=require(_0x2e9e('0x4'));var router=express[_0x2e9e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2e9e('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x2e9e('0x7')]('/',auth[_0x2e9e('0x8')](),controller['index']);router[_0x2e9e('0x7')]('/:id',auth[_0x2e9e('0x8')](),controller['show']);router[_0x2e9e('0x7')](_0x2e9e('0x9'),auth[_0x2e9e('0x8')](),controller[_0x2e9e('0xa')]);router[_0x2e9e('0xb')]('/',auth[_0x2e9e('0x8')](),controller[_0x2e9e('0xc')]);router[_0x2e9e('0xb')](_0x2e9e('0x9'),auth[_0x2e9e('0x8')](),controller[_0x2e9e('0xd')]);router[_0x2e9e('0xe')](_0x2e9e('0xf'),auth[_0x2e9e('0x8')](),controller[_0x2e9e('0x10')]);router[_0x2e9e('0x11')](_0x2e9e('0xf'),auth[_0x2e9e('0x8')](),controller[_0x2e9e('0x12')]);router[_0x2e9e('0x11')](_0x2e9e('0x13'),auth[_0x2e9e('0x8')](),controller[_0x2e9e('0x14')]);module[_0x2e9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 461a704..cc2b407 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 _0x235a=['BOOLEAN','sequelize','exports','name','custom','files','mp3nb','mp3','STRING','alpha','TIMESTAMP'];(function(_0x2cd296,_0x2e9adf){var _0x344001=function(_0x2fecc2){while(--_0x2fecc2){_0x2cd296['push'](_0x2cd296['shift']());}};_0x344001(++_0x2e9adf);}(_0x235a,0xc7));var _0xa235=function(_0x4165e0,_0x4f41db){_0x4165e0=_0x4165e0-0x0;var _0x330dc2=_0x235a[_0x4165e0];return _0x330dc2;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa235('0x2')},'mode':{'type':Sequelize['ENUM'](_0xa235('0x3'),_0xa235('0x4'),_0xa235('0x5'),'quietmp3nb','quietmp3',_0xa235('0x6')),'allowNull':!![],'defaultValue':_0xa235('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa235('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa235('0x7')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa235('0x8')},'format':{'type':Sequelize[_0xa235('0x7')],'allowNull':!![]},'stamp':{'type':_0xa235('0x9')},'defaultEntry':{'type':Sequelize[_0xa235('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x669a=['quietmp3','mp3','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','files','mp3nb'];(function(_0x46d596,_0x1520db){var _0x1b1ad1=function(_0x32f472){while(--_0x32f472){_0x46d596['push'](_0x46d596['shift']());}};_0x1b1ad1(++_0x1520db);}(_0x669a,0x1e8));var _0xa669=function(_0x290155,_0x15ee5b){_0x290155=_0x290155-0x0;var _0x31f576=_0x669a[_0x290155];return _0x31f576;};'use strict';var Sequelize=require('sequelize');module[_0xa669('0x0')]={'name':{'type':Sequelize[_0xa669('0x1')],'allowNull':![],'unique':_0xa669('0x2')},'mode':{'type':Sequelize[_0xa669('0x3')](_0xa669('0x4'),_0xa669('0x5'),_0xa669('0x6'),'quietmp3nb',_0xa669('0x7'),_0xa669('0x8')),'allowNull':!![],'defaultValue':_0xa669('0x5')},'directory':{'type':Sequelize[_0xa669('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xa669('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa669('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xa669('0x1')],'allowNull':!![]},'stamp':{'type':_0xa669('0x9')},'defaultEntry':{'type':Sequelize[_0xa669('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 59d6f5c..78876f0 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 _0xd9c1=['name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','include','find','body','create','sequelize','transaction','mode','join','root','files','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','%s.%s','extname','save_name','server/files/moh','format','symlinkSync','removeSound','id2','createdAt','getSounds','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','MusicOnHolds','end','sendStatus','error','stack'];(function(_0x4ca2ed,_0x3f21f){var _0x14a1ae=function(_0x34beaa){while(--_0x34beaa){_0x4ca2ed['push'](_0x4ca2ed['shift']());}};_0x14a1ae(++_0x3f21f);}(_0xd9c1,0x11e));var _0x1d9c=function(_0x11f143,_0x31248c){_0x11f143=_0x11f143-0x0;var _0x21eb6e=_0xd9c1[_0x11f143];return _0x21eb6e;};'use strict';var emlformat=require(_0x1d9c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d9c('0x1'));var rp=require(_0x1d9c('0x2'));var moment=require(_0x1d9c('0x3'));var BPromise=require(_0x1d9c('0x4'));var Mustache=require(_0x1d9c('0x5'));var util=require('util');var path=require(_0x1d9c('0x6'));var sox=require(_0x1d9c('0x7'));var csv=require(_0x1d9c('0x8'));var ejs=require(_0x1d9c('0x9'));var fs=require('fs');var fs_extra=require(_0x1d9c('0xa'));var _=require(_0x1d9c('0xb'));var squel=require(_0x1d9c('0xc'));var crypto=require(_0x1d9c('0xd'));var jsforce=require(_0x1d9c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d9c('0xf'));var Papa=require(_0x1d9c('0x10'));var Redis=require(_0x1d9c('0x11'));var authService=require(_0x1d9c('0x12'));var qs=require(_0x1d9c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d9c('0x14'))('api');var utils=require(_0x1d9c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c3ced,_0x4d8cdc){_0x4d8cdc=_0x4d8cdc||0xcc;return function(_0x5f0d4f){if(_0x5f0d4f){return _0x5c3ced['sendStatus'](_0x4d8cdc);}return _0x5c3ced['status'](_0x4d8cdc)['end']();};}function respondWithResult(_0xd276ba,_0x1a7658){_0x1a7658=_0x1a7658||0xc8;return function(_0x868fb7){if(_0x868fb7){return _0xd276ba[_0x1d9c('0x16')](_0x1a7658)[_0x1d9c('0x17')](_0x868fb7);}};}function respondWithFilteredResult(_0x46c60d,_0x33d449){return function(_0x3deb49){if(_0x3deb49){var _0x28cc03=typeof _0x33d449[_0x1d9c('0x18')]===_0x1d9c('0x19')&&typeof _0x33d449[_0x1d9c('0x1a')]==='undefined';var _0x3fa380=_0x3deb49[_0x1d9c('0x1b')];var _0x51d876=_0x28cc03?0x0:_0x33d449[_0x1d9c('0x18')];var _0x2f7435=_0x28cc03?_0x3deb49[_0x1d9c('0x1b')]:_0x33d449[_0x1d9c('0x18')]+_0x33d449[_0x1d9c('0x1a')];var _0x564d46;if(_0x2f7435>=_0x3fa380){_0x2f7435=_0x3fa380;_0x564d46=0xc8;}else{_0x564d46=0xce;}_0x46c60d['status'](_0x564d46);return _0x46c60d['set'](_0x1d9c('0x1c'),_0x51d876+'-'+_0x2f7435+'/'+_0x3fa380)['json'](_0x3deb49);}return null;};}function patchUpdates(_0x690c42){return function(_0x323499){try{jsonpatch[_0x1d9c('0x1d')](_0x323499,_0x690c42,!![]);}catch(_0xaa94f8){return BPromise[_0x1d9c('0x1e')](_0xaa94f8);}return _0x323499[_0x1d9c('0x1f')]();};}function saveUpdates(_0xe9acb9,_0x50b7b4){return function(_0x4901be){if(_0x4901be){return _0x4901be[_0x1d9c('0x20')](_0xe9acb9)['then'](function(_0x2f8ed4){return _0x2f8ed4;});}return null;};}function removeEntity(_0x4d8417,_0x755a5){return function(_0x3b5170){if(_0x3b5170){return _0x3b5170[_0x1d9c('0x21')]()[_0x1d9c('0x22')](function(){var _0x5588f1=_0x3b5170[_0x1d9c('0x23')]({'plain':!![]});var _0xf83a0a=_0x1d9c('0x24');return db['UserProfileResource'][_0x1d9c('0x21')]({'where':{'type':_0xf83a0a,'resourceId':_0x5588f1['id']}})[_0x1d9c('0x22')](function(){return _0x3b5170;});})[_0x1d9c('0x22')](function(){_0x4d8417[_0x1d9c('0x16')](0xcc)[_0x1d9c('0x25')]();});}};}function handleEntityNotFound(_0x52fffb,_0x3fe68d){return function(_0x32a998){if(!_0x32a998){_0x52fffb[_0x1d9c('0x26')](0x194);}return _0x32a998;};}function handleError(_0x5184c9,_0x21699e){_0x21699e=_0x21699e||0x1f4;return function(_0x58f245){logger[_0x1d9c('0x27')](_0x58f245[_0x1d9c('0x28')]);if(_0x58f245[_0x1d9c('0x29')]){delete _0x58f245['name'];}_0x5184c9[_0x1d9c('0x16')](_0x21699e)[_0x1d9c('0x2a')](_0x58f245);};}exports[_0x1d9c('0x2b')]=function(_0x3596b8,_0x178805){var _0x31840a={},_0x5845bf={},_0x33fee6={'count':0x0,'rows':[]};var _0x3a0796=_[_0x1d9c('0x2c')](db[_0x1d9c('0x2d')][_0x1d9c('0x2e')],function(_0x58ac53){return{'name':_0x58ac53[_0x1d9c('0x2f')],'type':_0x58ac53[_0x1d9c('0x30')][_0x1d9c('0x31')]};});_0x5845bf[_0x1d9c('0x32')]=_['map'](_0x3a0796,_0x1d9c('0x29'));_0x5845bf[_0x1d9c('0x33')]=_['keys'](_0x3596b8[_0x1d9c('0x33')]);_0x5845bf[_0x1d9c('0x34')]=_['intersection'](_0x5845bf[_0x1d9c('0x32')],_0x5845bf[_0x1d9c('0x33')]);_0x31840a['attributes']=_[_0x1d9c('0x35')](_0x5845bf['model'],qs[_0x1d9c('0x36')](_0x3596b8[_0x1d9c('0x33')][_0x1d9c('0x36')]));_0x31840a['attributes']=_0x31840a[_0x1d9c('0x37')][_0x1d9c('0x38')]?_0x31840a[_0x1d9c('0x37')]:_0x5845bf[_0x1d9c('0x32')];if(!_0x3596b8['query'][_0x1d9c('0x39')]('nolimit')){_0x31840a[_0x1d9c('0x1a')]=qs[_0x1d9c('0x1a')](_0x3596b8[_0x1d9c('0x33')]['limit']);_0x31840a[_0x1d9c('0x18')]=qs[_0x1d9c('0x18')](_0x3596b8[_0x1d9c('0x33')][_0x1d9c('0x18')]);}_0x31840a[_0x1d9c('0x3a')]=qs[_0x1d9c('0x3b')](_0x3596b8[_0x1d9c('0x33')]['sort']);delete _0x3596b8['query'][_0x1d9c('0x3b')];_0x31840a[_0x1d9c('0x3c')]=qs['filters'](_[_0x1d9c('0x3d')](_0x3596b8[_0x1d9c('0x33')],_0x5845bf[_0x1d9c('0x34')]),_0x3a0796);if(_0x3596b8['query'][_0x1d9c('0x3e')]){_0x31840a[_0x1d9c('0x3c')]=_[_0x1d9c('0x3f')](_0x31840a['where'],{'$or':_[_0x1d9c('0x2c')](_0x3a0796,function(_0x508a20){if(_0x508a20[_0x1d9c('0x30')]!==_0x1d9c('0x40')){var _0x2cba31={};_0x2cba31[_0x508a20['name']]={'$like':'%'+_0x3596b8[_0x1d9c('0x33')]['filter']+'%'};return _0x2cba31;}})});}_0x31840a=_['merge']({},_0x31840a,_0x3596b8[_0x1d9c('0x41')]);var _0x2ff2f={'where':_0x31840a[_0x1d9c('0x3c')]};return db['VoiceMusicOnHold'][_0x1d9c('0x1b')](_0x2ff2f)[_0x1d9c('0x22')](function(_0xfe8224){_0x33fee6[_0x1d9c('0x1b')]=_0xfe8224;if(_0x3596b8[_0x1d9c('0x33')]['includeAll']){_0x31840a['include']=[{'all':!![]}];}return db[_0x1d9c('0x2d')][_0x1d9c('0x42')](_0x31840a);})['then'](function(_0x358442){_0x33fee6['rows']=_0x358442;return _0x33fee6;})[_0x1d9c('0x22')](respondWithFilteredResult(_0x178805,_0x31840a))[_0x1d9c('0x43')](handleError(_0x178805,null));};exports[_0x1d9c('0x44')]=function(_0x84bf54,_0x4ab2ef){var _0x3150bd={'raw':![],'where':{'id':_0x84bf54[_0x1d9c('0x45')]['id']}},_0x502e72={};_0x502e72[_0x1d9c('0x32')]=_[_0x1d9c('0x46')](db['VoiceMusicOnHold']['rawAttributes']);_0x502e72[_0x1d9c('0x33')]=_['keys'](_0x84bf54['query']);_0x502e72[_0x1d9c('0x34')]=_[_0x1d9c('0x35')](_0x502e72[_0x1d9c('0x32')],_0x502e72['query']);_0x3150bd['attributes']=_[_0x1d9c('0x35')](_0x502e72[_0x1d9c('0x32')],qs[_0x1d9c('0x36')](_0x84bf54[_0x1d9c('0x33')][_0x1d9c('0x36')]));_0x3150bd[_0x1d9c('0x37')]=_0x3150bd[_0x1d9c('0x37')][_0x1d9c('0x38')]?_0x3150bd[_0x1d9c('0x37')]:_0x502e72['model'];if(_0x84bf54[_0x1d9c('0x33')]['includeAll']){_0x3150bd[_0x1d9c('0x47')]=[{'all':!![]}];}_0x3150bd=_[_0x1d9c('0x3f')]({},_0x3150bd,_0x84bf54[_0x1d9c('0x41')]);return db[_0x1d9c('0x2d')][_0x1d9c('0x48')](_0x3150bd)[_0x1d9c('0x22')](handleEntityNotFound(_0x4ab2ef,null))[_0x1d9c('0x22')](respondWithResult(_0x4ab2ef,null))['catch'](handleError(_0x4ab2ef,null));};exports[_0x1d9c('0x20')]=function(_0x5eefdd,_0x41c04a){if(_0x5eefdd[_0x1d9c('0x49')]['id']){delete _0x5eefdd['body']['id'];}return db[_0x1d9c('0x2d')][_0x1d9c('0x48')]({'where':{'id':_0x5eefdd[_0x1d9c('0x45')]['id']}})[_0x1d9c('0x22')](handleEntityNotFound(_0x41c04a,null))['then'](saveUpdates(_0x5eefdd[_0x1d9c('0x49')],null))[_0x1d9c('0x22')](respondWithResult(_0x41c04a,null))[_0x1d9c('0x43')](handleError(_0x41c04a,null));};exports[_0x1d9c('0x4a')]=function(_0x285bf4,_0x3e5535,_0x3290c7){return db[_0x1d9c('0x4b')][_0x1d9c('0x4c')](function(_0x3a63a8){if(_0x285bf4['body'][_0x1d9c('0x4d')]==='files'){_0x285bf4['body']['directory']=path[_0x1d9c('0x4e')](config[_0x1d9c('0x4f')],'server/files/moh',_0x285bf4[_0x1d9c('0x49')][_0x1d9c('0x29')]);}return db[_0x1d9c('0x2d')][_0x1d9c('0x4a')](_0x285bf4[_0x1d9c('0x49')],{'transaction':_0x3a63a8})['then'](function(_0x3d7a64){if(_0x285bf4[_0x1d9c('0x49')][_0x1d9c('0x4d')]===_0x1d9c('0x50')){fs[_0x1d9c('0x51')](_0x3d7a64[_0x1d9c('0x52')],parseInt('0777',0x8));}var _0x42efcb=_0x285bf4[_0x1d9c('0x53')][_0x1d9c('0x23')]({'plain':!![]});if(!_0x42efcb)throw new Error(_0x1d9c('0x54'));if(_0x42efcb[_0x1d9c('0x55')]===_0x1d9c('0x53')){var _0x5974e0=_0x3d7a64[_0x1d9c('0x23')]({'plain':!![]});return db[_0x1d9c('0x56')][_0x1d9c('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x42efcb['userProfileId']},'raw':!![]})['then'](function(_0x43440f){if(_0x43440f&&_0x43440f[_0x1d9c('0x57')]===0x0){return db[_0x1d9c('0x58')][_0x1d9c('0x4a')]({'name':_0x5974e0['name'],'resourceId':_0x5974e0['id'],'type':_0x43440f['name'],'sectionId':_0x43440f['id']},{})['then'](function(){return _0x3d7a64;});}else{return _0x3d7a64;}})[_0x1d9c('0x43')](function(_0x5ea208){logger['error'](_0x1d9c('0x59'),_0x5ea208);});}return _0x3d7a64;});})[_0x1d9c('0x22')](respondWithResult(_0x3e5535,0xc9))[_0x1d9c('0x43')](handleError(_0x3e5535,null));};exports[_0x1d9c('0x21')]=function(_0x28c6fd,_0x3356c9,_0x145560){var _0x681d2c;return db[_0x1d9c('0x2d')][_0x1d9c('0x48')]({'where':{'id':_0x28c6fd[_0x1d9c('0x45')]['id']}})[_0x1d9c('0x22')](function(_0x510718){if(_0x510718){return db['sequelize'][_0x1d9c('0x4c')](function(_0x29035d){return _0x510718[_0x1d9c('0x21')]({'transaction':_0x29035d,'raw':!![]})[_0x1d9c('0x22')](function(_0x1ae869){if(_0x1ae869['directory']){fs['readdirSync'](_0x1ae869['directory'])[_0x1d9c('0x5a')](function(_0x35d28b){fs[_0x1d9c('0x5b')](path[_0x1d9c('0x4e')](_0x1ae869[_0x1d9c('0x52')],_0x35d28b));});fs['rmdirSync'](_0x1ae869['directory']);}return _0x1ae869;});})[_0x1d9c('0x43')](function(_0x1b6b43){throw new db[(_0x1d9c('0x5c'))][(_0x1d9c('0x5d'))](_0x1b6b43[_0x1d9c('0x5e')]);});}})[_0x1d9c('0x22')](handleEntityNotFound(_0x3356c9,null))['then'](removeEntity(_0x3356c9,null))[_0x1d9c('0x43')](handleError(_0x3356c9,null));};exports[_0x1d9c('0x5f')]=function(_0x3c1bd0,_0x34ca39,_0x4f9270){return db[_0x1d9c('0x4b')][_0x1d9c('0x4c')](function(_0x332021){var _0x239553;return db[_0x1d9c('0x2d')][_0x1d9c('0x48')]({'where':{'id':_0x3c1bd0[_0x1d9c('0x45')]['id']}})[_0x1d9c('0x22')](function(_0x41e6a6){if(_0x41e6a6){_0x239553=_0x41e6a6;return _0x41e6a6[_0x1d9c('0x5f')](_0x3c1bd0[_0x1d9c('0x49')]['id'],{'transaction':_0x332021});}})['then'](function(_0x44f866){if(_0x44f866){return db[_0x1d9c('0x60')][_0x1d9c('0x61')]({'where':{'id':_0x3c1bd0['body']['id']},'attributes':['id',_0x1d9c('0x29'),'save_name',_0x1d9c('0x62'),'createdAt'],'raw':!![]});}})[_0x1d9c('0x22')](function(_0xb853ec){if(_0xb853ec){var _0x5cc44d=path['join'](config[_0x1d9c('0x4f')],'server/files/sounds/converted',util['format'](_0x1d9c('0x63'),path['basename'](_0xb853ec['save_name'],path[_0x1d9c('0x64')](_0xb853ec[_0x1d9c('0x65')])),_0xb853ec[_0x1d9c('0x62')]));var _0x4e98a8=path['join'](config[_0x1d9c('0x4f')],_0x1d9c('0x66'),_0x239553[_0x1d9c('0x29')],util[_0x1d9c('0x67')](_0x1d9c('0x63'),_0xb853ec['name'],_0xb853ec['converted_format']));fs[_0x1d9c('0x68')](_0x5cc44d,_0x4e98a8);return _0xb853ec;}})[_0x1d9c('0x43')](function(_0x158b04){throw new db[(_0x1d9c('0x5c'))][(_0x1d9c('0x5d'))](_0x158b04[_0x1d9c('0x5e')]);});})[_0x1d9c('0x22')](handleEntityNotFound(_0x34ca39,null))['then'](respondWithResult(_0x34ca39,0xc9))['catch'](handleError(_0x34ca39,null));};exports[_0x1d9c('0x69')]=function(_0x50c2ae,_0x5a4107,_0x1850ff){return db[_0x1d9c('0x4b')]['transaction'](function(_0x4bafd5){var _0x4f40db;return db[_0x1d9c('0x2d')][_0x1d9c('0x61')]({'where':{'id':_0x50c2ae[_0x1d9c('0x45')]['id']}})[_0x1d9c('0x22')](handleEntityNotFound(_0x5a4107,null))['then'](function(_0x27678d){if(_0x27678d){_0x4f40db=_0x27678d;return _0x27678d[_0x1d9c('0x69')](_0x50c2ae[_0x1d9c('0x45')][_0x1d9c('0x6a')]);}})['then'](function(_0x1cefee){if(_0x1cefee){return db[_0x1d9c('0x60')][_0x1d9c('0x61')]({'where':{'id':_0x50c2ae['params'][_0x1d9c('0x6a')]},'attributes':['id',_0x1d9c('0x29'),'save_name',_0x1d9c('0x62'),_0x1d9c('0x6b')],'raw':!![]});}})[_0x1d9c('0x22')](function(_0x43f58f){if(_0x43f58f){fs[_0x1d9c('0x5b')](path[_0x1d9c('0x4e')](_0x4f40db['directory'],util[_0x1d9c('0x67')]('%s.%s',_0x43f58f[_0x1d9c('0x29')],_0x43f58f[_0x1d9c('0x62')])));return _0x43f58f;}})[_0x1d9c('0x43')](function(_0x548795){throw new db[(_0x1d9c('0x5c'))][(_0x1d9c('0x5d'))](_0x548795['message']);});})[_0x1d9c('0x22')](handleEntityNotFound(_0x5a4107,null))[_0x1d9c('0x22')](respondWithStatusCode(_0x5a4107,0xcc))[_0x1d9c('0x43')](handleError(_0x5a4107,null));};exports[_0x1d9c('0x6c')]=function(_0x1e2cee,_0x4b5dfa,_0x2d8ff0){var _0x505f07={};var _0xfddf21={};var _0x5634af;var _0x4bcb4f;return db[_0x1d9c('0x2d')][_0x1d9c('0x61')]({'where':{'id':_0x1e2cee[_0x1d9c('0x45')]['id']}})[_0x1d9c('0x22')](handleEntityNotFound(_0x4b5dfa,null))[_0x1d9c('0x22')](function(_0x1b81f0){if(_0x1b81f0){_0x5634af=_0x1b81f0;_0xfddf21[_0x1d9c('0x32')]=_['keys'](db[_0x1d9c('0x60')][_0x1d9c('0x2e')]);_0xfddf21['query']=_[_0x1d9c('0x46')](_0x1e2cee[_0x1d9c('0x33')]);_0xfddf21[_0x1d9c('0x34')]=_['intersection'](_0xfddf21[_0x1d9c('0x32')],_0xfddf21[_0x1d9c('0x33')]);_0x505f07['attributes']=_[_0x1d9c('0x35')](_0xfddf21[_0x1d9c('0x32')],qs['fields'](_0x1e2cee[_0x1d9c('0x33')][_0x1d9c('0x36')]));_0x505f07[_0x1d9c('0x37')]=_0x505f07[_0x1d9c('0x37')][_0x1d9c('0x38')]?_0x505f07['attributes']:_0xfddf21[_0x1d9c('0x32')];_0x505f07[_0x1d9c('0x3a')]=qs[_0x1d9c('0x3b')](_0x1e2cee[_0x1d9c('0x33')][_0x1d9c('0x3b')]);_0x505f07['where']=qs['filters'](_[_0x1d9c('0x3d')](_0x1e2cee[_0x1d9c('0x33')],_0xfddf21[_0x1d9c('0x34')]));if(_0x1e2cee[_0x1d9c('0x33')][_0x1d9c('0x3e')]){_0x505f07[_0x1d9c('0x3c')]=_[_0x1d9c('0x3f')](_0x505f07['where'],{'$or':_[_0x1d9c('0x2c')](_0x505f07['attributes'],function(_0x464387){var _0x4a7bae={};_0x4a7bae[_0x464387]={'$like':'%'+_0x1e2cee[_0x1d9c('0x33')][_0x1d9c('0x3e')]+'%'};return _0x4a7bae;})});}_0x505f07=_[_0x1d9c('0x3f')]({},_0x505f07,_0x1e2cee[_0x1d9c('0x41')]);return _0x5634af['getSounds'](_0x505f07);}})[_0x1d9c('0x22')](function(_0x4c111f){if(_0x4c111f){_0x4bcb4f=_0x4c111f['length'];if(!_0x1e2cee['query'][_0x1d9c('0x39')]('nolimit')){_0x505f07[_0x1d9c('0x1a')]=qs[_0x1d9c('0x1a')](_0x1e2cee['query']['limit']);_0x505f07[_0x1d9c('0x18')]=qs[_0x1d9c('0x18')](_0x1e2cee[_0x1d9c('0x33')][_0x1d9c('0x18')]);}return _0x5634af['getSounds'](_0x505f07);}})['then'](function(_0x500893){if(_0x500893){return _0x500893?{'count':_0x4bcb4f,'rows':_0x500893}:null;}})[_0x1d9c('0x22')](respondWithResult(_0x4b5dfa,null))[_0x1d9c('0x43')](handleError(_0x4b5dfa,null));}; \ No newline at end of file +var _0x7328=['moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','MusicOnHolds','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','VoiceMusicOnHold','includeAll','findAll','rows','catch','show','params','include','find','body','files','directory','join','root','server/files/moh','create','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','transaction','readdirSync','forEach','unlinkSync','ValidationError','message','addSound','findOne','converted_format','createdAt','format','%s.%s','basename','extname','save_name','Sequelize','sequelize','removeSound','id2','Sound','pick','getSounds','eml-format','rimraf','zip-dir','request-promise'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x7328,0xe0));var _0x8732=function(_0x4af1a4,_0x5d77ca){_0x4af1a4=_0x4af1a4-0x0;var _0x6210ec=_0x7328[_0x4af1a4];return _0x6210ec;};'use strict';var emlformat=require(_0x8732('0x0'));var rimraf=require(_0x8732('0x1'));var zipdir=require(_0x8732('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8732('0x3'));var moment=require(_0x8732('0x4'));var BPromise=require(_0x8732('0x5'));var Mustache=require(_0x8732('0x6'));var util=require(_0x8732('0x7'));var path=require('path');var sox=require(_0x8732('0x8'));var csv=require(_0x8732('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8732('0xa'));var _=require(_0x8732('0xb'));var squel=require(_0x8732('0xc'));var crypto=require(_0x8732('0xd'));var jsforce=require(_0x8732('0xe'));var deskjs=require(_0x8732('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8732('0x10'));var Redis=require('ioredis');var authService=require(_0x8732('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8732('0x12'));var hardwareService=require(_0x8732('0x13'));var logger=require(_0x8732('0x14'))(_0x8732('0x15'));var utils=require(_0x8732('0x16'));var config=require(_0x8732('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403065,_0x26c004){_0x26c004=_0x26c004||0xcc;return function(_0x2e9d64){if(_0x2e9d64){return _0x403065[_0x8732('0x18')](_0x26c004);}return _0x403065[_0x8732('0x19')](_0x26c004)[_0x8732('0x1a')]();};}function respondWithResult(_0x4e1b49,_0x32d55f){_0x32d55f=_0x32d55f||0xc8;return function(_0x527848){if(_0x527848){return _0x4e1b49[_0x8732('0x19')](_0x32d55f)[_0x8732('0x1b')](_0x527848);}};}function respondWithFilteredResult(_0x867d47,_0x511f28){return function(_0x14f780){if(_0x14f780){var _0x25a702=typeof _0x511f28[_0x8732('0x1c')]===_0x8732('0x1d')&&typeof _0x511f28[_0x8732('0x1e')]===_0x8732('0x1d');var _0x5882a3=_0x14f780[_0x8732('0x1f')];var _0x112552=_0x25a702?0x0:_0x511f28[_0x8732('0x1c')];var _0x1c7a92=_0x25a702?_0x14f780[_0x8732('0x1f')]:_0x511f28[_0x8732('0x1c')]+_0x511f28[_0x8732('0x1e')];var _0x2f9e54;if(_0x1c7a92>=_0x5882a3){_0x1c7a92=_0x5882a3;_0x2f9e54=0xc8;}else{_0x2f9e54=0xce;}_0x867d47[_0x8732('0x19')](_0x2f9e54);return _0x867d47[_0x8732('0x20')](_0x8732('0x21'),_0x112552+'-'+_0x1c7a92+'/'+_0x5882a3)[_0x8732('0x1b')](_0x14f780);}return null;};}function patchUpdates(_0x34ca5e){return function(_0x10f365){try{jsonpatch[_0x8732('0x22')](_0x10f365,_0x34ca5e,!![]);}catch(_0x2609a){return BPromise[_0x8732('0x23')](_0x2609a);}return _0x10f365['save']();};}function saveUpdates(_0x6e4b6a,_0xccbb6f){return function(_0x6b0349){if(_0x6b0349){return _0x6b0349[_0x8732('0x24')](_0x6e4b6a)[_0x8732('0x25')](function(_0x23720d){return _0x23720d;});}return null;};}function removeEntity(_0x17dd9c,_0x253f30){return function(_0x3c6bfc){if(_0x3c6bfc){return _0x3c6bfc['destroy']()[_0x8732('0x25')](function(){var _0x2744b5=_0x3c6bfc[_0x8732('0x26')]({'plain':!![]});var _0x583097=_0x8732('0x27');return db['UserProfileResource'][_0x8732('0x28')]({'where':{'type':_0x583097,'resourceId':_0x2744b5['id']}})[_0x8732('0x25')](function(){return _0x3c6bfc;});})[_0x8732('0x25')](function(){_0x17dd9c[_0x8732('0x19')](0xcc)[_0x8732('0x1a')]();});}};}function handleEntityNotFound(_0x1459d2,_0x53114e){return function(_0x1374b9){if(!_0x1374b9){_0x1459d2['sendStatus'](0x194);}return _0x1374b9;};}function handleError(_0x31d484,_0x17db2f){_0x17db2f=_0x17db2f||0x1f4;return function(_0x42e530){logger[_0x8732('0x29')](_0x42e530[_0x8732('0x2a')]);if(_0x42e530[_0x8732('0x2b')]){delete _0x42e530['name'];}_0x31d484[_0x8732('0x19')](_0x17db2f)['send'](_0x42e530);};}exports[_0x8732('0x2c')]=function(_0x34a464,_0x2f5546){var _0x23b37a={},_0x1ec2a1={},_0x6bf36b={'count':0x0,'rows':[]};var _0x4762bc=_[_0x8732('0x2d')](db['VoiceMusicOnHold'][_0x8732('0x2e')],function(_0x12ea75){return{'name':_0x12ea75[_0x8732('0x2f')],'type':_0x12ea75['type']['key']};});_0x1ec2a1[_0x8732('0x30')]=_['map'](_0x4762bc,_0x8732('0x2b'));_0x1ec2a1[_0x8732('0x31')]=_[_0x8732('0x32')](_0x34a464[_0x8732('0x31')]);_0x1ec2a1[_0x8732('0x33')]=_['intersection'](_0x1ec2a1['model'],_0x1ec2a1[_0x8732('0x31')]);_0x23b37a[_0x8732('0x34')]=_[_0x8732('0x35')](_0x1ec2a1['model'],qs[_0x8732('0x36')](_0x34a464[_0x8732('0x31')][_0x8732('0x36')]));_0x23b37a[_0x8732('0x34')]=_0x23b37a['attributes'][_0x8732('0x37')]?_0x23b37a[_0x8732('0x34')]:_0x1ec2a1[_0x8732('0x30')];if(!_0x34a464[_0x8732('0x31')][_0x8732('0x38')](_0x8732('0x39'))){_0x23b37a[_0x8732('0x1e')]=qs[_0x8732('0x1e')](_0x34a464[_0x8732('0x31')][_0x8732('0x1e')]);_0x23b37a[_0x8732('0x1c')]=qs[_0x8732('0x1c')](_0x34a464[_0x8732('0x31')][_0x8732('0x1c')]);}_0x23b37a[_0x8732('0x3a')]=qs['sort'](_0x34a464['query'][_0x8732('0x3b')]);delete _0x34a464['query'][_0x8732('0x3b')];_0x23b37a[_0x8732('0x3c')]=qs[_0x8732('0x33')](_['pick'](_0x34a464[_0x8732('0x31')],_0x1ec2a1[_0x8732('0x33')]),_0x4762bc);if(_0x34a464[_0x8732('0x31')][_0x8732('0x3d')]){_0x23b37a[_0x8732('0x3c')]=_[_0x8732('0x3e')](_0x23b37a[_0x8732('0x3c')],{'$or':_[_0x8732('0x2d')](_0x4762bc,function(_0x2c18c2){if(_0x2c18c2[_0x8732('0x3f')]!==_0x8732('0x40')){var _0x35bc43={};_0x35bc43[_0x2c18c2[_0x8732('0x2b')]]={'$like':'%'+_0x34a464[_0x8732('0x31')][_0x8732('0x3d')]+'%'};return _0x35bc43;}})});}_0x23b37a=_[_0x8732('0x3e')]({},_0x23b37a,_0x34a464[_0x8732('0x41')]);var _0x550f49={'where':_0x23b37a['where']};return db[_0x8732('0x42')][_0x8732('0x1f')](_0x550f49)[_0x8732('0x25')](function(_0x109841){_0x6bf36b[_0x8732('0x1f')]=_0x109841;if(_0x34a464[_0x8732('0x31')][_0x8732('0x43')]){_0x23b37a['include']=[{'all':!![]}];}return db[_0x8732('0x42')][_0x8732('0x44')](_0x23b37a);})[_0x8732('0x25')](function(_0x37c3db){_0x6bf36b[_0x8732('0x45')]=_0x37c3db;return _0x6bf36b;})['then'](respondWithFilteredResult(_0x2f5546,_0x23b37a))[_0x8732('0x46')](handleError(_0x2f5546,null));};exports[_0x8732('0x47')]=function(_0x53acdf,_0x3669de){var _0x2a0b4c={'raw':![],'where':{'id':_0x53acdf[_0x8732('0x48')]['id']}},_0x156eab={};_0x156eab[_0x8732('0x30')]=_[_0x8732('0x32')](db['VoiceMusicOnHold'][_0x8732('0x2e')]);_0x156eab[_0x8732('0x31')]=_['keys'](_0x53acdf[_0x8732('0x31')]);_0x156eab[_0x8732('0x33')]=_[_0x8732('0x35')](_0x156eab[_0x8732('0x30')],_0x156eab['query']);_0x2a0b4c['attributes']=_[_0x8732('0x35')](_0x156eab[_0x8732('0x30')],qs[_0x8732('0x36')](_0x53acdf[_0x8732('0x31')][_0x8732('0x36')]));_0x2a0b4c[_0x8732('0x34')]=_0x2a0b4c['attributes'][_0x8732('0x37')]?_0x2a0b4c[_0x8732('0x34')]:_0x156eab[_0x8732('0x30')];if(_0x53acdf['query']['includeAll']){_0x2a0b4c[_0x8732('0x49')]=[{'all':!![]}];}_0x2a0b4c=_[_0x8732('0x3e')]({},_0x2a0b4c,_0x53acdf[_0x8732('0x41')]);return db['VoiceMusicOnHold'][_0x8732('0x4a')](_0x2a0b4c)[_0x8732('0x25')](handleEntityNotFound(_0x3669de,null))[_0x8732('0x25')](respondWithResult(_0x3669de,null))[_0x8732('0x46')](handleError(_0x3669de,null));};exports[_0x8732('0x24')]=function(_0x385fc8,_0x51145f){if(_0x385fc8['body']['id']){delete _0x385fc8[_0x8732('0x4b')]['id'];}return db[_0x8732('0x42')]['find']({'where':{'id':_0x385fc8[_0x8732('0x48')]['id']}})[_0x8732('0x25')](handleEntityNotFound(_0x51145f,null))[_0x8732('0x25')](saveUpdates(_0x385fc8[_0x8732('0x4b')],null))[_0x8732('0x25')](respondWithResult(_0x51145f,null))[_0x8732('0x46')](handleError(_0x51145f,null));};exports['create']=function(_0x3c00ae,_0x16bf96,_0x369b2f){return db['sequelize']['transaction'](function(_0x583ce5){if(_0x3c00ae['body']['mode']===_0x8732('0x4c')){_0x3c00ae[_0x8732('0x4b')][_0x8732('0x4d')]=path[_0x8732('0x4e')](config[_0x8732('0x4f')],_0x8732('0x50'),_0x3c00ae[_0x8732('0x4b')][_0x8732('0x2b')]);}return db['VoiceMusicOnHold'][_0x8732('0x51')](_0x3c00ae['body'],{'transaction':_0x583ce5})[_0x8732('0x25')](function(_0x3c7cd4){if(_0x3c00ae['body'][_0x8732('0x52')]===_0x8732('0x4c')){fs[_0x8732('0x53')](_0x3c7cd4['directory'],parseInt(_0x8732('0x54'),0x8));}var _0x3fcd8b=_0x3c00ae['user'][_0x8732('0x26')]({'plain':!![]});if(!_0x3fcd8b)throw new Error(_0x8732('0x55'));if(_0x3fcd8b[_0x8732('0x56')]===_0x8732('0x57')){var _0x3430b3=_0x3c7cd4[_0x8732('0x26')]({'plain':!![]});return db[_0x8732('0x58')][_0x8732('0x4a')]({'where':{'name':_0x8732('0x27'),'userProfileId':_0x3fcd8b[_0x8732('0x59')]},'raw':!![]})[_0x8732('0x25')](function(_0x4532be){if(_0x4532be&&_0x4532be[_0x8732('0x5a')]===0x0){return db[_0x8732('0x5b')][_0x8732('0x51')]({'name':_0x3430b3[_0x8732('0x2b')],'resourceId':_0x3430b3['id'],'type':_0x4532be[_0x8732('0x2b')],'sectionId':_0x4532be['id']},{})[_0x8732('0x25')](function(){return _0x3c7cd4;});}else{return _0x3c7cd4;}})['catch'](function(_0x54ab1a){logger[_0x8732('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54ab1a);});}return _0x3c7cd4;});})['then'](respondWithResult(_0x16bf96,0xc9))[_0x8732('0x46')](handleError(_0x16bf96,null));};exports[_0x8732('0x28')]=function(_0x20c9c3,_0x2b0bf5,_0x33f23a){var _0x48ed47;return db[_0x8732('0x42')][_0x8732('0x4a')]({'where':{'id':_0x20c9c3[_0x8732('0x48')]['id']}})[_0x8732('0x25')](function(_0x6620e1){if(_0x6620e1){return db['sequelize'][_0x8732('0x5c')](function(_0x3a83a7){return _0x6620e1[_0x8732('0x28')]({'transaction':_0x3a83a7,'raw':!![]})[_0x8732('0x25')](function(_0x35b081){if(_0x35b081[_0x8732('0x4d')]){fs[_0x8732('0x5d')](_0x35b081[_0x8732('0x4d')])[_0x8732('0x5e')](function(_0x2cc033){fs[_0x8732('0x5f')](path[_0x8732('0x4e')](_0x35b081[_0x8732('0x4d')],_0x2cc033));});fs['rmdirSync'](_0x35b081[_0x8732('0x4d')]);}return _0x35b081;});})[_0x8732('0x46')](function(_0x4c5979){throw new db['Sequelize'][(_0x8732('0x60'))](_0x4c5979[_0x8732('0x61')]);});}})['then'](handleEntityNotFound(_0x2b0bf5,null))[_0x8732('0x25')](removeEntity(_0x2b0bf5,null))['catch'](handleError(_0x2b0bf5,null));};exports[_0x8732('0x62')]=function(_0x46dbb9,_0x5ca5ac,_0x2fbbdd){return db['sequelize'][_0x8732('0x5c')](function(_0x3ea843){var _0x3464e;return db[_0x8732('0x42')][_0x8732('0x4a')]({'where':{'id':_0x46dbb9[_0x8732('0x48')]['id']}})['then'](function(_0x5d153c){if(_0x5d153c){_0x3464e=_0x5d153c;return _0x5d153c[_0x8732('0x62')](_0x46dbb9['body']['id'],{'transaction':_0x3ea843});}})['then'](function(_0x3862ca){if(_0x3862ca){return db['Sound'][_0x8732('0x63')]({'where':{'id':_0x46dbb9[_0x8732('0x4b')]['id']},'attributes':['id',_0x8732('0x2b'),'save_name',_0x8732('0x64'),_0x8732('0x65')],'raw':!![]});}})[_0x8732('0x25')](function(_0x515c7d){if(_0x515c7d){var _0x2705ee=path[_0x8732('0x4e')](config[_0x8732('0x4f')],'server/files/sounds/converted',util[_0x8732('0x66')](_0x8732('0x67'),path[_0x8732('0x68')](_0x515c7d['save_name'],path[_0x8732('0x69')](_0x515c7d[_0x8732('0x6a')])),_0x515c7d[_0x8732('0x64')]));var _0x19cd94=path['join'](config[_0x8732('0x4f')],_0x8732('0x50'),_0x3464e['name'],util[_0x8732('0x66')](_0x8732('0x67'),_0x515c7d[_0x8732('0x2b')],_0x515c7d[_0x8732('0x64')]));fs['symlinkSync'](_0x2705ee,_0x19cd94);return _0x515c7d;}})[_0x8732('0x46')](function(_0x145889){throw new db[(_0x8732('0x6b'))][(_0x8732('0x60'))](_0x145889[_0x8732('0x61')]);});})[_0x8732('0x25')](handleEntityNotFound(_0x5ca5ac,null))[_0x8732('0x25')](respondWithResult(_0x5ca5ac,0xc9))[_0x8732('0x46')](handleError(_0x5ca5ac,null));};exports['removeSound']=function(_0x34e7bb,_0x49b548,_0x370e86){return db[_0x8732('0x6c')][_0x8732('0x5c')](function(_0x3eafb6){var _0x5aef43;return db[_0x8732('0x42')]['findOne']({'where':{'id':_0x34e7bb[_0x8732('0x48')]['id']}})[_0x8732('0x25')](handleEntityNotFound(_0x49b548,null))[_0x8732('0x25')](function(_0xb32e47){if(_0xb32e47){_0x5aef43=_0xb32e47;return _0xb32e47[_0x8732('0x6d')](_0x34e7bb[_0x8732('0x48')][_0x8732('0x6e')]);}})['then'](function(_0x1f8359){if(_0x1f8359){return db[_0x8732('0x6f')]['findOne']({'where':{'id':_0x34e7bb['params'][_0x8732('0x6e')]},'attributes':['id',_0x8732('0x2b'),_0x8732('0x6a'),_0x8732('0x64'),'createdAt'],'raw':!![]});}})[_0x8732('0x25')](function(_0x58f91e){if(_0x58f91e){fs[_0x8732('0x5f')](path[_0x8732('0x4e')](_0x5aef43[_0x8732('0x4d')],util[_0x8732('0x66')]('%s.%s',_0x58f91e['name'],_0x58f91e[_0x8732('0x64')])));return _0x58f91e;}})[_0x8732('0x46')](function(_0x5c9789){throw new db[(_0x8732('0x6b'))]['ValidationError'](_0x5c9789[_0x8732('0x61')]);});})['then'](handleEntityNotFound(_0x49b548,null))[_0x8732('0x25')](respondWithStatusCode(_0x49b548,0xcc))[_0x8732('0x46')](handleError(_0x49b548,null));};exports['getSounds']=function(_0x2509c4,_0x16c935,_0x4cf0e8){var _0x444ff4={};var _0x32d3ef={};var _0x5a5c9f;var _0xf12b32;return db[_0x8732('0x42')]['findOne']({'where':{'id':_0x2509c4[_0x8732('0x48')]['id']}})[_0x8732('0x25')](handleEntityNotFound(_0x16c935,null))[_0x8732('0x25')](function(_0x3e1519){if(_0x3e1519){_0x5a5c9f=_0x3e1519;_0x32d3ef['model']=_[_0x8732('0x32')](db[_0x8732('0x6f')][_0x8732('0x2e')]);_0x32d3ef['query']=_[_0x8732('0x32')](_0x2509c4[_0x8732('0x31')]);_0x32d3ef['filters']=_['intersection'](_0x32d3ef['model'],_0x32d3ef[_0x8732('0x31')]);_0x444ff4['attributes']=_[_0x8732('0x35')](_0x32d3ef[_0x8732('0x30')],qs[_0x8732('0x36')](_0x2509c4[_0x8732('0x31')]['fields']));_0x444ff4['attributes']=_0x444ff4[_0x8732('0x34')][_0x8732('0x37')]?_0x444ff4[_0x8732('0x34')]:_0x32d3ef['model'];_0x444ff4[_0x8732('0x3a')]=qs[_0x8732('0x3b')](_0x2509c4[_0x8732('0x31')][_0x8732('0x3b')]);_0x444ff4[_0x8732('0x3c')]=qs[_0x8732('0x33')](_[_0x8732('0x70')](_0x2509c4[_0x8732('0x31')],_0x32d3ef[_0x8732('0x33')]));if(_0x2509c4['query']['filter']){_0x444ff4[_0x8732('0x3c')]=_[_0x8732('0x3e')](_0x444ff4[_0x8732('0x3c')],{'$or':_[_0x8732('0x2d')](_0x444ff4['attributes'],function(_0x58ee80){var _0x2ffe4b={};_0x2ffe4b[_0x58ee80]={'$like':'%'+_0x2509c4[_0x8732('0x31')][_0x8732('0x3d')]+'%'};return _0x2ffe4b;})});}_0x444ff4=_[_0x8732('0x3e')]({},_0x444ff4,_0x2509c4['options']);return _0x5a5c9f[_0x8732('0x71')](_0x444ff4);}})[_0x8732('0x25')](function(_0x500998){if(_0x500998){_0xf12b32=_0x500998['length'];if(!_0x2509c4[_0x8732('0x31')]['hasOwnProperty'](_0x8732('0x39'))){_0x444ff4['limit']=qs[_0x8732('0x1e')](_0x2509c4[_0x8732('0x31')]['limit']);_0x444ff4[_0x8732('0x1c')]=qs[_0x8732('0x1c')](_0x2509c4[_0x8732('0x31')]['offset']);}return _0x5a5c9f['getSounds'](_0x444ff4);}})[_0x8732('0x25')](function(_0x32a759){if(_0x32a759){return _0x32a759?{'count':_0xf12b32,'rows':_0x32a759}:null;}})[_0x8732('0x25')](respondWithResult(_0x16c935,null))[_0x8732('0x46')](handleError(_0x16c935,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 34116cd..e3711c0 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 _0xe2fd=['rimraf','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xb4e9b0,_0x111908){var _0x5eac9b=function(_0x207b6b){while(--_0x207b6b){_0xb4e9b0['push'](_0xb4e9b0['shift']());}};_0x5eac9b(++_0x111908);}(_0xe2fd,0x149));var _0xde2f=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xe2fd[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xde2f('0x0'));var util=require(_0xde2f('0x1'));var logger=require(_0xde2f('0x2'))(_0xde2f('0x3'));var moment=require(_0xde2f('0x4'));var BPromise=require(_0xde2f('0x5'));var rp=require(_0xde2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde2f('0x7'));var config=require('../../config/environment');var attributes=require(_0xde2f('0x8'));module[_0xde2f('0x9')]=function(_0x20fc5b,_0x3f4be8){return _0x20fc5b[_0xde2f('0xa')](_0xde2f('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0159=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x24ac5b,_0xcd7b51){var _0x4c5a5d=function(_0x548125){while(--_0x548125){_0x24ac5b['push'](_0x24ac5b['shift']());}};_0x4c5a5d(++_0xcd7b51);}(_0x0159,0x141));var _0x9015=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0159[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9015('0x0'));var util=require(_0x9015('0x1'));var logger=require(_0x9015('0x2'))(_0x9015('0x3'));var moment=require(_0x9015('0x4'));var BPromise=require(_0x9015('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9015('0x6'));var rimraf=require(_0x9015('0x7'));var config=require(_0x9015('0x8'));var attributes=require(_0x9015('0x9'));module[_0x9015('0xa')]=function(_0x4e94d2,_0x372fe6){return _0x4e94d2[_0x9015('0xb')](_0x9015('0xc'),attributes,{'tableName':_0x9015('0xd'),'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 01701ce..30888dc 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x2afb18,_0x46bfd3){var _0x391cea=function(_0x87d5eb){while(--_0x87d5eb){_0x2afb18['push'](_0x2afb18['shift']());}};_0x391cea(++_0x46bfd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x32b068,_0x232fde){var _0x1c40d3=function(_0x103f49){while(--_0x103f49){_0x32b068['push'](_0x32b068['shift']());}};_0x1c40d3(++_0x232fde);}(_0xe706,0xa3));var _0x6e70=function(_0x36de53,_0x4a0679){_0x36de53=_0x36de53-0x0;var _0x2b04cb=_0xe706[_0x36de53];return _0x2b04cb;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index b77dcb7..604341b 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 _0xc688=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','/describe','/:id','show','/:id/users','isAuthenticated','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams','update','delete','removeTeams','exports'];(function(_0xdaa456,_0x3dbbe5){var _0x288a4a=function(_0x4e4d5d){while(--_0x4e4d5d){_0xdaa456['push'](_0xdaa456['shift']());}};_0x288a4a(++_0x3dbbe5);}(_0xc688,0xc0));var _0x8c68=function(_0x241e61,_0x51e5ea){_0x241e61=_0x241e61-0x0;var _0x409de4=_0xc688[_0x241e61];return _0x409de4;};'use strict';var multer=require(_0x8c68('0x0'));var util=require(_0x8c68('0x1'));var path=require('path');var timeout=require(_0x8c68('0x2'));var express=require(_0x8c68('0x3'));var router=express['Router']();var fs_extra=require(_0x8c68('0x4'));var auth=require(_0x8c68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c68('0x6'));var controller=require('./voicePrefix.controller');router[_0x8c68('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8c68('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x8c68('0x7')](_0x8c68('0x9'),auth['isAuthenticated'](),controller[_0x8c68('0xa')]);router['get'](_0x8c68('0xb'),auth[_0x8c68('0xc')](),controller[_0x8c68('0xd')]);router[_0x8c68('0x7')]('/:id/teams',auth[_0x8c68('0xc')](),controller[_0x8c68('0xe')]);router[_0x8c68('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c68('0x10')]);router[_0x8c68('0xf')](_0x8c68('0xb'),auth[_0x8c68('0xc')](),controller[_0x8c68('0x11')]);router[_0x8c68('0xf')](_0x8c68('0x12'),auth[_0x8c68('0xc')](),controller[_0x8c68('0x13')]);router['put'](_0x8c68('0x9'),auth['isAuthenticated'](),controller[_0x8c68('0x14')]);router['delete']('/:id',auth[_0x8c68('0xc')](),controller['destroy']);router[_0x8c68('0x15')](_0x8c68('0xb'),auth[_0x8c68('0xc')](),controller['removeAgents']);router['delete'](_0x8c68('0x12'),auth['isAuthenticated'](),controller[_0x8c68('0x16')]);module[_0x8c68('0x17')]=router; \ No newline at end of file +var _0xe384=['/:id','isAuthenticated','getAgents','/:id/teams','getTeams','create','post','addAgents','put','update','delete','destroy','/:id/users','removeAgents','removeTeams','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe384,0x160));var _0x4e38=function(_0x438a33,_0x44905e){_0x438a33=_0x438a33-0x0;var _0x39a0ec=_0xe384[_0x438a33];return _0x39a0ec;};'use strict';var multer=require(_0x4e38('0x0'));var util=require('util');var path=require(_0x4e38('0x1'));var timeout=require(_0x4e38('0x2'));var express=require(_0x4e38('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4e38('0x4'));var interaction=require(_0x4e38('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x4e38('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4e38('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x4e38('0x7')]);router[_0x4e38('0x6')](_0x4e38('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x4e38('0x6')]('/:id/users',auth[_0x4e38('0x9')](),controller[_0x4e38('0xa')]);router[_0x4e38('0x6')](_0x4e38('0xb'),auth[_0x4e38('0x9')](),controller[_0x4e38('0xc')]);router['post']('/',auth[_0x4e38('0x9')](),controller[_0x4e38('0xd')]);router[_0x4e38('0xe')]('/:id/users',auth[_0x4e38('0x9')](),controller[_0x4e38('0xf')]);router['post'](_0x4e38('0xb'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4e38('0x10')](_0x4e38('0x8'),auth['isAuthenticated'](),controller[_0x4e38('0x11')]);router[_0x4e38('0x12')](_0x4e38('0x8'),auth['isAuthenticated'](),controller[_0x4e38('0x13')]);router[_0x4e38('0x12')](_0x4e38('0x14'),auth[_0x4e38('0x9')](),controller[_0x4e38('0x15')]);router['delete'](_0x4e38('0xb'),auth[_0x4e38('0x9')](),controller[_0x4e38('0x16')]);module[_0x4e38('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index de772f9..e8a5ebf 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 _0xc586=['exports','STRING','name','VIRTUAL','system-','INTEGER','sequelize'];(function(_0x16793e,_0x57e8c6){var _0x1d4cf6=function(_0xe01412){while(--_0xe01412){_0x16793e['push'](_0x16793e['shift']());}};_0x1d4cf6(++_0x57e8c6);}(_0xc586,0x1a3));var _0x6c58=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xc586[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require(_0x6c58('0x0'));module[_0x6c58('0x1')]={'name':{'type':Sequelize[_0x6c58('0x2')],'allowNull':![],'unique':_0x6c58('0x3')},'prefix':{'type':Sequelize[_0x6c58('0x4')],'get':function(_0x4f7ade){return _0x6c58('0x5')+this['getDataValue'](_0x6c58('0x3'))+'-';}},'description':{'type':Sequelize[_0x6c58('0x2')]},'callerIdAll':{'type':Sequelize[_0x6c58('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x6c58('0x6')]}}; \ No newline at end of file +var _0xd17c=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x19df8e,_0xc8482){var _0x378598=function(_0x24f1d0){while(--_0x24f1d0){_0x19df8e['push'](_0x19df8e['shift']());}};_0x378598(++_0xc8482);}(_0xd17c,0x76));var _0xcd17=function(_0x682dbd,_0x1f3ed6){_0x682dbd=_0x682dbd-0x0;var _0x758f76=_0xd17c[_0x682dbd];return _0x758f76;};'use strict';var Sequelize=require(_0xcd17('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd17('0x1')],'allowNull':![],'unique':_0xcd17('0x2')},'prefix':{'type':Sequelize[_0xcd17('0x3')],'get':function(_0x6568d1){return _0xcd17('0x4')+this[_0xcd17('0x5')](_0xcd17('0x2'))+'-';}},'description':{'type':Sequelize[_0xcd17('0x1')]},'callerIdAll':{'type':Sequelize[_0xcd17('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xcd17('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2cb474a..cd07048 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 _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8603,0x190));var _0x3860=function(_0x372791,_0x37c573){_0x372791=_0x372791-0x0;var _0x19c83c=_0x8603[_0x372791];return _0x19c83c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file +var _0xb62e=['all','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','nolimit','getTeams','Team','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','SELECT','every','TeamId','includes'];(function(_0x3013cb,_0x4a907c){var _0x2b07ea=function(_0x5a0835){while(--_0x5a0835){_0x3013cb['push'](_0x3013cb['shift']());}};_0x2b07ea(++_0x4a907c);}(_0xb62e,0x1de));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xeb62('0x0'));var rimraf=require(_0xeb62('0x1'));var zipdir=require(_0xeb62('0x2'));var jsonpatch=require(_0xeb62('0x3'));var rp=require('request-promise');var moment=require(_0xeb62('0x4'));var BPromise=require(_0xeb62('0x5'));var Mustache=require(_0xeb62('0x6'));var util=require(_0xeb62('0x7'));var path=require(_0xeb62('0x8'));var sox=require(_0xeb62('0x9'));var csv=require('to-csv');var ejs=require(_0xeb62('0xa'));var fs=require('fs');var fs_extra=require(_0xeb62('0xb'));var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb62('0x11'));var authService=require(_0xeb62('0x12'));var qs=require(_0xeb62('0x13'));var as=require(_0xeb62('0x14'));var hardwareService=require(_0xeb62('0x15'));var logger=require(_0xeb62('0x16'))(_0xeb62('0x17'));var utils=require(_0xeb62('0x18'));var config=require(_0xeb62('0x19'));var licenseUtil=require(_0xeb62('0x1a'));var db=require('../../mysqldb')['db'];config[_0xeb62('0x1b')]=_[_0xeb62('0x1c')](config[_0xeb62('0x1b')],{'host':_0xeb62('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb62('0x1b')]));require(_0xeb62('0x1e'))[_0xeb62('0x1f')](socket);function respondWithStatusCode(_0x4da178,_0x26c3fd){_0x26c3fd=_0x26c3fd||0xcc;return function(_0x195837){if(_0x195837){return _0x4da178[_0xeb62('0x20')](_0x26c3fd);}return _0x4da178['status'](_0x26c3fd)[_0xeb62('0x21')]();};}function respondWithResult(_0x15b3e8,_0x184106){_0x184106=_0x184106||0xc8;return function(_0x353e2c){if(_0x353e2c){return _0x15b3e8[_0xeb62('0x22')](_0x184106)[_0xeb62('0x23')](_0x353e2c);}};}function respondWithFilteredResult(_0x1fb460,_0x1324d7){return function(_0x39b138){if(_0x39b138){var _0x27fd84=typeof _0x1324d7[_0xeb62('0x24')]===_0xeb62('0x25')&&typeof _0x1324d7[_0xeb62('0x26')]==='undefined';var _0x38c5e4=_0x39b138[_0xeb62('0x27')];var _0x332396=_0x27fd84?0x0:_0x1324d7[_0xeb62('0x24')];var _0x425817=_0x27fd84?_0x39b138[_0xeb62('0x27')]:_0x1324d7[_0xeb62('0x24')]+_0x1324d7['limit'];var _0x599d0b;if(_0x425817>=_0x38c5e4){_0x425817=_0x38c5e4;_0x599d0b=0xc8;}else{_0x599d0b=0xce;}_0x1fb460[_0xeb62('0x22')](_0x599d0b);return _0x1fb460[_0xeb62('0x28')](_0xeb62('0x29'),_0x332396+'-'+_0x425817+'/'+_0x38c5e4)[_0xeb62('0x23')](_0x39b138);}return null;};}function patchUpdates(_0x122b15){return function(_0x4cafcf){try{jsonpatch['apply'](_0x4cafcf,_0x122b15,!![]);}catch(_0x4664ce){return BPromise[_0xeb62('0x2a')](_0x4664ce);}return _0x4cafcf[_0xeb62('0x2b')]();};}function saveUpdates(_0x395b70,_0x55a169){return function(_0x4e92f5){if(_0x4e92f5){return _0x4e92f5[_0xeb62('0x2c')](_0x395b70)['then'](function(_0x448327){return _0x448327;});}return null;};}function removeEntity(_0x4b0f46,_0xfe3e16){return function(_0x516a72){if(_0x516a72){return _0x516a72[_0xeb62('0x2d')]()[_0xeb62('0x2e')](function(){var _0x46d1bb=_0x516a72['get']({'plain':!![]});var _0x3ef784=_0xeb62('0x2f');return db[_0xeb62('0x30')][_0xeb62('0x2d')]({'where':{'type':_0x3ef784,'resourceId':_0x46d1bb['id']}})[_0xeb62('0x2e')](function(){return _0x516a72;});})[_0xeb62('0x2e')](function(){_0x4b0f46['status'](0xcc)[_0xeb62('0x21')]();});}};}function handleEntityNotFound(_0x1616ee,_0x57169a){return function(_0x157474){if(!_0x157474){_0x1616ee[_0xeb62('0x20')](0x194);}return _0x157474;};}function handleError(_0x2c967c,_0x2c308c){_0x2c308c=_0x2c308c||0x1f4;return function(_0x235448){logger['error'](_0x235448['stack']);if(_0x235448[_0xeb62('0x31')]){delete _0x235448[_0xeb62('0x31')];}_0x2c967c[_0xeb62('0x22')](_0x2c308c)[_0xeb62('0x32')](_0x235448);};}exports[_0xeb62('0x33')]=function(_0x2ad3ec,_0x1ae51e){var _0x4be25d={},_0x411062={},_0x47a94b={'count':0x0,'rows':[]};var _0x555db1=_[_0xeb62('0x34')](db[_0xeb62('0x35')]['rawAttributes'],function(_0x1ade38){return{'name':_0x1ade38['fieldName'],'type':_0x1ade38[_0xeb62('0x36')][_0xeb62('0x37')]};});_0x411062['model']=_[_0xeb62('0x34')](_0x555db1,_0xeb62('0x31'));_0x411062['query']=_[_0xeb62('0x38')](_0x2ad3ec[_0xeb62('0x39')]);_0x411062[_0xeb62('0x3a')]=_[_0xeb62('0x3b')](_0x411062['model'],_0x411062[_0xeb62('0x39')]);_0x4be25d[_0xeb62('0x3c')]=_['intersection'](_0x411062['model'],qs[_0xeb62('0x3d')](_0x2ad3ec[_0xeb62('0x39')]['fields']));_0x4be25d[_0xeb62('0x3c')]=_0x4be25d[_0xeb62('0x3c')][_0xeb62('0x3e')]?_0x4be25d[_0xeb62('0x3c')]:_0x411062[_0xeb62('0x3f')];if(!_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x40')]('nolimit')){_0x4be25d['limit']=qs[_0xeb62('0x26')](_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x26')]);_0x4be25d[_0xeb62('0x24')]=qs['offset'](_0x2ad3ec[_0xeb62('0x39')]['offset']);}_0x4be25d[_0xeb62('0x41')]=qs[_0xeb62('0x42')](_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x42')]);_0x4be25d[_0xeb62('0x43')]=qs[_0xeb62('0x3a')](_[_0xeb62('0x44')](_0x2ad3ec[_0xeb62('0x39')],_0x411062['filters']),_0x555db1);if(_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x45')]){_0x4be25d[_0xeb62('0x43')]=_[_0xeb62('0x46')](_0x4be25d['where'],{'$or':_['map'](_0x555db1,function(_0x46a560){if(_0x46a560[_0xeb62('0x36')]!=='VIRTUAL'){var _0x1f7036={};_0x1f7036[_0x46a560[_0xeb62('0x31')]]={'$like':'%'+_0x2ad3ec['query'][_0xeb62('0x45')]+'%'};return _0x1f7036;}})});}_0x4be25d=_['merge']({},_0x4be25d,_0x2ad3ec[_0xeb62('0x47')]);var _0x47b815={'where':_0x4be25d[_0xeb62('0x43')]};return db['VoicePrefix'][_0xeb62('0x27')](_0x47b815)[_0xeb62('0x2e')](function(_0x317f50){_0x47a94b['count']=_0x317f50;if(_0x2ad3ec['query'][_0xeb62('0x48')]){_0x4be25d[_0xeb62('0x49')]=[{'all':!![]}];}return db[_0xeb62('0x35')][_0xeb62('0x4a')](_0x4be25d);})[_0xeb62('0x2e')](function(_0x4afd5e){_0x47a94b[_0xeb62('0x4b')]=_0x4afd5e;return _0x47a94b;})['then'](respondWithFilteredResult(_0x1ae51e,_0x4be25d))[_0xeb62('0x4c')](handleError(_0x1ae51e,null));};exports['show']=function(_0xeeced2,_0x4d2f80){var _0x26c77d={'raw':![],'where':{'id':_0xeeced2[_0xeb62('0x4d')]['id']}},_0x4dbcac={};_0x4dbcac[_0xeb62('0x3f')]=_[_0xeb62('0x38')](db[_0xeb62('0x35')][_0xeb62('0x4e')]);_0x4dbcac[_0xeb62('0x39')]=_['keys'](_0xeeced2[_0xeb62('0x39')]);_0x4dbcac[_0xeb62('0x3a')]=_['intersection'](_0x4dbcac['model'],_0x4dbcac['query']);_0x26c77d['attributes']=_[_0xeb62('0x3b')](_0x4dbcac[_0xeb62('0x3f')],qs['fields'](_0xeeced2[_0xeb62('0x39')][_0xeb62('0x3d')]));_0x26c77d[_0xeb62('0x3c')]=_0x26c77d[_0xeb62('0x3c')][_0xeb62('0x3e')]?_0x26c77d['attributes']:_0x4dbcac[_0xeb62('0x3f')];if(_0xeeced2['query'][_0xeb62('0x48')]){_0x26c77d[_0xeb62('0x49')]=[{'all':!![]}];}_0x26c77d=_[_0xeb62('0x46')]({},_0x26c77d,_0xeeced2[_0xeb62('0x47')]);return db[_0xeb62('0x35')][_0xeb62('0x4f')](_0x26c77d)[_0xeb62('0x2e')](handleEntityNotFound(_0x4d2f80,null))[_0xeb62('0x2e')](respondWithResult(_0x4d2f80,null))[_0xeb62('0x4c')](handleError(_0x4d2f80,null));};exports[_0xeb62('0x2d')]=function(_0xe13846,_0x13e102){return db['VoicePrefix'][_0xeb62('0x4f')]({'where':{'id':_0xe13846['params']['id']}})['then'](handleEntityNotFound(_0x13e102,null))[_0xeb62('0x2e')](removeEntity(_0x13e102,null))[_0xeb62('0x4c')](handleError(_0x13e102,null));};exports['describe']=function(_0x373505,_0x462760){return db['VoicePrefix'][_0xeb62('0x50')]()[_0xeb62('0x2e')](respondWithResult(_0x462760,null))[_0xeb62('0x4c')](handleError(_0x462760,null));};exports[_0xeb62('0x51')]=function(_0xe71e83,_0x1e6238){var _0x351027;return db[_0xeb62('0x52')]['transaction'](function(_0x3e2be9){return db['VoicePrefix'][_0xeb62('0x51')](_0xe71e83[_0xeb62('0x53')],{'transaction':_0x3e2be9})[_0xeb62('0x2e')](function(_0x289af0){_0x351027=_0x289af0[_0xeb62('0x54')]({'plain':!![]});return db[_0xeb62('0x55')][_0xeb62('0x4f')]({'where':{'id':_0x351027[_0xeb62('0x56')]},'raw':!![]})['then'](function(_0x4d31a1){return createVoicePrefixExtensions(_0x351027,_0x4d31a1,_0x3e2be9);});});})['then'](function(){var _0x5033eb=_0xe71e83[_0xeb62('0x57')]['get']({'plain':!![]});if(!_0x5033eb)throw new Error(_0xeb62('0x58'));if(_0x5033eb['role']===_0xeb62('0x57')){var _0x342768=_0x351027;return db[_0xeb62('0x59')]['find']({'where':{'name':_0xeb62('0x2f'),'userProfileId':_0x5033eb[_0xeb62('0x5a')]},'raw':!![]})['then'](function(_0x35982a){if(_0x35982a&&_0x35982a[_0xeb62('0x5b')]===0x0){return db[_0xeb62('0x30')][_0xeb62('0x51')]({'name':_0x342768['name'],'resourceId':_0x342768['id'],'type':_0x35982a[_0xeb62('0x31')],'sectionId':_0x35982a['id']},{})[_0xeb62('0x2e')](function(){return _0x351027;});}else{return _0x351027;}})['catch'](function(_0x2eba52){logger[_0xeb62('0x5c')](_0xeb62('0x5d'),_0x2eba52);throw _0x2eba52;});}return _0x351027;})[_0xeb62('0x2e')](respondWithResult(_0x1e6238,null))[_0xeb62('0x4c')](handleError(_0x1e6238,null));};function Extension(_0x46da69,_0x3e55bf,_0x1b354d,_0x222d0c){this[_0xeb62('0x5e')]=_0xeb62('0x5f');this[_0xeb62('0x60')]=_0x46da69;this[_0xeb62('0x61')]=_0x1b354d;this[_0xeb62('0x36')]=_0xeb62('0x62');this[_0xeb62('0x63')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3e55bf;this['appdata']=_0x222d0c;}function createVoicePrefixExtensions(_0x5b28ec,_0x279b83,_0x5f363d){return new BPromise(function(_0x10cc40,_0x136d81){var _0x5b8c4=new Extension(formatPrefixName(_0x5b28ec[_0xeb62('0x64')]),0x1,_0xeb62('0x65'),_0xeb62('0x66'));_0x5b8c4[_0xeb62('0x67')]=_0x5b28ec['id'];return db[_0xeb62('0x55')][_0xeb62('0x51')](_0x5b8c4,{'transaction':_0x5f363d})[_0xeb62('0x2e')](function(_0x52dfbd){var _0x113302=_0x52dfbd[_0xeb62('0x54')]({'plain':!![]});var _0x42e992=_[_0xeb62('0x34')](addVoicePrefixExtensions(_0x5b28ec,_0x279b83),function(_0x4aba1f){_0x4aba1f[_0xeb62('0x56')]=_0x113302['id'];_0x4aba1f[_0xeb62('0x67')]=_0x5b28ec['id'];return _0x4aba1f;});return db[_0xeb62('0x55')][_0xeb62('0x68')](_0x42e992,{'transaction':_0x5f363d})[_0xeb62('0x2e')](function(_0x1679a7){if(!_0x1679a7){return _0x136d81(_0xeb62('0x69'));}else{return _0x10cc40(_0x1679a7);}})[_0xeb62('0x4c')](function(_0x2e1fb8){return _0x136d81(_0x2e1fb8);});});;});};function addVoicePrefixExtensions(_0x2b788e,_0x1d8675){var _0x510275=[];var _0x110224=formatPrefixName(_0x2b788e[_0xeb62('0x64')]);_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x2,_0xeb62('0x6b'),_0xeb62('0x6c')+_0x2b788e[_0xeb62('0x31')]));if(_0x2b788e[_0xeb62('0x6d')]){_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x3,_0xeb62('0x6b'),_0xeb62('0x6e')+_0x2b788e['callerIdAll']));}else{_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x3,_0xeb62('0x65'),_0xeb62('0x6f')));}_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x4,'goto',_0x1d8675[_0xeb62('0x5e')]+','+_0xeb62('0x70')+(0x8+_0x2b788e[_0xeb62('0x31')][_0xeb62('0x3e')])+'}'+','+0x1));return _0x510275;}function formatPrefixName(_0xc81d4c){var _0x32642f='_';for(var _0x48488c=0x0;_0x48488c<_0xc81d4c[_0xeb62('0x3e')];_0x48488c++){if(_0xc81d4c[_0xeb62('0x71')](_0x48488c)=='-'){_0x32642f+=_0xc81d4c[_0xeb62('0x71')](_0x48488c);}else{_0x32642f+='['+_0xc81d4c[_0xeb62('0x71')](_0x48488c)+']';}}_0x32642f+='.';return _0x32642f;}exports[_0xeb62('0x2c')]=function(_0x28d0ff,_0x2e4502,_0x313d33){var _0x233715=_0x28d0ff[_0xeb62('0x53')];_0x233715[_0xeb62('0x64')]=_0xeb62('0x72')+_0x233715[_0xeb62('0x31')]+'-';return db[_0xeb62('0x52')][_0xeb62('0x73')](function(_0x2bbbff){return db['VoicePrefix'][_0xeb62('0x2c')](_0x233715,{'where':{'id':_0x233715['id']},'transaction':_0x2bbbff})['then'](function(){return db[_0xeb62('0x55')][_0xeb62('0x2d')]({'where':{'VoicePrefixId':_0x233715['id']},'transaction':_0x2bbbff})['then'](function(){return db[_0xeb62('0x55')][_0xeb62('0x4f')]({'where':{'id':_0x233715[_0xeb62('0x56')]},'raw':!![]})[_0xeb62('0x2e')](function(_0x206e77){return createVoicePrefixExtensions(_0x233715,_0x206e77,_0x2bbbff);});});});})[_0xeb62('0x2e')](function(){return db[_0xeb62('0x35')][_0xeb62('0x74')](_0x233715['id']);})[_0xeb62('0x2e')](respondWithResult(_0x2e4502,null))[_0xeb62('0x4c')](handleError(_0x2e4502,null));};exports[_0xeb62('0x75')]=function(_0x146174,_0x910940,_0x4c6b69){return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x146174['params']['id']}})[_0xeb62('0x2e')](handleEntityNotFound(_0x910940,null))['then'](function(_0x32679a){if(_0x32679a){return _0x32679a[_0xeb62('0x75')](_0x146174[_0xeb62('0x53')][_0xeb62('0x76')],_[_0xeb62('0x77')](_0x146174[_0xeb62('0x53')],['ids','id'])||{})[_0xeb62('0x78')](function(_0x4fc07f){for(var _0x42ee4d=0x0;_0x42ee4d<_0x146174[_0xeb62('0x53')][_0xeb62('0x76')][_0xeb62('0x3e')];_0x42ee4d+=0x1){socket[_0xeb62('0x79')]('userVoicePrefix:save',{'UserId':Number(_0x146174[_0xeb62('0x53')][_0xeb62('0x76')][_0x42ee4d]),'VoicePrefixId':Number(_0x146174[_0xeb62('0x4d')]['id'])});}return _0x4fc07f;});}})['then'](respondWithResult(_0x910940,null))[_0xeb62('0x4c')](handleError(_0x910940,null));};exports[_0xeb62('0x7a')]=function(_0x8a8ef3,_0x7ca547,_0x16c28d){return db[_0xeb62('0x35')]['find']({'where':{'id':_0x8a8ef3['params']['id']}})['then'](handleEntityNotFound(_0x7ca547,null))['then'](function(_0x5bf6f6){if(_0x5bf6f6){return _0x5bf6f6[_0xeb62('0x7a')](_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')])[_0xeb62('0x2e')](function(){if(_[_0xeb62('0x7b')](_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')])){for(var _0x1c01ae=0x0;_0x1c01ae<_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')][_0xeb62('0x3e')];_0x1c01ae+=0x1){socket[_0xeb62('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')][_0x1c01ae]),'VoicePrefixId':Number(_0x8a8ef3[_0xeb62('0x4d')]['id'])});}}else{socket[_0xeb62('0x79')](_0xeb62('0x7c'),{'UserId':Number(_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')]),'VoicePrefixId':Number(_0x8a8ef3[_0xeb62('0x4d')]['id'])});}});}})[_0xeb62('0x2e')](respondWithStatusCode(_0x7ca547,null))[_0xeb62('0x4c')](handleError(_0x7ca547,null));};exports[_0xeb62('0x7d')]=function(_0x17beef,_0x45b2a3,_0x42c384){var _0xfff29b={};var _0x1cbfab={};var _0x29648f;var _0x2f5f2f;return db['VoicePrefix'][_0xeb62('0x7e')]({'where':{'id':_0x17beef['params']['id']}})[_0xeb62('0x2e')](handleEntityNotFound(_0x45b2a3,null))[_0xeb62('0x2e')](function(_0x48dcf6){if(_0x48dcf6){_0x29648f=_0x48dcf6;_0x1cbfab[_0xeb62('0x3f')]=_['keys'](db['User'][_0xeb62('0x4e')]);_0x1cbfab[_0xeb62('0x39')]=_[_0xeb62('0x38')](_0x17beef[_0xeb62('0x39')]);_0x1cbfab['filters']=_[_0xeb62('0x3b')](_0x1cbfab[_0xeb62('0x3f')],_0x1cbfab['query']);_0xfff29b[_0xeb62('0x3c')]=_[_0xeb62('0x3b')](_0x1cbfab[_0xeb62('0x3f')],qs[_0xeb62('0x3d')](_0x17beef[_0xeb62('0x39')][_0xeb62('0x3d')]));_0xfff29b[_0xeb62('0x3c')]=_0xfff29b[_0xeb62('0x3c')]['length']?_0xfff29b[_0xeb62('0x3c')]:_0x1cbfab[_0xeb62('0x3f')];_0xfff29b['order']=qs[_0xeb62('0x42')](_0x17beef['query']['sort']);_0xfff29b[_0xeb62('0x43')]=qs[_0xeb62('0x3a')](_[_0xeb62('0x44')](_0x17beef[_0xeb62('0x39')],_0x1cbfab[_0xeb62('0x3a')]));if(_0x17beef['query'][_0xeb62('0x45')]){_0xfff29b[_0xeb62('0x43')]=_[_0xeb62('0x46')](_0xfff29b[_0xeb62('0x43')],{'$or':_[_0xeb62('0x34')](_0xfff29b[_0xeb62('0x3c')],function(_0x401ad1){var _0x50170b={};_0x50170b[_0x401ad1]={'$like':'%'+_0x17beef['query']['filter']+'%'};return _0x50170b;})});}_0xfff29b=_[_0xeb62('0x46')]({},_0xfff29b,_0x17beef[_0xeb62('0x47')]);return _0x29648f[_0xeb62('0x7d')](_0xfff29b);}})[_0xeb62('0x2e')](function(_0x599418){if(_0x599418){_0x2f5f2f=_0x599418[_0xeb62('0x3e')];if(!_0x17beef['query']['hasOwnProperty'](_0xeb62('0x7f'))){_0xfff29b[_0xeb62('0x26')]=qs['limit'](_0x17beef[_0xeb62('0x39')]['limit']);_0xfff29b[_0xeb62('0x24')]=qs[_0xeb62('0x24')](_0x17beef[_0xeb62('0x39')]['offset']);}return _0x29648f['getAgents'](_0xfff29b);}})[_0xeb62('0x2e')](function(_0x276e06){if(_0x276e06){return _0x276e06?{'count':_0x2f5f2f,'rows':_0x276e06}:null;}})[_0xeb62('0x2e')](respondWithResult(_0x45b2a3,null))['catch'](handleError(_0x45b2a3,null));};exports[_0xeb62('0x80')]=function(_0x162993,_0x3f5c93,_0x3b15ec){var _0xca3f0e={};var _0x2e4d99={};var _0x518655;var _0x4cd599;return db['VoicePrefix'][_0xeb62('0x7e')]({'where':{'id':_0x162993['params']['id']}})['then'](handleEntityNotFound(_0x3f5c93,null))[_0xeb62('0x2e')](function(_0x49d2c7){if(_0x49d2c7){_0x518655=_0x49d2c7;_0x2e4d99['model']=_['keys'](db[_0xeb62('0x81')]['rawAttributes']);_0x2e4d99[_0xeb62('0x39')]=_[_0xeb62('0x38')](_0x162993[_0xeb62('0x39')]);_0x2e4d99[_0xeb62('0x3a')]=_[_0xeb62('0x3b')](_0x2e4d99[_0xeb62('0x3f')],_0x2e4d99[_0xeb62('0x39')]);_0xca3f0e['attributes']=_['intersection'](_0x2e4d99[_0xeb62('0x3f')],qs[_0xeb62('0x3d')](_0x162993[_0xeb62('0x39')][_0xeb62('0x3d')]));_0xca3f0e[_0xeb62('0x3c')]=_0xca3f0e['attributes'][_0xeb62('0x3e')]?_0xca3f0e[_0xeb62('0x3c')]:_0x2e4d99[_0xeb62('0x3f')];_0xca3f0e['order']=qs[_0xeb62('0x42')](_0x162993['query'][_0xeb62('0x42')]);_0xca3f0e[_0xeb62('0x43')]=qs['filters'](_['pick'](_0x162993[_0xeb62('0x39')],_0x2e4d99[_0xeb62('0x3a')]));if(_0x162993[_0xeb62('0x39')][_0xeb62('0x45')]){_0xca3f0e['where']=_[_0xeb62('0x46')](_0xca3f0e[_0xeb62('0x43')],{'$or':_['map'](_0xca3f0e['attributes'],function(_0x12adf6){var _0x1b9569={};_0x1b9569[_0x12adf6]={'$like':'%'+_0x162993[_0xeb62('0x39')][_0xeb62('0x45')]+'%'};return _0x1b9569;})});}_0xca3f0e=_[_0xeb62('0x46')]({},_0xca3f0e,_0x162993[_0xeb62('0x47')]);return _0x518655[_0xeb62('0x80')](_0xca3f0e);}})[_0xeb62('0x2e')](function(_0x144bc8){if(_0x144bc8){_0x4cd599=_0x144bc8[_0xeb62('0x3e')];if(!_0x162993[_0xeb62('0x39')][_0xeb62('0x40')](_0xeb62('0x7f'))){_0xca3f0e[_0xeb62('0x26')]=qs[_0xeb62('0x26')](_0x162993[_0xeb62('0x39')]['limit']);_0xca3f0e[_0xeb62('0x24')]=qs[_0xeb62('0x24')](_0x162993[_0xeb62('0x39')][_0xeb62('0x24')]);}return _0x518655[_0xeb62('0x80')](_0xca3f0e);}})['then'](function(_0x54984f){if(_0x54984f){return _0x54984f?{'count':_0x4cd599,'rows':_0x54984f}:null;}})[_0xeb62('0x2e')](respondWithResult(_0x3f5c93,null))[_0xeb62('0x4c')](handleError(_0x3f5c93,null));};exports[_0xeb62('0x82')]=function(_0x3d957d,_0x5af4d7,_0x3a0b12){var _0x5f2c1e=_0x3d957d[_0xeb62('0x53')][_0xeb62('0x76')];var _0x3409db;return db[_0xeb62('0x81')][_0xeb62('0x4a')]({'where':{'id':_0x5f2c1e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb62('0x83'),'attributes':['id',_0xeb62('0x31'),'online',_0xeb62('0x84'),'interface'],'raw':!![]}]})[_0xeb62('0x2e')](function(_0x43107d){if(_0x43107d){_0x3409db=_0x43107d;var _0x2e503b=_[_0xeb62('0x85')](_0x43107d,function(_0x45a197){var _0x3394e6=_0x45a197['get']({'plain':!![]});return _0x3394e6['Agents'];});return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x3d957d[_0xeb62('0x4d')]['id']}})[_0xeb62('0x2e')](function(_0x582217){return db['sequelize'][_0xeb62('0x73')](function(_0x527de3){return _0x582217[_0xeb62('0x82')](_0x5f2c1e,{'transaction':_0x527de3})[_0xeb62('0x2e')](function(){return BPromise[_0xeb62('0x86')](_0x3409db,function(_0x5e43f0){return db[_0xeb62('0x87')][_0xeb62('0x88')]({'TeamId':_0x5e43f0['id'],'VoicePrefixId':_0x3d957d[_0xeb62('0x4d')]['id']},{'transaction':_0x527de3});});})[_0xeb62('0x2e')](function(){return BPromise[_0xeb62('0x86')](_0x2e503b,function(_0x10731b){return db[_0xeb62('0x89')][_0xeb62('0x8a')]({'where':{'UserId':_0x10731b['id'],'VoicePrefixId':_0x3d957d['params']['id']},'transaction':_0x527de3});});})[_0xeb62('0x2e')](function(){_0x2e503b[_0xeb62('0x8b')](function(_0x35d372){socket[_0xeb62('0x79')]('userVoicePrefix:save',{'UserId':_0x35d372['id'],'VoicePrefixId':_0x582217['id']});});});});});}})[_0xeb62('0x2e')](respondWithStatusCode(_0x5af4d7,null))[_0xeb62('0x4c')](handleError(_0x5af4d7,null));};exports[_0xeb62('0x8c')]=function(_0x146c7e,_0x24c285,_0x59bb00){return db[_0xeb62('0x81')][_0xeb62('0x4a')]({'where':{'id':_0x146c7e[_0xeb62('0x39')][_0xeb62('0x76')]},'attributes':['id'],'include':[{'model':db[_0xeb62('0x8d')],'as':_0xeb62('0x83'),'attributes':['id'],'raw':!![]}]})[_0xeb62('0x2e')](handleEntityNotFound(_0x24c285,null))[_0xeb62('0x2e')](function(_0x30625f){var _0x94d0c9=_['map'](_0x30625f,'id');var _0x3ae667=[];var _0x3338ba=[];var _0x50cf9b=squel['select']();_0x50cf9b[_0xeb62('0x8e')](_0xeb62('0x8f'))[_0xeb62('0x90')](_0xeb62('0x91'),'tq')[_0xeb62('0x92')](_0xeb62('0x93'),'ut',_0xeb62('0x94'))[_0xeb62('0x43')](_0xeb62('0x95'),_0x146c7e['params']['id']);for(var _0x535e7a=0x0;_0x535e7a<_0x30625f[_0xeb62('0x3e')];_0x535e7a+=0x1){let _0x43daef=_0x30625f[_0x535e7a];for(var _0x58ffb2=0x0;_0x58ffb2<_0x43daef['Agents'][_0xeb62('0x3e')];_0x58ffb2+=0x1){let _0x341bd8=_0x43daef[_0xeb62('0x83')][_0x58ffb2];var _0x55ef9d=_0x50cf9b['clone']();_0x55ef9d[_0xeb62('0x43')]('ut.UserId\x20=\x20?',_0x341bd8['id']);_0x3338ba[_0xeb62('0x6a')](db[_0xeb62('0x52')][_0xeb62('0x39')](_0x55ef9d['toString'](),{'type':db['sequelize']['QueryTypes'][_0xeb62('0x96')]})[_0xeb62('0x2e')](function(_0x3517db){if(_0x3517db[_0xeb62('0x3e')]===0x1){return _0x341bd8['id'];}else{var _0x5bd3b6=_[_0xeb62('0x97')](_[_0xeb62('0x34')](_0x3517db,_0xeb62('0x98')),function(_0x22eb23){return _[_0xeb62('0x99')](_0x94d0c9,_0x22eb23);});if(_0x5bd3b6){return _0x341bd8['id'];}}}));}}return BPromise[_0xeb62('0x9a')](_0x3338ba)[_0xeb62('0x2e')](function(_0x394573){_0x3ae667=_(_0x3ae667)['union'](_0x394573)[_0xeb62('0x9b')]()[_0xeb62('0x9c')]();return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x146c7e['params']['id']}})[_0xeb62('0x2e')](function(_0x1f84f0){return db['sequelize'][_0xeb62('0x73')](function(_0x26b456){return _0x1f84f0[_0xeb62('0x8c')](_0x146c7e[_0xeb62('0x39')][_0xeb62('0x76')],{'transaction':_0x26b456})[_0xeb62('0x2e')](function(){if(!_[_0xeb62('0x9d')](_0x3ae667)){return _0x1f84f0['removeAgents'](_0x3ae667,{'transaction':_0x26b456});}})[_0xeb62('0x2e')](function(){_0x3ae667['forEach'](function(_0x3578a9){socket[_0xeb62('0x79')](_0xeb62('0x7c'),{'UserId':_0x3578a9,'VoicePrefixId':_0x1f84f0['id']});});});});});});})['then'](respondWithStatusCode(_0x24c285,null))['catch'](handleError(_0x24c285,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 4c5abfe..7687e80 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 _0xf00d=['VoicePrefix','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x36995d,_0x3a9c7a){var _0x17c899=function(_0x498d86){while(--_0x498d86){_0x36995d['push'](_0x36995d['shift']());}};_0x17c899(++_0x3a9c7a);}(_0xf00d,0x1ce));var _0xdf00=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xf00d[_0x48ec91];return _0x22766c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0xdf00('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdf00('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf00('0x2'),'afterDestroy':'remove'};function emitEvent(_0xacce5f){return function(_0x815f2d,_0x4f29b3,_0x5cd632){VoicePrefixEvents[_0xdf00('0x3')](_0xacce5f+':'+_0x815f2d['id'],_0x815f2d);VoicePrefixEvents['emit'](_0xacce5f,_0x815f2d);_0x5cd632(null);};}for(var e in events){if(events[_0xdf00('0x4')](e)){var event=events[e];VoicePrefix[_0xdf00('0x5')](e,emitEvent(event));}}module[_0xdf00('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x9309=['VoicePrefix','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x376a6b,_0x4ddf53){var _0x77e783=function(_0x498bee){while(--_0x498bee){_0x376a6b['push'](_0x376a6b['shift']());}};_0x77e783(++_0x4ddf53);}(_0x9309,0x1e4));var _0x9930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9309[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9930('0x0'));var VoicePrefix=require(_0x9930('0x1'))['db'][_0x9930('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9930('0x3')](0x0);var events={'afterCreate':_0x9930('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf3c054){return function(_0x27afe7,_0x368598,_0xfb0dd4){VoicePrefixEvents[_0x9930('0x5')](_0xf3c054+':'+_0x27afe7['id'],_0x27afe7);VoicePrefixEvents['emit'](_0xf3c054,_0x27afe7);_0xfb0dd4(null);};}for(var e in events){if(events[_0x9930('0x6')](e)){var event=events[e];VoicePrefix[_0x9930('0x7')](e,emitEvent(event));}}module[_0x9930('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index a33450e..08e23d4 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 _0x4858=['lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','VoicePrefix'];(function(_0x1f52f5,_0x404fcc){var _0x3921be=function(_0x3085b5){while(--_0x3085b5){_0x1f52f5['push'](_0x1f52f5['shift']());}};_0x3921be(++_0x404fcc);}(_0x4858,0x154));var _0x8485=function(_0x2abb5e,_0x234f0b){_0x2abb5e=_0x2abb5e-0x0;var _0x1c5543=_0x4858[_0x2abb5e];return _0x1c5543;};'use strict';var _=require(_0x8485('0x0'));var util=require(_0x8485('0x1'));var logger=require('../../config/logger')(_0x8485('0x2'));var moment=require(_0x8485('0x3'));var BPromise=require(_0x8485('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8485('0x5'));var rimraf=require('rimraf');var config=require(_0x8485('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x8485('0x7')]=function(_0x46e7bf,_0x4d65ba){return _0x46e7bf[_0x8485('0x8')](_0x8485('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf559=['exports','define','VoicePrefix','util','../../config/logger','api','moment','bluebird','request-promise','path','./voicePrefix.attributes'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0xf559,0x1e7));var _0x9f55=function(_0x2c1837,_0x82ad96){_0x2c1837=_0x2c1837-0x0;var _0x5041a0=_0xf559[_0x2c1837];return _0x5041a0;};'use strict';var _=require('lodash');var util=require(_0x9f55('0x0'));var logger=require(_0x9f55('0x1'))(_0x9f55('0x2'));var moment=require(_0x9f55('0x3'));var BPromise=require(_0x9f55('0x4'));var rp=require(_0x9f55('0x5'));var fs=require('fs');var path=require(_0x9f55('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f55('0x7'));module[_0x9f55('0x8')]=function(_0x50e19c,_0x3bdb8f){return _0x50e19c[_0x9f55('0x9')](_0x9f55('0xa'),attributes,{'tableName':'voice_prefixes','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 9ed03a4..6acaa92 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 _0x8c8b=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x8c8b,0x106));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb8c8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb8c8('0x1'));var rs=require(_0xb8c8('0x2'));var fs=require('fs');var Redis=require(_0xb8c8('0x3'));var db=require(_0xb8c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8c8('0x5'));var config=require(_0xb8c8('0x6'));var jayson=require(_0xb8c8('0x7'));var client=jayson[_0xb8c8('0x8')][_0xb8c8('0x9')]({'port':0x232a});config[_0xb8c8('0xa')]=_[_0xb8c8('0xb')](config[_0xb8c8('0xa')],{'host':_0xb8c8('0xc'),'port':0x18eb});var socket=require(_0xb8c8('0xd'))(new Redis(config[_0xb8c8('0xa')]));require('./voicePrefix.socket')[_0xb8c8('0xe')](socket);function respondWithRpcPromise(_0x3e6f56,_0x406e1e,_0x1db0e7){return new BPromise(function(_0x3c74d5,_0x3414ec){return client[_0xb8c8('0xf')](_0x3e6f56,_0x1db0e7)[_0xb8c8('0x10')](function(_0x8814ad){logger[_0xb8c8('0x11')](_0xb8c8('0x12'),_0x406e1e,_0xb8c8('0x13'));logger['debug'](_0xb8c8('0x14'),_0x406e1e,'request\x20sent',JSON[_0xb8c8('0x15')](_0x8814ad));if(_0x8814ad[_0xb8c8('0x16')]){if(_0x8814ad['error'][_0xb8c8('0x17')]===0x1f4){logger[_0xb8c8('0x16')](_0xb8c8('0x12'),_0x406e1e,_0x8814ad['error'][_0xb8c8('0x18')]);return _0x3414ec(_0x8814ad[_0xb8c8('0x16')][_0xb8c8('0x18')]);}logger[_0xb8c8('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x406e1e,_0x8814ad[_0xb8c8('0x16')][_0xb8c8('0x18')]);return _0x3c74d5(_0x8814ad[_0xb8c8('0x16')][_0xb8c8('0x18')]);}else{logger['info'](_0xb8c8('0x12'),_0x406e1e,_0xb8c8('0x13'));_0x3c74d5(_0x8814ad[_0xb8c8('0x19')][_0xb8c8('0x18')]);}})[_0xb8c8('0x1a')](function(_0x1cbded){logger[_0xb8c8('0x16')](_0xb8c8('0x12'),_0x406e1e,_0x1cbded);_0x3414ec(_0x1cbded);});});} \ No newline at end of file +var _0xba34=['then','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register'];(function(_0x414815,_0x42c654){var _0x3b11b2=function(_0x503189){while(--_0x503189){_0x414815['push'](_0x414815['shift']());}};_0x3b11b2(++_0x42c654);}(_0xba34,0x119));var _0x4ba3=function(_0x2e8569,_0x6ed141){_0x2e8569=_0x2e8569-0x0;var _0x5d897a=_0xba34[_0x2e8569];return _0x5d897a;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});config[_0x4ba3('0xb')]=_['defaults'](config[_0x4ba3('0xb')],{'host':_0x4ba3('0xc'),'port':0x18eb});var socket=require(_0x4ba3('0xd'))(new Redis(config[_0x4ba3('0xb')]));require(_0x4ba3('0xe'))[_0x4ba3('0xf')](socket);function respondWithRpcPromise(_0x292f58,_0x3f653c,_0x2ed106){return new BPromise(function(_0x14ebf2,_0x2d215b){return client['request'](_0x292f58,_0x2ed106)[_0x4ba3('0x10')](function(_0x9071){logger['info'](_0x4ba3('0x11'),_0x3f653c,'request\x20sent');logger[_0x4ba3('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3f653c,_0x4ba3('0x13'),JSON[_0x4ba3('0x14')](_0x9071));if(_0x9071[_0x4ba3('0x15')]){if(_0x9071[_0x4ba3('0x15')][_0x4ba3('0x16')]===0x1f4){logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);return _0x2d215b(_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);}logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);return _0x14ebf2(_0x9071[_0x4ba3('0x15')]['message']);}else{logger[_0x4ba3('0x18')](_0x4ba3('0x11'),_0x3f653c,_0x4ba3('0x13'));_0x14ebf2(_0x9071[_0x4ba3('0x19')]['message']);}})[_0x4ba3('0x1a')](function(_0xe4eff9){logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0xe4eff9);_0x2d215b(_0xe4eff9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 04a7a60..62c2de1 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 _0x9c5e=['./voicePrefix.events','save','remove','update','register','voicePrefix:'];(function(_0x3777f1,_0x4b12be){var _0x12b3f8=function(_0x36902f){while(--_0x36902f){_0x3777f1['push'](_0x3777f1['shift']());}};_0x12b3f8(++_0x4b12be);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x20f8e8,_0x3c692c){_0x20f8e8=_0x20f8e8-0x0;var _0x313033=_0x9c5e[_0x20f8e8];return _0x313033;};'use strict';var VoicePrefixEvents=require(_0xe9c5('0x0'));var events=[_0xe9c5('0x1'),_0xe9c5('0x2'),_0xe9c5('0x3')];function createListener(_0x2ce33e,_0x5a6ce5){return function(_0x51e921){_0x5a6ce5['emit'](_0x2ce33e,_0x51e921);};}function removeListener(_0x120d2f,_0x13d5d7){return function(){VoicePrefixEvents['removeListener'](_0x120d2f,_0x13d5d7);};}exports[_0xe9c5('0x4')]=function(_0x5c11e5){for(var _0x1e6a31=0x0,_0x6f6045=events['length'];_0x1e6a31<_0x6f6045;_0x1e6a31++){var _0x2fa290=events[_0x1e6a31];var _0x34ee69=createListener(_0xe9c5('0x5')+_0x2fa290,_0x5c11e5);VoicePrefixEvents['on'](_0x2fa290,_0x34ee69);}}; \ No newline at end of file +var _0x67da=['removeListener','length','voicePrefix:','save','remove','update','emit'];(function(_0xddd2cb,_0xfb1fde){var _0x352f=function(_0x3a6367){while(--_0x3a6367){_0xddd2cb['push'](_0xddd2cb['shift']());}};_0x352f(++_0xfb1fde);}(_0x67da,0x192));var _0xa67d=function(_0x42ad47,_0x2439b1){_0x42ad47=_0x42ad47-0x0;var _0x53cadd=_0x67da[_0x42ad47];return _0x53cadd;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xa67d('0x0'),_0xa67d('0x1'),_0xa67d('0x2')];function createListener(_0x3cae01,_0x472755){return function(_0x3633a0){_0x472755[_0xa67d('0x3')](_0x3cae01,_0x3633a0);};}function removeListener(_0x1a8b5e,_0x3dcee7){return function(){VoicePrefixEvents[_0xa67d('0x4')](_0x1a8b5e,_0x3dcee7);};}exports['register']=function(_0x5b8ec7){for(var _0x408786=0x0,_0x4d2734=events[_0xa67d('0x5')];_0x408786<_0x4d2734;_0x408786++){var _0x2346f4=events[_0x408786];var _0x10f89a=createListener(_0xa67d('0x6')+_0x2346f4,_0x5b8ec7);VoicePrefixEvents['on'](_0x2346f4,_0x10f89a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c8fc0f4..117ada0 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x44ff3a,_0x46f40d){var _0x333bc1=function(_0x1114aa){while(--_0x1114aa){_0x44ff3a['push'](_0x44ff3a['shift']());}};_0x333bc1(++_0x46f40d);}(_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/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xb10b,0x12a));var _0xbb10=function(_0x55f380,_0x3e27f0){_0x55f380=_0x55f380-0x0;var _0x36b38e=_0xb10b[_0x55f380];return _0x36b38e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 1dc1ecd..3c6b0df 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 _0x047c=['ENUM','inbound','default','leastrecent','fewestcalls','random','linear','wrandom','ringall','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','agentBusyFactor','Only\x20for\x20predictive\x20method.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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)','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)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name'];(function(_0x5cdf4b,_0x1122f7){var _0x3a1171=function(_0x4cf5eb){while(--_0x4cf5eb){_0x5cdf4b['push'](_0x5cdf4b['shift']());}};_0x3a1171(++_0x1122f7);}(_0x047c,0xf2));var _0xc047=function(_0x1e8e81,_0x240af8){_0x1e8e81=_0x1e8e81-0x0;var _0x583bcd=_0x047c[_0x1e8e81];return _0x583bcd;};'use strict';var Sequelize=require(_0xc047('0x0'));module[_0xc047('0x1')]={'name':{'type':Sequelize[_0xc047('0x2')],'allowNull':![],'unique':_0xc047('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x5'),'outbound'),'allowNull':![],'defaultValue':_0xc047('0x5')},'musiconhold':{'type':Sequelize[_0xc047('0x2')],'defaultValue':_0xc047('0x6')},'announce':{'type':Sequelize[_0xc047('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0xc047('0x7'),_0xc047('0x8'),_0xc047('0x9'),'rrmemory',_0xc047('0xa'),_0xc047('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0xc047('0xc'),'set':function(_0x2aa92c){this[_0xc047('0xd')](_0xc047('0xe'),_0x2aa92c?_0x2aa92c:_0xc047('0xf'));},'get':function(){var _0x46bfef=this[_0xc047('0x10')](_0xc047('0x11'));var _0x5d2b32=this[_0xc047('0x10')](_0xc047('0x12'));var _0x5c32ff=this[_0xc047('0x10')](_0xc047('0xe'));if(_0x46bfef===_0xc047('0x5')){return _0x5c32ff;}if(_0x5d2b32===_0xc047('0x13')&&_0x5c32ff===_0xc047('0xf')||_0x5d2b32==='booked'&&_0x5c32ff===_0xc047('0x14')){return _0x5c32ff;}if(_0x5d2b32===_0xc047('0x15')||_0x5d2b32===_0xc047('0x16')||_0x5d2b32==='power'){return _0x5c32ff;}return null;}},'servicelevel':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc047('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no'),'defaultValue':_0xc047('0x18')},'autopause':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no',_0xc047('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc047('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xc047('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xc047('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc047('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc047('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc047('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xc047('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xc047('0x18')},'announce_holdtime':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no',_0xc047('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xc047('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc047('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc047('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc047('0x2')]},'queue_quantity1':{'type':Sequelize[_0xc047('0x2')]},'queue_quantity2':{'type':Sequelize[_0xc047('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xc047('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xc047('0x1b')],'set':function(_0x5cb13a){this[_0xc047('0xd')](_0xc047('0x1c'),_0x5cb13a?_0x5cb13a[_0xc047('0x1d')](','):[]);},'get':function(){return this[_0xc047('0x10')](_0xc047('0x1c'))?this['getDataValue'](_0xc047('0x1c'))[_0xc047('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0xc047('0x2')],'defaultValue':'yes','set':function(_0x34eaa1){this[_0xc047('0xd')](_0xc047('0x1f'),_0x34eaa1?_0x34eaa1[_0xc047('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0xc047('0x1f'))?this[_0xc047('0x10')]('joinempty')[_0xc047('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc047('0x2')],'defaultValue':'no','set':function(_0x150924){this[_0xc047('0xd')]('leavewhenempty',_0x150924?_0x150924[_0xc047('0x1d')](','):undefined);},'get':function(){return this[_0xc047('0x10')](_0xc047('0x20'))?this[_0xc047('0x10')](_0xc047('0x20'))[_0xc047('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc047('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc047('0x2')]},'description':{'type':Sequelize[_0xc047('0x2')]},'acw':{'type':Sequelize[_0xc047('0x21')],'defaultValue':0x0,'set':function(_0x4120fc){this['setDataValue'](_0xc047('0x22'),_0x4120fc);if(_0x4120fc){if(this[_0xc047('0x10')](_0xc047('0x23'))<0x2){this[_0xc047('0xd')](_0xc047('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc047('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc047('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x24'),_0xc047('0x15'),_0xc047('0x25'),'predictive',_0xc047('0x13')),'defaultValue':_0xc047('0x15'),'comment':_0xc047('0x26')},'dialLimitChannel':{'type':Sequelize[_0xc047('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc047('0x27')},'dialLimitQueue':{'type':Sequelize[_0xc047('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc047('0x28')},'dialPowerLevel':{'type':Sequelize[_0xc047('0x29')](0x2)[_0xc047('0x2a')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x2b'),'dropRate'),'defaultValue':'dropRate','comment':_0xc047('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc047('0x29')](0x2)[_0xc047('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc047('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc047('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xc047('0x2')],'defaultValue':_0xc047('0x2e'),'comment':_0xc047('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc047('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc047('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc047('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xc047('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc047('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'defaultValue':0x3,'comment':_0xc047('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc047('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc047('0x2a')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc047('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc047('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc047('0x36'),_0xc047('0x37'),'onlyIfOpen'),'defaultValue':_0xc047('0x36')},'dialAMDActive':{'type':Sequelize[_0xc047('0x21')],'defaultValue':0x0,'comment':_0xc047('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xc047('0x17')](0x9)[_0xc047('0x2a')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc047('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xc047('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc047('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc047('0x17')](0x9)[_0xc047('0x2a')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc047('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc047('0x17')](0x9)[_0xc047('0x2a')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc047('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xc047('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc047('0x17')](0x9)[_0xc047('0x2a')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc047('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc047('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc047('0x17')](0x5)[_0xc047('0x2a')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc047('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc047('0x17')](0x9)[_0xc047('0x2a')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc047('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0xc047('0x17')](0x5)[_0xc047('0x2a')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc047('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc047('0x4')](_0xc047('0x42'),'ASC'),'defaultValue':_0xc047('0x42')},'dialQueueProject2':{'type':Sequelize[_0xc047('0x2')],'comment':_0xc047('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc047('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc047('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc047('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc047('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc047('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc047('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0xc047('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc047('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc047('0x17')](0x5)[_0xc047('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc047('0x17')](0x3)[_0xc047('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc047('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc047('0x17')](0x5)[_0xc047('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc047('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xc047('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0xc047('0x21')],'defaultValue':![],'comment':_0xc047('0x4f'),'set':function(_0x5aeaa2){if(!_0x5aeaa2)this[_0xc047('0xd')](_0xc047('0x50'),null);this[_0xc047('0xd')](_0xc047('0x51'),_0x5aeaa2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xc047('0x2a')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xc047('0x21')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9192=['Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','random','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9192,0xbf));var _0x2919=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x9192[_0x4e783c];return _0x2fbd6d;};'use strict';var Sequelize=require(_0x2919('0x0'));module[_0x2919('0x1')]={'name':{'type':Sequelize[_0x2919('0x2')],'allowNull':![],'unique':_0x2919('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x5'),_0x2919('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x2919('0x7')},'announce':{'type':Sequelize[_0x2919('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x2919('0x8'),'leastrecent',_0x2919('0x9'),_0x2919('0xa'),'rrmemory',_0x2919('0xb'),_0x2919('0xc'),_0x2919('0xd')),'allowNull':![],'defaultValue':_0x2919('0x8'),'set':function(_0x207aa8){this[_0x2919('0xe')]('strategy',_0x207aa8?_0x207aa8:_0x2919('0xf'));},'get':function(){var _0x2d9b8f=this[_0x2919('0x10')](_0x2919('0x11'));var _0x32099a=this[_0x2919('0x10')](_0x2919('0x12'));var _0x4843e0=this[_0x2919('0x10')]('strategy');if(_0x2d9b8f==='inbound'){return _0x4843e0;}if(_0x32099a===_0x2919('0x13')&&_0x4843e0==='rrmemory'||_0x32099a===_0x2919('0x13')&&_0x4843e0===_0x2919('0x14')){return _0x4843e0;}if(_0x32099a===_0x2919('0x15')||_0x32099a===_0x2919('0x16')||_0x32099a==='power'){return _0x4843e0;}return null;}},'servicelevel':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2919('0x2')]},'weight':{'type':Sequelize[_0x2919('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defaultValue':_0x2919('0x18')},'autopause':{'type':Sequelize[_0x2919('0x4')]('yes','no',_0x2919('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2919('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x2919('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2919('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2919('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2919('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2919('0x4')]('yes','no'),'defaultValue':_0x2919('0x18')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x2919('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x2919('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2919('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2919('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2919('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x2919('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x2919('0x2')]},'queue_less_than':{'type':Sequelize[_0x2919('0x2')]},'periodic_announce':{'type':Sequelize[_0x2919('0x1b')],'set':function(_0x2041a5){this[_0x2919('0xe')](_0x2919('0x1c'),_0x2041a5?_0x2041a5[_0x2919('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x2919('0x1c'))?this[_0x2919('0x10')](_0x2919('0x1c'))[_0x2919('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x2919('0x18'),'set':function(_0x323300){this[_0x2919('0xe')](_0x2919('0x1f'),_0x323300?_0x323300[_0x2919('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x2919('0x1f'))?this[_0x2919('0x10')](_0x2919('0x1f'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2919('0x2')],'defaultValue':'no','set':function(_0x5c6d82){this[_0x2919('0xe')](_0x2919('0x20'),_0x5c6d82?_0x5c6d82['join'](','):undefined);},'get':function(){return this[_0x2919('0x10')](_0x2919('0x20'))?this[_0x2919('0x10')](_0x2919('0x20'))[_0x2919('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x2919('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2919('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x2919('0x21')],'defaultValue':0x0,'set':function(_0x4968f6){this['setDataValue'](_0x2919('0x22'),_0x4968f6);if(_0x4968f6){if(this[_0x2919('0x10')](_0x2919('0x23'))<0x2){this[_0x2919('0xe')](_0x2919('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2919('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x2919('0x21')],'defaultValue':0x0,'comment':_0x2919('0x24')},'dialMethod':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x25'),_0x2919('0x15'),_0x2919('0x26'),_0x2919('0x16'),'booked'),'defaultValue':_0x2919('0x15'),'comment':_0x2919('0x27')},'dialLimitChannel':{'type':Sequelize[_0x2919('0x17')](0x4)[_0x2919('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2919('0x29')},'dialLimitQueue':{'type':Sequelize[_0x2919('0x17')](0x4)[_0x2919('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2919('0x2a')},'dialPowerLevel':{'type':Sequelize[_0x2919('0x2b')](0x2)[_0x2919('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2919('0x2c')},'dialPredictiveOptimization':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x2d'),_0x2919('0x2e')),'defaultValue':_0x2919('0x2e'),'comment':_0x2919('0x2f')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2919('0x2b')](0x2)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2919('0x30')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2919('0x31')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2919('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x32')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x2919('0x33')},'dialQueueTimeout':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x34')},'dialQueueProject':{'type':Sequelize[_0x2919('0x2')],'comment':_0x2919('0x35')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x36')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x37')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2919('0x28')],'defaultValue':0x3,'comment':_0x2919('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2919('0x17')](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2919('0x39')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2919('0x3a')},'dialTimezone':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2919('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x2919('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2919('0x4')]('always',_0x2919('0x3b'),'onlyIfOpen'),'defaultValue':_0x2919('0x3c')},'dialAMDActive':{'type':Sequelize[_0x2919('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2919('0x17')](0x9)[_0x2919('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2919('0x3d')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x2919('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2919('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2919('0x17')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x2919('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2919('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x2919('0x17')](0x9)[_0x2919('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2919('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2919('0x17')](0x9)[_0x2919('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2919('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2919('0x17')](0x9)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2919('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2919('0x17')](0x5)[_0x2919('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2919('0x17')](0x9)[_0x2919('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2919('0x43')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x2919('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x2919('0x21')],'defaultValue':0x0,'comment':_0x2919('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2919('0x4')](_0x2919('0x45'),_0x2919('0x46')),'defaultValue':_0x2919('0x45')},'dialQueueProject2':{'type':Sequelize[_0x2919('0x2')],'comment':_0x2919('0x35')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2919('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2919('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2919('0x47')},'dialCutDigit':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2919('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2919('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x2919('0x17')](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2919('0x17')](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2919('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2919('0x17')](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2919('0x17')](0x5)[_0x2919('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2919('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2919('0x17')],'allowNull':!![],'comment':_0x2919('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x2919('0x21')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x25c6c5){if(!_0x25c6c5)this[_0x2919('0xe')](_0x2919('0x4f'),null);this[_0x2919('0xe')](_0x2919('0x50'),_0x25c6c5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2919('0x17')](0x3)[_0x2919('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x2919('0x21')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index e3c4d07..7b94f5b 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 _0xfbbe=['destroy','end','sendStatus','error','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','options','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','params','CmHopper','getHopperHistories','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','online','interface','Agents','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','findOrCreate','isNil','format','SIP/%s','voicePause','forEach','emit','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','clone','QueryTypes','all','union','isEmpty','removeAgents','addAgents','userVoiceQueue:save','push','UserVoiceQueueRt','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','NOW()','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','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','./voiceQueue.socket','register','json','offset','limit','undefined','count','status','apply','reject','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xfbbe,0x1ee));var _0xefbb=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfbbe[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xefbb('0x0'));var rimraf=require(_0xefbb('0x1'));var zipdir=require(_0xefbb('0x2'));var jsonpatch=require(_0xefbb('0x3'));var rp=require(_0xefbb('0x4'));var moment=require(_0xefbb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xefbb('0x6'));var util=require(_0xefbb('0x7'));var path=require(_0xefbb('0x8'));var sox=require(_0xefbb('0x9'));var csv=require(_0xefbb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefbb('0xb'));var squel=require(_0xefbb('0xc'));var crypto=require(_0xefbb('0xd'));var jsforce=require(_0xefbb('0xe'));var deskjs=require(_0xefbb('0xf'));var toCsv=require(_0xefbb('0xa'));var querystring=require('querystring');var Papa=require(_0xefbb('0x10'));var Redis=require(_0xefbb('0x11'));var authService=require(_0xefbb('0x12'));var qs=require(_0xefbb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefbb('0x14'));var logger=require(_0xefbb('0x15'))(_0xefbb('0x16'));var utils=require(_0xefbb('0x17'));var config=require(_0xefbb('0x18'));var licenseUtil=require(_0xefbb('0x19'));var db=require(_0xefbb('0x1a'))['db'];config[_0xefbb('0x1b')]=_[_0xefbb('0x1c')](config['redis'],{'host':_0xefbb('0x1d'),'port':0x18eb});var socket=require(_0xefbb('0x1e'))(new Redis(config[_0xefbb('0x1b')]));require(_0xefbb('0x1f'))[_0xefbb('0x20')](socket);function respondWithStatusCode(_0x12156d,_0x424dbe){_0x424dbe=_0x424dbe||0xcc;return function(_0x495944){if(_0x495944){return _0x12156d['sendStatus'](_0x424dbe);}return _0x12156d['status'](_0x424dbe)['end']();};}function respondWithResult(_0x405c16,_0xad2c54){_0xad2c54=_0xad2c54||0xc8;return function(_0x5c62e0){if(_0x5c62e0){return _0x405c16['status'](_0xad2c54)[_0xefbb('0x21')](_0x5c62e0);}};}function respondWithFilteredResult(_0x1a4e00,_0x206b81){return function(_0x2337cc){if(_0x2337cc){var _0x107410=typeof _0x206b81[_0xefbb('0x22')]==='undefined'&&typeof _0x206b81[_0xefbb('0x23')]===_0xefbb('0x24');var _0x4f9f0f=_0x2337cc[_0xefbb('0x25')];var _0x411f3c=_0x107410?0x0:_0x206b81['offset'];var _0x4ec5f7=_0x107410?_0x2337cc[_0xefbb('0x25')]:_0x206b81['offset']+_0x206b81[_0xefbb('0x23')];var _0x184457;if(_0x4ec5f7>=_0x4f9f0f){_0x4ec5f7=_0x4f9f0f;_0x184457=0xc8;}else{_0x184457=0xce;}_0x1a4e00[_0xefbb('0x26')](_0x184457);return _0x1a4e00['set']('Content-Range',_0x411f3c+'-'+_0x4ec5f7+'/'+_0x4f9f0f)[_0xefbb('0x21')](_0x2337cc);}return null;};}function patchUpdates(_0x311ea1){return function(_0x51ab35){try{jsonpatch[_0xefbb('0x27')](_0x51ab35,_0x311ea1,!![]);}catch(_0x2ff995){return BPromise[_0xefbb('0x28')](_0x2ff995);}return _0x51ab35['save']();};}function saveUpdates(_0x9e391c,_0x3a490f){return function(_0x32019e){if(_0x32019e){return _0x32019e['update'](_0x9e391c)[_0xefbb('0x29')](function(_0x537abf){return _0x537abf;});}return null;};}function removeEntity(_0x4ed42b,_0x328aa8){return function(_0x5d44f0){if(_0x5d44f0){return _0x5d44f0['destroy']()[_0xefbb('0x29')](function(){var _0xbbd77b=_0x5d44f0[_0xefbb('0x2a')]({'plain':!![]});var _0x54ed48=[{'name':_0xefbb('0x2b'),'value':_0xefbb('0x2c'),'ignore':![]},{'name':_0xefbb('0x2d'),'value':_0xefbb('0x2e'),'ignore':![]}];var _0xd40ed4=_(_0x54ed48)[_0xefbb('0x2f')]('ignore')[_0xefbb('0x30')](_0xefbb('0x31'))[_0xefbb('0x31')]();if(_[_0xefbb('0x32')](_0xd40ed4,_0xbbd77b[_0xefbb('0x33')])){return;}var _0x3e9836=_[_0xefbb('0x34')](_0x54ed48,[_0xefbb('0x31'),_0xbbd77b['type']])[_0xefbb('0x35')];return db[_0xefbb('0x36')][_0xefbb('0x37')]({'where':{'type':_0x3e9836,'resourceId':_0xbbd77b['id']}})['then'](function(){return _0x5d44f0;});})['then'](function(){_0x4ed42b[_0xefbb('0x26')](0xcc)[_0xefbb('0x38')]();});}};}function handleEntityNotFound(_0x4a2921,_0x22a582){return function(_0x345968){if(!_0x345968){_0x4a2921[_0xefbb('0x39')](0x194);}return _0x345968;};}function handleError(_0x595aad,_0x44ed5b){_0x44ed5b=_0x44ed5b||0x1f4;return function(_0x354a9b){logger[_0xefbb('0x3a')](_0x354a9b['stack']);if(_0x354a9b[_0xefbb('0x35')]){delete _0x354a9b[_0xefbb('0x35')];}_0x595aad[_0xefbb('0x26')](_0x44ed5b)[_0xefbb('0x3b')](_0x354a9b);};}exports[_0xefbb('0x3c')]=function(_0x3e9076,_0x220270){var _0x5a79f3={},_0x188a52={},_0x4e1e3d={'count':0x0,'rows':[]};var _0xdcde85=_['map'](db[_0xefbb('0x3d')][_0xefbb('0x3e')],function(_0x32ac49){return{'name':_0x32ac49[_0xefbb('0x3f')],'type':_0x32ac49[_0xefbb('0x33')][_0xefbb('0x40')]};});_0x188a52[_0xefbb('0x41')]=_[_0xefbb('0x30')](_0xdcde85,_0xefbb('0x35'));_0x188a52[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x3e9076[_0xefbb('0x42')]);_0x188a52[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x188a52[_0xefbb('0x41')],_0x188a52[_0xefbb('0x42')]);_0x5a79f3[_0xefbb('0x46')]=_['intersection'](_0x188a52['model'],qs[_0xefbb('0x47')](_0x3e9076['query'][_0xefbb('0x47')]));_0x5a79f3[_0xefbb('0x46')]=_0x5a79f3[_0xefbb('0x46')][_0xefbb('0x48')]?_0x5a79f3[_0xefbb('0x46')]:_0x188a52[_0xefbb('0x41')];if(!_0x3e9076[_0xefbb('0x42')][_0xefbb('0x49')](_0xefbb('0x4a'))){_0x5a79f3[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x3e9076[_0xefbb('0x42')][_0xefbb('0x23')]);_0x5a79f3[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x3e9076[_0xefbb('0x42')][_0xefbb('0x22')]);}_0x5a79f3[_0xefbb('0x4b')]=qs[_0xefbb('0x4c')](_0x3e9076[_0xefbb('0x42')][_0xefbb('0x4c')]);_0x5a79f3[_0xefbb('0x4d')]=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0x3e9076[_0xefbb('0x42')],_0x188a52[_0xefbb('0x44')]),_0xdcde85);if(_0x3e9076['query']['filter']){_0x5a79f3[_0xefbb('0x4d')]=_[_0xefbb('0x4f')](_0x5a79f3[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0xdcde85,function(_0x1ede26){if(_0x1ede26[_0xefbb('0x33')]!==_0xefbb('0x50')){var _0x2be4e8={};_0x2be4e8[_0x1ede26[_0xefbb('0x35')]]={'$like':'%'+_0x3e9076[_0xefbb('0x42')]['filter']+'%'};return _0x2be4e8;}})});}_0x5a79f3=_['merge']({},_0x5a79f3,_0x3e9076['options']);var _0x53eb87={'where':_0x5a79f3[_0xefbb('0x4d')]};return db['VoiceQueue']['count'](_0x53eb87)[_0xefbb('0x29')](function(_0x277e67){_0x4e1e3d[_0xefbb('0x25')]=_0x277e67;if(_0x3e9076[_0xefbb('0x42')]['includeAll']){_0x5a79f3[_0xefbb('0x51')]=[{'all':!![]}];}return db[_0xefbb('0x3d')][_0xefbb('0x52')](_0x5a79f3);})['then'](function(_0xe415e7){_0x4e1e3d[_0xefbb('0x53')]=_0xe415e7;return _0x4e1e3d;})[_0xefbb('0x29')](respondWithFilteredResult(_0x220270,_0x5a79f3))[_0xefbb('0x54')](handleError(_0x220270,null));};exports['show']=function(_0x33ecce,_0x58c7ee){var _0x11cfbc={'raw':![],'where':{'id':_0x33ecce['params']['id']}},_0x313f4d={};_0x313f4d['model']=_[_0xefbb('0x43')](db[_0xefbb('0x3d')]['rawAttributes']);_0x313f4d[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x33ecce[_0xefbb('0x42')]);_0x313f4d[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x313f4d['model'],_0x313f4d[_0xefbb('0x42')]);_0x11cfbc[_0xefbb('0x46')]=_[_0xefbb('0x45')](_0x313f4d[_0xefbb('0x41')],qs[_0xefbb('0x47')](_0x33ecce[_0xefbb('0x42')][_0xefbb('0x47')]));_0x11cfbc[_0xefbb('0x46')]=_0x11cfbc[_0xefbb('0x46')][_0xefbb('0x48')]?_0x11cfbc['attributes']:_0x313f4d[_0xefbb('0x41')];if(_0x33ecce[_0xefbb('0x42')][_0xefbb('0x55')]){_0x11cfbc['include']=[{'all':!![]}];}_0x11cfbc=_[_0xefbb('0x4f')]({},_0x11cfbc,_0x33ecce['options']);return db['VoiceQueue']['find'](_0x11cfbc)[_0xefbb('0x29')](handleEntityNotFound(_0x58c7ee,null))[_0xefbb('0x29')](respondWithResult(_0x58c7ee,null))[_0xefbb('0x54')](handleError(_0x58c7ee,null));};exports[_0xefbb('0x56')]=function(_0x2c61f7,_0x2df5c2){return db[_0xefbb('0x3d')][_0xefbb('0x56')](_0x2c61f7[_0xefbb('0x57')],{})[_0xefbb('0x29')](function(_0x1d657e){var _0x7ef9c2=_0x2c61f7['user'][_0xefbb('0x2a')]({'plain':!![]});if(!_0x7ef9c2)throw new Error(_0xefbb('0x58'));if(_0x7ef9c2[_0xefbb('0x59')]===_0xefbb('0x5a')){var _0x375c8b=_0x1d657e[_0xefbb('0x2a')]({'plain':!![]});var _0x3d0ea4=[{'name':_0xefbb('0x2b'),'value':_0xefbb('0x2c')},{'name':_0xefbb('0x2d'),'value':_0xefbb('0x2e')}];var _0x44ef47=_[_0xefbb('0x34')](_0x3d0ea4,['value',_0x375c8b[_0xefbb('0x33')]])[_0xefbb('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x44ef47,'userProfileId':_0x7ef9c2[_0xefbb('0x5b')]},'raw':!![]})[_0xefbb('0x29')](function(_0x2c396b){if(_0x2c396b&&_0x2c396b[_0xefbb('0x5c')]===0x0){return db[_0xefbb('0x36')]['create']({'name':_0x375c8b[_0xefbb('0x35')],'resourceId':_0x375c8b['id'],'type':_0x2c396b[_0xefbb('0x35')],'sectionId':_0x2c396b['id']},{})[_0xefbb('0x29')](function(){return _0x1d657e;});}else{return _0x1d657e;}})[_0xefbb('0x54')](function(_0x2fa932){logger[_0xefbb('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa932);throw _0x2fa932;});}return _0x1d657e;})[_0xefbb('0x29')](respondWithResult(_0x2df5c2,0xc9))[_0xefbb('0x54')](handleError(_0x2df5c2,null));};exports['clone']=function(_0x1ca9bc,_0x49fe9c){var _0x11b8cb={'where':{'id':_0x1ca9bc['params']['id']}},_0x58e0b1={};_0x58e0b1[_0xefbb('0x41')]=_[_0xefbb('0x43')](db['VoiceQueue'][_0xefbb('0x3e')]);_0x11b8cb['attributes']=_['intersection'](_0x58e0b1[_0xefbb('0x41')],qs[_0xefbb('0x47')](_0x1ca9bc['query'][_0xefbb('0x47')]));_0x11b8cb['attributes']=_0x11b8cb[_0xefbb('0x46')][_0xefbb('0x48')]?_0x11b8cb[_0xefbb('0x46')]:_0x58e0b1[_0xefbb('0x41')];if(_0x1ca9bc['query'][_0xefbb('0x55')]){_0x11b8cb[_0xefbb('0x51')]=[{'all':!![]}];}_0x11b8cb=_['merge']({},_0x11b8cb,_0x1ca9bc[_0xefbb('0x5d')]);return db['VoiceQueue'][_0xefbb('0x34')](_0x11b8cb)[_0xefbb('0x29')](handleEntityNotFound(_0x49fe9c,null))[_0xefbb('0x29')](function(_0x1a6b2a){if(_0x1a6b2a){var _0x515f4b=_0x1a6b2a[_0xefbb('0x2a')]({'plain':!![]});_0x515f4b=qs[_0xefbb('0x5e')](_0x515f4b,['id',_0xefbb('0x5f'),'updatedAt']);_0x1ca9bc[_0xefbb('0x57')]=_[_0xefbb('0x5e')](_0x1ca9bc[_0xefbb('0x57')],['id',_0xefbb('0x5f'),_0xefbb('0x60')]);return db['VoiceQueue'][_0xefbb('0x56')](_[_0xefbb('0x4f')](_0x515f4b,_0x1ca9bc[_0xefbb('0x57')]),{'include':_0x1ca9bc[_0xefbb('0x42')][_0xefbb('0x55')]?[{'all':!![]}]:undefined})[_0xefbb('0x29')](function(_0x9486eb){var _0x3e2a40=_0x1ca9bc[_0xefbb('0x5a')]['get']({'plain':!![]});if(!_0x3e2a40)throw new Error(_0xefbb('0x58'));if(_0x3e2a40[_0xefbb('0x59')]===_0xefbb('0x5a')){var _0x13d2de=_0x9486eb[_0xefbb('0x2a')]({'plain':!![]});var _0x3a212b=[{'name':'VoiceQueues','value':_0xefbb('0x2c')},{'name':_0xefbb('0x2d'),'value':_0xefbb('0x2e')}];var _0x39f4bf=_[_0xefbb('0x34')](_0x3a212b,[_0xefbb('0x31'),_0x13d2de[_0xefbb('0x33')]])[_0xefbb('0x35')];return db['UserProfileSection'][_0xefbb('0x34')]({'where':{'name':_0x39f4bf,'userProfileId':_0x3e2a40['userProfileId']},'raw':!![]})[_0xefbb('0x29')](function(_0x57196e){if(_0x57196e&&_0x57196e[_0xefbb('0x5c')]===0x0){return db[_0xefbb('0x36')][_0xefbb('0x56')]({'name':_0x13d2de[_0xefbb('0x35')],'resourceId':_0x13d2de['id'],'type':_0x57196e[_0xefbb('0x35')],'sectionId':_0x57196e['id']},{})['then'](function(){return _0x9486eb;});}else{return _0x9486eb;}})[_0xefbb('0x54')](function(_0xfaf815){logger[_0xefbb('0x3a')](_0xefbb('0x61'),_0xfaf815);throw _0xfaf815;});}return _0x9486eb;});}})['then'](respondWithResult(_0x49fe9c,0xc9))['catch'](handleError(_0x49fe9c,null));};exports[_0xefbb('0x62')]=function(_0xb277a2,_0x1baf57){if(_0xb277a2[_0xefbb('0x57')]['id']){delete _0xb277a2[_0xefbb('0x57')]['id'];}return db[_0xefbb('0x3d')][_0xefbb('0x34')]({'where':{'id':_0xb277a2['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x1baf57,null))['then'](saveUpdates(_0xb277a2[_0xefbb('0x57')],null))[_0xefbb('0x29')](respondWithResult(_0x1baf57,null))[_0xefbb('0x54')](handleError(_0x1baf57,null));};exports[_0xefbb('0x37')]=function(_0x593f0d,_0x135892){return db[_0xefbb('0x3d')][_0xefbb('0x34')]({'where':{'id':_0x593f0d['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x135892,null))[_0xefbb('0x29')](removeEntity(_0x135892,null))[_0xefbb('0x54')](handleError(_0x135892,null));};exports[_0xefbb('0x63')]=function(_0xbcfe2f,_0x11374b,_0x2ade00){var _0x313fd1={'raw':![],'where':{}};var _0x43872a={};var _0xf62c22={'count':0x0,'rows':[]};return db[_0xefbb('0x3d')][_0xefbb('0x64')]({'where':{'id':_0xbcfe2f[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x11374b,null))[_0xefbb('0x29')](function(_0x356e88){if(_0x356e88){_0x43872a[_0xefbb('0x41')]=_[_0xefbb('0x43')](db['CmHopper'][_0xefbb('0x3e')]);_0x43872a[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0xbcfe2f['query']);_0x43872a[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x43872a[_0xefbb('0x41')],_0x43872a['query']);_0x313fd1[_0xefbb('0x46')]=_[_0xefbb('0x45')](_0x43872a['model'],qs[_0xefbb('0x47')](_0xbcfe2f['query']['fields']));_0x313fd1[_0xefbb('0x46')]=_0x313fd1[_0xefbb('0x46')][_0xefbb('0x48')]?_0x313fd1[_0xefbb('0x46')]:_0x43872a['model'];if(!_0xbcfe2f[_0xefbb('0x42')][_0xefbb('0x49')]('nolimit')){_0x313fd1[_0xefbb('0x23')]=qs['limit'](_0xbcfe2f[_0xefbb('0x42')][_0xefbb('0x23')]);_0x313fd1[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0xbcfe2f[_0xefbb('0x42')][_0xefbb('0x22')]);}_0x313fd1[_0xefbb('0x4b')]=qs[_0xefbb('0x4c')](_0xbcfe2f[_0xefbb('0x42')]['sort']);_0x313fd1[_0xefbb('0x4d')]=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0xbcfe2f[_0xefbb('0x42')],_0x43872a[_0xefbb('0x44')]));_0x313fd1[_0xefbb('0x4d')]['VoiceQueueId']=_0x356e88['id'];if(_0xbcfe2f['query'][_0xefbb('0x2f')]){_0x313fd1['where']=_[_0xefbb('0x4f')](_0x313fd1['where'],{'$or':_[_0xefbb('0x30')](_0x313fd1[_0xefbb('0x46')],function(_0xedea1){var _0x56c5b9={};_0x56c5b9[_0xedea1]={'$like':'%'+_0xbcfe2f[_0xefbb('0x42')][_0xefbb('0x2f')]+'%'};return _0x56c5b9;})});}_0x313fd1=_[_0xefbb('0x4f')]({},_0x313fd1,_0xbcfe2f[_0xefbb('0x5d')]);return db[_0xefbb('0x66')][_0xefbb('0x25')]({'where':_0x313fd1['where']})['then'](function(_0x67b449){_0xf62c22[_0xefbb('0x25')]=_0x67b449;if(_0xbcfe2f[_0xefbb('0x42')][_0xefbb('0x55')]){_0x313fd1[_0xefbb('0x51')]=[{'all':!![]}];}return db[_0xefbb('0x66')][_0xefbb('0x52')](_0x313fd1);})[_0xefbb('0x29')](function(_0x83be8e){_0xf62c22[_0xefbb('0x53')]=_0x83be8e;return _0xf62c22;});}})[_0xefbb('0x29')](respondWithFilteredResult(_0x11374b,_0x313fd1))['catch'](handleError(_0x11374b,null));};exports[_0xefbb('0x67')]=function(_0x2fd1c2,_0x28d43c,_0x8a9e87){var _0x1d0cdb={'raw':!![],'where':{}};var _0x2cdc40={};var _0x3e14a0={'count':0x0,'rows':[]};return db[_0xefbb('0x3d')][_0xefbb('0x64')]({'where':{'id':_0x2fd1c2[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x28d43c,null))['then'](function(_0x40b2d1){if(_0x40b2d1){_0x2cdc40[_0xefbb('0x41')]=_[_0xefbb('0x43')](db['CmHopperHistory']['rawAttributes']);_0x2cdc40[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x2fd1c2[_0xefbb('0x42')]);_0x2cdc40[_0xefbb('0x44')]=_['intersection'](_0x2cdc40['model'],_0x2cdc40['query']);_0x1d0cdb[_0xefbb('0x46')]=_['intersection'](_0x2cdc40[_0xefbb('0x41')],qs['fields'](_0x2fd1c2['query'][_0xefbb('0x47')]));_0x1d0cdb['attributes']=_0x1d0cdb[_0xefbb('0x46')][_0xefbb('0x48')]?_0x1d0cdb['attributes']:_0x2cdc40[_0xefbb('0x41')];if(!_0x2fd1c2['query'][_0xefbb('0x49')](_0xefbb('0x4a'))){_0x1d0cdb['limit']=qs['limit'](_0x2fd1c2[_0xefbb('0x42')][_0xefbb('0x23')]);_0x1d0cdb[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x2fd1c2[_0xefbb('0x42')][_0xefbb('0x22')]);}_0x1d0cdb[_0xefbb('0x4b')]=qs['sort'](_0x2fd1c2[_0xefbb('0x42')]['sort']);_0x1d0cdb['where']=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0x2fd1c2['query'],_0x2cdc40[_0xefbb('0x44')]));_0x1d0cdb[_0xefbb('0x4d')][_0xefbb('0x68')]=_0x40b2d1['id'];if(_0x2fd1c2['query'][_0xefbb('0x2f')]){_0x1d0cdb['where']=_[_0xefbb('0x4f')](_0x1d0cdb[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0x1d0cdb[_0xefbb('0x46')],function(_0xf0e24b){var _0x50e29c={};_0x50e29c[_0xf0e24b]={'$like':'%'+_0x2fd1c2[_0xefbb('0x42')]['filter']+'%'};return _0x50e29c;})});}_0x1d0cdb=_[_0xefbb('0x4f')]({},_0x1d0cdb,_0x2fd1c2[_0xefbb('0x5d')]);return db[_0xefbb('0x69')][_0xefbb('0x25')]({'where':_0x1d0cdb[_0xefbb('0x4d')]})['then'](function(_0x145548){_0x3e14a0[_0xefbb('0x25')]=_0x145548;if(_0x2fd1c2[_0xefbb('0x42')][_0xefbb('0x55')]){_0x1d0cdb[_0xefbb('0x51')]=[{'all':!![]}];}return db[_0xefbb('0x69')][_0xefbb('0x52')](_0x1d0cdb);})[_0xefbb('0x29')](function(_0x1ca72f){_0x3e14a0['rows']=_0x1ca72f;return _0x3e14a0;});}})['then'](respondWithFilteredResult(_0x28d43c,_0x1d0cdb))['catch'](handleError(_0x28d43c,null));};exports[_0xefbb('0x6a')]=function(_0x416c46,_0x3b2327,_0x56fae3){var _0xb2b2a8={'raw':!![],'where':{}};var _0x20c311={};var _0x3fedf0={'count':0x0,'rows':[]};return db[_0xefbb('0x3d')][_0xefbb('0x64')]({'where':{'id':_0x416c46[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x3b2327,null))[_0xefbb('0x29')](function(_0x3e58ba){if(_0x3e58ba){_0x20c311[_0xefbb('0x41')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x20c311[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x416c46[_0xefbb('0x42')]);_0x20c311[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x20c311[_0xefbb('0x41')],_0x20c311['query']);_0xb2b2a8[_0xefbb('0x46')]=_[_0xefbb('0x45')](_0x20c311[_0xefbb('0x41')],qs[_0xefbb('0x47')](_0x416c46[_0xefbb('0x42')][_0xefbb('0x47')]));_0xb2b2a8[_0xefbb('0x46')]=_0xb2b2a8[_0xefbb('0x46')][_0xefbb('0x48')]?_0xb2b2a8['attributes']:_0x20c311['model'];if(!_0x416c46[_0xefbb('0x42')][_0xefbb('0x49')](_0xefbb('0x4a'))){_0xb2b2a8[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x416c46['query'][_0xefbb('0x23')]);_0xb2b2a8[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x416c46[_0xefbb('0x42')][_0xefbb('0x22')]);}_0xb2b2a8[_0xefbb('0x4b')]=qs[_0xefbb('0x4c')](_0x416c46[_0xefbb('0x42')][_0xefbb('0x4c')]);_0xb2b2a8[_0xefbb('0x4d')]=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0x416c46[_0xefbb('0x42')],_0x20c311[_0xefbb('0x44')]));_0xb2b2a8['where']['VoiceQueueId']=_0x3e58ba['id'];if(_0x416c46['query']['filter']){_0xb2b2a8[_0xefbb('0x4d')]=_[_0xefbb('0x4f')](_0xb2b2a8[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0xb2b2a8['attributes'],function(_0x383fde){var _0x3eb720={};_0x3eb720[_0x383fde]={'$like':'%'+_0x416c46['query'][_0xefbb('0x2f')]+'%'};return _0x3eb720;})});}_0xb2b2a8=_[_0xefbb('0x4f')]({},_0xb2b2a8,_0x416c46[_0xefbb('0x5d')]);return db[_0xefbb('0x6b')][_0xefbb('0x25')]({'where':_0xb2b2a8['where']})[_0xefbb('0x29')](function(_0x257156){_0x3fedf0[_0xefbb('0x25')]=_0x257156;if(_0x416c46[_0xefbb('0x42')]['includeAll']){_0xb2b2a8['include']=[{'all':!![]}];}return db[_0xefbb('0x6b')][_0xefbb('0x52')](_0xb2b2a8);})['then'](function(_0xab6f82){_0x3fedf0[_0xefbb('0x53')]=_0xab6f82;return _0x3fedf0;});}})['then'](respondWithFilteredResult(_0x3b2327,_0xb2b2a8))[_0xefbb('0x54')](handleError(_0x3b2327,null));};exports[_0xefbb('0x6c')]=function(_0x1b4c8e,_0x580dc3,_0x3065c5){var _0x245567={'raw':!![],'where':{}};var _0x359dc4={};var _0xe677a6={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xefbb('0x64')]({'where':{'id':_0x1b4c8e[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x580dc3,null))[_0xefbb('0x29')](function(_0x9ab486){if(_0x9ab486){_0x359dc4[_0xefbb('0x41')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x359dc4[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x1b4c8e[_0xefbb('0x42')]);_0x359dc4[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x359dc4[_0xefbb('0x41')],_0x359dc4[_0xefbb('0x42')]);_0x245567['attributes']=_[_0xefbb('0x45')](_0x359dc4['model'],qs[_0xefbb('0x47')](_0x1b4c8e[_0xefbb('0x42')][_0xefbb('0x47')]));_0x245567[_0xefbb('0x46')]=_0x245567[_0xefbb('0x46')][_0xefbb('0x48')]?_0x245567[_0xefbb('0x46')]:_0x359dc4[_0xefbb('0x41')];if(!_0x1b4c8e['query'][_0xefbb('0x49')](_0xefbb('0x4a'))){_0x245567[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x1b4c8e['query'][_0xefbb('0x23')]);_0x245567['offset']=qs[_0xefbb('0x22')](_0x1b4c8e[_0xefbb('0x42')]['offset']);}_0x245567[_0xefbb('0x4b')]=qs[_0xefbb('0x4c')](_0x1b4c8e['query'][_0xefbb('0x4c')]);_0x245567[_0xefbb('0x4d')]=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0x1b4c8e[_0xefbb('0x42')],_0x359dc4[_0xefbb('0x44')]));_0x245567['where'][_0xefbb('0x68')]=_0x9ab486['id'];if(_0x1b4c8e[_0xefbb('0x42')][_0xefbb('0x2f')]){_0x245567[_0xefbb('0x4d')]=_['merge'](_0x245567[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0x245567['attributes'],function(_0x37a7aa){var _0x45f98d={};_0x45f98d[_0x37a7aa]={'$like':'%'+_0x1b4c8e[_0xefbb('0x42')][_0xefbb('0x2f')]+'%'};return _0x45f98d;})});}_0x245567=_[_0xefbb('0x4f')]({},_0x245567,_0x1b4c8e['options']);return db[_0xefbb('0x6d')][_0xefbb('0x25')]({'where':_0x245567[_0xefbb('0x4d')]})[_0xefbb('0x29')](function(_0x511835){_0xe677a6['count']=_0x511835;if(_0x1b4c8e['query'][_0xefbb('0x55')]){_0x245567[_0xefbb('0x51')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xefbb('0x52')](_0x245567);})[_0xefbb('0x29')](function(_0x3f69ca){_0xe677a6[_0xefbb('0x53')]=_0x3f69ca;return _0xe677a6;});}})[_0xefbb('0x29')](respondWithFilteredResult(_0x580dc3,_0x245567))[_0xefbb('0x54')](handleError(_0x580dc3,null));};exports[_0xefbb('0x6e')]=function(_0x2e015e,_0x4c3034,_0x33a3fa){var _0x3ede4e={};var _0x39f129={};var _0x5f0106;var _0x24c272;return db[_0xefbb('0x3d')][_0xefbb('0x64')]({'where':{'id':_0x2e015e[_0xefbb('0x65')]['id']}})['then'](handleEntityNotFound(_0x4c3034,null))[_0xefbb('0x29')](function(_0x47d181){if(_0x47d181){_0x5f0106=_0x47d181;_0x39f129['model']=_[_0xefbb('0x43')](db[_0xefbb('0x6f')][_0xefbb('0x3e')]);_0x39f129[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x2e015e[_0xefbb('0x42')]);_0x39f129[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x39f129['model'],_0x39f129[_0xefbb('0x42')]);_0x3ede4e[_0xefbb('0x46')]=_['intersection'](_0x39f129['model'],qs[_0xefbb('0x47')](_0x2e015e[_0xefbb('0x42')][_0xefbb('0x47')]));_0x3ede4e['attributes']=_0x3ede4e[_0xefbb('0x46')]['length']?_0x3ede4e[_0xefbb('0x46')]:_0x39f129[_0xefbb('0x41')];_0x3ede4e[_0xefbb('0x4b')]=qs[_0xefbb('0x4c')](_0x2e015e[_0xefbb('0x42')]['sort']);_0x3ede4e[_0xefbb('0x4d')]=qs['filters'](_[_0xefbb('0x4e')](_0x2e015e['query'],_0x39f129['filters']));if(_0x2e015e[_0xefbb('0x42')][_0xefbb('0x2f')]){_0x3ede4e[_0xefbb('0x4d')]=_['merge'](_0x3ede4e[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0x3ede4e[_0xefbb('0x46')],function(_0x173235){var _0x591027={};_0x591027[_0x173235]={'$like':'%'+_0x2e015e['query'][_0xefbb('0x2f')]+'%'};return _0x591027;})});}_0x3ede4e=_['merge']({},_0x3ede4e,_0x2e015e['options']);return _0x5f0106['getTeams'](_0x3ede4e);}})[_0xefbb('0x29')](function(_0x34086d){if(_0x34086d){_0x24c272=_0x34086d[_0xefbb('0x48')];if(!_0x2e015e[_0xefbb('0x42')][_0xefbb('0x49')]('nolimit')){_0x3ede4e[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x2e015e[_0xefbb('0x42')][_0xefbb('0x23')]);_0x3ede4e[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x2e015e[_0xefbb('0x42')][_0xefbb('0x22')]);}return _0x5f0106['getTeams'](_0x3ede4e);}})[_0xefbb('0x29')](function(_0x5c9f33){if(_0x5c9f33){return _0x5c9f33?{'count':_0x24c272,'rows':_0x5c9f33}:null;}})['then'](respondWithResult(_0x4c3034,null))[_0xefbb('0x54')](handleError(_0x4c3034,null));};exports['addTeams']=function(_0x30ea1b,_0x4ced4a,_0x5e0503){var _0x441970=_0x30ea1b[_0xefbb('0x57')]['teams'];var _0x215110=_[_0xefbb('0x30')](_0x441970,'id');return db[_0xefbb('0x6f')][_0xefbb('0x52')]({'where':{'id':_0x215110},'attributes':['id'],'include':[{'model':db[_0xefbb('0x70')],'as':'Agents','attributes':['id',_0xefbb('0x35'),_0xefbb('0x71'),'voicePause',_0xefbb('0x72')],'raw':!![]}]})[_0xefbb('0x29')](function(_0x27c7bd){if(_0x27c7bd){var _0x9bca66=_['flatMap'](_0x27c7bd,function(_0x4f308b){var _0x5a5fa8=_0x4f308b[_0xefbb('0x2a')]({'plain':!![]});_0x5a5fa8[_0xefbb('0x73')]['forEach'](function(_0x17c5c2){_0x17c5c2[_0xefbb('0x74')]=_[_0xefbb('0x34')](_0x441970,{'id':_0x5a5fa8['id']})[_0xefbb('0x74')];});return _0x5a5fa8['Agents'];});return db[_0xefbb('0x3d')]['find']({'where':{'id':_0x30ea1b['params']['id']}})['then'](function(_0x2c75bf){return db[_0xefbb('0x75')][_0xefbb('0x76')](function(_0x251c30){return _0x2c75bf[_0xefbb('0x77')](_0x215110,{'transaction':_0x251c30})[_0xefbb('0x29')](function(){return BPromise[_0xefbb('0x78')](_0x441970,function(_0x1b66bd){return db[_0xefbb('0x79')][_0xefbb('0x7a')]({'TeamId':_0x1b66bd['id'],'VoiceQueueId':_0x30ea1b[_0xefbb('0x65')]['id'],'penalty':_0x1b66bd['penalty']},{'transaction':_0x251c30});});})['then'](function(){return BPromise[_0xefbb('0x78')](_0x9bca66,function(_0x15e941){return db['UserVoiceQueue'][_0xefbb('0x7b')]({'where':{'UserId':_0x15e941['id'],'VoiceQueueId':_0x30ea1b[_0xefbb('0x65')]['id']},'defaults':{'penalty':_0x15e941[_0xefbb('0x74')]},'transaction':_0x251c30});});})[_0xefbb('0x29')](function(){return BPromise[_0xefbb('0x78')](_[_0xefbb('0x2f')](_0x9bca66,{'online':!![]}),function(_0x76d8c1){return db['UserVoiceQueueRt'][_0xefbb('0x7a')]({'membername':_0x76d8c1[_0xefbb('0x35')],'UserId':_0x76d8c1['id'],'queue_name':_0x2c75bf[_0xefbb('0x35')],'VoiceQueueId':_0x2c75bf['id'],'interface':_[_0xefbb('0x7c')](_0x76d8c1['interface'])?util[_0xefbb('0x7d')](_0xefbb('0x7e'),_0x76d8c1[_0xefbb('0x35')]):_0x76d8c1[_0xefbb('0x72')],'paused':_0x76d8c1[_0xefbb('0x7f')]||![],'penalty':_0x76d8c1[_0xefbb('0x74')]},{'transaction':_0x251c30});});})[_0xefbb('0x29')](function(){_0x9bca66[_0xefbb('0x80')](function(_0x11b484){socket[_0xefbb('0x81')]('userVoiceQueue:save',{'UserId':_0x11b484['id'],'VoiceQueueId':_0x2c75bf['id']});});});});});}})[_0xefbb('0x29')](respondWithStatusCode(_0x4ced4a,null))[_0xefbb('0x54')](handleError(_0x4ced4a,null));};exports[_0xefbb('0x82')]=function(_0x46248c,_0xa66e9b,_0x1e12fe){return db[_0xefbb('0x6f')][_0xefbb('0x52')]({'where':{'id':_0x46248c[_0xefbb('0x42')][_0xefbb('0x83')]},'attributes':['id'],'include':[{'model':db[_0xefbb('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa66e9b,null))[_0xefbb('0x29')](function(_0x48b036){var _0x4e90ff=_[_0xefbb('0x30')](_0x48b036,'id');var _0xe4df05=[];var _0x5924dc=[];var _0x4fbffc=squel['select']();_0x4fbffc[_0xefbb('0x84')](_0xefbb('0x85'))[_0xefbb('0x86')](_0xefbb('0x87'),'tq')[_0xefbb('0x88')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xefbb('0x4d')](_0xefbb('0x89'),_0x46248c[_0xefbb('0x65')]['id']);for(var _0x369b3d=0x0;_0x369b3d<_0x48b036[_0xefbb('0x48')];_0x369b3d+=0x1){let _0x92154d=_0x48b036[_0x369b3d];for(var _0x295079=0x0;_0x295079<_0x92154d[_0xefbb('0x73')]['length'];_0x295079+=0x1){let _0x1541c3=_0x92154d['Agents'][_0x295079];var _0xbe92f6=_0x4fbffc[_0xefbb('0x8a')]();_0xbe92f6['where']('ut.UserId\x20=\x20?',_0x1541c3['id']);_0x5924dc['push'](db[_0xefbb('0x75')][_0xefbb('0x42')](_0xbe92f6['toString'](),{'type':db['sequelize'][_0xefbb('0x8b')]['SELECT']})[_0xefbb('0x29')](function(_0x36d9fb){if(_0x36d9fb[_0xefbb('0x48')]===0x1){return _0x1541c3['id'];}else{var _0x211b65=_['every'](_[_0xefbb('0x30')](_0x36d9fb,'TeamId'),function(_0x2a7e7c){return _[_0xefbb('0x32')](_0x4e90ff,_0x2a7e7c);});if(_0x211b65){return _0x1541c3['id'];}}}));}}return BPromise[_0xefbb('0x8c')](_0x5924dc)[_0xefbb('0x29')](function(_0x27ba94){_0xe4df05=_(_0xe4df05)[_0xefbb('0x8d')](_0x27ba94)['compact']()[_0xefbb('0x31')]();return db[_0xefbb('0x3d')][_0xefbb('0x34')]({'where':{'id':_0x46248c[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](function(_0x595a8c){return db[_0xefbb('0x75')]['transaction'](function(_0x5162dc){return _0x595a8c['removeTeams'](_0x46248c['query'][_0xefbb('0x83')],{'transaction':_0x5162dc})[_0xefbb('0x29')](function(){if(!_[_0xefbb('0x8e')](_0xe4df05)){return _0x595a8c[_0xefbb('0x8f')](_0xe4df05,{'transaction':_0x5162dc})['then'](function(){return db['UserVoiceQueueRt'][_0xefbb('0x37')]({'where':{'VoiceQueueId':_0x46248c[_0xefbb('0x65')]['id'],'UserId':_0xe4df05},'transaction':_0x5162dc});});}})[_0xefbb('0x29')](function(){_0xe4df05[_0xefbb('0x80')](function(_0x1c38be){socket['emit']('userVoiceQueue:remove',{'UserId':_0x1c38be,'VoiceQueueId':_0x595a8c['id']});});});});});});})[_0xefbb('0x29')](respondWithStatusCode(_0xa66e9b,null))[_0xefbb('0x54')](handleError(_0xa66e9b,null));};exports[_0xefbb('0x90')]=function(_0xe5a62f,_0x135a5e,_0x92f1c){var _0x3a01cd,_0x2854a2;return db[_0xefbb('0x3d')][_0xefbb('0x34')]({'where':{'id':_0xe5a62f['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x135a5e,null))['then'](function(_0x7873){if(_0x7873){_0x2854a2=_0x7873;return _0x7873[_0xefbb('0x90')](_0xe5a62f[_0xefbb('0x57')][_0xefbb('0x83')],_[_0xefbb('0x5e')](_0xe5a62f[_0xefbb('0x57')],['ids','id'])||{})['spread'](function(_0x13ffce){for(var _0x134f43=0x0;_0x134f43<_0xe5a62f['body']['ids'][_0xefbb('0x48')];_0x134f43+=0x1){socket[_0xefbb('0x81')](_0xefbb('0x91'),{'UserId':Number(_0xe5a62f['body'][_0xefbb('0x83')][_0x134f43]),'VoiceQueueId':Number(_0xe5a62f['params']['id'])});}return _0x13ffce;});}})['then'](function(_0x202c57){_0x3a01cd=_0x202c57||[];if(_0x2854a2){return db[_0xefbb('0x70')][_0xefbb('0x52')]({'where':{'id':_0xe5a62f[_0xefbb('0x57')][_0xefbb('0x83')]},'attributes':['id',_0xefbb('0x35'),_0xefbb('0x71'),_0xefbb('0x7f'),_0xefbb('0x72')],'raw':!![]});}})[_0xefbb('0x29')](function(_0x3efc5b){if(!_['isEmpty'](_0x3efc5b)){var _0x5dd267=[];for(var _0x572748=0x0;_0x572748<_0x3efc5b[_0xefbb('0x48')];_0x572748++){if(_0x3efc5b[_0x572748][_0xefbb('0x71')]){_0x5dd267[_0xefbb('0x92')](db[_0xefbb('0x93')][_0xefbb('0x7a')]({'membername':_0x3efc5b[_0x572748][_0xefbb('0x35')],'UserId':_0x3efc5b[_0x572748]['id'],'queue_name':_0x2854a2[_0xefbb('0x35')],'VoiceQueueId':_0x2854a2['id'],'interface':_[_0xefbb('0x7c')](_0x3efc5b[_0x572748][_0xefbb('0x72')])?util[_0xefbb('0x7d')](_0xefbb('0x7e'),_0x3efc5b[_0x572748][_0xefbb('0x35')]):_0x3efc5b[_0x572748][_0xefbb('0x72')],'paused':_0x3efc5b[_0x572748]['voicePause']||![],'penalty':_0xe5a62f[_0xefbb('0x57')][_0xefbb('0x74')]||0x0}));}}return BPromise[_0xefbb('0x8c')](_0x5dd267);}})[_0xefbb('0x29')](function(){return _0x3a01cd;})[_0xefbb('0x29')](respondWithResult(_0x135a5e,null))[_0xefbb('0x54')](handleError(_0x135a5e,null));};exports[_0xefbb('0x8f')]=function(_0x582ec8,_0x1ac0da,_0x480be9){return db[_0xefbb('0x3d')][_0xefbb('0x34')]({'where':{'id':_0x582ec8[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x1ac0da,null))[_0xefbb('0x29')](function(_0x47839e){if(_0x47839e){return _0x47839e[_0xefbb('0x8f')](_0x582ec8[_0xefbb('0x42')][_0xefbb('0x83')])[_0xefbb('0x29')](function(){if(_[_0xefbb('0x94')](_0x582ec8['query'][_0xefbb('0x83')])){for(var _0x5eafb4=0x0;_0x5eafb4<_0x582ec8[_0xefbb('0x42')]['ids']['length'];_0x5eafb4+=0x1){socket[_0xefbb('0x81')](_0xefbb('0x95'),{'UserId':Number(_0x582ec8[_0xefbb('0x42')][_0xefbb('0x83')][_0x5eafb4]),'VoiceQueueId':Number(_0x582ec8[_0xefbb('0x65')]['id'])});}}else{socket[_0xefbb('0x81')](_0xefbb('0x95'),{'UserId':Number(_0x582ec8[_0xefbb('0x42')][_0xefbb('0x83')]),'VoiceQueueId':Number(_0x582ec8[_0xefbb('0x65')]['id'])});}});}})[_0xefbb('0x29')](function(_0x4ad504){return db[_0xefbb('0x93')][_0xefbb('0x37')]({'where':{'VoiceQueueId':_0x582ec8[_0xefbb('0x65')]['id'],'UserId':_0x582ec8['query']['ids']}})['then'](function(){return _0x4ad504;});})[_0xefbb('0x29')](respondWithStatusCode(_0x1ac0da,null))['catch'](handleError(_0x1ac0da,null));};exports[_0xefbb('0x96')]=function(_0x2baed3,_0xe00665,_0x12ffb8){var _0x1c6d17={};var _0x21352e={};var _0x19e3f7;var _0xf1a07;return db[_0xefbb('0x3d')][_0xefbb('0x64')]({'where':{'id':_0x2baed3['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0xe00665,null))[_0xefbb('0x29')](function(_0x47215d){if(_0x47215d){_0x19e3f7=_0x47215d;_0x21352e[_0xefbb('0x41')]=_[_0xefbb('0x43')](db['User'][_0xefbb('0x3e')]);_0x21352e[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x2baed3['query']);_0x21352e['filters']=_[_0xefbb('0x45')](_0x21352e[_0xefbb('0x41')],_0x21352e[_0xefbb('0x42')]);_0x1c6d17[_0xefbb('0x46')]=_[_0xefbb('0x45')](_0x21352e[_0xefbb('0x41')],qs[_0xefbb('0x47')](_0x2baed3[_0xefbb('0x42')][_0xefbb('0x47')]));_0x1c6d17[_0xefbb('0x46')]=_0x1c6d17[_0xefbb('0x46')][_0xefbb('0x48')]?_0x1c6d17[_0xefbb('0x46')]:_0x21352e['model'];_0x1c6d17['order']=qs[_0xefbb('0x4c')](_0x2baed3[_0xefbb('0x42')][_0xefbb('0x4c')]);_0x1c6d17[_0xefbb('0x4d')]=qs['filters'](_['pick'](_0x2baed3[_0xefbb('0x42')],_0x21352e[_0xefbb('0x44')]));if(_0x2baed3[_0xefbb('0x42')][_0xefbb('0x2f')]){_0x1c6d17[_0xefbb('0x4d')]=_[_0xefbb('0x4f')](_0x1c6d17[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0x1c6d17['attributes'],function(_0x53b8c3){var _0x256df3={};_0x256df3[_0x53b8c3]={'$like':'%'+_0x2baed3['query'][_0xefbb('0x2f')]+'%'};return _0x256df3;})});}_0x1c6d17=_[_0xefbb('0x4f')]({},_0x1c6d17,_0x2baed3[_0xefbb('0x5d')]);return _0x19e3f7['getAgents'](_0x1c6d17);}})[_0xefbb('0x29')](function(_0x291273){if(_0x291273){_0xf1a07=_0x291273[_0xefbb('0x48')];if(!_0x2baed3[_0xefbb('0x42')]['hasOwnProperty'](_0xefbb('0x4a'))){_0x1c6d17[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x2baed3[_0xefbb('0x42')][_0xefbb('0x23')]);_0x1c6d17[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x2baed3[_0xefbb('0x42')][_0xefbb('0x22')]);}return _0x19e3f7['getAgents'](_0x1c6d17);}})[_0xefbb('0x29')](function(_0x43f3c9){if(_0x43f3c9){return _0x43f3c9?{'count':_0xf1a07,'rows':_0x43f3c9}:null;}})[_0xefbb('0x29')](respondWithResult(_0xe00665,null))[_0xefbb('0x54')](handleError(_0xe00665,null));};exports[_0xefbb('0x97')]=function(_0x49b686,_0x594b34,_0xcc3e80){var _0x3e1fb4={};var _0x40ddc9={};var _0x518494;var _0xdce25a;return db[_0xefbb('0x3d')][_0xefbb('0x64')]({'where':{'id':_0x49b686['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x594b34,null))[_0xefbb('0x29')](function(_0x169ba1){if(_0x169ba1){_0x518494=_0x169ba1;_0x40ddc9['model']=_[_0xefbb('0x43')](db[_0xefbb('0x93')]['rawAttributes']);_0x40ddc9[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x49b686['query']);_0x40ddc9[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x40ddc9['model'],_0x40ddc9[_0xefbb('0x42')]);_0x3e1fb4['attributes']=_['intersection'](_0x40ddc9[_0xefbb('0x41')],qs['fields'](_0x49b686[_0xefbb('0x42')][_0xefbb('0x47')]));_0x3e1fb4['attributes']=_0x3e1fb4[_0xefbb('0x46')]['length']?_0x3e1fb4[_0xefbb('0x46')]:_0x40ddc9['model'];_0x3e1fb4[_0xefbb('0x4b')]=qs[_0xefbb('0x4c')](_0x49b686[_0xefbb('0x42')][_0xefbb('0x4c')]);_0x3e1fb4[_0xefbb('0x4d')]=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0x49b686[_0xefbb('0x42')],_0x40ddc9[_0xefbb('0x44')]));if(_0x49b686[_0xefbb('0x42')][_0xefbb('0x2f')]){_0x3e1fb4[_0xefbb('0x4d')]=_['merge'](_0x3e1fb4['where'],{'$or':_[_0xefbb('0x30')](_0x3e1fb4[_0xefbb('0x46')],function(_0x3fe966){var _0x2f849a={};_0x2f849a[_0x3fe966]={'$like':'%'+_0x49b686[_0xefbb('0x42')]['filter']+'%'};return _0x2f849a;})});}_0x3e1fb4=_[_0xefbb('0x4f')]({},_0x3e1fb4,_0x49b686['options']);return _0x518494[_0xefbb('0x97')](_0x3e1fb4);}})[_0xefbb('0x29')](function(_0x405667){if(_0x405667){_0xdce25a=_0x405667[_0xefbb('0x48')];if(!_0x49b686['query'][_0xefbb('0x49')](_0xefbb('0x4a'))){_0x3e1fb4[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x49b686[_0xefbb('0x42')]['limit']);_0x3e1fb4[_0xefbb('0x22')]=qs['offset'](_0x49b686['query'][_0xefbb('0x22')]);}return _0x518494[_0xefbb('0x97')](_0x3e1fb4);}})[_0xefbb('0x29')](function(_0x52d5e1){return _0x52d5e1?{'count':_0xdce25a,'rows':_0x52d5e1}:null;})[_0xefbb('0x29')](respondWithResult(_0x594b34,null))[_0xefbb('0x54')](handleError(_0x594b34,null));};exports[_0xefbb('0x98')]=function(_0x223837,_0xbae452,_0x4f76d7){var _0x3b1531={};var _0x4af4fe={};var _0x212237;var _0x2a66c4;return db['VoiceQueue']['findOne']({'where':{'id':_0x223837[_0xefbb('0x65')]['id']}})['then'](handleEntityNotFound(_0xbae452,null))[_0xefbb('0x29')](function(_0x1f2a55){if(_0x1f2a55){_0x212237=_0x1f2a55;_0x4af4fe[_0xefbb('0x41')]=_['keys'](db[_0xefbb('0x99')][_0xefbb('0x3e')]);_0x4af4fe['query']=_[_0xefbb('0x43')](_0x223837['query']);_0x4af4fe[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x4af4fe['model'],_0x4af4fe[_0xefbb('0x42')]);_0x3b1531[_0xefbb('0x46')]=_['intersection'](_0x4af4fe[_0xefbb('0x41')],qs[_0xefbb('0x47')](_0x223837[_0xefbb('0x42')][_0xefbb('0x47')]));_0x3b1531[_0xefbb('0x46')]=_0x3b1531[_0xefbb('0x46')][_0xefbb('0x48')]?_0x3b1531[_0xefbb('0x46')]:_0x4af4fe[_0xefbb('0x41')];_0x3b1531['order']=qs['sort'](_0x223837[_0xefbb('0x42')][_0xefbb('0x4c')]);_0x3b1531[_0xefbb('0x4d')]=qs[_0xefbb('0x44')](_[_0xefbb('0x4e')](_0x223837[_0xefbb('0x42')],_0x4af4fe['filters']));if(_0x223837['query'][_0xefbb('0x2f')]){_0x3b1531[_0xefbb('0x4d')]=_['merge'](_0x3b1531[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0x3b1531[_0xefbb('0x46')],function(_0xc2025a){var _0xc2cbe7={};_0xc2cbe7[_0xc2025a]={'$like':'%'+_0x223837['query'][_0xefbb('0x2f')]+'%'};return _0xc2cbe7;})});}_0x3b1531=_[_0xefbb('0x4f')]({},_0x3b1531,_0x223837[_0xefbb('0x5d')]);return _0x212237['getLists'](_0x3b1531);}})[_0xefbb('0x29')](function(_0x4c1b76){if(_0x4c1b76){_0x2a66c4=_0x4c1b76[_0xefbb('0x48')];if(!_0x223837[_0xefbb('0x42')][_0xefbb('0x49')]('nolimit')){_0x3b1531[_0xefbb('0x23')]=qs['limit'](_0x223837[_0xefbb('0x42')]['limit']);_0x3b1531[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x223837['query'][_0xefbb('0x22')]);}return _0x212237[_0xefbb('0x98')](_0x3b1531);}})['then'](function(_0x981d32){if(_0x981d32){return _0x981d32?{'count':_0x2a66c4,'rows':_0x981d32}:null;}})[_0xefbb('0x29')](respondWithResult(_0xbae452,null))['catch'](handleError(_0xbae452,null));};exports[_0xefbb('0x9a')]=function(_0xb665ce,_0x3f0e9d,_0xf08c1){var _0x5691bd,_0x5ab24d;return db[_0xefbb('0x3d')][_0xefbb('0x34')]({'where':{'id':_0xb665ce[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x3f0e9d,null))[_0xefbb('0x29')](function(_0x13746d){if(_0x13746d){_0x5ab24d=_0x13746d;return _0x13746d[_0xefbb('0x9a')](_0xb665ce['body']['ids'],_[_0xefbb('0x5e')](_0xb665ce[_0xefbb('0x57')],[_0xefbb('0x83'),'id'])||{});}return null;})['spread'](function(_0xb4aac1){var _0x4bb753;_0x5691bd=_0xb4aac1||[];var _0x2be7cb=[];if(_0xb4aac1){for(var _0x3950b7=0x0;_0x3950b7<_0xb4aac1[_0xefbb('0x48')];_0x3950b7+=0x1){var _0x48b1b4=_0xb4aac1[_0x3950b7][_0xefbb('0x2a')]({'plain':!![]});_0x5ab24d[_0xefbb('0x9b')]=_0xb665ce['body'][_0xefbb('0x9b')]?_0xb665ce[_0xefbb('0x57')][_0xefbb('0x9b')]:_0x5ab24d['dialCheckDuplicateType'];switch(_0x5ab24d['dialCheckDuplicateType']){case'always':_0x4bb753=squel['insert']()[_0xefbb('0x9c')](_0xefbb('0x9d'))[_0xefbb('0x9e')]([_0xefbb('0x9f'),_0xefbb('0xa0'),_0xefbb('0xa1'),'ListId','VoiceQueueId','createdAt',_0xefbb('0x60')],squel[_0xefbb('0xa2')]()[_0xefbb('0x84')](_0xefbb('0x9f'),_0xefbb('0x9f'))[_0xefbb('0x84')](_0xefbb('0xa3'),_0xefbb('0xa0'))[_0xefbb('0x84')]('id','ContactId')['field'](_0x48b1b4['CmListId'][_0xefbb('0xa4')](),_0xefbb('0xa5'))[_0xefbb('0x84')](_0xb665ce[_0xefbb('0x65')]['id'][_0xefbb('0xa4')](),_0xefbb('0x68'))[_0xefbb('0x84')]('NOW()',_0xefbb('0x5f'))['field'](_0xefbb('0xa3'),_0xefbb('0x60'))[_0xefbb('0x86')](_0xefbb('0xa6'))['where'](_0xefbb('0xa7'))[_0xefbb('0x4d')](_0xefbb('0xa8'),_0x48b1b4[_0xefbb('0xa9')][_0xefbb('0xa4')]())[_0xefbb('0x4d')]('phone\x20IS\x20NOT\x20NULL')[_0xefbb('0x4d')](_0xefbb('0xaa'),squel['select']()['field'](_0xefbb('0xab'))[_0xefbb('0x86')](_0xefbb('0xac'))[_0xefbb('0x4d')]('VoiceQueueId\x20=\x20?',_0xb665ce[_0xefbb('0x65')]['id'][_0xefbb('0xa4')]()))[_0xefbb('0x4d')](_0xefbb('0xaa'),squel['select']()[_0xefbb('0x84')](_0xefbb('0xad'))[_0xefbb('0x86')](_0xefbb('0x9d'))['where'](_0xefbb('0x89'),_0xb665ce['params']['id'][_0xefbb('0xa4')]())))[_0xefbb('0xa4')]();break;case _0xefbb('0xae'):_0x4bb753=squel[_0xefbb('0xaf')]()[_0xefbb('0x9c')](_0xefbb('0x9d'))['fromQuery']([_0xefbb('0x9f'),_0xefbb('0xa0'),'ContactId',_0xefbb('0xa5'),'VoiceQueueId',_0xefbb('0x5f'),_0xefbb('0x60')],squel[_0xefbb('0xa2')]()[_0xefbb('0x84')](_0xefbb('0x9f'),_0xefbb('0x9f'))[_0xefbb('0x84')](_0xefbb('0xa3'),'scheduledAt')['field']('id',_0xefbb('0xa1'))[_0xefbb('0x84')](_0x48b1b4[_0xefbb('0xa9')][_0xefbb('0xa4')](),_0xefbb('0xa5'))[_0xefbb('0x84')](_0xb665ce[_0xefbb('0x65')]['id'][_0xefbb('0xa4')](),_0xefbb('0x68'))[_0xefbb('0x84')](_0xefbb('0xa3'),'createdAt')[_0xefbb('0x84')](_0xefbb('0xa3'),'updatedAt')['from'](_0xefbb('0xa6'))[_0xefbb('0x4d')](_0xefbb('0xa7'))[_0xefbb('0x4d')](_0xefbb('0xa8'),_0x48b1b4[_0xefbb('0xa9')][_0xefbb('0xa4')]())[_0xefbb('0x4d')]('phone\x20IS\x20NOT\x20NULL')[_0xefbb('0x4d')](_0xefbb('0xaa'),squel[_0xefbb('0xa2')]()[_0xefbb('0x84')]('COALESCE(phone,\x27\x27)')[_0xefbb('0x86')]('cm_hopper')['where'](_0xefbb('0x89'),_0xb665ce[_0xefbb('0x65')]['id']['toString']())))[_0xefbb('0xa4')]();break;default:_0x4bb753=squel[_0xefbb('0xaf')]()[_0xefbb('0x9c')](_0xefbb('0x9d'))['fromQuery']([_0xefbb('0x9f'),'scheduledAt',_0xefbb('0xa1'),'ListId',_0xefbb('0x68'),_0xefbb('0x5f'),_0xefbb('0x60')],squel[_0xefbb('0xa2')]()['field'](_0xefbb('0x9f'),_0xefbb('0x9f'))[_0xefbb('0x84')](_0xefbb('0xa3'),'scheduledAt')[_0xefbb('0x84')]('id',_0xefbb('0xa1'))[_0xefbb('0x84')](_0x48b1b4[_0xefbb('0xa9')][_0xefbb('0xa4')](),_0xefbb('0xa5'))['field'](_0xb665ce[_0xefbb('0x65')]['id'][_0xefbb('0xa4')](),_0xefbb('0x68'))[_0xefbb('0x84')]('NOW()',_0xefbb('0x5f'))[_0xefbb('0x84')](_0xefbb('0xa3'),_0xefbb('0x60'))[_0xefbb('0x86')](_0xefbb('0xa6'))[_0xefbb('0x4d')]('deletedAt\x20IS\x20NULL')['where'](_0xefbb('0xa8'),_0x48b1b4[_0xefbb('0xa9')][_0xefbb('0xa4')]())['where'](_0xefbb('0xb0')))['toString']();}_0x2be7cb[_0xefbb('0x92')](db[_0xefbb('0x75')][_0xefbb('0x42')](_0x4bb753));}return BPromise[_0xefbb('0x8c')](_0x2be7cb);}})[_0xefbb('0x29')](function(){return _0x5691bd;})[_0xefbb('0x29')](respondWithResult(_0x3f0e9d,null))[_0xefbb('0x54')](handleError(_0x3f0e9d,null));};exports[_0xefbb('0xb1')]=function(_0x3f9f80,_0x1b8392,_0x256fc1){return db['VoiceQueue'][_0xefbb('0x34')]({'where':{'id':_0x3f9f80[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x1b8392,null))[_0xefbb('0x29')](function(_0x43e6f4){if(_0x43e6f4){return _0x43e6f4[_0xefbb('0xb1')](_0x3f9f80[_0xefbb('0x42')]['ids']);}})[_0xefbb('0x29')](function(_0x52d632){if(_0x52d632){return db[_0xefbb('0x66')][_0xefbb('0x37')]({'where':{'ListId':_0x3f9f80[_0xefbb('0x42')][_0xefbb('0x83')],'VoiceQueueId':_0x3f9f80['params']['id']}})[_0xefbb('0x29')](function(){return _0x52d632;});}})['then'](respondWithStatusCode(_0x1b8392,null))[_0xefbb('0x54')](handleError(_0x1b8392,null));};exports['getBlackLists']=function(_0x381a5b,_0x5e9ebc,_0x84bbcf){var _0x144433={};var _0x18e14d={};var _0x547404;var _0x5451c8;return db['VoiceQueue']['findOne']({'where':{'id':_0x381a5b['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x5e9ebc,null))['then'](function(_0x335489){if(_0x335489){_0x547404=_0x335489;_0x18e14d[_0xefbb('0x41')]=_['keys'](db[_0xefbb('0x99')]['rawAttributes']);_0x18e14d[_0xefbb('0x42')]=_[_0xefbb('0x43')](_0x381a5b[_0xefbb('0x42')]);_0x18e14d[_0xefbb('0x44')]=_[_0xefbb('0x45')](_0x18e14d[_0xefbb('0x41')],_0x18e14d['query']);_0x144433[_0xefbb('0x46')]=_['intersection'](_0x18e14d[_0xefbb('0x41')],qs[_0xefbb('0x47')](_0x381a5b[_0xefbb('0x42')][_0xefbb('0x47')]));_0x144433[_0xefbb('0x46')]=_0x144433[_0xefbb('0x46')][_0xefbb('0x48')]?_0x144433['attributes']:_0x18e14d['model'];_0x144433[_0xefbb('0x4b')]=qs['sort'](_0x381a5b[_0xefbb('0x42')][_0xefbb('0x4c')]);_0x144433['where']=qs['filters'](_[_0xefbb('0x4e')](_0x381a5b[_0xefbb('0x42')],_0x18e14d[_0xefbb('0x44')]));if(_0x381a5b[_0xefbb('0x42')][_0xefbb('0x2f')]){_0x144433['where']=_[_0xefbb('0x4f')](_0x144433[_0xefbb('0x4d')],{'$or':_[_0xefbb('0x30')](_0x144433[_0xefbb('0x46')],function(_0x20b19b){var _0x4fe51c={};_0x4fe51c[_0x20b19b]={'$like':'%'+_0x381a5b['query']['filter']+'%'};return _0x4fe51c;})});}_0x144433=_[_0xefbb('0x4f')]({},_0x144433,_0x381a5b[_0xefbb('0x5d')]);return _0x547404[_0xefbb('0xb2')](_0x144433);}})[_0xefbb('0x29')](function(_0x133da8){if(_0x133da8){_0x5451c8=_0x133da8[_0xefbb('0x48')];if(!_0x381a5b[_0xefbb('0x42')][_0xefbb('0x49')](_0xefbb('0x4a'))){_0x144433[_0xefbb('0x23')]=qs[_0xefbb('0x23')](_0x381a5b[_0xefbb('0x42')][_0xefbb('0x23')]);_0x144433[_0xefbb('0x22')]=qs[_0xefbb('0x22')](_0x381a5b[_0xefbb('0x42')]['offset']);}return _0x547404[_0xefbb('0xb2')](_0x144433);}})[_0xefbb('0x29')](function(_0x1789e0){if(_0x1789e0){return _0x1789e0?{'count':_0x5451c8,'rows':_0x1789e0}:null;}})[_0xefbb('0x29')](respondWithResult(_0x5e9ebc,null))[_0xefbb('0x54')](handleError(_0x5e9ebc,null));};exports[_0xefbb('0xb3')]=function(_0x443ea0,_0x558513,_0x4e06fc){var _0x374301,_0x2a003a;return db[_0xefbb('0x3d')]['find']({'where':{'id':_0x443ea0[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x558513,null))[_0xefbb('0x29')](function(_0x1aeabe){if(_0x1aeabe){_0x2a003a=_0x1aeabe;return _0x1aeabe[_0xefbb('0xb3')](_0x443ea0[_0xefbb('0x57')][_0xefbb('0x83')],_[_0xefbb('0x5e')](_0x443ea0[_0xefbb('0x57')],[_0xefbb('0x83'),'id'])||{});}return null;})[_0xefbb('0xb4')](function(_0x2f3f21){var _0x5844af;_0x374301=_0x2f3f21||[];var _0xa43857=[];if(_0x2f3f21){for(var _0x4711f1=0x0;_0x4711f1<_0x2f3f21[_0xefbb('0x48')];_0x4711f1+=0x1){var _0x338e44=_0x2f3f21[_0x4711f1][_0xefbb('0x2a')]({'plain':!![]});_0x5844af=squel[_0xefbb('0xaf')]()['into'](_0xefbb('0xb5'))[_0xefbb('0x9e')]([_0xefbb('0x9f'),_0xefbb('0xa1'),_0xefbb('0xa5'),_0xefbb('0x68'),_0xefbb('0x5f'),_0xefbb('0x60')],squel['select']()[_0xefbb('0x84')](_0xefbb('0x9f'),_0xefbb('0x9f'))[_0xefbb('0x84')]('id','ContactId')[_0xefbb('0x84')](_0x338e44['CmListId'][_0xefbb('0xa4')](),_0xefbb('0xa5'))[_0xefbb('0x84')](_0x443ea0['params']['id']['toString'](),_0xefbb('0x68'))[_0xefbb('0x84')]('NOW()',_0xefbb('0x5f'))[_0xefbb('0x84')](_0xefbb('0xa3'),_0xefbb('0x60'))[_0xefbb('0x86')](_0xefbb('0xa6'))[_0xefbb('0x4d')](_0xefbb('0xa7'))[_0xefbb('0x4d')](_0xefbb('0xa8'),_0x338e44['CmListId']['toString']())[_0xefbb('0x4d')](_0xefbb('0xb0')))[_0xefbb('0xa4')]();_0xa43857[_0xefbb('0x92')](db['sequelize'][_0xefbb('0x42')](_0x5844af));}return BPromise[_0xefbb('0x8c')](_0xa43857);}})['then'](function(){return _0x374301;})['then'](respondWithResult(_0x558513,null))[_0xefbb('0x54')](handleError(_0x558513,null));};exports[_0xefbb('0xb6')]=function(_0x2ff26f,_0x369499,_0x2478c3){return db['VoiceQueue'][_0xefbb('0x34')]({'where':{'id':_0x2ff26f['params']['id']}})[_0xefbb('0x29')](handleEntityNotFound(_0x369499,null))[_0xefbb('0x29')](function(_0x5dd7e3){if(_0x5dd7e3){return _0x5dd7e3['removeBlackLists'](_0x2ff26f['query']['ids']);}})[_0xefbb('0x29')](function(_0x5df234){if(_0x5df234){return db[_0xefbb('0x6d')]['destroy']({'where':{'ListId':_0x2ff26f['query']['ids'],'VoiceQueueId':_0x2ff26f[_0xefbb('0x65')]['id']}})[_0xefbb('0x29')](function(){return _0x5df234;});}})['then'](respondWithStatusCode(_0x369499,null))[_0xefbb('0x54')](handleError(_0x369499,null));}; \ No newline at end of file +var _0xb391=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','VoiceQueue','include','findAll','catch','show','params','intersection','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','includeAll','omit','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','VoiceQueueId','rows','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','emit','select','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','removeTeams','isEmpty','removeAgents','forEach','userVoiceQueue:remove','addAgents','ids','userVoiceQueue:save','upsert','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','NOW()','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','undefined','limit','offset','count','status','set','apply','save','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','find','type','name','UserProfileResource','destroy','error','stack','send','index','rawAttributes','key','model','query','keys','filters'];(function(_0x751a0f,_0x2b39bf){var _0x117e0c=function(_0x19b6c0){while(--_0x19b6c0){_0x751a0f['push'](_0x751a0f['shift']());}};_0x117e0c(++_0x2b39bf);}(_0xb391,0x133));var _0x1b39=function(_0x1977f1,_0x19ef5c){_0x1977f1=_0x1977f1-0x0;var _0x5185ce=_0xb391[_0x1977f1];return _0x5185ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b39('0x0'));var zipdir=require(_0x1b39('0x1'));var jsonpatch=require(_0x1b39('0x2'));var rp=require(_0x1b39('0x3'));var moment=require(_0x1b39('0x4'));var BPromise=require(_0x1b39('0x5'));var Mustache=require('mustache');var util=require(_0x1b39('0x6'));var path=require('path');var sox=require(_0x1b39('0x7'));var csv=require('to-csv');var ejs=require(_0x1b39('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b39('0x9'));var squel=require(_0x1b39('0xa'));var crypto=require(_0x1b39('0xb'));var jsforce=require(_0x1b39('0xc'));var deskjs=require(_0x1b39('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1b39('0xe'));var Papa=require(_0x1b39('0xf'));var Redis=require(_0x1b39('0x10'));var authService=require(_0x1b39('0x11'));var qs=require(_0x1b39('0x12'));var as=require(_0x1b39('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1b39('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b39('0x15'))['db'];config['redis']=_[_0x1b39('0x16')](config[_0x1b39('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b39('0x18'))(new Redis(config['redis']));require(_0x1b39('0x19'))[_0x1b39('0x1a')](socket);function respondWithStatusCode(_0x4b70d7,_0x84e14){_0x84e14=_0x84e14||0xcc;return function(_0x5d0521){if(_0x5d0521){return _0x4b70d7[_0x1b39('0x1b')](_0x84e14);}return _0x4b70d7['status'](_0x84e14)[_0x1b39('0x1c')]();};}function respondWithResult(_0x5c5437,_0x3e00ad){_0x3e00ad=_0x3e00ad||0xc8;return function(_0x2d833a){if(_0x2d833a){return _0x5c5437['status'](_0x3e00ad)[_0x1b39('0x1d')](_0x2d833a);}};}function respondWithFilteredResult(_0x349a93,_0x21ed6b){return function(_0x3617a8){if(_0x3617a8){var _0x956a35=typeof _0x21ed6b['offset']===_0x1b39('0x1e')&&typeof _0x21ed6b[_0x1b39('0x1f')]==='undefined';var _0x59c5ec=_0x3617a8['count'];var _0x368034=_0x956a35?0x0:_0x21ed6b[_0x1b39('0x20')];var _0x9b26c2=_0x956a35?_0x3617a8[_0x1b39('0x21')]:_0x21ed6b[_0x1b39('0x20')]+_0x21ed6b[_0x1b39('0x1f')];var _0x5970da;if(_0x9b26c2>=_0x59c5ec){_0x9b26c2=_0x59c5ec;_0x5970da=0xc8;}else{_0x5970da=0xce;}_0x349a93[_0x1b39('0x22')](_0x5970da);return _0x349a93[_0x1b39('0x23')]('Content-Range',_0x368034+'-'+_0x9b26c2+'/'+_0x59c5ec)[_0x1b39('0x1d')](_0x3617a8);}return null;};}function patchUpdates(_0x57b9fa){return function(_0x22224e){try{jsonpatch[_0x1b39('0x24')](_0x22224e,_0x57b9fa,!![]);}catch(_0x39fabf){return BPromise['reject'](_0x39fabf);}return _0x22224e[_0x1b39('0x25')]();};}function saveUpdates(_0x4b9a0c,_0x5af776){return function(_0x3c3be4){if(_0x3c3be4){return _0x3c3be4[_0x1b39('0x26')](_0x4b9a0c)[_0x1b39('0x27')](function(_0x1fd65c){return _0x1fd65c;});}return null;};}function removeEntity(_0x3dc27d,_0x65c8c9){return function(_0x1951ae){if(_0x1951ae){return _0x1951ae['destroy']()[_0x1b39('0x27')](function(){var _0x13287f=_0x1951ae['get']({'plain':!![]});var _0x569a31=[{'name':_0x1b39('0x28'),'value':_0x1b39('0x29'),'ignore':![]},{'name':_0x1b39('0x2a'),'value':_0x1b39('0x2b'),'ignore':![]}];var _0x191dc0=_(_0x569a31)[_0x1b39('0x2c')]('ignore')[_0x1b39('0x2d')](_0x1b39('0x2e'))['value']();if(_[_0x1b39('0x2f')](_0x191dc0,_0x13287f['type'])){return;}var _0x35fda5=_[_0x1b39('0x30')](_0x569a31,['value',_0x13287f[_0x1b39('0x31')]])[_0x1b39('0x32')];return db[_0x1b39('0x33')][_0x1b39('0x34')]({'where':{'type':_0x35fda5,'resourceId':_0x13287f['id']}})[_0x1b39('0x27')](function(){return _0x1951ae;});})['then'](function(){_0x3dc27d[_0x1b39('0x22')](0xcc)[_0x1b39('0x1c')]();});}};}function handleEntityNotFound(_0x186b6a,_0x444ade){return function(_0x2e2376){if(!_0x2e2376){_0x186b6a[_0x1b39('0x1b')](0x194);}return _0x2e2376;};}function handleError(_0x28f29c,_0x59085e){_0x59085e=_0x59085e||0x1f4;return function(_0x125851){logger[_0x1b39('0x35')](_0x125851[_0x1b39('0x36')]);if(_0x125851[_0x1b39('0x32')]){delete _0x125851[_0x1b39('0x32')];}_0x28f29c[_0x1b39('0x22')](_0x59085e)[_0x1b39('0x37')](_0x125851);};}exports[_0x1b39('0x38')]=function(_0xba9ba1,_0x269b3b){var _0x142ea8={},_0x1fbeba={},_0x29216b={'count':0x0,'rows':[]};var _0x28aaac=_[_0x1b39('0x2d')](db['VoiceQueue'][_0x1b39('0x39')],function(_0x1dc4af){return{'name':_0x1dc4af['fieldName'],'type':_0x1dc4af[_0x1b39('0x31')][_0x1b39('0x3a')]};});_0x1fbeba[_0x1b39('0x3b')]=_['map'](_0x28aaac,_0x1b39('0x32'));_0x1fbeba[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0xba9ba1['query']);_0x1fbeba[_0x1b39('0x3e')]=_['intersection'](_0x1fbeba[_0x1b39('0x3b')],_0x1fbeba[_0x1b39('0x3c')]);_0x142ea8[_0x1b39('0x3f')]=_['intersection'](_0x1fbeba[_0x1b39('0x3b')],qs['fields'](_0xba9ba1[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x142ea8[_0x1b39('0x3f')]=_0x142ea8[_0x1b39('0x3f')][_0x1b39('0x41')]?_0x142ea8['attributes']:_0x1fbeba[_0x1b39('0x3b')];if(!_0xba9ba1[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x142ea8['limit']=qs[_0x1b39('0x1f')](_0xba9ba1[_0x1b39('0x3c')]['limit']);_0x142ea8[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0xba9ba1[_0x1b39('0x3c')][_0x1b39('0x20')]);}_0x142ea8['order']=qs[_0x1b39('0x44')](_0xba9ba1['query'][_0x1b39('0x44')]);_0x142ea8[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_[_0x1b39('0x46')](_0xba9ba1['query'],_0x1fbeba[_0x1b39('0x3e')]),_0x28aaac);if(_0xba9ba1[_0x1b39('0x3c')]['filter']){_0x142ea8[_0x1b39('0x45')]=_['merge'](_0x142ea8[_0x1b39('0x45')],{'$or':_[_0x1b39('0x2d')](_0x28aaac,function(_0x156018){if(_0x156018['type']!=='VIRTUAL'){var _0x48bd8c={};_0x48bd8c[_0x156018[_0x1b39('0x32')]]={'$like':'%'+_0xba9ba1['query'][_0x1b39('0x2c')]+'%'};return _0x48bd8c;}})});}_0x142ea8=_[_0x1b39('0x47')]({},_0x142ea8,_0xba9ba1[_0x1b39('0x48')]);var _0x4d75c1={'where':_0x142ea8[_0x1b39('0x45')]};return db[_0x1b39('0x49')][_0x1b39('0x21')](_0x4d75c1)[_0x1b39('0x27')](function(_0x1f4f76){_0x29216b[_0x1b39('0x21')]=_0x1f4f76;if(_0xba9ba1[_0x1b39('0x3c')]['includeAll']){_0x142ea8[_0x1b39('0x4a')]=[{'all':!![]}];}return db[_0x1b39('0x49')][_0x1b39('0x4b')](_0x142ea8);})[_0x1b39('0x27')](function(_0x92e05b){_0x29216b['rows']=_0x92e05b;return _0x29216b;})[_0x1b39('0x27')](respondWithFilteredResult(_0x269b3b,_0x142ea8))[_0x1b39('0x4c')](handleError(_0x269b3b,null));};exports[_0x1b39('0x4d')]=function(_0x493625,_0x2389ce){var _0x49c60d={'raw':![],'where':{'id':_0x493625[_0x1b39('0x4e')]['id']}},_0x4be416={};_0x4be416[_0x1b39('0x3b')]=_[_0x1b39('0x3d')](db['VoiceQueue'][_0x1b39('0x39')]);_0x4be416['query']=_[_0x1b39('0x3d')](_0x493625[_0x1b39('0x3c')]);_0x4be416[_0x1b39('0x3e')]=_['intersection'](_0x4be416[_0x1b39('0x3b')],_0x4be416[_0x1b39('0x3c')]);_0x49c60d[_0x1b39('0x3f')]=_[_0x1b39('0x4f')](_0x4be416['model'],qs[_0x1b39('0x40')](_0x493625['query'][_0x1b39('0x40')]));_0x49c60d['attributes']=_0x49c60d[_0x1b39('0x3f')][_0x1b39('0x41')]?_0x49c60d[_0x1b39('0x3f')]:_0x4be416['model'];if(_0x493625[_0x1b39('0x3c')]['includeAll']){_0x49c60d[_0x1b39('0x4a')]=[{'all':!![]}];}_0x49c60d=_[_0x1b39('0x47')]({},_0x49c60d,_0x493625[_0x1b39('0x48')]);return db['VoiceQueue'][_0x1b39('0x30')](_0x49c60d)['then'](handleEntityNotFound(_0x2389ce,null))[_0x1b39('0x27')](respondWithResult(_0x2389ce,null))[_0x1b39('0x4c')](handleError(_0x2389ce,null));};exports['create']=function(_0x47694c,_0xa53e1d){return db['VoiceQueue'][_0x1b39('0x50')](_0x47694c['body'],{})[_0x1b39('0x27')](function(_0x4778a4){var _0x3ce5a6=_0x47694c[_0x1b39('0x51')][_0x1b39('0x52')]({'plain':!![]});if(!_0x3ce5a6)throw new Error(_0x1b39('0x53'));if(_0x3ce5a6[_0x1b39('0x54')]==='user'){var _0x402edf=_0x4778a4[_0x1b39('0x52')]({'plain':!![]});var _0x2a25b7=[{'name':_0x1b39('0x28'),'value':_0x1b39('0x29')},{'name':_0x1b39('0x2a'),'value':'outbound'}];var _0x5b90b2=_['find'](_0x2a25b7,[_0x1b39('0x2e'),_0x402edf['type']])[_0x1b39('0x32')];return db[_0x1b39('0x55')][_0x1b39('0x30')]({'where':{'name':_0x5b90b2,'userProfileId':_0x3ce5a6[_0x1b39('0x56')]},'raw':!![]})[_0x1b39('0x27')](function(_0x3ac159){if(_0x3ac159&&_0x3ac159['autoAssociation']===0x0){return db[_0x1b39('0x33')][_0x1b39('0x50')]({'name':_0x402edf[_0x1b39('0x32')],'resourceId':_0x402edf['id'],'type':_0x3ac159[_0x1b39('0x32')],'sectionId':_0x3ac159['id']},{})['then'](function(){return _0x4778a4;});}else{return _0x4778a4;}})['catch'](function(_0x5f493a){logger[_0x1b39('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f493a);throw _0x5f493a;});}return _0x4778a4;})[_0x1b39('0x27')](respondWithResult(_0xa53e1d,0xc9))[_0x1b39('0x4c')](handleError(_0xa53e1d,null));};exports['clone']=function(_0x1d0f83,_0x542b61){var _0x1f4d0a={'where':{'id':_0x1d0f83[_0x1b39('0x4e')]['id']}},_0x111883={};_0x111883[_0x1b39('0x3b')]=_['keys'](db[_0x1b39('0x49')][_0x1b39('0x39')]);_0x1f4d0a['attributes']=_[_0x1b39('0x4f')](_0x111883[_0x1b39('0x3b')],qs[_0x1b39('0x40')](_0x1d0f83[_0x1b39('0x3c')]['fields']));_0x1f4d0a[_0x1b39('0x3f')]=_0x1f4d0a[_0x1b39('0x3f')][_0x1b39('0x41')]?_0x1f4d0a[_0x1b39('0x3f')]:_0x111883['model'];if(_0x1d0f83[_0x1b39('0x3c')][_0x1b39('0x57')]){_0x1f4d0a['include']=[{'all':!![]}];}_0x1f4d0a=_[_0x1b39('0x47')]({},_0x1f4d0a,_0x1d0f83[_0x1b39('0x48')]);return db[_0x1b39('0x49')]['find'](_0x1f4d0a)['then'](handleEntityNotFound(_0x542b61,null))['then'](function(_0xb79104){if(_0xb79104){var _0x1852df=_0xb79104[_0x1b39('0x52')]({'plain':!![]});_0x1852df=qs[_0x1b39('0x58')](_0x1852df,['id',_0x1b39('0x59'),_0x1b39('0x5a')]);_0x1d0f83['body']=_[_0x1b39('0x58')](_0x1d0f83[_0x1b39('0x5b')],['id','createdAt',_0x1b39('0x5a')]);return db[_0x1b39('0x49')]['create'](_[_0x1b39('0x47')](_0x1852df,_0x1d0f83[_0x1b39('0x5b')]),{'include':_0x1d0f83[_0x1b39('0x3c')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x423944){var _0x10552b=_0x1d0f83['user'][_0x1b39('0x52')]({'plain':!![]});if(!_0x10552b)throw new Error(_0x1b39('0x53'));if(_0x10552b[_0x1b39('0x54')]===_0x1b39('0x51')){var _0x548a85=_0x423944[_0x1b39('0x52')]({'plain':!![]});var _0xb537b0=[{'name':_0x1b39('0x28'),'value':'inbound'},{'name':_0x1b39('0x2a'),'value':_0x1b39('0x2b')}];var _0x5c5bc8=_[_0x1b39('0x30')](_0xb537b0,[_0x1b39('0x2e'),_0x548a85[_0x1b39('0x31')]])['name'];return db[_0x1b39('0x55')][_0x1b39('0x30')]({'where':{'name':_0x5c5bc8,'userProfileId':_0x10552b[_0x1b39('0x56')]},'raw':!![]})[_0x1b39('0x27')](function(_0x2dd210){if(_0x2dd210&&_0x2dd210[_0x1b39('0x5c')]===0x0){return db[_0x1b39('0x33')][_0x1b39('0x50')]({'name':_0x548a85['name'],'resourceId':_0x548a85['id'],'type':_0x2dd210[_0x1b39('0x32')],'sectionId':_0x2dd210['id']},{})[_0x1b39('0x27')](function(){return _0x423944;});}else{return _0x423944;}})['catch'](function(_0x5e1e67){logger['error'](_0x1b39('0x5d'),_0x5e1e67);throw _0x5e1e67;});}return _0x423944;});}})['then'](respondWithResult(_0x542b61,0xc9))[_0x1b39('0x4c')](handleError(_0x542b61,null));};exports[_0x1b39('0x26')]=function(_0x369ecd,_0x102e62){if(_0x369ecd[_0x1b39('0x5b')]['id']){delete _0x369ecd[_0x1b39('0x5b')]['id'];}return db['VoiceQueue'][_0x1b39('0x30')]({'where':{'id':_0x369ecd[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x102e62,null))[_0x1b39('0x27')](saveUpdates(_0x369ecd['body'],null))[_0x1b39('0x27')](respondWithResult(_0x102e62,null))[_0x1b39('0x4c')](handleError(_0x102e62,null));};exports['destroy']=function(_0x4d1762,_0x117c8e){return db[_0x1b39('0x49')]['find']({'where':{'id':_0x4d1762[_0x1b39('0x4e')]['id']}})['then'](handleEntityNotFound(_0x117c8e,null))[_0x1b39('0x27')](removeEntity(_0x117c8e,null))[_0x1b39('0x4c')](handleError(_0x117c8e,null));};exports[_0x1b39('0x5e')]=function(_0x5d33d1,_0x223b60,_0x492ac2){var _0x5ddc03={'raw':![],'where':{}};var _0x123b38={};var _0x544786={'count':0x0,'rows':[]};return db[_0x1b39('0x49')]['findOne']({'where':{'id':_0x5d33d1[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x223b60,null))['then'](function(_0xaee37b){if(_0xaee37b){_0x123b38[_0x1b39('0x3b')]=_['keys'](db[_0x1b39('0x5f')]['rawAttributes']);_0x123b38[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x5d33d1['query']);_0x123b38[_0x1b39('0x3e')]=_[_0x1b39('0x4f')](_0x123b38[_0x1b39('0x3b')],_0x123b38[_0x1b39('0x3c')]);_0x5ddc03[_0x1b39('0x3f')]=_[_0x1b39('0x4f')](_0x123b38[_0x1b39('0x3b')],qs[_0x1b39('0x40')](_0x5d33d1[_0x1b39('0x3c')]['fields']));_0x5ddc03[_0x1b39('0x3f')]=_0x5ddc03[_0x1b39('0x3f')]['length']?_0x5ddc03[_0x1b39('0x3f')]:_0x123b38[_0x1b39('0x3b')];if(!_0x5d33d1['query'][_0x1b39('0x42')](_0x1b39('0x43'))){_0x5ddc03[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x5d33d1['query'][_0x1b39('0x1f')]);_0x5ddc03[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0x5d33d1['query'][_0x1b39('0x20')]);}_0x5ddc03['order']=qs['sort'](_0x5d33d1[_0x1b39('0x3c')][_0x1b39('0x44')]);_0x5ddc03[_0x1b39('0x45')]=qs['filters'](_[_0x1b39('0x46')](_0x5d33d1[_0x1b39('0x3c')],_0x123b38[_0x1b39('0x3e')]));_0x5ddc03[_0x1b39('0x45')][_0x1b39('0x60')]=_0xaee37b['id'];if(_0x5d33d1[_0x1b39('0x3c')]['filter']){_0x5ddc03[_0x1b39('0x45')]=_['merge'](_0x5ddc03['where'],{'$or':_[_0x1b39('0x2d')](_0x5ddc03[_0x1b39('0x3f')],function(_0x26079c){var _0x37216f={};_0x37216f[_0x26079c]={'$like':'%'+_0x5d33d1[_0x1b39('0x3c')][_0x1b39('0x2c')]+'%'};return _0x37216f;})});}_0x5ddc03=_[_0x1b39('0x47')]({},_0x5ddc03,_0x5d33d1[_0x1b39('0x48')]);return db[_0x1b39('0x5f')]['count']({'where':_0x5ddc03[_0x1b39('0x45')]})['then'](function(_0x597d8e){_0x544786[_0x1b39('0x21')]=_0x597d8e;if(_0x5d33d1['query'][_0x1b39('0x57')]){_0x5ddc03['include']=[{'all':!![]}];}return db[_0x1b39('0x5f')]['findAll'](_0x5ddc03);})[_0x1b39('0x27')](function(_0x5aaadc){_0x544786[_0x1b39('0x61')]=_0x5aaadc;return _0x544786;});}})['then'](respondWithFilteredResult(_0x223b60,_0x5ddc03))['catch'](handleError(_0x223b60,null));};exports[_0x1b39('0x62')]=function(_0x7ce39b,_0x32e570,_0x4365fb){var _0x50b0c5={'raw':!![],'where':{}};var _0x314277={};var _0x36b485={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1b39('0x63')]({'where':{'id':_0x7ce39b['params']['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x32e570,null))[_0x1b39('0x27')](function(_0x84e6fa){if(_0x84e6fa){_0x314277[_0x1b39('0x3b')]=_[_0x1b39('0x3d')](db['CmHopperHistory']['rawAttributes']);_0x314277['query']=_[_0x1b39('0x3d')](_0x7ce39b[_0x1b39('0x3c')]);_0x314277[_0x1b39('0x3e')]=_['intersection'](_0x314277['model'],_0x314277[_0x1b39('0x3c')]);_0x50b0c5[_0x1b39('0x3f')]=_['intersection'](_0x314277[_0x1b39('0x3b')],qs['fields'](_0x7ce39b[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x50b0c5[_0x1b39('0x3f')]=_0x50b0c5['attributes'][_0x1b39('0x41')]?_0x50b0c5['attributes']:_0x314277[_0x1b39('0x3b')];if(!_0x7ce39b[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x50b0c5[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x7ce39b[_0x1b39('0x3c')][_0x1b39('0x1f')]);_0x50b0c5[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0x7ce39b['query'][_0x1b39('0x20')]);}_0x50b0c5['order']=qs['sort'](_0x7ce39b[_0x1b39('0x3c')][_0x1b39('0x44')]);_0x50b0c5[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_[_0x1b39('0x46')](_0x7ce39b[_0x1b39('0x3c')],_0x314277['filters']));_0x50b0c5[_0x1b39('0x45')][_0x1b39('0x60')]=_0x84e6fa['id'];if(_0x7ce39b['query'][_0x1b39('0x2c')]){_0x50b0c5['where']=_['merge'](_0x50b0c5[_0x1b39('0x45')],{'$or':_[_0x1b39('0x2d')](_0x50b0c5[_0x1b39('0x3f')],function(_0x1e0c8e){var _0x35361f={};_0x35361f[_0x1e0c8e]={'$like':'%'+_0x7ce39b[_0x1b39('0x3c')]['filter']+'%'};return _0x35361f;})});}_0x50b0c5=_[_0x1b39('0x47')]({},_0x50b0c5,_0x7ce39b[_0x1b39('0x48')]);return db[_0x1b39('0x64')][_0x1b39('0x21')]({'where':_0x50b0c5[_0x1b39('0x45')]})['then'](function(_0xd620e2){_0x36b485['count']=_0xd620e2;if(_0x7ce39b['query'][_0x1b39('0x57')]){_0x50b0c5[_0x1b39('0x4a')]=[{'all':!![]}];}return db[_0x1b39('0x64')][_0x1b39('0x4b')](_0x50b0c5);})[_0x1b39('0x27')](function(_0x466c8d){_0x36b485[_0x1b39('0x61')]=_0x466c8d;return _0x36b485;});}})[_0x1b39('0x27')](respondWithFilteredResult(_0x32e570,_0x50b0c5))[_0x1b39('0x4c')](handleError(_0x32e570,null));};exports['getHopperFinals']=function(_0x26e2d1,_0x460396,_0x526ea6){var _0x21ac12={'raw':!![],'where':{}};var _0x4f4f2f={};var _0x16ccd0={'count':0x0,'rows':[]};return db[_0x1b39('0x49')]['findOne']({'where':{'id':_0x26e2d1[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x460396,null))[_0x1b39('0x27')](function(_0x289a47){if(_0x289a47){_0x4f4f2f['model']=_[_0x1b39('0x3d')](db[_0x1b39('0x65')][_0x1b39('0x39')]);_0x4f4f2f[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x26e2d1[_0x1b39('0x3c')]);_0x4f4f2f[_0x1b39('0x3e')]=_[_0x1b39('0x4f')](_0x4f4f2f[_0x1b39('0x3b')],_0x4f4f2f[_0x1b39('0x3c')]);_0x21ac12['attributes']=_[_0x1b39('0x4f')](_0x4f4f2f['model'],qs['fields'](_0x26e2d1[_0x1b39('0x3c')]['fields']));_0x21ac12[_0x1b39('0x3f')]=_0x21ac12[_0x1b39('0x3f')][_0x1b39('0x41')]?_0x21ac12[_0x1b39('0x3f')]:_0x4f4f2f[_0x1b39('0x3b')];if(!_0x26e2d1[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x21ac12[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x26e2d1['query'][_0x1b39('0x1f')]);_0x21ac12[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0x26e2d1[_0x1b39('0x3c')][_0x1b39('0x20')]);}_0x21ac12[_0x1b39('0x66')]=qs['sort'](_0x26e2d1[_0x1b39('0x3c')]['sort']);_0x21ac12[_0x1b39('0x45')]=qs['filters'](_[_0x1b39('0x46')](_0x26e2d1[_0x1b39('0x3c')],_0x4f4f2f['filters']));_0x21ac12[_0x1b39('0x45')][_0x1b39('0x60')]=_0x289a47['id'];if(_0x26e2d1[_0x1b39('0x3c')]['filter']){_0x21ac12['where']=_['merge'](_0x21ac12['where'],{'$or':_[_0x1b39('0x2d')](_0x21ac12['attributes'],function(_0x185d86){var _0x1e7f28={};_0x1e7f28[_0x185d86]={'$like':'%'+_0x26e2d1['query'][_0x1b39('0x2c')]+'%'};return _0x1e7f28;})});}_0x21ac12=_[_0x1b39('0x47')]({},_0x21ac12,_0x26e2d1[_0x1b39('0x48')]);return db[_0x1b39('0x65')]['count']({'where':_0x21ac12['where']})[_0x1b39('0x27')](function(_0x154e3d){_0x16ccd0['count']=_0x154e3d;if(_0x26e2d1['query'][_0x1b39('0x57')]){_0x21ac12[_0x1b39('0x4a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x1b39('0x4b')](_0x21ac12);})[_0x1b39('0x27')](function(_0x34a16c){_0x16ccd0[_0x1b39('0x61')]=_0x34a16c;return _0x16ccd0;});}})[_0x1b39('0x27')](respondWithFilteredResult(_0x460396,_0x21ac12))[_0x1b39('0x4c')](handleError(_0x460396,null));};exports[_0x1b39('0x67')]=function(_0x3bfa9e,_0x1e7156,_0x574041){var _0x439d7={'raw':!![],'where':{}};var _0x2a9fbf={};var _0x26d2b0={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1b39('0x63')]({'where':{'id':_0x3bfa9e[_0x1b39('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1e7156,null))['then'](function(_0x42d35b){if(_0x42d35b){_0x2a9fbf['model']=_[_0x1b39('0x3d')](db['CmHopperBlack']['rawAttributes']);_0x2a9fbf[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x3bfa9e['query']);_0x2a9fbf[_0x1b39('0x3e')]=_[_0x1b39('0x4f')](_0x2a9fbf[_0x1b39('0x3b')],_0x2a9fbf[_0x1b39('0x3c')]);_0x439d7[_0x1b39('0x3f')]=_[_0x1b39('0x4f')](_0x2a9fbf[_0x1b39('0x3b')],qs[_0x1b39('0x40')](_0x3bfa9e[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x439d7[_0x1b39('0x3f')]=_0x439d7[_0x1b39('0x3f')][_0x1b39('0x41')]?_0x439d7['attributes']:_0x2a9fbf[_0x1b39('0x3b')];if(!_0x3bfa9e[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x439d7[_0x1b39('0x1f')]=qs['limit'](_0x3bfa9e[_0x1b39('0x3c')]['limit']);_0x439d7['offset']=qs[_0x1b39('0x20')](_0x3bfa9e[_0x1b39('0x3c')][_0x1b39('0x20')]);}_0x439d7[_0x1b39('0x66')]=qs[_0x1b39('0x44')](_0x3bfa9e[_0x1b39('0x3c')]['sort']);_0x439d7[_0x1b39('0x45')]=qs['filters'](_[_0x1b39('0x46')](_0x3bfa9e[_0x1b39('0x3c')],_0x2a9fbf[_0x1b39('0x3e')]));_0x439d7[_0x1b39('0x45')]['VoiceQueueId']=_0x42d35b['id'];if(_0x3bfa9e[_0x1b39('0x3c')]['filter']){_0x439d7[_0x1b39('0x45')]=_[_0x1b39('0x47')](_0x439d7[_0x1b39('0x45')],{'$or':_[_0x1b39('0x2d')](_0x439d7['attributes'],function(_0x4aae49){var _0x486f38={};_0x486f38[_0x4aae49]={'$like':'%'+_0x3bfa9e[_0x1b39('0x3c')]['filter']+'%'};return _0x486f38;})});}_0x439d7=_['merge']({},_0x439d7,_0x3bfa9e[_0x1b39('0x48')]);return db['CmHopperBlack']['count']({'where':_0x439d7[_0x1b39('0x45')]})['then'](function(_0x56ef40){_0x26d2b0['count']=_0x56ef40;if(_0x3bfa9e[_0x1b39('0x3c')][_0x1b39('0x57')]){_0x439d7['include']=[{'all':!![]}];}return db[_0x1b39('0x68')]['findAll'](_0x439d7);})[_0x1b39('0x27')](function(_0x1a29ef){_0x26d2b0[_0x1b39('0x61')]=_0x1a29ef;return _0x26d2b0;});}})['then'](respondWithFilteredResult(_0x1e7156,_0x439d7))[_0x1b39('0x4c')](handleError(_0x1e7156,null));};exports[_0x1b39('0x69')]=function(_0x3788ef,_0x3b69b7,_0x1df8cf){var _0x3b06dd={};var _0x366306={};var _0x2469f9;var _0x311df6;return db['VoiceQueue']['findOne']({'where':{'id':_0x3788ef[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x3b69b7,null))['then'](function(_0x3a56a0){if(_0x3a56a0){_0x2469f9=_0x3a56a0;_0x366306['model']=_[_0x1b39('0x3d')](db['Team'][_0x1b39('0x39')]);_0x366306['query']=_['keys'](_0x3788ef[_0x1b39('0x3c')]);_0x366306[_0x1b39('0x3e')]=_[_0x1b39('0x4f')](_0x366306[_0x1b39('0x3b')],_0x366306['query']);_0x3b06dd[_0x1b39('0x3f')]=_['intersection'](_0x366306[_0x1b39('0x3b')],qs['fields'](_0x3788ef[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x3b06dd['attributes']=_0x3b06dd[_0x1b39('0x3f')]['length']?_0x3b06dd[_0x1b39('0x3f')]:_0x366306[_0x1b39('0x3b')];_0x3b06dd[_0x1b39('0x66')]=qs[_0x1b39('0x44')](_0x3788ef['query']['sort']);_0x3b06dd[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_[_0x1b39('0x46')](_0x3788ef['query'],_0x366306[_0x1b39('0x3e')]));if(_0x3788ef['query'][_0x1b39('0x2c')]){_0x3b06dd[_0x1b39('0x45')]=_[_0x1b39('0x47')](_0x3b06dd[_0x1b39('0x45')],{'$or':_[_0x1b39('0x2d')](_0x3b06dd['attributes'],function(_0x1b5a7e){var _0x5c188b={};_0x5c188b[_0x1b5a7e]={'$like':'%'+_0x3788ef[_0x1b39('0x3c')][_0x1b39('0x2c')]+'%'};return _0x5c188b;})});}_0x3b06dd=_[_0x1b39('0x47')]({},_0x3b06dd,_0x3788ef[_0x1b39('0x48')]);return _0x2469f9[_0x1b39('0x69')](_0x3b06dd);}})[_0x1b39('0x27')](function(_0xec2069){if(_0xec2069){_0x311df6=_0xec2069[_0x1b39('0x41')];if(!_0x3788ef[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x3b06dd[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x3788ef[_0x1b39('0x3c')][_0x1b39('0x1f')]);_0x3b06dd['offset']=qs[_0x1b39('0x20')](_0x3788ef[_0x1b39('0x3c')]['offset']);}return _0x2469f9[_0x1b39('0x69')](_0x3b06dd);}})[_0x1b39('0x27')](function(_0x41f3bc){if(_0x41f3bc){return _0x41f3bc?{'count':_0x311df6,'rows':_0x41f3bc}:null;}})['then'](respondWithResult(_0x3b69b7,null))[_0x1b39('0x4c')](handleError(_0x3b69b7,null));};exports['addTeams']=function(_0x49bb3d,_0x57a32a,_0x2f5d2e){var _0x17198d=_0x49bb3d[_0x1b39('0x5b')][_0x1b39('0x6a')];var _0x4564db=_[_0x1b39('0x2d')](_0x17198d,'id');return db[_0x1b39('0x6b')][_0x1b39('0x4b')]({'where':{'id':_0x4564db},'attributes':['id'],'include':[{'model':db[_0x1b39('0x6c')],'as':_0x1b39('0x6d'),'attributes':['id',_0x1b39('0x32'),_0x1b39('0x6e'),_0x1b39('0x6f'),_0x1b39('0x70')],'raw':!![]}]})[_0x1b39('0x27')](function(_0xa0a841){if(_0xa0a841){var _0xd5cfd2=_[_0x1b39('0x71')](_0xa0a841,function(_0x5db236){var _0x9d361=_0x5db236['get']({'plain':!![]});_0x9d361[_0x1b39('0x6d')]['forEach'](function(_0x26ab4e){_0x26ab4e[_0x1b39('0x72')]=_[_0x1b39('0x30')](_0x17198d,{'id':_0x9d361['id']})[_0x1b39('0x72')];});return _0x9d361[_0x1b39('0x6d')];});return db[_0x1b39('0x49')][_0x1b39('0x30')]({'where':{'id':_0x49bb3d['params']['id']}})[_0x1b39('0x27')](function(_0x2e650d){return db[_0x1b39('0x73')][_0x1b39('0x74')](function(_0x1b8911){return _0x2e650d[_0x1b39('0x75')](_0x4564db,{'transaction':_0x1b8911})[_0x1b39('0x27')](function(){return BPromise[_0x1b39('0x76')](_0x17198d,function(_0xfa1c3){return db[_0x1b39('0x77')]['upsert']({'TeamId':_0xfa1c3['id'],'VoiceQueueId':_0x49bb3d[_0x1b39('0x4e')]['id'],'penalty':_0xfa1c3[_0x1b39('0x72')]},{'transaction':_0x1b8911});});})[_0x1b39('0x27')](function(){return BPromise['each'](_0xd5cfd2,function(_0x4bade2){return db[_0x1b39('0x78')]['findOrCreate']({'where':{'UserId':_0x4bade2['id'],'VoiceQueueId':_0x49bb3d[_0x1b39('0x4e')]['id']},'defaults':{'penalty':_0x4bade2[_0x1b39('0x72')]},'transaction':_0x1b8911});});})[_0x1b39('0x27')](function(){return BPromise['each'](_[_0x1b39('0x2c')](_0xd5cfd2,{'online':!![]}),function(_0x59c8d7){return db[_0x1b39('0x79')]['upsert']({'membername':_0x59c8d7[_0x1b39('0x32')],'UserId':_0x59c8d7['id'],'queue_name':_0x2e650d[_0x1b39('0x32')],'VoiceQueueId':_0x2e650d['id'],'interface':_[_0x1b39('0x7a')](_0x59c8d7[_0x1b39('0x70')])?util[_0x1b39('0x7b')](_0x1b39('0x7c'),_0x59c8d7[_0x1b39('0x32')]):_0x59c8d7['interface'],'paused':_0x59c8d7[_0x1b39('0x6f')]||![],'penalty':_0x59c8d7[_0x1b39('0x72')]},{'transaction':_0x1b8911});});})['then'](function(){_0xd5cfd2['forEach'](function(_0xeb7e5f){socket[_0x1b39('0x7d')]('userVoiceQueue:save',{'UserId':_0xeb7e5f['id'],'VoiceQueueId':_0x2e650d['id']});});});});});}})[_0x1b39('0x27')](respondWithStatusCode(_0x57a32a,null))['catch'](handleError(_0x57a32a,null));};exports['removeTeams']=function(_0x544569,_0x4ada9a,_0x4959db){return db[_0x1b39('0x6b')][_0x1b39('0x4b')]({'where':{'id':_0x544569['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x1b39('0x6c')],'as':_0x1b39('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x1b39('0x27')](handleEntityNotFound(_0x4ada9a,null))[_0x1b39('0x27')](function(_0x4c1098){var _0x50973e=_['map'](_0x4c1098,'id');var _0x25f49e=[];var _0x3fb6ee=[];var _0x583cee=squel[_0x1b39('0x7e')]();_0x583cee['field']('tq.TeamId')[_0x1b39('0x7f')](_0x1b39('0x80'),'tq')[_0x1b39('0x81')](_0x1b39('0x82'),'ut',_0x1b39('0x83'))[_0x1b39('0x45')](_0x1b39('0x84'),_0x544569[_0x1b39('0x4e')]['id']);for(var _0x1a267a=0x0;_0x1a267a<_0x4c1098[_0x1b39('0x41')];_0x1a267a+=0x1){let _0x2fcf1f=_0x4c1098[_0x1a267a];for(var _0x26f212=0x0;_0x26f212<_0x2fcf1f[_0x1b39('0x6d')][_0x1b39('0x41')];_0x26f212+=0x1){let _0x127bde=_0x2fcf1f[_0x1b39('0x6d')][_0x26f212];var _0x5716d2=_0x583cee['clone']();_0x5716d2[_0x1b39('0x45')](_0x1b39('0x85'),_0x127bde['id']);_0x3fb6ee[_0x1b39('0x86')](db['sequelize']['query'](_0x5716d2['toString'](),{'type':db[_0x1b39('0x73')][_0x1b39('0x87')][_0x1b39('0x88')]})[_0x1b39('0x27')](function(_0x492cc0){if(_0x492cc0['length']===0x1){return _0x127bde['id'];}else{var _0x2f65ea=_[_0x1b39('0x89')](_[_0x1b39('0x2d')](_0x492cc0,'TeamId'),function(_0x4448c6){return _['includes'](_0x50973e,_0x4448c6);});if(_0x2f65ea){return _0x127bde['id'];}}}));}}return BPromise[_0x1b39('0x8a')](_0x3fb6ee)[_0x1b39('0x27')](function(_0x977175){_0x25f49e=_(_0x25f49e)[_0x1b39('0x8b')](_0x977175)[_0x1b39('0x8c')]()[_0x1b39('0x2e')]();return db[_0x1b39('0x49')][_0x1b39('0x30')]({'where':{'id':_0x544569[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](function(_0x24a810){return db[_0x1b39('0x73')][_0x1b39('0x74')](function(_0x34fd41){return _0x24a810[_0x1b39('0x8d')](_0x544569[_0x1b39('0x3c')]['ids'],{'transaction':_0x34fd41})[_0x1b39('0x27')](function(){if(!_[_0x1b39('0x8e')](_0x25f49e)){return _0x24a810[_0x1b39('0x8f')](_0x25f49e,{'transaction':_0x34fd41})['then'](function(){return db[_0x1b39('0x79')][_0x1b39('0x34')]({'where':{'VoiceQueueId':_0x544569[_0x1b39('0x4e')]['id'],'UserId':_0x25f49e},'transaction':_0x34fd41});});}})['then'](function(){_0x25f49e[_0x1b39('0x90')](function(_0x297475){socket[_0x1b39('0x7d')](_0x1b39('0x91'),{'UserId':_0x297475,'VoiceQueueId':_0x24a810['id']});});});});});});})[_0x1b39('0x27')](respondWithStatusCode(_0x4ada9a,null))[_0x1b39('0x4c')](handleError(_0x4ada9a,null));};exports[_0x1b39('0x92')]=function(_0x29305a,_0x31334a,_0x2256c3){var _0x4b1c8f,_0x4900ef;return db['VoiceQueue'][_0x1b39('0x30')]({'where':{'id':_0x29305a[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x31334a,null))[_0x1b39('0x27')](function(_0x52d205){if(_0x52d205){_0x4900ef=_0x52d205;return _0x52d205[_0x1b39('0x92')](_0x29305a[_0x1b39('0x5b')][_0x1b39('0x93')],_['omit'](_0x29305a[_0x1b39('0x5b')],['ids','id'])||{})['spread'](function(_0x4af190){for(var _0x2c5ed5=0x0;_0x2c5ed5<_0x29305a[_0x1b39('0x5b')][_0x1b39('0x93')][_0x1b39('0x41')];_0x2c5ed5+=0x1){socket[_0x1b39('0x7d')](_0x1b39('0x94'),{'UserId':Number(_0x29305a['body'][_0x1b39('0x93')][_0x2c5ed5]),'VoiceQueueId':Number(_0x29305a[_0x1b39('0x4e')]['id'])});}return _0x4af190;});}})[_0x1b39('0x27')](function(_0x10625a){_0x4b1c8f=_0x10625a||[];if(_0x4900ef){return db['User']['findAll']({'where':{'id':_0x29305a['body'][_0x1b39('0x93')]},'attributes':['id','name',_0x1b39('0x6e'),_0x1b39('0x6f'),_0x1b39('0x70')],'raw':!![]});}})[_0x1b39('0x27')](function(_0xdcd5b4){if(!_[_0x1b39('0x8e')](_0xdcd5b4)){var _0x76ae9=[];for(var _0x91d845=0x0;_0x91d845<_0xdcd5b4['length'];_0x91d845++){if(_0xdcd5b4[_0x91d845]['online']){_0x76ae9[_0x1b39('0x86')](db[_0x1b39('0x79')][_0x1b39('0x95')]({'membername':_0xdcd5b4[_0x91d845]['name'],'UserId':_0xdcd5b4[_0x91d845]['id'],'queue_name':_0x4900ef[_0x1b39('0x32')],'VoiceQueueId':_0x4900ef['id'],'interface':_[_0x1b39('0x7a')](_0xdcd5b4[_0x91d845][_0x1b39('0x70')])?util[_0x1b39('0x7b')](_0x1b39('0x7c'),_0xdcd5b4[_0x91d845][_0x1b39('0x32')]):_0xdcd5b4[_0x91d845]['interface'],'paused':_0xdcd5b4[_0x91d845][_0x1b39('0x6f')]||![],'penalty':_0x29305a['body'][_0x1b39('0x72')]||0x0}));}}return BPromise[_0x1b39('0x8a')](_0x76ae9);}})['then'](function(){return _0x4b1c8f;})[_0x1b39('0x27')](respondWithResult(_0x31334a,null))['catch'](handleError(_0x31334a,null));};exports[_0x1b39('0x8f')]=function(_0x330168,_0x4030cc,_0x49c312){return db['VoiceQueue'][_0x1b39('0x30')]({'where':{'id':_0x330168[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x4030cc,null))[_0x1b39('0x27')](function(_0x3b3407){if(_0x3b3407){return _0x3b3407[_0x1b39('0x8f')](_0x330168[_0x1b39('0x3c')]['ids'])['then'](function(){if(_[_0x1b39('0x96')](_0x330168[_0x1b39('0x3c')][_0x1b39('0x93')])){for(var _0xa48223=0x0;_0xa48223<_0x330168[_0x1b39('0x3c')][_0x1b39('0x93')][_0x1b39('0x41')];_0xa48223+=0x1){socket[_0x1b39('0x7d')](_0x1b39('0x91'),{'UserId':Number(_0x330168[_0x1b39('0x3c')][_0x1b39('0x93')][_0xa48223]),'VoiceQueueId':Number(_0x330168[_0x1b39('0x4e')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x330168[_0x1b39('0x3c')][_0x1b39('0x93')]),'VoiceQueueId':Number(_0x330168['params']['id'])});}});}})[_0x1b39('0x27')](function(_0x338742){return db[_0x1b39('0x79')][_0x1b39('0x34')]({'where':{'VoiceQueueId':_0x330168[_0x1b39('0x4e')]['id'],'UserId':_0x330168[_0x1b39('0x3c')][_0x1b39('0x93')]}})['then'](function(){return _0x338742;});})[_0x1b39('0x27')](respondWithStatusCode(_0x4030cc,null))[_0x1b39('0x4c')](handleError(_0x4030cc,null));};exports['getAgents']=function(_0x358dd6,_0xeca731,_0x5e15d3){var _0x1dab09={};var _0x33a177={};var _0x56daae;var _0x43a54c;return db['VoiceQueue'][_0x1b39('0x63')]({'where':{'id':_0x358dd6[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0xeca731,null))[_0x1b39('0x27')](function(_0x8a5c78){if(_0x8a5c78){_0x56daae=_0x8a5c78;_0x33a177[_0x1b39('0x3b')]=_[_0x1b39('0x3d')](db[_0x1b39('0x6c')][_0x1b39('0x39')]);_0x33a177[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x358dd6[_0x1b39('0x3c')]);_0x33a177[_0x1b39('0x3e')]=_[_0x1b39('0x4f')](_0x33a177[_0x1b39('0x3b')],_0x33a177[_0x1b39('0x3c')]);_0x1dab09[_0x1b39('0x3f')]=_[_0x1b39('0x4f')](_0x33a177[_0x1b39('0x3b')],qs[_0x1b39('0x40')](_0x358dd6[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x1dab09[_0x1b39('0x3f')]=_0x1dab09['attributes'][_0x1b39('0x41')]?_0x1dab09[_0x1b39('0x3f')]:_0x33a177['model'];_0x1dab09['order']=qs[_0x1b39('0x44')](_0x358dd6['query']['sort']);_0x1dab09[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_[_0x1b39('0x46')](_0x358dd6[_0x1b39('0x3c')],_0x33a177[_0x1b39('0x3e')]));if(_0x358dd6[_0x1b39('0x3c')][_0x1b39('0x2c')]){_0x1dab09[_0x1b39('0x45')]=_[_0x1b39('0x47')](_0x1dab09[_0x1b39('0x45')],{'$or':_['map'](_0x1dab09[_0x1b39('0x3f')],function(_0x2dfd8a){var _0x34296c={};_0x34296c[_0x2dfd8a]={'$like':'%'+_0x358dd6['query'][_0x1b39('0x2c')]+'%'};return _0x34296c;})});}_0x1dab09=_[_0x1b39('0x47')]({},_0x1dab09,_0x358dd6[_0x1b39('0x48')]);return _0x56daae[_0x1b39('0x97')](_0x1dab09);}})['then'](function(_0x460e34){if(_0x460e34){_0x43a54c=_0x460e34[_0x1b39('0x41')];if(!_0x358dd6[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x1dab09[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x358dd6[_0x1b39('0x3c')][_0x1b39('0x1f')]);_0x1dab09[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0x358dd6['query'][_0x1b39('0x20')]);}return _0x56daae[_0x1b39('0x97')](_0x1dab09);}})['then'](function(_0x29ee8e){if(_0x29ee8e){return _0x29ee8e?{'count':_0x43a54c,'rows':_0x29ee8e}:null;}})[_0x1b39('0x27')](respondWithResult(_0xeca731,null))[_0x1b39('0x4c')](handleError(_0xeca731,null));};exports[_0x1b39('0x98')]=function(_0x45bc06,_0x5ab5a0,_0x5d5dfd){var _0x242129={};var _0x274691={};var _0x59af8e;var _0x44400e;return db['VoiceQueue'][_0x1b39('0x63')]({'where':{'id':_0x45bc06['params']['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x5ab5a0,null))[_0x1b39('0x27')](function(_0x43b9f8){if(_0x43b9f8){_0x59af8e=_0x43b9f8;_0x274691['model']=_['keys'](db['UserVoiceQueueRt'][_0x1b39('0x39')]);_0x274691[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x45bc06['query']);_0x274691['filters']=_[_0x1b39('0x4f')](_0x274691['model'],_0x274691[_0x1b39('0x3c')]);_0x242129[_0x1b39('0x3f')]=_[_0x1b39('0x4f')](_0x274691[_0x1b39('0x3b')],qs['fields'](_0x45bc06[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x242129['attributes']=_0x242129[_0x1b39('0x3f')]['length']?_0x242129[_0x1b39('0x3f')]:_0x274691['model'];_0x242129[_0x1b39('0x66')]=qs[_0x1b39('0x44')](_0x45bc06['query']['sort']);_0x242129[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_['pick'](_0x45bc06['query'],_0x274691[_0x1b39('0x3e')]));if(_0x45bc06[_0x1b39('0x3c')][_0x1b39('0x2c')]){_0x242129['where']=_[_0x1b39('0x47')](_0x242129[_0x1b39('0x45')],{'$or':_[_0x1b39('0x2d')](_0x242129[_0x1b39('0x3f')],function(_0x336f83){var _0x2e1ada={};_0x2e1ada[_0x336f83]={'$like':'%'+_0x45bc06['query'][_0x1b39('0x2c')]+'%'};return _0x2e1ada;})});}_0x242129=_['merge']({},_0x242129,_0x45bc06['options']);return _0x59af8e[_0x1b39('0x98')](_0x242129);}})[_0x1b39('0x27')](function(_0x506ee2){if(_0x506ee2){_0x44400e=_0x506ee2[_0x1b39('0x41')];if(!_0x45bc06[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x242129[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x45bc06['query'][_0x1b39('0x1f')]);_0x242129[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0x45bc06['query'][_0x1b39('0x20')]);}return _0x59af8e[_0x1b39('0x98')](_0x242129);}})[_0x1b39('0x27')](function(_0x2682c7){return _0x2682c7?{'count':_0x44400e,'rows':_0x2682c7}:null;})[_0x1b39('0x27')](respondWithResult(_0x5ab5a0,null))[_0x1b39('0x4c')](handleError(_0x5ab5a0,null));};exports[_0x1b39('0x99')]=function(_0x2246ff,_0x1eab7a,_0x5f23bd){var _0x4229de={};var _0x2249d0={};var _0x4b2572;var _0x50b941;return db[_0x1b39('0x49')][_0x1b39('0x63')]({'where':{'id':_0x2246ff[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x1eab7a,null))[_0x1b39('0x27')](function(_0x227992){if(_0x227992){_0x4b2572=_0x227992;_0x2249d0[_0x1b39('0x3b')]=_[_0x1b39('0x3d')](db[_0x1b39('0x9a')][_0x1b39('0x39')]);_0x2249d0[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x2246ff['query']);_0x2249d0[_0x1b39('0x3e')]=_['intersection'](_0x2249d0[_0x1b39('0x3b')],_0x2249d0[_0x1b39('0x3c')]);_0x4229de['attributes']=_[_0x1b39('0x4f')](_0x2249d0['model'],qs[_0x1b39('0x40')](_0x2246ff[_0x1b39('0x3c')][_0x1b39('0x40')]));_0x4229de[_0x1b39('0x3f')]=_0x4229de[_0x1b39('0x3f')][_0x1b39('0x41')]?_0x4229de[_0x1b39('0x3f')]:_0x2249d0['model'];_0x4229de[_0x1b39('0x66')]=qs[_0x1b39('0x44')](_0x2246ff['query'][_0x1b39('0x44')]);_0x4229de[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_[_0x1b39('0x46')](_0x2246ff[_0x1b39('0x3c')],_0x2249d0[_0x1b39('0x3e')]));if(_0x2246ff[_0x1b39('0x3c')][_0x1b39('0x2c')]){_0x4229de[_0x1b39('0x45')]=_[_0x1b39('0x47')](_0x4229de['where'],{'$or':_[_0x1b39('0x2d')](_0x4229de['attributes'],function(_0x2a4ecf){var _0x198788={};_0x198788[_0x2a4ecf]={'$like':'%'+_0x2246ff['query']['filter']+'%'};return _0x198788;})});}_0x4229de=_['merge']({},_0x4229de,_0x2246ff[_0x1b39('0x48')]);return _0x4b2572[_0x1b39('0x99')](_0x4229de);}})[_0x1b39('0x27')](function(_0x178d09){if(_0x178d09){_0x50b941=_0x178d09[_0x1b39('0x41')];if(!_0x2246ff['query']['hasOwnProperty']('nolimit')){_0x4229de[_0x1b39('0x1f')]=qs['limit'](_0x2246ff['query']['limit']);_0x4229de[_0x1b39('0x20')]=qs['offset'](_0x2246ff[_0x1b39('0x3c')][_0x1b39('0x20')]);}return _0x4b2572[_0x1b39('0x99')](_0x4229de);}})[_0x1b39('0x27')](function(_0x490cf9){if(_0x490cf9){return _0x490cf9?{'count':_0x50b941,'rows':_0x490cf9}:null;}})[_0x1b39('0x27')](respondWithResult(_0x1eab7a,null))[_0x1b39('0x4c')](handleError(_0x1eab7a,null));};exports[_0x1b39('0x9b')]=function(_0x14a8ba,_0x54eb6b,_0x304822){var _0x8fa477,_0x4e1af5;return db[_0x1b39('0x49')][_0x1b39('0x30')]({'where':{'id':_0x14a8ba[_0x1b39('0x4e')]['id']}})['then'](handleEntityNotFound(_0x54eb6b,null))[_0x1b39('0x27')](function(_0x3923ab){if(_0x3923ab){_0x4e1af5=_0x3923ab;return _0x3923ab[_0x1b39('0x9b')](_0x14a8ba['body'][_0x1b39('0x93')],_['omit'](_0x14a8ba['body'],[_0x1b39('0x93'),'id'])||{});}return null;})[_0x1b39('0x9c')](function(_0xd1083){var _0x4524f0;_0x8fa477=_0xd1083||[];var _0x2ff428=[];if(_0xd1083){for(var _0x5ed4eb=0x0;_0x5ed4eb<_0xd1083['length'];_0x5ed4eb+=0x1){var _0x590166=_0xd1083[_0x5ed4eb]['get']({'plain':!![]});_0x4e1af5[_0x1b39('0x9d')]=_0x14a8ba[_0x1b39('0x5b')][_0x1b39('0x9d')]?_0x14a8ba[_0x1b39('0x5b')][_0x1b39('0x9d')]:_0x4e1af5[_0x1b39('0x9d')];switch(_0x4e1af5[_0x1b39('0x9d')]){case _0x1b39('0x9e'):_0x4524f0=squel[_0x1b39('0x9f')]()[_0x1b39('0xa0')](_0x1b39('0xa1'))['fromQuery']([_0x1b39('0xa2'),_0x1b39('0xa3'),_0x1b39('0xa4'),_0x1b39('0xa5'),_0x1b39('0x60'),_0x1b39('0x59'),'updatedAt'],squel['select']()[_0x1b39('0xa6')](_0x1b39('0xa2'),'phone')[_0x1b39('0xa6')]('NOW()','scheduledAt')[_0x1b39('0xa6')]('id',_0x1b39('0xa4'))[_0x1b39('0xa6')](_0x590166[_0x1b39('0xa7')][_0x1b39('0xa8')](),_0x1b39('0xa5'))[_0x1b39('0xa6')](_0x14a8ba[_0x1b39('0x4e')]['id'][_0x1b39('0xa8')](),_0x1b39('0x60'))[_0x1b39('0xa6')](_0x1b39('0xa9'),_0x1b39('0x59'))[_0x1b39('0xa6')]('NOW()',_0x1b39('0x5a'))[_0x1b39('0x7f')](_0x1b39('0xaa'))[_0x1b39('0x45')]('deletedAt\x20IS\x20NULL')[_0x1b39('0x45')]('ListId\x20=\x20?',_0x590166[_0x1b39('0xa7')][_0x1b39('0xa8')]())[_0x1b39('0x45')](_0x1b39('0xab'))[_0x1b39('0x45')](_0x1b39('0xac'),squel[_0x1b39('0x7e')]()['field'](_0x1b39('0xad'))[_0x1b39('0x7f')](_0x1b39('0xae'))['where']('VoiceQueueId\x20=\x20?',_0x14a8ba['params']['id'][_0x1b39('0xa8')]()))[_0x1b39('0x45')](_0x1b39('0xac'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x1b39('0x7f')](_0x1b39('0xa1'))[_0x1b39('0x45')](_0x1b39('0x84'),_0x14a8ba[_0x1b39('0x4e')]['id'][_0x1b39('0xa8')]())))['toString']();break;case _0x1b39('0xaf'):_0x4524f0=squel['insert']()[_0x1b39('0xa0')]('cm_hopper')[_0x1b39('0xb0')]([_0x1b39('0xa2'),_0x1b39('0xa3'),_0x1b39('0xa4'),_0x1b39('0xa5'),_0x1b39('0x60'),'createdAt',_0x1b39('0x5a')],squel[_0x1b39('0x7e')]()[_0x1b39('0xa6')]('phone','phone')['field'](_0x1b39('0xa9'),_0x1b39('0xa3'))[_0x1b39('0xa6')]('id',_0x1b39('0xa4'))[_0x1b39('0xa6')](_0x590166[_0x1b39('0xa7')]['toString'](),_0x1b39('0xa5'))[_0x1b39('0xa6')](_0x14a8ba[_0x1b39('0x4e')]['id'][_0x1b39('0xa8')](),_0x1b39('0x60'))[_0x1b39('0xa6')](_0x1b39('0xa9'),'createdAt')[_0x1b39('0xa6')](_0x1b39('0xa9'),_0x1b39('0x5a'))[_0x1b39('0x7f')](_0x1b39('0xaa'))[_0x1b39('0x45')](_0x1b39('0xb1'))[_0x1b39('0x45')](_0x1b39('0xb2'),_0x590166[_0x1b39('0xa7')][_0x1b39('0xa8')]())[_0x1b39('0x45')](_0x1b39('0xab'))['where'](_0x1b39('0xac'),squel[_0x1b39('0x7e')]()[_0x1b39('0xa6')](_0x1b39('0xb3'))[_0x1b39('0x7f')](_0x1b39('0xa1'))[_0x1b39('0x45')](_0x1b39('0x84'),_0x14a8ba[_0x1b39('0x4e')]['id'][_0x1b39('0xa8')]())))[_0x1b39('0xa8')]();break;default:_0x4524f0=squel[_0x1b39('0x9f')]()[_0x1b39('0xa0')](_0x1b39('0xa1'))[_0x1b39('0xb0')]([_0x1b39('0xa2'),_0x1b39('0xa3'),_0x1b39('0xa4'),_0x1b39('0xa5'),_0x1b39('0x60'),_0x1b39('0x59'),_0x1b39('0x5a')],squel[_0x1b39('0x7e')]()[_0x1b39('0xa6')](_0x1b39('0xa2'),_0x1b39('0xa2'))[_0x1b39('0xa6')](_0x1b39('0xa9'),_0x1b39('0xa3'))['field']('id',_0x1b39('0xa4'))['field'](_0x590166[_0x1b39('0xa7')]['toString'](),_0x1b39('0xa5'))['field'](_0x14a8ba['params']['id'][_0x1b39('0xa8')](),_0x1b39('0x60'))[_0x1b39('0xa6')](_0x1b39('0xa9'),_0x1b39('0x59'))['field'](_0x1b39('0xa9'),_0x1b39('0x5a'))['from'](_0x1b39('0xaa'))['where'](_0x1b39('0xb1'))[_0x1b39('0x45')](_0x1b39('0xb2'),_0x590166[_0x1b39('0xa7')][_0x1b39('0xa8')]())['where'](_0x1b39('0xab')))[_0x1b39('0xa8')]();}_0x2ff428['push'](db[_0x1b39('0x73')][_0x1b39('0x3c')](_0x4524f0));}return BPromise[_0x1b39('0x8a')](_0x2ff428);}})['then'](function(){return _0x8fa477;})[_0x1b39('0x27')](respondWithResult(_0x54eb6b,null))[_0x1b39('0x4c')](handleError(_0x54eb6b,null));};exports[_0x1b39('0xb4')]=function(_0x209916,_0x377d8e,_0x3c89bc){return db['VoiceQueue'][_0x1b39('0x30')]({'where':{'id':_0x209916[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x377d8e,null))[_0x1b39('0x27')](function(_0x5dd81d){if(_0x5dd81d){return _0x5dd81d['removeLists'](_0x209916['query']['ids']);}})['then'](function(_0x5a24f0){if(_0x5a24f0){return db['CmHopper'][_0x1b39('0x34')]({'where':{'ListId':_0x209916[_0x1b39('0x3c')][_0x1b39('0x93')],'VoiceQueueId':_0x209916[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](function(){return _0x5a24f0;});}})[_0x1b39('0x27')](respondWithStatusCode(_0x377d8e,null))[_0x1b39('0x4c')](handleError(_0x377d8e,null));};exports[_0x1b39('0xb5')]=function(_0x402c1e,_0x3dfe50,_0x39e085){var _0x4db5f5={};var _0x4405ca={};var _0x4adb1d;var _0x7286a0;return db[_0x1b39('0x49')][_0x1b39('0x63')]({'where':{'id':_0x402c1e[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x3dfe50,null))['then'](function(_0x232592){if(_0x232592){_0x4adb1d=_0x232592;_0x4405ca[_0x1b39('0x3b')]=_[_0x1b39('0x3d')](db['CmList'][_0x1b39('0x39')]);_0x4405ca[_0x1b39('0x3c')]=_[_0x1b39('0x3d')](_0x402c1e[_0x1b39('0x3c')]);_0x4405ca[_0x1b39('0x3e')]=_['intersection'](_0x4405ca[_0x1b39('0x3b')],_0x4405ca[_0x1b39('0x3c')]);_0x4db5f5['attributes']=_[_0x1b39('0x4f')](_0x4405ca[_0x1b39('0x3b')],qs[_0x1b39('0x40')](_0x402c1e[_0x1b39('0x3c')]['fields']));_0x4db5f5['attributes']=_0x4db5f5[_0x1b39('0x3f')]['length']?_0x4db5f5[_0x1b39('0x3f')]:_0x4405ca[_0x1b39('0x3b')];_0x4db5f5[_0x1b39('0x66')]=qs['sort'](_0x402c1e[_0x1b39('0x3c')]['sort']);_0x4db5f5[_0x1b39('0x45')]=qs[_0x1b39('0x3e')](_[_0x1b39('0x46')](_0x402c1e['query'],_0x4405ca[_0x1b39('0x3e')]));if(_0x402c1e[_0x1b39('0x3c')][_0x1b39('0x2c')]){_0x4db5f5[_0x1b39('0x45')]=_[_0x1b39('0x47')](_0x4db5f5[_0x1b39('0x45')],{'$or':_[_0x1b39('0x2d')](_0x4db5f5['attributes'],function(_0xc85294){var _0x3d7063={};_0x3d7063[_0xc85294]={'$like':'%'+_0x402c1e['query']['filter']+'%'};return _0x3d7063;})});}_0x4db5f5=_['merge']({},_0x4db5f5,_0x402c1e[_0x1b39('0x48')]);return _0x4adb1d[_0x1b39('0xb5')](_0x4db5f5);}})[_0x1b39('0x27')](function(_0x10655){if(_0x10655){_0x7286a0=_0x10655[_0x1b39('0x41')];if(!_0x402c1e[_0x1b39('0x3c')][_0x1b39('0x42')](_0x1b39('0x43'))){_0x4db5f5[_0x1b39('0x1f')]=qs[_0x1b39('0x1f')](_0x402c1e[_0x1b39('0x3c')][_0x1b39('0x1f')]);_0x4db5f5[_0x1b39('0x20')]=qs[_0x1b39('0x20')](_0x402c1e[_0x1b39('0x3c')][_0x1b39('0x20')]);}return _0x4adb1d[_0x1b39('0xb5')](_0x4db5f5);}})[_0x1b39('0x27')](function(_0x33dc78){if(_0x33dc78){return _0x33dc78?{'count':_0x7286a0,'rows':_0x33dc78}:null;}})[_0x1b39('0x27')](respondWithResult(_0x3dfe50,null))[_0x1b39('0x4c')](handleError(_0x3dfe50,null));};exports['addBlackLists']=function(_0x5134ef,_0x10116c,_0x4cad2b){var _0x2065f0,_0x14dac2;return db[_0x1b39('0x49')]['find']({'where':{'id':_0x5134ef[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x10116c,null))['then'](function(_0x3b9378){if(_0x3b9378){_0x14dac2=_0x3b9378;return _0x3b9378[_0x1b39('0xb6')](_0x5134ef[_0x1b39('0x5b')]['ids'],_[_0x1b39('0x58')](_0x5134ef[_0x1b39('0x5b')],[_0x1b39('0x93'),'id'])||{});}return null;})[_0x1b39('0x9c')](function(_0x19c73a){var _0x2b5bd7;_0x2065f0=_0x19c73a||[];var _0x38a353=[];if(_0x19c73a){for(var _0x45a712=0x0;_0x45a712<_0x19c73a['length'];_0x45a712+=0x1){var _0x1d5084=_0x19c73a[_0x45a712]['get']({'plain':!![]});_0x2b5bd7=squel['insert']()['into'](_0x1b39('0xb7'))['fromQuery']([_0x1b39('0xa2'),_0x1b39('0xa4'),'ListId',_0x1b39('0x60'),_0x1b39('0x59'),_0x1b39('0x5a')],squel[_0x1b39('0x7e')]()[_0x1b39('0xa6')](_0x1b39('0xa2'),'phone')[_0x1b39('0xa6')]('id','ContactId')[_0x1b39('0xa6')](_0x1d5084[_0x1b39('0xa7')][_0x1b39('0xa8')](),'ListId')[_0x1b39('0xa6')](_0x5134ef[_0x1b39('0x4e')]['id'][_0x1b39('0xa8')](),_0x1b39('0x60'))['field'](_0x1b39('0xa9'),'createdAt')[_0x1b39('0xa6')](_0x1b39('0xa9'),_0x1b39('0x5a'))['from'](_0x1b39('0xaa'))[_0x1b39('0x45')](_0x1b39('0xb1'))[_0x1b39('0x45')](_0x1b39('0xb2'),_0x1d5084[_0x1b39('0xa7')][_0x1b39('0xa8')]())[_0x1b39('0x45')](_0x1b39('0xab')))[_0x1b39('0xa8')]();_0x38a353[_0x1b39('0x86')](db[_0x1b39('0x73')][_0x1b39('0x3c')](_0x2b5bd7));}return BPromise[_0x1b39('0x8a')](_0x38a353);}})[_0x1b39('0x27')](function(){return _0x2065f0;})[_0x1b39('0x27')](respondWithResult(_0x10116c,null))['catch'](handleError(_0x10116c,null));};exports['removeBlackLists']=function(_0x1044ba,_0x53b82a,_0x2eb32d){return db[_0x1b39('0x49')][_0x1b39('0x30')]({'where':{'id':_0x1044ba[_0x1b39('0x4e')]['id']}})[_0x1b39('0x27')](handleEntityNotFound(_0x53b82a,null))['then'](function(_0x1da893){if(_0x1da893){return _0x1da893[_0x1b39('0xb8')](_0x1044ba[_0x1b39('0x3c')][_0x1b39('0x93')]);}})[_0x1b39('0x27')](function(_0x4460a7){if(_0x4460a7){return db[_0x1b39('0x68')][_0x1b39('0x34')]({'where':{'ListId':_0x1044ba['query'][_0x1b39('0x93')],'VoiceQueueId':_0x1044ba['params']['id']}})['then'](function(){return _0x4460a7;});}})[_0x1b39('0x27')](respondWithStatusCode(_0x53b82a,null))[_0x1b39('0x4c')](handleError(_0x53b82a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 96ba20e..3e1d3bf 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 _0x17c2=['remove','emit','hasOwnProperty','hook','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x3a10d7,_0x5a3b7f){var _0xc1df65=function(_0x4a39d0){while(--_0x4a39d0){_0x3a10d7['push'](_0x3a10d7['shift']());}};_0xc1df65(++_0x5a3b7f);}(_0x17c2,0x1bd));var _0x217c=function(_0x72e945,_0x109cc9){_0x72e945=_0x72e945-0x0;var _0x36f91a=_0x17c2[_0x72e945];return _0x36f91a;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x217c('0x0'))['db'][_0x217c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x217c('0x2')](0x0);var events={'afterCreate':_0x217c('0x3'),'afterUpdate':_0x217c('0x4'),'afterDestroy':_0x217c('0x5')};function emitEvent(_0x339f73){return function(_0x4ab8a3,_0x5e6270,_0x3ff378){VoiceQueueEvents[_0x217c('0x6')](_0x339f73+':'+_0x4ab8a3['id'],_0x4ab8a3);VoiceQueueEvents[_0x217c('0x6')](_0x339f73,_0x4ab8a3);_0x3ff378(null);};}for(var e in events){if(events[_0x217c('0x7')](e)){var event=events[e];VoiceQueue[_0x217c('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x5cbe=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cbe,0xe9));var _0xe5cb=function(_0x2d9cd3,_0x43d55e){_0x2d9cd3=_0x2d9cd3-0x0;var _0x1deb5a=_0x5cbe[_0x2d9cd3];return _0x1deb5a;};'use strict';var EventEmitter=require(_0xe5cb('0x0'));var VoiceQueue=require(_0xe5cb('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe5cb('0x2')](0x0);var events={'afterCreate':_0xe5cb('0x3'),'afterUpdate':'update','afterDestroy':_0xe5cb('0x4')};function emitEvent(_0xc74b85){return function(_0x4b02a5,_0x1f73aa,_0x49537f){VoiceQueueEvents[_0xe5cb('0x5')](_0xc74b85+':'+_0x4b02a5['id'],_0x4b02a5);VoiceQueueEvents['emit'](_0xc74b85,_0x4b02a5);_0x49537f(null);};}for(var e in events){if(events[_0xe5cb('0x6')](e)){var event=events[e];VoiceQueue[_0xe5cb('0x7')](e,emitEvent(event));}}module[_0xe5cb('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5e4fef4..c4337cb 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x5c768b,_0x5e88a6){var _0x335af8=function(_0x39b04f){while(--_0x39b04f){_0x5c768b['push'](_0x5c768b['shift']());}};_0x335af8(++_0x5e88a6);}(_0x008c,0x188));var _0xc008=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x008c[_0x53f37f];return _0x2fe5f8;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x22057f,_0x2fbb83){var _0x340c45=function(_0x269fb5){while(--_0x269fb5){_0x22057f['push'](_0x22057f['shift']());}};_0x340c45(++_0x2fbb83);}(_0x70e0,0x17b));var _0x070e=function(_0x4cef51,_0xf013c3){_0x4cef51=_0x4cef51-0x0;var _0x2292b5=_0x70e0[_0x4cef51];return _0x2292b5;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 23b50bf..9911053 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 _0xa7f5=['error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','map','attributes','model','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x265f6d,_0x2a38a5){var _0x317995=function(_0x3d0f86){while(--_0x3d0f86){_0x265f6d['push'](_0x265f6d['shift']());}};_0x317995(++_0x2a38a5);}(_0xa7f5,0x159));var _0x5a7f=function(_0x3c9310,_0x58f0c7){_0x3c9310=_0x3c9310-0x0;var _0x24e56c=_0xa7f5[_0x3c9310];return _0x24e56c;};'use strict';var _=require(_0x5a7f('0x0'));var util=require('util');var moment=require(_0x5a7f('0x1'));var BPromise=require(_0x5a7f('0x2'));var rs=require(_0x5a7f('0x3'));var fs=require('fs');var Redis=require(_0x5a7f('0x4'));var db=require(_0x5a7f('0x5'))['db'];var utils=require(_0x5a7f('0x6'));var logger=require('../../config/logger')(_0x5a7f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a7f('0x8'));var client=jayson[_0x5a7f('0x9')]['http']({'port':0x232a});config[_0x5a7f('0xa')]=_[_0x5a7f('0xb')](config[_0x5a7f('0xa')],{'host':_0x5a7f('0xc'),'port':0x18eb});var socket=require(_0x5a7f('0xd'))(new Redis(config[_0x5a7f('0xa')]));require(_0x5a7f('0xe'))[_0x5a7f('0xf')](socket);function respondWithRpcPromise(_0x362dbf,_0x81c3d8,_0x1f913c){return new BPromise(function(_0x193a05,_0x1de5d8){return client[_0x5a7f('0x10')](_0x362dbf,_0x1f913c)[_0x5a7f('0x11')](function(_0x2c550e){logger[_0x5a7f('0x12')](_0x5a7f('0x13'),_0x81c3d8,'request\x20sent');logger[_0x5a7f('0x14')](_0x5a7f('0x15'),_0x81c3d8,_0x5a7f('0x16'),JSON[_0x5a7f('0x17')](_0x2c550e));if(_0x2c550e[_0x5a7f('0x18')]){if(_0x2c550e[_0x5a7f('0x18')][_0x5a7f('0x19')]===0x1f4){logger['error'](_0x5a7f('0x13'),_0x81c3d8,_0x2c550e[_0x5a7f('0x18')][_0x5a7f('0x1a')]);return _0x1de5d8(_0x2c550e[_0x5a7f('0x18')][_0x5a7f('0x1a')]);}logger[_0x5a7f('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x81c3d8,_0x2c550e['error'][_0x5a7f('0x1a')]);return _0x193a05(_0x2c550e[_0x5a7f('0x18')][_0x5a7f('0x1a')]);}else{logger[_0x5a7f('0x12')](_0x5a7f('0x13'),_0x81c3d8,_0x5a7f('0x16'));_0x193a05(_0x2c550e[_0x5a7f('0x1b')][_0x5a7f('0x1a')]);}})[_0x5a7f('0x1c')](function(_0xa8e20e){logger[_0x5a7f('0x18')](_0x5a7f('0x13'),_0x81c3d8,_0xa8e20e);_0x1de5d8(_0xa8e20e);});});}exports[_0x5a7f('0x1d')]=function(_0x50079a){var _0x1c8eb5=this;return new Promise(function(_0x441082,_0x52e441){return db[_0x5a7f('0x1e')][_0x5a7f('0x1f')]({'raw':_0x50079a[_0x5a7f('0x20')]?_0x50079a[_0x5a7f('0x20')][_0x5a7f('0x21')]===undefined?!![]:![]:!![],'where':_0x50079a[_0x5a7f('0x20')]?_0x50079a[_0x5a7f('0x20')][_0x5a7f('0x22')]||null:null,'attributes':_0x50079a[_0x5a7f('0x20')]?_0x50079a[_0x5a7f('0x20')]['attributes']||null:null,'limit':_0x50079a[_0x5a7f('0x20')]?_0x50079a[_0x5a7f('0x20')]['limit']||null:null,'include':_0x50079a[_0x5a7f('0x20')]?_0x50079a[_0x5a7f('0x20')][_0x5a7f('0x23')]?_[_0x5a7f('0x24')](_0x50079a[_0x5a7f('0x20')]['include'],function(_0x55caa8){return{'model':db[_0x55caa8['model']],'as':_0x55caa8['as'],'attributes':_0x55caa8[_0x5a7f('0x25')],'include':_0x55caa8[_0x5a7f('0x23')]?_[_0x5a7f('0x24')](_0x55caa8[_0x5a7f('0x23')],function(_0x4a89ca){return{'model':db[_0x4a89ca[_0x5a7f('0x26')]],'as':_0x4a89ca['as'],'attributes':_0x4a89ca[_0x5a7f('0x25')],'include':_0x4a89ca[_0x5a7f('0x23')]?_[_0x5a7f('0x24')](_0x4a89ca[_0x5a7f('0x23')],function(_0xf1fe65){return{'model':db[_0xf1fe65[_0x5a7f('0x26')]],'as':_0xf1fe65['as'],'attributes':_0xf1fe65[_0x5a7f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5a7f('0x11')](function(_0x360cf9){logger[_0x5a7f('0x12')](_0x5a7f('0x1d'),_0x50079a);logger[_0x5a7f('0x14')](_0x5a7f('0x1d'),_0x50079a,JSON[_0x5a7f('0x17')](_0x360cf9));_0x441082(_0x360cf9);})[_0x5a7f('0x1c')](function(_0x5f08b1){logger[_0x5a7f('0x18')](_0x5a7f('0x1d'),_0x5f08b1[_0x5a7f('0x1a')],_0x50079a);_0x52e441(_0x1c8eb5[_0x5a7f('0x18')](0x1f4,_0x5f08b1[_0x5a7f('0x1a')]));});});};exports[_0x5a7f('0x27')]=function(_0x198081){var _0xbad7fb=this;return new Promise(function(_0x56da67,_0x12eab5){return db[_0x5a7f('0x1e')][_0x5a7f('0x28')]({'raw':_0x198081['options']?_0x198081[_0x5a7f('0x20')][_0x5a7f('0x21')]===undefined?!![]:![]:!![],'where':_0x198081[_0x5a7f('0x20')]?_0x198081['options']['where']||null:null,'attributes':_0x198081[_0x5a7f('0x20')]?_0x198081['options']['attributes']||null:null,'include':_0x198081[_0x5a7f('0x20')]?_0x198081[_0x5a7f('0x20')][_0x5a7f('0x23')]?_[_0x5a7f('0x24')](_0x198081[_0x5a7f('0x20')][_0x5a7f('0x23')],function(_0x1e0709){return{'model':db[_0x1e0709[_0x5a7f('0x26')]],'as':_0x1e0709['as'],'attributes':_0x1e0709[_0x5a7f('0x25')],'include':_0x1e0709[_0x5a7f('0x23')]?_['map'](_0x1e0709[_0x5a7f('0x23')],function(_0x42f3c8){return{'model':db[_0x42f3c8[_0x5a7f('0x26')]],'as':_0x42f3c8['as'],'attributes':_0x42f3c8[_0x5a7f('0x25')],'include':_0x42f3c8['include']?_[_0x5a7f('0x24')](_0x42f3c8['include'],function(_0x5362b9){return{'model':db[_0x5362b9['model']],'as':_0x5362b9['as'],'attributes':_0x5362b9[_0x5a7f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5a7f('0x11')](function(_0x51a819){logger[_0x5a7f('0x12')](_0x5a7f('0x27'),_0x198081);logger[_0x5a7f('0x14')](_0x5a7f('0x27'),_0x198081,JSON[_0x5a7f('0x17')](_0x51a819));_0x56da67(_0x51a819);})[_0x5a7f('0x1c')](function(_0x437baf){logger['error'](_0x5a7f('0x27'),_0x437baf[_0x5a7f('0x1a')],_0x198081);_0x12eab5(_0xbad7fb['error'](0x1f4,_0x437baf[_0x5a7f('0x1a')]));});});}; \ No newline at end of file +var _0x44f3=['attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','where','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw'];(function(_0x21705c,_0x3f9ecb){var _0x398bbe=function(_0x334351){while(--_0x334351){_0x21705c['push'](_0x21705c['shift']());}};_0x398bbe(++_0x3f9ecb);}(_0x44f3,0x10b));var _0x344f=function(_0x4a35d4,_0x24be38){_0x4a35d4=_0x4a35d4-0x0;var _0x1feb7a=_0x44f3[_0x4a35d4];return _0x1feb7a;};'use strict';var _=require(_0x344f('0x0'));var util=require(_0x344f('0x1'));var moment=require(_0x344f('0x2'));var BPromise=require(_0x344f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x344f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x344f('0x5'))('rpc');var config=require(_0x344f('0x6'));var jayson=require(_0x344f('0x7'));var client=jayson[_0x344f('0x8')][_0x344f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x344f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x344f('0xb'))(new Redis(config[_0x344f('0xa')]));require(_0x344f('0xc'))['register'](socket);function respondWithRpcPromise(_0x511edc,_0x3ed76b,_0x517174){return new BPromise(function(_0x5b584c,_0x4433b0){return client['request'](_0x511edc,_0x517174)[_0x344f('0xd')](function(_0x6e5b7d){logger[_0x344f('0xe')](_0x344f('0xf'),_0x3ed76b,_0x344f('0x10'));logger[_0x344f('0x11')](_0x344f('0x12'),_0x3ed76b,'request\x20sent',JSON[_0x344f('0x13')](_0x6e5b7d));if(_0x6e5b7d[_0x344f('0x14')]){if(_0x6e5b7d[_0x344f('0x14')][_0x344f('0x15')]===0x1f4){logger[_0x344f('0x14')](_0x344f('0xf'),_0x3ed76b,_0x6e5b7d[_0x344f('0x14')]['message']);return _0x4433b0(_0x6e5b7d[_0x344f('0x14')][_0x344f('0x16')]);}logger[_0x344f('0x14')](_0x344f('0xf'),_0x3ed76b,_0x6e5b7d['error'][_0x344f('0x16')]);return _0x5b584c(_0x6e5b7d[_0x344f('0x14')][_0x344f('0x16')]);}else{logger[_0x344f('0xe')]('VoiceQueue,\x20%s,\x20%s',_0x3ed76b,'request\x20sent');_0x5b584c(_0x6e5b7d[_0x344f('0x17')][_0x344f('0x16')]);}})[_0x344f('0x18')](function(_0x19b51c){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3ed76b,_0x19b51c);_0x4433b0(_0x19b51c);});});}exports[_0x344f('0x19')]=function(_0x121ae9){var _0x21858c=this;return new Promise(function(_0x5dce0e,_0x51ac41){return db['VoiceQueue'][_0x344f('0x1a')]({'raw':_0x121ae9[_0x344f('0x1b')]?_0x121ae9[_0x344f('0x1b')][_0x344f('0x1c')]===undefined?!![]:![]:!![],'where':_0x121ae9['options']?_0x121ae9[_0x344f('0x1b')]['where']||null:null,'attributes':_0x121ae9[_0x344f('0x1b')]?_0x121ae9['options'][_0x344f('0x1d')]||null:null,'limit':_0x121ae9[_0x344f('0x1b')]?_0x121ae9['options'][_0x344f('0x1e')]||null:null,'include':_0x121ae9[_0x344f('0x1b')]?_0x121ae9[_0x344f('0x1b')][_0x344f('0x1f')]?_[_0x344f('0x20')](_0x121ae9[_0x344f('0x1b')][_0x344f('0x1f')],function(_0x4ef925){return{'model':db[_0x4ef925['model']],'as':_0x4ef925['as'],'attributes':_0x4ef925[_0x344f('0x1d')],'include':_0x4ef925['include']?_[_0x344f('0x20')](_0x4ef925['include'],function(_0x14067e){return{'model':db[_0x14067e[_0x344f('0x21')]],'as':_0x14067e['as'],'attributes':_0x14067e[_0x344f('0x1d')],'include':_0x14067e[_0x344f('0x1f')]?_['map'](_0x14067e[_0x344f('0x1f')],function(_0x42027e){return{'model':db[_0x42027e[_0x344f('0x21')]],'as':_0x42027e['as'],'attributes':_0x42027e[_0x344f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x344f('0xd')](function(_0x2495fc){logger[_0x344f('0xe')](_0x344f('0x19'),_0x121ae9);logger[_0x344f('0x11')](_0x344f('0x19'),_0x121ae9,JSON[_0x344f('0x13')](_0x2495fc));_0x5dce0e(_0x2495fc);})[_0x344f('0x18')](function(_0x112e2e){logger['error']('GetVoiceQueue',_0x112e2e[_0x344f('0x16')],_0x121ae9);_0x51ac41(_0x21858c['error'](0x1f4,_0x112e2e[_0x344f('0x16')]));});});};exports[_0x344f('0x22')]=function(_0x309eea){var _0xa74543=this;return new Promise(function(_0x32676f,_0x7bddff){return db[_0x344f('0x23')]['find']({'raw':_0x309eea['options']?_0x309eea[_0x344f('0x1b')][_0x344f('0x1c')]===undefined?!![]:![]:!![],'where':_0x309eea['options']?_0x309eea['options'][_0x344f('0x24')]||null:null,'attributes':_0x309eea[_0x344f('0x1b')]?_0x309eea[_0x344f('0x1b')][_0x344f('0x1d')]||null:null,'include':_0x309eea['options']?_0x309eea[_0x344f('0x1b')][_0x344f('0x1f')]?_[_0x344f('0x20')](_0x309eea[_0x344f('0x1b')][_0x344f('0x1f')],function(_0x58344e){return{'model':db[_0x58344e[_0x344f('0x21')]],'as':_0x58344e['as'],'attributes':_0x58344e['attributes'],'include':_0x58344e[_0x344f('0x1f')]?_[_0x344f('0x20')](_0x58344e['include'],function(_0x193f2a){return{'model':db[_0x193f2a[_0x344f('0x21')]],'as':_0x193f2a['as'],'attributes':_0x193f2a['attributes'],'include':_0x193f2a[_0x344f('0x1f')]?_[_0x344f('0x20')](_0x193f2a[_0x344f('0x1f')],function(_0x5de72b){return{'model':db[_0x5de72b[_0x344f('0x21')]],'as':_0x5de72b['as'],'attributes':_0x5de72b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cfa70){logger[_0x344f('0xe')]('ShowVoiceQueue',_0x309eea);logger[_0x344f('0x11')](_0x344f('0x22'),_0x309eea,JSON['stringify'](_0x4cfa70));_0x32676f(_0x4cfa70);})[_0x344f('0x18')](function(_0x1259ad){logger[_0x344f('0x14')](_0x344f('0x22'),_0x1259ad['message'],_0x309eea);_0x7bddff(_0xa74543[_0x344f('0x14')](0x1f4,_0x1259ad[_0x344f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 2d5c83e..da28d86 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 _0x8fe4=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x16f7cf,_0x227024){var _0x4b75db=function(_0x5a3f89){while(--_0x5a3f89){_0x16f7cf['push'](_0x16f7cf['shift']());}};_0x4b75db(++_0x227024);}(_0x8fe4,0x8b));var _0x48fe=function(_0x40a6b4,_0x1a6fa0){_0x40a6b4=_0x40a6b4-0x0;var _0x3b96c6=_0x8fe4[_0x40a6b4];return _0x3b96c6;};'use strict';var VoiceQueueEvents=require(_0x48fe('0x0'));var events=[_0x48fe('0x1'),_0x48fe('0x2'),_0x48fe('0x3')];function createListener(_0x391966,_0x2f2d67){return function(_0x529d0a){_0x2f2d67[_0x48fe('0x4')](_0x391966,_0x529d0a);};}function removeListener(_0x86c123,_0x2b6e80){return function(){VoiceQueueEvents[_0x48fe('0x5')](_0x86c123,_0x2b6e80);};}exports[_0x48fe('0x6')]=function(_0x5532ef){for(var _0xf1f434=0x0,_0x463607=events[_0x48fe('0x7')];_0xf1f434<_0x463607;_0xf1f434++){var _0x576d83=events[_0xf1f434];var _0xb58fa1=createListener(_0x48fe('0x8')+_0x576d83,_0x5532ef);VoiceQueueEvents['on'](_0x576d83,_0xb58fa1);}}; \ No newline at end of file +var _0x8449=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x3d4a6b,_0x20dbcb){var _0x55d64a=function(_0x220a50){while(--_0x220a50){_0x3d4a6b['push'](_0x3d4a6b['shift']());}};_0x55d64a(++_0x20dbcb);}(_0x8449,0x183));var _0x9844=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x8449[_0x4a7631];return _0x1a5a6f;};'use strict';var VoiceQueueEvents=require(_0x9844('0x0'));var events=[_0x9844('0x1'),_0x9844('0x2'),_0x9844('0x3')];function createListener(_0x50d2bd,_0x13c0f0){return function(_0x2de978){_0x13c0f0[_0x9844('0x4')](_0x50d2bd,_0x2de978);};}function removeListener(_0x2406b3,_0x54e8e2){return function(){VoiceQueueEvents['removeListener'](_0x2406b3,_0x54e8e2);};}exports['register']=function(_0x1313d1){for(var _0x1ff9f7=0x0,_0x561473=events[_0x9844('0x5')];_0x1ff9f7<_0x561473;_0x1ff9f7++){var _0x56cff3=events[_0x1ff9f7];var _0x473351=createListener(_0x9844('0x6')+_0x56cff3,_0x1313d1);VoiceQueueEvents['on'](_0x56cff3,_0x473351);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 5ca3e1a..50817e2 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 _0x1ba7=['update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','describe','show','post','create','put','/:id'];(function(_0x598924,_0x249d6f){var _0x2781c0=function(_0x297c55){while(--_0x297c55){_0x598924['push'](_0x598924['shift']());}};_0x2781c0(++_0x249d6f);}(_0x1ba7,0x124));var _0x71ba=function(_0x133020,_0x2f76aa){_0x133020=_0x133020-0x0;var _0x3257c9=_0x1ba7[_0x133020];return _0x3257c9;};'use strict';var multer=require(_0x71ba('0x0'));var util=require(_0x71ba('0x1'));var path=require(_0x71ba('0x2'));var timeout=require(_0x71ba('0x3'));var express=require('express');var router=express[_0x71ba('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x71ba('0x5'));var config=require(_0x71ba('0x6'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x71ba('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x71ba('0x8')]);router['get']('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71ba('0x9')]);router[_0x71ba('0xa')]('/',auth[_0x71ba('0x7')](),controller[_0x71ba('0xb')]);router[_0x71ba('0xc')](_0x71ba('0xd'),auth[_0x71ba('0x7')](),controller[_0x71ba('0xe')]);router[_0x71ba('0xf')](_0x71ba('0xd'),auth[_0x71ba('0x7')](),controller['destroy']);module[_0x71ba('0x10')]=router; \ No newline at end of file +var _0x1a3f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x18572f,_0x1dfecd){var _0x324ec0=function(_0x251c86){while(--_0x251c86){_0x18572f['push'](_0x18572f['shift']());}};_0x324ec0(++_0x1dfecd);}(_0x1a3f,0x68));var _0xf1a3=function(_0x29fc32,_0x124ed4){_0x29fc32=_0x29fc32-0x0;var _0x3a0a6e=_0x1a3f[_0x29fc32];return _0x3a0a6e;};'use strict';var multer=require(_0xf1a3('0x0'));var util=require('util');var path=require(_0xf1a3('0x1'));var timeout=require(_0xf1a3('0x2'));var express=require(_0xf1a3('0x3'));var router=express[_0xf1a3('0x4')]();var fs_extra=require(_0xf1a3('0x5'));var auth=require(_0xf1a3('0x6'));var interaction=require(_0xf1a3('0x7'));var config=require(_0xf1a3('0x8'));var controller=require('./voiceQueueReport.controller');router[_0xf1a3('0x9')]('/',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xb')]);router['get'](_0xf1a3('0xc'),auth['isAuthenticated'](),controller[_0xf1a3('0xd')]);router[_0xf1a3('0x9')]('/index',auth[_0xf1a3('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0xf1a3('0xe'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xf')]);router[_0xf1a3('0x10')]('/',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x11')]);router[_0xf1a3('0x12')](_0xf1a3('0xe'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x13')]);router[_0xf1a3('0x14')](_0xf1a3('0xe'),auth[_0xf1a3('0xa')](),controller['destroy']);module[_0xf1a3('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index cba559e..2899963 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 _0xffcf=['format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','STRING','DATE','getDataValue'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xffcf,0xdf));var _0xfffc=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xffcf[_0x339129];return _0x1570df;};'use strict';var Sequelize=require(_0xfffc('0x0'));var moment=require(_0xfffc('0x1'));module['exports']={'type':{'type':Sequelize[_0xfffc('0x2')]},'uniqueid':{'type':Sequelize[_0xfffc('0x2')]},'calleridnum':{'type':Sequelize[_0xfffc('0x2')]},'calleridname':{'type':Sequelize[_0xfffc('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xfffc('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xfffc('0x3')],'set':function(_0x1bd35a){var _0x4bd1dd=moment(_0x1bd35a);var _0x3d2a4c=moment(this[_0xfffc('0x4')]('queuecallerjoinAt'))[_0xfffc('0x5')](_0xfffc('0x6'));var _0x5da23d=_0x4bd1dd['diff'](_0x3d2a4c,_0xfffc('0x7'));this[_0xfffc('0x8')]('queuecallerleaveAt',_0x1bd35a);this['setDataValue']('holdtime',_0x5da23d||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xfffc('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xfffc('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xfffc('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xfffc('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xfffc('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xfffc('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xfffc('0x2')],'comment':_0xfffc('0xb')},'originalposition':{'type':Sequelize[_0xfffc('0x9')]},'channel':{'type':Sequelize[_0xfffc('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xfffc('0x2')]},'accountcode':{'type':Sequelize[_0xfffc('0x2')]},'context':{'type':Sequelize[_0xfffc('0x2')]},'exten':{'type':Sequelize[_0xfffc('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xfffc('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfffc('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xfffc('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfffc('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xfffc('0x2')]},'disposition':{'type':Sequelize[_0xfffc('0x2')]},'secondDisposition':{'type':Sequelize[_0xfffc('0x2')]},'thirdDisposition':{'type':Sequelize[_0xfffc('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x58b8=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','BOOLEAN','sequelize','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x58b8,0x10a));var _0x858b=function(_0x405541,_0x2945cc){_0x405541=_0x405541-0x0;var _0x194a1e=_0x58b8[_0x405541];return _0x194a1e;};'use strict';var Sequelize=require(_0x858b('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x858b('0x1')]},'uniqueid':{'type':Sequelize[_0x858b('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x858b('0x1')]},'queue':{'type':Sequelize[_0x858b('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x858b('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x858b('0x2')],'set':function(_0x4284e7){var _0x58dcb5=moment(_0x4284e7);var _0x1b43c9=moment(this['getDataValue'](_0x858b('0x3')))[_0x858b('0x4')](_0x858b('0x5'));var _0x6cadb1=_0x58dcb5[_0x858b('0x6')](_0x1b43c9,'seconds');this[_0x858b('0x7')]('queuecallerleaveAt',_0x4284e7);this[_0x858b('0x7')](_0x858b('0x8'),_0x6cadb1||null);}},'position':{'type':Sequelize[_0x858b('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x858b('0x2')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x858b('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x858b('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x858b('0xa')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x858b('0x1')]},'connectedlinename':{'type':Sequelize[_0x858b('0x1')]},'accountcode':{'type':Sequelize[_0x858b('0x1')]},'context':{'type':Sequelize[_0x858b('0x1')]},'exten':{'type':Sequelize[_0x858b('0x1')]},'priority':{'type':Sequelize[_0x858b('0x1')]},'holdtime':{'type':Sequelize[_0x858b('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x858b('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x858b('0x1')]},'transferuniqueid':{'type':Sequelize[_0x858b('0x1')]},'disposition':{'type':Sequelize[_0x858b('0x1')]},'secondDisposition':{'type':Sequelize[_0x858b('0x1')]},'thirdDisposition':{'type':Sequelize[_0x858b('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x858b('0x9')],'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 471460d..1f6a6a8 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 _0x82b8=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','pick','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0x82b8,0x89));var _0x882b=function(_0x721ae7,_0x201f9d){_0x721ae7=_0x721ae7-0x0;var _0xe075b8=_0x82b8[_0x721ae7];return _0xe075b8;};'use strict';var emlformat=require(_0x882b('0x0'));var rimraf=require(_0x882b('0x1'));var zipdir=require(_0x882b('0x2'));var jsonpatch=require(_0x882b('0x3'));var rp=require('request-promise');var moment=require(_0x882b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x882b('0x5'));var util=require(_0x882b('0x6'));var path=require(_0x882b('0x7'));var sox=require(_0x882b('0x8'));var csv=require('to-csv');var ejs=require(_0x882b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x882b('0xa'));var squel=require(_0x882b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x882b('0xc'));var Papa=require(_0x882b('0xd'));var Redis=require(_0x882b('0xe'));var authService=require(_0x882b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x882b('0x10'));var hardwareService=require(_0x882b('0x11'));var logger=require(_0x882b('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x882b('0x13'));var db=require(_0x882b('0x14'))['db'];config[_0x882b('0x15')]=_[_0x882b('0x16')](config['redis'],{'host':_0x882b('0x17'),'port':0x18eb});var socket=require(_0x882b('0x18'))(new Redis(config[_0x882b('0x15')]));require('./voiceQueueReport.socket')[_0x882b('0x19')](socket);function respondWithStatusCode(_0x5d320e,_0x5be4dd){_0x5be4dd=_0x5be4dd||0xcc;return function(_0xdaaa84){if(_0xdaaa84){return _0x5d320e[_0x882b('0x1a')](_0x5be4dd);}return _0x5d320e[_0x882b('0x1b')](_0x5be4dd)[_0x882b('0x1c')]();};}function respondWithResult(_0x42e5c5,_0x22315b){_0x22315b=_0x22315b||0xc8;return function(_0x26b053){if(_0x26b053){return _0x42e5c5['status'](_0x22315b)[_0x882b('0x1d')](_0x26b053);}};}function respondWithFilteredResult(_0x9f8c90,_0x19b39f){return function(_0x2089ac){if(_0x2089ac){var _0x1aba07=typeof _0x19b39f['offset']==='undefined'&&typeof _0x19b39f[_0x882b('0x1e')]==='undefined';var _0x6a9e21=_0x2089ac[_0x882b('0x1f')];var _0xed147b=_0x1aba07?0x0:_0x19b39f[_0x882b('0x20')];var _0x36ddfe=_0x1aba07?_0x2089ac[_0x882b('0x1f')]:_0x19b39f[_0x882b('0x20')]+_0x19b39f[_0x882b('0x1e')];var _0x1e44a9;if(_0x36ddfe>=_0x6a9e21){_0x36ddfe=_0x6a9e21;_0x1e44a9=0xc8;}else{_0x1e44a9=0xce;}_0x9f8c90[_0x882b('0x1b')](_0x1e44a9);return _0x9f8c90[_0x882b('0x21')](_0x882b('0x22'),_0xed147b+'-'+_0x36ddfe+'/'+_0x6a9e21)[_0x882b('0x1d')](_0x2089ac);}return null;};}function patchUpdates(_0x1210da){return function(_0x4a6da5){try{jsonpatch[_0x882b('0x23')](_0x4a6da5,_0x1210da,!![]);}catch(_0x144fb1){return BPromise['reject'](_0x144fb1);}return _0x4a6da5[_0x882b('0x24')]();};}function saveUpdates(_0x36a0df,_0x290b2b){return function(_0x12cb45){if(_0x12cb45){return _0x12cb45[_0x882b('0x25')](_0x36a0df)[_0x882b('0x26')](function(_0x371e9a){return _0x371e9a;});}return null;};}function removeEntity(_0xa92b9e,_0x21b228){return function(_0x53d6a9){if(_0x53d6a9){return _0x53d6a9[_0x882b('0x27')]()[_0x882b('0x26')](function(){_0xa92b9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x303ddd,_0x1f8e75){return function(_0x5976b5){if(!_0x5976b5){_0x303ddd['sendStatus'](0x194);}return _0x5976b5;};}function handleError(_0x56c2ad,_0x450b13){_0x450b13=_0x450b13||0x1f4;return function(_0xd98299){logger[_0x882b('0x28')](_0xd98299['stack']);if(_0xd98299['name']){delete _0xd98299['name'];}_0x56c2ad['status'](_0x450b13)[_0x882b('0x29')](_0xd98299);};}exports[_0x882b('0x2a')]=function(_0x1ba6bc,_0x45fd0f){var _0x8a8c75={},_0x568c9c={},_0x1abdcf={'count':0x0,'rows':[]};var _0x4bd2ac=_[_0x882b('0x2b')](db[_0x882b('0x2c')][_0x882b('0x2d')],function(_0x1615a6){return{'name':_0x1615a6[_0x882b('0x2e')],'type':_0x1615a6[_0x882b('0x2f')]['key']};});_0x568c9c[_0x882b('0x30')]=_[_0x882b('0x2b')](_0x4bd2ac,_0x882b('0x31'));_0x568c9c[_0x882b('0x32')]=_['keys'](_0x1ba6bc[_0x882b('0x32')]);_0x568c9c['filters']=_[_0x882b('0x33')](_0x568c9c[_0x882b('0x30')],_0x568c9c[_0x882b('0x32')]);_0x8a8c75['attributes']=_[_0x882b('0x33')](_0x568c9c[_0x882b('0x30')],qs[_0x882b('0x34')](_0x1ba6bc[_0x882b('0x32')]['fields']));_0x8a8c75[_0x882b('0x35')]=_0x8a8c75[_0x882b('0x35')][_0x882b('0x36')]?_0x8a8c75[_0x882b('0x35')]:_0x568c9c[_0x882b('0x30')];if(!_0x1ba6bc[_0x882b('0x32')][_0x882b('0x37')](_0x882b('0x38'))){_0x8a8c75[_0x882b('0x1e')]=qs[_0x882b('0x1e')](_0x1ba6bc[_0x882b('0x32')]['limit']);_0x8a8c75['offset']=qs[_0x882b('0x20')](_0x1ba6bc['query'][_0x882b('0x20')]);}_0x8a8c75[_0x882b('0x39')]=qs[_0x882b('0x3a')](_0x1ba6bc[_0x882b('0x32')][_0x882b('0x3a')]);_0x8a8c75[_0x882b('0x3b')]=qs[_0x882b('0x3c')](_['pick'](_0x1ba6bc['query'],_0x568c9c['filters']),_0x4bd2ac);if(_0x1ba6bc['query']['filter']){_0x8a8c75[_0x882b('0x3b')]=_[_0x882b('0x3d')](_0x8a8c75['where'],{'$or':_[_0x882b('0x2b')](_0x4bd2ac,function(_0x26590a){if(_0x26590a['type']!==_0x882b('0x3e')){var _0x5b13ae={};_0x5b13ae[_0x26590a['name']]={'$like':'%'+_0x1ba6bc[_0x882b('0x32')][_0x882b('0x3f')]+'%'};return _0x5b13ae;}})});}_0x8a8c75=_[_0x882b('0x3d')]({},_0x8a8c75,_0x1ba6bc[_0x882b('0x40')]);var _0x34d02d={'where':_0x8a8c75['where']};return db[_0x882b('0x2c')]['count'](_0x34d02d)[_0x882b('0x26')](function(_0x5e1a73){_0x1abdcf[_0x882b('0x1f')]=_0x5e1a73;if(_0x1ba6bc[_0x882b('0x32')][_0x882b('0x41')]){_0x8a8c75[_0x882b('0x42')]=[{'all':!![]}];}return db[_0x882b('0x2c')][_0x882b('0x43')](_0x8a8c75);})[_0x882b('0x26')](function(_0x5e8a7d){_0x1abdcf[_0x882b('0x44')]=_0x5e8a7d;return _0x1abdcf;})[_0x882b('0x26')](respondWithFilteredResult(_0x45fd0f,_0x8a8c75))[_0x882b('0x45')](handleError(_0x45fd0f,null));};exports[_0x882b('0x46')]=function(_0x7e6fac,_0x501199){var _0x28ec2e={'raw':![],'where':{'id':_0x7e6fac[_0x882b('0x47')]['id']}},_0x408348={};_0x408348[_0x882b('0x30')]=_['keys'](db[_0x882b('0x2c')][_0x882b('0x2d')]);_0x408348[_0x882b('0x32')]=_[_0x882b('0x48')](_0x7e6fac[_0x882b('0x32')]);_0x408348[_0x882b('0x3c')]=_[_0x882b('0x33')](_0x408348[_0x882b('0x30')],_0x408348[_0x882b('0x32')]);_0x28ec2e[_0x882b('0x35')]=_['intersection'](_0x408348[_0x882b('0x30')],qs[_0x882b('0x34')](_0x7e6fac['query']['fields']));_0x28ec2e[_0x882b('0x35')]=_0x28ec2e['attributes'][_0x882b('0x36')]?_0x28ec2e[_0x882b('0x35')]:_0x408348['model'];if(_0x7e6fac[_0x882b('0x32')][_0x882b('0x41')]){_0x28ec2e[_0x882b('0x42')]=[{'all':!![]}];}_0x28ec2e=_[_0x882b('0x3d')]({},_0x28ec2e,_0x7e6fac[_0x882b('0x40')]);return db[_0x882b('0x2c')][_0x882b('0x49')](_0x28ec2e)[_0x882b('0x26')](handleEntityNotFound(_0x501199,null))[_0x882b('0x26')](respondWithResult(_0x501199,null))[_0x882b('0x45')](handleError(_0x501199,null));};exports[_0x882b('0x4a')]=function(_0x148656,_0x5494a7){return db[_0x882b('0x2c')][_0x882b('0x4a')](_0x148656[_0x882b('0x4b')],{})[_0x882b('0x26')](respondWithResult(_0x5494a7,0xc9))[_0x882b('0x45')](handleError(_0x5494a7,null));};exports[_0x882b('0x25')]=function(_0x1dcc9f,_0x146556){if(_0x1dcc9f[_0x882b('0x4b')]['id']){delete _0x1dcc9f[_0x882b('0x4b')]['id'];}return db['VoiceQueueReport'][_0x882b('0x49')]({'where':{'id':_0x1dcc9f[_0x882b('0x47')]['id']}})[_0x882b('0x26')](handleEntityNotFound(_0x146556,null))[_0x882b('0x26')](saveUpdates(_0x1dcc9f[_0x882b('0x4b')],null))[_0x882b('0x26')](respondWithResult(_0x146556,null))['catch'](handleError(_0x146556,null));};exports['destroy']=function(_0x4ab677,_0x18666b){return db[_0x882b('0x2c')][_0x882b('0x49')]({'where':{'id':_0x4ab677['params']['id']}})[_0x882b('0x26')](handleEntityNotFound(_0x18666b,null))[_0x882b('0x26')](removeEntity(_0x18666b,null))[_0x882b('0x45')](handleError(_0x18666b,null));};exports[_0x882b('0x4c')]=function(_0x447518,_0x52d02c){return db['VoiceQueueReport']['describe']()['then'](respondWithResult(_0x52d02c,null))[_0x882b('0x45')](handleError(_0x52d02c,null));};exports['getVoiceQueuesReport']=function(_0x5ad852,_0x50bb91){var _0x448768={},_0x5d2293={},_0x314045={'count':0x0,'rows':[]};_0x5d2293[_0x882b('0x30')]=_[_0x882b('0x48')](db['VoiceQueueReport']['rawAttributes']);_0x5d2293[_0x882b('0x32')]=_[_0x882b('0x48')](_0x5ad852[_0x882b('0x32')]);_0x5d2293['filters']=_[_0x882b('0x33')](_0x5d2293[_0x882b('0x30')],_0x5d2293[_0x882b('0x32')]);_0x448768['attributes']=_[_0x882b('0x33')](_0x5d2293['model'],qs[_0x882b('0x34')](_0x5ad852[_0x882b('0x32')][_0x882b('0x34')]));_0x448768[_0x882b('0x35')]=_0x448768[_0x882b('0x35')][_0x882b('0x36')]?_0x448768[_0x882b('0x35')]:_0x5d2293[_0x882b('0x30')];if(!_0x5ad852[_0x882b('0x32')]['hasOwnProperty'](_0x882b('0x38'))){_0x448768[_0x882b('0x1e')]=qs[_0x882b('0x1e')](_0x5ad852[_0x882b('0x32')][_0x882b('0x1e')]);_0x448768[_0x882b('0x20')]=qs[_0x882b('0x20')](_0x5ad852[_0x882b('0x32')][_0x882b('0x20')]);}_0x448768[_0x882b('0x39')]=qs[_0x882b('0x3a')](_0x5ad852[_0x882b('0x32')][_0x882b('0x3a')]);_0x448768[_0x882b('0x3b')]=qs[_0x882b('0x3c')](_[_0x882b('0x4d')](_0x5ad852['query'],_0x5d2293[_0x882b('0x3c')]));if(_0x5ad852['query']['filter']){_0x448768['where']=_['merge'](_0x448768['where'],{'$or':_[_0x882b('0x2b')](_0x448768[_0x882b('0x35')],function(_0xb24f30){var _0x3f019e={};_0x3f019e[_0xb24f30]={'$like':'%'+_0x5ad852['query']['filter']+'%'};return _0x3f019e;})});}_0x448768=_['merge']({},_0x448768,_0x5ad852[_0x882b('0x40')]);var _0x49d690={'where':_0x448768[_0x882b('0x3b')]};return db[_0x882b('0x2c')][_0x882b('0x1f')](_0x49d690)[_0x882b('0x26')](function(_0x4b70f2){_0x314045['count']=_0x4b70f2;if(_0x5ad852['query']['includeAll']){_0x448768[_0x882b('0x42')]=[{'all':!![]}];}return db[_0x882b('0x2c')][_0x882b('0x43')](_0x448768);})[_0x882b('0x26')](function(_0x2cafbc){_0x314045[_0x882b('0x44')]=_0x2cafbc;return _0x314045;})['then'](respondWithFilteredResult(_0x50bb91,_0x448768,'getVoiceQueuesReport'))[_0x882b('0x45')](handleError(_0x50bb91,null,_0x882b('0x4e')));}; \ No newline at end of file +var _0x358f=['undefined','limit','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset'];(function(_0x2e3151,_0x171962){var _0x49a026=function(_0x30d671){while(--_0x30d671){_0x2e3151['push'](_0x2e3151['shift']());}};_0x49a026(++_0x171962);}(_0x358f,0xcb));var _0xf358=function(_0x590938,_0x205ccd){_0x590938=_0x590938-0x0;var _0x18b0d9=_0x358f[_0x590938];return _0x18b0d9;};'use strict';var emlformat=require(_0xf358('0x0'));var rimraf=require(_0xf358('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf358('0x2'));var moment=require(_0xf358('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf358('0x4'));var util=require(_0xf358('0x5'));var path=require(_0xf358('0x6'));var sox=require(_0xf358('0x7'));var csv=require(_0xf358('0x8'));var ejs=require(_0xf358('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf358('0xa'));var squel=require(_0xf358('0xb'));var crypto=require(_0xf358('0xc'));var jsforce=require(_0xf358('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf358('0x8'));var querystring=require(_0xf358('0xe'));var Papa=require(_0xf358('0xf'));var Redis=require(_0xf358('0x10'));var authService=require(_0xf358('0x11'));var qs=require(_0xf358('0x12'));var as=require(_0xf358('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf358('0x14'))(_0xf358('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf358('0x16'));var db=require('../../mysqldb')['db'];config[_0xf358('0x17')]=_['defaults'](config[_0xf358('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf358('0x18'))(new Redis(config[_0xf358('0x17')]));require(_0xf358('0x19'))[_0xf358('0x1a')](socket);function respondWithStatusCode(_0x51332f,_0x5187a7){_0x5187a7=_0x5187a7||0xcc;return function(_0x44ff0c){if(_0x44ff0c){return _0x51332f[_0xf358('0x1b')](_0x5187a7);}return _0x51332f['status'](_0x5187a7)['end']();};}function respondWithResult(_0x31dc80,_0x488973){_0x488973=_0x488973||0xc8;return function(_0x4a5e9b){if(_0x4a5e9b){return _0x31dc80[_0xf358('0x1c')](_0x488973)[_0xf358('0x1d')](_0x4a5e9b);}};}function respondWithFilteredResult(_0x19f2ad,_0x29b608){return function(_0x3daac6){if(_0x3daac6){var _0x49f10f=typeof _0x29b608[_0xf358('0x1e')]===_0xf358('0x1f')&&typeof _0x29b608[_0xf358('0x20')]===_0xf358('0x1f');var _0x33dd70=_0x3daac6['count'];var _0x184b5e=_0x49f10f?0x0:_0x29b608['offset'];var _0xa66c42=_0x49f10f?_0x3daac6['count']:_0x29b608[_0xf358('0x1e')]+_0x29b608['limit'];var _0x3d7820;if(_0xa66c42>=_0x33dd70){_0xa66c42=_0x33dd70;_0x3d7820=0xc8;}else{_0x3d7820=0xce;}_0x19f2ad[_0xf358('0x1c')](_0x3d7820);return _0x19f2ad['set'](_0xf358('0x21'),_0x184b5e+'-'+_0xa66c42+'/'+_0x33dd70)[_0xf358('0x1d')](_0x3daac6);}return null;};}function patchUpdates(_0x2a95fc){return function(_0x37f7fe){try{jsonpatch['apply'](_0x37f7fe,_0x2a95fc,!![]);}catch(_0x2644a3){return BPromise[_0xf358('0x22')](_0x2644a3);}return _0x37f7fe[_0xf358('0x23')]();};}function saveUpdates(_0x27e9bf,_0x4857ab){return function(_0x51088f){if(_0x51088f){return _0x51088f[_0xf358('0x24')](_0x27e9bf)[_0xf358('0x25')](function(_0x54ad31){return _0x54ad31;});}return null;};}function removeEntity(_0x1c1925,_0x609ad7){return function(_0x5dd12e){if(_0x5dd12e){return _0x5dd12e[_0xf358('0x26')]()[_0xf358('0x25')](function(){_0x1c1925[_0xf358('0x1c')](0xcc)[_0xf358('0x27')]();});}};}function handleEntityNotFound(_0x57f349,_0x29081c){return function(_0x1d78f6){if(!_0x1d78f6){_0x57f349[_0xf358('0x1b')](0x194);}return _0x1d78f6;};}function handleError(_0x1a0e6a,_0xe9a700){_0xe9a700=_0xe9a700||0x1f4;return function(_0x4bd545){logger['error'](_0x4bd545[_0xf358('0x28')]);if(_0x4bd545[_0xf358('0x29')]){delete _0x4bd545['name'];}_0x1a0e6a['status'](_0xe9a700)[_0xf358('0x2a')](_0x4bd545);};}exports[_0xf358('0x2b')]=function(_0x40ea66,_0x2cb560){var _0x3f195b={},_0x530a32={},_0x210f5f={'count':0x0,'rows':[]};var _0x2d4ada=_[_0xf358('0x2c')](db[_0xf358('0x2d')][_0xf358('0x2e')],function(_0x3be526){return{'name':_0x3be526['fieldName'],'type':_0x3be526[_0xf358('0x2f')]['key']};});_0x530a32[_0xf358('0x30')]=_[_0xf358('0x2c')](_0x2d4ada,'name');_0x530a32[_0xf358('0x31')]=_[_0xf358('0x32')](_0x40ea66['query']);_0x530a32[_0xf358('0x33')]=_[_0xf358('0x34')](_0x530a32[_0xf358('0x30')],_0x530a32[_0xf358('0x31')]);_0x3f195b['attributes']=_['intersection'](_0x530a32[_0xf358('0x30')],qs[_0xf358('0x35')](_0x40ea66[_0xf358('0x31')][_0xf358('0x35')]));_0x3f195b[_0xf358('0x36')]=_0x3f195b[_0xf358('0x36')][_0xf358('0x37')]?_0x3f195b['attributes']:_0x530a32[_0xf358('0x30')];if(!_0x40ea66[_0xf358('0x31')][_0xf358('0x38')](_0xf358('0x39'))){_0x3f195b[_0xf358('0x20')]=qs['limit'](_0x40ea66[_0xf358('0x31')][_0xf358('0x20')]);_0x3f195b[_0xf358('0x1e')]=qs[_0xf358('0x1e')](_0x40ea66[_0xf358('0x31')][_0xf358('0x1e')]);}_0x3f195b[_0xf358('0x3a')]=qs['sort'](_0x40ea66[_0xf358('0x31')][_0xf358('0x3b')]);_0x3f195b['where']=qs[_0xf358('0x33')](_[_0xf358('0x3c')](_0x40ea66[_0xf358('0x31')],_0x530a32[_0xf358('0x33')]),_0x2d4ada);if(_0x40ea66['query'][_0xf358('0x3d')]){_0x3f195b[_0xf358('0x3e')]=_['merge'](_0x3f195b[_0xf358('0x3e')],{'$or':_[_0xf358('0x2c')](_0x2d4ada,function(_0xed04b5){if(_0xed04b5['type']!==_0xf358('0x3f')){var _0x49dda7={};_0x49dda7[_0xed04b5['name']]={'$like':'%'+_0x40ea66[_0xf358('0x31')]['filter']+'%'};return _0x49dda7;}})});}_0x3f195b=_[_0xf358('0x40')]({},_0x3f195b,_0x40ea66[_0xf358('0x41')]);var _0x567c07={'where':_0x3f195b[_0xf358('0x3e')]};return db['VoiceQueueReport'][_0xf358('0x42')](_0x567c07)[_0xf358('0x25')](function(_0x2b82b2){_0x210f5f[_0xf358('0x42')]=_0x2b82b2;if(_0x40ea66[_0xf358('0x31')][_0xf358('0x43')]){_0x3f195b[_0xf358('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xf358('0x45')](_0x3f195b);})[_0xf358('0x25')](function(_0xa388ae){_0x210f5f[_0xf358('0x46')]=_0xa388ae;return _0x210f5f;})[_0xf358('0x25')](respondWithFilteredResult(_0x2cb560,_0x3f195b))[_0xf358('0x47')](handleError(_0x2cb560,null));};exports['show']=function(_0x329833,_0x2cba35){var _0x55c6f8={'raw':![],'where':{'id':_0x329833[_0xf358('0x48')]['id']}},_0x2e1438={};_0x2e1438[_0xf358('0x30')]=_['keys'](db[_0xf358('0x2d')][_0xf358('0x2e')]);_0x2e1438[_0xf358('0x31')]=_[_0xf358('0x32')](_0x329833[_0xf358('0x31')]);_0x2e1438['filters']=_[_0xf358('0x34')](_0x2e1438[_0xf358('0x30')],_0x2e1438[_0xf358('0x31')]);_0x55c6f8[_0xf358('0x36')]=_[_0xf358('0x34')](_0x2e1438[_0xf358('0x30')],qs['fields'](_0x329833['query']['fields']));_0x55c6f8[_0xf358('0x36')]=_0x55c6f8[_0xf358('0x36')][_0xf358('0x37')]?_0x55c6f8[_0xf358('0x36')]:_0x2e1438[_0xf358('0x30')];if(_0x329833[_0xf358('0x31')][_0xf358('0x43')]){_0x55c6f8[_0xf358('0x44')]=[{'all':!![]}];}_0x55c6f8=_[_0xf358('0x40')]({},_0x55c6f8,_0x329833[_0xf358('0x41')]);return db[_0xf358('0x2d')][_0xf358('0x49')](_0x55c6f8)[_0xf358('0x25')](handleEntityNotFound(_0x2cba35,null))[_0xf358('0x25')](respondWithResult(_0x2cba35,null))[_0xf358('0x47')](handleError(_0x2cba35,null));};exports[_0xf358('0x4a')]=function(_0xec6c54,_0x3822f2){return db[_0xf358('0x2d')][_0xf358('0x4a')](_0xec6c54[_0xf358('0x4b')],{})[_0xf358('0x25')](respondWithResult(_0x3822f2,0xc9))[_0xf358('0x47')](handleError(_0x3822f2,null));};exports[_0xf358('0x24')]=function(_0x517af3,_0x4179e8){if(_0x517af3[_0xf358('0x4b')]['id']){delete _0x517af3[_0xf358('0x4b')]['id'];}return db[_0xf358('0x2d')][_0xf358('0x49')]({'where':{'id':_0x517af3['params']['id']}})['then'](handleEntityNotFound(_0x4179e8,null))['then'](saveUpdates(_0x517af3['body'],null))[_0xf358('0x25')](respondWithResult(_0x4179e8,null))['catch'](handleError(_0x4179e8,null));};exports[_0xf358('0x26')]=function(_0x54b949,_0x338f5b){return db[_0xf358('0x2d')][_0xf358('0x49')]({'where':{'id':_0x54b949[_0xf358('0x48')]['id']}})[_0xf358('0x25')](handleEntityNotFound(_0x338f5b,null))[_0xf358('0x25')](removeEntity(_0x338f5b,null))[_0xf358('0x47')](handleError(_0x338f5b,null));};exports[_0xf358('0x4c')]=function(_0x1ae3ee,_0x582f62){return db[_0xf358('0x2d')][_0xf358('0x4c')]()[_0xf358('0x25')](respondWithResult(_0x582f62,null))[_0xf358('0x47')](handleError(_0x582f62,null));};exports[_0xf358('0x4d')]=function(_0x3b2cff,_0x3a9373){var _0x5f0b72={},_0x4687a3={},_0x4e3354={'count':0x0,'rows':[]};_0x4687a3[_0xf358('0x30')]=_['keys'](db[_0xf358('0x2d')][_0xf358('0x2e')]);_0x4687a3['query']=_['keys'](_0x3b2cff[_0xf358('0x31')]);_0x4687a3[_0xf358('0x33')]=_[_0xf358('0x34')](_0x4687a3[_0xf358('0x30')],_0x4687a3['query']);_0x5f0b72[_0xf358('0x36')]=_[_0xf358('0x34')](_0x4687a3['model'],qs[_0xf358('0x35')](_0x3b2cff[_0xf358('0x31')]['fields']));_0x5f0b72[_0xf358('0x36')]=_0x5f0b72[_0xf358('0x36')]['length']?_0x5f0b72[_0xf358('0x36')]:_0x4687a3[_0xf358('0x30')];if(!_0x3b2cff[_0xf358('0x31')][_0xf358('0x38')](_0xf358('0x39'))){_0x5f0b72['limit']=qs[_0xf358('0x20')](_0x3b2cff[_0xf358('0x31')][_0xf358('0x20')]);_0x5f0b72[_0xf358('0x1e')]=qs[_0xf358('0x1e')](_0x3b2cff[_0xf358('0x31')][_0xf358('0x1e')]);}_0x5f0b72[_0xf358('0x3a')]=qs[_0xf358('0x3b')](_0x3b2cff[_0xf358('0x31')]['sort']);_0x5f0b72['where']=qs[_0xf358('0x33')](_[_0xf358('0x3c')](_0x3b2cff[_0xf358('0x31')],_0x4687a3['filters']));if(_0x3b2cff[_0xf358('0x31')]['filter']){_0x5f0b72['where']=_[_0xf358('0x40')](_0x5f0b72['where'],{'$or':_[_0xf358('0x2c')](_0x5f0b72[_0xf358('0x36')],function(_0x5b7d41){var _0x277fef={};_0x277fef[_0x5b7d41]={'$like':'%'+_0x3b2cff[_0xf358('0x31')]['filter']+'%'};return _0x277fef;})});}_0x5f0b72=_[_0xf358('0x40')]({},_0x5f0b72,_0x3b2cff[_0xf358('0x41')]);var _0x2c616a={'where':_0x5f0b72['where']};return db[_0xf358('0x2d')][_0xf358('0x42')](_0x2c616a)[_0xf358('0x25')](function(_0x5be9ee){_0x4e3354[_0xf358('0x42')]=_0x5be9ee;if(_0x3b2cff['query']['includeAll']){_0x5f0b72[_0xf358('0x44')]=[{'all':!![]}];}return db[_0xf358('0x2d')][_0xf358('0x45')](_0x5f0b72);})[_0xf358('0x25')](function(_0x5d44ea){_0x4e3354[_0xf358('0x46')]=_0x5d44ea;return _0x4e3354;})[_0xf358('0x25')](respondWithFilteredResult(_0x3a9373,_0x5f0b72,_0xf358('0x4d')))[_0xf358('0x47')](handleError(_0x3a9373,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index c5b4441..2f38bd0 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 _0xf4d5=['VoiceQueueReport','setMaxListeners','save','remove','emit','exports','events','../../mysqldb'];(function(_0x390143,_0x2b54ac){var _0x11361b=function(_0x3666c3){while(--_0x3666c3){_0x390143['push'](_0x390143['shift']());}};_0x11361b(++_0x2b54ac);}(_0xf4d5,0x126));var _0x5f4d=function(_0x41405b,_0x110dea){_0x41405b=_0x41405b-0x0;var _0x554bfa=_0xf4d5[_0x41405b];return _0x554bfa;};'use strict';var EventEmitter=require(_0x5f4d('0x0'));var VoiceQueueReport=require(_0x5f4d('0x1'))['db'][_0x5f4d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5f4d('0x3')](0x0);var events={'afterCreate':_0x5f4d('0x4'),'afterUpdate':'update','afterDestroy':_0x5f4d('0x5')};function emitEvent(_0x439858){return function(_0x5288aa,_0x2f0569,_0x4ec82d){VoiceQueueReportEvents[_0x5f4d('0x6')](_0x439858+':'+_0x5288aa['id'],_0x5288aa);VoiceQueueReportEvents[_0x5f4d('0x6')](_0x439858,_0x5288aa);_0x4ec82d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5f4d('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x058c=['VoiceQueueReport','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x566e01,_0x16d6b3){var _0x525851=function(_0x5eeb4b){while(--_0x5eeb4b){_0x566e01['push'](_0x566e01['shift']());}};_0x525851(++_0x16d6b3);}(_0x058c,0x1db));var _0xc058=function(_0x9e9a5e,_0x20e4f8){_0x9e9a5e=_0x9e9a5e-0x0;var _0x27397e=_0x058c[_0x9e9a5e];return _0x27397e;};'use strict';var EventEmitter=require(_0xc058('0x0'));var VoiceQueueReport=require(_0xc058('0x1'))['db'][_0xc058('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc058('0x3'),'afterUpdate':_0xc058('0x4'),'afterDestroy':_0xc058('0x5')};function emitEvent(_0x20f1ae){return function(_0x5c8cec,_0x1d0c5b,_0x11d70c){VoiceQueueReportEvents[_0xc058('0x6')](_0x20f1ae+':'+_0x5c8cec['id'],_0x5c8cec);VoiceQueueReportEvents['emit'](_0x20f1ae,_0x5c8cec);_0x11d70c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xc058('0x7')](e,emitEvent(event));}}module[_0xc058('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 83e59fd..fe98698 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 _0xd69a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','lodash','../../config/logger','api'];(function(_0x3af275,_0x1730fd){var _0x4cc88=function(_0xa9211a){while(--_0xa9211a){_0x3af275['push'](_0x3af275['shift']());}};_0x4cc88(++_0x1730fd);}(_0xd69a,0xa5));var _0xad69=function(_0x4eeb54,_0xfc52dc){_0x4eeb54=_0x4eeb54-0x0;var _0xc0e018=_0xd69a[_0x4eeb54];return _0xc0e018;};'use strict';var _=require(_0xad69('0x0'));var util=require('util');var logger=require(_0xad69('0x1'))(_0xad69('0x2'));var moment=require(_0xad69('0x3'));var BPromise=require(_0xad69('0x4'));var rp=require(_0xad69('0x5'));var fs=require('fs');var path=require(_0xad69('0x6'));var rimraf=require(_0xad69('0x7'));var config=require(_0xad69('0x8'));var attributes=require(_0xad69('0x9'));module[_0xad69('0xa')]=function(_0x2fbbaf,_0x4026c9){return _0x2fbbaf[_0xad69('0xb')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x22f6=['VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x22f6,0x10e));var _0x622f=function(_0x33e31b,_0xab5709){_0x33e31b=_0x33e31b-0x0;var _0x24759f=_0x22f6[_0x33e31b];return _0x24759f;};'use strict';var _=require(_0x622f('0x0'));var util=require('util');var logger=require(_0x622f('0x1'))('api');var moment=require(_0x622f('0x2'));var BPromise=require(_0x622f('0x3'));var rp=require(_0x622f('0x4'));var fs=require('fs');var path=require(_0x622f('0x5'));var rimraf=require(_0x622f('0x6'));var config=require(_0x622f('0x7'));var attributes=require(_0x622f('0x8'));module[_0x622f('0x9')]=function(_0x659c64,_0x342d96){return _0x659c64['define'](_0x622f('0xa'),attributes,{'tableName':_0x622f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x622f('0xc')]},{'fields':[_0x622f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 439c150..8a729df 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 _0x25e2=['include','map','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit'];(function(_0x11e6e8,_0x47a1b2){var _0xe52c25=function(_0x91874f){while(--_0x91874f){_0x11e6e8['push'](_0x11e6e8['shift']());}};_0xe52c25(++_0x47a1b2);}(_0x25e2,0x1d6));var _0x225e=function(_0x2880e0,_0x3d08e9){_0x2880e0=_0x2880e0-0x0;var _0x52293e=_0x25e2[_0x2880e0];return _0x52293e;};'use strict';var _=require(_0x225e('0x0'));var util=require(_0x225e('0x1'));var moment=require(_0x225e('0x2'));var BPromise=require('bluebird');var rs=require(_0x225e('0x3'));var fs=require('fs');var Redis=require(_0x225e('0x4'));var db=require(_0x225e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x225e('0x6'))(_0x225e('0x7'));var config=require(_0x225e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x225e('0x9')][_0x225e('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x225e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x225e('0xc'))(new Redis(config[_0x225e('0xb')]));require(_0x225e('0xd'))[_0x225e('0xe')](socket);function respondWithRpcPromise(_0x5cd314,_0x341797,_0x253f04){return new BPromise(function(_0x2c27d7,_0xee7eea){return client[_0x225e('0xf')](_0x5cd314,_0x253f04)[_0x225e('0x10')](function(_0x4d079d){logger[_0x225e('0x11')](_0x225e('0x12'),_0x341797,'request\x20sent');logger[_0x225e('0x13')](_0x225e('0x14'),_0x341797,_0x225e('0x15'),JSON[_0x225e('0x16')](_0x4d079d));if(_0x4d079d[_0x225e('0x17')]){if(_0x4d079d[_0x225e('0x17')][_0x225e('0x18')]===0x1f4){logger['error'](_0x225e('0x12'),_0x341797,_0x4d079d[_0x225e('0x17')][_0x225e('0x19')]);return _0xee7eea(_0x4d079d[_0x225e('0x17')]['message']);}logger[_0x225e('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x341797,_0x4d079d[_0x225e('0x17')]['message']);return _0x2c27d7(_0x4d079d[_0x225e('0x17')][_0x225e('0x19')]);}else{logger[_0x225e('0x11')](_0x225e('0x12'),_0x341797,'request\x20sent');_0x2c27d7(_0x4d079d['result']['message']);}})[_0x225e('0x1a')](function(_0x203633){logger['error'](_0x225e('0x12'),_0x341797,_0x203633);_0xee7eea(_0x203633);});});}exports['GetVoiceQueueReport']=function(_0x851166){var _0xbb6363=this;return new Promise(function(_0x26bd36,_0x272957){return db[_0x225e('0x1b')][_0x225e('0x1c')]({'raw':_0x851166[_0x225e('0x1d')]?_0x851166['options'][_0x225e('0x1e')]===undefined?!![]:![]:!![],'where':_0x851166[_0x225e('0x1d')]?_0x851166['options'][_0x225e('0x1f')]||null:null,'attributes':_0x851166[_0x225e('0x1d')]?_0x851166[_0x225e('0x1d')][_0x225e('0x20')]||null:null,'limit':_0x851166[_0x225e('0x1d')]?_0x851166[_0x225e('0x1d')][_0x225e('0x21')]||null:null,'include':_0x851166['options']?_0x851166[_0x225e('0x1d')][_0x225e('0x22')]?_[_0x225e('0x23')](_0x851166[_0x225e('0x1d')][_0x225e('0x22')],function(_0x4abde7){return{'model':db[_0x4abde7[_0x225e('0x24')]],'as':_0x4abde7['as'],'attributes':_0x4abde7[_0x225e('0x20')],'include':_0x4abde7[_0x225e('0x22')]?_[_0x225e('0x23')](_0x4abde7[_0x225e('0x22')],function(_0x88f1ed){return{'model':db[_0x88f1ed['model']],'as':_0x88f1ed['as'],'attributes':_0x88f1ed[_0x225e('0x20')],'include':_0x88f1ed[_0x225e('0x22')]?_['map'](_0x88f1ed['include'],function(_0x5b737f){return{'model':db[_0x5b737f[_0x225e('0x24')]],'as':_0x5b737f['as'],'attributes':_0x5b737f[_0x225e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x225e('0x10')](function(_0x4333e0){logger[_0x225e('0x11')](_0x225e('0x25'),_0x851166);logger[_0x225e('0x13')](_0x225e('0x25'),_0x851166,JSON[_0x225e('0x16')](_0x4333e0));_0x26bd36(_0x4333e0);})[_0x225e('0x1a')](function(_0x3baea3){logger['error']('GetVoiceQueueReport',_0x3baea3[_0x225e('0x19')],_0x851166);_0x272957(_0xbb6363[_0x225e('0x17')](0x1f4,_0x3baea3[_0x225e('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x169e35){var _0x1e7677=this;return new Promise(function(_0x153c58,_0x40eb05){return db[_0x225e('0x1b')][_0x225e('0x26')](_0x169e35[_0x225e('0x27')],{'raw':_0x169e35[_0x225e('0x1d')]?_0x169e35[_0x225e('0x1d')][_0x225e('0x1e')]===undefined?!![]:![]:!![]})[_0x225e('0x10')](function(_0x37ca67){logger[_0x225e('0x11')](_0x225e('0x28'),_0x169e35);logger['debug'](_0x225e('0x28'),_0x169e35,JSON[_0x225e('0x16')](_0x37ca67));_0x153c58(_0x37ca67);})[_0x225e('0x1a')](function(_0x41e2e7){logger[_0x225e('0x17')](_0x225e('0x28'),_0x41e2e7['message'],_0x169e35);_0x40eb05(_0x1e7677['error'](0x1f4,_0x41e2e7[_0x225e('0x19')]));});});};exports[_0x225e('0x29')]=function(_0x10624b){var _0x539567=this;return new Promise(function(_0x3c04c8,_0x58a499){return db['VoiceQueueReport']['update'](_0x10624b[_0x225e('0x27')],{'raw':_0x10624b[_0x225e('0x1d')]?_0x10624b['options'][_0x225e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10624b[_0x225e('0x1d')]?_0x10624b[_0x225e('0x1d')][_0x225e('0x1f')]||null:null,'attributes':_0x10624b['options']?_0x10624b[_0x225e('0x1d')]['attributes']||null:null,'limit':_0x10624b[_0x225e('0x1d')]?_0x10624b['options'][_0x225e('0x21')]||null:null})[_0x225e('0x10')](function(_0x17278f){logger[_0x225e('0x11')]('UpdateVoiceQueueReport',_0x10624b);logger['debug']('UpdateVoiceQueueReport',_0x10624b,JSON[_0x225e('0x16')](_0x17278f));_0x3c04c8(_0x17278f);})[_0x225e('0x1a')](function(_0x5683ea){logger[_0x225e('0x17')](_0x225e('0x29'),_0x5683ea[_0x225e('0x19')],_0x10624b);_0x58a499(_0x539567[_0x225e('0x17')](0x1f4,_0x5683ea[_0x225e('0x19')]));});});}; \ No newline at end of file +var _0xd4a0=['info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVoiceQueueReport','findAll','options','include','attributes','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','then','stringify','UpdateVoiceQueueReport','update','raw','where','lodash','moment','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request'];(function(_0x540854,_0x3374d6){var _0x55561a=function(_0x3fa483){while(--_0x3fa483){_0x540854['push'](_0x540854['shift']());}};_0x55561a(++_0x3374d6);}(_0xd4a0,0x132));var _0x0d4a=function(_0x357966,_0x2d787d){_0x357966=_0x357966-0x0;var _0x51e432=_0xd4a0[_0x357966];return _0x51e432;};'use strict';var _=require(_0x0d4a('0x0'));var util=require('util');var moment=require(_0x0d4a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0d4a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d4a('0x4'));var client=jayson[_0x0d4a('0x5')][_0x0d4a('0x6')]({'port':0x232a});config[_0x0d4a('0x7')]=_[_0x0d4a('0x8')](config[_0x0d4a('0x7')],{'host':_0x0d4a('0x9'),'port':0x18eb});var socket=require(_0x0d4a('0xa'))(new Redis(config[_0x0d4a('0x7')]));require(_0x0d4a('0xb'))[_0x0d4a('0xc')](socket);function respondWithRpcPromise(_0xa01b70,_0x865ef4,_0x3be911){return new BPromise(function(_0x54103e,_0x1e801c){return client[_0x0d4a('0xd')](_0xa01b70,_0x3be911)['then'](function(_0x1e8fbd){logger[_0x0d4a('0xe')](_0x0d4a('0xf'),_0x865ef4,'request\x20sent');logger[_0x0d4a('0x10')](_0x0d4a('0x11'),_0x865ef4,_0x0d4a('0x12'),JSON['stringify'](_0x1e8fbd));if(_0x1e8fbd['error']){if(_0x1e8fbd['error']['code']===0x1f4){logger['error'](_0x0d4a('0xf'),_0x865ef4,_0x1e8fbd[_0x0d4a('0x13')]['message']);return _0x1e801c(_0x1e8fbd[_0x0d4a('0x13')][_0x0d4a('0x14')]);}logger[_0x0d4a('0x13')](_0x0d4a('0xf'),_0x865ef4,_0x1e8fbd[_0x0d4a('0x13')][_0x0d4a('0x14')]);return _0x54103e(_0x1e8fbd['error'][_0x0d4a('0x14')]);}else{logger[_0x0d4a('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x865ef4,'request\x20sent');_0x54103e(_0x1e8fbd[_0x0d4a('0x15')][_0x0d4a('0x14')]);}})[_0x0d4a('0x16')](function(_0x21d998){logger[_0x0d4a('0x13')](_0x0d4a('0xf'),_0x865ef4,_0x21d998);_0x1e801c(_0x21d998);});});}exports[_0x0d4a('0x17')]=function(_0x59f83e){var _0x212ca8=this;return new Promise(function(_0x463788,_0x4ee72e){return db['VoiceQueueReport'][_0x0d4a('0x18')]({'raw':_0x59f83e[_0x0d4a('0x19')]?_0x59f83e[_0x0d4a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x59f83e[_0x0d4a('0x19')]?_0x59f83e['options']['where']||null:null,'attributes':_0x59f83e[_0x0d4a('0x19')]?_0x59f83e[_0x0d4a('0x19')]['attributes']||null:null,'limit':_0x59f83e[_0x0d4a('0x19')]?_0x59f83e['options']['limit']||null:null,'include':_0x59f83e[_0x0d4a('0x19')]?_0x59f83e[_0x0d4a('0x19')][_0x0d4a('0x1a')]?_['map'](_0x59f83e[_0x0d4a('0x19')][_0x0d4a('0x1a')],function(_0x42e79b){return{'model':db[_0x42e79b['model']],'as':_0x42e79b['as'],'attributes':_0x42e79b[_0x0d4a('0x1b')],'include':_0x42e79b['include']?_[_0x0d4a('0x1c')](_0x42e79b['include'],function(_0x3ebe50){return{'model':db[_0x3ebe50[_0x0d4a('0x1d')]],'as':_0x3ebe50['as'],'attributes':_0x3ebe50['attributes'],'include':_0x3ebe50['include']?_[_0x0d4a('0x1c')](_0x3ebe50[_0x0d4a('0x1a')],function(_0x23f293){return{'model':db[_0x23f293[_0x0d4a('0x1d')]],'as':_0x23f293['as'],'attributes':_0x23f293[_0x0d4a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36d360){logger[_0x0d4a('0xe')](_0x0d4a('0x17'),_0x59f83e);logger['debug'](_0x0d4a('0x17'),_0x59f83e,JSON['stringify'](_0x36d360));_0x463788(_0x36d360);})[_0x0d4a('0x16')](function(_0x3684d8){logger[_0x0d4a('0x13')](_0x0d4a('0x17'),_0x3684d8[_0x0d4a('0x14')],_0x59f83e);_0x4ee72e(_0x212ca8[_0x0d4a('0x13')](0x1f4,_0x3684d8[_0x0d4a('0x14')]));});});};exports[_0x0d4a('0x1e')]=function(_0x15c1de){var _0x3df864=this;return new Promise(function(_0x18d7ba,_0x3465ce){return db[_0x0d4a('0x1f')][_0x0d4a('0x20')](_0x15c1de[_0x0d4a('0x21')],{'raw':_0x15c1de[_0x0d4a('0x19')]?_0x15c1de[_0x0d4a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d4a('0x22')](function(_0x32b65c){logger['info'](_0x0d4a('0x1e'),_0x15c1de);logger[_0x0d4a('0x10')](_0x0d4a('0x1e'),_0x15c1de,JSON[_0x0d4a('0x23')](_0x32b65c));_0x18d7ba(_0x32b65c);})['catch'](function(_0x14c0fb){logger[_0x0d4a('0x13')](_0x0d4a('0x1e'),_0x14c0fb[_0x0d4a('0x14')],_0x15c1de);_0x3465ce(_0x3df864[_0x0d4a('0x13')](0x1f4,_0x14c0fb[_0x0d4a('0x14')]));});});};exports[_0x0d4a('0x24')]=function(_0x178932){var _0x2ec3db=this;return new Promise(function(_0xaea47,_0x38e80f){return db['VoiceQueueReport'][_0x0d4a('0x25')](_0x178932['body'],{'raw':_0x178932[_0x0d4a('0x19')]?_0x178932[_0x0d4a('0x19')][_0x0d4a('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178932['options']?_0x178932['options'][_0x0d4a('0x27')]||null:null,'attributes':_0x178932[_0x0d4a('0x19')]?_0x178932[_0x0d4a('0x19')][_0x0d4a('0x1b')]||null:null,'limit':_0x178932[_0x0d4a('0x19')]?_0x178932[_0x0d4a('0x19')]['limit']||null:null})['then'](function(_0x54c481){logger[_0x0d4a('0xe')](_0x0d4a('0x24'),_0x178932);logger[_0x0d4a('0x10')](_0x0d4a('0x24'),_0x178932,JSON['stringify'](_0x54c481));_0xaea47(_0x54c481);})['catch'](function(_0xad1b50){logger[_0x0d4a('0x13')]('UpdateVoiceQueueReport',_0xad1b50[_0x0d4a('0x14')],_0x178932);_0x38e80f(_0x2ec3db[_0x0d4a('0x13')](0x1f4,_0xad1b50['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 4a1173a..9e64762 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 _0x212b=['remove','update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x66be3c,_0x156370){var _0x12b415=function(_0x2f0a1c){while(--_0x2f0a1c){_0x66be3c['push'](_0x66be3c['shift']());}};_0x12b415(++_0x156370);}(_0x212b,0x148));var _0xb212=function(_0x401ed9,_0x592565){_0x401ed9=_0x401ed9-0x0;var _0x509377=_0x212b[_0x401ed9];return _0x509377;};'use strict';var VoiceQueueReportEvents=require(_0xb212('0x0'));var events=['save',_0xb212('0x1'),_0xb212('0x2')];function createListener(_0xf67ecc,_0x309b83){return function(_0x5731dc){_0x309b83[_0xb212('0x3')](_0xf67ecc,_0x5731dc);};}function removeListener(_0x18e53a,_0x1826d1){return function(){VoiceQueueReportEvents['removeListener'](_0x18e53a,_0x1826d1);};}exports[_0xb212('0x4')]=function(_0x49a13c){for(var _0x21825a=0x0,_0x51f604=events[_0xb212('0x5')];_0x21825a<_0x51f604;_0x21825a++){var _0x3839e0=events[_0x21825a];var _0x5c1000=createListener(_0xb212('0x6')+_0x3839e0,_0x49a13c);VoiceQueueReportEvents['on'](_0x3839e0,_0x5c1000);}}; \ No newline at end of file +var _0xa1f6=['save','remove','update','register','length','./voiceQueueReport.events'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xa1f6[_0x277721];return _0x286051;};'use strict';var VoiceQueueReportEvents=require(_0x6a1f('0x0'));var events=[_0x6a1f('0x1'),_0x6a1f('0x2'),_0x6a1f('0x3')];function createListener(_0x198e14,_0x123ad4){return function(_0x5cf561){_0x123ad4['emit'](_0x198e14,_0x5cf561);};}function removeListener(_0x521944,_0x5d4ad7){return function(){VoiceQueueReportEvents['removeListener'](_0x521944,_0x5d4ad7);};}exports[_0x6a1f('0x4')]=function(_0x426ae1){for(var _0xa1c928=0x0,_0x3a772b=events[_0x6a1f('0x5')];_0xa1c928<_0x3a772b;_0xa1c928++){var _0x3ecd63=events[_0xa1c928];var _0x36c00b=createListener('voiceQueueReport:'+_0x3ecd63,_0x426ae1);VoiceQueueReportEvents['on'](_0x3ecd63,_0x36c00b);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 578528c..023d111 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 _0x215d=['delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','get','isAuthenticated','show','post','put','/:id','update'];(function(_0x1df8e3,_0x2f4d65){var _0xa8f888=function(_0x1be8e4){while(--_0x1be8e4){_0x1df8e3['push'](_0x1df8e3['shift']());}};_0xa8f888(++_0x2f4d65);}(_0x215d,0xdb));var _0xd215=function(_0x25d483,_0x41d303){_0x25d483=_0x25d483-0x0;var _0x3b38e8=_0x215d[_0x25d483];return _0x3b38e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd215('0x0'));var timeout=require(_0xd215('0x1'));var express=require(_0xd215('0x2'));var router=express['Router']();var fs_extra=require(_0xd215('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd215('0x4'));var config=require(_0xd215('0x5'));var controller=require(_0xd215('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd215('0x7')]);router[_0xd215('0x8')]('/:id',auth[_0xd215('0x9')](),controller[_0xd215('0xa')]);router[_0xd215('0xb')]('/',auth[_0xd215('0x9')](),controller['create']);router[_0xd215('0xc')](_0xd215('0xd'),auth[_0xd215('0x9')](),controller[_0xd215('0xe')]);router[_0xd215('0xf')](_0xd215('0xd'),auth[_0xd215('0x9')](),controller[_0xd215('0x10')]);module[_0xd215('0x11')]=router; \ No newline at end of file +var _0x2dab=['/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dab,0x120));var _0xb2da=function(_0x3dc575,_0x4a7e78){_0x3dc575=_0x3dc575-0x0;var _0x2093ef=_0x2dab[_0x3dc575];return _0x2093ef;};'use strict';var multer=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var path=require(_0xb2da('0x2'));var timeout=require(_0xb2da('0x3'));var express=require(_0xb2da('0x4'));var router=express['Router']();var fs_extra=require(_0xb2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2da('0x6'));var config=require(_0xb2da('0x7'));var controller=require(_0xb2da('0x8'));router[_0xb2da('0x9')]('/',auth[_0xb2da('0xa')](),controller[_0xb2da('0xb')]);router[_0xb2da('0x9')]('/:id',auth[_0xb2da('0xa')](),controller[_0xb2da('0xc')]);router[_0xb2da('0xd')]('/',auth[_0xb2da('0xa')](),controller[_0xb2da('0xe')]);router[_0xb2da('0xf')](_0xb2da('0x10'),auth[_0xb2da('0xa')](),controller['update']);router['delete'](_0xb2da('0x10'),auth[_0xb2da('0xa')](),controller[_0xb2da('0x11')]);module[_0xb2da('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 c4b95a4..8dc16bf 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 _0x314f=['DATE','sequelize','moment','exports','STRING'];(function(_0x489a76,_0x5e2922){var _0x243e24=function(_0x158549){while(--_0x158549){_0x489a76['push'](_0x489a76['shift']());}};_0x243e24(++_0x5e2922);}(_0x314f,0x114));var _0xf314=function(_0x3b3609,_0x4f4324){_0x3b3609=_0x3b3609-0x0;var _0x10e4fa=_0x314f[_0x3b3609];return _0x10e4fa;};'use strict';var Sequelize=require(_0xf314('0x0'));var moment=require(_0xf314('0x1'));module[_0xf314('0x2')]={'time':{'type':Sequelize[_0xf314('0x3')]},'callid':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf314('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf314('0x4')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x738c=['moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x220c9a,_0x3d5639){var _0xc7b146=function(_0x2f4690){while(--_0x2f4690){_0x220c9a['push'](_0x220c9a['shift']());}};_0xc7b146(++_0x3d5639);}(_0x738c,0x185));var _0xc738=function(_0x42179f,_0x35c825){_0x42179f=_0x42179f-0x0;var _0x3160a8=_0x738c[_0x42179f];return _0x3160a8;};'use strict';var Sequelize=require(_0xc738('0x0'));var moment=require(_0xc738('0x1'));module['exports']={'time':{'type':Sequelize[_0xc738('0x2')]},'callid':{'type':Sequelize[_0xc738('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc738('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc738('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc738('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc738('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc738('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc738('0x3')],'allowNull':![],'defaultValue':moment()[_0xc738('0x4')](_0xc738('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c61c14d..821c1c9 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 _0x2d01=['merge','filter','then','includeAll','include','rows','show','params','options','find','catch','create','body','update','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','error','stack','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x139a4f,_0x5c6d66){var _0x46ed1c=function(_0x1190e4){while(--_0x1190e4){_0x139a4f['push'](_0x139a4f['shift']());}};_0x46ed1c(++_0x5c6d66);}(_0x2d01,0x171));var _0x12d0=function(_0x32b54b,_0x3a2566){_0x32b54b=_0x32b54b-0x0;var _0x199f12=_0x2d01[_0x32b54b];return _0x199f12;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12d0('0x0'));var rp=require(_0x12d0('0x1'));var moment=require(_0x12d0('0x2'));var BPromise=require(_0x12d0('0x3'));var Mustache=require('mustache');var util=require(_0x12d0('0x4'));var path=require(_0x12d0('0x5'));var sox=require(_0x12d0('0x6'));var csv=require('to-csv');var ejs=require(_0x12d0('0x7'));var fs=require('fs');var fs_extra=require(_0x12d0('0x8'));var _=require(_0x12d0('0x9'));var squel=require(_0x12d0('0xa'));var crypto=require(_0x12d0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x12d0('0xc'));var toCsv=require(_0x12d0('0xd'));var querystring=require(_0x12d0('0xe'));var Papa=require(_0x12d0('0xf'));var Redis=require('ioredis');var authService=require(_0x12d0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x12d0('0x11'));var hardwareService=require(_0x12d0('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x12d0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x12d0('0x14'));var db=require(_0x12d0('0x15'))['db'];function respondWithStatusCode(_0x30f2a2,_0x3f0fd6){_0x3f0fd6=_0x3f0fd6||0xcc;return function(_0x96a8ee){if(_0x96a8ee){return _0x30f2a2[_0x12d0('0x16')](_0x3f0fd6);}return _0x30f2a2[_0x12d0('0x17')](_0x3f0fd6)[_0x12d0('0x18')]();};}function respondWithResult(_0x4c88cf,_0x31e468){_0x31e468=_0x31e468||0xc8;return function(_0x40d4d2){if(_0x40d4d2){return _0x4c88cf[_0x12d0('0x17')](_0x31e468)[_0x12d0('0x19')](_0x40d4d2);}};}function respondWithFilteredResult(_0x5b3799,_0x20820a){return function(_0x23efef){if(_0x23efef){var _0x45d663=typeof _0x20820a[_0x12d0('0x1a')]===_0x12d0('0x1b')&&typeof _0x20820a[_0x12d0('0x1c')]==='undefined';var _0x5d9d36=_0x23efef[_0x12d0('0x1d')];var _0xcd4958=_0x45d663?0x0:_0x20820a[_0x12d0('0x1a')];var _0x30e817=_0x45d663?_0x23efef['count']:_0x20820a[_0x12d0('0x1a')]+_0x20820a['limit'];var _0x3084ae;if(_0x30e817>=_0x5d9d36){_0x30e817=_0x5d9d36;_0x3084ae=0xc8;}else{_0x3084ae=0xce;}_0x5b3799[_0x12d0('0x17')](_0x3084ae);return _0x5b3799[_0x12d0('0x1e')](_0x12d0('0x1f'),_0xcd4958+'-'+_0x30e817+'/'+_0x5d9d36)[_0x12d0('0x19')](_0x23efef);}return null;};}function patchUpdates(_0x2c3bf6){return function(_0x526465){try{jsonpatch[_0x12d0('0x20')](_0x526465,_0x2c3bf6,!![]);}catch(_0x30a563){return BPromise['reject'](_0x30a563);}return _0x526465['save']();};}function saveUpdates(_0x3c2435,_0x29aee6){return function(_0x3c36b9){if(_0x3c36b9){return _0x3c36b9['update'](_0x3c2435)['then'](function(_0x415e88){return _0x415e88;});}return null;};}function removeEntity(_0x2bada1,_0x2b033e){return function(_0x2ef5b4){if(_0x2ef5b4){return _0x2ef5b4[_0x12d0('0x21')]()['then'](function(){_0x2bada1[_0x12d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x116d9e,_0xcc1e06){return function(_0x573180){if(!_0x573180){_0x116d9e[_0x12d0('0x16')](0x194);}return _0x573180;};}function handleError(_0x2828b7,_0x3008ff){_0x3008ff=_0x3008ff||0x1f4;return function(_0xb77751){logger[_0x12d0('0x22')](_0xb77751[_0x12d0('0x23')]);if(_0xb77751['name']){delete _0xb77751['name'];}_0x2828b7[_0x12d0('0x17')](_0x3008ff)['send'](_0xb77751);};}exports[_0x12d0('0x24')]=function(_0x148be7,_0x9266c1){var _0x145051={},_0x1ff4b1={},_0x35038c={'count':0x0,'rows':[]};var _0x9aaecf=_[_0x12d0('0x25')](db[_0x12d0('0x26')][_0x12d0('0x27')],function(_0x208d13){return{'name':_0x208d13[_0x12d0('0x28')],'type':_0x208d13[_0x12d0('0x29')]['key']};});_0x1ff4b1['model']=_[_0x12d0('0x25')](_0x9aaecf,_0x12d0('0x2a'));_0x1ff4b1[_0x12d0('0x2b')]=_[_0x12d0('0x2c')](_0x148be7[_0x12d0('0x2b')]);_0x1ff4b1['filters']=_[_0x12d0('0x2d')](_0x1ff4b1[_0x12d0('0x2e')],_0x1ff4b1[_0x12d0('0x2b')]);_0x145051[_0x12d0('0x2f')]=_['intersection'](_0x1ff4b1[_0x12d0('0x2e')],qs[_0x12d0('0x30')](_0x148be7['query'][_0x12d0('0x30')]));_0x145051[_0x12d0('0x2f')]=_0x145051[_0x12d0('0x2f')][_0x12d0('0x31')]?_0x145051['attributes']:_0x1ff4b1[_0x12d0('0x2e')];if(!_0x148be7[_0x12d0('0x2b')][_0x12d0('0x32')](_0x12d0('0x33'))){_0x145051[_0x12d0('0x1c')]=qs['limit'](_0x148be7[_0x12d0('0x2b')][_0x12d0('0x1c')]);_0x145051[_0x12d0('0x1a')]=qs[_0x12d0('0x1a')](_0x148be7[_0x12d0('0x2b')]['offset']);}_0x145051[_0x12d0('0x34')]=qs[_0x12d0('0x35')](_0x148be7[_0x12d0('0x2b')][_0x12d0('0x35')]);_0x145051[_0x12d0('0x36')]=qs[_0x12d0('0x37')](_[_0x12d0('0x38')](_0x148be7[_0x12d0('0x2b')],_0x1ff4b1['filters']),_0x9aaecf);if(_0x148be7[_0x12d0('0x2b')]['filter']){_0x145051[_0x12d0('0x36')]=_[_0x12d0('0x39')](_0x145051[_0x12d0('0x36')],{'$or':_[_0x12d0('0x25')](_0x9aaecf,function(_0x4abca1){if(_0x4abca1[_0x12d0('0x29')]!=='VIRTUAL'){var _0x318bd0={};_0x318bd0[_0x4abca1[_0x12d0('0x2a')]]={'$like':'%'+_0x148be7['query'][_0x12d0('0x3a')]+'%'};return _0x318bd0;}})});}_0x145051=_['merge']({},_0x145051,_0x148be7['options']);var _0x1263f6={'where':_0x145051[_0x12d0('0x36')]};return db[_0x12d0('0x26')]['count'](_0x1263f6)[_0x12d0('0x3b')](function(_0x45a8b6){_0x35038c[_0x12d0('0x1d')]=_0x45a8b6;if(_0x148be7[_0x12d0('0x2b')][_0x12d0('0x3c')]){_0x145051[_0x12d0('0x3d')]=[{'all':!![]}];}return db[_0x12d0('0x26')]['findAll'](_0x145051);})[_0x12d0('0x3b')](function(_0x1cb99f){_0x35038c[_0x12d0('0x3e')]=_0x1cb99f;return _0x35038c;})['then'](respondWithFilteredResult(_0x9266c1,_0x145051))['catch'](handleError(_0x9266c1,null));};exports[_0x12d0('0x3f')]=function(_0x3d1bed,_0x4bb6d7){var _0x4933a4={'raw':!![],'where':{'id':_0x3d1bed[_0x12d0('0x40')]['id']}},_0x2a86ab={};_0x2a86ab['model']=_[_0x12d0('0x2c')](db[_0x12d0('0x26')][_0x12d0('0x27')]);_0x2a86ab['query']=_[_0x12d0('0x2c')](_0x3d1bed[_0x12d0('0x2b')]);_0x2a86ab[_0x12d0('0x37')]=_[_0x12d0('0x2d')](_0x2a86ab['model'],_0x2a86ab[_0x12d0('0x2b')]);_0x4933a4['attributes']=_[_0x12d0('0x2d')](_0x2a86ab[_0x12d0('0x2e')],qs[_0x12d0('0x30')](_0x3d1bed[_0x12d0('0x2b')]['fields']));_0x4933a4['attributes']=_0x4933a4['attributes'][_0x12d0('0x31')]?_0x4933a4[_0x12d0('0x2f')]:_0x2a86ab['model'];if(_0x3d1bed['query'][_0x12d0('0x3c')]){_0x4933a4['include']=[{'all':!![]}];}_0x4933a4=_[_0x12d0('0x39')]({},_0x4933a4,_0x3d1bed[_0x12d0('0x41')]);return db[_0x12d0('0x26')][_0x12d0('0x42')](_0x4933a4)[_0x12d0('0x3b')](handleEntityNotFound(_0x4bb6d7,null))[_0x12d0('0x3b')](respondWithResult(_0x4bb6d7,null))[_0x12d0('0x43')](handleError(_0x4bb6d7,null));};exports[_0x12d0('0x44')]=function(_0x488ba3,_0x42e100){return db[_0x12d0('0x26')][_0x12d0('0x44')](_0x488ba3[_0x12d0('0x45')],{})[_0x12d0('0x3b')](respondWithResult(_0x42e100,0xc9))[_0x12d0('0x43')](handleError(_0x42e100,null));};exports[_0x12d0('0x46')]=function(_0x57bedb,_0x5dcb90){if(_0x57bedb[_0x12d0('0x45')]['id']){delete _0x57bedb[_0x12d0('0x45')]['id'];}return db['VoiceQueuesLog'][_0x12d0('0x42')]({'where':{'id':_0x57bedb[_0x12d0('0x40')]['id']}})[_0x12d0('0x3b')](handleEntityNotFound(_0x5dcb90,null))[_0x12d0('0x3b')](saveUpdates(_0x57bedb['body'],null))['then'](respondWithResult(_0x5dcb90,null))[_0x12d0('0x43')](handleError(_0x5dcb90,null));};exports[_0x12d0('0x21')]=function(_0x8ea455,_0x4fcb4f){return db['VoiceQueuesLog'][_0x12d0('0x42')]({'where':{'id':_0x8ea455[_0x12d0('0x40')]['id']}})[_0x12d0('0x3b')](handleEntityNotFound(_0x4fcb4f,null))['then'](removeEntity(_0x4fcb4f,null))[_0x12d0('0x43')](handleError(_0x4fcb4f,null));}; \ No newline at end of file +var _0x595f=['count','set','json','reject','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x4975fb,_0x47c565){var _0x1d57ab=function(_0x44756c){while(--_0x44756c){_0x4975fb['push'](_0x4975fb['shift']());}};_0x1d57ab(++_0x47c565);}(_0x595f,0x71));var _0xf595=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x595f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf595('0x0'));var zipdir=require(_0xf595('0x1'));var jsonpatch=require(_0xf595('0x2'));var rp=require(_0xf595('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf595('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf595('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf595('0x6'));var _=require(_0xf595('0x7'));var squel=require(_0xf595('0x8'));var crypto=require(_0xf595('0x9'));var jsforce=require(_0xf595('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf595('0xb'));var Papa=require('papaparse');var Redis=require(_0xf595('0xc'));var authService=require(_0xf595('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf595('0xe'));var logger=require(_0xf595('0xf'))(_0xf595('0x10'));var utils=require(_0xf595('0x11'));var config=require(_0xf595('0x12'));var licenseUtil=require(_0xf595('0x13'));var db=require(_0xf595('0x14'))['db'];function respondWithStatusCode(_0xb3745d,_0x5074af){_0x5074af=_0x5074af||0xcc;return function(_0x374f2e){if(_0x374f2e){return _0xb3745d[_0xf595('0x15')](_0x5074af);}return _0xb3745d[_0xf595('0x16')](_0x5074af)[_0xf595('0x17')]();};}function respondWithResult(_0x1456cc,_0x53c69a){_0x53c69a=_0x53c69a||0xc8;return function(_0xf2459d){if(_0xf2459d){return _0x1456cc['status'](_0x53c69a)['json'](_0xf2459d);}};}function respondWithFilteredResult(_0x343db7,_0x4a8099){return function(_0x18e163){if(_0x18e163){var _0x44f679=typeof _0x4a8099[_0xf595('0x18')]===_0xf595('0x19')&&typeof _0x4a8099[_0xf595('0x1a')]===_0xf595('0x19');var _0xdd9027=_0x18e163[_0xf595('0x1b')];var _0x3d3fe1=_0x44f679?0x0:_0x4a8099[_0xf595('0x18')];var _0x56b91a=_0x44f679?_0x18e163[_0xf595('0x1b')]:_0x4a8099[_0xf595('0x18')]+_0x4a8099[_0xf595('0x1a')];var _0x2cdb0b;if(_0x56b91a>=_0xdd9027){_0x56b91a=_0xdd9027;_0x2cdb0b=0xc8;}else{_0x2cdb0b=0xce;}_0x343db7['status'](_0x2cdb0b);return _0x343db7[_0xf595('0x1c')]('Content-Range',_0x3d3fe1+'-'+_0x56b91a+'/'+_0xdd9027)[_0xf595('0x1d')](_0x18e163);}return null;};}function patchUpdates(_0x7d0a9f){return function(_0x218769){try{jsonpatch['apply'](_0x218769,_0x7d0a9f,!![]);}catch(_0x5638a7){return BPromise[_0xf595('0x1e')](_0x5638a7);}return _0x218769['save']();};}function saveUpdates(_0x1989bf,_0x41e2d8){return function(_0x20ffe4){if(_0x20ffe4){return _0x20ffe4[_0xf595('0x1f')](_0x1989bf)[_0xf595('0x20')](function(_0x3844bb){return _0x3844bb;});}return null;};}function removeEntity(_0x5965b3,_0x11dff6){return function(_0x1db3f){if(_0x1db3f){return _0x1db3f[_0xf595('0x21')]()['then'](function(){_0x5965b3[_0xf595('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8b8a,_0x17219c){return function(_0x1ea180){if(!_0x1ea180){_0x5b8b8a[_0xf595('0x15')](0x194);}return _0x1ea180;};}function handleError(_0x5b2b6d,_0x443e6b){_0x443e6b=_0x443e6b||0x1f4;return function(_0x57c344){logger[_0xf595('0x22')](_0x57c344[_0xf595('0x23')]);if(_0x57c344[_0xf595('0x24')]){delete _0x57c344['name'];}_0x5b2b6d[_0xf595('0x16')](_0x443e6b)[_0xf595('0x25')](_0x57c344);};}exports['index']=function(_0x4e467e,_0x936144){var _0x24df2d={},_0x769724={},_0x136789={'count':0x0,'rows':[]};var _0x2aeeef=_[_0xf595('0x26')](db[_0xf595('0x27')][_0xf595('0x28')],function(_0x7db19c){return{'name':_0x7db19c[_0xf595('0x29')],'type':_0x7db19c[_0xf595('0x2a')][_0xf595('0x2b')]};});_0x769724[_0xf595('0x2c')]=_[_0xf595('0x26')](_0x2aeeef,'name');_0x769724[_0xf595('0x2d')]=_[_0xf595('0x2e')](_0x4e467e['query']);_0x769724[_0xf595('0x2f')]=_[_0xf595('0x30')](_0x769724['model'],_0x769724['query']);_0x24df2d[_0xf595('0x31')]=_[_0xf595('0x30')](_0x769724[_0xf595('0x2c')],qs[_0xf595('0x32')](_0x4e467e[_0xf595('0x2d')][_0xf595('0x32')]));_0x24df2d[_0xf595('0x31')]=_0x24df2d[_0xf595('0x31')][_0xf595('0x33')]?_0x24df2d[_0xf595('0x31')]:_0x769724[_0xf595('0x2c')];if(!_0x4e467e['query']['hasOwnProperty']('nolimit')){_0x24df2d[_0xf595('0x1a')]=qs[_0xf595('0x1a')](_0x4e467e[_0xf595('0x2d')][_0xf595('0x1a')]);_0x24df2d[_0xf595('0x18')]=qs[_0xf595('0x18')](_0x4e467e[_0xf595('0x2d')][_0xf595('0x18')]);}_0x24df2d[_0xf595('0x34')]=qs[_0xf595('0x35')](_0x4e467e[_0xf595('0x2d')][_0xf595('0x35')]);_0x24df2d[_0xf595('0x36')]=qs[_0xf595('0x2f')](_[_0xf595('0x37')](_0x4e467e[_0xf595('0x2d')],_0x769724[_0xf595('0x2f')]),_0x2aeeef);if(_0x4e467e[_0xf595('0x2d')][_0xf595('0x38')]){_0x24df2d[_0xf595('0x36')]=_[_0xf595('0x39')](_0x24df2d['where'],{'$or':_[_0xf595('0x26')](_0x2aeeef,function(_0x453ab9){if(_0x453ab9[_0xf595('0x2a')]!==_0xf595('0x3a')){var _0x3bd2c7={};_0x3bd2c7[_0x453ab9[_0xf595('0x24')]]={'$like':'%'+_0x4e467e[_0xf595('0x2d')][_0xf595('0x38')]+'%'};return _0x3bd2c7;}})});}_0x24df2d=_[_0xf595('0x39')]({},_0x24df2d,_0x4e467e[_0xf595('0x3b')]);var _0x166fd8={'where':_0x24df2d[_0xf595('0x36')]};return db[_0xf595('0x27')][_0xf595('0x1b')](_0x166fd8)[_0xf595('0x20')](function(_0x1df0c2){_0x136789['count']=_0x1df0c2;if(_0x4e467e[_0xf595('0x2d')][_0xf595('0x3c')]){_0x24df2d[_0xf595('0x3d')]=[{'all':!![]}];}return db[_0xf595('0x27')][_0xf595('0x3e')](_0x24df2d);})[_0xf595('0x20')](function(_0x23f97f){_0x136789[_0xf595('0x3f')]=_0x23f97f;return _0x136789;})['then'](respondWithFilteredResult(_0x936144,_0x24df2d))[_0xf595('0x40')](handleError(_0x936144,null));};exports[_0xf595('0x41')]=function(_0x21f9b6,_0x21c9e7){var _0xc5147b={'raw':!![],'where':{'id':_0x21f9b6['params']['id']}},_0x1e0ae9={};_0x1e0ae9['model']=_[_0xf595('0x2e')](db[_0xf595('0x27')][_0xf595('0x28')]);_0x1e0ae9[_0xf595('0x2d')]=_[_0xf595('0x2e')](_0x21f9b6['query']);_0x1e0ae9[_0xf595('0x2f')]=_['intersection'](_0x1e0ae9[_0xf595('0x2c')],_0x1e0ae9['query']);_0xc5147b[_0xf595('0x31')]=_[_0xf595('0x30')](_0x1e0ae9[_0xf595('0x2c')],qs[_0xf595('0x32')](_0x21f9b6[_0xf595('0x2d')][_0xf595('0x32')]));_0xc5147b[_0xf595('0x31')]=_0xc5147b[_0xf595('0x31')]['length']?_0xc5147b['attributes']:_0x1e0ae9[_0xf595('0x2c')];if(_0x21f9b6[_0xf595('0x2d')][_0xf595('0x3c')]){_0xc5147b[_0xf595('0x3d')]=[{'all':!![]}];}_0xc5147b=_[_0xf595('0x39')]({},_0xc5147b,_0x21f9b6[_0xf595('0x3b')]);return db['VoiceQueuesLog'][_0xf595('0x42')](_0xc5147b)[_0xf595('0x20')](handleEntityNotFound(_0x21c9e7,null))[_0xf595('0x20')](respondWithResult(_0x21c9e7,null))['catch'](handleError(_0x21c9e7,null));};exports[_0xf595('0x43')]=function(_0x116e2d,_0x31069a){return db[_0xf595('0x27')][_0xf595('0x43')](_0x116e2d[_0xf595('0x44')],{})[_0xf595('0x20')](respondWithResult(_0x31069a,0xc9))[_0xf595('0x40')](handleError(_0x31069a,null));};exports[_0xf595('0x1f')]=function(_0x3c00a9,_0x1c7f22){if(_0x3c00a9[_0xf595('0x44')]['id']){delete _0x3c00a9['body']['id'];}return db[_0xf595('0x27')][_0xf595('0x42')]({'where':{'id':_0x3c00a9['params']['id']}})['then'](handleEntityNotFound(_0x1c7f22,null))[_0xf595('0x20')](saveUpdates(_0x3c00a9['body'],null))['then'](respondWithResult(_0x1c7f22,null))['catch'](handleError(_0x1c7f22,null));};exports['destroy']=function(_0x22187c,_0x126ed1){return db[_0xf595('0x27')]['find']({'where':{'id':_0x22187c[_0xf595('0x45')]['id']}})[_0xf595('0x20')](handleEntityNotFound(_0x126ed1,null))[_0xf595('0x20')](removeEntity(_0x126ed1,null))[_0xf595('0x40')](handleError(_0x126ed1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index ef2700b..5befb8e 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 _0x42c9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','../../config/logger'];(function(_0x3f0802,_0x492d41){var _0xb316b4=function(_0x5813d3){while(--_0x5813d3){_0x3f0802['push'](_0x3f0802['shift']());}};_0xb316b4(++_0x492d41);}(_0x42c9,0x1ae));var _0x942c=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0x42c9[_0x16e57d];return _0x40239c;};'use strict';var _=require(_0x942c('0x0'));var util=require('util');var logger=require(_0x942c('0x1'))(_0x942c('0x2'));var moment=require(_0x942c('0x3'));var BPromise=require(_0x942c('0x4'));var rp=require(_0x942c('0x5'));var fs=require('fs');var path=require(_0x942c('0x6'));var rimraf=require(_0x942c('0x7'));var config=require(_0x942c('0x8'));var attributes=require(_0x942c('0x9'));module[_0x942c('0xa')]=function(_0x26c8fa,_0x173d7e){return _0x26c8fa[_0x942c('0xb')](_0x942c('0xc'),attributes,{'tableName':_0x942c('0xd'),'paranoid':![],'indexes':[{'name':_0x942c('0xe'),'fields':['event',_0x942c('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3189=['api','moment','bluebird','path','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','event','lodash','util'];(function(_0x18fb4d,_0x20d59b){var _0x4b2399=function(_0xa675b8){while(--_0xa675b8){_0x18fb4d['push'](_0x18fb4d['shift']());}};_0x4b2399(++_0x20d59b);}(_0x3189,0xae));var _0x9318=function(_0x2e889d,_0x13c0ae){_0x2e889d=_0x2e889d-0x0;var _0x2c91a9=_0x3189[_0x2e889d];return _0x2c91a9;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var logger=require('../../config/logger')(_0x9318('0x2'));var moment=require(_0x9318('0x3'));var BPromise=require(_0x9318('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9318('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9318('0x6'));module[_0x9318('0x7')]=function(_0x50b157,_0x1175d3){return _0x50b157['define']('VoiceQueuesLog',attributes,{'tableName':_0x9318('0x8'),'paranoid':![],'indexes':[{'name':_0x9318('0x9'),'fields':[_0x9318('0xa'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 552e07f..6491274 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 _0x049e=['then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x049e,0x16a));var _0xe049=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x049e[_0x352d28];return _0x387d7e;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var moment=require('moment');var BPromise=require(_0xe049('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe049('0x3'));var db=require(_0xe049('0x4'))['db'];var utils=require(_0xe049('0x5'));var logger=require(_0xe049('0x6'))(_0xe049('0x7'));var config=require('../../config/environment');var jayson=require(_0xe049('0x8'));var client=jayson[_0xe049('0x9')][_0xe049('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x221a5f,_0x1d4fc6,_0x17945b){return new BPromise(function(_0x22abb2,_0x515823){return client[_0xe049('0xb')](_0x221a5f,_0x17945b)[_0xe049('0xc')](function(_0x6d04ed){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x1d4fc6,_0xe049('0xd'));logger[_0xe049('0xe')](_0xe049('0xf'),_0x1d4fc6,'request\x20sent',JSON['stringify'](_0x6d04ed));if(_0x6d04ed['error']){if(_0x6d04ed[_0xe049('0x10')][_0xe049('0x11')]===0x1f4){logger[_0xe049('0x10')](_0xe049('0x12'),_0x1d4fc6,_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);return _0x515823(_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);}logger['error'](_0xe049('0x12'),_0x1d4fc6,_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);return _0x22abb2(_0x6d04ed[_0xe049('0x10')]['message']);}else{logger[_0xe049('0x14')](_0xe049('0x12'),_0x1d4fc6,'request\x20sent');_0x22abb2(_0x6d04ed[_0xe049('0x15')][_0xe049('0x13')]);}})['catch'](function(_0x8b9bfe){logger[_0xe049('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1d4fc6,_0x8b9bfe);_0x515823(_0x8b9bfe);});});} \ No newline at end of file +var _0xb81a=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','util'];(function(_0x9c32df,_0x533254){var _0x4edcc2=function(_0x53fc0a){while(--_0x53fc0a){_0x9c32df['push'](_0x9c32df['shift']());}};_0x4edcc2(++_0x533254);}(_0xb81a,0x186));var _0xab81=function(_0x485719,_0x31e533){_0x485719=_0x485719-0x0;var _0x425075=_0xb81a[_0x485719];return _0x425075;};'use strict';var _=require('lodash');var util=require(_0xab81('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xab81('0x1'));var fs=require('fs');var Redis=require(_0xab81('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab81('0x3'))(_0xab81('0x4'));var config=require('../../config/environment');var jayson=require(_0xab81('0x5'));var client=jayson[_0xab81('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592bad,_0x152175,_0x5f6b1b){return new BPromise(function(_0x173e79,_0xefc9c6){return client[_0xab81('0x7')](_0x592bad,_0x5f6b1b)['then'](function(_0x41d595){logger[_0xab81('0x8')]('VoiceQueuesLog,\x20%s,\x20%s',_0x152175,_0xab81('0x9'));logger[_0xab81('0xa')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x152175,'request\x20sent',JSON[_0xab81('0xb')](_0x41d595));if(_0x41d595[_0xab81('0xc')]){if(_0x41d595[_0xab81('0xc')][_0xab81('0xd')]===0x1f4){logger['error'](_0xab81('0xe'),_0x152175,_0x41d595[_0xab81('0xc')]['message']);return _0xefc9c6(_0x41d595[_0xab81('0xc')][_0xab81('0xf')]);}logger[_0xab81('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x152175,_0x41d595[_0xab81('0xc')][_0xab81('0xf')]);return _0x173e79(_0x41d595['error'][_0xab81('0xf')]);}else{logger['info'](_0xab81('0xe'),_0x152175,_0xab81('0x9'));_0x173e79(_0x41d595[_0xab81('0x10')]['message']);}})['catch'](function(_0x2f2dfa){logger[_0xab81('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x152175,_0x2f2dfa);_0xefc9c6(_0x2f2dfa);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index a001955..ad05a33 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 _0x68e3=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','delete','destroy'];(function(_0x14c967,_0x5342b1){var _0x4e3f55=function(_0x1a1da6){while(--_0x1a1da6){_0x14c967['push'](_0x14c967['shift']());}};_0x4e3f55(++_0x5342b1);}(_0x68e3,0x135));var _0x368e=function(_0xa6e4ed,_0x42b6b){_0xa6e4ed=_0xa6e4ed-0x0;var _0xa6acbf=_0x68e3[_0xa6e4ed];return _0xa6acbf;};'use strict';var multer=require(_0x368e('0x0'));var util=require('util');var path=require(_0x368e('0x1'));var timeout=require(_0x368e('0x2'));var express=require('express');var router=express[_0x368e('0x3')]();var fs_extra=require(_0x368e('0x4'));var auth=require(_0x368e('0x5'));var interaction=require(_0x368e('0x6'));var config=require(_0x368e('0x7'));var controller=require(_0x368e('0x8'));router['get']('/',auth[_0x368e('0x9')](),controller[_0x368e('0xa')]);router[_0x368e('0xb')](_0x368e('0xc'),auth['isAuthenticated'](),controller[_0x368e('0xd')]);router[_0x368e('0xb')](_0x368e('0xe'),auth[_0x368e('0x9')](),controller[_0x368e('0xf')]);router[_0x368e('0xb')](_0x368e('0x10'),auth['isAuthenticated'](),controller[_0x368e('0x11')]);router[_0x368e('0xb')](_0x368e('0x12'),controller[_0x368e('0x13')]);router[_0x368e('0xb')](_0x368e('0x14'),auth[_0x368e('0x9')](),controller[_0x368e('0x15')]);router[_0x368e('0x16')]('/',auth[_0x368e('0x9')](),controller['create']);router[_0x368e('0x16')](_0x368e('0x14'),auth[_0x368e('0x9')](),controller[_0x368e('0x17')]);router['put']('/:id',auth[_0x368e('0x9')](),controller[_0x368e('0x18')]);router[_0x368e('0x19')](_0x368e('0xe'),auth[_0x368e('0x9')](),controller[_0x368e('0x1a')]);module[_0x368e('0x1b')]=router; \ No newline at end of file +var _0xb46b=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe'];(function(_0x255908,_0x45f78b){var _0x8ac1a0=function(_0xfd33b1){while(--_0xfd33b1){_0x255908['push'](_0x255908['shift']());}};_0x8ac1a0(++_0x45f78b);}(_0xb46b,0xb3));var _0xbb46=function(_0x392e51,_0x3b1711){_0x392e51=_0x392e51-0x0;var _0x2fb817=_0xb46b[_0x392e51];return _0x2fb817;};'use strict';var multer=require('multer');var util=require(_0xbb46('0x0'));var path=require(_0xbb46('0x1'));var timeout=require(_0xbb46('0x2'));var express=require(_0xbb46('0x3'));var router=express[_0xbb46('0x4')]();var fs_extra=require(_0xbb46('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb46('0x6'));var config=require(_0xbb46('0x7'));var controller=require(_0xbb46('0x8'));router[_0xbb46('0x9')]('/',auth[_0xbb46('0xa')](),controller[_0xbb46('0xb')]);router[_0xbb46('0x9')](_0xbb46('0xc'),auth[_0xbb46('0xa')](),controller[_0xbb46('0xd')]);router[_0xbb46('0x9')](_0xbb46('0xe'),auth['isAuthenticated'](),controller[_0xbb46('0xf')]);router['get'](_0xbb46('0x10'),auth[_0xbb46('0xa')](),controller[_0xbb46('0x11')]);router[_0xbb46('0x9')](_0xbb46('0x12'),controller[_0xbb46('0x13')]);router[_0xbb46('0x9')](_0xbb46('0x14'),auth[_0xbb46('0xa')](),controller[_0xbb46('0x15')]);router[_0xbb46('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbb46('0x16')]('/:id/transcribe',auth[_0xbb46('0xa')](),controller[_0xbb46('0x17')]);router[_0xbb46('0x18')](_0xbb46('0xe'),auth[_0xbb46('0xa')](),controller[_0xbb46('0x19')]);router[_0xbb46('0x1a')]('/:id',auth[_0xbb46('0xa')](),controller[_0xbb46('0x1b')]);module[_0xbb46('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 044c25f..3206830 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(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 5597cdc..f0f9b4c 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 _0x43ac=['crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','update','then','destroy','end','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','rows','show','params','includeAll','find','create','body','catch','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','download','filename','extname','send','Not\x20found','downloads','sequelize','MD5','col','$and','push','secrets','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','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','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x43ac,0x1c4));var _0xc43a=function(_0x327811,_0x28bb6f){_0x327811=_0x327811-0x0;var _0x1ad9b7=_0x43ac[_0x327811];return _0x1ad9b7;};'use strict';var emlformat=require(_0xc43a('0x0'));var rimraf=require(_0xc43a('0x1'));var zipdir=require(_0xc43a('0x2'));var jsonpatch=require(_0xc43a('0x3'));var rp=require('request-promise');var moment=require(_0xc43a('0x4'));var BPromise=require(_0xc43a('0x5'));var Mustache=require(_0xc43a('0x6'));var util=require(_0xc43a('0x7'));var path=require(_0xc43a('0x8'));var sox=require('sox');var csv=require(_0xc43a('0x9'));var ejs=require(_0xc43a('0xa'));var fs=require('fs');var fs_extra=require(_0xc43a('0xb'));var _=require('lodash');var squel=require(_0xc43a('0xc'));var crypto=require(_0xc43a('0xd'));var jsforce=require(_0xc43a('0xe'));var deskjs=require(_0xc43a('0xf'));var toCsv=require(_0xc43a('0x9'));var querystring=require(_0xc43a('0x10'));var Papa=require(_0xc43a('0x11'));var AWS=require(_0xc43a('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xc43a('0x13'));var qs=require(_0xc43a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc43a('0x15'));var logger=require('../../config/logger')(_0xc43a('0x16'));var utils=require(_0xc43a('0x17'));var config=require(_0xc43a('0x18'));var licenseUtil=require(_0xc43a('0x19'));var db=require(_0xc43a('0x1a'))['db'];function respondWithStatusCode(_0x2fa453,_0x5eee87){_0x5eee87=_0x5eee87||0xcc;return function(_0x7ecd7b){if(_0x7ecd7b){return _0x2fa453[_0xc43a('0x1b')](_0x5eee87);}return _0x2fa453[_0xc43a('0x1c')](_0x5eee87)['end']();};}function respondWithResult(_0x1a717f,_0x37adb8){_0x37adb8=_0x37adb8||0xc8;return function(_0x6ec190){if(_0x6ec190){return _0x1a717f['status'](_0x37adb8)[_0xc43a('0x1d')](_0x6ec190);}};}function respondWithFilteredResult(_0xc51682,_0x4dc5c3){return function(_0x120c63){if(_0x120c63){var _0x420fc0=typeof _0x4dc5c3['offset']===_0xc43a('0x1e')&&typeof _0x4dc5c3[_0xc43a('0x1f')]===_0xc43a('0x1e');var _0x1f3ead=_0x120c63[_0xc43a('0x20')];var _0x46229c=_0x420fc0?0x0:_0x4dc5c3[_0xc43a('0x21')];var _0x49c9c0=_0x420fc0?_0x120c63[_0xc43a('0x20')]:_0x4dc5c3[_0xc43a('0x21')]+_0x4dc5c3[_0xc43a('0x1f')];var _0x44a23d;if(_0x49c9c0>=_0x1f3ead){_0x49c9c0=_0x1f3ead;_0x44a23d=0xc8;}else{_0x44a23d=0xce;}_0xc51682[_0xc43a('0x1c')](_0x44a23d);return _0xc51682[_0xc43a('0x22')]('Content-Range',_0x46229c+'-'+_0x49c9c0+'/'+_0x1f3ead)[_0xc43a('0x1d')](_0x120c63);}return null;};}function patchUpdates(_0x3697a9){return function(_0x546263){try{jsonpatch['apply'](_0x546263,_0x3697a9,!![]);}catch(_0x510cfb){return BPromise['reject'](_0x510cfb);}return _0x546263['save']();};}function saveUpdates(_0x5521c7,_0x4d461b){return function(_0x45d051){if(_0x45d051){return _0x45d051[_0xc43a('0x23')](_0x5521c7)[_0xc43a('0x24')](function(_0x133240){return _0x133240;});}return null;};}function removeEntity(_0x6c9277,_0x377149){return function(_0x199064){if(_0x199064){return _0x199064[_0xc43a('0x25')]()[_0xc43a('0x24')](function(){_0x6c9277[_0xc43a('0x1c')](0xcc)[_0xc43a('0x26')]();});}};}function handleEntityNotFound(_0x9afb5b,_0xb1f252){return function(_0x2e6ee2){if(!_0x2e6ee2){_0x9afb5b['sendStatus'](0x194);}return _0x2e6ee2;};}function handleError(_0x2b0bb4,_0x5937f3){_0x5937f3=_0x5937f3||0x1f4;return function(_0x3f541c){logger[_0xc43a('0x27')](_0x3f541c[_0xc43a('0x28')]);if(_0x3f541c[_0xc43a('0x29')]){delete _0x3f541c[_0xc43a('0x29')];}_0x2b0bb4[_0xc43a('0x1c')](_0x5937f3)['send'](_0x3f541c);};}exports[_0xc43a('0x2a')]=function(_0x58c1ee,_0x45222c){var _0x39d3ae={},_0x586d2a={},_0x2ccfd7={'count':0x0,'rows':[]};var _0x2d618c=_[_0xc43a('0x2b')](db[_0xc43a('0x2c')][_0xc43a('0x2d')],function(_0x1a041e){return{'name':_0x1a041e[_0xc43a('0x2e')],'type':_0x1a041e['type'][_0xc43a('0x2f')]};});_0x586d2a[_0xc43a('0x30')]=_[_0xc43a('0x31')](_['map'](_0x2d618c,_0xc43a('0x29')),[_0xc43a('0x32')]);_0x586d2a['query']=_[_0xc43a('0x33')](_0x58c1ee[_0xc43a('0x34')]);_0x586d2a[_0xc43a('0x35')]=_[_0xc43a('0x36')](_0x586d2a[_0xc43a('0x30')],_0x586d2a[_0xc43a('0x34')]);_0x39d3ae['attributes']=_[_0xc43a('0x36')](_0x586d2a['model'],qs[_0xc43a('0x37')](_0x58c1ee[_0xc43a('0x34')][_0xc43a('0x37')]));_0x39d3ae[_0xc43a('0x38')]=_0x39d3ae['attributes'][_0xc43a('0x39')]?_0x39d3ae[_0xc43a('0x38')]:_0x586d2a[_0xc43a('0x30')];if(!_0x58c1ee[_0xc43a('0x34')][_0xc43a('0x3a')](_0xc43a('0x3b'))){_0x39d3ae[_0xc43a('0x1f')]=qs[_0xc43a('0x1f')](_0x58c1ee[_0xc43a('0x34')][_0xc43a('0x1f')]);_0x39d3ae[_0xc43a('0x21')]=qs[_0xc43a('0x21')](_0x58c1ee['query']['offset']);}_0x39d3ae[_0xc43a('0x3c')]=qs[_0xc43a('0x3d')](_0x58c1ee[_0xc43a('0x34')][_0xc43a('0x3d')]);_0x39d3ae[_0xc43a('0x3e')]=qs[_0xc43a('0x35')](_['pick'](_0x58c1ee[_0xc43a('0x34')],_0x586d2a['filters']),_0x2d618c);if(_0x58c1ee[_0xc43a('0x34')]['filter']){_0x39d3ae[_0xc43a('0x3e')]=_[_0xc43a('0x3f')](_0x39d3ae[_0xc43a('0x3e')],{'$or':_['map'](_0x2d618c,function(_0x4f9150){if(_0x4f9150[_0xc43a('0x40')]!==_0xc43a('0x41')){var _0x1e83a5={};_0x1e83a5[_0x4f9150['name']]={'$like':'%'+_0x58c1ee['query'][_0xc43a('0x42')]+'%'};return _0x1e83a5;}})});}_0x39d3ae=_[_0xc43a('0x3f')]({},_0x39d3ae,_0x58c1ee[_0xc43a('0x43')]);var _0x4fa36a={'where':_0x39d3ae[_0xc43a('0x3e')]};return db[_0xc43a('0x2c')]['count'](_0x4fa36a)[_0xc43a('0x24')](function(_0x366837){_0x2ccfd7[_0xc43a('0x20')]=_0x366837;if(_0x58c1ee['query']['includeAll']){_0x39d3ae[_0xc43a('0x44')]=[{'all':!![]}];}return db[_0xc43a('0x2c')]['findAll'](_0x39d3ae);})['then'](function(_0x5e9108){_0x2ccfd7[_0xc43a('0x45')]=_0x5e9108;return _0x2ccfd7;})['then'](respondWithFilteredResult(_0x45222c,_0x39d3ae))['catch'](handleError(_0x45222c,null));};exports[_0xc43a('0x46')]=function(_0x45effe,_0x3b3c75){var _0x17b295={'raw':![],'where':{'id':_0x45effe[_0xc43a('0x47')]['id']}},_0x22c58d={};_0x22c58d[_0xc43a('0x30')]=_[_0xc43a('0x33')](db[_0xc43a('0x2c')][_0xc43a('0x2d')]);_0x22c58d[_0xc43a('0x34')]=_['keys'](_0x45effe[_0xc43a('0x34')]);_0x22c58d['filters']=_['intersection'](_0x22c58d[_0xc43a('0x30')],_0x22c58d['query']);_0x17b295[_0xc43a('0x38')]=_[_0xc43a('0x36')](_0x22c58d[_0xc43a('0x30')],qs[_0xc43a('0x37')](_0x45effe['query'][_0xc43a('0x37')]));_0x17b295[_0xc43a('0x38')]=_0x17b295[_0xc43a('0x38')][_0xc43a('0x39')]?_0x17b295[_0xc43a('0x38')]:_0x22c58d[_0xc43a('0x30')];if(_0x45effe[_0xc43a('0x34')][_0xc43a('0x48')]){_0x17b295[_0xc43a('0x44')]=[{'all':!![]}];}_0x17b295=_[_0xc43a('0x3f')]({},_0x17b295,_0x45effe[_0xc43a('0x43')]);return db[_0xc43a('0x2c')][_0xc43a('0x49')](_0x17b295)[_0xc43a('0x24')](handleEntityNotFound(_0x3b3c75,null))[_0xc43a('0x24')](respondWithResult(_0x3b3c75,null))['catch'](handleError(_0x3b3c75,null));};exports['create']=function(_0x60d8e,_0x23e972){return db[_0xc43a('0x2c')][_0xc43a('0x4a')](_0x60d8e[_0xc43a('0x4b')],{})[_0xc43a('0x24')](respondWithResult(_0x23e972,0xc9))[_0xc43a('0x4c')](handleError(_0x23e972,null));};exports[_0xc43a('0x23')]=function(_0x578e5f,_0x460d16){if(_0x578e5f[_0xc43a('0x4b')]['id']){delete _0x578e5f[_0xc43a('0x4b')]['id'];}return db[_0xc43a('0x2c')][_0xc43a('0x49')]({'where':{'id':_0x578e5f[_0xc43a('0x47')]['id']}})[_0xc43a('0x24')](handleEntityNotFound(_0x460d16,null))[_0xc43a('0x24')](saveUpdates(_0x578e5f[_0xc43a('0x4b')],null))[_0xc43a('0x24')](respondWithResult(_0x460d16,null))[_0xc43a('0x4c')](handleError(_0x460d16,null));};exports['describe']=function(_0x3a1299,_0x17487a){return db['VoiceRecording'][_0xc43a('0x4d')]()[_0xc43a('0x24')](respondWithResult(_0x17487a,null))[_0xc43a('0x4c')](handleError(_0x17487a,null));};exports['download']=function(_0x46bbc8,_0x405ecb,_0x2aff07){var _0x2eb531=require(_0xc43a('0x4e'));var _0x4b4163=![];var _0xf5a793={};if(_0x46bbc8['query']['type']&&_0x46bbc8[_0xc43a('0x34')][_0xc43a('0x40')]===_0xc43a('0x4f')){_0xf5a793[_0xc43a('0x4f')]=_0x46bbc8[_0xc43a('0x47')]['id'];}else{_0xf5a793['id']=_0x46bbc8[_0xc43a('0x47')]['id'];}return db[_0xc43a('0x2c')][_0xc43a('0x49')]({'where':_0xf5a793,'attributes':['id',_0xc43a('0x50')],'raw':!![]})[_0xc43a('0x24')](handleEntityNotFound(_0x405ecb,null))[_0xc43a('0x24')](function(_0x4ac884){if(_0x4ac884){var _0x24af61=_0x4ac884['value'];var _0x6e6438=util[_0xc43a('0x32')](_0xc43a('0x51'),_0x24af61);if(fs[_0xc43a('0x52')](_0x6e6438)){_0x4b4163=!![];return _0x2eb531[_0xc43a('0x53')](_0x6e6438,_0x24af61,config['secrets'][_0xc43a('0x54')])[_0xc43a('0x24')](function(){return _0x4ac884;});}return _0x4ac884;}})[_0xc43a('0x24')](function(_0x1ceebd){if(_0x1ceebd){var _0x43707e=_0x1ceebd[_0xc43a('0x50')];if(!fs[_0xc43a('0x52')](_0x43707e)){throw new db[(_0xc43a('0x55'))]['ValidationError'](_0xc43a('0x56'));}if(_0x1ceebd['filename']){return _0x405ecb[_0xc43a('0x57')](_0x43707e,_0x1ceebd[_0xc43a('0x58')]+path[_0xc43a('0x59')](_0x43707e),function(){if(_0x4b4163){fs['unlink'](_0x43707e);}});}else{return _0x405ecb[_0xc43a('0x57')](_0x43707e,function(_0x21d759){if(_0x4b4163){fs['unlink'](_0x43707e);}});}}})['catch'](function(_0x108ca2){if(_0x108ca2['message']===_0xc43a('0x56')){_0x405ecb['status'](0x194)[_0xc43a('0x5a')](_0xc43a('0x5b'));}else{return handleError(_0x405ecb,null);}});};exports[_0xc43a('0x5c')]=function(_0x507ea1,_0x14e750,_0xc89506){var _0x39ff06=require(_0xc43a('0x4e'));var _0x59c8a1=![];var _0x2e68aa={'$and':[db[_0xc43a('0x5d')][_0xc43a('0x3e')](db['sequelize']['fn'](_0xc43a('0x5e'),db['sequelize'][_0xc43a('0x5f')](_0xc43a('0x4f'))),_0x507ea1['query']['token'])]};if(_0x507ea1[_0xc43a('0x34')][_0xc43a('0x40')]&&_0x507ea1['query']['type']===_0xc43a('0x4f')){_0x2e68aa[_0xc43a('0x60')][_0xc43a('0x61')]({'uniqueid':_0x507ea1[_0xc43a('0x47')]['id']});}else{_0x2e68aa[_0xc43a('0x60')][_0xc43a('0x61')]({'id':_0x507ea1['params']['id']});}return db['VoiceRecording'][_0xc43a('0x49')]({'where':_0x2e68aa,'attributes':['id','value'],'raw':!![]})[_0xc43a('0x24')](handleEntityNotFound(_0x14e750,null))[_0xc43a('0x24')](function(_0x283284){if(_0x283284){var _0x27e01a=util['format']('%s.cypher',_0x283284['value']);if(fs[_0xc43a('0x52')](_0x27e01a)){_0x59c8a1=!![];return _0x39ff06[_0xc43a('0x53')](_0x27e01a,_0x283284[_0xc43a('0x50')],config[_0xc43a('0x62')]['recording'])['then'](function(){return _0x283284;});}return _0x283284;}})[_0xc43a('0x24')](function(_0x2ad330){if(_0x2ad330){if(!fs[_0xc43a('0x52')](_0x2ad330['value'])){throw new db[(_0xc43a('0x55'))][(_0xc43a('0x63'))](_0xc43a('0x56'));}if(_0x2ad330[_0xc43a('0x58')]){return _0x14e750[_0xc43a('0x57')](_0x2ad330[_0xc43a('0x50')],_0x2ad330[_0xc43a('0x58')]+path['extname'](_0x2ad330[_0xc43a('0x50')]),function(){if(_0x59c8a1){fs['unlink'](_0x2ad330[_0xc43a('0x50')]);}});}else{return _0x14e750[_0xc43a('0x57')](_0x2ad330[_0xc43a('0x50')],function(_0x418b2b){if(_0x59c8a1){fs['unlink'](_0x2ad330[_0xc43a('0x50')]);}});}}})[_0xc43a('0x4c')](handleError(_0x14e750,null));};exports[_0xc43a('0x25')]=function(_0x23ecc5,_0x28fbdf){return db['VoiceRecording'][_0xc43a('0x49')]({'where':{'id':_0x23ecc5['params']['id']}})[_0xc43a('0x24')](function(_0x36e504){if(_[_0xc43a('0x64')](_0x36e504)){throw new ReferenceError(_0xc43a('0x65'));}return _0x36e504;})[_0xc43a('0x24')](function(_0x13d8e4){var _0x569168=_0x13d8e4[_0xc43a('0x50')];logger[_0xc43a('0x66')](_0xc43a('0x67'),_0x569168);if(!_[_0xc43a('0x64')](_0x13d8e4[_0xc43a('0x50')])&&fs[_0xc43a('0x52')](_0x569168)){logger['info'](_0xc43a('0x68')+_0x569168+_0xc43a('0x69'));fs[_0xc43a('0x6a')](_0x569168);}_0x569168=_0x569168+'.cypher';if(!_[_0xc43a('0x64')](_0x13d8e4['value'])&&fs[_0xc43a('0x52')](_0x569168)){logger[_0xc43a('0x66')](_0xc43a('0x68')+_0x569168+_0xc43a('0x69'));fs[_0xc43a('0x6a')](_0x569168);}return _0x13d8e4;})[_0xc43a('0x24')](function(_0x12417f){if(!_0x12417f)throw new InternalError();return _0x12417f['destroy']();})['then'](function(){_0x28fbdf[_0xc43a('0x1c')](0xcc)[_0xc43a('0x26')]();})[_0xc43a('0x4c')](handleError(_0x28fbdf,null));};function getBucketslist(_0x15a472,_0x425a36,_0x56973a){return new Promise(function(_0x174b80,_0x18fdca){var _0x5a5d31=new AWS['S3']({'accessKeyId':_0x425a36,'secretAccessKey':_0x15a472,'region':_0x56973a});_0x5a5d31[_0xc43a('0x6b')]({},function(_0x35e582,_0x34e7d4){if(_0x35e582){return _0x18fdca(_0x35e582);}else{return _0x174b80(_0x34e7d4);}});});}function createBucket(_0x26582c,_0x1af570,_0xb6b28d,_0x24b4be){return new Promise(function(_0x26f76c,_0xe3683){var _0x32b73d=new AWS['S3']({'accessKeyId':_0x1af570,'secretAccessKey':_0x26582c,'region':_0xb6b28d});_0x32b73d[_0xc43a('0x6c')]({'Bucket':_0x24b4be},function(_0x1deb71,_0x2dbe9d){if(_0x1deb71){return _0xe3683(_0x1deb71);}else{return _0x26f76c(_0x2dbe9d);}});});}function uploadFile(_0x1db2dc,_0x46191a,_0x46b481,_0x5afd4b,_0x3b2d72,_0x51157d){return new Promise(function(_0x56b6bc,_0x33ec8c){var _0x224cfd=new AWS['S3']({'accessKeyId':_0x46191a,'secretAccessKey':_0x1db2dc,'region':_0x46b481});_0x224cfd[_0xc43a('0x6d')]({'Bucket':_0x5afd4b,'Key':_0x3b2d72,'Body':_0x51157d},function(_0x99b2f2,_0x44152f){if(_0x99b2f2){return _0x33ec8c(_0x99b2f2);}else{return _0x56b6bc(_0x44152f);}});});}function startTranscribe(_0x35feb7,_0x3b3007,_0x42cc82,_0x529991,_0xdf1f5d,_0x439d2c){return new Promise(function(_0x1e20af,_0x597e45){var _0x41d2a5=new AWS[(_0xc43a('0x6e'))]({'accessKeyId':_0x3b3007,'secretAccessKey':_0x35feb7,'region':_0x42cc82});_0x41d2a5[_0xc43a('0x6f')]({'TranscriptionJobName':_0x529991,'LanguageCode':_0xdf1f5d,'Media':{'MediaFileUri':_0x439d2c}},function(_0x102ca9,_0x206bfe){if(_0x102ca9){return _0x597e45(_0x102ca9);}else{return _0x1e20af(_0x206bfe);}});});}function transcribe(_0x7bd921,_0x547986,_0x22f188,_0x358e54,_0x324b3c,_0x32bdb1,_0x37e0a7){return new Promise(function(_0x171525,_0x41f1eb){var _0xec16c6={};logger[_0xc43a('0x66')](util[_0xc43a('0x32')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x7bd921,_0x324b3c));return uploadFile(_0x547986,_0x22f188,_0x358e54,_0x324b3c,path[_0xc43a('0x70')](_0x32bdb1),fs[_0xc43a('0x71')](_0x32bdb1))[_0xc43a('0x24')](function(_0x26ffcf){logger['info'](util[_0xc43a('0x32')](_0xc43a('0x72'),_0x7bd921,_0x324b3c,_0x26ffcf[_0xc43a('0x73')]));_0xec16c6[_0xc43a('0x74')]=_0x26ffcf[_0xc43a('0x75')];_0xec16c6[_0xc43a('0x76')]=_0x26ffcf[_0xc43a('0x73')];logger['info'](util[_0xc43a('0x32')](_0xc43a('0x77'),_0x7bd921));return startTranscribe(_0x547986,_0x22f188,_0x358e54,uuidv4(),_0x37e0a7,_0x26ffcf['Location']);})[_0xc43a('0x24')](function(_0x2200f1){logger[_0xc43a('0x66')](util[_0xc43a('0x32')](_0xc43a('0x78'),_0x7bd921,_0x2200f1[_0xc43a('0x79')][_0xc43a('0x7a')]));_0xec16c6[_0xc43a('0x7b')]=_0x2200f1[_0xc43a('0x79')][_0xc43a('0x7a')];_0xec16c6[_0xc43a('0x7c')]=_0x2200f1[_0xc43a('0x79')][_0xc43a('0x7d')];return _0x171525(_0xec16c6);})[_0xc43a('0x4c')](function(_0x3dc5ae){return _0x41f1eb(_0x3dc5ae);});});}exports[_0xc43a('0x7e')]=function(_0x19a1ec,_0x4377ff,_0x5ad8ae){var _0x489845;var _0x383e7e;var _0x1335e2;var _0xee1737=require(_0xc43a('0x4e'));return db[_0xc43a('0x2c')][_0xc43a('0x7f')]({'where':{'id':_0x19a1ec['params']['id']}})['then'](function(_0x1c332c){if(_0x1c332c){var _0x40be8e=util[_0xc43a('0x32')](_0xc43a('0x51'),_0x1c332c[_0xc43a('0x50')]);if(fs[_0xc43a('0x52')](_0x40be8e)){cypher=!![];return _0xee1737[_0xc43a('0x53')](_0x40be8e,_0x1c332c[_0xc43a('0x50')],config[_0xc43a('0x62')][_0xc43a('0x54')])[_0xc43a('0x24')](function(){return _0x1c332c;});}return _0x1c332c;}})[_0xc43a('0x24')](function(_0x22e2a2){if(!_0x22e2a2){throw new db['Sequelize'][(_0xc43a('0x63'))](_0xc43a('0x80'));}_0x383e7e=_0x22e2a2;return db[_0xc43a('0x81')][_0xc43a('0x7f')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x4377ff,null))[_0xc43a('0x24')](function(_0x63de06){if(_0x63de06){_0x489845=_0x63de06;if(!_0x489845[_0xc43a('0x82')]||!_0x489845[_0xc43a('0x83')]||!_0x489845[_0xc43a('0x84')]||!_0x489845['language']||!_0x489845[_0xc43a('0x74')]){throw new db[(_0xc43a('0x55'))][(_0xc43a('0x63'))]('Transcribe\x20not\x20configured');}if(_0x19a1ec['body'][_0xc43a('0x85')]&&(!_0x489845[_0xc43a('0x86')]||!_0x489845[_0xc43a('0x87')]||!_0x489845['sentimentRegion']||!_0x489845['language']||!_0x489845[_0xc43a('0x74')])){throw new db[(_0xc43a('0x55'))]['ValidationError'](_0xc43a('0x88'));}return db[_0xc43a('0x89')][_0xc43a('0x7f')]({'where':{'id':_0x489845['transcribeAccountId']}});}})[_0xc43a('0x24')](function(_0x271fd9){if(!_0x271fd9){throw new db[(_0xc43a('0x55'))][(_0xc43a('0x63'))](_0xc43a('0x8a'));}if(!_0x271fd9[_0xc43a('0x8b')]||!_0x271fd9[_0xc43a('0x8c')]){throw new db[(_0xc43a('0x55'))][(_0xc43a('0x63'))]('Cloud\x20Provider\x20not\x20configured');}_0x1335e2=_0x271fd9;return getBucketslist(_0x1335e2['data1'],_0x1335e2[_0xc43a('0x8c')],_0x489845[_0xc43a('0x84')]);})[_0xc43a('0x24')](function(_0x2b4319){if(_0x2b4319&&_0x2b4319[_0xc43a('0x8d')]){var _0x167073=_[_0xc43a('0x49')](_0x2b4319[_0xc43a('0x8d')],function(_0x48a442){return _0x48a442[_0xc43a('0x8e')]===_0x489845[_0xc43a('0x74')];});if(!_0x167073){logger[_0xc43a('0x66')](util[_0xc43a('0x32')](_0xc43a('0x8f'),_0x19a1ec[_0xc43a('0x47')]['id'],_0x489845[_0xc43a('0x74')]));return createBucket(_0x1335e2[_0xc43a('0x8b')],_0x1335e2[_0xc43a('0x8c')],_0x489845[_0xc43a('0x84')],_0x489845[_0xc43a('0x74')]);}logger[_0xc43a('0x66')](util[_0xc43a('0x32')](_0xc43a('0x90'),_0x19a1ec[_0xc43a('0x47')]['id'],_0x489845['bucket']));return;}})[_0xc43a('0x24')](function(_0x145d5b){if(_0x383e7e[_0xc43a('0x7c')]===_0xc43a('0x91')){return transcribe(_0x19a1ec[_0xc43a('0x47')]['id'],_0x1335e2[_0xc43a('0x8b')],_0x1335e2['data2'],_0x489845[_0xc43a('0x84')],_0x489845[_0xc43a('0x74')],_0x383e7e[_0xc43a('0x50')],_0x489845[_0xc43a('0x92')]);}else{logger[_0xc43a('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x19a1ec['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xc43a('0x24')](function(_0xdf742e){if(_0xdf742e){_0xdf742e[_0xc43a('0x93')]=_0x19a1ec[_0xc43a('0x4b')]['runSentiment'];return _0x383e7e[_0xc43a('0x94')](_0xdf742e);}})['then'](respondWithResult(_0x4377ff,null))[_0xc43a('0x4c')](handleError(_0x4377ff,null));};function writeFile(_0xf6e373,_0x3444fb){return new Promise(function(_0x176a10,_0x5131e9){fs['writeFile'](_0x3444fb,_0xf6e373,function(_0x3be3b4,_0x3af15f){if(_0x3be3b4){return _0x5131e9(_0x3be3b4);}else{return _0x176a10(_0x3af15f);}});});}exports[_0xc43a('0x95')]=function(_0x1867d5,_0x30ee58,_0x42accc){return db[_0xc43a('0x2c')]['findOne']({'where':{'id':_0x1867d5[_0xc43a('0x47')]['id']}})['then'](handleEntityNotFound(_0x30ee58))[_0xc43a('0x24')](function(_0x39017f){if(_0x39017f&&_0x39017f[_0xc43a('0x96')]){var _0x544d4e=_0x39017f[_0xc43a('0x96')];var _0x3b8c6e=config[_0xc43a('0x97')]+_0xc43a('0x98')+_0x39017f['id']+_0xc43a('0x99');if(fs[_0xc43a('0x52')](_0x3b8c6e)){return _0x3b8c6e;}return writeFile(_0x544d4e,_0x3b8c6e)[_0xc43a('0x24')](function(){return _0x3b8c6e;});}else{throw new db[(_0xc43a('0x55'))][(_0xc43a('0x63'))](_0xc43a('0x9a'));}})[_0xc43a('0x24')](function(_0x454bda){return _0x30ee58['download'](_0x454bda);})['catch'](handleError(_0x30ee58));}; \ No newline at end of file +var _0xa87c=['status','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','VoiceRecording','include','findAll','rows','catch','params','includeAll','create','update','body','describe','download','../../components/encryptor','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','uniqueid','token','$and','push','secrets','ValidationError','find','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x48fff1,_0x50c537){var _0x127a1d=function(_0x2abe66){while(--_0x2abe66){_0x48fff1['push'](_0x48fff1['shift']());}};_0x127a1d(++_0x50c537);}(_0xa87c,0x1a8));var _0xca87=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xa87c[_0x503cd5];return _0x1fdf1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xca87('0x0'));var jsonpatch=require(_0xca87('0x1'));var rp=require('request-promise');var moment=require(_0xca87('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xca87('0x3'));var util=require(_0xca87('0x4'));var path=require(_0xca87('0x5'));var sox=require(_0xca87('0x6'));var csv=require(_0xca87('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca87('0x8'));var _=require(_0xca87('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xca87('0xa'));var toCsv=require(_0xca87('0x7'));var querystring=require('querystring');var Papa=require(_0xca87('0xb'));var AWS=require(_0xca87('0xc'));var uuidv4=require(_0xca87('0xd'));var Redis=require(_0xca87('0xe'));var authService=require(_0xca87('0xf'));var qs=require(_0xca87('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xca87('0x11'))(_0xca87('0x12'));var utils=require('../../config/utils');var config=require(_0xca87('0x13'));var licenseUtil=require(_0xca87('0x14'));var db=require(_0xca87('0x15'))['db'];function respondWithStatusCode(_0x5bb8f3,_0x3cbf65){_0x3cbf65=_0x3cbf65||0xcc;return function(_0x455f91){if(_0x455f91){return _0x5bb8f3[_0xca87('0x16')](_0x3cbf65);}return _0x5bb8f3['status'](_0x3cbf65)['end']();};}function respondWithResult(_0x252f58,_0x386aa8){_0x386aa8=_0x386aa8||0xc8;return function(_0x3bb3d7){if(_0x3bb3d7){return _0x252f58[_0xca87('0x17')](_0x386aa8)[_0xca87('0x18')](_0x3bb3d7);}};}function respondWithFilteredResult(_0x42118c,_0x2b2197){return function(_0x4ece31){if(_0x4ece31){var _0x1ee6d0=typeof _0x2b2197['offset']===_0xca87('0x19')&&typeof _0x2b2197[_0xca87('0x1a')]===_0xca87('0x19');var _0x119d55=_0x4ece31['count'];var _0x2d011a=_0x1ee6d0?0x0:_0x2b2197[_0xca87('0x1b')];var _0x20ee9a=_0x1ee6d0?_0x4ece31[_0xca87('0x1c')]:_0x2b2197[_0xca87('0x1b')]+_0x2b2197['limit'];var _0x23a6d4;if(_0x20ee9a>=_0x119d55){_0x20ee9a=_0x119d55;_0x23a6d4=0xc8;}else{_0x23a6d4=0xce;}_0x42118c['status'](_0x23a6d4);return _0x42118c[_0xca87('0x1d')]('Content-Range',_0x2d011a+'-'+_0x20ee9a+'/'+_0x119d55)[_0xca87('0x18')](_0x4ece31);}return null;};}function patchUpdates(_0x3ea37f){return function(_0x203dc7){try{jsonpatch[_0xca87('0x1e')](_0x203dc7,_0x3ea37f,!![]);}catch(_0x455606){return BPromise[_0xca87('0x1f')](_0x455606);}return _0x203dc7[_0xca87('0x20')]();};}function saveUpdates(_0x4036e7,_0x51aa20){return function(_0x476957){if(_0x476957){return _0x476957['update'](_0x4036e7)[_0xca87('0x21')](function(_0x36cd71){return _0x36cd71;});}return null;};}function removeEntity(_0x77c647,_0x20026e){return function(_0xa73541){if(_0xa73541){return _0xa73541[_0xca87('0x22')]()[_0xca87('0x21')](function(){_0x77c647[_0xca87('0x17')](0xcc)[_0xca87('0x23')]();});}};}function handleEntityNotFound(_0x573f40,_0x2718b8){return function(_0x208d52){if(!_0x208d52){_0x573f40[_0xca87('0x16')](0x194);}return _0x208d52;};}function handleError(_0x3c8a32,_0x2d7df9){_0x2d7df9=_0x2d7df9||0x1f4;return function(_0x58213f){logger[_0xca87('0x24')](_0x58213f['stack']);if(_0x58213f[_0xca87('0x25')]){delete _0x58213f['name'];}_0x3c8a32[_0xca87('0x17')](_0x2d7df9)[_0xca87('0x26')](_0x58213f);};}exports[_0xca87('0x27')]=function(_0x4d207f,_0x8ee48d){var _0x16a481={},_0x3b707f={},_0x510438={'count':0x0,'rows':[]};var _0x2baea5=_['map'](db['VoiceRecording'][_0xca87('0x28')],function(_0x4c90a7){return{'name':_0x4c90a7[_0xca87('0x29')],'type':_0x4c90a7[_0xca87('0x2a')][_0xca87('0x2b')]};});_0x3b707f[_0xca87('0x2c')]=_[_0xca87('0x2d')](_[_0xca87('0x2e')](_0x2baea5,_0xca87('0x25')),[_0xca87('0x2f')]);_0x3b707f[_0xca87('0x30')]=_[_0xca87('0x31')](_0x4d207f['query']);_0x3b707f[_0xca87('0x32')]=_['intersection'](_0x3b707f['model'],_0x3b707f[_0xca87('0x30')]);_0x16a481['attributes']=_[_0xca87('0x33')](_0x3b707f[_0xca87('0x2c')],qs[_0xca87('0x34')](_0x4d207f[_0xca87('0x30')][_0xca87('0x34')]));_0x16a481[_0xca87('0x35')]=_0x16a481[_0xca87('0x35')]['length']?_0x16a481[_0xca87('0x35')]:_0x3b707f['model'];if(!_0x4d207f[_0xca87('0x30')][_0xca87('0x36')](_0xca87('0x37'))){_0x16a481[_0xca87('0x1a')]=qs['limit'](_0x4d207f[_0xca87('0x30')][_0xca87('0x1a')]);_0x16a481[_0xca87('0x1b')]=qs[_0xca87('0x1b')](_0x4d207f[_0xca87('0x30')][_0xca87('0x1b')]);}_0x16a481[_0xca87('0x38')]=qs['sort'](_0x4d207f['query']['sort']);_0x16a481['where']=qs[_0xca87('0x32')](_[_0xca87('0x39')](_0x4d207f['query'],_0x3b707f[_0xca87('0x32')]),_0x2baea5);if(_0x4d207f[_0xca87('0x30')][_0xca87('0x3a')]){_0x16a481[_0xca87('0x3b')]=_[_0xca87('0x3c')](_0x16a481[_0xca87('0x3b')],{'$or':_[_0xca87('0x2e')](_0x2baea5,function(_0x3da491){if(_0x3da491[_0xca87('0x2a')]!==_0xca87('0x3d')){var _0x38caf8={};_0x38caf8[_0x3da491['name']]={'$like':'%'+_0x4d207f['query'][_0xca87('0x3a')]+'%'};return _0x38caf8;}})});}_0x16a481=_[_0xca87('0x3c')]({},_0x16a481,_0x4d207f[_0xca87('0x3e')]);var _0xaaa9cd={'where':_0x16a481[_0xca87('0x3b')]};return db[_0xca87('0x3f')]['count'](_0xaaa9cd)['then'](function(_0x462586){_0x510438[_0xca87('0x1c')]=_0x462586;if(_0x4d207f[_0xca87('0x30')]['includeAll']){_0x16a481[_0xca87('0x40')]=[{'all':!![]}];}return db[_0xca87('0x3f')][_0xca87('0x41')](_0x16a481);})[_0xca87('0x21')](function(_0x49e02d){_0x510438[_0xca87('0x42')]=_0x49e02d;return _0x510438;})['then'](respondWithFilteredResult(_0x8ee48d,_0x16a481))[_0xca87('0x43')](handleError(_0x8ee48d,null));};exports['show']=function(_0x49686a,_0x14e004){var _0x595af0={'raw':![],'where':{'id':_0x49686a[_0xca87('0x44')]['id']}},_0x8e7001={};_0x8e7001[_0xca87('0x2c')]=_[_0xca87('0x31')](db[_0xca87('0x3f')][_0xca87('0x28')]);_0x8e7001[_0xca87('0x30')]=_[_0xca87('0x31')](_0x49686a['query']);_0x8e7001[_0xca87('0x32')]=_[_0xca87('0x33')](_0x8e7001[_0xca87('0x2c')],_0x8e7001[_0xca87('0x30')]);_0x595af0[_0xca87('0x35')]=_[_0xca87('0x33')](_0x8e7001[_0xca87('0x2c')],qs[_0xca87('0x34')](_0x49686a[_0xca87('0x30')][_0xca87('0x34')]));_0x595af0[_0xca87('0x35')]=_0x595af0[_0xca87('0x35')]['length']?_0x595af0[_0xca87('0x35')]:_0x8e7001[_0xca87('0x2c')];if(_0x49686a[_0xca87('0x30')][_0xca87('0x45')]){_0x595af0[_0xca87('0x40')]=[{'all':!![]}];}_0x595af0=_[_0xca87('0x3c')]({},_0x595af0,_0x49686a[_0xca87('0x3e')]);return db[_0xca87('0x3f')]['find'](_0x595af0)[_0xca87('0x21')](handleEntityNotFound(_0x14e004,null))['then'](respondWithResult(_0x14e004,null))[_0xca87('0x43')](handleError(_0x14e004,null));};exports[_0xca87('0x46')]=function(_0x18007d,_0xd8b421){return db[_0xca87('0x3f')][_0xca87('0x46')](_0x18007d['body'],{})[_0xca87('0x21')](respondWithResult(_0xd8b421,0xc9))[_0xca87('0x43')](handleError(_0xd8b421,null));};exports[_0xca87('0x47')]=function(_0x5c8274,_0x49319d){if(_0x5c8274[_0xca87('0x48')]['id']){delete _0x5c8274[_0xca87('0x48')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x5c8274[_0xca87('0x44')]['id']}})[_0xca87('0x21')](handleEntityNotFound(_0x49319d,null))['then'](saveUpdates(_0x5c8274[_0xca87('0x48')],null))[_0xca87('0x21')](respondWithResult(_0x49319d,null))[_0xca87('0x43')](handleError(_0x49319d,null));};exports['describe']=function(_0x2cd1c1,_0x250d22){return db[_0xca87('0x3f')][_0xca87('0x49')]()[_0xca87('0x21')](respondWithResult(_0x250d22,null))[_0xca87('0x43')](handleError(_0x250d22,null));};exports[_0xca87('0x4a')]=function(_0x3784bf,_0x37756f,_0x2f0746){var _0x30cf85=require(_0xca87('0x4b'));var _0x200dc1=![];var _0x34e129={};if(_0x3784bf[_0xca87('0x30')][_0xca87('0x2a')]&&_0x3784bf[_0xca87('0x30')][_0xca87('0x2a')]==='uniqueid'){_0x34e129['uniqueid']=_0x3784bf['params']['id'];}else{_0x34e129['id']=_0x3784bf[_0xca87('0x44')]['id'];}return db[_0xca87('0x3f')]['find']({'where':_0x34e129,'attributes':['id',_0xca87('0x4c')],'raw':!![]})[_0xca87('0x21')](handleEntityNotFound(_0x37756f,null))['then'](function(_0x38e824){if(_0x38e824){var _0xc50d29=_0x38e824[_0xca87('0x4c')];var _0x3989fc=util['format'](_0xca87('0x4d'),_0xc50d29);if(fs[_0xca87('0x4e')](_0x3989fc)){_0x200dc1=!![];return _0x30cf85[_0xca87('0x4f')](_0x3989fc,_0xc50d29,config['secrets'][_0xca87('0x50')])['then'](function(){return _0x38e824;});}return _0x38e824;}})[_0xca87('0x21')](function(_0x4418d3){if(_0x4418d3){var _0x1fe19a=_0x4418d3[_0xca87('0x4c')];if(!fs[_0xca87('0x4e')](_0x1fe19a)){throw new db[(_0xca87('0x51'))]['ValidationError'](_0xca87('0x52'));}if(_0x4418d3[_0xca87('0x53')]){return _0x37756f[_0xca87('0x4a')](_0x1fe19a,_0x4418d3['filename']+path[_0xca87('0x54')](_0x1fe19a),function(){if(_0x200dc1){fs['unlink'](_0x1fe19a);}});}else{return _0x37756f[_0xca87('0x4a')](_0x1fe19a,function(_0x1479e1){if(_0x200dc1){fs[_0xca87('0x55')](_0x1fe19a);}});}}})[_0xca87('0x43')](function(_0x185234){if(_0x185234['message']===_0xca87('0x52')){_0x37756f[_0xca87('0x17')](0x194)[_0xca87('0x26')](_0xca87('0x56'));}else{return handleError(_0x37756f,null);}});};exports[_0xca87('0x57')]=function(_0x46eb3a,_0x39ac96,_0x103154){var _0x50efb4=require('../../components/encryptor');var _0x2624ea=![];var _0x19d631={'$and':[db['sequelize'][_0xca87('0x3b')](db[_0xca87('0x58')]['fn'](_0xca87('0x59'),db[_0xca87('0x58')][_0xca87('0x5a')](_0xca87('0x5b'))),_0x46eb3a[_0xca87('0x30')][_0xca87('0x5c')])]};if(_0x46eb3a[_0xca87('0x30')]['type']&&_0x46eb3a[_0xca87('0x30')]['type']===_0xca87('0x5b')){_0x19d631[_0xca87('0x5d')][_0xca87('0x5e')]({'uniqueid':_0x46eb3a[_0xca87('0x44')]['id']});}else{_0x19d631[_0xca87('0x5d')]['push']({'id':_0x46eb3a[_0xca87('0x44')]['id']});}return db['VoiceRecording']['find']({'where':_0x19d631,'attributes':['id',_0xca87('0x4c')],'raw':!![]})[_0xca87('0x21')](handleEntityNotFound(_0x39ac96,null))[_0xca87('0x21')](function(_0x41177e){if(_0x41177e){var _0x3917cd=util[_0xca87('0x2f')]('%s.cypher',_0x41177e['value']);if(fs[_0xca87('0x4e')](_0x3917cd)){_0x2624ea=!![];return _0x50efb4[_0xca87('0x4f')](_0x3917cd,_0x41177e['value'],config[_0xca87('0x5f')][_0xca87('0x50')])[_0xca87('0x21')](function(){return _0x41177e;});}return _0x41177e;}})[_0xca87('0x21')](function(_0x5e8fb8){if(_0x5e8fb8){if(!fs[_0xca87('0x4e')](_0x5e8fb8['value'])){throw new db['Sequelize'][(_0xca87('0x60'))](_0xca87('0x52'));}if(_0x5e8fb8[_0xca87('0x53')]){return _0x39ac96['download'](_0x5e8fb8[_0xca87('0x4c')],_0x5e8fb8[_0xca87('0x53')]+path[_0xca87('0x54')](_0x5e8fb8['value']),function(){if(_0x2624ea){fs[_0xca87('0x55')](_0x5e8fb8[_0xca87('0x4c')]);}});}else{return _0x39ac96['download'](_0x5e8fb8[_0xca87('0x4c')],function(_0x37788a){if(_0x2624ea){fs['unlink'](_0x5e8fb8['value']);}});}}})[_0xca87('0x43')](handleError(_0x39ac96,null));};exports[_0xca87('0x22')]=function(_0x44f807,_0x2b8738){return db[_0xca87('0x3f')][_0xca87('0x61')]({'where':{'id':_0x44f807[_0xca87('0x44')]['id']}})['then'](function(_0x5239f3){if(_[_0xca87('0x62')](_0x5239f3)){throw new ReferenceError(_0xca87('0x63'));}return _0x5239f3;})[_0xca87('0x21')](function(_0x3297f3){var _0x40267e=_0x3297f3[_0xca87('0x4c')];logger[_0xca87('0x64')](_0xca87('0x65'),_0x40267e);if(!_[_0xca87('0x62')](_0x3297f3[_0xca87('0x4c')])&&fs[_0xca87('0x4e')](_0x40267e)){logger[_0xca87('0x64')]('File:\x20\x22'+_0x40267e+_0xca87('0x66'));fs[_0xca87('0x67')](_0x40267e);}_0x40267e=_0x40267e+_0xca87('0x68');if(!_[_0xca87('0x62')](_0x3297f3['value'])&&fs['existsSync'](_0x40267e)){logger[_0xca87('0x64')](_0xca87('0x69')+_0x40267e+_0xca87('0x66'));fs['unlinkSync'](_0x40267e);}return _0x3297f3;})[_0xca87('0x21')](function(_0x2fe74d){if(!_0x2fe74d)throw new InternalError();return _0x2fe74d[_0xca87('0x22')]();})[_0xca87('0x21')](function(){_0x2b8738[_0xca87('0x17')](0xcc)[_0xca87('0x23')]();})[_0xca87('0x43')](handleError(_0x2b8738,null));};function getBucketslist(_0x11752a,_0x52e594,_0x3fc385){return new Promise(function(_0x2db06a,_0x3e0a44){var _0x8bd001=new AWS['S3']({'accessKeyId':_0x52e594,'secretAccessKey':_0x11752a,'region':_0x3fc385});_0x8bd001[_0xca87('0x6a')]({},function(_0x3d4eef,_0x21c2e6){if(_0x3d4eef){return _0x3e0a44(_0x3d4eef);}else{return _0x2db06a(_0x21c2e6);}});});}function createBucket(_0x986974,_0x3e91ed,_0x43e136,_0x131c0b){return new Promise(function(_0x42b8fd,_0x22de39){var _0x5b83c7=new AWS['S3']({'accessKeyId':_0x3e91ed,'secretAccessKey':_0x986974,'region':_0x43e136});_0x5b83c7['createBucket']({'Bucket':_0x131c0b},function(_0x4f41d2,_0xba214e){if(_0x4f41d2){return _0x22de39(_0x4f41d2);}else{return _0x42b8fd(_0xba214e);}});});}function uploadFile(_0x4809f5,_0x1ef158,_0x555ebd,_0x4ab2ad,_0x49011d,_0x2dd62d){return new Promise(function(_0x79a53,_0x2f6de9){var _0x364cf4=new AWS['S3']({'accessKeyId':_0x1ef158,'secretAccessKey':_0x4809f5,'region':_0x555ebd});_0x364cf4[_0xca87('0x6b')]({'Bucket':_0x4ab2ad,'Key':_0x49011d,'Body':_0x2dd62d},function(_0x350dff,_0xb9707a){if(_0x350dff){return _0x2f6de9(_0x350dff);}else{return _0x79a53(_0xb9707a);}});});}function startTranscribe(_0x25d0b2,_0x28f9be,_0x8f8c11,_0x2c2a07,_0xb4d84a,_0x3f8d01){return new Promise(function(_0xd19ee1,_0x4c33c0){var _0x726b9=new AWS['TranscribeService']({'accessKeyId':_0x28f9be,'secretAccessKey':_0x25d0b2,'region':_0x8f8c11});_0x726b9[_0xca87('0x6c')]({'TranscriptionJobName':_0x2c2a07,'LanguageCode':_0xb4d84a,'Media':{'MediaFileUri':_0x3f8d01}},function(_0x545782,_0x4eefd0){if(_0x545782){return _0x4c33c0(_0x545782);}else{return _0xd19ee1(_0x4eefd0);}});});}function transcribe(_0x8e7ca5,_0xceb233,_0x29ca90,_0x5e77ec,_0x5edcd9,_0x46910d,_0x3ad937){return new Promise(function(_0x19ba12,_0x452790){var _0x1c0f12={};logger['info'](util[_0xca87('0x2f')](_0xca87('0x6d'),_0x8e7ca5,_0x5edcd9));return uploadFile(_0xceb233,_0x29ca90,_0x5e77ec,_0x5edcd9,path[_0xca87('0x6e')](_0x46910d),fs[_0xca87('0x6f')](_0x46910d))['then'](function(_0x2ee780){logger[_0xca87('0x64')](util[_0xca87('0x2f')](_0xca87('0x70'),_0x8e7ca5,_0x5edcd9,_0x2ee780['Location']));_0x1c0f12[_0xca87('0x71')]=_0x2ee780[_0xca87('0x72')];_0x1c0f12[_0xca87('0x73')]=_0x2ee780[_0xca87('0x74')];logger[_0xca87('0x64')](util[_0xca87('0x2f')](_0xca87('0x75'),_0x8e7ca5));return startTranscribe(_0xceb233,_0x29ca90,_0x5e77ec,uuidv4(),_0x3ad937,_0x2ee780[_0xca87('0x74')]);})['then'](function(_0x1520e0){logger['info'](util['format'](_0xca87('0x76'),_0x8e7ca5,_0x1520e0[_0xca87('0x77')][_0xca87('0x78')]));_0x1c0f12['transcribeName']=_0x1520e0[_0xca87('0x77')][_0xca87('0x78')];_0x1c0f12[_0xca87('0x79')]=_0x1520e0[_0xca87('0x77')]['TranscriptionJobStatus'];return _0x19ba12(_0x1c0f12);})[_0xca87('0x43')](function(_0x274663){return _0x452790(_0x274663);});});}exports[_0xca87('0x7a')]=function(_0x31da9c,_0x2579db,_0x1e8409){var _0x1b0ecd;var _0x392609;var _0x5063f1;var _0x341deb=require('../../components/encryptor');return db[_0xca87('0x3f')][_0xca87('0x7b')]({'where':{'id':_0x31da9c[_0xca87('0x44')]['id']}})[_0xca87('0x21')](function(_0x207782){if(_0x207782){var _0x17c3b4=util['format'](_0xca87('0x4d'),_0x207782[_0xca87('0x4c')]);if(fs[_0xca87('0x4e')](_0x17c3b4)){cypher=!![];return _0x341deb[_0xca87('0x4f')](_0x17c3b4,_0x207782[_0xca87('0x4c')],config[_0xca87('0x5f')][_0xca87('0x50')])['then'](function(){return _0x207782;});}return _0x207782;}})[_0xca87('0x21')](function(_0x82071e){if(!_0x82071e){throw new db[(_0xca87('0x51'))][(_0xca87('0x60'))](_0xca87('0x7c'));}_0x392609=_0x82071e;return db[_0xca87('0x7d')][_0xca87('0x7b')]({'where':{'id':0x1}});})[_0xca87('0x21')](handleEntityNotFound(_0x2579db,null))['then'](function(_0x4ebf07){if(_0x4ebf07){_0x1b0ecd=_0x4ebf07;if(!_0x1b0ecd[_0xca87('0x7e')]||!_0x1b0ecd['transcribeAccountId']||!_0x1b0ecd['transcribeRegion']||!_0x1b0ecd[_0xca87('0x7f')]||!_0x1b0ecd['bucket']){throw new db['Sequelize'][(_0xca87('0x60'))](_0xca87('0x80'));}if(_0x31da9c[_0xca87('0x48')][_0xca87('0x81')]&&(!_0x1b0ecd[_0xca87('0x82')]||!_0x1b0ecd['sentimentAccountId']||!_0x1b0ecd[_0xca87('0x83')]||!_0x1b0ecd['language']||!_0x1b0ecd[_0xca87('0x71')])){throw new db[(_0xca87('0x51'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xca87('0x84')][_0xca87('0x7b')]({'where':{'id':_0x1b0ecd['transcribeAccountId']}});}})[_0xca87('0x21')](function(_0x3c29f7){if(!_0x3c29f7){throw new db[(_0xca87('0x51'))][(_0xca87('0x60'))](_0xca87('0x85'));}if(!_0x3c29f7[_0xca87('0x86')]||!_0x3c29f7[_0xca87('0x87')]){throw new db['Sequelize'][(_0xca87('0x60'))](_0xca87('0x88'));}_0x5063f1=_0x3c29f7;return getBucketslist(_0x5063f1['data1'],_0x5063f1[_0xca87('0x87')],_0x1b0ecd[_0xca87('0x89')]);})['then'](function(_0x1fa153){if(_0x1fa153&&_0x1fa153['Buckets']){var _0x380ad8=_['find'](_0x1fa153[_0xca87('0x8a')],function(_0x1644b4){return _0x1644b4[_0xca87('0x8b')]===_0x1b0ecd['bucket'];});if(!_0x380ad8){logger['info'](util[_0xca87('0x2f')](_0xca87('0x8c'),_0x31da9c[_0xca87('0x44')]['id'],_0x1b0ecd[_0xca87('0x71')]));return createBucket(_0x5063f1['data1'],_0x5063f1[_0xca87('0x87')],_0x1b0ecd[_0xca87('0x89')],_0x1b0ecd['bucket']);}logger['info'](util[_0xca87('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x31da9c[_0xca87('0x44')]['id'],_0x1b0ecd[_0xca87('0x71')]));return;}})[_0xca87('0x21')](function(_0x3da7b4){if(_0x392609[_0xca87('0x79')]===_0xca87('0x8d')){return transcribe(_0x31da9c[_0xca87('0x44')]['id'],_0x5063f1[_0xca87('0x86')],_0x5063f1['data2'],_0x1b0ecd['transcribeRegion'],_0x1b0ecd['bucket'],_0x392609[_0xca87('0x4c')],_0x1b0ecd['language']);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x31da9c[_0xca87('0x44')]['id']));return{'transcribeStatus':_0xca87('0x8e')};}})[_0xca87('0x21')](function(_0x44e378){if(_0x44e378){_0x44e378[_0xca87('0x8f')]=_0x31da9c[_0xca87('0x48')][_0xca87('0x81')];return _0x392609['updateAttributes'](_0x44e378);}})[_0xca87('0x21')](respondWithResult(_0x2579db,null))['catch'](handleError(_0x2579db,null));};function writeFile(_0x2a4e1f,_0x427d17){return new Promise(function(_0x889405,_0x26a2d1){fs[_0xca87('0x90')](_0x427d17,_0x2a4e1f,function(_0x397cdb,_0x4f07aa){if(_0x397cdb){return _0x26a2d1(_0x397cdb);}else{return _0x889405(_0x4f07aa);}});});}exports[_0xca87('0x91')]=function(_0x4afb72,_0x184ac1,_0x49f90d){return db[_0xca87('0x3f')][_0xca87('0x7b')]({'where':{'id':_0x4afb72[_0xca87('0x44')]['id']}})['then'](handleEntityNotFound(_0x184ac1))['then'](function(_0x111546){if(_0x111546&&_0x111546[_0xca87('0x92')]){var _0x1bf83a=_0x111546[_0xca87('0x92')];var _0x29ca5c=config['root']+_0xca87('0x93')+_0x111546['id']+'.txt';if(fs[_0xca87('0x4e')](_0x29ca5c)){return _0x29ca5c;}return writeFile(_0x1bf83a,_0x29ca5c)['then'](function(){return _0x29ca5c;});}else{throw new db[(_0xca87('0x51'))][(_0xca87('0x60'))](_0xca87('0x94'));}})[_0xca87('0x21')](function(_0x352e4d){return _0x184ac1[_0xca87('0x4a')](_0x352e4d);})[_0xca87('0x43')](handleError(_0x184ac1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3cbde27..cf417e0 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 _0x66fa=['path','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x608fcd,_0x4f72ba){var _0x2d6617=function(_0xb58dd8){while(--_0xb58dd8){_0x608fcd['push'](_0x608fcd['shift']());}};_0x2d6617(++_0x4f72ba);}(_0x66fa,0x126));var _0xa66f=function(_0x3ce1c6,_0x59755f){_0x3ce1c6=_0x3ce1c6-0x0;var _0x1837d2=_0x66fa[_0x3ce1c6];return _0x1837d2;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require(_0xa66f('0x2'))(_0xa66f('0x3'));var moment=require('moment');var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0xa66f('0x7')]=function(_0x1b2719,_0x132ee6){return _0x1b2719[_0xa66f('0x8')](_0xa66f('0x9'),attributes,{'tableName':_0xa66f('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa66f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccf3=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','api'];(function(_0x24a9bd,_0x23419a){var _0x159c03=function(_0xbe5d19){while(--_0xbe5d19){_0x24a9bd['push'](_0x24a9bd['shift']());}};_0x159c03(++_0x23419a);}(_0xccf3,0x1d3));var _0x3ccf=function(_0x3a7abe,_0x4ddc02){_0x3a7abe=_0x3a7abe-0x0;var _0x3fc1a7=_0xccf3[_0x3a7abe];return _0x3fc1a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3ccf('0x0'));var moment=require(_0x3ccf('0x1'));var BPromise=require(_0x3ccf('0x2'));var rp=require(_0x3ccf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ccf('0x4'));var config=require(_0x3ccf('0x5'));var attributes=require(_0x3ccf('0x6'));module[_0x3ccf('0x7')]=function(_0x45a684,_0x596cca){return _0x45a684[_0x3ccf('0x8')](_0x3ccf('0x9'),attributes,{'tableName':_0x3ccf('0xa'),'paranoid':![],'indexes':[{'name':_0x3ccf('0xb'),'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 6f257de..6bf6baf 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3da=['CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceRecording','update','body','options','where','attributes','limit','then','UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink'];(function(_0x4af672,_0x47dcd3){var _0x5ad251=function(_0x27ca60){while(--_0x27ca60){_0x4af672['push'](_0x4af672['shift']());}};_0x5ad251(++_0x47dcd3);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['UpdateVoiceRecording']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')](_0x3f8cf9[_0xae3d('0x1a')],{'raw':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9['options'][_0xae3d('0x1c')]||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null})[_0xae3d('0x1f')](function(_0x3224ff){logger[_0xae3d('0xe')](_0xae3d('0x20'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x20'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x3224ff));_0x558e42(_0x3224ff);})[_0xae3d('0x21')](function(_0x1fe90f){logger[_0xae3d('0x14')](_0xae3d('0x20'),_0x1fe90f[_0xae3d('0x16')],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x1fe90f['message']));});});};exports[_0xae3d('0x22')]=function(_0x185e71){var _0xb5940=this;return new Promise(function(_0x52df0f,_0x256bd0){var _0x4391db=require(_0xae3d('0x23'));var _0x54c1e1;return db['Setting'][_0xae3d('0x24')]({'attributes':['id',_0xae3d('0x25')],'where':{'id':0x1},'raw':!![]})[_0xae3d('0x1f')](function(_0x3114f9){_0x54c1e1=_0x3114f9;return db[_0xae3d('0x18')]['create'](_0x185e71[_0xae3d('0x1a')]);})[_0xae3d('0x1f')](function(_0x5a39c5){if(_0x54c1e1[_0xae3d('0x25')]&&fs[_0xae3d('0x26')](_0x5a39c5[_0xae3d('0x27')])){var _0x46f484=util[_0xae3d('0x28')](_0xae3d('0x29'),_0x5a39c5['value']);return _0x4391db['encryptFile'](_0x5a39c5['value'],_0x46f484,config[_0xae3d('0x2a')][_0xae3d('0x2b')])[_0xae3d('0x1f')](function(){fs[_0xae3d('0x2c')](_0x5a39c5['value']);logger[_0xae3d('0xe')](_0xae3d('0x2d'));return _0x5a39c5;});}return _0x5a39c5;})[_0xae3d('0x1f')](function(_0x3748d2){logger[_0xae3d('0xe')](_0xae3d('0x22'),_0x185e71);logger[_0xae3d('0x11')]('CreateVoiceRecording',_0x185e71,JSON[_0xae3d('0x13')](_0x3748d2));_0x52df0f(_0x3748d2);})['catch'](function(_0x55aae4){logger[_0xae3d('0x14')]('CreateVoiceRecording',_0x55aae4[_0xae3d('0x16')],_0x185e71);_0x256bd0(_0xb5940['error'](0x1f4,_0x55aae4['message']));});});}; \ No newline at end of file +var _0xcf2f=['request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','recording','then','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x214b95,_0x34df0c){var _0x315005=function(_0x44856b){while(--_0x44856b){_0x214b95['push'](_0x214b95['shift']());}};_0x315005(++_0x34df0c);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x5abd30,_0x2d0695){_0x5abd30=_0x5abd30-0x0;var _0x262d4f=_0xcf2f[_0x5abd30];return _0x262d4f;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}exports[_0xfcf2('0x17')]=function(_0x581d78){var _0xd87472=this;return new Promise(function(_0x1b3c89,_0x33eaa7){return db[_0xfcf2('0x18')][_0xfcf2('0x19')](_0x581d78['body'],{'raw':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1b')]||null:null,'attributes':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1c')]||null:null,'limit':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1d')]||null:null})['then'](function(_0x3790ed){logger[_0xfcf2('0x14')](_0xfcf2('0x17'),_0x581d78);logger['debug'](_0xfcf2('0x17'),_0x581d78,JSON[_0xfcf2('0x11')](_0x3790ed));_0x1b3c89(_0x3790ed);})['catch'](function(_0x3c3774){logger[_0xfcf2('0x12')]('UpdateVoiceRecording',_0x3c3774[_0xfcf2('0x13')],_0x581d78);_0x33eaa7(_0xd87472[_0xfcf2('0x12')](0x1f4,_0x3c3774[_0xfcf2('0x13')]));});});};exports[_0xfcf2('0x1e')]=function(_0x5bb384){var _0x1deca3=this;return new Promise(function(_0x448222,_0x2a9d64){var _0x3779ee=require(_0xfcf2('0x1f'));var _0x2b1d60;return db[_0xfcf2('0x20')][_0xfcf2('0x21')]({'attributes':['id',_0xfcf2('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4c2935){_0x2b1d60=_0x4c2935;return db[_0xfcf2('0x18')][_0xfcf2('0x23')](_0x5bb384[_0xfcf2('0x24')]);})['then'](function(_0x560898){if(_0x2b1d60['callRecordingEncryption']&&fs[_0xfcf2('0x25')](_0x560898[_0xfcf2('0x26')])){var _0x40c1ae=util[_0xfcf2('0x27')](_0xfcf2('0x28'),_0x560898[_0xfcf2('0x26')]);return _0x3779ee[_0xfcf2('0x29')](_0x560898['value'],_0x40c1ae,config['secrets'][_0xfcf2('0x2a')])[_0xfcf2('0x2b')](function(){fs[_0xfcf2('0x2c')](_0x560898[_0xfcf2('0x26')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x560898;});}return _0x560898;})[_0xfcf2('0x2b')](function(_0x5310e6){logger[_0xfcf2('0x14')](_0xfcf2('0x1e'),_0x5bb384);logger['debug'](_0xfcf2('0x1e'),_0x5bb384,JSON[_0xfcf2('0x11')](_0x5310e6));_0x448222(_0x5310e6);})[_0xfcf2('0x16')](function(_0x4046c6){logger[_0xfcf2('0x12')](_0xfcf2('0x1e'),_0x4046c6[_0xfcf2('0x13')],_0x5bb384);_0x2a9d64(_0x1deca3['error'](0x1f4,_0x4046c6[_0xfcf2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 190d096..18cddff 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 _0x0451=['index','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x3ba636,_0x7746fc){var _0x2eb338=function(_0x104e12){while(--_0x104e12){_0x3ba636['push'](_0x3ba636['shift']());}};_0x2eb338(++_0x7746fc);}(_0x0451,0x6e));var _0x1045=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0x0451[_0x591a90];return _0x551587;};'use strict';var multer=require(_0x1045('0x0'));var util=require('util');var path=require(_0x1045('0x1'));var timeout=require(_0x1045('0x2'));var express=require(_0x1045('0x3'));var router=express['Router']();var fs_extra=require(_0x1045('0x4'));var auth=require(_0x1045('0x5'));var interaction=require(_0x1045('0x6'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x1045('0x7')]('/',auth[_0x1045('0x8')](),controller[_0x1045('0x9')]);router[_0x1045('0x7')]('/describe',auth[_0x1045('0x8')](),controller['describe']);router[_0x1045('0x7')](_0x1045('0xa'),auth[_0x1045('0x8')](),controller[_0x1045('0xb')]);router[_0x1045('0xc')]('/',auth['isAuthenticated'](),controller[_0x1045('0xd')]);router[_0x1045('0xe')](_0x1045('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1045('0xf')](_0x1045('0xa'),auth[_0x1045('0x8')](),controller['destroy']);module[_0x1045('0x10')]=router; \ No newline at end of file +var _0xa491=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','describe','post','create','put','/:id','update','destroy','exports','multer','util','path','express'];(function(_0x35b522,_0x185725){var _0x5489ee=function(_0x569af6){while(--_0x569af6){_0x35b522['push'](_0x35b522['shift']());}};_0x5489ee(++_0x185725);}(_0xa491,0x152));var _0x1a49=function(_0x4da3e7,_0x56e676){_0x4da3e7=_0x4da3e7-0x0;var _0x181645=_0xa491[_0x4da3e7];return _0x181645;};'use strict';var multer=require(_0x1a49('0x0'));var util=require(_0x1a49('0x1'));var path=require(_0x1a49('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a49('0x3'));var router=express[_0x1a49('0x4')]();var fs_extra=require(_0x1a49('0x5'));var auth=require(_0x1a49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x1a49('0x7')]('/',auth[_0x1a49('0x8')](),controller[_0x1a49('0x9')]);router[_0x1a49('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x1a49('0xa')]);router[_0x1a49('0x7')]('/:id',auth[_0x1a49('0x8')](),controller['show']);router[_0x1a49('0xb')]('/',auth[_0x1a49('0x8')](),controller[_0x1a49('0xc')]);router[_0x1a49('0xd')](_0x1a49('0xe'),auth['isAuthenticated'](),controller[_0x1a49('0xf')]);router['delete'](_0x1a49('0xe'),auth[_0x1a49('0x8')](),controller[_0x1a49('0x10')]);module[_0x1a49('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 192fb67..705bcd9 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 _0x6a4d=['exports','ENUM','attended','STRING','sequelize','moment'];(function(_0x521388,_0x4f2d2b){var _0xf1d577=function(_0x49ec04){while(--_0x49ec04){_0x521388['push'](_0x521388['shift']());}};_0xf1d577(++_0x4f2d2b);}(_0x6a4d,0x82));var _0xd6a4=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x6a4d[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0xd6a4('0x0'));var moment=require(_0xd6a4('0x1'));module[_0xd6a4('0x2')]={'type':{'type':Sequelize[_0xd6a4('0x3')]('blind',_0xd6a4('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xd6a4('0x5')]},'transferercalleridname':{'type':Sequelize[_0xd6a4('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd6a4('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xd6a4('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xd6a4('0x5')]},'transferercontext':{'type':Sequelize[_0xd6a4('0x5')]},'transfererexten':{'type':Sequelize[_0xd6a4('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xd6a4('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xd6a4('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xd6a4('0x5')]},'transfereecontext':{'type':Sequelize[_0xd6a4('0x5')]},'transfereeexten':{'type':Sequelize[_0xd6a4('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xd6a4('0x5')]},'isexternal':{'type':Sequelize[_0xd6a4('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xd6a4('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8b96=['Yes','sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x45f86d,_0x3e2608){var _0x3c6db5=function(_0x4cfdf8){while(--_0x4cfdf8){_0x45f86d['push'](_0x45f86d['shift']());}};_0x3c6db5(++_0x3e2608);}(_0x8b96,0x131));var _0x68b9=function(_0x3961a2,_0xf3a769){_0x3961a2=_0x3961a2-0x0;var _0x1aa3b8=_0x8b96[_0x3961a2];return _0x1aa3b8;};'use strict';var Sequelize=require(_0x68b9('0x0'));var moment=require(_0x68b9('0x1'));module[_0x68b9('0x2')]={'type':{'type':Sequelize[_0x68b9('0x3')](_0x68b9('0x4'),_0x68b9('0x5'))},'result':{'type':Sequelize[_0x68b9('0x6')]},'transfererchannel':{'type':Sequelize[_0x68b9('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x68b9('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x68b9('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x68b9('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x68b9('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x68b9('0x6')]},'transfereechannel':{'type':Sequelize[_0x68b9('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x68b9('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x68b9('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x68b9('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x68b9('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x68b9('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x68b9('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0x68b9('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x68b9('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 401f82d..30f4bab 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 _0x1879=['offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','zip-dir','request-promise','moment','mustache','util','path','to-csv','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/license/util','sendStatus','status','end','json'];(function(_0x4f9eef,_0x5a89d4){var _0x103ed9=function(_0x57946b){while(--_0x57946b){_0x4f9eef['push'](_0x4f9eef['shift']());}};_0x103ed9(++_0x5a89d4);}(_0x1879,0x7b));var _0x9187=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x1879[_0xc14df7];return _0x34a445;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9187('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9187('0x1'));var moment=require(_0x9187('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9187('0x3'));var util=require(_0x9187('0x4'));var path=require(_0x9187('0x5'));var sox=require('sox');var csv=require(_0x9187('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9187('0x7'));var _=require(_0x9187('0x8'));var squel=require(_0x9187('0x9'));var crypto=require(_0x9187('0xa'));var jsforce=require(_0x9187('0xb'));var deskjs=require(_0x9187('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9187('0xd'));var Papa=require(_0x9187('0xe'));var Redis=require(_0x9187('0xf'));var authService=require(_0x9187('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9187('0x11'));var hardwareService=require(_0x9187('0x12'));var logger=require(_0x9187('0x13'))(_0x9187('0x14'));var utils=require(_0x9187('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9187('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ba45d,_0x5a0761){_0x5a0761=_0x5a0761||0xcc;return function(_0x297921){if(_0x297921){return _0x2ba45d[_0x9187('0x17')](_0x5a0761);}return _0x2ba45d[_0x9187('0x18')](_0x5a0761)[_0x9187('0x19')]();};}function respondWithResult(_0x2bf954,_0x331d28){_0x331d28=_0x331d28||0xc8;return function(_0x1624ad){if(_0x1624ad){return _0x2bf954[_0x9187('0x18')](_0x331d28)[_0x9187('0x1a')](_0x1624ad);}};}function respondWithFilteredResult(_0x4edefd,_0x5d3658){return function(_0x5369af){if(_0x5369af){var _0x266232=typeof _0x5d3658[_0x9187('0x1b')]===_0x9187('0x1c')&&typeof _0x5d3658[_0x9187('0x1d')]===_0x9187('0x1c');var _0xf5a8bc=_0x5369af[_0x9187('0x1e')];var _0x19440a=_0x266232?0x0:_0x5d3658[_0x9187('0x1b')];var _0x5ab84d=_0x266232?_0x5369af[_0x9187('0x1e')]:_0x5d3658[_0x9187('0x1b')]+_0x5d3658[_0x9187('0x1d')];var _0x465988;if(_0x5ab84d>=_0xf5a8bc){_0x5ab84d=_0xf5a8bc;_0x465988=0xc8;}else{_0x465988=0xce;}_0x4edefd['status'](_0x465988);return _0x4edefd[_0x9187('0x1f')]('Content-Range',_0x19440a+'-'+_0x5ab84d+'/'+_0xf5a8bc)['json'](_0x5369af);}return null;};}function patchUpdates(_0x5c76f3){return function(_0xedafd1){try{jsonpatch['apply'](_0xedafd1,_0x5c76f3,!![]);}catch(_0x4e2b4e){return BPromise[_0x9187('0x20')](_0x4e2b4e);}return _0xedafd1[_0x9187('0x21')]();};}function saveUpdates(_0x2f28ac,_0x48a557){return function(_0x2c6609){if(_0x2c6609){return _0x2c6609[_0x9187('0x22')](_0x2f28ac)[_0x9187('0x23')](function(_0xecad43){return _0xecad43;});}return null;};}function removeEntity(_0x134332,_0x1fe779){return function(_0x52d723){if(_0x52d723){return _0x52d723[_0x9187('0x24')]()['then'](function(){_0x134332['status'](0xcc)[_0x9187('0x19')]();});}};}function handleEntityNotFound(_0x27e9cb,_0x380702){return function(_0x2ab0d3){if(!_0x2ab0d3){_0x27e9cb[_0x9187('0x17')](0x194);}return _0x2ab0d3;};}function handleError(_0x4bc439,_0x98740){_0x98740=_0x98740||0x1f4;return function(_0x1473f5){logger['error'](_0x1473f5[_0x9187('0x25')]);if(_0x1473f5[_0x9187('0x26')]){delete _0x1473f5['name'];}_0x4bc439[_0x9187('0x18')](_0x98740)[_0x9187('0x27')](_0x1473f5);};}exports[_0x9187('0x28')]=function(_0x1564c6,_0xc980eb){var _0x33e21e={},_0x2ea14d={},_0x1ec00b={'count':0x0,'rows':[]};var _0x823d6e=_[_0x9187('0x29')](db[_0x9187('0x2a')][_0x9187('0x2b')],function(_0x17e9ab){return{'name':_0x17e9ab['fieldName'],'type':_0x17e9ab[_0x9187('0x2c')][_0x9187('0x2d')]};});_0x2ea14d[_0x9187('0x2e')]=_[_0x9187('0x29')](_0x823d6e,_0x9187('0x26'));_0x2ea14d[_0x9187('0x2f')]=_[_0x9187('0x30')](_0x1564c6[_0x9187('0x2f')]);_0x2ea14d['filters']=_[_0x9187('0x31')](_0x2ea14d[_0x9187('0x2e')],_0x2ea14d[_0x9187('0x2f')]);_0x33e21e[_0x9187('0x32')]=_[_0x9187('0x31')](_0x2ea14d[_0x9187('0x2e')],qs[_0x9187('0x33')](_0x1564c6['query'][_0x9187('0x33')]));_0x33e21e[_0x9187('0x32')]=_0x33e21e[_0x9187('0x32')][_0x9187('0x34')]?_0x33e21e[_0x9187('0x32')]:_0x2ea14d[_0x9187('0x2e')];if(!_0x1564c6[_0x9187('0x2f')][_0x9187('0x35')](_0x9187('0x36'))){_0x33e21e[_0x9187('0x1d')]=qs['limit'](_0x1564c6[_0x9187('0x2f')][_0x9187('0x1d')]);_0x33e21e[_0x9187('0x1b')]=qs['offset'](_0x1564c6[_0x9187('0x2f')][_0x9187('0x1b')]);}_0x33e21e[_0x9187('0x37')]=qs[_0x9187('0x38')](_0x1564c6[_0x9187('0x2f')][_0x9187('0x38')]);_0x33e21e[_0x9187('0x39')]=qs[_0x9187('0x3a')](_[_0x9187('0x3b')](_0x1564c6[_0x9187('0x2f')],_0x2ea14d[_0x9187('0x3a')]),_0x823d6e);if(_0x1564c6[_0x9187('0x2f')]['filter']){_0x33e21e['where']=_[_0x9187('0x3c')](_0x33e21e[_0x9187('0x39')],{'$or':_[_0x9187('0x29')](_0x823d6e,function(_0x595acd){if(_0x595acd[_0x9187('0x2c')]!==_0x9187('0x3d')){var _0x216dfb={};_0x216dfb[_0x595acd['name']]={'$like':'%'+_0x1564c6['query'][_0x9187('0x3e')]+'%'};return _0x216dfb;}})});}_0x33e21e=_[_0x9187('0x3c')]({},_0x33e21e,_0x1564c6[_0x9187('0x3f')]);var _0xa17754={'where':_0x33e21e[_0x9187('0x39')]};return db[_0x9187('0x2a')]['count'](_0xa17754)[_0x9187('0x23')](function(_0x10065b){_0x1ec00b[_0x9187('0x1e')]=_0x10065b;if(_0x1564c6['query']['includeAll']){_0x33e21e[_0x9187('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x9187('0x41')](_0x33e21e);})[_0x9187('0x23')](function(_0x398e3f){_0x1ec00b[_0x9187('0x42')]=_0x398e3f;return _0x1ec00b;})[_0x9187('0x23')](respondWithFilteredResult(_0xc980eb,_0x33e21e))[_0x9187('0x43')](handleError(_0xc980eb,null));};exports[_0x9187('0x44')]=function(_0x189d25,_0x49f5d4){var _0x2a0d55={'raw':!![],'where':{'id':_0x189d25[_0x9187('0x45')]['id']}},_0x36fbe0={};_0x36fbe0[_0x9187('0x2e')]=_[_0x9187('0x30')](db['VoiceTransferReport'][_0x9187('0x2b')]);_0x36fbe0[_0x9187('0x2f')]=_['keys'](_0x189d25[_0x9187('0x2f')]);_0x36fbe0[_0x9187('0x3a')]=_[_0x9187('0x31')](_0x36fbe0[_0x9187('0x2e')],_0x36fbe0[_0x9187('0x2f')]);_0x2a0d55[_0x9187('0x32')]=_['intersection'](_0x36fbe0[_0x9187('0x2e')],qs[_0x9187('0x33')](_0x189d25[_0x9187('0x2f')][_0x9187('0x33')]));_0x2a0d55[_0x9187('0x32')]=_0x2a0d55['attributes'][_0x9187('0x34')]?_0x2a0d55['attributes']:_0x36fbe0[_0x9187('0x2e')];if(_0x189d25[_0x9187('0x2f')][_0x9187('0x46')]){_0x2a0d55['include']=[{'all':!![]}];}_0x2a0d55=_[_0x9187('0x3c')]({},_0x2a0d55,_0x189d25['options']);return db[_0x9187('0x2a')][_0x9187('0x47')](_0x2a0d55)[_0x9187('0x23')](handleEntityNotFound(_0x49f5d4,null))[_0x9187('0x23')](respondWithResult(_0x49f5d4,null))[_0x9187('0x43')](handleError(_0x49f5d4,null));};exports['create']=function(_0x2b392c,_0x111e9a){return db['VoiceTransferReport'][_0x9187('0x48')](_0x2b392c[_0x9187('0x49')],{})[_0x9187('0x23')](respondWithResult(_0x111e9a,0xc9))['catch'](handleError(_0x111e9a,null));};exports[_0x9187('0x22')]=function(_0x4a521f,_0x349742){if(_0x4a521f[_0x9187('0x49')]['id']){delete _0x4a521f[_0x9187('0x49')]['id'];}return db[_0x9187('0x2a')]['find']({'where':{'id':_0x4a521f[_0x9187('0x45')]['id']}})[_0x9187('0x23')](handleEntityNotFound(_0x349742,null))[_0x9187('0x23')](saveUpdates(_0x4a521f[_0x9187('0x49')],null))[_0x9187('0x23')](respondWithResult(_0x349742,null))['catch'](handleError(_0x349742,null));};exports[_0x9187('0x24')]=function(_0x30776a,_0x2e34a8){return db[_0x9187('0x2a')][_0x9187('0x47')]({'where':{'id':_0x30776a[_0x9187('0x45')]['id']}})[_0x9187('0x23')](handleEntityNotFound(_0x2e34a8,null))['then'](removeEntity(_0x2e34a8,null))['catch'](handleError(_0x2e34a8,null));};exports[_0x9187('0x4a')]=function(_0x2505a8,_0x5b9a6c){return db[_0x9187('0x2a')]['describe']()['then'](respondWithResult(_0x5b9a6c,null))[_0x9187('0x43')](handleError(_0x5b9a6c,null));}; \ No newline at end of file +var _0x6506=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','send','index','VoiceTransferReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','describe'];(function(_0x2a0431,_0xd1837d){var _0x553840=function(_0x3d563a){while(--_0x3d563a){_0x2a0431['push'](_0x2a0431['shift']());}};_0x553840(++_0xd1837d);}(_0x6506,0x177));var _0x6650=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6506[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x6650('0x0'));var rimraf=require(_0x6650('0x1'));var zipdir=require(_0x6650('0x2'));var jsonpatch=require(_0x6650('0x3'));var rp=require(_0x6650('0x4'));var moment=require(_0x6650('0x5'));var BPromise=require(_0x6650('0x6'));var Mustache=require(_0x6650('0x7'));var util=require(_0x6650('0x8'));var path=require(_0x6650('0x9'));var sox=require(_0x6650('0xa'));var csv=require(_0x6650('0xb'));var ejs=require(_0x6650('0xc'));var fs=require('fs');var fs_extra=require(_0x6650('0xd'));var _=require(_0x6650('0xe'));var squel=require(_0x6650('0xf'));var crypto=require('crypto');var jsforce=require(_0x6650('0x10'));var deskjs=require(_0x6650('0x11'));var toCsv=require(_0x6650('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6650('0x12'));var authService=require(_0x6650('0x13'));var qs=require(_0x6650('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6650('0x15'));var logger=require('../../config/logger')(_0x6650('0x16'));var utils=require(_0x6650('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6650('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cc915,_0x5e3779){_0x5e3779=_0x5e3779||0xcc;return function(_0x1d360b){if(_0x1d360b){return _0x2cc915[_0x6650('0x19')](_0x5e3779);}return _0x2cc915[_0x6650('0x1a')](_0x5e3779)['end']();};}function respondWithResult(_0x5481c7,_0x6ece62){_0x6ece62=_0x6ece62||0xc8;return function(_0x5cdf93){if(_0x5cdf93){return _0x5481c7['status'](_0x6ece62)['json'](_0x5cdf93);}};}function respondWithFilteredResult(_0x403c2c,_0x5ea6d2){return function(_0x327c6c){if(_0x327c6c){var _0x4605fa=typeof _0x5ea6d2[_0x6650('0x1b')]===_0x6650('0x1c')&&typeof _0x5ea6d2[_0x6650('0x1d')]===_0x6650('0x1c');var _0x2b04a2=_0x327c6c[_0x6650('0x1e')];var _0x3daf0e=_0x4605fa?0x0:_0x5ea6d2[_0x6650('0x1b')];var _0x2fb3b0=_0x4605fa?_0x327c6c['count']:_0x5ea6d2['offset']+_0x5ea6d2[_0x6650('0x1d')];var _0x149fc6;if(_0x2fb3b0>=_0x2b04a2){_0x2fb3b0=_0x2b04a2;_0x149fc6=0xc8;}else{_0x149fc6=0xce;}_0x403c2c[_0x6650('0x1a')](_0x149fc6);return _0x403c2c[_0x6650('0x1f')](_0x6650('0x20'),_0x3daf0e+'-'+_0x2fb3b0+'/'+_0x2b04a2)['json'](_0x327c6c);}return null;};}function patchUpdates(_0x4c5098){return function(_0x43088f){try{jsonpatch['apply'](_0x43088f,_0x4c5098,!![]);}catch(_0x28f2fd){return BPromise[_0x6650('0x21')](_0x28f2fd);}return _0x43088f['save']();};}function saveUpdates(_0x45ee57,_0x4e5eef){return function(_0x1b94a4){if(_0x1b94a4){return _0x1b94a4[_0x6650('0x22')](_0x45ee57)['then'](function(_0x122c6c){return _0x122c6c;});}return null;};}function removeEntity(_0xf20ecb,_0x1a4324){return function(_0xeacfe5){if(_0xeacfe5){return _0xeacfe5['destroy']()['then'](function(){_0xf20ecb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54711b,_0x7bb237){return function(_0x44c4ef){if(!_0x44c4ef){_0x54711b[_0x6650('0x19')](0x194);}return _0x44c4ef;};}function handleError(_0x5ad35c,_0x5a1af8){_0x5a1af8=_0x5a1af8||0x1f4;return function(_0x50a8c9){logger[_0x6650('0x23')](_0x50a8c9[_0x6650('0x24')]);if(_0x50a8c9['name']){delete _0x50a8c9[_0x6650('0x25')];}_0x5ad35c[_0x6650('0x1a')](_0x5a1af8)[_0x6650('0x26')](_0x50a8c9);};}exports[_0x6650('0x27')]=function(_0x3cb676,_0x8a8471){var _0x23c695={},_0x3d82ce={},_0x753e3b={'count':0x0,'rows':[]};var _0x4c75e8=_['map'](db[_0x6650('0x28')]['rawAttributes'],function(_0x367874){return{'name':_0x367874[_0x6650('0x29')],'type':_0x367874[_0x6650('0x2a')]['key']};});_0x3d82ce[_0x6650('0x2b')]=_[_0x6650('0x2c')](_0x4c75e8,_0x6650('0x25'));_0x3d82ce[_0x6650('0x2d')]=_[_0x6650('0x2e')](_0x3cb676[_0x6650('0x2d')]);_0x3d82ce[_0x6650('0x2f')]=_[_0x6650('0x30')](_0x3d82ce['model'],_0x3d82ce[_0x6650('0x2d')]);_0x23c695[_0x6650('0x31')]=_[_0x6650('0x30')](_0x3d82ce['model'],qs[_0x6650('0x32')](_0x3cb676['query'][_0x6650('0x32')]));_0x23c695[_0x6650('0x31')]=_0x23c695[_0x6650('0x31')][_0x6650('0x33')]?_0x23c695[_0x6650('0x31')]:_0x3d82ce['model'];if(!_0x3cb676['query'][_0x6650('0x34')](_0x6650('0x35'))){_0x23c695['limit']=qs[_0x6650('0x1d')](_0x3cb676['query'][_0x6650('0x1d')]);_0x23c695[_0x6650('0x1b')]=qs[_0x6650('0x1b')](_0x3cb676[_0x6650('0x2d')]['offset']);}_0x23c695[_0x6650('0x36')]=qs['sort'](_0x3cb676['query'][_0x6650('0x37')]);_0x23c695['where']=qs[_0x6650('0x2f')](_[_0x6650('0x38')](_0x3cb676[_0x6650('0x2d')],_0x3d82ce['filters']),_0x4c75e8);if(_0x3cb676[_0x6650('0x2d')][_0x6650('0x39')]){_0x23c695['where']=_[_0x6650('0x3a')](_0x23c695[_0x6650('0x3b')],{'$or':_[_0x6650('0x2c')](_0x4c75e8,function(_0x49d06c){if(_0x49d06c[_0x6650('0x2a')]!==_0x6650('0x3c')){var _0x65abc5={};_0x65abc5[_0x49d06c[_0x6650('0x25')]]={'$like':'%'+_0x3cb676[_0x6650('0x2d')]['filter']+'%'};return _0x65abc5;}})});}_0x23c695=_[_0x6650('0x3a')]({},_0x23c695,_0x3cb676[_0x6650('0x3d')]);var _0x37f77d={'where':_0x23c695[_0x6650('0x3b')]};return db[_0x6650('0x28')][_0x6650('0x1e')](_0x37f77d)[_0x6650('0x3e')](function(_0x3c0acd){_0x753e3b[_0x6650('0x1e')]=_0x3c0acd;if(_0x3cb676[_0x6650('0x2d')][_0x6650('0x3f')]){_0x23c695[_0x6650('0x40')]=[{'all':!![]}];}return db[_0x6650('0x28')][_0x6650('0x41')](_0x23c695);})[_0x6650('0x3e')](function(_0x49df9d){_0x753e3b[_0x6650('0x42')]=_0x49df9d;return _0x753e3b;})['then'](respondWithFilteredResult(_0x8a8471,_0x23c695))[_0x6650('0x43')](handleError(_0x8a8471,null));};exports['show']=function(_0x4dfc23,_0x35e357){var _0x3cd6dc={'raw':!![],'where':{'id':_0x4dfc23[_0x6650('0x44')]['id']}},_0x2bfd8f={};_0x2bfd8f[_0x6650('0x2b')]=_['keys'](db[_0x6650('0x28')][_0x6650('0x45')]);_0x2bfd8f[_0x6650('0x2d')]=_[_0x6650('0x2e')](_0x4dfc23[_0x6650('0x2d')]);_0x2bfd8f[_0x6650('0x2f')]=_['intersection'](_0x2bfd8f['model'],_0x2bfd8f[_0x6650('0x2d')]);_0x3cd6dc[_0x6650('0x31')]=_[_0x6650('0x30')](_0x2bfd8f[_0x6650('0x2b')],qs[_0x6650('0x32')](_0x4dfc23[_0x6650('0x2d')][_0x6650('0x32')]));_0x3cd6dc[_0x6650('0x31')]=_0x3cd6dc[_0x6650('0x31')]['length']?_0x3cd6dc[_0x6650('0x31')]:_0x2bfd8f[_0x6650('0x2b')];if(_0x4dfc23[_0x6650('0x2d')]['includeAll']){_0x3cd6dc[_0x6650('0x40')]=[{'all':!![]}];}_0x3cd6dc=_[_0x6650('0x3a')]({},_0x3cd6dc,_0x4dfc23['options']);return db[_0x6650('0x28')][_0x6650('0x46')](_0x3cd6dc)[_0x6650('0x3e')](handleEntityNotFound(_0x35e357,null))['then'](respondWithResult(_0x35e357,null))[_0x6650('0x43')](handleError(_0x35e357,null));};exports[_0x6650('0x47')]=function(_0x20b994,_0x1d6d2f){return db[_0x6650('0x28')]['create'](_0x20b994[_0x6650('0x48')],{})[_0x6650('0x3e')](respondWithResult(_0x1d6d2f,0xc9))[_0x6650('0x43')](handleError(_0x1d6d2f,null));};exports[_0x6650('0x22')]=function(_0x47d6c8,_0x3d542e){if(_0x47d6c8[_0x6650('0x48')]['id']){delete _0x47d6c8['body']['id'];}return db[_0x6650('0x28')][_0x6650('0x46')]({'where':{'id':_0x47d6c8[_0x6650('0x44')]['id']}})[_0x6650('0x3e')](handleEntityNotFound(_0x3d542e,null))[_0x6650('0x3e')](saveUpdates(_0x47d6c8['body'],null))[_0x6650('0x3e')](respondWithResult(_0x3d542e,null))[_0x6650('0x43')](handleError(_0x3d542e,null));};exports[_0x6650('0x49')]=function(_0x5be68e,_0x302b1a){return db['VoiceTransferReport'][_0x6650('0x46')]({'where':{'id':_0x5be68e[_0x6650('0x44')]['id']}})['then'](handleEntityNotFound(_0x302b1a,null))['then'](removeEntity(_0x302b1a,null))[_0x6650('0x43')](handleError(_0x302b1a,null));};exports[_0x6650('0x4a')]=function(_0x1096cd,_0xee27e){return db[_0x6650('0x28')][_0x6650('0x4a')]()[_0x6650('0x3e')](respondWithResult(_0xee27e,null))[_0x6650('0x43')](handleError(_0xee27e,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 637597f..2426a27 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 _0x7ccd=['report_call_transfer','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport'];(function(_0x532ac3,_0x55e608){var _0x37bd3e=function(_0x59f198){while(--_0x59f198){_0x532ac3['push'](_0x532ac3['shift']());}};_0x37bd3e(++_0x55e608);}(_0x7ccd,0x1c4));var _0xd7cc=function(_0x3936c5,_0x5e18ca){_0x3936c5=_0x3936c5-0x0;var _0x6ea1c3=_0x7ccd[_0x3936c5];return _0x6ea1c3;};'use strict';var _=require(_0xd7cc('0x0'));var util=require(_0xd7cc('0x1'));var logger=require(_0xd7cc('0x2'))('api');var moment=require(_0xd7cc('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7cc('0x5'));var config=require(_0xd7cc('0x6'));var attributes=require(_0xd7cc('0x7'));module['exports']=function(_0xd5dc4b,_0x83fd3d){return _0xd5dc4b[_0xd7cc('0x8')](_0xd7cc('0x9'),attributes,{'tableName':_0xd7cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8004=['request-promise','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x49f350,_0x48881c){var _0x4fd16d=function(_0x2fa9ca){while(--_0x2fa9ca){_0x49f350['push'](_0x49f350['shift']());}};_0x4fd16d(++_0x48881c);}(_0x8004,0x17b));var _0x4800=function(_0x31005a,_0x32c1b0){_0x31005a=_0x31005a-0x0;var _0x5d24f2=_0x8004[_0x31005a];return _0x5d24f2;};'use strict';var _=require(_0x4800('0x0'));var util=require(_0x4800('0x1'));var logger=require(_0x4800('0x2'))(_0x4800('0x3'));var moment=require('moment');var BPromise=require(_0x4800('0x4'));var rp=require(_0x4800('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4800('0x6'));var config=require(_0x4800('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x4800('0x8')]=function(_0x192c75,_0x3f3612){return _0x192c75[_0x4800('0x9')](_0x4800('0xa'),attributes,{'tableName':_0x4800('0xb'),'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 b6f833f..778a819 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 _0x72e2=['request\x20sent','stringify','error','code','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x2ad2fe,_0x5dc68b){var _0x1f2d3d=function(_0x54387e){while(--_0x54387e){_0x2ad2fe['push'](_0x2ad2fe['shift']());}};_0x1f2d3d(++_0x5dc68b);}(_0x72e2,0x186));var _0x272e=function(_0x17e5fa,_0x3b0830){_0x17e5fa=_0x17e5fa-0x0;var _0x196c97=_0x72e2[_0x17e5fa];return _0x196c97;};'use strict';var _=require('lodash');var util=require(_0x272e('0x0'));var moment=require(_0x272e('0x1'));var BPromise=require('bluebird');var rs=require(_0x272e('0x2'));var fs=require('fs');var Redis=require(_0x272e('0x3'));var db=require(_0x272e('0x4'))['db'];var utils=require(_0x272e('0x5'));var logger=require(_0x272e('0x6'))(_0x272e('0x7'));var config=require(_0x272e('0x8'));var jayson=require(_0x272e('0x9'));var client=jayson[_0x272e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2883e1,_0x7d772e,_0x3411a3){return new BPromise(function(_0x27f7b2,_0x58edf3){return client[_0x272e('0xb')](_0x2883e1,_0x3411a3)[_0x272e('0xc')](function(_0x2898ca){logger[_0x272e('0xd')](_0x272e('0xe'),_0x7d772e,_0x272e('0xf'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x7d772e,_0x272e('0xf'),JSON[_0x272e('0x10')](_0x2898ca));if(_0x2898ca['error']){if(_0x2898ca[_0x272e('0x11')][_0x272e('0x12')]===0x1f4){logger[_0x272e('0x11')](_0x272e('0xe'),_0x7d772e,_0x2898ca[_0x272e('0x11')][_0x272e('0x13')]);return _0x58edf3(_0x2898ca['error'][_0x272e('0x13')]);}logger[_0x272e('0x11')](_0x272e('0xe'),_0x7d772e,_0x2898ca['error'][_0x272e('0x13')]);return _0x27f7b2(_0x2898ca[_0x272e('0x11')][_0x272e('0x13')]);}else{logger['info'](_0x272e('0xe'),_0x7d772e,_0x272e('0xf'));_0x27f7b2(_0x2898ca[_0x272e('0x14')][_0x272e('0x13')]);}})[_0x272e('0x15')](function(_0x25e9f5){logger[_0x272e('0x11')](_0x272e('0xe'),_0x7d772e,_0x25e9f5);_0x58edf3(_0x25e9f5);});});}exports[_0x272e('0x16')]=function(_0x22e70d){var _0x5936aa=this;return new Promise(function(_0x21ff50,_0x5e73f7){return db['VoiceTransferReport'][_0x272e('0x17')](_0x22e70d[_0x272e('0x18')],{'raw':_0x22e70d[_0x272e('0x19')]?_0x22e70d[_0x272e('0x19')][_0x272e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x117c51){logger[_0x272e('0xd')]('CreateVoiceTransferReport',_0x22e70d);logger['debug'](_0x272e('0x16'),_0x22e70d,JSON['stringify'](_0x117c51));_0x21ff50(_0x117c51);})['catch'](function(_0x41b32a){logger[_0x272e('0x11')](_0x272e('0x16'),_0x41b32a[_0x272e('0x13')],_0x22e70d);_0x5e73f7(_0x5936aa[_0x272e('0x11')](0x1f4,_0x41b32a['message']));});});}; \ No newline at end of file +var _0xd70e=['VoiceTransferReport','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateVoiceTransferReport'];(function(_0x19feb2,_0x5eaebf){var _0x26f044=function(_0x39b940){while(--_0x39b940){_0x19feb2['push'](_0x19feb2['shift']());}};_0x26f044(++_0x5eaebf);}(_0xd70e,0x71));var _0xed70=function(_0x46654d,_0x48226a){_0x46654d=_0x46654d-0x0;var _0x3eeaa2=_0xd70e[_0x46654d];return _0x3eeaa2;};'use strict';var _=require('lodash');var util=require(_0xed70('0x0'));var moment=require(_0xed70('0x1'));var BPromise=require(_0xed70('0x2'));var rs=require(_0xed70('0x3'));var fs=require('fs');var Redis=require(_0xed70('0x4'));var db=require(_0xed70('0x5'))['db'];var utils=require(_0xed70('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xed70('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc2b00f,_0xe028f1,_0xf699d2){return new BPromise(function(_0x375824,_0x542f48){return client[_0xed70('0x9')](_0xc2b00f,_0xf699d2)[_0xed70('0xa')](function(_0x3308b8){logger[_0xed70('0xb')](_0xed70('0xc'),_0xe028f1,_0xed70('0xd'));logger[_0xed70('0xe')](_0xed70('0xf'),_0xe028f1,_0xed70('0xd'),JSON[_0xed70('0x10')](_0x3308b8));if(_0x3308b8['error']){if(_0x3308b8['error'][_0xed70('0x11')]===0x1f4){logger[_0xed70('0x12')](_0xed70('0xc'),_0xe028f1,_0x3308b8[_0xed70('0x12')][_0xed70('0x13')]);return _0x542f48(_0x3308b8['error'][_0xed70('0x13')]);}logger[_0xed70('0x12')](_0xed70('0xc'),_0xe028f1,_0x3308b8['error']['message']);return _0x375824(_0x3308b8[_0xed70('0x12')][_0xed70('0x13')]);}else{logger[_0xed70('0xb')](_0xed70('0xc'),_0xe028f1,'request\x20sent');_0x375824(_0x3308b8[_0xed70('0x14')][_0xed70('0x13')]);}})['catch'](function(_0x37e55f){logger['error'](_0xed70('0xc'),_0xe028f1,_0x37e55f);_0x542f48(_0x37e55f);});});}exports[_0xed70('0x15')]=function(_0x20fcad){var _0x18873e=this;return new Promise(function(_0x1ed713,_0x3fea33){return db[_0xed70('0x16')]['create'](_0x20fcad[_0xed70('0x17')],{'raw':_0x20fcad[_0xed70('0x18')]?_0x20fcad[_0xed70('0x18')][_0xed70('0x19')]===undefined?!![]:![]:!![]})[_0xed70('0xa')](function(_0x4ffd3d){logger['info'](_0xed70('0x15'),_0x20fcad);logger[_0xed70('0xe')](_0xed70('0x15'),_0x20fcad,JSON[_0xed70('0x10')](_0x4ffd3d));_0x1ed713(_0x4ffd3d);})[_0xed70('0x1a')](function(_0x2100cc){logger['error'](_0xed70('0x15'),_0x2100cc[_0xed70('0x13')],_0x20fcad);_0x3fea33(_0x18873e[_0xed70('0x12')](0x1f4,_0x2100cc['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c8437e1..50f8a1f 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','unhold','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post'];(function(_0x108438,_0x5c6fa4){var _0x52fab7=function(_0x49e87d){while(--_0x49e87d){_0x108438['push'](_0x108438['shift']());}};_0x52fab7(++_0x5c6fa4);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x237448,_0x1a5f67){_0x237448=_0x237448-0x0;var _0x5c78d6=_0x6f0d[_0x237448];return _0x5c78d6;};'use strict';var express=require('express');var router=express[_0xd6f0('0x0')]();var auth=require(_0xd6f0('0x1'));var controller=require(_0xd6f0('0x2'));router[_0xd6f0('0x3')]('/originate',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0x6')]);router[_0xd6f0('0x3')](_0xd6f0('0x7'),auth['isAuthenticated'](),auth[_0xd6f0('0x5')](),controller['hangup']);router[_0xd6f0('0x3')](_0xd6f0('0x8'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller['answer']);router['post'](_0xd6f0('0x9'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xa')]);router[_0xd6f0('0x3')]('/unhold',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xb')]);router[_0xd6f0('0x3')]('/calls',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0x3')](_0xd6f0('0xd'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xe')]);module[_0xd6f0('0xf')]=router; \ No newline at end of file +var _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0x25a836,_0x56557e){var _0x275368=function(_0xcc6bb2){while(--_0xcc6bb2){_0x25a836['push'](_0x25a836['shift']());}};_0x275368(++_0x56557e);}(_0x54ef,0x112));var _0xf54e=function(_0x3cb92e,_0x49a9cd){_0x3cb92e=_0x3cb92e-0x0;var _0x2ce93f=_0x54ef[_0x3cb92e];return _0x2ce93f;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 1bbdaff..6091dcd 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 _0xb205=['transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','client','../../config/logger','webbarapi','redis','defaults','socket.io-emitter','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','code','message','result','User','findOne','agent','then','VoiceChannels','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','catch','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','all','filter','conference\x20fired:','conference\x20executed!'];(function(_0x1473a9,_0x33d7f7){var _0x2a1fc3=function(_0x2fa6cd){while(--_0x2fa6cd){_0x1473a9['push'](_0x1473a9['shift']());}};_0x2a1fc3(++_0x33d7f7);}(_0xb205,0xf0));var _0x5b20=function(_0x17f680,_0x56e5bb){_0x17f680=_0x17f680-0x0;var _0x5321c3=_0xb205[_0x17f680];return _0x5321c3;};'use strict';var path=require(_0x5b20('0x0'));var fs=require('fs');var _=require(_0x5b20('0x1'));var db=require(_0x5b20('0x2'))['db'];var config=require(_0x5b20('0x3'));var util=require(_0x5b20('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x5b20('0x5')]['http']({'port':0x232a});var logger=require(_0x5b20('0x6'))(_0x5b20('0x7'));var Redis=require('ioredis');config[_0x5b20('0x8')]=_[_0x5b20('0x9')](config[_0x5b20('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x5b20('0xa'))(new Redis(config[_0x5b20('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5b20('0xb')]},'callNumber':{'type':_0x5b20('0xc'),'required':[!![],_0x5b20('0xd')]},'callerId':{'type':_0x5b20('0xc')},'callbackUrl':{'type':_0x5b20('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],_0x5b20('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],_0x5b20('0xb')]},'sessionId':{'type':_0x5b20('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5b20('0xc'),'required':[!![],_0x5b20('0xf')]},'transferNumber':{'type':_0x5b20('0xc'),'required':[!![],_0x5b20('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5b20('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],_0x5b20('0xb')]},'sessionId':{'type':_0x5b20('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x5ac9db,_0x31b9dd,_0x52042b){logger[_0x5b20('0x11')](_0x5ac9db,_0x31b9dd,JSON[_0x5b20('0x12')](_0x52042b));io['to'](_0x5ac9db)[_0x5b20('0x13')](_0x31b9dd,_0x52042b);}function handleError(_0x498986){return function(_0x44ac15){console[_0x5b20('0x14')](_0x5b20('0x15'),_0x44ac15,_0x44ac15 instanceof RangeError);logger[_0x5b20('0x16')](_0x44ac15['stack']);if(_0x44ac15 instanceof RangeError){if(_0x44ac15[_0x5b20('0x17')]){delete _0x44ac15['name'];}_0x498986[_0x5b20('0x18')](0x194)[_0x5b20('0x19')](_0x44ac15);}else{if(_0x44ac15['name']){delete _0x44ac15[_0x5b20('0x17')];}_0x498986[_0x5b20('0x18')](0x1f4)[_0x5b20('0x19')](_0x44ac15);}};}function checkError(){return function(_0x4e9ae9){if(!_0x4e9ae9){throw new RangeError(_0x5b20('0x1a'));}return _0x4e9ae9;};}function respondWithRpcPromise(_0x28fe6e,_0x59f614){return new BPromise(function(_0x2d404f,_0x52e27f){var _0x4f291e=amiClient;return _0x4f291e[_0x5b20('0x1b')](_0x28fe6e,_0x59f614)['then'](function(_0x4b4076){if(_0x4b4076[_0x5b20('0x16')]){if(_0x4b4076[_0x5b20('0x16')][_0x5b20('0x1c')]===0x1f4){return _0x52e27f(_0x4b4076[_0x5b20('0x16')][_0x5b20('0x1d')]);}return _0x2d404f(_0x4b4076[_0x5b20('0x16')][_0x5b20('0x1d')]);}else{_0x2d404f(_0x4b4076[_0x5b20('0x1e')]);}})['catch'](function(_0x285249){_0x52e27f(_0x285249);});});}function getAgent(_0x102b05){return db[_0x5b20('0x1f')][_0x5b20('0x20')]({'where':{'id':_0x102b05,'role':_0x5b20('0x21')}})[_0x5b20('0x22')](checkError());}function getAgentCheckSession(_0x50d335,_0x16ff2d){return new BPromise(function(_0x49a15d,_0x444195){var _0x1b8965=respondWithRpcPromise(_0x5b20('0x23'));var _0x516f16=getAgent(_0x50d335);Promise['all']([_0x1b8965,_0x516f16])[_0x5b20('0x22')](function(_0x27aefb){var _0x508618=_0x27aefb[0x0];var _0x551224=_0x27aefb[0x1];var _0x38351c=_['filter'](_0x508618[_0x5b20('0x24')],function(_0x13d302){return _0x13d302[_0x5b20('0x25')]==_0x551224['id']&&_0x13d302[_0x5b20('0x26')]==_0x16ff2d;});if(_0x38351c['length']==0x1){_0x49a15d(_0x551224);}else{_0x444195(new RangeError(_0x5b20('0x27')+_0x16ff2d+_0x5b20('0x28')));}});});}exports[_0x5b20('0x29')]=function(_0xf480fd,_0x5ce609){logger[_0x5b20('0x11')](_0x5b20('0x2a'),_0xf480fd[_0x5b20('0x2b')]);var _0xb22b1c=originateValidation[_0x5b20('0x2c')](_0xf480fd[_0x5b20('0x2b')]);if(_0xb22b1c[_0x5b20('0x2d')]>0x0){return _0x5ce609[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0xb22b1c);}var _0x283e00=_0xf480fd[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x199830=_0xf480fd[_0x5b20('0x2b')][_0x5b20('0x30')];var _0x553a20=_0xf480fd['body']['callerId'];var _0x310d26=_0xf480fd[_0x5b20('0x2b')][_0x5b20('0x31')];return getAgent(_0x283e00)[_0x5b20('0x22')](function(_0x5d3e95){logger['info'](_0x5b20('0x32'),_0x5d3e95[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x5d3e95[_0x5b20('0x17')]),_0x5b20('0x35'),{'callNumber':_0x199830,'callerId':_0x553a20,'callbackUrl':_0x310d26});return _0x5ce609[_0x5b20('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5ce609));};exports[_0x5b20('0x36')]=function(_0x3ecb37,_0x29c731){logger[_0x5b20('0x11')](_0x5b20('0x37'),_0x3ecb37[_0x5b20('0x2b')]);var _0x492fbb=hangupValidation['validate'](_0x3ecb37[_0x5b20('0x2b')]);if(_0x492fbb[_0x5b20('0x2d')]>0x0){return _0x29c731['status'](0x190)[_0x5b20('0x2e')](_0x492fbb);}var _0xf5babd=_0x3ecb37[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x368990=_0x3ecb37[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0xf5babd)[_0x5b20('0x22')](function(_0xce0cec){logger[_0x5b20('0x11')](_0x5b20('0x32'),_0xce0cec[_0x5b20('0x17')]);emit(util['format'](_0x5b20('0x34'),_0xce0cec[_0x5b20('0x17')]),_0x5b20('0x38'),{'sessionId':_0x368990});return _0x29c731[_0x5b20('0x18')](0xc8)[_0x5b20('0x2e')]({'error':![],'message':_0x5b20('0x39')});})[_0x5b20('0x3a')](handleError(_0x29c731));};exports[_0x5b20('0x3b')]=function(_0x3ce01d,_0x3e6029){logger[_0x5b20('0x11')](_0x5b20('0x3c'),_0x3ce01d[_0x5b20('0x2b')]);var _0x2ea494=answerValidation[_0x5b20('0x2c')](_0x3ce01d[_0x5b20('0x2b')]);if(_0x2ea494[_0x5b20('0x2d')]>0x0){return _0x3e6029[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x2ea494);}var _0x106c62=_0x3ce01d[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x13326e=_0x3ce01d[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0x106c62)[_0x5b20('0x22')](function(_0x1c2134){logger['info'](_0x5b20('0x32'),_0x1c2134[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x1c2134[_0x5b20('0x17')]),_0x5b20('0x3d'),{'sessionId':_0x13326e});return _0x3e6029[_0x5b20('0x18')](0xc8)['json']({'error':![],'message':_0x5b20('0x3e')});})[_0x5b20('0x3a')](handleError(_0x3e6029));};exports[_0x5b20('0x3f')]=function(_0x110774,_0x1197f4){logger[_0x5b20('0x11')](_0x5b20('0x40'),_0x110774['body']);var _0x1f0df8=holdValidation[_0x5b20('0x2c')](_0x110774['body']);if(_0x1f0df8[_0x5b20('0x2d')]>0x0){return _0x1197f4[_0x5b20('0x18')](0x190)['json'](_0x1f0df8);}var _0x2b726c=_0x110774[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x41a6d1=_0x110774[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0x2b726c)[_0x5b20('0x22')](function(_0x36c204){logger['info'](_0x5b20('0x32'),_0x36c204[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x36c204[_0x5b20('0x17')]),_0x5b20('0x41'),{'sessionId':_0x41a6d1});return _0x1197f4['status'](0xc8)[_0x5b20('0x2e')]({'error':![],'message':_0x5b20('0x42')});})['catch'](handleError(_0x1197f4));};exports[_0x5b20('0x43')]=function(_0x48d5f2,_0x110480){logger[_0x5b20('0x11')](_0x5b20('0x44'),_0x48d5f2[_0x5b20('0x2b')]);var _0x5c8cb2=unholdValidation[_0x5b20('0x2c')](_0x48d5f2[_0x5b20('0x2b')]);if(_0x5c8cb2[_0x5b20('0x2d')]>0x0){return _0x110480[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x5c8cb2);}var _0x23eea9=_0x48d5f2[_0x5b20('0x2b')]['userId'];var _0x55fc94=_0x48d5f2[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0x23eea9)[_0x5b20('0x22')](function(_0x4d2326){logger[_0x5b20('0x11')](_0x5b20('0x32'),_0x4d2326[_0x5b20('0x17')]);emit(util['format'](_0x5b20('0x34'),_0x4d2326[_0x5b20('0x17')]),_0x5b20('0x45'),{'sessionId':_0x55fc94});return _0x110480['status'](0xc8)[_0x5b20('0x2e')]({'error':![],'message':'unhold\x20executed!'});})[_0x5b20('0x3a')](handleError(_0x110480));};exports[_0x5b20('0x46')]=function(_0x5fbbe0,_0x3bddbf){logger['info'](_0x5b20('0x47'),_0x3bddbf['body']);var _0x15e8a1=callsValidation['validate'](_0x5fbbe0['body']);if(_0x15e8a1[_0x5b20('0x2d')]>0x0){return _0x3bddbf[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x15e8a1);}var _0x240ca5=_0x5fbbe0['body']['userId'];var _0x299148=respondWithRpcPromise(_0x5b20('0x23'));var _0x1cca2c=getAgent(_0x240ca5);return Promise[_0x5b20('0x48')]([_0x299148,_0x1cca2c])[_0x5b20('0x22')](function(_0x4bd1fa){var _0x1dca2a=_0x4bd1fa[0x0];var _0x3cf2de=_0x4bd1fa[0x1];var _0x3241a9=_[_0x5b20('0x49')](_0x1dca2a[_0x5b20('0x24')],function(_0x2c5e87){return _0x2c5e87[_0x5b20('0x25')]==_0x3cf2de['id'];});return _0x3bddbf['status'](0xc8)[_0x5b20('0x2e')]({'count':_0x3241a9[_0x5b20('0x2d')],'rows':_0x3241a9});})[_0x5b20('0x3a')](handleError(_0x3bddbf));};exports['conference']=function(_0x1ea503,_0x3449db){logger[_0x5b20('0x11')](_0x5b20('0x4a'),_0x1ea503['body']);var _0x1de6a1=conferenceValidation[_0x5b20('0x2c')](_0x1ea503[_0x5b20('0x2b')]);if(_0x1de6a1[_0x5b20('0x2d')]>0x0){return _0x3449db[_0x5b20('0x18')](0x190)['json'](_0x1de6a1);}var _0x59ee23=_0x1ea503['body']['userId'];return getAgent(_0x59ee23)['then'](function(_0x4ed20b){logger['info'](_0x5b20('0x32'),_0x4ed20b[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x4ed20b['name']),'webbar:conference');return _0x3449db[_0x5b20('0x18')](0xc8)[_0x5b20('0x2e')]({'error':![],'message':_0x5b20('0x4b')});})[_0x5b20('0x3a')](handleError(_0x3449db));};exports['transfer']=function(_0x48a14f,_0x354147){logger[_0x5b20('0x11')](_0x5b20('0x4c'),_0x48a14f[_0x5b20('0x2b')]);var _0x5c3de3=transferValidation[_0x5b20('0x2c')](_0x48a14f[_0x5b20('0x2b')]);if(_0x5c3de3['length']>0x0){return _0x354147[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x5c3de3);}var _0x143632=_0x48a14f[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x48fb7a=_0x48a14f[_0x5b20('0x2b')][_0x5b20('0x26')];var _0x2a9964=_0x48a14f[_0x5b20('0x2b')][_0x5b20('0x4d')];return getAgent(_0x143632)['then'](function(_0x215f71){logger[_0x5b20('0x11')](_0x5b20('0x32'),_0x215f71[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x215f71[_0x5b20('0x17')]),_0x5b20('0x4e'),{'sessionId':_0x48fb7a,'transferNumber':_0x2a9964});return _0x354147['status'](0xc8)[_0x5b20('0x2e')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x354147));}; \ No newline at end of file +var _0x24cd=['number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','sessionId','length','originate','info','body','json','callerId','callbackUrl','entityFound:','format','user:%s','hangup','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../config/environment','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0x24cd,0x83));var _0xd24c=function(_0x108b27,_0x2db06e){_0x108b27=_0x108b27-0x0;var _0x156871=_0x24cd[_0x108b27];return _0x156871;};'use strict';var path=require(_0xd24c('0x0'));var fs=require('fs');var _=require(_0xd24c('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xd24c('0x2'));var util=require('util');var BPromise=require(_0xd24c('0x3'));var jayson=require(_0xd24c('0x4'));var amiClient=jayson[_0xd24c('0x5')]['http']({'port':0x232a});var logger=require(_0xd24c('0x6'))(_0xd24c('0x7'));var Redis=require('ioredis');config[_0xd24c('0x8')]=_[_0xd24c('0x9')](config[_0xd24c('0x8')],{'host':_0xd24c('0xa'),'port':0x18eb});var io=require(_0xd24c('0xb'))(new Redis(config[_0xd24c('0x8')]));var Schema=require(_0xd24c('0xc'));var originateValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xd24c('0xe')]},'callerId':{'type':_0xd24c('0xf')},'callbackUrl':{'type':_0xd24c('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':_0xd24c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':[!![],_0xd24c('0x11')]},'transferNumber':{'type':_0xd24c('0xf'),'required':[!![],_0xd24c('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':_0xd24c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd24c('0x10')]}});function emit(_0x3aa193,_0x1a1111,_0x3221a8){logger['info'](_0x3aa193,_0x1a1111,JSON['stringify'](_0x3221a8));io['to'](_0x3aa193)[_0xd24c('0x13')](_0x1a1111,_0x3221a8);}function handleError(_0x34f882){return function(_0x170d59){console['log'](_0xd24c('0x14'),_0x170d59,_0x170d59 instanceof RangeError);logger[_0xd24c('0x15')](_0x170d59[_0xd24c('0x16')]);if(_0x170d59 instanceof RangeError){if(_0x170d59[_0xd24c('0x17')]){delete _0x170d59['name'];}_0x34f882[_0xd24c('0x18')](0x194)['send'](_0x170d59);}else{if(_0x170d59[_0xd24c('0x17')]){delete _0x170d59[_0xd24c('0x17')];}_0x34f882[_0xd24c('0x18')](0x1f4)[_0xd24c('0x19')](_0x170d59);}};}function checkError(){return function(_0x333416){if(!_0x333416){throw new RangeError(_0xd24c('0x1a'));}return _0x333416;};}function respondWithRpcPromise(_0x2f7439,_0x298d73){return new BPromise(function(_0x17375b,_0x206ce7){var _0x48fffd=amiClient;return _0x48fffd[_0xd24c('0x1b')](_0x2f7439,_0x298d73)[_0xd24c('0x1c')](function(_0x2549d0){if(_0x2549d0['error']){if(_0x2549d0[_0xd24c('0x15')][_0xd24c('0x1d')]===0x1f4){return _0x206ce7(_0x2549d0[_0xd24c('0x15')]['message']);}return _0x17375b(_0x2549d0[_0xd24c('0x15')][_0xd24c('0x1e')]);}else{_0x17375b(_0x2549d0[_0xd24c('0x1f')]);}})[_0xd24c('0x20')](function(_0x574cd4){_0x206ce7(_0x574cd4);});});}function getAgent(_0x5ec0b1){return db[_0xd24c('0x21')]['findOne']({'where':{'id':_0x5ec0b1,'role':_0xd24c('0x22')}})[_0xd24c('0x1c')](checkError());}function getAgentCheckSession(_0x325fcc,_0x4c0d99){return new BPromise(function(_0x4cb1b3,_0x26fd85){var _0x14d44a=respondWithRpcPromise(_0xd24c('0x23'));var _0x160f03=getAgent(_0x325fcc);Promise[_0xd24c('0x24')]([_0x14d44a,_0x160f03])[_0xd24c('0x1c')](function(_0x1be144){var _0x20d37f=_0x1be144[0x0];var _0x1c48d6=_0x1be144[0x1];var _0x3b14c7=_[_0xd24c('0x25')](_0x20d37f['rows'],function(_0x4e128b){return _0x4e128b[_0xd24c('0x26')]==_0x1c48d6['id']&&_0x4e128b[_0xd24c('0x27')]==_0x4c0d99;});if(_0x3b14c7[_0xd24c('0x28')]==0x1){_0x4cb1b3(_0x1c48d6);}else{_0x26fd85(new RangeError('sessionId\x20'+_0x4c0d99+'\x20not\x20found!'));}});});}exports[_0xd24c('0x29')]=function(_0x1678e4,_0x34a64c){logger[_0xd24c('0x2a')]('originate\x20fired:',_0x1678e4[_0xd24c('0x2b')]);var _0x2ae0ce=originateValidation[_0xd24c('0xc')](_0x1678e4[_0xd24c('0x2b')]);if(_0x2ae0ce[_0xd24c('0x28')]>0x0){return _0x34a64c[_0xd24c('0x18')](0x190)[_0xd24c('0x2c')](_0x2ae0ce);}var _0x1935f3=_0x1678e4[_0xd24c('0x2b')]['userId'];var _0x4be898=_0x1678e4['body']['callNumber'];var _0x23d014=_0x1678e4[_0xd24c('0x2b')][_0xd24c('0x2d')];var _0x1113a6=_0x1678e4[_0xd24c('0x2b')][_0xd24c('0x2e')];return getAgent(_0x1935f3)[_0xd24c('0x1c')](function(_0x483e3f){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x483e3f[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x483e3f[_0xd24c('0x17')]),'webbar:originate',{'callNumber':_0x4be898,'callerId':_0x23d014,'callbackUrl':_0x1113a6});return _0x34a64c[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'originate\x20executed!'});})[_0xd24c('0x20')](handleError(_0x34a64c));};exports[_0xd24c('0x32')]=function(_0x4bf183,_0x1e5718){logger[_0xd24c('0x2a')]('hangup\x20fired:',_0x4bf183[_0xd24c('0x2b')]);var _0x36d013=hangupValidation[_0xd24c('0xc')](_0x4bf183[_0xd24c('0x2b')]);if(_0x36d013['length']>0x0){return _0x1e5718[_0xd24c('0x18')](0x190)['json'](_0x36d013);}var _0x2a93af=_0x4bf183['body']['userId'];var _0x4b1a7e=_0x4bf183[_0xd24c('0x2b')]['sessionId'];return getAgent(_0x2a93af)['then'](function(_0x66f45){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x66f45[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0x66f45['name']),_0xd24c('0x33'),{'sessionId':_0x4b1a7e});return _0x1e5718[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x34')});})[_0xd24c('0x20')](handleError(_0x1e5718));};exports[_0xd24c('0x35')]=function(_0x17f070,_0xd20086){logger[_0xd24c('0x2a')](_0xd24c('0x36'),_0x17f070['body']);var _0x2607e5=answerValidation[_0xd24c('0xc')](_0x17f070['body']);if(_0x2607e5[_0xd24c('0x28')]>0x0){return _0xd20086[_0xd24c('0x18')](0x190)['json'](_0x2607e5);}var _0x2f2981=_0x17f070['body'][_0xd24c('0x37')];var _0x2d46b8=_0x17f070[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x2f2981)[_0xd24c('0x1c')](function(_0x5bd78b){logger[_0xd24c('0x2a')]('entityFound:',_0x5bd78b[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0x5bd78b[_0xd24c('0x17')]),'webbar:answer',{'sessionId':_0x2d46b8});return _0xd20086[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xd24c('0x20')](handleError(_0xd20086));};exports['hold']=function(_0x548080,_0x5dd31a){logger[_0xd24c('0x2a')](_0xd24c('0x38'),_0x548080['body']);var _0x516734=holdValidation[_0xd24c('0xc')](_0x548080[_0xd24c('0x2b')]);if(_0x516734[_0xd24c('0x28')]>0x0){return _0x5dd31a[_0xd24c('0x18')](0x190)['json'](_0x516734);}var _0x2931b7=_0x548080[_0xd24c('0x2b')]['userId'];var _0x1ee699=_0x548080[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x2931b7)['then'](function(_0x3039aa){logger['info'](_0xd24c('0x2f'),_0x3039aa[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x3039aa['name']),_0xd24c('0x39'),{'sessionId':_0x1ee699});return _0x5dd31a[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x3a')});})[_0xd24c('0x20')](handleError(_0x5dd31a));};exports[_0xd24c('0x3b')]=function(_0x3ce7d0,_0x34321f){logger[_0xd24c('0x2a')](_0xd24c('0x3c'),_0x3ce7d0[_0xd24c('0x2b')]);var _0x5c2b2c=unholdValidation[_0xd24c('0xc')](_0x3ce7d0[_0xd24c('0x2b')]);if(_0x5c2b2c['length']>0x0){return _0x34321f['status'](0x190)['json'](_0x5c2b2c);}var _0x252f2e=_0x3ce7d0[_0xd24c('0x2b')][_0xd24c('0x37')];var _0x4668d2=_0x3ce7d0[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x252f2e)[_0xd24c('0x1c')](function(_0xd9b530){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0xd9b530[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0xd9b530[_0xd24c('0x17')]),'webbar:unhold',{'sessionId':_0x4668d2});return _0x34321f[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x3d')});})['catch'](handleError(_0x34321f));};exports['calls']=function(_0xdf1f18,_0xd35f63){logger[_0xd24c('0x2a')](_0xd24c('0x3e'),_0xd35f63[_0xd24c('0x2b')]);var _0x3dee09=callsValidation[_0xd24c('0xc')](_0xdf1f18[_0xd24c('0x2b')]);if(_0x3dee09['length']>0x0){return _0xd35f63[_0xd24c('0x18')](0x190)['json'](_0x3dee09);}var _0x4844fc=_0xdf1f18[_0xd24c('0x2b')]['userId'];var _0x4f6b11=respondWithRpcPromise(_0xd24c('0x23'));var _0x1b649e=getAgent(_0x4844fc);return Promise[_0xd24c('0x24')]([_0x4f6b11,_0x1b649e])[_0xd24c('0x1c')](function(_0x4890d6){var _0x66db4a=_0x4890d6[0x0];var _0x1e99e7=_0x4890d6[0x1];var _0x3e6c3b=_[_0xd24c('0x25')](_0x66db4a[_0xd24c('0x3f')],function(_0xcb46e8){return _0xcb46e8[_0xd24c('0x26')]==_0x1e99e7['id'];});return _0xd35f63['status'](0xc8)['json']({'count':_0x3e6c3b['length'],'rows':_0x3e6c3b});})[_0xd24c('0x20')](handleError(_0xd35f63));};exports[_0xd24c('0x40')]=function(_0x42a917,_0x186042){logger[_0xd24c('0x2a')](_0xd24c('0x41'),_0x42a917['body']);var _0x1f2632=conferenceValidation[_0xd24c('0xc')](_0x42a917['body']);if(_0x1f2632[_0xd24c('0x28')]>0x0){return _0x186042[_0xd24c('0x18')](0x190)[_0xd24c('0x2c')](_0x1f2632);}var _0x45030d=_0x42a917[_0xd24c('0x2b')]['userId'];return getAgent(_0x45030d)['then'](function(_0x2a6d13){logger[_0xd24c('0x2a')]('entityFound:',_0x2a6d13[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')]('user:%s',_0x2a6d13[_0xd24c('0x17')]),_0xd24c('0x42'));return _0x186042[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x43')});})[_0xd24c('0x20')](handleError(_0x186042));};exports[_0xd24c('0x44')]=function(_0x4af868,_0x522587){logger['info'](_0xd24c('0x45'),_0x4af868['body']);var _0x5293b4=transferValidation['validate'](_0x4af868[_0xd24c('0x2b')]);if(_0x5293b4[_0xd24c('0x28')]>0x0){return _0x522587[_0xd24c('0x18')](0x190)['json'](_0x5293b4);}var _0x312c4c=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x37')];var _0x2daf65=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x27')];var _0x52567d=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x46')];return getAgent(_0x312c4c)['then'](function(_0x24ede8){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x24ede8[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x24ede8[_0xd24c('0x17')]),_0xd24c('0x47'),{'sessionId':_0x2daf65,'transferNumber':_0x52567d});return _0x522587[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xd24c('0x20')](handleError(_0x522587));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 0cdee15..9e16ad5 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 _0xd117=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/users','getAgents','getApplications','create','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','/:id/notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0xd117,0x182));var _0x7d11=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xd117[_0x258b93];return _0x35484b;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var fs_extra=require(_0x7d11('0x6'));var auth=require(_0x7d11('0x7'));var interaction=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var controller=require(_0x7d11('0xa'));router[_0x7d11('0xb')]('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0xd')]);router[_0x7d11('0xb')](_0x7d11('0xe'),auth['isAuthenticated'](),controller[_0x7d11('0xf')]);router[_0x7d11('0xb')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x11')]);router[_0x7d11('0xb')](_0x7d11('0x12'),auth['isAuthenticated'](),controller[_0x7d11('0x13')]);router['get']('/:id/canned_answers',auth[_0x7d11('0xc')](),controller['getAnswers']);router['get'](_0x7d11('0x14'),auth['isAuthenticated'](),controller[_0x7d11('0x15')]);router[_0x7d11('0xb')]('/:id/applications',auth[_0x7d11('0xc')](),controller[_0x7d11('0x16')]);router['post']('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0x17')]);router[_0x7d11('0x18')](_0x7d11('0x12'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x19')]);router[_0x7d11('0x18')](_0x7d11('0x1a'),auth['isAuthenticated'](),controller[_0x7d11('0x1b')]);router[_0x7d11('0x18')](_0x7d11('0x14'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x1c')]);router['post'](_0x7d11('0x1d'),auth[_0x7d11('0xc')](),controller['addApplications']);router['post'](_0x7d11('0x1e'),controller['notify']);router[_0x7d11('0x18')]('/:id/send',auth[_0x7d11('0xc')](),controller[_0x7d11('0x1f')]);router[_0x7d11('0x20')](_0x7d11('0x10'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x21')]);router[_0x7d11('0x22')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x23')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7d11('0x24')]);router[_0x7d11('0x22')](_0x7d11('0x1a'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x25')]);router[_0x7d11('0x22')](_0x7d11('0x14'),auth[_0x7d11('0xc')](),controller['removeAgents']);module[_0x7d11('0x26')]=router; \ No newline at end of file +var _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x430c,0x1a1));var _0xc430=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x430c[_0x1a3e23];return _0x5ee0d8;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 0b7b9b7..99e6311 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 _0x3b9c=['generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name'];(function(_0x291c1f,_0x51e17a){var _0x5eba80=function(_0x343db0){while(--_0x343db0){_0x291c1f['push'](_0x291c1f['shift']());}};_0x5eba80(++_0x51e17a);}(_0x3b9c,0xed));var _0xc3b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xc3b9('0x0')]={'name':{'type':Sequelize[_0xc3b9('0x1')],'unique':_0xc3b9('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc3b9('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xc3b9('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc3b9('0x3')]();}},'phone':{'type':Sequelize[_0xc3b9('0x1')]},'type':{'type':Sequelize[_0xc3b9('0x4')]('twilio',_0xc3b9('0x5'))},'accountSid':{'type':Sequelize[_0xc3b9('0x1')]},'baseUrl':{'type':Sequelize[_0xc3b9('0x1')]},'authToken':{'type':Sequelize[_0xc3b9('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc3b9('0x6')],'defaultValue':function(){return _0xc3b9('0x7');}},'notificationSound':{'type':Sequelize[_0xc3b9('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc3b9('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc3b9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc3b9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc3b9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc3b9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc3b9('0x9')],'comment':_0xc3b9('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xc3b9('0x8')],'defaultValue':![],'comment':_0xc3b9('0xb'),'set':function(_0x585a5b){if(!_0x585a5b){this[_0xc3b9('0xc')](_0xc3b9('0xd'),null);}this[_0xc3b9('0xc')](_0xc3b9('0xe'),_0x585a5b);}},'description':{'type':Sequelize[_0xc3b9('0x1')]}}; \ No newline at end of file +var _0xf986=['setDataValue','sequelize','randomstring','name','STRING','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x504413,_0x56c93f){var _0x278627=function(_0x479e35){while(--_0x479e35){_0x504413['push'](_0x504413['shift']());}};_0x278627(++_0x56c93f);}(_0xf986,0x112));var _0x6f98=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf986[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x6f98('0x0'));var rs=require(_0x6f98('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6f98('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6f98('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6f98('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6f98('0x3')],'defaultValue':function(){return rs[_0x6f98('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6f98('0x5')]('twilio',_0x6f98('0x6'))},'accountSid':{'type':Sequelize[_0x6f98('0x3')]},'baseUrl':{'type':Sequelize[_0x6f98('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6f98('0x7')],'defaultValue':function(){return _0x6f98('0x8');}},'notificationSound':{'type':Sequelize[_0x6f98('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6f98('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f98('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6f98('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f98('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f98('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f98('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6f98('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x6f98('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xa714d3){if(!_0xa714d3){this[_0x6f98('0xc')]('mandatoryDispositionPauseId',null);}this[_0x6f98('0xc')]('mandatoryDisposition',_0xa714d3);}},'description':{'type':Sequelize[_0x6f98('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index b875856..74a7ecb 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 _0x71e2=['mobile','from','From','replace','messageId','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','List','DESC','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','WhatsappAccount','type','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','findAll','rows','params','mandatoryDispositionPause','rawAttributes','intersection','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','order','CannedAnswer','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','priority','getApplications','Applications','account','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId'];(function(_0x40cfb0,_0x5c5343){var _0x2eb83c=function(_0x47bb5f){while(--_0x47bb5f){_0x40cfb0['push'](_0x40cfb0['shift']());}};_0x2eb83c(++_0x5c5343);}(_0x71e2,0x1ac));var _0x271e=function(_0x382081,_0x4278ae){_0x382081=_0x382081-0x0;var _0x4e5058=_0x71e2[_0x382081];return _0x4e5058;};'use strict';var emlformat=require(_0x271e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x271e('0x1'));var jsonpatch=require(_0x271e('0x2'));var rp=require(_0x271e('0x3'));var moment=require(_0x271e('0x4'));var BPromise=require(_0x271e('0x5'));var Mustache=require('mustache');var util=require(_0x271e('0x6'));var path=require(_0x271e('0x7'));var sox=require(_0x271e('0x8'));var csv=require(_0x271e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x271e('0xa'));var _=require(_0x271e('0xb'));var squel=require(_0x271e('0xc'));var crypto=require('crypto');var jsforce=require(_0x271e('0xd'));var deskjs=require(_0x271e('0xe'));var toCsv=require(_0x271e('0x9'));var querystring=require('querystring');var Papa=require(_0x271e('0xf'));var Redis=require('ioredis');var authService=require(_0x271e('0x10'));var qs=require(_0x271e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x271e('0x12'));var logger=require(_0x271e('0x13'))(_0x271e('0x14'));var utils=require(_0x271e('0x15'));var config=require(_0x271e('0x16'));var licenseUtil=require(_0x271e('0x17'));var db=require(_0x271e('0x18'))['db'];config[_0x271e('0x19')]=_[_0x271e('0x1a')](config[_0x271e('0x19')],{'host':_0x271e('0x1b'),'port':0x18eb});var socket=require(_0x271e('0x1c'))(new Redis(config[_0x271e('0x19')]));require(_0x271e('0x1d'))[_0x271e('0x1e')](socket);var jayson=require(_0x271e('0x1f'));var client=jayson[_0x271e('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2c4217,_0x19b2eb,_0x4df07e,_0x3e981b){return new BPromise(function(_0x3ff370,_0x36fa44){var _0x504c66=_0x3e981b||client;return _0x504c66['request'](_0x2c4217,_0x4df07e)['then'](function(_0x5dcdc3){logger['info'](_0x271e('0x21'),_0x19b2eb,_0x271e('0x22'));logger[_0x271e('0x23')](_0x271e('0x24'),_0x19b2eb,_0x271e('0x22'),JSON['stringify'](_0x5dcdc3));if(_0x5dcdc3[_0x271e('0x25')]){if(_0x5dcdc3[_0x271e('0x25')][_0x271e('0x26')]===0x1f4){logger[_0x271e('0x25')](_0x271e('0x21'),_0x19b2eb,_0x5dcdc3[_0x271e('0x25')][_0x271e('0x27')]);return _0x36fa44(_0x5dcdc3[_0x271e('0x25')]['message']);}logger[_0x271e('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x19b2eb,_0x5dcdc3['error'][_0x271e('0x27')]);return _0x3ff370(_0x5dcdc3['error'][_0x271e('0x27')]);}else{logger[_0x271e('0x28')](_0x271e('0x21'),_0x19b2eb,_0x271e('0x22'));_0x3ff370(_0x5dcdc3[_0x271e('0x29')][_0x271e('0x27')]);}})[_0x271e('0x2a')](function(_0xa72240){logger[_0x271e('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x19b2eb,_0xa72240);_0x36fa44(_0xa72240);});});}function respondWithStatusCode(_0x4378ff,_0x4ab9ab){_0x4ab9ab=_0x4ab9ab||0xcc;return function(_0x17503d){if(_0x17503d){return _0x4378ff[_0x271e('0x2b')](_0x4ab9ab);}return _0x4378ff[_0x271e('0x2c')](_0x4ab9ab)[_0x271e('0x2d')]();};}function respondWithResult(_0x546828,_0xbea88a){_0xbea88a=_0xbea88a||0xc8;return function(_0x3ce592){if(_0x3ce592){return _0x546828['status'](_0xbea88a)[_0x271e('0x2e')](_0x3ce592);}};}function respondWithFilteredResult(_0x21c80e,_0x6fa75c){return function(_0x39e5c5){if(_0x39e5c5){var _0x535f71=typeof _0x6fa75c[_0x271e('0x2f')]===_0x271e('0x30')&&typeof _0x6fa75c['limit']==='undefined';var _0x4083ac=_0x39e5c5[_0x271e('0x31')];var _0x31956a=_0x535f71?0x0:_0x6fa75c['offset'];var _0xb3dced=_0x535f71?_0x39e5c5['count']:_0x6fa75c[_0x271e('0x2f')]+_0x6fa75c[_0x271e('0x32')];var _0x576276;if(_0xb3dced>=_0x4083ac){_0xb3dced=_0x4083ac;_0x576276=0xc8;}else{_0x576276=0xce;}_0x21c80e[_0x271e('0x2c')](_0x576276);return _0x21c80e[_0x271e('0x33')](_0x271e('0x34'),_0x31956a+'-'+_0xb3dced+'/'+_0x4083ac)[_0x271e('0x2e')](_0x39e5c5);}return null;};}function patchUpdates(_0x58e309){return function(_0x3dce7f){try{jsonpatch['apply'](_0x3dce7f,_0x58e309,!![]);}catch(_0x306adb){return BPromise['reject'](_0x306adb);}return _0x3dce7f[_0x271e('0x35')]();};}function saveUpdates(_0x196fb0,_0x16f9af){return function(_0x160736){if(_0x160736){return _0x160736['update'](_0x196fb0)['then'](function(_0x41e30e){return _0x41e30e;});}return null;};}function removeEntity(_0x3449ce,_0x34909b){return function(_0x4ed6a9){if(_0x4ed6a9){return _0x4ed6a9['destroy']()[_0x271e('0x36')](function(){var _0x47f6ae=_0x4ed6a9['get']({'plain':!![]});var _0x41f10c=_0x271e('0x37');return db[_0x271e('0x38')][_0x271e('0x39')]({'where':{'type':_0x41f10c,'resourceId':_0x47f6ae['id']}})[_0x271e('0x36')](function(){return _0x4ed6a9;});})[_0x271e('0x36')](function(){_0x3449ce[_0x271e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a96b,_0x33c54b){return function(_0x1ad8ab){if(!_0x1ad8ab){_0x24a96b[_0x271e('0x2b')](0x194);}return _0x1ad8ab;};}function handleError(_0x1f5361,_0x274409){_0x274409=_0x274409||0x1f4;return function(_0x4be063){logger[_0x271e('0x25')](_0x4be063[_0x271e('0x3a')]);if(_0x4be063[_0x271e('0x3b')]){delete _0x4be063['name'];}_0x1f5361[_0x271e('0x2c')](_0x274409)[_0x271e('0x3c')](_0x4be063);};}exports[_0x271e('0x3d')]=function(_0x218658,_0x137c4f){var _0x4c9824={'include':[{'model':db[_0x271e('0x3e')],'as':'mandatoryDispositionPause'}]},_0x4311f6={},_0x9681c4={'count':0x0,'rows':[]};var _0x5cd915=_['map'](db[_0x271e('0x3f')]['rawAttributes'],function(_0x40b63c){return{'name':_0x40b63c['fieldName'],'type':_0x40b63c[_0x271e('0x40')]['key']};});_0x4311f6[_0x271e('0x41')]=_[_0x271e('0x42')](_0x5cd915,_0x271e('0x3b'));_0x4311f6['query']=_[_0x271e('0x43')](_0x218658[_0x271e('0x44')]);_0x4311f6[_0x271e('0x45')]=_['intersection'](_0x4311f6['model'],_0x4311f6[_0x271e('0x44')]);_0x4c9824[_0x271e('0x46')]=_['intersection'](_0x4311f6[_0x271e('0x41')],qs[_0x271e('0x47')](_0x218658[_0x271e('0x44')][_0x271e('0x47')]));_0x4c9824[_0x271e('0x46')]=_0x4c9824[_0x271e('0x46')][_0x271e('0x48')]?_0x4c9824[_0x271e('0x46')]:_0x4311f6['model'];if(!_0x218658['query'][_0x271e('0x49')](_0x271e('0x4a'))){_0x4c9824['limit']=qs[_0x271e('0x32')](_0x218658['query'][_0x271e('0x32')]);_0x4c9824[_0x271e('0x2f')]=qs[_0x271e('0x2f')](_0x218658[_0x271e('0x44')][_0x271e('0x2f')]);}_0x4c9824['order']=qs[_0x271e('0x4b')](_0x218658['query']['sort']);_0x4c9824[_0x271e('0x4c')]=qs[_0x271e('0x45')](_[_0x271e('0x4d')](_0x218658[_0x271e('0x44')],_0x4311f6['filters']),_0x5cd915);if(_0x218658[_0x271e('0x44')]['filter']){_0x4c9824['where']=_[_0x271e('0x4e')](_0x4c9824[_0x271e('0x4c')],{'$or':_[_0x271e('0x42')](_0x5cd915,function(_0x272222){if(_0x272222[_0x271e('0x40')]!=='VIRTUAL'){var _0x53c5d6={};_0x53c5d6[_0x272222[_0x271e('0x3b')]]={'$like':'%'+_0x218658[_0x271e('0x44')][_0x271e('0x4f')]+'%'};return _0x53c5d6;}})});}_0x4c9824=_[_0x271e('0x4e')]({},_0x4c9824,_0x218658['options']);var _0x487a98={'where':_0x4c9824[_0x271e('0x4c')]};return db[_0x271e('0x3f')]['count'](_0x487a98)['then'](function(_0x3f54ee){_0x9681c4[_0x271e('0x31')]=_0x3f54ee;if(_0x218658['query'][_0x271e('0x50')]){_0x4c9824[_0x271e('0x51')]=[{'all':!![]}];}return db[_0x271e('0x3f')][_0x271e('0x52')](_0x4c9824);})[_0x271e('0x36')](function(_0x3f87aa){_0x9681c4[_0x271e('0x53')]=_0x3f87aa;return _0x9681c4;})[_0x271e('0x36')](respondWithFilteredResult(_0x137c4f,_0x4c9824))[_0x271e('0x2a')](handleError(_0x137c4f,null));};exports['show']=function(_0x749137,_0x2e467c){var _0x562a72={'raw':![],'where':{'id':_0x749137[_0x271e('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x271e('0x55')}]},_0x211241={};_0x211241[_0x271e('0x41')]=_[_0x271e('0x43')](db[_0x271e('0x3f')][_0x271e('0x56')]);_0x211241['query']=_[_0x271e('0x43')](_0x749137['query']);_0x211241[_0x271e('0x45')]=_[_0x271e('0x57')](_0x211241[_0x271e('0x41')],_0x211241[_0x271e('0x44')]);_0x562a72[_0x271e('0x46')]=_[_0x271e('0x57')](_0x211241['model'],qs[_0x271e('0x47')](_0x749137['query']['fields']));_0x562a72[_0x271e('0x46')]=_0x562a72[_0x271e('0x46')][_0x271e('0x48')]?_0x562a72[_0x271e('0x46')]:_0x211241[_0x271e('0x41')];if(_0x749137[_0x271e('0x44')][_0x271e('0x50')]){_0x562a72[_0x271e('0x51')]=[{'all':!![]}];}_0x562a72=_['merge']({},_0x562a72,_0x749137[_0x271e('0x58')]);return db[_0x271e('0x3f')][_0x271e('0x59')](_0x562a72)[_0x271e('0x36')](handleEntityNotFound(_0x2e467c,null))[_0x271e('0x36')](respondWithResult(_0x2e467c,null))[_0x271e('0x2a')](handleError(_0x2e467c,null));};exports[_0x271e('0x5a')]=function(_0x5ba492,_0x15c922){return db[_0x271e('0x3f')][_0x271e('0x5a')](_0x5ba492[_0x271e('0x5b')],{})['then'](function(_0x1146e9){var _0x184b15=_0x5ba492[_0x271e('0x5c')][_0x271e('0x5d')]({'plain':!![]});if(!_0x184b15)throw new Error(_0x271e('0x5e'));if(_0x184b15['role']===_0x271e('0x5c')){var _0x2e6d67=_0x1146e9['get']({'plain':!![]});var _0x53ebc5=_0x271e('0x37');return db[_0x271e('0x5f')][_0x271e('0x59')]({'where':{'name':_0x53ebc5,'userProfileId':_0x184b15[_0x271e('0x60')]},'raw':!![]})[_0x271e('0x36')](function(_0x1d0cbc){if(_0x1d0cbc&&_0x1d0cbc[_0x271e('0x61')]===0x0){return db[_0x271e('0x38')][_0x271e('0x5a')]({'name':_0x2e6d67[_0x271e('0x3b')],'resourceId':_0x2e6d67['id'],'type':_0x1d0cbc[_0x271e('0x3b')],'sectionId':_0x1d0cbc['id']},{})['then'](function(){return _0x1146e9;});}else{return _0x1146e9;}})[_0x271e('0x2a')](function(_0x4ed523){logger[_0x271e('0x25')](_0x271e('0x62'),_0x4ed523);throw _0x4ed523;});}return _0x1146e9;})[_0x271e('0x36')](respondWithResult(_0x15c922,0xc9))[_0x271e('0x2a')](handleError(_0x15c922,null));};exports[_0x271e('0x63')]=function(_0x452247,_0x2763ce){if(_0x452247[_0x271e('0x5b')]['id']){delete _0x452247[_0x271e('0x5b')]['id'];}return db[_0x271e('0x3f')]['find']({'where':{'id':_0x452247[_0x271e('0x54')]['id']},'include':[{'model':db[_0x271e('0x3e')],'as':_0x271e('0x55')}]})['then'](handleEntityNotFound(_0x2763ce,null))[_0x271e('0x36')](saveUpdates(_0x452247['body'],null))[_0x271e('0x36')](respondWithResult(_0x2763ce,null))[_0x271e('0x2a')](handleError(_0x2763ce,null));};exports[_0x271e('0x39')]=function(_0x2a20f6,_0x49717d){return db['WhatsappAccount'][_0x271e('0x59')]({'where':{'id':_0x2a20f6[_0x271e('0x54')]['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x49717d,null))['then'](removeEntity(_0x49717d,null))[_0x271e('0x2a')](handleError(_0x49717d,null));};exports[_0x271e('0x64')]=function(_0x373252,_0x37c89a){return db[_0x271e('0x3f')][_0x271e('0x64')]()[_0x271e('0x36')](respondWithResult(_0x37c89a,null))['catch'](handleError(_0x37c89a,null));};exports[_0x271e('0x65')]=function(_0x52038c,_0x307662,_0x1830c8){if(_0x52038c[_0x271e('0x5b')]['id']){delete _0x52038c[_0x271e('0x5b')]['id'];}return db[_0x271e('0x3f')][_0x271e('0x59')]({'where':{'id':_0x52038c[_0x271e('0x54')]['id']}})['then'](handleEntityNotFound(_0x307662,null))[_0x271e('0x36')](function(_0x22135b){if(_0x22135b){_0x52038c[_0x271e('0x5b')][_0x271e('0x66')]=_0x22135b['id'];return db[_0x271e('0x67')]['create'](_0x52038c[_0x271e('0x5b')]);}})[_0x271e('0x36')](respondWithResult(_0x307662,null))[_0x271e('0x2a')](handleError(_0x307662,null));};exports[_0x271e('0x68')]=function(_0x3c5c15,_0x409e94,_0x37754d){var _0x57cfb6={'raw':![],'where':{}};var _0x2d7cc9={};var _0x50f324={'count':0x0,'rows':[]};return db[_0x271e('0x3f')][_0x271e('0x69')]({'where':{'id':_0x3c5c15['params']['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x409e94,null))[_0x271e('0x36')](function(_0x313f18){if(_0x313f18){_0x2d7cc9['model']=_[_0x271e('0x43')](db[_0x271e('0x67')]['rawAttributes']);_0x2d7cc9[_0x271e('0x44')]=_[_0x271e('0x43')](_0x3c5c15[_0x271e('0x44')]);_0x2d7cc9[_0x271e('0x45')]=_[_0x271e('0x57')](_0x2d7cc9[_0x271e('0x41')],_0x2d7cc9['query']);_0x57cfb6[_0x271e('0x46')]=_[_0x271e('0x57')](_0x2d7cc9['model'],qs[_0x271e('0x47')](_0x3c5c15[_0x271e('0x44')][_0x271e('0x47')]));_0x57cfb6['attributes']=_0x57cfb6[_0x271e('0x46')][_0x271e('0x48')]?_0x57cfb6[_0x271e('0x46')]:_0x2d7cc9['model'];if(!_0x3c5c15['query'][_0x271e('0x49')]('nolimit')){_0x57cfb6[_0x271e('0x32')]=qs[_0x271e('0x32')](_0x3c5c15[_0x271e('0x44')][_0x271e('0x32')]);_0x57cfb6[_0x271e('0x2f')]=qs[_0x271e('0x2f')](_0x3c5c15[_0x271e('0x44')]['offset']);}_0x57cfb6['order']=qs[_0x271e('0x4b')](_0x3c5c15['query']['sort']);_0x57cfb6[_0x271e('0x4c')]=qs[_0x271e('0x45')](_[_0x271e('0x4d')](_0x3c5c15[_0x271e('0x44')],_0x2d7cc9[_0x271e('0x45')]));_0x57cfb6[_0x271e('0x4c')][_0x271e('0x66')]=_0x313f18['id'];if(_0x3c5c15[_0x271e('0x44')][_0x271e('0x4f')]){_0x57cfb6[_0x271e('0x4c')]=_['merge'](_0x57cfb6[_0x271e('0x4c')],{'$or':_['map'](_0x57cfb6[_0x271e('0x46')],function(_0x74ebb){var _0x1383a0={};_0x1383a0[_0x74ebb]={'$like':'%'+_0x3c5c15[_0x271e('0x44')][_0x271e('0x4f')]+'%'};return _0x1383a0;})});}_0x57cfb6=_[_0x271e('0x4e')]({},_0x57cfb6,_0x3c5c15['options']);return db[_0x271e('0x67')][_0x271e('0x31')]({'where':_0x57cfb6[_0x271e('0x4c')]})[_0x271e('0x36')](function(_0x23f10b){_0x50f324[_0x271e('0x31')]=_0x23f10b;if(_0x3c5c15[_0x271e('0x44')][_0x271e('0x50')]){_0x57cfb6[_0x271e('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x271e('0x52')](_0x57cfb6);})[_0x271e('0x36')](function(_0xead9d9){_0x50f324['rows']=_0xead9d9;return _0x50f324;});}})[_0x271e('0x36')](respondWithFilteredResult(_0x409e94,_0x57cfb6))[_0x271e('0x2a')](handleError(_0x409e94,null));};exports[_0x271e('0x6a')]=function(_0x4585dd,_0x3e9bf7,_0x5667c7){return db[_0x271e('0x3f')][_0x271e('0x59')]({'where':{'id':_0x4585dd[_0x271e('0x54')]['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x3e9bf7,null))[_0x271e('0x36')](function(_0xb24bcb){if(_0xb24bcb){return _0xb24bcb[_0x271e('0x6a')](_0x4585dd[_0x271e('0x44')][_0x271e('0x6b')]);}})['then'](respondWithStatusCode(_0x3e9bf7,null))[_0x271e('0x2a')](handleError(_0x3e9bf7,null));};exports[_0x271e('0x6c')]=function(_0x407995,_0x4e444e,_0x25f688){if(_0x407995[_0x271e('0x5b')]['id']){delete _0x407995[_0x271e('0x5b')]['id'];}return db['WhatsappAccount'][_0x271e('0x59')]({'where':{'id':_0x407995['params']['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x4e444e,null))[_0x271e('0x36')](function(_0xf490fa){if(_0xf490fa){_0x407995[_0x271e('0x5b')][_0x271e('0x66')]=_0xf490fa['id'];return db['CannedAnswer'][_0x271e('0x5a')](_0x407995[_0x271e('0x5b')]);}})[_0x271e('0x36')](respondWithResult(_0x4e444e,null))[_0x271e('0x2a')](handleError(_0x4e444e,null));};exports[_0x271e('0x6d')]=function(_0x43d84c,_0x15c63f,_0x4fbcaf){var _0x2aa37e={'raw':![],'where':{}};var _0x4f55ad={};var _0x55f3a6={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x43d84c[_0x271e('0x54')]['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x15c63f,null))[_0x271e('0x36')](function(_0x1569e0){if(_0x1569e0){_0x4f55ad[_0x271e('0x41')]=_[_0x271e('0x43')](db['CannedAnswer']['rawAttributes']);_0x4f55ad[_0x271e('0x44')]=_[_0x271e('0x43')](_0x43d84c[_0x271e('0x44')]);_0x4f55ad[_0x271e('0x45')]=_['intersection'](_0x4f55ad[_0x271e('0x41')],_0x4f55ad[_0x271e('0x44')]);_0x2aa37e[_0x271e('0x46')]=_[_0x271e('0x57')](_0x4f55ad[_0x271e('0x41')],qs[_0x271e('0x47')](_0x43d84c[_0x271e('0x44')][_0x271e('0x47')]));_0x2aa37e[_0x271e('0x46')]=_0x2aa37e[_0x271e('0x46')][_0x271e('0x48')]?_0x2aa37e[_0x271e('0x46')]:_0x4f55ad[_0x271e('0x41')];if(!_0x43d84c[_0x271e('0x44')]['hasOwnProperty'](_0x271e('0x4a'))){_0x2aa37e[_0x271e('0x32')]=qs['limit'](_0x43d84c[_0x271e('0x44')]['limit']);_0x2aa37e[_0x271e('0x2f')]=qs[_0x271e('0x2f')](_0x43d84c[_0x271e('0x44')][_0x271e('0x2f')]);}_0x2aa37e[_0x271e('0x6e')]=qs['sort'](_0x43d84c['query']['sort']);_0x2aa37e['where']=qs[_0x271e('0x45')](_[_0x271e('0x4d')](_0x43d84c[_0x271e('0x44')],_0x4f55ad[_0x271e('0x45')]));_0x2aa37e[_0x271e('0x4c')][_0x271e('0x66')]=_0x1569e0['id'];if(_0x43d84c[_0x271e('0x44')]['filter']){_0x2aa37e[_0x271e('0x4c')]=_['merge'](_0x2aa37e['where'],{'$or':_[_0x271e('0x42')](_0x2aa37e[_0x271e('0x46')],function(_0x49c62d){var _0x987455={};_0x987455[_0x49c62d]={'$like':'%'+_0x43d84c[_0x271e('0x44')][_0x271e('0x4f')]+'%'};return _0x987455;})});}_0x2aa37e=_['merge']({},_0x2aa37e,_0x43d84c[_0x271e('0x58')]);return db['CannedAnswer']['count']({'where':_0x2aa37e['where']})[_0x271e('0x36')](function(_0x14c18c){_0x55f3a6[_0x271e('0x31')]=_0x14c18c;if(_0x43d84c['query'][_0x271e('0x50')]){_0x2aa37e[_0x271e('0x51')]=[{'all':!![]}];}return db[_0x271e('0x6f')][_0x271e('0x52')](_0x2aa37e);})[_0x271e('0x36')](function(_0x102daa){_0x55f3a6['rows']=_0x102daa;return _0x55f3a6;});}})[_0x271e('0x36')](respondWithFilteredResult(_0x15c63f,_0x2aa37e))['catch'](handleError(_0x15c63f,null));};exports[_0x271e('0x70')]=function(_0x12dfba,_0x4bd8d9,_0x9e63ae){return db[_0x271e('0x3f')]['find']({'where':{'id':_0x12dfba[_0x271e('0x54')]['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x4bd8d9,null))[_0x271e('0x36')](function(_0x1a7251){if(_0x1a7251){return _0x1a7251[_0x271e('0x70')](_0x12dfba['query'][_0x271e('0x6b')]);}})['then'](respondWithStatusCode(_0x4bd8d9,null))[_0x271e('0x2a')](handleError(_0x4bd8d9,null));};exports['addAgents']=function(_0x1c98d5,_0x513c09,_0x394ea2){return db[_0x271e('0x3f')][_0x271e('0x59')]({'where':{'id':_0x1c98d5[_0x271e('0x54')]['id']}})['then'](handleEntityNotFound(_0x513c09,null))[_0x271e('0x36')](function(_0x3cd384){if(_0x3cd384){return _0x3cd384[_0x271e('0x71')](_0x1c98d5[_0x271e('0x5b')][_0x271e('0x6b')],_[_0x271e('0x72')](_0x1c98d5[_0x271e('0x5b')],[_0x271e('0x6b'),'id'])||{})[_0x271e('0x73')](function(_0x18e2a3){for(var _0x198fa8=0x0;_0x198fa8<_0x1c98d5[_0x271e('0x5b')]['ids'][_0x271e('0x48')];_0x198fa8+=0x1){socket['emit'](_0x271e('0x74'),{'UserId':Number(_0x1c98d5[_0x271e('0x5b')]['ids'][_0x198fa8]),'WhatsappAccountId':Number(_0x1c98d5['params']['id'])});}return _0x18e2a3;});}})['then'](respondWithResult(_0x513c09,null))[_0x271e('0x2a')](handleError(_0x513c09,null));};exports['removeAgents']=function(_0x21eee0,_0x3c39f8,_0x509537){return db[_0x271e('0x3f')]['find']({'where':{'id':_0x21eee0[_0x271e('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c39f8,null))[_0x271e('0x36')](function(_0x4af5d6){if(_0x4af5d6){return _0x4af5d6[_0x271e('0x75')](_0x21eee0[_0x271e('0x44')][_0x271e('0x6b')])[_0x271e('0x36')](function(){if(_[_0x271e('0x76')](_0x21eee0[_0x271e('0x44')]['ids'])){for(var _0x1fb33d=0x0;_0x1fb33d<_0x21eee0['query']['ids'][_0x271e('0x48')];_0x1fb33d+=0x1){socket[_0x271e('0x77')](_0x271e('0x78'),{'UserId':Number(_0x21eee0[_0x271e('0x44')][_0x271e('0x6b')][_0x1fb33d]),'WhatsappAccountId':Number(_0x21eee0['params']['id'])});}}else{socket[_0x271e('0x77')]('userWhatsappAccount:remove',{'UserId':Number(_0x21eee0['query'][_0x271e('0x6b')]),'WhatsappAccountId':Number(_0x21eee0[_0x271e('0x54')]['id'])});}});}})[_0x271e('0x36')](respondWithStatusCode(_0x3c39f8,null))[_0x271e('0x2a')](handleError(_0x3c39f8,null));};exports['getAgents']=function(_0x512137,_0x48f0b1,_0xe2ae79){var _0xb0f286={};var _0x2aeb82={};var _0xd6f8b7;var _0x495563;return db[_0x271e('0x3f')][_0x271e('0x69')]({'where':{'id':_0x512137['params']['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x48f0b1,null))[_0x271e('0x36')](function(_0x400d0d){if(_0x400d0d){_0xd6f8b7=_0x400d0d;_0x2aeb82[_0x271e('0x41')]=_[_0x271e('0x43')](db[_0x271e('0x79')]['rawAttributes']);_0x2aeb82[_0x271e('0x44')]=_[_0x271e('0x43')](_0x512137[_0x271e('0x44')]);_0x2aeb82[_0x271e('0x45')]=_[_0x271e('0x57')](_0x2aeb82[_0x271e('0x41')],_0x2aeb82[_0x271e('0x44')]);_0xb0f286[_0x271e('0x46')]=_[_0x271e('0x57')](_0x2aeb82[_0x271e('0x41')],qs['fields'](_0x512137[_0x271e('0x44')][_0x271e('0x47')]));_0xb0f286[_0x271e('0x46')]=_0xb0f286[_0x271e('0x46')][_0x271e('0x48')]?_0xb0f286['attributes']:_0x2aeb82[_0x271e('0x41')];_0xb0f286[_0x271e('0x6e')]=qs['sort'](_0x512137[_0x271e('0x44')][_0x271e('0x4b')]);_0xb0f286[_0x271e('0x4c')]=qs[_0x271e('0x45')](_['pick'](_0x512137['query'],_0x2aeb82[_0x271e('0x45')]));if(_0x512137[_0x271e('0x44')]['filter']){_0xb0f286['where']=_['merge'](_0xb0f286[_0x271e('0x4c')],{'$or':_[_0x271e('0x42')](_0xb0f286[_0x271e('0x46')],function(_0x5d5841){var _0x5ad3fa={};_0x5ad3fa[_0x5d5841]={'$like':'%'+_0x512137[_0x271e('0x44')][_0x271e('0x4f')]+'%'};return _0x5ad3fa;})});}_0xb0f286=_['merge']({},_0xb0f286,_0x512137[_0x271e('0x58')]);return _0xd6f8b7[_0x271e('0x7a')](_0xb0f286);}})['then'](function(_0x13dbf8){if(_0x13dbf8){_0x495563=_0x13dbf8[_0x271e('0x48')];if(!_0x512137['query'][_0x271e('0x49')](_0x271e('0x4a'))){_0xb0f286['limit']=qs['limit'](_0x512137[_0x271e('0x44')][_0x271e('0x32')]);_0xb0f286['offset']=qs['offset'](_0x512137['query'][_0x271e('0x2f')]);}return _0xd6f8b7[_0x271e('0x7a')](_0xb0f286);}})[_0x271e('0x36')](function(_0x1514d2){if(_0x1514d2){return _0x1514d2?{'count':_0x495563,'rows':_0x1514d2}:null;}})[_0x271e('0x36')](respondWithResult(_0x48f0b1,null))[_0x271e('0x2a')](handleError(_0x48f0b1,null));};exports[_0x271e('0x7b')]=function(_0x312e3b,_0x15aeb9){var _0x276b37=_0x312e3b[_0x271e('0x54')]['id'];var _0xcec2ca=_0x312e3b[_0x271e('0x5b')];var _0x27e711=0xc8;var _0x14f293=null;return db[_0x271e('0x7c')]['transaction']({'isolationLevel':db['sequelize'][_0x271e('0x7d')][_0x271e('0x7e')]['READ_COMMITTED']},function(_0x495b33){return db['WhatsappAccount'][_0x271e('0x69')]({'where':{'id':_0x276b37},'transaction':_0x495b33})['then'](function(_0x2c338a){if(_0x2c338a){return db[_0x271e('0x7f')][_0x271e('0x39')]({'where':{'WhatsappAccountId':_0x276b37},'transaction':_0x495b33})[_0x271e('0x36')](function(){var _0x5404a7=_['map'](_0xcec2ca,function(_0x2f61de){_0x2f61de[_0x271e('0x66')]=_0x276b37;return _0x2f61de;});return db[_0x271e('0x7f')]['bulkCreate'](_0x5404a7,{'transaction':_0x495b33});});}else{_0x27e711=0x194;_0x14f293=[];}});})[_0x271e('0x36')](function(){if(_0x27e711!==0x194){return db[_0x271e('0x7f')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x276b37},'order':_0x271e('0x80')})[_0x271e('0x36')](function(_0x584776){_0x14f293=_0x584776;});}})['catch'](function(_0x3534e5){_0x27e711=0x1f4;logger['error'](_0x3534e5[_0x271e('0x3a')]);if(_0x3534e5[_0x271e('0x3b')]){delete _0x3534e5[_0x271e('0x3b')];}_0x14f293=_0x3534e5;})['finally'](function(){if(_0x14f293===null){_0x15aeb9[_0x271e('0x2b')](_0x27e711);}else{if(_0x27e711===0x1f4){_0x15aeb9[_0x271e('0x2c')](_0x27e711)[_0x271e('0x3c')](_0x14f293);}else{_0x15aeb9['status'](_0x27e711)[_0x271e('0x2e')](_0x14f293);}}});};exports['getApplications']=function(_0x5a097a,_0x4ff2d5,_0x25597a){var _0x102d48={};var _0x1a3063={};var _0x21249f;var _0x4fd0d2;return db[_0x271e('0x3f')]['findOne']({'where':{'id':_0x5a097a['params']['id']}})[_0x271e('0x36')](handleEntityNotFound(_0x4ff2d5,null))[_0x271e('0x36')](function(_0x4d4eae){if(_0x4d4eae){_0x21249f=_0x4d4eae;_0x1a3063[_0x271e('0x41')]=_['keys'](db[_0x271e('0x7f')][_0x271e('0x56')]);_0x1a3063[_0x271e('0x44')]=_[_0x271e('0x43')](_0x5a097a[_0x271e('0x44')]);_0x1a3063[_0x271e('0x45')]=_[_0x271e('0x57')](_0x1a3063[_0x271e('0x41')],_0x1a3063[_0x271e('0x44')]);_0x102d48['attributes']=_[_0x271e('0x57')](_0x1a3063[_0x271e('0x41')],qs['fields'](_0x5a097a[_0x271e('0x44')][_0x271e('0x47')]));_0x102d48['attributes']=_0x102d48[_0x271e('0x46')][_0x271e('0x48')]?_0x102d48[_0x271e('0x46')]:_0x1a3063[_0x271e('0x41')];_0x102d48['order']=qs[_0x271e('0x4b')](_0x5a097a[_0x271e('0x44')]['sort']);_0x102d48['where']=qs[_0x271e('0x45')](_[_0x271e('0x4d')](_0x5a097a[_0x271e('0x44')],_0x1a3063[_0x271e('0x45')]));if(_0x5a097a[_0x271e('0x44')][_0x271e('0x4f')]){_0x102d48[_0x271e('0x4c')]=_['merge'](_0x102d48['where'],{'$or':_['map'](_0x102d48[_0x271e('0x46')],function(_0x157765){var _0x2d5c1b={};_0x2d5c1b[_0x157765]={'$like':'%'+_0x5a097a[_0x271e('0x44')][_0x271e('0x4f')]+'%'};return _0x2d5c1b;})});}_0x102d48=_[_0x271e('0x4e')]({},_0x102d48,_0x5a097a['options']);return _0x21249f['getApplications'](_0x102d48);}})[_0x271e('0x36')](function(_0x35925b){if(_0x35925b){_0x4fd0d2=_0x35925b[_0x271e('0x48')];if(!_0x5a097a['query'][_0x271e('0x49')](_0x271e('0x4a'))){_0x102d48[_0x271e('0x32')]=qs[_0x271e('0x32')](_0x5a097a[_0x271e('0x44')][_0x271e('0x32')]);_0x102d48[_0x271e('0x2f')]=qs[_0x271e('0x2f')](_0x5a097a[_0x271e('0x44')]['offset']);}return _0x21249f[_0x271e('0x81')](_0x102d48);}})['then'](function(_0xa37669){if(_0xa37669){return _0xa37669?{'count':_0x4fd0d2,'rows':_0xa37669}:null;}})[_0x271e('0x36')](respondWithResult(_0x4ff2d5,null))['catch'](handleError(_0x4ff2d5,null));};exports['notify']=function(_0x2ef61f,_0x491304,_0x2b6f3a){var _0x5d9430={'channel':'whatsapp'};var _0x494a7e=[];var _0x170cc9=[];var _0x456070={};return db['WhatsappAccount'][_0x271e('0x59')]({'where':{'id':_0x2ef61f[_0x271e('0x54')]['id']},'include':[{'model':db[_0x271e('0x7f')],'as':_0x271e('0x82')}]})[_0x271e('0x36')](handleEntityNotFound(_0x491304,null))['then'](function(_0x4d8b60){_0x5d9430[_0x271e('0x83')]=_0x4d8b60;if(_0x5d9430[_0x271e('0x83')]&&_0x5d9430[_0x271e('0x83')][_0x271e('0x40')]==='sinch'&&_0x2ef61f['body'][_0x271e('0x84')]){if(_0x2ef61f['body'][_0x271e('0x84')]['length']===0x0)return;if(_0x2ef61f[_0x271e('0x5b')][_0x271e('0x84')][0x0][_0x271e('0x85')]!==_0x271e('0x86'))return;return db[_0x271e('0x87')]['update']({'read':!![],'readAt':_0x2ef61f[_0x271e('0x5b')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x2ef61f[_0x271e('0x5b')][_0x271e('0x84')][0x0][_0x271e('0x88')]},'individualHooks':!![]})[_0x271e('0x36')](function(_0xf5ebac){return _0x491304[_0x271e('0x2c')](0xc8)['json'](_0xf5ebac);});}_0x5d9430[_0x271e('0x89')]=_[_0x271e('0x8a')](_0x4d8b60['Applications'],[_0x271e('0x80')],[_0x271e('0x8b')]);if(_0x5d9430['account']['Applications']){delete _0x5d9430[_0x271e('0x83')][_0x271e('0x82')];}return db[_0x271e('0x8c')][_0x271e('0x64')]()['then'](function(_0x53e56d){if(!_0x53e56d){throw new db[(_0x271e('0x8d'))][(_0x271e('0x8e'))]('no\x20available\x20attributes');}_0x494a7e=_[_0x271e('0x8f')](_[_0x271e('0x43')](_0x53e56d),[_0x271e('0x90'),_0x271e('0x91')]);_0x170cc9=_[_0x271e('0x8f')](_[_0x271e('0x43')](_0x53e56d),['createdAt','updatedAt',_0x271e('0x92'),_0x271e('0x93')]);_0x5d9430[_0x271e('0x5b')]={'mapKey':_0x271e('0x94')};if(_0x5d9430[_0x271e('0x83')]&&_0x5d9430[_0x271e('0x83')][_0x271e('0x40')]==='twilio'){_0x5d9430[_0x271e('0x5b')][_0x271e('0x95')]=_0x2ef61f[_0x271e('0x5b')][_0x271e('0x96')][_0x271e('0x97')]('whatsapp:','');_0x5d9430[_0x271e('0x5b')]['body']=_0x2ef61f['body']['Body'];_0x5d9430[_0x271e('0x5b')][_0x271e('0x98')]=_0x2ef61f['body'][_0x271e('0x99')];}if(_0x5d9430[_0x271e('0x83')]&&_0x5d9430['account'][_0x271e('0x40')]===_0x271e('0x9a')){_0x5d9430[_0x271e('0x5b')][_0x271e('0x95')]=_0x2ef61f[_0x271e('0x5b')][_0x271e('0x9b')][0x0]['from'];_0x5d9430[_0x271e('0x5b')][_0x271e('0x5b')]=_0x2ef61f[_0x271e('0x5b')][_0x271e('0x9b')][0x0]['message']['body'];_0x5d9430['body'][_0x271e('0x98')]=_0x2ef61f[_0x271e('0x5b')][_0x271e('0x9b')][0x0][_0x271e('0x88')];}if(_0x5d9430[_0x271e('0x5b')]['id']){delete _0x5d9430[_0x271e('0x5b')]['id'];}if(_[_0x271e('0x9c')](_0x5d9430['body'][_0x271e('0x95')])){throw new db['Sequelize'][(_0x271e('0x8e'))](_0x271e('0x9d'));}if(_[_0x271e('0x9c')](_0x5d9430['body'][_0x271e('0x5b')])||_0x5d9430[_0x271e('0x5b')][_0x271e('0x5b')]===''){throw new db['Sequelize'][(_0x271e('0x8e'))](_0x271e('0x9e'));}if(_[_0x271e('0x9c')](_0x5d9430['body'][_0x271e('0x9f')])){throw new db[(_0x271e('0x8d'))][(_0x271e('0x8e'))](_0x271e('0xa0')+_0x170cc9);}if(!_[_0x271e('0xa1')](_0x170cc9,_0x5d9430['body'][_0x271e('0x9f')])){throw new db[(_0x271e('0x8d'))]['ValidationError'](_0x271e('0xa2')+_0x170cc9);}_0x456070[_0x5d9430['body']['mapKey']]=_0x5d9430[_0x271e('0x5b')][_0x271e('0x95')];return db[_0x271e('0xa3')][_0x271e('0x59')]({'where':{'id':_0x5d9430[_0x271e('0x83')][_0x271e('0x93')]},'include':[{'model':db[_0x271e('0x8c')],'as':_0x271e('0xa4'),'where':_0x456070,'limit':0x1,'order':[[_0x271e('0x91'),'DESC']]}]});})[_0x271e('0x36')](handleEntityNotFound(_0x491304,null))[_0x271e('0x36')](function(_0x386654){if(_0x386654){_0x5d9430[_0x271e('0xa5')]=_[_0x271e('0x72')](_0x386654,[_0x271e('0xa4')]);if(_0x386654[_0x271e('0xa4')]['length']){return _0x386654[_0x271e('0xa4')][0x0];}var _0x47b7f6=_['defaults'](_0x5d9430[_0x271e('0x5b')],{'firstName':_0x5d9430[_0x271e('0x5b')][_0x271e('0x95')],'ListId':_0x386654['id']});_0x47b7f6[_0x5d9430['body'][_0x271e('0x9f')]]=_0x5d9430[_0x271e('0x5b')][_0x271e('0x95')];return db[_0x271e('0x8c')][_0x271e('0x5a')](_0x47b7f6,{'fields':_0x494a7e,'raw':!![]});}})[_0x271e('0x36')](handleEntityNotFound(_0x491304,null))[_0x271e('0x36')](function(_0x5e283e){if(_0x5e283e){_0x5d9430[_0x271e('0xa6')]=_0x5e283e;var _0x3ce91a={'ContactId':_0x5e283e['id'],'phone':_0x5d9430[_0x271e('0x5b')][_0x271e('0x95')],'WhatsappAccountId':_0x2ef61f[_0x271e('0x54')]['id']};var _0xd23a96={'ContactId':_0x5e283e['id'],'WhatsappAccountId':_0x2ef61f[_0x271e('0x54')]['id'],'closed':![]};return db[_0x271e('0xa7')][_0x271e('0x59')]({'where':_0xd23a96})[_0x271e('0x36')](function(_0x1be5d6){if(_0x1be5d6){return[_0x1be5d6,![]];}return db['WhatsappInteraction'][_0x271e('0x5a')](_0x3ce91a)['then'](function(_0x26ff4e){return[_0x26ff4e,!![]];});});}})[_0x271e('0x73')](function(_0x508be1,_0x3d7b82){_0x5d9430[_0x271e('0xa8')]=_0x508be1[_0x271e('0x5d')]({'plain':!![]});_0x5d9430[_0x271e('0xa8')][_0x271e('0xa9')]=![];if(_0x3d7b82){if(_0x5d9430[_0x271e('0x83')][_0x271e('0xaa')]){_0x5d9430[_0x271e('0x89')][_0x271e('0xab')]({'id':0x0,'priority':_0x5d9430[_0x271e('0x89')][_0x271e('0x48')]+0x1,'app':_0x271e('0xac'),'appdata':_0x271e('0xad'),'interval':'*,*,*,*'});}_0x5d9430['interaction'][_0x271e('0xa9')]=!![];}return db[_0x271e('0x87')][_0x271e('0x5a')]({'phone':_0x5d9430['body'][_0x271e('0x95')],'messageId':_0x5d9430[_0x271e('0x5b')][_0x271e('0x98')],'body':_0x5d9430['body'][_0x271e('0x5b')],'WhatsappAccountId':_0x2ef61f[_0x271e('0x54')]['id'],'WhatsappInteractionId':_0x508be1['id'],'direction':'in','ContactId':_0x508be1[_0x271e('0xae')],'AttachmentId':_0x5d9430[_0x271e('0x5b')]['AttachmentId']});})[_0x271e('0x36')](function(_0x12a46d){_0x5d9430[_0x271e('0x27')]=_0x12a46d;if(_0x5d9430[_0x271e('0xa8')][_0x271e('0xaf')]){return db[_0x271e('0x79')][_0x271e('0x59')]({'attributes':['id',_0x271e('0x3b')],'where':{'id':_0x5d9430[_0x271e('0xa8')][_0x271e('0xaf')]}})['then'](function(_0x3597e7){if(_0x3597e7){_0x5d9430['applications'][_0x271e('0xb0')]({'id':0x0,'priority':0x0,'app':_0x271e('0xb1'),'appdata':_0x3597e7[_0x271e('0x3b')]+','+(_0x5d9430['account'][_0x271e('0xb2')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x271e('0xb3'),'startRouting',_0x5d9430);});}return respondWithRpcPromise('Start',_0x271e('0xb4'),_0x5d9430);})[_0x271e('0x36')](function(_0x4d66da){if(_0x4d66da){var _0x56472f=0xc8;var _0x3bd561=_0x271e('0xb5');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3bd561,_0x56472f,_0x271e('0xb6'));logger[_0x271e('0x23')](_0x271e('0xb7'),_0x3bd561,_0x56472f,_0x271e('0xb6'),JSON[_0x271e('0xb8')](_0x4d66da));if(_0x5d9430[_0x271e('0x83')][_0x271e('0x40')]==='twilio'){return _0x491304['status'](_0x56472f)[_0x271e('0x33')](_0x271e('0xb9'),_0x271e('0xba'))[_0x271e('0x3c')]('\x0a');}else{return _0x491304[_0x271e('0x2c')](_0x56472f)[_0x271e('0x2e')](_0x4d66da);}}});})[_0x271e('0x2a')](handleError(_0x491304,null));};exports['send']=function(_0x470eab,_0x403436,_0x164145){var _0x1aea5b,_0x488694,_0x15c6d4;if(_[_0x271e('0x9c')](_0x470eab[_0x271e('0x5b')][_0x271e('0x5b')])||_0x470eab[_0x271e('0x5b')][_0x271e('0x5b')]===''){throw new db['Sequelize'][(_0x271e('0x8e'))](_0x271e('0x9e'));}if(_[_0x271e('0x9c')](_0x470eab['body']['to'])){throw new db[(_0x271e('0x8d'))][(_0x271e('0x8e'))]('to\x20is\x20mandatory');}_0x1aea5b=_0x470eab[_0x271e('0x5b')]['to'];return db[_0x271e('0x3f')]['find']({'where':{'id':_0x470eab[_0x271e('0x54')]['id']},'include':[{'model':db[_0x271e('0xa3')],'as':_0x271e('0xbb'),'include':[{'model':db['CmContact'],'as':_0x271e('0xa4'),'where':{'mobile':_0x1aea5b},'limit':0x1,'order':[[_0x271e('0x91'),_0x271e('0xbc')]]}]}]})[_0x271e('0x36')](handleEntityNotFound(_0x403436,null))['then'](function(_0x333d1e){if(_0x333d1e&&_0x333d1e[_0x271e('0xbb')]){_0x488694=_0x333d1e[_0x271e('0x5d')]({'plain':!![]});if(_0x488694[_0x271e('0xbb')]&&_0x488694[_0x271e('0xbb')][_0x271e('0xa4')][_0x271e('0x48')]){return _0x488694[_0x271e('0xbb')][_0x271e('0xa4')][0x0];}return db[_0x271e('0x8c')][_0x271e('0x5a')](_[_0x271e('0x1a')](_0x470eab[_0x271e('0x5b')],{'firstName':_0x1aea5b,'mobile':_0x1aea5b,'phone':_0x1aea5b,'ListId':_0x488694[_0x271e('0x93')]}));}})[_0x271e('0x36')](handleEntityNotFound(_0x403436,null))[_0x271e('0x36')](function(_0x14c53c){if(_0x14c53c){_0x15c6d4=_0x14c53c;return db[_0x271e('0xa7')][_0x271e('0x59')]({'where':{'ContactId':_0x15c6d4['id'],'closed':![],'WhatsappAccountId':_0x488694['id']}})[_0x271e('0x36')](function(_0x55cb11){if(_0x55cb11){return[_0x55cb11,![]];}return db[_0x271e('0xa7')][_0x271e('0x5a')]({'UserId':_0x470eab[_0x271e('0x5c')]['id'],'ContactId':_0x15c6d4['id'],'WhatsappAccountId':_0x488694['id'],'phone':_0x1aea5b,'firstMsgDirection':_0x271e('0xbd'),'Messages':[_[_0x271e('0x4e')](_0x470eab['body'],{'read':![],'body':_0x470eab[_0x271e('0x5b')]['body'],'phone':_0x1aea5b,'WhatsappAccountId':_0x488694['id'],'UserId':_0x470eab[_0x271e('0x5c')]['id'],'ContactId':_0x15c6d4['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x271e('0xbe')}]})[_0x271e('0x36')](function(_0x255772){return[_0x255772,!![]];});});}})[_0x271e('0x73')](function(_0x53b337,_0x309a78){if(_0x309a78){return _0x53b337;}return db[_0x271e('0x87')]['create'](_['merge'](_0x470eab[_0x271e('0x5b')],{'read':![],'body':_0x470eab[_0x271e('0x5b')][_0x271e('0x5b')],'phone':_0x1aea5b,'WhatsappAccountId':_0x488694['id'],'WhatsappInteractionId':_0x53b337['id'],'UserId':_0x470eab[_0x271e('0x5c')]['id'],'ContactId':_0x15c6d4['id']}))[_0x271e('0x36')](function(_0x282e8e){_0x53b337[_0x271e('0xbf')]['Messages']=[];_0x53b337[_0x271e('0xbf')][_0x271e('0xbe')][_0x271e('0xab')](_0x282e8e[_0x271e('0xbf')]);return _0x53b337;});})[_0x271e('0x36')](respondWithResult(_0x403436,null))[_0x271e('0x2a')](handleError(_0x403436,null));}; \ No newline at end of file +var _0xa98b=['updatedAt','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','sinch','notifications','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','debug','entity\x20found','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','spread','dataValues','Messages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./whatsappAccount.socket','jayson/promise','client','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','priority','asc','Sequelize','ValidationError','difference','createdAt'];(function(_0x460d3c,_0x3786ee){var _0x205e7e=function(_0x1009eb){while(--_0x1009eb){_0x460d3c['push'](_0x460d3c['shift']());}};_0x205e7e(++_0x3786ee);}(_0xa98b,0x1aa));var _0xba98=function(_0x1705a9,_0x19c42b){_0x1705a9=_0x1705a9-0x0;var _0x9cc5d0=_0xa98b[_0x1705a9];return _0x9cc5d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba98('0x0'));var zipdir=require(_0xba98('0x1'));var jsonpatch=require(_0xba98('0x2'));var rp=require(_0xba98('0x3'));var moment=require(_0xba98('0x4'));var BPromise=require(_0xba98('0x5'));var Mustache=require('mustache');var util=require(_0xba98('0x6'));var path=require(_0xba98('0x7'));var sox=require(_0xba98('0x8'));var csv=require(_0xba98('0x9'));var ejs=require(_0xba98('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba98('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba98('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xba98('0xd'));var Papa=require(_0xba98('0xe'));var Redis=require(_0xba98('0xf'));var authService=require(_0xba98('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba98('0x11'));var hardwareService=require(_0xba98('0x12'));var logger=require(_0xba98('0x13'))(_0xba98('0x14'));var utils=require(_0xba98('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xba98('0x16'));var db=require(_0xba98('0x17'))['db'];config['redis']=_[_0xba98('0x18')](config[_0xba98('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba98('0x19')]));require(_0xba98('0x1a'))['register'](socket);var jayson=require(_0xba98('0x1b'));var client=jayson[_0xba98('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x94247a,_0x4097c2,_0x5ccd7e,_0xaf7303){return new BPromise(function(_0x3add77,_0x29efce){var _0x1f7488=_0xaf7303||client;return _0x1f7488['request'](_0x94247a,_0x5ccd7e)[_0xba98('0x1d')](function(_0x389fb6){logger['info'](_0xba98('0x1e'),_0x4097c2,_0xba98('0x1f'));logger['debug'](_0xba98('0x20'),_0x4097c2,'request\x20sent',JSON[_0xba98('0x21')](_0x389fb6));if(_0x389fb6[_0xba98('0x22')]){if(_0x389fb6[_0xba98('0x22')][_0xba98('0x23')]===0x1f4){logger[_0xba98('0x22')](_0xba98('0x1e'),_0x4097c2,_0x389fb6[_0xba98('0x22')][_0xba98('0x24')]);return _0x29efce(_0x389fb6['error'][_0xba98('0x24')]);}logger[_0xba98('0x22')](_0xba98('0x1e'),_0x4097c2,_0x389fb6[_0xba98('0x22')][_0xba98('0x24')]);return _0x3add77(_0x389fb6[_0xba98('0x22')][_0xba98('0x24')]);}else{logger[_0xba98('0x25')](_0xba98('0x1e'),_0x4097c2,_0xba98('0x1f'));_0x3add77(_0x389fb6[_0xba98('0x26')][_0xba98('0x24')]);}})[_0xba98('0x27')](function(_0x52453d){logger['error'](_0xba98('0x1e'),_0x4097c2,_0x52453d);_0x29efce(_0x52453d);});});}function respondWithStatusCode(_0x3c9e8d,_0xfd1c9b){_0xfd1c9b=_0xfd1c9b||0xcc;return function(_0xe8755){if(_0xe8755){return _0x3c9e8d[_0xba98('0x28')](_0xfd1c9b);}return _0x3c9e8d[_0xba98('0x29')](_0xfd1c9b)[_0xba98('0x2a')]();};}function respondWithResult(_0x5a8edc,_0x278568){_0x278568=_0x278568||0xc8;return function(_0x10e394){if(_0x10e394){return _0x5a8edc[_0xba98('0x29')](_0x278568)[_0xba98('0x2b')](_0x10e394);}};}function respondWithFilteredResult(_0x1e4725,_0x1dc6ff){return function(_0x17b7d2){if(_0x17b7d2){var _0x5824ff=typeof _0x1dc6ff[_0xba98('0x2c')]===_0xba98('0x2d')&&typeof _0x1dc6ff[_0xba98('0x2e')]===_0xba98('0x2d');var _0x156474=_0x17b7d2['count'];var _0x8c7bd9=_0x5824ff?0x0:_0x1dc6ff[_0xba98('0x2c')];var _0x3cdfbe=_0x5824ff?_0x17b7d2[_0xba98('0x2f')]:_0x1dc6ff[_0xba98('0x2c')]+_0x1dc6ff[_0xba98('0x2e')];var _0x275fde;if(_0x3cdfbe>=_0x156474){_0x3cdfbe=_0x156474;_0x275fde=0xc8;}else{_0x275fde=0xce;}_0x1e4725['status'](_0x275fde);return _0x1e4725[_0xba98('0x30')]('Content-Range',_0x8c7bd9+'-'+_0x3cdfbe+'/'+_0x156474)[_0xba98('0x2b')](_0x17b7d2);}return null;};}function patchUpdates(_0x25cc96){return function(_0x5b5fc6){try{jsonpatch['apply'](_0x5b5fc6,_0x25cc96,!![]);}catch(_0x55a80d){return BPromise[_0xba98('0x31')](_0x55a80d);}return _0x5b5fc6[_0xba98('0x32')]();};}function saveUpdates(_0x4e5763,_0x5c1e80){return function(_0x33faa6){if(_0x33faa6){return _0x33faa6[_0xba98('0x33')](_0x4e5763)[_0xba98('0x1d')](function(_0x55c6d6){return _0x55c6d6;});}return null;};}function removeEntity(_0x52dbf9,_0x451572){return function(_0x4f1202){if(_0x4f1202){return _0x4f1202[_0xba98('0x34')]()['then'](function(){var _0x13d580=_0x4f1202[_0xba98('0x35')]({'plain':!![]});var _0x5a0e05='WhatsappAccounts';return db[_0xba98('0x36')][_0xba98('0x34')]({'where':{'type':_0x5a0e05,'resourceId':_0x13d580['id']}})['then'](function(){return _0x4f1202;});})[_0xba98('0x1d')](function(){_0x52dbf9['status'](0xcc)[_0xba98('0x2a')]();});}};}function handleEntityNotFound(_0xd91e80,_0x17bcdf){return function(_0x2b9066){if(!_0x2b9066){_0xd91e80[_0xba98('0x28')](0x194);}return _0x2b9066;};}function handleError(_0x1d5791,_0x596a9e){_0x596a9e=_0x596a9e||0x1f4;return function(_0x4046be){logger[_0xba98('0x22')](_0x4046be[_0xba98('0x37')]);if(_0x4046be[_0xba98('0x38')]){delete _0x4046be[_0xba98('0x38')];}_0x1d5791[_0xba98('0x29')](_0x596a9e)[_0xba98('0x39')](_0x4046be);};}exports['index']=function(_0x3e6a08,_0x33ff21){var _0x1df007={'include':[{'model':db[_0xba98('0x3a')],'as':_0xba98('0x3b')}]},_0x367d79={},_0x35cead={'count':0x0,'rows':[]};var _0x2b23ca=_[_0xba98('0x3c')](db[_0xba98('0x3d')]['rawAttributes'],function(_0x1415ef){return{'name':_0x1415ef[_0xba98('0x3e')],'type':_0x1415ef[_0xba98('0x3f')]['key']};});_0x367d79[_0xba98('0x40')]=_[_0xba98('0x3c')](_0x2b23ca,_0xba98('0x38'));_0x367d79[_0xba98('0x41')]=_[_0xba98('0x42')](_0x3e6a08[_0xba98('0x41')]);_0x367d79[_0xba98('0x43')]=_[_0xba98('0x44')](_0x367d79[_0xba98('0x40')],_0x367d79['query']);_0x1df007[_0xba98('0x45')]=_['intersection'](_0x367d79[_0xba98('0x40')],qs[_0xba98('0x46')](_0x3e6a08[_0xba98('0x41')][_0xba98('0x46')]));_0x1df007[_0xba98('0x45')]=_0x1df007[_0xba98('0x45')][_0xba98('0x47')]?_0x1df007['attributes']:_0x367d79[_0xba98('0x40')];if(!_0x3e6a08[_0xba98('0x41')][_0xba98('0x48')]('nolimit')){_0x1df007[_0xba98('0x2e')]=qs[_0xba98('0x2e')](_0x3e6a08[_0xba98('0x41')][_0xba98('0x2e')]);_0x1df007[_0xba98('0x2c')]=qs[_0xba98('0x2c')](_0x3e6a08[_0xba98('0x41')]['offset']);}_0x1df007[_0xba98('0x49')]=qs[_0xba98('0x4a')](_0x3e6a08[_0xba98('0x41')][_0xba98('0x4a')]);_0x1df007[_0xba98('0x4b')]=qs[_0xba98('0x43')](_[_0xba98('0x4c')](_0x3e6a08['query'],_0x367d79[_0xba98('0x43')]),_0x2b23ca);if(_0x3e6a08[_0xba98('0x41')][_0xba98('0x4d')]){_0x1df007[_0xba98('0x4b')]=_[_0xba98('0x4e')](_0x1df007[_0xba98('0x4b')],{'$or':_['map'](_0x2b23ca,function(_0x536ff7){if(_0x536ff7[_0xba98('0x3f')]!=='VIRTUAL'){var _0xbf26a3={};_0xbf26a3[_0x536ff7['name']]={'$like':'%'+_0x3e6a08['query'][_0xba98('0x4d')]+'%'};return _0xbf26a3;}})});}_0x1df007=_['merge']({},_0x1df007,_0x3e6a08[_0xba98('0x4f')]);var _0x47424d={'where':_0x1df007['where']};return db[_0xba98('0x3d')]['count'](_0x47424d)[_0xba98('0x1d')](function(_0x264e02){_0x35cead[_0xba98('0x2f')]=_0x264e02;if(_0x3e6a08[_0xba98('0x41')][_0xba98('0x50')]){_0x1df007['include']=[{'all':!![]}];}return db[_0xba98('0x3d')][_0xba98('0x51')](_0x1df007);})[_0xba98('0x1d')](function(_0x3eed21){_0x35cead[_0xba98('0x52')]=_0x3eed21;return _0x35cead;})[_0xba98('0x1d')](respondWithFilteredResult(_0x33ff21,_0x1df007))['catch'](handleError(_0x33ff21,null));};exports[_0xba98('0x53')]=function(_0x1cdeec,_0x475314){var _0x2c6103={'raw':![],'where':{'id':_0x1cdeec[_0xba98('0x54')]['id']},'include':[{'model':db[_0xba98('0x3a')],'as':_0xba98('0x3b')}]},_0xc0abe0={};_0xc0abe0[_0xba98('0x40')]=_[_0xba98('0x42')](db[_0xba98('0x3d')][_0xba98('0x55')]);_0xc0abe0[_0xba98('0x41')]=_[_0xba98('0x42')](_0x1cdeec[_0xba98('0x41')]);_0xc0abe0[_0xba98('0x43')]=_[_0xba98('0x44')](_0xc0abe0[_0xba98('0x40')],_0xc0abe0['query']);_0x2c6103[_0xba98('0x45')]=_[_0xba98('0x44')](_0xc0abe0[_0xba98('0x40')],qs[_0xba98('0x46')](_0x1cdeec[_0xba98('0x41')][_0xba98('0x46')]));_0x2c6103[_0xba98('0x45')]=_0x2c6103[_0xba98('0x45')][_0xba98('0x47')]?_0x2c6103[_0xba98('0x45')]:_0xc0abe0['model'];if(_0x1cdeec[_0xba98('0x41')][_0xba98('0x50')]){_0x2c6103[_0xba98('0x56')]=[{'all':!![]}];}_0x2c6103=_[_0xba98('0x4e')]({},_0x2c6103,_0x1cdeec[_0xba98('0x4f')]);return db[_0xba98('0x3d')][_0xba98('0x57')](_0x2c6103)[_0xba98('0x1d')](handleEntityNotFound(_0x475314,null))['then'](respondWithResult(_0x475314,null))['catch'](handleError(_0x475314,null));};exports['create']=function(_0x4a53f3,_0x3307be){return db[_0xba98('0x3d')]['create'](_0x4a53f3[_0xba98('0x58')],{})[_0xba98('0x1d')](function(_0x2ab218){var _0xa9a8fd=_0x4a53f3[_0xba98('0x59')][_0xba98('0x35')]({'plain':!![]});if(!_0xa9a8fd)throw new Error(_0xba98('0x5a'));if(_0xa9a8fd['role']===_0xba98('0x59')){var _0x3e91d8=_0x2ab218['get']({'plain':!![]});var _0x396e62='WhatsappAccounts';return db['UserProfileSection'][_0xba98('0x57')]({'where':{'name':_0x396e62,'userProfileId':_0xa9a8fd[_0xba98('0x5b')]},'raw':!![]})['then'](function(_0x5b9aaf){if(_0x5b9aaf&&_0x5b9aaf[_0xba98('0x5c')]===0x0){return db['UserProfileResource'][_0xba98('0x5d')]({'name':_0x3e91d8['name'],'resourceId':_0x3e91d8['id'],'type':_0x5b9aaf[_0xba98('0x38')],'sectionId':_0x5b9aaf['id']},{})['then'](function(){return _0x2ab218;});}else{return _0x2ab218;}})[_0xba98('0x27')](function(_0x5ae2e3){logger['error'](_0xba98('0x5e'),_0x5ae2e3);throw _0x5ae2e3;});}return _0x2ab218;})[_0xba98('0x1d')](respondWithResult(_0x3307be,0xc9))[_0xba98('0x27')](handleError(_0x3307be,null));};exports[_0xba98('0x33')]=function(_0x148a54,_0x36962f){if(_0x148a54['body']['id']){delete _0x148a54[_0xba98('0x58')]['id'];}return db[_0xba98('0x3d')][_0xba98('0x57')]({'where':{'id':_0x148a54['params']['id']},'include':[{'model':db[_0xba98('0x3a')],'as':_0xba98('0x3b')}]})[_0xba98('0x1d')](handleEntityNotFound(_0x36962f,null))[_0xba98('0x1d')](saveUpdates(_0x148a54[_0xba98('0x58')],null))[_0xba98('0x1d')](respondWithResult(_0x36962f,null))[_0xba98('0x27')](handleError(_0x36962f,null));};exports[_0xba98('0x34')]=function(_0x11acec,_0x1548bc){return db[_0xba98('0x3d')][_0xba98('0x57')]({'where':{'id':_0x11acec[_0xba98('0x54')]['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x1548bc,null))[_0xba98('0x1d')](removeEntity(_0x1548bc,null))['catch'](handleError(_0x1548bc,null));};exports[_0xba98('0x5f')]=function(_0x9226bd,_0x4be104){return db['WhatsappAccount'][_0xba98('0x5f')]()[_0xba98('0x1d')](respondWithResult(_0x4be104,null))[_0xba98('0x27')](handleError(_0x4be104,null));};exports[_0xba98('0x60')]=function(_0x23cd5b,_0x3582d7,_0x45e547){if(_0x23cd5b[_0xba98('0x58')]['id']){delete _0x23cd5b[_0xba98('0x58')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x23cd5b['params']['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x3582d7,null))[_0xba98('0x1d')](function(_0x4fc55a){if(_0x4fc55a){_0x23cd5b[_0xba98('0x58')][_0xba98('0x61')]=_0x4fc55a['id'];return db[_0xba98('0x62')][_0xba98('0x5d')](_0x23cd5b[_0xba98('0x58')]);}})[_0xba98('0x1d')](respondWithResult(_0x3582d7,null))[_0xba98('0x27')](handleError(_0x3582d7,null));};exports[_0xba98('0x63')]=function(_0x523017,_0x1a0b0c,_0x2e1efd){var _0x6c8b8c={'raw':![],'where':{}};var _0x1d66dd={};var _0x5733a2={'count':0x0,'rows':[]};return db[_0xba98('0x3d')][_0xba98('0x64')]({'where':{'id':_0x523017[_0xba98('0x54')]['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x1a0b0c,null))[_0xba98('0x1d')](function(_0xff90ac){if(_0xff90ac){_0x1d66dd[_0xba98('0x40')]=_[_0xba98('0x42')](db[_0xba98('0x62')][_0xba98('0x55')]);_0x1d66dd[_0xba98('0x41')]=_[_0xba98('0x42')](_0x523017[_0xba98('0x41')]);_0x1d66dd[_0xba98('0x43')]=_[_0xba98('0x44')](_0x1d66dd['model'],_0x1d66dd['query']);_0x6c8b8c[_0xba98('0x45')]=_['intersection'](_0x1d66dd[_0xba98('0x40')],qs[_0xba98('0x46')](_0x523017[_0xba98('0x41')][_0xba98('0x46')]));_0x6c8b8c['attributes']=_0x6c8b8c[_0xba98('0x45')][_0xba98('0x47')]?_0x6c8b8c[_0xba98('0x45')]:_0x1d66dd['model'];if(!_0x523017['query'][_0xba98('0x48')](_0xba98('0x65'))){_0x6c8b8c[_0xba98('0x2e')]=qs[_0xba98('0x2e')](_0x523017[_0xba98('0x41')][_0xba98('0x2e')]);_0x6c8b8c[_0xba98('0x2c')]=qs['offset'](_0x523017['query'][_0xba98('0x2c')]);}_0x6c8b8c[_0xba98('0x49')]=qs[_0xba98('0x4a')](_0x523017['query'][_0xba98('0x4a')]);_0x6c8b8c[_0xba98('0x4b')]=qs[_0xba98('0x43')](_[_0xba98('0x4c')](_0x523017[_0xba98('0x41')],_0x1d66dd[_0xba98('0x43')]));_0x6c8b8c[_0xba98('0x4b')][_0xba98('0x61')]=_0xff90ac['id'];if(_0x523017['query']['filter']){_0x6c8b8c[_0xba98('0x4b')]=_[_0xba98('0x4e')](_0x6c8b8c[_0xba98('0x4b')],{'$or':_[_0xba98('0x3c')](_0x6c8b8c[_0xba98('0x45')],function(_0x273e2f){var _0xf70a3c={};_0xf70a3c[_0x273e2f]={'$like':'%'+_0x523017[_0xba98('0x41')][_0xba98('0x4d')]+'%'};return _0xf70a3c;})});}_0x6c8b8c=_[_0xba98('0x4e')]({},_0x6c8b8c,_0x523017['options']);return db[_0xba98('0x62')][_0xba98('0x2f')]({'where':_0x6c8b8c['where']})['then'](function(_0x3620e7){_0x5733a2[_0xba98('0x2f')]=_0x3620e7;if(_0x523017[_0xba98('0x41')][_0xba98('0x50')]){_0x6c8b8c[_0xba98('0x56')]=[{'all':!![]}];}return db[_0xba98('0x62')]['findAll'](_0x6c8b8c);})[_0xba98('0x1d')](function(_0x699679){_0x5733a2[_0xba98('0x52')]=_0x699679;return _0x5733a2;});}})['then'](respondWithFilteredResult(_0x1a0b0c,_0x6c8b8c))['catch'](handleError(_0x1a0b0c,null));};exports[_0xba98('0x66')]=function(_0x37cffa,_0x27bb0e,_0x484bb3){return db[_0xba98('0x3d')][_0xba98('0x57')]({'where':{'id':_0x37cffa[_0xba98('0x54')]['id']}})['then'](handleEntityNotFound(_0x27bb0e,null))[_0xba98('0x1d')](function(_0x2c25bf){if(_0x2c25bf){return _0x2c25bf[_0xba98('0x66')](_0x37cffa['query']['ids']);}})[_0xba98('0x1d')](respondWithStatusCode(_0x27bb0e,null))[_0xba98('0x27')](handleError(_0x27bb0e,null));};exports[_0xba98('0x67')]=function(_0x5710a2,_0x110bdb,_0x4d385d){if(_0x5710a2['body']['id']){delete _0x5710a2[_0xba98('0x58')]['id'];}return db[_0xba98('0x3d')]['find']({'where':{'id':_0x5710a2[_0xba98('0x54')]['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x110bdb,null))['then'](function(_0x427a97){if(_0x427a97){_0x5710a2[_0xba98('0x58')][_0xba98('0x61')]=_0x427a97['id'];return db['CannedAnswer'][_0xba98('0x5d')](_0x5710a2[_0xba98('0x58')]);}})[_0xba98('0x1d')](respondWithResult(_0x110bdb,null))[_0xba98('0x27')](handleError(_0x110bdb,null));};exports[_0xba98('0x68')]=function(_0x6c2734,_0x18ea70,_0x4ccf1e){var _0x7cc007={'raw':![],'where':{}};var _0x1b7eca={};var _0x5d4965={'count':0x0,'rows':[]};return db[_0xba98('0x3d')][_0xba98('0x64')]({'where':{'id':_0x6c2734[_0xba98('0x54')]['id']}})['then'](handleEntityNotFound(_0x18ea70,null))[_0xba98('0x1d')](function(_0xbb8101){if(_0xbb8101){_0x1b7eca['model']=_[_0xba98('0x42')](db[_0xba98('0x69')][_0xba98('0x55')]);_0x1b7eca[_0xba98('0x41')]=_[_0xba98('0x42')](_0x6c2734['query']);_0x1b7eca[_0xba98('0x43')]=_['intersection'](_0x1b7eca[_0xba98('0x40')],_0x1b7eca[_0xba98('0x41')]);_0x7cc007['attributes']=_[_0xba98('0x44')](_0x1b7eca[_0xba98('0x40')],qs[_0xba98('0x46')](_0x6c2734[_0xba98('0x41')][_0xba98('0x46')]));_0x7cc007[_0xba98('0x45')]=_0x7cc007[_0xba98('0x45')][_0xba98('0x47')]?_0x7cc007['attributes']:_0x1b7eca[_0xba98('0x40')];if(!_0x6c2734['query'][_0xba98('0x48')](_0xba98('0x65'))){_0x7cc007[_0xba98('0x2e')]=qs['limit'](_0x6c2734['query']['limit']);_0x7cc007[_0xba98('0x2c')]=qs[_0xba98('0x2c')](_0x6c2734[_0xba98('0x41')][_0xba98('0x2c')]);}_0x7cc007[_0xba98('0x49')]=qs[_0xba98('0x4a')](_0x6c2734[_0xba98('0x41')][_0xba98('0x4a')]);_0x7cc007['where']=qs['filters'](_[_0xba98('0x4c')](_0x6c2734[_0xba98('0x41')],_0x1b7eca[_0xba98('0x43')]));_0x7cc007[_0xba98('0x4b')][_0xba98('0x61')]=_0xbb8101['id'];if(_0x6c2734[_0xba98('0x41')]['filter']){_0x7cc007[_0xba98('0x4b')]=_[_0xba98('0x4e')](_0x7cc007['where'],{'$or':_['map'](_0x7cc007[_0xba98('0x45')],function(_0x44299b){var _0x41f342={};_0x41f342[_0x44299b]={'$like':'%'+_0x6c2734[_0xba98('0x41')]['filter']+'%'};return _0x41f342;})});}_0x7cc007=_['merge']({},_0x7cc007,_0x6c2734['options']);return db[_0xba98('0x69')][_0xba98('0x2f')]({'where':_0x7cc007[_0xba98('0x4b')]})[_0xba98('0x1d')](function(_0x3d1cc7){_0x5d4965[_0xba98('0x2f')]=_0x3d1cc7;if(_0x6c2734[_0xba98('0x41')][_0xba98('0x50')]){_0x7cc007[_0xba98('0x56')]=[{'all':!![]}];}return db[_0xba98('0x69')][_0xba98('0x51')](_0x7cc007);})[_0xba98('0x1d')](function(_0x5d1df9){_0x5d4965[_0xba98('0x52')]=_0x5d1df9;return _0x5d4965;});}})[_0xba98('0x1d')](respondWithFilteredResult(_0x18ea70,_0x7cc007))['catch'](handleError(_0x18ea70,null));};exports[_0xba98('0x6a')]=function(_0x5db97b,_0x20c17f,_0x96917d){return db[_0xba98('0x3d')][_0xba98('0x57')]({'where':{'id':_0x5db97b[_0xba98('0x54')]['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x20c17f,null))[_0xba98('0x1d')](function(_0x4f4397){if(_0x4f4397){return _0x4f4397[_0xba98('0x6a')](_0x5db97b['query']['ids']);}})[_0xba98('0x1d')](respondWithStatusCode(_0x20c17f,null))[_0xba98('0x27')](handleError(_0x20c17f,null));};exports['addAgents']=function(_0x1dcdd3,_0x571637,_0x2e4fa4){return db[_0xba98('0x3d')][_0xba98('0x57')]({'where':{'id':_0x1dcdd3['params']['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x571637,null))[_0xba98('0x1d')](function(_0x2a4ba7){if(_0x2a4ba7){return _0x2a4ba7['addAgents'](_0x1dcdd3[_0xba98('0x58')][_0xba98('0x6b')],_['omit'](_0x1dcdd3[_0xba98('0x58')],['ids','id'])||{})['spread'](function(_0x452893){for(var _0x400924=0x0;_0x400924<_0x1dcdd3['body'][_0xba98('0x6b')]['length'];_0x400924+=0x1){socket[_0xba98('0x6c')](_0xba98('0x6d'),{'UserId':Number(_0x1dcdd3['body'][_0xba98('0x6b')][_0x400924]),'WhatsappAccountId':Number(_0x1dcdd3['params']['id'])});}return _0x452893;});}})[_0xba98('0x1d')](respondWithResult(_0x571637,null))['catch'](handleError(_0x571637,null));};exports[_0xba98('0x6e')]=function(_0x296bfb,_0x5ed07c,_0x36ceeb){return db['WhatsappAccount'][_0xba98('0x57')]({'where':{'id':_0x296bfb['params']['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x5ed07c,null))[_0xba98('0x1d')](function(_0x33a992){if(_0x33a992){return _0x33a992[_0xba98('0x6e')](_0x296bfb[_0xba98('0x41')]['ids'])[_0xba98('0x1d')](function(){if(_['isArray'](_0x296bfb[_0xba98('0x41')][_0xba98('0x6b')])){for(var _0x40f92e=0x0;_0x40f92e<_0x296bfb[_0xba98('0x41')][_0xba98('0x6b')]['length'];_0x40f92e+=0x1){socket[_0xba98('0x6c')]('userWhatsappAccount:remove',{'UserId':Number(_0x296bfb[_0xba98('0x41')][_0xba98('0x6b')][_0x40f92e]),'WhatsappAccountId':Number(_0x296bfb[_0xba98('0x54')]['id'])});}}else{socket['emit'](_0xba98('0x6f'),{'UserId':Number(_0x296bfb[_0xba98('0x41')]['ids']),'WhatsappAccountId':Number(_0x296bfb[_0xba98('0x54')]['id'])});}});}})[_0xba98('0x1d')](respondWithStatusCode(_0x5ed07c,null))[_0xba98('0x27')](handleError(_0x5ed07c,null));};exports[_0xba98('0x70')]=function(_0x30f5a4,_0x23c789,_0x451675){var _0x3604dd={};var _0x25e685={};var _0x36093e;var _0x23f659;return db[_0xba98('0x3d')][_0xba98('0x64')]({'where':{'id':_0x30f5a4[_0xba98('0x54')]['id']}})[_0xba98('0x1d')](handleEntityNotFound(_0x23c789,null))[_0xba98('0x1d')](function(_0x378762){if(_0x378762){_0x36093e=_0x378762;_0x25e685['model']=_[_0xba98('0x42')](db[_0xba98('0x71')]['rawAttributes']);_0x25e685['query']=_[_0xba98('0x42')](_0x30f5a4[_0xba98('0x41')]);_0x25e685[_0xba98('0x43')]=_[_0xba98('0x44')](_0x25e685[_0xba98('0x40')],_0x25e685[_0xba98('0x41')]);_0x3604dd[_0xba98('0x45')]=_[_0xba98('0x44')](_0x25e685[_0xba98('0x40')],qs[_0xba98('0x46')](_0x30f5a4[_0xba98('0x41')][_0xba98('0x46')]));_0x3604dd[_0xba98('0x45')]=_0x3604dd['attributes'][_0xba98('0x47')]?_0x3604dd[_0xba98('0x45')]:_0x25e685['model'];_0x3604dd[_0xba98('0x49')]=qs[_0xba98('0x4a')](_0x30f5a4[_0xba98('0x41')][_0xba98('0x4a')]);_0x3604dd['where']=qs['filters'](_[_0xba98('0x4c')](_0x30f5a4[_0xba98('0x41')],_0x25e685[_0xba98('0x43')]));if(_0x30f5a4['query']['filter']){_0x3604dd[_0xba98('0x4b')]=_[_0xba98('0x4e')](_0x3604dd['where'],{'$or':_['map'](_0x3604dd[_0xba98('0x45')],function(_0x227b76){var _0x24eb14={};_0x24eb14[_0x227b76]={'$like':'%'+_0x30f5a4['query'][_0xba98('0x4d')]+'%'};return _0x24eb14;})});}_0x3604dd=_[_0xba98('0x4e')]({},_0x3604dd,_0x30f5a4[_0xba98('0x4f')]);return _0x36093e['getAgents'](_0x3604dd);}})[_0xba98('0x1d')](function(_0x5d527d){if(_0x5d527d){_0x23f659=_0x5d527d['length'];if(!_0x30f5a4[_0xba98('0x41')][_0xba98('0x48')](_0xba98('0x65'))){_0x3604dd[_0xba98('0x2e')]=qs[_0xba98('0x2e')](_0x30f5a4['query'][_0xba98('0x2e')]);_0x3604dd[_0xba98('0x2c')]=qs['offset'](_0x30f5a4[_0xba98('0x41')][_0xba98('0x2c')]);}return _0x36093e[_0xba98('0x70')](_0x3604dd);}})[_0xba98('0x1d')](function(_0x2bd5af){if(_0x2bd5af){return _0x2bd5af?{'count':_0x23f659,'rows':_0x2bd5af}:null;}})['then'](respondWithResult(_0x23c789,null))[_0xba98('0x27')](handleError(_0x23c789,null));};exports[_0xba98('0x72')]=function(_0x136060,_0x35d1f3){var _0x4a8e0f=_0x136060['params']['id'];var _0x5a2cac=_0x136060[_0xba98('0x58')];var _0x5a28b1=0xc8;var _0x589d7c=null;return db[_0xba98('0x73')][_0xba98('0x74')]({'isolationLevel':db[_0xba98('0x73')]['Transaction'][_0xba98('0x75')][_0xba98('0x76')]},function(_0x5e3ecf){return db[_0xba98('0x3d')][_0xba98('0x64')]({'where':{'id':_0x4a8e0f},'transaction':_0x5e3ecf})['then'](function(_0x46743a){if(_0x46743a){return db[_0xba98('0x77')][_0xba98('0x34')]({'where':{'WhatsappAccountId':_0x4a8e0f},'transaction':_0x5e3ecf})[_0xba98('0x1d')](function(){var _0x37aebc=_[_0xba98('0x3c')](_0x5a2cac,function(_0x18f97b){_0x18f97b[_0xba98('0x61')]=_0x4a8e0f;return _0x18f97b;});return db[_0xba98('0x77')][_0xba98('0x78')](_0x37aebc,{'transaction':_0x5e3ecf});});}else{_0x5a28b1=0x194;_0x589d7c=[];}});})[_0xba98('0x1d')](function(){if(_0x5a28b1!==0x194){return db['WhatsappApplication'][_0xba98('0x79')]({'where':{'WhatsappAccountId':_0x4a8e0f},'order':'priority'})[_0xba98('0x1d')](function(_0xad0cb3){_0x589d7c=_0xad0cb3;});}})[_0xba98('0x27')](function(_0x13d39b){_0x5a28b1=0x1f4;logger[_0xba98('0x22')](_0x13d39b[_0xba98('0x37')]);if(_0x13d39b['name']){delete _0x13d39b[_0xba98('0x38')];}_0x589d7c=_0x13d39b;})[_0xba98('0x7a')](function(){if(_0x589d7c===null){_0x35d1f3[_0xba98('0x28')](_0x5a28b1);}else{if(_0x5a28b1===0x1f4){_0x35d1f3[_0xba98('0x29')](_0x5a28b1)[_0xba98('0x39')](_0x589d7c);}else{_0x35d1f3['status'](_0x5a28b1)[_0xba98('0x2b')](_0x589d7c);}}});};exports['getApplications']=function(_0x3fa2c1,_0x462075,_0x362f6e){var _0x53d1be={};var _0x3030f9={};var _0x493383;var _0x532310;return db['WhatsappAccount']['findOne']({'where':{'id':_0x3fa2c1[_0xba98('0x54')]['id']}})['then'](handleEntityNotFound(_0x462075,null))[_0xba98('0x1d')](function(_0x4326ec){if(_0x4326ec){_0x493383=_0x4326ec;_0x3030f9[_0xba98('0x40')]=_['keys'](db[_0xba98('0x77')][_0xba98('0x55')]);_0x3030f9[_0xba98('0x41')]=_['keys'](_0x3fa2c1['query']);_0x3030f9[_0xba98('0x43')]=_[_0xba98('0x44')](_0x3030f9[_0xba98('0x40')],_0x3030f9['query']);_0x53d1be[_0xba98('0x45')]=_[_0xba98('0x44')](_0x3030f9[_0xba98('0x40')],qs[_0xba98('0x46')](_0x3fa2c1[_0xba98('0x41')][_0xba98('0x46')]));_0x53d1be['attributes']=_0x53d1be[_0xba98('0x45')][_0xba98('0x47')]?_0x53d1be[_0xba98('0x45')]:_0x3030f9[_0xba98('0x40')];_0x53d1be[_0xba98('0x49')]=qs[_0xba98('0x4a')](_0x3fa2c1[_0xba98('0x41')][_0xba98('0x4a')]);_0x53d1be[_0xba98('0x4b')]=qs[_0xba98('0x43')](_[_0xba98('0x4c')](_0x3fa2c1['query'],_0x3030f9[_0xba98('0x43')]));if(_0x3fa2c1['query'][_0xba98('0x4d')]){_0x53d1be[_0xba98('0x4b')]=_[_0xba98('0x4e')](_0x53d1be[_0xba98('0x4b')],{'$or':_[_0xba98('0x3c')](_0x53d1be[_0xba98('0x45')],function(_0x5aa5a7){var _0x2f8ea1={};_0x2f8ea1[_0x5aa5a7]={'$like':'%'+_0x3fa2c1[_0xba98('0x41')]['filter']+'%'};return _0x2f8ea1;})});}_0x53d1be=_[_0xba98('0x4e')]({},_0x53d1be,_0x3fa2c1['options']);return _0x493383['getApplications'](_0x53d1be);}})[_0xba98('0x1d')](function(_0x55cf80){if(_0x55cf80){_0x532310=_0x55cf80['length'];if(!_0x3fa2c1[_0xba98('0x41')][_0xba98('0x48')](_0xba98('0x65'))){_0x53d1be['limit']=qs[_0xba98('0x2e')](_0x3fa2c1[_0xba98('0x41')]['limit']);_0x53d1be[_0xba98('0x2c')]=qs['offset'](_0x3fa2c1[_0xba98('0x41')]['offset']);}return _0x493383[_0xba98('0x7b')](_0x53d1be);}})[_0xba98('0x1d')](function(_0x5a8edb){if(_0x5a8edb){return _0x5a8edb?{'count':_0x532310,'rows':_0x5a8edb}:null;}})['then'](respondWithResult(_0x462075,null))[_0xba98('0x27')](handleError(_0x462075,null));};exports[_0xba98('0x7c')]=function(_0x22e454,_0x28fd83,_0xf86a34){var _0x602ae9={'channel':_0xba98('0x7d')};var _0x232900=[];var _0x1ff88a=[];var _0x581054={};return db[_0xba98('0x3d')][_0xba98('0x57')]({'where':{'id':_0x22e454[_0xba98('0x54')]['id']},'include':[{'model':db[_0xba98('0x77')],'as':_0xba98('0x7e')}]})['then'](handleEntityNotFound(_0x28fd83,null))[_0xba98('0x1d')](function(_0x1fd8fb){_0x602ae9[_0xba98('0x7f')]=_0x1fd8fb;if(_0x602ae9[_0xba98('0x7f')]&&_0x602ae9[_0xba98('0x7f')][_0xba98('0x3f')]==='sinch'&&_0x22e454[_0xba98('0x58')][_0xba98('0x80')]){if(_0x22e454[_0xba98('0x58')][_0xba98('0x80')][_0xba98('0x47')]===0x0)return;if(_0x22e454[_0xba98('0x58')]['statuses'][0x0][_0xba98('0x81')]!==_0xba98('0x82'))return;return db[_0xba98('0x83')][_0xba98('0x33')]({'read':!![],'readAt':_0x22e454[_0xba98('0x58')][_0xba98('0x80')][0x0][_0xba98('0x84')]},{'where':{'messageId':_0x22e454[_0xba98('0x58')][_0xba98('0x80')][0x0]['message_id']},'individualHooks':!![]})[_0xba98('0x1d')](function(_0x4821f0){return _0x28fd83['status'](0xc8)[_0xba98('0x2b')](_0x4821f0);});}_0x602ae9[_0xba98('0x85')]=_[_0xba98('0x86')](_0x1fd8fb[_0xba98('0x7e')],[_0xba98('0x87')],[_0xba98('0x88')]);if(_0x602ae9[_0xba98('0x7f')]['Applications']){delete _0x602ae9['account']['Applications'];}return db['CmContact']['describe']()[_0xba98('0x1d')](function(_0xedc80){if(!_0xedc80){throw new db[(_0xba98('0x89'))][(_0xba98('0x8a'))]('no\x20available\x20attributes');}_0x232900=_[_0xba98('0x8b')](_[_0xba98('0x42')](_0xedc80),[_0xba98('0x8c'),'updatedAt']);_0x1ff88a=_[_0xba98('0x8b')](_[_0xba98('0x42')](_0xedc80),[_0xba98('0x8c'),_0xba98('0x8d'),'CompanyId',_0xba98('0x8e')]);_0x602ae9[_0xba98('0x58')]={'mapKey':_0xba98('0x8f')};if(_0x602ae9[_0xba98('0x7f')]&&_0x602ae9[_0xba98('0x7f')][_0xba98('0x3f')]===_0xba98('0x90')){_0x602ae9[_0xba98('0x58')][_0xba98('0x91')]=_0x22e454['body'][_0xba98('0x92')][_0xba98('0x93')](_0xba98('0x94'),'');_0x602ae9['body'][_0xba98('0x58')]=_0x22e454['body']['Body'];_0x602ae9['body'][_0xba98('0x95')]=_0x22e454[_0xba98('0x58')][_0xba98('0x96')];}if(_0x602ae9[_0xba98('0x7f')]&&_0x602ae9[_0xba98('0x7f')][_0xba98('0x3f')]===_0xba98('0x97')){_0x602ae9['body'][_0xba98('0x91')]=_0x22e454[_0xba98('0x58')][_0xba98('0x98')][0x0]['from'];_0x602ae9[_0xba98('0x58')][_0xba98('0x58')]=_0x22e454['body'][_0xba98('0x98')][0x0]['message'][_0xba98('0x58')];_0x602ae9[_0xba98('0x58')][_0xba98('0x95')]=_0x22e454[_0xba98('0x58')][_0xba98('0x98')][0x0]['message_id'];}if(_0x602ae9['body']['id']){delete _0x602ae9[_0xba98('0x58')]['id'];}if(_['isNil'](_0x602ae9[_0xba98('0x58')][_0xba98('0x91')])){throw new db[(_0xba98('0x89'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xba98('0x99')](_0x602ae9['body'][_0xba98('0x58')])||_0x602ae9['body'][_0xba98('0x58')]===''){throw new db[(_0xba98('0x89'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x602ae9[_0xba98('0x58')][_0xba98('0x9a')])){throw new db[(_0xba98('0x89'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ff88a);}if(!_[_0xba98('0x9b')](_0x1ff88a,_0x602ae9[_0xba98('0x58')]['mapKey'])){throw new db[(_0xba98('0x89'))][(_0xba98('0x8a'))](_0xba98('0x9c')+_0x1ff88a);}_0x581054[_0x602ae9[_0xba98('0x58')][_0xba98('0x9a')]]=_0x602ae9[_0xba98('0x58')][_0xba98('0x91')];return db[_0xba98('0x9d')]['find']({'where':{'id':_0x602ae9['account']['ListId']},'include':[{'model':db[_0xba98('0x9e')],'as':'Contacts','where':_0x581054,'limit':0x1,'order':[[_0xba98('0x8d'),'DESC']]}]});})['then'](handleEntityNotFound(_0x28fd83,null))[_0xba98('0x1d')](function(_0x2840ea){if(_0x2840ea){_0x602ae9['list']=_['omit'](_0x2840ea,[_0xba98('0x9f')]);if(_0x2840ea[_0xba98('0x9f')][_0xba98('0x47')]){return _0x2840ea[_0xba98('0x9f')][0x0];}var _0x1d86c2=_[_0xba98('0x18')](_0x602ae9[_0xba98('0x58')],{'firstName':_0x602ae9[_0xba98('0x58')]['from'],'ListId':_0x2840ea['id']});_0x1d86c2[_0x602ae9[_0xba98('0x58')][_0xba98('0x9a')]]=_0x602ae9[_0xba98('0x58')][_0xba98('0x91')];return db['CmContact'][_0xba98('0x5d')](_0x1d86c2,{'fields':_0x232900,'raw':!![]});}})[_0xba98('0x1d')](handleEntityNotFound(_0x28fd83,null))['then'](function(_0x53be32){if(_0x53be32){_0x602ae9[_0xba98('0xa0')]=_0x53be32;var _0x315d22={'ContactId':_0x53be32['id'],'phone':_0x602ae9[_0xba98('0x58')][_0xba98('0x91')],'WhatsappAccountId':_0x22e454['params']['id']};var _0x15716e={'ContactId':_0x53be32['id'],'WhatsappAccountId':_0x22e454[_0xba98('0x54')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xba98('0x57')]({'where':_0x15716e})[_0xba98('0x1d')](function(_0x46208f){if(_0x46208f){return[_0x46208f,![]];}return db[_0xba98('0xa1')][_0xba98('0x5d')](_0x315d22)[_0xba98('0x1d')](function(_0x1089aa){return[_0x1089aa,!![]];});});}})['spread'](function(_0x466b08,_0x178efb){_0x602ae9[_0xba98('0xa2')]=_0x466b08[_0xba98('0x35')]({'plain':!![]});_0x602ae9[_0xba98('0xa2')]['created']=![];if(_0x178efb){if(_0x602ae9[_0xba98('0x7f')][_0xba98('0xa3')]){_0x602ae9['applications'][_0xba98('0xa4')]({'id':0x0,'priority':_0x602ae9['applications'][_0xba98('0x47')]+0x1,'app':_0xba98('0xa5'),'appdata':_0xba98('0xa6'),'interval':_0xba98('0xa7')});}_0x602ae9['interaction'][_0xba98('0xa8')]=!![];}return db[_0xba98('0x83')][_0xba98('0x5d')]({'phone':_0x602ae9[_0xba98('0x58')][_0xba98('0x91')],'messageId':_0x602ae9[_0xba98('0x58')][_0xba98('0x95')],'body':_0x602ae9[_0xba98('0x58')][_0xba98('0x58')],'WhatsappAccountId':_0x22e454[_0xba98('0x54')]['id'],'WhatsappInteractionId':_0x466b08['id'],'direction':'in','ContactId':_0x466b08[_0xba98('0xa9')],'AttachmentId':_0x602ae9[_0xba98('0x58')][_0xba98('0xaa')]});})[_0xba98('0x1d')](function(_0x298642){_0x602ae9['message']=_0x298642;if(_0x602ae9[_0xba98('0xa2')]['UserId']){return db[_0xba98('0x71')]['find']({'attributes':['id',_0xba98('0x38')],'where':{'id':_0x602ae9[_0xba98('0xa2')][_0xba98('0xab')]}})[_0xba98('0x1d')](function(_0xc2d29c){if(_0xc2d29c){_0x602ae9[_0xba98('0x85')][_0xba98('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xc2d29c[_0xba98('0x38')]+','+(_0x602ae9['account'][_0xba98('0xad')]||0xa),'interval':_0xba98('0xa7')});}return respondWithRpcPromise('Start',_0xba98('0xae'),_0x602ae9);});}return respondWithRpcPromise(_0xba98('0xaf'),_0xba98('0xae'),_0x602ae9);})[_0xba98('0x1d')](function(_0x5931d2){if(_0x5931d2){var _0x58ed42=0xc8;var _0x494657=_0xba98('0xb0');logger[_0xba98('0x25')](_0xba98('0x20'),_0x494657,_0x58ed42,'entity\x20found');logger[_0xba98('0xb1')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x494657,_0x58ed42,_0xba98('0xb2'),JSON[_0xba98('0x21')](_0x5931d2));if(_0x602ae9[_0xba98('0x7f')][_0xba98('0x3f')]===_0xba98('0x90')){return _0x28fd83['status'](_0x58ed42)[_0xba98('0x30')](_0xba98('0xb3'),_0xba98('0xb4'))[_0xba98('0x39')]('\x0a');}else{return _0x28fd83['status'](_0x58ed42)[_0xba98('0x2b')](_0x5931d2);}}});})[_0xba98('0x27')](handleError(_0x28fd83,null));};exports[_0xba98('0x39')]=function(_0x137288,_0x39f6ed,_0x1c87df){var _0x39c538,_0x44953e,_0x5b7fb3;if(_['isNil'](_0x137288['body']['body'])||_0x137288[_0xba98('0x58')][_0xba98('0x58')]===''){throw new db[(_0xba98('0x89'))][(_0xba98('0x8a'))](_0xba98('0xb5'));}if(_[_0xba98('0x99')](_0x137288[_0xba98('0x58')]['to'])){throw new db[(_0xba98('0x89'))][(_0xba98('0x8a'))](_0xba98('0xb6'));}_0x39c538=_0x137288[_0xba98('0x58')]['to'];return db['WhatsappAccount'][_0xba98('0x57')]({'where':{'id':_0x137288[_0xba98('0x54')]['id']},'include':[{'model':db[_0xba98('0x9d')],'as':_0xba98('0xb7'),'include':[{'model':db['CmContact'],'as':_0xba98('0x9f'),'where':{'mobile':_0x39c538},'limit':0x1,'order':[[_0xba98('0x8d'),_0xba98('0xb8')]]}]}]})[_0xba98('0x1d')](handleEntityNotFound(_0x39f6ed,null))[_0xba98('0x1d')](function(_0x198a44){if(_0x198a44&&_0x198a44['List']){_0x44953e=_0x198a44[_0xba98('0x35')]({'plain':!![]});if(_0x44953e[_0xba98('0xb7')]&&_0x44953e[_0xba98('0xb7')][_0xba98('0x9f')]['length']){return _0x44953e[_0xba98('0xb7')][_0xba98('0x9f')][0x0];}return db[_0xba98('0x9e')]['create'](_[_0xba98('0x18')](_0x137288[_0xba98('0x58')],{'firstName':_0x39c538,'mobile':_0x39c538,'phone':_0x39c538,'ListId':_0x44953e[_0xba98('0x8e')]}));}})['then'](handleEntityNotFound(_0x39f6ed,null))[_0xba98('0x1d')](function(_0x7c448a){if(_0x7c448a){_0x5b7fb3=_0x7c448a;return db[_0xba98('0xa1')]['find']({'where':{'ContactId':_0x5b7fb3['id'],'closed':![],'WhatsappAccountId':_0x44953e['id']}})[_0xba98('0x1d')](function(_0x51b409){if(_0x51b409){return[_0x51b409,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x137288[_0xba98('0x59')]['id'],'ContactId':_0x5b7fb3['id'],'WhatsappAccountId':_0x44953e['id'],'phone':_0x39c538,'firstMsgDirection':_0xba98('0xb9'),'Messages':[_['merge'](_0x137288[_0xba98('0x58')],{'read':![],'body':_0x137288[_0xba98('0x58')]['body'],'phone':_0x39c538,'WhatsappAccountId':_0x44953e['id'],'UserId':_0x137288[_0xba98('0x59')]['id'],'ContactId':_0x5b7fb3['id']})]},{'include':[{'model':db[_0xba98('0x83')],'as':'Messages'}]})[_0xba98('0x1d')](function(_0x22ed8e){return[_0x22ed8e,!![]];});});}})[_0xba98('0xba')](function(_0x3b22be,_0x1411f4){if(_0x1411f4){return _0x3b22be;}return db[_0xba98('0x83')][_0xba98('0x5d')](_[_0xba98('0x4e')](_0x137288[_0xba98('0x58')],{'read':![],'body':_0x137288['body'][_0xba98('0x58')],'phone':_0x39c538,'WhatsappAccountId':_0x44953e['id'],'WhatsappInteractionId':_0x3b22be['id'],'UserId':_0x137288[_0xba98('0x59')]['id'],'ContactId':_0x5b7fb3['id']}))[_0xba98('0x1d')](function(_0x50f8cd){_0x3b22be[_0xba98('0xbb')][_0xba98('0xbc')]=[];_0x3b22be[_0xba98('0xbb')][_0xba98('0xbc')][_0xba98('0xa4')](_0x50f8cd[_0xba98('0xbb')]);return _0x3b22be;});})[_0xba98('0x1d')](respondWithResult(_0x39f6ed,null))['catch'](handleError(_0x39f6ed,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index bb8da9b..65629ec 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 _0xdb25=['hook','exports','events','WhatsappAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdb25,0x112));var _0x5db2=function(_0x575b72,_0xa6244){_0x575b72=_0x575b72-0x0;var _0x4a6b10=_0xdb25[_0x575b72];return _0x4a6b10;};'use strict';var EventEmitter=require(_0x5db2('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x5db2('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5db2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5db2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x276674){return function(_0x1c9e7f,_0x8e980a,_0x50b286){WhatsappAccountEvents[_0x5db2('0x4')](_0x276674+':'+_0x1c9e7f['id'],_0x1c9e7f);WhatsappAccountEvents[_0x5db2('0x4')](_0x276674,_0x1c9e7f);_0x50b286(null);};}for(var e in events){if(events[_0x5db2('0x5')](e)){var event=events[e];WhatsappAccount[_0x5db2('0x6')](e,emitEvent(event));}}module[_0x5db2('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd83d=['save','update','emit','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xd83d,0xfd));var _0xdd83=function(_0x554760,_0x491f9e){_0x554760=_0x554760-0x0;var _0xeaf2a3=_0xd83d[_0x554760];return _0xeaf2a3;};'use strict';var EventEmitter=require(_0xdd83('0x0'));var WhatsappAccount=require(_0xdd83('0x1'))['db'][_0xdd83('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd83('0x3'),'afterUpdate':_0xdd83('0x4'),'afterDestroy':'remove'};function emitEvent(_0x164cb3){return function(_0x2cc97a,_0x7bfce5,_0x358c8f){WhatsappAccountEvents[_0xdd83('0x5')](_0x164cb3+':'+_0x2cc97a['id'],_0x2cc97a);WhatsappAccountEvents[_0xdd83('0x5')](_0x164cb3,_0x2cc97a);_0x358c8f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xdd83('0x6')](e,emitEvent(event));}}module[_0xdd83('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 5103648..92c9d32 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 _0x3d2b=['WhatsappAccount','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x9e56ea,_0x24b70d){var _0x8dc669=function(_0x192796){while(--_0x192796){_0x9e56ea['push'](_0x9e56ea['shift']());}};_0x8dc669(++_0x24b70d);}(_0x3d2b,0x1e1));var _0xb3d2=function(_0xcce5ff,_0x4baa7f){_0xcce5ff=_0xcce5ff-0x0;var _0x2b35f1=_0x3d2b[_0xcce5ff];return _0x2b35f1;};'use strict';var _=require(_0xb3d2('0x0'));var util=require('util');var logger=require(_0xb3d2('0x1'))(_0xb3d2('0x2'));var moment=require('moment');var BPromise=require(_0xb3d2('0x3'));var rp=require(_0xb3d2('0x4'));var fs=require('fs');var path=require(_0xb3d2('0x5'));var rimraf=require('rimraf');var config=require(_0xb3d2('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xb3d2('0x7')]=function(_0x7c2bf9,_0x48f61a){return _0x7c2bf9[_0xb3d2('0x8')](_0xb3d2('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3082=['bluebird','request-promise','../../config/environment','exports','define','whatsapp_accounts','lodash','util','../../config/logger','api'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x3082,0x16e));var _0x2308=function(_0x59d038,_0x291c49){_0x59d038=_0x59d038-0x0;var _0x155b51=_0x3082[_0x59d038];return _0x155b51;};'use strict';var _=require(_0x2308('0x0'));var util=require(_0x2308('0x1'));var logger=require(_0x2308('0x2'))(_0x2308('0x3'));var moment=require('moment');var BPromise=require(_0x2308('0x4'));var rp=require(_0x2308('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2308('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0x2308('0x7')]=function(_0x400c2,_0x116b3c){return _0x400c2[_0x2308('0x8')]('WhatsappAccount',attributes,{'tableName':_0x2308('0x9'),'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 fadf7bd..cc0e6aa 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 _0xe083=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','info','result','message','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','map','model','then','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d3e40,_0x3204b3){var _0x3bc4e1=function(_0x4377aa){while(--_0x4377aa){_0x4d3e40['push'](_0x4d3e40['shift']());}};_0x3bc4e1(++_0x3204b3);}(_0xe083,0x1dc));var _0x3e08=function(_0x4e59b7,_0x8c1534){_0x4e59b7=_0x4e59b7-0x0;var _0x10654f=_0xe083[_0x4e59b7];return _0x10654f;};'use strict';var _=require(_0x3e08('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e08('0x1'));var rs=require(_0x3e08('0x2'));var fs=require('fs');var Redis=require(_0x3e08('0x3'));var db=require(_0x3e08('0x4'))['db'];var utils=require(_0x3e08('0x5'));var logger=require(_0x3e08('0x6'))(_0x3e08('0x7'));var config=require(_0x3e08('0x8'));var jayson=require(_0x3e08('0x9'));var client=jayson[_0x3e08('0xa')][_0x3e08('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3e08('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e08('0xd'))(new Redis(config[_0x3e08('0xc')]));require(_0x3e08('0xe'))[_0x3e08('0xf')](socket);function respondWithRpcPromise(_0x29e51d,_0x34b31d,_0x393fe2){return new BPromise(function(_0x320f6e,_0x13001a){return client['request'](_0x29e51d,_0x393fe2)['then'](function(_0x5e9cec){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x34b31d,_0x3e08('0x10'));logger[_0x3e08('0x11')](_0x3e08('0x12'),_0x34b31d,'request\x20sent',JSON[_0x3e08('0x13')](_0x5e9cec));if(_0x5e9cec[_0x3e08('0x14')]){if(_0x5e9cec[_0x3e08('0x14')]['code']===0x1f4){logger['error'](_0x3e08('0x15'),_0x34b31d,_0x5e9cec['error']['message']);return _0x13001a(_0x5e9cec[_0x3e08('0x14')]['message']);}logger[_0x3e08('0x14')](_0x3e08('0x15'),_0x34b31d,_0x5e9cec[_0x3e08('0x14')]['message']);return _0x320f6e(_0x5e9cec[_0x3e08('0x14')]['message']);}else{logger[_0x3e08('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x34b31d,_0x3e08('0x10'));_0x320f6e(_0x5e9cec[_0x3e08('0x17')][_0x3e08('0x18')]);}})[_0x3e08('0x19')](function(_0x452319){logger['error'](_0x3e08('0x15'),_0x34b31d,_0x452319);_0x13001a(_0x452319);});});}exports[_0x3e08('0x1a')]=function(_0x3005a3){var _0x3e0e3d=this;return new Promise(function(_0xb47529,_0x17271c){return db[_0x3e08('0x1b')][_0x3e08('0x1c')]({'raw':_0x3005a3['options']?_0x3005a3['options'][_0x3e08('0x1d')]===undefined?!![]:![]:!![],'where':_0x3005a3[_0x3e08('0x1e')]?_0x3005a3[_0x3e08('0x1e')][_0x3e08('0x1f')]||null:null,'attributes':_0x3005a3[_0x3e08('0x1e')]?_0x3005a3[_0x3e08('0x1e')][_0x3e08('0x20')]||null:null,'include':_0x3005a3[_0x3e08('0x1e')]?_0x3005a3[_0x3e08('0x1e')][_0x3e08('0x21')]?_[_0x3e08('0x22')](_0x3005a3[_0x3e08('0x1e')]['include'],function(_0x1a2881){return{'model':db[_0x1a2881[_0x3e08('0x23')]],'as':_0x1a2881['as'],'attributes':_0x1a2881['attributes'],'include':_0x1a2881[_0x3e08('0x21')]?_[_0x3e08('0x22')](_0x1a2881[_0x3e08('0x21')],function(_0x21f5db){return{'model':db[_0x21f5db[_0x3e08('0x23')]],'as':_0x21f5db['as'],'attributes':_0x21f5db[_0x3e08('0x20')],'include':_0x21f5db['include']?_[_0x3e08('0x22')](_0x21f5db[_0x3e08('0x21')],function(_0x2dd2a8){return{'model':db[_0x2dd2a8[_0x3e08('0x23')]],'as':_0x2dd2a8['as'],'attributes':_0x2dd2a8[_0x3e08('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3e08('0x24')](function(_0x17e41b){logger[_0x3e08('0x16')]('ShowWhatsappAccount',_0x3005a3);logger[_0x3e08('0x11')](_0x3e08('0x1a'),_0x3005a3,JSON[_0x3e08('0x13')](_0x17e41b));_0xb47529(_0x17e41b);})[_0x3e08('0x19')](function(_0x47a17d){logger['error'](_0x3e08('0x1a'),_0x47a17d[_0x3e08('0x18')],_0x3005a3);_0x17271c(_0x3e0e3d[_0x3e08('0x14')](0x1f4,_0x47a17d[_0x3e08('0x18')]));});});}; \ No newline at end of file +var _0x9421=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappAccount','find','options','where','attributes','map','include','model','ShowWhatsappAccount','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9421,0x155));var _0x1942=function(_0x5d8957,_0x3e2e35){_0x5d8957=_0x5d8957-0x0;var _0x5a8a5b=_0x9421[_0x5d8957];return _0x5a8a5b;};'use strict';var _=require(_0x1942('0x0'));var util=require(_0x1942('0x1'));var moment=require(_0x1942('0x2'));var BPromise=require(_0x1942('0x3'));var rs=require(_0x1942('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1942('0x5'))['db'];var utils=require(_0x1942('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1942('0x7'));var jayson=require(_0x1942('0x8'));var client=jayson[_0x1942('0x9')]['http']({'port':0x232a});config[_0x1942('0xa')]=_[_0x1942('0xb')](config[_0x1942('0xa')],{'host':_0x1942('0xc'),'port':0x18eb});var socket=require(_0x1942('0xd'))(new Redis(config['redis']));require(_0x1942('0xe'))[_0x1942('0xf')](socket);function respondWithRpcPromise(_0x3a0580,_0x4b26da,_0x5d79c8){return new BPromise(function(_0x323d94,_0x48f00a){return client[_0x1942('0x10')](_0x3a0580,_0x5d79c8)[_0x1942('0x11')](function(_0x132225){logger[_0x1942('0x12')](_0x1942('0x13'),_0x4b26da,_0x1942('0x14'));logger[_0x1942('0x15')](_0x1942('0x16'),_0x4b26da,_0x1942('0x14'),JSON[_0x1942('0x17')](_0x132225));if(_0x132225[_0x1942('0x18')]){if(_0x132225[_0x1942('0x18')][_0x1942('0x19')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4b26da,_0x132225[_0x1942('0x18')][_0x1942('0x1a')]);return _0x48f00a(_0x132225[_0x1942('0x18')][_0x1942('0x1a')]);}logger['error'](_0x1942('0x13'),_0x4b26da,_0x132225['error'][_0x1942('0x1a')]);return _0x323d94(_0x132225[_0x1942('0x18')][_0x1942('0x1a')]);}else{logger[_0x1942('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x4b26da,_0x1942('0x14'));_0x323d94(_0x132225[_0x1942('0x1b')][_0x1942('0x1a')]);}})[_0x1942('0x1c')](function(_0x477d91){logger[_0x1942('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x4b26da,_0x477d91);_0x48f00a(_0x477d91);});});}exports['ShowWhatsappAccount']=function(_0x54ab2a){var _0x252af2=this;return new Promise(function(_0x5bf71c,_0x5d0879){return db[_0x1942('0x1d')][_0x1942('0x1e')]({'raw':_0x54ab2a['options']?_0x54ab2a['options']['raw']===undefined?!![]:![]:!![],'where':_0x54ab2a[_0x1942('0x1f')]?_0x54ab2a[_0x1942('0x1f')][_0x1942('0x20')]||null:null,'attributes':_0x54ab2a[_0x1942('0x1f')]?_0x54ab2a[_0x1942('0x1f')][_0x1942('0x21')]||null:null,'include':_0x54ab2a['options']?_0x54ab2a[_0x1942('0x1f')]['include']?_[_0x1942('0x22')](_0x54ab2a['options'][_0x1942('0x23')],function(_0x5ce68e){return{'model':db[_0x5ce68e[_0x1942('0x24')]],'as':_0x5ce68e['as'],'attributes':_0x5ce68e['attributes'],'include':_0x5ce68e[_0x1942('0x23')]?_[_0x1942('0x22')](_0x5ce68e['include'],function(_0x5a8889){return{'model':db[_0x5a8889[_0x1942('0x24')]],'as':_0x5a8889['as'],'attributes':_0x5a8889[_0x1942('0x21')],'include':_0x5a8889[_0x1942('0x23')]?_[_0x1942('0x22')](_0x5a8889[_0x1942('0x23')],function(_0x58581e){return{'model':db[_0x58581e[_0x1942('0x24')]],'as':_0x58581e['as'],'attributes':_0x58581e[_0x1942('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x934634){logger['info']('ShowWhatsappAccount',_0x54ab2a);logger[_0x1942('0x15')](_0x1942('0x25'),_0x54ab2a,JSON['stringify'](_0x934634));_0x5bf71c(_0x934634);})[_0x1942('0x1c')](function(_0x5ace83){logger[_0x1942('0x18')]('ShowWhatsappAccount',_0x5ace83[_0x1942('0x1a')],_0x54ab2a);_0x5d0879(_0x252af2['error'](0x1f4,_0x5ace83['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e4bb4d5..09d6900 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 _0x2a48=['register','whatsappAccount:','./whatsappAccount.events','save','emit','removeListener'];(function(_0x9401cf,_0x3af936){var _0x2e9f73=function(_0x5998e1){while(--_0x5998e1){_0x9401cf['push'](_0x9401cf['shift']());}};_0x2e9f73(++_0x3af936);}(_0x2a48,0x1a6));var _0x82a4=function(_0x162506,_0x1aa619){_0x162506=_0x162506-0x0;var _0x2c866f=_0x2a48[_0x162506];return _0x2c866f;};'use strict';var WhatsappAccountEvents=require(_0x82a4('0x0'));var events=[_0x82a4('0x1'),'remove','update'];function createListener(_0x551420,_0x1d62eb){return function(_0x30abf7){_0x1d62eb[_0x82a4('0x2')](_0x551420,_0x30abf7);};}function removeListener(_0x300c92,_0x54d25c){return function(){WhatsappAccountEvents[_0x82a4('0x3')](_0x300c92,_0x54d25c);};}exports[_0x82a4('0x4')]=function(_0x543181){for(var _0xd88a19=0x0,_0xc60058=events['length'];_0xd88a19<_0xc60058;_0xd88a19++){var _0x3df320=events[_0xd88a19];var _0x2dc0d5=createListener(_0x82a4('0x5')+_0x3df320,_0x543181);WhatsappAccountEvents['on'](_0x3df320,_0x2dc0d5);}}; \ No newline at end of file +var _0x26f0=['save','remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x12209a,_0x3bec68){var _0x31be3b=function(_0x489ad2){while(--_0x489ad2){_0x12209a['push'](_0x12209a['shift']());}};_0x31be3b(++_0x3bec68);}(_0x26f0,0x116));var _0x026f=function(_0x21a4f8,_0x26ff18){_0x21a4f8=_0x21a4f8-0x0;var _0x53979d=_0x26f0[_0x21a4f8];return _0x53979d;};'use strict';var WhatsappAccountEvents=require(_0x026f('0x0'));var events=[_0x026f('0x1'),_0x026f('0x2'),_0x026f('0x3')];function createListener(_0x2cba96,_0x16a1d6){return function(_0x1514a0){_0x16a1d6[_0x026f('0x4')](_0x2cba96,_0x1514a0);};}function removeListener(_0x5c39e2,_0x4f7a98){return function(){WhatsappAccountEvents[_0x026f('0x5')](_0x5c39e2,_0x4f7a98);};}exports[_0x026f('0x6')]=function(_0x1e85d6){for(var _0x3b499d=0x0,_0x49720e=events[_0x026f('0x7')];_0x3b499d<_0x49720e;_0x3b499d++){var _0x11088f=events[_0x3b499d];var _0x92af66=createListener(_0x026f('0x8')+_0x11088f,_0x1e85d6);WhatsappAccountEvents['on'](_0x11088f,_0x92af66);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 45887ba..2d67d8e 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 _0xc464=['index','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x435f60,_0x2026c2){var _0x60dfe6=function(_0x48130b){while(--_0x48130b){_0x435f60['push'](_0x435f60['shift']());}};_0x60dfe6(++_0x2026c2);}(_0xc464,0x1be));var _0x4c46=function(_0x126a2e,_0x386f78){_0x126a2e=_0x126a2e-0x0;var _0xd042db=_0xc464[_0x126a2e];return _0xd042db;};'use strict';var multer=require(_0x4c46('0x0'));var util=require(_0x4c46('0x1'));var path=require('path');var timeout=require(_0x4c46('0x2'));var express=require(_0x4c46('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4c46('0x4'));var interaction=require(_0x4c46('0x5'));var config=require(_0x4c46('0x6'));var controller=require(_0x4c46('0x7'));router[_0x4c46('0x8')]('/',auth[_0x4c46('0x9')](),controller[_0x4c46('0xa')]);router[_0x4c46('0x8')](_0x4c46('0xb'),auth[_0x4c46('0x9')](),controller[_0x4c46('0xc')]);router[_0x4c46('0xd')]('/',auth['isAuthenticated'](),controller[_0x4c46('0xe')]);router[_0x4c46('0xf')](_0x4c46('0xb'),auth[_0x4c46('0x9')](),controller[_0x4c46('0x10')]);router[_0x4c46('0x11')](_0x4c46('0xb'),auth[_0x4c46('0x9')](),controller[_0x4c46('0x12')]);module['exports']=router; \ No newline at end of file +var _0x09f8=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x15e141,_0x3aa94a){var _0x1d4fca=function(_0x40c61e){while(--_0x40c61e){_0x15e141['push'](_0x15e141['shift']());}};_0x1d4fca(++_0x3aa94a);}(_0x09f8,0x171));var _0x809f=function(_0x52d320,_0x48c537){_0x52d320=_0x52d320-0x0;var _0x4e8a45=_0x09f8[_0x52d320];return _0x4e8a45;};'use strict';var multer=require('multer');var util=require(_0x809f('0x0'));var path=require(_0x809f('0x1'));var timeout=require(_0x809f('0x2'));var express=require(_0x809f('0x3'));var router=express[_0x809f('0x4')]();var fs_extra=require(_0x809f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x809f('0x6'));var config=require(_0x809f('0x7'));var controller=require('./whatsappApplication.controller');router[_0x809f('0x8')]('/',auth[_0x809f('0x9')](),controller[_0x809f('0xa')]);router['get'](_0x809f('0xb'),auth[_0x809f('0x9')](),controller[_0x809f('0xc')]);router[_0x809f('0xd')]('/',auth[_0x809f('0x9')](),controller[_0x809f('0xe')]);router['put'](_0x809f('0xb'),auth[_0x809f('0x9')](),controller['update']);router[_0x809f('0xf')](_0x809f('0xb'),auth[_0x809f('0x9')](),controller[_0x809f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 982e2de..1d31243 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 _0x8900=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x2c64ce,_0x1ec726){var _0x3242ea=function(_0x2329dd){while(--_0x2329dd){_0x2c64ce['push'](_0x2c64ce['shift']());}};_0x3242ea(++_0x1ec726);}(_0x8900,0x11f));var _0x0890=function(_0x214abd,_0x406e03){_0x214abd=_0x214abd-0x0;var _0x4092e5=_0x8900[_0x214abd];return _0x4092e5;};'use strict';var Sequelize=require(_0x0890('0x0'));module[_0x0890('0x1')]={'priority':{'type':Sequelize[_0x0890('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0890('0x3')},'appdata':{'type':Sequelize[_0x0890('0x4')]()},'description':{'type':Sequelize[_0x0890('0x5')]},'interval':{'type':Sequelize[_0x0890('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xba22=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba22,0x165));var _0x2ba2=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xba22[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x2ba2('0x0'));module[_0x2ba2('0x1')]={'priority':{'type':Sequelize[_0x2ba2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2ba2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2ba2('0x4')]()},'description':{'type':Sequelize[_0x2ba2('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2ba2('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 13f36b8..9426327 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 _0xbdc2=['intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','save','update','destroy','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','attributes'];(function(_0x548fd5,_0x4c36b0){var _0xc295bf=function(_0x592f00){while(--_0x592f00){_0x548fd5['push'](_0x548fd5['shift']());}};_0xc295bf(++_0x4c36b0);}(_0xbdc2,0x148));var _0x2bdc=function(_0x2a2d4c,_0x421c0b){_0x2a2d4c=_0x2a2d4c-0x0;var _0x281be4=_0xbdc2[_0x2a2d4c];return _0x281be4;};'use strict';var emlformat=require(_0x2bdc('0x0'));var rimraf=require(_0x2bdc('0x1'));var zipdir=require(_0x2bdc('0x2'));var jsonpatch=require(_0x2bdc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2bdc('0x4'));var Mustache=require(_0x2bdc('0x5'));var util=require('util');var path=require(_0x2bdc('0x6'));var sox=require(_0x2bdc('0x7'));var csv=require('to-csv');var ejs=require(_0x2bdc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bdc('0x9'));var squel=require(_0x2bdc('0xa'));var crypto=require(_0x2bdc('0xb'));var jsforce=require(_0x2bdc('0xc'));var deskjs=require(_0x2bdc('0xd'));var toCsv=require(_0x2bdc('0xe'));var querystring=require(_0x2bdc('0xf'));var Papa=require(_0x2bdc('0x10'));var Redis=require(_0x2bdc('0x11'));var authService=require(_0x2bdc('0x12'));var qs=require(_0x2bdc('0x13'));var as=require(_0x2bdc('0x14'));var hardwareService=require(_0x2bdc('0x15'));var logger=require('../../config/logger')(_0x2bdc('0x16'));var utils=require('../../config/utils');var config=require(_0x2bdc('0x17'));var licenseUtil=require(_0x2bdc('0x18'));var db=require(_0x2bdc('0x19'))['db'];function respondWithStatusCode(_0x4928ae,_0x112aca){_0x112aca=_0x112aca||0xcc;return function(_0x503cee){if(_0x503cee){return _0x4928ae[_0x2bdc('0x1a')](_0x112aca);}return _0x4928ae[_0x2bdc('0x1b')](_0x112aca)[_0x2bdc('0x1c')]();};}function respondWithResult(_0x3a52a4,_0x2b0568){_0x2b0568=_0x2b0568||0xc8;return function(_0x335f15){if(_0x335f15){return _0x3a52a4[_0x2bdc('0x1b')](_0x2b0568)['json'](_0x335f15);}};}function respondWithFilteredResult(_0x40128d,_0x79c8d5){return function(_0x2b13ea){if(_0x2b13ea){var _0x514444=typeof _0x79c8d5[_0x2bdc('0x1d')]==='undefined'&&typeof _0x79c8d5[_0x2bdc('0x1e')]==='undefined';var _0x2adf8b=_0x2b13ea[_0x2bdc('0x1f')];var _0x3dfa0d=_0x514444?0x0:_0x79c8d5['offset'];var _0x2054c4=_0x514444?_0x2b13ea[_0x2bdc('0x1f')]:_0x79c8d5[_0x2bdc('0x1d')]+_0x79c8d5['limit'];var _0x16def6;if(_0x2054c4>=_0x2adf8b){_0x2054c4=_0x2adf8b;_0x16def6=0xc8;}else{_0x16def6=0xce;}_0x40128d[_0x2bdc('0x1b')](_0x16def6);return _0x40128d['set'](_0x2bdc('0x20'),_0x3dfa0d+'-'+_0x2054c4+'/'+_0x2adf8b)[_0x2bdc('0x21')](_0x2b13ea);}return null;};}function patchUpdates(_0x29f969){return function(_0x3e98e9){try{jsonpatch[_0x2bdc('0x22')](_0x3e98e9,_0x29f969,!![]);}catch(_0x31d773){return BPromise['reject'](_0x31d773);}return _0x3e98e9[_0x2bdc('0x23')]();};}function saveUpdates(_0x92a2a3,_0xdef070){return function(_0x2ac1eb){if(_0x2ac1eb){return _0x2ac1eb[_0x2bdc('0x24')](_0x92a2a3)['then'](function(_0x2efff1){return _0x2efff1;});}return null;};}function removeEntity(_0x3e692f,_0x3af3be){return function(_0x1c466){if(_0x1c466){return _0x1c466[_0x2bdc('0x25')]()['then'](function(){_0x3e692f[_0x2bdc('0x1b')](0xcc)[_0x2bdc('0x1c')]();});}};}function handleEntityNotFound(_0x1dd4be,_0x536f5b){return function(_0x34cfb0){if(!_0x34cfb0){_0x1dd4be[_0x2bdc('0x1a')](0x194);}return _0x34cfb0;};}function handleError(_0x34a9f8,_0x534434){_0x534434=_0x534434||0x1f4;return function(_0x45cf23){logger[_0x2bdc('0x26')](_0x45cf23[_0x2bdc('0x27')]);if(_0x45cf23[_0x2bdc('0x28')]){delete _0x45cf23['name'];}_0x34a9f8[_0x2bdc('0x1b')](_0x534434)['send'](_0x45cf23);};}exports[_0x2bdc('0x29')]=function(_0x366a05,_0x3327cd){var _0xdf8b6f={},_0x560f43={},_0x4ce40b={'count':0x0,'rows':[]};var _0x518831=_[_0x2bdc('0x2a')](db[_0x2bdc('0x2b')][_0x2bdc('0x2c')],function(_0x333e93){return{'name':_0x333e93[_0x2bdc('0x2d')],'type':_0x333e93[_0x2bdc('0x2e')][_0x2bdc('0x2f')]};});_0x560f43[_0x2bdc('0x30')]=_[_0x2bdc('0x2a')](_0x518831,_0x2bdc('0x28'));_0x560f43[_0x2bdc('0x31')]=_[_0x2bdc('0x32')](_0x366a05[_0x2bdc('0x31')]);_0x560f43['filters']=_['intersection'](_0x560f43[_0x2bdc('0x30')],_0x560f43[_0x2bdc('0x31')]);_0xdf8b6f[_0x2bdc('0x33')]=_[_0x2bdc('0x34')](_0x560f43[_0x2bdc('0x30')],qs[_0x2bdc('0x35')](_0x366a05[_0x2bdc('0x31')][_0x2bdc('0x35')]));_0xdf8b6f[_0x2bdc('0x33')]=_0xdf8b6f[_0x2bdc('0x33')]['length']?_0xdf8b6f[_0x2bdc('0x33')]:_0x560f43[_0x2bdc('0x30')];if(!_0x366a05[_0x2bdc('0x31')][_0x2bdc('0x36')](_0x2bdc('0x37'))){_0xdf8b6f[_0x2bdc('0x1e')]=qs[_0x2bdc('0x1e')](_0x366a05['query'][_0x2bdc('0x1e')]);_0xdf8b6f['offset']=qs[_0x2bdc('0x1d')](_0x366a05['query'][_0x2bdc('0x1d')]);}_0xdf8b6f[_0x2bdc('0x38')]=qs[_0x2bdc('0x39')](_0x366a05[_0x2bdc('0x31')]['sort']);_0xdf8b6f[_0x2bdc('0x3a')]=qs[_0x2bdc('0x3b')](_['pick'](_0x366a05[_0x2bdc('0x31')],_0x560f43[_0x2bdc('0x3b')]),_0x518831);if(_0x366a05[_0x2bdc('0x31')][_0x2bdc('0x3c')]){_0xdf8b6f[_0x2bdc('0x3a')]=_['merge'](_0xdf8b6f['where'],{'$or':_['map'](_0x518831,function(_0x580287){if(_0x580287[_0x2bdc('0x2e')]!==_0x2bdc('0x3d')){var _0x30fc5c={};_0x30fc5c[_0x580287[_0x2bdc('0x28')]]={'$like':'%'+_0x366a05['query'][_0x2bdc('0x3c')]+'%'};return _0x30fc5c;}})});}_0xdf8b6f=_[_0x2bdc('0x3e')]({},_0xdf8b6f,_0x366a05[_0x2bdc('0x3f')]);var _0x185b26={'where':_0xdf8b6f['where']};return db[_0x2bdc('0x2b')][_0x2bdc('0x1f')](_0x185b26)[_0x2bdc('0x40')](function(_0x2e99ab){_0x4ce40b[_0x2bdc('0x1f')]=_0x2e99ab;if(_0x366a05['query'][_0x2bdc('0x41')]){_0xdf8b6f[_0x2bdc('0x42')]=[{'all':!![]}];}return db[_0x2bdc('0x2b')][_0x2bdc('0x43')](_0xdf8b6f);})[_0x2bdc('0x40')](function(_0x5d3051){_0x4ce40b[_0x2bdc('0x44')]=_0x5d3051;return _0x4ce40b;})[_0x2bdc('0x40')](respondWithFilteredResult(_0x3327cd,_0xdf8b6f))[_0x2bdc('0x45')](handleError(_0x3327cd,null));};exports[_0x2bdc('0x46')]=function(_0x3ca751,_0x5c3bd3){var _0x187f7f={'raw':!![],'where':{'id':_0x3ca751['params']['id']}},_0x47f6d8={};_0x47f6d8['model']=_[_0x2bdc('0x32')](db[_0x2bdc('0x2b')][_0x2bdc('0x2c')]);_0x47f6d8['query']=_['keys'](_0x3ca751[_0x2bdc('0x31')]);_0x47f6d8[_0x2bdc('0x3b')]=_[_0x2bdc('0x34')](_0x47f6d8['model'],_0x47f6d8[_0x2bdc('0x31')]);_0x187f7f[_0x2bdc('0x33')]=_[_0x2bdc('0x34')](_0x47f6d8[_0x2bdc('0x30')],qs[_0x2bdc('0x35')](_0x3ca751[_0x2bdc('0x31')][_0x2bdc('0x35')]));_0x187f7f['attributes']=_0x187f7f[_0x2bdc('0x33')][_0x2bdc('0x47')]?_0x187f7f['attributes']:_0x47f6d8['model'];if(_0x3ca751[_0x2bdc('0x31')][_0x2bdc('0x41')]){_0x187f7f[_0x2bdc('0x42')]=[{'all':!![]}];}_0x187f7f=_['merge']({},_0x187f7f,_0x3ca751[_0x2bdc('0x3f')]);return db[_0x2bdc('0x2b')][_0x2bdc('0x48')](_0x187f7f)[_0x2bdc('0x40')](handleEntityNotFound(_0x5c3bd3,null))[_0x2bdc('0x40')](respondWithResult(_0x5c3bd3,null))[_0x2bdc('0x45')](handleError(_0x5c3bd3,null));};exports[_0x2bdc('0x49')]=function(_0xb176dc,_0x2cf1a9){return db[_0x2bdc('0x2b')][_0x2bdc('0x49')](_0xb176dc[_0x2bdc('0x4a')],{})[_0x2bdc('0x40')](respondWithResult(_0x2cf1a9,0xc9))['catch'](handleError(_0x2cf1a9,null));};exports[_0x2bdc('0x24')]=function(_0x3c3a3b,_0x2e3222){if(_0x3c3a3b[_0x2bdc('0x4a')]['id']){delete _0x3c3a3b[_0x2bdc('0x4a')]['id'];}return db[_0x2bdc('0x2b')]['find']({'where':{'id':_0x3c3a3b[_0x2bdc('0x4b')]['id']}})[_0x2bdc('0x40')](handleEntityNotFound(_0x2e3222,null))[_0x2bdc('0x40')](saveUpdates(_0x3c3a3b[_0x2bdc('0x4a')],null))[_0x2bdc('0x40')](respondWithResult(_0x2e3222,null))[_0x2bdc('0x45')](handleError(_0x2e3222,null));};exports[_0x2bdc('0x25')]=function(_0xd5df00,_0x3d1eed){return db[_0x2bdc('0x2b')][_0x2bdc('0x48')]({'where':{'id':_0xd5df00[_0x2bdc('0x4b')]['id']}})[_0x2bdc('0x40')](handleEntityNotFound(_0x3d1eed,null))[_0x2bdc('0x40')](removeEntity(_0x3d1eed,null))[_0x2bdc('0x45')](handleError(_0x3d1eed,null));}; \ No newline at end of file +var _0x1fcc=['update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','error','stack','name','send','map','WhatsappApplication','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x1fcc,0x125));var _0xc1fc=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0x1fcc[_0x5c8827];return _0x50ffd5;};'use strict';var emlformat=require(_0xc1fc('0x0'));var rimraf=require(_0xc1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1fc('0x2'));var rp=require(_0xc1fc('0x3'));var moment=require(_0xc1fc('0x4'));var BPromise=require(_0xc1fc('0x5'));var Mustache=require(_0xc1fc('0x6'));var util=require(_0xc1fc('0x7'));var path=require(_0xc1fc('0x8'));var sox=require('sox');var csv=require(_0xc1fc('0x9'));var ejs=require(_0xc1fc('0xa'));var fs=require('fs');var fs_extra=require(_0xc1fc('0xb'));var _=require('lodash');var squel=require(_0xc1fc('0xc'));var crypto=require(_0xc1fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc1fc('0xe'));var toCsv=require(_0xc1fc('0x9'));var querystring=require('querystring');var Papa=require(_0xc1fc('0xf'));var Redis=require('ioredis');var authService=require(_0xc1fc('0x10'));var qs=require(_0xc1fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1fc('0x12'));var logger=require(_0xc1fc('0x13'))(_0xc1fc('0x14'));var utils=require(_0xc1fc('0x15'));var config=require(_0xc1fc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1fc('0x17'))['db'];function respondWithStatusCode(_0x10d1d3,_0x354393){_0x354393=_0x354393||0xcc;return function(_0x55c62b){if(_0x55c62b){return _0x10d1d3[_0xc1fc('0x18')](_0x354393);}return _0x10d1d3[_0xc1fc('0x19')](_0x354393)[_0xc1fc('0x1a')]();};}function respondWithResult(_0x52b0bb,_0x2a8519){_0x2a8519=_0x2a8519||0xc8;return function(_0x338ca8){if(_0x338ca8){return _0x52b0bb[_0xc1fc('0x19')](_0x2a8519)[_0xc1fc('0x1b')](_0x338ca8);}};}function respondWithFilteredResult(_0x232bc2,_0xd04a31){return function(_0x476bcf){if(_0x476bcf){var _0x427326=typeof _0xd04a31[_0xc1fc('0x1c')]===_0xc1fc('0x1d')&&typeof _0xd04a31['limit']===_0xc1fc('0x1d');var _0x5626d6=_0x476bcf['count'];var _0x6c0e26=_0x427326?0x0:_0xd04a31[_0xc1fc('0x1c')];var _0x3fba13=_0x427326?_0x476bcf[_0xc1fc('0x1e')]:_0xd04a31[_0xc1fc('0x1c')]+_0xd04a31[_0xc1fc('0x1f')];var _0x28e2d2;if(_0x3fba13>=_0x5626d6){_0x3fba13=_0x5626d6;_0x28e2d2=0xc8;}else{_0x28e2d2=0xce;}_0x232bc2[_0xc1fc('0x19')](_0x28e2d2);return _0x232bc2[_0xc1fc('0x20')]('Content-Range',_0x6c0e26+'-'+_0x3fba13+'/'+_0x5626d6)[_0xc1fc('0x1b')](_0x476bcf);}return null;};}function patchUpdates(_0x36122b){return function(_0x56b0f3){try{jsonpatch['apply'](_0x56b0f3,_0x36122b,!![]);}catch(_0x36345c){return BPromise[_0xc1fc('0x21')](_0x36345c);}return _0x56b0f3[_0xc1fc('0x22')]();};}function saveUpdates(_0x528900,_0x474c8f){return function(_0x54d500){if(_0x54d500){return _0x54d500['update'](_0x528900)[_0xc1fc('0x23')](function(_0x8b5912){return _0x8b5912;});}return null;};}function removeEntity(_0x34aaa4,_0x3aacf2){return function(_0x214ddd){if(_0x214ddd){return _0x214ddd[_0xc1fc('0x24')]()['then'](function(){_0x34aaa4[_0xc1fc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27723f,_0x38fd5c){return function(_0x489f41){if(!_0x489f41){_0x27723f[_0xc1fc('0x18')](0x194);}return _0x489f41;};}function handleError(_0x2d6f4a,_0x281d16){_0x281d16=_0x281d16||0x1f4;return function(_0x23594f){logger[_0xc1fc('0x25')](_0x23594f[_0xc1fc('0x26')]);if(_0x23594f['name']){delete _0x23594f[_0xc1fc('0x27')];}_0x2d6f4a[_0xc1fc('0x19')](_0x281d16)[_0xc1fc('0x28')](_0x23594f);};}exports['index']=function(_0xf45540,_0x47ad51){var _0x3c0da5={},_0x1977a4={},_0x11afe8={'count':0x0,'rows':[]};var _0x16d15c=_[_0xc1fc('0x29')](db[_0xc1fc('0x2a')]['rawAttributes'],function(_0x39f60d){return{'name':_0x39f60d['fieldName'],'type':_0x39f60d[_0xc1fc('0x2b')][_0xc1fc('0x2c')]};});_0x1977a4['model']=_['map'](_0x16d15c,_0xc1fc('0x27'));_0x1977a4['query']=_[_0xc1fc('0x2d')](_0xf45540[_0xc1fc('0x2e')]);_0x1977a4['filters']=_[_0xc1fc('0x2f')](_0x1977a4['model'],_0x1977a4[_0xc1fc('0x2e')]);_0x3c0da5[_0xc1fc('0x30')]=_['intersection'](_0x1977a4[_0xc1fc('0x31')],qs[_0xc1fc('0x32')](_0xf45540['query'][_0xc1fc('0x32')]));_0x3c0da5[_0xc1fc('0x30')]=_0x3c0da5['attributes'][_0xc1fc('0x33')]?_0x3c0da5['attributes']:_0x1977a4['model'];if(!_0xf45540[_0xc1fc('0x2e')][_0xc1fc('0x34')]('nolimit')){_0x3c0da5[_0xc1fc('0x1f')]=qs[_0xc1fc('0x1f')](_0xf45540[_0xc1fc('0x2e')][_0xc1fc('0x1f')]);_0x3c0da5[_0xc1fc('0x1c')]=qs[_0xc1fc('0x1c')](_0xf45540[_0xc1fc('0x2e')][_0xc1fc('0x1c')]);}_0x3c0da5[_0xc1fc('0x35')]=qs['sort'](_0xf45540['query'][_0xc1fc('0x36')]);_0x3c0da5['where']=qs[_0xc1fc('0x37')](_[_0xc1fc('0x38')](_0xf45540[_0xc1fc('0x2e')],_0x1977a4[_0xc1fc('0x37')]),_0x16d15c);if(_0xf45540['query']['filter']){_0x3c0da5[_0xc1fc('0x39')]=_[_0xc1fc('0x3a')](_0x3c0da5[_0xc1fc('0x39')],{'$or':_[_0xc1fc('0x29')](_0x16d15c,function(_0x722d12){if(_0x722d12[_0xc1fc('0x2b')]!==_0xc1fc('0x3b')){var _0x142e53={};_0x142e53[_0x722d12['name']]={'$like':'%'+_0xf45540['query'][_0xc1fc('0x3c')]+'%'};return _0x142e53;}})});}_0x3c0da5=_['merge']({},_0x3c0da5,_0xf45540[_0xc1fc('0x3d')]);var _0x493831={'where':_0x3c0da5[_0xc1fc('0x39')]};return db['WhatsappApplication']['count'](_0x493831)[_0xc1fc('0x23')](function(_0x46b18d){_0x11afe8[_0xc1fc('0x1e')]=_0x46b18d;if(_0xf45540['query']['includeAll']){_0x3c0da5[_0xc1fc('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x3c0da5);})[_0xc1fc('0x23')](function(_0x2366d1){_0x11afe8[_0xc1fc('0x3f')]=_0x2366d1;return _0x11afe8;})['then'](respondWithFilteredResult(_0x47ad51,_0x3c0da5))['catch'](handleError(_0x47ad51,null));};exports[_0xc1fc('0x40')]=function(_0x2e48c1,_0x38fe43){var _0x43017d={'raw':!![],'where':{'id':_0x2e48c1[_0xc1fc('0x41')]['id']}},_0x3fcd72={};_0x3fcd72[_0xc1fc('0x31')]=_[_0xc1fc('0x2d')](db[_0xc1fc('0x2a')][_0xc1fc('0x42')]);_0x3fcd72[_0xc1fc('0x2e')]=_['keys'](_0x2e48c1[_0xc1fc('0x2e')]);_0x3fcd72[_0xc1fc('0x37')]=_[_0xc1fc('0x2f')](_0x3fcd72[_0xc1fc('0x31')],_0x3fcd72[_0xc1fc('0x2e')]);_0x43017d[_0xc1fc('0x30')]=_[_0xc1fc('0x2f')](_0x3fcd72['model'],qs[_0xc1fc('0x32')](_0x2e48c1[_0xc1fc('0x2e')][_0xc1fc('0x32')]));_0x43017d[_0xc1fc('0x30')]=_0x43017d[_0xc1fc('0x30')][_0xc1fc('0x33')]?_0x43017d[_0xc1fc('0x30')]:_0x3fcd72[_0xc1fc('0x31')];if(_0x2e48c1['query'][_0xc1fc('0x43')]){_0x43017d[_0xc1fc('0x3e')]=[{'all':!![]}];}_0x43017d=_[_0xc1fc('0x3a')]({},_0x43017d,_0x2e48c1[_0xc1fc('0x3d')]);return db['WhatsappApplication'][_0xc1fc('0x44')](_0x43017d)[_0xc1fc('0x23')](handleEntityNotFound(_0x38fe43,null))[_0xc1fc('0x23')](respondWithResult(_0x38fe43,null))[_0xc1fc('0x45')](handleError(_0x38fe43,null));};exports[_0xc1fc('0x46')]=function(_0x3b4b8d,_0xe76f74){return db[_0xc1fc('0x2a')][_0xc1fc('0x46')](_0x3b4b8d[_0xc1fc('0x47')],{})[_0xc1fc('0x23')](respondWithResult(_0xe76f74,0xc9))['catch'](handleError(_0xe76f74,null));};exports[_0xc1fc('0x48')]=function(_0x1ca680,_0x89bf6a){if(_0x1ca680[_0xc1fc('0x47')]['id']){delete _0x1ca680['body']['id'];}return db['WhatsappApplication'][_0xc1fc('0x44')]({'where':{'id':_0x1ca680['params']['id']}})['then'](handleEntityNotFound(_0x89bf6a,null))[_0xc1fc('0x23')](saveUpdates(_0x1ca680['body'],null))[_0xc1fc('0x23')](respondWithResult(_0x89bf6a,null))[_0xc1fc('0x45')](handleError(_0x89bf6a,null));};exports['destroy']=function(_0x2930ff,_0x48669c){return db[_0xc1fc('0x2a')]['find']({'where':{'id':_0x2930ff[_0xc1fc('0x41')]['id']}})[_0xc1fc('0x23')](handleEntityNotFound(_0x48669c,null))[_0xc1fc('0x23')](removeEntity(_0x48669c,null))[_0xc1fc('0x45')](handleError(_0x48669c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 58f7fdc..5bcfbb0 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 _0x79a8=['request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x1f6744,_0x56c212){var _0x536673=function(_0x5872e5){while(--_0x5872e5){_0x1f6744['push'](_0x1f6744['shift']());}};_0x536673(++_0x56c212);}(_0x79a8,0x1d0));var _0x879a=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0x79a8[_0x544b3f];return _0x15787f;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var logger=require(_0x879a('0x1'))(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var BPromise=require('bluebird');var rp=require(_0x879a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var attributes=require(_0x879a('0x7'));module[_0x879a('0x8')]=function(_0x1808f1,_0x3cb89c){return _0x1808f1[_0x879a('0x9')](_0x879a('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x879a('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf25a=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x51356c,_0x501f0c){var _0x2ebe29=function(_0x581edd){while(--_0x581edd){_0x51356c['push'](_0x51356c['shift']());}};_0x2ebe29(++_0x501f0c);}(_0xf25a,0x195));var _0xaf25=function(_0x38b7eb,_0x4bbef7){_0x38b7eb=_0x38b7eb-0x0;var _0x3c930e=_0xf25a[_0x38b7eb];return _0x3c930e;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var logger=require(_0xaf25('0x2'))('api');var moment=require(_0xaf25('0x3'));var BPromise=require(_0xaf25('0x4'));var rp=require(_0xaf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf25('0x6'));var config=require(_0xaf25('0x7'));var attributes=require(_0xaf25('0x8'));module['exports']=function(_0x49281b,_0x30eaae){return _0x49281b['define']('WhatsappApplication',attributes,{'tableName':_0xaf25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf25('0xa'),'collate':_0xaf25('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index d7c178f..cbba3d2 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 _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3cd91d,_0x163516){var _0x3b4fab=function(_0x1b3319){while(--_0x1b3319){_0x3cd91d['push'](_0x3cd91d['shift']());}};_0x3b4fab(++_0x163516);}(_0x5c12,0x188));var _0x25c1=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0x5c12[_0x54f7c0];return _0x245d03;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file +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(_0x595e96,_0x39b21b){var _0x382e4d=function(_0x3a1462){while(--_0x3a1462){_0x595e96['push'](_0x595e96['shift']());}};_0x382e4d(++_0x39b21b);}(_0xe14d,0x1ee));var _0xde14=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xe14d[_0x4fc9e6];return _0x551d28;};'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 diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 4f24855..fecb2c1 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 _0xafc4=['show','/:id/messages','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id'];(function(_0x4d7988,_0x4c62e3){var _0x97e287=function(_0x223966){while(--_0x223966){_0x4d7988['push'](_0x4d7988['shift']());}};_0x97e287(++_0x4c62e3);}(_0xafc4,0x69));var _0x4afc=function(_0x233cff,_0x5e67d6){_0x233cff=_0x233cff-0x0;var _0x426861=_0xafc4[_0x233cff];return _0x426861;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0x6')](_0x4afc('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x4afc('0x6')]('/:id/download',auth[_0x4afc('0x7')](),controller[_0x4afc('0xd')]);router['post']('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0xe')]);router[_0x4afc('0xf')](_0x4afc('0xc'),auth[_0x4afc('0x7')](),controller[_0x4afc('0x10')]);router[_0x4afc('0xf')](_0x4afc('0x11'),auth['isAuthenticated'](),interaction[_0x4afc('0x12')](_0x4afc('0x13'),_0x4afc('0x14')),controller[_0x4afc('0x15')]);router['put']('/:id',auth[_0x4afc('0x7')](),interaction['tracked'](_0x4afc('0x13'),_0x4afc('0x16')),controller[_0x4afc('0x17')]);router[_0x4afc('0x18')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),interaction[_0x4afc('0x12')](_0x4afc('0x13'),_0x4afc('0x19')),controller[_0x4afc('0x1a')]);router[_0x4afc('0x18')]('/:id/tags',auth[_0x4afc('0x7')](),controller[_0x4afc('0x1b')]);module[_0x4afc('0x1c')]=router; \ No newline at end of file +var _0x02a7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','getMessages','/:id/download','post','create','/:id/messages','addMessage','tracked','delete','whatsapp','destroy','removeTags','exports','util','express','Router'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x02a7,0x7a));var _0x702a=function(_0x9d4244,_0x474456){_0x9d4244=_0x9d4244-0x0;var _0x5e6a50=_0x02a7[_0x9d4244];return _0x5e6a50;};'use strict';var multer=require('multer');var util=require(_0x702a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x702a('0x1'));var router=express[_0x702a('0x2')]();var fs_extra=require(_0x702a('0x3'));var auth=require(_0x702a('0x4'));var interaction=require(_0x702a('0x5'));var config=require(_0x702a('0x6'));var controller=require(_0x702a('0x7'));router['get']('/',auth[_0x702a('0x8')](),controller['index']);router[_0x702a('0x9')](_0x702a('0xa'),auth[_0x702a('0x8')](),controller[_0x702a('0xb')]);router[_0x702a('0x9')](_0x702a('0xc'),auth[_0x702a('0x8')](),controller['show']);router[_0x702a('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x702a('0xd')]);router[_0x702a('0x9')](_0x702a('0xe'),auth[_0x702a('0x8')](),controller['download']);router[_0x702a('0xf')]('/',auth[_0x702a('0x8')](),controller[_0x702a('0x10')]);router[_0x702a('0xf')](_0x702a('0x11'),auth[_0x702a('0x8')](),controller[_0x702a('0x12')]);router['post']('/:id/tags',auth[_0x702a('0x8')](),interaction['tracked']('whatsapp','whatsappinteraction:addtags'),controller['addTags']);router['put'](_0x702a('0xc'),auth[_0x702a('0x8')](),interaction[_0x702a('0x13')]('whatsapp','whatsappinteraction:update'),controller['update']);router[_0x702a('0x14')](_0x702a('0xc'),auth[_0x702a('0x8')](),interaction['tracked'](_0x702a('0x15'),'whatsappinteraction:destroy'),controller[_0x702a('0x16')]);router[_0x702a('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x702a('0x17')]);module[_0x702a('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 632dd46..8f0a597 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 _0x86f4=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x7520f6,_0x570e8a){var _0x459ed7=function(_0x3a0f29){while(--_0x3a0f29){_0x7520f6['push'](_0x7520f6['shift']());}};_0x459ed7(++_0x570e8a);}(_0x86f4,0x18a));var _0x486f=function(_0x52f19e,_0x3a4506){_0x52f19e=_0x52f19e-0x0;var _0x51622c=_0x86f4[_0x52f19e];return _0x51622c;};'use strict';var Sequelize=require(_0x486f('0x0'));var moment=require(_0x486f('0x1'));module[_0x486f('0x2')]={'closed':{'type':Sequelize[_0x486f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x486f('0x4')]},'disposition':{'type':Sequelize[_0x486f('0x5')]},'secondDisposition':{'type':Sequelize[_0x486f('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x486f('0x5')]},'phone':{'type':Sequelize[_0x486f('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x486f('0x6')]('in',_0x486f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x486f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x486f('0x6')]('in',_0x486f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x486f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0686=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x193aa3,_0xb5c42a){var _0x136d04=function(_0x576a4f){while(--_0x576a4f){_0x193aa3['push'](_0x193aa3['shift']());}};_0x136d04(++_0xb5c42a);}(_0x0686,0x123));var _0x6068=function(_0x186103,_0x39c382){_0x186103=_0x186103-0x0;var _0x2478e6=_0x0686[_0x186103];return _0x2478e6;};'use strict';var Sequelize=require(_0x6068('0x0'));var moment=require(_0x6068('0x1'));module[_0x6068('0x2')]={'closed':{'type':Sequelize[_0x6068('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6068('0x4')]},'disposition':{'type':Sequelize[_0x6068('0x5')]},'secondDisposition':{'type':Sequelize[_0x6068('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6068('0x5')]},'phone':{'type':Sequelize[_0x6068('0x5')]},'read1stAt':{'type':Sequelize[_0x6068('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6068('0x6')]('in',_0x6068('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6068('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6068('0x6')]('in',_0x6068('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6068('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index bf7a95e..cb43377 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 _0xb205=['createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','count','set','reject','save','update','then','destroy','error','stack','map','fullname','TagIds','Tags','split','forEach','push','catch','index','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','name','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$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','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','WhatsappInteraction','rawAttributes','include','create','body','params','describe','addMessage','ids','findOne','WhatsappMessage','options','includeAll','findAll','addTags','setTags','omit','spread','removeTags','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','User','Contact','firstName','lastName','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Attachment','existsSync','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','.pdf'];(function(_0xe44b1,_0x242100){var _0x368147=function(_0x3cd64c){while(--_0x3cd64c){_0xe44b1['push'](_0xe44b1['shift']());}};_0x368147(++_0x242100);}(_0xb205,0xf0));var _0x5b20=function(_0xab12a,_0x16b930){_0xab12a=_0xab12a-0x0;var _0x185fa3=_0xb205[_0xab12a];return _0x185fa3;};'use strict';var emlformat=require(_0x5b20('0x0'));var rimraf=require(_0x5b20('0x1'));var zipdir=require(_0x5b20('0x2'));var jsonpatch=require(_0x5b20('0x3'));var rp=require(_0x5b20('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b20('0x5'));var util=require('util');var path=require(_0x5b20('0x6'));var sox=require(_0x5b20('0x7'));var csv=require('to-csv');var ejs=require(_0x5b20('0x8'));var fs=require('fs');var fs_extra=require(_0x5b20('0x9'));var _=require(_0x5b20('0xa'));var squel=require('squel');var crypto=require(_0x5b20('0xb'));var jsforce=require(_0x5b20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b20('0xd'));var Papa=require(_0x5b20('0xe'));var Redis=require(_0x5b20('0xf'));var authService=require(_0x5b20('0x10'));var qs=require(_0x5b20('0x11'));var as=require(_0x5b20('0x12'));var pdf=require(_0x5b20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b20('0x14'))(_0x5b20('0x15'));var utils=require(_0x5b20('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b20('0x17'))['db'];config[_0x5b20('0x18')]=_[_0x5b20('0x19')](config[_0x5b20('0x18')],{'host':_0x5b20('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b20('0x18')]));require(_0x5b20('0x1b'))[_0x5b20('0x1c')](socket);function respondWithStatusCode(_0x20d7b6,_0x519f9f){_0x519f9f=_0x519f9f||0xcc;return function(_0x5247f9){if(_0x5247f9){return _0x20d7b6[_0x5b20('0x1d')](_0x519f9f);}return _0x20d7b6['status'](_0x519f9f)['end']();};}function respondWithResult(_0x31b9dd,_0x52042b){_0x52042b=_0x52042b||0xc8;return function(_0x43b7b0){if(_0x43b7b0){return _0x31b9dd[_0x5b20('0x1e')](_0x52042b)[_0x5b20('0x1f')](_0x43b7b0);}};}function respondWithFilteredResult(_0x498986,_0x44ac15){return function(_0x301c9a){if(_0x301c9a){var _0x3e37ef=typeof _0x44ac15[_0x5b20('0x20')]==='undefined'&&typeof _0x44ac15[_0x5b20('0x21')]==='undefined';var _0x1a75d7=_0x301c9a[_0x5b20('0x22')];var _0x4ea691=_0x3e37ef?0x0:_0x44ac15[_0x5b20('0x20')];var _0x54cdf3=_0x3e37ef?_0x301c9a[_0x5b20('0x22')]:_0x44ac15['offset']+_0x44ac15[_0x5b20('0x21')];var _0x28fe6e;if(_0x54cdf3>=_0x1a75d7){_0x54cdf3=_0x1a75d7;_0x28fe6e=0xc8;}else{_0x28fe6e=0xce;}_0x498986['status'](_0x28fe6e);return _0x498986[_0x5b20('0x23')]('Content-Range',_0x4ea691+'-'+_0x54cdf3+'/'+_0x1a75d7)['json'](_0x301c9a);}return null;};}function patchUpdates(_0xea7776){return function(_0x517e12){try{jsonpatch['apply'](_0x517e12,_0xea7776,!![]);}catch(_0x37ab76){return BPromise[_0x5b20('0x24')](_0x37ab76);}return _0x517e12[_0x5b20('0x25')]();};}function saveUpdates(_0x437621,_0x3c3c47){return function(_0xb0f07e){if(_0xb0f07e){return _0xb0f07e[_0x5b20('0x26')](_0x437621)[_0x5b20('0x27')](function(_0x56aa6a){return _0x56aa6a;});}return null;};}function removeEntity(_0x285249,_0x102b05){return function(_0x205c11){if(_0x205c11){return _0x205c11[_0x5b20('0x28')]()[_0x5b20('0x27')](function(){_0x285249[_0x5b20('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ff2d,_0x49a15d){return function(_0x444195){if(!_0x444195){_0x16ff2d[_0x5b20('0x1d')](0x194);}return _0x444195;};}function handleError(_0x1d4c46,_0x516f16){_0x516f16=_0x516f16||0x1f4;return function(_0x492342){logger[_0x5b20('0x29')](_0x492342[_0x5b20('0x2a')]);if(_0x492342['name']){delete _0x492342['name'];}_0x1d4c46[_0x5b20('0x1e')](_0x516f16)['send'](_0x492342);};}function getInteractionUsers(_0x3aee17,_0x13d302){return new BPromise(function(_0x3f599c,_0x344688){try{if(_0x13d302[_0x3aee17['id']]){_0x3aee17['Users']=_[_0x5b20('0x2b')](_0x13d302[_0x3aee17['id']],function(_0xf84eb7){return{'id':_0xf84eb7['id'],'fullname':_0xf84eb7[_0x5b20('0x2c')]};});}}catch(_0xf480fd){_0x344688(_0xf480fd);}_0x3f599c(_0x3aee17);});}function getInteractionTags(_0x5ce609,_0x29d17a){return new BPromise(function(_0xc9f578,_0x2780dc){try{if(_0x5ce609[_0x5b20('0x2d')]){_0x5ce609[_0x5b20('0x2e')]=[];_0x5ce609[_0x5b20('0x2d')][_0x5b20('0x2f')](',')[_0x5b20('0x30')](function(_0x33b98a){_0x5ce609[_0x5b20('0x2e')][_0x5b20('0x31')](_0x29d17a[_0x33b98a]);});}delete _0x5ce609[_0x5b20('0x2d')];}catch(_0x199830){_0x2780dc(_0x199830);}_0xc9f578(_0x5ce609);});}function updateWhatsappInteraction(_0x460d43,_0x117d0a,_0x553a20){return new BPromise(function(_0x4ad57f,_0x54e244){return getInteractionUsers(_0x460d43,_0x553a20)[_0x5b20('0x27')](function(_0x2f78cf){return getInteractionTags(_0x2f78cf,_0x117d0a);})[_0x5b20('0x27')](function(_0x31820e){_0x4ad57f(_0x31820e);})[_0x5b20('0x32')](function(_0x5eccb2){_0x54e244(_0x5eccb2);});});}exports[_0x5b20('0x33')]=function(_0x1c8ed6,_0x2af90d){var _0x304d51={},_0x3de50a={},_0x6c89b2={'count':0x0,'rows':[]};var _0x2d0cd9=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x2fb524){return{'name':_0x2fb524[_0x5b20('0x34')],'type':_0x2fb524[_0x5b20('0x35')][_0x5b20('0x36')]};});_0x3de50a[_0x5b20('0x37')]=_[_0x5b20('0x2b')](_0x2d0cd9,'name');_0x3de50a['query']=_[_0x5b20('0x38')](_0x1c8ed6[_0x5b20('0x39')]);_0x3de50a['filters']=_[_0x5b20('0x3a')](_0x3de50a[_0x5b20('0x37')],_0x3de50a[_0x5b20('0x39')]);_0x304d51[_0x5b20('0x3b')]=_[_0x5b20('0x3a')](_0x3de50a[_0x5b20('0x37')],qs[_0x5b20('0x3c')](_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x3c')]));_0x304d51[_0x5b20('0x3b')]=_0x304d51[_0x5b20('0x3b')][_0x5b20('0x3d')]?_0x304d51['attributes']:_0x3de50a[_0x5b20('0x37')];if(!_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x3e')](_0x5b20('0x3f'))){_0x304d51[_0x5b20('0x21')]=qs[_0x5b20('0x21')](_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x21')]);_0x304d51[_0x5b20('0x20')]=qs[_0x5b20('0x20')](_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x20')]);}_0x304d51[_0x5b20('0x40')]=qs[_0x5b20('0x41')](_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x41')]);_0x304d51[_0x5b20('0x42')]=qs[_0x5b20('0x43')](_[_0x5b20('0x44')](_0x1c8ed6[_0x5b20('0x39')],_0x3de50a[_0x5b20('0x43')]),_0x2d0cd9);var _0xa30aba=[];var _0x13326e=squel[_0x5b20('0x45')]()[_0x5b20('0x46')]('id')[_0x5b20('0x46')](_0x5b20('0x47'))['field'](_0x5b20('0x48'))[_0x5b20('0x49')](_0x5b20('0x4a'));var _0xeae4dd=squel[_0x5b20('0x45')]()[_0x5b20('0x46')](_0x5b20('0x4b'))['field'](_0x5b20('0x4c'))[_0x5b20('0x46')](_0x5b20('0x4d'))[_0x5b20('0x49')](_0x5b20('0x4e'),'ui')[_0x5b20('0x4f')](_0x5b20('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x1f0df8=squel[_0x5b20('0x45')]()['from'](_0x5b20('0x51'),'i')[_0x5b20('0x4f')]('cm_contacts','c',_0x5b20('0x52'))[_0x5b20('0x4f')](_0x5b20('0x50'),'o',_0x5b20('0x53'))[_0x5b20('0x4f')](_0x5b20('0x54'),'a',_0x5b20('0x55'))[_0x5b20('0x4f')]('whatsapp_messages','me',_0x5b20('0x56'))[_0x5b20('0x4f')](_0x5b20('0x57'),'it',_0x5b20('0x58'))[_0x5b20('0x4f')](_0x5b20('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x4536ab=squel[_0x5b20('0x59')]();var _0x5b93db=[];var _0x464d43=squel['expr']();var _0x110480;if(_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x5a')]){_0x110480=as[_0x5b20('0x5b')](_0x1c8ed6['query'][_0x5b20('0x5a')]);var _0x6cbe57=_0x110480[_0x5b20('0x5c')];for(var _0x1830f1=0x0;_0x1830f1<_0x110480[_0x5b20('0x5d')][_0x5b20('0x3d')];_0x1830f1++){var _0x2fd428=_0x110480['conditions'][_0x1830f1];var _0x55fc94='i';var _0x2699bf=_[_0x5b20('0x5e')](_0x2d0cd9,[_0x5b20('0x47'),_0x2fd428['field']]);if(!_0x2699bf){switch(_0x2fd428[_0x5b20('0x46')]){case _0x5b20('0x5f'):if(_0x2fd428[_0x5b20('0x60')]==0x1){_0x1f0df8['having']('`'+_0x2fd428[_0x5b20('0x46')]+_0x5b20('0x61'));}else{_0x1f0df8[_0x5b20('0x62')]('`'+_0x2fd428['field']+_0x5b20('0x63'));}break;case'Contact':if(_0x2fd428[_0x5b20('0x64')]===_0x5b20('0x65')){if(_0x2fd428[_0x5b20('0x60')][_0x5b20('0x2f')]('\x20')['length']>0x1){_0x4536ab[_0x6cbe57](_0x5b20('0x66'),qs['getFullTextValue'](_0x2fd428[_0x5b20('0x60')]),null);}else{var _0x4e66fd='%'+_0x2fd428['value']+'%';_0x4536ab[_0x6cbe57](_0x5b20('0x67'),_0x4e66fd,_0x4e66fd,_0x4e66fd);}}else{_0x2699bf=_[_0x5b20('0x5e')](_0x2d0cd9,[_0x5b20('0x47'),_0x5b20('0x68')]);_0x2fd428['field']='ContactId';_0x15a151=as[_0x5b20('0x69')](_0x55fc94,_0x2699bf[_0x5b20('0x35')],_0x2fd428);_0x4536ab[_0x6cbe57](_0x15a151[_0x5b20('0x6a')],_0x15a151[_0x5b20('0x60')][_0x5b20('0x6b')],_0x15a151['value'][_0x5b20('0x6c')]);}break;case _0x5b20('0x6d'):var _0x3241a9=_0x2fd428[_0x5b20('0x60')][_0x5b20('0x2f')](',')[_0x5b20('0x2b')](function(_0x2743ff){return Number(_0x2743ff);});_0x3241a9['forEach'](function(_0x3f5db6){_0x464d43['or'](_0x5b20('0x6e'),'%,'+_0x3f5db6+',%');});_0x5b93db=_[_0x5b20('0x6f')](_0x5b93db,_0x3241a9);break;case'User':if(_0x2fd428[_0x5b20('0x64')]===_0x5b20('0x65')){_0x4536ab[_0x6cbe57](_0x5b20('0x70'),'%'+_0x2fd428[_0x5b20('0x60')]+'%',null);}else{_0x2699bf=_['find'](_0x2d0cd9,[_0x5b20('0x47'),_0x5b20('0x71')]);_0x2fd428[_0x5b20('0x46')]=_0x5b20('0x71');_0x15a151=as[_0x5b20('0x69')](_0x55fc94,_0x2699bf['type'],_0x2fd428);_0x4536ab[_0x6cbe57](_0x15a151['text'],_0x15a151['value']['start'],_0x15a151['value']['end']);}break;case'body':_0x15a151=as[_0x5b20('0x69')]('me',null,_0x2fd428);_0x4536ab[_0x6cbe57](_0x15a151[_0x5b20('0x6a')],_0x15a151[_0x5b20('0x60')][_0x5b20('0x6b')],_0x15a151['value']['end']);break;}}else{var _0x15a151=as[_0x5b20('0x69')](_0x55fc94,_0x2699bf[_0x5b20('0x35')],_0x2fd428);_0x4536ab[_0x6cbe57](_0x15a151[_0x5b20('0x6a')],_0x15a151['value']['start'],_0x15a151[_0x5b20('0x60')][_0x5b20('0x6c')]);}}}else{var _0x42e992=_(_0x1c8ed6[_0x5b20('0x39')])['keys']()[_0x5b20('0x2b')](function(_0x2e4692){return _['some'](_0x2d0cd9,[_0x5b20('0x47'),_0x2e4692])?_0x2e4692:undefined;})[_0x5b20('0x72')]()[_0x5b20('0x60')]();if(!_[_0x5b20('0x73')](_0x42e992)){_0x42e992[_0x5b20('0x30')](function(_0x48fb7a){if(_0x48fb7a===_0x5b20('0x74')){_0x1f0df8[_0x5b20('0x42')](_0x5b20('0x75'),[][_0x5b20('0x76')](_0x1c8ed6[_0x5b20('0x39')][_0x48fb7a]));}else if(_0x48fb7a==='createdAt'){var _0x215f71=JSON[_0x5b20('0x77')](_0x1c8ed6[_0x5b20('0x39')][_0x48fb7a])[_0x5b20('0x78')];var _0x1ddfec=JSON[_0x5b20('0x77')](_0x1c8ed6[_0x5b20('0x39')][_0x48fb7a])[_0x5b20('0x79')];_0x1f0df8['where'](_0x5b20('0x7a'),_0x215f71,_0x1ddfec);}else{if(_0x1c8ed6['query'][_0x48fb7a]==='null'){_0x1f0df8[_0x5b20('0x42')]('i.'+_0x48fb7a+_0x5b20('0x7b'));}else{_0x1f0df8[_0x5b20('0x42')]('i.'+_0x48fb7a+_0x5b20('0x7c'),_0x1c8ed6[_0x5b20('0x39')][_0x48fb7a]);}}});}if(_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x7d')]){if(_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x7d')]==0x1){_0x1f0df8[_0x5b20('0x62')](_0x5b20('0x7e'));}else{_0x1f0df8['having'](_0x5b20('0x7f'));}}if(_0x1c8ed6['query'][_0x5b20('0x80')]){_0x5b93db=_[_0x5b20('0x81')](_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x80')])?_0x1c8ed6[_0x5b20('0x39')]['tag']:new Array(_0x1c8ed6['query'][_0x5b20('0x80')]);_0x5b93db[_0x5b20('0x30')](function(_0x218f49){_0x464d43['or'](_0x5b20('0x6e'),'%,'+_0x218f49+',%');});}if(_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x82')]){var _0x312fea=_0x1c8ed6[_0x5b20('0x39')]['filter'][_0x5b20('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x5b20('0x84')](_0x312fea)){_0x4536ab['or'](_0x5b20('0x85'),_0x312fea+'%')['or']('i.phone\x20LIKE\x20?',_0x312fea+'%');}else{_0x4536ab['or'](_0x5b20('0x86'),qs[_0x5b20('0x87')](_0x312fea))['or'](_0x5b20('0x88'),_0x312fea+'%');}}}_0x1f0df8[_0x5b20('0x42')](_0x4536ab);_0x1f0df8[_0x5b20('0x89')](_0x5b20('0x8a'));var _0x2cc4b4={'type':db['Sequelize'][_0x5b20('0x8b')]['SELECT'],'raw':!![]};var _0x52fccc=_0x1f0df8[_0x5b20('0x8c')]();_0x52fccc[_0x5b20('0x46')]('i.id');_0x52fccc[_0x5b20('0x46')](_0x5b20('0x8d'),'unreadMessages');if(_0x304d51[_0x5b20('0x40')]){_0x304d51[_0x5b20('0x40')][_0x5b20('0x30')](function(_0xf00341){var _0x441abd=_0xf00341[0x0]==='contactName'?_0xf00341[0x0]:'i.'+_0xf00341[0x0];_0x1f0df8['order'](_0x441abd,_0xf00341[0x1]===_0x5b20('0x8e')?![]:!![]);});}if(!_[_0x5b20('0x73')](_0x5b93db)){_0x1f0df8[_0x5b20('0x62')](_0x464d43);_0x52fccc[_0x5b20('0x42')](_0x5b20('0x8f'),_0x5b93db);}BPromise['resolve']()[_0x5b20('0x27')](function(){if(!_0x110480){if(_0x1c8ed6[_0x5b20('0x39')][_0x5b20('0x74')])return;_0x52fccc[_0x5b20('0x42')](_0x5b20('0x90'));_0x1f0df8[_0x5b20('0x42')](_0x5b20('0x90'));return;}if(_0x1c8ed6[_0x5b20('0x91')][_0x5b20('0x92')]!=='agent')return;return _0x1c8ed6[_0x5b20('0x91')][_0x5b20('0x93')]({'attributes':['id'],'raw':!![]})[_0x5b20('0x27')](function(_0x52bc5f){if(_['isEmpty'](_0x52bc5f)){_0x52fccc[_0x5b20('0x42')](_0x5b20('0x94'));_0x1f0df8[_0x5b20('0x42')](_0x5b20('0x94'));}else{_0x52fccc[_0x5b20('0x42')](_0x5b20('0x75'),_['map'](_0x52bc5f,'id'));_0x1f0df8[_0x5b20('0x42')](_0x5b20('0x75'),_['map'](_0x52bc5f,'id'));}});})[_0x5b20('0x27')](function(){if(_0x1c8ed6[_0x5b20('0x91')]['role']===_0x5b20('0x95')&&!_0x110480&&!_0x1c8ed6['query'][_0x5b20('0x74')])return[];return db[_0x5b20('0x96')][_0x5b20('0x39')](_0x52fccc['toString'](),_0x2cc4b4);})[_0x5b20('0x27')](function(_0x235adc){_0x6c89b2[_0x5b20('0x22')]=_0x235adc['length'];if(_0x6c89b2[_0x5b20('0x22')]===0x0)return[];return db[_0x5b20('0x96')][_0x5b20('0x39')](_0x13326e[_0x5b20('0x97')](),_0x2cc4b4)['then'](function(_0x5d4cdb){_0xa30aba=_[_0x5b20('0x98')](_0x5d4cdb,'id');_0x2cc4b4=_[_0x5b20('0x99')](_0x2cc4b4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c8ed6[_0x5b20('0x39')]['fields']){_0x304d51[_0x5b20('0x3b')][_0x5b20('0x30')](function(_0x16f26f){_0x1f0df8[_0x5b20('0x46')]('i.'+_0x16f26f);});}else{_0x1f0df8[_0x5b20('0x46')](_0x5b20('0x8d'),_0x5b20('0x5f'));_0x1f0df8[_0x5b20('0x46')]('a.key','Account.key');_0x1f0df8[_0x5b20('0x46')](_0x5b20('0x9a'),_0x5b20('0x9b'));_0x1f0df8[_0x5b20('0x46')]('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',_0x5b20('0x9c'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0x9d'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0x9e'),_0x5b20('0x9f'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0xa0'),_0x5b20('0xa1'));_0x1f0df8[_0x5b20('0x46')]('c.email',_0x5b20('0xa2'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0xa3'),'Contact.phone');_0x1f0df8['field']('c.mobile','Contact.mobile');_0x1f0df8[_0x5b20('0x46')](_0x5b20('0xa4'),_0x5b20('0xa5'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0xa6'),_0x5b20('0xa7'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0xa8'),_0x5b20('0xa9'));_0x1f0df8[_0x5b20('0x46')](_0x5b20('0xaa'),_0x5b20('0x2d'));}if(_0x304d51['limit'])_0x1f0df8[_0x5b20('0x21')](_0x304d51[_0x5b20('0x21')]);if(_0x304d51['offset'])_0x1f0df8['offset'](_0x304d51[_0x5b20('0x20')]);return db[_0x5b20('0x96')][_0x5b20('0x39')](_0x1f0df8[_0x5b20('0x97')](),_0x2cc4b4);})[_0x5b20('0x27')](function(_0x3fdb3c){if(_0x3fdb3c[_0x5b20('0x3d')]>0x0)_0xeae4dd[_0x5b20('0x42')](_0x5b20('0xab'),_[_0x5b20('0x2b')](_0x3fdb3c,'id'));return db['sequelize'][_0x5b20('0x39')](_0xeae4dd['toString'](),_0x2cc4b4)[_0x5b20('0x27')](function(_0x2ae93d){var _0xf5e771=_[_0x5b20('0xac')](_0x2ae93d,_0x5b20('0xad'));var _0x2fc2e5=[];_0x3fdb3c[_0x5b20('0x30')](function(_0x4f5b03){_0x2fc2e5[_0x5b20('0x31')](updateWhatsappInteraction(_0x4f5b03,_0xa30aba,_0xf5e771));});return BPromise[_0x5b20('0xae')](_0x2fc2e5);});});})[_0x5b20('0x27')](function(_0x4bbd1e){_0x6c89b2[_0x5b20('0xaf')]=_0x4bbd1e;return _0x6c89b2;})[_0x5b20('0x27')](respondWithFilteredResult(_0x2af90d,_0x304d51))['catch'](handleError(_0x2af90d,null));};exports[_0x5b20('0xb0')]=function(_0x575a1c,_0xab5e43){var _0x9498cd={'raw':![],'where':{'id':_0x575a1c['params']['id']}},_0x522712={};_0x522712[_0x5b20('0x37')]=_[_0x5b20('0x38')](db[_0x5b20('0xb1')][_0x5b20('0xb2')]);_0x522712[_0x5b20('0x39')]=_[_0x5b20('0x38')](_0x575a1c[_0x5b20('0x39')]);_0x522712['filters']=_['intersection'](_0x522712[_0x5b20('0x37')],_0x522712[_0x5b20('0x39')]);_0x9498cd[_0x5b20('0x3b')]=_[_0x5b20('0x3a')](_0x522712[_0x5b20('0x37')],qs['fields'](_0x575a1c[_0x5b20('0x39')][_0x5b20('0x3c')]));_0x9498cd[_0x5b20('0x3b')]=_0x9498cd[_0x5b20('0x3b')][_0x5b20('0x3d')]?_0x9498cd[_0x5b20('0x3b')]:_0x522712[_0x5b20('0x37')];if(_0x575a1c[_0x5b20('0x39')]['includeAll']){_0x9498cd[_0x5b20('0xb3')]=[{'all':!![]}];}_0x9498cd=_[_0x5b20('0x99')]({},_0x9498cd,_0x575a1c['options']);return db[_0x5b20('0xb1')][_0x5b20('0x5e')](_0x9498cd)['then'](handleEntityNotFound(_0xab5e43,null))[_0x5b20('0x27')](respondWithResult(_0xab5e43,null))['catch'](handleError(_0xab5e43,null));};exports[_0x5b20('0xb4')]=function(_0x32b550,_0xfd94d5){return db['WhatsappInteraction'][_0x5b20('0xb4')](_0x32b550[_0x5b20('0xb5')],{})[_0x5b20('0x27')](respondWithResult(_0xfd94d5,0xc9))[_0x5b20('0x32')](handleError(_0xfd94d5,null));};exports[_0x5b20('0x26')]=function(_0x3ee97a,_0x25b325){if(_0x3ee97a[_0x5b20('0xb5')]['id']){delete _0x3ee97a['body']['id'];}return db['WhatsappInteraction'][_0x5b20('0x5e')]({'where':{'id':_0x3ee97a[_0x5b20('0xb6')]['id']}})[_0x5b20('0x27')](handleEntityNotFound(_0x25b325,null))[_0x5b20('0x27')](saveUpdates(_0x3ee97a[_0x5b20('0xb5')],null))['then'](respondWithResult(_0x25b325,null))[_0x5b20('0x32')](handleError(_0x25b325,null));};exports[_0x5b20('0x28')]=function(_0x4e6bb3,_0x3e5759){return db[_0x5b20('0xb1')][_0x5b20('0x5e')]({'where':{'id':_0x4e6bb3[_0x5b20('0xb6')]['id']}})[_0x5b20('0x27')](handleEntityNotFound(_0x3e5759,null))[_0x5b20('0x27')](removeEntity(_0x3e5759,null))[_0x5b20('0x32')](handleError(_0x3e5759,null));};exports[_0x5b20('0xb7')]=function(_0x5a82ae,_0x2a6678){return db[_0x5b20('0xb1')][_0x5b20('0xb7')]()['then'](respondWithResult(_0x2a6678,null))[_0x5b20('0x32')](handleError(_0x2a6678,null));};exports[_0x5b20('0xb8')]=function(_0x19342d,_0xfa7ab0,_0x3b9c3b){return db['WhatsappMessage'][_0x5b20('0x5e')]({'where':{'id':_0x19342d[_0x5b20('0xb6')]['id']}})[_0x5b20('0x27')](handleEntityNotFound(_0xfa7ab0,null))[_0x5b20('0x27')](function(_0x48e888){if(_0x48e888){return _0x48e888[_0x5b20('0xb8')](_0x19342d[_0x5b20('0xb5')][_0x5b20('0xb9')],_['omit'](_0x19342d[_0x5b20('0xb5')],['ids','id'])||{});}})['then'](respondWithResult(_0xfa7ab0,null))[_0x5b20('0x32')](handleError(_0xfa7ab0,null));};exports['getMessages']=function(_0x8d6aaf,_0x25910a,_0x11118a){var _0x13bc25={'raw':![],'where':{}};var _0x578c4d={};var _0x11e857={'count':0x0,'rows':[]};return db[_0x5b20('0xb1')][_0x5b20('0xba')]({'where':{'id':_0x8d6aaf[_0x5b20('0xb6')]['id']}})[_0x5b20('0x27')](handleEntityNotFound(_0x25910a,null))[_0x5b20('0x27')](function(_0x4cba01){if(_0x4cba01){_0x578c4d[_0x5b20('0x37')]=_[_0x5b20('0x38')](db[_0x5b20('0xbb')][_0x5b20('0xb2')]);_0x578c4d['query']=_[_0x5b20('0x38')](_0x8d6aaf[_0x5b20('0x39')]);_0x578c4d[_0x5b20('0x43')]=_['intersection'](_0x578c4d[_0x5b20('0x37')],_0x578c4d[_0x5b20('0x39')]);_0x13bc25[_0x5b20('0x3b')]=_[_0x5b20('0x3a')](_0x578c4d[_0x5b20('0x37')],qs[_0x5b20('0x3c')](_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x3c')]));_0x13bc25[_0x5b20('0x3b')]=_0x13bc25[_0x5b20('0x3b')]['length']?_0x13bc25[_0x5b20('0x3b')]:_0x578c4d[_0x5b20('0x37')];if(!_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x3e')]('nolimit')){_0x13bc25[_0x5b20('0x21')]=qs['limit'](_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x21')]);_0x13bc25['offset']=qs['offset'](_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x20')]);}_0x13bc25[_0x5b20('0x40')]=qs[_0x5b20('0x41')](_0x8d6aaf['query'][_0x5b20('0x41')]);_0x13bc25[_0x5b20('0x42')]=qs[_0x5b20('0x43')](_[_0x5b20('0x44')](_0x8d6aaf[_0x5b20('0x39')],_0x578c4d[_0x5b20('0x43')]));_0x13bc25[_0x5b20('0x42')][_0x5b20('0xad')]=_0x4cba01['id'];if(_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x82')]){_0x13bc25[_0x5b20('0x42')]=_[_0x5b20('0x99')](_0x13bc25[_0x5b20('0x42')],{'$or':_[_0x5b20('0x2b')](_0x13bc25[_0x5b20('0x3b')],function(_0x51d4a4){var _0x47c8a5={};_0x47c8a5[_0x51d4a4]={'$like':'%'+_0x8d6aaf['query']['filter']+'%'};return _0x47c8a5;})});}if(_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x78')]){var _0x2b0d5c=_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0x78')][_0x5b20('0x2f')](',');var _0x340b5f={};_0x340b5f[_0x2b0d5c[0x0]]={'$gte':moment(_0x2b0d5c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x13bc25['where']=_[_0x5b20('0x99')](_0x13bc25[_0x5b20('0x42')],_0x340b5f);}_0x13bc25=_[_0x5b20('0x99')]({},_0x13bc25,_0x8d6aaf[_0x5b20('0xbc')]);return db[_0x5b20('0xbb')]['count']({'where':_0x13bc25[_0x5b20('0x42')]})[_0x5b20('0x27')](function(_0x2d9305){_0x11e857[_0x5b20('0x22')]=_0x2d9305;if(_0x8d6aaf[_0x5b20('0x39')][_0x5b20('0xbd')]){_0x13bc25[_0x5b20('0xb3')]=[{'all':!![]}];}return db[_0x5b20('0xbb')][_0x5b20('0xbe')](_0x13bc25);})[_0x5b20('0x27')](function(_0x1ae20d){_0x11e857[_0x5b20('0xaf')]=_0x1ae20d;return _0x11e857;});}})[_0x5b20('0x27')](respondWithFilteredResult(_0x25910a,_0x13bc25))[_0x5b20('0x32')](handleError(_0x25910a,null));};exports[_0x5b20('0xbf')]=function(_0x467642,_0x13bf49,_0xb77aff){return db['WhatsappInteraction'][_0x5b20('0x5e')]({'where':{'id':_0x467642[_0x5b20('0xb6')]['id']}})['then'](handleEntityNotFound(_0x13bf49,null))[_0x5b20('0x27')](function(_0x59d64e){if(_0x59d64e){return _0x59d64e[_0x5b20('0xc0')](_0x467642[_0x5b20('0xb5')][_0x5b20('0xb9')],_[_0x5b20('0xc1')](_0x467642[_0x5b20('0xb5')],['ids','id'])||{})[_0x5b20('0xc2')](function(){return db[_0x5b20('0x6d')][_0x5b20('0xbe')]({'attributes':['id',_0x5b20('0x47'),'color'],'where':{'id':_0x467642[_0x5b20('0xb5')][_0x5b20('0xb9')]}});})['then'](function(_0x14cd76){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x467642['params']['id']),'tags':_0x14cd76||[]});return{'id':Number(_0x467642[_0x5b20('0xb6')]['id']),'tags':_0x14cd76||[]};});}})[_0x5b20('0x27')](respondWithResult(_0x13bf49,null))[_0x5b20('0x32')](handleError(_0x13bf49,null));};exports[_0x5b20('0xc3')]=function(_0x445493,_0xe45e10,_0x375538){return db[_0x5b20('0xb1')][_0x5b20('0x5e')]({'where':{'id':_0x445493['params']['id']}})[_0x5b20('0x27')](handleEntityNotFound(_0xe45e10,null))[_0x5b20('0x27')](function(_0x5538fc){if(_0x5538fc){return _0x5538fc[_0x5b20('0xc3')](_0x445493[_0x5b20('0x39')][_0x5b20('0xb9')]);}})['then'](respondWithStatusCode(_0xe45e10,null))[_0x5b20('0x32')](handleError(_0xe45e10,null));};exports[_0x5b20('0xc4')]=function(_0x4c284b,_0x3cf102){var _0x947ade=moment()[_0x5b20('0xc5')]()[_0x5b20('0x97')]();var _0x66eeab=path['join'](config[_0x5b20('0xc6')],_0x5b20('0xc7'),_0x5b20('0xc8'),_0x5b20('0xc9'));var _0x325be7=path['join'](config[_0x5b20('0xc6')],'server',_0x5b20('0xc8'),_0x5b20('0xca'));var _0x251427=path[_0x5b20('0xcb')](_0x66eeab,_0x947ade);var _0xa28be1=util['format'](_0x5b20('0xcc'),_0x4c284b['params']['id'],_0x947ade);var _0x5c84fb=path['join'](_0x66eeab,_0xa28be1);var _0x332919=[];_0x332919['push']({'model':db[_0x5b20('0xcd')],'as':_0x5b20('0xcd'),'attributes':['id','fullname'],'raw':!![]});_0x332919[_0x5b20('0x31')]({'model':db['CmContact'],'as':_0x5b20('0xce'),'attributes':['id',_0x5b20('0xcf'),_0x5b20('0xd0')],'raw':!![]});if(_0x4c284b[_0x5b20('0x39')][_0x5b20('0xca')]){_0x332919[_0x5b20('0x31')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2a5959=[{'model':db[_0x5b20('0xbb')],'as':_0x5b20('0xd1'),'attributes':['id','body',_0x5b20('0xd2'),_0x5b20('0xd3'),_0x5b20('0xd4'),_0x5b20('0x7d')],'include':_0x332919}];_0x2a5959[_0x5b20('0x31')]({'model':db[_0x5b20('0xd5')],'as':_0x5b20('0xd6'),'attributes':['id',_0x5b20('0x47')]});_0x2a5959['push']({'model':db[_0x5b20('0xcd')],'as':_0x5b20('0xd7'),'attributes':['id',_0x5b20('0x2c')]});return db[_0x5b20('0xb1')][_0x5b20('0x5e')]({'where':{'id':_0x4c284b[_0x5b20('0xb6')]['id']},'include':_0x2a5959})[_0x5b20('0x27')](handleEntityNotFound(_0x3cf102,null))[_0x5b20('0x27')](function(_0x2bca56){if(_0x2bca56){var _0x474dd7=_0x2bca56[_0x5b20('0xd8')]({'plain':!![]});fs[_0x5b20('0xd9')](_0x251427);var _0x362358={'channel':_0x5b20('0xda'),'account':_0x474dd7[_0x5b20('0xd6')]['name'],'agent':_0x474dd7['Owner']?_0x474dd7[_0x5b20('0xd7')][_0x5b20('0x2c')]:_0x5b20('0xdb'),'createdAt':moment(_0x474dd7[_0x5b20('0xd2')])[_0x5b20('0xdc')](_0x5b20('0xdd'))[_0x5b20('0x97')](),'closedAt':_0x474dd7[_0x5b20('0xde')]?moment(_0x474dd7['closedAt'])[_0x5b20('0xdc')](_0x5b20('0xdd'))[_0x5b20('0x97')]():'','disposition':_0x474dd7[_0x5b20('0xdf')],'messages':_(_0x474dd7['Messages'])[_0x5b20('0x82')]({'secret':![]})['map'](function(_0x28123d){if(_0x28123d[_0x5b20('0xe0')]){var _0x1505a7=path[_0x5b20('0xcb')](_0x325be7,_0x28123d[_0x5b20('0xe0')]['basename']);if(fs[_0x5b20('0xe1')](_0x1505a7)){fs[_0x5b20('0xe2')](_0x1505a7)[_0x5b20('0xe3')](fs['createWriteStream'](path[_0x5b20('0xcb')](_0x251427,_0x28123d[_0x5b20('0xe0')]['basename'])));}}return{'date':moment(_0x28123d[_0x5b20('0xd2')])[_0x5b20('0xdc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5b20('0x97')](),'sender':_0x28123d[_0x5b20('0xd3')]===_0x5b20('0xe4')?_0x28123d[_0x5b20('0xcd')]?_0x28123d[_0x5b20('0xcd')][_0x5b20('0x2c')]:_0x5b20('0xe5'):_0x28123d[_0x5b20('0xce')]['firstName']+(_0x28123d[_0x5b20('0xce')][_0x5b20('0xd0')]?'\x20'+_0x28123d[_0x5b20('0xce')][_0x5b20('0xd0')]:''),'body':_0x28123d['Attachment']?_0x28123d[_0x5b20('0xe0')]['basename']:_0x28123d[_0x5b20('0xb5')],'direction':_0x28123d['direction']==='out'?'A':'C','secret':_0x28123d[_0x5b20('0xd4')],'read':_0x28123d[_0x5b20('0x7d')],'attachment':_0x28123d[_0x5b20('0xe0')]};})[_0x5b20('0x60')]()};return ejs[_0x5b20('0xe6')](path[_0x5b20('0xcb')](config[_0x5b20('0xc6')],_0x5b20('0xc7'),_0x5b20('0xe7'),_0x5b20('0xe8')),{'interaction':_0x362358})[_0x5b20('0x27')](function(_0x1762eb){var _0x3cc7ef=path['join'](_0x251427,'transcript-'+_0x474dd7['id']+'-'+_0x947ade+_0x5b20('0xe9'));var _0x420fef={'path':_0x3cc7ef,'channel':_0x5b20('0xda'),'interactionId':_0x474dd7['id']};return pdf[_0x5b20('0xea')](_0x1762eb,_0x420fef);})[_0x5b20('0x27')](function(){return new BPromise(function(_0x6d6318,_0x45b966){zipdir(_0x251427,{'saveTo':_0x5c84fb},function(_0x42e51b,_0x21620f){if(_0x42e51b)return _0x45b966(_0x42e51b);return _0x6d6318(_0x21620f);});})[_0x5b20('0x27')](function(){return new BPromise(function(_0x565a67,_0x46a167){rimraf(_0x251427,function(_0x475f8f){if(_0x475f8f)_0x46a167(_0x475f8f);return _0x565a67();});});})[_0x5b20('0x27')](function(){return _0x3cf102[_0x5b20('0xc4')](_0x5c84fb,_0xa28be1,function(_0x49feff){if(_0x49feff){console[_0x5b20('0xeb')](_0x5b20('0xec'),_0x49feff);}else{fs['unlinkSync'](_0x5c84fb);}});});});}else{return _0x3cf102['sendStatus'](0xc8);}})[_0x5b20('0x32')](handleError(_0x3cf102,null));}; \ No newline at end of file +var _0xa7a3=['start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','params','includeAll','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','whatsappInteractionTags:save','removeTags','download','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','createdAt','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','sendStatus','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','status','end','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','catch','map','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','text'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xa7a3,0x7c));var _0x3a7a=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xa7a3[_0x2261ce];return _0x524640;};'use strict';var emlformat=require(_0x3a7a('0x0'));var rimraf=require(_0x3a7a('0x1'));var zipdir=require(_0x3a7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a7a('0x3'));var moment=require('moment');var BPromise=require(_0x3a7a('0x4'));var Mustache=require('mustache');var util=require(_0x3a7a('0x5'));var path=require('path');var sox=require(_0x3a7a('0x6'));var csv=require(_0x3a7a('0x7'));var ejs=require(_0x3a7a('0x8'));var fs=require('fs');var fs_extra=require(_0x3a7a('0x9'));var _=require(_0x3a7a('0xa'));var squel=require(_0x3a7a('0xb'));var crypto=require(_0x3a7a('0xc'));var jsforce=require(_0x3a7a('0xd'));var deskjs=require(_0x3a7a('0xe'));var toCsv=require(_0x3a7a('0x7'));var querystring=require('querystring');var Papa=require(_0x3a7a('0xf'));var Redis=require(_0x3a7a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a7a('0x11'));var pdf=require(_0x3a7a('0x12'));var hardwareService=require(_0x3a7a('0x13'));var logger=require(_0x3a7a('0x14'))(_0x3a7a('0x15'));var utils=require(_0x3a7a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3a7a('0x17')]=_[_0x3a7a('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3a7a('0x19'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x3a7a('0x1a')](socket);function respondWithStatusCode(_0x314e46,_0x5384a8){_0x5384a8=_0x5384a8||0xcc;return function(_0x55a31c){if(_0x55a31c){return _0x314e46[_0x3a7a('0x1b')](_0x5384a8);}return _0x314e46['status'](_0x5384a8)['end']();};}function respondWithResult(_0x4409cc,_0x4138a6){_0x4138a6=_0x4138a6||0xc8;return function(_0x5d4d33){if(_0x5d4d33){return _0x4409cc['status'](_0x4138a6)['json'](_0x5d4d33);}};}function respondWithFilteredResult(_0x44a8ca,_0x1c2f57){return function(_0xce3a70){if(_0xce3a70){var _0x53ee6a=typeof _0x1c2f57['offset']==='undefined'&&typeof _0x1c2f57[_0x3a7a('0x1c')]===_0x3a7a('0x1d');var _0x5ad8a2=_0xce3a70[_0x3a7a('0x1e')];var _0xc6f8e3=_0x53ee6a?0x0:_0x1c2f57[_0x3a7a('0x1f')];var _0x1d7440=_0x53ee6a?_0xce3a70[_0x3a7a('0x1e')]:_0x1c2f57[_0x3a7a('0x1f')]+_0x1c2f57[_0x3a7a('0x1c')];var _0x499556;if(_0x1d7440>=_0x5ad8a2){_0x1d7440=_0x5ad8a2;_0x499556=0xc8;}else{_0x499556=0xce;}_0x44a8ca['status'](_0x499556);return _0x44a8ca[_0x3a7a('0x20')](_0x3a7a('0x21'),_0xc6f8e3+'-'+_0x1d7440+'/'+_0x5ad8a2)[_0x3a7a('0x22')](_0xce3a70);}return null;};}function patchUpdates(_0x166fc5){return function(_0x221315){try{jsonpatch['apply'](_0x221315,_0x166fc5,!![]);}catch(_0x16ba3e){return BPromise[_0x3a7a('0x23')](_0x16ba3e);}return _0x221315[_0x3a7a('0x24')]();};}function saveUpdates(_0x159fc1,_0x29c9fe){return function(_0x320706){if(_0x320706){return _0x320706[_0x3a7a('0x25')](_0x159fc1)[_0x3a7a('0x26')](function(_0x5a2c72){return _0x5a2c72;});}return null;};}function removeEntity(_0x2d435a,_0x5b6259){return function(_0x4c7b46){if(_0x4c7b46){return _0x4c7b46[_0x3a7a('0x27')]()[_0x3a7a('0x26')](function(){_0x2d435a[_0x3a7a('0x28')](0xcc)[_0x3a7a('0x29')]();});}};}function handleEntityNotFound(_0x2d60f5,_0x55f761){return function(_0x511728){if(!_0x511728){_0x2d60f5[_0x3a7a('0x1b')](0x194);}return _0x511728;};}function handleError(_0x52f71a,_0x53d77f){_0x53d77f=_0x53d77f||0x1f4;return function(_0xfe442c){logger[_0x3a7a('0x2a')](_0xfe442c[_0x3a7a('0x2b')]);if(_0xfe442c[_0x3a7a('0x2c')]){delete _0xfe442c['name'];}_0x52f71a[_0x3a7a('0x28')](_0x53d77f)[_0x3a7a('0x2d')](_0xfe442c);};}function getInteractionUsers(_0x1e774e,_0x54b20b){return new BPromise(function(_0x3898c5,_0x515778){try{if(_0x54b20b[_0x1e774e['id']]){_0x1e774e[_0x3a7a('0x2e')]=_['map'](_0x54b20b[_0x1e774e['id']],function(_0x437710){return{'id':_0x437710['id'],'fullname':_0x437710[_0x3a7a('0x2f')]};});}}catch(_0x3eec1e){_0x515778(_0x3eec1e);}_0x3898c5(_0x1e774e);});}function getInteractionTags(_0x803548,_0xabecbc){return new BPromise(function(_0xc83e62,_0x5b1aed){try{if(_0x803548[_0x3a7a('0x30')]){_0x803548['Tags']=[];_0x803548[_0x3a7a('0x30')][_0x3a7a('0x31')](',')[_0x3a7a('0x32')](function(_0x25942d){_0x803548[_0x3a7a('0x33')][_0x3a7a('0x34')](_0xabecbc[_0x25942d]);});}delete _0x803548[_0x3a7a('0x30')];}catch(_0x249cc6){_0x5b1aed(_0x249cc6);}_0xc83e62(_0x803548);});}function updateWhatsappInteraction(_0x2a83d8,_0x332d44,_0xfd13ca){return new BPromise(function(_0x1d82ae,_0x5078b3){return getInteractionUsers(_0x2a83d8,_0xfd13ca)[_0x3a7a('0x26')](function(_0x104e28){return getInteractionTags(_0x104e28,_0x332d44);})[_0x3a7a('0x26')](function(_0x511bdb){_0x1d82ae(_0x511bdb);})[_0x3a7a('0x35')](function(_0x23f43e){_0x5078b3(_0x23f43e);});});}exports['index']=function(_0x2791a6,_0x5019d1){var _0x1c1faa={},_0xd4b778={},_0x2fc64f={'count':0x0,'rows':[]};var _0x50f22d=_[_0x3a7a('0x36')](db[_0x3a7a('0x37')][_0x3a7a('0x38')],function(_0x3376c5){return{'name':_0x3376c5[_0x3a7a('0x39')],'type':_0x3376c5[_0x3a7a('0x3a')][_0x3a7a('0x3b')]};});_0xd4b778[_0x3a7a('0x3c')]=_[_0x3a7a('0x36')](_0x50f22d,_0x3a7a('0x2c'));_0xd4b778[_0x3a7a('0x3d')]=_[_0x3a7a('0x3e')](_0x2791a6[_0x3a7a('0x3d')]);_0xd4b778['filters']=_['intersection'](_0xd4b778['model'],_0xd4b778[_0x3a7a('0x3d')]);_0x1c1faa['attributes']=_[_0x3a7a('0x3f')](_0xd4b778[_0x3a7a('0x3c')],qs[_0x3a7a('0x40')](_0x2791a6[_0x3a7a('0x3d')]['fields']));_0x1c1faa[_0x3a7a('0x41')]=_0x1c1faa['attributes']['length']?_0x1c1faa[_0x3a7a('0x41')]:_0xd4b778['model'];if(!_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x42')]('nolimit')){_0x1c1faa[_0x3a7a('0x1c')]=qs[_0x3a7a('0x1c')](_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x1c')]);_0x1c1faa[_0x3a7a('0x1f')]=qs[_0x3a7a('0x1f')](_0x2791a6['query'][_0x3a7a('0x1f')]);}_0x1c1faa[_0x3a7a('0x43')]=qs[_0x3a7a('0x44')](_0x2791a6[_0x3a7a('0x3d')]['sort']);_0x1c1faa[_0x3a7a('0x45')]=qs['filters'](_[_0x3a7a('0x46')](_0x2791a6[_0x3a7a('0x3d')],_0xd4b778[_0x3a7a('0x47')]),_0x50f22d);var _0x3ddb44=[];var _0x5d6aee=squel[_0x3a7a('0x48')]()[_0x3a7a('0x49')]('id')[_0x3a7a('0x49')]('name')[_0x3a7a('0x49')](_0x3a7a('0x4a'))[_0x3a7a('0x4b')](_0x3a7a('0x4c'));var _0x12e390=squel['select']()[_0x3a7a('0x49')](_0x3a7a('0x4d'))[_0x3a7a('0x49')](_0x3a7a('0x4e'))[_0x3a7a('0x49')](_0x3a7a('0x4f'))[_0x3a7a('0x4b')](_0x3a7a('0x50'),'ui')['left_join'](_0x3a7a('0x51'),'u',_0x3a7a('0x52'));var _0x176047=squel[_0x3a7a('0x48')]()[_0x3a7a('0x4b')](_0x3a7a('0x53'),'i')[_0x3a7a('0x54')]('cm_contacts','c',_0x3a7a('0x55'))[_0x3a7a('0x54')](_0x3a7a('0x51'),'o',_0x3a7a('0x56'))[_0x3a7a('0x54')](_0x3a7a('0x57'),'a',_0x3a7a('0x58'))[_0x3a7a('0x54')](_0x3a7a('0x59'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x3a7a('0x5a'),'it',_0x3a7a('0x5b'))[_0x3a7a('0x54')](_0x3a7a('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x14bca7=squel[_0x3a7a('0x5c')]();var _0x26db7e=[];var _0x5cce85=squel[_0x3a7a('0x5c')]();var _0x44b1fc;if(_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x5d')]){_0x44b1fc=as[_0x3a7a('0x5e')](_0x2791a6[_0x3a7a('0x3d')]['search']);var _0x49d9de=_0x44b1fc[_0x3a7a('0x5f')];for(var _0xf5647a=0x0;_0xf5647a<_0x44b1fc[_0x3a7a('0x60')][_0x3a7a('0x61')];_0xf5647a++){var _0x4147ee=_0x44b1fc[_0x3a7a('0x60')][_0xf5647a];var _0x13ff78='i';var _0x4496c6=_['find'](_0x50f22d,['name',_0x4147ee[_0x3a7a('0x49')]]);if(!_0x4496c6){switch(_0x4147ee[_0x3a7a('0x49')]){case _0x3a7a('0x62'):if(_0x4147ee[_0x3a7a('0x63')]==0x1){_0x176047[_0x3a7a('0x64')]('`'+_0x4147ee[_0x3a7a('0x49')]+_0x3a7a('0x65'));}else{_0x176047[_0x3a7a('0x64')]('`'+_0x4147ee[_0x3a7a('0x49')]+_0x3a7a('0x66'));}break;case _0x3a7a('0x67'):if(_0x4147ee[_0x3a7a('0x68')]===_0x3a7a('0x69')){if(_0x4147ee['value'][_0x3a7a('0x31')]('\x20')[_0x3a7a('0x61')]>0x1){_0x14bca7[_0x49d9de](_0x3a7a('0x6a'),qs['getFullTextValue'](_0x4147ee['value']),null);}else{var _0x3b6174='%'+_0x4147ee[_0x3a7a('0x63')]+'%';_0x14bca7[_0x49d9de]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3b6174,_0x3b6174,_0x3b6174);}}else{_0x4496c6=_[_0x3a7a('0x6b')](_0x50f22d,['name',_0x3a7a('0x6c')]);_0x4147ee[_0x3a7a('0x49')]=_0x3a7a('0x6c');_0x4224ef=as[_0x3a7a('0x6d')](_0x13ff78,_0x4496c6[_0x3a7a('0x3a')],_0x4147ee);_0x14bca7[_0x49d9de](_0x4224ef[_0x3a7a('0x6e')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x6f')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x29')]);}break;case _0x3a7a('0x70'):var _0x47cbb7=_0x4147ee[_0x3a7a('0x63')][_0x3a7a('0x31')](',')[_0x3a7a('0x36')](function(_0x4b95e6){return Number(_0x4b95e6);});_0x47cbb7['forEach'](function(_0x5799f2){_0x5cce85['or'](_0x3a7a('0x71'),'%,'+_0x5799f2+',%');});_0x26db7e=_[_0x3a7a('0x72')](_0x26db7e,_0x47cbb7);break;case'User':if(_0x4147ee[_0x3a7a('0x68')]===_0x3a7a('0x69')){_0x14bca7[_0x49d9de](_0x3a7a('0x73'),'%'+_0x4147ee['value']+'%',null);}else{_0x4496c6=_[_0x3a7a('0x6b')](_0x50f22d,[_0x3a7a('0x2c'),_0x3a7a('0x74')]);_0x4147ee['field']=_0x3a7a('0x74');_0x4224ef=as[_0x3a7a('0x6d')](_0x13ff78,_0x4496c6['type'],_0x4147ee);_0x14bca7[_0x49d9de](_0x4224ef[_0x3a7a('0x6e')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x6f')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x29')]);}break;case _0x3a7a('0x75'):_0x4224ef=as[_0x3a7a('0x6d')]('me',null,_0x4147ee);_0x14bca7[_0x49d9de](_0x4224ef[_0x3a7a('0x6e')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x6f')],_0x4224ef[_0x3a7a('0x63')]['end']);break;}}else{var _0x4224ef=as[_0x3a7a('0x6d')](_0x13ff78,_0x4496c6[_0x3a7a('0x3a')],_0x4147ee);_0x14bca7[_0x49d9de](_0x4224ef[_0x3a7a('0x6e')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x6f')],_0x4224ef[_0x3a7a('0x63')][_0x3a7a('0x29')]);}}}else{var _0x38958b=_(_0x2791a6[_0x3a7a('0x3d')])[_0x3a7a('0x3e')]()[_0x3a7a('0x36')](function(_0x507b57){return _['some'](_0x50f22d,[_0x3a7a('0x2c'),_0x507b57])?_0x507b57:undefined;})[_0x3a7a('0x76')]()['value']();if(!_[_0x3a7a('0x77')](_0x38958b)){_0x38958b[_0x3a7a('0x32')](function(_0x2054e7){if(_0x2054e7===_0x3a7a('0x78')){_0x176047[_0x3a7a('0x45')](_0x3a7a('0x79'),[][_0x3a7a('0x7a')](_0x2791a6[_0x3a7a('0x3d')][_0x2054e7]));}else if(_0x2054e7==='createdAt'){var _0x41e567=JSON[_0x3a7a('0x7b')](_0x2791a6['query'][_0x2054e7])[_0x3a7a('0x7c')];var _0x5e76d=JSON[_0x3a7a('0x7b')](_0x2791a6['query'][_0x2054e7])[_0x3a7a('0x7d')];_0x176047[_0x3a7a('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x41e567,_0x5e76d);}else{if(_0x2791a6[_0x3a7a('0x3d')][_0x2054e7]===_0x3a7a('0x7e')){_0x176047[_0x3a7a('0x45')]('i.'+_0x2054e7+'\x20IS\x20NULL');}else{_0x176047['where']('i.'+_0x2054e7+_0x3a7a('0x7f'),_0x2791a6['query'][_0x2054e7]);}}});}if(_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x80')]){if(_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x80')]==0x1){_0x176047['having'](_0x3a7a('0x81'));}else{_0x176047[_0x3a7a('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x2791a6[_0x3a7a('0x3d')]['tag']){_0x26db7e=_['isArray'](_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x82')])?_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x82')]:new Array(_0x2791a6['query'][_0x3a7a('0x82')]);_0x26db7e['forEach'](function(_0x34263e){_0x5cce85['or'](_0x3a7a('0x71'),'%,'+_0x34263e+',%');});}if(_0x2791a6[_0x3a7a('0x3d')][_0x3a7a('0x83')]){var _0x300f52=_0x2791a6['query'][_0x3a7a('0x83')][_0x3a7a('0x84')]('\x5c','\x5c\x5c')[_0x3a7a('0x84')](/'/g,'\x27\x27');if(qs[_0x3a7a('0x85')](_0x300f52)){_0x14bca7['or']('i.id\x20LIKE\x20?',_0x300f52+'%')['or'](_0x3a7a('0x86'),_0x300f52+'%');}else{_0x14bca7['or'](_0x3a7a('0x87'),qs[_0x3a7a('0x88')](_0x300f52))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x300f52+'%');}}}_0x176047[_0x3a7a('0x45')](_0x14bca7);_0x176047[_0x3a7a('0x89')](_0x3a7a('0x8a'));var _0x21247b={'type':db['Sequelize'][_0x3a7a('0x8b')][_0x3a7a('0x8c')],'raw':!![]};var _0x4219e3=_0x176047[_0x3a7a('0x8d')]();_0x4219e3[_0x3a7a('0x49')](_0x3a7a('0x8a'));_0x4219e3['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3a7a('0x62'));if(_0x1c1faa[_0x3a7a('0x43')]){_0x1c1faa[_0x3a7a('0x43')]['forEach'](function(_0x38cd22){var _0x55d523=_0x38cd22[0x0]===_0x3a7a('0x8e')?_0x38cd22[0x0]:'i.'+_0x38cd22[0x0];_0x176047[_0x3a7a('0x43')](_0x55d523,_0x38cd22[0x1]===_0x3a7a('0x8f')?![]:!![]);});}if(!_[_0x3a7a('0x77')](_0x26db7e)){_0x176047['having'](_0x5cce85);_0x4219e3['where'](_0x3a7a('0x90'),_0x26db7e);}BPromise[_0x3a7a('0x91')]()[_0x3a7a('0x26')](function(){if(!_0x44b1fc){if(_0x2791a6['query']['WhatsappAccountId'])return;_0x4219e3['where'](_0x3a7a('0x92'));_0x176047[_0x3a7a('0x45')](_0x3a7a('0x92'));return;}if(_0x2791a6[_0x3a7a('0x93')]['role']!==_0x3a7a('0x94'))return;return _0x2791a6[_0x3a7a('0x93')][_0x3a7a('0x95')]({'attributes':['id'],'raw':!![]})[_0x3a7a('0x26')](function(_0xa7bf91){if(_[_0x3a7a('0x77')](_0xa7bf91)){_0x4219e3[_0x3a7a('0x45')](_0x3a7a('0x96'));_0x176047[_0x3a7a('0x45')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x4219e3[_0x3a7a('0x45')](_0x3a7a('0x79'),_['map'](_0xa7bf91,'id'));_0x176047['where'](_0x3a7a('0x79'),_[_0x3a7a('0x36')](_0xa7bf91,'id'));}});})[_0x3a7a('0x26')](function(){if(_0x2791a6[_0x3a7a('0x93')][_0x3a7a('0x97')]===_0x3a7a('0x94')&&!_0x44b1fc&&!_0x2791a6[_0x3a7a('0x3d')]['WhatsappAccountId'])return[];return db[_0x3a7a('0x98')]['query'](_0x4219e3[_0x3a7a('0x99')](),_0x21247b);})[_0x3a7a('0x26')](function(_0x6c9426){_0x2fc64f[_0x3a7a('0x1e')]=_0x6c9426[_0x3a7a('0x61')];if(_0x2fc64f[_0x3a7a('0x1e')]===0x0)return[];return db[_0x3a7a('0x98')][_0x3a7a('0x3d')](_0x5d6aee[_0x3a7a('0x99')](),_0x21247b)[_0x3a7a('0x26')](function(_0x163355){_0x3ddb44=_['keyBy'](_0x163355,'id');_0x21247b=_[_0x3a7a('0x9a')](_0x21247b,{'model':db[_0x3a7a('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2791a6[_0x3a7a('0x3d')]['fields']){_0x1c1faa[_0x3a7a('0x41')][_0x3a7a('0x32')](function(_0x86d69f){_0x176047[_0x3a7a('0x49')]('i.'+_0x86d69f);});}else{_0x176047[_0x3a7a('0x49')](_0x3a7a('0x9b'),'unreadMessages');_0x176047[_0x3a7a('0x49')](_0x3a7a('0x9c'),_0x3a7a('0x9d'));_0x176047[_0x3a7a('0x49')]('a.mandatoryDisposition',_0x3a7a('0x9e'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0x9f'),_0x3a7a('0x8e'));_0x176047[_0x3a7a('0x49')]('i.*');_0x176047[_0x3a7a('0x49')]('c.firstName',_0x3a7a('0xa0'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0xa1'),_0x3a7a('0xa2'));_0x176047['field'](_0x3a7a('0xa3'),_0x3a7a('0xa4'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0xa5'),_0x3a7a('0xa6'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0xa7'),_0x3a7a('0xa8'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0xa9'),_0x3a7a('0xaa'));_0x176047[_0x3a7a('0x49')]('o.fullname',_0x3a7a('0xab'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0xac'),_0x3a7a('0xad'));_0x176047[_0x3a7a('0x49')](_0x3a7a('0xae'),_0x3a7a('0x30'));}if(_0x1c1faa[_0x3a7a('0x1c')])_0x176047[_0x3a7a('0x1c')](_0x1c1faa[_0x3a7a('0x1c')]);if(_0x1c1faa['offset'])_0x176047[_0x3a7a('0x1f')](_0x1c1faa[_0x3a7a('0x1f')]);return db['sequelize'][_0x3a7a('0x3d')](_0x176047[_0x3a7a('0x99')](),_0x21247b);})[_0x3a7a('0x26')](function(_0x3a92a2){if(_0x3a92a2[_0x3a7a('0x61')]>0x0)_0x12e390[_0x3a7a('0x45')](_0x3a7a('0xaf'),_['map'](_0x3a92a2,'id'));return db['sequelize'][_0x3a7a('0x3d')](_0x12e390[_0x3a7a('0x99')](),_0x21247b)[_0x3a7a('0x26')](function(_0xdbbae2){var _0x26d440=_['groupBy'](_0xdbbae2,_0x3a7a('0xb0'));var _0x1ab40e=[];_0x3a92a2[_0x3a7a('0x32')](function(_0x418bf2){_0x1ab40e[_0x3a7a('0x34')](updateWhatsappInteraction(_0x418bf2,_0x3ddb44,_0x26d440));});return BPromise[_0x3a7a('0xb1')](_0x1ab40e);});});})['then'](function(_0x219aac){_0x2fc64f[_0x3a7a('0xb2')]=_0x219aac;return _0x2fc64f;})[_0x3a7a('0x26')](respondWithFilteredResult(_0x5019d1,_0x1c1faa))['catch'](handleError(_0x5019d1,null));};exports['show']=function(_0x245fd4,_0x3488b1){var _0x34fe4a={'raw':![],'where':{'id':_0x245fd4[_0x3a7a('0xb3')]['id']}},_0x4a4493={};_0x4a4493['model']=_['keys'](db[_0x3a7a('0x37')][_0x3a7a('0x38')]);_0x4a4493['query']=_['keys'](_0x245fd4[_0x3a7a('0x3d')]);_0x4a4493[_0x3a7a('0x47')]=_[_0x3a7a('0x3f')](_0x4a4493[_0x3a7a('0x3c')],_0x4a4493[_0x3a7a('0x3d')]);_0x34fe4a['attributes']=_[_0x3a7a('0x3f')](_0x4a4493['model'],qs[_0x3a7a('0x40')](_0x245fd4[_0x3a7a('0x3d')][_0x3a7a('0x40')]));_0x34fe4a[_0x3a7a('0x41')]=_0x34fe4a['attributes']['length']?_0x34fe4a['attributes']:_0x4a4493[_0x3a7a('0x3c')];if(_0x245fd4[_0x3a7a('0x3d')][_0x3a7a('0xb4')]){_0x34fe4a[_0x3a7a('0xb5')]=[{'all':!![]}];}_0x34fe4a=_['merge']({},_0x34fe4a,_0x245fd4[_0x3a7a('0xb6')]);return db[_0x3a7a('0x37')][_0x3a7a('0x6b')](_0x34fe4a)['then'](handleEntityNotFound(_0x3488b1,null))['then'](respondWithResult(_0x3488b1,null))[_0x3a7a('0x35')](handleError(_0x3488b1,null));};exports['create']=function(_0x20d30b,_0x32b7ba){return db['WhatsappInteraction'][_0x3a7a('0xb7')](_0x20d30b[_0x3a7a('0x75')],{})['then'](respondWithResult(_0x32b7ba,0xc9))[_0x3a7a('0x35')](handleError(_0x32b7ba,null));};exports[_0x3a7a('0x25')]=function(_0x514985,_0x3f8dc1){if(_0x514985[_0x3a7a('0x75')]['id']){delete _0x514985['body']['id'];}return db[_0x3a7a('0x37')][_0x3a7a('0x6b')]({'where':{'id':_0x514985[_0x3a7a('0xb3')]['id']}})[_0x3a7a('0x26')](handleEntityNotFound(_0x3f8dc1,null))['then'](saveUpdates(_0x514985['body'],null))['then'](respondWithResult(_0x3f8dc1,null))[_0x3a7a('0x35')](handleError(_0x3f8dc1,null));};exports[_0x3a7a('0x27')]=function(_0x220a4b,_0x4b76a8){return db[_0x3a7a('0x37')][_0x3a7a('0x6b')]({'where':{'id':_0x220a4b[_0x3a7a('0xb3')]['id']}})[_0x3a7a('0x26')](handleEntityNotFound(_0x4b76a8,null))[_0x3a7a('0x26')](removeEntity(_0x4b76a8,null))[_0x3a7a('0x35')](handleError(_0x4b76a8,null));};exports[_0x3a7a('0xb8')]=function(_0x113610,_0x454746){return db['WhatsappInteraction'][_0x3a7a('0xb8')]()['then'](respondWithResult(_0x454746,null))[_0x3a7a('0x35')](handleError(_0x454746,null));};exports[_0x3a7a('0xb9')]=function(_0x422ae5,_0x316d85,_0x56d7a6){return db[_0x3a7a('0xba')][_0x3a7a('0x6b')]({'where':{'id':_0x422ae5[_0x3a7a('0xb3')]['id']}})[_0x3a7a('0x26')](handleEntityNotFound(_0x316d85,null))['then'](function(_0x1be60f){if(_0x1be60f){return _0x1be60f[_0x3a7a('0xb9')](_0x422ae5[_0x3a7a('0x75')][_0x3a7a('0xbb')],_[_0x3a7a('0xbc')](_0x422ae5[_0x3a7a('0x75')],[_0x3a7a('0xbb'),'id'])||{});}})[_0x3a7a('0x26')](respondWithResult(_0x316d85,null))[_0x3a7a('0x35')](handleError(_0x316d85,null));};exports[_0x3a7a('0xbd')]=function(_0x3a2aab,_0x14d88f,_0x580f6e){var _0x17b979={'raw':![],'where':{}};var _0x5d3d79={};var _0x138396={'count':0x0,'rows':[]};return db[_0x3a7a('0x37')]['findOne']({'where':{'id':_0x3a2aab[_0x3a7a('0xb3')]['id']}})[_0x3a7a('0x26')](handleEntityNotFound(_0x14d88f,null))[_0x3a7a('0x26')](function(_0x251772){if(_0x251772){_0x5d3d79[_0x3a7a('0x3c')]=_[_0x3a7a('0x3e')](db['WhatsappMessage'][_0x3a7a('0x38')]);_0x5d3d79[_0x3a7a('0x3d')]=_[_0x3a7a('0x3e')](_0x3a2aab[_0x3a7a('0x3d')]);_0x5d3d79['filters']=_[_0x3a7a('0x3f')](_0x5d3d79[_0x3a7a('0x3c')],_0x5d3d79['query']);_0x17b979[_0x3a7a('0x41')]=_[_0x3a7a('0x3f')](_0x5d3d79[_0x3a7a('0x3c')],qs[_0x3a7a('0x40')](_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x40')]));_0x17b979[_0x3a7a('0x41')]=_0x17b979[_0x3a7a('0x41')]['length']?_0x17b979[_0x3a7a('0x41')]:_0x5d3d79[_0x3a7a('0x3c')];if(!_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x42')](_0x3a7a('0xbe'))){_0x17b979[_0x3a7a('0x1c')]=qs[_0x3a7a('0x1c')](_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x1c')]);_0x17b979[_0x3a7a('0x1f')]=qs['offset'](_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x1f')]);}_0x17b979[_0x3a7a('0x43')]=qs[_0x3a7a('0x44')](_0x3a2aab['query']['sort']);_0x17b979[_0x3a7a('0x45')]=qs[_0x3a7a('0x47')](_[_0x3a7a('0x46')](_0x3a2aab[_0x3a7a('0x3d')],_0x5d3d79[_0x3a7a('0x47')]));_0x17b979[_0x3a7a('0x45')][_0x3a7a('0xb0')]=_0x251772['id'];if(_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x83')]){_0x17b979[_0x3a7a('0x45')]=_['merge'](_0x17b979[_0x3a7a('0x45')],{'$or':_[_0x3a7a('0x36')](_0x17b979['attributes'],function(_0x260b91){var _0x212d72={};_0x212d72[_0x260b91]={'$like':'%'+_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x83')]+'%'};return _0x212d72;})});}if(_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x7c')]){var _0x5292d3=_0x3a2aab[_0x3a7a('0x3d')][_0x3a7a('0x7c')][_0x3a7a('0x31')](',');var _0x5e79d2={};_0x5e79d2[_0x5292d3[0x0]]={'$gte':moment(_0x5292d3[0x1])[_0x3a7a('0xbf')](_0x3a7a('0xc0'))};_0x17b979[_0x3a7a('0x45')]=_['merge'](_0x17b979[_0x3a7a('0x45')],_0x5e79d2);}_0x17b979=_['merge']({},_0x17b979,_0x3a2aab[_0x3a7a('0xb6')]);return db[_0x3a7a('0xba')][_0x3a7a('0x1e')]({'where':_0x17b979[_0x3a7a('0x45')]})['then'](function(_0x133fbf){_0x138396[_0x3a7a('0x1e')]=_0x133fbf;if(_0x3a2aab[_0x3a7a('0x3d')]['includeAll']){_0x17b979[_0x3a7a('0xb5')]=[{'all':!![]}];}return db[_0x3a7a('0xba')][_0x3a7a('0xc1')](_0x17b979);})[_0x3a7a('0x26')](function(_0x1bb51a){_0x138396[_0x3a7a('0xb2')]=_0x1bb51a;return _0x138396;});}})[_0x3a7a('0x26')](respondWithFilteredResult(_0x14d88f,_0x17b979))['catch'](handleError(_0x14d88f,null));};exports['addTags']=function(_0x121de7,_0xaa09d1,_0x3a5e8b){return db[_0x3a7a('0x37')][_0x3a7a('0x6b')]({'where':{'id':_0x121de7[_0x3a7a('0xb3')]['id']}})[_0x3a7a('0x26')](handleEntityNotFound(_0xaa09d1,null))['then'](function(_0x2032ab){if(_0x2032ab){return _0x2032ab[_0x3a7a('0xc2')](_0x121de7[_0x3a7a('0x75')]['ids'],_[_0x3a7a('0xbc')](_0x121de7[_0x3a7a('0x75')],[_0x3a7a('0xbb'),'id'])||{})['spread'](function(){return db[_0x3a7a('0x70')][_0x3a7a('0xc1')]({'attributes':['id',_0x3a7a('0x2c'),_0x3a7a('0x4a')],'where':{'id':_0x121de7[_0x3a7a('0x75')][_0x3a7a('0xbb')]}});})['then'](function(_0x54e1f4){socket['emit'](_0x3a7a('0xc3'),{'id':Number(_0x121de7['params']['id']),'tags':_0x54e1f4||[]});return{'id':Number(_0x121de7['params']['id']),'tags':_0x54e1f4||[]};});}})[_0x3a7a('0x26')](respondWithResult(_0xaa09d1,null))[_0x3a7a('0x35')](handleError(_0xaa09d1,null));};exports['removeTags']=function(_0x239964,_0x1a7a26,_0x4ec15a){return db[_0x3a7a('0x37')][_0x3a7a('0x6b')]({'where':{'id':_0x239964[_0x3a7a('0xb3')]['id']}})[_0x3a7a('0x26')](handleEntityNotFound(_0x1a7a26,null))[_0x3a7a('0x26')](function(_0x37f958){if(_0x37f958){return _0x37f958[_0x3a7a('0xc4')](_0x239964[_0x3a7a('0x3d')][_0x3a7a('0xbb')]);}})[_0x3a7a('0x26')](respondWithStatusCode(_0x1a7a26,null))[_0x3a7a('0x35')](handleError(_0x1a7a26,null));};exports[_0x3a7a('0xc5')]=function(_0x12c805,_0x25e085){var _0x456c97=moment()['unix']()[_0x3a7a('0x99')]();var _0xd9215=path[_0x3a7a('0xc6')](config['root'],_0x3a7a('0xc7'),'files',_0x3a7a('0xc8'));var _0x11e872=path['join'](config[_0x3a7a('0xc9')],_0x3a7a('0xc7'),_0x3a7a('0xca'),_0x3a7a('0xcb'));var _0x5139fa=path[_0x3a7a('0xc6')](_0xd9215,_0x456c97);var _0x13a6e7=util[_0x3a7a('0xbf')](_0x3a7a('0xcc'),_0x12c805[_0x3a7a('0xb3')]['id'],_0x456c97);var _0x37840e=path[_0x3a7a('0xc6')](_0xd9215,_0x13a6e7);var _0x40a489=[];_0x40a489[_0x3a7a('0x34')]({'model':db[_0x3a7a('0xcd')],'as':_0x3a7a('0xcd'),'attributes':['id',_0x3a7a('0x2f')],'raw':!![]});_0x40a489['push']({'model':db[_0x3a7a('0xce')],'as':_0x3a7a('0x67'),'attributes':['id',_0x3a7a('0xcf'),_0x3a7a('0xd0')],'raw':!![]});if(_0x12c805[_0x3a7a('0x3d')]['attachments']){_0x40a489[_0x3a7a('0x34')]({'model':db[_0x3a7a('0xd1')],'as':_0x3a7a('0xd1'),'raw':!![]});}var _0x2fc438=[{'model':db[_0x3a7a('0xba')],'as':_0x3a7a('0xd2'),'attributes':['id','body','createdAt',_0x3a7a('0xd3'),_0x3a7a('0xd4'),_0x3a7a('0x80')],'include':_0x40a489}];_0x2fc438[_0x3a7a('0x34')]({'model':db[_0x3a7a('0xd5')],'as':'Account','attributes':['id',_0x3a7a('0x2c')]});_0x2fc438[_0x3a7a('0x34')]({'model':db['User'],'as':_0x3a7a('0xd6'),'attributes':['id',_0x3a7a('0x2f')]});return db[_0x3a7a('0x37')][_0x3a7a('0x6b')]({'where':{'id':_0x12c805[_0x3a7a('0xb3')]['id']},'include':_0x2fc438})['then'](handleEntityNotFound(_0x25e085,null))[_0x3a7a('0x26')](function(_0x2180b6){if(_0x2180b6){var _0xcc3d86=_0x2180b6['get']({'plain':!![]});fs[_0x3a7a('0xd7')](_0x5139fa);var _0x5aaa5a={'channel':_0x3a7a('0xd8'),'account':_0xcc3d86[_0x3a7a('0xd9')][_0x3a7a('0x2c')],'agent':_0xcc3d86['Owner']?_0xcc3d86[_0x3a7a('0xd6')][_0x3a7a('0x2f')]:'N.A.','createdAt':moment(_0xcc3d86[_0x3a7a('0xda')])['format'](_0x3a7a('0xc0'))[_0x3a7a('0x99')](),'closedAt':_0xcc3d86[_0x3a7a('0xdb')]?moment(_0xcc3d86[_0x3a7a('0xdc')])['format'](_0x3a7a('0xc0'))[_0x3a7a('0x99')]():'','disposition':_0xcc3d86[_0x3a7a('0xdd')],'messages':_(_0xcc3d86[_0x3a7a('0xd2')])[_0x3a7a('0x83')]({'secret':![]})['map'](function(_0x26e77f){if(_0x26e77f[_0x3a7a('0xd1')]){var _0x522e63=path[_0x3a7a('0xc6')](_0x11e872,_0x26e77f[_0x3a7a('0xd1')][_0x3a7a('0xde')]);if(fs[_0x3a7a('0xdf')](_0x522e63)){fs['createReadStream'](_0x522e63)[_0x3a7a('0xe0')](fs[_0x3a7a('0xe1')](path[_0x3a7a('0xc6')](_0x5139fa,_0x26e77f['Attachment'][_0x3a7a('0xde')])));}}return{'date':moment(_0x26e77f['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3a7a('0x99')](),'sender':_0x26e77f[_0x3a7a('0xd3')]===_0x3a7a('0xe2')?_0x26e77f['User']?_0x26e77f[_0x3a7a('0xcd')][_0x3a7a('0x2f')]:'System':_0x26e77f[_0x3a7a('0x67')][_0x3a7a('0xcf')]+(_0x26e77f[_0x3a7a('0x67')][_0x3a7a('0xd0')]?'\x20'+_0x26e77f[_0x3a7a('0x67')][_0x3a7a('0xd0')]:''),'body':_0x26e77f[_0x3a7a('0xd1')]?_0x26e77f['Attachment'][_0x3a7a('0xde')]:_0x26e77f[_0x3a7a('0x75')],'direction':_0x26e77f['direction']===_0x3a7a('0xe2')?'A':'C','secret':_0x26e77f[_0x3a7a('0xd4')],'read':_0x26e77f[_0x3a7a('0x80')],'attachment':_0x26e77f[_0x3a7a('0xd1')]};})['value']()};return ejs[_0x3a7a('0xe3')](path[_0x3a7a('0xc6')](config['root'],'server',_0x3a7a('0xe4'),_0x3a7a('0xe5')),{'interaction':_0x5aaa5a})['then'](function(_0x49324f){var _0x46a736=path['join'](_0x5139fa,_0x3a7a('0xe6')+_0xcc3d86['id']+'-'+_0x456c97+'.pdf');var _0xe28f64={'path':_0x46a736,'channel':_0x3a7a('0xd8'),'interactionId':_0xcc3d86['id']};return pdf[_0x3a7a('0xe7')](_0x49324f,_0xe28f64);})['then'](function(){return new BPromise(function(_0x50e86a,_0x2bd0f9){zipdir(_0x5139fa,{'saveTo':_0x37840e},function(_0xcefc13,_0x3a8700){if(_0xcefc13)return _0x2bd0f9(_0xcefc13);return _0x50e86a(_0x3a8700);});})[_0x3a7a('0x26')](function(){return new BPromise(function(_0x3702dd,_0x570785){rimraf(_0x5139fa,function(_0x4d7a8c){if(_0x4d7a8c)_0x570785(_0x4d7a8c);return _0x3702dd();});});})[_0x3a7a('0x26')](function(){return _0x25e085[_0x3a7a('0xc5')](_0x37840e,_0x13a6e7,function(_0x410655){if(_0x410655){console[_0x3a7a('0xe8')](_0x3a7a('0xe9'),_0x410655);}else{fs[_0x3a7a('0xea')](_0x37840e);}});});});}else{return _0x25e085['sendStatus'](0xc8);}})[_0x3a7a('0x35')](handleError(_0x25e085,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 9c0ed82..065d34c 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 _0x76bc=['length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x1ec174,_0x4948bb){var _0xa787d9=function(_0x4dc0e3){while(--_0x4dc0e3){_0x1ec174['push'](_0x1ec174['shift']());}};_0xa787d9(++_0x4948bb);}(_0x76bc,0x17f));var _0xc76b=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x76bc[_0x4bd67a];return _0x2be5fb;};'use strict';var EventEmitter=require(_0xc76b('0x0'));var WhatsappInteraction=require(_0xc76b('0x1'))['db'][_0xc76b('0x2')];var WhatsappMessage=require(_0xc76b('0x1'))['db'][_0xc76b('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc76b('0x4'),'afterDestroy':_0xc76b('0x5')};function emitEvent(_0x3f7b22){return function(_0x1412b4,_0x190889,_0x239be6){_0x1412b4[_0xc76b('0x6')]({'attributes':['id'],'raw':!![]})[_0xc76b('0x7')](function(_0x110f3b){_0x1412b4[_0xc76b('0x8')](_0xc76b('0x9'),_0x110f3b[_0xc76b('0xa')](function(_0x27f25f){return{'id':_0x27f25f['id']};}));return WhatsappMessage[_0xc76b('0xb')]({'where':{'WhatsappInteractionId':_0x1412b4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc76b('0x7')](function(_0x17a4f5){_0x1412b4['setDataValue'](_0xc76b('0xc'),_0x17a4f5[_0xc76b('0xd')]);WhatsappInteractionEvents[_0xc76b('0xe')](_0x3f7b22+':'+_0x1412b4['id'],_0x1412b4);WhatsappInteractionEvents[_0xc76b('0xe')](_0x3f7b22,_0x1412b4);_0x239be6(null);})[_0xc76b('0xf')](_0x239be6(null));};}for(var e in events){if(events[_0xc76b('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xc76b('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x5d31=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','getUsers','then','Users'];(function(_0x5fe066,_0x2bbe24){var _0x54c385=function(_0x11e8f5){while(--_0x11e8f5){_0x5fe066['push'](_0x5fe066['shift']());}};_0x54c385(++_0x2bbe24);}(_0x5d31,0xb7));var _0x15d3=function(_0x3e690a,_0x31aa0f){_0x3e690a=_0x3e690a-0x0;var _0x435ca0=_0x5d31[_0x3e690a];return _0x435ca0;};'use strict';var EventEmitter=require(_0x15d3('0x0'));var WhatsappInteraction=require(_0x15d3('0x1'))['db'][_0x15d3('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x15d3('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x15d3('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x15d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f54e9){return function(_0x475081,_0x27be92,_0x4177c1){_0x475081[_0x15d3('0x6')]({'attributes':['id'],'raw':!![]})[_0x15d3('0x7')](function(_0x204309){_0x475081['setDataValue'](_0x15d3('0x8'),_0x204309[_0x15d3('0x9')](function(_0x719223){return{'id':_0x719223['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x475081['id'],'direction':'in','read':![]},'raw':!![]});})[_0x15d3('0x7')](function(_0x51da1f){_0x475081['setDataValue'](_0x15d3('0xa'),_0x51da1f[_0x15d3('0xb')]);WhatsappInteractionEvents[_0x15d3('0xc')](_0x4f54e9+':'+_0x475081['id'],_0x475081);WhatsappInteractionEvents[_0x15d3('0xc')](_0x4f54e9,_0x475081);_0x4177c1(null);})[_0x15d3('0xd')](_0x4177c1(null));};}for(var e in events){if(events[_0x15d3('0xe')](e)){var event=events[e];WhatsappInteraction[_0x15d3('0xf')](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 1baf36a..e3653b1 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 _0x2395=['./whatsappInteraction.attributes','define','WhatsappInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x2395,0x1c1));var _0x5239=function(_0xa00c66,_0x2fd95d){_0xa00c66=_0xa00c66-0x0;var _0x54f0aa=_0x2395[_0xa00c66];return _0x54f0aa;};'use strict';var _=require(_0x5239('0x0'));var util=require(_0x5239('0x1'));var logger=require(_0x5239('0x2'))(_0x5239('0x3'));var moment=require(_0x5239('0x4'));var BPromise=require(_0x5239('0x5'));var rp=require(_0x5239('0x6'));var fs=require('fs');var path=require(_0x5239('0x7'));var rimraf=require(_0x5239('0x8'));var config=require(_0x5239('0x9'));var attributes=require(_0x5239('0xa'));module['exports']=function(_0x7f022d,_0x2de9bb){return _0x7f022d[_0x5239('0xb')](_0x5239('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a4870,_0x365b8f,_0x350695){if(_0x3a4870[_0x5239('0xd')](_0x5239('0xe'))){_0x3a4870['closedAt']=moment()[_0x5239('0xf')](_0x5239('0x10'));}_0x350695(null,_0x3a4870);}}});}; \ No newline at end of file +var _0xc88f=['WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','rimraf','./whatsappInteraction.attributes','define'];(function(_0x151370,_0xdcac59){var _0x2993ac=function(_0x33d896){while(--_0x33d896){_0x151370['push'](_0x151370['shift']());}};_0x2993ac(++_0xdcac59);}(_0xc88f,0x19b));var _0xfc88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc88f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfc88('0x0'));var util=require(_0xfc88('0x1'));var logger=require(_0xfc88('0x2'))(_0xfc88('0x3'));var moment=require(_0xfc88('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc88('0x5'));var rimraf=require(_0xfc88('0x6'));var config=require('../../config/environment');var attributes=require(_0xfc88('0x7'));module['exports']=function(_0x280906,_0x453285){return _0x280906[_0xfc88('0x8')](_0xfc88('0x9'),attributes,{'tableName':_0xfc88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23b177,_0x3e7d09,_0x18964c){if(_0x23b177[_0xfc88('0xb')]('closed')){_0x23b177[_0xfc88('0xc')]=moment()[_0xfc88('0xd')](_0xfc88('0xe'));}_0x18964c(null,_0x23b177);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 10c4bcb..4cd4bc7 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 _0x1106=['raw','limit','debug','WhatsappInteraction','addTags','ids','omit','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','update','body','options'];(function(_0x5351a7,_0x36527d){var _0x10e122=function(_0x8783c0){while(--_0x8783c0){_0x5351a7['push'](_0x5351a7['shift']());}};_0x10e122(++_0x36527d);}(_0x1106,0x128));var _0x6110=function(_0x19ec1c,_0x1d8299){_0x19ec1c=_0x19ec1c-0x0;var _0xbae1d4=_0x1106[_0x19ec1c];return _0xbae1d4;};'use strict';var _=require('lodash');var util=require(_0x6110('0x0'));var moment=require('moment');var BPromise=require(_0x6110('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6110('0x2'));var db=require(_0x6110('0x3'))['db'];var utils=require(_0x6110('0x4'));var logger=require(_0x6110('0x5'))(_0x6110('0x6'));var config=require(_0x6110('0x7'));var jayson=require(_0x6110('0x8'));var client=jayson[_0x6110('0x9')][_0x6110('0xa')]({'port':0x232a});config[_0x6110('0xb')]=_[_0x6110('0xc')](config['redis'],{'host':_0x6110('0xd'),'port':0x18eb});var socket=require(_0x6110('0xe'))(new Redis(config[_0x6110('0xb')]));require(_0x6110('0xf'))[_0x6110('0x10')](socket);function respondWithRpcPromise(_0x10ed0c,_0xaa0d83,_0x23610a){return new BPromise(function(_0x595f4c,_0x22c4bb){return client['request'](_0x10ed0c,_0x23610a)[_0x6110('0x11')](function(_0x56a490){logger[_0x6110('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0xaa0d83,_0x6110('0x13'));logger['debug'](_0x6110('0x14'),_0xaa0d83,_0x6110('0x13'),JSON[_0x6110('0x15')](_0x56a490));if(_0x56a490[_0x6110('0x16')]){if(_0x56a490[_0x6110('0x16')][_0x6110('0x17')]===0x1f4){logger[_0x6110('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0xaa0d83,_0x56a490[_0x6110('0x16')][_0x6110('0x18')]);return _0x22c4bb(_0x56a490[_0x6110('0x16')][_0x6110('0x18')]);}logger[_0x6110('0x16')](_0x6110('0x19'),_0xaa0d83,_0x56a490['error']['message']);return _0x595f4c(_0x56a490[_0x6110('0x16')][_0x6110('0x18')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0xaa0d83,_0x6110('0x13'));_0x595f4c(_0x56a490[_0x6110('0x1a')]['message']);}})[_0x6110('0x1b')](function(_0x2df5a5){logger[_0x6110('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0xaa0d83,_0x2df5a5);_0x22c4bb(_0x2df5a5);});});}exports[_0x6110('0x1c')]=function(_0xe4d07e){var _0x265971=this;return new Promise(function(_0x2753e4,_0x31218b){return db['WhatsappInteraction'][_0x6110('0x1d')](_0xe4d07e[_0x6110('0x1e')],{'raw':_0xe4d07e[_0x6110('0x1f')]?_0xe4d07e[_0x6110('0x1f')][_0x6110('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe4d07e[_0x6110('0x1f')]?_0xe4d07e['options']['where']||null:null,'attributes':_0xe4d07e[_0x6110('0x1f')]?_0xe4d07e[_0x6110('0x1f')]['attributes']||null:null,'limit':_0xe4d07e['options']?_0xe4d07e['options'][_0x6110('0x21')]||null:null})[_0x6110('0x11')](function(_0x450fff){logger[_0x6110('0x12')]('UpdateWhatsappInteraction',_0xe4d07e);logger[_0x6110('0x22')](_0x6110('0x1c'),_0xe4d07e,JSON[_0x6110('0x15')](_0x450fff));_0x2753e4(_0x450fff);})[_0x6110('0x1b')](function(_0x59af62){logger[_0x6110('0x16')]('UpdateWhatsappInteraction',_0x59af62[_0x6110('0x18')],_0xe4d07e);_0x31218b(_0x265971[_0x6110('0x16')](0x1f4,_0x59af62[_0x6110('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3d7cea){return new Promise(function(_0x18836b,_0x1cc84a){return db[_0x6110('0x23')]['find']({'where':_0x3d7cea[_0x6110('0x1f')]?_0x3d7cea[_0x6110('0x1f')]['where']||null:null})[_0x6110('0x11')](function(_0x2481a9){if(_0x2481a9){return _0x2481a9[_0x6110('0x24')](_0x3d7cea[_0x6110('0x1e')][_0x6110('0x25')],_[_0x6110('0x26')](_0x3d7cea[_0x6110('0x1e')],[_0x6110('0x25'),'id'])||{});}})[_0x6110('0x27')](function(_0x42cdd5){logger[_0x6110('0x12')]('AddTags',_0x3d7cea);logger[_0x6110('0x22')](_0x6110('0x28'),_0x3d7cea,JSON[_0x6110('0x15')](_0x42cdd5));_0x18836b(_0x42cdd5);})['catch'](function(_0x5bdb1f){logger[_0x6110('0x16')]('AddTags',_0x5bdb1f[_0x6110('0x18')],_0x3d7cea);_0x1cc84a(_this[_0x6110('0x16')](0x1f4,_0x5bdb1f['message']));});});}; \ No newline at end of file +var _0xe629=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateWhatsappInteraction','update','options','raw','where','debug','catch','WhatsappInteraction','find','body','omit','ids','AddTags','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe629,0x1d2));var _0x9e62=function(_0x3c872c,_0xff179){_0x3c872c=_0x3c872c-0x0;var _0x45def1=_0xe629[_0x3c872c];return _0x45def1;};'use strict';var _=require(_0x9e62('0x0'));var util=require(_0x9e62('0x1'));var moment=require(_0x9e62('0x2'));var BPromise=require(_0x9e62('0x3'));var rs=require(_0x9e62('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e62('0x5'))['db'];var utils=require(_0x9e62('0x6'));var logger=require(_0x9e62('0x7'))(_0x9e62('0x8'));var config=require(_0x9e62('0x9'));var jayson=require(_0x9e62('0xa'));var client=jayson[_0x9e62('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9e62('0xc')](config[_0x9e62('0xd')],{'host':_0x9e62('0xe'),'port':0x18eb});var socket=require(_0x9e62('0xf'))(new Redis(config[_0x9e62('0xd')]));require('./whatsappInteraction.socket')[_0x9e62('0x10')](socket);function respondWithRpcPromise(_0x5a37d9,_0x3c707c,_0x1c648d){return new BPromise(function(_0x117a28,_0x58d09e){return client[_0x9e62('0x11')](_0x5a37d9,_0x1c648d)[_0x9e62('0x12')](function(_0x351483){logger[_0x9e62('0x13')](_0x9e62('0x14'),_0x3c707c,_0x9e62('0x15'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3c707c,_0x9e62('0x15'),JSON[_0x9e62('0x16')](_0x351483));if(_0x351483['error']){if(_0x351483['error']['code']===0x1f4){logger[_0x9e62('0x17')](_0x9e62('0x14'),_0x3c707c,_0x351483[_0x9e62('0x17')][_0x9e62('0x18')]);return _0x58d09e(_0x351483['error']['message']);}logger[_0x9e62('0x17')](_0x9e62('0x14'),_0x3c707c,_0x351483[_0x9e62('0x17')][_0x9e62('0x18')]);return _0x117a28(_0x351483[_0x9e62('0x17')]['message']);}else{logger['info'](_0x9e62('0x14'),_0x3c707c,_0x9e62('0x15'));_0x117a28(_0x351483[_0x9e62('0x19')][_0x9e62('0x18')]);}})['catch'](function(_0x5257c1){logger['error'](_0x9e62('0x14'),_0x3c707c,_0x5257c1);_0x58d09e(_0x5257c1);});});}exports[_0x9e62('0x1a')]=function(_0x2210d8){var _0xbba4bc=this;return new Promise(function(_0x4a4c22,_0x43f4fb){return db['WhatsappInteraction'][_0x9e62('0x1b')](_0x2210d8['body'],{'raw':_0x2210d8[_0x9e62('0x1c')]?_0x2210d8[_0x9e62('0x1c')][_0x9e62('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2210d8[_0x9e62('0x1c')]?_0x2210d8[_0x9e62('0x1c')][_0x9e62('0x1e')]||null:null,'attributes':_0x2210d8['options']?_0x2210d8[_0x9e62('0x1c')]['attributes']||null:null,'limit':_0x2210d8[_0x9e62('0x1c')]?_0x2210d8['options']['limit']||null:null})[_0x9e62('0x12')](function(_0x107f06){logger[_0x9e62('0x13')](_0x9e62('0x1a'),_0x2210d8);logger[_0x9e62('0x1f')](_0x9e62('0x1a'),_0x2210d8,JSON[_0x9e62('0x16')](_0x107f06));_0x4a4c22(_0x107f06);})[_0x9e62('0x20')](function(_0x270c26){logger[_0x9e62('0x17')](_0x9e62('0x1a'),_0x270c26[_0x9e62('0x18')],_0x2210d8);_0x43f4fb(_0xbba4bc[_0x9e62('0x17')](0x1f4,_0x270c26['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3140dd){return new Promise(function(_0x2a2369,_0x3be86c){return db[_0x9e62('0x21')][_0x9e62('0x22')]({'where':_0x3140dd[_0x9e62('0x1c')]?_0x3140dd['options'][_0x9e62('0x1e')]||null:null})[_0x9e62('0x12')](function(_0x45a872){if(_0x45a872){return _0x45a872['addTags'](_0x3140dd[_0x9e62('0x23')]['ids'],_[_0x9e62('0x24')](_0x3140dd[_0x9e62('0x23')],[_0x9e62('0x25'),'id'])||{});}})['spread'](function(_0x56f3c8){logger['info'](_0x9e62('0x26'),_0x3140dd);logger[_0x9e62('0x1f')](_0x9e62('0x26'),_0x3140dd,JSON['stringify'](_0x56f3c8));_0x2a2369(_0x56f3c8);})['catch'](function(_0xd8e625){logger['error']('AddTags',_0xd8e625[_0x9e62('0x18')],_0x3140dd);_0x3be86c(_this[_0x9e62('0x17')](0x1f4,_0xd8e625[_0x9e62('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 4926287..7a9d1e7 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 _0x422a=['update','emit','removeListener','register','length','whatsappInteraction:','save','remove'];(function(_0x5bceed,_0x1f301a){var _0x4828fe=function(_0x380e85){while(--_0x380e85){_0x5bceed['push'](_0x5bceed['shift']());}};_0x4828fe(++_0x1f301a);}(_0x422a,0x166));var _0xa422=function(_0x503778,_0x5f16eb){_0x503778=_0x503778-0x0;var _0x533602=_0x422a[_0x503778];return _0x533602;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xa422('0x0'),_0xa422('0x1'),_0xa422('0x2')];function createListener(_0x3afa8d,_0x2dc613){return function(_0x3a82a8){_0x2dc613[_0xa422('0x3')](_0x3afa8d,_0x3a82a8);};}function removeListener(_0x3fb132,_0x512316){return function(){WhatsappInteractionEvents[_0xa422('0x4')](_0x3fb132,_0x512316);};}exports[_0xa422('0x5')]=function(_0x1fea5b){for(var _0x518b37=0x0,_0x49df14=events[_0xa422('0x6')];_0x518b37<_0x49df14;_0x518b37++){var _0xb4044f=events[_0x518b37];var _0x851239=createListener(_0xa422('0x7')+_0xb4044f,_0x1fea5b);WhatsappInteractionEvents['on'](_0xb4044f,_0x851239);}}; \ No newline at end of file +var _0x5f8e=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x4045ff,_0x1ebd30){var _0x56f11c=function(_0x2ae844){while(--_0x2ae844){_0x4045ff['push'](_0x4045ff['shift']());}};_0x56f11c(++_0x1ebd30);}(_0x5f8e,0x8b));var _0xe5f8=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x5f8e[_0x163742];return _0x1152ac;};'use strict';var WhatsappInteractionEvents=require(_0xe5f8('0x0'));var events=[_0xe5f8('0x1'),_0xe5f8('0x2'),_0xe5f8('0x3')];function createListener(_0xa02a36,_0x1203a3){return function(_0x52577d){_0x1203a3['emit'](_0xa02a36,_0x52577d);};}function removeListener(_0x2950b2,_0xcdc1f5){return function(){WhatsappInteractionEvents[_0xe5f8('0x4')](_0x2950b2,_0xcdc1f5);};}exports['register']=function(_0x576261){for(var _0x36053a=0x0,_0x5e7742=events['length'];_0x36053a<_0x5e7742;_0x36053a++){var _0x275af0=events[_0x36053a];var _0x404adf=createListener(_0xe5f8('0x5')+_0x275af0,_0x576261);WhatsappInteractionEvents['on'](_0x275af0,_0x404adf);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9c4fd8c..fd55734 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 _0x180a=['describe','/:id','show','whatsappmessage:create','create','/:id/status','status','update','accept','put','/:id/reject','reject','delete','exports','Router','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','get','/describe'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x180a,0x1f1));var _0xa180=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x180a[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa180('0x0')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa180('0x1'));var config=require(_0xa180('0x2'));var controller=require(_0xa180('0x3'));router['get']('/',auth[_0xa180('0x4')](),controller['index']);router[_0xa180('0x5')](_0xa180('0x6'),auth['isAuthenticated'](),controller[_0xa180('0x7')]);router[_0xa180('0x5')](_0xa180('0x8'),auth['isAuthenticated'](),controller[_0xa180('0x9')]);router['post']('/',auth[_0xa180('0x4')](),interaction['tracked']('whatsapp',_0xa180('0xa')),controller[_0xa180('0xb')]);router['post'](_0xa180('0xc'),controller[_0xa180('0xd')]);router['put'](_0xa180('0x8'),auth['isAuthenticated'](),controller[_0xa180('0xe')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xa180('0xf')]);router[_0xa180('0x10')](_0xa180('0x11'),auth[_0xa180('0x4')](),controller[_0xa180('0x12')]);router[_0xa180('0x13')]('/:id',auth[_0xa180('0x4')](),controller['destroy']);module[_0xa180('0x14')]=router; \ No newline at end of file +var _0x4181=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','Router'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4181,0x1d9));var _0x1418=function(_0x2b81d9,_0x49e779){_0x2b81d9=_0x2b81d9-0x0;var _0x24237b=_0x4181[_0x2b81d9];return _0x24237b;};'use strict';var multer=require('multer');var util=require(_0x1418('0x0'));var path=require(_0x1418('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1418('0x2')]();var fs_extra=require(_0x1418('0x3'));var auth=require(_0x1418('0x4'));var interaction=require(_0x1418('0x5'));var config=require(_0x1418('0x6'));var controller=require(_0x1418('0x7'));router[_0x1418('0x8')]('/',auth[_0x1418('0x9')](),controller['index']);router[_0x1418('0x8')]('/describe',auth[_0x1418('0x9')](),controller[_0x1418('0xa')]);router[_0x1418('0x8')]('/:id',auth[_0x1418('0x9')](),controller[_0x1418('0xb')]);router[_0x1418('0xc')]('/',auth[_0x1418('0x9')](),interaction[_0x1418('0xd')](_0x1418('0xe'),_0x1418('0xf')),controller[_0x1418('0x10')]);router[_0x1418('0xc')]('/:id/status',controller[_0x1418('0x11')]);router[_0x1418('0x12')](_0x1418('0x13'),auth['isAuthenticated'](),controller[_0x1418('0x14')]);router[_0x1418('0x12')](_0x1418('0x15'),auth['isAuthenticated'](),controller[_0x1418('0x16')]);router['put'](_0x1418('0x17'),auth[_0x1418('0x9')](),controller[_0x1418('0x18')]);router[_0x1418('0x19')](_0x1418('0x13'),auth[_0x1418('0x9')](),controller[_0x1418('0x1a')]);module[_0x1418('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 36d9bf8..6f0e9fb 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 _0xfd61=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x101ccf,_0x37e172){var _0x99b0f1=function(_0x4111c8){while(--_0x4111c8){_0x101ccf['push'](_0x101ccf['shift']());}};_0x99b0f1(++_0x37e172);}(_0xfd61,0x176));var _0x1fd6=function(_0x55d2d0,_0x6abf28){_0x55d2d0=_0x55d2d0-0x0;var _0x1e60ed=_0xfd61[_0x55d2d0];return _0x1e60ed;};'use strict';var Sequelize=require(_0x1fd6('0x0'));module[_0x1fd6('0x1')]={'body':{'type':Sequelize[_0x1fd6('0x2')](_0x1fd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1fd6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1fd6('0x5')]('in',_0x1fd6('0x6')),'defaultValue':_0x1fd6('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1fd6('0x7')]},'readAt':{'type':Sequelize[_0x1fd6('0x8')]},'secret':{'type':Sequelize[_0x1fd6('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1fd6('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2f29=['out','STRING','DATE','TEXT','exports','BOOLEAN','ENUM'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x2f29,0x1af));var _0x92f2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2f29[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x92f2('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x92f2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x92f2('0x2')]('in',_0x92f2('0x3')),'defaultValue':_0x92f2('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x92f2('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x92f2('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x92f2('0x4')]},'providerResponse':{'type':Sequelize[_0x92f2('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e7d8974..aa378cc 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 _0x7e17=['error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','end','stack','name','index','map','WhatsappMessage','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','create','body','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE: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','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','whatsapp-interactions','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','User','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x498d00,_0x34017f){var _0x323b9e=function(_0x12eade){while(--_0x12eade){_0x498d00['push'](_0x498d00['shift']());}};_0x323b9e(++_0x34017f);}(_0x7e17,0x17a));var _0x77e1=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0x7e17[_0x137815];return _0x29ded1;};'use strict';var emlformat=require(_0x77e1('0x0'));var rimraf=require(_0x77e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77e1('0x2'));var rp=require(_0x77e1('0x3'));var moment=require(_0x77e1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x77e1('0x5'));var path=require(_0x77e1('0x6'));var sox=require(_0x77e1('0x7'));var csv=require(_0x77e1('0x8'));var ejs=require(_0x77e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x77e1('0xa'));var crypto=require(_0x77e1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x77e1('0xc'));var toCsv=require(_0x77e1('0x8'));var querystring=require(_0x77e1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x77e1('0xe'));var qs=require(_0x77e1('0xf'));var as=require(_0x77e1('0x10'));var hardwareService=require(_0x77e1('0x11'));var logger=require(_0x77e1('0x12'))(_0x77e1('0x13'));var utils=require(_0x77e1('0x14'));var config=require(_0x77e1('0x15'));var licenseUtil=require(_0x77e1('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x77e1('0x17')],{'host':_0x77e1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77e1('0x17')]));require(_0x77e1('0x19'))[_0x77e1('0x1a')](socket);var jayson=require(_0x77e1('0x1b'));var client=jayson[_0x77e1('0x1c')][_0x77e1('0x1d')]({'port':0x232c});var client9002=jayson[_0x77e1('0x1c')][_0x77e1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xd07845,_0x145e9a,_0x261af7,_0x55bba8){return new BPromise(function(_0x47bc6e,_0x4652ca){var _0x1beb85=_0x55bba8||client;return _0x1beb85['request'](_0xd07845,_0x261af7)[_0x77e1('0x1e')](function(_0xe64882){logger['info'](_0x77e1('0x1f'),_0x145e9a,_0x77e1('0x20'));logger[_0x77e1('0x21')](_0x77e1('0x22'),_0x145e9a,_0x77e1('0x20'),JSON[_0x77e1('0x23')](_0xe64882));if(_0xe64882[_0x77e1('0x24')]){if(_0xe64882[_0x77e1('0x24')][_0x77e1('0x25')]===0x1f4){logger[_0x77e1('0x24')](_0x77e1('0x1f'),_0x145e9a,_0xe64882[_0x77e1('0x24')][_0x77e1('0x26')]);return _0x4652ca(_0xe64882[_0x77e1('0x24')][_0x77e1('0x26')]);}logger[_0x77e1('0x24')](_0x77e1('0x1f'),_0x145e9a,_0xe64882['error'][_0x77e1('0x26')]);return _0x47bc6e(_0xe64882['error'][_0x77e1('0x26')]);}else{logger[_0x77e1('0x27')](_0x77e1('0x1f'),_0x145e9a,_0x77e1('0x20'));_0x47bc6e(_0xe64882[_0x77e1('0x28')]['message']);}})[_0x77e1('0x29')](function(_0x54e148){logger[_0x77e1('0x24')](_0x77e1('0x1f'),_0x145e9a,_0x54e148);_0x4652ca(_0x54e148);});});}function respondWithStatusCode(_0x49b81d,_0x594741){_0x594741=_0x594741||0xcc;return function(_0x277b20){if(_0x277b20){return _0x49b81d[_0x77e1('0x2a')](_0x594741);}return _0x49b81d[_0x77e1('0x2b')](_0x594741)['end']();};}function respondWithResult(_0x28e8dd,_0x23f379){_0x23f379=_0x23f379||0xc8;return function(_0x4f7ca9){if(_0x4f7ca9){return _0x28e8dd['status'](_0x23f379)[_0x77e1('0x2c')](_0x4f7ca9);}};}function respondWithFilteredResult(_0xff3af8,_0x59181c){return function(_0x3d7900){if(_0x3d7900){var _0x3a117d=typeof _0x59181c[_0x77e1('0x2d')]==='undefined'&&typeof _0x59181c['limit']===_0x77e1('0x2e');var _0x5ca60c=_0x3d7900[_0x77e1('0x2f')];var _0x1d3e4c=_0x3a117d?0x0:_0x59181c[_0x77e1('0x2d')];var _0x7b766b=_0x3a117d?_0x3d7900[_0x77e1('0x2f')]:_0x59181c['offset']+_0x59181c['limit'];var _0x35e92e;if(_0x7b766b>=_0x5ca60c){_0x7b766b=_0x5ca60c;_0x35e92e=0xc8;}else{_0x35e92e=0xce;}_0xff3af8[_0x77e1('0x2b')](_0x35e92e);return _0xff3af8[_0x77e1('0x30')](_0x77e1('0x31'),_0x1d3e4c+'-'+_0x7b766b+'/'+_0x5ca60c)['json'](_0x3d7900);}return null;};}function patchUpdates(_0x1ec20d){return function(_0x615d32){try{jsonpatch['apply'](_0x615d32,_0x1ec20d,!![]);}catch(_0x5f0dc1){return BPromise[_0x77e1('0x32')](_0x5f0dc1);}return _0x615d32[_0x77e1('0x33')]();};}function saveUpdates(_0x19a70f,_0x4c0dc0){return function(_0x118678){if(_0x118678){return _0x118678[_0x77e1('0x34')](_0x19a70f)[_0x77e1('0x1e')](function(_0x4900e4){return _0x4900e4;});}return null;};}function removeEntity(_0x1960df,_0x5cf544){return function(_0xb81e6c){if(_0xb81e6c){return _0xb81e6c[_0x77e1('0x35')]()[_0x77e1('0x1e')](function(){_0x1960df[_0x77e1('0x2b')](0xcc)[_0x77e1('0x36')]();});}};}function handleEntityNotFound(_0x5430df,_0x471d0e){return function(_0x368660){if(!_0x368660){_0x5430df[_0x77e1('0x2a')](0x194);}return _0x368660;};}function handleError(_0x3d2ddf,_0x15debc){_0x15debc=_0x15debc||0x1f4;return function(_0x1149dd){logger[_0x77e1('0x24')](_0x1149dd[_0x77e1('0x37')]);if(_0x1149dd[_0x77e1('0x38')]){delete _0x1149dd['name'];}_0x3d2ddf[_0x77e1('0x2b')](_0x15debc)['send'](_0x1149dd);};}exports[_0x77e1('0x39')]=function(_0x148d6a,_0x54d765){var _0x29a318={},_0x3d4515={},_0x1f1018={'count':0x0,'rows':[]};var _0x6578f4=_[_0x77e1('0x3a')](db[_0x77e1('0x3b')]['rawAttributes'],function(_0x42246a){return{'name':_0x42246a['fieldName'],'type':_0x42246a[_0x77e1('0x3c')][_0x77e1('0x3d')]};});_0x3d4515['model']=_[_0x77e1('0x3a')](_0x6578f4,_0x77e1('0x38'));_0x3d4515['query']=_[_0x77e1('0x3e')](_0x148d6a[_0x77e1('0x3f')]);_0x3d4515[_0x77e1('0x40')]=_[_0x77e1('0x41')](_0x3d4515[_0x77e1('0x42')],_0x3d4515[_0x77e1('0x3f')]);_0x29a318[_0x77e1('0x43')]=_['intersection'](_0x3d4515['model'],qs[_0x77e1('0x44')](_0x148d6a[_0x77e1('0x3f')]['fields']));_0x29a318[_0x77e1('0x43')]=_0x29a318[_0x77e1('0x43')]['length']?_0x29a318[_0x77e1('0x43')]:_0x3d4515[_0x77e1('0x42')];if(!_0x148d6a[_0x77e1('0x3f')][_0x77e1('0x45')](_0x77e1('0x46'))){_0x29a318[_0x77e1('0x47')]=qs[_0x77e1('0x47')](_0x148d6a[_0x77e1('0x3f')][_0x77e1('0x47')]);_0x29a318['offset']=qs[_0x77e1('0x2d')](_0x148d6a[_0x77e1('0x3f')][_0x77e1('0x2d')]);}_0x29a318[_0x77e1('0x48')]=qs[_0x77e1('0x49')](_0x148d6a[_0x77e1('0x3f')][_0x77e1('0x49')]);_0x29a318['where']=qs[_0x77e1('0x40')](_[_0x77e1('0x4a')](_0x148d6a[_0x77e1('0x3f')],_0x3d4515[_0x77e1('0x40')]),_0x6578f4);if(_0x148d6a[_0x77e1('0x3f')][_0x77e1('0x4b')]){_0x29a318[_0x77e1('0x4c')]=_[_0x77e1('0x4d')](_0x29a318['where'],{'$or':_['map'](_0x6578f4,function(_0x41a230){if(_0x41a230[_0x77e1('0x3c')]!==_0x77e1('0x4e')){var _0x57dbf7={};_0x57dbf7[_0x41a230[_0x77e1('0x38')]]={'$like':'%'+_0x148d6a[_0x77e1('0x3f')][_0x77e1('0x4b')]+'%'};return _0x57dbf7;}})});}_0x29a318=_[_0x77e1('0x4d')]({},_0x29a318,_0x148d6a[_0x77e1('0x4f')]);var _0x2d5271={'where':_0x29a318[_0x77e1('0x4c')]};return db[_0x77e1('0x3b')]['count'](_0x2d5271)[_0x77e1('0x1e')](function(_0x41b5b3){_0x1f1018['count']=_0x41b5b3;if(_0x148d6a['query'][_0x77e1('0x50')]){_0x29a318[_0x77e1('0x51')]=[{'all':!![]}];}return db[_0x77e1('0x3b')][_0x77e1('0x52')](_0x29a318);})[_0x77e1('0x1e')](function(_0x4ddf2d){_0x1f1018[_0x77e1('0x53')]=_0x4ddf2d;return _0x1f1018;})['then'](respondWithFilteredResult(_0x54d765,_0x29a318))['catch'](handleError(_0x54d765,null));};exports['show']=function(_0x32fa84,_0x30b2b1){var _0x1e6481={'raw':!![],'where':{'id':_0x32fa84[_0x77e1('0x54')]['id']}},_0xabebc4={};_0xabebc4['model']=_[_0x77e1('0x3e')](db[_0x77e1('0x3b')][_0x77e1('0x55')]);_0xabebc4[_0x77e1('0x3f')]=_['keys'](_0x32fa84[_0x77e1('0x3f')]);_0xabebc4['filters']=_[_0x77e1('0x41')](_0xabebc4[_0x77e1('0x42')],_0xabebc4['query']);_0x1e6481[_0x77e1('0x43')]=_[_0x77e1('0x41')](_0xabebc4[_0x77e1('0x42')],qs[_0x77e1('0x44')](_0x32fa84[_0x77e1('0x3f')][_0x77e1('0x44')]));_0x1e6481[_0x77e1('0x43')]=_0x1e6481[_0x77e1('0x43')][_0x77e1('0x56')]?_0x1e6481[_0x77e1('0x43')]:_0xabebc4['model'];if(_0x32fa84[_0x77e1('0x3f')][_0x77e1('0x50')]){_0x1e6481['include']=[{'all':!![]}];}_0x1e6481=_['merge']({},_0x1e6481,_0x32fa84[_0x77e1('0x4f')]);return db[_0x77e1('0x3b')][_0x77e1('0x57')](_0x1e6481)[_0x77e1('0x1e')](handleEntityNotFound(_0x30b2b1,null))[_0x77e1('0x1e')](respondWithResult(_0x30b2b1,null))[_0x77e1('0x29')](handleError(_0x30b2b1,null));};exports[_0x77e1('0x58')]=function(_0x4f5a58,_0x438197){return db[_0x77e1('0x3b')]['create'](_0x4f5a58[_0x77e1('0x59')],{})['then'](respondWithResult(_0x438197,0xc9))[_0x77e1('0x29')](handleError(_0x438197,null));};exports[_0x77e1('0x34')]=function(_0x87ed46,_0x276deb){if(_0x87ed46[_0x77e1('0x59')]['id']){delete _0x87ed46['body']['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x87ed46[_0x77e1('0x54')]['id']}})['then'](handleEntityNotFound(_0x276deb,null))['then'](saveUpdates(_0x87ed46['body'],null))[_0x77e1('0x1e')](respondWithResult(_0x276deb,null))[_0x77e1('0x29')](handleError(_0x276deb,null));};exports['destroy']=function(_0x2eca60,_0x5bedbf){return db['WhatsappMessage'][_0x77e1('0x57')]({'where':{'id':_0x2eca60[_0x77e1('0x54')]['id']}})[_0x77e1('0x1e')](handleEntityNotFound(_0x5bedbf,null))[_0x77e1('0x1e')](removeEntity(_0x5bedbf,null))[_0x77e1('0x29')](handleError(_0x5bedbf,null));};exports['describe']=function(_0x2ff3f4,_0x2420f5){return db[_0x77e1('0x3b')]['describe']()[_0x77e1('0x1e')](respondWithResult(_0x2420f5,null))[_0x77e1('0x29')](handleError(_0x2420f5,null));};var interaction_log=require(_0x77e1('0x12'))('whatsapp-interactions');exports['accept']=function(_0x5b91ac,_0x32d2db,_0x2cbd51){var _0x10bb64={'agent':{},'channel':_0x77e1('0x5a')};if(_0x5b91ac['body']['id']){delete _0x5b91ac['body']['id'];}_0x5b91ac[_0x77e1('0x59')][_0x77e1('0x5b')]=!![];_0x5b91ac[_0x77e1('0x59')]['readAt']=moment()[_0x77e1('0x5c')](_0x77e1('0x5d'));_0x5b91ac[_0x77e1('0x59')][_0x77e1('0x5e')]=_0x5b91ac[_0x77e1('0x59')]['UserId']||_0x5b91ac['user']['id'];_0x10bb64[_0x77e1('0x5f')]['id']=_0x5b91ac[_0x77e1('0x59')][_0x77e1('0x5e')];return db[_0x77e1('0x3b')]['find']({'where':{'id':_0x5b91ac[_0x77e1('0x54')]['id'],'UserId':null}})[_0x77e1('0x1e')](handleEntityNotFound(_0x32d2db,null))['then'](saveUpdates(_0x5b91ac['body'],null))[_0x77e1('0x1e')](function(_0x44794a){if(_0x44794a){_0x10bb64['message']=_0x44794a[_0x77e1('0x60')]({'plain':!![]});return db['WhatsappInteraction'][_0x77e1('0x57')]({'where':{'id':_0x44794a[_0x77e1('0x61')]}});}return null;})[_0x77e1('0x1e')](handleEntityNotFound(_0x32d2db,null))[_0x77e1('0x1e')](function(_0x13d9d2){if(_0x13d9d2){return _0x13d9d2[_0x77e1('0x34')]({'UserId':_0x5b91ac[_0x77e1('0x59')][_0x77e1('0x5e')],'read1stAt':_[_0x77e1('0x62')](_0x13d9d2[_0x77e1('0x63')])?moment()[_0x77e1('0x5c')](_0x77e1('0x5d')):undefined});}return null;})['then'](function(_0x3b0c6c){if(_0x3b0c6c){_0x10bb64[_0x77e1('0x64')]=_0x3b0c6c['get']({'plain':!![]});interaction_log[_0x77e1('0x27')](_0x77e1('0x65'),_0x5b91ac[_0x77e1('0x66')]['id'],_0x5b91ac['user'][_0x77e1('0x38')],_0x5b91ac['user'][_0x77e1('0x67')],_0x10bb64[_0x77e1('0x64')]['id'],_0x5b91ac[_0x77e1('0x59')]?JSON[_0x77e1('0x23')](_0x5b91ac[_0x77e1('0x59')]):_0x77e1('0x68'));return respondWithRpcPromise(_0x77e1('0x69'),'acceptMessage',_0x10bb64);}return null;})[_0x77e1('0x1e')](function(_0x5b71f0){var _0x7aab67=_0x77e1('0x6a')+_0x5b71f0[_0x77e1('0x26')][_0x77e1('0x6b')];return db['sequelize'][_0x77e1('0x3f')](_0x7aab67,{'type':db[_0x77e1('0x6c')][_0x77e1('0x6d')][_0x77e1('0x6e')],'raw':!![]})[_0x77e1('0x1e')](function(_0x2aa275){return _0x2aa275;});})[_0x77e1('0x1e')](function(_0x42bcf8){if(_0x42bcf8){_0x10bb64[_0x77e1('0x26')][_0x77e1('0x6f')]=_0x42bcf8[0x0];if(!_0x5b91ac['body'][_0x77e1('0x5e')])return;return db['User']['find']({'where':{'id':_0x5b91ac['body'][_0x77e1('0x5e')],'role':'agent'},'attributes':['id',_0x77e1('0x38'),_0x77e1('0x70'),_0x77e1('0x71'),_0x77e1('0x72')],'raw':!![]});}return null;})[_0x77e1('0x1e')](function(_0x389803){if(!_0x389803)return null;_0x10bb64[_0x77e1('0x26')][_0x77e1('0x5f')]=_0x389803;return _0x10bb64;})[_0x77e1('0x1e')](function(_0xd692e3){if(_0xd692e3){if(_0x5b91ac[_0x77e1('0x59')]['manual']){_0x10bb64['message'][_0x77e1('0x73')]=util[_0x77e1('0x5c')](_0x77e1('0x74'),_0x5b91ac['user'][_0x77e1('0x38')]);_0x10bb64[_0x77e1('0x26')][_0x77e1('0x75')]=_0x10bb64[_0x77e1('0x75')];_0x10bb64[_0x77e1('0x26')]['motionChannel']=_0x10bb64[_0x77e1('0x75')];_0x10bb64[_0x77e1('0x26')][_0x77e1('0x76')]=_0x77e1('0x77');return respondWithRpcPromise('EventManager',_0x77e1('0x78'),{'event':_0x77e1('0x79'),'message':_0x10bb64[_0x77e1('0x26')]},client9002)[_0x77e1('0x1e')](function(){return _0x10bb64;});}return _0x10bb64;}return null;})['then'](respondWithResult(_0x32d2db,null))['catch'](handleError(_0x32d2db,null));};var interaction_log=require(_0x77e1('0x12'))(_0x77e1('0x7a'));exports['reject']=function(_0x56abb7,_0x48eb86,_0x44958a){var _0x10fca9={'agent':{},'channel':_0x77e1('0x5a')};if(_0x56abb7[_0x77e1('0x59')]['id']){delete _0x56abb7[_0x77e1('0x59')]['id'];}_0x56abb7['body'][_0x77e1('0x5e')]=_0x56abb7[_0x77e1('0x59')][_0x77e1('0x5e')]||_0x56abb7['user']['id'];_0x10fca9[_0x77e1('0x5f')]['id']=_0x56abb7[_0x77e1('0x59')][_0x77e1('0x5e')];return db[_0x77e1('0x3b')][_0x77e1('0x57')]({'where':{'id':_0x56abb7['params']['id'],'UserId':null}})[_0x77e1('0x1e')](handleEntityNotFound(_0x48eb86,null))[_0x77e1('0x1e')](function(_0x219246){if(_0x219246){_0x10fca9['message']=_0x219246[_0x77e1('0x60')]({'plain':!![]});return db[_0x77e1('0x7b')][_0x77e1('0x57')]({'where':{'id':_0x219246[_0x77e1('0x61')]}});}return null;})[_0x77e1('0x1e')](handleEntityNotFound(_0x48eb86,null))[_0x77e1('0x1e')](function(_0x5335b2){if(_0x5335b2){_0x10fca9['interaction']=_0x5335b2[_0x77e1('0x60')]({'plain':!![]});interaction_log[_0x77e1('0x27')](_0x77e1('0x7c'),_0x56abb7['user']['id'],_0x56abb7[_0x77e1('0x66')][_0x77e1('0x38')],_0x56abb7['user'][_0x77e1('0x67')],_0x10fca9['interaction']['id'],_0x56abb7[_0x77e1('0x59')]?JSON[_0x77e1('0x23')](_0x56abb7[_0x77e1('0x59')]):_0x77e1('0x68'));return respondWithRpcPromise(_0x77e1('0x7d'),_0x77e1('0x7e'),_0x10fca9);}return null;})['then'](function(_0x75d095){var _0x237848='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x75d095[_0x77e1('0x26')][_0x77e1('0x6b')];return db[_0x77e1('0x7f')][_0x77e1('0x3f')](_0x237848,{'type':db[_0x77e1('0x6c')][_0x77e1('0x6d')][_0x77e1('0x6e')],'raw':!![]})['then'](function(_0x1d51d7){return _0x1d51d7;});})['then'](function(_0x3089c1){if(_0x3089c1){_0x10fca9[_0x77e1('0x26')][_0x77e1('0x6f')]=_0x3089c1[0x0];if(!_0x56abb7[_0x77e1('0x59')][_0x77e1('0x5e')])return;return db[_0x77e1('0x80')][_0x77e1('0x57')]({'where':{'id':_0x56abb7[_0x77e1('0x59')][_0x77e1('0x5e')],'role':_0x77e1('0x5f')},'attributes':['id',_0x77e1('0x38'),_0x77e1('0x70'),_0x77e1('0x71'),_0x77e1('0x72')],'raw':!![]});}return null;})[_0x77e1('0x1e')](function(_0x344a2d){if(!_0x344a2d)return null;_0x10fca9['message'][_0x77e1('0x5f')]=_0x344a2d;return _0x10fca9;})[_0x77e1('0x1e')](function(_0x3f5a2c){if(_0x3f5a2c){_0x3f5a2c[_0x77e1('0x26')][_0x77e1('0x73')]=util[_0x77e1('0x5c')](_0x77e1('0x74'),_0x56abb7[_0x77e1('0x66')][_0x77e1('0x38')]);_0x3f5a2c[_0x77e1('0x26')][_0x77e1('0x75')]=_0x10fca9[_0x77e1('0x75')];_0x3f5a2c[_0x77e1('0x26')][_0x77e1('0x81')]=_0x10fca9['channel'];_0x3f5a2c[_0x77e1('0x26')][_0x77e1('0x76')]='reject';respondWithRpcPromise(_0x77e1('0x78'),_0x77e1('0x78'),{'event':_0x77e1('0x82'),'message':_0x3f5a2c[_0x77e1('0x26')]},client9002);return _0x10fca9;}return null;})[_0x77e1('0x1e')](respondWithResult(_0x48eb86,null))['catch'](handleError(_0x48eb86,null));};exports[_0x77e1('0x2b')]=function(_0x1f5267,_0x20f995,_0x46dc6e){if(_0x1f5267[_0x77e1('0x59')]['id']){delete _0x1f5267['body']['id'];}var _0x386e16;return db[_0x77e1('0x3b')]['find']({'where':{'id':_0x1f5267[_0x77e1('0x54')]['id']}})[_0x77e1('0x1e')](handleEntityNotFound(_0x20f995,null))[_0x77e1('0x1e')](function(_0x3af280){if(_0x3af280){_0x386e16=_0x3af280;return db[_0x77e1('0x83')]['find']({'where':{'id':_0x3af280[_0x77e1('0x84')]}});}})[_0x77e1('0x1e')](handleEntityNotFound(_0x20f995,null))[_0x77e1('0x1e')](function(_0x171ce6){if(_0x171ce6){logger['debug'](_0x77e1('0x85'),_0x77e1('0x2b'),'received\x20delivery\x20report\x20from',_0x171ce6[_0x77e1('0x3c')],util['inspect'](_0x1f5267['body'],{'showHidden':![],'depth':null}));switch(_0x171ce6[_0x77e1('0x3c')]){case _0x77e1('0x86'):if(_0x1f5267[_0x77e1('0x59')]['MessageSid']&&_0x1f5267[_0x77e1('0x59')][_0x77e1('0x87')]===_0x386e16['messageId']&&_0x1f5267[_0x77e1('0x59')]['MessageStatus']&&_0x1f5267['body']['MessageStatus']===_0x77e1('0x5b')){return _0x386e16[_0x77e1('0x34')]({'read':!![]});}else{logger[_0x77e1('0x24')](_0x77e1('0x88'),'status','twilio',util[_0x77e1('0x89')](_0x1f5267[_0x77e1('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x386e16;}})[_0x77e1('0x1e')](respondWithResult(_0x20f995,null))[_0x77e1('0x29')](handleError(_0x20f995,null));}; \ No newline at end of file +var _0x5030=['find','create','body','params','describe','whatsapp-interactions','accept','read','readAt','format','UserId','user','agent','WhatsappInteractionId','update','YYYY-MM-DD\x20HH:mm:ss','get','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','event','EventManager','whatsapp','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','fullname','SIP/%s','motionChannel','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','save','then','destroy','stack','name','index','WhatsappMessage','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','keys','rawAttributes'];(function(_0x4a9557,_0x41e4e6){var _0x2675be=function(_0x1e2994){while(--_0x1e2994){_0x4a9557['push'](_0x4a9557['shift']());}};_0x2675be(++_0x41e4e6);}(_0x5030,0x1c8));var _0x0503=function(_0x1e1064,_0x1e9d40){_0x1e1064=_0x1e1064-0x0;var _0x312d49=_0x5030[_0x1e1064];return _0x312d49;};'use strict';var emlformat=require(_0x0503('0x0'));var rimraf=require(_0x0503('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0503('0x2'));var BPromise=require(_0x0503('0x3'));var Mustache=require(_0x0503('0x4'));var util=require(_0x0503('0x5'));var path=require(_0x0503('0x6'));var sox=require(_0x0503('0x7'));var csv=require(_0x0503('0x8'));var ejs=require(_0x0503('0x9'));var fs=require('fs');var fs_extra=require(_0x0503('0xa'));var _=require(_0x0503('0xb'));var squel=require('squel');var crypto=require(_0x0503('0xc'));var jsforce=require(_0x0503('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0503('0x8'));var querystring=require(_0x0503('0xe'));var Papa=require(_0x0503('0xf'));var Redis=require(_0x0503('0x10'));var authService=require(_0x0503('0x11'));var qs=require(_0x0503('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0503('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0503('0x14'));var db=require(_0x0503('0x15'))['db'];config[_0x0503('0x16')]=_['defaults'](config['redis'],{'host':_0x0503('0x17'),'port':0x18eb});var socket=require(_0x0503('0x18'))(new Redis(config[_0x0503('0x16')]));require(_0x0503('0x19'))['register'](socket);var jayson=require(_0x0503('0x1a'));var client=jayson[_0x0503('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x0503('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x54d941,_0x213659,_0x6a8a38,_0x32d793){return new BPromise(function(_0x5b28b1,_0x434a36){var _0x53a8ca=_0x32d793||client;return _0x53a8ca[_0x0503('0x1d')](_0x54d941,_0x6a8a38)['then'](function(_0x26d943){logger[_0x0503('0x1e')](_0x0503('0x1f'),_0x213659,_0x0503('0x20'));logger['debug'](_0x0503('0x21'),_0x213659,_0x0503('0x20'),JSON[_0x0503('0x22')](_0x26d943));if(_0x26d943[_0x0503('0x23')]){if(_0x26d943[_0x0503('0x23')][_0x0503('0x24')]===0x1f4){logger[_0x0503('0x23')](_0x0503('0x1f'),_0x213659,_0x26d943[_0x0503('0x23')]['message']);return _0x434a36(_0x26d943['error'][_0x0503('0x25')]);}logger[_0x0503('0x23')](_0x0503('0x1f'),_0x213659,_0x26d943[_0x0503('0x23')][_0x0503('0x25')]);return _0x5b28b1(_0x26d943[_0x0503('0x23')][_0x0503('0x25')]);}else{logger[_0x0503('0x1e')](_0x0503('0x1f'),_0x213659,_0x0503('0x20'));_0x5b28b1(_0x26d943[_0x0503('0x26')][_0x0503('0x25')]);}})[_0x0503('0x27')](function(_0x54a9cc){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x213659,_0x54a9cc);_0x434a36(_0x54a9cc);});});}function respondWithStatusCode(_0x4dfb43,_0x5be645){_0x5be645=_0x5be645||0xcc;return function(_0x252423){if(_0x252423){return _0x4dfb43[_0x0503('0x28')](_0x5be645);}return _0x4dfb43['status'](_0x5be645)[_0x0503('0x29')]();};}function respondWithResult(_0x454c9e,_0x4c15c5){_0x4c15c5=_0x4c15c5||0xc8;return function(_0x1ac97f){if(_0x1ac97f){return _0x454c9e[_0x0503('0x2a')](_0x4c15c5)[_0x0503('0x2b')](_0x1ac97f);}};}function respondWithFilteredResult(_0xbacaeb,_0x339c24){return function(_0x41d9ad){if(_0x41d9ad){var _0x3721cf=typeof _0x339c24['offset']===_0x0503('0x2c')&&typeof _0x339c24[_0x0503('0x2d')]==='undefined';var _0x1c87ec=_0x41d9ad['count'];var _0x3eaffe=_0x3721cf?0x0:_0x339c24[_0x0503('0x2e')];var _0x261140=_0x3721cf?_0x41d9ad['count']:_0x339c24['offset']+_0x339c24[_0x0503('0x2d')];var _0x23eb2c;if(_0x261140>=_0x1c87ec){_0x261140=_0x1c87ec;_0x23eb2c=0xc8;}else{_0x23eb2c=0xce;}_0xbacaeb['status'](_0x23eb2c);return _0xbacaeb[_0x0503('0x2f')](_0x0503('0x30'),_0x3eaffe+'-'+_0x261140+'/'+_0x1c87ec)[_0x0503('0x2b')](_0x41d9ad);}return null;};}function patchUpdates(_0x1c6cd2){return function(_0x4212d6){try{jsonpatch['apply'](_0x4212d6,_0x1c6cd2,!![]);}catch(_0x298c76){return BPromise[_0x0503('0x31')](_0x298c76);}return _0x4212d6[_0x0503('0x32')]();};}function saveUpdates(_0x1e5d98,_0x1c2708){return function(_0x3fc483){if(_0x3fc483){return _0x3fc483['update'](_0x1e5d98)[_0x0503('0x33')](function(_0x42eeb6){return _0x42eeb6;});}return null;};}function removeEntity(_0x2f2d99,_0x2827a3){return function(_0xfaf098){if(_0xfaf098){return _0xfaf098[_0x0503('0x34')]()[_0x0503('0x33')](function(){_0x2f2d99[_0x0503('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x465c3b,_0x2dffa6){return function(_0xbf9509){if(!_0xbf9509){_0x465c3b[_0x0503('0x28')](0x194);}return _0xbf9509;};}function handleError(_0x28e065,_0x435f42){_0x435f42=_0x435f42||0x1f4;return function(_0x17bc7d){logger[_0x0503('0x23')](_0x17bc7d[_0x0503('0x35')]);if(_0x17bc7d[_0x0503('0x36')]){delete _0x17bc7d['name'];}_0x28e065[_0x0503('0x2a')](_0x435f42)['send'](_0x17bc7d);};}exports[_0x0503('0x37')]=function(_0x59db90,_0x22189b){var _0x791b60={},_0x2bbc4a={},_0x268b65={'count':0x0,'rows':[]};var _0x22d8ad=_['map'](db[_0x0503('0x38')]['rawAttributes'],function(_0xe1eb14){return{'name':_0xe1eb14['fieldName'],'type':_0xe1eb14[_0x0503('0x39')][_0x0503('0x3a')]};});_0x2bbc4a[_0x0503('0x3b')]=_[_0x0503('0x3c')](_0x22d8ad,_0x0503('0x36'));_0x2bbc4a[_0x0503('0x3d')]=_['keys'](_0x59db90['query']);_0x2bbc4a[_0x0503('0x3e')]=_[_0x0503('0x3f')](_0x2bbc4a[_0x0503('0x3b')],_0x2bbc4a[_0x0503('0x3d')]);_0x791b60[_0x0503('0x40')]=_[_0x0503('0x3f')](_0x2bbc4a[_0x0503('0x3b')],qs[_0x0503('0x41')](_0x59db90[_0x0503('0x3d')]['fields']));_0x791b60[_0x0503('0x40')]=_0x791b60[_0x0503('0x40')][_0x0503('0x42')]?_0x791b60['attributes']:_0x2bbc4a[_0x0503('0x3b')];if(!_0x59db90['query'][_0x0503('0x43')]('nolimit')){_0x791b60[_0x0503('0x2d')]=qs[_0x0503('0x2d')](_0x59db90[_0x0503('0x3d')][_0x0503('0x2d')]);_0x791b60[_0x0503('0x2e')]=qs[_0x0503('0x2e')](_0x59db90[_0x0503('0x3d')][_0x0503('0x2e')]);}_0x791b60[_0x0503('0x44')]=qs[_0x0503('0x45')](_0x59db90[_0x0503('0x3d')][_0x0503('0x45')]);_0x791b60[_0x0503('0x46')]=qs[_0x0503('0x3e')](_[_0x0503('0x47')](_0x59db90['query'],_0x2bbc4a[_0x0503('0x3e')]),_0x22d8ad);if(_0x59db90[_0x0503('0x3d')]['filter']){_0x791b60[_0x0503('0x46')]=_[_0x0503('0x48')](_0x791b60['where'],{'$or':_[_0x0503('0x3c')](_0x22d8ad,function(_0x2d9461){if(_0x2d9461[_0x0503('0x39')]!==_0x0503('0x49')){var _0x5f70af={};_0x5f70af[_0x2d9461[_0x0503('0x36')]]={'$like':'%'+_0x59db90[_0x0503('0x3d')][_0x0503('0x4a')]+'%'};return _0x5f70af;}})});}_0x791b60=_[_0x0503('0x48')]({},_0x791b60,_0x59db90[_0x0503('0x4b')]);var _0x40de25={'where':_0x791b60['where']};return db[_0x0503('0x38')][_0x0503('0x4c')](_0x40de25)[_0x0503('0x33')](function(_0x1d68e6){_0x268b65[_0x0503('0x4c')]=_0x1d68e6;if(_0x59db90['query'][_0x0503('0x4d')]){_0x791b60[_0x0503('0x4e')]=[{'all':!![]}];}return db[_0x0503('0x38')][_0x0503('0x4f')](_0x791b60);})[_0x0503('0x33')](function(_0x3039b4){_0x268b65[_0x0503('0x50')]=_0x3039b4;return _0x268b65;})[_0x0503('0x33')](respondWithFilteredResult(_0x22189b,_0x791b60))[_0x0503('0x27')](handleError(_0x22189b,null));};exports[_0x0503('0x51')]=function(_0x1c296e,_0x5bd6a4){var _0x4183a0={'raw':!![],'where':{'id':_0x1c296e['params']['id']}},_0x2f119d={};_0x2f119d[_0x0503('0x3b')]=_[_0x0503('0x52')](db[_0x0503('0x38')][_0x0503('0x53')]);_0x2f119d[_0x0503('0x3d')]=_[_0x0503('0x52')](_0x1c296e[_0x0503('0x3d')]);_0x2f119d[_0x0503('0x3e')]=_[_0x0503('0x3f')](_0x2f119d['model'],_0x2f119d['query']);_0x4183a0[_0x0503('0x40')]=_['intersection'](_0x2f119d[_0x0503('0x3b')],qs['fields'](_0x1c296e[_0x0503('0x3d')]['fields']));_0x4183a0[_0x0503('0x40')]=_0x4183a0[_0x0503('0x40')]['length']?_0x4183a0['attributes']:_0x2f119d[_0x0503('0x3b')];if(_0x1c296e[_0x0503('0x3d')][_0x0503('0x4d')]){_0x4183a0[_0x0503('0x4e')]=[{'all':!![]}];}_0x4183a0=_[_0x0503('0x48')]({},_0x4183a0,_0x1c296e[_0x0503('0x4b')]);return db[_0x0503('0x38')][_0x0503('0x54')](_0x4183a0)[_0x0503('0x33')](handleEntityNotFound(_0x5bd6a4,null))[_0x0503('0x33')](respondWithResult(_0x5bd6a4,null))['catch'](handleError(_0x5bd6a4,null));};exports[_0x0503('0x55')]=function(_0x4c20a6,_0x5ae643){return db[_0x0503('0x38')][_0x0503('0x55')](_0x4c20a6['body'],{})[_0x0503('0x33')](respondWithResult(_0x5ae643,0xc9))[_0x0503('0x27')](handleError(_0x5ae643,null));};exports['update']=function(_0x29da2b,_0x5f51a3){if(_0x29da2b[_0x0503('0x56')]['id']){delete _0x29da2b[_0x0503('0x56')]['id'];}return db[_0x0503('0x38')]['find']({'where':{'id':_0x29da2b[_0x0503('0x57')]['id']}})[_0x0503('0x33')](handleEntityNotFound(_0x5f51a3,null))[_0x0503('0x33')](saveUpdates(_0x29da2b[_0x0503('0x56')],null))['then'](respondWithResult(_0x5f51a3,null))['catch'](handleError(_0x5f51a3,null));};exports[_0x0503('0x34')]=function(_0x255989,_0x407c65){return db[_0x0503('0x38')][_0x0503('0x54')]({'where':{'id':_0x255989[_0x0503('0x57')]['id']}})['then'](handleEntityNotFound(_0x407c65,null))[_0x0503('0x33')](removeEntity(_0x407c65,null))['catch'](handleError(_0x407c65,null));};exports[_0x0503('0x58')]=function(_0x5d6548,_0x3e7fdf){return db[_0x0503('0x38')][_0x0503('0x58')]()[_0x0503('0x33')](respondWithResult(_0x3e7fdf,null))[_0x0503('0x27')](handleError(_0x3e7fdf,null));};var interaction_log=require(_0x0503('0x13'))(_0x0503('0x59'));exports[_0x0503('0x5a')]=function(_0x339732,_0x205fa3,_0x15c935){var _0x2e7834={'agent':{},'channel':'whatsapp'};if(_0x339732['body']['id']){delete _0x339732['body']['id'];}_0x339732[_0x0503('0x56')][_0x0503('0x5b')]=!![];_0x339732['body'][_0x0503('0x5c')]=moment()[_0x0503('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x339732[_0x0503('0x56')][_0x0503('0x5e')]=_0x339732[_0x0503('0x56')][_0x0503('0x5e')]||_0x339732[_0x0503('0x5f')]['id'];_0x2e7834[_0x0503('0x60')]['id']=_0x339732[_0x0503('0x56')][_0x0503('0x5e')];return db[_0x0503('0x38')][_0x0503('0x54')]({'where':{'id':_0x339732[_0x0503('0x57')]['id'],'UserId':null}})[_0x0503('0x33')](handleEntityNotFound(_0x205fa3,null))['then'](saveUpdates(_0x339732[_0x0503('0x56')],null))['then'](function(_0xeae6fe){if(_0xeae6fe){_0x2e7834[_0x0503('0x25')]=_0xeae6fe['get']({'plain':!![]});return db['WhatsappInteraction'][_0x0503('0x54')]({'where':{'id':_0xeae6fe[_0x0503('0x61')]}});}return null;})[_0x0503('0x33')](handleEntityNotFound(_0x205fa3,null))[_0x0503('0x33')](function(_0x21f5a5){if(_0x21f5a5){return _0x21f5a5[_0x0503('0x62')]({'UserId':_0x339732[_0x0503('0x56')]['UserId'],'read1stAt':_['isNil'](_0x21f5a5['read1stAt'])?moment()[_0x0503('0x5d')](_0x0503('0x63')):undefined});}return null;})[_0x0503('0x33')](function(_0x5f3138){if(_0x5f3138){_0x2e7834['interaction']=_0x5f3138[_0x0503('0x64')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x339732[_0x0503('0x5f')]['id'],_0x339732['user'][_0x0503('0x36')],_0x339732['user'][_0x0503('0x65')],_0x2e7834[_0x0503('0x66')]['id'],_0x339732['body']?JSON['stringify'](_0x339732[_0x0503('0x56')]):_0x0503('0x67'));return respondWithRpcPromise(_0x0503('0x68'),_0x0503('0x69'),_0x2e7834);}return null;})[_0x0503('0x33')](function(_0x52e920){var _0x3077dd=_0x0503('0x6a')+_0x52e920[_0x0503('0x25')][_0x0503('0x6b')];return db[_0x0503('0x6c')]['query'](_0x3077dd,{'type':db['Sequelize'][_0x0503('0x6d')][_0x0503('0x6e')],'raw':!![]})['then'](function(_0x5df450){return _0x5df450;});})[_0x0503('0x33')](function(_0x5f0bc5){if(_0x5f0bc5){_0x2e7834[_0x0503('0x25')][_0x0503('0x6f')]=_0x5f0bc5[0x0];if(!_0x339732[_0x0503('0x56')][_0x0503('0x5e')])return;return db[_0x0503('0x70')][_0x0503('0x54')]({'where':{'id':_0x339732['body'][_0x0503('0x5e')],'role':_0x0503('0x60')},'attributes':['id','name','fullname',_0x0503('0x71'),_0x0503('0x72')],'raw':!![]});}return null;})[_0x0503('0x33')](function(_0x3b594e){if(!_0x3b594e)return null;_0x2e7834[_0x0503('0x25')][_0x0503('0x60')]=_0x3b594e;return _0x2e7834;})[_0x0503('0x33')](function(_0x5c94f2){if(_0x5c94f2){if(_0x339732[_0x0503('0x56')][_0x0503('0x73')]){_0x2e7834[_0x0503('0x25')][_0x0503('0x74')]=util[_0x0503('0x5d')]('SIP/%s',_0x339732[_0x0503('0x5f')][_0x0503('0x36')]);_0x2e7834[_0x0503('0x25')][_0x0503('0x75')]=_0x2e7834[_0x0503('0x75')];_0x2e7834['message']['motionChannel']=_0x2e7834['channel'];_0x2e7834[_0x0503('0x25')][_0x0503('0x76')]=_0x0503('0x5a');return respondWithRpcPromise('EventManager',_0x0503('0x77'),{'event':'acceptmessage','message':_0x2e7834[_0x0503('0x25')]},client9002)[_0x0503('0x33')](function(){return _0x2e7834;});}return _0x2e7834;}return null;})[_0x0503('0x33')](respondWithResult(_0x205fa3,null))[_0x0503('0x27')](handleError(_0x205fa3,null));};var interaction_log=require(_0x0503('0x13'))(_0x0503('0x59'));exports[_0x0503('0x31')]=function(_0x1a2a13,_0x529b65,_0x1eb63c){var _0x4745e8={'agent':{},'channel':_0x0503('0x78')};if(_0x1a2a13[_0x0503('0x56')]['id']){delete _0x1a2a13[_0x0503('0x56')]['id'];}_0x1a2a13['body'][_0x0503('0x5e')]=_0x1a2a13[_0x0503('0x56')][_0x0503('0x5e')]||_0x1a2a13[_0x0503('0x5f')]['id'];_0x4745e8[_0x0503('0x60')]['id']=_0x1a2a13[_0x0503('0x56')]['UserId'];return db['WhatsappMessage'][_0x0503('0x54')]({'where':{'id':_0x1a2a13['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x529b65,null))[_0x0503('0x33')](function(_0x43e90d){if(_0x43e90d){_0x4745e8[_0x0503('0x25')]=_0x43e90d[_0x0503('0x64')]({'plain':!![]});return db[_0x0503('0x79')]['find']({'where':{'id':_0x43e90d[_0x0503('0x61')]}});}return null;})[_0x0503('0x33')](handleEntityNotFound(_0x529b65,null))[_0x0503('0x33')](function(_0x237615){if(_0x237615){_0x4745e8[_0x0503('0x66')]=_0x237615[_0x0503('0x64')]({'plain':!![]});interaction_log['info'](_0x0503('0x7a'),_0x1a2a13[_0x0503('0x5f')]['id'],_0x1a2a13['user']['name'],_0x1a2a13[_0x0503('0x5f')][_0x0503('0x65')],_0x4745e8[_0x0503('0x66')]['id'],_0x1a2a13[_0x0503('0x56')]?JSON[_0x0503('0x22')](_0x1a2a13['body']):_0x0503('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4745e8);}return null;})[_0x0503('0x33')](function(_0x58e8ae){var _0x12c2b5=_0x0503('0x6a')+_0x58e8ae[_0x0503('0x25')][_0x0503('0x6b')];return db[_0x0503('0x6c')][_0x0503('0x3d')](_0x12c2b5,{'type':db['Sequelize'][_0x0503('0x6d')][_0x0503('0x6e')],'raw':!![]})['then'](function(_0x18ed11){return _0x18ed11;});})['then'](function(_0x3d1bf5){if(_0x3d1bf5){_0x4745e8[_0x0503('0x25')][_0x0503('0x6f')]=_0x3d1bf5[0x0];if(!_0x1a2a13[_0x0503('0x56')][_0x0503('0x5e')])return;return db['User']['find']({'where':{'id':_0x1a2a13[_0x0503('0x56')][_0x0503('0x5e')],'role':_0x0503('0x60')},'attributes':['id',_0x0503('0x36'),_0x0503('0x7b'),_0x0503('0x71'),_0x0503('0x72')],'raw':!![]});}return null;})[_0x0503('0x33')](function(_0x3cc9ba){if(!_0x3cc9ba)return null;_0x4745e8[_0x0503('0x25')][_0x0503('0x60')]=_0x3cc9ba;return _0x4745e8;})[_0x0503('0x33')](function(_0x6f207f){if(_0x6f207f){_0x6f207f[_0x0503('0x25')][_0x0503('0x74')]=util[_0x0503('0x5d')](_0x0503('0x7c'),_0x1a2a13[_0x0503('0x5f')][_0x0503('0x36')]);_0x6f207f[_0x0503('0x25')][_0x0503('0x75')]=_0x4745e8[_0x0503('0x75')];_0x6f207f[_0x0503('0x25')][_0x0503('0x7d')]=_0x4745e8['channel'];_0x6f207f[_0x0503('0x25')]['event']='reject';respondWithRpcPromise(_0x0503('0x77'),_0x0503('0x77'),{'event':_0x0503('0x7e'),'message':_0x6f207f[_0x0503('0x25')]},client9002);return _0x4745e8;}return null;})[_0x0503('0x33')](respondWithResult(_0x529b65,null))['catch'](handleError(_0x529b65,null));};exports['status']=function(_0x1689de,_0x3a122e,_0x277771){if(_0x1689de[_0x0503('0x56')]['id']){delete _0x1689de[_0x0503('0x56')]['id'];}var _0x4f7d03;return db[_0x0503('0x38')]['find']({'where':{'id':_0x1689de[_0x0503('0x57')]['id']}})[_0x0503('0x33')](handleEntityNotFound(_0x3a122e,null))[_0x0503('0x33')](function(_0x407fd9){if(_0x407fd9){_0x4f7d03=_0x407fd9;return db['WhatsappAccount'][_0x0503('0x54')]({'where':{'id':_0x407fd9[_0x0503('0x7f')]}});}})['then'](handleEntityNotFound(_0x3a122e,null))[_0x0503('0x33')](function(_0x289e22){if(_0x289e22){logger[_0x0503('0x80')](_0x0503('0x81'),_0x0503('0x2a'),'received\x20delivery\x20report\x20from',_0x289e22[_0x0503('0x39')],util[_0x0503('0x82')](_0x1689de[_0x0503('0x56')],{'showHidden':![],'depth':null}));switch(_0x289e22[_0x0503('0x39')]){case _0x0503('0x83'):if(_0x1689de[_0x0503('0x56')][_0x0503('0x84')]&&_0x1689de[_0x0503('0x56')][_0x0503('0x84')]===_0x4f7d03['messageId']&&_0x1689de[_0x0503('0x56')][_0x0503('0x85')]&&_0x1689de[_0x0503('0x56')][_0x0503('0x85')]===_0x0503('0x5b')){return _0x4f7d03['update']({'read':!![]});}else{logger[_0x0503('0x23')](_0x0503('0x86'),_0x0503('0x2a'),'twilio',util[_0x0503('0x82')](_0x1689de[_0x0503('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4f7d03;}})[_0x0503('0x33')](respondWithResult(_0x3a122e,null))[_0x0503('0x27')](handleError(_0x3a122e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index f88cbc8..b6c4fb4 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 _0x750a=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3e88f0,_0x27d2b0){var _0x106a66=function(_0x4c2fab){while(--_0x4c2fab){_0x3e88f0['push'](_0x3e88f0['shift']());}};_0x106a66(++_0x27d2b0);}(_0x750a,0x140));var _0xa750=function(_0x1b075a,_0x5756db){_0x1b075a=_0x1b075a-0x0;var _0x3d52=_0x750a[_0x1b075a];return _0x3d52;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xa750('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa750('0x1'),'afterUpdate':_0xa750('0x2'),'afterDestroy':_0xa750('0x3')};function emitEvent(_0x19bd5f){return function(_0x457cae,_0x43d704,_0x562911){WhatsappMessageEvents[_0xa750('0x4')](_0x19bd5f+':'+_0x457cae['id'],_0x457cae);WhatsappMessageEvents[_0xa750('0x4')](_0x19bd5f,_0x457cae);_0x562911(null);};}for(var e in events){if(events[_0xa750('0x5')](e)){var event=events[e];WhatsappMessage[_0xa750('0x6')](e,emitEvent(event));}}module[_0xa750('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x153f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage'];(function(_0x3774ca,_0x17bb36){var _0x163dce=function(_0xa0ccec){while(--_0xa0ccec){_0x3774ca['push'](_0x3774ca['shift']());}};_0x163dce(++_0x17bb36);}(_0x153f,0x15b));var _0xf153=function(_0x389b1c,_0x4d3bc3){_0x389b1c=_0x389b1c-0x0;var _0x5ac7cc=_0x153f[_0x389b1c];return _0x5ac7cc;};'use strict';var EventEmitter=require(_0xf153('0x0'));var WhatsappMessage=require(_0xf153('0x1'))['db'][_0xf153('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf153('0x3')](0x0);var events={'afterCreate':_0xf153('0x4'),'afterUpdate':_0xf153('0x5'),'afterDestroy':_0xf153('0x6')};function emitEvent(_0x59757c){return function(_0x364e65,_0x5c49c7,_0x1f9ead){WhatsappMessageEvents[_0xf153('0x7')](_0x59757c+':'+_0x364e65['id'],_0x364e65);WhatsappMessageEvents[_0xf153('0x7')](_0x59757c,_0x364e65);_0x1f9ead(null);};}for(var e in events){if(events[_0xf153('0x8')](e)){var event=events[e];WhatsappMessage[_0xf153('0x9')](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 17fc865..6d0ee07 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 _0xd3ed=['afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','error','secret','WhatsappAccountId','twilio','accountSid','authToken','phone','messages','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd3ed,0x15f));var _0xdd3e=function(_0x21b849,_0x363130){_0x21b849=_0x21b849-0x0;var _0x41e617=_0xd3ed[_0x21b849];return _0x41e617;};'use strict';var _=require(_0xdd3e('0x0'));var util=require(_0xdd3e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd3e('0x2'));var BPromise=require(_0xdd3e('0x3'));var rp=require(_0xdd3e('0x4'));var fetch=require(_0xdd3e('0x5'));var fs=require('fs');var path=require(_0xdd3e('0x6'));var rimraf=require(_0xdd3e('0x7'));var config=require(_0xdd3e('0x8'));var attributes=require(_0xdd3e('0x9'));module[_0xdd3e('0xa')]=function(_0x3ba9e4,_0x843745){return _0x3ba9e4['define'](_0xdd3e('0xb'),attributes,{'tableName':_0xdd3e('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xdd3e('0xd')]},{'name':_0xdd3e('0xe'),'fields':[_0xdd3e('0xf')],'type':_0xdd3e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x545659,_0xd3260e,_0x32ebb2){var _0x302846=_0x3ba9e4['models'];var _0x1428ec=_0x545659[_0xdd3e('0x11')]({'plain':!![]});if(_0x1428ec[_0xdd3e('0x12')]['toLowerCase']()==='in'||_0x1428ec[_0xdd3e('0x12')][_0xdd3e('0x13')]()==='out'&&!_0x1428ec['secret']&&!_[_0xdd3e('0x14')](_0x1428ec[_0xdd3e('0x15')])){_0x302846[_0xdd3e('0x16')]['findOne']({'where':{'id':_0x1428ec[_0xdd3e('0x17')]}})[_0xdd3e('0x18')](function(_0x28e02a){if(_0x28e02a){_0x28e02a['update']({'lastMsgAt':_0x1428ec['createdAt'],'lastMsgDirection':_0x1428ec['direction'][_0xdd3e('0x13')]()});}})['catch'](function(_0x4692b){console[_0xdd3e('0x19')](_0x4692b);});}if(_0x1428ec[_0xdd3e('0x12')]==='out'&&!_0x1428ec[_0xdd3e('0x1a')]){var _0x5c348e;_0x302846['WhatsappAccount']['find']({'where':{'id':_0x1428ec[_0xdd3e('0x1b')]},'raw':!![]})['then'](function(_0x5327b7){_0x5c348e=_0x5327b7;if(_0x5c348e&&_0x5c348e['type']){switch(_0x5c348e['type']){case'twilio':var _0x537738=require(_0xdd3e('0x1c'));if(_0x5c348e[_0xdd3e('0x1d')]&&_0x5c348e[_0xdd3e('0x1e')]&&_0x5c348e[_0xdd3e('0x1f')]){var _0x78aba4=new _0x537738(_0x5c348e[_0xdd3e('0x1d')],_0x5c348e[_0xdd3e('0x1e')]);_0x78aba4[_0xdd3e('0x20')]['create']({'body':_0x1428ec[_0xdd3e('0xf')],'to':'whatsapp:'+_0x1428ec['phone'],'from':'whatsapp:'+_0x5c348e[_0xdd3e('0x1f')],'statusCallback':_0x5c348e[_0xdd3e('0x21')]+_0xdd3e('0x22')+_0x1428ec['id']+_0xdd3e('0x23')+_0x5c348e[_0xdd3e('0x24')]})[_0xdd3e('0x18')](function(_0x11a836){if(_0x11a836[_0xdd3e('0x25')]){return _0x545659[_0xdd3e('0x26')]({'messageId':_0x11a836[_0xdd3e('0x25')]});}})[_0xdd3e('0x27')](function(_0x10b985){logger[_0xdd3e('0x19')](_0xdd3e('0x28'),_0xdd3e('0x29'),'twilio',util[_0xdd3e('0x2a')](_0x10b985,{'showHidden':![],'depth':null}));});}else{logger[_0xdd3e('0x19')](_0xdd3e('0x28'),_0xdd3e('0x29'),_0xdd3e('0x1c'),_0xdd3e('0x2b'));}break;case _0xdd3e('0x2c'):var _0x5a9b97=_0x5c348e['accountSid'];var _0x16d152=_0x5c348e[_0xdd3e('0x1e')];var _0xe02f78=_0x5c348e[_0xdd3e('0x2d')]+_0xdd3e('0x2e')+_0x5a9b97+_0xdd3e('0x2f');var _0x831627={'to':[_0x1428ec[_0xdd3e('0x1f')]],'message':{'type':'text','text':_0x1428ec[_0xdd3e('0xf')]}};var _0x20ec90={'method':'POST','uri':_0xe02f78,'headers':{'Authorization':_0xdd3e('0x30')+_0x16d152,'Content-Type':_0xdd3e('0x31')},'body':_0x831627,'json':!![]};rp(_0x20ec90)[_0xdd3e('0x18')](function(_0x14aeda){if(_0x14aeda[_0xdd3e('0x32')][0x0]['message_id']){return _0x545659[_0xdd3e('0x26')]({'messageId':_0x14aeda['statuses'][0x0][_0xdd3e('0x33')]});}})[_0xdd3e('0x27')](function(_0x10454f){logger[_0xdd3e('0x34')](_0xdd3e('0x35'),_0x10454f);});break;}}})['finally'](function(){_0x32ebb2();});}else{_0x32ebb2();}}},'charset':_0xdd3e('0x36'),'collate':_0xdd3e('0x37')});}; \ No newline at end of file +var _0x2fda=['WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','update','catch','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','statuses','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','node-fetch','./whatsappMessage.attributes','exports','define'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x2fda,0x186));var _0xa2fd=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x2fda[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xa2fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2fd('0x1'));var moment=require(_0xa2fd('0x2'));var BPromise=require(_0xa2fd('0x3'));var rp=require(_0xa2fd('0x4'));var fetch=require(_0xa2fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa2fd('0x6'));module[_0xa2fd('0x7')]=function(_0x4c6b0b,_0x11994b){return _0x4c6b0b[_0xa2fd('0x8')](_0xa2fd('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xa2fd('0xa'),'fields':[_0xa2fd('0xa')]},{'name':_0xa2fd('0xb'),'fields':[_0xa2fd('0xc')],'type':_0xa2fd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x420baf,_0x5987f1,_0x5ceb1f){var _0x505cce=_0x4c6b0b[_0xa2fd('0xe')];var _0x5ad62c=_0x420baf[_0xa2fd('0xf')]({'plain':!![]});if(_0x5ad62c[_0xa2fd('0x10')]['toLowerCase']()==='in'||_0x5ad62c['direction'][_0xa2fd('0x11')]()===_0xa2fd('0x12')&&!_0x5ad62c[_0xa2fd('0x13')]&&!_[_0xa2fd('0x14')](_0x5ad62c[_0xa2fd('0x15')])){_0x505cce[_0xa2fd('0x16')]['findOne']({'where':{'id':_0x5ad62c['WhatsappInteractionId']}})[_0xa2fd('0x17')](function(_0x4c75e5){if(_0x4c75e5){_0x4c75e5[_0xa2fd('0x18')]({'lastMsgAt':_0x5ad62c['createdAt'],'lastMsgDirection':_0x5ad62c[_0xa2fd('0x10')][_0xa2fd('0x11')]()});}})[_0xa2fd('0x19')](function(_0x31c996){console['error'](_0x31c996);});}if(_0x5ad62c[_0xa2fd('0x10')]===_0xa2fd('0x12')&&!_0x5ad62c[_0xa2fd('0x13')]){var _0x195d32;_0x505cce[_0xa2fd('0x1a')]['find']({'where':{'id':_0x5ad62c[_0xa2fd('0x1b')]},'raw':!![]})[_0xa2fd('0x17')](function(_0x2940dd){_0x195d32=_0x2940dd;if(_0x195d32&&_0x195d32[_0xa2fd('0x1c')]){switch(_0x195d32[_0xa2fd('0x1c')]){case _0xa2fd('0x1d'):var _0x140d4b=require(_0xa2fd('0x1d'));if(_0x195d32[_0xa2fd('0x1e')]&&_0x195d32[_0xa2fd('0x1f')]&&_0x195d32[_0xa2fd('0x20')]){var _0x535d05=new _0x140d4b(_0x195d32[_0xa2fd('0x1e')],_0x195d32[_0xa2fd('0x1f')]);_0x535d05[_0xa2fd('0x21')][_0xa2fd('0x22')]({'body':_0x5ad62c[_0xa2fd('0xc')],'to':'whatsapp:'+_0x5ad62c[_0xa2fd('0x20')],'from':_0xa2fd('0x23')+_0x195d32[_0xa2fd('0x20')],'statusCallback':_0x195d32[_0xa2fd('0x24')]+_0xa2fd('0x25')+_0x5ad62c['id']+_0xa2fd('0x26')+_0x195d32[_0xa2fd('0x27')]})[_0xa2fd('0x17')](function(_0x35f472){if(_0x35f472['sid']){return _0x420baf[_0xa2fd('0x18')]({'messageId':_0x35f472[_0xa2fd('0x28')]});}})[_0xa2fd('0x19')](function(_0x584339){logger['error'](_0xa2fd('0x29'),_0xa2fd('0x2a'),_0xa2fd('0x1d'),util[_0xa2fd('0x2b')](_0x584339,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xa2fd('0x2a'),_0xa2fd('0x1d'),_0xa2fd('0x2c'));}break;case _0xa2fd('0x2d'):var _0x42a1d3=_0x195d32[_0xa2fd('0x1e')];var _0x583a19=_0x195d32[_0xa2fd('0x1f')];var _0xffe5a1=_0x195d32[_0xa2fd('0x2e')]+_0xa2fd('0x2f')+_0x42a1d3+_0xa2fd('0x30');var _0x3cfb76={'to':[_0x5ad62c['phone']],'message':{'type':_0xa2fd('0x31'),'text':_0x5ad62c[_0xa2fd('0xc')]}};var _0x1c879a={'method':_0xa2fd('0x32'),'uri':_0xffe5a1,'headers':{'Authorization':_0xa2fd('0x33')+_0x583a19,'Content-Type':_0xa2fd('0x34')},'body':_0x3cfb76,'json':!![]};rp(_0x1c879a)[_0xa2fd('0x17')](function(_0x408f73){if(_0x408f73['statuses'][0x0][_0xa2fd('0x35')]){return _0x420baf[_0xa2fd('0x18')]({'messageId':_0x408f73[_0xa2fd('0x36')][0x0][_0xa2fd('0x35')]});}})['catch'](function(_0x4ac90d){logger['err'](_0xa2fd('0x37'),_0x4ac90d);});break;}}})['finally'](function(){_0x5ceb1f();});}else{_0x5ceb1f();}}},'charset':'utf8mb4','collate':_0xa2fd('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index e10f0e9..b591bf7 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 _0x2716=['message','request\x20sent','result','CreateWhatsappMessage','WhatsappMessage','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappMessage,\x20%s,\x20%s'];(function(_0x422447,_0xba1b27){var _0x2f4457=function(_0x43ced8){while(--_0x43ced8){_0x422447['push'](_0x422447['shift']());}};_0x2f4457(++_0xba1b27);}(_0x2716,0x167));var _0x6271=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x2716[_0x545fe3];return _0x480702;};'use strict';var _=require(_0x6271('0x0'));var util=require(_0x6271('0x1'));var moment=require(_0x6271('0x2'));var BPromise=require(_0x6271('0x3'));var rs=require(_0x6271('0x4'));var fs=require('fs');var Redis=require(_0x6271('0x5'));var db=require(_0x6271('0x6'))['db'];var utils=require(_0x6271('0x7'));var logger=require(_0x6271('0x8'))(_0x6271('0x9'));var config=require(_0x6271('0xa'));var jayson=require(_0x6271('0xb'));var client=jayson[_0x6271('0xc')][_0x6271('0xd')]({'port':0x232a});config[_0x6271('0xe')]=_[_0x6271('0xf')](config[_0x6271('0xe')],{'host':_0x6271('0x10'),'port':0x18eb});var socket=require(_0x6271('0x11'))(new Redis(config[_0x6271('0xe')]));require('./whatsappMessage.socket')[_0x6271('0x12')](socket);function respondWithRpcPromise(_0x317611,_0x55f7d0,_0x339aaa){return new BPromise(function(_0x1bc151,_0x191a04){return client[_0x6271('0x13')](_0x317611,_0x339aaa)['then'](function(_0x451f4f){logger[_0x6271('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x55f7d0,'request\x20sent');logger[_0x6271('0x15')](_0x6271('0x16'),_0x55f7d0,'request\x20sent',JSON[_0x6271('0x17')](_0x451f4f));if(_0x451f4f[_0x6271('0x18')]){if(_0x451f4f[_0x6271('0x18')]['code']===0x1f4){logger['error'](_0x6271('0x19'),_0x55f7d0,_0x451f4f[_0x6271('0x18')][_0x6271('0x1a')]);return _0x191a04(_0x451f4f['error']['message']);}logger[_0x6271('0x18')](_0x6271('0x19'),_0x55f7d0,_0x451f4f[_0x6271('0x18')][_0x6271('0x1a')]);return _0x1bc151(_0x451f4f[_0x6271('0x18')][_0x6271('0x1a')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x55f7d0,_0x6271('0x1b'));_0x1bc151(_0x451f4f[_0x6271('0x1c')][_0x6271('0x1a')]);}})['catch'](function(_0x1c3294){logger[_0x6271('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x55f7d0,_0x1c3294);_0x191a04(_0x1c3294);});});}exports[_0x6271('0x1d')]=function(_0x35a3e4){var _0x1c1c3b=this;return new Promise(function(_0x32fd01,_0x537587){return db[_0x6271('0x1e')]['create'](_0x35a3e4['body'],{'raw':_0x35a3e4['options']?_0x35a3e4[_0x6271('0x1f')][_0x6271('0x20')]===undefined?!![]:![]:!![]})[_0x6271('0x21')](function(_0x46bbe6){logger[_0x6271('0x14')](_0x6271('0x1d'),_0x35a3e4);logger['debug'](_0x6271('0x1d'),_0x35a3e4,JSON[_0x6271('0x17')](_0x46bbe6));_0x32fd01(_0x46bbe6);})[_0x6271('0x22')](function(_0x337377){logger[_0x6271('0x18')](_0x6271('0x1d'),_0x337377[_0x6271('0x1a')],_0x35a3e4);_0x537587(_0x1c1c3b['error'](0x1f4,_0x337377['message']));});});}; \ No newline at end of file +var _0x3241=['create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage'];(function(_0x121c8a,_0x1622ff){var _0x2d5342=function(_0x4fa64f){while(--_0x4fa64f){_0x121c8a['push'](_0x121c8a['shift']());}};_0x2d5342(++_0x1622ff);}(_0x3241,0x164));var _0x1324=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3241[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1324('0x0'));var util=require('util');var moment=require(_0x1324('0x1'));var BPromise=require(_0x1324('0x2'));var rs=require(_0x1324('0x3'));var fs=require('fs');var Redis=require(_0x1324('0x4'));var db=require(_0x1324('0x5'))['db'];var utils=require(_0x1324('0x6'));var logger=require(_0x1324('0x7'))(_0x1324('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1324('0x9')]['http']({'port':0x232a});config[_0x1324('0xa')]=_[_0x1324('0xb')](config[_0x1324('0xa')],{'host':_0x1324('0xc'),'port':0x18eb});var socket=require(_0x1324('0xd'))(new Redis(config[_0x1324('0xa')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x43f4ad,_0x411770,_0x5e3f9e){return new BPromise(function(_0x562949,_0x4fab48){return client[_0x1324('0xe')](_0x43f4ad,_0x5e3f9e)[_0x1324('0xf')](function(_0x1775b5){logger[_0x1324('0x10')](_0x1324('0x11'),_0x411770,'request\x20sent');logger['debug'](_0x1324('0x12'),_0x411770,_0x1324('0x13'),JSON[_0x1324('0x14')](_0x1775b5));if(_0x1775b5[_0x1324('0x15')]){if(_0x1775b5[_0x1324('0x15')][_0x1324('0x16')]===0x1f4){logger[_0x1324('0x15')](_0x1324('0x11'),_0x411770,_0x1775b5[_0x1324('0x15')][_0x1324('0x17')]);return _0x4fab48(_0x1775b5[_0x1324('0x15')][_0x1324('0x17')]);}logger[_0x1324('0x15')](_0x1324('0x11'),_0x411770,_0x1775b5[_0x1324('0x15')][_0x1324('0x17')]);return _0x562949(_0x1775b5[_0x1324('0x15')][_0x1324('0x17')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x411770,_0x1324('0x13'));_0x562949(_0x1775b5[_0x1324('0x18')][_0x1324('0x17')]);}})[_0x1324('0x19')](function(_0x2ae4e3){logger[_0x1324('0x15')](_0x1324('0x11'),_0x411770,_0x2ae4e3);_0x4fab48(_0x2ae4e3);});});}exports[_0x1324('0x1a')]=function(_0x4e7f47){var _0x214402=this;return new Promise(function(_0x193af8,_0xf2298c){return db[_0x1324('0x1b')][_0x1324('0x1c')](_0x4e7f47[_0x1324('0x1d')],{'raw':_0x4e7f47['options']?_0x4e7f47[_0x1324('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x1324('0xf')](function(_0x351961){logger[_0x1324('0x10')](_0x1324('0x1a'),_0x4e7f47);logger[_0x1324('0x1f')](_0x1324('0x1a'),_0x4e7f47,JSON['stringify'](_0x351961));_0x193af8(_0x351961);})['catch'](function(_0x408e7d){logger['error']('CreateWhatsappMessage',_0x408e7d['message'],_0x4e7f47);_0xf2298c(_0x214402[_0x1324('0x15')](0x1f4,_0x408e7d[_0x1324('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 400f0e7..ce8668c 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 _0xcbe7=['length','whatsappMessage:','./whatsappMessage.events','save','update','emit','register'];(function(_0x2ff75c,_0x2d7c8c){var _0x41b448=function(_0x315c15){while(--_0x315c15){_0x2ff75c['push'](_0x2ff75c['shift']());}};_0x41b448(++_0x2d7c8c);}(_0xcbe7,0x8e));var _0x7cbe=function(_0x3be4a0,_0x1777ee){_0x3be4a0=_0x3be4a0-0x0;var _0x3e966f=_0xcbe7[_0x3be4a0];return _0x3e966f;};'use strict';var WhatsappMessageEvents=require(_0x7cbe('0x0'));var events=[_0x7cbe('0x1'),'remove',_0x7cbe('0x2')];function createListener(_0x523547,_0x45bd2c){return function(_0x1e1727){_0x45bd2c[_0x7cbe('0x3')](_0x523547,_0x1e1727);};}function removeListener(_0x24e87e,_0x417f58){return function(){WhatsappMessageEvents['removeListener'](_0x24e87e,_0x417f58);};}exports[_0x7cbe('0x4')]=function(_0x14196e){for(var _0x7a18e1=0x0,_0x4695de=events[_0x7cbe('0x5')];_0x7a18e1<_0x4695de;_0x7a18e1++){var _0x39b201=events[_0x7a18e1];var _0x398707=createListener(_0x7cbe('0x6')+_0x39b201,_0x14196e);WhatsappMessageEvents['on'](_0x39b201,_0x398707);}}; \ No newline at end of file +var _0xbe88=['register','length','./whatsappMessage.events','save','update','emit','removeListener'];(function(_0xe13a7d,_0x53b3ff){var _0x18b3a9=function(_0x23d654){while(--_0x23d654){_0xe13a7d['push'](_0xe13a7d['shift']());}};_0x18b3a9(++_0x53b3ff);}(_0xbe88,0xdb));var _0x8be8=function(_0x178e71,_0x5c6c7d){_0x178e71=_0x178e71-0x0;var _0x3eec6c=_0xbe88[_0x178e71];return _0x3eec6c;};'use strict';var WhatsappMessageEvents=require(_0x8be8('0x0'));var events=[_0x8be8('0x1'),'remove',_0x8be8('0x2')];function createListener(_0x16f281,_0x59a6b1){return function(_0x4a7d05){_0x59a6b1[_0x8be8('0x3')](_0x16f281,_0x4a7d05);};}function removeListener(_0x3d8815,_0x18bce4){return function(){WhatsappMessageEvents[_0x8be8('0x4')](_0x3d8815,_0x18bce4);};}exports[_0x8be8('0x5')]=function(_0x2dfd51){for(var _0x2b93d0=0x0,_0x3a4013=events[_0x8be8('0x6')];_0x2b93d0<_0x3a4013;_0x2b93d0++){var _0x1d186e=events[_0x2b93d0];var _0x2bc48e=createListener('whatsappMessage:'+_0x1d186e,_0x2dfd51);WhatsappMessageEvents['on'](_0x1d186e,_0x2bc48e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index b3cff8c..87748c4 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 _0x4c09=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4c09,0x149));var _0x94c0=function(_0x483606,_0x1e6890){_0x483606=_0x483606-0x0;var _0x49c89f=_0x4c09[_0x483606];return _0x49c89f;};'use strict';var multer=require(_0x94c0('0x0'));var util=require('util');var path=require(_0x94c0('0x1'));var timeout=require(_0x94c0('0x2'));var express=require(_0x94c0('0x3'));var router=express[_0x94c0('0x4')]();var fs_extra=require(_0x94c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x94c0('0x6'));var config=require(_0x94c0('0x7'));var controller=require(_0x94c0('0x8'));router[_0x94c0('0x9')]('/',auth['isAuthenticated'](),controller[_0x94c0('0xa')]);router[_0x94c0('0x9')](_0x94c0('0xb'),auth[_0x94c0('0xc')](),controller['describe']);router[_0x94c0('0x9')](_0x94c0('0xd'),auth[_0x94c0('0xc')](),controller[_0x94c0('0xe')]);router['get']('/:id/members',auth[_0x94c0('0xc')](),controller[_0x94c0('0xf')]);router['get'](_0x94c0('0x10'),auth[_0x94c0('0xc')](),controller[_0x94c0('0x11')]);router[_0x94c0('0x9')](_0x94c0('0x12'),auth['isAuthenticated'](),controller[_0x94c0('0x13')]);router[_0x94c0('0x14')]('/',auth[_0x94c0('0xc')](),controller[_0x94c0('0x15')]);router[_0x94c0('0x14')](_0x94c0('0x10'),auth[_0x94c0('0xc')](),controller['addTeams']);router[_0x94c0('0x14')](_0x94c0('0x12'),auth['isAuthenticated'](),controller[_0x94c0('0x16')]);router[_0x94c0('0x17')]('/:id',auth[_0x94c0('0xc')](),controller[_0x94c0('0x18')]);router['delete'](_0x94c0('0xd'),auth['isAuthenticated'](),controller[_0x94c0('0x19')]);router[_0x94c0('0x1a')](_0x94c0('0x10'),auth[_0x94c0('0xc')](),controller[_0x94c0('0x1b')]);router['delete'](_0x94c0('0x12'),auth['isAuthenticated'](),controller[_0x94c0('0x1c')]);module[_0x94c0('0x1d')]=router; \ No newline at end of file +var _0x683e=['/:id/teams','getTeams','/:id/users','getAgents','post','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x683e,0x1f2));var _0xe683=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x683e[_0x2f2360];return _0x1cc8d3;};'use strict';var multer=require(_0xe683('0x0'));var util=require(_0xe683('0x1'));var path=require(_0xe683('0x2'));var timeout=require('connect-timeout');var express=require(_0xe683('0x3'));var router=express[_0xe683('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe683('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe683('0x6'));router[_0xe683('0x7')]('/',auth[_0xe683('0x8')](),controller[_0xe683('0x9')]);router['get'](_0xe683('0xa'),auth[_0xe683('0x8')](),controller['describe']);router[_0xe683('0x7')](_0xe683('0xb'),auth[_0xe683('0x8')](),controller[_0xe683('0xc')]);router['get'](_0xe683('0xd'),auth['isAuthenticated'](),controller[_0xe683('0xe')]);router[_0xe683('0x7')](_0xe683('0xf'),auth[_0xe683('0x8')](),controller[_0xe683('0x10')]);router[_0xe683('0x7')](_0xe683('0x11'),auth['isAuthenticated'](),controller[_0xe683('0x12')]);router[_0xe683('0x13')]('/',auth[_0xe683('0x8')](),controller['create']);router[_0xe683('0x13')](_0xe683('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth[_0xe683('0x8')](),controller['addAgents']);router[_0xe683('0x14')]('/:id',auth[_0xe683('0x8')](),controller[_0xe683('0x15')]);router[_0xe683('0x16')](_0xe683('0xb'),auth[_0xe683('0x8')](),controller[_0xe683('0x17')]);router[_0xe683('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe683('0x18')]);router[_0xe683('0x16')](_0xe683('0x11'),auth['isAuthenticated'](),controller[_0xe683('0x19')]);module[_0xe683('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 2b1c637..9577c53 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 _0xbb53=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x28c4db,_0x2ccd05){var _0x5907ed=function(_0x1d83c2){while(--_0x1d83c2){_0x28c4db['push'](_0x28c4db['shift']());}};_0x5907ed(++_0x2ccd05);}(_0xbb53,0x121));var _0x3bb5=function(_0x1d80e8,_0xd69ea6){_0x1d80e8=_0x1d80e8-0x0;var _0x42e610=_0xbb53[_0x1d80e8];return _0x42e610;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize[_0x3bb5('0x2')],'unique':_0x3bb5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3bb5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3bb5('0x5')](_0x3bb5('0x6'),_0x3bb5('0x7'),_0x3bb5('0x8'))},'description':{'type':Sequelize[_0x3bb5('0x2')]}}; \ No newline at end of file +var _0xe80c=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0xe80c,0x1c2));var _0xce80=function(_0xedfb46,_0x3d538a){_0xedfb46=_0xedfb46-0x0;var _0x1a6c3f=_0xe80c[_0xedfb46];return _0x1a6c3f;};'use strict';var Sequelize=require('sequelize');module[_0xce80('0x0')]={'name':{'type':Sequelize[_0xce80('0x1')],'unique':_0xce80('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xce80('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xce80('0x4')]('rrmemory',_0xce80('0x5'),_0xce80('0x6'))},'description':{'type':Sequelize[_0xce80('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4c85398..15a0537 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 _0x7cab=['bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','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','localhost','socket.io-emitter','./whatsappQueue.socket','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','WhatsappQueues','destroy','end','sendStatus','error','name','send','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','SIP','updatedAt','getTeams','Team','nolimit','addTeams','online','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','getAgents','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x599d23,_0x26c88a){var _0x3f2af1=function(_0x3aea34){while(--_0x3aea34){_0x599d23['push'](_0x599d23['shift']());}};_0x3f2af1(++_0x26c88a);}(_0x7cab,0x86));var _0xb7ca=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x7cab[_0x209ec9];return _0x129b1b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7ca('0x0'));var zipdir=require(_0xb7ca('0x1'));var jsonpatch=require(_0xb7ca('0x2'));var rp=require('request-promise');var moment=require(_0xb7ca('0x3'));var BPromise=require(_0xb7ca('0x4'));var Mustache=require(_0xb7ca('0x5'));var util=require('util');var path=require(_0xb7ca('0x6'));var sox=require(_0xb7ca('0x7'));var csv=require(_0xb7ca('0x8'));var ejs=require(_0xb7ca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7ca('0xa'));var squel=require('squel');var crypto=require(_0xb7ca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb7ca('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb7ca('0xd'));var Redis=require(_0xb7ca('0xe'));var authService=require(_0xb7ca('0xf'));var qs=require(_0xb7ca('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7ca('0x11'));var logger=require(_0xb7ca('0x12'))(_0xb7ca('0x13'));var utils=require(_0xb7ca('0x14'));var config=require(_0xb7ca('0x15'));var licenseUtil=require(_0xb7ca('0x16'));var db=require(_0xb7ca('0x17'))['db'];config[_0xb7ca('0x18')]=_['defaults'](config[_0xb7ca('0x18')],{'host':_0xb7ca('0x19'),'port':0x18eb});var socket=require(_0xb7ca('0x1a'))(new Redis(config[_0xb7ca('0x18')]));require(_0xb7ca('0x1b'))['register'](socket);function respondWithStatusCode(_0x122097,_0x3bdff9){_0x3bdff9=_0x3bdff9||0xcc;return function(_0x75c592){if(_0x75c592){return _0x122097['sendStatus'](_0x3bdff9);}return _0x122097[_0xb7ca('0x1c')](_0x3bdff9)['end']();};}function respondWithResult(_0x2bdab9,_0x430c30){_0x430c30=_0x430c30||0xc8;return function(_0x174257){if(_0x174257){return _0x2bdab9[_0xb7ca('0x1c')](_0x430c30)[_0xb7ca('0x1d')](_0x174257);}};}function respondWithFilteredResult(_0x558033,_0x2479c5){return function(_0x1cf82c){if(_0x1cf82c){var _0x4cf5d9=typeof _0x2479c5[_0xb7ca('0x1e')]===_0xb7ca('0x1f')&&typeof _0x2479c5['limit']===_0xb7ca('0x1f');var _0xfc6c89=_0x1cf82c[_0xb7ca('0x20')];var _0x4ee6e7=_0x4cf5d9?0x0:_0x2479c5[_0xb7ca('0x1e')];var _0x460609=_0x4cf5d9?_0x1cf82c[_0xb7ca('0x20')]:_0x2479c5[_0xb7ca('0x1e')]+_0x2479c5[_0xb7ca('0x21')];var _0x34822c;if(_0x460609>=_0xfc6c89){_0x460609=_0xfc6c89;_0x34822c=0xc8;}else{_0x34822c=0xce;}_0x558033[_0xb7ca('0x1c')](_0x34822c);return _0x558033[_0xb7ca('0x22')](_0xb7ca('0x23'),_0x4ee6e7+'-'+_0x460609+'/'+_0xfc6c89)[_0xb7ca('0x1d')](_0x1cf82c);}return null;};}function patchUpdates(_0x4ce83a){return function(_0x443524){try{jsonpatch[_0xb7ca('0x24')](_0x443524,_0x4ce83a,!![]);}catch(_0x1dbf3d){return BPromise['reject'](_0x1dbf3d);}return _0x443524[_0xb7ca('0x25')]();};}function saveUpdates(_0x1594dc,_0x2a934c){return function(_0x1e85fb){if(_0x1e85fb){return _0x1e85fb[_0xb7ca('0x26')](_0x1594dc)[_0xb7ca('0x27')](function(_0x2009f2){return _0x2009f2;});}return null;};}function removeEntity(_0x41cb56,_0xde5071){return function(_0x50be56){if(_0x50be56){return _0x50be56['destroy']()[_0xb7ca('0x27')](function(){var _0x1e4b79=_0x50be56[_0xb7ca('0x28')]({'plain':!![]});var _0x52045b=_0xb7ca('0x29');return db['UserProfileResource'][_0xb7ca('0x2a')]({'where':{'type':_0x52045b,'resourceId':_0x1e4b79['id']}})['then'](function(){return _0x50be56;});})[_0xb7ca('0x27')](function(){_0x41cb56[_0xb7ca('0x1c')](0xcc)[_0xb7ca('0x2b')]();});}};}function handleEntityNotFound(_0x313447,_0x2f3de3){return function(_0x3e661a){if(!_0x3e661a){_0x313447[_0xb7ca('0x2c')](0x194);}return _0x3e661a;};}function handleError(_0x27c527,_0x1ec75b){_0x1ec75b=_0x1ec75b||0x1f4;return function(_0x1a813d){logger[_0xb7ca('0x2d')](_0x1a813d['stack']);if(_0x1a813d['name']){delete _0x1a813d[_0xb7ca('0x2e')];}_0x27c527['status'](_0x1ec75b)[_0xb7ca('0x2f')](_0x1a813d);};}exports[_0xb7ca('0x30')]=function(_0x1aed2d,_0x1c6f01){var _0x292ef1={},_0x2818dd={},_0x4ca686={'count':0x0,'rows':[]};var _0x4451fe=_[_0xb7ca('0x31')](db[_0xb7ca('0x32')]['rawAttributes'],function(_0x58f516){return{'name':_0x58f516[_0xb7ca('0x33')],'type':_0x58f516[_0xb7ca('0x34')][_0xb7ca('0x35')]};});_0x2818dd[_0xb7ca('0x36')]=_[_0xb7ca('0x31')](_0x4451fe,_0xb7ca('0x2e'));_0x2818dd[_0xb7ca('0x37')]=_[_0xb7ca('0x38')](_0x1aed2d[_0xb7ca('0x37')]);_0x2818dd[_0xb7ca('0x39')]=_[_0xb7ca('0x3a')](_0x2818dd[_0xb7ca('0x36')],_0x2818dd[_0xb7ca('0x37')]);_0x292ef1[_0xb7ca('0x3b')]=_['intersection'](_0x2818dd[_0xb7ca('0x36')],qs[_0xb7ca('0x3c')](_0x1aed2d[_0xb7ca('0x37')]['fields']));_0x292ef1[_0xb7ca('0x3b')]=_0x292ef1[_0xb7ca('0x3b')][_0xb7ca('0x3d')]?_0x292ef1[_0xb7ca('0x3b')]:_0x2818dd[_0xb7ca('0x36')];if(!_0x1aed2d[_0xb7ca('0x37')][_0xb7ca('0x3e')]('nolimit')){_0x292ef1[_0xb7ca('0x21')]=qs[_0xb7ca('0x21')](_0x1aed2d['query'][_0xb7ca('0x21')]);_0x292ef1[_0xb7ca('0x1e')]=qs[_0xb7ca('0x1e')](_0x1aed2d['query'][_0xb7ca('0x1e')]);}_0x292ef1[_0xb7ca('0x3f')]=qs['sort'](_0x1aed2d['query'][_0xb7ca('0x40')]);_0x292ef1['where']=qs['filters'](_[_0xb7ca('0x41')](_0x1aed2d[_0xb7ca('0x37')],_0x2818dd[_0xb7ca('0x39')]),_0x4451fe);if(_0x1aed2d[_0xb7ca('0x37')][_0xb7ca('0x42')]){_0x292ef1['where']=_[_0xb7ca('0x43')](_0x292ef1[_0xb7ca('0x44')],{'$or':_[_0xb7ca('0x31')](_0x4451fe,function(_0x377d52){if(_0x377d52[_0xb7ca('0x34')]!==_0xb7ca('0x45')){var _0x47959e={};_0x47959e[_0x377d52['name']]={'$like':'%'+_0x1aed2d[_0xb7ca('0x37')][_0xb7ca('0x42')]+'%'};return _0x47959e;}})});}_0x292ef1=_[_0xb7ca('0x43')]({},_0x292ef1,_0x1aed2d['options']);var _0x491bfb={'where':_0x292ef1[_0xb7ca('0x44')]};return db[_0xb7ca('0x32')][_0xb7ca('0x20')](_0x491bfb)[_0xb7ca('0x27')](function(_0x5e2554){_0x4ca686[_0xb7ca('0x20')]=_0x5e2554;if(_0x1aed2d[_0xb7ca('0x37')]['includeAll']){_0x292ef1[_0xb7ca('0x46')]=[{'all':!![]}];}return db[_0xb7ca('0x32')][_0xb7ca('0x47')](_0x292ef1);})[_0xb7ca('0x27')](function(_0x598edf){_0x4ca686['rows']=_0x598edf;return _0x4ca686;})['then'](respondWithFilteredResult(_0x1c6f01,_0x292ef1))[_0xb7ca('0x48')](handleError(_0x1c6f01,null));};exports[_0xb7ca('0x49')]=function(_0x3d8d7d,_0x318d1c){var _0x66203b={'raw':!![],'where':{'id':_0x3d8d7d[_0xb7ca('0x4a')]['id']}},_0x9d7eee={};_0x9d7eee[_0xb7ca('0x36')]=_['keys'](db[_0xb7ca('0x32')][_0xb7ca('0x4b')]);_0x9d7eee[_0xb7ca('0x37')]=_['keys'](_0x3d8d7d[_0xb7ca('0x37')]);_0x9d7eee[_0xb7ca('0x39')]=_[_0xb7ca('0x3a')](_0x9d7eee['model'],_0x9d7eee['query']);_0x66203b[_0xb7ca('0x3b')]=_['intersection'](_0x9d7eee[_0xb7ca('0x36')],qs[_0xb7ca('0x3c')](_0x3d8d7d[_0xb7ca('0x37')][_0xb7ca('0x3c')]));_0x66203b[_0xb7ca('0x3b')]=_0x66203b[_0xb7ca('0x3b')][_0xb7ca('0x3d')]?_0x66203b[_0xb7ca('0x3b')]:_0x9d7eee[_0xb7ca('0x36')];if(_0x3d8d7d[_0xb7ca('0x37')][_0xb7ca('0x4c')]){_0x66203b[_0xb7ca('0x46')]=[{'all':!![]}];}_0x66203b=_[_0xb7ca('0x43')]({},_0x66203b,_0x3d8d7d[_0xb7ca('0x4d')]);return db[_0xb7ca('0x32')][_0xb7ca('0x4e')](_0x66203b)[_0xb7ca('0x27')](handleEntityNotFound(_0x318d1c,null))['then'](respondWithResult(_0x318d1c,null))[_0xb7ca('0x48')](handleError(_0x318d1c,null));};exports['create']=function(_0x138f1d,_0x47448a){return db[_0xb7ca('0x32')][_0xb7ca('0x4f')](_0x138f1d[_0xb7ca('0x50')],{})['then'](function(_0x361067){var _0x4491a6=_0x138f1d[_0xb7ca('0x51')][_0xb7ca('0x28')]({'plain':!![]});if(!_0x4491a6)throw new Error(_0xb7ca('0x52'));if(_0x4491a6['role']==='user'){var _0x28cf51=_0x361067['get']({'plain':!![]});var _0x5cba50='WhatsappQueues';return db[_0xb7ca('0x53')][_0xb7ca('0x4e')]({'where':{'name':_0x5cba50,'userProfileId':_0x4491a6[_0xb7ca('0x54')]},'raw':!![]})[_0xb7ca('0x27')](function(_0x18b137){if(_0x18b137&&_0x18b137[_0xb7ca('0x55')]===0x0){return db['UserProfileResource'][_0xb7ca('0x4f')]({'name':_0x28cf51[_0xb7ca('0x2e')],'resourceId':_0x28cf51['id'],'type':_0x18b137[_0xb7ca('0x2e')],'sectionId':_0x18b137['id']},{})[_0xb7ca('0x27')](function(){return _0x361067;});}else{return _0x361067;}})['catch'](function(_0x3479bf){logger['error'](_0xb7ca('0x56'),_0x3479bf);throw _0x3479bf;});}return _0x361067;})[_0xb7ca('0x27')](respondWithResult(_0x47448a,0xc9))[_0xb7ca('0x48')](handleError(_0x47448a,null));};exports['update']=function(_0x513d6d,_0x3611ec){if(_0x513d6d[_0xb7ca('0x50')]['id']){delete _0x513d6d['body']['id'];}return db[_0xb7ca('0x32')][_0xb7ca('0x4e')]({'where':{'id':_0x513d6d[_0xb7ca('0x4a')]['id']}})[_0xb7ca('0x27')](handleEntityNotFound(_0x3611ec,null))['then'](saveUpdates(_0x513d6d[_0xb7ca('0x50')],null))['then'](respondWithResult(_0x3611ec,null))['catch'](handleError(_0x3611ec,null));};exports[_0xb7ca('0x2a')]=function(_0x313179,_0x49c07e){return db[_0xb7ca('0x32')]['find']({'where':{'id':_0x313179['params']['id']}})[_0xb7ca('0x27')](handleEntityNotFound(_0x49c07e,null))[_0xb7ca('0x27')](removeEntity(_0x49c07e,null))[_0xb7ca('0x48')](handleError(_0x49c07e,null));};exports[_0xb7ca('0x57')]=function(_0x53f64c,_0x511cd8){return db[_0xb7ca('0x32')]['describe']()[_0xb7ca('0x27')](respondWithResult(_0x511cd8,null))['catch'](handleError(_0x511cd8,null));};exports[_0xb7ca('0x58')]=function(_0x50f504,_0x313210,_0x2fafbb){var _0x41a880={'raw':!![],'where':{}},_0x5c67c7={},_0x30cbda;return db[_0xb7ca('0x32')][_0xb7ca('0x59')]({'where':{'id':_0x50f504[_0xb7ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x313210,null))[_0xb7ca('0x27')](function(_0x185044){if(_0x185044){_0x30cbda=_0x185044[_0xb7ca('0x28')]({'plain':!![]});_0x5c67c7[_0xb7ca('0x36')]=_['keys'](db[_0xb7ca('0x5a')][_0xb7ca('0x4b')]);_0x5c67c7[_0xb7ca('0x37')]=_[_0xb7ca('0x38')](_0x50f504[_0xb7ca('0x37')]);_0x5c67c7[_0xb7ca('0x39')]=_['intersection'](_0x5c67c7[_0xb7ca('0x36')],_0x5c67c7[_0xb7ca('0x37')]);_0x41a880['attributes']=_[_0xb7ca('0x3a')](_0x5c67c7[_0xb7ca('0x36')],qs['fields'](_0x50f504[_0xb7ca('0x37')][_0xb7ca('0x3c')]));_0x41a880[_0xb7ca('0x3b')]=_0x41a880[_0xb7ca('0x3b')][_0xb7ca('0x3d')]?_0x41a880[_0xb7ca('0x3b')]:_0x5c67c7['model'];if(!_0x50f504[_0xb7ca('0x37')][_0xb7ca('0x3e')]('nolimit')){_0x41a880[_0xb7ca('0x21')]=qs['limit'](_0x50f504[_0xb7ca('0x37')]['limit']);_0x41a880[_0xb7ca('0x1e')]=qs[_0xb7ca('0x1e')](_0x50f504[_0xb7ca('0x37')]['offset']);}_0x41a880[_0xb7ca('0x3f')]=qs[_0xb7ca('0x40')](_0x50f504['query']['sort']);_0x41a880[_0xb7ca('0x44')]=qs[_0xb7ca('0x39')](_[_0xb7ca('0x41')](_0x50f504[_0xb7ca('0x37')],_0x5c67c7[_0xb7ca('0x39')]));_0x41a880[_0xb7ca('0x44')][_0xb7ca('0x5b')]=_0x185044['id'];if(_0x50f504['query'][_0xb7ca('0x42')]){_0x41a880['where']=_[_0xb7ca('0x43')](_0x41a880['where'],{'$or':_['map'](_0x41a880['attributes'],function(_0x71f382){var _0x504883={};_0x504883[_0x71f382]={'$like':'%'+_0x50f504['query'][_0xb7ca('0x42')]+'%'};return _0x504883;})});}_0x41a880=_[_0xb7ca('0x43')]({},_0x41a880,_0x50f504[_0xb7ca('0x4d')]);return db[_0xb7ca('0x5a')][_0xb7ca('0x47')](_0x41a880);}})[_0xb7ca('0x27')](function(_0x178925){if(_0x178925){return db[_0xb7ca('0x5c')][_0xb7ca('0x5d')]({'where':{'id':_['map'](_0x178925,_0xb7ca('0x5e')),'role':_0xb7ca('0x5f')},'attributes':['id','name',_0xb7ca('0x60'),'updatedAt',_0xb7ca('0x61')]});}})[_0xb7ca('0x27')](function(_0xcf9d92){if(_0xcf9d92){return{'count':_0xcf9d92[_0xb7ca('0x20')],'rows':_['map'](_0xcf9d92['rows'],function(_0x52e65e){return{'membername':_0x52e65e[_0xb7ca('0x2e')],'UserId':_0x52e65e['id'],'queue_name':_0x30cbda[_0xb7ca('0x2e')],'WhatsappQueueId':_0x30cbda['id'],'interface':util[_0xb7ca('0x62')]('%s/%s',_0xb7ca('0x63'),_0x52e65e[_0xb7ca('0x2e')]),'penalty':0x0,'paused':_0x52e65e[_0xb7ca('0x60')],'createdAt':_0x52e65e[_0xb7ca('0x61')],'updatedAt':_0x52e65e[_0xb7ca('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb7ca('0x27')](respondWithFilteredResult(_0x313210,_0x41a880))[_0xb7ca('0x48')](handleError(_0x313210,null));};exports[_0xb7ca('0x65')]=function(_0x4eada3,_0x2dce76,_0x1457ae){var _0x4f08f6={};var _0x559784={};var _0x5b0863;var _0x57e522;return db[_0xb7ca('0x32')]['findOne']({'where':{'id':_0x4eada3[_0xb7ca('0x4a')]['id']}})[_0xb7ca('0x27')](handleEntityNotFound(_0x2dce76,null))['then'](function(_0x44b971){if(_0x44b971){_0x5b0863=_0x44b971;_0x559784[_0xb7ca('0x36')]=_[_0xb7ca('0x38')](db[_0xb7ca('0x66')]['rawAttributes']);_0x559784[_0xb7ca('0x37')]=_[_0xb7ca('0x38')](_0x4eada3['query']);_0x559784[_0xb7ca('0x39')]=_[_0xb7ca('0x3a')](_0x559784[_0xb7ca('0x36')],_0x559784[_0xb7ca('0x37')]);_0x4f08f6[_0xb7ca('0x3b')]=_[_0xb7ca('0x3a')](_0x559784[_0xb7ca('0x36')],qs[_0xb7ca('0x3c')](_0x4eada3[_0xb7ca('0x37')][_0xb7ca('0x3c')]));_0x4f08f6[_0xb7ca('0x3b')]=_0x4f08f6['attributes']['length']?_0x4f08f6[_0xb7ca('0x3b')]:_0x559784[_0xb7ca('0x36')];_0x4f08f6[_0xb7ca('0x3f')]=qs[_0xb7ca('0x40')](_0x4eada3['query']['sort']);_0x4f08f6[_0xb7ca('0x44')]=qs['filters'](_[_0xb7ca('0x41')](_0x4eada3['query'],_0x559784['filters']));if(_0x4eada3[_0xb7ca('0x37')][_0xb7ca('0x42')]){_0x4f08f6[_0xb7ca('0x44')]=_[_0xb7ca('0x43')](_0x4f08f6[_0xb7ca('0x44')],{'$or':_[_0xb7ca('0x31')](_0x4f08f6[_0xb7ca('0x3b')],function(_0x519bf4){var _0x4318cb={};_0x4318cb[_0x519bf4]={'$like':'%'+_0x4eada3['query']['filter']+'%'};return _0x4318cb;})});}_0x4f08f6=_['merge']({},_0x4f08f6,_0x4eada3[_0xb7ca('0x4d')]);return _0x5b0863[_0xb7ca('0x65')](_0x4f08f6);}})[_0xb7ca('0x27')](function(_0x1ba158){if(_0x1ba158){_0x57e522=_0x1ba158[_0xb7ca('0x3d')];if(!_0x4eada3[_0xb7ca('0x37')][_0xb7ca('0x3e')](_0xb7ca('0x67'))){_0x4f08f6[_0xb7ca('0x21')]=qs[_0xb7ca('0x21')](_0x4eada3[_0xb7ca('0x37')][_0xb7ca('0x21')]);_0x4f08f6[_0xb7ca('0x1e')]=qs['offset'](_0x4eada3[_0xb7ca('0x37')][_0xb7ca('0x1e')]);}return _0x5b0863['getTeams'](_0x4f08f6);}})[_0xb7ca('0x27')](function(_0x14a583){if(_0x14a583){return _0x14a583?{'count':_0x57e522,'rows':_0x14a583}:null;}})[_0xb7ca('0x27')](respondWithResult(_0x2dce76,null))[_0xb7ca('0x48')](handleError(_0x2dce76,null));};exports[_0xb7ca('0x68')]=function(_0x4ec0a3,_0x534c0b,_0x17735){var _0x253138=_0x4ec0a3[_0xb7ca('0x50')]['ids'];return db[_0xb7ca('0x66')]['findAll']({'where':{'id':_0x253138},'attributes':['id'],'include':[{'model':db[_0xb7ca('0x5c')],'as':'Agents','attributes':['id',_0xb7ca('0x2e'),_0xb7ca('0x69'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x157fe6){if(_0x157fe6){var _0x14b5e0=_[_0xb7ca('0x6a')](_0x157fe6,function(_0xc424e2){var _0x1cc07d=_0xc424e2[_0xb7ca('0x28')]({'plain':!![]});return _0x1cc07d[_0xb7ca('0x6b')];});return db[_0xb7ca('0x32')]['find']({'where':{'id':_0x4ec0a3['params']['id']}})[_0xb7ca('0x27')](function(_0x45f4c4){return db[_0xb7ca('0x6c')][_0xb7ca('0x6d')](function(_0x558bee){return _0x45f4c4[_0xb7ca('0x68')](_0x253138,{'transaction':_0x558bee})[_0xb7ca('0x27')](function(){return BPromise[_0xb7ca('0x6e')](_0x14b5e0,function(_0x5a0b96){return db[_0xb7ca('0x5a')][_0xb7ca('0x6f')]({'where':{'UserId':_0x5a0b96['id'],'WhatsappQueueId':_0x4ec0a3[_0xb7ca('0x4a')]['id']},'transaction':_0x558bee});});})[_0xb7ca('0x27')](function(){_0x14b5e0['forEach'](function(_0x5f2cab){socket[_0xb7ca('0x70')](_0xb7ca('0x71'),{'UserId':_0x5f2cab['id'],'WhatsappQueueId':_0x45f4c4['id']});});});});});}})[_0xb7ca('0x27')](respondWithStatusCode(_0x534c0b,null))[_0xb7ca('0x48')](handleError(_0x534c0b,null));};exports[_0xb7ca('0x72')]=function(_0x3989c7,_0x1672b4,_0x11d2cb){return db['Team']['findAll']({'where':{'id':_0x3989c7[_0xb7ca('0x37')][_0xb7ca('0x73')]},'attributes':['id'],'include':[{'model':db[_0xb7ca('0x5c')],'as':_0xb7ca('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1672b4,null))[_0xb7ca('0x27')](function(_0x5daf08){var _0x170c7f=_[_0xb7ca('0x31')](_0x5daf08,'id');var _0x41fd23=[];var _0x1ebb28=[];var _0x1efc84=squel[_0xb7ca('0x74')]();_0x1efc84[_0xb7ca('0x75')](_0xb7ca('0x76'))[_0xb7ca('0x77')](_0xb7ca('0x78'),'tq')[_0xb7ca('0x79')](_0xb7ca('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb7ca('0x7b'),_0x3989c7['params']['id']);for(var _0x592e19=0x0;_0x592e19<_0x5daf08[_0xb7ca('0x3d')];_0x592e19+=0x1){let _0xb4de6c=_0x5daf08[_0x592e19];for(var _0x2ccbd5=0x0;_0x2ccbd5<_0xb4de6c[_0xb7ca('0x6b')][_0xb7ca('0x3d')];_0x2ccbd5+=0x1){let _0x32a7b4=_0xb4de6c[_0xb7ca('0x6b')][_0x2ccbd5];var _0x306973=_0x1efc84[_0xb7ca('0x7c')]();_0x306973[_0xb7ca('0x44')](_0xb7ca('0x7d'),_0x32a7b4['id']);_0x1ebb28[_0xb7ca('0x7e')](db['sequelize']['query'](_0x306973[_0xb7ca('0x7f')](),{'type':db[_0xb7ca('0x6c')][_0xb7ca('0x80')]['SELECT']})[_0xb7ca('0x27')](function(_0x1dba14){if(_0x1dba14[_0xb7ca('0x3d')]===0x1){return _0x32a7b4['id'];}else{var _0x276984=_[_0xb7ca('0x81')](_[_0xb7ca('0x31')](_0x1dba14,_0xb7ca('0x82')),function(_0x1fc2bf){return _['includes'](_0x170c7f,_0x1fc2bf);});if(_0x276984){return _0x32a7b4['id'];}}}));}}return BPromise['all'](_0x1ebb28)['then'](function(_0x219af8){_0x41fd23=_(_0x41fd23)[_0xb7ca('0x83')](_0x219af8)[_0xb7ca('0x84')]()['value']();return db[_0xb7ca('0x32')][_0xb7ca('0x4e')]({'where':{'id':_0x3989c7[_0xb7ca('0x4a')]['id']}})[_0xb7ca('0x27')](function(_0x526479){return db['sequelize'][_0xb7ca('0x6d')](function(_0x2612d){return _0x526479[_0xb7ca('0x72')](_0x3989c7[_0xb7ca('0x37')]['ids'],{'transaction':_0x2612d})['then'](function(){if(!_[_0xb7ca('0x85')](_0x41fd23)){return _0x526479[_0xb7ca('0x86')](_0x41fd23,{'transaction':_0x2612d});}})[_0xb7ca('0x27')](function(){_0x41fd23['forEach'](function(_0x2c533e){socket[_0xb7ca('0x70')](_0xb7ca('0x87'),{'UserId':_0x2c533e,'WhatsappQueueId':_0x526479['id']});});});});});});})[_0xb7ca('0x27')](respondWithStatusCode(_0x1672b4,null))[_0xb7ca('0x48')](handleError(_0x1672b4,null));};exports[_0xb7ca('0x88')]=function(_0x2a56d9,_0x48e0c6,_0x14d4b7){return db[_0xb7ca('0x32')]['find']({'where':{'id':_0x2a56d9['params']['id']}})['then'](handleEntityNotFound(_0x48e0c6,null))[_0xb7ca('0x27')](function(_0x5e1a5d){if(_0x5e1a5d){return _0x5e1a5d[_0xb7ca('0x88')](_0x2a56d9[_0xb7ca('0x50')][_0xb7ca('0x73')],_['omit'](_0x2a56d9[_0xb7ca('0x50')],[_0xb7ca('0x73'),'id'])||{})['spread'](function(_0x1dae61){for(var _0x52667b=0x0;_0x52667b<_0x2a56d9['body'][_0xb7ca('0x73')]['length'];_0x52667b+=0x1){socket[_0xb7ca('0x70')](_0xb7ca('0x71'),{'UserId':Number(_0x2a56d9[_0xb7ca('0x50')][_0xb7ca('0x73')][_0x52667b]),'WhatsappQueueId':Number(_0x2a56d9[_0xb7ca('0x4a')]['id'])});}return _0x1dae61;});}})['then'](respondWithResult(_0x48e0c6,null))[_0xb7ca('0x48')](handleError(_0x48e0c6,null));};exports['removeAgents']=function(_0x4bc8da,_0x50e99a,_0x5cb92c){return db[_0xb7ca('0x32')][_0xb7ca('0x4e')]({'where':{'id':_0x4bc8da[_0xb7ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50e99a,null))[_0xb7ca('0x27')](function(_0x963f78){if(_0x963f78){return _0x963f78[_0xb7ca('0x86')](_0x4bc8da[_0xb7ca('0x37')][_0xb7ca('0x73')])['then'](function(){if(_['isArray'](_0x4bc8da[_0xb7ca('0x37')][_0xb7ca('0x73')])){for(var _0x2adfd6=0x0;_0x2adfd6<_0x4bc8da['query']['ids'][_0xb7ca('0x3d')];_0x2adfd6+=0x1){socket[_0xb7ca('0x70')](_0xb7ca('0x87'),{'UserId':Number(_0x4bc8da[_0xb7ca('0x37')][_0xb7ca('0x73')][_0x2adfd6]),'WhatsappQueueId':Number(_0x4bc8da['params']['id'])});}}else{socket[_0xb7ca('0x70')](_0xb7ca('0x87'),{'UserId':Number(_0x4bc8da[_0xb7ca('0x37')][_0xb7ca('0x73')]),'WhatsappQueueId':Number(_0x4bc8da['params']['id'])});}});}})[_0xb7ca('0x27')](respondWithStatusCode(_0x50e99a,null))[_0xb7ca('0x48')](handleError(_0x50e99a,null));};exports[_0xb7ca('0x89')]=function(_0x582df0,_0x2a3806,_0x2fba98){var _0x537a68={};var _0x24629a={};var _0x34e75d;var _0x4bdea1;return db[_0xb7ca('0x32')]['findOne']({'where':{'id':_0x582df0['params']['id']}})[_0xb7ca('0x27')](handleEntityNotFound(_0x2a3806,null))[_0xb7ca('0x27')](function(_0x347f04){if(_0x347f04){_0x34e75d=_0x347f04;_0x24629a[_0xb7ca('0x36')]=_[_0xb7ca('0x38')](db[_0xb7ca('0x5c')][_0xb7ca('0x4b')]);_0x24629a[_0xb7ca('0x37')]=_[_0xb7ca('0x38')](_0x582df0[_0xb7ca('0x37')]);_0x24629a[_0xb7ca('0x39')]=_['intersection'](_0x24629a['model'],_0x24629a[_0xb7ca('0x37')]);_0x537a68[_0xb7ca('0x3b')]=_[_0xb7ca('0x3a')](_0x24629a[_0xb7ca('0x36')],qs[_0xb7ca('0x3c')](_0x582df0['query']['fields']));_0x537a68[_0xb7ca('0x3b')]=_0x537a68[_0xb7ca('0x3b')][_0xb7ca('0x3d')]?_0x537a68[_0xb7ca('0x3b')]:_0x24629a[_0xb7ca('0x36')];_0x537a68[_0xb7ca('0x3f')]=qs[_0xb7ca('0x40')](_0x582df0[_0xb7ca('0x37')][_0xb7ca('0x40')]);_0x537a68['where']=qs[_0xb7ca('0x39')](_[_0xb7ca('0x41')](_0x582df0[_0xb7ca('0x37')],_0x24629a[_0xb7ca('0x39')]));if(_0x582df0[_0xb7ca('0x37')][_0xb7ca('0x42')]){_0x537a68[_0xb7ca('0x44')]=_[_0xb7ca('0x43')](_0x537a68[_0xb7ca('0x44')],{'$or':_[_0xb7ca('0x31')](_0x537a68[_0xb7ca('0x3b')],function(_0x2c1e6a){var _0x4a4630={};_0x4a4630[_0x2c1e6a]={'$like':'%'+_0x582df0[_0xb7ca('0x37')]['filter']+'%'};return _0x4a4630;})});}_0x537a68=_[_0xb7ca('0x43')]({},_0x537a68,_0x582df0[_0xb7ca('0x4d')]);return _0x34e75d[_0xb7ca('0x89')](_0x537a68);}})[_0xb7ca('0x27')](function(_0x22459f){if(_0x22459f){_0x4bdea1=_0x22459f[_0xb7ca('0x3d')];if(!_0x582df0['query'][_0xb7ca('0x3e')](_0xb7ca('0x67'))){_0x537a68[_0xb7ca('0x21')]=qs['limit'](_0x582df0[_0xb7ca('0x37')][_0xb7ca('0x21')]);_0x537a68[_0xb7ca('0x1e')]=qs[_0xb7ca('0x1e')](_0x582df0[_0xb7ca('0x37')][_0xb7ca('0x1e')]);}return _0x34e75d[_0xb7ca('0x89')](_0x537a68);}})[_0xb7ca('0x27')](function(_0x1eb257){if(_0x1eb257){return _0x1eb257?{'count':_0x4bdea1,'rows':_0x1eb257}:null;}})['then'](respondWithResult(_0x2a3806,null))[_0xb7ca('0x48')](handleError(_0x2a3806,null));}; \ No newline at end of file +var _0x8e55=['ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeAgents','forEach','omit','userWhatsappQueue:save','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','WhatsappQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','WhatsappQueue','findAll','show','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','pick','WhatsappQueueId','User','UserId','whatsappPause','updatedAt','createdAt','rows','format','SIP','Team','getTeams','nolimit','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','emit','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams'];(function(_0x4a994b,_0x389745){var _0x5c14c4=function(_0x5aeb77){while(--_0x5aeb77){_0x4a994b['push'](_0x4a994b['shift']());}};_0x5c14c4(++_0x389745);}(_0x8e55,0x1ca));var _0x58e5=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x8e55[_0x2b152a];return _0x2ad4c7;};'use strict';var emlformat=require(_0x58e5('0x0'));var rimraf=require(_0x58e5('0x1'));var zipdir=require(_0x58e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58e5('0x3'));var moment=require(_0x58e5('0x4'));var BPromise=require(_0x58e5('0x5'));var Mustache=require(_0x58e5('0x6'));var util=require(_0x58e5('0x7'));var path=require('path');var sox=require(_0x58e5('0x8'));var csv=require(_0x58e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58e5('0xa'));var _=require(_0x58e5('0xb'));var squel=require(_0x58e5('0xc'));var crypto=require(_0x58e5('0xd'));var jsforce=require(_0x58e5('0xe'));var deskjs=require(_0x58e5('0xf'));var toCsv=require(_0x58e5('0x9'));var querystring=require(_0x58e5('0x10'));var Papa=require(_0x58e5('0x11'));var Redis=require(_0x58e5('0x12'));var authService=require(_0x58e5('0x13'));var qs=require(_0x58e5('0x14'));var as=require(_0x58e5('0x15'));var hardwareService=require(_0x58e5('0x16'));var logger=require('../../config/logger')(_0x58e5('0x17'));var utils=require(_0x58e5('0x18'));var config=require(_0x58e5('0x19'));var licenseUtil=require(_0x58e5('0x1a'));var db=require(_0x58e5('0x1b'))['db'];config['redis']=_['defaults'](config[_0x58e5('0x1c')],{'host':_0x58e5('0x1d'),'port':0x18eb});var socket=require(_0x58e5('0x1e'))(new Redis(config['redis']));require(_0x58e5('0x1f'))[_0x58e5('0x20')](socket);function respondWithStatusCode(_0x3f28b7,_0x1a21c8){_0x1a21c8=_0x1a21c8||0xcc;return function(_0x437f41){if(_0x437f41){return _0x3f28b7[_0x58e5('0x21')](_0x1a21c8);}return _0x3f28b7[_0x58e5('0x22')](_0x1a21c8)[_0x58e5('0x23')]();};}function respondWithResult(_0x2e88d7,_0x2783ba){_0x2783ba=_0x2783ba||0xc8;return function(_0x3e393c){if(_0x3e393c){return _0x2e88d7[_0x58e5('0x22')](_0x2783ba)['json'](_0x3e393c);}};}function respondWithFilteredResult(_0x10159d,_0x14dc83){return function(_0x37a429){if(_0x37a429){var _0x23850b=typeof _0x14dc83['offset']===_0x58e5('0x24')&&typeof _0x14dc83[_0x58e5('0x25')]==='undefined';var _0x30e00d=_0x37a429['count'];var _0x34a75a=_0x23850b?0x0:_0x14dc83['offset'];var _0x4726ae=_0x23850b?_0x37a429[_0x58e5('0x26')]:_0x14dc83[_0x58e5('0x27')]+_0x14dc83[_0x58e5('0x25')];var _0x4b1efb;if(_0x4726ae>=_0x30e00d){_0x4726ae=_0x30e00d;_0x4b1efb=0xc8;}else{_0x4b1efb=0xce;}_0x10159d[_0x58e5('0x22')](_0x4b1efb);return _0x10159d[_0x58e5('0x28')](_0x58e5('0x29'),_0x34a75a+'-'+_0x4726ae+'/'+_0x30e00d)[_0x58e5('0x2a')](_0x37a429);}return null;};}function patchUpdates(_0x3da62c){return function(_0x26e5cf){try{jsonpatch[_0x58e5('0x2b')](_0x26e5cf,_0x3da62c,!![]);}catch(_0x19110d){return BPromise[_0x58e5('0x2c')](_0x19110d);}return _0x26e5cf[_0x58e5('0x2d')]();};}function saveUpdates(_0x11fb30,_0x51b7fd){return function(_0x33e999){if(_0x33e999){return _0x33e999['update'](_0x11fb30)[_0x58e5('0x2e')](function(_0x4307a1){return _0x4307a1;});}return null;};}function removeEntity(_0x36ba6b,_0x2c700e){return function(_0x4a2a83){if(_0x4a2a83){return _0x4a2a83[_0x58e5('0x2f')]()[_0x58e5('0x2e')](function(){var _0x147314=_0x4a2a83['get']({'plain':!![]});var _0x33b0cc=_0x58e5('0x30');return db[_0x58e5('0x31')]['destroy']({'where':{'type':_0x33b0cc,'resourceId':_0x147314['id']}})[_0x58e5('0x2e')](function(){return _0x4a2a83;});})[_0x58e5('0x2e')](function(){_0x36ba6b[_0x58e5('0x22')](0xcc)[_0x58e5('0x23')]();});}};}function handleEntityNotFound(_0x360441,_0x5c8669){return function(_0x447dee){if(!_0x447dee){_0x360441[_0x58e5('0x21')](0x194);}return _0x447dee;};}function handleError(_0x51807e,_0x357171){_0x357171=_0x357171||0x1f4;return function(_0x2999d0){logger[_0x58e5('0x32')](_0x2999d0[_0x58e5('0x33')]);if(_0x2999d0[_0x58e5('0x34')]){delete _0x2999d0['name'];}_0x51807e['status'](_0x357171)[_0x58e5('0x35')](_0x2999d0);};}exports['index']=function(_0x467b34,_0x54b000){var _0x2113a9={},_0x416509={},_0x1135cf={'count':0x0,'rows':[]};var _0xe9495f=_[_0x58e5('0x36')](db['WhatsappQueue'][_0x58e5('0x37')],function(_0x4a18b3){return{'name':_0x4a18b3[_0x58e5('0x38')],'type':_0x4a18b3[_0x58e5('0x39')][_0x58e5('0x3a')]};});_0x416509[_0x58e5('0x3b')]=_[_0x58e5('0x36')](_0xe9495f,'name');_0x416509[_0x58e5('0x3c')]=_[_0x58e5('0x3d')](_0x467b34['query']);_0x416509[_0x58e5('0x3e')]=_[_0x58e5('0x3f')](_0x416509[_0x58e5('0x3b')],_0x416509[_0x58e5('0x3c')]);_0x2113a9[_0x58e5('0x40')]=_['intersection'](_0x416509['model'],qs[_0x58e5('0x41')](_0x467b34['query'][_0x58e5('0x41')]));_0x2113a9[_0x58e5('0x40')]=_0x2113a9[_0x58e5('0x40')][_0x58e5('0x42')]?_0x2113a9[_0x58e5('0x40')]:_0x416509[_0x58e5('0x3b')];if(!_0x467b34[_0x58e5('0x3c')]['hasOwnProperty']('nolimit')){_0x2113a9[_0x58e5('0x25')]=qs[_0x58e5('0x25')](_0x467b34['query'][_0x58e5('0x25')]);_0x2113a9[_0x58e5('0x27')]=qs['offset'](_0x467b34[_0x58e5('0x3c')][_0x58e5('0x27')]);}_0x2113a9[_0x58e5('0x43')]=qs[_0x58e5('0x44')](_0x467b34[_0x58e5('0x3c')][_0x58e5('0x44')]);_0x2113a9[_0x58e5('0x45')]=qs[_0x58e5('0x3e')](_['pick'](_0x467b34[_0x58e5('0x3c')],_0x416509[_0x58e5('0x3e')]),_0xe9495f);if(_0x467b34[_0x58e5('0x3c')]['filter']){_0x2113a9[_0x58e5('0x45')]=_[_0x58e5('0x46')](_0x2113a9[_0x58e5('0x45')],{'$or':_['map'](_0xe9495f,function(_0x3b3e42){if(_0x3b3e42[_0x58e5('0x39')]!==_0x58e5('0x47')){var _0xfc9d90={};_0xfc9d90[_0x3b3e42['name']]={'$like':'%'+_0x467b34[_0x58e5('0x3c')][_0x58e5('0x48')]+'%'};return _0xfc9d90;}})});}_0x2113a9=_[_0x58e5('0x46')]({},_0x2113a9,_0x467b34['options']);var _0x32a3ae={'where':_0x2113a9[_0x58e5('0x45')]};return db[_0x58e5('0x49')][_0x58e5('0x26')](_0x32a3ae)[_0x58e5('0x2e')](function(_0x24c21c){_0x1135cf[_0x58e5('0x26')]=_0x24c21c;if(_0x467b34['query']['includeAll']){_0x2113a9['include']=[{'all':!![]}];}return db[_0x58e5('0x49')][_0x58e5('0x4a')](_0x2113a9);})[_0x58e5('0x2e')](function(_0x407c1d){_0x1135cf['rows']=_0x407c1d;return _0x1135cf;})['then'](respondWithFilteredResult(_0x54b000,_0x2113a9))['catch'](handleError(_0x54b000,null));};exports[_0x58e5('0x4b')]=function(_0x224265,_0x51d404){var _0x16f814={'raw':!![],'where':{'id':_0x224265['params']['id']}},_0x58fe73={};_0x58fe73[_0x58e5('0x3b')]=_[_0x58e5('0x3d')](db[_0x58e5('0x49')][_0x58e5('0x37')]);_0x58fe73[_0x58e5('0x3c')]=_[_0x58e5('0x3d')](_0x224265['query']);_0x58fe73[_0x58e5('0x3e')]=_[_0x58e5('0x3f')](_0x58fe73[_0x58e5('0x3b')],_0x58fe73[_0x58e5('0x3c')]);_0x16f814[_0x58e5('0x40')]=_[_0x58e5('0x3f')](_0x58fe73['model'],qs[_0x58e5('0x41')](_0x224265[_0x58e5('0x3c')][_0x58e5('0x41')]));_0x16f814[_0x58e5('0x40')]=_0x16f814[_0x58e5('0x40')]['length']?_0x16f814[_0x58e5('0x40')]:_0x58fe73[_0x58e5('0x3b')];if(_0x224265[_0x58e5('0x3c')][_0x58e5('0x4c')]){_0x16f814[_0x58e5('0x4d')]=[{'all':!![]}];}_0x16f814=_[_0x58e5('0x46')]({},_0x16f814,_0x224265[_0x58e5('0x4e')]);return db[_0x58e5('0x49')][_0x58e5('0x4f')](_0x16f814)[_0x58e5('0x2e')](handleEntityNotFound(_0x51d404,null))['then'](respondWithResult(_0x51d404,null))['catch'](handleError(_0x51d404,null));};exports[_0x58e5('0x50')]=function(_0x25dd8d,_0x2ce562){return db[_0x58e5('0x49')][_0x58e5('0x50')](_0x25dd8d['body'],{})[_0x58e5('0x2e')](function(_0x317b91){var _0xcbdbcf=_0x25dd8d[_0x58e5('0x51')]['get']({'plain':!![]});if(!_0xcbdbcf)throw new Error(_0x58e5('0x52'));if(_0xcbdbcf[_0x58e5('0x53')]===_0x58e5('0x51')){var _0x2273b4=_0x317b91[_0x58e5('0x54')]({'plain':!![]});var _0x5e2a2d='WhatsappQueues';return db['UserProfileSection']['find']({'where':{'name':_0x5e2a2d,'userProfileId':_0xcbdbcf['userProfileId']},'raw':!![]})[_0x58e5('0x2e')](function(_0x327786){if(_0x327786&&_0x327786['autoAssociation']===0x0){return db[_0x58e5('0x31')]['create']({'name':_0x2273b4['name'],'resourceId':_0x2273b4['id'],'type':_0x327786[_0x58e5('0x34')],'sectionId':_0x327786['id']},{})[_0x58e5('0x2e')](function(){return _0x317b91;});}else{return _0x317b91;}})[_0x58e5('0x55')](function(_0xbccc1b){logger[_0x58e5('0x32')](_0x58e5('0x56'),_0xbccc1b);throw _0xbccc1b;});}return _0x317b91;})[_0x58e5('0x2e')](respondWithResult(_0x2ce562,0xc9))[_0x58e5('0x55')](handleError(_0x2ce562,null));};exports[_0x58e5('0x57')]=function(_0xc38391,_0x44aa3a){if(_0xc38391[_0x58e5('0x58')]['id']){delete _0xc38391[_0x58e5('0x58')]['id'];}return db['WhatsappQueue'][_0x58e5('0x4f')]({'where':{'id':_0xc38391['params']['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0x44aa3a,null))[_0x58e5('0x2e')](saveUpdates(_0xc38391[_0x58e5('0x58')],null))[_0x58e5('0x2e')](respondWithResult(_0x44aa3a,null))[_0x58e5('0x55')](handleError(_0x44aa3a,null));};exports[_0x58e5('0x2f')]=function(_0x37d52b,_0xb8bb7c){return db[_0x58e5('0x49')][_0x58e5('0x4f')]({'where':{'id':_0x37d52b[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0xb8bb7c,null))[_0x58e5('0x2e')](removeEntity(_0xb8bb7c,null))[_0x58e5('0x55')](handleError(_0xb8bb7c,null));};exports[_0x58e5('0x5a')]=function(_0x1d39d9,_0x913bea){return db[_0x58e5('0x49')][_0x58e5('0x5a')]()['then'](respondWithResult(_0x913bea,null))[_0x58e5('0x55')](handleError(_0x913bea,null));};exports[_0x58e5('0x5b')]=function(_0x1f8f9b,_0xc1d533,_0xf61752){var _0x33297f={'raw':!![],'where':{}},_0x5a4c3d={},_0x3f1c2d;return db[_0x58e5('0x49')][_0x58e5('0x5c')]({'where':{'id':_0x1f8f9b[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0xc1d533,null))[_0x58e5('0x2e')](function(_0xf83897){if(_0xf83897){_0x3f1c2d=_0xf83897[_0x58e5('0x54')]({'plain':!![]});_0x5a4c3d[_0x58e5('0x3b')]=_['keys'](db[_0x58e5('0x5d')][_0x58e5('0x37')]);_0x5a4c3d[_0x58e5('0x3c')]=_['keys'](_0x1f8f9b[_0x58e5('0x3c')]);_0x5a4c3d[_0x58e5('0x3e')]=_['intersection'](_0x5a4c3d[_0x58e5('0x3b')],_0x5a4c3d[_0x58e5('0x3c')]);_0x33297f[_0x58e5('0x40')]=_[_0x58e5('0x3f')](_0x5a4c3d[_0x58e5('0x3b')],qs[_0x58e5('0x41')](_0x1f8f9b[_0x58e5('0x3c')][_0x58e5('0x41')]));_0x33297f[_0x58e5('0x40')]=_0x33297f[_0x58e5('0x40')]['length']?_0x33297f['attributes']:_0x5a4c3d[_0x58e5('0x3b')];if(!_0x1f8f9b[_0x58e5('0x3c')][_0x58e5('0x5e')]('nolimit')){_0x33297f[_0x58e5('0x25')]=qs[_0x58e5('0x25')](_0x1f8f9b[_0x58e5('0x3c')][_0x58e5('0x25')]);_0x33297f[_0x58e5('0x27')]=qs['offset'](_0x1f8f9b[_0x58e5('0x3c')]['offset']);}_0x33297f[_0x58e5('0x43')]=qs[_0x58e5('0x44')](_0x1f8f9b[_0x58e5('0x3c')][_0x58e5('0x44')]);_0x33297f[_0x58e5('0x45')]=qs['filters'](_[_0x58e5('0x5f')](_0x1f8f9b['query'],_0x5a4c3d['filters']));_0x33297f[_0x58e5('0x45')][_0x58e5('0x60')]=_0xf83897['id'];if(_0x1f8f9b[_0x58e5('0x3c')][_0x58e5('0x48')]){_0x33297f[_0x58e5('0x45')]=_['merge'](_0x33297f[_0x58e5('0x45')],{'$or':_[_0x58e5('0x36')](_0x33297f[_0x58e5('0x40')],function(_0x19bba4){var _0x24f7f9={};_0x24f7f9[_0x19bba4]={'$like':'%'+_0x1f8f9b['query'][_0x58e5('0x48')]+'%'};return _0x24f7f9;})});}_0x33297f=_[_0x58e5('0x46')]({},_0x33297f,_0x1f8f9b[_0x58e5('0x4e')]);return db[_0x58e5('0x5d')]['findAll'](_0x33297f);}})[_0x58e5('0x2e')](function(_0x150ef0){if(_0x150ef0){return db[_0x58e5('0x61')]['findAndCountAll']({'where':{'id':_['map'](_0x150ef0,_0x58e5('0x62')),'role':'agent'},'attributes':['id',_0x58e5('0x34'),_0x58e5('0x63'),_0x58e5('0x64'),_0x58e5('0x65')]});}})[_0x58e5('0x2e')](function(_0x4c1099){if(_0x4c1099){return{'count':_0x4c1099[_0x58e5('0x26')],'rows':_[_0x58e5('0x36')](_0x4c1099[_0x58e5('0x66')],function(_0x1adca5){return{'membername':_0x1adca5[_0x58e5('0x34')],'UserId':_0x1adca5['id'],'queue_name':_0x3f1c2d['name'],'WhatsappQueueId':_0x3f1c2d['id'],'interface':util[_0x58e5('0x67')]('%s/%s',_0x58e5('0x68'),_0x1adca5[_0x58e5('0x34')]),'penalty':0x0,'paused':_0x1adca5[_0x58e5('0x63')],'createdAt':_0x1adca5[_0x58e5('0x65')],'updatedAt':_0x1adca5[_0x58e5('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xc1d533,_0x33297f))[_0x58e5('0x55')](handleError(_0xc1d533,null));};exports['getTeams']=function(_0x22c1d1,_0x481c26,_0x4abcaa){var _0x243bf5={};var _0x16d4c8={};var _0x4a1645;var _0x4e039f;return db[_0x58e5('0x49')][_0x58e5('0x5c')]({'where':{'id':_0x22c1d1[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0x481c26,null))[_0x58e5('0x2e')](function(_0x42fa39){if(_0x42fa39){_0x4a1645=_0x42fa39;_0x16d4c8[_0x58e5('0x3b')]=_[_0x58e5('0x3d')](db[_0x58e5('0x69')][_0x58e5('0x37')]);_0x16d4c8[_0x58e5('0x3c')]=_[_0x58e5('0x3d')](_0x22c1d1[_0x58e5('0x3c')]);_0x16d4c8['filters']=_[_0x58e5('0x3f')](_0x16d4c8['model'],_0x16d4c8[_0x58e5('0x3c')]);_0x243bf5[_0x58e5('0x40')]=_[_0x58e5('0x3f')](_0x16d4c8['model'],qs[_0x58e5('0x41')](_0x22c1d1[_0x58e5('0x3c')][_0x58e5('0x41')]));_0x243bf5[_0x58e5('0x40')]=_0x243bf5[_0x58e5('0x40')][_0x58e5('0x42')]?_0x243bf5[_0x58e5('0x40')]:_0x16d4c8['model'];_0x243bf5['order']=qs['sort'](_0x22c1d1[_0x58e5('0x3c')]['sort']);_0x243bf5[_0x58e5('0x45')]=qs[_0x58e5('0x3e')](_[_0x58e5('0x5f')](_0x22c1d1[_0x58e5('0x3c')],_0x16d4c8['filters']));if(_0x22c1d1[_0x58e5('0x3c')][_0x58e5('0x48')]){_0x243bf5[_0x58e5('0x45')]=_[_0x58e5('0x46')](_0x243bf5[_0x58e5('0x45')],{'$or':_[_0x58e5('0x36')](_0x243bf5[_0x58e5('0x40')],function(_0x5d7956){var _0x3df329={};_0x3df329[_0x5d7956]={'$like':'%'+_0x22c1d1[_0x58e5('0x3c')][_0x58e5('0x48')]+'%'};return _0x3df329;})});}_0x243bf5=_[_0x58e5('0x46')]({},_0x243bf5,_0x22c1d1['options']);return _0x4a1645[_0x58e5('0x6a')](_0x243bf5);}})[_0x58e5('0x2e')](function(_0x194f9a){if(_0x194f9a){_0x4e039f=_0x194f9a[_0x58e5('0x42')];if(!_0x22c1d1[_0x58e5('0x3c')][_0x58e5('0x5e')](_0x58e5('0x6b'))){_0x243bf5['limit']=qs[_0x58e5('0x25')](_0x22c1d1['query'][_0x58e5('0x25')]);_0x243bf5[_0x58e5('0x27')]=qs[_0x58e5('0x27')](_0x22c1d1[_0x58e5('0x3c')]['offset']);}return _0x4a1645[_0x58e5('0x6a')](_0x243bf5);}})[_0x58e5('0x2e')](function(_0x320b41){if(_0x320b41){return _0x320b41?{'count':_0x4e039f,'rows':_0x320b41}:null;}})[_0x58e5('0x2e')](respondWithResult(_0x481c26,null))['catch'](handleError(_0x481c26,null));};exports['addTeams']=function(_0x4904b0,_0x2bd9ff,_0x130a21){var _0x40efdc=_0x4904b0[_0x58e5('0x58')][_0x58e5('0x6c')];return db[_0x58e5('0x69')][_0x58e5('0x4a')]({'where':{'id':_0x40efdc},'attributes':['id'],'include':[{'model':db['User'],'as':_0x58e5('0x6d'),'attributes':['id','name',_0x58e5('0x6e'),_0x58e5('0x6f'),_0x58e5('0x70')],'raw':!![]}]})[_0x58e5('0x2e')](function(_0x495559){if(_0x495559){var _0x1ec458=_[_0x58e5('0x71')](_0x495559,function(_0x427927){var _0x2856c9=_0x427927['get']({'plain':!![]});return _0x2856c9[_0x58e5('0x6d')];});return db[_0x58e5('0x49')][_0x58e5('0x4f')]({'where':{'id':_0x4904b0[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](function(_0x23eeb3){return db['sequelize'][_0x58e5('0x72')](function(_0x4743db){return _0x23eeb3[_0x58e5('0x73')](_0x40efdc,{'transaction':_0x4743db})[_0x58e5('0x2e')](function(){return BPromise[_0x58e5('0x74')](_0x1ec458,function(_0xc245d9){return db[_0x58e5('0x5d')]['findOrCreate']({'where':{'UserId':_0xc245d9['id'],'WhatsappQueueId':_0x4904b0[_0x58e5('0x59')]['id']},'transaction':_0x4743db});});})[_0x58e5('0x2e')](function(){_0x1ec458['forEach'](function(_0x2a8f00){socket[_0x58e5('0x75')]('userWhatsappQueue:save',{'UserId':_0x2a8f00['id'],'WhatsappQueueId':_0x23eeb3['id']});});});});});}})[_0x58e5('0x2e')](respondWithStatusCode(_0x2bd9ff,null))['catch'](handleError(_0x2bd9ff,null));};exports[_0x58e5('0x76')]=function(_0x353474,_0xd730fb,_0x10e8ed){return db[_0x58e5('0x69')][_0x58e5('0x4a')]({'where':{'id':_0x353474[_0x58e5('0x3c')][_0x58e5('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x58e5('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x58e5('0x2e')](handleEntityNotFound(_0xd730fb,null))['then'](function(_0x595bd6){var _0xfcf810=_[_0x58e5('0x36')](_0x595bd6,'id');var _0xe4cadf=[];var _0x2de1d6=[];var _0x4997c0=squel[_0x58e5('0x77')]();_0x4997c0[_0x58e5('0x78')](_0x58e5('0x79'))[_0x58e5('0x7a')](_0x58e5('0x7b'),'tq')[_0x58e5('0x7c')](_0x58e5('0x7d'),'ut',_0x58e5('0x7e'))[_0x58e5('0x45')](_0x58e5('0x7f'),_0x353474[_0x58e5('0x59')]['id']);for(var _0x39ca44=0x0;_0x39ca44<_0x595bd6[_0x58e5('0x42')];_0x39ca44+=0x1){let _0x3e1f06=_0x595bd6[_0x39ca44];for(var _0x1984e0=0x0;_0x1984e0<_0x3e1f06[_0x58e5('0x6d')][_0x58e5('0x42')];_0x1984e0+=0x1){let _0x554c4b=_0x3e1f06[_0x58e5('0x6d')][_0x1984e0];var _0x1776d3=_0x4997c0[_0x58e5('0x80')]();_0x1776d3['where']('ut.UserId\x20=\x20?',_0x554c4b['id']);_0x2de1d6[_0x58e5('0x81')](db[_0x58e5('0x82')][_0x58e5('0x3c')](_0x1776d3[_0x58e5('0x83')](),{'type':db[_0x58e5('0x82')][_0x58e5('0x84')][_0x58e5('0x85')]})[_0x58e5('0x2e')](function(_0x5e7ef6){if(_0x5e7ef6[_0x58e5('0x42')]===0x1){return _0x554c4b['id'];}else{var _0x1feb31=_[_0x58e5('0x86')](_[_0x58e5('0x36')](_0x5e7ef6,_0x58e5('0x87')),function(_0x3a07e1){return _[_0x58e5('0x88')](_0xfcf810,_0x3a07e1);});if(_0x1feb31){return _0x554c4b['id'];}}}));}}return BPromise[_0x58e5('0x89')](_0x2de1d6)[_0x58e5('0x2e')](function(_0x17761f){_0xe4cadf=_(_0xe4cadf)[_0x58e5('0x8a')](_0x17761f)['compact']()[_0x58e5('0x8b')]();return db[_0x58e5('0x49')][_0x58e5('0x4f')]({'where':{'id':_0x353474[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](function(_0x4d322a){return db[_0x58e5('0x82')][_0x58e5('0x72')](function(_0x4e86fb){return _0x4d322a[_0x58e5('0x76')](_0x353474[_0x58e5('0x3c')][_0x58e5('0x6c')],{'transaction':_0x4e86fb})[_0x58e5('0x2e')](function(){if(!_['isEmpty'](_0xe4cadf)){return _0x4d322a[_0x58e5('0x8c')](_0xe4cadf,{'transaction':_0x4e86fb});}})[_0x58e5('0x2e')](function(){_0xe4cadf[_0x58e5('0x8d')](function(_0x59875e){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x59875e,'WhatsappQueueId':_0x4d322a['id']});});});});});});})[_0x58e5('0x2e')](respondWithStatusCode(_0xd730fb,null))['catch'](handleError(_0xd730fb,null));};exports['addAgents']=function(_0x55e170,_0x3a2280,_0x2e9a68){return db[_0x58e5('0x49')][_0x58e5('0x4f')]({'where':{'id':_0x55e170[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0x3a2280,null))['then'](function(_0x52d9b5){if(_0x52d9b5){return _0x52d9b5['addAgents'](_0x55e170[_0x58e5('0x58')][_0x58e5('0x6c')],_[_0x58e5('0x8e')](_0x55e170['body'],[_0x58e5('0x6c'),'id'])||{})['spread'](function(_0xace303){for(var _0x7a4471=0x0;_0x7a4471<_0x55e170[_0x58e5('0x58')][_0x58e5('0x6c')][_0x58e5('0x42')];_0x7a4471+=0x1){socket[_0x58e5('0x75')](_0x58e5('0x8f'),{'UserId':Number(_0x55e170[_0x58e5('0x58')][_0x58e5('0x6c')][_0x7a4471]),'WhatsappQueueId':Number(_0x55e170[_0x58e5('0x59')]['id'])});}return _0xace303;});}})[_0x58e5('0x2e')](respondWithResult(_0x3a2280,null))[_0x58e5('0x55')](handleError(_0x3a2280,null));};exports[_0x58e5('0x8c')]=function(_0x1282e0,_0x611316,_0x5178e6){return db[_0x58e5('0x49')][_0x58e5('0x4f')]({'where':{'id':_0x1282e0[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0x611316,null))[_0x58e5('0x2e')](function(_0x4dc1c3){if(_0x4dc1c3){return _0x4dc1c3[_0x58e5('0x8c')](_0x1282e0[_0x58e5('0x3c')][_0x58e5('0x6c')])[_0x58e5('0x2e')](function(){if(_['isArray'](_0x1282e0[_0x58e5('0x3c')][_0x58e5('0x6c')])){for(var _0x1c0cf0=0x0;_0x1c0cf0<_0x1282e0[_0x58e5('0x3c')][_0x58e5('0x6c')][_0x58e5('0x42')];_0x1c0cf0+=0x1){socket[_0x58e5('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x1282e0[_0x58e5('0x3c')]['ids'][_0x1c0cf0]),'WhatsappQueueId':Number(_0x1282e0[_0x58e5('0x59')]['id'])});}}else{socket[_0x58e5('0x75')](_0x58e5('0x90'),{'UserId':Number(_0x1282e0[_0x58e5('0x3c')][_0x58e5('0x6c')]),'WhatsappQueueId':Number(_0x1282e0[_0x58e5('0x59')]['id'])});}});}})[_0x58e5('0x2e')](respondWithStatusCode(_0x611316,null))[_0x58e5('0x55')](handleError(_0x611316,null));};exports['getAgents']=function(_0x5c232a,_0xcf9ea0,_0x50c11c){var _0x5e5d52={};var _0x260d5f={};var _0x4bf0bd;var _0x41597a;return db[_0x58e5('0x49')]['findOne']({'where':{'id':_0x5c232a[_0x58e5('0x59')]['id']}})[_0x58e5('0x2e')](handleEntityNotFound(_0xcf9ea0,null))[_0x58e5('0x2e')](function(_0x25e7b9){if(_0x25e7b9){_0x4bf0bd=_0x25e7b9;_0x260d5f[_0x58e5('0x3b')]=_[_0x58e5('0x3d')](db[_0x58e5('0x61')][_0x58e5('0x37')]);_0x260d5f[_0x58e5('0x3c')]=_['keys'](_0x5c232a['query']);_0x260d5f[_0x58e5('0x3e')]=_[_0x58e5('0x3f')](_0x260d5f[_0x58e5('0x3b')],_0x260d5f['query']);_0x5e5d52['attributes']=_['intersection'](_0x260d5f[_0x58e5('0x3b')],qs[_0x58e5('0x41')](_0x5c232a[_0x58e5('0x3c')][_0x58e5('0x41')]));_0x5e5d52[_0x58e5('0x40')]=_0x5e5d52['attributes'][_0x58e5('0x42')]?_0x5e5d52[_0x58e5('0x40')]:_0x260d5f['model'];_0x5e5d52['order']=qs['sort'](_0x5c232a[_0x58e5('0x3c')]['sort']);_0x5e5d52[_0x58e5('0x45')]=qs[_0x58e5('0x3e')](_[_0x58e5('0x5f')](_0x5c232a['query'],_0x260d5f[_0x58e5('0x3e')]));if(_0x5c232a[_0x58e5('0x3c')][_0x58e5('0x48')]){_0x5e5d52[_0x58e5('0x45')]=_[_0x58e5('0x46')](_0x5e5d52[_0x58e5('0x45')],{'$or':_[_0x58e5('0x36')](_0x5e5d52[_0x58e5('0x40')],function(_0x394b2a){var _0x44320b={};_0x44320b[_0x394b2a]={'$like':'%'+_0x5c232a['query'][_0x58e5('0x48')]+'%'};return _0x44320b;})});}_0x5e5d52=_[_0x58e5('0x46')]({},_0x5e5d52,_0x5c232a[_0x58e5('0x4e')]);return _0x4bf0bd[_0x58e5('0x91')](_0x5e5d52);}})[_0x58e5('0x2e')](function(_0x52c0bd){if(_0x52c0bd){_0x41597a=_0x52c0bd[_0x58e5('0x42')];if(!_0x5c232a[_0x58e5('0x3c')]['hasOwnProperty'](_0x58e5('0x6b'))){_0x5e5d52[_0x58e5('0x25')]=qs[_0x58e5('0x25')](_0x5c232a[_0x58e5('0x3c')]['limit']);_0x5e5d52[_0x58e5('0x27')]=qs['offset'](_0x5c232a[_0x58e5('0x3c')][_0x58e5('0x27')]);}return _0x4bf0bd[_0x58e5('0x91')](_0x5e5d52);}})[_0x58e5('0x2e')](function(_0x2be29e){if(_0x2be29e){return _0x2be29e?{'count':_0x41597a,'rows':_0x2be29e}:null;}})[_0x58e5('0x2e')](respondWithResult(_0xcf9ea0,null))[_0x58e5('0x55')](handleError(_0xcf9ea0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 31ac0f1..348a1b1 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 _0x2669=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x4ee070,_0x516047){var _0x5a87e4=function(_0x4e8db3){while(--_0x4e8db3){_0x4ee070['push'](_0x4ee070['shift']());}};_0x5a87e4(++_0x516047);}(_0x2669,0x1c7));var _0x9266=function(_0xa15f62,_0x426b90){_0xa15f62=_0xa15f62-0x0;var _0x5f20c9=_0x2669[_0xa15f62];return _0x5f20c9;};'use strict';var EventEmitter=require(_0x9266('0x0'));var WhatsappQueue=require(_0x9266('0x1'))['db'][_0x9266('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9266('0x3')](0x0);var events={'afterCreate':_0x9266('0x4'),'afterUpdate':_0x9266('0x5'),'afterDestroy':_0x9266('0x6')};function emitEvent(_0x39cee2){return function(_0x2a5b2d,_0x677cc0,_0x71ca4a){WhatsappQueueEvents[_0x9266('0x7')](_0x39cee2+':'+_0x2a5b2d['id'],_0x2a5b2d);WhatsappQueueEvents[_0x9266('0x7')](_0x39cee2,_0x2a5b2d);_0x71ca4a(null);};}for(var e in events){if(events[_0x9266('0x8')](e)){var event=events[e];WhatsappQueue[_0x9266('0x9')](e,emitEvent(event));}}module[_0x9266('0xa')]=WhatsappQueueEvents; \ No newline at end of file +var _0x7b3f=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b3f,0xea));var _0xf7b3=function(_0x401ffe,_0xed1806){_0x401ffe=_0x401ffe-0x0;var _0x4d29ad=_0x7b3f[_0x401ffe];return _0x4d29ad;};'use strict';var EventEmitter=require(_0xf7b3('0x0'));var WhatsappQueue=require(_0xf7b3('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf7b3('0x2')](0x0);var events={'afterCreate':_0xf7b3('0x3'),'afterUpdate':_0xf7b3('0x4'),'afterDestroy':_0xf7b3('0x5')};function emitEvent(_0x486752){return function(_0x1f2142,_0x450675,_0xb95b9d){WhatsappQueueEvents[_0xf7b3('0x6')](_0x486752+':'+_0x1f2142['id'],_0x1f2142);WhatsappQueueEvents[_0xf7b3('0x6')](_0x486752,_0x1f2142);_0xb95b9d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xf7b3('0x7')](e,emitEvent(event));}}module[_0xf7b3('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 71a7c64..6923203 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 _0xf0c5=['./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d3905,_0x561ef9){var _0x3e462f=function(_0x13c1b4){while(--_0x13c1b4){_0x5d3905['push'](_0x5d3905['shift']());}};_0x3e462f(++_0x561ef9);}(_0xf0c5,0xdc));var _0x5f0c=function(_0x2d0854,_0x4c5b12){_0x2d0854=_0x2d0854-0x0;var _0x287c91=_0xf0c5[_0x2d0854];return _0x287c91;};'use strict';var _=require(_0x5f0c('0x0'));var util=require('util');var logger=require(_0x5f0c('0x1'))('api');var moment=require(_0x5f0c('0x2'));var BPromise=require(_0x5f0c('0x3'));var rp=require(_0x5f0c('0x4'));var fs=require('fs');var path=require(_0x5f0c('0x5'));var rimraf=require(_0x5f0c('0x6'));var config=require(_0x5f0c('0x7'));var attributes=require(_0x5f0c('0x8'));module[_0x5f0c('0x9')]=function(_0x3ca845,_0x356985){return _0x3ca845['define'](_0x5f0c('0xa'),attributes,{'tableName':_0x5f0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03b9=['request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','define','whatsapp_queues','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x03b9,0x180));var _0x903b=function(_0x46efef,_0x19e4d8){_0x46efef=_0x46efef-0x0;var _0x3cd91b=_0x03b9[_0x46efef];return _0x3cd91b;};'use strict';var _=require('lodash');var util=require(_0x903b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x903b('0x1'));var BPromise=require(_0x903b('0x2'));var rp=require(_0x903b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x903b('0x4'));var config=require(_0x903b('0x5'));var attributes=require(_0x903b('0x6'));module['exports']=function(_0x3ee9b2,_0x15a27d){return _0x3ee9b2[_0x903b('0x7')]('WhatsappQueue',attributes,{'tableName':_0x903b('0x8'),'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 3eb93bc..88bac44 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 _0x2be6=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowWhatsappQueue','lodash','moment','randomstring','ioredis'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x2be6,0x149));var _0x62be=function(_0x3f3035,_0x279b16){_0x3f3035=_0x3f3035-0x0;var _0x2f7af1=_0x2be6[_0x3f3035];return _0x2f7af1;};'use strict';var _=require(_0x62be('0x0'));var util=require('util');var moment=require(_0x62be('0x1'));var BPromise=require('bluebird');var rs=require(_0x62be('0x2'));var fs=require('fs');var Redis=require(_0x62be('0x3'));var db=require(_0x62be('0x4'))['db'];var utils=require(_0x62be('0x5'));var logger=require('../../config/logger')(_0x62be('0x6'));var config=require('../../config/environment');var jayson=require(_0x62be('0x7'));var client=jayson[_0x62be('0x8')]['http']({'port':0x232a});config[_0x62be('0x9')]=_[_0x62be('0xa')](config[_0x62be('0x9')],{'host':_0x62be('0xb'),'port':0x18eb});var socket=require(_0x62be('0xc'))(new Redis(config[_0x62be('0x9')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x421b97,_0x45e1af,_0x325738){return new BPromise(function(_0x54872b,_0x58d000){return client[_0x62be('0xd')](_0x421b97,_0x325738)[_0x62be('0xe')](function(_0x583a06){logger[_0x62be('0xf')](_0x62be('0x10'),_0x45e1af,_0x62be('0x11'));logger[_0x62be('0x12')](_0x62be('0x13'),_0x45e1af,_0x62be('0x11'),JSON[_0x62be('0x14')](_0x583a06));if(_0x583a06[_0x62be('0x15')]){if(_0x583a06[_0x62be('0x15')][_0x62be('0x16')]===0x1f4){logger[_0x62be('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x45e1af,_0x583a06[_0x62be('0x15')][_0x62be('0x17')]);return _0x58d000(_0x583a06['error'][_0x62be('0x17')]);}logger[_0x62be('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x45e1af,_0x583a06[_0x62be('0x15')][_0x62be('0x17')]);return _0x54872b(_0x583a06[_0x62be('0x15')][_0x62be('0x17')]);}else{logger[_0x62be('0xf')](_0x62be('0x10'),_0x45e1af,_0x62be('0x11'));_0x54872b(_0x583a06['result'][_0x62be('0x17')]);}})['catch'](function(_0xc46a88){logger[_0x62be('0x15')](_0x62be('0x10'),_0x45e1af,_0xc46a88);_0x58d000(_0xc46a88);});});}exports[_0x62be('0x18')]=function(_0x2f6a4a){var _0x1632d2=this;return new Promise(function(_0x229e2b,_0x1a1107){return db[_0x62be('0x19')][_0x62be('0x1a')]({'raw':_0x2f6a4a[_0x62be('0x1b')]?_0x2f6a4a[_0x62be('0x1b')][_0x62be('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f6a4a['options']?_0x2f6a4a[_0x62be('0x1b')][_0x62be('0x1d')]||null:null,'attributes':_0x2f6a4a[_0x62be('0x1b')]?_0x2f6a4a[_0x62be('0x1b')][_0x62be('0x1e')]||null:null,'limit':_0x2f6a4a[_0x62be('0x1b')]?_0x2f6a4a[_0x62be('0x1b')][_0x62be('0x1f')]||null:null,'include':_0x2f6a4a[_0x62be('0x1b')]?_0x2f6a4a[_0x62be('0x1b')][_0x62be('0x20')]?_[_0x62be('0x21')](_0x2f6a4a[_0x62be('0x1b')]['include'],function(_0x5c994b){return{'model':db[_0x5c994b[_0x62be('0x22')]],'as':_0x5c994b['as'],'attributes':_0x5c994b[_0x62be('0x1e')],'include':_0x5c994b[_0x62be('0x20')]?_['map'](_0x5c994b['include'],function(_0x24a448){return{'model':db[_0x24a448[_0x62be('0x22')]],'as':_0x24a448['as'],'attributes':_0x24a448[_0x62be('0x1e')],'include':_0x24a448[_0x62be('0x20')]?_[_0x62be('0x21')](_0x24a448[_0x62be('0x20')],function(_0x103240){return{'model':db[_0x103240[_0x62be('0x22')]],'as':_0x103240['as'],'attributes':_0x103240['attributes']};}):[]};}):[]};}):[]:[]})[_0x62be('0xe')](function(_0x56e0ad){logger[_0x62be('0xf')](_0x62be('0x18'),_0x2f6a4a);logger[_0x62be('0x12')]('GetWhatsappQueue',_0x2f6a4a,JSON['stringify'](_0x56e0ad));_0x229e2b(_0x56e0ad);})[_0x62be('0x23')](function(_0x127ef6){logger[_0x62be('0x15')](_0x62be('0x18'),_0x127ef6['message'],_0x2f6a4a);_0x1a1107(_0x1632d2['error'](0x1f4,_0x127ef6['message']));});});};exports[_0x62be('0x24')]=function(_0x3e1e79){var _0x4310cd=this;return new Promise(function(_0x5ca08f,_0x34511c){return db['WhatsappQueue']['find']({'raw':_0x3e1e79[_0x62be('0x1b')]?_0x3e1e79['options'][_0x62be('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e1e79[_0x62be('0x1b')]?_0x3e1e79[_0x62be('0x1b')][_0x62be('0x1d')]||null:null,'attributes':_0x3e1e79[_0x62be('0x1b')]?_0x3e1e79[_0x62be('0x1b')]['attributes']||null:null,'include':_0x3e1e79[_0x62be('0x1b')]?_0x3e1e79[_0x62be('0x1b')]['include']?_['map'](_0x3e1e79[_0x62be('0x1b')][_0x62be('0x20')],function(_0x2ca0e5){return{'model':db[_0x2ca0e5[_0x62be('0x22')]],'as':_0x2ca0e5['as'],'attributes':_0x2ca0e5[_0x62be('0x1e')],'include':_0x2ca0e5[_0x62be('0x20')]?_[_0x62be('0x21')](_0x2ca0e5[_0x62be('0x20')],function(_0x1e9cb7){return{'model':db[_0x1e9cb7[_0x62be('0x22')]],'as':_0x1e9cb7['as'],'attributes':_0x1e9cb7[_0x62be('0x1e')],'include':_0x1e9cb7[_0x62be('0x20')]?_['map'](_0x1e9cb7['include'],function(_0x2e07fe){return{'model':db[_0x2e07fe[_0x62be('0x22')]],'as':_0x2e07fe['as'],'attributes':_0x2e07fe[_0x62be('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x62be('0xe')](function(_0x51bc9d){logger['info'](_0x62be('0x24'),_0x3e1e79);logger[_0x62be('0x12')](_0x62be('0x24'),_0x3e1e79,JSON[_0x62be('0x14')](_0x51bc9d));_0x5ca08f(_0x51bc9d);})[_0x62be('0x23')](function(_0x5418a3){logger['error']('ShowWhatsappQueue',_0x5418a3[_0x62be('0x17')],_0x3e1e79);_0x34511c(_0x4310cd[_0x62be('0x15')](0x1f4,_0x5418a3[_0x62be('0x17')]));});});}; \ No newline at end of file +var _0x8704=['defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','attributes','ShowWhatsappQueue','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x1a33dc,_0x18b19f){var _0x57ef59=function(_0x420401){while(--_0x420401){_0x1a33dc['push'](_0x1a33dc['shift']());}};_0x57ef59(++_0x18b19f);}(_0x8704,0x134));var _0x4870=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x8704[_0x32b30c];return _0xcfc212;};'use strict';var _=require('lodash');var util=require(_0x4870('0x0'));var moment=require(_0x4870('0x1'));var BPromise=require(_0x4870('0x2'));var rs=require(_0x4870('0x3'));var fs=require('fs');var Redis=require(_0x4870('0x4'));var db=require(_0x4870('0x5'))['db'];var utils=require(_0x4870('0x6'));var logger=require(_0x4870('0x7'))('rpc');var config=require(_0x4870('0x8'));var jayson=require(_0x4870('0x9'));var client=jayson['client'][_0x4870('0xa')]({'port':0x232a});config[_0x4870('0xb')]=_[_0x4870('0xc')](config['redis'],{'host':_0x4870('0xd'),'port':0x18eb});var socket=require(_0x4870('0xe'))(new Redis(config[_0x4870('0xb')]));require(_0x4870('0xf'))['register'](socket);function respondWithRpcPromise(_0x717a92,_0x20a326,_0x49d219){return new BPromise(function(_0x3a00f9,_0x1f498d){return client[_0x4870('0x10')](_0x717a92,_0x49d219)[_0x4870('0x11')](function(_0x180568){logger[_0x4870('0x12')](_0x4870('0x13'),_0x20a326,_0x4870('0x14'));logger[_0x4870('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x20a326,'request\x20sent',JSON[_0x4870('0x16')](_0x180568));if(_0x180568[_0x4870('0x17')]){if(_0x180568['error'][_0x4870('0x18')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x20a326,_0x180568[_0x4870('0x17')][_0x4870('0x19')]);return _0x1f498d(_0x180568[_0x4870('0x17')]['message']);}logger['error'](_0x4870('0x13'),_0x20a326,_0x180568[_0x4870('0x17')]['message']);return _0x3a00f9(_0x180568['error']['message']);}else{logger[_0x4870('0x12')](_0x4870('0x13'),_0x20a326,_0x4870('0x14'));_0x3a00f9(_0x180568[_0x4870('0x1a')][_0x4870('0x19')]);}})[_0x4870('0x1b')](function(_0x5ab7ce){logger[_0x4870('0x17')](_0x4870('0x13'),_0x20a326,_0x5ab7ce);_0x1f498d(_0x5ab7ce);});});}exports[_0x4870('0x1c')]=function(_0x436263){var _0x600006=this;return new Promise(function(_0x58c2fd,_0x163060){return db[_0x4870('0x1d')][_0x4870('0x1e')]({'raw':_0x436263[_0x4870('0x1f')]?_0x436263[_0x4870('0x1f')][_0x4870('0x20')]===undefined?!![]:![]:!![],'where':_0x436263[_0x4870('0x1f')]?_0x436263[_0x4870('0x1f')][_0x4870('0x21')]||null:null,'attributes':_0x436263[_0x4870('0x1f')]?_0x436263[_0x4870('0x1f')]['attributes']||null:null,'limit':_0x436263[_0x4870('0x1f')]?_0x436263[_0x4870('0x1f')][_0x4870('0x22')]||null:null,'include':_0x436263[_0x4870('0x1f')]?_0x436263[_0x4870('0x1f')][_0x4870('0x23')]?_[_0x4870('0x24')](_0x436263['options']['include'],function(_0x1acd05){return{'model':db[_0x1acd05['model']],'as':_0x1acd05['as'],'attributes':_0x1acd05[_0x4870('0x25')],'include':_0x1acd05[_0x4870('0x23')]?_[_0x4870('0x24')](_0x1acd05['include'],function(_0x51669d){return{'model':db[_0x51669d['model']],'as':_0x51669d['as'],'attributes':_0x51669d[_0x4870('0x25')],'include':_0x51669d[_0x4870('0x23')]?_[_0x4870('0x24')](_0x51669d[_0x4870('0x23')],function(_0xfbce4a){return{'model':db[_0xfbce4a['model']],'as':_0xfbce4a['as'],'attributes':_0xfbce4a[_0x4870('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4870('0x11')](function(_0x4cb5c4){logger['info'](_0x4870('0x1c'),_0x436263);logger['debug'](_0x4870('0x1c'),_0x436263,JSON[_0x4870('0x16')](_0x4cb5c4));_0x58c2fd(_0x4cb5c4);})['catch'](function(_0x3be9a6){logger[_0x4870('0x17')]('GetWhatsappQueue',_0x3be9a6[_0x4870('0x19')],_0x436263);_0x163060(_0x600006[_0x4870('0x17')](0x1f4,_0x3be9a6[_0x4870('0x19')]));});});};exports[_0x4870('0x26')]=function(_0x30b304){var _0x588f96=this;return new Promise(function(_0x7bcf0f,_0x14e451){return db[_0x4870('0x1d')]['find']({'raw':_0x30b304[_0x4870('0x1f')]?_0x30b304[_0x4870('0x1f')][_0x4870('0x20')]===undefined?!![]:![]:!![],'where':_0x30b304[_0x4870('0x1f')]?_0x30b304[_0x4870('0x1f')]['where']||null:null,'attributes':_0x30b304[_0x4870('0x1f')]?_0x30b304[_0x4870('0x1f')][_0x4870('0x25')]||null:null,'include':_0x30b304[_0x4870('0x1f')]?_0x30b304[_0x4870('0x1f')][_0x4870('0x23')]?_[_0x4870('0x24')](_0x30b304[_0x4870('0x1f')][_0x4870('0x23')],function(_0x1dc679){return{'model':db[_0x1dc679['model']],'as':_0x1dc679['as'],'attributes':_0x1dc679[_0x4870('0x25')],'include':_0x1dc679[_0x4870('0x23')]?_['map'](_0x1dc679[_0x4870('0x23')],function(_0x5475ba){return{'model':db[_0x5475ba[_0x4870('0x27')]],'as':_0x5475ba['as'],'attributes':_0x5475ba[_0x4870('0x25')],'include':_0x5475ba[_0x4870('0x23')]?_['map'](_0x5475ba[_0x4870('0x23')],function(_0x46c417){return{'model':db[_0x46c417[_0x4870('0x27')]],'as':_0x46c417['as'],'attributes':_0x46c417[_0x4870('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4870('0x11')](function(_0x5bc89a){logger['info'](_0x4870('0x26'),_0x30b304);logger[_0x4870('0x15')](_0x4870('0x26'),_0x30b304,JSON[_0x4870('0x16')](_0x5bc89a));_0x7bcf0f(_0x5bc89a);})['catch'](function(_0x533807){logger[_0x4870('0x17')](_0x4870('0x26'),_0x533807['message'],_0x30b304);_0x14e451(_0x588f96[_0x4870('0x17')](0x1f4,_0x533807['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index abb1d6d..64e11a2 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 _0x1eab=['removeListener','length','whatsappQueue:','./whatsappQueue.events','remove','emit'];(function(_0xb75de0,_0x1e6d9b){var _0x458484=function(_0x36d41a){while(--_0x36d41a){_0xb75de0['push'](_0xb75de0['shift']());}};_0x458484(++_0x1e6d9b);}(_0x1eab,0xed));var _0xb1ea=function(_0x82c6ba,_0x196648){_0x82c6ba=_0x82c6ba-0x0;var _0x37a8e0=_0x1eab[_0x82c6ba];return _0x37a8e0;};'use strict';var WhatsappQueueEvents=require(_0xb1ea('0x0'));var events=['save',_0xb1ea('0x1'),'update'];function createListener(_0x414575,_0x3a8024){return function(_0x522cb5){_0x3a8024[_0xb1ea('0x2')](_0x414575,_0x522cb5);};}function removeListener(_0xcf10a,_0x516864){return function(){WhatsappQueueEvents[_0xb1ea('0x3')](_0xcf10a,_0x516864);};}exports['register']=function(_0x31440c){for(var _0x6fa719=0x0,_0x379f4a=events[_0xb1ea('0x4')];_0x6fa719<_0x379f4a;_0x6fa719++){var _0x36aae2=events[_0x6fa719];var _0x285ce3=createListener(_0xb1ea('0x5')+_0x36aae2,_0x31440c);WhatsappQueueEvents['on'](_0x36aae2,_0x285ce3);}}; \ No newline at end of file +var _0x19df=['emit','length','./whatsappQueue.events','remove','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x19df,0x1e2));var _0xf19d=function(_0x13b70f,_0x5c1116){_0x13b70f=_0x13b70f-0x0;var _0x51427c=_0x19df[_0x13b70f];return _0x51427c;};'use strict';var WhatsappQueueEvents=require(_0xf19d('0x0'));var events=['save',_0xf19d('0x1'),_0xf19d('0x2')];function createListener(_0x13b5b7,_0x477b80){return function(_0xe35165){_0x477b80[_0xf19d('0x3')](_0x13b5b7,_0xe35165);};}function removeListener(_0x9fbbdb,_0x113a5d){return function(){WhatsappQueueEvents['removeListener'](_0x9fbbdb,_0x113a5d);};}exports['register']=function(_0x7839c0){for(var _0x49f10c=0x0,_0x2a14d8=events[_0xf19d('0x4')];_0x49f10c<_0x2a14d8;_0x49f10c++){var _0x18f44f=events[_0x49f10c];var _0x76210d=createListener('whatsappQueue:'+_0x18f44f,_0x7839c0);WhatsappQueueEvents['on'](_0x18f44f,_0x76210d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 50b9066..aed2585 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 _0x1599=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','util'];(function(_0x1a28ae,_0x22cedd){var _0x3a6d12=function(_0x4a2acb){while(--_0x4a2acb){_0x1a28ae['push'](_0x1a28ae['shift']());}};_0x3a6d12(++_0x22cedd);}(_0x1599,0x1a3));var _0x9159=function(_0x18f95d,_0x3602bd){_0x18f95d=_0x18f95d-0x0;var _0x30850a=_0x1599[_0x18f95d];return _0x30850a;};'use strict';var multer=require('multer');var util=require(_0x9159('0x0'));var path=require('path');var timeout=require(_0x9159('0x1'));var express=require(_0x9159('0x2'));var router=express[_0x9159('0x3')]();var fs_extra=require(_0x9159('0x4'));var auth=require(_0x9159('0x5'));var interaction=require(_0x9159('0x6'));var config=require(_0x9159('0x7'));var controller=require(_0x9159('0x8'));router[_0x9159('0x9')]('/',auth[_0x9159('0xa')](),controller[_0x9159('0xb')]);router[_0x9159('0x9')](_0x9159('0xc'),auth[_0x9159('0xa')](),controller['describe']);router[_0x9159('0x9')](_0x9159('0xd'),auth[_0x9159('0xa')](),controller[_0x9159('0xe')]);router['post']('/',auth[_0x9159('0xa')](),controller[_0x9159('0xf')]);router['put'](_0x9159('0xd'),auth['isAuthenticated'](),controller[_0x9159('0x10')]);router[_0x9159('0x11')](_0x9159('0xd'),auth['isAuthenticated'](),controller[_0x9159('0x12')]);module[_0x9159('0x13')]=router; \ No newline at end of file +var _0xd5e3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x306eea,_0x4dda74){var _0x3e39b8=function(_0x28c2b5){while(--_0x28c2b5){_0x306eea['push'](_0x306eea['shift']());}};_0x3e39b8(++_0x4dda74);}(_0xd5e3,0x70));var _0x3d5e=function(_0x19f8e7,_0x455fab){_0x19f8e7=_0x19f8e7-0x0;var _0x4938eb=_0xd5e3[_0x19f8e7];return _0x4938eb;};'use strict';var multer=require(_0x3d5e('0x0'));var util=require(_0x3d5e('0x1'));var path=require('path');var timeout=require(_0x3d5e('0x2'));var express=require(_0x3d5e('0x3'));var router=express[_0x3d5e('0x4')]();var fs_extra=require(_0x3d5e('0x5'));var auth=require(_0x3d5e('0x6'));var interaction=require(_0x3d5e('0x7'));var config=require(_0x3d5e('0x8'));var controller=require(_0x3d5e('0x9'));router['get']('/',auth[_0x3d5e('0xa')](),controller[_0x3d5e('0xb')]);router[_0x3d5e('0xc')](_0x3d5e('0xd'),auth[_0x3d5e('0xa')](),controller[_0x3d5e('0xe')]);router[_0x3d5e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x3d5e('0xf')]);router['post']('/',auth[_0x3d5e('0xa')](),controller[_0x3d5e('0x10')]);router[_0x3d5e('0x11')](_0x3d5e('0x12'),auth[_0x3d5e('0xa')](),controller[_0x3d5e('0x13')]);router[_0x3d5e('0x14')]('/:id',auth[_0x3d5e('0xa')](),controller[_0x3d5e('0x15')]);module[_0x3d5e('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a2c54b6..ece8706 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x1e4a5d,_0x2e3725){var _0x43c741=function(_0x4b2acc){while(--_0x4b2acc){_0x1e4a5d['push'](_0x1e4a5d['shift']());}};_0x43c741(++_0x2e3725);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x6c6b74,_0x3d7343){var _0x5312f7=function(_0x469d03){while(--_0x469d03){_0x6c6b74['push'](_0x6c6b74['shift']());}};_0x5312f7(++_0x3d7343);}(_0x7a54,0x106));var _0x47a5=function(_0x33d7b9,_0x179f2a){_0x33d7b9=_0x33d7b9-0x0;var _0x14b107=_0x7a54[_0x33d7b9];return _0x14b107;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index aff4e61..b8ab340 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 _0x3266=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model'];(function(_0x234144,_0x2bbfca){var _0x44cf1d=function(_0x21afbf){while(--_0x21afbf){_0x234144['push'](_0x234144['shift']());}};_0x44cf1d(++_0x2bbfca);}(_0x3266,0x6a));var _0x6326=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x3266[_0x51c819];return _0x15c5d2;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){_0x429bb0[_0x6326('0x1d')](0xcc)[_0x6326('0x27')]();});}};}function handleEntityNotFound(_0x575701,_0x4e272b){return function(_0x4d28fd){if(!_0x4d28fd){_0x575701[_0x6326('0x1c')](0x194);}return _0x4d28fd;};}function handleError(_0x4dae28,_0x33c466){_0x33c466=_0x33c466||0x1f4;return function(_0x1a48da){logger['error'](_0x1a48da[_0x6326('0x28')]);if(_0x1a48da[_0x6326('0x29')]){delete _0x1a48da[_0x6326('0x29')];}_0x4dae28[_0x6326('0x1d')](_0x33c466)[_0x6326('0x2a')](_0x1a48da);};}exports[_0x6326('0x2b')]=function(_0x40e036,_0x27802c){var _0x461e0f={},_0x127744={},_0x4980f6={'count':0x0,'rows':[]};var _0x2a8873=_[_0x6326('0x2c')](db[_0x6326('0x2d')][_0x6326('0x2e')],function(_0x20c5ab){return{'name':_0x20c5ab['fieldName'],'type':_0x20c5ab[_0x6326('0x2f')][_0x6326('0x30')]};});_0x127744[_0x6326('0x31')]=_['map'](_0x2a8873,_0x6326('0x29'));_0x127744['query']=_['keys'](_0x40e036[_0x6326('0x32')]);_0x127744[_0x6326('0x33')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],_0x127744[_0x6326('0x32')]);_0x461e0f[_0x6326('0x35')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],qs[_0x6326('0x36')](_0x40e036[_0x6326('0x32')][_0x6326('0x36')]));_0x461e0f[_0x6326('0x35')]=_0x461e0f['attributes'][_0x6326('0x37')]?_0x461e0f[_0x6326('0x35')]:_0x127744['model'];if(!_0x40e036[_0x6326('0x32')][_0x6326('0x38')](_0x6326('0x39'))){_0x461e0f['limit']=qs[_0x6326('0x3a')](_0x40e036['query']['limit']);_0x461e0f[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x40e036[_0x6326('0x32')]['offset']);}_0x461e0f[_0x6326('0x3b')]=qs['sort'](_0x40e036[_0x6326('0x32')]['sort']);_0x461e0f[_0x6326('0x3c')]=qs[_0x6326('0x33')](_[_0x6326('0x3d')](_0x40e036[_0x6326('0x32')],_0x127744[_0x6326('0x33')]),_0x2a8873);if(_0x40e036[_0x6326('0x32')]['filter']){_0x461e0f[_0x6326('0x3c')]=_[_0x6326('0x3e')](_0x461e0f['where'],{'$or':_[_0x6326('0x2c')](_0x2a8873,function(_0x5ae140){if(_0x5ae140['type']!==_0x6326('0x3f')){var _0x1f8dcf={};_0x1f8dcf[_0x5ae140[_0x6326('0x29')]]={'$like':'%'+_0x40e036[_0x6326('0x32')][_0x6326('0x40')]+'%'};return _0x1f8dcf;}})});}_0x461e0f=_[_0x6326('0x3e')]({},_0x461e0f,_0x40e036['options']);var _0x485bed={'where':_0x461e0f[_0x6326('0x3c')]};return db['WhatsappQueueReport'][_0x6326('0x20')](_0x485bed)['then'](function(_0x282f33){_0x4980f6[_0x6326('0x20')]=_0x282f33;if(_0x40e036[_0x6326('0x32')][_0x6326('0x41')]){_0x461e0f[_0x6326('0x42')]=[{'all':!![]}];}return db[_0x6326('0x2d')][_0x6326('0x43')](_0x461e0f);})[_0x6326('0x25')](function(_0x3b089b){_0x4980f6[_0x6326('0x44')]=_0x3b089b;return _0x4980f6;})[_0x6326('0x25')](respondWithFilteredResult(_0x27802c,_0x461e0f))['catch'](handleError(_0x27802c,null));};exports[_0x6326('0x45')]=function(_0x5ce03a,_0x29f2fd){var _0x1d9d4c={'raw':!![],'where':{'id':_0x5ce03a[_0x6326('0x46')]['id']}},_0x16fc33={};_0x16fc33['model']=_[_0x6326('0x47')](db[_0x6326('0x2d')]['rawAttributes']);_0x16fc33[_0x6326('0x32')]=_[_0x6326('0x47')](_0x5ce03a[_0x6326('0x32')]);_0x16fc33[_0x6326('0x33')]=_['intersection'](_0x16fc33[_0x6326('0x31')],_0x16fc33[_0x6326('0x32')]);_0x1d9d4c[_0x6326('0x35')]=_[_0x6326('0x34')](_0x16fc33[_0x6326('0x31')],qs[_0x6326('0x36')](_0x5ce03a[_0x6326('0x32')]['fields']));_0x1d9d4c[_0x6326('0x35')]=_0x1d9d4c[_0x6326('0x35')][_0x6326('0x37')]?_0x1d9d4c[_0x6326('0x35')]:_0x16fc33['model'];if(_0x5ce03a[_0x6326('0x32')]['includeAll']){_0x1d9d4c[_0x6326('0x42')]=[{'all':!![]}];}_0x1d9d4c=_[_0x6326('0x3e')]({},_0x1d9d4c,_0x5ce03a[_0x6326('0x48')]);return db[_0x6326('0x2d')][_0x6326('0x49')](_0x1d9d4c)['then'](handleEntityNotFound(_0x29f2fd,null))[_0x6326('0x25')](respondWithResult(_0x29f2fd,null))['catch'](handleError(_0x29f2fd,null));};exports['create']=function(_0x2bca12,_0x44cf9d){return db['WhatsappQueueReport'][_0x6326('0x4a')](_0x2bca12[_0x6326('0x4b')],{})[_0x6326('0x25')](respondWithResult(_0x44cf9d,0xc9))[_0x6326('0x4c')](handleError(_0x44cf9d,null));};exports[_0x6326('0x24')]=function(_0x4f8dc0,_0x4af0ee){if(_0x4f8dc0[_0x6326('0x4b')]['id']){delete _0x4f8dc0[_0x6326('0x4b')]['id'];}return db[_0x6326('0x2d')][_0x6326('0x49')]({'where':{'id':_0x4f8dc0[_0x6326('0x46')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x25')](saveUpdates(_0x4f8dc0['body'],null))[_0x6326('0x25')](respondWithResult(_0x4af0ee,null))[_0x6326('0x4c')](handleError(_0x4af0ee,null));};exports[_0x6326('0x26')]=function(_0x3e7674,_0x1b5e9a){return db['WhatsappQueueReport'][_0x6326('0x49')]({'where':{'id':_0x3e7674['params']['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x1b5e9a,null))[_0x6326('0x25')](removeEntity(_0x1b5e9a,null))['catch'](handleError(_0x1b5e9a,null));};exports[_0x6326('0x4d')]=function(_0x5040b1,_0xaa4c9d){return db[_0x6326('0x2d')][_0x6326('0x4d')]()[_0x6326('0x25')](respondWithResult(_0xaa4c9d,null))['catch'](handleError(_0xaa4c9d,null));}; \ No newline at end of file +var _0x8603=['fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes'];(function(_0xd0f704,_0x1367ee){var _0x4c3237=function(_0x2bb875){while(--_0x2bb875){_0xd0f704['push'](_0xd0f704['shift']());}};_0x4c3237(++_0x1367ee);}(_0x8603,0x190));var _0x3860=function(_0x3e08c4,_0x6d2d30){_0x3e08c4=_0x3e08c4-0x0;var _0xa42d2d=_0x8603[_0x3e08c4];return _0xa42d2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];function respondWithStatusCode(_0x8ad61d,_0x2428f6){_0x2428f6=_0x2428f6||0xcc;return function(_0x1ea619){if(_0x1ea619){return _0x8ad61d[_0x3860('0x15')](_0x2428f6);}return _0x8ad61d[_0x3860('0x16')](_0x2428f6)[_0x3860('0x17')]();};}function respondWithResult(_0x12b23b,_0x465d8d){_0x465d8d=_0x465d8d||0xc8;return function(_0x46264d){if(_0x46264d){return _0x12b23b['status'](_0x465d8d)[_0x3860('0x18')](_0x46264d);}};}function respondWithFilteredResult(_0x21eaf1,_0x122e40){return function(_0x37d9ab){if(_0x37d9ab){var _0x1055b3=typeof _0x122e40[_0x3860('0x19')]===_0x3860('0x1a')&&typeof _0x122e40[_0x3860('0x1b')]===_0x3860('0x1a');var _0x3c0d91=_0x37d9ab[_0x3860('0x1c')];var _0x45b799=_0x1055b3?0x0:_0x122e40['offset'];var _0x4863bd=_0x1055b3?_0x37d9ab[_0x3860('0x1c')]:_0x122e40[_0x3860('0x19')]+_0x122e40[_0x3860('0x1b')];var _0x53fc63;if(_0x4863bd>=_0x3c0d91){_0x4863bd=_0x3c0d91;_0x53fc63=0xc8;}else{_0x53fc63=0xce;}_0x21eaf1[_0x3860('0x16')](_0x53fc63);return _0x21eaf1[_0x3860('0x1d')](_0x3860('0x1e'),_0x45b799+'-'+_0x4863bd+'/'+_0x3c0d91)[_0x3860('0x18')](_0x37d9ab);}return null;};}function patchUpdates(_0x20a5b0){return function(_0x45081f){try{jsonpatch[_0x3860('0x1f')](_0x45081f,_0x20a5b0,!![]);}catch(_0x1f8891){return BPromise[_0x3860('0x20')](_0x1f8891);}return _0x45081f[_0x3860('0x21')]();};}function saveUpdates(_0xacd57f,_0x2e0b6e){return function(_0x280ea9){if(_0x280ea9){return _0x280ea9[_0x3860('0x22')](_0xacd57f)[_0x3860('0x23')](function(_0x564efd){return _0x564efd;});}return null;};}function removeEntity(_0xfc10a5,_0x133093){return function(_0x2b91f2){if(_0x2b91f2){return _0x2b91f2[_0x3860('0x24')]()[_0x3860('0x23')](function(){_0xfc10a5['status'](0xcc)[_0x3860('0x17')]();});}};}function handleEntityNotFound(_0x568515,_0x577750){return function(_0xfa9705){if(!_0xfa9705){_0x568515[_0x3860('0x15')](0x194);}return _0xfa9705;};}function handleError(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0x1f4;return function(_0x5f42d5){logger[_0x3860('0x25')](_0x5f42d5[_0x3860('0x26')]);if(_0x5f42d5[_0x3860('0x27')]){delete _0x5f42d5[_0x3860('0x27')];}_0x54b5ec[_0x3860('0x16')](_0x4d9a90)[_0x3860('0x28')](_0x5f42d5);};}exports['index']=function(_0x4c4314,_0x389bd0){var _0x1f1809={},_0x5a9af2={},_0x2551f4={'count':0x0,'rows':[]};var _0x3d5143=_[_0x3860('0x29')](db[_0x3860('0x2a')][_0x3860('0x2b')],function(_0x4bbae9){return{'name':_0x4bbae9[_0x3860('0x2c')],'type':_0x4bbae9[_0x3860('0x2d')][_0x3860('0x2e')]};});_0x5a9af2['model']=_[_0x3860('0x29')](_0x3d5143,'name');_0x5a9af2[_0x3860('0x2f')]=_['keys'](_0x4c4314[_0x3860('0x2f')]);_0x5a9af2[_0x3860('0x30')]=_[_0x3860('0x31')](_0x5a9af2['model'],_0x5a9af2[_0x3860('0x2f')]);_0x1f1809[_0x3860('0x32')]=_['intersection'](_0x5a9af2[_0x3860('0x33')],qs['fields'](_0x4c4314[_0x3860('0x2f')][_0x3860('0x34')]));_0x1f1809[_0x3860('0x32')]=_0x1f1809[_0x3860('0x32')][_0x3860('0x35')]?_0x1f1809[_0x3860('0x32')]:_0x5a9af2[_0x3860('0x33')];if(!_0x4c4314['query'][_0x3860('0x36')](_0x3860('0x37'))){_0x1f1809['limit']=qs[_0x3860('0x1b')](_0x4c4314[_0x3860('0x2f')][_0x3860('0x1b')]);_0x1f1809['offset']=qs['offset'](_0x4c4314[_0x3860('0x2f')][_0x3860('0x19')]);}_0x1f1809[_0x3860('0x38')]=qs[_0x3860('0x39')](_0x4c4314['query']['sort']);_0x1f1809[_0x3860('0x3a')]=qs[_0x3860('0x30')](_[_0x3860('0x3b')](_0x4c4314[_0x3860('0x2f')],_0x5a9af2[_0x3860('0x30')]),_0x3d5143);if(_0x4c4314['query'][_0x3860('0x3c')]){_0x1f1809[_0x3860('0x3a')]=_['merge'](_0x1f1809['where'],{'$or':_[_0x3860('0x29')](_0x3d5143,function(_0x148914){if(_0x148914[_0x3860('0x2d')]!==_0x3860('0x3d')){var _0x2b35b2={};_0x2b35b2[_0x148914['name']]={'$like':'%'+_0x4c4314[_0x3860('0x2f')]['filter']+'%'};return _0x2b35b2;}})});}_0x1f1809=_[_0x3860('0x3e')]({},_0x1f1809,_0x4c4314[_0x3860('0x3f')]);var _0x53d443={'where':_0x1f1809[_0x3860('0x3a')]};return db[_0x3860('0x2a')]['count'](_0x53d443)[_0x3860('0x23')](function(_0xc7d34d){_0x2551f4[_0x3860('0x1c')]=_0xc7d34d;if(_0x4c4314[_0x3860('0x2f')]['includeAll']){_0x1f1809[_0x3860('0x40')]=[{'all':!![]}];}return db[_0x3860('0x2a')][_0x3860('0x41')](_0x1f1809);})['then'](function(_0x3a87e5){_0x2551f4['rows']=_0x3a87e5;return _0x2551f4;})[_0x3860('0x23')](respondWithFilteredResult(_0x389bd0,_0x1f1809))[_0x3860('0x42')](handleError(_0x389bd0,null));};exports[_0x3860('0x43')]=function(_0x3f613f,_0x2220c8){var _0x3f4216={'raw':!![],'where':{'id':_0x3f613f[_0x3860('0x44')]['id']}},_0x4e0a44={};_0x4e0a44[_0x3860('0x33')]=_['keys'](db['WhatsappQueueReport'][_0x3860('0x2b')]);_0x4e0a44[_0x3860('0x2f')]=_['keys'](_0x3f613f[_0x3860('0x2f')]);_0x4e0a44[_0x3860('0x30')]=_['intersection'](_0x4e0a44[_0x3860('0x33')],_0x4e0a44[_0x3860('0x2f')]);_0x3f4216[_0x3860('0x32')]=_[_0x3860('0x31')](_0x4e0a44[_0x3860('0x33')],qs[_0x3860('0x34')](_0x3f613f[_0x3860('0x2f')][_0x3860('0x34')]));_0x3f4216[_0x3860('0x32')]=_0x3f4216[_0x3860('0x32')][_0x3860('0x35')]?_0x3f4216[_0x3860('0x32')]:_0x4e0a44[_0x3860('0x33')];if(_0x3f613f['query'][_0x3860('0x45')]){_0x3f4216['include']=[{'all':!![]}];}_0x3f4216=_[_0x3860('0x3e')]({},_0x3f4216,_0x3f613f[_0x3860('0x3f')]);return db[_0x3860('0x2a')][_0x3860('0x46')](_0x3f4216)[_0x3860('0x23')](handleEntityNotFound(_0x2220c8,null))[_0x3860('0x23')](respondWithResult(_0x2220c8,null))[_0x3860('0x42')](handleError(_0x2220c8,null));};exports[_0x3860('0x47')]=function(_0x5a91b2,_0x3cd575){return db[_0x3860('0x2a')][_0x3860('0x47')](_0x5a91b2['body'],{})[_0x3860('0x23')](respondWithResult(_0x3cd575,0xc9))[_0x3860('0x42')](handleError(_0x3cd575,null));};exports[_0x3860('0x22')]=function(_0x3dc957,_0x5ed2db){if(_0x3dc957['body']['id']){delete _0x3dc957[_0x3860('0x48')]['id'];}return db['WhatsappQueueReport'][_0x3860('0x46')]({'where':{'id':_0x3dc957[_0x3860('0x44')]['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x5ed2db,null))['then'](saveUpdates(_0x3dc957[_0x3860('0x48')],null))['then'](respondWithResult(_0x5ed2db,null))[_0x3860('0x42')](handleError(_0x5ed2db,null));};exports['destroy']=function(_0xf9edb4,_0x25d22f){return db[_0x3860('0x2a')]['find']({'where':{'id':_0xf9edb4['params']['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x25d22f,null))[_0x3860('0x23')](removeEntity(_0x25d22f,null))['catch'](handleError(_0x25d22f,null));};exports[_0x3860('0x49')]=function(_0x58237e,_0x3b3bfe){return db[_0x3860('0x2a')][_0x3860('0x49')]()[_0x3860('0x23')](respondWithResult(_0x3b3bfe,null))[_0x3860('0x42')](handleError(_0x3b3bfe,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8f5acaa..f2a3e7f 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 _0x02f2=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','api','moment','bluebird','request-promise','path'];(function(_0x12827d,_0x26f618){var _0x14b812=function(_0x4a61e9){while(--_0x4a61e9){_0x12827d['push'](_0x12827d['shift']());}};_0x14b812(++_0x26f618);}(_0x02f2,0x13f));var _0x202f=function(_0x1ab57a,_0x4d4132){_0x1ab57a=_0x1ab57a-0x0;var _0x2a7d49=_0x02f2[_0x1ab57a];return _0x2a7d49;};'use strict';var _=require('lodash');var util=require(_0x202f('0x0'));var logger=require('../../config/logger')(_0x202f('0x1'));var moment=require(_0x202f('0x2'));var BPromise=require(_0x202f('0x3'));var rp=require(_0x202f('0x4'));var fs=require('fs');var path=require(_0x202f('0x5'));var rimraf=require(_0x202f('0x6'));var config=require(_0x202f('0x7'));var attributes=require(_0x202f('0x8'));module[_0x202f('0x9')]=function(_0x37e059,_0x505e5f){return _0x37e059['define'](_0x202f('0xa'),attributes,{'tableName':_0x202f('0xb'),'paranoid':![],'indexes':[{'name':_0x202f('0xc'),'fields':[_0x202f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4772=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger','api','path'];(function(_0x45b100,_0x29a4b1){var _0x1b41f8=function(_0x5a48b4){while(--_0x5a48b4){_0x45b100['push'](_0x45b100['shift']());}};_0x1b41f8(++_0x29a4b1);}(_0x4772,0x19b));var _0x2477=function(_0x264292,_0x27f518){_0x264292=_0x264292-0x0;var _0x20f82a=_0x4772[_0x264292];return _0x20f82a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2477('0x0'))(_0x2477('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2477('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2477('0x3'));module[_0x2477('0x4')]=function(_0xd97ded,_0x13b8da){return _0xd97ded[_0x2477('0x5')](_0x2477('0x6'),attributes,{'tableName':_0x2477('0x7'),'paranoid':![],'indexes':[{'name':_0x2477('0x8'),'fields':[_0x2477('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 8677076..e7dd8d6 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 _0xd34c=['catch','CreateWhatsappQueueReport','create','options','raw','then','UpdateWhatsappQueueReport','WhatsappQueueReport','where','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','request\x20sent','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result'];(function(_0x48fcf2,_0x36f603){var _0xd69676=function(_0x584e21){while(--_0x584e21){_0x48fcf2['push'](_0x48fcf2['shift']());}};_0xd69676(++_0x36f603);}(_0xd34c,0x7a));var _0xcd34=function(_0x2d1683,_0x91bc3){_0x2d1683=_0x2d1683-0x0;var _0x22340=_0xd34c[_0x2d1683];return _0x22340;};'use strict';var _=require('lodash');var util=require(_0xcd34('0x0'));var moment=require(_0xcd34('0x1'));var BPromise=require(_0xcd34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd34('0x3'));var db=require(_0xcd34('0x4'))['db'];var utils=require(_0xcd34('0x5'));var logger=require(_0xcd34('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcd34('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17411c,_0xec4e4b,_0x1b4340){return new BPromise(function(_0x3d878c,_0xa87de6){return client[_0xcd34('0x8')](_0x17411c,_0x1b4340)['then'](function(_0x1a6ca5){logger[_0xcd34('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0xec4e4b,_0xcd34('0xa'));logger[_0xcd34('0xb')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0xec4e4b,_0xcd34('0xa'),JSON[_0xcd34('0xc')](_0x1a6ca5));if(_0x1a6ca5[_0xcd34('0xd')]){if(_0x1a6ca5['error'][_0xcd34('0xe')]===0x1f4){logger[_0xcd34('0xd')](_0xcd34('0xf'),_0xec4e4b,_0x1a6ca5['error'][_0xcd34('0x10')]);return _0xa87de6(_0x1a6ca5[_0xcd34('0xd')][_0xcd34('0x10')]);}logger['error'](_0xcd34('0xf'),_0xec4e4b,_0x1a6ca5[_0xcd34('0xd')][_0xcd34('0x10')]);return _0x3d878c(_0x1a6ca5[_0xcd34('0xd')][_0xcd34('0x10')]);}else{logger[_0xcd34('0x9')](_0xcd34('0xf'),_0xec4e4b,'request\x20sent');_0x3d878c(_0x1a6ca5[_0xcd34('0x11')][_0xcd34('0x10')]);}})[_0xcd34('0x12')](function(_0x37eda8){logger[_0xcd34('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0xec4e4b,_0x37eda8);_0xa87de6(_0x37eda8);});});}exports[_0xcd34('0x13')]=function(_0x579107){var _0x13ac41=this;return new Promise(function(_0xd540fc,_0x22064c){return db['WhatsappQueueReport'][_0xcd34('0x14')](_0x579107['body'],{'raw':_0x579107[_0xcd34('0x15')]?_0x579107[_0xcd34('0x15')][_0xcd34('0x16')]===undefined?!![]:![]:!![]})[_0xcd34('0x17')](function(_0x196eb8){logger[_0xcd34('0x9')](_0xcd34('0x13'),_0x579107);logger[_0xcd34('0xb')](_0xcd34('0x13'),_0x579107,JSON[_0xcd34('0xc')](_0x196eb8));_0xd540fc(_0x196eb8);})[_0xcd34('0x12')](function(_0x5920eb){logger['error'](_0xcd34('0x13'),_0x5920eb[_0xcd34('0x10')],_0x579107);_0x22064c(_0x13ac41[_0xcd34('0xd')](0x1f4,_0x5920eb[_0xcd34('0x10')]));});});};exports[_0xcd34('0x18')]=function(_0x238f04){var _0x3a49d2=this;return new Promise(function(_0x1e0935,_0x40824d){return db[_0xcd34('0x19')]['update'](_0x238f04['body'],{'raw':_0x238f04[_0xcd34('0x15')]?_0x238f04['options'][_0xcd34('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238f04[_0xcd34('0x15')]?_0x238f04[_0xcd34('0x15')][_0xcd34('0x1a')]||null:null,'attributes':_0x238f04[_0xcd34('0x15')]?_0x238f04[_0xcd34('0x15')]['attributes']||null:null,'limit':_0x238f04[_0xcd34('0x15')]?_0x238f04[_0xcd34('0x15')][_0xcd34('0x1b')]||null:null})[_0xcd34('0x17')](function(_0x505987){logger[_0xcd34('0x9')](_0xcd34('0x18'),_0x238f04);logger[_0xcd34('0xb')](_0xcd34('0x18'),_0x238f04,JSON[_0xcd34('0xc')](_0x505987));_0x1e0935(_0x505987);})[_0xcd34('0x12')](function(_0x207930){logger[_0xcd34('0xd')](_0xcd34('0x18'),_0x207930[_0xcd34('0x10')],_0x238f04);_0x40824d(_0x3a49d2[_0xcd34('0xd')](0x1f4,_0x207930[_0xcd34('0x10')]));});});}; \ No newline at end of file +var _0x8cbb=['info','result','catch','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','update','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x183600,_0x1cc3de){var _0x24e182=function(_0x501d0e){while(--_0x501d0e){_0x183600['push'](_0x183600['shift']());}};_0x24e182(++_0x1cc3de);}(_0x8cbb,0x1ea));var _0xb8cb=function(_0x185e8e,_0x2872e9){_0x185e8e=_0x185e8e-0x0;var _0x39795e=_0x8cbb[_0x185e8e];return _0x39795e;};'use strict';var _=require(_0xb8cb('0x0'));var util=require(_0xb8cb('0x1'));var moment=require(_0xb8cb('0x2'));var BPromise=require(_0xb8cb('0x3'));var rs=require(_0xb8cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8cb('0x5'))['db'];var utils=require(_0xb8cb('0x6'));var logger=require('../../config/logger')(_0xb8cb('0x7'));var config=require(_0xb8cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb8cb('0x9')][_0xb8cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28f5ea,_0x71ad05,_0x59f64e){return new BPromise(function(_0x2bfdc9,_0x28d84a){return client[_0xb8cb('0xb')](_0x28f5ea,_0x59f64e)['then'](function(_0x153a71){logger['info'](_0xb8cb('0xc'),_0x71ad05,_0xb8cb('0xd'));logger[_0xb8cb('0xe')](_0xb8cb('0xf'),_0x71ad05,_0xb8cb('0xd'),JSON[_0xb8cb('0x10')](_0x153a71));if(_0x153a71[_0xb8cb('0x11')]){if(_0x153a71[_0xb8cb('0x11')][_0xb8cb('0x12')]===0x1f4){logger[_0xb8cb('0x11')](_0xb8cb('0xc'),_0x71ad05,_0x153a71[_0xb8cb('0x11')][_0xb8cb('0x13')]);return _0x28d84a(_0x153a71['error'][_0xb8cb('0x13')]);}logger[_0xb8cb('0x11')](_0xb8cb('0xc'),_0x71ad05,_0x153a71[_0xb8cb('0x11')][_0xb8cb('0x13')]);return _0x2bfdc9(_0x153a71[_0xb8cb('0x11')][_0xb8cb('0x13')]);}else{logger[_0xb8cb('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x71ad05,_0xb8cb('0xd'));_0x2bfdc9(_0x153a71[_0xb8cb('0x15')][_0xb8cb('0x13')]);}})[_0xb8cb('0x16')](function(_0x590579){logger['error'](_0xb8cb('0xc'),_0x71ad05,_0x590579);_0x28d84a(_0x590579);});});}exports['CreateWhatsappQueueReport']=function(_0x10d80c){var _0x1d7dd3=this;return new Promise(function(_0x4d649b,_0x5c22c9){return db[_0xb8cb('0x17')][_0xb8cb('0x18')](_0x10d80c[_0xb8cb('0x19')],{'raw':_0x10d80c[_0xb8cb('0x1a')]?_0x10d80c['options'][_0xb8cb('0x1b')]===undefined?!![]:![]:!![]})[_0xb8cb('0x1c')](function(_0x14796a){logger[_0xb8cb('0x14')](_0xb8cb('0x1d'),_0x10d80c);logger[_0xb8cb('0xe')](_0xb8cb('0x1d'),_0x10d80c,JSON[_0xb8cb('0x10')](_0x14796a));_0x4d649b(_0x14796a);})[_0xb8cb('0x16')](function(_0x40a0e5){logger['error'](_0xb8cb('0x1d'),_0x40a0e5[_0xb8cb('0x13')],_0x10d80c);_0x5c22c9(_0x1d7dd3[_0xb8cb('0x11')](0x1f4,_0x40a0e5[_0xb8cb('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5dcb94){var _0x2b68db=this;return new Promise(function(_0x59cf0d,_0x4082fe){return db['WhatsappQueueReport'][_0xb8cb('0x1e')](_0x5dcb94['body'],{'raw':_0x5dcb94[_0xb8cb('0x1a')]?_0x5dcb94[_0xb8cb('0x1a')][_0xb8cb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dcb94[_0xb8cb('0x1a')]?_0x5dcb94[_0xb8cb('0x1a')]['where']||null:null,'attributes':_0x5dcb94['options']?_0x5dcb94[_0xb8cb('0x1a')][_0xb8cb('0x1f')]||null:null,'limit':_0x5dcb94[_0xb8cb('0x1a')]?_0x5dcb94[_0xb8cb('0x1a')][_0xb8cb('0x20')]||null:null})[_0xb8cb('0x1c')](function(_0x22bf5e){logger[_0xb8cb('0x14')](_0xb8cb('0x21'),_0x5dcb94);logger[_0xb8cb('0xe')]('UpdateWhatsappQueueReport',_0x5dcb94,JSON[_0xb8cb('0x10')](_0x22bf5e));_0x59cf0d(_0x22bf5e);})['catch'](function(_0x29f9cf){logger['error'](_0xb8cb('0x21'),_0x29f9cf[_0xb8cb('0x13')],_0x5dcb94);_0x4082fe(_0x2b68db[_0xb8cb('0x11')](0x1f4,_0x29f9cf['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 2a95b2e..78c47be 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 _0x240a=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','destroy','exports','multer','util'];(function(_0x1f6370,_0x229f05){var _0x2aae9e=function(_0x5e271e){while(--_0x5e271e){_0x1f6370['push'](_0x1f6370['shift']());}};_0x2aae9e(++_0x229f05);}(_0x240a,0x1c6));var _0xa240=function(_0x2dacc4,_0x1352de){_0x2dacc4=_0x2dacc4-0x0;var _0xb5a8d=_0x240a[_0x2dacc4];return _0xb5a8d;};'use strict';var multer=require(_0xa240('0x0'));var util=require(_0xa240('0x1'));var path=require(_0xa240('0x2'));var timeout=require('connect-timeout');var express=require(_0xa240('0x3'));var router=express[_0xa240('0x4')]();var fs_extra=require(_0xa240('0x5'));var auth=require(_0xa240('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa240('0x7'));var controller=require(_0xa240('0x8'));router[_0xa240('0x9')]('/',auth[_0xa240('0xa')](),controller['index']);router[_0xa240('0x9')](_0xa240('0xb'),auth['isAuthenticated'](),controller[_0xa240('0xc')]);router['get'](_0xa240('0xd'),auth[_0xa240('0xa')](),controller[_0xa240('0xe')]);router['post']('/',auth[_0xa240('0xa')](),controller[_0xa240('0xf')]);router[_0xa240('0x10')](_0xa240('0xd'),auth[_0xa240('0xa')](),controller['update']);router['delete']('/:id',auth[_0xa240('0xa')](),controller[_0xa240('0x11')]);module[_0xa240('0x12')]=router; \ No newline at end of file +var _0xb974=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express'];(function(_0x16382b,_0x5d7704){var _0x1c1ff1=function(_0x590865){while(--_0x590865){_0x16382b['push'](_0x16382b['shift']());}};_0x1c1ff1(++_0x5d7704);}(_0xb974,0x18b));var _0x4b97=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb974[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x4b97('0x0'));var util=require(_0x4b97('0x1'));var path=require('path');var timeout=require(_0x4b97('0x2'));var express=require(_0x4b97('0x3'));var router=express[_0x4b97('0x4')]();var fs_extra=require(_0x4b97('0x5'));var auth=require(_0x4b97('0x6'));var interaction=require(_0x4b97('0x7'));var config=require(_0x4b97('0x8'));var controller=require(_0x4b97('0x9'));router[_0x4b97('0xa')]('/',auth[_0x4b97('0xb')](),controller[_0x4b97('0xc')]);router[_0x4b97('0xa')](_0x4b97('0xd'),auth[_0x4b97('0xb')](),controller['describe']);router[_0x4b97('0xa')](_0x4b97('0xe'),auth[_0x4b97('0xb')](),controller[_0x4b97('0xf')]);router[_0x4b97('0x10')]('/',auth['isAuthenticated'](),controller[_0x4b97('0x11')]);router[_0x4b97('0x12')]('/:id',auth[_0x4b97('0xb')](),controller['update']);router[_0x4b97('0x13')]('/:id',auth[_0x4b97('0xb')](),controller['destroy']);module[_0x4b97('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index c4afe40..f075401 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 _0xc3b7=['ENUM','account','agent','queue','DATE','exports','STRING'];(function(_0x340eb8,_0x309809){var _0x274b35=function(_0x11e1a8){while(--_0x11e1a8){_0x340eb8['push'](_0x340eb8['shift']());}};_0x274b35(++_0x309809);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x36d5f7,_0x25019a){_0x36d5f7=_0x36d5f7-0x0;var _0x3b12d8=_0xc3b7[_0x36d5f7];return _0x3b12d8;};'use strict';var Sequelize=require('sequelize');module[_0x7c3b('0x0')]={'uniqueid':{'type':Sequelize[_0x7c3b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7c3b('0x2')](_0x7c3b('0x3'),_0x7c3b('0x4'),_0x7c3b('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7c3b('0x6')]}}; \ No newline at end of file +var _0xf6ed=['account','DATE','sequelize','STRING','ENUM'];(function(_0x42896c,_0x984699){var _0x1664a1=function(_0x40b6f8){while(--_0x40b6f8){_0x42896c['push'](_0x42896c['shift']());}};_0x1664a1(++_0x984699);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x19a71d,_0x1990bf){_0x19a71d=_0x19a71d-0x0;var _0x1e6ddc=_0xf6ed[_0x19a71d];return _0x1e6ddc;};'use strict';var Sequelize=require(_0xdf6e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdf6e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdf6e('0x2')](_0xdf6e('0x3'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdf6e('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 0b8135c..801534e 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 _0x9e0d=['update','then','error','stack','name','send','WhatsappTransferReport','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','order','sort','where','merge','filter','options','includeAll','include','catch','show','keys','rawAttributes','find','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9e0d,0xf8));var _0xd9e0=function(_0x3ddc1f,_0x5bd6b3){_0x3ddc1f=_0x3ddc1f-0x0;var _0x3fabbd=_0x9e0d[_0x3ddc1f];return _0x3fabbd;};'use strict';var emlformat=require(_0xd9e0('0x0'));var rimraf=require(_0xd9e0('0x1'));var zipdir=require(_0xd9e0('0x2'));var jsonpatch=require(_0xd9e0('0x3'));var rp=require(_0xd9e0('0x4'));var moment=require(_0xd9e0('0x5'));var BPromise=require(_0xd9e0('0x6'));var Mustache=require(_0xd9e0('0x7'));var util=require(_0xd9e0('0x8'));var path=require(_0xd9e0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd9e0('0xa'));var fs=require('fs');var fs_extra=require(_0xd9e0('0xb'));var _=require(_0xd9e0('0xc'));var squel=require(_0xd9e0('0xd'));var crypto=require(_0xd9e0('0xe'));var jsforce=require(_0xd9e0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd9e0('0x10'));var querystring=require(_0xd9e0('0x11'));var Papa=require(_0xd9e0('0x12'));var Redis=require('ioredis');var authService=require(_0xd9e0('0x13'));var qs=require(_0xd9e0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9e0('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd9e0('0x16'));var licenseUtil=require(_0xd9e0('0x17'));var db=require(_0xd9e0('0x18'))['db'];function respondWithStatusCode(_0x4e43f4,_0x351f90){_0x351f90=_0x351f90||0xcc;return function(_0x4abfbf){if(_0x4abfbf){return _0x4e43f4['sendStatus'](_0x351f90);}return _0x4e43f4[_0xd9e0('0x19')](_0x351f90)[_0xd9e0('0x1a')]();};}function respondWithResult(_0x269721,_0x11b4cf){_0x11b4cf=_0x11b4cf||0xc8;return function(_0x4a15d8){if(_0x4a15d8){return _0x269721[_0xd9e0('0x19')](_0x11b4cf)[_0xd9e0('0x1b')](_0x4a15d8);}};}function respondWithFilteredResult(_0x1bd9bb,_0x5e59ec){return function(_0x285ab6){if(_0x285ab6){var _0x16714a=typeof _0x5e59ec[_0xd9e0('0x1c')]===_0xd9e0('0x1d')&&typeof _0x5e59ec[_0xd9e0('0x1e')]===_0xd9e0('0x1d');var _0x17dbbe=_0x285ab6[_0xd9e0('0x1f')];var _0x54e1aa=_0x16714a?0x0:_0x5e59ec[_0xd9e0('0x1c')];var _0x498a8a=_0x16714a?_0x285ab6[_0xd9e0('0x1f')]:_0x5e59ec[_0xd9e0('0x1c')]+_0x5e59ec[_0xd9e0('0x1e')];var _0x47323e;if(_0x498a8a>=_0x17dbbe){_0x498a8a=_0x17dbbe;_0x47323e=0xc8;}else{_0x47323e=0xce;}_0x1bd9bb[_0xd9e0('0x19')](_0x47323e);return _0x1bd9bb['set'](_0xd9e0('0x20'),_0x54e1aa+'-'+_0x498a8a+'/'+_0x17dbbe)[_0xd9e0('0x1b')](_0x285ab6);}return null;};}function patchUpdates(_0x2ec910){return function(_0x166bb4){try{jsonpatch[_0xd9e0('0x21')](_0x166bb4,_0x2ec910,!![]);}catch(_0x5b28ec){return BPromise[_0xd9e0('0x22')](_0x5b28ec);}return _0x166bb4[_0xd9e0('0x23')]();};}function saveUpdates(_0x193bb1,_0x176a9f){return function(_0x294643){if(_0x294643){return _0x294643[_0xd9e0('0x24')](_0x193bb1)[_0xd9e0('0x25')](function(_0x2f4f22){return _0x2f4f22;});}return null;};}function removeEntity(_0x21a373,_0x15e021){return function(_0x1074c2){if(_0x1074c2){return _0x1074c2['destroy']()['then'](function(){_0x21a373[_0xd9e0('0x19')](0xcc)[_0xd9e0('0x1a')]();});}};}function handleEntityNotFound(_0x3f5698,_0x387826){return function(_0x25f33d){if(!_0x25f33d){_0x3f5698['sendStatus'](0x194);}return _0x25f33d;};}function handleError(_0x22e861,_0x4f6fce){_0x4f6fce=_0x4f6fce||0x1f4;return function(_0xb24759){logger[_0xd9e0('0x26')](_0xb24759[_0xd9e0('0x27')]);if(_0xb24759['name']){delete _0xb24759[_0xd9e0('0x28')];}_0x22e861[_0xd9e0('0x19')](_0x4f6fce)[_0xd9e0('0x29')](_0xb24759);};}exports['index']=function(_0x37c150,_0x34b3a8){var _0x4aea0f={},_0x36b7f8={},_0x5f068f={'count':0x0,'rows':[]};var _0x52c5e2=_['map'](db[_0xd9e0('0x2a')]['rawAttributes'],function(_0x2628a8){return{'name':_0x2628a8[_0xd9e0('0x2b')],'type':_0x2628a8[_0xd9e0('0x2c')][_0xd9e0('0x2d')]};});_0x36b7f8['model']=_[_0xd9e0('0x2e')](_0x52c5e2,'name');_0x36b7f8[_0xd9e0('0x2f')]=_['keys'](_0x37c150[_0xd9e0('0x2f')]);_0x36b7f8[_0xd9e0('0x30')]=_[_0xd9e0('0x31')](_0x36b7f8[_0xd9e0('0x32')],_0x36b7f8[_0xd9e0('0x2f')]);_0x4aea0f['attributes']=_[_0xd9e0('0x31')](_0x36b7f8[_0xd9e0('0x32')],qs[_0xd9e0('0x33')](_0x37c150[_0xd9e0('0x2f')]['fields']));_0x4aea0f['attributes']=_0x4aea0f[_0xd9e0('0x34')][_0xd9e0('0x35')]?_0x4aea0f['attributes']:_0x36b7f8[_0xd9e0('0x32')];if(!_0x37c150['query']['hasOwnProperty']('nolimit')){_0x4aea0f['limit']=qs[_0xd9e0('0x1e')](_0x37c150[_0xd9e0('0x2f')]['limit']);_0x4aea0f[_0xd9e0('0x1c')]=qs['offset'](_0x37c150[_0xd9e0('0x2f')][_0xd9e0('0x1c')]);}_0x4aea0f[_0xd9e0('0x36')]=qs[_0xd9e0('0x37')](_0x37c150[_0xd9e0('0x2f')][_0xd9e0('0x37')]);_0x4aea0f[_0xd9e0('0x38')]=qs[_0xd9e0('0x30')](_['pick'](_0x37c150[_0xd9e0('0x2f')],_0x36b7f8[_0xd9e0('0x30')]),_0x52c5e2);if(_0x37c150[_0xd9e0('0x2f')]['filter']){_0x4aea0f['where']=_[_0xd9e0('0x39')](_0x4aea0f[_0xd9e0('0x38')],{'$or':_['map'](_0x52c5e2,function(_0x3fa7ba){if(_0x3fa7ba[_0xd9e0('0x2c')]!=='VIRTUAL'){var _0xeef394={};_0xeef394[_0x3fa7ba[_0xd9e0('0x28')]]={'$like':'%'+_0x37c150['query'][_0xd9e0('0x3a')]+'%'};return _0xeef394;}})});}_0x4aea0f=_[_0xd9e0('0x39')]({},_0x4aea0f,_0x37c150[_0xd9e0('0x3b')]);var _0x3549bc={'where':_0x4aea0f[_0xd9e0('0x38')]};return db[_0xd9e0('0x2a')][_0xd9e0('0x1f')](_0x3549bc)[_0xd9e0('0x25')](function(_0x15ac78){_0x5f068f[_0xd9e0('0x1f')]=_0x15ac78;if(_0x37c150[_0xd9e0('0x2f')][_0xd9e0('0x3c')]){_0x4aea0f[_0xd9e0('0x3d')]=[{'all':!![]}];}return db[_0xd9e0('0x2a')]['findAll'](_0x4aea0f);})['then'](function(_0x19d69e){_0x5f068f['rows']=_0x19d69e;return _0x5f068f;})[_0xd9e0('0x25')](respondWithFilteredResult(_0x34b3a8,_0x4aea0f))[_0xd9e0('0x3e')](handleError(_0x34b3a8,null));};exports[_0xd9e0('0x3f')]=function(_0x3df5b3,_0x337b0a){var _0x218b56={'raw':!![],'where':{'id':_0x3df5b3['params']['id']}},_0x1b04a4={};_0x1b04a4[_0xd9e0('0x32')]=_[_0xd9e0('0x40')](db[_0xd9e0('0x2a')][_0xd9e0('0x41')]);_0x1b04a4[_0xd9e0('0x2f')]=_[_0xd9e0('0x40')](_0x3df5b3[_0xd9e0('0x2f')]);_0x1b04a4['filters']=_['intersection'](_0x1b04a4[_0xd9e0('0x32')],_0x1b04a4[_0xd9e0('0x2f')]);_0x218b56['attributes']=_[_0xd9e0('0x31')](_0x1b04a4[_0xd9e0('0x32')],qs[_0xd9e0('0x33')](_0x3df5b3[_0xd9e0('0x2f')][_0xd9e0('0x33')]));_0x218b56['attributes']=_0x218b56[_0xd9e0('0x34')][_0xd9e0('0x35')]?_0x218b56[_0xd9e0('0x34')]:_0x1b04a4[_0xd9e0('0x32')];if(_0x3df5b3['query'][_0xd9e0('0x3c')]){_0x218b56['include']=[{'all':!![]}];}_0x218b56=_[_0xd9e0('0x39')]({},_0x218b56,_0x3df5b3['options']);return db[_0xd9e0('0x2a')][_0xd9e0('0x42')](_0x218b56)[_0xd9e0('0x25')](handleEntityNotFound(_0x337b0a,null))[_0xd9e0('0x25')](respondWithResult(_0x337b0a,null))['catch'](handleError(_0x337b0a,null));};exports['create']=function(_0x1bb3e9,_0x3790c0){return db['WhatsappTransferReport']['create'](_0x1bb3e9['body'],{})[_0xd9e0('0x25')](respondWithResult(_0x3790c0,0xc9))[_0xd9e0('0x3e')](handleError(_0x3790c0,null));};exports[_0xd9e0('0x24')]=function(_0x188125,_0x1df506){if(_0x188125[_0xd9e0('0x43')]['id']){delete _0x188125[_0xd9e0('0x43')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x188125['params']['id']}})[_0xd9e0('0x25')](handleEntityNotFound(_0x1df506,null))[_0xd9e0('0x25')](saveUpdates(_0x188125[_0xd9e0('0x43')],null))[_0xd9e0('0x25')](respondWithResult(_0x1df506,null))[_0xd9e0('0x3e')](handleError(_0x1df506,null));};exports[_0xd9e0('0x44')]=function(_0x3d249c,_0x1dd0f0){return db[_0xd9e0('0x2a')][_0xd9e0('0x42')]({'where':{'id':_0x3d249c[_0xd9e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dd0f0,null))[_0xd9e0('0x25')](removeEntity(_0x1dd0f0,null))[_0xd9e0('0x3e')](handleError(_0x1dd0f0,null));};exports[_0xd9e0('0x46')]=function(_0x1b5373,_0x28da65){return db['WhatsappTransferReport'][_0xd9e0('0x46')]()[_0xd9e0('0x25')](respondWithResult(_0x28da65,null))[_0xd9e0('0x3e')](handleError(_0x28da65,null));}; \ No newline at end of file +var _0x5d9d=['querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','keys','options','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x5d9d,0xcc));var _0xd5d9=function(_0x496e32,_0x4c3e56){_0x496e32=_0x496e32-0x0;var _0x4907df=_0x5d9d[_0x496e32];return _0x4907df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5d9('0x0'));var zipdir=require(_0xd5d9('0x1'));var jsonpatch=require(_0xd5d9('0x2'));var rp=require(_0xd5d9('0x3'));var moment=require(_0xd5d9('0x4'));var BPromise=require(_0xd5d9('0x5'));var Mustache=require(_0xd5d9('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd5d9('0x7'));var csv=require('to-csv');var ejs=require(_0xd5d9('0x8'));var fs=require('fs');var fs_extra=require(_0xd5d9('0x9'));var _=require(_0xd5d9('0xa'));var squel=require(_0xd5d9('0xb'));var crypto=require(_0xd5d9('0xc'));var jsforce=require(_0xd5d9('0xd'));var deskjs=require(_0xd5d9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd5d9('0xf'));var Papa=require(_0xd5d9('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd5d9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5d9('0x12'))(_0xd5d9('0x13'));var utils=require('../../config/utils');var config=require(_0xd5d9('0x14'));var licenseUtil=require(_0xd5d9('0x15'));var db=require(_0xd5d9('0x16'))['db'];function respondWithStatusCode(_0x19e82f,_0x33770e){_0x33770e=_0x33770e||0xcc;return function(_0x2320b6){if(_0x2320b6){return _0x19e82f[_0xd5d9('0x17')](_0x33770e);}return _0x19e82f['status'](_0x33770e)[_0xd5d9('0x18')]();};}function respondWithResult(_0x20b0e4,_0x3c6745){_0x3c6745=_0x3c6745||0xc8;return function(_0x48551d){if(_0x48551d){return _0x20b0e4[_0xd5d9('0x19')](_0x3c6745)[_0xd5d9('0x1a')](_0x48551d);}};}function respondWithFilteredResult(_0x17729e,_0xfb6f33){return function(_0x3718af){if(_0x3718af){var _0x21347f=typeof _0xfb6f33[_0xd5d9('0x1b')]===_0xd5d9('0x1c')&&typeof _0xfb6f33[_0xd5d9('0x1d')]==='undefined';var _0x362f53=_0x3718af['count'];var _0x456587=_0x21347f?0x0:_0xfb6f33[_0xd5d9('0x1b')];var _0x499e67=_0x21347f?_0x3718af[_0xd5d9('0x1e')]:_0xfb6f33[_0xd5d9('0x1b')]+_0xfb6f33['limit'];var _0x1591bb;if(_0x499e67>=_0x362f53){_0x499e67=_0x362f53;_0x1591bb=0xc8;}else{_0x1591bb=0xce;}_0x17729e[_0xd5d9('0x19')](_0x1591bb);return _0x17729e['set'](_0xd5d9('0x1f'),_0x456587+'-'+_0x499e67+'/'+_0x362f53)[_0xd5d9('0x1a')](_0x3718af);}return null;};}function patchUpdates(_0x38bb53){return function(_0xcbd9ae){try{jsonpatch[_0xd5d9('0x20')](_0xcbd9ae,_0x38bb53,!![]);}catch(_0x81f1fa){return BPromise[_0xd5d9('0x21')](_0x81f1fa);}return _0xcbd9ae[_0xd5d9('0x22')]();};}function saveUpdates(_0x159046,_0x5b26de){return function(_0x1979ae){if(_0x1979ae){return _0x1979ae['update'](_0x159046)[_0xd5d9('0x23')](function(_0x4a41ba){return _0x4a41ba;});}return null;};}function removeEntity(_0x2889f,_0x1e7f5b){return function(_0x141a9a){if(_0x141a9a){return _0x141a9a[_0xd5d9('0x24')]()[_0xd5d9('0x23')](function(){_0x2889f[_0xd5d9('0x19')](0xcc)[_0xd5d9('0x18')]();});}};}function handleEntityNotFound(_0x456168,_0x3bc3ce){return function(_0x186d84){if(!_0x186d84){_0x456168['sendStatus'](0x194);}return _0x186d84;};}function handleError(_0x22341f,_0x1cb74d){_0x1cb74d=_0x1cb74d||0x1f4;return function(_0x56908c){logger[_0xd5d9('0x25')](_0x56908c['stack']);if(_0x56908c[_0xd5d9('0x26')]){delete _0x56908c[_0xd5d9('0x26')];}_0x22341f['status'](_0x1cb74d)[_0xd5d9('0x27')](_0x56908c);};}exports['index']=function(_0x56e5c0,_0x26a784){var _0xe59922={},_0x27ea81={},_0x1595b4={'count':0x0,'rows':[]};var _0x5e0af8=_['map'](db[_0xd5d9('0x28')][_0xd5d9('0x29')],function(_0x17054e){return{'name':_0x17054e[_0xd5d9('0x2a')],'type':_0x17054e[_0xd5d9('0x2b')][_0xd5d9('0x2c')]};});_0x27ea81[_0xd5d9('0x2d')]=_[_0xd5d9('0x2e')](_0x5e0af8,'name');_0x27ea81['query']=_['keys'](_0x56e5c0[_0xd5d9('0x2f')]);_0x27ea81[_0xd5d9('0x30')]=_[_0xd5d9('0x31')](_0x27ea81[_0xd5d9('0x2d')],_0x27ea81[_0xd5d9('0x2f')]);_0xe59922[_0xd5d9('0x32')]=_['intersection'](_0x27ea81[_0xd5d9('0x2d')],qs[_0xd5d9('0x33')](_0x56e5c0[_0xd5d9('0x2f')][_0xd5d9('0x33')]));_0xe59922['attributes']=_0xe59922[_0xd5d9('0x32')][_0xd5d9('0x34')]?_0xe59922['attributes']:_0x27ea81[_0xd5d9('0x2d')];if(!_0x56e5c0[_0xd5d9('0x2f')][_0xd5d9('0x35')]('nolimit')){_0xe59922[_0xd5d9('0x1d')]=qs['limit'](_0x56e5c0['query'][_0xd5d9('0x1d')]);_0xe59922[_0xd5d9('0x1b')]=qs[_0xd5d9('0x1b')](_0x56e5c0['query']['offset']);}_0xe59922[_0xd5d9('0x36')]=qs[_0xd5d9('0x37')](_0x56e5c0[_0xd5d9('0x2f')][_0xd5d9('0x37')]);_0xe59922[_0xd5d9('0x38')]=qs[_0xd5d9('0x30')](_['pick'](_0x56e5c0[_0xd5d9('0x2f')],_0x27ea81['filters']),_0x5e0af8);if(_0x56e5c0[_0xd5d9('0x2f')]['filter']){_0xe59922[_0xd5d9('0x38')]=_[_0xd5d9('0x39')](_0xe59922[_0xd5d9('0x38')],{'$or':_[_0xd5d9('0x2e')](_0x5e0af8,function(_0x1a882d){if(_0x1a882d[_0xd5d9('0x2b')]!==_0xd5d9('0x3a')){var _0x516e2f={};_0x516e2f[_0x1a882d[_0xd5d9('0x26')]]={'$like':'%'+_0x56e5c0['query'][_0xd5d9('0x3b')]+'%'};return _0x516e2f;}})});}_0xe59922=_[_0xd5d9('0x39')]({},_0xe59922,_0x56e5c0['options']);var _0x1d4526={'where':_0xe59922[_0xd5d9('0x38')]};return db[_0xd5d9('0x28')][_0xd5d9('0x1e')](_0x1d4526)['then'](function(_0x1e6330){_0x1595b4[_0xd5d9('0x1e')]=_0x1e6330;if(_0x56e5c0[_0xd5d9('0x2f')][_0xd5d9('0x3c')]){_0xe59922[_0xd5d9('0x3d')]=[{'all':!![]}];}return db[_0xd5d9('0x28')][_0xd5d9('0x3e')](_0xe59922);})[_0xd5d9('0x23')](function(_0x1e1323){_0x1595b4['rows']=_0x1e1323;return _0x1595b4;})[_0xd5d9('0x23')](respondWithFilteredResult(_0x26a784,_0xe59922))[_0xd5d9('0x3f')](handleError(_0x26a784,null));};exports[_0xd5d9('0x40')]=function(_0x4899be,_0x5f4370){var _0x185698={'raw':!![],'where':{'id':_0x4899be['params']['id']}},_0x4216b8={};_0x4216b8[_0xd5d9('0x2d')]=_[_0xd5d9('0x41')](db['WhatsappTransferReport'][_0xd5d9('0x29')]);_0x4216b8[_0xd5d9('0x2f')]=_[_0xd5d9('0x41')](_0x4899be[_0xd5d9('0x2f')]);_0x4216b8[_0xd5d9('0x30')]=_[_0xd5d9('0x31')](_0x4216b8[_0xd5d9('0x2d')],_0x4216b8[_0xd5d9('0x2f')]);_0x185698['attributes']=_[_0xd5d9('0x31')](_0x4216b8[_0xd5d9('0x2d')],qs['fields'](_0x4899be['query'][_0xd5d9('0x33')]));_0x185698[_0xd5d9('0x32')]=_0x185698['attributes']['length']?_0x185698[_0xd5d9('0x32')]:_0x4216b8[_0xd5d9('0x2d')];if(_0x4899be[_0xd5d9('0x2f')][_0xd5d9('0x3c')]){_0x185698[_0xd5d9('0x3d')]=[{'all':!![]}];}_0x185698=_['merge']({},_0x185698,_0x4899be[_0xd5d9('0x42')]);return db[_0xd5d9('0x28')][_0xd5d9('0x43')](_0x185698)[_0xd5d9('0x23')](handleEntityNotFound(_0x5f4370,null))[_0xd5d9('0x23')](respondWithResult(_0x5f4370,null))['catch'](handleError(_0x5f4370,null));};exports[_0xd5d9('0x44')]=function(_0x414be9,_0x193f61){return db[_0xd5d9('0x28')][_0xd5d9('0x44')](_0x414be9[_0xd5d9('0x45')],{})['then'](respondWithResult(_0x193f61,0xc9))[_0xd5d9('0x3f')](handleError(_0x193f61,null));};exports[_0xd5d9('0x46')]=function(_0x5a3fa4,_0x10abd5){if(_0x5a3fa4['body']['id']){delete _0x5a3fa4[_0xd5d9('0x45')]['id'];}return db[_0xd5d9('0x28')]['find']({'where':{'id':_0x5a3fa4[_0xd5d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x10abd5,null))[_0xd5d9('0x23')](saveUpdates(_0x5a3fa4[_0xd5d9('0x45')],null))[_0xd5d9('0x23')](respondWithResult(_0x10abd5,null))[_0xd5d9('0x3f')](handleError(_0x10abd5,null));};exports[_0xd5d9('0x24')]=function(_0x45d63e,_0x3eb8cb){return db[_0xd5d9('0x28')]['find']({'where':{'id':_0x45d63e[_0xd5d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x3eb8cb,null))[_0xd5d9('0x23')](removeEntity(_0x3eb8cb,null))[_0xd5d9('0x3f')](handleError(_0x3eb8cb,null));};exports[_0xd5d9('0x48')]=function(_0x2e3624,_0x69ccb7){return db[_0xd5d9('0x28')][_0xd5d9('0x48')]()[_0xd5d9('0x23')](respondWithResult(_0x69ccb7,null))[_0xd5d9('0x3f')](handleError(_0x69ccb7,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2900a2c..17d3fea 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 _0x044e=['uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x5f11f0,_0x2ca169){var _0x3044fc=function(_0x4ba305){while(--_0x4ba305){_0x5f11f0['push'](_0x5f11f0['shift']());}};_0x3044fc(++_0x2ca169);}(_0x044e,0x1bb));var _0xe044=function(_0x45d88e,_0x56e183){_0x45d88e=_0x45d88e-0x0;var _0x947f78=_0x044e[_0x45d88e];return _0x947f78;};'use strict';var _=require(_0xe044('0x0'));var util=require(_0xe044('0x1'));var logger=require(_0xe044('0x2'))('api');var moment=require(_0xe044('0x3'));var BPromise=require(_0xe044('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe044('0x5'));var rimraf=require(_0xe044('0x6'));var config=require('../../config/environment');var attributes=require(_0xe044('0x7'));module[_0xe044('0x8')]=function(_0x39288b,_0x45b3c5){return _0x39288b[_0xe044('0x9')](_0xe044('0xa'),attributes,{'tableName':_0xe044('0xb'),'paranoid':![],'indexes':[{'name':_0xe044('0xc'),'fields':[_0xe044('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa57c=['define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0xe9b5d5,_0x1c40d1){var _0x6df8db=function(_0x4ac448){while(--_0x4ac448){_0xe9b5d5['push'](_0xe9b5d5['shift']());}};_0x6df8db(++_0x1c40d1);}(_0xa57c,0xb9));var _0xca57=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xa57c[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xca57('0x0'));var util=require(_0xca57('0x1'));var logger=require(_0xca57('0x2'))(_0xca57('0x3'));var moment=require(_0xca57('0x4'));var BPromise=require('bluebird');var rp=require(_0xca57('0x5'));var fs=require('fs');var path=require(_0xca57('0x6'));var rimraf=require(_0xca57('0x7'));var config=require(_0xca57('0x8'));var attributes=require(_0xca57('0x9'));module[_0xca57('0xa')]=function(_0x2484e3,_0x5eb405){return _0x2484e3[_0xca57('0xb')]('WhatsappTransferReport',attributes,{'tableName':_0xca57('0xc'),'paranoid':![],'indexes':[{'name':_0xca57('0xd'),'fields':[_0xca57('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index ac4d77d..86115d3 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 _0x476a=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x476a,0xad));var _0xa476=function(_0xac42d2,_0x34deb6){_0xac42d2=_0xac42d2-0x0;var _0x128cc4=_0x476a[_0xac42d2];return _0x128cc4;};'use strict';var _=require(_0xa476('0x0'));var util=require(_0xa476('0x1'));var moment=require('moment');var BPromise=require(_0xa476('0x2'));var rs=require(_0xa476('0x3'));var fs=require('fs');var Redis=require(_0xa476('0x4'));var db=require(_0xa476('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa476('0x6'))(_0xa476('0x7'));var config=require('../../config/environment');var jayson=require(_0xa476('0x8'));var client=jayson[_0xa476('0x9')][_0xa476('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3148bd,_0x439ed8,_0x4fe475){return new BPromise(function(_0x3b481f,_0x2e5796){return client[_0xa476('0xb')](_0x3148bd,_0x4fe475)[_0xa476('0xc')](function(_0x2e8406){logger[_0xa476('0xd')](_0xa476('0xe'),_0x439ed8,_0xa476('0xf'));logger[_0xa476('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x439ed8,'request\x20sent',JSON[_0xa476('0x11')](_0x2e8406));if(_0x2e8406[_0xa476('0x12')]){if(_0x2e8406[_0xa476('0x12')][_0xa476('0x13')]===0x1f4){logger[_0xa476('0x12')](_0xa476('0xe'),_0x439ed8,_0x2e8406[_0xa476('0x12')][_0xa476('0x14')]);return _0x2e5796(_0x2e8406[_0xa476('0x12')]['message']);}logger['error'](_0xa476('0xe'),_0x439ed8,_0x2e8406[_0xa476('0x12')][_0xa476('0x14')]);return _0x3b481f(_0x2e8406['error']['message']);}else{logger[_0xa476('0xd')](_0xa476('0xe'),_0x439ed8,'request\x20sent');_0x3b481f(_0x2e8406['result'][_0xa476('0x14')]);}})[_0xa476('0x15')](function(_0x570236){logger[_0xa476('0x12')](_0xa476('0xe'),_0x439ed8,_0x570236);_0x2e5796(_0x570236);});});} \ No newline at end of file +var _0x5520=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5520,0x91));var _0x0552=function(_0x47cfc9,_0x24fc3d){_0x47cfc9=_0x47cfc9-0x0;var _0x18fc41=_0x5520[_0x47cfc9];return _0x18fc41;};'use strict';var _=require(_0x0552('0x0'));var util=require(_0x0552('0x1'));var moment=require('moment');var BPromise=require(_0x0552('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0552('0x3'));var db=require(_0x0552('0x4'))['db'];var utils=require(_0x0552('0x5'));var logger=require('../../config/logger')(_0x0552('0x6'));var config=require(_0x0552('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0552('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8b5f,_0x2bac7e,_0x57bcb5){return new BPromise(function(_0x4e4df6,_0x553ec5){return client['request'](_0x2d8b5f,_0x57bcb5)[_0x0552('0x9')](function(_0x110c0c){logger[_0x0552('0xa')](_0x0552('0xb'),_0x2bac7e,'request\x20sent');logger[_0x0552('0xc')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2bac7e,'request\x20sent',JSON[_0x0552('0xd')](_0x110c0c));if(_0x110c0c['error']){if(_0x110c0c['error']['code']===0x1f4){logger[_0x0552('0xe')](_0x0552('0xb'),_0x2bac7e,_0x110c0c[_0x0552('0xe')][_0x0552('0xf')]);return _0x553ec5(_0x110c0c[_0x0552('0xe')][_0x0552('0xf')]);}logger[_0x0552('0xe')](_0x0552('0xb'),_0x2bac7e,_0x110c0c[_0x0552('0xe')][_0x0552('0xf')]);return _0x4e4df6(_0x110c0c[_0x0552('0xe')][_0x0552('0xf')]);}else{logger[_0x0552('0xa')](_0x0552('0xb'),_0x2bac7e,_0x0552('0x10'));_0x4e4df6(_0x110c0c[_0x0552('0x11')][_0x0552('0xf')]);}})['catch'](function(_0x44655f){logger[_0x0552('0xe')](_0x0552('0xb'),_0x2bac7e,_0x44655f);_0x553ec5(_0x44655f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 4025bb3..1930ee3 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a6=['sequelize','then','listen','start','info','map','online','name','join','Offline\x20apps:','filter','status','seedDB','./config/seedDB','default','./config/license','catch','error','exit','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe'];(function(_0x5e86d1,_0x362722){var _0x80ced6=function(_0x25e617){while(--_0x25e617){_0x5e86d1['push'](_0x5e86d1['shift']());}};_0x80ced6(++_0x362722);}(_0x45a6,0x6d));var _0x645a=function(_0x5c276d,_0x564182){_0x5c276d=_0x5c276d-0x0;var _0x202903=_0x45a6[_0x5c276d];return _0x202903;};'use strict';var _=require(_0x645a('0x0'));var mysqldb=require(_0x645a('0x1'));var rpc=require('./rpc');var config=require(_0x645a('0x2'));var logger=require(_0x645a('0x3'))(_0x645a('0x4'));var pm2=require(_0x645a('0x5'));var pm2Config=require(_0x645a('0x6'));var schedule=require(_0x645a('0x7'));var chat=require(_0x645a('0x8'));var whatsapp=require(_0x645a('0x9'));var transcribe=require(_0x645a('0xa'));function main(){return mysqldb['db'][_0x645a('0xb')]['sync']()[_0x645a('0xc')](function(){return rpc[_0x645a('0xd')]();})[_0x645a('0xc')](function(_0x1483e7){logger['info'](_0x1483e7);return chat[_0x645a('0xe')]();})['then'](function(){return whatsapp[_0x645a('0xe')]();})[_0x645a('0xc')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x645a('0xe')]();})[_0x645a('0xc')](function(_0x431cb0){logger[_0x645a('0xf')](_0x431cb0);return pm2[_0x645a('0xe')](pm2Config);})['then'](function(_0xa9ac7d){logger[_0x645a('0xf')]('Online\x20apps:',_[_0x645a('0x10')](_['filter'](_0xa9ac7d,{'status':_0x645a('0x11')}),_0x645a('0x12'))[_0x645a('0x13')]());logger[_0x645a('0xf')](_0x645a('0x14'),_['map'](_[_0x645a('0x15')](_0xa9ac7d,function(_0x46469e){return _0x46469e[_0x645a('0x16')]!==_0x645a('0x11');}),_0x645a('0x12'))[_0x645a('0x13')]()||'None');config[_0x645a('0x17')]&&require(_0x645a('0x18'))[_0x645a('0x19')]();require(_0x645a('0x1a'))[_0x645a('0x19')]();})[_0x645a('0x1b')](function(_0x487013){logger[_0x645a('0x1c')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x487013);process[_0x645a('0x1d')](0x1);});}main(); \ No newline at end of file +var _0xc270=['online','name','join','Offline\x20apps:','None','./config/seedDB','./config/license','default','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sync','then','listen','info','start','Online\x20apps:','map','filter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc270,0x1c4));var _0x0c27=function(_0x412841,_0x2e1d7a){_0x412841=_0x412841-0x0;var _0x28d36a=_0xc270[_0x412841];return _0x28d36a;};'use strict';var _=require(_0x0c27('0x0'));var mysqldb=require(_0x0c27('0x1'));var rpc=require('./rpc');var config=require(_0x0c27('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0x0c27('0x3'));var pm2Config=require(_0x0c27('0x4'));var schedule=require(_0x0c27('0x5'));var chat=require(_0x0c27('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x0c27('0x7'));function main(){return mysqldb['db']['sequelize'][_0x0c27('0x8')]()[_0x0c27('0x9')](function(){return rpc[_0x0c27('0xa')]();})[_0x0c27('0x9')](function(_0x10bc9b){logger[_0x0c27('0xb')](_0x10bc9b);return chat[_0x0c27('0xc')]();})['then'](function(){return whatsapp['start']();})[_0x0c27('0x9')](function(){return schedule[_0x0c27('0xc')]();})[_0x0c27('0x9')](function(){return transcribe['start']();})['then'](function(_0x4a1d39){logger[_0x0c27('0xb')](_0x4a1d39);return pm2[_0x0c27('0xc')](pm2Config);})[_0x0c27('0x9')](function(_0x2bb278){logger[_0x0c27('0xb')](_0x0c27('0xd'),_[_0x0c27('0xe')](_[_0x0c27('0xf')](_0x2bb278,{'status':_0x0c27('0x10')}),_0x0c27('0x11'))[_0x0c27('0x12')]());logger[_0x0c27('0xb')](_0x0c27('0x13'),_[_0x0c27('0xe')](_['filter'](_0x2bb278,function(_0x1407bc){return _0x1407bc['status']!==_0x0c27('0x10');}),_0x0c27('0x11'))[_0x0c27('0x12')]()||_0x0c27('0x14'));config['seedDB']&&require(_0x0c27('0x15'))['default']();require(_0x0c27('0x16'))[_0x0c27('0x17')]();})['catch'](function(_0x5a4aa6){logger['error'](_0x0c27('0x18'),_0x5a4aa6);process[_0x0c27('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c9ac7d5..0569af0 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 _0xab18=['then','status','unmanaged','Forbidden.','catch','headers','authorization','startsWith','Basic','find','name','pass','json','Wrong\x20credentials.','Bearer','apikey','getUuid','query','User','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','/dashboards/general','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','validatePasswordPattern','test','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','unshift','encryptString','join','promisify','secret','payload','options','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','basic-auth','crypto','bluebird','util','secrets','session','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','allowmessenger','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition'];(function(_0x3372fb,_0x31a0fb){var _0x2dccfc=function(_0x51c88b){while(--_0x51c88b){_0x3372fb['push'](_0x3372fb['shift']());}};_0x2dccfc(++_0x31a0fb);}(_0xab18,0x141));var _0x8ab1=function(_0x11815f,_0x27dd2e){_0x11815f=_0x11815f-0x0;var _0xc3b0ac=_0xab18[_0x11815f];return _0xc3b0ac;};'use strict';var db=require(_0x8ab1('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x8ab1('0x1'));var licenseUtil=require(_0x8ab1('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x8ab1('0x3'));var crypto=require(_0x8ab1('0x4'));var BPromise=require(_0x8ab1('0x5'));var util=require(_0x8ab1('0x6'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x8ab1('0x7')][_0x8ab1('0x8')]});var userAttributes=['id','role',_0x8ab1('0x9'),'name',_0x8ab1('0xa'),_0x8ab1('0xb'),_0x8ab1('0xc'),_0x8ab1('0xd'),_0x8ab1('0xe'),_0x8ab1('0xf'),_0x8ab1('0x10'),'mailPause',_0x8ab1('0x11'),_0x8ab1('0x12'),_0x8ab1('0x13'),_0x8ab1('0x14'),_0x8ab1('0x15'),'lastLoginAt','lastPauseAt','crudPermissions',_0x8ab1('0x16'),'passwordResetAt',_0x8ab1('0x17'),_0x8ab1('0x18'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0x8ab1('0x19'),_0x8ab1('0x1a'),_0x8ab1('0x1b'),_0x8ab1('0x1c'),_0x8ab1('0x1d'),_0x8ab1('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0x8ab1('0x1f'),_0x8ab1('0x20'),_0x8ab1('0x21'),'settingsEnabled',_0x8ab1('0x22'),_0x8ab1('0x23'),_0x8ab1('0x24'),'downloadAttachments',_0x8ab1('0x25'),_0x8ab1('0x26')];exports[_0x8ab1('0x27')]=function(){return this[_0x8ab1('0x28')](!![])[_0x8ab1('0x29')](function(_0x43e23c,_0x22abdb,_0x365b36){if(_0x43e23c[_0x8ab1('0x2a')]){_0x365b36();}else{return db[_0x8ab1('0x2b')][_0x8ab1('0x2c')]({'where':{'id':_0x43e23c[_0x8ab1('0x2d')]['id']},'attributes':['id',_0x8ab1('0x2e'),_0x8ab1('0x2f')],'raw':!![]})[_0x8ab1('0x30')](function(_0x5c87c2){if(_0x5c87c2&&_0x5c87c2[_0x8ab1('0x2e')]){return _0x22abdb[_0x8ab1('0x31')](_0x5c87c2[_0x8ab1('0x2f')]==='unmanaged'?0x195:0x193)['json']({'message':_0x5c87c2[_0x8ab1('0x2f')]===_0x8ab1('0x32')?'Unmanaged.':_0x8ab1('0x33')});}else{_0x365b36();}})[_0x8ab1('0x34')](function(_0xbb561e){_0x365b36(_0xbb561e);});}});};exports[_0x8ab1('0x28')]=function isAuthenticated(_0x1418c6){return compose()['use'](function(_0x46b695,_0x25040a,_0x27cfd3){var _0xe0e5cf;if(_0x46b695[_0x8ab1('0x35')][_0x8ab1('0x36')]){if(_[_0x8ab1('0x37')](_0x46b695[_0x8ab1('0x35')]['authorization'],_0x8ab1('0x38'))){var _0x3c9e96=basicAuth(_0x46b695);db['User'][_0x8ab1('0x39')]({'where':{'name':_0x3c9e96[_0x8ab1('0x3a')]}})[_0x8ab1('0x30')](function(_0x5b5626){if(!_0x5b5626||!_0x5b5626['authenticate'](_0x3c9e96[_0x8ab1('0x3b')])){return _0x25040a['status'](0x191)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x3d')});}_0x46b695[_0x8ab1('0x2a')]={'id':_0x5b5626['id']};_0x27cfd3();})[_0x8ab1('0x34')](function(_0x321523){_0x27cfd3(_0x321523);});}else if(_[_0x8ab1('0x37')](_0x46b695[_0x8ab1('0x35')][_0x8ab1('0x36')],_0x8ab1('0x3e'))){validateJwt(_0x46b695,_0x25040a,_0x27cfd3);}else{if(_0x1418c6){_0x27cfd3();}else{return _0x25040a['status'](0x193)[_0x8ab1('0x3c')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x46b695['query'][_0x8ab1('0x3f')]){try{var _0x27cee8={'audience':hardwareConf[_0x8ab1('0x40')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x46b695[_0x8ab1('0x41')][_0x8ab1('0x3f')],_0x27cee8)[_0x8ab1('0x30')](function(_0x78def3){return db[_0x8ab1('0x42')][_0x8ab1('0x39')]({'where':{'id':_0x78def3['sub']}})[_0x8ab1('0x30')](function(_0x18ac28){_0xe0e5cf=_0x18ac28;return db[_0x8ab1('0x43')][_0x8ab1('0x2c')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8ab1('0x44')],'raw':!![]});})['then'](function(_0x4e3239){if(!_0xe0e5cf||!_[_0x8ab1('0x45')](_0xe0e5cf[_0x8ab1('0x46')],_0x78def3[_0x8ab1('0x47')])){return _0x25040a[_0x8ab1('0x31')](0x191)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x48')});}if(_0xe0e5cf[_0x8ab1('0x49')]){return _0x25040a[_0x8ab1('0x31')](0x191)[_0x8ab1('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xe0e5cf[_0x8ab1('0x4a')]){if(_0x4e3239[_0x8ab1('0x44')]>0x0){if(moment(_0xe0e5cf[_0x8ab1('0x4b')])[_0x8ab1('0x4c')](_0x4e3239[_0x8ab1('0x44')],_0x8ab1('0x4d'))>moment()){return _0x25040a[_0x8ab1('0x31')](0x191)[_0x8ab1('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x25040a[_0x8ab1('0x31')](0x191)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x4e')});}}_0x46b695['user']={'id':_0xe0e5cf['id']};_0x27cfd3();});})[_0x8ab1('0x34')](function(){return _0x25040a['status'](0x191)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x4e')});});}catch(_0x491ea4){_0x27cfd3(_0x491ea4);}}else if(_0x1418c6){_0x27cfd3();}else{return _0x25040a[_0x8ab1('0x31')](0x193)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x4f')});}})['use'](function(_0x1086a1,_0x5c6688,_0x2f3586){if(_0x1086a1[_0x8ab1('0x2a')]){db['User'][_0x8ab1('0x39')]({'where':{'id':_0x1086a1[_0x8ab1('0x2a')]['id']},'attributes':userAttributes})[_0x8ab1('0x30')](function(_0x260fd9){if(!_0x260fd9){return _0x5c6688[_0x8ab1('0x31')](0x194)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x50')});}_0x1086a1[_0x8ab1('0x2a')]=_0x260fd9;_0x2f3586();})[_0x8ab1('0x34')](function(_0x410a9c){_0x2f3586(_0x410a9c);});}else if(_0x1418c6){_0x2f3586();}else{return _0x5c6688[_0x8ab1('0x31')](0x194)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x51')});}});};exports[_0x8ab1('0x52')]=function canUpdate(){return compose()[_0x8ab1('0x29')](function(_0x57bcc7,_0x22b2d5,_0x2b9d26){return licenseUtil['getLicense']()[_0x8ab1('0x30')](function(_0x19519e){if(_0x19519e[_0x8ab1('0x53')]){_0x2b9d26();}else{return _0x22b2d5['status'](0x193)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x54')});}})[_0x8ab1('0x34')](function(_0x28d97d){_0x2b9d26(_0x28d97d);});});};exports[_0x8ab1('0x55')]=function isWebrtcLicence(){return compose()['use'](function(_0x4ab592,_0x5b4b8c,_0xd6aeb5){return licenseUtil[_0x8ab1('0x56')]()[_0x8ab1('0x30')](function(_0x4b6424){if(_0x4b6424[_0x8ab1('0x57')]){_0xd6aeb5();}else{return _0x5b4b8c[_0x8ab1('0x31')](0x193)[_0x8ab1('0x3c')]({'message':_0x8ab1('0x54')});}})[_0x8ab1('0x34')](function(_0x1668ae){_0xd6aeb5(_0x1668ae);});});};exports['isMiddleware']=function(_0x45946b,_0x5c581e,_0xe3c911){_0x45946b['isMiddleware']=!![];return _0xe3c911();};exports['signToken']=function signToken(_0x32248e){return signJwt(_0x32248e);};exports['setTokenCookie']=function(_0x6b31d9,_0x3262fb){if(!_0x6b31d9[_0x8ab1('0x2a')]){return _0x3262fb[_0x8ab1('0x31')](0x194)['json']({'message':_0x8ab1('0x58')});}var _0x4d1406={'payload':{'id':_0x6b31d9[_0x8ab1('0x2a')]['id'],'role':_0x6b31d9[_0x8ab1('0x2a')][_0x8ab1('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4d1406)['then'](function(_0x56c487){_0x3262fb[_0x8ab1('0x5a')](_0x8ab1('0x5b'),_0x56c487);_0x3262fb['redirect'](_0x8ab1('0x5c'));})[_0x8ab1('0x34')](function(_0x45aa3b){return _0x3262fb[_0x8ab1('0x31')](0x1f4)['send'](_0x45aa3b);});};exports[_0x8ab1('0x5d')]=function(_0x3191f4){if(_[_0x8ab1('0x5e')](_0x3191f4[_0x8ab1('0x46')])||_[_0x8ab1('0x5e')](_0x3191f4['apiKeyIat'])){return null;}else{return createJwt(_0x3191f4);}};exports[_0x8ab1('0x5f')]=function(_0x2a7d33){_0x2a7d33[_0x8ab1('0x46')]=generateNonce();_0x2a7d33[_0x8ab1('0x60')]=generateIssuedAt();return createJwt(_0x2a7d33);};exports[_0x8ab1('0x61')]=function(_0x31092b,_0x593322){var _0x43640f=_0x31092b['query']['apikey'];if(_0x43640f){var _0x10ed09={'nonce':_0x593322[_0x8ab1('0x46')],'iat':_0x593322[_0x8ab1('0x60')],'audience':hardwareConf[_0x8ab1('0x40')](),'issuer':hardwareConf[_0x8ab1('0x40')]()};return verifyJwt(_0x43640f,_0x10ed09)[_0x8ab1('0x30')](function(){return generateApiKey(_0x593322);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x8ab1('0x62')]=function(_0x583857){var _0x4eff94=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4eff94[_0x8ab1('0x63')](_0x583857))throw new db['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~!@#$%^&-_=+[{]}.');return;};exports[_0x8ab1('0x64')]=function(_0x1d877d,_0x5d7e22,_0x3ca2c2){var _0x50bf30=encryptor[_0x8ab1('0x65')](_0x5d7e22)[_0x8ab1('0x66')](',');for(var _0x132e7f=0x0;_0x132e7f<_0x3ca2c2;_0x132e7f++){if(!_0x50bf30[_0x132e7f])break;if(_0x1d877d[_0x8ab1('0x67')]()===_0x50bf30[_0x132e7f][_0x8ab1('0x67')]()){var _0x1deb82=util['format'](_0x8ab1('0x68'),_0x3ca2c2);if(_0x3ca2c2===0x1){_0x1deb82=_0x8ab1('0x69');}throw new db[(_0x8ab1('0x6a'))][(_0x8ab1('0x6b'))](_0x1deb82);}}return;};exports[_0x8ab1('0x6c')]=function(_0x1a53d1,_0xf97252){var _0x19dcc6=_0xf97252?encryptor['decryptString'](_0xf97252)[_0x8ab1('0x66')](','):[];if(_0x19dcc6[_0x8ab1('0x6d')]===0x5){_0x19dcc6['splice'](-0x1,0x1);}_0x19dcc6[_0x8ab1('0x6e')](_0x1a53d1);return encryptor[_0x8ab1('0x6f')](_0x19dcc6[_0x8ab1('0x70')](','));};function signJwt(_0x34f3c5){var _0x251155=BPromise[_0x8ab1('0x71')](jwt['sign'],{'context':jwt});var _0x53a17a=_0x34f3c5[_0x8ab1('0x72')]||config['secrets'][_0x8ab1('0x8')];return new BPromise(function(_0x2b7e76,_0x2a13a6){_0x251155(_0x34f3c5[_0x8ab1('0x73')],_0x53a17a,_0x34f3c5[_0x8ab1('0x74')])['then'](function(_0x3919e0){_0x2b7e76(_0x3919e0);})[_0x8ab1('0x34')](function(_0x82ce96){_0x2a13a6(_0x82ce96);});});}function verifyJwt(_0x14e68f,_0x32fe62,_0x280e0){var _0x417065=BPromise[_0x8ab1('0x71')](jwt['verify'],{'context':jwt});var _0x4ece1e=_0x280e0||config[_0x8ab1('0x7')][_0x8ab1('0x8')];return new BPromise(function(_0x5d965f,_0x4d87e5){_0x417065(_0x14e68f,_0x4ece1e,_0x32fe62)[_0x8ab1('0x30')](function(_0xf8fcc9){_0x5d965f(_0xf8fcc9);})[_0x8ab1('0x34')](function(_0x2e563e){_0x4d87e5(_0x2e563e);});});}function generateNonce(){return crypto[_0x8ab1('0x75')](0x10)[_0x8ab1('0x76')](_0x8ab1('0x77'));}function generateIssuedAt(){return Math[_0x8ab1('0x78')](Date[_0x8ab1('0x79')]()/0x3e8)[_0x8ab1('0x76')]();}function createJwt(_0x2d005a){var _0x45a51a={'payload':{'iat':_0x2d005a[_0x8ab1('0x60')],'nonce':_0x2d005a['apiKeyNonce']},'options':{'algorithm':_0x8ab1('0x7a'),'subject':_0x2d005a['id'][_0x8ab1('0x76')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x45a51a)[_0x8ab1('0x30')](function(_0xade186){return{'iat':_0x2d005a['apiKeyIat'],'nonce':_0x2d005a['apiKeyNonce'],'token':_0xade186};});} \ No newline at end of file +var _0xa2bf=['Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString','join','promisify','sign','secret','secrets','session','payload','options','verify','randomBytes','floor','now','toString','HS512','../../config/environment','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','util','moment','role','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','authorization','headers','Basic','User','find','authenticate','pass','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled'];(function(_0x94db4a,_0x12f038){var _0x111626=function(_0x5d473f){while(--_0x5d473f){_0x94db4a['push'](_0x94db4a['shift']());}};_0x111626(++_0x12f038);}(_0xa2bf,0x1b7));var _0xfa2b=function(_0xa126b3,_0x5b6c2a){_0xa126b3=_0xa126b3-0x0;var _0x5bb57d=_0xa2bf[_0xa126b3];return _0x5bb57d;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xfa2b('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xfa2b('0x1'));var _=require(_0xfa2b('0x2'));var jwt=require(_0xfa2b('0x3'));var expressJwt=require(_0xfa2b('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xfa2b('0x5'));var BPromise=require('bluebird');var util=require(_0xfa2b('0x6'));var moment=require(_0xfa2b('0x7'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xfa2b('0x8'),'fullname',_0xfa2b('0x9'),_0xfa2b('0xa'),_0xfa2b('0xb'),_0xfa2b('0xc'),_0xfa2b('0xd'),_0xfa2b('0xe'),_0xfa2b('0xf'),'chatPause',_0xfa2b('0x10'),_0xfa2b('0x11'),_0xfa2b('0x12'),'openchannelPause',_0xfa2b('0x13'),_0xfa2b('0x14'),_0xfa2b('0x15'),_0xfa2b('0x16'),_0xfa2b('0x17'),_0xfa2b('0x18'),'passwordResetAt',_0xfa2b('0x19'),_0xfa2b('0x1a'),_0xfa2b('0x1b'),'phoneBarDnd',_0xfa2b('0x1c'),_0xfa2b('0x1d'),_0xfa2b('0x1e'),'phoneBarExpires','phoneBarPrefixRequired',_0xfa2b('0x1f'),'phoneBarRemoteControlPort',_0xfa2b('0x20'),_0xfa2b('0x21'),_0xfa2b('0x22'),_0xfa2b('0x23'),_0xfa2b('0x24'),'wssPort','downloadVoiceRecordings',_0xfa2b('0x25'),_0xfa2b('0x26'),_0xfa2b('0x27'),'selectRecallMeCampaign'];exports[_0xfa2b('0x28')]=function(){return this[_0xfa2b('0x29')](!![])[_0xfa2b('0x2a')](function(_0x1dd18b,_0x1b4399,_0x11c3a4){if(_0x1dd18b['user']){_0x11c3a4();}else{return db[_0xfa2b('0x2b')][_0xfa2b('0x2c')]({'where':{'id':_0x1dd18b['params']['id']},'attributes':['id',_0xfa2b('0x2d'),_0xfa2b('0x2e')],'raw':!![]})[_0xfa2b('0x2f')](function(_0x149a8e){if(_0x149a8e&&_0x149a8e['closed']){return _0x1b4399[_0xfa2b('0x30')](_0x149a8e[_0xfa2b('0x2e')]===_0xfa2b('0x31')?0x195:0x193)[_0xfa2b('0x32')]({'message':_0x149a8e[_0xfa2b('0x2e')]===_0xfa2b('0x31')?_0xfa2b('0x33'):_0xfa2b('0x34')});}else{_0x11c3a4();}})['catch'](function(_0x3e7060){_0x11c3a4(_0x3e7060);});}});};exports['isAuthenticated']=function isAuthenticated(_0xa45837){return compose()[_0xfa2b('0x2a')](function(_0x9ec91b,_0x58c491,_0x3b40cf){var _0x2130cb;if(_0x9ec91b['headers'][_0xfa2b('0x35')]){if(_['startsWith'](_0x9ec91b[_0xfa2b('0x36')][_0xfa2b('0x35')],_0xfa2b('0x37'))){var _0x32490a=basicAuth(_0x9ec91b);db[_0xfa2b('0x38')][_0xfa2b('0x39')]({'where':{'name':_0x32490a[_0xfa2b('0x9')]}})[_0xfa2b('0x2f')](function(_0xfd4716){if(!_0xfd4716||!_0xfd4716[_0xfa2b('0x3a')](_0x32490a[_0xfa2b('0x3b')])){return _0x58c491[_0xfa2b('0x30')](0x191)[_0xfa2b('0x32')]({'message':_0xfa2b('0x3c')});}_0x9ec91b[_0xfa2b('0x3d')]={'id':_0xfd4716['id']};_0x3b40cf();})[_0xfa2b('0x3e')](function(_0x3ae46b){_0x3b40cf(_0x3ae46b);});}else if(_['startsWith'](_0x9ec91b[_0xfa2b('0x36')]['authorization'],_0xfa2b('0x3f'))){validateJwt(_0x9ec91b,_0x58c491,_0x3b40cf);}else{if(_0xa45837){_0x3b40cf();}else{return _0x58c491['status'](0x193)[_0xfa2b('0x32')]({'message':_0xfa2b('0x40')});}}}else if(_0x9ec91b['query']['apikey']){try{var _0x96817b={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x9ec91b[_0xfa2b('0x41')][_0xfa2b('0x42')],_0x96817b)[_0xfa2b('0x2f')](function(_0x14db28){return db[_0xfa2b('0x38')][_0xfa2b('0x39')]({'where':{'id':_0x14db28[_0xfa2b('0x43')]}})[_0xfa2b('0x2f')](function(_0x7d4b33){_0x2130cb=_0x7d4b33;return db[_0xfa2b('0x44')][_0xfa2b('0x2c')]({'where':{'id':0x1},'attributes':[_0xfa2b('0x45'),'blockDuration'],'raw':!![]});})[_0xfa2b('0x2f')](function(_0x188e70){if(!_0x2130cb||!_['isEqual'](_0x2130cb[_0xfa2b('0x46')],_0x14db28['nonce'])){return _0x58c491[_0xfa2b('0x30')](0x191)[_0xfa2b('0x32')]({'message':_0xfa2b('0x47')});}if(_0x2130cb[_0xfa2b('0x48')]){return _0x58c491[_0xfa2b('0x30')](0x191)[_0xfa2b('0x32')]({'message':_0xfa2b('0x49')});}if(_0x2130cb[_0xfa2b('0x4a')]){if(_0x188e70[_0xfa2b('0x4b')]>0x0){if(moment(_0x2130cb[_0xfa2b('0x4c')])[_0xfa2b('0x4d')](_0x188e70[_0xfa2b('0x4b')],_0xfa2b('0x4e'))>moment()){return _0x58c491['status'](0x191)[_0xfa2b('0x32')]({'message':_0xfa2b('0x49')});}}else{return _0x58c491[_0xfa2b('0x30')](0x191)[_0xfa2b('0x32')]({'message':_0xfa2b('0x49')});}}_0x9ec91b[_0xfa2b('0x3d')]={'id':_0x2130cb['id']};_0x3b40cf();});})[_0xfa2b('0x3e')](function(){return _0x58c491[_0xfa2b('0x30')](0x191)[_0xfa2b('0x32')]({'message':_0xfa2b('0x49')});});}catch(_0x1df741){_0x3b40cf(_0x1df741);}}else if(_0xa45837){_0x3b40cf();}else{return _0x58c491[_0xfa2b('0x30')](0x193)[_0xfa2b('0x32')]({'message':_0xfa2b('0x40')});}})[_0xfa2b('0x2a')](function(_0x1571f5,_0xab8ea2,_0xdac1e6){if(_0x1571f5[_0xfa2b('0x3d')]){db[_0xfa2b('0x38')][_0xfa2b('0x39')]({'where':{'id':_0x1571f5[_0xfa2b('0x3d')]['id']},'attributes':userAttributes})[_0xfa2b('0x2f')](function(_0x5a2f45){if(!_0x5a2f45){return _0xab8ea2['status'](0x194)[_0xfa2b('0x32')]({'message':'User\x20not\x20found.'});}_0x1571f5[_0xfa2b('0x3d')]=_0x5a2f45;_0xdac1e6();})[_0xfa2b('0x3e')](function(_0x34e819){_0xdac1e6(_0x34e819);});}else if(_0xa45837){_0xdac1e6();}else{return _0xab8ea2['status'](0x194)[_0xfa2b('0x32')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xfa2b('0x4f')]=function canUpdate(){return compose()[_0xfa2b('0x2a')](function(_0x3b7df2,_0x1173ff,_0x5b43aa){return licenseUtil[_0xfa2b('0x50')]()[_0xfa2b('0x2f')](function(_0x5a0021){if(_0x5a0021[_0xfa2b('0x51')]){_0x5b43aa();}else{return _0x1173ff['status'](0x193)['json']({'message':_0xfa2b('0x52')});}})['catch'](function(_0x4b6573){_0x5b43aa(_0x4b6573);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xfa2b('0x2a')](function(_0x1dbbec,_0x3cbf62,_0x1bc560){return licenseUtil[_0xfa2b('0x50')]()[_0xfa2b('0x2f')](function(_0x9846f1){if(_0x9846f1[_0xfa2b('0x53')]){_0x1bc560();}else{return _0x3cbf62[_0xfa2b('0x30')](0x193)[_0xfa2b('0x32')]({'message':_0xfa2b('0x52')});}})[_0xfa2b('0x3e')](function(_0x2b6aa5){_0x1bc560(_0x2b6aa5);});});};exports[_0xfa2b('0x54')]=function(_0x440fef,_0x1fb5dc,_0x40ce8c){_0x440fef[_0xfa2b('0x54')]=!![];return _0x40ce8c();};exports[_0xfa2b('0x55')]=function signToken(_0x20f4c1){return signJwt(_0x20f4c1);};exports[_0xfa2b('0x56')]=function(_0x382039,_0x30b2ca){if(!_0x382039[_0xfa2b('0x3d')]){return _0x30b2ca[_0xfa2b('0x30')](0x194)[_0xfa2b('0x32')]({'message':_0xfa2b('0x57')});}var _0x2e674e={'payload':{'id':_0x382039[_0xfa2b('0x3d')]['id'],'role':_0x382039[_0xfa2b('0x3d')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2e674e)['then'](function(_0x365521){_0x30b2ca['cookie'](_0xfa2b('0x58'),_0x365521);_0x30b2ca[_0xfa2b('0x59')](_0xfa2b('0x5a'));})[_0xfa2b('0x3e')](function(_0x111355){return _0x30b2ca[_0xfa2b('0x30')](0x1f4)[_0xfa2b('0x5b')](_0x111355);});};exports[_0xfa2b('0x5c')]=function(_0x5ea02b){if(_[_0xfa2b('0x5d')](_0x5ea02b[_0xfa2b('0x46')])||_[_0xfa2b('0x5d')](_0x5ea02b[_0xfa2b('0x5e')])){return null;}else{return createJwt(_0x5ea02b);}};exports[_0xfa2b('0x5f')]=function(_0x520661){_0x520661[_0xfa2b('0x46')]=generateNonce();_0x520661[_0xfa2b('0x5e')]=generateIssuedAt();return createJwt(_0x520661);};exports[_0xfa2b('0x60')]=function(_0x4b6dd9,_0x52109f){var _0x521a7a=_0x4b6dd9[_0xfa2b('0x41')][_0xfa2b('0x42')];if(_0x521a7a){var _0xc14a3a={'nonce':_0x52109f[_0xfa2b('0x46')],'iat':_0x52109f['apiKeyIat'],'audience':hardwareConf[_0xfa2b('0x61')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x521a7a,_0xc14a3a)['then'](function(){return generateApiKey(_0x52109f);});}else{throw{'message':_0xfa2b('0x62')};}};exports['validatePasswordPattern']=function(_0x111813){var _0xe6661b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xe6661b[_0xfa2b('0x63')](_0x111813))throw new db[(_0xfa2b('0x64'))][(_0xfa2b('0x65'))](_0xfa2b('0x66'));return;};exports[_0xfa2b('0x67')]=function(_0x2cb5b6,_0x4b8fc1,_0x203728){var _0x469c16=encryptor[_0xfa2b('0x68')](_0x4b8fc1)[_0xfa2b('0x69')](',');for(var _0x81aeac=0x0;_0x81aeac<_0x203728;_0x81aeac++){if(!_0x469c16[_0x81aeac])break;if(_0x2cb5b6[_0xfa2b('0x6a')]()===_0x469c16[_0x81aeac][_0xfa2b('0x6a')]()){var _0x354b1a=util[_0xfa2b('0x6b')](_0xfa2b('0x6c'),_0x203728);if(_0x203728===0x1){_0x354b1a=_0xfa2b('0x6d');}throw new db['Sequelize'][(_0xfa2b('0x65'))](_0x354b1a);}}return;};exports[_0xfa2b('0x6e')]=function(_0x32e680,_0x2d66f8){var _0x2eef74=_0x2d66f8?encryptor[_0xfa2b('0x68')](_0x2d66f8)[_0xfa2b('0x69')](','):[];if(_0x2eef74['length']===0x5){_0x2eef74[_0xfa2b('0x6f')](-0x1,0x1);}_0x2eef74[_0xfa2b('0x70')](_0x32e680);return encryptor[_0xfa2b('0x71')](_0x2eef74[_0xfa2b('0x72')](','));};function signJwt(_0x563e0f){var _0x35f746=BPromise[_0xfa2b('0x73')](jwt[_0xfa2b('0x74')],{'context':jwt});var _0x4b2206=_0x563e0f[_0xfa2b('0x75')]||config[_0xfa2b('0x76')][_0xfa2b('0x77')];return new BPromise(function(_0x66e71b,_0x3c338e){_0x35f746(_0x563e0f[_0xfa2b('0x78')],_0x4b2206,_0x563e0f[_0xfa2b('0x79')])[_0xfa2b('0x2f')](function(_0x358699){_0x66e71b(_0x358699);})[_0xfa2b('0x3e')](function(_0x217448){_0x3c338e(_0x217448);});});}function verifyJwt(_0x409884,_0x4e0811,_0x2e8e19){var _0x47c99b=BPromise[_0xfa2b('0x73')](jwt[_0xfa2b('0x7a')],{'context':jwt});var _0x47025f=_0x2e8e19||config[_0xfa2b('0x76')]['session'];return new BPromise(function(_0x38bd25,_0x3cf9df){_0x47c99b(_0x409884,_0x47025f,_0x4e0811)['then'](function(_0x167af2){_0x38bd25(_0x167af2);})[_0xfa2b('0x3e')](function(_0xd67c68){_0x3cf9df(_0xd67c68);});});}function generateNonce(){return crypto[_0xfa2b('0x7b')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xfa2b('0x7c')](Date[_0xfa2b('0x7d')]()/0x3e8)[_0xfa2b('0x7e')]();}function createJwt(_0x535bfe){var _0x203c12={'payload':{'iat':_0x535bfe[_0xfa2b('0x5e')],'nonce':_0x535bfe[_0xfa2b('0x46')]},'options':{'algorithm':_0xfa2b('0x7f'),'subject':_0x535bfe['id'][_0xfa2b('0x7e')](),'issuer':hardwareConf[_0xfa2b('0x61')](),'audience':hardwareConf[_0xfa2b('0x61')]()}};return signJwt(_0x203c12)[_0xfa2b('0x2f')](function(_0xef0dd4){return{'iat':_0x535bfe[_0xfa2b('0x5e')],'nonce':_0x535bfe[_0xfa2b('0x46')],'token':_0xef0dd4};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index d745fed..044b4c6 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 _0x474c=['close','unlink','decryptFile','createDecipher','update','secret','utf8','base64','decryptString','crypto','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','binary','write','end','final'];(function(_0x818eb3,_0x2853e5){var _0x411f96=function(_0x4963c7){while(--_0x4963c7){_0x818eb3['push'](_0x818eb3['shift']());}};_0x411f96(++_0x2853e5);}(_0x474c,0xa9));var _0xc474=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0x474c[_0x872b02];return _0x1a6b24;};'use strict';var crypto=require(_0xc474('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xc474('0x1'));var logger=require(_0xc474('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc474('0x3')][_0xc474('0x4')],'algorithm':_0xc474('0x5')};const fileOptions={'algorithm':_0xc474('0x6')};if(config['encrypt']&&config[_0xc474('0x7')][_0xc474('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xc474('0x8')]=config['encrypt'][_0xc474('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xc474('0x9')](config['encrypt']['algorithm'],_0xc474('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x2786e7){return AES_SUPPORTED_RX[_0xc474('0xb')](_0x2786e7);}function getSupportedCiphers(){return crypto[_0xc474('0xc')]()[_0xc474('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3e602a){return getSupportedCiphers()['indexOf'](_0x3e602a)>-0x1;}function combineOptions(_0x7eb0d3){var _0x4a9d4a={};for(var _0x17b203 in fileOptions){if(fileOptions['hasOwnProperty'](_0x17b203)){_0x4a9d4a[_0x17b203]=fileOptions[_0x17b203];}}if(_0x7eb0d3){for(var _0x2b6782 in _0x7eb0d3){if(_0x7eb0d3[_0xc474('0xe')](_0x2b6782)){_0x4a9d4a[_0x2b6782]=_0x7eb0d3[_0x2b6782];}}}return _0x4a9d4a;}exports[_0xc474('0xf')]=function(_0xc3c6b5,_0x34e3d8,_0x405100,_0x2f7977){return new BPromise(function(_0x2f7413,_0x44aed6){_0x2f7977=combineOptions(_0x2f7977);var _0x220192=new Buffer(_0x405100);var _0x2e0a2c=fs['createReadStream'](_0xc3c6b5);var _0x24602b=fs[_0xc474('0x10')](_0x34e3d8);var _0x5d3f9=crypto[_0xc474('0x11')](_0x2f7977[_0xc474('0x8')],_0x220192);_0x2e0a2c['on'](_0xc474('0x12'),function(_0x15d34c){var _0x3d937b=new Buffer(_0x5d3f9['update'](_0x15d34c),_0xc474('0x13'));_0x24602b[_0xc474('0x14')](_0x3d937b);});_0x2e0a2c['on'](_0xc474('0x15'),function(){try{var _0x34d234=new Buffer(_0x5d3f9[_0xc474('0x16')](_0xc474('0x13')),'binary');_0x24602b['write'](_0x34d234);_0x24602b['end']();_0x24602b['on'](_0xc474('0x17'),function(){return _0x2f7413(_0x34e3d8);});}catch(_0x162a35){fs[_0xc474('0x18')](_0x34e3d8);return _0x44aed6(_0x162a35);}});});};exports[_0xc474('0x19')]=function(_0x1a0f84,_0x52f30d,_0x56cc5c,_0x1bf170){return new BPromise(function(_0x46dc57,_0x29c691){_0x1bf170=combineOptions(_0x1bf170);var _0x252d7f=new Buffer(_0x56cc5c);var _0x19add9=fs['createReadStream'](_0x1a0f84);var _0x4858d5=fs[_0xc474('0x10')](_0x52f30d);var _0x281c26=crypto[_0xc474('0x1a')](_0x1bf170[_0xc474('0x8')],_0x252d7f);_0x19add9['on'](_0xc474('0x12'),function(_0x166181){var _0x257bed=new Buffer(_0x281c26[_0xc474('0x1b')](_0x166181),_0xc474('0x13'));_0x4858d5[_0xc474('0x14')](_0x257bed);});_0x19add9['on'](_0xc474('0x15'),function(){try{var _0x181e11=new Buffer(_0x281c26[_0xc474('0x16')](_0xc474('0x13')),_0xc474('0x13'));_0x4858d5[_0xc474('0x14')](_0x181e11);_0x4858d5['end']();_0x4858d5['on'](_0xc474('0x17'),function(){return _0x46dc57(_0x52f30d);});}catch(_0x2be822){fs['unlink'](_0x52f30d);return _0x29c691(_0x2be822);}});});};exports['encryptString']=function(_0x23781a,_0x465650,_0x3a1542){var _0xb87640=_0x3a1542||stringOptions[_0xc474('0x8')];var _0x33a8c9=_0x465650||stringOptions[_0xc474('0x1c')];var _0x364427=crypto[_0xc474('0x11')](_0xb87640,_0x33a8c9);var _0x52cb3d=_0x364427['update'](_0x23781a,_0xc474('0x1d'),_0xc474('0x1e'));_0x52cb3d+=_0x364427['final']('base64');return _0x52cb3d;};exports[_0xc474('0x1f')]=function(_0x1b5a76,_0x2d9e01,_0x190df6){var _0x2b36e7=_0x190df6||stringOptions[_0xc474('0x8')];var _0x527253=_0x2d9e01||stringOptions[_0xc474('0x1c')];var _0x197727=crypto[_0xc474('0x1a')](_0x2b36e7,_0x527253);var _0x34141c=_0x197727['update'](_0x1b5a76,_0xc474('0x1e'),_0xc474('0x1d'));_0x34141c+=_0x197727[_0xc474('0x16')](_0xc474('0x1d'));return _0x34141c;}; \ No newline at end of file +var _0x750b=['encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','binary','write','end','close','decryptFile','createDecipher','update','unlink','encryptString','secret','utf8','decryptString','base64','final','crypto','bluebird','lodash','app','session','aes-256-ctr'];(function(_0x5227de,_0x3a4133){var _0x4c890b=function(_0x56da6c){while(--_0x56da6c){_0x5227de['push'](_0x5227de['shift']());}};_0x4c890b(++_0x3a4133);}(_0x750b,0x9a));var _0xb750=function(_0x2b4a10,_0x4db9ba){_0x2b4a10=_0x2b4a10-0x0;var _0x425abb=_0x750b[_0x2b4a10];return _0x425abb;};'use strict';var crypto=require(_0xb750('0x0'));var fs=require('fs');var BPromise=require(_0xb750('0x1'));var _=require(_0xb750('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xb750('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xb750('0x4')],'algorithm':_0xb750('0x5')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xb750('0x6')][_0xb750('0x7')]){var isSupported=isAlgorithmSupported(config[_0xb750('0x6')][_0xb750('0x7')]);if(isSupported){fileOptions[_0xb750('0x7')]=config[_0xb750('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb750('0x8')](',\x20');logger['error'](config[_0xb750('0x6')][_0xb750('0x7')],_0xb750('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x266349){return AES_SUPPORTED_RX['test'](_0x266349);}function getSupportedCiphers(){return crypto[_0xb750('0xa')]()[_0xb750('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x3a510a){return getSupportedCiphers()[_0xb750('0xc')](_0x3a510a)>-0x1;}function combineOptions(_0x46c2f4){var _0x37f24a={};for(var _0x2e1df9 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2e1df9)){_0x37f24a[_0x2e1df9]=fileOptions[_0x2e1df9];}}if(_0x46c2f4){for(var _0x1869b2 in _0x46c2f4){if(_0x46c2f4[_0xb750('0xd')](_0x1869b2)){_0x37f24a[_0x1869b2]=_0x46c2f4[_0x1869b2];}}}return _0x37f24a;}exports['encryptFile']=function(_0x452c50,_0x4ece9b,_0x4a1489,_0x381362){return new BPromise(function(_0x5ab5e4,_0x54db4f){_0x381362=combineOptions(_0x381362);var _0x32450c=new Buffer(_0x4a1489);var _0x7e2341=fs[_0xb750('0xe')](_0x452c50);var _0x479677=fs[_0xb750('0xf')](_0x4ece9b);var _0xcd3131=crypto[_0xb750('0x10')](_0x381362[_0xb750('0x7')],_0x32450c);_0x7e2341['on'](_0xb750('0x11'),function(_0x50774c){var _0x2903a1=new Buffer(_0xcd3131['update'](_0x50774c),_0xb750('0x12'));_0x479677[_0xb750('0x13')](_0x2903a1);});_0x7e2341['on'](_0xb750('0x14'),function(){try{var _0x5b2d45=new Buffer(_0xcd3131['final'](_0xb750('0x12')),_0xb750('0x12'));_0x479677[_0xb750('0x13')](_0x5b2d45);_0x479677['end']();_0x479677['on'](_0xb750('0x15'),function(){return _0x5ab5e4(_0x4ece9b);});}catch(_0x12b51){fs['unlink'](_0x4ece9b);return _0x54db4f(_0x12b51);}});});};exports[_0xb750('0x16')]=function(_0x2c63b3,_0x1b61da,_0x129c73,_0x1ac14a){return new BPromise(function(_0x287f60,_0x33949a){_0x1ac14a=combineOptions(_0x1ac14a);var _0x306672=new Buffer(_0x129c73);var _0x104403=fs[_0xb750('0xe')](_0x2c63b3);var _0x16b3e8=fs[_0xb750('0xf')](_0x1b61da);var _0x4b20e5=crypto[_0xb750('0x17')](_0x1ac14a[_0xb750('0x7')],_0x306672);_0x104403['on'](_0xb750('0x11'),function(_0x64c6d5){var _0x4f24c4=new Buffer(_0x4b20e5[_0xb750('0x18')](_0x64c6d5),_0xb750('0x12'));_0x16b3e8[_0xb750('0x13')](_0x4f24c4);});_0x104403['on']('end',function(){try{var _0x2c4241=new Buffer(_0x4b20e5['final']('binary'),'binary');_0x16b3e8['write'](_0x2c4241);_0x16b3e8['end']();_0x16b3e8['on'](_0xb750('0x15'),function(){return _0x287f60(_0x1b61da);});}catch(_0x54de3d){fs[_0xb750('0x19')](_0x1b61da);return _0x33949a(_0x54de3d);}});});};exports[_0xb750('0x1a')]=function(_0x9f30ed,_0x348283,_0x55e46e){var _0x3c9d42=_0x55e46e||stringOptions[_0xb750('0x7')];var _0x44d26a=_0x348283||stringOptions[_0xb750('0x1b')];var _0x43ee6b=crypto['createCipher'](_0x3c9d42,_0x44d26a);var _0x265f4c=_0x43ee6b[_0xb750('0x18')](_0x9f30ed,_0xb750('0x1c'),'base64');_0x265f4c+=_0x43ee6b['final']('base64');return _0x265f4c;};exports[_0xb750('0x1d')]=function(_0x1bbdb5,_0x5e1dc8,_0xab9e54){var _0x1ccfb3=_0xab9e54||stringOptions[_0xb750('0x7')];var _0x15a846=_0x5e1dc8||stringOptions[_0xb750('0x1b')];var _0x3b92a5=crypto[_0xb750('0x17')](_0x1ccfb3,_0x15a846);var _0x282a83=_0x3b92a5[_0xb750('0x18')](_0x1bbdb5,_0xb750('0x1e'),'utf8');_0x282a83+=_0x3b92a5[_0xb750('0x1f')](_0xb750('0x1c'));return _0x282a83;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 423a88e..34185e5 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 _0xdfdf=['bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','lodash'];(function(_0x4d67d2,_0x2d0886){var _0x5e0c33=function(_0x1eea18){while(--_0x1eea18){_0x4d67d2['push'](_0x4d67d2['shift']());}};_0x5e0c33(++_0x2d0886);}(_0xdfdf,0x87));var _0xfdfd=function(_0x3f28ca,_0x56df3b){_0x3f28ca=_0x3f28ca-0x0;var _0x5ac068=_0xdfdf[_0x3f28ca];return _0x5ac068;};'use strict';var util=require(_0xfdfd('0x0'));var path=require(_0xfdfd('0x1'));var _=require(_0xfdfd('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xfdfd('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xfdfd('0x4'));var db=require(_0xfdfd('0x5'))['db'];var dbH=require(_0xfdfd('0x5'))[_0xfdfd('0x6')];var logger=require(_0xfdfd('0x7'))(_0xfdfd('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xfdfd('0x9')][0x3];var PATH=process[_0xfdfd('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x30b54e,_0x3b6b98){var _0x3812ba={'status':_0x30b54e};var _0x5af026={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3b6b98){_0x3812ba['savename']=_0x3b6b98;}return db[_0xfdfd('0xa')][_0xfdfd('0xb')](_0x3812ba,_0x5af026);}function main(){var _0x25ad8b=0x1388;var _0x98d8b2;logger[_0xfdfd('0xc')](util['format'](_0xfdfd('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xfdfd('0xe')][_0xfdfd('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfdfd('0x10'),_0xfdfd('0x11')]})[_0xfdfd('0x12')](function(_0xf9b3fd){if(_0xf9b3fd){_0x98d8b2=_0xf9b3fd;_0x25ad8b=_0x98d8b2['splitSizeCsv']||0x1388;}})[_0xfdfd('0x12')](function(){return dbH[_0xfdfd('0x13')][_0xfdfd('0x14')](util[_0xfdfd('0x15')](_0xfdfd('0x16'),QUERY),{'type':dbH[_0xfdfd('0x13')][_0xfdfd('0x17')][_0xfdfd('0x18')]});})[_0xfdfd('0x12')](function(_0x3a4562){if(!_0x3a4562[0x0]['num']){return analyticExtractedReport(_0xfdfd('0x19'));}var _0x1273c6=[];var _0x25e153=0x0;if(_0x98d8b2[_0xfdfd('0x10')]){if(_0x3a4562&&_0x3a4562[_0xfdfd('0x1a')]){var _0x7215cd=_[_0xfdfd('0x1b')](_0x3a4562[0x0][_0xfdfd('0x1c')]/_0x25ad8b);var _0x5b7327=Number['isInteger'](_0x3a4562[0x0]['num']/_0x25ad8b)?_0x3a4562[0x0][_0xfdfd('0x1c')]%_0x25ad8b:0x0;_0x7215cd[_0xfdfd('0x1d')](function(_0x2038e7){if(_0x2038e7>0x0){_0x25e153+=_0x25ad8b;}_0x1273c6[_0xfdfd('0x1e')](dbH[_0xfdfd('0x13')][_0xfdfd('0x14')](util[_0xfdfd('0x15')](_0xfdfd('0x1f'),QUERY,_0x25ad8b,_0x25e153),{'type':dbH[_0xfdfd('0x13')][_0xfdfd('0x17')]['SELECT']}));});if(_0x5b7327>0x0){_0x25e153+=_0x25ad8b;_0x1273c6[_0xfdfd('0x1e')](dbH[_0xfdfd('0x13')][_0xfdfd('0x14')](util['format'](_0xfdfd('0x1f'),QUERY,_0x5b7327,_0x25e153),{'type':dbH[_0xfdfd('0x13')][_0xfdfd('0x17')][_0xfdfd('0x18')]}));}}}else{_0x1273c6[_0xfdfd('0x1e')](dbH[_0xfdfd('0x13')]['query'](QUERY,{'type':dbH[_0xfdfd('0x13')]['QueryTypes'][_0xfdfd('0x18')]}));}var _0x4ce435=path[_0xfdfd('0x20')](PATH);var _0x205f16=path['basename'](PATH,_0xfdfd('0x21'));var _0x27fc26=_0x98d8b2['split']&&_0x1273c6[_0xfdfd('0x1a')]>0x1;var _0x11fd70=[];if(!fs[_0xfdfd('0x22')](path['join'](_0x4ce435,_0x205f16))&&_0x27fc26){fs['mkdirSync'](path['join'](_0x4ce435,_0x205f16));}return BPromise['each'](_0x1273c6,function(_0x559234){_0x11fd70[_0xfdfd('0x1e')](_0x559234);})[_0xfdfd('0x12')](function(){for(var _0x31465e=0x0;_0x31465e<_0x11fd70[_0xfdfd('0x1a')];_0x31465e+=0x1){var _0xe96c2a;var _0x372554=_0x11fd70[_0x31465e];if(_0x27fc26){_0xe96c2a=path[_0xfdfd('0x23')](_0x4ce435,_0x205f16,util[_0xfdfd('0x15')](_0xfdfd('0x24'),_0x205f16,_0x31465e,_0xfdfd('0x25')));}else{_0xe96c2a=path[_0xfdfd('0x23')](_0x4ce435,util[_0xfdfd('0x15')](_0xfdfd('0x26'),_0x205f16,'csv'));}fs['writeFileSync'](_0xe96c2a,csv(_0x372554));}})[_0xfdfd('0x12')](function(){if(_0x27fc26){return new Promise(function(_0x5eeb04){zipdir(path[_0xfdfd('0x23')](_0x4ce435,_0x205f16),{'saveTo':path[_0xfdfd('0x23')](_0x4ce435,util[_0xfdfd('0x15')](_0xfdfd('0x26'),_0x205f16,_0xfdfd('0x27')))},function(_0xd10977,_0x576d20){rimraf(path['join'](_0x4ce435,_0x205f16),function(){});_0x5eeb04(_0xfdfd('0x28'));});});}})[_0xfdfd('0x12')](function(){logger[_0xfdfd('0xc')](util[_0xfdfd('0x15')](_0xfdfd('0x29'),EXTRACTED_REPORT_ID,_0xfdfd('0x2a')));return analyticExtractedReport('Completed',_0x27fc26?util[_0xfdfd('0x15')](_0xfdfd('0x26'),_0x205f16,_0x27fc26?_0xfdfd('0x27'):'csv'):null);});})[_0xfdfd('0x2b')](function(_0x1bc555){logger[_0xfdfd('0xc')](util[_0xfdfd('0x15')](_0xfdfd('0x2c'),EXTRACTED_REPORT_ID,_0xfdfd('0x2a')),util[_0xfdfd('0x2d')](_0x1bc555,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5c84=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','push'];(function(_0x33d0c5,_0xdaf95f){var _0x58e326=function(_0x2f59ac){while(--_0x2f59ac){_0x33d0c5['push'](_0x33d0c5['shift']());}};_0x58e326(++_0xdaf95f);}(_0x5c84,0x1c2));var _0x45c8=function(_0x539487,_0x81d83a){_0x539487=_0x539487-0x0;var _0x4f0f8f=_0x5c84[_0x539487];return _0x4f0f8f;};'use strict';var util=require(_0x45c8('0x0'));var path=require(_0x45c8('0x1'));var _=require('lodash');var csv=require(_0x45c8('0x2'));var fs=require('fs');var BPromise=require(_0x45c8('0x3'));var zipdir=require(_0x45c8('0x4'));var rimraf=require('rimraf');var db=require(_0x45c8('0x5'))['db'];var dbH=require(_0x45c8('0x5'))[_0x45c8('0x6')];var logger=require(_0x45c8('0x7'))(_0x45c8('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x45c8('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x45c8('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x475fb0,_0x2d9338){var _0x552394={'status':_0x475fb0};var _0x185226={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d9338){_0x552394[_0x45c8('0xa')]=_0x2d9338;}return db['AnalyticExtractedReport']['update'](_0x552394,_0x185226);}function main(){var _0x23bed0=0x1388;var _0x33f289;logger[_0x45c8('0xb')](util[_0x45c8('0xc')](_0x45c8('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x45c8('0xe')][_0x45c8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x45c8('0x10'),_0x45c8('0x11')]})[_0x45c8('0x12')](function(_0x3d618f){if(_0x3d618f){_0x33f289=_0x3d618f;_0x23bed0=_0x33f289['splitSizeCsv']||0x1388;}})[_0x45c8('0x12')](function(){return dbH[_0x45c8('0x13')][_0x45c8('0x14')](util[_0x45c8('0xc')](_0x45c8('0x15'),QUERY),{'type':dbH[_0x45c8('0x13')][_0x45c8('0x16')][_0x45c8('0x17')]});})[_0x45c8('0x12')](function(_0xa7f755){if(!_0xa7f755[0x0][_0x45c8('0x18')]){return analyticExtractedReport('Empty');}var _0x2bd4e1=[];var _0x51974f=0x0;if(_0x33f289[_0x45c8('0x10')]){if(_0xa7f755&&_0xa7f755[_0x45c8('0x19')]){var _0x24e14d=_[_0x45c8('0x1a')](_0xa7f755[0x0][_0x45c8('0x18')]/_0x23bed0);var _0x13b054=Number[_0x45c8('0x1b')](_0xa7f755[0x0][_0x45c8('0x18')]/_0x23bed0)?_0xa7f755[0x0][_0x45c8('0x18')]%_0x23bed0:0x0;_0x24e14d[_0x45c8('0x1c')](function(_0x15acf7){if(_0x15acf7>0x0){_0x51974f+=_0x23bed0;}_0x2bd4e1[_0x45c8('0x1d')](dbH[_0x45c8('0x13')][_0x45c8('0x14')](util[_0x45c8('0xc')](_0x45c8('0x1e'),QUERY,_0x23bed0,_0x51974f),{'type':dbH['sequelize']['QueryTypes'][_0x45c8('0x17')]}));});if(_0x13b054>0x0){_0x51974f+=_0x23bed0;_0x2bd4e1[_0x45c8('0x1d')](dbH[_0x45c8('0x13')]['query'](util[_0x45c8('0xc')](_0x45c8('0x1e'),QUERY,_0x13b054,_0x51974f),{'type':dbH['sequelize'][_0x45c8('0x16')][_0x45c8('0x17')]}));}}}else{_0x2bd4e1['push'](dbH[_0x45c8('0x13')][_0x45c8('0x14')](QUERY,{'type':dbH[_0x45c8('0x13')][_0x45c8('0x16')][_0x45c8('0x17')]}));}var _0x2743be=path[_0x45c8('0x1f')](PATH);var _0xa0333=path[_0x45c8('0x20')](PATH,_0x45c8('0x21'));var _0x510564=_0x33f289[_0x45c8('0x10')]&&_0x2bd4e1[_0x45c8('0x19')]>0x1;var _0x3c4bef=[];if(!fs[_0x45c8('0x22')](path['join'](_0x2743be,_0xa0333))&&_0x510564){fs['mkdirSync'](path[_0x45c8('0x23')](_0x2743be,_0xa0333));}return BPromise[_0x45c8('0x24')](_0x2bd4e1,function(_0x4ce874){_0x3c4bef[_0x45c8('0x1d')](_0x4ce874);})['then'](function(){for(var _0x19d419=0x0;_0x19d419<_0x3c4bef[_0x45c8('0x19')];_0x19d419+=0x1){var _0x1808d5;var _0x5789d1=_0x3c4bef[_0x19d419];if(_0x510564){_0x1808d5=path['join'](_0x2743be,_0xa0333,util[_0x45c8('0xc')](_0x45c8('0x25'),_0xa0333,_0x19d419,'csv'));}else{_0x1808d5=path['join'](_0x2743be,util[_0x45c8('0xc')](_0x45c8('0x26'),_0xa0333,_0x45c8('0x27')));}fs[_0x45c8('0x28')](_0x1808d5,csv(_0x5789d1));}})[_0x45c8('0x12')](function(){if(_0x510564){return new Promise(function(_0xc6a04c){zipdir(path[_0x45c8('0x23')](_0x2743be,_0xa0333),{'saveTo':path[_0x45c8('0x23')](_0x2743be,util[_0x45c8('0xc')](_0x45c8('0x26'),_0xa0333,'zip'))},function(_0x418872,_0x4ca059){rimraf(path[_0x45c8('0x23')](_0x2743be,_0xa0333),function(){});_0xc6a04c('zip\x20finished');});});}})[_0x45c8('0x12')](function(){logger['info'](util[_0x45c8('0xc')](_0x45c8('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x45c8('0x2a'),_0x510564?util['format']('%s.%s',_0xa0333,_0x510564?'zip':_0x45c8('0x27')):null);});})[_0x45c8('0x2b')](function(_0x48e5d9){logger[_0x45c8('0xb')](util[_0x45c8('0xc')](_0x45c8('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util[_0x45c8('0x2d')](_0x48e5d9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x45c8('0x2e'));})[_0x45c8('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7c38376..1bfbff7 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 _0x9249=['%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','end','createPdfFromHTML','catch','lodash','util','moment','pdfmake/src/printer','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','toString','footer','black','Empty','Setting','find','split','then','splitSizePdf','range','isInteger','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','join','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf'];(function(_0x399849,_0x3b630d){var _0xfbb04=function(_0x4fea04){while(--_0x4fea04){_0x399849['push'](_0x399849['shift']());}};_0xfbb04(++_0x3b630d);}(_0x9249,0x11d));var _0x9924=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x9249[_0x217ff6];return _0x417c93;};'use strict';var _=require(_0x9924('0x0'));var fs=require('fs');var util=require(_0x9924('0x1'));var path=require('path');var moment=require(_0x9924('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x9924('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x9924('0x4'));var JSDOM=require(_0x9924('0x5'))['JSDOM'];var window=new JSDOM('')[_0x9924('0x6')];var BPromise=require(_0x9924('0x7'));var db=require(_0x9924('0x8'))['db'];var dbH=require('../../mysqldb')[_0x9924('0x9')];var logger=require(_0x9924('0xa'))(_0x9924('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x9924('0xc')][0x2]);var QUERY=process[_0x9924('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x9924('0xc')][0x5];var FORMAT=_0x9924('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5c3916,_0x384578){var _0x423eea={'status':_0x5c3916};var _0x2e2d56={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x384578){_0x423eea[_0x9924('0xe')]=_0x384578;}return db[_0x9924('0xf')][_0x9924('0x10')](_0x423eea,_0x2e2d56);}function getHeaders(_0x3fd8e9){return _[_0x9924('0x11')](_0x3fd8e9,function(_0x1ed929){return{'text':_0x1ed929,'style':'tableHeader'};});}function getRows(_0x4a3e5d,_0x42cc96){return _[_0x9924('0x11')](_0x42cc96,function(_0x359598){return _(_0x359598)['pick'](_0x4a3e5d)[_0x9924('0x11')](function(_0x4eb601){return _0x4eb601?_['toString'](_0x4eb601):'';})[_0x9924('0x12')]();});}function createTable(_0x1ae096,_0x226ad3){var _0x47cb93={'widths':_[_0x9924('0x13')](Array(_0x1ae096[_0x9924('0x14')]),0x91),'heights':function(_0x41c074){return _0x41c074===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x105f12=getHeaders(_0x1ae096);_0x47cb93[_0x9924('0x15')][_0x9924('0x16')](_0x105f12);var _0x415e4b=getRows(_0x1ae096,_0x226ad3);_0x47cb93[_0x9924('0x15')]=_0x47cb93[_0x9924('0x15')][_0x9924('0x17')](_0x415e4b);return _0x47cb93;}function createTables(_0x3e38f6){var _0x56303f=[];var _0x2158fa=_[_0x9924('0x18')](Object[_0x9924('0x19')](_0x3e38f6[0x0]),0x5);_0x2158fa[_0x9924('0x1a')](function(_0x26829e){_0x56303f[_0x9924('0x16')](createTable(_0x26829e,_0x3e38f6));});return _0x56303f;}function getPDFDocDefinition(_0x52dbf2){var _0x58fc68=util[_0x9924('0x1b')](_0x9924('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x9924('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x9924('0x1e')])[_0x9924('0x1b')](FORMAT));var _0x5448dd=[];for(var _0x1f7443=0x0;_0x1f7443<_0x52dbf2[_0x9924('0x14')];_0x1f7443++){var _0x40b2b6=[];if(_0x1f7443===0x0){_0x40b2b6[_0x9924('0x16')]({'text':_0x58fc68,'style':_0x9924('0x1f')});}var _0x3d9b63={'table':_0x52dbf2[_0x1f7443]};if(_0x1f7443>0x0){_0x3d9b63[_0x9924('0x20')]=_0x9924('0x21');_0x3d9b63[_0x9924('0x22')]=[0x0,0x46,0x0,0x0];}_0x40b2b6[_0x9924('0x16')](_0x3d9b63);_0x5448dd[_0x9924('0x16')](_0x40b2b6);}return{'pageSize':'A4','pageOrientation':_0x9924('0x23'),'content':_0x5448dd,'footer':function(_0x415e88,_0x3d586b){return{'text':_0x415e88[_0x9924('0x24')]()+'\x20/\x20'+_0x3d586b,'style':_0x9924('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9924('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4ff49c){var _0x26cffe=0x1388;var _0x1b5b0c;if(!_0x4ff49c[0x0]['num']){return analyticExtractedReport(_0x9924('0x27'));}return db[_0x9924('0x28')][_0x9924('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9924('0x2a'),'splitSizePdf']})[_0x9924('0x2b')](function(_0x5dee1d){if(_0x5dee1d){_0x1b5b0c=_0x5dee1d;_0x26cffe=_0x1b5b0c[_0x9924('0x2c')]||0x3e8;}})['then'](function(){var _0x5942d4=[];var _0x3f1471=0x0;if(_0x1b5b0c[_0x9924('0x2a')]){if(_0x4ff49c&&_0x4ff49c[_0x9924('0x14')]){var _0x30412d=_[_0x9924('0x2d')](_0x4ff49c[0x0]['num']/_0x26cffe);var _0x1d24a9=Number[_0x9924('0x2e')](_0x4ff49c[0x0][_0x9924('0x2f')]/_0x26cffe)?_0x4ff49c[0x0][_0x9924('0x2f')]%_0x26cffe:0x0;_0x30412d[_0x9924('0x1a')](function(_0x5176e5){if(_0x5176e5>0x0){_0x3f1471+=_0x26cffe;}_0x5942d4['push'](dbH[_0x9924('0x30')]['query'](util[_0x9924('0x1b')](_0x9924('0x31'),QUERY,_0x26cffe,_0x3f1471),{'type':dbH[_0x9924('0x30')][_0x9924('0x32')][_0x9924('0x33')]}));});if(_0x1d24a9>0x0){_0x3f1471+=_0x26cffe;_0x5942d4['push'](dbH['sequelize']['query'](util[_0x9924('0x1b')](_0x9924('0x31'),QUERY,_0x1d24a9,_0x3f1471),{'type':dbH[_0x9924('0x30')][_0x9924('0x32')]['SELECT']}));}}}else{_0x5942d4[_0x9924('0x16')](dbH[_0x9924('0x30')]['query'](QUERY,{'type':dbH['sequelize'][_0x9924('0x32')][_0x9924('0x33')]}));}var _0x329586=path[_0x9924('0x34')](PATH);var _0x7bc79f=path[_0x9924('0x35')](PATH,_0x9924('0x36'));var _0x57ae88=_0x1b5b0c[_0x9924('0x2a')]&&_0x5942d4[_0x9924('0x14')]>0x1;var _0x55eb78=[];if(!fs[_0x9924('0x37')](path['join'](_0x329586,_0x7bc79f))&&_0x57ae88){fs[_0x9924('0x38')](path['join'](_0x329586,_0x7bc79f));}return BPromise[_0x9924('0x39')](_0x5942d4,function(_0x2f54be){_0x55eb78['push'](_0x2f54be);})['then'](function(){var _0x4b6359=[];for(var _0x5463e6=0x0;_0x5463e6<_0x55eb78[_0x9924('0x14')];_0x5463e6+=0x1){var _0x21287a=_0x55eb78[_0x5463e6];var _0x4f473f=createTables(_[_0x9924('0x3a')](_0x21287a));var _0x3f6a70;var _0x1eb785=getPDFDocDefinition(_0x4f473f);var _0x27c4ea=getPDFPrinter();var _0x20ec5e=_0x27c4ea[_0x9924('0x3b')](_0x1eb785);if(_0x57ae88){_0x3f6a70=path['join'](_0x329586,_0x7bc79f,util[_0x9924('0x1b')](_0x9924('0x3c'),_0x7bc79f,_0x5463e6,_0x9924('0x3d')));}else{_0x3f6a70=path[_0x9924('0x3e')](_0x329586,util[_0x9924('0x1b')](_0x9924('0x3f'),_0x7bc79f,_0x9924('0x3d')));}_0x4b6359['push'](writePDFDocument(_0x20ec5e,_0x3f6a70));}return Promise[_0x9924('0x40')](_0x4b6359);})[_0x9924('0x2b')](function(){if(_0x57ae88){return new Promise(function(_0x361b50){zipdir(path[_0x9924('0x3e')](_0x329586,_0x7bc79f),{'saveTo':path[_0x9924('0x3e')](_0x329586,util['format'](_0x9924('0x3f'),_0x7bc79f,'zip'))},function(){rimraf(path[_0x9924('0x3e')](_0x329586,_0x7bc79f),function(){});_0x361b50(_0x9924('0x41'));});});}})['then'](function(){if(!_0x57ae88)return;rimraf(path[_0x9924('0x3e')](_0x329586,_0x7bc79f),function(){});})[_0x9924('0x2b')](function(){logger['info'](util[_0x9924('0x1b')](_0x9924('0x42'),EXTRACTED_REPORT_ID,_0x9924('0x43')));return analyticExtractedReport('Completed',_0x57ae88?util['format'](_0x9924('0x3f'),_0x7bc79f,_0x57ae88?_0x9924('0x44'):_0x9924('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x9924('0x1b')](_0x9924('0x45'),EXTRACTED_REPORT_ID,_0x9924('0x43')));return db[_0x9924('0xf')][_0x9924('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9924('0x2b')](function(_0x5794f4){EXTRACTED_REPORT=_0x5794f4;return dbH[_0x9924('0x30')]['query'](util[_0x9924('0x1b')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9924('0x30')][_0x9924('0x32')][_0x9924('0x33')]});})[_0x9924('0x2b')](extractReport)['catch'](function(_0x140675){logger[_0x9924('0x47')](util['format'](_0x9924('0x48'),EXTRACTED_REPORT_ID,_0x9924('0x43')),util[_0x9924('0x49')](_0x140675,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9924('0x4a'));})['finally'](function(){process[_0x9924('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1f9311=new PdfPrinter({'Arial':{'normal':__dirname+_0x9924('0x4c'),'bold':__dirname+_0x9924('0x4d'),'italics':__dirname+_0x9924('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1f9311;}function getPDFDocDefinitionFromHTML(_0x377b42,_0x54630f){var _0x5db277=util[_0x9924('0x1b')](_0x9924('0x4f'),_0x54630f[_0x9924('0x50')],_0x54630f[_0x9924('0x51')]);var _0x1c4be5=moment()['format'](_0x9924('0x52'))[_0x9924('0x24')]();var _0x3a3cbd=htmlToPdfmake(_0x377b42,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3a3cbd],'defaultStyle':{'font':_0x9924('0x53')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9924('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9924('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x9924('0x1f')}];},'footer':function(_0x3d60e2,_0x307c67){return[{'text':util[_0x9924('0x1b')](_0x9924('0x55'),_0x5db277,_0x3d60e2,_0x307c67,_0x1c4be5),'style':_0x9924('0x25')}];}};}function writePDFDocument(_0x10c16b,_0x497775){return new Promise(function(_0x2d5617,_0x4fd90d){var _0x2daee0=_0x10c16b[_0x9924('0x56')](fs['createWriteStream'](_0x497775));_0x2daee0['on'](_0x9924('0x57'),function(){_0x2d5617('finish');});_0x2daee0['on']('error',function(_0x3ba5a7){_0x4fd90d(_0x3ba5a7);});_0x10c16b[_0x9924('0x58')]();});}exports[_0x9924('0x59')]=function(_0x329292,_0x2fde08){var _0x2cb597=getPDFPrinter();var _0x44e493=getPDFDocDefinitionFromHTML(_0x329292,_0x2fde08);var _0x182c9c=_0x2cb597[_0x9924('0x3b')](_0x44e493);return writePDFDocument(_0x182c9c,_0x2fde08['path'])[_0x9924('0x5a')](function(_0x5846a4){throw _0x5846a4;});}; \ No newline at end of file +var _0x374b=['path','moment','html-to-pdfmake','zip-dir','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','push','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','landscape','footer','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','sequelize','dirname','basename','.pdf','existsSync','mkdirSync','join','flatten','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','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-bold.ttf','%s\x20#%d','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','util'];(function(_0x206d7d,_0x296bee){var _0xcba6ff=function(_0x10109b){while(--_0x10109b){_0x206d7d['push'](_0x206d7d['shift']());}};_0xcba6ff(++_0x296bee);}(_0x374b,0x173));var _0xb374=function(_0x36c017,_0x5b29ff){_0x36c017=_0x36c017-0x0;var _0xeaf343=_0x374b[_0x36c017];return _0xeaf343;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xb374('0x0'));var path=require(_0xb374('0x1'));var moment=require(_0xb374('0x2'));var htmlToPdfmake=require(_0xb374('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xb374('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0xb374('0x5'))['JSDOM'];var window=new JSDOM('')[_0xb374('0x6')];var BPromise=require(_0xb374('0x7'));var db=require(_0xb374('0x8'))['db'];var dbH=require(_0xb374('0x8'))[_0xb374('0x9')];var logger=require(_0xb374('0xa'))(_0xb374('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xb374('0xc')][0x3];var PATH=process[_0xb374('0xc')][0x4];var NAME=process[_0xb374('0xc')][0x5];var FORMAT=_0xb374('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x46175c,_0x4a1a63){var _0x397369={'status':_0x46175c};var _0x14f167={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a1a63){_0x397369[_0xb374('0xe')]=_0x4a1a63;}return db[_0xb374('0xf')]['update'](_0x397369,_0x14f167);}function getHeaders(_0x42bc9f){return _[_0xb374('0x10')](_0x42bc9f,function(_0xf04759){return{'text':_0xf04759,'style':_0xb374('0x11')};});}function getRows(_0x202b36,_0x31c3e7){return _['map'](_0x31c3e7,function(_0x52d142){return _(_0x52d142)[_0xb374('0x12')](_0x202b36)[_0xb374('0x10')](function(_0x4ac19e){return _0x4ac19e?_[_0xb374('0x13')](_0x4ac19e):'';})[_0xb374('0x14')]();});}function createTable(_0x1ef778,_0x27a1a8){var _0x4bfb43={'widths':_[_0xb374('0x15')](Array(_0x1ef778[_0xb374('0x16')]),0x91),'heights':function(_0xdf74f9){return _0xdf74f9===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x135e37=getHeaders(_0x1ef778);_0x4bfb43['body'][_0xb374('0x17')](_0x135e37);var _0x24153e=getRows(_0x1ef778,_0x27a1a8);_0x4bfb43[_0xb374('0x18')]=_0x4bfb43['body'][_0xb374('0x19')](_0x24153e);return _0x4bfb43;}function createTables(_0x4d1dd1){var _0x4bd782=[];var _0x35a4a8=_[_0xb374('0x1a')](Object[_0xb374('0x1b')](_0x4d1dd1[0x0]),0x5);_0x35a4a8[_0xb374('0x1c')](function(_0x405596){_0x4bd782[_0xb374('0x17')](createTable(_0x405596,_0x4d1dd1));});return _0x4bd782;}function getPDFDocDefinition(_0x54ed70){var _0x498f8f=util[_0xb374('0x1d')](_0xb374('0x1e'),NAME,EXTRACTED_REPORT[_0xb374('0x1f')],moment(EXTRACTED_REPORT[_0xb374('0x20')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xb374('0x21')])[_0xb374('0x1d')](FORMAT));var _0x414f44=[];for(var _0x3617a4=0x0;_0x3617a4<_0x54ed70[_0xb374('0x16')];_0x3617a4++){var _0x2f067d=[];if(_0x3617a4===0x0){_0x2f067d[_0xb374('0x17')]({'text':_0x498f8f,'style':'header'});}var _0x20e2b7={'table':_0x54ed70[_0x3617a4]};if(_0x3617a4>0x0){_0x20e2b7[_0xb374('0x22')]=_0xb374('0x23');_0x20e2b7['margin']=[0x0,0x46,0x0,0x0];}_0x2f067d[_0xb374('0x17')](_0x20e2b7);_0x414f44[_0xb374('0x17')](_0x2f067d);}return{'pageSize':'A4','pageOrientation':_0xb374('0x24'),'content':_0x414f44,'footer':function(_0x888b67,_0x494a49){return{'text':_0x888b67['toString']()+'\x20/\x20'+_0x494a49,'style':_0xb374('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb374('0x26')},'footer':{'alignment':_0xb374('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xaa4f3d){var _0x199076=0x1388;var _0x14158c;if(!_0xaa4f3d[0x0][_0xb374('0x28')]){return analyticExtractedReport(_0xb374('0x29'));}return db[_0xb374('0x2a')][_0xb374('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb374('0x2c')]})['then'](function(_0x59d89b){if(_0x59d89b){_0x14158c=_0x59d89b;_0x199076=_0x14158c[_0xb374('0x2c')]||0x3e8;}})[_0xb374('0x2d')](function(){var _0x574f61=[];var _0x228671=0x0;if(_0x14158c[_0xb374('0x2e')]){if(_0xaa4f3d&&_0xaa4f3d['length']){var _0xa1d7b1=_[_0xb374('0x2f')](_0xaa4f3d[0x0]['num']/_0x199076);var _0x8df3b6=Number['isInteger'](_0xaa4f3d[0x0][_0xb374('0x28')]/_0x199076)?_0xaa4f3d[0x0]['num']%_0x199076:0x0;_0xa1d7b1[_0xb374('0x1c')](function(_0x56c766){if(_0x56c766>0x0){_0x228671+=_0x199076;}_0x574f61['push'](dbH['sequelize'][_0xb374('0x30')](util[_0xb374('0x1d')](_0xb374('0x31'),QUERY,_0x199076,_0x228671),{'type':dbH['sequelize'][_0xb374('0x32')][_0xb374('0x33')]}));});if(_0x8df3b6>0x0){_0x228671+=_0x199076;_0x574f61[_0xb374('0x17')](dbH['sequelize'][_0xb374('0x30')](util['format'](_0xb374('0x31'),QUERY,_0x8df3b6,_0x228671),{'type':dbH[_0xb374('0x34')][_0xb374('0x32')]['SELECT']}));}}}else{_0x574f61['push'](dbH[_0xb374('0x34')]['query'](QUERY,{'type':dbH['sequelize'][_0xb374('0x32')]['SELECT']}));}var _0x409b9d=path[_0xb374('0x35')](PATH);var _0x10bb5c=path[_0xb374('0x36')](PATH,_0xb374('0x37'));var _0x2496b0=_0x14158c[_0xb374('0x2e')]&&_0x574f61[_0xb374('0x16')]>0x1;var _0x52d7a0=[];if(!fs[_0xb374('0x38')](path['join'](_0x409b9d,_0x10bb5c))&&_0x2496b0){fs[_0xb374('0x39')](path[_0xb374('0x3a')](_0x409b9d,_0x10bb5c));}return BPromise['each'](_0x574f61,function(_0x3e6db6){_0x52d7a0[_0xb374('0x17')](_0x3e6db6);})['then'](function(){var _0x468645=[];for(var _0x4c6ffa=0x0;_0x4c6ffa<_0x52d7a0[_0xb374('0x16')];_0x4c6ffa+=0x1){var _0x14b984=_0x52d7a0[_0x4c6ffa];var _0x458f94=createTables(_[_0xb374('0x3b')](_0x14b984));var _0x5e5ca8;var _0x997445=getPDFDocDefinition(_0x458f94);var _0x23f046=getPDFPrinter();var _0x4ed39e=_0x23f046['createPdfKitDocument'](_0x997445);if(_0x2496b0){_0x5e5ca8=path['join'](_0x409b9d,_0x10bb5c,util['format'](_0xb374('0x3c'),_0x10bb5c,_0x4c6ffa,'pdf'));}else{_0x5e5ca8=path[_0xb374('0x3a')](_0x409b9d,util[_0xb374('0x1d')](_0xb374('0x3d'),_0x10bb5c,_0xb374('0x3e')));}_0x468645[_0xb374('0x17')](writePDFDocument(_0x4ed39e,_0x5e5ca8));}return Promise[_0xb374('0x3f')](_0x468645);})['then'](function(){if(_0x2496b0){return new Promise(function(_0x3f8685){zipdir(path[_0xb374('0x3a')](_0x409b9d,_0x10bb5c),{'saveTo':path[_0xb374('0x3a')](_0x409b9d,util[_0xb374('0x1d')](_0xb374('0x3d'),_0x10bb5c,_0xb374('0x40')))},function(){rimraf(path[_0xb374('0x3a')](_0x409b9d,_0x10bb5c),function(){});_0x3f8685(_0xb374('0x41'));});});}})['then'](function(){if(!_0x2496b0)return;rimraf(path[_0xb374('0x3a')](_0x409b9d,_0x10bb5c),function(){});})['then'](function(){logger[_0xb374('0x42')](util[_0xb374('0x1d')](_0xb374('0x43'),EXTRACTED_REPORT_ID,_0xb374('0x44')));return analyticExtractedReport(_0xb374('0x45'),_0x2496b0?util[_0xb374('0x1d')](_0xb374('0x3d'),_0x10bb5c,_0x2496b0?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb374('0x42')](util[_0xb374('0x1d')](_0xb374('0x46'),EXTRACTED_REPORT_ID,_0xb374('0x44')));return db[_0xb374('0xf')][_0xb374('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x8fb82f){EXTRACTED_REPORT=_0x8fb82f;return dbH[_0xb374('0x34')][_0xb374('0x30')](util['format'](_0xb374('0x48'),QUERY),{'type':dbH['sequelize'][_0xb374('0x32')][_0xb374('0x33')]});})[_0xb374('0x2d')](extractReport)[_0xb374('0x49')](function(_0x30ea99){logger[_0xb374('0x42')](util[_0xb374('0x1d')](_0xb374('0x4a'),EXTRACTED_REPORT_ID,_0xb374('0x44')),util[_0xb374('0x4b')](_0x30ea99,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb374('0x4c'));})[_0xb374('0x4d')](function(){process[_0xb374('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x213177=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xb374('0x4f'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x213177;}function getPDFDocDefinitionFromHTML(_0x314af1,_0x2afec7){var _0x20654d=util[_0xb374('0x1d')](_0xb374('0x50'),_0x2afec7['channel'],_0x2afec7['interactionId']);var _0x3abbcd=moment()[_0xb374('0x1d')](_0xb374('0x51'))[_0xb374('0x13')]();var _0x21c06c=htmlToPdfmake(_0x314af1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x21c06c],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb374('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb374('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xb374('0x53'),'style':_0xb374('0x54')}];},'footer':function(_0x92810f,_0x42fbd6){return[{'text':util[_0xb374('0x1d')](_0xb374('0x55'),_0x20654d,_0x92810f,_0x42fbd6,_0x3abbcd),'style':_0xb374('0x25')}];}};}function writePDFDocument(_0x171e02,_0xf74d03){return new Promise(function(_0x4b052c,_0x288421){var _0x13d7b0=_0x171e02[_0xb374('0x56')](fs[_0xb374('0x57')](_0xf74d03));_0x13d7b0['on'](_0xb374('0x58'),function(){_0x4b052c(_0xb374('0x58'));});_0x13d7b0['on'](_0xb374('0x59'),function(_0x5ce865){_0x288421(_0x5ce865);});_0x171e02[_0xb374('0x5a')]();});}exports[_0xb374('0x5b')]=function(_0x30822c,_0xe60333){var _0x3c9b9f=getPDFPrinter();var _0x4ace0d=getPDFDocDefinitionFromHTML(_0x30822c,_0xe60333);var _0x5f5372=_0x3c9b9f[_0xb374('0x5c')](_0x4ace0d);return writePDFDocument(_0x5f5372,_0xe60333[_0xb374('0x1')])[_0xb374('0x49')](function(_0x165814){throw _0x165814;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 47734a1..dc4f97f 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 _0x7e22=['inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','mkdirSync','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x3ce54d,_0x2aabcb){var _0x387f35=function(_0x12424d){while(--_0x12424d){_0x3ce54d['push'](_0x3ce54d['shift']());}};_0x387f35(++_0x2aabcb);}(_0x7e22,0x1d8));var _0x27e2=function(_0x4752b6,_0x517625){_0x4752b6=_0x4752b6-0x0;var _0x23dea4=_0x7e22[_0x4752b6];return _0x23dea4;};'use strict';var util=require(_0x27e2('0x0'));var path=require('path');var _=require(_0x27e2('0x1'));var fs=require('fs');var json2xls=require(_0x27e2('0x2'));var BPromise=require(_0x27e2('0x3'));var zipdir=require(_0x27e2('0x4'));var rimraf=require(_0x27e2('0x5'));var db=require(_0x27e2('0x6'))['db'];var dbH=require('../../mysqldb')[_0x27e2('0x7')];var logger=require('../../config/logger')(_0x27e2('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x27e2('0x9')][0x2]);var QUERY=process[_0x27e2('0x9')][0x3];var PATH=process[_0x27e2('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x54c99e,_0x207ab6){var _0x419985={'status':_0x54c99e};var _0x44cf2e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x207ab6){_0x419985[_0x27e2('0xa')]=_0x207ab6;}return db[_0x27e2('0xb')][_0x27e2('0xc')](_0x419985,_0x44cf2e);}function main(){var _0x1892a9=0x1388;var _0x256eac;logger['info'](util[_0x27e2('0xd')](_0x27e2('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x27e2('0xf')][_0x27e2('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x27e2('0x11'),_0x27e2('0x12')]})['then'](function(_0x1d57b7){if(_0x1d57b7){_0x256eac=_0x1d57b7;_0x1892a9=_0x256eac['splitSizeXlsx']||0x1388;}})[_0x27e2('0x13')](function(){return dbH[_0x27e2('0x14')][_0x27e2('0x15')](util[_0x27e2('0xd')](_0x27e2('0x16'),QUERY),{'type':dbH['sequelize'][_0x27e2('0x17')]['SELECT']});})[_0x27e2('0x13')](function(_0x5c625){if(!_0x5c625[0x0][_0x27e2('0x18')]){return analyticExtractedReport(_0x27e2('0x19'));}var _0x3499e2=[];var _0x20ed2c=0x0;if(_0x256eac[_0x27e2('0x11')]){if(_0x5c625&&_0x5c625[_0x27e2('0x1a')]){var _0x4ee164=_['range'](_0x5c625[0x0][_0x27e2('0x18')]/_0x1892a9);var _0x1c5847=Number['isInteger'](_0x5c625[0x0][_0x27e2('0x18')]/_0x1892a9)?_0x5c625[0x0][_0x27e2('0x18')]%_0x1892a9:0x0;_0x4ee164[_0x27e2('0x1b')](function(_0x223ceb){if(_0x223ceb>0x0){_0x20ed2c+=_0x1892a9;}_0x3499e2[_0x27e2('0x1c')](dbH['sequelize'][_0x27e2('0x15')](util[_0x27e2('0xd')](_0x27e2('0x1d'),QUERY,_0x1892a9,_0x20ed2c),{'type':dbH['sequelize'][_0x27e2('0x17')][_0x27e2('0x1e')]}));});if(_0x1c5847>0x0){_0x20ed2c+=_0x1892a9;_0x3499e2['push'](dbH['sequelize'][_0x27e2('0x15')](util[_0x27e2('0xd')](_0x27e2('0x1d'),QUERY,_0x1c5847,_0x20ed2c),{'type':dbH[_0x27e2('0x14')][_0x27e2('0x17')][_0x27e2('0x1e')]}));}}}else{_0x3499e2[_0x27e2('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x27e2('0x14')][_0x27e2('0x17')][_0x27e2('0x1e')]}));}var _0x270cf3=path[_0x27e2('0x1f')](PATH);var _0x20cf21=path['basename'](PATH,_0x27e2('0x20'));var _0x30b0a9=_0x256eac['split']&&_0x3499e2[_0x27e2('0x1a')]>0x1;var _0x361ba5=[];if(!fs['existsSync'](path['join'](_0x270cf3,_0x20cf21))&&_0x30b0a9){fs[_0x27e2('0x21')](path[_0x27e2('0x22')](_0x270cf3,_0x20cf21));}return BPromise[_0x27e2('0x23')](_0x3499e2,function(_0x46ca56){_0x361ba5[_0x27e2('0x1c')](_0x46ca56);})[_0x27e2('0x13')](function(){for(var _0x175c05=0x0;_0x175c05<_0x361ba5[_0x27e2('0x1a')];_0x175c05+=0x1){var _0x5efbd5;var _0x5000f4=_0x361ba5[_0x175c05];if(_0x30b0a9){_0x5efbd5=path[_0x27e2('0x22')](_0x270cf3,_0x20cf21,util['format'](_0x27e2('0x24'),_0x20cf21,_0x175c05,'xlsx'));}else{_0x5efbd5=path[_0x27e2('0x22')](_0x270cf3,util[_0x27e2('0xd')](_0x27e2('0x25'),_0x20cf21,_0x27e2('0x26')));}fs[_0x27e2('0x27')](_0x5efbd5,json2xls(_0x5000f4),_0x27e2('0x28'));}})['then'](function(){if(_0x30b0a9){return new Promise(function(_0x1eb259){zipdir(path['join'](_0x270cf3,_0x20cf21),{'saveTo':path['join'](_0x270cf3,util[_0x27e2('0xd')](_0x27e2('0x25'),_0x20cf21,_0x27e2('0x29')))},function(_0x44623f,_0x5811ff){rimraf(path[_0x27e2('0x22')](_0x270cf3,_0x20cf21),function(){});_0x1eb259(_0x27e2('0x2a'));});});}})[_0x27e2('0x13')](function(){logger[_0x27e2('0x2b')](util[_0x27e2('0xd')](_0x27e2('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x30b0a9?util[_0x27e2('0xd')]('%s.%s',_0x20cf21,_0x30b0a9?_0x27e2('0x29'):'xlsx'):null);});})[_0x27e2('0x2d')](function(_0x805658){logger['info'](util['format'](_0x27e2('0x2e'),EXTRACTED_REPORT_ID,_0x27e2('0x2f')),util[_0x27e2('0x30')](_0x805658,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x27e2('0x31'));})[_0x27e2('0x32')](function(){process[_0x27e2('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd65c=['savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','split','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xd65c,0x177));var _0xcd65=function(_0x56c445,_0x3b5b87){_0x56c445=_0x56c445-0x0;var _0x5d729a=_0xd65c[_0x56c445];return _0x5d729a;};'use strict';var util=require(_0xcd65('0x0'));var path=require(_0xcd65('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xcd65('0x2'));var zipdir=require(_0xcd65('0x3'));var rimraf=require(_0xcd65('0x4'));var db=require(_0xcd65('0x5'))['db'];var dbH=require(_0xcd65('0x5'))[_0xcd65('0x6')];var logger=require(_0xcd65('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcd65('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcd65('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3a6b70,_0x1a3ac4){var _0x1dbaaf={'status':_0x3a6b70};var _0x4d93f4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1a3ac4){_0x1dbaaf[_0xcd65('0x9')]=_0x1a3ac4;}return db['AnalyticExtractedReport'][_0xcd65('0xa')](_0x1dbaaf,_0x4d93f4);}function main(){var _0x4e0cf2=0x1388;var _0x1979b8;logger[_0xcd65('0xb')](util[_0xcd65('0xc')](_0xcd65('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xcd65('0xe')][_0xcd65('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xcd65('0x10')]})[_0xcd65('0x11')](function(_0x3fb1e6){if(_0x3fb1e6){_0x1979b8=_0x3fb1e6;_0x4e0cf2=_0x1979b8['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xcd65('0x12')][_0xcd65('0x13')](util[_0xcd65('0xc')](_0xcd65('0x14'),QUERY),{'type':dbH[_0xcd65('0x12')][_0xcd65('0x15')][_0xcd65('0x16')]});})[_0xcd65('0x11')](function(_0x31304d){if(!_0x31304d[0x0]['num']){return analyticExtractedReport('Empty');}var _0x414297=[];var _0x475be9=0x0;if(_0x1979b8[_0xcd65('0x17')]){if(_0x31304d&&_0x31304d[_0xcd65('0x18')]){var _0x299104=_[_0xcd65('0x19')](_0x31304d[0x0][_0xcd65('0x1a')]/_0x4e0cf2);var _0x69714c=Number[_0xcd65('0x1b')](_0x31304d[0x0][_0xcd65('0x1a')]/_0x4e0cf2)?_0x31304d[0x0][_0xcd65('0x1a')]%_0x4e0cf2:0x0;_0x299104['forEach'](function(_0x3ed200){if(_0x3ed200>0x0){_0x475be9+=_0x4e0cf2;}_0x414297[_0xcd65('0x1c')](dbH[_0xcd65('0x12')][_0xcd65('0x13')](util[_0xcd65('0xc')](_0xcd65('0x1d'),QUERY,_0x4e0cf2,_0x475be9),{'type':dbH[_0xcd65('0x12')][_0xcd65('0x15')][_0xcd65('0x16')]}));});if(_0x69714c>0x0){_0x475be9+=_0x4e0cf2;_0x414297['push'](dbH[_0xcd65('0x12')][_0xcd65('0x13')](util[_0xcd65('0xc')](_0xcd65('0x1d'),QUERY,_0x69714c,_0x475be9),{'type':dbH[_0xcd65('0x12')][_0xcd65('0x15')][_0xcd65('0x16')]}));}}}else{_0x414297['push'](dbH[_0xcd65('0x12')][_0xcd65('0x13')](QUERY,{'type':dbH['sequelize'][_0xcd65('0x15')][_0xcd65('0x16')]}));}var _0x317e87=path[_0xcd65('0x1e')](PATH);var _0x3eea67=path[_0xcd65('0x1f')](PATH,'.xlsx');var _0x453d2b=_0x1979b8[_0xcd65('0x17')]&&_0x414297[_0xcd65('0x18')]>0x1;var _0x16f9c5=[];if(!fs['existsSync'](path[_0xcd65('0x20')](_0x317e87,_0x3eea67))&&_0x453d2b){fs['mkdirSync'](path['join'](_0x317e87,_0x3eea67));}return BPromise[_0xcd65('0x21')](_0x414297,function(_0x16e46c){_0x16f9c5[_0xcd65('0x1c')](_0x16e46c);})[_0xcd65('0x11')](function(){for(var _0x5e66bf=0x0;_0x5e66bf<_0x16f9c5[_0xcd65('0x18')];_0x5e66bf+=0x1){var _0x231439;var _0x2dc213=_0x16f9c5[_0x5e66bf];if(_0x453d2b){_0x231439=path[_0xcd65('0x20')](_0x317e87,_0x3eea67,util[_0xcd65('0xc')](_0xcd65('0x22'),_0x3eea67,_0x5e66bf,_0xcd65('0x23')));}else{_0x231439=path['join'](_0x317e87,util[_0xcd65('0xc')](_0xcd65('0x24'),_0x3eea67,_0xcd65('0x23')));}fs[_0xcd65('0x25')](_0x231439,json2xls(_0x2dc213),_0xcd65('0x26'));}})[_0xcd65('0x11')](function(){if(_0x453d2b){return new Promise(function(_0xa7ddcc){zipdir(path[_0xcd65('0x20')](_0x317e87,_0x3eea67),{'saveTo':path[_0xcd65('0x20')](_0x317e87,util[_0xcd65('0xc')](_0xcd65('0x24'),_0x3eea67,_0xcd65('0x27')))},function(_0x2b87a6,_0x2f5592){rimraf(path[_0xcd65('0x20')](_0x317e87,_0x3eea67),function(){});_0xa7ddcc(_0xcd65('0x28'));});});}})['then'](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcd65('0x29')));return analyticExtractedReport(_0xcd65('0x2a'),_0x453d2b?util[_0xcd65('0xc')](_0xcd65('0x24'),_0x3eea67,_0x453d2b?_0xcd65('0x27'):_0xcd65('0x23')):null);});})['catch'](function(_0x2761fa){logger[_0xcd65('0xb')](util[_0xcd65('0xc')](_0xcd65('0x2b'),EXTRACTED_REPORT_ID,_0xcd65('0x29')),util[_0xcd65('0x2c')](_0x2761fa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcd65('0x2d'));})[_0xcd65('0x2e')](function(){process[_0xcd65('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 5fc71cf..20bf55f 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 _0xe6b8=['uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','groupBy','playback','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','hasOwnProperty','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime','last','concat','Hangup','transaction','destroy','rewrite','lodash','models','Interval','findAll','intervals','VoiceExtension','IntervalId'];(function(_0x3b2edf,_0x4c77a7){var _0x5c5c00=function(_0x136202){while(--_0x136202){_0x3b2edf['push'](_0x3b2edf['shift']());}};_0x5c5c00(++_0x4c77a7);}(_0xe6b8,0x1dc));var _0x8e6b=function(_0x2d9a77,_0x863097){_0x2d9a77=_0x2d9a77-0x0;var _0xf2da22=_0xe6b8[_0x2d9a77];return _0xf2da22;};'use strict';var _=require(_0x8e6b('0x0'));var util=require('util');function rewrite(_0x3a1b32,_0x133361){var _0x174ee3=this;return _0x3a1b32[_0x8e6b('0x1')][_0x8e6b('0x2')][_0x8e6b('0x3')]({'raw':!![]})['then'](function(_0x14caef){_0x174ee3[_0x8e6b('0x4')]=_0x14caef;return _0x3a1b32[_0x8e6b('0x1')][_0x8e6b('0x5')][_0x8e6b('0x3')]({'where':{'IntervalId':_0x133361[_0x8e6b('0x6')]},'raw':!![]});})['then'](function(_0x1c17a5){return _0x3a1b32[_0x8e6b('0x1')]['VoiceExtension'][_0x8e6b('0x3')]({'where':{'exten':{'$in':_[_0x8e6b('0x7')](_[_0x8e6b('0x8')](_0x1c17a5,_0x8e6b('0x9')))}},'order':[{'raw':_0x8e6b('0xa')}],'raw':!![]});})[_0x8e6b('0xb')](function(_0x355144){var _0x4f4b55=_[_0x8e6b('0xc')](_0x355144,{'priority':'1'});var _0xad3088=_[_0x8e6b('0xc')](_0x355144,{'isApp':0x1});var _0x20481f=_[_0x8e6b('0xd')](_0xad3088,_0x8e6b('0x9'));var _0x194339=['queue',_0x8e6b('0xe')];var _0x3e985c=[];var _0xc76793=[];for(var _0x4db3b3 in _0x20481f){if(_0x20481f['hasOwnProperty'](_0x4db3b3)){_0x174ee3[_0x8e6b('0xf')]=0x2;_0x174ee3[_0x8e6b('0x10')]=[];_0x174ee3[_0x8e6b('0x11')]=_[_0x8e6b('0x12')](_0x4f4b55,{'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')]});_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':util[_0x8e6b('0x16')](_0x8e6b('0x17'),_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')]),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3['priority']++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});if(_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')]===_0x8e6b('0x1a')){_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':'Set','appdata':_0x8e6b('0x1b')+_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')],'context':_0x20481f[_0x4db3b3][0x0]['context'],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});}else if(_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')]===_0x8e6b('0x1c')){if(_0x174ee3['extension']){_0x174ee3[_0x8e6b('0x10')]['push']({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x1d')+(_0x174ee3[_0x8e6b('0x11')]['cutdigits']?'${EXTEN:'+_0x174ee3['extension'][_0x8e6b('0x1e')]+'}':'${EXTEN}'),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3['priority']++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0]['VoiceExtensionId']});}_0x174ee3[_0x8e6b('0x10')]['push']({'type':_0x20481f[_0x4db3b3][0x0]['type'],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x1b')+_0x20481f[_0x4db3b3][0x0]['VoiceExtensionId'],'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});var _0x5c7ed4=_0x174ee3[_0x8e6b('0xf')]++;_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x1f'),'appdata':_0x8e6b('0x20')+(_0x5c7ed4+0x2)+_0x8e6b('0x21')+(_0x5c7ed4+0x1)+')','context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x5c7ed4,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0]['VoiceExtensionId']});if(_0x174ee3[_0x8e6b('0x11')]){_0x174ee3['extensions'][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0]['type'],'app':_0x8e6b('0x15'),'appdata':_0x174ee3[_0x8e6b('0x11')]['cutdigits']?_0x8e6b('0x22')+_0x174ee3[_0x8e6b('0x11')]['cutdigits']+'}':_0x8e6b('0x23'),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});}_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':'outboundrouteid='+_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')],'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});if(_0x174ee3[_0x8e6b('0x11')]&&_0x174ee3['extension']['hasOwnProperty'](_0x8e6b('0x24'))&&_0x174ee3[_0x8e6b('0x11')][_0x8e6b('0x24')]!==_0x8e6b('0x25')){_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x26'),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3['priority']++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});_0x174ee3['extensions'][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x27')+_0x174ee3[_0x8e6b('0x11')]['recordingFormat']||_0x8e6b('0x28'),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0]['exten'],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0]['VoiceExtensionId']});}}_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0]['type'],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x29'),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0]['exten'],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});_0x174ee3['extensions']['push']({'type':_0x20481f[_0x4db3b3][0x0]['type'],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x2a'),'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'exten':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x9')],'priority':_0x174ee3['priority']++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0]['VoiceExtensionId']});_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0x20481f[_0x4db3b3][0x0]['context'],'exten':_0x20481f[_0x4db3b3][0x0]['exten'],'priority':_0x174ee3[_0x8e6b('0xf')]++,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0]['VoiceExtensionId']});for(var _0x45d3ab=0x0,_0x2a6f23=0x0;_0x45d3ab<_0x20481f[_0x4db3b3][_0x8e6b('0x2b')];_0x45d3ab+=0x1,_0x2a6f23=0x0){var _0x331812=_0x20481f[_0x4db3b3][_0x45d3ab];if(_0x331812['type']){_0x331812['type']=_0x331812['type'][_0x8e6b('0x2c')]();}var _0x4fa1a9=[];var _0x142b87=[];delete _0x331812['id'];delete _0x331812[_0x8e6b('0x2d')];delete _0x331812[_0x8e6b('0x2e')];var _0x3318b3=_0x331812[_0x8e6b('0x2f')]!==_0x8e6b('0x30')?[_0x331812[_0x8e6b('0x2f')]]:_0x331812['IntervalId']?_[_0x8e6b('0x8')](_[_0x8e6b('0xc')](_0x174ee3['intervals'],{'IntervalId':_0x331812['IntervalId']}),_0x8e6b('0x2f')):[];if(_0x331812[_0x8e6b('0x31')](_0x8e6b('0x32'))){if(_0x331812['tag']&&_0x331812['tag']!=='--'){_0x4fa1a9[_0x8e6b('0x13')]({'type':_0x331812['type'],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x33')+_0x331812[_0x8e6b('0x32')],'context':_0x331812[_0x8e6b('0x18')],'exten':_0x331812[_0x8e6b('0x9')],'priority':_0x3318b3[_0x8e6b('0x2b')]+_0x174ee3[_0x8e6b('0xf')]+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});}}if(_0x331812[_0x8e6b('0x14')]===_0x8e6b('0x1c')&&_0x331812['hasOwnProperty'](_0x8e6b('0x34'))){if(_0x331812[_0x8e6b('0x34')]){_0x4fa1a9[_0x8e6b('0x13')]({'type':_0x331812[_0x8e6b('0x14')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x331812['callerID']+')','context':_0x331812[_0x8e6b('0x18')],'exten':_0x331812[_0x8e6b('0x9')],'priority':_0x3318b3[_0x8e6b('0x2b')]+_0x174ee3['priority']+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});}else{_0x4fa1a9[_0x8e6b('0x13')]({'type':_0x331812['type'],'app':_0x8e6b('0x1f'),'appdata':_0x8e6b('0x35'),'context':_0x331812[_0x8e6b('0x18')],'exten':_0x331812['exten'],'priority':_0x3318b3[_0x8e6b('0x2b')]+_0x174ee3[_0x8e6b('0xf')]+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});}}if(_0x331812[_0x8e6b('0x31')](_0x8e6b('0x36'))){if(_0x194339[_0x8e6b('0x37')](_0x331812[_0x8e6b('0x38')][_0x8e6b('0x2c')]())>=0x0&&_0x331812[_0x8e6b('0x39')]!==_0x8e6b('0x3a')){if(_0x331812[_0x8e6b('0x36')]){_0x4fa1a9[_0x8e6b('0x13')]({'type':_0x331812[_0x8e6b('0x14')],'app':'ExecIf','appdata':_0x8e6b('0x3b'),'context':_0x331812['context'],'exten':_0x331812['exten'],'priority':_0x3318b3[_0x8e6b('0x2b')]+_0x174ee3['priority']+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});_0x4fa1a9[_0x8e6b('0x13')]({'type':_0x331812[_0x8e6b('0x14')],'app':_0x8e6b('0x15'),'appdata':_0x8e6b('0x3c'),'context':_0x331812[_0x8e6b('0x18')],'exten':_0x331812[_0x8e6b('0x9')],'priority':_0x3318b3[_0x8e6b('0x2b')]+_0x174ee3[_0x8e6b('0xf')]+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});}else{_0x4fa1a9['push']({'type':_0x331812['type'],'app':_0x8e6b('0x1f'),'appdata':_0x8e6b('0x3d'),'context':_0x331812['context'],'exten':_0x331812[_0x8e6b('0x9')],'priority':_0x3318b3[_0x8e6b('0x2b')]+_0x174ee3[_0x8e6b('0xf')]+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});_0x4fa1a9['push']({'type':_0x331812['type'],'app':_0x8e6b('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x331812[_0x8e6b('0x18')],'exten':_0x331812[_0x8e6b('0x9')],'priority':_0x3318b3['length']+_0x174ee3[_0x8e6b('0xf')]+_0x2a6f23++,'VoiceExtensionId':_0x331812[_0x8e6b('0x19')]});}}}for(var _0x381c3d=0x0;_0x381c3d<_0x3318b3[_0x8e6b('0x2b')];_0x381c3d+=0x1){var _0x45a46e=_0x174ee3[_0x8e6b('0xf')]+_0x3318b3[_0x8e6b('0x2b')];var _0x43dc78=_0x381c3d===_0x3318b3[_0x8e6b('0x2b')]-0x1?_0x174ee3[_0x8e6b('0xf')]+_0x4fa1a9[_0x8e6b('0x2b')]+_0x142b87[_0x8e6b('0x2b')]+0x2:_0x174ee3[_0x8e6b('0xf')]+_0x381c3d+0x1;_0x4fa1a9['splice'](_0x381c3d,0x0,{'type':_0x331812[_0x8e6b('0x14')],'app':_0x8e6b('0x3e'),'appdata':_0x3318b3[_0x381c3d]+'?'+_0x331812['context']+',${EXTEN},'+_0x45a46e+':'+_0x331812[_0x8e6b('0x18')]+',${EXTEN},'+_0x43dc78,'exten':_0x331812[_0x8e6b('0x9')],'context':_0x331812['context'],'priority':_0x174ee3[_0x8e6b('0xf')]+_0x381c3d,'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});}_0x331812['priority']=_0x4fa1a9[_0x8e6b('0x2b')]?_['last'](_0x4fa1a9)[_0x8e6b('0xf')]+0x1:_0x174ee3[_0x8e6b('0xf')];_0x174ee3['priority']=(_0x142b87[_0x8e6b('0x2b')]?_[_0x8e6b('0x3f')](_0x142b87)[_0x8e6b('0xf')]:_0x331812[_0x8e6b('0xf')])+0x1;_0x174ee3['extensions']=_[_0x8e6b('0x40')](_0x174ee3[_0x8e6b('0x10')],_0x4fa1a9,[_0x331812],_0x142b87);}_0x174ee3[_0x8e6b('0x10')][_0x8e6b('0x13')]({'type':_0x20481f[_0x4db3b3][0x0]['type'],'app':_0x8e6b('0x41'),'exten':_0x20481f[_0x4db3b3][0x0]['exten'],'context':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x18')],'priority':_0x174ee3['priority'],'VoiceExtensionId':_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]});_0x3e985c[_0x8e6b('0x13')](_0x20481f[_0x4db3b3][0x0][_0x8e6b('0x19')]);_0xc76793=_[_0x8e6b('0x40')](_0xc76793,_0x174ee3[_0x8e6b('0x10')]);}}return _0x3a1b32[_0x8e6b('0x42')](function(_0x502a17){return _0x3a1b32[_0x8e6b('0x1')][_0x8e6b('0x5')][_0x8e6b('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x3e985c}},'transaction':_0x502a17})[_0x8e6b('0xb')](function(_0x1bb18e){return _0x3a1b32[_0x8e6b('0x1')][_0x8e6b('0x5')]['bulkCreate'](_['sortBy'](_0xc76793,_0x8e6b('0xf')),{'transaction':_0x502a17});});});})['catch'](function(_0x55763a){console['error'](_0x55763a);});}exports[_0x8e6b('0x44')]=rewrite; \ No newline at end of file +var _0xf2df=['last','concat','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','uniq','map','filter','groupBy','queue','playback','priority','extensions','extension','exten','push','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','Set','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','createdAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','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)','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},'];(function(_0x11e9e0,_0x423474){var _0x4e743c=function(_0x2f7608){while(--_0x2f7608){_0x11e9e0['push'](_0x11e9e0['shift']());}};_0x4e743c(++_0x423474);}(_0xf2df,0x15b));var _0xff2d=function(_0x7ceb9c,_0x593f86){_0x7ceb9c=_0x7ceb9c-0x0;var _0x3f3bf2=_0xf2df[_0x7ceb9c];return _0x3f3bf2;};'use strict';var _=require(_0xff2d('0x0'));var util=require(_0xff2d('0x1'));function rewrite(_0x5ee59a,_0x156776){var _0x307c97=this;return _0x5ee59a[_0xff2d('0x2')][_0xff2d('0x3')][_0xff2d('0x4')]({'raw':!![]})['then'](function(_0x3707b9){_0x307c97[_0xff2d('0x5')]=_0x3707b9;return _0x5ee59a[_0xff2d('0x2')]['VoiceExtension'][_0xff2d('0x4')]({'where':{'IntervalId':_0x156776['IntervalId']},'raw':!![]});})['then'](function(_0x467e4e){return _0x5ee59a[_0xff2d('0x2')][_0xff2d('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xff2d('0x7')](_[_0xff2d('0x8')](_0x467e4e,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x4cb936){var _0x4d3696=_[_0xff2d('0x9')](_0x4cb936,{'priority':'1'});var _0x3ad843=_[_0xff2d('0x9')](_0x4cb936,{'isApp':0x1});var _0x4d9d8f=_[_0xff2d('0xa')](_0x3ad843,'exten');var _0x29f5a8=[_0xff2d('0xb'),_0xff2d('0xc')];var _0x3f28f6=[];var _0xac172b=[];for(var _0x27132c in _0x4d9d8f){if(_0x4d9d8f['hasOwnProperty'](_0x27132c)){_0x307c97[_0xff2d('0xd')]=0x2;_0x307c97[_0xff2d('0xe')]=[];_0x307c97[_0xff2d('0xf')]=_['find'](_0x4d3696,{'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')]});_0x307c97['extensions'][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')]),'context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});if(_0x4d9d8f[_0x27132c][0x0]['type']===_0xff2d('0x15')){_0x307c97[_0xff2d('0xe')]['push']({'type':_0x4d9d8f[_0x27132c][0x0]['type'],'app':'Set','appdata':_0xff2d('0x16')+_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')],'context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId']});}else if(_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')]===_0xff2d('0x17')){if(_0x307c97[_0xff2d('0xf')]){_0x307c97['extensions']['push']({'type':_0x4d9d8f[_0x27132c][0x0]['type'],'app':_0xff2d('0x18'),'appdata':'CDR(destination)='+(_0x307c97[_0xff2d('0xf')][_0xff2d('0x19')]?_0xff2d('0x1a')+_0x307c97[_0xff2d('0xf')][_0xff2d('0x19')]+'}':_0xff2d('0x1b')),'context':_0x4d9d8f[_0x27132c][0x0]['context'],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId']});}_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x16')+_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')],'context':_0x4d9d8f[_0x27132c][0x0]['context'],'exten':_0x4d9d8f[_0x27132c][0x0]['exten'],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});var _0x1627e4=_0x307c97[_0xff2d('0xd')]++;_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0]['type'],'app':_0xff2d('0x1c'),'appdata':_0xff2d('0x1d')+(_0x1627e4+0x2)+_0xff2d('0x1e')+(_0x1627e4+0x1)+')','context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0]['exten'],'priority':_0x1627e4,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId']});if(_0x307c97[_0xff2d('0xf')]){_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':_0xff2d('0x18'),'appdata':_0x307c97[_0xff2d('0xf')][_0xff2d('0x19')]?_0xff2d('0x1f')+_0x307c97[_0xff2d('0xf')][_0xff2d('0x19')]+'}':'CDR(prefix)=noprefix','context':_0x4d9d8f[_0x27132c][0x0]['context'],'exten':_0x4d9d8f[_0x27132c][0x0]['exten'],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId']});}_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0]['type'],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x20')+_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId'],'context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});if(_0x307c97['extension']&&_0x307c97[_0xff2d('0xf')][_0xff2d('0x21')](_0xff2d('0x22'))&&_0x307c97[_0xff2d('0xf')][_0xff2d('0x22')]!==_0xff2d('0x23')){_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x24'),'context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});_0x307c97[_0xff2d('0xe')]['push']({'type':_0x4d9d8f[_0x27132c][0x0]['type'],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x25')+_0x307c97[_0xff2d('0xf')][_0xff2d('0x22')]||'wav','context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0]['exten'],'priority':_0x307c97['priority']++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId']});}}_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x26'),'context':_0x4d9d8f[_0x27132c][0x0]['context'],'exten':_0x4d9d8f[_0x27132c][0x0]['exten'],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});_0x307c97['extensions'][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x27'),'context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});_0x307c97[_0xff2d('0xe')][_0xff2d('0x11')]({'type':_0x4d9d8f[_0x27132c][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'exten':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x10')],'priority':_0x307c97[_0xff2d('0xd')]++,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});for(var _0x29f4e5=0x0,_0x860e82=0x0;_0x29f4e5<_0x4d9d8f[_0x27132c]['length'];_0x29f4e5+=0x1,_0x860e82=0x0){var _0x30a64=_0x4d9d8f[_0x27132c][_0x29f4e5];if(_0x30a64[_0xff2d('0x12')]){_0x30a64['type']=_0x30a64['type']['toLowerCase']();}var _0x11df45=[];var _0x567d58=[];delete _0x30a64['id'];delete _0x30a64[_0xff2d('0x28')];delete _0x30a64['updatedAt'];var _0xf15ba5=_0x30a64[_0xff2d('0x29')]!==_0xff2d('0x2a')?[_0x30a64[_0xff2d('0x29')]]:_0x30a64[_0xff2d('0x2b')]?_[_0xff2d('0x8')](_[_0xff2d('0x9')](_0x307c97['intervals'],{'IntervalId':_0x30a64[_0xff2d('0x2b')]}),_0xff2d('0x29')):[];if(_0x30a64[_0xff2d('0x21')](_0xff2d('0x2c'))){if(_0x30a64[_0xff2d('0x2c')]&&_0x30a64[_0xff2d('0x2c')]!=='--'){_0x11df45[_0xff2d('0x11')]({'type':_0x30a64[_0xff2d('0x12')],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x2d')+_0x30a64['tag'],'context':_0x30a64[_0xff2d('0x13')],'exten':_0x30a64[_0xff2d('0x10')],'priority':_0xf15ba5[_0xff2d('0x2e')]+_0x307c97[_0xff2d('0xd')]+_0x860e82++,'VoiceExtensionId':_0x30a64['VoiceExtensionId']});}}if(_0x30a64[_0xff2d('0x12')]===_0xff2d('0x17')&&_0x30a64[_0xff2d('0x21')](_0xff2d('0x2f'))){if(_0x30a64[_0xff2d('0x2f')]){_0x11df45['push']({'type':_0x30a64[_0xff2d('0x12')],'app':'ExecIf','appdata':_0xff2d('0x30')+_0x30a64[_0xff2d('0x2f')]+')','context':_0x30a64[_0xff2d('0x13')],'exten':_0x30a64[_0xff2d('0x10')],'priority':_0xf15ba5[_0xff2d('0x2e')]+_0x307c97[_0xff2d('0xd')]+_0x860e82++,'VoiceExtensionId':_0x30a64[_0xff2d('0x14')]});}else{_0x11df45[_0xff2d('0x11')]({'type':_0x30a64[_0xff2d('0x12')],'app':_0xff2d('0x1c'),'appdata':_0xff2d('0x31'),'context':_0x30a64[_0xff2d('0x13')],'exten':_0x30a64['exten'],'priority':_0xf15ba5[_0xff2d('0x2e')]+_0x307c97[_0xff2d('0xd')]+_0x860e82++,'VoiceExtensionId':_0x30a64[_0xff2d('0x14')]});}}if(_0x30a64['hasOwnProperty']('answer')){if(_0x29f5a8[_0xff2d('0x32')](_0x30a64[_0xff2d('0x33')][_0xff2d('0x34')]())>=0x0&&_0x30a64[_0xff2d('0x35')]!=='custom'){if(_0x30a64['answer']){_0x11df45['push']({'type':_0x30a64['type'],'app':_0xff2d('0x1c'),'appdata':_0xff2d('0x36'),'context':_0x30a64['context'],'exten':_0x30a64[_0xff2d('0x10')],'priority':_0xf15ba5['length']+_0x307c97[_0xff2d('0xd')]+_0x860e82++,'VoiceExtensionId':_0x30a64[_0xff2d('0x14')]});_0x11df45['push']({'type':_0x30a64[_0xff2d('0x12')],'app':'Set','appdata':_0xff2d('0x37'),'context':_0x30a64[_0xff2d('0x13')],'exten':_0x30a64[_0xff2d('0x10')],'priority':_0xf15ba5['length']+_0x307c97[_0xff2d('0xd')]+_0x860e82++,'VoiceExtensionId':_0x30a64[_0xff2d('0x14')]});}else{_0x11df45[_0xff2d('0x11')]({'type':_0x30a64[_0xff2d('0x12')],'app':_0xff2d('0x1c'),'appdata':_0xff2d('0x38'),'context':_0x30a64['context'],'exten':_0x30a64[_0xff2d('0x10')],'priority':_0xf15ba5[_0xff2d('0x2e')]+_0x307c97['priority']+_0x860e82++,'VoiceExtensionId':_0x30a64['VoiceExtensionId']});_0x11df45['push']({'type':_0x30a64['type'],'app':_0xff2d('0x18'),'appdata':_0xff2d('0x39'),'context':_0x30a64['context'],'exten':_0x30a64[_0xff2d('0x10')],'priority':_0xf15ba5[_0xff2d('0x2e')]+_0x307c97['priority']+_0x860e82++,'VoiceExtensionId':_0x30a64['VoiceExtensionId']});}}}for(var _0x54bff9=0x0;_0x54bff9<_0xf15ba5[_0xff2d('0x2e')];_0x54bff9+=0x1){var _0xa082f2=_0x307c97[_0xff2d('0xd')]+_0xf15ba5[_0xff2d('0x2e')];var _0xeb66c6=_0x54bff9===_0xf15ba5[_0xff2d('0x2e')]-0x1?_0x307c97['priority']+_0x11df45['length']+_0x567d58['length']+0x2:_0x307c97[_0xff2d('0xd')]+_0x54bff9+0x1;_0x11df45[_0xff2d('0x3a')](_0x54bff9,0x0,{'type':_0x30a64[_0xff2d('0x12')],'app':_0xff2d('0x3b'),'appdata':_0xf15ba5[_0x54bff9]+'?'+_0x30a64['context']+',${EXTEN},'+_0xa082f2+':'+_0x30a64['context']+_0xff2d('0x3c')+_0xeb66c6,'exten':_0x30a64[_0xff2d('0x10')],'context':_0x30a64[_0xff2d('0x13')],'priority':_0x307c97['priority']+_0x54bff9,'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0]['VoiceExtensionId']});}_0x30a64[_0xff2d('0xd')]=_0x11df45[_0xff2d('0x2e')]?_[_0xff2d('0x3d')](_0x11df45)[_0xff2d('0xd')]+0x1:_0x307c97[_0xff2d('0xd')];_0x307c97[_0xff2d('0xd')]=(_0x567d58['length']?_[_0xff2d('0x3d')](_0x567d58)['priority']:_0x30a64['priority'])+0x1;_0x307c97[_0xff2d('0xe')]=_[_0xff2d('0x3e')](_0x307c97['extensions'],_0x11df45,[_0x30a64],_0x567d58);}_0x307c97[_0xff2d('0xe')]['push']({'type':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x12')],'app':'Hangup','exten':_0x4d9d8f[_0x27132c][0x0]['exten'],'context':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x13')],'priority':_0x307c97[_0xff2d('0xd')],'VoiceExtensionId':_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]});_0x3f28f6[_0xff2d('0x11')](_0x4d9d8f[_0x27132c][0x0][_0xff2d('0x14')]);_0xac172b=_[_0xff2d('0x3e')](_0xac172b,_0x307c97[_0xff2d('0xe')]);}}return _0x5ee59a[_0xff2d('0x3f')](function(_0x33a0ff){return _0x5ee59a[_0xff2d('0x2')][_0xff2d('0x6')][_0xff2d('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x3f28f6}},'transaction':_0x33a0ff})['then'](function(_0x2abeba){return _0x5ee59a[_0xff2d('0x2')][_0xff2d('0x6')][_0xff2d('0x41')](_[_0xff2d('0x42')](_0xac172b,_0xff2d('0xd')),{'transaction':_0x33a0ff});});});})['catch'](function(_0x87fbf1){console['error'](_0x87fbf1);});}exports[_0xff2d('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index b1b6d1e..e0dc9b0 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 _0xe1e6=['dialCheckDuplicateType','CmList','always','sequelize','query','VoiceQueueId','all','VoiceQueue','findAll','get','Campaign','Lists','CampaignId','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','message','stringify','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','errors','length','map','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','into','cm_hopper','fromQuery','scheduledAt','createdAt','select','field','NOW()','ContactId','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','cm_hopper_black','str','outbound'];(function(_0x1ea034,_0x476985){var _0x2a16c1=function(_0x2d8a2c){while(--_0x2d8a2c){_0x1ea034['push'](_0x1ea034['shift']());}};_0x2a16c1(++_0x476985);}(_0xe1e6,0x87));var _0x6e1e=function(_0x5bff60,_0x4dda8d){_0x5bff60=_0x5bff60-0x0;var _0x3483bd=_0xe1e6[_0x5bff60];return _0x3483bd;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x6e1e('0x0'));var Papa=require('papaparse');var Redis=require(_0x6e1e('0x1'));var db=require(_0x6e1e('0x2'))['db'];var config=require(_0x6e1e('0x3'));var logger=require(_0x6e1e('0x4'))(_0x6e1e('0x5'));config[_0x6e1e('0x6')]=_[_0x6e1e('0x7')](config[_0x6e1e('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e1e('0x6')]));require(_0x6e1e('0x8'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x6e1e('0x9')][0x2]==='undefined'||process[_0x6e1e('0x9')][0x2]===_0x6e1e('0xa')){throw new Error(_0x6e1e('0xb'));}var FILEPATH=process[_0x6e1e('0x9')][0x2];if(!process[_0x6e1e('0x9')][0x3]||process['argv'][0x3]==='undefined'||process['argv'][0x3]===_0x6e1e('0xa')||!process[_0x6e1e('0x9')][0x4]||process[_0x6e1e('0x9')][0x4]===_0x6e1e('0xc')||process[_0x6e1e('0x9')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x6e1e('0xd')](process[_0x6e1e('0x9')][0x3]['split'](','),process['argv'][0x4][_0x6e1e('0xe')](','));if(!process[_0x6e1e('0x9')][0x5]||process['argv'][0x5]===_0x6e1e('0xc')||process[_0x6e1e('0x9')][0x5]===_0x6e1e('0xa')){throw new Error(_0x6e1e('0xf'));}var LISTID=process[_0x6e1e('0x9')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0x6e1e('0x9')][0x6]!=='null'?process[_0x6e1e('0x9')][0x6]:null;var DUPLICATES=process[_0x6e1e('0x9')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x6e1e('0x9')][0x7]!=='null'?process[_0x6e1e('0x9')][0x7]:null;if(!process[_0x6e1e('0x9')][0x8]||process[_0x6e1e('0x9')][0x8]===_0x6e1e('0xc')||process[_0x6e1e('0x9')][0x8]===_0x6e1e('0xa')){throw new Error(_0x6e1e('0x10'));}var SOCKET_TIMESTAMP=process[_0x6e1e('0x9')][0x8];}catch(_0x271a89){logger[_0x6e1e('0x11')](_0x271a89);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(_0xab350e,_0x313542,_0x20ae49,_0x1813ea){var _0x4cd433={'message':_0x313542};_0x4cd433[_0xab350e]=!![];if(_0x20ae49){_0x4cd433['contact']=_0x20ae49;}if(_0x1813ea){_0x4cd433[_0x6e1e('0x12')]=_0x1813ea;}return _0x4cd433;}function isEmail(_0x4f1bd8){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))*$/[_0x6e1e('0x13')](_0x4f1bd8);}function checkRow(_0x566d3c,_0x5ef74e,_0x3d8ed8){return new BPromise(function(_0x4e306b,_0xdbf568){if(_[_0x6e1e('0x14')](_0x566d3c)){return _0xdbf568(handleCheckRowError(_0x6e1e('0x11'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3d8ed8));}if(_0x566d3c[_0x6e1e('0x15')]&&_0x566d3c[_0x6e1e('0x15')][_0x6e1e('0x16')]){var _0x1155ad=_[_0x6e1e('0x17')](_0x566d3c[_0x6e1e('0x15')],'message')['join'](';');return _0xdbf568(handleCheckRowError(_0x6e1e('0x11'),_0x1155ad,null,_0x3d8ed8));}var _0xacbf01={};for(var _0x708006 in FIELDS){if(FIELDS['hasOwnProperty'](_0x708006)&&FIELDS[_0x708006]){_0xacbf01[_0x708006]=_0x566d3c[_0x6e1e('0x18')][0x0][FIELDS[_0x708006]]||_0x566d3c[_0x6e1e('0x18')][0x0]['\ufeff'+FIELDS[_0x708006]];}}if(!_0xacbf01[_0x6e1e('0x19')]){return _0xdbf568(handleCheckRowError(_0x6e1e('0x11'),_0x6e1e('0x1a'),null,_0x3d8ed8));}if(!_0xacbf01[_0x6e1e('0x1b')]){return _0xdbf568(handleCheckRowError('error',_0x6e1e('0x1c'),null,_0x3d8ed8));}if(_0xacbf01['birthDate']){var _0x2a890d=moment(_0xacbf01[_0x6e1e('0x1d')],'YYYY-MM-DD');if(!_0x2a890d[_0x6e1e('0x1e')]()){return _0xdbf568(handleCheckRowError(_0x6e1e('0x11'),_0x6e1e('0x1f'),null,_0x3d8ed8));}}if(_0xacbf01['email']){if(!isEmail(_0xacbf01[_0x6e1e('0x20')])){return _0xdbf568(handleCheckRowError(_0x6e1e('0x11'),_0x6e1e('0x21'),null,_0x3d8ed8));}}_0xacbf01[_0x6e1e('0x22')]=LISTID;_0xacbf01[_0x6e1e('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e1e('0x16')]&&_0x5ef74e){var _0x36b769={};for(var _0x46d1a7=0x0,_0x30544e=DUPLICATES[_0x6e1e('0x16')];_0x46d1a7<_0x30544e;_0x46d1a7+=0x1){_0x36b769[DUPLICATES[_0x46d1a7]]=_0xacbf01[DUPLICATES[_0x46d1a7]];}var _0xa47254=_[_0x6e1e('0x24')](_0x5ef74e,_0x36b769);if(_0xa47254){return _0xdbf568(handleCheckRowError(_0x6e1e('0x25'),_0x6e1e('0x26'),_0xa47254,_0x3d8ed8));}}return db[_0x6e1e('0x27')]['create'](_0xacbf01,{'raw':!![],'hooks':![],'fields':_[_0x6e1e('0x28')](_0xacbf01)})[_0x6e1e('0x29')](function(_0x5f9663){if(DUPLICATES&&DUPLICATES['length']&&_0x5ef74e){_0x5ef74e[_0x6e1e('0x2a')](_['pick'](_0xacbf01,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5f9663['id'];return _0x4e306b();})[_0x6e1e('0x2b')](function(_0x4deff9){return _0xdbf568(handleCheckRowError(_0x6e1e('0x11'),_0x6e1e('0x2c')+(_0x4deff9['message']||JSON['stringify'](_0x4deff9)),null,_0x3d8ed8));});});}function checkHopper(){function _0x202523(){return function(_0x159df5){logger['error'](_0x6e1e('0x2d'),_0x6e1e('0x2e'),util['inspect'](_0x159df5,{'showHidden':![],'depth':null}));};}var _0x3b5c0d=function(_0x50d568,_0x58066d){var _0x1cb974=squel['insert']()[_0x6e1e('0x2f')](_0x6e1e('0x30'))[_0x6e1e('0x31')]([_0x6e1e('0x1b'),_0x6e1e('0x32'),'ContactId',_0x6e1e('0x22'),_0x58066d,_0x6e1e('0x33'),'updatedAt'],squel[_0x6e1e('0x34')]()['field'](_0x6e1e('0x1b'),_0x6e1e('0x1b'))[_0x6e1e('0x35')](_0x6e1e('0x36'),_0x6e1e('0x32'))['field']('id',_0x6e1e('0x37'))['field'](LISTID[_0x6e1e('0x38')](),_0x6e1e('0x22'))['field'](_0x50d568['id'][_0x6e1e('0x38')](),_0x58066d)[_0x6e1e('0x35')](_0x6e1e('0x36'),_0x6e1e('0x33'))[_0x6e1e('0x35')]('NOW()',_0x6e1e('0x39'))[_0x6e1e('0x3a')](_0x6e1e('0x3b'))[_0x6e1e('0x3c')](_0x6e1e('0x3d'))[_0x6e1e('0x3c')]('ListId\x20=\x20?',LISTID[_0x6e1e('0x38')]())[_0x6e1e('0x3c')](_0x6e1e('0x3e'))[_0x6e1e('0x3c')](_0x6e1e('0x3f'),squel[_0x6e1e('0x34')]()[_0x6e1e('0x35')](_0x6e1e('0x1b'))[_0x6e1e('0x3a')](_0x6e1e('0x30'))[_0x6e1e('0x3c')](_0x58066d+_0x6e1e('0x40'),_0x50d568['id']['toString']())))[_0x6e1e('0x38')]();return _0x1cb974;};var _0x5e219a=function(_0x4d6cc0,_0x46e252){var _0x3ebf15=squel[_0x6e1e('0x41')]()[_0x6e1e('0x2f')]('cm_hopper')[_0x6e1e('0x31')]([_0x6e1e('0x1b'),_0x6e1e('0x32'),_0x6e1e('0x37'),'ListId',_0x46e252,_0x6e1e('0x33'),'updatedAt'],squel[_0x6e1e('0x34')]()[_0x6e1e('0x35')]('phone',_0x6e1e('0x1b'))['field']('NOW()',_0x6e1e('0x32'))[_0x6e1e('0x35')]('id','ContactId')[_0x6e1e('0x35')](LISTID[_0x6e1e('0x38')](),_0x6e1e('0x22'))[_0x6e1e('0x35')](_0x4d6cc0['id']['toString'](),_0x46e252)['field'](_0x6e1e('0x36'),_0x6e1e('0x33'))[_0x6e1e('0x35')](_0x6e1e('0x36'),_0x6e1e('0x39'))[_0x6e1e('0x3a')](_0x6e1e('0x3b'))[_0x6e1e('0x3c')](_0x6e1e('0x3d'))[_0x6e1e('0x3c')](_0x6e1e('0x42'),LISTID['toString']())[_0x6e1e('0x3c')](_0x6e1e('0x43'),squel['str'](hopperContacts))[_0x6e1e('0x3c')](_0x6e1e('0x3e'))['where'](_0x6e1e('0x3f'),squel['select']()[_0x6e1e('0x35')](_0x6e1e('0x44'))[_0x6e1e('0x3a')](_0x6e1e('0x45'))['where'](_0x46e252+_0x6e1e('0x40'),_0x4d6cc0['id'][_0x6e1e('0x38')]()))[_0x6e1e('0x3c')](_0x6e1e('0x3f'),squel[_0x6e1e('0x34')]()[_0x6e1e('0x35')]('phone')[_0x6e1e('0x3a')]('cm_hopper')[_0x6e1e('0x3c')](_0x46e252+_0x6e1e('0x40'),_0x4d6cc0['id'][_0x6e1e('0x38')]())))[_0x6e1e('0x38')]();return _0x3ebf15;};function _0x785354(_0x277c81,_0x49b89a){var _0x347479=squel['insert']()[_0x6e1e('0x2f')]('cm_hopper')[_0x6e1e('0x31')]([_0x6e1e('0x1b'),_0x6e1e('0x32'),_0x6e1e('0x37'),'ListId',_0x49b89a,'createdAt',_0x6e1e('0x39')],squel[_0x6e1e('0x34')]()[_0x6e1e('0x35')](_0x6e1e('0x1b'),_0x6e1e('0x1b'))[_0x6e1e('0x35')]('NOW()',_0x6e1e('0x32'))[_0x6e1e('0x35')]('id',_0x6e1e('0x37'))[_0x6e1e('0x35')](LISTID[_0x6e1e('0x38')](),_0x6e1e('0x22'))['field'](_0x277c81['id']['toString'](),_0x49b89a)[_0x6e1e('0x35')](_0x6e1e('0x36'),'createdAt')[_0x6e1e('0x35')](_0x6e1e('0x36'),_0x6e1e('0x39'))[_0x6e1e('0x3a')](_0x6e1e('0x3b'))[_0x6e1e('0x3c')]('deletedAt\x20IS\x20NULL')[_0x6e1e('0x3c')](_0x6e1e('0x42'),LISTID[_0x6e1e('0x38')]())[_0x6e1e('0x3c')](_0x6e1e('0x43'),squel['str'](hopperContacts))[_0x6e1e('0x3c')](_0x6e1e('0x3e')))[_0x6e1e('0x38')]();return _0x347479;}function _0x3e58b1(_0x3e1269,_0x169d5a){var _0x552b72=squel[_0x6e1e('0x41')]()[_0x6e1e('0x2f')](_0x6e1e('0x46'))[_0x6e1e('0x31')]([_0x6e1e('0x1b'),_0x6e1e('0x37'),_0x6e1e('0x22'),_0x169d5a,_0x6e1e('0x33'),_0x6e1e('0x39')],squel[_0x6e1e('0x34')]()[_0x6e1e('0x35')](_0x6e1e('0x1b'),_0x6e1e('0x1b'))[_0x6e1e('0x35')]('id',_0x6e1e('0x37'))[_0x6e1e('0x35')](LISTID[_0x6e1e('0x38')](),_0x6e1e('0x22'))[_0x6e1e('0x35')](_0x3e1269['id'][_0x6e1e('0x38')](),_0x169d5a)['field']('NOW()',_0x6e1e('0x33'))['field'](_0x6e1e('0x36'),_0x6e1e('0x39'))[_0x6e1e('0x3a')](_0x6e1e('0x3b'))['where'](_0x6e1e('0x3d'))[_0x6e1e('0x3c')](_0x6e1e('0x42'),LISTID['toString']())['where'](_0x6e1e('0x43'),squel[_0x6e1e('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x6e1e('0x38')]();return _0x552b72;}return db['VoiceQueue']['findAll']({'where':{'type':_0x6e1e('0x48')},'attributes':['id',_0x6e1e('0x49')],'include':[{'model':db[_0x6e1e('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e1e('0x29')](function(_0x1245a1){var _0x9ec245=[];if(_0x1245a1){var _0x39aa97;for(var _0x26d49e=0x0,_0x1809b8;_0x26d49e<_0x1245a1[_0x6e1e('0x16')];_0x26d49e+=0x1){_0x1809b8=_0x1245a1[_0x26d49e]['get']({'plain':!![]});switch(_0x1809b8[_0x6e1e('0x49')]){case _0x6e1e('0x4b'):_0x9ec245[_0x6e1e('0x2a')](db[_0x6e1e('0x4c')][_0x6e1e('0x4d')](_0x5e219a(_0x1809b8,_0x6e1e('0x4e')))[_0x6e1e('0x29')](function(){})['catch'](_0x202523()));break;case'onlyIfOpen':_0x9ec245[_0x6e1e('0x2a')](db[_0x6e1e('0x4c')]['query'](_0x3b5c0d(_0x1809b8,_0x6e1e('0x4e')))[_0x6e1e('0x29')](function(){})[_0x6e1e('0x2b')](_0x202523()));break;default:_0x9ec245[_0x6e1e('0x2a')](db['sequelize'][_0x6e1e('0x4d')](_0x785354(_0x1809b8,_0x6e1e('0x4e')))[_0x6e1e('0x29')](function(){})[_0x6e1e('0x2b')](_0x202523()));}}}return _0x9ec245;})[_0x6e1e('0x4f')]()['then'](function(){return db[_0x6e1e('0x50')][_0x6e1e('0x51')]({'where':{'type':_0x6e1e('0x48')},'attributes':['id'],'include':[{'model':db[_0x6e1e('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e1e('0x29')](function(_0x27a221){var _0x15a337=[];if(_0x27a221){var _0xc86d8a;for(var _0x14e22d=0x0,_0x129be9;_0x14e22d<_0x27a221[_0x6e1e('0x16')];_0x14e22d+=0x1){_0x129be9=_0x27a221[_0x14e22d][_0x6e1e('0x52')]({'plain':!![]});_0x15a337['push'](db[_0x6e1e('0x4c')]['query'](_0x3e58b1(_0x129be9,_0x6e1e('0x4e')))['then'](function(){})[_0x6e1e('0x2b')](_0x202523()));}}return _0x15a337;})['all']();})[_0x6e1e('0x29')](function(){return db[_0x6e1e('0x53')][_0x6e1e('0x51')]({'attributes':['id',_0x6e1e('0x49')],'include':[{'model':db[_0x6e1e('0x4a')],'as':_0x6e1e('0x54'),'where':{'id':LISTID}}]})[_0x6e1e('0x29')](function(_0x2359b5){var _0x300662=[];if(_0x2359b5){for(var _0x2a8c4f=0x0,_0x2108a1;_0x2a8c4f<_0x2359b5['length'];_0x2a8c4f+=0x1){_0x2108a1=_0x2359b5[_0x2a8c4f][_0x6e1e('0x52')]({'plain':!![]});switch(_0x2108a1[_0x6e1e('0x49')]){case _0x6e1e('0x4b'):_0x300662[_0x6e1e('0x2a')](db[_0x6e1e('0x4c')][_0x6e1e('0x4d')](_0x5e219a(_0x2108a1,_0x6e1e('0x55')))[_0x6e1e('0x29')](function(){})[_0x6e1e('0x2b')](_0x202523()));break;case _0x6e1e('0x56'):_0x300662[_0x6e1e('0x2a')](db[_0x6e1e('0x4c')][_0x6e1e('0x4d')](_0x3b5c0d(_0x2108a1,_0x6e1e('0x55')))[_0x6e1e('0x29')](function(){})[_0x6e1e('0x2b')](_0x202523()));break;default:_0x300662['push'](db['sequelize'][_0x6e1e('0x4d')](_0x785354(_0x2108a1,_0x6e1e('0x55')))[_0x6e1e('0x29')](function(){})['catch'](_0x202523()));}}}return _0x300662;})['all']();})[_0x6e1e('0x29')](function(){return db[_0x6e1e('0x53')][_0x6e1e('0x51')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x6e1e('0x57'),'where':{'id':LISTID}}]})[_0x6e1e('0x29')](function(_0x15f723){var _0x3aa6e6=[];if(_0x15f723){for(var _0xbd2e71=0x0,_0x45d1e9;_0xbd2e71<_0x15f723[_0x6e1e('0x16')];_0xbd2e71+=0x1){_0x45d1e9=_0x15f723[_0xbd2e71][_0x6e1e('0x52')]({'plain':!![]});_0x3aa6e6['push'](db[_0x6e1e('0x4c')][_0x6e1e('0x4d')](_0x3e58b1(_0x45d1e9,'CampaignId'))[_0x6e1e('0x29')](function(){})[_0x6e1e('0x2b')](_0x202523()));}}return _0x3aa6e6;})[_0x6e1e('0x4f')]();})[_0x6e1e('0x2b')](function(_0x233603){logger[_0x6e1e('0x11')](_0x6e1e('0x58'),_0x6e1e('0x59'),_0x233603[_0x6e1e('0x5a')]);});}var processPromises=function(_0xca0dfa){return BPromise['all'](promises)[_0x6e1e('0x29')](function(_0xe21824){})[_0x6e1e('0x2b')](function(_0x2e9228){logger[_0x6e1e('0x11')]('Error\x20processing\x20rows\x20block:',JSON[_0x6e1e('0x5b')](_0x2e9228));})['finally'](function(){socket[_0x6e1e('0x5c')](_0x6e1e('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xca0dfa){return _0xca0dfa[_0x6e1e('0x5e')]();}});};var endCsv=function(){return BPromise[_0x6e1e('0x5f')]()[_0x6e1e('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x6e1e('0x29')](function(){socket['emit'](_0x6e1e('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x42ae4d){logger[_0x6e1e('0x11')](_0x6e1e('0x60'),JSON[_0x6e1e('0x5b')](_0x42ae4d));}finally{process[_0x6e1e('0x61')](0x0);}});};process['on'](_0x6e1e('0x62'),function(){logger[_0x6e1e('0x63')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x6e1e('0x5f')]()[_0x6e1e('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e1e('0xe')](',');return db[_0x6e1e('0x27')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1295a8){var _0xc8087d=fs[_0x6e1e('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0xc8087d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x46b5b2,_0x241a93){total+=0x1;var _0x359873=total;promises[_0x6e1e('0x2a')](checkRow(_0x46b5b2,_0x1295a8,_0x359873)[_0x6e1e('0x29')](function(){success+=0x1;})[_0x6e1e('0x2b')](function(_0x45a9ad){if(_0x45a9ad[_0x6e1e('0x11')]){errors+=0x1;delete _0x45a9ad[_0x6e1e('0x11')];}else if(_0x45a9ad['duplicate']){duplicates+=0x1;delete _0x45a9ad[_0x6e1e('0x25')];}rows[_0x6e1e('0x2a')](_0x45a9ad);}));if(total%0xc8===0x0){_0x241a93[_0x6e1e('0x65')]();return processPromises(_0x241a93);}},'complete':function(){return processPromises()[_0x6e1e('0x29')](function(){logger[_0x6e1e('0x63')](_0x6e1e('0x66'));endCsv();});},'error':function(_0x17590e,_0x3c47fe){logger['info'](_0x6e1e('0x67'),JSON[_0x6e1e('0x5b')](_0x17590e));endCsv();}});})[_0x6e1e('0x2b')](function(_0x45b4f7){logger[_0x6e1e('0x11')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x6e1e('0x5b')](_0x45b4f7));});}main(); \ No newline at end of file +var _0xee8e=['ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','inspect','insert','cm_hopper','fromQuery','phone','scheduledAt','updatedAt','select','field','NOW()','ContactId','toString','createdAt','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','into','cm_hopper_black','str','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','VoiceQueue','findAll','outbound','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','errors','length','map','message','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0xee8e,0x11a));var _0xeee8=function(_0x4a80a0,_0x21eea3){_0x4a80a0=_0x4a80a0-0x0;var _0x2a04f2=_0xee8e[_0x4a80a0];return _0x2a04f2;};'use strict';var BPromise=require(_0xeee8('0x0'));var util=require(_0xeee8('0x1'));var _=require(_0xeee8('0x2'));var fs=require('fs');var squel=require(_0xeee8('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xeee8('0x4'))['db'];var config=require(_0xeee8('0x5'));var logger=require(_0xeee8('0x6'))('api');config[_0xeee8('0x7')]=_[_0xeee8('0x8')](config[_0xeee8('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xeee8('0x9'))(new Redis(config[_0xeee8('0x7')]));require(_0xeee8('0xa'))[_0xeee8('0xb')](socket);try{if(!process[_0xeee8('0xc')][0x2]||process[_0xeee8('0xc')][0x2]==='undefined'||process[_0xeee8('0xc')][0x2]==='null'){throw new Error(_0xeee8('0xd'));}var FILEPATH=process[_0xeee8('0xc')][0x2];if(!process[_0xeee8('0xc')][0x3]||process['argv'][0x3]===_0xeee8('0xe')||process[_0xeee8('0xc')][0x3]===_0xeee8('0xf')||!process['argv'][0x4]||process[_0xeee8('0xc')][0x4]===_0xeee8('0xe')||process[_0xeee8('0xc')][0x4]===_0xeee8('0xf')){throw new Error(_0xeee8('0x10'));}var FIELDS=_[_0xeee8('0x11')](process[_0xeee8('0xc')][0x3]['split'](','),process[_0xeee8('0xc')][0x4][_0xeee8('0x12')](','));if(!process[_0xeee8('0xc')][0x5]||process[_0xeee8('0xc')][0x5]===_0xeee8('0xe')||process[_0xeee8('0xc')][0x5]===_0xeee8('0xf')){throw new Error(_0xeee8('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xeee8('0xc')][0x6]!==_0xeee8('0xe')&&process['argv'][0x6]!==_0xeee8('0xf')?process[_0xeee8('0xc')][0x6]:null;var DUPLICATES=process[_0xeee8('0xc')][0x7]&&process[_0xeee8('0xc')][0x7]!==_0xeee8('0xe')&&process[_0xeee8('0xc')][0x7]!==_0xeee8('0xf')?process[_0xeee8('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0xeee8('0xc')][0x8]==='undefined'||process[_0xeee8('0xc')][0x8]===_0xeee8('0xf')){throw new Error(_0xeee8('0x14'));}var SOCKET_TIMESTAMP=process[_0xeee8('0xc')][0x8];}catch(_0x4a67bc){logger['error'](_0x4a67bc);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(_0x63f6d6,_0x1ff4a2,_0x409b71,_0x2111ca){var _0x1f37aa={'message':_0x1ff4a2};_0x1f37aa[_0x63f6d6]=!![];if(_0x409b71){_0x1f37aa[_0xeee8('0x15')]=_0x409b71;}if(_0x2111ca){_0x1f37aa[_0xeee8('0x16')]=_0x2111ca;}return _0x1f37aa;}function isEmail(_0x5c360b){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))*$/[_0xeee8('0x17')](_0x5c360b);}function checkRow(_0x257126,_0x596b1c,_0x4e7fc5){return new BPromise(function(_0xf85515,_0xbd1405){if(_[_0xeee8('0x18')](_0x257126)){return _0xbd1405(handleCheckRowError(_0xeee8('0x19'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4e7fc5));}if(_0x257126[_0xeee8('0x1a')]&&_0x257126['errors'][_0xeee8('0x1b')]){var _0xccc467=_[_0xeee8('0x1c')](_0x257126[_0xeee8('0x1a')],_0xeee8('0x1d'))['join'](';');return _0xbd1405(handleCheckRowError('error',_0xccc467,null,_0x4e7fc5));}var _0x33f068={};for(var _0x5d676f in FIELDS){if(FIELDS['hasOwnProperty'](_0x5d676f)&&FIELDS[_0x5d676f]){_0x33f068[_0x5d676f]=_0x257126[_0xeee8('0x1e')][0x0][FIELDS[_0x5d676f]]||_0x257126[_0xeee8('0x1e')][0x0]['\ufeff'+FIELDS[_0x5d676f]];}}if(!_0x33f068['firstName']){return _0xbd1405(handleCheckRowError(_0xeee8('0x19'),_0xeee8('0x1f'),null,_0x4e7fc5));}if(!_0x33f068['phone']){return _0xbd1405(handleCheckRowError(_0xeee8('0x19'),_0xeee8('0x20'),null,_0x4e7fc5));}if(_0x33f068[_0xeee8('0x21')]){var _0x262463=moment(_0x33f068['birthDate'],_0xeee8('0x22'));if(!_0x262463['isValid']()){return _0xbd1405(handleCheckRowError(_0xeee8('0x19'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4e7fc5));}}if(_0x33f068[_0xeee8('0x23')]){if(!isEmail(_0x33f068[_0xeee8('0x23')])){return _0xbd1405(handleCheckRowError(_0xeee8('0x19'),'email\x20format\x20is\x20not\x20valid!',null,_0x4e7fc5));}}_0x33f068[_0xeee8('0x24')]=LISTID;_0x33f068['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xeee8('0x1b')]&&_0x596b1c){var _0xc9d59b={};for(var _0x2208a7=0x0,_0xd06146=DUPLICATES[_0xeee8('0x1b')];_0x2208a7<_0xd06146;_0x2208a7+=0x1){_0xc9d59b[DUPLICATES[_0x2208a7]]=_0x33f068[DUPLICATES[_0x2208a7]];}var _0x479b73=_[_0xeee8('0x25')](_0x596b1c,_0xc9d59b);if(_0x479b73){return _0xbd1405(handleCheckRowError(_0xeee8('0x26'),_0xeee8('0x27'),_0x479b73,_0x4e7fc5));}}return db[_0xeee8('0x28')][_0xeee8('0x29')](_0x33f068,{'raw':!![],'hooks':![],'fields':_[_0xeee8('0x2a')](_0x33f068)})[_0xeee8('0x2b')](function(_0x4d2250){if(DUPLICATES&&DUPLICATES[_0xeee8('0x1b')]&&_0x596b1c){_0x596b1c[_0xeee8('0x2c')](_['pick'](_0x33f068,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4d2250['id'];return _0xf85515();})['catch'](function(_0x18619e){return _0xbd1405(handleCheckRowError(_0xeee8('0x19'),_0xeee8('0x2d')+(_0x18619e[_0xeee8('0x1d')]||JSON['stringify'](_0x18619e)),null,_0x4e7fc5));});});}function checkHopper(){function _0x3f481b(){return function(_0x51c9da){logger[_0xeee8('0x19')]('cmContact','checkHopper',util[_0xeee8('0x2e')](_0x51c9da,{'showHidden':![],'depth':null}));};}var _0x53fe17=function(_0x51d884,_0x388392){var _0x452f61=squel[_0xeee8('0x2f')]()['into'](_0xeee8('0x30'))[_0xeee8('0x31')]([_0xeee8('0x32'),_0xeee8('0x33'),'ContactId',_0xeee8('0x24'),_0x388392,'createdAt',_0xeee8('0x34')],squel[_0xeee8('0x35')]()[_0xeee8('0x36')](_0xeee8('0x32'),_0xeee8('0x32'))['field'](_0xeee8('0x37'),'scheduledAt')[_0xeee8('0x36')]('id',_0xeee8('0x38'))[_0xeee8('0x36')](LISTID[_0xeee8('0x39')](),_0xeee8('0x24'))[_0xeee8('0x36')](_0x51d884['id'][_0xeee8('0x39')](),_0x388392)[_0xeee8('0x36')](_0xeee8('0x37'),_0xeee8('0x3a'))['field']('NOW()',_0xeee8('0x34'))[_0xeee8('0x3b')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xeee8('0x3c')](_0xeee8('0x3d'),LISTID['toString']())[_0xeee8('0x3c')](_0xeee8('0x3e'))[_0xeee8('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeee8('0x35')]()[_0xeee8('0x36')](_0xeee8('0x32'))['from'](_0xeee8('0x30'))[_0xeee8('0x3c')](_0x388392+_0xeee8('0x3f'),_0x51d884['id']['toString']())))['toString']();return _0x452f61;};var _0x81233f=function(_0x22e7d4,_0x5ec519){var _0x5edeac=squel[_0xeee8('0x2f')]()['into'](_0xeee8('0x30'))[_0xeee8('0x31')]([_0xeee8('0x32'),_0xeee8('0x33'),_0xeee8('0x38'),_0xeee8('0x24'),_0x5ec519,'createdAt',_0xeee8('0x34')],squel[_0xeee8('0x35')]()['field'](_0xeee8('0x32'),_0xeee8('0x32'))['field'](_0xeee8('0x37'),_0xeee8('0x33'))['field']('id','ContactId')[_0xeee8('0x36')](LISTID[_0xeee8('0x39')](),_0xeee8('0x24'))[_0xeee8('0x36')](_0x22e7d4['id']['toString'](),_0x5ec519)[_0xeee8('0x36')](_0xeee8('0x37'),_0xeee8('0x3a'))[_0xeee8('0x36')](_0xeee8('0x37'),_0xeee8('0x34'))[_0xeee8('0x3b')](_0xeee8('0x40'))['where'](_0xeee8('0x41'))[_0xeee8('0x3c')](_0xeee8('0x3d'),LISTID[_0xeee8('0x39')]())[_0xeee8('0x3c')](_0xeee8('0x42'),squel['str'](hopperContacts))[_0xeee8('0x3c')](_0xeee8('0x3e'))[_0xeee8('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeee8('0x35')]()[_0xeee8('0x36')]('calleridnum')['from'](_0xeee8('0x43'))[_0xeee8('0x3c')](_0x5ec519+_0xeee8('0x3f'),_0x22e7d4['id'][_0xeee8('0x39')]()))[_0xeee8('0x3c')](_0xeee8('0x44'),squel[_0xeee8('0x35')]()['field'](_0xeee8('0x32'))[_0xeee8('0x3b')](_0xeee8('0x30'))['where'](_0x5ec519+'\x20=\x20?',_0x22e7d4['id'][_0xeee8('0x39')]())))[_0xeee8('0x39')]();return _0x5edeac;};function _0x5d7aad(_0x3e025f,_0x235f58){var _0x4365c0=squel['insert']()[_0xeee8('0x45')]('cm_hopper')['fromQuery'](['phone',_0xeee8('0x33'),'ContactId','ListId',_0x235f58,_0xeee8('0x3a'),_0xeee8('0x34')],squel['select']()[_0xeee8('0x36')](_0xeee8('0x32'),_0xeee8('0x32'))[_0xeee8('0x36')](_0xeee8('0x37'),_0xeee8('0x33'))[_0xeee8('0x36')]('id',_0xeee8('0x38'))[_0xeee8('0x36')](LISTID['toString'](),_0xeee8('0x24'))[_0xeee8('0x36')](_0x3e025f['id'][_0xeee8('0x39')](),_0x235f58)[_0xeee8('0x36')](_0xeee8('0x37'),_0xeee8('0x3a'))[_0xeee8('0x36')](_0xeee8('0x37'),_0xeee8('0x34'))[_0xeee8('0x3b')](_0xeee8('0x40'))[_0xeee8('0x3c')](_0xeee8('0x41'))[_0xeee8('0x3c')](_0xeee8('0x3d'),LISTID[_0xeee8('0x39')]())[_0xeee8('0x3c')](_0xeee8('0x42'),squel['str'](hopperContacts))[_0xeee8('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xeee8('0x39')]();return _0x4365c0;}function _0x2e76c0(_0x566f02,_0x4c0da5){var _0xb53e7=squel[_0xeee8('0x2f')]()[_0xeee8('0x45')](_0xeee8('0x46'))[_0xeee8('0x31')](['phone',_0xeee8('0x38'),'ListId',_0x4c0da5,_0xeee8('0x3a'),_0xeee8('0x34')],squel[_0xeee8('0x35')]()['field']('phone','phone')[_0xeee8('0x36')]('id',_0xeee8('0x38'))[_0xeee8('0x36')](LISTID[_0xeee8('0x39')](),_0xeee8('0x24'))[_0xeee8('0x36')](_0x566f02['id'][_0xeee8('0x39')](),_0x4c0da5)[_0xeee8('0x36')]('NOW()',_0xeee8('0x3a'))['field']('NOW()','updatedAt')['from']('cm_contacts')['where'](_0xeee8('0x41'))['where'](_0xeee8('0x3d'),LISTID[_0xeee8('0x39')]())[_0xeee8('0x3c')](_0xeee8('0x42'),squel[_0xeee8('0x47')](hopperContacts))['where'](_0xeee8('0x3e')))['toString']();return _0xb53e7;}return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xeee8('0x48')],'include':[{'model':db[_0xeee8('0x49')],'as':_0xeee8('0x4a'),'where':{'id':LISTID}}]})[_0xeee8('0x2b')](function(_0x4b1e17){var _0x2d70be=[];if(_0x4b1e17){var _0xc57eb2;for(var _0x312264=0x0,_0x1f69fa;_0x312264<_0x4b1e17[_0xeee8('0x1b')];_0x312264+=0x1){_0x1f69fa=_0x4b1e17[_0x312264][_0xeee8('0x4b')]({'plain':!![]});switch(_0x1f69fa[_0xeee8('0x48')]){case _0xeee8('0x4c'):_0x2d70be[_0xeee8('0x2c')](db[_0xeee8('0x4d')][_0xeee8('0x4e')](_0x81233f(_0x1f69fa,_0xeee8('0x4f')))[_0xeee8('0x2b')](function(){})[_0xeee8('0x50')](_0x3f481b()));break;case _0xeee8('0x51'):_0x2d70be[_0xeee8('0x2c')](db[_0xeee8('0x4d')][_0xeee8('0x4e')](_0x53fe17(_0x1f69fa,_0xeee8('0x4f')))[_0xeee8('0x2b')](function(){})[_0xeee8('0x50')](_0x3f481b()));break;default:_0x2d70be[_0xeee8('0x2c')](db[_0xeee8('0x4d')][_0xeee8('0x4e')](_0x5d7aad(_0x1f69fa,_0xeee8('0x4f')))['then'](function(){})[_0xeee8('0x50')](_0x3f481b()));}}}return _0x2d70be;})['all']()[_0xeee8('0x2b')](function(){return db[_0xeee8('0x52')][_0xeee8('0x53')]({'where':{'type':_0xeee8('0x54')},'attributes':['id'],'include':[{'model':db[_0xeee8('0x49')],'as':_0xeee8('0x55'),'where':{'id':LISTID}}]})[_0xeee8('0x2b')](function(_0x151f22){var _0x25a1ff=[];if(_0x151f22){var _0x21b455;for(var _0xb58720=0x0,_0x2899a1;_0xb58720<_0x151f22[_0xeee8('0x1b')];_0xb58720+=0x1){_0x2899a1=_0x151f22[_0xb58720][_0xeee8('0x4b')]({'plain':!![]});_0x25a1ff[_0xeee8('0x2c')](db[_0xeee8('0x4d')][_0xeee8('0x4e')](_0x2e76c0(_0x2899a1,_0xeee8('0x4f')))[_0xeee8('0x2b')](function(){})['catch'](_0x3f481b()));}}return _0x25a1ff;})[_0xeee8('0x56')]();})[_0xeee8('0x2b')](function(){return db[_0xeee8('0x57')]['findAll']({'attributes':['id',_0xeee8('0x48')],'include':[{'model':db[_0xeee8('0x49')],'as':_0xeee8('0x4a'),'where':{'id':LISTID}}]})[_0xeee8('0x2b')](function(_0x535a99){var _0x63bdda=[];if(_0x535a99){for(var _0xc0bb58=0x0,_0x319746;_0xc0bb58<_0x535a99[_0xeee8('0x1b')];_0xc0bb58+=0x1){_0x319746=_0x535a99[_0xc0bb58]['get']({'plain':!![]});switch(_0x319746[_0xeee8('0x48')]){case _0xeee8('0x4c'):_0x63bdda['push'](db[_0xeee8('0x4d')]['query'](_0x81233f(_0x319746,_0xeee8('0x58')))[_0xeee8('0x2b')](function(){})['catch'](_0x3f481b()));break;case _0xeee8('0x51'):_0x63bdda[_0xeee8('0x2c')](db['sequelize'][_0xeee8('0x4e')](_0x53fe17(_0x319746,_0xeee8('0x58')))[_0xeee8('0x2b')](function(){})[_0xeee8('0x50')](_0x3f481b()));break;default:_0x63bdda[_0xeee8('0x2c')](db[_0xeee8('0x4d')]['query'](_0x5d7aad(_0x319746,'CampaignId'))[_0xeee8('0x2b')](function(){})[_0xeee8('0x50')](_0x3f481b()));}}}return _0x63bdda;})[_0xeee8('0x56')]();})[_0xeee8('0x2b')](function(){return db[_0xeee8('0x57')][_0xeee8('0x53')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xeee8('0x55'),'where':{'id':LISTID}}]})['then'](function(_0xa47007){var _0x5083f5=[];if(_0xa47007){for(var _0x1facc8=0x0,_0xafdc5f;_0x1facc8<_0xa47007[_0xeee8('0x1b')];_0x1facc8+=0x1){_0xafdc5f=_0xa47007[_0x1facc8][_0xeee8('0x4b')]({'plain':!![]});_0x5083f5[_0xeee8('0x2c')](db[_0xeee8('0x4d')][_0xeee8('0x4e')](_0x2e76c0(_0xafdc5f,_0xeee8('0x58')))[_0xeee8('0x2b')](function(){})[_0xeee8('0x50')](_0x3f481b()));}}return _0x5083f5;})[_0xeee8('0x56')]();})[_0xeee8('0x50')](function(_0x4e947a){logger[_0xeee8('0x19')](_0xeee8('0x59'),_0xeee8('0x5a'),_0x4e947a[_0xeee8('0x1d')]);});}var processPromises=function(_0x45451d){return BPromise[_0xeee8('0x56')](promises)['then'](function(_0x139524){})[_0xeee8('0x50')](function(_0x41cdf9){logger[_0xeee8('0x19')](_0xeee8('0x5b'),JSON[_0xeee8('0x5c')](_0x41cdf9));})[_0xeee8('0x5d')](function(){socket[_0xeee8('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x45451d){return _0x45451d[_0xeee8('0x5f')]();}});};var endCsv=function(){return BPromise[_0xeee8('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xeee8('0x2b')](function(){socket[_0xeee8('0x5e')](_0xeee8('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xeee8('0x62')](FILEPATH);}catch(_0x3ca390){logger[_0xeee8('0x19')](_0xeee8('0x63'),JSON['stringify'](_0x3ca390));}finally{process[_0xeee8('0x64')](0x0);}});};process['on']('SIGINT',function(){logger[_0xeee8('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xeee8('0x60')]()[_0xeee8('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xeee8('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xeee8('0x2b')](function(_0x302ba2){var _0x3b710d=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xeee8('0x66')](_0x3b710d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x418c71,_0x5badcc){total+=0x1;var _0xa35649=total;promises[_0xeee8('0x2c')](checkRow(_0x418c71,_0x302ba2,_0xa35649)[_0xeee8('0x2b')](function(){success+=0x1;})[_0xeee8('0x50')](function(_0x59ca7d){if(_0x59ca7d[_0xeee8('0x19')]){errors+=0x1;delete _0x59ca7d['error'];}else if(_0x59ca7d[_0xeee8('0x26')]){duplicates+=0x1;delete _0x59ca7d[_0xeee8('0x26')];}rows[_0xeee8('0x2c')](_0x59ca7d);}));if(total%0xc8===0x0){_0x5badcc[_0xeee8('0x67')]();return processPromises(_0x5badcc);}},'complete':function(){return processPromises()[_0xeee8('0x2b')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3893dc,_0x59fdd8){logger['info'](_0xeee8('0x68'),JSON[_0xeee8('0x5c')](_0x3893dc));endCsv();}});})[_0xeee8('0x50')](function(_0x9c63a){logger['error'](_0xeee8('0x69'),JSON['stringify'](_0x9c63a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1644774..de7b211 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 _0x7d95=['server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','into','cm_hopper_black','cm_contacts','.CmListId','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId','updatedAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','push','info','sequelize','spread','catch','main','stringify','send','start','root'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7d95,0x1d6));var _0x57d9=function(_0x38051b,_0x46cf1e){_0x38051b=_0x38051b-0x0;var _0x349422=_0x7d95[_0x38051b];return _0x349422;};'use strict';var fs=require('fs');var path=require(_0x57d9('0x0'));var _=require('lodash');var Papa=require(_0x57d9('0x1'));var util=require(_0x57d9('0x2'));var BPromise=require(_0x57d9('0x3'));var moment=require(_0x57d9('0x4'));var squel=require('squel');var Redis=require(_0x57d9('0x5'));var db=require(_0x57d9('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x57d9('0x7'))(_0x57d9('0x8'));config[_0x57d9('0x9')]=_[_0x57d9('0xa')](config[_0x57d9('0x9')],{'host':_0x57d9('0xb'),'port':0x18eb});var socket=require(_0x57d9('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x57d9('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3531ad){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))*$/[_0x57d9('0xe')](_0x3531ad);}function selectNotIn(_0x343b5d,_0x2900a0,_0x328376,_0x445f76,_0x5c48e7){return squel[_0x57d9('0xf')]()[_0x57d9('0x10')]('phone')[_0x57d9('0x11')](_0x445f76)[_0x57d9('0x12')](_0x2900a0,null,_0x2900a0+_0x57d9('0x13')+_0x445f76+'.'+_0x328376)[_0x57d9('0x14')](_0x445f76+'.'+_0x328376+_0x57d9('0x15')+_0x343b5d+'.'+_0x328376)[_0x57d9('0x14')](_0x2900a0+_0x57d9('0x16')+_0x5c48e7[_0x57d9('0x12')]()+')');}function insertCmHopper(_0x38350c,_0x489dfc,_0x40e246,_0x5be0e8,_0x36770d){var _0x2ba653=['cm_contacts.phone',_0x57d9('0x17'),_0x57d9('0x18'),_0x57d9('0x19'),_0x489dfc+'.'+_0x5be0e8,_0x57d9('0x1a'),_0x57d9('0x1b'),_0x57d9('0x1c'),_0x57d9('0x1d'),'\x22'+_0x36770d+'\x22'];return squel[_0x57d9('0x1e')]()['into'](_0x57d9('0x1f'))[_0x57d9('0x20')]([_0x57d9('0x21'),_0x57d9('0x22'),_0x57d9('0x23'),_0x57d9('0x24'),_0x5be0e8,_0x57d9('0x25'),'updatedAt',_0x57d9('0x26'),_0x57d9('0x27'),_0x57d9('0x28')],squel[_0x57d9('0xf')]()[_0x57d9('0x29')](_0x2ba653)[_0x57d9('0x11')](_0x489dfc)[_0x57d9('0x12')]('cm_contacts',null,_0x57d9('0x2a')+_0x489dfc+'.CmListId')['join'](_0x40e246,null,_0x40e246+_0x57d9('0x13')+_0x489dfc+'.'+_0x5be0e8)[_0x57d9('0x14')](_0x489dfc+_0x57d9('0x2b'),_0x38350c)[_0x57d9('0x14')](_0x57d9('0x2c'),NOW)[_0x57d9('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x489dfc,_0x40e246,_0x5be0e8,'cm_hopper',[_0x57d9('0x2d'),_0x57d9('0x2e')]))[_0x57d9('0x14')](_0x57d9('0x2f'),selectNotIn(_0x489dfc,_0x40e246,_0x5be0e8,_0x57d9('0x1f'),[_0x57d9('0x2d')])))[_0x57d9('0x30')]();}function insertCmHopperBlack(_0xdd6179,_0xef3511,_0xe9586,_0x20c771){var _0x312bee=[_0x57d9('0x31'),_0x57d9('0x18'),_0x57d9('0x19'),_0xef3511+'.'+_0x20c771,_0x57d9('0x1a'),'cm_contacts.updatedAt'];return squel[_0x57d9('0x1e')]()[_0x57d9('0x32')](_0x57d9('0x33'))[_0x57d9('0x20')]([_0x57d9('0x21'),'ContactId',_0x57d9('0x24'),_0x20c771,_0x57d9('0x25'),'updatedAt'],squel[_0x57d9('0xf')]()[_0x57d9('0x29')](_0x312bee)[_0x57d9('0x11')](_0xef3511)['join'](_0x57d9('0x34'),null,_0x57d9('0x2a')+_0xef3511+_0x57d9('0x35'))[_0x57d9('0x12')](_0xe9586,null,_0xe9586+_0x57d9('0x13')+_0xef3511+'.'+_0x20c771)[_0x57d9('0x14')](_0xef3511+'.CmListId\x20=\x20?',_0xdd6179)['where'](_0x57d9('0x2c'),NOW)[_0x57d9('0x14')](_0x57d9('0x2f'),squel[_0x57d9('0xf')]()[_0x57d9('0x10')](_0x57d9('0x21'))['from'](_0x57d9('0x33'))['where'](_0x57d9('0x36'),_0xdd6179)[_0x57d9('0x14')](_0x20c771+_0x57d9('0x37'),_0xef3511+'.'+_0x20c771)))[_0x57d9('0x30')]();}function insertCmContact(_0x4f3ea1,_0x1846c5,_0x3a351b,_0x546886){var _0x5dec28=_['concat'](_[_0x57d9('0x38')](_0x546886),[_0x57d9('0x24'),_0x57d9('0x39'),_0x57d9('0x25'),_0x57d9('0x3a')]);return squel['insert']()[_0x57d9('0x32')](_0x57d9('0x34'))['fromQuery'](_0x5dec28,squel[_0x57d9('0xf')]()[_0x57d9('0x29')](_0x5dec28)['from'](_0x1846c5)[_0x57d9('0x14')]('('+_0x3a351b[_0x57d9('0x12')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x57d9('0x29')](_0x3a351b)[_0x57d9('0x11')](_0x57d9('0x34'))[_0x57d9('0x14')]('ListId\x20=\x20?',_0x4f3ea1)[_0x57d9('0x14')](_0x57d9('0x3b')))[_0x57d9('0x14')](_0x57d9('0x3c'),squel[_0x57d9('0xf')]()[_0x57d9('0x10')](_0x57d9('0x3d'),_0x57d9('0x3e'))[_0x57d9('0x11')](_0x1846c5)[_0x57d9('0x3f')](_0x3a351b[_0x57d9('0x12')](','))))['toString']();}function handleStop(){logger['info'](_0x57d9('0x40'));stopped=!![];}function handleUncaughtException(_0x4542d1){logger[_0x57d9('0x41')](_0x4542d1[_0x57d9('0x42')]);process[_0x57d9('0x43')](0x1);}function handleError(_0x4c2f29,_0x429a18){stats['errors'][_0x57d9('0x44')]({'name':_0x429a18['code'],'message':_0x429a18[_0x57d9('0x42')],'row':_0x4c2f29});}function handleQuery(_0x3cde4e){logger[_0x57d9('0x45')](_0x3cde4e);return db[_0x57d9('0x46')]['query'](_0x3cde4e)[_0x57d9('0x47')](function(_0x4eb144){results['push'](_0x4eb144);})[_0x57d9('0x48')](function(_0x31193f){logger['error'](_0x31193f['message']);});}function main(_0x27bd07,_0x278cbb,_0x2cd9d6,_0x71ad24){logger[_0x57d9('0x45')](_0x57d9('0x49'),_0x27bd07,JSON[_0x57d9('0x4a')](_0x278cbb));process[_0x57d9('0x4b')](_0x57d9('0x4c'));var _0x3ca929=_0x278cbb['binding'];var _0x22fdee=_0x278cbb['socket_timestamp'];var _0x8462aa=path[_0x57d9('0x12')](config[_0x57d9('0x4d')],_0x57d9('0x4e'),_0x22fdee+_0x57d9('0x4f'));var _0x5f46f6=_[_0x57d9('0x38')](_0x3ca929)['join']();logger[_0x57d9('0x45')]('header',_0x5f46f6);fs[_0x57d9('0x50')](_0x8462aa,_0x5f46f6+'\x0a');Papa[_0x57d9('0x51')](fs[_0x57d9('0x52')](_0x27bd07),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3fbfdf,_0x4cfbed){try{for(var _0x36a477=0x0,_0x2bb283=[];_0x36a477<_0x3fbfdf[_0x57d9('0x53')][_0x57d9('0x54')];_0x36a477++){stats[_0x57d9('0x55')]+=0x1;if(_0x3fbfdf[_0x57d9('0x56')][_0x36a477]){handleError(_0x3fbfdf[_0x57d9('0x53')][_0x36a477],_0x3fbfdf[_0x57d9('0x56')][_0x36a477]);}else{var _0x2537c4=[];for(var _0xcfd6e7 in _0x3ca929){if(_0x3ca929[_0x57d9('0x57')](_0xcfd6e7)){if(_0x3fbfdf[_0x57d9('0x53')][_0x36a477][_0x3ca929[_0xcfd6e7]]){var _0x30198b=_[_0x57d9('0x58')](_0x3fbfdf['data'][_0x36a477][_0x3ca929[_0xcfd6e7]]['replace'](/"/g,'\x27'));switch(_0xcfd6e7){case _0x57d9('0x22'):var _0x3ae114=moment(_0x30198b,_0x57d9('0x59'),!![]);if(_0x3ae114['isValid']()){_0x2bb283['push']('\x22'+_0x30198b+'\x22');}else{_0x2537c4[_0x57d9('0x44')](_0x57d9('0x5a'));}break;case _0x57d9('0x26'):var _0x42a124=parseInt(_0x30198b);_0x30198b=_[_0x57d9('0x5b')](_0x42a124)||_0x42a124<0x0||_0x42a124>0x4?_0x71ad24?0x3:0x2:_0x42a124;_0x2bb283[_0x57d9('0x44')]('\x22'+_0x30198b+'\x22');break;case _0x57d9('0x27'):var _0x48eeb2=parseInt(_0x30198b);if(_[_0x57d9('0x5c')](_0x48eeb2)&&_['includes'](_0x2cd9d6,_0x48eeb2)){_0x2bb283['push']('\x22'+_0x48eeb2+'\x22');}else{_0x2537c4[_0x57d9('0x44')](_0x57d9('0x5d'));}break;case _0x57d9('0x5e'):if(isEmail(_0x30198b)){_0x2bb283[_0x57d9('0x44')]('\x22'+_0x30198b+'\x22');}else{_0x2537c4[_0x57d9('0x44')]('email\x20wrong\x20format');}break;case _0x57d9('0x5f'):var _0x5ac463=moment(_0x30198b,_0x57d9('0x60'),!![]);if(_0x5ac463[_0x57d9('0x61')]()){_0x2bb283[_0x57d9('0x44')]('\x22'+_0x30198b+'\x22');}else{_0x2537c4[_0x57d9('0x44')](_0x57d9('0x62'));}break;default:_0x2bb283[_0x57d9('0x44')]('\x22'+_0x30198b+'\x22');}}else{switch(_0xcfd6e7){case _0x57d9('0x63'):case _0x57d9('0x21'):_0x2537c4['push'](_0xcfd6e7+_0x57d9('0x64'));break;default:_0x2bb283[_0x57d9('0x44')]('\x22\x22');}}}}if(_0x2537c4[_0x57d9('0x54')]){handleError(_0x3fbfdf['data'][_0x36a477],{'code':_0x57d9('0x65'),'message':_0x2537c4[_0x57d9('0x12')]()});}else{fs[_0x57d9('0x66')](_0x8462aa,_0x2bb283[_0x57d9('0x12')]()+'\x0a');}_0x2bb283=[];}if(!(stats[_0x57d9('0x55')]%0xc8)){socket[_0x57d9('0x67')](_0x57d9('0x68')+_0x22fdee,stats);stats[_0x57d9('0x56')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x4cfbed[_0x57d9('0x69')]();}}catch(_0x41c0c8){handleError(_0x3fbfdf[_0x57d9('0x53')][_0x36a477],{'code':_0x57d9('0x6a'),'message':_0x41c0c8[_0x57d9('0x42')]});logger[_0x57d9('0x41')]('step',_0x41c0c8[_0x57d9('0x42')]);}},'complete':function(){try{var _0x3a05b5=[];var _0xa1e11b=_0x57d9('0x34');if(_0x278cbb['duplicates']&&_0x278cbb[_0x57d9('0x6b')][_0x57d9('0x54')]){_0xa1e11b='cm_contacts_'+_0x22fdee;_0x3a05b5[_0x57d9('0x44')](_0x57d9('0x6c')+_0xa1e11b+_0x57d9('0x6d'));}var _0x180f31=util[_0x57d9('0xd')](_0x57d9('0x6e'),_0x8462aa,_0xa1e11b,_0x5f46f6,_0x278cbb[_0x57d9('0x24')],_0x278cbb[_0x57d9('0x39')]||null,NOW,NOW);if(_[_0x57d9('0x6f')](_0x3ca929[_0x57d9('0x22')])){_0x180f31+=_0x57d9('0x70');}_0x3a05b5[_0x57d9('0x44')](_0x180f31);if(_0x278cbb[_0x57d9('0x6b')]&&_0x278cbb[_0x57d9('0x6b')][_0x57d9('0x54')]){_0x3a05b5['push'](insertCmContact(_0x278cbb[_0x57d9('0x24')],_0xa1e11b,_0x278cbb[_0x57d9('0x6b')],_0x3ca929));_0x3a05b5[_0x57d9('0x44')](_0x57d9('0x71')+_0xa1e11b+';');}_0x3a05b5[_0x57d9('0x44')](insertCmHopper(_0x278cbb[_0x57d9('0x24')],_0x57d9('0x72'),_0x57d9('0x73'),_0x57d9('0x74'),_0x71ad24));_0x3a05b5['push'](insertCmHopperBlack(_0x278cbb[_0x57d9('0x24')],'voice_queues_has_cm_blacklists',_0x57d9('0x73'),_0x57d9('0x74')));_0x3a05b5['push'](insertCmHopper(_0x278cbb[_0x57d9('0x24')],_0x57d9('0x75'),_0x57d9('0x76'),_0x57d9('0x77'),_0x71ad24));_0x3a05b5[_0x57d9('0x44')](insertCmHopperBlack(_0x278cbb['ListId'],_0x57d9('0x78'),_0x57d9('0x76'),_0x57d9('0x77')));BPromise[_0x57d9('0x79')](_0x3a05b5,handleQuery)[_0x57d9('0x7a')](function(_0x3b8d63){stats[_0x57d9('0x7b')]=!![];stats[_0x57d9('0x7c')]=_0x278cbb[_0x57d9('0x6b')]&&_0x278cbb[_0x57d9('0x6b')][_0x57d9('0x54')]?results[0x2]['affectedRows']:results[0x0][_0x57d9('0x7c')];socket[_0x57d9('0x67')]('contact:import:'+_0x22fdee,stats);fs[_0x57d9('0x7d')](_0x27bd07);fs[_0x57d9('0x7d')](_0x8462aa);process[_0x57d9('0x43')](0x0);})[_0x57d9('0x48')](function(_0x35c0be){logger[_0x57d9('0x41')](_0x35c0be[_0x57d9('0x42')]);process[_0x57d9('0x43')](0x1);});}catch(_0x31a4c7){logger[_0x57d9('0x41')](_0x57d9('0x7e'),_0x31a4c7[_0x57d9('0x42')]);process[_0x57d9('0x43')](0x1);}},'error':function(_0x13c06c,_0x33095b,_0x170f76,_0x2aa581){throw new Error(_0x2aa581);}});}function validate(){if(process['argv']&&process[_0x57d9('0x7f')][_0x57d9('0x54')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x12f2b8=path['join'](config['root'],_0x57d9('0x4e'),process[_0x57d9('0x7f')][0x2]);if(!fs['existsSync'](_0x12f2b8)){throw new Error(_0x57d9('0x80'));}var _0x43863a={};try{_0x43863a=JSON['parse'](process[_0x57d9('0x7f')][0x3]);if(!_0x43863a[_0x57d9('0x81')]){throw new Error(_0x57d9('0x82'));}if(!_0x43863a[_0x57d9('0x81')][_0x57d9('0x21')]){throw new Error(_0x57d9('0x83'));}if(!_0x43863a['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x58a208=0x0;if(_0x43863a[_0x57d9('0x81')][_0x57d9('0x27')]){_0x58a208=0x1;}if(!_0x43863a[_0x57d9('0x24')]){throw new Error(_0x57d9('0x84'));}}catch(_0x4210a3){throw new Error(_0x57d9('0x85'));}var _0x5a67f8=[];try{_0x5a67f8=_['map'](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x571336){logger[_0x57d9('0x45')](_0x57d9('0x86'));}main(_0x12f2b8,_0x43863a,_0x5a67f8,_0x58a208);}validate();process['on'](_0x57d9('0x87'),handleStop);process['on'](_0x57d9('0x88'),handleUncaughtException); \ No newline at end of file +var _0x8902=['cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','from','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fields','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','keys','insert',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','spread','push','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','isNaN','includes','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','appendFileSync','abort','SystemError','duplicates','CREATE\x20TABLE\x20','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','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','contact:import:','unlink','complete','argv','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','../../../config/logger','import','defaults','localhost','socket.io-emitter','redis','format','test','select','phone','join','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat'];(function(_0x1eb711,_0x150d52){var _0x2ae3c0=function(_0x14bd31){while(--_0x14bd31){_0x1eb711['push'](_0x1eb711['shift']());}};_0x2ae3c0(++_0x150d52);}(_0x8902,0x1e5));var _0x2890=function(_0x317542,_0x1eca3a){_0x317542=_0x317542-0x0;var _0x49e499=_0x8902[_0x317542];return _0x49e499;};'use strict';var fs=require('fs');var path=require(_0x2890('0x0'));var _=require(_0x2890('0x1'));var Papa=require(_0x2890('0x2'));var util=require(_0x2890('0x3'));var BPromise=require(_0x2890('0x4'));var moment=require(_0x2890('0x5'));var squel=require(_0x2890('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x2890('0x7'));var logger=require(_0x2890('0x8'))(_0x2890('0x9'));config['redis']=_[_0x2890('0xa')](config['redis'],{'host':_0x2890('0xb'),'port':0x18eb});var socket=require(_0x2890('0xc'))(new Redis(config[_0x2890('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2890('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xd61d49){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))*$/[_0x2890('0xf')](_0xd61d49);}function selectNotIn(_0x16f078,_0x420474,_0x3d1b8f,_0x3da7d2,_0x2948cc){return squel[_0x2890('0x10')]()['field'](_0x2890('0x11'))['from'](_0x3da7d2)[_0x2890('0x12')](_0x420474,null,_0x420474+'.id\x20=\x20'+_0x3da7d2+'.'+_0x3d1b8f)[_0x2890('0x13')](_0x3da7d2+'.'+_0x3d1b8f+_0x2890('0x14')+_0x16f078+'.'+_0x3d1b8f)[_0x2890('0x13')](_0x420474+'.dialCheckDuplicateType\x20IN\x20('+_0x2948cc[_0x2890('0x12')]()+')');}function insertCmHopper(_0x56f2c2,_0x3e8768,_0x2faabd,_0x29dbf4,_0x11ebea){var _0x4a2b93=[_0x2890('0x15'),_0x2890('0x16'),_0x2890('0x17'),_0x2890('0x18'),_0x3e8768+'.'+_0x29dbf4,_0x2890('0x19'),_0x2890('0x1a'),_0x2890('0x1b'),'cm_contacts.UserId','\x22'+_0x11ebea+'\x22'];return squel['insert']()[_0x2890('0x1c')]('cm_hopper')[_0x2890('0x1d')]([_0x2890('0x11'),_0x2890('0x1e'),_0x2890('0x1f'),_0x2890('0x20'),_0x29dbf4,_0x2890('0x21'),_0x2890('0x22'),_0x2890('0x23'),_0x2890('0x24'),'recallme'],squel[_0x2890('0x10')]()['fields'](_0x4a2b93)[_0x2890('0x25')](_0x3e8768)[_0x2890('0x12')](_0x2890('0x26'),null,_0x2890('0x27')+_0x3e8768+'.CmListId')[_0x2890('0x12')](_0x2faabd,null,_0x2faabd+_0x2890('0x28')+_0x3e8768+'.'+_0x29dbf4)['where'](_0x3e8768+_0x2890('0x29'),_0x56f2c2)[_0x2890('0x13')](_0x2890('0x2a'),NOW)['where'](_0x2890('0x2b'),selectNotIn(_0x3e8768,_0x2faabd,_0x29dbf4,_0x2890('0x2c'),[_0x2890('0x2d'),_0x2890('0x2e')]))['where'](_0x2890('0x2b'),selectNotIn(_0x3e8768,_0x2faabd,_0x29dbf4,_0x2890('0x2c'),[_0x2890('0x2d')])))[_0x2890('0x2f')]();}function insertCmHopperBlack(_0x159d8b,_0x5d342a,_0x175b61,_0x1765e5){var _0x1387e4=[_0x2890('0x15'),_0x2890('0x17'),'cm_contacts.ListId',_0x5d342a+'.'+_0x1765e5,_0x2890('0x19'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x2890('0x30'))[_0x2890('0x1d')](['phone',_0x2890('0x1f'),'ListId',_0x1765e5,'createdAt',_0x2890('0x22')],squel[_0x2890('0x10')]()[_0x2890('0x31')](_0x1387e4)[_0x2890('0x25')](_0x5d342a)[_0x2890('0x12')](_0x2890('0x26'),null,_0x2890('0x27')+_0x5d342a+_0x2890('0x32'))[_0x2890('0x12')](_0x175b61,null,_0x175b61+_0x2890('0x28')+_0x5d342a+'.'+_0x1765e5)[_0x2890('0x13')](_0x5d342a+_0x2890('0x29'),_0x159d8b)[_0x2890('0x13')](_0x2890('0x2a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2890('0x10')]()[_0x2890('0x33')](_0x2890('0x11'))['from']('cm_hopper_black')['where'](_0x2890('0x34'),_0x159d8b)['where'](_0x1765e5+_0x2890('0x35'),_0x5d342a+'.'+_0x1765e5)))[_0x2890('0x2f')]();}function insertCmContact(_0x5f40e8,_0x121b57,_0x5eb812,_0x41e60b){var _0x7cf80b=_['concat'](_[_0x2890('0x36')](_0x41e60b),[_0x2890('0x20'),'CompanyId',_0x2890('0x21'),_0x2890('0x22')]);return squel[_0x2890('0x37')]()[_0x2890('0x1c')](_0x2890('0x26'))[_0x2890('0x1d')](_0x7cf80b,squel[_0x2890('0x10')]()[_0x2890('0x31')](_0x7cf80b)[_0x2890('0x25')](_0x121b57)[_0x2890('0x13')]('('+_0x5eb812['join'](',')+_0x2890('0x38'),squel[_0x2890('0x10')]()['fields'](_0x5eb812)[_0x2890('0x25')]('cm_contacts')[_0x2890('0x13')]('ListId\x20=\x20?',_0x5f40e8)[_0x2890('0x13')](_0x2890('0x39')))[_0x2890('0x13')](_0x2890('0x3a'),squel['select']()[_0x2890('0x33')](_0x2890('0x3b'),_0x2890('0x3c'))[_0x2890('0x25')](_0x121b57)[_0x2890('0x3d')](_0x5eb812[_0x2890('0x12')](','))))[_0x2890('0x2f')]();}function handleStop(){logger[_0x2890('0x3e')](_0x2890('0x3f'));stopped=!![];}function handleUncaughtException(_0xa9b76b){logger[_0x2890('0x40')](_0xa9b76b[_0x2890('0x41')]);process[_0x2890('0x42')](0x1);}function handleError(_0x5e2646,_0x141176){stats[_0x2890('0x43')]['push']({'name':_0x141176[_0x2890('0x44')],'message':_0x141176[_0x2890('0x41')],'row':_0x5e2646});}function handleQuery(_0x5713b9){logger[_0x2890('0x3e')](_0x5713b9);return db['sequelize']['query'](_0x5713b9)[_0x2890('0x45')](function(_0x5b8571){results[_0x2890('0x46')](_0x5b8571);})[_0x2890('0x47')](function(_0x471e90){logger['error'](_0x471e90[_0x2890('0x41')]);});}function main(_0x388f33,_0x1a00ef,_0x3980ca,_0x10d383){logger['info'](_0x2890('0x48'),_0x388f33,JSON[_0x2890('0x49')](_0x1a00ef));process[_0x2890('0x4a')]('start');var _0x5cc142=_0x1a00ef[_0x2890('0x4b')];var _0x55002f=_0x1a00ef[_0x2890('0x4c')];var _0x5514f7=path['join'](config[_0x2890('0x4d')],_0x2890('0x4e'),_0x55002f+_0x2890('0x4f'));var _0x55311a=_[_0x2890('0x36')](_0x5cc142)[_0x2890('0x12')]();logger[_0x2890('0x3e')]('header',_0x55311a);fs[_0x2890('0x50')](_0x5514f7,_0x55311a+'\x0a');Papa[_0x2890('0x51')](fs[_0x2890('0x52')](_0x388f33),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1abea0,_0x23cca2){try{for(var _0x3218d6=0x0,_0x2b066d=[];_0x3218d6<_0x1abea0[_0x2890('0x53')][_0x2890('0x54')];_0x3218d6++){stats[_0x2890('0x55')]+=0x1;if(_0x1abea0[_0x2890('0x43')][_0x3218d6]){handleError(_0x1abea0[_0x2890('0x53')][_0x3218d6],_0x1abea0[_0x2890('0x43')][_0x3218d6]);}else{var _0x22a532=[];for(var _0x3e5c54 in _0x5cc142){if(_0x5cc142[_0x2890('0x56')](_0x3e5c54)){if(_0x1abea0[_0x2890('0x53')][_0x3218d6][_0x5cc142[_0x3e5c54]]){var _0x5d5fca=_[_0x2890('0x57')](_0x1abea0[_0x2890('0x53')][_0x3218d6][_0x5cc142[_0x3e5c54]][_0x2890('0x58')](/"/g,'\x27'));switch(_0x3e5c54){case _0x2890('0x1e'):var _0x4f9c11=moment(_0x5d5fca,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4f9c11[_0x2890('0x59')]()){_0x2b066d['push']('\x22'+_0x5d5fca+'\x22');}else{_0x22a532[_0x2890('0x46')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x3264c9=parseInt(_0x5d5fca);_0x5d5fca=_[_0x2890('0x5a')](_0x3264c9)||_0x3264c9<0x0||_0x3264c9>0x4?_0x10d383?0x3:0x2:_0x3264c9;_0x2b066d[_0x2890('0x46')]('\x22'+_0x5d5fca+'\x22');break;case _0x2890('0x24'):var _0x15ee99=parseInt(_0x5d5fca);if(_['isNumber'](_0x15ee99)&&_[_0x2890('0x5b')](_0x3980ca,_0x15ee99)){_0x2b066d[_0x2890('0x46')]('\x22'+_0x15ee99+'\x22');}else{_0x22a532[_0x2890('0x46')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x5d5fca)){_0x2b066d[_0x2890('0x46')]('\x22'+_0x5d5fca+'\x22');}else{_0x22a532[_0x2890('0x46')]('email\x20wrong\x20format');}break;case _0x2890('0x5c'):var _0x463ed6=moment(_0x5d5fca,_0x2890('0x5d'),!![]);if(_0x463ed6['isValid']()){_0x2b066d[_0x2890('0x46')]('\x22'+_0x5d5fca+'\x22');}else{_0x22a532[_0x2890('0x46')](_0x2890('0x5e'));}break;default:_0x2b066d[_0x2890('0x46')]('\x22'+_0x5d5fca+'\x22');}}else{switch(_0x3e5c54){case'firstName':case _0x2890('0x11'):_0x22a532['push'](_0x3e5c54+'\x20not\x20specified');break;default:_0x2b066d[_0x2890('0x46')]('\x22\x22');}}}}if(_0x22a532[_0x2890('0x54')]){handleError(_0x1abea0[_0x2890('0x53')][_0x3218d6],{'code':'SystemRow','message':_0x22a532[_0x2890('0x12')]()});}else{fs[_0x2890('0x5f')](_0x5514f7,_0x2b066d['join']()+'\x0a');}_0x2b066d=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x55002f,stats);stats[_0x2890('0x43')]=[];}}if(stopped){logger[_0x2890('0x3e')]('Abort\x20parser');_0x23cca2[_0x2890('0x60')]();}}catch(_0x167842){handleError(_0x1abea0[_0x2890('0x53')][_0x3218d6],{'code':_0x2890('0x61'),'message':_0x167842[_0x2890('0x41')]});logger[_0x2890('0x40')]('step',_0x167842[_0x2890('0x41')]);}},'complete':function(){try{var _0x30f819=[];var _0x40246a=_0x2890('0x26');if(_0x1a00ef[_0x2890('0x62')]&&_0x1a00ef[_0x2890('0x62')][_0x2890('0x54')]){_0x40246a='cm_contacts_'+_0x55002f;_0x30f819[_0x2890('0x46')](_0x2890('0x63')+_0x40246a+'\x20LIKE\x20cm_contacts;');}var _0x374597=util['format'](_0x2890('0x64'),_0x5514f7,_0x40246a,_0x55311a,_0x1a00ef['ListId'],_0x1a00ef['CompanyId']||null,NOW,NOW);if(_[_0x2890('0x65')](_0x5cc142[_0x2890('0x1e')])){_0x374597+=_0x2890('0x66');}_0x30f819[_0x2890('0x46')](_0x374597);if(_0x1a00ef[_0x2890('0x62')]&&_0x1a00ef[_0x2890('0x62')][_0x2890('0x54')]){_0x30f819[_0x2890('0x46')](insertCmContact(_0x1a00ef[_0x2890('0x20')],_0x40246a,_0x1a00ef['duplicates'],_0x5cc142));_0x30f819['push'](_0x2890('0x67')+_0x40246a+';');}_0x30f819['push'](insertCmHopper(_0x1a00ef[_0x2890('0x20')],'voice_queues_has_cm_lists',_0x2890('0x68'),'VoiceQueueId',_0x10d383));_0x30f819['push'](insertCmHopperBlack(_0x1a00ef[_0x2890('0x20')],_0x2890('0x69'),_0x2890('0x68'),_0x2890('0x6a')));_0x30f819[_0x2890('0x46')](insertCmHopper(_0x1a00ef[_0x2890('0x20')],_0x2890('0x6b'),'campaigns',_0x2890('0x6c'),_0x10d383));_0x30f819[_0x2890('0x46')](insertCmHopperBlack(_0x1a00ef[_0x2890('0x20')],_0x2890('0x6d'),'campaigns',_0x2890('0x6c')));BPromise[_0x2890('0x6e')](_0x30f819,handleQuery)[_0x2890('0x6f')](function(_0x1012c3){stats[_0x2890('0x70')]=!![];stats[_0x2890('0x71')]=_0x1a00ef[_0x2890('0x62')]&&_0x1a00ef[_0x2890('0x62')][_0x2890('0x54')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0x2890('0x72')](_0x2890('0x73')+_0x55002f,stats);fs[_0x2890('0x74')](_0x388f33);fs['unlink'](_0x5514f7);process['exit'](0x0);})['catch'](function(_0xde35ba){logger[_0x2890('0x40')](_0xde35ba[_0x2890('0x41')]);process[_0x2890('0x42')](0x1);});}catch(_0x3cdfd1){logger[_0x2890('0x40')](_0x2890('0x75'),_0x3cdfd1[_0x2890('0x41')]);process[_0x2890('0x42')](0x1);}},'error':function(_0x221e03,_0x16a6d7,_0x1f716f,_0x1ad095){throw new Error(_0x1ad095);}});}function validate(){if(process[_0x2890('0x76')]&&process[_0x2890('0x76')][_0x2890('0x54')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x12c1dc=path[_0x2890('0x12')](config['root'],_0x2890('0x4e'),process['argv'][0x2]);if(!fs['existsSync'](_0x12c1dc)){throw new Error(_0x2890('0x77'));}var _0x31fab9={};try{_0x31fab9=JSON[_0x2890('0x51')](process['argv'][0x3]);if(!_0x31fab9[_0x2890('0x4b')]){throw new Error(_0x2890('0x78'));}if(!_0x31fab9['binding'][_0x2890('0x11')]){throw new Error(_0x2890('0x79'));}if(!_0x31fab9[_0x2890('0x4b')]['firstName']){throw new Error(_0x2890('0x7a'));}var _0x47b30b=0x0;if(_0x31fab9['binding'][_0x2890('0x24')]){_0x47b30b=0x1;}if(!_0x31fab9[_0x2890('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0xc61aea){throw new Error(_0x2890('0x7b'));}var _0x42f775=[];try{_0x42f775=_[_0x2890('0x7c')](JSON[_0x2890('0x51')](process[_0x2890('0x76')][0x4]),'id');}catch(_0xb2edaf){logger[_0x2890('0x3e')](_0x2890('0x7d'));}main(_0x12c1dc,_0x31fab9,_0x42f775,_0x47b30b);}validate();process['on'](_0x2890('0x7e'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 664ad93..a0c693a 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 _0x676b=['UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue','queue'];(function(_0x2f930c,_0x1620e7){var _0x54fd2a=function(_0xa33dd){while(--_0xa33dd){_0x2f930c['push'](_0x2f930c['shift']());}};_0x54fd2a(++_0x1620e7);}(_0x676b,0xd7));var _0xb676=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x676b[_0x5b5cde];return _0x364ad2;};'use strict';exports['getSubjects']=function(_0x5cf52c,_0x58393d){var _0x53b913=[{'type':_0xb676('0x0'),'content':_0xb676('0x1'),'variableName':null}];switch(_0x5cf52c[_0xb676('0x2')]()){case _0xb676('0x3'):switch(_0x58393d[_0xb676('0x2')]()){case _0xb676('0x4'):_0x53b913['push']({'type':_0xb676('0x5'),'content':'','variableName':'queue'});_0x53b913[_0xb676('0x6')]({'type':_0xb676('0x5'),'content':'','variableName':_0xb676('0x7')});break;case _0xb676('0x8'):_0x53b913[_0xb676('0x6')]({'type':_0xb676('0x0'),'content':_0xb676('0x9'),'variableName':null});_0x53b913[_0xb676('0x6')]({'type':_0xb676('0x5'),'content':'','variableName':_0xb676('0xa')});break;}}return _0x53b913;};exports[_0xb676('0xb')]=function(_0x5c1af3,_0x517030){var _0x598111=[];switch(_0x5c1af3[_0xb676('0x2')]()){case'voice':switch(_0x517030[_0xb676('0x2')]()){case _0xb676('0x4'):_0x598111=[{'type':_0xb676('0x0'),'content':_0xb676('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0xe'),'keyType':_0xb676('0x5'),'variableName':'calleridnum'},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0xf'),'keyType':'variable','variableName':'calleridname'},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x10'),'keyType':_0xb676('0x5'),'variableName':_0xb676('0x11')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x12'),'keyType':_0xb676('0x5'),'variableName':_0xb676('0x13')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x14'),'keyType':_0xb676('0x5'),'variableName':_0xb676('0x15')},{'type':_0xb676('0xd'),'content':'','key':'Date','keyType':_0xb676('0x5'),'variableName':_0xb676('0x16')},{'type':_0xb676('0x0'),'content':_0xb676('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xb676('0xd'),'content':'','key':'Agent\x20Name','keyType':_0xb676('0x5'),'variableName':_0xb676('0x18')},{'type':'keyValue','content':'','key':_0xb676('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0xb676('0x0'),'content':_0xb676('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x1b'),'keyType':'variable','variableName':_0xb676('0x16')},{'type':'keyValue','content':'','key':_0xb676('0x1c'),'keyType':_0xb676('0x5'),'variableName':'agentconnectAt'},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x1d'),'keyType':'variable','variableName':_0xb676('0x1e')},{'type':'keyValue','content':'','key':_0xb676('0x1f'),'keyType':_0xb676('0x5'),'variableName':_0xb676('0x20')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x21'),'keyType':'variable','variableName':_0xb676('0x22')}];break;case'outbound':_0x598111=[{'type':_0xb676('0x0'),'content':_0xb676('0xc'),'variableName':null},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x23'),'keyType':_0xb676('0x5'),'keyContent':'','variableName':_0xb676('0xa')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x24'),'keyType':'variable','keyContent':'','variableName':_0xb676('0x25')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xb676('0x5'),'keyContent':'','variableName':_0xb676('0x15')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x26'),'keyType':_0xb676('0x5'),'keyContent':'','variableName':_0xb676('0x27')},{'type':_0xb676('0x0'),'content':_0xb676('0x1a')},{'type':'keyValue','content':'','key':_0xb676('0x28'),'keyType':_0xb676('0x5'),'keyContent':'','variableName':_0xb676('0x29')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xb676('0x2a')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x2b'),'keyType':_0xb676('0x5'),'keyContent':'','variableName':_0xb676('0x2c')},{'type':_0xb676('0xd'),'content':'','key':_0xb676('0x2d'),'keyType':_0xb676('0x5'),'keyContent':'','variableName':_0xb676('0x2e')}];break;}}return _0x598111;}; \ No newline at end of file +var _0xd4d4=['agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Queue','queue','UniqueId','uniqueid','Date'];(function(_0x29429e,_0x22b056){var _0x11ec37=function(_0x26358f){while(--_0x26358f){_0x29429e['push'](_0x29429e['shift']());}};_0x11ec37(++_0x22b056);}(_0xd4d4,0xf1));var _0x4d4d=function(_0x31b8fb,_0x5b9428){_0x31b8fb=_0x31b8fb-0x0;var _0x3d73a5=_0xd4d4[_0x31b8fb];return _0x3d73a5;};'use strict';exports[_0x4d4d('0x0')]=function(_0x10fe78,_0x11970f){var _0x66071b=[{'type':_0x4d4d('0x1'),'content':_0x4d4d('0x2'),'variableName':null}];switch(_0x10fe78[_0x4d4d('0x3')]()){case _0x4d4d('0x4'):switch(_0x11970f[_0x4d4d('0x3')]()){case _0x4d4d('0x5'):_0x66071b['push']({'type':_0x4d4d('0x6'),'content':'','variableName':'queue'});_0x66071b[_0x4d4d('0x7')]({'type':_0x4d4d('0x6'),'content':'','variableName':_0x4d4d('0x8')});break;case _0x4d4d('0x9'):_0x66071b[_0x4d4d('0x7')]({'type':_0x4d4d('0x1'),'content':_0x4d4d('0xa'),'variableName':null});_0x66071b[_0x4d4d('0x7')]({'type':'variable','content':'','variableName':_0x4d4d('0xb')});break;}}return _0x66071b;};exports[_0x4d4d('0xc')]=function(_0x4cdb5b,_0x2c5a6e){var _0x22292f=[];switch(_0x4cdb5b[_0x4d4d('0x3')]()){case'voice':switch(_0x2c5a6e['toLowerCase']()){case _0x4d4d('0x5'):_0x22292f=[{'type':'string','content':_0x4d4d('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0xf'),'keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x8')},{'type':'keyValue','content':'','key':_0x4d4d('0x10'),'keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x11')},{'type':_0x4d4d('0xe'),'content':'','key':'Call\x20To','keyType':_0x4d4d('0x6'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0x4d4d('0x12'),'keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x13')},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x14'),'keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x15')},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x16'),'keyType':'variable','variableName':_0x4d4d('0x17')},{'type':_0x4d4d('0x1'),'content':_0x4d4d('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x19'),'keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x1a')},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x1b'),'keyType':'variable','variableName':_0x4d4d('0xb')},{'type':_0x4d4d('0x1'),'content':_0x4d4d('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x4d4d('0xe'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x4d4d('0x17')},{'type':_0x4d4d('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x1d')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x1e')},{'type':'keyValue','content':'','key':_0x4d4d('0x1f'),'keyType':_0x4d4d('0x6'),'variableName':_0x4d4d('0x20')},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x21'),'keyType':'variable','variableName':_0x4d4d('0x22')}];break;case _0x4d4d('0x9'):_0x22292f=[{'type':_0x4d4d('0x1'),'content':_0x4d4d('0xd'),'variableName':null},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x23'),'keyType':_0x4d4d('0x6'),'keyContent':'','variableName':_0x4d4d('0xb')},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x24'),'keyType':'variable','keyContent':'','variableName':_0x4d4d('0x25')},{'type':_0x4d4d('0xe'),'content':'','key':'UniqueId','keyType':_0x4d4d('0x6'),'keyContent':'','variableName':_0x4d4d('0x15')},{'type':'keyValue','content':'','key':_0x4d4d('0x16'),'keyType':_0x4d4d('0x6'),'keyContent':'','variableName':_0x4d4d('0x26')},{'type':_0x4d4d('0x1'),'content':_0x4d4d('0x1c')},{'type':'keyValue','content':'','key':_0x4d4d('0x27'),'keyType':_0x4d4d('0x6'),'keyContent':'','variableName':_0x4d4d('0x28')},{'type':'keyValue','content':'','key':_0x4d4d('0x29'),'keyType':_0x4d4d('0x6'),'keyContent':'','variableName':_0x4d4d('0x2a')},{'type':_0x4d4d('0xe'),'content':'','key':_0x4d4d('0x2b'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x4d4d('0xe'),'content':'','key':'Billable\x20Time','keyType':_0x4d4d('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x22292f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index bffe077..337523e 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 _0x04d5=['update','info','catch','clone','body','omit','phone','mobile','lodash','../../mysqldb','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then'];(function(_0x3edb5d,_0x850915){var _0x14e109=function(_0x2f51a6){while(--_0x2f51a6){_0x3edb5d['push'](_0x3edb5d['shift']());}};_0x14e109(++_0x850915);}(_0x04d5,0x1e8));var _0x504d=function(_0x170f4d,_0x1dc262){_0x170f4d=_0x170f4d-0x0;var _0x94eef0=_0x04d5[_0x170f4d];return _0x94eef0;};'use strict';var _=require(_0x504d('0x0'));var db=require(_0x504d('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x504d('0x2'))('fax-interactions'),'sms':require(_0x504d('0x2'))(_0x504d('0x3')),'chat':require('../../config/logger')(_0x504d('0x4')),'whatsapp':require('../../config/logger')(_0x504d('0x5'))};function getInteractionId(_0x862570,_0x7d3884,_0x55d2db){if(_0x862570&&_0x862570[_[_0x504d('0x6')](_0x55d2db)+'InteractionId']){return _0x862570[_[_0x504d('0x6')](_0x55d2db)+'InteractionId'];}else if(_0x862570&&_0x862570['id']){return _0x862570['id'];}else if(_0x7d3884&&_0x7d3884['id']){return _0x7d3884['id'];}else{return _0x504d('0x7');}}function log(_0x43c031,_0x103df2,_0x32bc6e,_0x512439,_0x3389b2,_0x1f850c){loggers[_0x3389b2['toLowerCase']()][_0x43c031](_0x504d('0x8'),_0x1f850c['toUpperCase'](),_0x103df2?_0x103df2['id']:null,_0x103df2?_0x103df2[_0x504d('0x9')]:null,_0x103df2?_0x103df2[_0x504d('0xa')]:null,getInteractionId(_0x32bc6e,_0x512439,_0x3389b2),_0x32bc6e?JSON[_0x504d('0xb')](_0x32bc6e):_0x504d('0xc'));}function updateUser(_0x3d6722,_0x409097,_0x22dde1,_0x56c52,_0x4af49d){db[_[_0x504d('0x6')](_0x56c52)+_0x504d('0xd')][_0x504d('0xe')]({'where':{'id':getInteractionId(_0x409097,_0x22dde1,_0x56c52)}})[_0x504d('0xf')](function(_0x532597){if(_0x532597){return _0x532597[_0x504d('0x10')]({'UserId':_0x3d6722?_0x3d6722['id']:null});}})[_0x504d('0xf')](function(_0x3220b9){if(_0x3220b9){log(_0x504d('0x11'),_0x3d6722,_0x409097,_0x22dde1,_0x56c52,_0x4af49d);}})[_0x504d('0x12')](function(){log('error',_0x3d6722,_0x409097,_0x22dde1,_0x56c52,_0x4af49d);});}exports['tracked']=function(_0x42e4c5,_0x4c82c2){return function(_0x145f35,_0x7a2ffc,_0x1ca9ab){var _0x3a18f7=_0x145f35['user'];var _0xb3fa1e={};var _0x1815f4=_0x145f35['query'];if(_0xb3fa1e){_0xb3fa1e=_[_0x504d('0x13')](_0x145f35[_0x504d('0x14')]);_0xb3fa1e=_[_0x504d('0x15')](_0xb3fa1e,[_0x504d('0x14'),'html',_0x504d('0x16'),'fax',_0x504d('0x17')]);}updateUser(_0x3a18f7,_0xb3fa1e,_0x1815f4,_0x42e4c5,_0x4c82c2);_0x1ca9ab(null);};}; \ No newline at end of file +var _0x89df=['whatsapp-interactions','InteractionId','upperFirst','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x37c734,_0x450d77){var _0x3e0a4f=function(_0x2146be){while(--_0x2146be){_0x37c734['push'](_0x37c734['shift']());}};_0x3e0a4f(++_0x450d77);}(_0x89df,0x121));var _0xf89d=function(_0x5f0198,_0x117ef1){_0x5f0198=_0x5f0198-0x0;var _0x87134b=_0x89df[_0x5f0198];return _0x87134b;};'use strict';var _=require(_0xf89d('0x0'));var db=require(_0xf89d('0x1'))['db'];var loggers={'openchannel':require(_0xf89d('0x2'))(_0xf89d('0x3')),'mail':require(_0xf89d('0x2'))(_0xf89d('0x4')),'fax':require(_0xf89d('0x2'))(_0xf89d('0x5')),'sms':require(_0xf89d('0x2'))(_0xf89d('0x6')),'chat':require(_0xf89d('0x2'))(_0xf89d('0x7')),'whatsapp':require('../../config/logger')(_0xf89d('0x8'))};function getInteractionId(_0x5c793b,_0x3de301,_0x49215a){if(_0x5c793b&&_0x5c793b[_['upperFirst'](_0x49215a)+_0xf89d('0x9')]){return _0x5c793b[_[_0xf89d('0xa')](_0x49215a)+_0xf89d('0x9')];}else if(_0x5c793b&&_0x5c793b['id']){return _0x5c793b['id'];}else if(_0x3de301&&_0x3de301['id']){return _0x3de301['id'];}else{return _0xf89d('0xb');}}function log(_0x126d6b,_0x15e4c9,_0x469bdc,_0x251de2,_0x5c0900,_0x2bfde1){loggers[_0x5c0900['toLowerCase']()][_0x126d6b](_0xf89d('0xc'),_0x2bfde1['toUpperCase'](),_0x15e4c9?_0x15e4c9['id']:null,_0x15e4c9?_0x15e4c9[_0xf89d('0xd')]:null,_0x15e4c9?_0x15e4c9[_0xf89d('0xe')]:null,getInteractionId(_0x469bdc,_0x251de2,_0x5c0900),_0x469bdc?JSON[_0xf89d('0xf')](_0x469bdc):_0xf89d('0x10'));}function updateUser(_0x34fd52,_0x26d3c9,_0x490325,_0x305bc0,_0x631df7){db[_[_0xf89d('0xa')](_0x305bc0)+_0xf89d('0x11')][_0xf89d('0x12')]({'where':{'id':getInteractionId(_0x26d3c9,_0x490325,_0x305bc0)}})[_0xf89d('0x13')](function(_0x4558a0){if(_0x4558a0){return _0x4558a0[_0xf89d('0x14')]({'UserId':_0x34fd52?_0x34fd52['id']:null});}})[_0xf89d('0x13')](function(_0xb792ca){if(_0xb792ca){log(_0xf89d('0x15'),_0x34fd52,_0x26d3c9,_0x490325,_0x305bc0,_0x631df7);}})[_0xf89d('0x16')](function(){log(_0xf89d('0x17'),_0x34fd52,_0x26d3c9,_0x490325,_0x305bc0,_0x631df7);});}exports[_0xf89d('0x18')]=function(_0x406083,_0x408811){return function(_0x322e4b,_0x1abec4,_0x2f6043){var _0xbc12a=_0x322e4b[_0xf89d('0x19')];var _0x1324de={};var _0x3e4fb3=_0x322e4b[_0xf89d('0x1a')];if(_0x1324de){_0x1324de=_[_0xf89d('0x1b')](_0x322e4b[_0xf89d('0x1c')]);_0x1324de=_[_0xf89d('0x1d')](_0x1324de,[_0xf89d('0x1c'),_0xf89d('0x1e'),_0xf89d('0x1f'),_0xf89d('0x20'),'mobile']);}updateUser(_0xbc12a,_0x1324de,_0x3e4fb3,_0x406083,_0x408811);_0x2f6043(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 3925c61..7cd8567 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 _0xacb5=['final','parse','use','License','findOne','then','count','json','format','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','update','base64'];(function(_0x397c43,_0x1687ee){var _0x6fe36c=function(_0x156fd3){while(--_0x156fd3){_0x397c43['push'](_0x397c43['shift']());}};_0x6fe36c(++_0x1687ee);}(_0xacb5,0x1d1));var _0x5acb=function(_0x35eea6,_0x195b2a){_0x35eea6=_0x35eea6-0x0;var _0x23c5c5=_0xacb5[_0x35eea6];return _0x23c5c5;};'use strict';var crypto=require(_0x5acb('0x0'));var util=require(_0x5acb('0x1'));var compose=require(_0x5acb('0x2'));var db=require(_0x5acb('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x261820,_0x8e458d){if(_0x261820&&_0x8e458d){if(_0x8e458d[_0x5acb('0x4')]&&_0x8e458d['license']){var _0xe11932=_0x8e458d[_0x5acb('0x4')];var _0xde5989=_0x8e458d[_0x5acb('0x5')];var _0xc2ed33=_0xe11932['split']('-')[0x4];var _0x32e166=_0xe11932[_0x5acb('0x6')]('-')[0x0];var _0x2cfc3a=crypto[_0x5acb('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0xc2ed33,_0xe11932,_0x32e166));var _0x1c39a4=_0x2cfc3a[_0x5acb('0x8')](_0xde5989,_0x5acb('0x9'),'utf8');_0x1c39a4+=_0x2cfc3a[_0x5acb('0xa')]('utf8');var _0x2d3fbb=JSON[_0x5acb('0xb')](_0x1c39a4);return _0x2d3fbb['hasOwnProperty'](_0x261820)?_0x2d3fbb[_0x261820]:null;}}return null;}function isLimit(_0x194eae,_0x448dc9,_0x1785f6,_0x387db7){var _0xb5b719=_0x448dc9;return compose()[_0x5acb('0xc')](function(_0x265eb6,_0x446841,_0x312583){return db[_0x5acb('0xd')][_0x5acb('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5acb('0xf')](function(_0x4f10c6){var _0x207780=getValueFromLicense(_0x194eae,_0x4f10c6);return _0x207780?_0x207780:_0xb5b719;})[_0x5acb('0xf')](function(_0x5c57a6){_0xb5b719=_0x5c57a6;return _0x1785f6[_0x5acb('0x10')](_0x387db7);})[_0x5acb('0xf')](function(_0x17a911){if(_0x17a911>=_0xb5b719){return _0x446841['status'](0x193)[_0x5acb('0x11')]({'message':util[_0x5acb('0x12')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x194eae)});}_0x312583();})[_0x5acb('0x13')](function(_0x4589e1){_0x312583(_0x4589e1);});});}function isUserLimit(){return isLimit(_0x5acb('0x14'),0x1,db[_0x5acb('0x15')],{'where':{'$or':[{'role':_0x5acb('0x16')},{'role':_0x5acb('0x17')}]}});}exports[_0x5acb('0x18')]=isUserLimit; \ No newline at end of file +var _0xf6cb=['catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','License','findOne','count','then','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x1faef4,_0x38ef7c){var _0x48f2b0=function(_0x10ac33){while(--_0x10ac33){_0x1faef4['push'](_0x1faef4['shift']());}};_0x48f2b0(++_0x38ef7c);}(_0xf6cb,0xa7));var _0xbf6c=function(_0x27e6cd,_0x5d2e3b){_0x27e6cd=_0x27e6cd-0x0;var _0x5d4dc3=_0xf6cb[_0x27e6cd];return _0x5d4dc3;};'use strict';var crypto=require(_0xbf6c('0x0'));var util=require(_0xbf6c('0x1'));var compose=require(_0xbf6c('0x2'));var db=require(_0xbf6c('0x3'))['db'];var config=require(_0xbf6c('0x4'));function getValueFromLicense(_0x26df94,_0x1395c7){if(_0x26df94&&_0x1395c7){if(_0x1395c7[_0xbf6c('0x5')]&&_0x1395c7[_0xbf6c('0x6')]){var _0x57c380=_0x1395c7[_0xbf6c('0x5')];var _0x4582a4=_0x1395c7['license'];var _0x2b5a5b=_0x57c380['split']('-')[0x4];var _0x5bd760=_0x57c380['split']('-')[0x0];var _0x1b0b87=crypto[_0xbf6c('0x7')](_0xbf6c('0x8'),util['format'](_0xbf6c('0x9'),_0x2b5a5b,_0x57c380,_0x5bd760));var _0x38fcb2=_0x1b0b87[_0xbf6c('0xa')](_0x4582a4,_0xbf6c('0xb'),_0xbf6c('0xc'));_0x38fcb2+=_0x1b0b87[_0xbf6c('0xd')](_0xbf6c('0xc'));var _0x404e51=JSON['parse'](_0x38fcb2);return _0x404e51[_0xbf6c('0xe')](_0x26df94)?_0x404e51[_0x26df94]:null;}}return null;}function isLimit(_0x1b56a1,_0x34e00b,_0x2ab79c,_0x5a7341){var _0x24b0f0=_0x34e00b;return compose()['use'](function(_0xcfc959,_0x33eae5,_0x493912){return db[_0xbf6c('0xf')][_0xbf6c('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x28ffef){var _0x5ac870=getValueFromLicense(_0x1b56a1,_0x28ffef);return _0x5ac870?_0x5ac870:_0x24b0f0;})['then'](function(_0x9585cc){_0x24b0f0=_0x9585cc;return _0x2ab79c[_0xbf6c('0x11')](_0x5a7341);})[_0xbf6c('0x12')](function(_0x52c11a){if(_0x52c11a>=_0x24b0f0){return _0x33eae5[_0xbf6c('0x13')](0x193)['json']({'message':util[_0xbf6c('0x14')](_0xbf6c('0x15'),_0x1b56a1)});}_0x493912();})[_0xbf6c('0x16')](function(_0x369415){_0x493912(_0x369415);});});}function isUserLimit(){return isLimit(_0xbf6c('0x17'),0x1,db[_0xbf6c('0x18')],{'where':{'$or':[{'role':_0xbf6c('0x19')},{'role':_0xbf6c('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index eb218ea..d573e25 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 _0x23cf=['$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','length','split','slice','forEach','shift','match','filter','map','conditions','push','buildExpression','DATE','$eq','$between','value','$lte','add','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','operator','$ne'];(function(_0xa8d323,_0x427a6c){var _0x369959=function(_0x431c02){while(--_0x431c02){_0xa8d323['push'](_0xa8d323['shift']());}};_0x369959(++_0x427a6c);}(_0x23cf,0xec));var _0xf23c=function(_0x4aec40,_0x13a3b0){_0x4aec40=_0x4aec40-0x0;var _0x6d1f15=_0x23cf[_0x4aec40];return _0x6d1f15;};'use strict';var _=require(_0xf23c('0x0'));var moment=require(_0xf23c('0x1'));exports[_0xf23c('0x2')]=function(_0x2372f2){var _0x6047aa={'conditions':[]};_0x6047aa[_0xf23c('0x3')]=_[_0xf23c('0x4')](_0x2372f2,'[$or]')?'or':_0xf23c('0x5');var _0x5e362c=_0x2372f2[_0xf23c('0x6')](_0xf23c('0x7'),'')[_0xf23c('0x6')](_0xf23c('0x8'),'')['split']('||');for(var _0xe0a8ca=0x0;_0xe0a8ca<_0x5e362c[_0xf23c('0x9')];_0xe0a8ca++){var _0x5bc6cb=_0x5e362c[_0xe0a8ca][_0xf23c('0xa')](':=');var _0x5f1fb7=_0x5bc6cb[0x0];var _0x4b401d=_0x5bc6cb[_0xf23c('0xb')](0x1);_0x4b401d[_0xf23c('0xc')](function(_0x3fffe8){var _0x9da7fd=_0x3fffe8['split']('[')[_0xf23c('0xd')]();var _0x3da840=_0x3fffe8[_0xf23c('0xe')](/\[(.*?)\]/g);_0x3da840[_0xf23c('0xc')](function(_0x3da734){var _0x20cff3=_0x3da734[_0xf23c('0xa')]('[')[_0xf23c('0xf')](function(_0x30c3e8){return _0x30c3e8['indexOf'](']')>-0x1;})[_0xf23c('0x10')](function(_0x314c2d){return _0x314c2d[_0xf23c('0xa')](']')[0x0];})[0x0];_0x6047aa[_0xf23c('0x11')][_0xf23c('0x12')]({'field':_0x5f1fb7,'operator':_0x9da7fd,'value':_0x20cff3});});});}return _0x6047aa;};exports[_0xf23c('0x13')]=function(_0x541271,_0x3b53ea,_0x5f8a2a){var _0x5403fa={};if(_0x3b53ea===_0xf23c('0x14')){if(_0x5f8a2a['operator']===_0xf23c('0x15')){_0x5f8a2a['operator']=_0xf23c('0x16');_0x5f8a2a[_0xf23c('0x17')]+=','+_0x5f8a2a[_0xf23c('0x17')];}else if(_['includes'](['$gt',_0xf23c('0x18')],_0x5f8a2a['operator'])){_0x5f8a2a['value']=moment(_0x5f8a2a[_0xf23c('0x17')])[_0xf23c('0x19')](0x1,'days')[_0xf23c('0x1a')](_0xf23c('0x1b'));}}if(_0x5f8a2a['castTo']){_0x3b53ea=_0x5f8a2a[_0xf23c('0x1c')];_0x5403fa[_0xf23c('0x1d')]='CAST('+_0x541271+'.'+_0x5f8a2a[_0xf23c('0x1e')]+_0xf23c('0x1f')+_0x5f8a2a['castTo']+')\x20'+parseOperator(_0x5f8a2a['operator']);}else{_0x5403fa[_0xf23c('0x1d')]=_0x541271+'.'+_0x5f8a2a[_0xf23c('0x1e')]+'\x20'+parseOperator(_0x5f8a2a[_0xf23c('0x20')]);}if(_['includes']([_0xf23c('0x21'),_0xf23c('0x22')],_0x5f8a2a['operator']))_0x5403fa[_0xf23c('0x1d')]='('+_0x5403fa['text']+_0xf23c('0x23')+_0x541271+'.'+_0x5f8a2a[_0xf23c('0x1e')]+_0xf23c('0x24');_0x5403fa[_0xf23c('0x17')]=parseValue(_0x3b53ea,_0x5f8a2a[_0xf23c('0x20')],_0x5f8a2a['value']);return _0x5403fa;};function parseOperator(_0x5507c3){var _0x4ea305;switch(_0x5507c3){case _0xf23c('0x25'):_0x4ea305='IN\x20?';break;case _0xf23c('0x22'):_0x4ea305='NOT\x20IN\x20?';break;case _0xf23c('0x15'):_0x4ea305='=\x20?';break;case _0xf23c('0x21'):_0x4ea305=_0xf23c('0x26');break;case _0xf23c('0x27'):case _0xf23c('0x28'):case _0xf23c('0x29'):_0x4ea305=_0xf23c('0x2a');break;case _0xf23c('0x2b'):_0x4ea305='<\x20?';break;case _0xf23c('0x2c'):_0x4ea305=_0xf23c('0x2d');break;case _0xf23c('0x18'):_0x4ea305=_0xf23c('0x2e');break;case _0xf23c('0x2f'):_0x4ea305=_0xf23c('0x30');break;case'$between':_0x4ea305=_0xf23c('0x31');break;}return _0x4ea305;}function parseValue(_0x46eff5,_0x1f2108,_0x3400ec){var _0xf2c9c8={'start':undefined,'end':undefined};switch(_0x1f2108){case _0xf23c('0x25'):case _0xf23c('0x22'):_0xf2c9c8[_0xf23c('0x32')]=_0x3400ec[_0xf23c('0xa')](',');break;case _0xf23c('0x27'):_0xf2c9c8[_0xf23c('0x32')]='%'+_0x3400ec+'%';break;case'$startsWith':_0xf2c9c8[_0xf23c('0x32')]=_0x3400ec+'%';break;case _0xf23c('0x29'):_0xf2c9c8[_0xf23c('0x32')]='%'+_0x3400ec;break;case'$between':var _0x4fe720=_0x3400ec['split'](',');var _0x3400ec=_0x4fe720[_0xf23c('0xd')]();var _0x3df480=_0x4fe720[_0xf23c('0x33')]();if(_0x46eff5===_0xf23c('0x14')){_0x3400ec=moment(_0x3400ec)[_0xf23c('0x34')](0x0,!![])[_0xf23c('0x1a')]();_0x3df480=moment(_0x3df480)[_0xf23c('0x34')](0x0,!![])['add'](0x17,_0xf23c('0x35'))['add'](0x3b,'minutes')['add'](0x3b,'seconds')['format']();}_0xf2c9c8={'start':_0x3400ec,'end':_0x3df480};break;default:_0xf2c9c8[_0xf23c('0x32')]=_0x3400ec;break;}return _0xf2c9c8;} \ No newline at end of file +var _0x2a9f=['forEach','shift','map','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','$between','start','$startsWith','pop','utcOffset','hours','seconds','lodash','parseSearch','[$or]','replace','[$and]','split','length','slice'];(function(_0x3482f7,_0xd34bfa){var _0x1b8f33=function(_0x4d702c){while(--_0x4d702c){_0x3482f7['push'](_0x3482f7['shift']());}};_0x1b8f33(++_0xd34bfa);}(_0x2a9f,0x190));var _0xf2a9=function(_0x34e675,_0xf1df78){_0x34e675=_0x34e675-0x0;var _0x296a0c=_0x2a9f[_0x34e675];return _0x296a0c;};'use strict';var _=require(_0xf2a9('0x0'));var moment=require('moment');exports[_0xf2a9('0x1')]=function(_0x5512b0){var _0x2a0e62={'conditions':[]};_0x2a0e62['sqlOperator']=_['startsWith'](_0x5512b0,_0xf2a9('0x2'))?'or':'and';var _0xc4baf8=_0x5512b0[_0xf2a9('0x3')](_0xf2a9('0x4'),'')[_0xf2a9('0x3')](_0xf2a9('0x2'),'')[_0xf2a9('0x5')]('||');for(var _0x3d03ac=0x0;_0x3d03ac<_0xc4baf8[_0xf2a9('0x6')];_0x3d03ac++){var _0x1ce58b=_0xc4baf8[_0x3d03ac]['split'](':=');var _0x422a7d=_0x1ce58b[0x0];var _0x3f7a1f=_0x1ce58b[_0xf2a9('0x7')](0x1);_0x3f7a1f[_0xf2a9('0x8')](function(_0x46fcf3){var _0x44d5f2=_0x46fcf3[_0xf2a9('0x5')]('[')[_0xf2a9('0x9')]();var _0xd87c1=_0x46fcf3['match'](/\[(.*?)\]/g);_0xd87c1[_0xf2a9('0x8')](function(_0x197f81){var _0x4751d1=_0x197f81[_0xf2a9('0x5')]('[')['filter'](function(_0x303f6c){return _0x303f6c['indexOf'](']')>-0x1;})[_0xf2a9('0xa')](function(_0x85ddf3){return _0x85ddf3[_0xf2a9('0x5')](']')[0x0];})[0x0];_0x2a0e62[_0xf2a9('0xb')][_0xf2a9('0xc')]({'field':_0x422a7d,'operator':_0x44d5f2,'value':_0x4751d1});});});}return _0x2a0e62;};exports[_0xf2a9('0xd')]=function(_0x823aaa,_0x1a6181,_0x32ec64){var _0x1717f6={};if(_0x1a6181===_0xf2a9('0xe')){if(_0x32ec64[_0xf2a9('0xf')]===_0xf2a9('0x10')){_0x32ec64[_0xf2a9('0xf')]='$between';_0x32ec64[_0xf2a9('0x11')]+=','+_0x32ec64['value'];}else if(_[_0xf2a9('0x12')]([_0xf2a9('0x13'),_0xf2a9('0x14')],_0x32ec64[_0xf2a9('0xf')])){_0x32ec64[_0xf2a9('0x11')]=moment(_0x32ec64[_0xf2a9('0x11')])[_0xf2a9('0x15')](0x1,_0xf2a9('0x16'))[_0xf2a9('0x17')](_0xf2a9('0x18'));}}if(_0x32ec64[_0xf2a9('0x19')]){_0x1a6181=_0x32ec64['castTo'];_0x1717f6[_0xf2a9('0x1a')]=_0xf2a9('0x1b')+_0x823aaa+'.'+_0x32ec64[_0xf2a9('0x1c')]+'\x20AS\x20'+_0x32ec64[_0xf2a9('0x19')]+')\x20'+parseOperator(_0x32ec64['operator']);}else{_0x1717f6[_0xf2a9('0x1a')]=_0x823aaa+'.'+_0x32ec64[_0xf2a9('0x1c')]+'\x20'+parseOperator(_0x32ec64[_0xf2a9('0xf')]);}if(_[_0xf2a9('0x12')]([_0xf2a9('0x1d'),_0xf2a9('0x1e')],_0x32ec64[_0xf2a9('0xf')]))_0x1717f6[_0xf2a9('0x1a')]='('+_0x1717f6[_0xf2a9('0x1a')]+'\x20OR\x20'+_0x823aaa+'.'+_0x32ec64[_0xf2a9('0x1c')]+'\x20IS\x20NULL)';_0x1717f6[_0xf2a9('0x11')]=parseValue(_0x1a6181,_0x32ec64[_0xf2a9('0xf')],_0x32ec64['value']);return _0x1717f6;};function parseOperator(_0x35405b){var _0xa5b4d3;switch(_0x35405b){case _0xf2a9('0x1f'):_0xa5b4d3=_0xf2a9('0x20');break;case'$notIn':_0xa5b4d3=_0xf2a9('0x21');break;case _0xf2a9('0x10'):_0xa5b4d3=_0xf2a9('0x22');break;case _0xf2a9('0x1d'):_0xa5b4d3=_0xf2a9('0x23');break;case _0xf2a9('0x24'):case'$startsWith':case _0xf2a9('0x25'):_0xa5b4d3=_0xf2a9('0x26');break;case _0xf2a9('0x27'):_0xa5b4d3=_0xf2a9('0x28');break;case'$gt':_0xa5b4d3=_0xf2a9('0x29');break;case _0xf2a9('0x14'):_0xa5b4d3=_0xf2a9('0x2a');break;case _0xf2a9('0x2b'):_0xa5b4d3='>=\x20?';break;case _0xf2a9('0x2c'):_0xa5b4d3='BETWEEN\x20?\x20AND\x20?';break;}return _0xa5b4d3;}function parseValue(_0x5a2bae,_0x3bb7e1,_0x2d3b49){var _0xd1b641={'start':undefined,'end':undefined};switch(_0x3bb7e1){case'$in':case'$notIn':_0xd1b641[_0xf2a9('0x2d')]=_0x2d3b49[_0xf2a9('0x5')](',');break;case'$substring':_0xd1b641[_0xf2a9('0x2d')]='%'+_0x2d3b49+'%';break;case _0xf2a9('0x2e'):_0xd1b641[_0xf2a9('0x2d')]=_0x2d3b49+'%';break;case _0xf2a9('0x25'):_0xd1b641[_0xf2a9('0x2d')]='%'+_0x2d3b49;break;case _0xf2a9('0x2c'):var _0x461214=_0x2d3b49[_0xf2a9('0x5')](',');var _0x2d3b49=_0x461214[_0xf2a9('0x9')]();var _0x17ef2d=_0x461214[_0xf2a9('0x2f')]();if(_0x5a2bae===_0xf2a9('0xe')){_0x2d3b49=moment(_0x2d3b49)[_0xf2a9('0x30')](0x0,!![])[_0xf2a9('0x17')]();_0x17ef2d=moment(_0x17ef2d)[_0xf2a9('0x30')](0x0,!![])[_0xf2a9('0x15')](0x17,_0xf2a9('0x31'))['add'](0x3b,'minutes')[_0xf2a9('0x15')](0x3b,_0xf2a9('0x32'))[_0xf2a9('0x17')]();}_0xd1b641={'start':_0x2d3b49,'end':_0x17ef2d};break;default:_0xd1b641[_0xf2a9('0x2d')]=_0x2d3b49;break;}return _0xd1b641;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index c05ab2c..2629e43 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 _0x3ed8=['isEmail','forEach','replace','push','join','query','$id','map','model','attributes','intersection','order','where','pick','object','filter','columns','value','merge','lower','col','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','forOwn','find','type','DATE','isPlainObject','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','unsigned','substr','DESC','ASC','isEmpty','omit','isString','length','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$'];(function(_0x18042b,_0x140f60){var _0x7dd973=function(_0x204c0a){while(--_0x204c0a){_0x18042b['push'](_0x18042b['shift']());}};_0x7dd973(++_0x140f60);}(_0x3ed8,0x17d));var _0x83ed=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x3ed8[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x83ed('0x0'));var sequelize=require(_0x83ed('0x1'));var moment=require(_0x83ed('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5e7717){var _0x237464=['ne'];try{var _0x1f0cef=JSON[_0x83ed('0x3')](_0x5e7717);var _0x3b3c26=Object[_0x83ed('0x4')](_0x1f0cef)[0x0];return _0x237464[_0x83ed('0x5')](_0x3b3c26);}catch(_0x70a478){return![];}}function getOperatorValue(_0x2d2e9f){var _0x531321=JSON[_0x83ed('0x3')](_0x2d2e9f);var _0x21c3a3=Object['keys'](_0x531321)[0x0];var _0x5caa85=_0x531321[_0x21c3a3];return{['$'+_0x21c3a3]:_0x5caa85};}exports[_0x83ed('0x6')]=function(_0xb7f180){var _0x3c47b7=null;if(_0xb7f180){_0x3c47b7=_0xb7f180[_0x83ed('0x7')](',');}return _0x3c47b7;};exports[_0x83ed('0x8')]=function(_0x33f31b,_0x535190){var _0x21f46d={};if(!_['isEmpty'](_0x33f31b)){_[_0x83ed('0x9')](_0x33f31b,function(_0x2f1692,_0x56b7b7){try{if(_0x535190){var _0x3e7082=_[_0x83ed('0xa')](_0x535190,{'name':_0x56b7b7})||{};if(hasSequelizeOperator(_0x2f1692)){_0x21f46d[_0x56b7b7]=getOperatorValue(_0x2f1692);}else if(_0x3e7082[_0x83ed('0xb')]===_0x83ed('0xc')&&_[_0x83ed('0xd')](_0x2f1692)){var _0xb2969b=JSON[_0x83ed('0x3')](_0x2f1692);var _0x1e77b1={'$gte':moment(moment(_0xb2969b['$gte'])['format'](_0x83ed('0xe')))[_0x83ed('0xf')]()[_0x83ed('0x10')](),'$lte':moment(moment(_0xb2969b['$lte'])[_0x83ed('0x10')]('YYYY-MM-DD'))[_0x83ed('0xf')]()[_0x83ed('0x11')](0x1,'s')[_0x83ed('0x10')]()};_0x21f46d[_0x56b7b7]=_0x1e77b1;}else if(_0x3e7082[_0x83ed('0x12')]===_0x83ed('0x13')){_0x21f46d[_0x56b7b7]=_0x2f1692;}else{_0x21f46d[_0x56b7b7]=_[_0x83ed('0x14')](_0x2f1692)?_0x2f1692:JSON[_0x83ed('0x3')](_0x2f1692);}}else{_0x21f46d[_0x56b7b7]=_[_0x83ed('0x14')](_0x2f1692)?_0x2f1692:JSON[_0x83ed('0x3')](_0x2f1692);}}catch(_0x14635b){_0x21f46d[_0x56b7b7]=_0x2f1692[_0x83ed('0x7')](',');}});}return _0x21f46d;};exports[_0x83ed('0x15')]=function(_0x3f8ea7){_0x3f8ea7=parseInt(_0x3f8ea7,0xa);if(!_0x3f8ea7||_0x3f8ea7<0x0){_0x3f8ea7=LIMIT_VALUE;}return _0x3f8ea7;};exports[_0x83ed('0x16')]=function(_0x242a53){_0x242a53=parseInt(_0x242a53,0xa);if(!_0x242a53||_0x242a53<0x0){_0x242a53=0x0;}return _0x242a53;};exports[_0x83ed('0x17')]=function(_0x120b76){var _0x3e75ac,_0x315bf8=null;if(_0x120b76){_0x3e75ac=_0x120b76[_0x83ed('0x7')](',');_0x315bf8=_['map'](_0x3e75ac,function(_0x381856){if(_0x381856[_0x83ed('0x18')]('-')===0x0){return[_0x381856===_0x83ed('0x19')?sequelize[_0x83ed('0x1a')](sequelize['col'](_0x83ed('0x19')),_0x83ed('0x1b')):_0x381856[_0x83ed('0x1c')](0x1),_0x83ed('0x1d')];}else{return[_0x381856===_0x83ed('0x19')?sequelize['cast'](sequelize['col'](_0x83ed('0x19')),_0x83ed('0x1b')):_0x381856,_0x83ed('0x1e')];}});}return _0x315bf8;};exports['omit']=function(_0x260914,_0x4d3cbc){if(_[_0x83ed('0x1f')](_0x260914)){return _0x260914;}if(_['isArray'](_0x260914)){for(var _0x15f658=0x0;_0x15f658<_0x260914['length'];_0x15f658+=0x1){_0x260914[_0x15f658]=this[_0x83ed('0x20')](_0x260914[_0x15f658],_0x4d3cbc);}return _0x260914;}if(!_['isObject'](_0x260914)){return _0x260914;}if(_[_0x83ed('0x21')](_0x4d3cbc)){_0x4d3cbc=[_0x4d3cbc];}if(!_[_0x83ed('0x14')](_0x4d3cbc)){return _0x260914;}for(var _0x5133ca=0x0;_0x5133ca<_0x4d3cbc[_0x83ed('0x22')];_0x5133ca+=0x1){_['unset'](_0x260914,_0x4d3cbc[_0x5133ca]);}for(var _0x588c3c in _0x260914){if(_0x260914[_0x83ed('0x23')](_0x588c3c)){_0x260914[_0x588c3c]=this[_0x83ed('0x20')](_0x260914[_0x588c3c],_0x4d3cbc);}}return _0x260914;};exports[_0x83ed('0x24')]=function(_0xa6b804){return _0xa6b804[_0x83ed('0x25')](RegExp(_0x83ed('0x26')))?!![]:![];};exports[_0x83ed('0x27')]=function(_0x421349){return _0x421349[_0x83ed('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x392c95){var _0x2adec9=[];_0x392c95[_0x83ed('0x7')](/[ ,]+/)[_0x83ed('0x28')](function(_0x4aa8e0){_0x4aa8e0=_0x4aa8e0[_0x83ed('0x29')](/([^:]")"+/g,'$1');_0x4aa8e0='+'+_0x4aa8e0+'*';if(_0x4aa8e0[_0x83ed('0x5')]('@'))_0x4aa8e0='\x22'+_0x4aa8e0+'\x22';_0x2adec9[_0x83ed('0x2a')](_0x4aa8e0);});return _0x2adec9[_0x83ed('0x2b')]('\x20');};exports['getOptions']=function(_0x1fcb3e,_0x55aa5f,_0x4369a7){var _0x5e2130={},_0x558cf2={};if(_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x2d')]){_0x55aa5f[_0x83ed('0x2c')]['id']=_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x2d')];delete _0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x2d')];}_0x5e2130['model']=_[_0x83ed('0x2e')](_0x1fcb3e,'name');_0x5e2130[_0x83ed('0x2c')]=_[_0x83ed('0x4')](_0x55aa5f['query']);_0x5e2130[_0x83ed('0x8')]=_['intersection'](_0x5e2130[_0x83ed('0x2f')],_0x5e2130[_0x83ed('0x2c')]);_0x558cf2[_0x83ed('0x30')]=_[_0x83ed('0x31')](_0x5e2130[_0x83ed('0x2f')],this[_0x83ed('0x6')](_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x6')]));_0x558cf2[_0x83ed('0x30')]=_0x558cf2[_0x83ed('0x30')][_0x83ed('0x22')]?_0x558cf2[_0x83ed('0x30')]:_0x5e2130[_0x83ed('0x2f')];if(!_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x23')]('nolimit')){_0x558cf2[_0x83ed('0x15')]=this['limit'](_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x15')]);_0x558cf2[_0x83ed('0x16')]=this[_0x83ed('0x16')](_0x55aa5f[_0x83ed('0x2c')]['offset']);}_0x558cf2[_0x83ed('0x32')]=this['sort'](_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x17')]);_0x558cf2[_0x83ed('0x33')]=this[_0x83ed('0x8')](_[_0x83ed('0x34')](_0x55aa5f[_0x83ed('0x2c')],_0x5e2130['filters']),_0x1fcb3e);if(_0x55aa5f['query']['filter']){var _0x395782=_0x1fcb3e;var _0x47f8f5=_0x55aa5f['query']['filter'];if(typeof _0x47f8f5===_0x83ed('0x35')){_0x395782=_[_0x83ed('0x36')](_0x1fcb3e,function(_0x43ff00){return _[_0x83ed('0x5')](_0x47f8f5[_0x83ed('0x37')],_0x43ff00[_0x83ed('0x12')]);});_0x47f8f5=_0x47f8f5[_0x83ed('0x38')];}_0x558cf2[_0x83ed('0x33')]=_[_0x83ed('0x39')](_0x558cf2[_0x83ed('0x33')],{'$or':_[_0x83ed('0x2e')](_0x395782,function(_0x130011){if(_0x130011[_0x83ed('0xb')]!=='VIRTUAL'){if(_0x4369a7){return sequelize[_0x83ed('0x33')](sequelize['fn'](_0x83ed('0x3a'),sequelize[_0x83ed('0x3b')](_0x130011[_0x83ed('0x12')])),{'$like':sequelize['fn'](_0x83ed('0x3a'),'%'+_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x36')]+'%')});}else{var _0x1c0312={};_0x1c0312[_0x130011[_0x83ed('0x12')]]={'$like':'%'+_0x55aa5f[_0x83ed('0x2c')][_0x83ed('0x36')]+'%'};return _0x1c0312;}}})});}_0x558cf2=_[_0x83ed('0x39')]({},_0x558cf2,_0x55aa5f['options']);return _0x558cf2;}; \ No newline at end of file +var _0xd8fa=['sort','map','priority','cast','substr','DESC','col','unsigned','ASC','omit','length','isObject','isString','unset','hasOwnProperty','match','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','name','intersection','attributes','nolimit','order','where','filter','object','columns','value','type','VIRTUAL','lower','merge','options','lodash','sequelize','keys','includes','fields','split','filters','isEmpty','find','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','subtract','uniqueid','isArray','limit','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8fa,0x159));var _0xad8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xad8f('0x0'));var sequelize=require(_0xad8f('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xf4fb74){var _0x3554e0=['ne'];try{var _0x5503b4=JSON['parse'](_0xf4fb74);var _0x22567c=Object[_0xad8f('0x2')](_0x5503b4)[0x0];return _0x3554e0[_0xad8f('0x3')](_0x22567c);}catch(_0x434a01){return![];}}function getOperatorValue(_0x2db3eb){var _0xd23945=JSON['parse'](_0x2db3eb);var _0x2761a1=Object[_0xad8f('0x2')](_0xd23945)[0x0];var _0x4fc324=_0xd23945[_0x2761a1];return{['$'+_0x2761a1]:_0x4fc324};}exports[_0xad8f('0x4')]=function(_0x1a60a0){var _0x4aafcc=null;if(_0x1a60a0){_0x4aafcc=_0x1a60a0[_0xad8f('0x5')](',');}return _0x4aafcc;};exports[_0xad8f('0x6')]=function(_0x5d17c5,_0x2742be){var _0x5e3239={};if(!_[_0xad8f('0x7')](_0x5d17c5)){_['forOwn'](_0x5d17c5,function(_0x660b8a,_0x312609){try{if(_0x2742be){var _0x2ae92e=_[_0xad8f('0x8')](_0x2742be,{'name':_0x312609})||{};if(hasSequelizeOperator(_0x660b8a)){_0x5e3239[_0x312609]=getOperatorValue(_0x660b8a);}else if(_0x2ae92e['type']===_0xad8f('0x9')&&_[_0xad8f('0xa')](_0x660b8a)){var _0x5cbeeb=JSON[_0xad8f('0xb')](_0x660b8a);var _0x4cceed={'$gte':moment(moment(_0x5cbeeb[_0xad8f('0xc')])[_0xad8f('0xd')](_0xad8f('0xe')))[_0xad8f('0xf')]()['format'](),'$lte':moment(moment(_0x5cbeeb['$lte'])[_0xad8f('0xd')](_0xad8f('0xe')))[_0xad8f('0xf')]()[_0xad8f('0x10')](0x1,'s')[_0xad8f('0xd')]()};_0x5e3239[_0x312609]=_0x4cceed;}else if(_0x2ae92e['name']===_0xad8f('0x11')){_0x5e3239[_0x312609]=_0x660b8a;}else{_0x5e3239[_0x312609]=_['isArray'](_0x660b8a)?_0x660b8a:JSON['parse'](_0x660b8a);}}else{_0x5e3239[_0x312609]=_[_0xad8f('0x12')](_0x660b8a)?_0x660b8a:JSON[_0xad8f('0xb')](_0x660b8a);}}catch(_0x451c3b){_0x5e3239[_0x312609]=_0x660b8a['split'](',');}});}return _0x5e3239;};exports[_0xad8f('0x13')]=function(_0x138d53){_0x138d53=parseInt(_0x138d53,0xa);if(!_0x138d53||_0x138d53<0x0){_0x138d53=LIMIT_VALUE;}return _0x138d53;};exports[_0xad8f('0x14')]=function(_0x55b395){_0x55b395=parseInt(_0x55b395,0xa);if(!_0x55b395||_0x55b395<0x0){_0x55b395=0x0;}return _0x55b395;};exports[_0xad8f('0x15')]=function(_0x1a3c65){var _0x46543d,_0xdbc98=null;if(_0x1a3c65){_0x46543d=_0x1a3c65[_0xad8f('0x5')](',');_0xdbc98=_[_0xad8f('0x16')](_0x46543d,function(_0x213bfb){if(_0x213bfb['indexOf']('-')===0x0){return[_0x213bfb===_0xad8f('0x17')?sequelize[_0xad8f('0x18')](sequelize['col'](_0xad8f('0x17')),'unsigned'):_0x213bfb[_0xad8f('0x19')](0x1),_0xad8f('0x1a')];}else{return[_0x213bfb===_0xad8f('0x17')?sequelize[_0xad8f('0x18')](sequelize[_0xad8f('0x1b')](_0xad8f('0x17')),_0xad8f('0x1c')):_0x213bfb,_0xad8f('0x1d')];}});}return _0xdbc98;};exports[_0xad8f('0x1e')]=function(_0x4c9b0f,_0x41271d){if(_[_0xad8f('0x7')](_0x4c9b0f)){return _0x4c9b0f;}if(_[_0xad8f('0x12')](_0x4c9b0f)){for(var _0x46be88=0x0;_0x46be88<_0x4c9b0f[_0xad8f('0x1f')];_0x46be88+=0x1){_0x4c9b0f[_0x46be88]=this['omit'](_0x4c9b0f[_0x46be88],_0x41271d);}return _0x4c9b0f;}if(!_[_0xad8f('0x20')](_0x4c9b0f)){return _0x4c9b0f;}if(_[_0xad8f('0x21')](_0x41271d)){_0x41271d=[_0x41271d];}if(!_[_0xad8f('0x12')](_0x41271d)){return _0x4c9b0f;}for(var _0x25158e=0x0;_0x25158e<_0x41271d[_0xad8f('0x1f')];_0x25158e+=0x1){_[_0xad8f('0x22')](_0x4c9b0f,_0x41271d[_0x25158e]);}for(var _0x315ace in _0x4c9b0f){if(_0x4c9b0f[_0xad8f('0x23')](_0x315ace)){_0x4c9b0f[_0x315ace]=this[_0xad8f('0x1e')](_0x4c9b0f[_0x315ace],_0x41271d);}}return _0x4c9b0f;};exports['isNumeric']=function(_0x48c911){return _0x48c911[_0xad8f('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xad8f('0x25')]=function(_0x115392){return _0x115392[_0xad8f('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xad8f('0x26')]=function(_0x6f4db9){var _0x4cee38=[];_0x6f4db9[_0xad8f('0x5')](/[ ,]+/)[_0xad8f('0x27')](function(_0x371434){_0x371434=_0x371434[_0xad8f('0x28')](/([^:]")"+/g,'$1');_0x371434='+'+_0x371434+'*';if(_0x371434[_0xad8f('0x3')]('@'))_0x371434='\x22'+_0x371434+'\x22';_0x4cee38[_0xad8f('0x29')](_0x371434);});return _0x4cee38['join']('\x20');};exports[_0xad8f('0x2a')]=function(_0x10011b,_0x5d248f,_0x3e1068){var _0x2e26d1={},_0x11a1c4={};if(_0x5d248f[_0xad8f('0x2b')]['$id']){_0x5d248f[_0xad8f('0x2b')]['id']=_0x5d248f[_0xad8f('0x2b')][_0xad8f('0x2c')];delete _0x5d248f['query'][_0xad8f('0x2c')];}_0x2e26d1[_0xad8f('0x2d')]=_[_0xad8f('0x16')](_0x10011b,_0xad8f('0x2e'));_0x2e26d1['query']=_['keys'](_0x5d248f['query']);_0x2e26d1[_0xad8f('0x6')]=_[_0xad8f('0x2f')](_0x2e26d1[_0xad8f('0x2d')],_0x2e26d1[_0xad8f('0x2b')]);_0x11a1c4[_0xad8f('0x30')]=_['intersection'](_0x2e26d1['model'],this[_0xad8f('0x4')](_0x5d248f[_0xad8f('0x2b')][_0xad8f('0x4')]));_0x11a1c4[_0xad8f('0x30')]=_0x11a1c4[_0xad8f('0x30')][_0xad8f('0x1f')]?_0x11a1c4[_0xad8f('0x30')]:_0x2e26d1[_0xad8f('0x2d')];if(!_0x5d248f['query'][_0xad8f('0x23')](_0xad8f('0x31'))){_0x11a1c4[_0xad8f('0x13')]=this['limit'](_0x5d248f[_0xad8f('0x2b')]['limit']);_0x11a1c4[_0xad8f('0x14')]=this[_0xad8f('0x14')](_0x5d248f[_0xad8f('0x2b')][_0xad8f('0x14')]);}_0x11a1c4[_0xad8f('0x32')]=this[_0xad8f('0x15')](_0x5d248f[_0xad8f('0x2b')][_0xad8f('0x15')]);_0x11a1c4[_0xad8f('0x33')]=this['filters'](_['pick'](_0x5d248f['query'],_0x2e26d1['filters']),_0x10011b);if(_0x5d248f[_0xad8f('0x2b')][_0xad8f('0x34')]){var _0x3a5644=_0x10011b;var _0x17a992=_0x5d248f['query'][_0xad8f('0x34')];if(typeof _0x17a992===_0xad8f('0x35')){_0x3a5644=_[_0xad8f('0x34')](_0x10011b,function(_0x42ebce){return _['includes'](_0x17a992[_0xad8f('0x36')],_0x42ebce[_0xad8f('0x2e')]);});_0x17a992=_0x17a992[_0xad8f('0x37')];}_0x11a1c4[_0xad8f('0x33')]=_['merge'](_0x11a1c4['where'],{'$or':_[_0xad8f('0x16')](_0x3a5644,function(_0x2a6333){if(_0x2a6333[_0xad8f('0x38')]!==_0xad8f('0x39')){if(_0x3e1068){return sequelize[_0xad8f('0x33')](sequelize['fn'](_0xad8f('0x3a'),sequelize[_0xad8f('0x1b')](_0x2a6333[_0xad8f('0x2e')])),{'$like':sequelize['fn']('lower','%'+_0x5d248f[_0xad8f('0x2b')]['filter']+'%')});}else{var _0x59ad41={};_0x59ad41[_0x2a6333[_0xad8f('0x2e')]]={'$like':'%'+_0x5d248f[_0xad8f('0x2b')][_0xad8f('0x34')]+'%'};return _0x59ad41;}}})});}_0x11a1c4=_[_0xad8f('0x3b')]({},_0x11a1c4,_0x5d248f[_0xad8f('0x3c')]);return _0x11a1c4;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 923c34c..da777d3 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc270=['toISOString','split','views','/server/views','engine','ejs','renderFile','view\x20engine','html','use','urlencoded','50mb','json','express','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','production','set','appPath','join','root','public','development','json\x20replacer'];(function(_0x58a33d,_0x30bebe){var _0x3ade1d=function(_0x432245){while(--_0x432245){_0x58a33d['push'](_0x58a33d['shift']());}};_0x3ade1d(++_0x30bebe);}(_0xc270,0xf4));var _0x0c27=function(_0x1a9e6e,_0x1cd59f){_0x1a9e6e=_0x1a9e6e-0x0;var _0x3751fb=_0xc270[_0x1a9e6e];return _0x3751fb;};'use strict';var express=require(_0x0c27('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x0c27('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0x0c27('0x2'));var errorHandler=require(_0x0c27('0x3'));var path=require(_0x0c27('0x4'));var passport=require(_0x0c27('0x5'));var cors=require(_0x0c27('0x6'));var moment=require(_0x0c27('0x7'));var config=require(_0x0c27('0x8'));var db=require(_0x0c27('0x9'))['db'];exports[_0x0c27('0xa')]=function(_0x49ef71){var _0x36f8d2=_0x49ef71[_0x0c27('0xb')]('env');if(_0x36f8d2===_0x0c27('0xc')){_0x49ef71[_0x0c27('0xd')](_0x0c27('0xe'),path[_0x0c27('0xf')](config[_0x0c27('0x10')],_0x0c27('0x11')));}if(_0x36f8d2===_0x0c27('0x12')||_0x36f8d2==='test'){_0x49ef71[_0x0c27('0xd')](_0x0c27('0xe'),path[_0x0c27('0xf')](config[_0x0c27('0x10')],'client'));_0x49ef71['use'](errorHandler());}_0x49ef71[_0x0c27('0xd')](_0x0c27('0x13'),function(_0x54ca65,_0x5c488d){if(this[_0x54ca65]instanceof Date){_0x5c488d=this[_0x54ca65][_0x0c27('0x14')]()[_0x0c27('0x15')]('.')[0x0]+'Z';}return _0x5c488d;});_0x49ef71['use'](express['static'](_0x49ef71['get'](_0x0c27('0xe'))));_0x49ef71[_0x0c27('0xd')](_0x0c27('0x16'),config[_0x0c27('0x10')]+_0x0c27('0x17'));_0x49ef71[_0x0c27('0x18')]('html',require(_0x0c27('0x19'))[_0x0c27('0x1a')]);_0x49ef71[_0x0c27('0xd')](_0x0c27('0x1b'),_0x0c27('0x1c'));_0x49ef71[_0x0c27('0x1d')](bodyParser[_0x0c27('0x1e')]({'limit':_0x0c27('0x1f'),'extended':!![]}));_0x49ef71[_0x0c27('0x1d')](bodyParser[_0x0c27('0x20')]({'limit':_0x0c27('0x1f')}));_0x49ef71[_0x0c27('0x1d')](cors());_0x49ef71[_0x0c27('0x1d')](methodOverride());_0x49ef71[_0x0c27('0x1d')](cookieParser());_0x49ef71['use'](passport['initialize']());}; \ No newline at end of file +var _0x39ad=['path','passport','./environment','../mysqldb','default','get','set','appPath','join','root','public','test','client','use','json\x20replacer','toISOString','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','serve-favicon','method-override','cookie-parser','errorhandler'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x39ad,0x146));var _0xd39a=function(_0x34265e,_0x20390b){_0x34265e=_0x34265e-0x0;var _0x3621be=_0x39ad[_0x34265e];return _0x3621be;};'use strict';var express=require('express');var favicon=require(_0xd39a('0x0'));var bodyParser=require('body-parser');var methodOverride=require(_0xd39a('0x1'));var cookieParser=require(_0xd39a('0x2'));var errorHandler=require(_0xd39a('0x3'));var path=require(_0xd39a('0x4'));var passport=require(_0xd39a('0x5'));var cors=require('cors');var moment=require('moment');var config=require(_0xd39a('0x6'));var db=require(_0xd39a('0x7'))['db'];exports[_0xd39a('0x8')]=function(_0x413e4c){var _0x51f08a=_0x413e4c[_0xd39a('0x9')]('env');if(_0x51f08a==='production'){_0x413e4c[_0xd39a('0xa')](_0xd39a('0xb'),path[_0xd39a('0xc')](config[_0xd39a('0xd')],_0xd39a('0xe')));}if(_0x51f08a==='development'||_0x51f08a===_0xd39a('0xf')){_0x413e4c[_0xd39a('0xa')](_0xd39a('0xb'),path[_0xd39a('0xc')](config[_0xd39a('0xd')],_0xd39a('0x10')));_0x413e4c[_0xd39a('0x11')](errorHandler());}_0x413e4c[_0xd39a('0xa')](_0xd39a('0x12'),function(_0x378b0f,_0x4f92ff){if(this[_0x378b0f]instanceof Date){_0x4f92ff=this[_0x378b0f][_0xd39a('0x13')]()['split']('.')[0x0]+'Z';}return _0x4f92ff;});_0x413e4c['use'](express[_0xd39a('0x14')](_0x413e4c[_0xd39a('0x9')](_0xd39a('0xb'))));_0x413e4c[_0xd39a('0xa')]('views',config[_0xd39a('0xd')]+_0xd39a('0x15'));_0x413e4c[_0xd39a('0x16')](_0xd39a('0x17'),require(_0xd39a('0x18'))[_0xd39a('0x19')]);_0x413e4c[_0xd39a('0xa')](_0xd39a('0x1a'),_0xd39a('0x17'));_0x413e4c[_0xd39a('0x11')](bodyParser[_0xd39a('0x1b')]({'limit':_0xd39a('0x1c'),'extended':!![]}));_0x413e4c['use'](bodyParser[_0xd39a('0x1d')]({'limit':_0xd39a('0x1c')}));_0x413e4c['use'](cors());_0x413e4c[_0xd39a('0x11')](methodOverride());_0x413e4c[_0xd39a('0x11')](cookieParser());_0x413e4c['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index f1d76f9..1358f5c 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 _0x70f3=['head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','update','digest','hex','platform','licenseToken','win32','replace','hostname','macAddress','ipAddress','md5','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','family','concat'];(function(_0x322a49,_0x400be1){var _0x2a5395=function(_0x59bf09){while(--_0x59bf09){_0x322a49['push'](_0x322a49['shift']());}};_0x2a5395(++_0x400be1);}(_0x70f3,0xbb));var _0x370f=function(_0x578a96,_0x2ecda8){_0x578a96=_0x578a96-0x0;var _0x4d7a64=_0x70f3[_0x578a96];return _0x4d7a64;};'use strict';var _=require(_0x370f('0x0'));var os=require('os');var crypto=require(_0x370f('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x370f('0x2'))[_0x370f('0x3')];var config=require(_0x370f('0x4'));function getInterfaces(){var _0xa7890d=[];var _0x504b3e=os[_0x370f('0x5')]();var _0x3487ea=_[_0x370f('0x6')](_['keys'](_0x504b3e));for(var _0x5d52fc=0x0;_0x5d52fc<_0x3487ea[_0x370f('0x7')];_0x5d52fc++){var _0x42277f=_0x504b3e[_0x3487ea[_0x5d52fc]][_0x370f('0x8')](function(_0x321d4d){return _0x321d4d[_0x370f('0x9')]==='IPv4'&&_0x321d4d['internal']===![];});_0xa7890d=_0xa7890d[_0x370f('0xa')](_0x42277f);}return _0xa7890d;}function getFirstInterface(){var _0x1ae09a=_[_0x370f('0xb')](getInterfaces());return{'macAddress':_0x1ae09a&&_0x1ae09a[_0x370f('0xc')]?_0x1ae09a[_0x370f('0xc')]:_0x370f('0xd'),'ipAddress':_0x1ae09a&&_0x1ae09a['address']?_0x1ae09a[_0x370f('0xe')]:_0x370f('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x47a2cf=_[_0x370f('0x6')](os[_0x370f('0x10')]()[_0x370f('0x11')](function(_0x5b7cac){return _0x5b7cac[_0x370f('0x12')];}))[_0x370f('0x13')](':');return crypto[_0x370f('0x14')]('md5')[_0x370f('0x15')](_0x47a2cf)[_0x370f('0x16')](_0x370f('0x17'));}exports['getUuid']=function(){var _0x5e622a=os[_0x370f('0x18')]();var _0x5b9607=/[0-9a-f-]{36}/;if(config[_0x370f('0x19')]&&_0x5b9607['test'](config['licenseToken'])){return config[_0x370f('0x19')];}else if(_0x5e622a===_0x370f('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x370f('0x1b')]('\x0d\x0a','');}else{var _0x1c0fd0=getFirstInterface();var _0x2ac5da=getCPUhash();var _0x22f7b0=_0x2ac5da+'|'+os[_0x370f('0x1c')]()+'|'+_0x1c0fd0[_0x370f('0x1d')]+'|'+_0x1c0fd0[_0x370f('0x1e')];var _0x528f5d=crypto[_0x370f('0x14')](_0x370f('0x1f'))['update'](_0x22f7b0)['digest'](_0x370f('0x17'));return _0x528f5d['substring'](0x0,0x8)+'-'+_0x528f5d[_0x370f('0x20')](0x8,0xc)+'-'+_0x528f5d[_0x370f('0x20')](0xc,0x10)+'-'+_0x528f5d['substring'](0x10,0x14)+'-'+_0x528f5d[_0x370f('0x20')](0x14);}}; \ No newline at end of file +var _0x1d06=['digest','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update'];(function(_0x17fc39,_0x2202e1){var _0x3373f5=function(_0x359c01){while(--_0x359c01){_0x17fc39['push'](_0x17fc39['shift']());}};_0x3373f5(++_0x2202e1);}(_0x1d06,0x9c));var _0x61d0=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x1d06[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x61d0('0x0'));var os=require('os');var crypto=require(_0x61d0('0x1'));var machine=require(_0x61d0('0x2'));var exec=require(_0x61d0('0x3'))[_0x61d0('0x4')];var config=require('../environment');function getInterfaces(){var _0x24b9c9=[];var _0x34dbe0=os['networkInterfaces']();var _0x5670ac=_[_0x61d0('0x5')](_[_0x61d0('0x6')](_0x34dbe0));for(var _0x2a5203=0x0;_0x2a5203<_0x5670ac[_0x61d0('0x7')];_0x2a5203++){var _0x4132e8=_0x34dbe0[_0x5670ac[_0x2a5203]][_0x61d0('0x8')](function(_0x731fc5){return _0x731fc5[_0x61d0('0x9')]===_0x61d0('0xa')&&_0x731fc5[_0x61d0('0xb')]===![];});_0x24b9c9=_0x24b9c9[_0x61d0('0xc')](_0x4132e8);}return _0x24b9c9;}function getFirstInterface(){var _0xed0e56=_[_0x61d0('0xd')](getInterfaces());return{'macAddress':_0xed0e56&&_0xed0e56['mac']?_0xed0e56[_0x61d0('0xe')]:'00:00:00:00:00:00','ipAddress':_0xed0e56&&_0xed0e56[_0x61d0('0xf')]?_0xed0e56[_0x61d0('0xf')]:_0x61d0('0x10')};}exports[_0x61d0('0x11')]=getFirstInterface;function getCPUhash(){var _0x265582=_[_0x61d0('0x5')](os[_0x61d0('0x12')]()[_0x61d0('0x13')](function(_0x3b8c97){return _0x3b8c97[_0x61d0('0x14')];}))['join'](':');return crypto[_0x61d0('0x15')](_0x61d0('0x16'))[_0x61d0('0x17')](_0x265582)[_0x61d0('0x18')](_0x61d0('0x19'));}exports['getUuid']=function(){var _0x3fcb49=os[_0x61d0('0x1a')]();var _0x3e30a7=/[0-9a-f-]{36}/;if(config[_0x61d0('0x1b')]&&_0x3e30a7[_0x61d0('0x1c')](config['licenseToken'])){return config[_0x61d0('0x1b')];}else if(_0x3fcb49===_0x61d0('0x1d')){return exec(_0x61d0('0x1e'),{'encoding':_0x61d0('0x1f')})[_0x61d0('0x20')]('\x0d\x0a','');}else{var _0x1cbb99=getFirstInterface();var _0x44953e=getCPUhash();var _0x16060d=_0x44953e+'|'+os[_0x61d0('0x21')]()+'|'+_0x1cbb99[_0x61d0('0x22')]+'|'+_0x1cbb99['ipAddress'];var _0x194a73=crypto['createHash']('md5')[_0x61d0('0x17')](_0x16060d)[_0x61d0('0x18')]('hex');return _0x194a73['substring'](0x0,0x8)+'-'+_0x194a73[_0x61d0('0x23')](0x8,0xc)+'-'+_0x194a73['substring'](0xc,0x10)+'-'+_0x194a73[_0x61d0('0x23')](0x10,0x14)+'-'+_0x194a73['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 15e9a3b..d4b17b8 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 _0xbc9e=['NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','catch','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0xbc9e,0x7c));var _0xebc9=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbc9e[_0x279d37];return _0x530173;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0xebc9('0x0'));var BPromise=require(_0xebc9('0x1'));var pkginfo=require(_0xebc9('0x2'))(module,'version');var db=require(_0xebc9('0x3'))['db'];var encryptor=require(_0xebc9('0x4'));var hardware=require(_0xebc9('0x5'));var logger=require(_0xebc9('0x6'))('license');var HOST=_0xebc9('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4dbe48){return new BPromise(function(_0x3a2fc0,_0x3d3162){var _0xc4d04b=util[_0xebc9('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x4dbe48,module[_0xebc9('0x9')]['version']);if(oldToken){_0xc4d04b=util['format'](_0xebc9('0xa'),HOST,_0x4dbe48,module['exports'][_0xebc9('0xb')],oldToken);}var _0x43a917={'uri':_0xc4d04b,'method':_0xebc9('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x43a917)[_0xebc9('0xd')](function(_0x1f6b96){_0x3a2fc0(_0x1f6b96);})[_0xebc9('0xe')](function(_0x5b08fc){_0x3d3162(_0x5b08fc);});});}function manageLicense(_0x59a6b4,_0x127d77){var _0x5dcd69=_0x127d77['get']({'plain':!![]});if(!isOldTokenSent&&_0x5dcd69[_0xebc9('0xf')]!==_0x59a6b4&&!_0x5dcd69[_0xebc9('0x10')]){oldToken=_0x5dcd69[_0xebc9('0xf')];}httpRequest(_0x59a6b4)[_0xebc9('0xd')](function(_0x51ff9c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x51ff9c[_0xebc9('0x11')]){isOldTokenSent=![];if(!_0x5dcd69[_0xebc9('0x12')]&&_0x5dcd69[_0xebc9('0x12')]!=_0x51ff9c[_0xebc9('0x12')]||_0x5dcd69[_0xebc9('0x12')]&&_0x5dcd69[_0xebc9('0x10')]){logger[_0xebc9('0x13')](_0xebc9('0x14'));}if(_0x5dcd69[_0xebc9('0x12')]&&!_0x5dcd69[_0xebc9('0x10')]&&_0x5dcd69[_0xebc9('0x12')]!=_0x51ff9c['license']){logger['info'](_0xebc9('0x15'));}if(_0x5dcd69[_0xebc9('0x12')]&&!_0x5dcd69['data2']&&_0x5dcd69[_0xebc9('0x12')]==_0x51ff9c[_0xebc9('0x12')]){return _0x127d77;}return _0x127d77['update']({'data1':_0x59a6b4,'data2':null,'license':_0x51ff9c[_0xebc9('0x12')]});}else{if(_0x51ff9c[_0xebc9('0x12')]||_0x5dcd69[_0xebc9('0x12')]){if(!_0x5dcd69[_0xebc9('0x10')]){if(_0x5dcd69['data1']==_0x59a6b4){GRAY_PERIOD_REASON=_0xebc9('0x16');logger[_0xebc9('0x13')](_0xebc9('0x17'));}else{GRAY_PERIOD_REASON=_0xebc9('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5dcd69[_0xebc9('0xf')],_0x59a6b4);}logger[_0xebc9('0x13')](_0xebc9('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xebc9('0x8')](_0xebc9('0x1a')));return _0x127d77[_0xebc9('0x1b')]({'data2':encryptor[_0xebc9('0x1c')](moment()[_0xebc9('0x8')](_0xebc9('0x1a')))});}else{if(moment()['diff'](encryptor[_0xebc9('0x1d')](_0x5dcd69[_0xebc9('0x10')]),_0xebc9('0x1e'))>DAYS){logger[_0xebc9('0x13')](_0xebc9('0x1f'),moment()[_0xebc9('0x8')](_0xebc9('0x1a')));isOldTokenSent=![];return _0x127d77['update']({'data1':_0x59a6b4,'data2':null,'license':null});}}}else{if(_0x5dcd69[_0xebc9('0xf')]!=_0x59a6b4){logger[_0xebc9('0x13')](_0xebc9('0x20'),_0x5dcd69['data1'],_0x59a6b4);return _0x127d77[_0xebc9('0x1b')]({'data1':_0x59a6b4,'data2':null,'license':null});}}}return _0x127d77;})['then'](function(_0x1f9704){_0x127d77=_0x1f9704;})['catch'](function(_0x235535){logger[_0xebc9('0x21')](_0x235535['message']);})[_0xebc9('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xebc9('0x23')](),_0x127d77);},TIME);});}function defaultLicense(){var _0x1b250f=hardware[_0xebc9('0x23')]();if(_0x1b250f){return db['License'][_0xebc9('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x1b250f}})['spread'](function(_0x3e0d33,_0x2c90d8){logger['info'](_0xebc9('0x25'),_0x1b250f);manageLicense(_0x1b250f,_0x3e0d33);})[_0xebc9('0xe')](function(_0x1d368a){logger['error'](_0x1d368a['message']);});}}exports[_0xebc9('0x26')]=defaultLicense; \ No newline at end of file +var _0x076a=['../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','version'];(function(_0x2d1fbf,_0x2f61ad){var _0x1b5f73=function(_0x594e17){while(--_0x594e17){_0x2d1fbf['push'](_0x2d1fbf['shift']());}};_0x1b5f73(++_0x2f61ad);}(_0x076a,0x1a1));var _0xa076=function(_0x2b57fc,_0x4b3658){_0x2b57fc=_0x2b57fc-0x0;var _0x5bf238=_0x076a[_0x2b57fc];return _0x5bf238;};'use strict';var util=require(_0xa076('0x0'));var moment=require('moment');var rp=require(_0xa076('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xa076('0x2'));var db=require(_0xa076('0x3'))['db'];var encryptor=require(_0xa076('0x4'));var hardware=require(_0xa076('0x5'));var logger=require(_0xa076('0x6'))('license');var HOST=_0xa076('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x14eeb2){return new BPromise(function(_0xc800e0,_0x164e7d){var _0x27c126=util[_0xa076('0x8')](_0xa076('0x9'),HOST,_0x14eeb2,module[_0xa076('0xa')][_0xa076('0x2')]);if(oldToken){_0x27c126=util[_0xa076('0x8')](_0xa076('0xb'),HOST,_0x14eeb2,module[_0xa076('0xa')][_0xa076('0x2')],oldToken);}var _0x18de91={'uri':_0x27c126,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x18de91)[_0xa076('0xc')](function(_0xb330e5){_0xc800e0(_0xb330e5);})[_0xa076('0xd')](function(_0x59e393){_0x164e7d(_0x59e393);});});}function manageLicense(_0x2457ba,_0x314bac){var _0x285175=_0x314bac[_0xa076('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x285175[_0xa076('0xf')]!==_0x2457ba&&!_0x285175['data2']){oldToken=_0x285175[_0xa076('0xf')];}httpRequest(_0x2457ba)[_0xa076('0xc')](function(_0x21c49d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x21c49d[_0xa076('0x10')]){isOldTokenSent=![];if(!_0x285175[_0xa076('0x11')]&&_0x285175[_0xa076('0x11')]!=_0x21c49d[_0xa076('0x11')]||_0x285175[_0xa076('0x11')]&&_0x285175[_0xa076('0x12')]){logger[_0xa076('0x13')](_0xa076('0x14'));}if(_0x285175[_0xa076('0x11')]&&!_0x285175[_0xa076('0x12')]&&_0x285175[_0xa076('0x11')]!=_0x21c49d[_0xa076('0x11')]){logger['info'](_0xa076('0x15'));}if(_0x285175[_0xa076('0x11')]&&!_0x285175[_0xa076('0x12')]&&_0x285175[_0xa076('0x11')]==_0x21c49d[_0xa076('0x11')]){return _0x314bac;}return _0x314bac[_0xa076('0x16')]({'data1':_0x2457ba,'data2':null,'license':_0x21c49d[_0xa076('0x11')]});}else{if(_0x21c49d[_0xa076('0x11')]||_0x285175[_0xa076('0x11')]){if(!_0x285175[_0xa076('0x12')]){if(_0x285175[_0xa076('0xf')]==_0x2457ba){GRAY_PERIOD_REASON=_0xa076('0x17');logger[_0xa076('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xa076('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x285175[_0xa076('0xf')],_0x2457ba);}logger['info'](_0xa076('0x19'),GRAY_PERIOD_REASON[_0xa076('0x1a')](),moment()[_0xa076('0x8')](_0xa076('0x1b')));return _0x314bac[_0xa076('0x16')]({'data2':encryptor[_0xa076('0x1c')](moment()[_0xa076('0x8')](_0xa076('0x1b')))});}else{if(moment()[_0xa076('0x1d')](encryptor[_0xa076('0x1e')](_0x285175['data2']),_0xa076('0x1f'))>DAYS){logger[_0xa076('0x13')](_0xa076('0x20'),moment()[_0xa076('0x8')](_0xa076('0x1b')));isOldTokenSent=![];return _0x314bac[_0xa076('0x16')]({'data1':_0x2457ba,'data2':null,'license':null});}}}else{if(_0x285175['data1']!=_0x2457ba){logger[_0xa076('0x13')](_0xa076('0x21'),_0x285175[_0xa076('0xf')],_0x2457ba);return _0x314bac['update']({'data1':_0x2457ba,'data2':null,'license':null});}}}return _0x314bac;})[_0xa076('0xc')](function(_0x1c5729){_0x314bac=_0x1c5729;})['catch'](function(_0x1cc738){logger[_0xa076('0x22')](_0x1cc738[_0xa076('0x23')]);})[_0xa076('0x24')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x314bac);},TIME);});}function defaultLicense(){var _0x54b656=hardware[_0xa076('0x25')]();if(_0x54b656){return db[_0xa076('0x26')][_0xa076('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x54b656}})[_0xa076('0x28')](function(_0x74d7f4,_0x43b70c){logger[_0xa076('0x13')](_0xa076('0x29'),_0x54b656);manageLicense(_0x54b656,_0x74d7f4);})['catch'](function(_0x1f7449){logger[_0xa076('0x22')](_0x1f7449[_0xa076('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index bf36b75..f16bbff 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 _0xa06e=['pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','days','grayReason','changed','disabled','message','findAll','sequelize','COUNT','col','role','admin','user','telephone','count','catch'];(function(_0xd8854b,_0x7d29ce){var _0x33df24=function(_0x4d141a){while(--_0x4d141a){_0xd8854b['push'](_0xd8854b['shift']());}};_0x33df24(++_0x7d29ce);}(_0xa06e,0x1db));var _0xea06=function(_0x31efd9,_0x311b21){_0x31efd9=_0x31efd9-0x0;var _0x22f29d=_0xa06e[_0x31efd9];return _0x22f29d;};'use strict';var util=require('util');var _=require(_0xea06('0x0'));var moment=require(_0xea06('0x1'));var BPromise=require('bluebird');var hardware=require(_0xea06('0x2'));var encryptor=require(_0xea06('0x3'));var db=require(_0xea06('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xea06('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xea06('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xea06('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xea06('0x7'),'machineUuid':hardware[_0xea06('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xe6ff20){return new BPromise(function(_0x1241b4,_0x13fa9a){return db[_0xea06('0x9')][_0xea06('0xa')](_[_0xea06('0xb')](_0xe6ff20,{'raw':!![],'where':{'id':0x1}}))[_0xea06('0xc')](function(_0x18be73){return checkLicense(_0x18be73,null);})[_0xea06('0xc')](function(_0x371fbc){_0x1241b4(_0x371fbc);return;})['catch'](function(_0x1dabda){_0x13fa9a(_0x1dabda);});});}function checkLicense(_0x3938ea,_0x428809){if(!_0x3938ea){demoLicense['uuid']=_0x3938ea[_0xea06('0xd')];return demoLicense;}try{var _0x3b9fba=_0x428809||_0x3938ea['license'];if(_[_0xea06('0xe')](_0x3b9fba)){throw new Error(_0xea06('0xf'));}var _0x8225ec=_0x3938ea[_0xea06('0xd')];var _0x36fcab=_0x3938ea[_0xea06('0x10')];var _0x6909d2=_0x8225ec[_0xea06('0x11')]('-')[0x4];var _0xfeeaaf=_0x8225ec[_0xea06('0x11')]('-')[0x0];var _0x714426=encryptor[_0xea06('0x12')](_0x3b9fba,util[_0xea06('0x13')](_0xea06('0x14'),_0x6909d2,_0x8225ec,_0xfeeaaf));var _0x553f55=JSON[_0xea06('0x15')](_0x714426);_0x553f55[_0xea06('0x16')]=![];_0x553f55[_0xea06('0x17')]=_0x8225ec;_0x553f55[_0xea06('0x18')]=hardware[_0xea06('0x8')]();if(_0x36fcab){var _0x24c9a7=encryptor['decryptString'](_0x36fcab);_0x553f55[_0xea06('0x19')]=_0x24c9a7;_0x553f55[_0xea06('0x1a')]=moment(_0x24c9a7)['add'](0x7,_0xea06('0x1b'))[_0xea06('0x13')]();_0x553f55[_0xea06('0x1c')]=_0x553f55[_0xea06('0x17')]!=_0x553f55[_0xea06('0x18')]?_0xea06('0x1d'):_0xea06('0x1e');}return _0x553f55;}catch(_0x4b4eec){breakingLicense[_0xea06('0x17')]=_0x3938ea[_0xea06('0xd')];breakingLicense[_0xea06('0x1f')]=_0x4b4eec['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x225046,_0x5926a7){getLicense()[_0xea06('0xc')](function(_0x3903e3){return db['User'][_0xea06('0x20')]({'attributes':['role',[db[_0xea06('0x21')]['fn'](_0xea06('0x22'),db[_0xea06('0x21')][_0xea06('0x23')]('role')),'count']],'group':_0xea06('0x24'),'where':{'role':{'$or':[_0xea06('0x25'),_0xea06('0x26'),_0xea06('0x27')]}},'raw':!![]})[_0xea06('0xc')](function(_0x502452){var _0x329257={'user':_0x3903e3['users']||0x0,'telephone':_0x3903e3['telephones']||0x0};_0x502452['forEach'](function(_0xee2604){var _0x3456b2=_0xee2604[_0xea06('0x24')]===_0xea06('0x25')?_0xea06('0x26'):_0xee2604[_0xea06('0x24')];_0x329257[_0x3456b2]-=_0xee2604[_0xea06('0x28')];if(_0x329257[_0x3456b2]<0x0)_0x329257[_0x3456b2]=0x0;});_0x225046(_0x329257);return;});})[_0xea06('0x29')](function(_0x4ce791){_0x5926a7(_0x4ce791);});});}function checkUserLimits(_0x4547cc){return new BPromise(function(_0x40def9,_0x14fd1c){getLimits()[_0xea06('0xc')](function(_0x17260b){var _0x11cdd2=_[_0xea06('0x2a')](_[_0xea06('0x2b')](_0x4547cc,_0xea06('0x24')),[_0xea06('0x25'),_0xea06('0x26'),_0xea06('0x27')]);var _0x2faf87=(_0x11cdd2[_0xea06('0x25')]||0x0)+(_0x11cdd2[_0xea06('0x26')]||0x0);var _0x55a05f=_0x11cdd2[_0xea06('0x27')]||0x0;if(_0x2faf87>_0x17260b[_0xea06('0x26')])return _0x14fd1c(_0xea06('0x2c'));if(_0x55a05f>_0x17260b[_0xea06('0x27')])return _0x14fd1c(_0xea06('0x2d'));return _0x40def9();})[_0xea06('0x29')](function(_0x380162){_0x14fd1c(_0x380162);});});}module[_0xea06('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xee7a=['count','admin','user','users','telephones','forEach','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','col'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xee7a,0x1ec));var _0xaee7=function(_0x5b63a2,_0x401781){_0x5b63a2=_0x5b63a2-0x0;var _0xdd9204=_0xee7a[_0x5b63a2];return _0xdd9204;};'use strict';var util=require(_0xaee7('0x0'));var _=require(_0xaee7('0x1'));var moment=require(_0xaee7('0x2'));var BPromise=require(_0xaee7('0x3'));var hardware=require('./hardware');var encryptor=require(_0xaee7('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xaee7('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xaee7('0x6'),'machineUuid':hardware[_0xaee7('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xaee7('0x8'),'machineUuid':hardware[_0xaee7('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x20ccd4){return new BPromise(function(_0xe1e20c,_0x540bdb){return db[_0xaee7('0x9')][_0xaee7('0xa')](_['defaults'](_0x20ccd4,{'raw':!![],'where':{'id':0x1}}))[_0xaee7('0xb')](function(_0x2cf946){return checkLicense(_0x2cf946,null);})[_0xaee7('0xb')](function(_0xe791c8){_0xe1e20c(_0xe791c8);return;})['catch'](function(_0x2a4c8a){_0x540bdb(_0x2a4c8a);});});}function checkLicense(_0x576807,_0x3cb6f1){if(!_0x576807){demoLicense[_0xaee7('0xc')]=_0x576807[_0xaee7('0xd')];return demoLicense;}try{var _0x49baa3=_0x3cb6f1||_0x576807[_0xaee7('0xe')];if(_[_0xaee7('0xf')](_0x49baa3)){throw new Error(_0xaee7('0x10'));}var _0xedee43=_0x576807['data1'];var _0x2aca43=_0x576807[_0xaee7('0x11')];var _0x19fdf1=_0xedee43[_0xaee7('0x12')]('-')[0x4];var _0x54caf0=_0xedee43[_0xaee7('0x12')]('-')[0x0];var _0x1a2ee3=encryptor[_0xaee7('0x13')](_0x49baa3,util[_0xaee7('0x14')](_0xaee7('0x15'),_0x19fdf1,_0xedee43,_0x54caf0));var _0x5d4d66=JSON[_0xaee7('0x16')](_0x1a2ee3);_0x5d4d66[_0xaee7('0x17')]=![];_0x5d4d66[_0xaee7('0xc')]=_0xedee43;_0x5d4d66[_0xaee7('0x18')]=hardware[_0xaee7('0x7')]();if(_0x2aca43){var _0x44e7ea=encryptor[_0xaee7('0x13')](_0x2aca43);_0x5d4d66['gray']=_0x44e7ea;_0x5d4d66[_0xaee7('0x19')]=moment(_0x44e7ea)['add'](0x7,_0xaee7('0x1a'))[_0xaee7('0x14')]();_0x5d4d66[_0xaee7('0x1b')]=_0x5d4d66[_0xaee7('0xc')]!=_0x5d4d66[_0xaee7('0x18')]?_0xaee7('0x1c'):_0xaee7('0x1d');}return _0x5d4d66;}catch(_0x21b6b0){breakingLicense['uuid']=_0x576807[_0xaee7('0xd')];breakingLicense[_0xaee7('0x1e')]=_0x21b6b0[_0xaee7('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x770c55,_0x47b6b6){getLicense()[_0xaee7('0xb')](function(_0x2948f7){return db[_0xaee7('0x1f')][_0xaee7('0x20')]({'attributes':[_0xaee7('0x21'),[db[_0xaee7('0x22')]['fn']('COUNT',db[_0xaee7('0x22')][_0xaee7('0x23')](_0xaee7('0x21'))),_0xaee7('0x24')]],'group':_0xaee7('0x21'),'where':{'role':{'$or':[_0xaee7('0x25'),_0xaee7('0x26'),'telephone']}},'raw':!![]})['then'](function(_0x5104a8){var _0x151e95={'user':_0x2948f7[_0xaee7('0x27')]||0x0,'telephone':_0x2948f7[_0xaee7('0x28')]||0x0};_0x5104a8[_0xaee7('0x29')](function(_0x16b217){var _0x1c4b93=_0x16b217['role']===_0xaee7('0x25')?_0xaee7('0x26'):_0x16b217['role'];_0x151e95[_0x1c4b93]-=_0x16b217[_0xaee7('0x24')];if(_0x151e95[_0x1c4b93]<0x0)_0x151e95[_0x1c4b93]=0x0;});_0x770c55(_0x151e95);return;});})[_0xaee7('0x2a')](function(_0x17632c){_0x47b6b6(_0x17632c);});});}function checkUserLimits(_0x5d974){return new BPromise(function(_0x547194,_0x2d2914){getLimits()[_0xaee7('0xb')](function(_0x3810ae){var _0x3a350f=_[_0xaee7('0x2b')](_[_0xaee7('0x2c')](_0x5d974,_0xaee7('0x21')),[_0xaee7('0x25'),_0xaee7('0x26'),_0xaee7('0x2d')]);var _0x3cac3c=(_0x3a350f[_0xaee7('0x25')]||0x0)+(_0x3a350f[_0xaee7('0x26')]||0x0);var _0x4f8f50=_0x3a350f['telephone']||0x0;if(_0x3cac3c>_0x3810ae['user'])return _0x2d2914(_0xaee7('0x2e'));if(_0x4f8f50>_0x3810ae[_0xaee7('0x2d')])return _0x2d2914('License\x20limit\x20reached\x20for\x20telephones');return _0x547194();})[_0xaee7('0x2a')](function(_0x1e0f50){_0x2d2914(_0x1e0f50);});});}module[_0xaee7('0x2f')]={'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 46f1e32..1c9ec83 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 _0x5464=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x12fe24,_0x4061cd){var _0x309501=function(_0x2c91d8){while(--_0x2c91d8){_0x12fe24['push'](_0x12fe24['shift']());}};_0x309501(++_0x4061cd);}(_0x5464,0x15d));var _0x4546=function(_0x13dac4,_0x342ecc){_0x13dac4=_0x13dac4-0x0;var _0x405ca2=_0x5464[_0x13dac4];return _0x405ca2;};'use strict';module[_0x4546('0x0')]={'DOMAIN':_0x4546('0x1'),'SESSION_SECRET':_0x4546('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x4546('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x93e9=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x93e9,0xcc));var _0x993e=function(_0x30156e,_0x4f5e62){_0x30156e=_0x30156e-0x0;var _0x3fdd6d=_0x93e9[_0x30156e];return _0x3fdd6d;};'use strict';module[_0x993e('0x0')]={'DOMAIN':_0x993e('0x1'),'SESSION_SECRET':_0x993e('0x2'),'GOOGLE_ID':_0x993e('0x3'),'GOOGLE_SECRET':_0x993e('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 8d06940..7fa4c85 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x402c=['error','info','Console','env','debugLevel','moment','winston','util','INFO','/var','log','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','%s-%s'];(function(_0x3990c3,_0x4e75ab){var _0x221763=function(_0x2300bb){while(--_0x2300bb){_0x3990c3['push'](_0x3990c3['shift']());}};_0x221763(++_0x4e75ab);}(_0x402c,0x10d));var _0xc402=function(_0x4c9316,_0x5c7f6f){_0x4c9316=_0x4c9316-0x0;var _0x146aad=_0x402c[_0x4c9316];return _0x146aad;};'use strict';var moment=require(_0xc402('0x0'));var winston=require(_0xc402('0x1'));var util=require(_0xc402('0x2'));var path=require('path');var debugLevel=_0xc402('0x3');function filename(_0x286e54,_0x38de3e){return path['join'](_0xc402('0x4'),_0xc402('0x5'),'xcally',util[_0xc402('0x6')](_0xc402('0x7'),_0x286e54,_0x38de3e));}function formatter(_0x46cf98,_0x1b2177){_0x1b2177[_0xc402('0x8')]=_0x1b2177[_0xc402('0x8')]['replace'](/@@{/g,_0xc402('0x9'))[_0xc402('0xa')](/}@@/g,'}}}')[_0xc402('0xa')](/@{/g,'{{')[_0xc402('0xa')](/}@/g,'}}');return util[_0xc402('0x6')](_0xc402('0xb'),moment()[_0xc402('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1b2177[_0xc402('0xc')][_0xc402('0xd')](),_0x46cf98,_0x1b2177['message']);}module[_0xc402('0xe')]=function(_0x45c561){return new winston[(_0xc402('0xf'))]({'transports':[new winston[(_0xc402('0x10'))][(_0xc402('0x11'))]({'name':util['format'](_0xc402('0x12'),_0x45c561,_0xc402('0x13')),'filename':filename(_0x45c561,_0xc402('0x13')),'level':_0xc402('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x41166b){return formatter(_0x45c561,_0x41166b);}}),new winston[(_0xc402('0x10'))][(_0xc402('0x11'))]({'name':util[_0xc402('0x6')]('%s-%s',_0x45c561,_0xc402('0x14')),'filename':filename(_0x45c561,_0xc402('0x14')),'level':_0xc402('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ce67e){return formatter(_0x45c561,_0x2ce67e);}}),new winston[(_0xc402('0x10'))][(_0xc402('0x15'))]({'level':process[_0xc402('0x16')][_0xc402('0x17')]||debugLevel,'json':![],'formatter':function(_0x4a4b45){return formatter(_0x45c561,_0x4a4b45);}})]});}; \ No newline at end of file +var _0x12a2=['Logger','File','%s-%s','error','info','env','debugLevel','moment','winston','util','INFO','join','/var','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x12a2,0x132));var _0x212a=function(_0x304456,_0x59063c){_0x304456=_0x304456-0x0;var _0x2943da=_0x12a2[_0x304456];return _0x2943da;};'use strict';var moment=require(_0x212a('0x0'));var winston=require(_0x212a('0x1'));var util=require(_0x212a('0x2'));var path=require('path');var debugLevel=_0x212a('0x3');function filename(_0x9e3f82,_0x3d7af1){return path[_0x212a('0x4')](_0x212a('0x5'),'log',_0x212a('0x6'),util[_0x212a('0x7')](_0x212a('0x8'),_0x9e3f82,_0x3d7af1));}function formatter(_0x3a6824,_0xa55712){_0xa55712[_0x212a('0x9')]=_0xa55712[_0x212a('0x9')][_0x212a('0xa')](/@@{/g,_0x212a('0xb'))[_0x212a('0xa')](/}@@/g,_0x212a('0xc'))[_0x212a('0xa')](/@{/g,'{{')[_0x212a('0xa')](/}@/g,'}}');return util[_0x212a('0x7')](_0x212a('0xd'),moment()[_0x212a('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0xa55712[_0x212a('0xe')][_0x212a('0xf')](),_0x3a6824,_0xa55712[_0x212a('0x9')]);}module['exports']=function(_0x4c2ebf){return new winston[(_0x212a('0x10'))]({'transports':[new winston['transports'][(_0x212a('0x11'))]({'name':util[_0x212a('0x7')](_0x212a('0x12'),_0x4c2ebf,_0x212a('0x13')),'filename':filename(_0x4c2ebf,_0x212a('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x129e28){return formatter(_0x4c2ebf,_0x129e28);}}),new winston['transports'][(_0x212a('0x11'))]({'name':util[_0x212a('0x7')](_0x212a('0x12'),_0x4c2ebf,'info'),'filename':filename(_0x4c2ebf,_0x212a('0x14')),'level':_0x212a('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2f67e9){return formatter(_0x4c2ebf,_0x2f67e9);}}),new winston['transports']['Console']({'level':process[_0x212a('0x15')][_0x212a('0x16')]||debugLevel,'json':![],'formatter':function(_0x4db02f){return formatter(_0x4c2ebf,_0x4db02f);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c65f259..b28fd93 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 _0xf587=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','ami'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf587,0xb2));var _0x7f58=function(_0x37d195,_0x41890){_0x37d195=_0x37d195-0x0;var _0x4bb415=_0xf587[_0x37d195];return _0x4bb415;};'use strict';var path=require(_0x7f58('0x0'));var os=require('os');var config={'apps':[{'name':_0x7f58('0x1'),'script':path[_0x7f58('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x7f58('0x3'),'script':path[_0x7f58('0x2')](__dirname,_0x7f58('0x4'))},{'name':_0x7f58('0x5'),'script':path[_0x7f58('0x2')](__dirname,_0x7f58('0x6'))},{'name':_0x7f58('0x7'),'script':path[_0x7f58('0x2')](__dirname,_0x7f58('0x8'))},{'name':_0x7f58('0x9'),'script':path['join'](__dirname,_0x7f58('0xa'))},{'name':_0x7f58('0xb'),'script':path[_0x7f58('0x2')](__dirname,_0x7f58('0xc'))}]};module['exports']=config; \ No newline at end of file +var _0x3c2b=['express','join','agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x3c2b,0x7d));var _0xb3c2=function(_0x2bf9b3,_0x4a0b59){_0x2bf9b3=_0x2bf9b3-0x0;var _0x2eee64=_0x3c2b[_0x2bf9b3];return _0x2eee64;};'use strict';var path=require(_0xb3c2('0x0'));var os=require('os');var config={'apps':[{'name':_0xb3c2('0x1'),'script':path[_0xb3c2('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xb3c2('0x3'),'script':path[_0xb3c2('0x2')](__dirname,_0xb3c2('0x4'))},{'name':'email','script':path[_0xb3c2('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xb3c2('0x5'),'script':path['join'](__dirname,_0xb3c2('0x6'))},{'name':_0xb3c2('0x7'),'script':path[_0xb3c2('0x2')](__dirname,_0xb3c2('0x8'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8d19090..65e12a9 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 _0xf38f=['./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','pm2'];(function(_0x29ff5e,_0x220788){var _0xd8135a=function(_0x3a0136){while(--_0x3a0136){_0x29ff5e['push'](_0x29ff5e['shift']());}};_0xd8135a(++_0x220788);}(_0xf38f,0x15e));var _0xff38=function(_0x48a17b,_0x15fe4b){_0x48a17b=_0x48a17b-0x0;var _0x3170db=_0xf38f[_0x48a17b];return _0x3170db;};'use strict';var pm2=require(_0xff38('0x0'));var BPromise=require('bluebird');var config=require(_0xff38('0x1'));function connect(){return new BPromise(function(_0x291f1d,_0x51aacd){return pm2[_0xff38('0x2')](function(_0x483c95){if(_0x483c95){return _0x51aacd(_0x483c95);}return _0x291f1d(_0xff38('0x3'));});});};exports[_0xff38('0x4')]=function(_0x14ac6e){return connect()[_0xff38('0x5')](function(){return new BPromise(function(_0x2027ea,_0x17375e){return pm2['start'](_0x14ac6e,function(_0x44242a,_0xa3a35b){if(_0x44242a){return _0x17375e(_0x44242a);}pm2[_0xff38('0x6')]();return _0x2027ea(_0xa3a35b);});});});};exports['stop']=function(_0x28532c){return connect()[_0xff38('0x5')](function(){return new BPromise(function(_0x5e675b,_0x5165b8){return pm2[_0xff38('0x7')](_0x28532c,function(_0x93905d,_0x2ecb26){if(_0x93905d){return _0x5165b8(_0x93905d);}pm2[_0xff38('0x6')]();return _0x5e675b(_0x2ecb26);});});});};exports[_0xff38('0x8')]=function(_0x3e4acd){return connect()['then'](function(){return new BPromise(function(_0x13826e,_0x2d3ef3){return pm2[_0xff38('0x8')](_0x3e4acd,function(_0xbc12af,_0xb04f98){if(_0xbc12af){return _0x2d3ef3(_0xbc12af);}pm2[_0xff38('0x6')]();return _0x13826e(_0xb04f98);});});});};exports[_0xff38('0x9')]=function(){return connect()[_0xff38('0x5')](function(){return new BPromise(function(_0x3948bc,_0x3bcf37){return pm2['list'](function(_0x5607b7,_0x5d0983){if(_0x5607b7){return _0x3bcf37(_0x5607b7);}pm2[_0xff38('0x6')]();return _0x3948bc(_0x5d0983);});});});};exports[_0xff38('0xa')]=function(_0x51648c){return connect()['then'](function(){return new BPromise(function(_0xe0b0d6,_0x3cec96){return pm2[_0xff38('0xa')](_0x51648c,function(_0x3c8573,_0x2452ea){if(_0x3c8573){return _0x3cec96(_0x3c8573);}pm2['disconnect']();return _0xe0b0d6(_0x2452ea);});});});};exports['delete']=function(_0x230f1a){return connect()[_0xff38('0x5')](function(){return new BPromise(function(_0x38385a,_0x2b2c4b){return pm2[_0xff38('0xb')](_0x230f1a,function(_0xcf4c3d,_0x2a6e0c){if(_0xcf4c3d){return _0x2b2c4b(_0xcf4c3d);}pm2['disconnect']();return _0x38385a(_0x2a6e0c);});});});};exports[_0xff38('0xc')]=function(){return connect()[_0xff38('0x5')](function(){return new BPromise(function(_0x4a1af0,_0x2d7b8e){return pm2[_0xff38('0xc')](function(_0x133c04){if(_0x133c04){return _0x2d7b8e(_0x133c04);}return _0x4a1af0('saved');});});});}; \ No newline at end of file +var _0xdcd4=['./config','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0xdcd4,0x6e));var _0x4dcd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcd4[_0x1facfa];return _0x9ec701;};'use strict';var pm2=require(_0x4dcd('0x0'));var BPromise=require(_0x4dcd('0x1'));var config=require(_0x4dcd('0x2'));function connect(){return new BPromise(function(_0x4152bb,_0x1f9fe0){return pm2['connect'](function(_0x17bc26){if(_0x17bc26){return _0x1f9fe0(_0x17bc26);}return _0x4152bb(_0x4dcd('0x3'));});});};exports[_0x4dcd('0x4')]=function(_0x93c304){return connect()[_0x4dcd('0x5')](function(){return new BPromise(function(_0x2e8ae0,_0x29e4ae){return pm2[_0x4dcd('0x4')](_0x93c304,function(_0x565786,_0x45f873){if(_0x565786){return _0x29e4ae(_0x565786);}pm2[_0x4dcd('0x6')]();return _0x2e8ae0(_0x45f873);});});});};exports['stop']=function(_0x1a04dc){return connect()['then'](function(){return new BPromise(function(_0x5626c9,_0x39785b){return pm2[_0x4dcd('0x7')](_0x1a04dc,function(_0x363289,_0x427f2f){if(_0x363289){return _0x39785b(_0x363289);}pm2[_0x4dcd('0x6')]();return _0x5626c9(_0x427f2f);});});});};exports[_0x4dcd('0x8')]=function(_0x5520c0){return connect()[_0x4dcd('0x5')](function(){return new BPromise(function(_0x21ba11,_0x40de25){return pm2[_0x4dcd('0x8')](_0x5520c0,function(_0x58aa81,_0x4daefb){if(_0x58aa81){return _0x40de25(_0x58aa81);}pm2[_0x4dcd('0x6')]();return _0x21ba11(_0x4daefb);});});});};exports[_0x4dcd('0x9')]=function(){return connect()[_0x4dcd('0x5')](function(){return new BPromise(function(_0x5286da,_0x563806){return pm2[_0x4dcd('0x9')](function(_0x36473f,_0x1097f3){if(_0x36473f){return _0x563806(_0x36473f);}pm2[_0x4dcd('0x6')]();return _0x5286da(_0x1097f3);});});});};exports[_0x4dcd('0xa')]=function(_0x24ef66){return connect()[_0x4dcd('0x5')](function(){return new BPromise(function(_0x5becf3,_0x385730){return pm2[_0x4dcd('0xa')](_0x24ef66,function(_0x44beba,_0x209109){if(_0x44beba){return _0x385730(_0x44beba);}pm2[_0x4dcd('0x6')]();return _0x5becf3(_0x209109);});});});};exports['delete']=function(_0x573bf0){return connect()['then'](function(){return new BPromise(function(_0x3d9bb3,_0x4d7b29){return pm2[_0x4dcd('0xb')](_0x573bf0,function(_0x50eca1,_0xd3c477){if(_0x50eca1){return _0x4d7b29(_0x50eca1);}pm2['disconnect']();return _0x3d9bb3(_0xd3c477);});});});};exports[_0x4dcd('0xc')]=function(){return connect()[_0x4dcd('0x5')](function(){return new BPromise(function(_0x3bf4b1,_0x5e138c){return pm2[_0x4dcd('0xc')](function(_0x68fb6f){if(_0x68fb6f){return _0x5e138c(_0x68fb6f);}return _0x3bf4b1(_0x4dcd('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 86a0b4b..b11dc92 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 _0x3e55=['minutes','then','length','info','join','update','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e55,0x1bb));var _0x53e5=function(_0x48602e,_0x57f29f){_0x48602e=_0x48602e-0x0;var _0x10a656=_0x3e55[_0x48602e];return _0x10a656;};'use strict';var _=require(_0x53e5('0x0'));var moment=require(_0x53e5('0x1'));var Redis=require(_0x53e5('0x2'));var util=require(_0x53e5('0x3'));var config=require(_0x53e5('0x4'));var db=require(_0x53e5('0x5'))['db'];var logger=require(_0x53e5('0x6'))(_0x53e5('0x7'));config['redis']=_[_0x53e5('0x8')](config[_0x53e5('0x9')],{'host':_0x53e5('0xa'),'port':0x18eb});var io=require(_0x53e5('0xb'))(new Redis(config[_0x53e5('0x9')]));function closeInteractions(){var _0x69b5fb=0x0;var _0x534fd8=[];return db[_0x53e5('0xc')][_0x53e5('0xd')]({'raw':!![],'attributes':['id',_0x53e5('0xe')],'where':{'id':0x1}})['then'](function(_0x4bcdab){_0x69b5fb=_0x4bcdab[_0x53e5('0xe')];if(_0x69b5fb){return db[_0x53e5('0xf')][_0x53e5('0x10')]({'raw':!![],'attributes':['id',_0x53e5('0x11')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x53e5('0x12')](_0x4bcdab[_0x53e5('0xe')],_0x53e5('0x13'))}}});}else{return[];}})[_0x53e5('0x14')](function(_0x34a0b6){if(_0x34a0b6&&_0x34a0b6[_0x53e5('0x15')]){_0x534fd8=_['map'](_0x34a0b6||[],'id');logger[_0x53e5('0x16')]('[CHAT]\x20Interactions\x20to\x20close:',_0x534fd8[_0x53e5('0x17')]());return db[_0x53e5('0xf')][_0x53e5('0x18')]({'closeReason':_0x53e5('0x19'),'disposition':_0x53e5('0x1a'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x534fd8}});}})['then'](function(){if(_0x534fd8&&_0x534fd8[_0x53e5('0x15')]){logger[_0x53e5('0x16')](_0x53e5('0x1b'),_0x534fd8[_0x53e5('0x17')]());for(var _0x2dc611=0x0;_0x2dc611<_0x534fd8[_0x53e5('0x15')];_0x2dc611++){io['emit'](_0x53e5('0x1c'),{'id':_0x534fd8[_0x2dc611],'closed':!![]});}}})[_0x53e5('0x1d')](function(_0x5e1753){logger[_0x53e5('0x1e')](_0x53e5('0x1f'),_0x5e1753?util['inspect'](_0x5e1753,{'showHidden':![],'depth':null}):'');});}exports[_0x53e5('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x29fa=['minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','../../config/environment','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt'];(function(_0x49f37a,_0x1e5e53){var _0x33ce5a=function(_0x362743){while(--_0x362743){_0x49f37a['push'](_0x49f37a['shift']());}};_0x33ce5a(++_0x1e5e53);}(_0x29fa,0x15e));var _0xa29f=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0x29fa[_0x566bdf];return _0x331215;};'use strict';var _=require('lodash');var moment=require(_0xa29f('0x0'));var Redis=require('ioredis');var util=require('util');var config=require(_0xa29f('0x1'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xa29f('0x2'));config['redis']=_[_0xa29f('0x3')](config[_0xa29f('0x4')],{'host':_0xa29f('0x5'),'port':0x18eb});var io=require(_0xa29f('0x6'))(new Redis(config[_0xa29f('0x4')]));function closeInteractions(){var _0x225193=0x0;var _0x2ec881=[];return db[_0xa29f('0x7')][_0xa29f('0x8')]({'raw':!![],'attributes':['id',_0xa29f('0x9')],'where':{'id':0x1}})[_0xa29f('0xa')](function(_0x1d5110){_0x225193=_0x1d5110[_0xa29f('0x9')];if(_0x225193){return db[_0xa29f('0xb')][_0xa29f('0xc')]({'raw':!![],'attributes':['id',_0xa29f('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1d5110[_0xa29f('0x9')],_0xa29f('0xe'))}}});}else{return[];}})['then'](function(_0x45d8bd){if(_0x45d8bd&&_0x45d8bd['length']){_0x2ec881=_[_0xa29f('0xf')](_0x45d8bd||[],'id');logger[_0xa29f('0x10')](_0xa29f('0x11'),_0x2ec881[_0xa29f('0x12')]());return db[_0xa29f('0xb')][_0xa29f('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xa29f('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2ec881}});}})['then'](function(){if(_0x2ec881&&_0x2ec881[_0xa29f('0x15')]){logger[_0xa29f('0x10')](_0xa29f('0x16'),_0x2ec881[_0xa29f('0x12')]());for(var _0x40ec8a=0x0;_0x40ec8a<_0x2ec881[_0xa29f('0x15')];_0x40ec8a++){io['emit']('chatInteraction:update',{'id':_0x2ec881[_0x40ec8a],'closed':!![]});}}})['catch'](function(_0x34f96e){logger[_0xa29f('0x17')](_0xa29f('0x18'),_0x34f96e?util['inspect'](_0x34f96e,{'showHidden':![],'depth':null}):'');});}exports[_0xa29f('0x19')]=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 6f1aa37..b6b90e5 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 _0x92b2=['start','stop\x20cron','active','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','email','Smtp','service','MailAccount','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify','info','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','no\x20report\x20id','Schedule','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','isBetween','startAt','endAt','add'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92b2,0x110));var _0x292b=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x92b2[_0x367e5b];return _0x4b909e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x292b('0x0'));var _=require(_0x292b('0x1'));var moment=require(_0x292b('0x2'));var CronJobManager=require(_0x292b('0x3'));var jayson=require(_0x292b('0x4'));var BPromise=require(_0x292b('0x5'));var logger=require(_0x292b('0x6'))(_0x292b('0x7'));var db=require(_0x292b('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x292b('0x9'));var client=jayson['client'][_0x292b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1be399,_0x5f0d79){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x1be399[_0x292b('0xb')]);var _0x3a1bb3=!![];var _0x120496={'tls':{'rejectUnauthorized':![]}};if(_0x1be399['MailAccount'][_0x292b('0xc')][_0x292b('0xd')]){_0x120496[_0x292b('0xd')]=_0x1be399['MailAccount'][_0x292b('0xc')]['service'];}else{_0x120496['host']=_0x1be399[_0x292b('0xe')][_0x292b('0xc')]['host'];_0x120496[_0x292b('0xf')]=_0x1be399[_0x292b('0xe')][_0x292b('0xc')][_0x292b('0xf')];_0x120496[_0x292b('0x10')]=_0x1be399['MailAccount']['Smtp'][_0x292b('0x10')];}if(_0x1be399[_0x292b('0xe')]['Smtp'][_0x292b('0x11')]){_0x120496[_0x292b('0x12')]={'user':_0x1be399[_0x292b('0xe')][_0x292b('0xc')][_0x292b('0x13')],'pass':_0x1be399[_0x292b('0xe')][_0x292b('0xc')][_0x292b('0x14')]};}var _0x418c8c={'account':_0x120496,'message':{'from':util[_0x292b('0x15')](_0x292b('0x16'),_0x1be399[_0x292b('0xe')]['name'],_0x1be399[_0x292b('0xe')][_0x292b('0xb')]||_0x1be399[_0x292b('0xe')][_0x292b('0xc')][_0x292b('0x13')]),'to':_0x1be399[_0x292b('0xb')],'cc':_0x1be399['cc'],'bcc':_0x1be399[_0x292b('0x17')],'subject':util[_0x292b('0x15')](_0x292b('0x18'),_0x5f0d79[_0x292b('0x19')],_0x1be399[_0x292b('0x1a')],_0x1be399[_0x292b('0x1b')])}};var _0x594e85=path[_0x292b('0x1c')](__dirname,_0x292b('0x1d'));var _0x545501=_0x5f0d79[_0x292b('0x1e')];var _0x3fa3ae=util['format'](_0x292b('0x1f'),path[_0x292b('0x20')](_0x5f0d79[_0x292b('0x1e')],path[_0x292b('0x21')](_0x5f0d79[_0x292b('0x1e')])),_0x292b('0x22'));var _0x5ebd11=path[_0x292b('0x1c')](_0x594e85,_0x545501);var _0x69c016=path[_0x292b('0x1c')](_0x594e85,_0x3fa3ae);if(fs[_0x292b('0x23')](_0x5ebd11)){_0x5f0d79[_0x292b('0x24')]=_0x292b('0x25');_0x418c8c['message'][_0x292b('0x26')]=[{'filename':_0x545501,'path':_0x5ebd11}];_0x418c8c[_0x292b('0x27')][_0x292b('0x28')]=util[_0x292b('0x15')](_0x292b('0x29'),JSON['stringify'](_0x5f0d79,null,0x2));}else if(fs[_0x292b('0x23')](_0x69c016)){_0x5f0d79[_0x292b('0x24')]=_0x292b('0x25');_0x418c8c['message'][_0x292b('0x26')]=[{'filename':_0x3fa3ae,'path':_0x69c016}];}else{_0x418c8c[_0x292b('0x27')][_0x292b('0x28')]=_0x292b('0x2a');if(!_0x1be399[_0x292b('0x2b')]){_0x3a1bb3=![];logger['info'](_0x292b('0x2c'));}}if(_0x3a1bb3){return client[_0x292b('0x2d')](_0x292b('0x2e'),_0x418c8c)['then'](function(_0x145fe4){if(_0x145fe4[_0x292b('0x2f')]){return logger[_0x292b('0x2f')](_0x292b('0x30'),JSON[_0x292b('0x31')](_0x145fe4));}return logger[_0x292b('0x32')](_0x292b('0x33'));})[_0x292b('0x34')](function(_0x15dc4c){return logger[_0x292b('0x2f')]('error\x20mail',JSON[_0x292b('0x31')](_0x15dc4c));});}};}function handleError(){return function(_0x4c4697){return logger[_0x292b('0x2f')](JSON['stringify'](_0x4c4697));};}function handleResult(_0x5e3a5d){return function(_0xacc188){logger[_0x292b('0x32')](_0x292b('0x35'),JSON[_0x292b('0x31')](_0xacc188));if(_0x5e3a5d['MailAccount']&&_0x5e3a5d[_0x292b('0xe')][_0x292b('0xc')]&&!_['isNil'](_0x5e3a5d[_0x292b('0xb')])){setTimeout(handleSendEmail(_0x5e3a5d,_0xacc188),0x3c*0x3e8);}};}function handleJob(_0x3be303){return function(){try{if(_[_0x292b('0x36')](_0x3be303[_0x292b('0x1a')])){return logger[_0x292b('0x32')](_0x292b('0x37'));}if(_[_0x292b('0x36')](_0x3be303[_0x292b('0x1b')])){return logger[_0x292b('0x32')]('subtractUnit\x20null\x20or\x20undefined');}var _0x65625a={'startDate':moment()[_0x292b('0x38')](_0x3be303['subtractNumber'],_0x3be303[_0x292b('0x1b')])[_0x292b('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x292b('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x292b('0x39'),'output':_0x3be303[_0x292b('0x3a')],'name':_0x3be303['name']};if(!_[_0x292b('0x36')](_0x3be303[_0x292b('0x3b')])){logger[_0x292b('0x32')](_0x292b('0x3c'),_0x3be303[_0x292b('0x3b')]);return analyticDefaultReportController[_0x292b('0x3d')]({'id':_0x3be303['DefaultReportId']},_0x65625a)[_0x292b('0x3e')](handleResult(_0x3be303))[_0x292b('0x34')](handleError());}if(!_[_0x292b('0x36')](_0x3be303[_0x292b('0x3f')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x3be303[_0x292b('0x3f')]);return analyticCustomReportController[_0x292b('0x3d')]({'id':_0x3be303['CustomReportId']},_0x65625a)[_0x292b('0x3e')](handleResult(_0x3be303))[_0x292b('0x34')](handleError());}}catch(_0x35fa33){logger[_0x292b('0x2f')](JSON[_0x292b('0x31')](_0x35fa33));}return logger[_0x292b('0x32')](_0x292b('0x40'));};}function getJobs(_0xee1a6a){var _0x565c72={};if(_0xee1a6a){_0x565c72['id']=_0xee1a6a;}return db[_0x292b('0x41')]['findAll']({'where':_0x565c72,'include':[{'model':db[_0x292b('0xe')],'attributes':['id',_0x292b('0x19'),_0x292b('0xb')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x292b('0x3e')](function(_0x488bb2){var _0x3810dc=_['keys'](manager['jobs']);var _0xb38f3=_['map'](_0x488bb2,function(_0x5a9f94){return _0x5a9f94['id'][_0x292b('0x42')]();});var _0x541f99=_[_0x292b('0x43')](_0x488bb2,function(_0x4f84fa){return _0x4f84fa['id'][_0x292b('0x42')]();});var _0x5f0f8d=_0xee1a6a?_0xb38f3:_['difference'](_0xb38f3,_0x3810dc);var _0x59448f=_[_0x292b('0x44')](_0xb38f3,_0x3810dc);var _0x3bf7be=_[_0x292b('0x45')](_0x3810dc,_0xb38f3);var _0x12f0b3;var _0x1f719a;for(_0x12f0b3=0x0;_0x12f0b3<_0x3bf7be[_0x292b('0x46')]&&!_0xee1a6a;_0x12f0b3+=0x1){_0x1f719a=_0x3bf7be[_0x12f0b3][_0x292b('0x42')]();if(manager[_0x292b('0x47')](_0x1f719a)){manager[_0x292b('0x48')](_0x1f719a);manager[_0x292b('0x49')](_0x1f719a);logger[_0x292b('0x32')](_0x292b('0x4a'),_0x1f719a);}}logger[_0x292b('0x32')](_0x292b('0x4b'),JSON['stringify'](_0x5f0f8d));for(_0x12f0b3=0x0;_0x12f0b3<_0x5f0f8d[_0x292b('0x46')];_0x12f0b3+=0x1){_0x1f719a=_0x5f0f8d[_0x12f0b3][_0x292b('0x42')]();logger[_0x292b('0x32')](_0x292b('0x4c'),_0x1f719a);if(_0xee1a6a){logger[_0x292b('0x32')]('my\x20id',_0xee1a6a);logger[_0x292b('0x32')](JSON[_0x292b('0x31')](_0x541f99[_0x1f719a]));BPromise[_0x292b('0x4d')]()[_0x292b('0x3e')](handleJob(_0x541f99[_0x1f719a]));logger[_0x292b('0x32')](_0x292b('0x4e'),_0x541f99[_0x1f719a][_0x292b('0x19')],_0x541f99[_0x1f719a][_0x292b('0x4f')]);}else if(_0x541f99[_0x1f719a][_0x292b('0x4f')]&&_0x541f99[_0x1f719a]['active']&&moment()[_0x292b('0x50')](_0x541f99[_0x1f719a][_0x292b('0x51')],_0x541f99[_0x1f719a][_0x292b('0x52')])){manager[_0x292b('0x53')](_0x1f719a,_0x541f99[_0x1f719a][_0x292b('0x4f')],handleJob(_0x541f99[_0x1f719a]));manager[_0x292b('0x54')](_0x1f719a);logger[_0x292b('0x32')]('add\x20cron',_0x541f99[_0x1f719a][_0x292b('0x19')],_0x541f99[_0x1f719a]['cron']);}else if(manager['exists'](_0x1f719a)){manager[_0x292b('0x48')](_0x1f719a);manager[_0x292b('0x49')](_0x1f719a);logger[_0x292b('0x32')](_0x292b('0x55'),_0x541f99[_0x1f719a][_0x292b('0x19')],_0x541f99[_0x1f719a]['cron']);}}for(_0x12f0b3=0x0,_0x1f719a;_0x12f0b3<_0x59448f[_0x292b('0x46')]&&!_0xee1a6a;_0x12f0b3+=0x1){_0x1f719a=_0x59448f[_0x12f0b3][_0x292b('0x42')]();if(manager[_0x292b('0x47')](_0x1f719a)){if(_0x541f99[_0x1f719a]['cron']&&_0x541f99[_0x1f719a][_0x292b('0x56')]&&moment()[_0x292b('0x50')](_0x541f99[_0x1f719a][_0x292b('0x51')],_0x541f99[_0x1f719a][_0x292b('0x52')])){manager['update'](_0x1f719a,_0x541f99[_0x1f719a]['cron'],handleJob(_0x541f99[_0x1f719a]));logger[_0x292b('0x32')](_0x292b('0x57'),_0x541f99[_0x1f719a][_0x292b('0x19')],_0x541f99[_0x1f719a]['cron']);}else{manager['stop'](_0x1f719a);manager[_0x292b('0x49')](_0x1f719a);logger[_0x292b('0x32')](_0x292b('0x55'),_0x541f99[_0x1f719a][_0x292b('0x19')],_0x541f99[_0x1f719a][_0x292b('0x4f')]);}}}})[_0x292b('0x34')](function(_0x5a7ad5){logger['error'](JSON[_0x292b('0x31')](_0x5a7ad5));});}exports[_0x292b('0x58')]=function(_0x543d68){return getJobs(_0x543d68);};exports[_0x292b('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x81bd=['host','port','secure','authentication','auth','user','pass','format','name','bcc','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','zip','existsSync','message','attachments','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','catch','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','endAt','add','start','stop\x20cron','startAt','update','update\x20cron','run','util','path','lodash','moment','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service'];(function(_0x1dfccf,_0x486832){var _0x408558=function(_0x60acd4){while(--_0x60acd4){_0x1dfccf['push'](_0x1dfccf['shift']());}};_0x408558(++_0x486832);}(_0x81bd,0xf5));var _0xd81b=function(_0x4de5bc,_0x50fa9f){_0x4de5bc=_0x4de5bc-0x0;var _0x1d498c=_0x81bd[_0x4de5bc];return _0x1d498c;};'use strict';var fs=require('fs');var util=require(_0xd81b('0x0'));var path=require(_0xd81b('0x1'));var _=require(_0xd81b('0x2'));var moment=require(_0xd81b('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xd81b('0x4'));var logger=require(_0xd81b('0x5'))(_0xd81b('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xd81b('0x7'));var analyticDefaultReportController=require(_0xd81b('0x8'));var client=jayson[_0xd81b('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x309192,_0x5ec9d5){return function(){logger[_0xd81b('0xa')](_0xd81b('0xb'),_0x309192[_0xd81b('0xc')]);var _0x3ffa59=!![];var _0x576857={'tls':{'rejectUnauthorized':![]}};if(_0x309192[_0xd81b('0xd')][_0xd81b('0xe')][_0xd81b('0xf')]){_0x576857['service']=_0x309192[_0xd81b('0xd')]['Smtp'][_0xd81b('0xf')];}else{_0x576857[_0xd81b('0x10')]=_0x309192[_0xd81b('0xd')][_0xd81b('0xe')][_0xd81b('0x10')];_0x576857[_0xd81b('0x11')]=_0x309192[_0xd81b('0xd')][_0xd81b('0xe')]['port'];_0x576857[_0xd81b('0x12')]=_0x309192['MailAccount']['Smtp']['secure'];}if(_0x309192[_0xd81b('0xd')][_0xd81b('0xe')][_0xd81b('0x13')]){_0x576857[_0xd81b('0x14')]={'user':_0x309192[_0xd81b('0xd')][_0xd81b('0xe')][_0xd81b('0x15')],'pass':_0x309192['MailAccount'][_0xd81b('0xe')][_0xd81b('0x16')]};}var _0x4ba49b={'account':_0x576857,'message':{'from':util[_0xd81b('0x17')]('\x22%s\x22\x20<%s>',_0x309192[_0xd81b('0xd')][_0xd81b('0x18')],_0x309192[_0xd81b('0xd')][_0xd81b('0xc')]||_0x309192[_0xd81b('0xd')][_0xd81b('0xe')]['user']),'to':_0x309192[_0xd81b('0xc')],'cc':_0x309192['cc'],'bcc':_0x309192[_0xd81b('0x19')],'subject':util[_0xd81b('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x5ec9d5[_0xd81b('0x18')],_0x309192[_0xd81b('0x1a')],_0x309192[_0xd81b('0x1b')])}};var _0x3e9239=path[_0xd81b('0x1c')](__dirname,_0xd81b('0x1d'));var _0x52cfb8=_0x5ec9d5['savename'];var _0x4284e0=util[_0xd81b('0x17')]('%s.%s',path[_0xd81b('0x1e')](_0x5ec9d5[_0xd81b('0x1f')],path['extname'](_0x5ec9d5[_0xd81b('0x1f')])),_0xd81b('0x20'));var _0xaa542b=path['join'](_0x3e9239,_0x52cfb8);var _0x5e0dd6=path[_0xd81b('0x1c')](_0x3e9239,_0x4284e0);if(fs[_0xd81b('0x21')](_0xaa542b)){_0x5ec9d5['status']='Sent';_0x4ba49b[_0xd81b('0x22')][_0xd81b('0x23')]=[{'filename':_0x52cfb8,'path':_0xaa542b}];_0x4ba49b[_0xd81b('0x22')]['text']=util[_0xd81b('0x17')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd81b('0x24')](_0x5ec9d5,null,0x2));}else if(fs[_0xd81b('0x21')](_0x5e0dd6)){_0x5ec9d5['status']=_0xd81b('0x25');_0x4ba49b[_0xd81b('0x22')][_0xd81b('0x23')]=[{'filename':_0x4284e0,'path':_0x5e0dd6}];}else{_0x4ba49b[_0xd81b('0x22')]['text']=_0xd81b('0x26');if(!_0x309192[_0xd81b('0x27')]){_0x3ffa59=![];logger[_0xd81b('0xa')](_0xd81b('0x28'));}}if(_0x3ffa59){return client[_0xd81b('0x29')](_0xd81b('0x2a'),_0x4ba49b)[_0xd81b('0x2b')](function(_0x56cbdc){if(_0x56cbdc['error']){return logger[_0xd81b('0x2c')]('error\x20mail',JSON[_0xd81b('0x24')](_0x56cbdc));}return logger['info']('email\x20sent');})['catch'](function(_0x43cd26){return logger[_0xd81b('0x2c')](_0xd81b('0x2d'),JSON[_0xd81b('0x24')](_0x43cd26));});}};}function handleError(){return function(_0x2877ad){return logger[_0xd81b('0x2c')](JSON['stringify'](_0x2877ad));};}function handleResult(_0x50759d){return function(_0x5a3062){logger['info'](_0xd81b('0x2e'),JSON[_0xd81b('0x24')](_0x5a3062));if(_0x50759d[_0xd81b('0xd')]&&_0x50759d['MailAccount'][_0xd81b('0xe')]&&!_['isNil'](_0x50759d['email'])){setTimeout(handleSendEmail(_0x50759d,_0x5a3062),0x3c*0x3e8);}};}function handleJob(_0x38cb76){return function(){try{if(_[_0xd81b('0x2f')](_0x38cb76[_0xd81b('0x1a')])){return logger['info'](_0xd81b('0x30'));}if(_[_0xd81b('0x2f')](_0x38cb76[_0xd81b('0x1b')])){return logger[_0xd81b('0xa')](_0xd81b('0x31'));}var _0x21508f={'startDate':moment()[_0xd81b('0x32')](_0x38cb76[_0xd81b('0x1a')],_0x38cb76[_0xd81b('0x1b')])[_0xd81b('0x17')](_0xd81b('0x33')),'endDate':moment()[_0xd81b('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x38cb76[_0xd81b('0x34')],'name':_0x38cb76[_0xd81b('0x18')]};if(!_[_0xd81b('0x2f')](_0x38cb76[_0xd81b('0x35')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x38cb76[_0xd81b('0x35')]);return analyticDefaultReportController['runReport']({'id':_0x38cb76[_0xd81b('0x35')]},_0x21508f)[_0xd81b('0x2b')](handleResult(_0x38cb76))['catch'](handleError());}if(!_[_0xd81b('0x2f')](_0x38cb76[_0xd81b('0x36')])){logger[_0xd81b('0xa')](_0xd81b('0x37'),_0x38cb76['CustomReportId']);return analyticCustomReportController[_0xd81b('0x38')]({'id':_0x38cb76[_0xd81b('0x36')]},_0x21508f)[_0xd81b('0x2b')](handleResult(_0x38cb76))[_0xd81b('0x39')](handleError());}}catch(_0x4b590d){logger[_0xd81b('0x2c')](JSON[_0xd81b('0x24')](_0x4b590d));}return logger[_0xd81b('0xa')]('no\x20report\x20id');};}function getJobs(_0x2a9089){var _0x4d802d={};if(_0x2a9089){_0x4d802d['id']=_0x2a9089;}return db[_0xd81b('0x3a')][_0xd81b('0x3b')]({'where':_0x4d802d,'include':[{'model':db[_0xd81b('0xd')],'attributes':['id',_0xd81b('0x18'),_0xd81b('0xc')],'include':[{'model':db[_0xd81b('0x3c')],'as':_0xd81b('0xe')}]}]})['then'](function(_0x2197b9){var _0x3dcb2c=_[_0xd81b('0x3d')](manager[_0xd81b('0x3e')]);var _0x1617ff=_[_0xd81b('0x3f')](_0x2197b9,function(_0x527682){return _0x527682['id'][_0xd81b('0x40')]();});var _0xc00dd8=_[_0xd81b('0x41')](_0x2197b9,function(_0x585d70){return _0x585d70['id'][_0xd81b('0x40')]();});var _0xa391ee=_0x2a9089?_0x1617ff:_[_0xd81b('0x42')](_0x1617ff,_0x3dcb2c);var _0x2180ff=_[_0xd81b('0x43')](_0x1617ff,_0x3dcb2c);var _0x2f1297=_[_0xd81b('0x42')](_0x3dcb2c,_0x1617ff);var _0x3f1549;var _0x3132d7;for(_0x3f1549=0x0;_0x3f1549<_0x2f1297[_0xd81b('0x44')]&&!_0x2a9089;_0x3f1549+=0x1){_0x3132d7=_0x2f1297[_0x3f1549][_0xd81b('0x40')]();if(manager[_0xd81b('0x45')](_0x3132d7)){manager[_0xd81b('0x46')](_0x3132d7);manager[_0xd81b('0x47')](_0x3132d7);logger[_0xd81b('0xa')](_0xd81b('0x48'),_0x3132d7);}}logger[_0xd81b('0xa')](_0xd81b('0x49'),JSON[_0xd81b('0x24')](_0xa391ee));for(_0x3f1549=0x0;_0x3f1549<_0xa391ee[_0xd81b('0x44')];_0x3f1549+=0x1){_0x3132d7=_0xa391ee[_0x3f1549][_0xd81b('0x40')]();logger['info']('index',_0x3132d7);if(_0x2a9089){logger[_0xd81b('0xa')](_0xd81b('0x4a'),_0x2a9089);logger[_0xd81b('0xa')](JSON[_0xd81b('0x24')](_0xc00dd8[_0x3132d7]));BPromise[_0xd81b('0x4b')]()[_0xd81b('0x2b')](handleJob(_0xc00dd8[_0x3132d7]));logger[_0xd81b('0xa')](_0xd81b('0x4c'),_0xc00dd8[_0x3132d7][_0xd81b('0x18')],_0xc00dd8[_0x3132d7][_0xd81b('0x4d')]);}else if(_0xc00dd8[_0x3132d7][_0xd81b('0x4d')]&&_0xc00dd8[_0x3132d7][_0xd81b('0x4e')]&&moment()['isBetween'](_0xc00dd8[_0x3132d7]['startAt'],_0xc00dd8[_0x3132d7][_0xd81b('0x4f')])){manager[_0xd81b('0x50')](_0x3132d7,_0xc00dd8[_0x3132d7][_0xd81b('0x4d')],handleJob(_0xc00dd8[_0x3132d7]));manager[_0xd81b('0x51')](_0x3132d7);logger[_0xd81b('0xa')]('add\x20cron',_0xc00dd8[_0x3132d7]['name'],_0xc00dd8[_0x3132d7][_0xd81b('0x4d')]);}else if(manager[_0xd81b('0x45')](_0x3132d7)){manager[_0xd81b('0x46')](_0x3132d7);manager[_0xd81b('0x47')](_0x3132d7);logger['info'](_0xd81b('0x52'),_0xc00dd8[_0x3132d7][_0xd81b('0x18')],_0xc00dd8[_0x3132d7][_0xd81b('0x4d')]);}}for(_0x3f1549=0x0,_0x3132d7;_0x3f1549<_0x2180ff[_0xd81b('0x44')]&&!_0x2a9089;_0x3f1549+=0x1){_0x3132d7=_0x2180ff[_0x3f1549][_0xd81b('0x40')]();if(manager[_0xd81b('0x45')](_0x3132d7)){if(_0xc00dd8[_0x3132d7][_0xd81b('0x4d')]&&_0xc00dd8[_0x3132d7][_0xd81b('0x4e')]&&moment()['isBetween'](_0xc00dd8[_0x3132d7][_0xd81b('0x53')],_0xc00dd8[_0x3132d7][_0xd81b('0x4f')])){manager[_0xd81b('0x54')](_0x3132d7,_0xc00dd8[_0x3132d7][_0xd81b('0x4d')],handleJob(_0xc00dd8[_0x3132d7]));logger['info'](_0xd81b('0x55'),_0xc00dd8[_0x3132d7][_0xd81b('0x18')],_0xc00dd8[_0x3132d7]['cron']);}else{manager['stop'](_0x3132d7);manager[_0xd81b('0x47')](_0x3132d7);logger['info'](_0xd81b('0x52'),_0xc00dd8[_0x3132d7]['name'],_0xc00dd8[_0x3132d7][_0xd81b('0x4d')]);}}}})[_0xd81b('0x39')](function(_0x12679d){logger[_0xd81b('0x2c')](JSON['stringify'](_0x12679d));});}exports[_0xd81b('0x56')]=function(_0x41970e){return getJobs(_0x41970e);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index b15bfde..a7efb53 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 _0x0abf=['Neutral','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','catch','name','SequelizeValidationError','lodash','request-promise','util','../../config/logger','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative'];(function(_0xe51cfe,_0x325125){var _0x3eec96=function(_0x275313){while(--_0x275313){_0xe51cfe['push'](_0xe51cfe['shift']());}};_0x3eec96(++_0x325125);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};var _=require(_0xf0ab('0x0'));var AWS=require('aws-sdk');var rp=require(_0xf0ab('0x1'));var util=require(_0xf0ab('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xf0ab('0x3'))('transcribe');function getTranscriptionJob(_0x7ea4e0,_0x3be05e,_0x2efe43,_0xbb1f91){return new Promise(function(_0x2ab7d6,_0x4d2ea8){var _0x233afe=new AWS['TranscribeService']({'accessKeyId':_0x3be05e,'secretAccessKey':_0x7ea4e0,'region':_0x2efe43});_0x233afe[_0xf0ab('0x4')]({'TranscriptionJobName':_0xbb1f91},function(_0x3f7e2b,_0x3ca099){if(_0x3f7e2b){return _0x4d2ea8(_0x3f7e2b);}else{return _0x2ab7d6(_0x3ca099);}});});}function sentiment(_0x236b07,_0x480f49,_0x472508,_0x4688d8,_0x1e7887){return new Promise(function(_0x4ab8e7,_0x5d25a0){var _0x30042c=new AWS['Comprehend']({'accessKeyId':_0x480f49,'secretAccessKey':_0x236b07,'region':_0x472508});_0x30042c[_0xf0ab('0x5')]({'Text':_0x4688d8,'LanguageCode':_0x1e7887[_0xf0ab('0x6')](0x0,0x2)},function(_0xf34cc6,_0x410df5){if(_0xf34cc6){return _0x5d25a0(_0xf34cc6);}else{return _0x4ab8e7(_0x410df5);}});});}function checkTranscribeJob(_0x2dc4f8,_0x38ca67,_0x34ccdc){var _0x4fdd5f;return new BPromise(function(_0x39b4e7,_0x2cc002){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x9'),_0x2dc4f8['id'],_0x2dc4f8[_0xf0ab('0xa')]));return getTranscriptionJob(_0x34ccdc[_0xf0ab('0xb')],_0x34ccdc[_0xf0ab('0xc')],_0x38ca67[_0xf0ab('0xd')],_0x2dc4f8[_0xf0ab('0xa')])[_0xf0ab('0xe')](function(_0x221bac){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0xf'),_0x2dc4f8['id'],_0x2dc4f8['transcribeName'],_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')]));if(!_0x2dc4f8[_0xf0ab('0x12')]){switch(_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')]){case _0xf0ab('0x13'):var _0x3a0edf={'transcribeStatus':_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')],'fileUri':_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x14')][_0xf0ab('0x15')]};logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x16'),_0x2dc4f8['id']));return rp({'uri':_0x221bac[_0xf0ab('0x10')]['Transcript'][_0xf0ab('0x15')],'json':!![]})[_0xf0ab('0xe')](function(_0x1e1483){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x17'),_0x2dc4f8['id']));if(_0x1e1483&&_0x1e1483[_0xf0ab('0x18')]&&_0x1e1483[_0xf0ab('0x18')][_0xf0ab('0x19')]&&_0x1e1483[_0xf0ab('0x18')][_0xf0ab('0x19')]['length']){_0x3a0edf['fileText']='';for(var _0x4eee21=0x0;_0x4eee21<_0x1e1483[_0xf0ab('0x18')]['transcripts'][_0xf0ab('0x1a')];_0x4eee21++){_0x3a0edf[_0xf0ab('0x12')]+=_0x1e1483['results'][_0xf0ab('0x19')][_0x4eee21][_0xf0ab('0x1b')]+'';}}return _0x2dc4f8[_0xf0ab('0x1c')](_0x3a0edf);})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util['format'](_0xf0ab('0x1d'),_0x2dc4f8['id']));if(!_0x2dc4f8['tempSentiment']){throw new db['Sequelize'][(_0xf0ab('0x1e'))](_0xf0ab('0x1f'));}if(!_0x38ca67[_0xf0ab('0x20')]||!_0x38ca67[_0xf0ab('0x21')]||!_0x38ca67[_0xf0ab('0x22')]||!_0x38ca67[_0xf0ab('0x23')]||!_0x38ca67[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x26'));}if(!_0x3a0edf[_0xf0ab('0x12')]){throw new Error(_0xf0ab('0x27'));}if(_0x38ca67['sentimentAccountId']===_0x34ccdc['id']){return _0x34ccdc;}else{return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1eff91){if(!_0x1eff91){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1eff91['data1']||!_0x1eff91[_0xf0ab('0xc')]){throw new db['Sequelize'][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x4fdd5f=_0x1eff91;logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2dc4f8['id']));return sentiment(_0x4fdd5f['data1'],_0x4fdd5f[_0xf0ab('0xc')],_0x38ca67[_0xf0ab('0x22')],_0x3a0edf[_0xf0ab('0x12')],_0x38ca67[_0xf0ab('0x23')]);})[_0xf0ab('0xe')](function(_0x36195d){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x2a'),_0x2dc4f8['id']));return _0x2dc4f8[_0xf0ab('0x1c')]({'sentiment':_0x36195d[_0xf0ab('0x2b')],'sPositive':_0x36195d[_0xf0ab('0x2c')][_0xf0ab('0x2d')],'sNegative':_0x36195d[_0xf0ab('0x2c')]['Negative'],'sMixed':_0x36195d[_0xf0ab('0x2c')][_0xf0ab('0x2e')],'sNeutral':_0x36195d[_0xf0ab('0x2c')]['Neutral']});})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dc4f8['id']));_0x39b4e7();});case _0xf0ab('0x2f'):return _0x2dc4f8['update']({'transcribeStatus':_0xf0ab('0x2f'),'failureReason':_0x221bac['TranscriptionJob'][_0xf0ab('0x30')]})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x1d'),_0x2dc4f8['id']));_0x39b4e7();});default:logger[_0xf0ab('0x7')](util['format'](_0xf0ab('0x31'),_0x2dc4f8['id']));break;}}else{return BPromise[_0xf0ab('0x32')]()['then'](function(){if(!_0x2dc4f8[_0xf0ab('0x33')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x1f'));}if(!_0x38ca67[_0xf0ab('0x20')]||!_0x38ca67[_0xf0ab('0x21')]||!_0x38ca67[_0xf0ab('0x22')]||!_0x38ca67['language']||!_0x38ca67[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2dc4f8[_0xf0ab('0x12')]){throw new Error(_0xf0ab('0x27'));}if(_0x38ca67[_0xf0ab('0x21')]===_0x34ccdc['id']){return _0x34ccdc;}else{return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf0ab('0xe')](function(_0x39a212){if(!_0x39a212){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x34'));}if(!_0x39a212[_0xf0ab('0xb')]||!_0x39a212[_0xf0ab('0xc')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x35'));}_0x4fdd5f=_0x39a212;logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x36'),_0x2dc4f8['id']));return sentiment(_0x4fdd5f['data1'],_0x4fdd5f['data2'],_0x38ca67[_0xf0ab('0x22')],_0x2dc4f8['fileText'],_0x38ca67[_0xf0ab('0x23')]);})[_0xf0ab('0xe')](function(_0x4bbdf6){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2dc4f8['id']));return _0x2dc4f8[_0xf0ab('0x1c')]({'sentiment':_0x4bbdf6[_0xf0ab('0x2b')],'sPositive':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x2d')],'sNegative':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x37')],'sMixed':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x2e')],'sNeutral':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x38')],'transcribeStatus':_0xf0ab('0x13')});})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dc4f8['id']));_0x39b4e7();});}})['catch'](function(_0x3f173c){if(_0x3f173c){if(!_0x3f173c['name']||_0x3f173c['name']!=='SequelizeValidationError'){logger[_0xf0ab('0x39')](util[_0xf0ab('0x8')](_0xf0ab('0x3a'),_0x2dc4f8['id']),util[_0xf0ab('0x3b')](_0x3f173c,{'showHidden':![],'depth':null}));}}_0x39b4e7();});});}function checkTranscribe(){var _0x1a2ee9;var _0x132ada;var _0x472c1b;return db[_0xf0ab('0x3c')][_0xf0ab('0x3d')]({'where':{'transcribeStatus':_0xf0ab('0x3e')}})[_0xf0ab('0xe')](function(_0x157287){if(!_0x157287||!_0x157287['length']){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x3f'));}_0x1a2ee9=_0x157287;return db[_0xf0ab('0x40')][_0xf0ab('0x29')]({'where':{'id':0x1}});})[_0xf0ab('0xe')](function(_0x430921){if(!_0x430921){throw new db[(_0xf0ab('0x25'))]['ValidationError']('Settings\x20not\x20available');}_0x132ada=_0x430921;if(!_0x132ada['transcribe']||!_0x132ada[_0xf0ab('0x41')]||!_0x132ada[_0xf0ab('0xd')]||!_0x132ada['language']||!_0x132ada[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))]['ValidationError'](_0xf0ab('0x42'));}return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_0x132ada[_0xf0ab('0x41')]}});})[_0xf0ab('0xe')](function(_0x33112b){if(!_0x33112b){throw new db[(_0xf0ab('0x25'))]['ValidationError'](_0xf0ab('0x34'));}if(!_0x33112b['data1']||!_0x33112b[_0xf0ab('0xc')]){throw new db['Sequelize'][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x472c1b=_0x33112b;var _0x535274=[];_0x1a2ee9[_0xf0ab('0x43')](function(_0x58ac39){_0x535274[_0xf0ab('0x44')](checkTranscribeJob(_0x58ac39,_0x132ada,_0x472c1b));});return BPromise['all'](_0x535274);})[_0xf0ab('0x45')](function(_0x488001){if(_0x488001){if(!_0x488001[_0xf0ab('0x46')]||_0x488001[_0xf0ab('0x46')]!==_0xf0ab('0x47')){logger['error'](util['inspect'](_0x488001,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xb248=['Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Transcript\x20not\x20available','Negative','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','error','start','lodash','request-promise','util','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment'];(function(_0x954524,_0x5b3a39){var _0x192f1c=function(_0x5af0af){while(--_0x5af0af){_0x954524['push'](_0x954524['shift']());}};_0x192f1c(++_0x5b3a39);}(_0xb248,0xc6));var _0x8b24=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb248[_0x565c49];return _0x20ca34;};var _=require(_0x8b24('0x0'));var AWS=require('aws-sdk');var rp=require(_0x8b24('0x1'));var util=require(_0x8b24('0x2'));var BPromise=require(_0x8b24('0x3'));var db=require(_0x8b24('0x4'))['db'];var logger=require('../../config/logger')(_0x8b24('0x5'));function getTranscriptionJob(_0x4438f7,_0x5d4103,_0x253441,_0x2b605d){return new Promise(function(_0x4cc3c4,_0x6da5b7){var _0x4705e0=new AWS['TranscribeService']({'accessKeyId':_0x5d4103,'secretAccessKey':_0x4438f7,'region':_0x253441});_0x4705e0[_0x8b24('0x6')]({'TranscriptionJobName':_0x2b605d},function(_0x51bbad,_0x43b851){if(_0x51bbad){return _0x6da5b7(_0x51bbad);}else{return _0x4cc3c4(_0x43b851);}});});}function sentiment(_0x299fa2,_0xd4ab1e,_0x4ad0db,_0x403adc,_0x285c7b){return new Promise(function(_0x1775d6,_0x2edeb7){var _0x3847bd=new AWS[(_0x8b24('0x7'))]({'accessKeyId':_0xd4ab1e,'secretAccessKey':_0x299fa2,'region':_0x4ad0db});_0x3847bd[_0x8b24('0x8')]({'Text':_0x403adc,'LanguageCode':_0x285c7b[_0x8b24('0x9')](0x0,0x2)},function(_0x34fd65,_0x7a1244){if(_0x34fd65){return _0x2edeb7(_0x34fd65);}else{return _0x1775d6(_0x7a1244);}});});}function checkTranscribeJob(_0x273ecc,_0x3d3450,_0x40c1e6){var _0x40ea49;return new BPromise(function(_0x495ba4,_0x56efbf){logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0xc'),_0x273ecc['id'],_0x273ecc[_0x8b24('0xd')]));return getTranscriptionJob(_0x40c1e6[_0x8b24('0xe')],_0x40c1e6[_0x8b24('0xf')],_0x3d3450[_0x8b24('0x10')],_0x273ecc[_0x8b24('0xd')])['then'](function(_0x5a5745){logger['info'](util[_0x8b24('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x273ecc['id'],_0x273ecc['transcribeName'],_0x5a5745[_0x8b24('0x11')][_0x8b24('0x12')]));if(!_0x273ecc['fileText']){switch(_0x5a5745[_0x8b24('0x11')]['TranscriptionJobStatus']){case _0x8b24('0x13'):var _0x56d424={'transcribeStatus':_0x5a5745[_0x8b24('0x11')]['TranscriptionJobStatus'],'fileUri':_0x5a5745[_0x8b24('0x11')][_0x8b24('0x14')][_0x8b24('0x15')]};logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0x16'),_0x273ecc['id']));return rp({'uri':_0x5a5745[_0x8b24('0x11')]['Transcript'][_0x8b24('0x15')],'json':!![]})[_0x8b24('0x17')](function(_0x4fff3c){logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0x18'),_0x273ecc['id']));if(_0x4fff3c&&_0x4fff3c[_0x8b24('0x19')]&&_0x4fff3c[_0x8b24('0x19')][_0x8b24('0x1a')]&&_0x4fff3c[_0x8b24('0x19')][_0x8b24('0x1a')][_0x8b24('0x1b')]){_0x56d424[_0x8b24('0x1c')]='';for(var _0x2dd44b=0x0;_0x2dd44b<_0x4fff3c[_0x8b24('0x19')][_0x8b24('0x1a')][_0x8b24('0x1b')];_0x2dd44b++){_0x56d424[_0x8b24('0x1c')]+=_0x4fff3c[_0x8b24('0x19')][_0x8b24('0x1a')][_0x2dd44b][_0x8b24('0x1d')]+'';}}return _0x273ecc[_0x8b24('0x1e')](_0x56d424);})[_0x8b24('0x17')](function(){logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0x1f'),_0x273ecc['id']));if(!_0x273ecc[_0x8b24('0x20')]){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x23'));}if(!_0x3d3450[_0x8b24('0x24')]||!_0x3d3450['sentimentAccountId']||!_0x3d3450[_0x8b24('0x25')]||!_0x3d3450[_0x8b24('0x26')]||!_0x3d3450[_0x8b24('0x27')]){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x28'));}if(!_0x56d424[_0x8b24('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x3d3450[_0x8b24('0x29')]===_0x40c1e6['id']){return _0x40c1e6;}else{return db[_0x8b24('0x2a')][_0x8b24('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x51f4cd){if(!_0x51f4cd){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x2c'));}if(!_0x51f4cd[_0x8b24('0xe')]||!_0x51f4cd[_0x8b24('0xf')]){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x2d'));}_0x40ea49=_0x51f4cd;logger[_0x8b24('0xa')](util['format'](_0x8b24('0x2e'),_0x273ecc['id']));return sentiment(_0x40ea49[_0x8b24('0xe')],_0x40ea49[_0x8b24('0xf')],_0x3d3450['sentimentRegion'],_0x56d424[_0x8b24('0x1c')],_0x3d3450[_0x8b24('0x26')]);})[_0x8b24('0x17')](function(_0x3567b2){logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0x2f'),_0x273ecc['id']));return _0x273ecc[_0x8b24('0x1e')]({'sentiment':_0x3567b2[_0x8b24('0x30')],'sPositive':_0x3567b2['SentimentScore'][_0x8b24('0x31')],'sNegative':_0x3567b2[_0x8b24('0x32')]['Negative'],'sMixed':_0x3567b2[_0x8b24('0x32')][_0x8b24('0x33')],'sNeutral':_0x3567b2['SentimentScore'][_0x8b24('0x34')]});})[_0x8b24('0x17')](function(){logger[_0x8b24('0xa')](util[_0x8b24('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x273ecc['id']));_0x495ba4();});case _0x8b24('0x35'):return _0x273ecc[_0x8b24('0x1e')]({'transcribeStatus':_0x8b24('0x35'),'failureReason':_0x5a5745[_0x8b24('0x11')][_0x8b24('0x36')]})[_0x8b24('0x17')](function(){logger['info'](util[_0x8b24('0xb')](_0x8b24('0x1f'),_0x273ecc['id']));_0x495ba4();});default:logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0x37'),_0x273ecc['id']));break;}}else{return BPromise[_0x8b24('0x38')]()[_0x8b24('0x17')](function(){if(!_0x273ecc[_0x8b24('0x20')]){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x23'));}if(!_0x3d3450['sentiment']||!_0x3d3450[_0x8b24('0x29')]||!_0x3d3450['sentimentRegion']||!_0x3d3450[_0x8b24('0x26')]||!_0x3d3450[_0x8b24('0x27')]){throw new db[(_0x8b24('0x21'))]['ValidationError'](_0x8b24('0x28'));}if(!_0x273ecc[_0x8b24('0x1c')]){throw new Error(_0x8b24('0x39'));}if(_0x3d3450['sentimentAccountId']===_0x40c1e6['id']){return _0x40c1e6;}else{return db[_0x8b24('0x2a')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x8b24('0x17')](function(_0x5ce1c1){if(!_0x5ce1c1){throw new db['Sequelize'][(_0x8b24('0x22'))](_0x8b24('0x2c'));}if(!_0x5ce1c1[_0x8b24('0xe')]||!_0x5ce1c1[_0x8b24('0xf')]){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x2d'));}_0x40ea49=_0x5ce1c1;logger['info'](util['format'](_0x8b24('0x2e'),_0x273ecc['id']));return sentiment(_0x40ea49[_0x8b24('0xe')],_0x40ea49[_0x8b24('0xf')],_0x3d3450[_0x8b24('0x25')],_0x273ecc['fileText'],_0x3d3450[_0x8b24('0x26')]);})[_0x8b24('0x17')](function(_0x204297){logger['info'](util[_0x8b24('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x273ecc['id']));return _0x273ecc[_0x8b24('0x1e')]({'sentiment':_0x204297[_0x8b24('0x30')],'sPositive':_0x204297['SentimentScore'][_0x8b24('0x31')],'sNegative':_0x204297[_0x8b24('0x32')][_0x8b24('0x3a')],'sMixed':_0x204297[_0x8b24('0x32')][_0x8b24('0x33')],'sNeutral':_0x204297[_0x8b24('0x32')][_0x8b24('0x34')],'transcribeStatus':_0x8b24('0x13')});})[_0x8b24('0x17')](function(){logger[_0x8b24('0xa')](util[_0x8b24('0xb')](_0x8b24('0x1f'),_0x273ecc['id']));_0x495ba4();});}})['catch'](function(_0x2ea25e){if(_0x2ea25e){if(!_0x2ea25e['name']||_0x2ea25e[_0x8b24('0x3b')]!==_0x8b24('0x3c')){logger['error'](util['format'](_0x8b24('0x3d'),_0x273ecc['id']),util[_0x8b24('0x3e')](_0x2ea25e,{'showHidden':![],'depth':null}));}}_0x495ba4();});});}function checkTranscribe(){var _0x231658;var _0x353313;var _0x407b2f;return db[_0x8b24('0x3f')][_0x8b24('0x40')]({'where':{'transcribeStatus':_0x8b24('0x41')}})['then'](function(_0x478a0b){if(!_0x478a0b||!_0x478a0b['length']){throw new db[(_0x8b24('0x21'))]['ValidationError'](_0x8b24('0x42'));}_0x231658=_0x478a0b;return db[_0x8b24('0x43')][_0x8b24('0x2b')]({'where':{'id':0x1}});})[_0x8b24('0x17')](function(_0x58a26d){if(!_0x58a26d){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x44'));}_0x353313=_0x58a26d;if(!_0x353313[_0x8b24('0x5')]||!_0x353313[_0x8b24('0x45')]||!_0x353313[_0x8b24('0x10')]||!_0x353313[_0x8b24('0x26')]||!_0x353313[_0x8b24('0x27')]){throw new db[(_0x8b24('0x21'))][(_0x8b24('0x22'))](_0x8b24('0x46'));}return db[_0x8b24('0x2a')][_0x8b24('0x2b')]({'where':{'id':_0x353313[_0x8b24('0x45')]}});})[_0x8b24('0x17')](function(_0x19bf6f){if(!_0x19bf6f){throw new db[(_0x8b24('0x21'))]['ValidationError'](_0x8b24('0x2c'));}if(!_0x19bf6f[_0x8b24('0xe')]||!_0x19bf6f[_0x8b24('0xf')]){throw new db[(_0x8b24('0x21'))]['ValidationError'](_0x8b24('0x2d'));}_0x407b2f=_0x19bf6f;var _0xa16ed6=[];_0x231658[_0x8b24('0x47')](function(_0xcea62f){_0xa16ed6[_0x8b24('0x48')](checkTranscribeJob(_0xcea62f,_0x353313,_0x407b2f));});return BPromise[_0x8b24('0x49')](_0xa16ed6);})[_0x8b24('0x4a')](function(_0x20188b){if(_0x20188b){if(!_0x20188b[_0x8b24('0x3b')]||_0x20188b[_0x8b24('0x3b')]!==_0x8b24('0x3c')){logger[_0x8b24('0x4b')](util[_0x8b24('0x3e')](_0x20188b,{'showHidden':![],'depth':null}));}}});}exports[_0x8b24('0x4c')]=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 2601123..b0cbe98 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 _0xc29f=['whatsappInteraction:update','error','inspect','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','localhost','socket.io-emitter','redis','findAll','subtract','hours','then','length','map','info','join','WhatsappInteraction','update','system','timeout','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x51292d,_0x259f8c){var _0x2a62a8=function(_0x2d0ecb){while(--_0x2d0ecb){_0x51292d['push'](_0x51292d['shift']());}};_0x2a62a8(++_0x259f8c);}(_0xc29f,0x1b4));var _0xfc29=function(_0x5a8287,_0x3cdccb){_0x5a8287=_0x5a8287-0x0;var _0x5d138c=_0xc29f[_0x5a8287];return _0x5d138c;};'use strict';var _=require('lodash');var moment=require(_0xfc29('0x0'));var Redis=require('ioredis');var util=require(_0xfc29('0x1'));var config=require(_0xfc29('0x2'));var db=require(_0xfc29('0x3'))['db'];var logger=require(_0xfc29('0x4'))(_0xfc29('0x5'));config['redis']=_[_0xfc29('0x6')](config['redis'],{'host':_0xfc29('0x7'),'port':0x18eb});var io=require(_0xfc29('0x8'))(new Redis(config[_0xfc29('0x9')]));function closeInteractions(){var _0x2a767a=[];return db['WhatsappInteraction'][_0xfc29('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfc29('0xb')](0x18,_0xfc29('0xc'))}}})[_0xfc29('0xd')](function(_0x17362c){if(_0x17362c&&_0x17362c[_0xfc29('0xe')]){_0x2a767a=_[_0xfc29('0xf')](_0x17362c||[],'id');logger[_0xfc29('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x2a767a[_0xfc29('0x11')]());return db[_0xfc29('0x12')][_0xfc29('0x13')]({'closeReason':_0xfc29('0x14'),'disposition':_0xfc29('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2a767a}});}})[_0xfc29('0xd')](function(){if(_0x2a767a&&_0x2a767a['length']){logger[_0xfc29('0x10')](_0xfc29('0x16'),_0x2a767a[_0xfc29('0x11')]());for(var _0x223f9d=0x0;_0x223f9d<_0x2a767a[_0xfc29('0xe')];_0x223f9d++){io['emit'](_0xfc29('0x17'),{'id':_0x2a767a[_0x223f9d],'closed':!![]});}}})['catch'](function(_0xeb06f3){logger[_0xfc29('0x18')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xeb06f3?util[_0xfc29('0x19')](_0xeb06f3,{'showHidden':![],'depth':null}):'');});}exports[_0xfc29('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdccf=['error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','subtract','hours','then','map','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x52abbe,_0xedd7fb){var _0x199b23=function(_0x16b423){while(--_0x16b423){_0x52abbe['push'](_0x52abbe['shift']());}};_0x199b23(++_0xedd7fb);}(_0xdccf,0x95));var _0xfdcc=function(_0x3cd3e9,_0x21efe0){_0x3cd3e9=_0x3cd3e9-0x0;var _0x24a380=_0xdccf[_0x3cd3e9];return _0x24a380;};'use strict';var _=require(_0xfdcc('0x0'));var moment=require(_0xfdcc('0x1'));var Redis=require('ioredis');var util=require(_0xfdcc('0x2'));var config=require(_0xfdcc('0x3'));var db=require(_0xfdcc('0x4'))['db'];var logger=require(_0xfdcc('0x5'))('schedule');config[_0xfdcc('0x6')]=_[_0xfdcc('0x7')](config[_0xfdcc('0x6')],{'host':_0xfdcc('0x8'),'port':0x18eb});var io=require(_0xfdcc('0x9'))(new Redis(config[_0xfdcc('0x6')]));function closeInteractions(){var _0x58df4b=[];return db['WhatsappInteraction'][_0xfdcc('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfdcc('0xb')](0x18,_0xfdcc('0xc'))}}})[_0xfdcc('0xd')](function(_0xce7da9){if(_0xce7da9&&_0xce7da9['length']){_0x58df4b=_[_0xfdcc('0xe')](_0xce7da9||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x58df4b[_0xfdcc('0xf')]());return db['WhatsappInteraction'][_0xfdcc('0x10')]({'closeReason':_0xfdcc('0x11'),'disposition':_0xfdcc('0x12'),'closed':!![],'closedAt':moment()[_0xfdcc('0x13')](_0xfdcc('0x14'))},{'where':{'id':_0x58df4b}});}})[_0xfdcc('0xd')](function(){if(_0x58df4b&&_0x58df4b[_0xfdcc('0x15')]){logger[_0xfdcc('0x16')](_0xfdcc('0x17'),_0x58df4b[_0xfdcc('0xf')]());for(var _0x97e3c9=0x0;_0x97e3c9<_0x58df4b[_0xfdcc('0x15')];_0x97e3c9++){io[_0xfdcc('0x18')]('whatsappInteraction:update',{'id':_0x58df4b[_0x97e3c9],'closed':!![]});}}})['catch'](function(_0x298b6b){logger[_0xfdcc('0x19')](_0xfdcc('0x1a'),_0x298b6b?util[_0xfdcc('0x1b')](_0x298b6b,{'showHidden':![],'depth':null}):'');});}exports[_0xfdcc('0x1c')]=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 dbf6440..ae9e047 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8212=['../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1','hopper2','util'];(function(_0x1afedc,_0x17ee2f){var _0x3520db=function(_0x46b771){while(--_0x46b771){_0x1afedc['push'](_0x1afedc['shift']());}};_0x3520db(++_0x17ee2f);}(_0x8212,0xb3));var _0x2821=function(_0x5bd20c,_0xcb49f4){_0x5bd20c=_0x5bd20c-0x0;var _0x1d5aaa=_0x8212[_0x5bd20c];return _0x1d5aaa;};'use strict';var util=require(_0x2821('0x0'));var db=require(_0x2821('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x2821('0x2')+i,'lastName':_0x2821('0x3')+i,'phone':0xf879fb460+i,'email':_0x2821('0x4')+i+_0x2821('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2821('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x2821('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2821('0x7')](),'updatedAt':Date[_0x2821('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x2821('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x2821('0x4')+i+_0x2821('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x2821('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2821('0x7')](),'updatedAt':Date[_0x2821('0x7')]()});}db[_0x2821('0x8')][_0x2821('0x9')]({'where':{}})[_0x2821('0xa')](function(){return db[_0x2821('0x8')][_0x2821('0xb')](contacts);})[_0x2821('0xa')](function(){console['log'](_0x2821('0xc'),_0x2821('0xd'));return db[_0x2821('0xe')]['destroy']({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x2821('0xa')](function(){console[_0x2821('0xf')](_0x2821('0xc'),_0x2821('0x10'));return db[_0x2821('0x8')][_0x2821('0xb')](contacts2);})['then'](function(){console[_0x2821('0xf')]('finished\x20populating','contacts2');return db[_0x2821('0xe')][_0x2821('0xb')](hopper2);})[_0x2821('0xa')](function(){console[_0x2821('0xf')]('finished\x20populating',_0x2821('0x11'));})['catch'](function(_0xa448cb){console[_0x2821('0xf')](_0xa448cb);}); \ No newline at end of file +var _0x80be=['now','Innocenzo','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','contacts2','hopper2','../mysqldb','push','innocenzo.biondo','@xcally.com'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x80be,0xfc));var _0xe80b=function(_0x53e696,_0xc0b25b){_0x53e696=_0x53e696-0x0;var _0x544d89=_0x80be[_0x53e696];return _0x544d89;};'use strict';var util=require('util');var db=require(_0xe80b('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe80b('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xe80b('0x2')+i+_0xe80b('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe80b('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xe80b('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe80b('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xe80b('0x5')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xe80b('0x2')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe80b('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xe80b('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe80b('0x4')](),'updatedAt':Date['now']()});}db[_0xe80b('0x6')][_0xe80b('0x7')]({'where':{}})['then'](function(){return db[_0xe80b('0x6')]['bulkCreate'](contacts);})[_0xe80b('0x8')](function(){console[_0xe80b('0x9')](_0xe80b('0xa'),_0xe80b('0xb'));return db['CmHopper'][_0xe80b('0x7')]({'where':{}});})['then'](function(){return db[_0xe80b('0xc')][_0xe80b('0xd')](hopper);})[_0xe80b('0x8')](function(){console[_0xe80b('0x9')](_0xe80b('0xa'),'hopper1');return db['CmContact'][_0xe80b('0xd')](contacts2);})['then'](function(){console[_0xe80b('0x9')](_0xe80b('0xa'),_0xe80b('0xe'));return db[_0xe80b('0xc')][_0xe80b('0xd')](hopper2);})[_0xe80b('0x8')](function(){console[_0xe80b('0x9')]('finished\x20populating',_0xe80b('0xf'));})['catch'](function(_0x1caecb){console[_0xe80b('0x9')](_0x1caecb);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 052ae99..f42ce6e 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43ed=['then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>'];(function(_0x1d5677,_0x342d27){var _0x274227=function(_0x5ead9c){while(--_0x5ead9c){_0x1d5677['push'](_0x1d5677['shift']());}};_0x274227(++_0x342d27);}(_0x43ed,0x146));var _0xd43e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x43ed[_0x9df060];return _0x338dfe;};'use strict';var util=require(_0xd43e('0x0'));var db=require(_0xd43e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd43e('0x2')]({'name':util[_0xd43e('0x3')](_0xd43e('0x4'),_0xd43e('0x5'),i),'fullname':util[_0xd43e('0x3')](_0xd43e('0x4'),'agent',i),'email':util[_0xd43e('0x3')](_0xd43e('0x6'),_0xd43e('0x5'),i),'role':_0xd43e('0x5'),'password':_0xd43e('0x7'),'internal':0xfa0+i,'type':_0xd43e('0x8'),'transport':[_0xd43e('0x9'),'ws',_0xd43e('0xa')],'disallow':[_0xd43e('0xb')],'allow':[_0xd43e('0xc')],'defaultuser':util[_0xd43e('0x3')]('%s%s',_0xd43e('0x5'),i),'encryption':_0xd43e('0xd'),'avpf':_0xd43e('0xd'),'force_avp':_0xd43e('0xd'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd43e('0xe'),'dtlssetup':'actpass','callerid':util[_0xd43e('0x3')](_0xd43e('0xf'),util[_0xd43e('0x3')]('%s%s','agent',i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xd43e('0x10')](function(){console[_0xd43e('0x11')](_0xd43e('0x12'));})['catch'](function(_0x1b4c3c){console[_0xd43e('0x11')](_0x1b4c3c);}); \ No newline at end of file +var _0x32e0=['then','log','add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x3bfc1c,_0x5cdd1e){var _0x23fe8a=function(_0x5847c8){while(--_0x5847c8){_0x3bfc1c['push'](_0x3bfc1c['shift']());}};_0x23fe8a(++_0x5cdd1e);}(_0x32e0,0xe0));var _0x032e=function(_0x26bbd1,_0xb274f3){_0x26bbd1=_0x26bbd1-0x0;var _0x26b1eb=_0x32e0[_0x26bbd1];return _0x26b1eb;};'use strict';var util=require('util');var db=require(_0x032e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x032e('0x1')](_0x032e('0x2'),_0x032e('0x3'),i),'fullname':util[_0x032e('0x1')]('%s%s','agent',i),'email':util[_0x032e('0x1')](_0x032e('0x4'),_0x032e('0x3'),i),'role':_0x032e('0x3'),'password':_0x032e('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x032e('0x6'),'ws',_0x032e('0x7')],'disallow':[_0x032e('0x8')],'allow':[_0x032e('0x9')],'defaultuser':util[_0x032e('0x1')](_0x032e('0x2'),'agent',i),'encryption':_0x032e('0xa'),'avpf':'yes','force_avp':_0x032e('0xa'),'icesupport':_0x032e('0xa'),'dtlsenable':_0x032e('0xa'),'dtlsverify':'no','dtlscertfile':_0x032e('0xb'),'dtlsprivatekey':_0x032e('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0x032e('0xd'),util[_0x032e('0x1')]('%s%s','agent',i),0xfa0+i)});}db[_0x032e('0xe')][_0x032e('0xf')](users)[_0x032e('0x10')](function(){console[_0x032e('0x11')](_0x032e('0x12'));})[_0x032e('0x13')](function(_0x50a403){console[_0x032e('0x11')](_0x50a403);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6c2fba9..b4a8861 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68c3=['getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','then','map','Campaign','where','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','ChatQueue','FaxQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x68c3,0x8b));var _0x368c=function(_0x2a8006,_0xe34861){_0x2a8006=_0x2a8006-0x0;var _0x15fc3a=_0x68c3[_0x2a8006];return _0x15fc3a;};'use strict';var _=require(_0x368c('0x0'));var util=require('util');var BPromise=require(_0x368c('0x1'));var db=require(_0x368c('0x2'))['db'];var config=require(_0x368c('0x3'));var queryQueues={'attributes':['id',_0x368c('0x4')],'include':[{'as':'Agents','model':db[_0x368c('0x5')],'attributes':['id',_0x368c('0x4'),_0x368c('0x6')],'raw':!![],'where':{'role':_0x368c('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x368c('0x4')],'where':{'role':_0x368c('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x368c('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x368c('0x4')],'where':{'role':_0x368c('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x368c('0x9')],'where':{'type':_0x368c('0xa')}};function getAssociatedResources(_0x3b2307,_0x181501,_0x5d5a69){return db[_0x368c('0xb')][_0x368c('0xc')]({'where':{'name':_0x3b2307,'userProfileId':_0x181501},'raw':!![]})['then'](function(_0x2b9ec0){if(_0x2b9ec0){if(_0x2b9ec0['autoAssociation']){switch(_0x3b2307){case _0x368c('0xd'):case _0x368c('0xe'):case'FaxQueues':case'SmsQueues':case _0x368c('0xf'):case _0x368c('0x10'):case _0x368c('0x11'):return db[_0x5d5a69][_0x368c('0x12')](queryQueues);case _0x368c('0x13'):return db[_0x5d5a69][_0x368c('0x12')](queryTelephones);case'Trunks':return db[_0x5d5a69][_0x368c('0x12')](queryTrunks);case _0x368c('0x14'):return db[_0x5d5a69][_0x368c('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x368c('0x12')]({'attributes':[_0x368c('0x15')],'where':{'sectionId':_0x2b9ec0['id']},'raw':!![]})[_0x368c('0x16')](function(_0x55578e){if(_0x55578e){var _0x2495da={'where':{'id':_[_0x368c('0x17')](_0x55578e,_0x368c('0x15'))},'raw':!![]};switch(_0x5d5a69){case'User':_0x2495da['where'][_0x368c('0x6')]=_0x368c('0x8');break;case _0x368c('0x18'):_0x2495da[_0x368c('0x19')]['type']=_0x368c('0xa');break;}return db[_0x5d5a69][_0x368c('0x12')](_0x2495da);}else{return[];}});}}else{return[];}})[_0x368c('0x16')](function(_0x162430){return _0x162430;});}function joinOrLeaveQueues(_0x30a2fb,_0x336bd5,_0x13a78c,_0x403c8d){_0x30a2fb[_0x336bd5](util[_0x368c('0x1a')](_0x368c('0x1b'),_0x13a78c,_0x403c8d['name']));if(_0x403c8d['Agents']){for(var _0x445b20=0x0;_0x445b20<_0x403c8d[_0x368c('0x1c')]['length'];_0x445b20+=0x1){_0x30a2fb[_0x336bd5](util[_0x368c('0x1a')](_0x368c('0x1d'),_0x403c8d[_0x368c('0x1c')][_0x445b20][_0x368c('0x4')]));}}}function joinOrLeave(_0xc5656d,_0x147a12,_0x13f29e){var _0x2e8c32;if(_0xc5656d[_0x368c('0x1e')][_0x368c('0x1f')]['id']){db['User'][_0x368c('0x20')]({'attributes':['id',_0x368c('0x4'),_0x368c('0x6'),_0x368c('0x21')],'where':{'id':_0xc5656d[_0x368c('0x1e')][_0x368c('0x1f')]['id']},'include':[{'model':db[_0x368c('0x22')],'as':_0x368c('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x368c('0x24')],'as':_0x368c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x368c('0x26')],'as':_0x368c('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x368c('0x28')],'as':_0x368c('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x368c('0x2a')],'as':_0x368c('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x32f0e2){if(_0x32f0e2){_0x2e8c32=_0x32f0e2;_0xc5656d[_0x147a12](util[_0x368c('0x1a')](_0x368c('0x1d'),_0x32f0e2[_0x368c('0x4')]));var _0xa25ce7=[];switch(_0x32f0e2[_0x368c('0x6')]){case _0x368c('0x2c'):_0xc5656d[_0x147a12](_0x368c('0x2d'));_0xc5656d[_0x147a12](_0x368c('0x2e'));if(queryQueues[_0x368c('0x2f')]('include')){delete queryQueues[_0x368c('0x30')];}_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x32')]['findAll'](queryQueues));_0xa25ce7[_0x368c('0x31')](db['ChatQueue'][_0x368c('0x12')](queryQueues));_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x33')][_0x368c('0x12')](queryQueues));_0xa25ce7[_0x368c('0x31')](db['SmsQueue']['findAll'](queryQueues));_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x34')][_0x368c('0x12')](queryQueues));_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x35')][_0x368c('0x12')](queryQueues));_0xa25ce7[_0x368c('0x31')](db['WhatsappQueue']['findAll'](queryQueues));_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x5')][_0x368c('0x12')](queryTelephones));_0xa25ce7['push'](db[_0x368c('0x36')][_0x368c('0x12')](queryTrunks));_0xa25ce7['push'](db['Campaign']['findAll'](queryCampaigns));_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x5')]['findAll'](queryAgents));break;case'user':_0xc5656d[_0x147a12](_0x368c('0x2d'));_0xc5656d[_0x147a12](_0x368c('0x2e'));_0xa25ce7[_0x368c('0x31')](getAssociatedResources(_0x368c('0xd'),_0x32f0e2[_0x368c('0x21')],_0x368c('0x32')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources('ChatQueues',_0x32f0e2['userProfileId'],_0x368c('0x37')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources(_0x368c('0x38'),_0x32f0e2['userProfileId'],_0x368c('0x33')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources('SmsQueues',_0x32f0e2['userProfileId'],'SmsQueue'));_0xa25ce7[_0x368c('0x31')](getAssociatedResources(_0x368c('0xf'),_0x32f0e2['userProfileId'],_0x368c('0x34')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources('OpenchannelQueues',_0x32f0e2['userProfileId'],_0x368c('0x35')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources(_0x368c('0x11'),_0x32f0e2['userProfileId'],_0x368c('0x39')));_0xa25ce7['push'](getAssociatedResources(_0x368c('0x13'),_0x32f0e2[_0x368c('0x21')],_0x368c('0x5')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources('Trunks',_0x32f0e2['userProfileId'],_0x368c('0x36')));_0xa25ce7[_0x368c('0x31')](getAssociatedResources(_0x368c('0x14'),_0x32f0e2[_0x368c('0x21')],'Campaign'));_0xa25ce7[_0x368c('0x31')](db[_0x368c('0x5')][_0x368c('0x12')](queryAgents));break;case _0x368c('0x7'):_0xc5656d[_0x147a12]('voice:inbound');_0xc5656d[_0x147a12](_0x368c('0x2e'));_0xa25ce7[_0x368c('0x31')](_0x32f0e2[_0x368c('0x3a')]({'attributes':['id',_0x368c('0x4')]}));_0xa25ce7['push'](_0x32f0e2[_0x368c('0x3b')]({'attributes':['id','name']}));_0xa25ce7[_0x368c('0x31')](_0x32f0e2[_0x368c('0x3c')]({'attributes':['id','name']}));_0xa25ce7[_0x368c('0x31')](_0x32f0e2[_0x368c('0x3d')]({'attributes':['id',_0x368c('0x4')]}));_0xa25ce7['push'](_0x32f0e2[_0x368c('0x3e')]({'attributes':['id',_0x368c('0x4')]}));_0xa25ce7['push'](_0x32f0e2[_0x368c('0x3f')]({'attributes':['id',_0x368c('0x4')]}));_0xa25ce7[_0x368c('0x31')](_0x32f0e2[_0x368c('0x40')]({'attributes':['id',_0x368c('0x4')]}));break;}return BPromise[_0x368c('0x41')](_0xa25ce7);}})[_0x368c('0x16')](function(_0x110e17){if(_0x110e17&&_0x110e17[_0x368c('0x42')]){for(var _0x13e184=0x0;_0x13e184<_0x110e17[_0x368c('0x42')];_0x13e184+=0x1){for(var _0x56313c=0x0;_0x56313c<_0x110e17[_0x13e184][_0x368c('0x42')];_0x56313c+=0x1){switch(_0x13e184){case 0x0:joinOrLeaveQueues(_0xc5656d,_0x147a12,'voice',_0x110e17[_0x13e184][_0x56313c]);break;case 0x1:joinOrLeaveQueues(_0xc5656d,_0x147a12,_0x368c('0x43'),_0x110e17[_0x13e184][_0x56313c]);break;case 0x2:joinOrLeaveQueues(_0xc5656d,_0x147a12,_0x368c('0x44'),_0x110e17[_0x13e184][_0x56313c]);break;case 0x3:joinOrLeaveQueues(_0xc5656d,_0x147a12,_0x368c('0x45'),_0x110e17[_0x13e184][_0x56313c]);break;case 0x4:joinOrLeaveQueues(_0xc5656d,_0x147a12,_0x368c('0x46'),_0x110e17[_0x13e184][_0x56313c]);break;case 0x5:joinOrLeaveQueues(_0xc5656d,_0x147a12,_0x368c('0x47'),_0x110e17[_0x13e184][_0x56313c]);break;case 0x6:joinOrLeaveQueues(_0xc5656d,_0x147a12,'whatsapp',_0x110e17[_0x13e184][_0x56313c]);break;case 0x7:if(_0x2e8c32['role']!==_0x368c('0x7'))_0xc5656d[_0x147a12](util[_0x368c('0x1a')](_0x368c('0x48'),_0x110e17[_0x13e184][_0x56313c][_0x368c('0x4')]));break;case 0x8:if(_0x2e8c32[_0x368c('0x6')]!==_0x368c('0x7'))_0xc5656d[_0x147a12](util[_0x368c('0x1a')](_0x368c('0x49'),_0x110e17[_0x13e184][_0x56313c]['name']));break;case 0x9:if(_0x2e8c32[_0x368c('0x6')]!==_0x368c('0x7'))_0xc5656d[_0x147a12](util['format'](_0x368c('0x4a'),_0x110e17[_0x13e184][_0x56313c]['type'],_0x110e17[_0x13e184][_0x56313c]['name']));break;case 0xa:_0xc5656d[_0x147a12](util[_0x368c('0x1a')]('user:%s',_0x110e17[_0x13e184][_0x56313c][_0x368c('0x4')]));break;}}}}})['then'](function(){if(_0x147a12===_0x368c('0x4b')){var _0x2e14a0=_['map'](_0x2e8c32['ChatInteractions'],'id');return _0x2e8c32['removeChatInteractions'](_0x2e14a0)['then'](function(){for(var _0x37db38=0x0;_0x37db38<_0x2e14a0['length'];_0x37db38+=0x1){_0x13f29e[_0x368c('0x4c')](_0x368c('0x4d'),{'ChatInteractionId':Number(_0x2e14a0[_0x37db38]),'UserId':Number(_0x2e8c32['id'])});}});}})['then'](function(){if(_0x147a12===_0x368c('0x4b')){var _0x1b3084=_[_0x368c('0x17')](_0x2e8c32[_0x368c('0x4e')],'id');return _0x2e8c32[_0x368c('0x4f')](_0x1b3084)['then'](function(){for(var _0x334d7e=0x0;_0x334d7e<_0x1b3084[_0x368c('0x42')];_0x334d7e+=0x1){_0x13f29e[_0x368c('0x4c')](_0x368c('0x50'),{'MailInteractionId':Number(_0x1b3084[_0x334d7e]),'UserId':Number(_0x2e8c32['id'])});}});}})['then'](function(){if(_0x147a12===_0x368c('0x4b')){var _0x2f390c=_[_0x368c('0x17')](_0x2e8c32[_0x368c('0x25')],'id');return _0x2e8c32[_0x368c('0x51')](_0x2f390c)['then'](function(){for(var _0x353293=0x0;_0x353293<_0x2f390c['length'];_0x353293+=0x1){_0x13f29e['emit'](_0x368c('0x52'),{'FaxInteractionId':Number(_0x2f390c[_0x353293]),'UserId':Number(_0x2e8c32['id'])});}});}})[_0x368c('0x16')](function(){if(_0x147a12===_0x368c('0x4b')){var _0x125474=_[_0x368c('0x17')](_0x2e8c32['SmsInteractions'],'id');return _0x2e8c32[_0x368c('0x53')](_0x125474)[_0x368c('0x16')](function(){for(var _0x1123f5=0x0;_0x1123f5<_0x125474['length'];_0x1123f5+=0x1){_0x13f29e[_0x368c('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x125474[_0x1123f5]),'UserId':Number(_0x2e8c32['id'])});}});}})[_0x368c('0x16')](function(){if(_0x147a12===_0x368c('0x4b')){var _0x306772=_[_0x368c('0x17')](_0x2e8c32['OpenchannelInteractions'],'id');return _0x2e8c32[_0x368c('0x54')](_0x306772)[_0x368c('0x16')](function(){for(var _0x11067a=0x0;_0x11067a<_0x306772['length'];_0x11067a+=0x1){_0x13f29e[_0x368c('0x4c')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x306772[_0x11067a]),'UserId':Number(_0x2e8c32['id'])});}});}})[_0x368c('0x16')](function(){if(_0x147a12===_0x368c('0x4b')){var _0x3fbb2d=_[_0x368c('0x17')](_0x2e8c32[_0x368c('0x2b')],'id');return _0x2e8c32[_0x368c('0x55')](_0x3fbb2d)[_0x368c('0x16')](function(){for(var _0x108233=0x0;_0x108233<_0x3fbb2d[_0x368c('0x42')];_0x108233+=0x1){_0x13f29e[_0x368c('0x4c')](_0x368c('0x56'),{'WhatsappInteractionId':Number(_0x3fbb2d[_0x108233]),'UserId':Number(_0x2e8c32['id'])});}});}})[_0x368c('0x57')](function(_0x18ff1b){_0xc5656d[_0x368c('0x58')](_0x18ff1b);});}}function onDisconnect(_0x517caf,_0x5e12a7){joinOrLeave(_0x517caf,'leave',_0x5e12a7);}function onConnect(_0x5cdbd6){joinOrLeave(_0x5cdbd6,_0x368c('0x59'));}exports[_0x368c('0x5a')]=function(_0xa550bb){_0xa550bb['on'](_0x368c('0x5b'),function(_0x4e89d0){_0x4e89d0['setMaxListeners'](0x0);_0x4e89d0[_0x368c('0x5c')]=_0x4e89d0[_0x368c('0x5d')][_0x368c('0x5b')]['remoteAddress']+':'+_0x4e89d0[_0x368c('0x5d')][_0x368c('0x5b')][_0x368c('0x5e')];_0x4e89d0['connectedAt']=new Date();_0x4e89d0['log']=function(_0x37f9fc){console[_0x368c('0x58')](_0x368c('0x5f')+_0x4e89d0[_0x368c('0x60')][_0x368c('0x4')]+'['+_0x4e89d0[_0x368c('0x5c')]+']',_0x37f9fc);};_0x4e89d0['on'](_0x368c('0x61'),function(){onDisconnect(_0x4e89d0,_0xa550bb);_0x4e89d0['log'](_0x368c('0x62'));});onConnect(_0x4e89d0);_0x4e89d0['log'](_0x368c('0x63'));});}; \ No newline at end of file +var _0x4ccb=['disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','User','role','telephone','agent','type','UserProfileSection','findOne','autoAssociation','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','Telephones','findAll','UserProfileResource','resourceId','map','Campaign','ivr','then','format','%s:queue:%s','Agents','length','handshake','query','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','VoiceQueue','ChatQueue','FaxQueues','WhatsappQueues','Trunks','Trunk','IvrCampaigns','getVoiceQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','setMaxListeners','request','connection','remoteAddress','connectedAt','SocketIO\x20','nsp','address'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x4ccb,0x196));var _0xb4cc=function(_0x1ffbb0,_0x28b43f){_0x1ffbb0=_0x1ffbb0-0x0;var _0x478670=_0x4ccb[_0x1ffbb0];return _0x478670;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var BPromise=require(_0xb4cc('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xb4cc('0x3'));var queryQueues={'attributes':['id',_0xb4cc('0x4')],'include':[{'as':'Agents','model':db[_0xb4cc('0x5')],'attributes':['id',_0xb4cc('0x4'),_0xb4cc('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb4cc('0x4')],'where':{'role':_0xb4cc('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xb4cc('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb4cc('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb4cc('0x4'),_0xb4cc('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x7e4460,_0x475478,_0xbf893){return db[_0xb4cc('0xa')][_0xb4cc('0xb')]({'where':{'name':_0x7e4460,'userProfileId':_0x475478},'raw':!![]})['then'](function(_0x507d38){if(_0x507d38){if(_0x507d38[_0xb4cc('0xc')]){switch(_0x7e4460){case'VoiceQueues':case _0xb4cc('0xd'):case'FaxQueues':case _0xb4cc('0xe'):case _0xb4cc('0xf'):case _0xb4cc('0x10'):case'WhatsappQueues':return db[_0xbf893]['findAll'](queryQueues);case _0xb4cc('0x11'):return db[_0xbf893]['findAll'](queryTelephones);case'Trunks':return db[_0xbf893][_0xb4cc('0x12')](queryTrunks);case'IvrCampaigns':return db[_0xbf893]['findAll'](queryCampaigns);}}else{return db[_0xb4cc('0x13')][_0xb4cc('0x12')]({'attributes':[_0xb4cc('0x14')],'where':{'sectionId':_0x507d38['id']},'raw':!![]})['then'](function(_0x4096db){if(_0x4096db){var _0x1a5edc={'where':{'id':_[_0xb4cc('0x15')](_0x4096db,_0xb4cc('0x14'))},'raw':!![]};switch(_0xbf893){case _0xb4cc('0x5'):_0x1a5edc['where'][_0xb4cc('0x6')]=_0xb4cc('0x7');break;case _0xb4cc('0x16'):_0x1a5edc['where'][_0xb4cc('0x9')]=_0xb4cc('0x17');break;}return db[_0xbf893][_0xb4cc('0x12')](_0x1a5edc);}else{return[];}});}}else{return[];}})[_0xb4cc('0x18')](function(_0xa99916){return _0xa99916;});}function joinOrLeaveQueues(_0x5cfc7d,_0x242272,_0x20b08f,_0x300a99){_0x5cfc7d[_0x242272](util[_0xb4cc('0x19')](_0xb4cc('0x1a'),_0x20b08f,_0x300a99['name']));if(_0x300a99[_0xb4cc('0x1b')]){for(var _0x1bed69=0x0;_0x1bed69<_0x300a99[_0xb4cc('0x1b')][_0xb4cc('0x1c')];_0x1bed69+=0x1){_0x5cfc7d[_0x242272](util[_0xb4cc('0x19')]('user:%s',_0x300a99[_0xb4cc('0x1b')][_0x1bed69][_0xb4cc('0x4')]));}}}function joinOrLeave(_0x28a089,_0xaf11df,_0x5e1c46){var _0x4dddc8;if(_0x28a089[_0xb4cc('0x1d')][_0xb4cc('0x1e')]['id']){db['User']['find']({'attributes':['id',_0xb4cc('0x4'),_0xb4cc('0x6'),_0xb4cc('0x1f')],'where':{'id':_0x28a089[_0xb4cc('0x1d')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0xb4cc('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xb4cc('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xb4cc('0x22')],'as':_0xb4cc('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb4cc('0x24')],'as':_0xb4cc('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb4cc('0x26')],'as':_0xb4cc('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xb4cc('0x28')],'as':_0xb4cc('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x755b4a){if(_0x755b4a){_0x4dddc8=_0x755b4a;_0x28a089[_0xaf11df](util[_0xb4cc('0x19')](_0xb4cc('0x2a'),_0x755b4a[_0xb4cc('0x4')]));var _0x1141be=[];switch(_0x755b4a['role']){case _0xb4cc('0x2b'):_0x28a089[_0xaf11df](_0xb4cc('0x2c'));_0x28a089[_0xaf11df](_0xb4cc('0x2d'));if(queryQueues[_0xb4cc('0x2e')]('include')){delete queryQueues[_0xb4cc('0x2f')];}_0x1141be[_0xb4cc('0x30')](db['VoiceQueue'][_0xb4cc('0x12')](queryQueues));_0x1141be[_0xb4cc('0x30')](db['ChatQueue'][_0xb4cc('0x12')](queryQueues));_0x1141be[_0xb4cc('0x30')](db[_0xb4cc('0x31')][_0xb4cc('0x12')](queryQueues));_0x1141be[_0xb4cc('0x30')](db[_0xb4cc('0x32')][_0xb4cc('0x12')](queryQueues));_0x1141be[_0xb4cc('0x30')](db[_0xb4cc('0x33')]['findAll'](queryQueues));_0x1141be['push'](db[_0xb4cc('0x34')][_0xb4cc('0x12')](queryQueues));_0x1141be[_0xb4cc('0x30')](db[_0xb4cc('0x35')][_0xb4cc('0x12')](queryQueues));_0x1141be['push'](db[_0xb4cc('0x5')][_0xb4cc('0x12')](queryTelephones));_0x1141be[_0xb4cc('0x30')](db['Trunk'][_0xb4cc('0x12')](queryTrunks));_0x1141be[_0xb4cc('0x30')](db[_0xb4cc('0x16')]['findAll'](queryCampaigns));_0x1141be[_0xb4cc('0x30')](db['User'][_0xb4cc('0x12')](queryAgents));break;case _0xb4cc('0x36'):_0x28a089[_0xaf11df](_0xb4cc('0x2c'));_0x28a089[_0xaf11df](_0xb4cc('0x2d'));_0x1141be['push'](getAssociatedResources(_0xb4cc('0x37'),_0x755b4a['userProfileId'],_0xb4cc('0x38')));_0x1141be[_0xb4cc('0x30')](getAssociatedResources(_0xb4cc('0xd'),_0x755b4a[_0xb4cc('0x1f')],_0xb4cc('0x39')));_0x1141be[_0xb4cc('0x30')](getAssociatedResources(_0xb4cc('0x3a'),_0x755b4a['userProfileId'],_0xb4cc('0x31')));_0x1141be[_0xb4cc('0x30')](getAssociatedResources(_0xb4cc('0xe'),_0x755b4a['userProfileId'],'SmsQueue'));_0x1141be[_0xb4cc('0x30')](getAssociatedResources(_0xb4cc('0xf'),_0x755b4a[_0xb4cc('0x1f')],_0xb4cc('0x33')));_0x1141be[_0xb4cc('0x30')](getAssociatedResources('OpenchannelQueues',_0x755b4a[_0xb4cc('0x1f')],'OpenchannelQueue'));_0x1141be['push'](getAssociatedResources(_0xb4cc('0x3b'),_0x755b4a[_0xb4cc('0x1f')],_0xb4cc('0x35')));_0x1141be[_0xb4cc('0x30')](getAssociatedResources(_0xb4cc('0x11'),_0x755b4a['userProfileId'],_0xb4cc('0x5')));_0x1141be['push'](getAssociatedResources(_0xb4cc('0x3c'),_0x755b4a[_0xb4cc('0x1f')],_0xb4cc('0x3d')));_0x1141be[_0xb4cc('0x30')](getAssociatedResources(_0xb4cc('0x3e'),_0x755b4a[_0xb4cc('0x1f')],_0xb4cc('0x16')));_0x1141be[_0xb4cc('0x30')](db[_0xb4cc('0x5')][_0xb4cc('0x12')](queryAgents));break;case _0xb4cc('0x8'):_0x28a089[_0xaf11df]('voice:inbound');_0x28a089[_0xaf11df](_0xb4cc('0x2d'));_0x1141be[_0xb4cc('0x30')](_0x755b4a[_0xb4cc('0x3f')]({'attributes':['id',_0xb4cc('0x4')]}));_0x1141be['push'](_0x755b4a['getChatQueues']({'attributes':['id',_0xb4cc('0x4')]}));_0x1141be[_0xb4cc('0x30')](_0x755b4a['getFaxQueues']({'attributes':['id',_0xb4cc('0x4')]}));_0x1141be[_0xb4cc('0x30')](_0x755b4a[_0xb4cc('0x40')]({'attributes':['id',_0xb4cc('0x4')]}));_0x1141be['push'](_0x755b4a[_0xb4cc('0x41')]({'attributes':['id',_0xb4cc('0x4')]}));_0x1141be[_0xb4cc('0x30')](_0x755b4a['getOpenchannelQueues']({'attributes':['id',_0xb4cc('0x4')]}));_0x1141be[_0xb4cc('0x30')](_0x755b4a[_0xb4cc('0x42')]({'attributes':['id',_0xb4cc('0x4')]}));break;}return BPromise[_0xb4cc('0x43')](_0x1141be);}})[_0xb4cc('0x18')](function(_0x26caae){if(_0x26caae&&_0x26caae[_0xb4cc('0x1c')]){for(var _0x3a2283=0x0;_0x3a2283<_0x26caae['length'];_0x3a2283+=0x1){for(var _0x1933f6=0x0;_0x1933f6<_0x26caae[_0x3a2283]['length'];_0x1933f6+=0x1){switch(_0x3a2283){case 0x0:joinOrLeaveQueues(_0x28a089,_0xaf11df,_0xb4cc('0x44'),_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x1:joinOrLeaveQueues(_0x28a089,_0xaf11df,_0xb4cc('0x45'),_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x2:joinOrLeaveQueues(_0x28a089,_0xaf11df,_0xb4cc('0x46'),_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x3:joinOrLeaveQueues(_0x28a089,_0xaf11df,'sms',_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x4:joinOrLeaveQueues(_0x28a089,_0xaf11df,_0xb4cc('0x47'),_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x5:joinOrLeaveQueues(_0x28a089,_0xaf11df,_0xb4cc('0x48'),_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x6:joinOrLeaveQueues(_0x28a089,_0xaf11df,_0xb4cc('0x49'),_0x26caae[_0x3a2283][_0x1933f6]);break;case 0x7:if(_0x4dddc8[_0xb4cc('0x6')]!==_0xb4cc('0x8'))_0x28a089[_0xaf11df](util[_0xb4cc('0x19')](_0xb4cc('0x4a'),_0x26caae[_0x3a2283][_0x1933f6][_0xb4cc('0x4')]));break;case 0x8:if(_0x4dddc8['role']!==_0xb4cc('0x8'))_0x28a089[_0xaf11df](util[_0xb4cc('0x19')](_0xb4cc('0x4b'),_0x26caae[_0x3a2283][_0x1933f6][_0xb4cc('0x4')]));break;case 0x9:if(_0x4dddc8[_0xb4cc('0x6')]!==_0xb4cc('0x8'))_0x28a089[_0xaf11df](util[_0xb4cc('0x19')]('campaign:%s:%s',_0x26caae[_0x3a2283][_0x1933f6][_0xb4cc('0x9')],_0x26caae[_0x3a2283][_0x1933f6][_0xb4cc('0x4')]));break;case 0xa:_0x28a089[_0xaf11df](util['format'](_0xb4cc('0x2a'),_0x26caae[_0x3a2283][_0x1933f6][_0xb4cc('0x4')]));break;}}}}})[_0xb4cc('0x18')](function(){if(_0xaf11df===_0xb4cc('0x4c')){var _0x4b2184=_[_0xb4cc('0x15')](_0x4dddc8['ChatInteractions'],'id');return _0x4dddc8[_0xb4cc('0x4d')](_0x4b2184)['then'](function(){for(var _0x494cfd=0x0;_0x494cfd<_0x4b2184[_0xb4cc('0x1c')];_0x494cfd+=0x1){_0x5e1c46[_0xb4cc('0x4e')](_0xb4cc('0x4f'),{'ChatInteractionId':Number(_0x4b2184[_0x494cfd]),'UserId':Number(_0x4dddc8['id'])});}});}})['then'](function(){if(_0xaf11df===_0xb4cc('0x4c')){var _0x1c65aa=_[_0xb4cc('0x15')](_0x4dddc8[_0xb4cc('0x21')],'id');return _0x4dddc8[_0xb4cc('0x50')](_0x1c65aa)['then'](function(){for(var _0x45bd2c=0x0;_0x45bd2c<_0x1c65aa[_0xb4cc('0x1c')];_0x45bd2c+=0x1){_0x5e1c46['emit'](_0xb4cc('0x51'),{'MailInteractionId':Number(_0x1c65aa[_0x45bd2c]),'UserId':Number(_0x4dddc8['id'])});}});}})[_0xb4cc('0x18')](function(){if(_0xaf11df===_0xb4cc('0x4c')){var _0x4f9a98=_[_0xb4cc('0x15')](_0x4dddc8[_0xb4cc('0x23')],'id');return _0x4dddc8['removeFaxInteractions'](_0x4f9a98)['then'](function(){for(var _0x6c1e81=0x0;_0x6c1e81<_0x4f9a98['length'];_0x6c1e81+=0x1){_0x5e1c46[_0xb4cc('0x4e')](_0xb4cc('0x52'),{'FaxInteractionId':Number(_0x4f9a98[_0x6c1e81]),'UserId':Number(_0x4dddc8['id'])});}});}})['then'](function(){if(_0xaf11df===_0xb4cc('0x4c')){var _0x2a0c11=_[_0xb4cc('0x15')](_0x4dddc8[_0xb4cc('0x25')],'id');return _0x4dddc8[_0xb4cc('0x53')](_0x2a0c11)['then'](function(){for(var _0x6a7fec=0x0;_0x6a7fec<_0x2a0c11['length'];_0x6a7fec+=0x1){_0x5e1c46[_0xb4cc('0x4e')](_0xb4cc('0x54'),{'SmsInteractionId':Number(_0x2a0c11[_0x6a7fec]),'UserId':Number(_0x4dddc8['id'])});}});}})[_0xb4cc('0x18')](function(){if(_0xaf11df==='leave'){var _0x11e230=_[_0xb4cc('0x15')](_0x4dddc8[_0xb4cc('0x27')],'id');return _0x4dddc8['removeOpenchannelInteractions'](_0x11e230)[_0xb4cc('0x18')](function(){for(var _0x2019a8=0x0;_0x2019a8<_0x11e230[_0xb4cc('0x1c')];_0x2019a8+=0x1){_0x5e1c46['emit'](_0xb4cc('0x55'),{'OpenchannelInteractionId':Number(_0x11e230[_0x2019a8]),'UserId':Number(_0x4dddc8['id'])});}});}})[_0xb4cc('0x18')](function(){if(_0xaf11df===_0xb4cc('0x4c')){var _0xd65693=_[_0xb4cc('0x15')](_0x4dddc8['WhatsappInteractions'],'id');return _0x4dddc8[_0xb4cc('0x56')](_0xd65693)[_0xb4cc('0x18')](function(){for(var _0x3b6c2f=0x0;_0x3b6c2f<_0xd65693[_0xb4cc('0x1c')];_0x3b6c2f+=0x1){_0x5e1c46[_0xb4cc('0x4e')](_0xb4cc('0x57'),{'WhatsappInteractionId':Number(_0xd65693[_0x3b6c2f]),'UserId':Number(_0x4dddc8['id'])});}});}})[_0xb4cc('0x58')](function(_0x31d28c){_0x28a089[_0xb4cc('0x59')](_0x31d28c);});}}function onDisconnect(_0x491aaa,_0x23bb10){joinOrLeave(_0x491aaa,'leave',_0x23bb10);}function onConnect(_0x3a3c4c){joinOrLeave(_0x3a3c4c,_0xb4cc('0x5a'));}exports['default']=function(_0x2f3a03){_0x2f3a03['on']('connection',function(_0x314c8b){_0x314c8b[_0xb4cc('0x5b')](0x0);_0x314c8b['address']=_0x314c8b[_0xb4cc('0x5c')][_0xb4cc('0x5d')][_0xb4cc('0x5e')]+':'+_0x314c8b[_0xb4cc('0x5c')][_0xb4cc('0x5d')]['remotePort'];_0x314c8b[_0xb4cc('0x5f')]=new Date();_0x314c8b['log']=function(_0x1790b8){console[_0xb4cc('0x59')](_0xb4cc('0x60')+_0x314c8b[_0xb4cc('0x61')][_0xb4cc('0x4')]+'['+_0x314c8b[_0xb4cc('0x62')]+']',_0x1790b8);};_0x314c8b['on'](_0xb4cc('0x63'),function(){onDisconnect(_0x314c8b,_0x2f3a03);_0x314c8b[_0xb4cc('0x59')](_0xb4cc('0x64'));});onConnect(_0x314c8b);_0x314c8b[_0xb4cc('0x59')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 460ff8d..4e0775e 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 _0x8ad8=['model','hook','callback','condition','jayson/promise','../logger','triggers','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','QueryTypes','SELECT','contact','undefined','UserId','interface','format','name','agent','outgoingmessage','AfterCreateMessage','motionChannel','opened','SIP/%s','changed','closed','substatus','Sequelize','AfterUpdate','User','fullname','email','internal','default','length','hasOwnProperty'];(function(_0x50f3dd,_0x32978c){var _0x34473e=function(_0x3e0ea1){while(--_0x3e0ea1){_0x50f3dd['push'](_0x50f3dd['shift']());}};_0x34473e(++_0x32978c);}(_0x8ad8,0x1ee));var _0x88ad=function(_0x278201,_0x5dfa87){_0x278201=_0x278201-0x0;var _0x3ff2d1=_0x8ad8[_0x278201];return _0x3ff2d1;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x88ad('0x0'));var logger=require(_0x88ad('0x1'))(_0x88ad('0x2'));var client=jayson['client'][_0x88ad('0x3')]({'port':0x232a});var triggers=[{'channel':_0x88ad('0x4'),'model':'ChatInteraction','event':_0x88ad('0x5'),'condition':_0x88ad('0x6'),'callback':afterCreate},{'channel':_0x88ad('0x4'),'model':_0x88ad('0x7'),'event':_0x88ad('0x8'),'condition':_0x88ad('0x9'),'callback':afterUpdate},{'channel':_0x88ad('0x4'),'model':'ChatMessage','event':_0x88ad('0x5'),'condition':_0x88ad('0xa'),'callback':afterCreateMessage},{'channel':_0x88ad('0xb'),'model':'SmsInteraction','event':_0x88ad('0x5'),'condition':_0x88ad('0x6'),'callback':afterCreate},{'channel':_0x88ad('0xb'),'model':_0x88ad('0xc'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x88ad('0xb'),'model':_0x88ad('0xd'),'event':_0x88ad('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x88ad('0xe'),'model':_0x88ad('0xf'),'event':'afterCreate','condition':_0x88ad('0x6'),'callback':afterCreate},{'channel':_0x88ad('0xe'),'model':'WhatsappInteraction','event':_0x88ad('0x8'),'condition':_0x88ad('0x9'),'callback':afterUpdate},{'channel':_0x88ad('0xe'),'model':'WhatsappMessage','event':_0x88ad('0x5'),'condition':_0x88ad('0xa'),'callback':afterCreateMessage},{'channel':_0x88ad('0x10'),'model':_0x88ad('0x11'),'event':'afterCreate','condition':_0x88ad('0x6'),'callback':afterCreate},{'channel':'Fax','model':_0x88ad('0x11'),'event':_0x88ad('0x8'),'condition':_0x88ad('0x9'),'callback':afterUpdate},{'channel':_0x88ad('0x10'),'model':_0x88ad('0x12'),'event':_0x88ad('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x88ad('0x13'),'model':_0x88ad('0x14'),'event':'afterCreate','condition':_0x88ad('0x6'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0x88ad('0x8'),'condition':_0x88ad('0x9'),'callback':afterUpdate},{'channel':_0x88ad('0x13'),'model':'MailMessage','event':_0x88ad('0x5'),'condition':_0x88ad('0xa'),'callback':afterCreateMessage},{'channel':_0x88ad('0x15'),'model':_0x88ad('0x16'),'event':'afterCreate','condition':_0x88ad('0x6'),'callback':afterCreate},{'channel':'Openchannel','model':_0x88ad('0x16'),'event':_0x88ad('0x8'),'condition':_0x88ad('0x9'),'callback':afterUpdate},{'channel':_0x88ad('0x15'),'model':_0x88ad('0x17'),'event':_0x88ad('0x5'),'condition':_0x88ad('0xa'),'callback':afterCreateMessage}];function request(_0x59b646){return client['request'](_0x88ad('0x18'),_0x59b646)[_0x88ad('0x19')](function(_0x1ed0b0){logger[_0x88ad('0x1a')](_0x88ad('0x1b'),_0x88ad('0x18'),_0x1ed0b0);if(_0x1ed0b0['error']){if(_0x1ed0b0[_0x88ad('0x1c')][_0x88ad('0x1d')]===0x1f4){logger[_0x88ad('0x1c')](_0x88ad('0x1b'),'EventManager',_0x1ed0b0[_0x88ad('0x1c')]);}}})[_0x88ad('0x1e')](function(_0x3cf904){logger[_0x88ad('0x1c')]('Trigger,\x20%s',_0x88ad('0x18'),_0x3cf904);});}function afterCreateMessage(_0x4b0bdb){return function(_0x45ce40){_0x45ce40=_0x45ce40[_0x88ad('0x1f')]({'plain':!![]});_0x45ce40[_0x88ad('0x20')]=_0x4b0bdb;_0x45ce40['motionChannel']=_0x4b0bdb;_0x45ce40[_0x88ad('0x21')]=_0x45ce40[_0x88ad('0x22')];Promise[_0x88ad('0x23')]()[_0x88ad('0x19')](function(){if(typeof _0x45ce40[_0x88ad('0x24')]==='undefined')return null;var _0x4038e2=_0x88ad('0x25')+_0x45ce40[_0x88ad('0x24')];return db[_0x88ad('0x26')][_0x88ad('0x27')](_0x4038e2,{'type':db['Sequelize'][_0x88ad('0x28')][_0x88ad('0x29')],'raw':!![]});})[_0x88ad('0x19')](function(_0x480bf9){if(_0x480bf9){_0x45ce40[_0x88ad('0x2a')]=_0x480bf9[0x0];}if(typeof _0x45ce40['UserId']===_0x88ad('0x2b'))return;return getAgent(_0x45ce40[_0x88ad('0x2c')]);})[_0x88ad('0x19')](function(_0x570294){if(_0x570294){_0x45ce40[_0x88ad('0x2d')]=util[_0x88ad('0x2e')]('SIP/%s',_0x570294[_0x88ad('0x2f')]);_0x45ce40[_0x88ad('0x30')]=_0x570294;_0x45ce40[_0x88ad('0x20')]=_0x4b0bdb;return request({'event':'incomingmessage','message':_0x45ce40});}else{return request({'event':_0x88ad('0x31'),'message':_0x45ce40});}})[_0x88ad('0x1e')](function(_0xf57ab7){logger[_0x88ad('0x1c')](_0x88ad('0x1b'),_0x88ad('0x32'),_0xf57ab7);});};}function afterCreate(_0x3e4598,_0x3b46d9){return function(_0xf996e){_0xf996e=_0xf996e['get']({'plain':!![]});_0xf996e[_0x88ad('0x20')]=_0x3e4598;_0xf996e[_0x88ad('0x33')]=_0x3e4598;_0xf996e[_0x88ad('0x21')]=_0x88ad('0x34');Promise[_0x88ad('0x23')]()[_0x88ad('0x19')](function(){var _0x241820=_0x88ad('0x25')+_0xf996e[_0x88ad('0x24')];return db[_0x88ad('0x26')]['query'](_0x241820,{'type':db['Sequelize'][_0x88ad('0x28')][_0x88ad('0x29')],'raw':!![]});})[_0x88ad('0x19')](function(_0x146e22){if(_0x146e22){_0xf996e[_0x88ad('0x2a')]=_0x146e22[0x0];}if(typeof _0xf996e[_0x88ad('0x2c')]===_0x88ad('0x2b'))return;return getAgent(_0xf996e[_0x88ad('0x2c')]);})[_0x88ad('0x19')](function(_0xdce984){if(_0xdce984){_0xf996e[_0x88ad('0x2d')]=util['format'](_0x88ad('0x35'),_0xdce984[_0x88ad('0x2f')]);_0xf996e[_0x88ad('0x30')]=_0xdce984;}return request({'event':_0x3b46d9,'message':_0xf996e});})[_0x88ad('0x1e')](function(_0x4c9380){logger[_0x88ad('0x1c')](_0x88ad('0x1b'),'AfterCreate',_0x4c9380);});};}function afterUpdate(_0x2807e0){return function(_0x499d7d){var _0x70e707=_0x499d7d[_0x88ad('0x36')](_0x88ad('0x37'))&&_0x499d7d[_0x88ad('0x37')];var _0x268067=_0x499d7d[_0x88ad('0x36')]('substatus');if(_0x70e707||_0x268067){var _0x3f387f=_0x70e707?_0x88ad('0x9'):_0x88ad('0x38');var _0x59b02c=_0x499d7d['get']({'plain':!![]});_0x59b02c['channel']=_0x2807e0;_0x59b02c[_0x88ad('0x33')]=_0x2807e0;_0x59b02c[_0x88ad('0x21')]=_0x70e707?_0x88ad('0x37'):_0x88ad('0x38');var _0x3de3fd=_0x88ad('0x25')+_0x59b02c[_0x88ad('0x24')];return db[_0x88ad('0x26')][_0x88ad('0x27')](_0x3de3fd,{'type':db[_0x88ad('0x39')][_0x88ad('0x28')][_0x88ad('0x29')],'raw':!![]})['then'](function(_0x2f2149){if(_0x2f2149){_0x59b02c[_0x88ad('0x2a')]=_0x2f2149[0x0];}if(typeof _0x59b02c[_0x88ad('0x2c')]===_0x88ad('0x2b'))return;return getAgent(_0x59b02c[_0x88ad('0x2c')]);})['then'](function(_0x269da7){if(_0x269da7){_0x59b02c[_0x88ad('0x2d')]=util[_0x88ad('0x2e')](_0x88ad('0x35'),_0x269da7['name']);_0x59b02c[_0x88ad('0x30')]=_0x269da7;}return request({'event':_0x3f387f,'message':_0x59b02c});})['catch'](function(_0x41dfd7){logger[_0x88ad('0x1c')]('Trigger,\x20%s',_0x88ad('0x3a'),_0x41dfd7);});}};}function getAgent(_0x3b31c1){return db[_0x88ad('0x3b')]['find']({'where':{'id':_0x3b31c1},'attributes':['id','name',_0x88ad('0x3c'),_0x88ad('0x3d'),_0x88ad('0x3e')],'raw':!![]})[_0x88ad('0x19')](function(_0x24e276){return _0x24e276;});}exports[_0x88ad('0x3f')]=function(){for(var _0x2283e6=0x0;_0x2283e6=_0x36a4e4[_0xa017('0x11')]){throw Error(_0xa017('0x12'));}_0x8e403f(_0x9b14f6);})[_0xa017('0x13')](function(_0x34b6d3){_0x3b09ed(_0x34b6d3);});});}; \ No newline at end of file +var _0x3807=['mail','chat','sms','whatsapp','isValidChannel','includes','clearBlockUser','isUndefined','updateAttributes','getLicense','role','User','count','agent','agents','Maximum\x20login\x20has\x20been\x20reached','../mysqldb','./license/util'];(function(_0x87fc37,_0x3d1cc2){var _0xe530a2=function(_0x4cc194){while(--_0x4cc194){_0x87fc37['push'](_0x87fc37['shift']());}};_0xe530a2(++_0x3d1cc2);}(_0x3807,0xa0));var _0x7380=function(_0x365d53,_0x48f29f){_0x365d53=_0x365d53-0x0;var _0x3a6761=_0x3807[_0x365d53];return _0x3a6761;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x7380('0x0'))['db'];var util=require(_0x7380('0x1'));var channels=['voice',_0x7380('0x2'),_0x7380('0x3'),'fax',_0x7380('0x4'),_0x7380('0x5'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x7380('0x6')]=function(_0x4e79fb){_0x4e79fb=_0x4e79fb['toLowerCase']();return _[_0x7380('0x7')](channels,_0x4e79fb);};exports[_0x7380('0x8')]=function(_0x10733e,_0x154c99,_0x177aaa,_0x24069c){var _0x146045={'loginAttempts':_0x154c99,'blocked':_0x177aaa};if(!_[_0x7380('0x9')](_0x24069c)){_0x146045['blockedAt']=_0x24069c;}return _0x10733e[_0x7380('0xa')](_0x146045);};exports[_0x7380('0xb')]=function(_0x5935b7){return new BPromise(function(_0x4b7535,_0x1d1c4c){var _0x499c90=0x0;if(_0x5935b7[_0x7380('0xc')]!=='agent'){_0x4b7535(_0x5935b7);}db[_0x7380('0xd')][_0x7380('0xe')]({'where':{'role':_0x7380('0xf'),'online':!![],'id':{'$ne':_0x5935b7['id']}}})['then'](function(_0x4cdaf2){_0x499c90=_0x4cdaf2;return util[_0x7380('0xb')]();})['then'](function(_0x351d98){if(_0x351d98&&_0x351d98[_0x7380('0x10')]&&_0x499c90>=_0x351d98[_0x7380('0x10')]){throw Error(_0x7380('0x11'));}_0x4b7535(_0x5935b7);})['catch'](function(_0x1daad9){_0x1d1c4c(_0x1daad9);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index c6b4865..444db7e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb78d=['status','render','json','exports','404'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb78d,0x14d));var _0xdb78=function(_0x5ea643,_0x47edad){_0x5ea643=_0x5ea643-0x0;var _0x5e0d65=_0xb78d[_0x5ea643];return _0x5e0d65;};'use strict';module[_0xdb78('0x0')][0x194]=function pageNotFound(_0x4f797e,_0x53cb01){var _0x6c7d27=_0xdb78('0x1');var _0x441c71=0x194;var _0x5ad0f1={'status':_0x441c71};_0x53cb01[_0xdb78('0x2')](_0x5ad0f1['status']);_0x53cb01[_0xdb78('0x3')](_0x6c7d27,{},function(_0x813611,_0x2905a8){if(_0x813611){return _0x53cb01[_0xdb78('0x2')](_0x5ad0f1[_0xdb78('0x2')])[_0xdb78('0x4')](_0x5ad0f1);}_0x53cb01['send'](_0x2905a8);});}; \ No newline at end of file +var _0x9464=['404','status','render','json','send'];(function(_0x401bc3,_0x26ac00){var _0x21532c=function(_0x4597be){while(--_0x4597be){_0x401bc3['push'](_0x401bc3['shift']());}};_0x21532c(++_0x26ac00);}(_0x9464,0xd7));var _0x4946=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x9464[_0x589f71];return _0x5763bd;};'use strict';module['exports'][0x194]=function pageNotFound(_0x25bb17,_0x49a16e){var _0x36abb8=_0x4946('0x0');var _0x3758a7=0x194;var _0x28f641={'status':_0x3758a7};_0x49a16e[_0x4946('0x1')](_0x28f641[_0x4946('0x1')]);_0x49a16e[_0x4946('0x2')](_0x36abb8,{},function(_0x474bf8,_0x1503dc){if(_0x474bf8){return _0x49a16e[_0x4946('0x1')](_0x28f641[_0x4946('0x1')])[_0x4946('0x3')](_0x28f641);}_0x49a16e[_0x4946('0x4')](_0x1503dc);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index e2b4cbd..44396fe 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['Smtp','Dispositions','Answers','ListId','TemplateId','Agents','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailMessage','Attachments','Interaction','Account','ChatOfflineMessage','ChatOfflineMessageId','restrict','List','Items','FaxAccount','FaxAccountId','Interactions','Applications','FaxInteractionId','Owner','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','TagId','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','Agent','Queue','ChatQueueId','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','CmHopper','HopperHistories','SmsInteractions','Company','cm_contact_has_tags','OwnerId','CampaignId','All','AutomationAllId','OneAny','AutomationAnyId','Action','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','chat_interaction_has_tags','fax_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyCondition','TriggerAnyId','Actions','Fields','CustomReportId','AnalyticMetric','AnalyticFieldReport','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceConfiguration','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','SugarcrmAccount','Subjects','DeskAccount','DeskField','int_desk_configuration_has_tags','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','FromId','ToId','JscriptySessionReport','SessionId','JscriptyAnswerReport','SmsQueueReport','ProjectId','SquareProject','OpenchannelQueues','team_has_whatsapp_queues','WhatsappQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailAccountId','FromChatWebsiteId','ToQueue','ToFaxQueueId','ToAccount','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','CustomFields','Queues','userProfileId','Resources','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','ToWhatsappAccountId','WhatsappQueueId','exports','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','username','password','options','database','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskConfiguration','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','cascade','hasMany','Recordings','UserId','UserVoiceQueueRt','Extensions','HopperFinals','HopperHistory','ChatInteraction','ChatInteractions','FaxInteractions','UserNotifications','SenderId','belongsTo','ChatGroup','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueue','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','CmContact','Contact','ContactId','MailServerIn','MailAccountId','MailServerOut','hasOne','Imap'];(function(_0x67b97a,_0x503a86){var _0x1c50b2=function(_0x1f76d7){while(--_0x1f76d7){_0x67b97a['push'](_0x67b97a['shift']());}};_0x1c50b2(++_0x503a86);}(_0x9354,0x96));var _0x4935=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0x9354[_0x594ece];return _0x471bc4;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x4935('0x0'));var _=require(_0x4935('0x1'));var jstz=require('jstz');var timezone=jstz[_0x4935('0x2')]();config[_0x4935('0x0')]=_[_0x4935('0x3')](config[_0x4935('0x0')],{'database':'motion2','username':_0x4935('0x4'),'password':_0x4935('0x5'),'options':{'host':_0x4935('0x6'),'port':0xcea,'dialect':_0x4935('0x7'),'dialectOptions':{'charset':_0x4935('0x8')},'logging':![],'timezone':timezone[_0x4935('0x9')](),'define':{'charset':_0x4935('0xa'),'collate':_0x4935('0xb')}}});config[_0x4935('0xc')]=_['defaultsDeep'](config[_0x4935('0xc')],{'database':'motion2','username':_0x4935('0x4'),'password':_0x4935('0x5'),'options':{'host':_0x4935('0x6'),'port':0xcea,'dialect':_0x4935('0x7'),'dialectOptions':{'charset':_0x4935('0x8')},'logging':![],'timezone':timezone[_0x4935('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4935('0x0')]['database'],config['sequelize'][_0x4935('0xd')],config[_0x4935('0x0')][_0x4935('0xe')],config[_0x4935('0x0')][_0x4935('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4935('0xc')][_0x4935('0x10')],config[_0x4935('0xc')][_0x4935('0xd')],config[_0x4935('0xc')][_0x4935('0xe')],config[_0x4935('0xc')][_0x4935('0xf')])};db[_0x4935('0x11')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/user/user.model');db[_0x4935('0x13')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x14'));db[_0x4935('0x15')]=db[_0x4935('0x0')]['import'](_0x4935('0x16'));db[_0x4935('0x17')]=db['sequelize'][_0x4935('0x12')](_0x4935('0x18'));db[_0x4935('0x19')]=db['sequelize']['import'](_0x4935('0x1a'));db[_0x4935('0x1b')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x1c'));db[_0x4935('0x1d')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0x4935('0x1e')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x1f'));db[_0x4935('0x20')]=db['sequelize']['import'](_0x4935('0x21'));db[_0x4935('0x22')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x23'));db[_0x4935('0x24')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x25'));db[_0x4935('0x26')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x27'));db[_0x4935('0x28')]=db[_0x4935('0x0')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x4935('0x29')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x2a'));db[_0x4935('0x2b')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x2c'));db['VoiceTransferReport']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x4935('0x0')]['import'](_0x4935('0x2d'));db[_0x4935('0x2e')]=db[_0x4935('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x4935('0x2f')]=db[_0x4935('0x0')]['import'](_0x4935('0x30'));db[_0x4935('0x31')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x32'));db['UserFaxQueue']=db['sequelize'][_0x4935('0x12')](_0x4935('0x33'));db['UserSmsQueue']=db['sequelize'][_0x4935('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x4935('0x34')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x35'));db[_0x4935('0x36')]=db[_0x4935('0x0')]['import'](_0x4935('0x37'));db['MailServerIn']=db[_0x4935('0x0')]['import'](_0x4935('0x38'));db['MailServerOut']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x39'));db[_0x4935('0x3a')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x3b'));db['MailQueue']=db['sequelize'][_0x4935('0x12')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x4935('0x0')]['import'](_0x4935('0x3c'));db[_0x4935('0x3d')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x3e'));db['MailMessage']=db['sequelize'][_0x4935('0x12')](_0x4935('0x3f'));db[_0x4935('0x40')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x41'));db[_0x4935('0x42')]=db[_0x4935('0x0')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x4935('0x43')]=db[_0x4935('0x0')]['import'](_0x4935('0x44'));db[_0x4935('0x45')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/faxAccount/faxAccount.model');db[_0x4935('0x46')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/faxApplication/faxApplication.model');db[_0x4935('0x47')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x48'));db[_0x4935('0x49')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x4a'));db[_0x4935('0x4b')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x4c'));db[_0x4935('0x4d')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x4e'));db[_0x4935('0x4f')]=db[_0x4935('0x0')]['import'](_0x4935('0x50'));db['SmsApplication']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x51'));db[_0x4935('0x52')]=db['sequelize'][_0x4935('0x12')](_0x4935('0x53'));db[_0x4935('0x54')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x55'));db[_0x4935('0x56')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x57'));db['OpenchannelAccount']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0x4935('0x58')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x59'));db[_0x4935('0x5a')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x5b'));db['OpenchannelMessage']=db[_0x4935('0x0')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0x4935('0x5c')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x5d'));db[_0x4935('0x5e')]=db['sequelize'][_0x4935('0x12')](_0x4935('0x5f'));db[_0x4935('0x60')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x61'));db[_0x4935('0x62')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x63'));db['ChatInteraction']=db[_0x4935('0x0')]['import'](_0x4935('0x64'));db[_0x4935('0x65')]=db['sequelize'][_0x4935('0x12')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize'][_0x4935('0x12')](_0x4935('0x66'));db[_0x4935('0x67')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x68'));db['ChatProactiveAction']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x69'));db[_0x4935('0x6a')]=db['sequelize'][_0x4935('0x12')]('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0x4935('0x12')](_0x4935('0x6b'));db['CmHopper']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/cmHopper/cmHopper.model');db[_0x4935('0x6c')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x6d'));db[_0x4935('0x6e')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x4935('0x6f')]=db['sequelize']['import'](_0x4935('0x70'));db[_0x4935('0x71')]=db['sequelize']['import'](_0x4935('0x72'));db[_0x4935('0x73')]=db[_0x4935('0x0')]['import'](_0x4935('0x74'));db['Action']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x75'));db[_0x4935('0x76')]=db[_0x4935('0x0')]['import'](_0x4935('0x77'));db[_0x4935('0x78')]=db['sequelize'][_0x4935('0x12')](_0x4935('0x79'));db[_0x4935('0x7a')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x7b'));db[_0x4935('0x7c')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x7d'));db[_0x4935('0x7e')]=db['sequelize'][_0x4935('0x12')](_0x4935('0x7f'));db[_0x4935('0x80')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x81'));db[_0x4935('0x82')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x83'));db[_0x4935('0x84')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/schedule/schedule.model');db[_0x4935('0x85')]=db[_0x4935('0x0')]['import']('../api/sound/sound.model');db[_0x4935('0x86')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x87'));db[_0x4935('0x88')]=db['sequelize'][_0x4935('0x12')](_0x4935('0x89'));db[_0x4935('0x8a')]=db[_0x4935('0x0')]['import'](_0x4935('0x8b'));db['Variable']=db['sequelize'][_0x4935('0x12')](_0x4935('0x8c'));db['Integration']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x8d'));db['IntegrationReport']=db[_0x4935('0x0')]['import']('../api/integrationReport/integrationReport.model');db[_0x4935('0x8e')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x8f'));db[_0x4935('0x90')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x91'));db['AnalyticExtractedReport']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x92'));db['AnalyticMetric']=db['sequelize'][_0x4935('0x12')](_0x4935('0x93'));db['AnalyticFieldReport']=db[_0x4935('0x0')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0x4935('0x94')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x4935('0x0')]['import'](_0x4935('0x95'));db['SalesforceConfiguration']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x96'));db[_0x4935('0x97')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x98'));db['SugarcrmAccount']=db[_0x4935('0x0')]['import'](_0x4935('0x99'));db[_0x4935('0x9a')]=db['sequelize'][_0x4935('0x12')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x4935('0x9b')]=db[_0x4935('0x0')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x4935('0x0')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x4935('0x9c')]=db['sequelize'][_0x4935('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize'][_0x4935('0x12')]('../api/intDeskField/intDeskField.model');db[_0x4935('0x9d')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x9e'));db[_0x4935('0x9f')]=db['sequelize'][_0x4935('0x12')](_0x4935('0xa0'));db['ZohoField']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/intZohoField/intZohoField.model');db[_0x4935('0xa1')]=db[_0x4935('0x0')]['import'](_0x4935('0xa2'));db['ZendeskConfiguration']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4935('0xa3')]=db[_0x4935('0x0')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x4935('0xa4')]=db[_0x4935('0x0')]['import'](_0x4935('0xa5'));db[_0x4935('0xa6')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4935('0xa7')]=db[_0x4935('0x0')]['import'](_0x4935('0xa8'));db[_0x4935('0xa9')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xaa'));db[_0x4935('0xab')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xac'));db[_0x4935('0xad')]=db[_0x4935('0x0')]['import'](_0x4935('0xae'));db[_0x4935('0xaf')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xb0'));db['ServicenowConfiguration']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4935('0xb1')]=db[_0x4935('0x0')]['import'](_0x4935('0xb2'));db[_0x4935('0xb3')]=db[_0x4935('0x0')]['import'](_0x4935('0xb4'));db[_0x4935('0xb5')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xb6'));db['Dynamics365Field']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xb7'));db[_0x4935('0xb8')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x4935('0xb9')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xba'));db[_0x4935('0xbb')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x4935('0xbc')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0x8d'));db[_0x4935('0xbd')]=db['sequelize']['import'](_0x4935('0xbe'));db[_0x4935('0xbf')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xc0'));db['ChatInternalMessage']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xc1'));db['JscriptyAnswerReport']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xc2'));db[_0x4935('0xc3')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xc4'));db['JscriptySessionReport']=db[_0x4935('0x0')]['import'](_0x4935('0xc5'));db['SmsQueueReport']=db['sequelize'][_0x4935('0x12')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/squareReport/squareReport.model');db[_0x4935('0xc6')]=db['sequelize'][_0x4935('0x12')](_0x4935('0xc7'));db[_0x4935('0xc8')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xc9'));db['Setting']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xca'));db['SquareOdbc']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xcb'));db['SquareProject']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xcc'));db[_0x4935('0xcd')]=db[_0x4935('0x0')]['import'](_0x4935('0xce'));db['SquareMessage']=db[_0x4935('0x0')]['import'](_0x4935('0xcf'));db['Team']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xd0'));db['License']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xd1'));db[_0x4935('0xd2')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xd3'));db[_0x4935('0xd4')]=db[_0x4935('0x0')]['import'](_0x4935('0xd5'));db[_0x4935('0xd6')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xd7'));db[_0x4935('0xd8')]=db[_0x4935('0x0')]['import']('../api/plugin/plugin.model');db[_0x4935('0xd9')]=db['sequelize']['import'](_0x4935('0xda'));db[_0x4935('0xdb')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0x4935('0xdc')]=db[_0x4935('0x0')]['import']('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db['sequelize']['import'](_0x4935('0xdd'));db[_0x4935('0xde')]=db['sequelize']['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x4935('0xdf')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/cmList/cmList.model');db['VoicePrefix']=db['sequelize'][_0x4935('0x12')](_0x4935('0xe0'));db[_0x4935('0xe1')]=db[_0x4935('0x0')]['import'](_0x4935('0xe2'));db[_0x4935('0xe3')]=db[_0x4935('0x0')]['import']('../api/userProfileSection/userProfileSection.model');db[_0x4935('0xe4')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xe5'));db[_0x4935('0xe6')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xe7'));db[_0x4935('0xe8')]=db['sequelize'][_0x4935('0x12')](_0x4935('0xe9'));db['WhatsappApplication']=db['sequelize'][_0x4935('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0x4935('0xea')]=db[_0x4935('0x0')]['import'](_0x4935('0xeb'));db['WhatsappMessage']=db[_0x4935('0x0')][_0x4935('0x12')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xec'));db[_0x4935('0xed')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xee'));db[_0x4935('0xef')]=db['sequelize']['import'](_0x4935('0xf0'));db[_0x4935('0xf1')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xf2'));db[_0x4935('0xf3')]=db[_0x4935('0x0')][_0x4935('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x4935('0xf4')]=db['sequelize'][_0x4935('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x4935('0xf5')]=db[_0x4935('0x0')][_0x4935('0x12')](_0x4935('0xf6'));db[_0x4935('0x11')]['hasOne'](db[_0x4935('0x20')],{'as':_0x4935('0x20'),'onDelete':_0x4935('0xf7'),'foreignKey':'UserId'});db['User'][_0x4935('0xf8')](db['VoiceRecording'],{'as':_0x4935('0xf9'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0xfb')],{'as':'VoiceQueuesRt','foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x17')],{'as':_0x4935('0xfc'),'onDelete':'cascade','hooks':!![]});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x6e')],{'as':_0x4935('0xfd'),'foreignKey':'UserId'});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0x4935('0xfe'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x71')],{'as':_0x4935('0x71'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x5a')],{'as':'OpenchannelInteractions','foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0xff')],{'as':_0x4935('0x100'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x52')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x47')],{'as':_0x4935('0x101'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0x3d')],{'as':'MailInteractions','foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')]['hasMany'](db[_0x4935('0xea')],{'as':'WhatsappInteractions','foreignKey':_0x4935('0xfa')});db[_0x4935('0x11')][_0x4935('0xf8')](db[_0x4935('0xe6')],{'as':_0x4935('0x102'),'foreignKey':_0x4935('0x103')});db[_0x4935('0x11')][_0x4935('0x104')](db[_0x4935('0xe1')],{'as':_0x4935('0xe1'),'foreignKey':'userProfileId'});db[_0x4935('0x11')]['belongsToMany'](db[_0x4935('0x105')],{'as':_0x4935('0x106'),'through':_0x4935('0x107')});db[_0x4935('0x11')][_0x4935('0x108')](db['CmContact'],{'as':_0x4935('0x109'),'through':_0x4935('0x10a')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0xdf')],{'as':_0x4935('0x10b'),'through':_0x4935('0x10c')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0x10d')],{'through':_0x4935('0x10e')});db[_0x4935('0x11')]['belongsToMany'](db[_0x4935('0x3d')],{'as':_0x4935('0x10f'),'through':_0x4935('0x110')});db['User'][_0x4935('0x108')](db['ChatInteraction'],{'as':_0x4935('0x100'),'through':_0x4935('0x111')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0x47')],{'as':'FaxInteractions','through':_0x4935('0x112')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0x52')],{'as':'SmsInteractions','through':_0x4935('0x113')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0x5a')],{'as':_0x4935('0x114'),'through':_0x4935('0x115')});db[_0x4935('0x11')][_0x4935('0x108')](db['WhatsappInteraction'],{'as':_0x4935('0x116'),'through':_0x4935('0x117')});db[_0x4935('0x11')]['belongsToMany'](db[_0x4935('0x1b')],{'as':_0x4935('0x118'),'through':'UserVoiceQueue','required':![]});db['User'][_0x4935('0x108')](db[_0x4935('0x119')],{'as':_0x4935('0x11a'),'through':'UserVoicePrefix','required':![]});db['User']['belongsToMany'](db[_0x4935('0x11b')],{'as':_0x4935('0x11c'),'through':_0x4935('0x31'),'required':![]});db[_0x4935('0x11')][_0x4935('0x108')](db['ChatQueue'],{'as':_0x4935('0x11d'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x4935('0x4b')],{'as':_0x4935('0x11e'),'through':_0x4935('0x11f'),'required':![]});db['User'][_0x4935('0x108')](db[_0x4935('0x56')],{'as':_0x4935('0x120'),'through':'UserSmsQueue','required':![]});db[_0x4935('0x11')][_0x4935('0x108')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x4935('0x34'),'required':![]});db['User'][_0x4935('0x108')](db[_0x4935('0xef')],{'as':'WhatsappQueues','through':_0x4935('0x36'),'required':![]});db['User']['belongsToMany'](db[_0x4935('0xdf')],{'through':_0x4935('0x10c')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0x5e')],{'as':_0x4935('0x121'),'through':_0x4935('0x122')});db['User'][_0x4935('0x108')](db['FaxAccount'],{'as':_0x4935('0x123'),'through':_0x4935('0x124')});db[_0x4935('0x11')][_0x4935('0x108')](db[_0x4935('0x3a')],{'as':_0x4935('0x125'),'through':'user_has_mail_accounts'});db['User'][_0x4935('0x108')](db[_0x4935('0x126')],{'as':_0x4935('0x127'),'through':_0x4935('0x128')});db[_0x4935('0x11')][_0x4935('0x108')](db['SmsAccount'],{'as':_0x4935('0x129'),'through':_0x4935('0x12a')});db[_0x4935('0x11')]['belongsToMany'](db['WhatsappAccount'],{'as':_0x4935('0x12b'),'through':_0x4935('0x12c')});db[_0x4935('0x11')][_0x4935('0x108')](db['SquareProject'],{'as':_0x4935('0x12d'),'through':_0x4935('0x12e')});db[_0x4935('0x13')]['hasMany'](db['VoiceExtension'],{'as':_0x4935('0x12f'),'onDelete':_0x4935('0xf7'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0x4935('0xf8')](db[_0x4935('0x17')],{'onDelete':_0x4935('0xf7')});db[_0x4935('0x17')][_0x4935('0xf8')](db[_0x4935('0x17')],{'as':'Applications','onDelete':_0x4935('0xf7')});db[_0x4935('0x19')][_0x4935('0x108')](db[_0x4935('0x85')],{'as':_0x4935('0x130'),'through':_0x4935('0x131')});db['VoiceQueue'][_0x4935('0xf8')](db[_0x4935('0xfb')],{'as':'Members','foreignKey':_0x4935('0x132')});db[_0x4935('0x1b')][_0x4935('0xf8')](db['CmHopper'],{'as':_0x4935('0x133'),'foreignKey':'VoiceQueueId'});db[_0x4935('0x1b')]['hasMany'](db[_0x4935('0x6e')],{'as':'HopperFinals','foreignKey':_0x4935('0x132')});db[_0x4935('0x1b')][_0x4935('0xf8')](db[_0x4935('0x6f')],{'as':'HopperHistories','foreignKey':_0x4935('0x132')});db[_0x4935('0x1b')][_0x4935('0xf8')](db[_0x4935('0x71')],{'as':_0x4935('0x71'),'foreignKey':_0x4935('0x132')});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x4935('0x1b')][_0x4935('0xf8')](db['JscriptySessionReport'],{'as':_0x4935('0x134'),'foreignKey':'VoiceQueueId'});db[_0x4935('0x1b')][_0x4935('0x104')](db['Trunk'],{'as':'Trunk','foreignKey':_0x4935('0x135')});db[_0x4935('0x1b')]['belongsTo'](db['Trunk'],{'as':_0x4935('0x136'),'foreignKey':'TrunkBackupId'});db[_0x4935('0x1b')]['belongsTo'](db[_0x4935('0x7e')],{'as':_0x4935('0x7e'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x1b')][_0x4935('0x104')](db[_0x4935('0x80')],{'as':_0x4935('0x138'),'foreignKey':_0x4935('0x139')});db['VoiceQueue']['belongsToMany'](db[_0x4935('0xdf')],{'as':_0x4935('0x10b'),'through':_0x4935('0x13a')});db['VoiceQueue']['belongsToMany'](db[_0x4935('0x11')],{'as':'Agents','through':_0x4935('0x2e')});db[_0x4935('0x1b')][_0x4935('0x108')](db['Team'],{'as':_0x4935('0x13b'),'through':_0x4935('0xf3')});db[_0x4935('0x1b')][_0x4935('0x108')](db[_0x4935('0xdf')],{'as':_0x4935('0x13c'),'through':_0x4935('0x13d')});db[_0x4935('0x1d')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x11'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x1e')][_0x4935('0x104')](db['User'],{'as':_0x4935('0x11'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x20')][_0x4935('0xf8')](db[_0x4935('0x22')],{'as':_0x4935('0x13e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x13f'),'sourceKey':_0x4935('0x140')});db[_0x4935('0x22')][_0x4935('0x104')](db[_0x4935('0x20')],{'foreignKey':_0x4935('0x13f'),'targetKey':_0x4935('0x140')});db['VoiceCallReport'][_0x4935('0xf8')](db[_0x4935('0x141')],{'as':_0x4935('0x142'),'foreignKey':_0x4935('0x143'),'constraints':![]});db[_0x4935('0x24')][_0x4935('0xf8')](db[_0x4935('0x28')],{'as':_0x4935('0x144'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x4935('0x11')],{'as':_0x4935('0x11'),'foreignKey':_0x4935('0xfa')});db['VoiceCallReport'][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x148')][_0x4935('0x104')](db[_0x4935('0x3a')],{'as':'MailAccount','foreignKey':_0x4935('0x149')});db[_0x4935('0x14a')][_0x4935('0x104')](db[_0x4935('0x3a')],{'as':'MailAccount','foreignKey':_0x4935('0x149')});db['MailAccount'][_0x4935('0x14b')](db['MailServerIn'],{'as':_0x4935('0x14c'),'onDelete':_0x4935('0xf7')});db['MailAccount'][_0x4935('0x14b')](db[_0x4935('0x14a')],{'as':_0x4935('0x14d'),'onDelete':_0x4935('0xf7')});db['MailAccount'][_0x4935('0xf8')](db[_0x4935('0x7a')],{'as':_0x4935('0x14e'),'foreignKey':_0x4935('0x149'),'onDelete':'cascade'});db[_0x4935('0x3a')][_0x4935('0xf8')](db[_0x4935('0x78')],{'as':_0x4935('0x14f'),'foreignKey':_0x4935('0x149')});db[_0x4935('0x3a')][_0x4935('0xf8')](db['MailMessage'],{'as':_0x4935('0x13e'),'foreignKey':_0x4935('0x149')});db['MailAccount'][_0x4935('0xf8')](db[_0x4935('0x3d')],{'as':'Interactions'});db[_0x4935('0x3a')][_0x4935('0xf8')](db[_0x4935('0x40')],{'as':'Applications'});db[_0x4935('0x3a')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':'List','foreignKey':_0x4935('0x150')});db[_0x4935('0x3a')][_0x4935('0x104')](db[_0x4935('0x88')],{'as':_0x4935('0x88'),'foreignKey':_0x4935('0x151')});db[_0x4935('0x3a')][_0x4935('0x104')](db[_0x4935('0x80')],{'as':_0x4935('0x138'),'foreignKey':_0x4935('0x139')});db['MailAccount'][_0x4935('0x108')](db['User'],{'as':_0x4935('0x152'),'through':_0x4935('0x153')});db[_0x4935('0x11b')][_0x4935('0x108')](db[_0x4935('0x11')],{'as':'Agents','through':_0x4935('0x31')});db['MailQueue'][_0x4935('0x108')](db[_0x4935('0x10d')],{'through':_0x4935('0x154'),'as':_0x4935('0x13b')});db[_0x4935('0x3d')][_0x4935('0xf8')](db['MailMessage'],{'as':_0x4935('0x13e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x155')});db[_0x4935('0x3d')]['belongsTo'](db[_0x4935('0x3a')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x4935('0x3d')]['belongsTo'](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x3d')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':'Owner','foreignKey':'UserId'});db[_0x4935('0x3d')][_0x4935('0x108')](db['Tag'],{'through':_0x4935('0x156'),'as':_0x4935('0x157')});db['MailInteraction']['belongsToMany'](db[_0x4935('0x86')],{'through':_0x4935('0x156'),'as':_0x4935('0x158')});db[_0x4935('0x3d')]['belongsToMany'](db[_0x4935('0x11')],{'as':_0x4935('0x159'),'through':_0x4935('0x110'),'foreignKey':_0x4935('0x155')});db[_0x4935('0x15a')][_0x4935('0xf8')](db[_0x4935('0xd6')],{'as':_0x4935('0x15b'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x15a')]['belongsTo'](db[_0x4935('0x11')],{'as':_0x4935('0x11')});db['MailMessage']['belongsTo'](db[_0x4935('0x145')],{'onDelete':'cascade','as':_0x4935('0x146')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0x4935('0x15c'),'foreignKey':_0x4935('0x155')});db[_0x4935('0x15a')][_0x4935('0x104')](db['MailAccount'],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x149')});db['MailMessage'][_0x4935('0x104')](db[_0x4935('0x5e')],{'as':_0x4935('0x5e'),'foreignKey':'ChatWebsiteId'});db[_0x4935('0x15a')][_0x4935('0x104')](db[_0x4935('0x15e')],{'as':_0x4935('0x15e'),'foreignKey':_0x4935('0x15f')});db[_0x4935('0x40')][_0x4935('0x104')](db[_0x4935('0x11')],{'onDelete':_0x4935('0x160')});db[_0x4935('0x40')][_0x4935('0x104')](db[_0x4935('0x11b')],{'onDelete':'restrict'});db['MailApplication'][_0x4935('0x104')](db['MailAccount'],{'onDelete':'restrict'});db[_0x4935('0x40')][_0x4935('0x104')](db[_0x4935('0x7e')],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x40')][_0x4935('0x104')](db['Tag'],{'onDelete':_0x4935('0x160'),'foreignKey':'TagId'});db[_0x4935('0x42')]['belongsTo'](db[_0x4935('0x3a')],{});db[_0x4935('0x42')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db[_0x4935('0x42')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x42')][_0x4935('0x104')](db[_0x4935('0x3d')],{});db[_0x4935('0x42')][_0x4935('0x104')](db[_0x4935('0x15a')],{});db['MailQueueReport'][_0x4935('0x104')](db[_0x4935('0x11')],{});db[_0x4935('0x42')]['belongsTo'](db[_0x4935('0x11b')],{});db[_0x4935('0x43')][_0x4935('0xf8')](db[_0x4935('0x45')],{'as':_0x4935('0x162'),'onDelete':_0x4935('0xf7')});db['FaxAccount'][_0x4935('0xf8')](db[_0x4935('0x7a')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x4935('0xf7')});db[_0x4935('0x163')]['hasMany'](db[_0x4935('0x78')],{'as':_0x4935('0x14f'),'foreignKey':_0x4935('0x164')});db['FaxAccount'][_0x4935('0xf8')](db[_0x4935('0x47')],{'as':_0x4935('0x165')});db[_0x4935('0x163')][_0x4935('0xf8')](db['FaxApplication'],{'as':_0x4935('0x166')});db[_0x4935('0x163')]['hasMany'](db[_0x4935('0x17')],{'as':'Exntensions','onDelete':_0x4935('0xf7')});db[_0x4935('0x163')][_0x4935('0xf8')](db[_0x4935('0x49')],{'as':_0x4935('0x13e')});db[_0x4935('0x163')][_0x4935('0x104')](db[_0x4935('0x2b')],{'as':_0x4935('0x2b')});db['FaxAccount'][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db[_0x4935('0x163')][_0x4935('0x104')](db[_0x4935('0x80')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x4935('0x163')]['belongsToMany'](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':_0x4935('0x124')});db[_0x4935('0x46')][_0x4935('0x104')](db[_0x4935('0x11')],{'onDelete':_0x4935('0x160')});db['FaxApplication'][_0x4935('0x104')](db[_0x4935('0x4b')],{'onDelete':_0x4935('0x160')});db['FaxApplication']['belongsTo'](db[_0x4935('0x163')],{'onDelete':_0x4935('0x160')});db[_0x4935('0x46')]['belongsTo'](db[_0x4935('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4935('0x47')]['hasMany'](db[_0x4935('0x49')],{'as':_0x4935('0x13e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x167')});db[_0x4935('0x47')][_0x4935('0x104')](db[_0x4935('0x163')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x4935('0x104')](db['CmContact'],{'as':'Contact','foreignKey':_0x4935('0x147')});db[_0x4935('0x47')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x168'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0x47')]['belongsToMany'](db[_0x4935('0x86')],{'through':'fax_interaction_has_tags','as':_0x4935('0x157')});db[_0x4935('0x47')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':'fax_interaction_has_tags','as':_0x4935('0x158')});db[_0x4935('0x47')]['belongsToMany'](db[_0x4935('0x11')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0x4935('0x167')});db[_0x4935('0x49')][_0x4935('0x104')](db['User'],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x11')});db[_0x4935('0x49')][_0x4935('0x104')](db[_0x4935('0x47')],{'as':_0x4935('0x15c'),'foreignKey':_0x4935('0x167')});db[_0x4935('0x49')]['belongsTo'](db[_0x4935('0x145')],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x146')});db[_0x4935('0x49')][_0x4935('0x104')](db[_0x4935('0xd6')],{'as':_0x4935('0xd6'),'foreignKey':_0x4935('0x169')});db[_0x4935('0x49')]['belongsTo'](db[_0x4935('0x163')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x164')});db['FaxQueue'][_0x4935('0x108')](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':'UserFaxQueue'});db['FaxQueue'][_0x4935('0x108')](db[_0x4935('0x10d')],{'through':_0x4935('0x16a'),'as':_0x4935('0x13b')});db[_0x4935('0x4d')][_0x4935('0x104')](db[_0x4935('0x163')],{});db[_0x4935('0x4d')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db[_0x4935('0x4d')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db['FaxQueueReport'][_0x4935('0x104')](db[_0x4935('0x47')],{});db[_0x4935('0x4d')][_0x4935('0x104')](db[_0x4935('0x49')],{});db[_0x4935('0x4d')]['belongsTo'](db[_0x4935('0x11')],{});db[_0x4935('0x4d')][_0x4935('0x104')](db['FaxQueue'],{});db['SmsAccount'][_0x4935('0xf8')](db['Disposition'],{'as':_0x4935('0x14e'),'foreignKey':_0x4935('0x16b'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x4f')][_0x4935('0xf8')](db[_0x4935('0x78')],{'as':_0x4935('0x14f'),'foreignKey':'SmsAccountId'});db[_0x4935('0x4f')]['hasMany'](db[_0x4935('0x54')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount'][_0x4935('0xf8')](db['SmsInteraction'],{'as':_0x4935('0x165')});db[_0x4935('0x4f')]['hasMany'](db[_0x4935('0x16c')],{'as':'Applications'});db[_0x4935('0x4f')]['belongsTo'](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db['SmsAccount'][_0x4935('0x104')](db[_0x4935('0x80')],{'as':_0x4935('0x138'),'foreignKey':_0x4935('0x139')});db[_0x4935('0x4f')][_0x4935('0x108')](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':'user_has_sms_accounts'});db[_0x4935('0x16c')][_0x4935('0x104')](db['User'],{'onDelete':'restrict'});db[_0x4935('0x16c')][_0x4935('0x104')](db[_0x4935('0x56')],{'onDelete':_0x4935('0x160')});db[_0x4935('0x16c')][_0x4935('0x104')](db[_0x4935('0x4f')],{'onDelete':'restrict'});db[_0x4935('0x16c')]['belongsTo'](db[_0x4935('0x7e')],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x16c')][_0x4935('0x104')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4935('0x16d')});db[_0x4935('0x52')][_0x4935('0xf8')](db[_0x4935('0x54')],{'as':_0x4935('0x13e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x16e')});db[_0x4935('0x52')][_0x4935('0x104')](db[_0x4935('0x4f')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x16b')});db[_0x4935('0x52')]['belongsTo'](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db['SmsInteraction'][_0x4935('0x104')](db[_0x4935('0x11')],{'as':'Owner','foreignKey':_0x4935('0xfa')});db[_0x4935('0x52')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':_0x4935('0x16f'),'as':'Tags'});db[_0x4935('0x52')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':_0x4935('0x16f'),'as':'ThroughTags'});db[_0x4935('0x52')]['belongsToMany'](db['User'],{'as':_0x4935('0x159'),'through':_0x4935('0x113'),'foreignKey':'SmsInteractionId'});db[_0x4935('0x54')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x11')});db[_0x4935('0x54')][_0x4935('0x104')](db[_0x4935('0x145')],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x146')});db[_0x4935('0x54')]['belongsTo'](db[_0x4935('0x52')],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x15c'),'foreignKey':_0x4935('0x16e')});db[_0x4935('0x54')][_0x4935('0x104')](db[_0x4935('0x4f')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x16b')});db[_0x4935('0x56')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x4935('0x170'),'foreignKey':_0x4935('0x171')});db[_0x4935('0x56')][_0x4935('0x108')](db[_0x4935('0x10d')],{'through':_0x4935('0x172'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x4935('0x7a')],{'as':_0x4935('0x14e'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x4935('0x126')][_0x4935('0xf8')](db['CannedAnswer'],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x4935('0x126')][_0x4935('0xf8')](db['OpenchannelInteraction'],{'as':_0x4935('0x165'),'foreignKey':_0x4935('0x173')});db['OpenchannelAccount'][_0x4935('0xf8')](db[_0x4935('0x174')],{'as':_0x4935('0x13e'),'foreignKey':'OpenchannelAccountId'});db[_0x4935('0x126')][_0x4935('0xf8')](db[_0x4935('0x58')],{'as':'Applications','foreignKey':_0x4935('0x173')});db[_0x4935('0x126')][_0x4935('0x104')](db['CmList'],{'as':_0x4935('0x161'),'foreignKey':'ListId'});db[_0x4935('0x126')][_0x4935('0x104')](db[_0x4935('0x80')],{'as':_0x4935('0x138'),'foreignKey':_0x4935('0x139')});db[_0x4935('0x126')]['belongsToMany'](db['User'],{'as':_0x4935('0x152'),'through':_0x4935('0x128')});db['OpenchannelApplication'][_0x4935('0x104')](db[_0x4935('0x11')],{'onDelete':_0x4935('0x160')});db[_0x4935('0x58')][_0x4935('0x104')](db[_0x4935('0x5c')],{'onDelete':'restrict','foreignKey':_0x4935('0x175')});db[_0x4935('0x58')][_0x4935('0x104')](db[_0x4935('0x126')],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x173')});db[_0x4935('0x58')][_0x4935('0x104')](db[_0x4935('0x7e')],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x58')][_0x4935('0x104')](db['Tag'],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x16d')});db['OpenchannelInteraction'][_0x4935('0xf8')](db[_0x4935('0x174')],{'as':_0x4935('0x13e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x176')});db['OpenchannelInteraction'][_0x4935('0x104')](db[_0x4935('0x126')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x173')});db[_0x4935('0x5a')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':'ContactId'});db[_0x4935('0x5a')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x168'),'foreignKey':'UserId'});db[_0x4935('0x5a')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db['OpenchannelInteraction']['belongsToMany'](db[_0x4935('0x86')],{'through':_0x4935('0x177'),'as':_0x4935('0x158')});db[_0x4935('0x5a')]['belongsToMany'](db['User'],{'as':_0x4935('0x159'),'through':_0x4935('0x115'),'foreignKey':_0x4935('0x176')});db[_0x4935('0x174')][_0x4935('0x104')](db['User'],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x11')});db[_0x4935('0x174')][_0x4935('0x104')](db['CmContact'],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x146')});db[_0x4935('0x174')][_0x4935('0x104')](db['OpenchannelInteraction'],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x15c'),'foreignKey':'OpenchannelInteractionId'});db[_0x4935('0x174')][_0x4935('0x104')](db[_0x4935('0xd6')],{'as':'Attachment','foreignKey':_0x4935('0x169')});db[_0x4935('0x174')][_0x4935('0x104')](db[_0x4935('0x126')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x173')});db[_0x4935('0x5c')]['belongsToMany'](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':_0x4935('0x34'),'foreignKey':_0x4935('0x175')});db['OpenchannelQueue'][_0x4935('0x108')](db[_0x4935('0x10d')],{'through':_0x4935('0x178'),'as':_0x4935('0x13b')});db[_0x4935('0x5e')][_0x4935('0xf8')](db['Disposition'],{'as':_0x4935('0x14e'),'foreignKey':_0x4935('0x179'),'onDelete':_0x4935('0xf7')});db['ChatWebsite'][_0x4935('0xf8')](db[_0x4935('0x78')],{'as':_0x4935('0x14f'),'foreignKey':_0x4935('0x179')});db[_0x4935('0x5e')]['hasMany'](db[_0x4935('0x17a')],{'as':'ProactiveActions'});db[_0x4935('0x5e')]['hasMany'](db[_0x4935('0xff')],{'as':'Interactions'});db[_0x4935('0x5e')][_0x4935('0xf8')](db['ChatApplication'],{'as':_0x4935('0x166')});db['ChatWebsite'][_0x4935('0xf8')](db['ChatMessage'],{'as':_0x4935('0x13e')});db[_0x4935('0x5e')]['belongsTo'](db['CmList'],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db[_0x4935('0x5e')][_0x4935('0x104')](db['Interval'],{'as':_0x4935('0x7e'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x5e')][_0x4935('0x104')](db[_0x4935('0x3a')],{'as':_0x4935('0x3a'),'foreignKey':_0x4935('0x149')});db['ChatWebsite'][_0x4935('0x104')](db[_0x4935('0x80')],{'as':_0x4935('0x138'),'foreignKey':_0x4935('0x139')});db[_0x4935('0x5e')][_0x4935('0x108')](db['User'],{'as':_0x4935('0x152'),'through':'user_has_chat_websites'});db[_0x4935('0x60')][_0x4935('0x104')](db[_0x4935('0x126')],{});db[_0x4935('0x60')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db[_0x4935('0x60')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x60')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x4935('0x60')][_0x4935('0x104')](db[_0x4935('0x174')],{});db[_0x4935('0x60')][_0x4935('0x104')](db['User'],{});db[_0x4935('0x60')][_0x4935('0x104')](db['OpenchannelQueue'],{});db[_0x4935('0x62')][_0x4935('0x104')](db['User'],{'as':_0x4935('0x17b'),'foreignKey':_0x4935('0xfa'),'onDelete':_0x4935('0x160')});db['ChatApplication']['belongsTo'](db[_0x4935('0x67')],{'as':_0x4935('0x17c'),'foreignKey':_0x4935('0x17d'),'onDelete':_0x4935('0x160')});db['ChatApplication']['belongsTo'](db[_0x4935('0x5e')],{'as':'Website','foreignKey':_0x4935('0x179'),'onDelete':_0x4935('0x160')});db['ChatApplication'][_0x4935('0x104')](db[_0x4935('0x86')],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x16d')});db[_0x4935('0xff')]['hasMany'](db[_0x4935('0x65')],{'as':_0x4935('0x13e'),'onDelete':'cascade','foreignKey':_0x4935('0x17e')});db[_0x4935('0xff')][_0x4935('0x104')](db[_0x4935('0x5e')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x179')});db[_0x4935('0xff')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0xff')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x168'),'foreignKey':'UserId'});db[_0x4935('0xff')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':'chat_interaction_has_tags','as':_0x4935('0x157')});db[_0x4935('0xff')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':'chat_interaction_has_tags','as':_0x4935('0x158')});db['ChatInteraction'][_0x4935('0x108')](db[_0x4935('0x11')],{'as':'Users','through':_0x4935('0x111'),'foreignKey':_0x4935('0x17e')});db['ChatMessage'][_0x4935('0x104')](db['User'],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x11')});db[_0x4935('0x65')][_0x4935('0x104')](db[_0x4935('0x145')],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x65')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x15c'),'foreignKey':_0x4935('0x17e')});db[_0x4935('0x65')][_0x4935('0x104')](db[_0x4935('0xd6')],{'as':_0x4935('0xd6'),'foreignKey':_0x4935('0x169')});db['ChatMessage']['belongsTo'](db[_0x4935('0x5e')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x179')});db[_0x4935('0x15e')][_0x4935('0xf8')](db['Attachment'],{'as':_0x4935('0x15b'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x4935('0xf7'),'hooks':!![]});db[_0x4935('0x15e')][_0x4935('0x104')](db[_0x4935('0x145')],{'onDelete':_0x4935('0xf7'),'as':_0x4935('0x146'),'foreignKey':'ContactId'});db[_0x4935('0x15e')]['belongsTo'](db['ChatWebsite'],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x179')});db[_0x4935('0x67')][_0x4935('0x108')](db['User'],{'as':_0x4935('0x152'),'through':'UserChatQueue','hooks':!![]});db[_0x4935('0x67')][_0x4935('0x108')](db['Team'],{'through':_0x4935('0x17f'),'as':_0x4935('0x13b')});db[_0x4935('0x105')][_0x4935('0xf8')](db[_0x4935('0x180')],{'as':_0x4935('0x13e'),'foreignKey':_0x4935('0x181'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x105')][_0x4935('0x108')](db['User'],{'as':'Members','through':_0x4935('0x107')});db['ChatProactiveAction'][_0x4935('0x104')](db[_0x4935('0x5e')],{'as':'Website','foreignKey':_0x4935('0x179')});db[_0x4935('0x6a')]['hasMany'](db[_0x4935('0x145')],{'as':_0x4935('0x109'),'foreignKey':_0x4935('0x182')});db[_0x4935('0x145')][_0x4935('0xf8')](db[_0x4935('0x183')],{'as':_0x4935('0x133'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x145')][_0x4935('0xf8')](db[_0x4935('0x6e')],{'as':_0x4935('0xfd'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x145')][_0x4935('0xf8')](db[_0x4935('0x6f')],{'as':_0x4935('0x184'),'foreignKey':'ContactId'});db[_0x4935('0x145')][_0x4935('0xf8')](db[_0x4935('0x71')],{'as':_0x4935('0x71'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x145')][_0x4935('0xf8')](db['JscriptySessionReport'],{'as':_0x4935('0x134'),'foreignKey':_0x4935('0x147')});db['CmContact'][_0x4935('0xf8')](db[_0x4935('0x5a')],{'as':'OpenchannelInteractions','foreignKey':_0x4935('0x147'),'onDelete':'restrict'});db[_0x4935('0x145')][_0x4935('0xf8')](db[_0x4935('0xff')],{'as':_0x4935('0x100'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x4935('0x145')]['hasMany'](db[_0x4935('0x52')],{'as':_0x4935('0x185'),'foreignKey':'ContactId','onDelete':_0x4935('0x160')});db[_0x4935('0x145')]['hasMany'](db[_0x4935('0x47')],{'as':'FaxInteractions','foreignKey':_0x4935('0x147'),'onDelete':_0x4935('0x160')});db[_0x4935('0x145')][_0x4935('0xf8')](db[_0x4935('0x3d')],{'as':_0x4935('0x10f'),'foreignKey':_0x4935('0x147'),'onDelete':_0x4935('0x160')});db[_0x4935('0x145')][_0x4935('0x104')](db[_0x4935('0x6a')],{'as':_0x4935('0x186'),'foreignKey':_0x4935('0x182')});db[_0x4935('0x145')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150'),'onDelete':'cascade'});db[_0x4935('0x145')][_0x4935('0x108')](db['User'],{'as':_0x4935('0x159'),'through':_0x4935('0x10a')});db['CmContact']['belongsToMany'](db[_0x4935('0x86')],{'as':_0x4935('0x157'),'through':'cm_contact_has_tags'});db[_0x4935('0x145')]['belongsToMany'](db[_0x4935('0x86')],{'through':_0x4935('0x187'),'as':_0x4935('0x158')});db[_0x4935('0x183')]['belongsTo'](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x183')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150'),'onDelete':'cascade'});db[_0x4935('0x183')][_0x4935('0x104')](db['User'],{'as':_0x4935('0x17b'),'foreignKey':_0x4935('0xfa')});db['CmHopper'][_0x4935('0x104')](db[_0x4935('0x1b')],{'as':_0x4935('0x17c'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x4935('0x183')]['belongsTo'](db[_0x4935('0xd2')],{'as':_0x4935('0xd2'),'foreignKey':'CampaignId','onDelete':_0x4935('0xf7')});db[_0x4935('0x183')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x168'),'foreignKey':_0x4935('0x188')});db[_0x4935('0x6c')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':'Contact','foreignKey':_0x4935('0x147'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x6c')]['belongsTo'](db[_0x4935('0xdf')],{'as':'List','foreignKey':_0x4935('0x150'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x6c')]['belongsTo'](db[_0x4935('0x1b')],{'as':_0x4935('0x17c'),'foreignKey':'VoiceQueueId','onDelete':_0x4935('0xf7')});db[_0x4935('0x6c')][_0x4935('0x104')](db['Campaign'],{'as':_0x4935('0xd2'),'foreignKey':_0x4935('0x189'),'onDelete':_0x4935('0xf7')});db['Automation'][_0x4935('0xf8')](db['Condition'],{'as':{'plural':_0x4935('0x18a'),'singular':'OneAll'},'foreignKey':_0x4935('0x18b'),'onDelete':_0x4935('0xf7'),'hooks':!![]});db[_0x4935('0x76')][_0x4935('0xf8')](db[_0x4935('0x7c')],{'as':{'plural':'Any','singular':_0x4935('0x18c')},'foreignKey':_0x4935('0x18d'),'onDelete':_0x4935('0xf7'),'hooks':!![]});db['Automation'][_0x4935('0xf8')](db[_0x4935('0x18e')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x4935('0xf7'),'hooks':!![]});db[_0x4935('0x7a')]['hasMany'](db[_0x4935('0x7a')],{'as':'Dispositions','foreignKey':_0x4935('0x18f'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x7e')][_0x4935('0xf8')](db[_0x4935('0x7e')],{'as':'Intervals','foreignKey':_0x4935('0x137'),'onDelete':_0x4935('0xf7'),'hooks':!![],'required':![]});db['Interval'][_0x4935('0xf8')](db[_0x4935('0x17')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x4935('0x160')});db[_0x4935('0x7e')]['hasMany'](db[_0x4935('0x40')],{'as':_0x4935('0x190'),'foreignKey':'IntervalId'});db[_0x4935('0x7e')][_0x4935('0xf8')](db['ChatApplication'],{'as':_0x4935('0x191'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x7e')][_0x4935('0xf8')](db[_0x4935('0x46')],{'as':_0x4935('0x192'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x7e')][_0x4935('0xf8')](db[_0x4935('0x16c')],{'as':_0x4935('0x193'),'foreignKey':_0x4935('0x137')});db[_0x4935('0x194')][_0x4935('0x104')](db[_0x4935('0x3a')],{});db[_0x4935('0x194')][_0x4935('0x104')](db[_0x4935('0x90')],{'foreignKey':_0x4935('0x195')});db[_0x4935('0x194')][_0x4935('0x104')](db[_0x4935('0x8e')],{'foreignKey':'CustomReportId'});db[_0x4935('0x85')][_0x4935('0x108')](db[_0x4935('0x19')],{'as':'Mohs','through':_0x4935('0x131'),'onDelete':_0x4935('0x160')});db[_0x4935('0x86')]['belongsToMany'](db[_0x4935('0x145')],{'through':'cm_contact_has_tags'});db[_0x4935('0x86')]['belongsToMany'](db[_0x4935('0xff')],{'through':_0x4935('0x196')});db[_0x4935('0x86')]['belongsToMany'](db[_0x4935('0x3d')],{'through':_0x4935('0x156')});db['Tag']['belongsToMany'](db[_0x4935('0x52')],{'through':'sms_interaction_has_tags'});db[_0x4935('0x86')][_0x4935('0x108')](db[_0x4935('0x47')],{'through':_0x4935('0x197')});db[_0x4935('0x86')]['belongsToMany'](db[_0x4935('0x5a')],{'through':_0x4935('0x177')});db[_0x4935('0x86')][_0x4935('0x108')](db[_0x4935('0xea')],{'through':_0x4935('0x198')});db['Trigger'][_0x4935('0xf8')](db['Condition'],{'as':{'plural':_0x4935('0x199'),'singular':'AllCondition'},'foreignKey':_0x4935('0x19a'),'onDelete':_0x4935('0xf7'),'hooks':!![]});db[_0x4935('0x8a')][_0x4935('0xf8')](db[_0x4935('0x7c')],{'as':{'plural':'AnyConditions','singular':_0x4935('0x19b')},'foreignKey':_0x4935('0x19c'),'onDelete':_0x4935('0xf7'),'hooks':!![]});db[_0x4935('0x8a')][_0x4935('0xf8')](db[_0x4935('0x18e')],{'as':_0x4935('0x19d'),'foreignKey':'TriggerId','onDelete':_0x4935('0xf7'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x4935('0x19e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x19f'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x4935('0x19e'),'onDelete':_0x4935('0xf7'),'foreignKey':'DefaultReportId'});db[_0x4935('0x1a0')][_0x4935('0xf8')](db[_0x4935('0x1a1')],{'as':_0x4935('0x19e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a2')});db[_0x4935('0x1a1')][_0x4935('0x104')](db[_0x4935('0x1a0')],{'foreignKey':_0x4935('0x1a2')});db[_0x4935('0x1a3')][_0x4935('0xf8')](db['SalesforceConfiguration'],{'as':_0x4935('0x1a4'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0x1a6')][_0x4935('0xf8')](db[_0x4935('0x97')],{'as':'Subjects','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0x1a6')][_0x4935('0xf8')](db[_0x4935('0x97')],{'as':_0x4935('0x1a8'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x1a6')][_0x4935('0xf8')](db['SalesforceField'],{'as':_0x4935('0x19e'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0x1a6')][_0x4935('0x104')](db[_0x4935('0x1a3')],{'as':'Account','foreignKey':_0x4935('0x1a5')});db[_0x4935('0x97')][_0x4935('0xf8')](db[_0x4935('0x97')],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db['SalesforceField']['hasMany'](db[_0x4935('0x97')],{'as':_0x4935('0x1ac'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x97')][_0x4935('0xf8')](db[_0x4935('0x97')],{'as':_0x4935('0x1ad'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0x97')][_0x4935('0x104')](db[_0x4935('0x1ae')],{'as':_0x4935('0x1ae'),'foreignKey':_0x4935('0x1af')});db[_0x4935('0x1b0')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x4935('0x1a4'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db['SugarcrmConfiguration'][_0x4935('0xf8')](db[_0x4935('0x9b')],{'as':_0x4935('0x1b1'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0x9a')][_0x4935('0xf8')](db['SugarcrmField'],{'as':_0x4935('0x1a8'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x9a')][_0x4935('0xf8')](db[_0x4935('0x9b')],{'as':'Fields','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0x9a')]['belongsTo'](db[_0x4935('0x1b0')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0x9b')][_0x4935('0xf8')](db[_0x4935('0x9b')],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0x9b')]['hasMany'](db['SugarcrmField'],{'as':'Description','foreignKey':_0x4935('0x1a9')});db[_0x4935('0x9b')][_0x4935('0xf8')](db[_0x4935('0x9b')],{'as':_0x4935('0x1ad'),'foreignKey':_0x4935('0x1aa')});db['SugarcrmField']['belongsTo'](db[_0x4935('0x1ae')],{'as':'Variable','foreignKey':_0x4935('0x1af')});db[_0x4935('0x1b2')]['hasMany'](db[_0x4935('0x9c')],{'as':_0x4935('0x1a4'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x4935('0x9c')]['hasMany'](db[_0x4935('0x1b3')],{'as':_0x4935('0x1b1'),'onDelete':'cascade','foreignKey':_0x4935('0x1a7')});db[_0x4935('0x9c')][_0x4935('0xf8')](db['DeskField'],{'as':_0x4935('0x1a8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4935('0x9c')][_0x4935('0xf8')](db[_0x4935('0x1b3')],{'as':_0x4935('0x19e'),'onDelete':'cascade','foreignKey':_0x4935('0x1aa')});db[_0x4935('0x9c')][_0x4935('0x104')](db[_0x4935('0x1b2')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0x9c')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':_0x4935('0x1b4')});db[_0x4935('0x1b3')][_0x4935('0xf8')](db['DeskField'],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0x1b3')][_0x4935('0xf8')](db[_0x4935('0x1b3')],{'as':_0x4935('0x1ac'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x1b3')][_0x4935('0xf8')](db['DeskField'],{'as':_0x4935('0x1ad'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0x1b3')][_0x4935('0x104')](db[_0x4935('0x1ae')],{'as':_0x4935('0x1ae'),'foreignKey':'VariableId'});db[_0x4935('0x9d')][_0x4935('0xf8')](db['ZohoConfiguration'],{'as':_0x4935('0x1a4'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0x4935('0xf8')](db[_0x4935('0x1b5')],{'as':_0x4935('0x1b1'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a7')});db['ZohoConfiguration'][_0x4935('0xf8')](db[_0x4935('0x1b5')],{'as':_0x4935('0x1a8'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a9')});db['ZohoConfiguration'][_0x4935('0xf8')](db[_0x4935('0x1b5')],{'as':_0x4935('0x19e'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x4935('0x9f')][_0x4935('0x104')](db[_0x4935('0x9d')],{'as':'Account','foreignKey':_0x4935('0x1a5')});db['ZohoField']['hasMany'](db[_0x4935('0x1b5')],{'as':'Subject','foreignKey':_0x4935('0x1a7')});db['ZohoField'][_0x4935('0xf8')](db[_0x4935('0x1b5')],{'as':_0x4935('0x1ac'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x1b5')]['hasMany'](db[_0x4935('0x1b5')],{'as':_0x4935('0x1ad'),'foreignKey':_0x4935('0x1aa')});db['ZohoField'][_0x4935('0x104')](db[_0x4935('0x1ae')],{'as':_0x4935('0x1ae'),'foreignKey':'VariableId'});db[_0x4935('0xa1')][_0x4935('0xf8')](db[_0x4935('0x1b6')],{'as':'Configurations','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db['ZendeskConfiguration']['hasMany'](db[_0x4935('0xa3')],{'as':_0x4935('0x1b1'),'foreignKey':'SubjectId'});db[_0x4935('0x1b6')][_0x4935('0xf8')](db[_0x4935('0xa3')],{'as':_0x4935('0x1a8'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x1b6')][_0x4935('0xf8')](db[_0x4935('0xa3')],{'as':_0x4935('0x19e'),'foreignKey':_0x4935('0x1aa')});db['ZendeskConfiguration'][_0x4935('0x104')](db[_0x4935('0xa1')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0x1b6')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':_0x4935('0x1b7')});db[_0x4935('0xa3')][_0x4935('0xf8')](db[_0x4935('0xa3')],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db['ZendeskField'][_0x4935('0xf8')](db['ZendeskField'],{'as':_0x4935('0x1ac'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0xa3')][_0x4935('0xf8')](db[_0x4935('0xa3')],{'as':_0x4935('0x1ad'),'foreignKey':'FieldId'});db[_0x4935('0xa3')]['belongsTo'](db[_0x4935('0x1ae')],{'as':_0x4935('0x1ae'),'foreignKey':_0x4935('0x1af')});db[_0x4935('0xa4')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x4935('0x1a4'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db['FreshdeskConfiguration']['hasMany'](db[_0x4935('0xa7')],{'as':_0x4935('0x1b1'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0xa6')][_0x4935('0xf8')](db[_0x4935('0xa7')],{'as':'Descriptions','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0xa6')][_0x4935('0xf8')](db[_0x4935('0xa7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x4935('0x1aa')});db[_0x4935('0xa6')][_0x4935('0x104')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x4935('0x1a5')});db[_0x4935('0xa6')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':_0x4935('0x1b8')});db[_0x4935('0xa7')][_0x4935('0xf8')](db[_0x4935('0xa7')],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db['FreshdeskField'][_0x4935('0xf8')](db[_0x4935('0xa7')],{'as':_0x4935('0x1ac'),'foreignKey':'DescriptionId'});db[_0x4935('0xa7')][_0x4935('0xf8')](db[_0x4935('0xa7')],{'as':'Field','foreignKey':_0x4935('0x1aa')});db['FreshdeskField'][_0x4935('0x104')](db[_0x4935('0x1ae')],{'as':_0x4935('0x1ae'),'foreignKey':'VariableId'});db[_0x4935('0xa9')][_0x4935('0xf8')](db['VtigerConfiguration'],{'as':_0x4935('0x1a4'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0xab')]['hasMany'](db['VtigerField'],{'as':_0x4935('0x1b1'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0xab')][_0x4935('0xf8')](db[_0x4935('0xad')],{'as':'Descriptions','foreignKey':_0x4935('0x1a9')});db[_0x4935('0xab')]['hasMany'](db[_0x4935('0xad')],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration'][_0x4935('0x104')](db[_0x4935('0xa9')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0xad')][_0x4935('0xf8')](db[_0x4935('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4935('0xad')][_0x4935('0xf8')](db[_0x4935('0xad')],{'as':_0x4935('0x1ac'),'foreignKey':'DescriptionId'});db[_0x4935('0xad')][_0x4935('0xf8')](db['VtigerField'],{'as':_0x4935('0x1ad'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0xad')][_0x4935('0x104')](db[_0x4935('0x1ae')],{'as':_0x4935('0x1ae'),'foreignKey':_0x4935('0x1af')});db['ServicenowAccount'][_0x4935('0xf8')](db['ServicenowConfiguration'],{'as':_0x4935('0x1a4'),'onDelete':_0x4935('0xf7'),'foreignKey':'AccountId'});db[_0x4935('0x1b9')][_0x4935('0xf8')](db[_0x4935('0xb1')],{'as':_0x4935('0x1b1'),'foreignKey':'SubjectId'});db[_0x4935('0x1b9')]['hasMany'](db['ServicenowField'],{'as':_0x4935('0x1a8'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0x1b9')][_0x4935('0xf8')](db[_0x4935('0xb1')],{'as':_0x4935('0x19e'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0x1b9')][_0x4935('0x104')](db[_0x4935('0xaf')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0xb1')][_0x4935('0xf8')](db['ServicenowField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4935('0xb1')][_0x4935('0xf8')](db['ServicenowField'],{'as':_0x4935('0x1ac'),'foreignKey':_0x4935('0x1a9')});db['ServicenowField'][_0x4935('0xf8')](db['ServicenowField'],{'as':_0x4935('0x1ad'),'foreignKey':'FieldId'});db[_0x4935('0xb1')][_0x4935('0x104')](db[_0x4935('0x1ae')],{'as':'Variable','foreignKey':_0x4935('0x1af')});db['Dynamics365Account'][_0x4935('0xf8')](db[_0x4935('0xb5')],{'as':'Configurations','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0xb5')][_0x4935('0xf8')](db[_0x4935('0x1ba')],{'as':_0x4935('0x1b1'),'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0xb5')][_0x4935('0xf8')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a9')});db[_0x4935('0xb5')][_0x4935('0xf8')](db[_0x4935('0x1ba')],{'as':'Fields','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1aa')});db['Dynamics365Configuration'][_0x4935('0x104')](db[_0x4935('0xb3')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0x1ba')][_0x4935('0xf8')](db['Dynamics365Field'],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0x1ba')][_0x4935('0xf8')](db[_0x4935('0x1ba')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4935('0x1ba')]['hasMany'](db[_0x4935('0x1ba')],{'as':'Field','foreignKey':'FieldId'});db[_0x4935('0x1ba')][_0x4935('0x104')](db['Variable'],{'as':_0x4935('0x1ae'),'foreignKey':_0x4935('0x1af')});db[_0x4935('0xb8')]['hasMany'](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1a5')});db['FreshsalesConfiguration'][_0x4935('0xf8')](db[_0x4935('0xbb')],{'as':_0x4935('0x1b1'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0xb9')]['hasMany'](db[_0x4935('0xbb')],{'as':'Descriptions','foreignKey':_0x4935('0x1a9')});db[_0x4935('0xb9')][_0x4935('0xf8')](db['FreshsalesField'],{'as':_0x4935('0x19e'),'foreignKey':_0x4935('0x1aa')});db[_0x4935('0xb9')][_0x4935('0x104')](db['FreshsalesAccount'],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1a5')});db[_0x4935('0xbb')][_0x4935('0xf8')](db[_0x4935('0xbb')],{'as':_0x4935('0x1ab'),'foreignKey':_0x4935('0x1a7')});db[_0x4935('0xbb')]['hasMany'](db['FreshsalesField'],{'as':_0x4935('0x1ac'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0x4935('0xf8')](db[_0x4935('0xbb')],{'as':'Field','foreignKey':_0x4935('0x1aa')});db[_0x4935('0xbb')][_0x4935('0x104')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x4935('0xbf')][_0x4935('0x104')](db[_0x4935('0x5e')],{});db[_0x4935('0xbf')][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':_0x4935('0x150')});db[_0x4935('0xbf')][_0x4935('0x104')](db['CmContact'],{'as':'Contact','foreignKey':_0x4935('0x147')});db[_0x4935('0xbf')][_0x4935('0x104')](db[_0x4935('0xff')],{});db['ChatQueueReport'][_0x4935('0x104')](db['ChatMessage'],{});db[_0x4935('0xbf')]['belongsTo'](db[_0x4935('0x11')],{});db[_0x4935('0xbf')][_0x4935('0x104')](db[_0x4935('0x67')],{});db[_0x4935('0x180')][_0x4935('0x104')](db['User'],{'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1bb')});db[_0x4935('0x180')]['belongsTo'](db['User'],{'onDelete':_0x4935('0xf7'),'foreignKey':_0x4935('0x1bc')});db[_0x4935('0x1bd')][_0x4935('0xf8')](db['JscriptyQuestionReport'],{'foreignKey':_0x4935('0x1be'),'onDelete':_0x4935('0xf7')});db['JscriptySessionReport'][_0x4935('0xf8')](db[_0x4935('0x1bf')],{'foreignKey':'SessionId','onDelete':'cascade'});db['SmsQueueReport'][_0x4935('0x104')](db[_0x4935('0x4f')],{});db[_0x4935('0x1c0')]['belongsTo'](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':'ListId'});db[_0x4935('0x1c0')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':'Contact','foreignKey':_0x4935('0x147')});db[_0x4935('0x1c0')][_0x4935('0x104')](db['SmsInteraction'],{});db[_0x4935('0x1c0')][_0x4935('0x104')](db['SmsMessage'],{});db[_0x4935('0x1c0')]['belongsTo'](db['User'],{});db[_0x4935('0x1c0')]['belongsTo'](db[_0x4935('0x56')],{});db[_0x4935('0xc8')][_0x4935('0xf8')](db[_0x4935('0x1bd')],{'foreignKey':_0x4935('0x1c1')});db[_0x4935('0xc8')][_0x4935('0xf8')](db[_0x4935('0xc3')],{'foreignKey':'ProjectId'});db[_0x4935('0xc8')]['hasMany'](db[_0x4935('0x1bf')],{'foreignKey':_0x4935('0x1c1')});db[_0x4935('0x1c2')][_0x4935('0x108')](db[_0x4935('0x11')],{'as':_0x4935('0x159'),'through':_0x4935('0x12e')});db['Team'][_0x4935('0x108')](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':_0x4935('0x10e')});db['Team'][_0x4935('0x108')](db[_0x4935('0x1b')],{'through':'TeamVoiceQueue','as':_0x4935('0x118')});db[_0x4935('0x10d')][_0x4935('0x108')](db[_0x4935('0x11b')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x4935('0x10d')][_0x4935('0x108')](db[_0x4935('0x67')],{'through':'team_has_chat_queues','as':_0x4935('0x11d')});db[_0x4935('0x10d')][_0x4935('0x108')](db[_0x4935('0x4b')],{'through':_0x4935('0x16a'),'as':_0x4935('0x11e')});db[_0x4935('0x10d')][_0x4935('0x108')](db['SmsQueue'],{'through':_0x4935('0x172'),'as':'SmsQueues'});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x4935('0x1c3')});db[_0x4935('0x10d')][_0x4935('0x108')](db[_0x4935('0xef')],{'through':_0x4935('0x1c4'),'as':_0x4935('0x1c5')});db[_0x4935('0x10d')][_0x4935('0x108')](db['VoicePrefix'],{'through':_0x4935('0xf4'),'as':_0x4935('0x11a')});db[_0x4935('0xd2')][_0x4935('0xf8')](db['CmHopper'],{'as':_0x4935('0x133'),'foreignKey':_0x4935('0x189')});db['Campaign'][_0x4935('0xf8')](db[_0x4935('0x6e')],{'as':_0x4935('0xfd'),'foreignKey':_0x4935('0x189')});db['Campaign'][_0x4935('0xf8')](db[_0x4935('0x6f')],{'as':_0x4935('0x184'),'foreignKey':_0x4935('0x189')});db[_0x4935('0xd2')]['hasMany'](db[_0x4935('0x6c')],{'as':'HopperBlacks','foreignKey':_0x4935('0x189')});db[_0x4935('0xd2')]['belongsTo'](db[_0x4935('0x2b')],{'as':_0x4935('0x2b'),'foreignKey':_0x4935('0x135')});db[_0x4935('0xd2')][_0x4935('0x104')](db[_0x4935('0x2b')],{'as':_0x4935('0x136'),'foreignKey':'TrunkBackupId'});db[_0x4935('0xd2')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x4935('0x137')});db['Campaign'][_0x4935('0x104')](db[_0x4935('0x1c2')],{'as':_0x4935('0x1c2'),'foreignKey':_0x4935('0x1c6')});db[_0x4935('0xd2')][_0x4935('0x108')](db['CmList'],{'as':_0x4935('0x10b'),'through':_0x4935('0x1c7')});db['Campaign'][_0x4935('0x108')](db['CmList'],{'as':'BlackLists','through':_0x4935('0x1c8')});db[_0x4935('0xd6')]['belongsTo'](db[_0x4935('0x15e')],{'as':_0x4935('0x15e'),'foreignKey':_0x4935('0x15f')});db[_0x4935('0xd9')]['belongsTo'](db[_0x4935('0x15a')],{});db['MailTransferReport'][_0x4935('0x104')](db[_0x4935('0x3d')],{});db[_0x4935('0xd9')][_0x4935('0x104')](db[_0x4935('0x3a')],{'foreignKey':_0x4935('0x1c9'),'as':_0x4935('0x1ca')});db[_0x4935('0xd9')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cb'),'as':_0x4935('0x1cc')});db[_0x4935('0xd9')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cd'),'as':_0x4935('0x1ce')});db['MailTransferReport'][_0x4935('0x104')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport'][_0x4935('0x104')](db[_0x4935('0x3a')],{'foreignKey':_0x4935('0x1cf'),'as':'ToAccount'});db[_0x4935('0xdb')]['belongsTo'](db[_0x4935('0x65')],{});db[_0x4935('0xdb')][_0x4935('0x104')](db[_0x4935('0xff')],{});db[_0x4935('0xdb')][_0x4935('0x104')](db[_0x4935('0x5e')],{'foreignKey':_0x4935('0x1d0'),'as':_0x4935('0x1ca')});db[_0x4935('0xdb')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cb'),'as':'FromAgent'});db['ChatTransferReport'][_0x4935('0x104')](db['User'],{'foreignKey':'ToUserId','as':_0x4935('0x1ce')});db[_0x4935('0xdb')][_0x4935('0x104')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x4935('0x1d1')});db[_0x4935('0xdb')]['belongsTo'](db[_0x4935('0x5e')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0x4935('0xdc')][_0x4935('0x104')](db['FaxMessage'],{});db[_0x4935('0xdc')][_0x4935('0x104')](db[_0x4935('0x47')],{});db[_0x4935('0xdc')][_0x4935('0x104')](db[_0x4935('0x163')],{'foreignKey':'FromFaxAccountId','as':_0x4935('0x1ca')});db[_0x4935('0xdc')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cb'),'as':_0x4935('0x1cc')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0x4935('0x104')](db[_0x4935('0x4b')],{'foreignKey':_0x4935('0x1d2'),'as':'ToQueue'});db[_0x4935('0xdc')][_0x4935('0x104')](db[_0x4935('0x163')],{'foreignKey':'ToFaxAccountId','as':_0x4935('0x1d3')});db[_0x4935('0x1d4')]['belongsTo'](db[_0x4935('0x174')],{});db['OpenchannelTransferReport'][_0x4935('0x104')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x4935('0x104')](db['OpenchannelAccount'],{'foreignKey':_0x4935('0x1d5'),'as':'FromAccount'});db[_0x4935('0x1d4')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cb'),'as':_0x4935('0x1cc')});db[_0x4935('0x1d4')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cd'),'as':_0x4935('0x1ce')});db[_0x4935('0x1d4')]['belongsTo'](db[_0x4935('0x5c')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x4935('0x1d4')]['belongsTo'](db[_0x4935('0x126')],{'foreignKey':_0x4935('0x1d6'),'as':'ToAccount'});db[_0x4935('0xde')][_0x4935('0x104')](db[_0x4935('0x54')],{});db['SmsTransferReport'][_0x4935('0x104')](db[_0x4935('0x52')],{});db[_0x4935('0xde')][_0x4935('0x104')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport'][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cb'),'as':_0x4935('0x1cc')});db[_0x4935('0xde')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cd'),'as':_0x4935('0x1ce')});db[_0x4935('0xde')][_0x4935('0x104')](db[_0x4935('0x56')],{'foreignKey':'ToSmsQueueId','as':_0x4935('0x1d1')});db[_0x4935('0xde')][_0x4935('0x104')](db[_0x4935('0x4f')],{'foreignKey':'ToSmsAccountId','as':_0x4935('0x1d3')});db['CmList']['hasMany'](db['Disposition'],{'as':_0x4935('0x14e'),'foreignKey':_0x4935('0x150'),'onDelete':_0x4935('0xf7')});db[_0x4935('0xdf')][_0x4935('0xf8')](db[_0x4935('0x73')],{'as':_0x4935('0x1d7'),'foreignKey':_0x4935('0x150')});db[_0x4935('0xdf')][_0x4935('0xf8')](db[_0x4935('0x145')],{'as':_0x4935('0x109'),'onDelete':'cascade','foreignKey':_0x4935('0x150')});db[_0x4935('0xdf')][_0x4935('0xf8')](db[_0x4935('0x6e')],{'as':'HopperFinals','foreignKey':_0x4935('0x150')});db[_0x4935('0xdf')][_0x4935('0xf8')](db[_0x4935('0x6f')],{'as':_0x4935('0xfe'),'foreignKey':_0x4935('0x150')});db[_0x4935('0xdf')]['hasMany'](db[_0x4935('0x71')],{'as':_0x4935('0x71'),'foreignKey':'ListId'});db[_0x4935('0xdf')][_0x4935('0x108')](db['VoiceQueue'],{'as':_0x4935('0x1d8'),'through':_0x4935('0x13a')});db[_0x4935('0xdf')][_0x4935('0x108')](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':_0x4935('0x10c')});db[_0x4935('0x119')][_0x4935('0xf8')](db['VoiceExtension'],{'as':_0x4935('0xfc'),'onDelete':_0x4935('0xf7')});db[_0x4935('0x119')][_0x4935('0x108')](db[_0x4935('0x11')],{'as':_0x4935('0x152'),'through':'UserVoicePrefix'});db[_0x4935('0x119')][_0x4935('0x108')](db['Team'],{'through':'TeamVoicePrefix','as':_0x4935('0x13b')});db[_0x4935('0xe1')][_0x4935('0xf8')](db[_0x4935('0x11')],{'as':_0x4935('0x159'),'foreignKey':_0x4935('0x1d9')});db[_0x4935('0xe1')][_0x4935('0xf8')](db[_0x4935('0xe3')],{'as':'UserProfileSections','foreignKey':_0x4935('0x1d9'),'onDelete':_0x4935('0xf7')});db[_0x4935('0xe3')][_0x4935('0xf8')](db[_0x4935('0xe4')],{'as':_0x4935('0x1da'),'foreignKey':'sectionId','onDelete':_0x4935('0xf7')});db['WhatsappAccount'][_0x4935('0xf8')](db['Disposition'],{'as':_0x4935('0x14e'),'foreignKey':'WhatsappAccountId','onDelete':_0x4935('0xf7')});db[_0x4935('0xe8')][_0x4935('0xf8')](db[_0x4935('0x78')],{'as':'Answers','foreignKey':_0x4935('0x1db')});db['WhatsappAccount'][_0x4935('0xf8')](db[_0x4935('0x1dc')],{'as':'Messages','foreignKey':_0x4935('0x1db')});db[_0x4935('0xe8')]['hasMany'](db[_0x4935('0xea')],{'as':'Interactions'});db['WhatsappAccount'][_0x4935('0xf8')](db[_0x4935('0x1dd')],{'as':_0x4935('0x166')});db[_0x4935('0xe8')]['belongsTo'](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':'ListId'});db[_0x4935('0xe8')]['belongsTo'](db[_0x4935('0x80')],{'as':_0x4935('0x138'),'foreignKey':_0x4935('0x139')});db[_0x4935('0xe8')][_0x4935('0x108')](db['User'],{'as':_0x4935('0x152'),'through':_0x4935('0x12c')});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':_0x4935('0x160')});db[_0x4935('0x1dd')][_0x4935('0x104')](db[_0x4935('0xef')],{'onDelete':_0x4935('0x160')});db[_0x4935('0x1dd')][_0x4935('0x104')](db['WhatsappAccount'],{'onDelete':_0x4935('0x160')});db[_0x4935('0x1dd')][_0x4935('0x104')](db[_0x4935('0x7e')],{'onDelete':'restrict','foreignKey':_0x4935('0x137')});db[_0x4935('0x1dd')][_0x4935('0x104')](db[_0x4935('0x86')],{'onDelete':_0x4935('0x160'),'foreignKey':_0x4935('0x16d')});db[_0x4935('0xea')][_0x4935('0xf8')](db[_0x4935('0x1dc')],{'as':_0x4935('0x13e'),'onDelete':'cascade','foreignKey':_0x4935('0x1de')});db[_0x4935('0xea')]['belongsTo'](db[_0x4935('0xe8')],{'as':_0x4935('0x15d'),'foreignKey':_0x4935('0x1db')});db[_0x4935('0xea')][_0x4935('0x104')](db['CmContact'],{'as':'Contact','foreignKey':_0x4935('0x147')});db[_0x4935('0xea')][_0x4935('0x104')](db[_0x4935('0x11')],{'as':_0x4935('0x168'),'foreignKey':_0x4935('0xfa')});db[_0x4935('0xea')][_0x4935('0x108')](db[_0x4935('0x86')],{'through':'whatsapp_interaction_has_tags','as':_0x4935('0x157')});db[_0x4935('0xea')]['belongsToMany'](db['Tag'],{'through':_0x4935('0x198'),'as':_0x4935('0x158')});db['WhatsappInteraction']['belongsToMany'](db['User'],{'as':_0x4935('0x159'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x4935('0x1dc')][_0x4935('0x104')](db['User'],{'as':_0x4935('0x11')});db['WhatsappMessage'][_0x4935('0x104')](db[_0x4935('0x145')],{'onDelete':'cascade','as':_0x4935('0x146')});db[_0x4935('0x1dc')][_0x4935('0x104')](db[_0x4935('0xea')],{'onDelete':'cascade','as':_0x4935('0x15c'),'foreignKey':'WhatsappInteractionId'});db[_0x4935('0x1dc')][_0x4935('0x104')](db[_0x4935('0xe8')],{'as':_0x4935('0x15d'),'foreignKey':'WhatsappAccountId'});db[_0x4935('0x1df')]['belongsTo'](db[_0x4935('0xe8')],{});db['WhatsappQueueReport'][_0x4935('0x104')](db[_0x4935('0xdf')],{'as':_0x4935('0x161'),'foreignKey':'ListId'});db[_0x4935('0x1df')][_0x4935('0x104')](db[_0x4935('0x145')],{'as':_0x4935('0x146'),'foreignKey':_0x4935('0x147')});db[_0x4935('0x1df')]['belongsTo'](db[_0x4935('0xea')],{});db[_0x4935('0x1df')][_0x4935('0x104')](db[_0x4935('0xef')],{});db['WhatsappQueueReport'][_0x4935('0x104')](db['WhatsappMessage'],{});db[_0x4935('0x1df')][_0x4935('0x104')](db['User'],{});db[_0x4935('0xed')][_0x4935('0x104')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0x4935('0x104')](db['WhatsappInteraction'],{});db[_0x4935('0xed')]['belongsTo'](db[_0x4935('0xe8')],{'foreignKey':'FromWhatsappAccountId','as':_0x4935('0x1ca')});db[_0x4935('0xed')][_0x4935('0x104')](db[_0x4935('0xe8')],{'foreignKey':_0x4935('0x1e0'),'as':_0x4935('0x1d3')});db['WhatsappTransferReport'][_0x4935('0x104')](db[_0x4935('0xef')],{'foreignKey':'ToQueueId','as':_0x4935('0x1d1')});db[_0x4935('0xed')][_0x4935('0x104')](db[_0x4935('0x11')],{'foreignKey':_0x4935('0x1cb'),'as':_0x4935('0x1cc')});db['WhatsappTransferReport'][_0x4935('0x104')](db['User'],{'foreignKey':_0x4935('0x1cd'),'as':_0x4935('0x1ce')});db[_0x4935('0xef')][_0x4935('0x108')](db[_0x4935('0x11')],{'as':'Agents','through':_0x4935('0x36'),'foreignKey':_0x4935('0x1e1')});db['WhatsappQueue'][_0x4935('0x108')](db[_0x4935('0x10d')],{'through':_0x4935('0x1c4'),'as':_0x4935('0x13b')});module[_0x4935('0x1e2')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x0713=['../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','hasOne','VoiceMail','cascade','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','chat_group_has_users','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProject','SpiedAgents','ChanSpyId','Sounds','Members','VoiceQueueId','JscriptySessionReport','JscriptySessions','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','MailAccount','MailAccountId','Dispositions','Answers','MailMessage','Interactions','List','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','ListId','DashboardItem','FaxAccountId','Applications','Exntensions','mandatoryDispositionPauseId','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','Tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','AttachmentId','team_has_chat_queues','ChatGroupId','ChatGroup','Contacts','CompanyId','HopperHistories','CmCompany','cm_user_has_contacts','cm_contact_has_tags','Agent','OwnerId','CampaignId','All','OneAll','AutomationAllId','Any','Actions','ParentId','Intervals','MailApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','VoiceMusicOnHold','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','Field','VariableId','Subject','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','FreshsalesAccount','FreshsalesField','FromId','ToId','SessionId','JscriptyProject','ProjectId','JscriptyQuestionReport','user_has_square_projects','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','Hoppers','TrunkId','SquareProjectId','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromAccount','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromUserId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccount','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../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','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue'];(function(_0x2083ba,_0x135f8b){var _0x205dc3=function(_0x580ebd){while(--_0x580ebd){_0x2083ba['push'](_0x2083ba['shift']());}};_0x205dc3(++_0x135f8b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x3071('0x0'));var jstz=require(_0x3071('0x1'));var timezone=jstz[_0x3071('0x2')]();config[_0x3071('0x3')]=_[_0x3071('0x4')](config['sequelize'],{'database':_0x3071('0x5'),'username':_0x3071('0x6'),'password':_0x3071('0x7'),'options':{'host':_0x3071('0x8'),'port':0xcea,'dialect':_0x3071('0x9'),'dialectOptions':{'charset':_0x3071('0xa')},'logging':![],'timezone':timezone[_0x3071('0xb')](),'define':{'charset':_0x3071('0xc'),'collate':_0x3071('0xd')}}});config[_0x3071('0xe')]=_[_0x3071('0x4')](config[_0x3071('0xe')],{'database':_0x3071('0x5'),'username':'xcall','password':_0x3071('0x7'),'options':{'host':_0x3071('0x8'),'port':0xcea,'dialect':_0x3071('0x9'),'dialectOptions':{'charset':_0x3071('0xa')},'logging':![],'timezone':timezone[_0x3071('0xb')](),'define':{'charset':'utf8','collate':_0x3071('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3071('0x3')][_0x3071('0xf')],config[_0x3071('0x3')][_0x3071('0x10')],config['sequelize']['password'],config[_0x3071('0x3')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3071('0xe')][_0x3071('0xf')],config['sequelizeHistory'][_0x3071('0x10')],config['sequelizeHistory'][_0x3071('0x11')],config[_0x3071('0xe')][_0x3071('0x12')])};db[_0x3071('0x13')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x15'));db[_0x3071('0x16')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x3071('0x17')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x18'));db[_0x3071('0x19')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x1a'));db['VoiceMusicOnHold']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x1b'));db['VoiceQueue']=db[_0x3071('0x3')]['import'](_0x3071('0x1c'));db[_0x3071('0x1d')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x1e'));db[_0x3071('0x1f')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x20'));db[_0x3071('0x21')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x22'));db[_0x3071('0x23')]=db[_0x3071('0x3')]['import'](_0x3071('0x24'));db[_0x3071('0x25')]=db[_0x3071('0x3')]['import'](_0x3071('0x26'));db[_0x3071('0x27')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x28'));db[_0x3071('0x29')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x2a'));db[_0x3071('0x2b')]=db[_0x3071('0x3')]['import']('../api/memberReport/memberReport.model');db[_0x3071('0x2c')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x2d'));db[_0x3071('0x2e')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x2f'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0x3071('0x30'));db[_0x3071('0x31')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x32'));db[_0x3071('0x33')]=db[_0x3071('0x3')]['import'](_0x3071('0x34'));db[_0x3071('0x35')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x36'));db[_0x3071('0x37')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x3071('0x38')]=db['sequelize']['import'](_0x3071('0x39'));db[_0x3071('0x3a')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x3b'));db[_0x3071('0x3c')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x3d'));db['MailServerIn']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x3071('0x3e')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x3f'));db['MailAccount']=db['sequelize'][_0x3071('0x14')](_0x3071('0x40'));db[_0x3071('0x41')]=db['sequelize'][_0x3071('0x14')]('../api/mailQueue/mailQueue.model');db[_0x3071('0x42')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x43'));db[_0x3071('0x44')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x45'));db[_0x3071('0x46')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x47'));db[_0x3071('0x48')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x49'));db['Dashboard']=db[_0x3071('0x3')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x3071('0x14')](_0x3071('0x4a'));db[_0x3071('0x4b')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x4c'));db[_0x3071('0x4d')]=db[_0x3071('0x3')]['import'](_0x3071('0x4e'));db[_0x3071('0x4f')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x50'));db['FaxMessage']=db['sequelize'][_0x3071('0x14')](_0x3071('0x51'));db[_0x3071('0x52')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/faxQueue/faxQueue.model');db[_0x3071('0x53')]=db['sequelize'][_0x3071('0x14')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x3071('0x3')]['import'](_0x3071('0x54'));db['SmsApplication']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x55'));db[_0x3071('0x56')]=db['sequelize'][_0x3071('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0x3071('0x57')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x58'));db['SmsQueue']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x59'));db[_0x3071('0x5a')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x5b'));db['OpenchannelApplication']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x5c'));db[_0x3071('0x5d')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x5e'));db[_0x3071('0x5f')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x60'));db[_0x3071('0x61')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x62'));db[_0x3071('0x63')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x64'));db[_0x3071('0x65')]=db[_0x3071('0x3')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x3071('0x66')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x67'));db[_0x3071('0x68')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x69'));db['ChatMessage']=db['sequelize'][_0x3071('0x14')](_0x3071('0x6a'));db[_0x3071('0x6b')]=db[_0x3071('0x3')]['import'](_0x3071('0x6c'));db[_0x3071('0x6d')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x6e'));db['ChatGroup']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x6f'));db[_0x3071('0x70')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x71'));db['CmCompany']=db['sequelize'][_0x3071('0x14')]('../api/cmCompany/cmCompany.model');db[_0x3071('0x72')]=db[_0x3071('0x3')]['import'](_0x3071('0x73'));db[_0x3071('0x74')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x75'));db[_0x3071('0x76')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x3071('0x77')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x3071('0x78')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x79'));db[_0x3071('0x7a')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x7b'));db[_0x3071('0x7c')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x7d'));db[_0x3071('0x7e')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x7f'));db[_0x3071('0x80')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x81'));db[_0x3071('0x82')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x83'));db[_0x3071('0x84')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x85'));db[_0x3071('0x86')]=db[_0x3071('0x3')]['import'](_0x3071('0x87'));db[_0x3071('0x88')]=db['sequelize']['import'](_0x3071('0x89'));db[_0x3071('0x8a')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/pause/pause.model');db['Cdr']=db[_0x3071('0x3')]['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db['sequelize'][_0x3071('0x14')](_0x3071('0x8b'));db[_0x3071('0x8c')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x8d'));db[_0x3071('0x8e')]=db[_0x3071('0x3')]['import'](_0x3071('0x8f'));db[_0x3071('0x90')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x91'));db[_0x3071('0x92')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x93'));db[_0x3071('0x94')]=db['sequelize']['import'](_0x3071('0x95'));db[_0x3071('0x96')]=db[_0x3071('0x3')]['import']('../api/variable/variable.model');db[_0x3071('0x97')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x98'));db[_0x3071('0x99')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x9a'));db['AnalyticCustomReport']=db[_0x3071('0x3')]['import'](_0x3071('0x9b'));db[_0x3071('0x9c')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x9d'));db[_0x3071('0x9e')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x3071('0x9f')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0x3071('0xa0')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x3071('0x3')]['import'](_0x3071('0xa1'));db[_0x3071('0xa2')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xa3'));db[_0x3071('0xa4')]=db[_0x3071('0x3')]['import'](_0x3071('0xa5'));db[_0x3071('0xa6')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xa7'));db[_0x3071('0xa8')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x3071('0xa9')]=db['sequelize'][_0x3071('0x14')](_0x3071('0xaa'));db[_0x3071('0xab')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xac'));db[_0x3071('0xad')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xae'));db['DeskConfiguration']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3071('0xaf')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb0'));db[_0x3071('0xb1')]=db['sequelize']['import'](_0x3071('0xb2'));db['ZohoConfiguration']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb3'));db[_0x3071('0xb4')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intZohoField/intZohoField.model');db[_0x3071('0xb5')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb6'));db['ZendeskConfiguration']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x3071('0xb7')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb8'));db[_0x3071('0xb9')]=db['sequelize'][_0x3071('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x3071('0xba')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xbb'));db[_0x3071('0xbc')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xbd'));db['VtigerAccount']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xbe'));db['VtigerConfiguration']=db[_0x3071('0x3')]['import'](_0x3071('0xbf'));db[_0x3071('0xc0')]=db[_0x3071('0x3')]['import'](_0x3071('0xc1'));db[_0x3071('0xc2')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc3'));db[_0x3071('0xc4')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc5'));db['ServicenowField']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc6'));db['Dynamics365Account']=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x3071('0xc7')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc8'));db[_0x3071('0xc9')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xca'));db['FreshsalesField']=db['sequelize'][_0x3071('0x14')](_0x3071('0xcb'));db[_0x3071('0x97')]=db[_0x3071('0x3')]['import'](_0x3071('0x98'));db[_0x3071('0xcc')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xcd'));db[_0x3071('0xce')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x3071('0xcf')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd0'));db[_0x3071('0xd1')]=db['sequelize'][_0x3071('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd2'));db['JscriptySessionReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd3'));db[_0x3071('0xd4')]=db[_0x3071('0x3')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x3071('0xd5')]=db[_0x3071('0x3')]['import'](_0x3071('0xd6'));db[_0x3071('0xd7')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd8'));db['JscriptyProject']=db[_0x3071('0x3')]['import'](_0x3071('0xd9'));db[_0x3071('0xda')]=db['sequelize'][_0x3071('0x14')]('../api/setting/setting.model');db[_0x3071('0xdb')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xdc'));db['SquareProject']=db[_0x3071('0x3')]['import'](_0x3071('0xdd'));db['SquareRecording']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/squareRecording/squareRecording.model');db[_0x3071('0xde')]=db[_0x3071('0x3')]['import'](_0x3071('0xdf'));db[_0x3071('0xe0')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe1'));db[_0x3071('0xe2')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe3'));db[_0x3071('0xe4')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe5'));db[_0x3071('0xe6')]=db[_0x3071('0x3')]['import'](_0x3071('0xe7'));db[_0x3071('0xe8')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe9'));db['Plugin']=db['sequelize'][_0x3071('0x14')](_0x3071('0xea'));db['MailTransferReport']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x3071('0xeb')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xec'));db[_0x3071('0xed')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xee'));db[_0x3071('0xef')]=db[_0x3071('0x3')]['import'](_0x3071('0xf0'));db['SmsTransferReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf1'));db[_0x3071('0xf2')]=db['sequelize']['import']('../api/cmList/cmList.model');db[_0x3071('0xf3')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf4'));db['UserProfile']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf5'));db['UserProfileSection']=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0x3071('0xf6')]=db[_0x3071('0x3')]['import'](_0x3071('0xf7'));db[_0x3071('0xf8')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf9'));db['WhatsappAccount']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xfa'));db[_0x3071('0xfb')]=db['sequelize'][_0x3071('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0x3071('0xfc')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x3071('0xfd')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xfe'));db['WhatsappQueueReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xff'));db[_0x3071('0x100')]=db[_0x3071('0x3')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x3071('0x101')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x102'));db['CloudProvider']=db['sequelize'][_0x3071('0x14')](_0x3071('0x103'));db['TeamVoiceQueue']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x104'));db['TeamVoicePrefix']=db['sequelize']['import'](_0x3071('0x105'));db[_0x3071('0x106')]=db[_0x3071('0x3')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x3071('0x13')][_0x3071('0x107')](db[_0x3071('0x108')],{'as':_0x3071('0x108'),'onDelete':_0x3071('0x109'),'foreignKey':'UserId'});db[_0x3071('0x13')]['hasMany'](db[_0x3071('0x1d')],{'as':_0x3071('0x10a'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db['UserVoiceQueueRt'],{'as':_0x3071('0x10d'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x10e'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':'UserId'});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':_0x3071('0x110'),'foreignKey':'UserId'});db[_0x3071('0x13')]['hasMany'](db[_0x3071('0x7a')],{'as':_0x3071('0x7a'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x5d')],{'as':_0x3071('0x111'),'foreignKey':'UserId'});db[_0x3071('0x13')]['hasMany'](db['ChatInteraction'],{'as':_0x3071('0x112'),'foreignKey':_0x3071('0x10b')});db['User'][_0x3071('0x10c')](db['SmsInteraction'],{'as':_0x3071('0x113'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x4f')],{'as':_0x3071('0x114'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x44')],{'as':_0x3071('0x115'),'foreignKey':'UserId'});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0xfc')],{'as':'WhatsappInteractions','foreignKey':_0x3071('0x10b')});db['User'][_0x3071('0x10c')](db[_0x3071('0xf8')],{'as':_0x3071('0x116'),'foreignKey':_0x3071('0x117')});db['User']['belongsTo'](db['UserProfile'],{'as':_0x3071('0x118'),'foreignKey':'userProfileId'});db['User'][_0x3071('0x119')](db['ChatGroup'],{'as':_0x3071('0x11a'),'through':_0x3071('0x11b')});db[_0x3071('0x13')]['belongsToMany'](db[_0x3071('0x72')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xf2')],{'as':_0x3071('0x11c'),'through':_0x3071('0x11d')});db[_0x3071('0x13')][_0x3071('0x119')](db['Team'],{'through':_0x3071('0x11e')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x44')],{'as':_0x3071('0x115'),'through':_0x3071('0x11f')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x68')],{'as':'ChatInteractions','through':_0x3071('0x120')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x4f')],{'as':_0x3071('0x114'),'through':_0x3071('0x121')});db[_0x3071('0x13')]['belongsToMany'](db[_0x3071('0x56')],{'as':'SmsInteractions','through':_0x3071('0x122')});db[_0x3071('0x13')][_0x3071('0x119')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xfc')],{'as':'WhatsappInteractions','through':_0x3071('0x123')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x124')],{'as':_0x3071('0x125'),'through':_0x3071('0x31'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xf3')],{'as':'VoicePrefixes','through':_0x3071('0x106'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db['MailQueue'],{'as':_0x3071('0x126'),'through':_0x3071('0x35'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x6d')],{'as':_0x3071('0x127'),'through':_0x3071('0x33'),'required':![],'hooks':!![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x52')],{'as':_0x3071('0x128'),'through':_0x3071('0x37'),'required':![]});db['User'][_0x3071('0x119')](db[_0x3071('0x129')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db[_0x3071('0x61')],{'as':_0x3071('0x12a'),'through':'UserOpenchannelQueue','required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x101')],{'as':_0x3071('0x12b'),'through':_0x3071('0x3c'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xf2')],{'through':_0x3071('0x11d')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x63')],{'as':_0x3071('0x12c'),'through':'user_has_chat_websites'});db[_0x3071('0x13')][_0x3071('0x119')](db['FaxAccount'],{'as':_0x3071('0x12d'),'through':_0x3071('0x12e')});db[_0x3071('0x13')][_0x3071('0x119')](db['MailAccount'],{'as':_0x3071('0x12f'),'through':_0x3071('0x130')});db[_0x3071('0x13')][_0x3071('0x119')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x3071('0x131')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x132')],{'as':_0x3071('0x133'),'through':_0x3071('0x134')});db[_0x3071('0x13')][_0x3071('0x119')](db['WhatsappAccount'],{'as':_0x3071('0x135'),'through':'user_has_whatsapp_accounts'});db['User'][_0x3071('0x119')](db[_0x3071('0x136')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x3071('0x16')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x137'),'onDelete':'cascade','foreignKey':_0x3071('0x138')});db[_0x3071('0x17')][_0x3071('0x10c')](db[_0x3071('0x19')],{'onDelete':_0x3071('0x109')});db['VoiceExtension'][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0x3071('0x119')](db[_0x3071('0x8e')],{'as':_0x3071('0x139'),'through':'moh_has_sounds'});db[_0x3071('0x124')][_0x3071('0x10c')](db['UserVoiceQueueRt'],{'as':_0x3071('0x13a'),'foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x74')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':'HopperHistories','foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x76')],{'as':'HopperBlacks','foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')]['hasMany'](db[_0x3071('0x13c')],{'as':_0x3071('0x13d'),'foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x13e')](db['Trunk'],{'as':_0x3071('0x2c'),'foreignKey':'TrunkId'});db[_0x3071('0x124')]['belongsTo'](db[_0x3071('0x2c')],{'as':_0x3071('0x13f'),'foreignKey':_0x3071('0x140')});db[_0x3071('0x124')]['belongsTo'](db[_0x3071('0x88')],{'as':_0x3071('0x88'),'foreignKey':_0x3071('0x141')});db['VoiceQueue'][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3071('0x124')][_0x3071('0x119')](db[_0x3071('0xf2')],{'as':_0x3071('0x11c'),'through':_0x3071('0x143')});db['VoiceQueue'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x31')});db['VoiceQueue'][_0x3071('0x119')](db[_0x3071('0xe0')],{'as':_0x3071('0x145'),'through':_0x3071('0x146')});db[_0x3071('0x124')][_0x3071('0x119')](db[_0x3071('0xf2')],{'as':_0x3071('0x147'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':'User','foreignKey':_0x3071('0x10b')});db[_0x3071('0x1f')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x13'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x108')]['hasMany'](db[_0x3071('0x21')],{'as':_0x3071('0x148'),'onDelete':'cascade','foreignKey':_0x3071('0x149'),'sourceKey':_0x3071('0x14a')});db[_0x3071('0x21')]['belongsTo'](db[_0x3071('0x108')],{'foreignKey':_0x3071('0x149'),'targetKey':_0x3071('0x14a')});db[_0x3071('0x23')][_0x3071('0x10c')](db[_0x3071('0x29')],{'as':_0x3071('0x14b'),'foreignKey':_0x3071('0x14c'),'constraints':![]});db['VoiceCallReport'][_0x3071('0x10c')](db[_0x3071('0x27')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x3071('0x23')]['belongsTo'](db[_0x3071('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3071('0x23')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x14f')]['belongsTo'](db[_0x3071('0x150')],{'as':_0x3071('0x150'),'foreignKey':'MailAccountId'});db[_0x3071('0x3e')][_0x3071('0x13e')](db['MailAccount'],{'as':_0x3071('0x150'),'foreignKey':_0x3071('0x151')});db[_0x3071('0x150')][_0x3071('0x107')](db[_0x3071('0x14f')],{'as':'Imap','onDelete':_0x3071('0x109')});db[_0x3071('0x150')][_0x3071('0x107')](db[_0x3071('0x3e')],{'as':'Smtp','onDelete':'cascade'});db[_0x3071('0x150')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x151'),'onDelete':_0x3071('0x109')});db[_0x3071('0x150')][_0x3071('0x10c')](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x151')});db[_0x3071('0x150')]['hasMany'](db[_0x3071('0x154')],{'as':'Messages','foreignKey':_0x3071('0x151')});db[_0x3071('0x150')][_0x3071('0x10c')](db[_0x3071('0x44')],{'as':_0x3071('0x155')});db[_0x3071('0x150')][_0x3071('0x10c')](db['MailApplication'],{'as':'Applications'});db[_0x3071('0x150')]['belongsTo'](db['CmList'],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db['MailAccount'][_0x3071('0x13e')](db['Template'],{'as':_0x3071('0x92'),'foreignKey':'TemplateId'});db[_0x3071('0x150')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x130')});db['MailQueue'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x35')});db['MailQueue'][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x157'),'as':_0x3071('0x145')});db[_0x3071('0x44')][_0x3071('0x10c')](db[_0x3071('0x154')],{'as':'Messages','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x158')});db[_0x3071('0x44')][_0x3071('0x13e')](db[_0x3071('0x150')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x151')});db[_0x3071('0x44')]['belongsTo'](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x44')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':'Owner','foreignKey':_0x3071('0x10b')});db[_0x3071('0x44')]['belongsToMany'](db[_0x3071('0x90')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x3071('0x44')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x15a'),'as':_0x3071('0x15b')});db[_0x3071('0x44')][_0x3071('0x119')](db['User'],{'as':_0x3071('0x15c'),'through':_0x3071('0x11f'),'foreignKey':'MailInteractionId'});db[_0x3071('0x154')][_0x3071('0x10c')](db[_0x3071('0xe8')],{'as':_0x3071('0x15d'),'onDelete':_0x3071('0x109')});db[_0x3071('0x154')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x13')});db[_0x3071('0x154')][_0x3071('0x13e')](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':'Contact'});db[_0x3071('0x154')]['belongsTo'](db[_0x3071('0x44')],{'as':_0x3071('0x15e'),'foreignKey':_0x3071('0x158')});db[_0x3071('0x154')][_0x3071('0x13e')](db['MailAccount'],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x151')});db['MailMessage']['belongsTo'](db[_0x3071('0x63')],{'as':'ChatWebsite','foreignKey':_0x3071('0x15f')});db['MailMessage'][_0x3071('0x13e')](db['ChatOfflineMessage'],{'as':_0x3071('0x6b'),'foreignKey':_0x3071('0x160')});db[_0x3071('0x46')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x161')});db['MailApplication'][_0x3071('0x13e')](db[_0x3071('0x41')],{'onDelete':'restrict'});db[_0x3071('0x46')]['belongsTo'](db['MailAccount'],{'onDelete':_0x3071('0x161')});db[_0x3071('0x46')][_0x3071('0x13e')](db[_0x3071('0x88')],{'onDelete':_0x3071('0x161'),'foreignKey':'IntervalId'});db[_0x3071('0x46')][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x162')});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x150')],{});db['MailQueueReport']['belongsTo'](db[_0x3071('0xf2')],{'as':'List','foreignKey':_0x3071('0x163')});db[_0x3071('0x48')][_0x3071('0x13e')](db['CmContact'],{'as':'Contact','foreignKey':_0x3071('0x14e')});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x44')],{});db['MailQueueReport'][_0x3071('0x13e')](db[_0x3071('0x154')],{});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x41')],{});db['Dashboard'][_0x3071('0x10c')](db[_0x3071('0x164')],{'as':'Items','onDelete':'cascade'});db[_0x3071('0x4b')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x165'),'onDelete':_0x3071('0x109')});db[_0x3071('0x4b')]['hasMany'](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':'FaxAccountId'});db[_0x3071('0x4b')]['hasMany'](db[_0x3071('0x4f')],{'as':'Interactions'});db[_0x3071('0x4b')][_0x3071('0x10c')](db[_0x3071('0x4d')],{'as':_0x3071('0x166')});db[_0x3071('0x4b')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x167'),'onDelete':_0x3071('0x109')});db[_0x3071('0x4b')][_0x3071('0x10c')](db['FaxMessage'],{'as':_0x3071('0x148')});db[_0x3071('0x4b')][_0x3071('0x13e')](db[_0x3071('0x2c')],{'as':'Trunk'});db['FaxAccount'][_0x3071('0x13e')](db['CmList'],{'as':'List','foreignKey':_0x3071('0x163')});db[_0x3071('0x4b')]['belongsTo'](db[_0x3071('0x8a')],{'as':'mandatoryDispositionPause','foreignKey':_0x3071('0x168')});db[_0x3071('0x4b')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':'user_has_fax_accounts'});db[_0x3071('0x4d')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x161')});db[_0x3071('0x4d')][_0x3071('0x13e')](db[_0x3071('0x52')],{'onDelete':'restrict'});db[_0x3071('0x4d')][_0x3071('0x13e')](db[_0x3071('0x4b')],{'onDelete':_0x3071('0x161')});db['FaxApplication'][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':'restrict','foreignKey':_0x3071('0x162')});db[_0x3071('0x4f')][_0x3071('0x10c')](db[_0x3071('0x169')],{'as':_0x3071('0x148'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x16a')});db['FaxInteraction'][_0x3071('0x13e')](db[_0x3071('0x4b')],{'as':'Account','foreignKey':_0x3071('0x165')});db['FaxInteraction'][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':'Contact','foreignKey':_0x3071('0x14e')});db['FaxInteraction'][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x4f')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction']['belongsToMany'](db[_0x3071('0x90')],{'through':_0x3071('0x16c'),'as':_0x3071('0x15b')});db[_0x3071('0x4f')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':_0x3071('0x121'),'foreignKey':_0x3071('0x16a')});db[_0x3071('0x169')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'as':'User'});db['FaxMessage'][_0x3071('0x13e')](db[_0x3071('0x4f')],{'as':_0x3071('0x15e'),'foreignKey':_0x3071('0x16a')});db[_0x3071('0x169')][_0x3071('0x13e')](db['CmContact'],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d')});db[_0x3071('0x169')][_0x3071('0x13e')](db[_0x3071('0xe8')],{'as':_0x3071('0xe8'),'foreignKey':'AttachmentId'});db[_0x3071('0x169')][_0x3071('0x13e')](db[_0x3071('0x4b')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x165')});db[_0x3071('0x52')]['belongsToMany'](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x37')});db['FaxQueue'][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x16d'),'as':_0x3071('0x145')});db[_0x3071('0x53')][_0x3071('0x13e')](db[_0x3071('0x4b')],{});db[_0x3071('0x53')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0x53')]['belongsTo'](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x53')][_0x3071('0x13e')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x3071('0x13e')](db[_0x3071('0x169')],{});db[_0x3071('0x53')][_0x3071('0x13e')](db['User'],{});db['FaxQueueReport'][_0x3071('0x13e')](db['FaxQueue'],{});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x16e'),'onDelete':_0x3071('0x109')});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x16e')});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x57')],{'as':'Messages','foreignKey':_0x3071('0x16e')});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x56')],{'as':_0x3071('0x155')});db[_0x3071('0x132')]['hasMany'](db[_0x3071('0x16f')],{'as':'Applications'});db[_0x3071('0x132')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db[_0x3071('0x132')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':_0x3071('0x168')});db[_0x3071('0x132')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':'Agents','through':_0x3071('0x134')});db[_0x3071('0x16f')][_0x3071('0x13e')](db['User'],{'onDelete':_0x3071('0x161')});db['SmsApplication'][_0x3071('0x13e')](db[_0x3071('0x129')],{'onDelete':_0x3071('0x161')});db['SmsApplication']['belongsTo'](db[_0x3071('0x132')],{'onDelete':_0x3071('0x161')});db[_0x3071('0x16f')][_0x3071('0x13e')](db[_0x3071('0x88')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x141')});db[_0x3071('0x16f')][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':_0x3071('0x161'),'foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0x3071('0x57')],{'as':_0x3071('0x148'),'onDelete':'cascade','foreignKey':_0x3071('0x170')});db[_0x3071('0x56')][_0x3071('0x13e')](db[_0x3071('0x132')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x16e')});db[_0x3071('0x56')][_0x3071('0x13e')](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x56')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x56')][_0x3071('0x119')](db['Tag'],{'through':_0x3071('0x171'),'as':_0x3071('0x172')});db[_0x3071('0x56')][_0x3071('0x119')](db['Tag'],{'through':_0x3071('0x171'),'as':_0x3071('0x15b')});db[_0x3071('0x56')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':'Users','through':_0x3071('0x122'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x13')});db['SmsMessage'][_0x3071('0x13e')](db['CmContact'],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d')});db['SmsMessage'][_0x3071('0x13e')](db[_0x3071('0x56')],{'onDelete':_0x3071('0x109'),'as':'Interaction','foreignKey':_0x3071('0x170')});db[_0x3071('0x57')][_0x3071('0x13e')](db[_0x3071('0x132')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x16e')});db[_0x3071('0x129')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':'UserSmsQueue','foreignKey':_0x3071('0x173')});db[_0x3071('0x129')][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x174'),'as':_0x3071('0x145')});db[_0x3071('0x5a')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':'OpenchannelAccountId','onDelete':_0x3071('0x109')});db[_0x3071('0x5a')]['hasMany'](db['CannedAnswer'],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x175')});db[_0x3071('0x5a')][_0x3071('0x10c')](db[_0x3071('0x5d')],{'as':_0x3071('0x155'),'foreignKey':_0x3071('0x175')});db[_0x3071('0x5a')]['hasMany'](db[_0x3071('0x5f')],{'as':_0x3071('0x148'),'foreignKey':_0x3071('0x175')});db['OpenchannelAccount'][_0x3071('0x10c')](db[_0x3071('0x176')],{'as':'Applications','foreignKey':_0x3071('0x175')});db[_0x3071('0x5a')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0x5a')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x3071('0x5a')]['belongsToMany'](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x131')});db[_0x3071('0x176')][_0x3071('0x13e')](db['User'],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x3071('0x13e')](db[_0x3071('0x61')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x177')});db['OpenchannelApplication'][_0x3071('0x13e')](db[_0x3071('0x5a')],{'onDelete':'restrict','foreignKey':_0x3071('0x175')});db['OpenchannelApplication']['belongsTo'](db[_0x3071('0x88')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x141')});db[_0x3071('0x176')][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':'restrict','foreignKey':_0x3071('0x162')});db[_0x3071('0x5d')][_0x3071('0x10c')](db[_0x3071('0x5f')],{'as':_0x3071('0x148'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x178')});db[_0x3071('0x5d')]['belongsTo'](db[_0x3071('0x5a')],{'as':'Account','foreignKey':_0x3071('0x175')});db[_0x3071('0x5d')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':'Contact','foreignKey':_0x3071('0x14e')});db[_0x3071('0x5d')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x5d')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x179'),'as':_0x3071('0x172')});db[_0x3071('0x5d')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x179'),'as':_0x3071('0x15b')});db[_0x3071('0x5d')]['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':'user_has_openchannel_interactions','foreignKey':_0x3071('0x178')});db[_0x3071('0x5f')]['belongsTo'](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x13')});db[_0x3071('0x5f')][_0x3071('0x13e')](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d')});db[_0x3071('0x5f')][_0x3071('0x13e')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x3071('0x15e'),'foreignKey':_0x3071('0x178')});db['OpenchannelMessage'][_0x3071('0x13e')](db[_0x3071('0xe8')],{'as':_0x3071('0xe8'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x3071('0x13e')](db[_0x3071('0x5a')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x175')});db['OpenchannelQueue'][_0x3071('0x119')](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x3a'),'foreignKey':_0x3071('0x177')});db[_0x3071('0x61')]['belongsToMany'](db['Team'],{'through':_0x3071('0x17a'),'as':_0x3071('0x145')});db[_0x3071('0x63')][_0x3071('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x3071('0x63')][_0x3071('0x10c')](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x15f')});db[_0x3071('0x63')]['hasMany'](db[_0x3071('0x70')],{'as':_0x3071('0x17b')});db['ChatWebsite']['hasMany'](db[_0x3071('0x68')],{'as':_0x3071('0x155')});db[_0x3071('0x63')][_0x3071('0x10c')](db[_0x3071('0x66')],{'as':'Applications'});db[_0x3071('0x63')][_0x3071('0x10c')](db['ChatMessage'],{'as':_0x3071('0x148')});db[_0x3071('0x63')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':'List','foreignKey':_0x3071('0x163')});db[_0x3071('0x63')][_0x3071('0x13e')](db['Interval'],{'as':_0x3071('0x88'),'foreignKey':_0x3071('0x141')});db[_0x3071('0x63')][_0x3071('0x13e')](db[_0x3071('0x150')],{'as':_0x3071('0x150'),'foreignKey':'MailAccountId'});db[_0x3071('0x63')]['belongsTo'](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':_0x3071('0x168')});db[_0x3071('0x63')]['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x17c')});db[_0x3071('0x65')]['belongsTo'](db[_0x3071('0x5a')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x5d')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x5f')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x61')],{});db[_0x3071('0x66')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x3071('0x161')});db[_0x3071('0x66')]['belongsTo'](db[_0x3071('0x6d')],{'as':_0x3071('0x17d'),'foreignKey':_0x3071('0x17e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x66')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x17f'),'foreignKey':_0x3071('0x15f'),'onDelete':'restrict'});db['ChatApplication'][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x162')});db[_0x3071('0x68')][_0x3071('0x10c')](db[_0x3071('0x180')],{'as':_0x3071('0x148'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x181')});db[_0x3071('0x68')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x15f')});db[_0x3071('0x68')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':'ContactId'});db[_0x3071('0x68')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0x3071('0x90')],{'through':_0x3071('0x182'),'as':'Tags'});db[_0x3071('0x68')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x182'),'as':_0x3071('0x15b')});db[_0x3071('0x68')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':'user_has_chat_interactions','foreignKey':_0x3071('0x181')});db['ChatMessage'][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':'cascade','as':_0x3071('0x13')});db['ChatMessage'][_0x3071('0x13e')](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':'Contact','foreignKey':_0x3071('0x14e')});db[_0x3071('0x180')][_0x3071('0x13e')](db[_0x3071('0x68')],{'onDelete':'cascade','as':_0x3071('0x15e'),'foreignKey':_0x3071('0x181')});db['ChatMessage']['belongsTo'](db[_0x3071('0xe8')],{'as':_0x3071('0xe8'),'foreignKey':_0x3071('0x183')});db[_0x3071('0x180')][_0x3071('0x13e')](db['ChatWebsite'],{'as':_0x3071('0x159'),'foreignKey':'ChatWebsiteId'});db[_0x3071('0x6b')][_0x3071('0x10c')](db[_0x3071('0xe8')],{'as':'Attachments','foreignKey':_0x3071('0x160'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x6b')]['belongsTo'](db['CmContact'],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x6b')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x15f')});db[_0x3071('0x6d')]['belongsToMany'](db[_0x3071('0x13')],{'as':'Agents','through':_0x3071('0x33'),'hooks':!![]});db[_0x3071('0x6d')][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x184'),'as':_0x3071('0x145')});db['ChatGroup']['hasMany'](db[_0x3071('0xcf')],{'as':_0x3071('0x148'),'foreignKey':_0x3071('0x185'),'onDelete':'cascade'});db[_0x3071('0x186')]['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x13a'),'through':_0x3071('0x11b')});db[_0x3071('0x70')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x17f'),'foreignKey':_0x3071('0x15f')});db['CmCompany'][_0x3071('0x10c')](db[_0x3071('0x72')],{'as':_0x3071('0x187'),'foreignKey':_0x3071('0x188')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x74')],{'as':'Hoppers','foreignKey':_0x3071('0x14e')});db[_0x3071('0x72')]['hasMany'](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':_0x3071('0x14e')});db['CmContact'][_0x3071('0x10c')](db['CmHopperHistory'],{'as':_0x3071('0x189'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x7a')],{'as':_0x3071('0x7a'),'foreignKey':'ContactId'});db[_0x3071('0x72')][_0x3071('0x10c')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x3071('0x14e')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x5d')],{'as':_0x3071('0x111'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x68')],{'as':'ChatInteractions','foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x56')],{'as':_0x3071('0x113'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x4f')],{'as':_0x3071('0x114'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x44')],{'as':'MailInteractions','foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')]['belongsTo'](db[_0x3071('0x18a')],{'as':'Company','foreignKey':'CompanyId'});db[_0x3071('0x72')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db[_0x3071('0x72')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':_0x3071('0x18b')});db[_0x3071('0x72')][_0x3071('0x119')](db[_0x3071('0x90')],{'as':_0x3071('0x172'),'through':_0x3071('0x18c')});db[_0x3071('0x72')][_0x3071('0x119')](db['Tag'],{'through':_0x3071('0x18c'),'as':_0x3071('0x15b')});db[_0x3071('0x74')][_0x3071('0x13e')](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e'),'onDelete':'cascade'});db[_0x3071('0x74')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':'List','foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db[_0x3071('0x74')][_0x3071('0x13e')](db['User'],{'as':_0x3071('0x18d'),'foreignKey':'UserId'});db[_0x3071('0x74')][_0x3071('0x13e')](db['VoiceQueue'],{'as':_0x3071('0x17d'),'foreignKey':'VoiceQueueId','onDelete':_0x3071('0x109')});db[_0x3071('0x74')][_0x3071('0x13e')](db[_0x3071('0xe4')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x3071('0x74')][_0x3071('0x13e')](db['User'],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x18e')});db[_0x3071('0x76')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x109')});db[_0x3071('0x76')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db['CmHopperBlack'][_0x3071('0x13e')](db[_0x3071('0x124')],{'as':_0x3071('0x17d'),'foreignKey':_0x3071('0x13b'),'onDelete':_0x3071('0x109')});db['CmHopperBlack'][_0x3071('0x13e')](db['Campaign'],{'as':_0x3071('0xe4'),'foreignKey':_0x3071('0x18f'),'onDelete':'cascade'});db[_0x3071('0x80')][_0x3071('0x10c')](db[_0x3071('0x86')],{'as':{'plural':_0x3071('0x190'),'singular':_0x3071('0x191')},'foreignKey':_0x3071('0x192'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x80')][_0x3071('0x10c')](db['Condition'],{'as':{'plural':_0x3071('0x193'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db['Automation'][_0x3071('0x10c')](db[_0x3071('0x7e')],{'as':_0x3071('0x194'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x3071('0x84')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x195'),'onDelete':_0x3071('0x109')});db[_0x3071('0x88')]['hasMany'](db[_0x3071('0x88')],{'as':_0x3071('0x196'),'foreignKey':_0x3071('0x141'),'onDelete':_0x3071('0x109'),'hooks':!![],'required':![]});db[_0x3071('0x88')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x10e'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x3071('0x88')][_0x3071('0x10c')](db['MailApplication'],{'as':_0x3071('0x197'),'foreignKey':'IntervalId'});db[_0x3071('0x88')][_0x3071('0x10c')](db[_0x3071('0x66')],{'as':'ChatApplications','foreignKey':_0x3071('0x141')});db['Interval'][_0x3071('0x10c')](db[_0x3071('0x4d')],{'as':'FaxApplications','foreignKey':_0x3071('0x141')});db[_0x3071('0x88')][_0x3071('0x10c')](db['SmsApplication'],{'as':_0x3071('0x198'),'foreignKey':'IntervalId'});db[_0x3071('0x8c')]['belongsTo'](db[_0x3071('0x150')],{});db['Schedule']['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x3071('0x199')});db[_0x3071('0x8c')][_0x3071('0x13e')](db[_0x3071('0x19a')],{'foreignKey':'CustomReportId'});db['Sound']['belongsToMany'](db[_0x3071('0x19b')],{'as':_0x3071('0x19c'),'through':_0x3071('0x19d'),'onDelete':_0x3071('0x161')});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x72')],{'through':_0x3071('0x18c')});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x68')],{'through':'chat_interaction_has_tags'});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x44')],{'through':_0x3071('0x15a')});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x56')],{'through':'sms_interaction_has_tags'});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x4f')],{'through':'fax_interaction_has_tags'});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x5d')],{'through':_0x3071('0x179')});db[_0x3071('0x90')][_0x3071('0x119')](db['WhatsappInteraction'],{'through':_0x3071('0x19e')});db[_0x3071('0x94')][_0x3071('0x10c')](db['Condition'],{'as':{'plural':_0x3071('0x19f'),'singular':_0x3071('0x1a0')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x3071('0x94')]['hasMany'](db[_0x3071('0x86')],{'as':{'plural':_0x3071('0x1a1'),'singular':'AnyCondition'},'foreignKey':_0x3071('0x1a2'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x94')][_0x3071('0x10c')](db['Action'],{'as':_0x3071('0x194'),'foreignKey':'TriggerId','onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x19a')][_0x3071('0x10c')](db[_0x3071('0xa0')],{'as':_0x3071('0x1a3'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x3071('0x9c')][_0x3071('0x10c')](db[_0x3071('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x3071('0x9f')][_0x3071('0x10c')](db[_0x3071('0xa0')],{'as':'Fields','onDelete':_0x3071('0x109'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x3071('0x13e')](db['AnalyticMetric'],{'foreignKey':_0x3071('0x1a4')});db['SalesforceAccount'][_0x3071('0x10c')](db[_0x3071('0xa4')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xa4')][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1a7'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xa4')][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db['SalesforceConfiguration'][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1a3'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xa4')][_0x3071('0x13e')](db[_0x3071('0xa2')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xa6')]['hasMany'](db[_0x3071('0xa6')],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xa6')][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1ac'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x3071('0xa6')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xa6')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db[_0x3071('0xa8')][_0x3071('0x10c')](db[_0x3071('0xa9')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db['SugarcrmConfiguration']['hasMany'](db[_0x3071('0xab')],{'as':'Subjects','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db['SugarcrmConfiguration'][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xa9')][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':'Fields','onDelete':_0x3071('0x109'),'foreignKey':'FieldId'});db[_0x3071('0xa9')][_0x3071('0x13e')](db[_0x3071('0xa8')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xab')]['hasMany'](db[_0x3071('0xab')],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xab')][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':'Field','foreignKey':_0x3071('0x1ab')});db[_0x3071('0xab')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':'VariableId'});db[_0x3071('0xad')][_0x3071('0x10c')](db[_0x3071('0x1b0')],{'as':'Configurations','onDelete':_0x3071('0x109'),'foreignKey':'AccountId'});db[_0x3071('0x1b0')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':_0x3071('0x1a7'),'onDelete':'cascade','foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b0')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b0')][_0x3071('0x10c')](db['DeskField'],{'as':_0x3071('0x1a3'),'onDelete':'cascade','foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b0')][_0x3071('0x13e')](db[_0x3071('0xad')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b0')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x1b1')});db[_0x3071('0xaf')]['hasMany'](db['DeskField'],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db[_0x3071('0xaf')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':'Description','foreignKey':_0x3071('0x1aa')});db[_0x3071('0xaf')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xaf')]['belongsTo'](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db[_0x3071('0xb1')][_0x3071('0x10c')](db[_0x3071('0x1b2')],{'as':_0x3071('0x1a5'),'onDelete':'cascade','foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b2')][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':'Subjects','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db['ZohoConfiguration'][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db['ZohoConfiguration']['hasMany'](db[_0x3071('0xb4')],{'as':'Fields','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b2')]['belongsTo'](db[_0x3071('0xb1')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xb4')][_0x3071('0x10c')](db['ZohoField'],{'as':_0x3071('0x1af'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xb4')][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':'Description','foreignKey':_0x3071('0x1aa')});db[_0x3071('0xb4')][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xb4')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db[_0x3071('0xb5')][_0x3071('0x10c')](db['ZendeskConfiguration'],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b3')][_0x3071('0x10c')](db['ZendeskField'],{'as':_0x3071('0x1a7'),'foreignKey':'SubjectId'});db[_0x3071('0x1b3')]['hasMany'](db[_0x3071('0xb7')],{'as':_0x3071('0x1a9'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b3')][_0x3071('0x10c')](db[_0x3071('0xb7')],{'as':_0x3071('0x1a3'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b3')][_0x3071('0x13e')](db[_0x3071('0xb5')],{'as':'Account','foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b3')]['belongsToMany'](db['Tag'],{'through':_0x3071('0x1b4')});db[_0x3071('0xb7')][_0x3071('0x10c')](db[_0x3071('0xb7')],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xb7')][_0x3071('0x10c')](db[_0x3071('0xb7')],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xb7')][_0x3071('0x10c')](db['ZendeskField'],{'as':_0x3071('0x1ad'),'foreignKey':'FieldId'});db[_0x3071('0xb7')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':'Variable','foreignKey':_0x3071('0x1ae')});db[_0x3071('0xb9')][_0x3071('0x10c')](db[_0x3071('0xba')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3071('0x1a6')});db[_0x3071('0xba')][_0x3071('0x10c')](db['FreshdeskField'],{'as':_0x3071('0x1a7'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xba')][_0x3071('0x10c')](db['FreshdeskField'],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':'DescriptionId'});db[_0x3071('0xba')][_0x3071('0x10c')](db[_0x3071('0xbc')],{'as':_0x3071('0x1a3'),'onDelete':_0x3071('0x109'),'foreignKey':'FieldId'});db[_0x3071('0xba')][_0x3071('0x13e')](db['FreshdeskAccount'],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xba')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x3071('0x10c')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xbc')][_0x3071('0x10c')](db['FreshdeskField'],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xbc')][_0x3071('0x10c')](db[_0x3071('0xbc')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xbc')]['belongsTo'](db[_0x3071('0x96')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3071('0x1b5')][_0x3071('0x10c')](db[_0x3071('0x1b6')],{'as':_0x3071('0x1a5'),'onDelete':'cascade','foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b6')][_0x3071('0x10c')](db[_0x3071('0xc0')],{'as':_0x3071('0x1a7'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b6')][_0x3071('0x10c')](db[_0x3071('0xc0')],{'as':_0x3071('0x1a9'),'foreignKey':'DescriptionId'});db[_0x3071('0x1b6')][_0x3071('0x10c')](db[_0x3071('0xc0')],{'as':'Fields','foreignKey':_0x3071('0x1ab')});db['VtigerConfiguration'][_0x3071('0x13e')](db[_0x3071('0x1b5')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db[_0x3071('0xc0')][_0x3071('0x10c')](db['VtigerField'],{'as':_0x3071('0x1af'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xc0')]['hasMany'](db[_0x3071('0xc0')],{'as':'Description','foreignKey':_0x3071('0x1aa')});db[_0x3071('0xc0')][_0x3071('0x10c')](db['VtigerField'],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db['VtigerField'][_0x3071('0x13e')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x3071('0xc2')][_0x3071('0x10c')](db[_0x3071('0xc4')],{'as':'Configurations','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xc4')][_0x3071('0x10c')](db[_0x3071('0x1b7')],{'as':_0x3071('0x1a7'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xc4')][_0x3071('0x10c')](db['ServicenowField'],{'as':_0x3071('0x1a9'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xc4')][_0x3071('0x10c')](db['ServicenowField'],{'as':_0x3071('0x1a3'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xc4')]['belongsTo'](db[_0x3071('0xc2')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db[_0x3071('0x1b7')][_0x3071('0x10c')](db[_0x3071('0x1b7')],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b7')][_0x3071('0x10c')](db['ServicenowField'],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b7')][_0x3071('0x10c')](db[_0x3071('0x1b7')],{'as':'Field','foreignKey':'FieldId'});db[_0x3071('0x1b7')]['belongsTo'](db[_0x3071('0x96')],{'as':'Variable','foreignKey':_0x3071('0x1ae')});db[_0x3071('0x1b8')]['hasMany'](db[_0x3071('0x1b9')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b9')][_0x3071('0x10c')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b9')]['hasMany'](db[_0x3071('0xc7')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b9')]['hasMany'](db[_0x3071('0xc7')],{'as':_0x3071('0x1a3'),'onDelete':'cascade','foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b9')][_0x3071('0x13e')](db[_0x3071('0x1b8')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x3071('0x10c')](db[_0x3071('0xc7')],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db[_0x3071('0xc7')][_0x3071('0x10c')](db[_0x3071('0xc7')],{'as':_0x3071('0x1ac'),'foreignKey':'DescriptionId'});db[_0x3071('0xc7')][_0x3071('0x10c')](db[_0x3071('0xc7')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xc7')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':'Variable','foreignKey':_0x3071('0x1ae')});db[_0x3071('0x1ba')]['hasMany'](db[_0x3071('0xc9')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x3071('0x10c')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xc9')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1a9'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xc9')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x3071('0x13e')](db[_0x3071('0x1ba')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db[_0x3071('0x1bb')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db[_0x3071('0x1bb')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1ac'),'foreignKey':'DescriptionId'});db[_0x3071('0x1bb')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1bb')][_0x3071('0x13e')](db['Variable'],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db['ChatQueueReport']['belongsTo'](db[_0x3071('0x63')],{});db[_0x3071('0xce')]['belongsTo'](db['CmList'],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xce')]['belongsTo'](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0xce')][_0x3071('0x13e')](db['ChatInteraction'],{});db[_0x3071('0xce')][_0x3071('0x13e')](db[_0x3071('0x180')],{});db[_0x3071('0xce')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0xce')]['belongsTo'](db[_0x3071('0x6d')],{});db[_0x3071('0xcf')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1bc')});db['ChatInternalMessage'][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1bd')});db[_0x3071('0x13c')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x3071('0x1be'),'onDelete':'cascade'});db[_0x3071('0x13c')][_0x3071('0x10c')](db[_0x3071('0xd1')],{'foreignKey':_0x3071('0x1be'),'onDelete':'cascade'});db[_0x3071('0xd4')]['belongsTo'](db['SmsAccount'],{});db[_0x3071('0xd4')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xd4')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db['SmsQueueReport'][_0x3071('0x13e')](db[_0x3071('0x56')],{});db['SmsQueueReport'][_0x3071('0x13e')](db['SmsMessage'],{});db[_0x3071('0xd4')][_0x3071('0x13e')](db['User'],{});db[_0x3071('0xd4')][_0x3071('0x13e')](db[_0x3071('0x129')],{});db[_0x3071('0x1bf')][_0x3071('0x10c')](db[_0x3071('0x13c')],{'foreignKey':_0x3071('0x1c0')});db[_0x3071('0x1bf')]['hasMany'](db[_0x3071('0x1c1')],{'foreignKey':'ProjectId'});db[_0x3071('0x1bf')][_0x3071('0x10c')](db[_0x3071('0xd1')],{'foreignKey':_0x3071('0x1c0')});db[_0x3071('0x136')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':_0x3071('0x1c2')});db['Team'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x11e')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x124')],{'through':_0x3071('0x146'),'as':_0x3071('0x125')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x41')],{'through':_0x3071('0x157'),'as':_0x3071('0x126')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x6d')],{'through':'team_has_chat_queues','as':_0x3071('0x127')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x52')],{'through':'team_has_fax_queues','as':_0x3071('0x128')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x129')],{'through':_0x3071('0x174'),'as':'SmsQueues'});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x61')],{'through':_0x3071('0x17a'),'as':_0x3071('0x12a')});db['Team'][_0x3071('0x119')](db[_0x3071('0x101')],{'through':_0x3071('0x1c3'),'as':_0x3071('0x12b')});db[_0x3071('0xe0')][_0x3071('0x119')](db['VoicePrefix'],{'through':_0x3071('0x1c4'),'as':_0x3071('0x1c5')});db['Campaign'][_0x3071('0x10c')](db['CmHopper'],{'as':_0x3071('0x1c6'),'foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':'HopperFinals','foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':'HopperHistories','foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')][_0x3071('0x10c')](db[_0x3071('0x76')],{'as':'HopperBlacks','foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')]['belongsTo'](db[_0x3071('0x2c')],{'as':_0x3071('0x2c'),'foreignKey':_0x3071('0x1c7')});db['Campaign'][_0x3071('0x13e')](db[_0x3071('0x2c')],{'as':_0x3071('0x13f'),'foreignKey':_0x3071('0x140')});db[_0x3071('0xe4')][_0x3071('0x13e')](db[_0x3071('0x88')],{'as':_0x3071('0x88'),'foreignKey':_0x3071('0x141')});db['Campaign']['belongsTo'](db[_0x3071('0x136')],{'as':'SquareProject','foreignKey':_0x3071('0x1c8')});db[_0x3071('0xe4')]['belongsToMany'](db[_0x3071('0xf2')],{'as':_0x3071('0x11c'),'through':_0x3071('0x1c9')});db[_0x3071('0xe4')]['belongsToMany'](db[_0x3071('0xf2')],{'as':_0x3071('0x147'),'through':'campaigns_has_cm_blacklists'});db[_0x3071('0xe8')][_0x3071('0x13e')](db[_0x3071('0x6b')],{'as':_0x3071('0x6b'),'foreignKey':_0x3071('0x160')});db[_0x3071('0x1ca')]['belongsTo'](db['MailMessage'],{});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x44')],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0x3071('0x1cb'),'as':'FromAccount'});db['MailTransferReport']['belongsTo'](db[_0x3071('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x41')],{'foreignKey':'ToMailQueueId','as':_0x3071('0x1ce')});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x150')],{'foreignKey':_0x3071('0x1cf'),'as':_0x3071('0x1d0')});db[_0x3071('0xeb')][_0x3071('0x13e')](db['ChatMessage'],{});db['ChatTransferReport'][_0x3071('0x13e')](db['ChatInteraction'],{});db[_0x3071('0xeb')][_0x3071('0x13e')](db[_0x3071('0x63')],{'foreignKey':'FromChatWebsiteId','as':_0x3071('0x1d1')});db[_0x3071('0xeb')][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':'FromUserId','as':_0x3071('0x1d2')});db[_0x3071('0xeb')]['belongsTo'](db[_0x3071('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3071('0xeb')][_0x3071('0x13e')](db[_0x3071('0x6d')],{'foreignKey':_0x3071('0x1d3'),'as':_0x3071('0x1ce')});db['ChatTransferReport'][_0x3071('0x13e')](db[_0x3071('0x63')],{'foreignKey':_0x3071('0x1d4'),'as':'ToAccount'});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x169')],{});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x4f')],{});db['FaxTransferReport']['belongsTo'](db[_0x3071('0x4b')],{'foreignKey':_0x3071('0x1d5'),'as':'FromAccount'});db['FaxTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':'FromUserId','as':_0x3071('0x1d2')});db['FaxTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x52')],{'foreignKey':_0x3071('0x1d6'),'as':_0x3071('0x1ce')});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x4b')],{'foreignKey':_0x3071('0x1d7'),'as':'ToAccount'});db['OpenchannelTransferReport']['belongsTo'](db[_0x3071('0x5f')],{});db[_0x3071('0xef')][_0x3071('0x13e')](db['OpenchannelInteraction'],{});db[_0x3071('0xef')][_0x3071('0x13e')](db[_0x3071('0x5a')],{'foreignKey':_0x3071('0x1d8'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1d9'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':'ToUserId','as':_0x3071('0x1cd')});db['OpenchannelTransferReport'][_0x3071('0x13e')](db[_0x3071('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0x3071('0x1ce')});db[_0x3071('0xef')][_0x3071('0x13e')](db['OpenchannelAccount'],{'foreignKey':_0x3071('0x1da'),'as':_0x3071('0x1d0')});db['SmsTransferReport'][_0x3071('0x13e')](db[_0x3071('0x57')],{});db[_0x3071('0x1db')][_0x3071('0x13e')](db['SmsInteraction'],{});db[_0x3071('0x1db')][_0x3071('0x13e')](db[_0x3071('0x132')],{'foreignKey':'FromSmsAccountId','as':_0x3071('0x1d1')});db['SmsTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1d9'),'as':_0x3071('0x1d2')});db[_0x3071('0x1db')][_0x3071('0x13e')](db['User'],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db['SmsTransferReport'][_0x3071('0x13e')](db[_0x3071('0x129')],{'foreignKey':'ToSmsQueueId','as':_0x3071('0x1ce')});db[_0x3071('0x1db')]['belongsTo'](db[_0x3071('0x132')],{'foreignKey':_0x3071('0x1dc'),'as':_0x3071('0x1d0')});db['CmList'][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db[_0x3071('0xf2')][_0x3071('0x10c')](db['CmCustomField'],{'as':_0x3071('0x1dd'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')]['hasMany'](db['CmContact'],{'as':_0x3071('0x187'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':'ListId'});db[_0x3071('0xf2')][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':_0x3071('0x110'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')][_0x3071('0x10c')](db[_0x3071('0x7a')],{'as':_0x3071('0x7a'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')]['belongsToMany'](db[_0x3071('0x124')],{'as':_0x3071('0x1de'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0x3071('0x119')](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x11d')});db[_0x3071('0xf3')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x10e'),'onDelete':_0x3071('0x109')});db['VoicePrefix'][_0x3071('0x119')](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x106')});db[_0x3071('0xf3')][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x1c4'),'as':_0x3071('0x145')});db[_0x3071('0x118')][_0x3071('0x10c')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'foreignKey':_0x3071('0x1df')});db[_0x3071('0x118')][_0x3071('0x10c')](db[_0x3071('0x1e0')],{'as':_0x3071('0x1e1'),'foreignKey':_0x3071('0x1df'),'onDelete':'cascade'});db[_0x3071('0x1e0')][_0x3071('0x10c')](db[_0x3071('0xf6')],{'as':_0x3071('0x1e2'),'foreignKey':_0x3071('0x1e3'),'onDelete':_0x3071('0x109')});db[_0x3071('0x1e4')]['hasMany'](db['Disposition'],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x1e5'),'onDelete':'cascade'});db[_0x3071('0x1e4')][_0x3071('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db[_0x3071('0xfd')],{'as':_0x3071('0x148'),'foreignKey':'WhatsappAccountId'});db[_0x3071('0x1e4')][_0x3071('0x10c')](db[_0x3071('0xfc')],{'as':_0x3071('0x155')});db[_0x3071('0x1e4')][_0x3071('0x10c')](db[_0x3071('0xfb')],{'as':_0x3071('0x166')});db[_0x3071('0x1e4')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db[_0x3071('0x1e4')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':_0x3071('0x168')});db['WhatsappAccount'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x1e6')});db[_0x3071('0xfb')]['belongsTo'](db['User'],{'onDelete':_0x3071('0x161')});db['WhatsappApplication']['belongsTo'](db[_0x3071('0x101')],{'onDelete':'restrict'});db[_0x3071('0xfb')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'onDelete':_0x3071('0x161')});db[_0x3071('0xfb')][_0x3071('0x13e')](db[_0x3071('0x88')],{'onDelete':'restrict','foreignKey':_0x3071('0x141')});db[_0x3071('0xfb')][_0x3071('0x13e')](db['Tag'],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x162')});db[_0x3071('0xfc')][_0x3071('0x10c')](db[_0x3071('0xfd')],{'as':'Messages','onDelete':_0x3071('0x109'),'foreignKey':'WhatsappInteractionId'});db[_0x3071('0xfc')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1e5')});db[_0x3071('0xfc')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0xfc')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0xfc')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x19e'),'as':'Tags'});db[_0x3071('0xfc')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x19e'),'as':'ThroughTags'});db[_0x3071('0xfc')]['belongsToMany'](db[_0x3071('0x13')],{'as':'Users','through':_0x3071('0x123'),'foreignKey':_0x3071('0x1e7')});db[_0x3071('0xfd')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x13')});db[_0x3071('0xfd')]['belongsTo'](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':'Contact'});db[_0x3071('0xfd')][_0x3071('0x13e')](db[_0x3071('0xfc')],{'onDelete':_0x3071('0x109'),'as':'Interaction','foreignKey':_0x3071('0x1e7')});db[_0x3071('0xfd')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1e5')});db['WhatsappQueueReport'][_0x3071('0x13e')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db[_0x3071('0x1e8')][_0x3071('0x13e')](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x1e8')][_0x3071('0x13e')](db[_0x3071('0xfc')],{});db[_0x3071('0x1e8')][_0x3071('0x13e')](db['WhatsappQueue'],{});db[_0x3071('0x1e8')][_0x3071('0x13e')](db[_0x3071('0xfd')],{});db[_0x3071('0x1e8')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0x100')]['belongsTo'](db['WhatsappMessage'],{});db[_0x3071('0x100')][_0x3071('0x13e')](db[_0x3071('0xfc')],{});db[_0x3071('0x100')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'foreignKey':_0x3071('0x1e9'),'as':_0x3071('0x1d1')});db['WhatsappTransferReport'][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'foreignKey':_0x3071('0x1ea'),'as':'ToAccount'});db[_0x3071('0x100')][_0x3071('0x13e')](db[_0x3071('0x101')],{'foreignKey':_0x3071('0x1eb'),'as':_0x3071('0x1ce')});db[_0x3071('0x100')][_0x3071('0x13e')](db['User'],{'foreignKey':_0x3071('0x1d9'),'as':_0x3071('0x1d2')});db[_0x3071('0x100')][_0x3071('0x13e')](db['User'],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db['WhatsappQueue'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x3c'),'foreignKey':_0x3071('0x1ec')});db[_0x3071('0x101')][_0x3071('0x119')](db['Team'],{'through':_0x3071('0x1c3'),'as':_0x3071('0x145')});module[_0x3071('0x1ed')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 9d31609..4c4c67f 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe565=['./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/authLocal','/api/auth/google','./api/jira','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','/apidoc','static','root','/www','join','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','username','password','newPassword','apiKey','lastName','street','phone','mobile','fax','email','clientId','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','accountSid','registry','oldPassword','length','isString','replace','@@{','}@@','path','express','util','api','auth','./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','url','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./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/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages'];(function(_0x261db1,_0x31f749){var _0x255257=function(_0x5d48ec){while(--_0x5d48ec){_0x261db1['push'](_0x261db1['shift']());}};_0x255257(++_0x31f749);}(_0xe565,0x1b2));var _0x5e56=function(_0x4bd27a,_0x2de426){_0x4bd27a=_0x4bd27a-0x0;var _0x351943=_0xe565[_0x4bd27a];return _0x351943;};'use strict';var _=require('lodash');var path=require(_0x5e56('0x0'));var express=require(_0x5e56('0x1'));var ewinston=require('express-winston');var util=require(_0x5e56('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require('./config/logger')(_0x5e56('0x3'));var authLogger=require('./config/logger')(_0x5e56('0x4'));var safeTemplate=require(_0x5e56('0x5'))[_0x5e56('0x6')];exports[_0x5e56('0x7')]=function(_0x38c879){_0x38c879[_0x5e56('0x8')](ewinston[_0x5e56('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1f4c33,_0x485738){var _0x319cc4=_0x5e56('0xa');if(!_[_0x5e56('0xb')](_0x1f4c33[_0x5e56('0xc')])){_0x319cc4+=_0x5e56('0xd');var _0x269226=_0x1f4c33['body'];maskSensitiveData(_0x269226);}return safeTemplate(util[_0x5e56('0xe')](_0x319cc4,_0x1f4c33[_0x5e56('0xf')],_0x1f4c33['headers'][_0x5e56('0x10')]?_0x1f4c33[_0x5e56('0x11')][_0x5e56('0x10')]:_0x1f4c33['connection']['remoteAddress']||_0x1f4c33['ip'],_0x1f4c33[_0x5e56('0x12')],_0x485738['statusCode'],_0x485738[_0x5e56('0x13')],_0x1f4c33['user']?_0x1f4c33['user']['id']:null,_0x1f4c33[_0x5e56('0x14')]?_0x1f4c33[_0x5e56('0x14')][_0x5e56('0x15')]:null,_0x1f4c33[_0x5e56('0x14')]?_0x1f4c33['user'][_0x5e56('0x16')]:null,_0x269226?util[_0x5e56('0x17')](_0x269226,![],null):''));}}));_0x38c879[_0x5e56('0x8')](ewinston[_0x5e56('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5ede2c,_0x39671b){var _0x184b1a=_0x5e56('0x18');if(_0x5ede2c['body']&&_0x5ede2c[_0x5e56('0xc')]['device']&&_0x5ede2c[_0x5e56('0xc')][_0x5e56('0x19')]){_0x184b1a=_0x5e56('0x1a');}return util[_0x5e56('0xe')](_0x184b1a,_0x5ede2c[_0x5e56('0xf')],_0x5ede2c['headers']['x-forwarded-for']?_0x5ede2c[_0x5e56('0x11')][_0x5e56('0x10')]:_0x5ede2c['connection'][_0x5e56('0x1b')]||_0x5ede2c['ip'],_0x5ede2c[_0x5e56('0x12')],_0x39671b['statusCode'],_0x39671b[_0x5e56('0x13')],_0x5ede2c[_0x5e56('0x14')]?_0x5ede2c['user']['id']:null,_0x5ede2c['user']?_0x5ede2c[_0x5e56('0x14')][_0x5e56('0x15')]:null,_0x5ede2c[_0x5e56('0x14')]?_0x5ede2c[_0x5e56('0x14')][_0x5e56('0x16')]:null,_0x5ede2c['body']&&_0x5ede2c[_0x5e56('0xc')][_0x5e56('0x1c')]?_0x5ede2c[_0x5e56('0xc')][_0x5e56('0x1c')]:_0x5e56('0x1d'),_0x5ede2c['body']&&_0x5ede2c[_0x5e56('0xc')]['agent_id']?_0x5ede2c[_0x5e56('0xc')]['agent_id']:'',_0x5ede2c[_0x5e56('0xc')]&&_0x5ede2c['body'][_0x5e56('0x1e')]?_0x5ede2c[_0x5e56('0xc')][_0x5e56('0x1e')]:'');},'ignoreRoute':function(_0x2c8b81){var _0x3d418e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3d418e[_0x5e56('0x1f')](_0x2c8b81[_0x5e56('0x12')]);}}));_0x38c879[_0x5e56('0x8')](_0x5e56('0x20'),require(_0x5e56('0x21')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x22'),require(_0x5e56('0x23')));_0x38c879[_0x5e56('0x8')]('/api/voice/contexts',require(_0x5e56('0x24')));_0x38c879[_0x5e56('0x8')]('/api/voice/extensions',require(_0x5e56('0x25')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x26'),require(_0x5e56('0x27')));_0x38c879[_0x5e56('0x8')]('/api/voice/queues',require('./api/voiceQueue'));_0x38c879[_0x5e56('0x8')]('/api/voice/recordings',require(_0x5e56('0x28')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x29'),require(_0x5e56('0x2a')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x2b'),require(_0x5e56('0x2c')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x2d'),require(_0x5e56('0x2e')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x2f'),require(_0x5e56('0x30')));_0x38c879['use'](_0x5e56('0x31'),require('./api/voiceDialReport'));_0x38c879[_0x5e56('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x32'),require(_0x5e56('0x33')));_0x38c879[_0x5e56('0x8')]('/api/members/reports',require('./api/memberReport'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x34'),require(_0x5e56('0x35')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x36'),require(_0x5e56('0x37')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x38'),require(_0x5e56('0x39')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x3a'),require('./api/mailAccount'));_0x38c879['use'](_0x5e56('0x3b'),require(_0x5e56('0x3c')));_0x38c879['use']('/api/mail/substatuses',require('./api/mailSubstatus'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x3d'),require(_0x5e56('0x3e')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x3f'),require(_0x5e56('0x40')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x41'),require(_0x5e56('0x42')));_0x38c879[_0x5e56('0x8')]('/api/mail/reports/queue',require(_0x5e56('0x43')));_0x38c879['use'](_0x5e56('0x44'),require(_0x5e56('0x45')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x46'),require(_0x5e56('0x47')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x48'),require(_0x5e56('0x49')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x4a'),require(_0x5e56('0x4b')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x4c'),require(_0x5e56('0x4d')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x4e'),require(_0x5e56('0x4f')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x50'),require('./api/faxQueue'));_0x38c879['use'](_0x5e56('0x51'),require(_0x5e56('0x52')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x53'),require('./api/smsAccount'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x54'),require(_0x5e56('0x55')));_0x38c879[_0x5e56('0x8')]('/api/sms/interactions',require(_0x5e56('0x56')));_0x38c879['use'](_0x5e56('0x57'),require(_0x5e56('0x58')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x59'),require(_0x5e56('0x5a')));_0x38c879[_0x5e56('0x8')]('/api/openchannel/accounts',require(_0x5e56('0x5b')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x5c'),require(_0x5e56('0x5d')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x5e'),require(_0x5e56('0x5f')));_0x38c879['use']('/api/openchannel/messages',require(_0x5e56('0x60')));_0x38c879['use'](_0x5e56('0x61'),require(_0x5e56('0x62')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x63'),require(_0x5e56('0x64')));_0x38c879[_0x5e56('0x8')]('/api/openchannel/reports/queue',require(_0x5e56('0x65')));_0x38c879['use'](_0x5e56('0x66'),require(_0x5e56('0x67')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x68'),require(_0x5e56('0x69')));_0x38c879['use']('/api/chat/messages',require(_0x5e56('0x6a')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x6b'),require(_0x5e56('0x6c')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x6d'),require(_0x5e56('0x6e')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x6f'),require(_0x5e56('0x70')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x71'),require(_0x5e56('0x72')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x73'),require(_0x5e56('0x74')));_0x38c879[_0x5e56('0x8')]('/api/cm/contacts',require(_0x5e56('0x75')));_0x38c879[_0x5e56('0x8')]('/api/cm/hopper',require(_0x5e56('0x76')));_0x38c879[_0x5e56('0x8')]('/api/cm/hopper_black',require(_0x5e56('0x77')));_0x38c879[_0x5e56('0x8')]('/api/cm/hopper_final',require(_0x5e56('0x78')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x79'),require(_0x5e56('0x7a')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x7b'),require(_0x5e56('0x7c')));_0x38c879['use'](_0x5e56('0x7d'),require(_0x5e56('0x7e')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x7f'),require(_0x5e56('0x80')));_0x38c879[_0x5e56('0x8')]('/api/canned_answers',require(_0x5e56('0x81')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x82'),require('./api/disposition'));_0x38c879[_0x5e56('0x8')]('/api/conditions',require(_0x5e56('0x83')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x84'),require(_0x5e56('0x85')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x86'),require(_0x5e56('0x87')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x88'),require(_0x5e56('0x89')));_0x38c879[_0x5e56('0x8')]('/api/voiceQueuesLog',require(_0x5e56('0x8a')));_0x38c879['use']('/api/schedules',require(_0x5e56('0x8b')));_0x38c879['use'](_0x5e56('0x8c'),require(_0x5e56('0x8d')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x8e'),require('./api/tag'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x8f'),require(_0x5e56('0x90')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x91'),require(_0x5e56('0x92')));_0x38c879[_0x5e56('0x8')]('/api/variables',require(_0x5e56('0x93')));_0x38c879['use'](_0x5e56('0x94'),require(_0x5e56('0x95')));_0x38c879['use']('/api/integrations/reports',require('./api/integrationReport'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x96'),require(_0x5e56('0x97')));_0x38c879['use'](_0x5e56('0x98'),require(_0x5e56('0x99')));_0x38c879[_0x5e56('0x8')]('/api/analytics/extracted_reports',require(_0x5e56('0x9a')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x9b'),require(_0x5e56('0x9c')));_0x38c879['use'](_0x5e56('0x9d'),require(_0x5e56('0x9e')));_0x38c879[_0x5e56('0x8')]('/api/analytics/tree_reports',require(_0x5e56('0x9f')));_0x38c879['use']('/api/integrations/salesforce/accounts',require(_0x5e56('0xa0')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xa1'),require(_0x5e56('0xa2')));_0x38c879['use'](_0x5e56('0xa3'),require(_0x5e56('0xa4')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xa5'),require(_0x5e56('0xa6')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xa7'),require(_0x5e56('0xa8')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xa9'),require(_0x5e56('0xaa')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xab'),require(_0x5e56('0xac')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xad'),require(_0x5e56('0xae')));_0x38c879['use'](_0x5e56('0xaf'),require('./api/intDeskField'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xb0'),require('./api/intZohoAccount'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xb1'),require('./api/intZohoConfiguration'));_0x38c879['use']('/api/integrations/zoho/fields',require(_0x5e56('0xb2')));_0x38c879[_0x5e56('0x8')]('/api/integrations/zendesk/accounts',require(_0x5e56('0xb3')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xb4'),require(_0x5e56('0xb5')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xb6'),require('./api/intZendeskField'));_0x38c879[_0x5e56('0x8')]('/api/integrations/freshdesk/accounts',require(_0x5e56('0xb7')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xb8'),require(_0x5e56('0xb9')));_0x38c879['use'](_0x5e56('0xba'),require(_0x5e56('0xbb')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xbc'),require('./api/intVtigerAccount'));_0x38c879['use'](_0x5e56('0xbd'),require(_0x5e56('0xbe')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xbf'),require(_0x5e56('0xc0')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xc1'),require(_0x5e56('0xc2')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xc3'),require(_0x5e56('0xc4')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xc5'),require(_0x5e56('0xc6')));_0x38c879['use'](_0x5e56('0xc7'),require(_0x5e56('0xc8')));_0x38c879['use'](_0x5e56('0xc9'),require(_0x5e56('0xca')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xcb'),require('./api/intDynamics365Field'));_0x38c879[_0x5e56('0x8')]('/api/integrations/freshsales/accounts',require(_0x5e56('0xcc')));_0x38c879[_0x5e56('0x8')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xcd'),require(_0x5e56('0xce')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xcf'),require(_0x5e56('0xd0')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xd1'),require(_0x5e56('0xd2')));_0x38c879['use'](_0x5e56('0xd3'),require(_0x5e56('0xd4')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xd5'),require(_0x5e56('0xd6')));_0x38c879['use'](_0x5e56('0xd7'),require(_0x5e56('0xd8')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xd9'),require('./api/jscriptySessionReport'));_0x38c879['use'](_0x5e56('0xda'),require('./api/smsQueueReport'));_0x38c879[_0x5e56('0x8')]('/api/square/reports',require('./api/squareReport'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xdb'),require(_0x5e56('0xdc')));_0x38c879['use']('/api/jscripty/projects',require(_0x5e56('0xdd')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xde'),require(_0x5e56('0xdf')));_0x38c879['use'](_0x5e56('0xe0'),require(_0x5e56('0xe1')));_0x38c879['use']('/api/square/projects',require(_0x5e56('0xe2')));_0x38c879['use'](_0x5e56('0xe3'),require('./api/squareRecording'));_0x38c879[_0x5e56('0x8')]('/api/square/messages',require(_0x5e56('0xe4')));_0x38c879[_0x5e56('0x8')]('/api/teams',require(_0x5e56('0xe5')));_0x38c879['use'](_0x5e56('0xe6'),require(_0x5e56('0xe7')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xe8'),require('./api/campaign'));_0x38c879[_0x5e56('0x8')]('/api/migrations',require('./api/migration'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xe9'),require(_0x5e56('0xea')));_0x38c879['use'](_0x5e56('0xeb'),require(_0x5e56('0xec')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xed'),require(_0x5e56('0xee')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xef'),require(_0x5e56('0xf0')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xf1'),require(_0x5e56('0xf2')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xf3'),require('./api/openchannelTransferReport'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xf4'),require(_0x5e56('0xf5')));_0x38c879[_0x5e56('0x8')]('/api/cm/lists',require(_0x5e56('0xf6')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xf7'),require(_0x5e56('0xf8')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xf9'),require('./api/userProfile'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xfa'),require('./api/userProfileSection'));_0x38c879[_0x5e56('0x8')]('/api/userProfile/resources',require(_0x5e56('0xfb')));_0x38c879[_0x5e56('0x8')]('/api/userNotifications',require('./api/userNotification'));_0x38c879[_0x5e56('0x8')](_0x5e56('0xfc'),require(_0x5e56('0xfd')));_0x38c879[_0x5e56('0x8')]('/api/whatsapp/applications',require(_0x5e56('0xfe')));_0x38c879[_0x5e56('0x8')](_0x5e56('0xff'),require(_0x5e56('0x100')));_0x38c879['use'](_0x5e56('0x101'),require(_0x5e56('0x102')));_0x38c879[_0x5e56('0x8')]('/api/whatsapp/reports/queue',require(_0x5e56('0x103')));_0x38c879[_0x5e56('0x8')]('/api/whatsapp/reports/transfer',require(_0x5e56('0x104')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x105'),require('./api/whatsappQueue'));_0x38c879[_0x5e56('0x8')](_0x5e56('0x106'),require(_0x5e56('0x107')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x108'),require(_0x5e56('0x109')));_0x38c879[_0x5e56('0x8')]('/api/auth/local',require(_0x5e56('0x10a')));_0x38c879['use'](_0x5e56('0x10b'),require('./api/authGoogle'));_0x38c879[_0x5e56('0x8')]('/api/jira',require(_0x5e56('0x10c')));_0x38c879[_0x5e56('0x8')]('/api/rpc',require('./api/rpc'));_0x38c879[_0x5e56('0x8')]('/api/version',require(_0x5e56('0x10d')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x10e'),require(_0x5e56('0x10f')));_0x38c879[_0x5e56('0x8')]('/api/pm2',require(_0x5e56('0x110')));_0x38c879['use'](_0x5e56('0x111'),require('./api/webbar'));_0x38c879['use'](_0x5e56('0x112'),express[_0x5e56('0x113')](path['join'](config[_0x5e56('0x114')],_0x5e56('0x112'))));_0x38c879['use'](_0x5e56('0x115'),express[_0x5e56('0x113')](path[_0x5e56('0x116')](config[_0x5e56('0x114')],'/www')));_0x38c879[_0x5e56('0x8')]('/demo',express[_0x5e56('0x113')](path[_0x5e56('0x116')](config['root'],'/demo')));_0x38c879[_0x5e56('0x8')](_0x5e56('0x117'),express[_0x5e56('0x113')](path[_0x5e56('0x116')](config[_0x5e56('0x114')],'snippet',_0x5e56('0x118'))));_0x38c879[_0x5e56('0x8')](_0x5e56('0x119'),express['static'](path[_0x5e56('0x116')](config[_0x5e56('0x114')],_0x5e56('0x11a'))));_0x38c879[_0x5e56('0x11b')](_0x5e56('0x11c'))[_0x5e56('0x11d')](errors[0x194]);_0x38c879[_0x5e56('0x11b')]('/*')['get'](function(_0x274416,_0x1932ff){_0x1932ff['sendFile'](path[_0x5e56('0x11e')](_0x38c879[_0x5e56('0x11d')](_0x5e56('0x11f'))+'/index.html'));});};var sensitiveFields=[_0x5e56('0x120'),_0x5e56('0x121'),_0x5e56('0x122'),_0x5e56('0x123'),'firstName',_0x5e56('0x124'),_0x5e56('0x125'),_0x5e56('0x126'),_0x5e56('0x127'),_0x5e56('0x128'),_0x5e56('0x129'),_0x5e56('0x12a'),'clientSecret',_0x5e56('0x12b'),_0x5e56('0x12c'),_0x5e56('0x12d'),_0x5e56('0x12e'),_0x5e56('0x12f'),_0x5e56('0x130'),_0x5e56('0x131'),_0x5e56('0x132'),'authToken',_0x5e56('0x133'),'consumerSecret',_0x5e56('0x134'),_0x5e56('0x135'),'calleridnum',_0x5e56('0x136'),_0x5e56('0x137'),_0x5e56('0x138'),'privateKey',_0x5e56('0x139'),_0x5e56('0x13a'),'key','user','pass',_0x5e56('0x13b'),'localstationid','dsn','secret',_0x5e56('0x13c'),_0x5e56('0x13d')];function maskSensitiveData(_0x488ae2){var _0x19f3ef=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x488ae2))return;for(var _0x4da1d7 in _0x488ae2){if(_['isArray'](_0x488ae2[_0x4da1d7])){for(var _0x2179db=0x0;_0x2179db<_0x488ae2[_0x4da1d7][_0x5e56('0x13e')];_0x2179db++){maskSensitiveData(_0x488ae2[_0x4da1d7][_0x2179db]);}}else if(_['isPlainObject'](_0x488ae2[_0x4da1d7])){maskSensitiveData(_0x488ae2[_0x4da1d7]);}else if(_[_0x5e56('0x13f')](_0x488ae2[_0x4da1d7])){_0x488ae2[_0x4da1d7]=_0x488ae2[_0x4da1d7][_0x5e56('0x140')](/{{{/g,_0x5e56('0x141'))['replace'](/}}}/g,_0x5e56('0x142'))[_0x5e56('0x140')](/{{/g,'@{')[_0x5e56('0x140')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x4da1d7)){_0x488ae2[_0x4da1d7]=_0x488ae2[_0x4da1d7]['replace'](_0x19f3ef,'*');}}}} \ No newline at end of file +var _0xf22c=['./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','securityToken','accessKey','token','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','safeTemplate','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','remoteAddress','url','statusCode','responseTime','user','role','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/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/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes'];(function(_0x504f55,_0xa8b85b){var _0xcf5e00=function(_0x4bb66b){while(--_0x4bb66b){_0x504f55['push'](_0x504f55['shift']());}};_0xcf5e00(++_0xa8b85b);}(_0xf22c,0x19f));var _0xcf22=function(_0x1b3e51,_0x47a4df){_0x1b3e51=_0x1b3e51-0x0;var _0x470c7d=_0xf22c[_0x1b3e51];return _0x470c7d;};'use strict';var _=require('lodash');var path=require('path');var express=require(_0xcf22('0x0'));var ewinston=require(_0xcf22('0x1'));var util=require(_0xcf22('0x2'));var errors=require(_0xcf22('0x3'));var config=require(_0xcf22('0x4'));var logger=require(_0xcf22('0x5'))(_0xcf22('0x6'));var authLogger=require(_0xcf22('0x5'))(_0xcf22('0x7'));var safeTemplate=require('./safe-template')[_0xcf22('0x8')];exports['default']=function(_0x18ba9f){_0x18ba9f[_0xcf22('0x9')](ewinston[_0xcf22('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x22f5a2,_0x3bb824){var _0x98cb6d=_0xcf22('0xb');if(!_[_0xcf22('0xc')](_0x22f5a2[_0xcf22('0xd')])){_0x98cb6d+=_0xcf22('0xe');var _0x7c1b19=_0x22f5a2[_0xcf22('0xd')];maskSensitiveData(_0x7c1b19);}return safeTemplate(util[_0xcf22('0xf')](_0x98cb6d,_0x22f5a2[_0xcf22('0x10')],_0x22f5a2[_0xcf22('0x11')][_0xcf22('0x12')]?_0x22f5a2[_0xcf22('0x11')][_0xcf22('0x12')]:_0x22f5a2[_0xcf22('0x13')][_0xcf22('0x14')]||_0x22f5a2['ip'],_0x22f5a2[_0xcf22('0x15')],_0x3bb824[_0xcf22('0x16')],_0x3bb824[_0xcf22('0x17')],_0x22f5a2[_0xcf22('0x18')]?_0x22f5a2[_0xcf22('0x18')]['id']:null,_0x22f5a2[_0xcf22('0x18')]?_0x22f5a2[_0xcf22('0x18')]['name']:null,_0x22f5a2[_0xcf22('0x18')]?_0x22f5a2[_0xcf22('0x18')][_0xcf22('0x19')]:null,_0x7c1b19?util[_0xcf22('0x1a')](_0x7c1b19,![],null):''));}}));_0x18ba9f['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xc3a33f,_0x596c62){var _0x5ad6db='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xc3a33f['body']&&_0xc3a33f[_0xcf22('0xd')][_0xcf22('0x1b')]&&_0xc3a33f[_0xcf22('0xd')][_0xcf22('0x1c')]){_0x5ad6db=_0xcf22('0x1d');}return util[_0xcf22('0xf')](_0x5ad6db,_0xc3a33f[_0xcf22('0x10')],_0xc3a33f[_0xcf22('0x11')][_0xcf22('0x12')]?_0xc3a33f['headers'][_0xcf22('0x12')]:_0xc3a33f['connection'][_0xcf22('0x14')]||_0xc3a33f['ip'],_0xc3a33f[_0xcf22('0x15')],_0x596c62['statusCode'],_0x596c62['responseTime'],_0xc3a33f[_0xcf22('0x18')]?_0xc3a33f[_0xcf22('0x18')]['id']:null,_0xc3a33f[_0xcf22('0x18')]?_0xc3a33f[_0xcf22('0x18')]['name']:null,_0xc3a33f['user']?_0xc3a33f[_0xcf22('0x18')]['role']:null,_0xc3a33f[_0xcf22('0xd')]&&_0xc3a33f[_0xcf22('0xd')][_0xcf22('0x1b')]?_0xc3a33f[_0xcf22('0xd')]['device']:_0xcf22('0x1e'),_0xc3a33f[_0xcf22('0xd')]&&_0xc3a33f[_0xcf22('0xd')][_0xcf22('0x1c')]?_0xc3a33f[_0xcf22('0xd')][_0xcf22('0x1c')]:'',_0xc3a33f[_0xcf22('0xd')]&&_0xc3a33f[_0xcf22('0xd')][_0xcf22('0x1f')]?_0xc3a33f['body'][_0xcf22('0x1f')]:'');},'ignoreRoute':function(_0x537078){var _0x2fecd1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2fecd1['test'](_0x537078['url']);}}));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x20'),require(_0xcf22('0x21')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x22'),require('./api/voiceChanSpy'));_0x18ba9f['use'](_0xcf22('0x23'),require(_0xcf22('0x24')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x25'),require('./api/voiceExtension'));_0x18ba9f['use'](_0xcf22('0x26'),require(_0xcf22('0x27')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x28'),require(_0xcf22('0x29')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x2a'),require(_0xcf22('0x2b')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x2c'),require(_0xcf22('0x2d')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x2e'),require(_0xcf22('0x2f')));_0x18ba9f['use'](_0xcf22('0x30'),require(_0xcf22('0x31')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x32'),require(_0xcf22('0x33')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x34'),require(_0xcf22('0x35')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x36'),require(_0xcf22('0x37')));_0x18ba9f['use'](_0xcf22('0x38'),require(_0xcf22('0x39')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x3a'),require(_0xcf22('0x3b')));_0x18ba9f['use'](_0xcf22('0x3c'),require(_0xcf22('0x3d')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x3e'),require(_0xcf22('0x3f')));_0x18ba9f[_0xcf22('0x9')]('/api/mail/out_servers',require(_0xcf22('0x40')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x41'),require(_0xcf22('0x42')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x43'),require('./api/mailQueue'));_0x18ba9f['use']('/api/mail/substatuses',require(_0xcf22('0x44')));_0x18ba9f[_0xcf22('0x9')]('/api/mail/interactions',require(_0xcf22('0x45')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x46'),require(_0xcf22('0x47')));_0x18ba9f['use'](_0xcf22('0x48'),require(_0xcf22('0x49')));_0x18ba9f['use'](_0xcf22('0x4a'),require(_0xcf22('0x4b')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x4c'),require('./api/dashboard'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x4d'),require(_0xcf22('0x4e')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x4f'),require(_0xcf22('0x50')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x51'),require(_0xcf22('0x52')));_0x18ba9f[_0xcf22('0x9')]('/api/fax/interactions',require('./api/faxInteraction'));_0x18ba9f['use']('/api/fax/messages',require(_0xcf22('0x53')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x54'),require('./api/faxQueue'));_0x18ba9f['use']('/api/fax/reports/queue',require(_0xcf22('0x55')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x56'),require(_0xcf22('0x57')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x58'),require(_0xcf22('0x59')));_0x18ba9f['use'](_0xcf22('0x5a'),require(_0xcf22('0x5b')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x5c'),require('./api/smsMessage'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x5d'),require(_0xcf22('0x5e')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x5f'),require('./api/openchannelAccount'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x60'),require(_0xcf22('0x61')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x62'),require(_0xcf22('0x63')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x64'),require(_0xcf22('0x65')));_0x18ba9f[_0xcf22('0x9')]('/api/openchannel/queues',require(_0xcf22('0x66')));_0x18ba9f['use'](_0xcf22('0x67'),require(_0xcf22('0x68')));_0x18ba9f['use'](_0xcf22('0x69'),require('./api/openchannelQueueReport'));_0x18ba9f[_0xcf22('0x9')]('/api/chat/applications',require(_0xcf22('0x6a')));_0x18ba9f[_0xcf22('0x9')]('/api/chat/interactions',require(_0xcf22('0x6b')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x6c'),require(_0xcf22('0x6d')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x6e'),require(_0xcf22('0x6f')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x70'),require(_0xcf22('0x71')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x72'),require(_0xcf22('0x73')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x74'),require(_0xcf22('0x75')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x76'),require(_0xcf22('0x77')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x78'),require('./api/cmContact'));_0x18ba9f['use'](_0xcf22('0x79'),require(_0xcf22('0x7a')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x7b'),require(_0xcf22('0x7c')));_0x18ba9f['use'](_0xcf22('0x7d'),require(_0xcf22('0x7e')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x7f'),require(_0xcf22('0x80')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x81'),require(_0xcf22('0x82')));_0x18ba9f[_0xcf22('0x9')]('/api/actions',require('./api/action'));_0x18ba9f['use']('/api/automations',require(_0xcf22('0x83')));_0x18ba9f[_0xcf22('0x9')]('/api/canned_answers',require(_0xcf22('0x84')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x85'),require(_0xcf22('0x86')));_0x18ba9f[_0xcf22('0x9')]('/api/conditions',require('./api/condition'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x87'),require(_0xcf22('0x88')));_0x18ba9f['use'](_0xcf22('0x89'),require(_0xcf22('0x8a')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x8b'),require(_0xcf22('0x8c')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x8d'),require(_0xcf22('0x8e')));_0x18ba9f[_0xcf22('0x9')]('/api/schedules',require(_0xcf22('0x8f')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x90'),require(_0xcf22('0x91')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x92'),require('./api/tag'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x93'),require(_0xcf22('0x94')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x95'),require(_0xcf22('0x96')));_0x18ba9f['use'](_0xcf22('0x97'),require(_0xcf22('0x98')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x99'),require(_0xcf22('0x9a')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x9b'),require('./api/integrationReport'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x9c'),require(_0xcf22('0x9d')));_0x18ba9f['use'](_0xcf22('0x9e'),require(_0xcf22('0x9f')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xa0'),require('./api/analyticExtractedReport'));_0x18ba9f['use']('/api/analytics/metrics',require(_0xcf22('0xa1')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xa2'),require(_0xcf22('0xa3')));_0x18ba9f['use'](_0xcf22('0xa4'),require(_0xcf22('0xa5')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xa6'),require('./api/intSalesforceAccount'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xa7'),require(_0xcf22('0xa8')));_0x18ba9f['use'](_0xcf22('0xa9'),require(_0xcf22('0xaa')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xab'),require(_0xcf22('0xac')));_0x18ba9f[_0xcf22('0x9')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xad'),require(_0xcf22('0xae')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xaf'),require(_0xcf22('0xb0')));_0x18ba9f[_0xcf22('0x9')]('/api/integrations/desk/configurations',require(_0xcf22('0xb1')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xb2'),require(_0xcf22('0xb3')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xb4'),require('./api/intZohoAccount'));_0x18ba9f['use']('/api/integrations/zoho/configurations',require(_0xcf22('0xb5')));_0x18ba9f['use'](_0xcf22('0xb6'),require(_0xcf22('0xb7')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xb8'),require('./api/intZendeskAccount'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xb9'),require('./api/intZendeskConfiguration'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xba'),require('./api/intZendeskField'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xbb'),require('./api/intFreshdeskAccount'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xbc'),require(_0xcf22('0xbd')));_0x18ba9f[_0xcf22('0x9')]('/api/integrations/freshdesk/fields',require(_0xcf22('0xbe')));_0x18ba9f[_0xcf22('0x9')]('/api/integrations/vtiger/accounts',require(_0xcf22('0xbf')));_0x18ba9f['use']('/api/integrations/vtiger/configurations',require(_0xcf22('0xc0')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xc1'),require(_0xcf22('0xc2')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xc3'),require('./api/intServicenowAccount'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xc4'),require(_0xcf22('0xc5')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xc6'),require('./api/intServicenowField'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xc7'),require(_0xcf22('0xc8')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xc9'),require(_0xcf22('0xca')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xcb'),require(_0xcf22('0xcc')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xcd'),require(_0xcf22('0xce')));_0x18ba9f[_0xcf22('0x9')]('/api/integrations/freshsales/configurations',require(_0xcf22('0xcf')));_0x18ba9f['use'](_0xcf22('0xd0'),require('./api/intFreshsalesField'));_0x18ba9f['use'](_0xcf22('0xd1'),require(_0xcf22('0xd2')));_0x18ba9f['use'](_0xcf22('0xd3'),require(_0xcf22('0xd4')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xd5'),require('./api/chatInternalMessage'));_0x18ba9f['use'](_0xcf22('0xd6'),require(_0xcf22('0xd7')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xd8'),require(_0xcf22('0xd9')));_0x18ba9f[_0xcf22('0x9')]('/api/jscripty/sessions/reports',require(_0xcf22('0xda')));_0x18ba9f['use'](_0xcf22('0xdb'),require(_0xcf22('0xdc')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xdd'),require(_0xcf22('0xde')));_0x18ba9f[_0xcf22('0x9')]('/api/square/details/reports',require(_0xcf22('0xdf')));_0x18ba9f['use']('/api/jscripty/projects',require(_0xcf22('0xe0')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xe1'),require('./api/setting'));_0x18ba9f['use']('/api/square/odbc',require('./api/squareOdbc'));_0x18ba9f[_0xcf22('0x9')]('/api/square/projects',require('./api/squareProject'));_0x18ba9f[_0xcf22('0x9')]('/api/square/recordings',require(_0xcf22('0xe2')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xe3'),require('./api/squareMessage'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xe4'),require(_0xcf22('0xe5')));_0x18ba9f['use'](_0xcf22('0xe6'),require(_0xcf22('0xe7')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xe8'),require(_0xcf22('0xe9')));_0x18ba9f[_0xcf22('0x9')]('/api/migrations',require('./api/migration'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xea'),require(_0xcf22('0xeb')));_0x18ba9f['use'](_0xcf22('0xec'),require(_0xcf22('0xed')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xee'),require(_0xcf22('0xef')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xf0'),require('./api/chatTransferReport'));_0x18ba9f[_0xcf22('0x9')]('/api/fax/reports/transfer',require(_0xcf22('0xf1')));_0x18ba9f['use'](_0xcf22('0xf2'),require(_0xcf22('0xf3')));_0x18ba9f['use'](_0xcf22('0xf4'),require(_0xcf22('0xf5')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xf6'),require(_0xcf22('0xf7')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xf8'),require(_0xcf22('0xf9')));_0x18ba9f['use'](_0xcf22('0xfa'),require('./api/userProfile'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xfb'),require(_0xcf22('0xfc')));_0x18ba9f['use'](_0xcf22('0xfd'),require(_0xcf22('0xfe')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0xff'),require(_0xcf22('0x100')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x101'),require(_0xcf22('0x102')));_0x18ba9f[_0xcf22('0x9')]('/api/whatsapp/applications',require(_0xcf22('0x103')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x104'),require('./api/whatsappInteraction'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x105'),require(_0xcf22('0x106')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x107'),require('./api/whatsappQueueReport'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x108'),require(_0xcf22('0x109')));_0x18ba9f[_0xcf22('0x9')]('/api/whatsapp/queues',require(_0xcf22('0x10a')));_0x18ba9f['use'](_0xcf22('0x10b'),require('./api/cloudProvider'));_0x18ba9f[_0xcf22('0x9')]('/api/realtime',require('./api/realtime'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x10c'),require(_0xcf22('0x10d')));_0x18ba9f['use'](_0xcf22('0x10e'),require('./api/authGoogle'));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x10f'),require(_0xcf22('0x110')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x111'),require(_0xcf22('0x112')));_0x18ba9f['use'](_0xcf22('0x113'),require(_0xcf22('0x114')));_0x18ba9f['use'](_0xcf22('0x115'),require(_0xcf22('0x116')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x117'),require(_0xcf22('0x118')));_0x18ba9f['use']('/api/webbar',require('./api/webbar'));_0x18ba9f['use']('/apidoc',express[_0xcf22('0x119')](path[_0xcf22('0x11a')](config[_0xcf22('0x11b')],'/apidoc')));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x11c'),express['static'](path['join'](config[_0xcf22('0x11b')],'/www')));_0x18ba9f[_0xcf22('0x9')]('/demo',express['static'](path[_0xcf22('0x11a')](config[_0xcf22('0x11b')],_0xcf22('0x11d'))));_0x18ba9f[_0xcf22('0x9')](_0xcf22('0x11e'),express[_0xcf22('0x119')](path[_0xcf22('0x11a')](config[_0xcf22('0x11b')],_0xcf22('0x11f'),_0xcf22('0x120'))));_0x18ba9f[_0xcf22('0x9')]('/plugins',express[_0xcf22('0x119')](path['join'](config[_0xcf22('0x11b')],_0xcf22('0x121'))));_0x18ba9f[_0xcf22('0x122')](_0xcf22('0x123'))['get'](errors[0x194]);_0x18ba9f[_0xcf22('0x122')]('/*')[_0xcf22('0x124')](function(_0x3ff517,_0x103432){_0x103432[_0xcf22('0x125')](path['resolve'](_0x18ba9f[_0xcf22('0x124')](_0xcf22('0x126'))+_0xcf22('0x127')));});};var sensitiveFields=[_0xcf22('0x128'),_0xcf22('0x129'),_0xcf22('0x12a'),_0xcf22('0x12b'),_0xcf22('0x12c'),_0xcf22('0x12d'),_0xcf22('0x12e'),_0xcf22('0x12f'),_0xcf22('0x130'),_0xcf22('0x131'),'email','clientId','clientSecret',_0xcf22('0x132'),'code',_0xcf22('0x133'),'tenantId',_0xcf22('0x134'),'channelSecret',_0xcf22('0x135'),'accessTokenSecret',_0xcf22('0x136'),_0xcf22('0x137'),_0xcf22('0x138'),_0xcf22('0x139'),_0xcf22('0x13a'),_0xcf22('0x13b'),_0xcf22('0x13c'),'vidaooApiKey','clientEmail',_0xcf22('0x13d'),_0xcf22('0x13e'),_0xcf22('0x13f'),_0xcf22('0x140'),_0xcf22('0x18'),'pass',_0xcf22('0x141'),_0xcf22('0x142'),_0xcf22('0x143'),_0xcf22('0x144'),_0xcf22('0x145'),_0xcf22('0x146')];function maskSensitiveData(_0x2a149f){var _0x4ce481=/(?!^)[\s\S](?!$)/g;if(!_[_0xcf22('0x147')](_0x2a149f))return;for(var _0x4a0f06 in _0x2a149f){if(_[_0xcf22('0x148')](_0x2a149f[_0x4a0f06])){for(var _0x4dad83=0x0;_0x4dad83<_0x2a149f[_0x4a0f06][_0xcf22('0x149')];_0x4dad83++){maskSensitiveData(_0x2a149f[_0x4a0f06][_0x4dad83]);}}else if(_['isPlainObject'](_0x2a149f[_0x4a0f06])){maskSensitiveData(_0x2a149f[_0x4a0f06]);}else if(_[_0xcf22('0x14a')](_0x2a149f[_0x4a0f06])){_0x2a149f[_0x4a0f06]=_0x2a149f[_0x4a0f06][_0xcf22('0x14b')](/{{{/g,'@@{')[_0xcf22('0x14b')](/}}}/g,'}@@')[_0xcf22('0x14b')](/{{/g,'@{')[_0xcf22('0x14b')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x4a0f06)){_0x2a149f[_0x4a0f06]=_0x2a149f[_0x4a0f06][_0xcf22('0x14b')](_0x4ce481,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 37b7afb..b7a6278 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1d7=['../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../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/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.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/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc'];(function(_0x55a583,_0x13a474){var _0x232c16=function(_0x4dd914){while(--_0x4dd914){_0x55a583['push'](_0x55a583['shift']());}};_0x232c16(++_0x13a474);}(_0xd1d7,0x1d7));var _0x7d1d=function(_0x27ad3e,_0x15f1a8){_0x27ad3e=_0x27ad3e-0x0;var _0x1777bd=_0xd1d7[_0x27ad3e];return _0x1777bd;};'use strict';var jayson=require(_0x7d1d('0x0'));var BPromise=require(_0x7d1d('0x1'));var _=require(_0x7d1d('0x2'));var config=require(_0x7d1d('0x3'));exports[_0x7d1d('0x4')]=function(){return new BPromise(function(_0x506bdc,_0x444fad){var _0x3dbeae={};_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x6')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x7')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x8')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x9')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0xa')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0xb')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0xc')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/memberReport/memberReport.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0xd')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x3dbeae=_['merge'](_0x3dbeae,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0xe')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0xf')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x10')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/mailInteraction/mailInteraction.rpc'));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x11')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x12')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x13')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x14')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x15')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x16')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x17')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x18')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x19')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/smsAccount/smsAccount.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x1a')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/smsMessage/smsMessage.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x1b')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x1c')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x1d')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x1e')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x1f')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x20')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x21')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x22')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/cmContact/cmContact.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x23')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x24')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x25')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x26')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x27')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x28')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x29')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x2a')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x2b')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/trigger/trigger.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x2c')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x2d')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x2e')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x2f')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x30')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x31')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x32')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x33')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x34')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x35')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x36')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x37')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x38')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x39')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x3a')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require('../api/squareProject/squareProject.rpc'));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x3b')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x3c')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x3d')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x3e')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x3f')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x40')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x41')));_0x3dbeae=_['merge'](_0x3dbeae,require(_0x7d1d('0x42')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x43')));_0x3dbeae=_[_0x7d1d('0x5')](_0x3dbeae,require(_0x7d1d('0x44')));var _0x57ae0f=jayson[_0x7d1d('0x45')](_0x3dbeae)[_0x7d1d('0x46')]();var _0x30b30b=config[_0x7d1d('0x47')]['port']||config[_0x7d1d('0x48')]+0x1;var _0x4bba56=config[_0x7d1d('0x47')]['ip']||'localhost';_0x57ae0f['on'](_0x7d1d('0x49'),function(_0xc383bc){return _0x444fad(_0xc383bc);});_0x57ae0f[_0x7d1d('0x4')](_0x30b30b,_0x4bba56,function(){console[_0x7d1d('0x4a')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4bba56,_0x30b30b);require('../config/triggers')[_0x7d1d('0x4b')]();return _0x506bdc(_0x7d1d('0x4c')+_0x4bba56+':'+_0x30b30b);});});}; \ No newline at end of file +var _0x896a=['../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','lodash','../config/environment','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.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/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc'];(function(_0x5ef77a,_0x2777ca){var _0x12d23c=function(_0x4d9168){while(--_0x4d9168){_0x5ef77a['push'](_0x5ef77a['shift']());}};_0x12d23c(++_0x2777ca);}(_0x896a,0x168));var _0xa896=function(_0x4d3085,_0x5f2ff9){_0x4d3085=_0x4d3085-0x0;var _0x235649=_0x896a[_0x4d3085];return _0x235649;};'use strict';var jayson=require(_0xa896('0x0'));var BPromise=require(_0xa896('0x1'));var _=require(_0xa896('0x2'));var config=require(_0xa896('0x3'));exports['listen']=function(){return new BPromise(function(_0x58e31b,_0x34bc8d){var _0x2e4c03={};_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x4')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x5')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x7')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x8')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x9')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0xa')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0xb')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0xc')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0xd')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0xe')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0xf')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x10')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x11')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/mailAccount/mailAccount.rpc'));_0x2e4c03=_['merge'](_0x2e4c03,require('../api/mailQueue/mailQueue.rpc'));_0x2e4c03=_['merge'](_0x2e4c03,require('../api/mailInteraction/mailInteraction.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x12')));_0x2e4c03=_['merge'](_0x2e4c03,require('../api/mailApplication/mailApplication.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x13')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x14')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x15')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x16')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/faxMessage/faxMessage.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/faxQueue/faxQueue.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x17')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/smsInteraction/smsInteraction.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/smsMessage/smsMessage.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x18')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x19')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x1a')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x1b')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x1c')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x1d')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x1e')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x1f')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x20')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/cmHopper/cmHopper.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x21')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x22')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x23')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/pause/pause.rpc'));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x24')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/template/template.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x25')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x26')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x27')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x28')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x29')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x2a')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x2b')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x2c')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x2d')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x2e')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x2f')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x30')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x31')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x32')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x33')));_0x2e4c03=_['merge'](_0x2e4c03,require('../api/setting/setting.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/squareOdbc/squareOdbc.rpc'));_0x2e4c03=_['merge'](_0x2e4c03,require('../api/squareProject/squareProject.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x34')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/squareMessage/squareMessage.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/campaign/campaign.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x35')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x36')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require(_0xa896('0x37')));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x38')));_0x2e4c03=_[_0xa896('0x6')](_0x2e4c03,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x2e4c03=_['merge'](_0x2e4c03,require(_0xa896('0x39')));var _0x378b24=jayson[_0xa896('0x3a')](_0x2e4c03)[_0xa896('0x3b')]();var _0x18342e=config[_0xa896('0x3c')]['port']||config[_0xa896('0x3d')]+0x1;var _0x25344d=config[_0xa896('0x3c')]['ip']||_0xa896('0x3e');_0x378b24['on']('error',function(_0x60ca54){return _0x34bc8d(_0x60ca54);});_0x378b24[_0xa896('0x3f')](_0x18342e,_0x25344d,function(){console[_0xa896('0x40')](_0xa896('0x41'),_0x25344d,_0x18342e);require(_0xa896('0x42'))[_0xa896('0x43')]();return _0x58e31b('RPC\x20listening\x20on\x20'+_0x25344d+':'+_0x18342e);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index c7346f3..d6d2775 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a2=['exports','safeTemplate','lodash','\x20}\x20}','replace','map','isPlainObject','keys','reduce'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x7f105c,_0xc176d5){_0x7f105c=_0x7f105c-0x0;var _0x134c0e=_0xd4a2[_0x7f105c];return _0x134c0e;};var _=require(_0x2d4a('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5d70e1){return _0x5d70e1==='{{'?'{\x20{\x20':_0x2d4a('0x1');}function safeTemplate(_0x576ffe){var _0x2a8a71=_0x576ffe;if(typeof _0x576ffe==='string'){_0x2a8a71=_0x576ffe[_0x2d4a('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x576ffe)){_0x2a8a71=_0x576ffe[_0x2d4a('0x3')](function(_0x40d744){return safeTemplate(_0x40d744);});}else if(_[_0x2d4a('0x4')](_0x576ffe)){_0x2a8a71=Object[_0x2d4a('0x5')](_0x576ffe)[_0x2d4a('0x6')](function(_0x57058f,_0x45fefb){_0x57058f[_0x45fefb]=safeTemplate(_0x576ffe[_0x45fefb]);return _0x57058f;},{});}return _0x2a8a71;}module[_0x2d4a('0x7')][_0x2d4a('0x8')]=safeTemplate; \ No newline at end of file +var _0x7916=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','safeTemplate','lodash'];(function(_0x529a9a,_0x5c78da){var _0x275b9e=function(_0x1507f5){while(--_0x1507f5){_0x529a9a['push'](_0x529a9a['shift']());}};_0x275b9e(++_0x5c78da);}(_0x7916,0x128));var _0x6791=function(_0x45c320,_0x53aad1){_0x45c320=_0x45c320-0x0;var _0x285e5c=_0x7916[_0x45c320];return _0x285e5c;};var _=require(_0x6791('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5eaf3a){return _0x5eaf3a==='{{'?_0x6791('0x1'):_0x6791('0x2');}function safeTemplate(_0x4ca50a){var _0x325c54=_0x4ca50a;if(typeof _0x4ca50a===_0x6791('0x3')){_0x325c54=_0x4ca50a[_0x6791('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6791('0x5')](_0x4ca50a)){_0x325c54=_0x4ca50a['map'](function(_0xe98396){return safeTemplate(_0xe98396);});}else if(_['isPlainObject'](_0x4ca50a)){_0x325c54=Object[_0x6791('0x6')](_0x4ca50a)[_0x6791('0x7')](function(_0x5ad8c0,_0x8b85ff){_0x5ad8c0[_0x8b85ff]=safeTemplate(_0x4ca50a[_0x8b85ff]);return _0x5ad8c0;},{});}return _0x325c54;}module['exports'][_0x6791('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b03ac25..7c5604b 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 _0x18af=['substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','result=','substr','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','noop','label','exports','util','events','./reply','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup'];(function(_0x14735c,_0x56c131){var _0x44e4f4=function(_0x5d565f){while(--_0x5d565f){_0x14735c['push'](_0x14735c['shift']());}};_0x44e4f4(++_0x56c131);}(_0x18af,0x8b));var _0xf18a=function(_0x3ec0dd,_0x329fe6){_0x3ec0dd=_0x3ec0dd-0x0;var _0x3bfc11=_0x18af[_0x3ec0dd];return _0x3bfc11;};'use strict';var util=require(_0xf18a('0x0'));var _=require('lodash');var EventEmitter=require(_0xf18a('0x1'))['EventEmitter'];var AGIReply=require(_0xf18a('0x2'));var AGIError=require('./error');function AGIChannel(_0x51d620){var _0x512048=this,_0x45472b=new AGIReply(),_0x198ffd=![],_0x473d94={};EventEmitter[_0xf18a('0x3')](_0x512048);_0x51d620['setEncoding'](_0xf18a('0x4'));_0x51d620[_0xf18a('0x5')](0x8*0x3c*0x3c*0x3e8);_0x45472b[_0xf18a('0x6')]('utf8');_0x45472b['on'](_0xf18a('0x7'),function(_0x22c181){for(var _0x1499b4 in _0x22c181){_0x512048[_0x1499b4]=_0x22c181[_0x1499b4];}_0x512048[_0xf18a('0x8')](_0xf18a('0x9'));});_0x45472b['on'](_0xf18a('0xa'),function(_0xcafadb){if(_0xcafadb[_0xf18a('0xb')]()==_0xf18a('0xc')){_0x512048[_0xf18a('0x8')](_0xf18a('0xc'));return;}if(_0xcafadb[_0xf18a('0xd')](0x0,0xb)==_0xf18a('0xe')){_0x198ffd=!![];}if(_0x198ffd){_0x473d94['rx']+=_0xcafadb+'\x0a';if(_0xcafadb['search'](_0xf18a('0xf'))!=-0x1){_0x198ffd=![];}}else{_0x473d94['rx']=_0xcafadb;}if(_0x198ffd){return;}if(typeof _0x473d94['cb']==_0xf18a('0x10')){var _0x252333=_0x473d94['rx']['substring'](0x0,0x3),_0x12c907=null,_0x18901a=null;_0x252333=parseInt(_0x252333);if(isNaN(_0x252333)){_0x473d94['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf18a('0x11')});return;}if(_0x252333!=0xc8){_0x473d94['cb'](null,{'code':_0x252333,'result':-0x1,'extra':'KO'});return;}_0x12c907=_0x473d94['rx'][_0xf18a('0xd')](0x4)['replace'](_0xf18a('0x12'),'');if(_0x12c907['indexOf']('\x20')!=-0x1){_0x12c907=_0x12c907[_0xf18a('0x13')](0x0,_0x12c907[_0xf18a('0x14')]('\x20'));}if(_['startsWith'](_0x12c907,'-1')){_0x12c907=parseInt(_0x12c907);}_0x18901a=_0x473d94['rx'][_0xf18a('0x15')]('\x20');if(_0x18901a['length']==0x3){_0x18901a=_0x18901a[0x2][_0xf18a('0xd')](0x1,_0x18901a[0x2][_0xf18a('0x16')]-0x1);}else if(_0x18901a['length']>0x3){var _0x526bb7=/\((.+)\)/;var _0x2704de=_0x473d94['rx'][_0xf18a('0x17')](_0x526bb7);if(_0x2704de){_0x18901a=_0x2704de[0x1];}else{_0x18901a=null;}}else{_0x18901a=null;}_0x473d94['cb'](null,{'code':_0x252333,'result':_0x12c907,'extra':_0x18901a});}});_0x51d620['on']('error',function(_0x5e3da3){_0x512048[_0xf18a('0x8')](_0xf18a('0x18'),new AGIError(_0xf18a('0x19'),_0x5e3da3['code']));});_0x51d620['on'](_0xf18a('0x1a'),function(){_0x512048['emit'](_0xf18a('0x1a'),new AGIError(_0xf18a('0x1b')));});_0x51d620['on']('timeout',function(){_0x512048[_0xf18a('0x8')](_0xf18a('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x51d620[_0xf18a('0x1d')]();});_0x51d620[_0xf18a('0x1e')](_0x45472b);this[_0xf18a('0x1f')]=function(_0x5b0a02,_0x516e7f){var _0x5b0a02=_0x5b0a02||'',_0x516e7f=typeof _0x516e7f==_0xf18a('0x10')?_0x516e7f:new Function();_0x473d94={'tx':_0x5b0a02,'rx':'','cb':_0x516e7f};_0x51d620[_0xf18a('0x20')](_0x5b0a02+'\x0a');},this[_0xf18a('0x1a')]=function(){_0x51d620[_0xf18a('0x1d')]();};}util[_0xf18a('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xf18a('0x22')][_0xf18a('0x23')]=function(_0x56778f){return this[_0xf18a('0x1f')][_0xf18a('0x24')](this,_0x56778f);};AGIChannel[_0xf18a('0x22')][_0xf18a('0x25')]=function(){return this['sendRequest'](_0xf18a('0x26'));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x27')]=function(_0x4f540d,_0x265ccb,_0x40d6d3){_0x4f540d=_0x4f540d===undefined?_0xf18a('0x28'):_0x4f540d;_0x265ccb=_0x265ccb===undefined?'5':_0x265ccb;_0x40d6d3=_0x40d6d3===undefined?'1':_0x40d6d3;return this[_0xf18a('0x23')](util['format'](_0xf18a('0x29'),_0x4f540d,_0x265ccb*0x3e8,_0x40d6d3));};AGIChannel[_0xf18a('0x22')]['noop']=function(_0x49efea){_0x49efea=_0x49efea||_0xf18a('0x2a');return this[_0xf18a('0x23')](util[_0xf18a('0x2b')](_0xf18a('0x2c'),_0x49efea));};AGIChannel['prototype'][_0xf18a('0x2d')]=function(_0x40596f,_0x3a70a2){if(_[_0xf18a('0x2e')](_0x3a70a2)){return this[_0xf18a('0x23')](util[_0xf18a('0x2b')]('EXEC\x20%s\x20%s',_0x40596f,_0x3a70a2['join'](',')));}return this[_0xf18a('0x23')](util[_0xf18a('0x2b')](_0xf18a('0x2f'),_0x40596f,_0x3a70a2));};AGIChannel['prototype']['setContext']=function(_0x26fbde){return this[_0xf18a('0x23')](util[_0xf18a('0x2b')](_0xf18a('0x30'),_0x26fbde));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x31')]=function(_0x522474){return this[_0xf18a('0x23')](util[_0xf18a('0x2b')]('SET\x20EXTENSION\x20%s',_0x522474));};AGIChannel[_0xf18a('0x22')]['setPriority']=function(_0x44857f){return this[_0xf18a('0x23')](util['format']('SET\x20PRIORITY\x20%s',_0x44857f));};AGIChannel[_0xf18a('0x22')][_0xf18a('0xc')]=function(){return this[_0xf18a('0x23')](_0xf18a('0x32'));};AGIChannel['prototype'][_0xf18a('0x33')]=function(_0x44e19f,_0x5a3ccb){var _0x3e8b31=_[_0xf18a('0x34')](_0x5a3ccb)||_[_0xf18a('0x35')](_0x5a3ccb)?_0x5a3ccb['toString']():_0x5a3ccb;return this['sendRequest'](util[_0xf18a('0x2b')](_0xf18a('0x36'),_0x44e19f,_0x3e8b31?_0x3e8b31[_0xf18a('0x37')]()[_0xf18a('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x39')]=function(_0x7ef49d,_0x35c0e6){return this[_0xf18a('0x23')](util[_0xf18a('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x7ef49d,_0x35c0e6));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x3a')]=function(_0x5df534,_0x34dd7a){return this['sendRequest'](util[_0xf18a('0x2b')](_0xf18a('0x3b'),_0x5df534,_0x34dd7a));};AGIChannel[_0xf18a('0x22')]['sayPhonetic']=function(_0x366399,_0x3e8906){return this['sendRequest'](util[_0xf18a('0x2b')](_0xf18a('0x3c'),_0x366399,_0x3e8906));};AGIChannel[_0xf18a('0x22')]['continueAt']=function(_0x4dca63,_0x3a57d1,_0x222f22){_0x3a57d1=_0x3a57d1||this[_0xf18a('0x3d')];_0x222f22=_0x222f22||0x1;this['setContext'](_0x4dca63);this[_0xf18a('0x31')](_0x3a57d1);this[_0xf18a('0x3e')](_0x222f22);return this['noop'](util[_0xf18a('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x4dca63,_0x3a57d1,_0x222f22));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x3f')]=function(_0x356646){return this[_0xf18a('0x23')](util[_0xf18a('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x356646));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x40')]=function(_0x267863,_0x1ab7c3,_0x8cfb08,_0x3e2a3e,_0x2b0085,_0x48f37b){_0x1ab7c3=_0x1ab7c3||_0xf18a('0x41');_0x8cfb08=_0x8cfb08||'';_0x3e2a3e=_0x3e2a3e===undefined?-0x1:_0x3e2a3e==='-1'?-0x1:_0x3e2a3e*0x3e8;_0x2b0085=_0x2b0085===undefined?'':'s='+_0x2b0085;_0x48f37b=_0x48f37b?_0xf18a('0x42'):'';return this[_0xf18a('0x23')](util[_0xf18a('0x2b')](_0xf18a('0x43'),_0x267863,_0x1ab7c3,_0x8cfb08,_0x3e2a3e,_0x48f37b,_0x2b0085));};AGIChannel['prototype'][_0xf18a('0x44')]=function(_0x2eaea4,_0x4ec831){_0x4ec831=_0x4ec831||'';return this[_0xf18a('0x23')](util[_0xf18a('0x2b')](_0xf18a('0x45'),_0x2eaea4,_0x4ec831));};AGIChannel[_0xf18a('0x22')][_0xf18a('0x46')]=function(_0x590717){return this['exec']('AGI',_0x590717);};AGIChannel['prototype'][_0xf18a('0x47')]=function(_0x3a15a2){return this[_0xf18a('0x2d')](_0xf18a('0x48'),_0x3a15a2);};AGIChannel[_0xf18a('0x22')][_0xf18a('0x18')]=function(_0x2e63ea,_0x50e1c0){this[_0xf18a('0x49')](util[_0xf18a('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2e63ea['id'],_0x2e63ea[_0xf18a('0x4a')],_0x50e1c0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf18a('0x4b')]=AGIChannel; \ No newline at end of file +var _0x5edd=['BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','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','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','prototype','sendRequest','command','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','wav'];(function(_0x19dfed,_0x5646ec){var _0x3f6120=function(_0xad500b){while(--_0xad500b){_0x19dfed['push'](_0x19dfed['shift']());}};_0x3f6120(++_0x5646ec);}(_0x5edd,0xf3));var _0xd5ed=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5edd[_0x4b055c];return _0x4b62bb;};'use strict';var util=require('util');var _=require(_0xd5ed('0x0'));var EventEmitter=require(_0xd5ed('0x1'))['EventEmitter'];var AGIReply=require(_0xd5ed('0x2'));var AGIError=require(_0xd5ed('0x3'));function AGIChannel(_0x5c8c03){var _0x196edb=this,_0x1d159c=new AGIReply(),_0x4e43eb=![],_0x36796d={};EventEmitter['call'](_0x196edb);_0x5c8c03[_0xd5ed('0x4')](_0xd5ed('0x5'));_0x5c8c03[_0xd5ed('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1d159c[_0xd5ed('0x4')](_0xd5ed('0x5'));_0x1d159c['on']('headers',function(_0x505499){for(var _0x59b272 in _0x505499){_0x196edb[_0x59b272]=_0x505499[_0x59b272];}_0x196edb[_0xd5ed('0x7')](_0xd5ed('0x8'));});_0x1d159c['on'](_0xd5ed('0x9'),function(_0x1eaba1){if(_0x1eaba1[_0xd5ed('0xa')]()==_0xd5ed('0xb')){_0x196edb[_0xd5ed('0x7')](_0xd5ed('0xb'));return;}if(_0x1eaba1[_0xd5ed('0xc')](0x0,0xb)==_0xd5ed('0xd')){_0x4e43eb=!![];}if(_0x4e43eb){_0x36796d['rx']+=_0x1eaba1+'\x0a';if(_0x1eaba1[_0xd5ed('0xe')](_0xd5ed('0xf'))!=-0x1){_0x4e43eb=![];}}else{_0x36796d['rx']=_0x1eaba1;}if(_0x4e43eb){return;}if(typeof _0x36796d['cb']=='function'){var _0x21fbe4=_0x36796d['rx']['substring'](0x0,0x3),_0x2c8f18=null,_0x5bb4c3=null;_0x21fbe4=parseInt(_0x21fbe4);if(isNaN(_0x21fbe4)){_0x36796d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd5ed('0x10')});return;}if(_0x21fbe4!=0xc8){_0x36796d['cb'](null,{'code':_0x21fbe4,'result':-0x1,'extra':'KO'});return;}_0x2c8f18=_0x36796d['rx'][_0xd5ed('0xc')](0x4)[_0xd5ed('0x11')](_0xd5ed('0x12'),'');if(_0x2c8f18[_0xd5ed('0x13')]('\x20')!=-0x1){_0x2c8f18=_0x2c8f18['substr'](0x0,_0x2c8f18[_0xd5ed('0x13')]('\x20'));}if(_[_0xd5ed('0x14')](_0x2c8f18,'-1')){_0x2c8f18=parseInt(_0x2c8f18);}_0x5bb4c3=_0x36796d['rx'][_0xd5ed('0x15')]('\x20');if(_0x5bb4c3[_0xd5ed('0x16')]==0x3){_0x5bb4c3=_0x5bb4c3[0x2][_0xd5ed('0xc')](0x1,_0x5bb4c3[0x2][_0xd5ed('0x16')]-0x1);}else if(_0x5bb4c3['length']>0x3){var _0x201946=/\((.+)\)/;var _0x141d6e=_0x36796d['rx'][_0xd5ed('0x17')](_0x201946);if(_0x141d6e){_0x5bb4c3=_0x141d6e[0x1];}else{_0x5bb4c3=null;}}else{_0x5bb4c3=null;}_0x36796d['cb'](null,{'code':_0x21fbe4,'result':_0x2c8f18,'extra':_0x5bb4c3});}});_0x5c8c03['on'](_0xd5ed('0x18'),function(_0x2333c1){_0x196edb[_0xd5ed('0x7')](_0xd5ed('0x18'),new AGIError(_0xd5ed('0x19'),_0x2333c1[_0xd5ed('0x1a')]));});_0x5c8c03['on'](_0xd5ed('0x1b'),function(){_0x196edb[_0xd5ed('0x7')](_0xd5ed('0x1b'),new AGIError(_0xd5ed('0x1c')));});_0x5c8c03['on'](_0xd5ed('0x1d'),function(){_0x196edb[_0xd5ed('0x7')](_0xd5ed('0x1d'),new AGIError(_0xd5ed('0x1e')));_0x5c8c03[_0xd5ed('0x1f')]();});_0x5c8c03[_0xd5ed('0x20')](_0x1d159c);this['command']=function(_0x1f1ba2,_0x14fc96){var _0x1f1ba2=_0x1f1ba2||'',_0x14fc96=typeof _0x14fc96==_0xd5ed('0x21')?_0x14fc96:new Function();_0x36796d={'tx':_0x1f1ba2,'rx':'','cb':_0x14fc96};_0x5c8c03[_0xd5ed('0x22')](_0x1f1ba2+'\x0a');},this[_0xd5ed('0x1b')]=function(){_0x5c8c03[_0xd5ed('0x1f')]();};}util[_0xd5ed('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x25')]=function(_0x4ad13e){return this[_0xd5ed('0x26')][_0xd5ed('0x27')](this,_0x4ad13e);};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x28')]=function(){return this[_0xd5ed('0x25')]('ANSWER');};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x29')]=function(_0xe6837d,_0x25ed74,_0x366e63){_0xe6837d=_0xe6837d===undefined?_0xd5ed('0x2a'):_0xe6837d;_0x25ed74=_0x25ed74===undefined?'5':_0x25ed74;_0x366e63=_0x366e63===undefined?'1':_0x366e63;return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x2c'),_0xe6837d,_0x25ed74*0x3e8,_0x366e63));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x2d')]=function(_0x760643){_0x760643=_0x760643||_0xd5ed('0x2e');return this['sendRequest'](util[_0xd5ed('0x2b')](_0xd5ed('0x2f'),_0x760643));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x30')]=function(_0xf55fca,_0x3aa5b3){if(_['isArray'](_0x3aa5b3)){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x31'),_0xf55fca,_0x3aa5b3[_0xd5ed('0x32')](',')));}return this[_0xd5ed('0x25')](util['format']('EXEC\x20%s\x20%s',_0xf55fca,_0x3aa5b3));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x33')]=function(_0x1520a4){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x34'),_0x1520a4));};AGIChannel['prototype'][_0xd5ed('0x35')]=function(_0x1ed670){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x36'),_0x1ed670));};AGIChannel[_0xd5ed('0x24')]['setPriority']=function(_0x4edebb){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x37'),_0x4edebb));};AGIChannel['prototype']['hangup']=function(){return this[_0xd5ed('0x25')]('HANGUP');};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x38')]=function(_0x357d6f,_0x531316){var _0x2d85a3=_[_0xd5ed('0x39')](_0x531316)||_[_0xd5ed('0x3a')](_0x531316)?_0x531316[_0xd5ed('0x3b')]():_0x531316;return this[_0xd5ed('0x25')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x357d6f,_0x2d85a3?_0x2d85a3['toString']()[_0xd5ed('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x3c')]=function(_0x115037,_0x4f6445){return this['sendRequest'](util[_0xd5ed('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x115037,_0x4f6445));};AGIChannel['prototype'][_0xd5ed('0x3d')]=function(_0x32db3a,_0x4a41bd){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x3e'),_0x32db3a,_0x4a41bd));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x3f')]=function(_0x3eafd7,_0x5d3ba9){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')](_0xd5ed('0x40'),_0x3eafd7,_0x5d3ba9));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x41')]=function(_0x38772c,_0x4ee593,_0x1a5850){_0x4ee593=_0x4ee593||this[_0xd5ed('0x42')];_0x1a5850=_0x1a5850||0x1;this[_0xd5ed('0x33')](_0x38772c);this['setExtension'](_0x4ee593);this['setPriority'](_0x1a5850);return this['noop'](util[_0xd5ed('0x2b')](_0xd5ed('0x43'),_0x38772c,_0x4ee593,_0x1a5850));};AGIChannel[_0xd5ed('0x24')]['getVariable']=function(_0x22b574){return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x22b574));};AGIChannel[_0xd5ed('0x24')]['recordFile']=function(_0x31d199,_0x22ca93,_0x273f11,_0x219d0d,_0x2419e0,_0x44443d){_0x22ca93=_0x22ca93||_0xd5ed('0x44');_0x273f11=_0x273f11||'';_0x219d0d=_0x219d0d===undefined?-0x1:_0x219d0d==='-1'?-0x1:_0x219d0d*0x3e8;_0x2419e0=_0x2419e0===undefined?'':'s='+_0x2419e0;_0x44443d=_0x44443d?_0xd5ed('0x45'):'';return this[_0xd5ed('0x25')](util['format'](_0xd5ed('0x46'),_0x31d199,_0x22ca93,_0x273f11,_0x219d0d,_0x44443d,_0x2419e0));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x47')]=function(_0x11ec57,_0x5e6d9f){_0x5e6d9f=_0x5e6d9f||'';return this[_0xd5ed('0x25')](util[_0xd5ed('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x11ec57,_0x5e6d9f));};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x48')]=function(_0x533505){return this['exec']('AGI',_0x533505);};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x49')]=function(_0x304305){return this[_0xd5ed('0x30')](_0xd5ed('0x4a'),_0x304305);};AGIChannel[_0xd5ed('0x24')][_0xd5ed('0x18')]=function(_0x2fb724,_0x428b60){this[_0xd5ed('0x2d')](util[_0xd5ed('0x2b')](_0xd5ed('0x4b'),_0x2fb724['id'],_0x2fb724[_0xd5ed('0x4c')],_0x428b60));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd5ed('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index f4acf34..241a5da 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 _0x6ea5=['apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0x6ea5,0x148));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x56ea('0x0'));var error={'E_AGI_UNDEFINED':_0x56ea('0x1'),'E_AGI_ARGUMENT_PORT':_0x56ea('0x2'),'E_AGI_SERVER_ERROR':_0x56ea('0x3'),'E_AGI_SERVER_CLOSE':_0x56ea('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x56ea('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x56ea('0x6'),'E_AGI_SOCKET_ERROR':_0x56ea('0x7'),'E_AGI_SOCKET_CLOSE':_0x56ea('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x56ea('0x9'),'E_AGI_COMMAND_EMPTY':_0x56ea('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x56ea('0xb')};function AGIError(_0x350064){var _0x350064=_0x350064||null,_0x1d8624=_0x1d8624||[],_0x44ea7f=0x1,_0x3b8756='';if(!error[_0x350064]){_0x350064='E_AGI_UNDEFINED';}_0x1d8624['push'](error[_0x350064]);while(arguments[_0x44ea7f]){_0x1d8624[_0x56ea('0xc')](arguments[_0x44ea7f]);_0x44ea7f++;}_0x3b8756=util[_0x56ea('0xd')][_0x56ea('0xe')](util,_0x1d8624);this[_0x56ea('0xf')]=_0x3b8756;this[_0x56ea('0x10')]=_0x350064;}module[_0x56ea('0x11')]=AGIError; \ No newline at end of file +var _0xf8d6=['apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format'];(function(_0x29bd7d,_0x104677){var _0x2e4bd7=function(_0x42c46e){while(--_0x42c46e){_0x29bd7d['push'](_0x29bd7d['shift']());}};_0x2e4bd7(++_0x104677);}(_0xf8d6,0x144));var _0x6f8d=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xf8d6[_0x2300f2];return _0x6bd508;};'use strict';var util=require(_0x6f8d('0x0'));var error={'E_AGI_UNDEFINED':_0x6f8d('0x1'),'E_AGI_ARGUMENT_PORT':_0x6f8d('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x6f8d('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x6f8d('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x6f8d('0x5'),'E_AGI_SOCKET_CLOSE':_0x6f8d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x6f8d('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6f8d('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x17c99b){var _0x17c99b=_0x17c99b||null,_0x2338fb=_0x2338fb||[],_0xd28e3d=0x1,_0xa45d13='';if(!error[_0x17c99b]){_0x17c99b=_0x6f8d('0x9');}_0x2338fb[_0x6f8d('0xa')](error[_0x17c99b]);while(arguments[_0xd28e3d]){_0x2338fb[_0x6f8d('0xa')](arguments[_0xd28e3d]);_0xd28e3d++;}_0xa45d13=util[_0x6f8d('0xb')][_0x6f8d('0xc')](util,_0x2338fb);this[_0x6f8d('0xd')]=_0xa45d13;this[_0x6f8d('0xe')]=_0x17c99b;}module[_0x6f8d('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index ec4ce3a..3334328 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 _0x2160=['traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','getVertex'];(function(_0x23a1da,_0x47da02){var _0x12177e=function(_0xb52fca){while(--_0xb52fca){_0x23a1da['push'](_0x23a1da['shift']());}};_0x12177e(++_0x47da02);}(_0x2160,0x132));var _0x0216=function(_0x1a422f,_0x4a2ade){_0x1a422f=_0x1a422f-0x0;var _0x3273d6=_0x2160[_0x1a422f];return _0x3273d6;};'use strict';var _=require('lodash');var logger=require(_0x0216('0x0'))(_0x0216('0x1'));var verticesWithRetry=[_0x0216('0x2'),_0x0216('0x3'),_0x0216('0x4')];var Graph=function(){this[_0x0216('0x5')]={};this[_0x0216('0x6')]={};this[_0x0216('0x7')]=0x0;};Graph[_0x0216('0x8')][_0x0216('0x9')]=function(_0x978b93){this[_0x0216('0x5')][_0x978b93['id']]=_0x978b93;this[_0x0216('0x6')][_0x978b93['id']]=[];};Graph[_0x0216('0x8')]['addEdge']=function(_0x337ccd,_0x2fd88d,_0x578377){this['edges'][_0x337ccd][_0x0216('0xa')]({'target':_0x2fd88d,'condition':_0x578377});this[_0x0216('0x7')]+=0x1;};Graph[_0x0216('0x8')]['size']=function(){return _[_0x0216('0xb')](this[_0x0216('0x5')]);};Graph[_0x0216('0x8')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x0216('0x8')][_0x0216('0xc')]=function(_0x31eeb7){return this['vertices'][_0x31eeb7];};Graph['prototype'][_0x0216('0xd')]=function(_0x22e8ed,_0x3c9431){if(!this[_0x0216('0x5')][_0x22e8ed]){return logger[_0x0216('0xe')](_0x0216('0xf'));}var _0x213273=_0x3c9431(this['vertices'][_0x22e8ed]);if(!_0x213273){return logger['info'](_0x0216('0x10'));}if(this[_0x0216('0x6')][_0x22e8ed][_0x0216('0x11')]===0x0){return logger[_0x0216('0xe')]('no\x20edge/s\x20available');}for(var _0x89bb91=0x0,_0x26c3c9=[],_0x49f9ef=![];_0x89bb91\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','catch','indexOf','agi_','substring','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x2b9b56,_0x1ab101){var _0x2783df=function(_0x45196c){while(--_0x45196c){_0x2b9b56['push'](_0x2b9b56['shift']());}};_0x2783df(++_0x1ab101);}(_0x9cc4,0x1e3));var _0x49cc=function(_0x329344,_0x3418a3){_0x329344=_0x329344-0x0;var _0x362fc9=_0x9cc4[_0x329344];return _0x362fc9;};'use strict';var parser=require('xml2json');var _=require(_0x49cc('0x0'));var syncho=require(_0x49cc('0x1'));var util=require('util');var moment=require(_0x49cc('0x2'));var config=require(_0x49cc('0x3'));var logger=require(_0x49cc('0x4'))(_0x49cc('0x5'));var utilLicense=require(_0x49cc('0x6'));var rpc=require(_0x49cc('0x7'));var mailRpc=require(_0x49cc('0x8'));var Graph=require(_0x49cc('0x9'));var Vertices=require(_0x49cc('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x49cc('0xb')](config[_0x49cc('0x5')],{'ip':_0x49cc('0xc'),'port':0x11dd});function connectionHandler(_0x16ffc0){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x16ffc0);agiHandler(_0x16ffc0);}catch(_0x4e68b9){logger['error'](_0x4e68b9[_0x49cc('0xd')]);}});});}function listeningHandler(){console['log'](_0x49cc('0xe'),config[_0x49cc('0x5')][_0x49cc('0xf')]);logger['info'](util['format'](_0x49cc('0x10'),config[_0x49cc('0x5')]['ip'],config[_0x49cc('0x5')]['port']));}function errorHandler(_0x3757c5){if(_0x3757c5&&_0x3757c5[_0x49cc('0x11')]&&_0x3757c5[_0x49cc('0x12')]){logger['error'](util[_0x49cc('0x13')](_0x49cc('0x14'),_0x3757c5['name'],_0x3757c5['message']));}else{logger[_0x49cc('0x15')](util[_0x49cc('0x13')]('[ERROR]\x20%s',_0x3757c5[_0x49cc('0xd')]));}}function closeHandler(){logger[_0x49cc('0x16')](util[_0x49cc('0x13')](_0x49cc('0x17'),this[_0x49cc('0x18')],this['calleridname'],this[_0x49cc('0x19')],this[_0x49cc('0x1a')],this[_0x49cc('0x1b')]));try{createSquareReport(this);}catch(_0x3cf1b5){logger[_0x49cc('0x15')](_0x3cf1b5['stack']);}}function timeoutHandler(){logger[_0x49cc('0x16')](util[_0x49cc('0x13')](_0x49cc('0x1c'),this[_0x49cc('0x18')],this[_0x49cc('0x1d')],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x49cc('0x13')](_0x49cc('0x1e'),this[_0x49cc('0x18')],this['calleridname'],this['callerid'],this['dnid'],this[_0x49cc('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x35d4ed){return parser[_0x49cc('0x1f')](_0x35d4ed,{'object':!![]})[_0x49cc('0x20')]['root'];}function addVertex(_0x288522,_0x5b7809,_0x3215ce){_0x5b7809[_0x49cc('0x21')]=_0x3215ce;if(_0x5b7809[_0x49cc('0x22')](_0x49cc('0x23'))){_0x5b7809[_0x49cc('0x24')]=parseInt(_0x5b7809[_0x49cc('0x23')],0xa);}_0x288522[_0x49cc('0x25')](_[_0x49cc('0x26')](_0x5b7809,_0x49cc('0x27')));}function initGraph(_0x21e2f4,_0x57e633){var _0x3ca3c3=new Graph();for(var _0x161666 in _0x21e2f4){if(_0x21e2f4[_0x49cc('0x22')](_0x161666)){if(_[_0x49cc('0x28')](_0x21e2f4[_0x161666])){for(var _0x3aa077=0x0;_0x3aa077<_0x21e2f4[_0x161666][_0x49cc('0x29')];_0x3aa077+=0x1){addVertex(_0x3ca3c3,_0x21e2f4[_0x161666][_0x3aa077],_0x161666);}}else{addVertex(_0x3ca3c3,_0x21e2f4[_0x161666],_0x161666);}}}for(var _0x3598e7=0x0;_0x3598e7<_0x57e633[_0x49cc('0x29')];_0x3598e7+=0x1){if(_0x57e633[_0x3598e7][_0x49cc('0x2a')]&&_0x57e633[_0x3598e7]['target']){_0x3ca3c3[_0x49cc('0x2b')](_0x57e633[_0x3598e7]['source'],_0x57e633[_0x3598e7][_0x49cc('0x2c')],_0x57e633[_0x3598e7][_0x49cc('0x2d')]);}}return _0x3ca3c3;}function getSquareProject(_0x231c47,_0x358455){rpc[_0x49cc('0x2e')](_0x231c47)[_0x49cc('0x2f')](function(_0x1309a5){_0x358455(null,_0x1309a5);})[_0x49cc('0x30')](function(_0x4bb29f){_0x358455(null,_0x4bb29f);});}function createSquareReport(_0x404c01,_0x1101f5){rpc['createSquareReport'](_0x404c01)[_0x49cc('0x2f')](function(_0x1ce532){if(_0x1101f5){_0x1101f5(null,_0x1ce532);}})['catch'](function(_0x4eb621){if(_0x1101f5){_0x1101f5(null,_0x4eb621);}});}function setChannelVariables(_0x19ff96){for(var _0x2602db in _0x19ff96){if(_0x19ff96['hasOwnProperty'](_0x2602db)){if(_0x2602db[_0x49cc('0x31')](_0x49cc('0x32'))===0x0){_0x19ff96[_0x2602db[_0x49cc('0x33')](0x4)]=_0x19ff96[_0x2602db];delete _0x19ff96[_0x2602db];}}}}function getLogFromObject(_0x2c62f3){return util[_0x49cc('0x34')](_0x2c62f3,{'showHidden':![],'depth':null});}function agiHandler(_0x234f7c){var _0x4b8387,_0x14d26c,_0x5c8b60,_0x5a7e91,_0x48a4d1;logger[_0x49cc('0x35')]('variables',JSON['stringify'](_0x234f7c,null,0x2));logger[_0x49cc('0x16')](util[_0x49cc('0x13')](_0x49cc('0x36'),_0x234f7c[_0x49cc('0x18')],_0x234f7c[_0x49cc('0x1d')],_0x234f7c[_0x49cc('0x19')],_0x234f7c[_0x49cc('0x1a')],_0x234f7c['uniqueid']));_0x234f7c['on'](_0x49cc('0x15'),errorHandler);_0x234f7c['on'](_0x49cc('0x37'),closeHandler);_0x234f7c['on']('timeout',timeoutHandler);_0x234f7c[_0x49cc('0x38')]=![];_0x234f7c['on']('hangup',hangupHandler);var _0x872a4e=getSquareProject[_0x49cc('0x39')](null,_0x234f7c[_0x49cc('0x18')]);if(_0x872a4e){if(_0x872a4e['production']){_0x4b8387=getRoot(_0x872a4e[_0x49cc('0x3a')]);if(_0x4b8387&&_0x4b8387[_0x49cc('0x3b')]){logger[_0x49cc('0x35')]('root',JSON['stringify'](_0x4b8387,null,0x2));_0x234f7c[_0x49cc('0x3c')]=moment()[_0x49cc('0x13')](_0x49cc('0x3d'));_0x14d26c=initGraph(_[_0x49cc('0x26')](_0x4b8387,_0x49cc('0x27')),_0x4b8387['mxCell']);_0x5c8b60=new Vertices(_0x234f7c,rpc,mailRpc);logger[_0x49cc('0x16')](util[_0x49cc('0x13')](_0x49cc('0x3e'),_0x234f7c[_0x49cc('0x18')],_0x234f7c[_0x49cc('0x1d')],_0x234f7c[_0x49cc('0x19')],_0x234f7c['dnid'],_0x234f7c['uniqueid']));_0x14d26c['traverseBFS'](_0x4b8387['start']['id'],function(_0x3ab294){try{_0x3ab294=_0x5c8b60[_0x49cc('0x3f')](_0x3ab294);logger[_0x49cc('0x35')](_0x49cc('0x40'),JSON['stringify'](_0x3ab294,null,0x2));if(_0x3ab294[_0x49cc('0x21')]===_0x49cc('0x41')){logger[_0x49cc('0x16')](_0x49cc('0x42'));_0x234f7c[_0x49cc('0x43')]=_0x3ab294[_0x49cc('0x43')]||_0x234f7c[_0x49cc('0x43')];_0x234f7c[_0x49cc('0x44')]=_0x3ab294[_0x49cc('0x44')];_0x234f7c[_0x49cc('0x45')]=_0x3ab294[_0x49cc('0x45')]?_0x3ab294[_0x49cc('0x45')]-0x1:0x1;return null;}else if(_0x3ab294&&_0x5c8b60[_0x3ab294[_0x49cc('0x21')]]){_0x48a4d1=_0x5c8b60[_0x3ab294[_0x49cc('0x21')]](_0x3ab294);logger[_0x49cc('0x16')](_0x49cc('0x46'),JSON[_0x49cc('0x47')](_0x48a4d1,null,0x2));if(_0x48a4d1&&_0x48a4d1[_0x49cc('0x48')]===AGI_CODE_SUCCESS&&_0x48a4d1[_0x49cc('0x49')]!==AGI_RESULT_ERROR&&!_0x234f7c['evtHangup']){logger[_0x49cc('0x35')](_0x49cc('0x46'),getLogFromObject(_0x48a4d1));return _[_0x49cc('0x4a')](_0x48a4d1['result'])?null:_0x48a4d1[_0x49cc('0x49')][_0x49cc('0x4b')]();}else{logger[_0x49cc('0x15')](_0x49cc('0x46'),getLogFromObject(_0x48a4d1));return null;}}else{logger[_0x49cc('0x15')](_0x49cc('0x4c'));return null;}}catch(_0x566f5e){logger['error'](_0x566f5e['stack']);return null;}});if(_0x4b8387[_0x49cc('0x4d')]){logger[_0x49cc('0x16')](util[_0x49cc('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x234f7c[_0x49cc('0x18')],_0x234f7c[_0x49cc('0x1d')],_0x234f7c[_0x49cc('0x19')],_0x234f7c[_0x49cc('0x1a')],_0x234f7c['uniqueid']));_0x14d26c[_0x49cc('0x4e')](_0x4b8387['finally']['id'],function(_0xa7a967){try{_0xa7a967=_0x5c8b60[_0x49cc('0x3f')](_0xa7a967);logger[_0x49cc('0x35')](_0x49cc('0x40'),JSON[_0x49cc('0x47')](_0xa7a967,null,0x2));if(_0xa7a967&&_0x5c8b60[_0xa7a967[_0x49cc('0x21')]]){_0x48a4d1=_0x5c8b60[_0xa7a967[_0x49cc('0x21')]](_0xa7a967);if(_0x48a4d1){logger[_0x49cc('0x35')](_0x49cc('0x46'),getLogFromObject(_0x48a4d1));return _[_0x49cc('0x4a')](_0x48a4d1[_0x49cc('0x49')])?null:_0x48a4d1[_0x49cc('0x49')][_0x49cc('0x4b')]();}else{logger['error']('response',getLogFromObject(_0x48a4d1));return null;}}else{logger[_0x49cc('0x15')](_0x49cc('0x4c'));return null;}}catch(_0x43d999){logger['error'](_0x43d999[_0x49cc('0xd')]);return null;}});}logger['info'](util[_0x49cc('0x13')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x234f7c['arg_1'],_0x234f7c[_0x49cc('0x1d')],_0x234f7c['callerid'],_0x234f7c[_0x49cc('0x1a')],_0x234f7c[_0x49cc('0x1b')]));logger['info'](util['format'](_0x49cc('0x4f'),_0x234f7c[_0x49cc('0x43')],_0x234f7c[_0x49cc('0x44')],parseInt(_0x234f7c[_0x49cc('0x45')],0xa)+0x1));_0x234f7c[_0x49cc('0x50')](_0x234f7c[_0x49cc('0x43')],_0x234f7c[_0x49cc('0x44')],parseInt(_0x234f7c[_0x49cc('0x45')],0xa)+0x1);_0x234f7c[_0x49cc('0x37')]();}}else{logger[_0x49cc('0x15')](util[_0x49cc('0x13')](_0x49cc('0x51'),_0x234f7c['arg_1']));_0x234f7c[_0x49cc('0x50')](_0x234f7c[_0x49cc('0x43')],_0x234f7c['extension'],parseInt(_0x234f7c[_0x49cc('0x45')],0xa)+0x1);_0x234f7c['close']();}}else{logger['error'](util[_0x49cc('0x13')](_0x49cc('0x52'),_0x234f7c[_0x49cc('0x18')]));_0x234f7c[_0x49cc('0x50')](_0x234f7c[_0x49cc('0x43')],_0x234f7c['extension'],parseInt(_0x234f7c[_0x49cc('0x45')],0xa)+0x1);_0x234f7c[_0x49cc('0x37')]();}}function main(){var _0x311c8f;return utilLicense[_0x49cc('0x53')]()['then'](function(_0x44f005){if(_0x44f005){if(_0x44f005[_0x49cc('0x54')]){if(_0x44f005[_0x49cc('0x55')]&&_0x44f005[_0x49cc('0x55')]>0x0){logger['info'](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x44f005[_0x49cc('0x55')]));_0x311c8f=_0x44f005[_0x49cc('0x55')];}else{logger[_0x49cc('0x16')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x49cc('0x16')](_0x49cc('0x56'));_0x311c8f=-0x1;}}})['catch'](function(_0x3f7b1e){logger[_0x49cc('0x15')](_0x49cc('0x57'),_0x3f7b1e['stack']);})[_0x49cc('0x4d')](function(){var _0x5437c1=require(_0x49cc('0x58'))(config[_0x49cc('0x5')]['port'],config[_0x49cc('0x5')]['ip'],_0x311c8f);_0x5437c1['on'](_0x49cc('0x15'),errorHandler);_0x5437c1['on'](_0x49cc('0x59'),listeningHandler);_0x5437c1['on'](_0x49cc('0x5a'),connectionHandler);_0x5437c1['on'](_0x49cc('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0xbce0=['inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','xml2json','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./graph','defaults','127.0.0.1','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','error','[%s]\x20%s','[ERROR]\x20%s','calleridname','callerid','stack','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','evtHangup','root','hasOwnProperty','retry','addVertex','mxCell','length','source','target','addEdge','value','getSquareProject','catch','createSquareReport','indexOf','agi_','substring'];(function(_0x1837f6,_0x23e465){var _0x202053=function(_0x519a42){while(--_0x519a42){_0x1837f6['push'](_0x1837f6['shift']());}};_0x202053(++_0x23e465);}(_0xbce0,0x1dd));var _0x0bce=function(_0x3dc5e4,_0x5d21f7){_0x3dc5e4=_0x3dc5e4-0x0;var _0x32a4fb=_0xbce0[_0x3dc5e4];return _0x32a4fb;};'use strict';var parser=require(_0x0bce('0x0'));var _=require(_0x0bce('0x1'));var syncho=require(_0x0bce('0x2'));var util=require(_0x0bce('0x3'));var moment=require('moment');var config=require(_0x0bce('0x4'));var logger=require(_0x0bce('0x5'))(_0x0bce('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0x0bce('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x0bce('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0bce('0x6')]=_[_0x0bce('0x9')](config[_0x0bce('0x6')],{'ip':_0x0bce('0xa'),'port':0x11dd});function connectionHandler(_0x4d5f3c){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4d5f3c);agiHandler(_0x4d5f3c);}catch(_0x38ec4b){logger['error'](_0x38ec4b['stack']);}});});}function listeningHandler(){console[_0x0bce('0xb')](_0x0bce('0xc'),config[_0x0bce('0x6')][_0x0bce('0xd')]);logger[_0x0bce('0xe')](util[_0x0bce('0xf')](_0x0bce('0x10'),config[_0x0bce('0x6')]['ip'],config[_0x0bce('0x6')]['port']));}function errorHandler(_0x29f76a){if(_0x29f76a&&_0x29f76a[_0x0bce('0x11')]&&_0x29f76a['message']){logger[_0x0bce('0x12')](util[_0x0bce('0xf')](_0x0bce('0x13'),_0x29f76a[_0x0bce('0x11')],_0x29f76a['message']));}else{logger['error'](util[_0x0bce('0xf')](_0x0bce('0x14'),_0x29f76a['stack']));}}function closeHandler(){logger[_0x0bce('0xe')](util[_0x0bce('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x0bce('0x15')],this[_0x0bce('0x16')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x256e80){logger[_0x0bce('0x12')](_0x256e80[_0x0bce('0x17')]);}}function timeoutHandler(){logger[_0x0bce('0xe')](util[_0x0bce('0xf')](_0x0bce('0x18'),this[_0x0bce('0x19')],this[_0x0bce('0x15')],this['callerid'],this[_0x0bce('0x1a')],this[_0x0bce('0x1b')]));}function hangupHandler(){logger[_0x0bce('0xe')](util[_0x0bce('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0bce('0x19')],this[_0x0bce('0x15')],this[_0x0bce('0x16')],this['dnid'],this[_0x0bce('0x1b')]));this[_0x0bce('0x1c')]=!![];}function getRoot(_0x3707b3){return parser['toJson'](_0x3707b3,{'object':!![]})['mxGraphModel'][_0x0bce('0x1d')];}function addVertex(_0x237d51,_0x1e76a7,_0x1b44da){_0x1e76a7['agicommand']=_0x1b44da;if(_0x1e76a7[_0x0bce('0x1e')](_0x0bce('0x1f'))){_0x1e76a7['maxRetry']=parseInt(_0x1e76a7[_0x0bce('0x1f')],0xa);}_0x237d51[_0x0bce('0x20')](_['omit'](_0x1e76a7,_0x0bce('0x21')));}function initGraph(_0x669462,_0x52b5ff){var _0x30eda9=new Graph();for(var _0x2ada44 in _0x669462){if(_0x669462['hasOwnProperty'](_0x2ada44)){if(_['isArray'](_0x669462[_0x2ada44])){for(var _0x46fc08=0x0;_0x46fc08<_0x669462[_0x2ada44][_0x0bce('0x22')];_0x46fc08+=0x1){addVertex(_0x30eda9,_0x669462[_0x2ada44][_0x46fc08],_0x2ada44);}}else{addVertex(_0x30eda9,_0x669462[_0x2ada44],_0x2ada44);}}}for(var _0x2bcef9=0x0;_0x2bcef9<_0x52b5ff['length'];_0x2bcef9+=0x1){if(_0x52b5ff[_0x2bcef9][_0x0bce('0x23')]&&_0x52b5ff[_0x2bcef9][_0x0bce('0x24')]){_0x30eda9[_0x0bce('0x25')](_0x52b5ff[_0x2bcef9]['source'],_0x52b5ff[_0x2bcef9]['target'],_0x52b5ff[_0x2bcef9][_0x0bce('0x26')]);}}return _0x30eda9;}function getSquareProject(_0x214591,_0x14c962){rpc[_0x0bce('0x27')](_0x214591)['then'](function(_0x31b50b){_0x14c962(null,_0x31b50b);})[_0x0bce('0x28')](function(_0xb67c29){_0x14c962(null,_0xb67c29);});}function createSquareReport(_0x1c23db,_0x4070dc){rpc[_0x0bce('0x29')](_0x1c23db)['then'](function(_0x52a07f){if(_0x4070dc){_0x4070dc(null,_0x52a07f);}})['catch'](function(_0x1b5677){if(_0x4070dc){_0x4070dc(null,_0x1b5677);}});}function setChannelVariables(_0x3344e9){for(var _0x38f6a0 in _0x3344e9){if(_0x3344e9['hasOwnProperty'](_0x38f6a0)){if(_0x38f6a0[_0x0bce('0x2a')](_0x0bce('0x2b'))===0x0){_0x3344e9[_0x38f6a0[_0x0bce('0x2c')](0x4)]=_0x3344e9[_0x38f6a0];delete _0x3344e9[_0x38f6a0];}}}}function getLogFromObject(_0x2bbb1c){return util[_0x0bce('0x2d')](_0x2bbb1c,{'showHidden':![],'depth':null});}function agiHandler(_0x33db78){var _0x3331ee,_0x26cace,_0x54bab8,_0x11d446,_0x36c480;logger[_0x0bce('0x2e')](_0x0bce('0x2f'),JSON[_0x0bce('0x30')](_0x33db78,null,0x2));logger[_0x0bce('0xe')](util['format'](_0x0bce('0x31'),_0x33db78['arg_1'],_0x33db78[_0x0bce('0x15')],_0x33db78[_0x0bce('0x16')],_0x33db78[_0x0bce('0x1a')],_0x33db78[_0x0bce('0x1b')]));_0x33db78['on']('error',errorHandler);_0x33db78['on'](_0x0bce('0x32'),closeHandler);_0x33db78['on'](_0x0bce('0x33'),timeoutHandler);_0x33db78['evtHangup']=![];_0x33db78['on'](_0x0bce('0x34'),hangupHandler);var _0x3f2333=getSquareProject[_0x0bce('0x35')](null,_0x33db78[_0x0bce('0x19')]);if(_0x3f2333){if(_0x3f2333['production']){_0x3331ee=getRoot(_0x3f2333[_0x0bce('0x36')]);if(_0x3331ee&&_0x3331ee['start']){logger[_0x0bce('0x2e')]('root',JSON[_0x0bce('0x30')](_0x3331ee,null,0x2));_0x33db78[_0x0bce('0x37')]=moment()[_0x0bce('0xf')](_0x0bce('0x38'));_0x26cace=initGraph(_[_0x0bce('0x39')](_0x3331ee,_0x0bce('0x21')),_0x3331ee[_0x0bce('0x21')]);_0x54bab8=new Vertices(_0x33db78,rpc,mailRpc);logger[_0x0bce('0xe')](util['format'](_0x0bce('0x3a'),_0x33db78[_0x0bce('0x19')],_0x33db78[_0x0bce('0x15')],_0x33db78['callerid'],_0x33db78['dnid'],_0x33db78[_0x0bce('0x1b')]));_0x26cace['traverseBFS'](_0x3331ee[_0x0bce('0x3b')]['id'],function(_0x381352){try{_0x381352=_0x54bab8[_0x0bce('0x3c')](_0x381352);logger[_0x0bce('0x2e')](_0x0bce('0x3d'),JSON['stringify'](_0x381352,null,0x2));if(_0x381352[_0x0bce('0x3e')]===_0x0bce('0x3f')){logger[_0x0bce('0xe')](_0x0bce('0x40'));_0x33db78[_0x0bce('0x41')]=_0x381352['context']||_0x33db78[_0x0bce('0x41')];_0x33db78[_0x0bce('0x42')]=_0x381352['extension'];_0x33db78['priority']=_0x381352[_0x0bce('0x43')]?_0x381352['priority']-0x1:0x1;return null;}else if(_0x381352&&_0x54bab8[_0x381352[_0x0bce('0x3e')]]){_0x36c480=_0x54bab8[_0x381352[_0x0bce('0x3e')]](_0x381352);logger[_0x0bce('0xe')]('response',JSON['stringify'](_0x36c480,null,0x2));if(_0x36c480&&_0x36c480['code']===AGI_CODE_SUCCESS&&_0x36c480[_0x0bce('0x44')]!==AGI_RESULT_ERROR&&!_0x33db78[_0x0bce('0x1c')]){logger['debug'](_0x0bce('0x45'),getLogFromObject(_0x36c480));return _[_0x0bce('0x46')](_0x36c480[_0x0bce('0x44')])?null:_0x36c480['result'][_0x0bce('0x47')]();}else{logger['error']('response',getLogFromObject(_0x36c480));return null;}}else{logger[_0x0bce('0x12')](_0x0bce('0x48'));return null;}}catch(_0x1efa34){logger[_0x0bce('0x12')](_0x1efa34[_0x0bce('0x17')]);return null;}});if(_0x3331ee[_0x0bce('0x49')]){logger['info'](util[_0x0bce('0xf')](_0x0bce('0x4a'),_0x33db78['arg_1'],_0x33db78[_0x0bce('0x15')],_0x33db78[_0x0bce('0x16')],_0x33db78[_0x0bce('0x1a')],_0x33db78['uniqueid']));_0x26cace[_0x0bce('0x4b')](_0x3331ee[_0x0bce('0x49')]['id'],function(_0x1aebf6){try{_0x1aebf6=_0x54bab8[_0x0bce('0x3c')](_0x1aebf6);logger['debug']('vertex',JSON[_0x0bce('0x30')](_0x1aebf6,null,0x2));if(_0x1aebf6&&_0x54bab8[_0x1aebf6[_0x0bce('0x3e')]]){_0x36c480=_0x54bab8[_0x1aebf6[_0x0bce('0x3e')]](_0x1aebf6);if(_0x36c480){logger[_0x0bce('0x2e')](_0x0bce('0x45'),getLogFromObject(_0x36c480));return _[_0x0bce('0x46')](_0x36c480[_0x0bce('0x44')])?null:_0x36c480[_0x0bce('0x44')][_0x0bce('0x47')]();}else{logger[_0x0bce('0x12')](_0x0bce('0x45'),getLogFromObject(_0x36c480));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x349c5b){logger[_0x0bce('0x12')](_0x349c5b[_0x0bce('0x17')]);return null;}});}logger[_0x0bce('0xe')](util[_0x0bce('0xf')](_0x0bce('0x4c'),_0x33db78['arg_1'],_0x33db78['calleridname'],_0x33db78['callerid'],_0x33db78[_0x0bce('0x1a')],_0x33db78[_0x0bce('0x1b')]));logger[_0x0bce('0xe')](util[_0x0bce('0xf')](_0x0bce('0x4d'),_0x33db78['context'],_0x33db78[_0x0bce('0x42')],parseInt(_0x33db78[_0x0bce('0x43')],0xa)+0x1));_0x33db78[_0x0bce('0x4e')](_0x33db78['context'],_0x33db78[_0x0bce('0x42')],parseInt(_0x33db78[_0x0bce('0x43')],0xa)+0x1);_0x33db78['close']();}}else{logger[_0x0bce('0x12')](util['format'](_0x0bce('0x4f'),_0x33db78[_0x0bce('0x19')]));_0x33db78[_0x0bce('0x4e')](_0x33db78[_0x0bce('0x41')],_0x33db78[_0x0bce('0x42')],parseInt(_0x33db78[_0x0bce('0x43')],0xa)+0x1);_0x33db78[_0x0bce('0x32')]();}}else{logger[_0x0bce('0x12')](util[_0x0bce('0xf')](_0x0bce('0x50'),_0x33db78[_0x0bce('0x19')]));_0x33db78[_0x0bce('0x4e')](_0x33db78['context'],_0x33db78[_0x0bce('0x42')],parseInt(_0x33db78['priority'],0xa)+0x1);_0x33db78['close']();}}function main(){var _0x5eeef5;return utilLicense[_0x0bce('0x51')]()['then'](function(_0x3ed330){if(_0x3ed330){if(_0x3ed330[_0x0bce('0x52')]){if(_0x3ed330['callysquare']&&_0x3ed330[_0x0bce('0x53')]>0x0){logger[_0x0bce('0xe')](util[_0x0bce('0xf')](_0x0bce('0x54'),_0x3ed330[_0x0bce('0x53')]));_0x5eeef5=_0x3ed330[_0x0bce('0x53')];}else{logger[_0x0bce('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x0bce('0xe')](_0x0bce('0x55'));_0x5eeef5=-0x1;}}})['catch'](function(_0xbe02b1){logger[_0x0bce('0x12')]('[LICENSE]',_0xbe02b1['stack']);})['finally'](function(){var _0x54918e=require('./server')(config[_0x0bce('0x6')][_0x0bce('0xd')],config[_0x0bce('0x6')]['ip'],_0x5eeef5);_0x54918e['on'](_0x0bce('0x12'),errorHandler);_0x54918e['on'](_0x0bce('0x56'),listeningHandler);_0x54918e['on']('connection',connectionHandler);_0x54918e['on'](_0x0bce('0x32'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 0229f41..bdb412e 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 _0x74f6=['client','http','then','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x582af2,_0x42e4d4){var _0x4941d8=function(_0x33ed2d){while(--_0x33ed2d){_0x582af2['push'](_0x582af2['shift']());}};_0x4941d8(++_0x42e4d4);}(_0x74f6,0x134));var _0x674f=function(_0xe1f980,_0xcd0d97){_0xe1f980=_0xe1f980-0x0;var _0x59f236=_0x74f6[_0xe1f980];return _0x59f236;};'use strict';var BPromise=require(_0x674f('0x0'));var jayson=require(_0x674f('0x1'));var client=jayson[_0x674f('0x2')][_0x674f('0x3')]({'port':0x232b});function request(_0x9214ef,_0xf83173){return new BPromise(function(_0x6d96ad,_0x20b3c6){return client['request'](_0x9214ef,_0xf83173)[_0x674f('0x4')](function(_0x27b693){if(_0x27b693[_0x674f('0x5')]){return _0x20b3c6(_0x27b693[_0x674f('0x5')][_0x674f('0x6')]);}else{return _0x6d96ad(_0x27b693[_0x674f('0x7')]);}})['catch'](function(_0x2f7998){return _0x20b3c6(_0x2f7998);});});}exports[_0x674f('0x8')]=function(_0x44d069,_0x2566b0){return request(_0x674f('0x9'),{'account':_0x44d069,'message':_0x2566b0});}; \ No newline at end of file +var _0x663e=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result','catch'];(function(_0x50caa0,_0x2431be){var _0x11b0c9=function(_0xa6a09d){while(--_0xa6a09d){_0x50caa0['push'](_0x50caa0['shift']());}};_0x11b0c9(++_0x2431be);}(_0x663e,0xe6));var _0xe663=function(_0x173876,_0x34fd4b){_0x173876=_0x173876-0x0;var _0x4e6081=_0x663e[_0x173876];return _0x4e6081;};'use strict';var BPromise=require(_0xe663('0x0'));var jayson=require(_0xe663('0x1'));var client=jayson[_0xe663('0x2')][_0xe663('0x3')]({'port':0x232b});function request(_0x17aa42,_0x1280cd){return new BPromise(function(_0x49d770,_0x113490){return client[_0xe663('0x4')](_0x17aa42,_0x1280cd)[_0xe663('0x5')](function(_0x469586){if(_0x469586[_0xe663('0x6')]){return _0x113490(_0x469586[_0xe663('0x6')][_0xe663('0x7')]);}else{return _0x49d770(_0x469586[_0xe663('0x8')]);}})[_0xe663('0x9')](function(_0xd6b5fc){return _0x113490(_0xd6b5fc);});});}exports[_0xe663('0xa')]=function(_0x22a76f,_0x3c0c72){return request(_0xe663('0xb'),{'account':_0x22a76f,'message':_0x3c0c72});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 6ffd0f1..8b06203 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 _0xecbc=['substring','split','slice','trim','length','emit','headers','exports','util','stream','Transform','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecbc,0x86));var _0xcecb=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xecbc[_0x12fc8d];return _0x3f9d04;};'use strict';var util=require(_0xcecb('0x0'));var Transform=require(_0xcecb('0x1'))[_0xcecb('0x2')];function AGIReply(_0x1dbc04){Transform['call'](this,_0x1dbc04);this['_localBuffer']='';this[_0xcecb('0x3')]=![];}util[_0xcecb('0x4')](AGIReply,Transform);AGIReply[_0xcecb('0x5')]['_transform']=function(_0x12a61c,_0x13aae6,_0x23c1bb){var _0x32f577='\x0a',_0x48382b=['\x0a\x0a',_0xcecb('0x6')],_0x3f5c49=-0x1,_0x57ae82=-0x1,_0x155f0d='',_0x32d5d8=0x0,_0x1f637a='',_0x2f2e12='';this[_0xcecb('0x7')]+=_0x12a61c[_0xcecb('0x8')]();_0x1f637a=this[_0xcecb('0x7')];if(!this[_0xcecb('0x3')]){_0x32d5d8=0x0;while(_0x48382b[_0x32d5d8]){while((_0x57ae82=_0x1f637a[_0xcecb('0x9')](_0x48382b[_0x32d5d8]))!=-0x1){_0x155f0d=_0x48382b[_0x32d5d8];_0x2f2e12=_0x1f637a[_0xcecb('0xa')](0x0,_0x57ae82);_0x1f637a=_0x1f637a[_0xcecb('0xa')](_0x57ae82+_0x155f0d['length']);var _0x31aa0d=_0x2f2e12[_0xcecb('0xb')](_0x32f577),_0x431093=0x0,_0xdd73ae={},_0x1e7ec1='',_0x468c41='',_0x3de1e9=-0x1;while(_0x31aa0d[_0x431093]){_0x3de1e9=_0x31aa0d[_0x431093][_0xcecb('0x9')](':');if(_0x3de1e9!=-0x1){_0x1e7ec1=_0x31aa0d[_0x431093][_0xcecb('0xc')](0x0,_0x3de1e9)[_0xcecb('0xd')]();_0x468c41=_0x31aa0d[_0x431093][_0xcecb('0xc')](_0x3de1e9+0x1)[_0xcecb('0xd')]();if(_0x1e7ec1[_0xcecb('0xe')]>0x0){_0xdd73ae[_0x1e7ec1]=_0x468c41;}}else{}_0x431093++;}this[_0xcecb('0xf')](_0xcecb('0x10'),_0xdd73ae);this[_0xcecb('0x3')]=!![];}_0x32d5d8++;}this['_localBuffer']=_0x1f637a;}else{while((_0x3f5c49=_0x1f637a['indexOf'](_0x32f577))!=-0x1){_0x2f2e12=_0x1f637a[_0xcecb('0xa')](0x0,_0x3f5c49);this['emit']('line',_0x2f2e12);_0x1f637a=_0x1f637a[_0xcecb('0xa')](_0x3f5c49+_0x32f577[_0xcecb('0xe')]);}this[_0xcecb('0x7')]=_0x1f637a;}_0x23c1bb();};module[_0xcecb('0x11')]=AGIReply; \ No newline at end of file +var _0x0192=['headers','line','exports','util','call','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','substring','split','indexOf','slice','trim','length','emit'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0x0192,0x1c5));var _0x2019=function(_0x171c1b,_0x977d63){_0x171c1b=_0x171c1b-0x0;var _0x1ad910=_0x0192[_0x171c1b];return _0x1ad910;};'use strict';var util=require(_0x2019('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0xaf57c8){Transform[_0x2019('0x1')](this,_0xaf57c8);this['_localBuffer']='';this[_0x2019('0x2')]=![];}util[_0x2019('0x3')](AGIReply,Transform);AGIReply['prototype'][_0x2019('0x4')]=function(_0x55dfd3,_0x39a798,_0x2f8c9a){var _0xc5f35d='\x0a',_0x5c39cd=['\x0a\x0a',_0x2019('0x5')],_0x10295f=-0x1,_0x59f7b5=-0x1,_0xbee346='',_0x53f66e=0x0,_0x390c73='',_0x57d02c='';this['_localBuffer']+=_0x55dfd3[_0x2019('0x6')]();_0x390c73=this[_0x2019('0x7')];if(!this[_0x2019('0x2')]){_0x53f66e=0x0;while(_0x5c39cd[_0x53f66e]){while((_0x59f7b5=_0x390c73['indexOf'](_0x5c39cd[_0x53f66e]))!=-0x1){_0xbee346=_0x5c39cd[_0x53f66e];_0x57d02c=_0x390c73[_0x2019('0x8')](0x0,_0x59f7b5);_0x390c73=_0x390c73[_0x2019('0x8')](_0x59f7b5+_0xbee346['length']);var _0x4a66d1=_0x57d02c[_0x2019('0x9')](_0xc5f35d),_0x394411=0x0,_0x1599f5={},_0x4c24bc='',_0x3fec68='',_0x51de66=-0x1;while(_0x4a66d1[_0x394411]){_0x51de66=_0x4a66d1[_0x394411][_0x2019('0xa')](':');if(_0x51de66!=-0x1){_0x4c24bc=_0x4a66d1[_0x394411][_0x2019('0xb')](0x0,_0x51de66)[_0x2019('0xc')]();_0x3fec68=_0x4a66d1[_0x394411][_0x2019('0xb')](_0x51de66+0x1)['trim']();if(_0x4c24bc[_0x2019('0xd')]>0x0){_0x1599f5[_0x4c24bc]=_0x3fec68;}}else{}_0x394411++;}this[_0x2019('0xe')](_0x2019('0xf'),_0x1599f5);this[_0x2019('0x2')]=!![];}_0x53f66e++;}this[_0x2019('0x7')]=_0x390c73;}else{while((_0x10295f=_0x390c73[_0x2019('0xa')](_0xc5f35d))!=-0x1){_0x57d02c=_0x390c73[_0x2019('0x8')](0x0,_0x10295f);this[_0x2019('0xe')](_0x2019('0x10'),_0x57d02c);_0x390c73=_0x390c73['substring'](_0x10295f+_0xc5f35d['length']);}this['_localBuffer']=_0x390c73;}_0x2f8c9a();};module[_0x2019('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 2c68e90..b673a80 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 _0x1b71=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','request','then','error','message','result','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','ShowSquareProject','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getTrunkById','ShowTrunk','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x1b71,0x1e7));var _0x11b7=function(_0x4e09b1,_0x4f1c23){_0x4e09b1=_0x4e09b1-0x0;var _0x1c0239=_0x1b71[_0x4e09b1];return _0x1c0239;};'use strict';var BPromise=require(_0x11b7('0x0'));var moment=require(_0x11b7('0x1'));var _=require(_0x11b7('0x2'));var util=require(_0x11b7('0x3'));var jayson=require(_0x11b7('0x4'));var client=jayson['client'][_0x11b7('0x5')]({'port':0x2329});function request(_0x43c2d0,_0x59e907){return new BPromise(function(_0x3c6963,_0x21bf22){return client[_0x11b7('0x6')](_0x43c2d0,_0x59e907)[_0x11b7('0x7')](function(_0x3def0c){if(_0x3def0c['error']){return _0x21bf22(_0x3def0c[_0x11b7('0x8')][_0x11b7('0x9')]);}else{return _0x3c6963(_0x3def0c[_0x11b7('0xa')]);}})['catch'](function(_0x55306f){return _0x21bf22(_0x55306f);});});}exports[_0x11b7('0xb')]=function(_0x5ae9d6){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5ae9d6},'attributes':[_0x11b7('0xc')]}});};exports[_0x11b7('0xd')]=function(_0x441cfa){return request(_0x11b7('0xe'),{'options':{'raw':![],'where':{'id':_0x441cfa},'include':[{'model':_0x11b7('0xf'),'as':_0x11b7('0x10')}],'attributes':['id',_0x11b7('0x11'),'email']}});};exports[_0x11b7('0x12')]=function(_0x2c5f48){return request(_0x11b7('0x13'),{'options':{'where':{'id':_0x2c5f48},'attributes':[_0x11b7('0x11')]}});};exports[_0x11b7('0x14')]=function(_0x5241bf){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5241bf},'attributes':['name']}});};exports[_0x11b7('0x15')]=function(_0x3fd09d){return request(_0x11b7('0x16'),{'options':{'where':{'id':_0x3fd09d},'attributes':['name']}});};exports[_0x11b7('0x17')]=function(_0x3fba6f){return request(_0x11b7('0x18'),{'options':{'where':{'id':_0x3fba6f},'attributes':[_0x11b7('0x19')]}});};exports[_0x11b7('0x1a')]=function(_0x18f77a){return request('ShowUser',{'options':{'where':{'id':_0x18f77a},'attributes':[_0x11b7('0x11')]}});};exports[_0x11b7('0x1b')]=function(_0x5aec75){return request(_0x11b7('0x1c'),{'options':{'where':{'id':_0x5aec75},'attributes':[_0x11b7('0x11')]}});};exports['getSoundById']=function(_0x56e6d4){return request(_0x11b7('0x1d'),{'options':{'where':{'id':_0x56e6d4},'attributes':['save_name']}});};exports[_0x11b7('0x1e')]=function(_0x5095ea){return request(_0x11b7('0x1f'),{'options':{'raw':![],'where':{'id':_0x5095ea},'include':[{'model':_0x11b7('0x20'),'as':_0x11b7('0x21')}]}});};exports[_0x11b7('0x22')]=function(_0xace1f){return request(_0x11b7('0x23'),{'options':{'where':{'id':_0xace1f},'attributes':['id',_0x11b7('0x11')]}});};exports[_0x11b7('0x24')]=function(_0x3eac01){return request(_0x11b7('0x25'),{'body':_0x3eac01});};exports[_0x11b7('0x26')]=function(_0xf8ff27){return request('CreateSquareDetailsReport',{'body':_0xf8ff27});};exports[_0x11b7('0x27')]=function(_0x44938e){return request('CreateSquareReport',{'body':_[_0x11b7('0x28')](_0x44938e,{'project_name':_0x44938e[_0x11b7('0x29')],'prev_project_name':_0x44938e[_0x11b7('0x2a')]||'','is_subproject':_0x44938e[_0x11b7('0x2a')]?!![]:![],'leaveAt':moment()[_0x11b7('0x2b')](_0x11b7('0x2c'))})});};exports[_0x11b7('0x2d')]=function(_0x463297){return request('CreateSquareRecording',{'body':_0x463297});};exports['createSquareMessage']=function(_0x22cd55){return request('CreateSquareMessage',{'body':_0x22cd55});};exports[_0x11b7('0x2e')]=function(_0x22f687){return request(_0x11b7('0x2f'),{'options':{'raw':![],'where':{'phone':_0x22f687[_0x11b7('0x30')],'ListId':_0x22f687[_0x11b7('0x31')]}}})['then'](function(_0x4b9ca6){if(_0x4b9ca6){return _0x4b9ca6;}return request(_0x11b7('0x32'),{'body':_0x22f687});});};exports['getPauseById']=function(_0x1cd58a){return request(_0x11b7('0x33'),{'options':{'where':{'id':_0x1cd58a},'attributes':[_0x11b7('0x11')]}});};exports[_0x11b7('0x34')]=function(_0x53d609,_0x4edef7){return request(_0x11b7('0x35'),{'body':{'interface':_0x4edef7},'options':{'where':_0x53d609}});};exports[_0x11b7('0x36')]=function(_0x460c37,_0x5c97f3,_0x5e92b7){return request(_0x11b7('0x37'),{'body':{'type':_0x5c97f3,'uniqueid':_0x5e92b7},'options':{'where':_0x460c37}});};exports[_0x11b7('0x38')]=function(_0x3b885e){return request('UnpauseUser',{'body':{},'options':{'where':_0x3b885e}});};exports['agentLogout']=function(_0x23d9fa){return request(_0x11b7('0x39'),{'body':{},'options':{'where':_0x23d9fa}});}; \ No newline at end of file +var _0xa3fe=['ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','util','jayson/promise','client','then','error','message','ShowSquareProject','production','getMailAccountById'];(function(_0x9b5257,_0x21d403){var _0x336395=function(_0x5996a4){while(--_0x5996a4){_0x9b5257['push'](_0x9b5257['shift']());}};_0x336395(++_0x21d403);}(_0xa3fe,0xa0));var _0xea3f=function(_0x3827ce,_0xba7f3){_0x3827ce=_0x3827ce-0x0;var _0x511b1d=_0xa3fe[_0x3827ce];return _0x511b1d;};'use strict';var BPromise=require(_0xea3f('0x0'));var moment=require('moment');var _=require(_0xea3f('0x1'));var util=require(_0xea3f('0x2'));var jayson=require(_0xea3f('0x3'));var client=jayson[_0xea3f('0x4')]['http']({'port':0x2329});function request(_0x2e61be,_0xd2b0aa){return new BPromise(function(_0xe2423b,_0x3a79b5){return client['request'](_0x2e61be,_0xd2b0aa)[_0xea3f('0x5')](function(_0xd8ec40){if(_0xd8ec40[_0xea3f('0x6')]){return _0x3a79b5(_0xd8ec40[_0xea3f('0x6')][_0xea3f('0x7')]);}else{return _0xe2423b(_0xd8ec40['result']);}})['catch'](function(_0x43eb96){return _0x3a79b5(_0x43eb96);});});}exports['getSquareProject']=function(_0x515923){return request(_0xea3f('0x8'),{'options':{'raw':![],'where':{'name':_0x515923},'attributes':[_0xea3f('0x9')]}});};exports[_0xea3f('0xa')]=function(_0x28423a){return request(_0xea3f('0xb'),{'options':{'raw':![],'where':{'id':_0x28423a},'include':[{'model':_0xea3f('0xc'),'as':_0xea3f('0xd')}],'attributes':['id',_0xea3f('0xe'),_0xea3f('0xf')]}});};exports[_0xea3f('0x10')]=function(_0xf090b6){return request(_0xea3f('0x8'),{'options':{'where':{'id':_0xf090b6},'attributes':[_0xea3f('0xe')]}});};exports[_0xea3f('0x11')]=function(_0x518452){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x518452},'attributes':[_0xea3f('0xe')]}});};exports['getVariableById']=function(_0x217402){return request(_0xea3f('0x12'),{'options':{'where':{'id':_0x217402},'attributes':[_0xea3f('0xe')]}});};exports[_0xea3f('0x13')]=function(_0x216cf7){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x216cf7},'attributes':[_0xea3f('0x14')]}});};exports[_0xea3f('0x15')]=function(_0x12392a){return request(_0xea3f('0x16'),{'options':{'where':{'id':_0x12392a},'attributes':[_0xea3f('0xe')]}});};exports[_0xea3f('0x17')]=function(_0x5cf4f4){return request(_0xea3f('0x18'),{'options':{'where':{'id':_0x5cf4f4},'attributes':[_0xea3f('0xe')]}});};exports[_0xea3f('0x19')]=function(_0x580d45){return request(_0xea3f('0x1a'),{'options':{'where':{'id':_0x580d45},'attributes':[_0xea3f('0x1b')]}});};exports[_0xea3f('0x1c')]=function(_0x5b189f){return request(_0xea3f('0x1d'),{'options':{'raw':![],'where':{'id':_0x5b189f},'include':[{'model':_0xea3f('0x1e'),'as':_0xea3f('0x1f')}]}});};exports[_0xea3f('0x20')]=function(_0x307d2a){return request('ShowSmsAccount',{'options':{'where':{'id':_0x307d2a},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0xbbbbab){return request(_0xea3f('0x21'),{'body':_0xbbbbab});};exports[_0xea3f('0x22')]=function(_0x105215){return request(_0xea3f('0x23'),{'body':_0x105215});};exports[_0xea3f('0x24')]=function(_0x1409e3){return request(_0xea3f('0x25'),{'body':_[_0xea3f('0x26')](_0x1409e3,{'project_name':_0x1409e3['arg_1'],'prev_project_name':_0x1409e3[_0xea3f('0x27')]||'','is_subproject':_0x1409e3[_0xea3f('0x27')]?!![]:![],'leaveAt':moment()[_0xea3f('0x28')](_0xea3f('0x29'))})});};exports['createSquareRecording']=function(_0x39034e){return request('CreateSquareRecording',{'body':_0x39034e});};exports[_0xea3f('0x2a')]=function(_0x425e7a){return request(_0xea3f('0x2b'),{'body':_0x425e7a});};exports[_0xea3f('0x2c')]=function(_0x1e75e2){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1e75e2[_0xea3f('0x2d')],'ListId':_0x1e75e2[_0xea3f('0x2e')]}}})[_0xea3f('0x5')](function(_0x35b4fb){if(_0x35b4fb){return _0x35b4fb;}return request(_0xea3f('0x2f'),{'body':_0x1e75e2});});};exports[_0xea3f('0x30')]=function(_0x540b26){return request(_0xea3f('0x31'),{'options':{'where':{'id':_0x540b26},'attributes':[_0xea3f('0xe')]}});};exports[_0xea3f('0x32')]=function(_0x53de88,_0xc03c4c){return request(_0xea3f('0x33'),{'body':{'interface':_0xc03c4c},'options':{'where':_0x53de88}});};exports['agentPause']=function(_0x729464,_0x2053ca,_0x244f50){return request(_0xea3f('0x34'),{'body':{'type':_0x2053ca,'uniqueid':_0x244f50},'options':{'where':_0x729464}});};exports[_0xea3f('0x35')]=function(_0x2506d0){return request(_0xea3f('0x36'),{'body':{},'options':{'where':_0x2506d0}});};exports[_0xea3f('0x37')]=function(_0xdfa9d1){return request(_0xea3f('0x38'),{'body':{},'options':{'where':_0xdfa9d1}});}; \ 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 b955baa..5e320d4 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 _0x4e47=['exports'];(function(_0x11cecf,_0xa35f2f){var _0x10308d=function(_0x18f692){while(--_0x18f692){_0x11cecf['push'](_0x11cecf['shift']());}};_0x10308d(++_0xa35f2f);}(_0x4e47,0x17f));var _0x74e4=function(_0x571407,_0x320425){_0x571407=_0x571407-0x0;var _0xcbf9d8=_0x4e47[_0x571407];return _0xcbf9d8;};var polly=require('./polly');var lex=require('./lex');module[_0x74e4('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x31af=['./polly','./lex','exports'];(function(_0x3c6c7c,_0x5771af){var _0x1d6308=function(_0x5f3138){while(--_0x5f3138){_0x3c6c7c['push'](_0x3c6c7c['shift']());}};_0x1d6308(++_0x5771af);}(_0x31af,0xde));var _0xf31a=function(_0x48528f,_0x574d7b){_0x48528f=_0x48528f-0x0;var _0x337266=_0x31af[_0x48528f];return _0x337266;};var polly=require(_0xf31a('0x0'));var lex=require(_0xf31a('0x1'));module[_0xf31a('0x2')]={'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 ab28065..326db13 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['exports','./lib/api'];(function(_0x52ade6,_0x2dd46b){var _0x340fb5=function(_0xc21257){while(--_0xc21257){_0x52ade6['push'](_0x52ade6['shift']());}};_0x340fb5(++_0x2dd46b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0xe5b5[_0x33593e];return _0x53db1a;};'use strict';var lex=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]=function(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763){return lex(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763);}; \ No newline at end of file +var _0xaa88=['exports','./lib/api'];(function(_0xc32025,_0x2f7081){var _0x8ddd99=function(_0x1383f3){while(--_0x1383f3){_0xc32025['push'](_0xc32025['shift']());}};_0x8ddd99(++_0x2f7081);}(_0xaa88,0x137));var _0x8aa8=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xaa88[_0x4ea69d];return _0x5318e0;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);}; \ 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 6669315..5993f17 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(_0x41a5a2,_0x4d127e){var _0x4c2866=function(_0x3a9bc8){while(--_0x3a9bc8){_0x41a5a2['push'](_0x41a5a2['shift']());}};_0x4c2866(++_0x4d127e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x5b3ba1,_0x135724){var _0x2e2434=function(_0x584952){while(--_0x584952){_0x5b3ba1['push'](_0x5b3ba1['shift']());}};_0x2e2434(++_0x135724);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 033c219..ae21a22 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 _0x022b=['./lib/api','exports'];(function(_0x2c6933,_0x2da32a){var _0x59b8f7=function(_0x1a466b){while(--_0x1a466b){_0x2c6933['push'](_0x2c6933['shift']());}};_0x59b8f7(++_0x2da32a);}(_0x022b,0x10e));var _0xb022=function(_0x27e50c,_0x368fd1){_0x27e50c=_0x27e50c-0x0;var _0x40711b=_0x022b[_0x27e50c];return _0x40711b;};'use strict';var polly=require(_0xb022('0x0'));module[_0xb022('0x1')]=function(_0x142b21,_0x412741,_0x3ac597,_0x2a612a,_0x55d95f,_0x36bde2,_0x6398b8){return polly(_0x142b21,_0x412741,_0x3ac597,_0x2a612a,_0x55d95f,_0x36bde2,_0x6398b8);}; \ No newline at end of file +var _0x29c4=['exports'];(function(_0x99df7f,_0x5b0bf2){var _0x15a6be=function(_0x1acbf2){while(--_0x1acbf2){_0x99df7f['push'](_0x99df7f['shift']());}};_0x15a6be(++_0x5b0bf2);}(_0x29c4,0x103));var _0x429c=function(_0x349316,_0x4d02c4){_0x349316=_0x349316-0x0;var _0x194132=_0x29c4[_0x349316];return _0x194132;};'use strict';var polly=require('./lib/api');module[_0x429c('0x0')]=function(_0x5d8509,_0x36feb6,_0x4eed82,_0x364d16,_0x102c72,_0x489c64,_0x35b00d){return polly(_0x5d8509,_0x36feb6,_0x4eed82,_0x364d16,_0x102c72,_0x489c64,_0x35b00d);}; \ 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 9280098..f1908cb 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 _0x2888=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x4ab490,_0xa80a0){var _0x3a5862=function(_0x544143){while(--_0x544143){_0x4ab490['push'](_0x4ab490['shift']());}};_0x3a5862(++_0xa80a0);}(_0x2888,0x125));var _0x8288=function(_0x59efac,_0x40b978){_0x59efac=_0x59efac-0x0;var _0x49fcb3=_0x2888[_0x59efac];return _0x49fcb3;};'use strict';var fs=require('fs');var path=require(_0x8288('0x0'));var BPromise=require('bluebird');var rs=require(_0x8288('0x1'));var AWS=require(_0x8288('0x2'));function pollyResult(_0x10befe,_0x3f6296,_0x16066b){return new BPromise(function(_0x2b00a6,_0x58eb0f){_0x10befe[_0x8288('0x3')](_0x3f6296,function(_0x3314a6,_0xb15fb5){if(_0x3314a6){_0x58eb0f(_0x3314a6);}else if(_0xb15fb5){if(_0xb15fb5[_0x8288('0x4')]instanceof Buffer){fs[_0x8288('0x5')](_0x16066b,_0xb15fb5['AudioStream'],function(_0x142421){if(_0x142421){_0x58eb0f(_0x142421);}else{_0x2b00a6();}});}else{_0x58eb0f(new Error(_0x8288('0x6')));}}else{_0x58eb0f(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x8288('0x7')]=function(_0x456831,_0x771843,_0x383540,_0xcbf1bd,_0xcab8f6,_0x568520,_0x807343){var _0x25e28e=new AWS[(_0x8288('0x8'))]({'accessKeyId':_0x456831,'secretAccessKey':_0x771843,'region':_0x383540});var _0x49bb1d={'Text':_0xcab8f6,'TextType':_0x568520||_0x8288('0x9'),'OutputFormat':_0x8288('0xa'),'VoiceId':_0xcbf1bd};return pollyResult(_0x25e28e,_0x49bb1d,_0x807343);}; \ No newline at end of file +var _0xcdd4=['randomstring','aws-sdk','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0xcdd4,0xa8));var _0x4cdd=function(_0x26114c,_0x3ebcf7){_0x26114c=_0x26114c-0x0;var _0x5121ac=_0xcdd4[_0x26114c];return _0x5121ac;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x4cdd('0x0'));var AWS=require(_0x4cdd('0x1'));function pollyResult(_0x309166,_0x586701,_0x10abaf){return new BPromise(function(_0x3f86e8,_0x4b34b1){_0x309166['synthesizeSpeech'](_0x586701,function(_0x11e499,_0xa60664){if(_0x11e499){_0x4b34b1(_0x11e499);}else if(_0xa60664){if(_0xa60664[_0x4cdd('0x2')]instanceof Buffer){fs['writeFile'](_0x10abaf,_0xa60664[_0x4cdd('0x2')],function(_0x9a6566){if(_0x9a6566){_0x4b34b1(_0x9a6566);}else{_0x3f86e8();}});}else{_0x4b34b1(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4b34b1(new Error(_0x4cdd('0x3')));}});});}module[_0x4cdd('0x4')]=function(_0x2f42b9,_0x32c0e9,_0x105a9c,_0x4703d4,_0x23fdd8,_0x4a4ce1,_0x3edcf4){var _0x45b3d4=new AWS[(_0x4cdd('0x5'))]({'accessKeyId':_0x2f42b9,'secretAccessKey':_0x32c0e9,'region':_0x105a9c});var _0x352143={'Text':_0x23fdd8,'TextType':_0x4a4ce1||_0x4cdd('0x6'),'OutputFormat':_0x4cdd('0x7'),'VoiceId':_0x4703d4};return pollyResult(_0x45b3d4,_0x352143,_0x3edcf4);}; \ 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 fa56d39..ac65b70 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 _0xa13d=['exports'];(function(_0x4e99a1,_0x21b67d){var _0x3edb0e=function(_0x205399){while(--_0x205399){_0x4e99a1['push'](_0x4e99a1['shift']());}};_0x3edb0e(++_0x21b67d);}(_0xa13d,0x13b));var _0xda13=function(_0x2d421d,_0x1a7a72){_0x2d421d=_0x2d421d-0x0;var _0x3eafea=_0xa13d[_0x2d421d];return _0x3eafea;};'use strict';var asr=require('./lib/api');module[_0xda13('0x0')]=function(_0xbcb3a3,_0x567993,_0x193e18,_0x2e6162){return asr(_0xbcb3a3,_0x567993,_0x193e18);}; \ No newline at end of file +var _0x54c2=['exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x54c2,0x139));var _0x254c=function(_0x915908,_0x333bc8){_0x915908=_0x915908-0x0;var _0x26a3ea=_0x54c2[_0x915908];return _0x26a3ea;};'use strict';var asr=require('./lib/api');module[_0x254c('0x0')]=function(_0xb7aca7,_0x5450ed,_0x2353d6,_0x49c269){return asr(_0xb7aca7,_0x5450ed,_0x2353d6);}; \ 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 f4a105f..854e442 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 _0x6308=['string','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x16ed87,_0x1be1a2){var _0xc1a1d8=function(_0x3c0fcf){while(--_0x3c0fcf){_0x16ed87['push'](_0x16ed87['shift']());}};_0xc1a1d8(++_0x1be1a2);}(_0x6308,0x1f2));var _0x8630=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6308[_0x4d613c];return _0x301fe3;};'use strict';var url=require(_0x8630('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x8630('0x1');module['exports']=function(_0x54a006,_0x315284,_0x1ba5a4){return new BPromise(function(_0x89e9db,_0x393f45){var _0xd3ae17;if(typeof _0x54a006!=='string'||_0x54a006['length']===0x0){return _0x393f45(_0x8630('0x2'));}if(typeof _0x315284!=='string'||_0x315284[_0x8630('0x3')]===0x0){return _0x393f45(_0x8630('0x4'));}if(typeof _0x1ba5a4!==_0x8630('0x5')&&(typeof _0x1ba5a4!==_0x8630('0x6')||_0x1ba5a4[_0x8630('0x3')]===0x0)){return _0x393f45(_0x8630('0x7'));}try{_0xd3ae17=fs['readFileSync'](_0x54a006)[_0x8630('0x8')]('base64');}catch(_0x3dc3c8){return _0x393f45(_0x3dc3c8);}return _0x89e9db({'method':_0x8630('0x9'),'uri':host+_0x8630('0xa')+_0x315284,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x8630('0xb'),'languageCode':_0x1ba5a4},'audio':{'content':_0xd3ae17}},'json':!![]});});}; \ No newline at end of file +var _0x222f=['url','bluebird','https://speech.googleapis.com','exports','length','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000'];(function(_0x2bef27,_0x11b00a){var _0x528142=function(_0xe75b12){while(--_0xe75b12){_0x2bef27['push'](_0x2bef27['shift']());}};_0x528142(++_0x11b00a);}(_0x222f,0x1a4));var _0xf222=function(_0x274394,_0x6fd912){_0x274394=_0x274394-0x0;var _0x2a2773=_0x222f[_0x274394];return _0x2a2773;};'use strict';var url=require(_0xf222('0x0'));var BPromise=require(_0xf222('0x1'));var fs=require('fs');var host=_0xf222('0x2');module[_0xf222('0x3')]=function(_0x4d09ec,_0x4b4237,_0x195de1){return new BPromise(function(_0x233e95,_0x307791){var _0x7b187d;if(typeof _0x4d09ec!=='string'||_0x4d09ec[_0xf222('0x4')]===0x0){return _0x307791('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x4b4237!==_0xf222('0x5')||_0x4b4237[_0xf222('0x4')]===0x0){return _0x307791('key\x20should\x20be\x20a\x20string');}if(typeof _0x195de1!==_0xf222('0x6')&&(typeof _0x195de1!==_0xf222('0x5')||_0x195de1['length']===0x0)){return _0x307791(_0xf222('0x7'));}try{_0x7b187d=fs[_0xf222('0x8')](_0x4d09ec)[_0xf222('0x9')](_0xf222('0xa'));}catch(_0x46ccfe){return _0x307791(_0x46ccfe);}return _0x233e95({'method':_0xf222('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x4b4237,'body':{'config':{'encoding':_0xf222('0xc'),'sampleRateHertz':_0xf222('0xd'),'languageCode':_0x195de1},'audio':{'content':_0x7b187d}},'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 3ec0e1c..10cb4be 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 _0xe56e=['exports'];(function(_0x3938cb,_0x47e7fc){var _0x54ed4a=function(_0x49f740){while(--_0x49f740){_0x3938cb['push'](_0x3938cb['shift']());}};_0x54ed4a(++_0x47e7fc);}(_0xe56e,0xa8));var _0xee56=function(_0x3c76fc,_0x39e116){_0x3c76fc=_0x3c76fc-0x0;var _0x4755f5=_0xe56e[_0x3c76fc];return _0x4755f5;};var asr=require('./asr');module[_0xee56('0x0')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index a56312c..f79cbc3 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 _0xbe80=['close','unlink','pipe','end','host','WHAT_EVER','data','transcode','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','then','777','readFileSync','toString','base64','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','audioContent','writeFile','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','awsPolly','polly','.wav','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','CustomAction','channelData','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','https','md5','path','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish\x20download\x20file'];(function(_0x287784,_0xdfd747){var _0xca0b23=function(_0x21909b){while(--_0x21909b){_0x287784['push'](_0x287784['shift']());}};_0xca0b23(++_0xdfd747);}(_0xbe80,0x184));var _0x0be8=function(_0xba5959,_0x5d3be8){_0xba5959=_0xba5959-0x0;var _0x56ace5=_0xbe80[_0xba5959];return _0x56ace5;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x0be8('0x0'));var dialogflow=require(_0x0be8('0x1'));var fs=require('fs');var http=require(_0x0be8('0x2'));var https=require(_0x0be8('0x3'));var md5=require(_0x0be8('0x4'));var path=require(_0x0be8('0x5'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x0be8('0x6'));var sox=require(_0x0be8('0x7'));var tts=require(_0x0be8('0x8'));var urlParse=require(_0x0be8('0x9'))[_0x0be8('0xa')];var util=require('util');var aws=require(_0x0be8('0xb'));var google=require(_0x0be8('0xc'));var sestek=require(_0x0be8('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x0be8('0xe'));var ISPEECH_API=_0x0be8('0xf');function downloadFile(_0x590d71,_0x526f86){return new BPromise(function(_0xd4d294,_0x39e3a2){var _0x5baf6a=urlParse(_0x590d71);var _0xc12b87=_0x5baf6a[_0x0be8('0x10')]===_0x0be8('0x11')?https:http;var _0x1bd92a={'host':_0x5baf6a['host'],'path':_0x5baf6a[_0x0be8('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0xc12b87[_0x0be8('0x12')](_0x1bd92a,function(_0x49c666){if(_0x49c666[_0x0be8('0x13')]!==0xc8){logger[_0x0be8('0x14')](_0x0be8('0x15')+_0x590d71+_0x0be8('0x16')+_0x49c666['statusCode']+'\x20('+_0x49c666[_0x0be8('0x17')]+')');_0x39e3a2(new Error(_0x0be8('0x15')+_0x590d71+_0x0be8('0x16')+_0x49c666[_0x0be8('0x13')]+'\x20('+_0x49c666['statusMessage']+')'));return;}var _0x43175c=fs[_0x0be8('0x18')](_0x526f86);_0x43175c['on']('finish',function(){logger['info'](_0x0be8('0x19'));_0x43175c[_0x0be8('0x1a')](_0xd4d294);});_0x43175c['on'](_0x0be8('0x14'),function(_0x152d4a){fs[_0x0be8('0x1b')](_0x526f86);logger[_0x0be8('0x14')]('download\x20error',_0x152d4a);_0x39e3a2(_0x152d4a);});_0x49c666[_0x0be8('0x1c')](_0x43175c);})['on'](_0x0be8('0x14'),function(_0xae7349){logger[_0x0be8('0x14')](_0xae7349);_0x39e3a2(_0xae7349);})[_0x0be8('0x1d')]();});}function uploadFile(_0x31e1cd){return new BPromise(function(_0x126847,_0x5e488d){var _0x4f04f6=urlParse(_0x31e1cd);var _0x40ceaf=_0x4f04f6[_0x0be8('0x10')]===_0x0be8('0x11')?https:http;var _0x16cc16={'host':_0x4f04f6[_0x0be8('0x1e')],'path':_0x4f04f6[_0x0be8('0x5')],'headers':{'user-agent':_0x0be8('0x1f')}};_0x40ceaf['get'](_0x16cc16,function(_0x173700){if(_0x173700[_0x0be8('0x13')]!==0xc8){_0x5e488d(new Error(_0x0be8('0x15')+_0x31e1cd+_0x0be8('0x16')+_0x173700[_0x0be8('0x13')]+'\x20('+_0x173700[_0x0be8('0x17')]+')'));return;}var _0x4bfe62='';_0x173700['on'](_0x0be8('0x20'),function(_0xbe4049){_0x4bfe62+=_0xbe4049;});_0x173700['on'](_0x0be8('0x1d'),function(){_0x126847(_0x4bfe62);});})['on'](_0x0be8('0x14'),function(_0x583247){_0x5e488d(_0x583247);})['end']();});}function convertFile(_0x31a3ec,_0xc30cc3){return new BPromise(function(_0x1f5000,_0x5debb2){var _0x2be529=sox[_0x0be8('0x21')](_0x31a3ec,_0xc30cc3,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2be529['on']('error',function(_0x4c10f4){logger[_0x0be8('0x14')](_0x0be8('0x22'),_0x4c10f4);_0x5debb2(_0x4c10f4);});_0x2be529['on'](_0x0be8('0x1d'),function(){logger[_0x0be8('0x23')](_0x0be8('0x24'));_0x1f5000();});_0x2be529[_0x0be8('0x25')]();});}function base64Decode(_0x568567,_0x230281){var _0x1a1740=path[_0x0be8('0x26')](__dirname,_0x0be8('0x27'),rs[_0x0be8('0x28')](0x4)+'.wav');fs[_0x0be8('0x29')](_0x1a1740,_0x568567,'base64');return convertFile(_0x1a1740,_0x230281)[_0x0be8('0x2a')](function(){try{fs['unlink'](_0x1a1740);fs['chmodSync'](_0x230281,_0x0be8('0x2b'));}catch(_0x591c79){logger[_0x0be8('0x14')](_0x591c79);}return _0x230281['split']('.')[0x0];});}function base64Encode(_0x14fd20){var _0x264e34=fs[_0x0be8('0x2c')](_0x14fd20);return new Buffer(_0x264e34)[_0x0be8('0x2d')](_0x0be8('0x2e'));}exports['googleCloudTTS']=function(_0x4d2810,_0x5bf6aa,_0x4892a9,_0x5cdc1a,_0x16e300,_0x398871){var _0x2c37a3,_0x5de048;var _0x2e7521=_0x0be8('0x2f');var _0x58947d=_0x0be8('0x30')+_0x4d2810;var _0x7860f1={};if(_0x5bf6aa===_0x0be8('0x31')){_0x7860f1[_0x0be8('0x32')]={'ssml':_0x4892a9};}else{_0x7860f1[_0x0be8('0x32')]={'text':_0x4892a9};};_0x7860f1[_0x0be8('0x33')]={'languageCode':_0x5cdc1a,'ssmlGender':_0x16e300};_0x7860f1[_0x0be8('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x36c570={'url':_0x2e7521+_0x0be8('0x35')+_0x58947d,'method':_0x0be8('0x36'),'json':!![],'body':_0x7860f1};return rp(_0x36c570)['then'](function(_0x535821){return new BPromise(function(_0x1bd72f,_0x10ac93){_0x2c37a3=path[_0x0be8('0x26')](__dirname,_0x0be8('0x27'),rs[_0x0be8('0x28')](0x4)+_0x0be8('0x37'));var _0x72d8ba=Buffer['from'](_0x535821[_0x0be8('0x38')],'base64');return fs[_0x0be8('0x39')](_0x2c37a3,_0x72d8ba,function(_0x362738){_0x10ac93(_0x362738);},function(_0x8fdf43){fs['chmodSync'](_0x2c37a3,_0x0be8('0x2b'));_0x1bd72f(_0x8fdf43);});});})[_0x0be8('0x2a')](function(_0x191a30){_0x5de048=path['resolve'](__dirname,_0x0be8('0x27'),rs[_0x0be8('0x28')](0x4)+'.wav');return convertFile(_0x2c37a3,_0x5de048);})[_0x0be8('0x2a')](function(){try{fs[_0x0be8('0x1b')](_0x2c37a3);fs['chmodSync'](_0x5de048,'777');}catch(_0x3bd687){logger[_0x0be8('0x14')](_0x3bd687);}logger['info']('googleCloudTTS\x20path',_0x5de048[_0x0be8('0x3a')]('.')[0x0]);return _0x5de048[_0x0be8('0x3a')]('.')[0x0];});};exports[_0x0be8('0x3b')]=function(_0x449cfd,_0xb5a054){var _0x2fdee1=_0x0be8('0x3c');var _0x840b30,_0x1f7ec4;var _0x5da330;var _0x2c2723={'encoding':_0x0be8('0x3d'),'method':_0x0be8('0x36'),'timeout':0x2710,'url':_0x2fdee1,'headers':{'Content-Type':_0x0be8('0x3e')},'body':_0x0be8('0x3f')+encodeURIComponent(JSON[_0x0be8('0x40')]([[['jQ1olc',JSON[_0x0be8('0x40')]([_0x449cfd,_0xb5a054||'en',![],_0x0be8('0x41')]),null,_0x0be8('0x42')]]]))};return rp(_0x2c2723)[_0x0be8('0x2a')](function(_0x311e07){try{_0x5da330=eval(_0x311e07['slice'](0x5))[0x0][0x2];}catch(_0x4fd22e){throw new Error(_0x0be8('0x43')+_0x311e07[_0x0be8('0x20')]);}if(!_0x5da330){if(_0x449cfd[_0x0be8('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0xb5a054+_0x0be8('0x45'));}}try{_0x5da330=eval(_0x5da330)[0x0];}catch(_0x1e2f59){throw new Error(_0x0be8('0x43')+res[_0x0be8('0x20')]);}const _0x301d50=_0x5da330;_0x840b30=path[_0x0be8('0x26')](__dirname,'tmp',rs[_0x0be8('0x28')](0x4)+'.mp3');fs[_0x0be8('0x29')](_0x840b30,_0x5da330,{'encoding':_0x0be8('0x2e')});_0x1f7ec4=path[_0x0be8('0x26')](__dirname,_0x0be8('0x27'),rs[_0x0be8('0x28')](0x4)+'.wav');return convertFile(_0x840b30,_0x1f7ec4);})[_0x0be8('0x2a')](function(){try{fs[_0x0be8('0x1b')](_0x840b30);fs['chmodSync'](_0x1f7ec4,_0x0be8('0x2b'));}catch(_0x12d947){logger['error'](_0x12d947);}logger[_0x0be8('0x23')](_0x0be8('0x46'),_0x1f7ec4[_0x0be8('0x3a')]('.')[0x0]);return _0x1f7ec4[_0x0be8('0x3a')]('.')[0x0];});};exports['googleASR']=function(_0x5e23ad,_0x4378cc,_0x5daeb1){return google[_0x0be8('0x47')](_0x5e23ad,_0x4378cc,_0x5daeb1)['then'](function(_0x3f911f){logger[_0x0be8('0x23')](_0x3f911f[_0x0be8('0x48')]);return rp(_0x3f911f);})[_0x0be8('0x2a')](function(_0x20e0c7){var _0x1c1db9='';var _0x5a20e6=0x0;try{fs['unlink'](_0x5e23ad);}catch(_0x50fe29){logger['error'](_0x50fe29);}if(_0x20e0c7&&_0x20e0c7[_0x0be8('0x49')]){_0x1c1db9=_0x20e0c7[_0x0be8('0x49')][_0x0be8('0x4a')](function(_0x10872e){return _0x10872e&&_0x10872e[_0x0be8('0x4b')][0x0]&&_0x10872e[_0x0be8('0x4b')][0x0][_0x0be8('0x4c')]?_0x10872e[_0x0be8('0x4b')][0x0][_0x0be8('0x4c')]:'';})[_0x0be8('0x4d')]('\x0a');_0x5a20e6=_0x20e0c7[_0x0be8('0x49')][_0x0be8('0x4a')](function(_0x1c8bda){return _0x1c8bda&&_0x1c8bda[_0x0be8('0x4b')][0x0]&&_0x1c8bda[_0x0be8('0x4b')][0x0]['confidence']?_0x1c8bda[_0x0be8('0x4b')][0x0][_0x0be8('0x4e')]:0x0;})[_0x0be8('0x4d')]('\x0a');}logger[_0x0be8('0x23')](_0x0be8('0x4f'),_0x1c1db9);logger[_0x0be8('0x23')]('googleASR\x20confidence',_0x5a20e6);return{'transcript':_0x1c1db9,'confidence':_0x5a20e6};})[_0x0be8('0x50')](function(_0x18c328){logger[_0x0be8('0x14')](_0x0be8('0x51'),_0x18c328[_0x0be8('0x13')],_0x18c328[_0x0be8('0x52')],_0x18c328[_0x0be8('0x53')]);});};exports[_0x0be8('0x54')]=function(_0x40a129,_0x197fcc,_0x33fbaa,_0x4a909a){var _0x47dc3a=apiai(_0x197fcc,{'language':_0x4a909a||'en'});return _0x47dc3a[_0x0be8('0x55')](_0x33fbaa,{'sessionId':md5(_0x40a129)})[_0x0be8('0x2a')](function(_0x380bf9){logger[_0x0be8('0x23')](JSON[_0x0be8('0x40')](_0x380bf9));return{'source':_0x380bf9[_0x0be8('0x56')][_0x0be8('0x57')],'resolvedQuery':_0x380bf9[_0x0be8('0x56')][_0x0be8('0x58')],'action':_0x380bf9[_0x0be8('0x56')][_0x0be8('0x59')],'actionIncomplete':_0x380bf9['result'][_0x0be8('0x5a')],'speech':_0x380bf9['result'][_0x0be8('0x5b')][_0x0be8('0x5c')],'score':_0x380bf9[_0x0be8('0x56')][_0x0be8('0x5d')],'statusCode':_0x380bf9[_0x0be8('0x5e')]['code'],'endConversation':_0x380bf9[_0x0be8('0x56')]['metadata'][_0x0be8('0x5f')]||![],'isFallbackIntent':_0x380bf9[_0x0be8('0x56')][_0x0be8('0x60')][_0x0be8('0x61')]};});};exports[_0x0be8('0x62')]=function(_0x3c3b2e,_0x154c5b,_0x3e2af6,_0x4c4df2,_0x315f14,_0x2f470b){var _0x1aad0e=_0x4c4df2[_0x0be8('0x63')](/\\n/g,'\x0a');var _0x4aec55={'credentials':{'private_key':_0x1aad0e,'client_email':_0x3e2af6}};var _0x2e4897=new dialogflow[(_0x0be8('0x64'))](_0x4aec55);var _0x1bf2fa=_0x2e4897[_0x0be8('0x65')](_0x154c5b,md5(_0x3c3b2e));var _0x4e9a8e={'session':_0x1bf2fa,'queryInput':{'text':{'text':_0x315f14,'languageCode':_0x2f470b}}};return _0x2e4897[_0x0be8('0x66')](_0x4e9a8e)['then'](function(_0x4aaa05){if(_0x4aaa05&&_0x4aaa05[_0x0be8('0x44')]){logger[_0x0be8('0x23')](_0x0be8('0x67'),JSON[_0x0be8('0x40')](_0x4aaa05));var _0x4cf09d=_0x4aaa05[0x0];if(_0x4cf09d){var _0x2703e6={'action':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x59')],'allRequiredParamsPresent':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x69')],'endConversation':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x6a')]&&_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x6a')]['fields']?_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x6a')]['fields'][_0x0be8('0x6b')][_0x0be8('0x6c')]:![],'fulfillmentText':_0x4cf09d['queryResult'][_0x0be8('0x6d')],'intentName':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x6e')][_0x0be8('0x52')],'intentDisplayName':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x6e')][_0x0be8('0x6f')],'isFallbackIntent':_0x4cf09d[_0x0be8('0x68')]['intent'][_0x0be8('0x70')],'languageCode':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x71')],'queryText':_0x4cf09d[_0x0be8('0x68')]['queryText'],'responseId':_0x4cf09d[_0x0be8('0x72')],'score':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x73')],'speech':_0x4cf09d[_0x0be8('0x68')][_0x0be8('0x6d')],'providerResponse':JSON[_0x0be8('0x40')](_0x4aaa05)};return _0x2703e6;}}});};exports[_0x0be8('0x74')]=function(_0x3c9b24,_0x4118d1,_0x5cb072,_0x247e42){return tilde[_0x0be8('0x47')](_0x3c9b24,_0x4118d1,_0x5cb072,_0x247e42)[_0x0be8('0x2a')](function(_0x2fdf5b){try{fs['unlink'](_0x3c9b24);}catch(_0x101259){logger['error'](_0x101259);}logger[_0x0be8('0x23')]('Tilde\x20ASR\x20transcription',_0x2fdf5b['transcript']);logger[_0x0be8('0x23')]('Tilde\x20ASR\x20confidence',_0x2fdf5b[_0x0be8('0x4e')]);return _0x2fdf5b;});};exports[_0x0be8('0x75')]=function(_0x403ef5,_0x1682c3,_0x3ee6dc,_0x6072ea,_0x299b6f,_0x44fac3){var _0x547e3f=path[_0x0be8('0x26')](__dirname,'tmp',rs[_0x0be8('0x28')](0x4)+_0x0be8('0x37'));var _0x15d1fb;return aws[_0x0be8('0x76')](_0x403ef5,_0x1682c3,_0x3ee6dc,_0x6072ea,_0x299b6f,_0x44fac3,_0x547e3f)['then'](function(){_0x15d1fb=path[_0x0be8('0x26')](__dirname,_0x0be8('0x27'),rs['generate'](0x4)+_0x0be8('0x77'));return convertFile(_0x547e3f,_0x15d1fb);})[_0x0be8('0x2a')](function(){try{fs['unlink'](_0x547e3f);fs[_0x0be8('0x78')](_0x15d1fb,_0x0be8('0x2b'));}catch(_0x3e000f){logger[_0x0be8('0x14')](_0x3e000f);}return _0x15d1fb[_0x0be8('0x3a')]('.')[0x0];});};exports[_0x0be8('0x79')]=function(_0x41b821,_0x1c70ad,_0x5e01a5,_0x554ab7,_0x57c0bc,_0x264ef3){return aws[_0x0be8('0x7a')](_0x41b821,_0x1c70ad,_0x5e01a5,_0x554ab7,_0x57c0bc,_0x264ef3)['then'](function(_0x3af06a){logger[_0x0be8('0x23')](JSON[_0x0be8('0x40')](_0x3af06a));return _0x3af06a;});};exports[_0x0be8('0x7b')]=function(_0x56c463,_0x53ee73,_0xa89592,_0x5dc7fc){var _0xe92d3d=util[_0x0be8('0x7c')](_0x0be8('0x7d'),ISPEECH_API,_0x56c463,encodeURIComponent(_0x53ee73),_0xa89592,_0x5dc7fc);var _0x3b36f5=path[_0x0be8('0x26')](__dirname,'tmp',rs[_0x0be8('0x28')](0x4)+_0x0be8('0x37'));var _0x34f0e0;return downloadFile(_0xe92d3d,_0x3b36f5)[_0x0be8('0x2a')](function(){_0x34f0e0=path['resolve'](__dirname,'tmp',rs[_0x0be8('0x28')](0x4)+_0x0be8('0x77'));return convertFile(_0x3b36f5,_0x34f0e0);})['then'](function(){try{fs[_0x0be8('0x1b')](_0x3b36f5);fs[_0x0be8('0x78')](_0x34f0e0,_0x0be8('0x2b'));}catch(_0x5af05b){logger[_0x0be8('0x14')](_0x5af05b);}return _0x34f0e0[_0x0be8('0x3a')]('.')[0x0];});};exports[_0x0be8('0x7e')]=function(_0x348309,_0xa4ba9f,_0x52d9bd,_0x5a2b50){var _0x2a39d2=util['format'](_0x0be8('0x7f'),ISPEECH_API,_0xa4ba9f,_0x52d9bd,base64Encode(_0x348309),_0x5a2b50?util['format'](_0x0be8('0x80'),encodeURIComponent(_0x5a2b50)):'freeform=3');return uploadFile(_0x2a39d2)['then'](function(_0x2a024e){return querystring['parse'](_0x2a024e);});};exports[_0x0be8('0x81')]=function(_0x3a129b,_0x4fad60){return sestek[_0x0be8('0x82')](_0x3a129b,_0x4fad60)[_0x0be8('0x2a')](function(_0x204aec){logger['info'](JSON[_0x0be8('0x40')](_0x204aec));var _0x99fc50={'speech':_0x204aec[_0x0be8('0x83')],'action':_0x204aec['channelData']?_0x204aec['channelData'][_0x0be8('0x84')]:undefined,'actiondata':_0x204aec[_0x0be8('0x85')]?_0x204aec['channelData'][_0x0be8('0x86')]:undefined};if(_0x204aec['channelData']&&_0x204aec[_0x0be8('0x85')][_0x0be8('0x87')]){return base64Decode(_0x204aec[_0x0be8('0x85')][_0x0be8('0x87')][_0x0be8('0x88')],path['resolve'](__dirname,_0x0be8('0x27'),rs[_0x0be8('0x28')](0x4)+'.wav'))[_0x0be8('0x2a')](function(_0x466d40){_0x99fc50['audiofile']=_0x466d40;return _0x99fc50;});}return _0x99fc50;});};exports[_0x0be8('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x240b=['input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','googleASR','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','textRequest','result','source','resolvedQuery','fulfillment','speech','score','status','code','metadata','endConversation','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','name','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink','WHAT_EVER','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','split','readFileSync','toString','base64','googleCloudTTS','?key=','ssml'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x240b,0xd7));var _0xb240=function(_0x30fe42,_0x305361){_0x30fe42=_0x30fe42-0x0;var _0x9ef966=_0x240b[_0x30fe42];return _0x9ef966;};'use strict';var apiai=require(_0xb240('0x0'));var BPromise=require(_0xb240('0x1'));var dialogflow=require(_0xb240('0x2'));var fs=require('fs');var http=require(_0xb240('0x3'));var https=require(_0xb240('0x4'));var md5=require(_0xb240('0x5'));var path=require(_0xb240('0x6'));var querystring=require('querystring');var rp=require(_0xb240('0x7'));var rs=require(_0xb240('0x8'));var sox=require(_0xb240('0x9'));var tts=require(_0xb240('0xa'));var urlParse=require('url')['parse'];var util=require('util');var aws=require(_0xb240('0xb'));var google=require(_0xb240('0xc'));var sestek=require('./sestek');var tilde=require(_0xb240('0xd'));var logger=require('../../../config/logger')(_0xb240('0xe'));var ISPEECH_API=_0xb240('0xf');function downloadFile(_0x2f7b20,_0x22f7a){return new BPromise(function(_0x33b087,_0x2039d9){var _0x418983=urlParse(_0x2f7b20);var _0x3a6feb=_0x418983[_0xb240('0x10')]===_0xb240('0x11')?https:http;var _0x1550f9={'host':_0x418983[_0xb240('0x12')],'path':_0x418983[_0xb240('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x3a6feb[_0xb240('0x13')](_0x1550f9,function(_0x4773a8){if(_0x4773a8[_0xb240('0x14')]!==0xc8){logger[_0xb240('0x15')](_0xb240('0x16')+_0x2f7b20+_0xb240('0x17')+_0x4773a8[_0xb240('0x14')]+'\x20('+_0x4773a8[_0xb240('0x18')]+')');_0x2039d9(new Error(_0xb240('0x16')+_0x2f7b20+_0xb240('0x17')+_0x4773a8['statusCode']+'\x20('+_0x4773a8[_0xb240('0x18')]+')'));return;}var _0x272f91=fs[_0xb240('0x19')](_0x22f7a);_0x272f91['on'](_0xb240('0x1a'),function(){logger[_0xb240('0x1b')](_0xb240('0x1c'));_0x272f91['close'](_0x33b087);});_0x272f91['on']('error',function(_0x19fd6a){fs[_0xb240('0x1d')](_0x22f7a);logger[_0xb240('0x15')]('download\x20error',_0x19fd6a);_0x2039d9(_0x19fd6a);});_0x4773a8['pipe'](_0x272f91);})['on'](_0xb240('0x15'),function(_0x3c28d0){logger['error'](_0x3c28d0);_0x2039d9(_0x3c28d0);})['end']();});}function uploadFile(_0x6ff1f4){return new BPromise(function(_0x131040,_0x5aaff7){var _0x5b22b0=urlParse(_0x6ff1f4);var _0x435679=_0x5b22b0[_0xb240('0x10')]===_0xb240('0x11')?https:http;var _0x29f7f2={'host':_0x5b22b0[_0xb240('0x12')],'path':_0x5b22b0['path'],'headers':{'user-agent':_0xb240('0x1e')}};_0x435679['get'](_0x29f7f2,function(_0x497e0b){if(_0x497e0b[_0xb240('0x14')]!==0xc8){_0x5aaff7(new Error('request\x20to\x20'+_0x6ff1f4+_0xb240('0x17')+_0x497e0b[_0xb240('0x14')]+'\x20('+_0x497e0b['statusMessage']+')'));return;}var _0x46b668='';_0x497e0b['on'](_0xb240('0x1f'),function(_0x5650f9){_0x46b668+=_0x5650f9;});_0x497e0b['on'](_0xb240('0x20'),function(){_0x131040(_0x46b668);});})['on'](_0xb240('0x15'),function(_0x1d23b2){_0x5aaff7(_0x1d23b2);})[_0xb240('0x20')]();});}function convertFile(_0x22622a,_0x56e454){return new BPromise(function(_0x4f3e5a,_0x39a64f){var _0x456b73=sox[_0xb240('0x21')](_0x22622a,_0x56e454,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x456b73['on'](_0xb240('0x15'),function(_0x444f14){logger[_0xb240('0x15')](_0xb240('0x22'),_0x444f14);_0x39a64f(_0x444f14);});_0x456b73['on'](_0xb240('0x20'),function(){logger[_0xb240('0x1b')](_0xb240('0x23'));_0x4f3e5a();});_0x456b73[_0xb240('0x24')]();});}function base64Decode(_0x2c6fca,_0x3fd6d8){var _0x51bb43=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs[_0xb240('0x27')](0x4)+_0xb240('0x28'));fs[_0xb240('0x29')](_0x51bb43,_0x2c6fca,'base64');return convertFile(_0x51bb43,_0x3fd6d8)[_0xb240('0x2a')](function(){try{fs[_0xb240('0x1d')](_0x51bb43);fs[_0xb240('0x2b')](_0x3fd6d8,'777');}catch(_0x4149ec){logger[_0xb240('0x15')](_0x4149ec);}return _0x3fd6d8[_0xb240('0x2c')]('.')[0x0];});}function base64Encode(_0x199ce7){var _0x555188=fs[_0xb240('0x2d')](_0x199ce7);return new Buffer(_0x555188)[_0xb240('0x2e')](_0xb240('0x2f'));}exports[_0xb240('0x30')]=function(_0x1d57ae,_0x5f3598,_0x46d1c2,_0x1a3f51,_0x388380,_0x57cf48){var _0x471f49,_0x24ffb1;var _0x48ac17='https://texttospeech.googleapis.com/v1/';var _0x230170=_0xb240('0x31')+_0x1d57ae;var _0x2ca479={};if(_0x5f3598===_0xb240('0x32')){_0x2ca479[_0xb240('0x33')]={'ssml':_0x46d1c2};}else{_0x2ca479[_0xb240('0x33')]={'text':_0x46d1c2};};_0x2ca479[_0xb240('0x34')]={'languageCode':_0x1a3f51,'ssmlGender':_0x388380};_0x2ca479[_0xb240('0x35')]={'audioEncoding':_0xb240('0x36'),'sampleRateHertz':0x1f40};var _0x867d86={'url':_0x48ac17+_0xb240('0x37')+_0x230170,'method':_0xb240('0x38'),'json':!![],'body':_0x2ca479};return rp(_0x867d86)['then'](function(_0x8c6fd1){return new BPromise(function(_0x10cb13,_0xe86c00){_0x471f49=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs[_0xb240('0x27')](0x4)+_0xb240('0x39'));var _0x5ab131=Buffer[_0xb240('0x3a')](_0x8c6fd1[_0xb240('0x3b')],_0xb240('0x2f'));return fs['writeFile'](_0x471f49,_0x5ab131,function(_0x3f90f8){_0xe86c00(_0x3f90f8);},function(_0x93813a){fs[_0xb240('0x2b')](_0x471f49,_0xb240('0x3c'));_0x10cb13(_0x93813a);});});})['then'](function(_0xb68b38){_0x24ffb1=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs[_0xb240('0x27')](0x4)+'.wav');return convertFile(_0x471f49,_0x24ffb1);})['then'](function(){try{fs[_0xb240('0x1d')](_0x471f49);fs[_0xb240('0x2b')](_0x24ffb1,_0xb240('0x3c'));}catch(_0x4482b1){logger['error'](_0x4482b1);}logger[_0xb240('0x1b')](_0xb240('0x3d'),_0x24ffb1['split']('.')[0x0]);return _0x24ffb1[_0xb240('0x2c')]('.')[0x0];});};exports[_0xb240('0x3e')]=function(_0x167d7e,_0x29d79a){var _0x211e9b=_0xb240('0x3f');var _0x26fd1d,_0x5c5a57;var _0x4e969a;var _0x240f2c={'encoding':_0xb240('0x40'),'method':_0xb240('0x38'),'timeout':0x2710,'url':_0x211e9b,'headers':{'Content-Type':_0xb240('0x41')},'body':_0xb240('0x42')+encodeURIComponent(JSON[_0xb240('0x43')]([[[_0xb240('0x44'),JSON[_0xb240('0x43')]([_0x167d7e,_0x29d79a||'en',![],_0xb240('0x45')]),null,_0xb240('0x46')]]]))};return rp(_0x240f2c)[_0xb240('0x2a')](function(_0x1438e5){try{_0x4e969a=eval(_0x1438e5[_0xb240('0x47')](0x5))[0x0][0x2];}catch(_0x387ab3){throw new Error('parse\x20response\x20failed:\x0a'+_0x1438e5['data']);}if(!_0x4e969a){if(_0x167d7e['length']>0xc8){throw new Error(_0xb240('0x48'));}else{throw new Error(_0xb240('0x49')+_0x29d79a+_0xb240('0x4a'));}}try{_0x4e969a=eval(_0x4e969a)[0x0];}catch(_0x2a0662){throw new Error(_0xb240('0x4b')+res[_0xb240('0x1f')]);}const _0x2317d0=_0x4e969a;_0x26fd1d=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs[_0xb240('0x27')](0x4)+'.mp3');fs[_0xb240('0x29')](_0x26fd1d,_0x4e969a,{'encoding':_0xb240('0x2f')});_0x5c5a57=path[_0xb240('0x25')](__dirname,'tmp',rs[_0xb240('0x27')](0x4)+_0xb240('0x28'));return convertFile(_0x26fd1d,_0x5c5a57);})[_0xb240('0x2a')](function(){try{fs[_0xb240('0x1d')](_0x26fd1d);fs[_0xb240('0x2b')](_0x5c5a57,'777');}catch(_0x5ae47e){logger[_0xb240('0x15')](_0x5ae47e);}logger[_0xb240('0x1b')]('goggleTTS\x20path',_0x5c5a57[_0xb240('0x2c')]('.')[0x0]);return _0x5c5a57[_0xb240('0x2c')]('.')[0x0];});};exports[_0xb240('0x4c')]=function(_0x145423,_0xb27e83,_0x44262d){return google['asr'](_0x145423,_0xb27e83,_0x44262d)[_0xb240('0x2a')](function(_0x315207){logger['info'](_0x315207['uri']);return rp(_0x315207);})['then'](function(_0x57deaa){var _0x26008a='';var _0x22b6be=0x0;try{fs['unlink'](_0x145423);}catch(_0x16149e){logger[_0xb240('0x15')](_0x16149e);}if(_0x57deaa&&_0x57deaa[_0xb240('0x4d')]){_0x26008a=_0x57deaa[_0xb240('0x4d')]['map'](function(_0x4247f3){return _0x4247f3&&_0x4247f3[_0xb240('0x4e')][0x0]&&_0x4247f3[_0xb240('0x4e')][0x0][_0xb240('0x4f')]?_0x4247f3[_0xb240('0x4e')][0x0][_0xb240('0x4f')]:'';})[_0xb240('0x50')]('\x0a');_0x22b6be=_0x57deaa['results']['map'](function(_0x3ddff8){return _0x3ddff8&&_0x3ddff8[_0xb240('0x4e')][0x0]&&_0x3ddff8[_0xb240('0x4e')][0x0][_0xb240('0x51')]?_0x3ddff8[_0xb240('0x4e')][0x0][_0xb240('0x51')]:0x0;})[_0xb240('0x50')]('\x0a');}logger['info'](_0xb240('0x52'),_0x26008a);logger['info'](_0xb240('0x53'),_0x22b6be);return{'transcript':_0x26008a,'confidence':_0x22b6be};})[_0xb240('0x54')](function(_0xb29b72){logger[_0xb240('0x15')](_0xb240('0x55'),_0xb29b72[_0xb240('0x14')],_0xb29b72['name'],_0xb29b72['message']);});};exports[_0xb240('0x56')]=function(_0x482860,_0xa703a6,_0x474592,_0x1b1853){var _0x32d3e7=apiai(_0xa703a6,{'language':_0x1b1853||'en'});return _0x32d3e7[_0xb240('0x57')](_0x474592,{'sessionId':md5(_0x482860)})[_0xb240('0x2a')](function(_0x1f0568){logger[_0xb240('0x1b')](JSON[_0xb240('0x43')](_0x1f0568));return{'source':_0x1f0568[_0xb240('0x58')][_0xb240('0x59')],'resolvedQuery':_0x1f0568[_0xb240('0x58')][_0xb240('0x5a')],'action':_0x1f0568['result']['action'],'actionIncomplete':_0x1f0568[_0xb240('0x58')]['actionIncomplete'],'speech':_0x1f0568[_0xb240('0x58')][_0xb240('0x5b')][_0xb240('0x5c')],'score':_0x1f0568[_0xb240('0x58')][_0xb240('0x5d')],'statusCode':_0x1f0568[_0xb240('0x5e')][_0xb240('0x5f')],'endConversation':_0x1f0568[_0xb240('0x58')][_0xb240('0x60')][_0xb240('0x61')]||![],'isFallbackIntent':_0x1f0568[_0xb240('0x58')][_0xb240('0x60')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x339a4d,_0x15ddef,_0x13d6fe,_0x229e4a,_0x41ee1c,_0x406f70){var _0xe2a39=_0x229e4a['replace'](/\\n/g,'\x0a');var _0x3871c8={'credentials':{'private_key':_0xe2a39,'client_email':_0x13d6fe}};var _0x3952de=new dialogflow['SessionsClient'](_0x3871c8);var _0x434b31=_0x3952de[_0xb240('0x62')](_0x15ddef,md5(_0x339a4d));var _0x2e6c4a={'session':_0x434b31,'queryInput':{'text':{'text':_0x41ee1c,'languageCode':_0x406f70}}};return _0x3952de[_0xb240('0x63')](_0x2e6c4a)['then'](function(_0x1fdb31){if(_0x1fdb31&&_0x1fdb31[_0xb240('0x64')]){logger[_0xb240('0x1b')](_0xb240('0x65'),JSON[_0xb240('0x43')](_0x1fdb31));var _0x36f9ad=_0x1fdb31[0x0];if(_0x36f9ad){var _0xf1a63c={'action':_0x36f9ad[_0xb240('0x66')]['action'],'allRequiredParamsPresent':_0x36f9ad['queryResult'][_0xb240('0x67')],'endConversation':_0x36f9ad[_0xb240('0x66')]['diagnosticInfo']&&_0x36f9ad[_0xb240('0x66')][_0xb240('0x68')][_0xb240('0x69')]?_0x36f9ad['queryResult'][_0xb240('0x68')][_0xb240('0x69')][_0xb240('0x6a')]['boolValue']:![],'fulfillmentText':_0x36f9ad[_0xb240('0x66')][_0xb240('0x6b')],'intentName':_0x36f9ad['queryResult'][_0xb240('0x6c')][_0xb240('0x6d')],'intentDisplayName':_0x36f9ad[_0xb240('0x66')][_0xb240('0x6c')]['displayName'],'isFallbackIntent':_0x36f9ad[_0xb240('0x66')]['intent'][_0xb240('0x6e')],'languageCode':_0x36f9ad[_0xb240('0x66')][_0xb240('0x6f')],'queryText':_0x36f9ad[_0xb240('0x66')][_0xb240('0x70')],'responseId':_0x36f9ad['responseId'],'score':_0x36f9ad[_0xb240('0x66')][_0xb240('0x71')],'speech':_0x36f9ad[_0xb240('0x66')]['fulfillmentText'],'providerResponse':JSON[_0xb240('0x43')](_0x1fdb31)};return _0xf1a63c;}}});};exports[_0xb240('0x72')]=function(_0x342fea,_0x5ec04b,_0x10a9f7,_0x299105){return tilde['asr'](_0x342fea,_0x5ec04b,_0x10a9f7,_0x299105)[_0xb240('0x2a')](function(_0x5658e6){try{fs[_0xb240('0x1d')](_0x342fea);}catch(_0x9538b2){logger['error'](_0x9538b2);}logger[_0xb240('0x1b')](_0xb240('0x73'),_0x5658e6[_0xb240('0x4f')]);logger[_0xb240('0x1b')]('Tilde\x20ASR\x20confidence',_0x5658e6[_0xb240('0x51')]);return _0x5658e6;});};exports[_0xb240('0x74')]=function(_0x336365,_0x5c1338,_0x544ea0,_0x4593e5,_0x3a4522,_0x595261){var _0x13991b=path['resolve'](__dirname,_0xb240('0x26'),rs[_0xb240('0x27')](0x4)+_0xb240('0x39'));var _0x2d7e8d;return aws[_0xb240('0x75')](_0x336365,_0x5c1338,_0x544ea0,_0x4593e5,_0x3a4522,_0x595261,_0x13991b)[_0xb240('0x2a')](function(){_0x2d7e8d=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x13991b,_0x2d7e8d);})[_0xb240('0x2a')](function(){try{fs[_0xb240('0x1d')](_0x13991b);fs['chmodSync'](_0x2d7e8d,_0xb240('0x3c'));}catch(_0x5f2f94){logger[_0xb240('0x15')](_0x5f2f94);}return _0x2d7e8d[_0xb240('0x2c')]('.')[0x0];});};exports[_0xb240('0x76')]=function(_0x18f6f9,_0x36ed7e,_0x183dc3,_0x1a1cd1,_0x525462,_0x40c561){return aws[_0xb240('0x77')](_0x18f6f9,_0x36ed7e,_0x183dc3,_0x1a1cd1,_0x525462,_0x40c561)[_0xb240('0x2a')](function(_0x5f2655){logger[_0xb240('0x1b')](JSON[_0xb240('0x43')](_0x5f2655));return _0x5f2655;});};exports['ispeechTTS']=function(_0x417fe5,_0x39296c,_0x55adbf,_0xd23ad9){var _0xc72b37=util['format'](_0xb240('0x78'),ISPEECH_API,_0x417fe5,encodeURIComponent(_0x39296c),_0x55adbf,_0xd23ad9);var _0x1de948=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs['generate'](0x4)+_0xb240('0x39'));var _0x56f617;return downloadFile(_0xc72b37,_0x1de948)[_0xb240('0x2a')](function(){_0x56f617=path[_0xb240('0x25')](__dirname,_0xb240('0x26'),rs[_0xb240('0x27')](0x4)+'.wav');return convertFile(_0x1de948,_0x56f617);})[_0xb240('0x2a')](function(){try{fs[_0xb240('0x1d')](_0x1de948);fs['chmodSync'](_0x56f617,'777');}catch(_0x442940){logger[_0xb240('0x15')](_0x442940);}return _0x56f617[_0xb240('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x7f5e65,_0x4b4db3,_0x28de32,_0x51df95){var _0x278def=util[_0xb240('0x79')](_0xb240('0x7a'),ISPEECH_API,_0x4b4db3,_0x28de32,base64Encode(_0x7f5e65),_0x51df95?util[_0xb240('0x79')](_0xb240('0x7b'),encodeURIComponent(_0x51df95)):_0xb240('0x7c'));return uploadFile(_0x278def)['then'](function(_0x371c84){return querystring[_0xb240('0x7d')](_0x371c84);});};exports[_0xb240('0x7e')]=function(_0x1a2dcf,_0x3dd146){return sestek['nda'](_0x1a2dcf,_0x3dd146)[_0xb240('0x2a')](function(_0x493582){logger[_0xb240('0x1b')](JSON[_0xb240('0x43')](_0x493582));var _0x18fbff={'speech':_0x493582['text'],'action':_0x493582[_0xb240('0x7f')]?_0x493582[_0xb240('0x7f')][_0xb240('0x80')]:undefined,'actiondata':_0x493582[_0xb240('0x7f')]?_0x493582[_0xb240('0x7f')][_0xb240('0x81')]:undefined};if(_0x493582['channelData']&&_0x493582[_0xb240('0x7f')][_0xb240('0x82')]){return base64Decode(_0x493582['channelData'][_0xb240('0x82')][_0xb240('0x83')],path['resolve'](__dirname,'tmp',rs[_0xb240('0x27')](0x4)+_0xb240('0x28')))[_0xb240('0x2a')](function(_0x368a5d){_0x18fbff['audiofile']=_0x368a5d;return _0x18fbff;});}return _0x18fbff;});};exports[_0xb240('0x84')]=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 6435df4..fa4c51b 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 _0xcba2=['exports'];(function(_0x453510,_0x1fc635){var _0x3b4ffb=function(_0x434203){while(--_0x434203){_0x453510['push'](_0x453510['shift']());}};_0x3b4ffb(++_0x1fc635);}(_0xcba2,0x18f));var _0x2cba=function(_0x7b85cc,_0x428651){_0x7b85cc=_0x7b85cc-0x0;var _0x2251ac=_0xcba2[_0x7b85cc];return _0x2251ac;};var nda=require('./nda');module[_0x2cba('0x0')]={'nda':nda}; \ No newline at end of file +var _0xb281=['exports','./nda'];(function(_0x390c17,_0x2ef4af){var _0x18067c=function(_0x3718f0){while(--_0x3718f0){_0x390c17['push'](_0x390c17['shift']());}};_0x18067c(++_0x2ef4af);}(_0xb281,0xcd));var _0x1b28=function(_0x1d8202,_0x300831){_0x1d8202=_0x1d8202-0x0;var _0x546b53=_0xb281[_0x1d8202];return _0x546b53;};var nda=require(_0x1b28('0x0'));module[_0x1b28('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 032433f..60a6929 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 _0x6822=['then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','calleridname','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','info','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x6822,0x18c));var _0x2682=function(_0x3c327c,_0x372943){_0x3c327c=_0x3c327c-0x0;var _0x54b3f4=_0x6822[_0x3c327c];return _0x54b3f4;};'use strict';var rp=require('request-promise');var url=require(_0x2682('0x0'));var logger=require(_0x2682('0x1'))(_0x2682('0x2'));module[_0x2682('0x3')]=function(_0x5ccdb9,_0x2ac70f){var _0xa240ee={'method':_0x2682('0x4'),'uri':url[_0x2682('0x5')](_0x2ac70f[_0x2682('0x6')],_0x2682('0x7')),'form':{'grant_type':_0x2682('0x8'),'username':_0x2ac70f[_0x2682('0x9')],'password':_0x2ac70f[_0x2682('0x8')]},'json':!![]};return rp(_0xa240ee)[_0x2682('0xa')](function(_0x4242c5){var _0x1a1307={'method':_0x2682('0x4'),'uri':url[_0x2682('0x5')](_0x2ac70f['ndassistant_url'],_0x2682('0xb')),'body':{'type':_0x2ac70f[_0x2682('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x5ccdb9['uniqueid']},'from':{'id':_0x5ccdb9[_0x2682('0xd')],'name':_0x5ccdb9[_0x2682('0xe')]},'recipient':{'id':_0x5ccdb9['dnid'],'name':_0x5ccdb9[_0x2682('0xf')]},'text':_0x2ac70f[_0x2682('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4242c5[_0x2682('0x11')]},'json':!![]};if(_0x2ac70f[_0x2682('0x12')]){_0x1a1307[_0x2682('0x13')][_0x2682('0x14')][_0x2682('0x15')]=_0x2ac70f[_0x2682('0x12')];}if(_0x2ac70f[_0x2682('0x16')]=='1'){_0x1a1307[_0x2682('0x13')][_0x2682('0x14')][_0x2682('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2682('0x18')};}if(_0x2ac70f[_0x2682('0x19')]){_0x1a1307[_0x2682('0x13')][_0x2682('0x14')][_0x2682('0x1a')]=_0x2ac70f['custom_action'];if(_0x2ac70f['custom_action_data']){_0x1a1307[_0x2682('0x13')][_0x2682('0x14')][_0x2682('0x1b')]=_0x2ac70f['custom_action_data'];}}logger[_0x2682('0x1c')](JSON['stringify'](_0x1a1307));return rp(_0x1a1307);});}; \ No newline at end of file +var _0xdeb7=['url','../../../../../config/logger','exports','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','ndaactivity_type','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','stringify','request-promise'];(function(_0x298850,_0x4874f0){var _0x36a052=function(_0x6ebc36){while(--_0x6ebc36){_0x298850['push'](_0x298850['shift']());}};_0x36a052(++_0x4874f0);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var rp=require(_0x7deb('0x0'));var url=require(_0x7deb('0x1'));var logger=require(_0x7deb('0x2'))('agi');module[_0x7deb('0x3')]=function(_0x161729,_0x6c21e2){var _0x20de63={'method':_0x7deb('0x4'),'uri':url['resolve'](_0x6c21e2[_0x7deb('0x5')],_0x7deb('0x6')),'form':{'grant_type':_0x7deb('0x7'),'username':_0x6c21e2[_0x7deb('0x8')],'password':_0x6c21e2[_0x7deb('0x7')]},'json':!![]};return rp(_0x20de63)[_0x7deb('0x9')](function(_0x4e3d14){var _0xfa72b7={'method':_0x7deb('0x4'),'uri':url[_0x7deb('0xa')](_0x6c21e2[_0x7deb('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x6c21e2[_0x7deb('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x161729[_0x7deb('0xd')]},'from':{'id':_0x161729['callerid'],'name':_0x161729[_0x7deb('0xe')]},'recipient':{'id':_0x161729[_0x7deb('0xf')],'name':_0x161729[_0x7deb('0x10')]},'text':_0x6c21e2['text'],'channelData':{}},'headers':{'Authorization':_0x7deb('0x11')+_0x4e3d14[_0x7deb('0x12')]},'json':!![]};if(_0x6c21e2[_0x7deb('0x13')]){_0xfa72b7[_0x7deb('0x14')]['channelData'][_0x7deb('0x15')]=_0x6c21e2[_0x7deb('0x13')];}if(_0x6c21e2[_0x7deb('0x16')]=='1'){_0xfa72b7[_0x7deb('0x14')][_0x7deb('0x17')][_0x7deb('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7deb('0x19')};}if(_0x6c21e2[_0x7deb('0x1a')]){_0xfa72b7[_0x7deb('0x14')][_0x7deb('0x17')][_0x7deb('0x1b')]=_0x6c21e2[_0x7deb('0x1a')];if(_0x6c21e2[_0x7deb('0x1c')]){_0xfa72b7[_0x7deb('0x14')][_0x7deb('0x17')]['CustomActionData']=_0x6c21e2[_0x7deb('0x1c')];}}logger['info'](JSON[_0x7deb('0x1d')](_0xfa72b7));return rp(_0xfa72b7);});}; \ 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 1170121..b4dfbae 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 _0xc290=['./lib/api'];(function(_0x41b2c6,_0x177970){var _0x3851e9=function(_0x3f7902){while(--_0x3f7902){_0x41b2c6['push'](_0x41b2c6['shift']());}};_0x3851e9(++_0x177970);}(_0xc290,0x16b));var _0x0c29=function(_0xcba291,_0x10e9d5){_0xcba291=_0xcba291-0x0;var _0x162274=_0xc290[_0xcba291];return _0x162274;};'use strict';var asr=require(_0x0c29('0x0'));module['exports']=function(_0x4e2ded,_0x2f3716,_0x5c96a1,_0x12e4b0){return asr(_0x4e2ded,_0x2f3716,_0x5c96a1,_0x12e4b0);}; \ No newline at end of file +var _0x7b6a=['./lib/api','exports'];(function(_0x3ecb13,_0xae4596){var _0x5a4a32=function(_0xdcf9cb){while(--_0xdcf9cb){_0x3ecb13['push'](_0x3ecb13['shift']());}};_0x5a4a32(++_0xae4596);}(_0x7b6a,0x190));var _0xa7b6=function(_0x2de2a1,_0x2887da){_0x2de2a1=_0x2de2a1-0x0;var _0x58cc07=_0x7b6a[_0x2de2a1];return _0x58cc07;};'use strict';var asr=require(_0xa7b6('0x0'));module[_0xa7b6('0x1')]=function(_0x12a95d,_0x2b4435,_0x1e811f,_0xe739e2){return asr(_0x12a95d,_0x2b4435,_0x1e811f,_0xe739e2);}; \ 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 7506705..4588001 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 _0xeadc=['error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','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.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open','moment','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','stringify','createReadStream','data','close','send','EOS'];(function(_0x449b91,_0x81b396){var _0x4e4239=function(_0x527740){while(--_0x527740){_0x449b91['push'](_0x449b91['shift']());}};_0x4e4239(++_0x81b396);}(_0xeadc,0x157));var _0xcead=function(_0x134fc2,_0x366bb0){_0x134fc2=_0x134fc2-0x0;var _0xff61b2=_0xeadc[_0x134fc2];return _0xff61b2;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcead('0x0'));var crypto=require('crypto');var logger=require(_0xcead('0x1'))(_0xcead('0x2'));module['exports']=function(_0x1bfa55,_0x5bc196,_0x156c7b,_0x46f165){return new BPromise(function(_0x60b16f,_0x1d11ae){logger[_0xcead('0x3')](_0xcead('0x4'),_0x46f165||_0xcead('0x5'));var _0x9e727c=new WebSocket(_0x46f165||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x48b050='';var _0x288289='0';var _0x5da78e='1';var _0x57b4a4='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x27152e(_0x3cf56d){var _0x400032=crypto[_0xcead('0x6')](_0xcead('0x7'));_0x400032['update'](_0x3cf56d);return _0x400032[_0xcead('0x8')](_0xcead('0x9'));}function _0x31819f(){try{logger[_0xcead('0x3')](_0xcead('0xa'));var _0x1982f6=moment()['unix']();var _0x13658a=_0x27152e(_0x1982f6+_0x5bc196+_0x156c7b);_0x9e727c['send'](JSON[_0xcead('0xb')]({'appID':_0x5bc196,'timestamp':_0x1982f6,'appKey':_0x13658a}));var _0x4f1a2e=fs[_0xcead('0xc')](_0x1bfa55);_0x4f1a2e['on'](_0xcead('0xd'),function(_0x4dbf22){_0x9e727c['send'](_0x4dbf22);});_0x4f1a2e['on'](_0xcead('0xe'),function(){_0x9e727c[_0xcead('0xf')](_0xcead('0x10'));});}catch(_0x4bbaea){logger[_0xcead('0x11')](_0xcead('0x12'),JSON[_0xcead('0xb')](_0x4bbaea));_0x9e727c[_0xcead('0x13')]();}}function _0x33779e(_0xb81066){try{if(_0xb81066){var _0x59554a=JSON[_0xcead('0x14')](_0xb81066);switch(_0x59554a[_0xcead('0x15')]){case 0x0:if(_0x59554a[_0xcead('0x16')]){if(_0x59554a[_0xcead('0x16')][_0xcead('0x17')]){logger[_0xcead('0x3')](_0xcead('0x18'),JSON[_0xcead('0xb')](_0x59554a[_0xcead('0x16')]['hypotheses']));_0x48b050=_0x59554a[_0xcead('0x16')][_0xcead('0x19')][0x0]['transcript'];_0x288289=_0x59554a[_0xcead('0x16')]['hypotheses'][0x0][_0xcead('0x1a')];_0x5da78e='0';_0x57b4a4='Success.';_0x9e727c[_0xcead('0x13')]();}}break;case 0x1:logger['info'](_0xcead('0x1b'));_0x5da78e='1';_0x57b4a4='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xcead('0x3')](_0xcead('0x1c'));_0x5da78e='2';_0x57b4a4='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xcead('0x3')](_0xcead('0x1d'));_0x5da78e='9';_0x57b4a4=_0xcead('0x1d');break;case 0xa:logger[_0xcead('0x3')](_0xcead('0x1e'));_0x5da78e='10';_0x57b4a4=_0xcead('0x1e');break;case 0xb:logger[_0xcead('0x3')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5da78e='11';_0x57b4a4=_0xcead('0x1f');}}}catch(_0x3215f2){logger[_0xcead('0x11')](_0xcead('0x20'),JSON[_0xcead('0xb')](_0x3215f2));_0x9e727c[_0xcead('0x13')]();}}function _0x18258f(){logger[_0xcead('0x3')]('Close\x20Tilde\x20ASR\x20socket');_0x60b16f({'transcript':_0x48b050,'confidence':_0x288289,'status':_0x5da78e,'status_message':_0x57b4a4});}function _0x66498d(_0x2aa897){logger[_0xcead('0x11')](_0xcead('0x21'));if(!_['isNil'](_0x2aa897)){logger[_0xcead('0x11')](_[_0xcead('0x22')](_0x2aa897)?JSON[_0xcead('0xb')](_0x2aa897):_0x2aa897);}}_0x9e727c['on'](_0xcead('0x23'),_0x31819f);_0x9e727c['on']('message',_0x33779e);_0x9e727c['on'](_0xcead('0xe'),_0x18258f);_0x9e727c['on'](_0xcead('0x11'),_0x66498d);});}; \ No newline at end of file +var _0xc48e=['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.','terminate','Error\x20Tilde\x20ASR\x20socket','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.'];(function(_0x5773e7,_0x435e69){var _0x5e6621=function(_0x112829){while(--_0x112829){_0x5773e7['push'](_0x5773e7['shift']());}};_0x5e6621(++_0x435e69);}(_0xc48e,0x184));var _0xec48=function(_0x3551ac,_0x2b6bd9){_0x3551ac=_0x3551ac-0x0;var _0x53e671=_0xc48e[_0x3551ac];return _0x53e671;};'use strict';var BPromise=require(_0xec48('0x0'));var _=require(_0xec48('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xec48('0x2'));var crypto=require(_0xec48('0x3'));var logger=require(_0xec48('0x4'))(_0xec48('0x5'));module[_0xec48('0x6')]=function(_0xdb898d,_0x5e27e9,_0x4ff6cf,_0x214f85){return new BPromise(function(_0x5c719e,_0x4e16cd){logger[_0xec48('0x7')](_0xec48('0x8'),_0x214f85||_0xec48('0x9'));var _0x2034fa=new WebSocket(_0x214f85||_0xec48('0x9'),{'perMessageDeflate':![]});var _0x2e8cef='';var _0xcf1b5f='0';var _0xa5c358='1';var _0x4ab885=_0xec48('0xa');function _0x4e05f7(_0x304ddd){var _0x3d6af9=crypto['createHash'](_0xec48('0xb'));_0x3d6af9[_0xec48('0xc')](_0x304ddd);return _0x3d6af9[_0xec48('0xd')]('hex');}function _0x47f919(){try{logger['info'](_0xec48('0xe'));var _0x28701e=moment()[_0xec48('0xf')]();var _0x1e5034=_0x4e05f7(_0x28701e+_0x5e27e9+_0x4ff6cf);_0x2034fa[_0xec48('0x10')](JSON[_0xec48('0x11')]({'appID':_0x5e27e9,'timestamp':_0x28701e,'appKey':_0x1e5034}));var _0x1355ba=fs[_0xec48('0x12')](_0xdb898d);_0x1355ba['on'](_0xec48('0x13'),function(_0x508fc7){_0x2034fa['send'](_0x508fc7);});_0x1355ba['on'](_0xec48('0x14'),function(){_0x2034fa['send'](_0xec48('0x15'));});}catch(_0x459061){logger[_0xec48('0x16')](_0xec48('0x17'),JSON[_0xec48('0x11')](_0x459061));_0x2034fa['terminate']();}}function _0x135db4(_0x17301d){try{if(_0x17301d){var _0xd8a5ae=JSON['parse'](_0x17301d);switch(_0xd8a5ae[_0xec48('0x18')]){case 0x0:if(_0xd8a5ae[_0xec48('0x19')]){if(_0xd8a5ae[_0xec48('0x19')]['final']){logger['info'](_0xec48('0x1a'),JSON['stringify'](_0xd8a5ae[_0xec48('0x19')][_0xec48('0x1b')]));_0x2e8cef=_0xd8a5ae[_0xec48('0x19')]['hypotheses'][0x0]['transcript'];_0xcf1b5f=_0xd8a5ae[_0xec48('0x19')][_0xec48('0x1b')][0x0][_0xec48('0x1c')];_0xa5c358='0';_0x4ab885=_0xec48('0x1d');_0x2034fa['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0xa5c358='1';_0x4ab885='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xec48('0x7')](_0xec48('0x1e'));_0xa5c358='2';_0x4ab885=_0xec48('0x1e');break;case 0x9:logger[_0xec48('0x7')](_0xec48('0x1f'));_0xa5c358='9';_0x4ab885=_0xec48('0x1f');break;case 0xa:logger['info'](_0xec48('0x20'));_0xa5c358='10';_0x4ab885=_0xec48('0x20');break;case 0xb:logger[_0xec48('0x7')](_0xec48('0x21'));_0xa5c358='11';_0x4ab885=_0xec48('0x21');}}}catch(_0x58a2f4){logger[_0xec48('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xec48('0x11')](_0x58a2f4));_0x2034fa[_0xec48('0x22')]();}}function _0x2e8d93(){logger[_0xec48('0x7')]('Close\x20Tilde\x20ASR\x20socket');_0x5c719e({'transcript':_0x2e8cef,'confidence':_0xcf1b5f,'status':_0xa5c358,'status_message':_0x4ab885});}function _0x3ced90(_0x183016){logger[_0xec48('0x16')](_0xec48('0x23'));if(!_['isNil'](_0x183016)){logger[_0xec48('0x16')](_['isObject'](_0x183016)?JSON['stringify'](_0x183016):_0x183016);}}_0x2034fa['on'](_0xec48('0x24'),_0x47f919);_0x2034fa['on'](_0xec48('0x25'),_0x135db4);_0x2034fa['on']('close',_0x2e8d93);_0x2034fa['on'](_0xec48('0x16'),_0x3ced90);});}; \ 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 bc616d3..8cb8b9d 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 _0x5b72=['exports','./asr'];(function(_0x164493,_0x4c8350){var _0xb00dca=function(_0x2f95dc){while(--_0x2f95dc){_0x164493['push'](_0x164493['shift']());}};_0xb00dca(++_0x4c8350);}(_0x5b72,0x9f));var _0x25b7=function(_0x30d60b,_0x3564ad){_0x30d60b=_0x30d60b-0x0;var _0x1191eb=_0x5b72[_0x30d60b];return _0x1191eb;};var asr=require(_0x25b7('0x0'));module[_0x25b7('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2a6a=['./asr'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x2a6a,0x1b8));var _0xa2a6=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0x2a6a[_0x36a3d1];return _0x821ef4;};var asr=require(_0xa2a6('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 6f8e677..49e6ee6 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 _0x65e8=['code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy'];(function(_0x38c401,_0x3b088e){var _0x12ed59=function(_0x1ef804){while(--_0x1ef804){_0x38c401['push'](_0x38c401['shift']());}};_0x12ed59(++_0x3b088e);}(_0x65e8,0x186));var _0x865e=function(_0x26771d,_0x121ef4){_0x26771d=_0x26771d-0x0;var _0x1c48e6=_0x65e8[_0x26771d];return _0x1c48e6;};'use strict';var util=require(_0x865e('0x0'));var net=require('net');var EventEmitter=require(_0x865e('0x1'))[_0x865e('0x2')];var AGIError=require(_0x865e('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x169c91,_0x4a2286,_0x100f56){var _0x26d310=this,_0x169c91=_0x169c91||0x11dd,_0x4a2286=_0x4a2286||_0x865e('0x4'),_0x1c39ed=null,_0x383838=0x0;EventEmitter[_0x865e('0x5')](_0x26d310);function _0x4b62f8(){if(!_0x169c91){_0x26d310['emit'](_0x865e('0x6'),new AGIError(_0x865e('0x7')));return![];}_0x1c39ed=net[_0x865e('0x8')]();_0x1c39ed[_0x865e('0x9')](_0x169c91,_0x4a2286);_0x1c39ed['on'](_0x865e('0xa'),function(){_0x26d310[_0x865e('0xb')](_0x865e('0xa'));});_0x1c39ed['on'](_0x865e('0xc'),function(_0x57a950){_0x1c39ed[_0x865e('0xd')](function(_0x2a24a2,_0x4fa955){if(_0x2a24a2){_0x26d310['emit'](_0x865e('0x6'),new AGIError(_0x865e('0xe'),_0x2a24a2));}else if(_0x100f56&&_0x100f56<0x0){_0x26d310[_0x865e('0xb')]('error',new AGIError(_0x865e('0xf')));_0x57a950['destroy']();}else if(_0x100f56&&_0x100f56>0x0&&_0x100f56<_0x4fa955){_0x383838+=0x1;_0x26d310[_0x865e('0xb')]('error',new AGIError(_0x865e('0x10'),_0x383838));_0x57a950[_0x865e('0x11')]();}else{var _0x13dd7c=new AGIChannel(_0x57a950);_0x13dd7c['on']('ready',function(){_0x26d310[_0x865e('0xb')]('connection',_0x13dd7c);});}});});_0x1c39ed['on'](_0x865e('0x6'),function(_0x1d4a2d){_0x26d310[_0x865e('0xb')](_0x865e('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x1d4a2d[_0x865e('0x12')]));});_0x1c39ed['on'](_0x865e('0x13'),function(){_0x26d310[_0x865e('0xb')](_0x865e('0x13'),new AGIError(_0x865e('0x14')));});}process[_0x865e('0x15')](function(){_0x4b62f8();});};util[_0x865e('0x16')](AGIServer,EventEmitter);module[_0x865e('0x17')]=function(_0x3aaa83,_0x33d164,_0x30a233){return new AGIServer(_0x3aaa83,_0x33d164,_0x30a233);}; \ No newline at end of file +var _0x53d6=['close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x53d6,0x12e));var _0x653d=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0x53d6[_0x996bc8];return _0x20b0ea;};'use strict';var util=require(_0x653d('0x0'));var net=require(_0x653d('0x1'));var EventEmitter=require(_0x653d('0x2'))[_0x653d('0x3')];var AGIError=require(_0x653d('0x4'));var AGIChannel=require(_0x653d('0x5'));var AGIServer=function(_0x2cdc59,_0x49f0d9,_0x39506b){var _0x31a46d=this,_0x2cdc59=_0x2cdc59||0x11dd,_0x49f0d9=_0x49f0d9||_0x653d('0x6'),_0x458e3e=null,_0x4c9ff4=0x0;EventEmitter[_0x653d('0x7')](_0x31a46d);function _0x2bae13(){if(!_0x2cdc59){_0x31a46d[_0x653d('0x8')](_0x653d('0x9'),new AGIError(_0x653d('0xa')));return![];}_0x458e3e=net[_0x653d('0xb')]();_0x458e3e[_0x653d('0xc')](_0x2cdc59,_0x49f0d9);_0x458e3e['on'](_0x653d('0xd'),function(){_0x31a46d[_0x653d('0x8')]('listening');});_0x458e3e['on'](_0x653d('0xe'),function(_0x64f207){_0x458e3e[_0x653d('0xf')](function(_0x1deb03,_0x514f80){if(_0x1deb03){_0x31a46d['emit']('error',new AGIError(_0x653d('0x10'),_0x1deb03));}else if(_0x39506b&&_0x39506b<0x0){_0x31a46d[_0x653d('0x8')](_0x653d('0x9'),new AGIError(_0x653d('0x11')));_0x64f207['destroy']();}else if(_0x39506b&&_0x39506b>0x0&&_0x39506b<_0x514f80){_0x4c9ff4+=0x1;_0x31a46d[_0x653d('0x8')]('error',new AGIError(_0x653d('0x12'),_0x4c9ff4));_0x64f207[_0x653d('0x13')]();}else{var _0x46228d=new AGIChannel(_0x64f207);_0x46228d['on'](_0x653d('0x14'),function(){_0x31a46d['emit'](_0x653d('0xe'),_0x46228d);});}});});_0x458e3e['on'](_0x653d('0x9'),function(_0x52d210){_0x31a46d[_0x653d('0x8')](_0x653d('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x52d210[_0x653d('0x15')]));});_0x458e3e['on']('close',function(){_0x31a46d[_0x653d('0x8')](_0x653d('0x16'),new AGIError(_0x653d('0x17')));});}process[_0x653d('0x18')](function(){_0x2bae13();});};util[_0x653d('0x19')](AGIServer,EventEmitter);module[_0x653d('0x1a')]=function(_0x47f627,_0x198613,_0x3da99a){return new AGIServer(_0x47f627,_0x198613,_0x3da99a);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 255154f..d6bc845 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 _0xbe26=['ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','isEmpty','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','wav','%s_%s','%s/recordings/%s.%s','%s/recordings/%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','statusCode','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','auth','user','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','lodash','shelljs','randomstring','moment','request-promise','../../config/logger','agi','rawBody','getdigits','getsecretdigits','rpc','getVariable','getVariableById','then','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','name','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','callback_','isNil','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','method','number','timeout','includes','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','isString','saveRestApiResult','isArray','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','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','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_access_key_id','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','no\x20appid\x20configured','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','false','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created'];(function(_0x17d43d,_0x44a4b8){var _0x3413dd=function(_0x5ed348){while(--_0x5ed348){_0x17d43d['push'](_0x17d43d['shift']());}};_0x3413dd(++_0x44a4b8);}(_0xbe26,0x7d));var _0x6be2=function(_0x5dac61,_0x6903df){_0x5dac61=_0x5dac61-0x0;var _0x299dd9=_0xbe26[_0x5dac61];return _0x299dd9;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x6be2('0x0'));var _=require(_0x6be2('0x1'));var sh=require(_0x6be2('0x2'));var odbc=require('odbc')();var rs=require(_0x6be2('0x3'));var moment=require(_0x6be2('0x4'));var Mustache=require('mustache');var rp=require(_0x6be2('0x5'));var logger=require(_0x6be2('0x6'))(_0x6be2('0x7'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x6be2('0x8')];var verticesWithRetry=['menu',_0x6be2('0x9'),_0x6be2('0xa')];var AGIVertices=function(_0x3b5c48,_0x3f49cd,_0x5af003){this['channel']=_0x3b5c48;this[_0x6be2('0xb')]=_0x3f49cd;this['mailRpc']=_0x5af003;};AGIVertices['prototype'][_0x6be2('0xc')]=function(_0x429c72,_0x4617c0){this[_0x6be2('0xb')][_0x6be2('0xd')](_0x429c72)[_0x6be2('0xe')](function(_0x4a1487){_0x4617c0(null,_0x4a1487?_0x4a1487['name']:![]);})[_0x6be2('0xf')](function(_0x2b5c27){_0x4617c0(_0x2b5c27);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x11')]=function(_0x5b9fe3,_0x1af595){this[_0x6be2('0xb')][_0x6be2('0x12')](_0x5b9fe3)[_0x6be2('0xe')](function(_0x5087d5){_0x1af595(null,_0x5087d5?_0x5087d5['name']:![]);})['catch'](function(_0x385b08){_0x1af595(_0x385b08);});};AGIVertices[_0x6be2('0x10')]['getSquareProject']=function(_0x1c1037,_0x418f70){this[_0x6be2('0xb')]['getSquareProjectById'](_0x1c1037)[_0x6be2('0xe')](function(_0x9ef56f){_0x418f70(null,_0x9ef56f?_0x9ef56f['name']:![]);})[_0x6be2('0xf')](function(_0x21a0de){_0x418f70(_0x21a0de);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x13')]=function(_0x1c1a10,_0x543a17){this[_0x6be2('0xb')][_0x6be2('0x14')](_0x1c1a10)[_0x6be2('0xe')](function(_0x4a6fd8){_0x543a17(null,_0x4a6fd8?_0x4a6fd8[_0x6be2('0x15')]:![]);})[_0x6be2('0xf')](function(_0x508cd3){_0x543a17(_0x508cd3);});};AGIVertices[_0x6be2('0x10')]['getUser']=function(_0x537b00,_0x13c9b1){this[_0x6be2('0xb')][_0x6be2('0x16')](_0x537b00)[_0x6be2('0xe')](function(_0x54255a){_0x13c9b1(null,_0x54255a?_0x54255a[_0x6be2('0x17')]:![]);})[_0x6be2('0xf')](function(_0x1c45d5){_0x13c9b1(_0x1c45d5);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x18')]=function(_0x4b5d75,_0x31858b){this[_0x6be2('0xb')][_0x6be2('0x19')](_0x4b5d75)[_0x6be2('0xe')](function(_0x30a938){_0x31858b(null,_0x30a938?_0x30a938[_0x6be2('0x17')]:![]);})['catch'](function(_0x37c65d){_0x31858b(_0x37c65d);});};AGIVertices[_0x6be2('0x10')]['getSound']=function(_0x2e3c86,_0x212aa4){var _0xeda3c3=this;this[_0x6be2('0xb')][_0x6be2('0x1a')](_0x2e3c86)[_0x6be2('0xe')](function(_0x343d1b){_0x212aa4(null,_0x343d1b?_0xeda3c3[_0x6be2('0x1b')](_0x343d1b[_0x6be2('0x1c')]):![]);})[_0x6be2('0xf')](function(_0x1b8b48){_0x212aa4(_0x1b8b48);});};AGIVertices['prototype'][_0x6be2('0x1d')]=function(_0x598f3c,_0x99a188){this['rpc'][_0x6be2('0x1e')](_0x598f3c)[_0x6be2('0xe')](function(_0x6d54d8){_0x99a188(null,_0x6d54d8?_0x6d54d8:![]);})[_0x6be2('0xf')](function(_0x190e7b){_0x99a188(_0x190e7b);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x1f')]=function(_0x5448e5,_0x27a86c,_0x2fb1e6){this['mailRpc']['sendMailMessage'](_0x5448e5,_0x27a86c)['then'](function(){_0x2fb1e6(null);})['catch'](function(_0x10a8f2){_0x2fb1e6(_0x10a8f2);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x20')]=function(_0x1d93ab,_0x282557){this[_0x6be2('0xb')][_0x6be2('0x21')](_0x1d93ab)[_0x6be2('0xe')](function(_0x23b3ee){if(_0x23b3ee){if(_0x23b3ee[_0x6be2('0x22')]){_0x282557(null,[_0x23b3ee['interval']]);}else{_0x282557(null,_['map'](_0x23b3ee[_0x6be2('0x23')],'interval'));}}else{_0x282557(null,![]);}})[_0x6be2('0xf')](function(_0x886f2a){_0x282557(_0x886f2a);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x1b')]=function(_0x41679f){return util['format'](_0x6be2('0x24'),FILES_PATH,_0x41679f);};AGIVertices['prototype']['getQueryOdbc']=function(_0x5a680e,_0x30308a,_0x40c3ad){odbc[_0x6be2('0x25')](_0x5a680e,function(_0x2d8e88){if(_0x2d8e88){logger[_0x6be2('0x26')](_0x6be2('0x27'),_0x2d8e88);_0x40c3ad(_0x2d8e88);}else{logger[_0x6be2('0x28')]('ODBC\x20connection\x20successfully');odbc[_0x6be2('0x29')](_0x30308a,function(_0x2d5871,_0x512a65){if(_0x2d5871){logger['info']('Error\x20executing\x20query\x20%s',_0x30308a);_0x40c3ad(_0x2d5871);}else{logger[_0x6be2('0x28')](_0x6be2('0x2a'),_0x30308a);odbc['close'](function(_0x1ed864){if(_0x1ed864){logger[_0x6be2('0x26')](_0x6be2('0x2b'),_0x1ed864);}_0x40c3ad(null,_0x512a65);});}});}});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x2c')]=function(_0x3103f2,_0xf01e2a){this[_0x6be2('0xb')]['getSmsAccountById'](_0x3103f2)[_0x6be2('0xe')](function(_0x3906d6){_0xf01e2a(null,_0x3906d6?_0x3906d6:![]);})[_0x6be2('0xf')](function(_0x360997){_0xf01e2a(_0x360997);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x2d')]=function(_0x137e94,_0x2519c6){this['rpc']['createSmsMessage'](_0x137e94)[_0x6be2('0xe')](function(_0x147512){_0x2519c6(null,_0x147512);})[_0x6be2('0xf')](function(_0x1008f4){_0x2519c6(_0x1008f4);});};AGIVertices['prototype'][_0x6be2('0x2e')]=function(_0x4e7caa,_0x34b0cd,_0x5a8bfd){this[_0x6be2('0xb')][_0x6be2('0x2e')]({'uniqueid':this[_0x6be2('0x2f')][_0x6be2('0x30')],'node':_0x4e7caa[_0x6be2('0x31')],'application':_0x4e7caa[_0x6be2('0x32')],'data':_0x34b0cd||null,'project_name':this[_0x6be2('0x2f')][_0x6be2('0x33')],'callerid':this['channel'][_0x6be2('0x34')]})[_0x6be2('0xe')](function(_0x55313a){if(_0x5a8bfd){_0x5a8bfd(null,_0x55313a);}})[_0x6be2('0xf')](function(_0x136e0a){if(_0x5a8bfd){_0x5a8bfd(_0x136e0a);}});};AGIVertices[_0x6be2('0x10')]['createSquareRecording']=function(_0x488ad5,_0x59b074,_0x569b91,_0x515b73){this['rpc'][_0x6be2('0x35')]({'uniqueid':this[_0x6be2('0x2f')][_0x6be2('0x30')],'callerid':this['channel'][_0x6be2('0x34')],'calleridname':this[_0x6be2('0x2f')][_0x6be2('0x36')],'context':this['channel'][_0x6be2('0x37')],'extension':this[_0x6be2('0x2f')][_0x6be2('0x38')],'priority':this[_0x6be2('0x2f')][_0x6be2('0x39')],'accountcode':this[_0x6be2('0x2f')][_0x6be2('0x3a')],'dnid':this['channel'][_0x6be2('0x3b')],'projectName':this['channel'][_0x6be2('0x33')],'saveName':_0x59b074,'filename':_0x488ad5[_0x6be2('0x3c')]||_0x59b074,'savePath':_0x569b91})[_0x6be2('0xe')](function(_0xc48979){_0x515b73(null,_0xc48979);})[_0x6be2('0xf')](function(_0x12de5c){_0x515b73(_0x12de5c);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x3d')]=function(_0x57254b,_0x51db68,_0x211ff2,_0x38caf9,_0x5932c7){this['rpc'][_0x6be2('0x3d')]({'uniqueid':this[_0x6be2('0x2f')]['uniqueid'],'body':_0x57254b,'direction':_0x51db68,'providerName':_0x211ff2,'providerResponse':_0x38caf9})['then'](function(_0x410029){if(_0x5932c7){_0x5932c7(null,_0x410029);}})[_0x6be2('0xf')](function(_0x5815fa){if(_0x5932c7){_0x5932c7(_0x5815fa);}});};AGIVertices['prototype'][_0x6be2('0x3e')]=function(_0x5d46f7,_0x30ae6d){this[_0x6be2('0xb')]['createCmContact']({'firstName':_['isEmpty'](_0x5d46f7[_0x6be2('0x17')])||_['isNil'](_0x5d46f7[_0x6be2('0x17')])?_0x6be2('0x3f')+Math['random']():_0x5d46f7[_0x6be2('0x17')],'lastName':_['isEmpty'](_0x5d46f7['lastName'])||_[_0x6be2('0x40')](_0x5d46f7['lastName'])?null:_0x5d46f7[_0x6be2('0x41')],'phone':_0x5d46f7[_0x6be2('0x42')],'ListId':_0x5d46f7['list_id'],'scheduledat':_0x5d46f7[_0x6be2('0x43')],'callbackUniqueid':this[_0x6be2('0x2f')][_0x6be2('0x30')],'tags':_0x6be2('0x44'),'description':_0x6be2('0x45')+_0x5d46f7[_0x6be2('0x43')]['toString'](),'priority':_0x5d46f7[_0x6be2('0x46')]})[_0x6be2('0xe')](function(_0x912546){_0x30ae6d(null,_0x912546);})['catch'](function(_0x18ccfe){_0x30ae6d(_0x18ccfe);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x47')]=function(_0x19dcfb,_0x4893dd){this[_0x6be2('0xb')][_0x6be2('0x48')](_0x19dcfb)[_0x6be2('0xe')](function(_0x23f64c){_0x4893dd(null,_0x23f64c?_0x23f64c[_0x6be2('0x17')]:![]);})['catch'](function(_0x15ff7c){_0x4893dd(_0x15ff7c);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x49')]=function(_0x9e3f6a,_0x5265b4,_0x5cb773){var _0x5f13e6={'role':'agent'};_0x5f13e6[_0x9e3f6a]=this['channel'][_0x6be2('0x34')];this[_0x6be2('0xb')]['agentPause'](_0x5f13e6,_0x5265b4,this['channel']['uniqueid'])[_0x6be2('0xe')](function(_0x32d7a0){_0x5cb773(null,_[_0x6be2('0x40')](_0x32d7a0)?![]:!![]);})['catch'](function(_0x2cb55a){logger[_0x6be2('0x26')](_0x2cb55a);_0x5cb773(null,![]);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x4a')]=function(_0x47b89a,_0xf50b5a){var _0x2c22a7={'role':_0x6be2('0x4b')};_0x2c22a7[_0x47b89a]=this[_0x6be2('0x2f')]['callerid'];this[_0x6be2('0xb')][_0x6be2('0x4a')](_0x2c22a7)[_0x6be2('0xe')](function(_0x53b982){_0xf50b5a(null,_[_0x6be2('0x40')](_0x53b982)?![]:!![]);})[_0x6be2('0xf')](function(_0x2724c5){logger[_0x6be2('0x26')](_0x2724c5);_0xf50b5a(null,![]);});};AGIVertices['prototype'][_0x6be2('0x4c')]=function(_0x12f0fa,_0x20fd6f){var _0x134b36={'role':_0x6be2('0x4b')};_0x134b36[_0x12f0fa]=this['channel'][_0x6be2('0x34')];this[_0x6be2('0xb')]['agentLogout'](_0x134b36)['then'](function(_0x15097a){_0x20fd6f(null,_[_0x6be2('0x40')](_0x15097a)?![]:!![]);})[_0x6be2('0xf')](function(_0x381e06){logger['error'](_0x381e06);_0x20fd6f(null,![]);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x4d')]=function(_0x248e09,_0xc3039){var _0x47db35={'role':'agent'};_0x47db35[_0x248e09]=this[_0x6be2('0x2f')][_0x6be2('0x34')];var _0xcd8a1a=_0x248e09!=_0x6be2('0x4e')?util[_0x6be2('0x4f')](_0x6be2('0x50'),_0x6be2('0x51'),this[_0x6be2('0x2f')][_0x6be2('0x34')]):undefined;this[_0x6be2('0xb')][_0x6be2('0x4d')](_0x47db35,_0xcd8a1a)[_0x6be2('0xe')](function(_0x1288c7){_0xc3039(null,_[_0x6be2('0x40')](_0x1288c7)?![]:!![]);})['catch'](function(_0x43f0ec){logger[_0x6be2('0x26')](_0x43f0ec);_0xc3039(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x461dc9,_0x1b74a4){sh[_0x6be2('0x52')](_[_0x6be2('0x53')](_0x461dc9),function(_0x3021d5,_0x47cf9d){var _0x2e81ae=_0x47cf9d[_0x6be2('0x54')](/(\r\n|\n|\r)/gm,'');_0x1b74a4(null,_0x2e81ae);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x55')]=function(_0xb921e7,_0x4da801){scripts['googleCloudTTS'](_0xb921e7[_0x6be2('0x56')],_0xb921e7[_0x6be2('0x57')]||_0x6be2('0x58'),_0xb921e7[_0x6be2('0x58')],_0xb921e7['languageCode']||'en-US',_0xb921e7[_0x6be2('0x59')]||_0x6be2('0x5a'),_0xb921e7[_0x6be2('0x5b')]||_0x6be2('0x5c'))['then'](function(_0x404119){_0x4da801(null,_0x404119);})[_0x6be2('0xf')](function(_0x4a8197){_0x4da801(_0x4a8197);});};AGIVertices['prototype'][_0x6be2('0x5d')]=function(_0x594d72,_0x49b7c6){scripts[_0x6be2('0x5d')](_0x594d72['text'],_0x594d72['google_tts_language']||'en',0x1)[_0x6be2('0xe')](function(_0xb52763){_0x49b7c6(null,_0xb52763);})['catch'](function(_0x184468){_0x49b7c6(_0x184468);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x5e')]=function(_0x165114,_0x2362c2){var _0x397819={'uri':_0x165114['url'],'method':_0x165114[_0x6be2('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x165114['timeout'])===_0x6be2('0x60')&&parseInt(_0x165114[_0x6be2('0x61')])>=0x1?parseInt(_0x165114[_0x6be2('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x6be2('0x62')](['POST',_0x6be2('0x63')],_0x397819['method'][_0x6be2('0x64')]())){try{_0x397819[_0x6be2('0x65')]=_0x165114['rawBody']?JSON['parse'](_0x165114[_0x6be2('0x8')]):{};}catch(_0x2451be){logger[_0x6be2('0x26')](_0x6be2('0x66'),_0x2451be);}}try{_0x397819[_0x6be2('0x67')]=_0x165114[_0x6be2('0x68')]?JSON['parse'](_0x165114[_0x6be2('0x68')]):{};}catch(_0x34f6ff){logger['error'](_0x6be2('0x69'),_0x34f6ff);}if(_0x165114[_0x6be2('0x6a')]){try{var _0x173bd9=require(_0x165114[_0x6be2('0x6a')])[_0x6be2('0x6b')](this,_0x397819);_0x397819['uri']=Mustache[_0x6be2('0x6c')](_0x165114[_0x6be2('0x6d')],_0x173bd9,{},['$$','$$']);if(_0x397819[_0x6be2('0x67')]){_0x397819[_0x6be2('0x67')]=JSON[_0x6be2('0x6e')](Mustache[_0x6be2('0x6c')](JSON[_0x6be2('0x6f')](_0x397819[_0x6be2('0x67')]),_0x173bd9,{},['$$','$$']));}if(_0x397819[_0x6be2('0x65')]){_0x397819[_0x6be2('0x65')]=JSON['parse'](Mustache[_0x6be2('0x6c')](JSON[_0x6be2('0x6f')](_0x397819[_0x6be2('0x65')]),_0x173bd9,{},['$$','$$']));}}catch(_0x13c70b){logger[_0x6be2('0x26')](_0x6be2('0x70'),_0x13c70b);}}rp(_0x397819)[_0x6be2('0xe')](function(_0xbeedd1){var _0x2da381={'statusCode':_0xbeedd1['statusCode']||0xc8,'statusMessage':_0xbeedd1[_0x6be2('0x71')]||'OK','headers':_0xbeedd1[_0x6be2('0x67')]||{},'body':_0xbeedd1[_0x6be2('0x65')]||{}};_0x2362c2(null,_0x2da381);})[_0x6be2('0xf')](function(_0x522c91){var _0x4fcaa7={'statusCode':_0x522c91['statusCode']||0x1f4,'statusMessage':_0x522c91[_0x6be2('0x72')]||_0x6be2('0x73'),'headers':_0x522c91[_0x6be2('0x74')][_0x6be2('0x67')]||{},'body':_0x522c91[_0x6be2('0x74')][_0x6be2('0x65')]||{}};_0x2362c2(null,_0x4fcaa7);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x75')]=function(_0x5647b4,_0x481249){scripts[_0x6be2('0x75')](this[_0x6be2('0x2f')][_0x6be2('0x30')],_0x5647b4['key'],_0x5647b4['text'],_0x5647b4['dialogflow_language']||'en')[_0x6be2('0xe')](function(_0x29dfd8){_0x481249(null,_0x29dfd8);})[_0x6be2('0xf')](function(_0x3609b8){_0x481249(_0x3609b8);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x76')]=function(_0x3aa4f9,_0x45a95a){scripts[_0x6be2('0x76')](this[_0x6be2('0x2f')]['uniqueid'],_0x3aa4f9['dialogflowV2_project_id'],_0x3aa4f9[_0x6be2('0x77')],_0x3aa4f9[_0x6be2('0x78')],_0x3aa4f9[_0x6be2('0x58')],_0x3aa4f9[_0x6be2('0x79')]||'en')[_0x6be2('0xe')](function(_0x2f0c00){_0x45a95a(null,_0x2f0c00);})[_0x6be2('0xf')](function(_0x406835){_0x45a95a(_0x406835);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x7a')]=function(_0x5d6296,_0x3a72ee){scripts[_0x6be2('0x7a')](this[_0x6be2('0x2f')],_0x5d6296)[_0x6be2('0xe')](function(_0x564ec0){_0x3a72ee(null,_0x564ec0);})[_0x6be2('0xf')](function(_0x34d19a){_0x3a72ee(_0x34d19a);});};AGIVertices[_0x6be2('0x10')]['ispeechTTS']=function(_0x4b6788,_0x551372){scripts[_0x6be2('0x7b')](_0x4b6788['key'],_0x4b6788[_0x6be2('0x58')],_0x4b6788[_0x6be2('0x7c')]||'en-US',_0x4b6788[_0x6be2('0x7d')])[_0x6be2('0xe')](function(_0x3a521f){_0x551372(null,_0x3a521f);})['catch'](function(_0x215d7c){_0x551372(_0x215d7c);});};AGIVertices[_0x6be2('0x10')]['ispeechASR']=function(_0xab6acb,_0x517106,_0x582092){scripts[_0x6be2('0x7e')](_0x517106,_0xab6acb[_0x6be2('0x7f')],_0xab6acb[_0x6be2('0x80')]||_0x6be2('0x81'),this[_0x6be2('0x82')](_0xab6acb[_0x6be2('0x83')])?_0xab6acb[_0x6be2('0x83')]:undefined)[_0x6be2('0xe')](function(_0x32841d){_0x582092(null,_0x32841d);})[_0x6be2('0xf')](function(_0x36dae9){_0x582092(_0x36dae9);});};AGIVertices['prototype'][_0x6be2('0x84')]=function(_0x1a4f46,_0x2bf815){scripts['awsPolly'](_0x1a4f46['aws_access_key_id'],_0x1a4f46[_0x6be2('0x85')],_0x1a4f46['aws_polly_region'],_0x1a4f46[_0x6be2('0x86')]||_0x6be2('0x87'),_0x1a4f46[_0x6be2('0x58')],_0x1a4f46[_0x6be2('0x88')]||_0x6be2('0x58'))[_0x6be2('0xe')](function(_0x4db371){_0x2bf815(null,_0x4db371);})[_0x6be2('0xf')](function(_0x52187e){_0x2bf815(_0x52187e);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x89')]=function(_0x14396b,_0x38d293){scripts['awsLex'](this['channel'][_0x6be2('0x30')],_0x14396b['aws_access_key_id'],_0x14396b[_0x6be2('0x85')],_0x14396b['aws_lex_region'],_0x14396b[_0x6be2('0x58')],_0x14396b[_0x6be2('0x8a')])[_0x6be2('0xe')](function(_0x14072f){_0x38d293(null,_0x14072f);})[_0x6be2('0xf')](function(_0x4dfce5){_0x38d293(_0x4dfce5);});};AGIVertices[_0x6be2('0x10')]['googleASR']=function(_0x46cc68,_0x58507b,_0xcd286f){scripts[_0x6be2('0x8b')](_0x58507b,_0x46cc68[_0x6be2('0x7f')],_0x46cc68[_0x6be2('0x8c')]||'en-US')[_0x6be2('0xe')](function(_0x1a124e){_0xcd286f(null,_0x1a124e);})[_0x6be2('0xf')](function(_0x2b6d1c){_0xcd286f(_0x2b6d1c);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x8d')]=function(_0x448728,_0xb71b17,_0x2bf99e){scripts['tildeASR'](_0xb71b17,_0x448728[_0x6be2('0x8e')],_0x448728[_0x6be2('0x8f')],_0x448728[_0x6be2('0x90')])[_0x6be2('0xe')](function(_0x172735){_0x2bf99e(null,_0x172735);})[_0x6be2('0xf')](function(_0x5c5f5b){_0x2bf99e(_0x5c5f5b);});};AGIVertices[_0x6be2('0x10')][_0x6be2('0x91')]=function(_0x416644){var _0x28fa71=_[_0x6be2('0x62')](verticesWithRetry,_0x416644[_0x6be2('0x32')])?_0x416644:_[_0x6be2('0x92')](_0x416644);for(var _0xfadc90 in _0x28fa71){if(_0x28fa71[_0x6be2('0x93')](_0xfadc90)){if(_0x28fa71[_0xfadc90]&&_['isString'](_0x28fa71[_0xfadc90])){if(_[_0x6be2('0x62')](recursiveMapAttributes,_0xfadc90)){_0x28fa71[_0xfadc90]=this['replaceObjectAllVariables'](_0x28fa71[_0xfadc90]);}else{_0x28fa71[_0xfadc90]=this[_0x6be2('0x94')](_0x28fa71[_0xfadc90]);}}}}return _0x28fa71;};AGIVertices['prototype'][_0x6be2('0x95')]=function(_0x409daa){for(var _0x3c0039 in _0x409daa){if(_0x409daa['hasOwnProperty'](_0x3c0039)){if(_[_0x6be2('0x96')](_0x409daa[_0x3c0039])){this[_0x6be2('0x95')](_0x409daa[_0x3c0039]);}else if(_['isArray'](_0x409daa[_0x3c0039])){for(var _0x762c34=0x0;_0x762c34<_0x409daa[_0x3c0039][_0x6be2('0x97')];_0x762c34++){this[_0x6be2('0x95')](_0x409daa[_0x3c0039][_0x762c34]);}}else if(_[_0x6be2('0x98')](_0x409daa[_0x3c0039])){_0x409daa[_0x3c0039]=this[_0x6be2('0x94')](_0x409daa[_0x3c0039]);}}}};AGIVertices[_0x6be2('0x10')][_0x6be2('0x99')]=function(_0x5f5332,_0x61ddbe){for(var _0x57635f in _0x5f5332){if(_0x5f5332[_0x6be2('0x93')](_0x57635f)){if(_[_0x6be2('0x96')](_0x5f5332[_0x57635f])){if(!_['isEmpty'](_0x5f5332[_0x57635f])){this[_0x6be2('0x99')](_0x5f5332[_0x57635f],util[_0x6be2('0x4f')]('%s.%s',_0x61ddbe,_0x57635f));}}else if(_[_0x6be2('0x9a')](_0x5f5332[_0x57635f])){for(var _0x341d20=0x0;_0x341d20<_0x5f5332[_0x57635f][_0x6be2('0x97')];_0x341d20++){this[_0x6be2('0x99')](_0x5f5332[_0x57635f][_0x341d20],util[_0x6be2('0x4f')](_0x6be2('0x9b'),_0x61ddbe,_0x57635f+'['+_0x341d20+']'));}}else{if(!_[_0x6be2('0x40')](_0x5f5332[_0x57635f])){this[_0x6be2('0x2f')][_0x6be2('0x9c')](util[_0x6be2('0x4f')]('%s.%s',_0x61ddbe,_0x57635f),_0x5f5332[_0x57635f]);}}}}};AGIVertices['prototype'][_0x6be2('0x9d')]=function(_0x5c8703){try{var _0x91be2e=JSON[_0x6be2('0x6e')](_0x5c8703);this[_0x6be2('0x95')](_0x91be2e);return JSON['stringify'](_0x91be2e);}catch(_0x3be289){return this[_0x6be2('0x94')](_0x5c8703);}};AGIVertices[_0x6be2('0x10')][_0x6be2('0x94')]=function(_0x3f82d7){var _0x34a8b8=_0x3f82d7[_0x6be2('0x9e')]('{');for(var _0x1940c1=0x1;_0x1940c1<_0x34a8b8[_0x6be2('0x97')];_0x1940c1+=0x1){var _0x314533=_0x34a8b8[_0x1940c1][_0x6be2('0x9e')]('}');if(_0x314533['length']>0x1){_0x3f82d7=_0x3f82d7[_0x6be2('0x9f')]('{'+_0x314533[0x0]+'}',this[_0x6be2('0x2f')][_0x6be2('0xc')](_0x314533[0x0])[_0x6be2('0xa0')]||_0x314533[0x0]);}}if(_0x34a8b8[_0x6be2('0x97')]===0x1){return _0x3f82d7[_0x6be2('0xa1')]();}return this['replaceAllVariables'](_0x3f82d7);};AGIVertices[_0x6be2('0x10')][_0x6be2('0xa2')]=function(_0x421deb,_0x19c41e){var _0xb9d432=this[_0x6be2('0x2f')][_0x6be2('0xc')](_0x421deb);if(_0xb9d432['result']===-0x1){return _0xb9d432;}logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xa3'),_0x19c41e,_0xb9d432[_0x6be2('0xa0')]));return this[_0x6be2('0x2f')][_0x6be2('0x9c')](_0x19c41e,_0xb9d432[_0x6be2('0xa0')]);};AGIVertices['prototype'][_0x6be2('0x82')]=function(_0xff9a09){return _0xff9a09&&_0xff9a09!=='0'&&_0xff9a09!=='-1'&&_0xff9a09!=='';};AGIVertices[_0x6be2('0x10')][_0x6be2('0xa4')]=function(_0x22911f){this['createSquareDetailsReport'][_0x6be2('0x6b')](this,_0x22911f,'-');_0x22911f['retry']=_0x22911f[_0x6be2('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6be2('0x10')][_0x6be2('0xa5')]=function(_0x4b4810){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xa6'),_0x4b4810[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x4b4810[_0x6be2('0x58')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xa8'));}var _0x3f3a47='\x22'+_0x4b4810['text']+'\x22';if(this['isConfigured'](_0x4b4810[_0x6be2('0x74')])){_0x3f3a47+=','+_0x4b4810[_0x6be2('0x74')];}var _0x14f729=this[_0x6be2('0x2f')][_0x6be2('0x52')](_0x6be2('0xa9'),_0x3f3a47);if(_0x14f729['result']===-0x1){return _0x14f729;}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xaa'),_0x3f3a47));};AGIVertices['prototype'][_0x6be2('0xab')]=function(_0x7e5abe){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x7e5abe[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x7e5abe[_0x6be2('0xac')])){return this['channel']['noop'](_0x6be2('0xad'));}var _0x8b6984=_0x7e5abe[_0x6be2('0xac')];if(this[_0x6be2('0x82')](_0x7e5abe[_0x6be2('0x74')])){_0x8b6984+=','+_0x7e5abe[_0x6be2('0x74')];}var _0x581899=this['channel'][_0x6be2('0x52')]('MRCPRecog',_0x8b6984);if(_0x581899[_0x6be2('0xae')]===-0x1){return _0x581899;}var _0x4059b2=this['getAndSetVariable'](_0x6be2('0xaf'),_0x6be2('0xb0'));if(_0x4059b2[_0x6be2('0xae')]===-0x1){return _0x4059b2;}var _0xcd0123=this[_0x6be2('0xa2')]('RECOG_INPUT()',_0x6be2('0xb1'));if(_0xcd0123[_0x6be2('0xae')]===-0x1){return _0xcd0123;}var _0x5e4420=this[_0x6be2('0xa2')](_0x6be2('0xb2'),_0x6be2('0xb3'));if(_0x5e4420['result']===-0x1){return _0x5e4420;}return this[_0x6be2('0x2f')]['noop'](util['format'](_0x6be2('0xb4'),_0x8b6984));};AGIVertices['prototype'][_0x6be2('0x7')]=function(_0x2d9af8){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0xb5'),_0x2d9af8['label']));return this[_0x6be2('0x2f')][_0x6be2('0x7')]([_0x2d9af8[_0x6be2('0xb6')],_0x2d9af8[_0x6be2('0xb7')]]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0xb8')]=function(_0x1dfe6b){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0xb9'),_0x1dfe6b['label']));if(this[_0x6be2('0x82')](_0x1dfe6b[_0x6be2('0x61')])){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0xba'),_0x1dfe6b['timeout']));var _0x12dee=this[_0x6be2('0x2f')]['wait'](_0x1dfe6b[_0x6be2('0x61')]);if(_0x12dee[_0x6be2('0xae')]===-0x1){return _0x12dee;}}return this['channel']['answer']();};AGIVertices['prototype']['callback']=function(_0x4d35d2){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0xbb'),_0x4d35d2[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x4d35d2['list_id'])){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x4d35d2,_0x6be2('0xbc'));}_0x4d35d2[_0x6be2('0x43')]=moment();if(this['isConfigured'](_0x4d35d2[_0x6be2('0xbd')])){_0x4d35d2['scheduledAt']=moment()[_0x6be2('0xbe')](_0x4d35d2[_0x6be2('0xbd')],_0x6be2('0xbf'));}if(!this[_0x6be2('0x82')](_0x4d35d2[_0x6be2('0x46')])){_0x4d35d2['callback_priority']=0x2;}this[_0x6be2('0x3e')]['sync'](this,_0x4d35d2);return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4d35d2[_0x6be2('0x42')],_0x4d35d2[_0x6be2('0xc0')],_0x4d35d2[_0x6be2('0x43')]));};AGIVertices['prototype'][_0x6be2('0xc1')]=function(_0x44999c){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xc2'),_0x44999c[_0x6be2('0x31')]));var _0x329abb=this[_0x6be2('0x2f')][_0x6be2('0x52')](_0x44999c[_0x6be2('0xc3')],_0x44999c[_0x6be2('0x74')]);if(_0x329abb['result']===-0x1){return _0x329abb;}return this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')](_0x6be2('0xc4'),_0x44999c['application'],_0x44999c[_0x6be2('0x74')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x1ec48f){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xc5'),_0x1ec48f[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x1ec48f[_0x6be2('0x58')])){return this['channel'][_0x6be2('0xa7')](_0x6be2('0xa8'));}var _0x27e3e1='\x22'+_0x1ec48f[_0x6be2('0x58')]+'\x22';if(this[_0x6be2('0x82')](_0x1ec48f[_0x6be2('0x74')])){_0x27e3e1+=','+_0x1ec48f[_0x6be2('0x74')];}var _0x31c47c=this['channel']['exec'](_0x6be2('0xa9'),_0x27e3e1);if(_0x31c47c[_0x6be2('0xae')]===-0x1){return _0x31c47c;}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0xaa'),_0x27e3e1));};AGIVertices['prototype']['sestektts']=function(_0x3605a7){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3605a7['label']));if(!this[_0x6be2('0x82')](_0x3605a7[_0x6be2('0x58')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20text\x20configured');}var _0x3b23f4='\x22'+_0x3605a7[_0x6be2('0x58')]+'\x22';if(this[_0x6be2('0x82')](_0x3605a7[_0x6be2('0x74')])){_0x3b23f4+=','+_0x3605a7[_0x6be2('0x74')];}var _0x238620=this[_0x6be2('0x2f')][_0x6be2('0x52')](_0x6be2('0xa9'),_0x3b23f4);if(_0x238620[_0x6be2('0xae')]===-0x1){return _0x238620;}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xaa'),_0x3b23f4));};AGIVertices[_0x6be2('0x10')][_0x6be2('0xc6')]=function(_0x417b91){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xc7'),_0x417b91[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x417b91[_0x6be2('0xac')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xad'));}var _0x2d0e40=_0x417b91[_0x6be2('0xac')];if(this[_0x6be2('0x82')](_0x417b91[_0x6be2('0x74')])){_0x2d0e40+=','+_0x417b91['options'];}var _0x4d9ae1=this[_0x6be2('0x2f')][_0x6be2('0x52')]('MRCPRecog',_0x2d0e40);if(_0x4d9ae1['result']===-0x1){return _0x4d9ae1;}var _0x41031f=this[_0x6be2('0xa2')](_0x6be2('0xaf'),_0x6be2('0xc8'));if(_0x41031f[_0x6be2('0xae')]===-0x1){return _0x41031f;}var _0x389425=this['getAndSetVariable'](_0x6be2('0xc9'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x389425[_0x6be2('0xae')]===-0x1){return _0x389425;}var _0x368fca=this[_0x6be2('0xa2')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x368fca[_0x6be2('0xae')]===-0x1){return _0x368fca;}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xb4'),_0x2d0e40));};AGIVertices[_0x6be2('0x10')][_0x6be2('0xca')]=function(_0x3c9183){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xcb'),_0x3c9183['label']));if(!this['isConfigured'](_0x3c9183['grammar'])){return this['channel']['noop'](_0x6be2('0xad'));}var _0x64e8e3=_0x3c9183[_0x6be2('0xac')];if(this[_0x6be2('0x82')](_0x3c9183[_0x6be2('0x74')])){_0x64e8e3+=','+_0x3c9183['options'];}var _0x4eeeb5=this[_0x6be2('0x2f')][_0x6be2('0x52')]('MRCPRecog',_0x64e8e3);if(_0x4eeeb5[_0x6be2('0xae')]===-0x1){return _0x4eeeb5;}var _0x1057fb=this[_0x6be2('0xa2')](_0x6be2('0xaf'),'SESTEK_ASR_CONFIDENCE');if(_0x1057fb[_0x6be2('0xae')]===-0x1){return _0x1057fb;}var _0x167662=this[_0x6be2('0xa2')](_0x6be2('0xc9'),_0x6be2('0xcc'));if(_0x167662[_0x6be2('0xae')]===-0x1){return _0x167662;}var _0x2462a0=this['getAndSetVariable'](_0x6be2('0xb2'),_0x6be2('0xcd'));if(_0x2462a0[_0x6be2('0xae')]===-0x1){return _0x2462a0;}return this['channel'][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xb4'),_0x64e8e3));};AGIVertices[_0x6be2('0x10')][_0x6be2('0xce')]=function(_0x588145){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x588145['label']));if(!this[_0x6be2('0x82')](_0x588145[_0x6be2('0xcf')])){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x588145,_0x6be2('0xd0'));}var _0x5da167=this[_0x6be2('0x13')][_0x6be2('0x6b')](this,_0x588145[_0x6be2('0xcf')]);if(!_0x5da167){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x588145,_0x6be2('0xd1'));}if(!this['isConfigured'](_0x588145[_0x6be2('0x29')])){return this['channel'][_0x6be2('0x26')](_0x588145,_0x6be2('0xd2'));}var _0x46c4bf=_0x588145[_0x6be2('0x29')][_0x6be2('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0xd3'),_0x46c4bf));var _0x17b74f=this[_0x6be2('0xd4')]['sync'](this,_0x5da167,_0x46c4bf);this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x588145,_0x46c4bf);if(!this[_0x6be2('0x82')](_0x588145[_0x6be2('0xd5')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xd6'));}var _0x45fa7a=this[_0x6be2('0xc')][_0x6be2('0x6b')](this,_0x588145[_0x6be2('0xd5')]);if(!_0x45fa7a){return this['channel'][_0x6be2('0x26')](_0x588145,_0x6be2('0xd7'));}var _0x3654a6=this;_0x17b74f[_0x6be2('0xd8')](function(_0xed4675,_0x1525e8){Object[_0x6be2('0xd9')](_0xed4675)[_0x6be2('0xd8')](function(_0x1b67a1){_0x3654a6[_0x6be2('0x2f')][_0x6be2('0x9c')](util[_0x6be2('0x4f')](_0x6be2('0xda'),_0x45fa7a,_0x1525e8,_0x1b67a1),_0xed4675[_0x1b67a1]);});});this[_0x6be2('0x2f')]['setVariable'](util[_0x6be2('0x4f')]('%s_ROWS_COUNT',_0x45fa7a),_0x17b74f[_0x6be2('0x97')]);return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0xdb'),_0x45fa7a));};AGIVertices[_0x6be2('0x10')][_0x6be2('0xdc')]=function(_0x306467){logger[_0x6be2('0xdd')](util[_0x6be2('0x4f')](_0x6be2('0xde'),_0x306467[_0x6be2('0x31')]));if(!this['isConfigured'](_0x306467['sip_id'])){return this['channel'][_0x6be2('0x26')](_0x306467,_0x6be2('0xdf'));}var _0x1e858d=this[_0x6be2('0xe0')][_0x6be2('0x6b')](this,_0x306467[_0x6be2('0xe1')]);if(!_0x1e858d){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x306467,_0x6be2('0xe2'));}var _0xa99ba7=this['channel']['exec'](_0x6be2('0xe3'),[util[_0x6be2('0x4f')]('SIP/%s',_0x1e858d),_0x306467[_0x6be2('0x61')],_0x306467[_0x6be2('0xe4')],_0x306467[_0x6be2('0x6d')]]);if(_0xa99ba7[_0x6be2('0xae')]===-0x1){return _0xa99ba7;}return this['channel']['noop'](util[_0x6be2('0x4f')](_0x6be2('0xe5'),_0x6be2('0xe3')));};AGIVertices['prototype'][_0x6be2('0xe6')]=function(_0x3cea92){logger[_0x6be2('0x28')](util['format'](_0x6be2('0xe7'),_0x3cea92[_0x6be2('0x31')]));if(!this['isConfigured'](_0x3cea92[_0x6be2('0x7f')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x3cea92[_0x6be2('0x58')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xa8'));}this[_0x6be2('0x2f')][_0x6be2('0xe8')]=!![];this[_0x6be2('0x2e')](_0x3cea92);this[_0x6be2('0x3d')](_0x3cea92[_0x6be2('0x58')],'in','','');this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0xe9'),_0x3cea92[_0x6be2('0x58')]));var _0x3cb270=this[_0x6be2('0x75')][_0x6be2('0x6b')](this,_0x3cea92);if(_0x3cb270){for(var _0x18e444 in _0x3cb270){if(_0x3cb270[_0x6be2('0x93')](_0x18e444)){this[_0x6be2('0x2f')][_0x6be2('0x9c')](util[_0x6be2('0x4f')]('DIALOGFLOW_%s',_0x18e444['toUpperCase']()),_0x3cb270[_0x18e444]);}}this[_0x6be2('0x3d')](_0x3cb270['speech'],_0x6be2('0xea'),_0x6be2('0xe6'),'');return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0xeb'),_0x3cb270[_0x6be2('0xec')]));}return this[_0x6be2('0x2f')]['error'](_0x3cea92,_0x6be2('0xed'));};AGIVertices['prototype']['dialogflowV2']=function(_0x21f333){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0xee'),_0x21f333[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x21f333['dialogflowV2_project_id'])){return this['channel']['noop'](_0x6be2('0xef'));}if(!this[_0x6be2('0x82')](_0x21f333[_0x6be2('0x77')])){return this[_0x6be2('0x2f')]['noop'](_0x6be2('0xf0'));}if(!this[_0x6be2('0x82')](_0x21f333[_0x6be2('0x78')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xf1'));}if(!this[_0x6be2('0x82')](_0x21f333[_0x6be2('0x79')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xf2'));}if(!this['isConfigured'](_0x21f333[_0x6be2('0x58')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xa8'));}this[_0x6be2('0x2f')]['bot']=!![];this[_0x6be2('0x2e')](_0x21f333);this[_0x6be2('0x3d')](_0x21f333[_0x6be2('0x58')],'in','','');this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('Trying\x20DialogflowV2:\x20%s',_0x21f333[_0x6be2('0x58')]));var _0x117aa2=this[_0x6be2('0x76')]['sync'](this,_0x21f333);if(_0x117aa2){for(var _0x30d32e in _0x117aa2){if(_0x117aa2['hasOwnProperty'](_0x30d32e)){if(_0x30d32e!==_0x6be2('0xf3')){this['channel'][_0x6be2('0x9c')](util[_0x6be2('0x4f')](_0x6be2('0xf4'),_0x30d32e[_0x6be2('0x64')]()),_0x117aa2[_0x30d32e]);}}}this[_0x6be2('0x3d')](_0x117aa2[_0x6be2('0xec')],'out','dialogflowV2',_0x117aa2[_0x6be2('0xf3')]);return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xf5'),_0x117aa2[_0x6be2('0xec')]));}return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x21f333,_0x6be2('0xf6'));};AGIVertices[_0x6be2('0x10')][_0x6be2('0xf7')]=function(_0x756ffb){logger['info'](util[_0x6be2('0x4f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x756ffb[_0x6be2('0x31')]));if(!this['isConfigured'](_0x756ffb[_0x6be2('0xf8')])){return this['channel']['noop'](_0x6be2('0xf9'));}if(!this[_0x6be2('0x82')](_0x756ffb[_0x6be2('0xfa')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20username\x20configured');}if(!this[_0x6be2('0x82')](_0x756ffb['password'])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xfb'));}if(!this['isConfigured'](_0x756ffb[_0x6be2('0xfc')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20text\x20configured');}this[_0x6be2('0x2f')][_0x6be2('0xe8')]=!![];this[_0x6be2('0x2e')](_0x756ffb);this[_0x6be2('0x3d')](_0x756ffb['text'],'in','','');this['channel'][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xfd'),_0x756ffb[_0x6be2('0x58')]));var _0x68c779=this['sestekNDA'][_0x6be2('0x6b')](this,_0x756ffb);if(_0x68c779){for(var _0x143ccb in _0x68c779){if(_0x68c779['hasOwnProperty'](_0x143ccb)){this[_0x6be2('0x2f')][_0x6be2('0x9c')](util[_0x6be2('0x4f')](_0x6be2('0xfe'),_0x143ccb[_0x6be2('0x64')]()),_0x68c779[_0x143ccb]);}}this[_0x6be2('0x3d')](_0x68c779[_0x6be2('0xec')],'out','sesteknda','');if(_0x68c779['audiofile']){this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')](_0x6be2('0xff'),_0x68c779[_0x6be2('0x100')]));var _0x25fe31=this[_0x6be2('0x2f')][_0x6be2('0x101')](_0x68c779[_0x6be2('0x100')]);try{fs['unlink'](_0x68c779['audiofile']+_0x6be2('0x102'));}catch(_0x2888f0){logger[_0x6be2('0x26')](_0x2888f0);}return _0x25fe31;}else{return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('SestekNDA\x20Result\x20%s',_0x68c779[_0x6be2('0xec')]));}}return this['channel'][_0x6be2('0x26')](_0x756ffb,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x6be2('0x10')]['end']=function(_0x374a2b){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x103'),_0x374a2b[_0x6be2('0x31')]));return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x104'));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x105')]=function(_0x490173){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x490173[_0x6be2('0x31')]));var _0x42e401='';if(_0x490173[_0x6be2('0x106')]){if(!this['isConfigured'](_0x490173[_0x6be2('0x106')])){return this['channel'][_0x6be2('0x26')](_0x490173,'no\x20trunk\x20selected');}else{var _0x13296b=parseInt(_0x490173[_0x6be2('0x106')],0xa);if(isNaN(_0x13296b)){_0x42e401=_0x490173[_0x6be2('0x106')];}else{_0x42e401=this[_0x6be2('0x18')][_0x6be2('0x6b')](this,_0x490173[_0x6be2('0x106')]);if(!_0x42e401){return this[_0x6be2('0x2f')]['error'](_0x490173,'no\x20trunk\x20found');}}}}else if(_0x490173['trunk_name']){_0x42e401=_0x490173[_0x6be2('0x107')];}else{return this['channel'][_0x6be2('0x26')](_0x490173,_0x6be2('0x108'));}var _0x1b20f4=this[_0x6be2('0x2f')][_0x6be2('0x52')]('DIAL',[util[_0x6be2('0x4f')]('SIP/%s/%s',_0x42e401,_0x490173[_0x6be2('0x42')]),_0x490173[_0x6be2('0x61')],_0x490173[_0x6be2('0xe4')],_0x490173['url']]);if(_0x1b20f4['result']===-0x1){return _0x1b20f4;}return this[_0x6be2('0x2f')]['noop'](util['format'](_0x6be2('0xe5'),_0x6be2('0xe3')));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x109')]=function(_0x3ee162){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x10a'),_0x3ee162[_0x6be2('0x31')]));return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x109'));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x9')]=function(_0x30df97){logger['info'](util['format'](_0x6be2('0x10b'),_0x30df97[_0x6be2('0x31')]));if(_0x30df97[_0x6be2('0x10c')]===0x0){return this[_0x6be2('0xa4')](_0x30df97);}_0x30df97[_0x6be2('0x10c')]-=0x1;if(!this[_0x6be2('0x82')](_0x30df97[_0x6be2('0x10d')])){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x30df97,_0x6be2('0x10e'));}var _0xc9ded9=this[_0x6be2('0x10f')][_0x6be2('0x6b')](this,_0x30df97['file_id']);if(!_0xc9ded9){return this['channel'][_0x6be2('0x26')](_0x30df97,_0x6be2('0x110'));}if(!this[_0x6be2('0x82')](_0x30df97[_0x6be2('0xd5')])){return this[_0x6be2('0x2f')]['error'](_0x6be2('0xd6'));}var _0x230ca8=this[_0x6be2('0x2f')][_0x6be2('0x111')](_0xc9ded9,_0x30df97[_0x6be2('0x112')],_0x30df97[_0x6be2('0x113')]);var _0x4e8bed=_0x230ca8[_0x6be2('0xae')]?_0x230ca8[_0x6be2('0xae')]['toString']():'';logger[_0x6be2('0x28')]('test',JSON[_0x6be2('0x6f')](_0x230ca8));if(_0x230ca8[_0x6be2('0xae')]===-0x1){this[_0x6be2('0x2e')]['sync'](this,_0x30df97,_0x4e8bed);return _0x230ca8;}else if(_0x230ca8[_0x6be2('0xa0')]===_0x6be2('0x61')){_0x230ca8[_0x6be2('0xae')]=_0x4e8bed[_0x6be2('0x97')]>=parseInt(_0x30df97[_0x6be2('0x114')])?'x':'i';}else{_0x230ca8[_0x6be2('0xae')]=_0x4e8bed[_0x6be2('0x97')]>=parseInt(_0x30df97[_0x6be2('0x114')])&&_0x4e8bed[_0x6be2('0x97')]<=parseInt(_0x30df97[_0x6be2('0x113')])?'x':'i';}var _0x4b5865=this['getVariable'][_0x6be2('0x6b')](this,_0x30df97[_0x6be2('0xd5')]);if(!_0x4b5865){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x30df97,_0x6be2('0xd7'));}this[_0x6be2('0x2f')][_0x6be2('0x9c')](_0x4b5865,_0x4e8bed);if(this['isConfigured'](_0x30df97[_0x6be2('0x115')])){var _0x3fb8f1=parseInt(_0x30df97[_0x6be2('0x115')],0xa);var _0x19c2c1=rs[_0x6be2('0x116')]({'charset':'*','length':_0x3fb8f1});var _0x356341=_0x4e8bed[_0x6be2('0x97')];if(_0x356341>0x0){if(_0x356341>_0x3fb8f1){this['createSquareDetailsReport'][_0x6be2('0x6b')](this,_0x30df97,_0x30df97[_0x6be2('0x117')]===_0x6be2('0x118')?_0x19c2c1+_0x4e8bed['substr'](_0x3fb8f1):_0x4e8bed[_0x6be2('0x119')](0x0,_0x356341-_0x3fb8f1)+_0x19c2c1);}else{this[_0x6be2('0x2e')]['sync'](this,_0x30df97,rs[_0x6be2('0x116')]({'charset':'*','length':_0x356341}));}}else{this['createSquareDetailsReport']['sync'](this,_0x30df97,'');}}else{this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x30df97,_0x4e8bed);}return _0x230ca8;};AGIVertices[_0x6be2('0x10')][_0x6be2('0xa')]=function(_0x2cf328){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x11a'),_0x2cf328['label']));return this[_0x6be2('0x9')](_0x2cf328);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x11b')]=function(_0x34ba54){logger[_0x6be2('0x28')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x34ba54[_0x6be2('0x31')]));this['createSquareDetailsReport'][_0x6be2('0x6b')](this,_0x34ba54,_0x34ba54[_0x6be2('0x11c')]);return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x11d'),_0x34ba54[_0x6be2('0x11c')]));};AGIVertices['prototype'][_0x6be2('0x11e')]=function(_0x2b801e){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x11f'),_0x2b801e['label']));if(!this[_0x6be2('0x82')](_0x2b801e['aws_access_key_id'])||!this[_0x6be2('0x82')](_0x2b801e[_0x6be2('0x85')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x120'));}if(!this[_0x6be2('0x82')](_0x2b801e[_0x6be2('0x58')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xa8'));}this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('Trying\x20aws\x20Polly\x20%s',_0x2b801e['text']));var _0x194d31=this[_0x6be2('0x84')][_0x6be2('0x6b')](this,_0x2b801e);if(_0x194d31){this['channel']['noop'](util['format'](_0x6be2('0x121'),_0x194d31));var _0x36944d=this[_0x6be2('0x2f')][_0x6be2('0x101')](_0x194d31);try{fs[_0x6be2('0x122')](_0x194d31+_0x6be2('0x102'));}catch(_0x56413e){logger[_0x6be2('0x26')](_0x56413e);}return _0x36944d;}return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x2b801e,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x6be2('0x10')][_0x6be2('0x123')]=function(_0xdcb327){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x124'),_0xdcb327[_0x6be2('0x31')]));if(!this['isConfigured'](_0xdcb327[_0x6be2('0x125')])||!this[_0x6be2('0x82')](_0xdcb327['aws_secret_access_key'])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x6be2('0x82')](_0xdcb327[_0x6be2('0x8a')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20bot\x20name\x20configured');}if(!this[_0x6be2('0x82')](_0xdcb327[_0x6be2('0x58')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xa8'));}this[_0x6be2('0x2f')][_0x6be2('0xe8')]=!![];this[_0x6be2('0x2e')](_0xdcb327);this[_0x6be2('0x3d')](_0xdcb327[_0x6be2('0x58')],'in','','');this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x126'),_0xdcb327[_0x6be2('0x58')]));var _0x17e322=this[_0x6be2('0x89')][_0x6be2('0x6b')](this,_0xdcb327);if(_0x17e322){for(var _0x311724 in _0x17e322){if(_0x17e322[_0x6be2('0x93')](_0x311724)&&_['isString'](_0x17e322[_0x311724])){this[_0x6be2('0x2f')]['setVariable'](util[_0x6be2('0x4f')]('AWS_LEX_%s',_0x311724[_0x6be2('0x64')]()),_0x17e322[_0x311724]);}}if(_[_0x6be2('0x40')](_0x17e322['message'])){return this['channel']['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x6be2('0x3d')](_0x17e322[_0x6be2('0x72')],_0x6be2('0xea'),_0x6be2('0x127'),'');return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('Amazon\x20Lex\x20Result\x20%s',_0x17e322[_0x6be2('0x72')]));}}return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0xdcb327,_0x6be2('0x128'));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x129')]=function(_0x1b386b){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x12a'),_0x1b386b['label'],_0x1b386b[_0x6be2('0x61')]));if(!this[_0x6be2('0x82')](_0x1b386b['key'])){return this['channel'][_0x6be2('0xa7')](_0x6be2('0x12b'));}var _0xef3152='wav';var _0x552981=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x6be2('0x116')](0x4));var _0x2c9c8b=util[_0x6be2('0x4f')](_0x6be2('0x9b'),_0x552981,_0xef3152);var _0x365d9e=!![];if(_0x1b386b[_0x6be2('0x12c')]==='NOBEEP'){_0x365d9e=![];}var _0xc3e875=this['channel'][_0x6be2('0x12d')](_0x552981,_0xef3152,_0x1b386b[_0x6be2('0x12e')],_0x1b386b[_0x6be2('0x61')],undefined,_0x365d9e);if(_0xc3e875[_0x6be2('0xae')]!==-0x1){this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x12f'),_0x2c9c8b));var _0x1db978=this[_0x6be2('0x8b')][_0x6be2('0x6b')](this,_0x1b386b,_0x2c9c8b);if(_0x1db978){for(var _0x113475 in _0x1db978){if(_0x1db978[_0x6be2('0x93')](_0x113475)){this[_0x6be2('0x2f')]['setVariable'](util[_0x6be2('0x4f')](_0x6be2('0x130'),_0x113475[_0x6be2('0x64')]()),_0x1db978[_0x113475]);}}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('GoogleASR\x20Result\x20%s',JSON[_0x6be2('0x6f')](_0x1db978)));}}return _0xc3e875;};AGIVertices[_0x6be2('0x10')]['tildeasr']=function(_0x33abbc){logger[_0x6be2('0x28')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x33abbc[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x33abbc[_0x6be2('0x8e')])){return this['channel'][_0x6be2('0xa7')](_0x6be2('0x131'));}if(!this[_0x6be2('0x82')](_0x33abbc['appsecret'])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20appsecret\x20configured');}var _0x1d89c1='wav';var _0x15508b=util[_0x6be2('0x4f')]('%s/recordings/%s',FILES_PATH,rs[_0x6be2('0x116')](0x4));var _0x8053a9=util['format']('%s.%s',_0x15508b,_0x1d89c1);var _0x47a9b4=!![];if(_0x33abbc[_0x6be2('0x12c')]===_0x6be2('0x132')){_0x47a9b4=![];}var _0x431ff2=this[_0x6be2('0x2f')][_0x6be2('0x12d')](_0x15508b,_0x1d89c1,_0x33abbc[_0x6be2('0x12e')],_0x33abbc[_0x6be2('0x61')],undefined,_0x47a9b4);if(_0x431ff2[_0x6be2('0xae')]!==-0x1){this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('tilde\x20%s\x20file\x20created',_0x8053a9));var _0x5f2af0=this[_0x6be2('0x8d')][_0x6be2('0x6b')](this,_0x33abbc,_0x8053a9);if(_0x5f2af0){for(var _0x39e954 in _0x5f2af0){if(_0x5f2af0[_0x6be2('0x93')](_0x39e954)){this[_0x6be2('0x2f')][_0x6be2('0x9c')](util[_0x6be2('0x4f')](_0x6be2('0x133'),_0x39e954['toUpperCase']()),_0x5f2af0[_0x39e954]);}}return this['channel'][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x134'),JSON[_0x6be2('0x6f')](_0x5f2af0)));}}return _0x431ff2;};AGIVertices[_0x6be2('0x10')][_0x6be2('0x135')]=function(_0x18760f){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x136'),_0x18760f[_0x6be2('0x31')]));return this[_0x6be2('0x2f')][_0x6be2('0x137')](_0x18760f[_0x6be2('0x37')],_0x18760f['extension'],_0x18760f[_0x6be2('0x39')]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x138')]=function(_0x34e438){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x34e438[_0x6be2('0x31')]));if(!this['isConfigured'](_0x34e438[_0x6be2('0x139')])){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x34e438,'no\x20condition\x20configured');}try{var _0xa4536a=eval(_0x34e438[_0x6be2('0x139')])?'true':'false';this['channel'][_0x6be2('0xa7')](util['format'](_0x6be2('0x13a'),_0x34e438[_0x6be2('0x139')],_0xa4536a));return{'code':0xc8,'result':_0xa4536a};}catch(_0x41026d){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x6be2('0x10')][_0x6be2('0x13b')]=function(_0x232179){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x232179[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x232179[_0x6be2('0x13c')])){return this['channel'][_0x6be2('0x26')](_0x232179,_0x6be2('0x13d'));}var _0x54c186=this[_0x6be2('0x20')][_0x6be2('0x6b')](this,_0x232179[_0x6be2('0x13c')]);if(!_0x54c186){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x232179,_0x6be2('0x13e'));}for(var _0x517556=0x0;_0x517556<_0x54c186['length'];_0x517556+=0x1){var _0x3825c9=this[_0x6be2('0x2f')][_0x6be2('0xc')](util[_0x6be2('0x4f')](_0x6be2('0x13f'),_0x54c186[_0x517556]));if(_0x3825c9['result']===-0x1){return _0x3825c9;}logger[_0x6be2('0x28')](util['format'](_0x6be2('0x140'),_0x54c186[_0x517556],_0x3825c9[_0x6be2('0xa0')]));if(_0x3825c9[_0x6be2('0xa0')]===_0x6be2('0x141')){logger[_0x6be2('0x28')](util['format'](_0x6be2('0x140'),_0x54c186[_0x517556],'true'));this['channel']['noop'](util[_0x6be2('0x4f')](_0x6be2('0x140'),_0x54c186[_0x517556],_0x6be2('0x141')));return{'code':0xc8,'result':_0x6be2('0x141')};}else{logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x140'),_0x54c186[_0x517556],_0x6be2('0x142')));this['channel'][_0x6be2('0xa7')](util[_0x6be2('0x4f')]('IFTIME\x20%s\x20%s',_0x54c186[_0x517556],_0x6be2('0x142')));}}return{'code':0xc8,'result':_0x6be2('0x142')};};AGIVertices[_0x6be2('0x10')]['hangup']=function(_0x5ba8dc){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5ba8dc[_0x6be2('0x31')]));return this[_0x6be2('0x2f')]['hangup']();};AGIVertices[_0x6be2('0x10')]['ispeechasr']=function(_0xf3956){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x143'),_0xf3956[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0xf3956['key'])){return this[_0x6be2('0x2f')]['noop'](_0x6be2('0x12b'));}var _0x14e1ce='wav';var _0x2608f4=util[_0x6be2('0x4f')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3db949=util[_0x6be2('0x4f')]('%s.%s',_0x2608f4,_0x14e1ce);var _0x3430e4=!![];if(_0xf3956[_0x6be2('0x12c')]===_0x6be2('0x132')){_0x3430e4=![];}var _0x442495=this[_0x6be2('0x2f')]['recordFile'](_0x2608f4,_0x14e1ce,_0xf3956[_0x6be2('0x12e')],_0xf3956[_0x6be2('0x61')],undefined,_0x3430e4);if(_0x442495[_0x6be2('0xae')]!==-0x1){this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')]('ispeech\x20%s\x20file\x20created',_0x3db949));var _0x12ed3a=this['ispeechASR'][_0x6be2('0x6b')](this,_0xf3956,_0x3db949);if(_0x12ed3a){for(var _0x350b72 in _0x12ed3a){if(_0x12ed3a[_0x6be2('0x93')](_0x350b72)){this['channel'][_0x6be2('0x9c')](util['format'](_0x6be2('0x144'),_0x350b72[_0x6be2('0x64')]()),_0x12ed3a[_0x350b72]);}}return this['channel']['noop'](util['format'](_0x6be2('0x145'),JSON['stringify'](_0x12ed3a)));}}return _0x442495;};AGIVertices[_0x6be2('0x10')]['ispeechtts']=function(_0x336d9d){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x336d9d[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x336d9d[_0x6be2('0x7f')])){return this['channel'][_0x6be2('0xa7')](_0x6be2('0x12b'));}if(!this['isConfigured'](_0x336d9d[_0x6be2('0x58')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0x6be2('0xa7')](util['format'](_0x6be2('0x146'),_0x336d9d[_0x6be2('0x58')]));var _0x28b420=this[_0x6be2('0x7b')][_0x6be2('0x6b')](this,_0x336d9d);if(_0x28b420){this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x147'),_0x28b420));var _0x52498c=this[_0x6be2('0x2f')][_0x6be2('0x101')](_0x28b420,_0x336d9d[_0x6be2('0x12e')]);try{fs['unlink'](_0x28b420+_0x6be2('0x102'));}catch(_0x49d72c){logger[_0x6be2('0x26')](_0x49d72c);}return _0x52498c;}return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x336d9d,_0x6be2('0x148'));};AGIVertices['prototype'][_0x6be2('0x149')]=function(_0x55a0ad){logger[_0x6be2('0x28')](util['format'](_0x6be2('0x14a'),_0x55a0ad['label']));if(!this[_0x6be2('0x82')](_0x55a0ad[_0x6be2('0x14b')])){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x55a0ad,_0x6be2('0x14c'));}logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x14d'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x55a0ad[_0x6be2('0x14b')]));var _0x266de7=this[_0x6be2('0x4d')]['sync'](this,_0x55a0ad[_0x6be2('0x14b')]);if(_0x266de7){logger[_0x6be2('0x28')](util['format'](_0x6be2('0x14e'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x55a0ad[_0x6be2('0x14b')]));this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x14e'),this['channel'][_0x6be2('0x34')],_0x55a0ad[_0x6be2('0x14b')]));return{'code':0xc8,'result':_0x6be2('0x14f')};}else{logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x150'),this['channel'][_0x6be2('0x34')],_0x55a0ad[_0x6be2('0x14b')]));this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x150'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x55a0ad['findBy']));return{'code':0xc8,'result':_0x6be2('0x151')};}};AGIVertices[_0x6be2('0x10')][_0x6be2('0x152')]=function(_0x361d0c){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x153'),_0x361d0c[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x361d0c[_0x6be2('0x14b')])){return this[_0x6be2('0x2f')]['error'](_0x361d0c,'no\x20find\x20by\x20configured');}logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x361d0c['findBy']));var _0x315e0f=this['agentLogout'][_0x6be2('0x6b')](this,_0x361d0c[_0x6be2('0x14b')]);if(_0x315e0f){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x14e'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x361d0c[_0x6be2('0x14b')]));this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x14e'),this[_0x6be2('0x2f')]['callerid'],_0x361d0c['findBy']));return{'code':0xc8,'result':_0x6be2('0x14f')};}else{logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x150'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x361d0c[_0x6be2('0x14b')]));this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x150'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x361d0c['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6be2('0x10')][_0x6be2('0x154')]=function(_0x4dc7d1){logger[_0x6be2('0x28')](util['format'](_0x6be2('0x155'),_0x4dc7d1['label']));if(!this[_0x6be2('0x82')](_0x4dc7d1[_0x6be2('0x156')])){return this['channel'][_0x6be2('0x26')](_0x4dc7d1,_0x6be2('0x157'));}this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x158'),_0x4dc7d1[_0x6be2('0x156')]));var _0x950386=eval(_0x4dc7d1[_0x6be2('0x156')]);if(!this[_0x6be2('0x82')](_0x4dc7d1[_0x6be2('0xd5')])){return this[_0x6be2('0x2f')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1cd17b=this['getVariable'][_0x6be2('0x6b')](this,_0x4dc7d1[_0x6be2('0xd5')]);if(!_0x1cd17b){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x4dc7d1,_0x6be2('0xd7'));}if(_[_0x6be2('0x9a')](_0x950386)){var _0x4998b3=this;_0x950386['forEach'](function(_0x419f59,_0xd2f527){_0x4998b3[_0x6be2('0x2f')][_0x6be2('0x9c')](util['format'](_0x6be2('0x159'),_0x1cd17b,_0xd2f527),_0x419f59);});return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x15a'),_0x1cd17b));}else{return this[_0x6be2('0x2f')][_0x6be2('0x9c')](_0x1cd17b,_0x950386);}};AGIVertices[_0x6be2('0x10')]['menu']=function(_0x51ab0b){logger['info'](util[_0x6be2('0x4f')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x51ab0b[_0x6be2('0x31')]));if(_0x51ab0b[_0x6be2('0x10c')]===0x0){return this[_0x6be2('0xa4')](_0x51ab0b);}_0x51ab0b['retry']-=0x1;if(!this[_0x6be2('0x82')](_0x51ab0b['file_id'])){return this[_0x6be2('0x2f')]['error'](_0x51ab0b,_0x6be2('0x10e'));}var _0x5bf853=this['getSound'][_0x6be2('0x6b')](this,_0x51ab0b['file_id']);if(!_0x5bf853){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x51ab0b,'no\x20file\x20audio\x20found');}var _0x5c4393=this[_0x6be2('0x2f')][_0x6be2('0x111')](_0x5bf853,_0x51ab0b[_0x6be2('0x112')],_0x51ab0b['digit']);var _0x5a7485=_0x5c4393[_0x6be2('0xae')];if(_0x5c4393[_0x6be2('0xae')]===-0x1){this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x51ab0b,'-1');return _0x5c4393;}else if(_0x5c4393[_0x6be2('0xa0')]==='timeout'){_0x5c4393[_0x6be2('0xae')]=_0x5c4393['result'][_0x6be2('0x97')]>0x0?_0x5c4393[_0x6be2('0xae')]:'t';}else if(_[_0x6be2('0x15b')](_0x5c4393[_0x6be2('0xae')])){_0x5c4393[_0x6be2('0xae')]='#';_0x5a7485='#';}if(!this['isConfigured'](_0x51ab0b[_0x6be2('0xd5')])){this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0xd6'));}else{var _0x200726=this[_0x6be2('0xc')][_0x6be2('0x6b')](this,_0x51ab0b[_0x6be2('0xd5')]);if(!_0x200726){return this[_0x6be2('0x2f')]['error'](_0x51ab0b,_0x6be2('0xd7'));}this[_0x6be2('0x2f')][_0x6be2('0x9c')](_0x200726,_0x5a7485);}this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x51ab0b,_0x5a7485);return _0x5c4393;};AGIVertices['prototype'][_0x6be2('0xa7')]=function(_0x323eed){logger[_0x6be2('0x28')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x323eed['label']));return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x323eed[_0x6be2('0x15c')]||_0x323eed[_0x6be2('0x31')]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x15d')]=function(_0x367a92){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x15e'),_0x367a92['label']));if(!this[_0x6be2('0x82')](_0x367a92[_0x6be2('0x14b')])){return this[_0x6be2('0x2f')]['error'](_0x367a92,_0x6be2('0x14c'));}logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x367a92[_0x6be2('0x14b')]));var _0x4a6574=this['getPause']['sync'](this,_0x367a92[_0x6be2('0x15f')]);var _0x458e55=this[_0x6be2('0x49')][_0x6be2('0x6b')](this,_0x367a92[_0x6be2('0x14b')],_0x4a6574);if(_0x458e55){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x14e'),this['channel'][_0x6be2('0x34')],_0x367a92[_0x6be2('0x14b')]));this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x14e'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x367a92['findBy']));return{'code':0xc8,'result':_0x6be2('0x14f')};}else{logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x150'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x367a92[_0x6be2('0x14b')]));this[_0x6be2('0x2f')]['noop'](util['format'](_0x6be2('0x14e'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x367a92[_0x6be2('0x14b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6be2('0x10')][_0x6be2('0x160')]=function(_0x4931ab){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x161'),_0x4931ab[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x4931ab[_0x6be2('0x10d')])){return this['channel'][_0x6be2('0x26')](_0x4931ab,_0x6be2('0x10e'));}var _0x417e8d=this['getSound']['sync'](this,_0x4931ab[_0x6be2('0x10d')]);if(!_0x417e8d){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x4931ab,'no\x20file\x20audio\x20found');}var _0x473530=this[_0x6be2('0x2f')][_0x6be2('0x52')]('PLAYBACK',[_0x417e8d,_0x4931ab['opts']]);if(_0x473530[_0x6be2('0xae')]===-0x1){return _0x473530;}return this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')]('Executed\x20command\x20%s\x20%s',_0x6be2('0x162'),_0x417e8d));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x163')]=function(_0x587919){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x587919[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x587919[_0x6be2('0x164')])){return this[_0x6be2('0x2f')]['error'](_0x587919,'no\x20queue\x20selected');}var _0x583189='';var _0x2a79a8=parseInt(_0x587919[_0x6be2('0x164')],0xa);if(isNaN(_0x2a79a8)){_0x583189=_0x587919[_0x6be2('0x164')];}else{_0x583189=this[_0x6be2('0x11')][_0x6be2('0x6b')](this,_0x587919[_0x6be2('0x164')]);if(!_0x583189){return this['channel'][_0x6be2('0x26')](_0x587919,_0x6be2('0x165'));}}var _0x3dd31a='';if(this[_0x6be2('0x82')](_0x587919[_0x6be2('0x10d')])){var _0x468047=this[_0x6be2('0x10f')][_0x6be2('0x6b')](this,_0x587919['file_id']);if(_0x468047){_0x3dd31a=_0x468047;}}this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x587919,_0x583189);if(_0x587919[_0x6be2('0xe4')][_0x6be2('0x166')]('x')<0x0){_0x587919[_0x6be2('0xe4')]+='x';}if(_0x587919[_0x6be2('0xe4')][_0x6be2('0x166')]('X')<0x0){_0x587919[_0x6be2('0xe4')]+='X';}this[_0x6be2('0x2f')][_0x6be2('0x9c')](_0x6be2('0x167'),_0x583189?_0x583189[_0x6be2('0x168')]():'');var _0x4fede0=this['channel'][_0x6be2('0x52')](_0x6be2('0x169'),[_0x583189,_0x587919[_0x6be2('0xe4')],_0x587919[_0x6be2('0x6d')],_0x3dd31a,_0x587919[_0x6be2('0x61')],_0x587919[_0x6be2('0x7')],_0x587919['macro'],_0x587919[_0x6be2('0x16a')],'',_0x587919[_0x6be2('0x16b')]]);if(_0x4fede0[_0x6be2('0xae')]===-0x1){return _0x4fede0;}return this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')]('Executed\x20command\x20%s\x20%s',_0x6be2('0x169'),_0x583189));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x16c')]=function(_0x5d1295){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x16d'),_0x5d1295[_0x6be2('0x31')]));var _0x26c7dc=_0x5d1295[_0x6be2('0x16e')]||_0x6be2('0x16f');var _0x17fb34=util['format'](_0x6be2('0x170'),this[_0x6be2('0x2f')]['uniqueid'],rs[_0x6be2('0x116')](0x5));var _0x51fa9d=util[_0x6be2('0x4f')](_0x6be2('0x171'),FILES_PATH,_0x17fb34,_0x26c7dc);var _0x5ace27=util[_0x6be2('0x4f')](_0x6be2('0x172'),FILES_PATH,_0x17fb34);this['createSquareRecording'][_0x6be2('0x6b')](this,_0x5d1295,_0x17fb34,_0x51fa9d);this['channel'][_0x6be2('0x9c')](_0x6be2('0x173'),_0x17fb34);logger['info'](_0x6be2('0x174'),_0x5ace27,_0x26c7dc,_0x5d1295[_0x6be2('0x175')],_0x5d1295[_0x6be2('0x61')]);return this[_0x6be2('0x2f')][_0x6be2('0x12d')](_0x5ace27,_0x26c7dc,_0x5d1295['escape_digits'],_0x5d1295[_0x6be2('0x61')],undefined,!![]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x176')]=function(_0x10d5dd){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x177'),_0x10d5dd[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x10d5dd[_0x6be2('0x6d')])){return this['channel']['noop'](_0x6be2('0x178'));}var _0x320438=this[_0x6be2('0x5e')]['sync'](this,_0x10d5dd);logger[_0x6be2('0x28')](util['format'](_0x6be2('0x179'),util[_0x6be2('0x17a')](_0x320438,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x10d5dd[_0x6be2('0xd5')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x17b'));}var _0x546925=this[_0x6be2('0xc')]['sync'](this,_0x10d5dd[_0x6be2('0xd5')]);if(!_0x546925){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x10d5dd,_0x6be2('0xd7'));}this[_0x6be2('0x2f')][_0x6be2('0x9c')](util[_0x6be2('0x4f')]('%s_STATUS_CODE',_0x546925),_0x320438[_0x6be2('0x17c')]?_0x320438[_0x6be2('0x17c')]:_0x6be2('0x17d'));this[_0x6be2('0x2f')][_0x6be2('0x9c')](util['format'](_0x6be2('0x17e'),_0x546925),_0x320438[_0x6be2('0x71')]?_0x320438[_0x6be2('0x71')]:'OK');if(_0x320438[_0x6be2('0x65')]){try{this['saveRestApiResult'](_0x320438['body'],_0x546925);}catch(_0x1cd346){logger[_0x6be2('0x26')](util[_0x6be2('0x4f')](_0x6be2('0x17f'),_0x546925));}}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xdb'),_0x546925));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x180')]=function(_0x443554){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x181'),_0x443554[_0x6be2('0x31')]));return this['channel']['sayDigits'](_0x443554['digits'][_0x6be2('0x54')](/\s+/g,''),_0x443554[_0x6be2('0x175')]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x182')]=function(_0x530138){logger['info'](util['format'](_0x6be2('0x183'),_0x530138[_0x6be2('0x31')]));return this[_0x6be2('0x2f')][_0x6be2('0x184')](_0x530138['number'][_0x6be2('0x54')](/\s+/g,''),_0x530138[_0x6be2('0x175')]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x185')]=function(_0x3d206f){logger['info'](util[_0x6be2('0x4f')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x3d206f[_0x6be2('0x31')]));return this[_0x6be2('0x2f')]['sayPhonetic'](_0x3d206f[_0x6be2('0x58')],_0x3d206f['escape_digits']);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x186')]=function(_0x55cac1){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x55cac1[_0x6be2('0x31')]));if(!this['isConfigured'](_0x55cac1[_0x6be2('0x187')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x188'));}var _0x2fdfea=this[_0x6be2('0x1d')][_0x6be2('0x6b')](this,_0x55cac1[_0x6be2('0x187')]);if(!_0x2fdfea||!_0x2fdfea[_0x6be2('0x189')]){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x55cac1,'no\x20mail\x20account\x20found');}var _0x35e6bd={'from':util[_0x6be2('0x4f')](_0x6be2('0x18a'),_0x2fdfea[_0x6be2('0x17')],_0x2fdfea[_0x6be2('0x18b')]||_0x2fdfea[_0x6be2('0x189')]['user']),'to':_0x55cac1['to']||'','cc':_0x55cac1['cc']||'','bcc':_0x55cac1['bcc']||'','subject':_0x55cac1[_0x6be2('0x18c')],'html':_0x55cac1[_0x6be2('0x58')],'text':_0x55cac1[_0x6be2('0x58')]};var _0x28bbbd={'tls':{'rejectUnauthorized':![]}};if(_0x2fdfea[_0x6be2('0x189')][_0x6be2('0x18d')]){_0x28bbbd[_0x6be2('0x18d')]=_0x2fdfea[_0x6be2('0x189')][_0x6be2('0x18d')];}else{_0x28bbbd[_0x6be2('0x18e')]=_0x2fdfea['Smtp'][_0x6be2('0x18e')];_0x28bbbd[_0x6be2('0x18f')]=_0x2fdfea[_0x6be2('0x189')][_0x6be2('0x18f')];_0x28bbbd[_0x6be2('0x190')]=_0x2fdfea[_0x6be2('0x189')][_0x6be2('0x190')];}if(_0x2fdfea[_0x6be2('0x189')]['authentication']){_0x28bbbd[_0x6be2('0x191')]={'user':_0x2fdfea[_0x6be2('0x189')][_0x6be2('0x192')],'pass':_0x2fdfea[_0x6be2('0x189')]['pass']};}if(this['isConfigured'](_0x55cac1[_0x6be2('0x193')])){}logger[_0x6be2('0xdd')](_0x6be2('0x194'),JSON[_0x6be2('0x6f')](_0x35e6bd));this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x55cac1,_0x55cac1[_0x6be2('0x187')]);this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x195'),_0x2fdfea[_0x6be2('0x17')]));this[_0x6be2('0x1f')][_0x6be2('0x6b')](this,_0x28bbbd,_0x35e6bd);return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x6be2('0x10')][_0x6be2('0x196')]=function(_0x48956e){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x197'),_0x48956e['label']));return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x198'));};AGIVertices['prototype']['sendSMS']=function(_0x3bec74){logger[_0x6be2('0x28')](util['format'](_0x6be2('0x199'),_0x3bec74[_0x6be2('0x31')]));if(!this['isConfigured'](_0x3bec74[_0x6be2('0x19a')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x19b'));}var _0x9d0474=this['getSmsAccount'][_0x6be2('0x6b')](this,_0x3bec74[_0x6be2('0x19a')]);if(!_0x9d0474){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x3bec74,_0x6be2('0x19c'));}var _0x49d91d={'body':_0x3bec74[_0x6be2('0x19d')],'phone':_0x3bec74['to']||'','SmsAccountId':_0x9d0474['id']};logger['debug']('sendSMS\x20message',JSON[_0x6be2('0x6f')](_0x49d91d));this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x3bec74,_0x3bec74[_0x6be2('0x19a')]);this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x19e'),_0x9d0474[_0x6be2('0x17')]));this[_0x6be2('0x2d')][_0x6be2('0x6b')](this,_0x49d91d);return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x6be2('0x10')][_0x6be2('0x19f')]=function(_0x11edee){logger[_0x6be2('0x28')](util['format'](_0x6be2('0x1a0'),_0x11edee[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x11edee['variable_id'])){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x11edee,'no\x20variable\x20selected');}var _0x1ccb5f=this['getVariable'][_0x6be2('0x6b')](this,_0x11edee[_0x6be2('0xd5')]);if(!_0x1ccb5f){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x11edee,_0x6be2('0xd7'));}return this[_0x6be2('0x2f')]['setVariable'](_0x1ccb5f,_0x11edee[_0x6be2('0x1a1')]);};AGIVertices[_0x6be2('0x10')][_0x6be2('0x1a2')]=function(_0xe30897){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x1a3'),_0xe30897[_0x6be2('0x31')]));this[_0x6be2('0x2f')]['noop'](_0x6be2('0x1a4'));if(_0xe30897[_0x6be2('0xb8')]===_0x6be2('0x1a5')){this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x1a6'));return this[_0x6be2('0x2f')]['answer']();}return this[_0x6be2('0x2f')]['noop']('Skipped\x20Answer');};AGIVertices[_0x6be2('0x10')][_0x6be2('0x1a7')]=function(_0xc262c){logger['info'](util['format'](_0x6be2('0x1a8'),_0xc262c[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0xc262c[_0x6be2('0x1a9')])){return this['channel'][_0x6be2('0x26')](_0xc262c,_0x6be2('0x1aa'));}var _0x827606=this['getSquareProject'][_0x6be2('0x6b')](this,_0xc262c[_0x6be2('0x1a9')]);if(!this[_0x6be2('0x82')](_0x827606)){return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0xc262c,util['format'](_0x6be2('0x1ab'),_0xc262c['project_id']));}if(_0x827606===this[_0x6be2('0x2f')][_0x6be2('0x33')]){return this[_0x6be2('0x2f')]['error'](_0xc262c,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x6be2('0x2e')]['sync'](this,_0xc262c,_0x827606);var _0x122cbb=this[_0x6be2('0x2f')]['exec'](_0x6be2('0x1ac'),util[_0x6be2('0x4f')](_0x6be2('0x1ad'),config[_0x6be2('0x7')]['host']||_0x6be2('0x1ae'),_0x827606,this['channel'][_0x6be2('0x33')]));if(_0x122cbb[_0x6be2('0xae')]===-0x1){return _0x122cbb;}return this['channel']['noop'](util[_0x6be2('0x4f')](_0x6be2('0xc4'),_0x6be2('0x1ac'),_0x827606));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x1af')]=function(_0x73263b){logger[_0x6be2('0x28')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x73263b[_0x6be2('0x31')]));var _0x7d195e=this[_0x6be2('0x1b0')][_0x6be2('0x6b')](this,_0x73263b[_0x6be2('0xb6')]);this[_0x6be2('0x2e')][_0x6be2('0x6b')](this,_0x73263b,_0x73263b['command']);if(this[_0x6be2('0x82')](_0x73263b[_0x6be2('0xd5')])){var _0x2832ed=this[_0x6be2('0xc')][_0x6be2('0x6b')](this,_0x73263b[_0x6be2('0xd5')]);if(_0x2832ed){this['channel']['setVariable'](_0x2832ed,_0x7d195e);return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x1b1'),_0x73263b[_0x6be2('0xb6')],_0x2832ed));}}return this[_0x6be2('0x2f')][_0x6be2('0xa7')](util['format'](_0x6be2('0x1b2'),_0x73263b['command']));};AGIVertices['prototype'][_0x6be2('0x1b3')]=function(_0xa3da0a){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x1b4'),_0xa3da0a[_0x6be2('0x31')]));_0xa3da0a['text']=_0xa3da0a[_0x6be2('0x58')][_0x6be2('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6be2('0x82')](_0xa3da0a[_0x6be2('0x56')])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')](_0x6be2('0x1b5'));}if(!this['isConfigured'](_0xa3da0a['text'])){return this[_0x6be2('0x2f')][_0x6be2('0xa7')]('no\x20text\x20configured');}this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x1b6'),_0xa3da0a[_0x6be2('0x58')]));var _0xc4983e=this[_0x6be2('0x55')][_0x6be2('0x6b')](this,_0xa3da0a);if(_0xc4983e){this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')](_0x6be2('0x1b7'),_0xc4983e));var _0x322ba6=this[_0x6be2('0x2f')]['streamFile'](_0xc4983e);try{fs['unlink'](_0xc4983e+_0x6be2('0x102'));}catch(_0x341549){logger[_0x6be2('0x26')](_0x341549);}return _0x322ba6;}return this['channel'][_0x6be2('0x26')](_0xa3da0a,_0x6be2('0x1b8'));};AGIVertices[_0x6be2('0x10')][_0x6be2('0x1b9')]=function(_0x2d8907){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x1ba'),_0x2d8907[_0x6be2('0x31')]));_0x2d8907[_0x6be2('0x58')]=_0x2d8907[_0x6be2('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2d8907[_0x6be2('0x58')])){return this['channel'][_0x6be2('0xa7')]('no\x20text\x20configured');}this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')]('Trying\x20Google\x20TTS\x20%s',_0x2d8907[_0x6be2('0x58')]));var _0x23f44e=this[_0x6be2('0x5d')][_0x6be2('0x6b')](this,_0x2d8907);if(_0x23f44e){this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x1bb'),_0x23f44e));var _0x3aed82=this['channel']['streamFile'](_0x23f44e);try{fs[_0x6be2('0x122')](_0x23f44e+_0x6be2('0x102'));}catch(_0x262cc7){logger[_0x6be2('0x26')](_0x262cc7);}return _0x3aed82;}return this[_0x6be2('0x2f')][_0x6be2('0x26')](_0x2d8907,_0x6be2('0x1bc'));};AGIVertices[_0x6be2('0x10')]['unpause']=function(_0x57ecf1){logger['info'](util[_0x6be2('0x4f')](_0x6be2('0x1bd'),_0x57ecf1[_0x6be2('0x31')]));if(!this['isConfigured'](_0x57ecf1[_0x6be2('0x14b')])){return this['channel'][_0x6be2('0x26')](_0x57ecf1,_0x6be2('0x14c'));}logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x14d'),this[_0x6be2('0x2f')][_0x6be2('0x34')],_0x57ecf1[_0x6be2('0x14b')]));var _0x874e79=this[_0x6be2('0x4a')][_0x6be2('0x6b')](this,_0x57ecf1[_0x6be2('0x14b')]);if(_0x874e79){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x14e'),this['channel']['callerid'],_0x57ecf1[_0x6be2('0x14b')]));this[_0x6be2('0x2f')][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0x14e'),this['channel'][_0x6be2('0x34')],_0x57ecf1['findBy']));return{'code':0xc8,'result':_0x6be2('0x14f')};}else{logger[_0x6be2('0x28')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6be2('0x2f')]['callerid'],_0x57ecf1[_0x6be2('0x14b')]));this[_0x6be2('0x2f')]['noop'](util[_0x6be2('0x4f')](_0x6be2('0x150'),this[_0x6be2('0x2f')]['callerid'],_0x57ecf1[_0x6be2('0x14b')]));return{'code':0xc8,'result':_0x6be2('0x151')};}};AGIVertices[_0x6be2('0x10')]['voicemail']=function(_0x302f83){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x302f83[_0x6be2('0x31')]));var _0x2d949d=this[_0x6be2('0x2f')][_0x6be2('0x52')]('VOICEMAIL',[_0x302f83['mailbox'],_0x302f83[_0x6be2('0x74')]]);if(_0x2d949d[_0x6be2('0xae')]===-0x1){return _0x2d949d;}return this['channel'][_0x6be2('0xa7')](util[_0x6be2('0x4f')](_0x6be2('0xc4'),_0x6be2('0x1be'),_0x302f83[_0x6be2('0x1bf')]));};AGIVertices['prototype'][_0x6be2('0x1c0')]=function(_0x108240){logger[_0x6be2('0x28')](util[_0x6be2('0x4f')](_0x6be2('0x1c1'),_0x108240[_0x6be2('0x31')]));if(!this[_0x6be2('0x82')](_0x108240['variable_id'])){return this['channel'][_0x6be2('0x26')](_0x108240,_0x6be2('0x1c2'));}var _0x2eecc3=this[_0x6be2('0xc')][_0x6be2('0x6b')](this,_0x108240['variable_id']);if(!_0x2eecc3){return this['channel'][_0x6be2('0x26')](_0x108240,_0x6be2('0xd7'));}var _0x4ad8d5=this[_0x6be2('0x2f')][_0x6be2('0xc')](_0x2eecc3);return{'code':0xc8,'result':_0x4ad8d5[_0x6be2('0xa0')]?_0x4ad8d5[_0x6be2('0xa0')]:'-'};};String[_0x6be2('0x10')][_0x6be2('0x9f')]=function(_0x5972b1,_0x5d27fc){return this[_0x6be2('0x9e')](_0x5972b1)[_0x6be2('0x1c3')](_0x5d27fc);};module[_0x6be2('0x1c4')]=AGIVertices; \ No newline at end of file +var _0xdec0=['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','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','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','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','split','exports','path','lodash','shelljs','odbc','randomstring','moment','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','list_id','scheduledAt','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','uri','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','tildeASR','appid','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','stringify','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','sync','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','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','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','MRCPSynth','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdec0,0xab));var _0x0dec=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0xdec0[_0x481af3];return _0x3354ea;};'use strict';var fs=require('fs');var path=require(_0x0dec('0x0'));var util=require('util');var _=require(_0x0dec('0x1'));var sh=require(_0x0dec('0x2'));var odbc=require(_0x0dec('0x3'))();var rs=require(_0x0dec('0x4'));var moment=require(_0x0dec('0x5'));var Mustache=require('mustache');var rp=require(_0x0dec('0x6'));var logger=require('../../config/logger')(_0x0dec('0x7'));var config=require(_0x0dec('0x8'));var scripts=require('./scripts');var FILES_PATH=_0x0dec('0x9');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu',_0x0dec('0xa'),_0x0dec('0xb')];var AGIVertices=function(_0x75564c,_0xec087a,_0x30c52e){this[_0x0dec('0xc')]=_0x75564c;this[_0x0dec('0xd')]=_0xec087a;this[_0x0dec('0xe')]=_0x30c52e;};AGIVertices['prototype'][_0x0dec('0xf')]=function(_0x488006,_0x1599c6){this[_0x0dec('0xd')][_0x0dec('0x10')](_0x488006)[_0x0dec('0x11')](function(_0x69c7e0){_0x1599c6(null,_0x69c7e0?_0x69c7e0[_0x0dec('0x12')]:![]);})['catch'](function(_0x58178c){_0x1599c6(_0x58178c);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x14')]=function(_0x18871e,_0x328dd6){this[_0x0dec('0xd')][_0x0dec('0x15')](_0x18871e)['then'](function(_0x1dcf87){_0x328dd6(null,_0x1dcf87?_0x1dcf87[_0x0dec('0x12')]:![]);})[_0x0dec('0x16')](function(_0xacea7c){_0x328dd6(_0xacea7c);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x17')]=function(_0x4bfea5,_0x314f85){this[_0x0dec('0xd')][_0x0dec('0x18')](_0x4bfea5)['then'](function(_0x1bb319){_0x314f85(null,_0x1bb319?_0x1bb319['name']:![]);})['catch'](function(_0x20c555){_0x314f85(_0x20c555);});};AGIVertices[_0x0dec('0x13')]['getSquareOdbc']=function(_0x17a941,_0x545eb5){this[_0x0dec('0xd')][_0x0dec('0x19')](_0x17a941)[_0x0dec('0x11')](function(_0x58b360){_0x545eb5(null,_0x58b360?_0x58b360[_0x0dec('0x1a')]:![]);})['catch'](function(_0x16d005){_0x545eb5(_0x16d005);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1b')]=function(_0x28e8f5,_0x48e651){this[_0x0dec('0xd')][_0x0dec('0x1c')](_0x28e8f5)[_0x0dec('0x11')](function(_0x4ac5a0){_0x48e651(null,_0x4ac5a0?_0x4ac5a0[_0x0dec('0x12')]:![]);})[_0x0dec('0x16')](function(_0x51cda1){_0x48e651(_0x51cda1);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1d')]=function(_0x32eaab,_0x30aee9){this[_0x0dec('0xd')][_0x0dec('0x1e')](_0x32eaab)[_0x0dec('0x11')](function(_0x142fa1){_0x30aee9(null,_0x142fa1?_0x142fa1[_0x0dec('0x12')]:![]);})[_0x0dec('0x16')](function(_0x276296){_0x30aee9(_0x276296);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1f')]=function(_0x1509a3,_0x45912b){var _0x407cc1=this;this[_0x0dec('0xd')][_0x0dec('0x20')](_0x1509a3)[_0x0dec('0x11')](function(_0x2e4b6d){_0x45912b(null,_0x2e4b6d?_0x407cc1['getSoundPath'](_0x2e4b6d[_0x0dec('0x21')]):![]);})[_0x0dec('0x16')](function(_0xd7713){_0x45912b(_0xd7713);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x22')]=function(_0x218bf2,_0x5ab647){this['rpc'][_0x0dec('0x23')](_0x218bf2)[_0x0dec('0x11')](function(_0x26743a){_0x5ab647(null,_0x26743a?_0x26743a:![]);})[_0x0dec('0x16')](function(_0x4f33f6){_0x5ab647(_0x4f33f6);});};AGIVertices['prototype'][_0x0dec('0x24')]=function(_0x4ed2e7,_0x95cea5,_0x192c3c){this[_0x0dec('0xe')][_0x0dec('0x24')](_0x4ed2e7,_0x95cea5)['then'](function(){_0x192c3c(null);})[_0x0dec('0x16')](function(_0xfadc4a){_0x192c3c(_0xfadc4a);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x25')]=function(_0x2f8c2f,_0xf53004){this[_0x0dec('0xd')]['getIntervalById'](_0x2f8c2f)['then'](function(_0x4b3f5e){if(_0x4b3f5e){if(_0x4b3f5e[_0x0dec('0x26')]){_0xf53004(null,[_0x4b3f5e[_0x0dec('0x27')]]);}else{_0xf53004(null,_[_0x0dec('0x28')](_0x4b3f5e[_0x0dec('0x29')],_0x0dec('0x27')));}}else{_0xf53004(null,![]);}})[_0x0dec('0x16')](function(_0x4ef97b){_0xf53004(_0x4ef97b);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x2a')]=function(_0x3f96da){return util['format'](_0x0dec('0x2b'),FILES_PATH,_0x3f96da);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x2c')]=function(_0x2da594,_0x4652ed,_0x542454){odbc['open'](_0x2da594,function(_0x44d8d7){if(_0x44d8d7){logger['error'](_0x0dec('0x2d'),_0x44d8d7);_0x542454(_0x44d8d7);}else{logger[_0x0dec('0x2e')]('ODBC\x20connection\x20successfully');odbc[_0x0dec('0x2f')](_0x4652ed,function(_0x350fe9,_0x1a53b9){if(_0x350fe9){logger[_0x0dec('0x2e')]('Error\x20executing\x20query\x20%s',_0x4652ed);_0x542454(_0x350fe9);}else{logger[_0x0dec('0x2e')]('Query\x20executed\x20correctly\x20%s',_0x4652ed);odbc[_0x0dec('0x30')](function(_0x19cf8f){if(_0x19cf8f){logger[_0x0dec('0x31')](_0x0dec('0x32'),_0x19cf8f);}_0x542454(null,_0x1a53b9);});}});}});};AGIVertices[_0x0dec('0x13')]['getSmsAccount']=function(_0x21d566,_0x421afa){this['rpc'][_0x0dec('0x33')](_0x21d566)[_0x0dec('0x11')](function(_0x3e6a5b){_0x421afa(null,_0x3e6a5b?_0x3e6a5b:![]);})[_0x0dec('0x16')](function(_0x230040){_0x421afa(_0x230040);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x34')]=function(_0x14921b,_0x7d5e33){this[_0x0dec('0xd')][_0x0dec('0x34')](_0x14921b)[_0x0dec('0x11')](function(_0x401bef){_0x7d5e33(null,_0x401bef);})[_0x0dec('0x16')](function(_0x144297){_0x7d5e33(_0x144297);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x35')]=function(_0x313745,_0x141257,_0x377d66){this[_0x0dec('0xd')]['createSquareDetailsReport']({'uniqueid':this[_0x0dec('0xc')][_0x0dec('0x36')],'node':_0x313745[_0x0dec('0x37')],'application':_0x313745[_0x0dec('0x38')],'data':_0x141257||null,'project_name':this[_0x0dec('0xc')]['arg_1'],'callerid':this[_0x0dec('0xc')][_0x0dec('0x39')]})[_0x0dec('0x11')](function(_0x1c8c06){if(_0x377d66){_0x377d66(null,_0x1c8c06);}})[_0x0dec('0x16')](function(_0x5e76ad){if(_0x377d66){_0x377d66(_0x5e76ad);}});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x3a')]=function(_0x1faabd,_0x2fed33,_0x3de815,_0x3bff8c){this[_0x0dec('0xd')]['createSquareRecording']({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x0dec('0xc')][_0x0dec('0x39')],'calleridname':this['channel'][_0x0dec('0x3b')],'context':this['channel'][_0x0dec('0x3c')],'extension':this[_0x0dec('0xc')][_0x0dec('0x3d')],'priority':this['channel'][_0x0dec('0x3e')],'accountcode':this['channel'][_0x0dec('0x3f')],'dnid':this[_0x0dec('0xc')][_0x0dec('0x40')],'projectName':this[_0x0dec('0xc')][_0x0dec('0x41')],'saveName':_0x2fed33,'filename':_0x1faabd['file']||_0x2fed33,'savePath':_0x3de815})[_0x0dec('0x11')](function(_0x6f9d15){_0x3bff8c(null,_0x6f9d15);})[_0x0dec('0x16')](function(_0x4408b8){_0x3bff8c(_0x4408b8);});};AGIVertices['prototype'][_0x0dec('0x42')]=function(_0x2bff9e,_0xd8a9e,_0x282c07,_0x99af55,_0x28ef4c){this['rpc'][_0x0dec('0x42')]({'uniqueid':this[_0x0dec('0xc')][_0x0dec('0x36')],'body':_0x2bff9e,'direction':_0xd8a9e,'providerName':_0x282c07,'providerResponse':_0x99af55})['then'](function(_0x5cab19){if(_0x28ef4c){_0x28ef4c(null,_0x5cab19);}})[_0x0dec('0x16')](function(_0x40ca03){if(_0x28ef4c){_0x28ef4c(_0x40ca03);}});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x43')]=function(_0x18e039,_0x2c6735){this[_0x0dec('0xd')][_0x0dec('0x43')]({'firstName':_[_0x0dec('0x44')](_0x18e039[_0x0dec('0x12')])||_['isNil'](_0x18e039['name'])?_0x0dec('0x45')+Math[_0x0dec('0x46')]():_0x18e039['name'],'lastName':_[_0x0dec('0x44')](_0x18e039['lastName'])||_[_0x0dec('0x47')](_0x18e039[_0x0dec('0x48')])?null:_0x18e039['lastName'],'phone':_0x18e039[_0x0dec('0x49')],'ListId':_0x18e039[_0x0dec('0x4a')],'scheduledat':_0x18e039[_0x0dec('0x4b')],'callbackUniqueid':this[_0x0dec('0xc')][_0x0dec('0x36')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x18e039[_0x0dec('0x4b')]['toString'](),'priority':_0x18e039[_0x0dec('0x4c')]})[_0x0dec('0x11')](function(_0x592460){_0x2c6735(null,_0x592460);})[_0x0dec('0x16')](function(_0x448ec6){_0x2c6735(_0x448ec6);});};AGIVertices[_0x0dec('0x13')]['getPause']=function(_0x1bc597,_0x69380a){this['rpc'][_0x0dec('0x4d')](_0x1bc597)[_0x0dec('0x11')](function(_0x5f1be6){_0x69380a(null,_0x5f1be6?_0x5f1be6[_0x0dec('0x12')]:![]);})['catch'](function(_0x445124){_0x69380a(_0x445124);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x4e')]=function(_0x2991cf,_0x25dfa6,_0x379439){var _0xa1a43={'role':_0x0dec('0x4f')};_0xa1a43[_0x2991cf]=this[_0x0dec('0xc')][_0x0dec('0x39')];this[_0x0dec('0xd')]['agentPause'](_0xa1a43,_0x25dfa6,this[_0x0dec('0xc')][_0x0dec('0x36')])[_0x0dec('0x11')](function(_0x23a172){_0x379439(null,_['isNil'](_0x23a172)?![]:!![]);})['catch'](function(_0x58b739){logger['error'](_0x58b739);_0x379439(null,![]);});};AGIVertices[_0x0dec('0x13')]['agentUnpause']=function(_0x4bb0db,_0x23e378){var _0x218cc4={'role':_0x0dec('0x4f')};_0x218cc4[_0x4bb0db]=this[_0x0dec('0xc')]['callerid'];this[_0x0dec('0xd')][_0x0dec('0x50')](_0x218cc4)['then'](function(_0x3cda32){_0x23e378(null,_[_0x0dec('0x47')](_0x3cda32)?![]:!![]);})[_0x0dec('0x16')](function(_0x354743){logger['error'](_0x354743);_0x23e378(null,![]);});};AGIVertices['prototype'][_0x0dec('0x51')]=function(_0x55cf7a,_0x1dc0eb){var _0x131e46={'role':_0x0dec('0x4f')};_0x131e46[_0x55cf7a]=this['channel'][_0x0dec('0x39')];this[_0x0dec('0xd')][_0x0dec('0x51')](_0x131e46)['then'](function(_0x1ae0c1){_0x1dc0eb(null,_[_0x0dec('0x47')](_0x1ae0c1)?![]:!![]);})['catch'](function(_0xea25eb){logger[_0x0dec('0x31')](_0xea25eb);_0x1dc0eb(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x423c73,_0x18725c){var _0x54efa9={'role':_0x0dec('0x4f')};_0x54efa9[_0x423c73]=this['channel'][_0x0dec('0x39')];var _0x1ba7ab=_0x423c73!=_0x0dec('0x52')?util[_0x0dec('0x53')](_0x0dec('0x54'),_0x0dec('0x55'),this[_0x0dec('0xc')][_0x0dec('0x39')]):undefined;this[_0x0dec('0xd')][_0x0dec('0x56')](_0x54efa9,_0x1ba7ab)[_0x0dec('0x11')](function(_0x30bad9){_0x18725c(null,_[_0x0dec('0x47')](_0x30bad9)?![]:!![]);})[_0x0dec('0x16')](function(_0x2394dc){logger[_0x0dec('0x31')](_0x2394dc);_0x18725c(null,![]);});};AGIVertices['prototype'][_0x0dec('0x57')]=function(_0xe511b3,_0x4edbd4){sh[_0x0dec('0x58')](_['trim'](_0xe511b3),function(_0x1ee482,_0x17ae8b){var _0x3376fb=_0x17ae8b[_0x0dec('0x59')](/(\r\n|\n|\r)/gm,'');_0x4edbd4(null,_0x3376fb);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x5a')]=function(_0x3a3df1,_0x277940){scripts[_0x0dec('0x5a')](_0x3a3df1[_0x0dec('0x5b')],_0x3a3df1[_0x0dec('0x5c')]||_0x0dec('0x5d'),_0x3a3df1[_0x0dec('0x5d')],_0x3a3df1['languageCode']||_0x0dec('0x5e'),_0x3a3df1[_0x0dec('0x5f')]||'MALE',_0x3a3df1[_0x0dec('0x60')]||_0x0dec('0x61'))[_0x0dec('0x11')](function(_0x4c6362){_0x277940(null,_0x4c6362);})['catch'](function(_0x149d51){_0x277940(_0x149d51);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x62')]=function(_0x59fe55,_0x3ccdd4){scripts[_0x0dec('0x62')](_0x59fe55[_0x0dec('0x5d')],_0x59fe55['google_tts_language']||'en',0x1)[_0x0dec('0x11')](function(_0x5443eb){_0x3ccdd4(null,_0x5443eb);})['catch'](function(_0x9a4a55){_0x3ccdd4(_0x9a4a55);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x63')]=function(_0x4e28cf,_0x436c48){var _0x5d63a2={'uri':_0x4e28cf[_0x0dec('0x64')],'method':_0x4e28cf[_0x0dec('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4e28cf['timeout'])===_0x0dec('0x66')&&parseInt(_0x4e28cf[_0x0dec('0x67')])>=0x1?parseInt(_0x4e28cf[_0x0dec('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x0dec('0x68')]([_0x0dec('0x69'),_0x0dec('0x6a')],_0x5d63a2['method'][_0x0dec('0x6b')]())){try{_0x5d63a2[_0x0dec('0x6c')]=_0x4e28cf[_0x0dec('0x6d')]?JSON['parse'](_0x4e28cf[_0x0dec('0x6d')]):{};}catch(_0x1e90ea){logger[_0x0dec('0x31')](_0x0dec('0x6e'),_0x1e90ea);}}try{_0x5d63a2[_0x0dec('0x6f')]=_0x4e28cf[_0x0dec('0x70')]?JSON[_0x0dec('0x71')](_0x4e28cf[_0x0dec('0x70')]):{};}catch(_0x31672b){logger['error'](_0x0dec('0x72'),_0x31672b);}if(_0x4e28cf['computedVariables']){try{var _0x752c61=require(_0x4e28cf['computedVariables'])['sync'](this,_0x5d63a2);_0x5d63a2[_0x0dec('0x73')]=Mustache[_0x0dec('0x74')](_0x4e28cf[_0x0dec('0x64')],_0x752c61,{},['$$','$$']);if(_0x5d63a2['headers']){_0x5d63a2[_0x0dec('0x6f')]=JSON['parse'](Mustache[_0x0dec('0x74')](JSON['stringify'](_0x5d63a2[_0x0dec('0x6f')]),_0x752c61,{},['$$','$$']));}if(_0x5d63a2[_0x0dec('0x6c')]){_0x5d63a2[_0x0dec('0x6c')]=JSON[_0x0dec('0x71')](Mustache[_0x0dec('0x74')](JSON['stringify'](_0x5d63a2[_0x0dec('0x6c')]),_0x752c61,{},['$$','$$']));}}catch(_0x4c6ced){logger[_0x0dec('0x31')](_0x0dec('0x75'),_0x4c6ced);}}rp(_0x5d63a2)['then'](function(_0x226b12){var _0x28d56d={'statusCode':_0x226b12[_0x0dec('0x76')]||0xc8,'statusMessage':_0x226b12[_0x0dec('0x77')]||'OK','headers':_0x226b12['headers']||{},'body':_0x226b12[_0x0dec('0x6c')]||{}};_0x436c48(null,_0x28d56d);})['catch'](function(_0x65a7a6){var _0xf3ed2={'statusCode':_0x65a7a6[_0x0dec('0x76')]||0x1f4,'statusMessage':_0x65a7a6[_0x0dec('0x78')]||_0x0dec('0x79'),'headers':_0x65a7a6['options'][_0x0dec('0x6f')]||{},'body':_0x65a7a6[_0x0dec('0x7a')][_0x0dec('0x6c')]||{}};_0x436c48(null,_0xf3ed2);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x7b')]=function(_0x29bda6,_0x12cb25){scripts[_0x0dec('0x7b')](this[_0x0dec('0xc')][_0x0dec('0x36')],_0x29bda6['key'],_0x29bda6['text'],_0x29bda6[_0x0dec('0x7c')]||'en')[_0x0dec('0x11')](function(_0x5819e8){_0x12cb25(null,_0x5819e8);})[_0x0dec('0x16')](function(_0x5186cb){_0x12cb25(_0x5186cb);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x7d')]=function(_0x465e8d,_0x523537){scripts[_0x0dec('0x7d')](this[_0x0dec('0xc')]['uniqueid'],_0x465e8d['dialogflowV2_project_id'],_0x465e8d[_0x0dec('0x7e')],_0x465e8d[_0x0dec('0x7f')],_0x465e8d[_0x0dec('0x5d')],_0x465e8d[_0x0dec('0x80')]||'en')['then'](function(_0xd89bbb){_0x523537(null,_0xd89bbb);})[_0x0dec('0x16')](function(_0xf5ab6d){_0x523537(_0xf5ab6d);});};AGIVertices[_0x0dec('0x13')]['sestekNDA']=function(_0x1d2b38,_0x37fe58){scripts[_0x0dec('0x81')](this[_0x0dec('0xc')],_0x1d2b38)[_0x0dec('0x11')](function(_0x47de49){_0x37fe58(null,_0x47de49);})['catch'](function(_0x4da5a8){_0x37fe58(_0x4da5a8);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x82')]=function(_0xaca40f,_0x4cf8ec){scripts[_0x0dec('0x82')](_0xaca40f[_0x0dec('0x83')],_0xaca40f[_0x0dec('0x5d')],_0xaca40f[_0x0dec('0x84')]||'en-US',_0xaca40f['speed'])[_0x0dec('0x11')](function(_0x50ca96){_0x4cf8ec(null,_0x50ca96);})[_0x0dec('0x16')](function(_0x45c822){_0x4cf8ec(_0x45c822);});};AGIVertices['prototype'][_0x0dec('0x85')]=function(_0x4d771f,_0x3d03f5,_0x20ca8c){scripts[_0x0dec('0x85')](_0x3d03f5,_0x4d771f[_0x0dec('0x83')],_0x4d771f[_0x0dec('0x86')]||_0x0dec('0x5e'),this[_0x0dec('0x87')](_0x4d771f['model'])?_0x4d771f[_0x0dec('0x88')]:undefined)[_0x0dec('0x11')](function(_0x4d9b60){_0x20ca8c(null,_0x4d9b60);})[_0x0dec('0x16')](function(_0x273e91){_0x20ca8c(_0x273e91);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x89')]=function(_0x394dd0,_0x1028fc){scripts['awsPolly'](_0x394dd0[_0x0dec('0x8a')],_0x394dd0[_0x0dec('0x8b')],_0x394dd0[_0x0dec('0x8c')],_0x394dd0['aws_polly_voice']||_0x0dec('0x8d'),_0x394dd0['text'],_0x394dd0[_0x0dec('0x8e')]||_0x0dec('0x5d'))['then'](function(_0x11b239){_0x1028fc(null,_0x11b239);})[_0x0dec('0x16')](function(_0x28156f){_0x1028fc(_0x28156f);});};AGIVertices[_0x0dec('0x13')]['awsLex']=function(_0x2b6a3d,_0x55ca42){scripts[_0x0dec('0x8f')](this[_0x0dec('0xc')][_0x0dec('0x36')],_0x2b6a3d[_0x0dec('0x8a')],_0x2b6a3d['aws_secret_access_key'],_0x2b6a3d['aws_lex_region'],_0x2b6a3d['text'],_0x2b6a3d[_0x0dec('0x90')])[_0x0dec('0x11')](function(_0x241014){_0x55ca42(null,_0x241014);})['catch'](function(_0x6c4c83){_0x55ca42(_0x6c4c83);});};AGIVertices[_0x0dec('0x13')][_0x0dec('0x91')]=function(_0x48297e,_0x2cc9c5,_0x414bc8){scripts['googleASR'](_0x2cc9c5,_0x48297e[_0x0dec('0x83')],_0x48297e['google_asr_language']||'en-US')[_0x0dec('0x11')](function(_0x4deaf1){_0x414bc8(null,_0x4deaf1);})['catch'](function(_0x312764){_0x414bc8(_0x312764);});};AGIVertices['prototype'][_0x0dec('0x92')]=function(_0x3a45c7,_0x3afd10,_0x55c240){scripts['tildeASR'](_0x3afd10,_0x3a45c7[_0x0dec('0x93')],_0x3a45c7['appsecret'],_0x3a45c7[_0x0dec('0x73')])[_0x0dec('0x11')](function(_0x18826c){_0x55c240(null,_0x18826c);})[_0x0dec('0x16')](function(_0x3907e2){_0x55c240(_0x3907e2);});};AGIVertices[_0x0dec('0x13')]['clear']=function(_0x2e4bc5){var _0x1ac6e3=_[_0x0dec('0x68')](verticesWithRetry,_0x2e4bc5[_0x0dec('0x38')])?_0x2e4bc5:_[_0x0dec('0x94')](_0x2e4bc5);for(var _0x25a927 in _0x1ac6e3){if(_0x1ac6e3[_0x0dec('0x95')](_0x25a927)){if(_0x1ac6e3[_0x25a927]&&_[_0x0dec('0x96')](_0x1ac6e3[_0x25a927])){if(_[_0x0dec('0x68')](recursiveMapAttributes,_0x25a927)){_0x1ac6e3[_0x25a927]=this[_0x0dec('0x97')](_0x1ac6e3[_0x25a927]);}else{_0x1ac6e3[_0x25a927]=this[_0x0dec('0x98')](_0x1ac6e3[_0x25a927]);}}}}return _0x1ac6e3;};AGIVertices[_0x0dec('0x13')][_0x0dec('0x99')]=function(_0x46c884){for(var _0x30b519 in _0x46c884){if(_0x46c884[_0x0dec('0x95')](_0x30b519)){if(_[_0x0dec('0x9a')](_0x46c884[_0x30b519])){this[_0x0dec('0x99')](_0x46c884[_0x30b519]);}else if(_[_0x0dec('0x9b')](_0x46c884[_0x30b519])){for(var _0x388429=0x0;_0x388429<_0x46c884[_0x30b519][_0x0dec('0x9c')];_0x388429++){this[_0x0dec('0x99')](_0x46c884[_0x30b519][_0x388429]);}}else if(_[_0x0dec('0x96')](_0x46c884[_0x30b519])){_0x46c884[_0x30b519]=this['replaceAllVariables'](_0x46c884[_0x30b519]);}}}};AGIVertices[_0x0dec('0x13')]['saveRestApiResult']=function(_0x51f131,_0x29f33f){for(var _0x3d8fc2 in _0x51f131){if(_0x51f131[_0x0dec('0x95')](_0x3d8fc2)){if(_[_0x0dec('0x9a')](_0x51f131[_0x3d8fc2])){if(!_[_0x0dec('0x44')](_0x51f131[_0x3d8fc2])){this[_0x0dec('0x9d')](_0x51f131[_0x3d8fc2],util[_0x0dec('0x53')](_0x0dec('0x9e'),_0x29f33f,_0x3d8fc2));}}else if(_[_0x0dec('0x9b')](_0x51f131[_0x3d8fc2])){for(var _0x3dfab6=0x0;_0x3dfab6<_0x51f131[_0x3d8fc2][_0x0dec('0x9c')];_0x3dfab6++){this['saveRestApiResult'](_0x51f131[_0x3d8fc2][_0x3dfab6],util['format']('%s.%s',_0x29f33f,_0x3d8fc2+'['+_0x3dfab6+']'));}}else{if(!_[_0x0dec('0x47')](_0x51f131[_0x3d8fc2])){this[_0x0dec('0xc')][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0x9e'),_0x29f33f,_0x3d8fc2),_0x51f131[_0x3d8fc2]);}}}}};AGIVertices[_0x0dec('0x13')][_0x0dec('0x97')]=function(_0x6dd28){try{var _0xf81f3d=JSON[_0x0dec('0x71')](_0x6dd28);this['recursiveNodeIndex'](_0xf81f3d);return JSON[_0x0dec('0xa0')](_0xf81f3d);}catch(_0x1a4e7e){return this[_0x0dec('0x98')](_0x6dd28);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x481cf8){var _0x573f15=_0x481cf8['split']('{');for(var _0x3dd484=0x1;_0x3dd484<_0x573f15[_0x0dec('0x9c')];_0x3dd484+=0x1){var _0x43105e=_0x573f15[_0x3dd484]['split']('}');if(_0x43105e['length']>0x1){_0x481cf8=_0x481cf8[_0x0dec('0xa1')]('{'+_0x43105e[0x0]+'}',this[_0x0dec('0xc')][_0x0dec('0xf')](_0x43105e[0x0])[_0x0dec('0xa2')]||_0x43105e[0x0]);}}if(_0x573f15['length']===0x1){return _0x481cf8[_0x0dec('0xa3')]();}return this[_0x0dec('0x98')](_0x481cf8);};AGIVertices['prototype'][_0x0dec('0xa4')]=function(_0x51ee8c,_0x4c67ca){var _0x1b7270=this[_0x0dec('0xc')][_0x0dec('0xf')](_0x51ee8c);if(_0x1b7270[_0x0dec('0xa5')]===-0x1){return _0x1b7270;}logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xa6'),_0x4c67ca,_0x1b7270[_0x0dec('0xa2')]));return this['channel'][_0x0dec('0x9f')](_0x4c67ca,_0x1b7270[_0x0dec('0xa2')]);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x87')]=function(_0x535636){return _0x535636&&_0x535636!=='0'&&_0x535636!=='-1'&&_0x535636!=='';};AGIVertices[_0x0dec('0x13')]['maxRetry']=function(_0xdd086d){this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0xdd086d,'-');_0xdd086d[_0x0dec('0xa8')]=_0xdd086d[_0x0dec('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x0dec('0xaa')]=function(_0x2ad118){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xab'),_0x2ad118[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x2ad118[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xad'));}var _0x2f278a='\x22'+_0x2ad118[_0x0dec('0x5d')]+'\x22';if(this['isConfigured'](_0x2ad118[_0x0dec('0x7a')])){_0x2f278a+=','+_0x2ad118['options'];}var _0x2baea8=this[_0x0dec('0xc')][_0x0dec('0x58')]('MRCPSynth',_0x2f278a);if(_0x2baea8[_0x0dec('0xa5')]===-0x1){return _0x2baea8;}return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xae'),_0x2f278a));};AGIVertices['prototype']['mrcprecog']=function(_0x2de1c6){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xaf'),_0x2de1c6['label']));if(!this[_0x0dec('0x87')](_0x2de1c6[_0x0dec('0xb0')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xb1'));}var _0xd56fe3=_0x2de1c6[_0x0dec('0xb0')];if(this[_0x0dec('0x87')](_0x2de1c6['options'])){_0xd56fe3+=','+_0x2de1c6[_0x0dec('0x7a')];}var _0x5750ed=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0xb2'),_0xd56fe3);if(_0x5750ed['result']===-0x1){return _0x5750ed;}var _0x809d54=this['getAndSetVariable'](_0x0dec('0xb3'),_0x0dec('0xb4'));if(_0x809d54[_0x0dec('0xa5')]===-0x1){return _0x809d54;}var _0x489145=this['getAndSetVariable'](_0x0dec('0xb5'),_0x0dec('0xb6'));if(_0x489145[_0x0dec('0xa5')]===-0x1){return _0x489145;}var _0x105383=this[_0x0dec('0xa4')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x105383[_0x0dec('0xa5')]===-0x1){return _0x105383;}return this['channel']['noop'](util['format'](_0x0dec('0xb7'),_0xd56fe3));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x7')]=function(_0x161839){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xb8'),_0x161839[_0x0dec('0x37')]));return this[_0x0dec('0xc')]['agi']([_0x161839[_0x0dec('0xb9')],_0x161839[_0x0dec('0xba')]]);};AGIVertices[_0x0dec('0x13')][_0x0dec('0xbb')]=function(_0x4d8632){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xbc'),_0x4d8632[_0x0dec('0x37')]));if(this[_0x0dec('0x87')](_0x4d8632['timeout'])){logger['info'](util['format'](_0x0dec('0xbd'),_0x4d8632[_0x0dec('0x67')]));var _0x13c2ea=this[_0x0dec('0xc')][_0x0dec('0xbe')](_0x4d8632[_0x0dec('0x67')]);if(_0x13c2ea[_0x0dec('0xa5')]===-0x1){return _0x13c2ea;}}return this['channel'][_0x0dec('0xbb')]();};AGIVertices['prototype'][_0x0dec('0xbf')]=function(_0x27729f){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xc0'),_0x27729f['label']));if(!this[_0x0dec('0x87')](_0x27729f[_0x0dec('0x4a')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x27729f,_0x0dec('0xc1'));}_0x27729f[_0x0dec('0x4b')]=moment();if(this[_0x0dec('0x87')](_0x27729f['delay'])){_0x27729f[_0x0dec('0x4b')]=moment()[_0x0dec('0xc2')](_0x27729f[_0x0dec('0xc3')],_0x0dec('0xc4'));}if(!this['isConfigured'](_0x27729f[_0x0dec('0x4c')])){_0x27729f['callback_priority']=0x2;}this[_0x0dec('0x43')][_0x0dec('0xa7')](this,_0x27729f);return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xc5'),_0x27729f['phone'],_0x27729f[_0x0dec('0x4a')],_0x27729f[_0x0dec('0x4b')]));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xc6')]=function(_0x2157f1){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xc7'),_0x2157f1[_0x0dec('0x37')]));var _0x47ca2a=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x2157f1['application'],_0x2157f1['options']);if(_0x47ca2a['result']===-0x1){return _0x47ca2a;}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('Executed\x20command\x20%s\x20%s',_0x2157f1[_0x0dec('0xc8')],_0x2157f1['options']));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xc9')]=function(_0x2ece16){logger[_0x0dec('0x2e')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2ece16['label']));if(!this[_0x0dec('0x87')](_0x2ece16[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xad'));}var _0x35fa3f='\x22'+_0x2ece16[_0x0dec('0x5d')]+'\x22';if(this[_0x0dec('0x87')](_0x2ece16[_0x0dec('0x7a')])){_0x35fa3f+=','+_0x2ece16['options'];}var _0x4cba19=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0xca'),_0x35fa3f);if(_0x4cba19[_0x0dec('0xa5')]===-0x1){return _0x4cba19;}return this['channel']['noop'](util[_0x0dec('0x53')](_0x0dec('0xae'),_0x35fa3f));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xcb')]=function(_0x28f3dc){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x28f3dc['label']));if(!this[_0x0dec('0x87')](_0x28f3dc[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')]('no\x20text\x20configured');}var _0x3907b0='\x22'+_0x28f3dc[_0x0dec('0x5d')]+'\x22';if(this[_0x0dec('0x87')](_0x28f3dc[_0x0dec('0x7a')])){_0x3907b0+=','+_0x28f3dc[_0x0dec('0x7a')];}var _0xee36f7=this['channel'][_0x0dec('0x58')]('MRCPSynth',_0x3907b0);if(_0xee36f7[_0x0dec('0xa5')]===-0x1){return _0xee36f7;}return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xae'),_0x3907b0));};AGIVertices['prototype'][_0x0dec('0xcc')]=function(_0x395455){logger[_0x0dec('0x2e')](util['format'](_0x0dec('0xcd'),_0x395455['label']));if(!this[_0x0dec('0x87')](_0x395455['grammar'])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x130986=_0x395455[_0x0dec('0xb0')];if(this['isConfigured'](_0x395455[_0x0dec('0x7a')])){_0x130986+=','+_0x395455[_0x0dec('0x7a')];}var _0x2f8e8e=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0xb2'),_0x130986);if(_0x2f8e8e['result']===-0x1){return _0x2f8e8e;}var _0x2935a0=this[_0x0dec('0xa4')](_0x0dec('0xb3'),_0x0dec('0xce'));if(_0x2935a0[_0x0dec('0xa5')]===-0x1){return _0x2935a0;}var _0x1c1099=this[_0x0dec('0xa4')](_0x0dec('0xb5'),_0x0dec('0xcf'));if(_0x1c1099['result']===-0x1){return _0x1c1099;}var _0x3b0896=this[_0x0dec('0xa4')]('RECOG_INSTANCE()',_0x0dec('0xd0'));if(_0x3b0896['result']===-0x1){return _0x3b0896;}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xb7'),_0x130986));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xd1')]=function(_0x4c871b){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xd2'),_0x4c871b[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x4c871b[_0x0dec('0xb0')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xb1'));}var _0x27cac0=_0x4c871b[_0x0dec('0xb0')];if(this[_0x0dec('0x87')](_0x4c871b['options'])){_0x27cac0+=','+_0x4c871b['options'];}var _0x3ddfc4=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0xb2'),_0x27cac0);if(_0x3ddfc4['result']===-0x1){return _0x3ddfc4;}var _0x6d8ada=this[_0x0dec('0xa4')](_0x0dec('0xb3'),_0x0dec('0xd3'));if(_0x6d8ada[_0x0dec('0xa5')]===-0x1){return _0x6d8ada;}var _0x39947d=this[_0x0dec('0xa4')](_0x0dec('0xb5'),_0x0dec('0xd4'));if(_0x39947d['result']===-0x1){return _0x39947d;}var _0x21d324=this[_0x0dec('0xa4')](_0x0dec('0xd5'),_0x0dec('0xd6'));if(_0x21d324['result']===-0x1){return _0x21d324;}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('Executed\x20command\x20MRCPRecog\x20%s',_0x27cac0));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xd7')]=function(_0x33089c){logger[_0x0dec('0x2e')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x33089c[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x33089c[_0x0dec('0xd8')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x33089c,_0x0dec('0xd9'));}var _0x899a=this[_0x0dec('0xda')][_0x0dec('0xa7')](this,_0x33089c[_0x0dec('0xd8')]);if(!_0x899a){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x33089c,_0x0dec('0xdb'));}if(!this[_0x0dec('0x87')](_0x33089c['query'])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x33089c,_0x0dec('0xdc'));}var _0x4672f7=_0x33089c['query'][_0x0dec('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xdd'),_0x4672f7));var _0x22146e=this[_0x0dec('0x2c')]['sync'](this,_0x899a,_0x4672f7);this['createSquareDetailsReport'][_0x0dec('0xa7')](this,_0x33089c,_0x4672f7);if(!this[_0x0dec('0x87')](_0x33089c[_0x0dec('0xde')])){return this[_0x0dec('0xc')]['noop'](_0x0dec('0xdf'));}var _0x55640f=this['getVariable'][_0x0dec('0xa7')](this,_0x33089c['variable_id']);if(!_0x55640f){return this['channel'][_0x0dec('0x31')](_0x33089c,_0x0dec('0xe0'));}var _0x2b1304=this;_0x22146e[_0x0dec('0xe1')](function(_0x4ceb12,_0x13fd9f){Object[_0x0dec('0xe2')](_0x4ceb12)[_0x0dec('0xe1')](function(_0x378c0e){_0x2b1304['channel'][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0xe3'),_0x55640f,_0x13fd9f,_0x378c0e),_0x4ceb12[_0x378c0e]);});});this['channel']['setVariable'](util[_0x0dec('0x53')](_0x0dec('0xe4'),_0x55640f),_0x22146e[_0x0dec('0x9c')]);return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xe5'),_0x55640f));};AGIVertices['prototype'][_0x0dec('0xe6')]=function(_0x33f004){logger[_0x0dec('0xe7')](util[_0x0dec('0x53')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x33f004[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x33f004['sip_id'])){return this['channel']['error'](_0x33f004,'no\x20user\x20selected');}var _0x3ad422=this[_0x0dec('0x1b')][_0x0dec('0xa7')](this,_0x33f004['sip_id']);if(!_0x3ad422){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x33f004,_0x0dec('0xe8'));}var _0x2d63ab=this[_0x0dec('0xc')][_0x0dec('0x58')]('DIAL',[util[_0x0dec('0x53')](_0x0dec('0xe9'),_0x3ad422),_0x33f004['timeout'],_0x33f004[_0x0dec('0xea')],_0x33f004[_0x0dec('0x64')]]);if(_0x2d63ab['result']===-0x1){return _0x2d63ab;}return this['channel'][_0x0dec('0xac')](util['format'](_0x0dec('0xeb'),_0x0dec('0xec')));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xed')]=function(_0x229c1b){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xee'),_0x229c1b[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x229c1b[_0x0dec('0x83')])){return this[_0x0dec('0xc')][_0x0dec('0xac')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x229c1b[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xad'));}this[_0x0dec('0xc')]['bot']=!![];this[_0x0dec('0x35')](_0x229c1b);this[_0x0dec('0x42')](_0x229c1b[_0x0dec('0x5d')],'in','','');this[_0x0dec('0xc')]['noop'](util[_0x0dec('0x53')]('Trying\x20Dialogflow:\x20%s',_0x229c1b[_0x0dec('0x5d')]));var _0x329a41=this[_0x0dec('0x7b')]['sync'](this,_0x229c1b);if(_0x329a41){for(var _0x238722 in _0x329a41){if(_0x329a41[_0x0dec('0x95')](_0x238722)){this['channel']['setVariable'](util['format'](_0x0dec('0xef'),_0x238722[_0x0dec('0x6b')]()),_0x329a41[_0x238722]);}}this[_0x0dec('0x42')](_0x329a41[_0x0dec('0xf0')],_0x0dec('0xf1'),'dialogflow','');return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xf2'),_0x329a41[_0x0dec('0xf0')]));}return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x229c1b,_0x0dec('0xf3'));};AGIVertices[_0x0dec('0x13')]['dialogflowV2']=function(_0x4f9c71){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0xf4'),_0x4f9c71[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x4f9c71[_0x0dec('0xf5')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xf6'));}if(!this[_0x0dec('0x87')](_0x4f9c71[_0x0dec('0x7e')])){return this[_0x0dec('0xc')][_0x0dec('0xac')]('no\x20client_email\x20configured');}if(!this[_0x0dec('0x87')](_0x4f9c71['private_key'])){return this[_0x0dec('0xc')]['noop'](_0x0dec('0xf7'));}if(!this[_0x0dec('0x87')](_0x4f9c71[_0x0dec('0x80')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xf8'));}if(!this[_0x0dec('0x87')](_0x4f9c71[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xad'));}this[_0x0dec('0xc')][_0x0dec('0xf9')]=!![];this['createSquareDetailsReport'](_0x4f9c71);this[_0x0dec('0x42')](_0x4f9c71[_0x0dec('0x5d')],'in','','');this[_0x0dec('0xc')][_0x0dec('0xac')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x4f9c71[_0x0dec('0x5d')]));var _0x36a577=this[_0x0dec('0x7d')][_0x0dec('0xa7')](this,_0x4f9c71);if(_0x36a577){for(var _0xbc8733 in _0x36a577){if(_0x36a577[_0x0dec('0x95')](_0xbc8733)){if(_0xbc8733!=='providerResponse'){this['channel'][_0x0dec('0x9f')](util['format'](_0x0dec('0xef'),_0xbc8733[_0x0dec('0x6b')]()),_0x36a577[_0xbc8733]);}}}this[_0x0dec('0x42')](_0x36a577[_0x0dec('0xf0')],'out',_0x0dec('0xfa'),_0x36a577[_0x0dec('0xfb')]);return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0xfc'),_0x36a577['speech']));}return this['channel']['error'](_0x4f9c71,_0x0dec('0xfd'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0xfe')]=function(_0x56fba1){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x56fba1[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x56fba1[_0x0dec('0xff')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x100'));}if(!this['isConfigured'](_0x56fba1[_0x0dec('0x101')])){return this['channel'][_0x0dec('0xac')](_0x0dec('0x102'));}if(!this[_0x0dec('0x87')](_0x56fba1['password'])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x103'));}if(!this[_0x0dec('0x87')](_0x56fba1['ndassistant_url'])){return this[_0x0dec('0xc')]['noop'](_0x0dec('0xad'));}this['channel'][_0x0dec('0xf9')]=!![];this[_0x0dec('0x35')](_0x56fba1);this[_0x0dec('0x42')](_0x56fba1['text'],'in','','');this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0x104'),_0x56fba1[_0x0dec('0x5d')]));var _0x48ff16=this[_0x0dec('0x81')]['sync'](this,_0x56fba1);if(_0x48ff16){for(var _0x22170f in _0x48ff16){if(_0x48ff16[_0x0dec('0x95')](_0x22170f)){this['channel'][_0x0dec('0x9f')](util[_0x0dec('0x53')]('SESTEK_NDA_%s',_0x22170f[_0x0dec('0x6b')]()),_0x48ff16[_0x22170f]);}}this[_0x0dec('0x42')](_0x48ff16[_0x0dec('0xf0')],_0x0dec('0xf1'),'sesteknda','');if(_0x48ff16[_0x0dec('0x105')]){this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x106'),_0x48ff16[_0x0dec('0x105')]));var _0x30a47c=this[_0x0dec('0xc')][_0x0dec('0x107')](_0x48ff16[_0x0dec('0x105')]);try{fs[_0x0dec('0x108')](_0x48ff16[_0x0dec('0x105')]+_0x0dec('0x109'));}catch(_0x585c33){logger['error'](_0x585c33);}return _0x30a47c;}else{return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('SestekNDA\x20Result\x20%s',_0x48ff16[_0x0dec('0xf0')]));}}return this[_0x0dec('0xc')]['error'](_0x56fba1,_0x0dec('0x10a'));};AGIVertices[_0x0dec('0x13')]['end']=function(_0x5ad270){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x10b'),_0x5ad270[_0x0dec('0x37')]));return this['channel'][_0x0dec('0xac')](_0x0dec('0x10c'));};AGIVertices['prototype'][_0x0dec('0x10d')]=function(_0x49c508){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x49c508[_0x0dec('0x37')]));var _0x45682e='';if(_0x49c508[_0x0dec('0x10e')]){if(!this[_0x0dec('0x87')](_0x49c508[_0x0dec('0x10e')])){return this[_0x0dec('0xc')]['error'](_0x49c508,_0x0dec('0x10f'));}else{var _0x2fdcf0=parseInt(_0x49c508[_0x0dec('0x10e')],0xa);if(isNaN(_0x2fdcf0)){_0x45682e=_0x49c508['trunk_id'];}else{_0x45682e=this[_0x0dec('0x1d')]['sync'](this,_0x49c508[_0x0dec('0x10e')]);if(!_0x45682e){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x49c508,_0x0dec('0x110'));}}}}else if(_0x49c508[_0x0dec('0x111')]){_0x45682e=_0x49c508[_0x0dec('0x111')];}else{return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x49c508,'no\x20trunk\x20selected');}var _0xeebfa0=this[_0x0dec('0xc')]['exec']('DIAL',[util['format'](_0x0dec('0x112'),_0x45682e,_0x49c508['phone']),_0x49c508[_0x0dec('0x67')],_0x49c508[_0x0dec('0xea')],_0x49c508[_0x0dec('0x64')]]);if(_0xeebfa0[_0x0dec('0xa5')]===-0x1){return _0xeebfa0;}return this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0xeb'),'DIAL'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x113')]=function(_0x43648b){logger['info'](util[_0x0dec('0x53')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x43648b[_0x0dec('0x37')]));return this['channel'][_0x0dec('0xac')]('finally');};AGIVertices[_0x0dec('0x13')][_0x0dec('0xa')]=function(_0x262013){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x262013[_0x0dec('0x37')]));if(_0x262013['retry']===0x0){return this[_0x0dec('0xa9')](_0x262013);}_0x262013['retry']-=0x1;if(!this[_0x0dec('0x87')](_0x262013[_0x0dec('0x114')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x262013,_0x0dec('0x115'));}var _0x46b71e=this['getSound'][_0x0dec('0xa7')](this,_0x262013[_0x0dec('0x114')]);if(!_0x46b71e){return this['channel'][_0x0dec('0x31')](_0x262013,_0x0dec('0x116'));}if(!this[_0x0dec('0x87')](_0x262013[_0x0dec('0xde')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x0dec('0xdf'));}var _0x2d22fe=this[_0x0dec('0xc')]['getData'](_0x46b71e,_0x262013[_0x0dec('0x117')],_0x262013[_0x0dec('0x118')]);var _0x4de3c3=_0x2d22fe[_0x0dec('0xa5')]?_0x2d22fe[_0x0dec('0xa5')][_0x0dec('0xa3')]():'';logger[_0x0dec('0x2e')](_0x0dec('0x119'),JSON[_0x0dec('0xa0')](_0x2d22fe));if(_0x2d22fe[_0x0dec('0xa5')]===-0x1){this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x262013,_0x4de3c3);return _0x2d22fe;}else if(_0x2d22fe[_0x0dec('0xa2')]===_0x0dec('0x67')){_0x2d22fe[_0x0dec('0xa5')]=_0x4de3c3[_0x0dec('0x9c')]>=parseInt(_0x262013['mindigit'])?'x':'i';}else{_0x2d22fe[_0x0dec('0xa5')]=_0x4de3c3[_0x0dec('0x9c')]>=parseInt(_0x262013[_0x0dec('0x11a')])&&_0x4de3c3[_0x0dec('0x9c')]<=parseInt(_0x262013[_0x0dec('0x118')])?'x':'i';}var _0x255367=this[_0x0dec('0xf')][_0x0dec('0xa7')](this,_0x262013[_0x0dec('0xde')]);if(!_0x255367){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x262013,_0x0dec('0xe0'));}this[_0x0dec('0xc')][_0x0dec('0x9f')](_0x255367,_0x4de3c3);if(this['isConfigured'](_0x262013[_0x0dec('0x11b')])){var _0x2f9f75=parseInt(_0x262013[_0x0dec('0x11b')],0xa);var _0x174ebf=rs[_0x0dec('0x11c')]({'charset':'*','length':_0x2f9f75});var _0x531705=_0x4de3c3[_0x0dec('0x9c')];if(_0x531705>0x0){if(_0x531705>_0x2f9f75){this['createSquareDetailsReport'][_0x0dec('0xa7')](this,_0x262013,_0x262013[_0x0dec('0x11d')]===_0x0dec('0x11e')?_0x174ebf+_0x4de3c3[_0x0dec('0x11f')](_0x2f9f75):_0x4de3c3[_0x0dec('0x11f')](0x0,_0x531705-_0x2f9f75)+_0x174ebf);}else{this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x262013,rs[_0x0dec('0x11c')]({'charset':'*','length':_0x531705}));}}else{this['createSquareDetailsReport'][_0x0dec('0xa7')](this,_0x262013,'');}}else{this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x262013,_0x4de3c3);}return _0x2d22fe;};AGIVertices[_0x0dec('0x13')]['getsecretdigits']=function(_0x1ca762){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x120'),_0x1ca762[_0x0dec('0x37')]));return this[_0x0dec('0xa')](_0x1ca762);};AGIVertices['prototype'][_0x0dec('0x121')]=function(_0x2426c2){logger[_0x0dec('0x2e')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x2426c2[_0x0dec('0x37')]));this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x2426c2,_0x2426c2[_0x0dec('0x122')]);return this['channel']['noop'](util['format'](_0x0dec('0x123'),_0x2426c2[_0x0dec('0x122')]));};AGIVertices['prototype'][_0x0dec('0x124')]=function(_0x1b7423){logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x125'),_0x1b7423[_0x0dec('0x37')]));if(!this['isConfigured'](_0x1b7423[_0x0dec('0x8a')])||!this[_0x0dec('0x87')](_0x1b7423[_0x0dec('0x8b')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x126'));}if(!this['isConfigured'](_0x1b7423[_0x0dec('0x5d')])){return this[_0x0dec('0xc')]['noop']('no\x20text\x20configured');}this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')]('Trying\x20aws\x20Polly\x20%s',_0x1b7423[_0x0dec('0x5d')]));var _0x33bfeb=this[_0x0dec('0x89')]['sync'](this,_0x1b7423);if(_0x33bfeb){this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x127'),_0x33bfeb));var _0x284d9c=this[_0x0dec('0xc')][_0x0dec('0x107')](_0x33bfeb);try{fs[_0x0dec('0x108')](_0x33bfeb+_0x0dec('0x109'));}catch(_0x227575){logger[_0x0dec('0x31')](_0x227575);}return _0x284d9c;}return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x1b7423,_0x0dec('0x128'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x129')]=function(_0x358518){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x358518[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x358518[_0x0dec('0x8a')])||!this[_0x0dec('0x87')](_0x358518['aws_secret_access_key'])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x126'));}if(!this[_0x0dec('0x87')](_0x358518[_0x0dec('0x90')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x12a'));}if(!this[_0x0dec('0x87')](_0x358518[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xad'));}this[_0x0dec('0xc')]['bot']=!![];this[_0x0dec('0x35')](_0x358518);this[_0x0dec('0x42')](_0x358518[_0x0dec('0x5d')],'in','','');this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('Trying\x20Amazon\x20Lex:\x20%s',_0x358518['text']));var _0x2f7a78=this['awsLex'][_0x0dec('0xa7')](this,_0x358518);if(_0x2f7a78){for(var _0x4c3b35 in _0x2f7a78){if(_0x2f7a78[_0x0dec('0x95')](_0x4c3b35)&&_[_0x0dec('0x96')](_0x2f7a78[_0x4c3b35])){this['channel'][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0x12b'),_0x4c3b35[_0x0dec('0x6b')]()),_0x2f7a78[_0x4c3b35]);}}if(_[_0x0dec('0x47')](_0x2f7a78[_0x0dec('0x78')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x12c'));}else{this['createSquareMessage'](_0x2f7a78[_0x0dec('0x78')],_0x0dec('0xf1'),'amazonlex','');return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x12d'),_0x2f7a78['message']));}}return this['channel'][_0x0dec('0x31')](_0x358518,_0x0dec('0x12e'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x12f')]=function(_0x42ea62){logger[_0x0dec('0x2e')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x42ea62[_0x0dec('0x37')],_0x42ea62[_0x0dec('0x67')]));if(!this[_0x0dec('0x87')](_0x42ea62[_0x0dec('0x83')])){return this[_0x0dec('0xc')][_0x0dec('0xac')]('no\x20key\x20configured');}var _0x250b93=_0x0dec('0x130');var _0x4a52d2=util['format'](_0x0dec('0x131'),FILES_PATH,rs[_0x0dec('0x11c')](0x4));var _0x31443e=util['format'](_0x0dec('0x9e'),_0x4a52d2,_0x250b93);var _0x1d80e4=!![];if(_0x42ea62['beep']===_0x0dec('0x132')){_0x1d80e4=![];}var _0x1f5865=this[_0x0dec('0xc')]['recordFile'](_0x4a52d2,_0x250b93,_0x42ea62[_0x0dec('0x133')],_0x42ea62[_0x0dec('0x67')],undefined,_0x1d80e4);if(_0x1f5865[_0x0dec('0xa5')]!==-0x1){this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x134'),_0x31443e));var _0x558776=this[_0x0dec('0x91')]['sync'](this,_0x42ea62,_0x31443e);if(_0x558776){for(var _0x34c374 in _0x558776){if(_0x558776['hasOwnProperty'](_0x34c374)){this[_0x0dec('0xc')][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0x135'),_0x34c374['toUpperCase']()),_0x558776[_0x34c374]);}}return this[_0x0dec('0xc')]['noop'](util[_0x0dec('0x53')]('GoogleASR\x20Result\x20%s',JSON[_0x0dec('0xa0')](_0x558776)));}}return _0x1f5865;};AGIVertices[_0x0dec('0x13')][_0x0dec('0x136')]=function(_0x517540){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x137'),_0x517540['label']));if(!this[_0x0dec('0x87')](_0x517540[_0x0dec('0x93')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x138'));}if(!this['isConfigured'](_0x517540[_0x0dec('0x139')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x13a'));}var _0x1a4d71=_0x0dec('0x130');var _0x4375f8=util['format'](_0x0dec('0x131'),FILES_PATH,rs[_0x0dec('0x11c')](0x4));var _0x3df121=util['format']('%s.%s',_0x4375f8,_0x1a4d71);var _0x471097=!![];if(_0x517540[_0x0dec('0x13b')]==='NOBEEP'){_0x471097=![];}var _0x3ffc93=this[_0x0dec('0xc')][_0x0dec('0x13c')](_0x4375f8,_0x1a4d71,_0x517540[_0x0dec('0x133')],_0x517540[_0x0dec('0x67')],undefined,_0x471097);if(_0x3ffc93[_0x0dec('0xa5')]!==-0x1){this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x13d'),_0x3df121));var _0x1a4a83=this[_0x0dec('0x92')][_0x0dec('0xa7')](this,_0x517540,_0x3df121);if(_0x1a4a83){for(var _0x43fb82 in _0x1a4a83){if(_0x1a4a83[_0x0dec('0x95')](_0x43fb82)){this[_0x0dec('0xc')][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0x13e'),_0x43fb82[_0x0dec('0x6b')]()),_0x1a4a83[_0x43fb82]);}}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x13f'),JSON['stringify'](_0x1a4a83)));}}return _0x3ffc93;};AGIVertices[_0x0dec('0x13')][_0x0dec('0x140')]=function(_0x486c16){logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x141'),_0x486c16['label']));return this[_0x0dec('0xc')][_0x0dec('0x142')](_0x486c16[_0x0dec('0x3c')],_0x486c16[_0x0dec('0x3d')],_0x486c16[_0x0dec('0x3e')]);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x143')]=function(_0x412ed1){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x412ed1[_0x0dec('0x37')]));if(!this['isConfigured'](_0x412ed1[_0x0dec('0x144')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x412ed1,_0x0dec('0x145'));}try{var _0x401c03=eval(_0x412ed1['condition'])?_0x0dec('0x146'):_0x0dec('0x147');this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x148'),_0x412ed1[_0x0dec('0x144')],_0x401c03));return{'code':0xc8,'result':_0x401c03};}catch(_0x54e644){return{'code':0xc8,'result':_0x0dec('0x147')};}};AGIVertices[_0x0dec('0x13')]['gotoiftime']=function(_0x58e9f4){logger['info'](util['format'](_0x0dec('0x149'),_0x58e9f4[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x58e9f4[_0x0dec('0x14a')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x58e9f4,_0x0dec('0x14b'));}var _0x241777=this[_0x0dec('0x25')]['sync'](this,_0x58e9f4[_0x0dec('0x14a')]);if(!_0x241777){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x58e9f4,'no\x20intervals\x20found');}for(var _0x2831db=0x0;_0x2831db<_0x241777[_0x0dec('0x9c')];_0x2831db+=0x1){var _0x20de9a=this['channel']['getVariable'](util[_0x0dec('0x53')](_0x0dec('0x14c'),_0x241777[_0x2831db]));if(_0x20de9a['result']===-0x1){return _0x20de9a;}logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x14d'),_0x241777[_0x2831db],_0x20de9a[_0x0dec('0xa2')]));if(_0x20de9a[_0x0dec('0xa2')]===_0x0dec('0x146')){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('IFTIME\x20%s\x20%s',_0x241777[_0x2831db],_0x0dec('0x146')));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('IFTIME\x20%s\x20%s',_0x241777[_0x2831db],'true'));return{'code':0xc8,'result':_0x0dec('0x146')};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x241777[_0x2831db],_0x0dec('0x147')));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x14d'),_0x241777[_0x2831db],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x0dec('0x13')]['hangup']=function(_0x51a451){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x14e'),_0x51a451[_0x0dec('0x37')]));return this['channel'][_0x0dec('0x14f')]();};AGIVertices[_0x0dec('0x13')][_0x0dec('0x150')]=function(_0x316971){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x151'),_0x316971[_0x0dec('0x37')]));if(!this['isConfigured'](_0x316971['key'])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x152'));}var _0x8d4097='wav';var _0x458016=util[_0x0dec('0x53')](_0x0dec('0x131'),FILES_PATH,rs[_0x0dec('0x11c')](0x4));var _0x3f0220=util[_0x0dec('0x53')](_0x0dec('0x9e'),_0x458016,_0x8d4097);var _0x58e22d=!![];if(_0x316971[_0x0dec('0x13b')]===_0x0dec('0x132')){_0x58e22d=![];}var _0x521a1f=this['channel'][_0x0dec('0x13c')](_0x458016,_0x8d4097,_0x316971[_0x0dec('0x133')],_0x316971[_0x0dec('0x67')],undefined,_0x58e22d);if(_0x521a1f['result']!==-0x1){this['channel']['noop'](util[_0x0dec('0x53')]('ispeech\x20%s\x20file\x20created',_0x3f0220));var _0x5cbf47=this[_0x0dec('0x85')]['sync'](this,_0x316971,_0x3f0220);if(_0x5cbf47){for(var _0x11a8de in _0x5cbf47){if(_0x5cbf47['hasOwnProperty'](_0x11a8de)){this['channel'][_0x0dec('0x9f')](util[_0x0dec('0x53')]('ISPEECH_ASR_%s',_0x11a8de[_0x0dec('0x6b')]()),_0x5cbf47[_0x11a8de]);}}return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x153'),JSON[_0x0dec('0xa0')](_0x5cbf47)));}}return _0x521a1f;};AGIVertices['prototype']['ispeechtts']=function(_0x3a91c0){logger['info'](util[_0x0dec('0x53')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3a91c0[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x3a91c0[_0x0dec('0x83')])){return this[_0x0dec('0xc')]['noop']('no\x20key\x20configured');}if(!this[_0x0dec('0x87')](_0x3a91c0[_0x0dec('0x5d')])){return this['channel'][_0x0dec('0xac')](_0x0dec('0xad'));}this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0x154'),_0x3a91c0[_0x0dec('0x5d')]));var _0x7524b7=this[_0x0dec('0x82')]['sync'](this,_0x3a91c0);if(_0x7524b7){this['channel']['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x7524b7));var _0x22f827=this[_0x0dec('0xc')][_0x0dec('0x107')](_0x7524b7,_0x3a91c0[_0x0dec('0x133')]);try{fs[_0x0dec('0x108')](_0x7524b7+_0x0dec('0x109'));}catch(_0x5e0733){logger[_0x0dec('0x31')](_0x5e0733);}return _0x22f827;}return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x3a91c0,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0dec('0x13')][_0x0dec('0x155')]=function(_0x576f28){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x156'),_0x576f28['label']));if(!this[_0x0dec('0x87')](_0x576f28[_0x0dec('0x157')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x576f28,_0x0dec('0x158'));}logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x159'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x576f28['findBy']));var _0xaa6088=this['agentLogin'][_0x0dec('0xa7')](this,_0x576f28['findBy']);if(_0xaa6088){logger['info'](util[_0x0dec('0x53')](_0x0dec('0x15a'),this['channel'][_0x0dec('0x39')],_0x576f28[_0x0dec('0x157')]));this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0x15a'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x576f28['findBy']));return{'code':0xc8,'result':_0x0dec('0x15b')};}else{logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0dec('0xc')]['callerid'],_0x576f28[_0x0dec('0x157')]));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x15c'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x576f28['findBy']));return{'code':0xc8,'result':_0x0dec('0x15d')};}};AGIVertices[_0x0dec('0x13')][_0x0dec('0x15e')]=function(_0x74b7c0){logger['info'](util[_0x0dec('0x53')](_0x0dec('0x15f'),_0x74b7c0[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x74b7c0[_0x0dec('0x157')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x74b7c0,_0x0dec('0x158'));}logger['info'](util[_0x0dec('0x53')](_0x0dec('0x159'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x74b7c0[_0x0dec('0x157')]));var _0x36fcb1=this[_0x0dec('0x51')][_0x0dec('0xa7')](this,_0x74b7c0[_0x0dec('0x157')]);if(_0x36fcb1){logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x15a'),this[_0x0dec('0xc')]['callerid'],_0x74b7c0[_0x0dec('0x157')]));this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0x15a'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x74b7c0['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x15c'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x74b7c0['findBy']));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x15c'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x74b7c0[_0x0dec('0x157')]));return{'code':0xc8,'result':_0x0dec('0x15d')};}};AGIVertices[_0x0dec('0x13')][_0x0dec('0x160')]=function(_0x2f7286){logger['info'](util['format'](_0x0dec('0x161'),_0x2f7286['label']));if(!this[_0x0dec('0x87')](_0x2f7286['operation'])){return this[_0x0dec('0xc')]['error'](_0x2f7286,_0x0dec('0x162'));}this['channel'][_0x0dec('0xac')](util['format'](_0x0dec('0x163'),_0x2f7286[_0x0dec('0x164')]));var _0x593210=eval(_0x2f7286[_0x0dec('0x164')]);if(!this['isConfigured'](_0x2f7286[_0x0dec('0xde')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xdf'));}var _0x3f0f07=this[_0x0dec('0xf')][_0x0dec('0xa7')](this,_0x2f7286[_0x0dec('0xde')]);if(!_0x3f0f07){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x2f7286,_0x0dec('0xe0'));}if(_[_0x0dec('0x9b')](_0x593210)){var _0x37dfb1=this;_0x593210[_0x0dec('0xe1')](function(_0x2f93e2,_0x5bd5bc){_0x37dfb1[_0x0dec('0xc')][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0x165'),_0x3f0f07,_0x5bd5bc),_0x2f93e2);});return this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0x166'),_0x3f0f07));}else{return this['channel'][_0x0dec('0x9f')](_0x3f0f07,_0x593210);}};AGIVertices[_0x0dec('0x13')][_0x0dec('0x167')]=function(_0x546874){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x168'),_0x546874[_0x0dec('0x37')]));if(_0x546874['retry']===0x0){return this[_0x0dec('0xa9')](_0x546874);}_0x546874[_0x0dec('0xa8')]-=0x1;if(!this[_0x0dec('0x87')](_0x546874[_0x0dec('0x114')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x546874,'no\x20file\x20audio\x20selected');}var _0x5557f3=this[_0x0dec('0x1f')][_0x0dec('0xa7')](this,_0x546874['file_id']);if(!_0x5557f3){return this['channel']['error'](_0x546874,_0x0dec('0x116'));}var _0x5ae2d2=this['channel']['getData'](_0x5557f3,_0x546874[_0x0dec('0x117')],_0x546874['digit']);var _0x331090=_0x5ae2d2['result'];if(_0x5ae2d2[_0x0dec('0xa5')]===-0x1){this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x546874,'-1');return _0x5ae2d2;}else if(_0x5ae2d2[_0x0dec('0xa2')]===_0x0dec('0x67')){_0x5ae2d2[_0x0dec('0xa5')]=_0x5ae2d2[_0x0dec('0xa5')][_0x0dec('0x9c')]>0x0?_0x5ae2d2[_0x0dec('0xa5')]:'t';}else if(_[_0x0dec('0x44')](_0x5ae2d2[_0x0dec('0xa5')])){_0x5ae2d2['result']='#';_0x331090='#';}if(!this['isConfigured'](_0x546874['variable_id'])){this[_0x0dec('0xc')][_0x0dec('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x8d2747=this[_0x0dec('0xf')][_0x0dec('0xa7')](this,_0x546874[_0x0dec('0xde')]);if(!_0x8d2747){return this['channel'][_0x0dec('0x31')](_0x546874,_0x0dec('0xe0'));}this[_0x0dec('0xc')][_0x0dec('0x9f')](_0x8d2747,_0x331090);}this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x546874,_0x331090);return _0x5ae2d2;};AGIVertices['prototype'][_0x0dec('0xac')]=function(_0x2cc55b){logger['info'](util['format'](_0x0dec('0x169'),_0x2cc55b[_0x0dec('0x37')]));return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x2cc55b[_0x0dec('0x16a')]||_0x2cc55b[_0x0dec('0x37')]);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x16b')]=function(_0xdec403){logger['info'](util[_0x0dec('0x53')](_0x0dec('0x16c'),_0xdec403[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0xdec403[_0x0dec('0x157')])){return this[_0x0dec('0xc')]['error'](_0xdec403,_0x0dec('0x158'));}logger['info'](util[_0x0dec('0x53')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0dec('0xc')][_0x0dec('0x39')],_0xdec403['findBy']));var _0x45db3b=this['getPause']['sync'](this,_0xdec403[_0x0dec('0x16d')]);var _0x3ccb25=this['agentPause'][_0x0dec('0xa7')](this,_0xdec403[_0x0dec('0x157')],_0x45db3b);if(_0x3ccb25){logger['info'](util[_0x0dec('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0dec('0xc')][_0x0dec('0x39')],_0xdec403['findBy']));this[_0x0dec('0xc')][_0x0dec('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0dec('0xc')][_0x0dec('0x39')],_0xdec403[_0x0dec('0x157')]));return{'code':0xc8,'result':_0x0dec('0x15b')};}else{logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x15c'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0xdec403[_0x0dec('0x157')]));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0dec('0xc')]['callerid'],_0xdec403['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0dec('0x13')]['playback']=function(_0x54fd4d){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x16e'),_0x54fd4d[_0x0dec('0x37')]));if(!this['isConfigured'](_0x54fd4d[_0x0dec('0x114')])){return this['channel'][_0x0dec('0x31')](_0x54fd4d,_0x0dec('0x115'));}var _0x3d08fa=this[_0x0dec('0x1f')][_0x0dec('0xa7')](this,_0x54fd4d[_0x0dec('0x114')]);if(!_0x3d08fa){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x54fd4d,'no\x20file\x20audio\x20found');}var _0x5c477e=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0x16f'),[_0x3d08fa,_0x54fd4d[_0x0dec('0xea')]]);if(_0x5c477e[_0x0dec('0xa5')]===-0x1){return _0x5c477e;}return this['channel'][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x170'),_0x0dec('0x16f'),_0x3d08fa));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x171')]=function(_0x481ffd){logger['info'](util[_0x0dec('0x53')](_0x0dec('0x172'),_0x481ffd['label']));if(!this[_0x0dec('0x87')](_0x481ffd[_0x0dec('0x173')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x481ffd,'no\x20queue\x20selected');}var _0x24c5b1='';var _0x419662=parseInt(_0x481ffd[_0x0dec('0x173')],0xa);if(isNaN(_0x419662)){_0x24c5b1=_0x481ffd[_0x0dec('0x173')];}else{_0x24c5b1=this[_0x0dec('0x14')][_0x0dec('0xa7')](this,_0x481ffd[_0x0dec('0x173')]);if(!_0x24c5b1){return this['channel'][_0x0dec('0x31')](_0x481ffd,_0x0dec('0x174'));}}var _0xc6efe7='';if(this['isConfigured'](_0x481ffd[_0x0dec('0x114')])){var _0x3182d8=this[_0x0dec('0x1f')]['sync'](this,_0x481ffd[_0x0dec('0x114')]);if(_0x3182d8){_0xc6efe7=_0x3182d8;}}this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x481ffd,_0x24c5b1);if(_0x481ffd[_0x0dec('0xea')][_0x0dec('0x175')]('x')<0x0){_0x481ffd[_0x0dec('0xea')]+='x';}if(_0x481ffd[_0x0dec('0xea')][_0x0dec('0x175')]('X')<0x0){_0x481ffd[_0x0dec('0xea')]+='X';}this[_0x0dec('0xc')][_0x0dec('0x9f')](_0x0dec('0x176'),_0x24c5b1?_0x24c5b1[_0x0dec('0x177')]():'');var _0x5b6b08=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0x178'),[_0x24c5b1,_0x481ffd[_0x0dec('0xea')],_0x481ffd['url'],_0xc6efe7,_0x481ffd['timeout'],_0x481ffd[_0x0dec('0x7')],_0x481ffd[_0x0dec('0x179')],_0x481ffd[_0x0dec('0x17a')],'',_0x481ffd[_0x0dec('0x17b')]]);if(_0x5b6b08['result']===-0x1){return _0x5b6b08;}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x170'),_0x0dec('0x178'),_0x24c5b1));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x17c')]=function(_0xe46bea){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x17d'),_0xe46bea['label']));var _0x5360a8=_0xe46bea['recordingFormat']||'wav';var _0x195d1d=util['format'](_0x0dec('0x17e'),this['channel'][_0x0dec('0x36')],rs['generate'](0x5));var _0x527de0=util[_0x0dec('0x53')]('%s/recordings/%s.%s',FILES_PATH,_0x195d1d,_0x5360a8);var _0x55df93=util['format']('%s/recordings/%s',FILES_PATH,_0x195d1d);this[_0x0dec('0x3a')]['sync'](this,_0xe46bea,_0x195d1d,_0x527de0);this['channel'][_0x0dec('0x9f')](_0x0dec('0x17f'),_0x195d1d);logger[_0x0dec('0x2e')](_0x0dec('0x180'),_0x55df93,_0x5360a8,_0xe46bea[_0x0dec('0x181')],_0xe46bea['timeout']);return this[_0x0dec('0xc')][_0x0dec('0x13c')](_0x55df93,_0x5360a8,_0xe46bea[_0x0dec('0x181')],_0xe46bea['timeout'],undefined,!![]);};AGIVertices[_0x0dec('0x13')]['restapi']=function(_0x1b32b4){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1b32b4[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x1b32b4[_0x0dec('0x64')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x182'));}var _0x5a7421=this[_0x0dec('0x63')][_0x0dec('0xa7')](this,_0x1b32b4);logger['info'](util[_0x0dec('0x53')](_0x0dec('0x183'),util[_0x0dec('0x184')](_0x5a7421,{'showHidden':![],'depth':null})));if(!this[_0x0dec('0x87')](_0x1b32b4['variable_id'])){return this[_0x0dec('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x51ab82=this[_0x0dec('0xf')][_0x0dec('0xa7')](this,_0x1b32b4[_0x0dec('0xde')]);if(!_0x51ab82){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x1b32b4,_0x0dec('0xe0'));}this['channel'][_0x0dec('0x9f')](util['format'](_0x0dec('0x185'),_0x51ab82),_0x5a7421['statusCode']?_0x5a7421[_0x0dec('0x76')]:_0x0dec('0x186'));this[_0x0dec('0xc')][_0x0dec('0x9f')](util[_0x0dec('0x53')](_0x0dec('0x187'),_0x51ab82),_0x5a7421['statusMessage']?_0x5a7421[_0x0dec('0x77')]:'OK');if(_0x5a7421[_0x0dec('0x6c')]){try{this[_0x0dec('0x9d')](_0x5a7421['body'],_0x51ab82);}catch(_0x4bc86b){logger[_0x0dec('0x31')](util['format'](_0x0dec('0x188'),_0x51ab82));}}return this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0xe5'),_0x51ab82));};AGIVertices[_0x0dec('0x13')]['saydigits']=function(_0x1c607b){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x189'),_0x1c607b[_0x0dec('0x37')]));return this[_0x0dec('0xc')][_0x0dec('0x18a')](_0x1c607b[_0x0dec('0x18b')][_0x0dec('0x59')](/\s+/g,''),_0x1c607b[_0x0dec('0x181')]);};AGIVertices['prototype'][_0x0dec('0x18c')]=function(_0x102f8d){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x18d'),_0x102f8d['label']));return this[_0x0dec('0xc')][_0x0dec('0x18e')](_0x102f8d[_0x0dec('0x66')]['replace'](/\s+/g,''),_0x102f8d['escape_digits']);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x18f')]=function(_0x3cfda8){logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x190'),_0x3cfda8[_0x0dec('0x37')]));return this[_0x0dec('0xc')][_0x0dec('0x191')](_0x3cfda8['text'],_0x3cfda8[_0x0dec('0x181')]);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x192')]=function(_0x34f766){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x34f766[_0x0dec('0x37')]));if(!this['isConfigured'](_0x34f766[_0x0dec('0x193')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0x194'));}var _0x44aee0=this[_0x0dec('0x22')][_0x0dec('0xa7')](this,_0x34f766[_0x0dec('0x193')]);if(!_0x44aee0||!_0x44aee0[_0x0dec('0x195')]){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x34f766,_0x0dec('0x196'));}var _0x52d293={'from':util['format']('\x22%s\x22\x20<%s>',_0x44aee0['name'],_0x44aee0['email']||_0x44aee0['Smtp'][_0x0dec('0x197')]),'to':_0x34f766['to']||'','cc':_0x34f766['cc']||'','bcc':_0x34f766[_0x0dec('0x198')]||'','subject':_0x34f766[_0x0dec('0x199')],'html':_0x34f766[_0x0dec('0x5d')],'text':_0x34f766['text']};var _0x10dfa5={'tls':{'rejectUnauthorized':![]}};if(_0x44aee0[_0x0dec('0x195')][_0x0dec('0x19a')]){_0x10dfa5[_0x0dec('0x19a')]=_0x44aee0[_0x0dec('0x195')][_0x0dec('0x19a')];}else{_0x10dfa5[_0x0dec('0x19b')]=_0x44aee0[_0x0dec('0x195')]['host'];_0x10dfa5[_0x0dec('0x19c')]=_0x44aee0[_0x0dec('0x195')][_0x0dec('0x19c')];_0x10dfa5[_0x0dec('0x19d')]=_0x44aee0[_0x0dec('0x195')][_0x0dec('0x19d')];}if(_0x44aee0[_0x0dec('0x195')][_0x0dec('0x19e')]){_0x10dfa5[_0x0dec('0x19f')]={'user':_0x44aee0[_0x0dec('0x195')][_0x0dec('0x197')],'pass':_0x44aee0['Smtp'][_0x0dec('0x1a0')]};}if(this[_0x0dec('0x87')](_0x34f766[_0x0dec('0x1a1')])){}logger[_0x0dec('0xe7')](_0x0dec('0x1a2'),JSON[_0x0dec('0xa0')](_0x52d293));this['createSquareDetailsReport'][_0x0dec('0xa7')](this,_0x34f766,_0x34f766[_0x0dec('0x193')]);this[_0x0dec('0xc')][_0x0dec('0xac')](util['format'](_0x0dec('0x1a3'),_0x44aee0['name']));this[_0x0dec('0x24')]['sync'](this,_0x10dfa5,_0x52d293);return this['channel'][_0x0dec('0xac')](_0x0dec('0x1a4'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1a5')]=function(_0x450da8){logger['info'](util[_0x0dec('0x53')](_0x0dec('0x1a6'),_0x450da8['label']));return this['channel'][_0x0dec('0xac')](_0x0dec('0x1a7'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1a8')]=function(_0x312e34){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x1a9'),_0x312e34['label']));if(!this[_0x0dec('0x87')](_0x312e34[_0x0dec('0x1aa')])){return this[_0x0dec('0xc')]['noop'](_0x0dec('0x1ab'));}var _0x11ec91=this[_0x0dec('0x1ac')][_0x0dec('0xa7')](this,_0x312e34[_0x0dec('0x1aa')]);if(!_0x11ec91){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x312e34,'no\x20sms\x20account\x20found');}var _0x4fcc90={'body':_0x312e34[_0x0dec('0x1ad')],'phone':_0x312e34['to']||'','SmsAccountId':_0x11ec91['id']};logger[_0x0dec('0xe7')](_0x0dec('0x1ae'),JSON[_0x0dec('0xa0')](_0x4fcc90));this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x312e34,_0x312e34[_0x0dec('0x1aa')]);this[_0x0dec('0xc')]['noop'](util[_0x0dec('0x53')](_0x0dec('0x1af'),_0x11ec91[_0x0dec('0x12')]));this['createSmsMessage']['sync'](this,_0x4fcc90);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1b0')]=function(_0x309575){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x1b1'),_0x309575[_0x0dec('0x37')]));if(!this[_0x0dec('0x87')](_0x309575[_0x0dec('0xde')])){return this[_0x0dec('0xc')]['error'](_0x309575,_0x0dec('0x1b2'));}var _0x3f39b9=this[_0x0dec('0xf')]['sync'](this,_0x309575[_0x0dec('0xde')]);if(!_0x3f39b9){return this[_0x0dec('0xc')]['error'](_0x309575,_0x0dec('0xe0'));}return this[_0x0dec('0xc')][_0x0dec('0x9f')](_0x3f39b9,_0x309575[_0x0dec('0x1b3')]);};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1b4')]=function(_0x266923){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20START\x20(%s)\x20block',_0x266923[_0x0dec('0x37')]));this[_0x0dec('0xc')][_0x0dec('0xac')]('START\x20CALLY\x20SQUARE');if(_0x266923[_0x0dec('0xbb')]==='yes'){this[_0x0dec('0xc')]['noop'](_0x0dec('0x1b5'));return this[_0x0dec('0xc')][_0x0dec('0xbb')]();}return this[_0x0dec('0xc')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x0dec('0x1b6')]=function(_0xe60829){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x1b7'),_0xe60829[_0x0dec('0x37')]));if(!this['isConfigured'](_0xe60829[_0x0dec('0x1b8')])){return this[_0x0dec('0xc')]['error'](_0xe60829,'no\x20subproject\x20selected');}var _0x40f1fa=this[_0x0dec('0x17')][_0x0dec('0xa7')](this,_0xe60829['project_id']);if(!this[_0x0dec('0x87')](_0x40f1fa)){return this['channel'][_0x0dec('0x31')](_0xe60829,util[_0x0dec('0x53')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0xe60829['project_id']));}if(_0x40f1fa===this[_0x0dec('0xc')]['arg_1']){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0xe60829,_0x0dec('0x1b9'));}this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0xe60829,_0x40f1fa);var _0x19aba8=this['channel'][_0x0dec('0x58')](_0x0dec('0x1ba'),util[_0x0dec('0x53')](_0x0dec('0x1bb'),config['agi'][_0x0dec('0x19b')]||_0x0dec('0x1bc'),_0x40f1fa,this[_0x0dec('0xc')][_0x0dec('0x41')]));if(_0x19aba8['result']===-0x1){return _0x19aba8;}return this[_0x0dec('0xc')]['noop'](util[_0x0dec('0x53')](_0x0dec('0x170'),_0x0dec('0x1ba'),_0x40f1fa));};AGIVertices[_0x0dec('0x13')]['system']=function(_0x1b76c6){logger[_0x0dec('0x2e')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1b76c6[_0x0dec('0x37')]));var _0x5975a5=this[_0x0dec('0x57')][_0x0dec('0xa7')](this,_0x1b76c6[_0x0dec('0xb9')]);this[_0x0dec('0x35')][_0x0dec('0xa7')](this,_0x1b76c6,_0x1b76c6[_0x0dec('0xb9')]);if(this[_0x0dec('0x87')](_0x1b76c6['variable_id'])){var _0x27ba09=this[_0x0dec('0xf')][_0x0dec('0xa7')](this,_0x1b76c6[_0x0dec('0xde')]);if(_0x27ba09){this[_0x0dec('0xc')][_0x0dec('0x9f')](_0x27ba09,_0x5975a5);return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1b76c6[_0x0dec('0xb9')],_0x27ba09));}}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1b76c6['command']));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1bd')]=function(_0x106ad5){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x1be'),_0x106ad5[_0x0dec('0x37')]));_0x106ad5['text']=_0x106ad5['text'][_0x0dec('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0dec('0x87')](_0x106ad5['apiKey'])){return this[_0x0dec('0xc')]['noop'](_0x0dec('0x1bf'));}if(!this[_0x0dec('0x87')](_0x106ad5[_0x0dec('0x5d')])){return this[_0x0dec('0xc')][_0x0dec('0xac')](_0x0dec('0xad'));}this[_0x0dec('0xc')]['noop'](util['format'](_0x0dec('0x1c0'),_0x106ad5['text']));var _0x372d49=this[_0x0dec('0x5a')]['sync'](this,_0x106ad5);if(_0x372d49){this[_0x0dec('0xc')][_0x0dec('0xac')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x372d49));var _0x5664c6=this['channel'][_0x0dec('0x107')](_0x372d49);try{fs[_0x0dec('0x108')](_0x372d49+_0x0dec('0x109'));}catch(_0x53149a){logger['error'](_0x53149a);}return _0x5664c6;}return this['channel'][_0x0dec('0x31')](_0x106ad5,_0x0dec('0x1c1'));};AGIVertices[_0x0dec('0x13')]['tts']=function(_0x4947dd){logger[_0x0dec('0x2e')](util['format'](_0x0dec('0x1c2'),_0x4947dd[_0x0dec('0x37')]));_0x4947dd[_0x0dec('0x5d')]=_0x4947dd[_0x0dec('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0dec('0x87')](_0x4947dd[_0x0dec('0x5d')])){return this['channel'][_0x0dec('0xac')](_0x0dec('0xad'));}this[_0x0dec('0xc')]['noop'](util[_0x0dec('0x53')](_0x0dec('0x1c3'),_0x4947dd['text']));var _0x15b92f=this[_0x0dec('0x62')][_0x0dec('0xa7')](this,_0x4947dd);if(_0x15b92f){this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')]('Google\x20TTS\x20%s\x20file\x20created',_0x15b92f));var _0x20f84d=this[_0x0dec('0xc')][_0x0dec('0x107')](_0x15b92f);try{fs['unlink'](_0x15b92f+_0x0dec('0x109'));}catch(_0x32ac60){logger[_0x0dec('0x31')](_0x32ac60);}return _0x20f84d;}return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x4947dd,_0x0dec('0x1c4'));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1c5')]=function(_0x48804d){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x1c6'),_0x48804d[_0x0dec('0x37')]));if(!this['isConfigured'](_0x48804d[_0x0dec('0x157')])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x48804d,_0x0dec('0x158'));}logger['info'](util['format'](_0x0dec('0x159'),this[_0x0dec('0xc')][_0x0dec('0x39')],_0x48804d[_0x0dec('0x157')]));var _0x5d20d2=this['agentUnpause'][_0x0dec('0xa7')](this,_0x48804d[_0x0dec('0x157')]);if(_0x5d20d2){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')](_0x0dec('0x15a'),this[_0x0dec('0xc')]['callerid'],_0x48804d[_0x0dec('0x157')]));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x15a'),this['channel']['callerid'],_0x48804d[_0x0dec('0x157')]));return{'code':0xc8,'result':_0x0dec('0x15b')};}else{logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0dec('0xc')][_0x0dec('0x39')],_0x48804d[_0x0dec('0x157')]));this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x15c'),this['channel'][_0x0dec('0x39')],_0x48804d[_0x0dec('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1c7')]=function(_0x557013){logger[_0x0dec('0x2e')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x557013['label']));var _0x53c7f9=this[_0x0dec('0xc')][_0x0dec('0x58')](_0x0dec('0x1c8'),[_0x557013[_0x0dec('0x1c9')],_0x557013['options']]);if(_0x53c7f9[_0x0dec('0xa5')]===-0x1){return _0x53c7f9;}return this[_0x0dec('0xc')][_0x0dec('0xac')](util[_0x0dec('0x53')](_0x0dec('0x170'),_0x0dec('0x1c8'),_0x557013[_0x0dec('0x1c9')]));};AGIVertices[_0x0dec('0x13')][_0x0dec('0x1ca')]=function(_0x15d5c2){logger[_0x0dec('0x2e')](util[_0x0dec('0x53')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x15d5c2['label']));if(!this[_0x0dec('0x87')](_0x15d5c2['variable_id'])){return this[_0x0dec('0xc')][_0x0dec('0x31')](_0x15d5c2,'no\x20variable\x20selected');}var _0x2da497=this[_0x0dec('0xf')][_0x0dec('0xa7')](this,_0x15d5c2['variable_id']);if(!_0x2da497){return this[_0x0dec('0xc')]['error'](_0x15d5c2,_0x0dec('0xe0'));}var _0x4f017c=this[_0x0dec('0xc')][_0x0dec('0xf')](_0x2da497);return{'code':0xc8,'result':_0x4f017c[_0x0dec('0xa2')]?_0x4f017c['extra']:'-'};};String[_0x0dec('0x13')][_0x0dec('0xa1')]=function(_0x3d22f7,_0x57d4f3){return this[_0x0dec('0x1cb')](_0x3d22f7)['join'](_0x57d4f3);};module[_0x0dec('0x1cc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b57396b..f17085a 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 _0xb6c6=['channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','voicePause','info','destlinkedid','savePause','then','acwTimeout','timer','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw'];(function(_0x418977,_0x5c1a09){var _0x5701cb=function(_0x14a38e){while(--_0x14a38e){_0x418977['push'](_0x418977['shift']());}};_0x5701cb(++_0x5c1a09);}(_0xb6c6,0x8e));var _0x6b6c=function(_0x3f91d1,_0x4de877){_0x3f91d1=_0x3f91d1-0x0;var _0x15ba99=_0xb6c6[_0x3f91d1];return _0x15ba99;};'use strict';var util=require(_0x6b6c('0x0'));var _=require('lodash');var moment=require(_0x6b6c('0x1'));var ami=require(_0x6b6c('0x2'));var logger=require(_0x6b6c('0x3'))(_0x6b6c('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x6b6c('0x5'));function Acw(_0x5a0913){this[_0x6b6c('0x6')]=_0x5a0913['voiceQueues'];this[_0x6b6c('0x7')]=_0x5a0913['agents'];this[_0x6b6c('0x8')]=_0x5a0913['timers'];this['channels']={};ami['on']('agentconnect',this[_0x6b6c('0x9')][_0x6b6c('0xa')](this));ami['on'](_0x6b6c('0xb'),this['syncHangupRequest'][_0x6b6c('0xa')](this));ami['on'](_0x6b6c('0xc'),this[_0x6b6c('0xd')][_0x6b6c('0xa')](this));ami['on']('agentringnoanswer',this[_0x6b6c('0xe')][_0x6b6c('0xa')](this));ami['on'](_0x6b6c('0xf'),this[_0x6b6c('0x10')][_0x6b6c('0xa')](this));ami['on']('blindtransfer',this[_0x6b6c('0x11')][_0x6b6c('0xa')](this));ami['on'](_0x6b6c('0x12'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x58fcc2){var _0x190012=moment()[_0x6b6c('0x13')](0x0);var _0x466c0c=moment(_0x58fcc2)['milliseconds'](0x0);return _0x190012[_0x6b6c('0x14')](_0x466c0c,_0x6b6c('0x15'));}Acw[_0x6b6c('0x16')][_0x6b6c('0x17')]=function(_0x3aa8e8){try{var _0x10fa0d=this;var _0x2fad58=this[_0x6b6c('0x18')][_0x3aa8e8]['interface'];var _0x831c3e=this[_0x6b6c('0x18')][_0x3aa8e8][_0x6b6c('0x19')];var _0x5afe12=this['voiceQueues'][_0x831c3e];var _0x3ff2fc=![];var _0x116f67=_0x6b6c('0x1a');if(_0x5afe12[_0x6b6c('0x1b')]){if(_0x5afe12['mandatoryDispositionPause']['name']){_0x3ff2fc=!![];_0x116f67=_0x5afe12[_0x6b6c('0x1c')][_0x6b6c('0x1d')];}}ami[_0x6b6c('0x1e')]({'action':_0x6b6c('0x1f'),'interface':_0x2fad58,'paused':!![],'reason':_0x116f67})['then'](function(_0x3d89c4){if(_0x10fa0d[_0x6b6c('0x7')][_0x2fad58]){return RpcUser[_0x6b6c('0x20')](_0x10fa0d[_0x6b6c('0x7')][_0x2fad58]['id'])['then'](function(_0x54a347){if(_0x54a347&&!_0x54a347[_0x6b6c('0x21')]){logger[_0x6b6c('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3aa8e8,_0x2fad58,_0x831c3e);var _0x573a26=_0x10fa0d[_0x6b6c('0x18')][_0x3aa8e8]['attended']&&_0x10fa0d[_0x6b6c('0x18')][_0x3aa8e8][_0x6b6c('0x23')]?_0x10fa0d[_0x6b6c('0x18')][_0x3aa8e8][_0x6b6c('0x23')]:_0x3aa8e8;return RpcUser[_0x6b6c('0x24')](_0x10fa0d[_0x6b6c('0x7')][_0x2fad58],_0x116f67,_0x573a26)[_0x6b6c('0x25')](function(_0x281a60){if(!_0x3ff2fc){_0x10fa0d[_0x6b6c('0x8')][_0x2fad58]={};logger[_0x6b6c('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3aa8e8,_0x10fa0d[_0x6b6c('0x6')][_0x831c3e][_0x6b6c('0x26')],_0x2fad58,_0x831c3e);_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x27')]=setTimeout(_0x10fa0d['stopAcw']['bind'](_0x10fa0d,_0x2fad58),_0x10fa0d['voiceQueues'][_0x831c3e]['acwTimeout']*0x3e8);_0x10fa0d['timers'][_0x2fad58][_0x6b6c('0x28')]=moment()[_0x6b6c('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x2a')]=_0x3aa8e8;_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x19')]=_0x831c3e;_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x2b')]=function(){var _0x18aee5=getDiff(_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x28')]);clearTimeout(_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x27')]);_0x10fa0d['timers'][_0x2fad58]['timer']=![];RpcVoiceAgentReport[_0x6b6c('0x2c')]({'acwtime':_0x18aee5},_0x10fa0d[_0x6b6c('0x8')][_0x2fad58][_0x6b6c('0x2a')],_0x2fad58)[_0x6b6c('0x25')](function(_0x5e5dff){logger[_0x6b6c('0x22')](_0x6b6c('0x2d'),_0x3aa8e8,_0x18aee5,_0x5e5dff);})[_0x6b6c('0x2e')](function(_0x233ee8){logger['error'](_0x6b6c('0x2f'),_0x3aa8e8,_0x233ee8);});delete _0x10fa0d[_0x6b6c('0x8')][_0x2fad58];};}});}else{logger[_0x6b6c('0x22')](_0x6b6c('0x30'),_0x3aa8e8,_0x2fad58,_0x831c3e);}});}})[_0x6b6c('0x2e')](function(_0x4122c3){logger[_0x6b6c('0x31')](_0x6b6c('0x32'),_0x3aa8e8,_0x10fa0d[_0x6b6c('0x6')][_0x831c3e][_0x6b6c('0x26')],_0x2fad58,_0x831c3e);})[_0x6b6c('0x33')](function(){delete _0x10fa0d[_0x6b6c('0x18')][_0x3aa8e8];});}catch(_0x4084c7){logger['error'](_0x6b6c('0x34'),_0x4084c7[_0x6b6c('0x35')]);}};Acw[_0x6b6c('0x16')]['stopAcw']=function(_0x68f886){try{var _0x1b28e0=this;if(_0x1b28e0[_0x6b6c('0x8')][_0x68f886]){_0x1b28e0[_0x6b6c('0x8')][_0x68f886][_0x6b6c('0x27')]=![];var _0x5aec3d=_0x1b28e0['timers'][_0x68f886][_0x6b6c('0x2a')];var _0x158faa=_0x1b28e0[_0x6b6c('0x8')][_0x68f886][_0x6b6c('0x19')];var _0x2b4203=_0x1b28e0[_0x6b6c('0x6')][_0x158faa][_0x6b6c('0x26')];logger[_0x6b6c('0x22')](_0x6b6c('0x36'),_0x5aec3d,_0x68f886);RpcUser[_0x6b6c('0x37')](this[_0x6b6c('0x7')][_0x68f886]);RpcVoiceAgentReport[_0x6b6c('0x2c')]({'acwtime':_0x2b4203,'agentacw':!![]},_0x5aec3d,_0x68f886)[_0x6b6c('0x25')](function(_0x32aae9){logger[_0x6b6c('0x22')](_0x6b6c('0x2d'),_0x5aec3d,_0x2b4203,_0x32aae9);})['catch'](function(_0x27f7ee){logger['error'](_0x6b6c('0x2f'),_0x5aec3d,_0x27f7ee);});}else{logger[_0x6b6c('0x31')](_0x6b6c('0x38'),_0x68f886);if(_0x1b28e0['timers']){logger[_0x6b6c('0x22')](_0x6b6c('0x39'),JSON[_0x6b6c('0x3a')](_0x1b28e0[_0x6b6c('0x8')]));}}}catch(_0xcae8aa){logger[_0x6b6c('0x31')](_0x6b6c('0x3b'),_0xcae8aa[_0x6b6c('0x35')]);}};Acw[_0x6b6c('0x16')][_0x6b6c('0x9')]=function(_0x3ccc14){try{if(this['voiceQueues'][_0x3ccc14[_0x6b6c('0x19')]]&&(this['voiceQueues'][_0x3ccc14['queue']]['acw']||this[_0x6b6c('0x6')][_0x3ccc14[_0x6b6c('0x19')]][_0x6b6c('0x1b')])){if(this['agents'][_0x3ccc14[_0x6b6c('0x3c')]]){this[_0x6b6c('0x18')][_0x3ccc14['uniqueid']]={'queue':_0x3ccc14[_0x6b6c('0x19')],'interface':_0x3ccc14['interface'],'destlinkedid':_0x3ccc14['destlinkedid']};}}}catch(_0x2dc260){logger[_0x6b6c('0x31')](_0x6b6c('0x3d'),_0x2dc260[_0x6b6c('0x35')]);}};Acw[_0x6b6c('0x16')]['syncAgentConnectPreview']=function(_0x53d2dd){try{if(this[_0x6b6c('0x6')][_0x53d2dd['queue']]&&(this['voiceQueues'][_0x53d2dd['queue']][_0x6b6c('0x4')]||this[_0x6b6c('0x6')][_0x53d2dd[_0x6b6c('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x53d2dd[_0x6b6c('0x3c')]]){this['channels'][_0x53d2dd[_0x6b6c('0x2a')]]={'queue':_0x53d2dd[_0x6b6c('0x19')],'interface':_0x53d2dd[_0x6b6c('0x3c')]};}}}catch(_0x2d1c0e){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x2d1c0e['message']);}};Acw[_0x6b6c('0x16')][_0x6b6c('0x3e')]=function(_0x48adf9){try{if(this[_0x6b6c('0x18')][_0x48adf9[_0x6b6c('0x2a')]]&&_[_0x6b6c('0x3f')](this[_0x6b6c('0x18')][_0x48adf9[_0x6b6c('0x2a')]][_0x6b6c('0x40')])){logger[_0x6b6c('0x22')]('[%s][HANGUP:UNIQUEID]',_0x48adf9['uniqueid']);this[_0x6b6c('0x17')](_0x48adf9[_0x6b6c('0x2a')]);}else if(this[_0x6b6c('0x18')][_0x48adf9[_0x6b6c('0x41')]]&&_[_0x6b6c('0x3f')](this[_0x6b6c('0x18')][_0x48adf9[_0x6b6c('0x41')]][_0x6b6c('0x40')])){logger[_0x6b6c('0x22')](_0x6b6c('0x42'),_0x48adf9['linkedid']);this['startAcw'](_0x48adf9['linkedid']);}}catch(_0x3db1b3){logger[_0x6b6c('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x3db1b3['message']);}};Acw[_0x6b6c('0x16')]['syncHangup']=function(_0x2cc530){try{if(this['channels'][_0x2cc530[_0x6b6c('0x2a')]]&&this['channels'][_0x2cc530[_0x6b6c('0x2a')]][_0x6b6c('0x40')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2cc530[_0x6b6c('0x2a')]);this[_0x6b6c('0x17')](_0x2cc530[_0x6b6c('0x2a')]);}else if(this['channels'][_0x2cc530[_0x6b6c('0x41')]]&&this[_0x6b6c('0x18')][_0x2cc530[_0x6b6c('0x41')]][_0x6b6c('0x40')]){logger[_0x6b6c('0x22')](_0x6b6c('0x43'),_0x2cc530['linkedid']);this[_0x6b6c('0x17')](_0x2cc530[_0x6b6c('0x41')]);}}catch(_0x1f34e4){logger[_0x6b6c('0x31')](_0x6b6c('0x44'),_0x1f34e4['message']);}};Acw[_0x6b6c('0x16')]['syncAttendedTransfer']=function(_0x4f6563){try{if(!_['isNil'](this['channels'][_0x4f6563[_0x6b6c('0x45')]])){this[_0x6b6c('0x17')](_0x4f6563[_0x6b6c('0x45')]);if(this[_0x6b6c('0x18')][_0x4f6563[_0x6b6c('0x46')]]){this[_0x6b6c('0x18')][_0x4f6563[_0x6b6c('0x46')]]['attended']=!![];this[_0x6b6c('0x18')][_0x4f6563[_0x6b6c('0x47')]]=this[_0x6b6c('0x18')][_0x4f6563['secondtransfereruniqueid']];delete this[_0x6b6c('0x18')][_0x4f6563[_0x6b6c('0x46')]];}}else if(!_[_0x6b6c('0x48')](this[_0x6b6c('0x18')][_0x4f6563['transfertargetuniqueid']])){this[_0x6b6c('0x17')](_0x4f6563['transfertargetuniqueid']);if(this['channels'][_0x4f6563[_0x6b6c('0x49')]]){this['channels'][_0x4f6563['origtransfereruniqueid']]['attended']=!![];this[_0x6b6c('0x18')][_0x4f6563['transfereeuniqueid']]=this['channels'][_0x4f6563[_0x6b6c('0x49')]];delete this[_0x6b6c('0x18')][_0x4f6563[_0x6b6c('0x49')]];}}}catch(_0x1c6509){logger[_0x6b6c('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0x1c6509[_0x6b6c('0x35')]);}};Acw[_0x6b6c('0x16')]['syncBlindTransfer']=function(_0x34f20e){try{if(this[_0x6b6c('0x18')][_0x34f20e[_0x6b6c('0x4a')]]){logger[_0x6b6c('0x22')](_0x6b6c('0x4b'),JSON[_0x6b6c('0x3a')](_0x34f20e[_0x6b6c('0x4a')]));this['startAcw'](_0x34f20e['transfereruniqueid']);}else if(this['channels'][_0x34f20e[_0x6b6c('0x4c')]]){logger[_0x6b6c('0x22')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x6b6c('0x3a')](_0x34f20e['transfererlinkedid']));this[_0x6b6c('0x17')](_0x34f20e[_0x6b6c('0x4c')]);}}catch(_0x3c9c82){logger[_0x6b6c('0x31')](_0x6b6c('0x4d'),_0x3c9c82[_0x6b6c('0x35')]);}};Acw['prototype'][_0x6b6c('0xe')]=function(_0x477553){try{if(this[_0x6b6c('0x6')][_0x477553['queue']]&&this[_0x6b6c('0x6')][_0x477553['queue']][_0x6b6c('0x4e')]===_0x6b6c('0x4f')){if(this['agents'][_0x477553[_0x6b6c('0x3c')]]){logger[_0x6b6c('0x22')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x477553['uniqueid'],_0x477553[_0x6b6c('0x3c')],_0x477553[_0x6b6c('0x19')]);return RpcUser['savePause'](this[_0x6b6c('0x7')][_0x477553[_0x6b6c('0x3c')]],_0x6b6c('0x50'),_0x477553[_0x6b6c('0x2a')]);}}}catch(_0x4ed5e4){logger[_0x6b6c('0x31')](_0x6b6c('0x51'),_0x4ed5e4[_0x6b6c('0x35')]);}};module[_0x6b6c('0x52')]=Acw; \ No newline at end of file +var _0x635a=['[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','channels','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','acwTimeout','[ACW][START]\x20%s','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x635a,0x107));var _0xa635=function(_0x4e9ac1,_0x52a8c1){_0x4e9ac1=_0x4e9ac1-0x0;var _0x3c8388=_0x635a[_0x4e9ac1];return _0x3c8388;};'use strict';var util=require('util');var _=require(_0xa635('0x0'));var moment=require(_0xa635('0x1'));var ami=require('../ami');var logger=require(_0xa635('0x2'))(_0xa635('0x3'));var RpcUser=require(_0xa635('0x4'));var RpcVoiceAgentReport=require(_0xa635('0x5'));function Acw(_0x3210a5){this[_0xa635('0x6')]=_0x3210a5[_0xa635('0x6')];this['agents']=_0x3210a5[_0xa635('0x7')];this[_0xa635('0x8')]=_0x3210a5[_0xa635('0x8')];this['channels']={};ami['on'](_0xa635('0x9'),this[_0xa635('0xa')][_0xa635('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xa635('0xb')](this));ami['on'](_0xa635('0xc'),this['syncHangup']['bind'](this));ami['on'](_0xa635('0xd'),this[_0xa635('0xe')][_0xa635('0xb')](this));ami['on'](_0xa635('0xf'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xa635('0x10'),this[_0xa635('0x11')][_0xa635('0xb')](this));ami['on'](_0xa635('0x12'),this['syncAgentConnectPreview'][_0xa635('0xb')](this));}function getDiff(_0x302830){var _0x29925a=moment()[_0xa635('0x13')](0x0);var _0x416af4=moment(_0x302830)[_0xa635('0x13')](0x0);return _0x29925a[_0xa635('0x14')](_0x416af4,_0xa635('0x15'));}Acw[_0xa635('0x16')]['startAcw']=function(_0x3ce531){try{var _0x30dc19=this;var _0x56bc4b=this['channels'][_0x3ce531][_0xa635('0x17')];var _0x3201a6=this['channels'][_0x3ce531][_0xa635('0x18')];var _0x5a704f=this[_0xa635('0x6')][_0x3201a6];var _0x4e8e84=![];var _0xa26811=_0xa635('0x19');if(_0x5a704f[_0xa635('0x1a')]){if(_0x5a704f[_0xa635('0x1b')][_0xa635('0x1c')]){_0x4e8e84=!![];_0xa26811=_0x5a704f[_0xa635('0x1b')][_0xa635('0x1c')];}}ami['Action']({'action':_0xa635('0x1d'),'interface':_0x56bc4b,'paused':!![],'reason':_0xa26811})[_0xa635('0x1e')](function(_0x55ec2a){if(_0x30dc19[_0xa635('0x7')][_0x56bc4b]){return RpcUser[_0xa635('0x1f')](_0x30dc19['agents'][_0x56bc4b]['id'])[_0xa635('0x1e')](function(_0x1ebb3){if(_0x1ebb3&&!_0x1ebb3[_0xa635('0x20')]){logger[_0xa635('0x21')](_0xa635('0x22'),_0x3ce531,_0x56bc4b,_0x3201a6);var _0x4aa566=_0x30dc19['channels'][_0x3ce531][_0xa635('0x23')]&&_0x30dc19[_0xa635('0x24')][_0x3ce531]['destlinkedid']?_0x30dc19['channels'][_0x3ce531][_0xa635('0x25')]:_0x3ce531;return RpcUser[_0xa635('0x26')](_0x30dc19[_0xa635('0x7')][_0x56bc4b],_0xa26811,_0x4aa566)[_0xa635('0x1e')](function(_0x22d876){if(!_0x4e8e84){_0x30dc19[_0xa635('0x8')][_0x56bc4b]={};logger[_0xa635('0x21')](_0xa635('0x27'),_0x3ce531,_0x30dc19['voiceQueues'][_0x3201a6]['acwTimeout'],_0x56bc4b,_0x3201a6);_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x28')]=setTimeout(_0x30dc19[_0xa635('0x29')][_0xa635('0xb')](_0x30dc19,_0x56bc4b),_0x30dc19[_0xa635('0x6')][_0x3201a6]['acwTimeout']*0x3e8);_0x30dc19['timers'][_0x56bc4b][_0xa635('0x2a')]=moment()[_0xa635('0x2b')](_0xa635('0x2c'));_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x2d')]=_0x3ce531;_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x18')]=_0x3201a6;_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x2e')]=function(){var _0x5994a9=getDiff(_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x2a')]);clearTimeout(_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x28')]);_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x28')]=![];RpcVoiceAgentReport[_0xa635('0x2f')]({'acwtime':_0x5994a9},_0x30dc19[_0xa635('0x8')][_0x56bc4b][_0xa635('0x2d')],_0x56bc4b)[_0xa635('0x1e')](function(_0x584d7f){logger[_0xa635('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x3ce531,_0x5994a9,_0x584d7f);})[_0xa635('0x30')](function(_0x12ea90){logger['error'](_0xa635('0x31'),_0x3ce531,_0x12ea90);});delete _0x30dc19[_0xa635('0x8')][_0x56bc4b];};}});}else{logger[_0xa635('0x21')](_0xa635('0x32'),_0x3ce531,_0x56bc4b,_0x3201a6);}});}})[_0xa635('0x30')](function(_0x2807bc){logger[_0xa635('0x33')](_0xa635('0x27'),_0x3ce531,_0x30dc19[_0xa635('0x6')][_0x3201a6][_0xa635('0x34')],_0x56bc4b,_0x3201a6);})['finally'](function(){delete _0x30dc19[_0xa635('0x24')][_0x3ce531];});}catch(_0x2d25a2){logger[_0xa635('0x33')](_0xa635('0x35'),_0x2d25a2['message']);}};Acw[_0xa635('0x16')]['stopAcw']=function(_0x34a652){try{var _0x2f93f7=this;if(_0x2f93f7[_0xa635('0x8')][_0x34a652]){_0x2f93f7['timers'][_0x34a652][_0xa635('0x28')]=![];var _0x4aeaa8=_0x2f93f7[_0xa635('0x8')][_0x34a652][_0xa635('0x2d')];var _0x235403=_0x2f93f7['timers'][_0x34a652][_0xa635('0x18')];var _0x4fdb9c=_0x2f93f7[_0xa635('0x6')][_0x235403][_0xa635('0x34')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x4aeaa8,_0x34a652);RpcUser[_0xa635('0x36')](this[_0xa635('0x7')][_0x34a652]);RpcVoiceAgentReport[_0xa635('0x2f')]({'acwtime':_0x4fdb9c,'agentacw':!![]},_0x4aeaa8,_0x34a652)[_0xa635('0x1e')](function(_0x1d9d72){logger[_0xa635('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x4aeaa8,_0x4fdb9c,_0x1d9d72);})[_0xa635('0x30')](function(_0x306678){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x4aeaa8,_0x306678);});}else{logger[_0xa635('0x33')](_0xa635('0x37'),_0x34a652);if(_0x2f93f7['timers']){logger[_0xa635('0x21')](_0xa635('0x38'),JSON[_0xa635('0x39')](_0x2f93f7[_0xa635('0x8')]));}}}catch(_0xf3642c){logger['error'](_0xa635('0x3a'),_0xf3642c[_0xa635('0x3b')]);}};Acw['prototype'][_0xa635('0xa')]=function(_0x5bf594){try{if(this[_0xa635('0x6')][_0x5bf594[_0xa635('0x18')]]&&(this[_0xa635('0x6')][_0x5bf594[_0xa635('0x18')]]['acw']||this['voiceQueues'][_0x5bf594[_0xa635('0x18')]][_0xa635('0x1a')])){if(this[_0xa635('0x7')][_0x5bf594['interface']]){this['channels'][_0x5bf594[_0xa635('0x2d')]]={'queue':_0x5bf594[_0xa635('0x18')],'interface':_0x5bf594[_0xa635('0x17')],'destlinkedid':_0x5bf594[_0xa635('0x25')]};}}}catch(_0x1a56ec){logger[_0xa635('0x33')](_0xa635('0x3c'),_0x1a56ec[_0xa635('0x3b')]);}};Acw['prototype'][_0xa635('0x3d')]=function(_0x2b624d){try{if(this[_0xa635('0x6')][_0x2b624d[_0xa635('0x18')]]&&(this[_0xa635('0x6')][_0x2b624d['queue']][_0xa635('0x3')]||this['voiceQueues'][_0x2b624d[_0xa635('0x18')]][_0xa635('0x1a')])){if(this[_0xa635('0x7')][_0x2b624d['interface']]){this['channels'][_0x2b624d[_0xa635('0x2d')]]={'queue':_0x2b624d[_0xa635('0x18')],'interface':_0x2b624d[_0xa635('0x17')]};}}}catch(_0x3ff0bf){logger['error'](_0xa635('0x3e'),_0x3ff0bf['message']);}};Acw[_0xa635('0x16')][_0xa635('0x3f')]=function(_0x398bf4){try{if(this[_0xa635('0x24')][_0x398bf4[_0xa635('0x2d')]]&&_[_0xa635('0x40')](this['channels'][_0x398bf4[_0xa635('0x2d')]][_0xa635('0x23')])){logger[_0xa635('0x21')]('[%s][HANGUP:UNIQUEID]',_0x398bf4['uniqueid']);this['startAcw'](_0x398bf4['uniqueid']);}else if(this[_0xa635('0x24')][_0x398bf4[_0xa635('0x41')]]&&_['isUndefined'](this['channels'][_0x398bf4[_0xa635('0x41')]][_0xa635('0x23')])){logger['info'](_0xa635('0x42'),_0x398bf4[_0xa635('0x41')]);this[_0xa635('0x43')](_0x398bf4[_0xa635('0x41')]);}}catch(_0xaa085d){logger[_0xa635('0x33')](_0xa635('0x44'),_0xaa085d[_0xa635('0x3b')]);}};Acw['prototype'][_0xa635('0x45')]=function(_0x5582dc){try{if(this['channels'][_0x5582dc[_0xa635('0x2d')]]&&this['channels'][_0x5582dc['uniqueid']][_0xa635('0x23')]){logger[_0xa635('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5582dc['uniqueid']);this['startAcw'](_0x5582dc[_0xa635('0x2d')]);}else if(this['channels'][_0x5582dc[_0xa635('0x41')]]&&this[_0xa635('0x24')][_0x5582dc[_0xa635('0x41')]]['attended']){logger[_0xa635('0x21')](_0xa635('0x46'),_0x5582dc[_0xa635('0x41')]);this[_0xa635('0x43')](_0x5582dc[_0xa635('0x41')]);}}catch(_0x2e0fbb){logger['error'](_0xa635('0x47'),_0x2e0fbb[_0xa635('0x3b')]);}};Acw[_0xa635('0x16')][_0xa635('0x48')]=function(_0x14210d){try{if(!_['isNil'](this['channels'][_0x14210d[_0xa635('0x49')]])){this['startAcw'](_0x14210d[_0xa635('0x49')]);if(this[_0xa635('0x24')][_0x14210d[_0xa635('0x4a')]]){this[_0xa635('0x24')][_0x14210d[_0xa635('0x4a')]][_0xa635('0x23')]=!![];this['channels'][_0x14210d[_0xa635('0x4b')]]=this[_0xa635('0x24')][_0x14210d[_0xa635('0x4a')]];delete this[_0xa635('0x24')][_0x14210d[_0xa635('0x4a')]];}}else if(!_['isNil'](this['channels'][_0x14210d[_0xa635('0x4b')]])){this[_0xa635('0x43')](_0x14210d['transfertargetuniqueid']);if(this[_0xa635('0x24')][_0x14210d[_0xa635('0x4c')]]){this[_0xa635('0x24')][_0x14210d[_0xa635('0x4c')]][_0xa635('0x23')]=!![];this[_0xa635('0x24')][_0x14210d[_0xa635('0x49')]]=this[_0xa635('0x24')][_0x14210d['origtransfereruniqueid']];delete this['channels'][_0x14210d[_0xa635('0x4c')]];}}}catch(_0x1c846b){logger[_0xa635('0x33')](_0xa635('0x4d'),_0x1c846b[_0xa635('0x3b')]);}};Acw[_0xa635('0x16')][_0xa635('0x11')]=function(_0x203eb2){try{if(this[_0xa635('0x24')][_0x203eb2[_0xa635('0x4e')]]){logger['info'](_0xa635('0x4f'),JSON['stringify'](_0x203eb2['transfereruniqueid']));this[_0xa635('0x43')](_0x203eb2['transfereruniqueid']);}else if(this['channels'][_0x203eb2['transfererlinkedid']]){logger[_0xa635('0x21')](_0xa635('0x50'),JSON[_0xa635('0x39')](_0x203eb2[_0xa635('0x51')]));this[_0xa635('0x43')](_0x203eb2[_0xa635('0x51')]);}}catch(_0x44301a){logger[_0xa635('0x33')](_0xa635('0x52'),_0x44301a[_0xa635('0x3b')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x242f91){try{if(this[_0xa635('0x6')][_0x242f91[_0xa635('0x18')]]&&this['voiceQueues'][_0x242f91[_0xa635('0x18')]][_0xa635('0x53')]===_0xa635('0x54')){if(this[_0xa635('0x7')][_0x242f91[_0xa635('0x17')]]){logger[_0xa635('0x21')](_0xa635('0x55'),_0x242f91[_0xa635('0x2d')],_0x242f91[_0xa635('0x17')],_0x242f91[_0xa635('0x18')]);return RpcUser[_0xa635('0x26')](this[_0xa635('0x7')][_0x242f91['interface']],'Auto-Pause',_0x242f91[_0xa635('0x2d')]);}}}catch(_0x4c1d4b){logger[_0xa635('0x33')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4c1d4b['message']);}};module[_0xa635('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index cd49eb3..d3e523b 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0x531388,_0x5f1821){_0x531388=_0x531388-0x0;var _0x580299=_0x2032[_0x531388];return _0x580299;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x5f3281,_0x309f51){var _0xfdcdd5=function(_0x2e3751){while(--_0x2e3751){_0x5f3281['push'](_0x5f3281['shift']());}};_0xfdcdd5(++_0x309f51);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 77065d0..9e2252e 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 _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x420340,_0x23e80d){var _0x1f61a7=function(_0x272f99){while(--_0x272f99){_0x420340['push'](_0x420340['shift']());}};_0x1f61a7(++_0x23e80d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x7f3be9,_0x193e5b){_0x7f3be9=_0x7f3be9-0x0;var _0x4e7f16=_0x9ffd[_0x7f3be9];return _0x4e7f16;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x70e0,0x17b));var _0x070e=function(_0x3339ab,_0x1341b5){_0x3339ab=_0x3339ab-0x0;var _0x256aa5=_0x70e0[_0x3339ab];return _0x256aa5;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index ad27163..cb962ec 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 _0x1d81=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','number','prototype','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','lastName','phone','queue','name','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x2a5900,_0x351e77){var _0x115100=function(_0x4ce07a){while(--_0x4ce07a){_0x2a5900['push'](_0x2a5900['shift']());}};_0x115100(++_0x351e77);}(_0x1d81,0x1b7));var _0x11d8=function(_0x503679,_0x1d99bf){_0x503679=_0x503679-0x0;var _0x2c6c2b=_0x1d81[_0x503679];return _0x2c6c2b;};'use strict';var util=require(_0x11d8('0x0'));var _=require(_0x11d8('0x1'));var moment=require(_0x11d8('0x2'));function checkNameSurname(_0x4e7b47,_0x1b6bd8,_0x5691f6){var _0x3be662='';if(!_[_0x11d8('0x3')](_0x1b6bd8)&&_0x11d8('0x4')===typeof _0x1b6bd8){_0x3be662+=_0x1b6bd8;}if(!_['isNil'](_0x5691f6)&&_0x11d8('0x4')===typeof _0x5691f6){_0x3be662+='\x20'+_0x5691f6;}if(_0x3be662!==''){return _0x3be662;}return _0x4e7b47;}function Action(_0x409605,_0x208eac,_0x185fd2){this[_0x11d8('0x5')]=_0x409605;this[_0x11d8('0x6')]=_0x185fd2||undefined;this['name']=checkNameSurname(_0x208eac[_0x11d8('0x7')]['phone'],_0x208eac[_0x11d8('0x7')]['firstName'],_0x208eac[_0x11d8('0x7')][_0x11d8('0x8')]);this['number']=_0x208eac['Contact'][_0x11d8('0x9')];this[_0x11d8('0xa')]=_0x409605[_0x11d8('0xb')];this['active']=_0x208eac[_0x11d8('0xc')]||![];this[_0x11d8('0xd')]=_0x409605[_0x11d8('0xd')];this['dialQueueTimeout']=_0x409605['dialQueueTimeout']||0x3;this[_0x11d8('0xe')]=_0x208eac['scheduledat'];this['countbusyretry']=_0x208eac[_0x11d8('0xf')];this[_0x11d8('0x10')]=_0x208eac[_0x11d8('0x10')];this[_0x11d8('0x11')]=_0x208eac['countnoanswerretry'];this[_0x11d8('0x12')]=_0x208eac[_0x11d8('0x12')];this[_0x11d8('0x13')]=_0x208eac[_0x11d8('0x13')];this[_0x11d8('0x14')]=_0x208eac[_0x11d8('0x14')];this[_0x11d8('0x15')]=_0x208eac[_0x11d8('0x15')];this['countagentrejectretry']=_0x208eac[_0x11d8('0x16')];this[_0x11d8('0x17')]=_0x208eac[_0x11d8('0x17')];this[_0x11d8('0x18')]=_0x208eac[_0x11d8('0x18')];this[_0x11d8('0x19')]=_0x208eac[_0x11d8('0x19')];this['VoiceQueueId']=_0x208eac[_0x11d8('0x1a')];this[_0x11d8('0x1b')]=_0x208eac['CampaignId'];this['idHopper']=_0x208eac['id'];this['ContactFirstName']=_0x208eac['Contact'][_0x11d8('0x1c')]||'';this['starttime']=moment()[_0x11d8('0x1d')](_0x11d8('0x1e'));this['callback']=_0x208eac[_0x11d8('0x1f')];this['callbackuniqueid']=_0x208eac[_0x11d8('0x20')];this[_0x11d8('0x21')]=_0x208eac['callbackat'];this[_0x11d8('0x22')]=_0x208eac[_0x11d8('0x22')];this[_0x11d8('0x23')]='';this['originatecalleridname']='';}Action['prototype'][_0x11d8('0x24')]=function(){return util[_0x11d8('0x1d')](_0x11d8('0x25'),this[_0x11d8('0xb')],this[_0x11d8('0x5')][_0x11d8('0x26')]>0x0?this['number'][_0x11d8('0x27')](this[_0x11d8('0x5')][_0x11d8('0x26')]):this[_0x11d8('0x28')]);};Action[_0x11d8('0x29')]['getQueue']=function(){return this[_0x11d8('0xa')];};module['exports']=Action; \ No newline at end of file +var _0x284a=['countmachineretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','util','moment','isNil','string','uniqueid','name','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x3132f0,_0x3075aa){var _0x2ef2d8=function(_0x1c79a8){while(--_0x1c79a8){_0x3132f0['push'](_0x3132f0['shift']());}};_0x2ef2d8(++_0x3075aa);}(_0x284a,0x97));var _0xa284=function(_0xbdbdac,_0xd03c5d){_0xbdbdac=_0xbdbdac-0x0;var _0x1edc15=_0x284a[_0xbdbdac];return _0x1edc15;};'use strict';var util=require(_0xa284('0x0'));var _=require('lodash');var moment=require(_0xa284('0x1'));function checkNameSurname(_0x9d5737,_0x1b2b9d,_0x3fdc1b){var _0x1b8f36='';if(!_[_0xa284('0x2')](_0x1b2b9d)&&'string'===typeof _0x1b2b9d){_0x1b8f36+=_0x1b2b9d;}if(!_['isNil'](_0x3fdc1b)&&_0xa284('0x3')===typeof _0x3fdc1b){_0x1b8f36+='\x20'+_0x3fdc1b;}if(_0x1b8f36!==''){return _0x1b8f36;}return _0x9d5737;}function Action(_0x12be39,_0x3a8f2e,_0x2323c8){this['voiceQueue']=_0x12be39;this[_0xa284('0x4')]=_0x2323c8||undefined;this[_0xa284('0x5')]=checkNameSurname(_0x3a8f2e['Contact'][_0xa284('0x6')],_0x3a8f2e[_0xa284('0x7')]['firstName'],_0x3a8f2e['Contact'][_0xa284('0x8')]);this[_0xa284('0x9')]=_0x3a8f2e[_0xa284('0x7')]['phone'];this[_0xa284('0xa')]=_0x12be39[_0xa284('0x5')];this[_0xa284('0xb')]=_0x3a8f2e[_0xa284('0xb')]||![];this[_0xa284('0xc')]=_0x12be39[_0xa284('0xc')];this['dialQueueTimeout']=_0x12be39[_0xa284('0xd')]||0x3;this[_0xa284('0xe')]=_0x3a8f2e['scheduledat'];this['countbusyretry']=_0x3a8f2e[_0xa284('0xf')];this[_0xa284('0x10')]=_0x3a8f2e['countcongestionretry'];this[_0xa284('0x11')]=_0x3a8f2e['countnoanswerretry'];this['countnosuchnumberretry']=_0x3a8f2e[_0xa284('0x12')];this[_0xa284('0x13')]=_0x3a8f2e[_0xa284('0x13')];this['countabandonedretry']=_0x3a8f2e[_0xa284('0x14')];this[_0xa284('0x15')]=_0x3a8f2e[_0xa284('0x15')];this['countagentrejectretry']=_0x3a8f2e['countagentrejectretry'];this[_0xa284('0x16')]=_0x3a8f2e[_0xa284('0x16')];this[_0xa284('0x17')]=_0x3a8f2e['ListId'];this[_0xa284('0x18')]=_0x3a8f2e[_0xa284('0x18')];this[_0xa284('0x19')]=_0x3a8f2e['VoiceQueueId'];this['CampaignId']=_0x3a8f2e['CampaignId'];this[_0xa284('0x1a')]=_0x3a8f2e['id'];this[_0xa284('0x1b')]=_0x3a8f2e[_0xa284('0x7')][_0xa284('0x1c')]||'';this[_0xa284('0x1d')]=moment()['format'](_0xa284('0x1e'));this['callback']=_0x3a8f2e[_0xa284('0x1f')];this[_0xa284('0x20')]=_0x3a8f2e[_0xa284('0x20')];this['callbackat']=_0x3a8f2e[_0xa284('0x21')];this[_0xa284('0x22')]=_0x3a8f2e[_0xa284('0x22')];this['originatecalleridnum']='';this[_0xa284('0x23')]='';}Action[_0xa284('0x24')][_0xa284('0x25')]=function(){return util['format'](_0xa284('0x26'),this[_0xa284('0x5')],this[_0xa284('0x27')][_0xa284('0x28')]>0x0?this[_0xa284('0x9')][_0xa284('0x29')](this[_0xa284('0x27')][_0xa284('0x28')]):this['number']);};Action['prototype'][_0xa284('0x2a')]=function(){return this[_0xa284('0xa')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 73cb79a..f281d3e 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 _0xdc7b=['callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','responsetime','answertime','endtime','holdtime','membername','reason'];(function(_0x211030,_0x49f3b3){var _0x5e238b=function(_0x5a59c4){while(--_0x5a59c4){_0x211030['push'](_0x211030['shift']());}};_0x5e238b(++_0x49f3b3);}(_0xdc7b,0x153));var _0xbdc7=function(_0x4e4245,_0x196413){_0x4e4245=_0x4e4245-0x0;var _0x342887=_0xdc7b[_0x4e4245];return _0x342887;};'use strict';var util=require(_0xbdc7('0x0'));var _=require(_0xbdc7('0x1'));var moment=require(_0xbdc7('0x2'));function getSeconds(_0x1e8d10,_0xaf2863){var _0x8d7256=moment(_0x1e8d10)[_0xbdc7('0x3')](0x0);var _0x58e84c=moment(_0xaf2863)[_0xbdc7('0x3')](0x0);return _0x8d7256[_0xbdc7('0x4')](_0x58e84c,_0xbdc7('0x5'));}function AgentComplete(_0x552f71,_0x31ecae){this[_0xbdc7('0x6')]=0x4;this[_0xbdc7('0x7')]=_0xbdc7('0x8');this[_0xbdc7('0x9')]=_0x552f71[_0xbdc7('0x9')];this['type']=_0x552f71[_0xbdc7('0xa')];this[_0xbdc7('0xb')]=_0x552f71[_0xbdc7('0xa')]===_0xbdc7('0xc')?_0xbdc7('0xd'):_0x552f71[_0xbdc7('0xa')];this['countbusyretry']=_0x552f71[_0xbdc7('0xe')];this['countcongestionretry']=_0x552f71['countcongestionretry'];this[_0xbdc7('0xf')]=_0x552f71[_0xbdc7('0xf')];this['countglobal']=_0x552f71[_0xbdc7('0xe')]+_0x552f71['countcongestionretry']+_0x552f71[_0xbdc7('0xf')]+_0x552f71[_0xbdc7('0x10')]+_0x552f71[_0xbdc7('0x11')]+_0x552f71[_0xbdc7('0x12')]+_0x552f71[_0xbdc7('0x13')]+_0x552f71[_0xbdc7('0x14')];this['countnosuchnumberretry']=_0x552f71[_0xbdc7('0x10')];this[_0xbdc7('0x11')]=_0x552f71[_0xbdc7('0x11')];this[_0xbdc7('0x12')]=_0x552f71[_0xbdc7('0x12')];this[_0xbdc7('0x13')]=_0x552f71[_0xbdc7('0x13')];this['countagentrejectretry']=_0x552f71[_0xbdc7('0x14')];this[_0xbdc7('0x15')]=_0x31ecae[_0xbdc7('0x15')];this['calleridname']=_0x552f71[_0xbdc7('0x16')];this['calleridnum']=_0x552f71[_0xbdc7('0x17')];this['starttime']=_0x552f71['starttime'];this[_0xbdc7('0x18')]=_0x552f71[_0xbdc7('0x18')];this[_0xbdc7('0x19')]=_0x552f71[_0xbdc7('0x19')];this[_0xbdc7('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x552f71['responsetime'],_0x552f71['starttime']);this[_0xbdc7('0x1b')]=getSeconds(_0x552f71[_0xbdc7('0x19')],_0x552f71[_0xbdc7('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x552f71[_0xbdc7('0x19')]);this['queue']=_0x31ecae[_0xbdc7('0xd')];this[_0xbdc7('0x1c')]=_0x31ecae[_0xbdc7('0x1c')];this[_0xbdc7('0x1d')]=_0x31ecae[_0xbdc7('0x1d')];this[_0xbdc7('0x1e')]=_0x552f71[_0xbdc7('0x1e')];this['callbackuniqueid']=_0x552f71['callbackuniqueid'];this[_0xbdc7('0x1f')]=_0x552f71[_0xbdc7('0x1f')];this[_0xbdc7('0x20')]=_0x552f71[_0xbdc7('0x20')];this[_0xbdc7('0x21')]=_0x552f71[_0xbdc7('0x21')];this[_0xbdc7('0x22')]=_0x552f71['ListId'];this[_0xbdc7('0x23')]=_0x552f71[_0xbdc7('0x23')];this['VoiceQueueId']=_0x552f71[_0xbdc7('0x24')];this[_0xbdc7('0x25')]=_0x552f71[_0xbdc7('0x25')];this[_0xbdc7('0x26')]=_0x552f71[_0xbdc7('0x26')]||'';this[_0xbdc7('0x27')]=_0x552f71[_0xbdc7('0x27')]||'';}module[_0xbdc7('0x28')]=AgentComplete; \ No newline at end of file +var _0x8cd0=['talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','moment','milliseconds','seconds','statedesc','Answer','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4848c5,_0x2d28c3){var _0x74a692=function(_0x55b22c){while(--_0x55b22c){_0x4848c5['push'](_0x4848c5['shift']());}};_0x74a692(++_0x2d28c3);}(_0x8cd0,0xb7));var _0x08cd=function(_0x4d5bb3,_0x18e9fa){_0x4d5bb3=_0x4d5bb3-0x0;var _0x451acb=_0x8cd0[_0x4d5bb3];return _0x451acb;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x08cd('0x0'));function getSeconds(_0x4a3f39,_0x35a639){var _0x4f1ee8=moment(_0x4a3f39)['milliseconds'](0x0);var _0x1b5fca=moment(_0x35a639)[_0x08cd('0x1')](0x0);return _0x4f1ee8['diff'](_0x1b5fca,_0x08cd('0x2'));}function AgentComplete(_0x54abf3,_0x1149d1){this['state']=0x4;this[_0x08cd('0x3')]=_0x08cd('0x4');this['scheduledat']=_0x54abf3['scheduledat'];this[_0x08cd('0x5')]=_0x54abf3[_0x08cd('0x5')];this[_0x08cd('0x6')]=_0x54abf3[_0x08cd('0x5')]==='outbound'?'queue':_0x54abf3[_0x08cd('0x5')];this[_0x08cd('0x7')]=_0x54abf3[_0x08cd('0x7')];this[_0x08cd('0x8')]=_0x54abf3['countcongestionretry'];this[_0x08cd('0x9')]=_0x54abf3['countnoanswerretry'];this[_0x08cd('0xa')]=_0x54abf3[_0x08cd('0x7')]+_0x54abf3[_0x08cd('0x8')]+_0x54abf3[_0x08cd('0x9')]+_0x54abf3[_0x08cd('0xb')]+_0x54abf3[_0x08cd('0xc')]+_0x54abf3[_0x08cd('0xd')]+_0x54abf3[_0x08cd('0xe')]+_0x54abf3[_0x08cd('0xf')];this['countnosuchnumberretry']=_0x54abf3[_0x08cd('0xb')];this[_0x08cd('0xc')]=_0x54abf3[_0x08cd('0xc')];this['countabandonedretry']=_0x54abf3[_0x08cd('0xd')];this[_0x08cd('0xe')]=_0x54abf3[_0x08cd('0xe')];this['countagentrejectretry']=_0x54abf3[_0x08cd('0xf')];this[_0x08cd('0x10')]=_0x1149d1['uniqueid'];this[_0x08cd('0x11')]=_0x54abf3[_0x08cd('0x12')];this[_0x08cd('0x13')]=_0x54abf3[_0x08cd('0x14')];this['starttime']=_0x54abf3[_0x08cd('0x15')];this['responsetime']=_0x54abf3[_0x08cd('0x16')];this['answertime']=_0x54abf3[_0x08cd('0x17')];this[_0x08cd('0x18')]=moment()[_0x08cd('0x19')](_0x08cd('0x1a'));this['ringtime']=getSeconds(_0x54abf3[_0x08cd('0x16')],_0x54abf3[_0x08cd('0x15')]);this['holdtime']=getSeconds(_0x54abf3[_0x08cd('0x17')],_0x54abf3[_0x08cd('0x16')]);this[_0x08cd('0x1b')]=getSeconds(this[_0x08cd('0x18')],_0x54abf3[_0x08cd('0x17')]);this[_0x08cd('0x1c')]=_0x1149d1[_0x08cd('0x1c')];this[_0x08cd('0x1d')]=_0x1149d1['membername'];this['reason']=_0x1149d1[_0x08cd('0x1e')];this[_0x08cd('0x1f')]=_0x54abf3[_0x08cd('0x1f')];this[_0x08cd('0x20')]=_0x54abf3[_0x08cd('0x20')];this[_0x08cd('0x21')]=_0x54abf3['callbackat'];this[_0x08cd('0x22')]=_0x54abf3[_0x08cd('0x22')];this['ContactId']=_0x54abf3[_0x08cd('0x23')];this[_0x08cd('0x24')]=_0x54abf3[_0x08cd('0x24')];this['UserId']=_0x54abf3[_0x08cd('0x25')];this[_0x08cd('0x26')]=_0x54abf3[_0x08cd('0x26')];this[_0x08cd('0x27')]=_0x54abf3[_0x08cd('0x27')];this['originatecalleridnum']=_0x54abf3['originatecalleridnum']||'';this[_0x08cd('0x28')]=_0x54abf3['originatecalleridname']||'';}module[_0x08cd('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 30ed57a..897801b 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 _0xe198=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds'];(function(_0x87d062,_0x43abf9){var _0x193215=function(_0x4c98bb){while(--_0x4c98bb){_0x87d062['push'](_0x87d062['shift']());}};_0x193215(++_0x43abf9);}(_0xe198,0x6f));var _0x8e19=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xe198[_0x1caf6a];return _0x1bf493;};'use strict';var util=require(_0x8e19('0x0'));var _=require(_0x8e19('0x1'));var moment=require('moment');function getSeconds(_0x488972,_0x18c3af){var _0x2b1b2b=moment(_0x488972)[_0x8e19('0x2')](0x0);var _0x529200=moment(_0x18c3af)[_0x8e19('0x2')](0x0);return _0x2b1b2b['diff'](_0x529200,_0x8e19('0x3'));}function Final(_0x2f94a8){this[_0x8e19('0x4')]=_0x2f94a8[_0x8e19('0x4')];this[_0x8e19('0x5')]=_0x2f94a8[_0x8e19('0x5')];this[_0x8e19('0x6')]=_0x2f94a8[_0x8e19('0x6')];this[_0x8e19('0x7')]=_0x2f94a8[_0x8e19('0x6')]===_0x8e19('0x8')?_0x8e19('0x9'):_0x2f94a8[_0x8e19('0x6')];this['countbusyretry']=_0x2f94a8[_0x8e19('0xa')];this[_0x8e19('0xb')]=_0x2f94a8[_0x8e19('0xb')];this[_0x8e19('0xc')]=_0x2f94a8[_0x8e19('0xc')];this[_0x8e19('0xd')]=_0x2f94a8[_0x8e19('0xa')]+_0x2f94a8[_0x8e19('0xb')]+_0x2f94a8['countnoanswerretry']+_0x2f94a8['countnosuchnumberretry']+_0x2f94a8[_0x8e19('0xe')]+_0x2f94a8['countabandonedretry']+_0x2f94a8['countmachineretry']+_0x2f94a8[_0x8e19('0xf')];this[_0x8e19('0x10')]=_0x2f94a8[_0x8e19('0x10')];this[_0x8e19('0xe')]=_0x2f94a8['countdropretry'];this[_0x8e19('0x11')]=_0x2f94a8[_0x8e19('0x11')];this['countmachineretry']=_0x2f94a8[_0x8e19('0x12')];this[_0x8e19('0xf')]=_0x2f94a8['countagentrejectretry'];this[_0x8e19('0x9')]=_0x2f94a8[_0x8e19('0x9')];this[_0x8e19('0x13')]=_0x2f94a8[_0x8e19('0x13')];this[_0x8e19('0x14')]=_0x2f94a8[_0x8e19('0x14')];this[_0x8e19('0x15')]=_0x2f94a8[_0x8e19('0x15')];this[_0x8e19('0x16')]=_0x2f94a8[_0x8e19('0x16')];this[_0x8e19('0x17')]=_0x2f94a8[_0x8e19('0x16')];this[_0x8e19('0x18')]=_0x2f94a8[_0x8e19('0x18')]||0x0;this['holdtime']=_0x2f94a8[_0x8e19('0x19')]||0x0;this[_0x8e19('0x1a')]=_0x2f94a8[_0x8e19('0x1a')]||0x0;this[_0x8e19('0x1b')]=_0x2f94a8[_0x8e19('0x1b')];this[_0x8e19('0x1c')]=_0x2f94a8[_0x8e19('0x1c')];this[_0x8e19('0x1d')]=_0x2f94a8[_0x8e19('0x1d')];this[_0x8e19('0x1e')]=_0x2f94a8[_0x8e19('0x1e')];this[_0x8e19('0x1f')]=_0x2f94a8[_0x8e19('0x1f')];this['ListId']=_0x2f94a8[_0x8e19('0x20')];this['UserId']=_0x2f94a8['UserId'];this[_0x8e19('0x21')]=_0x2f94a8[_0x8e19('0x21')];this[_0x8e19('0x22')]=_0x2f94a8['CampaignId'];this[_0x8e19('0x23')]=_0x2f94a8[_0x8e19('0x23')]||'';this[_0x8e19('0x24')]=_0x2f94a8[_0x8e19('0x24')]||'';}module[_0x8e19('0x25')]=Final; \ No newline at end of file +var _0x56e6=['diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56e6,0x6b));var _0x656e=function(_0x11a2df,_0x56503a){_0x11a2df=_0x11a2df-0x0;var _0x3e489e=_0x56e6[_0x11a2df];return _0x3e489e;};'use strict';var util=require(_0x656e('0x0'));var _=require(_0x656e('0x1'));var moment=require(_0x656e('0x2'));function getSeconds(_0x75e34c,_0x3a7a6a){var _0x3833eb=moment(_0x75e34c)['milliseconds'](0x0);var _0x40a874=moment(_0x3a7a6a)[_0x656e('0x3')](0x0);return _0x3833eb[_0x656e('0x4')](_0x40a874,_0x656e('0x5'));}function Final(_0x123fd4){this[_0x656e('0x6')]=_0x123fd4[_0x656e('0x6')];this['scheduledat']=_0x123fd4[_0x656e('0x7')];this[_0x656e('0x8')]=_0x123fd4[_0x656e('0x8')];this[_0x656e('0x9')]=_0x123fd4[_0x656e('0x8')]===_0x656e('0xa')?_0x656e('0xb'):_0x123fd4[_0x656e('0x8')];this[_0x656e('0xc')]=_0x123fd4[_0x656e('0xc')];this[_0x656e('0xd')]=_0x123fd4[_0x656e('0xd')];this[_0x656e('0xe')]=_0x123fd4[_0x656e('0xe')];this['countglobal']=_0x123fd4['countbusyretry']+_0x123fd4[_0x656e('0xd')]+_0x123fd4[_0x656e('0xe')]+_0x123fd4[_0x656e('0xf')]+_0x123fd4[_0x656e('0x10')]+_0x123fd4['countabandonedretry']+_0x123fd4['countmachineretry']+_0x123fd4[_0x656e('0x11')];this[_0x656e('0xf')]=_0x123fd4['countnosuchnumberretry'];this[_0x656e('0x10')]=_0x123fd4['countdropretry'];this[_0x656e('0x12')]=_0x123fd4[_0x656e('0x12')];this[_0x656e('0x13')]=_0x123fd4[_0x656e('0x13')];this['countagentrejectretry']=_0x123fd4[_0x656e('0x11')];this[_0x656e('0xb')]=_0x123fd4[_0x656e('0xb')];this[_0x656e('0x14')]=_0x123fd4[_0x656e('0x14')];this['calleridnum']=_0x123fd4['calleridnum'];this['starttime']=_0x123fd4[_0x656e('0x15')];this[_0x656e('0x16')]=_0x123fd4['responsetime'];this[_0x656e('0x17')]=_0x123fd4['responsetime'];this['ringtime']=_0x123fd4['ringtime']||0x0;this[_0x656e('0x18')]=_0x123fd4[_0x656e('0x18')]||0x0;this[_0x656e('0x19')]=_0x123fd4[_0x656e('0x19')]||0x0;this['callback']=_0x123fd4[_0x656e('0x1a')];this[_0x656e('0x1b')]=_0x123fd4[_0x656e('0x1b')];this['callbackat']=_0x123fd4[_0x656e('0x1c')];this[_0x656e('0x1d')]=_0x123fd4[_0x656e('0x1d')];this[_0x656e('0x1e')]=_0x123fd4[_0x656e('0x1e')];this[_0x656e('0x1f')]=_0x123fd4[_0x656e('0x1f')];this['UserId']=_0x123fd4[_0x656e('0x20')];this[_0x656e('0x21')]=_0x123fd4['VoiceQueueId'];this['CampaignId']=_0x123fd4[_0x656e('0x22')];this['originatecalleridnum']=_0x123fd4[_0x656e('0x23')]||'';this['originatecalleridname']=_0x123fd4['originatecalleridname']||'';}module[_0x656e('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 3b6e9a3..a665272 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 _0xe568=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countdropretry'];(function(_0x4f8968,_0x36a5d2){var _0x29523e=function(_0x14c679){while(--_0x14c679){_0x4f8968['push'](_0x4f8968['shift']());}};_0x29523e(++_0x36a5d2);}(_0xe568,0x137));var _0x8e56=function(_0x5f5495,_0x30d087){_0x5f5495=_0x5f5495-0x0;var _0x14d8a3=_0xe568[_0x5f5495];return _0x14d8a3;};'use strict';var util=require(_0x8e56('0x0'));var _=require(_0x8e56('0x1'));var moment=require(_0x8e56('0x2'));function getSeconds(_0x239f55,_0x1ceee8){var _0x14d999=moment(_0x239f55)[_0x8e56('0x3')](0x0);var _0x2208fd=moment(_0x1ceee8)[_0x8e56('0x3')](0x0);return _0x14d999[_0x8e56('0x4')](_0x2208fd,_0x8e56('0x5'));}function Hangup(_0x5eaf30,_0xce55e9){this['state']=0x4;this[_0x8e56('0x6')]=_0x8e56('0x7');this[_0x8e56('0x8')]=_0x5eaf30['scheduledat'];this[_0x8e56('0x9')]=_0x5eaf30['type'];this[_0x8e56('0xa')]=_0x5eaf30[_0x8e56('0x9')]===_0x8e56('0xb')?_0x8e56('0xc'):_0x5eaf30[_0x8e56('0x9')];this[_0x8e56('0xd')]=_0x5eaf30[_0x8e56('0xd')];this[_0x8e56('0xe')]=_0x5eaf30[_0x8e56('0xe')];this['countnoanswerretry']=_0x5eaf30['countnoanswerretry'];this[_0x8e56('0xf')]=_0x5eaf30[_0x8e56('0xd')]+_0x5eaf30['countcongestionretry']+_0x5eaf30['countnoanswerretry']+_0x5eaf30['countnosuchnumberretry']+_0x5eaf30[_0x8e56('0x10')]+_0x5eaf30[_0x8e56('0x11')]+_0x5eaf30[_0x8e56('0x12')]+_0x5eaf30[_0x8e56('0x13')];this[_0x8e56('0x14')]=_0x5eaf30['countnosuchnumberretry'];this[_0x8e56('0x10')]=_0x5eaf30[_0x8e56('0x10')];this[_0x8e56('0x11')]=_0x5eaf30[_0x8e56('0x11')];this[_0x8e56('0x12')]=_0x5eaf30[_0x8e56('0x12')];this[_0x8e56('0x13')]=_0x5eaf30['countagentrejectretry'];this[_0x8e56('0x15')]=_0xce55e9['uniqueid'];this['calleridname']=_0x5eaf30[_0x8e56('0x16')];this[_0x8e56('0x17')]=_0x5eaf30[_0x8e56('0x18')];this['starttime']=_0x5eaf30[_0x8e56('0x19')];this[_0x8e56('0x1a')]=_0x5eaf30[_0x8e56('0x1a')];this[_0x8e56('0x1b')]=moment()['format'](_0x8e56('0x1c'));this[_0x8e56('0x1d')]=getSeconds(_0x5eaf30[_0x8e56('0x1a')],_0x5eaf30[_0x8e56('0x19')]);this[_0x8e56('0x1e')]=0x0;this[_0x8e56('0x1f')]=getSeconds(this[_0x8e56('0x1b')],_0x5eaf30['responsetime']);this[_0x8e56('0xc')]=_0x5eaf30[_0x8e56('0xc')];this['membername']=_0x8e56('0x20');this['reason']=_0xce55e9['cause-txt'];this['callback']=_0x5eaf30['callback'];this['callbackuniqueid']=_0x5eaf30[_0x8e56('0x21')];this[_0x8e56('0x22')]=_0x5eaf30[_0x8e56('0x22')];this[_0x8e56('0x23')]=_0x5eaf30['recallme'];this['ContactId']=_0x5eaf30[_0x8e56('0x24')];this[_0x8e56('0x25')]=_0x5eaf30[_0x8e56('0x25')];this[_0x8e56('0x26')]=_0x5eaf30['UserId'];this[_0x8e56('0x27')]=_0x5eaf30[_0x8e56('0x27')];this['CampaignId']=_0x5eaf30[_0x8e56('0x28')];}module['exports']=Hangup; \ No newline at end of file +var _0x3974=['CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','holdtime','talktime','membername','IVR','cause-txt','callback','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x3667db,_0x4d2233){var _0x5e0a06=function(_0x1bed7){while(--_0x1bed7){_0x3667db['push'](_0x3667db['shift']());}};_0x5e0a06(++_0x4d2233);}(_0x3974,0xd9));var _0x4397=function(_0x388538,_0x4308d1){_0x388538=_0x388538-0x0;var _0x2b2117=_0x3974[_0x388538];return _0x2b2117;};'use strict';var util=require(_0x4397('0x0'));var _=require(_0x4397('0x1'));var moment=require(_0x4397('0x2'));function getSeconds(_0xa55a80,_0x53721c){var _0x14bf3c=moment(_0xa55a80)[_0x4397('0x3')](0x0);var _0x2b68d0=moment(_0x53721c)[_0x4397('0x3')](0x0);return _0x14bf3c[_0x4397('0x4')](_0x2b68d0,_0x4397('0x5'));}function Hangup(_0x39aa14,_0x4f8e7c){this[_0x4397('0x6')]=0x4;this['statedesc']=_0x4397('0x7');this[_0x4397('0x8')]=_0x39aa14[_0x4397('0x8')];this[_0x4397('0x9')]=_0x39aa14[_0x4397('0x9')];this[_0x4397('0xa')]=_0x39aa14[_0x4397('0x9')]===_0x4397('0xb')?_0x4397('0xc'):_0x39aa14['type'];this['countbusyretry']=_0x39aa14[_0x4397('0xd')];this[_0x4397('0xe')]=_0x39aa14[_0x4397('0xe')];this[_0x4397('0xf')]=_0x39aa14[_0x4397('0xf')];this[_0x4397('0x10')]=_0x39aa14['countbusyretry']+_0x39aa14[_0x4397('0xe')]+_0x39aa14['countnoanswerretry']+_0x39aa14[_0x4397('0x11')]+_0x39aa14[_0x4397('0x12')]+_0x39aa14[_0x4397('0x13')]+_0x39aa14[_0x4397('0x14')]+_0x39aa14[_0x4397('0x15')];this[_0x4397('0x11')]=_0x39aa14[_0x4397('0x11')];this['countdropretry']=_0x39aa14[_0x4397('0x12')];this[_0x4397('0x13')]=_0x39aa14[_0x4397('0x13')];this['countmachineretry']=_0x39aa14[_0x4397('0x14')];this['countagentrejectretry']=_0x39aa14[_0x4397('0x15')];this[_0x4397('0x16')]=_0x4f8e7c[_0x4397('0x16')];this[_0x4397('0x17')]=_0x39aa14['name'];this[_0x4397('0x18')]=_0x39aa14[_0x4397('0x19')];this['starttime']=_0x39aa14[_0x4397('0x1a')];this['responsetime']=_0x39aa14[_0x4397('0x1b')];this[_0x4397('0x1c')]=moment()[_0x4397('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x39aa14['responsetime'],_0x39aa14[_0x4397('0x1a')]);this[_0x4397('0x1e')]=0x0;this[_0x4397('0x1f')]=getSeconds(this['endtime'],_0x39aa14[_0x4397('0x1b')]);this[_0x4397('0xc')]=_0x39aa14[_0x4397('0xc')];this[_0x4397('0x20')]=_0x4397('0x21');this['reason']=_0x4f8e7c[_0x4397('0x22')];this[_0x4397('0x23')]=_0x39aa14['callback'];this['callbackuniqueid']=_0x39aa14['callbackuniqueid'];this['callbackat']=_0x39aa14['callbackat'];this['recallme']=_0x39aa14[_0x4397('0x24')];this[_0x4397('0x25')]=_0x39aa14[_0x4397('0x25')];this[_0x4397('0x26')]=_0x39aa14[_0x4397('0x26')];this[_0x4397('0x27')]=_0x39aa14[_0x4397('0x27')];this[_0x4397('0x28')]=_0x39aa14[_0x4397('0x28')];this[_0x4397('0x29')]=_0x39aa14[_0x4397('0x29')];}module[_0x4397('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 43a216a..cd03075 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 _0xe4a3=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','number','starttime','responsetime','endtime'];(function(_0x344992,_0x12ad07){var _0x4c62a3=function(_0x27ce38){while(--_0x27ce38){_0x344992['push'](_0x344992['shift']());}};_0x4c62a3(++_0x12ad07);}(_0xe4a3,0x164));var _0x3e4a=function(_0x1ce2f3,_0x344e68){_0x1ce2f3=_0x1ce2f3-0x0;var _0x2f61e3=_0xe4a3[_0x1ce2f3];return _0x2f61e3;};'use strict';var util=require(_0x3e4a('0x0'));var _=require(_0x3e4a('0x1'));var moment=require('moment');function getSeconds(_0x59fa42,_0x22a798){var _0x12b48f=moment(_0x59fa42)[_0x3e4a('0x2')](0x0);var _0x3f22e4=moment(_0x22a798)[_0x3e4a('0x2')](0x0);return _0x12b48f['diff'](_0x3f22e4,_0x3e4a('0x3'));}function History(_0x45b6e5){this[_0x3e4a('0x4')]=_0x45b6e5['uniqueid'];this[_0x3e4a('0x5')]=_0x45b6e5[_0x3e4a('0x5')]||undefined;this[_0x3e4a('0x6')]=_0x45b6e5[_0x3e4a('0x6')];this[_0x3e4a('0x7')]=_0x45b6e5[_0x3e4a('0x6')]==='outbound'?_0x3e4a('0x8'):_0x45b6e5['type'];this[_0x3e4a('0x9')]=_0x45b6e5[_0x3e4a('0x9')];this[_0x3e4a('0xa')]=_0x45b6e5[_0x3e4a('0xa')];this[_0x3e4a('0xb')]=_0x45b6e5[_0x3e4a('0xb')];this[_0x3e4a('0xc')]=_0x45b6e5[_0x3e4a('0x9')]+_0x45b6e5[_0x3e4a('0xa')]+_0x45b6e5[_0x3e4a('0xb')]+_0x45b6e5[_0x3e4a('0xd')]+_0x45b6e5[_0x3e4a('0xe')]+_0x45b6e5['countabandonedretry']+_0x45b6e5[_0x3e4a('0xf')]+_0x45b6e5[_0x3e4a('0x10')];this[_0x3e4a('0xd')]=_0x45b6e5[_0x3e4a('0xd')];this[_0x3e4a('0xe')]=_0x45b6e5[_0x3e4a('0xe')];this[_0x3e4a('0x11')]=_0x45b6e5[_0x3e4a('0x11')];this[_0x3e4a('0xf')]=_0x45b6e5[_0x3e4a('0xf')];this[_0x3e4a('0x10')]=_0x45b6e5[_0x3e4a('0x10')];this[_0x3e4a('0x8')]=_0x45b6e5[_0x3e4a('0x8')];this[_0x3e4a('0x12')]=_0x45b6e5[_0x3e4a('0x13')];this['calleridnum']=_0x45b6e5[_0x3e4a('0x14')];this[_0x3e4a('0x15')]=_0x45b6e5[_0x3e4a('0x15')];this[_0x3e4a('0x16')]=_0x45b6e5[_0x3e4a('0x16')];this[_0x3e4a('0x17')]=_0x45b6e5['responsetime'];this['ringtime']=getSeconds(_0x45b6e5[_0x3e4a('0x16')],_0x45b6e5[_0x3e4a('0x15')]);this[_0x3e4a('0x18')]=0x0;this[_0x3e4a('0x19')]=0x0;this[_0x3e4a('0x1a')]=_0x45b6e5['callback'];this[_0x3e4a('0x1b')]=_0x45b6e5[_0x3e4a('0x1b')];this[_0x3e4a('0x1c')]=_0x45b6e5[_0x3e4a('0x1c')];this[_0x3e4a('0x1d')]=_0x45b6e5[_0x3e4a('0x1d')];this[_0x3e4a('0x1e')]=_0x45b6e5[_0x3e4a('0x1e')];this['ListId']=_0x45b6e5[_0x3e4a('0x1f')];this[_0x3e4a('0x20')]=_0x45b6e5[_0x3e4a('0x20')];this['VoiceQueueId']=_0x45b6e5[_0x3e4a('0x21')];this[_0x3e4a('0x22')]=_0x45b6e5['CampaignId'];this[_0x3e4a('0x23')]=_0x45b6e5[_0x3e4a('0x23')]||'';this['originatecalleridname']=_0x45b6e5[_0x3e4a('0x24')]||'';}module[_0x3e4a('0x25')]=History; \ No newline at end of file +var _0xb51e=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','name','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','type','campaigntype','outbound','queue'];(function(_0x4aab29,_0xe600b8){var _0x521231=function(_0x310a4b){while(--_0x310a4b){_0x4aab29['push'](_0x4aab29['shift']());}};_0x521231(++_0xe600b8);}(_0xb51e,0xda));var _0xeb51=function(_0x206917,_0x38ad99){_0x206917=_0x206917-0x0;var _0x2a2416=_0xb51e[_0x206917];return _0x2a2416;};'use strict';var util=require(_0xeb51('0x0'));var _=require(_0xeb51('0x1'));var moment=require(_0xeb51('0x2'));function getSeconds(_0x406b36,_0x1b5adf){var _0x9bf777=moment(_0x406b36)[_0xeb51('0x3')](0x0);var _0x243105=moment(_0x1b5adf)['milliseconds'](0x0);return _0x9bf777[_0xeb51('0x4')](_0x243105,'seconds');}function History(_0x4e92e4){this[_0xeb51('0x5')]=_0x4e92e4[_0xeb51('0x5')];this['scheduledat']=_0x4e92e4['scheduledat']||undefined;this[_0xeb51('0x6')]=_0x4e92e4[_0xeb51('0x6')];this[_0xeb51('0x7')]=_0x4e92e4[_0xeb51('0x6')]===_0xeb51('0x8')?_0xeb51('0x9'):_0x4e92e4[_0xeb51('0x6')];this[_0xeb51('0xa')]=_0x4e92e4[_0xeb51('0xa')];this[_0xeb51('0xb')]=_0x4e92e4[_0xeb51('0xb')];this[_0xeb51('0xc')]=_0x4e92e4[_0xeb51('0xc')];this[_0xeb51('0xd')]=_0x4e92e4[_0xeb51('0xa')]+_0x4e92e4[_0xeb51('0xb')]+_0x4e92e4[_0xeb51('0xc')]+_0x4e92e4['countnosuchnumberretry']+_0x4e92e4['countdropretry']+_0x4e92e4[_0xeb51('0xe')]+_0x4e92e4[_0xeb51('0xf')]+_0x4e92e4[_0xeb51('0x10')];this[_0xeb51('0x11')]=_0x4e92e4[_0xeb51('0x11')];this[_0xeb51('0x12')]=_0x4e92e4[_0xeb51('0x12')];this['countabandonedretry']=_0x4e92e4[_0xeb51('0xe')];this[_0xeb51('0xf')]=_0x4e92e4[_0xeb51('0xf')];this[_0xeb51('0x10')]=_0x4e92e4[_0xeb51('0x10')];this[_0xeb51('0x9')]=_0x4e92e4[_0xeb51('0x9')];this['calleridname']=_0x4e92e4[_0xeb51('0x13')];this[_0xeb51('0x14')]=_0x4e92e4['number'];this[_0xeb51('0x15')]=_0x4e92e4['starttime'];this[_0xeb51('0x16')]=_0x4e92e4[_0xeb51('0x16')];this['endtime']=_0x4e92e4[_0xeb51('0x16')];this[_0xeb51('0x17')]=getSeconds(_0x4e92e4[_0xeb51('0x16')],_0x4e92e4[_0xeb51('0x15')]);this[_0xeb51('0x18')]=0x0;this[_0xeb51('0x19')]=0x0;this[_0xeb51('0x1a')]=_0x4e92e4[_0xeb51('0x1a')];this[_0xeb51('0x1b')]=_0x4e92e4[_0xeb51('0x1b')];this[_0xeb51('0x1c')]=_0x4e92e4['callbackat'];this['recallme']=_0x4e92e4[_0xeb51('0x1d')];this[_0xeb51('0x1e')]=_0x4e92e4[_0xeb51('0x1e')];this['ListId']=_0x4e92e4[_0xeb51('0x1f')];this[_0xeb51('0x20')]=_0x4e92e4[_0xeb51('0x20')];this['VoiceQueueId']=_0x4e92e4[_0xeb51('0x21')];this['CampaignId']=_0x4e92e4[_0xeb51('0x22')];this[_0xeb51('0x23')]=_0x4e92e4['originatecalleridnum']||'';this[_0xeb51('0x24')]=_0x4e92e4[_0xeb51('0x24')]||'';}module[_0xeb51('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index d22a672..4f7451f 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 _0xede8=['sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','status','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','merge','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','reachable','unmonitored','saveInDb','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','value','state','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ListId','dialAMDActive','HANGUP','buildObj','[syncHangupInAMDIvr][createHistory]','countglobal','dialGlobalMaxRetry','add','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','interval','content','true','some','GLOBAL_INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnosuchnumberretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','handleIvr','limitCalls','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','interval\x20=\x20','Amax\x20=\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','lodash','bluebird','uuid','moment','md5','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','name','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','format','voice:queue:%s','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking'];(function(_0x237b6c,_0x43235d){var _0x1f2172=function(_0x44dc74){while(--_0x44dc74){_0x237b6c['push'](_0x237b6c['shift']());}};_0x1f2172(++_0x43235d);}(_0xede8,0x17a));var _0x8ede=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xede8[_0x501510];return _0x1e6ee5;};'use strict';var util=require('util');var _=require(_0x8ede('0x0'));var BPromise=require(_0x8ede('0x1'));var uuid=require(_0x8ede('0x2'));var moment=require(_0x8ede('0x3'));var rr=require('rr');var md5=require(_0x8ede('0x4'));var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0x8ede('0x5'));var logger=require('../../../config/logger')(_0x8ede('0x6'));var loggerBooked=require('../../../config/logger')(_0x8ede('0x7'));var loggerPredictive=require(_0x8ede('0x8'))(_0x8ede('0x9'));var loggerPredictiveCalls=require(_0x8ede('0x8'))(_0x8ede('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x8ede('0xb'));var ami=require(_0x8ede('0xc'));config[_0x8ede('0xd')]=_[_0x8ede('0xe')](config['redis'],{'host':_0x8ede('0xf'),'port':0x18eb});var io=require(_0x8ede('0x10'))(new Redis(config[_0x8ede('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x8ede('0x11'));var cmHopperBlack=require(_0x8ede('0x12'));var voiceQueueRt=require(_0x8ede('0x13'));var Action=require(_0x8ede('0x14'));var History=require(_0x8ede('0x15'));var Final=require(_0x8ede('0x16'));var AgentComplete=require(_0x8ede('0x17'));var QueueCallerAbandon=require(_0x8ede('0x18'));var Hangup=require(_0x8ede('0x19'));var ipAgi=process[_0x8ede('0x1a')][_0x8ede('0x1b')]||_0x8ede('0x1c');var strategy={'rrmemory':_0x8ede('0x1d'),'roundrobin':_0x8ede('0x1e')};var Sequence=function(){};Sequence[_0x8ede('0x1f')][_0x8ede('0x20')]=function(_0x3d25af){this[_0x8ede('0x21')]=this[_0x8ede('0x21')]?this[_0x8ede('0x21')]['finally'](_0x3d25af):_0x3d25af();};function Dialer(_0x46e3db,_0x50f7b7){this[_0x8ede('0x22')]=new Sequence();this['preview']=_0x50f7b7;this[_0x8ede('0x23')]=_0x46e3db[_0x8ede('0x23')];this['campaigns']=_0x46e3db[_0x8ede('0x24')];this[_0x8ede('0x25')]=_0x46e3db[_0x8ede('0x25')];this['trunks']=_0x46e3db[_0x8ede('0x26')];this[_0x8ede('0x27')]=config[_0x8ede('0x27')]||0x2;this[_0x8ede('0x28')]={};this[_0x8ede('0x29')]={};this[_0x8ede('0x2a')]={};this[_0x8ede('0x2b')]={};this[_0x8ede('0x2c')]={};this[_0x8ede('0x2d')]={};this[_0x8ede('0x2e')]={};this['ivrOriginated']={};this[_0x8ede('0x2f')]={};this[_0x8ede('0x30')]={};ami['on'](_0x8ede('0x31'),this['syncAgentConnect'][_0x8ede('0x32')](this));ami['on'](_0x8ede('0x33'),this[_0x8ede('0x34')][_0x8ede('0x32')](this));ami['on'](_0x8ede('0x35'),this[_0x8ede('0x36')][_0x8ede('0x32')](this));ami['on'](_0x8ede('0x37'),this['syncAgentComplete']['bind'](this));ami['on'](_0x8ede('0x38'),this[_0x8ede('0xb')][_0x8ede('0x32')](this));ami['on'](_0x8ede('0x39'),this[_0x8ede('0x3a')]['bind'](this));ami['on'](_0x8ede('0x3b'),this[_0x8ede('0x3c')][_0x8ede('0x32')](this));ami['on'](_0x8ede('0x3d'),this[_0x8ede('0x3e')][_0x8ede('0x32')](this));ami['on']('queuemember',this[_0x8ede('0x3f')][_0x8ede('0x32')](this));ami['on'](_0x8ede('0x40'),this['syncQueueStatusComplete']['bind'](this));this[_0x8ede('0x41')]();this[_0x8ede('0x42')]();}function isNotNull(_0x38cbde){return _0x38cbde!==null&&!_[_0x8ede('0x43')](_0x38cbde);}function checkIsLoggedIn(_0x447f80,_0x506591){return function(){if(_0x506591<=0x0){_0x447f80['message']=_0x8ede('0x44');throw _0x447f80['name']+_0x8ede('0x45');}};}function isActive(_0x534a02){return _0x534a02;}function checkIsActive(_0x53f78c,_0x54b587){return function(){if(!isActive(_0x54b587)){_0x53f78c[_0x8ede('0x46')]=_0x8ede('0x47');throw _0x53f78c['name']+_0x8ede('0x48');}};}function checkInterval(_0xfc9b9c){return function(){if(!isNotNull(_0xfc9b9c[_0x8ede('0x49')])){_0xfc9b9c['message']=_0x8ede('0x4a');throw _0xfc9b9c[_0x8ede('0x4b')]+_0x8ede('0x4c');}if(!isNotNull(_0xfc9b9c['Interval'][_0x8ede('0x4d')])){_0xfc9b9c[_0x8ede('0x46')]=_0x8ede('0x4a');throw _0xfc9b9c['name']+_0x8ede('0x4c');}if(!isNotNull(_[_0x8ede('0x4e')](_0xfc9b9c[_0x8ede('0x49')][_0x8ede('0x4d')]))){_0xfc9b9c[_0x8ede('0x46')]='INTERVAL_IS_NULL';throw _0xfc9b9c['name']+_0x8ede('0x4c');}};}function msgResponse(_0x3bbe09,_0x133084,_0x1019ff){return{'action':_0x3bbe09,'response':_0x133084,'message':_0x1019ff,'stack':_0x1019ff};}function myreject(_0x3a8040){return function(_0x17238f){return _0x3a8040(msgResponse(_0x8ede('0x4f'),_0x8ede('0x50'),JSON[_0x8ede('0x51')](_0x17238f)));};}function getSeconds(_0x3c2f9e,_0x5337c9){var _0x28aebf=moment(_0x3c2f9e)[_0x8ede('0x52')](0x0);var _0x98a1bc=moment(_0x5337c9)[_0x8ede('0x52')](0x0);return _0x28aebf['diff'](_0x98a1bc,'seconds');}function emit(_0x1f1183,_0x4278a8,_0x18047c){io['to'](_0x1f1183)[_0x8ede('0x53')](_0x4278a8,_0x18047c);}function emitVoiceQueueSummary(_0x12186c){if(_0x12186c[_0x8ede('0x54')]===_0x8ede('0x55')){var _0x1c62e3={'id':_0x12186c['id'],'name':_0x12186c[_0x8ede('0x4b')],'strategy':_0x12186c[_0x8ede('0x56')],'answered':_0x12186c[_0x8ede('0x57')],'available':_0x12186c[_0x8ede('0x58')],'loggedIn':_0x12186c[_0x8ede('0x59')],'pTalking':_0x12186c['pTalking'],'sumBillable':_0x12186c[_0x8ede('0x5a')],'sumDuration':_0x12186c[_0x8ede('0x5b')],'sumHoldTime':_0x12186c[_0x8ede('0x5c')]||0x0,'talking':_0x12186c[_0x8ede('0x5d')],'total':_0x12186c['total'],'type':_0x12186c[_0x8ede('0x54')],'unmanaged':_0x12186c[_0x8ede('0x5e')],'abandoned':_0x12186c[_0x8ede('0x5f')],'waiting':_0x12186c[_0x8ede('0x60')],'loggedInDb':_0x12186c[_0x8ede('0x61')],'dialActive':_0x12186c[_0x8ede('0x62')],'dialMethod':_0x12186c[_0x8ede('0x63')],'dialOriginateCallerIdName':_0x12186c[_0x8ede('0x64')],'dialOriginateCallerIdNumber':_0x12186c[_0x8ede('0x65')],'dialOriginateTimeout':_0x12186c['dialOriginateTimeout'],'dialPrefix':_0x12186c[_0x8ede('0x66')],'outboundAnswerAgiCallsDay':_0x12186c[_0x8ede('0x67')],'outboundAnswerCallsDay':_0x12186c[_0x8ede('0x68')],'outboundBlacklistCallsDay':_0x12186c['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x12186c[_0x8ede('0x69')],'outboundCongestionCallsDay':_0x12186c[_0x8ede('0x6a')],'outboundDropCallsDayACS':_0x12186c[_0x8ede('0x6b')],'outboundDropCallsDayCallersExit':_0x12186c[_0x8ede('0x6c')],'outboundDropCallsDayTimeout':_0x12186c[_0x8ede('0x6d')],'outboundNoAnswerCallsDay':_0x12186c[_0x8ede('0x6e')],'outboundNoSuchCallsDay':_0x12186c[_0x8ede('0x6f')],'outboundOriginateFailureCallsDay':_0x12186c[_0x8ede('0x70')],'outboundReCallsDay':_0x12186c[_0x8ede('0x71')],'outboundRejectCallsDay':_0x12186c[_0x8ede('0x72')],'outboundUnknownCallsDay':_0x12186c[_0x8ede('0x73')],'predictiveIntervalAnsweredCalls':_0x12186c[_0x8ede('0x74')],'predictiveIntervalAvgHoldtime':_0x12186c[_0x8ede('0x75')],'predictiveIntervalAvgTalktime':_0x12186c['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x12186c[_0x8ede('0x76')],'predictiveIntervalDroppedCallsTimeout':_0x12186c['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x12186c[_0x8ede('0x77')],'predictiveIntervalErlangCallsDroppedCalls':_0x12186c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x12186c[_0x8ede('0x78')],'predictiveIntervalMultiplicativeFactor':_0x12186c[_0x8ede('0x79')],'predictiveIntervalPauses':_0x12186c['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x12186c['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x12186c[_0x8ede('0x7a')],'message':_0x12186c['message'],'originated':_0x12186c['originated'],'erlangCalls':_0x12186c[_0x8ede('0x7b')],'erlangCallToSecond':_0x12186c[_0x8ede('0x7c')],'erlangAbandonmentRate':_0x12186c[_0x8ede('0x7d')],'erlangBusyFactor':_0x12186c['erlangBusyFactor'],'startPredictive':_0x12186c[_0x8ede('0x2d')],'startProgressive':_0x12186c[_0x8ede('0x2e')]};if(_0x12186c['Trunk']){_0x1c62e3['Trunk']={'id':_0x12186c['Trunk']['id'],'name':_0x12186c[_0x8ede('0x7e')][_0x8ede('0x4b')],'active':_0x12186c[_0x8ede('0x7e')][_0x8ede('0x7f')],'callerid':_0x12186c[_0x8ede('0x7e')][_0x8ede('0x80')]};}if(_0x12186c[_0x8ede('0x49')]){_0x1c62e3[_0x8ede('0x49')]={'id':_0x12186c[_0x8ede('0x49')]['id'],'name':_0x12186c[_0x8ede('0x49')]['name']};}var _0x417a08=md5(JSON[_0x8ede('0x51')](_0x1c62e3));if(_0x12186c[_0x8ede('0x4')]!==_0x417a08){_0x12186c[_0x8ede('0x4')]=_0x417a08;emit(util[_0x8ede('0x81')](_0x8ede('0x82'),_0x1c62e3[_0x8ede('0x4b')]),'voice_queue:save',_0x1c62e3);}}}function emitCampaignSummary(_0x3f8363){if(_0x3f8363[_0x8ede('0x54')]==='ivr'){emit(util[_0x8ede('0x81')](_0x8ede('0x83'),_0x3f8363['name']),_0x8ede('0x84'),_0x3f8363);}}function checkGetDataPredictive(_0x34051b){if(isNotNull(_0x34051b)&&!_[_0x8ede('0x4e')](_0x34051b)){loggerPredictive[_0x8ede('0x85')](_0x8ede('0x86'));loggerPredictive[_0x8ede('0x85')](_0x8ede('0x87'),_0x34051b[_0x8ede('0x7a')]);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x88'),_0x34051b[_0x8ede('0x74')]);loggerPredictive['info'](_0x8ede('0x89'),_0x34051b[_0x8ede('0x8a')]);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x8b'),_0x34051b['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x8c'),_0x34051b[_0x8ede('0x75')]);loggerPredictive[_0x8ede('0x85')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34051b[_0x8ede('0x8d')]);loggerPredictive['info'](_0x8ede('0x8e'));if(_0x34051b[_0x8ede('0x7a')]>0x0){if(!_['isUndefined'](_0x34051b[_0x8ede('0x8d')])&&_0x34051b[_0x8ede('0x8d')]>0x0){return!![];}loggerPredictive[_0x8ede('0x85')](_0x8ede('0x8f'));if(!_[_0x8ede('0x43')](_0x34051b[_0x8ede('0x75')])&&_0x34051b[_0x8ede('0x75')]>0x0){return!![];}loggerPredictive[_0x8ede('0x85')](_0x8ede('0x90'));}else{loggerPredictive[_0x8ede('0x85')](_0x8ede('0x91'));}}else{loggerPredictive[_0x8ede('0x85')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3905b5){return function(_0x16b2e0){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x8ede('0x85')](_0x8ede('0x92'),_0x16b2e0['erlangCalls']);loggerPredictive[_0x8ede('0x85')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16b2e0[_0x8ede('0x7c')]);loggerPredictive[_0x8ede('0x85')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16b2e0[_0x8ede('0x7d')]);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x93'),_0x16b2e0[_0x8ede('0x94')]);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x95'),_0x16b2e0[_0x8ede('0x7d')]);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x8e'));_['merge'](_0x3905b5,_0x16b2e0);};}function getDiff(_0x3542f1){var _0x5b8b7f=moment()[_0x8ede('0x52')](0x0);var _0x3bdaf5=moment(_0x3542f1)[_0x8ede('0x52')](0x0);return _0x5b8b7f[_0x8ede('0x96')](_0x3bdaf5,_0x8ede('0x97'));}function ifInterval(_0x455b76,_0x17b1ea){if(_[_0x8ede('0x43')](_0x17b1ea)){return![];}return getDiff(_0x17b1ea)<_0x455b76*0x3c;}function freeVariablesPredictive(_0x27df2e){if(isNotNull(_0x27df2e)){if(!_[_0x8ede('0x43')](_0x27df2e[_0x8ede('0x2e')])){_0x27df2e[_0x8ede('0x2e')]=undefined;loggerPredictive['info'](_0x27df2e[_0x8ede('0x4b')],_0x8ede('0x98'));}if(!_[_0x8ede('0x43')](_0x27df2e[_0x8ede('0x2d')])){_0x27df2e[_0x8ede('0x2d')]=undefined;loggerPredictive[_0x8ede('0x85')](_0x27df2e[_0x8ede('0x4b')],_0x8ede('0x99'));}if(!_[_0x8ede('0x43')](_0x27df2e[_0x8ede('0x9a')])){clearInterval(_0x27df2e[_0x8ede('0x9a')]);_0x27df2e['handlePredictive']=undefined;loggerPredictive['info'](_0x27df2e[_0x8ede('0x4b')],_0x8ede('0x9b'));}}}function erlangb(_0x5d822d,_0x3604fe){if(_0x3604fe===0x0){return 0x0;}var _0x934542=0x1;for(var _0x47ea2a=0x1;_0x47ea2a<=_0x3604fe;_0x47ea2a+=0x1){_0x934542=0x1+_0x934542*_0x47ea2a/_0x5d822d;}return 0x1/_0x934542;}function isVoiceQueueOutbound(_0x4543a5){return _0x4543a5==='outbound';}function isNotPreview(_0x2e8998){return _0x2e8998!==_0x8ede('0x9c');}function isCampaignIvr(_0x444af0){return _0x444af0===_0x8ede('0x9d');}function getCallerId(_0x4b0944,_0x5ccc6d,_0x20e110){if(!_[_0x8ede('0x43')](_0x20e110)&&typeof _0x20e110===_0x8ede('0x9e')&&!_['isEmpty'](_0x20e110)){if(!_[_0x8ede('0x43')](_0x5ccc6d)&&typeof _0x5ccc6d===_0x8ede('0x9e')&&!_[_0x8ede('0x4e')](_0x5ccc6d)){return util[_0x8ede('0x81')](_0x8ede('0x9f'),_0x5ccc6d,_0x20e110);}return util[_0x8ede('0x81')](_0x8ede('0x9f'),_0x20e110,_0x20e110);}if(!_[_0x8ede('0x43')](_0x4b0944)&&typeof _0x4b0944===_0x8ede('0x9e')&&!_['isEmpty'](_0x4b0944)){return _0x4b0944;}return _0x8ede('0xa0');}function loggerCatchQueueSummary(_0x1f639d,_0xbef133){return function(_0x5da814){freeVariablesPredictive(_0xbef133);emitVoiceQueueSummary(_0xbef133);emitCampaignSummary(_0xbef133);loggerSyncQueueSummary[_0x8ede('0xa1')](_0x1f639d,util[_0x8ede('0xa2')](_0x5da814,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4de3cc,_0x3b4b61){return function(_0x203825){loggerPredictive[_0x8ede('0xa1')](_0x3b4b61[_0x8ede('0x4b')],_0x4de3cc);loggerPredictive[_0x8ede('0xa1')](_0x203825[_0x8ede('0xa3')]);freeVariablesPredictive(_0x3b4b61);};}function loggerCatch(_0x3d6fef){return function(_0x317e74){logger['error'](_0x3d6fef,util[_0x8ede('0xa2')](_0x317e74,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1f4e4e){return _0x1f4e4e&&!_['isUndefined'](_0x1f4e4e)&&_0x1f4e4e[_0x8ede('0xa4')]>0x0;}function decremetOriginate(_0x496116){if(!_[_0x8ede('0x43')](_0x496116)&&_0x496116!==null){if(typeof _0x496116['originated']!=='undefined'){if(_0x496116['originated']>0x0){_0x496116[_0x8ede('0xa5')]-=0x1;}else{logger[_0x8ede('0xa1')](_0x8ede('0xa6'));}}}else{logger[_0x8ede('0xa1')](_0x8ede('0xa7'));}}function checkContactLowerLimitOriginate(_0x3fe956,_0xb0c960,_0x43e986){if(_0xb0c960>_0x43e986){for(var _0x20d969=0x0;_0x20d969<_0xb0c960-_0x43e986;_0x20d969+=0x1){decremetOriginate(_0x3fe956);}}}function loggerGetContactDialer(_0x4ecb3c,_0xdd06ce,_0x1cfc95){return function(_0x3cdcbb){checkContactLowerLimitOriginate(_0xdd06ce,_0x1cfc95,0x0);logger[_0x8ede('0xa1')](_0x4ecb3c,util['inspect'](_0x3cdcbb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x243d4b){return function(_0x448e72){if(isNotNull(_0x448e72)&&isNotNull(_0x448e72[0x0])){if(_0x448e72[0x0][_0x8ede('0xa8')]>0x0){_0x243d4b[_0x8ede('0x46')]='RESCHEDULED_CONTACTS';logger['info'](_0x8ede('0xa9')+_0x243d4b['name'],_0x448e72[0x0]['contactsRescheduled'],_0x8ede('0xaa'));}else{_0x243d4b[_0x8ede('0x46')]=_0x8ede('0xab');logger['info'](_0x8ede('0xac')+_0x243d4b[_0x8ede('0x4b')]);}}};}function notSendMessagesQueue(_0x44680b){if(_0x44680b['sendMessageOneNotActive']){freeVariablesPredictive(_0x44680b);if(_0x44680b[_0x8ede('0xa5')]===0x0&&_0x44680b[_0x8ede('0x5d')]===0x0&&_0x44680b[_0x8ede('0x60')]===0x0&&(_0x44680b[_0x8ede('0xad')]||0x0)===0x0){_0x44680b[_0x8ede('0xae')]=![];_0x44680b['available']=0x0;_0x44680b[_0x8ede('0x46')]=_0x8ede('0x47');loggerSyncQueueSummary[_0x8ede('0xa1')](_0x8ede('0xaf'),_0x44680b['name'],'is\x20not\x20active');}else{_0x44680b[_0x8ede('0x46')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x8ede('0xa1')](_0x8ede('0xaf'),_0x44680b[_0x8ede('0x4b')],_0x8ede('0xb0'));}emitVoiceQueueSummary(_0x44680b);}}function notSendMessagesCampaign(_0x503eb8){if(_0x503eb8[_0x8ede('0xae')]){if(_0x503eb8[_0x8ede('0xa5')]===0x0){_0x503eb8[_0x8ede('0xae')]=![];_0x503eb8[_0x8ede('0x46')]=_0x8ede('0x47');loggerSyncQueueSummary['error'](_0x8ede('0xb1'),_0x503eb8['name'],_0x8ede('0xb2'));}else{_0x503eb8[_0x8ede('0x46')]=_0x8ede('0xb3');loggerSyncQueueSummary[_0x8ede('0xa1')](_0x8ede('0xb1'),_0x503eb8['name'],_0x8ede('0xb0'));}emitCampaignSummary(_0x503eb8);}}function createObjHistory(_0x7b62c3,_0x4a0f71,_0x3c56e5,_0xf2ec5,_0x30f7ec){_0x7b62c3[_0x8ede('0x46')]=_0x3c56e5;var _0x9e8924=new Action(_0x7b62c3,_0x4a0f71);var _0x1926fe=new History(_0x9e8924);_0x1926fe['state']=_0xf2ec5;_0x1926fe[_0x8ede('0xb4')]=_0x30f7ec;_0x1926fe[_0x8ede('0xb5')]=_0x9e8924[_0x8ede('0xb6')];return _0x1926fe;}Dialer[_0x8ede('0x1f')]['loopClearZombieChannels']=function(){var _0x53b728=this;setInterval(function(){_0x53b728[_0x8ede('0xb7')](_0x53b728[_0x8ede('0x2b')],_0x8ede('0xb8'));_0x53b728[_0x8ede('0xb7')](_0x53b728[_0x8ede('0x29')],_0x8ede('0xb9'));},0x32c8);};Dialer[_0x8ede('0x1f')][_0x8ede('0xb7')]=function(_0x3339e0,_0x46aa6b){var _0x4b3336=this;for(var _0x30a50b in _0x3339e0){if(typeof _0x3339e0[_0x30a50b]!=='undefined'){this[_0x8ede('0x22')][_0x8ede('0x20')](function(){if(!_['isNil'](_0x3339e0[_0x30a50b])){return ami['Action']({'action':_0x8ede('0xba'),'channel':_0x3339e0[_0x30a50b]['channel']})[_0x8ede('0xbb')](function(_0x23560d){if(_0x23560d['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x3339e0[_0x30a50b]&&_0x3339e0[_0x30a50b][_0x8ede('0x54')]!==_0x8ede('0x9d')){_0x4b3336[_0x8ede('0xbc')](_0x4b3336[_0x8ede('0x23')][_0x3339e0[_0x30a50b][_0x8ede('0xbd')]]);logger['error'](_0x8ede('0xbe'),_0x46aa6b,_0x30a50b,_0x3339e0[_0x30a50b]['queue']);delete _0x3339e0[_0x30a50b];}if(_0x3339e0[_0x30a50b]&&_0x3339e0[_0x30a50b][_0x8ede('0x54')]===_0x8ede('0x9d')){_0x4b3336['updateOriginated'](_0x4b3336[_0x8ede('0x24')][_0x3339e0[_0x30a50b][_0x8ede('0xbd')]]);logger[_0x8ede('0xa1')](_0x8ede('0xbf'),_0x46aa6b,_0x30a50b,_0x3339e0[_0x30a50b][_0x8ede('0xbd')]);delete _0x3339e0[_0x30a50b];}},0x2328);}});}});}}};Dialer[_0x8ede('0x1f')]['countReScheduled']=function(_0x1151a2){return BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](cmHopper[_0x8ede('0xc2')](_0x1151a2))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xc3')));};Dialer['prototype'][_0x8ede('0xc4')]=function(_0x34e57b){return BPromise['resolve']()['then'](cmHopperBlack[_0x8ede('0xc4')](_0x34e57b))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xc5')));};Dialer[_0x8ede('0x1f')]['checkIsBlackListIvr']=function(_0x47f94f){return BPromise['resolve']()[_0x8ede('0xc1')](cmHopperBlack[_0x8ede('0xc6')](_0x47f94f))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xc7')));};Dialer[_0x8ede('0x1f')]['averageHandleTime']=function(_0x3ad56c){return BPromise[_0x8ede('0xc0')]()['then'](cmHopperHistory[_0x8ede('0xc8')](_0x3ad56c))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xc9')));};Dialer[_0x8ede('0x1f')][_0x8ede('0xca')]=function(_0x171b99){return BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](cmHopper[_0x8ede('0xca')](_0x171b99))['catch'](loggerCatch(_0x8ede('0xcb')));};Dialer['prototype'][_0x8ede('0xcc')]=function(_0x2b7cfd,_0x1eea21,_0x1445c1){return BPromise['resolve']()[_0x8ede('0xc1')](cmHopper[_0x8ede('0xcc')](_0x2b7cfd,_0x1eea21,_0x1445c1))['catch'](loggerCatch(_0x8ede('0xcd')));};Dialer[_0x8ede('0x1f')][_0x8ede('0xce')]=function(_0x2cbff2,_0x18541a,_0x52788b,_0x21330e,_0x4831ea){return BPromise[_0x8ede('0xc0')]()['then'](cmHopper['getContactDialer'](_0x2cbff2,_0x18541a,_0x52788b,_0x21330e))[_0x8ede('0xbb')](function(_0x296354){_0x4831ea[_0x8ede('0xcf')]-=_0x52788b;_0x4831ea[_0x8ede('0xcf')]=_0x4831ea[_0x8ede('0xcf')]>0x0?_0x4831ea['temp']:0x0;loggerCatch(_0x8ede('0xd0'))(_0x296354);});};Dialer[_0x8ede('0x1f')][_0x8ede('0xd1')]=function(_0x32a093,_0xd50ad5,_0x36003b,_0x325b6a){return BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](cmHopper[_0x8ede('0xd1')](_0x32a093,_0xd50ad5,_0x36003b))[_0x8ede('0xbb')](function(_0x273115){_0x325b6a[_0x8ede('0xcf')]-=_0xd50ad5;_0x325b6a[_0x8ede('0xcf')]=_0x325b6a['temp']>0x0?_0x325b6a[_0x8ede('0xcf')]:0x0;loggerCatch(_0x8ede('0xd2'))(_0x273115);});};Dialer[_0x8ede('0x1f')][_0x8ede('0xd3')]=function(_0x3dc25f){return BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](voiceQueueRt[_0x8ede('0xd3')](_0x3dc25f))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xd4')));};Dialer['prototype'][_0x8ede('0xd5')]=function(_0x49eb3e){return BPromise['resolve']()[_0x8ede('0xc1')](cmHopper[_0x8ede('0xd5')](_0x49eb3e))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xd6')));};Dialer[_0x8ede('0x1f')]['createHistory']=function(_0xd1be90){return BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](cmHopperHistory[_0x8ede('0xd7')](_0xd1be90))['catch'](loggerCatch(_0x8ede('0xd8')));};Dialer[_0x8ede('0x1f')][_0x8ede('0xbc')]=function(_0xeef4c5){if(!_[_0x8ede('0x43')](_0xeef4c5)&&_0xeef4c5!==null){if(typeof _0xeef4c5[_0x8ede('0xa5')]!==_0x8ede('0xd9')){if(_0xeef4c5['originated']>0x0){_0xeef4c5[_0x8ede('0xa5')]-=0x1;}else{logger['error'](_0x8ede('0xda'));}}}else{logger[_0x8ede('0xa1')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x8ede('0xdb')]=function(_0x4d38a5,_0x2f53f1){var _0x3620e8=this;return function(_0x2bdacf){_0x3620e8[_0x8ede('0xbc')](_0x2f53f1);logger[_0x8ede('0xa1')](_0x4d38a5,util['inspect'](_0x2bdacf,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x8ede('0xdc')]=function(_0x55dd93,_0x324624,_0x14723d){var _0x505cd5={'state':0x19,'statedesc':_0x8ede('0xdd')};this[_0x8ede('0xbc')](_0x324624);this['saveInDb'](_[_0x8ede('0xde')](_0x505cd5,_['pick'](_0x14723d,[_0x8ede('0xdf'),'ListId',_0x8ede('0xe0'),_0x8ede('0xe1'),_0x8ede('0xe2')])),_0x8ede('0xe3'),_0x8ede('0xe4'));logger['error'](_0x55dd93);};Dialer[_0x8ede('0x1f')][_0x8ede('0xe5')]=function(_0x4c45ee){return _0x4c45ee==='Success';};Dialer[_0x8ede('0x1f')][_0x8ede('0xe6')]=function(_0x47716e){return!_[_0x8ede('0x43')](_0x47716e)&&_0x47716e&&!_[_0x8ede('0x43')](_0x47716e[_0x8ede('0x4b')])&&!_['isUndefined'](_0x47716e[_0x8ede('0x7f')])&&_0x47716e['active']&&(this[_0x8ede('0x26')][util[_0x8ede('0x81')]('SIP/%s',_0x47716e[_0x8ede('0x4b')])][_0x8ede('0xba')]===_0x8ede('0xe7')||this[_0x8ede('0x26')][util[_0x8ede('0x81')]('SIP/%s',_0x47716e[_0x8ede('0x4b')])][_0x8ede('0xba')]===_0x8ede('0xe8'));};Dialer[_0x8ede('0x1f')][_0x8ede('0xe9')]=function(_0x262366,_0x1e90a9,_0x33dbb1){this[_0x8ede('0xd7')](_0x262366)[_0x8ede('0xbb')](loggerCatch(_0x1e90a9));this[_0x8ede('0xd5')](_0x262366)[_0x8ede('0xbb')](loggerCatch(_0x33dbb1));};Dialer[_0x8ede('0x1f')]['syncVarSet']=function(_0x29c1ce){var _0x28e603=this[_0x8ede('0x2b')][_0x29c1ce[_0x8ede('0xea')]];var _0x31c1f3;if(!_[_0x8ede('0xeb')](_0x29c1ce)&&!_[_0x8ede('0xeb')](_0x29c1ce[_0x8ede('0xec')])&&!_['isNil'](_0x29c1ce[_0x8ede('0xec')][_0x8ede('0xed')])&&_0x29c1ce[_0x8ede('0xee')]===_0x8ede('0xef')&&_0x28e603){if(_0x28e603[_0x8ede('0x54')]!==_0x8ede('0x9d')&&this[_0x8ede('0x23')][_0x28e603['queue']]['dialAMDActive']&&_0x29c1ce[_0x8ede('0xf0')]==='HANGUP'){delete this['uniqueId'][_0x29c1ce[_0x8ede('0xea')]];this[_0x8ede('0xbc')](this['voiceQueues'][_0x28e603[_0x8ede('0xbd')]]);this[_0x8ede('0x23')][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x68')]+=0x1;this[_0x8ede('0x23')][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x67')]+=0x1;_0x31c1f3=new Hangup(_0x28e603,_0x29c1ce);_0x31c1f3[_0x8ede('0xf1')]=0x12;_0x31c1f3['statedesc']='HangupInAMD';_0x31c1f3[_0x8ede('0xf2')]=_0x8ede('0xf3');ami[_0x8ede('0x53')](_0x8ede('0xf4'),ut['buildObj'](_0x31c1f3,_0x8ede('0xf5')));this['saveInDb'](_0x31c1f3,_0x8ede('0xf6'),_0x8ede('0xf7'));}if(_0x28e603[_0x8ede('0x54')]!==_0x8ede('0x9d')&&this[_0x8ede('0x23')][_0x28e603['queue']]['dialAMDActive']&&_0x29c1ce[_0x8ede('0xf0')]===_0x8ede('0xf8')){var _0x25d907=this;return new BPromise(function(_0x381e49,_0x8827be){delete _0x25d907['uniqueId'][_0x29c1ce[_0x8ede('0xea')]];_0x25d907[_0x8ede('0xbc')](_0x25d907['voiceQueues'][_0x28e603['queue']]);_0x25d907[_0x8ede('0x23')][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x68')]+=0x1;_0x25d907[_0x8ede('0x23')][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x67')]+=0x1;var _0x453eb5=_0x25d907[_0x8ede('0x23')][_0x28e603[_0x8ede('0xbd')]];var _0x4b5002=new Hangup(_0x28e603,_0x29c1ce);_0x4b5002[_0x8ede('0xf1')]=0x13;_0x4b5002[_0x8ede('0xb4')]=_0x8ede('0xf9');_0x4b5002[_0x8ede('0xf2')]='AMD';_0x4b5002[_0x8ede('0xfa')]+=0x1;_0x4b5002['countglobal']+=0x1;_0x4b5002[_0x8ede('0xf5')]=!![];ami[_0x8ede('0x53')](_0x8ede('0xf4'),ut['buildObj'](_0x4b5002,'amd'));_0x25d907[_0x8ede('0xd7')](_0x4b5002)['catch'](loggerCatch(_0x8ede('0xfb')));if(_0x4b5002[_0x8ede('0xfc')]+_0x4b5002[_0x8ede('0xfd')]+_0x4b5002[_0x8ede('0xfe')]+_0x4b5002['countnosuchnumberretry']+_0x4b5002[_0x8ede('0xff')]+_0x4b5002[_0x8ede('0x100')]+_0x4b5002[_0x8ede('0xfa')]+_0x4b5002[_0x8ede('0x101')]>=_0x453eb5['dialGlobalMaxRetry']){_0x25d907[_0x8ede('0x102')](_0x4b5002,_0x381e49,_0x8827be,_0x8ede('0x103'));}else{if(_0x4b5002[_0x8ede('0xfa')]>=_0x453eb5[_0x8ede('0x104')]){_0x25d907[_0x8ede('0x105')](_0x4b5002,_0x381e49,_0x8827be,_0x8ede('0x106'));}else{_0x25d907[_0x8ede('0xca')]({'active':![],'countmachineretry':_0x4b5002['countmachineretry'],'scheduledat':moment()['add'](_0x453eb5[_0x8ede('0x107')],'minutes')[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x4b5002[_0x8ede('0xdf')],'ListId':_0x4b5002[_0x8ede('0x109')],'VoiceQueueId':_0x4b5002[_0x8ede('0xe1')]||undefined,'CampaignId':_0x4b5002['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x381e49({'reschedule':0x1});}}});}if(_0x28e603['type']==='ivr'&&this[_0x8ede('0x24')][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x10a')]&&_0x29c1ce[_0x8ede('0xf0')]===_0x8ede('0x10b')){delete this[_0x8ede('0x2b')][_0x29c1ce[_0x8ede('0xea')]];this[_0x8ede('0xbc')](this[_0x8ede('0x24')][_0x28e603[_0x8ede('0xbd')]]);_0x31c1f3=new Hangup(_0x28e603,_0x29c1ce);_0x31c1f3[_0x8ede('0xf1')]=0x12;_0x31c1f3[_0x8ede('0xb4')]='HangupInAMD';_0x31c1f3[_0x8ede('0xf2')]=_0x8ede('0xf3');ami['emit'](_0x8ede('0xf4'),ut[_0x8ede('0x10c')](_0x31c1f3,_0x8ede('0xf5')));this['saveInDb'](_0x31c1f3,_0x8ede('0x10d'),'[syncHangupInAMDIvr]');}if(_0x28e603['type']==='ivr'&&this[_0x8ede('0x24')][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x10a')]&&_0x29c1ce['value']===_0x8ede('0xf8')){var _0x25d907=this;return new BPromise(function(_0x3d8c2b,_0x5942ff){delete _0x25d907[_0x8ede('0x2b')][_0x29c1ce[_0x8ede('0xea')]];_0x25d907['updateOriginated'](_0x25d907[_0x8ede('0x24')][_0x28e603[_0x8ede('0xbd')]]);_0x25d907['campaigns'][_0x28e603[_0x8ede('0xbd')]][_0x8ede('0x68')]+=0x1;_0x25d907['campaigns'][_0x28e603[_0x8ede('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xf103fd=_0x25d907[_0x8ede('0x24')][_0x28e603['queue']];var _0x38d738=new Hangup(_0x28e603,_0x29c1ce);_0x38d738[_0x8ede('0xf1')]=0x13;_0x38d738[_0x8ede('0xb4')]=_0x8ede('0xf9');_0x38d738['membername']=_0x8ede('0xf3');_0x38d738[_0x8ede('0xfa')]+=0x1;_0x38d738[_0x8ede('0x10e')]+=0x1;_0x38d738['amd']=!![];ami[_0x8ede('0x53')](_0x8ede('0xf4'),ut[_0x8ede('0x10c')](_0x38d738,'amd'));_0x25d907['createHistory'](_0x38d738)[_0x8ede('0xbb')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x38d738[_0x8ede('0xfc')]+_0x38d738['countcongestionretry']+_0x38d738[_0x8ede('0xfe')]+_0x38d738['countnosuchnumberretry']+_0x38d738[_0x8ede('0xff')]+_0x38d738[_0x8ede('0x100')]+_0x38d738[_0x8ede('0xfa')]+_0x38d738[_0x8ede('0x101')]>=_0xf103fd[_0x8ede('0x10f')]){_0x25d907[_0x8ede('0x102')](_0x38d738,_0x3d8c2b,_0x5942ff,'reason19\x20machine....');}else{if(_0x38d738[_0x8ede('0xfa')]>=_0xf103fd[_0x8ede('0x104')]){_0x25d907['createStateFinal'](_0x38d738,_0x3d8c2b,_0x5942ff,_0x8ede('0x106'));}else{_0x25d907['rescheduleContact']({'active':![],'countmachineretry':_0x38d738[_0x8ede('0xfa')],'scheduledat':moment()[_0x8ede('0x110')](_0xf103fd[_0x8ede('0x107')],'minutes')[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38d738[_0x8ede('0xdf')],'ListId':_0x38d738[_0x8ede('0x109')],'VoiceQueueId':_0x38d738[_0x8ede('0xe1')]||undefined,'CampaignId':_0x38d738[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x111')));_0x3d8c2b({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x36f366){var _0x17d1a4=this[_0x8ede('0x2b')][_0x36f366[_0x8ede('0xea')]];var _0x4f16bd=this;var _0x1efdce;if(_0x17d1a4&&_0x17d1a4[_0x8ede('0x54')]===_0x8ede('0x9d')){delete this[_0x8ede('0x2b')][_0x36f366[_0x8ede('0xea')]];this['updateOriginated'](this['campaigns'][_0x17d1a4[_0x8ede('0xbd')]]);this['campaigns'][_0x17d1a4[_0x8ede('0xbd')]][_0x8ede('0x112')]+=0x1;_0x1efdce=new Hangup(_0x17d1a4,_0x36f366);this[_0x8ede('0xd7')](_0x1efdce)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x113')));this[_0x8ede('0xd5')](_0x1efdce)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x114')));}if(_0x17d1a4&&_0x17d1a4[_0x8ede('0x54')]!==_0x8ede('0x9d')&&isNotNull(this[_0x8ede('0x23')][_0x17d1a4[_0x8ede('0xbd')]][_0x8ede('0x115')])){delete this[_0x8ede('0x2b')][_0x36f366[_0x8ede('0xea')]];this['updateOriginated'](this[_0x8ede('0x23')][_0x17d1a4['queue']]);this[_0x8ede('0x23')][_0x17d1a4[_0x8ede('0xbd')]][_0x8ede('0x68')]+=0x1;this[_0x8ede('0x23')][_0x17d1a4[_0x8ede('0xbd')]][_0x8ede('0x67')]+=0x1;_0x1efdce=new Hangup(_0x17d1a4,_0x36f366);_0x1efdce[_0x8ede('0xf1')]=0x10;_0x1efdce[_0x8ede('0xb4')]='AnswerAGI';_0x1efdce[_0x8ede('0xf2')]=_0x8ede('0x116');this['createHistory'](_0x1efdce)['catch'](loggerCatch(_0x8ede('0x113')));this[_0x8ede('0xd5')](_0x1efdce)['catch'](loggerCatch(_0x8ede('0x114')));}if(_0x17d1a4&&_0x17d1a4[_0x8ede('0x54')]!==_0x8ede('0x9d')&&!isNotNull(this[_0x8ede('0x23')][_0x17d1a4[_0x8ede('0xbd')]][_0x8ede('0x115')])){delete this[_0x8ede('0x2b')][_0x36f366['uniqueid']];this[_0x8ede('0xbc')](this['voiceQueues'][_0x17d1a4[_0x8ede('0xbd')]]);this[_0x8ede('0x23')][_0x17d1a4[_0x8ede('0xbd')]]['outboundUnknownCallsDay']+=0x1;_0x1efdce=new Hangup(_0x17d1a4,_0x36f366);_0x1efdce[_0x8ede('0xf1')]=0xc;_0x1efdce['statedesc']=_0x36f366[_0x8ede('0x117')];_0x1efdce[_0x8ede('0xf2')]=_0x8ede('0x118');this[_0x8ede('0xd7')](_0x1efdce)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8ede('0xd5')](_0x1efdce)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x114')));}};Dialer[_0x8ede('0x1f')][_0x8ede('0x119')]=function(_0x53160d){var _0x15e8ee=this['uniqueId'][_0x53160d[_0x8ede('0xea')]];var _0x5e4d74=this;if(this[_0x8ede('0x23')][_0x53160d[_0x8ede('0xbd')]]){if(_0x15e8ee&&_0x15e8ee['type']!==_0x8ede('0x9d')){delete this[_0x8ede('0x2b')][_0x53160d[_0x8ede('0xea')]];this['voiceQueues'][_0x53160d['queue']][_0x8ede('0x68')]+=0x1;var _0x398341=new AgentComplete(_0x15e8ee,_0x53160d);if(_0x53160d[_0x8ede('0x11a')]==='agent'){_0x398341[_0x8ede('0x11b')]=this[_0x8ede('0x23')][_0x53160d[_0x8ede('0xbd')]][_0x8ede('0x11c')]&&this[_0x8ede('0x23')][_0x53160d['queue']][_0x8ede('0x11d')]?moment()[_0x8ede('0x81')](_0x8ede('0x108')):undefined;}this[_0x8ede('0xd7')](_0x398341)['catch'](loggerCatch(_0x8ede('0x11e')));this[_0x8ede('0xd5')](_0x398341)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x11f')));}}};Dialer[_0x8ede('0x1f')]['syncAgentConnect']=function(_0x3543b9){if(this[_0x8ede('0x23')][_0x3543b9[_0x8ede('0xbd')]]){if(this[_0x8ede('0x2b')][_0x3543b9[_0x8ede('0xea')]]&&this[_0x8ede('0x2b')][_0x3543b9[_0x8ede('0xea')]][_0x8ede('0x54')]!==_0x8ede('0x9d')){this[_0x8ede('0xbc')](this[_0x8ede('0x23')][_0x3543b9[_0x8ede('0xbd')]]);this[_0x8ede('0x2b')][_0x3543b9[_0x8ede('0xea')]][_0x8ede('0x120')]=moment()[_0x8ede('0x81')](_0x8ede('0x108'));}}};Dialer[_0x8ede('0x1f')][_0x8ede('0x121')]=function(_0x2a1474){this[_0x8ede('0xd7')](_0x2a1474)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x11e')));this[_0x8ede('0xd5')](_0x2a1474)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x122')));};Dialer[_0x8ede('0x1f')][_0x8ede('0x34')]=function(_0x5482b1){var _0x28710b=this[_0x8ede('0x2b')][_0x5482b1['uniqueid']];var _0x45394c=this;if(this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]]){if(_0x28710b&&_0x28710b[_0x8ede('0x54')]!==_0x8ede('0x9d')){delete this[_0x8ede('0x2b')][_0x5482b1[_0x8ede('0xea')]];this['updateOriginated'](this['voiceQueues'][_0x5482b1[_0x8ede('0xbd')]]);_0x28710b[_0x8ede('0x123')]=moment()['format'](_0x8ede('0x108'));var _0x1545b6=new QueueCallerAbandon(_0x28710b,_0x5482b1);if(getSeconds(_0x28710b[_0x8ede('0x123')],_0x28710b['responsetime'])>=_0x28710b[_0x8ede('0x124')]){this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]][_0x8ede('0x8a')]+=0x1;this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]][_0x8ede('0x6d')]+=0x1;this['voiceQueues'][_0x5482b1[_0x8ede('0xbd')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1545b6['state']=0xa;_0x1545b6[_0x8ede('0xb4')]=_0x8ede('0x125');_0x1545b6[_0x8ede('0x126')]=_0x8ede('0x127');_0x1545b6[_0x8ede('0x11b')]=this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]]['dialQueueProject2']?moment()[_0x8ede('0x81')](_0x8ede('0x108')):undefined;_0x1545b6[_0x8ede('0xff')]+=0x1;_0x1545b6[_0x8ede('0x10e')]+=0x1;if(_0x1545b6[_0x8ede('0xff')]>=this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]][_0x8ede('0x128')]){this['queueCallerAbandonCreateState'](_0x1545b6);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1545b6['countdropretry'],'scheduledat':moment()['add'](this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]][_0x8ede('0x129')],'minutes')[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x28710b[_0x8ede('0xdf')],'ListId':_0x28710b[_0x8ede('0x109')],'VoiceQueueId':_0x28710b[_0x8ede('0xe1')]||undefined,'CampaignId':_0x28710b[_0x8ede('0xe2')]||undefined})['catch'](loggerCatch(_0x8ede('0x12a')));var _0xb5cd59=new History(_0x1545b6);_0xb5cd59['state']=0xa;_0xb5cd59[_0x8ede('0xb4')]=_0x8ede('0x125');_0xb5cd59[_0x8ede('0xb6')]=moment()[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss');_0xb5cd59[_0x8ede('0xb5')]=_0xb5cd59['starttime'];_0xb5cd59[_0x8ede('0x12b')]=_0x1545b6['calleridname'];_0xb5cd59[_0x8ede('0x12c')]=_0x1545b6[_0x8ede('0x12c')];this['createHistory'](_0xb5cd59)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x5482b1[_0x8ede('0xbd')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1545b6[_0x8ede('0xf1')]=0xb;_0x1545b6[_0x8ede('0xb4')]=_0x8ede('0x12d');_0x1545b6[_0x8ede('0x126')]=_0x8ede('0x12e');_0x1545b6['countabandonedretry']+=0x1;_0x1545b6[_0x8ede('0x10e')]+=0x1;if(_0x1545b6[_0x8ede('0x100')]>=this['voiceQueues'][_0x5482b1[_0x8ede('0xbd')]][_0x8ede('0x12f')]){this[_0x8ede('0x121')](_0x1545b6);}else{this[_0x8ede('0xca')]({'active':![],'countabandonedretry':_0x1545b6[_0x8ede('0x100')],'scheduledat':moment()[_0x8ede('0x110')](this[_0x8ede('0x23')][_0x5482b1[_0x8ede('0xbd')]][_0x8ede('0x130')],_0x8ede('0x131'))['format'](_0x8ede('0x108')),'ContactId':_0x28710b[_0x8ede('0xdf')],'ListId':_0x28710b[_0x8ede('0x109')],'VoiceQueueId':_0x28710b[_0x8ede('0xe1')]||undefined,'CampaignId':_0x28710b['CampaignId']||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x132')));var _0xb5cd59=new History(_0x1545b6);_0xb5cd59['state']=0xb;_0xb5cd59[_0x8ede('0xb4')]=_0x8ede('0x12d');_0xb5cd59[_0x8ede('0xb6')]=moment()['format'](_0x8ede('0x108'));_0xb5cd59['endtime']=_0xb5cd59[_0x8ede('0xb6')];_0xb5cd59[_0x8ede('0x12b')]=_0x1545b6[_0x8ede('0x12b')];_0xb5cd59[_0x8ede('0x12c')]=_0x1545b6['calleridnum'];this[_0x8ede('0xd7')](_0xb5cd59)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x133')));}}}}};Dialer[_0x8ede('0x1f')][_0x8ede('0x3c')]=function(_0x297964){if(this[_0x8ede('0x29')][_0x297964[_0x8ede('0xea')]]){this[_0x8ede('0x29')][_0x297964[_0x8ede('0xea')]][_0x8ede('0x134')]=_0x297964[_0x8ede('0x134')];}if(this[_0x8ede('0x2b')][_0x297964[_0x8ede('0xea')]]){this[_0x8ede('0x2b')][_0x297964['uniqueid']][_0x8ede('0x134')]=_0x297964[_0x8ede('0x134')];}};Dialer[_0x8ede('0x1f')][_0x8ede('0x3f')]=function(_0x12427c){if(strategy[this[_0x8ede('0x23')][this[_0x8ede('0x29')][_0x12427c[_0x8ede('0x135')]][_0x8ede('0xbd')]]['strategy']]===_0x8ede('0x1e')){if(this[_0x8ede('0x29')][_0x12427c['actionid']]&&_['isNil'](this[_0x8ede('0x29')][_0x12427c['actionid']][_0x8ede('0x136')])&&_0x12427c[_0x8ede('0xba')]==='1'&&_0x12427c[_0x8ede('0x137')]==='0'){if(this[_0x8ede('0x25')][_0x12427c['stateinterface']]){if(!this[_0x8ede('0x25')][_0x12427c[_0x8ede('0x138')]][_0x8ede('0x136')]){this[_0x8ede('0x25')][_0x12427c[_0x8ede('0x138')]][_0x8ede('0x136')]=!![];this[_0x8ede('0x29')][_0x12427c[_0x8ede('0x135')]][_0x8ede('0x136')]=!![];this[_0x8ede('0x29')][_0x12427c['actionid']][_0x8ede('0x138')]=_0x12427c[_0x8ede('0x138')];}}}}else if((strategy[this['voiceQueues'][this[_0x8ede('0x29')][_0x12427c[_0x8ede('0x135')]][_0x8ede('0xbd')]]['strategy']]||'rrmemory')===_0x8ede('0x1d')){if(this[_0x8ede('0x29')][_0x12427c[_0x8ede('0x135')]]){if(this['agents'][_0x12427c[_0x8ede('0x138')]]){this[_0x8ede('0x29')][_0x12427c[_0x8ede('0x135')]][_0x8ede('0x138')]=_0x12427c['stateinterface'];if(_[_0x8ede('0xeb')](this[_0x8ede('0x2f')][this[_0x8ede('0x29')][_0x12427c['actionid']]['queue']])){this[_0x8ede('0x2f')][this[_0x8ede('0x29')][_0x12427c[_0x8ede('0x135')]][_0x8ede('0xbd')]]=[];}this[_0x8ede('0x2f')][this['actions'][_0x12427c[_0x8ede('0x135')]][_0x8ede('0xbd')]][_0x8ede('0x139')](_[_0x8ede('0xde')](_[_0x8ede('0x13a')](this['actions'][_0x12427c['actionid']],[_0x8ede('0x13b'),_0x8ede('0x138')]),{'status':_0x12427c[_0x8ede('0xba')],'paused':_0x12427c[_0x8ede('0x137')]}));}}}};function unlockQueueStatus(_0x3646dd,_0x4e6a93){setTimeout(function(){if(_['isUndefined'](_0x3646dd[_0x8ede('0x13c')])){loggerBooked['error'](_0x8ede('0x13d'),_0x4e6a93);}_0x3646dd['queueStatusComplete']=!![];loggerBooked['info'](_0x8ede('0x13e'),_0x4e6a93,JSON[_0x8ede('0x51')](_[_0x8ede('0x13a')](_0x3646dd,[_0x8ede('0x4b'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0x8ede('0x13f')]=function(_0x1bac52){var _0x2e5709=this;var _0x448d20=_0x2e5709[_0x8ede('0x23')][_0x2e5709[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0xbd')]];if(strategy[this[_0x8ede('0x23')][this[_0x8ede('0x29')][_0x1bac52['actionid']][_0x8ede('0xbd')]][_0x8ede('0x56')]]===_0x8ede('0x1e')){if(this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]]&&this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0x138')]){this[_0x8ede('0x9c')][_0x8ede('0x140')](this['actions'][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0x13b')],this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0x138')])['catch'](function(_0x1b52bc){logger[_0x8ede('0xa1')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x1b52bc,{'showHidden':![],'depth':null}));})[_0x8ede('0x141')](function(){_0x2e5709[_0x8ede('0xbc')](_0x2e5709[_0x8ede('0x23')][_0x2e5709[_0x8ede('0x29')][_0x1bac52['actionid']][_0x8ede('0xbd')]]);_0x2e5709[_0x8ede('0x25')][_0x2e5709[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]]['stateinterface']][_0x8ede('0x136')]=![];delete _0x2e5709[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]];unlockQueueStatus(_0x448d20);});}else{this['updateOriginated'](this[_0x8ede('0x23')][this['actions'][_0x1bac52['actionid']][_0x8ede('0xbd')]]);this[_0x8ede('0xca')]({'active':![],'ContactId':this['actions'][_0x1bac52['actionid']][_0x8ede('0xdf')],'ListId':this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]]['ListId'],'VoiceQueueId':this[_0x8ede('0x29')][_0x1bac52['actionid']][_0x8ede('0xe1')]||undefined,'CampaignId':this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x1bac52[_0x8ede('0x135')]];unlockQueueStatus(_0x448d20);}}else if((strategy[this['voiceQueues'][this[_0x8ede('0x29')][_0x1bac52['actionid']][_0x8ede('0xbd')]][_0x8ede('0x56')]]||'rrmemory')===_0x8ede('0x1d')){var _0x33d76b;if(this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]]&&!_[_0x8ede('0x4e')](this[_0x8ede('0x2f')][this['actions'][_0x1bac52['actionid']][_0x8ede('0xbd')]])){if(this['queueBookedRR'][_0x2e5709[_0x8ede('0x29')][_0x1bac52['actionid']]['queue']]){this[_0x8ede('0x30')][_0x2e5709['actions'][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0xbd')]]=this[_0x8ede('0x30')][this[_0x8ede('0x29')][_0x1bac52['actionid']]['queue']]?this['queueBookedRR'][this['actions'][_0x1bac52[_0x8ede('0x135')]]['queue']]:this[_0x8ede('0x2f')][this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]]['queue']]?this[_0x8ede('0x2f')][this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0xbd')]]['_rr']||0x0:0x0;}this[_0x8ede('0x2f')][this[_0x8ede('0x29')][_0x1bac52['actionid']][_0x8ede('0xbd')]][_0x8ede('0x142')]=this[_0x8ede('0x30')][this[_0x8ede('0x29')][_0x1bac52[_0x8ede('0x135')]][_0x8ede('0xbd')]];for(var _0x29c50f=0x0;_0x29c50f=0x0;})[_0x8ede('0xbb')](myreject(_0x5bd3a8)));}}else{_0x4c439e['push'](ami[_0x8ede('0x15f')]({'action':_0x8ede('0x160'),'command':util[_0x8ede('0x81')](_0x8ede('0x161'),_0x58f96c,!_[_0x8ede('0x43')](config[_0x8ede('0x15c')][_0x160dc1])?_0x160dc1:'')})[_0x8ede('0xc1')](function(_0x40be58){return _0x40be58[_0x8ede('0x163')]['indexOf'](_0x8ede('0x164'))>=0x0;})[_0x8ede('0xbb')](myreject(_0x5bd3a8)));}BPromise['all'](_0x4c439e)[_0x8ede('0xc1')](function(_0x3d7dc3){var _0x56950a=_[_0x8ede('0x165')](_0x3d7dc3);if(_0x56950a){return _0x2ea6f5(_0x56950a);}else{_0x2164ed[_0x8ede('0x46')]=_0x448b5e?_0x8ede('0x166'):'INTERVAL_IS_OVERTIME';return _0x5bd3a8(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x448b5e+'\x20'+_0x245210+_0x8ede('0x167')+util[_0x8ede('0xa2')](_0x58f96c,{'showHidden':![],'depth':null})+_0x8ede('0x168')+_0x160dc1));}})['catch'](function(_0x3e0048){return _0x5bd3a8(msgResponse(_0x8ede('0x156'),_0x8ede('0x15a'),JSON['stringify'](_0x3e0048)));});});};Dialer['prototype'][_0x8ede('0x169')]=function(_0x508397){var _0x2236a6=this;return function(){switch(_0x508397['dialMethod']){case _0x8ede('0x16a'):freeVariablesPredictive(_0x508397);_0x2236a6[_0x8ede('0x16b')](_0x508397,0x1);break;case _0x8ede('0x16c'):freeVariablesPredictive(_0x508397);_0x2236a6['handlePower'](_0x508397,_0x508397[_0x8ede('0x16d')]);break;case _0x8ede('0x9'):_0x2236a6['predictive'](_0x508397);break;case'booked':freeVariablesPredictive(_0x508397);_0x2236a6[_0x8ede('0x16b')](_0x508397,0x1);break;default:freeVariablesPredictive(_0x508397);logger[_0x8ede('0xa1')](_0x8ede('0x16e'),_0x508397['name'],_0x8ede('0x16f'));}};};Dialer['prototype'][_0x8ede('0x170')]=function(_0x215e6){var _0x1af0be=this;return function(){_0x1af0be['handleIvr'](_0x215e6);};};Dialer[_0x8ede('0x1f')][_0x8ede('0xb')]=function(_0x1c0beb){var _0x3575a7=this;if(isNotPreview(_0x1c0beb[_0x8ede('0x63')])){if(isVoiceQueueOutbound(_0x1c0beb[_0x8ede('0x54')])&&isActive(_0x1c0beb[_0x8ede('0x62')])){_0x1c0beb[_0x8ede('0xae')]=!![];BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](checkIsLoggedIn(_0x1c0beb,_0x1c0beb[_0x8ede('0x59')]))[_0x8ede('0xc1')](checkIsActive(_0x1c0beb,_0x1c0beb[_0x8ede('0x62')]))[_0x8ede('0xc1')](checkInterval(_0x1c0beb))[_0x8ede('0xc1')](_0x3575a7[_0x8ede('0x151')](_0x1c0beb))[_0x8ede('0xc1')](_0x3575a7[_0x8ede('0x155')](_0x1c0beb[_0x8ede('0x171')],_0x1c0beb[_0x8ede('0x172')],_0x1c0beb[_0x8ede('0x4b')],_0x1c0beb))[_0x8ede('0xc1')](_0x3575a7[_0x8ede('0x157')](_0x1c0beb[_0x8ede('0x49')],_0x1c0beb[_0x8ede('0x172')],_0x1c0beb[_0x8ede('0x4b')],_0x1c0beb))[_0x8ede('0xc1')](_0x3575a7[_0x8ede('0x169')](_0x1c0beb))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x1c0beb));}else{notSendMessagesQueue(_0x1c0beb);}}else{freeVariablesPredictive(_0x1c0beb);}};Dialer[_0x8ede('0x1f')][_0x8ede('0x150')]=function(){var _0x1d1e65=this;var _0x24744c;for(var _0x276383 in this[_0x8ede('0x24')]){if(typeof this[_0x8ede('0x24')][_0x276383]!==_0x8ede('0xd9')){_0x24744c=this[_0x8ede('0x24')][_0x276383];if(isCampaignIvr(_0x24744c[_0x8ede('0x54')])&&isActive(_0x24744c[_0x8ede('0x7f')])){_0x24744c[_0x8ede('0xae')]=!![];BPromise[_0x8ede('0xc0')]()[_0x8ede('0xc1')](checkIsActive(_0x24744c,_0x24744c[_0x8ede('0x7f')]))[_0x8ede('0xc1')](checkInterval(_0x24744c))[_0x8ede('0xc1')](_0x1d1e65[_0x8ede('0x151')](_0x24744c))['then'](_0x1d1e65[_0x8ede('0x155')](_0x24744c[_0x8ede('0x171')],_0x24744c[_0x8ede('0x172')],_0x24744c[_0x8ede('0x4b')],_0x24744c))['then'](_0x1d1e65[_0x8ede('0x157')](_0x24744c[_0x8ede('0x49')],_0x24744c[_0x8ede('0x172')],_0x24744c[_0x8ede('0x4b')],_0x24744c))[_0x8ede('0xc1')](_0x1d1e65[_0x8ede('0x170')](_0x24744c))['catch'](loggerCatchQueueSummary(_0x8ede('0x173'),_0x24744c));}else{notSendMessagesCampaign(_0x24744c);}}}};function getCallerIdRandom(_0xcdc259,_0x294159){var _0x3e22fe;var _0x28b5e0;var _0x3d0dbd;if(_0x294159<=0x0){_0x294159=0x1;}_0x3e22fe=new RegExp(_0x8ede('0x174')+_0x294159+'}$');_0x28b5e0=Math[_0x8ede('0x175')](0xa,_0x294159-0x1);_0x3d0dbd=Math[_0x8ede('0x175')](0xa,_0x294159)-0x1;return util[_0x8ede('0x81')]('%s',_[_0x8ede('0x176')](_0xcdc259,_0x3e22fe,_[_0x8ede('0x177')](_0x28b5e0,_0x3d0dbd)));}function extractCalleridName(_0x41f1fd){var _0x586915=_0x41f1fd['match'](/"(.*?)"/);return _0x586915?_0x586915[0x1]:_0x41f1fd;}function extractCalleridNumber(_0x3329ec){var _0x4bdb57=_0x3329ec[_0x8ede('0x178')](/<(.*?)>/);return _0x4bdb57?_0x4bdb57[0x1]:_0x3329ec;}Dialer[_0x8ede('0x1f')][_0x8ede('0x179')]=function(_0x2f7125,_0x325412){var _0x3af651=this;var _0x499ac8=uuid['v4']();this[_0x8ede('0x29')][_0x499ac8]=new Action(_0x2f7125,_0x325412,_0x499ac8);return new BPromise(function(_0x114370,_0x573b8b){if(_['isUndefined'](_0x2f7125)&&typeof _0x2f7125!==_0x8ede('0x17a')){return _0x573b8b(msgResponse(_0x8ede('0x17b'),_0x8ede('0x15a'),_0x8ede('0x17c')));}if(_['isUndefined'](_0x325412['Contact'][_0x8ede('0x17d')])||_0x325412[_0x8ede('0x17e')][_0x8ede('0x17d')]===null){return _0x573b8b(msgResponse(_0x8ede('0x17b'),'Failure',_0x8ede('0x17f')));}var _0x1ed9a6={'XMD-CALLERID':_0x3af651[_0x8ede('0x29')][_0x499ac8][_0x8ede('0x180')](),'XMD-AGI':_0x2f7125[_0x8ede('0x115')]?util['format'](_0x8ede('0x181'),ipAgi,_0x2f7125[_0x8ede('0x115')]):'NONE','XMD-AGIAFTER':_0x2f7125[_0x8ede('0x11c')]?util[_0x8ede('0x81')](_0x8ede('0x181'),ipAgi,_0x2f7125[_0x8ede('0x11c')]):_0x8ede('0x182'),'XMD-QUEUE':_0x2f7125[_0x8ede('0x54')]==='outbound'?util[_0x8ede('0x81')]('\x22%s,%s%s,,,%s\x22',_0x2f7125[_0x8ede('0x4b')],_0x2f7125[_0x8ede('0x183')]||'',_0x2f7125[_0x8ede('0x11d')]?'c':'',_0x2f7125['dialQueueTimeout']||0x3):_0x8ede('0x182'),'XMD-CONTACTID':_0x325412['ContactId'],'XMD-CDRTYPE':_0x8ede('0x6'),'CALLERID(all)':_0x3af651[_0x8ede('0x29')][_0x499ac8]['getCaller'](),'XMD-AMD':_0x2f7125['dialAMDActive']?_0x8ede('0x184'):_0x8ede('0x182'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x2f7125[_0x8ede('0x10a')]){_0x1ed9a6[_0x8ede('0x185')]=_0x2f7125[_0x8ede('0x186')]||0x9c4;_0x1ed9a6[_0x8ede('0x187')]=_0x2f7125[_0x8ede('0x188')]||0x5dc;_0x1ed9a6[_0x8ede('0x189')]=_0x2f7125[_0x8ede('0x18a')]||0x320;_0x1ed9a6[_0x8ede('0x18b')]=_0x2f7125['dialAMDTotalAnalysisTime']||0x1388;_0x1ed9a6['XMD-AMDMINWORDLENGTH']=_0x2f7125[_0x8ede('0x18c')]||0x64;_0x1ed9a6[_0x8ede('0x18d')]=_0x2f7125[_0x8ede('0x18e')]||0x32;_0x1ed9a6[_0x8ede('0x18f')]=_0x2f7125[_0x8ede('0x190')]||0x3;_0x1ed9a6['XMD-AMDSILENCETHRESHOLD']=_0x2f7125[_0x8ede('0x191')]||0x100;_0x1ed9a6[_0x8ede('0x192')]=_0x2f7125[_0x8ede('0x193')]||0x1388;}if(_0x2f7125[_0x8ede('0x54')]==='outbound'){_0x1ed9a6[_0x8ede('0x194')]=_0x325412[_0x8ede('0xe1')];}else{_0x1ed9a6[_0x8ede('0x195')]=_0x325412[_0x8ede('0xe2')];}for(var _0x673390 in _0x325412['Contact']){if(typeof _0x325412[_0x8ede('0x17e')][_0x673390]!==_0x8ede('0xd9')){if(isNotNull(_0x325412[_0x8ede('0x17e')][_0x673390])&&_0x673390!=='id'&&_0x673390!=='tags'&&_0x673390!==_0x8ede('0x196')&&_0x673390!==_0x8ede('0x197')){_0x1ed9a6[util['format'](_0x8ede('0x198'),'XMD-',_['toUpper'](_0x673390))]=_0x325412[_0x8ede('0x17e')][_0x673390];}}}var _0x118fe6=_0x3af651[_0x8ede('0xe6')](_0x2f7125[_0x8ede('0x7e')])?getCallerId(_0x2f7125[_0x8ede('0x7e')][_0x8ede('0x80')],_0x2f7125[_0x8ede('0x64')],_0x2f7125[_0x8ede('0x199')]>0x0?getCallerIdRandom(_0x2f7125[_0x8ede('0x65')],_0x2f7125[_0x8ede('0x199')]):_0x2f7125[_0x8ede('0x65')]):getCallerId(_[_0x8ede('0xeb')](_0x2f7125['TrunkBackup'])?_0x2f7125[_0x8ede('0x7e')][_0x8ede('0x80')]:_0x2f7125[_0x8ede('0x152')][_0x8ede('0x80')],_0x2f7125['dialOriginateCallerIdName'],_0x2f7125[_0x8ede('0x199')]>0x0?getCallerIdRandom(_0x2f7125[_0x8ede('0x65')],_0x2f7125[_0x8ede('0x199')]):_0x2f7125[_0x8ede('0x65')]);if(_0x118fe6){_0x1ed9a6['XMD-ORIGINATECALLERIDNAME']=_0x3af651[_0x8ede('0x29')][_0x499ac8][_0x8ede('0x19a')]=extractCalleridName(_0x118fe6);_0x1ed9a6[_0x8ede('0x19b')]=_0x3af651['actions'][_0x499ac8][_0x8ede('0x19c')]=extractCalleridNumber(_0x118fe6);}return ami[_0x8ede('0x15f')]({'actionid':_0x499ac8,'action':'originate','channel':_0x3af651[_0x8ede('0xe6')](_0x2f7125['Trunk'])?util[_0x8ede('0x81')](_0x8ede('0x19d'),_0x2f7125[_0x8ede('0x7e')][_0x8ede('0x4b')],isNotNull(_0x2f7125[_0x8ede('0x66')])?_0x2f7125[_0x8ede('0x66')][_0x8ede('0x19e')]()||'':'',_0x2f7125[_0x8ede('0x19f')]>0x0?_0x325412[_0x8ede('0x17e')][_0x8ede('0x17d')][_0x8ede('0x1a0')](_0x2f7125[_0x8ede('0x19f')]):_0x325412[_0x8ede('0x17e')][_0x8ede('0x17d')]):util['format'](_0x8ede('0x19d'),_[_0x8ede('0xeb')](_0x2f7125['TrunkBackup'])?_0x2f7125[_0x8ede('0x7e')]['name']:_0x2f7125[_0x8ede('0x152')]['name'],isNotNull(_0x2f7125[_0x8ede('0x66')])?_0x2f7125[_0x8ede('0x66')][_0x8ede('0x19e')]()||'':'',_0x2f7125[_0x8ede('0x19f')]>0x0?_0x325412[_0x8ede('0x17e')]['phone'][_0x8ede('0x1a0')](_0x2f7125[_0x8ede('0x19f')]):_0x325412[_0x8ede('0x17e')][_0x8ede('0x17d')]),'callerid':_0x118fe6,'Exten':_0x8ede('0xef'),'Context':_0x8ede('0x1a1'),'Priority':'1','variable':_0x1ed9a6,'timeout':(_0x2f7125[_0x8ede('0x1a2')]||0x1e)*0x3e8,'async':!![],'channelid':_0x499ac8})[_0x8ede('0xc1')](function(_0x736832){return _0x114370(_0x736832);})[_0x8ede('0xbb')](function(_0x4cecb6){_0x2f7125[_0x8ede('0x70')]+=0x1;var _0x340d58=new History(_0x3af651[_0x8ede('0x29')][_0x499ac8]);logger[_0x8ede('0xa1')](util['format']('[originateError]:\x20%s',JSON[_0x8ede('0x51')](_0x4cecb6)));_0x340d58[_0x8ede('0xf1')]=0xe;_0x340d58['statedesc']=_0x8ede('0x1a3');_0x340d58[_0x8ede('0xb6')]=moment()[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss');_0x340d58[_0x8ede('0xb5')]=_0x340d58[_0x8ede('0xb6')];_0x3af651['createHistory'](_0x340d58)[_0x8ede('0xbb')](loggerCatch('[originate][error]'));_0x3af651[_0x8ede('0xd5')](_0x340d58)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1a4')))['finally'](function(){delete _0x3af651[_0x8ede('0x29')][_0x499ac8];return _0x573b8b(msgResponse(_0x8ede('0x17b'),_0x8ede('0x50'),_0x8ede('0x1a5')));});});});};Dialer[_0x8ede('0x1f')]['syncOriginateResponse']=function(_0x1c6e5){var _0x4028b0=this[_0x8ede('0x29')][_0x1c6e5['actionid']];if(_0x4028b0){delete this['actions'][_0x1c6e5[_0x8ede('0x135')]];_0x4028b0[_0x8ede('0x1a6')]=moment()[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss');var _0x28574e=_0x4028b0[_0x8ede('0x54')]===_0x8ede('0x9d')?this[_0x8ede('0x24')][_0x4028b0[_0x8ede('0xbd')]]:this[_0x8ede('0x23')][_0x4028b0['getQueue']()];if(!this[_0x8ede('0xe5')](_0x1c6e5[_0x8ede('0x1a7')])){this[_0x8ede('0xbc')](_0x28574e);return this[_0x8ede('0x1a8')](_0x4028b0,_0x28574e,_0x1c6e5)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1a9')));}this[_0x8ede('0x2b')][_0x1c6e5['uniqueid']]=_0x4028b0;}};Dialer['prototype'][_0x8ede('0x1aa')]=function(_0x5c05d2,_0x1841f2,_0x177c90){var _0x13ddca=new History(_0x1841f2);if(_0x13ddca['countbusyretry']+_0x13ddca[_0x8ede('0xfd')]+_0x13ddca[_0x8ede('0xfe')]+_0x13ddca[_0x8ede('0x1ab')]+_0x13ddca[_0x8ede('0xff')]+_0x13ddca['countabandonedretry']+_0x13ddca[_0x8ede('0xfa')]+_0x13ddca[_0x8ede('0x101')]>=_0x177c90[_0x8ede('0x10f')]-0x1){return!![];}switch(_0x5c05d2){case 0x3:if(_0x13ddca[_0x8ede('0xfe')]>=_0x177c90[_0x8ede('0x1ac')]-0x1){return!![];}this[_0x8ede('0xca')]({'active':![],'countnoanswerretry':_0x13ddca[_0x8ede('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x177c90['dialNoAnswerRetryFrequency'],_0x8ede('0x131'))[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca[_0x8ede('0x109')],'VoiceQueueId':_0x13ddca[_0x8ede('0xe1')]||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1ad')));break;case 0x5:if(_0x13ddca[_0x8ede('0xfc')]>=_0x177c90[_0x8ede('0x1ae')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x13ddca[_0x8ede('0xfc')]+=0x1,'scheduledat':moment()['add'](_0x177c90[_0x8ede('0x1af')],_0x8ede('0x131'))[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca[_0x8ede('0x109')],'VoiceQueueId':_0x13ddca['VoiceQueueId']||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x13ddca['countcongestionretry']>=_0x177c90[_0x8ede('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x13ddca['countcongestionretry']+=0x1,'scheduledat':moment()[_0x8ede('0x110')](_0x177c90[_0x8ede('0x1b1')],_0x8ede('0x131'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca['ListId'],'VoiceQueueId':_0x13ddca[_0x8ede('0xe1')]||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1b2')));break;case 0x0:if(_0x13ddca[_0x8ede('0x1ab')]>=_0x177c90[_0x8ede('0x1b3')]-0x1){return!![];}else{this[_0x8ede('0xca')]({'active':![],'countnosuchnumberretry':_0x13ddca['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x177c90['dialNoSuchNumberRetryFrequency'],_0x8ede('0x131'))[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca[_0x8ede('0x109')],'VoiceQueueId':_0x13ddca[_0x8ede('0xe1')]||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1b4')));}break;case 0xa:if(_0x13ddca[_0x8ede('0xff')]>=_0x177c90[_0x8ede('0x128')]-0x1){return!![];}this[_0x8ede('0xca')]({'active':![],'countdropretry':_0x13ddca[_0x8ede('0xff')]+=0x1,'scheduledat':moment()[_0x8ede('0x110')](_0x177c90[_0x8ede('0x129')],'minutes')[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca[_0x8ede('0x109')],'VoiceQueueId':_0x13ddca['VoiceQueueId']||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x12a')));break;case 0xb:if(_0x13ddca[_0x8ede('0x100')]>=_0x177c90[_0x8ede('0x12f')]-0x1){return!![];}this[_0x8ede('0xca')]({'active':![],'countabandonedretry':_0x13ddca[_0x8ede('0x100')]+=0x1,'scheduledat':moment()['add'](_0x177c90[_0x8ede('0x130')],'minutes')[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca[_0x8ede('0x109')],'VoiceQueueId':_0x13ddca[_0x8ede('0xe1')]||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x132')));break;case 0x13:if(_0x13ddca[_0x8ede('0xfa')]>=_0x177c90['dialMachineMaxRetry']-0x1){return!![];}this[_0x8ede('0xca')]({'active':![],'countmachineretry':_0x13ddca['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x177c90[_0x8ede('0x107')],_0x8ede('0x131'))[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca[_0x8ede('0x109')],'VoiceQueueId':_0x13ddca[_0x8ede('0xe1')]||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})['catch'](loggerCatch(_0x8ede('0x111')));break;case 0x14:if(_0x13ddca[_0x8ede('0x101')]>=_0x177c90[_0x8ede('0x1b5')]-0x1){return!![];}this[_0x8ede('0xca')]({'active':![],'countagentrejectretry':_0x13ddca[_0x8ede('0x101')]+=0x1,'scheduledat':moment()[_0x8ede('0x110')](_0x177c90['dialAgentRejectRetryFrequency'],_0x8ede('0x131'))[_0x8ede('0x81')](_0x8ede('0x108')),'ContactId':_0x13ddca[_0x8ede('0xdf')],'ListId':_0x13ddca['ListId'],'VoiceQueueId':_0x13ddca['VoiceQueueId']||undefined,'CampaignId':_0x13ddca[_0x8ede('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x8ede('0x1a8')]=function(_0x13fd81,_0x3588b2,_0x1197e6){var _0x36321e=this;var _0x1a8a0d=new History(_0x13fd81);return new BPromise(function(_0x3b1d4c,_0xba720e){if(_['isUndefined'](_0x3588b2)&&typeof _0x3588b2!=='object'){return _0xba720e(msgResponse(_0x8ede('0x1b6'),_0x8ede('0x15a'),_0x8ede('0x1b7')));}if(_['isUndefined'](_0x1197e6)&&typeof _0x1197e6!==_0x8ede('0x17a')){return _0xba720e(msgResponse(_0x8ede('0x1b6'),_0x8ede('0x15a'),'evt\x20is\x20undefine'));}switch(_0x1197e6[_0x8ede('0x11a')]){case'0':_0x3588b2[_0x8ede('0x6f')]+=0x1;_0x1a8a0d['state']=0x0;_0x1a8a0d[_0x8ede('0xb4')]='NoSuchNumber';_0x1a8a0d[_0x8ede('0x1ab')]+=0x1;_0x1a8a0d[_0x8ede('0x10e')]+=0x1;ami[_0x8ede('0x53')](_0x8ede('0x1b8'),ut[_0x8ede('0x10c')](_0x13fd81,'nosuchnumber'));_0x36321e['createHistory'](_0x1a8a0d)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xfb')));if(_0x36321e[_0x8ede('0x1aa')](0x0,_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0x1ab')]>=_0x3588b2[_0x8ede('0x1b3')]){_0x36321e[_0x8ede('0x105')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1b9'));}else{_0x36321e['stateGlobal'](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1b9'));}}break;case'3':_0x3588b2[_0x8ede('0x6e')]+=0x1;_0x1a8a0d['state']=0x3;_0x1a8a0d[_0x8ede('0xb4')]=_0x8ede('0x1ba');_0x1a8a0d[_0x8ede('0xfe')]+=0x1;_0x1a8a0d[_0x8ede('0x10e')]+=0x1;ami['emit'](_0x8ede('0x1bb'),ut[_0x8ede('0x10c')](_0x13fd81,_0x8ede('0x1bc')));_0x36321e[_0x8ede('0xd7')](_0x1a8a0d)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1bd')));if(_0x36321e[_0x8ede('0x1aa')](0x3,_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0xfe')]>=_0x3588b2['dialNoAnswerMaxRetry']){_0x36321e[_0x8ede('0x105')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1be'));}else{_0x36321e[_0x8ede('0x102')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1be'));}}break;case'5':_0x3588b2[_0x8ede('0x69')]+=0x1;_0x1a8a0d[_0x8ede('0xf1')]=0x5;_0x1a8a0d[_0x8ede('0xb4')]=_0x8ede('0x1bf');_0x1a8a0d[_0x8ede('0xfc')]+=0x1;_0x1a8a0d[_0x8ede('0x10e')]+=0x1;ami['emit'](_0x8ede('0x1c0'),ut[_0x8ede('0x10c')](_0x13fd81,_0x8ede('0x1c1')));_0x36321e[_0x8ede('0xd7')](_0x1a8a0d)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1c2')));if(_0x36321e[_0x8ede('0x1aa')](0x5,_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0xfc')]>=_0x3588b2[_0x8ede('0x1ae')]){_0x36321e[_0x8ede('0x105')](_0x1a8a0d,_0x3b1d4c,_0xba720e,'reason\x205\x20busy');}else{_0x36321e[_0x8ede('0x102')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1c3'));}}break;case'8':_0x3588b2[_0x8ede('0x6a')]+=0x1;_0x1a8a0d[_0x8ede('0xf1')]=0x8;_0x1a8a0d[_0x8ede('0xb4')]=_0x8ede('0x1c4');_0x1a8a0d['countcongestionretry']+=0x1;_0x1a8a0d['countglobal']+=0x1;ami[_0x8ede('0x53')](_0x8ede('0x1c5'),ut[_0x8ede('0x10c')](_0x13fd81,_0x8ede('0x1c6')));_0x36321e[_0x8ede('0xd7')](_0x1a8a0d)['catch'](loggerCatch(_0x8ede('0x1c7')));if(_0x36321e[_0x8ede('0x1aa')](0x8,_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0xfd')]>=_0x3588b2[_0x8ede('0x1b0')]){_0x36321e[_0x8ede('0x105')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1c8'));}else{_0x36321e['stateGlobal'](_0x1a8a0d,_0x3b1d4c,_0xba720e,'reason\x208\x20congestion');}}break;case'11':_0x3588b2['outboundAbandonedCallsDay']+=0x1;_0x1a8a0d['state']=0xb;_0x1a8a0d['statedesc']=_0x8ede('0x12d');_0x1a8a0d['countabandonedretry']+=0x1;_0x1a8a0d[_0x8ede('0x10e')]+=0x1;_0x36321e[_0x8ede('0xd7')](_0x1a8a0d)['catch'](loggerCatch(_0x8ede('0x133')));if(_0x36321e[_0x8ede('0x1aa')](0xb,_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0x100')]>=_0x3588b2['dialAbandonedMaxRetry']){_0x36321e['createStateFinal'](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1c9'));}else{_0x36321e[_0x8ede('0x102')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1c9'));}}break;case'20':_0x3588b2[_0x8ede('0x72')]+=0x1;_0x1a8a0d['state']=0x14;_0x1a8a0d['statedesc']=_0x8ede('0x1ca');_0x1a8a0d[_0x8ede('0x101')]+=0x1;_0x1a8a0d[_0x8ede('0x10e')]+=0x1;ami[_0x8ede('0x53')]('custom:agentreject',ut[_0x8ede('0x10c')](_0x13fd81,'agentreject'));_0x36321e[_0x8ede('0xd7')](_0x1a8a0d)[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1cb')));if(_0x36321e[_0x8ede('0x1aa')](0x14,_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0x101')]>=_0x3588b2[_0x8ede('0x1b5')]){_0x36321e[_0x8ede('0x105')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1cc'));}else{_0x36321e[_0x8ede('0x102')](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x8ede('0x1cc'));}}break;default:_0x3588b2[_0x8ede('0x73')]+=0x1;_0x1a8a0d[_0x8ede('0xf1')]=0xc;_0x1a8a0d['statedesc']=_0x1197e6[_0x8ede('0x11a')];_0x36321e['createHistory'](_0x1a8a0d)['catch'](loggerCatch(_0x8ede('0x1cd')));if(_0x36321e[_0x8ede('0x1aa')](_0x1197e6['reason'],_0x13fd81,_0x3588b2)){if(_0x1a8a0d[_0x8ede('0xfc')]+_0x1a8a0d[_0x8ede('0xfd')]+_0x1a8a0d[_0x8ede('0xfe')]+_0x1a8a0d[_0x8ede('0x1ab')]+_0x1a8a0d['countdropretry']+_0x1a8a0d[_0x8ede('0x100')]+_0x1a8a0d[_0x8ede('0xfa')]+_0x1a8a0d[_0x8ede('0x101')]>=_0x3588b2[_0x8ede('0x10f')]){_0x36321e['stateGlobal'](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x1197e6[_0x8ede('0x11a')]);}else{_0x36321e['createStateFinal'](_0x1a8a0d,_0x3b1d4c,_0xba720e,_0x1197e6[_0x8ede('0x11a')]);}}}});};Dialer[_0x8ede('0x1f')][_0x8ede('0x102')]=function(_0x4313bd,_0x17b0fd,_0x3e9211,_0x977a15){var _0xf48781=new Final(_0x4313bd);_0xf48781[_0x8ede('0xf1')]=0xf;_0xf48781[_0x8ede('0xb4')]=_0x8ede('0x1ce');this[_0x8ede('0x105')](_0xf48781,_0x17b0fd,_0x3e9211,_0x977a15);};Dialer[_0x8ede('0x1f')][_0x8ede('0x105')]=function(_0xb7af36,_0x3fe4fd,_0xcf6260,_0x417b3e){this['moveContactManagedDialer'](_0xb7af36)[_0x8ede('0xc1')](function(){return _0x3fe4fd(msgResponse(_0x8ede('0x1b6'),_0x8ede('0x1cf'),_0x417b3e));})['catch'](function(){return _0xcf6260(msgResponse(_0x8ede('0x1d0'),_0x8ede('0x15a'),_0x8ede('0x1d1')));});};Dialer[_0x8ede('0x1f')][_0x8ede('0x9')]=function(_0x2b0e43){var _0x4a5720=_0x2b0e43[_0x8ede('0x1d2')]/0x64;var _0x1ddccd=_0x2b0e43[_0x8ede('0x6d')]/(_0x2b0e43[_0x8ede('0x6d')]+_0x2b0e43[_0x8ede('0x68')]);var _0x3f4eed=Math[_0x8ede('0x1d3')](_0x2b0e43[_0x8ede('0x1d4')]*(_0x2b0e43[_0x8ede('0x1d5')]/0x64));var _0xf1f267=Math['round'](_0x2b0e43['predictiveIntervalAvailable']*(_0x2b0e43[_0x8ede('0x1d6')]/0x64));var _0x291e63=_0x2b0e43[_0x8ede('0x58')]+_0x2b0e43[_0x8ede('0x5d')];var _0x57caa0=Math[_0x8ede('0x1d7')](_0x2b0e43['erlangCalls']*_0x2b0e43['erlangAbandonmentRate']*_0x2b0e43[_0x8ede('0x78')]*_0x2b0e43['predictiveIntervalMultiplicativeFactor']);if(_[_0x8ede('0x43')](_0x2b0e43[_0x8ede('0x2e')])){if(!_[_0x8ede('0x43')](_0x2b0e43['startPredictive'])){_0x2b0e43['startPredictive']=undefined;loggerPredictive[_0x8ede('0xa1')](_0x8ede('0x1d8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x2b0e43[_0x8ede('0x9a')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x8ede('0x1d9'));clearInterval(_0x2b0e43['handlePredictive']);_0x2b0e43[_0x8ede('0x9a')]=undefined;}_0x2b0e43['startProgressive']=moment()[_0x8ede('0x81')](_0x8ede('0x108'));loggerPredictive[_0x8ede('0x85')](_0x2b0e43[_0x8ede('0x4b')],_0x8ede('0x1da'),_0x2b0e43['startProgressive']);this['handlePower'](_0x2b0e43,0x1);}else if(ifInterval(_0x2b0e43[_0x8ede('0x1db')],_0x2b0e43[_0x8ede('0x2e')])){this[_0x8ede('0x16b')](_0x2b0e43,0x1);loggerPredictiveCalls[_0x8ede('0x85')](_0x8ede('0x1dc'),_0x2b0e43[_0x8ede('0x2e')],_0x2b0e43[_0x8ede('0x4b')]);_0x2b0e43[_0x8ede('0x7b')]=0x0;_0x2b0e43[_0x8ede('0x1dd')]=0x0;}else if(_0x4a5720<_0x1ddccd&&_0x2b0e43[_0x8ede('0x1de')]===_0x8ede('0x1df')){freeVariablesPredictive(_0x2b0e43);loggerPredictive[_0x8ede('0x85')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x1ddccd,_0x8ede('0x2e'),_0x2b0e43[_0x8ede('0x4b')]);}else if(_0x57caa0<_0x2b0e43[_0x8ede('0x1dd')]&&_0x2b0e43['dialPredictiveOptimization']===_0x8ede('0x1df')){freeVariablesPredictive(_0x2b0e43);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x1e0'),_0x8ede('0x1e1'),_0x57caa0,'Drop\x20in\x20this\x20interval',_0x2b0e43[_0x8ede('0x1dd')],'startProgressive',_0x2b0e43[_0x8ede('0x4b')]);}else if(!ifInterval(_0x2b0e43[_0x8ede('0x1db')],_0x2b0e43[_0x8ede('0x2e')])&&_[_0x8ede('0x43')](_0x2b0e43[_0x8ede('0x2d')])&&!_[_0x8ede('0x43')](_0x2b0e43[_0x8ede('0x2e')])){_0x2b0e43[_0x8ede('0x2d')]=moment()[_0x8ede('0x81')](_0x8ede('0x108'));loggerPredictive[_0x8ede('0x85')](_0x2b0e43[_0x8ede('0x4b')],_0x8ede('0x1e2'),_0x2b0e43[_0x8ede('0x2d')]);this[_0x8ede('0x1e3')](_0x2b0e43[_0x8ede('0x1db')])[_0x8ede('0xc1')](this[_0x8ede('0x1e4')](_0x2b0e43))[_0x8ede('0xc1')](mergeDataErlangB(_0x2b0e43))['then'](this[_0x8ede('0x1e5')](_0x2b0e43))['catch'](loggerCatchPredictive(_0x8ede('0x1e6'),_0x2b0e43));}else if(!ifInterval(_0x2b0e43[_0x8ede('0x1db')],_0x2b0e43[_0x8ede('0x2d')])){_0x2b0e43[_0x8ede('0x1dd')]=0x0;_0x2b0e43[_0x8ede('0x2d')]=moment()[_0x8ede('0x81')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8ede('0x85')](_0x2b0e43['name'],_0x8ede('0x1e7'),_0x2b0e43[_0x8ede('0x2d')]);clearInterval(_0x2b0e43[_0x8ede('0x9a')]);_0x2b0e43[_0x8ede('0x9a')]=undefined;this[_0x8ede('0x1e3')](_0x2b0e43[_0x8ede('0x1db')])[_0x8ede('0xc1')](this[_0x8ede('0x1e4')](_0x2b0e43))[_0x8ede('0xc1')](mergeDataErlangB(_0x2b0e43))[_0x8ede('0xc1')](this['startMethodPredictive'](_0x2b0e43))[_0x8ede('0xbb')](loggerCatchPredictive(_0x8ede('0x1e8'),_0x2b0e43));}else if(_0x2b0e43['predictiveIntervalAvailable']&&_0x291e63<_0x2b0e43[_0x8ede('0x1d4')]-_0xf1f267){freeVariablesPredictive(_0x2b0e43);loggerPredictive['info'](_0x2b0e43[_0x8ede('0x4b')],_0x8ede('0x1e9'),_0x291e63,_0x8ede('0x1ea'),_0x2b0e43[_0x8ede('0x1d4')],'-',_0xf1f267,'=',_0x2b0e43[_0x8ede('0x1d4')]-_0xf1f267,')');}else if(_0x2b0e43[_0x8ede('0x1d4')]&&_0x291e63>_0x2b0e43[_0x8ede('0x1d4')]+_0x3f4eed){freeVariablesPredictive(_0x2b0e43);loggerPredictive['info'](_0x2b0e43[_0x8ede('0x4b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x291e63,_0x8ede('0x1eb'),_0x2b0e43['predictiveIntervalAvailable'],'+',_0x3f4eed,'=',_0x2b0e43[_0x8ede('0x1d4')]+_0x3f4eed,')');}};Dialer[_0x8ede('0x1f')][_0x8ede('0x1e4')]=function(_0x880f53){var _0x4fb057=this;return function(_0x2771fc){return new BPromise(function(_0x5ed717,_0x3d3c04){_[_0x8ede('0xde')](_0x880f53,_0x2771fc[0x0]);if(checkGetDataPredictive(_0x2771fc[0x0])){var _0x255d32=_0x880f53['predictiveIntervalAvailable']=_0x880f53[_0x8ede('0x5d')]+_0x880f53[_0x8ede('0x58')];var _0x860e43=_0x880f53[_0x8ede('0x1db')]*0x3c;var _0xf3d546=_0x2771fc[0x0][_0x8ede('0x8d')]+_0x2771fc[0x0][_0x8ede('0x75')];var _0x51afef=(_0x2771fc[0x0][_0x8ede('0x74')]+_0x2771fc[0x0][_0x8ede('0x8a')]+_0x2771fc[0x0][_0x8ede('0x76')])/_0x2771fc[0x0][_0x8ede('0x7a')];_0x880f53[_0x8ede('0x78')]=_0x51afef>0x0?_0x51afef:0x1;switch(_0x880f53['dialPredictiveOptimization']){case _0x8ede('0x1df'):var _0xd11a6f=_0x880f53[_0x8ede('0x1d2')]/0x64;return _0x4fb057[_0x8ede('0x1ec')](_0x255d32,_0x860e43,_0xf3d546,_0x51afef,_0xd11a6f)['then'](function(_0x32f8c6){return _0x5ed717(_0x32f8c6);});case _0x8ede('0x1ed'):var _0x1fb103=_0x880f53[_0x8ede('0x1d2')]/0x64;return _0x4fb057[_0x8ede('0x1ee')](_0x255d32,_0x860e43,_0xf3d546,_0x51afef,_0x1fb103)[_0x8ede('0xc1')](function(_0x268e55){return _0x5ed717(_0x268e55);});default:return _0x3d3c04(msgResponse('[getDataPredictive]',_0x8ede('0x15a'),'Unknown\x20Predictive'));}}else{return _0x3d3c04(msgResponse(_0x8ede('0x1ef'),_0x8ede('0x15a'),_0x8ede('0x1f0')));}});};};Dialer[_0x8ede('0x1f')][_0x8ede('0x1f1')]=function(_0x448f05){var _0x3bae59=this;return function(_0x55b0c){return new BPromise(function(_0x89121e,_0x1aba34){_[_0x8ede('0xde')](_0x448f05,_0x55b0c[0x0]);if(checkGetDataPredictive(_0x55b0c[0x0])){loggerPredictive[_0x8ede('0x85')](JSON[_0x8ede('0x51')](_0x55b0c[0x0]));if(_0x448f05['dialPredictiveOptimization']==='dropRate'){return _0x3bae59['getVoiceQueueRtPauses'](_0x448f05['id'])[_0x8ede('0xc1')](function(_0x3ae685){var _0x56506=_0x448f05[_0x8ede('0x59')]-_0x3ae685[0x0]['outboundQueuePauses'];var _0x2aa32b=_0x448f05[_0x8ede('0x1db')]*0x3c;var _0x4d138c=_0x55b0c[0x0][_0x8ede('0x8d')]+_0x55b0c[0x0]['predictiveIntervalAvgHoldtime'];var _0x326409=(_0x55b0c[0x0]['predictiveIntervalAnsweredCalls']+_0x55b0c[0x0][_0x8ede('0x8a')]+_0x55b0c[0x0][_0x8ede('0x76')])/_0x55b0c[0x0][_0x8ede('0x7a')];var _0x202073=_0x448f05[_0x8ede('0x1d2')]/0x64;_0x448f05['predictiveIntervalPauses']=_0x3ae685[0x0][_0x8ede('0x1f2')]||0x0;_0x448f05[_0x8ede('0x78')]=_0x326409>0x0?_0x326409:0x1;return _0x3bae59[_0x8ede('0x1ec')](_0x56506,_0x2aa32b,_0x4d138c,_0x326409,_0x202073);})[_0x8ede('0xc1')](function(_0x40191e){return _0x89121e(_0x40191e);})[_0x8ede('0xbb')](function(_0x3cb69c){return _0x1aba34(msgResponse(_0x8ede('0x1f3'),'Failure',JSON['stringify'](_0x3cb69c)));});}if(_0x448f05[_0x8ede('0x1de')]===_0x8ede('0x1ed')){return _0x3bae59['getVoiceQueueRtPauses'](_0x448f05['id'])[_0x8ede('0xc1')](function(_0x377bcb){var _0x158f3f=_0x448f05[_0x8ede('0x59')]-_0x377bcb[0x0][_0x8ede('0x1f2')];var _0x301a83=_0x448f05[_0x8ede('0x1db')]*0x3c;var _0x1abd15=_0x55b0c[0x0]['predictiveIntervalAvgTalktime']+_0x55b0c[0x0][_0x8ede('0x75')];var _0x275864=(_0x55b0c[0x0][_0x8ede('0x74')]+_0x55b0c[0x0][_0x8ede('0x8a')]+_0x55b0c[0x0][_0x8ede('0x76')])/_0x55b0c[0x0][_0x8ede('0x7a')];var _0x4eb399=_0x448f05[_0x8ede('0x1d2')]/0x64;_0x448f05[_0x8ede('0x1f4')]=_0x377bcb[0x0][_0x8ede('0x1f2')]||0x0;_0x448f05['predictiveIntervalHitRate']=_0x275864>0x0?_0x275864:0x1;return _0x3bae59[_0x8ede('0x1ee')](_0x158f3f,_0x301a83,_0x1abd15,_0x275864,_0x4eb399);})['then'](function(_0xb6dd5a){return _0x89121e(_0xb6dd5a);})[_0x8ede('0xbb')](function(_0x223915){return _0x1aba34(msgResponse(_0x8ede('0x1f3'),_0x8ede('0x15a'),JSON[_0x8ede('0x51')](_0x223915)));});}}else{return _0x1aba34(msgResponse(_0x8ede('0x1ef'),_0x8ede('0x15a'),'check\x20failure'));}});};};Dialer[_0x8ede('0x1f')][_0x8ede('0x1e5')]=function(_0x4dabe9){var _0x2424d1=this;return function(){var _0x1456b3=0x0;var _0x1cba7c=Math[_0x8ede('0x1d7')](_0x4dabe9[_0x8ede('0x7c')]*0x3e8);if(_0x1cba7c>0x0){_0x1cba7c=_0x1cba7c<0x64?0x64:_0x1cba7c;loggerPredictive['info'](_0x4dabe9['name'],_0x8ede('0x1f5'),_0x1cba7c,'milliseconds');_0x4dabe9[_0x8ede('0x9a')]=setInterval(function(){_0x2424d1['handlePredictive'](_0x4dabe9);loggerPredictiveCalls[_0x8ede('0x85')]('[handlePredictive]',_0x1456b3+=0x1);},_0x1cba7c);}else{loggerPredictive[_0x8ede('0x85')](_0x4dabe9['name'],_0x8ede('0x1f6'));}};};Dialer[_0x8ede('0x1f')][_0x8ede('0x1f7')]=function(_0x4d0374,_0x29da97){var _0x30837b=this;return function(_0x46d4bd){if(_[_0x8ede('0x4e')](_0x46d4bd)){if(_['isNil'](_0x29da97['UserId'])||!_0x29da97[_0x8ede('0x1f8')]){if(_0x4d0374[_0x8ede('0x63')]===_0x8ede('0x7')){_0x4d0374[_0x8ede('0x13c')]=_[_0x8ede('0x43')](_0x4d0374[_0x8ede('0x13c')])?!![]:_0x4d0374[_0x8ede('0x13c')];var _0x3b0d42=uuid['v4']();_0x30837b['actions'][_0x3b0d42]=new Action(_0x4d0374,_0x29da97,_0x3b0d42);loggerBooked[_0x8ede('0x85')](_0x8ede('0x1f9'),_0x3b0d42,_0x8ede('0x1fa'),JSON[_0x8ede('0x51')](_0x4d0374[_0x8ede('0x13c')]),_0x8ede('0x1fb'),_0x4d0374[_0x8ede('0x4b')]);if(_0x4d0374[_0x8ede('0x13c')]){_0x4d0374[_0x8ede('0x13c')]=![];_0x30837b[_0x8ede('0x2f')][_0x30837b[_0x8ede('0x29')][_0x3b0d42][_0x8ede('0xbd')]]=[];ami[_0x8ede('0x15f')]({'actionid':_0x3b0d42,'action':_0x8ede('0x1fc'),'queue':_0x4d0374['name']})[_0x8ede('0xbb')](function(){_0x30837b[_0x8ede('0xbc')](_0x4d0374);_0x30837b[_0x8ede('0xca')]({'active':![],'ContactId':_0x30837b['actions'][_0x3b0d42][_0x8ede('0xdf')],'ListId':_0x30837b[_0x8ede('0x29')][_0x3b0d42]['ListId'],'VoiceQueueId':_0x30837b[_0x8ede('0x29')][_0x3b0d42][_0x8ede('0xe1')]||undefined,'CampaignId':_0x30837b[_0x8ede('0x29')][_0x3b0d42][_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1fd')));delete _0x30837b['actions'][_0x3b0d42];});}else{loggerBooked[_0x8ede('0x85')](_0x8ede('0x1fe'),JSON['stringify'](_0x4d0374['queueStatusComplete']),'Queue:\x20',_0x4d0374[_0x8ede('0x4b')]);_0x30837b['updateOriginated'](_0x4d0374);_0x30837b[_0x8ede('0xca')]({'active':![],'ContactId':_0x30837b[_0x8ede('0x29')][_0x3b0d42][_0x8ede('0xdf')],'ListId':_0x30837b[_0x8ede('0x29')][_0x3b0d42][_0x8ede('0x109')],'VoiceQueueId':_0x30837b['actions'][_0x3b0d42]['VoiceQueueId']||undefined,'CampaignId':_0x30837b[_0x8ede('0x29')][_0x3b0d42][_0x8ede('0xe2')]||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x1fd')));delete _0x30837b['actions'][_0x3b0d42];}}else{return _0x30837b[_0x8ede('0x179')](_0x4d0374,_0x29da97);}}else{if(getDiff(_0x29da97[_0x8ede('0x1ff')])<_0x4d0374['dialRecallMeTimeout']*0x3c){if(_0x29da97[_0x8ede('0x200')]&&!_0x29da97[_0x8ede('0x200')][_0x8ede('0x201')]){_0x30837b['preview'][_0x8ede('0x140')](_0x29da97['id'])[_0x8ede('0x141')](function(){_0x30837b[_0x8ede('0xbc')](_0x4d0374);});}else{_0x30837b[_0x8ede('0xcc')]({'active':![]},_0x29da97['id'],0x1)[_0x8ede('0x141')](function(){_0x30837b[_0x8ede('0xbc')](_0x4d0374);});}}else{_0x4d0374[_0x8ede('0x71')]+=0x1;_0x30837b[_0x8ede('0xbc')](_0x4d0374);if(_0x4d0374['dialRecallInQueue']){_0x30837b[_0x8ede('0xca')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x29da97[_0x8ede('0xdf')],'ListId':_0x29da97[_0x8ede('0x109')],'VoiceQueueId':_0x29da97[_0x8ede('0xe1')]||undefined,'CampaignId':_0x29da97['CampaignId']||undefined})[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x202')));_0x30837b[_0x8ede('0xd7')](createObjHistory(_0x4d0374,_0x29da97,'RECALLINQUEUE',0x17,_0x8ede('0x203')))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0x204')));}else{_0x30837b[_0x8ede('0xe9')](createObjHistory(_0x4d0374,_0x29da97,'RECALLFAILEDTIMEOUT',0x16,_0x8ede('0x205')),_0x8ede('0x206'),_0x8ede('0x207'));}}}}else{_0x4d0374[_0x8ede('0x208')]+=0x1;_0x30837b[_0x8ede('0xe9')](createObjHistory(_0x4d0374,_0x29da97,_0x8ede('0x209'),0xd,_0x8ede('0x20a')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x8ede('0x1f')][_0x8ede('0x20b')]=function(_0x2399b1){var _0x194a61=this;var _0x5d379f=_0x2399b1[_0x8ede('0x20c')]-_0x2399b1[_0x8ede('0xa5')]-_0x2399b1[_0x8ede('0xcf')];emitCampaignSummary(_0x2399b1);if(_0x5d379f>0x0){if(_0x5d379f>this[_0x8ede('0x27')]){_0x5d379f=this[_0x8ede('0x27')];}_0x2399b1[_0x8ede('0xcf')]+=_0x5d379f;this[_0x8ede('0xd1')](_0x2399b1['id'],_0x5d379f,_0x2399b1['dialOrderByScheduledAt'],_0x2399b1)['then'](function(_0x170a85){_0x2399b1[_0x8ede('0xcf')]-=_0x5d379f;_0x2399b1[_0x8ede('0xcf')]=_0x2399b1['temp']>0x0?_0x2399b1['temp']:0x0;if(!checkContactEmpty(_0x170a85)){_0x2399b1[_0x8ede('0x46')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x8ede('0x85')]('[getContactCampaign2][Empty]'+_0x2399b1[_0x8ede('0x4b')]);}else{_0x2399b1[_0x8ede('0xa5')]+=_0x170a85['length'];_0x2399b1[_0x8ede('0x46')]=_0x8ede('0x20d');for(var _0x25fd43=0x0;_0x25fd43<_0x170a85['length'];_0x25fd43+=0x1){_0x2399b1[_0x8ede('0x20e')]+=0x1;if(_[_0x8ede('0xeb')](_0x170a85[_0x25fd43])||_[_0x8ede('0xeb')](_0x170a85[_0x25fd43][_0x8ede('0x17e')])||_[_0x8ede('0xeb')](_0x170a85[_0x25fd43][_0x8ede('0x17e')][_0x8ede('0x17d')])){_0x194a61[_0x8ede('0xdc')](_0x8ede('0x20f'),_0x2399b1,_0x170a85[_0x25fd43]);}else{_0x194a61[_0x8ede('0xc6')](_[_0x8ede('0x13a')](_0x170a85[_0x25fd43],[_0x8ede('0xe2'),_0x8ede('0x210')]))[_0x8ede('0xc1')](_0x194a61[_0x8ede('0x1f7')](_0x2399b1,_0x170a85[_0x25fd43]))[_0x8ede('0xbb')](_0x194a61[_0x8ede('0xdb')]('[actionOriginateIvr]\x20',_0x2399b1));}}}})['catch'](loggerGetContactDialer(_0x8ede('0x211'),_0x2399b1,_0x5d379f));}};Dialer[_0x8ede('0x1f')]['handlePower']=function(_0x3788f0,_0x361dc8){var _0x15ad6d=this;var _0x4a658e=[];var _0x28f2fc=_0x361dc8>=0x1?_0x361dc8:0x1;if(_0x3788f0[_0x8ede('0x63')]===_0x8ede('0x7')){_0x28f2fc=0x1;}var _0x2e043a=Math['floor'](_0x3788f0['available']*_0x28f2fc)-_0x3788f0['originated']-_0x3788f0[_0x8ede('0xcf')];emitVoiceQueueSummary(_0x3788f0);if(_0x3788f0[_0x8ede('0x212')]>0x0){var _0x411511=_0x3788f0[_0x8ede('0x212')]-_0x3788f0[_0x8ede('0xa5')]-_0x3788f0[_0x8ede('0x5d')]-_0x3788f0[_0x8ede('0xcf')]-_0x3788f0[_0x8ede('0xad')];if(_0x2e043a>_0x411511){_0x2e043a=_0x411511;}}if(_0x2e043a>0x0){if(_0x3788f0[_0x8ede('0x63')]===_0x8ede('0x7')){_0x2e043a=0x1;}if(_0x2e043a>this[_0x8ede('0x27')]){_0x2e043a=this['maxNumberOriginate'];}_0x3788f0['temp']+=_0x2e043a;for(var _0x5ce8d9 in this[_0x8ede('0x25')]){if(typeof this['agents'][_0x5ce8d9]!==_0x8ede('0xd9')){if(this[_0x8ede('0x25')][_0x5ce8d9][_0x8ede('0xf1')]===_0x8ede('0x213')&&this['agents'][_0x5ce8d9][_0x8ede('0xba')]===_0x8ede('0xe7')){_0x4a658e[_0x8ede('0x139')](this[_0x8ede('0x25')][_0x5ce8d9]['id']);}}}this[_0x8ede('0xce')](_0x3788f0['id'],_0x4a658e,_0x2e043a,_0x3788f0[_0x8ede('0x214')],_0x3788f0)[_0x8ede('0xc1')](function(_0x36a75e){_0x3788f0[_0x8ede('0xcf')]-=_0x2e043a;_0x3788f0[_0x8ede('0xcf')]=_0x3788f0[_0x8ede('0xcf')]>0x0?_0x3788f0[_0x8ede('0xcf')]:0x0;if(!checkContactEmpty(_0x36a75e)){_0x15ad6d[_0x8ede('0xc2')](_0x3788f0)[_0x8ede('0xc1')](sendMessageReschedule(_0x3788f0))[_0x8ede('0xbb')](loggerCatch(_0x8ede('0xc3')));}else{_0x3788f0['originated']+=_0x36a75e[_0x8ede('0xa4')];_0x3788f0[_0x8ede('0x46')]=_0x3788f0[_0x8ede('0x63')]===_0x8ede('0x7')?_0x8ede('0x184'):_0x8ede('0x20d');for(var _0x147aa4=0x0;_0x147aa4<_0x36a75e['length'];_0x147aa4+=0x1){if(_[_0x8ede('0xeb')](_0x36a75e[_0x147aa4])||_[_0x8ede('0xeb')](_0x36a75e[_0x147aa4][_0x8ede('0x17e')])||_[_0x8ede('0xeb')](_0x36a75e[_0x147aa4][_0x8ede('0x17e')][_0x8ede('0x17d')])){_0x15ad6d[_0x8ede('0xdc')](_0x8ede('0x20f'),_0x3788f0,_0x36a75e[_0x147aa4]);}else{_0x15ad6d['checkIsBlackList'](_[_0x8ede('0x13a')](_0x36a75e[_0x147aa4],['VoiceQueueId','Contact.phone']))['then'](_0x15ad6d['checkContactBlack'](_0x3788f0,_0x36a75e[_0x147aa4]))['catch'](_0x15ad6d[_0x8ede('0xdb')](_0x8ede('0x20f'),_0x3788f0));}}}})[_0x8ede('0xbb')](loggerGetContactDialer(_0x8ede('0x215'),_0x3788f0,_0x2e043a));}};Dialer[_0x8ede('0x1f')]['handlePredictive']=function(_0x3f36a1){if(_0x3f36a1[_0x8ede('0x212')]>0x0){var _0x4add67=_0x3f36a1['dialLimitQueue']-_0x3f36a1[_0x8ede('0xa5')]-_0x3f36a1['talking'];if(_0x4add67>0x0){this[_0x8ede('0x216')](_0x3f36a1);}else{loggerPredictiveCalls[_0x8ede('0x85')](_0x8ede('0x217'));}}else{this[_0x8ede('0x216')](_0x3f36a1);}};Dialer[_0x8ede('0x1f')][_0x8ede('0x216')]=function(_0x1f91d8){var _0x2f4781=this;var _0x4c78c5=[];_0x1f91d8[_0x8ede('0xa5')]+=0x1;for(var _0x2932d2 in this[_0x8ede('0x25')]){if(typeof this[_0x8ede('0x25')][_0x2932d2]!==_0x8ede('0xd9')){if(this[_0x8ede('0x25')][_0x2932d2][_0x8ede('0xf1')]===_0x8ede('0x213')&&this[_0x8ede('0x25')][_0x2932d2][_0x8ede('0xba')]==='reachable'){_0x4c78c5[_0x8ede('0x139')](this['agents'][_0x2932d2]['id']);}}}this['getContactDialer'](_0x1f91d8['id'],_0x4c78c5,0x1,_0x1f91d8[_0x8ede('0x214')],_0x1f91d8)['then'](function(_0x3ea58d){if(!checkContactEmpty(_0x3ea58d)){checkContactLowerLimitOriginate(_0x1f91d8,0x1,0x0);_0x2f4781[_0x8ede('0xc2')](_0x1f91d8)[_0x8ede('0xc1')](sendMessageReschedule(_0x1f91d8))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x1f91d8[_0x8ede('0x46')]=_0x8ede('0x20d');if(_[_0x8ede('0xeb')](_0x3ea58d[0x0])||_[_0x8ede('0xeb')](_0x3ea58d[0x0][_0x8ede('0x17e')])||_[_0x8ede('0xeb')](_0x3ea58d[0x0][_0x8ede('0x17e')][_0x8ede('0x17d')])){_0x2f4781[_0x8ede('0xdc')]('[actionOriginate]\x20',_0x1f91d8,_0x3ea58d[0x0]);}else{_0x2f4781[_0x8ede('0xc4')](_[_0x8ede('0x13a')](_0x3ea58d[0x0],['VoiceQueueId',_0x8ede('0x210')]))[_0x8ede('0xc1')](_0x2f4781[_0x8ede('0x1f7')](_0x1f91d8,_0x3ea58d[0x0]))['catch'](_0x2f4781[_0x8ede('0xdb')](_0x8ede('0x218'),_0x1f91d8));}}})[_0x8ede('0xbb')](loggerGetContactDialer(_0x8ede('0x219'),_0x1f91d8,0x1));emitVoiceQueueSummary(_0x1f91d8);};Dialer[_0x8ede('0x1f')][_0x8ede('0x1ec')]=function(_0x47ef0a,_0x59c3ea,_0xc6e754,_0x146e50,_0x3618fe,_0x577c72){loggerPredictive[_0x8ede('0x85')](_0x8ede('0x21a'));loggerPredictive[_0x8ede('0x85')](_0x8ede('0x21b'),_0x47ef0a);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x21c'),_0x59c3ea);loggerPredictive['info'](_0x8ede('0x21d'),_0xc6e754);loggerPredictive[_0x8ede('0x85')]('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',_0x146e50);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x21e'),_0x3618fe);loggerPredictive['info'](_0x8ede('0x8e'));return new BPromise(function(_0x35c0ee,_0x5882b2){if(_0x47ef0a<=0x0||isNaN(_0x47ef0a)){return _0x5882b2(msgResponse('[abandonmentRate]',_0x8ede('0x50'),_0x8ede('0x21f')+_0x47ef0a));}if(_0xc6e754<=0x0||isNaN(_0xc6e754)){return _0x5882b2(msgResponse(_0x8ede('0x220'),_0x8ede('0x50'),'Ts\x20=\x20'+_0xc6e754));}if(_0x146e50<=0x0||isNaN(_0x146e50)){return _0x5882b2(msgResponse(_0x8ede('0x220'),_0x8ede('0x50'),'p\x20=\x20'+_0x146e50));}if(_0x59c3ea<=0x0||isNaN(_0x59c3ea)){return _0x5882b2(msgResponse('[abandonmentRate]',_0x8ede('0x50'),_0x8ede('0x221')+_0x59c3ea));}if(_0x3618fe<=0x0||isNaN(_0x3618fe)){return _0x5882b2(msgResponse(_0x8ede('0x220'),_0x8ede('0x50'),_0x8ede('0x222')+_0x3618fe));}_0x577c72=_0x577c72||0x0;var _0x1fb1bc=0x1/_0xc6e754;var _0x138b76=0x0;var _0x598513=0x0;var _0x569a95=0x0;var _0xfd48b5=0x0;for(var _0x162dff=0x0;_0x569a95<_0x3618fe;_0x162dff+=0x1){_0x598513=_0x162dff/_0x59c3ea;_0x138b76=(_0x146e50*_0x598513+_0x577c72)/_0x1fb1bc;_0x569a95=erlangb(_0x138b76,_0x47ef0a);_0xfd48b5=_0x138b76/_0x47ef0a*(0x1-erlangb(_0x138b76,_0x47ef0a));}return _0x35c0ee({'erlangCalls':_0x162dff,'erlangCallToSecond':_0x59c3ea/_0x162dff,'erlangAbandonmentRate':_0x569a95,'erlangBusyFactor':_0xfd48b5});});};Dialer[_0x8ede('0x1f')][_0x8ede('0x1ee')]=function(_0x537b21,_0x25543a,_0x4f8c28,_0x2f43a5,_0x22e235,_0x4e9193){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x8ede('0x85')]('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',_0x537b21);loggerPredictive['info'](_0x8ede('0x21c'),_0x25543a);loggerPredictive['info'](_0x8ede('0x21d'),_0x4f8c28);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x223'),_0x2f43a5);loggerPredictive[_0x8ede('0x85')](_0x8ede('0x224'),_0x22e235);loggerPredictive['info'](_0x8ede('0x8e'));return new BPromise(function(_0x451e0d,_0x3503af){if(_0x537b21<=0x0||isNaN(_0x537b21)){return _0x3503af(msgResponse(_0x8ede('0x225'),_0x8ede('0x50'),'m\x20=\x20'+_0x537b21));}if(_0x4f8c28<=0x0||isNaN(_0x4f8c28)){return _0x3503af(msgResponse(_0x8ede('0x225'),_0x8ede('0x50'),'Ts\x20=\x20'+_0x4f8c28));}if(_0x2f43a5<=0x0||isNaN(_0x2f43a5)){return _0x3503af(msgResponse(_0x8ede('0x225'),_0x8ede('0x50'),_0x8ede('0x226')+_0x2f43a5));}if(_0x25543a<=0x0||isNaN(_0x25543a)){return _0x3503af(msgResponse('[busyFactor]',_0x8ede('0x50'),_0x8ede('0x221')+_0x25543a));}if(_0x22e235<=0x0||isNaN(_0x22e235)){return _0x3503af(msgResponse(_0x8ede('0x225'),_0x8ede('0x50'),_0x8ede('0x227')+_0x22e235));}_0x4e9193=_0x4e9193||0x0;var _0x4fa8b6=0x1/_0x4f8c28;var _0x17d91d=0x0;var _0x172b08=0x0;var _0x5822bb=0x0;var _0x4d41c1=0x0;for(var _0x2a00b7=0x0;_0x4d41c1<_0x22e235;_0x2a00b7+=0x1){_0x172b08=_0x2a00b7/_0x25543a;_0x17d91d=(_0x2f43a5*_0x172b08+_0x4e9193)/_0x4fa8b6;_0x5822bb=erlangb(_0x17d91d,_0x537b21);_0x4d41c1=_0x17d91d/_0x537b21*(0x1-erlangb(_0x17d91d,_0x537b21));}return _0x451e0d({'erlangCalls':_0x2a00b7,'erlangCallToSecond':_0x25543a/_0x2a00b7,'erlangAbandonmentRate':_0x5822bb,'erlangBusyFactor':_0x4d41c1});});};module['exports']=Dialer; \ No newline at end of file +var _0x8a8e=['from-sip','dialOriginateTimeout','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','busyFactor','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','reachable','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','Umin\x20=\x20','util','lodash','uuid','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','./action','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','undefined','sequence','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','dialAMDActive','value','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countcongestionretry','reason19\x20machine....','reason\x2019\x20machine....','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','countglobal','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','rrmemory','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','pick','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Intervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','interval','content','true','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','contact\x20is\x20undefine','getCaller','NONE','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','phone','substring','dialCutDigit'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0x8a8e,0x86));var _0xe8a8=function(_0x2bb0d9,_0x1fa51c){_0x2bb0d9=_0x2bb0d9-0x0;var _0x43fe14=_0x8a8e[_0x2bb0d9];return _0x43fe14;};'use strict';var util=require(_0xe8a8('0x0'));var _=require(_0xe8a8('0x1'));var BPromise=require('bluebird');var uuid=require(_0xe8a8('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xe8a8('0x3'));var Redis=require('ioredis');var ut=require(_0xe8a8('0x4'));var config=require(_0xe8a8('0x5'));var logger=require(_0xe8a8('0x6'))(_0xe8a8('0x7'));var loggerBooked=require(_0xe8a8('0x6'))(_0xe8a8('0x8'));var loggerPredictive=require(_0xe8a8('0x6'))(_0xe8a8('0x9'));var loggerPredictiveCalls=require(_0xe8a8('0x6'))(_0xe8a8('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xe8a8('0xb'));var ami=require(_0xe8a8('0xc'));config[_0xe8a8('0xd')]=_[_0xe8a8('0xe')](config[_0xe8a8('0xd')],{'host':_0xe8a8('0xf'),'port':0x18eb});var io=require(_0xe8a8('0x10'))(new Redis(config[_0xe8a8('0xd')]));var cmHopper=require(_0xe8a8('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xe8a8('0x12'));var Action=require(_0xe8a8('0x13'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xe8a8('0x14'));var QueueCallerAbandon=require(_0xe8a8('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xe8a8('0x16')][_0xe8a8('0x17')]||_0xe8a8('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0xe8a8('0x19')};var Sequence=function(){};Sequence[_0xe8a8('0x1a')][_0xe8a8('0x1b')]=function(_0x51f63b){this['tail']=this['tail']?this[_0xe8a8('0x1c')]['finally'](_0x51f63b):_0x51f63b();};function Dialer(_0x460715,_0x5568d){this['sequence']=new Sequence();this[_0xe8a8('0x1d')]=_0x5568d;this[_0xe8a8('0x1e')]=_0x460715[_0xe8a8('0x1e')];this[_0xe8a8('0x1f')]=_0x460715['campaigns'];this[_0xe8a8('0x20')]=_0x460715[_0xe8a8('0x20')];this[_0xe8a8('0x21')]=_0x460715[_0xe8a8('0x21')];this[_0xe8a8('0x22')]=config[_0xe8a8('0x22')]||0x2;this['channels']={};this[_0xe8a8('0x23')]={};this[_0xe8a8('0x24')]={};this['uniqueId']={};this[_0xe8a8('0x25')]={};this[_0xe8a8('0x26')]={};this[_0xe8a8('0x27')]={};this[_0xe8a8('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0xe8a8('0x29'),this[_0xe8a8('0x2a')][_0xe8a8('0x2b')](this));ami['on'](_0xe8a8('0x2c'),this[_0xe8a8('0x2d')]['bind'](this));ami['on'](_0xe8a8('0x2e'),this[_0xe8a8('0x2f')][_0xe8a8('0x2b')](this));ami['on'](_0xe8a8('0x30'),this[_0xe8a8('0x31')]['bind'](this));ami['on']('custom:queuesummary',this[_0xe8a8('0xb')]['bind'](this));ami['on'](_0xe8a8('0x32'),this[_0xe8a8('0x33')][_0xe8a8('0x2b')](this));ami['on'](_0xe8a8('0x34'),this[_0xe8a8('0x35')][_0xe8a8('0x2b')](this));ami['on'](_0xe8a8('0x36'),this[_0xe8a8('0x37')][_0xe8a8('0x2b')](this));ami['on'](_0xe8a8('0x38'),this[_0xe8a8('0x39')][_0xe8a8('0x2b')](this));ami['on'](_0xe8a8('0x3a'),this[_0xe8a8('0x3b')][_0xe8a8('0x2b')](this));this[_0xe8a8('0x3c')]();this['loopClearZombieChannels']();}function isNotNull(_0x26650c){return _0x26650c!==null&&!_[_0xe8a8('0x3d')](_0x26650c);}function checkIsLoggedIn(_0x44ff7b,_0x506b4a){return function(){if(_0x506b4a<=0x0){_0x44ff7b[_0xe8a8('0x3e')]=_0xe8a8('0x3f');throw _0x44ff7b[_0xe8a8('0x40')]+_0xe8a8('0x41');}};}function isActive(_0x1dfbe7){return _0x1dfbe7;}function checkIsActive(_0x102517,_0x4bcce0){return function(){if(!isActive(_0x4bcce0)){_0x102517[_0xe8a8('0x3e')]=_0xe8a8('0x42');throw _0x102517['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x411c1f){return function(){if(!isNotNull(_0x411c1f[_0xe8a8('0x43')])){_0x411c1f['message']=_0xe8a8('0x44');throw _0x411c1f[_0xe8a8('0x40')]+_0xe8a8('0x45');}if(!isNotNull(_0x411c1f[_0xe8a8('0x43')]['Intervals'])){_0x411c1f[_0xe8a8('0x3e')]='INTERVAL_IS_NULL';throw _0x411c1f['name']+_0xe8a8('0x45');}if(!isNotNull(_[_0xe8a8('0x46')](_0x411c1f[_0xe8a8('0x43')]['Intervals']))){_0x411c1f[_0xe8a8('0x3e')]='INTERVAL_IS_NULL';throw _0x411c1f[_0xe8a8('0x40')]+_0xe8a8('0x45');}};}function msgResponse(_0xedfe88,_0x59a963,_0x3f1c1a){return{'action':_0xedfe88,'response':_0x59a963,'message':_0x3f1c1a,'stack':_0x3f1c1a};}function myreject(_0x359d2a){return function(_0x4a3e51){return _0x359d2a(msgResponse('[ifTime][Action]',_0xe8a8('0x47'),JSON[_0xe8a8('0x48')](_0x4a3e51)));};}function getSeconds(_0x2f3096,_0x5c9dea){var _0x5ac2f2=moment(_0x2f3096)[_0xe8a8('0x49')](0x0);var _0x1a7cc1=moment(_0x5c9dea)[_0xe8a8('0x49')](0x0);return _0x5ac2f2[_0xe8a8('0x4a')](_0x1a7cc1,'seconds');}function emit(_0x57064a,_0x56ce60,_0x457594){io['to'](_0x57064a)[_0xe8a8('0x4b')](_0x56ce60,_0x457594);}function emitVoiceQueueSummary(_0x572ba1){if(_0x572ba1[_0xe8a8('0x4c')]===_0xe8a8('0x4d')){var _0xb46a3={'id':_0x572ba1['id'],'name':_0x572ba1[_0xe8a8('0x40')],'strategy':_0x572ba1[_0xe8a8('0x4e')],'answered':_0x572ba1[_0xe8a8('0x4f')],'available':_0x572ba1[_0xe8a8('0x50')],'loggedIn':_0x572ba1[_0xe8a8('0x51')],'pTalking':_0x572ba1['pTalking'],'sumBillable':_0x572ba1[_0xe8a8('0x52')],'sumDuration':_0x572ba1[_0xe8a8('0x53')],'sumHoldTime':_0x572ba1['sumHoldTime']||0x0,'talking':_0x572ba1[_0xe8a8('0x54')],'total':_0x572ba1['total'],'type':_0x572ba1['type'],'unmanaged':_0x572ba1[_0xe8a8('0x55')],'abandoned':_0x572ba1[_0xe8a8('0x56')],'waiting':_0x572ba1[_0xe8a8('0x57')],'loggedInDb':_0x572ba1['loggedInDb'],'dialActive':_0x572ba1[_0xe8a8('0x58')],'dialMethod':_0x572ba1[_0xe8a8('0x59')],'dialOriginateCallerIdName':_0x572ba1[_0xe8a8('0x5a')],'dialOriginateCallerIdNumber':_0x572ba1[_0xe8a8('0x5b')],'dialOriginateTimeout':_0x572ba1['dialOriginateTimeout'],'dialPrefix':_0x572ba1['dialPrefix'],'outboundAnswerAgiCallsDay':_0x572ba1[_0xe8a8('0x5c')],'outboundAnswerCallsDay':_0x572ba1[_0xe8a8('0x5d')],'outboundBlacklistCallsDay':_0x572ba1[_0xe8a8('0x5e')],'outboundBusyCallsDay':_0x572ba1[_0xe8a8('0x5f')],'outboundCongestionCallsDay':_0x572ba1[_0xe8a8('0x60')],'outboundDropCallsDayACS':_0x572ba1['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x572ba1[_0xe8a8('0x61')],'outboundDropCallsDayTimeout':_0x572ba1[_0xe8a8('0x62')],'outboundNoAnswerCallsDay':_0x572ba1[_0xe8a8('0x63')],'outboundNoSuchCallsDay':_0x572ba1[_0xe8a8('0x64')],'outboundOriginateFailureCallsDay':_0x572ba1[_0xe8a8('0x65')],'outboundReCallsDay':_0x572ba1['outboundReCallsDay'],'outboundRejectCallsDay':_0x572ba1[_0xe8a8('0x66')],'outboundUnknownCallsDay':_0x572ba1[_0xe8a8('0x67')],'predictiveIntervalAnsweredCalls':_0x572ba1[_0xe8a8('0x68')],'predictiveIntervalAvgHoldtime':_0x572ba1[_0xe8a8('0x69')],'predictiveIntervalAvgTalktime':_0x572ba1[_0xe8a8('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x572ba1[_0xe8a8('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x572ba1[_0xe8a8('0x6c')],'predictiveIntervalErlangCalls':_0x572ba1[_0xe8a8('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x572ba1[_0xe8a8('0x6e')],'predictiveIntervalHitRate':_0x572ba1[_0xe8a8('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x572ba1[_0xe8a8('0x70')],'predictiveIntervalPauses':_0x572ba1['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x572ba1[_0xe8a8('0x71')],'predictiveIntervalTotalCalls':_0x572ba1[_0xe8a8('0x72')],'message':_0x572ba1[_0xe8a8('0x3e')],'originated':_0x572ba1[_0xe8a8('0x73')],'erlangCalls':_0x572ba1[_0xe8a8('0x74')],'erlangCallToSecond':_0x572ba1[_0xe8a8('0x75')],'erlangAbandonmentRate':_0x572ba1[_0xe8a8('0x76')],'erlangBusyFactor':_0x572ba1[_0xe8a8('0x77')],'startPredictive':_0x572ba1[_0xe8a8('0x26')],'startProgressive':_0x572ba1[_0xe8a8('0x27')]};if(_0x572ba1[_0xe8a8('0x78')]){_0xb46a3['Trunk']={'id':_0x572ba1[_0xe8a8('0x78')]['id'],'name':_0x572ba1[_0xe8a8('0x78')][_0xe8a8('0x40')],'active':_0x572ba1[_0xe8a8('0x78')][_0xe8a8('0x79')],'callerid':_0x572ba1[_0xe8a8('0x78')][_0xe8a8('0x7a')]};}if(_0x572ba1[_0xe8a8('0x43')]){_0xb46a3['Interval']={'id':_0x572ba1['Interval']['id'],'name':_0x572ba1['Interval'][_0xe8a8('0x40')]};}var _0x93b833=md5(JSON[_0xe8a8('0x48')](_0xb46a3));if(_0x572ba1[_0xe8a8('0x3')]!==_0x93b833){_0x572ba1['md5']=_0x93b833;emit(util[_0xe8a8('0x7b')]('voice:queue:%s',_0xb46a3[_0xe8a8('0x40')]),_0xe8a8('0x7c'),_0xb46a3);}}}function emitCampaignSummary(_0x337f54){if(_0x337f54[_0xe8a8('0x4c')]==='ivr'){emit(util[_0xe8a8('0x7b')](_0xe8a8('0x7d'),_0x337f54[_0xe8a8('0x40')]),'campaign:save',_0x337f54);}}function checkGetDataPredictive(_0x2c703f){if(isNotNull(_0x2c703f)&&!_['isEmpty'](_0x2c703f)){loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x7f'));loggerPredictive[_0xe8a8('0x7e')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c703f[_0xe8a8('0x72')]);loggerPredictive['info'](_0xe8a8('0x80'),_0x2c703f['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xe8a8('0x81'),_0x2c703f[_0xe8a8('0x6c')]);loggerPredictive[_0xe8a8('0x7e')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c703f[_0xe8a8('0x6b')]);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x82'),_0x2c703f['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x83'),_0x2c703f[_0xe8a8('0x6a')]);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x84'));if(_0x2c703f[_0xe8a8('0x72')]>0x0){if(!_[_0xe8a8('0x3d')](_0x2c703f[_0xe8a8('0x6a')])&&_0x2c703f[_0xe8a8('0x6a')]>0x0){return!![];}loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x85'));if(!_['isUndefined'](_0x2c703f[_0xe8a8('0x69')])&&_0x2c703f[_0xe8a8('0x69')]>0x0){return!![];}loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x86'));}else{loggerPredictive['info'](_0xe8a8('0x87'));}}else{loggerPredictive[_0xe8a8('0x7e')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xc21cee){return function(_0x6ccc38){loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x88'));loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x89'),_0x6ccc38['erlangCalls']);loggerPredictive['info'](_0xe8a8('0x8a'),_0x6ccc38[_0xe8a8('0x75')]);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x8b'),_0x6ccc38[_0xe8a8('0x76')]);loggerPredictive[_0xe8a8('0x7e')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6ccc38['erlangBusyFactor']);loggerPredictive[_0xe8a8('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6ccc38['erlangAbandonmentRate']);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x84'));_['merge'](_0xc21cee,_0x6ccc38);};}function getDiff(_0x5dd273){var _0x31ce76=moment()[_0xe8a8('0x49')](0x0);var _0x361131=moment(_0x5dd273)[_0xe8a8('0x49')](0x0);return _0x31ce76[_0xe8a8('0x4a')](_0x361131,_0xe8a8('0x8c'));}function ifInterval(_0x682ed3,_0x2a24c7){if(_['isUndefined'](_0x2a24c7)){return![];}return getDiff(_0x2a24c7)<_0x682ed3*0x3c;}function freeVariablesPredictive(_0x5e0854){if(isNotNull(_0x5e0854)){if(!_['isUndefined'](_0x5e0854[_0xe8a8('0x27')])){_0x5e0854[_0xe8a8('0x27')]=undefined;loggerPredictive[_0xe8a8('0x7e')](_0x5e0854[_0xe8a8('0x40')],_0xe8a8('0x8d'));}if(!_[_0xe8a8('0x3d')](_0x5e0854[_0xe8a8('0x26')])){_0x5e0854[_0xe8a8('0x26')]=undefined;loggerPredictive[_0xe8a8('0x7e')](_0x5e0854['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xe8a8('0x3d')](_0x5e0854[_0xe8a8('0x8e')])){clearInterval(_0x5e0854[_0xe8a8('0x8e')]);_0x5e0854[_0xe8a8('0x8e')]=undefined;loggerPredictive[_0xe8a8('0x7e')](_0x5e0854[_0xe8a8('0x40')],_0xe8a8('0x8f'));}}}function erlangb(_0x40f90a,_0x242f1a){if(_0x242f1a===0x0){return 0x0;}var _0x6a61cd=0x1;for(var _0x23b62a=0x1;_0x23b62a<=_0x242f1a;_0x23b62a+=0x1){_0x6a61cd=0x1+_0x6a61cd*_0x23b62a/_0x40f90a;}return 0x1/_0x6a61cd;}function isVoiceQueueOutbound(_0xdfa1c5){return _0xdfa1c5==='outbound';}function isNotPreview(_0x3ac267){return _0x3ac267!==_0xe8a8('0x1d');}function isCampaignIvr(_0x3bacae){return _0x3bacae===_0xe8a8('0x90');}function getCallerId(_0x5ac03f,_0x1cf0ec,_0x3bed31){if(!_['isUndefined'](_0x3bed31)&&typeof _0x3bed31===_0xe8a8('0x91')&&!_[_0xe8a8('0x46')](_0x3bed31)){if(!_[_0xe8a8('0x3d')](_0x1cf0ec)&&typeof _0x1cf0ec===_0xe8a8('0x91')&&!_[_0xe8a8('0x46')](_0x1cf0ec)){return util['format'](_0xe8a8('0x92'),_0x1cf0ec,_0x3bed31);}return util[_0xe8a8('0x7b')](_0xe8a8('0x92'),_0x3bed31,_0x3bed31);}if(!_[_0xe8a8('0x3d')](_0x5ac03f)&&typeof _0x5ac03f===_0xe8a8('0x91')&&!_['isEmpty'](_0x5ac03f)){return _0x5ac03f;}return _0xe8a8('0x93');}function loggerCatchQueueSummary(_0xa1ffe9,_0x55e022){return function(_0x144d12){freeVariablesPredictive(_0x55e022);emitVoiceQueueSummary(_0x55e022);emitCampaignSummary(_0x55e022);loggerSyncQueueSummary[_0xe8a8('0x94')](_0xa1ffe9,util[_0xe8a8('0x95')](_0x144d12,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4a0be8,_0x4951bb){return function(_0x492306){loggerPredictive['error'](_0x4951bb[_0xe8a8('0x40')],_0x4a0be8);loggerPredictive[_0xe8a8('0x94')](_0x492306[_0xe8a8('0x96')]);freeVariablesPredictive(_0x4951bb);};}function loggerCatch(_0x1a4b0a){return function(_0x1df2c1){logger[_0xe8a8('0x94')](_0x1a4b0a,util['inspect'](_0x1df2c1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x537546){return _0x537546&&!_['isUndefined'](_0x537546)&&_0x537546[_0xe8a8('0x97')]>0x0;}function decremetOriginate(_0x4ce685){if(!_[_0xe8a8('0x3d')](_0x4ce685)&&_0x4ce685!==null){if(typeof _0x4ce685[_0xe8a8('0x73')]!=='undefined'){if(_0x4ce685['originated']>0x0){_0x4ce685[_0xe8a8('0x73')]-=0x1;}else{logger[_0xe8a8('0x94')](_0xe8a8('0x98'));}}}else{logger[_0xe8a8('0x94')](_0xe8a8('0x99'));}}function checkContactLowerLimitOriginate(_0x4115be,_0x366b93,_0x3d2633){if(_0x366b93>_0x3d2633){for(var _0x3cde15=0x0;_0x3cde15<_0x366b93-_0x3d2633;_0x3cde15+=0x1){decremetOriginate(_0x4115be);}}}function loggerGetContactDialer(_0x3bb84c,_0x3796f5,_0x45468e){return function(_0x55e4b7){checkContactLowerLimitOriginate(_0x3796f5,_0x45468e,0x0);logger[_0xe8a8('0x94')](_0x3bb84c,util[_0xe8a8('0x95')](_0x55e4b7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4847fd){return function(_0x320bbc){if(isNotNull(_0x320bbc)&&isNotNull(_0x320bbc[0x0])){if(_0x320bbc[0x0][_0xe8a8('0x9a')]>0x0){_0x4847fd[_0xe8a8('0x3e')]=_0xe8a8('0x9b');logger[_0xe8a8('0x7e')]('[getContactDialer2][ReScheduled]'+_0x4847fd[_0xe8a8('0x40')],_0x320bbc[0x0][_0xe8a8('0x9a')],_0xe8a8('0x9c'));}else{_0x4847fd[_0xe8a8('0x3e')]=_0xe8a8('0x9d');logger[_0xe8a8('0x7e')]('[getContactDialer2][Empty]'+_0x4847fd['name']);}}};}function notSendMessagesQueue(_0x7ddb18){if(_0x7ddb18[_0xe8a8('0x9e')]){freeVariablesPredictive(_0x7ddb18);if(_0x7ddb18[_0xe8a8('0x73')]===0x0&&_0x7ddb18[_0xe8a8('0x54')]===0x0&&_0x7ddb18[_0xe8a8('0x57')]===0x0&&(_0x7ddb18[_0xe8a8('0x9f')]||0x0)===0x0){_0x7ddb18[_0xe8a8('0x9e')]=![];_0x7ddb18[_0xe8a8('0x50')]=0x0;_0x7ddb18[_0xe8a8('0x3e')]=_0xe8a8('0x42');loggerSyncQueueSummary[_0xe8a8('0x94')](_0xe8a8('0xa0'),_0x7ddb18[_0xe8a8('0x40')],_0xe8a8('0xa1'));}else{_0x7ddb18[_0xe8a8('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xe8a8('0x94')](_0xe8a8('0xa0'),_0x7ddb18[_0xe8a8('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x7ddb18);}}function notSendMessagesCampaign(_0xeeff26){if(_0xeeff26[_0xe8a8('0x9e')]){if(_0xeeff26[_0xe8a8('0x73')]===0x0){_0xeeff26[_0xe8a8('0x9e')]=![];_0xeeff26['message']=_0xe8a8('0x42');loggerSyncQueueSummary[_0xe8a8('0x94')](_0xe8a8('0xa2'),_0xeeff26[_0xe8a8('0x40')],_0xe8a8('0xa1'));}else{_0xeeff26['message']=_0xe8a8('0xa3');loggerSyncQueueSummary[_0xe8a8('0x94')](_0xe8a8('0xa2'),_0xeeff26[_0xe8a8('0x40')],'is\x20disactive');}emitCampaignSummary(_0xeeff26);}}function createObjHistory(_0x248201,_0x25d761,_0xf47b18,_0x269fa3,_0x45e286){_0x248201[_0xe8a8('0x3e')]=_0xf47b18;var _0x46d936=new Action(_0x248201,_0x25d761);var _0x386e33=new History(_0x46d936);_0x386e33[_0xe8a8('0xa4')]=_0x269fa3;_0x386e33[_0xe8a8('0xa5')]=_0x45e286;_0x386e33[_0xe8a8('0xa6')]=_0x46d936[_0xe8a8('0xa7')];return _0x386e33;}Dialer[_0xe8a8('0x1a')]['loopClearZombieChannels']=function(){var _0x26ab51=this;setInterval(function(){_0x26ab51[_0xe8a8('0xa8')](_0x26ab51[_0xe8a8('0xa9')],_0xe8a8('0xaa'));_0x26ab51[_0xe8a8('0xa8')](_0x26ab51['actions'],_0xe8a8('0xab'));},0x32c8);};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xa8')]=function(_0x2920dd,_0x27fda9){var _0x5e166b=this;for(var _0x2ca2d2 in _0x2920dd){if(typeof _0x2920dd[_0x2ca2d2]!==_0xe8a8('0xac')){this[_0xe8a8('0xad')][_0xe8a8('0x1b')](function(){if(!_[_0xe8a8('0xae')](_0x2920dd[_0x2ca2d2])){return ami[_0xe8a8('0xaf')]({'action':_0xe8a8('0xb0'),'channel':_0x2920dd[_0x2ca2d2][_0xe8a8('0xb1')]})['catch'](function(_0x379065){if(_0x379065[_0xe8a8('0x3e')]===_0xe8a8('0xb2')){setTimeout(function(){if(_0x2920dd[_0x2ca2d2]&&_0x2920dd[_0x2ca2d2][_0xe8a8('0x4c')]!=='ivr'){_0x5e166b[_0xe8a8('0xb3')](_0x5e166b[_0xe8a8('0x1e')][_0x2920dd[_0x2ca2d2][_0xe8a8('0xb4')]]);logger[_0xe8a8('0x94')](_0xe8a8('0xb5'),_0x27fda9,_0x2ca2d2,_0x2920dd[_0x2ca2d2][_0xe8a8('0xb4')]);delete _0x2920dd[_0x2ca2d2];}if(_0x2920dd[_0x2ca2d2]&&_0x2920dd[_0x2ca2d2][_0xe8a8('0x4c')]==='ivr'){_0x5e166b[_0xe8a8('0xb3')](_0x5e166b[_0xe8a8('0x1f')][_0x2920dd[_0x2ca2d2]['queue']]);logger[_0xe8a8('0x94')]('[Dialer][checkChannel][ivr]',_0x27fda9,_0x2ca2d2,_0x2920dd[_0x2ca2d2][_0xe8a8('0xb4')]);delete _0x2920dd[_0x2ca2d2];}},0x2328);}});}});}}};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xb6')]=function(_0x33107c){return BPromise[_0xe8a8('0xb7')]()[_0xe8a8('0xb8')](cmHopper[_0xe8a8('0xb6')](_0x33107c))[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xba')));};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xbb')]=function(_0x47ace2){return BPromise[_0xe8a8('0xb7')]()[_0xe8a8('0xb8')](cmHopperBlack['checkIsBlackList'](_0x47ace2))['catch'](loggerCatch(_0xe8a8('0xbc')));};Dialer[_0xe8a8('0x1a')]['checkIsBlackListIvr']=function(_0x28bc36){return BPromise[_0xe8a8('0xb7')]()[_0xe8a8('0xb8')](cmHopperBlack['checkIsBlackListIvr'](_0x28bc36))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xe8a8('0x1a')]['averageHandleTime']=function(_0x2edc2e){return BPromise[_0xe8a8('0xb7')]()['then'](cmHopperHistory['avgHandleTime'](_0x2edc2e))[_0xe8a8('0xb9')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xbd')]=function(_0x289ada){return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x289ada))[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xbe')));};Dialer[_0xe8a8('0x1a')]['unlockContact']=function(_0x4483d3,_0x3d359e,_0x3005bf){return BPromise[_0xe8a8('0xb7')]()[_0xe8a8('0xb8')](cmHopper[_0xe8a8('0xbf')](_0x4483d3,_0x3d359e,_0x3005bf))[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xc0')));};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xc1')]=function(_0xc9165a,_0x272f2a,_0x129ded,_0x134796,_0x2de70d){return BPromise['resolve']()[_0xe8a8('0xb8')](cmHopper['getContactDialer'](_0xc9165a,_0x272f2a,_0x129ded,_0x134796))[_0xe8a8('0xb9')](function(_0x3089a8){_0x2de70d[_0xe8a8('0xc2')]-=_0x129ded;_0x2de70d[_0xe8a8('0xc2')]=_0x2de70d['temp']>0x0?_0x2de70d[_0xe8a8('0xc2')]:0x0;loggerCatch(_0xe8a8('0xc3'))(_0x3089a8);});};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xc4')]=function(_0x5e9a92,_0x2d2b93,_0x33635d,_0x903048){return BPromise['resolve']()[_0xe8a8('0xb8')](cmHopper[_0xe8a8('0xc4')](_0x5e9a92,_0x2d2b93,_0x33635d))['catch'](function(_0x69a2af){_0x903048[_0xe8a8('0xc2')]-=_0x2d2b93;_0x903048['temp']=_0x903048[_0xe8a8('0xc2')]>0x0?_0x903048[_0xe8a8('0xc2')]:0x0;loggerCatch(_0xe8a8('0xc5'))(_0x69a2af);});};Dialer[_0xe8a8('0x1a')]['getVoiceQueueRtPauses']=function(_0x3ba6af){return BPromise['resolve']()[_0xe8a8('0xb8')](voiceQueueRt[_0xe8a8('0xc6')](_0x3ba6af))[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xc7')));};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xc8')]=function(_0x490e8e){return BPromise['resolve']()['then'](cmHopper[_0xe8a8('0xc8')](_0x490e8e))[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xc9')));};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xca')]=function(_0x227a60){return BPromise[_0xe8a8('0xb7')]()['then'](cmHopperHistory['createHistory'](_0x227a60))[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xcb')));};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xb3')]=function(_0x194edd){if(!_[_0xe8a8('0x3d')](_0x194edd)&&_0x194edd!==null){if(typeof _0x194edd[_0xe8a8('0x73')]!==_0xe8a8('0xac')){if(_0x194edd['originated']>0x0){_0x194edd[_0xe8a8('0x73')]-=0x1;}else{logger[_0xe8a8('0x94')](_0xe8a8('0xcc'));}}}else{logger[_0xe8a8('0x94')](_0xe8a8('0xcd'));}};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xce')]=function(_0x57dd84,_0x1068d6){var _0x5ae1c4=this;return function(_0x1f8cf4){_0x5ae1c4[_0xe8a8('0xb3')](_0x1068d6);logger['error'](_0x57dd84,util[_0xe8a8('0x95')](_0x1f8cf4,{'showHidden':![],'depth':null}));};};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xcf')]=function(_0xffc22f,_0x52a891,_0x3ff64e){var _0x5771fb={'state':0x19,'statedesc':_0xe8a8('0xd0')};this[_0xe8a8('0xb3')](_0x52a891);this[_0xe8a8('0xd1')](_[_0xe8a8('0xd2')](_0x5771fb,_['pick'](_0x3ff64e,[_0xe8a8('0xd3'),_0xe8a8('0xd4'),'UserId',_0xe8a8('0xd5'),_0xe8a8('0xd6')])),_0xe8a8('0xd7'),_0xe8a8('0xd8'));logger[_0xe8a8('0x94')](_0xffc22f);};Dialer[_0xe8a8('0x1a')]['isSuccess']=function(_0x5d7613){return _0x5d7613===_0xe8a8('0xd9');};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xda')]=function(_0xc5150f){return!_['isUndefined'](_0xc5150f)&&_0xc5150f&&!_['isUndefined'](_0xc5150f[_0xe8a8('0x40')])&&!_['isUndefined'](_0xc5150f[_0xe8a8('0x79')])&&_0xc5150f['active']&&(this[_0xe8a8('0x21')][util[_0xe8a8('0x7b')](_0xe8a8('0xdb'),_0xc5150f['name'])][_0xe8a8('0xb0')]==='reachable'||this['trunks'][util['format'](_0xe8a8('0xdb'),_0xc5150f[_0xe8a8('0x40')])]['status']===_0xe8a8('0xdc'));};Dialer['prototype'][_0xe8a8('0xd1')]=function(_0x57428a,_0x34303e,_0x46c9b4){this[_0xe8a8('0xca')](_0x57428a)[_0xe8a8('0xb9')](loggerCatch(_0x34303e));this[_0xe8a8('0xc8')](_0x57428a)[_0xe8a8('0xb9')](loggerCatch(_0x46c9b4));};Dialer[_0xe8a8('0x1a')]['syncVarSet']=function(_0x3ebc4e){var _0x25321e=this[_0xe8a8('0xa9')][_0x3ebc4e[_0xe8a8('0xdd')]];var _0xea9790;if(!_['isNil'](_0x3ebc4e)&&!_['isNil'](_0x3ebc4e['variable'])&&!_[_0xe8a8('0xae')](_0x3ebc4e[_0xe8a8('0xde')][_0xe8a8('0xdf')])&&_0x3ebc4e[_0xe8a8('0xe0')]===_0xe8a8('0xe1')&&_0x25321e){if(_0x25321e[_0xe8a8('0x4c')]!=='ivr'&&this[_0xe8a8('0x1e')][_0x25321e[_0xe8a8('0xb4')]]['dialAMDActive']&&_0x3ebc4e['value']===_0xe8a8('0xe2')){delete this[_0xe8a8('0xa9')][_0x3ebc4e['uniqueid']];this[_0xe8a8('0xb3')](this[_0xe8a8('0x1e')][_0x25321e[_0xe8a8('0xb4')]]);this['voiceQueues'][_0x25321e['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xe8a8('0x1e')][_0x25321e[_0xe8a8('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0xea9790=new Hangup(_0x25321e,_0x3ebc4e);_0xea9790['state']=0x12;_0xea9790[_0xe8a8('0xa5')]=_0xe8a8('0xe3');_0xea9790[_0xe8a8('0xe4')]=_0xe8a8('0xe5');ami[_0xe8a8('0x4b')](_0xe8a8('0xe6'),ut[_0xe8a8('0xe7')](_0xea9790,_0xe8a8('0xe8')));this[_0xe8a8('0xd1')](_0xea9790,_0xe8a8('0xe9'),'[syncHangupInAMD]');}if(_0x25321e[_0xe8a8('0x4c')]!==_0xe8a8('0x90')&&this[_0xe8a8('0x1e')][_0x25321e[_0xe8a8('0xb4')]]['dialAMDActive']&&_0x3ebc4e['value']==='MACHINE'){var _0x61c086=this;return new BPromise(function(_0x5439b4,_0x2a6aec){delete _0x61c086['uniqueId'][_0x3ebc4e[_0xe8a8('0xdd')]];_0x61c086[_0xe8a8('0xb3')](_0x61c086[_0xe8a8('0x1e')][_0x25321e[_0xe8a8('0xb4')]]);_0x61c086[_0xe8a8('0x1e')][_0x25321e['queue']][_0xe8a8('0x5d')]+=0x1;_0x61c086[_0xe8a8('0x1e')][_0x25321e[_0xe8a8('0xb4')]][_0xe8a8('0x5c')]+=0x1;var _0x35deb5=_0x61c086[_0xe8a8('0x1e')][_0x25321e['queue']];var _0x39f3b0=new Hangup(_0x25321e,_0x3ebc4e);_0x39f3b0[_0xe8a8('0xa4')]=0x13;_0x39f3b0[_0xe8a8('0xa5')]=_0xe8a8('0xea');_0x39f3b0[_0xe8a8('0xe4')]='AMD';_0x39f3b0[_0xe8a8('0xeb')]+=0x1;_0x39f3b0['countglobal']+=0x1;_0x39f3b0[_0xe8a8('0xe8')]=!![];ami['emit'](_0xe8a8('0xe6'),ut[_0xe8a8('0xe7')](_0x39f3b0,'amd'));_0x61c086[_0xe8a8('0xca')](_0x39f3b0)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xec')));if(_0x39f3b0[_0xe8a8('0xed')]+_0x39f3b0['countcongestionretry']+_0x39f3b0[_0xe8a8('0xee')]+_0x39f3b0[_0xe8a8('0xef')]+_0x39f3b0[_0xe8a8('0xf0')]+_0x39f3b0[_0xe8a8('0xf1')]+_0x39f3b0['countmachineretry']+_0x39f3b0[_0xe8a8('0xf2')]>=_0x35deb5[_0xe8a8('0xf3')]){_0x61c086[_0xe8a8('0xf4')](_0x39f3b0,_0x5439b4,_0x2a6aec,'reason19\x20machine....');}else{if(_0x39f3b0[_0xe8a8('0xeb')]>=_0x35deb5[_0xe8a8('0xf5')]){_0x61c086[_0xe8a8('0xf6')](_0x39f3b0,_0x5439b4,_0x2a6aec,'reason\x2019\x20machine....');}else{_0x61c086[_0xe8a8('0xbd')]({'active':![],'countmachineretry':_0x39f3b0[_0xe8a8('0xeb')],'scheduledat':moment()[_0xe8a8('0xf7')](_0x35deb5['dialMachineRetryFrequency'],_0xe8a8('0xf8'))[_0xe8a8('0x7b')](_0xe8a8('0xf9')),'ContactId':_0x39f3b0[_0xe8a8('0xd3')],'ListId':_0x39f3b0[_0xe8a8('0xd4')],'VoiceQueueId':_0x39f3b0['VoiceQueueId']||undefined,'CampaignId':_0x39f3b0[_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xfa')));_0x5439b4({'reschedule':0x1});}}});}if(_0x25321e[_0xe8a8('0x4c')]===_0xe8a8('0x90')&&this['campaigns'][_0x25321e['queue']][_0xe8a8('0xfb')]&&_0x3ebc4e[_0xe8a8('0xfc')]===_0xe8a8('0xe2')){delete this['uniqueId'][_0x3ebc4e[_0xe8a8('0xdd')]];this[_0xe8a8('0xb3')](this[_0xe8a8('0x1f')][_0x25321e[_0xe8a8('0xb4')]]);_0xea9790=new Hangup(_0x25321e,_0x3ebc4e);_0xea9790['state']=0x12;_0xea9790[_0xe8a8('0xa5')]=_0xe8a8('0xe3');_0xea9790[_0xe8a8('0xe4')]='AMD';ami[_0xe8a8('0x4b')](_0xe8a8('0xe6'),ut['buildObj'](_0xea9790,_0xe8a8('0xe8')));this[_0xe8a8('0xd1')](_0xea9790,_0xe8a8('0xfd'),_0xe8a8('0xfe'));}if(_0x25321e[_0xe8a8('0x4c')]==='ivr'&&this['campaigns'][_0x25321e[_0xe8a8('0xb4')]][_0xe8a8('0xfb')]&&_0x3ebc4e[_0xe8a8('0xfc')]===_0xe8a8('0xff')){var _0x61c086=this;return new BPromise(function(_0x2a9108,_0x26625d){delete _0x61c086['uniqueId'][_0x3ebc4e[_0xe8a8('0xdd')]];_0x61c086[_0xe8a8('0xb3')](_0x61c086[_0xe8a8('0x1f')][_0x25321e['queue']]);_0x61c086['campaigns'][_0x25321e[_0xe8a8('0xb4')]][_0xe8a8('0x5d')]+=0x1;_0x61c086[_0xe8a8('0x1f')][_0x25321e[_0xe8a8('0xb4')]][_0xe8a8('0x5c')]+=0x1;var _0x10111f=_0x61c086[_0xe8a8('0x1f')][_0x25321e['queue']];var _0x53d617=new Hangup(_0x25321e,_0x3ebc4e);_0x53d617['state']=0x13;_0x53d617['statedesc']=_0xe8a8('0xea');_0x53d617[_0xe8a8('0xe4')]=_0xe8a8('0xe5');_0x53d617[_0xe8a8('0xeb')]+=0x1;_0x53d617['countglobal']+=0x1;_0x53d617[_0xe8a8('0xe8')]=!![];ami[_0xe8a8('0x4b')]('custom:amd',ut[_0xe8a8('0xe7')](_0x53d617,_0xe8a8('0xe8')));_0x61c086[_0xe8a8('0xca')](_0x53d617)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xec')));if(_0x53d617[_0xe8a8('0xed')]+_0x53d617[_0xe8a8('0x100')]+_0x53d617[_0xe8a8('0xee')]+_0x53d617[_0xe8a8('0xef')]+_0x53d617['countdropretry']+_0x53d617[_0xe8a8('0xf1')]+_0x53d617[_0xe8a8('0xeb')]+_0x53d617['countagentrejectretry']>=_0x10111f[_0xe8a8('0xf3')]){_0x61c086[_0xe8a8('0xf4')](_0x53d617,_0x2a9108,_0x26625d,_0xe8a8('0x101'));}else{if(_0x53d617[_0xe8a8('0xeb')]>=_0x10111f[_0xe8a8('0xf5')]){_0x61c086[_0xe8a8('0xf6')](_0x53d617,_0x2a9108,_0x26625d,_0xe8a8('0x102'));}else{_0x61c086[_0xe8a8('0xbd')]({'active':![],'countmachineretry':_0x53d617[_0xe8a8('0xeb')],'scheduledat':moment()[_0xe8a8('0xf7')](_0x10111f[_0xe8a8('0x103')],_0xe8a8('0xf8'))[_0xe8a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53d617[_0xe8a8('0xd3')],'ListId':_0x53d617['ListId'],'VoiceQueueId':_0x53d617[_0xe8a8('0xd5')]||undefined,'CampaignId':_0x53d617[_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xfa')));_0x2a9108({'reschedule':0x1});}}});}}};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x33')]=function(_0x3b4848){var _0xa26469=this[_0xe8a8('0xa9')][_0x3b4848[_0xe8a8('0xdd')]];var _0x1a8e4d=this;var _0x29493a;if(_0xa26469&&_0xa26469['type']===_0xe8a8('0x90')){delete this[_0xe8a8('0xa9')][_0x3b4848[_0xe8a8('0xdd')]];this[_0xe8a8('0xb3')](this[_0xe8a8('0x1f')][_0xa26469['queue']]);this[_0xe8a8('0x1f')][_0xa26469[_0xe8a8('0xb4')]][_0xe8a8('0x104')]+=0x1;_0x29493a=new Hangup(_0xa26469,_0x3b4848);this[_0xe8a8('0xca')](_0x29493a)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x105')));this[_0xe8a8('0xc8')](_0x29493a)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x106')));}if(_0xa26469&&_0xa26469['type']!==_0xe8a8('0x90')&&isNotNull(this[_0xe8a8('0x1e')][_0xa26469['queue']][_0xe8a8('0x107')])){delete this['uniqueId'][_0x3b4848[_0xe8a8('0xdd')]];this[_0xe8a8('0xb3')](this[_0xe8a8('0x1e')][_0xa26469[_0xe8a8('0xb4')]]);this[_0xe8a8('0x1e')][_0xa26469[_0xe8a8('0xb4')]][_0xe8a8('0x5d')]+=0x1;this['voiceQueues'][_0xa26469[_0xe8a8('0xb4')]][_0xe8a8('0x5c')]+=0x1;_0x29493a=new Hangup(_0xa26469,_0x3b4848);_0x29493a[_0xe8a8('0xa4')]=0x10;_0x29493a[_0xe8a8('0xa5')]=_0xe8a8('0x108');_0x29493a[_0xe8a8('0xe4')]=_0xe8a8('0x109');this[_0xe8a8('0xca')](_0x29493a)[_0xe8a8('0xb9')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xe8a8('0xc8')](_0x29493a)[_0xe8a8('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0xa26469&&_0xa26469['type']!==_0xe8a8('0x90')&&!isNotNull(this['voiceQueues'][_0xa26469[_0xe8a8('0xb4')]]['dialQueueProject'])){delete this[_0xe8a8('0xa9')][_0x3b4848[_0xe8a8('0xdd')]];this[_0xe8a8('0xb3')](this['voiceQueues'][_0xa26469[_0xe8a8('0xb4')]]);this['voiceQueues'][_0xa26469['queue']]['outboundUnknownCallsDay']+=0x1;_0x29493a=new Hangup(_0xa26469,_0x3b4848);_0x29493a[_0xe8a8('0xa4')]=0xc;_0x29493a[_0xe8a8('0xa5')]=_0x3b4848[_0xe8a8('0x10a')];_0x29493a[_0xe8a8('0xe4')]='Unknow';this['createHistory'](_0x29493a)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xe8a8('0xc8')](_0x29493a)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x106')));}};Dialer['prototype'][_0xe8a8('0x31')]=function(_0x4a30d8){var _0x21f616=this[_0xe8a8('0xa9')][_0x4a30d8[_0xe8a8('0xdd')]];var _0x1a8327=this;if(this[_0xe8a8('0x1e')][_0x4a30d8[_0xe8a8('0xb4')]]){if(_0x21f616&&_0x21f616['type']!==_0xe8a8('0x90')){delete this[_0xe8a8('0xa9')][_0x4a30d8[_0xe8a8('0xdd')]];this[_0xe8a8('0x1e')][_0x4a30d8['queue']][_0xe8a8('0x5d')]+=0x1;var _0x34607a=new AgentComplete(_0x21f616,_0x4a30d8);if(_0x4a30d8['reason']===_0xe8a8('0x10b')){_0x34607a[_0xe8a8('0x10c')]=this[_0xe8a8('0x1e')][_0x4a30d8[_0xe8a8('0xb4')]][_0xe8a8('0x10d')]&&this['voiceQueues'][_0x4a30d8[_0xe8a8('0xb4')]][_0xe8a8('0x10e')]?moment()[_0xe8a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xe8a8('0xca')](_0x34607a)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x10f')));this[_0xe8a8('0xc8')](_0x34607a)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x110')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x2b7205){if(this['voiceQueues'][_0x2b7205[_0xe8a8('0xb4')]]){if(this[_0xe8a8('0xa9')][_0x2b7205[_0xe8a8('0xdd')]]&&this[_0xe8a8('0xa9')][_0x2b7205[_0xe8a8('0xdd')]][_0xe8a8('0x4c')]!==_0xe8a8('0x90')){this[_0xe8a8('0xb3')](this['voiceQueues'][_0x2b7205[_0xe8a8('0xb4')]]);this['uniqueId'][_0x2b7205[_0xe8a8('0xdd')]]['answertime']=moment()[_0xe8a8('0x7b')](_0xe8a8('0xf9'));}}};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x111')]=function(_0x310789){this['createHistory'](_0x310789)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x10f')));this['moveContactManagedDialer'](_0x310789)['catch'](loggerCatch(_0xe8a8('0x112')));};Dialer['prototype'][_0xe8a8('0x2d')]=function(_0x72c55c){var _0x3f8e26=this[_0xe8a8('0xa9')][_0x72c55c[_0xe8a8('0xdd')]];var _0x2b8523=this;if(this['voiceQueues'][_0x72c55c[_0xe8a8('0xb4')]]){if(_0x3f8e26&&_0x3f8e26[_0xe8a8('0x4c')]!=='ivr'){delete this['uniqueId'][_0x72c55c[_0xe8a8('0xdd')]];this[_0xe8a8('0xb3')](this[_0xe8a8('0x1e')][_0x72c55c[_0xe8a8('0xb4')]]);_0x3f8e26[_0xe8a8('0x113')]=moment()[_0xe8a8('0x7b')](_0xe8a8('0xf9'));var _0x73e1f3=new QueueCallerAbandon(_0x3f8e26,_0x72c55c);if(getSeconds(_0x3f8e26[_0xe8a8('0x113')],_0x3f8e26[_0xe8a8('0x114')])>=_0x3f8e26[_0xe8a8('0x115')]){this[_0xe8a8('0x1e')][_0x72c55c[_0xe8a8('0xb4')]][_0xe8a8('0x6c')]+=0x1;this[_0xe8a8('0x1e')][_0x72c55c['queue']][_0xe8a8('0x62')]+=0x1;this[_0xe8a8('0x1e')][_0x72c55c[_0xe8a8('0xb4')]][_0xe8a8('0x6e')]+=0x1;_0x73e1f3[_0xe8a8('0xa4')]=0xa;_0x73e1f3[_0xe8a8('0xa5')]=_0xe8a8('0x116');_0x73e1f3[_0xe8a8('0x117')]=_0xe8a8('0x118');_0x73e1f3['agiafterat']=this[_0xe8a8('0x1e')][_0x72c55c[_0xe8a8('0xb4')]][_0xe8a8('0x10d')]?moment()[_0xe8a8('0x7b')](_0xe8a8('0xf9')):undefined;_0x73e1f3[_0xe8a8('0xf0')]+=0x1;_0x73e1f3[_0xe8a8('0x119')]+=0x1;if(_0x73e1f3[_0xe8a8('0xf0')]>=this['voiceQueues'][_0x72c55c[_0xe8a8('0xb4')]]['dialDropMaxRetry']){this[_0xe8a8('0x111')](_0x73e1f3);}else{this[_0xe8a8('0xbd')]({'active':![],'countdropretry':_0x73e1f3[_0xe8a8('0xf0')],'scheduledat':moment()['add'](this[_0xe8a8('0x1e')][_0x72c55c['queue']][_0xe8a8('0x11a')],_0xe8a8('0xf8'))['format'](_0xe8a8('0xf9')),'ContactId':_0x3f8e26['ContactId'],'ListId':_0x3f8e26[_0xe8a8('0xd4')],'VoiceQueueId':_0x3f8e26[_0xe8a8('0xd5')]||undefined,'CampaignId':_0x3f8e26[_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch('[rescheduleContact][Drop]'));var _0x1ccb89=new History(_0x73e1f3);_0x1ccb89[_0xe8a8('0xa4')]=0xa;_0x1ccb89[_0xe8a8('0xa5')]=_0xe8a8('0x116');_0x1ccb89['starttime']=moment()['format'](_0xe8a8('0xf9'));_0x1ccb89[_0xe8a8('0xa6')]=_0x1ccb89[_0xe8a8('0xa7')];_0x1ccb89[_0xe8a8('0x11b')]=_0x73e1f3[_0xe8a8('0x11b')];_0x1ccb89[_0xe8a8('0x11c')]=_0x73e1f3[_0xe8a8('0x11c')];this[_0xe8a8('0xca')](_0x1ccb89)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x11d')));}}else{this[_0xe8a8('0x1e')][_0x72c55c['queue']][_0xe8a8('0x6b')]+=0x1;this['voiceQueues'][_0x72c55c[_0xe8a8('0xb4')]][_0xe8a8('0x61')]+=0x1;_0x73e1f3[_0xe8a8('0xa4')]=0xb;_0x73e1f3[_0xe8a8('0xa5')]=_0xe8a8('0x11e');_0x73e1f3[_0xe8a8('0x117')]=_0xe8a8('0x11f');_0x73e1f3['countabandonedretry']+=0x1;_0x73e1f3[_0xe8a8('0x119')]+=0x1;if(_0x73e1f3[_0xe8a8('0xf1')]>=this[_0xe8a8('0x1e')][_0x72c55c[_0xe8a8('0xb4')]][_0xe8a8('0x120')]){this[_0xe8a8('0x111')](_0x73e1f3);}else{this[_0xe8a8('0xbd')]({'active':![],'countabandonedretry':_0x73e1f3[_0xe8a8('0xf1')],'scheduledat':moment()[_0xe8a8('0xf7')](this['voiceQueues'][_0x72c55c['queue']][_0xe8a8('0x121')],_0xe8a8('0xf8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f8e26[_0xe8a8('0xd3')],'ListId':_0x3f8e26[_0xe8a8('0xd4')],'VoiceQueueId':_0x3f8e26[_0xe8a8('0xd5')]||undefined,'CampaignId':_0x3f8e26['CampaignId']||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x122')));var _0x1ccb89=new History(_0x73e1f3);_0x1ccb89[_0xe8a8('0xa4')]=0xb;_0x1ccb89[_0xe8a8('0xa5')]=_0xe8a8('0x11e');_0x1ccb89[_0xe8a8('0xa7')]=moment()['format'](_0xe8a8('0xf9'));_0x1ccb89[_0xe8a8('0xa6')]=_0x1ccb89[_0xe8a8('0xa7')];_0x1ccb89[_0xe8a8('0x11b')]=_0x73e1f3[_0xe8a8('0x11b')];_0x1ccb89[_0xe8a8('0x11c')]=_0x73e1f3[_0xe8a8('0x11c')];this[_0xe8a8('0xca')](_0x1ccb89)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x123')));}}}}};Dialer['prototype'][_0xe8a8('0x35')]=function(_0x3227aa){if(this[_0xe8a8('0x23')][_0x3227aa[_0xe8a8('0xdd')]]){this[_0xe8a8('0x23')][_0x3227aa[_0xe8a8('0xdd')]][_0xe8a8('0xb1')]=_0x3227aa['channel'];}if(this[_0xe8a8('0xa9')][_0x3227aa['uniqueid']]){this[_0xe8a8('0xa9')][_0x3227aa[_0xe8a8('0xdd')]][_0xe8a8('0xb1')]=_0x3227aa[_0xe8a8('0xb1')];}};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x39')]=function(_0x372cee){if(strategy[this[_0xe8a8('0x1e')][this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]['strategy']]===_0xe8a8('0x19')){if(this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]]&&_[_0xe8a8('0xae')](this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]]['locked'])&&_0x372cee[_0xe8a8('0xb0')]==='1'&&_0x372cee[_0xe8a8('0x125')]==='0'){if(this['agents'][_0x372cee[_0xe8a8('0x126')]]){if(!this['agents'][_0x372cee[_0xe8a8('0x126')]][_0xe8a8('0x127')]){this[_0xe8a8('0x20')][_0x372cee[_0xe8a8('0x126')]][_0xe8a8('0x127')]=!![];this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]][_0xe8a8('0x127')]=!![];this['actions'][_0x372cee['actionid']][_0xe8a8('0x126')]=_0x372cee[_0xe8a8('0x126')];}}}}else if((strategy[this[_0xe8a8('0x1e')][this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]['strategy']]||_0xe8a8('0x128'))==='rrmemory'){if(this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]]){if(this[_0xe8a8('0x20')][_0x372cee[_0xe8a8('0x126')]]){this['actions'][_0x372cee[_0xe8a8('0x124')]][_0xe8a8('0x126')]=_0x372cee[_0xe8a8('0x126')];if(_['isNil'](this[_0xe8a8('0x129')][this['actions'][_0x372cee[_0xe8a8('0x124')]][_0xe8a8('0xb4')]])){this[_0xe8a8('0x129')][this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]]['queue']]=[];}this[_0xe8a8('0x129')][this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]]['queue']][_0xe8a8('0x12a')](_[_0xe8a8('0xd2')](_['pick'](this[_0xe8a8('0x23')][_0x372cee[_0xe8a8('0x124')]],[_0xe8a8('0x12b'),_0xe8a8('0x126')]),{'status':_0x372cee[_0xe8a8('0xb0')],'paused':_0x372cee[_0xe8a8('0x125')]}));}}}};function unlockQueueStatus(_0x2e68fc,_0x519bb8){setTimeout(function(){if(_[_0xe8a8('0x3d')](_0x2e68fc[_0xe8a8('0x12c')])){loggerBooked[_0xe8a8('0x94')](_0xe8a8('0x12d'),_0x519bb8);}_0x2e68fc[_0xe8a8('0x12c')]=!![];loggerBooked[_0xe8a8('0x7e')]('[booked][unlockQueueStatus]',_0x519bb8,JSON['stringify'](_[_0xe8a8('0x12e')](_0x2e68fc,[_0xe8a8('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xe8a8('0x1a')][_0xe8a8('0x3b')]=function(_0x43ef6d){var _0x1ff5f2=this;var _0x56f916=_0x1ff5f2[_0xe8a8('0x1e')][_0x1ff5f2[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]];if(strategy[this[_0xe8a8('0x1e')][this['actions'][_0x43ef6d['actionid']][_0xe8a8('0xb4')]][_0xe8a8('0x4e')]]==='roundrobin'){if(this['actions'][_0x43ef6d[_0xe8a8('0x124')]]&&this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0x126')]){this[_0xe8a8('0x1d')][_0xe8a8('0x12f')](this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0x12b')],this['actions'][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0x126')])[_0xe8a8('0xb9')](function(_0x3321d5){logger[_0xe8a8('0x94')](_0xe8a8('0x130'),util[_0xe8a8('0x95')](_0x3321d5,{'showHidden':![],'depth':null}));})[_0xe8a8('0x131')](function(){_0x1ff5f2[_0xe8a8('0xb3')](_0x1ff5f2[_0xe8a8('0x1e')][_0x1ff5f2[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]);_0x1ff5f2['agents'][_0x1ff5f2['actions'][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0x126')]]['locked']=![];delete _0x1ff5f2['actions'][_0x43ef6d['actionid']];unlockQueueStatus(_0x56f916);});}else{this[_0xe8a8('0xb3')](this[_0xe8a8('0x1e')][this['actions'][_0x43ef6d['actionid']][_0xe8a8('0xb4')]]);this[_0xe8a8('0xbd')]({'active':![],'ContactId':this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xd3')],'ListId':this[_0xe8a8('0x23')][_0x43ef6d['actionid']]['ListId'],'VoiceQueueId':this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xd5')]||undefined,'CampaignId':this['actions'][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x132')));delete this[_0xe8a8('0x23')][_0x43ef6d['actionid']];unlockQueueStatus(_0x56f916);}}else if((strategy[this['voiceQueues'][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]][_0xe8a8('0x4e')]]||'rrmemory')===_0xe8a8('0x128')){var _0x1c1de5;if(this[_0xe8a8('0x23')][_0x43ef6d['actionid']]&&!_['isEmpty'](this[_0xe8a8('0x129')][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]])){if(this['queueBookedRR'][_0x1ff5f2[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]]['queue']]){this[_0xe8a8('0x133')][_0x1ff5f2[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]=this[_0xe8a8('0x133')][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]?this[_0xe8a8('0x133')][this['actions'][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]:this['queueBooked'][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]]?this['queueBooked'][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]][_0xe8a8('0x134')]||0x0:0x0;}this[_0xe8a8('0x129')][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]]['queue']]['_rr']=this[_0xe8a8('0x133')][this[_0xe8a8('0x23')][_0x43ef6d[_0xe8a8('0x124')]][_0xe8a8('0xb4')]];for(var _0x231097=0x0;_0x231097=0x0;})[_0xe8a8('0xb9')](myreject(_0x4a070b)));}}else{_0x3f7df1['push'](ami['Action']({'action':_0xe8a8('0x14a'),'command':util['format']('iftime\x20%s,%s',_0x6a61cc,!_[_0xe8a8('0x3d')](config[_0xe8a8('0x148')][_0x3ace93])?_0x3ace93:'')})[_0xe8a8('0xb8')](function(_0x490ec9){return _0x490ec9[_0xe8a8('0x14c')][_0xe8a8('0x14e')]('true')>=0x0;})[_0xe8a8('0xb9')](myreject(_0x4a070b)));}BPromise[_0xe8a8('0x14f')](_0x3f7df1)['then'](function(_0x5697a6){var _0x243667=_[_0xe8a8('0x150')](_0x5697a6);if(_0x243667){return _0x1a55c4(_0x243667);}else{_0x37ce2e[_0xe8a8('0x3e')]=_0x13746?_0xe8a8('0x151'):_0xe8a8('0x152');return _0x4a070b(msgResponse(_0xe8a8('0x153'),_0xe8a8('0x145'),_0xe8a8('0x154')+_0x13746+'\x20'+_0x266ab0+_0xe8a8('0x155')+util[_0xe8a8('0x95')](_0x6a61cc,{'showHidden':![],'depth':null})+_0xe8a8('0x156')+_0x3ace93));}})[_0xe8a8('0xb9')](function(_0x3b8b5c){return _0x4a070b(msgResponse(_0xe8a8('0x143'),'Failure',JSON['stringify'](_0x3b8b5c)));});});};Dialer['prototype'][_0xe8a8('0x157')]=function(_0x2215e1){var _0x28961f=this;return function(){switch(_0x2215e1['dialMethod']){case _0xe8a8('0x158'):freeVariablesPredictive(_0x2215e1);_0x28961f[_0xe8a8('0x159')](_0x2215e1,0x1);break;case _0xe8a8('0x15a'):freeVariablesPredictive(_0x2215e1);_0x28961f['handlePower'](_0x2215e1,_0x2215e1[_0xe8a8('0x15b')]);break;case _0xe8a8('0x9'):_0x28961f[_0xe8a8('0x9')](_0x2215e1);break;case _0xe8a8('0x8'):freeVariablesPredictive(_0x2215e1);_0x28961f[_0xe8a8('0x159')](_0x2215e1,0x1);break;default:freeVariablesPredictive(_0x2215e1);logger[_0xe8a8('0x94')](_0xe8a8('0x15c'),_0x2215e1[_0xe8a8('0x40')],_0xe8a8('0x15d'));}};};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x15e')]=function(_0x33e654){var _0x1e3440=this;return function(){_0x1e3440[_0xe8a8('0x15f')](_0x33e654);};};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xb')]=function(_0x3953b0){var _0x514f2a=this;if(isNotPreview(_0x3953b0[_0xe8a8('0x59')])){if(isVoiceQueueOutbound(_0x3953b0[_0xe8a8('0x4c')])&&isActive(_0x3953b0[_0xe8a8('0x58')])){_0x3953b0['sendMessageOneNotActive']=!![];BPromise[_0xe8a8('0xb7')]()[_0xe8a8('0xb8')](checkIsLoggedIn(_0x3953b0,_0x3953b0[_0xe8a8('0x51')]))[_0xe8a8('0xb8')](checkIsActive(_0x3953b0,_0x3953b0['dialActive']))['then'](checkInterval(_0x3953b0))[_0xe8a8('0xb8')](_0x514f2a[_0xe8a8('0x160')](_0x3953b0))['then'](_0x514f2a[_0xe8a8('0x141')](_0x3953b0[_0xe8a8('0x161')],_0x3953b0[_0xe8a8('0x162')],_0x3953b0[_0xe8a8('0x40')],_0x3953b0))[_0xe8a8('0xb8')](_0x514f2a[_0xe8a8('0x142')](_0x3953b0[_0xe8a8('0x43')],_0x3953b0['dialTimezone'],_0x3953b0['name'],_0x3953b0))[_0xe8a8('0xb8')](_0x514f2a[_0xe8a8('0x157')](_0x3953b0))[_0xe8a8('0xb9')](loggerCatchQueueSummary(_0xe8a8('0x163'),_0x3953b0));}else{notSendMessagesQueue(_0x3953b0);}}else{freeVariablesPredictive(_0x3953b0);}};Dialer[_0xe8a8('0x1a')]['syncCampaigns']=function(){var _0x492b6a=this;var _0x78220d;for(var _0x342207 in this[_0xe8a8('0x1f')]){if(typeof this[_0xe8a8('0x1f')][_0x342207]!==_0xe8a8('0xac')){_0x78220d=this[_0xe8a8('0x1f')][_0x342207];if(isCampaignIvr(_0x78220d['type'])&&isActive(_0x78220d[_0xe8a8('0x79')])){_0x78220d[_0xe8a8('0x9e')]=!![];BPromise[_0xe8a8('0xb7')]()['then'](checkIsActive(_0x78220d,_0x78220d[_0xe8a8('0x79')]))['then'](checkInterval(_0x78220d))[_0xe8a8('0xb8')](_0x492b6a['checkIsTrunkReachable'](_0x78220d))[_0xe8a8('0xb8')](_0x492b6a['checkIfTime'](_0x78220d['dialGlobalInterval'],_0x78220d[_0xe8a8('0x162')],_0x78220d['name'],_0x78220d))['then'](_0x492b6a[_0xe8a8('0x142')](_0x78220d[_0xe8a8('0x43')],_0x78220d[_0xe8a8('0x162')],_0x78220d[_0xe8a8('0x40')],_0x78220d))['then'](_0x492b6a[_0xe8a8('0x15e')](_0x78220d))[_0xe8a8('0xb9')](loggerCatchQueueSummary(_0xe8a8('0x164'),_0x78220d));}else{notSendMessagesCampaign(_0x78220d);}}}};function getCallerIdRandom(_0x1a857c,_0x3ced54){var _0x385083;var _0x1097e2;var _0x14662e;if(_0x3ced54<=0x0){_0x3ced54=0x1;}_0x385083=new RegExp(_0xe8a8('0x165')+_0x3ced54+'}$');_0x1097e2=Math['pow'](0xa,_0x3ced54-0x1);_0x14662e=Math['pow'](0xa,_0x3ced54)-0x1;return util['format']('%s',_[_0xe8a8('0x166')](_0x1a857c,_0x385083,_[_0xe8a8('0x167')](_0x1097e2,_0x14662e)));}function extractCalleridName(_0x51fb64){var _0x58e004=_0x51fb64[_0xe8a8('0x168')](/"(.*?)"/);return _0x58e004?_0x58e004[0x1]:_0x51fb64;}function extractCalleridNumber(_0xd0a825){var _0x49e47c=_0xd0a825[_0xe8a8('0x168')](/<(.*?)>/);return _0x49e47c?_0x49e47c[0x1]:_0xd0a825;}Dialer[_0xe8a8('0x1a')][_0xe8a8('0x169')]=function(_0x18c0c9,_0x96804c){var _0x4fbbc3=this;var _0x759947=uuid['v4']();this[_0xe8a8('0x23')][_0x759947]=new Action(_0x18c0c9,_0x96804c,_0x759947);return new BPromise(function(_0x1090d2,_0x1380df){if(_['isUndefined'](_0x18c0c9)&&typeof _0x18c0c9!==_0xe8a8('0x16a')){return _0x1380df(msgResponse(_0xe8a8('0x16b'),_0xe8a8('0x145'),_0xe8a8('0x16c')));}if(_[_0xe8a8('0x3d')](_0x96804c[_0xe8a8('0x16d')]['phone'])||_0x96804c[_0xe8a8('0x16d')]['phone']===null){return _0x1380df(msgResponse(_0xe8a8('0x16b'),_0xe8a8('0x145'),_0xe8a8('0x16e')));}var _0x2533c6={'XMD-CALLERID':_0x4fbbc3[_0xe8a8('0x23')][_0x759947][_0xe8a8('0x16f')](),'XMD-AGI':_0x18c0c9[_0xe8a8('0x107')]?util[_0xe8a8('0x7b')]('\x22agi://%s/square,%s\x22',ipAgi,_0x18c0c9[_0xe8a8('0x107')]):_0xe8a8('0x170'),'XMD-AGIAFTER':_0x18c0c9['dialQueueProject2']?util[_0xe8a8('0x7b')]('\x22agi://%s/square,%s\x22',ipAgi,_0x18c0c9[_0xe8a8('0x10d')]):_0xe8a8('0x170'),'XMD-QUEUE':_0x18c0c9['type']==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x18c0c9['name'],_0x18c0c9[_0xe8a8('0x171')]||'',_0x18c0c9[_0xe8a8('0x10e')]?'c':'',_0x18c0c9[_0xe8a8('0x115')]||0x3):_0xe8a8('0x170'),'XMD-CONTACTID':_0x96804c[_0xe8a8('0xd3')],'XMD-CDRTYPE':_0xe8a8('0x7'),'CALLERID(all)':_0x4fbbc3[_0xe8a8('0x23')][_0x759947][_0xe8a8('0x16f')](),'XMD-AMD':_0x18c0c9['dialAMDActive']?'ACTIVE':_0xe8a8('0x170'),'XMD-DESTINATION':_0xe8a8('0xe1')};if(_0x18c0c9['dialAMDActive']){_0x2533c6['XMD-AMDINITIALSILENCE']=_0x18c0c9[_0xe8a8('0x172')]||0x9c4;_0x2533c6[_0xe8a8('0x173')]=_0x18c0c9[_0xe8a8('0x174')]||0x5dc;_0x2533c6[_0xe8a8('0x175')]=_0x18c0c9['dialAMDAfterGreetingSilence']||0x320;_0x2533c6[_0xe8a8('0x176')]=_0x18c0c9[_0xe8a8('0x177')]||0x1388;_0x2533c6[_0xe8a8('0x178')]=_0x18c0c9[_0xe8a8('0x179')]||0x64;_0x2533c6[_0xe8a8('0x17a')]=_0x18c0c9[_0xe8a8('0x17b')]||0x32;_0x2533c6[_0xe8a8('0x17c')]=_0x18c0c9['dialAMDMaximumNumberOfWords']||0x3;_0x2533c6[_0xe8a8('0x17d')]=_0x18c0c9[_0xe8a8('0x17e')]||0x100;_0x2533c6[_0xe8a8('0x17f')]=_0x18c0c9[_0xe8a8('0x180')]||0x1388;}if(_0x18c0c9['type']===_0xe8a8('0x4d')){_0x2533c6[_0xe8a8('0x181')]=_0x96804c[_0xe8a8('0xd5')];}else{_0x2533c6['XMD-CAMPAIGNID']=_0x96804c[_0xe8a8('0xd6')];}for(var _0x345656 in _0x96804c[_0xe8a8('0x16d')]){if(typeof _0x96804c[_0xe8a8('0x16d')][_0x345656]!==_0xe8a8('0xac')){if(isNotNull(_0x96804c['Contact'][_0x345656])&&_0x345656!=='id'&&_0x345656!=='tags'&&_0x345656!==_0xe8a8('0x182')&&_0x345656!==_0xe8a8('0x183')){_0x2533c6[util[_0xe8a8('0x7b')](_0xe8a8('0x184'),'XMD-',_[_0xe8a8('0x185')](_0x345656))]=_0x96804c[_0xe8a8('0x16d')][_0x345656];}}}var _0x25c813=_0x4fbbc3[_0xe8a8('0xda')](_0x18c0c9[_0xe8a8('0x78')])?getCallerId(_0x18c0c9['Trunk'][_0xe8a8('0x7a')],_0x18c0c9[_0xe8a8('0x5a')],_0x18c0c9[_0xe8a8('0x186')]>0x0?getCallerIdRandom(_0x18c0c9[_0xe8a8('0x5b')],_0x18c0c9[_0xe8a8('0x186')]):_0x18c0c9['dialOriginateCallerIdNumber']):getCallerId(_[_0xe8a8('0xae')](_0x18c0c9[_0xe8a8('0x187')])?_0x18c0c9[_0xe8a8('0x78')]['callerid']:_0x18c0c9[_0xe8a8('0x187')][_0xe8a8('0x7a')],_0x18c0c9[_0xe8a8('0x5a')],_0x18c0c9[_0xe8a8('0x186')]>0x0?getCallerIdRandom(_0x18c0c9[_0xe8a8('0x5b')],_0x18c0c9[_0xe8a8('0x186')]):_0x18c0c9[_0xe8a8('0x5b')]);if(_0x25c813){_0x2533c6[_0xe8a8('0x188')]=_0x4fbbc3[_0xe8a8('0x23')][_0x759947][_0xe8a8('0x189')]=extractCalleridName(_0x25c813);_0x2533c6[_0xe8a8('0x18a')]=_0x4fbbc3[_0xe8a8('0x23')][_0x759947][_0xe8a8('0x18b')]=extractCalleridNumber(_0x25c813);}return ami['Action']({'actionid':_0x759947,'action':_0xe8a8('0x16b'),'channel':_0x4fbbc3[_0xe8a8('0xda')](_0x18c0c9[_0xe8a8('0x78')])?util['format'](_0xe8a8('0x18c'),_0x18c0c9['Trunk'][_0xe8a8('0x40')],isNotNull(_0x18c0c9[_0xe8a8('0x18d')])?_0x18c0c9[_0xe8a8('0x18d')][_0xe8a8('0x18e')]()||'':'',_0x18c0c9['dialCutDigit']>0x0?_0x96804c['Contact'][_0xe8a8('0x18f')][_0xe8a8('0x190')](_0x18c0c9[_0xe8a8('0x191')]):_0x96804c[_0xe8a8('0x16d')][_0xe8a8('0x18f')]):util['format'](_0xe8a8('0x18c'),_[_0xe8a8('0xae')](_0x18c0c9[_0xe8a8('0x187')])?_0x18c0c9[_0xe8a8('0x78')]['name']:_0x18c0c9[_0xe8a8('0x187')][_0xe8a8('0x40')],isNotNull(_0x18c0c9[_0xe8a8('0x18d')])?_0x18c0c9['dialPrefix'][_0xe8a8('0x18e')]()||'':'',_0x18c0c9['dialCutDigit']>0x0?_0x96804c[_0xe8a8('0x16d')][_0xe8a8('0x18f')][_0xe8a8('0x190')](_0x18c0c9[_0xe8a8('0x191')]):_0x96804c[_0xe8a8('0x16d')][_0xe8a8('0x18f')]),'callerid':_0x25c813,'Exten':_0xe8a8('0xe1'),'Context':_0xe8a8('0x192'),'Priority':'1','variable':_0x2533c6,'timeout':(_0x18c0c9[_0xe8a8('0x193')]||0x1e)*0x3e8,'async':!![],'channelid':_0x759947})['then'](function(_0x35d7f4){return _0x1090d2(_0x35d7f4);})['catch'](function(_0x387094){_0x18c0c9[_0xe8a8('0x65')]+=0x1;var _0xfe5ab1=new History(_0x4fbbc3[_0xe8a8('0x23')][_0x759947]);logger[_0xe8a8('0x94')](util[_0xe8a8('0x7b')]('[originateError]:\x20%s',JSON[_0xe8a8('0x48')](_0x387094)));_0xfe5ab1['state']=0xe;_0xfe5ab1[_0xe8a8('0xa5')]=_0xe8a8('0x194');_0xfe5ab1[_0xe8a8('0xa7')]=moment()[_0xe8a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0xfe5ab1[_0xe8a8('0xa6')]=_0xfe5ab1['starttime'];_0x4fbbc3[_0xe8a8('0xca')](_0xfe5ab1)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x195')));_0x4fbbc3[_0xe8a8('0xc8')](_0xfe5ab1)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x195')))[_0xe8a8('0x131')](function(){delete _0x4fbbc3[_0xe8a8('0x23')][_0x759947];return _0x1380df(msgResponse(_0xe8a8('0x16b'),'Error',_0xe8a8('0x196')));});});});};Dialer['prototype'][_0xe8a8('0x2f')]=function(_0x142ed1){var _0x8dfcc6=this[_0xe8a8('0x23')][_0x142ed1['actionid']];if(_0x8dfcc6){delete this[_0xe8a8('0x23')][_0x142ed1['actionid']];_0x8dfcc6[_0xe8a8('0x114')]=moment()[_0xe8a8('0x7b')](_0xe8a8('0xf9'));var _0x14a85e=_0x8dfcc6[_0xe8a8('0x4c')]===_0xe8a8('0x90')?this[_0xe8a8('0x1f')][_0x8dfcc6['queue']]:this['voiceQueues'][_0x8dfcc6[_0xe8a8('0x197')]()];if(!this[_0xe8a8('0x198')](_0x142ed1[_0xe8a8('0x199')])){this[_0xe8a8('0xb3')](_0x14a85e);return this[_0xe8a8('0x19a')](_0x8dfcc6,_0x14a85e,_0x142ed1)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x19b')));}this[_0xe8a8('0xa9')][_0x142ed1[_0xe8a8('0xdd')]]=_0x8dfcc6;}};Dialer[_0xe8a8('0x1a')]['checkRetriveMax']=function(_0x10dce2,_0x2384c7,_0x33f67f){var _0xe6bd50=new History(_0x2384c7);if(_0xe6bd50[_0xe8a8('0xed')]+_0xe6bd50['countcongestionretry']+_0xe6bd50[_0xe8a8('0xee')]+_0xe6bd50[_0xe8a8('0xef')]+_0xe6bd50['countdropretry']+_0xe6bd50[_0xe8a8('0xf1')]+_0xe6bd50[_0xe8a8('0xeb')]+_0xe6bd50[_0xe8a8('0xf2')]>=_0x33f67f['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x10dce2){case 0x3:if(_0xe6bd50[_0xe8a8('0xee')]>=_0x33f67f[_0xe8a8('0x19c')]-0x1){return!![];}this[_0xe8a8('0xbd')]({'active':![],'countnoanswerretry':_0xe6bd50['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f[_0xe8a8('0x19d')],'minutes')[_0xe8a8('0x7b')](_0xe8a8('0xf9')),'ContactId':_0xe6bd50[_0xe8a8('0xd3')],'ListId':_0xe6bd50[_0xe8a8('0xd4')],'VoiceQueueId':_0xe6bd50['VoiceQueueId']||undefined,'CampaignId':_0xe6bd50[_0xe8a8('0xd6')]||undefined})['catch'](loggerCatch(_0xe8a8('0x19e')));break;case 0x5:if(_0xe6bd50['countbusyretry']>=_0x33f67f['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0xe6bd50[_0xe8a8('0xed')]+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f['dialBusyRetryFrequency'],_0xe8a8('0xf8'))['format'](_0xe8a8('0xf9')),'ContactId':_0xe6bd50[_0xe8a8('0xd3')],'ListId':_0xe6bd50['ListId'],'VoiceQueueId':_0xe6bd50[_0xe8a8('0xd5')]||undefined,'CampaignId':_0xe6bd50[_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x19f')));break;case 0x8:if(_0xe6bd50[_0xe8a8('0x100')]>=_0x33f67f[_0xe8a8('0x1a0')]-0x1){return!![];}this[_0xe8a8('0xbd')]({'active':![],'countcongestionretry':_0xe6bd50[_0xe8a8('0x100')]+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f['dialCongestionRetryFrequency'],_0xe8a8('0xf8'))[_0xe8a8('0x7b')](_0xe8a8('0xf9')),'ContactId':_0xe6bd50['ContactId'],'ListId':_0xe6bd50[_0xe8a8('0xd4')],'VoiceQueueId':_0xe6bd50['VoiceQueueId']||undefined,'CampaignId':_0xe6bd50['CampaignId']||undefined})[_0xe8a8('0xb9')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xe6bd50[_0xe8a8('0xef')]>=_0x33f67f[_0xe8a8('0x1a1')]-0x1){return!![];}else{this[_0xe8a8('0xbd')]({'active':![],'countnosuchnumberretry':_0xe6bd50['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f[_0xe8a8('0x1a2')],_0xe8a8('0xf8'))[_0xe8a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe6bd50[_0xe8a8('0xd3')],'ListId':_0xe6bd50[_0xe8a8('0xd4')],'VoiceQueueId':_0xe6bd50[_0xe8a8('0xd5')]||undefined,'CampaignId':_0xe6bd50[_0xe8a8('0xd6')]||undefined})['catch'](loggerCatch(_0xe8a8('0x1a3')));}break;case 0xa:if(_0xe6bd50[_0xe8a8('0xf0')]>=_0x33f67f[_0xe8a8('0x1a4')]-0x1){return!![];}this[_0xe8a8('0xbd')]({'active':![],'countdropretry':_0xe6bd50[_0xe8a8('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x33f67f['dialDropRetryFrequency'],'minutes')[_0xe8a8('0x7b')](_0xe8a8('0xf9')),'ContactId':_0xe6bd50[_0xe8a8('0xd3')],'ListId':_0xe6bd50[_0xe8a8('0xd4')],'VoiceQueueId':_0xe6bd50[_0xe8a8('0xd5')]||undefined,'CampaignId':_0xe6bd50['CampaignId']||undefined})[_0xe8a8('0xb9')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0xe6bd50[_0xe8a8('0xf1')]>=_0x33f67f[_0xe8a8('0x120')]-0x1){return!![];}this[_0xe8a8('0xbd')]({'active':![],'countabandonedretry':_0xe6bd50['countabandonedretry']+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f[_0xe8a8('0x121')],'minutes')[_0xe8a8('0x7b')](_0xe8a8('0xf9')),'ContactId':_0xe6bd50[_0xe8a8('0xd3')],'ListId':_0xe6bd50[_0xe8a8('0xd4')],'VoiceQueueId':_0xe6bd50[_0xe8a8('0xd5')]||undefined,'CampaignId':_0xe6bd50[_0xe8a8('0xd6')]||undefined})['catch'](loggerCatch(_0xe8a8('0x122')));break;case 0x13:if(_0xe6bd50[_0xe8a8('0xeb')]>=_0x33f67f[_0xe8a8('0xf5')]-0x1){return!![];}this[_0xe8a8('0xbd')]({'active':![],'countmachineretry':_0xe6bd50[_0xe8a8('0xeb')]+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f[_0xe8a8('0x103')],'minutes')['format'](_0xe8a8('0xf9')),'ContactId':_0xe6bd50['ContactId'],'ListId':_0xe6bd50['ListId'],'VoiceQueueId':_0xe6bd50['VoiceQueueId']||undefined,'CampaignId':_0xe6bd50[_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0xfa')));break;case 0x14:if(_0xe6bd50['countagentrejectretry']>=_0x33f67f[_0xe8a8('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0xe6bd50[_0xe8a8('0xf2')]+=0x1,'scheduledat':moment()[_0xe8a8('0xf7')](_0x33f67f[_0xe8a8('0x1a6')],_0xe8a8('0xf8'))['format'](_0xe8a8('0xf9')),'ContactId':_0xe6bd50[_0xe8a8('0xd3')],'ListId':_0xe6bd50[_0xe8a8('0xd4')],'VoiceQueueId':_0xe6bd50[_0xe8a8('0xd5')]||undefined,'CampaignId':_0xe6bd50[_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1a7')));break;default:return!![];}};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x19a')]=function(_0x2a226d,_0x3660a0,_0x372b0b){var _0x23e371=this;var _0xabc982=new History(_0x2a226d);return new BPromise(function(_0x549b9b,_0x532819){if(_[_0xe8a8('0x3d')](_0x3660a0)&&typeof _0x3660a0!=='object'){return _0x532819(msgResponse(_0xe8a8('0x1a8'),'Failure',_0xe8a8('0x1a9')));}if(_[_0xe8a8('0x3d')](_0x372b0b)&&typeof _0x372b0b!==_0xe8a8('0x16a')){return _0x532819(msgResponse(_0xe8a8('0x1a8'),_0xe8a8('0x145'),_0xe8a8('0x1aa')));}switch(_0x372b0b['reason']){case'0':_0x3660a0[_0xe8a8('0x64')]+=0x1;_0xabc982[_0xe8a8('0xa4')]=0x0;_0xabc982[_0xe8a8('0xa5')]=_0xe8a8('0x1ab');_0xabc982[_0xe8a8('0xef')]+=0x1;_0xabc982['countglobal']+=0x1;ami[_0xe8a8('0x4b')](_0xe8a8('0x1ac'),ut[_0xe8a8('0xe7')](_0x2a226d,'nosuchnumber'));_0x23e371[_0xe8a8('0xca')](_0xabc982)[_0xe8a8('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x23e371[_0xe8a8('0x1ad')](0x0,_0x2a226d,_0x3660a0)){if(_0xabc982[_0xe8a8('0xef')]>=_0x3660a0[_0xe8a8('0x1a1')]){_0x23e371[_0xe8a8('0xf6')](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1ae'));}else{_0x23e371[_0xe8a8('0xf4')](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1ae'));}}break;case'3':_0x3660a0['outboundNoAnswerCallsDay']+=0x1;_0xabc982['state']=0x3;_0xabc982['statedesc']='NoAnswer';_0xabc982[_0xe8a8('0xee')]+=0x1;_0xabc982['countglobal']+=0x1;ami[_0xe8a8('0x4b')]('custom:agentnoanswer',ut[_0xe8a8('0xe7')](_0x2a226d,_0xe8a8('0x1af')));_0x23e371['createHistory'](_0xabc982)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1b0')));if(_0x23e371['checkRetriveMax'](0x3,_0x2a226d,_0x3660a0)){if(_0xabc982[_0xe8a8('0xee')]>=_0x3660a0['dialNoAnswerMaxRetry']){_0x23e371[_0xe8a8('0xf6')](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1b1'));}else{_0x23e371[_0xe8a8('0xf4')](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1b1'));}}break;case'5':_0x3660a0[_0xe8a8('0x5f')]+=0x1;_0xabc982['state']=0x5;_0xabc982['statedesc']='Busy';_0xabc982[_0xe8a8('0xed')]+=0x1;_0xabc982[_0xe8a8('0x119')]+=0x1;ami['emit'](_0xe8a8('0x1b2'),ut[_0xe8a8('0xe7')](_0x2a226d,_0xe8a8('0x1b3')));_0x23e371['createHistory'](_0xabc982)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1b4')));if(_0x23e371[_0xe8a8('0x1ad')](0x5,_0x2a226d,_0x3660a0)){if(_0xabc982['countbusyretry']>=_0x3660a0[_0xe8a8('0x1b5')]){_0x23e371['createStateFinal'](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1b6'));}else{_0x23e371[_0xe8a8('0xf4')](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1b6'));}}break;case'8':_0x3660a0[_0xe8a8('0x60')]+=0x1;_0xabc982[_0xe8a8('0xa4')]=0x8;_0xabc982[_0xe8a8('0xa5')]='Congestion';_0xabc982[_0xe8a8('0x100')]+=0x1;_0xabc982['countglobal']+=0x1;ami[_0xe8a8('0x4b')](_0xe8a8('0x1b7'),ut[_0xe8a8('0xe7')](_0x2a226d,'congestion'));_0x23e371['createHistory'](_0xabc982)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1b8')));if(_0x23e371['checkRetriveMax'](0x8,_0x2a226d,_0x3660a0)){if(_0xabc982[_0xe8a8('0x100')]>=_0x3660a0[_0xe8a8('0x1a0')]){_0x23e371['createStateFinal'](_0xabc982,_0x549b9b,_0x532819,'reason\x208\x20congestion');}else{_0x23e371['stateGlobal'](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1b9'));}}break;case'11':_0x3660a0[_0xe8a8('0x1ba')]+=0x1;_0xabc982[_0xe8a8('0xa4')]=0xb;_0xabc982[_0xe8a8('0xa5')]=_0xe8a8('0x11e');_0xabc982[_0xe8a8('0xf1')]+=0x1;_0xabc982[_0xe8a8('0x119')]+=0x1;_0x23e371[_0xe8a8('0xca')](_0xabc982)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x123')));if(_0x23e371[_0xe8a8('0x1ad')](0xb,_0x2a226d,_0x3660a0)){if(_0xabc982[_0xe8a8('0xf1')]>=_0x3660a0[_0xe8a8('0x120')]){_0x23e371[_0xe8a8('0xf6')](_0xabc982,_0x549b9b,_0x532819,'reason\x2011\x20abandoned');}else{_0x23e371[_0xe8a8('0xf4')](_0xabc982,_0x549b9b,_0x532819,'reason\x2011\x20abandoned');}}break;case'20':_0x3660a0[_0xe8a8('0x66')]+=0x1;_0xabc982['state']=0x14;_0xabc982[_0xe8a8('0xa5')]=_0xe8a8('0x1bb');_0xabc982[_0xe8a8('0xf2')]+=0x1;_0xabc982[_0xe8a8('0x119')]+=0x1;ami[_0xe8a8('0x4b')]('custom:agentreject',ut[_0xe8a8('0xe7')](_0x2a226d,'agentreject'));_0x23e371[_0xe8a8('0xca')](_0xabc982)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1bc')));if(_0x23e371[_0xe8a8('0x1ad')](0x14,_0x2a226d,_0x3660a0)){if(_0xabc982[_0xe8a8('0xf2')]>=_0x3660a0[_0xe8a8('0x1a5')]){_0x23e371['createStateFinal'](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1bd'));}else{_0x23e371['stateGlobal'](_0xabc982,_0x549b9b,_0x532819,_0xe8a8('0x1bd'));}}break;default:_0x3660a0[_0xe8a8('0x67')]+=0x1;_0xabc982[_0xe8a8('0xa4')]=0xc;_0xabc982[_0xe8a8('0xa5')]=_0x372b0b['reason'];_0x23e371[_0xe8a8('0xca')](_0xabc982)[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1be')));if(_0x23e371[_0xe8a8('0x1ad')](_0x372b0b[_0xe8a8('0x1bf')],_0x2a226d,_0x3660a0)){if(_0xabc982[_0xe8a8('0xed')]+_0xabc982[_0xe8a8('0x100')]+_0xabc982[_0xe8a8('0xee')]+_0xabc982[_0xe8a8('0xef')]+_0xabc982[_0xe8a8('0xf0')]+_0xabc982[_0xe8a8('0xf1')]+_0xabc982[_0xe8a8('0xeb')]+_0xabc982[_0xe8a8('0xf2')]>=_0x3660a0[_0xe8a8('0xf3')]){_0x23e371[_0xe8a8('0xf4')](_0xabc982,_0x549b9b,_0x532819,_0x372b0b[_0xe8a8('0x1bf')]);}else{_0x23e371[_0xe8a8('0xf6')](_0xabc982,_0x549b9b,_0x532819,_0x372b0b[_0xe8a8('0x1bf')]);}}}});};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xf4')]=function(_0x5879be,_0x295e44,_0x254fbb,_0x407c45){var _0x4a0f80=new Final(_0x5879be);_0x4a0f80[_0xe8a8('0xa4')]=0xf;_0x4a0f80[_0xe8a8('0xa5')]='Global';this[_0xe8a8('0xf6')](_0x4a0f80,_0x295e44,_0x254fbb,_0x407c45);};Dialer[_0xe8a8('0x1a')][_0xe8a8('0xf6')]=function(_0x3e6cac,_0x2a3370,_0x320266,_0x5c6aec){this[_0xe8a8('0xc8')](_0x3e6cac)[_0xe8a8('0xb8')](function(){return _0x2a3370(msgResponse(_0xe8a8('0x1a8'),_0xe8a8('0xd9'),_0x5c6aec));})['catch'](function(){return _0x320266(msgResponse(_0xe8a8('0x1c0'),_0xe8a8('0x145'),_0xe8a8('0x1c1')));});};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x9')]=function(_0x438cb8){var _0x472cc4=_0x438cb8[_0xe8a8('0x1c2')]/0x64;var _0x4c7298=_0x438cb8[_0xe8a8('0x62')]/(_0x438cb8[_0xe8a8('0x62')]+_0x438cb8[_0xe8a8('0x5d')]);var _0x23c0cb=Math['round'](_0x438cb8['predictiveIntervalAvailable']*(_0x438cb8[_0xe8a8('0x1c3')]/0x64));var _0x6aa2f6=Math[_0xe8a8('0x1c4')](_0x438cb8[_0xe8a8('0x71')]*(_0x438cb8[_0xe8a8('0x1c5')]/0x64));var _0x25e475=_0x438cb8['available']+_0x438cb8[_0xe8a8('0x54')];var _0x5ead06=Math[_0xe8a8('0x1c6')](_0x438cb8[_0xe8a8('0x74')]*_0x438cb8[_0xe8a8('0x76')]*_0x438cb8[_0xe8a8('0x6f')]*_0x438cb8[_0xe8a8('0x70')]);if(_['isUndefined'](_0x438cb8['startProgressive'])){if(!_[_0xe8a8('0x3d')](_0x438cb8[_0xe8a8('0x26')])){_0x438cb8['startPredictive']=undefined;loggerPredictive[_0xe8a8('0x94')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xe8a8('0x3d')](_0x438cb8[_0xe8a8('0x8e')])){loggerPredictive[_0xe8a8('0x94')](_0xe8a8('0x1c7'),_0xe8a8('0x1c8'));clearInterval(_0x438cb8[_0xe8a8('0x8e')]);_0x438cb8['handlePredictive']=undefined;}_0x438cb8[_0xe8a8('0x27')]=moment()[_0xe8a8('0x7b')](_0xe8a8('0xf9'));loggerPredictive['info'](_0x438cb8[_0xe8a8('0x40')],_0xe8a8('0x1c9'),_0x438cb8['startProgressive']);this['handlePower'](_0x438cb8,0x1);}else if(ifInterval(_0x438cb8[_0xe8a8('0x1ca')],_0x438cb8['startProgressive'])){this[_0xe8a8('0x159')](_0x438cb8,0x1);loggerPredictiveCalls[_0xe8a8('0x7e')](_0xe8a8('0x1cb'),_0x438cb8['startProgressive'],_0x438cb8[_0xe8a8('0x40')]);_0x438cb8[_0xe8a8('0x74')]=0x0;_0x438cb8[_0xe8a8('0x6e')]=0x0;}else if(_0x472cc4<_0x4c7298&&_0x438cb8[_0xe8a8('0x1cc')]===_0xe8a8('0x1cd')){freeVariablesPredictive(_0x438cb8);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x1ce'),_0xe8a8('0x1cf'),_0x4c7298,_0xe8a8('0x27'),_0x438cb8[_0xe8a8('0x40')]);}else if(_0x5ead06<_0x438cb8['predictiveIntervalErlangCallsDroppedCalls']&&_0x438cb8[_0xe8a8('0x1cc')]===_0xe8a8('0x1cd')){freeVariablesPredictive(_0x438cb8);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xe8a8('0x1d0'),_0x5ead06,_0xe8a8('0x1d1'),_0x438cb8[_0xe8a8('0x6e')],_0xe8a8('0x27'),_0x438cb8[_0xe8a8('0x40')]);}else if(!ifInterval(_0x438cb8[_0xe8a8('0x1ca')],_0x438cb8[_0xe8a8('0x27')])&&_[_0xe8a8('0x3d')](_0x438cb8[_0xe8a8('0x26')])&&!_[_0xe8a8('0x3d')](_0x438cb8[_0xe8a8('0x27')])){_0x438cb8[_0xe8a8('0x26')]=moment()[_0xe8a8('0x7b')](_0xe8a8('0xf9'));loggerPredictive[_0xe8a8('0x7e')](_0x438cb8['name'],'started\x20in\x20predictive\x20at',_0x438cb8['startPredictive']);this[_0xe8a8('0x1d2')](_0x438cb8['dialPredictiveInterval'])[_0xe8a8('0xb8')](this[_0xe8a8('0x1d3')](_0x438cb8))['then'](mergeDataErlangB(_0x438cb8))['then'](this[_0xe8a8('0x1d4')](_0x438cb8))[_0xe8a8('0xb9')](loggerCatchPredictive(_0xe8a8('0x1d5'),_0x438cb8));}else if(!ifInterval(_0x438cb8['dialPredictiveInterval'],_0x438cb8[_0xe8a8('0x26')])){_0x438cb8[_0xe8a8('0x6e')]=0x0;_0x438cb8[_0xe8a8('0x26')]=moment()[_0xe8a8('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe8a8('0x7e')](_0x438cb8[_0xe8a8('0x40')],_0xe8a8('0x1d6'),_0x438cb8['startPredictive']);clearInterval(_0x438cb8['handlePredictive']);_0x438cb8[_0xe8a8('0x8e')]=undefined;this[_0xe8a8('0x1d2')](_0x438cb8[_0xe8a8('0x1ca')])['then'](this[_0xe8a8('0x1d3')](_0x438cb8))['then'](mergeDataErlangB(_0x438cb8))['then'](this[_0xe8a8('0x1d4')](_0x438cb8))[_0xe8a8('0xb9')](loggerCatchPredictive(_0xe8a8('0x1d7'),_0x438cb8));}else if(_0x438cb8[_0xe8a8('0x71')]&&_0x25e475<_0x438cb8[_0xe8a8('0x71')]-_0x6aa2f6){freeVariablesPredictive(_0x438cb8);loggerPredictive[_0xe8a8('0x7e')](_0x438cb8['name'],_0xe8a8('0x1d8'),_0x25e475,')\x20are\x20less\x20than\x20threshold\x20(',_0x438cb8[_0xe8a8('0x71')],'-',_0x6aa2f6,'=',_0x438cb8['predictiveIntervalAvailable']-_0x6aa2f6,')');}else if(_0x438cb8[_0xe8a8('0x71')]&&_0x25e475>_0x438cb8[_0xe8a8('0x71')]+_0x23c0cb){freeVariablesPredictive(_0x438cb8);loggerPredictive[_0xe8a8('0x7e')](_0x438cb8[_0xe8a8('0x40')],_0xe8a8('0x1d8'),_0x25e475,_0xe8a8('0x1d9'),_0x438cb8[_0xe8a8('0x71')],'+',_0x23c0cb,'=',_0x438cb8[_0xe8a8('0x71')]+_0x23c0cb,')');}};Dialer[_0xe8a8('0x1a')]['getDataPredictive']=function(_0x221dc4){var _0xf87426=this;return function(_0x5d002c){return new BPromise(function(_0x463e72,_0x352f8c){_['merge'](_0x221dc4,_0x5d002c[0x0]);if(checkGetDataPredictive(_0x5d002c[0x0])){var _0x3cf7b8=_0x221dc4[_0xe8a8('0x71')]=_0x221dc4[_0xe8a8('0x54')]+_0x221dc4['available'];var _0x5f0703=_0x221dc4[_0xe8a8('0x1ca')]*0x3c;var _0xc4078c=_0x5d002c[0x0][_0xe8a8('0x6a')]+_0x5d002c[0x0]['predictiveIntervalAvgHoldtime'];var _0x443c19=(_0x5d002c[0x0][_0xe8a8('0x68')]+_0x5d002c[0x0][_0xe8a8('0x6c')]+_0x5d002c[0x0][_0xe8a8('0x6b')])/_0x5d002c[0x0][_0xe8a8('0x72')];_0x221dc4[_0xe8a8('0x6f')]=_0x443c19>0x0?_0x443c19:0x1;switch(_0x221dc4[_0xe8a8('0x1cc')]){case _0xe8a8('0x1cd'):var _0x3ccdb8=_0x221dc4['dialPredictiveOptimizationPercentage']/0x64;return _0xf87426['abandonmentRate'](_0x3cf7b8,_0x5f0703,_0xc4078c,_0x443c19,_0x3ccdb8)[_0xe8a8('0xb8')](function(_0x4cedcd){return _0x463e72(_0x4cedcd);});case _0xe8a8('0x1da'):var _0x55c876=_0x221dc4[_0xe8a8('0x1c2')]/0x64;return _0xf87426['busyFactor'](_0x3cf7b8,_0x5f0703,_0xc4078c,_0x443c19,_0x55c876)[_0xe8a8('0xb8')](function(_0x26c148){return _0x463e72(_0x26c148);});default:return _0x352f8c(msgResponse(_0xe8a8('0x1db'),'Failure',_0xe8a8('0x1dc')));}}else{return _0x352f8c(msgResponse('[getDataPredictive]','Failure',_0xe8a8('0x1dd')));}});};};Dialer[_0xe8a8('0x1a')]['getDataPredictiveOld']=function(_0x52c3ba){var _0x435b51=this;return function(_0x47e7c5){return new BPromise(function(_0xd33ade,_0x1c58b8){_['merge'](_0x52c3ba,_0x47e7c5[0x0]);if(checkGetDataPredictive(_0x47e7c5[0x0])){loggerPredictive[_0xe8a8('0x7e')](JSON[_0xe8a8('0x48')](_0x47e7c5[0x0]));if(_0x52c3ba[_0xe8a8('0x1cc')]===_0xe8a8('0x1cd')){return _0x435b51[_0xe8a8('0xc6')](_0x52c3ba['id'])[_0xe8a8('0xb8')](function(_0x2a0027){var _0x4fe297=_0x52c3ba['loggedIn']-_0x2a0027[0x0][_0xe8a8('0x1de')];var _0x2a9a3d=_0x52c3ba['dialPredictiveInterval']*0x3c;var _0x5ebb44=_0x47e7c5[0x0][_0xe8a8('0x6a')]+_0x47e7c5[0x0]['predictiveIntervalAvgHoldtime'];var _0x236477=(_0x47e7c5[0x0]['predictiveIntervalAnsweredCalls']+_0x47e7c5[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x47e7c5[0x0][_0xe8a8('0x6b')])/_0x47e7c5[0x0][_0xe8a8('0x72')];var _0x47d4ef=_0x52c3ba['dialPredictiveOptimizationPercentage']/0x64;_0x52c3ba[_0xe8a8('0x1df')]=_0x2a0027[0x0]['outboundQueuePauses']||0x0;_0x52c3ba['predictiveIntervalHitRate']=_0x236477>0x0?_0x236477:0x1;return _0x435b51['abandonmentRate'](_0x4fe297,_0x2a9a3d,_0x5ebb44,_0x236477,_0x47d4ef);})['then'](function(_0x184c2f){return _0xd33ade(_0x184c2f);})[_0xe8a8('0xb9')](function(_0x168d6d){return _0x1c58b8(msgResponse('[CatchErlangB]',_0xe8a8('0x145'),JSON[_0xe8a8('0x48')](_0x168d6d)));});}if(_0x52c3ba['dialPredictiveOptimization']===_0xe8a8('0x1da')){return _0x435b51['getVoiceQueueRtPauses'](_0x52c3ba['id'])['then'](function(_0x13a6f1){var _0x545e6c=_0x52c3ba[_0xe8a8('0x51')]-_0x13a6f1[0x0][_0xe8a8('0x1de')];var _0x2bd641=_0x52c3ba['dialPredictiveInterval']*0x3c;var _0x426228=_0x47e7c5[0x0][_0xe8a8('0x6a')]+_0x47e7c5[0x0]['predictiveIntervalAvgHoldtime'];var _0x2dac00=(_0x47e7c5[0x0]['predictiveIntervalAnsweredCalls']+_0x47e7c5[0x0][_0xe8a8('0x6c')]+_0x47e7c5[0x0][_0xe8a8('0x6b')])/_0x47e7c5[0x0][_0xe8a8('0x72')];var _0x50b230=_0x52c3ba[_0xe8a8('0x1c2')]/0x64;_0x52c3ba['predictiveIntervalPauses']=_0x13a6f1[0x0]['outboundQueuePauses']||0x0;_0x52c3ba[_0xe8a8('0x6f')]=_0x2dac00>0x0?_0x2dac00:0x1;return _0x435b51[_0xe8a8('0x1e0')](_0x545e6c,_0x2bd641,_0x426228,_0x2dac00,_0x50b230);})[_0xe8a8('0xb8')](function(_0xc9bcf2){return _0xd33ade(_0xc9bcf2);})['catch'](function(_0x113f5b){return _0x1c58b8(msgResponse(_0xe8a8('0x1e1'),_0xe8a8('0x145'),JSON[_0xe8a8('0x48')](_0x113f5b)));});}}else{return _0x1c58b8(msgResponse(_0xe8a8('0x1db'),_0xe8a8('0x145'),_0xe8a8('0x1dd')));}});};};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x1d4')]=function(_0x167cd8){var _0x1618a6=this;return function(){var _0x913561=0x0;var _0x36d15b=Math[_0xe8a8('0x1c6')](_0x167cd8['erlangCallToSecond']*0x3e8);if(_0x36d15b>0x0){_0x36d15b=_0x36d15b<0x64?0x64:_0x36d15b;loggerPredictive['info'](_0x167cd8[_0xe8a8('0x40')],'one\x20call\x20every:',_0x36d15b,_0xe8a8('0x49'));_0x167cd8[_0xe8a8('0x8e')]=setInterval(function(){_0x1618a6[_0xe8a8('0x8e')](_0x167cd8);loggerPredictiveCalls[_0xe8a8('0x7e')](_0xe8a8('0x1e2'),_0x913561+=0x1);},_0x36d15b);}else{loggerPredictive['info'](_0x167cd8[_0xe8a8('0x40')],_0xe8a8('0x1e3'));}};};Dialer['prototype'][_0xe8a8('0x1e4')]=function(_0x3c6c96,_0x47e9e6){var _0x2dfb13=this;return function(_0x300862){if(_[_0xe8a8('0x46')](_0x300862)){if(_[_0xe8a8('0xae')](_0x47e9e6[_0xe8a8('0x1e5')])||!_0x47e9e6[_0xe8a8('0x1e6')]){if(_0x3c6c96[_0xe8a8('0x59')]===_0xe8a8('0x8')){_0x3c6c96['queueStatusComplete']=_[_0xe8a8('0x3d')](_0x3c6c96[_0xe8a8('0x12c')])?!![]:_0x3c6c96[_0xe8a8('0x12c')];var _0x492fec=uuid['v4']();_0x2dfb13['actions'][_0x492fec]=new Action(_0x3c6c96,_0x47e9e6,_0x492fec);loggerBooked[_0xe8a8('0x7e')]('[booked][checkContactBlack]',_0x492fec,'queueStatusComplete:\x20',JSON[_0xe8a8('0x48')](_0x3c6c96['queueStatusComplete']),_0xe8a8('0x1e7'),_0x3c6c96[_0xe8a8('0x40')]);if(_0x3c6c96[_0xe8a8('0x12c')]){_0x3c6c96['queueStatusComplete']=![];_0x2dfb13[_0xe8a8('0x129')][_0x2dfb13[_0xe8a8('0x23')][_0x492fec][_0xe8a8('0xb4')]]=[];ami['Action']({'actionid':_0x492fec,'action':_0xe8a8('0x1e8'),'queue':_0x3c6c96[_0xe8a8('0x40')]})[_0xe8a8('0xb9')](function(){_0x2dfb13[_0xe8a8('0xb3')](_0x3c6c96);_0x2dfb13[_0xe8a8('0xbd')]({'active':![],'ContactId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec][_0xe8a8('0xd3')],'ListId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec][_0xe8a8('0xd4')],'VoiceQueueId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec][_0xe8a8('0xd5')]||undefined,'CampaignId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec]['CampaignId']||undefined})[_0xe8a8('0xb9')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2dfb13[_0xe8a8('0x23')][_0x492fec];});}else{loggerBooked[_0xe8a8('0x7e')](_0xe8a8('0x1e9'),JSON[_0xe8a8('0x48')](_0x3c6c96[_0xe8a8('0x12c')]),'Queue:\x20',_0x3c6c96[_0xe8a8('0x40')]);_0x2dfb13['updateOriginated'](_0x3c6c96);_0x2dfb13[_0xe8a8('0xbd')]({'active':![],'ContactId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec]['ContactId'],'ListId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec]['ListId'],'VoiceQueueId':_0x2dfb13[_0xe8a8('0x23')][_0x492fec][_0xe8a8('0xd5')]||undefined,'CampaignId':_0x2dfb13['actions'][_0x492fec][_0xe8a8('0xd6')]||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1ea')));delete _0x2dfb13[_0xe8a8('0x23')][_0x492fec];}}else{return _0x2dfb13[_0xe8a8('0x169')](_0x3c6c96,_0x47e9e6);}}else{if(getDiff(_0x47e9e6[_0xe8a8('0x1eb')])<_0x3c6c96[_0xe8a8('0x1ec')]*0x3c){if(_0x47e9e6[_0xe8a8('0x1ed')]&&!_0x47e9e6[_0xe8a8('0x1ed')][_0xe8a8('0x1ee')]){_0x2dfb13[_0xe8a8('0x1d')][_0xe8a8('0x12f')](_0x47e9e6['id'])[_0xe8a8('0x131')](function(){_0x2dfb13[_0xe8a8('0xb3')](_0x3c6c96);});}else{_0x2dfb13[_0xe8a8('0xbf')]({'active':![]},_0x47e9e6['id'],0x1)['finally'](function(){_0x2dfb13['updateOriginated'](_0x3c6c96);});}}else{_0x3c6c96['outboundReCallsDay']+=0x1;_0x2dfb13['updateOriginated'](_0x3c6c96);if(_0x3c6c96[_0xe8a8('0x1ef')]){_0x2dfb13[_0xe8a8('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x47e9e6[_0xe8a8('0xd3')],'ListId':_0x47e9e6[_0xe8a8('0xd4')],'VoiceQueueId':_0x47e9e6['VoiceQueueId']||undefined,'CampaignId':_0x47e9e6['CampaignId']||undefined})[_0xe8a8('0xb9')](loggerCatch(_0xe8a8('0x1f0')));_0x2dfb13[_0xe8a8('0xca')](createObjHistory(_0x3c6c96,_0x47e9e6,'RECALLINQUEUE',0x17,_0xe8a8('0x1f1')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x2dfb13[_0xe8a8('0xd1')](createObjHistory(_0x3c6c96,_0x47e9e6,'RECALLFAILEDTIMEOUT',0x16,_0xe8a8('0x1f2')),_0xe8a8('0x1f3'),'[Originate][HistoryRecallClose]');}}}}else{_0x3c6c96[_0xe8a8('0x5e')]+=0x1;_0x2dfb13[_0xe8a8('0xd1')](createObjHistory(_0x3c6c96,_0x47e9e6,'BLACKLIST',0xd,_0xe8a8('0x1f4')),'[Originate][historyBlacklist]',_0xe8a8('0x1f5'));throw _0xe8a8('0x1f6');}};};Dialer[_0xe8a8('0x1a')][_0xe8a8('0x15f')]=function(_0x58a3bc){var _0x251c67=this;var _0x4aa06f=_0x58a3bc[_0xe8a8('0x1f7')]-_0x58a3bc[_0xe8a8('0x73')]-_0x58a3bc[_0xe8a8('0xc2')];emitCampaignSummary(_0x58a3bc);if(_0x4aa06f>0x0){if(_0x4aa06f>this[_0xe8a8('0x22')]){_0x4aa06f=this[_0xe8a8('0x22')];}_0x58a3bc[_0xe8a8('0xc2')]+=_0x4aa06f;this[_0xe8a8('0xc4')](_0x58a3bc['id'],_0x4aa06f,_0x58a3bc[_0xe8a8('0x1f8')],_0x58a3bc)[_0xe8a8('0xb8')](function(_0x2d1a80){_0x58a3bc['temp']-=_0x4aa06f;_0x58a3bc[_0xe8a8('0xc2')]=_0x58a3bc[_0xe8a8('0xc2')]>0x0?_0x58a3bc[_0xe8a8('0xc2')]:0x0;if(!checkContactEmpty(_0x2d1a80)){_0x58a3bc[_0xe8a8('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xe8a8('0x7e')](_0xe8a8('0x1f9')+_0x58a3bc[_0xe8a8('0x40')]);}else{_0x58a3bc['originated']+=_0x2d1a80[_0xe8a8('0x97')];_0x58a3bc[_0xe8a8('0x3e')]=_0xe8a8('0x1fa');for(var _0x5b63cb=0x0;_0x5b63cb<_0x2d1a80[_0xe8a8('0x97')];_0x5b63cb+=0x1){_0x58a3bc[_0xe8a8('0x1fb')]+=0x1;if(_[_0xe8a8('0xae')](_0x2d1a80[_0x5b63cb])||_[_0xe8a8('0xae')](_0x2d1a80[_0x5b63cb][_0xe8a8('0x16d')])||_[_0xe8a8('0xae')](_0x2d1a80[_0x5b63cb][_0xe8a8('0x16d')][_0xe8a8('0x18f')])){_0x251c67[_0xe8a8('0xcf')]('[actionOriginate]\x20',_0x58a3bc,_0x2d1a80[_0x5b63cb]);}else{_0x251c67[_0xe8a8('0x1fc')](_[_0xe8a8('0x12e')](_0x2d1a80[_0x5b63cb],[_0xe8a8('0xd6'),_0xe8a8('0x1fd')]))[_0xe8a8('0xb8')](_0x251c67['checkContactBlack'](_0x58a3bc,_0x2d1a80[_0x5b63cb]))[_0xe8a8('0xb9')](_0x251c67[_0xe8a8('0xce')](_0xe8a8('0x1fe'),_0x58a3bc));}}}})[_0xe8a8('0xb9')](loggerGetContactDialer(_0xe8a8('0x1ff'),_0x58a3bc,_0x4aa06f));}};Dialer[_0xe8a8('0x1a')]['handlePower']=function(_0x1e60aa,_0xe6ef61){var _0x306a71=this;var _0xc33a2=[];var _0x31f6a1=_0xe6ef61>=0x1?_0xe6ef61:0x1;if(_0x1e60aa[_0xe8a8('0x59')]===_0xe8a8('0x8')){_0x31f6a1=0x1;}var _0x48f529=Math[_0xe8a8('0x1c6')](_0x1e60aa['available']*_0x31f6a1)-_0x1e60aa['originated']-_0x1e60aa['temp'];emitVoiceQueueSummary(_0x1e60aa);if(_0x1e60aa[_0xe8a8('0x200')]>0x0){var _0x3dd2ef=_0x1e60aa[_0xe8a8('0x200')]-_0x1e60aa[_0xe8a8('0x73')]-_0x1e60aa[_0xe8a8('0x54')]-_0x1e60aa['temp']-_0x1e60aa['pTalking'];if(_0x48f529>_0x3dd2ef){_0x48f529=_0x3dd2ef;}}if(_0x48f529>0x0){if(_0x1e60aa[_0xe8a8('0x59')]==='booked'){_0x48f529=0x1;}if(_0x48f529>this['maxNumberOriginate']){_0x48f529=this[_0xe8a8('0x22')];}_0x1e60aa['temp']+=_0x48f529;for(var _0x43e153 in this[_0xe8a8('0x20')]){if(typeof this[_0xe8a8('0x20')][_0x43e153]!==_0xe8a8('0xac')){if(this[_0xe8a8('0x20')][_0x43e153]['state']==='not_inuse'&&this[_0xe8a8('0x20')][_0x43e153][_0xe8a8('0xb0')]===_0xe8a8('0x201')){_0xc33a2[_0xe8a8('0x12a')](this[_0xe8a8('0x20')][_0x43e153]['id']);}}}this['getContactDialer'](_0x1e60aa['id'],_0xc33a2,_0x48f529,_0x1e60aa[_0xe8a8('0x1f8')],_0x1e60aa)[_0xe8a8('0xb8')](function(_0x541f2b){_0x1e60aa['temp']-=_0x48f529;_0x1e60aa[_0xe8a8('0xc2')]=_0x1e60aa[_0xe8a8('0xc2')]>0x0?_0x1e60aa[_0xe8a8('0xc2')]:0x0;if(!checkContactEmpty(_0x541f2b)){_0x306a71[_0xe8a8('0xb6')](_0x1e60aa)[_0xe8a8('0xb8')](sendMessageReschedule(_0x1e60aa))['catch'](loggerCatch(_0xe8a8('0xba')));}else{_0x1e60aa[_0xe8a8('0x73')]+=_0x541f2b[_0xe8a8('0x97')];_0x1e60aa[_0xe8a8('0x3e')]=_0x1e60aa[_0xe8a8('0x59')]===_0xe8a8('0x8')?_0xe8a8('0x202'):'RUNNING';for(var _0x5312a3=0x0;_0x5312a3<_0x541f2b[_0xe8a8('0x97')];_0x5312a3+=0x1){if(_[_0xe8a8('0xae')](_0x541f2b[_0x5312a3])||_[_0xe8a8('0xae')](_0x541f2b[_0x5312a3][_0xe8a8('0x16d')])||_[_0xe8a8('0xae')](_0x541f2b[_0x5312a3][_0xe8a8('0x16d')][_0xe8a8('0x18f')])){_0x306a71[_0xe8a8('0xcf')](_0xe8a8('0x203'),_0x1e60aa,_0x541f2b[_0x5312a3]);}else{_0x306a71['checkIsBlackList'](_['pick'](_0x541f2b[_0x5312a3],[_0xe8a8('0xd5'),'Contact.phone']))[_0xe8a8('0xb8')](_0x306a71['checkContactBlack'](_0x1e60aa,_0x541f2b[_0x5312a3]))[_0xe8a8('0xb9')](_0x306a71[_0xe8a8('0xce')](_0xe8a8('0x203'),_0x1e60aa));}}}})[_0xe8a8('0xb9')](loggerGetContactDialer(_0xe8a8('0x204'),_0x1e60aa,_0x48f529));}};Dialer['prototype'][_0xe8a8('0x8e')]=function(_0x29c872){if(_0x29c872[_0xe8a8('0x200')]>0x0){var _0x36a810=_0x29c872['dialLimitQueue']-_0x29c872[_0xe8a8('0x73')]-_0x29c872[_0xe8a8('0x54')];if(_0x36a810>0x0){this[_0xe8a8('0x205')](_0x29c872);}else{loggerPredictiveCalls[_0xe8a8('0x7e')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x29c872);}};Dialer[_0xe8a8('0x1a')]['tryOriginatePredictive']=function(_0x4af4b5){var _0x3b6071=this;var _0x3a665b=[];_0x4af4b5[_0xe8a8('0x73')]+=0x1;for(var _0x3bfd53 in this[_0xe8a8('0x20')]){if(typeof this[_0xe8a8('0x20')][_0x3bfd53]!==_0xe8a8('0xac')){if(this[_0xe8a8('0x20')][_0x3bfd53][_0xe8a8('0xa4')]===_0xe8a8('0x206')&&this[_0xe8a8('0x20')][_0x3bfd53][_0xe8a8('0xb0')]===_0xe8a8('0x201')){_0x3a665b['push'](this[_0xe8a8('0x20')][_0x3bfd53]['id']);}}}this[_0xe8a8('0xc1')](_0x4af4b5['id'],_0x3a665b,0x1,_0x4af4b5[_0xe8a8('0x1f8')],_0x4af4b5)['then'](function(_0x5329e2){if(!checkContactEmpty(_0x5329e2)){checkContactLowerLimitOriginate(_0x4af4b5,0x1,0x0);_0x3b6071[_0xe8a8('0xb6')](_0x4af4b5)['then'](sendMessageReschedule(_0x4af4b5))[_0xe8a8('0xb9')](loggerCatch('[countReScheduled]\x20'));}else{_0x4af4b5[_0xe8a8('0x3e')]='RUNNING';if(_[_0xe8a8('0xae')](_0x5329e2[0x0])||_[_0xe8a8('0xae')](_0x5329e2[0x0][_0xe8a8('0x16d')])||_[_0xe8a8('0xae')](_0x5329e2[0x0]['Contact']['phone'])){_0x3b6071['emptyContact'](_0xe8a8('0x203'),_0x4af4b5,_0x5329e2[0x0]);}else{_0x3b6071[_0xe8a8('0xbb')](_['pick'](_0x5329e2[0x0],[_0xe8a8('0xd5'),_0xe8a8('0x1fd')]))[_0xe8a8('0xb8')](_0x3b6071[_0xe8a8('0x1e4')](_0x4af4b5,_0x5329e2[0x0]))['catch'](_0x3b6071['loggerHandler'](_0xe8a8('0x207'),_0x4af4b5));}}})[_0xe8a8('0xb9')](loggerGetContactDialer('[getContactDialerPredictive]',_0x4af4b5,0x1));emitVoiceQueueSummary(_0x4af4b5);};Dialer[_0xe8a8('0x1a')]['abandonmentRate']=function(_0x53f0ed,_0x42dd0e,_0x215ed1,_0x3761c9,_0x58c777,_0xe90f3a){loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x208'));loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x209'),_0x53f0ed);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x20a'),_0x42dd0e);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x20b'),_0x215ed1);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x20c'),_0x3761c9);loggerPredictive['info'](_0xe8a8('0x20d'),_0x58c777);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x84'));return new BPromise(function(_0x20f162,_0x259617){if(_0x53f0ed<=0x0||isNaN(_0x53f0ed)){return _0x259617(msgResponse(_0xe8a8('0x20e'),'Error','m\x20=\x20'+_0x53f0ed));}if(_0x215ed1<=0x0||isNaN(_0x215ed1)){return _0x259617(msgResponse(_0xe8a8('0x20e'),'Error','Ts\x20=\x20'+_0x215ed1));}if(_0x3761c9<=0x0||isNaN(_0x3761c9)){return _0x259617(msgResponse('[abandonmentRate]','Error',_0xe8a8('0x20f')+_0x3761c9));}if(_0x42dd0e<=0x0||isNaN(_0x42dd0e)){return _0x259617(msgResponse(_0xe8a8('0x20e'),_0xe8a8('0x47'),_0xe8a8('0x210')+_0x42dd0e));}if(_0x58c777<=0x0||isNaN(_0x58c777)){return _0x259617(msgResponse('[abandonmentRate]',_0xe8a8('0x47'),_0xe8a8('0x211')+_0x58c777));}_0xe90f3a=_0xe90f3a||0x0;var _0x1861b0=0x1/_0x215ed1;var _0x203488=0x0;var _0x5330ce=0x0;var _0x49dd46=0x0;var _0x2383ec=0x0;for(var _0x47e18e=0x0;_0x49dd46<_0x58c777;_0x47e18e+=0x1){_0x5330ce=_0x47e18e/_0x42dd0e;_0x203488=(_0x3761c9*_0x5330ce+_0xe90f3a)/_0x1861b0;_0x49dd46=erlangb(_0x203488,_0x53f0ed);_0x2383ec=_0x203488/_0x53f0ed*(0x1-erlangb(_0x203488,_0x53f0ed));}return _0x20f162({'erlangCalls':_0x47e18e,'erlangCallToSecond':_0x42dd0e/_0x47e18e,'erlangAbandonmentRate':_0x49dd46,'erlangBusyFactor':_0x2383ec});});};Dialer['prototype']['busyFactor']=function(_0x50d7c1,_0x3d5978,_0x10c97a,_0x101951,_0x22e61a,_0x6d5feb){loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x212'));loggerPredictive[_0xe8a8('0x7e')]('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',_0x50d7c1);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x20a'),_0x3d5978);loggerPredictive['info'](_0xe8a8('0x20b'),_0x10c97a);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x20c'),_0x101951);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x213'),_0x22e61a);loggerPredictive[_0xe8a8('0x7e')](_0xe8a8('0x84'));return new BPromise(function(_0x338e34,_0x2621d2){if(_0x50d7c1<=0x0||isNaN(_0x50d7c1)){return _0x2621d2(msgResponse(_0xe8a8('0x214'),_0xe8a8('0x47'),_0xe8a8('0x215')+_0x50d7c1));}if(_0x10c97a<=0x0||isNaN(_0x10c97a)){return _0x2621d2(msgResponse('[busyFactor]',_0xe8a8('0x47'),_0xe8a8('0x216')+_0x10c97a));}if(_0x101951<=0x0||isNaN(_0x101951)){return _0x2621d2(msgResponse(_0xe8a8('0x214'),_0xe8a8('0x47'),'p\x20=\x20'+_0x101951));}if(_0x3d5978<=0x0||isNaN(_0x3d5978)){return _0x2621d2(msgResponse(_0xe8a8('0x214'),_0xe8a8('0x47'),'interval\x20=\x20'+_0x3d5978));}if(_0x22e61a<=0x0||isNaN(_0x22e61a)){return _0x2621d2(msgResponse(_0xe8a8('0x214'),'Error',_0xe8a8('0x217')+_0x22e61a));}_0x6d5feb=_0x6d5feb||0x0;var _0x31b619=0x1/_0x10c97a;var _0x5663f4=0x0;var _0x216fb2=0x0;var _0x4937b6=0x0;var _0x13dc45=0x0;for(var _0x39a37d=0x0;_0x13dc45<_0x22e61a;_0x39a37d+=0x1){_0x216fb2=_0x39a37d/_0x3d5978;_0x5663f4=(_0x101951*_0x216fb2+_0x6d5feb)/_0x31b619;_0x4937b6=erlangb(_0x5663f4,_0x50d7c1);_0x13dc45=_0x5663f4/_0x50d7c1*(0x1-erlangb(_0x5663f4,_0x50d7c1));}return _0x338e34({'erlangCalls':_0x39a37d,'erlangCallToSecond':_0x3d5978/_0x39a37d,'erlangAbandonmentRate':_0x4937b6,'erlangBusyFactor':_0x13dc45});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 3ba0987..fff27ea 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 _0xf4d2=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','talktime','connectedlinename','reason','callback','callbackuniqueid'];(function(_0x4a17be,_0x26b003){var _0x4ae73f=function(_0x22f417){while(--_0x22f417){_0x4a17be['push'](_0x4a17be['shift']());}};_0x4ae73f(++_0x26b003);}(_0xf4d2,0x130));var _0x2f4d=function(_0xafabe3,_0x628db0){_0xafabe3=_0xafabe3-0x0;var _0x360c63=_0xf4d2[_0xafabe3];return _0x360c63;};'use strict';var util=require(_0x2f4d('0x0'));var _=require(_0x2f4d('0x1'));var moment=require(_0x2f4d('0x2'));function getSeconds(_0x49256d,_0xbbc256){var _0x222c99=moment(_0x49256d)[_0x2f4d('0x3')](0x0);var _0x25b558=moment(_0xbbc256)[_0x2f4d('0x3')](0x0);return _0x222c99[_0x2f4d('0x4')](_0x25b558,_0x2f4d('0x5'));}function QueueCallerAbandon(_0x5ae791,_0x1a96ae){this[_0x2f4d('0x6')]=_0x5ae791['scheduledat'];this['type']=_0x5ae791['type'];this[_0x2f4d('0x7')]=_0x5ae791[_0x2f4d('0x8')]==='outbound'?_0x2f4d('0x9'):_0x5ae791[_0x2f4d('0x8')];this[_0x2f4d('0xa')]=_0x5ae791[_0x2f4d('0xa')];this['countcongestionretry']=_0x5ae791['countcongestionretry'];this[_0x2f4d('0xb')]=_0x5ae791['countnoanswerretry'];this[_0x2f4d('0xc')]=_0x5ae791[_0x2f4d('0xa')]+_0x5ae791['countcongestionretry']+_0x5ae791[_0x2f4d('0xb')]+_0x5ae791[_0x2f4d('0xd')]+_0x5ae791['countdropretry']+_0x5ae791[_0x2f4d('0xe')]+_0x5ae791[_0x2f4d('0xf')]+_0x5ae791['countagentrejectretry'];this['countnosuchnumberretry']=_0x5ae791['countnosuchnumberretry'];this['countdropretry']=_0x5ae791[_0x2f4d('0x10')];this['countabandonedretry']=_0x5ae791[_0x2f4d('0xe')];this[_0x2f4d('0xf')]=_0x5ae791[_0x2f4d('0xf')];this['countagentrejectretry']=_0x5ae791[_0x2f4d('0x11')];this['uniqueid']=_0x1a96ae[_0x2f4d('0x12')];this[_0x2f4d('0x13')]=_0x5ae791[_0x2f4d('0x14')];this[_0x2f4d('0x15')]=_0x5ae791[_0x2f4d('0x16')];this[_0x2f4d('0x17')]=_0x5ae791['starttime'];this[_0x2f4d('0x18')]=_0x5ae791[_0x2f4d('0x18')];this['droptime']=_0x5ae791[_0x2f4d('0x19')];this['endtime']=this[_0x2f4d('0x19')];this[_0x2f4d('0x1a')]=getSeconds(_0x5ae791[_0x2f4d('0x18')],_0x5ae791[_0x2f4d('0x17')]);this['holdtime']=getSeconds(this[_0x2f4d('0x19')],_0x5ae791[_0x2f4d('0x18')]);this[_0x2f4d('0x1b')]=0x0;this['queue']=_0x1a96ae['queue'];this['membername']=_0x1a96ae[_0x2f4d('0x1c')];this[_0x2f4d('0x1d')]=_0x1a96ae[_0x2f4d('0x1d')];this[_0x2f4d('0x1e')]=_0x5ae791[_0x2f4d('0x1e')];this[_0x2f4d('0x1f')]=_0x5ae791[_0x2f4d('0x1f')];this['callbackat']=_0x5ae791[_0x2f4d('0x20')];this['recallme']=_0x5ae791[_0x2f4d('0x21')];this[_0x2f4d('0x22')]=_0x5ae791[_0x2f4d('0x22')];this[_0x2f4d('0x23')]=_0x5ae791['ListId'];this[_0x2f4d('0x24')]=_0x5ae791[_0x2f4d('0x24')];this['VoiceQueueId']=_0x5ae791[_0x2f4d('0x25')];this[_0x2f4d('0x26')]=_0x5ae791[_0x2f4d('0x26')];this[_0x2f4d('0x27')]=_0x5ae791['originatecalleridnum']||'';this[_0x2f4d('0x28')]=_0x5ae791['originatecalleridname']||'';}module[_0x2f4d('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xd856=['calleridnum','number','starttime','responsetime','droptime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid'];(function(_0x44bc6d,_0xbb54c9){var _0x3ea0ee=function(_0x56b89b){while(--_0x56b89b){_0x44bc6d['push'](_0x44bc6d['shift']());}};_0x3ea0ee(++_0xbb54c9);}(_0xd856,0xb6));var _0x6d85=function(_0x55ffa0,_0x3c8d0e){_0x55ffa0=_0x55ffa0-0x0;var _0x644bfc=_0xd856[_0x55ffa0];return _0x644bfc;};'use strict';var util=require(_0x6d85('0x0'));var _=require('lodash');var moment=require(_0x6d85('0x1'));function getSeconds(_0x5ab1b2,_0x45b4ad){var _0x2fed3c=moment(_0x5ab1b2)[_0x6d85('0x2')](0x0);var _0x47d46a=moment(_0x45b4ad)[_0x6d85('0x2')](0x0);return _0x2fed3c['diff'](_0x47d46a,_0x6d85('0x3'));}function QueueCallerAbandon(_0x5a6de8,_0x24283a){this[_0x6d85('0x4')]=_0x5a6de8[_0x6d85('0x4')];this[_0x6d85('0x5')]=_0x5a6de8[_0x6d85('0x5')];this[_0x6d85('0x6')]=_0x5a6de8['type']===_0x6d85('0x7')?_0x6d85('0x8'):_0x5a6de8[_0x6d85('0x5')];this[_0x6d85('0x9')]=_0x5a6de8[_0x6d85('0x9')];this[_0x6d85('0xa')]=_0x5a6de8[_0x6d85('0xa')];this[_0x6d85('0xb')]=_0x5a6de8[_0x6d85('0xb')];this['countglobal']=_0x5a6de8['countbusyretry']+_0x5a6de8['countcongestionretry']+_0x5a6de8[_0x6d85('0xb')]+_0x5a6de8[_0x6d85('0xc')]+_0x5a6de8[_0x6d85('0xd')]+_0x5a6de8[_0x6d85('0xe')]+_0x5a6de8[_0x6d85('0xf')]+_0x5a6de8[_0x6d85('0x10')];this[_0x6d85('0xc')]=_0x5a6de8[_0x6d85('0xc')];this[_0x6d85('0xd')]=_0x5a6de8[_0x6d85('0xd')];this[_0x6d85('0xe')]=_0x5a6de8['countabandonedretry'];this[_0x6d85('0xf')]=_0x5a6de8[_0x6d85('0xf')];this[_0x6d85('0x10')]=_0x5a6de8[_0x6d85('0x10')];this['uniqueid']=_0x24283a[_0x6d85('0x11')];this['calleridname']=_0x5a6de8['name'];this[_0x6d85('0x12')]=_0x5a6de8[_0x6d85('0x13')];this[_0x6d85('0x14')]=_0x5a6de8['starttime'];this['responsetime']=_0x5a6de8[_0x6d85('0x15')];this[_0x6d85('0x16')]=_0x5a6de8['droptime'];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x5a6de8['responsetime'],_0x5a6de8['starttime']);this[_0x6d85('0x17')]=getSeconds(this['droptime'],_0x5a6de8[_0x6d85('0x15')]);this[_0x6d85('0x18')]=0x0;this[_0x6d85('0x8')]=_0x24283a['queue'];this[_0x6d85('0x19')]=_0x24283a[_0x6d85('0x1a')];this[_0x6d85('0x1b')]=_0x24283a[_0x6d85('0x1b')];this[_0x6d85('0x1c')]=_0x5a6de8[_0x6d85('0x1c')];this[_0x6d85('0x1d')]=_0x5a6de8[_0x6d85('0x1d')];this['callbackat']=_0x5a6de8[_0x6d85('0x1e')];this[_0x6d85('0x1f')]=_0x5a6de8[_0x6d85('0x1f')];this[_0x6d85('0x20')]=_0x5a6de8[_0x6d85('0x20')];this[_0x6d85('0x21')]=_0x5a6de8[_0x6d85('0x21')];this['UserId']=_0x5a6de8[_0x6d85('0x22')];this[_0x6d85('0x23')]=_0x5a6de8['VoiceQueueId'];this[_0x6d85('0x24')]=_0x5a6de8['CampaignId'];this[_0x6d85('0x25')]=_0x5a6de8['originatecalleridnum']||'';this[_0x6d85('0x26')]=_0x5a6de8[_0x6d85('0x26')]||'';}module[_0x6d85('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 15c89c1..90d9097 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(_0x1f7746,_0x3ab2db){var _0x428123=function(_0x3997d8){while(--_0x3997d8){_0x1f7746['push'](_0x1f7746['shift']());}};_0x428123(++_0x3ab2db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x1a7a0d,_0x2d5bfa){var _0x14c390=function(_0x5271bf){while(--_0x5271bf){_0x1a7a0d['push'](_0x1a7a0d['shift']());}};_0x14c390(++_0x2d5bfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 614327d..eb4ef82 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 _0x97c1=['lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','then','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','execOriginate','addVariables','ext','.pdf','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x197c('0x0'));var _=require(_0x197c('0x1'));var BPromise=require('bluebird');var uuid=require(_0x197c('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x197c('0x3'));var gs=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var ami=require(_0x197c('0x7'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x197c('0x8'));var Action=require(_0x197c('0x9'));var faxAccount=require(_0x197c('0xa'));var attachment=require(_0x197c('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5d42c5){this[_0x197c('0xc')]={};this['faxAccounts']=_0x5d42c5[_0x197c('0xd')];this[_0x197c('0xe')]=_0x5d42c5[_0x197c('0xe')];this[_0x197c('0xf')]={};ami['on']('newchannel',this[_0x197c('0x10')][_0x197c('0x11')](this));ami['on'](_0x197c('0x12'),this[_0x197c('0x13')][_0x197c('0x11')](this));ami['on']('newstate',this[_0x197c('0x14')][_0x197c('0x11')](this));ami['on'](_0x197c('0x15'),this[_0x197c('0x16')]['bind'](this));ami['on'](_0x197c('0x17'),this[_0x197c('0x18')][_0x197c('0x11')](this));ami['on'](_0x197c('0x19'),this[_0x197c('0x1a')][_0x197c('0x11')](this));ami['on']('hangup',this['syncHangup'][_0x197c('0x11')](this));ami['on'](_0x197c('0x1b'),this[_0x197c('0x1c')][_0x197c('0x11')](this));}Fax[_0x197c('0x1d')][_0x197c('0x10')]=function(_0x437050){if(_0x437050[_0x197c('0x1e')]==='from-voip-provider'){for(var _0x372311 in this['faxAccounts']){if(this['faxAccounts'][_0x197c('0x1f')](_0x372311)){if(_0x437050[_0x197c('0x20')]===this[_0x197c('0xd')][_0x372311][_0x197c('0x21')]){this['channels'][_0x437050[_0x197c('0x22')]]={};this[_0x197c('0xc')][_0x437050[_0x197c('0x22')]]['channel']=_0x437050[_0x197c('0x23')];this[_0x197c('0xc')][_0x437050[_0x197c('0x22')]]['id']=this[_0x197c('0xd')][_0x372311]['id'];this[_0x197c('0xc')][_0x437050[_0x197c('0x22')]][_0x197c('0x24')]=this[_0x197c('0xd')][_0x372311][_0x197c('0x24')];logger[_0x197c('0x25')](_0x437050[_0x197c('0x22')],_0x197c('0x26'));}}}}if(this[_0x197c('0xf')][_0x437050[_0x197c('0x22')]]){this[_0x197c('0xc')][_0x437050[_0x197c('0x22')]]={};this['channels'][_0x437050[_0x197c('0x22')]][_0x197c('0x23')]=_0x437050[_0x197c('0x23')];logger['info'](_0x437050[_0x197c('0x22')],_0x197c('0x26'));}};Fax['prototype']['syncVarSet']=function(_0x12b37b){if(this['channels'][_0x12b37b[_0x197c('0x22')]]){for(var _0x14b0aa in _0x12b37b[_0x197c('0x27')]){if(_0x12b37b[_0x197c('0x27')][_0x197c('0x1f')](_0x14b0aa)){this[_0x197c('0xc')][_0x12b37b[_0x197c('0x22')]][_0x14b0aa]=_0x12b37b[_0x197c('0x28')];}}}};Fax[_0x197c('0x1d')]['syncNewState']=function(_0x50dea3){if(this['channels'][_0x50dea3['uniqueid']]){this[_0x197c('0xc')][_0x50dea3['uniqueid']][_0x197c('0x29')]=_0x50dea3[_0x197c('0x29')];this['channels'][_0x50dea3[_0x197c('0x22')]]['channelstatedesc']=_0x50dea3[_0x197c('0x2a')];}};Fax[_0x197c('0x1d')][_0x197c('0x16')]=function(_0x365f9f){if(this[_0x197c('0xc')][_0x365f9f[_0x197c('0x22')]]){for(var _0x176d83 in _0x365f9f[_0x197c('0x27')]){if(_0x365f9f[_0x197c('0x27')]['hasOwnProperty'](_0x176d83)){this['channels'][_0x365f9f[_0x197c('0x22')]][_0x176d83]=_0x365f9f[_0x197c('0x28')];}}}};Fax[_0x197c('0x1d')][_0x197c('0x18')]=function(_0x2c3623){if(this[_0x197c('0xc')][_0x2c3623[_0x197c('0x22')]]){this['channels'][_0x2c3623['uniqueid']][_0x197c('0x2b')]=_0x2c3623[_0x197c('0x2b')];this['channels'][_0x2c3623['uniqueid']][_0x197c('0x2c')]=_0x2c3623[_0x197c('0x2c')];this[_0x197c('0xc')][_0x2c3623[_0x197c('0x22')]][_0x197c('0x21')]=_0x2c3623[_0x197c('0x21')];this[_0x197c('0xc')][_0x2c3623[_0x197c('0x22')]][_0x197c('0x2d')]=_0x2c3623['filename'];logger[_0x197c('0x25')](_0x2c3623[_0x197c('0x22')],_0x197c('0x2e'));}};Fax[_0x197c('0x1d')][_0x197c('0x1a')]=function(_0x151e2f){var _0x50ec25=this;if(this[_0x197c('0xc')][_0x151e2f[_0x197c('0x22')]]){var _0x2c6cbc=this['channels'][_0x151e2f[_0x197c('0x22')]]['id'];this[_0x197c('0xc')][_0x151e2f[_0x197c('0x22')]][_0x197c('0x2f')]=_0x151e2f[_0x197c('0x2f')];this[_0x197c('0xc')][_0x151e2f[_0x197c('0x22')]][_0x197c('0x30')]=_0x151e2f[_0x197c('0x30')];this[_0x197c('0xc')][_0x151e2f['uniqueid']][_0x197c('0x21')]=_0x151e2f[_0x197c('0x21')];this['channels'][_0x151e2f['uniqueid']][_0x197c('0x31')]=_0x151e2f[_0x197c('0x31')];this[_0x197c('0xc')][_0x151e2f[_0x197c('0x22')]][_0x197c('0x32')]=_0x151e2f['transferrate'];this[_0x197c('0xc')][_0x151e2f[_0x197c('0x22')]][_0x197c('0x2d')]=_0x151e2f[_0x197c('0x2d')];this[_0x197c('0xc')][_0x151e2f['uniqueid']][_0x197c('0x33')]=_0x151e2f[_0x197c('0x33')];if(this[_0x197c('0xc')][_0x151e2f[_0x197c('0x22')]][_0x197c('0x30')]>0x0){tiff2pdf(_0x151e2f['filename'],_0x197c('0x34'),function(_0x3f417d){logger[_0x197c('0x25')](_0x151e2f[_0x197c('0x22')],_0x197c('0x35'),_0x3f417d[_0x197c('0x36')]);attachment[_0x197c('0x37')]({'name':path[_0x197c('0x38')](_0x151e2f[_0x197c('0x2d')])[_0x197c('0x24')],'basename':path[_0x197c('0x38')](_0x151e2f['filename'])['name']+'.pdf','type':'application/pdf'})[_0x197c('0x39')](function(_0x34271f){faxAccount['notify'](_0x2c6cbc,{'from':_0x151e2f[_0x197c('0x33')],'mapKey':_0x197c('0x6'),'body':path['parse'](_0x151e2f[_0x197c('0x2d')])[_0x197c('0x24')]+'.pdf','AttachmentId':_0x34271f['id']})[_0x197c('0x3a')](function(_0x233ae1){logger['error'](_0x151e2f[_0x197c('0x22')],_0x197c('0x3b'),JSON[_0x197c('0x3c')](_0x233ae1));});})['catch'](function(_0x3b36e5){logger[_0x197c('0x3d')](_0x151e2f[_0x197c('0x22')],_0x197c('0x3e'),JSON['stringify'](_0x3b36e5));});});}logger[_0x197c('0x25')](_0x151e2f[_0x197c('0x22')],_0x197c('0x3e'));}};Fax['prototype']['syncOriginateResponse']=function(_0x3a5089){if(this[_0x197c('0xf')][_0x3a5089[_0x197c('0x22')]]){_[_0x197c('0x3f')](this[_0x197c('0xc')][_0x3a5089[_0x197c('0x22')]],_['pick'](_0x3a5089,[_0x197c('0x40'),'reason']));}};function updateStatus(_0x28be4b){if(_0x28be4b[_0x197c('0x41')]){faxMessage[_0x197c('0x42')](_0x28be4b[_0x197c('0x41')],{'failMessage':_0x197c('0x43')})[_0x197c('0x39')](function(_0x172720){ut[_0x197c('0x44')]('[Fax][Message][Error][Updated]',_0x172720);})[_0x197c('0x3a')](function(_0x1224f2){ut[_0x197c('0x44')]('[Fax][Message][Error][NoUpdate1]',_0x1224f2);});}else{ut[_0x197c('0x44')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x197c('0x1d')][_0x197c('0x45')]=function(_0x1ec51a,_0x22a106,_0x1d7cdd){var _0x304537=this;var _0x360599={};if(_0x22a106){_0x360599={'read':_0x22a106};}else{_0x360599={'failMessage':_0x1d7cdd};}if(this[_0x197c('0xf')][_0x1ec51a]['AttachmentId']){faxMessage[_0x197c('0x42')](this[_0x197c('0xf')][_0x1ec51a][_0x197c('0x41')],_0x360599)['then'](function(_0x244faa){ut[_0x197c('0x44')](_0x197c('0x46'),_0x244faa);})[_0x197c('0x3a')](function(_0x3388fa){ut['logger']('[Fax][Message][NoUpdate1]',_0x3388fa);})[_0x197c('0x47')](function(){delete _0x304537[_0x197c('0xc')][_0x1ec51a];delete _0x304537[_0x197c('0xf')][_0x1ec51a];});}else{ut[_0x197c('0x44')](_0x197c('0x48'));delete this['channels'][_0x1ec51a];delete this['actions'][_0x1ec51a];}};Fax[_0x197c('0x1d')][_0x197c('0x49')]=function(_0x5855bd){var _0xb3747b=this;if(this[_0x197c('0xc')][_0x5855bd[_0x197c('0x22')]]){if(this[_0x197c('0xf')][_0x5855bd[_0x197c('0x22')]]){this[_0x197c('0xc')][_0x5855bd['uniqueid']]['id']=this[_0x197c('0xf')][_0x5855bd[_0x197c('0x22')]]['id'];this['channels'][_0x5855bd['uniqueid']][_0x197c('0x24')]=this['actions'][_0x5855bd[_0x197c('0x22')]][_0x197c('0x24')];}logger[_0x197c('0x25')](_0x5855bd['uniqueid'],this[_0x197c('0xf')][_0x5855bd[_0x197c('0x22')]]?'\x20hangup\x20sendFile\x20':_0x197c('0x4a'),JSON[_0x197c('0x3c')](this[_0x197c('0xc')][_0x5855bd['uniqueid']]));if(this[_0x197c('0xf')][_0x5855bd[_0x197c('0x22')]]){if(this['channels'][_0x5855bd['uniqueid']][_0x197c('0x4b')]>0x0&&this[_0x197c('0xc')][_0x5855bd[_0x197c('0x22')]]['faxstatus']===_0x197c('0x4c')){this[_0x197c('0x45')](_0x5855bd[_0x197c('0x22')],!![]);}else{this['updateStatus'](_0x5855bd[_0x197c('0x22')],![],this[_0x197c('0xc')][_0x5855bd[_0x197c('0x22')]][_0x197c('0x4d')]?_0x197c('0x4e')+this[_0x197c('0xc')][_0x5855bd[_0x197c('0x22')]][_0x197c('0x4d')]:_0x197c('0x4f'));}}}};Fax[_0x197c('0x1d')]['send']=function(_0x1f7ad0){var _0x572649=this;return new BPromise(function(_0x491162,_0x4a8e13){_0x572649['execOriginate'](_0x1f7ad0,_0x572649[_0x197c('0xd')][_0x1f7ad0[_0x197c('0x50')]])[_0x197c('0x39')](function(_0x3ad734){ut['logger'](_0x197c('0x51'),_0x3ad734);_0x491162(ut['message'](_0x197c('0x52')));})['catch'](function(_0x9df94b){ut['logger'](_0x197c('0x53'),_0x9df94b);updateStatus(_0x1f7ad0);_0x4a8e13(ut[_0x197c('0x36')](_0x197c('0x54')));});});};Fax[_0x197c('0x1d')]['checkAfterSend']=function(_0x2bbec2){var _0x304cb7=this;return new BPromise(function(_0x33ae9c,_0x523a69){var _0x2a4857=_0x304cb7[_0x197c('0x55')](_0x304cb7[_0x197c('0xd')][_0x2bbec2[_0x197c('0x50')]][_0x197c('0x56')],_0x2bbec2);if(_0x2a4857[_0x197c('0x57')]){_0x33ae9c(ut[_0x197c('0x36')](_0x197c('0x58')));}else{_0x523a69(ut[_0x197c('0x36')](_0x2a4857[_0x197c('0x36')]));}});};function originate(_0x342efa,_0x25d3c1,_0x43c0b2){return new BPromise(function(_0x395fce,_0x2b1c78){if(_0x43c0b2){var _0x18d530=util[_0x197c('0x59')](_0x197c('0x5a'),path['parse'](_0x342efa['path'])['name'],_0x342efa[_0x197c('0x5b')]);gs['execute'](_0x18d530)[_0x197c('0x39')](function(){_0x342efa['path']=util['format'](_0x197c('0x5c'),path[_0x197c('0x38')](_0x342efa[_0x197c('0x5b')])['dir'],path[_0x197c('0x38')](_0x342efa[_0x197c('0x5b')])['name']);_0x25d3c1[_0x197c('0x5d')]=_0x342efa[_0x197c('0x5b')];ut[_0x197c('0x44')](_0x197c('0x5e'),'');ami['Action'](ut[_0x197c('0x5f')](_0x342efa,_0x25d3c1))['then'](function(_0x315bd3){_0x395fce(_0x315bd3);})['catch'](function(_0x9411e8){_0x2b1c78(_0x9411e8);});})[_0x197c('0x3a')](function(_0x272674){_0x2b1c78(_0x272674);});}else{ami['Action'](ut[_0x197c('0x5f')](_0x342efa,_0x25d3c1))[_0x197c('0x39')](function(_0x328655){_0x395fce(_0x328655);})['catch'](function(_0xa6a5af){_0x2b1c78(_0xa6a5af);});}});}Fax[_0x197c('0x1d')][_0x197c('0x60')]=function(_0x284f54,_0xae273e){var _0x1c18aa=this;return new BPromise(function(_0x4bc7cc,_0x6f6c09){var _0x4f3192=uuid['v4']();var _0x51c88c=ut[_0x197c('0x61')](_0x284f54,_0xae273e);_0x1c18aa[_0x197c('0xf')][_0x4f3192]=new Action(_0x4f3192,_0xae273e,_0x284f54);var _0x58e708=_0x1c18aa[_0x197c('0xf')][_0x4f3192];if(path[_0x197c('0x38')](_0x284f54[_0x197c('0x5b')])[_0x197c('0x62')]===_0x197c('0x63')){originate(_0x58e708,_0x51c88c,!![])['then'](function(_0x5da64e){_0x4bc7cc(_0x5da64e);})['catch'](function(_0x5575fe){_0x6f6c09(_0x5575fe);});}else{originate(_0x58e708,_0x51c88c,![])[_0x197c('0x39')](function(_0x3d024b){_0x4bc7cc(_0x3d024b);})['catch'](function(_0x52e58b){_0x6f6c09(_0x52e58b);});}});};Fax[_0x197c('0x1d')]['isTrunkReachable']=function(_0x4b1088){return!_[_0x197c('0x64')](_0x4b1088)&&!_[_0x197c('0x64')](_0x4b1088[_0x197c('0x24')])&&!_[_0x197c('0x64')](_0x4b1088[_0x197c('0x65')])&&_0x4b1088[_0x197c('0x65')]&&!_['isNil'](this[_0x197c('0xe')][util[_0x197c('0x59')](_0x197c('0x66'),_0x4b1088[_0x197c('0x24')])])&&!_[_0x197c('0x64')](this[_0x197c('0xe')][util[_0x197c('0x59')]('SIP/%s',_0x4b1088[_0x197c('0x24')])][_0x197c('0x2c')])&&(this[_0x197c('0xe')][util[_0x197c('0x59')](_0x197c('0x66'),_0x4b1088[_0x197c('0x24')])]['status']===_0x197c('0x67')||this[_0x197c('0xe')][util['format'](_0x197c('0x66'),_0x4b1088[_0x197c('0x24')])][_0x197c('0x2c')]===_0x197c('0x68'));};Fax[_0x197c('0x1d')]['checkTrunk']=function(_0x54f819,_0x4e9b93){if(!this[_0x197c('0x69')](_0x54f819)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x197c('0x64')](_0x54f819)?'':_0x54f819[_0x197c('0x24')]+_0x197c('0x6a'));return{'isValid':![],'message':_0x197c('0x6b')};}if(_[_0x197c('0x64')](_0x4e9b93['fax'])){ut['logger'](_0x197c('0x6c'),JSON[_0x197c('0x3c')](_0x4e9b93));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x197c('0x64')](_0x4e9b93[_0x197c('0x5b')])){ut[_0x197c('0x44')](_0x197c('0x6d'),JSON[_0x197c('0x3c')](_0x4e9b93));return{'isValid':![],'message':_0x197c('0x6e')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x197c('0x6f')]=Fax; \ No newline at end of file +var _0x36ee=['./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','hasOwnProperty','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','error','stringify','\x20receiveFax\x20','actions','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','bluebird','moment','path','tiff2pdf'];(function(_0x54a7d0,_0x2ff9b5){var _0xf4b29a=function(_0x20bd34){while(--_0x20bd34){_0x54a7d0['push'](_0x54a7d0['shift']());}};_0xf4b29a(++_0x2ff9b5);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xe36e('0x0'));var uuid=require('uuid');var moment=require(_0xe36e('0x1'));var path=require(_0xe36e('0x2'));var tiff2pdf=require(_0xe36e('0x3'));var gs=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var ami=require(_0xe36e('0x7'));var rpcDb=require(_0xe36e('0x8'));var Channel=require(_0xe36e('0x9'));var ut=require(_0xe36e('0xa'));var Action=require(_0xe36e('0xb'));var faxAccount=require(_0xe36e('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xe36e('0xd'));function Fax(_0x4aebdd){this[_0xe36e('0xe')]={};this[_0xe36e('0xf')]=_0x4aebdd[_0xe36e('0xf')];this['trunks']=_0x4aebdd[_0xe36e('0x10')];this['actions']={};ami['on'](_0xe36e('0x11'),this[_0xe36e('0x12')][_0xe36e('0x13')](this));ami['on'](_0xe36e('0x14'),this[_0xe36e('0x15')][_0xe36e('0x13')](this));ami['on'](_0xe36e('0x16'),this[_0xe36e('0x17')]['bind'](this));ami['on'](_0xe36e('0x18'),this[_0xe36e('0x19')][_0xe36e('0x13')](this));ami['on'](_0xe36e('0x1a'),this['syncFaxStatus'][_0xe36e('0x13')](this));ami['on']('receivefax',this['syncReceiveFax'][_0xe36e('0x13')](this));ami['on'](_0xe36e('0x1b'),this[_0xe36e('0x1c')][_0xe36e('0x13')](this));ami['on'](_0xe36e('0x1d'),this[_0xe36e('0x1e')][_0xe36e('0x13')](this));}Fax[_0xe36e('0x1f')][_0xe36e('0x12')]=function(_0x428d34){if(_0x428d34['context']===_0xe36e('0x20')){for(var _0x2184ae in this['faxAccounts']){if(this[_0xe36e('0xf')]['hasOwnProperty'](_0x2184ae)){if(_0x428d34[_0xe36e('0x21')]===this[_0xe36e('0xf')][_0x2184ae]['localstationid']){this[_0xe36e('0xe')][_0x428d34[_0xe36e('0x22')]]={};this[_0xe36e('0xe')][_0x428d34['uniqueid']][_0xe36e('0x23')]=_0x428d34[_0xe36e('0x23')];this[_0xe36e('0xe')][_0x428d34[_0xe36e('0x22')]]['id']=this[_0xe36e('0xf')][_0x2184ae]['id'];this[_0xe36e('0xe')][_0x428d34['uniqueid']][_0xe36e('0x24')]=this[_0xe36e('0xf')][_0x2184ae][_0xe36e('0x24')];logger[_0xe36e('0x25')](_0x428d34[_0xe36e('0x22')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x428d34[_0xe36e('0x22')]]){this[_0xe36e('0xe')][_0x428d34[_0xe36e('0x22')]]={};this[_0xe36e('0xe')][_0x428d34[_0xe36e('0x22')]][_0xe36e('0x23')]=_0x428d34[_0xe36e('0x23')];logger['info'](_0x428d34[_0xe36e('0x22')],_0xe36e('0x26'));}};Fax[_0xe36e('0x1f')][_0xe36e('0x15')]=function(_0x5e58d8){if(this[_0xe36e('0xe')][_0x5e58d8['uniqueid']]){for(var _0xf7b02e in _0x5e58d8['variable']){if(_0x5e58d8[_0xe36e('0x27')]['hasOwnProperty'](_0xf7b02e)){this[_0xe36e('0xe')][_0x5e58d8['uniqueid']][_0xf7b02e]=_0x5e58d8[_0xe36e('0x28')];}}}};Fax['prototype']['syncNewState']=function(_0x5d8fd8){if(this['channels'][_0x5d8fd8[_0xe36e('0x22')]]){this[_0xe36e('0xe')][_0x5d8fd8['uniqueid']]['channelstate']=_0x5d8fd8[_0xe36e('0x29')];this[_0xe36e('0xe')][_0x5d8fd8[_0xe36e('0x22')]][_0xe36e('0x2a')]=_0x5d8fd8[_0xe36e('0x2a')];}};Fax[_0xe36e('0x1f')]['syncNewExten']=function(_0xb98e78){if(this[_0xe36e('0xe')][_0xb98e78['uniqueid']]){for(var _0x87e595 in _0xb98e78[_0xe36e('0x27')]){if(_0xb98e78[_0xe36e('0x27')][_0xe36e('0x2b')](_0x87e595)){this[_0xe36e('0xe')][_0xb98e78[_0xe36e('0x22')]][_0x87e595]=_0xb98e78[_0xe36e('0x28')];}}}};Fax[_0xe36e('0x1f')][_0xe36e('0x2c')]=function(_0x1cc329){if(this[_0xe36e('0xe')][_0x1cc329['uniqueid']]){this[_0xe36e('0xe')][_0x1cc329['uniqueid']]['operation']=_0x1cc329[_0xe36e('0x2d')];this['channels'][_0x1cc329[_0xe36e('0x22')]][_0xe36e('0x2e')]=_0x1cc329[_0xe36e('0x2e')];this[_0xe36e('0xe')][_0x1cc329['uniqueid']]['localstationid']=_0x1cc329[_0xe36e('0x2f')];this[_0xe36e('0xe')][_0x1cc329[_0xe36e('0x22')]][_0xe36e('0x30')]=_0x1cc329['filename'];logger[_0xe36e('0x25')](_0x1cc329[_0xe36e('0x22')],_0xe36e('0x31'));}};Fax['prototype'][_0xe36e('0x32')]=function(_0x2ff8f4){var _0x5d9f64=this;if(this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]]){var _0x3a95d7=this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]]['id'];this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]][_0xe36e('0x33')]=_0x2ff8f4[_0xe36e('0x33')];this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]][_0xe36e('0x34')]=_0x2ff8f4[_0xe36e('0x34')];this['channels'][_0x2ff8f4[_0xe36e('0x22')]][_0xe36e('0x2f')]=_0x2ff8f4[_0xe36e('0x2f')];this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]]['resolution']=_0x2ff8f4['resolution'];this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]][_0xe36e('0x35')]=_0x2ff8f4[_0xe36e('0x35')];this[_0xe36e('0xe')][_0x2ff8f4[_0xe36e('0x22')]][_0xe36e('0x30')]=_0x2ff8f4[_0xe36e('0x30')];this['channels'][_0x2ff8f4[_0xe36e('0x22')]][_0xe36e('0x36')]=_0x2ff8f4['calleridnum'];if(this[_0xe36e('0xe')][_0x2ff8f4['uniqueid']][_0xe36e('0x34')]>0x0){tiff2pdf(_0x2ff8f4[_0xe36e('0x30')],_0xe36e('0x37'),function(_0x470f38){logger[_0xe36e('0x25')](_0x2ff8f4['uniqueid'],_0xe36e('0x38'),_0x470f38[_0xe36e('0x39')]);attachment[_0xe36e('0x3a')]({'name':path[_0xe36e('0x3b')](_0x2ff8f4[_0xe36e('0x30')])[_0xe36e('0x24')],'basename':path['parse'](_0x2ff8f4[_0xe36e('0x30')])[_0xe36e('0x24')]+_0xe36e('0x3c'),'type':_0xe36e('0x3d')})[_0xe36e('0x3e')](function(_0x49cf4b){faxAccount[_0xe36e('0x3f')](_0x3a95d7,{'from':_0x2ff8f4[_0xe36e('0x36')],'mapKey':_0xe36e('0x6'),'body':path[_0xe36e('0x3b')](_0x2ff8f4[_0xe36e('0x30')])[_0xe36e('0x24')]+_0xe36e('0x3c'),'AttachmentId':_0x49cf4b['id']})[_0xe36e('0x40')](function(_0x43c2d4){logger['error'](_0x2ff8f4['uniqueid'],_0xe36e('0x41'),JSON['stringify'](_0x43c2d4));});})[_0xe36e('0x40')](function(_0x3d322c){logger[_0xe36e('0x42')](_0x2ff8f4[_0xe36e('0x22')],'\x20receiveFax\x20',JSON[_0xe36e('0x43')](_0x3d322c));});});}logger[_0xe36e('0x25')](_0x2ff8f4['uniqueid'],_0xe36e('0x44'));}};Fax[_0xe36e('0x1f')][_0xe36e('0x1e')]=function(_0x42eae5){if(this[_0xe36e('0x45')][_0x42eae5[_0xe36e('0x22')]]){_[_0xe36e('0x46')](this[_0xe36e('0xe')][_0x42eae5[_0xe36e('0x22')]],_[_0xe36e('0x47')](_0x42eae5,[_0xe36e('0x48'),_0xe36e('0x49')]));}};function updateStatus(_0x3147c0){if(_0x3147c0[_0xe36e('0x4a')]){faxMessage[_0xe36e('0x4b')](_0x3147c0['AttachmentId'],{'failMessage':_0xe36e('0x4c')})['then'](function(_0x510fcf){ut[_0xe36e('0x4d')](_0xe36e('0x4e'),_0x510fcf);})['catch'](function(_0x3ec864){ut[_0xe36e('0x4d')](_0xe36e('0x4f'),_0x3ec864);});}else{ut[_0xe36e('0x4d')](_0xe36e('0x50'));}}Fax[_0xe36e('0x1f')][_0xe36e('0x51')]=function(_0x41e10d,_0x4d5762,_0x55d190){var _0x22117e=this;var _0x837e8={};if(_0x4d5762){_0x837e8={'read':_0x4d5762};}else{_0x837e8={'failMessage':_0x55d190};}if(this['actions'][_0x41e10d][_0xe36e('0x4a')]){faxMessage[_0xe36e('0x4b')](this[_0xe36e('0x45')][_0x41e10d][_0xe36e('0x4a')],_0x837e8)[_0xe36e('0x3e')](function(_0x53758e){ut['logger']('[Fax][Message][Updated]',_0x53758e);})['catch'](function(_0x47605d){ut[_0xe36e('0x4d')](_0xe36e('0x52'),_0x47605d);})[_0xe36e('0x53')](function(){delete _0x22117e[_0xe36e('0xe')][_0x41e10d];delete _0x22117e[_0xe36e('0x45')][_0x41e10d];});}else{ut[_0xe36e('0x4d')](_0xe36e('0x54'));delete this[_0xe36e('0xe')][_0x41e10d];delete this['actions'][_0x41e10d];}};Fax[_0xe36e('0x1f')][_0xe36e('0x1c')]=function(_0x5a058b){var _0xd0733f=this;if(this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]]){if(this[_0xe36e('0x45')][_0x5a058b[_0xe36e('0x22')]]){this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]]['id']=this[_0xe36e('0x45')][_0x5a058b[_0xe36e('0x22')]]['id'];this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]][_0xe36e('0x24')]=this[_0xe36e('0x45')][_0x5a058b[_0xe36e('0x22')]][_0xe36e('0x24')];}logger[_0xe36e('0x25')](_0x5a058b[_0xe36e('0x22')],this[_0xe36e('0x45')][_0x5a058b[_0xe36e('0x22')]]?_0xe36e('0x55'):_0xe36e('0x56'),JSON[_0xe36e('0x43')](this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]]));if(this[_0xe36e('0x45')][_0x5a058b['uniqueid']]){if(this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]]['faxpages']>0x0&&this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]][_0xe36e('0x1a')]===_0xe36e('0x57')){this[_0xe36e('0x51')](_0x5a058b[_0xe36e('0x22')],!![]);}else{this['updateStatus'](_0x5a058b[_0xe36e('0x22')],![],this['channels'][_0x5a058b[_0xe36e('0x22')]][_0xe36e('0x58')]?_0xe36e('0x59')+this[_0xe36e('0xe')][_0x5a058b[_0xe36e('0x22')]][_0xe36e('0x58')]:_0xe36e('0x5a'));}}}};Fax[_0xe36e('0x1f')]['send']=function(_0x34c7a5){var _0xcafb87=this;return new BPromise(function(_0x4e6929,_0x3068e1){_0xcafb87[_0xe36e('0x5b')](_0x34c7a5,_0xcafb87[_0xe36e('0xf')][_0x34c7a5[_0xe36e('0x5c')]])[_0xe36e('0x3e')](function(_0x3565cb){ut[_0xe36e('0x4d')]('[Fax][execOriginate][success]',_0x3565cb);_0x4e6929(ut[_0xe36e('0x39')](_0xe36e('0x5d')));})[_0xe36e('0x40')](function(_0x1b7268){ut[_0xe36e('0x4d')](_0xe36e('0x5e'),_0x1b7268);updateStatus(_0x34c7a5);_0x3068e1(ut[_0xe36e('0x39')](_0xe36e('0x5f')));});});};Fax[_0xe36e('0x1f')][_0xe36e('0x60')]=function(_0x1c98bf){var _0x509733=this;return new BPromise(function(_0x371af5,_0x9a77de){var _0xd10e0b=_0x509733[_0xe36e('0x61')](_0x509733['faxAccounts'][_0x1c98bf['FaxAccountId']][_0xe36e('0x62')],_0x1c98bf);if(_0xd10e0b['isValid']){_0x371af5(ut['message']('Trunk\x20Reachable'));}else{_0x9a77de(ut[_0xe36e('0x39')](_0xd10e0b['message']));}});};function originate(_0x2cbd78,_0x2f7093,_0x258a63){return new BPromise(function(_0x221a90,_0x1bd60d){if(_0x258a63){var _0x46f789=util[_0xe36e('0x63')](_0xe36e('0x64'),path[_0xe36e('0x3b')](_0x2cbd78['path'])[_0xe36e('0x24')],_0x2cbd78['path']);gs[_0xe36e('0x65')](_0x46f789)['then'](function(){_0x2cbd78[_0xe36e('0x2')]=util[_0xe36e('0x63')](_0xe36e('0x66'),path[_0xe36e('0x3b')](_0x2cbd78['path'])['dir'],path[_0xe36e('0x3b')](_0x2cbd78[_0xe36e('0x2')])[_0xe36e('0x24')]);_0x2f7093[_0xe36e('0x67')]=_0x2cbd78[_0xe36e('0x2')];ut[_0xe36e('0x4d')]('Convert\x20pdf\x20to\x20tif','');ami[_0xe36e('0x68')](ut[_0xe36e('0x69')](_0x2cbd78,_0x2f7093))['then'](function(_0xb83ea7){_0x221a90(_0xb83ea7);})['catch'](function(_0x45ebca){_0x1bd60d(_0x45ebca);});})[_0xe36e('0x40')](function(_0x1cb052){_0x1bd60d(_0x1cb052);});}else{ami[_0xe36e('0x68')](ut['variablesAction'](_0x2cbd78,_0x2f7093))[_0xe36e('0x3e')](function(_0x565bcf){_0x221a90(_0x565bcf);})['catch'](function(_0x39ace1){_0x1bd60d(_0x39ace1);});}});}Fax[_0xe36e('0x1f')]['execOriginate']=function(_0x51f319,_0x460cc9){var _0x5ae7c6=this;return new BPromise(function(_0x33f3f5,_0x36ddc0){var _0x2c0ed5=uuid['v4']();var _0x276533=ut[_0xe36e('0x6a')](_0x51f319,_0x460cc9);_0x5ae7c6[_0xe36e('0x45')][_0x2c0ed5]=new Action(_0x2c0ed5,_0x460cc9,_0x51f319);var _0x590885=_0x5ae7c6[_0xe36e('0x45')][_0x2c0ed5];if(path[_0xe36e('0x3b')](_0x51f319[_0xe36e('0x2')])[_0xe36e('0x6b')]==='.pdf'){originate(_0x590885,_0x276533,!![])[_0xe36e('0x3e')](function(_0x37409f){_0x33f3f5(_0x37409f);})[_0xe36e('0x40')](function(_0x39c9fe){_0x36ddc0(_0x39c9fe);});}else{originate(_0x590885,_0x276533,![])['then'](function(_0x38be05){_0x33f3f5(_0x38be05);})['catch'](function(_0x1dae76){_0x36ddc0(_0x1dae76);});}});};Fax['prototype'][_0xe36e('0x6c')]=function(_0x522968){return!_['isNil'](_0x522968)&&!_[_0xe36e('0x6d')](_0x522968[_0xe36e('0x24')])&&!_[_0xe36e('0x6d')](_0x522968['active'])&&_0x522968[_0xe36e('0x6e')]&&!_[_0xe36e('0x6d')](this['trunks'][util[_0xe36e('0x63')](_0xe36e('0x6f'),_0x522968[_0xe36e('0x24')])])&&!_['isNil'](this['trunks'][util[_0xe36e('0x63')](_0xe36e('0x6f'),_0x522968[_0xe36e('0x24')])][_0xe36e('0x2e')])&&(this[_0xe36e('0x10')][util['format'](_0xe36e('0x6f'),_0x522968[_0xe36e('0x24')])][_0xe36e('0x2e')]===_0xe36e('0x70')||this[_0xe36e('0x10')][util['format'](_0xe36e('0x6f'),_0x522968[_0xe36e('0x24')])][_0xe36e('0x2e')]==='unmonitored');};Fax[_0xe36e('0x1f')]['checkTrunk']=function(_0x2ee394,_0x4c1845){if(!this[_0xe36e('0x6c')](_0x2ee394)){ut[_0xe36e('0x4d')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xe36e('0x6d')](_0x2ee394)?'':_0x2ee394['name']+_0xe36e('0x71'));return{'isValid':![],'message':_0xe36e('0x72')};}if(_[_0xe36e('0x6d')](_0x4c1845[_0xe36e('0x6')])){ut[_0xe36e('0x4d')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xe36e('0x43')](_0x4c1845));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xe36e('0x6d')](_0x4c1845[_0xe36e('0x2')])){ut[_0xe36e('0x4d')](_0xe36e('0x73'),JSON[_0xe36e('0x43')](_0x4c1845));return{'isValid':![],'message':_0xe36e('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xe36e('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index efe1fef..c0446c9 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 _0x36b6=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x5314af,_0x35ee8f){var _0x261556=function(_0x236688){while(--_0x236688){_0x5314af['push'](_0x5314af['shift']());}};_0x261556(++_0x35ee8f);}(_0x36b6,0x16a));var _0x636b=function(_0x15bf03,_0x68c199){_0x15bf03=_0x15bf03-0x0;var _0x263bd2=_0x36b6[_0x15bf03];return _0x263bd2;};'use strict';var util=require(_0x636b('0x0'));var BPromise=require(_0x636b('0x1'));var logger=require(_0x636b('0x2'))(_0x636b('0x3'));var _=require(_0x636b('0x4'));var faxAccount=require(_0x636b('0x5'));function loggerCatch(_0x493a95){return function(_0x4744e5){logger['error'](_0x493a95,util['inspect'](_0x4744e5,{'showHidden':![],'depth':null}));};}exports[_0x636b('0x6')]=function(_0x1bb14e,_0x293015){return BPromise[_0x636b('0x7')]()[_0x636b('0x8')](faxAccount[_0x636b('0x6')](_0x1bb14e,_0x293015))[_0x636b('0x9')](loggerCatch(_0x636b('0xa')));}; \ No newline at end of file +var _0xd2d8=['inspect','notify','catch','bluebird','preview','lodash','../rpc/faxAccount','error'];(function(_0x78a0fb,_0x19c03e){var _0x21a0e9=function(_0xf05328){while(--_0xf05328){_0x78a0fb['push'](_0x78a0fb['shift']());}};_0x21a0e9(++_0x19c03e);}(_0xd2d8,0x15b));var _0x8d2d=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0xd2d8[_0x2b8722];return _0x20c180;};'use strict';var util=require('util');var BPromise=require(_0x8d2d('0x0'));var logger=require('../../../config/logger')(_0x8d2d('0x1'));var _=require(_0x8d2d('0x2'));var faxAccount=require(_0x8d2d('0x3'));function loggerCatch(_0xd5810b){return function(_0x2e6c06){logger[_0x8d2d('0x4')](_0xd5810b,util[_0x8d2d('0x5')](_0x2e6c06,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4a0913,_0x218419){return BPromise['resolve']()['then'](faxAccount[_0x8d2d('0x6')](_0x4a0913,_0x218419))[_0x8d2d('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 49c2b51..2f3860e 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 _0x0270=['child_process','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger'];(function(_0x4d77bc,_0x5eb675){var _0xb2b6d5=function(_0x5b1dfe){while(--_0x5b1dfe){_0x4d77bc['push'](_0x4d77bc['shift']());}};_0xb2b6d5(++_0x5eb675);}(_0x0270,0x1b0));var _0x0027=function(_0x3e3e5b,_0x2a1f71){_0x3e3e5b=_0x3e3e5b-0x0;var _0x361cc6=_0x0270[_0x3e3e5b];return _0x361cc6;};'use strict';var util=require(_0x0027('0x0'));var logger=require(_0x0027('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x0027('0x2'))['exec'];exports[_0x0027('0x3')]=function(_0x2cd99c){return new BPromise(function(_0x3607dc,_0x1b69b1){exec(_0x2cd99c,function(_0x23be9f,_0x384e96,_0x2e7ce6){logger[_0x0027('0x4')](_0x0027('0x5'),_0x384e96);if(_0x23be9f){logger['info'](_0x0027('0x5'),_0x0027('0x6'),util['inspect'](_0x23be9f,{'showHidden':![],'depth':null}),_0x384e96,_0x2e7ce6);_0x1b69b1(_0x23be9f);}_0x3607dc(_0x384e96);});});}; \ No newline at end of file +var _0xad42=['util','../../../../config/logger','fax','bluebird','child_process','exec','info','Exec\x20gs','inspect'];(function(_0x66ca5a,_0x59cc51){var _0x25b1dc=function(_0x3ec6e0){while(--_0x3ec6e0){_0x66ca5a['push'](_0x66ca5a['shift']());}};_0x25b1dc(++_0x59cc51);}(_0xad42,0x15f));var _0x2ad4=function(_0x3b3c67,_0x532c66){_0x3b3c67=_0x3b3c67-0x0;var _0x25b17a=_0xad42[_0x3b3c67];return _0x25b17a;};'use strict';var util=require(_0x2ad4('0x0'));var logger=require(_0x2ad4('0x1'))(_0x2ad4('0x2'));var BPromise=require(_0x2ad4('0x3'));var exec=require(_0x2ad4('0x4'))[_0x2ad4('0x5')];exports['execute']=function(_0x7ae74b){return new BPromise(function(_0x45678c,_0x4ac20c){exec(_0x7ae74b,function(_0x24f219,_0x1e86ca,_0x132dc1){logger[_0x2ad4('0x6')](_0x2ad4('0x7'),_0x1e86ca);if(_0x24f219){logger[_0x2ad4('0x6')]('Exec\x20gs','\x20Error\x20:',util[_0x2ad4('0x8')](_0x24f219,{'showHidden':![],'depth':null}),_0x1e86ca,_0x132dc1);_0x4ac20c(_0x24f219);}_0x45678c(_0x1e86ca);});});}; \ 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 86e5163..d5e316e 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 _0xf0d3=['\x22%s\x22','gateway','t38timeout','localstationid','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format'];(function(_0x33d9c5,_0x2c159d){var _0x28f547=function(_0x61fc92){while(--_0x61fc92){_0x33d9c5['push'](_0x33d9c5['shift']());}};_0x28f547(++_0x2c159d);}(_0xf0d3,0xba));var _0x3f0d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0d3[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x3f0d('0x0'));var _=require(_0x3f0d('0x1'));var moment=require('moment');var logger=require(_0x3f0d('0x2'))('fax');exports[_0x3f0d('0x3')]=function(_0x501f13){return{'message':_0x501f13};};exports[_0x3f0d('0x4')]=function(_0x5a987b,_0x3e62bd){logger[_0x3f0d('0x5')](_0x5a987b,util[_0x3f0d('0x6')](_0x3e62bd,{'showHidden':![],'depth':null}));};exports[_0x3f0d('0x7')]=function(_0xc1decb,_0x481868){var _0x4ed5e3={'XMF-ECM':_0x481868['ecm'],'XMF-HEADERINFO':_0x481868[_0x3f0d('0x8')],'XMF-MINRATE':_0x481868[_0x3f0d('0x9')],'XMF-MAXRATE':_0x481868[_0x3f0d('0xa')],'XMF-MODEM':util[_0x3f0d('0xb')](_0x3f0d('0xc'),_0x481868['modem']),'XMF-GATEWAY':_0x481868[_0x3f0d('0xd')],'XMF-FAXDETECT':_0x481868['faxdetect'],'XMF-T38TIMEOUT':_0x481868[_0x3f0d('0xe')],'XMF-LOCALSTATIONID':_0x481868[_0x3f0d('0xf')],'XMF-PATH':_0xc1decb['path']};return _0x4ed5e3;};exports[_0x3f0d('0x10')]=function(_0x1ec980,_0x2dc515){return{'actionid':_0x1ec980[_0x3f0d('0x11')],'action':'originate','channel':_0x1ec980[_0x3f0d('0x12')],'Exten':_0x3f0d('0x13'),'Context':_0x3f0d('0x14'),'Priority':'1','callerid':util[_0x3f0d('0xb')](_0x3f0d('0x15'),_0x1ec980[_0x3f0d('0x8')]?_0x1ec980[_0x3f0d('0x8')]:'',_0x1ec980['localstationid']),'variable':_0x2dc515,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1ec980['uniqueid']};}; \ No newline at end of file +var _0xf9b8=['message','logger','info','inspect','addVariables','ecm','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','xcally-motion-fax','from-sip','format','headerinfo','uniqueid','util','lodash','moment','../../../../config/logger','fax'];(function(_0x3b1d55,_0x5f1de5){var _0x1d555e=function(_0x15b180){while(--_0x15b180){_0x3b1d55['push'](_0x3b1d55['shift']());}};_0x1d555e(++_0x5f1de5);}(_0xf9b8,0x154));var _0x8f9b=function(_0x494b65,_0x1dc9a3){_0x494b65=_0x494b65-0x0;var _0x1ea66c=_0xf9b8[_0x494b65];return _0x1ea66c;};'use strict';var util=require(_0x8f9b('0x0'));var _=require(_0x8f9b('0x1'));var moment=require(_0x8f9b('0x2'));var logger=require(_0x8f9b('0x3'))(_0x8f9b('0x4'));exports[_0x8f9b('0x5')]=function(_0x2e1add){return{'message':_0x2e1add};};exports[_0x8f9b('0x6')]=function(_0x1b33e1,_0x1598f8){logger[_0x8f9b('0x7')](_0x1b33e1,util[_0x8f9b('0x8')](_0x1598f8,{'showHidden':![],'depth':null}));};exports[_0x8f9b('0x9')]=function(_0x8a477a,_0x3c0157){var _0x1f00e0={'XMF-ECM':_0x3c0157[_0x8f9b('0xa')],'XMF-HEADERINFO':_0x3c0157['headerinfo'],'XMF-MINRATE':_0x3c0157['minrate'],'XMF-MAXRATE':_0x3c0157['maxrate'],'XMF-MODEM':util['format'](_0x8f9b('0xb'),_0x3c0157[_0x8f9b('0xc')]),'XMF-GATEWAY':_0x3c0157[_0x8f9b('0xd')],'XMF-FAXDETECT':_0x3c0157[_0x8f9b('0xe')],'XMF-T38TIMEOUT':_0x3c0157[_0x8f9b('0xf')],'XMF-LOCALSTATIONID':_0x3c0157[_0x8f9b('0x10')],'XMF-PATH':_0x8a477a[_0x8f9b('0x11')]};return _0x1f00e0;};exports['variablesAction']=function(_0x13b84c,_0x1675d6){return{'actionid':_0x13b84c['uniqueid'],'action':'originate','channel':_0x13b84c['channel'],'Exten':_0x8f9b('0x12'),'Context':_0x8f9b('0x13'),'Priority':'1','callerid':util[_0x8f9b('0x14')]('\x22%s\x22\x20<%s>',_0x13b84c['headerinfo']?_0x13b84c[_0x8f9b('0x15')]:'',_0x13b84c[_0x8f9b('0x10')]),'variable':_0x1675d6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x13b84c[_0x8f9b('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index a0be816..84c0693 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 _0xfeaa=['./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','initAgents','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','bluebird','util','./server','./realtime','./report','./acw'];(function(_0x55c3de,_0x523413){var _0xa599b8=function(_0x24a9b4){while(--_0x24a9b4){_0x55c3de['push'](_0x55c3de['shift']());}};_0xa599b8(++_0x523413);}(_0xfeaa,0x176));var _0xafea=function(_0x3d1699,_0x3c83be){_0x3d1699=_0x3d1699-0x0;var _0xe1ebc4=_0xfeaa[_0x3d1699];return _0xe1ebc4;};'use strict';var BPromise=require(_0xafea('0x0'));var util=require(_0xafea('0x1'));var moment=require('moment');var server=require(_0xafea('0x2'));var Realtime=require(_0xafea('0x3'));var Report=require(_0xafea('0x4'));var Acw=require(_0xafea('0x5'));var Trigger=require(_0xafea('0x6'));var Dialer=require(_0xafea('0x7'));var Preview=require(_0xafea('0x8'));var Fax=require(_0xafea('0x9'));var user=require(_0xafea('0xa'));var voiceQueue=require(_0xafea('0xb'));var voiceQueueReport=require(_0xafea('0xc'));var voiceCallReport=require(_0xafea('0xd'));var trunk=require(_0xafea('0xe'));var trigger=require('./rpc/trigger');var template=require(_0xafea('0xf'));var cmHopperHistory=require(_0xafea('0x10'));var campaign=require(_0xafea('0x11'));var voiceExtension=require(_0xafea('0x12'));var faxAccount=require(_0xafea('0x13'));var zendesk=require(_0xafea('0x14'));var salesforce=require(_0xafea('0x15'));var sugarcrm=require(_0xafea('0x16'));var freshdesk=require(_0xafea('0x17'));var desk=require(_0xafea('0x18'));var zoho=require(_0xafea('0x19'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xafea('0x1a'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xafea('0x1b'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xafea('0x1c'))(_0xafea('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xafea('0x1e')](_0xafea('0x1f'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xafea('0x1e')](_0xafea('0x1f'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xafea('0x20')]()['then'](user[_0xafea('0x21')]())[_0xafea('0x22')](realtime[_0xafea('0x23')]())[_0xafea('0x22')](user['getTelephones']())[_0xafea('0x22')](realtime[_0xafea('0x24')]())[_0xafea('0x22')](trunk[_0xafea('0x25')]())[_0xafea('0x22')](realtime[_0xafea('0x26')]())[_0xafea('0x22')](voiceQueue['getVoiceQueues']())[_0xafea('0x22')](realtime[_0xafea('0x27')]())[_0xafea('0x22')](trigger[_0xafea('0x28')]())[_0xafea('0x22')](realtime['initTriggers']())[_0xafea('0x22')](template['getTemplates']())['then'](realtime[_0xafea('0x29')]())['then'](zendesk[_0xafea('0x2a')]())[_0xafea('0x22')](realtime[_0xafea('0x2b')]())['then'](salesforce[_0xafea('0x2c')]())[_0xafea('0x22')](realtime['initSalesforceAccounts']())[_0xafea('0x22')](sugarcrm['getSugarcrmAccounts']())[_0xafea('0x22')](realtime[_0xafea('0x2d')]())['then'](freshdesk[_0xafea('0x2e')]())[_0xafea('0x22')](realtime[_0xafea('0x2f')]())['then'](desk[_0xafea('0x30')]())[_0xafea('0x22')](realtime[_0xafea('0x31')]())[_0xafea('0x22')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0xafea('0x32')]())[_0xafea('0x22')](realtime['initVtigerAccounts']())[_0xafea('0x22')](freshsales[_0xafea('0x33')]())['then'](realtime[_0xafea('0x34')]())[_0xafea('0x22')](servicenow[_0xafea('0x35')]())['then'](realtime[_0xafea('0x36')]())[_0xafea('0x22')](dynamics365[_0xafea('0x37')]())[_0xafea('0x22')](realtime[_0xafea('0x38')]())[_0xafea('0x22')](campaign[_0xafea('0x39')]())['then'](realtime['initCampaigns']())['then'](voiceExtension[_0xafea('0x3a')]())[_0xafea('0x22')](realtime[_0xafea('0x3b')]())[_0xafea('0x22')](faxAccount[_0xafea('0x3c')]())['then'](realtime[_0xafea('0x3d')]())[_0xafea('0x22')](function(){return realtime;});}function initParams(){return BPromise[_0xafea('0x20')]()[_0xafea('0x22')](voiceQueueReport[_0xafea('0x3e')]())['then'](realtime[_0xafea('0x3f')]())[_0xafea('0x22')](cmHopperHistory[_0xafea('0x40')]())[_0xafea('0x22')](realtime[_0xafea('0x41')]())[_0xafea('0x22')](cmHopperHistory[_0xafea('0x42')]())[_0xafea('0x22')](realtime[_0xafea('0x43')]())[_0xafea('0x22')](voiceCallReport[_0xafea('0x44')]())[_0xafea('0x22')](realtime[_0xafea('0x45')]())[_0xafea('0x46')](function(_0x4540bb){logger[_0xafea('0x47')](_0xafea('0x48'),util[_0xafea('0x49')](_0x4540bb,{'showHidden':![],'depth':null}));});}function main(){return server[_0xafea('0x4a')](realtime,preview,fax)[_0xafea('0x22')](function(_0x488d63){return initRealtime();})['then'](function(){return initParams();})[_0xafea('0x22')](function(){report[_0xafea('0x4b')]();setInterval(initRealtime,0x1388);})[_0xafea('0x46')](function(_0x2740f6){logger[_0xafea('0x47')]('[index.js][main]',util['inspect'](_0x2740f6,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x1d44=['initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports'];(function(_0x49b461,_0x5a3eb7){var _0x281fb9=function(_0x3f00c1){while(--_0x3f00c1){_0x49b461['push'](_0x49b461['shift']());}};_0x281fb9(++_0x5a3eb7);}(_0x1d44,0x1e1));var _0x41d4=function(_0x25f334,_0x44aab9){_0x25f334=_0x25f334-0x0;var _0x11fb6e=_0x1d44[_0x25f334];return _0x11fb6e;};'use strict';var BPromise=require(_0x41d4('0x0'));var util=require(_0x41d4('0x1'));var moment=require(_0x41d4('0x2'));var server=require(_0x41d4('0x3'));var Realtime=require(_0x41d4('0x4'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x41d4('0x5'));var Dialer=require(_0x41d4('0x6'));var Preview=require('./preview');var Fax=require(_0x41d4('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x41d4('0x8'));var voiceQueueReport=require(_0x41d4('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x41d4('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x41d4('0xb'));var cmHopperHistory=require(_0x41d4('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x41d4('0xd'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x41d4('0xe'));var desk=require(_0x41d4('0xf'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x41d4('0x10'));var freshsales=require(_0x41d4('0x11'));var servicenow=require(_0x41d4('0x12'));var dynamics365=require(_0x41d4('0x13'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x41d4('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x41d4('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x41d4('0x15')](_0x41d4('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x41d4('0x17')]()[_0x41d4('0x18')](user[_0x41d4('0x19')]())[_0x41d4('0x18')](realtime[_0x41d4('0x1a')]())[_0x41d4('0x18')](user[_0x41d4('0x1b')]())[_0x41d4('0x18')](realtime[_0x41d4('0x1c')]())[_0x41d4('0x18')](trunk['getTrunks']())[_0x41d4('0x18')](realtime[_0x41d4('0x1d')]())[_0x41d4('0x18')](voiceQueue[_0x41d4('0x1e')]())[_0x41d4('0x18')](realtime['initVoiceQueues']())['then'](trigger['getTriggers']())['then'](realtime[_0x41d4('0x1f')]())['then'](template[_0x41d4('0x20')]())[_0x41d4('0x18')](realtime[_0x41d4('0x21')]())[_0x41d4('0x18')](zendesk[_0x41d4('0x22')]())[_0x41d4('0x18')](realtime[_0x41d4('0x23')]())['then'](salesforce[_0x41d4('0x24')]())[_0x41d4('0x18')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x41d4('0x25')]())[_0x41d4('0x18')](realtime[_0x41d4('0x26')]())[_0x41d4('0x18')](freshdesk[_0x41d4('0x27')]())['then'](realtime[_0x41d4('0x28')]())[_0x41d4('0x18')](desk[_0x41d4('0x29')]())['then'](realtime['initDeskAccounts']())[_0x41d4('0x18')](zoho[_0x41d4('0x2a')]())[_0x41d4('0x18')](realtime[_0x41d4('0x2b')]())[_0x41d4('0x18')](vtiger[_0x41d4('0x2c')]())['then'](realtime[_0x41d4('0x2d')]())['then'](freshsales['getFreshsalesAccounts']())[_0x41d4('0x18')](realtime[_0x41d4('0x2e')]())[_0x41d4('0x18')](servicenow['getServicenowAccounts']())[_0x41d4('0x18')](realtime[_0x41d4('0x2f')]())[_0x41d4('0x18')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x41d4('0x30')]())[_0x41d4('0x18')](campaign[_0x41d4('0x31')]())['then'](realtime['initCampaigns']())[_0x41d4('0x18')](voiceExtension[_0x41d4('0x32')]())['then'](realtime[_0x41d4('0x33')]())['then'](faxAccount[_0x41d4('0x34')]())[_0x41d4('0x18')](realtime[_0x41d4('0x35')]())[_0x41d4('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x41d4('0x17')]()[_0x41d4('0x18')](voiceQueueReport[_0x41d4('0x36')]())[_0x41d4('0x18')](realtime[_0x41d4('0x37')]())[_0x41d4('0x18')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x41d4('0x18')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x41d4('0x38')]())[_0x41d4('0x18')](realtime[_0x41d4('0x39')]())[_0x41d4('0x18')](voiceCallReport[_0x41d4('0x3a')]())[_0x41d4('0x18')](realtime[_0x41d4('0x3b')]())[_0x41d4('0x3c')](function(_0x1a57b8){logger[_0x41d4('0x3d')](_0x41d4('0x3e'),util[_0x41d4('0x3f')](_0x1a57b8,{'showHidden':![],'depth':null}));});}function main(){return server[_0x41d4('0x40')](realtime,preview,fax)[_0x41d4('0x18')](function(_0x503e38){return initRealtime();})['then'](function(){return initParams();})[_0x41d4('0x18')](function(){report[_0x41d4('0x41')]();setInterval(initRealtime,0x1388);})[_0x41d4('0x3c')](function(_0x204ee8){logger[_0x41d4('0x3d')](_0x41d4('0x42'),util['inspect'](_0x204ee8,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 8b127d0..682b1a6 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xedd9,0xfc));var _0x9edd=function(_0x531535,_0x39872c){_0x531535=_0x531535-0x0;var _0x3f1563=_0xedd9[_0x531535];return _0x3f1563;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x4de29d,_0x33edac){var _0xc86be2=function(_0x55b701){while(--_0x55b701){_0x4de29d['push'](_0x4de29d['shift']());}};_0xc86be2(++_0x33edac);}(_0x70e0,0x17b));var _0x070e=function(_0x273474,_0x733621){_0x273474=_0x273474-0x0;var _0x1b1f07=_0x70e0[_0x273474];return _0x1b1f07;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 10830a4..9d899d2 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 _0xfc87=['originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign'];(function(_0x365176,_0x22f3c4){var _0x36fa20=function(_0x3f79b2){while(--_0x3f79b2){_0x365176['push'](_0x365176['shift']());}};_0x36fa20(++_0x22f3c4);}(_0xfc87,0x65));var _0x7fc8=function(_0x5648f5,_0x5209a4){_0x5648f5=_0x5648f5-0x0;var _0x5ed529=_0xfc87[_0x5648f5];return _0x5ed529;};'use strict';function Campaign(_0x567c80){this['id']=_0x567c80['id']||0x0;this[_0x7fc8('0x0')]=_0x567c80[_0x7fc8('0x0')]||'';this[_0x7fc8('0x1')]=_0x567c80[_0x7fc8('0x1')]||_0x7fc8('0x2');this[_0x7fc8('0x3')]=0x0;this[_0x7fc8('0x4')]=0x0;this[_0x7fc8('0x5')]=0x0;this[_0x7fc8('0x6')]=0x0;this[_0x7fc8('0x7')]='';this[_0x7fc8('0x8')]=!![];this['active']=_0x567c80[_0x7fc8('0x9')];this[_0x7fc8('0xa')]=_0x567c80['limitCalls'];this[_0x7fc8('0xb')]=_0x567c80[_0x7fc8('0xb')]||null;this[_0x7fc8('0xc')]=_0x567c80[_0x7fc8('0xc')]?_0x567c80[_0x7fc8('0xc')]:null;this[_0x7fc8('0xd')]=_0x567c80[_0x7fc8('0xd')];this['dialOriginateCallerIdNumber']=_0x567c80[_0x7fc8('0xe')];this[_0x7fc8('0xf')]=_0x567c80[_0x7fc8('0xf')]||0x1e;this[_0x7fc8('0x10')]=_0x567c80[_0x7fc8('0x10')];this[_0x7fc8('0x11')]=_0x567c80[_0x7fc8('0x11')];this[_0x7fc8('0x12')]=_0x567c80[_0x7fc8('0x12')];this[_0x7fc8('0x13')]=_0x567c80['dialBusyRetryFrequency'];this[_0x7fc8('0x14')]=_0x567c80[_0x7fc8('0x14')];this[_0x7fc8('0x15')]=_0x567c80[_0x7fc8('0x15')];this[_0x7fc8('0x16')]=_0x567c80[_0x7fc8('0x16')];this[_0x7fc8('0x17')]=_0x567c80['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x567c80[_0x7fc8('0x18')]||0x96;this['dialDropMaxRetry']=_0x567c80[_0x7fc8('0x19')]||0x3;this['dialDropRetryFrequency']=_0x567c80[_0x7fc8('0x1a')]||0x96;this[_0x7fc8('0x1b')]=_0x567c80[_0x7fc8('0x1b')]||0x3;this[_0x7fc8('0x1c')]=_0x567c80[_0x7fc8('0x1c')]||0x96;this[_0x7fc8('0x1d')]=_0x567c80['dialMachineMaxRetry']||0x3;this[_0x7fc8('0x1e')]=_0x567c80['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x567c80[_0x7fc8('0x1f')]||0x3;this[_0x7fc8('0x20')]=_0x567c80['dialAgentRejectRetryFrequency']||0x96;this[_0x7fc8('0x21')]=_0x567c80[_0x7fc8('0x21')]||_0x7fc8('0x22');this[_0x7fc8('0x23')]=_0x567c80[_0x7fc8('0x23')]||undefined;this[_0x7fc8('0x24')]=_0x567c80['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7fc8('0x25')]=_0x567c80[_0x7fc8('0x25')]||undefined;this['TrunkBackup']=_0x567c80[_0x7fc8('0x26')]?_0x567c80['TrunkBackup']:undefined;this[_0x7fc8('0x27')]=_0x567c80[_0x7fc8('0x27')]?_0x567c80[_0x7fc8('0x27')]:undefined;this['Interval']=_0x567c80[_0x7fc8('0x28')]?_0x567c80[_0x7fc8('0x28')]:undefined;this[_0x7fc8('0x29')]=_0x567c80[_0x7fc8('0x29')]?_0x567c80['SquareProject']:undefined;this[_0x7fc8('0x2a')]=_0x567c80['SquareProject']?_0x567c80[_0x7fc8('0x29')][_0x7fc8('0x0')]:undefined;this[_0x7fc8('0x2b')]=_0x567c80[_0x7fc8('0x2b')]||![];this[_0x7fc8('0x2c')]=_0x567c80[_0x7fc8('0x2c')];this['dialAMDGreeting']=_0x567c80['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x567c80[_0x7fc8('0x2d')];this[_0x7fc8('0x2e')]=_0x567c80[_0x7fc8('0x2e')];this[_0x7fc8('0x2f')]=_0x567c80['dialAMDMinWordLength'];this[_0x7fc8('0x30')]=_0x567c80['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x567c80['dialAMDMaximumNumberOfWords'];this[_0x7fc8('0x31')]=_0x567c80[_0x7fc8('0x31')];this[_0x7fc8('0x32')]=_0x567c80[_0x7fc8('0x32')];}module[_0x7fc8('0x33')]=Campaign; \ No newline at end of file +var _0x0734=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x0734,0x168));var _0x4073=function(_0x494ca7,_0x272cd5){_0x494ca7=_0x494ca7-0x0;var _0x434f43=_0x0734[_0x494ca7];return _0x434f43;};'use strict';function Campaign(_0x1ec88d){this['id']=_0x1ec88d['id']||0x0;this['name']=_0x1ec88d[_0x4073('0x0')]||'';this[_0x4073('0x1')]=_0x1ec88d[_0x4073('0x1')]||_0x4073('0x2');this[_0x4073('0x3')]=0x0;this[_0x4073('0x4')]=0x0;this[_0x4073('0x5')]=0x0;this[_0x4073('0x6')]=0x0;this['message']='';this[_0x4073('0x7')]=!![];this[_0x4073('0x8')]=_0x1ec88d[_0x4073('0x8')];this[_0x4073('0x9')]=_0x1ec88d['limitCalls'];this[_0x4073('0xa')]=_0x1ec88d[_0x4073('0xa')]||null;this[_0x4073('0xb')]=_0x1ec88d[_0x4073('0xb')]?_0x1ec88d[_0x4073('0xb')]:null;this[_0x4073('0xc')]=_0x1ec88d[_0x4073('0xc')];this[_0x4073('0xd')]=_0x1ec88d[_0x4073('0xd')];this['dialOriginateTimeout']=_0x1ec88d['dialOriginateTimeout']||0x1e;this[_0x4073('0xe')]=_0x1ec88d[_0x4073('0xe')];this[_0x4073('0xf')]=_0x1ec88d[_0x4073('0xf')];this[_0x4073('0x10')]=_0x1ec88d[_0x4073('0x10')];this['dialBusyRetryFrequency']=_0x1ec88d[_0x4073('0x11')];this[_0x4073('0x12')]=_0x1ec88d['dialNoAnswerMaxRetry'];this[_0x4073('0x13')]=_0x1ec88d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1ec88d[_0x4073('0x14')];this[_0x4073('0x15')]=_0x1ec88d['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1ec88d['dialNoSuchNumberRetryFrequency']||0x96;this[_0x4073('0x16')]=_0x1ec88d[_0x4073('0x16')]||0x3;this['dialDropRetryFrequency']=_0x1ec88d[_0x4073('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x1ec88d[_0x4073('0x18')]||0x3;this[_0x4073('0x19')]=_0x1ec88d[_0x4073('0x19')]||0x96;this[_0x4073('0x1a')]=_0x1ec88d[_0x4073('0x1a')]||0x3;this[_0x4073('0x1b')]=_0x1ec88d[_0x4073('0x1b')]||0x96;this[_0x4073('0x1c')]=_0x1ec88d[_0x4073('0x1c')]||0x3;this[_0x4073('0x1d')]=_0x1ec88d[_0x4073('0x1d')]||0x96;this[_0x4073('0x1e')]=_0x1ec88d[_0x4073('0x1e')]||'DESC';this['dialPrefix']=_0x1ec88d[_0x4073('0x1f')]||undefined;this[_0x4073('0x20')]=_0x1ec88d[_0x4073('0x20')]||undefined;this[_0x4073('0x21')]=_0x1ec88d[_0x4073('0x21')]||undefined;this[_0x4073('0x22')]=_0x1ec88d[_0x4073('0x22')]?_0x1ec88d[_0x4073('0x22')]:undefined;this['Trunk']=_0x1ec88d[_0x4073('0x23')]?_0x1ec88d[_0x4073('0x23')]:undefined;this[_0x4073('0x24')]=_0x1ec88d[_0x4073('0x24')]?_0x1ec88d[_0x4073('0x24')]:undefined;this[_0x4073('0x25')]=_0x1ec88d[_0x4073('0x25')]?_0x1ec88d[_0x4073('0x25')]:undefined;this[_0x4073('0x26')]=_0x1ec88d[_0x4073('0x25')]?_0x1ec88d[_0x4073('0x25')][_0x4073('0x0')]:undefined;this[_0x4073('0x27')]=_0x1ec88d['dialAMDActive']||![];this[_0x4073('0x28')]=_0x1ec88d[_0x4073('0x28')];this['dialAMDGreeting']=_0x1ec88d['dialAMDGreeting'];this[_0x4073('0x29')]=_0x1ec88d[_0x4073('0x29')];this['dialAMDTotalAnalysisTime']=_0x1ec88d[_0x4073('0x2a')];this['dialAMDMinWordLength']=_0x1ec88d[_0x4073('0x2b')];this[_0x4073('0x2c')]=_0x1ec88d[_0x4073('0x2c')];this[_0x4073('0x2d')]=_0x1ec88d[_0x4073('0x2d')];this[_0x4073('0x2e')]=_0x1ec88d['dialAMDSilenceThreshold'];this[_0x4073('0x2f')]=_0x1ec88d[_0x4073('0x2f')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 0e17b8a..5ef0dbe 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 _0x0fc9=['starttime','channel','destinationchannel','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x0fc9,0x15f));var _0x90fc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0fc9[_0x2d7f0e];return _0x110b07;};'use strict';function Channel(){this[_0x90fc('0x0')]=null;this[_0x90fc('0x1')]='';this[_0x90fc('0x2')]='';this['calleridnum']=0x0;this[_0x90fc('0x3')]='';this[_0x90fc('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x90fc('0x5')]=0x0;this[_0x90fc('0x6')]='';this[_0x90fc('0x7')]=0x0;this[_0x90fc('0x8')]=0x0;this[_0x90fc('0x9')]=0x0;this[_0x90fc('0xa')]=![];this['answertime']=null;this[_0x90fc('0xb')]=null;this[_0x90fc('0xc')]=![];this[_0x90fc('0xd')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0x90fc('0xe')]=0x0;this[_0x90fc('0xf')]=0x0;this[_0x90fc('0x10')]=null;this[_0x90fc('0x11')]=null;this[_0x90fc('0x12')]=null;this[_0x90fc('0x13')]=![];this[_0x90fc('0x14')]=null;this[_0x90fc('0x15')]=null;this[_0x90fc('0x16')]=[];this[_0x90fc('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x90fc('0x18')]=undefined;this[_0x90fc('0x19')]=0x0;}module[_0x90fc('0x1a')]=Channel; \ No newline at end of file +var _0x89f5=['uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','holdtime','type','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','context'];(function(_0x34bec6,_0x54119e){var _0x386151=function(_0x44f162){while(--_0x44f162){_0x34bec6['push'](_0x34bec6['shift']());}};_0x386151(++_0x54119e);}(_0x89f5,0x118));var _0x589f=function(_0x3b1b69,_0x41f114){_0x3b1b69=_0x3b1b69-0x0;var _0xa28b77=_0x89f5[_0x3b1b69];return _0xa28b77;};'use strict';function Channel(){this[_0x589f('0x0')]=null;this[_0x589f('0x1')]='';this[_0x589f('0x2')]='';this[_0x589f('0x3')]=0x0;this['calleridname']='';this[_0x589f('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x589f('0x5')]='';this[_0x589f('0x6')]=0x0;this[_0x589f('0x7')]=0x0;this[_0x589f('0x8')]=0x0;this[_0x589f('0x9')]=![];this[_0x589f('0xa')]=null;this[_0x589f('0xb')]=null;this[_0x589f('0xc')]=![];this[_0x589f('0xd')]=![];this[_0x589f('0xe')]='';this[_0x589f('0xf')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x589f('0x10')]=0x0;this[_0x589f('0x11')]=null;this['tag']=null;this[_0x589f('0x12')]=null;this[_0x589f('0x13')]=![];this['monitorFilename']=null;this[_0x589f('0x14')]=null;this[_0x589f('0x15')]=[];this[_0x589f('0x16')]=undefined;this[_0x589f('0x17')]=undefined;this[_0x589f('0x18')]=undefined;this['mohtime']=0x0;}module[_0x589f('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 ef87847..6d032a6 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 _0x6ff2=['exports','name','username','remoteUri','authType','password','token','tokenSecret','type','serverUrl'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x6ff2,0x15f));var _0x26ff=function(_0x472679,_0x66b705){_0x472679=_0x472679-0x0;var _0x579dc1=_0x6ff2[_0x472679];return _0x579dc1;};'use strict';function DeskAccount(_0x2a4397){this['id']=_0x2a4397['id']||0x0;this[_0x26ff('0x0')]=_0x2a4397[_0x26ff('0x0')]||'';this[_0x26ff('0x1')]=_0x2a4397[_0x26ff('0x1')]||'';this['remoteUri']=_0x2a4397[_0x26ff('0x2')]||'';this[_0x26ff('0x3')]=_0x2a4397[_0x26ff('0x3')]||'';this[_0x26ff('0x4')]=_0x2a4397[_0x26ff('0x4')]||'';this['consumerKey']=_0x2a4397['consumerKey']||'';this['consumerSecret']=_0x2a4397['consumerSecret']||'';this[_0x26ff('0x5')]=_0x2a4397['token']||'';this[_0x26ff('0x6')]=_0x2a4397[_0x26ff('0x6')]||'';this[_0x26ff('0x7')]=_0x2a4397[_0x26ff('0x7')]||'';this[_0x26ff('0x8')]=_0x2a4397[_0x26ff('0x8')]||'';this['Configurations']=_0x2a4397['Configurations']||{};}module[_0x26ff('0x9')]=DeskAccount; \ No newline at end of file +var _0x8643=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x570a43,_0x300f2a){var _0x36b6b9=function(_0x40e8c5){while(--_0x40e8c5){_0x570a43['push'](_0x570a43['shift']());}};_0x36b6b9(++_0x300f2a);}(_0x8643,0x8c));var _0x3864=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8643[_0x3947c9];return _0x2e7871;};'use strict';function DeskAccount(_0x5d77fb){this['id']=_0x5d77fb['id']||0x0;this['name']=_0x5d77fb[_0x3864('0x0')]||'';this[_0x3864('0x1')]=_0x5d77fb['username']||'';this[_0x3864('0x2')]=_0x5d77fb[_0x3864('0x2')]||'';this[_0x3864('0x3')]=_0x5d77fb[_0x3864('0x3')]||'';this['password']=_0x5d77fb[_0x3864('0x4')]||'';this[_0x3864('0x5')]=_0x5d77fb[_0x3864('0x5')]||'';this[_0x3864('0x6')]=_0x5d77fb[_0x3864('0x6')]||'';this[_0x3864('0x7')]=_0x5d77fb[_0x3864('0x7')]||'';this[_0x3864('0x8')]=_0x5d77fb['tokenSecret']||'';this[_0x3864('0x9')]=_0x5d77fb[_0x3864('0x9')]||'';this[_0x3864('0xa')]=_0x5d77fb[_0x3864('0xa')]||'';this['Configurations']=_0x5d77fb[_0x3864('0xb')]||{};}module[_0x3864('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 4678bd1..02e2471 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 _0x9348=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x9348,0x10d));var _0x8934=function(_0x5f0eae,_0x4f8cdd){_0x5f0eae=_0x5f0eae-0x0;var _0x186a93=_0x9348[_0x5f0eae];return _0x186a93;};'use strict';function Dynamics365Account(_0x41a189){this['id']=_0x41a189['id']||0x0;this[_0x8934('0x0')]=_0x41a189[_0x8934('0x0')]||'';this[_0x8934('0x1')]=_0x41a189[_0x8934('0x1')]||'';this['password']=_0x41a189[_0x8934('0x2')]||'';this[_0x8934('0x3')]=_0x41a189['remoteUri']||'';this[_0x8934('0x4')]=_0x41a189[_0x8934('0x4')]||'';this[_0x8934('0x5')]=_0x41a189[_0x8934('0x5')]||'';this[_0x8934('0x6')]=_0x41a189[_0x8934('0x6')]||{};this['serverUrl']=_0x41a189[_0x8934('0x7')]||'';this[_0x8934('0x8')]=_0x41a189[_0x8934('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x878f=['serverUrl','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x472f70,_0x3ca102){var _0x5eabd9=function(_0x26c97a){while(--_0x26c97a){_0x472f70['push'](_0x472f70['shift']());}};_0x5eabd9(++_0x3ca102);}(_0x878f,0x173));var _0xf878=function(_0x366df8,_0x1902c5){_0x366df8=_0x366df8-0x0;var _0x29cd95=_0x878f[_0x366df8];return _0x29cd95;};'use strict';function Dynamics365Account(_0x51758f){this['id']=_0x51758f['id']||0x0;this[_0xf878('0x0')]=_0x51758f[_0xf878('0x0')]||'';this[_0xf878('0x1')]=_0x51758f[_0xf878('0x1')]||'';this[_0xf878('0x2')]=_0x51758f[_0xf878('0x2')]||'';this[_0xf878('0x3')]=_0x51758f[_0xf878('0x3')]||'';this[_0xf878('0x4')]=_0x51758f[_0xf878('0x4')]||'';this[_0xf878('0x5')]=_0x51758f['clientId']||'';this['clientSecret']=_0x51758f[_0xf878('0x6')]||{};this[_0xf878('0x7')]=_0x51758f['serverUrl']||'';this['Configurations']=_0x51758f['Configurations']||{};}module[_0xf878('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 88928ee..ddd075e 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 _0x3efc=['key','description','ecm','headerinfo','localstationid','minrate','gateway','faxdetect','t38timeout','tech','Trunk'];(function(_0x1bf6a6,_0xded85b){var _0x1a3442=function(_0x436a09){while(--_0x436a09){_0x1bf6a6['push'](_0x1bf6a6['shift']());}};_0x1a3442(++_0xded85b);}(_0x3efc,0x156));var _0xc3ef=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3efc[_0xfae23b];return _0x200640;};'use strict';function FaxAccount(_0x321ace){this['id']=_0x321ace['id']||0x0;this['name']=_0x321ace['name']||'';this[_0xc3ef('0x0')]=_0x321ace[_0xc3ef('0x0')];this[_0xc3ef('0x1')]=_0x321ace[_0xc3ef('0x1')];this[_0xc3ef('0x2')]=_0x321ace[_0xc3ef('0x2')];this[_0xc3ef('0x3')]=_0x321ace['localstationid'];this['minrate']=_0x321ace[_0xc3ef('0x4')]||0x960;this['maxrate']=_0x321ace['maxrate']||0x3840;this['modem']=_0x321ace['modem']||'v17,v27,v29';this[_0xc3ef('0x5')]=_0x321ace['gateway']||'no';this['faxdetect']=_0x321ace[_0xc3ef('0x6')]||'no';this[_0xc3ef('0x7')]=_0x321ace['t38timeout']||0x1388;this[_0xc3ef('0x8')]=_0x321ace[_0xc3ef('0x8')]||'SIP';this[_0xc3ef('0x9')]=_0x321ace[_0xc3ef('0x9')]?_0x321ace[_0xc3ef('0x9')]:undefined;this['ListId']=_0x321ace['ListId'];this[_0xc3ef('0xa')]=_0x321ace[_0xc3ef('0xa')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x785e=['ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description'];(function(_0x16a674,_0x5a75e8){var _0x1fb5d0=function(_0x3dbbb7){while(--_0x3dbbb7){_0x16a674['push'](_0x16a674['shift']());}};_0x1fb5d0(++_0x5a75e8);}(_0x785e,0x1de));var _0xe785=function(_0x187826,_0x357251){_0x187826=_0x187826-0x0;var _0x2c22f5=_0x785e[_0x187826];return _0x2c22f5;};'use strict';function FaxAccount(_0xc2fd52){this['id']=_0xc2fd52['id']||0x0;this[_0xe785('0x0')]=_0xc2fd52[_0xe785('0x0')]||'';this[_0xe785('0x1')]=_0xc2fd52[_0xe785('0x1')];this[_0xe785('0x2')]=_0xc2fd52[_0xe785('0x2')];this[_0xe785('0x3')]=_0xc2fd52[_0xe785('0x3')];this[_0xe785('0x4')]=_0xc2fd52[_0xe785('0x4')];this[_0xe785('0x5')]=_0xc2fd52['minrate']||0x960;this['maxrate']=_0xc2fd52[_0xe785('0x6')]||0x3840;this['modem']=_0xc2fd52[_0xe785('0x7')]||'v17,v27,v29';this[_0xe785('0x8')]=_0xc2fd52[_0xe785('0x8')]||'no';this[_0xe785('0x9')]=_0xc2fd52[_0xe785('0x9')]||'no';this[_0xe785('0xa')]=_0xc2fd52[_0xe785('0xa')]||0x1388;this['tech']=_0xc2fd52[_0xe785('0xb')]||'SIP';this[_0xe785('0xc')]=_0xc2fd52[_0xe785('0xc')]?_0xc2fd52[_0xe785('0xc')]:undefined;this['ListId']=_0xc2fd52[_0xe785('0xd')];this[_0xe785('0xe')]=_0xc2fd52['key'];}module[_0xe785('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 96b0dda..1309afc 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 _0xc216=['Configurations','exports','name','apiKey','remoteUri','serverUrl'];(function(_0x3cc81e,_0x435f44){var _0x5b15e3=function(_0x4eadb5){while(--_0x4eadb5){_0x3cc81e['push'](_0x3cc81e['shift']());}};_0x5b15e3(++_0x435f44);}(_0xc216,0xe0));var _0x6c21=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xc216[_0x1b349a];return _0x5d1f7c;};'use strict';function FreshdeskAccount(_0x1f298a){this['id']=_0x1f298a['id']||0x0;this['name']=_0x1f298a[_0x6c21('0x0')]||'';this['username']=_0x1f298a['username']||'';this[_0x6c21('0x1')]=_0x1f298a['token']||'';this[_0x6c21('0x2')]=_0x1f298a[_0x6c21('0x2')]||'';this[_0x6c21('0x3')]=_0x1f298a[_0x6c21('0x3')]||'';this[_0x6c21('0x4')]=_0x1f298a[_0x6c21('0x4')]||{};}module[_0x6c21('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xe648=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0xe648,0x1e0));var _0x8e64=function(_0x551e7b,_0x5b7618){_0x551e7b=_0x551e7b-0x0;var _0x34b32d=_0xe648[_0x551e7b];return _0x34b32d;};'use strict';function FreshdeskAccount(_0x47e4ea){this['id']=_0x47e4ea['id']||0x0;this[_0x8e64('0x0')]=_0x47e4ea[_0x8e64('0x0')]||'';this[_0x8e64('0x1')]=_0x47e4ea[_0x8e64('0x1')]||'';this['apiKey']=_0x47e4ea['token']||'';this[_0x8e64('0x2')]=_0x47e4ea[_0x8e64('0x2')]||'';this[_0x8e64('0x3')]=_0x47e4ea['serverUrl']||'';this[_0x8e64('0x4')]=_0x47e4ea[_0x8e64('0x4')]||{};}module[_0x8e64('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 5469d6d..e1effdc 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 _0x077e=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x445a91,_0xba8856){var _0xe49c3d=function(_0x362a51){while(--_0x362a51){_0x445a91['push'](_0x445a91['shift']());}};_0xe49c3d(++_0xba8856);}(_0x077e,0x14a));var _0xe077=function(_0x3e529e,_0x145d98){_0x3e529e=_0x3e529e-0x0;var _0x213f6c=_0x077e[_0x3e529e];return _0x213f6c;};'use strict';function FreshsalesAccount(_0x4a3f3f){this['id']=_0x4a3f3f['id']||0x0;this[_0xe077('0x0')]=_0x4a3f3f[_0xe077('0x0')]||'';this[_0xe077('0x1')]=_0x4a3f3f['username']||'';this[_0xe077('0x2')]=_0x4a3f3f[_0xe077('0x3')]||'';this[_0xe077('0x4')]=_0x4a3f3f['remoteUri']||'';this[_0xe077('0x5')]=_0x4a3f3f[_0xe077('0x5')]||'';this[_0xe077('0x6')]=_0x4a3f3f[_0xe077('0x6')]||{};}module[_0xe077('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x5b20=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1de69a,_0x4274ef){var _0x57bc64=function(_0x5e9937){while(--_0x5e9937){_0x1de69a['push'](_0x1de69a['shift']());}};_0x57bc64(++_0x4274ef);}(_0x5b20,0x86));var _0x05b2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b20[_0x122ef9];return _0x42fba0;};'use strict';function FreshsalesAccount(_0x5e7b8d){this['id']=_0x5e7b8d['id']||0x0;this[_0x05b2('0x0')]=_0x5e7b8d[_0x05b2('0x0')]||'';this[_0x05b2('0x1')]=_0x5e7b8d[_0x05b2('0x1')]||'';this[_0x05b2('0x2')]=_0x5e7b8d[_0x05b2('0x3')]||'';this[_0x05b2('0x4')]=_0x5e7b8d[_0x05b2('0x4')]||'';this[_0x05b2('0x5')]=_0x5e7b8d[_0x05b2('0x5')]||'';this['Configurations']=_0x5e7b8d[_0x05b2('0x6')]||{};}module[_0x05b2('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 42ba50d..52665ea 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 _0xfa7c=['queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','priority','assigned','lastAssignedTo','motionChannel','voice','exports','type','inbound','uniqueid','calleridnum','calleridname'];(function(_0x9ac2cb,_0x1b0500){var _0x217bf3=function(_0x4a02b2){while(--_0x4a02b2){_0x9ac2cb['push'](_0x9ac2cb['shift']());}};_0x217bf3(++_0x1b0500);}(_0xfa7c,0x11b));var _0xcfa7=function(_0x279249,_0x4b20ff){_0x279249=_0x279249-0x0;var _0x277bff=_0xfa7c[_0x279249];return _0x277bff;};'use strict';function QueueReport(){this[_0xcfa7('0x0')]=_0xcfa7('0x1');this[_0xcfa7('0x2')]='';this[_0xcfa7('0x3')]='';this[_0xcfa7('0x4')]='';this[_0xcfa7('0x5')]='';this[_0xcfa7('0x6')]=null;this[_0xcfa7('0x7')]=null;this['position']=0x1;this[_0xcfa7('0x8')]=0x1;this[_0xcfa7('0x9')]=![];this[_0xcfa7('0xa')]=null;this[_0xcfa7('0xb')]=![];this['queuecallercompleteAt']=null;this[_0xcfa7('0xc')]=![];this[_0xcfa7('0xd')]=null;this[_0xcfa7('0xe')]=0x1;this[_0xcfa7('0xf')]='';this['connectedlinenum']='';this[_0xcfa7('0x10')]='';this['accountcode']='';this[_0xcfa7('0x11')]='';this['exten']='';this[_0xcfa7('0x12')]='';this['holdtime']=0x0;this[_0xcfa7('0x13')]=![];this[_0xcfa7('0x14')]='';this[_0xcfa7('0x15')]=_0xcfa7('0x16');this['mohtime']=0x0;this['variables']={};}module[_0xcfa7('0x17')]=QueueReport; \ No newline at end of file +var _0xc42a=['calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','holdtime','lastAssignedTo','voice','exports','type','inbound','uniqueid'];(function(_0x2be1ab,_0x2fe1fc){var _0x4c616d=function(_0x16dfc8){while(--_0x16dfc8){_0x2be1ab['push'](_0x2be1ab['shift']());}};_0x4c616d(++_0x2fe1fc);}(_0xc42a,0x1dd));var _0xac42=function(_0x5e20a7,_0x4568ae){_0x5e20a7=_0x5e20a7-0x0;var _0x2abe1a=_0xc42a[_0x5e20a7];return _0x2abe1a;};'use strict';function QueueReport(){this[_0xac42('0x0')]=_0xac42('0x1');this[_0xac42('0x2')]='';this[_0xac42('0x3')]='';this[_0xac42('0x4')]='';this[_0xac42('0x5')]='';this[_0xac42('0x6')]=null;this[_0xac42('0x7')]=null;this[_0xac42('0x8')]=0x1;this['count']=0x1;this[_0xac42('0x9')]=![];this[_0xac42('0xa')]=null;this[_0xac42('0xb')]=![];this[_0xac42('0xc')]=null;this[_0xac42('0xd')]=![];this[_0xac42('0xe')]=null;this[_0xac42('0xf')]=0x1;this[_0xac42('0x10')]='';this['connectedlinenum']='';this[_0xac42('0x11')]='';this['accountcode']='';this[_0xac42('0x12')]='';this[_0xac42('0x13')]='';this['priority']='';this[_0xac42('0x14')]=0x0;this['assigned']=![];this[_0xac42('0x15')]='';this['motionChannel']=_0xac42('0x16');this['mohtime']=0x0;this['variables']={};}module[_0xac42('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 764eb54..3c566e2 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 _0xf087=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','type'];(function(_0x528bb3,_0x2c9731){var _0x3005f5=function(_0x2de01f){while(--_0x2de01f){_0x528bb3['push'](_0x528bb3['shift']());}};_0x3005f5(++_0x2c9731);}(_0xf087,0x101));var _0x7f08=function(_0x364260,_0x1a4be1){_0x364260=_0x364260-0x0;var _0x526b0b=_0xf087[_0x364260];return _0x526b0b;};'use strict';function SalesforceAccount(_0x406b1a){this['id']=_0x406b1a['id']||0x0;this[_0x7f08('0x0')]=_0x406b1a[_0x7f08('0x0')]||'';this[_0x7f08('0x1')]=_0x406b1a[_0x7f08('0x1')]||'';this['remoteUri']=_0x406b1a[_0x7f08('0x2')]||'';this['password']=_0x406b1a[_0x7f08('0x3')]||'';this[_0x7f08('0x4')]=_0x406b1a['clientId']||'';this['clientSecret']=_0x406b1a[_0x7f08('0x5')]||'';this['securityToken']=_0x406b1a['securityToken']||'';this[_0x7f08('0x6')]=_0x406b1a['type']||_0x7f08('0x7');this[_0x7f08('0x8')]=_0x406b1a[_0x7f08('0x8')]||'';this[_0x7f08('0x9')]=_0x406b1a['Configurations']||{};}module[_0x7f08('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x8683=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x8683,0x1a7));var _0x3868=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8683[_0x4cf98e];return _0x1623ac;};'use strict';function SalesforceAccount(_0x1181dc){this['id']=_0x1181dc['id']||0x0;this[_0x3868('0x0')]=_0x1181dc[_0x3868('0x0')]||'';this['username']=_0x1181dc[_0x3868('0x1')]||'';this[_0x3868('0x2')]=_0x1181dc[_0x3868('0x2')]||'';this['password']=_0x1181dc[_0x3868('0x3')]||'';this[_0x3868('0x4')]=_0x1181dc[_0x3868('0x4')]||'';this[_0x3868('0x5')]=_0x1181dc['clientSecret']||'';this[_0x3868('0x6')]=_0x1181dc[_0x3868('0x6')]||'';this[_0x3868('0x7')]=_0x1181dc['type']||_0x3868('0x8');this['serverUrl']=_0x1181dc[_0x3868('0x9')]||'';this[_0x3868('0xa')]=_0x1181dc[_0x3868('0xa')]||{};}module[_0x3868('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 5b88558..bed03bd 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 _0x9444=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0xcca2f3,_0x245a36){var _0x374eff=function(_0x2450a7){while(--_0x2450a7){_0xcca2f3['push'](_0xcca2f3['shift']());}};_0x374eff(++_0x245a36);}(_0x9444,0xc8));var _0x4944=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x9444[_0x328b1c];return _0x4dbeaa;};'use strict';function ServicenowAccount(_0x249a4a){this['id']=_0x249a4a['id']||0x0;this['name']=_0x249a4a[_0x4944('0x0')]||'';this[_0x4944('0x1')]=_0x249a4a[_0x4944('0x1')]||'';this['password']=_0x249a4a[_0x4944('0x2')]||'';this[_0x4944('0x3')]=_0x249a4a[_0x4944('0x3')]||'';this[_0x4944('0x4')]=_0x249a4a[_0x4944('0x4')]||'';this[_0x4944('0x5')]=_0x249a4a[_0x4944('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x88bc=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x203c5a,_0x1da9f6){var _0x1e89e3=function(_0x333080){while(--_0x333080){_0x203c5a['push'](_0x203c5a['shift']());}};_0x1e89e3(++_0x1da9f6);}(_0x88bc,0x1a4));var _0xc88b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x88bc[_0xf50820];return _0x2a9b10;};'use strict';function ServicenowAccount(_0x790b74){this['id']=_0x790b74['id']||0x0;this[_0xc88b('0x0')]=_0x790b74[_0xc88b('0x0')]||'';this[_0xc88b('0x1')]=_0x790b74[_0xc88b('0x1')]||'';this[_0xc88b('0x2')]=_0x790b74[_0xc88b('0x2')]||'';this[_0xc88b('0x3')]=_0x790b74[_0xc88b('0x3')]||'';this[_0xc88b('0x4')]=_0x790b74[_0xc88b('0x4')]||'';this[_0xc88b('0x5')]=_0x790b74['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 23ede45..49db0c2 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 _0xb492=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x15cb1c,_0x3ee82f){var _0x449ce9=function(_0x1b500d){while(--_0x1b500d){_0x15cb1c['push'](_0x15cb1c['shift']());}};_0x449ce9(++_0x3ee82f);}(_0xb492,0x105));var _0x2b49=function(_0x37a609,_0x35ddbf){_0x37a609=_0x37a609-0x0;var _0x55ea4a=_0xb492[_0x37a609];return _0x55ea4a;};'use strict';function SugarcrmAccount(_0x5a28c5){this['id']=_0x5a28c5['id']||0x0;this[_0x2b49('0x0')]=_0x5a28c5[_0x2b49('0x0')]||'';this[_0x2b49('0x1')]=_0x5a28c5[_0x2b49('0x1')]||'';this['password']=_0x5a28c5[_0x2b49('0x2')]||'';this['remoteUri']=_0x5a28c5[_0x2b49('0x3')]||'';this['serverUrl']=_0x5a28c5[_0x2b49('0x4')]||'';this[_0x2b49('0x5')]=_0x5a28c5[_0x2b49('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x1776=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1a3722,_0x4e9eb2){var _0x377ef5=function(_0x485780){while(--_0x485780){_0x1a3722['push'](_0x1a3722['shift']());}};_0x377ef5(++_0x4e9eb2);}(_0x1776,0x15a));var _0x6177=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x1776[_0x29632e];return _0x426e04;};'use strict';function SugarcrmAccount(_0x5d5647){this['id']=_0x5d5647['id']||0x0;this['name']=_0x5d5647[_0x6177('0x0')]||'';this['username']=_0x5d5647[_0x6177('0x1')]||'';this[_0x6177('0x2')]=_0x5d5647[_0x6177('0x2')]||'';this[_0x6177('0x3')]=_0x5d5647[_0x6177('0x3')]||'';this['serverUrl']=_0x5d5647[_0x6177('0x4')]||'';this[_0x6177('0x5')]=_0x5d5647[_0x6177('0x5')]||{};}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 fcda7b7..20db381 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 _0xd9ed=['stateTime','unknown','exports','name','accountcode','state'];(function(_0x32373b,_0x2a091d){var _0x87f28e=function(_0x1c6367){while(--_0x1c6367){_0x32373b['push'](_0x32373b['shift']());}};_0x87f28e(++_0x2a091d);}(_0xd9ed,0x135));var _0xdd9e=function(_0x3820e4,_0x1a26d3){_0x3820e4=_0x3820e4-0x0;var _0xa97a4d=_0xd9ed[_0x3820e4];return _0xa97a4d;};'use strict';function Telephone(_0x3471a3){this['id']=_0x3471a3['id']||0x0;this['name']=_0x3471a3[_0xdd9e('0x0')]||'';this[_0xdd9e('0x1')]=_0x3471a3[_0xdd9e('0x1')]||'';this[_0xdd9e('0x2')]='unknown';this[_0xdd9e('0x3')]=0x0;this['status']=_0xdd9e('0x4');this['address']='';}module[_0xdd9e('0x5')]=Telephone; \ No newline at end of file +var _0x9b11=['stateTime','status','unknown','address','exports','name','accountcode'];(function(_0x2729e4,_0x7ffbb7){var _0x437335=function(_0x3050e3){while(--_0x3050e3){_0x2729e4['push'](_0x2729e4['shift']());}};_0x437335(++_0x7ffbb7);}(_0x9b11,0x12b));var _0x19b1=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0x9b11[_0x8abd64];return _0xd2511e;};'use strict';function Telephone(_0x1d4b20){this['id']=_0x1d4b20['id']||0x0;this[_0x19b1('0x0')]=_0x1d4b20['name']||'';this[_0x19b1('0x1')]=_0x1d4b20[_0x19b1('0x1')]||'';this['state']='unknown';this[_0x19b1('0x2')]=0x0;this[_0x19b1('0x3')]=_0x19b1('0x4');this[_0x19b1('0x5')]='';}module[_0x19b1('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 48046c2..349fdaa 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x58c9cd,_0x1544e9){var _0x2b624d=function(_0x20a57f){while(--_0x20a57f){_0x58c9cd['push'](_0x58c9cd['shift']());}};_0x2b624d(++_0x1544e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x571fd6,_0x5223fc){_0x571fd6=_0x571fd6-0x0;var _0x4d6af6=_0xb10b[_0x571fd6];return _0x4d6af6;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x3e7df1,_0x407981){var _0x14abd7=function(_0x4f773e){while(--_0x4f773e){_0x3e7df1['push'](_0x3e7df1['shift']());}};_0x14abd7(++_0x407981);}(_0xb10b,0x12a));var _0xbb10=function(_0x98ac1f,_0x2effb0){_0x98ac1f=_0x98ac1f-0x0;var _0x1579d1=_0xb10b[_0x98ac1f];return _0x1579d1;};'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 f02af5a..0e4496f 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x4405f4,_0x26eb48){var _0x4fa07e=function(_0x49b802){while(--_0x49b802){_0x4405f4['push'](_0x4405f4['shift']());}};_0x4fa07e(++_0x26eb48);}(_0xda2d,0x102));var _0xdda2=function(_0x43ff0a,_0x54e327){_0x43ff0a=_0x43ff0a-0x0;var _0x56cb38=_0xda2d[_0x43ff0a];return _0x56cb38;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x70ed5e,_0x5d89fb){var _0x5350eb=function(_0x5d2809){while(--_0x5d2809){_0x70ed5e['push'](_0x70ed5e['shift']());}};_0x5350eb(++_0x5d89fb);}(_0x14a0,0x8e));var _0x014a=function(_0x462582,_0x279982){_0x462582=_0x462582-0x0;var _0x176aac=_0x14a0[_0x462582];return _0x176aac;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index c08848e..5fbdc4f 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 _0x3010=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','host','domain','domainport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3010,0x8d));var _0x0301=function(_0x16a42b,_0x2d9468){_0x16a42b=_0x16a42b-0x0;var _0x1feccb=_0x3010[_0x16a42b];return _0x1feccb;};'use strict';function Trunk(_0x14e6e7){this['id']=_0x14e6e7['id']||0x0;this[_0x0301('0x0')]=_0x14e6e7[_0x0301('0x0')]||![];this[_0x0301('0x1')]=_0x14e6e7['name']||'';this[_0x0301('0x2')]=_0x0301('0x3');this['stateTime']=0x0;this[_0x0301('0x4')]=_0x0301('0x3');this[_0x0301('0x5')]=_0x14e6e7[_0x0301('0x5')]&&_0x14e6e7['registry']['indexOf'](':')?_0x14e6e7['registry']['split'](':')[0x0]:'';this[_0x0301('0x6')]='';this['port']='';this[_0x0301('0x7')]='';this[_0x0301('0x8')]='';this[_0x0301('0x9')]='';this[_0x0301('0xa')]='unknown';this[_0x0301('0xb')]='';this[_0x0301('0xc')]='';this[_0x0301('0xd')]=_0x14e6e7[_0x0301('0xd')]||'';}module[_0x0301('0xe')]=Trunk; \ No newline at end of file +var _0x6cb6=['unknown','stateTime','registry','indexOf','host','port','domain','stateRegistry','address','defaultuser','exports','active'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6cb6,0x107));var _0x66cb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x6cb6[_0x6131cd];return _0x47e916;};'use strict';function Trunk(_0x336a01){this['id']=_0x336a01['id']||0x0;this[_0x66cb('0x0')]=_0x336a01[_0x66cb('0x0')]||![];this['name']=_0x336a01['name']||'';this['state']=_0x66cb('0x1');this[_0x66cb('0x2')]=0x0;this['status']=_0x66cb('0x1');this[_0x66cb('0x3')]=_0x336a01['registry']&&_0x336a01[_0x66cb('0x3')][_0x66cb('0x4')](':')?_0x336a01['registry']['split'](':')[0x0]:'';this[_0x66cb('0x5')]='';this[_0x66cb('0x6')]='';this[_0x66cb('0x7')]='';this['domainport']='';this['refresh']='';this[_0x66cb('0x8')]='unknown';this['registrationtime']='';this[_0x66cb('0x9')]='';this[_0x66cb('0xa')]=_0x336a01[_0x66cb('0xa')]||'';}module[_0x66cb('0xb')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b21edc3..cd49f20 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 _0xf7c8=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xf7c8,0x1d5));var _0x8f7c=function(_0x364b43,_0x432061){_0x364b43=_0x364b43-0x0;var _0x54d692=_0xf7c8[_0x364b43];return _0x54d692;};'use strict';function voiceExtension(_0x13b20f){this['id']=_0x13b20f['id']||0x0;this[_0x8f7c('0x0')]=_0x13b20f[_0x8f7c('0x0')]||'';this[_0x8f7c('0x1')]=_0x13b20f[_0x8f7c('0x1')]||_0x8f7c('0x2');this[_0x8f7c('0x3')]=_0x13b20f[_0x8f7c('0x3')]||![];}module[_0x8f7c('0x4')]=voiceExtension; \ No newline at end of file +var _0x3e20=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x132b11,_0x25d93f){var _0xf08725=function(_0x3c8202){while(--_0x3c8202){_0x132b11['push'](_0x132b11['shift']());}};_0xf08725(++_0x25d93f);}(_0x3e20,0xa0));var _0x03e2=function(_0x1f4656,_0x201b59){_0x1f4656=_0x1f4656-0x0;var _0x35e26e=_0x3e20[_0x1f4656];return _0x35e26e;};'use strict';function voiceExtension(_0x432250){this['id']=_0x432250['id']||0x0;this['exten']=_0x432250[_0x03e2('0x0')]||'';this[_0x03e2('0x1')]=_0x432250[_0x03e2('0x1')]||'none';this[_0x03e2('0x2')]=_0x432250[_0x03e2('0x2')]||![];}module[_0x03e2('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ddb308c..48f50b3 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 _0x5c51=['dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','invalid','ringing','ringinuse','wav','wav49','roundrobin','name','monitor_format','type','inbound','waiting','talking','sumDuration','sumBillable','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp'];(function(_0x5250a9,_0x468b23){var _0x4e3185=function(_0x5b7ecc){while(--_0x5b7ecc){_0x5250a9['push'](_0x5250a9['shift']());}};_0x4e3185(++_0x468b23);}(_0x5c51,0xd4));var _0x15c5=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x5c51[_0x2125f0];return _0x12d6eb;};'use strict';var statusDesc=[_0x15c5('0x0'),'not_inuse','inuse','busy',_0x15c5('0x1'),'unavailable',_0x15c5('0x2'),_0x15c5('0x3'),'onhold'];var monitorFormat={'wav':_0x15c5('0x4'),'wav49':_0x15c5('0x5'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x15c5('0x6')};function VoiceQueue(_0x2b3954){this['id']=_0x2b3954['id']||0x0;this[_0x15c5('0x7')]=_0x2b3954[_0x15c5('0x7')]||'';this[_0x15c5('0x8')]=_0x2b3954[_0x15c5('0x8')]||'';this[_0x15c5('0x9')]=_0x2b3954[_0x15c5('0x9')]||_0x15c5('0xa');this[_0x15c5('0xb')]=0x0;this[_0x15c5('0xc')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x15c5('0xd')]=0x0;this['sumHoldTime']=0x0;this[_0x15c5('0xe')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0x15c5('0xf')]=0x0;this[_0x15c5('0x10')]=_0x2b3954[_0x15c5('0x10')]||![];this[_0x15c5('0x11')]=_0x2b3954[_0x15c5('0x11')]||0xa;this[_0x15c5('0x12')]=_0x2b3954[_0x15c5('0x12')]||'no';this[_0x15c5('0x13')]=!![];this[_0x15c5('0x14')]='';this['originated']=0x0;this[_0x15c5('0x15')]=0x0;this[_0x15c5('0x16')]=_0x2b3954['dialTimezone']||null;this['dialGlobalInterval']=_0x2b3954[_0x15c5('0x17')]?_0x2b3954[_0x15c5('0x17')]:null;this[_0x15c5('0x18')]=_0x2b3954[_0x15c5('0x18')];this[_0x15c5('0x19')]=_0x2b3954[_0x15c5('0x19')]||_0x15c5('0x1a');this[_0x15c5('0x1b')]=_0x2b3954['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x2b3954[_0x15c5('0x1c')]||0x0;this['dialPowerLevel']=_0x2b3954[_0x15c5('0x1d')]||0x1;this['dialPredictiveOptimization']=_0x2b3954[_0x15c5('0x1e')]||_0x15c5('0x1f');this[_0x15c5('0x20')]=_0x2b3954[_0x15c5('0x20')]||0.03;this['dialPredictiveInterval']=_0x2b3954[_0x15c5('0x21')]||0x258;this[_0x15c5('0x22')]=_0x2b3954[_0x15c5('0x22')]||_0x15c5('0x23');this['dialOriginateCallerIdNumber']=_0x2b3954[_0x15c5('0x24')]||_0x15c5('0x23');this[_0x15c5('0x25')]=_0x2b3954['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x2b3954[_0x15c5('0x26')]||_0x15c5('0x27');this[_0x15c5('0x28')]=_0x2b3954[_0x15c5('0x28')]||0x3;this['dialQueueProject']=_0x2b3954[_0x15c5('0x29')]||undefined;this[_0x15c5('0x2a')]=_0x2b3954[_0x15c5('0x2a')]||0x3;this['dialCongestionRetryFrequency']=_0x2b3954[_0x15c5('0x2b')]||0x96;this['dialBusyMaxRetry']=_0x2b3954[_0x15c5('0x2c')]||0x3;this['dialBusyRetryFrequency']=_0x2b3954[_0x15c5('0x2d')]||0x96;this[_0x15c5('0x2e')]=_0x2b3954[_0x15c5('0x2e')]||0x3;this['dialNoAnswerRetryFrequency']=_0x2b3954[_0x15c5('0x2f')]||0x96;this[_0x15c5('0x30')]=_0x2b3954[_0x15c5('0x30')]||0x3;this[_0x15c5('0x31')]=_0x2b3954[_0x15c5('0x31')]||0x96;this[_0x15c5('0x32')]=_0x2b3954[_0x15c5('0x32')]||0x3;this[_0x15c5('0x33')]=_0x2b3954[_0x15c5('0x33')]||0x96;this[_0x15c5('0x34')]=_0x2b3954[_0x15c5('0x34')]||0x3;this[_0x15c5('0x35')]=_0x2b3954['dialAbandonedRetryFrequency']||0x96;this[_0x15c5('0x36')]=_0x2b3954[_0x15c5('0x36')]||0x3;this[_0x15c5('0x37')]=_0x2b3954[_0x15c5('0x37')]||0x96;this[_0x15c5('0x38')]=_0x2b3954[_0x15c5('0x38')]||0x3;this[_0x15c5('0x39')]=_0x2b3954[_0x15c5('0x39')]||0x96;this[_0x15c5('0x3a')]=_0x2b3954['dialGlobalMaxRetry']||0x4;this[_0x15c5('0x3b')]=_0x2b3954['Trunk']?_0x2b3954[_0x15c5('0x3b')]:undefined;this[_0x15c5('0x3c')]=_0x2b3954[_0x15c5('0x3c')]?_0x2b3954[_0x15c5('0x3c')]:undefined;this['dialPrefix']=_0x2b3954[_0x15c5('0x3d')]||undefined;this['Interval']=_0x2b3954[_0x15c5('0x3e')]?_0x2b3954[_0x15c5('0x3e')]:undefined;this[_0x15c5('0x3f')]=_0x2b3954[_0x15c5('0x3f')]||_0x15c5('0x40');this[_0x15c5('0x41')]=_0x2b3954['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x2b3954[_0x15c5('0x42')]||undefined;this[_0x15c5('0x43')]=strategy[_0x2b3954[_0x15c5('0x43')]]||_0x15c5('0x44');this['queueStatusComplete']=!![];this[_0x15c5('0x45')]=_0x2b3954[_0x15c5('0x45')]||![];this[_0x15c5('0x46')]=_0x2b3954['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x2b3954[_0x15c5('0x47')];this[_0x15c5('0x48')]=_0x2b3954[_0x15c5('0x48')];this[_0x15c5('0x49')]=_0x2b3954[_0x15c5('0x49')];this[_0x15c5('0x4a')]=_0x2b3954[_0x15c5('0x4a')];this[_0x15c5('0x4b')]=_0x2b3954[_0x15c5('0x4b')];this[_0x15c5('0x4c')]=_0x2b3954[_0x15c5('0x4c')];this[_0x15c5('0x4d')]=_0x2b3954[_0x15c5('0x4d')];this[_0x15c5('0x4e')]=_0x2b3954['dialAMDMaximumWordLength'];this[_0x15c5('0x4f')]=0x0;this[_0x15c5('0x50')]=0x0;this[_0x15c5('0x51')]=_0x2b3954[_0x15c5('0x51')];this[_0x15c5('0x52')]=0x0;this[_0x15c5('0x53')]=0x0;this[_0x15c5('0x54')]=0x0;this[_0x15c5('0x55')]=0x0;this[_0x15c5('0x56')]=0x0;this[_0x15c5('0x57')]=0x0;this[_0x15c5('0x58')]=0x0;this[_0x15c5('0x59')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x15c5('0x5a')]=0x0;this[_0x15c5('0x5b')]=0x0;this[_0x15c5('0x5c')]=0x0;this[_0x15c5('0x5d')]=0x0;this['startProgressive']=undefined;this[_0x15c5('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x15c5('0x5f')]=1.05;this[_0x15c5('0x60')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x15c5('0x61')]=0x0;this[_0x15c5('0x62')]=0x0;this[_0x15c5('0x63')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x15c5('0x64')]=0x0;this[_0x15c5('0x65')]=_0x2b3954[_0x15c5('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x2b3954[_0x15c5('0x66')]||0xa;this[_0x15c5('0x67')]=0x0;this[_0x15c5('0x68')]=0x0;this[_0x15c5('0x69')]=0x1;this['erlangCalls']=0x0;this[_0x15c5('0x6a')]=0x0;this[_0x15c5('0x6b')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x2b3954[_0x15c5('0x6c')]||0x1e;this[_0x15c5('0x6d')]=_0x2b3954[_0x15c5('0x6d')]||![];this['dialPreviewAutoRecallMe']=!!_0x2b3954[_0x15c5('0x6e')]||![];this[_0x15c5('0x6f')]=_0x2b3954[_0x15c5('0x6f')]||undefined;this['dialAgiAfterHangupClient']=_0x2b3954[_0x15c5('0x70')]||![];this[_0x15c5('0x71')]=_0x2b3954['dialAgiAfterHangupAgent']||![];this[_0x15c5('0x8')]=monitorFormat[_0x2b3954['monitor_format']]?monitorFormat[_0x2b3954[_0x15c5('0x8')]]:undefined;this[_0x15c5('0x72')]=_0x2b3954[_0x15c5('0x72')]||![];this['mandatoryDispositionPause']=_0x2b3954['mandatoryDispositionPause']?_0x2b3954[_0x15c5('0x73')]:undefined;}module[_0x15c5('0x74')]=VoiceQueue; \ No newline at end of file +var _0x8b27=['predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','gsm','rrmemory','roundrobin','name','type','inbound','talking','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x8b27,0x8c));var _0x78b2=function(_0x3bef47,_0xdc5631){_0x3bef47=_0x3bef47-0x0;var _0x27d038=_0x8b27[_0x3bef47];return _0x27d038;};'use strict';var statusDesc=[_0x78b2('0x0'),_0x78b2('0x1'),_0x78b2('0x2'),_0x78b2('0x3'),_0x78b2('0x4'),_0x78b2('0x5'),_0x78b2('0x6'),_0x78b2('0x7'),'onhold'];var monitorFormat={'wav':_0x78b2('0x8'),'wav49':'wav49','gsm':_0x78b2('0x9')};var strategy={'rrmemory':_0x78b2('0xa'),'roundrobin':_0x78b2('0xb')};function VoiceQueue(_0x40af6e){this['id']=_0x40af6e['id']||0x0;this[_0x78b2('0xc')]=_0x40af6e[_0x78b2('0xc')]||'';this['monitor_format']=_0x40af6e['monitor_format']||'';this[_0x78b2('0xd')]=_0x40af6e[_0x78b2('0xd')]||_0x78b2('0xe');this['waiting']=0x0;this[_0x78b2('0xf')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x78b2('0x10')]=0x0;this[_0x78b2('0x11')]=0x0;this[_0x78b2('0x12')]=0x0;this[_0x78b2('0x13')]=0x0;this[_0x78b2('0x14')]=0x0;this[_0x78b2('0x15')]=0x0;this[_0x78b2('0x16')]=0x0;this['acw']=_0x40af6e[_0x78b2('0x17')]||![];this[_0x78b2('0x18')]=_0x40af6e[_0x78b2('0x18')]||0xa;this['autopause']=_0x40af6e[_0x78b2('0x19')]||'no';this[_0x78b2('0x1a')]=!![];this[_0x78b2('0x1b')]='';this[_0x78b2('0x1c')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x40af6e['dialTimezone']||null;this['dialGlobalInterval']=_0x40af6e[_0x78b2('0x1d')]?_0x40af6e[_0x78b2('0x1d')]:null;this['dialActive']=_0x40af6e[_0x78b2('0x1e')];this[_0x78b2('0x1f')]=_0x40af6e['dialMethod']||_0x78b2('0x20');this[_0x78b2('0x21')]=_0x40af6e[_0x78b2('0x21')]||0x0;this[_0x78b2('0x22')]=_0x40af6e[_0x78b2('0x22')]||0x0;this['dialPowerLevel']=_0x40af6e[_0x78b2('0x23')]||0x1;this[_0x78b2('0x24')]=_0x40af6e[_0x78b2('0x24')]||_0x78b2('0x25');this['dialPredictiveOptimizationPercentage']=_0x40af6e[_0x78b2('0x26')]||0.03;this[_0x78b2('0x27')]=_0x40af6e[_0x78b2('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x40af6e[_0x78b2('0x28')]||_0x78b2('0x29');this[_0x78b2('0x2a')]=_0x40af6e['dialOriginateCallerIdNumber']||_0x78b2('0x29');this[_0x78b2('0x2b')]=_0x40af6e['dialOriginateTimeout']||0x1e;this[_0x78b2('0x2c')]=_0x40af6e[_0x78b2('0x2c')]||_0x78b2('0x2d');this[_0x78b2('0x2e')]=_0x40af6e[_0x78b2('0x2e')]||0x3;this[_0x78b2('0x2f')]=_0x40af6e[_0x78b2('0x2f')]||undefined;this[_0x78b2('0x30')]=_0x40af6e[_0x78b2('0x30')]||0x3;this[_0x78b2('0x31')]=_0x40af6e[_0x78b2('0x31')]||0x96;this[_0x78b2('0x32')]=_0x40af6e[_0x78b2('0x32')]||0x3;this[_0x78b2('0x33')]=_0x40af6e[_0x78b2('0x33')]||0x96;this[_0x78b2('0x34')]=_0x40af6e[_0x78b2('0x34')]||0x3;this[_0x78b2('0x35')]=_0x40af6e[_0x78b2('0x35')]||0x96;this[_0x78b2('0x36')]=_0x40af6e[_0x78b2('0x36')]||0x3;this[_0x78b2('0x37')]=_0x40af6e[_0x78b2('0x37')]||0x96;this['dialDropMaxRetry']=_0x40af6e[_0x78b2('0x38')]||0x3;this['dialDropRetryFrequency']=_0x40af6e[_0x78b2('0x39')]||0x96;this[_0x78b2('0x3a')]=_0x40af6e[_0x78b2('0x3a')]||0x3;this['dialAbandonedRetryFrequency']=_0x40af6e[_0x78b2('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x40af6e[_0x78b2('0x3c')]||0x3;this[_0x78b2('0x3d')]=_0x40af6e[_0x78b2('0x3d')]||0x96;this[_0x78b2('0x3e')]=_0x40af6e[_0x78b2('0x3e')]||0x3;this[_0x78b2('0x3f')]=_0x40af6e['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x40af6e[_0x78b2('0x40')]||0x4;this[_0x78b2('0x41')]=_0x40af6e[_0x78b2('0x41')]?_0x40af6e['Trunk']:undefined;this[_0x78b2('0x42')]=_0x40af6e[_0x78b2('0x42')]?_0x40af6e[_0x78b2('0x42')]:undefined;this[_0x78b2('0x43')]=_0x40af6e[_0x78b2('0x43')]||undefined;this['Interval']=_0x40af6e[_0x78b2('0x44')]?_0x40af6e[_0x78b2('0x44')]:undefined;this[_0x78b2('0x45')]=_0x40af6e['dialOrderByScheduledAt']||'DESC';this[_0x78b2('0x46')]=_0x40af6e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x78b2('0x47')]=_0x40af6e[_0x78b2('0x47')]||undefined;this['strategy']=strategy[_0x40af6e[_0x78b2('0x48')]]||_0x78b2('0xa');this['queueStatusComplete']=!![];this[_0x78b2('0x49')]=_0x40af6e[_0x78b2('0x49')]||![];this['dialAMDInitialSilence']=_0x40af6e['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x40af6e[_0x78b2('0x4a')];this[_0x78b2('0x4b')]=_0x40af6e['dialAMDAfterGreetingSilence'];this[_0x78b2('0x4c')]=_0x40af6e[_0x78b2('0x4c')];this[_0x78b2('0x4d')]=_0x40af6e[_0x78b2('0x4d')];this[_0x78b2('0x4e')]=_0x40af6e[_0x78b2('0x4e')];this[_0x78b2('0x4f')]=_0x40af6e[_0x78b2('0x4f')];this[_0x78b2('0x50')]=_0x40af6e[_0x78b2('0x50')];this[_0x78b2('0x51')]=_0x40af6e[_0x78b2('0x51')];this['outboundRejectCallsDay']=0x0;this[_0x78b2('0x52')]=0x0;this['timeout']=_0x40af6e['timeout'];this[_0x78b2('0x53')]=0x0;this[_0x78b2('0x54')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x78b2('0x55')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x78b2('0x56')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x78b2('0x57')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x78b2('0x58')]=0x0;this[_0x78b2('0x59')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x78b2('0x5a')]=undefined;this[_0x78b2('0x5b')]=undefined;this['handlePredictive']=undefined;this[_0x78b2('0x5c')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x78b2('0x5d')]=0x0;this[_0x78b2('0x5e')]=0x0;this[_0x78b2('0x5f')]=0x0;this[_0x78b2('0x60')]=0x0;this[_0x78b2('0x61')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x78b2('0x62')]=0x0;this[_0x78b2('0x63')]=_0x40af6e[_0x78b2('0x64')]||0x14;this['predictiveIntervalMinThreshold']=_0x40af6e[_0x78b2('0x64')]||0xa;this[_0x78b2('0x65')]=0x0;this[_0x78b2('0x66')]=0x0;this[_0x78b2('0x67')]=0x1;this[_0x78b2('0x68')]=0x0;this['erlangCallToSecond']=0x0;this[_0x78b2('0x69')]=0x0;this[_0x78b2('0x6a')]=0x0;this[_0x78b2('0x6b')]=_0x40af6e[_0x78b2('0x6b')]||0x1e;this[_0x78b2('0x6c')]=_0x40af6e[_0x78b2('0x6c')]||![];this[_0x78b2('0x6d')]=!!_0x40af6e['dialPreviewAutoRecallMe']||![];this[_0x78b2('0x6e')]=_0x40af6e[_0x78b2('0x6e')]||undefined;this[_0x78b2('0x6f')]=_0x40af6e[_0x78b2('0x6f')]||![];this[_0x78b2('0x70')]=_0x40af6e[_0x78b2('0x70')]||![];this['monitor_format']=monitorFormat[_0x40af6e[_0x78b2('0x71')]]?monitorFormat[_0x40af6e[_0x78b2('0x71')]]:undefined;this[_0x78b2('0x72')]=_0x40af6e[_0x78b2('0x72')]||![];this['mandatoryDispositionPause']=_0x40af6e[_0x78b2('0x73')]?_0x40af6e[_0x78b2('0x73')]:undefined;}module[_0x78b2('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 3da82a1..1ce2de2 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 _0x20c3=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x20c3,0x1b0));var _0x320c=function(_0xdcb614,_0x2edfa0){_0xdcb614=_0xdcb614-0x0;var _0x232807=_0x20c3[_0xdcb614];return _0x232807;};'use strict';function VtigerAccount(_0x1cf83c){this['id']=_0x1cf83c['id']||0x0;this[_0x320c('0x0')]=_0x1cf83c[_0x320c('0x0')]||'';this[_0x320c('0x1')]=_0x1cf83c[_0x320c('0x1')]||'';this[_0x320c('0x2')]=_0x1cf83c['accessKey']||'';this[_0x320c('0x3')]=_0x1cf83c[_0x320c('0x3')]||'';this[_0x320c('0x4')]=_0x1cf83c[_0x320c('0x4')]||'';this[_0x320c('0x5')]=_0x1cf83c[_0x320c('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xeb73=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0xeb73,0x131));var _0x3eb7=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0xeb73[_0x3b3a82];return _0x267063;};'use strict';function VtigerAccount(_0x5e7577){this['id']=_0x5e7577['id']||0x0;this[_0x3eb7('0x0')]=_0x5e7577['name']||'';this[_0x3eb7('0x1')]=_0x5e7577[_0x3eb7('0x1')]||'';this[_0x3eb7('0x2')]=_0x5e7577[_0x3eb7('0x2')]||'';this[_0x3eb7('0x3')]=_0x5e7577[_0x3eb7('0x3')]||'';this[_0x3eb7('0x4')]=_0x5e7577[_0x3eb7('0x4')]||'';this[_0x3eb7('0x5')]=_0x5e7577[_0x3eb7('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 3cf66ca..8a7a22f 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 _0x64b1=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','integrationTab'];(function(_0x130f84,_0xf4b798){var _0x41bfd9=function(_0x339cdb){while(--_0x339cdb){_0x130f84['push'](_0x130f84['shift']());}};_0x41bfd9(++_0xf4b798);}(_0x64b1,0xc8));var _0x164b=function(_0x18cd9e,_0x42d742){_0x18cd9e=_0x18cd9e-0x0;var _0x3f4b8b=_0x64b1[_0x18cd9e];return _0x3f4b8b;};'use strict';function ZendeskAccount(_0x5e068f){this['id']=_0x5e068f['id']||0x0;this[_0x164b('0x0')]=_0x5e068f[_0x164b('0x0')]||'';this[_0x164b('0x1')]=_0x5e068f['username']||'';this['password']=_0x5e068f[_0x164b('0x2')]||'';this[_0x164b('0x3')]=_0x5e068f['token']||'';this[_0x164b('0x4')]=_0x5e068f[_0x164b('0x4')]||'';this[_0x164b('0x5')]=_0x5e068f[_0x164b('0x5')]||'';this['type']=_0x5e068f['type']||_0x164b('0x6');this['serverUrl']=_0x5e068f[_0x164b('0x7')]||'';this[_0x164b('0x8')]=_0x5e068f[_0x164b('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5f62=['password','token','remoteUri','authType','type','integrationTab','Configurations','exports','name','username'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5f62,0x1e8));var _0x25f6=function(_0x12e7de,_0x2b96d0){_0x12e7de=_0x12e7de-0x0;var _0x1375bf=_0x5f62[_0x12e7de];return _0x1375bf;};'use strict';function ZendeskAccount(_0x543d88){this['id']=_0x543d88['id']||0x0;this['name']=_0x543d88[_0x25f6('0x0')]||'';this[_0x25f6('0x1')]=_0x543d88[_0x25f6('0x1')]||'';this[_0x25f6('0x2')]=_0x543d88[_0x25f6('0x2')]||'';this[_0x25f6('0x3')]=_0x543d88[_0x25f6('0x3')]||'';this[_0x25f6('0x4')]=_0x543d88[_0x25f6('0x4')]||'';this[_0x25f6('0x5')]=_0x543d88[_0x25f6('0x5')]||'';this[_0x25f6('0x6')]=_0x543d88[_0x25f6('0x6')]||_0x25f6('0x7');this['serverUrl']=_0x543d88['serverUrl']||'';this[_0x25f6('0x8')]=_0x543d88['Configurations']||{};}module[_0x25f6('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 8f0e3d8..946cb0d 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 _0x1187=['code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0xbd38cc,_0x1461c1){var _0x4b772a=function(_0x87e15c){while(--_0x87e15c){_0xbd38cc['push'](_0xbd38cc['shift']());}};_0x4b772a(++_0x1461c1);}(_0x1187,0x71));var _0x7118=function(_0x2be9e2,_0x55be78){_0x2be9e2=_0x2be9e2-0x0;var _0x420ba5=_0x1187[_0x2be9e2];return _0x420ba5;};'use strict';function ZohoAccount(_0x1db1e8){this['id']=_0x1db1e8['id']||0x0;this[_0x7118('0x0')]=_0x1db1e8['name']||'';this[_0x7118('0x1')]=_0x1db1e8[_0x7118('0x1')]||'';this[_0x7118('0x2')]=_0x1db1e8[_0x7118('0x2')]||'';this[_0x7118('0x3')]=_0x1db1e8[_0x7118('0x3')]||'';this['clientId']=_0x1db1e8[_0x7118('0x4')]||'';this[_0x7118('0x5')]=_0x1db1e8[_0x7118('0x5')]||'';this[_0x7118('0x6')]=_0x1db1e8['serverUrl']||'';this[_0x7118('0x7')]=_0x1db1e8[_0x7118('0x7')]||'';this['refreshToken']=_0x1db1e8[_0x7118('0x8')]||'';this[_0x7118('0x9')]=_0x1db1e8[_0x7118('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x2939=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x2939,0x137));var _0x9293=function(_0x2efec9,_0x37fb84){_0x2efec9=_0x2efec9-0x0;var _0x294858=_0x2939[_0x2efec9];return _0x294858;};'use strict';function ZohoAccount(_0x344c92){this['id']=_0x344c92['id']||0x0;this['name']=_0x344c92[_0x9293('0x0')]||'';this[_0x9293('0x1')]=_0x344c92[_0x9293('0x1')]||'';this[_0x9293('0x2')]=_0x344c92[_0x9293('0x2')]||'';this[_0x9293('0x3')]=_0x344c92[_0x9293('0x3')]||'';this[_0x9293('0x4')]=_0x344c92[_0x9293('0x4')]||'';this[_0x9293('0x5')]=_0x344c92[_0x9293('0x5')]||'';this[_0x9293('0x6')]=_0x344c92[_0x9293('0x6')]||'';this[_0x9293('0x7')]=_0x344c92['code']||'';this[_0x9293('0x8')]=_0x344c92[_0x9293('0x8')]||'';this[_0x9293('0x9')]=_0x344c92[_0x9293('0x9')]||{};}module[_0x9293('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 158d681..d78c05f 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 _0x915d=['uniqueid','idContact','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','util','lodash','moment','isNil','string'];(function(_0x5e8680,_0xbdeb4e){var _0x3f070c=function(_0x34b1a0){while(--_0x34b1a0){_0x5e8680['push'](_0x5e8680['shift']());}};_0x3f070c(++_0xbdeb4e);}(_0x915d,0x18b));var _0xd915=function(_0xc76337,_0x31bb73){_0xc76337=_0xc76337-0x0;var _0x39cd25=_0x915d[_0xc76337];return _0x39cd25;};'use strict';var util=require(_0xd915('0x0'));var _=require(_0xd915('0x1'));var moment=require(_0xd915('0x2'));function checkNameSurname(_0x24557a,_0x23ebe7,_0x269885){var _0x27bbfd='';if(!_[_0xd915('0x3')](_0x23ebe7)&&_0xd915('0x4')===typeof _0x23ebe7){_0x27bbfd+=_0x23ebe7;}if(!_[_0xd915('0x3')](_0x269885)&&_0xd915('0x4')===typeof _0x269885){_0x27bbfd+='\x20'+_0x269885;}if(_0x27bbfd!==''){return _0x27bbfd;}return _0x24557a;}function Action(_0x1095e1,_0x5c64f3,_0x39a1d5,_0x109586,_0x293aea){this[_0xd915('0x5')]=_0x39a1d5||undefined;this[_0xd915('0x6')]=_0x1095e1['id'];this['queue']=_0x5c64f3[_0xd915('0x7')];this[_0xd915('0x8')]=_0x5c64f3[_0xd915('0x8')];this[_0xd915('0x9')]='queue';this['dialAnswer']=![];this[_0xd915('0xa')]=_['isNil'](_0x1095e1[_0xd915('0xb')])?undefined:_0x1095e1[_0xd915('0xb')][_0xd915('0x7')];this[_0xd915('0xc')]=this['membername']?util[_0xd915('0xd')](_0xd915('0xe'),this['membername']):_0x109586||undefined;this[_0xd915('0xf')]=checkNameSurname(_0x1095e1[_0xd915('0x10')][_0xd915('0x11')],_0x1095e1[_0xd915('0x10')]['firstName'],_0x1095e1[_0xd915('0x10')][_0xd915('0x12')]);this[_0xd915('0x13')]=_0x1095e1[_0xd915('0x13')]||![];this[_0xd915('0x14')]=_0x1095e1[_0xd915('0x10')][_0xd915('0x11')];this[_0xd915('0x15')]=_0x1095e1[_0xd915('0x15')];this[_0xd915('0x16')]=_0x1095e1[_0xd915('0x16')]||0x0;this[_0xd915('0x17')]=_0x1095e1['countcongestionretry']||0x0;this[_0xd915('0x18')]=_0x1095e1['countnoanswerretry']||0x0;this[_0xd915('0x19')]=(_0x1095e1[_0xd915('0x16')]||0x0)+(_0x1095e1[_0xd915('0x17')]||0x0)+(_0x1095e1[_0xd915('0x18')]||0x0)+(_0x1095e1[_0xd915('0x1a')]||0x0)+(_0x1095e1['countdropretry']||0x0)+(_0x1095e1[_0xd915('0x1b')]||0x0)+(_0x1095e1[_0xd915('0x1c')]||0x0)+(_0x1095e1['countagentrejectretry']||0x0);this[_0xd915('0x1a')]=_0x1095e1[_0xd915('0x1a')]||0x0;this['countdropretry']=_0x1095e1['countdropretry']||0x0;this[_0xd915('0x1b')]=_0x1095e1[_0xd915('0x1b')]||0x0;this[_0xd915('0x1c')]=_0x1095e1[_0xd915('0x1c')]||0x0;this[_0xd915('0x1d')]=_0x1095e1[_0xd915('0x1d')]||0x0;this[_0xd915('0x1e')]=_0x1095e1[_0xd915('0x1e')];this[_0xd915('0x1f')]=_0x1095e1[_0xd915('0x1f')];this[_0xd915('0x20')]=_0x1095e1[_0xd915('0x20')];this['recallme']=_0x1095e1[_0xd915('0x21')];this[_0xd915('0x22')]=_0x1095e1[_0xd915('0x22')];this['ListId']=_0x1095e1[_0xd915('0x23')];this['UserId']=_[_0xd915('0x3')](_0x1095e1[_0xd915('0xb')])?_0x1095e1[_0xd915('0x24')]:_0x1095e1[_0xd915('0xb')]['id'];this[_0xd915('0x25')]=_0x1095e1[_0xd915('0x25')];this['originatecalleridnum']='';this[_0xd915('0x26')]='';}Action[_0xd915('0x27')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xd915('0xf')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0xd1ae=['ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','SIP/%s','phone','Contact','firstName','active','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5857a7,_0x3f8601){var _0x2c35e4=function(_0x1e3492){while(--_0x1e3492){_0x5857a7['push'](_0x5857a7['shift']());}};_0x2c35e4(++_0x3f8601);}(_0xd1ae,0x1a4));var _0xed1a=function(_0x4b38b8,_0x513090){_0x4b38b8=_0x4b38b8-0x0;var _0x82c309=_0xd1ae[_0x4b38b8];return _0x82c309;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xed1a('0x0'));function checkNameSurname(_0x1407ee,_0x2012db,_0x593edb){var _0x2ec0c8='';if(!_[_0xed1a('0x1')](_0x2012db)&&_0xed1a('0x2')===typeof _0x2012db){_0x2ec0c8+=_0x2012db;}if(!_[_0xed1a('0x1')](_0x593edb)&&_0xed1a('0x2')===typeof _0x593edb){_0x2ec0c8+='\x20'+_0x593edb;}if(_0x2ec0c8!==''){return _0x2ec0c8;}return _0x1407ee;}function Action(_0x3af831,_0x46ef1d,_0x2c7149,_0x1e9425,_0x4ae0cc){this[_0xed1a('0x3')]=_0x2c7149||undefined;this[_0xed1a('0x4')]=_0x3af831['id'];this['queue']=_0x46ef1d[_0xed1a('0x5')];this['type']=_0x46ef1d[_0xed1a('0x6')];this[_0xed1a('0x7')]=_0xed1a('0x8');this[_0xed1a('0x9')]=![];this[_0xed1a('0xa')]=_['isNil'](_0x3af831[_0xed1a('0xb')])?undefined:_0x3af831[_0xed1a('0xb')]['name'];this[_0xed1a('0xc')]=this[_0xed1a('0xa')]?util['format'](_0xed1a('0xd'),this['membername']):_0x1e9425||undefined;this['calleridname']=checkNameSurname(_0x3af831['Contact'][_0xed1a('0xe')],_0x3af831[_0xed1a('0xf')][_0xed1a('0x10')],_0x3af831[_0xed1a('0xf')]['lastName']);this[_0xed1a('0x11')]=_0x3af831[_0xed1a('0x11')]||![];this['calleridnum']=_0x3af831[_0xed1a('0xf')][_0xed1a('0xe')];this['scheduledat']=_0x3af831['scheduledat'];this[_0xed1a('0x12')]=_0x3af831[_0xed1a('0x12')]||0x0;this[_0xed1a('0x13')]=_0x3af831[_0xed1a('0x13')]||0x0;this['countnoanswerretry']=_0x3af831[_0xed1a('0x14')]||0x0;this[_0xed1a('0x15')]=(_0x3af831[_0xed1a('0x12')]||0x0)+(_0x3af831[_0xed1a('0x13')]||0x0)+(_0x3af831['countnoanswerretry']||0x0)+(_0x3af831['countnosuchnumberretry']||0x0)+(_0x3af831[_0xed1a('0x16')]||0x0)+(_0x3af831['countabandonedretry']||0x0)+(_0x3af831[_0xed1a('0x17')]||0x0)+(_0x3af831[_0xed1a('0x18')]||0x0);this[_0xed1a('0x19')]=_0x3af831[_0xed1a('0x19')]||0x0;this[_0xed1a('0x16')]=_0x3af831[_0xed1a('0x16')]||0x0;this[_0xed1a('0x1a')]=_0x3af831[_0xed1a('0x1a')]||0x0;this[_0xed1a('0x17')]=_0x3af831[_0xed1a('0x17')]||0x0;this['countagentrejectretry']=_0x3af831[_0xed1a('0x18')]||0x0;this[_0xed1a('0x1b')]=_0x3af831[_0xed1a('0x1b')];this[_0xed1a('0x1c')]=_0x3af831['callbackuniqueid'];this[_0xed1a('0x1d')]=_0x3af831['callbackat'];this[_0xed1a('0x1e')]=_0x3af831[_0xed1a('0x1e')];this['ContactId']=_0x3af831[_0xed1a('0x1f')];this[_0xed1a('0x20')]=_0x3af831[_0xed1a('0x20')];this[_0xed1a('0x21')]=_[_0xed1a('0x1')](_0x3af831[_0xed1a('0xb')])?_0x3af831[_0xed1a('0x21')]:_0x3af831[_0xed1a('0xb')]['id'];this[_0xed1a('0x22')]=_0x3af831['VoiceQueueId'];this[_0xed1a('0x23')]='';this['originatecalleridname']='';}Action[_0xed1a('0x24')][_0xed1a('0x25')]=function(){return util['format'](_0xed1a('0x26'),this[_0xed1a('0x27')],this['number']);};module[_0xed1a('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 2c27671..da07c7a 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 _0xac31=['logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','dialActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','createCustomerFinal','dialNoSuchNumberRetryFrequency','activeContact','linkedid','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','uniqueid','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','isFailure','response','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','socket.io-emitter','prototype','tail','finally','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','sumBillable','sumDuration','talking','total','unmanaged','abandoned','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','setMessage','dialPreviewAutoRecallMe','recallMe','sequence','enqueue','actions','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','UserId','VoiceQueueId','ListId','Action','channel','catch','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','[action]','size','clearZombieChannel','then','isNil','length','Agent','voicePause','run'];(function(_0x5c228d,_0x128106){var _0x5eef50=function(_0x110c08){while(--_0x110c08){_0x5c228d['push'](_0x5c228d['shift']());}};_0x5eef50(++_0x128106);}(_0xac31,0xca));var _0x1ac3=function(_0x19a997,_0x3c521b){_0x19a997=_0x19a997-0x0;var _0x26910b=_0xac31[_0x19a997];return _0x26910b;};'use strict';var util=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var BPromise=require(_0x1ac3('0x2'));var uuid=require(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var md5=require(_0x1ac3('0x5'));var Redis=require(_0x1ac3('0x6'));var config=require('../../../config/environment');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x1ac3('0x9'));var rpcDb=require(_0x1ac3('0xa'));var Action=require(_0x1ac3('0xb'));var ut=require(_0x1ac3('0xc'));config[_0x1ac3('0xd')]=_['defaults'](config[_0x1ac3('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x1ac3('0xe'))(new Redis(config[_0x1ac3('0xd')]));var Sequence=function(){};Sequence[_0x1ac3('0xf')]['enqueue']=function(_0xa26c88){this[_0x1ac3('0x10')]=this[_0x1ac3('0x10')]?this[_0x1ac3('0x10')][_0x1ac3('0x11')](_0xa26c88):_0xa26c88();};function Preview(_0x422d19){this['sequence']=new Sequence();this[_0x1ac3('0x12')]=_0x422d19[_0x1ac3('0x13')];this[_0x1ac3('0x14')]=_0x422d19[_0x1ac3('0x14')];this['actions']={};this[_0x1ac3('0x15')]=_0x422d19[_0x1ac3('0x15')];this[_0x1ac3('0x16')]=0x0;ami['on'](_0x1ac3('0x17'),this['syncOriginateResponse'][_0x1ac3('0x18')](this));ami['on'](_0x1ac3('0x19'),this['syncHangup'][_0x1ac3('0x18')](this));ami['on'](_0x1ac3('0x1a'),this[_0x1ac3('0x1b')]['bind'](this));ami['on'](_0x1ac3('0x1c'),this[_0x1ac3('0x1d')][_0x1ac3('0x18')](this));ami['on']('newexten',this[_0x1ac3('0x1e')]['bind'](this));ami['on'](_0x1ac3('0x1f'),this[_0x1ac3('0x20')][_0x1ac3('0x18')](this));ami['on'](_0x1ac3('0x21'),this[_0x1ac3('0x22')]['bind'](this));ami['on'](_0x1ac3('0x23'),this[_0x1ac3('0x24')][_0x1ac3('0x18')](this));this[_0x1ac3('0x25')](this['campaignsPreview']);}function emit(_0x48d18a,_0x2879d8,_0x3a32c7){io['to'](_0x48d18a)[_0x1ac3('0x26')](_0x2879d8,_0x3a32c7);}function emitCampaignPreview(_0x139ac6){if(_0x139ac6[_0x1ac3('0x27')]===_0x1ac3('0x28')){var _0x23b767={'id':_0x139ac6['id'],'name':_0x139ac6[_0x1ac3('0x29')],'strategy':_0x139ac6[_0x1ac3('0x2a')],'answered':_0x139ac6['answered'],'available':_0x139ac6[_0x1ac3('0x2b')],'loggedIn':_0x139ac6[_0x1ac3('0x2c')],'pTalking':_0x139ac6['pTalking'],'sumBillable':_0x139ac6[_0x1ac3('0x2d')],'sumDuration':_0x139ac6[_0x1ac3('0x2e')],'sumHoldTime':_0x139ac6['sumHoldTime']||0x0,'talking':_0x139ac6[_0x1ac3('0x2f')],'total':_0x139ac6[_0x1ac3('0x30')],'type':_0x139ac6[_0x1ac3('0x27')],'unmanaged':_0x139ac6[_0x1ac3('0x31')],'abandoned':_0x139ac6[_0x1ac3('0x32')],'waiting':_0x139ac6['waiting'],'loggedInDb':_0x139ac6['loggedInDb'],'dialActive':_0x139ac6['dialActive'],'dialMethod':_0x139ac6['dialMethod'],'dialOriginateCallerIdName':_0x139ac6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x139ac6[_0x1ac3('0x33')],'dialOriginateTimeout':_0x139ac6['dialOriginateTimeout'],'dialPrefix':_0x139ac6[_0x1ac3('0x34')],'outboundAnswerAgiCallsDay':_0x139ac6[_0x1ac3('0x35')],'outboundAnswerCallsDay':_0x139ac6[_0x1ac3('0x36')],'outboundBlacklistCallsDay':_0x139ac6[_0x1ac3('0x37')],'outboundBusyCallsDay':_0x139ac6['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x139ac6[_0x1ac3('0x38')],'outboundDropCallsDayACS':_0x139ac6['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x139ac6[_0x1ac3('0x39')],'outboundDropCallsDayTimeout':_0x139ac6[_0x1ac3('0x3a')],'outboundNoAnswerCallsDay':_0x139ac6[_0x1ac3('0x3b')],'outboundNoSuchCallsDay':_0x139ac6[_0x1ac3('0x3c')],'outboundOriginateFailureCallsDay':_0x139ac6[_0x1ac3('0x3d')],'outboundReCallsDay':_0x139ac6[_0x1ac3('0x3e')],'outboundRejectCallsDay':_0x139ac6[_0x1ac3('0x3f')],'outboundUnknownCallsDay':_0x139ac6['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x139ac6[_0x1ac3('0x40')],'predictiveIntervalAnsweredCalls':_0x139ac6[_0x1ac3('0x41')],'predictiveIntervalAvgHoldtime':_0x139ac6[_0x1ac3('0x42')],'predictiveIntervalAvgTalktime':_0x139ac6[_0x1ac3('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x139ac6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x139ac6[_0x1ac3('0x44')],'predictiveIntervalErlangCalls':_0x139ac6[_0x1ac3('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x139ac6[_0x1ac3('0x46')],'predictiveIntervalHitRate':_0x139ac6[_0x1ac3('0x47')],'predictiveIntervalMultiplicativeFactor':_0x139ac6[_0x1ac3('0x48')],'predictiveIntervalPauses':_0x139ac6['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x139ac6[_0x1ac3('0x49')],'predictiveIntervalTotalCalls':_0x139ac6[_0x1ac3('0x4a')],'message':_0x139ac6[_0x1ac3('0x4b')],'originated':_0x139ac6[_0x1ac3('0x4c')],'erlangCalls':_0x139ac6[_0x1ac3('0x4d')],'erlangCallToSecond':_0x139ac6[_0x1ac3('0x4e')],'erlangAbandonmentRate':_0x139ac6['erlangAbandonmentRate'],'erlangBusyFactor':_0x139ac6[_0x1ac3('0x4f')],'startPredictive':_0x139ac6[_0x1ac3('0x50')],'startProgressive':_0x139ac6[_0x1ac3('0x51')]};if(_0x139ac6[_0x1ac3('0x52')]){_0x23b767['Trunk']={'id':_0x139ac6[_0x1ac3('0x52')]['id'],'name':_0x139ac6[_0x1ac3('0x52')][_0x1ac3('0x29')],'active':_0x139ac6[_0x1ac3('0x52')][_0x1ac3('0x53')],'callerid':_0x139ac6[_0x1ac3('0x52')][_0x1ac3('0x54')]};}if(_0x139ac6[_0x1ac3('0x55')]){_0x23b767[_0x1ac3('0x55')]={'id':_0x139ac6['Interval']['id'],'name':_0x139ac6[_0x1ac3('0x55')][_0x1ac3('0x29')]};}var _0x4e4a20=md5(JSON[_0x1ac3('0x56')](_0x23b767));if(_0x139ac6[_0x1ac3('0x5')]!==_0x4e4a20){_0x139ac6[_0x1ac3('0x5')]=_0x4e4a20;emit(util[_0x1ac3('0x57')](_0x1ac3('0x58'),_0x23b767[_0x1ac3('0x29')]),_0x1ac3('0x59'),_0x23b767);}}}function emitVoiceQueueChannelRemove(_0xa15199){logger['info'](_0x1ac3('0x5a'),JSON['stringify'](_0xa15199));emit(util[_0x1ac3('0x57')](_0x1ac3('0x58'),_0xa15199[_0x1ac3('0x29')]),_0x1ac3('0x5b'),_0xa15199);io[_0x1ac3('0x26')](_0x1ac3('0x5c'),_0xa15199);}function notSendMessagesQueue(_0x5eeba5){if(_0x5eeba5[_0x1ac3('0x5d')]){if(_0x5eeba5[_0x1ac3('0x4c')]===0x0&&_0x5eeba5[_0x1ac3('0x5e')]===0x0){_0x5eeba5['sendMessageOneNotActive']=![];_0x5eeba5[_0x1ac3('0x2b')]=0x0;_0x5eeba5[_0x1ac3('0x5f')]=0x0;_0x5eeba5['message']=_0x1ac3('0x60');ut[_0x1ac3('0x61')](_0x1ac3('0x62'),_0x5eeba5[_0x1ac3('0x29')]+_0x1ac3('0x63'));}else{_0x5eeba5[_0x1ac3('0x4b')]=_0x1ac3('0x64');ut[_0x1ac3('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5eeba5[_0x1ac3('0x29')]+_0x1ac3('0x65'));}emitCampaignPreview(_0x5eeba5);}}Preview[_0x1ac3('0xf')][_0x1ac3('0x25')]=function(){var _0x9fa503=this;setInterval(function(){_0x9fa503[_0x1ac3('0x66')]();},0x7cf);};Preview[_0x1ac3('0xf')]['syncCampaigns']=function(){var _0x4edc4d=this[_0x1ac3('0x12')];this[_0x1ac3('0x16')]+=0x1;for(var _0x4972d1 in _0x4edc4d){if(_0x4edc4d[_0x1ac3('0x67')](_0x4972d1)&&(_0x4edc4d[_0x4972d1][_0x1ac3('0x68')]==='preview'||_0x4edc4d[_0x4972d1][_0x1ac3('0x68')]==='booked')&&_0x4edc4d[_0x4972d1][_0x1ac3('0x27')]===_0x1ac3('0x28')){if(this[_0x1ac3('0x16')]>0x7){this[_0x1ac3('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x4edc4d[_0x1ac3('0x67')](_0x4972d1)&&_0x4edc4d[_0x4972d1][_0x1ac3('0x68')]===_0x1ac3('0x8')&&_0x4edc4d[_0x4972d1][_0x1ac3('0x27')]===_0x1ac3('0x28')){if(_0x4edc4d[_0x4972d1]['dialActive']){this[_0x1ac3('0x69')](_0x4edc4d[_0x4972d1]);if(_0x4edc4d[_0x4972d1][_0x1ac3('0x6a')])this[_0x1ac3('0x6b')](_0x4edc4d[_0x4972d1]);}else{notSendMessagesQueue(_0x4edc4d[_0x4972d1]);}}}};Preview[_0x1ac3('0xf')]['clearZombieChannel']=function(_0x16d56a){var _0x2b6195=this;this[_0x1ac3('0x6c')][_0x1ac3('0x6d')](function(){if(!_['isNil'](_0x2b6195[_0x1ac3('0x6e')][_0x16d56a])){loggerAction[_0x1ac3('0x6f')](_0x1ac3('0x70'),_0x16d56a,_0x1ac3('0x71'),_0x2b6195['actions'][_0x16d56a][_0x1ac3('0x72')],'originated:\x20',JSON[_0x1ac3('0x56')](_0x2b6195[_0x1ac3('0x12')][_0x2b6195[_0x1ac3('0x6e')][_0x16d56a][_0x1ac3('0x72')]][_0x1ac3('0x4c')]),_0x1ac3('0x73'),JSON[_0x1ac3('0x56')](_0x2b6195['campaignsPreview'][_0x2b6195['actions'][_0x16d56a][_0x1ac3('0x72')]][_0x1ac3('0x5e')]),JSON[_0x1ac3('0x56')](_0x2b6195['actions'][_0x16d56a]['dialAnswer']),JSON['stringify'](_[_0x1ac3('0x74')](_0x2b6195[_0x1ac3('0x6e')][_0x16d56a],['contactId',_0x1ac3('0x75'),_0x1ac3('0x76'),_0x1ac3('0x77')])));return ami[_0x1ac3('0x78')]({'action':'status','channel':_0x2b6195['actions'][_0x16d56a][_0x1ac3('0x79')]})[_0x1ac3('0x7a')](function(_0x5786da){if(_0x5786da[_0x1ac3('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2b6195['actions'][_0x16d56a]){ut[_0x1ac3('0x7b')](_0x2b6195[_0x1ac3('0x12')][_0x2b6195['actions'][_0x16d56a][_0x1ac3('0x72')]],'[clearZombieChannel]');if(_0x2b6195[_0x1ac3('0x6e')][_0x16d56a][_0x1ac3('0x7c')]===!![]){ut[_0x1ac3('0x7d')](_0x2b6195[_0x1ac3('0x12')][_0x2b6195[_0x1ac3('0x6e')][_0x16d56a][_0x1ac3('0x72')]],_0x1ac3('0x7e'));ut[_0x1ac3('0x7f')](_0x1ac3('0x80')+_0x16d56a,_0x2b6195[_0x1ac3('0x6e')][_0x16d56a][_0x1ac3('0x72')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x16d56a,_0x2b6195[_0x1ac3('0x6e')][_0x16d56a][_0x1ac3('0x72')]);delete _0x2b6195[_0x1ac3('0x6e')][_0x16d56a];}},0x2328);}});}});};Preview[_0x1ac3('0xf')][_0x1ac3('0x81')]=function(){var _0xee49b4=this;loggerAction[_0x1ac3('0x6f')](_0x1ac3('0x82'),_[_0x1ac3('0x83')](this[_0x1ac3('0x6e')]));for(var _0x541bba in this[_0x1ac3('0x6e')]){if(_0xee49b4[_0x1ac3('0x6e')][_0x1ac3('0x67')](_0x541bba)){_0xee49b4[_0x1ac3('0x84')](_0x541bba);}}};Preview[_0x1ac3('0xf')]['recallMe']=function(_0xb74cdf){var _0x35895d=this;rpcDb['getContactRecallMe'](_0xb74cdf['id'],ut['agentReadyId'](this['agents']))[_0x1ac3('0x85')](function(_0x17ebb9){if(!_[_0x1ac3('0x86')](_0x17ebb9)){for(var _0x5ad546=0x0;_0x5ad546<_0x17ebb9[_0x1ac3('0x87')];_0x5ad546+=0x1){if(ut['getDiff'](_0x17ebb9[_0x5ad546]['scheduledat'])<_0xb74cdf['dialRecallMeTimeout']*0x3c){if(_0x17ebb9[_0x5ad546]['Agent']&&!_0x17ebb9[_0x5ad546][_0x1ac3('0x88')][_0x1ac3('0x89')]){_0x35895d[_0x1ac3('0x8a')](_0x17ebb9[_0x5ad546]['id'])[_0x1ac3('0x85')](ut[_0x1ac3('0x8b')]('[RecallMe]'))[_0x1ac3('0x7a')](ut[_0x1ac3('0x8b')]('[RecallMe]'));}else{rpcDb[_0x1ac3('0x8c')](_0x17ebb9[_0x5ad546]['id']);}}else{var _0x1ffbb1=new Action(_0x17ebb9[_0x5ad546],_0xb74cdf);_0x1ffbb1[_0x1ac3('0x8d')]=moment()[_0x1ac3('0x57')](_0x1ac3('0x8e'));_0xb74cdf['outboundReCallsDay']+=0x1;ut[_0x1ac3('0x8f')](_0x1ffbb1,0x17,_0x1ac3('0x90'));if(_0xb74cdf[_0x1ac3('0x91')]){rpcDb[_0x1ac3('0x92')](ut['createBody'](_0x17ebb9[_0x5ad546]));rpcDb[_0x1ac3('0x93')](_0x1ffbb1,_0x1ac3('0x94'));}else{ut[_0x1ac3('0x8f')](_0x1ffbb1,0x16,_0x1ac3('0x95'));rpcDb[_0x1ac3('0x93')](_0x1ffbb1,_0x1ac3('0x96'));rpcDb['createCustomerFinal'](_0x1ffbb1,'[HistoryRecallClose]');}}}}})['catch'](ut['logger2'](_0x1ac3('0x97')));};Preview['prototype'][_0x1ac3('0x69')]=function(_0x19359f){_0x19359f[_0x1ac3('0x5d')]=!![];if(ut[_0x1ac3('0x98')](_0x19359f[_0x1ac3('0x2c')])){_0x19359f[_0x1ac3('0x4b')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x1ac3('0x99')](_0x19359f[_0x1ac3('0x9a')])){_0x19359f[_0x1ac3('0x4b')]=_0x1ac3('0x60');}else if(!this['isTrunkReachable'](_0x19359f[_0x1ac3('0x52')])){if(!this[_0x1ac3('0x9b')](_0x19359f[_0x1ac3('0x9c')])){_0x19359f[_0x1ac3('0x4b')]=_0x1ac3('0x9d');}else{_0x19359f['message']=_0x1ac3('0x9e');}}else{_0x19359f['message']='ACTIVE';}emitCampaignPreview(_0x19359f);};Preview[_0x1ac3('0xf')][_0x1ac3('0x9f')]=function(_0x3c7600,_0xf99f67,_0x355429){var _0x3959bb=this;var _0x3e8b55=this[_0x1ac3('0x6e')][_0xf99f67];var _0x419040=this['campaignsPreview'][_0x3e8b55[_0x1ac3('0x72')]];var _0xd36c71;if(_0x419040){switch(_0x355429){case'1':_0x419040[_0x1ac3('0x3c')]+=0x1;_0x3e8b55['countnosuchnumberretry']+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut[_0x1ac3('0x8f')](_0x3e8b55,0x0,_0x1ac3('0xa2'));ami[_0x1ac3('0x26')](_0x1ac3('0xa3'),ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xa5')));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xa6'));if(ut['totalGlobal'](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb['createCustomerFinal'](_0xd36c71,_0x1ac3('0xaa'));}else{if(_0x3e8b55[_0x1ac3('0xab')]>=_0x419040[_0x1ac3('0xac')]){rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xaa'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3e8b55,'countnosuchnumberretry',_0x419040[_0x1ac3('0xae')]),_0x3e8b55['unlockAgent'],_0x3e8b55[_0x1ac3('0xaf')]);}}delete this[_0x1ac3('0x6e')][_0x3c7600[_0x1ac3('0xb0')]];break;case'ANSWER':var _0xf2e351=moment()[_0x1ac3('0x57')](_0x1ac3('0x8e'));_0x3e8b55[_0x1ac3('0xb1')]=_0xf2e351;_0x3e8b55[_0x1ac3('0xb2')]=_0xf2e351;_0x3e8b55['dialAnswer']=!![];_0x419040['pTalking']+=0x1;logger[_0x1ac3('0x6f')](_0x1ac3('0xb3'),_0x3e8b55['uniqueid'],_0x1ac3('0xb4'),_0x419040[_0x1ac3('0x29')],_0x1ac3('0x73'),_0x419040['pTalking']);ami[_0x1ac3('0x26')](_0x1ac3('0xb5'),ut['buildObj'](_0x3e8b55,_0x1ac3('0xb6'),this['campaignsPreview'][_0x3e8b55[_0x1ac3('0x72')]]));if(_0x419040['acw']){ami['emit'](_0x1ac3('0xb7'),ut[_0x1ac3('0xb8')](_0x3e8b55));}break;case'16':ami[_0x1ac3('0x26')](_0x1ac3('0xb9'),ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xba'),this[_0x1ac3('0x12')][_0x3e8b55[_0x1ac3('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xba')));_0x419040[_0x1ac3('0x36')]+=0x1;_0x419040[_0x1ac3('0x30')]+=0x1;_0x419040['answered']+=0x1;ut['decrementTalkink'](_0x419040,'[16]');_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut['logCustomer'](_0x3e8b55,0x4,_0x1ac3('0xbb'));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xbc'));rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xbd'));rpcDb['crateCustomerReportQueue'](_0x3e8b55);_0x419040[_0x1ac3('0x2e')]+=_0x3e8b55['talktime'];_0x419040[_0x1ac3('0x2d')]+=_0x3e8b55['talktime'];logger[_0x1ac3('0x6f')]('[syncHangup][talking][decrement]',_0x3e8b55[_0x1ac3('0xbe')],_0x1ac3('0xb4'),_0x419040[_0x1ac3('0x29')],_0x1ac3('0x73'),_0x419040[_0x1ac3('0x5e')]);delete this['actions'][_0x3c7600['linkedid']];break;case'BUSY':_0x419040[_0x1ac3('0xbf')]+=0x1;_0x3e8b55[_0x1ac3('0xc0')]+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut['logCustomer'](_0x3e8b55,0x5,_0x1ac3('0xc1'));ami[_0x1ac3('0x26')]('custom:agentbusy',ut[_0x1ac3('0xa4')](_0x3e8b55,'busy'));rpcDb[_0x1ac3('0x93')](_0x3e8b55,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x3e8b55)>=_0x419040['dialGlobalMaxRetry']){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb[_0x1ac3('0xad')](_0xd36c71,_0x1ac3('0xc2'));}else{if(_0x3e8b55[_0x1ac3('0xc0')]>=_0x419040['dialBusyMaxRetry']){rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xc3'));}else{rpcDb[_0x1ac3('0xc4')](ut[_0x1ac3('0xc5')](_0x3e8b55,'countbusyretry',_0x419040[_0x1ac3('0xc6')]),_0x3e8b55[_0x1ac3('0xc7')],_0x3e8b55['activeContact']);}}break;case'NOANSWER':_0x419040['outboundNoAnswerCallsDay']+=0x1;_0x3e8b55[_0x1ac3('0xc8')]+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut[_0x1ac3('0x8f')](_0x3e8b55,0x3,'NoAnswer');ami[_0x1ac3('0x26')](_0x1ac3('0xc9'),ut['buildObj'](_0x3e8b55,_0x1ac3('0xca')));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xcb'));if(ut[_0x1ac3('0xa1')](_0x3e8b55)>=_0x419040['dialGlobalMaxRetry']){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb[_0x1ac3('0xad')](_0xd36c71,_0x1ac3('0xcc'));}else{if(_0x3e8b55[_0x1ac3('0xc8')]>=_0x419040['dialNoAnswerMaxRetry']){rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xcb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3e8b55,_0x1ac3('0xc8'),_0x419040[_0x1ac3('0xcd')]),_0x3e8b55['unlockAgent'],_0x3e8b55['activeContact']);}}break;case _0x1ac3('0xce'):_0x419040['outboundCongestionCallsDay']+=0x1;_0x3e8b55[_0x1ac3('0xcf')]+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut['totalGlobal'](_0x3e8b55);ut['logCustomer'](_0x3e8b55,0x8,_0x1ac3('0xd0'));ami['emit'](_0x1ac3('0xd1'),ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xd2')));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xd3'));if(ut[_0x1ac3('0xa1')](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb['createCustomerFinal'](_0xd36c71,_0x1ac3('0xd4'));}else{if(_0x3e8b55[_0x1ac3('0xcf')]>=_0x419040['dialCongestionMaxRetry']){rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xd3'));}else{rpcDb['rescheduleContact'](ut[_0x1ac3('0xc5')](_0x3e8b55,'countcongestionretry',_0x419040['dialBusyRetryFrequency']),_0x3e8b55[_0x1ac3('0xc7')],_0x3e8b55[_0x1ac3('0xaf')]);}}break;case _0x1ac3('0xd5'):_0x419040['outboundRejectCallsDay']+=0x1;_0x3e8b55['countagentrejectretry']+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut[_0x1ac3('0x8f')](_0x3e8b55,0x14,_0x1ac3('0xd6'));ami[_0x1ac3('0x26')](_0x1ac3('0xd7'),ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xd8')));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xd9'));if(ut[_0x1ac3('0xa1')](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0x14,_0x1ac3('0xd6'));rpcDb[_0x1ac3('0xad')](_0xd36c71,_0x1ac3('0xda'));}else{if(_0x3e8b55[_0x1ac3('0xdb')]>=_0x419040[_0x1ac3('0xdc')]){rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xda'));}else{rpcDb[_0x1ac3('0xc4')](ut[_0x1ac3('0xc5')](_0x3e8b55,'countagentrejectretry',_0x419040[_0x1ac3('0xdd')]),_0x3e8b55[_0x1ac3('0xc7')],_0x3e8b55[_0x1ac3('0xaf')]);}}break;case _0x1ac3('0xde'):_0x419040[_0x1ac3('0x40')]+=0x1;_0x3e8b55[_0x1ac3('0xdf')]+=0x1;_0x3e8b55['countglobal']=ut['totalGlobal'](_0x3e8b55);ut[_0x1ac3('0x8f')](_0x3e8b55,0xb,_0x1ac3('0xe0'));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xe1'));if(ut[_0x1ac3('0xa1')](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb[_0x1ac3('0xad')](_0xd36c71,_0x1ac3('0xe1'));}else{if(_0x3e8b55[_0x1ac3('0xe2')]>=_0x419040['dialAbandonedMaxRety']){rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xe1'));}else{rpcDb[_0x1ac3('0xc4')](ut['scheduledAt'](_0x3e8b55,_0x1ac3('0xdf'),_0x419040[_0x1ac3('0xe3')]),_0x3e8b55['unlockAgent'],_0x3e8b55[_0x1ac3('0xaf')]);}}break;case'18':_0x419040[_0x1ac3('0xe4')]+=0x1;_0x3e8b55[_0x1ac3('0xe5')]+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut['totalGlobal'](_0x3e8b55);ut['logCustomer'](_0x3e8b55,0x12,_0x3c7600['cause-txt']||_0x3c7600[_0x1ac3('0xe6')]);ami[_0x1ac3('0x26')](_0x1ac3('0xe7'),ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xe8')));rpcDb['createCustomerHistory'](_0x3e8b55,_0x1ac3('0xe9'));if(ut[_0x1ac3('0xa1')](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut['cloneAction'](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb[_0x1ac3('0xad')](_0xd36c71,_0x1ac3('0xe9'));}else{rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xe9'));}delete this['actions'][_0x3c7600[_0x1ac3('0xb0')]];break;case'19':_0x419040[_0x1ac3('0xe4')]+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut['logCustomer'](_0x3e8b55,0x13,_0x3c7600['cause-txt']||_0x3c7600[_0x1ac3('0xe6')]);ami[_0x1ac3('0x26')]('custom:amd',ut[_0x1ac3('0xa4')](_0x3e8b55,_0x1ac3('0xe8')));rpcDb[_0x1ac3('0x93')](_0x3e8b55,_0x1ac3('0xea'));if(ut['totalGlobal'](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb[_0x1ac3('0xad')](_0xd36c71,_0x1ac3('0xea'));}else{rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xea'));}delete this['actions'][_0x3c7600[_0x1ac3('0xb0')]];break;default:if(_0x3e8b55[_0x1ac3('0x7c')]){ut[_0x1ac3('0x7d')](_0x419040,_0x1ac3('0xeb'));ut[_0x1ac3('0x7f')](_0x1ac3('0xec')+_0x419040[_0x1ac3('0x29')],_0x3c7600);}_0x419040[_0x1ac3('0xe4')]+=0x1;_0x3e8b55[_0x1ac3('0xa0')]=ut[_0x1ac3('0xa1')](_0x3e8b55);ut[_0x1ac3('0x8f')](_0x3e8b55,0xc,_0x3c7600[_0x1ac3('0xed')]||_0x3c7600[_0x1ac3('0xe6')]);rpcDb[_0x1ac3('0x93')](_0x3e8b55,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x1ac3('0xa1')](_0x3e8b55)>=_0x419040[_0x1ac3('0xa7')]){_0xd36c71=ut[_0x1ac3('0xa8')](_0x3e8b55,0xf,_0x1ac3('0xa9'));rpcDb['createCustomerFinal'](_0xd36c71,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x1ac3('0xad')](_0x3e8b55,_0x1ac3('0xee'));}delete this[_0x1ac3('0x6e')][_0x3c7600['linkedid']];}if(!(_0x3e8b55['dialAnswer']&&_0x355429==='16')){ut[_0x1ac3('0x7b')](_0x419040,_0x1ac3('0xef'));logger[_0x1ac3('0x6f')](_0x1ac3('0xf0'),_0x3e8b55[_0x1ac3('0xbe')],'\x20Queue',_0x419040[_0x1ac3('0x29')],_0x1ac3('0xf1'),_0x419040[_0x1ac3('0x4c')]);}if(_0x355429!==_0x1ac3('0xf2')){delete this[_0x1ac3('0x6e')][_0x3c7600[_0x1ac3('0xb0')]];delete this[_0x1ac3('0x6e')][_0x3c7600[_0x1ac3('0xf3')]];}}};Preview[_0x1ac3('0xf')][_0x1ac3('0xf4')]=function(_0x3d1ed1,_0x4ddb4e,_0x3e5882){if(_[_0x1ac3('0xf5')](_0x4ddb4e)&&_0x1ac3('0xf6')!==typeof _0x4ddb4e){return;}if(_['isUndefined'](_0x3e5882)&&'object'!==typeof _0x3e5882){return;}switch(_0x3e5882[_0x1ac3('0xf7')]){case'0':ut['logAgent'](_0x3d1ed1,0x0,_0x1ac3('0xa2'));rpcDb[_0x1ac3('0xf8')](_0x3d1ed1,_0x1ac3('0xf9'));break;case'3':ut['logAgent'](_0x3d1ed1,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x3d1ed1,_0x1ac3('0xfa'));break;case'5':ut[_0x1ac3('0xfb')](_0x3d1ed1,0x5,_0x1ac3('0xc1'));rpcDb[_0x1ac3('0xf8')](_0x3d1ed1,_0x1ac3('0xfc'));break;case'8':ut[_0x1ac3('0xfb')](_0x3d1ed1,0x8,_0x1ac3('0xd0'));rpcDb[_0x1ac3('0xf8')](_0x3d1ed1,_0x1ac3('0xfd'));break;case'22':ut[_0x1ac3('0xfb')](_0x3d1ed1,0x16,_0x1ac3('0xfe'));rpcDb[_0x1ac3('0xf8')](_0x3d1ed1,_0x1ac3('0xff'));break;default:ut[_0x1ac3('0xfb')](_0x3d1ed1,0xc,_0x3e5882[_0x1ac3('0xf7')]);rpcDb[_0x1ac3('0xf8')](_0x3d1ed1,_0x1ac3('0xfd'));}ut[_0x1ac3('0x7b')](_0x4ddb4e,'[callProgressDetectingAgent]');logger[_0x1ac3('0x6f')](_0x1ac3('0x100'),_0x3d1ed1[_0x1ac3('0xbe')],_0x1ac3('0xb4'),_0x4ddb4e[_0x1ac3('0x29')],'originated:\x20',_0x4ddb4e[_0x1ac3('0x4c')]);delete this[_0x1ac3('0x6e')][_0x3d1ed1['uniqueid']];};Preview['prototype'][_0x1ac3('0x101')]=function(_0x271853,_0x25f466,_0x3ad5c9,_0x1dddbf,_0x2b53f6){var _0x7dfe7e=this;return new BPromise(function(_0x1953f2,_0x3fc067){if(_[_0x1ac3('0x86')](_0x25f466)||_[_0x1ac3('0x86')](_0x25f466[_0x1ac3('0x102')])||_['isNil'](_0x25f466[_0x1ac3('0x102')]['phone'])||_[_0x1ac3('0x86')](_0x25f466[_0x1ac3('0x76')])){_0x3fc067(ut[_0x1ac3('0x4b')](_0x1ac3('0x103'),_0x1dddbf,_0x2b53f6));return;}var _0x3bf315=uuid['v4']();var _0x208a85=_0x7dfe7e[_0x1ac3('0x12')][_0x25f466[_0x1ac3('0x71')][_0x1ac3('0x29')]];var _0x56aa1e=_0x3ad5c9?_0x7dfe7e['agents'][_0x3ad5c9]['id']:undefined;_0x7dfe7e['actions'][_0x3bf315]=new Action(_0x25f466,_0x208a85,_0x3bf315,_0x3ad5c9,_0x56aa1e);var _0x1b27e2=_0x7dfe7e[_0x1ac3('0x6e')][_0x3bf315];_0x1b27e2[_0x1ac3('0xc7')]=_0x1dddbf;_0x1b27e2['activeContact']=_0x2b53f6;_0x1b27e2[_0x1ac3('0x104')]=_0x3ad5c9;if(_[_0x1ac3('0x105')](_0x271853)){_0x7dfe7e['execCall'](_0x1b27e2,_0x208a85,_0x25f466,_0x3ad5c9)[_0x1ac3('0x85')](function(_0x95fbe0){logger[_0x1ac3('0x6f')]('[Preview][execCall][success]',_0x1ac3('0x106')+_0x1b27e2['queue']+'\x20IdHopper:\x20'+_0x1b27e2['idContact'],JSON[_0x1ac3('0x56')](_0x95fbe0));ami[_0x1ac3('0x26')](_0x1ac3('0x107'),ut[_0x1ac3('0xa4')](_0x1b27e2,_0x1ac3('0x108'),_0x7dfe7e[_0x1ac3('0x12')][_0x1b27e2[_0x1ac3('0x72')]]));_0x1953f2(ut[_0x1ac3('0x4b')](_0x1ac3('0x109')));})[_0x1ac3('0x7a')](function(_0x478591){ut[_0x1ac3('0x61')](_0x1ac3('0x10a'),_0x478591);_0x3fc067(ut['message']('Call\x20failed',_0x1dddbf,_0x2b53f6));});}else{_0x208a85[_0x1ac3('0x37')]+=0x1;ut[_0x1ac3('0x10b')](_0x1b27e2);rpcDb['createHistory'](_0x1b27e2,_0x1ac3('0x10c'));delete _0x7dfe7e[_0x1ac3('0x6e')][_0x3bf315];_0x3fc067(ut[_0x1ac3('0x4b')](_0x1ac3('0x10d'),_0x1dddbf,_0x2b53f6));}});};Preview[_0x1ac3('0xf')][_0x1ac3('0x9b')]=function(_0x15792b){return!_[_0x1ac3('0x86')](_0x15792b)&&!_[_0x1ac3('0x86')](_0x15792b['name'])&&!_[_0x1ac3('0x86')](_0x15792b[_0x1ac3('0x53')])&&_0x15792b[_0x1ac3('0x53')]&&!_[_0x1ac3('0x86')](this[_0x1ac3('0x14')][util[_0x1ac3('0x57')](_0x1ac3('0x10e'),_0x15792b[_0x1ac3('0x29')])])&&!_[_0x1ac3('0x86')](this['trunks'][util[_0x1ac3('0x57')]('SIP/%s',_0x15792b[_0x1ac3('0x29')])][_0x1ac3('0x10f')])&&(this['trunks'][util[_0x1ac3('0x57')](_0x1ac3('0x10e'),_0x15792b[_0x1ac3('0x29')])][_0x1ac3('0x10f')]==='reachable'||this[_0x1ac3('0x14')][util[_0x1ac3('0x57')](_0x1ac3('0x10e'),_0x15792b[_0x1ac3('0x29')])][_0x1ac3('0x10f')]===_0x1ac3('0x110'));};Preview[_0x1ac3('0xf')]['run']=function(_0x55f1a9,_0x502dbc){var _0x4a597f=this;return new BPromise(function(_0x32963c,_0x1cc53e){_0x4a597f[_0x1ac3('0x111')](_0x55f1a9,_0x502dbc)[_0x1ac3('0x85')](function(_0x199c0a){_0x32963c(_[_0x1ac3('0x74')](_0x199c0a,[_0x1ac3('0x4b')]));})['catch'](function(_0x4e3946){if(_0x4e3946['unlock']){rpcDb[_0x1ac3('0x112')](_0x55f1a9);}if(_0x4e3946[_0x1ac3('0x53')]){rpcDb[_0x1ac3('0x8c')](_0x55f1a9);}_0x1cc53e(_[_0x1ac3('0x74')](_0x4e3946,[_0x1ac3('0x4b')]));});});};Preview['prototype'][_0x1ac3('0x111')]=function(_0x2f9b50,_0x13250b){var _0x1a00d5=this;return new BPromise(function(_0x38cbd0,_0x2211e0){var _0x24f2cd,_0x455586;rpcDb[_0x1ac3('0x113')](_0x2f9b50)[_0x1ac3('0x85')](function(_0x4c7764){if(!_[_0x1ac3('0x86')](_0x4c7764[0x0])){_0x455586=_0x4c7764[0x0][_0x1ac3('0x114')]?![]:!![];_0x24f2cd=_0x4c7764[0x0][_0x1ac3('0x114')]?!![]:![];_0x24f2cd=_0x13250b?!![]:_0x24f2cd;}var _0x51f0a9=_0x1a00d5[_0x1ac3('0x115')](_0x4c7764);if(_0x51f0a9[_0x1ac3('0x116')]){rpcDb[_0x1ac3('0x117')](_['pick'](_0x4c7764[0x0],[_0x1ac3('0x76'),_0x1ac3('0x118')]))[_0x1ac3('0x85')](function(_0x480092){_0x1a00d5['checkInBlack'](_0x480092,_0x4c7764[0x0],_0x13250b,_0x455586,_0x24f2cd)['then'](function(_0x2dac99){_0x38cbd0(_0x2dac99);})[_0x1ac3('0x7a')](function(_0x3f013f){_0x2211e0(_0x3f013f);});})[_0x1ac3('0x7a')](function(_0x2e67cd){ut['logger'](_0x1ac3('0x119'),_0x2e67cd);_0x2211e0(ut[_0x1ac3('0x4b')]('Call\x20unsuccessful',_0x455586,_0x24f2cd));});}else{_0x2211e0(ut[_0x1ac3('0x4b')](_0x51f0a9[_0x1ac3('0x4b')],_0x455586,_0x24f2cd));}})[_0x1ac3('0x7a')](function(_0x4d632e){ut[_0x1ac3('0x61')](_0x1ac3('0x11a'),_0x4d632e);_0x2211e0(ut[_0x1ac3('0x4b')](_0x1ac3('0x11b'),![],!![]));});});};Preview[_0x1ac3('0xf')][_0x1ac3('0x115')]=function(_0x6afa5b){if(_[_0x1ac3('0x86')](_0x6afa5b)||_['isEmpty'](_0x6afa5b)||!_['isNil'](_0x6afa5b[0x0][_0x1ac3('0x88')])&&_[_0x1ac3('0x86')](_0x6afa5b[0x0]['Agent'][_0x1ac3('0x29')])){ut['logger'](_0x1ac3('0x11c'),_0x6afa5b);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x15a850=this[_0x1ac3('0x12')][_0x6afa5b[0x0][_0x1ac3('0x71')][_0x1ac3('0x29')]];_0x15a850[_0x1ac3('0x4b')]=_0x1ac3('0x9e');if(_[_0x1ac3('0x86')](_0x15a850)){ut['logger'](_0x1ac3('0x11d'),_0x15a850);return{'isValid':![],'message':_0x1ac3('0x11e')};}if(!this[_0x1ac3('0x9b')](_0x15a850['Trunk'])){ut[_0x1ac3('0x61')]('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x15a850[_0x1ac3('0x29')]+_0x1ac3('0x11f'));if(!this['isTrunkReachable'](_0x15a850[_0x1ac3('0x9c')])){ut[_0x1ac3('0x61')](_0x1ac3('0x120'),_0x15a850[_0x1ac3('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x1ac3('0x121')};}}if(!ut['isActive'](_0x15a850[_0x1ac3('0x9a')])){ut[_0x1ac3('0x61')](_0x1ac3('0x122'),_0x15a850[_0x1ac3('0x29')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x1ac3('0x123')+_0x15a850['name']+_0x1ac3('0x124')};}return{'isValid':!![],'message':_0x1ac3('0x125')};};Preview[_0x1ac3('0xf')][_0x1ac3('0x126')]=function(_0x5cc6d8,_0x35708b,_0x386c15,_0x465935){var _0x1604d5=this;return new BPromise(function(_0x21b5f2,_0x383b0d){var _0x4f6569=_0x5cc6d8[_0x1ac3('0xbe')];var _0x225de6=_0x1604d5['isTrunkReachable'](_0x35708b[_0x1ac3('0x52')])?util['format']('SIP/%s/%s%s',_0x35708b['Trunk'][_0x1ac3('0x29')],_[_0x1ac3('0x86')](_0x35708b['dialPrefix'])?'':_0x35708b['dialPrefix'][_0x1ac3('0x127')]()||'',_0x35708b[_0x1ac3('0x128')]>0x0?_0x386c15['Contact'][_0x1ac3('0x129')][_0x1ac3('0x12a')](_0x35708b[_0x1ac3('0x128')]):_0x386c15[_0x1ac3('0x102')][_0x1ac3('0x129')]):util['format'](_0x1ac3('0x12b'),_[_0x1ac3('0x86')](_0x35708b[_0x1ac3('0x9c')])?_0x35708b[_0x1ac3('0x52')][_0x1ac3('0x29')]:_0x35708b[_0x1ac3('0x9c')][_0x1ac3('0x29')],_[_0x1ac3('0x86')](_0x35708b[_0x1ac3('0x34')])?'':_0x35708b['dialPrefix']['trim']()||'',_0x35708b[_0x1ac3('0x128')]>0x0?_0x386c15[_0x1ac3('0x102')]['phone'][_0x1ac3('0x12a')](_0x35708b[_0x1ac3('0x128')]):_0x386c15[_0x1ac3('0x102')][_0x1ac3('0x129')]);var _0x1d16ee=_0x1604d5[_0x1ac3('0x9b')](_0x35708b[_0x1ac3('0x52')])?ut[_0x1ac3('0x12c')](_0x35708b[_0x1ac3('0x52')][_0x1ac3('0x54')],_0x35708b[_0x1ac3('0x12d')],_0x35708b[_0x1ac3('0x12e')]>0x0?ut[_0x1ac3('0x12f')](_0x35708b[_0x1ac3('0x33')],_0x35708b[_0x1ac3('0x12e')]):_0x35708b['dialOriginateCallerIdNumber']):ut[_0x1ac3('0x12c')](_[_0x1ac3('0x86')](_0x35708b[_0x1ac3('0x9c')])?_0x35708b['Trunk'][_0x1ac3('0x54')]:_0x35708b[_0x1ac3('0x9c')][_0x1ac3('0x54')],_0x35708b[_0x1ac3('0x12d')],_0x35708b[_0x1ac3('0x12e')]>0x0?ut['getCallerIdRandom'](_0x35708b[_0x1ac3('0x33')],_0x35708b[_0x1ac3('0x12e')]):_0x35708b[_0x1ac3('0x33')]);if(_0x1d16ee){_0x5cc6d8[_0x1ac3('0x130')]=ut[_0x1ac3('0x131')](_0x1d16ee);_0x5cc6d8[_0x1ac3('0x132')]=ut[_0x1ac3('0x133')](_0x1d16ee);}var _0x45fada=ut[_0x1ac3('0x134')](_0x35708b,_0x386c15,_0x225de6,_0x1d16ee,_0x4f6569,_0x5cc6d8);_[_0x1ac3('0x135')](_0x5cc6d8,ut[_0x1ac3('0x136')](_0x45fada));_0x5cc6d8['starttime']=moment()['format'](_0x1ac3('0x8e'));ami['Action'](ut[_0x1ac3('0x137')](_0x5cc6d8,_0x35708b,_0x45fada,_0x5cc6d8[_0x1ac3('0xaf')],_0x465935))[_0x1ac3('0x85')](function(_0x113a3b){_0x35708b[_0x1ac3('0x4c')]+=0x1;logger[_0x1ac3('0x6f')](_0x1ac3('0x138'),_0x4f6569,_0x1ac3('0xb4'),_0x35708b['name'],_0x1ac3('0xf1'),_0x35708b[_0x1ac3('0x4c')]);_0x21b5f2(_0x113a3b);})[_0x1ac3('0x7a')](function(_0x2ede00){ut['logAgent'](_0x5cc6d8,0xe,_0x1ac3('0x139'));rpcDb[_0x1ac3('0xf8')](_0x5cc6d8,_0x1ac3('0x13a'));_0x383b0d(_0x2ede00);});});};Preview[_0x1ac3('0xf')][_0x1ac3('0x1e')]=function(_0x3da6bb){if(this[_0x1ac3('0x6e')][_0x3da6bb['linkedid']]){this[_0x1ac3('0x6e')][_0x3da6bb['linkedid']]['channel']=_0x3da6bb[_0x1ac3('0x79')];}};Preview['prototype'][_0x1ac3('0x13b')]=function(_0x44378e){var _0x15002b=this;var _0x35817f=this['actions'][_0x44378e[_0x1ac3('0x13c')]];if(_0x35817f){if(_0x35817f[_0x1ac3('0x104')]&&this[_0x1ac3('0x15')][_0x35817f[_0x1ac3('0x104')]]){ut['logLookAgent'](_0x35817f,this[_0x1ac3('0x15')][_0x35817f[_0x1ac3('0x104')]][_0x1ac3('0x29')],this[_0x1ac3('0x15')][_0x35817f[_0x1ac3('0x104')]]['id']);}var _0x22bb76=_['clone'](_0x35817f);_0x22bb76[_0x1ac3('0xb1')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1727c0=_0x15002b['campaignsPreview'][_0x35817f[_0x1ac3('0x72')]];if(ut[_0x1ac3('0x13d')](_0x44378e[_0x1ac3('0x13e')])){if(_0x35817f[_0x1ac3('0xc7')]){rpcDb[_0x1ac3('0x112')](_0x35817f[_0x1ac3('0x13f')]);}if(_0x35817f['activeContact']){rpcDb[_0x1ac3('0x8c')](_0x35817f['idContact']);}ami[_0x1ac3('0x26')](_0x1ac3('0x140'),ut[_0x1ac3('0xa4')](_0x35817f,_0x1ac3('0x141'),this[_0x1ac3('0x12')][_0x35817f[_0x1ac3('0x72')]]));this[_0x1ac3('0xf4')](_0x22bb76,_0x1727c0,_0x44378e);}else{_0x35817f[_0x1ac3('0x8d')]=moment()[_0x1ac3('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x1ac3('0xfb')](_0x22bb76,0x4,_0x1ac3('0xbb'));rpcDb['createAgentHistory'](_0x22bb76,_0x1ac3('0x142'));}}};Preview['prototype']['syncHangup']=function(_0x28d45c){var _0x1a817a=this;var _0x3f2420=this[_0x1ac3('0x6e')][_0x28d45c['linkedid']];var _0x1a6330;if(_0x3f2420){_0x1a6330=this[_0x1ac3('0x12')][_0x3f2420[_0x1ac3('0x72')]];logger[_0x1ac3('0x6f')](_0x1ac3('0x143'),_0x28d45c[_0x1ac3('0xb0')],_0x1ac3('0xb4'),_0x1a6330[_0x1ac3('0x29')],_0x1ac3('0x73'),_0x1a6330[_0x1ac3('0x5e')]);}if(this['actions'][_0x28d45c[_0x1ac3('0xb0')]]&&_0x28d45c[_0x1ac3('0xb0')]!==_0x28d45c[_0x1ac3('0xbe')]){if(_0x28d45c[_0x1ac3('0x144')]==='16'&&this[_0x1ac3('0x6e')][_0x28d45c[_0x1ac3('0xb0')]]['dialAnswer']){this['callProgressDetectingCustomer'](_0x28d45c,_0x28d45c[_0x1ac3('0xb0')],_0x28d45c[_0x1ac3('0x144')]);}else if(this['actions'][_0x28d45c['linkedid']][_0x1ac3('0x7c')]){logger[_0x1ac3('0x6f')](_0x1ac3('0x145'),_0x28d45c[_0x1ac3('0xb0')],_0x28d45c['cause'],_0x1ac3('0xb4'),_0x1a6330[_0x1ac3('0x29')],_0x1ac3('0x73'),_0x1a6330[_0x1ac3('0x5e')]);this[_0x1ac3('0x9f')](_0x28d45c,_0x28d45c['linkedid'],_0x28d45c[_0x1ac3('0x144')]);}}else if(_0x3f2420&&_[_0x1ac3('0x86')](_0x3f2420[_0x1ac3('0x146')])&&_0x1a6330[_0x1ac3('0x147')]&&_0x28d45c[_0x1ac3('0xb0')]===_0x28d45c[_0x1ac3('0xbe')]&&_[_0x1ac3('0x86')](_0x28d45c[_0x1ac3('0xf7')])&&_0x28d45c[_0x1ac3('0x144')]==='16'&&_0x28d45c[_0x1ac3('0x148')]==='6'&&_[_0x1ac3('0xf5')](_0x3f2420[_0x1ac3('0x149')])){if(_0x3f2420['unlockAgent']){rpcDb[_0x1ac3('0x112')](_0x3f2420[_0x1ac3('0x13f')]);}if(_0x3f2420[_0x1ac3('0xaf')]){rpcDb[_0x1ac3('0x8c')](_0x3f2420[_0x1ac3('0x13f')]);}_0x28d45c[_0x1ac3('0xf7')]='22';this[_0x1ac3('0xf4')](_0x3f2420,_0x1a6330,_0x28d45c);}else if(_0x3f2420&&_0x3f2420[_0x1ac3('0x149')]){if(_0x28d45c[_0x1ac3('0x144')]==='16'&&this[_0x1ac3('0x6e')][_0x28d45c[_0x1ac3('0xb0')]][_0x1ac3('0x7c')]){logger[_0x1ac3('0x6f')](_0x1ac3('0x14a'),_0x28d45c['linkedid'],_0x28d45c[_0x1ac3('0x144')],'\x20Queue',_0x1a6330[_0x1ac3('0x29')],_0x1ac3('0x73'),_0x1a6330[_0x1ac3('0x5e')]);this['callProgressDetectingCustomer'](_0x28d45c,_0x28d45c[_0x1ac3('0xb0')],_0x28d45c[_0x1ac3('0x144')]);}else if(this['actions'][_0x28d45c[_0x1ac3('0xb0')]][_0x1ac3('0x7c')]){logger[_0x1ac3('0x6f')](_0x1ac3('0x145'),_0x28d45c[_0x1ac3('0xb0')],_0x28d45c['cause'],_0x1ac3('0xb4'),_0x1a6330['name'],_0x1ac3('0x73'),_0x1a6330['pTalking']);this[_0x1ac3('0x9f')](_0x28d45c,_0x28d45c[_0x1ac3('0xb0')],_0x28d45c['cause']);}}};Preview['prototype'][_0x1ac3('0x1d')]=function(_0x27d3c9){if(this['actions'][_0x27d3c9['destlinkedid']]&&_0x27d3c9[_0x1ac3('0xf3')]!==_0x27d3c9['destuniqueid']){this[_0x1ac3('0x9f')](_0x27d3c9,_0x27d3c9[_0x1ac3('0xf3')],_0x27d3c9['dialstatus']);}};Preview[_0x1ac3('0xf')][_0x1ac3('0x1b')]=function(_0x4c865a){if(this[_0x1ac3('0x6e')][_0x4c865a[_0x1ac3('0xb0')]]&&_0x4c865a['linkedid']!==_0x4c865a[_0x1ac3('0xbe')]&&!this[_0x1ac3('0x6e')][_0x4c865a[_0x1ac3('0xb0')]][_0x1ac3('0x7c')]){if(_0x4c865a[_0x1ac3('0x144')]==='1'){this[_0x1ac3('0x9f')](_0x4c865a,_0x4c865a['linkedid'],_0x4c865a[_0x1ac3('0x144')]);}}};Preview[_0x1ac3('0xf')][_0x1ac3('0x14b')]=function(_0x338d62,_0x3c902b,_0x26d6dc){if(this[_0x1ac3('0x6e')][_0x338d62]){if(_[_0x1ac3('0x86')](this[_0x1ac3('0x6e')][_0x338d62][_0x1ac3('0x14c')])){this[_0x1ac3('0x6e')][_0x338d62]['variables']={};}this['actions'][_0x338d62][_0x1ac3('0x14c')][_0x3c902b]=_0x26d6dc;}};Preview[_0x1ac3('0xf')]['syncVarSet']=function(_0x3e109b){try{if(!_[_0x1ac3('0x86')](_0x3e109b)){if(ut[_0x1ac3('0x14d')](_[_0x1ac3('0x14e')](_0x3e109b[_0x1ac3('0x14f')])[0x0])){this[_0x1ac3('0x14b')](_0x3e109b[_0x1ac3('0xbe')],_[_0x1ac3('0x14e')](_0x3e109b[_0x1ac3('0x14f')])[0x0],_0x3e109b[_0x1ac3('0x150')]);}}}catch(_0x4e42d1){logger[_0x1ac3('0x151')](_0x1ac3('0x152'),util['inspect'](_0x4e42d1,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x23d9f9){if(_0x23d9f9){if(this[_0x1ac3('0x6e')][_0x23d9f9['transfertargetlinkedid']]){this[_0x1ac3('0x6e')][_0x23d9f9[_0x1ac3('0x153')]][_0x1ac3('0x149')]=!![];}}};Preview[_0x1ac3('0xf')][_0x1ac3('0x24')]=function(_0x5c3ab5){if(_0x5c3ab5){if(this['actions'][_0x5c3ab5[_0x1ac3('0x154')]]){this['actions'][_0x5c3ab5[_0x1ac3('0x154')]][_0x1ac3('0x149')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xd0bb=['[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','SIP/%s','unmonitored','pick','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','callProgressDetectingAgent','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','ioredis','../../../config/environment','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','hanguprequest','syncHangupRequest','bind','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','UserId','ListId','Action','status','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','acw','custom:agentConnectPreview','complete','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','countglobal','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]'];(function(_0x19f132,_0x4f35ff){var _0x9cbf00=function(_0x5392ce){while(--_0x5392ce){_0x19f132['push'](_0x19f132['shift']());}};_0x9cbf00(++_0x4f35ff);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0xd0bb[_0x5b1c50];return _0x2d379b;};'use strict';var util=require(_0xbd0b('0x0'));var _=require(_0xbd0b('0x1'));var BPromise=require(_0xbd0b('0x2'));var uuid=require('uuid');var moment=require(_0xbd0b('0x3'));var md5=require('md5');var Redis=require(_0xbd0b('0x4'));var config=require(_0xbd0b('0x5'));var logger=require('../../../config/logger')(_0xbd0b('0x6'));var loggerAction=require('../../../config/logger')(_0xbd0b('0x7'));var ami=require(_0xbd0b('0x8'));var rpcDb=require(_0xbd0b('0x9'));var Action=require(_0xbd0b('0xa'));var ut=require(_0xbd0b('0xb'));config['redis']=_[_0xbd0b('0xc')](config[_0xbd0b('0xd')],{'host':_0xbd0b('0xe'),'port':0x18eb});var io=require(_0xbd0b('0xf'))(new Redis(config[_0xbd0b('0xd')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x14bc5b){this[_0xbd0b('0x10')]=this['tail']?this[_0xbd0b('0x10')][_0xbd0b('0x11')](_0x14bc5b):_0x14bc5b();};function Preview(_0x526258){this[_0xbd0b('0x12')]=new Sequence();this[_0xbd0b('0x13')]=_0x526258[_0xbd0b('0x14')];this[_0xbd0b('0x15')]=_0x526258[_0xbd0b('0x15')];this[_0xbd0b('0x16')]={};this[_0xbd0b('0x17')]=_0x526258[_0xbd0b('0x17')];this[_0xbd0b('0x18')]=0x0;ami['on'](_0xbd0b('0x19'),this[_0xbd0b('0x1a')]['bind'](this));ami['on'](_0xbd0b('0x1b'),this['syncHangup']['bind'](this));ami['on'](_0xbd0b('0x1c'),this[_0xbd0b('0x1d')][_0xbd0b('0x1e')](this));ami['on'](_0xbd0b('0x1f'),this[_0xbd0b('0x20')]['bind'](this));ami['on']('newexten',this[_0xbd0b('0x21')][_0xbd0b('0x1e')](this));ami['on'](_0xbd0b('0x22'),this[_0xbd0b('0x23')][_0xbd0b('0x1e')](this));ami['on'](_0xbd0b('0x24'),this['syncAttendedTransfer'][_0xbd0b('0x1e')](this));ami['on']('blindtransfer',this[_0xbd0b('0x25')][_0xbd0b('0x1e')](this));this[_0xbd0b('0x26')](this[_0xbd0b('0x13')]);}function emit(_0x4b312d,_0x403c91,_0x38c27f){io['to'](_0x4b312d)[_0xbd0b('0x27')](_0x403c91,_0x38c27f);}function emitCampaignPreview(_0x495d62){if(_0x495d62[_0xbd0b('0x28')]==='outbound'){var _0xc66b8={'id':_0x495d62['id'],'name':_0x495d62[_0xbd0b('0x29')],'strategy':_0x495d62[_0xbd0b('0x2a')],'answered':_0x495d62[_0xbd0b('0x2b')],'available':_0x495d62[_0xbd0b('0x2c')],'loggedIn':_0x495d62['loggedIn'],'pTalking':_0x495d62[_0xbd0b('0x2d')],'sumBillable':_0x495d62['sumBillable'],'sumDuration':_0x495d62[_0xbd0b('0x2e')],'sumHoldTime':_0x495d62[_0xbd0b('0x2f')]||0x0,'talking':_0x495d62[_0xbd0b('0x30')],'total':_0x495d62[_0xbd0b('0x31')],'type':_0x495d62[_0xbd0b('0x28')],'unmanaged':_0x495d62[_0xbd0b('0x32')],'abandoned':_0x495d62['abandoned'],'waiting':_0x495d62[_0xbd0b('0x33')],'loggedInDb':_0x495d62[_0xbd0b('0x34')],'dialActive':_0x495d62[_0xbd0b('0x35')],'dialMethod':_0x495d62[_0xbd0b('0x36')],'dialOriginateCallerIdName':_0x495d62[_0xbd0b('0x37')],'dialOriginateCallerIdNumber':_0x495d62[_0xbd0b('0x38')],'dialOriginateTimeout':_0x495d62['dialOriginateTimeout'],'dialPrefix':_0x495d62[_0xbd0b('0x39')],'outboundAnswerAgiCallsDay':_0x495d62[_0xbd0b('0x3a')],'outboundAnswerCallsDay':_0x495d62[_0xbd0b('0x3b')],'outboundBlacklistCallsDay':_0x495d62['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x495d62['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x495d62[_0xbd0b('0x3c')],'outboundDropCallsDayACS':_0x495d62[_0xbd0b('0x3d')],'outboundDropCallsDayCallersExit':_0x495d62[_0xbd0b('0x3e')],'outboundDropCallsDayTimeout':_0x495d62[_0xbd0b('0x3f')],'outboundNoAnswerCallsDay':_0x495d62[_0xbd0b('0x40')],'outboundNoSuchCallsDay':_0x495d62[_0xbd0b('0x41')],'outboundOriginateFailureCallsDay':_0x495d62[_0xbd0b('0x42')],'outboundReCallsDay':_0x495d62['outboundReCallsDay'],'outboundRejectCallsDay':_0x495d62[_0xbd0b('0x43')],'outboundUnknownCallsDay':_0x495d62[_0xbd0b('0x44')],'outboundAbandonedCallsDay':_0x495d62['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x495d62['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x495d62[_0xbd0b('0x45')],'predictiveIntervalAvgTalktime':_0x495d62[_0xbd0b('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x495d62['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x495d62[_0xbd0b('0x47')],'predictiveIntervalErlangCalls':_0x495d62[_0xbd0b('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x495d62[_0xbd0b('0x49')],'predictiveIntervalHitRate':_0x495d62[_0xbd0b('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x495d62[_0xbd0b('0x4b')],'predictiveIntervalPauses':_0x495d62[_0xbd0b('0x4c')],'predictiveIntervalAvailable':_0x495d62['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x495d62[_0xbd0b('0x4d')],'message':_0x495d62[_0xbd0b('0x4e')],'originated':_0x495d62[_0xbd0b('0x4f')],'erlangCalls':_0x495d62[_0xbd0b('0x50')],'erlangCallToSecond':_0x495d62[_0xbd0b('0x51')],'erlangAbandonmentRate':_0x495d62[_0xbd0b('0x52')],'erlangBusyFactor':_0x495d62[_0xbd0b('0x53')],'startPredictive':_0x495d62[_0xbd0b('0x54')],'startProgressive':_0x495d62[_0xbd0b('0x55')]};if(_0x495d62[_0xbd0b('0x56')]){_0xc66b8[_0xbd0b('0x56')]={'id':_0x495d62[_0xbd0b('0x56')]['id'],'name':_0x495d62[_0xbd0b('0x56')][_0xbd0b('0x29')],'active':_0x495d62['Trunk'][_0xbd0b('0x57')],'callerid':_0x495d62[_0xbd0b('0x56')]['callerid']};}if(_0x495d62[_0xbd0b('0x58')]){_0xc66b8[_0xbd0b('0x58')]={'id':_0x495d62[_0xbd0b('0x58')]['id'],'name':_0x495d62[_0xbd0b('0x58')][_0xbd0b('0x29')]};}var _0x288715=md5(JSON['stringify'](_0xc66b8));if(_0x495d62[_0xbd0b('0x59')]!==_0x288715){_0x495d62[_0xbd0b('0x59')]=_0x288715;emit(util[_0xbd0b('0x5a')](_0xbd0b('0x5b'),_0xc66b8[_0xbd0b('0x29')]),'voice_queue:save',_0xc66b8);}}}function emitVoiceQueueChannelRemove(_0x487aa6){logger[_0xbd0b('0x5c')](_0xbd0b('0x5d'),JSON[_0xbd0b('0x5e')](_0x487aa6));emit(util[_0xbd0b('0x5a')]('voice:queue:%s',_0x487aa6['name']),_0xbd0b('0x5f'),_0x487aa6);io['emit'](_0xbd0b('0x60'),_0x487aa6);}function notSendMessagesQueue(_0x27bdc5){if(_0x27bdc5[_0xbd0b('0x61')]){if(_0x27bdc5[_0xbd0b('0x4f')]===0x0&&_0x27bdc5[_0xbd0b('0x2d')]===0x0){_0x27bdc5[_0xbd0b('0x61')]=![];_0x27bdc5[_0xbd0b('0x2c')]=0x0;_0x27bdc5[_0xbd0b('0x62')]=0x0;_0x27bdc5[_0xbd0b('0x4e')]=_0xbd0b('0x63');ut[_0xbd0b('0x64')](_0xbd0b('0x65'),_0x27bdc5[_0xbd0b('0x29')]+_0xbd0b('0x66'));}else{_0x27bdc5[_0xbd0b('0x4e')]=_0xbd0b('0x67');ut[_0xbd0b('0x64')](_0xbd0b('0x65'),_0x27bdc5['name']+_0xbd0b('0x68'));}emitCampaignPreview(_0x27bdc5);}}Preview[_0xbd0b('0x69')][_0xbd0b('0x26')]=function(){var _0x3f4d9b=this;setInterval(function(){_0x3f4d9b[_0xbd0b('0x6a')]();},0x7cf);};Preview[_0xbd0b('0x69')][_0xbd0b('0x6a')]=function(){var _0x1b4497=this[_0xbd0b('0x13')];this[_0xbd0b('0x18')]+=0x1;for(var _0xa252a2 in _0x1b4497){if(_0x1b4497[_0xbd0b('0x6b')](_0xa252a2)&&(_0x1b4497[_0xa252a2]['dialMethod']===_0xbd0b('0x6')||_0x1b4497[_0xa252a2]['dialMethod']==='booked')&&_0x1b4497[_0xa252a2][_0xbd0b('0x28')]===_0xbd0b('0x6c')){if(this[_0xbd0b('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xbd0b('0x6d')]();}}if(_0x1b4497[_0xbd0b('0x6b')](_0xa252a2)&&_0x1b4497[_0xa252a2][_0xbd0b('0x36')]===_0xbd0b('0x6')&&_0x1b4497[_0xa252a2][_0xbd0b('0x28')]==='outbound'){if(_0x1b4497[_0xa252a2][_0xbd0b('0x35')]){this[_0xbd0b('0x6e')](_0x1b4497[_0xa252a2]);if(_0x1b4497[_0xa252a2][_0xbd0b('0x6f')])this[_0xbd0b('0x70')](_0x1b4497[_0xa252a2]);}else{notSendMessagesQueue(_0x1b4497[_0xa252a2]);}}}};Preview[_0xbd0b('0x69')][_0xbd0b('0x71')]=function(_0x480c00){var _0x335728=this;this[_0xbd0b('0x12')][_0xbd0b('0x72')](function(){if(!_[_0xbd0b('0x73')](_0x335728[_0xbd0b('0x16')][_0x480c00])){loggerAction[_0xbd0b('0x5c')](_0xbd0b('0x74'),_0x480c00,_0xbd0b('0x75'),_0x335728[_0xbd0b('0x16')][_0x480c00][_0xbd0b('0x76')],_0xbd0b('0x77'),JSON[_0xbd0b('0x5e')](_0x335728[_0xbd0b('0x13')][_0x335728[_0xbd0b('0x16')][_0x480c00][_0xbd0b('0x76')]][_0xbd0b('0x4f')]),_0xbd0b('0x78'),JSON[_0xbd0b('0x5e')](_0x335728[_0xbd0b('0x13')][_0x335728[_0xbd0b('0x16')][_0x480c00][_0xbd0b('0x76')]][_0xbd0b('0x2d')]),JSON[_0xbd0b('0x5e')](_0x335728['actions'][_0x480c00][_0xbd0b('0x79')]),JSON[_0xbd0b('0x5e')](_['pick'](_0x335728['actions'][_0x480c00],['contactId',_0xbd0b('0x7a'),'VoiceQueueId',_0xbd0b('0x7b')])));return ami[_0xbd0b('0x7c')]({'action':_0xbd0b('0x7d'),'channel':_0x335728[_0xbd0b('0x16')][_0x480c00]['channel']})[_0xbd0b('0x7e')](function(_0x58ccaf){if(_0x58ccaf[_0xbd0b('0x4e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x335728['actions'][_0x480c00]){ut[_0xbd0b('0x7f')](_0x335728[_0xbd0b('0x13')][_0x335728[_0xbd0b('0x16')][_0x480c00][_0xbd0b('0x76')]],_0xbd0b('0x80'));if(_0x335728[_0xbd0b('0x16')][_0x480c00][_0xbd0b('0x79')]===!![]){ut[_0xbd0b('0x81')](_0x335728['campaignsPreview'][_0x335728['actions'][_0x480c00][_0xbd0b('0x76')]],_0xbd0b('0x80'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x480c00,_0x335728[_0xbd0b('0x16')][_0x480c00][_0xbd0b('0x76')]);}ut[_0xbd0b('0x82')](_0xbd0b('0x83')+_0x480c00,_0x335728['actions'][_0x480c00][_0xbd0b('0x76')]);delete _0x335728[_0xbd0b('0x16')][_0x480c00];}},0x2328);}});}});};Preview[_0xbd0b('0x69')][_0xbd0b('0x6d')]=function(){var _0x50fc5b=this;loggerAction[_0xbd0b('0x5c')](_0xbd0b('0x84'),_['size'](this[_0xbd0b('0x16')]));for(var _0x1ea443 in this[_0xbd0b('0x16')]){if(_0x50fc5b[_0xbd0b('0x16')][_0xbd0b('0x6b')](_0x1ea443)){_0x50fc5b[_0xbd0b('0x71')](_0x1ea443);}}};Preview[_0xbd0b('0x69')][_0xbd0b('0x70')]=function(_0x5e508f){var _0x18696c=this;rpcDb[_0xbd0b('0x85')](_0x5e508f['id'],ut[_0xbd0b('0x86')](this[_0xbd0b('0x17')]))[_0xbd0b('0x87')](function(_0x1076dc){if(!_['isNil'](_0x1076dc)){for(var _0x570648=0x0;_0x570648<_0x1076dc[_0xbd0b('0x88')];_0x570648+=0x1){if(ut[_0xbd0b('0x89')](_0x1076dc[_0x570648]['scheduledat'])<_0x5e508f[_0xbd0b('0x8a')]*0x3c){if(_0x1076dc[_0x570648][_0xbd0b('0x8b')]&&!_0x1076dc[_0x570648][_0xbd0b('0x8b')][_0xbd0b('0x8c')]){_0x18696c[_0xbd0b('0x8d')](_0x1076dc[_0x570648]['id'])['then'](ut[_0xbd0b('0x8e')](_0xbd0b('0x8f')))[_0xbd0b('0x7e')](ut[_0xbd0b('0x8e')](_0xbd0b('0x8f')));}else{rpcDb[_0xbd0b('0x90')](_0x1076dc[_0x570648]['id']);}}else{var _0x19e3c0=new Action(_0x1076dc[_0x570648],_0x5e508f);_0x19e3c0[_0xbd0b('0x91')]=moment()[_0xbd0b('0x5a')](_0xbd0b('0x92'));_0x5e508f[_0xbd0b('0x93')]+=0x1;ut[_0xbd0b('0x94')](_0x19e3c0,0x17,_0xbd0b('0x95'));if(_0x5e508f[_0xbd0b('0x96')]){rpcDb[_0xbd0b('0x97')](ut[_0xbd0b('0x98')](_0x1076dc[_0x570648]));rpcDb[_0xbd0b('0x99')](_0x19e3c0,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xbd0b('0x94')](_0x19e3c0,0x16,_0xbd0b('0x9a'));rpcDb[_0xbd0b('0x99')](_0x19e3c0,_0xbd0b('0x9b'));rpcDb['createCustomerFinal'](_0x19e3c0,'[HistoryRecallClose]');}}}}})[_0xbd0b('0x7e')](ut[_0xbd0b('0x8e')](_0xbd0b('0x9c')));};Preview[_0xbd0b('0x69')][_0xbd0b('0x6e')]=function(_0x5813a2){_0x5813a2[_0xbd0b('0x61')]=!![];if(ut['IsNotLoggedIn'](_0x5813a2[_0xbd0b('0x9d')])){_0x5813a2[_0xbd0b('0x4e')]=_0xbd0b('0x9e');}else if(!ut[_0xbd0b('0x9f')](_0x5813a2[_0xbd0b('0x35')])){_0x5813a2[_0xbd0b('0x4e')]='NOT_ACTIVE';}else if(!this[_0xbd0b('0xa0')](_0x5813a2[_0xbd0b('0x56')])){if(!this[_0xbd0b('0xa0')](_0x5813a2[_0xbd0b('0xa1')])){_0x5813a2['message']=_0xbd0b('0xa2');}else{_0x5813a2[_0xbd0b('0x4e')]=_0xbd0b('0xa3');}}else{_0x5813a2[_0xbd0b('0x4e')]=_0xbd0b('0xa3');}emitCampaignPreview(_0x5813a2);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x4ce5bc,_0x4a85df,_0x2cd008){var _0x3735b9=this;var _0x2eda14=this[_0xbd0b('0x16')][_0x4a85df];var _0x3f711c=this[_0xbd0b('0x13')][_0x2eda14['queue']];var _0x1fa32f;if(_0x3f711c){switch(_0x2cd008){case'1':_0x3f711c['outboundNoSuchCallsDay']+=0x1;_0x2eda14[_0xbd0b('0xa4')]+=0x1;_0x2eda14['countglobal']=ut['totalGlobal'](_0x2eda14);ut['logCustomer'](_0x2eda14,0x0,_0xbd0b('0xa5'));ami['emit']('custom:agentnosuchnumber',ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xa7')));rpcDb['createCustomerHistory'](_0x2eda14,_0xbd0b('0xa8'));if(ut['totalGlobal'](_0x2eda14)>=_0x3f711c['dialGlobalMaxRetry']){_0x1fa32f=ut[_0xbd0b('0xa9')](_0x2eda14,0xf,_0xbd0b('0xaa'));rpcDb[_0xbd0b('0xab')](_0x1fa32f,_0xbd0b('0xac'));}else{if(_0x2eda14[_0xbd0b('0xa4')]>=_0x3f711c[_0xbd0b('0xad')]){rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xac'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2eda14,_0xbd0b('0xa4'),_0x3f711c['dialNoSuchNumberRetryFrequency']),_0x2eda14[_0xbd0b('0xae')],_0x2eda14[_0xbd0b('0xaf')]);}}delete this[_0xbd0b('0x16')][_0x4ce5bc['linkedid']];break;case _0xbd0b('0xb0'):var _0x1c4626=moment()['format'](_0xbd0b('0x92'));_0x2eda14[_0xbd0b('0xb1')]=_0x1c4626;_0x2eda14[_0xbd0b('0xb2')]=_0x1c4626;_0x2eda14[_0xbd0b('0x79')]=!![];_0x3f711c[_0xbd0b('0x2d')]+=0x1;logger['info'](_0xbd0b('0xb3'),_0x2eda14[_0xbd0b('0xb4')],_0xbd0b('0xb5'),_0x3f711c[_0xbd0b('0x29')],'pTalking:\x20',_0x3f711c[_0xbd0b('0x2d')]);ami[_0xbd0b('0x27')]('custom:agentconnect',ut[_0xbd0b('0xa6')](_0x2eda14,'connect',this[_0xbd0b('0x13')][_0x2eda14[_0xbd0b('0x76')]]));if(_0x3f711c[_0xbd0b('0xb6')]){ami[_0xbd0b('0x27')](_0xbd0b('0xb7'),ut['buildAcw'](_0x2eda14));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xb8'),this[_0xbd0b('0x13')][_0x2eda14['queue']]));emitVoiceQueueChannelRemove(ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xb8')));_0x3f711c[_0xbd0b('0x3b')]+=0x1;_0x3f711c[_0xbd0b('0x31')]+=0x1;_0x3f711c[_0xbd0b('0x2b')]+=0x1;ut['decrementTalkink'](_0x3f711c,_0xbd0b('0xb9'));_0x2eda14['countglobal']=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0x4,_0xbd0b('0xbb'));rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xbc'));rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xbd'));rpcDb[_0xbd0b('0xbe')](_0x2eda14);_0x3f711c[_0xbd0b('0x2e')]+=_0x2eda14[_0xbd0b('0xbf')];_0x3f711c['sumBillable']+=_0x2eda14[_0xbd0b('0xbf')];logger[_0xbd0b('0x5c')](_0xbd0b('0xc0'),_0x2eda14[_0xbd0b('0xb4')],_0xbd0b('0xb5'),_0x3f711c[_0xbd0b('0x29')],_0xbd0b('0x78'),_0x3f711c['pTalking']);delete this[_0xbd0b('0x16')][_0x4ce5bc[_0xbd0b('0xc1')]];break;case _0xbd0b('0xc2'):_0x3f711c['outboundBusyCallsDay']+=0x1;_0x2eda14[_0xbd0b('0xc3')]+=0x1;_0x2eda14['countglobal']=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0x5,_0xbd0b('0xc4'));ami[_0xbd0b('0x27')](_0xbd0b('0xc5'),ut[_0xbd0b('0xa6')](_0x2eda14,'busy'));rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xc6'));if(ut[_0xbd0b('0xba')](_0x2eda14)>=_0x3f711c[_0xbd0b('0xc7')]){_0x1fa32f=ut['cloneAction'](_0x2eda14,0xf,_0xbd0b('0xaa'));rpcDb['createCustomerFinal'](_0x1fa32f,_0xbd0b('0xc8'));}else{if(_0x2eda14[_0xbd0b('0xc3')]>=_0x3f711c[_0xbd0b('0xc9')]){rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xc6'));}else{rpcDb[_0xbd0b('0xca')](ut[_0xbd0b('0xcb')](_0x2eda14,_0xbd0b('0xc3'),_0x3f711c[_0xbd0b('0xcc')]),_0x2eda14[_0xbd0b('0xae')],_0x2eda14[_0xbd0b('0xaf')]);}}break;case _0xbd0b('0xcd'):_0x3f711c[_0xbd0b('0x40')]+=0x1;_0x2eda14['countnoanswerretry']+=0x1;_0x2eda14[_0xbd0b('0xce')]=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0x3,_0xbd0b('0xcf'));ami[_0xbd0b('0x27')](_0xbd0b('0xd0'),ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xd1')));rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xd2'));if(ut[_0xbd0b('0xba')](_0x2eda14)>=_0x3f711c[_0xbd0b('0xc7')]){_0x1fa32f=ut[_0xbd0b('0xa9')](_0x2eda14,0xf,'Global');rpcDb[_0xbd0b('0xab')](_0x1fa32f,_0xbd0b('0xd3'));}else{if(_0x2eda14[_0xbd0b('0xd4')]>=_0x3f711c[_0xbd0b('0xd5')]){rpcDb['createCustomerFinal'](_0x2eda14,_0xbd0b('0xd2'));}else{rpcDb[_0xbd0b('0xca')](ut[_0xbd0b('0xcb')](_0x2eda14,_0xbd0b('0xd4'),_0x3f711c[_0xbd0b('0xd6')]),_0x2eda14['unlockAgent'],_0x2eda14['activeContact']);}}break;case _0xbd0b('0xd7'):_0x3f711c[_0xbd0b('0x3c')]+=0x1;_0x2eda14[_0xbd0b('0xd8')]+=0x1;_0x2eda14['countglobal']=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0x8,_0xbd0b('0xd9'));ami['emit'](_0xbd0b('0xda'),ut['buildObj'](_0x2eda14,'congestion'));rpcDb[_0xbd0b('0x99')](_0x2eda14,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x2eda14)>=_0x3f711c[_0xbd0b('0xc7')]){_0x1fa32f=ut['cloneAction'](_0x2eda14,0xf,_0xbd0b('0xaa'));rpcDb[_0xbd0b('0xab')](_0x1fa32f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2eda14[_0xbd0b('0xd8')]>=_0x3f711c[_0xbd0b('0xdb')]){rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xdc'));}else{rpcDb[_0xbd0b('0xca')](ut['scheduledAt'](_0x2eda14,_0xbd0b('0xd8'),_0x3f711c[_0xbd0b('0xcc')]),_0x2eda14['unlockAgent'],_0x2eda14[_0xbd0b('0xaf')]);}}break;case _0xbd0b('0xdd'):_0x3f711c[_0xbd0b('0x43')]+=0x1;_0x2eda14[_0xbd0b('0xde')]+=0x1;_0x2eda14[_0xbd0b('0xce')]=ut[_0xbd0b('0xba')](_0x2eda14);ut['logCustomer'](_0x2eda14,0x14,_0xbd0b('0xdf'));ami[_0xbd0b('0x27')](_0xbd0b('0xe0'),ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xe1')));rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xe2'));if(ut[_0xbd0b('0xba')](_0x2eda14)>=_0x3f711c[_0xbd0b('0xc7')]){_0x1fa32f=ut['cloneAction'](_0x2eda14,0x14,_0xbd0b('0xdf'));rpcDb['createCustomerFinal'](_0x1fa32f,_0xbd0b('0xe3'));}else{if(_0x2eda14[_0xbd0b('0xde')]>=_0x3f711c[_0xbd0b('0xe4')]){rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xe3'));}else{rpcDb[_0xbd0b('0xca')](ut[_0xbd0b('0xcb')](_0x2eda14,_0xbd0b('0xde'),_0x3f711c[_0xbd0b('0xe5')]),_0x2eda14[_0xbd0b('0xae')],_0x2eda14[_0xbd0b('0xaf')]);}}break;case _0xbd0b('0xe6'):_0x3f711c['outboundAbandonedCallsDay']+=0x1;_0x2eda14[_0xbd0b('0xe7')]+=0x1;_0x2eda14['countglobal']=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0xb,'Abandoned');rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xe8'));if(ut[_0xbd0b('0xba')](_0x2eda14)>=_0x3f711c[_0xbd0b('0xc7')]){_0x1fa32f=ut[_0xbd0b('0xa9')](_0x2eda14,0xf,_0xbd0b('0xaa'));rpcDb[_0xbd0b('0xab')](_0x1fa32f,_0xbd0b('0xe8'));}else{if(_0x2eda14[_0xbd0b('0xe9')]>=_0x3f711c[_0xbd0b('0xea')]){rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xe8'));}else{rpcDb['rescheduleContact'](ut[_0xbd0b('0xcb')](_0x2eda14,_0xbd0b('0xe7'),_0x3f711c['dialAbandonedRetryFrequency']),_0x2eda14[_0xbd0b('0xae')],_0x2eda14[_0xbd0b('0xaf')]);}}break;case'18':_0x3f711c['outboundUnknownCallsDay']+=0x1;_0x2eda14[_0xbd0b('0xeb')]+=0x1;_0x2eda14['countglobal']=ut[_0xbd0b('0xba')](_0x2eda14);ut['logCustomer'](_0x2eda14,0x12,_0x4ce5bc[_0xbd0b('0xec')]||_0x4ce5bc[_0xbd0b('0xed')]);ami[_0xbd0b('0x27')](_0xbd0b('0xee'),ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xef')));rpcDb['createCustomerHistory'](_0x2eda14,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xbd0b('0xba')](_0x2eda14)>=_0x3f711c[_0xbd0b('0xc7')]){_0x1fa32f=ut[_0xbd0b('0xa9')](_0x2eda14,0xf,_0xbd0b('0xaa'));rpcDb[_0xbd0b('0xab')](_0x1fa32f,_0xbd0b('0xf0'));}else{rpcDb[_0xbd0b('0xab')](_0x2eda14,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xbd0b('0x16')][_0x4ce5bc[_0xbd0b('0xc1')]];break;case'19':_0x3f711c[_0xbd0b('0x44')]+=0x1;_0x2eda14['countglobal']=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0x13,_0x4ce5bc[_0xbd0b('0xec')]||_0x4ce5bc['dialstatus']);ami[_0xbd0b('0x27')]('custom:amd',ut[_0xbd0b('0xa6')](_0x2eda14,_0xbd0b('0xef')));rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xf1'));if(ut['totalGlobal'](_0x2eda14)>=_0x3f711c['dialGlobalMaxRetry']){_0x1fa32f=ut[_0xbd0b('0xa9')](_0x2eda14,0xf,'Global');rpcDb[_0xbd0b('0xab')](_0x1fa32f,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x2eda14,_0xbd0b('0xf1'));}delete this[_0xbd0b('0x16')][_0x4ce5bc[_0xbd0b('0xc1')]];break;default:if(_0x2eda14[_0xbd0b('0x79')]){ut['decrementTalkink'](_0x3f711c,_0xbd0b('0xf2'));ut[_0xbd0b('0x82')](_0xbd0b('0xf3')+_0x3f711c[_0xbd0b('0x29')],_0x4ce5bc);}_0x3f711c['outboundUnknownCallsDay']+=0x1;_0x2eda14[_0xbd0b('0xce')]=ut[_0xbd0b('0xba')](_0x2eda14);ut[_0xbd0b('0x94')](_0x2eda14,0xc,_0x4ce5bc[_0xbd0b('0xec')]||_0x4ce5bc['dialstatus']);rpcDb[_0xbd0b('0x99')](_0x2eda14,_0xbd0b('0xf4'));if(ut[_0xbd0b('0xba')](_0x2eda14)>=_0x3f711c['dialGlobalMaxRetry']){_0x1fa32f=ut[_0xbd0b('0xa9')](_0x2eda14,0xf,_0xbd0b('0xaa'));rpcDb[_0xbd0b('0xab')](_0x1fa32f,_0xbd0b('0xf5'));}else{rpcDb[_0xbd0b('0xab')](_0x2eda14,_0xbd0b('0xf5'));}delete this[_0xbd0b('0x16')][_0x4ce5bc[_0xbd0b('0xc1')]];}if(!(_0x2eda14[_0xbd0b('0x79')]&&_0x2cd008==='16')){ut[_0xbd0b('0x7f')](_0x3f711c,'[callProgressDetectingCustomer]');logger['info'](_0xbd0b('0xf6'),_0x2eda14[_0xbd0b('0xb4')],'\x20Queue',_0x3f711c[_0xbd0b('0x29')],_0xbd0b('0x77'),_0x3f711c[_0xbd0b('0x4f')]);}if(_0x2cd008!==_0xbd0b('0xb0')){delete this['actions'][_0x4ce5bc['linkedid']];delete this[_0xbd0b('0x16')][_0x4ce5bc[_0xbd0b('0xf7')]];}}};Preview[_0xbd0b('0x69')]['callProgressDetectingAgent']=function(_0x1b8cce,_0x92e855,_0x1ce516){if(_[_0xbd0b('0xf8')](_0x92e855)&&_0xbd0b('0xf9')!==typeof _0x92e855){return;}if(_['isUndefined'](_0x1ce516)&&_0xbd0b('0xf9')!==typeof _0x1ce516){return;}switch(_0x1ce516[_0xbd0b('0xfa')]){case'0':ut[_0xbd0b('0xfb')](_0x1b8cce,0x0,'NoSuchNumber');rpcDb[_0xbd0b('0xfc')](_0x1b8cce,_0xbd0b('0xfd'));break;case'3':ut['logAgent'](_0x1b8cce,0x3,_0xbd0b('0xcf'));rpcDb[_0xbd0b('0xfc')](_0x1b8cce,_0xbd0b('0xfe'));break;case'5':ut[_0xbd0b('0xfb')](_0x1b8cce,0x5,_0xbd0b('0xc4'));rpcDb['createAgentHistory'](_0x1b8cce,_0xbd0b('0xff'));break;case'8':ut[_0xbd0b('0xfb')](_0x1b8cce,0x8,_0xbd0b('0xd9'));rpcDb[_0xbd0b('0xfc')](_0x1b8cce,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xbd0b('0xfb')](_0x1b8cce,0x16,_0xbd0b('0x100'));rpcDb[_0xbd0b('0xfc')](_0x1b8cce,_0xbd0b('0x101'));break;default:ut[_0xbd0b('0xfb')](_0x1b8cce,0xc,_0x1ce516[_0xbd0b('0xfa')]);rpcDb[_0xbd0b('0xfc')](_0x1b8cce,_0xbd0b('0x102'));}ut['updateOriginated'](_0x92e855,_0xbd0b('0x103'));logger['info'](_0xbd0b('0x104'),_0x1b8cce[_0xbd0b('0xb4')],_0xbd0b('0xb5'),_0x92e855[_0xbd0b('0x29')],_0xbd0b('0x77'),_0x92e855['originated']);delete this[_0xbd0b('0x16')][_0x1b8cce['uniqueid']];};Preview[_0xbd0b('0x69')]['checkInBlack']=function(_0x515725,_0x40b95b,_0x30c31b,_0x4b8b70,_0x11516b){var _0x5178a0=this;return new BPromise(function(_0x216ac5,_0x483490){if(_[_0xbd0b('0x73')](_0x40b95b)||_[_0xbd0b('0x73')](_0x40b95b[_0xbd0b('0x105')])||_[_0xbd0b('0x73')](_0x40b95b[_0xbd0b('0x105')]['phone'])||_['isNil'](_0x40b95b[_0xbd0b('0x106')])){_0x483490(ut[_0xbd0b('0x4e')](_0xbd0b('0x107'),_0x4b8b70,_0x11516b));return;}var _0x51c53a=uuid['v4']();var _0x10287e=_0x5178a0[_0xbd0b('0x13')][_0x40b95b[_0xbd0b('0x75')][_0xbd0b('0x29')]];var _0x4acf00=_0x30c31b?_0x5178a0[_0xbd0b('0x17')][_0x30c31b]['id']:undefined;_0x5178a0[_0xbd0b('0x16')][_0x51c53a]=new Action(_0x40b95b,_0x10287e,_0x51c53a,_0x30c31b,_0x4acf00);var _0x4a963a=_0x5178a0['actions'][_0x51c53a];_0x4a963a[_0xbd0b('0xae')]=_0x4b8b70;_0x4a963a[_0xbd0b('0xaf')]=_0x11516b;_0x4a963a[_0xbd0b('0x108')]=_0x30c31b;if(_['isEmpty'](_0x515725)){_0x5178a0[_0xbd0b('0x109')](_0x4a963a,_0x10287e,_0x40b95b,_0x30c31b)['then'](function(_0x6b883){logger[_0xbd0b('0x5c')](_0xbd0b('0x10a'),_0xbd0b('0x10b')+_0x4a963a[_0xbd0b('0x76')]+_0xbd0b('0x10c')+_0x4a963a[_0xbd0b('0x10d')],JSON[_0xbd0b('0x5e')](_0x6b883));ami['emit']('custom:agentcalled',ut['buildObj'](_0x4a963a,_0xbd0b('0x10e'),_0x5178a0[_0xbd0b('0x13')][_0x4a963a[_0xbd0b('0x76')]]));_0x216ac5(ut[_0xbd0b('0x4e')]('Calling'));})[_0xbd0b('0x7e')](function(_0x16f90f){ut[_0xbd0b('0x64')](_0xbd0b('0x10f'),_0x16f90f);_0x483490(ut[_0xbd0b('0x4e')](_0xbd0b('0x110'),_0x4b8b70,_0x11516b));});}else{_0x10287e[_0xbd0b('0x111')]+=0x1;ut[_0xbd0b('0x112')](_0x4a963a);rpcDb[_0xbd0b('0x113')](_0x4a963a,'[Blacklist][error]');delete _0x5178a0[_0xbd0b('0x16')][_0x51c53a];_0x483490(ut['message']('Contact\x20in\x20black\x20List',_0x4b8b70,_0x11516b));}});};Preview[_0xbd0b('0x69')][_0xbd0b('0xa0')]=function(_0x34de02){return!_[_0xbd0b('0x73')](_0x34de02)&&!_[_0xbd0b('0x73')](_0x34de02['name'])&&!_[_0xbd0b('0x73')](_0x34de02[_0xbd0b('0x57')])&&_0x34de02[_0xbd0b('0x57')]&&!_[_0xbd0b('0x73')](this[_0xbd0b('0x15')][util[_0xbd0b('0x5a')](_0xbd0b('0x114'),_0x34de02[_0xbd0b('0x29')])])&&!_[_0xbd0b('0x73')](this[_0xbd0b('0x15')][util[_0xbd0b('0x5a')](_0xbd0b('0x114'),_0x34de02[_0xbd0b('0x29')])][_0xbd0b('0x7d')])&&(this[_0xbd0b('0x15')][util[_0xbd0b('0x5a')]('SIP/%s',_0x34de02[_0xbd0b('0x29')])][_0xbd0b('0x7d')]==='reachable'||this[_0xbd0b('0x15')][util[_0xbd0b('0x5a')]('SIP/%s',_0x34de02[_0xbd0b('0x29')])]['status']===_0xbd0b('0x115'));};Preview[_0xbd0b('0x69')][_0xbd0b('0x8d')]=function(_0x3e0aca,_0x3ed509){var _0x127fa5=this;return new BPromise(function(_0x57c3b4,_0x55425f){_0x127fa5['execRun'](_0x3e0aca,_0x3ed509)[_0xbd0b('0x87')](function(_0x3d4410){_0x57c3b4(_[_0xbd0b('0x116')](_0x3d4410,[_0xbd0b('0x4e')]));})[_0xbd0b('0x7e')](function(_0x54ae9b){if(_0x54ae9b[_0xbd0b('0x117')]){rpcDb[_0xbd0b('0x118')](_0x3e0aca);}if(_0x54ae9b[_0xbd0b('0x57')]){rpcDb['disableContact'](_0x3e0aca);}_0x55425f(_['pick'](_0x54ae9b,[_0xbd0b('0x4e')]));});});};Preview['prototype'][_0xbd0b('0x119')]=function(_0x383db0,_0x45a898){var _0x35ac14=this;return new BPromise(function(_0x2cf9c5,_0x38256d){var _0x457202,_0x17d624;rpcDb[_0xbd0b('0x11a')](_0x383db0)['then'](function(_0x51a3a7){if(!_['isNil'](_0x51a3a7[0x0])){_0x17d624=_0x51a3a7[0x0][_0xbd0b('0x11b')]?![]:!![];_0x457202=_0x51a3a7[0x0][_0xbd0b('0x11b')]?!![]:![];_0x457202=_0x45a898?!![]:_0x457202;}var _0x7b805=_0x35ac14[_0xbd0b('0x11c')](_0x51a3a7);if(_0x7b805[_0xbd0b('0x11d')]){rpcDb['checkIsBlackList'](_['pick'](_0x51a3a7[0x0],[_0xbd0b('0x106'),_0xbd0b('0x11e')]))[_0xbd0b('0x87')](function(_0x309ce2){_0x35ac14[_0xbd0b('0x11f')](_0x309ce2,_0x51a3a7[0x0],_0x45a898,_0x17d624,_0x457202)[_0xbd0b('0x87')](function(_0x39b33e){_0x2cf9c5(_0x39b33e);})[_0xbd0b('0x7e')](function(_0x5c3d8a){_0x38256d(_0x5c3d8a);});})[_0xbd0b('0x7e')](function(_0x2f8d37){ut['logger'](_0xbd0b('0x120'),_0x2f8d37);_0x38256d(ut[_0xbd0b('0x4e')](_0xbd0b('0x121'),_0x17d624,_0x457202));});}else{_0x38256d(ut[_0xbd0b('0x4e')](_0x7b805['message'],_0x17d624,_0x457202));}})['catch'](function(_0x491b2a){ut[_0xbd0b('0x64')](_0xbd0b('0x122'),_0x491b2a);_0x38256d(ut[_0xbd0b('0x4e')](_0xbd0b('0x121'),![],!![]));});});};Preview[_0xbd0b('0x69')][_0xbd0b('0x11c')]=function(_0x53b518){if(_[_0xbd0b('0x73')](_0x53b518)||_[_0xbd0b('0x123')](_0x53b518)||!_[_0xbd0b('0x73')](_0x53b518[0x0][_0xbd0b('0x8b')])&&_[_0xbd0b('0x73')](_0x53b518[0x0][_0xbd0b('0x8b')][_0xbd0b('0x29')])){ut[_0xbd0b('0x64')](_0xbd0b('0x124'),_0x53b518);return{'isValid':![],'message':_0xbd0b('0x125')};}var _0x29db23=this[_0xbd0b('0x13')][_0x53b518[0x0][_0xbd0b('0x75')][_0xbd0b('0x29')]];_0x29db23[_0xbd0b('0x4e')]='ACTIVE';if(_[_0xbd0b('0x73')](_0x29db23)){ut[_0xbd0b('0x64')](_0xbd0b('0x126'),_0x29db23);return{'isValid':![],'message':_0xbd0b('0x127')};}if(!this[_0xbd0b('0xa0')](_0x29db23[_0xbd0b('0x56')])){ut[_0xbd0b('0x64')](_0xbd0b('0x128'),_0xbd0b('0x129')+_0x29db23[_0xbd0b('0x29')]+_0xbd0b('0x12a'));if(!this['isTrunkReachable'](_0x29db23[_0xbd0b('0xa1')])){ut[_0xbd0b('0x64')](_0xbd0b('0x128'),_0x29db23[_0xbd0b('0x29')]+_0xbd0b('0x12b'));return{'isValid':![],'message':_0xbd0b('0x12c')};}}if(!ut[_0xbd0b('0x9f')](_0x29db23['dialActive'])){ut['logger'](_0xbd0b('0x12d'),_0x29db23['name']+_0xbd0b('0x12e'));return{'isValid':![],'message':_0xbd0b('0x129')+_0x29db23['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xbd0b('0x12f')};};Preview[_0xbd0b('0x69')][_0xbd0b('0x109')]=function(_0x58d4fc,_0x6dceca,_0x57b25c,_0x58504a){var _0x503482=this;return new BPromise(function(_0x464c74,_0x6cce17){var _0x5a7f4b=_0x58d4fc[_0xbd0b('0xb4')];var _0x341a15=_0x503482[_0xbd0b('0xa0')](_0x6dceca[_0xbd0b('0x56')])?util[_0xbd0b('0x5a')](_0xbd0b('0x130'),_0x6dceca[_0xbd0b('0x56')][_0xbd0b('0x29')],_['isNil'](_0x6dceca[_0xbd0b('0x39')])?'':_0x6dceca[_0xbd0b('0x39')][_0xbd0b('0x131')]()||'',_0x6dceca[_0xbd0b('0x132')]>0x0?_0x57b25c[_0xbd0b('0x105')][_0xbd0b('0x133')]['substring'](_0x6dceca[_0xbd0b('0x132')]):_0x57b25c[_0xbd0b('0x105')][_0xbd0b('0x133')]):util[_0xbd0b('0x5a')]('SIP/%s/%s%s',_['isNil'](_0x6dceca['TrunkBackup'])?_0x6dceca[_0xbd0b('0x56')][_0xbd0b('0x29')]:_0x6dceca['TrunkBackup'][_0xbd0b('0x29')],_[_0xbd0b('0x73')](_0x6dceca[_0xbd0b('0x39')])?'':_0x6dceca[_0xbd0b('0x39')][_0xbd0b('0x131')]()||'',_0x6dceca[_0xbd0b('0x132')]>0x0?_0x57b25c['Contact'][_0xbd0b('0x133')][_0xbd0b('0x134')](_0x6dceca[_0xbd0b('0x132')]):_0x57b25c[_0xbd0b('0x105')][_0xbd0b('0x133')]);var _0x379097=_0x503482[_0xbd0b('0xa0')](_0x6dceca[_0xbd0b('0x56')])?ut[_0xbd0b('0x135')](_0x6dceca['Trunk'][_0xbd0b('0x136')],_0x6dceca['dialOriginateCallerIdName'],_0x6dceca[_0xbd0b('0x137')]>0x0?ut[_0xbd0b('0x138')](_0x6dceca[_0xbd0b('0x38')],_0x6dceca[_0xbd0b('0x137')]):_0x6dceca['dialOriginateCallerIdNumber']):ut[_0xbd0b('0x135')](_[_0xbd0b('0x73')](_0x6dceca[_0xbd0b('0xa1')])?_0x6dceca[_0xbd0b('0x56')]['callerid']:_0x6dceca[_0xbd0b('0xa1')]['callerid'],_0x6dceca[_0xbd0b('0x37')],_0x6dceca[_0xbd0b('0x137')]>0x0?ut[_0xbd0b('0x138')](_0x6dceca[_0xbd0b('0x38')],_0x6dceca['dialRandomLastDigitCallerIdNumber']):_0x6dceca[_0xbd0b('0x38')]);if(_0x379097){_0x58d4fc[_0xbd0b('0x139')]=ut[_0xbd0b('0x13a')](_0x379097);_0x58d4fc[_0xbd0b('0x13b')]=ut[_0xbd0b('0x13c')](_0x379097);}var _0xa8899e=ut[_0xbd0b('0x13d')](_0x6dceca,_0x57b25c,_0x341a15,_0x379097,_0x5a7f4b,_0x58d4fc);_[_0xbd0b('0x13e')](_0x58d4fc,ut[_0xbd0b('0x13f')](_0xa8899e));_0x58d4fc[_0xbd0b('0x91')]=moment()[_0xbd0b('0x5a')](_0xbd0b('0x92'));ami[_0xbd0b('0x7c')](ut[_0xbd0b('0x140')](_0x58d4fc,_0x6dceca,_0xa8899e,_0x58d4fc[_0xbd0b('0xaf')],_0x58504a))[_0xbd0b('0x87')](function(_0x361926){_0x6dceca[_0xbd0b('0x4f')]+=0x1;logger['info'](_0xbd0b('0x141'),_0x5a7f4b,_0xbd0b('0xb5'),_0x6dceca['name'],_0xbd0b('0x77'),_0x6dceca[_0xbd0b('0x4f')]);_0x464c74(_0x361926);})[_0xbd0b('0x7e')](function(_0x1e379f){ut[_0xbd0b('0xfb')](_0x58d4fc,0xe,_0xbd0b('0x142'));rpcDb['createAgentHistory'](_0x58d4fc,_0xbd0b('0x143'));_0x6cce17(_0x1e379f);});});};Preview[_0xbd0b('0x69')][_0xbd0b('0x21')]=function(_0x14d442){if(this['actions'][_0x14d442['linkedid']]){this[_0xbd0b('0x16')][_0x14d442['linkedid']][_0xbd0b('0x144')]=_0x14d442['channel'];}};Preview['prototype'][_0xbd0b('0x1a')]=function(_0xa39e71){var _0x23a23c=this;var _0x7bcdc0=this['actions'][_0xa39e71[_0xbd0b('0x145')]];if(_0x7bcdc0){if(_0x7bcdc0[_0xbd0b('0x108')]&&this['agents'][_0x7bcdc0[_0xbd0b('0x108')]]){ut[_0xbd0b('0x146')](_0x7bcdc0,this[_0xbd0b('0x17')][_0x7bcdc0['lookAgent']][_0xbd0b('0x29')],this[_0xbd0b('0x17')][_0x7bcdc0[_0xbd0b('0x108')]]['id']);}var _0x204722=_['clone'](_0x7bcdc0);_0x204722[_0xbd0b('0xb1')]=moment()[_0xbd0b('0x5a')](_0xbd0b('0x92'));var _0x505f61=_0x23a23c[_0xbd0b('0x13')][_0x7bcdc0[_0xbd0b('0x76')]];if(ut[_0xbd0b('0x147')](_0xa39e71[_0xbd0b('0x148')])){if(_0x7bcdc0[_0xbd0b('0xae')]){rpcDb[_0xbd0b('0x118')](_0x7bcdc0[_0xbd0b('0x10d')]);}if(_0x7bcdc0[_0xbd0b('0xaf')]){rpcDb[_0xbd0b('0x90')](_0x7bcdc0[_0xbd0b('0x10d')]);}ami[_0xbd0b('0x27')](_0xbd0b('0x149'),ut[_0xbd0b('0xa6')](_0x7bcdc0,'rejected',this[_0xbd0b('0x13')][_0x7bcdc0[_0xbd0b('0x76')]]));this[_0xbd0b('0x14a')](_0x204722,_0x505f61,_0xa39e71);}else{_0x7bcdc0[_0xbd0b('0x91')]=moment()[_0xbd0b('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xbd0b('0xfb')](_0x204722,0x4,_0xbd0b('0xbb'));rpcDb[_0xbd0b('0xfc')](_0x204722,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xbd0b('0x69')]['syncHangup']=function(_0x45cad3){var _0x9d3adb=this;var _0x4e981e=this['actions'][_0x45cad3[_0xbd0b('0xc1')]];var _0x4ad616;if(_0x4e981e){_0x4ad616=this[_0xbd0b('0x13')][_0x4e981e[_0xbd0b('0x76')]];logger[_0xbd0b('0x5c')](_0xbd0b('0x14b'),_0x45cad3[_0xbd0b('0xc1')],_0xbd0b('0xb5'),_0x4ad616[_0xbd0b('0x29')],_0xbd0b('0x78'),_0x4ad616[_0xbd0b('0x2d')]);}if(this[_0xbd0b('0x16')][_0x45cad3[_0xbd0b('0xc1')]]&&_0x45cad3['linkedid']!==_0x45cad3['uniqueid']){if(_0x45cad3[_0xbd0b('0x14c')]==='16'&&this['actions'][_0x45cad3[_0xbd0b('0xc1')]][_0xbd0b('0x79')]){this[_0xbd0b('0x14d')](_0x45cad3,_0x45cad3['linkedid'],_0x45cad3[_0xbd0b('0x14c')]);}else if(this[_0xbd0b('0x16')][_0x45cad3[_0xbd0b('0xc1')]][_0xbd0b('0x79')]){logger[_0xbd0b('0x5c')]('[syncHangup][talking][cause]',_0x45cad3[_0xbd0b('0xc1')],_0x45cad3[_0xbd0b('0x14c')],_0xbd0b('0xb5'),_0x4ad616['name'],'pTalking:\x20',_0x4ad616[_0xbd0b('0x2d')]);this[_0xbd0b('0x14d')](_0x45cad3,_0x45cad3['linkedid'],_0x45cad3[_0xbd0b('0x14c')]);}}else if(_0x4e981e&&_[_0xbd0b('0x73')](_0x4e981e[_0xbd0b('0x14e')])&&_0x4ad616[_0xbd0b('0x14f')]&&_0x45cad3['linkedid']===_0x45cad3[_0xbd0b('0xb4')]&&_[_0xbd0b('0x73')](_0x45cad3[_0xbd0b('0xfa')])&&_0x45cad3[_0xbd0b('0x14c')]==='16'&&_0x45cad3['channelstate']==='6'&&_[_0xbd0b('0xf8')](_0x4e981e['transfer'])){if(_0x4e981e[_0xbd0b('0xae')]){rpcDb[_0xbd0b('0x118')](_0x4e981e['idContact']);}if(_0x4e981e[_0xbd0b('0xaf')]){rpcDb['disableContact'](_0x4e981e['idContact']);}_0x45cad3[_0xbd0b('0xfa')]='22';this['callProgressDetectingAgent'](_0x4e981e,_0x4ad616,_0x45cad3);}else if(_0x4e981e&&_0x4e981e[_0xbd0b('0x150')]){if(_0x45cad3[_0xbd0b('0x14c')]==='16'&&this[_0xbd0b('0x16')][_0x45cad3['linkedid']]['dialAnswer']){logger[_0xbd0b('0x5c')](_0xbd0b('0x151'),_0x45cad3[_0xbd0b('0xc1')],_0x45cad3[_0xbd0b('0x14c')],_0xbd0b('0xb5'),_0x4ad616[_0xbd0b('0x29')],_0xbd0b('0x78'),_0x4ad616[_0xbd0b('0x2d')]);this[_0xbd0b('0x14d')](_0x45cad3,_0x45cad3[_0xbd0b('0xc1')],_0x45cad3['cause']);}else if(this[_0xbd0b('0x16')][_0x45cad3[_0xbd0b('0xc1')]]['dialAnswer']){logger[_0xbd0b('0x5c')]('[syncHangup][talking][cause]',_0x45cad3[_0xbd0b('0xc1')],_0x45cad3[_0xbd0b('0x14c')],_0xbd0b('0xb5'),_0x4ad616[_0xbd0b('0x29')],'pTalking:\x20',_0x4ad616[_0xbd0b('0x2d')]);this[_0xbd0b('0x14d')](_0x45cad3,_0x45cad3[_0xbd0b('0xc1')],_0x45cad3[_0xbd0b('0x14c')]);}}};Preview['prototype'][_0xbd0b('0x20')]=function(_0x21bd14){if(this['actions'][_0x21bd14[_0xbd0b('0xf7')]]&&_0x21bd14[_0xbd0b('0xf7')]!==_0x21bd14[_0xbd0b('0x152')]){this[_0xbd0b('0x14d')](_0x21bd14,_0x21bd14['destlinkedid'],_0x21bd14[_0xbd0b('0xed')]);}};Preview[_0xbd0b('0x69')][_0xbd0b('0x1d')]=function(_0x4fa3d8){if(this[_0xbd0b('0x16')][_0x4fa3d8[_0xbd0b('0xc1')]]&&_0x4fa3d8[_0xbd0b('0xc1')]!==_0x4fa3d8['uniqueid']&&!this[_0xbd0b('0x16')][_0x4fa3d8[_0xbd0b('0xc1')]][_0xbd0b('0x79')]){if(_0x4fa3d8[_0xbd0b('0x14c')]==='1'){this['callProgressDetectingCustomer'](_0x4fa3d8,_0x4fa3d8['linkedid'],_0x4fa3d8[_0xbd0b('0x14c')]);}}};Preview['prototype'][_0xbd0b('0x153')]=function(_0x283f7b,_0xa80765,_0x5965dc){if(this['actions'][_0x283f7b]){if(_['isNil'](this['actions'][_0x283f7b][_0xbd0b('0x154')])){this[_0xbd0b('0x16')][_0x283f7b][_0xbd0b('0x154')]={};}this[_0xbd0b('0x16')][_0x283f7b][_0xbd0b('0x154')][_0xa80765]=_0x5965dc;}};Preview[_0xbd0b('0x69')]['syncVarSet']=function(_0x170264){try{if(!_[_0xbd0b('0x73')](_0x170264)){if(ut[_0xbd0b('0x155')](_['keys'](_0x170264[_0xbd0b('0x156')])[0x0])){this[_0xbd0b('0x153')](_0x170264[_0xbd0b('0xb4')],_[_0xbd0b('0x157')](_0x170264[_0xbd0b('0x156')])[0x0],_0x170264[_0xbd0b('0x158')]);}}}catch(_0x59018d){logger[_0xbd0b('0x159')](_0xbd0b('0x15a'),util[_0xbd0b('0x15b')](_0x59018d,{'showHidden':![],'depth':null}));}};Preview[_0xbd0b('0x69')]['syncAttendedTransfer']=function(_0x54741e){if(_0x54741e){if(this[_0xbd0b('0x16')][_0x54741e[_0xbd0b('0x15c')]]){this[_0xbd0b('0x16')][_0x54741e[_0xbd0b('0x15c')]][_0xbd0b('0x150')]=!![];}}};Preview[_0xbd0b('0x69')][_0xbd0b('0x25')]=function(_0x1ab9a1){if(_0x1ab9a1){if(this[_0xbd0b('0x16')][_0x1ab9a1['transfererlinkedid']]){this[_0xbd0b('0x16')][_0x1ab9a1[_0xbd0b('0x15d')]][_0xbd0b('0x150')]=!![];}}};module[_0xbd0b('0x15e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index fb244a4..2946fa8 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 _0x9e20=['[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x407c57,_0x4fe7b3){var _0xb8bf84=function(_0x48c6b7){while(--_0x48c6b7){_0x407c57['push'](_0x407c57['shift']());}};_0xb8bf84(++_0x4fe7b3);}(_0x9e20,0xf8));var _0x09e2=function(_0x21ca43,_0x5da01a){_0x21ca43=_0x21ca43-0x0;var _0x8d1de8=_0x9e20[_0x21ca43];return _0x8d1de8;};'use strict';var util=require(_0x09e2('0x0'));var BPromise=require(_0x09e2('0x1'));var logger=require('../../../config/logger')('preview');var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x09e2('0x2'));var cmHopperHistory=require(_0x09e2('0x3'));var cmHopperBlack=require(_0x09e2('0x4'));var voiceQueueRt=require(_0x09e2('0x5'));var agentReportPreview=require(_0x09e2('0x6'));var voiceQueueReport=require(_0x09e2('0x7'));function loggerCatch(_0x487499){return function(_0x4af668){logger[_0x09e2('0x8')](_0x487499,util[_0x09e2('0x9')](_0x4af668,{'showHidden':![],'depth':null}));};}function create(_0x110b82){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopperHistory[_0x09e2('0xc')](_0x110b82))[_0x09e2('0xd')](loggerCatch(_0x09e2('0xe')));}function createAgent(_0x123c5e){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](agentReportPreview[_0x09e2('0xc')](_0x123c5e))[_0x09e2('0xd')](loggerCatch(_0x09e2('0xe')));}function moveContact(_0x58375b){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopper['moveContactManagedDialer'](_0x58375b,!![]))[_0x09e2('0xd')](loggerCatch(_0x09e2('0xf')));}exports[_0x09e2('0x10')]=function(_0x395749){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopperBlack[_0x09e2('0x10')](_0x395749))[_0x09e2('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x09e2('0x11')]=function(_0x506225){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopper[_0x09e2('0x11')](_0x506225))[_0x09e2('0xd')](loggerCatch(_0x09e2('0x12')));};exports['createHistory']=function(_0x325f1d,_0xfd0e16){create(_0x325f1d)[_0x09e2('0xd')](loggerCatch(_0xfd0e16));moveContact(_0x325f1d)['catch'](loggerCatch(_0xfd0e16));};exports[_0x09e2('0x13')]=function(_0x115110,_0x11bc6e){createAgent(_0x115110)[_0x09e2('0xd')](loggerCatch(_0x11bc6e));};exports[_0x09e2('0x14')]=function(_0x57e64f,_0x4527e5){create(_0x57e64f)['catch'](loggerCatch(_0x4527e5));};exports[_0x09e2('0x15')]=function(_0x1b5bdf,_0x5cddd8){moveContact(_0x1b5bdf)[_0x09e2('0xd')](loggerCatch(_0x5cddd8));};exports[_0x09e2('0x16')]=function(_0x5b61a7,_0x241fe0,_0x5c63cc){if(_0x241fe0){_0x5b61a7[_0x09e2('0x17')]=null;}if(_0x5c63cc){_0x5b61a7[_0x09e2('0x18')]=![];}return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopper[_0x09e2('0x16')](_0x5b61a7))['catch'](loggerCatch(_0x09e2('0x19')));};exports[_0x09e2('0x1a')]=function(_0x2809d6){return BPromise['resolve']()[_0x09e2('0xb')](cmHopper[_0x09e2('0x1a')](_0x2809d6))[_0x09e2('0xd')](loggerCatch(_0x09e2('0x1b')));};exports[_0x09e2('0x1c')]=function(_0x43229c){return BPromise[_0x09e2('0xa')]()['then'](cmHopper[_0x09e2('0x1c')]({'UserId':null},_0x43229c,0x1))[_0x09e2('0xd')](loggerCatch(_0x09e2('0x1d')));};exports[_0x09e2('0x1e')]=function(_0x496cea){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopper[_0x09e2('0x1c')]({'active':![]},_0x496cea,0x1))[_0x09e2('0xd')](loggerCatch(_0x09e2('0x1f')));};exports[_0x09e2('0x20')]=function(_0xc17c15){var _0x1603b1={};_0x1603b1['type']=_0xc17c15[_0x09e2('0x21')];_0x1603b1['uniqueid']=_0xc17c15[_0x09e2('0x22')];_0x1603b1[_0x09e2('0x23')]=_0xc17c15['calleridnum'];_0x1603b1[_0x09e2('0x24')]=_0xc17c15['calleridname'];_0x1603b1[_0x09e2('0x25')]=_0xc17c15['queue'];_0x1603b1[_0x09e2('0x26')]=_0xc17c15[_0x09e2('0x27')];_0x1603b1['queuecallerleaveAt']=_0xc17c15['answertime'];_0x1603b1[_0x09e2('0x28')]=0x1;_0x1603b1[_0x09e2('0x29')]=_0xc17c15['endtime'];_0x1603b1[_0x09e2('0x2a')]=_0xc17c15[_0x09e2('0x2b')];_0x1603b1[_0x09e2('0x2c')]='from-sip';_0x1603b1[_0x09e2('0x2d')]=_0x09e2('0x2e');_0x1603b1[_0x09e2('0x2f')]=0x0;_0x1603b1['assigned']=0x1;_0x1603b1[_0x09e2('0x30')]=_0xc17c15[_0x09e2('0x2b')];_0x1603b1[_0x09e2('0x31')]='COMPLETED';return BPromise[_0x09e2('0xa')]()['then'](voiceQueueReport[_0x09e2('0x32')](_0x1603b1))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x09e2('0x33')]=function(_0x3a575b,_0x502d96){return BPromise['resolve']()[_0x09e2('0xb')](cmHopper[_0x09e2('0x33')](_0x3a575b,_0x502d96))[_0x09e2('0xd')](loggerCatch(_0x09e2('0x34')));};exports[_0x09e2('0x35')]=function(_0x5b0e90){return BPromise[_0x09e2('0xa')]()[_0x09e2('0xb')](cmHopper[_0x09e2('0x16')](_0x5b0e90,!![],!![]))['catch'](loggerCatch(_0x09e2('0x36')));}; \ No newline at end of file +var _0x232b=['[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch'];(function(_0x1973a3,_0x53bee8){var _0x229ecf=function(_0x4aa302){while(--_0x4aa302){_0x1973a3['push'](_0x1973a3['shift']());}};_0x229ecf(++_0x53bee8);}(_0x232b,0xff));var _0xb232=function(_0x2fa9ef,_0x11eb49){_0x2fa9ef=_0x2fa9ef-0x0;var _0x40a7db=_0x232b[_0x2fa9ef];return _0x40a7db;};'use strict';var util=require('util');var BPromise=require(_0xb232('0x0'));var logger=require(_0xb232('0x1'))(_0xb232('0x2'));var _=require(_0xb232('0x3'));var cmHopper=require(_0xb232('0x4'));var cmHopperFinal=require(_0xb232('0x5'));var cmHopperHistory=require(_0xb232('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xb232('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xb232('0x8'));function loggerCatch(_0x4e3dce){return function(_0x1182c9){logger[_0xb232('0x9')](_0x4e3dce,util[_0xb232('0xa')](_0x1182c9,{'showHidden':![],'depth':null}));};}function create(_0x133e14){return BPromise[_0xb232('0xb')]()[_0xb232('0xc')](cmHopperHistory[_0xb232('0xd')](_0x133e14))[_0xb232('0xe')](loggerCatch(_0xb232('0xf')));}function createAgent(_0x51ae76){return BPromise[_0xb232('0xb')]()[_0xb232('0xc')](agentReportPreview[_0xb232('0xd')](_0x51ae76))[_0xb232('0xe')](loggerCatch(_0xb232('0xf')));}function moveContact(_0xac0157){return BPromise['resolve']()[_0xb232('0xc')](cmHopper[_0xb232('0x10')](_0xac0157,!![]))[_0xb232('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xb232('0x11')]=function(_0x31e174){return BPromise['resolve']()[_0xb232('0xc')](cmHopperBlack['checkIsBlackList'](_0x31e174))[_0xb232('0xe')](loggerCatch(_0xb232('0x12')));};exports[_0xb232('0x13')]=function(_0x23e300){return BPromise[_0xb232('0xb')]()['then'](cmHopper['getContactPreview'](_0x23e300))[_0xb232('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0xb232('0xd')]=function(_0x5420fa,_0x50f5b2){create(_0x5420fa)[_0xb232('0xe')](loggerCatch(_0x50f5b2));moveContact(_0x5420fa)[_0xb232('0xe')](loggerCatch(_0x50f5b2));};exports[_0xb232('0x14')]=function(_0x29f434,_0x44c70e){createAgent(_0x29f434)['catch'](loggerCatch(_0x44c70e));};exports[_0xb232('0x15')]=function(_0x539a44,_0x42314a){create(_0x539a44)[_0xb232('0xe')](loggerCatch(_0x42314a));};exports[_0xb232('0x16')]=function(_0x5b91e4,_0x5239aa){moveContact(_0x5b91e4)['catch'](loggerCatch(_0x5239aa));};exports[_0xb232('0x17')]=function(_0x1de27a,_0x2e7b38,_0x56c3aa){if(_0x2e7b38){_0x1de27a[_0xb232('0x18')]=null;}if(_0x56c3aa){_0x1de27a[_0xb232('0x19')]=![];}return BPromise[_0xb232('0xb')]()['then'](cmHopper[_0xb232('0x17')](_0x1de27a))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xb232('0x1a')]=function(_0x226768){return BPromise['resolve']()[_0xb232('0xc')](cmHopper[_0xb232('0x1a')](_0x226768))[_0xb232('0xe')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x53ccdf){return BPromise['resolve']()['then'](cmHopper[_0xb232('0x1b')]({'UserId':null},_0x53ccdf,0x1))[_0xb232('0xe')](loggerCatch(_0xb232('0x1c')));};exports[_0xb232('0x1d')]=function(_0x13a452){return BPromise[_0xb232('0xb')]()['then'](cmHopper[_0xb232('0x1b')]({'active':![]},_0x13a452,0x1))[_0xb232('0xe')](loggerCatch('[activeContact]\x20'));};exports[_0xb232('0x1e')]=function(_0x5cbed9){var _0x52a2ea={};_0x52a2ea[_0xb232('0x1f')]=_0x5cbed9[_0xb232('0x1f')];_0x52a2ea[_0xb232('0x20')]=_0x5cbed9[_0xb232('0x20')];_0x52a2ea[_0xb232('0x21')]=_0x5cbed9['calleridnum'];_0x52a2ea[_0xb232('0x22')]=_0x5cbed9[_0xb232('0x22')];_0x52a2ea[_0xb232('0x23')]=_0x5cbed9['queue'];_0x52a2ea[_0xb232('0x24')]=_0x5cbed9[_0xb232('0x25')];_0x52a2ea['queuecallerleaveAt']=_0x5cbed9[_0xb232('0x25')];_0x52a2ea[_0xb232('0x26')]=0x1;_0x52a2ea[_0xb232('0x27')]=_0x5cbed9[_0xb232('0x28')];_0x52a2ea[_0xb232('0x29')]=_0x5cbed9[_0xb232('0x2a')];_0x52a2ea['context']=_0xb232('0x2b');_0x52a2ea['exten']=_0xb232('0x2c');_0x52a2ea[_0xb232('0x2d')]=0x0;_0x52a2ea[_0xb232('0x2e')]=0x1;_0x52a2ea[_0xb232('0x2f')]=_0x5cbed9[_0xb232('0x2a')];_0x52a2ea[_0xb232('0x30')]='COMPLETED';return BPromise[_0xb232('0xb')]()['then'](voiceQueueReport[_0xb232('0x31')](_0x52a2ea))[_0xb232('0xe')](loggerCatch(_0xb232('0x32')));};exports[_0xb232('0x33')]=function(_0x43ac0b,_0x1be4bc){return BPromise[_0xb232('0xb')]()[_0xb232('0xc')](cmHopper[_0xb232('0x33')](_0x43ac0b,_0x1be4bc))['catch'](loggerCatch(_0xb232('0x34')));};exports['rescheduleContactInQueue']=function(_0x2a021a){return BPromise[_0xb232('0xb')]()[_0xb232('0xc')](cmHopper[_0xb232('0x17')](_0x2a021a,!![],!![]))[_0xb232('0xe')](loggerCatch(_0xb232('0x35')));}; \ 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 c4738ee..565b97c 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 _0x9bd3=['callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','logAgent','responsetime','ringtime','logLookAgent','UserId','endtime','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','active','scheduledat','add','ListId','VoiceQueueId','decrementTalkink','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','voice','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer'];(function(_0xdffe7d,_0x1d258d){var _0x3063e0=function(_0x2ac37d){while(--_0x2ac37d){_0xdffe7d['push'](_0xdffe7d['shift']());}};_0x3063e0(++_0x1d258d);}(_0x9bd3,0x12e));var _0x39bd=function(_0x5ac7b5,_0x119a69){_0x5ac7b5=_0x5ac7b5-0x0;var _0x341a7a=_0x9bd3[_0x5ac7b5];return _0x341a7a;};'use strict';var util=require(_0x39bd('0x0'));var _=require(_0x39bd('0x1'));var moment=require(_0x39bd('0x2'));var logger=require(_0x39bd('0x3'))(_0x39bd('0x4'));var ipAgi=process[_0x39bd('0x5')][_0x39bd('0x6')]||'127.0.0.1';function getSeconds(_0x4e7c51,_0x255b9d){var _0x485ddb=moment(_0x4e7c51)[_0x39bd('0x7')](0x0);var _0x39c454=moment(_0x255b9d)[_0x39bd('0x7')](0x0);return _0x485ddb[_0x39bd('0x8')](_0x39c454,_0x39bd('0x9'));}exports[_0x39bd('0xa')]=function(_0x353aa9){return function(_0x190ea5){logger[_0x39bd('0xb')](_0x353aa9,util[_0x39bd('0xc')](_0x190ea5,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2d0708,_0xe53796){logger[_0x39bd('0xd')](_0x2d0708,util[_0x39bd('0xc')](_0xe53796,{'showHidden':![],'depth':null}));};exports[_0x39bd('0xe')]=function(_0x4a26d9,_0x1d8161){logger[_0x39bd('0xb')](_0x4a26d9,util['inspect'](_0x1d8161,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x883c59){return function(_0x2135cd){logger['info'](_0x883c59,util[_0x39bd('0xc')](_0x2135cd,{'showHidden':![],'depth':null}));};};exports[_0x39bd('0xf')]=function(_0x1f490d,_0x5e0396,_0x1b4ebd){return{'message':_0x1f490d,'unlock':_0x5e0396,'active':_0x1b4ebd};};exports[_0x39bd('0x10')]=function(_0x5b5727,_0x1f893b,_0x31db85){if(!_[_0x39bd('0x11')](_0x31db85)&&_0x39bd('0x12')===typeof _0x31db85&&!_[_0x39bd('0x13')](_0x31db85)){if(!_[_0x39bd('0x11')](_0x1f893b)&&_0x39bd('0x12')===typeof _0x1f893b&&!_[_0x39bd('0x13')](_0x1f893b)){return util['format'](_0x39bd('0x14'),_0x1f893b,_0x31db85);}return util[_0x39bd('0x15')](_0x39bd('0x14'),_0x31db85,_0x31db85);}if(!_[_0x39bd('0x11')](_0x5b5727)&&_0x39bd('0x12')===typeof _0x5b5727&&!_['isEmpty'](_0x5b5727)){return _0x5b5727;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x455412){if(_[_0x39bd('0x16')](_0x455412)){return![];}return _0x455412;};exports[_0x39bd('0x17')]=function(_0x5bf6b6,_0x2556ca,_0x20c1a1,_0x357ad8,_0x546f0f,_0x417277){var _0x273c4a={'XMD-QUEUE':_0x2556ca['Queue']?_0x2556ca[_0x39bd('0x18')][_0x39bd('0x19')]:'','XMD-CALLERID':_0x357ad8,'XMD-CALLERID-PREVIEW':_0x417277?util['format'](_0x39bd('0x14'),_0x417277[_0x39bd('0x1a')],_0x417277[_0x39bd('0x1b')]):_0x357ad8,'XMD-DIALID':_0x546f0f,'XMD-CONTACTID':_0x2556ca[_0x39bd('0x1c')],'XMD-CDRTYPE':_0x39bd('0x1d'),'CALLERID(all)':_0x357ad8,'XMD-VOICEQUEUEID':_0x2556ca['VoiceQueueId'],'XMD-DIALCHANNEL':_0x20c1a1,'XMD-DIALTIMEOUT':_0x5bf6b6[_0x39bd('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x39bd('0x15')]('\x22rtTxX%s%s\x22',_0x5bf6b6[_0x39bd('0x1f')]?'g':'',_[_0x39bd('0x13')](_0x5bf6b6[_0x39bd('0x20')])?'':_0x39bd('0x21')),'XMD-DIALURL':_0x5bf6b6['dialPreviewUrl']||'','XMD-AGI':_0x5bf6b6[_0x39bd('0x22')]?util[_0x39bd('0x15')](_0x39bd('0x23'),ipAgi,_0x5bf6b6[_0x39bd('0x22')]):_0x39bd('0x24'),'XMD-AGIAFTER':_0x5bf6b6['dialQueueProject2']?util[_0x39bd('0x15')](_0x39bd('0x23'),ipAgi,_0x5bf6b6[_0x39bd('0x1f')]):_0x39bd('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x417277?_0x417277['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x417277?_0x417277[_0x39bd('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x39bd('0x26')};if(!_[_0x39bd('0x13')](_0x5bf6b6['monitor_format'])){_0x273c4a[util[_0x39bd('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5bf6b6[_0x39bd('0x20')];_0x273c4a[util[_0x39bd('0x15')]('%s',_0x39bd('0x27'))]=_0x546f0f;}if(_0x2556ca&&_0x2556ca[_0x39bd('0x28')]){for(var _0x30de53 in _0x2556ca[_0x39bd('0x28')]){if(_0x2556ca[_0x39bd('0x28')][_0x39bd('0x29')](_0x30de53)){if(!_[_0x39bd('0x16')](_0x2556ca['Contact'][_0x30de53])&&_0x30de53!=='id'&&_0x30de53!=='tags'&&_0x30de53!==_0x39bd('0x2a')&&_0x30de53!==_0x39bd('0x2b')){_0x273c4a[util[_0x39bd('0x15')](_0x39bd('0x2c'),'XMD-',_[_0x39bd('0x2d')](_0x30de53))]=_0x2556ca[_0x39bd('0x28')][_0x30de53];}}}}return _0x273c4a;};exports[_0x39bd('0x2e')]=function(_0x45d4eb){var _0x215378={};for(var _0x4be4dd in _0x45d4eb){if(_0x45d4eb[_0x39bd('0x29')](_0x4be4dd)){_0x215378[util['format']('%s',_[_0x39bd('0x2f')](_0x4be4dd))]=_0x45d4eb[_0x4be4dd];}}return{'variables':_0x215378};};exports[_0x39bd('0x30')]=function(_0x3d5593,_0x3ef5b5){if(!_[_0x39bd('0x16')](_0x3d5593)){if(_0x3d5593['hasOwnProperty'](_0x39bd('0x31'))){if(_0x3d5593[_0x39bd('0x31')]>0x0){_0x3d5593[_0x39bd('0x31')]-=0x1;}else{logger['error'](_0x39bd('0x32'),_0x3ef5b5);}}}else{logger[_0x39bd('0xb')](_0x39bd('0x33'),_0x3ef5b5);}};exports['logBlacklist']=function(_0x88b57d){var _0x4971ac=moment()[_0x39bd('0x15')](_0x39bd('0x34'));_0x88b57d[_0x39bd('0x35')]=0xd;_0x88b57d[_0x39bd('0x36')]=_0x39bd('0x37');_0x88b57d[_0x39bd('0x38')]=_0x4971ac;_0x88b57d['responsetime']=_0x4971ac;_0x88b57d['endtime']=_0x4971ac;};exports[_0x39bd('0x39')]=function(_0x305c4c,_0x35ff0f,_0x47f931){var _0x4c7ea1=moment()[_0x39bd('0x15')](_0x39bd('0x34'));_0x305c4c['state']=_0x35ff0f;_0x305c4c['statedesc']=_0x47f931;_0x305c4c[_0x39bd('0x3a')]=_0x4c7ea1;_0x305c4c[_0x39bd('0x3b')]=getSeconds(_0x305c4c[_0x39bd('0x3a')],_0x305c4c[_0x39bd('0x38')]);};exports[_0x39bd('0x3c')]=function(_0x4979d5,_0x916a51,_0x4c7052){_0x4979d5['membername']=_0x916a51;_0x4979d5[_0x39bd('0x3d')]=_0x4c7052;};exports['logCustomer']=function(_0x2428a7,_0x4f7428,_0x12c8bc){var _0x33c5ad=moment()[_0x39bd('0x15')](_0x39bd('0x34'));_0x2428a7['state']=_0x4f7428;_0x2428a7['statedesc']=_0x12c8bc;_0x2428a7[_0x39bd('0x3a')]=_0x2428a7[_0x39bd('0x3a')]?_0x2428a7['responsetime']:_0x33c5ad;_0x2428a7[_0x39bd('0x3e')]=_0x2428a7[_0x39bd('0x3e')]?_0x2428a7[_0x39bd('0x3e')]:_0x33c5ad;_0x2428a7[_0x39bd('0x3b')]=getSeconds(_0x2428a7[_0x39bd('0x3a')]||0x0,_0x2428a7[_0x39bd('0x38')]||0x0);_0x2428a7[_0x39bd('0x3f')]=_0x2428a7[_0x39bd('0x40')]?getSeconds(_0x2428a7[_0x39bd('0x3e')],_0x2428a7['answertime']):0x0;};exports[_0x39bd('0x41')]=function(_0x4b540b){return _0x4b540b===_0x39bd('0x42');};exports[_0x39bd('0x43')]=function(_0x4f3d35,_0x16e68f,_0x3b49ca,_0x2c6a72,_0x40e15a){var _0x525987=_0x2c6a72?'RECALL':_0x4f3d35[_0x39bd('0x1a')];_0x525987=_0x40e15a?_0x39bd('0x44'):_0x525987;return{'actionid':_0x4f3d35[_0x39bd('0x45')],'action':_0x39bd('0x46'),'channel':_0x4f3d35[_0x39bd('0x47')],'callerid':util[_0x39bd('0x15')](_0x39bd('0x14'),_0x525987,_0x4f3d35[_0x39bd('0x1b')]),'Exten':_0x39bd('0x48'),'Context':_0x39bd('0x49'),'Priority':'1','variable':_0x3b49ca,'timeout':(_0x16e68f[_0x39bd('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4f3d35[_0x39bd('0x45')]};};exports['totalGlobal']=function(_0x143364){return _0x143364[_0x39bd('0x4b')]+_0x143364[_0x39bd('0x4c')]+_0x143364[_0x39bd('0x4d')]+_0x143364[_0x39bd('0x4e')]+_0x143364['countnosuchnumberretry'];};exports[_0x39bd('0x4f')]=function(_0x192972){var _0xd60fa7=_['clone'](_0x192972);_0xd60fa7['state']=0xf;_0xd60fa7[_0x39bd('0x36')]=_0x39bd('0x50');return _0xd60fa7;};exports['scheduledAt']=function(_0x68902e,_0x757e25,_0x17a05d){var _0x3e8e35={};_0x3e8e35[_0x757e25]=_0x68902e[_0x757e25];_0x3e8e35[_0x39bd('0x51')]=![];_0x3e8e35[_0x39bd('0x52')]=moment()[_0x39bd('0x53')](_0x17a05d,'minutes')[_0x39bd('0x15')](_0x39bd('0x34'));_0x3e8e35[_0x39bd('0x1c')]=_0x68902e[_0x39bd('0x1c')];_0x3e8e35[_0x39bd('0x54')]=_0x68902e[_0x39bd('0x54')];_0x3e8e35['VoiceQueueId']=_0x68902e[_0x39bd('0x55')]||undefined;return _0x3e8e35;};exports[_0x39bd('0x56')]=function(_0x5b2cb2,_0x492de9){if(!_['isNil'](_0x5b2cb2)){if(_0x5b2cb2['pTalking']>0x0){_0x5b2cb2['pTalking']-=0x1;}else{logger[_0x39bd('0xb')](_0x492de9,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x39bd('0xb')](_0x492de9,_0x39bd('0x57'));}};exports['IsNotLoggedIn']=function(_0x124158){if(_0x124158<=0x0){return!![];}return![];};exports[_0x39bd('0x58')]=function(_0x36aab8,_0x5d68ad,_0x1f5d5f){_0x36aab8[_0x39bd('0x59')]=_0x5d68ad;_0x36aab8['name']=_0x36aab8[_0x39bd('0x5a')];_0x36aab8[_0x39bd('0x5b')]=_0x36aab8['channelAgent'];_0x36aab8[_0x39bd('0x5c')]=_0x39bd('0x5d');if(_0x1f5d5f){_0x36aab8['mandatoryDisposition']=_0x1f5d5f['mandatoryDisposition'];}return _0x36aab8;};exports[_0x39bd('0x5e')]=function(_0x1a3049){var _0x42f047={};_0x42f047[_0x39bd('0x5a')]=_0x1a3049['queue'];_0x42f047[_0x39bd('0x5b')]=_0x1a3049[_0x39bd('0x47')];_0x42f047[_0x39bd('0x45')]=_0x1a3049[_0x39bd('0x45')];return _0x42f047;};exports[_0x39bd('0x5f')]=function(_0x24c975){var _0x2aa847=[];for(var _0x3a454b in _0x24c975){if(_0x24c975[_0x39bd('0x29')](_0x3a454b)){if(!_[_0x39bd('0x16')](_0x24c975[_0x3a454b])&&_0x24c975[_0x3a454b]['state']===_0x39bd('0x60')&&_0x24c975[_0x3a454b]['status']===_0x39bd('0x61')){_0x2aa847[_0x39bd('0x62')](_0x24c975[_0x3a454b]['id']);}}}return _0x2aa847;};exports[_0x39bd('0x63')]=function(_0x513d4b){var _0x5acc23=moment()[_0x39bd('0x7')](0x0);var _0xf41170=moment(_0x513d4b)[_0x39bd('0x7')](0x0);return _0x5acc23[_0x39bd('0x8')](_0xf41170,_0x39bd('0x9'));};exports[_0x39bd('0x64')]=function(_0x1a9042){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a9042[_0x39bd('0x1c')],'ListId':_0x1a9042[_0x39bd('0x54')],'VoiceQueueId':_0x1a9042[_0x39bd('0x55')]||undefined,'CampaignId':_0x1a9042[_0x39bd('0x65')]||undefined};};exports[_0x39bd('0x66')]=function(_0x5e0e6a){if(_0x5e0e6a==='uniqueid'||_0x5e0e6a===_0x39bd('0x67')||_0x5e0e6a===_0x39bd('0x5a')||_0x5e0e6a==='type'||_0x5e0e6a===_0x39bd('0x68')||_0x5e0e6a===_0x39bd('0x69')||_0x5e0e6a==='membername'||_0x5e0e6a===_0x39bd('0x47')||_0x5e0e6a==='calleridname'||_0x5e0e6a==='active'||_0x5e0e6a===_0x39bd('0x1b')||_0x5e0e6a==='scheduledat'||_0x5e0e6a===_0x39bd('0x4b')||_0x5e0e6a===_0x39bd('0x4c')||_0x5e0e6a===_0x39bd('0x4d')||_0x5e0e6a==='countglobal'||_0x5e0e6a===_0x39bd('0x6a')||_0x5e0e6a===_0x39bd('0x6b')||_0x5e0e6a==='callbackat'||_0x5e0e6a===_0x39bd('0x6c')||_0x5e0e6a===_0x39bd('0x1c')||_0x5e0e6a==='ListId'||_0x5e0e6a===_0x39bd('0x3d')||_0x5e0e6a===_0x39bd('0x55')||_0x5e0e6a===_0x39bd('0x6d')||_0x5e0e6a===_0x39bd('0x6e')||_0x5e0e6a===_0x39bd('0x6f')||_0x5e0e6a===_0x39bd('0x70')||_0x5e0e6a===_0x39bd('0x71')||_0x5e0e6a===_0x39bd('0x72')||_0x5e0e6a===_0x39bd('0x73')||_0x5e0e6a===_0x39bd('0x74')||_0x5e0e6a===_0x39bd('0x75')||_0x5e0e6a==='xmd-dialchannel'||_0x5e0e6a===_0x39bd('0x76')||_0x5e0e6a==='xmd-cdrtype'||_0x5e0e6a==='xmd-callerid'||_0x5e0e6a==='xmd-agiafter'||_0x5e0e6a==='xmd-agi'||_0x5e0e6a==='rtpaudioqos'||_0x5e0e6a==='rtpaudioqosbridged'||_0x5e0e6a===_0x39bd('0x77')||_0x5e0e6a===_0x39bd('0x78')||_0x5e0e6a===_0x39bd('0x79')||_0x5e0e6a===_0x39bd('0x7a')||_0x5e0e6a===_0x39bd('0x7b')||_0x5e0e6a===_0x39bd('0x7c')||_0x5e0e6a===_0x39bd('0x7d')||_0x5e0e6a===_0x39bd('0x7e')||_0x5e0e6a==='rtpaudioqosjitter'||_0x5e0e6a==='rtpaudioqosjitterbridged'||_0x5e0e6a===_0x39bd('0x79')||_0x5e0e6a===_0x39bd('0x7a')||_0x5e0e6a===_0x39bd('0x7b')||_0x5e0e6a===_0x39bd('0x7c')||_0x5e0e6a===_0x39bd('0x7f')||_0x5e0e6a===_0x39bd('0x80')||_0x5e0e6a===_0x39bd('0x35')||_0x5e0e6a===_0x39bd('0x36')){return![];}return!![];};exports[_0x39bd('0x81')]=function(_0x1935e3,_0x1305d9){var _0x212249,_0xb1c1e9,_0x9d5f55;if(_0x1305d9<=0x0){_0x1305d9=0x1;}_0x212249=new RegExp(_0x39bd('0x82')+_0x1305d9+'}$');_0xb1c1e9=Math[_0x39bd('0x83')](0xa,_0x1305d9-0x1);_0x9d5f55=Math[_0x39bd('0x83')](0xa,_0x1305d9)-0x1;return util['format']('%s',_[_0x39bd('0x84')](_0x1935e3,_0x212249,_[_0x39bd('0x85')](_0xb1c1e9,_0x9d5f55)));};exports['extractCalleridName']=function(_0x20b924){var _0x6903f3=_0x20b924[_0x39bd('0x86')](/"(.*?)"/);return _0x6903f3?_0x6903f3[0x1]:_0x20b924;};exports[_0x39bd('0x87')]=function(_0x49a576){var _0x31d7ae=_0x49a576[_0x39bd('0x86')](/<(.*?)>/);return _0x31d7ae?_0x31d7ae[0x1]:_0x49a576;}; \ No newline at end of file +var _0xcc85=['127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','active','scheduledat','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','motionChannel','voice','mandatoryDisposition','channelAgent','agentReadyId','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI'];(function(_0x13a5dd,_0x23fe66){var _0x1ab037=function(_0x1c53b8){while(--_0x1c53b8){_0x13a5dd['push'](_0x13a5dd['shift']());}};_0x1ab037(++_0x23fe66);}(_0xcc85,0x86));var _0x5cc8=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xcc85[_0x485201];return _0x9ca98a;};'use strict';var util=require(_0x5cc8('0x0'));var _=require('lodash');var moment=require(_0x5cc8('0x1'));var logger=require(_0x5cc8('0x2'))(_0x5cc8('0x3'));var ipAgi=process[_0x5cc8('0x4')][_0x5cc8('0x5')]||_0x5cc8('0x6');function getSeconds(_0x32bea6,_0x327327){var _0x37c3eb=moment(_0x32bea6)[_0x5cc8('0x7')](0x0);var _0x3f45c7=moment(_0x327327)['milliseconds'](0x0);return _0x37c3eb[_0x5cc8('0x8')](_0x3f45c7,_0x5cc8('0x9'));}exports[_0x5cc8('0xa')]=function(_0x44f4fa){return function(_0x6d8fe){logger[_0x5cc8('0xb')](_0x44f4fa,util[_0x5cc8('0xc')](_0x6d8fe,{'showHidden':![],'depth':null}));};};exports[_0x5cc8('0xd')]=function(_0x44410a,_0x1e35bb){logger[_0x5cc8('0xe')](_0x44410a,util[_0x5cc8('0xc')](_0x1e35bb,{'showHidden':![],'depth':null}));};exports[_0x5cc8('0xf')]=function(_0x338e21,_0x11c5dd){logger[_0x5cc8('0xb')](_0x338e21,util['inspect'](_0x11c5dd,{'showHidden':![],'depth':null}));};exports[_0x5cc8('0x10')]=function(_0x224cd8){return function(_0x256a43){logger['info'](_0x224cd8,util[_0x5cc8('0xc')](_0x256a43,{'showHidden':![],'depth':null}));};};exports[_0x5cc8('0x11')]=function(_0x801069,_0x30b23f,_0x4761b3){return{'message':_0x801069,'unlock':_0x30b23f,'active':_0x4761b3};};exports[_0x5cc8('0x12')]=function(_0x2e3cef,_0x2797e6,_0x345caf){if(!_['isUndefined'](_0x345caf)&&_0x5cc8('0x13')===typeof _0x345caf&&!_[_0x5cc8('0x14')](_0x345caf)){if(!_[_0x5cc8('0x15')](_0x2797e6)&&'string'===typeof _0x2797e6&&!_[_0x5cc8('0x14')](_0x2797e6)){return util[_0x5cc8('0x16')](_0x5cc8('0x17'),_0x2797e6,_0x345caf);}return util[_0x5cc8('0x16')](_0x5cc8('0x17'),_0x345caf,_0x345caf);}if(!_[_0x5cc8('0x15')](_0x2e3cef)&&'string'===typeof _0x2e3cef&&!_[_0x5cc8('0x14')](_0x2e3cef)){return _0x2e3cef;}return _0x5cc8('0x18');};exports['isActive']=function(_0x3c8d91){if(_['isNil'](_0x3c8d91)){return![];}return _0x3c8d91;};exports['addVariables']=function(_0x7afa78,_0x43448b,_0x5831cb,_0x296807,_0x1c4a2a,_0x336f99){var _0x672794={'XMD-QUEUE':_0x43448b[_0x5cc8('0x19')]?_0x43448b[_0x5cc8('0x19')][_0x5cc8('0x1a')]:'','XMD-CALLERID':_0x296807,'XMD-CALLERID-PREVIEW':_0x336f99?util[_0x5cc8('0x16')]('\x22%s\x22\x20<%s>',_0x336f99[_0x5cc8('0x1b')],_0x336f99[_0x5cc8('0x1c')]):_0x296807,'XMD-DIALID':_0x1c4a2a,'XMD-CONTACTID':_0x43448b[_0x5cc8('0x1d')],'XMD-CDRTYPE':_0x5cc8('0x1e'),'CALLERID(all)':_0x296807,'XMD-VOICEQUEUEID':_0x43448b[_0x5cc8('0x1f')],'XMD-DIALCHANNEL':_0x5831cb,'XMD-DIALTIMEOUT':_0x7afa78[_0x5cc8('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x5cc8('0x16')]('\x22rtTxX%s%s\x22',_0x7afa78['dialQueueProject2']?'g':'',_[_0x5cc8('0x14')](_0x7afa78['monitor_format'])?'':_0x5cc8('0x21')),'XMD-DIALURL':_0x7afa78['dialPreviewUrl']||'','XMD-AGI':_0x7afa78[_0x5cc8('0x22')]?util['format'](_0x5cc8('0x23'),ipAgi,_0x7afa78[_0x5cc8('0x22')]):_0x5cc8('0x24'),'XMD-AGIAFTER':_0x7afa78[_0x5cc8('0x25')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x7afa78[_0x5cc8('0x25')]):_0x5cc8('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x336f99?_0x336f99[_0x5cc8('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x336f99?_0x336f99['originatecalleridname']:'','XMD-DESTINATION':_0x5cc8('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x5cc8('0x14')](_0x7afa78[_0x5cc8('0x28')])){_0x672794[util[_0x5cc8('0x16')]('%s',_0x5cc8('0x29'))]=_0x7afa78['monitor_format'];_0x672794[util[_0x5cc8('0x16')]('%s',_0x5cc8('0x2a'))]=_0x1c4a2a;}if(_0x43448b&&_0x43448b[_0x5cc8('0x2b')]){for(var _0x3c5c3e in _0x43448b[_0x5cc8('0x2b')]){if(_0x43448b[_0x5cc8('0x2b')][_0x5cc8('0x2c')](_0x3c5c3e)){if(!_[_0x5cc8('0x2d')](_0x43448b[_0x5cc8('0x2b')][_0x3c5c3e])&&_0x3c5c3e!=='id'&&_0x3c5c3e!==_0x5cc8('0x2e')&&_0x3c5c3e!==_0x5cc8('0x2f')&&_0x3c5c3e!=='updatedAt'){_0x672794[util[_0x5cc8('0x16')](_0x5cc8('0x30'),_0x5cc8('0x31'),_[_0x5cc8('0x32')](_0x3c5c3e))]=_0x43448b[_0x5cc8('0x2b')][_0x3c5c3e];}}}}return _0x672794;};exports[_0x5cc8('0x33')]=function(_0x22df58){var _0x3750ef={};for(var _0x2da518 in _0x22df58){if(_0x22df58[_0x5cc8('0x2c')](_0x2da518)){_0x3750ef[util['format']('%s',_[_0x5cc8('0x34')](_0x2da518))]=_0x22df58[_0x2da518];}}return{'variables':_0x3750ef};};exports[_0x5cc8('0x35')]=function(_0x4407d5,_0x5af6d9){if(!_[_0x5cc8('0x2d')](_0x4407d5)){if(_0x4407d5[_0x5cc8('0x2c')]('originated')){if(_0x4407d5[_0x5cc8('0x36')]>0x0){_0x4407d5['originated']-=0x1;}else{logger[_0x5cc8('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5af6d9);}}}else{logger['error'](_0x5cc8('0x37'),_0x5af6d9);}};exports['logBlacklist']=function(_0xa40fb8){var _0x5e5e2a=moment()[_0x5cc8('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0xa40fb8[_0x5cc8('0x38')]=0xd;_0xa40fb8['statedesc']='Blacklist';_0xa40fb8[_0x5cc8('0x39')]=_0x5e5e2a;_0xa40fb8[_0x5cc8('0x3a')]=_0x5e5e2a;_0xa40fb8[_0x5cc8('0x3b')]=_0x5e5e2a;};exports[_0x5cc8('0x3c')]=function(_0x2b8390,_0x1beec5,_0x328183){var _0x2ed4fc=moment()[_0x5cc8('0x16')](_0x5cc8('0x3d'));_0x2b8390[_0x5cc8('0x38')]=_0x1beec5;_0x2b8390[_0x5cc8('0x3e')]=_0x328183;_0x2b8390['responsetime']=_0x2ed4fc;_0x2b8390[_0x5cc8('0x3f')]=getSeconds(_0x2b8390[_0x5cc8('0x3a')],_0x2b8390[_0x5cc8('0x39')]);};exports[_0x5cc8('0x40')]=function(_0x2d6beb,_0x8edab1,_0x4e101e){_0x2d6beb[_0x5cc8('0x41')]=_0x8edab1;_0x2d6beb[_0x5cc8('0x42')]=_0x4e101e;};exports['logCustomer']=function(_0x283102,_0x10c585,_0x175924){var _0x3433e2=moment()['format'](_0x5cc8('0x3d'));_0x283102[_0x5cc8('0x38')]=_0x10c585;_0x283102[_0x5cc8('0x3e')]=_0x175924;_0x283102['responsetime']=_0x283102[_0x5cc8('0x3a')]?_0x283102[_0x5cc8('0x3a')]:_0x3433e2;_0x283102[_0x5cc8('0x3b')]=_0x283102[_0x5cc8('0x3b')]?_0x283102['endtime']:_0x3433e2;_0x283102[_0x5cc8('0x3f')]=getSeconds(_0x283102[_0x5cc8('0x3a')]||0x0,_0x283102[_0x5cc8('0x39')]||0x0);_0x283102[_0x5cc8('0x43')]=_0x283102[_0x5cc8('0x44')]?getSeconds(_0x283102[_0x5cc8('0x3b')],_0x283102[_0x5cc8('0x44')]):0x0;};exports[_0x5cc8('0x45')]=function(_0x14189b){return _0x14189b===_0x5cc8('0x46');};exports[_0x5cc8('0x47')]=function(_0x2c5318,_0x2380dc,_0x55841f,_0x464149,_0xe89f80){var _0x1d563f=_0x464149?_0x5cc8('0x48'):_0x2c5318[_0x5cc8('0x1b')];_0x1d563f=_0xe89f80?'BOOKED':_0x1d563f;return{'actionid':_0x2c5318[_0x5cc8('0x49')],'action':_0x5cc8('0x4a'),'channel':_0x2c5318['channelAgent'],'callerid':util[_0x5cc8('0x16')]('\x22%s\x22\x20<%s>',_0x1d563f,_0x2c5318[_0x5cc8('0x1c')]),'Exten':'xcally-motion-preview','Context':_0x5cc8('0x4b'),'Priority':'1','variable':_0x55841f,'timeout':(_0x2380dc[_0x5cc8('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c5318[_0x5cc8('0x49')]};};exports[_0x5cc8('0x4d')]=function(_0x507ae8){return _0x507ae8['countbusyretry']+_0x507ae8[_0x5cc8('0x4e')]+_0x507ae8[_0x5cc8('0x4f')]+_0x507ae8[_0x5cc8('0x50')]+_0x507ae8[_0x5cc8('0x51')];};exports['cloneAction']=function(_0x3070c5){var _0x49f3d8=_['clone'](_0x3070c5);_0x49f3d8[_0x5cc8('0x38')]=0xf;_0x49f3d8[_0x5cc8('0x3e')]=_0x5cc8('0x52');return _0x49f3d8;};exports['scheduledAt']=function(_0x46e8c,_0x2a822b,_0x49342a){var _0x4176d5={};_0x4176d5[_0x2a822b]=_0x46e8c[_0x2a822b];_0x4176d5[_0x5cc8('0x53')]=![];_0x4176d5[_0x5cc8('0x54')]=moment()['add'](_0x49342a,'minutes')[_0x5cc8('0x16')](_0x5cc8('0x3d'));_0x4176d5[_0x5cc8('0x1d')]=_0x46e8c[_0x5cc8('0x1d')];_0x4176d5[_0x5cc8('0x55')]=_0x46e8c['ListId'];_0x4176d5[_0x5cc8('0x1f')]=_0x46e8c[_0x5cc8('0x1f')]||undefined;return _0x4176d5;};exports[_0x5cc8('0x56')]=function(_0x5b8551,_0x37d8ad){if(!_[_0x5cc8('0x2d')](_0x5b8551)){if(_0x5b8551[_0x5cc8('0x57')]>0x0){_0x5b8551[_0x5cc8('0x57')]-=0x1;}else{logger[_0x5cc8('0xb')](_0x37d8ad,_0x5cc8('0x58'));}}else{logger[_0x5cc8('0xb')](_0x37d8ad,_0x5cc8('0x59'));}};exports[_0x5cc8('0x5a')]=function(_0x36ee9c){if(_0x36ee9c<=0x0){return!![];}return![];};exports[_0x5cc8('0x5b')]=function(_0x3daee8,_0xe99bc4,_0x109a78){_0x3daee8['lastevent']=_0xe99bc4;_0x3daee8[_0x5cc8('0x1a')]=_0x3daee8[_0x5cc8('0x5c')];_0x3daee8[_0x5cc8('0x5d')]=_0x3daee8['channelAgent'];_0x3daee8[_0x5cc8('0x5e')]=_0x5cc8('0x5f');if(_0x109a78){_0x3daee8[_0x5cc8('0x60')]=_0x109a78[_0x5cc8('0x60')];}return _0x3daee8;};exports['buildAcw']=function(_0x2a8422){var _0x33aabc={};_0x33aabc[_0x5cc8('0x5c')]=_0x2a8422['queue'];_0x33aabc[_0x5cc8('0x5d')]=_0x2a8422[_0x5cc8('0x61')];_0x33aabc[_0x5cc8('0x49')]=_0x2a8422['uniqueid'];return _0x33aabc;};exports[_0x5cc8('0x62')]=function(_0x378148){var _0x12b614=[];for(var _0x87fbff in _0x378148){if(_0x378148[_0x5cc8('0x2c')](_0x87fbff)){if(!_[_0x5cc8('0x2d')](_0x378148[_0x87fbff])&&_0x378148[_0x87fbff][_0x5cc8('0x38')]==='not_inuse'&&_0x378148[_0x87fbff]['status']==='reachable'){_0x12b614['push'](_0x378148[_0x87fbff]['id']);}}}return _0x12b614;};exports[_0x5cc8('0x63')]=function(_0x2f300c){var _0xdeda89=moment()[_0x5cc8('0x7')](0x0);var _0x190fe6=moment(_0x2f300c)[_0x5cc8('0x7')](0x0);return _0xdeda89[_0x5cc8('0x8')](_0x190fe6,_0x5cc8('0x9'));};exports[_0x5cc8('0x64')]=function(_0x58e7c2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x58e7c2['ContactId'],'ListId':_0x58e7c2[_0x5cc8('0x55')],'VoiceQueueId':_0x58e7c2[_0x5cc8('0x1f')]||undefined,'CampaignId':_0x58e7c2[_0x5cc8('0x65')]||undefined};};exports[_0x5cc8('0x66')]=function(_0x3691a4){if(_0x3691a4==='uniqueid'||_0x3691a4===_0x5cc8('0x67')||_0x3691a4==='queue'||_0x3691a4===_0x5cc8('0x68')||_0x3691a4===_0x5cc8('0x69')||_0x3691a4==='dialAnswer'||_0x3691a4===_0x5cc8('0x41')||_0x3691a4===_0x5cc8('0x61')||_0x3691a4===_0x5cc8('0x1b')||_0x3691a4===_0x5cc8('0x53')||_0x3691a4===_0x5cc8('0x1c')||_0x3691a4==='scheduledat'||_0x3691a4===_0x5cc8('0x6a')||_0x3691a4==='countcongestionretry'||_0x3691a4===_0x5cc8('0x4f')||_0x3691a4===_0x5cc8('0x6b')||_0x3691a4===_0x5cc8('0x6c')||_0x3691a4===_0x5cc8('0x6d')||_0x3691a4===_0x5cc8('0x6e')||_0x3691a4===_0x5cc8('0x6f')||_0x3691a4===_0x5cc8('0x1d')||_0x3691a4===_0x5cc8('0x55')||_0x3691a4==='UserId'||_0x3691a4===_0x5cc8('0x1f')||_0x3691a4===_0x5cc8('0x70')||_0x3691a4===_0x5cc8('0x71')||_0x3691a4===_0x5cc8('0x72')||_0x3691a4===_0x5cc8('0x73')||_0x3691a4==='xmd-listid'||_0x3691a4==='xmd-dialurl'||_0x3691a4==='xmd-dialtimeout'||_0x3691a4===_0x5cc8('0x74')||_0x3691a4===_0x5cc8('0x75')||_0x3691a4===_0x5cc8('0x76')||_0x3691a4===_0x5cc8('0x77')||_0x3691a4===_0x5cc8('0x78')||_0x3691a4==='xmd-callerid'||_0x3691a4===_0x5cc8('0x79')||_0x3691a4===_0x5cc8('0x7a')||_0x3691a4===_0x5cc8('0x7b')||_0x3691a4===_0x5cc8('0x7c')||_0x3691a4===_0x5cc8('0x7d')||_0x3691a4===_0x5cc8('0x7e')||_0x3691a4===_0x5cc8('0x7f')||_0x3691a4===_0x5cc8('0x80')||_0x3691a4==='rtpaudioqosrtt'||_0x3691a4==='rtpaudioqosrttbridged'||_0x3691a4===_0x5cc8('0x7b')||_0x3691a4===_0x5cc8('0x7c')||_0x3691a4===_0x5cc8('0x7d')||_0x3691a4===_0x5cc8('0x7e')||_0x3691a4===_0x5cc8('0x7f')||_0x3691a4===_0x5cc8('0x80')||_0x3691a4===_0x5cc8('0x81')||_0x3691a4===_0x5cc8('0x82')||_0x3691a4==='bridgepeer'||_0x3691a4===_0x5cc8('0x83')||_0x3691a4===_0x5cc8('0x38')||_0x3691a4===_0x5cc8('0x3e')){return![];}return!![];};exports[_0x5cc8('0x84')]=function(_0x21f76e,_0x5e60e3){var _0xf79c5,_0x10d2a7,_0xafa941;if(_0x5e60e3<=0x0){_0x5e60e3=0x1;}_0xf79c5=new RegExp(_0x5cc8('0x85')+_0x5e60e3+'}$');_0x10d2a7=Math[_0x5cc8('0x86')](0xa,_0x5e60e3-0x1);_0xafa941=Math[_0x5cc8('0x86')](0xa,_0x5e60e3)-0x1;return util[_0x5cc8('0x16')]('%s',_[_0x5cc8('0x87')](_0x21f76e,_0xf79c5,_[_0x5cc8('0x88')](_0x10d2a7,_0xafa941)));};exports[_0x5cc8('0x89')]=function(_0x32cfb2){var _0x2c5bc0=_0x32cfb2[_0x5cc8('0x8a')](/"(.*?)"/);return _0x2c5bc0?_0x2c5bc0[0x1]:_0x32cfb2;};exports[_0x5cc8('0x8b')]=function(_0x2aba53){var _0x46b062=_0x2aba53[_0x5cc8('0x8a')](/<(.*?)>/);return _0x46b062?_0x46b062[0x1]:_0x2aba53;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 7771037..5922d4b 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 _0x1ec8=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0xefeb2,_0xdd6b10){var _0x131fa3=function(_0x2d4b41){while(--_0x2d4b41){_0xefeb2['push'](_0xefeb2['shift']());}};_0x131fa3(++_0xdd6b10);}(_0x1ec8,0x118));var _0x81ec=function(_0x9908e1,_0x4ef18e){_0x9908e1=_0x9908e1-0x0;var _0xedff05=_0x1ec8[_0x9908e1];return _0xedff05;};'use strict';exports[_0x81ec('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x81ec('0x1'),'required':!![]},'membername':{'type':_0x81ec('0x1'),'required':!![]},'penalty':{'type':_0x81ec('0x2'),'required':![]},'paused':{'type':_0x81ec('0x3'),'required':![]}};exports[_0x81ec('0x4')]={'queue':{'type':_0x81ec('0x1'),'required':!![]},'interface':{'type':_0x81ec('0x1'),'required':!![]}};exports[_0x81ec('0x5')]={'interface':{'type':_0x81ec('0x1'),'required':!![]},'paused':{'type':_0x81ec('0x3')},'reason':{'type':_0x81ec('0x1'),'required':![]}};exports[_0x81ec('0x6')]={'module':{'type':_0x81ec('0x1'),'required':![]}};exports[_0x81ec('0x7')]={'uniqueid':{'type':_0x81ec('0x1'),'required':!![]}};exports[_0x81ec('0x8')]={'uniqueid':{'type':_0x81ec('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x81ec('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x81ec('0x9')]={'uniqueid':{'type':_0x81ec('0x1'),'required':!![]}};exports[_0x81ec('0xa')]={'uniqueid':{'type':_0x81ec('0x1'),'required':!![]},'exten':{'type':_0x81ec('0x1'),'required':!![]},'context':{'type':_0x81ec('0x1')}}; \ No newline at end of file +var _0xd34e=['queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x3fedd3,_0x475df5){var _0x2425d3=function(_0x5c1258){while(--_0x5c1258){_0x3fedd3['push'](_0x3fedd3['shift']());}};_0x2425d3(++_0x475df5);}(_0xd34e,0xd1));var _0xed34=function(_0x7f6f48,_0x26c9e1){_0x7f6f48=_0x7f6f48-0x0;var _0x3a6f31=_0xd34e[_0x7f6f48];return _0x3a6f31;};'use strict';exports[_0xed34('0x0')]={'queue':{'type':_0xed34('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xed34('0x1'),'required':!![]},'penalty':{'type':_0xed34('0x2'),'required':![]},'paused':{'type':_0xed34('0x3'),'required':![]}};exports[_0xed34('0x4')]={'queue':{'type':_0xed34('0x1'),'required':!![]},'interface':{'type':_0xed34('0x1'),'required':!![]}};exports[_0xed34('0x5')]={'interface':{'type':_0xed34('0x1'),'required':!![]},'paused':{'type':_0xed34('0x3')},'reason':{'type':'string','required':![]}};exports[_0xed34('0x6')]={'module':{'type':_0xed34('0x1'),'required':![]}};exports[_0xed34('0x7')]={'uniqueid':{'type':_0xed34('0x1'),'required':!![]}};exports[_0xed34('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xed34('0x1')},'format':{'type':_0xed34('0x1')},'mixmonitorid':{'type':_0xed34('0x1')}};exports[_0xed34('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xed34('0xa')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xed34('0x1'),'required':!![]},'context':{'type':_0xed34('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 195b6f6..28f5007 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 _0x8f7b=['name','hasOwnProperty','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','initTelephones','initTrunks','trunks','isUndefined','initVoiceQueues','voiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','outbound','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','triggers','campaigns','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8f7b,0xb3));var _0xb8f7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8f7b[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require(_0xb8f7('0x0'));var util=require(_0xb8f7('0x1'));var _=require(_0xb8f7('0x2'));var moment=require('moment');var Agent=require(_0xb8f7('0x3'));var Telephone=require(_0xb8f7('0x4'));var Trunk=require(_0xb8f7('0x5'));var VoiceQueue=require(_0xb8f7('0x6'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xb8f7('0x7'));var ZendeskAccount=require(_0xb8f7('0x8'));var SalesforceAccount=require(_0xb8f7('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xb8f7('0xa'));var ZohoAccount=require(_0xb8f7('0xb'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xb8f7('0xc'));var ServicenowAccount=require(_0xb8f7('0xd'));var Dynamics365Account=require(_0xb8f7('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xb8f7('0xf'));var Realtime=function(){this[_0xb8f7('0x10')]={};this[_0xb8f7('0x11')]={};this['trunks']={};this['voiceQueues']={};this[_0xb8f7('0x12')]={};this[_0xb8f7('0x13')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb8f7('0x14')]={};this[_0xb8f7('0x15')]={};this[_0xb8f7('0x16')]={};this[_0xb8f7('0x17')]={};this[_0xb8f7('0x18')]={};this[_0xb8f7('0x19')]={};this[_0xb8f7('0x1a')]={};this[_0xb8f7('0x1b')]={};this['sugarcrmAccounts']={};this[_0xb8f7('0x1c')]={};this[_0xb8f7('0x1d')]={};this['deskAccounts']={};this[_0xb8f7('0x1e')]={};this[_0xb8f7('0x1f')]={};this[_0xb8f7('0x20')]={};this[_0xb8f7('0x21')]={};this[_0xb8f7('0x22')]={};};function freeIsNotKey(_0x63b4b3,_0x17bd0c,_0x545794){var _0x4551b9=_['mapKeys'](_0x63b4b3,function(_0x504082,_0x35f595){return _0x504082[_0x545794];});for(var _0x3899a4 in _0x17bd0c){if(_0x17bd0c['hasOwnProperty'](_0x3899a4)){if(!_0x4551b9[_0x3899a4]){delete _0x17bd0c[_0x3899a4];}}}}function freeIsNotKeySip(_0x47149,_0x53080b){var _0x56bcce=_[_0xb8f7('0x23')](_0x47149,function(_0x1819bb,_0x2ff9b5){return util[_0xb8f7('0x24')]('SIP/%s',_0x1819bb[_0xb8f7('0x25')]);});for(var _0x2ee547 in _0x53080b){if(_0x53080b[_0xb8f7('0x26')](_0x2ee547)){if(!_0x56bcce[_0x2ee547]){delete _0x53080b[_0x2ee547];}}}}function freeIsNotKeyAgent(_0x4c2bd3,_0x16e9a5){var _0x1a8b53=_[_0xb8f7('0x23')](_0x4c2bd3,function(_0x524b0d,_0x525121){var _0x45c4a2=_[_0xb8f7('0x27')](_0x524b0d[_0xb8f7('0x28')])?util[_0xb8f7('0x24')](_0xb8f7('0x29'),_0x524b0d[_0xb8f7('0x25')]):_0x524b0d['interface'];return _0x45c4a2;});for(var _0x9038fd in _0x16e9a5){if(_0x16e9a5['hasOwnProperty'](_0x9038fd)){if(!_0x1a8b53[_0x9038fd]){delete _0x16e9a5[_0x9038fd];}}}}function clearVoiceCallReports(_0x2bfdae){_0x2bfdae[_0xb8f7('0x2a')]=0x0;_0x2bfdae[_0xb8f7('0x2b')]=0x0;_0x2bfdae[_0xb8f7('0x2c')]=0x0;_0x2bfdae[_0xb8f7('0x2d')]=0x0;_0x2bfdae[_0xb8f7('0x2e')]=0x0;}function clearCampaigns(_0x20d274){if(!_[_0xb8f7('0x2f')](_0x20d274)){for(var _0x32d632 in _0x20d274){if(_0x20d274['hasOwnProperty'](_0x32d632)){_0x20d274[_0x32d632][_0xb8f7('0x30')]=0x0;_0x20d274[_0x32d632][_0xb8f7('0x31')]=0x0;}}}}function clearVoiceQueues(_0x462553){if(!_[_0xb8f7('0x2f')](_0x462553)){for(var _0x1db565 in _0x462553){if(_0x462553['hasOwnProperty'](_0x1db565)){_0x462553[_0x1db565][_0xb8f7('0x2a')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x2b')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x32')]=0x0;_0x462553[_0x1db565]['abandoned']=0x0;_0x462553[_0x1db565][_0xb8f7('0x2c')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x2d')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x2e')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x33')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x34')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x35')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x36')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x37')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x38')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x39')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x3a')]=0x0;_0x462553[_0x1db565]['outboundBlacklistCallsDay']=0x0;_0x462553[_0x1db565][_0xb8f7('0x3b')]=0x0;_0x462553[_0x1db565]['outboundRejectCallsDay']=0x0;_0x462553[_0x1db565][_0xb8f7('0x3c')]=0x0;_0x462553[_0x1db565]['outboundAnswerAgiCallsDay']=0x0;_0x462553[_0x1db565][_0xb8f7('0x3d')]=0x0;_0x462553[_0x1db565][_0xb8f7('0x3e')]=!![];}}}}Realtime[_0xb8f7('0x3f')][_0xb8f7('0x40')]=function(_0x5d7d27,_0x249794){for(var _0x419a83 in _0x249794){if(_0x5d7d27[_0xb8f7('0x26')](_0x419a83)){_0x5d7d27[_0x419a83]=_0x249794[_0x419a83];}}};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x41')]=function(){var _0x4eba34=this;return function(_0x29b215){if(_0x29b215){freeIsNotKeyAgent(_0x29b215,_0x4eba34[_0xb8f7('0x10')]);for(var _0x2e60c4=0x0,_0x1ca100={},_0x23879c={};_0x2e60c4<_0x29b215[_0xb8f7('0x42')];_0x2e60c4+=0x1){_0x1ca100=_0x29b215[_0x2e60c4];var _0x3b52a5=_['isNil'](_0x1ca100[_0xb8f7('0x28')])?util[_0xb8f7('0x24')]('SIP/%s',_0x1ca100[_0xb8f7('0x25')]):_0x1ca100[_0xb8f7('0x28')];if(_['isUndefined'](_0x4eba34['agents'][_0x3b52a5])){_0x4eba34[_0xb8f7('0x10')][_0x3b52a5]=new Agent(_0x1ca100);}else{_0x4eba34[_0xb8f7('0x40')](_0x4eba34[_0xb8f7('0x10')][_0x3b52a5],_0x1ca100);}}}return _0x4eba34[_0xb8f7('0x10')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x43')]=function(){var _0x3ceb95=this;return function(_0x4f0591){if(_0x4f0591){freeIsNotKeySip(_0x4f0591,_0x3ceb95[_0xb8f7('0x11')]);for(var _0x5f1140=0x0,_0x10c09a={},_0x488585={};_0x5f1140<_0x4f0591[_0xb8f7('0x42')];_0x5f1140+=0x1){_0x10c09a=_0x4f0591[_0x5f1140];if(_['isUndefined'](_0x3ceb95[_0xb8f7('0x11')][util[_0xb8f7('0x24')]('SIP/%s',_0x10c09a['name'])])){_0x3ceb95[_0xb8f7('0x11')][util[_0xb8f7('0x24')](_0xb8f7('0x29'),_0x10c09a['name'])]=new Telephone(_0x10c09a);}else{_0x3ceb95[_0xb8f7('0x40')](_0x3ceb95[_0xb8f7('0x11')][util[_0xb8f7('0x24')](_0xb8f7('0x29'),_0x10c09a['name'])],_0x10c09a);}}}return _0x3ceb95[_0xb8f7('0x11')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x44')]=function(){var _0x1c083=this;return function(_0x1abe35){if(_0x1abe35){freeIsNotKeySip(_0x1abe35,_0x1c083[_0xb8f7('0x45')]);for(var _0x1f5248=0x0,_0x4a0777={},_0x14330f={};_0x1f5248<_0x1abe35[_0xb8f7('0x42')];_0x1f5248+=0x1){_0x4a0777=_0x1abe35[_0x1f5248];if(_[_0xb8f7('0x46')](_0x1c083[_0xb8f7('0x45')][util[_0xb8f7('0x24')]('SIP/%s',_0x4a0777[_0xb8f7('0x25')])])){_0x1c083['trunks'][util['format'](_0xb8f7('0x29'),_0x4a0777[_0xb8f7('0x25')])]=new Trunk(_0x4a0777);}else{_0x1c083[_0xb8f7('0x40')](_0x1c083['trunks'][util['format']('SIP/%s',_0x4a0777[_0xb8f7('0x25')])],_0x4a0777);}}}return _0x1c083['trunks'];};};Realtime['prototype'][_0xb8f7('0x47')]=function(){var _0x1dba22=this;return function(_0x72f1e2){if(_0x72f1e2){freeIsNotKey(_0x72f1e2,_0x1dba22[_0xb8f7('0x48')],_0xb8f7('0x25'));for(var _0x526e7d=0x0,_0x28e532={},_0x13676d={};_0x526e7d<_0x72f1e2[_0xb8f7('0x42')];_0x526e7d+=0x1){_0x28e532=_0x72f1e2[_0x526e7d];if(_[_0xb8f7('0x46')](_0x1dba22[_0xb8f7('0x48')][_0x28e532[_0xb8f7('0x25')]])){_0x1dba22[_0xb8f7('0x48')][_0x28e532[_0xb8f7('0x25')]]=new VoiceQueue(_0x28e532);}else{_0x1dba22[_0xb8f7('0x40')](_0x1dba22[_0xb8f7('0x48')][_0x28e532[_0xb8f7('0x25')]],_0x28e532);}}}return _0x1dba22[_0xb8f7('0x48')];};};Realtime['prototype'][_0xb8f7('0x49')]=function(){var _0x3c2981=this;return function(_0x7cd4c8){if(_0x7cd4c8){freeIsNotKey(_0x7cd4c8,_0x3c2981[_0xb8f7('0x12')],'id');for(var _0x1263b1=0x0,_0x3598a7={},_0x3f2353={};_0x1263b1<_0x7cd4c8[_0xb8f7('0x42')];_0x1263b1+=0x1){_0x3598a7=_0x7cd4c8[_0x1263b1];if(_['isUndefined'](_0x3c2981[_0xb8f7('0x12')][_0x3598a7['id']])){_0x3c2981['triggers'][_0x3598a7['id']]=new Trigger(_0x3598a7);}else{_0x3c2981['mergeFromDatabase'](_0x3c2981[_0xb8f7('0x12')][_0x3598a7['id']],_0x3598a7);}}}return _0x3c2981[_0xb8f7('0x12')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x4a')]=function(){var _0x154a5d=this;return function(_0x59b04c){if(_0x59b04c){freeIsNotKey(_0x59b04c,_0x154a5d[_0xb8f7('0x4b')],'id');for(var _0x29724d=0x0,_0x5d002d={},_0x3a3482={};_0x29724d<_0x59b04c[_0xb8f7('0x42')];_0x29724d+=0x1){_0x5d002d=_0x59b04c[_0x29724d];if(_['isUndefined'](_0x154a5d[_0xb8f7('0x4b')][_0x5d002d['id']])){_0x154a5d['templates'][_0x5d002d['id']]=new Template(_0x5d002d);}else{_0x154a5d['mergeFromDatabase'](_0x154a5d['templates'][_0x5d002d['id']],_0x5d002d);}}}return _0x154a5d[_0xb8f7('0x4b')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x4c')]=function(){var _0x1cf0de=this;return function(_0x99e737){if(_0x99e737){freeIsNotKey(_0x99e737,_0x1cf0de[_0xb8f7('0x1a')],'id');for(var _0x32ea19=0x0,_0x51fcdd={},_0xaf833={};_0x32ea19<_0x99e737[_0xb8f7('0x42')];_0x32ea19+=0x1){_0x51fcdd=_0x99e737[_0x32ea19];if(_[_0xb8f7('0x46')](_0x1cf0de[_0xb8f7('0x1a')][_0x51fcdd['id']])){_0x1cf0de[_0xb8f7('0x1a')][_0x51fcdd['id']]=new ZendeskAccount(_0x51fcdd);}else{_0x1cf0de[_0xb8f7('0x40')](_0x1cf0de[_0xb8f7('0x1a')][_0x51fcdd['id']],_0x51fcdd);}}}return _0x1cf0de[_0xb8f7('0x1a')];};};Realtime['prototype'][_0xb8f7('0x4d')]=function(){var _0x24b1a0=this;return function(_0x585416){if(_0x585416){freeIsNotKey(_0x585416,_0x24b1a0['salesforceAccounts'],'id');for(var _0x24b170=0x0,_0x4a5d0d={},_0xd760bd={};_0x24b170<_0x585416[_0xb8f7('0x42')];_0x24b170+=0x1){_0x4a5d0d=_0x585416[_0x24b170];if(_[_0xb8f7('0x46')](_0x24b1a0[_0xb8f7('0x1b')][_0x4a5d0d['id']])){_0x24b1a0['salesforceAccounts'][_0x4a5d0d['id']]=new SalesforceAccount(_0x4a5d0d);}else{_0x24b1a0['mergeFromDatabase'](_0x24b1a0[_0xb8f7('0x1b')][_0x4a5d0d['id']],_0x4a5d0d);}}}return _0x24b1a0[_0xb8f7('0x1b')];};};Realtime[_0xb8f7('0x3f')]['initFreshdeskAccounts']=function(){var _0xc1908=this;return function(_0x2f096c){if(_0x2f096c){freeIsNotKey(_0x2f096c,_0xc1908['freshdeskAccounts'],'id');for(var _0x205dd4=0x0,_0x66ffdf={},_0x5d8ac2={};_0x205dd4<_0x2f096c[_0xb8f7('0x42')];_0x205dd4+=0x1){_0x66ffdf=_0x2f096c[_0x205dd4];if(_['isUndefined'](_0xc1908['freshdeskAccounts'][_0x66ffdf['id']])){_0xc1908[_0xb8f7('0x1c')][_0x66ffdf['id']]=new FreshdeskAccount(_0x66ffdf);}else{_0xc1908[_0xb8f7('0x40')](_0xc1908[_0xb8f7('0x1c')][_0x66ffdf['id']],_0x66ffdf);}}}return _0xc1908['freshdeskAccounts'];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x4e')]=function(){var _0x760e08=this;return function(_0x17f5a0){if(_0x17f5a0){freeIsNotKey(_0x17f5a0,_0x760e08[_0xb8f7('0x1d')],'id');for(var _0x177718=0x0,_0x5303d4={},_0x40c3a1={};_0x177718<_0x17f5a0[_0xb8f7('0x42')];_0x177718+=0x1){_0x5303d4=_0x17f5a0[_0x177718];if(_[_0xb8f7('0x46')](_0x760e08[_0xb8f7('0x1d')][_0x5303d4['id']])){_0x760e08[_0xb8f7('0x1d')][_0x5303d4['id']]=new ZohoAccount(_0x5303d4);}else{_0x760e08[_0xb8f7('0x40')](_0x760e08[_0xb8f7('0x1d')][_0x5303d4['id']],_0x5303d4);}}}return _0x760e08[_0xb8f7('0x1d')];};};Realtime[_0xb8f7('0x3f')]['initDeskAccounts']=function(){var _0x475dc4=this;return function(_0x3cda87){if(_0x3cda87){freeIsNotKey(_0x3cda87,_0x475dc4[_0xb8f7('0x4f')],'id');for(var _0x1d87bb=0x0,_0x468681={},_0x1d6ae1={};_0x1d87bb<_0x3cda87[_0xb8f7('0x42')];_0x1d87bb+=0x1){_0x468681=_0x3cda87[_0x1d87bb];if(_[_0xb8f7('0x46')](_0x475dc4['deskAccounts'][_0x468681['id']])){_0x475dc4[_0xb8f7('0x4f')][_0x468681['id']]=new DeskAccount(_0x468681);}else{_0x475dc4[_0xb8f7('0x40')](_0x475dc4[_0xb8f7('0x4f')][_0x468681['id']],_0x468681);}}}return _0x475dc4[_0xb8f7('0x4f')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x50')]=function(){var _0x4426b7=this;return function(_0x11319e){if(_0x11319e){freeIsNotKey(_0x11319e,_0x4426b7[_0xb8f7('0x51')],'id');for(var _0x437e8c=0x0,_0x49ef90={},_0x1fde29={};_0x437e8c<_0x11319e['length'];_0x437e8c+=0x1){_0x49ef90=_0x11319e[_0x437e8c];if(_[_0xb8f7('0x46')](_0x4426b7[_0xb8f7('0x51')][_0x49ef90['id']])){_0x4426b7[_0xb8f7('0x51')][_0x49ef90['id']]=new SugarcrmAccount(_0x49ef90);}else{_0x4426b7[_0xb8f7('0x40')](_0x4426b7[_0xb8f7('0x51')][_0x49ef90['id']],_0x49ef90);}}}return _0x4426b7[_0xb8f7('0x51')];};};Realtime[_0xb8f7('0x3f')]['initVtigerAccounts']=function(){var _0x127008=this;return function(_0x423dd1){if(_0x423dd1){freeIsNotKey(_0x423dd1,_0x127008[_0xb8f7('0x1e')],'id');for(var _0x1f2dd4=0x0,_0x7994c1={},_0x37d9a2={};_0x1f2dd4<_0x423dd1['length'];_0x1f2dd4+=0x1){_0x7994c1=_0x423dd1[_0x1f2dd4];if(_[_0xb8f7('0x46')](_0x127008[_0xb8f7('0x1e')][_0x7994c1['id']])){_0x127008[_0xb8f7('0x1e')][_0x7994c1['id']]=new VtigerAccount(_0x7994c1);}else{_0x127008[_0xb8f7('0x40')](_0x127008[_0xb8f7('0x1e')][_0x7994c1['id']],_0x7994c1);}}}return _0x127008[_0xb8f7('0x1e')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x1416fa=this;return function(_0x1dae07){if(_0x1dae07){freeIsNotKey(_0x1dae07,_0x1416fa['servicenowAccounts'],'id');for(var _0x1af60b=0x0,_0x18c2fb={},_0x468698={};_0x1af60b<_0x1dae07[_0xb8f7('0x42')];_0x1af60b+=0x1){_0x18c2fb=_0x1dae07[_0x1af60b];if(_[_0xb8f7('0x46')](_0x1416fa['servicenowAccounts'][_0x18c2fb['id']])){_0x1416fa[_0xb8f7('0x1f')][_0x18c2fb['id']]=new ServicenowAccount(_0x18c2fb);}else{_0x1416fa[_0xb8f7('0x40')](_0x1416fa['servicenowAccounts'][_0x18c2fb['id']],_0x18c2fb);}}}return _0x1416fa[_0xb8f7('0x1f')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x52')]=function(){var _0xbbeb12=this;return function(_0x352f18){if(_0x352f18){freeIsNotKey(_0x352f18,_0xbbeb12['dynamics365Accounts'],'id');for(var _0x336bb2=0x0,_0x3f4e40={},_0xfe8a94={};_0x336bb2<_0x352f18[_0xb8f7('0x42')];_0x336bb2+=0x1){_0x3f4e40=_0x352f18[_0x336bb2];if(_['isUndefined'](_0xbbeb12[_0xb8f7('0x20')][_0x3f4e40['id']])){_0xbbeb12[_0xb8f7('0x20')][_0x3f4e40['id']]=new Dynamics365Account(_0x3f4e40);}else{_0xbbeb12[_0xb8f7('0x40')](_0xbbeb12[_0xb8f7('0x20')][_0x3f4e40['id']],_0x3f4e40);}}}return _0xbbeb12[_0xb8f7('0x20')];};};Realtime['prototype'][_0xb8f7('0x53')]=function(){var _0x12f460=this;return function(_0x44b58c){if(_0x44b58c){freeIsNotKey(_0x44b58c,_0x12f460[_0xb8f7('0x21')],'id');for(var _0x4943b0=0x0,_0x5270b1={},_0x455e62={};_0x4943b0<_0x44b58c['length'];_0x4943b0+=0x1){_0x5270b1=_0x44b58c[_0x4943b0];if(_[_0xb8f7('0x46')](_0x12f460['freshsalesAccounts'][_0x5270b1['id']])){_0x12f460[_0xb8f7('0x21')][_0x5270b1['id']]=new FreshsalesAccount(_0x5270b1);}else{_0x12f460[_0xb8f7('0x40')](_0x12f460['freshsalesAccounts'][_0x5270b1['id']],_0x5270b1);}}}return _0x12f460[_0xb8f7('0x21')];};};Realtime[_0xb8f7('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0xdd2b0=this;return function(_0x423baa){for(var _0x368dad=0x0;_0x368dad<_0x423baa[_0xb8f7('0x42')];_0x368dad+=0x1){_[_0xb8f7('0x54')](_0xdd2b0[_0xb8f7('0x48')][_0x423baa[_0x368dad][_0xb8f7('0x25')]],_0x423baa[_0x368dad]);}return _0xdd2b0[_0xb8f7('0x48')];};};Realtime[_0xb8f7('0x3f')]['initVoiceQueueReports']=function(){var _0x98d5b4=this;return function(_0x41eebb){clearVoiceQueues(_0x98d5b4[_0xb8f7('0x48')]);if(_0x41eebb){_0x41eebb=_['groupBy'](_0x41eebb,_0xb8f7('0x55'));for(var _0x4ddd65 in _0x41eebb){if(_0x41eebb[_0xb8f7('0x26')](_0x4ddd65)){var _0x916f36={};for(var _0x2de047=0x0;_0x2de047<_0x41eebb[_0x4ddd65][_0xb8f7('0x42')];_0x2de047+=0x1){var _0x1a81c4=_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x56')];if(_0x98d5b4['voiceQueues'][_0x1a81c4]){if(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x57')]){_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4][_0xb8f7('0x32')]+=0x1;}if(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x58')]){_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4][_0xb8f7('0x59')]+=0x1;}_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4][_0xb8f7('0x2c')]+=moment(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x5a')])[_0xb8f7('0x5b')](moment(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x5c')]),_0xb8f7('0x5d'))||0x0;if(_0x2de047===_0x41eebb[_0x4ddd65][_0xb8f7('0x42')]-0x1){_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4][_0xb8f7('0x2d')]+=moment(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x5e')]||_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x5f')]||_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x60')])[_0xb8f7('0x5b')](moment(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x5c')]),'seconds')||0x0;_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4]['total']+=0x1;if(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x61')]){_0x98d5b4['voiceQueues'][_0x1a81c4][_0xb8f7('0x2b')]+=0x1;_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4][_0xb8f7('0x2e')]+=moment(_0x41eebb[_0x4ddd65][_0x2de047]['queuecallercompleteAt'])[_0xb8f7('0x5b')](moment(_0x41eebb[_0x4ddd65][_0x2de047][_0xb8f7('0x5a')]),_0xb8f7('0x5d'))||0x0;}}else{_0x98d5b4[_0xb8f7('0x48')][_0x1a81c4][_0xb8f7('0x2d')]+=_0x98d5b4['voiceQueues'][_0x1a81c4]['sumHoldTime']||0x0;}}}}}}return _0x98d5b4[_0xb8f7('0x48')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x62')]=function(){var _0xcc0f1e=this;return function(_0x13d6f4){clearVoiceCallReports(_0xcc0f1e['outbound']);if(_0x13d6f4){for(var _0x50689e=0x0;_0x50689e<_0x13d6f4[_0xb8f7('0x42')];_0x50689e+=0x1){_0xcc0f1e['outbound'][_0xb8f7('0x2a')]+=0x1;_0xcc0f1e['outbound'][_0xb8f7('0x2d')]+=_0x13d6f4[_0x50689e][_0xb8f7('0x63')];if(_0x13d6f4[_0x50689e]['disposition']==='ANSWERED'){_0xcc0f1e[_0xb8f7('0x64')][_0xb8f7('0x2b')]+=0x1;_0xcc0f1e['outbound'][_0xb8f7('0x2c')]+=_0x13d6f4[_0x50689e]['duration']-_0x13d6f4[_0x50689e][_0xb8f7('0x65')]||0x0;_0xcc0f1e[_0xb8f7('0x64')]['sumBillable']+=_0x13d6f4[_0x50689e][_0xb8f7('0x65')];}}}return _0xcc0f1e[_0xb8f7('0x64')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x66')]=function(){var _0x25601d=this;return function(_0x181c9e){if(_0x181c9e){freeIsNotKey(_0x181c9e,_0x25601d[_0xb8f7('0x13')],_0xb8f7('0x25'));for(var _0xecc264=0x0,_0x57a80b={};_0xecc264<_0x181c9e['length'];_0xecc264+=0x1){_0x57a80b=_0x181c9e[_0xecc264];if(_[_0xb8f7('0x46')](_0x25601d[_0xb8f7('0x13')][_0x57a80b[_0xb8f7('0x25')]])){_0x25601d['campaigns'][_0x57a80b[_0xb8f7('0x25')]]=new Campaign(_0x57a80b);}else{_0x25601d[_0xb8f7('0x40')](_0x25601d[_0xb8f7('0x13')][_0x57a80b['name']],_0x57a80b);_0x25601d[_0xb8f7('0x13')][_0x57a80b[_0xb8f7('0x25')]][_0xb8f7('0x67')]=_0x57a80b[_0xb8f7('0x68')]?_0x57a80b[_0xb8f7('0x68')][_0xb8f7('0x25')]:undefined;}}}return _0x25601d[_0xb8f7('0x13')];};};Realtime['prototype'][_0xb8f7('0x69')]=function(){var _0x48a9b4=this;return function(_0x415300){if(_0x415300){freeIsNotKey(_0x415300,_0x48a9b4['voiceExtensions'],'id');for(var _0x1f8779=0x0,_0x1261a8={};_0x1f8779<_0x415300[_0xb8f7('0x42')];_0x1f8779+=0x1){_0x1261a8=_0x415300[_0x1f8779];if(_[_0xb8f7('0x46')](_0x48a9b4[_0xb8f7('0x14')][_0x1261a8['id']])){_0x48a9b4['voiceExtensions'][_0x1261a8['id']]=new VoiceExtension(_0x1261a8);}else{_0x48a9b4[_0xb8f7('0x40')](_0x48a9b4[_0xb8f7('0x14')][_0x1261a8['id']],_0x1261a8);}}}return _0x48a9b4[_0xb8f7('0x14')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x6a')]=function(){var _0x68ce4b=this;return function(_0x51f043){clearCampaigns(_0x68ce4b['campaigns']);for(var _0x2cb5e7=0x0;_0x2cb5e7<_0x51f043[_0xb8f7('0x42')];_0x2cb5e7+=0x1){_['merge'](_0x68ce4b['campaigns'][_0x51f043[_0x2cb5e7]['name']],_0x51f043[_0x2cb5e7]);}return _0x68ce4b[_0xb8f7('0x13')];};};Realtime[_0xb8f7('0x3f')][_0xb8f7('0x6b')]=function(){var _0x5d2581=this;return function(_0x2e39fa){if(_0x2e39fa){freeIsNotKey(_0x2e39fa,_0x5d2581['faxAccounts'],'id');for(var _0x28ef3a=0x0,_0x12ce3d={},_0x444c89={};_0x28ef3a<_0x2e39fa[_0xb8f7('0x42')];_0x28ef3a+=0x1){_0x12ce3d=_0x2e39fa[_0x28ef3a];if(_[_0xb8f7('0x46')](_0x5d2581[_0xb8f7('0x22')][_0x12ce3d['id']])){_0x5d2581['faxAccounts'][_0x12ce3d['id']]=new FaxAccount(_0x12ce3d);}else{_0x5d2581[_0xb8f7('0x40')](_0x5d2581[_0xb8f7('0x22')][_0x12ce3d['id']],_0x12ce3d);}}}return _0x5d2581['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x97af=['exports','bluebird','util','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','name','isNil','hasOwnProperty','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','interface','SIP/%s','initTelephones','isUndefined','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initSalesforceAccounts','salesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','sumBillable','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x97af,0x14b));var _0xf97a=function(_0x2a9843,_0x1db071){_0x2a9843=_0x2a9843-0x0;var _0x2ff828=_0x97af[_0x2a9843];return _0x2ff828;};'use strict';var BPromise=require(_0xf97a('0x0'));var util=require(_0xf97a('0x1'));var _=require('lodash');var moment=require(_0xf97a('0x2'));var Agent=require(_0xf97a('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xf97a('0x4'));var VoiceQueue=require(_0xf97a('0x5'));var Trigger=require(_0xf97a('0x6'));var Template=require(_0xf97a('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xf97a('0x8'));var SugarcrmAccount=require(_0xf97a('0x9'));var ZohoAccount=require(_0xf97a('0xa'));var DeskAccount=require(_0xf97a('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xf97a('0xc'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xf97a('0xd'));var FaxAccount=require(_0xf97a('0xe'));var Realtime=function(){this[_0xf97a('0xf')]={};this[_0xf97a('0x10')]={};this['trunks']={};this['voiceQueues']={};this[_0xf97a('0x11')]={};this[_0xf97a('0x12')]={};this[_0xf97a('0x13')]={};this[_0xf97a('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf97a('0x15')]={};this[_0xf97a('0x16')]={};this['queueChannels']={};this[_0xf97a('0x17')]={};this[_0xf97a('0x18')]={};this[_0xf97a('0x19')]={};this[_0xf97a('0x1a')]={};this['salesforceAccounts']={};this[_0xf97a('0x1b')]={};this['freshdeskAccounts']={};this[_0xf97a('0x1c')]={};this['deskAccounts']={};this[_0xf97a('0x1d')]={};this[_0xf97a('0x1e')]={};this['dynamics365Accounts']={};this[_0xf97a('0x1f')]={};this[_0xf97a('0x20')]={};};function freeIsNotKey(_0x1832c3,_0x14f8d4,_0x452e79){var _0x172c5c=_[_0xf97a('0x21')](_0x1832c3,function(_0x710ab2,_0x23b0cd){return _0x710ab2[_0x452e79];});for(var _0x2d069f in _0x14f8d4){if(_0x14f8d4['hasOwnProperty'](_0x2d069f)){if(!_0x172c5c[_0x2d069f]){delete _0x14f8d4[_0x2d069f];}}}}function freeIsNotKeySip(_0x3eb2b0,_0x286c6e){var _0x4434b2=_[_0xf97a('0x21')](_0x3eb2b0,function(_0x39f79b,_0x34c209){return util[_0xf97a('0x22')]('SIP/%s',_0x39f79b[_0xf97a('0x23')]);});for(var _0x438f09 in _0x286c6e){if(_0x286c6e['hasOwnProperty'](_0x438f09)){if(!_0x4434b2[_0x438f09]){delete _0x286c6e[_0x438f09];}}}}function freeIsNotKeyAgent(_0x48fe91,_0x4234f1){var _0x33b107=_[_0xf97a('0x21')](_0x48fe91,function(_0x2241a6,_0x1b3302){var _0x187076=_[_0xf97a('0x24')](_0x2241a6['interface'])?util[_0xf97a('0x22')]('SIP/%s',_0x2241a6[_0xf97a('0x23')]):_0x2241a6['interface'];return _0x187076;});for(var _0x3bee0e in _0x4234f1){if(_0x4234f1[_0xf97a('0x25')](_0x3bee0e)){if(!_0x33b107[_0x3bee0e]){delete _0x4234f1[_0x3bee0e];}}}}function clearVoiceCallReports(_0x46bf59){_0x46bf59[_0xf97a('0x26')]=0x0;_0x46bf59[_0xf97a('0x27')]=0x0;_0x46bf59[_0xf97a('0x28')]=0x0;_0x46bf59[_0xf97a('0x29')]=0x0;_0x46bf59['sumBillable']=0x0;}function clearCampaigns(_0x4a8ebe){if(!_[_0xf97a('0x2a')](_0x4a8ebe)){for(var _0x4a5619 in _0x4a8ebe){if(_0x4a8ebe[_0xf97a('0x25')](_0x4a5619)){_0x4a8ebe[_0x4a5619][_0xf97a('0x2b')]=0x0;_0x4a8ebe[_0x4a5619]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x24a0d2){if(!_[_0xf97a('0x2a')](_0x24a0d2)){for(var _0x4fc5dd in _0x24a0d2){if(_0x24a0d2[_0xf97a('0x25')](_0x4fc5dd)){_0x24a0d2[_0x4fc5dd]['total']=0x0;_0x24a0d2[_0x4fc5dd]['answered']=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x2c')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x2d')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x28')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x29')]=0x0;_0x24a0d2[_0x4fc5dd]['sumBillable']=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x2e')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x2f')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x30')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x31')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x32')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x33')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x34')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x35')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x36')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x37')]=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x38')]=0x0;_0x24a0d2[_0x4fc5dd]['outboundReCallsDay']=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x2e')]=0x0;_0x24a0d2[_0x4fc5dd]['outboundAnswerCallsDay']=0x0;_0x24a0d2[_0x4fc5dd][_0xf97a('0x39')]=!![];}}}}Realtime[_0xf97a('0x3a')][_0xf97a('0x3b')]=function(_0x57257c,_0x462470){for(var _0x59e949 in _0x462470){if(_0x57257c[_0xf97a('0x25')](_0x59e949)){_0x57257c[_0x59e949]=_0x462470[_0x59e949];}}};Realtime['prototype'][_0xf97a('0x3c')]=function(){var _0x1df714=this;return function(_0x2c9080){if(_0x2c9080){freeIsNotKeyAgent(_0x2c9080,_0x1df714['agents']);for(var _0x2847a3=0x0,_0x46474f={},_0x94a75f={};_0x2847a3<_0x2c9080[_0xf97a('0x3d')];_0x2847a3+=0x1){_0x46474f=_0x2c9080[_0x2847a3];var _0x3c3ea7=_[_0xf97a('0x24')](_0x46474f[_0xf97a('0x3e')])?util[_0xf97a('0x22')](_0xf97a('0x3f'),_0x46474f[_0xf97a('0x23')]):_0x46474f[_0xf97a('0x3e')];if(_['isUndefined'](_0x1df714[_0xf97a('0xf')][_0x3c3ea7])){_0x1df714[_0xf97a('0xf')][_0x3c3ea7]=new Agent(_0x46474f);}else{_0x1df714['mergeFromDatabase'](_0x1df714[_0xf97a('0xf')][_0x3c3ea7],_0x46474f);}}}return _0x1df714['agents'];};};Realtime['prototype'][_0xf97a('0x40')]=function(){var _0x78a0bf=this;return function(_0x2e244a){if(_0x2e244a){freeIsNotKeySip(_0x2e244a,_0x78a0bf['telephones']);for(var _0x207369=0x0,_0x40c4ac={},_0x2a4b61={};_0x207369<_0x2e244a['length'];_0x207369+=0x1){_0x40c4ac=_0x2e244a[_0x207369];if(_[_0xf97a('0x41')](_0x78a0bf[_0xf97a('0x10')][util[_0xf97a('0x22')](_0xf97a('0x3f'),_0x40c4ac[_0xf97a('0x23')])])){_0x78a0bf[_0xf97a('0x10')][util[_0xf97a('0x22')]('SIP/%s',_0x40c4ac[_0xf97a('0x23')])]=new Telephone(_0x40c4ac);}else{_0x78a0bf['mergeFromDatabase'](_0x78a0bf[_0xf97a('0x10')][util[_0xf97a('0x22')](_0xf97a('0x3f'),_0x40c4ac['name'])],_0x40c4ac);}}}return _0x78a0bf[_0xf97a('0x10')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x42')]=function(){var _0x4f4f5c=this;return function(_0x21bab7){if(_0x21bab7){freeIsNotKeySip(_0x21bab7,_0x4f4f5c[_0xf97a('0x43')]);for(var _0xefa861=0x0,_0x50c7c3={},_0x2c5e6b={};_0xefa861<_0x21bab7['length'];_0xefa861+=0x1){_0x50c7c3=_0x21bab7[_0xefa861];if(_[_0xf97a('0x41')](_0x4f4f5c[_0xf97a('0x43')][util['format'](_0xf97a('0x3f'),_0x50c7c3[_0xf97a('0x23')])])){_0x4f4f5c['trunks'][util[_0xf97a('0x22')](_0xf97a('0x3f'),_0x50c7c3['name'])]=new Trunk(_0x50c7c3);}else{_0x4f4f5c[_0xf97a('0x3b')](_0x4f4f5c[_0xf97a('0x43')][util[_0xf97a('0x22')](_0xf97a('0x3f'),_0x50c7c3[_0xf97a('0x23')])],_0x50c7c3);}}}return _0x4f4f5c[_0xf97a('0x43')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x44')]=function(){var _0x2c253a=this;return function(_0x516a46){if(_0x516a46){freeIsNotKey(_0x516a46,_0x2c253a[_0xf97a('0x45')],_0xf97a('0x23'));for(var _0x42002d=0x0,_0xd7f169={},_0x34793e={};_0x42002d<_0x516a46[_0xf97a('0x3d')];_0x42002d+=0x1){_0xd7f169=_0x516a46[_0x42002d];if(_[_0xf97a('0x41')](_0x2c253a[_0xf97a('0x45')][_0xd7f169[_0xf97a('0x23')]])){_0x2c253a['voiceQueues'][_0xd7f169['name']]=new VoiceQueue(_0xd7f169);}else{_0x2c253a[_0xf97a('0x3b')](_0x2c253a[_0xf97a('0x45')][_0xd7f169[_0xf97a('0x23')]],_0xd7f169);}}}return _0x2c253a['voiceQueues'];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x46')]=function(){var _0x533a78=this;return function(_0x578da5){if(_0x578da5){freeIsNotKey(_0x578da5,_0x533a78[_0xf97a('0x11')],'id');for(var _0xc72a3=0x0,_0x2ae551={},_0x51393e={};_0xc72a3<_0x578da5['length'];_0xc72a3+=0x1){_0x2ae551=_0x578da5[_0xc72a3];if(_[_0xf97a('0x41')](_0x533a78[_0xf97a('0x11')][_0x2ae551['id']])){_0x533a78[_0xf97a('0x11')][_0x2ae551['id']]=new Trigger(_0x2ae551);}else{_0x533a78['mergeFromDatabase'](_0x533a78['triggers'][_0x2ae551['id']],_0x2ae551);}}}return _0x533a78[_0xf97a('0x11')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x47')]=function(){var _0x55ef82=this;return function(_0x3e8d74){if(_0x3e8d74){freeIsNotKey(_0x3e8d74,_0x55ef82[_0xf97a('0x13')],'id');for(var _0x66f99=0x0,_0x1e856e={},_0x37136e={};_0x66f99<_0x3e8d74[_0xf97a('0x3d')];_0x66f99+=0x1){_0x1e856e=_0x3e8d74[_0x66f99];if(_[_0xf97a('0x41')](_0x55ef82[_0xf97a('0x13')][_0x1e856e['id']])){_0x55ef82[_0xf97a('0x13')][_0x1e856e['id']]=new Template(_0x1e856e);}else{_0x55ef82[_0xf97a('0x3b')](_0x55ef82['templates'][_0x1e856e['id']],_0x1e856e);}}}return _0x55ef82[_0xf97a('0x13')];};};Realtime[_0xf97a('0x3a')]['initZendeskAccounts']=function(){var _0xe14c52=this;return function(_0x4a0e60){if(_0x4a0e60){freeIsNotKey(_0x4a0e60,_0xe14c52['zendeskAccounts'],'id');for(var _0x57d6e7=0x0,_0x378239={},_0x375ebe={};_0x57d6e7<_0x4a0e60[_0xf97a('0x3d')];_0x57d6e7+=0x1){_0x378239=_0x4a0e60[_0x57d6e7];if(_[_0xf97a('0x41')](_0xe14c52['zendeskAccounts'][_0x378239['id']])){_0xe14c52[_0xf97a('0x1a')][_0x378239['id']]=new ZendeskAccount(_0x378239);}else{_0xe14c52[_0xf97a('0x3b')](_0xe14c52['zendeskAccounts'][_0x378239['id']],_0x378239);}}}return _0xe14c52[_0xf97a('0x1a')];};};Realtime['prototype'][_0xf97a('0x48')]=function(){var _0x1908ef=this;return function(_0x4a9a4d){if(_0x4a9a4d){freeIsNotKey(_0x4a9a4d,_0x1908ef[_0xf97a('0x49')],'id');for(var _0x16ff35=0x0,_0x1f8691={},_0x1ff00d={};_0x16ff35<_0x4a9a4d[_0xf97a('0x3d')];_0x16ff35+=0x1){_0x1f8691=_0x4a9a4d[_0x16ff35];if(_[_0xf97a('0x41')](_0x1908ef[_0xf97a('0x49')][_0x1f8691['id']])){_0x1908ef['salesforceAccounts'][_0x1f8691['id']]=new SalesforceAccount(_0x1f8691);}else{_0x1908ef['mergeFromDatabase'](_0x1908ef[_0xf97a('0x49')][_0x1f8691['id']],_0x1f8691);}}}return _0x1908ef[_0xf97a('0x49')];};};Realtime[_0xf97a('0x3a')]['initFreshdeskAccounts']=function(){var _0x3189a1=this;return function(_0x4fe7f9){if(_0x4fe7f9){freeIsNotKey(_0x4fe7f9,_0x3189a1[_0xf97a('0x4a')],'id');for(var _0x37d74e=0x0,_0x35b63b={},_0x2dfe6b={};_0x37d74e<_0x4fe7f9[_0xf97a('0x3d')];_0x37d74e+=0x1){_0x35b63b=_0x4fe7f9[_0x37d74e];if(_[_0xf97a('0x41')](_0x3189a1[_0xf97a('0x4a')][_0x35b63b['id']])){_0x3189a1[_0xf97a('0x4a')][_0x35b63b['id']]=new FreshdeskAccount(_0x35b63b);}else{_0x3189a1['mergeFromDatabase'](_0x3189a1['freshdeskAccounts'][_0x35b63b['id']],_0x35b63b);}}}return _0x3189a1[_0xf97a('0x4a')];};};Realtime['prototype'][_0xf97a('0x4b')]=function(){var _0x57aa2d=this;return function(_0x568fd8){if(_0x568fd8){freeIsNotKey(_0x568fd8,_0x57aa2d[_0xf97a('0x1c')],'id');for(var _0x20b6a8=0x0,_0x1e8b6c={},_0x54bb5a={};_0x20b6a8<_0x568fd8[_0xf97a('0x3d')];_0x20b6a8+=0x1){_0x1e8b6c=_0x568fd8[_0x20b6a8];if(_[_0xf97a('0x41')](_0x57aa2d['zohoAccounts'][_0x1e8b6c['id']])){_0x57aa2d[_0xf97a('0x1c')][_0x1e8b6c['id']]=new ZohoAccount(_0x1e8b6c);}else{_0x57aa2d[_0xf97a('0x3b')](_0x57aa2d[_0xf97a('0x1c')][_0x1e8b6c['id']],_0x1e8b6c);}}}return _0x57aa2d[_0xf97a('0x1c')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x4c')]=function(){var _0x10e8a1=this;return function(_0x13ba42){if(_0x13ba42){freeIsNotKey(_0x13ba42,_0x10e8a1[_0xf97a('0x4d')],'id');for(var _0x361141=0x0,_0x14da0f={},_0x5cd7f6={};_0x361141<_0x13ba42[_0xf97a('0x3d')];_0x361141+=0x1){_0x14da0f=_0x13ba42[_0x361141];if(_[_0xf97a('0x41')](_0x10e8a1[_0xf97a('0x4d')][_0x14da0f['id']])){_0x10e8a1[_0xf97a('0x4d')][_0x14da0f['id']]=new DeskAccount(_0x14da0f);}else{_0x10e8a1[_0xf97a('0x3b')](_0x10e8a1['deskAccounts'][_0x14da0f['id']],_0x14da0f);}}}return _0x10e8a1[_0xf97a('0x4d')];};};Realtime['prototype'][_0xf97a('0x4e')]=function(){var _0xe748b=this;return function(_0x1095a9){if(_0x1095a9){freeIsNotKey(_0x1095a9,_0xe748b[_0xf97a('0x1b')],'id');for(var _0x519d6c=0x0,_0x299c1e={},_0x3d455c={};_0x519d6c<_0x1095a9[_0xf97a('0x3d')];_0x519d6c+=0x1){_0x299c1e=_0x1095a9[_0x519d6c];if(_[_0xf97a('0x41')](_0xe748b[_0xf97a('0x1b')][_0x299c1e['id']])){_0xe748b[_0xf97a('0x1b')][_0x299c1e['id']]=new SugarcrmAccount(_0x299c1e);}else{_0xe748b[_0xf97a('0x3b')](_0xe748b['sugarcrmAccounts'][_0x299c1e['id']],_0x299c1e);}}}return _0xe748b[_0xf97a('0x1b')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x4f')]=function(){var _0x42f88d=this;return function(_0x3c8e15){if(_0x3c8e15){freeIsNotKey(_0x3c8e15,_0x42f88d[_0xf97a('0x1d')],'id');for(var _0x57734c=0x0,_0x5f0280={},_0x12c2b4={};_0x57734c<_0x3c8e15[_0xf97a('0x3d')];_0x57734c+=0x1){_0x5f0280=_0x3c8e15[_0x57734c];if(_[_0xf97a('0x41')](_0x42f88d[_0xf97a('0x1d')][_0x5f0280['id']])){_0x42f88d[_0xf97a('0x1d')][_0x5f0280['id']]=new VtigerAccount(_0x5f0280);}else{_0x42f88d[_0xf97a('0x3b')](_0x42f88d[_0xf97a('0x1d')][_0x5f0280['id']],_0x5f0280);}}}return _0x42f88d[_0xf97a('0x1d')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x50')]=function(){var _0x21d777=this;return function(_0x52f9f7){if(_0x52f9f7){freeIsNotKey(_0x52f9f7,_0x21d777[_0xf97a('0x1e')],'id');for(var _0x2edc69=0x0,_0x272614={},_0x48776e={};_0x2edc69<_0x52f9f7['length'];_0x2edc69+=0x1){_0x272614=_0x52f9f7[_0x2edc69];if(_['isUndefined'](_0x21d777[_0xf97a('0x1e')][_0x272614['id']])){_0x21d777[_0xf97a('0x1e')][_0x272614['id']]=new ServicenowAccount(_0x272614);}else{_0x21d777[_0xf97a('0x3b')](_0x21d777[_0xf97a('0x1e')][_0x272614['id']],_0x272614);}}}return _0x21d777[_0xf97a('0x1e')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x51')]=function(){var _0x57af1e=this;return function(_0x5866c7){if(_0x5866c7){freeIsNotKey(_0x5866c7,_0x57af1e[_0xf97a('0x52')],'id');for(var _0x16146e=0x0,_0x5a6c21={},_0x352f8d={};_0x16146e<_0x5866c7[_0xf97a('0x3d')];_0x16146e+=0x1){_0x5a6c21=_0x5866c7[_0x16146e];if(_[_0xf97a('0x41')](_0x57af1e[_0xf97a('0x52')][_0x5a6c21['id']])){_0x57af1e[_0xf97a('0x52')][_0x5a6c21['id']]=new Dynamics365Account(_0x5a6c21);}else{_0x57af1e['mergeFromDatabase'](_0x57af1e['dynamics365Accounts'][_0x5a6c21['id']],_0x5a6c21);}}}return _0x57af1e[_0xf97a('0x52')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x53')]=function(){var _0x23b2e7=this;return function(_0x8d2c8){if(_0x8d2c8){freeIsNotKey(_0x8d2c8,_0x23b2e7[_0xf97a('0x1f')],'id');for(var _0x2dfd02=0x0,_0x2cf4e3={},_0x55f84d={};_0x2dfd02<_0x8d2c8['length'];_0x2dfd02+=0x1){_0x2cf4e3=_0x8d2c8[_0x2dfd02];if(_[_0xf97a('0x41')](_0x23b2e7['freshsalesAccounts'][_0x2cf4e3['id']])){_0x23b2e7[_0xf97a('0x1f')][_0x2cf4e3['id']]=new FreshsalesAccount(_0x2cf4e3);}else{_0x23b2e7[_0xf97a('0x3b')](_0x23b2e7[_0xf97a('0x1f')][_0x2cf4e3['id']],_0x2cf4e3);}}}return _0x23b2e7[_0xf97a('0x1f')];};};Realtime['prototype'][_0xf97a('0x54')]=function(){var _0x45918f=this;return function(_0x55805f){for(var _0x44d847=0x0;_0x44d847<_0x55805f[_0xf97a('0x3d')];_0x44d847+=0x1){_['merge'](_0x45918f[_0xf97a('0x45')][_0x55805f[_0x44d847]['name']],_0x55805f[_0x44d847]);}return _0x45918f[_0xf97a('0x45')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x55')]=function(){var _0x1b4087=this;return function(_0x29691c){clearVoiceQueues(_0x1b4087[_0xf97a('0x45')]);if(_0x29691c){_0x29691c=_['groupBy'](_0x29691c,'uniqueid');for(var _0x5611d6 in _0x29691c){if(_0x29691c[_0xf97a('0x25')](_0x5611d6)){var _0x147af3={};for(var _0xdef9d2=0x0;_0xdef9d2<_0x29691c[_0x5611d6][_0xf97a('0x3d')];_0xdef9d2+=0x1){var _0x287c2a=_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x56')];if(_0x1b4087[_0xf97a('0x45')][_0x287c2a]){if(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x57')]){_0x1b4087[_0xf97a('0x45')][_0x287c2a][_0xf97a('0x2c')]+=0x1;}if(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x58')]){_0x1b4087[_0xf97a('0x45')][_0x287c2a][_0xf97a('0x2d')]+=0x1;}_0x1b4087['voiceQueues'][_0x287c2a]['sumHoldTime']+=moment(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x59')])[_0xf97a('0x5a')](moment(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x5b')]),_0xf97a('0x5c'))||0x0;if(_0xdef9d2===_0x29691c[_0x5611d6]['length']-0x1){_0x1b4087[_0xf97a('0x45')][_0x287c2a][_0xf97a('0x29')]+=moment(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x5d')]||_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x5e')]||_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x5f')])[_0xf97a('0x5a')](moment(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x5b')]),'seconds')||0x0;_0x1b4087[_0xf97a('0x45')][_0x287c2a][_0xf97a('0x26')]+=0x1;if(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x60')]){_0x1b4087[_0xf97a('0x45')][_0x287c2a][_0xf97a('0x27')]+=0x1;_0x1b4087[_0xf97a('0x45')][_0x287c2a]['sumBillable']+=moment(_0x29691c[_0x5611d6][_0xdef9d2]['queuecallercompleteAt'])[_0xf97a('0x5a')](moment(_0x29691c[_0x5611d6][_0xdef9d2][_0xf97a('0x59')]),_0xf97a('0x5c'))||0x0;}}else{_0x1b4087[_0xf97a('0x45')][_0x287c2a][_0xf97a('0x29')]+=_0x1b4087[_0xf97a('0x45')][_0x287c2a]['sumHoldTime']||0x0;}}}}}}return _0x1b4087[_0xf97a('0x45')];};};Realtime['prototype'][_0xf97a('0x61')]=function(){var _0x2a966f=this;return function(_0x441ca4){clearVoiceCallReports(_0x2a966f[_0xf97a('0x14')]);if(_0x441ca4){for(var _0x3b21b6=0x0;_0x3b21b6<_0x441ca4['length'];_0x3b21b6+=0x1){_0x2a966f[_0xf97a('0x14')][_0xf97a('0x26')]+=0x1;_0x2a966f[_0xf97a('0x14')][_0xf97a('0x29')]+=_0x441ca4[_0x3b21b6][_0xf97a('0x62')];if(_0x441ca4[_0x3b21b6][_0xf97a('0x63')]===_0xf97a('0x64')){_0x2a966f['outbound'][_0xf97a('0x27')]+=0x1;_0x2a966f[_0xf97a('0x14')]['sumHoldTime']+=_0x441ca4[_0x3b21b6]['duration']-_0x441ca4[_0x3b21b6][_0xf97a('0x65')]||0x0;_0x2a966f[_0xf97a('0x14')][_0xf97a('0x66')]+=_0x441ca4[_0x3b21b6][_0xf97a('0x65')];}}}return _0x2a966f[_0xf97a('0x14')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x67')]=function(){var _0x4fd0d8=this;return function(_0x18cf72){if(_0x18cf72){freeIsNotKey(_0x18cf72,_0x4fd0d8['campaigns'],_0xf97a('0x23'));for(var _0x30fbf1=0x0,_0x1d68c1={};_0x30fbf1<_0x18cf72[_0xf97a('0x3d')];_0x30fbf1+=0x1){_0x1d68c1=_0x18cf72[_0x30fbf1];if(_['isUndefined'](_0x4fd0d8[_0xf97a('0x12')][_0x1d68c1[_0xf97a('0x23')]])){_0x4fd0d8['campaigns'][_0x1d68c1[_0xf97a('0x23')]]=new Campaign(_0x1d68c1);}else{_0x4fd0d8[_0xf97a('0x3b')](_0x4fd0d8[_0xf97a('0x12')][_0x1d68c1[_0xf97a('0x23')]],_0x1d68c1);_0x4fd0d8['campaigns'][_0x1d68c1[_0xf97a('0x23')]][_0xf97a('0x68')]=_0x1d68c1[_0xf97a('0x69')]?_0x1d68c1[_0xf97a('0x69')][_0xf97a('0x23')]:undefined;}}}return _0x4fd0d8['campaigns'];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x6a')]=function(){var _0x425ed7=this;return function(_0x22677a){if(_0x22677a){freeIsNotKey(_0x22677a,_0x425ed7['voiceExtensions'],'id');for(var _0x1ff98c=0x0,_0x1a65be={};_0x1ff98c<_0x22677a['length'];_0x1ff98c+=0x1){_0x1a65be=_0x22677a[_0x1ff98c];if(_[_0xf97a('0x41')](_0x425ed7[_0xf97a('0x15')][_0x1a65be['id']])){_0x425ed7[_0xf97a('0x15')][_0x1a65be['id']]=new VoiceExtension(_0x1a65be);}else{_0x425ed7[_0xf97a('0x3b')](_0x425ed7[_0xf97a('0x15')][_0x1a65be['id']],_0x1a65be);}}}return _0x425ed7[_0xf97a('0x15')];};};Realtime[_0xf97a('0x3a')][_0xf97a('0x6b')]=function(){var _0xc9f958=this;return function(_0xd76486){clearCampaigns(_0xc9f958['campaigns']);for(var _0x5463da=0x0;_0x5463da<_0xd76486[_0xf97a('0x3d')];_0x5463da+=0x1){_[_0xf97a('0x6c')](_0xc9f958[_0xf97a('0x12')][_0xd76486[_0x5463da][_0xf97a('0x23')]],_0xd76486[_0x5463da]);}return _0xc9f958[_0xf97a('0x12')];};};Realtime[_0xf97a('0x3a')]['initFaxAccounts']=function(){var _0x247202=this;return function(_0x1e4af4){if(_0x1e4af4){freeIsNotKey(_0x1e4af4,_0x247202[_0xf97a('0x20')],'id');for(var _0x4aaa19=0x0,_0x583d41={},_0x9345dd={};_0x4aaa19<_0x1e4af4[_0xf97a('0x3d')];_0x4aaa19+=0x1){_0x583d41=_0x1e4af4[_0x4aaa19];if(_[_0xf97a('0x41')](_0x247202[_0xf97a('0x20')][_0x583d41['id']])){_0x247202[_0xf97a('0x20')][_0x583d41['id']]=new FaxAccount(_0x583d41);}else{_0x247202[_0xf97a('0x3b')](_0x247202[_0xf97a('0x20')][_0x583d41['id']],_0x583d41);}}}return _0x247202[_0xf97a('0x20')];};};module[_0xf97a('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 78f0f6f..9cdd93d 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 _0xddda=['queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','destination','dialer','lastapplication','queue','from-voip-provider','callerid','context','from-sip','originatecalleridnum','channel','destinationchannel','calleridpreview','disposition','ANSWERED','linkedid','transfers','transfereelinkedid','uniqueid','type','membername','monitor','monitors','filename','createdAt','exten','xcally-motion-preview','connectedlinename','isArray','forEach','startsWith','Local','substring','indexOf','phone','transfererlinkedid','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','voiceAgentReport','bind','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','format'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xddda,0x1ec));var _0xaddd=function(_0xe155f0,_0x2989c8){_0xe155f0=_0xe155f0-0x0;var _0x453005=_0xddda[_0xe155f0];return _0x453005;};'use strict';var _=require('lodash');var moment=require(_0xaddd('0x0'));var util=require('util');var config=require(_0xaddd('0x1'));var ami=require(_0xaddd('0x2'));var RpcVoiceAgentReport=require(_0xaddd('0x3'));var RpcVoiceCallReport=require(_0xaddd('0x4'));var RpcVoiceDialReport=require(_0xaddd('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xaddd('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xaddd('0x7'));var VoiceQueueReport=require(_0xaddd('0x8'));var VoiceCallReport=require(_0xaddd('0x9'));var VoiceAgentReport=require(_0xaddd('0xa'));var VoiceDialReport=require(_0xaddd('0xb'));var UserReport=require(_0xaddd('0xc'));function Report(_0x1651c7){this[_0xaddd('0xd')]=_0x1651c7;this[_0xaddd('0xe')]=_0x1651c7[_0xaddd('0xe')];this[_0xaddd('0xf')]=_0x1651c7['telephones'];}Report[_0xaddd('0x10')]['sync']=function(_0x3b7180){var _0x3417b7=new VoiceQueueReport(this[_0xaddd('0xd')]);var _0x36f5ea=new VoiceAgentReport(this[_0xaddd('0xd')]);var _0x3fa52c=new VoiceDialReport(this[_0xaddd('0xd')]);var _0xa869c4=new VoiceCallReport(this[_0xaddd('0xd')]);var _0x1341ff=new UserReport(this[_0xaddd('0xd')]);if(config[_0xaddd('0x11')]&&config[_0xaddd('0x11')][_0xaddd('0x12')]){ami['on'](_0xaddd('0x13'),this[_0xaddd('0x14')]['bind'](this));ami['on'](_0xaddd('0x15'),this[_0xaddd('0x16')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0xaddd('0x17')][_0xaddd('0x18')](this));ami['on'](_0xaddd('0x19'),this[_0xaddd('0x1a')][_0xaddd('0x18')](this));ami['on'](_0xaddd('0x1b'),this[_0xaddd('0x1c')][_0xaddd('0x18')](this));ami['on'](_0xaddd('0x1d'),this[_0xaddd('0x1e')][_0xaddd('0x18')](this));}};Report[_0xaddd('0x10')][_0xaddd('0x1f')]=function(_0x2feac3){var _0xf39b90;_0xf39b90=_[_0xaddd('0x20')](this[_0xaddd('0xe')],function(_0x4f2d19){return _0x4f2d19[_0xaddd('0x21')]==_0x2feac3||_0x4f2d19[_0xaddd('0x22')]==_0x2feac3;});if(_[_0xaddd('0x23')](_0xf39b90)){var _0x591aeb=_[_0xaddd('0x20')](this[_0xaddd('0xf')],function(_0x446005){return _0x446005[_0xaddd('0x21')]==_0x2feac3||_0x446005[_0xaddd('0x22')]==_0x2feac3;});if(_0x591aeb){_0xf39b90=_[_0xaddd('0x20')](this['agents'],function(_0x54b7da){return _0x54b7da[_0xaddd('0x24')]==util['format'](_0xaddd('0x25'),_0x591aeb[_0xaddd('0x22')]);});}}return _0xf39b90;};Report[_0xaddd('0x10')]['voiceQueueReport']=function(_0x3c58d6){for(var _0x36ce66=0x0;_0x36ce66<_0x3c58d6[_0xaddd('0x26')];_0x36ce66+=0x1){var _0x22e2a7=this[_0xaddd('0x1f')](_0x3c58d6[_0x36ce66][_0xaddd('0x27')]);if(_0x22e2a7){_0x3c58d6[_0x36ce66][_0xaddd('0x21')]=_0x22e2a7[_0xaddd('0x21')];_0x3c58d6[_0x36ce66][_0xaddd('0x28')]=!![];_0x3c58d6[_0x36ce66]['lastAssignedTo']=_0x22e2a7[_0xaddd('0x22')];_0x3c58d6[_0x36ce66][_0xaddd('0x24')]=_['isNil'](_0x22e2a7[_0xaddd('0x24')])?util[_0xaddd('0x29')]('SIP/%s',_0x22e2a7[_0xaddd('0x22')]):_0x22e2a7[_0xaddd('0x24')];if(_0x3c58d6[_0x36ce66][_0xaddd('0x2a')]){_0x3c58d6[_0x36ce66][_0xaddd('0x2b')]=moment()[_0xaddd('0x29')](_0xaddd('0x2c'));}if(_0x3c58d6[_0x36ce66]['queuecallerexit']){_0x3c58d6[_0x36ce66][_0xaddd('0x2d')]=moment()['format'](_0xaddd('0x2c'));}RpcMemberReport[_0xaddd('0x14')](_0x3c58d6[_0x36ce66]);}RpcVoiceQueueReport[_0xaddd('0x2e')](_0x3c58d6[_0x36ce66]);}};function extractCalleridNumber(_0x20c304){var _0x3fc845=_0x20c304[_0xaddd('0x2f')](/<(.*?)>/);return _0x3fc845?_0x3fc845[0x1]:_0x20c304;}Report[_0xaddd('0x10')][_0xaddd('0x30')]=function(_0xa5a4c0){for(var _0x3fe582=0x0;_0x3fe582',_0xbd098['calleridname'],_0xbd098[_0xaddd('0x34')]);}if(RpcVoiceTransferReport['transfers'][_0xbd098[_0xaddd('0x44')]]){var _0x4f3803=RpcVoiceTransferReport[_0xaddd('0x45')][_0xbd098[_0xaddd('0x44')]];_0x4f3803[_0xaddd('0x46')]=_0xbd098[_0xaddd('0x47')];RpcVoiceTransferReport[_0xaddd('0x1c')](_0x4f3803);delete RpcVoiceTransferReport['transfers'][_0xbd098[_0xaddd('0x44')]];}if(_[_0xaddd('0x23')](_0xbd098[_0xaddd('0x48')])){_0xbd098[_0xaddd('0x48')]=this[_0xaddd('0x32')](_0xbd098);}if(_[_0xaddd('0x23')](_0xbd098['UserId'])){var _0x502d0c=_0xbd098[_0xaddd('0x3f')][_0xaddd('0x33')]('-')[0x0];var _0x2916f2=this[_0xaddd('0xe')][_0x502d0c];if(!_0x2916f2)_0x2916f2=this['getAgentByInternal'](_0xbd098[_0xaddd('0x21')]);if(_0x2916f2){_0xbd098['UserId']=_0x2916f2['id'];_0xbd098[_0xaddd('0x49')]=_0x2916f2[_0xaddd('0x22')];}}RpcVoiceCallReport['create'](_0xbd098);if(_0xbd098[_0xaddd('0x4a')]){for(var _0x567a69=0x0;_0x567a69<_0xbd098[_0xaddd('0x4b')]['length'];_0x567a69+=0x1){_0xbd098['monitorFilename']=_0xbd098[_0xaddd('0x4b')][_0x567a69][_0xaddd('0x4c')];_0xbd098[_0xaddd('0x4d')]=_0xbd098['monitors'][_0x567a69][_0xaddd('0x4d')];if(_0xbd098[_0xaddd('0x4e')]==_0xaddd('0x4f')){_0xbd098[_0xaddd('0x34')]=_0xbd098[_0xaddd('0x27')];_0xbd098['calleridname']=_0xbd098[_0xaddd('0x50')];_0xbd098[_0xaddd('0x27')]=_0xbd098[_0xaddd('0x21')];_0xbd098['connectedlinename']=_0xbd098[_0xaddd('0x49')];_0xbd098[_0xaddd('0x4e')]=_0xbd098[_0xaddd('0x3e')];}else if(_0xbd098['exten']=='xcally-motion-dialer'){_0xbd098[_0xaddd('0x34')]=_0xbd098[_0xaddd('0x36')];_0xbd098['exten']=_0xbd098[_0xaddd('0x3e')];}RpcVoiceRecording[_0xaddd('0x2e')](_0xbd098);}}};Report[_0xaddd('0x10')][_0xaddd('0x17')]=function(_0x1fe874){if(_[_0xaddd('0x51')](_0x1fe874)){_0x1fe874[_0xaddd('0x52')](function(_0x1b1b2f){RpcVoiceAgentReport[_0xaddd('0x2e')](_0x1b1b2f);});}else{RpcVoiceAgentReport['create'](_0x1fe874);}};Report['prototype'][_0xaddd('0x1a')]=function(_0x3ea0a8){RpcVoiceDialReport[_0xaddd('0x2e')](_0x3ea0a8);var _0x47396e;var _0x287e87;var _0x1c4ac9=_0x3ea0a8[_0xaddd('0x3f')];if(_[_0xaddd('0x53')](_0x1c4ac9,_0xaddd('0x54'))){_0x287e87=_0x1c4ac9[_0xaddd('0x55')](_0x1c4ac9[_0xaddd('0x56')]('/')+0x1,_0x1c4ac9[_0xaddd('0x56')]('@'));_0x47396e=_['find'](this['agents'],function(_0xfa702b){return _0xfa702b['mobile']==_0x287e87||_0xfa702b[_0xaddd('0x57')]==_0x287e87||_0xfa702b[_0xaddd('0x21')]==_0x287e87;});}else{_0x287e87=_0x1c4ac9['substring'](_0x1c4ac9['indexOf']('/')+0x1,_0x1c4ac9['lastIndexOf']('-'));_0x47396e=this['findAgent'](_0x287e87);}if(_0x47396e){_0x3ea0a8['interface']=_[_0xaddd('0x23')](_0x47396e[_0xaddd('0x24')])?util[_0xaddd('0x29')](_0xaddd('0x25'),_0x47396e[_0xaddd('0x22')]):_0x47396e[_0xaddd('0x24')];_0x3ea0a8['membername']=_0x47396e[_0xaddd('0x22')];_0x3ea0a8[_0xaddd('0x21')]=_0x47396e[_0xaddd('0x21')];RpcMemberReport[_0xaddd('0x1a')](_0x3ea0a8);}};Report[_0xaddd('0x10')][_0xaddd('0x1c')]=function(_0x34d531){RpcVoiceTransferReport[_0xaddd('0x45')][_0x34d531[_0xaddd('0x58')]]=_0x34d531;};Report[_0xaddd('0x10')]['attendedTransfer']=function(_0x272a84){RpcVoiceTransferReport[_0xaddd('0x1e')](_0x272a84);};module['exports']=Report; \ No newline at end of file +var _0x948c=['lastdata','context','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','disposition','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','isArray','forEach','startsWith','Local','substring','mobile','phone','lastIndexOf','findAgent','exports','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','accountcode','name','isNil','find','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','create','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','voiceCallReport','destination','exten','type','dialer','lastapplication','queue'];(function(_0x998f66,_0xc237b0){var _0x4c7d95=function(_0x47cb71){while(--_0x47cb71){_0x998f66['push'](_0x998f66['shift']());}};_0x4c7d95(++_0xc237b0);}(_0x948c,0x1e8));var _0xc948=function(_0x2401d2,_0x57caea){_0x2401d2=_0x2401d2-0x0;var _0x17c81f=_0x948c[_0x2401d2];return _0x17c81f;};'use strict';var _=require('lodash');var moment=require(_0xc948('0x0'));var util=require(_0xc948('0x1'));var config=require(_0xc948('0x2'));var ami=require(_0xc948('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xc948('0x4'));var RpcVoiceDialReport=require(_0xc948('0x5'));var RpcMemberReport=require(_0xc948('0x6'));var RpcVoiceQueueReport=require(_0xc948('0x7'));var RpcVoiceRecording=require(_0xc948('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xc948('0x9'));var VoiceCallReport=require(_0xc948('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xc948('0xb'));var UserReport=require('./userReport');function Report(_0x3b2e61){this[_0xc948('0xc')]=_0x3b2e61;this[_0xc948('0xd')]=_0x3b2e61[_0xc948('0xd')];this[_0xc948('0xe')]=_0x3b2e61['telephones'];}Report[_0xc948('0xf')]['sync']=function(_0x4cd632){var _0x1f7f3a=new VoiceQueueReport(this[_0xc948('0xc')]);var _0x568166=new VoiceAgentReport(this[_0xc948('0xc')]);var _0x54ecb5=new VoiceDialReport(this[_0xc948('0xc')]);var _0x3f81aa=new VoiceCallReport(this[_0xc948('0xc')]);var _0x468069=new UserReport(this[_0xc948('0xc')]);if(config[_0xc948('0x10')]&&config[_0xc948('0x10')][_0xc948('0x11')]){ami['on'](_0xc948('0x12'),this[_0xc948('0x13')][_0xc948('0x14')](this));ami['on'](_0xc948('0x15'),this['voiceCallReport'][_0xc948('0x14')](this));ami['on'](_0xc948('0x16'),this[_0xc948('0x17')][_0xc948('0x14')](this));ami['on'](_0xc948('0x18'),this[_0xc948('0x19')][_0xc948('0x14')](this));ami['on']('blindtransfer',this[_0xc948('0x1a')]['bind'](this));ami['on'](_0xc948('0x1b'),this[_0xc948('0x1c')][_0xc948('0x14')](this));}};Report[_0xc948('0xf')]['findAgent']=function(_0x3ce99f){var _0x4619d9;_0x4619d9=_['find'](this['agents'],function(_0x3f5723){return _0x3f5723[_0xc948('0x1d')]==_0x3ce99f||_0x3f5723[_0xc948('0x1e')]==_0x3ce99f;});if(_[_0xc948('0x1f')](_0x4619d9)){var _0xe65b84=_[_0xc948('0x20')](this[_0xc948('0xe')],function(_0xc79e0f){return _0xc79e0f['accountcode']==_0x3ce99f||_0xc79e0f['name']==_0x3ce99f;});if(_0xe65b84){_0x4619d9=_[_0xc948('0x20')](this[_0xc948('0xd')],function(_0x361286){return _0x361286[_0xc948('0x21')]==util[_0xc948('0x22')](_0xc948('0x23'),_0xe65b84[_0xc948('0x1e')]);});}}return _0x4619d9;};Report[_0xc948('0xf')][_0xc948('0x13')]=function(_0x11f175){for(var _0x29aeb8=0x0;_0x29aeb8<_0x11f175[_0xc948('0x24')];_0x29aeb8+=0x1){var _0x34f5bc=this['findAgent'](_0x11f175[_0x29aeb8][_0xc948('0x25')]);if(_0x34f5bc){_0x11f175[_0x29aeb8][_0xc948('0x1d')]=_0x34f5bc[_0xc948('0x1d')];_0x11f175[_0x29aeb8][_0xc948('0x26')]=!![];_0x11f175[_0x29aeb8]['lastAssignedTo']=_0x34f5bc['name'];_0x11f175[_0x29aeb8][_0xc948('0x21')]=_[_0xc948('0x1f')](_0x34f5bc[_0xc948('0x21')])?util[_0xc948('0x22')]('SIP/%s',_0x34f5bc[_0xc948('0x1e')]):_0x34f5bc['interface'];if(_0x11f175[_0x29aeb8][_0xc948('0x27')]){_0x11f175[_0x29aeb8][_0xc948('0x28')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x11f175[_0x29aeb8][_0xc948('0x29')]){_0x11f175[_0x29aeb8][_0xc948('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x11f175[_0x29aeb8]);}RpcVoiceQueueReport[_0xc948('0x2b')](_0x11f175[_0x29aeb8]);}};function extractCalleridNumber(_0x2e73c2){var _0x3d0dd6=_0x2e73c2['match'](/<(.*?)>/);return _0x3d0dd6?_0x3d0dd6[0x1]:_0x2e73c2;}Report['prototype'][_0xc948('0x2c')]=function(_0x252189){for(var _0x45a10b=0x0;_0x45a10b0x0?_0x5247d9:0x0;this[_0xc67a('0xf')][_0x83b4bb[_0xc67a('0x63')]]['talking']=this['voiceQueues'][_0x83b4bb[_0xc67a('0x63')]][_0xc67a('0x28')]>_['toNumber'](_0x83b4bb[_0xc67a('0x6a')])?_[_0xc67a('0x69')](_0x83b4bb[_0xc67a('0x6a')]):this[_0xc67a('0xf')][_0x83b4bb['queue']][_0xc67a('0x28')];this[_0xc67a('0x6b')](this[_0xc67a('0xf')][_0x83b4bb['queue']],'queuesummary');}logger['debug'](_0xc67a('0x6c'),util[_0xc67a('0x35')](this[_0xc67a('0xf')][_0x83b4bb[_0xc67a('0x63')]],{'showHidden':![],'depth':null}));ami[_0xc67a('0x3c')](_0xc67a('0x6d'),this[_0xc67a('0xf')][_0x83b4bb[_0xc67a('0x63')]]);}}}catch(_0x17562e){logger[_0xc67a('0x33')](_0xc67a('0x6e'),util[_0xc67a('0x35')](_0x17562e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc67a('0x8')][_0xc67a('0x15')]=function(_0x1738e0){logger[_0xc67a('0x3e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x1738e0,{'showHidden':![],'depth':null}));this[_0xc67a('0x60')]=!![];};VoiceQueueReport[_0xc67a('0x8')][_0xc67a('0x6f')]=function(_0x2802ee){try{if(this[_0xc67a('0x62')](_0x2802ee)){logger[_0xc67a('0x3e')](_0xc67a('0x70'),_0x2802ee['uniqueid'],util['inspect'](_0x2802ee,{'showHidden':![],'depth':null}));if(_[_0xc67a('0x71')](this['queueReports'][_0x2802ee[_0xc67a('0x40')]]))this['queueReports'][_0x2802ee[_0xc67a('0x40')]]=[];if(_[_0xc67a('0x71')](this[_0xc67a('0x2e')][_0x2802ee[_0xc67a('0x40')]]))this[_0xc67a('0x2e')][_0x2802ee['uniqueid']]={};var _0x328695=new QueueReport();_0x328695['name']=_0x2802ee[_0xc67a('0x63')];_0x328695['type']=this['voiceQueues'][_0x328695[_0xc67a('0x43')]]&&this['voiceQueues'][_0x328695[_0xc67a('0x43')]][_0xc67a('0x49')]?this[_0xc67a('0xf')][_0x328695['name']][_0xc67a('0x49')]||_0xc67a('0x4a'):_0xc67a('0x4a');_0x328695[_0xc67a('0x63')]=_0x2802ee['queue'];_0x328695[_0xc67a('0x72')]=moment()[_0xc67a('0x41')](_0xc67a('0x73'));_0x328695[_0xc67a('0x74')]=_0x2802ee[_0xc67a('0x74')];_0x328695[_0xc67a('0x75')]=_0x2802ee['count'];_0x328695['uniqueid']=_0x2802ee[_0xc67a('0x40')];_0x328695[_0xc67a('0x76')]=this[_0xc67a('0x2e')][_0x2802ee[_0xc67a('0x40')]]['routealias'];logger[_0xc67a('0x65')](_0xc67a('0x77'),_0x328695[_0xc67a('0x43')],_0x328695[_0xc67a('0x49')]);_[_0xc67a('0x78')](_0x328695,_[_0xc67a('0x79')](_0x2802ee,_['keys'](_0x328695)));this[_0xc67a('0xc')][_0x2802ee[_0xc67a('0x40')]]['push'](_0x328695);this[_0xc67a('0x2e')][_0x2802ee['uniqueid']]=_0x328695;this['emitVoiceQueueChannelSave'](_0x328695,'queuecallerjoin');}}catch(_0x4e1b44){logger[_0xc67a('0x33')](_0xc67a('0x70'),_0x2802ee['uniqueid'],util[_0xc67a('0x35')](_0x4e1b44,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc67a('0x8')][_0xc67a('0x7a')]=function(_0x14f575){try{if(this[_0xc67a('0x62')](_0x14f575)){logger[_0xc67a('0x3e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x14f575[_0xc67a('0x40')],util[_0xc67a('0x35')](_0x14f575,{'showHidden':![],'depth':null}));if(this[_0xc67a('0xc')][_0x14f575[_0xc67a('0x40')]]){var _0x1a3d38=_[_0xc67a('0x7b')](this[_0xc67a('0xc')][_0x14f575[_0xc67a('0x40')]]);_0x1a3d38['queuecallercomplete']=![];_0x1a3d38['queuecallercompleteAt']=null;_0x1a3d38['holdtime']=_0x14f575[_0xc67a('0x7c')];_0x1a3d38[_0xc67a('0x7d')]=_0x14f575['originalposition'];_0x1a3d38[_0xc67a('0x17')]=!![];_0x1a3d38[_0xc67a('0x7e')]=moment()[_0xc67a('0x41')](_0xc67a('0x73'));_0x1a3d38[_0xc67a('0x7f')]=_0xc67a('0x80');_0x1a3d38[_0xc67a('0x81')]=null;logger[_0xc67a('0x65')](_0xc67a('0x82'),_0x1a3d38[_0xc67a('0x43')],_0x1a3d38[_0xc67a('0x49')]);this[_0xc67a('0x2e')][_0x14f575[_0xc67a('0x40')]]=_0x1a3d38;this['emitVoiceQueueChannelRemove'](_0x1a3d38,'queuecallerabandon');}}}catch(_0x5d6110){logger[_0xc67a('0x33')](_0xc67a('0x83'),_0x14f575[_0xc67a('0x40')],util[_0xc67a('0x35')](_0x5d6110,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc67a('0x8')][_0xc67a('0x84')]=function(_0x481783){try{if(this[_0xc67a('0x62')](_0x481783)){logger['debug'](_0xc67a('0x85'),_0x481783[_0xc67a('0x40')],util['inspect'](_0x481783,{'showHidden':![],'depth':null}));if(this[_0xc67a('0xc')][_0x481783[_0xc67a('0x40')]]){var _0x222ecb=_['last'](this['queueReports'][_0x481783[_0xc67a('0x40')]]);_0x222ecb['queuecallerleaveAt']=moment()[_0xc67a('0x41')](_0xc67a('0x73'));_0x222ecb[_0xc67a('0x86')]=_0x481783[_0xc67a('0x86')];_0x222ecb[_0xc67a('0x87')]=_0x481783[_0xc67a('0x87')];logger[_0xc67a('0x65')](_0xc67a('0x88'),_0x222ecb[_0xc67a('0x43')],_0x222ecb[_0xc67a('0x49')],_0x481783[_0xc67a('0x86')],_0x481783[_0xc67a('0x87')]);this['channels'][_0x481783[_0xc67a('0x40')]]=_0x222ecb;this[_0xc67a('0x3d')](_0x222ecb,_0xc67a('0x18'));}}}catch(_0x470d1d){logger[_0xc67a('0x33')](_0xc67a('0x85'),_0x481783[_0xc67a('0x40')],util[_0xc67a('0x35')](_0x470d1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x697c17){try{if(this[_0xc67a('0x62')](_0x697c17)){logger[_0xc67a('0x3e')](_0xc67a('0x89'),_0x697c17[_0xc67a('0x40')],util[_0xc67a('0x35')](_0x697c17,{'showHidden':![],'depth':null}));if(this[_0xc67a('0xc')][_0x697c17[_0xc67a('0x40')]]){var _0xfada21=_[_0xc67a('0x7b')](this[_0xc67a('0xc')][_0x697c17[_0xc67a('0x40')]]);_0xfada21[_0xc67a('0x8a')]=!![];_0xfada21[_0xc67a('0x7f')]=_0xc67a('0x8b');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0xfada21[_0xc67a('0x43')],_0xfada21[_0xc67a('0x49')]);}}}catch(_0x2715ce){logger[_0xc67a('0x33')](_0xc67a('0x89'),_0x697c17[_0xc67a('0x40')],util[_0xc67a('0x35')](_0x2715ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc67a('0x8')]['syncAgentComplete']=function(_0x51c607){try{if(this[_0xc67a('0x62')](_0x51c607)){logger[_0xc67a('0x3e')](_0xc67a('0x8c'),_0x51c607[_0xc67a('0x40')],util[_0xc67a('0x35')](_0x51c607,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x51c607[_0xc67a('0x40')]]){var _0x3dca89=_[_0xc67a('0x7b')](this[_0xc67a('0xc')][_0x51c607[_0xc67a('0x40')]]);_0x3dca89[_0xc67a('0x17')]=![];_0x3dca89[_0xc67a('0x7e')]=null;_0x3dca89[_0xc67a('0x8d')]=!![];_0x3dca89[_0xc67a('0x81')]=_0x51c607[_0xc67a('0x8e')];_0x3dca89[_0xc67a('0x7c')]=_0x51c607['holdtime'];_0x3dca89[_0xc67a('0x8a')]=!![];_0x3dca89['queuecallerexit']=![];_0x3dca89['queuecallerexitAt']=null;if(!_0x3dca89[_0xc67a('0x8f')]){if(_0x51c607[_0xc67a('0x90')]==_0xc67a('0x8f')){_0x3dca89[_0xc67a('0x7f')]=_0xc67a('0x91');logger[_0xc67a('0x65')](_0xc67a('0x92'),_0x3dca89['name'],_0x3dca89[_0xc67a('0x49')]);}else{if(_[_0xc67a('0x93')](_0x51c607['channel']['toLowerCase'](),'local/')){if(this['queueReports'][_0x51c607['linkedid']]){var _0x488ef6=_[_0xc67a('0x7b')](this[_0xc67a('0xc')][_0x51c607['linkedid']]);_0x488ef6[_0xc67a('0x8a')]=![];_0x488ef6[_0xc67a('0x94')]=!![];_0x488ef6['queuecallerexitAt']=moment(_0x3dca89[_0xc67a('0x72')])[_0xc67a('0x95')](_0x51c607[_0xc67a('0x7c')],'seconds')['format'](_0xc67a('0x73'));_0x488ef6['queuecallerexitreason']=_0xc67a('0x96');_0x488ef6[_0xc67a('0x8f')]=!![];_0x488ef6['transfertype']=_0xc67a('0x97');_0x488ef6['transferexten']=_0x51c607[_0xc67a('0x98')];_0x488ef6[_0xc67a('0x99')]=_0x51c607[_0xc67a('0x40')];logger[_0xc67a('0x65')](_0xc67a('0x9a'),_0x488ef6[_0xc67a('0x43')],_0x488ef6[_0xc67a('0x49')]);var _0x54129e=this[_0xc67a('0xc')][_0x51c607[_0xc67a('0x9b')]];this['queueReports'][_0x51c607[_0xc67a('0x9b')]]=this['queueReports'][_0x51c607[_0xc67a('0x40')]];this[_0xc67a('0xc')][_0x51c607[_0xc67a('0x40')]]=_0x54129e;}}else{_0x3dca89['queuecallerexitreason']=_0xc67a('0x9c')+_0x51c607[_0xc67a('0x90')]['toUpperCase']();logger[_0xc67a('0x65')](_0xc67a('0x9d'),_0x3dca89[_0xc67a('0x43')],_0x3dca89[_0xc67a('0x49')],_0x3dca89[_0xc67a('0x7f')]);}}}this[_0xc67a('0x2e')][_0x51c607[_0xc67a('0x40')]]=_0x3dca89;this['emitVoiceQueueChannelRemove'](_0x3dca89,_0xc67a('0x19'));}}}catch(_0x49bb37){logger[_0xc67a('0x33')](_0xc67a('0x8c'),_0x51c607['uniqueid'],util[_0xc67a('0x35')](_0x49bb37,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc67a('0x9e')]=function(_0x39d405){try{if(this['isNotNull'](_0x39d405)){logger[_0xc67a('0x3e')](_0xc67a('0x9f'),_0x39d405[_0xc67a('0x40')],util['inspect'](_0x39d405,{'showHidden':![],'depth':null}));this[_0xc67a('0xa0')](_0x39d405['uniqueid'],_['keys'](_0x39d405[_0xc67a('0xa1')])[0x0],_0x39d405[_0xc67a('0xa2')]);if(this[_0xc67a('0xc')][_0x39d405['uniqueid']]){var _0xa53614=_[_0xc67a('0x7b')](this[_0xc67a('0xc')][_0x39d405[_0xc67a('0x40')]]);if(_0xa53614){if(this[_0xc67a('0x62')](_0x39d405[_0xc67a('0xa1')])&&this['isNotNull'](_0x39d405['variable']['queuestatus'])){switch(_0x39d405[_0xc67a('0xa2')]){case _0xc67a('0xa3'):_0xa53614[_0xc67a('0x94')]=![];_0xa53614[_0xc67a('0xa4')]=null;break;case _0xc67a('0xa5'):_0xa53614['lastevent']=_0xc67a('0xa6');_0xa53614['queuecallerexit']=!![];_0xa53614[_0xc67a('0xa4')]=moment()[_0xc67a('0x41')](_0xc67a('0x73'));_0xa53614['queuecallerleaveAt']=moment()[_0xc67a('0x41')](_0xc67a('0x73'));logger[_0xc67a('0x3e')](_0xc67a('0xa7'),_0x39d405[_0xc67a('0x40')],util[_0xc67a('0x35')](_0xa53614,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0xa53614);break;default:_0xa53614[_0xc67a('0x94')]=!![];_0xa53614[_0xc67a('0xa4')]=moment()[_0xc67a('0x41')](_0xc67a('0x73'));_0xa53614[_0xc67a('0xa8')]=moment()[_0xc67a('0x41')](_0xc67a('0x73'));}_0xa53614[_0xc67a('0x17')]=![];_0xa53614['queuecallerabandonAt']=null;_0xa53614[_0xc67a('0x7f')]=_0x39d405[_0xc67a('0xa2')];this['channels'][_0x39d405[_0xc67a('0x40')]]=_0xa53614;this[_0xc67a('0x46')](_0xa53614,_0xc67a('0xa9'));}else if(this['isNotNull'](_0x39d405['variable'])&&this[_0xc67a('0x62')](_0x39d405[_0xc67a('0xa1')][_0xc67a('0xaa')])){if(!_0xa53614['queuecallerabandon']){_0xa53614[_0xc67a('0x94')]=!![];_0xa53614[_0xc67a('0xa4')]=moment()['format'](_0xc67a('0x73'));_0xa53614[_0xc67a('0x7f')]=_0xc67a('0xab');_0xa53614[_0xc67a('0xa8')]=moment()[_0xc67a('0x41')](_0xc67a('0x73'));this[_0xc67a('0x2e')][_0x39d405[_0xc67a('0x40')]]=_0xa53614;}}logger[_0xc67a('0x65')](_0xc67a('0xac'),_0x39d405[_0xc67a('0x40')],_0xa53614[_0xc67a('0x43')],_0xa53614['type'],_[_0xc67a('0xad')](_0x39d405[_0xc67a('0xa1')])[0x0],_0x39d405[_0xc67a('0xa2')]);_0xa53614[_0xc67a('0x37')]=this['variables'][_0x39d405[_0xc67a('0x40')]];}}}}catch(_0x5c97f6){logger[_0xc67a('0x33')]('[%s][voiceQueueReport][varset]',_0x39d405[_0xc67a('0x40')],util['inspect'](_0x5c97f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc67a('0x8')][_0xc67a('0xa0')]=function(_0x30ad5e,_0x260bbb,_0x23cd39){var _0x3b6329=[_0xc67a('0xae'),_0xc67a('0xaf'),_0xc67a('0xb0'),_0xc67a('0xb1'),_0xc67a('0xb2'),_0xc67a('0xb3'),_0xc67a('0xb4'),_0xc67a('0xb5'),_0xc67a('0xb6'),_0xc67a('0xb7'),_0xc67a('0xb8'),_0xc67a('0xb9'),'membercalls','memberdynamic',_0xc67a('0xba'),'memberlastcall',_0xc67a('0x8e'),_0xc67a('0xbb'),_0xc67a('0xbc')];if(!_['isNil'](_0x260bbb)&&!_[_0xc67a('0xbd')](_0x3b6329,_0x260bbb)){if(_[_0xc67a('0x71')](this[_0xc67a('0x37')][_0x30ad5e])){this['variables'][_0x30ad5e]={};}this[_0xc67a('0x37')][_0x30ad5e][_0x260bbb]=_0x23cd39;}};VoiceQueueReport[_0xc67a('0x8')]['syncHangup']=function(_0x471e12){try{if(this[_0xc67a('0x62')](_0x471e12)){logger[_0xc67a('0x3e')](_0xc67a('0xbe'),_0x471e12[_0xc67a('0x40')],util['inspect'](_0x471e12,{'showHidden':![],'depth':null}));if(this[_0xc67a('0xc')][_0x471e12['uniqueid']]){for(var _0x403e6a=0x0,_0x250c35={};_0x403e6a0x0?_0x44fb7f:0x0;this[_0xaca8('0x3c')][_0x39be05[_0xaca8('0x5f')]][_0xaca8('0x4f')]=this[_0xaca8('0x3c')][_0x39be05[_0xaca8('0x5f')]][_0xaca8('0x4f')]>_[_0xaca8('0x62')](_0x39be05[_0xaca8('0x64')])?_[_0xaca8('0x62')](_0x39be05['loggedin']):this[_0xaca8('0x3c')][_0x39be05[_0xaca8('0x5f')]]['talking'];this[_0xaca8('0x48')](this['voiceQueues'][_0x39be05[_0xaca8('0x5f')]],'queuesummary');}logger['debug'](_0xaca8('0x65'),util[_0xaca8('0x39')](this['voiceQueues'][_0x39be05[_0xaca8('0x5f')]],{'showHidden':![],'depth':null}));ami[_0xaca8('0x3e')](_0xaca8('0x66'),this[_0xaca8('0x3c')][_0x39be05['queue']]);}}}catch(_0x520144){logger['error'](_0xaca8('0x5e'),util['inspect'](_0x520144,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaca8('0x30')][_0xaca8('0x67')]=function(_0x239383){logger[_0xaca8('0x57')](_0xaca8('0x68'),util['inspect'](_0x239383,{'showHidden':![],'depth':null}));this[_0xaca8('0xe')]=!![];};VoiceQueueReport[_0xaca8('0x30')]['syncQueueCallerJoin']=function(_0x238aae){try{if(this[_0xaca8('0x5a')](_0x238aae)){logger[_0xaca8('0x57')](_0xaca8('0x69'),_0x238aae['uniqueid'],util['inspect'](_0x238aae,{'showHidden':![],'depth':null}));if(_[_0xaca8('0x5b')](this[_0xaca8('0xa')][_0x238aae[_0xaca8('0x41')]]))this[_0xaca8('0xa')][_0x238aae[_0xaca8('0x41')]]=[];if(_['isUndefined'](this[_0xaca8('0xc')][_0x238aae[_0xaca8('0x41')]]))this['channels'][_0x238aae['uniqueid']]={};var _0x5b1998=new QueueReport();_0x5b1998[_0xaca8('0x44')]=_0x238aae[_0xaca8('0x5f')];_0x5b1998[_0xaca8('0x49')]=this[_0xaca8('0x3c')][_0x5b1998[_0xaca8('0x44')]]&&this[_0xaca8('0x3c')][_0x5b1998[_0xaca8('0x44')]][_0xaca8('0x49')]?this[_0xaca8('0x3c')][_0x5b1998[_0xaca8('0x44')]][_0xaca8('0x49')]||_0xaca8('0x6a'):'inbound';_0x5b1998[_0xaca8('0x5f')]=_0x238aae[_0xaca8('0x5f')];_0x5b1998[_0xaca8('0x6b')]=moment()[_0xaca8('0x42')](_0xaca8('0x6c'));_0x5b1998[_0xaca8('0x6d')]=_0x238aae[_0xaca8('0x6d')];_0x5b1998['count']=_0x238aae[_0xaca8('0x6e')];_0x5b1998[_0xaca8('0x41')]=_0x238aae[_0xaca8('0x41')];_0x5b1998[_0xaca8('0x6f')]=this['channels'][_0x238aae['uniqueid']][_0xaca8('0x6f')];logger['info'](_0xaca8('0x70'),_0x5b1998[_0xaca8('0x44')],_0x5b1998[_0xaca8('0x49')]);_[_0xaca8('0x71')](_0x5b1998,_[_0xaca8('0x72')](_0x238aae,_[_0xaca8('0x73')](_0x5b1998)));this[_0xaca8('0xa')][_0x238aae[_0xaca8('0x41')]][_0xaca8('0x74')](_0x5b1998);this[_0xaca8('0xc')][_0x238aae[_0xaca8('0x41')]]=_0x5b1998;this[_0xaca8('0x3f')](_0x5b1998,'queuecallerjoin');}}catch(_0x30a9b9){logger[_0xaca8('0x37')]('[%s][voiceQueueReport][queuecallerjoin]',_0x238aae[_0xaca8('0x41')],util[_0xaca8('0x39')](_0x30a9b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaca8('0x30')][_0xaca8('0x75')]=function(_0x4f5e51){try{if(this[_0xaca8('0x5a')](_0x4f5e51)){logger[_0xaca8('0x57')](_0xaca8('0x76'),_0x4f5e51[_0xaca8('0x41')],util[_0xaca8('0x39')](_0x4f5e51,{'showHidden':![],'depth':null}));if(this[_0xaca8('0xa')][_0x4f5e51[_0xaca8('0x41')]]){var _0x5e2bed=_['last'](this['queueReports'][_0x4f5e51[_0xaca8('0x41')]]);_0x5e2bed[_0xaca8('0x77')]=![];_0x5e2bed[_0xaca8('0x78')]=null;_0x5e2bed[_0xaca8('0x79')]=_0x4f5e51[_0xaca8('0x79')];_0x5e2bed[_0xaca8('0x7a')]=_0x4f5e51['originalposition'];_0x5e2bed[_0xaca8('0x16')]=!![];_0x5e2bed['queuecallerabandonAt']=moment()[_0xaca8('0x42')](_0xaca8('0x6c'));_0x5e2bed[_0xaca8('0x7b')]=_0xaca8('0x7c');_0x5e2bed[_0xaca8('0x7d')]=null;logger[_0xaca8('0x61')](_0xaca8('0x7e'),_0x5e2bed[_0xaca8('0x44')],_0x5e2bed[_0xaca8('0x49')]);this[_0xaca8('0xc')][_0x4f5e51[_0xaca8('0x41')]]=_0x5e2bed;this[_0xaca8('0x3d')](_0x5e2bed,_0xaca8('0x16'));}}}catch(_0x28281b){logger[_0xaca8('0x37')](_0xaca8('0x76'),_0x4f5e51[_0xaca8('0x41')],util['inspect'](_0x28281b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaca8('0x18')]=function(_0x2a8449){try{if(this[_0xaca8('0x5a')](_0x2a8449)){logger[_0xaca8('0x57')]('[%s][voiceQueueReport][queuecallerleave]',_0x2a8449['uniqueid'],util[_0xaca8('0x39')](_0x2a8449,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2a8449[_0xaca8('0x41')]]){var _0x3cca6c=_[_0xaca8('0x7f')](this['queueReports'][_0x2a8449[_0xaca8('0x41')]]);_0x3cca6c[_0xaca8('0x80')]=moment()[_0xaca8('0x42')](_0xaca8('0x6c'));_0x3cca6c['connectedlinenum']=_0x2a8449['connectedlinenum'];_0x3cca6c['connectedlinename']=_0x2a8449[_0xaca8('0x81')];logger[_0xaca8('0x61')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3cca6c['name'],_0x3cca6c[_0xaca8('0x49')],_0x2a8449[_0xaca8('0x82')],_0x2a8449[_0xaca8('0x81')]);this[_0xaca8('0xc')][_0x2a8449[_0xaca8('0x41')]]=_0x3cca6c;this[_0xaca8('0x3f')](_0x3cca6c,_0xaca8('0x17'));}}}catch(_0x13470d){logger['error'](_0xaca8('0x83'),_0x2a8449[_0xaca8('0x41')],util[_0xaca8('0x39')](_0x13470d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaca8('0x30')]['syncAgentConnect']=function(_0x317a24){try{if(this[_0xaca8('0x5a')](_0x317a24)){logger[_0xaca8('0x57')](_0xaca8('0x84'),_0x317a24['uniqueid'],util[_0xaca8('0x39')](_0x317a24,{'showHidden':![],'depth':null}));if(this[_0xaca8('0xa')][_0x317a24['uniqueid']]){var _0x510a91=_[_0xaca8('0x7f')](this[_0xaca8('0xa')][_0x317a24['uniqueid']]);_0x510a91[_0xaca8('0x77')]=!![];_0x510a91['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xaca8('0x61')](_0xaca8('0x85'),_0x510a91[_0xaca8('0x44')],_0x510a91[_0xaca8('0x49')]);}}}catch(_0x55b265){logger[_0xaca8('0x37')]('[%s][voiceQueueReport][agentconnect]',_0x317a24[_0xaca8('0x41')],util[_0xaca8('0x39')](_0x55b265,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaca8('0x1a')]=function(_0x1c7df0){try{if(this[_0xaca8('0x5a')](_0x1c7df0)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x1c7df0[_0xaca8('0x41')],util[_0xaca8('0x39')](_0x1c7df0,{'showHidden':![],'depth':null}));if(this[_0xaca8('0xa')][_0x1c7df0[_0xaca8('0x41')]]){var _0x59119a=_[_0xaca8('0x7f')](this['queueReports'][_0x1c7df0[_0xaca8('0x41')]]);_0x59119a[_0xaca8('0x16')]=![];_0x59119a[_0xaca8('0x86')]=null;_0x59119a[_0xaca8('0x87')]=!![];_0x59119a['lastAssignedTo']=_0x1c7df0[_0xaca8('0x88')];_0x59119a[_0xaca8('0x79')]=_0x1c7df0['holdtime'];_0x59119a[_0xaca8('0x77')]=!![];_0x59119a[_0xaca8('0x89')]=![];_0x59119a['queuecallerexitAt']=null;if(!_0x59119a[_0xaca8('0x8a')]){if(_0x1c7df0[_0xaca8('0x8b')]=='transfer'){_0x59119a[_0xaca8('0x7b')]='COMPLETED';logger[_0xaca8('0x61')](_0xaca8('0x8c'),_0x59119a['name'],_0x59119a['type']);}else{if(_[_0xaca8('0x8d')](_0x1c7df0[_0xaca8('0x8e')]['toLowerCase'](),'local/')){if(this[_0xaca8('0xa')][_0x1c7df0['linkedid']]){var _0x33c03d=_[_0xaca8('0x7f')](this[_0xaca8('0xa')][_0x1c7df0['linkedid']]);_0x33c03d[_0xaca8('0x77')]=![];_0x33c03d['queuecallerexit']=!![];_0x33c03d[_0xaca8('0x8f')]=moment(_0x59119a['queuecallerjoinAt'])[_0xaca8('0x90')](_0x1c7df0['holdtime'],_0xaca8('0x91'))[_0xaca8('0x42')](_0xaca8('0x6c'));_0x33c03d['queuecallerexitreason']=_0xaca8('0x92');_0x33c03d['transfer']=!![];_0x33c03d[_0xaca8('0x93')]=_0xaca8('0x94');_0x33c03d[_0xaca8('0x95')]=_0x1c7df0['destexten'];_0x33c03d[_0xaca8('0x96')]=_0x1c7df0[_0xaca8('0x41')];logger[_0xaca8('0x61')](_0xaca8('0x97'),_0x33c03d['name'],_0x33c03d['type']);var _0x111d66=this['queueReports'][_0x1c7df0[_0xaca8('0x98')]];this['queueReports'][_0x1c7df0[_0xaca8('0x98')]]=this[_0xaca8('0xa')][_0x1c7df0[_0xaca8('0x41')]];this[_0xaca8('0xa')][_0x1c7df0[_0xaca8('0x41')]]=_0x111d66;}}else{_0x59119a['queuecallerexitreason']=_0xaca8('0x99')+_0x1c7df0[_0xaca8('0x8b')]['toUpperCase']();logger[_0xaca8('0x61')](_0xaca8('0x9a'),_0x59119a[_0xaca8('0x44')],_0x59119a[_0xaca8('0x49')],_0x59119a[_0xaca8('0x7b')]);}}}this[_0xaca8('0xc')][_0x1c7df0['uniqueid']]=_0x59119a;this[_0xaca8('0x3d')](_0x59119a,_0xaca8('0x19'));}}}catch(_0xca92f1){logger[_0xaca8('0x37')](_0xaca8('0x9b'),_0x1c7df0[_0xaca8('0x41')],util[_0xaca8('0x39')](_0xca92f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaca8('0x9c')]=function(_0x45cacd){try{if(this[_0xaca8('0x5a')](_0x45cacd)){logger['debug'](_0xaca8('0x9d'),_0x45cacd[_0xaca8('0x41')],util[_0xaca8('0x39')](_0x45cacd,{'showHidden':![],'depth':null}));this['addVariable'](_0x45cacd[_0xaca8('0x41')],_[_0xaca8('0x73')](_0x45cacd[_0xaca8('0x9e')])[0x0],_0x45cacd[_0xaca8('0x9f')]);if(this[_0xaca8('0xa')][_0x45cacd[_0xaca8('0x41')]]){var _0x499676=_['last'](this[_0xaca8('0xa')][_0x45cacd[_0xaca8('0x41')]]);if(_0x499676){if(this[_0xaca8('0x5a')](_0x45cacd[_0xaca8('0x9e')])&&this[_0xaca8('0x5a')](_0x45cacd[_0xaca8('0x9e')][_0xaca8('0xa0')])){switch(_0x45cacd[_0xaca8('0x9f')]){case _0xaca8('0xa1'):_0x499676[_0xaca8('0x89')]=![];_0x499676['queuecallerexitAt']=null;break;case _0xaca8('0xa2'):_0x499676[_0xaca8('0xa3')]='timeout';_0x499676[_0xaca8('0x89')]=!![];_0x499676['queuecallerexitAt']=moment()[_0xaca8('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x499676['queuecallerleaveAt']=moment()['format'](_0xaca8('0x6c'));logger[_0xaca8('0x57')](_0xaca8('0xa4'),_0x45cacd[_0xaca8('0x41')],util['inspect'](_0x499676,{'showHidden':![],'depth':null}));ami[_0xaca8('0x3e')](_0xaca8('0xa5'),_0x499676);break;default:_0x499676['queuecallerexit']=!![];_0x499676[_0xaca8('0x8f')]=moment()[_0xaca8('0x42')](_0xaca8('0x6c'));_0x499676[_0xaca8('0x80')]=moment()['format'](_0xaca8('0x6c'));}_0x499676[_0xaca8('0x16')]=![];_0x499676['queuecallerabandonAt']=null;_0x499676['queuecallerexitreason']=_0x45cacd[_0xaca8('0x9f')];this['channels'][_0x45cacd[_0xaca8('0x41')]]=_0x499676;this[_0xaca8('0x3d')](_0x499676,_0xaca8('0x1d'));}else if(this[_0xaca8('0x5a')](_0x45cacd[_0xaca8('0x9e')])&&this[_0xaca8('0x5a')](_0x45cacd[_0xaca8('0x9e')]['queueposition'])){if(!_0x499676['queuecallerabandon']){_0x499676[_0xaca8('0x89')]=!![];_0x499676[_0xaca8('0x8f')]=moment()[_0xaca8('0x42')](_0xaca8('0x6c'));_0x499676[_0xaca8('0x7b')]=_0xaca8('0xa6');_0x499676[_0xaca8('0x80')]=moment()[_0xaca8('0x42')](_0xaca8('0x6c'));this[_0xaca8('0xc')][_0x45cacd[_0xaca8('0x41')]]=_0x499676;}}logger[_0xaca8('0x61')](_0xaca8('0xa7'),_0x45cacd['uniqueid'],_0x499676[_0xaca8('0x44')],_0x499676[_0xaca8('0x49')],_[_0xaca8('0x73')](_0x45cacd[_0xaca8('0x9e')])[0x0],_0x45cacd[_0xaca8('0x9f')]);_0x499676[_0xaca8('0x10')]=this['variables'][_0x45cacd[_0xaca8('0x41')]];}}}}catch(_0x507a97){logger[_0xaca8('0x37')](_0xaca8('0x9d'),_0x45cacd[_0xaca8('0x41')],util['inspect'](_0x507a97,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaca8('0x30')][_0xaca8('0xa8')]=function(_0x52caf7,_0x3e4a29,_0x10ed8){var _0x23ee9e=['rtpaudioqos',_0xaca8('0xa9'),'rtpaudioqosjitter',_0xaca8('0xaa'),_0xaca8('0xab'),_0xaca8('0xac'),_0xaca8('0xad'),_0xaca8('0xae'),_0xaca8('0xaf'),_0xaca8('0xb0'),_0xaca8('0xb1'),_0xaca8('0xb2'),'membercalls',_0xaca8('0xb3'),_0xaca8('0xb4'),_0xaca8('0xb5'),_0xaca8('0x88'),_0xaca8('0xb6'),_0xaca8('0xb7')];if(!_['isNil'](_0x3e4a29)&&!_[_0xaca8('0xb8')](_0x23ee9e,_0x3e4a29)){if(_[_0xaca8('0x5b')](this['variables'][_0x52caf7])){this['variables'][_0x52caf7]={};}this[_0xaca8('0x10')][_0x52caf7][_0x3e4a29]=_0x10ed8;}};VoiceQueueReport[_0xaca8('0x30')]['syncHangup']=function(_0x4a1f76){try{if(this[_0xaca8('0x5a')](_0x4a1f76)){logger[_0xaca8('0x57')](_0xaca8('0xb9'),_0x4a1f76['uniqueid'],util[_0xaca8('0x39')](_0x4a1f76,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4a1f76[_0xaca8('0x41')]]){for(var _0x214c88=0x0,_0x544215={};_0x214c88=0x0?moment(_0x251830[_0x2def('0x16')])[_0x2def('0xc')](_0x251830['starttime'],_0x2def('0xd')):null,'data1':'outbound','data2':_0x251830[_0x2def('0x12')],'data3':_0x251830[_0x2def('0x10')],'data4':_0x251830[_0x2def('0x17')]||null,'role':_0x2def('0x11'),'internal':_0x251830[_0x2def('0x12')]?_[_0x2def('0x18')](_0x251830[_0x2def('0x12')]):undefined,'uniqueid':_0x251830[_0x2def('0x13')]},'log':_0x2def('0x5')});}; \ No newline at end of file +var _0x5bdc=['membername','starttime','endtime','outbound','dialstring','moment','util','../client','queuecallerexitAt','Request','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','voice'];(function(_0x5a6b47,_0x4c6c74){var _0x219fa4=function(_0x1d6a1a){while(--_0x1d6a1a){_0x5a6b47['push'](_0x5a6b47['shift']());}};_0x219fa4(++_0x4c6c74);}(_0x5bdc,0x1a9));var _0xc5bd=function(_0x1a5ffe,_0x14caa7){_0x1a5ffe=_0x1a5ffe-0x0;var _0x5e6d65=_0x5bdc[_0x1a5ffe];return _0x5e6d65;};'use strict';var moment=require(_0xc5bd('0x0'));var _=require('lodash');var util=require(_0xc5bd('0x1'));var client=require(_0xc5bd('0x2'));exports['voiceQueueReport']=function(_0x3ccafc){var _0x573339=_0x3ccafc['queuecallercompleteAt']||_0x3ccafc[_0xc5bd('0x3')];return client[_0xc5bd('0x4')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3ccafc[_0xc5bd('0x5')],'interface':_[_0xc5bd('0x6')](_0x3ccafc[_0xc5bd('0x7')])?util['format'](_0xc5bd('0x8'),_0x3ccafc[_0xc5bd('0x5')]):_0x3ccafc['interface'],'type':_0xc5bd('0x9'),'enterAt':_0x3ccafc[_0xc5bd('0xa')],'exitAt':_0x573339,'duration':moment(_0x573339)[_0xc5bd('0xb')](_0x3ccafc[_0xc5bd('0xa')],_0xc5bd('0xc')),'data1':_0xc5bd('0xd'),'data2':_0x3ccafc[_0xc5bd('0xe')],'data3':_0x3ccafc[_0xc5bd('0xf')],'data4':null,'data5':_0x3ccafc['queue'],'role':_0xc5bd('0x10'),'internal':_0x3ccafc[_0xc5bd('0x11')]?_[_0xc5bd('0x12')](_0x3ccafc[_0xc5bd('0x11')]):undefined,'uniqueid':_0x3ccafc[_0xc5bd('0x13')]},'log':_0xc5bd('0x14')});};exports[_0xc5bd('0x15')]=function(_0x5b16ca){return client[_0xc5bd('0x4')](_0xc5bd('0x14'),{'body':{'channel':_0xc5bd('0x16'),'membername':_0x5b16ca[_0xc5bd('0x17')],'interface':_0x5b16ca[_0xc5bd('0x7')],'type':_0xc5bd('0x9'),'enterAt':_0x5b16ca[_0xc5bd('0x18')],'exitAt':_0x5b16ca[_0xc5bd('0x19')],'duration':moment(_0x5b16ca['endtime'])[_0xc5bd('0xb')](_0x5b16ca[_0xc5bd('0x18')],_0xc5bd('0xc'))>=0x0?moment(_0x5b16ca[_0xc5bd('0x19')])[_0xc5bd('0xb')](_0x5b16ca[_0xc5bd('0x18')],_0xc5bd('0xc')):null,'data1':_0xc5bd('0x1a'),'data2':_0x5b16ca[_0xc5bd('0x11')],'data3':_0x5b16ca['exten'],'data4':_0x5b16ca[_0xc5bd('0x1b')]||null,'role':_0xc5bd('0x10'),'internal':_0x5b16ca[_0xc5bd('0x11')]?_[_0xc5bd('0x12')](_0x5b16ca[_0xc5bd('0x11')]):undefined,'uniqueid':_0x5b16ca['uniqueid']},'log':_0xc5bd('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index fdec88e..555d7c0 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 _0x8278=['Request','ShowSetting','../client','getSettings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8827('0x0'));exports[_0x8827('0x1')]=function(){return client[_0x8827('0x2')](_0x8827('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file +var _0xe28e=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x46eed4,_0x23d556){var _0x1a6d1b=function(_0x19a25a){while(--_0x19a25a){_0x46eed4['push'](_0x46eed4['shift']());}};_0x1a6d1b(++_0x23d556);}(_0xe28e,0x1ba));var _0xee28=function(_0x5c259d,_0x1bac2c){_0x5c259d=_0x5c259d-0x0;var _0x9ce812=_0xe28e[_0x5c259d];return _0x9ce812;};'use strict';var client=require(_0xee28('0x0'));exports[_0xee28('0x1')]=function(){return client[_0xee28('0x2')](_0xee28('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xee28('0x4')]},'log':_0xee28('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3d24eda..f32d7c3 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 _0x0c55=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x51e897,_0x3d9a7e){var _0x54a1b8=function(_0x32089d){while(--_0x32089d){_0x51e897['push'](_0x51e897['shift']());}};_0x54a1b8(++_0x3d9a7e);}(_0x0c55,0xd0));var _0x50c5=function(_0x568d15,_0x49772a){_0x568d15=_0x568d15-0x0;var _0x4c178c=_0x0c55[_0x568d15];return _0x4c178c;};'use strict';var client=require(_0x50c5('0x0'));exports[_0x50c5('0x1')]=function(_0x2ca271){return function(_0x5aa6e0){return client[_0x50c5('0x2')](_0x50c5('0x3'),{'options':{'raw':!![],'attributes':['id',_0x50c5('0x4'),_0x50c5('0x5')]},'log':_0x50c5('0x3')});};}; \ No newline at end of file +var _0xf793=['GetTemplate','name','html','getTemplates','Request'];(function(_0x23e33d,_0x31c8c8){var _0x818fc=function(_0x19f33e){while(--_0x19f33e){_0x23e33d['push'](_0x23e33d['shift']());}};_0x818fc(++_0x31c8c8);}(_0xf793,0x1ac));var _0x3f79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf793[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x3f79('0x0')]=function(_0x54148c){return function(_0x5075af){return client[_0x3f79('0x1')](_0x3f79('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3f79('0x3'),_0x3f79('0x4')]},'log':_0x3f79('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8712ea7..de60683 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 _0x8380=['AllConditions','field','operator','AnyConditions','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x8380,0x1dd));var _0x0838=function(_0x20ed43,_0x18959a){_0x20ed43=_0x20ed43-0x0;var _0x29ebf8=_0x8380[_0x20ed43];return _0x29ebf8;};'use strict';var client=require(_0x0838('0x0'));exports[_0x0838('0x1')]=function(_0x1c8681){return function(_0x5bf731){return client['Request'](_0x0838('0x2'),{'options':{'raw':![],'attributes':['id',_0x0838('0x3'),_0x0838('0x4'),_0x0838('0x5')],'include':[{'model':_0x0838('0x6'),'as':_0x0838('0x7'),'attributes':['id',_0x0838('0x8'),_0x0838('0x9'),'value']},{'model':'Condition','as':_0x0838('0xa'),'attributes':['id','field',_0x0838('0x9'),_0x0838('0xb')]},{'model':_0x0838('0xc'),'as':_0x0838('0xd'),'attributes':['id',_0x0838('0xe'),_0x0838('0xf'),_0x0838('0x10'),_0x0838('0x11'),_0x0838('0x12'),_0x0838('0x13'),_0x0838('0x14'),_0x0838('0x15')]}]},'log':_0x0838('0x2')});};}; \ No newline at end of file +var _0xc441=['getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data3','data4','data5','data6','data7'];(function(_0x2a87fc,_0x30a039){var _0x32d9f5=function(_0x2e157c){while(--_0x2e157c){_0x2a87fc['push'](_0x2a87fc['shift']());}};_0x32d9f5(++_0x30a039);}(_0xc441,0x1cc));var _0x1c44=function(_0x2ed5b9,_0x53c07c){_0x2ed5b9=_0x2ed5b9-0x0;var _0x5967ec=_0xc441[_0x2ed5b9];return _0x5967ec;};'use strict';var client=require('../client');exports[_0x1c44('0x0')]=function(_0x330376){return function(_0x39259f){return client['Request'](_0x1c44('0x1'),{'options':{'raw':![],'attributes':['id',_0x1c44('0x2'),_0x1c44('0x3'),_0x1c44('0x4')],'include':[{'model':_0x1c44('0x5'),'as':_0x1c44('0x6'),'attributes':['id',_0x1c44('0x7'),_0x1c44('0x8'),_0x1c44('0x9')]},{'model':_0x1c44('0x5'),'as':_0x1c44('0xa'),'attributes':['id',_0x1c44('0x7'),'operator',_0x1c44('0x9')]},{'model':_0x1c44('0xb'),'as':_0x1c44('0xc'),'attributes':['id',_0x1c44('0xd'),_0x1c44('0xe'),'data2',_0x1c44('0xf'),_0x1c44('0x10'),_0x1c44('0x11'),_0x1c44('0x12'),_0x1c44('0x13')]}]},'log':_0x1c44('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 0fd5c81..1f05481 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 _0x0e82=['defaultuser','../client','getTrunks','Request','name','registry'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0e82,0x1e7));var _0x20e8=function(_0x297e9a,_0x557435){_0x297e9a=_0x297e9a-0x0;var _0x295ecf=_0x0e82[_0x297e9a];return _0x295ecf;};'use strict';var client=require(_0x20e8('0x0'));exports[_0x20e8('0x1')]=function(_0x9c2fac){return function(_0xa0a4d6){return client[_0x20e8('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x20e8('0x3'),_0x20e8('0x4'),_0x20e8('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xcbcc=['../client','Request','name','registry','defaultuser','GetTrunk'];(function(_0x17824a,_0x21994f){var _0x2618aa=function(_0x132e99){while(--_0x132e99){_0x17824a['push'](_0x17824a['shift']());}};_0x2618aa(++_0x21994f);}(_0xcbcc,0x198));var _0xccbc=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xcbcc[_0x2aec52];return _0x3b8835;};'use strict';var client=require(_0xccbc('0x0'));exports['getTrunks']=function(_0x57770f){return function(_0x362ea2){return client[_0xccbc('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xccbc('0x2'),_0xccbc('0x3'),_0xccbc('0x4')]},'log':_0xccbc('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d3cec34..0a1bb51 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x313b5e,_0x41f8aa){var _0x181483=function(_0x13f928){while(--_0x13f928){_0x313b5e['push'](_0x313b5e['shift']());}};_0x181483(++_0x41f8aa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0xcb91[_0x30cd7e];return _0x462a02;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x56c0b5,_0x580ee0){var _0x586ee4=function(_0x57d44b){while(--_0x57d44b){_0x56c0b5['push'](_0x56c0b5['shift']());}};_0x586ee4(++_0x580ee0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c74d793..2db1624 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 _0x6b05=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b05,0x6f));var _0x56b0=function(_0x4c56ed,_0x3397ce){_0x4c56ed=_0x4c56ed-0x0;var _0x393bd9=_0x6b05[_0x4c56ed];return _0x393bd9;};'use strict';var client=require('../client');exports[_0x56b0('0x0')]=function(_0x5c44c7){return client['Request']('CreateVoiceAgentReport',{'body':_0x5c44c7,'log':_0x56b0('0x1')});};exports[_0x56b0('0x2')]=function(_0x52a318,_0x2d4514,_0x9aeff){return client[_0x56b0('0x3')](_0x56b0('0x4'),{'body':_0x52a318,'options':{'where':{'uniqueid':_0x2d4514,'interface':_0x9aeff,'agentcomplete':!![]}},'log':_0x56b0('0x4')});}; \ No newline at end of file +var _0xf038=['update','UpdateVoiceAgentReport','Request','CreateVoiceAgentReport'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0xf038,0x19e));var _0x8f03=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0xf038[_0x1b4c04];return _0x374f5d;};'use strict';var client=require('../client');exports['create']=function(_0x2e32e2){return client[_0x8f03('0x0')]('CreateVoiceAgentReport',{'body':_0x2e32e2,'log':_0x8f03('0x1')});};exports[_0x8f03('0x2')]=function(_0x4d9e58,_0x1b2daa,_0x1b6dbf){return client[_0x8f03('0x0')](_0x8f03('0x3'),{'body':_0x4d9e58,'options':{'where':{'uniqueid':_0x1b2daa,'interface':_0x1b6dbf,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5205b9a..b81da78 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 _0x6323=['context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','billableseconds','moment','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x6323,0xf6));var _0x3632=function(_0x2aab9f,_0x187ed3){_0x2aab9f=_0x2aab9f-0x0;var _0x556333=_0x6323[_0x2aab9f];return _0x556333;};'use strict';var moment=require(_0x3632('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x3632('0x1'));exports[_0x3632('0x2')]=function(_0x3b92d5){return client[_0x3632('0x3')](_0x3632('0x4'),{'body':_[_0x3632('0x5')](_0x3b92d5,{'source':_0x3b92d5['calleridnum'],'destinationcontext':_0x3b92d5[_0x3632('0x6')],'callerid':_0x3b92d5['callerid'],'amaflags':_0x3632('0x7')}),'log':'CreateVoiceCallReport'});};exports[_0x3632('0x8')]=function(){return function(){return client['Request'](_0x3632('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3632('0xa')](_0x3632('0xb'))['format'](_0x3632('0xc')),moment()[_0x3632('0xd')]('day')[_0x3632('0xe')](_0x3632('0xc'))]}},'attributes':[_0x3632('0xf'),_0x3632('0x10'),'duration',_0x3632('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x0edc=['util','lodash','../client','CreateVoiceCallReport','context','callerid','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0edc,0xfb));var _0xc0ed=function(_0x52d1d0,_0x19eb07){_0x52d1d0=_0x52d1d0-0x0;var _0x73d34c=_0x0edc[_0x52d1d0];return _0x73d34c;};'use strict';var moment=require(_0xc0ed('0x0'));var util=require(_0xc0ed('0x1'));var _=require(_0xc0ed('0x2'));var client=require(_0xc0ed('0x3'));exports['create']=function(_0x37765b){return client['Request'](_0xc0ed('0x4'),{'body':_['merge'](_0x37765b,{'source':_0x37765b['calleridnum'],'destinationcontext':_0x37765b[_0xc0ed('0x5')],'callerid':_0x37765b[_0xc0ed('0x6')],'amaflags':'DOCUMENTATION'}),'log':_0xc0ed('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xc0ed('0x7'),{'options':{'where':{'type':[_0xc0ed('0x8')],'createdAt':{'$between':[moment()[_0xc0ed('0x9')](_0xc0ed('0xa'))[_0xc0ed('0xb')](_0xc0ed('0xc')),moment()[_0xc0ed('0xd')](_0xc0ed('0xa'))['format'](_0xc0ed('0xc'))]}},'attributes':[_0xc0ed('0xe'),_0xc0ed('0xf'),_0xc0ed('0x10'),_0xc0ed('0x11')]},'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 e0e42c3..cf32fac 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 _0x4d3f=['Request','CreateVoiceDialReport','../client','create'];(function(_0x50d2ac,_0x3634aa){var _0xeede0e=function(_0x240f36){while(--_0x240f36){_0x50d2ac['push'](_0x50d2ac['shift']());}};_0xeede0e(++_0x3634aa);}(_0x4d3f,0x136));var _0xf4d3=function(_0x521ff9,_0x179733){_0x521ff9=_0x521ff9-0x0;var _0x3861a3=_0x4d3f[_0x521ff9];return _0x3861a3;};'use strict';var client=require(_0xf4d3('0x0'));exports[_0xf4d3('0x1')]=function(_0x4aee7){return client[_0xf4d3('0x2')](_0xf4d3('0x3'),{'body':_0x4aee7,'log':_0xf4d3('0x3')});}; \ No newline at end of file +var _0xf662=['../client','create','Request','CreateVoiceDialReport'];(function(_0x202103,_0xb0042e){var _0x5de926=function(_0x4d3159){while(--_0x4d3159){_0x202103['push'](_0x202103['shift']());}};_0x5de926(++_0xb0042e);}(_0xf662,0xf4));var _0x2f66=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xf662[_0x3438cf];return _0x278698;};'use strict';var client=require(_0x2f66('0x0'));exports[_0x2f66('0x1')]=function(_0x59d878){return client[_0x2f66('0x2')](_0x2f66('0x3'),{'body':_0x59d878,'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 289a6e1..42e70a4 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 _0x6b19=['GetVoiceExtension','../client','getVoiceExtensions'];(function(_0x1ca6d2,_0x43ca92){var _0xe3ef1e=function(_0x504e9a){while(--_0x504e9a){_0x1ca6d2['push'](_0x1ca6d2['shift']());}};_0xe3ef1e(++_0x43ca92);}(_0x6b19,0xe8));var _0x96b1=function(_0x2072b3,_0x1c56b5){_0x2072b3=_0x2072b3-0x0;var _0x2b5ff3=_0x6b19[_0x2072b3];return _0x2b5ff3;};'use strict';var client=require(_0x96b1('0x0'));exports[_0x96b1('0x1')]=function(){return function(){return client['Request'](_0x96b1('0x2'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96b1('0x1')});};}; \ No newline at end of file +var _0xfd3a=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0x3dcb77,_0x3a4339){var _0x13c431=function(_0x39d61a){while(--_0x39d61a){_0x3dcb77['push'](_0x3dcb77['shift']());}};_0x13c431(++_0x3a4339);}(_0xfd3a,0x179));var _0xafd3=function(_0x299d5f,_0x4d31fb){_0x299d5f=_0x299d5f-0x0;var _0x53cd0c=_0xfd3a[_0x299d5f];return _0x53cd0c;};'use strict';var client=require(_0xafd3('0x0'));exports[_0xafd3('0x1')]=function(){return function(){return client[_0xafd3('0x2')](_0xafd3('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xafd3('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 460192d..60e016f 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 _0x9aac=['Request','GetVoiceQueue','acw','autopause','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','../client'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0x9aac,0x135));var _0xc9aa=function(_0x3e52ea,_0x50699c){_0x3e52ea=_0x3e52ea-0x0;var _0x19d4e4=_0x9aac[_0x3e52ea];return _0x19d4e4;};'use strict';var client=require(_0xc9aa('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xc9aa('0x1')](_0xc9aa('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc9aa('0x3'),'acwTimeout',_0xc9aa('0x4'),'monitor_format',_0xc9aa('0x5'),_0xc9aa('0x6'),'dialMethod',_0xc9aa('0x7'),_0xc9aa('0x8'),_0xc9aa('0x9'),'dialPredictiveOptimization',_0xc9aa('0xa'),_0xc9aa('0xb'),_0xc9aa('0xc'),'dialOriginateCallerIdNumber',_0xc9aa('0xd'),_0xc9aa('0xe'),_0xc9aa('0xf'),'dialQueueProject','dialCongestionMaxRetry',_0xc9aa('0x10'),'dialBusyMaxRetry',_0xc9aa('0x11'),_0xc9aa('0x12'),_0xc9aa('0x13'),_0xc9aa('0x14'),_0xc9aa('0x15'),_0xc9aa('0x16'),_0xc9aa('0x17'),_0xc9aa('0x18'),_0xc9aa('0x19'),_0xc9aa('0x1a'),_0xc9aa('0x1b'),_0xc9aa('0x1c'),_0xc9aa('0x1d'),_0xc9aa('0x1e'),_0xc9aa('0x1f'),_0xc9aa('0x20'),_0xc9aa('0x21'),'dialAMDMaximumWordLength',_0xc9aa('0x22'),'dialRecallMeTimeout','dialRecallInQueue',_0xc9aa('0x23'),_0xc9aa('0x24'),_0xc9aa('0x25'),_0xc9aa('0x26'),'monitor_format',_0xc9aa('0x27'),_0xc9aa('0x28'),_0xc9aa('0x29'),'dialNoSuchNumberMaxRetry',_0xc9aa('0x2a'),_0xc9aa('0x2b'),_0xc9aa('0x2c'),_0xc9aa('0x2d'),_0xc9aa('0x2e'),_0xc9aa('0x2f'),'dialMachineRetryFrequency',_0xc9aa('0x30'),'dialAgentRejectRetryFrequency',_0xc9aa('0x31'),'dialPredictiveIntervalMaxThreshold',_0xc9aa('0x32'),'dialPreviewAutoRecallMe'],'include':[{'model':_0xc9aa('0x33'),'as':_0xc9aa('0x33'),'attributes':['id',_0xc9aa('0x34'),_0xc9aa('0x35'),'active']},{'model':_0xc9aa('0x36'),'as':_0xc9aa('0x37'),'attributes':['id',_0xc9aa('0x34')]},{'model':_0xc9aa('0x33'),'as':_0xc9aa('0x38'),'attributes':['id','name',_0xc9aa('0x35'),_0xc9aa('0x39')]},{'model':_0xc9aa('0x3a'),'as':_0xc9aa('0x3a'),'attributes':['id',_0xc9aa('0x34')],'include':[{'model':_0xc9aa('0x3a'),'as':_0xc9aa('0x3b'),'attributes':['id','name',_0xc9aa('0x3c')]}]}]},'log':_0xc9aa('0x3d')});};}; \ No newline at end of file +var _0x6c7b=['strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','../client','name','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x7d286f,_0x1677de){_0x7d286f=_0x7d286f-0x0;var _0x3748cf=_0x6c7b[_0x7d286f];return _0x3748cf;};'use strict';var client=require(_0xb6c7('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xb6c7('0x1'),'acw',_0xb6c7('0x2'),_0xb6c7('0x3'),_0xb6c7('0x4'),'type',_0xb6c7('0x5'),_0xb6c7('0x6'),_0xb6c7('0x7'),_0xb6c7('0x8'),_0xb6c7('0x9'),'dialPredictiveOptimization',_0xb6c7('0xa'),_0xb6c7('0xb'),_0xb6c7('0xc'),_0xb6c7('0xd'),_0xb6c7('0xe'),_0xb6c7('0xf'),_0xb6c7('0x10'),_0xb6c7('0x11'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xb6c7('0x12'),_0xb6c7('0x13'),_0xb6c7('0x14'),_0xb6c7('0x15'),_0xb6c7('0x16'),_0xb6c7('0x17'),_0xb6c7('0x18'),'dialPrefix',_0xb6c7('0x19'),_0xb6c7('0x1a'),_0xb6c7('0x1b'),_0xb6c7('0x1c'),_0xb6c7('0x1d'),_0xb6c7('0x1e'),_0xb6c7('0x1f'),'dialAMDBetweenWordsSilence',_0xb6c7('0x20'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0xb6c7('0x21'),'dialRecallInQueue',_0xb6c7('0x22'),_0xb6c7('0x23'),_0xb6c7('0x24'),_0xb6c7('0x25'),_0xb6c7('0x4'),_0xb6c7('0x26'),_0xb6c7('0x27'),_0xb6c7('0x28'),_0xb6c7('0x29'),_0xb6c7('0x2a'),_0xb6c7('0x2b'),_0xb6c7('0x2c'),_0xb6c7('0x2d'),'dialAbandonedRetryFrequency',_0xb6c7('0x2e'),_0xb6c7('0x2f'),'dialAgentRejectMaxRetry',_0xb6c7('0x30'),'mandatoryDisposition',_0xb6c7('0x31'),'dialPredictiveIntervalMinThreshold',_0xb6c7('0x32')],'include':[{'model':'Trunk','as':_0xb6c7('0x33'),'attributes':['id',_0xb6c7('0x1'),'callerid',_0xb6c7('0x34')]},{'model':_0xb6c7('0x35'),'as':_0xb6c7('0x36'),'attributes':['id',_0xb6c7('0x1')]},{'model':_0xb6c7('0x33'),'as':_0xb6c7('0x37'),'attributes':['id','name',_0xb6c7('0x38'),_0xb6c7('0x34')]},{'model':_0xb6c7('0x39'),'as':_0xb6c7('0x39'),'attributes':['id','name'],'include':[{'model':_0xb6c7('0x39'),'as':_0xb6c7('0x3a'),'attributes':['id','name',_0xb6c7('0x3b')]}]}]},'log':_0xb6c7('0x3c')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5160c14..0629ddf 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(_0x3b2eea,_0xcc1547){var _0x2d5c9c=function(_0x3ea911){while(--_0x3ea911){_0x3b2eea['push'](_0x3b2eea['shift']());}};_0x2d5c9c(++_0xcc1547);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x5552d2,_0x3fd5ba){var _0x28e5e0=function(_0xf5d0d0){while(--_0xf5d0d0){_0x5552d2['push'](_0x5552d2['shift']());}};_0x28e5e0(++_0x3fd5ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 5146026..d16808d 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 _0x4285=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x3174d2,_0x4dbb8a){var _0x28519a=function(_0x4e0fb9){while(--_0x4e0fb9){_0x3174d2['push'](_0x3174d2['shift']());}};_0x28519a(++_0x4dbb8a);}(_0x4285,0x16b));var _0x5428=function(_0x213568,_0x114a6e){_0x213568=_0x213568-0x0;var _0x4fc3ff=_0x4285[_0x213568];return _0x4fc3ff;};'use strict';var client=require(_0x5428('0x0'));exports[_0x5428('0x1')]=function(_0x22f025){return function(){return client[_0x5428('0x2')](_0x5428('0x3'),{'options':{'where':{'VoiceQueueId':_0x22f025,'paused':!![]},'raw':!![]},'log':_0x5428('0x1')});};}; \ No newline at end of file +var _0xb743=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x41f556,_0x15e626){var _0x5817e6=function(_0x1125d4){while(--_0x1125d4){_0x41f556['push'](_0x41f556['shift']());}};_0x5817e6(++_0x15e626);}(_0xb743,0x65));var _0x3b74=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb743[_0x12fc8d];return _0x3f9d04;};'use strict';var client=require(_0x3b74('0x0'));exports[_0x3b74('0x1')]=function(_0x5f0f57){return function(){return client[_0x3b74('0x2')](_0x3b74('0x3'),{'options':{'where':{'VoiceQueueId':_0x5f0f57,'paused':!![]},'raw':!![]},'log':_0x3b74('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index dc4c5ed..2694349 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(_0x4d689b,_0xf1a0a8){var _0x58d069=function(_0x29d03b){while(--_0x29d03b){_0x4d689b['push'](_0x4d689b['shift']());}};_0x58d069(++_0xf1a0a8);}(_0x7a54,0x106));var _0x47a5=function(_0x2c5de2,_0x392ee0){_0x2c5de2=_0x2c5de2-0x0;var _0x324b7d=_0x7a54[_0x2c5de2];return _0x324b7d;};'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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3daee2,_0x2c1ee6){var _0x4c8ac4=function(_0x586d57){while(--_0x586d57){_0x3daee2['push'](_0x3daee2['shift']());}};_0x4c8ac4(++_0x2c1ee6);}(_0x7a54,0x106));var _0x47a5=function(_0x59bdf5,_0x15089a){_0x59bdf5=_0x59bdf5-0x0;var _0x2182ee=_0x7a54[_0x59bdf5];return _0x2182ee;};'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 diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 630528f..73d50e4 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 _0xd7ac=['transfereraccountcode','transferercontext','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x2a5c16,_0x57e2ac){var _0x21ea29=function(_0x2ab59c){while(--_0x2ab59c){_0x2a5c16['push'](_0x2a5c16['shift']());}};_0x21ea29(++_0x57e2ac);}(_0xd7ac,0x17c));var _0xcd7a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd7ac[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xcd7a('0x0'));exports[_0xcd7a('0x1')]={};exports[_0xcd7a('0x2')]=function(_0xfabce6){return client[_0xcd7a('0x3')](_0xcd7a('0x4'),{'body':{'result':_0xfabce6[_0xcd7a('0x5')],'transfererchannel':_0xfabce6[_0xcd7a('0x6')],'transferercalleridnum':_0xfabce6['transferercalleridnum'],'transferercalleridname':_0xfabce6[_0xcd7a('0x7')],'transfererconnectedlinenum':_0xfabce6[_0xcd7a('0x8')],'transfererconnectedlinename':_0xfabce6[_0xcd7a('0x9')],'transfereraccountcode':_0xfabce6[_0xcd7a('0xa')],'transferercontext':_0xfabce6[_0xcd7a('0xb')],'transfererexten':_0xfabce6[_0xcd7a('0xc')],'transfererlinkedid':_0xfabce6['transfererlinkedid'],'transfereechannel':_0xfabce6['transfereechannel'],'transfereecalleridnum':_0xfabce6[_0xcd7a('0xd')],'transfereecalleridname':_0xfabce6[_0xcd7a('0xe')],'transfereeconnectedlinenum':_0xfabce6[_0xcd7a('0xf')],'transfereeconnectedlinename':_0xfabce6[_0xcd7a('0x10')],'transfereeaccountcode':_0xfabce6['transfereeaccountcode'],'transfereecontext':_0xfabce6[_0xcd7a('0x11')],'transfereeexten':_0xfabce6[_0xcd7a('0x12')],'transfereelinkedid':_0xfabce6['transfereelinkedid'],'isexternal':_0xfabce6['isexternal'],'context':_0xfabce6[_0xcd7a('0x13')],'extension':_0xfabce6[_0xcd7a('0x14')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xcd7a('0x15')]=function(_0x140ce4){return client[_0xcd7a('0x3')](_0xcd7a('0x4'),{'body':{'result':_0x140ce4[_0xcd7a('0x5')],'transfererchannel':_0x140ce4[_0xcd7a('0x16')],'transferercalleridnum':_0x140ce4['origtransferercalleridnum'],'transferercalleridname':_0x140ce4[_0xcd7a('0x17')],'transfererconnectedlinenum':_0x140ce4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x140ce4['secondtransfererconnectedlinename'],'transfereraccountcode':_0x140ce4[_0xcd7a('0x18')],'transferercontext':_0x140ce4[_0xcd7a('0x19')],'transfererexten':_0x140ce4[_0xcd7a('0x1a')],'transfererlinkedid':_0x140ce4[_0xcd7a('0x1b')],'transfereechannel':_0x140ce4[_0xcd7a('0x1c')],'transfereecalleridnum':_0x140ce4[_0xcd7a('0x1d')],'transfereecalleridname':_0x140ce4[_0xcd7a('0x1e')],'transfereeconnectedlinenum':_0x140ce4[_0xcd7a('0x1f')],'transfereeconnectedlinename':_0x140ce4[_0xcd7a('0x20')],'transfereeaccountcode':_0x140ce4[_0xcd7a('0x21')],'transfereecontext':_0x140ce4[_0xcd7a('0x22')],'transfereeexten':_0x140ce4[_0xcd7a('0x23')],'transfereelinkedid':_0x140ce4['transfertargetlinkedid'],'isexternal':_0x140ce4[_0xcd7a('0x24')],'context':_0x140ce4[_0xcd7a('0x25')],'extension':_0x140ce4[_0xcd7a('0x26')],'type':'attended'},'log':_0xcd7a('0x4')});}; \ No newline at end of file +var _0xf60d=['transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereelinkedid','isexternal','context','blind','attendedTransfer','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','attended','../client','Request','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0xf60d,0x1a5));var _0xdf60=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xf60d[_0x13b02f];return _0x12e9a6;};'use strict';var client=require(_0xdf60('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0xb2b56f){return client[_0xdf60('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0xb2b56f[_0xdf60('0x2')],'transfererchannel':_0xb2b56f['transfererchannel'],'transferercalleridnum':_0xb2b56f[_0xdf60('0x3')],'transferercalleridname':_0xb2b56f['transferercalleridname'],'transfererconnectedlinenum':_0xb2b56f[_0xdf60('0x4')],'transfererconnectedlinename':_0xb2b56f['transfererconnectedlinename'],'transfereraccountcode':_0xb2b56f[_0xdf60('0x5')],'transferercontext':_0xb2b56f['transferercontext'],'transfererexten':_0xb2b56f[_0xdf60('0x6')],'transfererlinkedid':_0xb2b56f[_0xdf60('0x7')],'transfereechannel':_0xb2b56f['transfereechannel'],'transfereecalleridnum':_0xb2b56f[_0xdf60('0x8')],'transfereecalleridname':_0xb2b56f[_0xdf60('0x9')],'transfereeconnectedlinenum':_0xb2b56f[_0xdf60('0xa')],'transfereeconnectedlinename':_0xb2b56f['transfereeconnectedlinename'],'transfereeaccountcode':_0xb2b56f['transfereeaccountcode'],'transfereecontext':_0xb2b56f['transfereecontext'],'transfereeexten':_0xb2b56f['transfereeexten'],'transfereelinkedid':_0xb2b56f[_0xdf60('0xb')],'isexternal':_0xb2b56f[_0xdf60('0xc')],'context':_0xb2b56f[_0xdf60('0xd')],'extension':_0xb2b56f['extension'],'type':_0xdf60('0xe')},'log':'CreateVoiceTransferReport'});};exports[_0xdf60('0xf')]=function(_0x4fea83){return client['Request'](_0xdf60('0x10'),{'body':{'result':_0x4fea83[_0xdf60('0x2')],'transfererchannel':_0x4fea83[_0xdf60('0x11')],'transferercalleridnum':_0x4fea83[_0xdf60('0x12')],'transferercalleridname':_0x4fea83[_0xdf60('0x13')],'transfererconnectedlinenum':_0x4fea83[_0xdf60('0x14')],'transfererconnectedlinename':_0x4fea83[_0xdf60('0x15')],'transfereraccountcode':_0x4fea83[_0xdf60('0x16')],'transferercontext':_0x4fea83['secondtransferercontext'],'transfererexten':_0x4fea83[_0xdf60('0x17')],'transfererlinkedid':_0x4fea83[_0xdf60('0x18')],'transfereechannel':_0x4fea83[_0xdf60('0x19')],'transfereecalleridnum':_0x4fea83[_0xdf60('0x1a')],'transfereecalleridname':_0x4fea83[_0xdf60('0x1b')],'transfereeconnectedlinenum':_0x4fea83[_0xdf60('0x1c')],'transfereeconnectedlinename':_0x4fea83[_0xdf60('0x1d')],'transfereeaccountcode':_0x4fea83['transfertargetaccountcode'],'transfereecontext':_0x4fea83[_0xdf60('0x1e')],'transfereeexten':_0x4fea83['transfertargetexten'],'transfereelinkedid':_0x4fea83[_0xdf60('0x1f')],'isexternal':_0x4fea83[_0xdf60('0xc')],'context':_0x4fea83['origtransferercontext'],'extension':_0x4fea83['origtransfererexten'],'type':_0xdf60('0x20')},'log':_0xdf60('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 31169f6..01441c7 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 _0x444e=['loggedInDb','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','push','find','omit','undefined','values','channels','length','voicechannel','validate','map','uniqueid','filename','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','../../../config/environment','../ami','listen','format','%s/%s','timers','timer','agents','updateStatusRealtime','pause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','total','type','unmanaged','abandoned'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x444e,0xe8));var _0xe444=function(_0x40fd83,_0x4d6828){_0x40fd83=_0x40fd83-0x0;var _0x5084fa=_0x444e[_0x40fd83];return _0x5084fa;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var jayson=require(_0xe444('0x1'));var schema=require('validate');var BPromise=require(_0xe444('0x2'));var moment=require('moment');var config=require(_0xe444('0x3'));var properties=require('../properties');var ami=require(_0xe444('0x4'));exports[_0xe444('0x5')]=function(_0x91763c,_0x394fc1,_0x36ac3b){return new BPromise(function(_0x1ddb27,_0x4834c7){var _0xfbd88b={'QueuePause':function(_0x4b5b7d){return new Promise(function(_0x29a2b7,_0x482b98){var _0x3199dd=util[_0xe444('0x6')](_0xe444('0x7'),'SIP',_0x4b5b7d['name']);if(_0x91763c[_0xe444('0x8')]&&_0x91763c[_0xe444('0x8')][_0x3199dd]&&_0x91763c['timers'][_0x3199dd][_0xe444('0x9')]){_0x91763c['timers'][_0x3199dd]['updateAcw']();}if(_0x91763c[_0xe444('0xa')][_0x3199dd]){_0x91763c['agents'][_0x3199dd][_0xe444('0xb')]({'statePause':_0x4b5b7d[_0xe444('0xc')]?!![]:![]});}_0x29a2b7({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x28c3e4){var _0x4f046c=this;return new Promise(function(_0x5ba044,_0x32e7f9){if(ami[_0xe444('0xd')]()==![]){return _0x32e7f9(_0x4f046c['error'](0x1f4,[config[_0xe444('0xe')]['ip'],config['asterisk'][_0xe444('0xf')],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}_0x28c3e4=_[_0xe444('0x12')](_0x28c3e4,_[_0xe444('0x13')](properties[_0xe444('0x14')]));_0x28c3e4[_0xe444('0x15')]=_0xe444('0x16');return ami[_0xe444('0x17')](_0x28c3e4)[_0xe444('0x18')](function(_0x236bc4){_0x5ba044({'code':0xc8,'message':_0x236bc4[_0xe444('0x19')]});})[_0xe444('0x1a')](function(_0x4e2711){_0x32e7f9(_0x4f046c[_0xe444('0x1b')](0x1f5,_0x4e2711[_0xe444('0x19')]));});});},'Command':function(_0x12eb54){var _0x2f6a4a=this;return new Promise(function(_0x58fd40,_0x306e05){if(ami[_0xe444('0xd')]()==![]){return _0x306e05(_0x2f6a4a[_0xe444('0x1b')](0x1f4,[config[_0xe444('0xe')]['ip'],config[_0xe444('0xe')]['username'],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}_0x12eb54=_['pick'](_0x12eb54,_0xe444('0x1c'));_0x12eb54['action']=_0xe444('0x1d');return ami[_0xe444('0x17')](_0x12eb54)[_0xe444('0x18')](function(_0x322c07){_0x58fd40({'code':0xc8,'message':_0x322c07[_0xe444('0x1e')]});})['catch'](function(_0x527bf5){_0x306e05(_0x2f6a4a[_0xe444('0x1b')](0x1f5,_0x527bf5[_0xe444('0x19')]));});});},'VoiceQueues':function(_0x1ac266){return new Promise(function(_0x1ff6d2,_0x2a03a2){var _0x5e0311=[];for(var _0x3c9cf7 in _0x91763c[_0xe444('0x1f')]){if(_0x91763c['voiceQueues'][_0xe444('0x20')](_0x3c9cf7)){var _0x4f4412=_0x91763c[_0xe444('0x1f')][_0x3c9cf7];var _0x26ca6f={'id':_0x4f4412['id'],'name':_0x4f4412[_0xe444('0x21')],'strategy':_0x4f4412[_0xe444('0x22')],'answered':_0x4f4412[_0xe444('0x23')],'available':_0x4f4412['available'],'loggedIn':_0x4f4412[_0xe444('0x24')],'pTalking':_0x4f4412[_0xe444('0x25')],'sumBillable':_0x4f4412[_0xe444('0x26')],'sumDuration':_0x4f4412[_0xe444('0x27')],'sumHoldTime':_0x4f4412['sumHoldTime']||0x0,'talking':_0x4f4412['talking'],'total':_0x4f4412[_0xe444('0x28')],'type':_0x4f4412[_0xe444('0x29')],'unmanaged':_0x4f4412[_0xe444('0x2a')],'abandoned':_0x4f4412[_0xe444('0x2b')],'waiting':_0x4f4412['waiting'],'loggedInDb':_0x4f4412[_0xe444('0x2c')]};if(_0x4f4412[_0xe444('0x29')]===_0xe444('0x2d')){_0x26ca6f[_0xe444('0x2e')]=_0x4f4412['dialActive'];_0x26ca6f['dialMethod']=_0x4f4412['dialMethod'];_0x26ca6f[_0xe444('0x2f')]=_0x4f4412[_0xe444('0x2f')];_0x26ca6f[_0xe444('0x30')]=_0x4f4412[_0xe444('0x30')];_0x26ca6f[_0xe444('0x31')]=_0x4f4412['dialOriginateTimeout'];_0x26ca6f[_0xe444('0x32')]=_0x4f4412[_0xe444('0x32')];_0x26ca6f[_0xe444('0x33')]=_0x4f4412['temp'];_0x26ca6f[_0xe444('0x34')]=_0x4f4412['outboundAnswerAgiCallsDay'];_0x26ca6f['outboundAnswerCallsDay']=_0x4f4412[_0xe444('0x35')];_0x26ca6f[_0xe444('0x36')]=_0x4f4412['outboundBlacklistCallsDay'];_0x26ca6f[_0xe444('0x37')]=_0x4f4412['outboundBusyCallsDay'];_0x26ca6f[_0xe444('0x38')]=_0x4f4412['outboundCongestionCallsDay'];_0x26ca6f['outboundDropCallsDayACS']=_0x4f4412[_0xe444('0x39')];_0x26ca6f['outboundDropCallsDayCallersExit']=_0x4f4412[_0xe444('0x3a')];_0x26ca6f[_0xe444('0x3b')]=_0x4f4412[_0xe444('0x3b')];_0x26ca6f[_0xe444('0x3c')]=_0x4f4412['outboundNoAnswerCallsDay'];_0x26ca6f[_0xe444('0x3d')]=_0x4f4412[_0xe444('0x3d')];_0x26ca6f[_0xe444('0x3e')]=_0x4f4412['outboundOriginateFailureCallsDay'];_0x26ca6f[_0xe444('0x3f')]=_0x4f4412['outboundReCallsDay'];_0x26ca6f[_0xe444('0x40')]=_0x4f4412[_0xe444('0x40')];_0x26ca6f[_0xe444('0x41')]=_0x4f4412['outboundUnknownCallsDay'];_0x26ca6f['predictiveIntervalAnsweredCalls']=_0x4f4412[_0xe444('0x42')];_0x26ca6f[_0xe444('0x43')]=_0x4f4412[_0xe444('0x43')];_0x26ca6f[_0xe444('0x44')]=_0x4f4412[_0xe444('0x44')];_0x26ca6f[_0xe444('0x45')]=_0x4f4412[_0xe444('0x45')];_0x26ca6f['predictiveIntervalDroppedCallsTimeout']=_0x4f4412['predictiveIntervalDroppedCallsTimeout'];_0x26ca6f[_0xe444('0x46')]=_0x4f4412['predictiveIntervalErlangCalls'];_0x26ca6f[_0xe444('0x47')]=_0x4f4412['predictiveIntervalErlangCallsDroppedCalls'];_0x26ca6f[_0xe444('0x48')]=_0x4f4412[_0xe444('0x48')];_0x26ca6f[_0xe444('0x49')]=_0x4f4412[_0xe444('0x49')];_0x26ca6f[_0xe444('0x4a')]=_0x4f4412[_0xe444('0x4a')];_0x26ca6f['predictiveIntervalAvailable']=_0x4f4412[_0xe444('0x4b')];_0x26ca6f[_0xe444('0x4c')]=_0x4f4412[_0xe444('0x4c')];_0x26ca6f[_0xe444('0x19')]=_0x4f4412['message'];_0x26ca6f[_0xe444('0x4d')]=_0x4f4412[_0xe444('0x4d')];_0x26ca6f[_0xe444('0x4e')]=_0x4f4412[_0xe444('0x4e')];_0x26ca6f[_0xe444('0x4f')]=_0x4f4412[_0xe444('0x4f')];_0x26ca6f[_0xe444('0x50')]=_0x4f4412[_0xe444('0x50')];_0x26ca6f[_0xe444('0x51')]=_0x4f4412['erlangBusyFactor'];_0x26ca6f['startPredictive']=_0x4f4412['startPredictive'];_0x26ca6f[_0xe444('0x52')]=_0x4f4412[_0xe444('0x52')];}if(_0x4f4412[_0xe444('0x53')]){_0x26ca6f[_0xe444('0x53')]={'id':_0x4f4412[_0xe444('0x53')]['id'],'name':_0x4f4412['Trunk']['name'],'active':_0x4f4412[_0xe444('0x53')][_0xe444('0x54')],'callerid':_0x4f4412[_0xe444('0x53')]['callerid']};}if(_0x4f4412[_0xe444('0x55')]){_0x26ca6f[_0xe444('0x55')]={'id':_0x4f4412[_0xe444('0x55')]['id'],'name':_0x4f4412[_0xe444('0x55')][_0xe444('0x21')]};}_0x5e0311[_0xe444('0x56')](_0x26ca6f);}}_0x1ff6d2({'count':_0x5e0311['length'],'rows':_0x5e0311});});},'UpdateVoiceQueue':function(_0x595f81){return new Promise(function(_0x3c8636,_0x2f550f){var _0x2eba87=_[_0xe444('0x57')](_0x91763c['voiceQueues'],{'id':parseInt(_0x595f81['id'])});var _0x13b92d=_[_0xe444('0x58')](_0x595f81,['id']);if(_0x2eba87){for(var _0x3549d0 in _0x13b92d){if(typeof _0x13b92d[_0x3549d0]!==_0xe444('0x59')&&typeof _0x2eba87[_0x3549d0]!==_0xe444('0x59')){_0x2eba87[_0x3549d0]=_0x13b92d[_0x3549d0];}}_0x3c8636(_0x2eba87);}else{_0x2f550f();}});},'VoiceChannels':function(_0x300cea){return new Promise(function(_0x10b183,_0x26d4d3){var _0x4ae871=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x5b')]);_0x10b183({'count':_0x4ae871[_0xe444('0x5c')],'rows':_0x4ae871});});},'VoiceChannelMixMonitor':function(_0x4cb019){var _0x124fc3=this;return new Promise(function(_0x51ce26,_0x5736a2){if(ami['isConnected']()==![]){return _0x5736a2(_0x124fc3[_0xe444('0x1b')](0x1f4,[config[_0xe444('0xe')]['ip'],config['asterisk']['username'],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}var _0x53bde2=schema(properties[_0xe444('0x5d')])[_0xe444('0x5e')](_0x4cb019);if(_0x53bde2[_0xe444('0x5c')]>0x0){return _0x5736a2(_0x124fc3['error'](0x1f4,_[_0xe444('0x5f')](_0x53bde2,'message')[_0xe444('0x11')](',\x20')));}var _0x3f65d3=_['find'](_0x91763c['channels'],{'uniqueid':_0x4cb019[_0xe444('0x60')]});if(_0x3f65d3&&_0x3f65d3['channel']){var _0x251c70=util[_0xe444('0x6')]('%s.%s',_0x4cb019[_0xe444('0x61')]||_0x4cb019[_0xe444('0x60')],_0x4cb019[_0xe444('0x6')]||_0xe444('0x62'));return ami[_0xe444('0x17')]({'action':_0xe444('0x63'),'channel':_0x3f65d3[_0xe444('0x64')],'file':_0x251c70,'options':_0xe444('0x65')})[_0xe444('0x18')](function(_0x34482f){var _0x3286b6=_[_0xe444('0x57')](_0x3f65d3['monitors'],{'filename':_0xe444('0x66')+_0x251c70[_0xe444('0x67')]()});if(_['isNil'](_0x3286b6)){_0x3f65d3[_0xe444('0x68')]['push']({'filename':_0xe444('0x66')+_0x251c70['toLowerCase'](),'createdAt':moment()[_0xe444('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x34482f[_0xe444('0x69')],'status':_0xe444('0x6a')});}else{_0x3286b6[_0xe444('0x69')]=_0x34482f[_0xe444('0x69')];_0x3286b6[_0xe444('0x6b')]='rec';}_0x51ce26({'code':0xc8,'message':[_0x4cb019[_0xe444('0x60')],_0xe444('0x6c'),_0x34482f['mixmonitorid']][_0xe444('0x11')]('\x20'),'mixmonitorid':_0x34482f[_0xe444('0x69')]});})[_0xe444('0x1a')](function(_0x372909){_0x5736a2(_0x124fc3['error'](0x1f5,[_0x4cb019[_0xe444('0x60')],_0x372909[_0xe444('0x19')]['toLowerCase']()][_0xe444('0x11')]('\x20')));});}else{return _0x5736a2(_0x124fc3[_0xe444('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x486d5c){var _0x1bd0dc=this;return new Promise(function(_0x35793c,_0x31f478){if(ami[_0xe444('0xd')]()==![]){return _0x31f478(_0x1bd0dc['error'](0x1f4,[config[_0xe444('0xe')]['ip'],config['asterisk'][_0xe444('0xf')],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}var _0x152feb=schema(properties[_0xe444('0x5d')])['validate'](_0x486d5c);if(_0x152feb[_0xe444('0x5c')]>0x0){return _0x31f478(_0x1bd0dc[_0xe444('0x1b')](0x1f4,_['map'](_0x152feb,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x3a9acf=_[_0xe444('0x57')](_0x91763c[_0xe444('0x5b')],{'uniqueid':_0x486d5c[_0xe444('0x60')]});if(_0x3a9acf){return BPromise[_0xe444('0x6d')]()[_0xe444('0x18')](function(){if(_0x3a9acf[_0xe444('0x64')]){return ami[_0xe444('0x17')]({'action':_0xe444('0x6e'),'channel':_0x3a9acf['channel'],'mixmonitorid':_0x486d5c[_0xe444('0x69')]})[_0xe444('0x1a')](function(_0x4d91e3){});}})[_0xe444('0x18')](function(){if(_0x3a9acf['destinationchannel']){return ami[_0xe444('0x17')]({'action':_0xe444('0x6e'),'channel':_0x3a9acf[_0xe444('0x6f')],'mixmonitorid':_0x486d5c[_0xe444('0x69')]})['catch'](function(_0x28bdc2){});}})[_0xe444('0x18')](function(_0x5a0cb4){var _0xa45ffa=_[_0xe444('0x57')](_0x3a9acf['monitors'],{'mixmonitorid':_0x486d5c[_0xe444('0x69')]});if(_0xa45ffa){_0xa45ffa[_0xe444('0x6b')]=_0xe444('0x70');}})['then'](function(){var _0x849c5c=util[_0xe444('0x6')]('%s.%s',_0x486d5c[_0xe444('0x61')]||_0x486d5c[_0xe444('0x60')],_0x486d5c[_0xe444('0x6')]||_0xe444('0x62'));var _0x392a3a=_[_0xe444('0x57')](_0x3a9acf[_0xe444('0x68')],{'filename':_0xe444('0x66')+_0x849c5c['toLowerCase']()});if(_0x392a3a){_0x392a3a[_0xe444('0x6b')]=_0xe444('0x70');}})[_0xe444('0x18')](function(){_0x35793c({'code':0xc8,'message':[_0x486d5c[_0xe444('0x60')],'StopMixMonitor\x20Success'][_0xe444('0x11')]('\x20')});})[_0xe444('0x1a')](function(_0x37e49f){_0x31f478(_0x1bd0dc['error'](0x1f5,[_0x486d5c[_0xe444('0x60')],_0x37e49f[_0xe444('0x19')][_0xe444('0x67')]()][_0xe444('0x11')]('\x20')));});}else{return _0x31f478(_0x1bd0dc[_0xe444('0x1b')](0x1f5,_0xe444('0x71')));}});},'VoiceQueuesChannels':function(_0x32f7ed){return new Promise(function(_0x365d7f,_0x36a6a3){var _0x4d6bd4=_[_0xe444('0x5a')](_0x91763c['queueChannels']);_0x365d7f({'count':_0x4d6bd4[_0xe444('0x5c')],'rows':_0x4d6bd4});});},'VoiceQueuesChannel':function(_0x289b59){var _0x458851=this;return new Promise(function(_0x499246,_0x4ca57c){var _0x37533c=schema(properties['voicequeuechannel'])[_0xe444('0x5e')](_0x289b59);if(_0x37533c[_0xe444('0x5c')]>0x0){return _0x4ca57c(_0x458851[_0xe444('0x1b')](0x1f4,_['map'](_0x37533c,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x1edb83=_[_0xe444('0x57')](_0x91763c[_0xe444('0x72')],{'uniqueid':_0x289b59['uniqueid']});if(_0x1edb83){_0x499246(_0x1edb83);}else{return _0x4ca57c(_0x458851['error'](0x1f5,_0xe444('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x5bb065){var _0x151a8f=this;return new Promise(function(_0x153bd8,_0x2ad3e3){if(ami['isConnected']()==![]){return _0x2ad3e3(_0x151a8f[_0xe444('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0xe444('0xe')][_0xe444('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x4a1328=schema(properties[_0xe444('0x73')])['validate'](_0x5bb065);if(_0x4a1328[_0xe444('0x5c')]>0x0){return _0x2ad3e3(_0x151a8f['error'](0x1f4,_['map'](_0x4a1328,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x1398c2=_[_0xe444('0x57')](_0x91763c['queueChannels'],{'uniqueid':_0x5bb065['uniqueid']});if(_0x1398c2&&_0x1398c2[_0xe444('0x64')]){return ami['Action']({'action':_0xe444('0x74'),'channel':_0x1398c2[_0xe444('0x64')]})['then'](function(_0x5e863f){_0x153bd8({'code':0xc8,'message':[_0x5bb065[_0xe444('0x60')],_0x5e863f[_0xe444('0x19')][_0xe444('0x67')]()][_0xe444('0x11')]('\x20')});})[_0xe444('0x1a')](function(_0x192834){_0x2ad3e3(_0x151a8f[_0xe444('0x1b')](0x1f5,[_0x5bb065[_0xe444('0x60')],_0x192834['message'][_0xe444('0x67')]()]['join']('\x20')));});}else{return _0x2ad3e3(_0x151a8f[_0xe444('0x1b')](0x1f5,_0xe444('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x3ae01f){var _0x43796f=this;return new Promise(function(_0x57a209,_0x354c3a){if(ami[_0xe444('0xd')]()==![]){return _0x354c3a(_0x43796f[_0xe444('0x1b')](0x1f4,[config[_0xe444('0xe')]['ip'],config[_0xe444('0xe')]['username'],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}var _0x1d7b58=schema(properties[_0xe444('0x75')])[_0xe444('0x5e')](_0x3ae01f);if(_0x1d7b58[_0xe444('0x5c')]>0x0){return _0x354c3a(_0x43796f['error'](0x1f4,_[_0xe444('0x5f')](_0x1d7b58,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x4cfc14=_['find'](_0x91763c[_0xe444('0x72')],{'uniqueid':_0x3ae01f[_0xe444('0x60')]});if(_0x4cfc14&&_0x4cfc14[_0xe444('0x64')]){return ami[_0xe444('0x17')]({'action':_0xe444('0x76'),'channel':_0x4cfc14[_0xe444('0x64')],'exten':_0x3ae01f[_0xe444('0x77')],'context':_0x3ae01f['context']||_0x4cfc14[_0xe444('0x78')],'priority':0x1})[_0xe444('0x18')](function(_0x40261a){_0x57a209({'code':0xc8,'message':[_0x3ae01f['uniqueid'],_0x40261a[_0xe444('0x19')][_0xe444('0x67')]()]['join']('\x20')});})[_0xe444('0x1a')](function(_0x50fca3){_0x354c3a(_0x43796f['error'](0x1f5,[_0x3ae01f[_0xe444('0x60')],_0x50fca3[_0xe444('0x19')][_0xe444('0x67')]()]['join']('\x20')));});}else{return _0x354c3a(_0x43796f[_0xe444('0x1b')](0x1f5,_0xe444('0x71')));}});},'Agents':function(_0x3be23c){return new Promise(function(_0x51b876,_0x225dc4){var _0x241ea0=_['values'](_0x91763c[_0xe444('0xa')]);_0x51b876({'count':_0x241ea0['length'],'rows':_0x241ea0});});},'Telephones':function(_0x656676){return new Promise(function(_0x538968,_0x1372a7){var _0x5605cf=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x79')]);_0x538968({'count':_0x5605cf[_0xe444('0x5c')],'rows':_0x5605cf});});},'Trunks':function(_0xe57d6b){return new Promise(function(_0x292ecc,_0x26d26d){var _0x517f69=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x7a')]);_0x292ecc({'count':_0x517f69[_0xe444('0x5c')],'rows':_0x517f69});});},'OutboundChannels':function(_0x252f5d){return new Promise(function(_0xcf8b68,_0x29e74c){var _0x5b67eb=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x7b')]);_0xcf8b68({'count':_0x5b67eb[_0xe444('0x5c')],'rows':_0x5b67eb});});},'Outbound':function(_0x146199){return new Promise(function(_0x4cda77,_0x5a3f3e){_0x4cda77(_0x91763c[_0xe444('0x2d')]);});},'Campaigns':function(_0x4df1fc){return new Promise(function(_0x32e5b6,_0x120f49){var _0x356445=_['values'](_0x91763c[_0xe444('0x7c')]);_0x32e5b6({'count':_0x356445['length'],'rows':_0x356445});});},'VoiceQueuesPreview':function(_0x191d33){var _0x36d9be=this;return new Promise(function(_0x601c26,_0x3f1842){_0x394fc1[_0xe444('0x7d')](_0x191d33['id'])[_0xe444('0x18')](function(_0x1ef277){_0x601c26({'code':0xc8,'message':_0x1ef277[_0xe444('0x19')]});})[_0xe444('0x1a')](function(_0x3ec157){_0x3f1842(_0x36d9be[_0xe444('0x1b')](0x1f4,_0x3ec157[_0xe444('0x19')]));});});},'EventManager':function(_0x34deff){var _0x502f03=this;return new Promise(function(_0x3bea13,_0x507864){if(!_0x34deff[_0xe444('0x7e')]){return _0x507864(_0x502f03[_0xe444('0x1b')](0x1f4,_0xe444('0x7f')));}ami[_0xe444('0x80')](_0xe444('0x81')+_0x34deff[_0xe444('0x7e')],_0x34deff[_0xe444('0x19')]);_0x3bea13({'code':0xc8,'message':_0x34deff});});},'FaxAccounts':function(_0x806511){return new Promise(function(_0x5a7c24,_0x32d87f){var _0xbe9eef=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x82')]);_0x5a7c24({'count':_0xbe9eef[_0xe444('0x5c')],'rows':_0xbe9eef});});},'SendFax':function(_0x5e31ef){var _0x1fa6fa=this;return new Promise(function(_0x4e7bfe,_0x1fa8ca){_0x36ac3b[_0xe444('0x83')](_0x5e31ef)['then'](function(_0x5a6ff4){_0x4e7bfe({'code':0xc8,'message':_0x5a6ff4[_0xe444('0x19')]});})[_0xe444('0x1a')](function(_0x592b5a){_0x1fa8ca(_0x1fa6fa[_0xe444('0x1b')](0x1f4,_0x592b5a[_0xe444('0x19')]));});});},'CheckAfterSend':function(_0x26792f){var _0x1505f5=this;return new Promise(function(_0x52bf94,_0x18d289){_0x36ac3b['checkAfterSend'](_0x26792f)[_0xe444('0x18')](function(_0x16532c){_0x52bf94({'code':0xc8,'message':_0x16532c['message']});})[_0xe444('0x1a')](function(_0xc46db3){_0x18d289(_0x1505f5[_0xe444('0x1b')](0x1f4,_0xc46db3[_0xe444('0x19')]));});});}};var _0x1b2ec0=jayson[_0xe444('0x84')](_0xfbd88b)[_0xe444('0x85')]();_0x1b2ec0['on'](_0xe444('0x1b'),function(_0x4692b5){return _0x4834c7(_0x4692b5);});_0x1b2ec0[_0xe444('0x5')](0x232a,_0xe444('0x86'),function(){console[_0xe444('0x87')](_0xe444('0x88'),0x232a);return _0x1ddb27(_0xe444('0x89')+0x232a);});});}; \ No newline at end of file +var _0xa0a1=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','values','channels','length','voicechannel','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','map','find','resolve','StopMixMonitor','destinationchannel','status','stop','monitors','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','outboundChannels','campaigns','run','event','emit','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','../properties','../ami','format','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','action','Action','message','catch','ami\x20disconnected','command','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','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'];(function(_0x53dc2f,_0x352f5f){var _0x2db8b6=function(_0x1c82c9){while(--_0x1c82c9){_0x53dc2f['push'](_0x53dc2f['shift']());}};_0x2db8b6(++_0x352f5f);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x29443b,_0x3facea){_0x29443b=_0x29443b-0x0;var _0x2ab02c=_0xa0a1[_0x29443b];return _0x2ab02c;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var jayson=require(_0x1a0a('0x1'));var schema=require(_0x1a0a('0x2'));var BPromise=require(_0x1a0a('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x1a0a('0x4'));var ami=require(_0x1a0a('0x5'));exports['listen']=function(_0x27077a,_0x31e85b,_0x4b5573){return new BPromise(function(_0x2d4b04,_0xe59f97){var _0x3fe29f={'QueuePause':function(_0x245f3d){return new Promise(function(_0x9da67c,_0x48d604){var _0x2e5bec=util[_0x1a0a('0x6')](_0x1a0a('0x7'),'SIP',_0x245f3d['name']);if(_0x27077a['timers']&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec]&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec][_0x1a0a('0x9')]){_0x27077a['timers'][_0x2e5bec][_0x1a0a('0xa')]();}if(_0x27077a['agents'][_0x2e5bec]){_0x27077a[_0x1a0a('0xb')][_0x2e5bec][_0x1a0a('0xc')]({'statePause':_0x245f3d[_0x1a0a('0xd')]?!![]:![]});}_0x9da67c({'code':0xc8,'message':_0x1a0a('0xe')});});},'Reload':function(_0x289046){var _0x2dee74=this;return new Promise(function(_0x3f34d2,_0x4f2b35){if(ami[_0x1a0a('0xf')]()==![]){return _0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected'][_0x1a0a('0x13')]('\x20')));}_0x289046=_[_0x1a0a('0x14')](_0x289046,_[_0x1a0a('0x15')](properties['module']));_0x289046[_0x1a0a('0x16')]='Reload';return ami[_0x1a0a('0x17')](_0x289046)['then'](function(_0x54bfbe){_0x3f34d2({'code':0xc8,'message':_0x54bfbe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x307fdc){_0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f5,_0x307fdc['message']));});});},'Command':function(_0x56b8a5){var _0x239065=this;return new Promise(function(_0x40903a,_0xfa74ce){if(ami['isConnected']()==![]){return _0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config['asterisk'][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}_0x56b8a5=_['pick'](_0x56b8a5,_0x1a0a('0x1b'));_0x56b8a5[_0x1a0a('0x16')]=_0x1a0a('0x1c');return ami['Action'](_0x56b8a5)[_0x1a0a('0x1d')](function(_0x47ef88){_0x40903a({'code':0xc8,'message':_0x47ef88[_0x1a0a('0x1e')]});})[_0x1a0a('0x19')](function(_0x2d7967){_0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f5,_0x2d7967[_0x1a0a('0x18')]));});});},'VoiceQueues':function(_0x578995){return new Promise(function(_0x1e2b28,_0x8e4151){var _0x561407=[];for(var _0x4cf939 in _0x27077a[_0x1a0a('0x1f')]){if(_0x27077a[_0x1a0a('0x1f')][_0x1a0a('0x20')](_0x4cf939)){var _0x365ab5=_0x27077a[_0x1a0a('0x1f')][_0x4cf939];var _0x244bbf={'id':_0x365ab5['id'],'name':_0x365ab5[_0x1a0a('0x21')],'strategy':_0x365ab5[_0x1a0a('0x22')],'answered':_0x365ab5[_0x1a0a('0x23')],'available':_0x365ab5[_0x1a0a('0x24')],'loggedIn':_0x365ab5[_0x1a0a('0x25')],'pTalking':_0x365ab5[_0x1a0a('0x26')],'sumBillable':_0x365ab5[_0x1a0a('0x27')],'sumDuration':_0x365ab5[_0x1a0a('0x28')],'sumHoldTime':_0x365ab5[_0x1a0a('0x29')]||0x0,'talking':_0x365ab5[_0x1a0a('0x2a')],'total':_0x365ab5[_0x1a0a('0x2b')],'type':_0x365ab5['type'],'unmanaged':_0x365ab5[_0x1a0a('0x2c')],'abandoned':_0x365ab5[_0x1a0a('0x2d')],'waiting':_0x365ab5[_0x1a0a('0x2e')],'loggedInDb':_0x365ab5[_0x1a0a('0x2f')]};if(_0x365ab5[_0x1a0a('0x30')]===_0x1a0a('0x31')){_0x244bbf[_0x1a0a('0x32')]=_0x365ab5[_0x1a0a('0x32')];_0x244bbf[_0x1a0a('0x33')]=_0x365ab5[_0x1a0a('0x33')];_0x244bbf['dialOriginateCallerIdName']=_0x365ab5[_0x1a0a('0x34')];_0x244bbf[_0x1a0a('0x35')]=_0x365ab5['dialOriginateCallerIdNumber'];_0x244bbf[_0x1a0a('0x36')]=_0x365ab5['dialOriginateTimeout'];_0x244bbf['dialPrefix']=_0x365ab5[_0x1a0a('0x37')];_0x244bbf[_0x1a0a('0x38')]=_0x365ab5['temp'];_0x244bbf[_0x1a0a('0x39')]=_0x365ab5[_0x1a0a('0x39')];_0x244bbf[_0x1a0a('0x3a')]=_0x365ab5['outboundAnswerCallsDay'];_0x244bbf[_0x1a0a('0x3b')]=_0x365ab5[_0x1a0a('0x3b')];_0x244bbf['outboundBusyCallsDay']=_0x365ab5[_0x1a0a('0x3c')];_0x244bbf[_0x1a0a('0x3d')]=_0x365ab5['outboundCongestionCallsDay'];_0x244bbf[_0x1a0a('0x3e')]=_0x365ab5[_0x1a0a('0x3e')];_0x244bbf[_0x1a0a('0x3f')]=_0x365ab5[_0x1a0a('0x3f')];_0x244bbf['outboundDropCallsDayTimeout']=_0x365ab5[_0x1a0a('0x40')];_0x244bbf[_0x1a0a('0x41')]=_0x365ab5[_0x1a0a('0x41')];_0x244bbf[_0x1a0a('0x42')]=_0x365ab5[_0x1a0a('0x42')];_0x244bbf[_0x1a0a('0x43')]=_0x365ab5[_0x1a0a('0x43')];_0x244bbf[_0x1a0a('0x44')]=_0x365ab5[_0x1a0a('0x44')];_0x244bbf['outboundRejectCallsDay']=_0x365ab5['outboundRejectCallsDay'];_0x244bbf['outboundUnknownCallsDay']=_0x365ab5['outboundUnknownCallsDay'];_0x244bbf[_0x1a0a('0x45')]=_0x365ab5['predictiveIntervalAnsweredCalls'];_0x244bbf[_0x1a0a('0x46')]=_0x365ab5[_0x1a0a('0x46')];_0x244bbf['predictiveIntervalAvgTalktime']=_0x365ab5['predictiveIntervalAvgTalktime'];_0x244bbf[_0x1a0a('0x47')]=_0x365ab5[_0x1a0a('0x47')];_0x244bbf[_0x1a0a('0x48')]=_0x365ab5[_0x1a0a('0x48')];_0x244bbf['predictiveIntervalErlangCalls']=_0x365ab5[_0x1a0a('0x49')];_0x244bbf['predictiveIntervalErlangCallsDroppedCalls']=_0x365ab5['predictiveIntervalErlangCallsDroppedCalls'];_0x244bbf['predictiveIntervalHitRate']=_0x365ab5[_0x1a0a('0x4a')];_0x244bbf[_0x1a0a('0x4b')]=_0x365ab5['predictiveIntervalMultiplicativeFactor'];_0x244bbf[_0x1a0a('0x4c')]=_0x365ab5[_0x1a0a('0x4c')];_0x244bbf['predictiveIntervalAvailable']=_0x365ab5['predictiveIntervalAvailable'];_0x244bbf[_0x1a0a('0x4d')]=_0x365ab5[_0x1a0a('0x4d')];_0x244bbf['message']=_0x365ab5[_0x1a0a('0x18')];_0x244bbf[_0x1a0a('0x4e')]=_0x365ab5['originated'];_0x244bbf[_0x1a0a('0x4f')]=_0x365ab5['erlangCalls'];_0x244bbf[_0x1a0a('0x50')]=_0x365ab5['erlangCallToSecond'];_0x244bbf[_0x1a0a('0x51')]=_0x365ab5[_0x1a0a('0x51')];_0x244bbf[_0x1a0a('0x52')]=_0x365ab5[_0x1a0a('0x52')];_0x244bbf['startPredictive']=_0x365ab5[_0x1a0a('0x53')];_0x244bbf[_0x1a0a('0x54')]=_0x365ab5[_0x1a0a('0x54')];}if(_0x365ab5[_0x1a0a('0x55')]){_0x244bbf['Trunk']={'id':_0x365ab5[_0x1a0a('0x55')]['id'],'name':_0x365ab5[_0x1a0a('0x55')]['name'],'active':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x56')],'callerid':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x57')]};}if(_0x365ab5[_0x1a0a('0x58')]){_0x244bbf[_0x1a0a('0x58')]={'id':_0x365ab5[_0x1a0a('0x58')]['id'],'name':_0x365ab5[_0x1a0a('0x58')][_0x1a0a('0x21')]};}_0x561407[_0x1a0a('0x59')](_0x244bbf);}}_0x1e2b28({'count':_0x561407['length'],'rows':_0x561407});});},'UpdateVoiceQueue':function(_0x35c133){return new Promise(function(_0x2a5a04,_0x4ba9ca){var _0x493083=_['find'](_0x27077a['voiceQueues'],{'id':parseInt(_0x35c133['id'])});var _0x455f57=_[_0x1a0a('0x5a')](_0x35c133,['id']);if(_0x493083){for(var _0x48711d in _0x455f57){if(typeof _0x455f57[_0x48711d]!=='undefined'&&typeof _0x493083[_0x48711d]!=='undefined'){_0x493083[_0x48711d]=_0x455f57[_0x48711d];}}_0x2a5a04(_0x493083);}else{_0x4ba9ca();}});},'VoiceChannels':function(_0x423f52){return new Promise(function(_0x1185e9,_0x144360){var _0x2c58a9=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x5c')]);_0x1185e9({'count':_0x2c58a9[_0x1a0a('0x5d')],'rows':_0x2c58a9});});},'VoiceChannelMixMonitor':function(_0x683bdc){var _0x9a2756=this;return new Promise(function(_0xf729c7,_0x1ed012){if(ami[_0x1a0a('0xf')]()==![]){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x14b07a=schema(properties[_0x1a0a('0x5e')])['validate'](_0x683bdc);if(_0x14b07a[_0x1a0a('0x5d')]>0x0){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,_['map'](_0x14b07a,'message')[_0x1a0a('0x13')](',\x20')));}var _0x498118=_['find'](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x683bdc['uniqueid']});if(_0x498118&&_0x498118[_0x1a0a('0x5f')]){var _0x217073=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x683bdc[_0x1a0a('0x61')]||_0x683bdc[_0x1a0a('0x62')],_0x683bdc[_0x1a0a('0x6')]||_0x1a0a('0x63'));return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x64'),'channel':_0x498118['channel'],'file':_0x217073,'options':_0x1a0a('0x65')})['then'](function(_0x9e897f){var _0x1e97d2=_['find'](_0x498118['monitors'],{'filename':_0x1a0a('0x66')+_0x217073[_0x1a0a('0x67')]()});if(_['isNil'](_0x1e97d2)){_0x498118['monitors'][_0x1a0a('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x217073[_0x1a0a('0x67')](),'createdAt':moment()[_0x1a0a('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')],'status':'rec'});}else{_0x1e97d2[_0x1a0a('0x68')]=_0x9e897f[_0x1a0a('0x68')];_0x1e97d2['status']=_0x1a0a('0x69');}_0xf729c7({'code':0xc8,'message':[_0x683bdc[_0x1a0a('0x62')],_0x1a0a('0x6a'),_0x9e897f['mixmonitorid']][_0x1a0a('0x13')]('\x20'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')]});})['catch'](function(_0x5dac09){_0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f5,[_0x683bdc[_0x1a0a('0x62')],_0x5dac09[_0x1a0a('0x18')][_0x1a0a('0x67')]()]['join']('\x20')));});}else{return _0x1ed012(_0x9a2756['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2fef04){var _0x5e1eaa=this;return new Promise(function(_0x10fd71,_0x2953c1){if(ami[_0x1a0a('0xf')]()==![]){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}var _0x34dd54=schema(properties[_0x1a0a('0x5e')])[_0x1a0a('0x2')](_0x2fef04);if(_0x34dd54[_0x1a0a('0x5d')]>0x0){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x34dd54,'message')[_0x1a0a('0x13')](',\x20')));}var _0x26cb74=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x2fef04['uniqueid']});if(_0x26cb74){return BPromise[_0x1a0a('0x6d')]()[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x6e'),'channel':_0x26cb74[_0x1a0a('0x5f')],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})[_0x1a0a('0x19')](function(_0x224eac){});}})[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x6f')]){return ami['Action']({'action':_0x1a0a('0x6e'),'channel':_0x26cb74['destinationchannel'],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})['catch'](function(_0x1c2b41){});}})[_0x1a0a('0x1d')](function(_0x3ccce6){var _0x1aadbd=_[_0x1a0a('0x6c')](_0x26cb74['monitors'],{'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]});if(_0x1aadbd){_0x1aadbd[_0x1a0a('0x70')]=_0x1a0a('0x71');}})[_0x1a0a('0x1d')](function(){var _0x36c617=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x2fef04['filename']||_0x2fef04[_0x1a0a('0x62')],_0x2fef04[_0x1a0a('0x6')]||_0x1a0a('0x63'));var _0x5e2d94=_['find'](_0x26cb74[_0x1a0a('0x72')],{'filename':_0x1a0a('0x66')+_0x36c617[_0x1a0a('0x67')]()});if(_0x5e2d94){_0x5e2d94[_0x1a0a('0x70')]=_0x1a0a('0x71');}})['then'](function(){_0x10fd71({'code':0xc8,'message':[_0x2fef04[_0x1a0a('0x62')],_0x1a0a('0x73')][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x4629b7){_0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,[_0x2fef04[_0x1a0a('0x62')],_0x4629b7[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')));});}else{return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x33a0eb){return new Promise(function(_0x239262,_0x1a903c){var _0x569ecb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x74')]);_0x239262({'count':_0x569ecb[_0x1a0a('0x5d')],'rows':_0x569ecb});});},'VoiceQueuesChannel':function(_0x2c757f){var _0xec020d=this;return new Promise(function(_0x471c4e,_0x3ef0cc){var _0x488f43=schema(properties[_0x1a0a('0x75')])[_0x1a0a('0x2')](_0x2c757f);if(_0x488f43[_0x1a0a('0x5d')]>0x0){return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x488f43,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x56756e=_[_0x1a0a('0x6c')](_0x27077a['queueChannels'],{'uniqueid':_0x2c757f[_0x1a0a('0x62')]});if(_0x56756e){_0x471c4e(_0x56756e);}else{return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelHangup':function(_0x221201){var _0x24cca3=this;return new Promise(function(_0x55ce61,_0x21baea){if(ami[_0x1a0a('0xf')]()==![]){return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x4f5e24=schema(properties[_0x1a0a('0x77')])[_0x1a0a('0x2')](_0x221201);if(_0x4f5e24[_0x1a0a('0x5d')]>0x0){return _0x21baea(_0x24cca3['error'](0x1f4,_[_0x1a0a('0x6b')](_0x4f5e24,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x4ef8e7=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x221201['uniqueid']});if(_0x4ef8e7&&_0x4ef8e7[_0x1a0a('0x5f')]){return ami['Action']({'action':'Hangup','channel':_0x4ef8e7[_0x1a0a('0x5f')]})[_0x1a0a('0x1d')](function(_0xeb1468){_0x55ce61({'code':0xc8,'message':[_0x221201[_0x1a0a('0x62')],_0xeb1468[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')});})[_0x1a0a('0x19')](function(_0x51d91f){_0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,[_0x221201[_0x1a0a('0x62')],_0x51d91f[_0x1a0a('0x18')]['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelRedirect':function(_0x3e5323){var _0x59e463=this;return new Promise(function(_0x348d33,_0x5b35a8){if(ami[_0x1a0a('0xf')]()==![]){return _0x5b35a8(_0x59e463['error'](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x190000=schema(properties[_0x1a0a('0x78')])[_0x1a0a('0x2')](_0x3e5323);if(_0x190000[_0x1a0a('0x5d')]>0x0){return _0x5b35a8(_0x59e463['error'](0x1f4,_[_0x1a0a('0x6b')](_0x190000,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x5c73ad=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x3e5323[_0x1a0a('0x62')]});if(_0x5c73ad&&_0x5c73ad[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x79'),'channel':_0x5c73ad[_0x1a0a('0x5f')],'exten':_0x3e5323['exten'],'context':_0x3e5323[_0x1a0a('0x7a')]||_0x5c73ad['context'],'priority':0x1})[_0x1a0a('0x1d')](function(_0x367830){_0x348d33({'code':0xc8,'message':[_0x3e5323['uniqueid'],_0x367830['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x21146e){_0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,[_0x3e5323[_0x1a0a('0x62')],_0x21146e['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x47fb42){return new Promise(function(_0x32fbc5,_0x32bab1){var _0xe85959=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0xb')]);_0x32fbc5({'count':_0xe85959[_0x1a0a('0x5d')],'rows':_0xe85959});});},'Telephones':function(_0x577e25){return new Promise(function(_0x116934,_0xf2bdec){var _0x50f111=_[_0x1a0a('0x5b')](_0x27077a['telephones']);_0x116934({'count':_0x50f111[_0x1a0a('0x5d')],'rows':_0x50f111});});},'Trunks':function(_0x48c39f){return new Promise(function(_0x5187b7,_0x534aeb){var _0x3767ef=_['values'](_0x27077a['trunks']);_0x5187b7({'count':_0x3767ef[_0x1a0a('0x5d')],'rows':_0x3767ef});});},'OutboundChannels':function(_0x45d13a){return new Promise(function(_0x5f3fe6,_0x1a8641){var _0x2400a6=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7b')]);_0x5f3fe6({'count':_0x2400a6['length'],'rows':_0x2400a6});});},'Outbound':function(_0x2d1482){return new Promise(function(_0x552617,_0x2b6e84){_0x552617(_0x27077a[_0x1a0a('0x31')]);});},'Campaigns':function(_0x420de6){return new Promise(function(_0x4ca92c,_0x5b87dd){var _0x18e50a=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7c')]);_0x4ca92c({'count':_0x18e50a[_0x1a0a('0x5d')],'rows':_0x18e50a});});},'VoiceQueuesPreview':function(_0x3f0ec9){var _0x260122=this;return new Promise(function(_0x106b45,_0x92a816){_0x31e85b[_0x1a0a('0x7d')](_0x3f0ec9['id'])[_0x1a0a('0x1d')](function(_0x1431af){_0x106b45({'code':0xc8,'message':_0x1431af[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x20cebc){_0x92a816(_0x260122[_0x1a0a('0x10')](0x1f4,_0x20cebc[_0x1a0a('0x18')]));});});},'EventManager':function(_0x3b8bb7){var _0x575bd=this;return new Promise(function(_0x2bf3a,_0x22ad6d){if(!_0x3b8bb7[_0x1a0a('0x7e')]){return _0x22ad6d(_0x575bd[_0x1a0a('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x1a0a('0x7f')]('custom:'+_0x3b8bb7[_0x1a0a('0x7e')],_0x3b8bb7['message']);_0x2bf3a({'code':0xc8,'message':_0x3b8bb7});});},'FaxAccounts':function(_0x2c632f){return new Promise(function(_0x36eb72,_0x4cdbf1){var _0x59c6fb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x80')]);_0x36eb72({'count':_0x59c6fb[_0x1a0a('0x5d')],'rows':_0x59c6fb});});},'SendFax':function(_0x5d46b3){var _0x4a18dc=this;return new Promise(function(_0x94f975,_0x1c5f0c){_0x4b5573[_0x1a0a('0x81')](_0x5d46b3)[_0x1a0a('0x1d')](function(_0x59eafe){_0x94f975({'code':0xc8,'message':_0x59eafe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x12e46f){_0x1c5f0c(_0x4a18dc[_0x1a0a('0x10')](0x1f4,_0x12e46f[_0x1a0a('0x18')]));});});},'CheckAfterSend':function(_0x159137){var _0x20d586=this;return new Promise(function(_0xe3e686,_0x2c8065){_0x4b5573[_0x1a0a('0x82')](_0x159137)[_0x1a0a('0x1d')](function(_0x269a94){_0xe3e686({'code':0xc8,'message':_0x269a94[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x3754a7){_0x2c8065(_0x20d586[_0x1a0a('0x10')](0x1f4,_0x3754a7['message']));});});}};var _0x57ef20=jayson[_0x1a0a('0x83')](_0x3fe29f)[_0x1a0a('0x84')]();_0x57ef20['on']('error',function(_0x1ac840){return _0xe59f97(_0x1ac840);});_0x57ef20[_0x1a0a('0x85')](0x232a,_0x1a0a('0x86'),function(){console[_0x1a0a('0x87')](_0x1a0a('0x88'),0x232a);return _0x2d4b04('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 c1c19d5..b8ff932 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 _0x8d0e=['destcalleridnum','calleridname','','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','info','[CM][%s][%s]','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','$or','map','calleridnum','firstName','lastName','phone','fax','union','resolve','then','getContacts','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','routeId'];(function(_0x2d2adc,_0x2ac201){var _0x5c50a0=function(_0x3db540){while(--_0x3db540){_0x2d2adc['push'](_0x2d2adc['shift']());}};_0x5c50a0(++_0x2ac201);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x341220,_0x4e745e){_0x341220=_0x341220-0x0;var _0x144807=_0x8d0e[_0x341220];return _0x144807;};'use strict';var _=require(_0xe8d0('0x0'));var BPromise=require(_0xe8d0('0x1'));var Redis=require(_0xe8d0('0x2'));var util=require(_0xe8d0('0x3'));var config=require(_0xe8d0('0x4'));var logger=require(_0xe8d0('0x5'))(_0xe8d0('0x6'));var cmContactRpc=require(_0xe8d0('0x7'));config[_0xe8d0('0x8')]=_['defaults'](config[_0xe8d0('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe8d0('0x8')]));function emit(_0x92483d,_0x469d37,_0xcc03d0,_0x2b6dce,_0x13aa63){logger[_0xe8d0('0x9')](_0xe8d0('0xa'),_0x92483d,_0x469d37['id'],_0xcc03d0,_0x2b6dce,JSON['stringify'](_0x13aa63));io['to'](_0xcc03d0)[_0xe8d0('0xb')](_0x2b6dce,_0x13aa63);}exports[_0xe8d0('0xc')]=function(_0x463159,_0x599bc3,_0x580aab,_0x42e0c2){var _0x25e6b8,_0x3da047;var _0x10b345={};var _0x314657=Number(_0x580aab[_0xe8d0('0xd')]);var _0x5934b2=_0x580aab[_0xe8d0('0xe')]?Boolean(Number(_0x580aab[_0xe8d0('0xe')])):![];var _0x533b42;var _0x2b640d=![];if(!_['isNil'](_0x580aab['data5'])){if(_0x580aab[_0xe8d0('0xf')]=='1')_0x2b640d=!![];}if(!_0x2b640d){if(_0x42e0c2[_0xe8d0('0x10')]){_0x10b345['id']=_0x42e0c2[_0xe8d0('0x10')];}}if(!_0x10b345['id']){_0x10b345[_0xe8d0('0x11')]=_0x314657;_0x533b42=_0x580aab[_0xe8d0('0x12')]&&_0x580aab[_0xe8d0('0x12')]!=='0'?_0x580aab['data3'][_0xe8d0('0x13')](','):['phone'];_0x10b345[_0xe8d0('0x14')]=_[_0xe8d0('0x15')](_0x533b42,function(_0xfe8a4){var _0x4d1db4={};_0x4d1db4[_0xfe8a4]=_0x42e0c2['routeId']?_0x42e0c2['destcalleridnum']:_0x42e0c2[_0xe8d0('0x16')];return _0x4d1db4;});}var _0x384854=['id',_0xe8d0('0x17'),_0xe8d0('0x18'),_0xe8d0('0x19'),'mobile',_0xe8d0('0x1a'),_0xe8d0('0x11'),'createdAt','scheduledAt','updatedAt'];var _0x384a60=_[_0xe8d0('0x1b')](_0x384854,_0x533b42);BPromise[_0xe8d0('0x1c')]()[_0xe8d0('0x1d')](cmContactRpc[_0xe8d0('0x1e')]({'attributes':_0x384a60,'where':_0x10b345}))[_0xe8d0('0x1d')](function(_0x1bd25c){_0x3da047=_0x1bd25c;if(!_[_0xe8d0('0x1f')](_0x3da047)){if(_0x3da047[_0xe8d0('0x20')]===0x1){_0x25e6b8=_0x3da047[0x0];logger['info'](_0xe8d0('0x21'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id'],_0x25e6b8['id']);}else{logger['info'](_0xe8d0('0x23'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id'],_[_0xe8d0('0x15')](_0x3da047,'id')[_0xe8d0('0x24')](','));}return;}else{logger[_0xe8d0('0x9')](_0xe8d0('0x25'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id']);var _0x32f0c1={'ListId':_0x314657};var _0xfa3527=_0x580aab[_0xe8d0('0x26')]&&_0x580aab[_0xe8d0('0x26')]!=='0'?_0x580aab['data4']:_0xe8d0('0x19');if(_0x5934b2){logger[_0xe8d0('0x9')](_0xe8d0('0x27'),_0x42e0c2['uniqueid'],_0x599bc3['id']);_0x32f0c1[_0xfa3527]=_[_0xe8d0('0x28')](_0x42e0c2[_0xe8d0('0x29')])?_0x42e0c2['calleridnum']:_0x42e0c2[_0xe8d0('0x2a')];if(_[_0xe8d0('0x28')](_0x42e0c2[_0xe8d0('0x29')])){_0x32f0c1[_0xe8d0('0x17')]=_0x42e0c2[_0xe8d0('0x2b')]&&_0x42e0c2['calleridname']!==_0xe8d0('0x2c')?_0x42e0c2['calleridname']:'Unknown';}else{_0x32f0c1['firstName']=_0x42e0c2[_0xe8d0('0x2d')]&&_0x42e0c2[_0xe8d0('0x2d')]!==_0xe8d0('0x2c')?_0x42e0c2['destcalleridname']:'Unknown';}return BPromise[_0xe8d0('0x1c')]()['then'](cmContactRpc[_0xe8d0('0x2e')](_0x32f0c1))[_0xe8d0('0x1d')](function(_0x327004){_0x25e6b8=_0x327004;_0x3da047[_0xe8d0('0x2f')](_0x327004);if(_0x25e6b8){logger[_0xe8d0('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id'],_0x25e6b8['id']);}return;});}else{logger[_0xe8d0('0x9')](_0xe8d0('0x30'),_0x42e0c2[_0xe8d0('0x22')],_0x599bc3['id']);_0x32f0c1[_0xfa3527]=_['isNil'](_0x42e0c2[_0xe8d0('0x29')])?_0x42e0c2[_0xe8d0('0x16')]:_0x42e0c2['destcalleridnum'];if(_[_0xe8d0('0x28')](_0x42e0c2['routeId'])){_0x32f0c1[_0xe8d0('0x17')]=_0x42e0c2['calleridname']&&_0x42e0c2[_0xe8d0('0x2b')]!==''?_0x42e0c2[_0xe8d0('0x2b')]:_0xe8d0('0x31');}else{_0x32f0c1[_0xe8d0('0x17')]=_0x42e0c2[_0xe8d0('0x2d')]&&_0x42e0c2['destcalleridname']!==_0xe8d0('0x2c')?_0x42e0c2[_0xe8d0('0x2d')]:_0xe8d0('0x31');}_0x25e6b8=_0x32f0c1;_0x3da047['push'](_0x32f0c1);return;}}})[_0xe8d0('0x1d')](function(){if(_0x463159){emit(_0x42e0c2[_0xe8d0('0x22')],_0x599bc3,util[_0xe8d0('0x32')](_0xe8d0('0x33'),_0x463159[_0xe8d0('0x34')]),util['format'](_0xe8d0('0x35'),_0x580aab[_0xe8d0('0x36')][_0xe8d0('0x37')]()),{'evt':_[_0xe8d0('0x38')](_0x42e0c2,{'autoCreate':_0x5934b2}),'contact':_0x25e6b8===undefined?{}:_0x25e6b8,'contacts':_0x3da047[_0xe8d0('0x20')]===0x0?undefined:_0x3da047});}});}; \ No newline at end of file +var _0x9a19=['data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','createdAt','updatedAt','resolve','getContacts','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','emit','exec'];(function(_0xe0544a,_0x311095){var _0x357adf=function(_0x5c591d){while(--_0x5c591d){_0xe0544a['push'](_0xe0544a['shift']());}};_0x357adf(++_0x311095);}(_0x9a19,0x114));var _0x99a1=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x9a19[_0x4551f6];return _0x581dc2;};'use strict';var _=require(_0x99a1('0x0'));var BPromise=require(_0x99a1('0x1'));var Redis=require(_0x99a1('0x2'));var util=require('util');var config=require(_0x99a1('0x3'));var logger=require(_0x99a1('0x4'))(_0x99a1('0x5'));var cmContactRpc=require(_0x99a1('0x6'));config[_0x99a1('0x7')]=_[_0x99a1('0x8')](config[_0x99a1('0x7')],{'host':_0x99a1('0x9'),'port':0x18eb});var io=require(_0x99a1('0xa'))(new Redis(config[_0x99a1('0x7')]));function emit(_0x65045d,_0x523b9e,_0x4d2a5c,_0x5aa6c2,_0x56f50){logger[_0x99a1('0xb')]('[CM][%s][%s]',_0x65045d,_0x523b9e['id'],_0x4d2a5c,_0x5aa6c2,JSON['stringify'](_0x56f50));io['to'](_0x4d2a5c)[_0x99a1('0xc')](_0x5aa6c2,_0x56f50);}exports[_0x99a1('0xd')]=function(_0x23db53,_0x26473f,_0x1551a1,_0x537032){var _0x28ee99,_0xdd29e1;var _0x27d65f={};var _0x418dee=Number(_0x1551a1[_0x99a1('0xe')]);var _0x1bc7aa=_0x1551a1[_0x99a1('0xf')]?Boolean(Number(_0x1551a1[_0x99a1('0xf')])):![];var _0xf713b9;var _0x40c19c=![];if(!_[_0x99a1('0x10')](_0x1551a1[_0x99a1('0x11')])){if(_0x1551a1[_0x99a1('0x11')]=='1')_0x40c19c=!![];}if(!_0x40c19c){if(_0x537032[_0x99a1('0x12')]){_0x27d65f['id']=_0x537032[_0x99a1('0x12')];}}if(!_0x27d65f['id']){_0x27d65f['ListId']=_0x418dee;_0xf713b9=_0x1551a1[_0x99a1('0x13')]&&_0x1551a1[_0x99a1('0x13')]!=='0'?_0x1551a1[_0x99a1('0x13')][_0x99a1('0x14')](','):[_0x99a1('0x15')];_0x27d65f[_0x99a1('0x16')]=_[_0x99a1('0x17')](_0xf713b9,function(_0x4e645b){var _0x4f049c={};_0x4f049c[_0x4e645b]=_0x537032[_0x99a1('0x18')]?_0x537032[_0x99a1('0x19')]:_0x537032[_0x99a1('0x1a')];return _0x4f049c;});}var _0x1fcd00=['id',_0x99a1('0x1b'),_0x99a1('0x1c'),_0x99a1('0x15'),_0x99a1('0x1d'),_0x99a1('0x1e'),_0x99a1('0x1f'),_0x99a1('0x20'),'scheduledAt',_0x99a1('0x21')];var _0x20007e=_['union'](_0x1fcd00,_0xf713b9);BPromise[_0x99a1('0x22')]()['then'](cmContactRpc[_0x99a1('0x23')]({'attributes':_0x20007e,'where':_0x27d65f}))[_0x99a1('0x24')](function(_0x2d6f20){_0xdd29e1=_0x2d6f20;if(!_[_0x99a1('0x25')](_0xdd29e1)){if(_0xdd29e1['length']===0x1){_0x28ee99=_0xdd29e1[0x0];logger[_0x99a1('0xb')](_0x99a1('0x26'),_0x537032['uniqueid'],_0x26473f['id'],_0x28ee99['id']);}else{logger[_0x99a1('0xb')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x537032[_0x99a1('0x27')],_0x26473f['id'],_[_0x99a1('0x17')](_0xdd29e1,'id')[_0x99a1('0x28')](','));}return;}else{logger[_0x99a1('0xb')](_0x99a1('0x29'),_0x537032[_0x99a1('0x27')],_0x26473f['id']);var _0x4fe7f7={'ListId':_0x418dee};var _0x114b38=_0x1551a1['data4']&&_0x1551a1['data4']!=='0'?_0x1551a1[_0x99a1('0x2a')]:_0x99a1('0x15');if(_0x1bc7aa){logger[_0x99a1('0xb')](_0x99a1('0x2b'),_0x537032[_0x99a1('0x27')],_0x26473f['id']);_0x4fe7f7[_0x114b38]=_[_0x99a1('0x10')](_0x537032[_0x99a1('0x18')])?_0x537032['calleridnum']:_0x537032[_0x99a1('0x19')];if(_['isNil'](_0x537032[_0x99a1('0x18')])){_0x4fe7f7[_0x99a1('0x1b')]=_0x537032[_0x99a1('0x2c')]&&_0x537032['calleridname']!==_0x99a1('0x2d')?_0x537032[_0x99a1('0x2c')]:'Unknown';}else{_0x4fe7f7[_0x99a1('0x1b')]=_0x537032[_0x99a1('0x2e')]&&_0x537032[_0x99a1('0x2e')]!==_0x99a1('0x2d')?_0x537032[_0x99a1('0x2e')]:_0x99a1('0x2f');}return BPromise[_0x99a1('0x22')]()[_0x99a1('0x24')](cmContactRpc['createContact'](_0x4fe7f7))['then'](function(_0x3fa342){_0x28ee99=_0x3fa342;_0xdd29e1['push'](_0x3fa342);if(_0x28ee99){logger[_0x99a1('0xb')](_0x99a1('0x30'),_0x537032['uniqueid'],_0x26473f['id'],_0x28ee99['id']);}return;});}else{logger[_0x99a1('0xb')](_0x99a1('0x31'),_0x537032[_0x99a1('0x27')],_0x26473f['id']);_0x4fe7f7[_0x114b38]=_[_0x99a1('0x10')](_0x537032[_0x99a1('0x18')])?_0x537032[_0x99a1('0x1a')]:_0x537032[_0x99a1('0x19')];if(_[_0x99a1('0x10')](_0x537032[_0x99a1('0x18')])){_0x4fe7f7[_0x99a1('0x1b')]=_0x537032[_0x99a1('0x2c')]&&_0x537032[_0x99a1('0x2c')]!==_0x99a1('0x2d')?_0x537032[_0x99a1('0x2c')]:'Unknown';}else{_0x4fe7f7['firstName']=_0x537032[_0x99a1('0x2e')]&&_0x537032[_0x99a1('0x2e')]!==_0x99a1('0x2d')?_0x537032[_0x99a1('0x2e')]:_0x99a1('0x2f');}_0x28ee99=_0x4fe7f7;_0xdd29e1[_0x99a1('0x32')](_0x4fe7f7);return;}}})[_0x99a1('0x24')](function(){if(_0x23db53){emit(_0x537032['uniqueid'],_0x26473f,util[_0x99a1('0x33')](_0x99a1('0x34'),_0x23db53['name']),util[_0x99a1('0x33')](_0x99a1('0x35'),_0x1551a1[_0x99a1('0x36')][_0x99a1('0x37')]()),{'evt':_[_0x99a1('0x38')](_0x537032,{'autoCreate':_0x1bc7aa}),'contact':_0x28ee99===undefined?{}:_0x28ee99,'contacts':_0xdd29e1[_0x99a1('0x39')]===0x0?undefined:_0xdd29e1});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c51864e..59b72d8 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 _0xc2f5=['custom:substatus','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','undefined','voice','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','action','contactmanager','browser','data1','TemplateId','html','data2','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','600','data6','winApplication','render','format','name','trigger:%s:%s','toLowerCase','user:%s','trigger:%s','exec','integration','queue','routeId','script','parse','search','replace','AllConditions','every','checkConditions','channel','AnyConditions','field','account','chat','ChatWebsiteId','operator','AccountId','value','upperFirst','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','exports','util','lodash','url','mustache','./urlforward','../../../config/logger','trigger','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:newinteraction'];(function(_0x66d8c7,_0x470d0f){var _0x417254=function(_0x4c0647){while(--_0x4c0647){_0x66d8c7['push'](_0x66d8c7['shift']());}};_0x417254(++_0x470d0f);}(_0xc2f5,0xc0));var _0x5c2f=function(_0x3c13f0,_0x71a1d0){_0x3c13f0=_0x3c13f0-0x0;var _0x336364=_0xc2f5[_0x3c13f0];return _0x336364;};'use strict';var util=require(_0x5c2f('0x0'));var _=require(_0x5c2f('0x1'));var url=require(_0x5c2f('0x2'));var Mustache=require(_0x5c2f('0x3'));var Redis=require('ioredis');var urlforward=require(_0x5c2f('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x5c2f('0x5'))(_0x5c2f('0x6'));var ami=require(_0x5c2f('0x7'));config[_0x5c2f('0x8')]=_['defaults'](config['redis'],{'host':_0x5c2f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c2f('0x8')]));var operators={'equals':function(_0x46664d,_0x1b74a8){return _0x46664d==_0x1b74a8;},'not_equals':function(_0x1a1970,_0x26102a){return _0x1a1970!=_0x26102a;}};var barAndWebActions=[_0x5c2f('0xa'),_0x5c2f('0x2'),_0x5c2f('0xb')];function Trigger(_0x3d0f37){this[_0x5c2f('0xc')]=_0x3d0f37[_0x5c2f('0xc')];this[_0x5c2f('0xd')]=_0x3d0f37['agents'];this[_0x5c2f('0xe')]=_0x3d0f37[_0x5c2f('0xe')];this['templates']=_0x3d0f37[_0x5c2f('0xf')];this[_0x5c2f('0x10')]=_0x3d0f37[_0x5c2f('0x10')];this[_0x5c2f('0x11')]=_0x3d0f37[_0x5c2f('0x11')];this[_0x5c2f('0x12')]=_0x3d0f37['freshdeskAccounts'];this[_0x5c2f('0x13')]=_0x3d0f37[_0x5c2f('0x13')];this[_0x5c2f('0x14')]=_0x3d0f37[_0x5c2f('0x14')];this[_0x5c2f('0x15')]=_0x3d0f37[_0x5c2f('0x15')];this[_0x5c2f('0x16')]=_0x3d0f37['deskAccounts'];this[_0x5c2f('0x17')]=_0x3d0f37[_0x5c2f('0x17')];this[_0x5c2f('0x18')]=_0x3d0f37['servicenowAccounts'];this[_0x5c2f('0x19')]=_0x3d0f37[_0x5c2f('0x19')];this[_0x5c2f('0x1a')]=_0x3d0f37['freshsalesAccounts'];this[_0x5c2f('0x1b')]={'zendesk':this[_0x5c2f('0x11')],'salesforce':this[_0x5c2f('0x13')],'freshdesk':this[_0x5c2f('0x12')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x5c2f('0x15')],'desk':this[_0x5c2f('0x16')],'vtiger':this[_0x5c2f('0x17')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x5c2f('0x1a')],'servicenow':this[_0x5c2f('0x18')]};ami['on'](_0x5c2f('0x1c'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x1f'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x20'),this[_0x5c2f('0x1d')]['bind'](this));ami['on']('custom:agentcomplete',this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x21'),this[_0x5c2f('0x1d')]['bind'](this));ami['on'](_0x5c2f('0x22'),this[_0x5c2f('0x1d')]['bind'](this));ami['on'](_0x5c2f('0x23'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x24'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x25'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x26'),this['syncCustomEvent'][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x27'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x28'),this['syncCustomEvent'][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x29'),this['syncAgentDial'][_0x5c2f('0x1e')](this));ami['on']('custom:dialconnect',this[_0x5c2f('0x2a')][_0x5c2f('0x1e')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x2b'),this['syncCustomEvent'][_0x5c2f('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x2c'),this['syncCustomEvent'][_0x5c2f('0x1e')](this));ami['on']('custom:incomingmessage',this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on'](_0x5c2f('0x2d'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0x5c2f('0x2e'),this[_0x5c2f('0x1d')][_0x5c2f('0x1e')](this));}Trigger[_0x5c2f('0x2f')][_0x5c2f('0x30')]=function(_0x29c71c,_0x4b5584,_0x4dde4d){logger[_0x5c2f('0x31')](_0x29c71c,_0x4b5584,JSON[_0x5c2f('0x32')](_0x4dde4d));io['to'](_0x29c71c)['emit'](_0x4b5584,_0x4dde4d);};Trigger[_0x5c2f('0x2f')][_0x5c2f('0x1d')]=function(_0x3eedea){var _0x5cecd1=_[_0x5c2f('0x33')](_0x3eedea);if(typeof _0x5cecd1['motionChannel']===_0x5c2f('0x34')){_0x5cecd1['motionChannel']=_0x5c2f('0x35');}this[_0x5c2f('0x36')](_0x5cecd1);};Trigger[_0x5c2f('0x2f')][_0x5c2f('0x2a')]=function(_0xccd5c4){if(this['agents'][_0xccd5c4[_0x5c2f('0x37')]]){this[_0x5c2f('0x1d')](_0xccd5c4);}};Trigger['prototype']['checkTriggers']=function(_0x48b89a){var _0x1df56f;for(var _0x3241aa in this[_0x5c2f('0xc')]){if(this[_0x5c2f('0xc')][_0x5c2f('0x38')](_0x3241aa)){if(this[_0x5c2f('0xc')][_0x3241aa]['status']){_0x1df56f=this[_0x5c2f('0x39')](this[_0x5c2f('0xc')][_0x3241aa],_0x48b89a);if(_0x1df56f){_[_0x5c2f('0x3a')](_0x48b89a,_0x48b89a[_0x5c2f('0x3b')]);for(var _0x35a988=0x0,_0x37bb5f,_0x5b764d,_0x4bfa93;_0x35a9880x0){_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 _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x183192,_0x2e12f0){var _0x344e0f=function(_0x5d6d0c){while(--_0x5d6d0c){_0x183192['push'](_0x183192['shift']());}};_0x344e0f(++_0x2e12f0);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ 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 8287f95..f04f5d5 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 _0x80ed=['outbound','destcalleridnum','calleridnum','contacts','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','customField','indexOf','content','ticketType','incident','incidents','getString','Subjects','/systemusers(','phonecall','phonecalls','assign','queue','callDirection','/contacts(','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','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]','recordingURL','recordingFormat','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','info','systemuserid','userId','toUpperCase','userEmail','toLowerCase'];(function(_0x11298b,_0x17cdf0){var _0xe879e8=function(_0x2b475e){while(--_0x2b475e){_0x11298b['push'](_0x11298b['shift']());}};_0xe879e8(++_0x17cdf0);}(_0x80ed,0xa1));var _0xd80e=function(_0xb6df,_0x17ec3b){_0xb6df=_0xb6df-0x0;var _0x4cf499=_0x80ed[_0xb6df];return _0x4cf499;};'use strict';var _=require(_0xd80e('0x0'));var BPromise=require(_0xd80e('0x1'));var rp=require(_0xd80e('0x2'));var util=require(_0xd80e('0x3'));var intUtil=require(_0xd80e('0x4'));var md5=require(_0xd80e('0x5'));var Redis=require('ioredis');var logger=require(_0xd80e('0x6'))('dynamics365');var config=require(_0xd80e('0x7'));config[_0xd80e('0x8')]=_[_0xd80e('0x9')](config[_0xd80e('0x8')],{'host':_0xd80e('0xa'),'port':0x18eb});var io=require(_0xd80e('0xb'))(new Redis(config[_0xd80e('0x8')]));function getAuthToken(_0x240858,_0x2a8339,_0x16c53d){var _0x4766f9={'method':_0xd80e('0xc'),'uri':_0x2a8339,'form':{'client_id':_0x240858[_0xd80e('0xd')],'resource':_0x240858[_0xd80e('0xe')],'username':_0x240858[_0xd80e('0xf')],'password':_0x240858[_0xd80e('0x10')],'grant_type':_0xd80e('0x10'),'client_secret':_0x240858[_0xd80e('0x11')]},'json':!![]};return rp(_0x4766f9)[_0xd80e('0x12')](function(_0x590a55){return _0x590a55[_0xd80e('0x13')];})[_0xd80e('0x14')](function(_0x86d45b){logger['error']('['+[_0x16c53d['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x86d45b[_0xd80e('0x15')];});}function getUser(_0x5c7204,_0x1a616c,_0x20ef8a,_0x53a214,_0x271095,_0x35f542){return new BPromise(function(_0x490218,_0x53f577){return getAuthToken(_0x1a616c,_0x53a214,_0x35f542)[_0xd80e('0x12')](function(_0x1e8144){var _0x5f3bba={'method':'GET','uri':_0x271095+_0xd80e('0x16'),'headers':{'Authorization':_0xd80e('0x17')+_0x1e8144,'OData-Version':_0xd80e('0x18')},'json':!![]};return rp(_0x5f3bba);})['then'](function(_0x2befdc){var _0x51bc6c=_0x2befdc[_0xd80e('0x19')];var _0x56ea99=![];var _0x48f009=null;if(!_[_0xd80e('0x1a')](_0x20ef8a)){if(intUtil[_0xd80e('0x1b')](_0x20ef8a[_0xd80e('0x1c')])){_0x5c7204['userEmail']=_0x20ef8a[_0xd80e('0x1c')];for(_0x48f009=0x0;_0x48f009<_0x51bc6c[_0xd80e('0x1d')];_0x48f009++){if(_0x51bc6c[_0x48f009][_0xd80e('0x1e')]===_0x20ef8a[_0xd80e('0x1c')]&&!_0x51bc6c[_0x48f009]['isdisabled']){_0x56ea99=!![];logger[_0xd80e('0x1f')]('['+[_0x35f542['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x51bc6c[_0x48f009][_0xd80e('0x20')]+'!');_0x5c7204[_0xd80e('0x21')]=_0x51bc6c[_0x48f009][_0xd80e('0x20')];}}}}if(!_0x56ea99){logger[_0xd80e('0x1f')]('['+[_0x35f542[_0xd80e('0x22')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x5c7204[_0xd80e('0x23')]=_0x1a616c['username'];for(_0x48f009=0x0;_0x48f009<_0x51bc6c['length'];_0x48f009++){if(_0x51bc6c[_0x48f009][_0xd80e('0x1e')]===_0x1a616c[_0xd80e('0xf')]){_0x5c7204['userId']=_0x51bc6c[_0x48f009][_0xd80e('0x20')];}}}_0x490218(_0x5c7204);})[_0xd80e('0x14')](function(_0x24c126){_0x53f577(_0x24c126[_0xd80e('0x15')]);});});}function createEndUser(_0x3660db,_0x1d773d,_0x1ad91b,_0x29a927,_0x1f7440,_0x4328a4){return new BPromise(function(_0x284e87,_0x84acdc){return getAuthToken(_0x1d773d,_0x1ad91b,_0x4328a4)[_0xd80e('0x12')](function(_0x4829ed){var _0x2e8bd5=_0x4328a4[_0xd80e('0x24')]()===_0xd80e('0x25')?_0x1f7440[_0xd80e('0x26')]:_0x1f7440[_0xd80e('0x27')];var _0x18c682={'method':_0xd80e('0xc'),'uri':_0x29a927+_0xd80e('0x28'),'body':{'telephone1':_0x2e8bd5,'fullname':_0x2e8bd5,'firstname':_0x2e8bd5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3660db[_0xd80e('0x21')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4829ed,'OData-Version':_0xd80e('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x18c682);})['then'](function(_0x59032b){var _0x46fa3d=_0x59032b['headers'][_0xd80e('0x29')];var _0x1bd0d1=_0x46fa3d[_0xd80e('0x2a')](_0x46fa3d[_0xd80e('0x2b')]('(')+0x1,_0x46fa3d[_0xd80e('0x2b')](')'));_0x3660db[_0xd80e('0x2c')]=_0x1bd0d1;_0x284e87(_0x3660db);})[_0xd80e('0x14')](function(_0x286782){_0x84acdc(_0x286782[_0xd80e('0x15')]);});});}function getEndUser(_0x16165f,_0x4f4190,_0x397719,_0x36ba35,_0x352b92,_0x19eb6c){return new BPromise(function(_0x4f9314,_0x5d7f74){var _0x347d5c=_0x19eb6c[_0xd80e('0x24')]()===_0xd80e('0x25')?_0x352b92[_0xd80e('0x26')]:_0x352b92[_0xd80e('0x27')];return getAuthToken(_0x4f4190,_0x397719,_0x19eb6c)[_0xd80e('0x12')](function(_0x8bacda){var _0x1b5a9b={'method':_0xd80e('0x2d'),'uri':_0x36ba35+_0xd80e('0x2e')+_0x347d5c['replace']('+',_0xd80e('0x2f'))+'\x27','headers':{'Authorization':_0xd80e('0x17')+_0x8bacda,'If-None-Match':null,'OData-Version':_0xd80e('0x18')},'json':!![]};return rp(_0x1b5a9b);})[_0xd80e('0x12')](function(_0x7a1b2e){var _0x5cdb59=null;if(_0x7a1b2e){var _0x39ce4b=_0x7a1b2e[_0xd80e('0x19')];var _0x528110=![];for(_0x5cdb59=0x0;_0x5cdb59<_0x39ce4b[_0xd80e('0x1d')];_0x5cdb59++){if(_0x39ce4b[_0x5cdb59][_0xd80e('0x30')]===_0x347d5c){_0x528110=!![];_0x16165f[_0xd80e('0x2c')]=_0x39ce4b[_0x5cdb59][_0xd80e('0x31')];}}if(_0x528110){_0x4f9314(_0x16165f);}else{return createEndUser(_0x16165f,_0x4f4190,_0x397719,_0x36ba35,_0x352b92,_0x19eb6c)[_0xd80e('0x12')](function(_0x5371cd){logger[_0xd80e('0x1f')]('['+[_0x19eb6c[_0xd80e('0x22')]()]+_0xd80e('0x32'),_0x5371cd[_0xd80e('0x2c')]);_0x4f9314(_0x5371cd);});}}else{return createEndUser(_0x16165f,_0x4f4190,_0x397719,_0x36ba35,_0x352b92,_0x19eb6c)[_0xd80e('0x12')](function(_0x3fa269){logger[_0xd80e('0x1f')]('['+[_0x19eb6c[_0xd80e('0x22')]()]+_0xd80e('0x33'),_0x3fa269[_0xd80e('0x2c')]);_0x4f9314(_0x3fa269);});}});});}function getCustomFields(_0x1ca033,_0x42715e,_0x352060){var _0x409f6d={};if(_0x1ca033['length']>0x0){_[_0xd80e('0x34')](_0x1ca033,function(_0x3db0d5){if(_[_0xd80e('0x35')]([_0xd80e('0x36'),'picklist'],_0x3db0d5[_0xd80e('0x37')])&&_0x3db0d5['nameField']&&!_0x3db0d5[_0xd80e('0x38')]){var _0x51d98e=_0x3db0d5['idField'][_0xd80e('0x24')]();var _0x256d8=_0x51d98e[_0xd80e('0x2a')](0x0,_0x51d98e['indexOf']('_'));var _0x420739=_0x51d98e[_0xd80e('0x2a')](_0x51d98e[_0xd80e('0x39')]('_')+0x1);if(_0x256d8===_0x352060){_0x409f6d[_0x420739]=_0x3db0d5[_0xd80e('0x3a')];}}});}return _0x409f6d;}function getTicket(_0x404dea,_0x4fe044,_0x42cb86,_0x105be7,_0xd59e07,_0x3b18eb,_0xbb2761){return new BPromise(function(_0x216de1,_0x29820d){var _0x39afea;return getAuthToken(_0x4fe044,_0x42cb86,_0xbb2761)['then'](function(_0x4d735d){if(_0x3b18eb[_0xd80e('0x3b')]===_0xd80e('0x3c')){_0x39afea={'method':_0xd80e('0xc'),'uri':_0x105be7+_0xd80e('0x3d'),'body':Object['assign']({},{'title':intUtil[_0xd80e('0x3e')](_0x3b18eb[_0xd80e('0x3f')],_0xd59e07,'\x20'),'description':intUtil[_0xd80e('0x3e')](_0x3b18eb['Descriptions'],_0xd59e07,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x404dea[_0xd80e('0x2c')]+')','ownerid@odata.bind':_0xd80e('0x40')+_0x404dea[_0xd80e('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x3b18eb['Fields'],_0xd59e07,_0x3b18eb[_0xd80e('0x3b')])),'headers':{'Authorization':_0xd80e('0x17')+_0x4d735d,'OData-Version':_0xd80e('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3b18eb['ticketType']===_0xd80e('0x41')){_0x39afea={'method':_0xd80e('0xc'),'uri':_0x105be7+_0xd80e('0x42'),'body':Object[_0xd80e('0x43')]({},{'subject':intUtil[_0xd80e('0x3e')](_0x3b18eb[_0xd80e('0x3f')],_0xd59e07,'\x20'),'phonenumber':String(_0xd59e07[_0xd80e('0x27')]),'description':intUtil[_0xd80e('0x3e')](_0x3b18eb['Descriptions'],_0xd59e07,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x404dea[_0xd80e('0x2c')]+')','ownerid@odata.bind':_0xd80e('0x40')+_0x404dea[_0xd80e('0x21')]+')','directioncode':_0x404dea['callDirection']===_0xd80e('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xd80e('0x40')+_0x404dea[_0xd80e('0x21')]+')','participationtypemask':_0x404dea[_0xd80e('0x45')]===_0xd80e('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0xd80e('0x46')+_0x404dea['enduserId']+')','participationtypemask':_0x404dea['callDirection']===_0xd80e('0x44')?0x1:0x2}]},getCustomFields(_0x3b18eb[_0xd80e('0x47')],_0xd59e07,_0x3b18eb[_0xd80e('0x3b')])),'headers':{'Authorization':_0xd80e('0x17')+_0x4d735d,'OData-Version':_0xd80e('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x39afea);})[_0xd80e('0x12')](function(_0x2ed75d){var _0x2d84eb=_0x2ed75d['headers']['odata-entityid'];var _0x5775de=_0x2d84eb[_0xd80e('0x2a')](_0x2d84eb['lastIndexOf']('(')+0x1,_0x2d84eb['lastIndexOf'](')'));_0x404dea[_0xd80e('0x48')]=_0x5775de;_0x216de1(_0x404dea);})[_0xd80e('0x14')](function(_0x399d36){_0x29820d(_0x399d36[_0xd80e('0x15')]);});});}function emit(_0xb8e03c,_0x50677b,_0x5032ce,_0x3c156f){var _0x2db767={'uri':util['format'](_0xd80e('0x49'),_0xb8e03c,_0x5032ce,_0x3c156f)};io['to'](util[_0xd80e('0x4a')]('user:%s',_0x50677b))[_0xd80e('0x4b')](_0xd80e('0x4c'),_0x2db767);}exports['cs']=function(_0x5ae787,_0x3e116f,_0x113185,_0x4d138c,_0x4fc2c7,_0x246354,_0x204bd1,_0x4fdf2b){var _0x43e959={};_0x246354['remoteUri']=intUtil[_0xd80e('0x4d')](_0x246354[_0xd80e('0xe')]);_0x246354[_0xd80e('0x4e')]=intUtil[_0xd80e('0x4d')](_0x246354[_0xd80e('0x4e')]);_0x43e959[_0xd80e('0x45')]=_0x4fdf2b===_0xd80e('0x44')||_0x4fdf2b===_0xd80e('0x4f')?_0xd80e('0x44'):_0xd80e('0x25');var _0x3e6c54=util['format'](_0xd80e('0x50'),_0x246354['remoteUri']);var _0x3253b2=util[_0xd80e('0x4a')](_0xd80e('0x51'),_0x246354[_0xd80e('0x52')]);var _0x56354d=util[_0xd80e('0x4a')](_0xd80e('0x53'),_0x246354['serverUrl'],_0x3e116f[_0xd80e('0x54')],md5(_0x3e116f[_0xd80e('0x54')]));if(_0x4fc2c7&&_0x4fc2c7[_0xd80e('0x55')]){logger[_0xd80e('0x1f')](_0xd80e('0x56'),'Recording\x20is\x20enabled!');_0x3e116f[_0xd80e('0x57')]=_0x56354d;}else if(_0x204bd1&&_0x204bd1[_0xd80e('0x58')]&&_0x204bd1[_0xd80e('0x58')]!=='none'){logger['info']('[OUTBOUND]',_0xd80e('0x59'));_0x3e116f[_0xd80e('0x57')]=_0x56354d;}else{_0x3e116f[_0xd80e('0x57')]='';}return getUser(_0x43e959,_0x246354,_0x4d138c,_0x3253b2,_0x3e6c54,_0x4fdf2b)['then'](function(_0x22f3f6){logger[_0xd80e('0x1f')]('['+_0x4fdf2b['toUpperCase']()+_0xd80e('0x5a'),_0x22f3f6[_0xd80e('0x21')]);logger[_0xd80e('0x1f')]('['+_0x4fdf2b[_0xd80e('0x22')]()+_0xd80e('0x5b'),_0x22f3f6[_0xd80e('0x23')]);return getEndUser(_0x22f3f6,_0x246354,_0x3253b2,_0x3e6c54,_0x3e116f,_0x4fdf2b);})[_0xd80e('0x12')](function(_0x217370){logger[_0xd80e('0x1f')]('['+_0x4fdf2b['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x217370[_0xd80e('0x2c')]);logger['info']('['+_0x4fdf2b[_0xd80e('0x22')]()+_0xd80e('0x5c'),_0x3e116f[_0xd80e('0x27')]);return getTicket(_0x217370,_0x246354,_0x3253b2,_0x3e6c54,_0x3e116f,_0x113185,_0x4fdf2b);})[_0xd80e('0x12')](function(_0x1850a7){logger[_0xd80e('0x1f')](util[_0xd80e('0x4a')]('['+_0x4fdf2b[_0xd80e('0x22')]()+_0xd80e('0x5d'),_0x113185[_0xd80e('0x3b')],_0x1850a7[_0xd80e('0x48')]));logger[_0xd80e('0x1f')](util[_0xd80e('0x4a')]('['+_0x4fdf2b['toUpperCase']()+_0xd80e('0x5e'),_0x4fdf2b));if(_0x4fdf2b!=='unmanaged'){logger[_0xd80e('0x1f')]('['+_0x4fdf2b[_0xd80e('0x22')]()+']',_0xd80e('0x5f'));emit(_0x246354[_0xd80e('0xe')],_0x4d138c['name'],_0x113185[_0xd80e('0x3b')],_0x1850a7[_0xd80e('0x48')]);}})[_0xd80e('0x14')](function(_0x1ff8cf){logger[_0xd80e('0x60')]('['+_0x4fdf2b[_0xd80e('0x22')]()+_0xd80e('0x61'),util[_0xd80e('0x62')](_0x1ff8cf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6385=['userId','message','toLowerCase','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','outbound','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Descriptions','Fields','phonecalls','/contacts(','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','error','inspect','lodash','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','POST','username','password','clientSecret','catch','toUpperCase','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','then','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x6385,0xf9));var _0x5638=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x6385[_0x54b283];return _0x2462b3;};'use strict';var _=require(_0x5638('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x5638('0x1'));var intUtil=require(_0x5638('0x2'));var md5=require(_0x5638('0x3'));var Redis=require('ioredis');var logger=require(_0x5638('0x4'))(_0x5638('0x5'));var config=require(_0x5638('0x6'));config[_0x5638('0x7')]=_['defaults'](config[_0x5638('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5638('0x8'))(new Redis(config['redis']));function getAuthToken(_0x50acdf,_0x394a7d,_0x11f903){var _0x197c1c={'method':_0x5638('0x9'),'uri':_0x394a7d,'form':{'client_id':_0x50acdf['clientId'],'resource':_0x50acdf['remoteUri'],'username':_0x50acdf[_0x5638('0xa')],'password':_0x50acdf[_0x5638('0xb')],'grant_type':_0x5638('0xb'),'client_secret':_0x50acdf[_0x5638('0xc')]},'json':!![]};return rp(_0x197c1c)['then'](function(_0x3304f9){return _0x3304f9['access_token'];})[_0x5638('0xd')](function(_0x17d24e){logger['error']('['+[_0x11f903[_0x5638('0xe')]()]+']\x20Wrong\x20credentials!');return _0x17d24e['message'];});}function getUser(_0x565fdc,_0xf5af0a,_0x50f343,_0x4d81d6,_0x790be1,_0x57bdb3){return new BPromise(function(_0x5c0b5a,_0x702e96){return getAuthToken(_0xf5af0a,_0x4d81d6,_0x57bdb3)['then'](function(_0x584c29){var _0x3d0429={'method':'GET','uri':_0x790be1+_0x5638('0xf'),'headers':{'Authorization':_0x5638('0x10')+_0x584c29,'OData-Version':_0x5638('0x11')},'json':!![]};return rp(_0x3d0429);})[_0x5638('0x12')](function(_0x43b7e7){var _0x175ab0=_0x43b7e7[_0x5638('0x13')];var _0x5a18b4=![];var _0xae0064=null;if(!_['isNil'](_0x50f343)){if(intUtil[_0x5638('0x14')](_0x50f343[_0x5638('0x15')])){_0x565fdc[_0x5638('0x16')]=_0x50f343[_0x5638('0x15')];for(_0xae0064=0x0;_0xae0064<_0x175ab0[_0x5638('0x17')];_0xae0064++){if(_0x175ab0[_0xae0064][_0x5638('0x18')]===_0x50f343[_0x5638('0x15')]&&!_0x175ab0[_0xae0064][_0x5638('0x19')]){_0x5a18b4=!![];logger['info']('['+[_0x57bdb3[_0x5638('0xe')]()]+_0x5638('0x1a')+_0x175ab0[_0xae0064]['systemuserid']+'!');_0x565fdc['userId']=_0x175ab0[_0xae0064][_0x5638('0x1b')];}}}}if(!_0x5a18b4){logger[_0x5638('0x1c')]('['+[_0x57bdb3['toUpperCase']()]+_0x5638('0x1d'));_0x565fdc[_0x5638('0x16')]=_0xf5af0a[_0x5638('0xa')];for(_0xae0064=0x0;_0xae0064<_0x175ab0[_0x5638('0x17')];_0xae0064++){if(_0x175ab0[_0xae0064][_0x5638('0x18')]===_0xf5af0a['username']){_0x565fdc[_0x5638('0x1e')]=_0x175ab0[_0xae0064][_0x5638('0x1b')];}}}_0x5c0b5a(_0x565fdc);})[_0x5638('0xd')](function(_0x2886c1){_0x702e96(_0x2886c1[_0x5638('0x1f')]);});});}function createEndUser(_0x5c8a51,_0x2d1ec4,_0x2f2694,_0x2b2e4c,_0x21094e,_0x1402d8){return new BPromise(function(_0x576ca1,_0x5e4894){return getAuthToken(_0x2d1ec4,_0x2f2694,_0x1402d8)['then'](function(_0x1f70c7){var _0x588340=_0x1402d8[_0x5638('0x20')]()==='outbound'?_0x21094e[_0x5638('0x21')]:_0x21094e[_0x5638('0x22')];var _0x2173a1={'method':_0x5638('0x9'),'uri':_0x2b2e4c+'contacts','body':{'telephone1':_0x588340,'fullname':_0x588340,'firstname':_0x588340,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5638('0x23')+_0x5c8a51[_0x5638('0x1e')]+')'},'headers':{'Authorization':_0x5638('0x10')+_0x1f70c7,'OData-Version':_0x5638('0x11')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2173a1);})['then'](function(_0x59b95b){var _0xffad2a=_0x59b95b[_0x5638('0x24')][_0x5638('0x25')];var _0x2fdc56=_0xffad2a[_0x5638('0x26')](_0xffad2a[_0x5638('0x27')]('(')+0x1,_0xffad2a['lastIndexOf'](')'));_0x5c8a51['enduserId']=_0x2fdc56;_0x576ca1(_0x5c8a51);})[_0x5638('0xd')](function(_0x3f33db){_0x5e4894(_0x3f33db[_0x5638('0x1f')]);});});}function getEndUser(_0x280072,_0x338893,_0x220b39,_0x499ebc,_0x49253c,_0x3fbf0e){return new BPromise(function(_0x2c4701,_0x3120b5){var _0x5abad9=_0x3fbf0e[_0x5638('0x20')]()===_0x5638('0x28')?_0x49253c[_0x5638('0x21')]:_0x49253c['calleridnum'];return getAuthToken(_0x338893,_0x220b39,_0x3fbf0e)['then'](function(_0x6a906a){var _0x3e9f2b={'method':_0x5638('0x29'),'uri':_0x499ebc+_0x5638('0x2a')+_0x5abad9[_0x5638('0x2b')]('+',_0x5638('0x2c'))+'\x27','headers':{'Authorization':_0x5638('0x10')+_0x6a906a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3e9f2b);})[_0x5638('0x12')](function(_0x4020d7){var _0x3c6e8b=null;if(_0x4020d7){var _0x263b19=_0x4020d7['value'];var _0x3a9bfc=![];for(_0x3c6e8b=0x0;_0x3c6e8b<_0x263b19[_0x5638('0x17')];_0x3c6e8b++){if(_0x263b19[_0x3c6e8b][_0x5638('0x2d')]===_0x5abad9){_0x3a9bfc=!![];_0x280072[_0x5638('0x2e')]=_0x263b19[_0x3c6e8b][_0x5638('0x2f')];}}if(_0x3a9bfc){_0x2c4701(_0x280072);}else{return createEndUser(_0x280072,_0x338893,_0x220b39,_0x499ebc,_0x49253c,_0x3fbf0e)[_0x5638('0x12')](function(_0x6c8f6e){logger[_0x5638('0x1c')]('['+[_0x3fbf0e[_0x5638('0xe')]()]+_0x5638('0x30'),_0x6c8f6e[_0x5638('0x2e')]);_0x2c4701(_0x6c8f6e);});}}else{return createEndUser(_0x280072,_0x338893,_0x220b39,_0x499ebc,_0x49253c,_0x3fbf0e)[_0x5638('0x12')](function(_0x3e93a0){logger[_0x5638('0x1c')]('['+[_0x3fbf0e[_0x5638('0xe')]()]+']\x20Enduser\x20Created!',_0x3e93a0[_0x5638('0x2e')]);_0x2c4701(_0x3e93a0);});}});});}function getCustomFields(_0x6292b4,_0x5b228b,_0x3750d4){var _0x16f14e={};if(_0x6292b4[_0x5638('0x17')]>0x0){_[_0x5638('0x31')](_0x6292b4,function(_0xb9a91){if(_[_0x5638('0x32')]([_0x5638('0x33'),_0x5638('0x34')],_0xb9a91[_0x5638('0x35')])&&_0xb9a91[_0x5638('0x36')]&&!_0xb9a91[_0x5638('0x37')]){var _0x4a4ac5=_0xb9a91[_0x5638('0x38')][_0x5638('0x20')]();var _0x3696cb=_0x4a4ac5[_0x5638('0x26')](0x0,_0x4a4ac5[_0x5638('0x39')]('_'));var _0x583d56=_0x4a4ac5[_0x5638('0x26')](_0x4a4ac5['indexOf']('_')+0x1);if(_0x3696cb===_0x3750d4){_0x16f14e[_0x583d56]=_0xb9a91['content'];}}});}return _0x16f14e;}function getTicket(_0x3b47ad,_0x372004,_0x31d5c5,_0x43aeb1,_0x134e1a,_0xda5955,_0x394d97){return new BPromise(function(_0x1c2f64,_0x4ce668){var _0x2b7e91;return getAuthToken(_0x372004,_0x31d5c5,_0x394d97)['then'](function(_0x36dfb1){if(_0xda5955[_0x5638('0x3a')]===_0x5638('0x3b')){_0x2b7e91={'method':'POST','uri':_0x43aeb1+_0x5638('0x3c'),'body':Object[_0x5638('0x3d')]({},{'title':intUtil[_0x5638('0x3e')](_0xda5955['Subjects'],_0x134e1a,'\x20'),'description':intUtil[_0x5638('0x3e')](_0xda5955[_0x5638('0x3f')],_0x134e1a,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x3b47ad['enduserId']+')','ownerid@odata.bind':_0x5638('0x23')+_0x3b47ad[_0x5638('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0xda5955[_0x5638('0x40')],_0x134e1a,_0xda5955[_0x5638('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x36dfb1,'OData-Version':_0x5638('0x11')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xda5955['ticketType']==='phonecall'){_0x2b7e91={'method':_0x5638('0x9'),'uri':_0x43aeb1+_0x5638('0x41'),'body':Object[_0x5638('0x3d')]({},{'subject':intUtil[_0x5638('0x3e')](_0xda5955['Subjects'],_0x134e1a,'\x20'),'phonenumber':String(_0x134e1a[_0x5638('0x22')]),'description':intUtil[_0x5638('0x3e')](_0xda5955[_0x5638('0x3f')],_0x134e1a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5638('0x42')+_0x3b47ad['enduserId']+')','ownerid@odata.bind':_0x5638('0x23')+_0x3b47ad[_0x5638('0x1e')]+')','directioncode':_0x3b47ad[_0x5638('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5638('0x23')+_0x3b47ad[_0x5638('0x1e')]+')','participationtypemask':_0x3b47ad[_0x5638('0x43')]===_0x5638('0x44')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3b47ad[_0x5638('0x2e')]+')','participationtypemask':_0x3b47ad[_0x5638('0x43')]==='queue'?0x1:0x2}]},getCustomFields(_0xda5955['Fields'],_0x134e1a,_0xda5955[_0x5638('0x3a')])),'headers':{'Authorization':_0x5638('0x10')+_0x36dfb1,'OData-Version':_0x5638('0x11')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2b7e91);})[_0x5638('0x12')](function(_0x59c8bf){var _0x27e1b5=_0x59c8bf[_0x5638('0x24')][_0x5638('0x25')];var _0x662bfb=_0x27e1b5[_0x5638('0x26')](_0x27e1b5['lastIndexOf']('(')+0x1,_0x27e1b5['lastIndexOf'](')'));_0x3b47ad['ticketId']=_0x662bfb;_0x1c2f64(_0x3b47ad);})[_0x5638('0xd')](function(_0x527b24){_0x4ce668(_0x527b24[_0x5638('0x1f')]);});});}function emit(_0x3e00b8,_0x39f55,_0x503368,_0x308d69){var _0x313809={'uri':util[_0x5638('0x45')](_0x5638('0x46'),_0x3e00b8,_0x503368,_0x308d69)};io['to'](util[_0x5638('0x45')](_0x5638('0x47'),_0x39f55))['emit'](_0x5638('0x48'),_0x313809);}exports['cs']=function(_0x57f4f6,_0x420296,_0x3fb7d1,_0x1bcf27,_0x550357,_0x50b42a,_0x2d4c21,_0x184f02){var _0x10561f={};_0x50b42a[_0x5638('0x49')]=intUtil[_0x5638('0x4a')](_0x50b42a[_0x5638('0x49')]);_0x50b42a['serverUrl']=intUtil[_0x5638('0x4a')](_0x50b42a[_0x5638('0x4b')]);_0x10561f['callDirection']=_0x184f02===_0x5638('0x44')||_0x184f02===_0x5638('0x4c')?'queue':_0x5638('0x28');var _0x5cb592=util['format'](_0x5638('0x4d'),_0x50b42a[_0x5638('0x49')]);var _0x4e68c1=util[_0x5638('0x45')]('https://login.microsoftonline.com/%s/oauth2/token',_0x50b42a[_0x5638('0x4e')]);var _0x5e6764=util[_0x5638('0x45')](_0x5638('0x4f'),_0x50b42a['serverUrl'],_0x420296['uniqueid'],md5(_0x420296['uniqueid']));if(_0x550357&&_0x550357[_0x5638('0x50')]){logger[_0x5638('0x1c')](_0x5638('0x51'),_0x5638('0x52'));_0x420296[_0x5638('0x53')]=_0x5e6764;}else if(_0x2d4c21&&_0x2d4c21[_0x5638('0x54')]&&_0x2d4c21['recordingFormat']!=='none'){logger['info'](_0x5638('0x55'),_0x5638('0x52'));_0x420296['recordingURL']=_0x5e6764;}else{_0x420296[_0x5638('0x53')]='';}return getUser(_0x10561f,_0x50b42a,_0x1bcf27,_0x4e68c1,_0x5cb592,_0x184f02)[_0x5638('0x12')](function(_0x2b6f0a){logger[_0x5638('0x1c')]('['+_0x184f02['toUpperCase']()+_0x5638('0x56'),_0x2b6f0a[_0x5638('0x1e')]);logger[_0x5638('0x1c')]('['+_0x184f02[_0x5638('0xe')]()+_0x5638('0x57'),_0x2b6f0a[_0x5638('0x16')]);return getEndUser(_0x2b6f0a,_0x50b42a,_0x4e68c1,_0x5cb592,_0x420296,_0x184f02);})['then'](function(_0x168c6f){logger[_0x5638('0x1c')]('['+_0x184f02[_0x5638('0xe')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x168c6f['enduserId']);logger[_0x5638('0x1c')]('['+_0x184f02[_0x5638('0xe')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x420296[_0x5638('0x22')]);return getTicket(_0x168c6f,_0x50b42a,_0x4e68c1,_0x5cb592,_0x420296,_0x3fb7d1,_0x184f02);})[_0x5638('0x12')](function(_0x120bc5){logger['info'](util['format']('['+_0x184f02[_0x5638('0xe')]()+_0x5638('0x58'),_0x3fb7d1[_0x5638('0x3a')],_0x120bc5['ticketId']));logger[_0x5638('0x1c')](util[_0x5638('0x45')]('['+_0x184f02[_0x5638('0xe')]()+_0x5638('0x59'),_0x184f02));if(_0x184f02!==_0x5638('0x4c')){logger[_0x5638('0x1c')]('['+_0x184f02[_0x5638('0xe')]()+']',_0x5638('0x5a'));emit(_0x50b42a['remoteUri'],_0x1bcf27['name'],_0x3fb7d1[_0x5638('0x3a')],_0x120bc5['ticketId']);}})['catch'](function(_0x2c8fdf){logger[_0x5638('0x5b')]('['+_0x184f02['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x5638('0x5c')](_0x2c8fdf,{'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 2c3c4b4..0cfdf79 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 _0xd5a5=['apiKey','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','toString','idField','push','content','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','[QUEUE]','recordingFormat','Recording\x20is\x20enabled!','destcalleridnum','Ticket\x20created!','user:%s','%s/helpdesk/tickets/%d','toUpperCase','The\x20Enduser\x20ID\x20is:','error','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','Subjects','getString','Descriptions','Tags','name','Fields','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','validateEmail','then','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.'];(function(_0x4e9931,_0x5aeed7){var _0xb753c4=function(_0x4785b7){while(--_0x4785b7){_0x4e9931['push'](_0x4e9931['shift']());}};_0xb753c4(++_0x5aeed7);}(_0xd5a5,0x18b));var _0x5d5a=function(_0x57eb17,_0x45bdf9){_0x57eb17=_0x57eb17-0x0;var _0x574640=_0xd5a5[_0x57eb17];return _0x574640;};'use strict';var _=require(_0x5d5a('0x0'));var rp=require(_0x5d5a('0x1'));var md5=require(_0x5d5a('0x2'));var util=require(_0x5d5a('0x3'));var Redis=require('ioredis');var intUtil=require(_0x5d5a('0x4'));var config=require(_0x5d5a('0x5'));var logger=require(_0x5d5a('0x6'))(_0x5d5a('0x7'));config[_0x5d5a('0x8')]=_[_0x5d5a('0x9')](config[_0x5d5a('0x8')],{'host':_0x5d5a('0xa'),'port':0x18eb});var io=require(_0x5d5a('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0x5d5a('0xc'),'Accept':_0x5d5a('0xc')};function emit(_0x10f7e3,_0x3b36f2,_0x5c790b){io['to'](_0x10f7e3)[_0x5d5a('0xd')](_0x3b36f2,_0x5c790b);}function getTicket(_0x32c7e8,_0x24e0ef,_0x63ef8,_0xbbfd95,_0x6daf9e){logger[_0x5d5a('0xe')](_0x5d5a('0xf'));var _0x419196=_[_0x5d5a('0x10')]({'responder_id':_0x24e0ef['id'],'requester_id':_0x63ef8['id'],'name':util[_0x5d5a('0x11')]('Caller\x20-\x20%s',_0x6daf9e['calleridname']),'phone':_0x6daf9e[_0x5d5a('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xbbfd95[_0x5d5a('0x13')],_0x6daf9e,'\x20'),'description':intUtil[_0x5d5a('0x14')](_0xbbfd95[_0x5d5a('0x15')],_0x6daf9e,'
'),'tags':getTags(_0xbbfd95[_0x5d5a('0x16')],_0x5d5a('0x17'))},getCustomFields(_0xbbfd95[_0x5d5a('0x18')],_0x6daf9e));_0x419196['custom_fields']=_[_0x5d5a('0x19')](_[_0x5d5a('0x1a')](_0x419196[_0x5d5a('0x1b')],'id'),'value');return request({'uri':util[_0x5d5a('0x11')](_0x5d5a('0x1c'),_0x32c7e8[_0x5d5a('0x1d')]),'method':'POST','body':_0x419196})['then'](function(_0x3a7860){logger[_0x5d5a('0xe')]('Ticket\x20created!');return _0x3a7860;});}function getUser(_0x4cc908,_0x47bcf5){if(intUtil[_0x5d5a('0x1e')](_0x47bcf5)){return request({'uri':util[_0x5d5a('0x11')]('%s/api/v2/agents',_0x4cc908['remoteUri']),'qs':{'email':_0x47bcf5}})[_0x5d5a('0x1f')](function(_0x409ddf){if(_0x409ddf[_0x5d5a('0x20')]){logger[_0x5d5a('0xe')](_0x5d5a('0x21'));return _['find'](_0x409ddf,function(_0x2ff223){return _0x2ff223[_0x5d5a('0x22')][_0x5d5a('0x23')]===_0x47bcf5;});}else{logger[_0x5d5a('0xe')](_0x5d5a('0x24'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x4cc908[_0x5d5a('0x1d')])})[_0x5d5a('0x1f')](function(_0x176b60){logger['info'](_0x5d5a('0x25'));return _0x176b60;});}});}else{logger['info'](_0x5d5a('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x4cc908[_0x5d5a('0x1d')])})[_0x5d5a('0x1f')](function(_0x4e9407){logger[_0x5d5a('0xe')](_0x5d5a('0x25'));return _0x4e9407;});}}function getEndUser(_0x12f124,_0x2af2a8,_0x51946d){logger['info'](_0x5d5a('0x27'),_0x51946d);return request({'uri':util[_0x5d5a('0x11')]('%s/api/v2/contacts',_0x12f124['remoteUri']),'qs':{'phone':_0x51946d}})[_0x5d5a('0x1f')](function(_0x1bb110){if(_0x1bb110[_0x5d5a('0x20')]){logger[_0x5d5a('0xe')]('Enduser\x20found!');return _[_0x5d5a('0x28')](_0x1bb110,{'phone':_0x51946d});}else{logger[_0x5d5a('0xe')](_0x5d5a('0x29'));return request({'uri':util['format'](_0x5d5a('0x2a'),_0x12f124['remoteUri']),'method':_0x5d5a('0x2b'),'body':{'name':_0x2af2a8,'phone':_0x51946d}})[_0x5d5a('0x1f')](function(_0x52684d){logger['info'](_0x5d5a('0x2c'));return _0x52684d;});}});}function getAuth(_0x40d84e){return util[_0x5d5a('0x11')]('Basic\x20%s',new Buffer(_0x40d84e[_0x5d5a('0x2d')]+':X')['toString'](_0x5d5a('0x2e')));}function request(_0x594a52){logger[_0x5d5a('0x2f')](_0x5d5a('0x30'),JSON[_0x5d5a('0x31')](_0x594a52));return rp(_[_0x5d5a('0x9')](_0x594a52,{'method':_0x5d5a('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2ff4a7,_0x33e97b){var _0x8e4403=[];if(_0x2ff4a7&&_0x2ff4a7[_0x5d5a('0x20')]>0x0){_0x8e4403=_['map'](_0x2ff4a7,_0x33e97b);}return _0x8e4403;}function getCustomFields(_0x114a2e,_0x273cbc){var _0x534604=[];var _0x1a46ed={'custom_fields':[]};if(_0x114a2e[_0x5d5a('0x20')]>0x0){_[_0x5d5a('0x33')](_0x114a2e,function(_0x260c23){if(_[_0x5d5a('0x34')]([_0x5d5a('0x35'),_0x5d5a('0x36')],_0x260c23[_0x5d5a('0x37')])&&_0x260c23[_0x5d5a('0x38')]&&!_0x260c23[_0x5d5a('0x39')]){_0x1a46ed[_0x260c23[_0x5d5a('0x38')][_0x5d5a('0x3a')]()]=_0x260c23['content'][_0x5d5a('0x3b')]();}else if(_[_0x5d5a('0x34')]([_0x5d5a('0x35'),_0x5d5a('0x36')],_0x260c23[_0x5d5a('0x37')])&&_0x260c23[_0x5d5a('0x3c')]&&_0x260c23[_0x5d5a('0x39')]){_0x1a46ed['custom_fields'][_0x5d5a('0x3d')]({'id':_0x260c23['idField'],'value':_0x260c23[_0x5d5a('0x3e')][_0x5d5a('0x3b')]()});}else if(_0x260c23['type']===_0x5d5a('0x3f')&&_0x260c23[_0x5d5a('0x40')]&&_0x260c23[_0x5d5a('0x3c')]&&_0x260c23[_0x5d5a('0x39')]){_0x273cbc[_0x260c23[_0x5d5a('0x40')]]&&_0x1a46ed[_0x5d5a('0x1b')][_0x5d5a('0x3d')]({'id':_0x260c23[_0x5d5a('0x3c')],'value':_0x273cbc[_0x260c23[_0x5d5a('0x40')]][_0x5d5a('0x3b')]()});}else if(_0x260c23[_0x5d5a('0x37')]==='customVariable'&&_0x260c23[_0x5d5a('0x41')]&&_0x260c23[_0x5d5a('0x41')]['name']&&_0x260c23[_0x5d5a('0x3c')]&&_0x260c23[_0x5d5a('0x39')]){_0x273cbc[_0x260c23[_0x5d5a('0x41')][_0x5d5a('0x17')][_0x5d5a('0x3a')]()]&&_0x1a46ed[_0x5d5a('0x1b')][_0x5d5a('0x3d')]({'id':_0x260c23[_0x5d5a('0x3c')],'value':_0x273cbc[_0x260c23[_0x5d5a('0x41')][_0x5d5a('0x17')]['toLowerCase']()][_0x5d5a('0x3b')]()});}});}return _0x1a46ed;}exports['queue']=function(_0x417766,_0x5b9291,_0xde569,_0xbd971a,_0x5145ef,_0xf0e0a0){var _0xa65fd7,_0x3c4887;_0xf0e0a0['remoteUri']=intUtil[_0x5d5a('0x42')](_0xf0e0a0[_0x5d5a('0x1d')]);_0xf0e0a0[_0x5d5a('0x43')]=intUtil[_0x5d5a('0x42')](_0xf0e0a0['serverUrl']);if(_0x5145ef&&_0x5145ef[_0x5d5a('0x44')]){logger[_0x5d5a('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5b9291[_0x5d5a('0x45')]=util[_0x5d5a('0x11')](_0x5d5a('0x46'),_0xf0e0a0[_0x5d5a('0x43')],_0x5b9291['uniqueid'],md5(_0x5b9291[_0x5d5a('0x47')]));}else{_0x5b9291[_0x5d5a('0x45')]='';}headers[_0x5d5a('0x48')]=getAuth(_0xf0e0a0);return getUser(_0xf0e0a0,_0xbd971a['email'])[_0x5d5a('0x1f')](function(_0x411167){_0xa65fd7=_0x411167;logger[_0x5d5a('0xe')]('The\x20User\x20ID\x20is:',_0xa65fd7['id']);return getEndUser(_0xf0e0a0,_0x5b9291[_0x5d5a('0x49')],_0x5b9291[_0x5d5a('0x12')]);})[_0x5d5a('0x1f')](function(_0x3913d9){_0x3c4887=_0x3913d9;logger[_0x5d5a('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3c4887['id']);return getTicket(_0xf0e0a0,_0xa65fd7,_0x3c4887,_0xde569,_0x5b9291);})[_0x5d5a('0x1f')](function(_0x3b1882){if(_0x3b1882&&_0x3b1882['id']){logger[_0x5d5a('0xe')]('Ticket\x20created!');logger[_0x5d5a('0xe')](_0x5d5a('0x4a'),_0x3b1882['id']);logger['info']('[QUEUE]',_0x5d5a('0x4b'));emit(util[_0x5d5a('0x11')]('user:%s',_0xbd971a[_0x5d5a('0x17')]),_0x5d5a('0x4c'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0xf0e0a0['remoteUri'],_0x3b1882['id'])});}})[_0x5d5a('0x4d')](function(_0x185151){logger['error'](_0x5d5a('0x4e'),JSON[_0x5d5a('0x31')](_0x185151));});};exports['outbound']=function(_0x5d810b,_0xba2b5b,_0x3dba16,_0x533e73,_0x393990,_0x2cb013,_0x18f029){var _0x4aae4c,_0x5990f0;_0x2cb013[_0x5d5a('0x1d')]=intUtil[_0x5d5a('0x42')](_0x2cb013[_0x5d5a('0x1d')]);_0x2cb013[_0x5d5a('0x43')]=intUtil['stripTrailingSlash'](_0x2cb013[_0x5d5a('0x43')]);if(_0x18f029&&_0x18f029[_0x5d5a('0x4f')]&&_0x18f029[_0x5d5a('0x4f')]!=='none'){logger[_0x5d5a('0xe')]('[OUTBOUND]',_0x5d5a('0x50'));_0xba2b5b[_0x5d5a('0x45')]=util[_0x5d5a('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2cb013[_0x5d5a('0x43')],_0xba2b5b['uniqueid'],md5(_0xba2b5b['uniqueid']));}headers[_0x5d5a('0x48')]=getAuth(_0x2cb013);return getUser(_0x2cb013,_0x533e73[_0x5d5a('0x23')])[_0x5d5a('0x1f')](function(_0x3a2697){_0x4aae4c=_0x3a2697;logger[_0x5d5a('0xe')]('The\x20User\x20ID\x20is:',_0x4aae4c['id']);return getEndUser(_0x2cb013,_0xba2b5b['destcalleridname'],_0xba2b5b[_0x5d5a('0x51')]);})[_0x5d5a('0x1f')](function(_0x249123){_0x5990f0=_0x249123;logger[_0x5d5a('0xe')]('The\x20Enduser\x20ID\x20is:',_0x5990f0['id']);return getTicket(_0x2cb013,_0x4aae4c,_0x5990f0,_0x3dba16,_0xba2b5b);})[_0x5d5a('0x1f')](function(_0x5eba21){if(_0x5eba21&&_0x5eba21['id']){logger[_0x5d5a('0xe')](_0x5d5a('0x52'));logger[_0x5d5a('0xe')](_0x5d5a('0x4a'),_0x5eba21['id']);logger[_0x5d5a('0xe')]('[OUTBOUND]',_0x5d5a('0x4b'));emit(util['format'](_0x5d5a('0x53'),_0x533e73[_0x5d5a('0x17')]),_0x5d5a('0x4c'),{'uri':util[_0x5d5a('0x11')](_0x5d5a('0x54'),_0x2cb013[_0x5d5a('0x1d')],_0x5eba21['id'])});}})[_0x5d5a('0x4d')](function(_0x35c99b){logger['error']('[OUTBOUND]',JSON[_0x5d5a('0x31')](_0x35c99b));});};exports['unmanaged']=function(_0x21cbd1,_0x31fe03,_0x3d4b6e,_0x44cc18,_0x2567fb,_0x33da0d){var _0x4a361c,_0x3768dd;_0x33da0d[_0x5d5a('0x1d')]=intUtil['stripTrailingSlash'](_0x33da0d[_0x5d5a('0x1d')]);_0x33da0d[_0x5d5a('0x43')]=intUtil[_0x5d5a('0x42')](_0x33da0d[_0x5d5a('0x43')]);if(_0x2567fb&&_0x2567fb[_0x5d5a('0x44')]){logger[_0x5d5a('0xe')]('['+_0x31fe03['lastevent'][_0x5d5a('0x55')]()+']',_0x5d5a('0x50'));_0x31fe03[_0x5d5a('0x45')]=util[_0x5d5a('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x33da0d['serverUrl'],_0x31fe03['uniqueid'],md5(_0x31fe03[_0x5d5a('0x47')]));}else{_0x31fe03[_0x5d5a('0x45')]='';}headers[_0x5d5a('0x48')]=getAuth(_0x33da0d);return getUser(_0x33da0d,'')[_0x5d5a('0x1f')](function(_0x59c67d){_0x4a361c=_0x59c67d;logger['info']('The\x20User\x20ID\x20is:',_0x4a361c['id']);return getEndUser(_0x33da0d,_0x31fe03[_0x5d5a('0x49')],_0x31fe03[_0x5d5a('0x12')]);})[_0x5d5a('0x1f')](function(_0x2354b1){_0x3768dd=_0x2354b1;logger[_0x5d5a('0xe')](_0x5d5a('0x56'),_0x3768dd['id']);return getTicket(_0x33da0d,_0x4a361c,_0x3768dd,_0x3d4b6e,_0x31fe03);})[_0x5d5a('0x1f')](function(_0x175453){if(_0x175453){logger[_0x5d5a('0xe')](_0x5d5a('0x52'));logger[_0x5d5a('0xe')](_0x5d5a('0x4a'),_0x175453['id']);}})[_0x5d5a('0x4d')](function(_0x5190a9){logger[_0x5d5a('0x57')]('['+_0x31fe03['lastevent'][_0x5d5a('0x55')]()+']',JSON[_0x5d5a('0x31')](_0x5190a9));});}; \ No newline at end of file +var _0x0d9d=['serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','error','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','catch','lodash','request-promise','md5','util','ioredis','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','info','Ticket\x20created!','validateEmail','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','toString','base64','debug','[HTTP]','GET','map','includes','type','nameField','customField','content','string','picklist','idField','push','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x4517ff,_0x3a1399){var _0x460fff=function(_0x48f1b5){while(--_0x48f1b5){_0x4517ff['push'](_0x4517ff['shift']());}};_0x460fff(++_0x3a1399);}(_0x0d9d,0x73));var _0xd0d9=function(_0x4b0db3,_0x3295a4){_0x4b0db3=_0x4b0db3-0x0;var _0x245545=_0x0d9d[_0x4b0db3];return _0x245545;};'use strict';var _=require(_0xd0d9('0x0'));var rp=require(_0xd0d9('0x1'));var md5=require(_0xd0d9('0x2'));var util=require(_0xd0d9('0x3'));var Redis=require(_0xd0d9('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd0d9('0x5'));config[_0xd0d9('0x6')]=_[_0xd0d9('0x7')](config['redis'],{'host':_0xd0d9('0x8'),'port':0x18eb});var io=require(_0xd0d9('0x9'))(new Redis(config[_0xd0d9('0x6')]));var headers={'Content-Type':_0xd0d9('0xa'),'Accept':_0xd0d9('0xa')};function emit(_0xb268a8,_0x3108e8,_0x1b0a5c){io['to'](_0xb268a8)[_0xd0d9('0xb')](_0x3108e8,_0x1b0a5c);}function getTicket(_0xeaa76,_0x1d7021,_0x1508a7,_0x464331,_0x256762){logger['info']('Creating\x20new\x20ticket...');var _0x549655=_[_0xd0d9('0xc')]({'responder_id':_0x1d7021['id'],'requester_id':_0x1508a7['id'],'name':util[_0xd0d9('0xd')](_0xd0d9('0xe'),_0x256762[_0xd0d9('0xf')]),'phone':_0x256762[_0xd0d9('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd0d9('0x11')](_0x464331[_0xd0d9('0x12')],_0x256762,'\x20'),'description':intUtil[_0xd0d9('0x11')](_0x464331[_0xd0d9('0x13')],_0x256762,'
'),'tags':getTags(_0x464331[_0xd0d9('0x14')],'name')},getCustomFields(_0x464331['Fields'],_0x256762));_0x549655[_0xd0d9('0x15')]=_[_0xd0d9('0x16')](_[_0xd0d9('0x17')](_0x549655[_0xd0d9('0x15')],'id'),_0xd0d9('0x18'));return request({'uri':util['format'](_0xd0d9('0x19'),_0xeaa76[_0xd0d9('0x1a')]),'method':_0xd0d9('0x1b'),'body':_0x549655})['then'](function(_0x4925e2){logger[_0xd0d9('0x1c')](_0xd0d9('0x1d'));return _0x4925e2;});}function getUser(_0x40d97a,_0x4e8355){if(intUtil[_0xd0d9('0x1e')](_0x4e8355)){return request({'uri':util[_0xd0d9('0xd')]('%s/api/v2/agents',_0x40d97a[_0xd0d9('0x1a')]),'qs':{'email':_0x4e8355}})['then'](function(_0x45f10d){if(_0x45f10d[_0xd0d9('0x1f')]){logger[_0xd0d9('0x1c')]('Agent\x20found!');return _['find'](_0x45f10d,function(_0x7a5183){return _0x7a5183[_0xd0d9('0x20')][_0xd0d9('0x21')]===_0x4e8355;});}else{logger[_0xd0d9('0x1c')](_0xd0d9('0x22'));return request({'uri':util[_0xd0d9('0xd')](_0xd0d9('0x23'),_0x40d97a[_0xd0d9('0x1a')])})[_0xd0d9('0x24')](function(_0x529389){logger[_0xd0d9('0x1c')]('Admin\x20account\x20selected.');return _0x529389;});}});}else{logger[_0xd0d9('0x1c')](_0xd0d9('0x25'));return request({'uri':util[_0xd0d9('0xd')](_0xd0d9('0x23'),_0x40d97a['remoteUri'])})[_0xd0d9('0x24')](function(_0x456137){logger['info'](_0xd0d9('0x26'));return _0x456137;});}}function getEndUser(_0x4dbd96,_0x57b81f,_0x5d6e45){logger[_0xd0d9('0x1c')](_0xd0d9('0x27'),_0x5d6e45);return request({'uri':util[_0xd0d9('0xd')](_0xd0d9('0x28'),_0x4dbd96[_0xd0d9('0x1a')]),'qs':{'phone':_0x5d6e45}})[_0xd0d9('0x24')](function(_0x2eaab4){if(_0x2eaab4[_0xd0d9('0x1f')]){logger[_0xd0d9('0x1c')](_0xd0d9('0x29'));return _['find'](_0x2eaab4,{'phone':_0x5d6e45});}else{logger['info'](_0xd0d9('0x2a'));return request({'uri':util['format']('%s/api/v2/contacts',_0x4dbd96[_0xd0d9('0x1a')]),'method':_0xd0d9('0x1b'),'body':{'name':_0x57b81f,'phone':_0x5d6e45}})[_0xd0d9('0x24')](function(_0x893d1e){logger[_0xd0d9('0x1c')](_0xd0d9('0x2b'));return _0x893d1e;});}});}function getAuth(_0x989c95){return util[_0xd0d9('0xd')]('Basic\x20%s',new Buffer(_0x989c95['apiKey']+':X')[_0xd0d9('0x2c')](_0xd0d9('0x2d')));}function request(_0x131923){logger[_0xd0d9('0x2e')](_0xd0d9('0x2f'),JSON['stringify'](_0x131923));return rp(_['defaults'](_0x131923,{'method':_0xd0d9('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x597786,_0x53140c){var _0x497e04=[];if(_0x597786&&_0x597786[_0xd0d9('0x1f')]>0x0){_0x497e04=_[_0xd0d9('0x31')](_0x597786,_0x53140c);}return _0x497e04;}function getCustomFields(_0x119547,_0x58ec97){var _0xa2056a=[];var _0x311632={'custom_fields':[]};if(_0x119547[_0xd0d9('0x1f')]>0x0){_['forEach'](_0x119547,function(_0x39a0ea){if(_[_0xd0d9('0x32')](['string','picklist'],_0x39a0ea[_0xd0d9('0x33')])&&_0x39a0ea[_0xd0d9('0x34')]&&!_0x39a0ea[_0xd0d9('0x35')]){_0x311632[_0x39a0ea[_0xd0d9('0x34')]['toLowerCase']()]=_0x39a0ea[_0xd0d9('0x36')][_0xd0d9('0x2c')]();}else if(_[_0xd0d9('0x32')]([_0xd0d9('0x37'),_0xd0d9('0x38')],_0x39a0ea[_0xd0d9('0x33')])&&_0x39a0ea[_0xd0d9('0x39')]&&_0x39a0ea[_0xd0d9('0x35')]){_0x311632['custom_fields'][_0xd0d9('0x3a')]({'id':_0x39a0ea[_0xd0d9('0x39')],'value':_0x39a0ea[_0xd0d9('0x36')]['toString']()});}else if(_0x39a0ea[_0xd0d9('0x33')]===_0xd0d9('0x3b')&&_0x39a0ea[_0xd0d9('0x3c')]&&_0x39a0ea['idField']&&_0x39a0ea[_0xd0d9('0x35')]){_0x58ec97[_0x39a0ea[_0xd0d9('0x3c')]]&&_0x311632[_0xd0d9('0x15')][_0xd0d9('0x3a')]({'id':_0x39a0ea[_0xd0d9('0x39')],'value':_0x58ec97[_0x39a0ea['variableName']][_0xd0d9('0x2c')]()});}else if(_0x39a0ea[_0xd0d9('0x33')]===_0xd0d9('0x3d')&&_0x39a0ea[_0xd0d9('0x3e')]&&_0x39a0ea[_0xd0d9('0x3e')][_0xd0d9('0x3f')]&&_0x39a0ea[_0xd0d9('0x39')]&&_0x39a0ea['customField']){_0x58ec97[_0x39a0ea['Variable'][_0xd0d9('0x3f')][_0xd0d9('0x40')]()]&&_0x311632[_0xd0d9('0x15')]['push']({'id':_0x39a0ea[_0xd0d9('0x39')],'value':_0x58ec97[_0x39a0ea[_0xd0d9('0x3e')]['name']['toLowerCase']()]['toString']()});}});}return _0x311632;}exports['queue']=function(_0x5004ee,_0x4c3508,_0x2457eb,_0x2a5ec3,_0x5131d8,_0x5b6d94){var _0x5ec343,_0x1943de;_0x5b6d94[_0xd0d9('0x1a')]=intUtil['stripTrailingSlash'](_0x5b6d94[_0xd0d9('0x1a')]);_0x5b6d94[_0xd0d9('0x41')]=intUtil[_0xd0d9('0x42')](_0x5b6d94[_0xd0d9('0x41')]);if(_0x5131d8&&_0x5131d8[_0xd0d9('0x43')]){logger[_0xd0d9('0x1c')](_0xd0d9('0x44'),_0xd0d9('0x45'));_0x4c3508[_0xd0d9('0x46')]=util[_0xd0d9('0xd')](_0xd0d9('0x47'),_0x5b6d94[_0xd0d9('0x41')],_0x4c3508[_0xd0d9('0x48')],md5(_0x4c3508[_0xd0d9('0x48')]));}else{_0x4c3508[_0xd0d9('0x46')]='';}headers[_0xd0d9('0x49')]=getAuth(_0x5b6d94);return getUser(_0x5b6d94,_0x2a5ec3['email'])[_0xd0d9('0x24')](function(_0x6df854){_0x5ec343=_0x6df854;logger[_0xd0d9('0x1c')](_0xd0d9('0x4a'),_0x5ec343['id']);return getEndUser(_0x5b6d94,_0x4c3508[_0xd0d9('0xf')],_0x4c3508['calleridnum']);})[_0xd0d9('0x24')](function(_0xf3569b){_0x1943de=_0xf3569b;logger[_0xd0d9('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x1943de['id']);return getTicket(_0x5b6d94,_0x5ec343,_0x1943de,_0x2457eb,_0x4c3508);})[_0xd0d9('0x24')](function(_0x761818){if(_0x761818&&_0x761818['id']){logger['info'](_0xd0d9('0x1d'));logger['info'](_0xd0d9('0x4b'),_0x761818['id']);logger[_0xd0d9('0x1c')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd0d9('0xd')](_0xd0d9('0x4c'),_0x2a5ec3[_0xd0d9('0x3f')]),_0xd0d9('0x4d'),{'uri':util[_0xd0d9('0xd')]('%s/helpdesk/tickets/%d',_0x5b6d94[_0xd0d9('0x1a')],_0x761818['id'])});}})['catch'](function(_0x47831d){logger[_0xd0d9('0x4e')]('[QUEUE]',JSON[_0xd0d9('0x4f')](_0x47831d));});};exports[_0xd0d9('0x50')]=function(_0x3649ca,_0x35d4fb,_0x35ba61,_0x11b753,_0x2bbb99,_0x33397a,_0x504d98){var _0x13f1cd,_0x3ad415;_0x33397a[_0xd0d9('0x1a')]=intUtil[_0xd0d9('0x42')](_0x33397a[_0xd0d9('0x1a')]);_0x33397a[_0xd0d9('0x41')]=intUtil['stripTrailingSlash'](_0x33397a[_0xd0d9('0x41')]);if(_0x504d98&&_0x504d98[_0xd0d9('0x51')]&&_0x504d98['recordingFormat']!=='none'){logger[_0xd0d9('0x1c')](_0xd0d9('0x52'),'Recording\x20is\x20enabled!');_0x35d4fb[_0xd0d9('0x46')]=util['format'](_0xd0d9('0x47'),_0x33397a[_0xd0d9('0x41')],_0x35d4fb[_0xd0d9('0x48')],md5(_0x35d4fb[_0xd0d9('0x48')]));}headers['Authorization']=getAuth(_0x33397a);return getUser(_0x33397a,_0x11b753[_0xd0d9('0x21')])['then'](function(_0x85d575){_0x13f1cd=_0x85d575;logger[_0xd0d9('0x1c')]('The\x20User\x20ID\x20is:',_0x13f1cd['id']);return getEndUser(_0x33397a,_0x35d4fb['destcalleridname'],_0x35d4fb[_0xd0d9('0x53')]);})[_0xd0d9('0x24')](function(_0x114c33){_0x3ad415=_0x114c33;logger[_0xd0d9('0x1c')](_0xd0d9('0x54'),_0x3ad415['id']);return getTicket(_0x33397a,_0x13f1cd,_0x3ad415,_0x35ba61,_0x35d4fb);})[_0xd0d9('0x24')](function(_0x3d602f){if(_0x3d602f&&_0x3d602f['id']){logger[_0xd0d9('0x1c')](_0xd0d9('0x1d'));logger['info'](_0xd0d9('0x4b'),_0x3d602f['id']);logger[_0xd0d9('0x1c')](_0xd0d9('0x52'),_0xd0d9('0x55'));emit(util[_0xd0d9('0xd')](_0xd0d9('0x4c'),_0x11b753['name']),'trigger:browser:url',{'uri':util[_0xd0d9('0xd')]('%s/helpdesk/tickets/%d',_0x33397a[_0xd0d9('0x1a')],_0x3d602f['id'])});}})['catch'](function(_0x3b7937){logger[_0xd0d9('0x4e')](_0xd0d9('0x52'),JSON[_0xd0d9('0x4f')](_0x3b7937));});};exports[_0xd0d9('0x56')]=function(_0x53c8a6,_0x2e9a62,_0x4569a8,_0x4eb705,_0x2b6eef,_0x126120){var _0x48a137,_0x25f871;_0x126120[_0xd0d9('0x1a')]=intUtil[_0xd0d9('0x42')](_0x126120[_0xd0d9('0x1a')]);_0x126120[_0xd0d9('0x41')]=intUtil[_0xd0d9('0x42')](_0x126120['serverUrl']);if(_0x2b6eef&&_0x2b6eef[_0xd0d9('0x43')]){logger[_0xd0d9('0x1c')]('['+_0x2e9a62[_0xd0d9('0x57')][_0xd0d9('0x58')]()+']',_0xd0d9('0x45'));_0x2e9a62['recordingURL']=util[_0xd0d9('0xd')](_0xd0d9('0x47'),_0x126120['serverUrl'],_0x2e9a62['uniqueid'],md5(_0x2e9a62['uniqueid']));}else{_0x2e9a62[_0xd0d9('0x46')]='';}headers[_0xd0d9('0x49')]=getAuth(_0x126120);return getUser(_0x126120,'')['then'](function(_0x17efe8){_0x48a137=_0x17efe8;logger['info'](_0xd0d9('0x4a'),_0x48a137['id']);return getEndUser(_0x126120,_0x2e9a62['calleridname'],_0x2e9a62['calleridnum']);})[_0xd0d9('0x24')](function(_0x76107f){_0x25f871=_0x76107f;logger['info'](_0xd0d9('0x54'),_0x25f871['id']);return getTicket(_0x126120,_0x48a137,_0x25f871,_0x4569a8,_0x2e9a62);})[_0xd0d9('0x24')](function(_0x59dd02){if(_0x59dd02){logger[_0xd0d9('0x1c')](_0xd0d9('0x1d'));logger[_0xd0d9('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x59dd02['id']);}})[_0xd0d9('0x59')](function(_0x5d069a){logger[_0xd0d9('0x4e')]('['+_0x2e9a62[_0xd0d9('0x57')]['toUpperCase']()+']',JSON[_0xd0d9('0x4f')](_0x5d069a));});}; \ 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 2575254..51b6a0d 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 _0xc8f5=['agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','catch','GET','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','ticketId','Task\x20created:','/contacts/','emit','trigger:browser:url','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','destcalleridnum','unmanaged','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase'];(function(_0x1d7c94,_0x1a4d75){var _0x2e7eef=function(_0x36974){while(--_0x36974){_0x1d7c94['push'](_0x1d7c94['shift']());}};_0x2e7eef(++_0x1a4d75);}(_0xc8f5,0x8e));var _0x5c8f=function(_0x454bd3,_0x3e4d94){_0x454bd3=_0x454bd3-0x0;var _0x4eb066=_0xc8f5[_0x454bd3];return _0x4eb066;};'use strict';var _=require(_0x5c8f('0x0'));var rp=require(_0x5c8f('0x1'));var md5=require(_0x5c8f('0x2'));var util=require(_0x5c8f('0x3'));var moment=require(_0x5c8f('0x4'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x5c8f('0x5'));var config=require(_0x5c8f('0x6'));var logger=require(_0x5c8f('0x7'))(_0x5c8f('0x8'));config['redis']=_[_0x5c8f('0x9')](config[_0x5c8f('0xa')],{'host':_0x5c8f('0xb'),'port':0x18eb});var io=require(_0x5c8f('0xc'))(new Redis(config[_0x5c8f('0xa')]));function getAdminId(_0x4a4152,_0x3e2b15,_0x431c9f,_0x58e671){return new Promise(function(_0x32103e,_0x3bcd4f){var _0x2ad883=![];var _0x4fdc95={'method':'GET','uri':_0x58e671+_0x5c8f('0xd'),'json':!![]};_0x4fdc95[_0x5c8f('0xe')]=_0x431c9f;logger[_0x5c8f('0xf')](_0x5c8f('0x10'));return rp(_0x4fdc95)[_0x5c8f('0x11')](function(_0x5230cf){if(_0x5230cf){var _0x186f6b=_0x5230cf[_0x5c8f('0x12')];var _0x44abf9=null;for(_0x44abf9=0x0;_0x44abf9<_0x186f6b[_0x5c8f('0x13')];_0x44abf9++){if(_0x186f6b[_0x44abf9][_0x5c8f('0x14')]===_0x4a4152['adminEmail']){_0x4a4152['adminId']=_0x186f6b[_0x44abf9]['id'];_0x2ad883=!![];}}if(_0x2ad883){logger[_0x5c8f('0xf')](_0x5c8f('0x15'),_0x4a4152[_0x5c8f('0x16')]);_0x32103e(_0x4a4152);}else{_0x3bcd4f({'statusCode':0x194,'message':_0x5c8f('0x17')});}}else{_0x3bcd4f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x491673){logger[_0x5c8f('0x18')]('['+[_0x3e2b15[_0x5c8f('0x19')]()]+']',_0x491673['message']);_0x3bcd4f(_0x491673);});});}function getUser(_0x29b316,_0x51141c,_0x547a37){return function(_0x5c4d40){return new Promise(function(_0x47e2c8,_0x361449){var _0x4851fe={'method':'GET','uri':_0x547a37+_0x5c8f('0xd'),'json':!![]};_0x4851fe['headers']=_0x51141c;logger['info']('Getting\x20user\x20list');return rp(_0x4851fe)[_0x5c8f('0x11')](function(_0x3fd52a){if(_0x3fd52a){var _0x52cc4d=_0x3fd52a[_0x5c8f('0x12')];var _0x40a873=![];var _0x38adc5=null;if(_0x5c4d40[_0x5c8f('0x1a')]!==null){logger[_0x5c8f('0xf')]('Getting\x20user\x20with\x20email',_0x5c4d40[_0x5c8f('0x1a')]);_0x5c4d40[_0x5c8f('0x1b')]=_0x5c4d40['agentEmail'];for(_0x38adc5=0x0;_0x38adc5<_0x52cc4d[_0x5c8f('0x13')];_0x38adc5++){if(_0x52cc4d[_0x38adc5][_0x5c8f('0x14')]===_0x5c4d40[_0x5c8f('0x1a')]){_0x40a873=!![];_0x5c4d40[_0x5c8f('0x1c')]=_0x52cc4d[_0x38adc5]['id'];logger['info'](_0x5c8f('0x1d'),_0x5c4d40[_0x5c8f('0x1c')]);}}}if(!_0x40a873){logger[_0x5c8f('0xf')](_0x5c8f('0x1e'));_0x5c4d40['userEmail']=_0x5c4d40['adminEmail'];_0x5c4d40[_0x5c8f('0x1c')]=_0x5c4d40[_0x5c8f('0x16')];_0x40a873=!![];}if(_0x40a873){_0x47e2c8(_0x5c4d40);}else{_0x361449({'statusCode':0x194,'message':_0x5c8f('0x17')});}}else{_0x361449({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x5c8f('0x1f')](function(_0xf54e91){logger['error']('['+[_0x29b316[_0x5c8f('0x19')]()]+']',_0xf54e91['message']);_0x361449(_0xf54e91);});});};}function searchContact(_0x4b9c19,_0x4a5783,_0x2ec69d,_0x523304){return new Promise(function(_0x16d060,_0x2fd358){var _0x22473d={'method':_0x5c8f('0x20'),'headers':_0x4a5783,'uri':_0x4b9c19+_0x5c8f('0x21')+_0x523304+_0x5c8f('0x22')+_0x2ec69d+_0x5c8f('0x23'),'json':!![]};rp(_0x22473d)[_0x5c8f('0x11')](function(_0x3f2f14){var _0x1c6e47=_[_0x5c8f('0x24')](_0x3f2f14['contacts'][_0x5c8f('0x25')],[_0x2ec69d,_0x523304]);_0x16d060(_0x1c6e47);})[_0x5c8f('0x1f')](function(_0x1a72b5){_0x2fd358(_0x1a72b5);});});}function getEndUser(_0x299382,_0x37e5d4,_0x80b464){return function(_0x5ba72a){return new Promise(function(_0x2eaabc,_0x2aa5ae){logger[_0x5c8f('0xf')](util[_0x5c8f('0x26')](_0x5c8f('0x27'),_0x5ba72a['contactNumber']));searchContact(_0x80b464,_0x37e5d4,_0x5c8f('0x28'),_0x5ba72a['contactNumber'])[_0x5c8f('0x11')](function(_0x3d1c66){if(_0x3d1c66){_0x5ba72a[_0x5c8f('0x29')]=_0x3d1c66['id'];logger[_0x5c8f('0xf')](_0x5c8f('0x2a'),_0x5ba72a[_0x5c8f('0x29')]);return _0x2eaabc(_0x5ba72a);}searchContact(_0x80b464,_0x37e5d4,_0x5c8f('0x2b'),_0x5ba72a[_0x5c8f('0x2c')])[_0x5c8f('0x11')](function(_0x397343){if(_0x397343){_0x5ba72a[_0x5c8f('0x29')]=_0x397343['id'];logger[_0x5c8f('0xf')]('Contact\x20found\x20work_number:',_0x5ba72a[_0x5c8f('0x29')]);return _0x2eaabc(_0x5ba72a);}createEndUser(_0x5ba72a,_0x299382,_0x37e5d4,_0x80b464)[_0x5c8f('0x11')](function(_0x4f7188){logger[_0x5c8f('0xf')](_0x5c8f('0x2d'),_0x4f7188[_0x5c8f('0x29')]);return _0x2eaabc(_0x4f7188);});});})['catch'](function(_0xaf8ec7){_0x2aa5ae(_0xaf8ec7);});});};}function createEndUser(_0x3445e0,_0x24ebfd,_0x130e99,_0x2f57b5){return new Promise(function(_0x63b409,_0x435333){var _0xc42776=moment();var _0x3cc890={'method':_0x5c8f('0x2e'),'uri':_0x2f57b5+'/api/contacts','body':{'contact':{'last_name':_0x3445e0[_0x5c8f('0x2c')],'work_number':_0x3445e0[_0x5c8f('0x2c')],'mobile_number':_0x3445e0[_0x5c8f('0x2c')],'owner_id':_0x3445e0[_0x5c8f('0x1c')],'created_at':_0xc42776['format'](_0x5c8f('0x2f'))}},'json':!![]};_0x3cc890['headers']=_0x130e99;logger['info'](_0x5c8f('0x30'));return rp(_0x3cc890)['then'](function(_0x35d043){_0x3445e0['endUserId']=_0x35d043[_0x5c8f('0x31')]['id'];_0x63b409(_0x3445e0);})[_0x5c8f('0x1f')](function(_0x4dbef0){logger[_0x5c8f('0x18')]('['+[_0x24ebfd[_0x5c8f('0x19')]()]+']',_0x4dbef0[_0x5c8f('0x32')]);_0x435333(_0x4dbef0[_0x5c8f('0x32')]);});});}function getTicket(_0x36e7f9,_0x4ef63a,_0x15bd59,_0x5369c7,_0x3b2c28){return function(_0x5445c2){logger[_0x5c8f('0xf')](_0x5c8f('0x33'));return new Promise(function(_0x272268,_0x56e0b7){var _0x28c133=moment();var _0x24c9bb={'method':_0x5c8f('0x2e'),'uri':_0x15bd59+_0x5c8f('0x34'),'body':{'title':intUtil[_0x5c8f('0x35')](_0x5369c7[_0x5c8f('0x36')],_0x3b2c28,'\x20'),'description':intUtil['getString'](_0x5369c7['Descriptions'],_0x3b2c28,'\x0a'),'owner_id':_0x5445c2[_0x5c8f('0x1c')],'creater_id':_0x5445c2[_0x5c8f('0x16')],'targetable_id':_0x5445c2[_0x5c8f('0x29')],'targetable_type':_0x5c8f('0x37'),'created_at':_0x28c133['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x28c133['add'](0x1e,'m')[_0x5c8f('0x26')](_0x5c8f('0x2f'))},'json':!![]};_0x24c9bb['headers']=_0x4ef63a;return rp(_0x24c9bb)[_0x5c8f('0x11')](function(_0x1196ce){_0x5445c2[_0x5c8f('0x38')]=_0x1196ce['task']['id'];logger[_0x5c8f('0xf')](_0x5c8f('0x39'),_0x5445c2[_0x5c8f('0x38')]);_0x272268(_0x5445c2);})[_0x5c8f('0x1f')](function(_0x21293f){logger[_0x5c8f('0x18')]('['+[_0x36e7f9[_0x5c8f('0x19')]()]+']',_0x21293f['message']);_0x56e0b7(_0x21293f['message']);});});};}function emit(_0x528419,_0xa010b6,_0x20a150){var _0xb50b51={'uri':_0x528419+_0x5c8f('0x3a')+_0x20a150};io['to'](util['format']('user:%s',_0xa010b6))[_0x5c8f('0x3b')](_0x5c8f('0x3c'),_0xb50b51);}exports['cs']=function(_0x5541a4,_0x45cee1,_0x3e0ade,_0x102e64,_0x144c86,_0x85012e,_0x14972d,_0x48b762){var _0x248e7b={};var _0x46b314={'Authorization':'Token\x20token='+_0x85012e[_0x5c8f('0x3d')]};_0x85012e['remoteUri']=intUtil[_0x5c8f('0x3e')](_0x85012e['remoteUri']);_0x85012e[_0x5c8f('0x3f')]=intUtil['stripTrailingSlash'](_0x85012e[_0x5c8f('0x3f')]);var _0x41101f=_0x85012e[_0x5c8f('0x40')];_0x248e7b['adminEmail']=_0x85012e[_0x5c8f('0x41')];_0x248e7b['contactNumber']=_0x48b762[_0x5c8f('0x42')]()==='outbound'?_0x45cee1[_0x5c8f('0x43')]:_0x45cee1['calleridnum'];_0x248e7b['callDirection']=_0x48b762==='queue'||_0x48b762===_0x5c8f('0x44')?_0x5c8f('0x45'):_0x5c8f('0x46');if(_0x102e64){_0x248e7b[_0x5c8f('0x1a')]=_0x102e64[_0x5c8f('0x14')];}var _0x4b79b0=util['format'](_0x5c8f('0x47'),_0x85012e['serverUrl'],_0x45cee1[_0x5c8f('0x48')],md5(_0x45cee1['uniqueid']));if(_0x144c86&&_0x144c86[_0x5c8f('0x49')]){logger[_0x5c8f('0xf')](_0x5c8f('0x4a'),_0x5c8f('0x4b'));_0x45cee1[_0x5c8f('0x4c')]=_0x4b79b0;}else if(_0x14972d&&_0x14972d[_0x5c8f('0x4d')]&&_0x14972d[_0x5c8f('0x4d')]!==_0x5c8f('0x4e')){logger[_0x5c8f('0xf')](_0x5c8f('0x4f'),'Recording\x20is\x20enabled!');_0x45cee1['recordingURL']=_0x4b79b0;}else{_0x45cee1[_0x5c8f('0x4c')]='';}return getAdminId(_0x248e7b,_0x48b762,_0x46b314,_0x41101f)['then'](getUser(_0x48b762,_0x46b314,_0x41101f))[_0x5c8f('0x11')](getEndUser(_0x48b762,_0x46b314,_0x41101f))[_0x5c8f('0x11')](getTicket(_0x48b762,_0x46b314,_0x41101f,_0x3e0ade,_0x45cee1))[_0x5c8f('0x11')](function(_0x4ff161){logger['info'](util[_0x5c8f('0x26')](_0x5c8f('0x50'),_0x4ff161[_0x5c8f('0x38')]));if(_0x48b762!=='unmanaged'){logger[_0x5c8f('0xf')]('['+[_0x48b762[_0x5c8f('0x19')]()]+']',_0x5c8f('0x51'));emit(_0x41101f,_0x102e64['name'],_0x4ff161['endUserId']);}})[_0x5c8f('0x1f')](function(_0x27fe0a){logger['error']('['+[_0x48b762['toUpperCase']()]+_0x5c8f('0x52'),util[_0x5c8f('0x53')](_0x27fe0a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4ae7=['contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','userId','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','getString','Descriptions','YYYY-MM-DDTHH:mm:ss','add','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find'];(function(_0x363b8f,_0x5961a4){var _0x59394f=function(_0x366a9d){while(--_0x366a9d){_0x363b8f['push'](_0x363b8f['shift']());}};_0x59394f(++_0x5961a4);}(_0x4ae7,0x88));var _0x74ae=function(_0x2210d0,_0x45b4db){_0x2210d0=_0x2210d0-0x0;var _0x2aa676=_0x4ae7[_0x2210d0];return _0x2aa676;};'use strict';var _=require(_0x74ae('0x0'));var rp=require(_0x74ae('0x1'));var md5=require(_0x74ae('0x2'));var util=require(_0x74ae('0x3'));var moment=require(_0x74ae('0x4'));var Promise=require(_0x74ae('0x5'));var Redis=require(_0x74ae('0x6'));var intUtil=require(_0x74ae('0x7'));var config=require('../../../../config/environment');var logger=require(_0x74ae('0x8'))('freshsales');config[_0x74ae('0x9')]=_['defaults'](config[_0x74ae('0x9')],{'host':_0x74ae('0xa'),'port':0x18eb});var io=require(_0x74ae('0xb'))(new Redis(config[_0x74ae('0x9')]));function getAdminId(_0x51b0ed,_0x42f716,_0x4ef4c7,_0x20b299){return new Promise(function(_0x3ce12a,_0x5e17af){var _0x1eed6f=![];var _0x3bd770={'method':_0x74ae('0xc'),'uri':_0x20b299+_0x74ae('0xd'),'json':!![]};_0x3bd770['headers']=_0x4ef4c7;logger[_0x74ae('0xe')]('Getting\x20admin\x20information');return rp(_0x3bd770)[_0x74ae('0xf')](function(_0x225c84){if(_0x225c84){var _0x42c5da=_0x225c84[_0x74ae('0x10')];var _0x223e2d=null;for(_0x223e2d=0x0;_0x223e2d<_0x42c5da[_0x74ae('0x11')];_0x223e2d++){if(_0x42c5da[_0x223e2d][_0x74ae('0x12')]===_0x51b0ed[_0x74ae('0x13')]){_0x51b0ed[_0x74ae('0x14')]=_0x42c5da[_0x223e2d]['id'];_0x1eed6f=!![];}}if(_0x1eed6f){logger[_0x74ae('0xe')](_0x74ae('0x15'),_0x51b0ed['adminId']);_0x3ce12a(_0x51b0ed);}else{_0x5e17af({'statusCode':0x194,'message':_0x74ae('0x16')});}}else{_0x5e17af({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x74ae('0x17')](function(_0x1a6de1){logger['error']('['+[_0x42f716[_0x74ae('0x18')]()]+']',_0x1a6de1['message']);_0x5e17af(_0x1a6de1);});});}function getUser(_0x252b0e,_0x1c914b,_0x118551){return function(_0x22e930){return new Promise(function(_0xfd7c2a,_0x199cdc){var _0xb8c113={'method':_0x74ae('0xc'),'uri':_0x118551+_0x74ae('0xd'),'json':!![]};_0xb8c113['headers']=_0x1c914b;logger[_0x74ae('0xe')](_0x74ae('0x19'));return rp(_0xb8c113)['then'](function(_0x10654c){if(_0x10654c){var _0x18edda=_0x10654c['users'];var _0x5cc954=![];var _0xb6e5a=null;if(_0x22e930[_0x74ae('0x1a')]!==null){logger[_0x74ae('0xe')](_0x74ae('0x1b'),_0x22e930[_0x74ae('0x1a')]);_0x22e930['userEmail']=_0x22e930[_0x74ae('0x1a')];for(_0xb6e5a=0x0;_0xb6e5a<_0x18edda[_0x74ae('0x11')];_0xb6e5a++){if(_0x18edda[_0xb6e5a][_0x74ae('0x12')]===_0x22e930[_0x74ae('0x1a')]){_0x5cc954=!![];_0x22e930['userId']=_0x18edda[_0xb6e5a]['id'];logger[_0x74ae('0xe')]('User\x20found:',_0x22e930['userId']);}}}if(!_0x5cc954){logger[_0x74ae('0xe')](_0x74ae('0x1c'));_0x22e930['userEmail']=_0x22e930[_0x74ae('0x13')];_0x22e930['userId']=_0x22e930['adminId'];_0x5cc954=!![];}if(_0x5cc954){_0xfd7c2a(_0x22e930);}else{_0x199cdc({'statusCode':0x194,'message':_0x74ae('0x16')});}}else{_0x199cdc({'statusCode':0x194,'message':_0x74ae('0x16')});}})[_0x74ae('0x17')](function(_0x55602a){logger[_0x74ae('0x1d')]('['+[_0x252b0e[_0x74ae('0x18')]()]+']',_0x55602a['message']);_0x199cdc(_0x55602a);});});};}function searchContact(_0x2a6a1e,_0x15d735,_0x2296b6,_0x41e58a){return new Promise(function(_0x110c60,_0x2abe63){var _0x4f3418={'method':'GET','headers':_0x15d735,'uri':_0x2a6a1e+_0x74ae('0x1e')+_0x41e58a+_0x74ae('0x1f')+_0x2296b6+_0x74ae('0x20'),'json':!![]};rp(_0x4f3418)[_0x74ae('0xf')](function(_0x174e92){var _0x4bcc13=_[_0x74ae('0x21')](_0x174e92[_0x74ae('0x22')][_0x74ae('0x22')],[_0x2296b6,_0x41e58a]);_0x110c60(_0x4bcc13);})[_0x74ae('0x17')](function(_0x1b6cda){_0x2abe63(_0x1b6cda);});});}function getEndUser(_0x1196a5,_0x5c911e,_0x203622){return function(_0x1e9b58){return new Promise(function(_0x18ee24,_0x433634){logger[_0x74ae('0xe')](util[_0x74ae('0x23')](_0x74ae('0x24'),_0x1e9b58['contactNumber']));searchContact(_0x203622,_0x5c911e,_0x74ae('0x25'),_0x1e9b58['contactNumber'])[_0x74ae('0xf')](function(_0x3b3b7b){if(_0x3b3b7b){_0x1e9b58['endUserId']=_0x3b3b7b['id'];logger[_0x74ae('0xe')](_0x74ae('0x26'),_0x1e9b58[_0x74ae('0x27')]);return _0x18ee24(_0x1e9b58);}searchContact(_0x203622,_0x5c911e,_0x74ae('0x28'),_0x1e9b58[_0x74ae('0x29')])[_0x74ae('0xf')](function(_0x1404a6){if(_0x1404a6){_0x1e9b58[_0x74ae('0x27')]=_0x1404a6['id'];logger[_0x74ae('0xe')](_0x74ae('0x2a'),_0x1e9b58['endUserId']);return _0x18ee24(_0x1e9b58);}createEndUser(_0x1e9b58,_0x1196a5,_0x5c911e,_0x203622)[_0x74ae('0xf')](function(_0x410ddd){logger[_0x74ae('0xe')](_0x74ae('0x2b'),_0x410ddd[_0x74ae('0x27')]);return _0x18ee24(_0x410ddd);});});})[_0x74ae('0x17')](function(_0x33f725){_0x433634(_0x33f725);});});};}function createEndUser(_0x3161c8,_0x4b37ea,_0x5665eb,_0x50c165){return new Promise(function(_0x202314,_0x3dd574){var _0x5fd27b=moment();var _0x365328={'method':_0x74ae('0x2c'),'uri':_0x50c165+_0x74ae('0x2d'),'body':{'contact':{'last_name':_0x3161c8[_0x74ae('0x29')],'work_number':_0x3161c8[_0x74ae('0x29')],'mobile_number':_0x3161c8[_0x74ae('0x29')],'owner_id':_0x3161c8[_0x74ae('0x2e')],'created_at':_0x5fd27b[_0x74ae('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x365328['headers']=_0x5665eb;logger[_0x74ae('0xe')](_0x74ae('0x2f'));return rp(_0x365328)[_0x74ae('0xf')](function(_0x2f7db0){_0x3161c8['endUserId']=_0x2f7db0[_0x74ae('0x30')]['id'];_0x202314(_0x3161c8);})[_0x74ae('0x17')](function(_0x2c58af){logger['error']('['+[_0x4b37ea[_0x74ae('0x18')]()]+']',_0x2c58af[_0x74ae('0x31')]);_0x3dd574(_0x2c58af['message']);});});}function getTicket(_0x178deb,_0x506fca,_0x247d58,_0x2be301,_0x5e3a0a){return function(_0x11374a){logger[_0x74ae('0xe')](_0x74ae('0x32'));return new Promise(function(_0x5b9fb8,_0x3f5a12){var _0x4a7144=moment();var _0x54218a={'method':_0x74ae('0x2c'),'uri':_0x247d58+_0x74ae('0x33'),'body':{'title':intUtil[_0x74ae('0x34')](_0x2be301['Subjects'],_0x5e3a0a,'\x20'),'description':intUtil[_0x74ae('0x34')](_0x2be301[_0x74ae('0x35')],_0x5e3a0a,'\x0a'),'owner_id':_0x11374a[_0x74ae('0x2e')],'creater_id':_0x11374a[_0x74ae('0x14')],'targetable_id':_0x11374a[_0x74ae('0x27')],'targetable_type':'Contact','created_at':_0x4a7144['format'](_0x74ae('0x36')),'due_date':_0x4a7144[_0x74ae('0x37')](0x1e,'m')['format'](_0x74ae('0x36'))},'json':!![]};_0x54218a['headers']=_0x506fca;return rp(_0x54218a)[_0x74ae('0xf')](function(_0x3e206f){_0x11374a[_0x74ae('0x38')]=_0x3e206f['task']['id'];logger[_0x74ae('0xe')]('Task\x20created:',_0x11374a[_0x74ae('0x38')]);_0x5b9fb8(_0x11374a);})['catch'](function(_0x18f3b5){logger['error']('['+[_0x178deb[_0x74ae('0x18')]()]+']',_0x18f3b5[_0x74ae('0x31')]);_0x3f5a12(_0x18f3b5[_0x74ae('0x31')]);});});};}function emit(_0x16ada9,_0xdca7d4,_0x3c474c){var _0x2340ef={'uri':_0x16ada9+_0x74ae('0x39')+_0x3c474c};io['to'](util[_0x74ae('0x23')](_0x74ae('0x3a'),_0xdca7d4))[_0x74ae('0x3b')](_0x74ae('0x3c'),_0x2340ef);}exports['cs']=function(_0x382ea4,_0x147ae0,_0x1baa2a,_0x1ec16f,_0x100e5b,_0x12f739,_0x176fc6,_0x58c48d){var _0x4792c0={};var _0x42d1ad={'Authorization':_0x74ae('0x3d')+_0x12f739['apiKey']};_0x12f739[_0x74ae('0x3e')]=intUtil[_0x74ae('0x3f')](_0x12f739['remoteUri']);_0x12f739['serverUrl']=intUtil[_0x74ae('0x3f')](_0x12f739['serverUrl']);var _0x2ef031=_0x12f739[_0x74ae('0x3e')];_0x4792c0[_0x74ae('0x13')]=_0x12f739[_0x74ae('0x40')];_0x4792c0['contactNumber']=_0x58c48d['toLowerCase']()===_0x74ae('0x41')?_0x147ae0[_0x74ae('0x42')]:_0x147ae0[_0x74ae('0x43')];_0x4792c0[_0x74ae('0x44')]=_0x58c48d===_0x74ae('0x45')||_0x58c48d===_0x74ae('0x46')?_0x74ae('0x45'):'outbound';if(_0x1ec16f){_0x4792c0[_0x74ae('0x1a')]=_0x1ec16f[_0x74ae('0x12')];}var _0xedba5a=util['format'](_0x74ae('0x47'),_0x12f739[_0x74ae('0x48')],_0x147ae0['uniqueid'],md5(_0x147ae0[_0x74ae('0x49')]));if(_0x100e5b&&_0x100e5b[_0x74ae('0x4a')]){logger[_0x74ae('0xe')](_0x74ae('0x4b'),_0x74ae('0x4c'));_0x147ae0[_0x74ae('0x4d')]=_0xedba5a;}else if(_0x176fc6&&_0x176fc6['recordingFormat']&&_0x176fc6[_0x74ae('0x4e')]!==_0x74ae('0x4f')){logger[_0x74ae('0xe')](_0x74ae('0x50'),_0x74ae('0x4c'));_0x147ae0[_0x74ae('0x4d')]=_0xedba5a;}else{_0x147ae0['recordingURL']='';}return getAdminId(_0x4792c0,_0x58c48d,_0x42d1ad,_0x2ef031)[_0x74ae('0xf')](getUser(_0x58c48d,_0x42d1ad,_0x2ef031))[_0x74ae('0xf')](getEndUser(_0x58c48d,_0x42d1ad,_0x2ef031))[_0x74ae('0xf')](getTicket(_0x58c48d,_0x42d1ad,_0x2ef031,_0x1baa2a,_0x147ae0))[_0x74ae('0xf')](function(_0x3cd54b){logger[_0x74ae('0xe')](util[_0x74ae('0x23')](_0x74ae('0x51'),_0x3cd54b[_0x74ae('0x38')]));if(_0x58c48d!==_0x74ae('0x46')){logger[_0x74ae('0xe')]('['+[_0x58c48d[_0x74ae('0x18')]()]+']',_0x74ae('0x52'));emit(_0x2ef031,_0x1ec16f['name'],_0x3cd54b['endUserId']);}})['catch'](function(_0x4f75db){logger[_0x74ae('0x1d')]('['+[_0x58c48d[_0x74ae('0x18')]()]+_0x74ae('0x53'),util[_0x74ae('0x54')](_0x4f75db,{'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 252030a..e7481e8 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 _0x74c8=['lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found'];(function(_0x54e95d,_0x2373ff){var _0xa71f8d=function(_0x514fd1){while(--_0x514fd1){_0x54e95d['push'](_0x54e95d['shift']());}};_0xa71f8d(++_0x2373ff);}(_0x74c8,0x126));var _0x874c=function(_0xfc0bd,_0x60ef2f){_0xfc0bd=_0xfc0bd-0x0;var _0x5cd466=_0x74c8[_0xfc0bd];return _0x5cd466;};'use strict';var _=require(_0x874c('0x0'));var util=require(_0x874c('0x1'));var zendesk=require(_0x874c('0x2'));var salesforce=require(_0x874c('0x3'));var sugarcrm=require(_0x874c('0x4'));var freshdesk=require(_0x874c('0x5'));var zoho=require(_0x874c('0x6'));var desk=require(_0x874c('0x7'));var vtiger=require(_0x874c('0x8'));var servicenow=require(_0x874c('0x9'));var dynamics365=require(_0x874c('0xa'));var freshsales=require(_0x874c('0xb'));var integrations=['zendesk','salesforce',_0x874c('0xc'),_0x874c('0xd'),_0x874c('0xe'),_0x874c('0xf'),_0x874c('0x10'),_0x874c('0x11'),_0x874c('0x12'),'servicenow'];exports[_0x874c('0x13')]=function(_0x38e49d,_0x139a03,_0x221596,_0x3e2eab,_0x9cc12d,_0x161f1f){if(_0x221596){if(_[_0x874c('0x14')](integrations,_0x38e49d[_0x874c('0x15')][_0x874c('0x16')]())){try{var _0x1adae0=null;var _0x4d7004='';var _0x5adc1b=_0x221596[_0x38e49d[_0x874c('0x15')]['toLowerCase']()];if(_0x5adc1b){var _0x3141a1=_0x5adc1b[_0x38e49d[_0x874c('0x17')]];if(_0x3141a1){var _0xa56e13=_['find'](_0x3141a1[_0x874c('0x18')],{'id':parseInt(_0x38e49d[_0x874c('0x19')],0xa)});if(_0xa56e13){if(_0x3e2eab){if(_0x9cc12d&&_0x139a03[_0x874c('0x1a')]){_0x4d7004=_0x874c('0x1a');}else if(_0x139a03[_0x874c('0x1b')]){_0x4d7004=_0x874c('0x1c');}else{console[_0x874c('0x1d')](_0x874c('0x1e'),_0x139a03);}}else{_0x4d7004=_0x874c('0x1f');}switch(_0x38e49d[_0x874c('0x15')][_0x874c('0x16')]()){case _0x874c('0x20'):zendesk[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case _0x874c('0x21'):salesforce[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case _0x874c('0xc'):sugarcrm[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case'freshdesk':freshdesk[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case _0x874c('0xe'):zoho[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case _0x874c('0xf'):desk[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case _0x874c('0x10'):vtiger[_0x4d7004](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f);break;case _0x874c('0x12'):freshsales['cs'](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f,_0x4d7004);break;case _0x874c('0x22'):servicenow['cs'](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f,_0x4d7004);break;case _0x874c('0x11'):dynamics365['cs'](_0x38e49d,_0x139a03,_0xa56e13,_0x3e2eab,_0x9cc12d,_0x3141a1,_0x161f1f,_0x4d7004);break;default:console[_0x874c('0x1d')](_0x874c('0x23'));}}else{_0x1adae0=require(_0x874c('0x24'))(_0x38e49d[_0x874c('0x15')][_0x874c('0x16')]());_0x1adae0[_0x874c('0x25')](_0x874c('0x26'),util[_0x874c('0x27')](_0x874c('0x28'),_0x38e49d['data1'][_0x874c('0x16')](),_0x38e49d[_0x874c('0x19')]));}}else{_0x1adae0=require(_0x874c('0x24'))(_0x38e49d['data1'][_0x874c('0x16')]());_0x1adae0[_0x874c('0x25')](_0x874c('0x26'),util['format'](_0x874c('0x29'),_0x38e49d[_0x874c('0x15')][_0x874c('0x16')](),_0x38e49d['data2']));}}else{}}catch(_0x2ec4c6){console[_0x874c('0x25')](_0x2ec4c6);}}}}; \ No newline at end of file +var _0x650c=['./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','freshdesk','zoho','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk'];(function(_0x143d74,_0x43055c){var _0xfec465=function(_0x4d0404){while(--_0x4d0404){_0x143d74['push'](_0x143d74['shift']());}};_0xfec465(++_0x43055c);}(_0x650c,0xcf));var _0xc650=function(_0xb8d26c,_0x37f6d3){_0xb8d26c=_0xb8d26c-0x0;var _0x3516f6=_0x650c[_0xb8d26c];return _0x3516f6;};'use strict';var _=require(_0xc650('0x0'));var util=require(_0xc650('0x1'));var zendesk=require(_0xc650('0x2'));var salesforce=require(_0xc650('0x3'));var sugarcrm=require(_0xc650('0x4'));var freshdesk=require(_0xc650('0x5'));var zoho=require(_0xc650('0x6'));var desk=require(_0xc650('0x7'));var vtiger=require(_0xc650('0x8'));var servicenow=require(_0xc650('0x9'));var dynamics365=require(_0xc650('0xa'));var freshsales=require(_0xc650('0xb'));var integrations=[_0xc650('0xc'),_0xc650('0xd'),'sugarcrm','freshdesk','zoho','desk',_0xc650('0xe'),_0xc650('0xf'),_0xc650('0x10'),_0xc650('0x11')];exports[_0xc650('0x12')]=function(_0x56e16a,_0x123b3e,_0x1a99a8,_0x36a083,_0x231b6c,_0x1b5851){if(_0x1a99a8){if(_[_0xc650('0x13')](integrations,_0x56e16a[_0xc650('0x14')][_0xc650('0x15')]())){try{var _0x558052=null;var _0x131d5d='';var _0x11ac61=_0x1a99a8[_0x56e16a[_0xc650('0x14')][_0xc650('0x15')]()];if(_0x11ac61){var _0x1495da=_0x11ac61[_0x56e16a[_0xc650('0x16')]];if(_0x1495da){var _0x4bc121=_[_0xc650('0x17')](_0x1495da[_0xc650('0x18')],{'id':parseInt(_0x56e16a['data3'],0xa)});if(_0x4bc121){if(_0x36a083){if(_0x231b6c&&_0x123b3e['queue']){_0x131d5d=_0xc650('0x19');}else if(_0x123b3e[_0xc650('0x1a')]){_0x131d5d=_0xc650('0x1b');}else{console[_0xc650('0x1c')](_0xc650('0x1d'),_0x123b3e);}}else{_0x131d5d=_0xc650('0x1e');}switch(_0x56e16a[_0xc650('0x14')][_0xc650('0x15')]()){case _0xc650('0xc'):zendesk[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0xd'):salesforce[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0x1f'):sugarcrm[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0x20'):freshdesk[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0x21'):zoho[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0x22'):desk[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0xe'):vtiger[_0x131d5d](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851);break;case _0xc650('0x10'):freshsales['cs'](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851,_0x131d5d);break;case _0xc650('0x11'):servicenow['cs'](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851,_0x131d5d);break;case _0xc650('0xf'):dynamics365['cs'](_0x56e16a,_0x123b3e,_0x4bc121,_0x36a083,_0x231b6c,_0x1495da,_0x1b5851,_0x131d5d);break;default:console[_0xc650('0x1c')](_0xc650('0x23'));}}else{_0x558052=require(_0xc650('0x24'))(_0x56e16a[_0xc650('0x14')]['toLowerCase']());_0x558052[_0xc650('0x25')](_0xc650('0x26'),util[_0xc650('0x27')]('%s\x20configuration\x20#%s\x20not\x20found',_0x56e16a['data1'][_0xc650('0x15')](),_0x56e16a[_0xc650('0x28')]));}}else{_0x558052=require(_0xc650('0x24'))(_0x56e16a['data1']['toLowerCase']());_0x558052[_0xc650('0x25')](_0xc650('0x26'),util['format'](_0xc650('0x29'),_0x56e16a[_0xc650('0x14')][_0xc650('0x15')](),_0x56e16a[_0xc650('0x16')]));}}else{}}catch(_0x560190){console[_0xc650('0x25')](_0x560190);}}}}; \ 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 bc2a3f2..4829a9e 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 _0x404b=['Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','create','forEach','includes','string','idField','content','toString','variableName','customVariable','Variable','name','password','Connection','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','util','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','assign','Descriptions','Task','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','find','execute','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','Contact','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate'];(function(_0x2f5ff3,_0x212d25){var _0x3a3075=function(_0x991503){while(--_0x991503){_0x2f5ff3['push'](_0x2f5ff3['shift']());}};_0x3a3075(++_0x212d25);}(_0x404b,0x1a0));var _0xb404=function(_0x121dc9,_0x139628){_0x121dc9=_0x121dc9-0x0;var _0x5c3a96=_0x404b[_0x121dc9];return _0x5c3a96;};'use strict';var _=require('lodash');var rp=require(_0xb404('0x0'));var moment=require(_0xb404('0x1'));var BPromise=require(_0xb404('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xb404('0x3'));var Redis=require('ioredis');var intUtil=require(_0xb404('0x4'));var config=require(_0xb404('0x5'));var logger=require('../../../../config/logger')('salesforce');config[_0xb404('0x6')]=_['defaults'](config['redis'],{'host':_0xb404('0x7'),'port':0x18eb});var io=require(_0xb404('0x8'))(new Redis(config[_0xb404('0x6')]));function emit(_0x32834f,_0x5f37ef,_0x54e412){io['to'](_0x32834f)[_0xb404('0x9')](_0x5f37ef,_0x54e412);}function getTicket(_0x54a900,_0x4bd847,_0x455e3d,_0x5c4113,_0x1a26e4,_0x17c874,_0x13ec5c,_0x4522cc){var _0x548744=Object[_0xb404('0xa')]({},{'OwnerId':_0x4bd847['id'],'Subject':intUtil['getString'](_0x5c4113['Subjects'],_0x1a26e4,'\x20'),'Description':intUtil['getString'](_0x5c4113[_0xb404('0xb')],_0x1a26e4,'\x0a')},getCustomFields(_0x17c874,_0x1a26e4));if(_0x455e3d){if(_0x5c4113['ticketType']===_0xb404('0xc')){_0x548744['ActivityDate']=moment['utc']();_0x548744['IsReminderSet']=![];_0x548744[_0xb404('0xd')]=![];if(_0x455e3d[_0xb404('0xe')]===_0xb404('0xf')||_0x455e3d[_0xb404('0xe')]===_0xb404('0x10')){_0x548744[_0xb404('0x11')]=_0x455e3d['id'];}else if(_0x455e3d['endUserType']===_0xb404('0x12')){_0x548744[_0xb404('0x13')]=_0x455e3d['id'];}}else if(_0x5c4113[_0xb404('0x14')]==='Case'){if(_0x455e3d[_0xb404('0xe')]===_0xb404('0xf')){_0x548744[_0xb404('0x15')]=_0x455e3d['id'];}else if(_0x455e3d[_0xb404('0xe')]===_0xb404('0x12')){_0x548744[_0xb404('0x16')]=_0x455e3d['id'];}else if(_0x455e3d['endUserType']==='lead'&&_0x5c4113[_0xb404('0x17')]){_0x548744[_0x5c4113['leadId']]=_0x455e3d['id'];}else{logger[_0xb404('0x18')](_0xb404('0x19'));}}}return _0x13ec5c[_0xb404('0x1a')](_0x5c4113[_0xb404('0x14')])['create'](_0x548744);}function getUser(_0x102ee0,_0xc5cd2e,_0x2361bb){if(!_[_0xb404('0x1b')](_0xc5cd2e)&&intUtil['validateEmail'](_0xc5cd2e)){var _0x38ded5={'Email':_0xc5cd2e};var _0x28545b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2361bb['sobject'](_0xb404('0x1c'))[_0xb404('0x1d')](_0x38ded5,_0x28545b)[_0xb404('0x1e')]()['then'](function(_0x2aff91){if(_0x2aff91[_0xb404('0x1f')]){var _0x15d554=_['find'](_0x2aff91,function(_0x271843){return _0x271843['Email']===_0xc5cd2e;});if(_0x15d554){logger['info'](_0xb404('0x20'),_0xc5cd2e);return BPromise[_0xb404('0x21')]({'id':_0x15d554['Id'],'name':_0x15d554[_0xb404('0x22')]});}}else{logger[_0xb404('0x18')](_0xb404('0x23'),_0xc5cd2e);return _0x2361bb[_0xb404('0x24')]()[_0xb404('0x25')](function(_0x355fb5){return BPromise[_0xb404('0x21')]({'id':_0x355fb5['user_id'],'name':_0x355fb5[_0xb404('0x26')]});});}});}else{logger[_0xb404('0x18')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xc5cd2e);return _0x2361bb['identity']()[_0xb404('0x25')](function(_0x1c36c8){return BPromise[_0xb404('0x21')]({'id':_0x1c36c8[_0xb404('0x27')],'name':_0x1c36c8[_0xb404('0x26')]});});}}function getEndUser(_0x1fad3f,_0xf274bc,_0x45f8ab,_0x546671,_0x398eaa){var _0x4a5156={'$or':{'Phone':_0x546671}};var _0x56d5d8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb404('0x21')]()[_0xb404('0x25')](function(){logger['info'](_0xb404('0x28'),_0x546671,_0xf274bc[_0xb404('0x29')]);switch(_0xf274bc[_0xb404('0x29')]){case _0xb404('0x2a'):var _0x5aef93=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc['additionalSearchContact']){var _0x54137e={};_0x54137e[_0xf274bc[_0xb404('0x2c')]]=_0x546671;_[_0xb404('0x2d')](_0x5aef93[_0xb404('0x2e')],_0x54137e);}return _0x398eaa[_0xb404('0x1a')]('Contact')[_0xb404('0x1d')](_0x5aef93,_0x56d5d8)['execute']()[_0xb404('0x25')](function(_0x614150){if(_0x614150&&_0x614150[_0xb404('0x1f')]){return _0x614150;}else{var _0x450fbb=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc['additionalSearchLead']){var _0x578d43={};_0x578d43[_0xf274bc[_0xb404('0x2f')]]=_0x546671;_[_0xb404('0x2d')](_0x450fbb[_0xb404('0x2e')],_0x578d43);}return _0x398eaa[_0xb404('0x1a')]('Lead')['find'](_0x450fbb,_0x56d5d8);}});case _0xb404('0x30'):var _0x36fc3b=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc['additionalSearchAccount']){var _0x54137e={};_0x54137e[_0xf274bc[_0xb404('0x31')]]=_0x546671;_['merge'](_0x36fc3b[_0xb404('0x2e')],_0x54137e);}return _0x398eaa['sobject'](_0xb404('0x32'))[_0xb404('0x1d')](_0x36fc3b,_0x56d5d8)[_0xb404('0x1e')]()[_0xb404('0x25')](function(_0x1d6e86){if(_0x1d6e86&&_0x1d6e86[_0xb404('0x1f')]){return _0x1d6e86;}else{var _0x20eeae=_['cloneDeep'](_0x4a5156);if(_0xf274bc['additionalSearchContact']){var _0xe68053={};_0xe68053[_0xf274bc['additionalSearchContact']]=_0x546671;_[_0xb404('0x2d')](_0x20eeae[_0xb404('0x2e')],_0xe68053);}return _0x398eaa[_0xb404('0x1a')]('Contact')[_0xb404('0x1d')](_0x20eeae,_0x56d5d8)[_0xb404('0x25')](function(_0x36cdb8){if(_0x36cdb8&&_0x36cdb8['length']){return _0x36cdb8;}else{var _0x484562=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc[_0xb404('0x2f')]){var _0x1ab56f={};_0x1ab56f[_0xf274bc[_0xb404('0x2f')]]=_0x546671;_['merge'](_0x484562[_0xb404('0x2e')],_0x1ab56f);}return _0x398eaa[_0xb404('0x1a')](_0xb404('0x33'))[_0xb404('0x1d')](_0x484562,_0x56d5d8);}});}});case'contact':var _0x5aef93=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc[_0xb404('0x2c')]){var _0x54137e={};_0x54137e[_0xf274bc[_0xb404('0x2c')]]=_0x546671;_[_0xb404('0x2d')](_0x5aef93['$or'],_0x54137e);}return _0x398eaa[_0xb404('0x1a')](_0xb404('0x34'))[_0xb404('0x1d')](_0x5aef93,_0x56d5d8)[_0xb404('0x1e')]();case _0xb404('0x10'):var _0x39dc58=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc[_0xb404('0x2f')]){var _0x54137e={};_0x54137e[_0xf274bc['additionalSearchLead']]=_0x546671;_[_0xb404('0x2d')](_0x39dc58[_0xb404('0x2e')],_0x54137e);}return _0x398eaa[_0xb404('0x1a')](_0xb404('0x33'))['find'](_0x39dc58,_0x56d5d8);case _0xb404('0x12'):var _0x36fc3b=_[_0xb404('0x2b')](_0x4a5156);if(_0xf274bc[_0xb404('0x31')]){var _0x54137e={};_0x54137e[_0xf274bc['additionalSearchAccount']]=_0x546671;_[_0xb404('0x2d')](_0x36fc3b[_0xb404('0x2e')],_0x54137e);}return _0x398eaa[_0xb404('0x1a')](_0xb404('0x32'))['find'](_0x36fc3b,_0x56d5d8);default:return null;}})['then'](function(_0x166af3){if(_0x166af3&&_0x166af3['length']){var _0x5a7e8b=_['first'](_0x166af3);if(_0x5a7e8b){return BPromise[_0xb404('0x21')]({'id':_0x5a7e8b['Id'],'name':_0x5a7e8b[_0xb404('0x22')],'phone':_0x5a7e8b[_0xb404('0x35')],'endUserType':_0x5a7e8b[_0xb404('0x36')][_0xb404('0x37')][_0xb404('0x38')]()});}}})[_0xb404('0x25')](function(_0x1e6ed7){if(_0x1e6ed7){logger['info'](_0xb404('0x39'),_0x1e6ed7[_0xb404('0xe')],_0x546671);return BPromise[_0xb404('0x21')](_0x1e6ed7);}else{logger[_0xb404('0x18')](_0xb404('0x3a'),_0x546671);var _0x5b8d74={'Phone':_0x546671};if(_0xf274bc[_0xb404('0x3b')]){if(_0xf274bc[_0xb404('0x3b')]==='contact'){logger['info'](_0xb404('0x3c'),_0x546671,_0xf274bc['moduleCreate']);_0x5b8d74[_0xb404('0x3d')]=_0x45f8ab!==_0xb404('0x3e')?_0x45f8ab:util[_0xb404('0x3f')](_0xb404('0x40'),_0x546671);}else if(_0xf274bc[_0xb404('0x3b')]===_0xb404('0x10')){logger[_0xb404('0x18')](_0xb404('0x3c'),_0x546671,_0xf274bc[_0xb404('0x3b')]);_0x5b8d74[_0xb404('0x3d')]=_0x45f8ab!==_0xb404('0x3e')?_0x45f8ab:util[_0xb404('0x3f')](_0xb404('0x40'),_0x546671);_0x5b8d74[_0xb404('0x41')]='No\x20Company';}else if(_0xf274bc[_0xb404('0x3b')]===_0xb404('0x12')){logger[_0xb404('0x18')](_0xb404('0x3c'),_0x546671,_0xf274bc[_0xb404('0x3b')]);_0x5b8d74['Name']=_0x45f8ab!==_0xb404('0x3e')?_0x45f8ab:util[_0xb404('0x3f')](_0xb404('0x40'),_0x546671);}else{return null;}}return _0x398eaa[_0xb404('0x1a')](_[_0xb404('0x42')](_0xf274bc[_0xb404('0x3b')]))[_0xb404('0x43')](_0x5b8d74)[_0xb404('0x25')](function(_0x3e7226){return BPromise[_0xb404('0x21')]({'id':_0x3e7226['id'],'endUserType':_0xf274bc[_0xb404('0x3b')]});});}});}function getCustomFields(_0x2518d1,_0x37cb9c){var _0x3579ee={};if(_0x2518d1[_0xb404('0x1f')]>0x0){_[_0xb404('0x44')](_0x2518d1,function(_0x2bc652){if(_[_0xb404('0x45')]([_0xb404('0x46'),'picklist'],_0x2bc652['type'])&&_0x2bc652[_0xb404('0x47')]){_0x3579ee[_0x2bc652[_0xb404('0x47')]]=_0x2bc652[_0xb404('0x48')][_0xb404('0x49')]();}else if(_0x2bc652[_0xb404('0x37')]==='variable'&&_0x2bc652[_0xb404('0x4a')]&&_0x2bc652[_0xb404('0x47')]){_0x37cb9c[_0x2bc652[_0xb404('0x4a')]]&&(_0x3579ee[_0x2bc652[_0xb404('0x47')]]=_0x37cb9c[_0x2bc652['variableName']][_0xb404('0x49')]());}else if(_0x2bc652[_0xb404('0x37')]===_0xb404('0x4b')&&_0x2bc652[_0xb404('0x4c')]&&_0x2bc652[_0xb404('0x4c')][_0xb404('0x4d')]&&_0x2bc652[_0xb404('0x47')]){_0x37cb9c[_0x2bc652[_0xb404('0x4c')][_0xb404('0x4d')][_0xb404('0x38')]()]&&(_0x3579ee[_0x2bc652[_0xb404('0x47')]]=_0x37cb9c[_0x2bc652[_0xb404('0x4c')][_0xb404('0x4d')][_0xb404('0x38')]()][_0xb404('0x49')]());}});}return _0x3579ee;}function getConnection(_0x4582e9){var _0xbbf85a=_0x4582e9[_0xb404('0x4e')]['concat'](_0x4582e9['securityToken']);var _0x8f773f=new jsforce[(_0xb404('0x4f'))]({'oauth2':{'loginUrl':_0x4582e9['remoteUri']||_0xb404('0x50'),'clientId':_0x4582e9[_0xb404('0x51')],'clientSecret':_0x4582e9['clientSecret']}});return _0x8f773f[_0xb404('0x52')](_0x4582e9[_0xb404('0x53')],_0xbbf85a)[_0xb404('0x25')](function(){logger['info'](_0xb404('0x54'));return _0x8f773f;});}exports[_0xb404('0x55')]=function(_0x3d044f,_0x1fb074,_0x22b5c9,_0x3aee78,_0x3d53f3,_0x5354c2){var _0x300f8f,_0x5215f6,_0x6eb086,_0x966a69;_0x5354c2[_0xb404('0x56')]=intUtil[_0xb404('0x57')](_0x5354c2[_0xb404('0x56')]);_0x5354c2[_0xb404('0x58')]=intUtil[_0xb404('0x57')](_0x5354c2['remoteUri']);if(_0x3d53f3&&_0x3d53f3['monitor_format']){logger['info'](_0xb404('0x59'),_0xb404('0x5a'));_0x1fb074[_0xb404('0x5b')]=util[_0xb404('0x3f')](_0xb404('0x5c'),_0x5354c2[_0xb404('0x56')],_0x1fb074['uniqueid'],md5(_0x1fb074[_0xb404('0x5d')]));}else{_0x1fb074[_0xb404('0x5b')]='';}return getConnection(_0x5354c2)[_0xb404('0x25')](function(_0x3032db){_0x966a69=_0x3032db;return getUser(_0x5354c2,_0x3aee78[_0xb404('0x5e')],_0x966a69);})['then'](function(_0x488cc8){_0x300f8f=_0x488cc8;return getEndUser(_0x5354c2,_0x22b5c9,_0x1fb074[_0xb404('0x5f')],_0x1fb074[_0xb404('0x60')],_0x966a69);})[_0xb404('0x25')](function(_0x4bf4f1){_0x5215f6=_0x4bf4f1;return getTicket(_0x5354c2,_0x300f8f,_0x5215f6,_0x22b5c9,_0x1fb074,_0x22b5c9['Fields'],_0x966a69,_0xb404('0x55'));})['then'](function(_0x1d4de4){_0x6eb086=_0x1d4de4;logger[_0xb404('0x18')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x6eb086['id']);logger[_0xb404('0x18')](_0xb404('0x61'),_0x6eb086['id'],_0x3aee78[_0xb404('0x4d')],_0x5354c2[_0xb404('0x37')]);switch(_0x5354c2['type']){case _0xb404('0x62'):emit(util[_0xb404('0x3f')]('user:%s',_0x3aee78[_0xb404('0x4d')]),_0xb404('0x63'),{'recordId':_0x6eb086['id']});break;case _0xb404('0x64'):emit(util[_0xb404('0x3f')](_0xb404('0x65'),_0x3aee78[_0xb404('0x4d')]),_0xb404('0x66'),{'uri':util['format'](_0xb404('0x67'),_0x966a69[_0xb404('0x68')],_0x6eb086['id'])});break;default:logger[_0xb404('0x69')](_0xb404('0x6a'));}})[_0xb404('0x6b')](function(_0x47c1ee){logger[_0xb404('0x69')](_0xb404('0x59'),_0x47c1ee);});};exports[_0xb404('0x6c')]=function(_0x804c0f,_0x398cc1,_0x70b592,_0x2d3a2e,_0x5f10fd,_0xf18a76,_0x10ca6e){var _0xff9cee,_0x5de32f,_0x2f2484,_0x2bf9cb;_0xf18a76['serverUrl']=intUtil[_0xb404('0x57')](_0xf18a76[_0xb404('0x56')]);_0xf18a76[_0xb404('0x58')]=intUtil['stripTrailingSlash'](_0xf18a76[_0xb404('0x58')]);if(_0x10ca6e&&_0x10ca6e[_0xb404('0x6d')]&&_0x10ca6e[_0xb404('0x6d')]!==_0xb404('0x6e')){logger['info']('[OUTBOUND]',_0xb404('0x5a'));_0x398cc1[_0xb404('0x5b')]=util[_0xb404('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf18a76['serverUrl'],_0x398cc1['uniqueid'],md5(_0x398cc1['uniqueid']));}return getConnection(_0xf18a76)[_0xb404('0x25')](function(_0x50a8a){_0x2bf9cb=_0x50a8a;return getUser(_0xf18a76,_0x2d3a2e[_0xb404('0x5e')],_0x2bf9cb);})[_0xb404('0x25')](function(_0x3ce24f){_0xff9cee=_0x3ce24f;return getEndUser(_0xf18a76,_0x70b592,_0x398cc1['destcalleridname'],_0x398cc1[_0xb404('0x6f')],_0x2bf9cb);})[_0xb404('0x25')](function(_0x30d32d){_0x5de32f=_0x30d32d;return getTicket(_0xf18a76,_0xff9cee,_0x5de32f,_0x70b592,_0x398cc1,_0x70b592[_0xb404('0x70')],_0x2bf9cb,_0xb404('0x6c'));})[_0xb404('0x25')](function(_0x4fe8d6){_0x2f2484=_0x4fe8d6;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2f2484['id']);logger[_0xb404('0x18')](_0xb404('0x71'),_0x2f2484['id'],_0x2d3a2e[_0xb404('0x4d')],_0xf18a76[_0xb404('0x37')]);switch(_0xf18a76[_0xb404('0x37')]){case _0xb404('0x62'):emit(util[_0xb404('0x3f')](_0xb404('0x65'),_0x2d3a2e['name']),_0xb404('0x63'),{'recordId':_0x2f2484['id']});break;case _0xb404('0x64'):emit(util[_0xb404('0x3f')]('user:%s',_0x2d3a2e[_0xb404('0x4d')]),'trigger:browser:url',{'uri':util[_0xb404('0x3f')](_0xb404('0x67'),_0x2bf9cb['instanceUrl'],_0x2f2484['id'])});break;default:logger[_0xb404('0x69')]('[OUTBOUND]',_0xb404('0x72'));}})[_0xb404('0x6b')](function(_0x2be4ae){logger[_0xb404('0x69')]('[OUTBOUND]',_0x2be4ae);});};exports[_0xb404('0x73')]=function(_0x4b3711,_0x1e3804,_0x4c9bd6,_0x127899,_0xb8a424,_0x3a0f9e){var _0x2bdf04,_0x4c2893,_0x49e900,_0x4817a2;_0x3a0f9e[_0xb404('0x56')]=intUtil[_0xb404('0x57')](_0x3a0f9e[_0xb404('0x56')]);_0x3a0f9e[_0xb404('0x58')]=intUtil['stripTrailingSlash'](_0x3a0f9e[_0xb404('0x58')]);if(_0xb8a424&&_0xb8a424['monitor_format']){logger['info']('['+_0x1e3804[_0xb404('0x74')][_0xb404('0x75')]()+']',_0xb404('0x5a'));_0x1e3804[_0xb404('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a0f9e[_0xb404('0x56')],_0x1e3804[_0xb404('0x5d')],md5(_0x1e3804[_0xb404('0x5d')]));}else{_0x1e3804[_0xb404('0x5b')]='';}return getConnection(_0x3a0f9e)[_0xb404('0x25')](function(_0x327100){_0x4817a2=_0x327100;if(!_[_0xb404('0x1b')](_0x127899)){return getUser(_0x3a0f9e,_0x127899[_0xb404('0x4d')],_0x4817a2);}else{return getUser(_0x3a0f9e,null,_0x4817a2);}})[_0xb404('0x25')](function(_0x42c9fa){_0x2bdf04=_0x42c9fa;return getEndUser(_0x3a0f9e,_0x4c9bd6,_0x1e3804[_0xb404('0x5f')],_0x1e3804[_0xb404('0x60')],_0x4817a2);})['then'](function(_0x353f69){_0x4c2893=_0x353f69;return getTicket(_0x3a0f9e,_0x2bdf04,_0x4c2893,_0x4c9bd6,_0x1e3804,_0x4c9bd6[_0xb404('0x70')],_0x4817a2);})[_0xb404('0x25')](function(_0x3222f6){_0x49e900=_0x3222f6;logger[_0xb404('0x18')]('['+_0x1e3804[_0xb404('0x74')][_0xb404('0x75')]()+']\x20Ticket\x20%s\x20created.',_0x49e900['id']);logger['info']('['+_0x1e3804[_0xb404('0x74')]['toUpperCase']()+_0xb404('0x76'),_0x3a0f9e[_0xb404('0x37')]);})[_0xb404('0x6b')](function(_0x39bc6f){logger[_0xb404('0x69')]('['+_0x1e3804['lastevent']['toUpperCase']()+']',_0x39bc6f);});}; \ No newline at end of file +var _0xf491=['trigger:salesforce:display','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','WhoId','account','Case','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','username','Connection\x20established.','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.'];(function(_0x32bfa5,_0x1f76fd){var _0x120e9b=function(_0xd37de0){while(--_0xd37de0){_0x32bfa5['push'](_0x32bfa5['shift']());}};_0x120e9b(++_0x1f76fd);}(_0xf491,0x8f));var _0x1f49=function(_0x27e5b4,_0x46531e){_0x27e5b4=_0x27e5b4-0x0;var _0x5ab40b=_0xf491[_0x27e5b4];return _0x5ab40b;};'use strict';var _=require(_0x1f49('0x0'));var rp=require(_0x1f49('0x1'));var moment=require(_0x1f49('0x2'));var BPromise=require(_0x1f49('0x3'));var md5=require(_0x1f49('0x4'));var jsforce=require(_0x1f49('0x5'));var util=require(_0x1f49('0x6'));var Redis=require(_0x1f49('0x7'));var intUtil=require(_0x1f49('0x8'));var config=require(_0x1f49('0x9'));var logger=require(_0x1f49('0xa'))(_0x1f49('0xb'));config[_0x1f49('0xc')]=_[_0x1f49('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1f49('0xc')]));function emit(_0x24ca52,_0x1507ce,_0x5863ab){io['to'](_0x24ca52)[_0x1f49('0xe')](_0x1507ce,_0x5863ab);}function getTicket(_0x1ca2de,_0x17ce57,_0x5004ed,_0x567199,_0x460b06,_0x17b5c3,_0x35bd17,_0x24d621){var _0xf5c5d2=Object[_0x1f49('0xf')]({},{'OwnerId':_0x17ce57['id'],'Subject':intUtil[_0x1f49('0x10')](_0x567199[_0x1f49('0x11')],_0x460b06,'\x20'),'Description':intUtil[_0x1f49('0x10')](_0x567199[_0x1f49('0x12')],_0x460b06,'\x0a')},getCustomFields(_0x17b5c3,_0x460b06));if(_0x5004ed){if(_0x567199[_0x1f49('0x13')]===_0x1f49('0x14')){_0xf5c5d2[_0x1f49('0x15')]=moment[_0x1f49('0x16')]();_0xf5c5d2[_0x1f49('0x17')]=![];_0xf5c5d2['IsRecurrence']=![];if(_0x5004ed[_0x1f49('0x18')]===_0x1f49('0x19')||_0x5004ed['endUserType']==='lead'){_0xf5c5d2[_0x1f49('0x1a')]=_0x5004ed['id'];}else if(_0x5004ed[_0x1f49('0x18')]===_0x1f49('0x1b')){_0xf5c5d2['WhatId']=_0x5004ed['id'];}}else if(_0x567199[_0x1f49('0x13')]===_0x1f49('0x1c')){if(_0x5004ed[_0x1f49('0x18')]==='contact'){_0xf5c5d2['ContactId']=_0x5004ed['id'];}else if(_0x5004ed[_0x1f49('0x18')]===_0x1f49('0x1b')){_0xf5c5d2[_0x1f49('0x1d')]=_0x5004ed['id'];}else if(_0x5004ed[_0x1f49('0x18')]===_0x1f49('0x1e')&&_0x567199['leadId']){_0xf5c5d2[_0x567199[_0x1f49('0x1f')]]=_0x5004ed['id'];}else{logger[_0x1f49('0x20')](_0x1f49('0x21'));}}}return _0x35bd17['sobject'](_0x567199[_0x1f49('0x13')])[_0x1f49('0x22')](_0xf5c5d2);}function getUser(_0x274683,_0x3392d9,_0x8b7c49){if(!_[_0x1f49('0x23')](_0x3392d9)&&intUtil[_0x1f49('0x24')](_0x3392d9)){var _0x38219a={'Email':_0x3392d9};var _0x369ad9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x8b7c49[_0x1f49('0x25')](_0x1f49('0x26'))[_0x1f49('0x27')](_0x38219a,_0x369ad9)[_0x1f49('0x28')]()[_0x1f49('0x29')](function(_0x834bec){if(_0x834bec['length']){var _0x4c5c7d=_['find'](_0x834bec,function(_0x1e9f2c){return _0x1e9f2c[_0x1f49('0x2a')]===_0x3392d9;});if(_0x4c5c7d){logger[_0x1f49('0x20')](_0x1f49('0x2b'),_0x3392d9);return BPromise[_0x1f49('0x2c')]({'id':_0x4c5c7d['Id'],'name':_0x4c5c7d[_0x1f49('0x2d')]});}}else{logger[_0x1f49('0x20')](_0x1f49('0x2e'),_0x3392d9);return _0x8b7c49[_0x1f49('0x2f')]()[_0x1f49('0x29')](function(_0x2d72a1){return BPromise[_0x1f49('0x2c')]({'id':_0x2d72a1['user_id'],'name':_0x2d72a1[_0x1f49('0x30')]});});}});}else{logger[_0x1f49('0x20')](_0x1f49('0x2e'),_0x3392d9);return _0x8b7c49[_0x1f49('0x2f')]()[_0x1f49('0x29')](function(_0x1a0054){return BPromise[_0x1f49('0x2c')]({'id':_0x1a0054[_0x1f49('0x31')],'name':_0x1a0054[_0x1f49('0x30')]});});}}function getEndUser(_0x1578e6,_0x5dce34,_0x2d7f4b,_0x1fc5ff,_0x1431d0){var _0x3e083a={'$or':{'Phone':_0x1fc5ff}};var _0x2ef7f2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1f49('0x2c')]()[_0x1f49('0x29')](function(){logger[_0x1f49('0x20')](_0x1f49('0x32'),_0x1fc5ff,_0x5dce34[_0x1f49('0x33')]);switch(_0x5dce34[_0x1f49('0x33')]){case _0x1f49('0x34'):var _0x17c2df=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34[_0x1f49('0x36')]){var _0x5ad8b7={};_0x5ad8b7[_0x5dce34[_0x1f49('0x36')]]=_0x1fc5ff;_[_0x1f49('0x37')](_0x17c2df[_0x1f49('0x38')],_0x5ad8b7);}return _0x1431d0['sobject'](_0x1f49('0x39'))[_0x1f49('0x27')](_0x17c2df,_0x2ef7f2)[_0x1f49('0x28')]()['then'](function(_0x40350e){if(_0x40350e&&_0x40350e[_0x1f49('0x3a')]){return _0x40350e;}else{var _0x21d5ad=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34['additionalSearchLead']){var _0x3f7de3={};_0x3f7de3[_0x5dce34[_0x1f49('0x3b')]]=_0x1fc5ff;_[_0x1f49('0x37')](_0x21d5ad[_0x1f49('0x38')],_0x3f7de3);}return _0x1431d0[_0x1f49('0x25')](_0x1f49('0x3c'))['find'](_0x21d5ad,_0x2ef7f2);}});case _0x1f49('0x3d'):var _0x5dd046=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34[_0x1f49('0x3e')]){var _0x5ad8b7={};_0x5ad8b7[_0x5dce34['additionalSearchAccount']]=_0x1fc5ff;_[_0x1f49('0x37')](_0x5dd046[_0x1f49('0x38')],_0x5ad8b7);}return _0x1431d0[_0x1f49('0x25')](_0x1f49('0x3f'))[_0x1f49('0x27')](_0x5dd046,_0x2ef7f2)[_0x1f49('0x28')]()[_0x1f49('0x29')](function(_0x164309){if(_0x164309&&_0x164309['length']){return _0x164309;}else{var _0x289de1=_['cloneDeep'](_0x3e083a);if(_0x5dce34[_0x1f49('0x36')]){var _0x480e55={};_0x480e55[_0x5dce34['additionalSearchContact']]=_0x1fc5ff;_['merge'](_0x289de1[_0x1f49('0x38')],_0x480e55);}return _0x1431d0[_0x1f49('0x25')](_0x1f49('0x39'))['find'](_0x289de1,_0x2ef7f2)['then'](function(_0x4f2460){if(_0x4f2460&&_0x4f2460[_0x1f49('0x3a')]){return _0x4f2460;}else{var _0x288d01=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34[_0x1f49('0x3b')]){var _0x15ed0a={};_0x15ed0a[_0x5dce34[_0x1f49('0x3b')]]=_0x1fc5ff;_['merge'](_0x288d01['$or'],_0x15ed0a);}return _0x1431d0[_0x1f49('0x25')](_0x1f49('0x3c'))['find'](_0x288d01,_0x2ef7f2);}});}});case _0x1f49('0x19'):var _0x17c2df=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34['additionalSearchContact']){var _0x5ad8b7={};_0x5ad8b7[_0x5dce34[_0x1f49('0x36')]]=_0x1fc5ff;_[_0x1f49('0x37')](_0x17c2df['$or'],_0x5ad8b7);}return _0x1431d0['sobject']('Contact')[_0x1f49('0x27')](_0x17c2df,_0x2ef7f2)[_0x1f49('0x28')]();case _0x1f49('0x1e'):var _0x68d56d=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34[_0x1f49('0x3b')]){var _0x5ad8b7={};_0x5ad8b7[_0x5dce34[_0x1f49('0x3b')]]=_0x1fc5ff;_['merge'](_0x68d56d[_0x1f49('0x38')],_0x5ad8b7);}return _0x1431d0[_0x1f49('0x25')](_0x1f49('0x3c'))['find'](_0x68d56d,_0x2ef7f2);case _0x1f49('0x1b'):var _0x5dd046=_[_0x1f49('0x35')](_0x3e083a);if(_0x5dce34['additionalSearchAccount']){var _0x5ad8b7={};_0x5ad8b7[_0x5dce34[_0x1f49('0x3e')]]=_0x1fc5ff;_['merge'](_0x5dd046['$or'],_0x5ad8b7);}return _0x1431d0['sobject'](_0x1f49('0x3f'))[_0x1f49('0x27')](_0x5dd046,_0x2ef7f2);default:return null;}})['then'](function(_0x3488e3){if(_0x3488e3&&_0x3488e3[_0x1f49('0x3a')]){var _0x31766d=_[_0x1f49('0x40')](_0x3488e3);if(_0x31766d){return BPromise[_0x1f49('0x2c')]({'id':_0x31766d['Id'],'name':_0x31766d[_0x1f49('0x2d')],'phone':_0x31766d[_0x1f49('0x41')],'endUserType':_0x31766d[_0x1f49('0x42')][_0x1f49('0x43')][_0x1f49('0x44')]()});}}})[_0x1f49('0x29')](function(_0x5e8806){if(_0x5e8806){logger[_0x1f49('0x20')](_0x1f49('0x45'),_0x5e8806[_0x1f49('0x18')],_0x1fc5ff);return BPromise[_0x1f49('0x2c')](_0x5e8806);}else{logger[_0x1f49('0x20')](_0x1f49('0x46'),_0x1fc5ff);var _0x13eea2={'Phone':_0x1fc5ff};if(_0x5dce34[_0x1f49('0x47')]){if(_0x5dce34[_0x1f49('0x47')]===_0x1f49('0x19')){logger[_0x1f49('0x20')](_0x1f49('0x48'),_0x1fc5ff,_0x5dce34[_0x1f49('0x47')]);_0x13eea2[_0x1f49('0x49')]=_0x2d7f4b!==''?_0x2d7f4b:util[_0x1f49('0x4a')](_0x1f49('0x4b'),_0x1fc5ff);}else if(_0x5dce34[_0x1f49('0x47')]==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1fc5ff,_0x5dce34[_0x1f49('0x47')]);_0x13eea2[_0x1f49('0x49')]=_0x2d7f4b!==_0x1f49('0x4c')?_0x2d7f4b:util[_0x1f49('0x4a')](_0x1f49('0x4b'),_0x1fc5ff);_0x13eea2[_0x1f49('0x4d')]=_0x1f49('0x4e');}else if(_0x5dce34[_0x1f49('0x47')]==='account'){logger[_0x1f49('0x20')](_0x1f49('0x48'),_0x1fc5ff,_0x5dce34['moduleCreate']);_0x13eea2[_0x1f49('0x2d')]=_0x2d7f4b!==_0x1f49('0x4c')?_0x2d7f4b:util['format']('Caller\x20-\x20%s',_0x1fc5ff);}else{return null;}}return _0x1431d0[_0x1f49('0x25')](_[_0x1f49('0x4f')](_0x5dce34[_0x1f49('0x47')]))['create'](_0x13eea2)['then'](function(_0x38e4b9){return BPromise[_0x1f49('0x2c')]({'id':_0x38e4b9['id'],'endUserType':_0x5dce34[_0x1f49('0x47')]});});}});}function getCustomFields(_0x3e1ff1,_0x2485a7){var _0x7a778b={};if(_0x3e1ff1[_0x1f49('0x3a')]>0x0){_[_0x1f49('0x50')](_0x3e1ff1,function(_0x37b57c){if(_['includes']([_0x1f49('0x51'),_0x1f49('0x52')],_0x37b57c[_0x1f49('0x43')])&&_0x37b57c[_0x1f49('0x53')]){_0x7a778b[_0x37b57c['idField']]=_0x37b57c[_0x1f49('0x54')][_0x1f49('0x55')]();}else if(_0x37b57c[_0x1f49('0x43')]==='variable'&&_0x37b57c[_0x1f49('0x56')]&&_0x37b57c[_0x1f49('0x53')]){_0x2485a7[_0x37b57c[_0x1f49('0x56')]]&&(_0x7a778b[_0x37b57c['idField']]=_0x2485a7[_0x37b57c[_0x1f49('0x56')]]['toString']());}else if(_0x37b57c[_0x1f49('0x43')]===_0x1f49('0x57')&&_0x37b57c[_0x1f49('0x58')]&&_0x37b57c['Variable'][_0x1f49('0x59')]&&_0x37b57c[_0x1f49('0x53')]){_0x2485a7[_0x37b57c[_0x1f49('0x58')][_0x1f49('0x59')]['toLowerCase']()]&&(_0x7a778b[_0x37b57c[_0x1f49('0x53')]]=_0x2485a7[_0x37b57c[_0x1f49('0x58')][_0x1f49('0x59')][_0x1f49('0x44')]()]['toString']());}});}return _0x7a778b;}function getConnection(_0x23c0d8){var _0x366105=_0x23c0d8['password'][_0x1f49('0x5a')](_0x23c0d8[_0x1f49('0x5b')]);var _0x1c8d10=new jsforce[(_0x1f49('0x5c'))]({'oauth2':{'loginUrl':_0x23c0d8[_0x1f49('0x5d')]||_0x1f49('0x5e'),'clientId':_0x23c0d8[_0x1f49('0x5f')],'clientSecret':_0x23c0d8['clientSecret']}});return _0x1c8d10['login'](_0x23c0d8[_0x1f49('0x60')],_0x366105)[_0x1f49('0x29')](function(){logger['info'](_0x1f49('0x61'));return _0x1c8d10;});}exports[_0x1f49('0x62')]=function(_0x17d349,_0x587856,_0x39c6d9,_0x3943b6,_0x2a6695,_0x392d11){var _0x4d35f9,_0x1c7859,_0x19c962,_0x1ae4bc;_0x392d11['serverUrl']=intUtil['stripTrailingSlash'](_0x392d11['serverUrl']);_0x392d11[_0x1f49('0x5d')]=intUtil[_0x1f49('0x63')](_0x392d11[_0x1f49('0x5d')]);if(_0x2a6695&&_0x2a6695['monitor_format']){logger['info'](_0x1f49('0x64'),_0x1f49('0x65'));_0x587856['recordingURL']=util[_0x1f49('0x4a')](_0x1f49('0x66'),_0x392d11[_0x1f49('0x67')],_0x587856[_0x1f49('0x68')],md5(_0x587856[_0x1f49('0x68')]));}else{_0x587856[_0x1f49('0x69')]='';}return getConnection(_0x392d11)[_0x1f49('0x29')](function(_0x15a010){_0x1ae4bc=_0x15a010;return getUser(_0x392d11,_0x3943b6[_0x1f49('0x6a')],_0x1ae4bc);})[_0x1f49('0x29')](function(_0x48d9fe){_0x4d35f9=_0x48d9fe;return getEndUser(_0x392d11,_0x39c6d9,_0x587856['calleridname'],_0x587856[_0x1f49('0x6b')],_0x1ae4bc);})['then'](function(_0x495e34){_0x1c7859=_0x495e34;return getTicket(_0x392d11,_0x4d35f9,_0x1c7859,_0x39c6d9,_0x587856,_0x39c6d9[_0x1f49('0x6c')],_0x1ae4bc,_0x1f49('0x62'));})[_0x1f49('0x29')](function(_0x332778){_0x19c962=_0x332778;logger[_0x1f49('0x20')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x19c962['id']);logger[_0x1f49('0x20')](_0x1f49('0x6d'),_0x19c962['id'],_0x3943b6['name'],_0x392d11[_0x1f49('0x43')]);switch(_0x392d11[_0x1f49('0x43')]){case'integrationTab':emit(util['format']('user:%s',_0x3943b6[_0x1f49('0x59')]),'trigger:salesforce:display',{'recordId':_0x19c962['id']});break;case'newTab':emit(util[_0x1f49('0x4a')](_0x1f49('0x6e'),_0x3943b6[_0x1f49('0x59')]),_0x1f49('0x6f'),{'uri':util[_0x1f49('0x4a')]('%s/%s/e',_0x1ae4bc[_0x1f49('0x70')],_0x19c962['id'])});break;default:logger[_0x1f49('0x71')](_0x1f49('0x72'));}})[_0x1f49('0x73')](function(_0x2d0876){logger['error']('[QUEUE]',_0x2d0876);});};exports['outbound']=function(_0x18f68b,_0x418139,_0x59e037,_0x1ead84,_0x263355,_0xd4718a,_0x445091){var _0x53f2ac,_0x45a9f7,_0x3507e9,_0x2a569a;_0xd4718a[_0x1f49('0x67')]=intUtil[_0x1f49('0x63')](_0xd4718a[_0x1f49('0x67')]);_0xd4718a['remoteUri']=intUtil[_0x1f49('0x63')](_0xd4718a[_0x1f49('0x5d')]);if(_0x445091&&_0x445091['recordingFormat']&&_0x445091[_0x1f49('0x74')]!=='none'){logger[_0x1f49('0x20')](_0x1f49('0x75'),'Recording\x20is\x20enabled!');_0x418139[_0x1f49('0x69')]=util[_0x1f49('0x4a')](_0x1f49('0x66'),_0xd4718a[_0x1f49('0x67')],_0x418139['uniqueid'],md5(_0x418139[_0x1f49('0x68')]));}return getConnection(_0xd4718a)[_0x1f49('0x29')](function(_0x4e0557){_0x2a569a=_0x4e0557;return getUser(_0xd4718a,_0x1ead84[_0x1f49('0x6a')],_0x2a569a);})[_0x1f49('0x29')](function(_0x3b9d8f){_0x53f2ac=_0x3b9d8f;return getEndUser(_0xd4718a,_0x59e037,_0x418139[_0x1f49('0x76')],_0x418139[_0x1f49('0x77')],_0x2a569a);})['then'](function(_0x2940c9){_0x45a9f7=_0x2940c9;return getTicket(_0xd4718a,_0x53f2ac,_0x45a9f7,_0x59e037,_0x418139,_0x59e037[_0x1f49('0x6c')],_0x2a569a,_0x1f49('0x78'));})[_0x1f49('0x29')](function(_0x4c60e6){_0x3507e9=_0x4c60e6;logger['info'](_0x1f49('0x79'),_0x3507e9['id']);logger[_0x1f49('0x20')](_0x1f49('0x7a'),_0x3507e9['id'],_0x1ead84['name'],_0xd4718a[_0x1f49('0x43')]);switch(_0xd4718a['type']){case'integrationTab':emit(util['format'](_0x1f49('0x6e'),_0x1ead84[_0x1f49('0x59')]),_0x1f49('0x7b'),{'recordId':_0x3507e9['id']});break;case _0x1f49('0x7c'):emit(util[_0x1f49('0x4a')]('user:%s',_0x1ead84[_0x1f49('0x59')]),_0x1f49('0x6f'),{'uri':util[_0x1f49('0x4a')](_0x1f49('0x7d'),_0x2a569a['instanceUrl'],_0x3507e9['id'])});break;default:logger['error'](_0x1f49('0x75'),_0x1f49('0x7e'));}})[_0x1f49('0x73')](function(_0x486621){logger['error'](_0x1f49('0x75'),_0x486621);});};exports[_0x1f49('0x7f')]=function(_0x5a558a,_0x5f07b2,_0x1b815f,_0x4e78d8,_0x39a88f,_0x705a88){var _0x4eddfd,_0x5bc29c,_0x3a3918,_0x47b41c;_0x705a88[_0x1f49('0x67')]=intUtil[_0x1f49('0x63')](_0x705a88[_0x1f49('0x67')]);_0x705a88[_0x1f49('0x5d')]=intUtil[_0x1f49('0x63')](_0x705a88[_0x1f49('0x5d')]);if(_0x39a88f&&_0x39a88f[_0x1f49('0x80')]){logger[_0x1f49('0x20')]('['+_0x5f07b2[_0x1f49('0x81')][_0x1f49('0x82')]()+']',_0x1f49('0x65'));_0x5f07b2[_0x1f49('0x69')]=util[_0x1f49('0x4a')](_0x1f49('0x66'),_0x705a88[_0x1f49('0x67')],_0x5f07b2['uniqueid'],md5(_0x5f07b2[_0x1f49('0x68')]));}else{_0x5f07b2[_0x1f49('0x69')]='';}return getConnection(_0x705a88)[_0x1f49('0x29')](function(_0x581d4c){_0x47b41c=_0x581d4c;if(!_[_0x1f49('0x23')](_0x4e78d8)){return getUser(_0x705a88,_0x4e78d8['name'],_0x47b41c);}else{return getUser(_0x705a88,null,_0x47b41c);}})['then'](function(_0x3839e4){_0x4eddfd=_0x3839e4;return getEndUser(_0x705a88,_0x1b815f,_0x5f07b2[_0x1f49('0x83')],_0x5f07b2[_0x1f49('0x6b')],_0x47b41c);})[_0x1f49('0x29')](function(_0x4d551d){_0x5bc29c=_0x4d551d;return getTicket(_0x705a88,_0x4eddfd,_0x5bc29c,_0x1b815f,_0x5f07b2,_0x1b815f[_0x1f49('0x6c')],_0x47b41c);})['then'](function(_0x1be835){_0x3a3918=_0x1be835;logger['info']('['+_0x5f07b2[_0x1f49('0x81')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x3a3918['id']);logger[_0x1f49('0x20')]('['+_0x5f07b2[_0x1f49('0x81')][_0x1f49('0x82')]()+_0x1f49('0x84'),_0x705a88['type']);})[_0x1f49('0x73')](function(_0x34930e){logger[_0x1f49('0x71')]('['+_0x5f07b2['lastevent'][_0x1f49('0x82')]()+']',_0x34930e);});}; \ 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 a2df6cd..75a1cd4 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 _0x9783=['lodash','bluebird','request-promise','util','md5','ioredis','./util','servicenow','defaults','redis','socket.io-emitter','GET','then','result','adminId','sys_id','info','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry','incident','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect'];(function(_0x48a8d4,_0x3f35bd){var _0x277106=function(_0x5b44ab){while(--_0x5b44ab){_0x48a8d4['push'](_0x48a8d4['shift']());}};_0x277106(++_0x3f35bd);}(_0x9783,0xd6));var _0x3978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9783[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3978('0x0'));var Promise=require(_0x3978('0x1'));var rp=require(_0x3978('0x2'));var util=require(_0x3978('0x3'));var md5=require(_0x3978('0x4'));var Redis=require(_0x3978('0x5'));var intUtil=require(_0x3978('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3978('0x7'));config['redis']=_[_0x3978('0x8')](config[_0x3978('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3978('0xa'))(new Redis(config[_0x3978('0x9')]));function getAdminUser(_0x5d5c78,_0x8737a7,_0xcfe750,_0x402711,_0xd901cf,_0x2621ff){return new Promise(function(_0x17bf80,_0x28476c){var _0x167cdc={'method':_0x3978('0xb'),'uri':_0x402711+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0xd901cf+'&'+_0x2621ff,'auth':_0x8737a7,'json':!![]};return rp(_0x167cdc)[_0x3978('0xc')](function(_0x3471b5){if(_0x3471b5[_0x3978('0xd')]['length']>0x0){_0xcfe750[_0x3978('0xe')]=_0x3471b5[_0x3978('0xd')][0x0][_0x3978('0xf')];}logger[_0x3978('0x10')]('['+[_0x5d5c78['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0xcfe750);_0x17bf80(_0xcfe750);})[_0x3978('0x11')](function(_0x2fe8bb){logger[_0x3978('0x12')]('['+[_0x5d5c78[_0x3978('0x13')]()]+']',_0x2fe8bb[_0x3978('0x14')]);_0x28476c(_0x2fe8bb[_0x3978('0x14')]);});});}function getUser(_0x2a6fee,_0xcc8bb8,_0x8eef73,_0x4a133c,_0x44d33b){return function(_0x5f3c70){logger[_0x3978('0x10')]('['+[_0x2a6fee[_0x3978('0x13')]()]+_0x3978('0x15'),_0x5f3c70);return new Promise(function(_0x1ff466,_0x12d733){if(intUtil[_0x3978('0x16')](_0x5f3c70[_0x3978('0x17')])){var _0x26995f={'method':_0x3978('0xb'),'uri':_0x8eef73+'sys_user?sysparm_query=email%3D'+_0x5f3c70['userEmail']+'&'+_0x4a133c+'&'+_0x44d33b,'auth':_0xcc8bb8,'json':!![]};logger[_0x3978('0x10')]('['+[_0x2a6fee[_0x3978('0x13')]()]+_0x3978('0x18'),_0x26995f);return rp(_0x26995f)[_0x3978('0xc')](function(_0x321086){logger[_0x3978('0x10')]('['+[_0x2a6fee[_0x3978('0x13')]()]+_0x3978('0x19'),_0x321086);if(_0x321086[_0x3978('0xd')][_0x3978('0x1a')]>0x0&&String(_0x321086[_0x3978('0xd')][0x0][_0x3978('0x1b')])===_0x3978('0x1c')){_0x5f3c70['userId']=_0x321086[_0x3978('0xd')][0x0][_0x3978('0xf')];}else{_0x5f3c70[_0x3978('0x1d')]=_0x5f3c70[_0x3978('0xe')];_0x5f3c70[_0x3978('0x17')]=_0x5f3c70[_0x3978('0x1e')];}logger[_0x3978('0x10')]('['+[_0x2a6fee[_0x3978('0x13')]()]+'],\x20getUser\x20crm',_0x5f3c70);_0x1ff466(_0x5f3c70);})[_0x3978('0x11')](function(_0x56e0d8){logger[_0x3978('0x12')]('['+[_0x2a6fee[_0x3978('0x13')]()]+']',_0x56e0d8[_0x3978('0x14')]);_0x12d733(_0x56e0d8[_0x3978('0x14')]);});}else{logger[_0x3978('0x10')]('['+[_0x2a6fee[_0x3978('0x13')]()]+_0x3978('0x1f'));_0x5f3c70[_0x3978('0x1d')]=_0x5f3c70[_0x3978('0xe')];_0x5f3c70[_0x3978('0x17')]=_0x5f3c70[_0x3978('0x1e')];_0x1ff466(_0x5f3c70);}});};}function createEndUser(_0xc2b2b0,_0x4f5921,_0x340522,_0x31eab5,_0x324496){logger[_0x3978('0x10')]('['+[_0xc2b2b0[_0x3978('0x13')]()]+_0x3978('0x20'),_0x340522);return new Promise(function(_0x5c3599,_0x4b206e){var _0x9bb461={'method':_0x3978('0x21'),'uri':_0x31eab5+_0x3978('0x22')+_0x324496,'body':{'user_name':_0x340522[_0x3978('0x23')],'roles':_0x3978('0x24'),'first_name':_0x340522['endUserNumber'],'active':_0x3978('0x1c'),'date_format':_0x3978('0x25'),'phone':_0x340522['endUserNumber']},'auth':_0x4f5921,'json':!![]};return rp(_0x9bb461)['then'](function(_0x520877){logger['info']('['+[_0xc2b2b0[_0x3978('0x13')]()]+_0x3978('0x26'),_0x520877[_0x3978('0xd')]);_0x340522[_0x3978('0x27')]=_0x520877[_0x3978('0xd')][_0x3978('0xf')];_0x5c3599(_0x340522);})[_0x3978('0x11')](function(_0x15a740){logger[_0x3978('0x12')]('['+[_0xc2b2b0['toUpperCase']()]+']',_0x15a740[_0x3978('0x14')]);_0x4b206e(_0x15a740[_0x3978('0x14')]);});});}function getEndUser(_0x56ed5e,_0x14e1e1,_0x72b9a1,_0x836c32,_0x117168){return function(_0x61109c){logger['info']('['+[_0x56ed5e[_0x3978('0x13')]()]+_0x3978('0x28'),_0x61109c);return new Promise(function(_0x191acd,_0x40ca14){var _0x12c010={'method':_0x3978('0xb'),'uri':_0x72b9a1+_0x3978('0x29')+_0x61109c[_0x3978('0x23')]+'&'+_0x836c32+'&'+_0x117168,'auth':_0x14e1e1,'json':!![]};return rp(_0x12c010)[_0x3978('0xc')](function(_0x534283){if(_0x534283[_0x3978('0xd')][_0x3978('0x1a')]>0x0){_0x61109c['endUserId']=_0x534283[_0x3978('0xd')][0x0]['sys_id'];logger[_0x3978('0x10')]('['+[_0x56ed5e['toUpperCase']()]+_0x3978('0x2a'),_0x61109c);_0x191acd(_0x61109c);}else{return createEndUser(_0x56ed5e,_0x14e1e1,_0x61109c,_0x72b9a1,_0x836c32)[_0x3978('0xc')](function(_0x143676){logger[_0x3978('0x10')]('['+[_0x56ed5e[_0x3978('0x13')]()]+_0x3978('0x2b'),_0x143676);_0x191acd(_0x143676);});}})[_0x3978('0x11')](function(_0x5812b6){logger[_0x3978('0x12')]('['+[_0x56ed5e[_0x3978('0x13')]()]+']',_0x5812b6[_0x3978('0x14')]);_0x40ca14(_0x5812b6[_0x3978('0x14')]);});});};}function getCustomFields(_0x3f5f7a,_0x39bf3f){var _0x1242dd={};if(_0x3f5f7a[_0x3978('0x1a')]>0x0){_[_0x3978('0x2c')](_0x3f5f7a,function(_0x1b6f21){if(_['includes']([_0x3978('0x2d'),_0x3978('0x2e')],_0x1b6f21[_0x3978('0x2f')])&&_0x1b6f21[_0x3978('0x30')]&&!_0x1b6f21['customField']){_0x1242dd[_0x1b6f21[_0x3978('0x30')][_0x3978('0x31')]()]=_0x1b6f21[_0x3978('0x32')][_0x3978('0x33')]();}else if(_['includes']([_0x3978('0x2d'),_0x3978('0x2e')],_0x1b6f21[_0x3978('0x2f')])&&_0x1b6f21[_0x3978('0x34')]&&_0x1b6f21[_0x3978('0x35')]){_0x1242dd[_0x1b6f21[_0x3978('0x34')][_0x3978('0x31')]()]=_0x1b6f21[_0x3978('0x32')][_0x3978('0x33')]();}else if(_0x1b6f21[_0x3978('0x2f')]===_0x3978('0x36')&&_0x1b6f21[_0x3978('0x37')]&&_0x1b6f21['idField']&&_0x1b6f21[_0x3978('0x35')]){_0x1242dd[_0x1b6f21[_0x3978('0x34')][_0x3978('0x31')]()]=_0x39bf3f[_0x1b6f21['variableName']]['toString']();}else if(_0x1b6f21[_0x3978('0x2f')]===_0x3978('0x38')&&_0x1b6f21['Variable']&&_0x1b6f21[_0x3978('0x39')][_0x3978('0x3a')]&&_0x1b6f21['idField']&&_0x1b6f21[_0x3978('0x35')]){_0x1242dd[_0x1b6f21[_0x3978('0x34')][_0x3978('0x31')]()]=_0x39bf3f[_0x1b6f21[_0x3978('0x39')][_0x3978('0x3a')]['toLowerCase']()][_0x3978('0x33')]();}});}return _0x1242dd;}function getTicket(_0x2a9689,_0x21a657,_0x3ef634,_0x4bb779,_0x54715a,_0x2900a8){return function(_0x537bc0){logger[_0x3978('0x10')]('['+[_0x2a9689['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x537bc0);return new Promise(function(_0xc416ba,_0x1661b7){var _0x284cf5=_0x2a9689['toLowerCase']()===_0x3978('0x3b')?_0x537bc0[_0x3978('0x1d')]:_0x537bc0['endUserId'];var _0x74194e={'method':'POST','uri':_0x3ef634+'incident'+'?'+_0x2900a8,'body':Object[_0x3978('0x3c')]({},{'active':_0x3978('0x1c'),'caller_id':_0x284cf5,'assigned_to':_0x537bc0[_0x3978('0x1d')],'short_description':intUtil[_0x3978('0x3d')](_0x4bb779[_0x3978('0x3e')],_0x54715a,'\x20'),'description':intUtil[_0x3978('0x3d')](_0x4bb779[_0x3978('0x3f')],_0x54715a,'\x0a')},getCustomFields(_0x4bb779[_0x3978('0x40')],_0x54715a)),'auth':_0x21a657,'json':!![]};return rp(_0x74194e)[_0x3978('0xc')](function(_0x500772){logger['info']('['+[_0x2a9689[_0x3978('0x13')]()]+_0x3978('0x41'),_0x500772['result']);_0x537bc0[_0x3978('0x42')]=_0x500772[_0x3978('0xd')][_0x3978('0xf')];_0x537bc0['ticketNumber']=_0x500772[_0x3978('0xd')][_0x3978('0x43')];logger['info']('['+[_0x2a9689[_0x3978('0x13')]()]+_0x3978('0x44'),_0x537bc0);_0xc416ba(_0x537bc0);})['catch'](function(_0x3048c2){logger['error']('['+[_0x2a9689['toUpperCase']()]+']',_0x3048c2['message']);_0x1661b7(_0x3048c2['message']);});});};}function createRemoteTag(_0x164655,_0x378d5c,_0x15895a,_0x3f304b){return new Promise(function(_0x5b9ba0,_0xb069eb){var _0x3c4587={'method':'POST','uri':_0x15895a+'label'+'?'+_0x3f304b,'body':{'short_description':_0x164655,'global':!![],'active':!![],'name':_0x164655},'auth':_0x378d5c,'json':!![]};return rp(_0x3c4587)['then'](function(_0xc681a){var _0x575b2d=_0xc681a[_0x3978('0xd')][_0x3978('0xf')];_0x5b9ba0(_0x575b2d);});});}function getRemoteTag(_0x2694a1,_0x32e3fd,_0x4ec6d5,_0x369236,_0xa727d9){return new Promise(function(_0x25498e,_0x1e7924){var _0x24ebb2={'method':_0x3978('0xb'),'uri':_0x4ec6d5+_0x3978('0x45')+'?sysparm_query=name%3D'+_0x2694a1+'&'+_0x369236,'auth':_0x32e3fd,'json':!![]};return rp(_0x24ebb2)[_0x3978('0xc')](function(_0x197250){if(_0x197250[_0x3978('0xd')][_0x3978('0x1a')]>0x0){var _0x57c2e5=_0x197250[_0x3978('0xd')][0x0]['sys_id'];_0x25498e(_0x57c2e5);}else{return createRemoteTag(_0x2694a1,_0x32e3fd,_0x4ec6d5,_0x369236)[_0x3978('0xc')](function(_0x22bcdc){_0x25498e(_0x22bcdc);});}});});}function assignTagToIncident(_0x45d6ec,_0x3983c6,_0x92c062,_0x3f2b70,_0x13e1a1){return new Promise(function(_0x9b2bfe,_0x135b8c){var _0x3a1c6a={'method':_0x3978('0x21'),'uri':_0x92c062+_0x3978('0x46')+'?'+_0x13e1a1,'body':{'label':_0x45d6ec,'table':_0x3978('0x47'),'id_type':'Incident','table_key':_0x3f2b70['ticketId'],'title':'Incident\x20-\x20'+_0x3f2b70[_0x3978('0x48')],'id_display':_0x3f2b70[_0x3978('0x48')]},'auth':_0x3983c6,'json':!![]};return rp(_0x3a1c6a)['then'](function(_0xf271ec){_0x9b2bfe();})[_0x3978('0x11')](function(){_0x9b2bfe();});});}function manageTags(_0x3c82e2,_0x230ed5,_0x3b432f,_0x461812,_0x577099,_0x13ebf7,_0x7bda38){return new Promise(function(_0x3b90c4,_0x404ceb){var _0x5b31ac=[];_0x230ed5[_0x3978('0x2c')](function(_0x450296){_0x5b31ac['push'](getRemoteTag(_0x450296,_0x3b432f,_0x461812,_0x13ebf7,_0x7bda38));});return Promise[_0x3978('0x49')](_0x5b31ac)[_0x3978('0xc')](function(_0x52d753){if(_0x52d753[_0x3978('0x1a')]){logger[_0x3978('0x10')]('['+[_0x3c82e2[_0x3978('0x13')]()]+_0x3978('0x4a'),_0x52d753);var _0x3bd19a=[];_0x52d753[_0x3978('0x2c')](function(_0x4ed093){_0x3bd19a['push'](assignTagToIncident(_0x4ed093,_0x3b432f,_0x461812,_0x577099,_0x13ebf7));});return Promise[_0x3978('0x49')](_0x3bd19a)['then'](function(){_0x3b90c4();})[_0x3978('0x11')](function(){_0x3b90c4();});}else{_0x3b90c4();}});});}function getTags(_0x16b528,_0x471275,_0x46e08a,_0x3ec7c0,_0x1eb475,_0x572abe){return function(_0x3f1349){return new Promise(function(_0x1e15b8,_0x3bbb6c){var _0x136cfb=[];var _0x59c779=_0x3ec7c0[_0x3978('0x4b')];if(_0x59c779&&_0x59c779[_0x3978('0x1a')]>0x0){_0x136cfb=_[_0x3978('0x4c')](_0x59c779,_0x3978('0x3a'));}if(_0x136cfb[_0x3978('0x1a')]>0x0){return manageTags(_0x16b528,_0x136cfb,_0x471275,_0x46e08a,_0x3f1349,_0x1eb475,_0x572abe)[_0x3978('0xc')](function(){_0x1e15b8(_0x3f1349);});}else{_0x1e15b8(_0x3f1349);}});};}function emit(_0x560eba,_0x462606,_0x3952c5){var _0x34bb03=_0x3978('0x4d')+_0x3978('0x4e')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x3978('0x4f');var _0x502e6a={'uri':_0x560eba+_0x3978('0x50')+_0x3952c5+_0x34bb03};io['to'](util[_0x3978('0x51')](_0x3978('0x52'),_0x462606))[_0x3978('0x53')](_0x3978('0x54'),_0x502e6a);}exports['cs']=function(_0x423f30,_0x3efbfd,_0x2ef200,_0x4c7895,_0x43ec99,_0x5e67d9,_0x21ed70,_0x133253){var _0x5c586a={};var _0x97faf7={'user':_0x5e67d9['username'],'pass':_0x5e67d9['password']};var _0x2a2011='sysparm_limit=1';var _0x4820a8=_0x3978('0x55');_0x5e67d9[_0x3978('0x56')]=intUtil[_0x3978('0x57')](_0x5e67d9['remoteUri']);_0x5e67d9[_0x3978('0x58')]=intUtil['stripTrailingSlash'](_0x5e67d9[_0x3978('0x58')]);var _0x7c7c42=util[_0x3978('0x51')]('%s/api/now/table/',_0x5e67d9[_0x3978('0x56')]);_0x5c586a[_0x3978('0x17')]=!_[_0x3978('0x59')](_0x4c7895)?_0x4c7895['email']:null;_0x5c586a['adminEmail']=_0x5e67d9[_0x3978('0x5a')];_0x5c586a[_0x3978('0x23')]=_0x133253['toLowerCase']()===_0x3978('0x3b')?_0x3efbfd[_0x3978('0x5b')]:_0x3efbfd['calleridnum'];_0x5c586a[_0x3978('0x5c')]=_0x133253===_0x3978('0x5d')||_0x133253===_0x3978('0x5e')?_0x3978('0x5d'):'outbound';var _0x18b7d6=util[_0x3978('0x51')](_0x3978('0x5f'),_0x5e67d9['serverUrl'],_0x3efbfd[_0x3978('0x60')],md5(_0x3efbfd[_0x3978('0x60')]));if(_0x43ec99&&_0x43ec99[_0x3978('0x61')]){logger[_0x3978('0x10')](_0x3978('0x62'),_0x3978('0x63'));_0x3efbfd[_0x3978('0x64')]=_0x18b7d6;}else if(_0x21ed70&&_0x21ed70[_0x3978('0x65')]&&_0x21ed70[_0x3978('0x65')]!==_0x3978('0x66')){logger[_0x3978('0x10')]('[OUTBOUND]',_0x3978('0x63'));_0x3efbfd[_0x3978('0x64')]=_0x18b7d6;}else{_0x3efbfd[_0x3978('0x64')]='';}return getAdminUser(_0x133253,_0x97faf7,_0x5c586a,_0x7c7c42,_0x4820a8,_0x2a2011)[_0x3978('0xc')](getUser(_0x133253,_0x97faf7,_0x7c7c42,_0x4820a8,_0x2a2011))['then'](getEndUser(_0x133253,_0x97faf7,_0x7c7c42,_0x4820a8,_0x2a2011))[_0x3978('0xc')](getTicket(_0x133253,_0x97faf7,_0x7c7c42,_0x2ef200,_0x3efbfd,_0x4820a8))[_0x3978('0xc')](function(_0x339492){logger[_0x3978('0x10')](util[_0x3978('0x51')](_0x3978('0x67'),_0x339492[_0x3978('0x42')]));logger[_0x3978('0x10')](util[_0x3978('0x51')]('call\x20direction:\x20%s',_0x133253));if(_0x133253!==_0x3978('0x5e')){logger['info']('['+[_0x133253[_0x3978('0x13')]()]+']',_0x3978('0x68'));emit(_0x5e67d9[_0x3978('0x56')],_0x4c7895[_0x3978('0x3a')],_0x339492[_0x3978('0x42')]);}})[_0x3978('0x11')](function(_0x3f6654){logger[_0x3978('0x12')]('['+[_0x133253[_0x3978('0x13')]()]+_0x3978('0x69'),util[_0x3978('0x6a')](_0x3f6654,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9220=['email','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','util','ioredis','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','length','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','forEach','all','push','Tags','map','%26sysparm_record_target%3Dincident','%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/'];(function(_0x2120a3,_0x20fed9){var _0x5f02ec=function(_0x2897a4){while(--_0x2897a4){_0x2120a3['push'](_0x2120a3['shift']());}};_0x5f02ec(++_0x20fed9);}(_0x9220,0x151));var _0x0922=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x9220[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x0922('0x0'));var Promise=require(_0x0922('0x1'));var rp=require('request-promise');var util=require(_0x0922('0x2'));var md5=require('md5');var Redis=require(_0x0922('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x0922('0x4'))(_0x0922('0x5'));config[_0x0922('0x6')]=_['defaults'](config[_0x0922('0x6')],{'host':_0x0922('0x7'),'port':0x18eb});var io=require(_0x0922('0x8'))(new Redis(config[_0x0922('0x6')]));function getAdminUser(_0x35c532,_0x31d8db,_0xaf535,_0xae512e,_0x4d464d,_0x55785d){return new Promise(function(_0x5688e1,_0x3576c5){var _0x4ce5b6={'method':_0x0922('0x9'),'uri':_0xae512e+_0x0922('0xa')+'&'+_0x4d464d+'&'+_0x55785d,'auth':_0x31d8db,'json':!![]};return rp(_0x4ce5b6)[_0x0922('0xb')](function(_0x5d981f){if(_0x5d981f[_0x0922('0xc')]['length']>0x0){_0xaf535[_0x0922('0xd')]=_0x5d981f[_0x0922('0xc')][0x0][_0x0922('0xe')];}logger[_0x0922('0xf')]('['+[_0x35c532[_0x0922('0x10')]()]+_0x0922('0x11'),_0xaf535);_0x5688e1(_0xaf535);})[_0x0922('0x12')](function(_0x1b7877){logger[_0x0922('0x13')]('['+[_0x35c532[_0x0922('0x10')]()]+']',_0x1b7877['message']);_0x3576c5(_0x1b7877[_0x0922('0x14')]);});});}function getUser(_0x3b12d6,_0x4d8b88,_0xa58cb5,_0x2310ee,_0x4d15f0){return function(_0x41aad8){logger[_0x0922('0xf')]('['+[_0x3b12d6['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x41aad8);return new Promise(function(_0x1a33b2,_0x12e406){if(intUtil[_0x0922('0x15')](_0x41aad8['userEmail'])){var _0x2afb23={'method':_0x0922('0x9'),'uri':_0xa58cb5+_0x0922('0x16')+_0x41aad8[_0x0922('0x17')]+'&'+_0x2310ee+'&'+_0x4d15f0,'auth':_0x4d8b88,'json':!![]};logger[_0x0922('0xf')]('['+[_0x3b12d6['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x2afb23);return rp(_0x2afb23)[_0x0922('0xb')](function(_0x462a7e){logger['info']('['+[_0x3b12d6[_0x0922('0x10')]()]+'],\x20getUser\x20entity',_0x462a7e);if(_0x462a7e['result'][_0x0922('0x18')]>0x0&&String(_0x462a7e[_0x0922('0xc')][0x0][_0x0922('0x19')])===_0x0922('0x1a')){_0x41aad8['userId']=_0x462a7e[_0x0922('0xc')][0x0][_0x0922('0xe')];}else{_0x41aad8[_0x0922('0x1b')]=_0x41aad8[_0x0922('0xd')];_0x41aad8['userEmail']=_0x41aad8[_0x0922('0x1c')];}logger['info']('['+[_0x3b12d6[_0x0922('0x10')]()]+_0x0922('0x1d'),_0x41aad8);_0x1a33b2(_0x41aad8);})[_0x0922('0x12')](function(_0x51e0bf){logger[_0x0922('0x13')]('['+[_0x3b12d6['toUpperCase']()]+']',_0x51e0bf[_0x0922('0x14')]);_0x12e406(_0x51e0bf[_0x0922('0x14')]);});}else{logger['info']('['+[_0x3b12d6[_0x0922('0x10')]()]+_0x0922('0x1e'));_0x41aad8[_0x0922('0x1b')]=_0x41aad8[_0x0922('0xd')];_0x41aad8[_0x0922('0x17')]=_0x41aad8[_0x0922('0x1c')];_0x1a33b2(_0x41aad8);}});};}function createEndUser(_0x991ed6,_0x36e34d,_0x15d1d7,_0x26e015,_0x3e94ae){logger['info']('['+[_0x991ed6[_0x0922('0x10')]()]+_0x0922('0x1f'),_0x15d1d7);return new Promise(function(_0x377673,_0x35f13d){var _0x60abf8={'method':_0x0922('0x20'),'uri':_0x26e015+_0x0922('0x21')+_0x3e94ae,'body':{'user_name':_0x15d1d7['endUserNumber'],'roles':_0x0922('0x22'),'first_name':_0x15d1d7[_0x0922('0x23')],'active':_0x0922('0x1a'),'date_format':_0x0922('0x24'),'phone':_0x15d1d7[_0x0922('0x23')]},'auth':_0x36e34d,'json':!![]};return rp(_0x60abf8)[_0x0922('0xb')](function(_0x2158a8){logger[_0x0922('0xf')]('['+[_0x991ed6[_0x0922('0x10')]()]+_0x0922('0x25'),_0x2158a8['result']);_0x15d1d7['endUserId']=_0x2158a8[_0x0922('0xc')][_0x0922('0xe')];_0x377673(_0x15d1d7);})[_0x0922('0x12')](function(_0x438963){logger[_0x0922('0x13')]('['+[_0x991ed6[_0x0922('0x10')]()]+']',_0x438963['message']);_0x35f13d(_0x438963[_0x0922('0x14')]);});});}function getEndUser(_0x7ce78d,_0x2911ea,_0x26bde5,_0x2ae9a7,_0x13668b){return function(_0x26c16d){logger[_0x0922('0xf')]('['+[_0x7ce78d[_0x0922('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x26c16d);return new Promise(function(_0x5914c0,_0x1c7efc){var _0x1449ac={'method':_0x0922('0x9'),'uri':_0x26bde5+_0x0922('0x26')+_0x26c16d[_0x0922('0x23')]+'&'+_0x2ae9a7+'&'+_0x13668b,'auth':_0x2911ea,'json':!![]};return rp(_0x1449ac)[_0x0922('0xb')](function(_0x184d9f){if(_0x184d9f[_0x0922('0xc')]['length']>0x0){_0x26c16d[_0x0922('0x27')]=_0x184d9f[_0x0922('0xc')][0x0][_0x0922('0xe')];logger[_0x0922('0xf')]('['+[_0x7ce78d[_0x0922('0x10')]()]+_0x0922('0x28'),_0x26c16d);_0x5914c0(_0x26c16d);}else{return createEndUser(_0x7ce78d,_0x2911ea,_0x26c16d,_0x26bde5,_0x2ae9a7)[_0x0922('0xb')](function(_0x137174){logger[_0x0922('0xf')]('['+[_0x7ce78d['toUpperCase']()]+_0x0922('0x29'),_0x137174);_0x5914c0(_0x137174);});}})[_0x0922('0x12')](function(_0x25956e){logger[_0x0922('0x13')]('['+[_0x7ce78d[_0x0922('0x10')]()]+']',_0x25956e[_0x0922('0x14')]);_0x1c7efc(_0x25956e[_0x0922('0x14')]);});});};}function getCustomFields(_0x80cbb8,_0xa5cc1f){var _0x528081={};if(_0x80cbb8[_0x0922('0x18')]>0x0){_['forEach'](_0x80cbb8,function(_0x1ce397){if(_[_0x0922('0x2a')]([_0x0922('0x2b'),_0x0922('0x2c')],_0x1ce397[_0x0922('0x2d')])&&_0x1ce397[_0x0922('0x2e')]&&!_0x1ce397[_0x0922('0x2f')]){_0x528081[_0x1ce397['nameField'][_0x0922('0x30')]()]=_0x1ce397[_0x0922('0x31')][_0x0922('0x32')]();}else if(_[_0x0922('0x2a')]([_0x0922('0x2b'),_0x0922('0x2c')],_0x1ce397['type'])&&_0x1ce397[_0x0922('0x33')]&&_0x1ce397[_0x0922('0x2f')]){_0x528081[_0x1ce397[_0x0922('0x33')][_0x0922('0x30')]()]=_0x1ce397[_0x0922('0x31')]['toString']();}else if(_0x1ce397[_0x0922('0x2d')]===_0x0922('0x34')&&_0x1ce397[_0x0922('0x35')]&&_0x1ce397[_0x0922('0x33')]&&_0x1ce397[_0x0922('0x2f')]){_0x528081[_0x1ce397['idField'][_0x0922('0x30')]()]=_0xa5cc1f[_0x1ce397[_0x0922('0x35')]][_0x0922('0x32')]();}else if(_0x1ce397[_0x0922('0x2d')]==='customVariable'&&_0x1ce397[_0x0922('0x36')]&&_0x1ce397[_0x0922('0x36')][_0x0922('0x37')]&&_0x1ce397[_0x0922('0x33')]&&_0x1ce397[_0x0922('0x2f')]){_0x528081[_0x1ce397[_0x0922('0x33')][_0x0922('0x30')]()]=_0xa5cc1f[_0x1ce397['Variable'][_0x0922('0x37')][_0x0922('0x30')]()][_0x0922('0x32')]();}});}return _0x528081;}function getTicket(_0x46a53d,_0x4ea0e2,_0x575d4a,_0x191e77,_0x3989ea,_0x1e411b){return function(_0x4a1c11){logger[_0x0922('0xf')]('['+[_0x46a53d[_0x0922('0x10')]()]+_0x0922('0x38'),_0x4a1c11);return new Promise(function(_0x1e7543,_0x221baa){var _0xc9f98e=_0x46a53d[_0x0922('0x30')]()==='outbound'?_0x4a1c11[_0x0922('0x1b')]:_0x4a1c11[_0x0922('0x27')];var _0x5c3286={'method':_0x0922('0x20'),'uri':_0x575d4a+_0x0922('0x39')+'?'+_0x1e411b,'body':Object[_0x0922('0x3a')]({},{'active':_0x0922('0x1a'),'caller_id':_0xc9f98e,'assigned_to':_0x4a1c11[_0x0922('0x1b')],'short_description':intUtil[_0x0922('0x3b')](_0x191e77[_0x0922('0x3c')],_0x3989ea,'\x20'),'description':intUtil['getString'](_0x191e77[_0x0922('0x3d')],_0x3989ea,'\x0a')},getCustomFields(_0x191e77[_0x0922('0x3e')],_0x3989ea)),'auth':_0x4ea0e2,'json':!![]};return rp(_0x5c3286)['then'](function(_0x39fb4c){logger[_0x0922('0xf')]('['+[_0x46a53d[_0x0922('0x10')]()]+_0x0922('0x3f'),_0x39fb4c[_0x0922('0xc')]);_0x4a1c11[_0x0922('0x40')]=_0x39fb4c[_0x0922('0xc')]['sys_id'];_0x4a1c11[_0x0922('0x41')]=_0x39fb4c[_0x0922('0xc')]['number'];logger['info']('['+[_0x46a53d[_0x0922('0x10')]()]+_0x0922('0x42'),_0x4a1c11);_0x1e7543(_0x4a1c11);})['catch'](function(_0x1cf3f0){logger[_0x0922('0x13')]('['+[_0x46a53d[_0x0922('0x10')]()]+']',_0x1cf3f0[_0x0922('0x14')]);_0x221baa(_0x1cf3f0[_0x0922('0x14')]);});});};}function createRemoteTag(_0x2e0f46,_0x3ba66c,_0x5b7b07,_0x5be2dd){return new Promise(function(_0x5adfe5,_0x51a4f9){var _0x533d14={'method':_0x0922('0x20'),'uri':_0x5b7b07+'label'+'?'+_0x5be2dd,'body':{'short_description':_0x2e0f46,'global':!![],'active':!![],'name':_0x2e0f46},'auth':_0x3ba66c,'json':!![]};return rp(_0x533d14)[_0x0922('0xb')](function(_0x5ce0f3){var _0x520697=_0x5ce0f3['result'][_0x0922('0xe')];_0x5adfe5(_0x520697);});});}function getRemoteTag(_0x5e280b,_0xef5e86,_0x11842a,_0x10f60c,_0xd6d1a7){return new Promise(function(_0x18224e,_0x2b9423){var _0x44bd80={'method':_0x0922('0x9'),'uri':_0x11842a+_0x0922('0x43')+_0x0922('0x44')+_0x5e280b+'&'+_0x10f60c,'auth':_0xef5e86,'json':!![]};return rp(_0x44bd80)[_0x0922('0xb')](function(_0x10e060){if(_0x10e060['result'][_0x0922('0x18')]>0x0){var _0x9b60e5=_0x10e060['result'][0x0]['sys_id'];_0x18224e(_0x9b60e5);}else{return createRemoteTag(_0x5e280b,_0xef5e86,_0x11842a,_0x10f60c)['then'](function(_0x57821f){_0x18224e(_0x57821f);});}});});}function assignTagToIncident(_0x43cc9b,_0x49c36e,_0x39ebac,_0x423252,_0x5ade49){return new Promise(function(_0x37a05a,_0x431943){var _0x25bb77={'method':_0x0922('0x20'),'uri':_0x39ebac+_0x0922('0x45')+'?'+_0x5ade49,'body':{'label':_0x43cc9b,'table':_0x0922('0x39'),'id_type':'Incident','table_key':_0x423252['ticketId'],'title':_0x0922('0x46')+_0x423252['ticketNumber'],'id_display':_0x423252[_0x0922('0x41')]},'auth':_0x49c36e,'json':!![]};return rp(_0x25bb77)['then'](function(_0x3e56b0){_0x37a05a();})['catch'](function(){_0x37a05a();});});}function manageTags(_0x35b9e1,_0x4bf657,_0x1e5caf,_0x5c4562,_0x1be2ea,_0x1d070c,_0x122ad5){return new Promise(function(_0x524e1d,_0xb528c){var _0x185555=[];_0x4bf657[_0x0922('0x47')](function(_0x526e3d){_0x185555['push'](getRemoteTag(_0x526e3d,_0x1e5caf,_0x5c4562,_0x1d070c,_0x122ad5));});return Promise[_0x0922('0x48')](_0x185555)['then'](function(_0x1bf31e){if(_0x1bf31e[_0x0922('0x18')]){logger[_0x0922('0xf')]('['+[_0x35b9e1[_0x0922('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1bf31e);var _0x3e264e=[];_0x1bf31e[_0x0922('0x47')](function(_0x31b898){_0x3e264e[_0x0922('0x49')](assignTagToIncident(_0x31b898,_0x1e5caf,_0x5c4562,_0x1be2ea,_0x1d070c));});return Promise['all'](_0x3e264e)[_0x0922('0xb')](function(){_0x524e1d();})[_0x0922('0x12')](function(){_0x524e1d();});}else{_0x524e1d();}});});}function getTags(_0x353d9f,_0x1feb39,_0x326f13,_0x5963f2,_0x1e54ad,_0x3a9ed7){return function(_0x4f5903){return new Promise(function(_0x25702a,_0x1fc7cb){var _0x4bc823=[];var _0x169c2b=_0x5963f2[_0x0922('0x4a')];if(_0x169c2b&&_0x169c2b[_0x0922('0x18')]>0x0){_0x4bc823=_[_0x0922('0x4b')](_0x169c2b,_0x0922('0x37'));}if(_0x4bc823[_0x0922('0x18')]>0x0){return manageTags(_0x353d9f,_0x4bc823,_0x1feb39,_0x326f13,_0x4f5903,_0x1e54ad,_0x3a9ed7)[_0x0922('0xb')](function(){_0x25702a(_0x4f5903);});}else{_0x25702a(_0x4f5903);}});};}function emit(_0xf4ea97,_0x1fe52b,_0x1c9706){var _0x2b8a5a=_0x0922('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x0922('0x4d')+_0x0922('0x4e');var _0x3cad7a={'uri':_0xf4ea97+_0x0922('0x4f')+_0x1c9706+_0x2b8a5a};io['to'](util[_0x0922('0x50')](_0x0922('0x51'),_0x1fe52b))[_0x0922('0x52')](_0x0922('0x53'),_0x3cad7a);}exports['cs']=function(_0x2dbe01,_0x15deb7,_0x175ffe,_0x40cc4b,_0x1f4c20,_0x2fcb15,_0x35beb3,_0x26eb10){var _0x1e85d6={};var _0x3dcbe8={'user':_0x2fcb15[_0x0922('0x54')],'pass':_0x2fcb15[_0x0922('0x55')]};var _0x3068c1=_0x0922('0x56');var _0x4e70c2='sysparm_display_value=true';_0x2fcb15[_0x0922('0x57')]=intUtil[_0x0922('0x58')](_0x2fcb15[_0x0922('0x57')]);_0x2fcb15[_0x0922('0x59')]=intUtil[_0x0922('0x58')](_0x2fcb15['serverUrl']);var _0xfa60ba=util['format'](_0x0922('0x5a'),_0x2fcb15['remoteUri']);_0x1e85d6[_0x0922('0x17')]=!_['isNil'](_0x40cc4b)?_0x40cc4b['email']:null;_0x1e85d6['adminEmail']=_0x2fcb15[_0x0922('0x5b')];_0x1e85d6[_0x0922('0x23')]=_0x26eb10[_0x0922('0x30')]()===_0x0922('0x5c')?_0x15deb7['destcalleridnum']:_0x15deb7[_0x0922('0x5d')];_0x1e85d6[_0x0922('0x5e')]=_0x26eb10===_0x0922('0x5f')||_0x26eb10===_0x0922('0x60')?_0x0922('0x5f'):_0x0922('0x5c');var _0x12045a=util[_0x0922('0x50')](_0x0922('0x61'),_0x2fcb15[_0x0922('0x59')],_0x15deb7['uniqueid'],md5(_0x15deb7['uniqueid']));if(_0x1f4c20&&_0x1f4c20[_0x0922('0x62')]){logger[_0x0922('0xf')]('[QUEUE]',_0x0922('0x63'));_0x15deb7[_0x0922('0x64')]=_0x12045a;}else if(_0x35beb3&&_0x35beb3[_0x0922('0x65')]&&_0x35beb3[_0x0922('0x65')]!=='none'){logger['info'](_0x0922('0x66'),_0x0922('0x63'));_0x15deb7[_0x0922('0x64')]=_0x12045a;}else{_0x15deb7['recordingURL']='';}return getAdminUser(_0x26eb10,_0x3dcbe8,_0x1e85d6,_0xfa60ba,_0x4e70c2,_0x3068c1)['then'](getUser(_0x26eb10,_0x3dcbe8,_0xfa60ba,_0x4e70c2,_0x3068c1))['then'](getEndUser(_0x26eb10,_0x3dcbe8,_0xfa60ba,_0x4e70c2,_0x3068c1))['then'](getTicket(_0x26eb10,_0x3dcbe8,_0xfa60ba,_0x175ffe,_0x15deb7,_0x4e70c2))['then'](function(_0x2e2b2){logger[_0x0922('0xf')](util[_0x0922('0x50')](_0x0922('0x67'),_0x2e2b2['ticketId']));logger[_0x0922('0xf')](util['format'](_0x0922('0x68'),_0x26eb10));if(_0x26eb10!=='unmanaged'){logger[_0x0922('0xf')]('['+[_0x26eb10[_0x0922('0x10')]()]+']',_0x0922('0x69'));emit(_0x2fcb15[_0x0922('0x57')],_0x40cc4b[_0x0922('0x37')],_0x2e2b2['ticketId']);}})[_0x0922('0x12')](function(_0x3077a9){logger[_0x0922('0x13')]('['+[_0x26eb10[_0x0922('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x0922('0x6a')](_0x3077a9,{'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 151cec1..0e1e58e 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 _0x3aba=['custom_fields','variable','Variable','toLowerCase','POST','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','Ticket\x20created!','version','unmanaged','uri','monitor_format','lastevent','calleridnum','toUpperCase','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_name','direction','length','forEach','push','variableName','set_entry','JSON','stringify','Calls','Basic\x20%s','toString','get_server_info','isNil','get_entry_list','format','then','entry_list','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','debug','[HTTP]','merge','type','nameField','customField','content','idField'];(function(_0x19f98d,_0x3e1c0a){var _0x4f9a0d=function(_0x16dd54){while(--_0x16dd54){_0x19f98d['push'](_0x19f98d['shift']());}};_0x4f9a0d(++_0x3e1c0a);}(_0x3aba,0xa9));var _0xa3ab=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0x3aba[_0x467cb0];return _0x2153f7;};'use strict';var _=require(_0xa3ab('0x0'));var rp=require(_0xa3ab('0x1'));var BPromise=require(_0xa3ab('0x2'));var md5=require(_0xa3ab('0x3'));var util=require(_0xa3ab('0x4'));var Redis=require('ioredis');var intUtil=require(_0xa3ab('0x5'));var config=require(_0xa3ab('0x6'));var logger=require(_0xa3ab('0x7'))(_0xa3ab('0x8'));config[_0xa3ab('0x9')]=_[_0xa3ab('0xa')](config[_0xa3ab('0x9')],{'host':_0xa3ab('0xb'),'port':0x18eb});var io=require(_0xa3ab('0xc'))(new Redis(config[_0xa3ab('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x254efd,_0x155374,_0x51bbc9){io['to'](_0x254efd)[_0xa3ab('0xd')](_0x155374,_0x51bbc9);}function getTicket(_0x839412,_0x33a4da,_0x5e98bb,_0x313140,_0x465eb3,_0x4ecfb3,_0x5a634d,_0x4730e1){logger[_0xa3ab('0xe')](_0xa3ab('0xf'));var _0x1fcf4d=new Date();var _0x57c844=[{'name':_0xa3ab('0x10'),'value':intUtil[_0xa3ab('0x11')](_0x313140[_0xa3ab('0x12')],_0x465eb3,'\x20')},{'name':_0xa3ab('0x13'),'value':_0x33a4da['id']},{'name':_0xa3ab('0x14'),'value':_0x33a4da['id']},{'name':'description','value':intUtil[_0xa3ab('0x11')](_0x313140['Descriptions'],_0x465eb3,'\x0a')},{'name':_0xa3ab('0x15'),'value':_0x1fcf4d[_0xa3ab('0x16')]()[_0xa3ab('0x17')](0x0,0x13)[_0xa3ab('0x18')]('T','\x20')},{'name':_0xa3ab('0x19'),'value':'0'},{'name':_0xa3ab('0x1a'),'value':'15'},{'name':_0xa3ab('0x1b'),'value':_0x5e98bb['id']},{'name':'parent_type','value':'Contacts'},{'name':_0xa3ab('0x1c'),'value':_0x5e98bb[_0xa3ab('0x10')]},{'name':_0xa3ab('0x1d'),'value':_0x4730e1}];if(_0x4ecfb3[_0xa3ab('0x1e')]){_[_0xa3ab('0x1f')](_0x4ecfb3,function(_0x1c7b2a){if(_0x465eb3[_0x1c7b2a['variableName']]){_0x57c844[_0xa3ab('0x20')]({'name':_0x1c7b2a['idField'],'value':_0x465eb3[_0x1c7b2a[_0xa3ab('0x21')]]});}});}return request({'form':{'method':_0xa3ab('0x22'),'input_type':'JSON','response_type':_0xa3ab('0x23'),'rest_data':JSON[_0xa3ab('0x24')]({'session':_0x5a634d['id'],'module_name':_0xa3ab('0x25'),'name_value_list':_0x57c844})}});}function getAuth(_0x4fdb2e){return util['format'](_0xa3ab('0x26'),new Buffer(_0x4fdb2e['apiKey']+':X')[_0xa3ab('0x27')]('base64'));}function getServerInfo(_0x3abe3a){return request({'form':{'method':_0xa3ab('0x28'),'input_type':_0xa3ab('0x23'),'response_type':_0xa3ab('0x23'),'rest_data':JSON['stringify']({'session':_0x3abe3a['id']})}});}function getUser(_0x3bf475,_0xf1af7e,_0x555677){if(!_[_0xa3ab('0x29')](_0xf1af7e)){logger[_0xa3ab('0xe')]('Getting\x20agent\x20with\x20name',_0xf1af7e);return request({'form':{'method':_0xa3ab('0x2a'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa3ab('0x24')]({'session':_0x555677['id'],'module_name':'Employees','query':util[_0xa3ab('0x2b')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xf1af7e),'order_by':'','offset':'0','select_fields':['id',_0xa3ab('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa3ab('0x2c')](function(_0x22aed0){if(_0x22aed0[_0xa3ab('0x2d')][_0xa3ab('0x1e')]){var _0x273bb4=_['find'](_0x22aed0[_0xa3ab('0x2d')],function(_0x19eb42){return _0x19eb42[_0xa3ab('0x2e')]['user_name'][_0xa3ab('0x2f')]===_0xf1af7e;});if(_0x273bb4){logger[_0xa3ab('0xe')](_0xa3ab('0x30'));return BPromise['resolve']({'id':_0x273bb4[_0xa3ab('0x2e')]['id'][_0xa3ab('0x2f')],'name':_0x273bb4[_0xa3ab('0x2e')][_0xa3ab('0x10')][_0xa3ab('0x2f')]});}}logger[_0xa3ab('0xe')](_0xa3ab('0x31'));return BPromise['resolve']({'id':_0x555677[_0xa3ab('0x2e')][_0xa3ab('0x32')][_0xa3ab('0x2f')],'name':_0x555677[_0xa3ab('0x2e')][_0xa3ab('0x33')][_0xa3ab('0x2f')]});});}else{logger[_0xa3ab('0xe')](_0xa3ab('0x34'));return BPromise[_0xa3ab('0x35')]({'id':_0x555677[_0xa3ab('0x2e')][_0xa3ab('0x32')]['value'],'name':_0x555677[_0xa3ab('0x2e')][_0xa3ab('0x33')][_0xa3ab('0x2f')]});}}function getEndUser(_0x1c0e08,_0x17f9e9,_0x1f9c11,_0x41aecb){logger[_0xa3ab('0xe')](_0xa3ab('0x36'),_0x1f9c11);return request({'form':{'method':'get_entry_list','input_type':_0xa3ab('0x23'),'response_type':_0xa3ab('0x23'),'rest_data':JSON[_0xa3ab('0x24')]({'session':_0x41aecb['id'],'module_name':_0xa3ab('0x37'),'query':util[_0xa3ab('0x2b')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1f9c11),'order_by':'','offset':'0','select_fields':['id',_0xa3ab('0x10'),_0xa3ab('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa3ab('0x2c')](function(_0xcc37ff){if(_0xcc37ff[_0xa3ab('0x2d')][_0xa3ab('0x1e')]){var _0x32c446=_[_0xa3ab('0x39')](_0xcc37ff[_0xa3ab('0x2d')],function(_0x1803e0){return _0x1803e0[_0xa3ab('0x2e')][_0xa3ab('0x38')]['value']===_0x1f9c11;});if(_0x32c446){logger['info'](_0xa3ab('0x3a'));return BPromise[_0xa3ab('0x35')]({'id':_0x32c446[_0xa3ab('0x2e')]['id']['value'],'name':_0x32c446['name_value_list']['name'][_0xa3ab('0x2f')],'phone':_0x32c446[_0xa3ab('0x2e')][_0xa3ab('0x38')][_0xa3ab('0x2f')]});}}else{logger[_0xa3ab('0xe')](_0xa3ab('0x3b'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xa3ab('0x23'),'rest_data':JSON[_0xa3ab('0x24')]({'session':_0x41aecb['id'],'module_name':_0xa3ab('0x37'),'name_value_list':[{'name':'first_name','value':_0x17f9e9!==_0xa3ab('0x3c')?_0x17f9e9:util[_0xa3ab('0x2b')](_0xa3ab('0x3d'),_0x1f9c11)},{'name':'phone_home','value':_0x1f9c11}]})}})[_0xa3ab('0x2c')](function(_0x2d82f3){logger[_0xa3ab('0xe')]('Enduser\x20created.');return BPromise[_0xa3ab('0x35')]({'id':_0x2d82f3['id'],'name':_0x2d82f3[_0xa3ab('0x2d')][_0xa3ab('0x3e')][_0xa3ab('0x2f')],'phone':_0x2d82f3[_0xa3ab('0x2d')][_0xa3ab('0x38')]['value']});});}});}function request(_0x31cd62){logger[_0xa3ab('0x3f')](_0xa3ab('0x40'),JSON['stringify'](_0x31cd62));return rp(_[_0xa3ab('0x41')](def,_0x31cd62));}function getTags(_0x98e169,_0x5cec77){var _0x385fda=[];if(_0x98e169&&_0x98e169[_0xa3ab('0x1e')]>0x0){_0x385fda=_['map'](_0x98e169,_0x5cec77);}return _0x385fda;}function getCustomFields(_0x43f6d4,_0x33ad4a){var _0x5f3a3b=[];var _0x420e22={'custom_fields':[]};if(_0x43f6d4[_0xa3ab('0x1e')]>0x0){_['forEach'](_0x43f6d4,function(_0x5ea482){if(_0x5ea482[_0xa3ab('0x42')]==='string'&&_0x5ea482[_0xa3ab('0x43')]&&!_0x5ea482[_0xa3ab('0x44')]){_0x420e22[_0x5ea482[_0xa3ab('0x43')]['toLowerCase']()]=_0x5ea482[_0xa3ab('0x45')][_0xa3ab('0x27')]();}else if(_0x5ea482[_0xa3ab('0x42')]==='string'&&_0x5ea482[_0xa3ab('0x46')]&&_0x5ea482[_0xa3ab('0x44')]){_0x420e22[_0xa3ab('0x47')][_0xa3ab('0x20')]({'id':_0x5ea482[_0xa3ab('0x46')],'value':_0x5ea482[_0xa3ab('0x45')][_0xa3ab('0x27')]()});}else if(_0x5ea482[_0xa3ab('0x42')]===_0xa3ab('0x48')&&_0x5ea482['variableName']&&_0x5ea482['idField']&&_0x5ea482[_0xa3ab('0x44')]){_0x33ad4a[_0x5ea482[_0xa3ab('0x21')]]&&_0x420e22[_0xa3ab('0x47')]['push']({'id':_0x5ea482[_0xa3ab('0x46')],'value':_0x33ad4a[_0x5ea482['variableName']][_0xa3ab('0x27')]()});}else if(_0x5ea482[_0xa3ab('0x42')]==='customVariable'&&_0x5ea482[_0xa3ab('0x49')]&&_0x5ea482[_0xa3ab('0x49')][_0xa3ab('0x10')]&&_0x5ea482[_0xa3ab('0x46')]&&_0x5ea482[_0xa3ab('0x44')]){_0x33ad4a[_0x5ea482[_0xa3ab('0x49')][_0xa3ab('0x10')][_0xa3ab('0x4a')]()]&&_0x420e22[_0xa3ab('0x47')][_0xa3ab('0x20')]({'id':_0x5ea482['idField'],'value':_0x33ad4a[_0x5ea482[_0xa3ab('0x49')][_0xa3ab('0x10')][_0xa3ab('0x4a')]()]['toString']()});}});}return _0x420e22;}function getConnection(_0x5f3448){return request({'method':_0xa3ab('0x4b'),'form':{'method':_0xa3ab('0x4c'),'input_type':_0xa3ab('0x23'),'response_type':_0xa3ab('0x23'),'rest_data':JSON[_0xa3ab('0x24')]({'user_auth':{'user_name':_0x5f3448[_0xa3ab('0x4d')],'password':_0x5f3448['password'],'encryption':_0xa3ab('0x4e')},'application':_0xa3ab('0x4f')})}})[_0xa3ab('0x2c')](function(_0x21f345){var _0xfb9b86=_0x21f345;if(_0xfb9b86['id']){def[_0xa3ab('0x50')]=_0xfb9b86['id'];return BPromise[_0xa3ab('0x35')](_0xfb9b86);}else{throw new Error(util[_0xa3ab('0x2b')](_0xa3ab('0x51'),_0x5f3448['id']));}});}function setRelationship(_0x6d6492,_0x4aa971,_0x2a3d7a,_0x1eeb02){return request({'form':{'method':_0xa3ab('0x52'),'input_type':_0xa3ab('0x23'),'response_type':_0xa3ab('0x23'),'rest_data':JSON[_0xa3ab('0x24')]({'session':_0x6d6492['id'],'module_name':'Calls','module_id':_0x2a3d7a['id'],'link_field_name':_0x1eeb02,'related_ids':[_0x4aa971['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa3ab('0x53')]=function(_0x3f79c8,_0x3b2383,_0x10bf86,_0x1504b1,_0x21b15e,_0xc19baf){var _0x587d6d,_0x55f00a,_0x45c1f5,_0x1c4326;_0xc19baf[_0xa3ab('0x54')]=intUtil[_0xa3ab('0x55')](_0xc19baf['remoteUri']);_0xc19baf[_0xa3ab('0x56')]=intUtil[_0xa3ab('0x55')](_0xc19baf[_0xa3ab('0x56')]);def['uri']=util[_0xa3ab('0x2b')](_0xa3ab('0x57'),_0xc19baf[_0xa3ab('0x54')]);if(_0x21b15e&&_0x21b15e['monitor_format']){logger[_0xa3ab('0xe')](_0xa3ab('0x58'),_0xa3ab('0x59'));_0x3b2383[_0xa3ab('0x5a')]=util[_0xa3ab('0x2b')](_0xa3ab('0x5b'),_0xc19baf[_0xa3ab('0x56')],_0x3b2383['uniqueid'],md5(_0x3b2383[_0xa3ab('0x5c')]));}else{_0x3b2383[_0xa3ab('0x5a')]='';}return getConnection(_0xc19baf)['then'](function(_0x3c95e2){_0x1c4326=_0x3c95e2;return getUser(_0xc19baf,_0x1504b1['name'],_0x1c4326);})[_0xa3ab('0x2c')](function(_0x50d25c){_0x587d6d=_0x50d25c;logger['info'](_0xa3ab('0x5d'),_0x587d6d['id']);return getEndUser(_0xc19baf,_0x3b2383[_0xa3ab('0x5e')],_0x3b2383['calleridnum'],_0x1c4326);})['then'](function(_0x564ef2){_0x55f00a=_0x564ef2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x55f00a['id']);return getTicket(_0xc19baf,_0x587d6d,_0x55f00a,_0x10bf86,_0x3b2383,_0x10bf86[_0xa3ab('0x5f')],_0x1c4326,'Inbound');})[_0xa3ab('0x2c')](function(_0x45e601){_0x45c1f5=_0x45e601;logger['info']('Ticket\x20created!');logger[_0xa3ab('0xe')](_0xa3ab('0x60'),_0x45c1f5['id']);return setRelationship(_0x1c4326,_0x587d6d,_0x45c1f5,_0xa3ab('0x61'));})[_0xa3ab('0x2c')](function(){return setRelationship(_0x1c4326,_0x55f00a,_0x45c1f5,_0xa3ab('0x62'));})[_0xa3ab('0x2c')](function(){return getServerInfo(_0x1c4326);})[_0xa3ab('0x2c')](function(_0x521f45){var _0x1e9790=parseInt(_0x521f45['version'][_0xa3ab('0x63')](0x0));var _0x5aeae3=util['format'](_0xa3ab('0x64'),_0xc19baf[_0xa3ab('0x54')],_0x45c1f5['id']);if(_0x1e9790>0x6){_0x5aeae3=util[_0xa3ab('0x2b')](_0xa3ab('0x65'),_0xc19baf['remoteUri'],_0x45c1f5['id']);}logger['info'](_0xa3ab('0x58'),_0xa3ab('0x66'));emit(util[_0xa3ab('0x2b')]('user:%s',_0x1504b1[_0xa3ab('0x10')]),'trigger:browser:url',{'uri':_0x5aeae3});})[_0xa3ab('0x67')](function(_0x462eb7){logger[_0xa3ab('0x68')]('[QUEUE]',JSON[_0xa3ab('0x24')](_0x462eb7));});};exports['outbound']=function(_0x2f5f88,_0x2950f7,_0x584210,_0x3a81fb,_0x545dbc,_0x5d5121,_0x7f8809){var _0x12b036,_0x288192,_0x134b19,_0x581552;_0x5d5121[_0xa3ab('0x54')]=intUtil[_0xa3ab('0x55')](_0x5d5121[_0xa3ab('0x54')]);_0x5d5121['serverUrl']=intUtil[_0xa3ab('0x55')](_0x5d5121[_0xa3ab('0x56')]);def['uri']=util[_0xa3ab('0x2b')](_0xa3ab('0x57'),_0x5d5121['remoteUri']);if(_0x7f8809&&_0x7f8809[_0xa3ab('0x69')]&&_0x7f8809[_0xa3ab('0x69')]!==_0xa3ab('0x6a')){logger[_0xa3ab('0xe')](_0xa3ab('0x6b'),'Recording\x20is\x20enabled!');_0x2950f7[_0xa3ab('0x5a')]=util[_0xa3ab('0x2b')](_0xa3ab('0x5b'),_0x5d5121[_0xa3ab('0x56')],_0x2950f7['uniqueid'],md5(_0x2950f7['uniqueid']));}return getConnection(_0x5d5121)['then'](function(_0x54c127){_0x581552=_0x54c127;return getUser(_0x5d5121,_0x3a81fb[_0xa3ab('0x10')],_0x581552);})[_0xa3ab('0x2c')](function(_0x48e354){_0x12b036=_0x48e354;logger[_0xa3ab('0xe')](_0xa3ab('0x5d'),_0x12b036['id']);return getEndUser(_0x5d5121,_0x2950f7[_0xa3ab('0x6c')],_0x2950f7[_0xa3ab('0x6d')],_0x581552);})[_0xa3ab('0x2c')](function(_0x21685f){_0x288192=_0x21685f;logger[_0xa3ab('0xe')](_0xa3ab('0x6e'),_0x288192['id']);return getTicket(_0x5d5121,_0x12b036,_0x288192,_0x584210,_0x2950f7,_0x584210[_0xa3ab('0x5f')],_0x581552,_0xa3ab('0x6f'));})[_0xa3ab('0x2c')](function(_0x36503a){_0x134b19=_0x36503a;logger[_0xa3ab('0xe')](_0xa3ab('0x70'));logger[_0xa3ab('0xe')]('The\x20Ticket\x20ID\x20is:',_0x134b19['id']);return setRelationship(_0x581552,_0x12b036,_0x134b19,_0xa3ab('0x61'));})[_0xa3ab('0x2c')](function(){return setRelationship(_0x581552,_0x288192,_0x134b19,'contacts');})['then'](function(){return getServerInfo(_0x581552);})[_0xa3ab('0x2c')](function(_0x484e27){var _0x1b623e=parseInt(_0x484e27[_0xa3ab('0x71')][_0xa3ab('0x63')](0x0));var _0x18365e=util['format'](_0xa3ab('0x64'),_0x5d5121[_0xa3ab('0x54')],_0x134b19['id']);if(_0x1b623e>0x6){_0x18365e=util[_0xa3ab('0x2b')](_0xa3ab('0x65'),_0x5d5121[_0xa3ab('0x54')],_0x134b19['id']);}logger[_0xa3ab('0xe')](_0xa3ab('0x6b'),_0xa3ab('0x66'));emit(util[_0xa3ab('0x2b')]('user:%s',_0x3a81fb['name']),'trigger:browser:url',{'uri':_0x18365e});})[_0xa3ab('0x67')](function(_0x571ace){logger[_0xa3ab('0x68')](_0xa3ab('0x6b'),JSON[_0xa3ab('0x24')](_0x571ace));});};exports[_0xa3ab('0x72')]=function(_0x3784ca,_0x149583,_0x4c49aa,_0x4d5869,_0xd32f22,_0x3983cc){var _0x20ea04,_0x4eea4a,_0x48b94a,_0x4e3a9a;_0x3983cc[_0xa3ab('0x54')]=intUtil[_0xa3ab('0x55')](_0x3983cc[_0xa3ab('0x54')]);_0x3983cc[_0xa3ab('0x56')]=intUtil[_0xa3ab('0x55')](_0x3983cc[_0xa3ab('0x56')]);def[_0xa3ab('0x73')]=util['format'](_0xa3ab('0x57'),_0x3983cc[_0xa3ab('0x54')]);if(_0xd32f22&&_0xd32f22[_0xa3ab('0x74')]){logger[_0xa3ab('0xe')]('['+_0x149583[_0xa3ab('0x75')]['toUpperCase']()+']',_0xa3ab('0x59'));_0x149583[_0xa3ab('0x5a')]=util['format'](_0xa3ab('0x5b'),_0x3983cc[_0xa3ab('0x56')],_0x149583[_0xa3ab('0x5c')],md5(_0x149583[_0xa3ab('0x5c')]));}else{_0x149583[_0xa3ab('0x5a')]='';}return getConnection(_0x3983cc)['then'](function(_0x562d32){_0x4e3a9a=_0x562d32;if(!_[_0xa3ab('0x29')](_0x4d5869)){return getUser(_0x3983cc,_0x4d5869[_0xa3ab('0x10')],_0x4e3a9a);}else{return getUser(_0x3983cc,null,_0x4e3a9a);}})[_0xa3ab('0x2c')](function(_0x5e65f4){_0x20ea04=_0x5e65f4;logger[_0xa3ab('0xe')](_0xa3ab('0x5d'),_0x20ea04['id']);return getEndUser(_0x3983cc,_0x149583[_0xa3ab('0x5e')],_0x149583[_0xa3ab('0x76')],_0x4e3a9a);})[_0xa3ab('0x2c')](function(_0x1f8c1c){_0x4eea4a=_0x1f8c1c;logger[_0xa3ab('0xe')](_0xa3ab('0x6e'),_0x4eea4a['id']);return getTicket(_0x3983cc,_0x20ea04,_0x4eea4a,_0x4c49aa,_0x149583,_0x4c49aa[_0xa3ab('0x5f')],_0x4e3a9a,'Inbound');})[_0xa3ab('0x2c')](function(_0xbbbd7b){_0x48b94a=_0xbbbd7b;logger[_0xa3ab('0xe')](_0xa3ab('0x70'));logger['info'](_0xa3ab('0x60'),_0x48b94a['id']);return setRelationship(_0x4e3a9a,_0x20ea04,_0x48b94a,_0xa3ab('0x61'));})[_0xa3ab('0x2c')](function(){return setRelationship(_0x4e3a9a,_0x4eea4a,_0x48b94a,_0xa3ab('0x62'));})[_0xa3ab('0x2c')](function(){return getServerInfo(_0x4e3a9a);})[_0xa3ab('0x67')](function(_0x49a664){logger[_0xa3ab('0x68')]('['+_0x149583[_0xa3ab('0x75')][_0xa3ab('0x77')]()+']',JSON[_0xa3ab('0x24')](_0x49a664));});}; \ No newline at end of file +var _0x32b7=['The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Outbound','trigger:browser:url','[OUTBOUND]','unmanaged','%s/service/v4_1/rest.php','monitor_format','lastevent','toUpperCase','error','lodash','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','info','Creating\x20new\x20ticket...','name','getString','Subjects','description','Descriptions','date_start','toISOString','replace','duration_hours','parent_type','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','get_server_info','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','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Contacts','first_name','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','customField','toLowerCase','toString','string','custom_fields','content','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!'];(function(_0xd69b55,_0x14d143){var _0x37c370=function(_0x9cc2dc){while(--_0x9cc2dc){_0xd69b55['push'](_0xd69b55['shift']());}};_0x37c370(++_0x14d143);}(_0x32b7,0x108));var _0x732b=function(_0x17f439,_0x22a839){_0x17f439=_0x17f439-0x0;var _0x14ee45=_0x32b7[_0x17f439];return _0x14ee45;};'use strict';var _=require(_0x732b('0x0'));var rp=require('request-promise');var BPromise=require(_0x732b('0x1'));var md5=require(_0x732b('0x2'));var util=require('util');var Redis=require(_0x732b('0x3'));var intUtil=require(_0x732b('0x4'));var config=require(_0x732b('0x5'));var logger=require(_0x732b('0x6'))(_0x732b('0x7'));config[_0x732b('0x8')]=_[_0x732b('0x9')](config[_0x732b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x732b('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x3012bd,_0xede613,_0x48c482){io['to'](_0x3012bd)['emit'](_0xede613,_0x48c482);}function getTicket(_0x2abf35,_0x1b940d,_0x2971ba,_0x1f2002,_0x236c51,_0x4b6e36,_0x4f2080,_0x44abcf){logger[_0x732b('0xb')](_0x732b('0xc'));var _0x3d9c34=new Date();var _0x58f665=[{'name':_0x732b('0xd'),'value':intUtil[_0x732b('0xe')](_0x1f2002[_0x732b('0xf')],_0x236c51,'\x20')},{'name':'assigned_user_id','value':_0x1b940d['id']},{'name':'created_by','value':_0x1b940d['id']},{'name':_0x732b('0x10'),'value':intUtil['getString'](_0x1f2002[_0x732b('0x11')],_0x236c51,'\x0a')},{'name':_0x732b('0x12'),'value':_0x3d9c34[_0x732b('0x13')]()['slice'](0x0,0x13)[_0x732b('0x14')]('T','\x20')},{'name':_0x732b('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x2971ba['id']},{'name':_0x732b('0x16'),'value':'Contacts'},{'name':'parent_name','value':_0x2971ba[_0x732b('0xd')]},{'name':_0x732b('0x17'),'value':_0x44abcf}];if(_0x4b6e36[_0x732b('0x18')]){_[_0x732b('0x19')](_0x4b6e36,function(_0xb31be0){if(_0x236c51[_0xb31be0[_0x732b('0x1a')]]){_0x58f665[_0x732b('0x1b')]({'name':_0xb31be0[_0x732b('0x1c')],'value':_0x236c51[_0xb31be0[_0x732b('0x1a')]]});}});}return request({'form':{'method':_0x732b('0x1d'),'input_type':_0x732b('0x1e'),'response_type':'JSON','rest_data':JSON[_0x732b('0x1f')]({'session':_0x4f2080['id'],'module_name':_0x732b('0x20'),'name_value_list':_0x58f665})}});}function getAuth(_0x247cd3){return util[_0x732b('0x21')](_0x732b('0x22'),new Buffer(_0x247cd3['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0x386399){return request({'form':{'method':_0x732b('0x23'),'input_type':_0x732b('0x1e'),'response_type':_0x732b('0x1e'),'rest_data':JSON[_0x732b('0x1f')]({'session':_0x386399['id']})}});}function getUser(_0x11f5fc,_0x1ee0f9,_0x594e85){if(!_[_0x732b('0x24')](_0x1ee0f9)){logger['info']('Getting\x20agent\x20with\x20name',_0x1ee0f9);return request({'form':{'method':_0x732b('0x25'),'input_type':_0x732b('0x1e'),'response_type':_0x732b('0x1e'),'rest_data':JSON[_0x732b('0x1f')]({'session':_0x594e85['id'],'module_name':_0x732b('0x26'),'query':util['format'](_0x732b('0x27'),_0x1ee0f9),'order_by':'','offset':'0','select_fields':['id','name',_0x732b('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x357089){if(_0x357089[_0x732b('0x29')][_0x732b('0x18')]){var _0x46e54e=_[_0x732b('0x2a')](_0x357089['entry_list'],function(_0x3bc87f){return _0x3bc87f[_0x732b('0x2b')][_0x732b('0x28')][_0x732b('0x2c')]===_0x1ee0f9;});if(_0x46e54e){logger[_0x732b('0xb')](_0x732b('0x2d'));return BPromise[_0x732b('0x2e')]({'id':_0x46e54e[_0x732b('0x2b')]['id'][_0x732b('0x2c')],'name':_0x46e54e['name_value_list'][_0x732b('0xd')][_0x732b('0x2c')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x732b('0x2e')]({'id':_0x594e85[_0x732b('0x2b')][_0x732b('0x2f')][_0x732b('0x2c')],'name':_0x594e85[_0x732b('0x2b')][_0x732b('0x28')][_0x732b('0x2c')]});});}else{logger['info'](_0x732b('0x30'));return BPromise['resolve']({'id':_0x594e85[_0x732b('0x2b')]['user_id'][_0x732b('0x2c')],'name':_0x594e85[_0x732b('0x2b')][_0x732b('0x28')][_0x732b('0x2c')]});}}function getEndUser(_0x3b5e3e,_0x3444eb,_0x4d117e,_0x45e6d6){logger[_0x732b('0xb')](_0x732b('0x31'),_0x4d117e);return request({'form':{'method':_0x732b('0x25'),'input_type':_0x732b('0x1e'),'response_type':_0x732b('0x1e'),'rest_data':JSON[_0x732b('0x1f')]({'session':_0x45e6d6['id'],'module_name':'Contacts','query':util[_0x732b('0x21')](_0x732b('0x32'),_0x4d117e),'order_by':'','offset':'0','select_fields':['id',_0x732b('0xd'),_0x732b('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1c32ee){if(_0x1c32ee['entry_list']['length']){var _0x1d4d02=_[_0x732b('0x2a')](_0x1c32ee[_0x732b('0x29')],function(_0x1fa1b2){return _0x1fa1b2[_0x732b('0x2b')][_0x732b('0x33')][_0x732b('0x2c')]===_0x4d117e;});if(_0x1d4d02){logger[_0x732b('0xb')](_0x732b('0x34'));return BPromise[_0x732b('0x2e')]({'id':_0x1d4d02['name_value_list']['id'][_0x732b('0x2c')],'name':_0x1d4d02['name_value_list']['name'][_0x732b('0x2c')],'phone':_0x1d4d02[_0x732b('0x2b')][_0x732b('0x33')][_0x732b('0x2c')]});}}else{logger[_0x732b('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x732b('0x1d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x732b('0x1f')]({'session':_0x45e6d6['id'],'module_name':_0x732b('0x35'),'name_value_list':[{'name':_0x732b('0x36'),'value':_0x3444eb!==''?_0x3444eb:util[_0x732b('0x21')](_0x732b('0x37'),_0x4d117e)},{'name':_0x732b('0x33'),'value':_0x4d117e}]})}})[_0x732b('0x38')](function(_0x495cc4){logger[_0x732b('0xb')](_0x732b('0x39'));return BPromise[_0x732b('0x2e')]({'id':_0x495cc4['id'],'name':_0x495cc4[_0x732b('0x29')][_0x732b('0x36')][_0x732b('0x2c')],'phone':_0x495cc4[_0x732b('0x29')][_0x732b('0x33')][_0x732b('0x2c')]});});}});}function request(_0x3c44a5){logger[_0x732b('0x3a')](_0x732b('0x3b'),JSON['stringify'](_0x3c44a5));return rp(_[_0x732b('0x3c')](def,_0x3c44a5));}function getTags(_0x335cda,_0x6e9d84){var _0x18ecb1=[];if(_0x335cda&&_0x335cda[_0x732b('0x18')]>0x0){_0x18ecb1=_[_0x732b('0x3d')](_0x335cda,_0x6e9d84);}return _0x18ecb1;}function getCustomFields(_0x59e512,_0x1501f9){var _0x2bcb40=[];var _0x40e348={'custom_fields':[]};if(_0x59e512[_0x732b('0x18')]>0x0){_[_0x732b('0x19')](_0x59e512,function(_0x4cacf8){if(_0x4cacf8[_0x732b('0x3e')]==='string'&&_0x4cacf8[_0x732b('0x3f')]&&!_0x4cacf8[_0x732b('0x40')]){_0x40e348[_0x4cacf8['nameField'][_0x732b('0x41')]()]=_0x4cacf8['content'][_0x732b('0x42')]();}else if(_0x4cacf8['type']===_0x732b('0x43')&&_0x4cacf8[_0x732b('0x1c')]&&_0x4cacf8[_0x732b('0x40')]){_0x40e348[_0x732b('0x44')][_0x732b('0x1b')]({'id':_0x4cacf8[_0x732b('0x1c')],'value':_0x4cacf8[_0x732b('0x45')]['toString']()});}else if(_0x4cacf8['type']===_0x732b('0x46')&&_0x4cacf8['variableName']&&_0x4cacf8['idField']&&_0x4cacf8['customField']){_0x1501f9[_0x4cacf8[_0x732b('0x1a')]]&&_0x40e348[_0x732b('0x44')]['push']({'id':_0x4cacf8[_0x732b('0x1c')],'value':_0x1501f9[_0x4cacf8[_0x732b('0x1a')]][_0x732b('0x42')]()});}else if(_0x4cacf8[_0x732b('0x3e')]===_0x732b('0x47')&&_0x4cacf8['Variable']&&_0x4cacf8[_0x732b('0x48')][_0x732b('0xd')]&&_0x4cacf8[_0x732b('0x1c')]&&_0x4cacf8['customField']){_0x1501f9[_0x4cacf8[_0x732b('0x48')]['name'][_0x732b('0x41')]()]&&_0x40e348[_0x732b('0x44')][_0x732b('0x1b')]({'id':_0x4cacf8[_0x732b('0x1c')],'value':_0x1501f9[_0x4cacf8[_0x732b('0x48')]['name'][_0x732b('0x41')]()]['toString']()});}});}return _0x40e348;}function getConnection(_0x5f535f){return request({'method':_0x732b('0x49'),'form':{'method':_0x732b('0x4a'),'input_type':_0x732b('0x1e'),'response_type':_0x732b('0x1e'),'rest_data':JSON[_0x732b('0x1f')]({'user_auth':{'user_name':_0x5f535f[_0x732b('0x4b')],'password':_0x5f535f[_0x732b('0x4c')],'encryption':_0x732b('0x4d')},'application':_0x732b('0x4e')})}})['then'](function(_0x13fe5c){var _0x1dd601=_0x13fe5c;if(_0x1dd601['id']){def[_0x732b('0x4f')]=_0x1dd601['id'];return BPromise['resolve'](_0x1dd601);}else{throw new Error(util[_0x732b('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x5f535f['id']));}});}function setRelationship(_0x1fdd08,_0x587be2,_0x17717e,_0xbc2033){return request({'form':{'method':_0x732b('0x50'),'input_type':_0x732b('0x1e'),'response_type':_0x732b('0x1e'),'rest_data':JSON[_0x732b('0x1f')]({'session':_0x1fdd08['id'],'module_name':_0x732b('0x20'),'module_id':_0x17717e['id'],'link_field_name':_0xbc2033,'related_ids':[_0x587be2['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x732b('0x51')]=function(_0xcb6407,_0x462190,_0x26f775,_0x44932a,_0x224aaf,_0x4686c5){var _0x273143,_0x54d4ef,_0x15c273,_0x6add68;_0x4686c5[_0x732b('0x52')]=intUtil[_0x732b('0x53')](_0x4686c5[_0x732b('0x52')]);_0x4686c5[_0x732b('0x54')]=intUtil['stripTrailingSlash'](_0x4686c5[_0x732b('0x54')]);def[_0x732b('0x55')]=util['format']('%s/service/v4_1/rest.php',_0x4686c5[_0x732b('0x52')]);if(_0x224aaf&&_0x224aaf['monitor_format']){logger[_0x732b('0xb')](_0x732b('0x56'),_0x732b('0x57'));_0x462190['recordingURL']=util[_0x732b('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4686c5[_0x732b('0x54')],_0x462190[_0x732b('0x58')],md5(_0x462190['uniqueid']));}else{_0x462190[_0x732b('0x59')]='';}return getConnection(_0x4686c5)[_0x732b('0x38')](function(_0x128095){_0x6add68=_0x128095;return getUser(_0x4686c5,_0x44932a[_0x732b('0xd')],_0x6add68);})[_0x732b('0x38')](function(_0x1abae8){_0x273143=_0x1abae8;logger[_0x732b('0xb')](_0x732b('0x5a'),_0x273143['id']);return getEndUser(_0x4686c5,_0x462190[_0x732b('0x5b')],_0x462190['calleridnum'],_0x6add68);})[_0x732b('0x38')](function(_0x6d65f4){_0x54d4ef=_0x6d65f4;logger[_0x732b('0xb')](_0x732b('0x5c'),_0x54d4ef['id']);return getTicket(_0x4686c5,_0x273143,_0x54d4ef,_0x26f775,_0x462190,_0x26f775[_0x732b('0x5d')],_0x6add68,_0x732b('0x5e'));})[_0x732b('0x38')](function(_0x320a91){_0x15c273=_0x320a91;logger['info'](_0x732b('0x5f'));logger[_0x732b('0xb')](_0x732b('0x60'),_0x15c273['id']);return setRelationship(_0x6add68,_0x273143,_0x15c273,_0x732b('0x61'));})[_0x732b('0x38')](function(){return setRelationship(_0x6add68,_0x54d4ef,_0x15c273,_0x732b('0x62'));})['then'](function(){return getServerInfo(_0x6add68);})[_0x732b('0x38')](function(_0x4efe90){var _0x35ed44=parseInt(_0x4efe90[_0x732b('0x63')][_0x732b('0x64')](0x0));var _0x10c7aa=util[_0x732b('0x21')](_0x732b('0x65'),_0x4686c5[_0x732b('0x52')],_0x15c273['id']);if(_0x35ed44>0x6){_0x10c7aa=util['format'](_0x732b('0x66'),_0x4686c5['remoteUri'],_0x15c273['id']);}logger['info']('[QUEUE]',_0x732b('0x67'));emit(util[_0x732b('0x21')](_0x732b('0x68'),_0x44932a[_0x732b('0xd')]),'trigger:browser:url',{'uri':_0x10c7aa});})[_0x732b('0x69')](function(_0x456679){logger['error'](_0x732b('0x56'),JSON[_0x732b('0x1f')](_0x456679));});};exports[_0x732b('0x6a')]=function(_0x233e45,_0x464f41,_0x4a4ed3,_0x36e92a,_0x2a70be,_0x2e781e,_0x2c1a8a){var _0x2d93dc,_0x3ccde4,_0x14ea9f,_0x3cc299;_0x2e781e[_0x732b('0x52')]=intUtil[_0x732b('0x53')](_0x2e781e['remoteUri']);_0x2e781e[_0x732b('0x54')]=intUtil[_0x732b('0x53')](_0x2e781e[_0x732b('0x54')]);def[_0x732b('0x55')]=util[_0x732b('0x21')]('%s/service/v4_1/rest.php',_0x2e781e['remoteUri']);if(_0x2c1a8a&&_0x2c1a8a[_0x732b('0x6b')]&&_0x2c1a8a[_0x732b('0x6b')]!==_0x732b('0x6c')){logger[_0x732b('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x464f41['recordingURL']=util['format'](_0x732b('0x6d'),_0x2e781e[_0x732b('0x54')],_0x464f41[_0x732b('0x58')],md5(_0x464f41['uniqueid']));}return getConnection(_0x2e781e)[_0x732b('0x38')](function(_0x42b11b){_0x3cc299=_0x42b11b;return getUser(_0x2e781e,_0x36e92a[_0x732b('0xd')],_0x3cc299);})['then'](function(_0x7ead09){_0x2d93dc=_0x7ead09;logger[_0x732b('0xb')](_0x732b('0x5a'),_0x2d93dc['id']);return getEndUser(_0x2e781e,_0x464f41['destcalleridname'],_0x464f41[_0x732b('0x6e')],_0x3cc299);})[_0x732b('0x38')](function(_0x2ab812){_0x3ccde4=_0x2ab812;logger[_0x732b('0xb')](_0x732b('0x5c'),_0x3ccde4['id']);return getTicket(_0x2e781e,_0x2d93dc,_0x3ccde4,_0x4a4ed3,_0x464f41,_0x4a4ed3[_0x732b('0x5d')],_0x3cc299,_0x732b('0x6f'));})[_0x732b('0x38')](function(_0x1355fa){_0x14ea9f=_0x1355fa;logger[_0x732b('0xb')](_0x732b('0x5f'));logger[_0x732b('0xb')](_0x732b('0x60'),_0x14ea9f['id']);return setRelationship(_0x3cc299,_0x2d93dc,_0x14ea9f,'users');})[_0x732b('0x38')](function(){return setRelationship(_0x3cc299,_0x3ccde4,_0x14ea9f,_0x732b('0x62'));})[_0x732b('0x38')](function(){return getServerInfo(_0x3cc299);})['then'](function(_0x2cf676){var _0x8fce89=parseInt(_0x2cf676['version'][_0x732b('0x64')](0x0));var _0xbd749f=util['format'](_0x732b('0x65'),_0x2e781e['remoteUri'],_0x14ea9f['id']);if(_0x8fce89>0x6){_0xbd749f=util['format'](_0x732b('0x66'),_0x2e781e[_0x732b('0x52')],_0x14ea9f['id']);}logger[_0x732b('0xb')]('[OUTBOUND]',_0x732b('0x67'));emit(util[_0x732b('0x21')](_0x732b('0x68'),_0x36e92a['name']),_0x732b('0x70'),{'uri':_0xbd749f});})['catch'](function(_0xbc791e){logger['error'](_0x732b('0x71'),JSON[_0x732b('0x1f')](_0xbc791e));});};exports[_0x732b('0x72')]=function(_0x41feaa,_0x11c637,_0x2a94ef,_0xc47409,_0x19ed44,_0x21a997){var _0x4967a2,_0x2d1989,_0x420d97,_0x44fdfe;_0x21a997[_0x732b('0x52')]=intUtil[_0x732b('0x53')](_0x21a997[_0x732b('0x52')]);_0x21a997[_0x732b('0x54')]=intUtil[_0x732b('0x53')](_0x21a997['serverUrl']);def[_0x732b('0x55')]=util[_0x732b('0x21')](_0x732b('0x73'),_0x21a997[_0x732b('0x52')]);if(_0x19ed44&&_0x19ed44[_0x732b('0x74')]){logger[_0x732b('0xb')]('['+_0x11c637[_0x732b('0x75')][_0x732b('0x76')]()+']',_0x732b('0x57'));_0x11c637[_0x732b('0x59')]=util[_0x732b('0x21')](_0x732b('0x6d'),_0x21a997[_0x732b('0x54')],_0x11c637[_0x732b('0x58')],md5(_0x11c637['uniqueid']));}else{_0x11c637[_0x732b('0x59')]='';}return getConnection(_0x21a997)['then'](function(_0x2fc783){_0x44fdfe=_0x2fc783;if(!_[_0x732b('0x24')](_0xc47409)){return getUser(_0x21a997,_0xc47409[_0x732b('0xd')],_0x44fdfe);}else{return getUser(_0x21a997,null,_0x44fdfe);}})[_0x732b('0x38')](function(_0x4ea881){_0x4967a2=_0x4ea881;logger[_0x732b('0xb')](_0x732b('0x5a'),_0x4967a2['id']);return getEndUser(_0x21a997,_0x11c637['calleridname'],_0x11c637['calleridnum'],_0x44fdfe);})[_0x732b('0x38')](function(_0x20d7c6){_0x2d1989=_0x20d7c6;logger[_0x732b('0xb')](_0x732b('0x5c'),_0x2d1989['id']);return getTicket(_0x21a997,_0x4967a2,_0x2d1989,_0x2a94ef,_0x11c637,_0x2a94ef['Fields'],_0x44fdfe,_0x732b('0x5e'));})['then'](function(_0x2a88c4){_0x420d97=_0x2a88c4;logger[_0x732b('0xb')](_0x732b('0x5f'));logger[_0x732b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x420d97['id']);return setRelationship(_0x44fdfe,_0x4967a2,_0x420d97,_0x732b('0x61'));})[_0x732b('0x38')](function(){return setRelationship(_0x44fdfe,_0x2d1989,_0x420d97,_0x732b('0x62'));})[_0x732b('0x38')](function(){return getServerInfo(_0x44fdfe);})['catch'](function(_0x3ba3eb){logger[_0x732b('0x77')]('['+_0x11c637[_0x732b('0x75')]['toUpperCase']()+']',JSON[_0x732b('0x1f')](_0x3ba3eb));});}; \ 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 f014f8f..3a530f1 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 _0xaaa2=['substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice'];(function(_0x422298,_0x5dde31){var _0x397770=function(_0x2c113c){while(--_0x2c113c){_0x422298['push'](_0x422298['shift']());}};_0x397770(++_0x5dde31);}(_0xaaa2,0x1f2));var _0x2aaa=function(_0x12faa2,_0x21b3cd){_0x12faa2=_0x12faa2-0x0;var _0x4cc6a6=_0xaaa2[_0x12faa2];return _0x4cc6a6;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));exports[_0x2aaa('0x2')]=function(_0x65a6e3,_0x4cc3ae,_0x3ab80c){var _0x120002=[];if(_0x65a6e3[_0x2aaa('0x3')]>0x0){var _0x9533b0=_[_0x2aaa('0x4')](_0x65a6e3,['id']);for(var _0x236296=0x0;_0x236296<_0x9533b0[_0x2aaa('0x3')];_0x236296++){var _0x90a908=_0x9533b0[_0x236296];if(_0x90a908['type']===_0x2aaa('0x5')){_0x120002[_0x2aaa('0x6')](_0x90a908[_0x2aaa('0x7')]);}else if(_0x90a908[_0x2aaa('0x8')]===_0x2aaa('0x9')&&_0x90a908[_0x2aaa('0xa')]){_0x4cc3ae[_0x90a908['variableName']]&&_0x120002['push'](_0x4cc3ae[_0x90a908[_0x2aaa('0xa')]]['toString']());}else if(_0x90a908[_0x2aaa('0x8')]===_0x2aaa('0xb')&&_0x90a908[_0x2aaa('0xc')]&&_0x90a908[_0x2aaa('0xc')][_0x2aaa('0xd')]){_0x4cc3ae[_0x90a908[_0x2aaa('0xc')][_0x2aaa('0xd')]['toLowerCase']()]&&_0x120002[_0x2aaa('0x6')](_0x4cc3ae[_0x90a908[_0x2aaa('0xc')][_0x2aaa('0xd')][_0x2aaa('0xe')]()]['toString']());}else if(_0x90a908[_0x2aaa('0x8')]===_0x2aaa('0xf')){if(_0x90a908[_0x2aaa('0x10')]===_0x2aaa('0x5')&&_0x90a908[_0x2aaa('0x11')]){_0x120002[_0x2aaa('0x6')](util[_0x2aaa('0x12')](_0x2aaa('0x13'),_0x90a908['key'],_0x90a908[_0x2aaa('0x14')]));}else if(_0x90a908[_0x2aaa('0x10')]===_0x2aaa('0x9')&&_0x90a908['variableName']&&_0x90a908[_0x2aaa('0x11')]){_0x4cc3ae[_0x90a908[_0x2aaa('0xa')]]&&_0x120002['push'](util['format']('%s:\x20%s',_0x90a908[_0x2aaa('0x11')],_0x4cc3ae[_0x90a908[_0x2aaa('0xa')]]));}else if(_0x90a908[_0x2aaa('0x10')]===_0x2aaa('0xb')&&_0x90a908[_0x2aaa('0xc')]&&_0x90a908[_0x2aaa('0xc')][_0x2aaa('0xd')]&&_0x90a908[_0x2aaa('0x11')]){_0x4cc3ae[_0x90a908[_0x2aaa('0xc')][_0x2aaa('0xd')]['toLowerCase']()]&&_0x120002[_0x2aaa('0x6')](util['format'](_0x2aaa('0x13'),_0x90a908[_0x2aaa('0x11')],_0x4cc3ae[_0x90a908['Variable'][_0x2aaa('0xd')][_0x2aaa('0xe')]()]));}}}}return _0x120002[_0x2aaa('0x15')](_0x3ab80c);};exports[_0x2aaa('0x16')]=function(_0x390ea9){var _0x302fe8=_0x390ea9[_0x2aaa('0x17')](-0x1);if(_0x302fe8==='/'){_0x390ea9=_0x390ea9[_0x2aaa('0x18')](0x0,_0x390ea9[_0x2aaa('0x19')](_0x302fe8));}return _0x390ea9;};exports[_0x2aaa('0x1a')]=function(_0x2e877e){if(!_[_0x2aaa('0x1b')](_0x2e877e)&&_0x2e877e!==''){var _0x4c66cc=/^(([^<>()\[\]\\.,;:\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 _0x4c66cc[_0x2aaa('0x1c')](String(_0x2e877e)[_0x2aaa('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x3649=['keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','type','string','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyType','format','%s:\x20%s','key'];(function(_0x4fad63,_0x2852c4){var _0x2e17a8=function(_0x69d8e8){while(--_0x69d8e8){_0x4fad63['push'](_0x4fad63['shift']());}};_0x2e17a8(++_0x2852c4);}(_0x3649,0x175));var _0x9364=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3649[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x9364('0x0'));var util=require('util');exports[_0x9364('0x1')]=function(_0x40cda0,_0x110361,_0x34fdae){var _0x1384a8=[];if(_0x40cda0[_0x9364('0x2')]>0x0){var _0x46241f=_[_0x9364('0x3')](_0x40cda0,['id']);for(var _0x4e4e5b=0x0;_0x4e4e5b<_0x46241f['length'];_0x4e4e5b++){var _0x2e1e4d=_0x46241f[_0x4e4e5b];if(_0x2e1e4d[_0x9364('0x4')]===_0x9364('0x5')){_0x1384a8['push'](_0x2e1e4d[_0x9364('0x6')]);}else if(_0x2e1e4d[_0x9364('0x4')]===_0x9364('0x7')&&_0x2e1e4d[_0x9364('0x8')]){_0x110361[_0x2e1e4d['variableName']]&&_0x1384a8[_0x9364('0x9')](_0x110361[_0x2e1e4d[_0x9364('0x8')]][_0x9364('0xa')]());}else if(_0x2e1e4d[_0x9364('0x4')]===_0x9364('0xb')&&_0x2e1e4d[_0x9364('0xc')]&&_0x2e1e4d[_0x9364('0xc')]['name']){_0x110361[_0x2e1e4d[_0x9364('0xc')][_0x9364('0xd')][_0x9364('0xe')]()]&&_0x1384a8[_0x9364('0x9')](_0x110361[_0x2e1e4d[_0x9364('0xc')][_0x9364('0xd')][_0x9364('0xe')]()][_0x9364('0xa')]());}else if(_0x2e1e4d[_0x9364('0x4')]==='keyValue'){if(_0x2e1e4d[_0x9364('0xf')]===_0x9364('0x5')&&_0x2e1e4d['key']){_0x1384a8[_0x9364('0x9')](util[_0x9364('0x10')](_0x9364('0x11'),_0x2e1e4d[_0x9364('0x12')],_0x2e1e4d[_0x9364('0x13')]));}else if(_0x2e1e4d['keyType']===_0x9364('0x7')&&_0x2e1e4d['variableName']&&_0x2e1e4d['key']){_0x110361[_0x2e1e4d[_0x9364('0x8')]]&&_0x1384a8['push'](util[_0x9364('0x10')](_0x9364('0x11'),_0x2e1e4d[_0x9364('0x12')],_0x110361[_0x2e1e4d['variableName']]));}else if(_0x2e1e4d['keyType']===_0x9364('0xb')&&_0x2e1e4d[_0x9364('0xc')]&&_0x2e1e4d[_0x9364('0xc')]['name']&&_0x2e1e4d['key']){_0x110361[_0x2e1e4d['Variable']['name'][_0x9364('0xe')]()]&&_0x1384a8[_0x9364('0x9')](util['format'](_0x9364('0x11'),_0x2e1e4d[_0x9364('0x12')],_0x110361[_0x2e1e4d[_0x9364('0xc')]['name'][_0x9364('0xe')]()]));}}}}return _0x1384a8[_0x9364('0x14')](_0x34fdae);};exports[_0x9364('0x15')]=function(_0x44037f){var _0x32dcba=_0x44037f[_0x9364('0x16')](-0x1);if(_0x32dcba==='/'){_0x44037f=_0x44037f[_0x9364('0x17')](0x0,_0x44037f[_0x9364('0x18')](_0x32dcba));}return _0x44037f;};exports[_0x9364('0x19')]=function(_0x1c851f){if(!_[_0x9364('0x1a')](_0x1c851f)&&_0x1c851f!==''){var _0x2b3f44=/^(([^<>()\[\]\\.,;:\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 _0x2b3f44[_0x9364('0x1b')](String(_0x1c851f)[_0x9364('0xe')]());}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 ebc7636..d9ad634 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5f2f8c,_0x215aea){var _0x14c72a=function(_0x378325){while(--_0x378325){_0x5f2f8c['push'](_0x5f2f8c['shift']());}};_0x14c72a(++_0x215aea);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 4e51061..e31d93c 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 _0x1c02=['Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','length','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','username','token','Basic\x20%s','toString','debug','stringify','defaults','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','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...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','name','getString','Subjects'];(function(_0x2f4ad4,_0x3c0271){var _0x7afb99=function(_0x5f26c6){while(--_0x5f26c6){_0x2f4ad4['push'](_0x2f4ad4['shift']());}};_0x7afb99(++_0x3c0271);}(_0x1c02,0xc4));var _0x21c0=function(_0x3a5218,_0x11c73a){_0x3a5218=_0x3a5218-0x0;var _0x3d35ec=_0x1c02[_0x3a5218];return _0x3d35ec;};'use strict';var _=require('lodash');var rp=require(_0x21c0('0x0'));var md5=require(_0x21c0('0x1'));var util=require(_0x21c0('0x2'));var Redis=require(_0x21c0('0x3'));var intUtil=require(_0x21c0('0x4'));var config=require(_0x21c0('0x5'));var logger=require('../../../../config/logger')(_0x21c0('0x6'));config[_0x21c0('0x7')]=_['defaults'](config[_0x21c0('0x7')],{'host':_0x21c0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21c0('0x7')]));function emit(_0x1b2b98,_0x576030,_0x1985cf){io['to'](_0x1b2b98)[_0x21c0('0x9')](_0x576030,_0x1985cf);}var headers={'Content-Type':_0x21c0('0xa'),'Accept':_0x21c0('0xa')};function getTicket(_0x34b72b,_0x1c8f21,_0x1c14cf,_0x54dfbd,_0x54f7c4){logger[_0x21c0('0xb')](_0x21c0('0xc'));return request({'uri':util[_0x21c0('0xd')]('%s/tickets.json',_0x34b72b[_0x21c0('0xe')]),'method':_0x21c0('0xf'),'body':{'ticket':_[_0x21c0('0x10')]({'requester_id':_0x1c14cf['id'],'submitter_id':_0x1c8f21?_0x1c8f21['id']:undefined,'assignee_id':_0x1c8f21?_0x1c8f21['id']:undefined,'tags':getTags(_0x54dfbd['Tags'],_0x21c0('0x11')),'subject':intUtil[_0x21c0('0x12')](_0x54dfbd[_0x21c0('0x13')],_0x54f7c4,'\x20'),'description':intUtil[_0x21c0('0x12')](_0x54dfbd[_0x21c0('0x14')],_0x54f7c4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x21c0('0x12')](_0x54dfbd['Descriptions'],_0x54f7c4,'\x0a')}},getCustomFields(_0x54dfbd[_0x21c0('0x15')],_0x54f7c4))}})[_0x21c0('0x16')](function(_0x32fd0c){logger['info'](_0x21c0('0x17'));return _0x32fd0c[_0x21c0('0x18')];});}function getUser(_0x4e9902,_0x3888a8){if(intUtil[_0x21c0('0x19')](_0x3888a8)){logger[_0x21c0('0xb')]('Getting\x20agent\x20with\x20email',_0x3888a8);return request({'uri':util[_0x21c0('0xd')](_0x21c0('0x1a'),_0x4e9902[_0x21c0('0xe')]),'qs':{'query':util[_0x21c0('0xd')](_0x21c0('0x1b'),_0x3888a8)}})[_0x21c0('0x16')](function(_0x48124d){if(_0x48124d[_0x21c0('0x1c')]){logger['info']('Agent\x20found!');return _['find'](_0x48124d[_0x21c0('0x1d')],{'email':_0x3888a8,'role':'agent'});}else{logger[_0x21c0('0xb')](_0x21c0('0x1e'));return request({'uri':util[_0x21c0('0xd')]('%s/users/me.json',_0x4e9902[_0x21c0('0xe')])})[_0x21c0('0x16')](function(_0x64896d){logger[_0x21c0('0xb')]('Admin\x20account\x20selected.');return _0x64896d[_0x21c0('0x1f')];});}});}else{logger[_0x21c0('0xb')](_0x21c0('0x1e'));return request({'uri':util[_0x21c0('0xd')](_0x21c0('0x20'),_0x4e9902[_0x21c0('0xe')])})[_0x21c0('0x16')](function(_0x2ba868){logger[_0x21c0('0xb')](_0x21c0('0x21'));return _0x2ba868[_0x21c0('0x1f')];});}}function getEndUser(_0x11e311,_0xf1a1d4,_0x5f2dea){logger[_0x21c0('0xb')](_0x21c0('0x22'),_0x5f2dea);return request({'uri':util[_0x21c0('0xd')]('%s/search.json',_0x11e311[_0x21c0('0xe')]),'qs':{'query':util[_0x21c0('0xd')](_0x21c0('0x23'),_0x5f2dea)}})[_0x21c0('0x16')](function(_0x1a1485){var _0xd5939;if(_0x1a1485[_0x21c0('0x1d')]['length']){_0x1a1485['results']=_['filter'](_0x1a1485[_0x21c0('0x1d')],{'suspended':![],'role':_0x21c0('0x24')});if(_0x1a1485[_0x21c0('0x1d')][_0x21c0('0x25')]){_0xd5939=_['first'](_0x1a1485[_0x21c0('0x1d')]);}}if(_0xd5939){logger[_0x21c0('0xb')](_0x21c0('0x26'));return _0xd5939;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x21c0('0xd')](_0x21c0('0x27'),_0x11e311[_0x21c0('0xe')]),'method':_0x21c0('0xf'),'body':{'user':{'role':_0x21c0('0x24'),'name':util[_0x21c0('0xd')](_0x21c0('0x28'),_0xf1a1d4||_0x5f2dea),'phone':_0x5f2dea}}})[_0x21c0('0x16')](function(_0x26a044){logger[_0x21c0('0xb')](_0x21c0('0x29'));return _0x26a044[_0x21c0('0x1f')];});}});}function getAuth(_0x1a551f){var _0x4d545f;if(_0x1a551f[_0x21c0('0x2a')]==='password'){_0x4d545f=util[_0x21c0('0xd')]('%s:%s',_0x1a551f[_0x21c0('0x2b')],_0x1a551f['password']);}else if(_0x1a551f[_0x21c0('0x2a')]==='token'){_0x4d545f=util[_0x21c0('0xd')]('%s/token:%s',_0x1a551f[_0x21c0('0x2b')],_0x1a551f[_0x21c0('0x2c')]);}return util[_0x21c0('0xd')](_0x21c0('0x2d'),new Buffer(_0x4d545f)[_0x21c0('0x2e')]('base64'));}function request(_0x26b707){logger[_0x21c0('0x2f')]('[HTTP]',JSON[_0x21c0('0x30')](_0x26b707));return rp(_[_0x21c0('0x31')](_0x26b707,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x464ba5,_0x4e85c7){var _0x11599a=[];if(_0x464ba5&&_0x464ba5['length']>0x0){_0x11599a=_[_0x21c0('0x32')](_0x464ba5,_0x4e85c7);}return _0x11599a;}function getCustomFields(_0x2b7ea7,_0x1ada96){var _0x30f4de=[];var _0x5469bf={'custom_fields':[]};if(_0x2b7ea7[_0x21c0('0x25')]>0x0){_[_0x21c0('0x33')](_0x2b7ea7,function(_0x259c37){if(_[_0x21c0('0x34')]([_0x21c0('0x35'),_0x21c0('0x36')],_0x259c37[_0x21c0('0x37')])&&_0x259c37[_0x21c0('0x38')]&&!_0x259c37['customField']){_0x5469bf[_0x259c37[_0x21c0('0x38')][_0x21c0('0x39')]()]=_0x259c37[_0x21c0('0x3a')][_0x21c0('0x2e')]();}else if(_[_0x21c0('0x34')](['string','picklist'],_0x259c37[_0x21c0('0x37')])&&_0x259c37[_0x21c0('0x3b')]&&_0x259c37[_0x21c0('0x3c')]){_0x5469bf[_0x21c0('0x3d')][_0x21c0('0x3e')]({'id':_0x259c37['idField'],'value':_0x259c37['content'][_0x21c0('0x2e')]()});}else if(_0x259c37[_0x21c0('0x37')]===_0x21c0('0x3f')&&_0x259c37[_0x21c0('0x40')]&&_0x259c37[_0x21c0('0x3b')]&&_0x259c37['customField']){_0x1ada96[_0x259c37[_0x21c0('0x40')]]&&_0x5469bf[_0x21c0('0x3d')][_0x21c0('0x3e')]({'id':_0x259c37[_0x21c0('0x3b')],'value':_0x1ada96[_0x259c37[_0x21c0('0x40')]][_0x21c0('0x2e')]()});}else if(_0x259c37[_0x21c0('0x37')]===_0x21c0('0x41')&&_0x259c37[_0x21c0('0x42')]&&_0x259c37['Variable'][_0x21c0('0x11')]&&_0x259c37[_0x21c0('0x3b')]&&_0x259c37[_0x21c0('0x3c')]){_0x1ada96[_0x259c37[_0x21c0('0x42')][_0x21c0('0x11')][_0x21c0('0x39')]()]&&_0x5469bf['custom_fields'][_0x21c0('0x3e')]({'id':_0x259c37[_0x21c0('0x3b')],'value':_0x1ada96[_0x259c37[_0x21c0('0x42')]['name']['toLowerCase']()][_0x21c0('0x2e')]()});}});}return _0x5469bf;}exports['queue']=function(_0x56753f,_0x4b4956,_0x1febe9,_0x4ebeed,_0x2863e9,_0xfd0670){var _0x4558f2,_0x350de9;_0xfd0670[_0x21c0('0xe')]=intUtil[_0x21c0('0x43')](_0xfd0670[_0x21c0('0xe')]);_0xfd0670[_0x21c0('0x44')]=intUtil[_0x21c0('0x43')](_0xfd0670[_0x21c0('0x44')]);if(_0x2863e9&&_0x2863e9['monitor_format']){logger['info'](_0x21c0('0x45'),_0x21c0('0x46'));_0x4b4956[_0x21c0('0x47')]=util[_0x21c0('0xd')](_0x21c0('0x48'),_0xfd0670[_0x21c0('0x44')],_0x4b4956[_0x21c0('0x49')],md5(_0x4b4956[_0x21c0('0x49')]));}else{_0x4b4956[_0x21c0('0x47')]='';}headers[_0x21c0('0x4a')]=getAuth(_0xfd0670);return getUser(_0xfd0670,_0x4ebeed['email'])[_0x21c0('0x16')](function(_0x307221){_0x4558f2=_0x307221;logger[_0x21c0('0xb')]('The\x20User\x20ID\x20is:',_0x4558f2['id']);return getEndUser(_0xfd0670,_0x4b4956[_0x21c0('0x4b')],_0x4b4956[_0x21c0('0x4c')]);})[_0x21c0('0x16')](function(_0xd94ef7){_0x350de9=_0xd94ef7;logger[_0x21c0('0xb')]('The\x20Enduser\x20ID\x20is:',_0x350de9['id']);return getTicket(_0xfd0670,_0x4558f2,_0x350de9,_0x1febe9,_0x4b4956);})[_0x21c0('0x16')](function(_0x2ae139){if(_0x2ae139){logger['info'](_0x21c0('0x4d'),_0x2ae139['id']);switch(_0xfd0670[_0x21c0('0x37')]){case _0x21c0('0x4e'):logger[_0x21c0('0xb')](_0x21c0('0x45'),_0x21c0('0x4f'));return request({'uri':util['format'](_0x21c0('0x50'),_0xfd0670[_0x21c0('0xe')],_0x4558f2['id'],_0x2ae139['id']),'method':_0x21c0('0xf')});case _0x21c0('0x51'):logger[_0x21c0('0xb')]('[QUEUE]',_0x21c0('0x52'));emit(util[_0x21c0('0xd')](_0x21c0('0x53'),_0x4ebeed['name']),_0x21c0('0x54'),{'uri':util['format'](_0x21c0('0x55'),_0xfd0670['remoteUri'][_0x21c0('0x56')](_0x21c0('0x57'),''),_0x2ae139['id'])});break;default:logger[_0x21c0('0x58')](_0x21c0('0x45'),_0x21c0('0x59'));}}})[_0x21c0('0x5a')](function(_0x110a35){logger[_0x21c0('0x58')](_0x21c0('0x5b'),util[_0x21c0('0x5c')](_0x110a35,{'showHidden':!![],'depth':null}));});};exports[_0x21c0('0x5d')]=function(_0xc630ef,_0x4dd93f,_0x1695fc,_0x33f1f2,_0x11b00e,_0x529d5c,_0x2dc358){var _0x407b86,_0x3b263b;_0x529d5c[_0x21c0('0xe')]=intUtil[_0x21c0('0x43')](_0x529d5c[_0x21c0('0xe')]);_0x529d5c['serverUrl']=intUtil['stripTrailingSlash'](_0x529d5c[_0x21c0('0x44')]);if(_0x2dc358&&_0x2dc358['recordingFormat']&&_0x2dc358[_0x21c0('0x5e')]!==_0x21c0('0x5f')){logger['info'](_0x21c0('0x60'),_0x21c0('0x46'));_0x4dd93f[_0x21c0('0x47')]=util[_0x21c0('0xd')](_0x21c0('0x48'),_0x529d5c[_0x21c0('0x44')],_0x4dd93f[_0x21c0('0x49')],md5(_0x4dd93f['uniqueid']));}headers['Authorization']=getAuth(_0x529d5c);return getUser(_0x529d5c,_0x33f1f2[_0x21c0('0x61')])[_0x21c0('0x16')](function(_0x47f143){_0x407b86=_0x47f143;logger[_0x21c0('0xb')](_0x21c0('0x62'),_0x407b86['id']);return getEndUser(_0x529d5c,_0x4dd93f[_0x21c0('0x63')],_0x4dd93f[_0x21c0('0x64')]);})[_0x21c0('0x16')](function(_0x879cb6){_0x3b263b=_0x879cb6;logger[_0x21c0('0xb')](_0x21c0('0x65'),_0x3b263b['id']);return getTicket(_0x529d5c,_0x407b86,_0x3b263b,_0x1695fc,_0x4dd93f);})[_0x21c0('0x16')](function(_0x47a9fb){if(_0x47a9fb){logger[_0x21c0('0xb')](_0x21c0('0x4d'),_0x47a9fb['id']);switch(_0x529d5c[_0x21c0('0x37')]){case _0x21c0('0x4e'):logger[_0x21c0('0xb')](_0x21c0('0x60'),_0x21c0('0x4f'));return request({'uri':util['format'](_0x21c0('0x50'),_0x529d5c['remoteUri'],_0x407b86['id'],_0x47a9fb['id']),'method':'POST'});case _0x21c0('0x51'):logger[_0x21c0('0xb')](_0x21c0('0x60'),_0x21c0('0x52'));emit(util[_0x21c0('0xd')](_0x21c0('0x53'),_0x33f1f2['name']),_0x21c0('0x54'),{'uri':util['format'](_0x21c0('0x55'),_0x529d5c['remoteUri'][_0x21c0('0x56')](_0x21c0('0x57'),''),_0x47a9fb['id'])});break;default:logger['error'](_0x21c0('0x60'),_0x21c0('0x59'));}}})[_0x21c0('0x5a')](function(_0xdcb41){logger[_0x21c0('0x58')](_0x21c0('0x66'),util[_0x21c0('0x5c')](_0xdcb41,{'showHidden':!![],'depth':null}));});};exports[_0x21c0('0x67')]=function(_0x577cea,_0x3388e8,_0xea4284,_0x20dbaa,_0x266b56,_0x24d4a5){var _0x3244a7,_0x555f3a;_0x24d4a5[_0x21c0('0xe')]=intUtil['stripTrailingSlash'](_0x24d4a5[_0x21c0('0xe')]);_0x24d4a5[_0x21c0('0x44')]=intUtil[_0x21c0('0x43')](_0x24d4a5['serverUrl']);if(_0x266b56&&_0x266b56[_0x21c0('0x68')]){logger[_0x21c0('0xb')]('['+_0x3388e8['lastevent'][_0x21c0('0x69')]()+']','Recording\x20is\x20enabled!');_0x3388e8['recordingURL']=util[_0x21c0('0xd')](_0x21c0('0x48'),_0x24d4a5['serverUrl'],_0x3388e8[_0x21c0('0x49')],md5(_0x3388e8[_0x21c0('0x49')]));}else{_0x3388e8[_0x21c0('0x47')]='';}headers[_0x21c0('0x4a')]=getAuth(_0x24d4a5);return getUser(_0x24d4a5)[_0x21c0('0x16')](function(_0x1374bd){_0x3244a7=_0x1374bd;logger[_0x21c0('0xb')](_0x21c0('0x62'),_0x3244a7['id']);return getEndUser(_0x24d4a5,_0x3388e8[_0x21c0('0x4b')],_0x3388e8['calleridnum']);})['then'](function(_0xf893e7){_0x555f3a=_0xf893e7;logger[_0x21c0('0xb')]('The\x20Enduser\x20ID\x20is:',_0x555f3a['id']);return getTicket(_0x24d4a5,_0x3244a7,_0x555f3a,_0xea4284,_0x3388e8);})['then'](function(_0xc25a8b){if(_0xc25a8b){logger[_0x21c0('0xb')](_0x21c0('0x4d'),_0xc25a8b['id']);}})[_0x21c0('0x5a')](function(_0x4ec74d){logger[_0x21c0('0x58')]('['+_0x3388e8[_0x21c0('0x6a')][_0x21c0('0x69')]()+']'+_0x21c0('0x6b'),util['inspect'](_0x4ec74d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6c43=['Caller\x20-\x20%s','Enduser\x20created.','%s:%s','authType','token','username','Basic\x20%s','toString','base64','stringify','GET','length','string','type','nameField','customField','toLowerCase','content','includes','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','%s/search.json','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','filter','first','Enduser\x20found!','%s/users.json','end-user'];(function(_0x511e9a,_0x550be9){var _0x400147=function(_0x2ad428){while(--_0x2ad428){_0x511e9a['push'](_0x511e9a['shift']());}};_0x400147(++_0x550be9);}(_0x6c43,0x11b));var _0x36c4=function(_0x2b1552,_0x17993f){_0x2b1552=_0x2b1552-0x0;var _0x4cd48e=_0x6c43[_0x2b1552];return _0x4cd48e;};'use strict';var _=require(_0x36c4('0x0'));var rp=require(_0x36c4('0x1'));var md5=require(_0x36c4('0x2'));var util=require(_0x36c4('0x3'));var Redis=require(_0x36c4('0x4'));var intUtil=require(_0x36c4('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x36c4('0x6'));config[_0x36c4('0x7')]=_[_0x36c4('0x8')](config[_0x36c4('0x7')],{'host':_0x36c4('0x9'),'port':0x18eb});var io=require(_0x36c4('0xa'))(new Redis(config[_0x36c4('0x7')]));function emit(_0x261b9b,_0x82057,_0x15a303){io['to'](_0x261b9b)[_0x36c4('0xb')](_0x82057,_0x15a303);}var headers={'Content-Type':_0x36c4('0xc'),'Accept':_0x36c4('0xc')};function getTicket(_0x3dfd38,_0x10d63e,_0x56d09e,_0x57812f,_0x3a0398){logger[_0x36c4('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x36c4('0xe'),_0x3dfd38[_0x36c4('0xf')]),'method':_0x36c4('0x10'),'body':{'ticket':_[_0x36c4('0x11')]({'requester_id':_0x56d09e['id'],'submitter_id':_0x10d63e?_0x10d63e['id']:undefined,'assignee_id':_0x10d63e?_0x10d63e['id']:undefined,'tags':getTags(_0x57812f['Tags'],_0x36c4('0x12')),'subject':intUtil[_0x36c4('0x13')](_0x57812f[_0x36c4('0x14')],_0x3a0398,'\x20'),'description':intUtil[_0x36c4('0x13')](_0x57812f[_0x36c4('0x15')],_0x3a0398,'\x0a'),'comment':{'public':![],'body':intUtil[_0x36c4('0x13')](_0x57812f[_0x36c4('0x15')],_0x3a0398,'\x0a')}},getCustomFields(_0x57812f['Fields'],_0x3a0398))}})[_0x36c4('0x16')](function(_0x46097c){logger[_0x36c4('0xd')](_0x36c4('0x17'));return _0x46097c[_0x36c4('0x18')];});}function getUser(_0x2675bf,_0x5ced52){if(intUtil['validateEmail'](_0x5ced52)){logger[_0x36c4('0xd')](_0x36c4('0x19'),_0x5ced52);return request({'uri':util[_0x36c4('0x1a')](_0x36c4('0x1b'),_0x2675bf[_0x36c4('0xf')]),'qs':{'query':util[_0x36c4('0x1a')]('type:user\x20role:agent\x20email:%s',_0x5ced52)}})[_0x36c4('0x16')](function(_0x317987){if(_0x317987['count']){logger[_0x36c4('0xd')](_0x36c4('0x1c'));return _[_0x36c4('0x1d')](_0x317987[_0x36c4('0x1e')],{'email':_0x5ced52,'role':_0x36c4('0x1f')});}else{logger['info'](_0x36c4('0x20'));return request({'uri':util[_0x36c4('0x1a')]('%s/users/me.json',_0x2675bf[_0x36c4('0xf')])})[_0x36c4('0x16')](function(_0x294f2d){logger[_0x36c4('0xd')](_0x36c4('0x21'));return _0x294f2d[_0x36c4('0x22')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x36c4('0x1a')](_0x36c4('0x23'),_0x2675bf[_0x36c4('0xf')])})[_0x36c4('0x16')](function(_0x45c66f){logger[_0x36c4('0xd')](_0x36c4('0x21'));return _0x45c66f[_0x36c4('0x22')];});}}function getEndUser(_0x15a733,_0x42d439,_0x3a33ac){logger[_0x36c4('0xd')]('Searching\x20enduser\x20with\x20phone',_0x3a33ac);return request({'uri':util['format']('%s/search.json',_0x15a733['remoteUri']),'qs':{'query':util[_0x36c4('0x1a')]('type:user\x20role:end-user\x20phone:%s',_0x3a33ac)}})[_0x36c4('0x16')](function(_0x447800){var _0x1acc79;if(_0x447800[_0x36c4('0x1e')]['length']){_0x447800[_0x36c4('0x1e')]=_[_0x36c4('0x24')](_0x447800[_0x36c4('0x1e')],{'suspended':![],'role':'end-user'});if(_0x447800[_0x36c4('0x1e')]['length']){_0x1acc79=_[_0x36c4('0x25')](_0x447800[_0x36c4('0x1e')]);}}if(_0x1acc79){logger[_0x36c4('0xd')](_0x36c4('0x26'));return _0x1acc79;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x36c4('0x1a')](_0x36c4('0x27'),_0x15a733['remoteUri']),'method':_0x36c4('0x10'),'body':{'user':{'role':_0x36c4('0x28'),'name':util[_0x36c4('0x1a')](_0x36c4('0x29'),_0x42d439||_0x3a33ac),'phone':_0x3a33ac}}})[_0x36c4('0x16')](function(_0x573d2a){logger[_0x36c4('0xd')](_0x36c4('0x2a'));return _0x573d2a['user'];});}});}function getAuth(_0xfd91ed){var _0x13de44;if(_0xfd91ed['authType']==='password'){_0x13de44=util[_0x36c4('0x1a')](_0x36c4('0x2b'),_0xfd91ed['username'],_0xfd91ed['password']);}else if(_0xfd91ed[_0x36c4('0x2c')]===_0x36c4('0x2d')){_0x13de44=util[_0x36c4('0x1a')]('%s/token:%s',_0xfd91ed[_0x36c4('0x2e')],_0xfd91ed[_0x36c4('0x2d')]);}return util[_0x36c4('0x1a')](_0x36c4('0x2f'),new Buffer(_0x13de44)[_0x36c4('0x30')](_0x36c4('0x31')));}function request(_0x3d38e4){logger['debug']('[HTTP]',JSON[_0x36c4('0x32')](_0x3d38e4));return rp(_[_0x36c4('0x8')](_0x3d38e4,{'method':_0x36c4('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x91df0a,_0x31d3b8){var _0x41f806=[];if(_0x91df0a&&_0x91df0a['length']>0x0){_0x41f806=_['map'](_0x91df0a,_0x31d3b8);}return _0x41f806;}function getCustomFields(_0x4312db,_0x50f545){var _0xcb8cc7=[];var _0x4e939c={'custom_fields':[]};if(_0x4312db[_0x36c4('0x34')]>0x0){_['forEach'](_0x4312db,function(_0x8d08bd){if(_['includes']([_0x36c4('0x35'),'picklist'],_0x8d08bd[_0x36c4('0x36')])&&_0x8d08bd[_0x36c4('0x37')]&&!_0x8d08bd[_0x36c4('0x38')]){_0x4e939c[_0x8d08bd['nameField'][_0x36c4('0x39')]()]=_0x8d08bd[_0x36c4('0x3a')][_0x36c4('0x30')]();}else if(_[_0x36c4('0x3b')]([_0x36c4('0x35'),_0x36c4('0x3c')],_0x8d08bd[_0x36c4('0x36')])&&_0x8d08bd[_0x36c4('0x3d')]&&_0x8d08bd[_0x36c4('0x38')]){_0x4e939c[_0x36c4('0x3e')][_0x36c4('0x3f')]({'id':_0x8d08bd[_0x36c4('0x3d')],'value':_0x8d08bd['content'][_0x36c4('0x30')]()});}else if(_0x8d08bd[_0x36c4('0x36')]===_0x36c4('0x40')&&_0x8d08bd[_0x36c4('0x41')]&&_0x8d08bd[_0x36c4('0x3d')]&&_0x8d08bd[_0x36c4('0x38')]){_0x50f545[_0x8d08bd[_0x36c4('0x41')]]&&_0x4e939c[_0x36c4('0x3e')][_0x36c4('0x3f')]({'id':_0x8d08bd['idField'],'value':_0x50f545[_0x8d08bd[_0x36c4('0x41')]]['toString']()});}else if(_0x8d08bd[_0x36c4('0x36')]===_0x36c4('0x42')&&_0x8d08bd[_0x36c4('0x43')]&&_0x8d08bd['Variable'][_0x36c4('0x12')]&&_0x8d08bd[_0x36c4('0x3d')]&&_0x8d08bd[_0x36c4('0x38')]){_0x50f545[_0x8d08bd[_0x36c4('0x43')][_0x36c4('0x12')][_0x36c4('0x39')]()]&&_0x4e939c[_0x36c4('0x3e')]['push']({'id':_0x8d08bd['idField'],'value':_0x50f545[_0x8d08bd[_0x36c4('0x43')]['name'][_0x36c4('0x39')]()]['toString']()});}});}return _0x4e939c;}exports[_0x36c4('0x44')]=function(_0x3227c0,_0x2b61d0,_0x38b009,_0x3d9fef,_0x499fd4,_0x25f07b){var _0x336a09,_0x517ed4;_0x25f07b['remoteUri']=intUtil[_0x36c4('0x45')](_0x25f07b[_0x36c4('0xf')]);_0x25f07b[_0x36c4('0x46')]=intUtil[_0x36c4('0x45')](_0x25f07b['serverUrl']);if(_0x499fd4&&_0x499fd4[_0x36c4('0x47')]){logger[_0x36c4('0xd')](_0x36c4('0x48'),_0x36c4('0x49'));_0x2b61d0['recordingURL']=util[_0x36c4('0x1a')](_0x36c4('0x4a'),_0x25f07b[_0x36c4('0x46')],_0x2b61d0[_0x36c4('0x4b')],md5(_0x2b61d0[_0x36c4('0x4b')]));}else{_0x2b61d0[_0x36c4('0x4c')]='';}headers[_0x36c4('0x4d')]=getAuth(_0x25f07b);return getUser(_0x25f07b,_0x3d9fef[_0x36c4('0x4e')])[_0x36c4('0x16')](function(_0x13361f){_0x336a09=_0x13361f;logger[_0x36c4('0xd')]('The\x20User\x20ID\x20is:',_0x336a09['id']);return getEndUser(_0x25f07b,_0x2b61d0[_0x36c4('0x4f')],_0x2b61d0['calleridnum']);})[_0x36c4('0x16')](function(_0x19fb36){_0x517ed4=_0x19fb36;logger[_0x36c4('0xd')](_0x36c4('0x50'),_0x517ed4['id']);return getTicket(_0x25f07b,_0x336a09,_0x517ed4,_0x38b009,_0x2b61d0);})[_0x36c4('0x16')](function(_0x404dae){if(_0x404dae){logger[_0x36c4('0xd')](_0x36c4('0x51'),_0x404dae['id']);switch(_0x25f07b['type']){case _0x36c4('0x52'):logger[_0x36c4('0xd')]('[QUEUE]',_0x36c4('0x53'));return request({'uri':util['format'](_0x36c4('0x54'),_0x25f07b[_0x36c4('0xf')],_0x336a09['id'],_0x404dae['id']),'method':_0x36c4('0x10')});case _0x36c4('0x55'):logger[_0x36c4('0xd')](_0x36c4('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x36c4('0x1a')](_0x36c4('0x56'),_0x3d9fef[_0x36c4('0x12')]),_0x36c4('0x57'),{'uri':util[_0x36c4('0x1a')](_0x36c4('0x58'),_0x25f07b['remoteUri'][_0x36c4('0x59')](_0x36c4('0x5a'),''),_0x404dae['id'])});break;default:logger[_0x36c4('0x5b')](_0x36c4('0x48'),_0x36c4('0x5c'));}}})['catch'](function(_0x3ab99b){logger[_0x36c4('0x5b')](_0x36c4('0x5d'),util[_0x36c4('0x5e')](_0x3ab99b,{'showHidden':!![],'depth':null}));});};exports[_0x36c4('0x5f')]=function(_0x1b3323,_0x37f0f2,_0x48f882,_0xda19eb,_0x106abc,_0x1d433c,_0x2fbcf3){var _0xbc5dc8,_0x24866a;_0x1d433c[_0x36c4('0xf')]=intUtil[_0x36c4('0x45')](_0x1d433c[_0x36c4('0xf')]);_0x1d433c[_0x36c4('0x46')]=intUtil[_0x36c4('0x45')](_0x1d433c[_0x36c4('0x46')]);if(_0x2fbcf3&&_0x2fbcf3['recordingFormat']&&_0x2fbcf3[_0x36c4('0x60')]!==_0x36c4('0x61')){logger[_0x36c4('0xd')]('[OUTBOUND]',_0x36c4('0x49'));_0x37f0f2[_0x36c4('0x4c')]=util[_0x36c4('0x1a')](_0x36c4('0x4a'),_0x1d433c['serverUrl'],_0x37f0f2[_0x36c4('0x4b')],md5(_0x37f0f2[_0x36c4('0x4b')]));}headers[_0x36c4('0x4d')]=getAuth(_0x1d433c);return getUser(_0x1d433c,_0xda19eb[_0x36c4('0x4e')])['then'](function(_0x245e87){_0xbc5dc8=_0x245e87;logger[_0x36c4('0xd')](_0x36c4('0x62'),_0xbc5dc8['id']);return getEndUser(_0x1d433c,_0x37f0f2['destcalleridname'],_0x37f0f2[_0x36c4('0x63')]);})[_0x36c4('0x16')](function(_0x4c53bd){_0x24866a=_0x4c53bd;logger[_0x36c4('0xd')](_0x36c4('0x50'),_0x24866a['id']);return getTicket(_0x1d433c,_0xbc5dc8,_0x24866a,_0x48f882,_0x37f0f2);})['then'](function(_0x2e7ef2){if(_0x2e7ef2){logger[_0x36c4('0xd')](_0x36c4('0x51'),_0x2e7ef2['id']);switch(_0x1d433c[_0x36c4('0x36')]){case'integrationTab':logger[_0x36c4('0xd')](_0x36c4('0x64'),_0x36c4('0x53'));return request({'uri':util[_0x36c4('0x1a')](_0x36c4('0x54'),_0x1d433c[_0x36c4('0xf')],_0xbc5dc8['id'],_0x2e7ef2['id']),'method':_0x36c4('0x10')});case _0x36c4('0x55'):logger[_0x36c4('0xd')](_0x36c4('0x64'),_0x36c4('0x65'));emit(util[_0x36c4('0x1a')]('user:%s',_0xda19eb[_0x36c4('0x12')]),'trigger:browser:url',{'uri':util['format'](_0x36c4('0x58'),_0x1d433c[_0x36c4('0xf')]['replace'](_0x36c4('0x5a'),''),_0x2e7ef2['id'])});break;default:logger[_0x36c4('0x5b')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x36c4('0x66')](function(_0x12785f){logger[_0x36c4('0x5b')](_0x36c4('0x67'),util['inspect'](_0x12785f,{'showHidden':!![],'depth':null}));});};exports[_0x36c4('0x68')]=function(_0x4fa1e0,_0x2cbde1,_0x3445fa,_0x4060d0,_0x219225,_0x2c2bb1){var _0xa0bf03,_0x97fc59;_0x2c2bb1['remoteUri']=intUtil[_0x36c4('0x45')](_0x2c2bb1['remoteUri']);_0x2c2bb1[_0x36c4('0x46')]=intUtil[_0x36c4('0x45')](_0x2c2bb1['serverUrl']);if(_0x219225&&_0x219225[_0x36c4('0x47')]){logger[_0x36c4('0xd')]('['+_0x2cbde1[_0x36c4('0x69')][_0x36c4('0x6a')]()+']',_0x36c4('0x49'));_0x2cbde1[_0x36c4('0x4c')]=util[_0x36c4('0x1a')](_0x36c4('0x4a'),_0x2c2bb1[_0x36c4('0x46')],_0x2cbde1[_0x36c4('0x4b')],md5(_0x2cbde1['uniqueid']));}else{_0x2cbde1[_0x36c4('0x4c')]='';}headers[_0x36c4('0x4d')]=getAuth(_0x2c2bb1);return getUser(_0x2c2bb1)[_0x36c4('0x16')](function(_0x4bc3f7){_0xa0bf03=_0x4bc3f7;logger['info'](_0x36c4('0x62'),_0xa0bf03['id']);return getEndUser(_0x2c2bb1,_0x2cbde1[_0x36c4('0x4f')],_0x2cbde1['calleridnum']);})[_0x36c4('0x16')](function(_0x39c4cc){_0x97fc59=_0x39c4cc;logger[_0x36c4('0xd')](_0x36c4('0x50'),_0x97fc59['id']);return getTicket(_0x2c2bb1,_0xa0bf03,_0x97fc59,_0x3445fa,_0x2cbde1);})[_0x36c4('0x16')](function(_0x3a3a7a){if(_0x3a3a7a){logger[_0x36c4('0xd')](_0x36c4('0x51'),_0x3a3a7a['id']);}})[_0x36c4('0x66')](function(_0x28c425){logger[_0x36c4('0x5b')]('['+_0x2cbde1[_0x36c4('0x69')][_0x36c4('0x6a')]()+']'+_0x36c4('0x6b'),util[_0x36c4('0x5e')](_0x28c425,{'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 e0acc86..66a950b 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 _0x2b34=['The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','Outbound','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds','catch','error','stack','Search\x20user','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','called','Called','Call_Result','Answered','rejected','Rejected','Abandoned','Timeout','Call_Start_Time','agentcalledAt','Inbound','/crm/v2/Calls','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2b34,0xa7));var _0x42b3=function(_0x390b40,_0x32a62e){_0x390b40=_0x390b40-0x0;var _0x11a416=_0x2b34[_0x390b40];return _0x11a416;};'use strict';var _=require(_0x42b3('0x0'));var rp=require(_0x42b3('0x1'));var md5=require('md5');var util=require(_0x42b3('0x2'));var intUtil=require(_0x42b3('0x3'));var moment=require(_0x42b3('0x4'));var Redis=require('ioredis');var BPromise=require(_0x42b3('0x5'));var config=require(_0x42b3('0x6'));var logger=require(_0x42b3('0x7'))('zoho');config[_0x42b3('0x8')]=_[_0x42b3('0x9')](config[_0x42b3('0x8')],{'host':_0x42b3('0xa'),'port':0x18eb});var io=require(_0x42b3('0xb'))(new Redis(config[_0x42b3('0x8')]));function emit(_0xfd096b,_0x2be9bc,_0x46e9bf){io['to'](_0xfd096b)[_0x42b3('0xc')](_0x2be9bc,_0x46e9bf);}function request(_0x596829){logger[_0x42b3('0xd')](_0x42b3('0xe'),JSON[_0x42b3('0xf')](_0x596829));return rp(_0x596829);}function getCustomFields(_0x58bbcd,_0x1d50ec){var _0x1924f1={};if(_0x58bbcd[_0x42b3('0x10')]>0x0){_[_0x42b3('0x11')](_0x58bbcd,function(_0x4c626f){if(_['includes']([_0x42b3('0x12'),'picklist'],_0x4c626f[_0x42b3('0x13')])&&_0x4c626f[_0x42b3('0x14')]){_0x1924f1[_0x4c626f['idField']]=_0x4c626f[_0x42b3('0x15')][_0x42b3('0x16')]();}else if(_0x4c626f[_0x42b3('0x13')]===_0x42b3('0x17')&&_0x4c626f['variableName']&&_0x4c626f[_0x42b3('0x14')]&&_0x1d50ec[_0x4c626f[_0x42b3('0x18')]]){_0x1924f1[_0x4c626f['idField']]=_0x1d50ec[_0x4c626f[_0x42b3('0x18')]][_0x42b3('0x16')]();}else if(_0x4c626f['type']===_0x42b3('0x19')&&_0x4c626f['Variable']&&_0x4c626f[_0x42b3('0x1a')][_0x42b3('0x1b')]&&_0x4c626f[_0x42b3('0x14')]&&_0x1d50ec[_0x4c626f['Variable']['name'][_0x42b3('0x1c')]()]){_0x1924f1[_0x4c626f[_0x42b3('0x14')]]=_0x1d50ec[_0x4c626f[_0x42b3('0x1a')]['name']['toLowerCase']()][_0x42b3('0x16')]();}});}return _0x1924f1;}function getName(_0x1d2dd0){if(_0x1d2dd0['indexOf']('\x20')>0x0){var _0x3234d1=_0x1d2dd0['split'](/ (.+)/);if(_0x3234d1[0x1]){return _0x3234d1;}}return[_0x1d2dd0,_0x1d2dd0];}var accountsTokens={};function getAccessToken(_0x49c546){return new Promise(function(_0x1b92b4,_0x2e0f01){if(!_[_0x42b3('0x1d')](accountsTokens[_0x49c546['id']])&&!_[_0x42b3('0x1d')](accountsTokens[_0x49c546['id']][_0x42b3('0x1e')])){if(moment()[_0x42b3('0x1f')](accountsTokens[_0x49c546['id']][_0x42b3('0x20')])){_0x1b92b4(accountsTokens[_0x49c546['id']][_0x42b3('0x1e')]);}}var _0x14599f;switch(_0x49c546[_0x42b3('0x21')]){case'US':_0x14599f=_0x42b3('0x22');break;case'AU':_0x14599f=_0x42b3('0x23');break;case'EU':_0x14599f=_0x42b3('0x24');break;case'IN':_0x14599f='https://accounts.zoho.in';break;case'CN':_0x14599f='https://accounts.zoho.com.cn';break;default:_0x14599f='https://accounts.zoho.eu';break;}var _0x452095={'method':_0x42b3('0x25'),'uri':_0x14599f+_0x42b3('0x26'),'qs':{'refresh_token':_0x49c546[_0x42b3('0x27')],'client_id':_0x49c546[_0x42b3('0x28')],'client_secret':_0x49c546[_0x42b3('0x29')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x452095)[_0x42b3('0x2a')](function(_0x38c29e){accountsTokens[_0x49c546['id']]={'access_token':_0x38c29e[_0x42b3('0x1e')],'expires_in':moment()['add'](_0x38c29e[_0x42b3('0x20')],_0x42b3('0x2b'))};_0x1b92b4(_0x38c29e['access_token']);})[_0x42b3('0x2c')](function(_0x4d5e0a){logger[_0x42b3('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x4d5e0a[_0x42b3('0x2e')]);_0x2e0f01(_0x4d5e0a);});});}function getUser(_0x2f1344,_0x4b49d1,_0x25cd12,_0x32ba3b){logger['info'](_0x42b3('0x2f'));return request({'method':'GET','uri':util[_0x42b3('0x30')]('https://www.zohoapis.%s/crm/v2/users',_0x4b49d1),'qs':{'type':_0x42b3('0x31')},'headers':{'Authorization':_0x42b3('0x32')+_0x2f1344},'json':!![]})['then'](function(_0x11e3fe){if(_0x11e3fe[_0x42b3('0x33')]){var _0x413e62=-0x1;if(_['isArrayLikeObject'](_0x11e3fe[_0x42b3('0x33')])){if(!_['isNil'](_0x32ba3b)){_0x413e62=_[_0x42b3('0x34')](_0x11e3fe['users'],function(_0x2f00b1){return _0x2f00b1[_0x42b3('0x35')]===_0x32ba3b;});}if(_0x413e62>=0x0){logger[_0x42b3('0x36')](_0x42b3('0x37'));}else{logger[_0x42b3('0x36')](_0x42b3('0x38'));_0x413e62=_[_0x42b3('0x34')](_0x11e3fe['users'],function(_0x411dd4){return _0x411dd4[_0x42b3('0x39')][_0x42b3('0x1b')]==='Administrator';});}return _0x11e3fe[_0x42b3('0x33')][_0x413e62];}else{if(_0x11e3fe['user'][_0x42b3('0x39')]['name']===_0x42b3('0x3a')){logger[_0x42b3('0x36')](_0x42b3('0x38'));user=_0x11e3fe[_0x42b3('0x3b')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x42b3('0xf')](_0x11e3fe));throw new Error(_0x42b3('0x3c')+JSON['stringify'](_0x11e3fe));}}}else{logger[_0x42b3('0x2d')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x11e3fe));throw new Error(_0x42b3('0x3c')+JSON[_0x42b3('0xf')](_0x11e3fe));}})['catch'](function(_0x2856b4){console['error'](_0x2856b4);});}function getZohoUser(_0x39ee99,_0xef725f){return new BPromise(function(_0x271d55,_0x5e7f9f){request(_0x39ee99)['then'](function(_0x498414){var _0x4c6065=null;if(_0x498414){_0x4c6065=_0x498414[_0x42b3('0x3d')][0x0];_0x4c6065[_0x42b3('0x3e')]=_0xef725f;}_0x271d55(_0x4c6065);})[_0x42b3('0x2c')](function(_0x2517b6){_0x5e7f9f(_0x2517b6);});});}function createEndUser(_0x20bdb7,_0x34d18a,_0x284eb6,_0x3e8661,_0x184584,_0x24cb43){var _0x284eb6=getName(_0x284eb6);return request({'method':'POST','uri':_0x42b3('0x3f')+_0x34d18a+'/crm/v2/'+_[_0x42b3('0x40')](_0x24cb43[_0x42b3('0x41')])+'s','body':{'data':[{'Last_Name':_0x284eb6[0x1],'First_Name':_0x284eb6[0x0],'Phone':_0x3e8661,'Owner':{'name':!_[_0x42b3('0x1d')](_0x184584[_0x42b3('0x42')]['name'])?_0x184584[_0x42b3('0x42')][_0x42b3('0x1b')]:!_[_0x42b3('0x1d')](_0x184584[_0x42b3('0x43')])?_0x184584[_0x42b3('0x43')]+'\x20'+_0x184584[_0x42b3('0x44')]:_0x184584['last_name'],'id':_0x184584['id']}}]},'headers':{'Authorization':_0x42b3('0x32')+_0x20bdb7},'json':!![]})[_0x42b3('0x2a')](function(_0x55bc04){if(_0x55bc04&&_0x55bc04[_0x42b3('0x3d')][0x0][_0x42b3('0x45')]===_0x42b3('0x46')){var _0x28a8ac=_0x55bc04[_0x42b3('0x3d')][0x0]['details'];_0x28a8ac['enduserType']=_['startCase'](_0x24cb43[_0x42b3('0x41')])+'s';return _0x28a8ac;}logger[_0x42b3('0x2d')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x42b3('0x47')+JSON[_0x42b3('0xf')](data));})[_0x42b3('0x2c')](function(_0x52ceaf){console[_0x42b3('0x48')](_0x42b3('0x49'),_0x52ceaf);});}function getEndUser(_0x3f73b3,_0x5c45f3,_0x6eac0d,_0x20dc5a,_0x290ce9,_0x5305d8,_0x5b962c){var _0x207514={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3f73b3},'json':!![]};switch(_0x5b962c[_0x42b3('0x4a')]){case _0x42b3('0x4b'):_0x207514['uri']=_0x42b3('0x3f')+_0x5c45f3+_0x42b3('0x4c')+_0x290ce9+'))';return getZohoUser(_0x207514,_0x42b3('0x4d'))[_0x42b3('0x2a')](function(_0x48945c){if(_0x48945c)return _0x48945c;_0x207514[_0x42b3('0x4e')]=_0x42b3('0x3f')+_0x5c45f3+_0x42b3('0x4f')+_0x290ce9+'))';return getZohoUser(_0x207514,'Leads')['then'](function(_0x387e04){if(_0x387e04)return _0x387e04;if(_0x5b962c[_0x42b3('0x41')]!=_0x42b3('0x50')){return createEndUser(_0x3f73b3,_0x5c45f3,_0x20dc5a,_0x290ce9,_0x5305d8,_0x5b962c);}else{return{};}});});break;case _0x42b3('0x51'):_0x207514['uri']=_0x42b3('0x3f')+_0x5c45f3+_0x42b3('0x4c')+_0x290ce9+'))';return getZohoUser(_0x207514,'Contacts')[_0x42b3('0x2a')](function(_0x20a9b6){if(_0x20a9b6)return _0x20a9b6;if(_0x5b962c[_0x42b3('0x41')]!=_0x42b3('0x50')){return createEndUser(_0x3f73b3,_0x5c45f3,_0x20dc5a,_0x290ce9,_0x5305d8,_0x5b962c);}else{return{};}});break;case _0x42b3('0x52'):_0x207514[_0x42b3('0x4e')]=_0x42b3('0x3f')+_0x5c45f3+_0x42b3('0x4f')+_0x290ce9+'))';return getZohoUser(_0x207514,_0x42b3('0x53'))[_0x42b3('0x2a')](function(_0x33246b){if(_0x33246b)return _0x33246b;if(_0x5b962c[_0x42b3('0x41')]!='nothing'){return createEndUser(_0x3f73b3,_0x5c45f3,_0x20dc5a,_0x290ce9,_0x5305d8,_0x5b962c);}else{return{};}});break;}}function getCall(_0x30e46b,_0x23707f,_0x58564c,_0x2d56fe,_0x162dc1,_0x4b3d42,_0x39cf79,_0x294952){logger[_0x42b3('0x36')](_0x42b3('0x54'));var _0x35f3ed={};_0x35f3ed[_0x42b3('0x55')]={'name':!_['isNil'](_0x2d56fe[_0x42b3('0x42')][_0x42b3('0x1b')])&&!_[_0x42b3('0x1d')](_0x2d56fe[_0x42b3('0x39')][_0x42b3('0x1b')])&&_0x2d56fe[_0x42b3('0x39')][_0x42b3('0x1b')]===_0x42b3('0x56')?_0x2d56fe['role'][_0x42b3('0x1b')]:!_[_0x42b3('0x1d')](_0x2d56fe['first_name'])?_0x2d56fe[_0x42b3('0x43')]+'\x20'+_0x2d56fe[_0x42b3('0x44')]:_0x2d56fe['last_name'],'id':_0x2d56fe['id']};_0x35f3ed[_0x42b3('0x57')]=intUtil[_0x42b3('0x58')](_0x4b3d42[_0x42b3('0x59')],_0x39cf79,'\x20');_0x35f3ed['Description']=intUtil[_0x42b3('0x58')](_0x4b3d42[_0x42b3('0x5a')],_0x39cf79,'\x0a');if(_0x162dc1['enduserType']===_0x42b3('0x4d')){_0x35f3ed[_0x42b3('0x5b')]={'name':!_[_0x42b3('0x1d')](_0x162dc1[_0x42b3('0x5c')])?_0x162dc1['Full_Name']:!_[_0x42b3('0x1d')](_0x162dc1[_0x42b3('0x5d')])?_0x162dc1[_0x42b3('0x5d')]+'\x20'+_0x162dc1['Last_Name']:_0x162dc1['Last_Name'],'id':_0x162dc1['id']};}if(_0x162dc1[_0x42b3('0x3e')]==='Leads'){_0x35f3ed[_0x42b3('0x5e')]={'name':!_[_0x42b3('0x1d')](_0x162dc1[_0x42b3('0x5c')])?_0x162dc1[_0x42b3('0x5c')]:!_[_0x42b3('0x1d')](_0x162dc1[_0x42b3('0x5d')])?_0x162dc1[_0x42b3('0x5d')]+'\x20'+_0x162dc1[_0x42b3('0x5f')]:_0x162dc1[_0x42b3('0x5f')],'id':_0x162dc1['id']};_0x35f3ed[_0x42b3('0x60')]=_[_0x42b3('0x40')](_0x162dc1['enduserType']);}if(_0x39cf79[_0x42b3('0x61')]){_0x35f3ed[_0x42b3('0x62')]=moment['utc'](parseInt(_0x39cf79['talktime'])*0x3e8)['format']('mm:ss');}else if(_0x39cf79['answertime']&&_0x39cf79[_0x42b3('0x63')]){_0x35f3ed[_0x42b3('0x62')]=moment['utc'](moment(_0x39cf79[_0x42b3('0x63')],_0x42b3('0x64'))['diff'](moment(_0x39cf79[_0x42b3('0x65')],_0x42b3('0x64'))))['format'](_0x42b3('0x66'));}switch(_0x39cf79['lastevent']){case _0x42b3('0x67'):_0x35f3ed['Call_Result']=_0x42b3('0x68');break;case'complete':case'connect':_0x35f3ed[_0x42b3('0x69')]=_0x42b3('0x6a');break;case _0x42b3('0x6b'):_0x35f3ed[_0x42b3('0x69')]=_0x42b3('0x6c');break;case'abandoned':_0x35f3ed[_0x42b3('0x69')]=_0x42b3('0x6d');break;case'timeout':_0x35f3ed[_0x42b3('0x69')]=_0x42b3('0x6e');default:}_0x35f3ed[_0x42b3('0x6f')]=(_0x294952==='outbound'?moment(_0x39cf79[_0x42b3('0x65')])[_0x42b3('0x30')](_0x42b3('0x64')):moment(_0x39cf79[_0x42b3('0x70')])[_0x42b3('0x30')](_0x42b3('0x64')))||moment()[_0x42b3('0x30')](_0x42b3('0x64'));_0x35f3ed['Call_Type']=_0x294952||_0x42b3('0x71');_0x35f3ed=_['merge'](_0x35f3ed,getCustomFields(_0x4b3d42['Fields'],_0x39cf79));return request({'method':_0x42b3('0x25'),'uri':_0x42b3('0x3f')+_0x23707f+_0x42b3('0x72'),'headers':{'Authorization':_0x42b3('0x32')+_0x30e46b},'body':{'data':[_0x35f3ed]},'json':!![]})['then'](function(_0x5d580c){if(_0x5d580c&&_0x5d580c[_0x42b3('0x3d')][0x0][_0x42b3('0x45')]===_0x42b3('0x46')){logger[_0x42b3('0x36')]('Call\x20created!');return{'id':_0x5d580c[_0x42b3('0x3d')][0x0][_0x42b3('0x73')]['id']};}})[_0x42b3('0x2c')](function(_0x483f90){logger['info'](_0x42b3('0x74'),_0x483f90[_0x42b3('0x2e')]);console[_0x42b3('0x48')](_0x42b3('0x74'),_0x483f90);});}exports[_0x42b3('0x75')]=function(_0x3e05f5,_0x392ef1,_0xa8515c,_0x27565e,_0x55a5f2,_0x559ad4){var _0x22315a,_0x44cc89,_0x3d1e8b;_0x559ad4[_0x42b3('0x76')]=intUtil[_0x42b3('0x77')](_0x559ad4[_0x42b3('0x76')]);_0x559ad4['serverUrl']=intUtil['stripTrailingSlash'](_0x559ad4[_0x42b3('0x78')]);if(_0x55a5f2&&_0x55a5f2[_0x42b3('0x79')]){logger[_0x42b3('0x36')](_0x42b3('0x7a'),'Recording\x20is\x20enabled!');_0x392ef1[_0x42b3('0x7b')]=_0x559ad4['serverUrl']+_0x42b3('0x7c')+_0x392ef1[_0x42b3('0x7d')]+_0x42b3('0x7e')+md5(_0x392ef1[_0x42b3('0x7d')]);}else{_0x392ef1['recordingURL']='';}var _0x55980f=_0x559ad4[_0x42b3('0x76')]===_0x42b3('0x7f')?'eu':_0x42b3('0x80');return getAccessToken(_0x559ad4)[_0x42b3('0x2a')](function(_0x542e65){_0x3d1e8b=_0x542e65;return getUser(_0x3d1e8b,_0x55980f,_0x559ad4,_0x27565e['email']);})[_0x42b3('0x2a')](function(_0x1dcc96){_0x22315a=_0x1dcc96;logger[_0x42b3('0x36')](_0x42b3('0x81'),_0x22315a['id']);return getEndUser(_0x3d1e8b,_0x55980f,_0x559ad4,_0x392ef1[_0x42b3('0x82')],_0x392ef1['calleridnum'],_0x22315a,_0xa8515c);})['then'](function(_0x59bae0){_0x44cc89=_0x59bae0;return getCall(_0x3d1e8b,_0x55980f,_0x559ad4,_0x22315a,_0x44cc89,_0xa8515c,_0x392ef1,_0x42b3('0x71'));})[_0x42b3('0x2a')](function(_0x12b64b){if(_0x12b64b){logger['info'](_0x42b3('0x83'),_0x12b64b['id']);logger['info'](_0x42b3('0x7a'),_0x42b3('0x84'));emit(util[_0x42b3('0x30')]('user:%s',_0x27565e[_0x42b3('0x1b')]),_0x42b3('0x85'),{'uri':_0x42b3('0x86')+_0x559ad4['host']+_0x42b3('0x87')+_0x12b64b['id']});}})['catch'](function(_0x472fc9){logger['error'](_0x42b3('0x7a'),JSON['stringify'](_0x472fc9));});};exports[_0x42b3('0x88')]=function(_0xe3ea72,_0x4c83c1,_0x2da31e,_0x33769a,_0x380a94,_0x52fb77,_0x5ee8da){var _0xab4857,_0x239ef7,_0x4a7d25;_0x52fb77[_0x42b3('0x76')]=intUtil[_0x42b3('0x77')](_0x52fb77[_0x42b3('0x76')]);_0x52fb77['serverUrl']=intUtil[_0x42b3('0x77')](_0x52fb77[_0x42b3('0x78')]);if(_0x5ee8da&&_0x5ee8da[_0x42b3('0x89')]&&_0x5ee8da['recordingFormat']!==_0x42b3('0x8a')){logger['info']('[OUTBOUND]',_0x42b3('0x8b'));_0x4c83c1[_0x42b3('0x7b')]=_0x52fb77[_0x42b3('0x78')]+_0x42b3('0x7c')+_0x4c83c1[_0x42b3('0x7d')]+_0x42b3('0x7e')+md5(_0x4c83c1[_0x42b3('0x7d')]);}var _0x5cbe8a=_0x52fb77[_0x42b3('0x76')]===_0x42b3('0x7f')?'eu':_0x42b3('0x80');return getAccessToken(_0x52fb77)[_0x42b3('0x2a')](function(_0x5df6a9){_0x4a7d25=_0x5df6a9;return getUser(_0x4a7d25,_0x5cbe8a,_0x52fb77,_0x33769a[_0x42b3('0x35')]);})[_0x42b3('0x2a')](function(_0x5aed60){_0xab4857=_0x5aed60;logger['info']('The\x20User\x20ID\x20is:',_0xab4857['id']);return getEndUser(_0x4a7d25,_0x5cbe8a,_0x52fb77,_0x4c83c1[_0x42b3('0x8c')],_0x4c83c1['destcalleridnum'],_0xab4857,_0x2da31e);})[_0x42b3('0x2a')](function(_0x48c234){_0x239ef7=_0x48c234;return getCall(_0x4a7d25,_0x5cbe8a,_0x52fb77,_0xab4857,_0x239ef7,_0x2da31e,_0x4c83c1,_0x42b3('0x8d'));})[_0x42b3('0x2a')](function(_0x2361be){if(_0x2361be){logger[_0x42b3('0x36')]('The\x20Call\x20ID\x20is:',_0x2361be['id']);logger[_0x42b3('0x36')](_0x42b3('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x42b3('0x30')](_0x42b3('0x8f'),_0x33769a[_0x42b3('0x1b')]),_0x42b3('0x85'),{'uri':_0x42b3('0x86')+_0x52fb77['host']+_0x42b3('0x87')+_0x2361be['id']});}})[_0x42b3('0x2c')](function(_0x124ffb){logger[_0x42b3('0x2d')](_0x42b3('0x8e'),JSON[_0x42b3('0xf')](_0x124ffb));});};exports[_0x42b3('0x90')]=function(_0x39c455,_0x520b2c,_0x205121,_0x458f1b,_0xf21fd4,_0x9c9e81){var _0x3c099a,_0x5627e0,_0xa8275b;_0x9c9e81['host']=intUtil['stripTrailingSlash'](_0x9c9e81['host']);_0x9c9e81[_0x42b3('0x78')]=intUtil[_0x42b3('0x77')](_0x9c9e81[_0x42b3('0x78')]);if(_0xf21fd4&&_0xf21fd4[_0x42b3('0x79')]){logger[_0x42b3('0x36')]('['+_0x520b2c[_0x42b3('0x91')][_0x42b3('0x92')]()+']','Recording\x20is\x20enabled!');_0x520b2c[_0x42b3('0x7b')]=_0x9c9e81[_0x42b3('0x78')]+_0x42b3('0x7c')+_0x520b2c[_0x42b3('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x520b2c['uniqueid']);}else{_0x520b2c[_0x42b3('0x7b')]='';}var _0x1067b5=_0x9c9e81[_0x42b3('0x76')]===_0x42b3('0x7f')?'eu':'com';return getAccessToken(_0x9c9e81)['then'](function(_0x3051d7){_0xa8275b=_0x3051d7;return getUser(_0xa8275b,_0x1067b5,_0x9c9e81);})[_0x42b3('0x2a')](function(_0x475687){_0x3c099a=_0x475687;logger[_0x42b3('0x36')](_0x42b3('0x81'),_0x3c099a['id']);return getEndUser(_0xa8275b,_0x1067b5,_0x9c9e81,_0x520b2c[_0x42b3('0x82')],_0x520b2c[_0x42b3('0x93')],_0x3c099a,_0x205121);})[_0x42b3('0x2a')](function(_0x53c0d6){_0x5627e0=_0x53c0d6;return getCall(_0xa8275b,_0x1067b5,_0x9c9e81,_0x3c099a,_0x5627e0,_0x205121,_0x520b2c,'Inbound');})[_0x42b3('0x2a')](function(_0xdf8f25){if(_0xdf8f25){logger[_0x42b3('0x36')](_0x42b3('0x83'),_0xdf8f25['id']);}})[_0x42b3('0x2c')](function(_0x7a0de1){logger[_0x42b3('0x2d')]('['+_0x520b2c['lastevent'][_0x42b3('0x92')]()+']',JSON[_0x42b3('0xf')](_0x7a0de1));});}; \ No newline at end of file +var _0x1eb7=['../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','includes','picklist','type','content','toString','variable','variableName','idField','customVariable','name','Variable','toLowerCase','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Leads','Owner','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','talktime','mm:ss','answertime','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','complete','Call_Result','Answered','Rejected','abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','host','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','recordingURL','uniqueid','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird'];(function(_0x2f7c44,_0x22434d){var _0xa27ff9=function(_0x3ad37f){while(--_0x3ad37f){_0x2f7c44['push'](_0x2f7c44['shift']());}};_0xa27ff9(++_0x22434d);}(_0x1eb7,0x135));var _0x71eb=function(_0x801b9a,_0x177360){_0x801b9a=_0x801b9a-0x0;var _0x44dbd8=_0x1eb7[_0x801b9a];return _0x44dbd8;};'use strict';var _=require(_0x71eb('0x0'));var rp=require(_0x71eb('0x1'));var md5=require(_0x71eb('0x2'));var util=require('util');var intUtil=require(_0x71eb('0x3'));var moment=require(_0x71eb('0x4'));var Redis=require(_0x71eb('0x5'));var BPromise=require(_0x71eb('0x6'));var config=require('../../../../config/environment');var logger=require(_0x71eb('0x7'))(_0x71eb('0x8'));config[_0x71eb('0x9')]=_[_0x71eb('0xa')](config[_0x71eb('0x9')],{'host':_0x71eb('0xb'),'port':0x18eb});var io=require(_0x71eb('0xc'))(new Redis(config[_0x71eb('0x9')]));function emit(_0x1cb98d,_0x3e39bf,_0x1cf98f){io['to'](_0x1cb98d)[_0x71eb('0xd')](_0x3e39bf,_0x1cf98f);}function request(_0x45fcfe){logger[_0x71eb('0xe')]('[HTTP]',JSON[_0x71eb('0xf')](_0x45fcfe));return rp(_0x45fcfe);}function getCustomFields(_0xfc4e25,_0x19f9a6){var _0x450f86={};if(_0xfc4e25[_0x71eb('0x10')]>0x0){_['forEach'](_0xfc4e25,function(_0x1d074f){if(_[_0x71eb('0x11')](['string',_0x71eb('0x12')],_0x1d074f[_0x71eb('0x13')])&&_0x1d074f['idField']){_0x450f86[_0x1d074f['idField']]=_0x1d074f[_0x71eb('0x14')][_0x71eb('0x15')]();}else if(_0x1d074f[_0x71eb('0x13')]===_0x71eb('0x16')&&_0x1d074f[_0x71eb('0x17')]&&_0x1d074f[_0x71eb('0x18')]&&_0x19f9a6[_0x1d074f[_0x71eb('0x17')]]){_0x450f86[_0x1d074f['idField']]=_0x19f9a6[_0x1d074f['variableName']]['toString']();}else if(_0x1d074f[_0x71eb('0x13')]===_0x71eb('0x19')&&_0x1d074f['Variable']&&_0x1d074f['Variable'][_0x71eb('0x1a')]&&_0x1d074f[_0x71eb('0x18')]&&_0x19f9a6[_0x1d074f[_0x71eb('0x1b')][_0x71eb('0x1a')]['toLowerCase']()]){_0x450f86[_0x1d074f[_0x71eb('0x18')]]=_0x19f9a6[_0x1d074f[_0x71eb('0x1b')][_0x71eb('0x1a')][_0x71eb('0x1c')]()][_0x71eb('0x15')]();}});}return _0x450f86;}function getName(_0x5817a0){if(_0x5817a0['indexOf']('\x20')>0x0){var _0x12c46e=_0x5817a0[_0x71eb('0x1d')](/ (.+)/);if(_0x12c46e[0x1]){return _0x12c46e;}}return[_0x5817a0,_0x5817a0];}var accountsTokens={};function getAccessToken(_0x5ab7a5){return new Promise(function(_0x5744c5,_0x524637){if(!_[_0x71eb('0x1e')](accountsTokens[_0x5ab7a5['id']])&&!_[_0x71eb('0x1e')](accountsTokens[_0x5ab7a5['id']][_0x71eb('0x1f')])){if(moment()['isBefore'](accountsTokens[_0x5ab7a5['id']][_0x71eb('0x20')])){_0x5744c5(accountsTokens[_0x5ab7a5['id']][_0x71eb('0x1f')]);}}var _0x5347fb;switch(_0x5ab7a5[_0x71eb('0x21')]){case'US':_0x5347fb=_0x71eb('0x22');break;case'AU':_0x5347fb=_0x71eb('0x23');break;case'EU':_0x5347fb=_0x71eb('0x24');break;case'IN':_0x5347fb='https://accounts.zoho.in';break;case'CN':_0x5347fb=_0x71eb('0x25');break;default:_0x5347fb=_0x71eb('0x24');break;}var _0x51e785={'method':_0x71eb('0x26'),'uri':_0x5347fb+_0x71eb('0x27'),'qs':{'refresh_token':_0x5ab7a5[_0x71eb('0x28')],'client_id':_0x5ab7a5[_0x71eb('0x29')],'client_secret':_0x5ab7a5[_0x71eb('0x2a')],'grant_type':_0x71eb('0x2b')},'json':!![]};return rp(_0x51e785)[_0x71eb('0x2c')](function(_0x4e7640){accountsTokens[_0x5ab7a5['id']]={'access_token':_0x4e7640[_0x71eb('0x1f')],'expires_in':moment()[_0x71eb('0x2d')](_0x4e7640[_0x71eb('0x20')],_0x71eb('0x2e'))};_0x5744c5(_0x4e7640[_0x71eb('0x1f')]);})[_0x71eb('0x2f')](function(_0x4dbc9c){logger[_0x71eb('0x30')](_0x71eb('0x31'),_0x4dbc9c[_0x71eb('0x32')]);_0x524637(_0x4dbc9c);});});}function getUser(_0x5a5530,_0x150e63,_0x482713,_0x5f100b){logger[_0x71eb('0x33')](_0x71eb('0x34'));return request({'method':_0x71eb('0x35'),'uri':util[_0x71eb('0x36')](_0x71eb('0x37'),_0x150e63),'qs':{'type':_0x71eb('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5a5530},'json':!![]})['then'](function(_0x375abd){if(_0x375abd[_0x71eb('0x39')]){var _0x1c4534=-0x1;if(_[_0x71eb('0x3a')](_0x375abd[_0x71eb('0x39')])){if(!_[_0x71eb('0x1e')](_0x5f100b)){_0x1c4534=_['findIndex'](_0x375abd[_0x71eb('0x39')],function(_0x14f966){return _0x14f966[_0x71eb('0x3b')]===_0x5f100b;});}if(_0x1c4534>=0x0){logger[_0x71eb('0x33')](_0x71eb('0x3c'));}else{logger[_0x71eb('0x33')](_0x71eb('0x3d'));_0x1c4534=_[_0x71eb('0x3e')](_0x375abd['users'],function(_0x1a235a){return _0x1a235a[_0x71eb('0x3f')][_0x71eb('0x1a')]===_0x71eb('0x40');});}return _0x375abd[_0x71eb('0x39')][_0x1c4534];}else{if(_0x375abd['user'][_0x71eb('0x3f')][_0x71eb('0x1a')]===_0x71eb('0x40')){logger[_0x71eb('0x33')]('Using\x20the\x20admin\x20account!');user=_0x375abd[_0x71eb('0x41')];return user;}else{logger[_0x71eb('0x30')]('The\x20failing\x20result\x20is',JSON[_0x71eb('0xf')](_0x375abd));throw new Error(_0x71eb('0x42')+JSON[_0x71eb('0xf')](_0x375abd));}}}else{logger[_0x71eb('0x30')]('The\x20failing\x20result\x20is',JSON[_0x71eb('0xf')](_0x375abd));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x375abd));}})['catch'](function(_0x13e33a){console[_0x71eb('0x30')](_0x13e33a);});}function getZohoUser(_0x105c2f,_0x517c05){return new BPromise(function(_0x15ac26,_0x55a8c9){request(_0x105c2f)[_0x71eb('0x2c')](function(_0x313f6b){var _0x500628=null;if(_0x313f6b){_0x500628=_0x313f6b['data'][0x0];_0x500628[_0x71eb('0x43')]=_0x517c05;}_0x15ac26(_0x500628);})['catch'](function(_0x241294){_0x55a8c9(_0x241294);});});}function createEndUser(_0x4e82db,_0x182206,_0x35026b,_0x80ddc7,_0x4802d9,_0x2d86b5){var _0x35026b=getName(_0x35026b);return request({'method':_0x71eb('0x26'),'uri':_0x71eb('0x44')+_0x182206+_0x71eb('0x45')+_[_0x71eb('0x46')](_0x2d86b5[_0x71eb('0x47')])+'s','body':{'data':[{'Last_Name':_0x35026b[0x1],'First_Name':_0x35026b[0x0],'Phone':_0x80ddc7,'Owner':{'name':!_[_0x71eb('0x1e')](_0x4802d9[_0x71eb('0x48')]['name'])?_0x4802d9[_0x71eb('0x48')][_0x71eb('0x1a')]:!_[_0x71eb('0x1e')](_0x4802d9[_0x71eb('0x49')])?_0x4802d9[_0x71eb('0x49')]+'\x20'+_0x4802d9[_0x71eb('0x4a')]:_0x4802d9[_0x71eb('0x4a')],'id':_0x4802d9['id']}}]},'headers':{'Authorization':_0x71eb('0x4b')+_0x4e82db},'json':!![]})['then'](function(_0x25b5c9){if(_0x25b5c9&&_0x25b5c9[_0x71eb('0x4c')][0x0][_0x71eb('0x4d')]===_0x71eb('0x4e')){var _0x1d61c2=_0x25b5c9[_0x71eb('0x4c')][0x0][_0x71eb('0x4f')];_0x1d61c2[_0x71eb('0x43')]=_[_0x71eb('0x46')](_0x2d86b5[_0x71eb('0x47')])+'s';return _0x1d61c2;}logger[_0x71eb('0x30')](_0x71eb('0x50'),JSON[_0x71eb('0xf')](data));throw new Error(_0x71eb('0x51')+JSON[_0x71eb('0xf')](data));})['catch'](function(_0x12f1e7){console[_0x71eb('0x52')]('CREATE\x20ERROR',_0x12f1e7);});}function getEndUser(_0x18cb72,_0x3e902e,_0x57c58c,_0x371dfa,_0x5baded,_0x118219,_0x1fa01c){var _0x4aa9ef={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x18cb72},'json':!![]};switch(_0x1fa01c[_0x71eb('0x53')]){case _0x71eb('0x54'):_0x4aa9ef[_0x71eb('0x55')]=_0x71eb('0x44')+_0x3e902e+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5baded+'))';return getZohoUser(_0x4aa9ef,_0x71eb('0x56'))[_0x71eb('0x2c')](function(_0x3251ad){if(_0x3251ad)return _0x3251ad;_0x4aa9ef[_0x71eb('0x55')]='https://www.zohoapis.'+_0x3e902e+_0x71eb('0x57')+_0x5baded+'))';return getZohoUser(_0x4aa9ef,'Leads')[_0x71eb('0x2c')](function(_0x566a32){if(_0x566a32)return _0x566a32;if(_0x1fa01c['moduleCreate']!=_0x71eb('0x58')){return createEndUser(_0x18cb72,_0x3e902e,_0x371dfa,_0x5baded,_0x118219,_0x1fa01c);}else{return{};}});});break;case _0x71eb('0x59'):_0x4aa9ef['uri']=_0x71eb('0x44')+_0x3e902e+_0x71eb('0x5a')+_0x5baded+'))';return getZohoUser(_0x4aa9ef,_0x71eb('0x56'))[_0x71eb('0x2c')](function(_0x5f4364){if(_0x5f4364)return _0x5f4364;if(_0x1fa01c['moduleCreate']!=_0x71eb('0x58')){return createEndUser(_0x18cb72,_0x3e902e,_0x371dfa,_0x5baded,_0x118219,_0x1fa01c);}else{return{};}});break;case _0x71eb('0x5b'):_0x4aa9ef[_0x71eb('0x55')]=_0x71eb('0x44')+_0x3e902e+_0x71eb('0x57')+_0x5baded+'))';return getZohoUser(_0x4aa9ef,_0x71eb('0x5c'))[_0x71eb('0x2c')](function(_0x20f6ff){if(_0x20f6ff)return _0x20f6ff;if(_0x1fa01c['moduleCreate']!=_0x71eb('0x58')){return createEndUser(_0x18cb72,_0x3e902e,_0x371dfa,_0x5baded,_0x118219,_0x1fa01c);}else{return{};}});break;}}function getCall(_0x19e84b,_0x33163d,_0x13c73e,_0x5ca052,_0x3aaa73,_0xf2da78,_0x291dd4,_0x36e013){logger['info']('Creating\x20new\x20call...');var _0x4e185b={};_0x4e185b[_0x71eb('0x5d')]={'name':!_['isNil'](_0x5ca052[_0x71eb('0x48')][_0x71eb('0x1a')])&&!_[_0x71eb('0x1e')](_0x5ca052[_0x71eb('0x3f')][_0x71eb('0x1a')])&&_0x5ca052[_0x71eb('0x3f')][_0x71eb('0x1a')]===_0x71eb('0x5e')?_0x5ca052[_0x71eb('0x48')][_0x71eb('0x1a')]:!_[_0x71eb('0x1e')](_0x5ca052['first_name'])?_0x5ca052[_0x71eb('0x49')]+'\x20'+_0x5ca052[_0x71eb('0x4a')]:_0x5ca052['last_name'],'id':_0x5ca052['id']};_0x4e185b[_0x71eb('0x5f')]=intUtil[_0x71eb('0x60')](_0xf2da78[_0x71eb('0x61')],_0x291dd4,'\x20');_0x4e185b[_0x71eb('0x62')]=intUtil[_0x71eb('0x60')](_0xf2da78['Descriptions'],_0x291dd4,'\x0a');if(_0x3aaa73[_0x71eb('0x43')]===_0x71eb('0x56')){_0x4e185b[_0x71eb('0x63')]={'name':!_[_0x71eb('0x1e')](_0x3aaa73[_0x71eb('0x64')])?_0x3aaa73[_0x71eb('0x64')]:!_['isNil'](_0x3aaa73[_0x71eb('0x65')])?_0x3aaa73[_0x71eb('0x65')]+'\x20'+_0x3aaa73[_0x71eb('0x66')]:_0x3aaa73['Last_Name'],'id':_0x3aaa73['id']};}if(_0x3aaa73[_0x71eb('0x43')]===_0x71eb('0x5c')){_0x4e185b[_0x71eb('0x67')]={'name':!_[_0x71eb('0x1e')](_0x3aaa73['Full_Name'])?_0x3aaa73[_0x71eb('0x64')]:!_[_0x71eb('0x1e')](_0x3aaa73[_0x71eb('0x65')])?_0x3aaa73[_0x71eb('0x65')]+'\x20'+_0x3aaa73[_0x71eb('0x66')]:_0x3aaa73[_0x71eb('0x66')],'id':_0x3aaa73['id']};_0x4e185b[_0x71eb('0x68')]=_[_0x71eb('0x46')](_0x3aaa73['enduserType']);}if(_0x291dd4['talktime']){_0x4e185b['Call_Duration']=moment[_0x71eb('0x69')](parseInt(_0x291dd4[_0x71eb('0x6a')])*0x3e8)['format'](_0x71eb('0x6b'));}else if(_0x291dd4[_0x71eb('0x6c')]&&_0x291dd4['endtime']){_0x4e185b[_0x71eb('0x6d')]=moment[_0x71eb('0x69')](moment(_0x291dd4[_0x71eb('0x6e')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x291dd4['starttime'],_0x71eb('0x6f'))))[_0x71eb('0x36')]('mm:ss');}switch(_0x291dd4[_0x71eb('0x70')]){case _0x71eb('0x71'):_0x4e185b['Call_Result']='Called';break;case _0x71eb('0x72'):case'connect':_0x4e185b[_0x71eb('0x73')]=_0x71eb('0x74');break;case'rejected':_0x4e185b[_0x71eb('0x73')]=_0x71eb('0x75');break;case _0x71eb('0x76'):_0x4e185b['Call_Result']='Abandoned';break;case _0x71eb('0x77'):_0x4e185b[_0x71eb('0x73')]=_0x71eb('0x78');default:}_0x4e185b['Call_Start_Time']=(_0x36e013===_0x71eb('0x79')?moment(_0x291dd4[_0x71eb('0x7a')])[_0x71eb('0x36')](_0x71eb('0x6f')):moment(_0x291dd4[_0x71eb('0x7b')])['format'](_0x71eb('0x6f')))||moment()['format'](_0x71eb('0x6f'));_0x4e185b[_0x71eb('0x7c')]=_0x36e013||_0x71eb('0x7d');_0x4e185b=_['merge'](_0x4e185b,getCustomFields(_0xf2da78[_0x71eb('0x7e')],_0x291dd4));return request({'method':_0x71eb('0x26'),'uri':_0x71eb('0x44')+_0x33163d+_0x71eb('0x7f'),'headers':{'Authorization':_0x71eb('0x4b')+_0x19e84b},'body':{'data':[_0x4e185b]},'json':!![]})['then'](function(_0x152375){if(_0x152375&&_0x152375[_0x71eb('0x4c')][0x0][_0x71eb('0x4d')]===_0x71eb('0x4e')){logger['info'](_0x71eb('0x80'));return{'id':_0x152375[_0x71eb('0x4c')][0x0][_0x71eb('0x4f')]['id']};}})['catch'](function(_0x4d2b61){logger[_0x71eb('0x33')](_0x71eb('0x81'),_0x4d2b61[_0x71eb('0x32')]);console[_0x71eb('0x52')](_0x71eb('0x81'),_0x4d2b61);});}exports['queue']=function(_0x4454c0,_0x4f50d1,_0x3b698d,_0x5675cf,_0x120447,_0x567c25){var _0xaa34f7,_0x4e7c40,_0xeac78;_0x567c25['host']=intUtil[_0x71eb('0x82')](_0x567c25['host']);_0x567c25[_0x71eb('0x83')]=intUtil[_0x71eb('0x82')](_0x567c25[_0x71eb('0x83')]);if(_0x120447&&_0x120447[_0x71eb('0x84')]){logger[_0x71eb('0x33')](_0x71eb('0x85'),_0x71eb('0x86'));_0x4f50d1['recordingURL']=_0x567c25[_0x71eb('0x83')]+_0x71eb('0x87')+_0x4f50d1['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4f50d1['uniqueid']);}else{_0x4f50d1['recordingURL']='';}var _0x19f336=_0x567c25[_0x71eb('0x88')]===_0x71eb('0x89')?'eu':_0x71eb('0x8a');return getAccessToken(_0x567c25)[_0x71eb('0x2c')](function(_0x4fbdbe){_0xeac78=_0x4fbdbe;return getUser(_0xeac78,_0x19f336,_0x567c25,_0x5675cf[_0x71eb('0x3b')]);})[_0x71eb('0x2c')](function(_0x4ee3c3){_0xaa34f7=_0x4ee3c3;logger[_0x71eb('0x33')](_0x71eb('0x8b'),_0xaa34f7['id']);return getEndUser(_0xeac78,_0x19f336,_0x567c25,_0x4f50d1[_0x71eb('0x8c')],_0x4f50d1[_0x71eb('0x8d')],_0xaa34f7,_0x3b698d);})['then'](function(_0x1964ad){_0x4e7c40=_0x1964ad;return getCall(_0xeac78,_0x19f336,_0x567c25,_0xaa34f7,_0x4e7c40,_0x3b698d,_0x4f50d1,_0x71eb('0x7d'));})['then'](function(_0x975c2d){if(_0x975c2d){logger[_0x71eb('0x33')](_0x71eb('0x8e'),_0x975c2d['id']);logger[_0x71eb('0x33')]('[QUEUE]',_0x71eb('0x8f'));emit(util[_0x71eb('0x36')]('user:%s',_0x5675cf[_0x71eb('0x1a')]),_0x71eb('0x90'),{'uri':_0x71eb('0x91')+_0x567c25['host']+_0x71eb('0x92')+_0x975c2d['id']});}})['catch'](function(_0x463b39){logger[_0x71eb('0x30')]('[QUEUE]',JSON[_0x71eb('0xf')](_0x463b39));});};exports[_0x71eb('0x79')]=function(_0x338f16,_0x548704,_0x3e1e02,_0x346c1b,_0x3db1ee,_0x46b968,_0x2463b2){var _0x558493,_0x2e77e1,_0x5c5b4c;_0x46b968[_0x71eb('0x88')]=intUtil['stripTrailingSlash'](_0x46b968[_0x71eb('0x88')]);_0x46b968[_0x71eb('0x83')]=intUtil[_0x71eb('0x82')](_0x46b968[_0x71eb('0x83')]);if(_0x2463b2&&_0x2463b2[_0x71eb('0x93')]&&_0x2463b2[_0x71eb('0x93')]!=='none'){logger[_0x71eb('0x33')](_0x71eb('0x94'),_0x71eb('0x86'));_0x548704[_0x71eb('0x95')]=_0x46b968['serverUrl']+_0x71eb('0x87')+_0x548704[_0x71eb('0x96')]+_0x71eb('0x97')+md5(_0x548704[_0x71eb('0x96')]);}var _0x1e234b=_0x46b968[_0x71eb('0x88')]===_0x71eb('0x89')?'eu':_0x71eb('0x8a');return getAccessToken(_0x46b968)[_0x71eb('0x2c')](function(_0x323c60){_0x5c5b4c=_0x323c60;return getUser(_0x5c5b4c,_0x1e234b,_0x46b968,_0x346c1b['email']);})[_0x71eb('0x2c')](function(_0x1e00b9){_0x558493=_0x1e00b9;logger[_0x71eb('0x33')](_0x71eb('0x8b'),_0x558493['id']);return getEndUser(_0x5c5b4c,_0x1e234b,_0x46b968,_0x548704[_0x71eb('0x98')],_0x548704[_0x71eb('0x99')],_0x558493,_0x3e1e02);})['then'](function(_0x1c2b61){_0x2e77e1=_0x1c2b61;return getCall(_0x5c5b4c,_0x1e234b,_0x46b968,_0x558493,_0x2e77e1,_0x3e1e02,_0x548704,_0x71eb('0x9a'));})['then'](function(_0x12306d){if(_0x12306d){logger[_0x71eb('0x33')](_0x71eb('0x8e'),_0x12306d['id']);logger[_0x71eb('0x33')](_0x71eb('0x94'),_0x71eb('0x8f'));emit(util[_0x71eb('0x36')](_0x71eb('0x9b'),_0x346c1b['name']),_0x71eb('0x90'),{'uri':_0x71eb('0x91')+_0x46b968['host']+_0x71eb('0x92')+_0x12306d['id']});}})['catch'](function(_0x1412b0){logger[_0x71eb('0x30')](_0x71eb('0x94'),JSON[_0x71eb('0xf')](_0x1412b0));});};exports[_0x71eb('0x9c')]=function(_0x1f68d5,_0x22a9cf,_0x3eb9db,_0xced74f,_0x36fbb1,_0x1c1a1c){var _0x558735,_0x10ecd8,_0x3479ff;_0x1c1a1c[_0x71eb('0x88')]=intUtil['stripTrailingSlash'](_0x1c1a1c[_0x71eb('0x88')]);_0x1c1a1c[_0x71eb('0x83')]=intUtil[_0x71eb('0x82')](_0x1c1a1c[_0x71eb('0x83')]);if(_0x36fbb1&&_0x36fbb1[_0x71eb('0x84')]){logger[_0x71eb('0x33')]('['+_0x22a9cf['lastevent']['toUpperCase']()+']',_0x71eb('0x86'));_0x22a9cf[_0x71eb('0x95')]=_0x1c1a1c[_0x71eb('0x83')]+_0x71eb('0x87')+_0x22a9cf[_0x71eb('0x96')]+_0x71eb('0x97')+md5(_0x22a9cf['uniqueid']);}else{_0x22a9cf['recordingURL']='';}var _0x24d06a=_0x1c1a1c[_0x71eb('0x88')]===_0x71eb('0x89')?'eu':'com';return getAccessToken(_0x1c1a1c)[_0x71eb('0x2c')](function(_0x2add0a){_0x3479ff=_0x2add0a;return getUser(_0x3479ff,_0x24d06a,_0x1c1a1c);})[_0x71eb('0x2c')](function(_0x1c7136){_0x558735=_0x1c7136;logger[_0x71eb('0x33')]('The\x20User\x20ID\x20is:',_0x558735['id']);return getEndUser(_0x3479ff,_0x24d06a,_0x1c1a1c,_0x22a9cf[_0x71eb('0x8c')],_0x22a9cf[_0x71eb('0x8d')],_0x558735,_0x3eb9db);})[_0x71eb('0x2c')](function(_0x7817a6){_0x10ecd8=_0x7817a6;return getCall(_0x3479ff,_0x24d06a,_0x1c1a1c,_0x558735,_0x10ecd8,_0x3eb9db,_0x22a9cf,_0x71eb('0x7d'));})[_0x71eb('0x2c')](function(_0x3dcade){if(_0x3dcade){logger[_0x71eb('0x33')](_0x71eb('0x8e'),_0x3dcade['id']);}})[_0x71eb('0x2f')](function(_0xd3dabd){logger[_0x71eb('0x30')]('['+_0x22a9cf[_0x71eb('0x70')][_0x71eb('0x9d')]()+']',JSON['stringify'](_0xd3dabd));});}; \ 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 52b052c..5e2de79 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 _0xefd6=['exec','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','data2','data3'];(function(_0x310da1,_0x390f65){var _0x333d17=function(_0x27d0f8){while(--_0x27d0f8){_0x310da1['push'](_0x310da1['shift']());}};_0x333d17(++_0x390f65);}(_0xefd6,0x19c));var _0x6efd=function(_0x33cd58,_0x360a48){_0x33cd58=_0x33cd58-0x0;var _0x30fc60=_0xefd6[_0x33cd58];return _0x30fc60;};'use strict';var util=require(_0x6efd('0x0'));var sh=require(_0x6efd('0x1'));var Mustache=require(_0x6efd('0x2'));var logger=require('../../../../config/logger')(_0x6efd('0x3'));exports['exec']=function(_0x4f06e0,_0x237429){var _0x279dac=_0x4f06e0['data2']?_0x4f06e0[_0x6efd('0x4')]:'Script';var _0x45e0f3=_0x4f06e0[_0x6efd('0x5')]?Mustache['render'](_0x4f06e0['data3'],_0x237429):_0x237429;sh[_0x6efd('0x6')](_0x45e0f3,function(_0x4a6890,_0x299124,_0x537ddd){if(_0x4a6890!==0x0){logger['error'](util[_0x6efd('0x7')](_0x6efd('0x8'),_0x279dac,_0x45e0f3,_0x4a6890,_0x537ddd));}else{logger[_0x6efd('0x9')](util[_0x6efd('0x7')](_0x6efd('0xa'),_0x279dac,_0x45e0f3,_0x299124));}});}; \ No newline at end of file +var _0xda79=['trigger','exec','data2','Script','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache'];(function(_0x4cc16b,_0x5e7e85){var _0x258e49=function(_0x43a434){while(--_0x43a434){_0x4cc16b['push'](_0x4cc16b['shift']());}};_0x258e49(++_0x5e7e85);}(_0xda79,0x6c));var _0x9da7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xda79[_0x2b4411];return _0x8e41ef;};'use strict';var util=require('util');var sh=require(_0x9da7('0x0'));var Mustache=require(_0x9da7('0x1'));var logger=require('../../../../config/logger')(_0x9da7('0x2'));exports[_0x9da7('0x3')]=function(_0x18b61a,_0x29ae00){var _0x1c4525=_0x18b61a['data2']?_0x18b61a[_0x9da7('0x4')]:_0x9da7('0x5');var _0x8871d5=_0x18b61a['data3']?Mustache[_0x9da7('0x6')](_0x18b61a['data3'],_0x29ae00):_0x29ae00;sh['exec'](_0x8871d5,function(_0x3eda89,_0xbdab99,_0x121160){if(_0x3eda89!==0x0){logger['error'](util[_0x9da7('0x7')](_0x9da7('0x8'),_0x1c4525,_0x8871d5,_0x3eda89,_0x121160));}else{logger[_0x9da7('0x9')](util['format'](_0x9da7('0xa'),_0x1c4525,_0x8871d5,_0xbdab99));}});}; \ 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 e70a174..274a217 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 _0x8859=['isNil','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','GET','POST','PUT','data7','body','stack','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then'];(function(_0x1fad7e,_0x49d6fb){var _0xd0931=function(_0x11afe9){while(--_0x11afe9){_0x1fad7e['push'](_0x1fad7e['shift']());}};_0xd0931(++_0x49d6fb);}(_0x8859,0x15d));var _0x9885=function(_0x1fde2e,_0x277af1){_0x1fde2e=_0x1fde2e-0x0;var _0x186298=_0x8859[_0x1fde2e];return _0x186298;};'use strict';var rp=require(_0x9885('0x0'));var util=require(_0x9885('0x1'));var _=require('lodash');var Mustache=require(_0x9885('0x2'));var logger=require(_0x9885('0x3'))('trigger');exports[_0x9885('0x4')]=function(_0x4cd745,_0xbb816f){var _0x57d28b,_0x45441d;var _0x1f5a57={'method':_0x4cd745[_0x9885('0x5')][_0x9885('0x6')](),'uri':Mustache[_0x9885('0x7')](_0x4cd745[_0x9885('0x8')],_0xbb816f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4cd745['data5'])===_0x9885('0x9')&&parseInt(_0x4cd745['data5'])>=0x1&&parseInt(_0x4cd745[_0x9885('0xa')])<=0xa?parseInt(_0x4cd745[_0x9885('0xa')])*0x3e8:0x5*0x3e8};try{_0x1f5a57[_0x9885('0xb')]=_0x4cd745[_0x9885('0xc')]?JSON[_0x9885('0xd')](Mustache['render'](_0x4cd745[_0x9885('0xc')],_0xbb816f)):{};}catch(_0x147a0f){logger[_0x9885('0xe')](_0x147a0f['stack']);}switch(_0x4cd745[_0x9885('0x5')]['toUpperCase']()){case _0x9885('0xf'):case'DELETE':_0x57d28b=null;_0x1f5a57['qs']=_0xbb816f;break;case _0x9885('0x10'):case _0x9885('0x11'):if(_0x4cd745['data7']){try{_0x57d28b=JSON[_0x9885('0xd')](Mustache[_0x9885('0x7')](_0x4cd745[_0x9885('0x12')],_0xbb816f));_0x1f5a57[_0x9885('0x13')]=_0x57d28b;}catch(_0x5492b7){logger[_0x9885('0xe')](_0x5492b7[_0x9885('0x14')]);logger[_0x9885('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x57d28b=_0xbb816f;_0x1f5a57[_0x9885('0x13')]=_0x57d28b;}break;}logger[_0x9885('0x15')](util[_0x9885('0x16')](_0x9885('0x17'),_0x4cd745['data1'],_0x4cd745[_0x9885('0x8')],JSON['stringify'](_0x1f5a57)));rp(_0x1f5a57)[_0x9885('0x18')](function(_0xcecd0f){_0x57d28b=!_[_0x9885('0x19')](_0x57d28b)?',\x20request\x20body:\x20'+_0x57d28b:'';_0x45441d=typeof _0xcecd0f[_0x9885('0x13')]===_0x9885('0x1a')?JSON[_0x9885('0x1b')](_0xcecd0f[_0x9885('0x13')]):_0xcecd0f['body'];logger[_0x9885('0x15')](util[_0x9885('0x16')](_0x9885('0x1c'),_0x4cd745[_0x9885('0x5')],_0x4cd745['data2'],_0xcecd0f[_0x9885('0x1d')],_0x45441d));})[_0x9885('0x1e')](function(_0x1b84ef){logger[_0x9885('0xe')](util['format'](_0x9885('0x1f'),_0x4cd745[_0x9885('0x5')],_0x4cd745['data2'],_0x1b84ef[_0x9885('0x1d')],_0x1b84ef[_0x9885('0x20')],_0x1b84ef[_0x9885('0x21')]));});}; \ No newline at end of file +var _0x5d5b=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','isNil',',\x20request\x20body:\x20','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','message','util','lodash','../../../../config/logger','trigger','exec','render','data5','number','headers','data6','parse','error','stack','data1','toUpperCase','GET','DELETE','POST','data7'];(function(_0x446eb5,_0x4fdbc4){var _0xc1611=function(_0x50e3db){while(--_0x50e3db){_0x446eb5['push'](_0x446eb5['shift']());}};_0xc1611(++_0x4fdbc4);}(_0x5d5b,0xb3));var _0xb5d5=function(_0x9694ab,_0x501c53){_0x9694ab=_0x9694ab-0x0;var _0x228129=_0x5d5b[_0x9694ab];return _0x228129;};'use strict';var rp=require('request-promise');var util=require(_0xb5d5('0x0'));var _=require(_0xb5d5('0x1'));var Mustache=require('mustache');var logger=require(_0xb5d5('0x2'))(_0xb5d5('0x3'));exports[_0xb5d5('0x4')]=function(_0x59ae35,_0x32b362){var _0x7b268d,_0x1d37eb;var _0x2ee9ab={'method':_0x59ae35['data1']['toUpperCase'](),'uri':Mustache[_0xb5d5('0x5')](_0x59ae35['data2'],_0x32b362),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x59ae35[_0xb5d5('0x6')])===_0xb5d5('0x7')&&parseInt(_0x59ae35[_0xb5d5('0x6')])>=0x1&&parseInt(_0x59ae35[_0xb5d5('0x6')])<=0xa?parseInt(_0x59ae35['data5'])*0x3e8:0x5*0x3e8};try{_0x2ee9ab[_0xb5d5('0x8')]=_0x59ae35[_0xb5d5('0x9')]?JSON[_0xb5d5('0xa')](Mustache['render'](_0x59ae35[_0xb5d5('0x9')],_0x32b362)):{};}catch(_0x17a862){logger[_0xb5d5('0xb')](_0x17a862[_0xb5d5('0xc')]);}switch(_0x59ae35[_0xb5d5('0xd')][_0xb5d5('0xe')]()){case _0xb5d5('0xf'):case _0xb5d5('0x10'):_0x7b268d=null;_0x2ee9ab['qs']=_0x32b362;break;case _0xb5d5('0x11'):case'PUT':if(_0x59ae35[_0xb5d5('0x12')]){try{_0x7b268d=JSON[_0xb5d5('0xa')](Mustache[_0xb5d5('0x5')](_0x59ae35['data7'],_0x32b362));_0x2ee9ab['body']=_0x7b268d;}catch(_0x18fbcd){logger[_0xb5d5('0xb')](_0x18fbcd[_0xb5d5('0xc')]);logger[_0xb5d5('0xb')](_0xb5d5('0x13'));}}else{_0x7b268d=_0x32b362;_0x2ee9ab[_0xb5d5('0x14')]=_0x7b268d;}break;}logger[_0xb5d5('0x15')](util[_0xb5d5('0x16')](_0xb5d5('0x17'),_0x59ae35['data1'],_0x59ae35[_0xb5d5('0x18')],JSON[_0xb5d5('0x19')](_0x2ee9ab)));rp(_0x2ee9ab)['then'](function(_0x2249e1){_0x7b268d=!_[_0xb5d5('0x1a')](_0x7b268d)?_0xb5d5('0x1b')+_0x7b268d:'';_0x1d37eb=typeof _0x2249e1[_0xb5d5('0x14')]===_0xb5d5('0x1c')?JSON[_0xb5d5('0x19')](_0x2249e1['body']):_0x2249e1['body'];logger[_0xb5d5('0x15')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x59ae35[_0xb5d5('0xd')],_0x59ae35[_0xb5d5('0x18')],_0x2249e1['statusCode'],_0x1d37eb));})[_0xb5d5('0x1d')](function(_0x33437c){logger['error'](util[_0xb5d5('0x16')](_0xb5d5('0x1e'),_0x59ae35[_0xb5d5('0xd')],_0x59ae35[_0xb5d5('0x18')],_0x33437c[_0xb5d5('0x1f')],_0x33437c['name'],_0x33437c[_0xb5d5('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index db6835e..c643f64 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 _0x9b4f=['rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug'];(function(_0x2d3134,_0x477c10){var _0x2dd03e=function(_0x434841){while(--_0x434841){_0x2d3134['push'](_0x2d3134['shift']());}};_0x2dd03e(++_0x477c10);}(_0x9b4f,0x14f));var _0xf9b4=function(_0x1d2eff,_0x45286f){_0x1d2eff=_0x1d2eff-0x0;var _0x25e995=_0x9b4f[_0x1d2eff];return _0x25e995;};'use strict';var jayson=require(_0xf9b4('0x0'));var BPromise=require(_0xf9b4('0x1'));var logger=require(_0xf9b4('0x2'))(_0xf9b4('0x3'));var client=jayson[_0xf9b4('0x4')][_0xf9b4('0x5')]({'port':0x2329});client[_0xf9b4('0x6')]=function(_0x441063,_0x4b2af0){return new BPromise(function(_0x5b3f59,_0x36accd){return client[_0xf9b4('0x7')](_0x441063,_0x4b2af0)[_0xf9b4('0x8')](function(_0x49d3be){logger[_0xf9b4('0x9')](_0xf9b4('0xa'),_0xf9b4('0x3'),_0x441063,_0x4b2af0,_0x49d3be);if(_0x49d3be[_0xf9b4('0xb')]){logger['error'](_0xf9b4('0xa'),_0xf9b4('0x3'),_0x441063,_0x49d3be['error'][_0xf9b4('0xc')],_0x4b2af0);return _0x36accd(_0x49d3be[_0xf9b4('0xb')][_0xf9b4('0xc')]);}else{return _0x5b3f59(_0x49d3be[_0xf9b4('0xd')]);}})[_0xf9b4('0xe')](function(_0xd77a2a){logger[_0xf9b4('0xb')](_0xf9b4('0xa'),_0xf9b4('0x3'),_0x441063,_0xd77a2a,_0x4b2af0);return _0x36accd(_0xd77a2a);});});};module['exports']=client; \ No newline at end of file +var _0xf7be=['http','Request','request','then','debug','rpc','routing','error','message','result','exports','jayson/promise','../../config/logger'];(function(_0x149e76,_0x47fcd7){var _0x198f43=function(_0x34672f){while(--_0x34672f){_0x149e76['push'](_0x149e76['shift']());}};_0x198f43(++_0x47fcd7);}(_0xf7be,0x1ab));var _0xef7b=function(_0x5649ca,_0x1e121f){_0x5649ca=_0x5649ca-0x0;var _0x55ce30=_0xf7be[_0x5649ca];return _0x55ce30;};'use strict';var jayson=require(_0xef7b('0x0'));var BPromise=require('bluebird');var logger=require(_0xef7b('0x1'))('routing');var client=jayson['client'][_0xef7b('0x2')]({'port':0x2329});client[_0xef7b('0x3')]=function(_0x18f127,_0x404bdb){return new BPromise(function(_0x2d5d59,_0xc14c25){return client[_0xef7b('0x4')](_0x18f127,_0x404bdb)[_0xef7b('0x5')](function(_0x5448dd){logger[_0xef7b('0x6')](_0xef7b('0x7'),_0xef7b('0x8'),_0x18f127,_0x404bdb,_0x5448dd);if(_0x5448dd['error']){logger[_0xef7b('0x9')](_0xef7b('0x7'),_0xef7b('0x8'),_0x18f127,_0x5448dd[_0xef7b('0x9')][_0xef7b('0xa')],_0x404bdb);return _0xc14c25(_0x5448dd[_0xef7b('0x9')][_0xef7b('0xa')]);}else{return _0x2d5d59(_0x5448dd[_0xef7b('0xb')]);}})['catch'](function(_0x46d552){logger['error'](_0xef7b('0x7'),'routing',_0x18f127,_0x46d552,_0x404bdb);return _0xc14c25(_0x46d552);});});};module[_0xef7b('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f971f41..3880dbe 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 _0xcebd=['./rpc/mailAccount','./rpc/setting','resolve','then','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./lib/email'];(function(_0x50f96c,_0x1f81c3){var _0x576fa3=function(_0x25de7d){while(--_0x25de7d){_0x50f96c['push'](_0x50f96c['shift']());}};_0x576fa3(++_0x1f81c3);}(_0xcebd,0xae));var _0xdceb=function(_0x29a493,_0x2eea68){_0x29a493=_0x29a493-0x0;var _0x14a148=_0xcebd[_0x29a493];return _0x14a148;};'use strict';var BPromise=require(_0xdceb('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xdceb('0x1'));var mailAccount=require(_0xdceb('0x2'));var setting=require(_0xdceb('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xdceb('0x4')]()[_0xdceb('0x5')](mailAccount['getMailAccounts']())[_0xdceb('0x5')](realtime['initMailAccounts']())[_0xdceb('0x5')](function(){email['refresh'](realtime[_0xdceb('0x6')]);return realtime;});}function main(){return server[_0xdceb('0x7')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xdceb('0x8')]();})['then'](function(_0x37dce8){return setInterval(initRealtime,_0x37dce8[_0xdceb('0x9')]*0x3e8);})[_0xdceb('0xa')](function(_0x2e768d){console['log'](_0x2e768d);});}main(); \ No newline at end of file +var _0xf480=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','getSettings','./server'];(function(_0x5cb4f0,_0xb16665){var _0x22208=function(_0xa6ac92){while(--_0xa6ac92){_0x5cb4f0['push'](_0x5cb4f0['shift']());}};_0x22208(++_0xb16665);}(_0xf480,0xe6));var _0x0f48=function(_0x19f0cf,_0x11f630){_0x19f0cf=_0x19f0cf-0x0;var _0x374792=_0xf480[_0x19f0cf];return _0x374792;};'use strict';var BPromise=require('bluebird');var server=require(_0x0f48('0x0'));var Realtime=require(_0x0f48('0x1'));var EmailChannel=require(_0x0f48('0x2'));var mailAccount=require(_0x0f48('0x3'));var setting=require(_0x0f48('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x0f48('0x5')]())[_0x0f48('0x6')](realtime[_0x0f48('0x7')]())[_0x0f48('0x6')](function(){email[_0x0f48('0x8')](realtime[_0x0f48('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x0f48('0x6')](function(){return initRealtime();})[_0x0f48('0x6')](function(){return setting[_0x0f48('0xa')]();})['then'](function(_0x78f9f1){return setInterval(initRealtime,_0x78f9f1['loginMailFrequency']*0x3e8);})['catch'](function(_0x4e3c3c){console['log'](_0x4e3c3c);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 22849e9..221d001 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 _0x25a1=['handleImapError','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','status','messageStatus','Imap','total','isNil','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','error','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync'];(function(_0x5b68c9,_0x1ebacc){var _0x14e83e=function(_0x5909bf){while(--_0x5909bf){_0x5b68c9['push'](_0x5b68c9['shift']());}};_0x14e83e(++_0x1ebacc);}(_0x25a1,0x1d1));var _0x125a=function(_0x2c5330,_0x48a874){_0x2c5330=_0x2c5330-0x0;var _0x431cf3=_0x25a1[_0x2c5330];return _0x431cf3;};'use strict';var _=require(_0x125a('0x0'));var moment=require(_0x125a('0x1'));var BPromise=require(_0x125a('0x2'));var md5=require('md5');var Redis=require(_0x125a('0x3'));var config=require(_0x125a('0x4'));var logger=require('../../../config/logger')(_0x125a('0x5'));config[_0x125a('0x6')]=_[_0x125a('0x7')](config[_0x125a('0x6')],{'host':_0x125a('0x8'),'port':0x18eb});var io=require(_0x125a('0x9'))(new Redis(config[_0x125a('0x6')]));var EmailImap=require(_0x125a('0xa'));var EmailSmtp=require(_0x125a('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4dbf53){logger['info'](_0x125a('0xc'));this[_0x125a('0xd')]=_0x4dbf53[_0x125a('0xd')];this[_0x125a('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x125a('0xf')][_0x125a('0x10')]=function(_0x3a7707){var _0x30674e=this['mailAccounts'][_0x3a7707];var _0x519c2a={'id':_0x30674e['id'],'name':_0x30674e[_0x125a('0x11')],'key':_0x30674e[_0x125a('0x12')],'active':_0x30674e[_0x125a('0x13')],'Imap':{'status':_0x30674e['Imap'][_0x125a('0x14')],'messageStatus':_0x30674e['Imap'][_0x125a('0x15')],'total':_0x30674e[_0x125a('0x16')][_0x125a('0x17')]}};if(_[_0x125a('0x18')](md5Accounts[_0x3a7707])){md5Accounts[_0x3a7707]={};}var _0x19f2db=md5(JSON['stringify'](_0x519c2a));if(md5Accounts[_0x3a7707]['md5']!==_0x19f2db){md5Accounts[_0x3a7707]['md5']=_0x19f2db;io['emit'](_0x125a('0x19'),_0x519c2a);}};EmailChannel[_0x125a('0xf')][_0x125a('0x1a')]=function(_0xf0fa0e){for(var _0x5eade4 in _0xf0fa0e){if(_0xf0fa0e[_0x125a('0x1b')](_0x5eade4)){if(_0xf0fa0e[_0x5eade4][_0x125a('0x16')]&&_0xf0fa0e[_0x5eade4][_0x125a('0x13')]){var _0xda7681=_0xf0fa0e[_0x5eade4]['Imap'];if(!this[_0x125a('0xe')]['hasOwnProperty'](_0xda7681['id'])){this[_0x125a('0xe')][_0xda7681['id']]=new EmailImap(_0xda7681,_0xf0fa0e[_0x5eade4]['email']);this[_0x125a('0xe')][_0xda7681['id']]['on'](_0x125a('0x1c'),this[_0x125a('0x1d')][_0x125a('0x1e')](this,_0x5eade4));this[_0x125a('0xe')][_0xda7681['id']]['on'](_0x125a('0x5'),this[_0x125a('0x1f')]['bind'](this,_0x5eade4));this[_0x125a('0xe')][_0xda7681['id']]['on'](_0x125a('0x20'),this['handleImapEnd'][_0x125a('0x1e')](this,_0x5eade4));this[_0x125a('0xe')][_0xda7681['id']]['on'](_0x125a('0x21'),this['handleImapError'][_0x125a('0x1e')](this,_0x5eade4));}}else{if(_['isNil'](this[_0x125a('0xd')][_0x5eade4][_0x125a('0x16')])){this[_0x125a('0xd')][_0x5eade4][_0x125a('0x16')]={};}this['mailAccounts'][_0x5eade4]['Imap'][_0x125a('0x14')]='disabled';this[_0x125a('0xd')][_0x5eade4][_0x125a('0x16')][_0x125a('0x15')]='';this[_0x125a('0x10')](_0x5eade4);}}}};EmailChannel[_0x125a('0xf')][_0x125a('0x1d')]=function(_0x369eb9,_0x41b6a7){if(this['mailAccounts'][_0x369eb9]){this[_0x125a('0xd')][_0x369eb9][_0x125a('0x16')][_0x125a('0x14')]='connected';this[_0x125a('0xd')][_0x369eb9][_0x125a('0x16')][_0x125a('0x15')]=_0x41b6a7[_0x125a('0x11')];if(_0x41b6a7[_0x125a('0x22')]){this['mailAccounts'][_0x369eb9]['Imap'][_0x125a('0x17')]=_0x41b6a7['messages']['total'];}return this[_0x125a('0x10')](_0x369eb9);}};EmailChannel[_0x125a('0xf')][_0x125a('0x1f')]=function(_0x1c5330,_0x12b727){logger[_0x125a('0x23')](_0x125a('0x24'),_0x12b727[_0x125a('0x25')],_0x12b727[_0x125a('0x26')],_0x12b727[_0x125a('0x27')],_0x1c5330);if(this[_0x125a('0xd')][_0x1c5330]){return mailAccount[_0x125a('0x28')](_0x1c5330,_0x12b727)[_0x125a('0x29')](function(_0x4f2da5){if(_0x4f2da5){logger[_0x125a('0x23')](_0x125a('0x2a'));}})[_0x125a('0x2b')](function(_0x255f68){logger[_0x125a('0x21')](_0x125a('0x2c'),JSON[_0x125a('0x2d')](_0x255f68));});}};EmailChannel[_0x125a('0xf')][_0x125a('0x2e')]=function(_0x13ad87){if(this[_0x125a('0xd')][_0x13ad87]&&this[_0x125a('0xd')][_0x13ad87][_0x125a('0x16')]){if(this['imapAccounts'][this[_0x125a('0xd')][_0x13ad87][_0x125a('0x16')]['id']]){delete this[_0x125a('0xe')][this['mailAccounts'][_0x13ad87][_0x125a('0x16')]['id']];}this['mailAccounts'][_0x13ad87]['Imap'][_0x125a('0x2f')]=moment();this[_0x125a('0x10')](_0x13ad87);}};EmailChannel['prototype'][_0x125a('0x30')]=function(_0x28545c,_0x57c9d7){if(this[_0x125a('0xd')][_0x28545c]){this[_0x125a('0xd')][_0x28545c][_0x125a('0x16')][_0x125a('0x14')]='error';this['mailAccounts'][_0x28545c][_0x125a('0x16')]['messageStatus']=_0x57c9d7;return this[_0x125a('0x10')](_0x28545c);}};EmailChannel[_0x125a('0xf')][_0x125a('0x31')]=function(_0x520957,_0x877312){return this[_0x125a('0x32')][_0x125a('0x33')](_0x520957,_0x877312);};EmailChannel[_0x125a('0xf')][_0x125a('0x34')]=function(_0x657422){var _0x3a2f4b=this;if(this[_0x125a('0xd')][_0x657422['id']]){if(_['isNil'](this[_0x125a('0xd')][_0x657422['id']]['Smtp'])){this[_0x125a('0xd')][_0x657422['id']][_0x125a('0x35')]={};}this[_0x125a('0xd')][_0x657422['id']][_0x125a('0x35')][_0x125a('0x2f')]=moment();return new BPromise(function(_0xcd4920,_0x161207){return _0x3a2f4b['smtp'][_0x125a('0x36')](_0x657422)[_0x125a('0x29')](function(_0x1af753){_0x3a2f4b[_0x125a('0xd')][_0x657422['id']]['Smtp'][_0x125a('0x14')]=_0x125a('0x37');_0x3a2f4b[_0x125a('0xd')][_0x657422['id']][_0x125a('0x35')][_0x125a('0x15')]='';_0x3a2f4b[_0x125a('0x10')](_0x657422['id']);_0xcd4920(_0x1af753);})[_0x125a('0x2b')](function(_0x246015){_0x3a2f4b['mailAccounts'][_0x657422['id']]['Smtp'][_0x125a('0x14')]=_0x125a('0x21');_0x3a2f4b[_0x125a('0xd')][_0x657422['id']][_0x125a('0x35')]['messageStatus']=_0x246015;_0x3a2f4b[_0x125a('0x10')](_0x657422['id']);_0x161207(_0x246015);});});}return this[_0x125a('0x32')][_0x125a('0x36')](_0x657422);};module[_0x125a('0x38')]=EmailChannel; \ No newline at end of file +var _0x114c=['handleImapError','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','stringify','mailAccount:update','hasOwnProperty','handleImapBox','bind','handleImapEmail','error'];(function(_0x185c44,_0x2265cf){var _0x4a499f=function(_0x25252b){while(--_0x25252b){_0x185c44['push'](_0x185c44['shift']());}};_0x4a499f(++_0x2265cf);}(_0x114c,0x7e));var _0xc114=function(_0x16d36e,_0x386056){_0x16d36e=_0x16d36e-0x0;var _0x3ccb2e=_0x114c[_0x16d36e];return _0x3ccb2e;};'use strict';var _=require(_0xc114('0x0'));var moment=require(_0xc114('0x1'));var BPromise=require(_0xc114('0x2'));var md5=require(_0xc114('0x3'));var Redis=require(_0xc114('0x4'));var config=require(_0xc114('0x5'));var logger=require(_0xc114('0x6'))(_0xc114('0x7'));config[_0xc114('0x8')]=_[_0xc114('0x9')](config[_0xc114('0x8')],{'host':_0xc114('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc114('0x8')]));var EmailImap=require(_0xc114('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xc114('0xc'));var md5Accounts={};function EmailChannel(_0x126de0){logger[_0xc114('0xd')]('start\x20email\x20channel');this[_0xc114('0xe')]=_0x126de0[_0xc114('0xe')];this[_0xc114('0xf')]={};this[_0xc114('0x10')]=new EmailSmtp();}EmailChannel[_0xc114('0x11')][_0xc114('0x12')]=function(_0x2bb1dc){var _0x5dfd1a=this[_0xc114('0xe')][_0x2bb1dc];var _0x2ed894={'id':_0x5dfd1a['id'],'name':_0x5dfd1a[_0xc114('0x13')],'key':_0x5dfd1a[_0xc114('0x14')],'active':_0x5dfd1a[_0xc114('0x15')],'Imap':{'status':_0x5dfd1a[_0xc114('0x16')][_0xc114('0x17')],'messageStatus':_0x5dfd1a['Imap']['messageStatus'],'total':_0x5dfd1a[_0xc114('0x16')][_0xc114('0x18')]}};if(_[_0xc114('0x19')](md5Accounts[_0x2bb1dc])){md5Accounts[_0x2bb1dc]={};}var _0x47cbd7=md5(JSON[_0xc114('0x1a')](_0x2ed894));if(md5Accounts[_0x2bb1dc][_0xc114('0x3')]!==_0x47cbd7){md5Accounts[_0x2bb1dc][_0xc114('0x3')]=_0x47cbd7;io[_0xc114('0x12')](_0xc114('0x1b'),_0x2ed894);}};EmailChannel[_0xc114('0x11')]['refresh']=function(_0x1e0234){for(var _0x3e6a42 in _0x1e0234){if(_0x1e0234[_0xc114('0x1c')](_0x3e6a42)){if(_0x1e0234[_0x3e6a42][_0xc114('0x16')]&&_0x1e0234[_0x3e6a42][_0xc114('0x15')]){var _0x116ed1=_0x1e0234[_0x3e6a42][_0xc114('0x16')];if(!this[_0xc114('0xf')][_0xc114('0x1c')](_0x116ed1['id'])){this[_0xc114('0xf')][_0x116ed1['id']]=new EmailImap(_0x116ed1,_0x1e0234[_0x3e6a42][_0xc114('0x7')]);this[_0xc114('0xf')][_0x116ed1['id']]['on']('box',this[_0xc114('0x1d')][_0xc114('0x1e')](this,_0x3e6a42));this[_0xc114('0xf')][_0x116ed1['id']]['on']('email',this[_0xc114('0x1f')][_0xc114('0x1e')](this,_0x3e6a42));this['imapAccounts'][_0x116ed1['id']]['on']('end',this['handleImapEnd'][_0xc114('0x1e')](this,_0x3e6a42));this[_0xc114('0xf')][_0x116ed1['id']]['on'](_0xc114('0x20'),this[_0xc114('0x21')][_0xc114('0x1e')](this,_0x3e6a42));}}else{if(_[_0xc114('0x19')](this['mailAccounts'][_0x3e6a42][_0xc114('0x16')])){this['mailAccounts'][_0x3e6a42][_0xc114('0x16')]={};}this[_0xc114('0xe')][_0x3e6a42][_0xc114('0x16')][_0xc114('0x17')]=_0xc114('0x22');this[_0xc114('0xe')][_0x3e6a42]['Imap'][_0xc114('0x23')]='';this[_0xc114('0x12')](_0x3e6a42);}}}};EmailChannel[_0xc114('0x11')][_0xc114('0x1d')]=function(_0x7fccaa,_0x202cd1){if(this[_0xc114('0xe')][_0x7fccaa]){this[_0xc114('0xe')][_0x7fccaa][_0xc114('0x16')][_0xc114('0x17')]=_0xc114('0x24');this[_0xc114('0xe')][_0x7fccaa][_0xc114('0x16')]['messageStatus']=_0x202cd1[_0xc114('0x13')];if(_0x202cd1[_0xc114('0x25')]){this[_0xc114('0xe')][_0x7fccaa][_0xc114('0x16')][_0xc114('0x18')]=_0x202cd1[_0xc114('0x25')][_0xc114('0x18')];}return this[_0xc114('0x12')](_0x7fccaa);}};EmailChannel[_0xc114('0x11')][_0xc114('0x1f')]=function(_0xa6c4f7,_0x3d74b9){logger[_0xc114('0xd')](_0xc114('0x26'),_0x3d74b9['firstName'],_0x3d74b9[_0xc114('0x27')],_0x3d74b9['from'],_0xa6c4f7);if(this[_0xc114('0xe')][_0xa6c4f7]){return mailAccount['notify'](_0xa6c4f7,_0x3d74b9)[_0xc114('0x28')](function(_0x511d52){if(_0x511d52){logger[_0xc114('0xd')](_0xc114('0x29'));}})[_0xc114('0x2a')](function(_0x1881b5){logger[_0xc114('0x20')](_0xc114('0x2b'),JSON[_0xc114('0x1a')](_0x1881b5));});}};EmailChannel[_0xc114('0x11')][_0xc114('0x2c')]=function(_0x487584){if(this['mailAccounts'][_0x487584]&&this['mailAccounts'][_0x487584]['Imap']){if(this[_0xc114('0xf')][this[_0xc114('0xe')][_0x487584][_0xc114('0x16')]['id']]){delete this[_0xc114('0xf')][this['mailAccounts'][_0x487584]['Imap']['id']];}this[_0xc114('0xe')][_0x487584][_0xc114('0x16')][_0xc114('0x2d')]=moment();this[_0xc114('0x12')](_0x487584);}};EmailChannel[_0xc114('0x11')][_0xc114('0x21')]=function(_0x430ab6,_0x4eedbe){if(this['mailAccounts'][_0x430ab6]){this[_0xc114('0xe')][_0x430ab6]['Imap'][_0xc114('0x17')]=_0xc114('0x20');this['mailAccounts'][_0x430ab6]['Imap'][_0xc114('0x23')]=_0x4eedbe;return this['emit'](_0x430ab6);}};EmailChannel[_0xc114('0x11')][_0xc114('0x2e')]=function(_0xc63eeb,_0x2f3160){return this[_0xc114('0x10')][_0xc114('0x2f')](_0xc63eeb,_0x2f3160);};EmailChannel[_0xc114('0x11')][_0xc114('0x30')]=function(_0x373061){var _0x52fc1b=this;if(this[_0xc114('0xe')][_0x373061['id']]){if(_['isNil'](this['mailAccounts'][_0x373061['id']][_0xc114('0x31')])){this[_0xc114('0xe')][_0x373061['id']]['Smtp']={};}this['mailAccounts'][_0x373061['id']]['Smtp'][_0xc114('0x2d')]=moment();return new BPromise(function(_0xef5a55,_0x548888){return _0x52fc1b['smtp'][_0xc114('0x32')](_0x373061)[_0xc114('0x28')](function(_0x443308){_0x52fc1b[_0xc114('0xe')][_0x373061['id']][_0xc114('0x31')][_0xc114('0x17')]=_0xc114('0x33');_0x52fc1b[_0xc114('0xe')][_0x373061['id']]['Smtp'][_0xc114('0x23')]='';_0x52fc1b['emit'](_0x373061['id']);_0xef5a55(_0x443308);})['catch'](function(_0xa12031){_0x52fc1b['mailAccounts'][_0x373061['id']][_0xc114('0x31')][_0xc114('0x17')]=_0xc114('0x20');_0x52fc1b[_0xc114('0xe')][_0x373061['id']][_0xc114('0x31')][_0xc114('0x23')]=_0xa12031;_0x52fc1b['emit'](_0x373061['id']);_0x548888(_0xa12031);});});}return this['smtp'][_0xc114('0x32')](_0x373061);};module[_0xc114('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 17e6b1d..20d08bb 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 _0x0b94=['connTimeout','authTimeout','isNil','authentication','user','password','tls','autotls','required','host','getHost','anonymous@xcally.com','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','end','handleFetchEnd','closeBox','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','textCode','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','iconv','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','bind','handleEnd','error','handleError','connect','inherits','prototype'];(function(_0x3956f6,_0x59f313){var _0x4ce825=function(_0x1996de){while(--_0x1996de){_0x3956f6['push'](_0x3956f6['shift']());}};_0x4ce825(++_0x59f313);}(_0x0b94,0x91));var _0x40b9=function(_0x1e3b3b,_0x32e5c2){_0x1e3b3b=_0x1e3b3b-0x0;var _0x44d6=_0x0b94[_0x1e3b3b];return _0x44d6;};'use strict';var fs=require('fs');var path=require(_0x40b9('0x0'));var util=require(_0x40b9('0x1'));var Imap=require(_0x40b9('0x2'));var _=require(_0x40b9('0x3'));var rs=require(_0x40b9('0x4'));var simpleParser=require(_0x40b9('0x5'))['simpleParser'];var Iconv=require(_0x40b9('0x6'))['Iconv'];var EventEmitter=require('events')[_0x40b9('0x7')];var utils=require(_0x40b9('0x8'));var logger=require('../../../config/logger')(_0x40b9('0x9'));function EmailImap(_0x2ccf26,_0x3cb01d){this[_0x40b9('0xa')]='INBOX';this[_0x40b9('0xb')]=this[_0x40b9('0xc')](_0x2ccf26,_0x3cb01d);this[_0x40b9('0x2')]=new Imap(this[_0x40b9('0xb')]);this[_0x40b9('0x2')][_0x40b9('0xd')](_0x40b9('0xe'),this[_0x40b9('0xf')][_0x40b9('0x10')](this));this[_0x40b9('0x2')][_0x40b9('0xd')]('end',this[_0x40b9('0x11')][_0x40b9('0x10')](this));this['imap']['on'](_0x40b9('0x12'),this[_0x40b9('0x13')][_0x40b9('0x10')](this));this[_0x40b9('0x2')][_0x40b9('0x14')]();}util[_0x40b9('0x15')](EmailImap,EventEmitter);EmailImap[_0x40b9('0x16')]['getAccount']=function(_0x58fa25,_0x327451){var _0x516654={'connTimeout':_0x58fa25['connTimeout']?_0x58fa25[_0x40b9('0x17')]*0x3e8:0x2710,'authTimeout':_0x58fa25['authTimeout']?_0x58fa25[_0x40b9('0x18')]*0x3e8:0x1388};if(_[_0x40b9('0x19')](_0x58fa25['service'])){if(_0x58fa25[_0x40b9('0x1a')]){_0x516654[_0x40b9('0x1b')]=_0x58fa25[_0x40b9('0x1b')];_0x516654[_0x40b9('0x1c')]=_0x58fa25[_0x40b9('0x1c')];}_0x516654['host']=_0x58fa25['host'];_0x516654['port']=_0x58fa25['port']||0x3e1;if(_0x58fa25[_0x40b9('0x1d')]){_0x516654[_0x40b9('0x1d')]=!![];}else{_0x516654['tls']=![];_0x516654[_0x40b9('0x1e')]=_0x40b9('0x1f');}}else{_0x516654[_0x40b9('0x1b')]=_0x58fa25[_0x40b9('0x1b')];_0x516654[_0x40b9('0x1c')]=_0x58fa25['password'];_0x516654[_0x40b9('0x20')]=utils[_0x40b9('0x21')](_0x58fa25['service']);_0x516654['port']=0x3e1;_0x516654[_0x40b9('0x1d')]=!![];}_0x516654['email']=_0x327451||_0x58fa25[_0x40b9('0x1b')]||_0x40b9('0x22');return _0x516654;};EmailImap[_0x40b9('0x16')][_0x40b9('0xf')]=function(){this[_0x40b9('0x2')]['openBox'](this['mailbox'],![],this[_0x40b9('0x23')][_0x40b9('0x10')](this));};EmailImap[_0x40b9('0x16')]['handleOpenBox']=function(_0x1a5020,_0x20428c){if(_0x1a5020){this['handleError'](_0x1a5020,!![]);}else{this[_0x40b9('0x24')]('box',_0x20428c);this[_0x40b9('0x25')]();}};EmailImap[_0x40b9('0x16')][_0x40b9('0x26')]=function(_0x4e5175){if(_0x4e5175){this['handleError'](_0x4e5175,!![]);}else{this[_0x40b9('0x2')]['end']();}};EmailImap[_0x40b9('0x16')][_0x40b9('0x25')]=function(){this[_0x40b9('0x2')][_0x40b9('0x27')]([_0x40b9('0x28')],this[_0x40b9('0x29')][_0x40b9('0x10')](this));};EmailImap[_0x40b9('0x16')][_0x40b9('0x29')]=function(_0x54c306,_0x6523d6){if(_0x54c306){this[_0x40b9('0x13')](_0x54c306,!![]);}else{if(_0x6523d6[_0x40b9('0x2a')]){try{var _0xa9c0b3=this[_0x40b9('0x2')][_0x40b9('0x2b')](_0x6523d6,{'bodies':'','markSeen':!![]});_0xa9c0b3['on']('message',this[_0x40b9('0x2c')]['bind'](this));_0xa9c0b3[_0x40b9('0xd')]('error',this['handleFetchError'][_0x40b9('0x10')](this));_0xa9c0b3[_0x40b9('0xd')](_0x40b9('0x2d'),this[_0x40b9('0x2e')][_0x40b9('0x10')](this));}catch(_0x355e99){logger['error'](_0x355e99);}}else{this[_0x40b9('0x2')][_0x40b9('0x2f')](!![],this['handleCloseBox'][_0x40b9('0x10')](this));}}};EmailImap['prototype'][_0x40b9('0x2c')]=function(_0x12b486,_0x1d1d72){_0x12b486['on']('body',this[_0x40b9('0x30')]['bind'](this));_0x12b486[_0x40b9('0xd')]('attributes',this[_0x40b9('0x31')][_0x40b9('0x10')](this));_0x12b486[_0x40b9('0xd')](_0x40b9('0x2d'),this[_0x40b9('0x32')]['bind'](this));};EmailImap[_0x40b9('0x16')][_0x40b9('0x30')]=function(_0x17a729,_0x3ff0e7){simpleParser(_0x17a729,{'Iconv':Iconv},this[_0x40b9('0x33')][_0x40b9('0x10')](this));};EmailImap[_0x40b9('0x16')][_0x40b9('0x31')]=function(_0x2b56de){};EmailImap[_0x40b9('0x16')][_0x40b9('0x32')]=function(){};EmailImap[_0x40b9('0x16')][_0x40b9('0x33')]=function(_0x43cdc1,_0x4e82e6){if(_0x43cdc1){logger['error'](_0x43cdc1);}else{var _0xf7251c=this;utils[_0x40b9('0x34')](this[_0x40b9('0xb')],_0x4e82e6,function(_0x1ee024){_0xf7251c[_0x40b9('0x24')](_0x40b9('0x9'),_0x1ee024);});}};EmailImap[_0x40b9('0x16')][_0x40b9('0x2e')]=function(){this[_0x40b9('0x2')][_0x40b9('0x2f')](!![],this[_0x40b9('0x26')]['bind'](this));};EmailImap[_0x40b9('0x16')]['handleFetchError']=function(_0x479a02){this[_0x40b9('0x13')](_0x479a02);this[_0x40b9('0x2')][_0x40b9('0x2f')](!![],this[_0x40b9('0x26')]['bind'](this));};EmailImap[_0x40b9('0x16')]['handleEnd']=function(){this['emit']('end');};EmailImap[_0x40b9('0x16')][_0x40b9('0x13')]=function(_0x46e2e8,_0x1c6340){logger[_0x40b9('0x12')]('handleError',this[_0x40b9('0xb')]['email'],JSON['stringify'](_0x46e2e8));var _0x314286='';if(_0x46e2e8){if(_0x46e2e8[_0x40b9('0x35')]){_0x314286=_0x46e2e8['textCode'];}else{for(var _0xd89006 in _0x46e2e8){if(_0x46e2e8['hasOwnProperty'](_0xd89006)){_0x314286+=_[_0x40b9('0x36')](_0xd89006)+':\x20'+_0x46e2e8[_0xd89006]+'\x0a';}}}}if(_0x1c6340){this[_0x40b9('0x2')][_0x40b9('0x2d')]();}else{this[_0x40b9('0x24')](_0x40b9('0x12'),_0x314286);this[_0x40b9('0x24')](_0x40b9('0x2d'));}};module[_0x40b9('0x37')]=EmailImap; \ No newline at end of file +var _0x9ddf=['stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','randomstring','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','account','once','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','tls','autotls','getHost','port','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchEnd','handleFetchError'];(function(_0x24d328,_0x34ec4b){var _0x9d553b=function(_0x48383d){while(--_0x48383d){_0x24d328['push'](_0x24d328['shift']());}};_0x9d553b(++_0x34ec4b);}(_0x9ddf,0x1b7));var _0xf9dd=function(_0x3330b8,_0x19b32a){_0x3330b8=_0x3330b8-0x0;var _0x191799=_0x9ddf[_0x3330b8];return _0x191799;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xf9dd('0x0'));var Imap=require(_0xf9dd('0x1'));var _=require('lodash');var rs=require(_0xf9dd('0x2'));var simpleParser=require(_0xf9dd('0x3'))['simpleParser'];var Iconv=require(_0xf9dd('0x4'))[_0xf9dd('0x5')];var EventEmitter=require(_0xf9dd('0x6'))[_0xf9dd('0x7')];var utils=require(_0xf9dd('0x8'));var logger=require(_0xf9dd('0x9'))(_0xf9dd('0xa'));function EmailImap(_0x576419,_0x31d5ea){this['mailbox']='INBOX';this[_0xf9dd('0xb')]=this['getAccount'](_0x576419,_0x31d5ea);this[_0xf9dd('0x1')]=new Imap(this[_0xf9dd('0xb')]);this[_0xf9dd('0x1')][_0xf9dd('0xc')]('ready',this[_0xf9dd('0xd')]['bind'](this));this[_0xf9dd('0x1')][_0xf9dd('0xc')](_0xf9dd('0xe'),this[_0xf9dd('0xf')][_0xf9dd('0x10')](this));this['imap']['on'](_0xf9dd('0x11'),this[_0xf9dd('0x12')][_0xf9dd('0x10')](this));this['imap'][_0xf9dd('0x13')]();}util[_0xf9dd('0x14')](EmailImap,EventEmitter);EmailImap[_0xf9dd('0x15')][_0xf9dd('0x16')]=function(_0x57f40a,_0x42cb71){var _0x13de80={'connTimeout':_0x57f40a[_0xf9dd('0x17')]?_0x57f40a['connTimeout']*0x3e8:0x2710,'authTimeout':_0x57f40a[_0xf9dd('0x18')]?_0x57f40a[_0xf9dd('0x18')]*0x3e8:0x1388};if(_[_0xf9dd('0x19')](_0x57f40a[_0xf9dd('0x1a')])){if(_0x57f40a[_0xf9dd('0x1b')]){_0x13de80[_0xf9dd('0x1c')]=_0x57f40a[_0xf9dd('0x1c')];_0x13de80[_0xf9dd('0x1d')]=_0x57f40a[_0xf9dd('0x1d')];}_0x13de80[_0xf9dd('0x1e')]=_0x57f40a[_0xf9dd('0x1e')];_0x13de80['port']=_0x57f40a['port']||0x3e1;if(_0x57f40a[_0xf9dd('0x1f')]){_0x13de80[_0xf9dd('0x1f')]=!![];}else{_0x13de80[_0xf9dd('0x1f')]=![];_0x13de80[_0xf9dd('0x20')]='required';}}else{_0x13de80[_0xf9dd('0x1c')]=_0x57f40a[_0xf9dd('0x1c')];_0x13de80['password']=_0x57f40a[_0xf9dd('0x1d')];_0x13de80[_0xf9dd('0x1e')]=utils[_0xf9dd('0x21')](_0x57f40a[_0xf9dd('0x1a')]);_0x13de80[_0xf9dd('0x22')]=0x3e1;_0x13de80[_0xf9dd('0x1f')]=!![];}_0x13de80[_0xf9dd('0xa')]=_0x42cb71||_0x57f40a['user']||_0xf9dd('0x23');return _0x13de80;};EmailImap[_0xf9dd('0x15')][_0xf9dd('0xd')]=function(){this[_0xf9dd('0x1')][_0xf9dd('0x24')](this['mailbox'],![],this['handleOpenBox'][_0xf9dd('0x10')](this));};EmailImap['prototype'][_0xf9dd('0x25')]=function(_0x931f,_0x30757d){if(_0x931f){this[_0xf9dd('0x12')](_0x931f,!![]);}else{this['emit'](_0xf9dd('0x26'),_0x30757d);this[_0xf9dd('0x27')]();}};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x28')]=function(_0x22a8f2){if(_0x22a8f2){this[_0xf9dd('0x12')](_0x22a8f2,!![]);}else{this[_0xf9dd('0x1')][_0xf9dd('0xe')]();}};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x27')]=function(){this[_0xf9dd('0x1')]['search']([_0xf9dd('0x29')],this[_0xf9dd('0x2a')][_0xf9dd('0x10')](this));};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x2a')]=function(_0x1b6e2b,_0x2ec119){if(_0x1b6e2b){this[_0xf9dd('0x12')](_0x1b6e2b,!![]);}else{if(_0x2ec119[_0xf9dd('0x2b')]){try{var _0x27c644=this[_0xf9dd('0x1')][_0xf9dd('0x2c')](_0x2ec119,{'bodies':'','markSeen':!![]});_0x27c644['on'](_0xf9dd('0x2d'),this[_0xf9dd('0x2e')][_0xf9dd('0x10')](this));_0x27c644['once'](_0xf9dd('0x11'),this['handleFetchError']['bind'](this));_0x27c644[_0xf9dd('0xc')]('end',this['handleFetchEnd'][_0xf9dd('0x10')](this));}catch(_0x56bc2c){logger[_0xf9dd('0x11')](_0x56bc2c);}}else{this['imap'][_0xf9dd('0x2f')](!![],this[_0xf9dd('0x28')][_0xf9dd('0x10')](this));}}};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x2e')]=function(_0x9625cb,_0x47185e){_0x9625cb['on'](_0xf9dd('0x30'),this[_0xf9dd('0x31')][_0xf9dd('0x10')](this));_0x9625cb[_0xf9dd('0xc')]('attributes',this[_0xf9dd('0x32')][_0xf9dd('0x10')](this));_0x9625cb[_0xf9dd('0xc')]('end',this[_0xf9dd('0x33')][_0xf9dd('0x10')](this));};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x31')]=function(_0x4035b7,_0xe0a36a){simpleParser(_0x4035b7,{'Iconv':Iconv},this[_0xf9dd('0x34')][_0xf9dd('0x10')](this));};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x32')]=function(_0x2f5b29){};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x33')]=function(){};EmailImap['prototype'][_0xf9dd('0x34')]=function(_0x360a08,_0x5e1476){if(_0x360a08){logger[_0xf9dd('0x11')](_0x360a08);}else{var _0x3aceed=this;utils[_0xf9dd('0x35')](this['account'],_0x5e1476,function(_0x16d274){_0x3aceed[_0xf9dd('0x36')](_0xf9dd('0xa'),_0x16d274);});}};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x37')]=function(){this[_0xf9dd('0x1')][_0xf9dd('0x2f')](!![],this['handleCloseBox'][_0xf9dd('0x10')](this));};EmailImap[_0xf9dd('0x15')][_0xf9dd('0x38')]=function(_0x33d73b){this[_0xf9dd('0x12')](_0x33d73b);this[_0xf9dd('0x1')][_0xf9dd('0x2f')](!![],this[_0xf9dd('0x28')][_0xf9dd('0x10')](this));};EmailImap[_0xf9dd('0x15')][_0xf9dd('0xf')]=function(){this[_0xf9dd('0x36')]('end');};EmailImap['prototype'][_0xf9dd('0x12')]=function(_0x5da8be,_0x4511c9){logger['error']('handleError',this['account'][_0xf9dd('0xa')],JSON[_0xf9dd('0x39')](_0x5da8be));var _0x505aa3='';if(_0x5da8be){if(_0x5da8be[_0xf9dd('0x3a')]){_0x505aa3=_0x5da8be[_0xf9dd('0x3a')];}else{for(var _0xf070d0 in _0x5da8be){if(_0x5da8be[_0xf9dd('0x3b')](_0xf070d0)){_0x505aa3+=_[_0xf9dd('0x3c')](_0xf070d0)+':\x20'+_0x5da8be[_0xf070d0]+'\x0a';}}}}if(_0x4511c9){this[_0xf9dd('0x1')][_0xf9dd('0xe')]();}else{this['emit'](_0xf9dd('0x11'),_0x505aa3);this[_0xf9dd('0x36')](_0xf9dd('0xe'));}};module[_0xf9dd('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 843a14e..a7e99aa 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 _0x532c=['verify','toString','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x532c,0x1d7));var _0xc532=function(_0x37f99f,_0x471923){_0x37f99f=_0x37f99f-0x0;var _0x3c666a=_0x532c[_0x37f99f];return _0x3c666a;};'use strict';var nodemailer=require(_0xc532('0x0'));var BPromise=require(_0xc532('0x1'));var inlineBase64=require(_0xc532('0x2'));function EmailSmtp(){}EmailSmtp[_0xc532('0x3')][_0xc532('0x4')]=function(_0x37c80e,_0x5f3bcb){return new BPromise(function(_0x12c47b,_0x2d7916){var _0x3eebc0=nodemailer[_0xc532('0x5')](_0x37c80e);_0x3eebc0[_0xc532('0x6')](_0xc532('0x7'),inlineBase64());_0x3eebc0[_0xc532('0x8')](_0x5f3bcb,function(_0x2d90f0,_0x3edd46){if(_0x2d90f0){_0x2d7916(_0x2d90f0['toString']());}else{_0x12c47b(_0x3edd46);}});});};EmailSmtp[_0xc532('0x3')][_0xc532('0x9')]=function(_0x3be7ab){return new BPromise(function(_0x2ff657,_0x5d118c){var _0x3ef12e=nodemailer['createTransport'](_0x3be7ab);_0x3ef12e[_0xc532('0x9')](function(_0x1569bb,_0x4c4015){if(_0x1569bb){_0x5d118c(_0x1569bb[_0xc532('0xa')]());}else{if(_0x4c4015){_0x2ff657(_0x4c4015);}else{_0x5d118c(_0xc532('0xb'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x46a0=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','toString','verify','Not\x20verifired','nodemailer','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x46a0,0x76));var _0x046a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x46a0[_0x20a584];return _0x4b41a8;};'use strict';var nodemailer=require(_0x046a('0x0'));var BPromise=require(_0x046a('0x1'));var inlineBase64=require(_0x046a('0x2'));function EmailSmtp(){}EmailSmtp[_0x046a('0x3')][_0x046a('0x4')]=function(_0x5b01be,_0xfe27c8){return new BPromise(function(_0x5283fd,_0x5466aa){var _0x2a6981=nodemailer[_0x046a('0x5')](_0x5b01be);_0x2a6981[_0x046a('0x6')]('compile',inlineBase64());_0x2a6981['sendMail'](_0xfe27c8,function(_0x5579c8,_0x2543b0){if(_0x5579c8){_0x5466aa(_0x5579c8[_0x046a('0x7')]());}else{_0x5283fd(_0x2543b0);}});});};EmailSmtp[_0x046a('0x3')][_0x046a('0x8')]=function(_0x1dab0c){return new BPromise(function(_0xf2db56,_0xa19d6f){var _0x5db696=nodemailer[_0x046a('0x5')](_0x1dab0c);_0x5db696[_0x046a('0x8')](function(_0x1c7732,_0x5c612d){if(_0x1c7732){_0xa19d6f(_0x1c7732[_0x046a('0x7')]());}else{if(_0x5c612d){_0xf2db56(_0x5c612d);}else{_0xa19d6f(_0x046a('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index b79ce50..84a474e 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 _0x0c3a=['imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','@xcally.com','name','substring','split','slice','join','length','isEmpty','anonymous','generate','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','gmail','imap.gmail.com','yahoo'];(function(_0x426ff4,_0x6cd359){var _0x4a6ddc=function(_0x3a9211){while(--_0x3a9211){_0x426ff4['push'](_0x426ff4['shift']());}};_0x4a6ddc(++_0x6cd359);}(_0x0c3a,0x171));var _0xa0c3=function(_0x16cb49,_0x531ce8){_0x16cb49=_0x16cb49-0x0;var _0x53d3e0=_0x0c3a[_0x16cb49];return _0x53d3e0;};'use strict';var _=require(_0xa0c3('0x0'));var moment=require(_0xa0c3('0x1'));var random=require(_0xa0c3('0x2'));var fs=require('fs');var path=require(_0xa0c3('0x3'));var util=require(_0xa0c3('0x4'));var tnef=require(_0xa0c3('0x5'));var logger=require(_0xa0c3('0x6'))('email');var config=require(_0xa0c3('0x7'));function getAddress(_0x11e5d4){var _0x5d79bc=_[_0xa0c3('0x8')](_0x11e5d4[_0xa0c3('0x9')]);return _0x5d79bc&&_0x5d79bc['address']?_0x5d79bc[_0xa0c3('0xa')]:'anonymous'+random['generate'](0x6)+_0xa0c3('0xb');}function getFirstName(_0x109c9a){var _0x3b524a=_[_0xa0c3('0x8')](_0x109c9a['value']);if(_0x3b524a&&_0x3b524a[_0xa0c3('0xc')]){if(_0x3b524a[_0xa0c3('0xc')]==_0x3b524a['address']){return _0x3b524a['name'][_0xa0c3('0xd')](0x0,_0x3b524a[_0xa0c3('0xc')]['indexOf']('@'));}var _0x30522f=_0x3b524a[_0xa0c3('0xc')][_0xa0c3('0xe')](/\s+/);return _0x30522f['length']>0x1?_0x30522f[_0xa0c3('0xf')](0x0,-0x1)[_0xa0c3('0x10')]('\x20'):_0x3b524a['name'];}return'Anonymous';}function getLastName(_0x2de54f){var _0x2452d8=_[_0xa0c3('0x8')](_0x2de54f[_0xa0c3('0x9')]);if(_0x2452d8&&_0x2452d8[_0xa0c3('0xc')]){var _0x4bbfcf=_0x2452d8[_0xa0c3('0xc')]['split'](/\s+/);return _0x4bbfcf[_0xa0c3('0x11')]>0x1?_0x4bbfcf['pop']():'';}return'';}function getMails(_0x49983c,_0x4d5c8a){var _0xd70a2b='';for(var _0x474695=0x0;_0x474695<_0x4d5c8a[_0xa0c3('0x9')]['length'];_0x474695+=0x1){if(_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xa')]!==_0x49983c){if(!_[_0xa0c3('0x12')](_0xd70a2b)){_0xd70a2b+=',';}_0xd70a2b+=_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xc')]||_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xa')]||'';_0xd70a2b+='\x20<';_0xd70a2b+=_0x4d5c8a['value'][_0x474695][_0xa0c3('0xa')]?_0x4d5c8a['value'][_0x474695][_0xa0c3('0xa')]:_0xa0c3('0x13')+random[_0xa0c3('0x14')](0x6)+_0xa0c3('0xb');_0xd70a2b+='>';}}return _0xd70a2b;}function parseEmail(_0x53111d,_0x91fd9f,_0x2be9eb){if(_0x91fd9f[_0xa0c3('0x15')]){var _0x1a1c0b=/)<[^<]*)*<\/script>/gi;while(_0x1a1c0b[_0xa0c3('0x16')](_0x91fd9f[_0xa0c3('0x15')])){_0x91fd9f[_0xa0c3('0x15')]=_0x91fd9f['html'][_0xa0c3('0x17')](_0x1a1c0b,'');}if(_0x91fd9f[_0xa0c3('0x15')][_0xa0c3('0x18')]('{_0x47b303[_0xa0c3('0x1b')](_0x16daf8[_0xa0c3('0x1c')]);});var _0x303410=/]+>/g;var _0x381f3b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x171720=_0x91fd9f['html'][_0xa0c3('0x17')](_0x381f3b,_0xa0c3('0x1d'));var _0x254969=_0x171720[_0xa0c3('0x17')](_0x303410,_0xa0c3('0x1e'));for(let _0x54cf9e=0x0;_0x54cf9e<_0x47b303[_0xa0c3('0x11')];_0x54cf9e++){var _0x51ea75=_0x254969[_0xa0c3('0x17')](_0xa0c3('0x1e'),_0xa0c3('0x1f')+_0x47b303[_0x54cf9e]+_0xa0c3('0x20'));_0x254969=_0x51ea75;}_0x91fd9f[_0xa0c3('0x15')]=_0x254969;}_0x2be9eb[_0xa0c3('0x21')]=_0x91fd9f['html'];}else{_0x2be9eb[_0xa0c3('0x21')]=_0x91fd9f[_0xa0c3('0x22')];}if(_0x2be9eb[_0xa0c3('0x21')]){_0x2be9eb[_0xa0c3('0x21')]=_0x2be9eb[_0xa0c3('0x21')]['replace'](/0x0){var _0x382228=[_0xa0c3('0x32'),_0xa0c3('0x33'),_0xa0c3('0x34')];for(var _0x2fdae9=0x0;_0x2fdae9<_0x91fd9f[_0xa0c3('0x31')][_0xa0c3('0x11')];_0x2fdae9++){var _0x24b1db=_[_0xa0c3('0x35')](_0x382228,_0x91fd9f[_0xa0c3('0x31')][_0x2fdae9][_0xa0c3('0x36')]);if(_0x24b1db>=0x0){_0x2be9eb['isAutoreply']=!![];}}}return _0x2be9eb;}exports[_0xa0c3('0x37')]=function(_0x30dbe4,_0x3d0b8c,_0x43f80c){var _0x247e0c={'from':getAddress(_0x3d0b8c[_0xa0c3('0x38')]),'firstName':getFirstName(_0x3d0b8c[_0xa0c3('0x38')]),'lastName':getLastName(_0x3d0b8c[_0xa0c3('0x38')]),'mapKey':_0xa0c3('0x27'),'message':{'from':getMails(_0x30dbe4[_0xa0c3('0x27')],_0x3d0b8c['from']),'to':_0x30dbe4[_0xa0c3('0x27')],'cc':'','subject':_0x3d0b8c[_0xa0c3('0x39')]||'','messageId':_0x3d0b8c[_0xa0c3('0x3a')],'inReplyTo':_0x3d0b8c[_0xa0c3('0x3b')],'sentAt':moment(_0x3d0b8c['date'])[_0xa0c3('0x2b')](_0xa0c3('0x3c')),'attach':![],'attachments':[]}};if(!_0x3d0b8c[_0xa0c3('0x15')]&&!_0x3d0b8c[_0xa0c3('0x22')]){var _0x9b9954=_['filter'](_0x3d0b8c['attachments'],{'contentType':'application/ms-tnef'});if(_0x9b9954[_0xa0c3('0x11')]){logger['info'](util[_0xa0c3('0x2b')](_0xa0c3('0x3d'),_0x3d0b8c[_0xa0c3('0x3a')]));tnef['parseBuffer'](_[_0xa0c3('0x3e')](_0x9b9954)['content'],function(_0x51f22f,_0x168c06){if(_0x168c06){_0x3d0b8c[_0xa0c3('0x15')]=_0x168c06[_0xa0c3('0x3f')]||_0xa0c3('0x40');if(_0x168c06[_0xa0c3('0x41')]){for(var _0x23fe12=0x0;_0x23fe12<_0x168c06[_0xa0c3('0x41')][_0xa0c3('0x11')];_0x23fe12++){var _0x315ee5=_0x168c06[_0xa0c3('0x41')][_0x23fe12];_0x247e0c['message']['attachments'][_0xa0c3('0x1b')]({'filename':_0x315ee5['Title'],'content':Buffer['from'](_0x315ee5['Data'])});}}}_0x43f80c(parseEmail(_0x30dbe4,_0x3d0b8c,_0x247e0c));});}else{_0x3d0b8c[_0xa0c3('0x15')]='

Empty\x20message

';_0x43f80c(parseEmail(_0x30dbe4,_0x3d0b8c,_0x247e0c));}}else{_0x43f80c(parseEmail(_0x30dbe4,_0x3d0b8c,_0x247e0c));}};exports['getHost']=function(_0x354935){switch(_0x354935){case _0xa0c3('0x42'):return _0xa0c3('0x43');case _0xa0c3('0x44'):return'imap.mail.yahoo.com';case'hotmail':return _0xa0c3('0x45');case _0xa0c3('0x46'):return _0xa0c3('0x47');}return _0xa0c3('0x48');}; \ No newline at end of file +var _0x86dc=['push','_SRC','_IMG','\x20[Attachment:\x20','body','textAsHtml','message','originTo','email','bcc','attach','attachment','filename','attachment-','format','now','root','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','isAutoreply','parser','from','subject','messageId','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','Attachments','Title','getHost','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','path','util','node-tnef','../../../config/logger','../../../config/environment','value','address','generate','name','substring','indexOf','split','length','slice','join','Anonymous','head','isEmpty','anonymous','@xcally.com','html','test','replace','includes','attachments','forEach'];(function(_0x32f311,_0x40c3a7){var _0x21ff70=function(_0x5105a3){while(--_0x5105a3){_0x32f311['push'](_0x32f311['shift']());}};_0x21ff70(++_0x40c3a7);}(_0x86dc,0x13e));var _0xc86d=function(_0x56d560,_0x268724){_0x56d560=_0x56d560-0x0;var _0x19ffcf=_0x86dc[_0x56d560];return _0x19ffcf;};'use strict';var _=require(_0xc86d('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xc86d('0x1'));var util=require(_0xc86d('0x2'));var tnef=require(_0xc86d('0x3'));var logger=require(_0xc86d('0x4'))('email');var config=require(_0xc86d('0x5'));function getAddress(_0x496d00){var _0x271eb1=_['head'](_0x496d00[_0xc86d('0x6')]);return _0x271eb1&&_0x271eb1[_0xc86d('0x7')]?_0x271eb1[_0xc86d('0x7')]:'anonymous'+random[_0xc86d('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x20ae2c){var _0x1ffae3=_['head'](_0x20ae2c['value']);if(_0x1ffae3&&_0x1ffae3[_0xc86d('0x9')]){if(_0x1ffae3[_0xc86d('0x9')]==_0x1ffae3['address']){return _0x1ffae3[_0xc86d('0x9')][_0xc86d('0xa')](0x0,_0x1ffae3[_0xc86d('0x9')][_0xc86d('0xb')]('@'));}var _0x1aebff=_0x1ffae3[_0xc86d('0x9')][_0xc86d('0xc')](/\s+/);return _0x1aebff[_0xc86d('0xd')]>0x1?_0x1aebff[_0xc86d('0xe')](0x0,-0x1)[_0xc86d('0xf')]('\x20'):_0x1ffae3[_0xc86d('0x9')];}return _0xc86d('0x10');}function getLastName(_0x33b1a0){var _0xccef31=_[_0xc86d('0x11')](_0x33b1a0[_0xc86d('0x6')]);if(_0xccef31&&_0xccef31[_0xc86d('0x9')]){var _0x313c16=_0xccef31[_0xc86d('0x9')][_0xc86d('0xc')](/\s+/);return _0x313c16[_0xc86d('0xd')]>0x1?_0x313c16['pop']():'';}return'';}function getMails(_0x4fb8e7,_0x49af1f){var _0x3a253c='';for(var _0x376a90=0x0;_0x376a90<_0x49af1f[_0xc86d('0x6')][_0xc86d('0xd')];_0x376a90+=0x1){if(_0x49af1f[_0xc86d('0x6')][_0x376a90][_0xc86d('0x7')]!==_0x4fb8e7){if(!_[_0xc86d('0x12')](_0x3a253c)){_0x3a253c+=',';}_0x3a253c+=_0x49af1f['value'][_0x376a90]['name']||_0x49af1f[_0xc86d('0x6')][_0x376a90][_0xc86d('0x7')]||'';_0x3a253c+='\x20<';_0x3a253c+=_0x49af1f[_0xc86d('0x6')][_0x376a90]['address']?_0x49af1f[_0xc86d('0x6')][_0x376a90][_0xc86d('0x7')]:_0xc86d('0x13')+random['generate'](0x6)+_0xc86d('0x14');_0x3a253c+='>';}}return _0x3a253c;}function parseEmail(_0x210043,_0x548f59,_0x34bb85){if(_0x548f59[_0xc86d('0x15')]){var _0x3a4abb=/)<[^<]*)*<\/script>/gi;while(_0x3a4abb[_0xc86d('0x16')](_0x548f59['html'])){_0x548f59[_0xc86d('0x15')]=_0x548f59[_0xc86d('0x15')][_0xc86d('0x17')](_0x3a4abb,'');}if(_0x548f59[_0xc86d('0x15')][_0xc86d('0x18')]('{_0x38fb11[_0xc86d('0x1b')](_0xd59e7b['filename']);});var _0x1458fe=/]+>/g;var _0x54303e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4e1312=_0x548f59['html'][_0xc86d('0x17')](_0x54303e,_0xc86d('0x1c'));var _0x273c5a=_0x4e1312[_0xc86d('0x17')](_0x1458fe,_0xc86d('0x1d'));for(let _0x1ad978=0x0;_0x1ad978<_0x38fb11[_0xc86d('0xd')];_0x1ad978++){var _0x2a35b3=_0x273c5a['replace'](_0xc86d('0x1d'),_0xc86d('0x1e')+_0x38fb11[_0x1ad978]+'\x20]');_0x273c5a=_0x2a35b3;}_0x548f59['html']=_0x273c5a;}_0x34bb85[_0xc86d('0x1f')]=_0x548f59[_0xc86d('0x15')];}else{_0x34bb85[_0xc86d('0x1f')]=_0x548f59[_0xc86d('0x20')];}if(_0x34bb85[_0xc86d('0x1f')]){_0x34bb85[_0xc86d('0x1f')]=_0x34bb85[_0xc86d('0x1f')]['replace'](/0x0){var _0x117d82=['Auto-Submitted:\x20auto-replied',_0xc86d('0x30'),'Precedence:\x20auto_reply'];for(var _0x2023b5=0x0;_0x2023b5<_0x548f59[_0xc86d('0x2f')][_0xc86d('0xd')];_0x2023b5++){var _0x2e5971=_['indexOf'](_0x117d82,_0x548f59['headerLines'][_0x2023b5]['line']);if(_0x2e5971>=0x0){_0x34bb85[_0xc86d('0x31')]=!![];}}}return _0x34bb85;}exports[_0xc86d('0x32')]=function(_0x172f7b,_0x2c3f3d,_0x549023){var _0x22ace4={'from':getAddress(_0x2c3f3d[_0xc86d('0x33')]),'firstName':getFirstName(_0x2c3f3d[_0xc86d('0x33')]),'lastName':getLastName(_0x2c3f3d[_0xc86d('0x33')]),'mapKey':_0xc86d('0x23'),'message':{'from':getMails(_0x172f7b['email'],_0x2c3f3d[_0xc86d('0x33')]),'to':_0x172f7b[_0xc86d('0x23')],'cc':'','subject':_0x2c3f3d[_0xc86d('0x34')]||'','messageId':_0x2c3f3d[_0xc86d('0x35')],'inReplyTo':_0x2c3f3d['inReplyTo'],'sentAt':moment(_0x2c3f3d[_0xc86d('0x36')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2c3f3d[_0xc86d('0x15')]&&!_0x2c3f3d['textAsHtml']){var _0x2f3fa6=_[_0xc86d('0x37')](_0x2c3f3d[_0xc86d('0x19')],{'contentType':_0xc86d('0x38')});if(_0x2f3fa6['length']){logger[_0xc86d('0x39')](util[_0xc86d('0x29')](_0xc86d('0x3a'),_0x2c3f3d['messageId']));tnef['parseBuffer'](_[_0xc86d('0x3b')](_0x2f3fa6)['content'],function(_0x2ca8e1,_0x281007){if(_0x281007){_0x2c3f3d[_0xc86d('0x15')]=_0x281007['BodyHTML']||'

Empty\x20message

';if(_0x281007[_0xc86d('0x3c')]){for(var _0x21b745=0x0;_0x21b745<_0x281007[_0xc86d('0x3c')]['length'];_0x21b745++){var _0xb9c6e8=_0x281007['Attachments'][_0x21b745];_0x22ace4[_0xc86d('0x21')][_0xc86d('0x19')]['push']({'filename':_0xb9c6e8[_0xc86d('0x3d')],'content':Buffer[_0xc86d('0x33')](_0xb9c6e8['Data'])});}}}_0x549023(parseEmail(_0x172f7b,_0x2c3f3d,_0x22ace4));});}else{_0x2c3f3d[_0xc86d('0x15')]='

Empty\x20message

';_0x549023(parseEmail(_0x172f7b,_0x2c3f3d,_0x22ace4));}}else{_0x549023(parseEmail(_0x172f7b,_0x2c3f3d,_0x22ace4));}};exports[_0xc86d('0x3e')]=function(_0x44f29){switch(_0x44f29){case _0xc86d('0x3f'):return'imap.gmail.com';case'yahoo':return _0xc86d('0x40');case _0xc86d('0x41'):return _0xc86d('0x42');case _0xc86d('0x43'):return'outlook.office365.com';}return _0xc86d('0x44');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index a0dc41f..421268b 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 _0xeee1=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x37ad1c,_0x247bd6){var _0xedeefb=function(_0x45a953){while(--_0x45a953){_0x37ad1c['push'](_0x37ad1c['shift']());}};_0xedeefb(++_0x247bd6);}(_0xeee1,0x158));var _0x1eee=function(_0x51c318,_0x5ca22d){_0x51c318=_0x51c318-0x0;var _0xd43253=_0xeee1[_0x51c318];return _0xd43253;};'use strict';var _=require(_0x1eee('0x0'));function MailAccount(_0x578cf6){this['id']=_0x578cf6['id']||0x0;this[_0x1eee('0x1')]=_0x578cf6[_0x1eee('0x1')]||_0x1eee('0x2');this[_0x1eee('0x3')]=_0x578cf6[_0x1eee('0x3')]||_0x1eee('0x4');this[_0x1eee('0x5')]=_0x578cf6[_0x1eee('0x5')]||![];this[_0x1eee('0x6')]=_0x578cf6[_0x1eee('0x6')]||[];this[_0x1eee('0x7')]=_0x578cf6[_0x1eee('0x7')]||[];}module[_0x1eee('0x8')]=MailAccount; \ No newline at end of file +var _0x087f=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x087f,0xc7));var _0xf087=function(_0x37256d,_0x4013c9){_0x37256d=_0x37256d-0x0;var _0x4ca000=_0x087f[_0x37256d];return _0x4ca000;};'use strict';var _=require(_0xf087('0x0'));function MailAccount(_0x1d4d77){this['id']=_0x1d4d77['id']||0x0;this[_0xf087('0x1')]=_0x1d4d77[_0xf087('0x1')]||_0xf087('0x2');this[_0xf087('0x3')]=_0x1d4d77['key']||_0xf087('0x4');this[_0xf087('0x5')]=_0x1d4d77[_0xf087('0x5')]||![];this['Imap']=_0x1d4d77[_0xf087('0x6')]||[];this[_0xf087('0x7')]=_0x1d4d77[_0xf087('0x7')]||[];}module[_0xf087('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f863186..5775ef6 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 _0xf0cc=['isUndefined','exports','mailAccounts','mapKeys','prototype','hasOwnProperty','initMailAccounts'];(function(_0x5b24c1,_0x14df20){var _0x1ff851=function(_0x563727){while(--_0x563727){_0x5b24c1['push'](_0x5b24c1['shift']());}};_0x1ff851(++_0x14df20);}(_0xf0cc,0xfe));var _0xcf0c=function(_0x5c24f9,_0x727db9){_0x5c24f9=_0x5c24f9-0x0;var _0x24bf2b=_0xf0cc[_0x5c24f9];return _0x24bf2b;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xcf0c('0x0')]={};};function freeIsNotKey(_0x5bedd3,_0x136067,_0x1cec45){var _0x5521d0=_[_0xcf0c('0x1')](_0x5bedd3,function(_0x445d91,_0x3b776f){return _0x445d91[_0x1cec45];});for(var _0xbf9f78 in _0x136067){if(_0x136067['hasOwnProperty'](_0xbf9f78)){if(!_0x5521d0[_0xbf9f78]){delete _0x136067[_0xbf9f78];}}}}Realtime[_0xcf0c('0x2')]['mergeFromDatabase']=function(_0x38f3ab,_0x501862){for(var _0x1fa7cd in _0x501862){if(_0x38f3ab[_0xcf0c('0x3')](_0x1fa7cd)){_0x38f3ab[_0x1fa7cd]=_0x501862[_0x1fa7cd];}}};Realtime[_0xcf0c('0x2')][_0xcf0c('0x4')]=function(){var _0x2fefe1=this;return function(_0x5c4eaf){if(_0x5c4eaf){freeIsNotKey(_0x5c4eaf,_0x2fefe1['mailAccounts'],'id');for(var _0x151861=0x0,_0x2808ab={},_0x2b4e9c={};_0x151861<_0x5c4eaf['length'];_0x151861+=0x1){_0x2808ab=_0x5c4eaf[_0x151861];if(_[_0xcf0c('0x5')](_0x2fefe1[_0xcf0c('0x0')][_0x2808ab['id']])){_0x2fefe1[_0xcf0c('0x0')][_0x2808ab['id']]=new MailAccount(_0x2808ab);}else{_['merge'](_0x2fefe1[_0xcf0c('0x0')][_0x2808ab['id']],_0x2808ab);}}}return _0x2fefe1[_0xcf0c('0x0')];};};module[_0xcf0c('0x6')]=Realtime; \ No newline at end of file +var _0x2ed6=['mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0x2ed6,0x11b));var _0x62ed=function(_0xc96123,_0x50dc60){_0xc96123=_0xc96123-0x0;var _0x7fa1bf=_0x2ed6[_0xc96123];return _0x7fa1bf;};'use strict';var _=require(_0x62ed('0x0'));var MailAccount=require(_0x62ed('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x40961e,_0x3f1508,_0x229b4c){var _0x5a818e=_[_0x62ed('0x2')](_0x40961e,function(_0x57e709,_0x28f2db){return _0x57e709[_0x229b4c];});for(var _0x26e210 in _0x3f1508){if(_0x3f1508[_0x62ed('0x3')](_0x26e210)){if(!_0x5a818e[_0x26e210]){delete _0x3f1508[_0x26e210];}}}}Realtime[_0x62ed('0x4')][_0x62ed('0x5')]=function(_0x598ad4,_0x398311){for(var _0x52bd5e in _0x398311){if(_0x598ad4['hasOwnProperty'](_0x52bd5e)){_0x598ad4[_0x52bd5e]=_0x398311[_0x52bd5e];}}};Realtime['prototype'][_0x62ed('0x6')]=function(){var _0x255448=this;return function(_0x5acdfe){if(_0x5acdfe){freeIsNotKey(_0x5acdfe,_0x255448[_0x62ed('0x7')],'id');for(var _0x31e816=0x0,_0x52d637={},_0x2a674c={};_0x31e816<_0x5acdfe[_0x62ed('0x8')];_0x31e816+=0x1){_0x52d637=_0x5acdfe[_0x31e816];if(_[_0x62ed('0x9')](_0x255448['mailAccounts'][_0x52d637['id']])){_0x255448[_0x62ed('0x7')][_0x52d637['id']]=new MailAccount(_0x52d637);}else{_[_0x62ed('0xa')](_0x255448[_0x62ed('0x7')][_0x52d637['id']],_0x52d637);}}}return _0x255448['mailAccounts'];};};module[_0x62ed('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 42a8714..5df2434 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 _0xd1ca=['active','ListId','Imap','MailServerOut','Smtp','notify','Request','NotifyMailAccount','../client','getMailAccounts','service','email'];(function(_0x1071d6,_0x293323){var _0x4c6be4=function(_0x43a973){while(--_0x43a973){_0x1071d6['push'](_0x1071d6['shift']());}};_0x4c6be4(++_0x293323);}(_0xd1ca,0x140));var _0xad1c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xd1ca[_0x18ab2a];return _0x16dcee;};'use strict';var client=require(_0xad1c('0x0'));exports[_0xad1c('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name',_0xad1c('0x2'),_0xad1c('0x3'),_0xad1c('0x4'),'key',_0xad1c('0x5'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xad1c('0x6')},{'model':_0xad1c('0x7'),'as':_0xad1c('0x8')}]},'log':'getMailAccount'});};};exports[_0xad1c('0x9')]=function(_0x51b05c,_0x45bfc8){return client[_0xad1c('0xa')](_0xad1c('0xb'),{'account':{'id':_0x51b05c},'body':_0x45bfc8,'log':_0xad1c('0xb')});}; \ No newline at end of file +var _0x47c5=['GetMailAccount','name','service','active','key','TemplateId','MailServerIn','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x47c5,0x165));var _0x547c=function(_0x44edb0,_0x7a1d21){_0x44edb0=_0x44edb0-0x0;var _0x38dbd0=_0x47c5[_0x44edb0];return _0x38dbd0;};'use strict';var client=require(_0x547c('0x0'));exports[_0x547c('0x1')]=function(){return function(){return client[_0x547c('0x2')](_0x547c('0x3'),{'options':{'attributes':['id',_0x547c('0x4'),_0x547c('0x5'),'email',_0x547c('0x6'),_0x547c('0x7'),'ListId',_0x547c('0x8')],'raw':![],'include':[{'model':_0x547c('0x9'),'as':'Imap'},{'model':_0x547c('0xa'),'as':_0x547c('0xb')}]},'log':_0x547c('0xc')});};};exports[_0x547c('0xd')]=function(_0x12fb7d,_0x4ef079){return client[_0x547c('0x2')](_0x547c('0xe'),{'account':{'id':_0x12fb7d},'body':_0x4ef079,'log':_0x547c('0xe')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 0fc7750..e40e82f 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 _0xcf07=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x282952,_0x31a499){var _0x4bf0a2=function(_0x37fb5e){while(--_0x37fb5e){_0x282952['push'](_0x282952['shift']());}};_0x4bf0a2(++_0x31a499);}(_0xcf07,0x1bc));var _0x7cf0=function(_0x2c1aa8,_0x3e0609){_0x2c1aa8=_0x2c1aa8-0x0;var _0x4019f5=_0xcf07[_0x2c1aa8];return _0x4019f5;};'use strict';var client=require(_0x7cf0('0x0'));exports[_0x7cf0('0x1')]=function(){return client[_0x7cf0('0x2')](_0x7cf0('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7cf0('0x4')]},'log':_0x7cf0('0x5')});}; \ No newline at end of file +var _0x451c=['../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x4e1c3c,_0x2a8084){var _0x1c7150=function(_0x56daac){while(--_0x56daac){_0x4e1c3c['push'](_0x4e1c3c['shift']());}};_0x1c7150(++_0x2a8084);}(_0x451c,0x1f4));var _0xc451=function(_0x34875b,_0x2054f1){_0x34875b=_0x34875b-0x0;var _0x163ac3=_0x451c[_0x34875b];return _0x163ac3;};'use strict';var client=require(_0xc451('0x0'));exports[_0xc451('0x1')]=function(){return client[_0xc451('0x2')](_0xc451('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc451('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 58f8da6..eea29f6 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 4c65358..8ab1be9 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 _0x879f=['../../config/socketio','../../config/express','../../routes','once','log','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','redis','defaults','localhost','socket.io-redis','../../config/triggers','default'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x879f,0x176));var _0xf879=function(_0x294406,_0x19f0bc){_0x294406=_0x294406-0x0;var _0x2c29d5=_0x879f[_0x294406];return _0x2c29d5;};'use strict';var _=require(_0xf879('0x0'));var http=require(_0xf879('0x1'));var express=require(_0xf879('0x2'));var sticky=require(_0xf879('0x3'));var Redis=require(_0xf879('0x4'));var config=require(_0xf879('0x5'));var app=express();var server=http[_0xf879('0x6')](app);server[_0xf879('0x7')]=0xdbba0;if(sticky[_0xf879('0x8')](server,config[_0xf879('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0xf879('0xa'),'polling']});config[_0xf879('0xb')]=_[_0xf879('0xc')](config['redis'],{'host':_0xf879('0xd'),'port':0x18eb});socketio['adapter'](require(_0xf879('0xe'))({'pubClient':new Redis(config[_0xf879('0xb')]),'subClient':new Redis(config[_0xf879('0xb')])}));require(_0xf879('0xf'))[_0xf879('0x10')]();require(_0xf879('0x11'))[_0xf879('0x10')](socketio);require(_0xf879('0x12'))[_0xf879('0x10')](app);require(_0xf879('0x13'))[_0xf879('0x10')](app);}else{server[_0xf879('0x14')]('listening',function(){console[_0xf879('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xf879('0x9')]);});}exports=module[_0xf879('0x16')]=app; \ No newline at end of file +var _0x4249=['localhost','../../config/triggers','default','../../config/express','../../routes','once','listening','lodash','express','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults'];(function(_0x1314a3,_0x4f6e40){var _0x401e52=function(_0x30469a){while(--_0x30469a){_0x1314a3['push'](_0x1314a3['shift']());}};_0x401e52(++_0x4f6e40);}(_0x4249,0x1d3));var _0x9424=function(_0x3e3cdd,_0x22eed5){_0x3e3cdd=_0x3e3cdd-0x0;var _0x186821=_0x4249[_0x3e3cdd];return _0x186821;};'use strict';var _=require(_0x9424('0x0'));var http=require('http');var express=require(_0x9424('0x1'));var sticky=require('sticky-session');var Redis=require(_0x9424('0x2'));var config=require(_0x9424('0x3'));var app=express();var server=http[_0x9424('0x4')](app);server[_0x9424('0x5')]=0xdbba0;if(sticky[_0x9424('0x6')](server,config[_0x9424('0x7')])){var socketio=require(_0x9424('0x8'))(server,{'transports':[_0x9424('0x9'),_0x9424('0xa')]});config[_0x9424('0xb')]=_[_0x9424('0xc')](config['redis'],{'host':_0x9424('0xd'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x9424('0xb')]),'subClient':new Redis(config[_0x9424('0xb')])}));require(_0x9424('0xe'))[_0x9424('0xf')]();require('../../config/socketio')['default'](socketio);require(_0x9424('0x10'))[_0x9424('0xf')](app);require(_0x9424('0x11'))[_0x9424('0xf')](app);}else{server[_0x9424('0x12')](_0x9424('0x13'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9424('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 87638a3..8ff9fc0 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 _0x47ab=['exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','debug','rpc','error','message','catch'];(function(_0x5aa3bb,_0x5c3c35){var _0x3c3b72=function(_0x31d82a){while(--_0x31d82a){_0x5aa3bb['push'](_0x5aa3bb['shift']());}};_0x3c3b72(++_0x5c3c35);}(_0x47ab,0xeb));var _0xb47a=function(_0x2027b7,_0x548992){_0x2027b7=_0x2027b7-0x0;var _0x4a75a6=_0x47ab[_0x2027b7];return _0x4a75a6;};'use strict';var jayson=require(_0xb47a('0x0'));var BPromise=require(_0xb47a('0x1'));var logger=require(_0xb47a('0x2'))(_0xb47a('0x3'));var client=jayson['client'][_0xb47a('0x4')]({'port':0x2329});client[_0xb47a('0x5')]=function(_0x9b49fc,_0x112123){return new BPromise(function(_0x1b6301,_0xa0fef7){return client[_0xb47a('0x6')](_0x9b49fc,_0x112123)['then'](function(_0x36ea4d){logger[_0xb47a('0x7')](_0xb47a('0x8'),_0xb47a('0x3'),_0x9b49fc,_0x112123,_0x36ea4d);if(_0x36ea4d[_0xb47a('0x9')]){logger['error'](_0xb47a('0x8'),'routing',_0x9b49fc,_0x36ea4d[_0xb47a('0x9')][_0xb47a('0xa')],_0x112123);return _0xa0fef7(_0x36ea4d['error'][_0xb47a('0xa')]);}else{return _0x1b6301(_0x36ea4d['result']);}})[_0xb47a('0xb')](function(_0x1d53e2){logger[_0xb47a('0x9')]('rpc','routing',_0x9b49fc,_0x1d53e2,_0x112123);return _0xa0fef7(_0x1d53e2);});});};module[_0xb47a('0xc')]=client; \ No newline at end of file +var _0x05c4=['exports','bluebird','../../config/logger','routing','Request','request','then','debug','rpc','error','message','result','catch'];(function(_0x5ca86c,_0x264fa3){var _0x5a2816=function(_0x336f8d){while(--_0x336f8d){_0x5ca86c['push'](_0x5ca86c['shift']());}};_0x5a2816(++_0x264fa3);}(_0x05c4,0xde));var _0x405c=function(_0x3dc894,_0x612562){_0x3dc894=_0x3dc894-0x0;var _0x15ff52=_0x05c4[_0x3dc894];return _0x15ff52;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x405c('0x0'));var logger=require(_0x405c('0x1'))(_0x405c('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x405c('0x3')]=function(_0x180178,_0x17fd02){return new BPromise(function(_0x5197b7,_0x5dbeec){return client[_0x405c('0x4')](_0x180178,_0x17fd02)[_0x405c('0x5')](function(_0x4ab294){logger[_0x405c('0x6')](_0x405c('0x7'),_0x405c('0x2'),_0x180178,_0x17fd02,_0x4ab294);if(_0x4ab294['error']){logger[_0x405c('0x8')](_0x405c('0x7'),_0x405c('0x2'),_0x180178,_0x4ab294['error'][_0x405c('0x9')],_0x17fd02);return _0x5dbeec(_0x4ab294[_0x405c('0x8')][_0x405c('0x9')]);}else{return _0x5197b7(_0x4ab294[_0x405c('0xa')]);}})[_0x405c('0xb')](function(_0x41fbea){logger[_0x405c('0x8')]('rpc','routing',_0x180178,_0x41fbea,_0x17fd02);return _0x5dbeec(_0x41fbea);});});};module[_0x405c('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 41e0de0..7487e57 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 _0x2a75=['./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','initFaxQueues','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue'];(function(_0x22c597,_0x1b85f5){var _0x42ded4=function(_0x31cecc){while(--_0x31cecc){_0x22c597['push'](_0x22c597['shift']());}};_0x42ded4(++_0x1b85f5);}(_0x2a75,0x1c6));var _0x52a7=function(_0x57ad75,_0x440850){_0x57ad75=_0x57ad75-0x0;var _0xb168e3=_0x2a75[_0x57ad75];return _0xb168e3;};'use strict';var BPromise=require('bluebird');var server=require(_0x52a7('0x0'));var Realtime=require(_0x52a7('0x1'));var user=require(_0x52a7('0x2'));var interval=require(_0x52a7('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x52a7('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x52a7('0x5'));var faxQueue=require(_0x52a7('0x6'));var whatsappQueue=require(_0x52a7('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x52a7('0x8')](user['getAgents']())[_0x52a7('0x8')](realtime[_0x52a7('0x9')]())['then'](interval[_0x52a7('0xa')]())['then'](realtime[_0x52a7('0xb')]())[_0x52a7('0x8')](openchannelQueue[_0x52a7('0xc')]())['then'](realtime[_0x52a7('0xd')]())[_0x52a7('0x8')](chatQueue[_0x52a7('0xe')]())['then'](realtime['initChatQueues']())[_0x52a7('0x8')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x52a7('0x8')](mailQueue[_0x52a7('0xf')]())['then'](realtime[_0x52a7('0x10')]())['then'](faxQueue['getFaxQueues']())[_0x52a7('0x8')](realtime[_0x52a7('0x11')]())['then'](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())[_0x52a7('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x52a7('0x8')](function(_0x1b935e){return initRealtime();})[_0x52a7('0x8')](function(_0x467f92){return setInterval(initRealtime,0x1388);})[_0x52a7('0x12')](function(_0x33029f){console[_0x52a7('0x13')](_0x33029f);});}main(); \ No newline at end of file +var _0x51d3=['./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird'];(function(_0x1b5d50,_0x11c4f8){var _0x364975=function(_0x139b07){while(--_0x139b07){_0x1b5d50['push'](_0x1b5d50['shift']());}};_0x364975(++_0x11c4f8);}(_0x51d3,0x167));var _0x351d=function(_0x2ebc8c,_0x5a7993){_0x2ebc8c=_0x2ebc8c-0x0;var _0x39b033=_0x51d3[_0x2ebc8c];return _0x39b033;};'use strict';var BPromise=require(_0x351d('0x0'));var server=require('./server');var Realtime=require(_0x351d('0x1'));var user=require(_0x351d('0x2'));var interval=require(_0x351d('0x3'));var openchannelQueue=require(_0x351d('0x4'));var chatQueue=require(_0x351d('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x351d('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x351d('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x351d('0x8')](user[_0x351d('0x9')]())[_0x351d('0x8')](realtime[_0x351d('0xa')]())[_0x351d('0x8')](interval[_0x351d('0xb')]())[_0x351d('0x8')](realtime[_0x351d('0xc')]())[_0x351d('0x8')](openchannelQueue[_0x351d('0xd')]())[_0x351d('0x8')](realtime[_0x351d('0xe')]())['then'](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())['then'](smsQueue[_0x351d('0xf')]())[_0x351d('0x8')](realtime[_0x351d('0x10')]())[_0x351d('0x8')](mailQueue[_0x351d('0x11')]())[_0x351d('0x8')](realtime['initMailQueues']())[_0x351d('0x8')](faxQueue[_0x351d('0x12')]())[_0x351d('0x8')](realtime[_0x351d('0x13')]())['then'](whatsappQueue[_0x351d('0x14')]())['then'](realtime['initWhatsappQueues']())[_0x351d('0x8')](function(){return realtime;});}function main(){return server[_0x351d('0x15')](realtime)['then'](function(_0x3dc1e5){return initRealtime();})[_0x351d('0x8')](function(_0x3eb17d){return setInterval(initRealtime,0x1388);})[_0x351d('0x16')](function(_0x1883a9){console[_0x351d('0x17')](_0x1883a9);});}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 faf7293..e5a2c43 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x188719,_0x239a5a){var _0x2bcf5d=function(_0xfd71e7){while(--_0xfd71e7){_0x188719['push'](_0x188719['shift']());}};_0x2bcf5d(++_0x239a5a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x5fc3[_0x4226d6];return _0x19655b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x4f768a,_0x413685){var _0x4ab541=function(_0x213c3a){while(--_0x213c3a){_0x4f768a['push'](_0x4f768a['shift']());}};_0x4ab541(++_0x413685);}(_0x814b,0x1a2));var _0xb814=function(_0x2abf7f,_0x23b05a){_0x2abf7f=_0x2abf7f-0x0;var _0x248bce=_0x814b[_0x2abf7f];return _0x248bce;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9496aff..e6423fe 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 _0xfdb6=['client','http','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xfdb6,0x6c));var _0x6fdb=function(_0x552e26,_0x2e8829){_0x552e26=_0x552e26-0x0;var _0x20e344=_0xfdb6[_0x552e26];return _0x20e344;};'use strict';var BPromise=require(_0x6fdb('0x0'));var jayson=require(_0x6fdb('0x1'));var client=jayson[_0x6fdb('0x2')][_0x6fdb('0x3')]({'port':0x232b});function request(_0x46d994,_0x274422){return new BPromise(function(_0x3621fa,_0x36e46d){return client['request'](_0x46d994,_0x274422)[_0x6fdb('0x4')](function(_0x36c4e8){if(_0x36c4e8[_0x6fdb('0x5')]){return _0x36e46d(_0x36c4e8[_0x6fdb('0x5')][_0x6fdb('0x6')]);}else{return _0x3621fa(_0x36c4e8['result']);}})[_0x6fdb('0x7')](function(_0x2ca4ff){return _0x36e46d(_0x2ca4ff);});});}exports[_0x6fdb('0x8')]=function(_0x177ff7,_0xb88d4c){return request(_0x6fdb('0x9'),{'account':_0x177ff7,'message':_0xb88d4c});}; \ No newline at end of file +var _0x4165=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','error','result'];(function(_0x5a4fe4,_0x13daca){var _0x42aa6e=function(_0x42703c){while(--_0x42703c){_0x5a4fe4['push'](_0x5a4fe4['shift']());}};_0x42aa6e(++_0x13daca);}(_0x4165,0xec));var _0x5416=function(_0x47a3e3,_0x32c386){_0x47a3e3=_0x47a3e3-0x0;var _0x3f5029=_0x4165[_0x47a3e3];return _0x3f5029;};'use strict';var BPromise=require(_0x5416('0x0'));var jayson=require(_0x5416('0x1'));var client=jayson[_0x5416('0x2')][_0x5416('0x3')]({'port':0x232b});function request(_0x144d37,_0x301ff7){return new BPromise(function(_0x5747ca,_0x445d27){return client['request'](_0x144d37,_0x301ff7)[_0x5416('0x4')](function(_0x503d0a){if(_0x503d0a['error']){return _0x445d27(_0x503d0a[_0x5416('0x5')]['message']);}else{return _0x5747ca(_0x503d0a[_0x5416('0x6')]);}})['catch'](function(_0x3fe9a8){return _0x445d27(_0x3fe9a8);});});}exports[_0x5416('0x7')]=function(_0x11e195,_0x3b3245){return request(_0x5416('0x8'),{'account':_0x11e195,'message':_0x3b3245});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 96fda91..f2fef6d 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 _0xeddd=['moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','fax','sms','length','Status','StatusTime','toNumber','format','voicePause','openchannelPause','chatStatusTime','faxStatus','faxStatusTime','smsStatus','whatsappCurrentCapacity','openchannelStatus','stringify','user:save','exports','lodash'];(function(_0x438bcb,_0x1e61b4){var _0x17bfcc=function(_0x1f283c){while(--_0x1f283c){_0x438bcb['push'](_0x438bcb['shift']());}};_0x17bfcc(++_0x1e61b4);}(_0xeddd,0x1aa));var _0xdedd=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xeddd[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xdedd('0x0'));var moment=require(_0xdedd('0x1'));var md5=require(_0xdedd('0x2'));var Redis=require(_0xdedd('0x3'));var config=require('../../../config/environment');config[_0xdedd('0x4')]=_[_0xdedd('0x5')](config[_0xdedd('0x4')],{'host':_0xdedd('0x6'),'port':0x18eb});var io=require(_0xdedd('0x7'))(new Redis(config[_0xdedd('0x4')]));function Agent(_0x305017){this['id']=_0x305017['id']||0x0;this[_0xdedd('0x8')]=_0x305017[_0xdedd('0x8')]||'';this[_0xdedd('0x9')]=_0x305017[_0xdedd('0x9')]||!![];this['voicePause']=_0x305017['voicePause']||![];this[_0xdedd('0xa')]=_0x305017[_0xdedd('0xa')]||![];this[_0xdedd('0xb')]=_0x305017[_0xdedd('0xb')]||![];this[_0xdedd('0xc')]=_0x305017['faxPause']||![];this['smsPause']=_0x305017[_0xdedd('0xd')]||![];this['openchannelPause']=_0x305017['openchannelPause']||![];this[_0xdedd('0xe')]=_0xdedd('0xf');this['chatStatusTime']=0x0;this[_0xdedd('0x10')]=_0x305017[_0xdedd('0x10')]||0x0;this[_0xdedd('0x11')]=0x0;this[_0xdedd('0x12')]=_0xdedd('0xf');this['mailStatusTime']=0x0;this[_0xdedd('0x13')]=_0x305017[_0xdedd('0x13')]||0x0;this[_0xdedd('0x14')]=0x0;this['faxStatus']='unknown';this['faxStatusTime']=0x0;this[_0xdedd('0x15')]=_0x305017[_0xdedd('0x15')]||0x0;this[_0xdedd('0x16')]=0x0;this['smsStatus']=_0xdedd('0xf');this[_0xdedd('0x17')]=0x0;this['smsCapacity']=_0x305017[_0xdedd('0x18')]||0x0;this[_0xdedd('0x19')]=0x0;this[_0xdedd('0x1a')]=_0xdedd('0xf');this[_0xdedd('0x1b')]=0x0;this[_0xdedd('0x1c')]=_0x305017[_0xdedd('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xdedd('0xf');this[_0xdedd('0x1d')]=0x0;this[_0xdedd('0x1e')]=_0x305017[_0xdedd('0x1e')]||0x0;this[_0xdedd('0x1f')]=0x0;this[_0xdedd('0x20')]=![];this[_0xdedd('0x21')]=undefined;this[_0xdedd('0x2')]='';this[_0xdedd('0x22')]();}Agent[_0xdedd('0x23')][_0xdedd('0x24')]=function(_0x1ddfcf){if(this[_0x1ddfcf+_0xdedd('0x25')]>0x0){if(this[_0x1ddfcf+_0xdedd('0x26')]>0x0&&this[_0x1ddfcf+_0xdedd('0x25')]>=this[_0x1ddfcf+'Capacity']){return _0xdedd('0x27');}else{return _0xdedd('0x28');}}else{return'idle';}};Agent[_0xdedd('0x23')][_0xdedd('0x22')]=function(){var _0x521735=[_0xdedd('0x29'),_0xdedd('0x2a'),'openchannel',_0xdedd('0x2b'),_0xdedd('0x2c'),'whatsapp'];for(var _0x34075a=0x0;_0x34075a<_0x521735[_0xdedd('0x2d')];_0x34075a+=0x1){var _0x1f7a4c=this[_0xdedd('0x24')](_0x521735[_0x34075a]);if(this[_0x521735[_0x34075a]+_0xdedd('0x2e')]!==_0x1f7a4c){this[_0x521735[_0x34075a]+_0xdedd('0x2f')]=_[_0xdedd('0x30')](moment()[_0xdedd('0x31')]('x'));}this[_0x521735[_0x34075a]+'Status']=_0x1f7a4c;}var _0x2e1322={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xdedd('0x32')],'chatPause':this[_0xdedd('0xa')],'mailPause':this[_0xdedd('0xb')],'smsPause':this[_0xdedd('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0xdedd('0x33')],'chatStatus':this[_0xdedd('0xe')],'chatStatusTime':this[_0xdedd('0x34')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xdedd('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xdedd('0x13')],'mailCurrentCapacity':this[_0xdedd('0x14')],'faxStatus':this[_0xdedd('0x35')],'faxStatusTime':this[_0xdedd('0x36')],'faxCapacity':this[_0xdedd('0x15')],'faxCurrentCapacity':this[_0xdedd('0x16')],'smsStatus':this[_0xdedd('0x37')],'smsStatusTime':this[_0xdedd('0x17')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xdedd('0x1a')],'whatsappStatusTime':this[_0xdedd('0x1b')],'whatsappCapacity':this[_0xdedd('0x1c')],'whatsappCurrentCapacity':this[_0xdedd('0x38')],'openchannelStatus':this[_0xdedd('0x39')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xdedd('0x1e')],'openchannelCurrentCapacity':this[_0xdedd('0x1f')],'busy':this[_0xdedd('0x20')],'busyQueue':this[_0xdedd('0x21')]};var _0x306bfa=md5(JSON[_0xdedd('0x3a')](_0x2e1322));if(this['md5']!==_0x306bfa){this[_0xdedd('0x2')]=_0x306bfa;io['emit'](_0xdedd('0x3b'),_0x2e1322);}};module[_0xdedd('0x3c')]=Agent; \ No newline at end of file +var _0x0699=['whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','openchannel','fax','whatsapp','Status','StatusTime','mailStatusTime','faxStatusTime','smsStatusTime','whatsappCurrentCapacity','busyQueue','stringify','user:save','exports','lodash','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x0699,0x1db));var _0x9069=function(_0x40b2ea,_0x40aedf){_0x40b2ea=_0x40b2ea-0x0;var _0x124127=_0x0699[_0x40b2ea];return _0x124127;};'use strict';var _=require(_0x9069('0x0'));var moment=require('moment');var md5=require(_0x9069('0x1'));var Redis=require('ioredis');var config=require(_0x9069('0x2'));config[_0x9069('0x3')]=_[_0x9069('0x4')](config[_0x9069('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x9069('0x5'))(new Redis(config[_0x9069('0x3')]));function Agent(_0x166208){this['id']=_0x166208['id']||0x0;this[_0x9069('0x6')]=_0x166208[_0x9069('0x6')]||'';this[_0x9069('0x7')]=_0x166208[_0x9069('0x7')]||!![];this[_0x9069('0x8')]=_0x166208['voicePause']||![];this['chatPause']=_0x166208[_0x9069('0x9')]||![];this[_0x9069('0xa')]=_0x166208[_0x9069('0xa')]||![];this[_0x9069('0xb')]=_0x166208['faxPause']||![];this[_0x9069('0xc')]=_0x166208[_0x9069('0xc')]||![];this[_0x9069('0xd')]=_0x166208[_0x9069('0xd')]||![];this[_0x9069('0xe')]=_0x9069('0xf');this[_0x9069('0x10')]=0x0;this[_0x9069('0x11')]=_0x166208[_0x9069('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x9069('0x12')]=_0x9069('0xf');this['mailStatusTime']=0x0;this[_0x9069('0x13')]=_0x166208[_0x9069('0x13')]||0x0;this[_0x9069('0x14')]=0x0;this[_0x9069('0x15')]='unknown';this['faxStatusTime']=0x0;this[_0x9069('0x16')]=_0x166208['faxCapacity']||0x0;this[_0x9069('0x17')]=0x0;this[_0x9069('0x18')]=_0x9069('0xf');this['smsStatusTime']=0x0;this[_0x9069('0x19')]=_0x166208[_0x9069('0x19')]||0x0;this[_0x9069('0x1a')]=0x0;this[_0x9069('0x1b')]='unknown';this[_0x9069('0x1c')]=0x0;this[_0x9069('0x1d')]=_0x166208[_0x9069('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x9069('0x1e')]='unknown';this[_0x9069('0x1f')]=0x0;this[_0x9069('0x20')]=_0x166208['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x9069('0x21')]=![];this['busyQueue']=undefined;this[_0x9069('0x1')]='';this[_0x9069('0x22')]();}Agent[_0x9069('0x23')][_0x9069('0x24')]=function(_0x26cfce){if(this[_0x26cfce+_0x9069('0x25')]>0x0){if(this[_0x26cfce+_0x9069('0x26')]>0x0&&this[_0x26cfce+_0x9069('0x25')]>=this[_0x26cfce+'Capacity']){return _0x9069('0x27');}else{return _0x9069('0x28');}}else{return'idle';}};Agent[_0x9069('0x23')]['updateRealtime']=function(){var _0x3ab202=[_0x9069('0x29'),_0x9069('0x2a'),_0x9069('0x2b'),_0x9069('0x2c'),'sms',_0x9069('0x2d')];for(var _0x5eabf9=0x0;_0x5eabf9<_0x3ab202['length'];_0x5eabf9+=0x1){var _0x26c62f=this['getChannelStatus'](_0x3ab202[_0x5eabf9]);if(this[_0x3ab202[_0x5eabf9]+_0x9069('0x2e')]!==_0x26c62f){this[_0x3ab202[_0x5eabf9]+_0x9069('0x2f')]=_['toNumber'](moment()['format']('x'));}this[_0x3ab202[_0x5eabf9]+_0x9069('0x2e')]=_0x26c62f;}var _0x2728b4={'id':this['id'],'name':this[_0x9069('0x6')],'online':this[_0x9069('0x7')],'voicePause':this[_0x9069('0x8')],'chatPause':this[_0x9069('0x9')],'mailPause':this[_0x9069('0xa')],'smsPause':this[_0x9069('0xc')],'faxPause':this[_0x9069('0xb')],'openchannelPause':this[_0x9069('0xd')],'chatStatus':this[_0x9069('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x9069('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x9069('0x12')],'mailStatusTime':this[_0x9069('0x30')],'mailCapacity':this[_0x9069('0x13')],'mailCurrentCapacity':this[_0x9069('0x14')],'faxStatus':this[_0x9069('0x15')],'faxStatusTime':this[_0x9069('0x31')],'faxCapacity':this[_0x9069('0x16')],'faxCurrentCapacity':this[_0x9069('0x17')],'smsStatus':this[_0x9069('0x18')],'smsStatusTime':this[_0x9069('0x32')],'smsCapacity':this[_0x9069('0x19')],'smsCurrentCapacity':this[_0x9069('0x1a')],'whatsappStatus':this[_0x9069('0x1b')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x9069('0x1d')],'whatsappCurrentCapacity':this[_0x9069('0x33')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9069('0x1f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x9069('0x21')],'busyQueue':this[_0x9069('0x34')]};var _0x3eed8e=md5(JSON[_0x9069('0x35')](_0x2728b4));if(this[_0x9069('0x1')]!==_0x3eed8e){this['md5']=_0x3eed8e;io['emit'](_0x9069('0x36'),_0x2728b4);}};module[_0x9069('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index f7963bb..087b2e3 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 _0x0f04=['timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','available','stringify','format','emit','chat_queue:save','lodash','md5','../../../config/environment','redis','defaults','name'];(function(_0x24cf7f,_0xcda231){var _0x4c6742=function(_0x2469db){while(--_0x2469db){_0x24cf7f['push'](_0x24cf7f['shift']());}};_0x4c6742(++_0xcda231);}(_0x0f04,0xba));var _0x40f0=function(_0x1c319a,_0x7c0966){_0x1c319a=_0x1c319a-0x0;var _0x5a1067=_0x0f04[_0x1c319a];return _0x5a1067;};'use strict';var _=require(_0x40f0('0x0'));var md5=require(_0x40f0('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x40f0('0x2'));config[_0x40f0('0x3')]=_[_0x40f0('0x4')](config[_0x40f0('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x40f0('0x3')]));function ChatQueue(_0x69bf12){this['id']=_0x69bf12['id']||0x0;this[_0x40f0('0x5')]=_0x69bf12[_0x40f0('0x5')]||'';this[_0x40f0('0x6')]=_0x69bf12[_0x40f0('0x6')]||0xa;this[_0x40f0('0x7')]=_0x69bf12[_0x40f0('0x7')]||'beepall';this[_0x40f0('0x8')]=_0x69bf12[_0x40f0('0x8')];this[_0x40f0('0x9')]={};this[_0x40f0('0xa')]=0x0;this[_0x40f0('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x40f0('0xb')][_0x40f0('0xc')]=function(){var _0x4d5884=this[_0x40f0('0x9')][_0x40f0('0xd')];this[_0x40f0('0x9')]=_[_0x40f0('0xe')](this[_0x40f0('0x8')],'id');this['mapAgentsId'][_0x40f0('0xd')]=_0x4d5884;};ChatQueue[_0x40f0('0xb')]['updateRealtime']=function(){this[_0x40f0('0xf')]=0x0;this[_0x40f0('0x10')]=0x0;for(var _0x48bfe7=0x0;_0x48bfe7=0x0?this[_0x40f0('0x13')]:0x0;var _0x32eca0={'id':this['id'],'available':this[_0x40f0('0x13')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x40f0('0xa')]};var _0x174f79=md5(JSON[_0x40f0('0x14')](_0x32eca0));if(this['md5']!==_0x174f79){this[_0x40f0('0x1')]=_0x174f79;io['to'](util[_0x40f0('0x15')]('chat:queue:%s',_0x32eca0['name']))[_0x40f0('0x16')](_0x40f0('0x17'),_0x32eca0);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xfe98=['util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','lodash'];(function(_0x1ed776,_0x3417b5){var _0x470657=function(_0x37c61a){while(--_0x37c61a){_0x1ed776['push'](_0x1ed776['shift']());}};_0x470657(++_0x3417b5);}(_0xfe98,0x73));var _0x8fe9=function(_0x27332e,_0x247ad6){_0x27332e=_0x27332e-0x0;var _0x5882fc=_0xfe98[_0x27332e];return _0x5882fc;};'use strict';var _=require(_0x8fe9('0x0'));var md5=require('md5');var util=require(_0x8fe9('0x1'));var Redis=require(_0x8fe9('0x2'));var config=require(_0x8fe9('0x3'));config['redis']=_[_0x8fe9('0x4')](config[_0x8fe9('0x5')],{'host':_0x8fe9('0x6'),'port':0x18eb});var io=require(_0x8fe9('0x7'))(new Redis(config[_0x8fe9('0x5')]));function ChatQueue(_0x3d362d){this['id']=_0x3d362d['id']||0x0;this[_0x8fe9('0x8')]=_0x3d362d['name']||'';this[_0x8fe9('0x9')]=_0x3d362d[_0x8fe9('0x9')]||0xa;this[_0x8fe9('0xa')]=_0x3d362d[_0x8fe9('0xa')]||_0x8fe9('0xb');this[_0x8fe9('0xc')]=_0x3d362d['Agents'];this[_0x8fe9('0xd')]={};this[_0x8fe9('0xe')]=0x0;this[_0x8fe9('0xf')]='';this[_0x8fe9('0x10')]();this[_0x8fe9('0x11')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x1b15ac=this['mapAgentsId'][_0x8fe9('0x12')];this[_0x8fe9('0xd')]=_['map'](this[_0x8fe9('0xc')],'id');this[_0x8fe9('0xd')]['_rr']=_0x1b15ac;};ChatQueue[_0x8fe9('0x13')][_0x8fe9('0x11')]=function(){this[_0x8fe9('0x14')]=0x0;this[_0x8fe9('0x15')]=0x0;for(var _0x2a07fe=0x0;_0x2a07fe=0x0?this[_0x8fe9('0x18')]:0x0;var _0x2eda16={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8fe9('0x14')],'name':this[_0x8fe9('0x8')],'paused':this[_0x8fe9('0x15')],'waiting':this[_0x8fe9('0xe')]};var _0x50ec28=md5(JSON[_0x8fe9('0x19')](_0x2eda16));if(this[_0x8fe9('0xf')]!==_0x50ec28){this[_0x8fe9('0xf')]=_0x50ec28;io['to'](util[_0x8fe9('0x1a')](_0x8fe9('0x1b'),_0x2eda16['name']))[_0x8fe9('0x1c')]('chat_queue:save',_0x2eda16);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 097223f..d260a05 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 _0xb91e=['updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','online','faxPause','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting'];(function(_0x1657e6,_0x26f3ff){var _0x6e246b=function(_0x412de5){while(--_0x412de5){_0x1657e6['push'](_0x1657e6['shift']());}};_0x6e246b(++_0x26f3ff);}(_0xb91e,0x17a));var _0xeb91=function(_0x35cffd,_0x3e924f){_0x35cffd=_0x35cffd-0x0;var _0x265cf4=_0xb91e[_0x35cffd];return _0x265cf4;};'use strict';var _=require(_0xeb91('0x0'));var md5=require('md5');var util=require(_0xeb91('0x1'));var Redis=require(_0xeb91('0x2'));var config=require('../../../config/environment');config[_0xeb91('0x3')]=_[_0xeb91('0x4')](config[_0xeb91('0x3')],{'host':_0xeb91('0x5'),'port':0x18eb});var io=require(_0xeb91('0x6'))(new Redis(config[_0xeb91('0x3')]));function FaxQueue(_0xa67623){this['id']=_0xa67623['id']||0x0;this[_0xeb91('0x7')]=_0xa67623['name']||'';this[_0xeb91('0x8')]=_0xa67623[_0xeb91('0x8')]||0xa;this[_0xeb91('0x9')]=_0xa67623[_0xeb91('0x9')]||'beepall';this[_0xeb91('0xa')]=_0xa67623[_0xeb91('0xa')];this['mapAgentsId']={};this[_0xeb91('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xeb91('0xc')]();}FaxQueue[_0xeb91('0xd')][_0xeb91('0xe')]=function(){var _0x55c939=this[_0xeb91('0xf')][_0xeb91('0x10')];this[_0xeb91('0xf')]=_[_0xeb91('0x11')](this[_0xeb91('0xa')],'id');this['mapAgentsId'][_0xeb91('0x10')]=_0x55c939;};FaxQueue[_0xeb91('0xd')][_0xeb91('0xc')]=function(){this[_0xeb91('0x12')]=0x0;this[_0xeb91('0x13')]=0x0;for(var _0x2313bf=0x0;_0x2313bf=0x0?this[_0xeb91('0x16')]:0x0;var _0x480291={'id':this['id'],'available':this[_0xeb91('0x16')],'loggedIn':this[_0xeb91('0x12')],'name':this[_0xeb91('0x7')],'paused':this[_0xeb91('0x13')],'waiting':this[_0xeb91('0xb')]};var _0x4a1a2d=md5(JSON[_0xeb91('0x17')](_0x480291));if(this[_0xeb91('0x18')]!==_0x4a1a2d){this['md5']=_0x4a1a2d;io['to'](util[_0xeb91('0x19')](_0xeb91('0x1a'),_0x480291[_0xeb91('0x7')]))[_0xeb91('0x1b')](_0xeb91('0x1c'),_0x480291);}};module[_0xeb91('0x1d')]=FaxQueue; \ No newline at end of file +var _0x1327=['stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','available'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1327,0xad));var _0x7132=function(_0x56b034,_0xb96f9b){_0x56b034=_0x56b034-0x0;var _0x25f338=_0x1327[_0x56b034];return _0x25f338;};'use strict';var _=require(_0x7132('0x0'));var md5=require(_0x7132('0x1'));var util=require(_0x7132('0x2'));var Redis=require(_0x7132('0x3'));var config=require('../../../config/environment');config[_0x7132('0x4')]=_[_0x7132('0x5')](config[_0x7132('0x4')],{'host':_0x7132('0x6'),'port':0x18eb});var io=require(_0x7132('0x7'))(new Redis(config[_0x7132('0x4')]));function FaxQueue(_0x38bd83){this['id']=_0x38bd83['id']||0x0;this[_0x7132('0x8')]=_0x38bd83['name']||'';this[_0x7132('0x9')]=_0x38bd83[_0x7132('0x9')]||0xa;this[_0x7132('0xa')]=_0x38bd83['strategy']||_0x7132('0xb');this['Agents']=_0x38bd83[_0x7132('0xc')];this[_0x7132('0xd')]={};this[_0x7132('0xe')]=0x0;this['md5']='';this[_0x7132('0xf')]();this[_0x7132('0x10')]();}FaxQueue[_0x7132('0x11')][_0x7132('0xf')]=function(){var _0x156a57=this[_0x7132('0xd')][_0x7132('0x12')];this['mapAgentsId']=_['map'](this[_0x7132('0xc')],'id');this[_0x7132('0xd')][_0x7132('0x12')]=_0x156a57;};FaxQueue['prototype'][_0x7132('0x10')]=function(){this[_0x7132('0x13')]=0x0;this[_0x7132('0x14')]=0x0;for(var _0x352cc7=0x0;_0x352cc7=0x0?this['available']:0x0;var _0x87fd6d={'id':this['id'],'available':this[_0x7132('0x16')],'loggedIn':this[_0x7132('0x13')],'name':this['name'],'paused':this[_0x7132('0x14')],'waiting':this[_0x7132('0xe')]};var _0x5467c7=md5(JSON[_0x7132('0x17')](_0x87fd6d));if(this[_0x7132('0x1')]!==_0x5467c7){this[_0x7132('0x1')]=_0x5467c7;io['to'](util['format'](_0x7132('0x18'),_0x87fd6d[_0x7132('0x8')]))[_0x7132('0x19')](_0x7132('0x1a'),_0x87fd6d);}};module[_0x7132('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 fbb2e45..d8aa41a 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 _0x8396=['Intervals','exports','name'];(function(_0x5dd341,_0x14d420){var _0xdfba68=function(_0x363135){while(--_0x363135){_0x5dd341['push'](_0x5dd341['shift']());}};_0xdfba68(++_0x14d420);}(_0x8396,0xa1));var _0x6839=function(_0x23a170,_0x3d6440){_0x23a170=_0x23a170-0x0;var _0x49b4e7=_0x8396[_0x23a170];return _0x49b4e7;};'use strict';function Interval(_0x5bc79d){this['id']=_0x5bc79d['id']||0x0;this[_0x6839('0x0')]=_0x5bc79d[_0x6839('0x0')]||'';this[_0x6839('0x1')]=_0x5bc79d[_0x6839('0x1')]||{};}module[_0x6839('0x2')]=Interval; \ No newline at end of file +var _0xafa6=['Intervals','name'];(function(_0x5aef12,_0x1edd9d){var _0x245089=function(_0x11dafd){while(--_0x11dafd){_0x5aef12['push'](_0x5aef12['shift']());}};_0x245089(++_0x1edd9d);}(_0xafa6,0x81));var _0x6afa=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xafa6[_0x39e283];return _0x7de89f;};'use strict';function Interval(_0xa6168){this['id']=_0xa6168['id']||0x0;this[_0x6afa('0x0')]=_0xa6168[_0x6afa('0x0')]||'';this[_0x6afa('0x1')]=_0xa6168[_0x6afa('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 2280a5b..e4cfa2c 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 _0x0585=['updateRouting','updateRealtime','prototype','_rr','map','paused','online','loggedIn','mailPause','available','waiting','emit','exports','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x39cd91,_0x1c36fd){var _0x381a8e=function(_0x5a5abc){while(--_0x5a5abc){_0x39cd91['push'](_0x39cd91['shift']());}};_0x381a8e(++_0x1c36fd);}(_0x0585,0x18d));var _0x5058=function(_0x38ae14,_0x1e2d4a){_0x38ae14=_0x38ae14-0x0;var _0x4f28da=_0x0585[_0x38ae14];return _0x4f28da;};'use strict';var _=require('lodash');var md5=require(_0x5058('0x0'));var util=require(_0x5058('0x1'));var Redis=require(_0x5058('0x2'));var config=require(_0x5058('0x3'));config[_0x5058('0x4')]=_['defaults'](config[_0x5058('0x4')],{'host':_0x5058('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5058('0x4')]));function MailQueue(_0x5f11db){this['id']=_0x5f11db['id']||0x0;this[_0x5058('0x6')]=_0x5f11db[_0x5058('0x6')]||'';this[_0x5058('0x7')]=_0x5f11db[_0x5058('0x7')]||0xa;this[_0x5058('0x8')]=_0x5f11db['strategy']||'beepall';this[_0x5058('0x9')]=_0x5f11db[_0x5058('0x9')];this[_0x5058('0xa')]={};this['waiting']=0x0;this[_0x5058('0x0')]='';this[_0x5058('0xb')]();this[_0x5058('0xc')]();}MailQueue[_0x5058('0xd')][_0x5058('0xb')]=function(){var _0xd21519=this[_0x5058('0xa')][_0x5058('0xe')];this[_0x5058('0xa')]=_[_0x5058('0xf')](this['Agents'],'id');this[_0x5058('0xa')]['_rr']=_0xd21519;};MailQueue[_0x5058('0xd')][_0x5058('0xc')]=function(){this['loggedIn']=0x0;this[_0x5058('0x10')]=0x0;for(var _0x1adbfd=0x0;_0x1adbfd=0x0?this[_0x5058('0x14')]:0x0;var _0x5ee31d={'id':this['id'],'available':this[_0x5058('0x14')],'loggedIn':this[_0x5058('0x12')],'name':this[_0x5058('0x6')],'paused':this['paused'],'waiting':this[_0x5058('0x15')]};var _0x42a923=md5(JSON['stringify'](_0x5ee31d));if(this[_0x5058('0x0')]!==_0x42a923){this['md5']=_0x42a923;io['to'](util['format']('mail:queue:%s',_0x5ee31d['name']))[_0x5058('0x16')]('mail_queue:save',_0x5ee31d);}};module[_0x5058('0x17')]=MailQueue; \ No newline at end of file +var _0x4d5f=['available','stringify','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','paused','length','loggedIn','mailPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d5f,0x1e1));var _0xf4d5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4d5f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf4d5('0x0'));var md5=require(_0xf4d5('0x1'));var util=require(_0xf4d5('0x2'));var Redis=require(_0xf4d5('0x3'));var config=require('../../../config/environment');config[_0xf4d5('0x4')]=_[_0xf4d5('0x5')](config['redis'],{'host':_0xf4d5('0x6'),'port':0x18eb});var io=require(_0xf4d5('0x7'))(new Redis(config['redis']));function MailQueue(_0x2744ff){this['id']=_0x2744ff['id']||0x0;this['name']=_0x2744ff[_0xf4d5('0x8')]||'';this['timeout']=_0x2744ff[_0xf4d5('0x9')]||0xa;this[_0xf4d5('0xa')]=_0x2744ff['strategy']||'beepall';this[_0xf4d5('0xb')]=_0x2744ff[_0xf4d5('0xb')];this[_0xf4d5('0xc')]={};this[_0xf4d5('0xd')]=0x0;this[_0xf4d5('0x1')]='';this[_0xf4d5('0xe')]();this[_0xf4d5('0xf')]();}MailQueue['prototype'][_0xf4d5('0xe')]=function(){var _0x144d0f=this['mapAgentsId'][_0xf4d5('0x10')];this['mapAgentsId']=_[_0xf4d5('0x11')](this[_0xf4d5('0xb')],'id');this[_0xf4d5('0xc')]['_rr']=_0x144d0f;};MailQueue[_0xf4d5('0x12')][_0xf4d5('0xf')]=function(){this['loggedIn']=0x0;this[_0xf4d5('0x13')]=0x0;for(var _0x17b935=0x0;_0x17b935=0x0?this[_0xf4d5('0x17')]:0x0;var _0x44ec8b={'id':this['id'],'available':this[_0xf4d5('0x17')],'loggedIn':this[_0xf4d5('0x15')],'name':this[_0xf4d5('0x8')],'paused':this[_0xf4d5('0x13')],'waiting':this[_0xf4d5('0xd')]};var _0xd06ca8=md5(JSON[_0xf4d5('0x18')](_0x44ec8b));if(this[_0xf4d5('0x1')]!==_0xd06ca8){this[_0xf4d5('0x1')]=_0xd06ca8;io['to'](util['format'](_0xf4d5('0x19'),_0x44ec8b['name']))[_0xf4d5('0x1a')](_0xf4d5('0x1b'),_0x44ec8b);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 885bbcf..a618692 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(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x1261,0x144));var _0x1126=function(_0x273f92,_0x5e6ea2){_0x273f92=_0x273f92-0x0;var _0x38b53c=_0x1261[_0x273f92];return _0x38b53c;};'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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x219021,_0x5bb8c5){var _0x4255a2=function(_0x2a9d49){while(--_0x2a9d49){_0x219021['push'](_0x219021['shift']());}};_0x4255a2(++_0x5bb8c5);}(_0x814b,0x1a2));var _0xb814=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x814b[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 16c438d..cd15b2d 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 _0x1159=['loggedIn','paused','smsPause','available','waiting','stringify','md5','format','sms:queue:%s','sms_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','map','_rr','updateRealtime'];(function(_0x3c2d96,_0x30f14c){var _0x525be5=function(_0x25dd4e){while(--_0x25dd4e){_0x3c2d96['push'](_0x3c2d96['shift']());}};_0x525be5(++_0x30f14c);}(_0x1159,0xf3));var _0x9115=function(_0x4387cb,_0x9c01a5){_0x4387cb=_0x4387cb-0x0;var _0x103a86=_0x1159[_0x4387cb];return _0x103a86;};'use strict';var _=require(_0x9115('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9115('0x1'));var config=require(_0x9115('0x2'));config[_0x9115('0x3')]=_[_0x9115('0x4')](config[_0x9115('0x3')],{'host':_0x9115('0x5'),'port':0x18eb});var io=require(_0x9115('0x6'))(new Redis(config[_0x9115('0x3')]));function SmsQueue(_0x579e72){this['id']=_0x579e72['id']||0x0;this[_0x9115('0x7')]=_0x579e72[_0x9115('0x7')]||'';this[_0x9115('0x8')]=_0x579e72[_0x9115('0x8')]||0xa;this[_0x9115('0x9')]=_0x579e72[_0x9115('0x9')]||_0x9115('0xa');this['Agents']=_0x579e72[_0x9115('0xb')];this[_0x9115('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x9115('0xd')]();this['updateRealtime']();}SmsQueue[_0x9115('0xe')][_0x9115('0xd')]=function(){var _0x35f3fe=this[_0x9115('0xc')]['_rr'];this[_0x9115('0xc')]=_[_0x9115('0xf')](this[_0x9115('0xb')],'id');this[_0x9115('0xc')][_0x9115('0x10')]=_0x35f3fe;};SmsQueue[_0x9115('0xe')][_0x9115('0x11')]=function(){this[_0x9115('0x12')]=0x0;this[_0x9115('0x13')]=0x0;for(var _0x4b5d27=0x0;_0x4b5d27=0x0?this[_0x9115('0x15')]:0x0;var _0x157ad2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9115('0x12')],'name':this[_0x9115('0x7')],'paused':this[_0x9115('0x13')],'waiting':this[_0x9115('0x16')]};var _0x95ed4b=md5(JSON[_0x9115('0x17')](_0x157ad2));if(this[_0x9115('0x18')]!==_0x95ed4b){this[_0x9115('0x18')]=_0x95ed4b;io['to'](util[_0x9115('0x19')](_0x9115('0x1a'),_0x157ad2[_0x9115('0x7')]))['emit'](_0x9115('0x1b'),_0x157ad2);}};module[_0x9115('0x1c')]=SmsQueue; \ No newline at end of file +var _0xd737=['_rr','prototype','paused','length','online','smsPause','available','loggedIn','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','updateRouting','mapAgentsId','map'];(function(_0x5ee616,_0x244115){var _0x40998f=function(_0x478a86){while(--_0x478a86){_0x5ee616['push'](_0x5ee616['shift']());}};_0x40998f(++_0x244115);}(_0xd737,0x85));var _0x7d73=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xd737[_0xa1e2fd];return _0x218880;};'use strict';var _=require(_0x7d73('0x0'));var md5=require('md5');var util=require(_0x7d73('0x1'));var Redis=require('ioredis');var config=require(_0x7d73('0x2'));config[_0x7d73('0x3')]=_[_0x7d73('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7d73('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5c4a2c){this['id']=_0x5c4a2c['id']||0x0;this[_0x7d73('0x6')]=_0x5c4a2c[_0x7d73('0x6')]||'';this[_0x7d73('0x7')]=_0x5c4a2c[_0x7d73('0x7')]||0xa;this[_0x7d73('0x8')]=_0x5c4a2c[_0x7d73('0x8')]||_0x7d73('0x9');this[_0x7d73('0xa')]=_0x5c4a2c['Agents'];this['mapAgentsId']={};this[_0x7d73('0xb')]=0x0;this[_0x7d73('0xc')]='';this['updateRouting']();this[_0x7d73('0xd')]();}SmsQueue['prototype'][_0x7d73('0xe')]=function(){var _0x3e2d6e=this[_0x7d73('0xf')]['_rr'];this[_0x7d73('0xf')]=_[_0x7d73('0x10')](this['Agents'],'id');this[_0x7d73('0xf')][_0x7d73('0x11')]=_0x3e2d6e;};SmsQueue[_0x7d73('0x12')][_0x7d73('0xd')]=function(){this['loggedIn']=0x0;this[_0x7d73('0x13')]=0x0;for(var _0x499223=0x0;_0x499223=0x0?this[_0x7d73('0x17')]:0x0;var _0x50539e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7d73('0x18')],'name':this[_0x7d73('0x6')],'paused':this[_0x7d73('0x13')],'waiting':this[_0x7d73('0xb')]};var _0x593072=md5(JSON['stringify'](_0x50539e));if(this[_0x7d73('0xc')]!==_0x593072){this[_0x7d73('0xc')]=_0x593072;io['to'](util[_0x7d73('0x19')](_0x7d73('0x1a'),_0x50539e['name']))[_0x7d73('0x1b')](_0x7d73('0x1c'),_0x50539e);}};module[_0x7d73('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 836c61e..adb223f 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 _0x386a=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','loggedIn','paused','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x386a,0xb5));var _0xa386=function(_0x24be8a,_0xce3b20){_0x24be8a=_0x24be8a-0x0;var _0x2b4e1a=_0x386a[_0x24be8a];return _0x2b4e1a;};'use strict';var _=require(_0xa386('0x0'));var md5=require(_0xa386('0x1'));var util=require(_0xa386('0x2'));var Redis=require('ioredis');var config=require(_0xa386('0x3'));config[_0xa386('0x4')]=_[_0xa386('0x5')](config[_0xa386('0x4')],{'host':_0xa386('0x6'),'port':0x18eb});var io=require(_0xa386('0x7'))(new Redis(config[_0xa386('0x4')]));function WhatsappQueue(_0x507fc5){this['id']=_0x507fc5['id']||0x0;this[_0xa386('0x8')]=_0x507fc5['name']||'';this[_0xa386('0x9')]=_0x507fc5[_0xa386('0x9')]||0xa;this[_0xa386('0xa')]=_0x507fc5['strategy']||'beepall';this[_0xa386('0xb')]=_0x507fc5[_0xa386('0xb')];this[_0xa386('0xc')]={};this[_0xa386('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xa386('0xe')]();}WhatsappQueue[_0xa386('0xf')][_0xa386('0x10')]=function(){var _0x29e580=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xa386('0x11')](this[_0xa386('0xb')],'id');this[_0xa386('0xc')]['_rr']=_0x29e580;};WhatsappQueue[_0xa386('0xf')][_0xa386('0xe')]=function(){this[_0xa386('0x12')]=0x0;this[_0xa386('0x13')]=0x0;for(var _0x1c09e3=0x0;_0x1c09e3=0x0?this[_0xa386('0x15')]:0x0;var _0x3360f8={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa386('0x12')],'name':this[_0xa386('0x8')],'paused':this['paused'],'waiting':this[_0xa386('0xd')]};var _0x23f171=md5(JSON[_0xa386('0x16')](_0x3360f8));if(this[_0xa386('0x1')]!==_0x23f171){this[_0xa386('0x1')]=_0x23f171;io['to'](util[_0xa386('0x17')](_0xa386('0x18'),_0x3360f8[_0xa386('0x8')]))[_0xa386('0x19')]('whatsapp_queue:save',_0x3360f8);}};module[_0xa386('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xfdc1=['waiting','updateRouting','updateRealtime','prototype','_rr','map','mapAgentsId','paused','online','loggedIn','available','name','format','whatsapp:queue:%s','whatsapp_queue:save','exports','md5','defaults','redis','socket.io-emitter','timeout','strategy','beepall','Agents'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0xfdc1,0x160));var _0x1fdc=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0xfdc1[_0x285800];return _0x4b809e;};'use strict';var _=require('lodash');var md5=require(_0x1fdc('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x1fdc('0x1')](config[_0x1fdc('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x1fdc('0x3'))(new Redis(config[_0x1fdc('0x2')]));function WhatsappQueue(_0x250a94){this['id']=_0x250a94['id']||0x0;this['name']=_0x250a94['name']||'';this[_0x1fdc('0x4')]=_0x250a94['timeout']||0xa;this['strategy']=_0x250a94[_0x1fdc('0x5')]||_0x1fdc('0x6');this[_0x1fdc('0x7')]=_0x250a94['Agents'];this['mapAgentsId']={};this[_0x1fdc('0x8')]=0x0;this[_0x1fdc('0x0')]='';this[_0x1fdc('0x9')]();this[_0x1fdc('0xa')]();}WhatsappQueue[_0x1fdc('0xb')]['updateRouting']=function(){var _0x4ffdc8=this['mapAgentsId'][_0x1fdc('0xc')];this['mapAgentsId']=_[_0x1fdc('0xd')](this['Agents'],'id');this[_0x1fdc('0xe')][_0x1fdc('0xc')]=_0x4ffdc8;};WhatsappQueue[_0x1fdc('0xb')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x1fdc('0xf')]=0x0;for(var _0x5d52db=0x0;_0x5d52db=0x0?this[_0x1fdc('0x12')]:0x0;var _0x3ff379={'id':this['id'],'available':this[_0x1fdc('0x12')],'loggedIn':this['loggedIn'],'name':this[_0x1fdc('0x13')],'paused':this[_0x1fdc('0xf')],'waiting':this[_0x1fdc('0x8')]};var _0x8fa417=md5(JSON['stringify'](_0x3ff379));if(this[_0x1fdc('0x0')]!==_0x8fa417){this[_0x1fdc('0x0')]=_0x8fa417;io['to'](util[_0x1fdc('0x14')](_0x1fdc('0x15'),_0x3ff379[_0x1fdc('0x13')]))['emit'](_0x1fdc('0x16'),_0x3ff379);}};module[_0x1fdc('0x17')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 8831958..27fdc66 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x5daa4d,_0x660e39){var _0x5b14c7=function(_0x33a71c){while(--_0x33a71c){_0x5daa4d['push'](_0x5daa4d['shift']());}};_0x5b14c7(++_0x660e39);}(_0xb10b,0x12a));var _0xbb10=function(_0x1427e2,_0x5a60ba){_0x1427e2=_0x1427e2-0x0;var _0x3b2772=_0xb10b[_0x1427e2];return _0x3b2772;};'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 0c6404b..2698301 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 _0xb899=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x5a8430,_0x216d4c){var _0x2fd13f=function(_0x4a7364){while(--_0x4a7364){_0x5a8430['push'](_0x5a8430['shift']());}};_0x2fd13f(++_0x216d4c);}(_0xb899,0x18b));var _0x9b89=function(_0x432184,_0xe832cf){_0x432184=_0x432184-0x0;var _0xc4e3e6=_0xb899[_0x432184];return _0xc4e3e6;};'use strict';var client=require(_0x9b89('0x0'));exports[_0x9b89('0x1')]=function(_0x35d293,_0x5645ef){return client[_0x9b89('0x2')](_0x9b89('0x3'),{'body':_0x5645ef,'options':{'where':{'id':_0x35d293}},'log':_0x9b89('0x4')});};exports[_0x9b89('0x5')]=function(_0x2d98ad,_0x335e9d){return client['Request'](_0x9b89('0x6'),{'body':_0x335e9d,'options':{'where':{'id':_0x2d98ad}},'log':_0x9b89('0x7')});}; \ No newline at end of file +var _0x5a37=['../client','update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x470473,_0x4d9eb7){var _0x781cff=function(_0x96e08e){while(--_0x96e08e){_0x470473['push'](_0x470473['shift']());}};_0x781cff(++_0x4d9eb7);}(_0x5a37,0xde));var _0x75a3=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x5a37[_0x2fdce0];return _0x36f07e;};'use strict';var client=require(_0x75a3('0x0'));exports[_0x75a3('0x1')]=function(_0x344f7f,_0x5e72d6){return client[_0x75a3('0x2')]('UpdateChatInteraction',{'body':_0x5e72d6,'options':{'where':{'id':_0x344f7f}},'log':_0x75a3('0x3')});};exports[_0x75a3('0x4')]=function(_0x3e6cf9,_0x5656ca){return client[_0x75a3('0x2')](_0x75a3('0x5'),{'body':_0x5656ca,'options':{'where':{'id':_0x3e6cf9}},'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 3b8e9f7..339eec7 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 _0xb7d5=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0xd9d484,_0x24cfc5){var _0x498cff=function(_0x5891cb){while(--_0x5891cb){_0xd9d484['push'](_0xd9d484['shift']());}};_0x498cff(++_0x24cfc5);}(_0xb7d5,0xff));var _0x5b7d=function(_0x4991fa,_0x3c4802){_0x4991fa=_0x4991fa-0x0;var _0x43c96b=_0xb7d5[_0x4991fa];return _0x43c96b;};'use strict';var client=require(_0x5b7d('0x0'));exports['create']=function(_0x12eef0){return client[_0x5b7d('0x1')](_0x5b7d('0x2'),{'body':_0x12eef0,'log':_0x5b7d('0x3')});}; \ No newline at end of file +var _0x1f18=['Request','../client'];(function(_0x1ed1d8,_0x2b1eb7){var _0xb4e489=function(_0x15aad1){while(--_0x15aad1){_0x1ed1d8['push'](_0x1ed1d8['shift']());}};_0xb4e489(++_0x2b1eb7);}(_0x1f18,0x121));var _0x81f1=function(_0x1eff70,_0x47e56e){_0x1eff70=_0x1eff70-0x0;var _0x5c3103=_0x1f18[_0x1eff70];return _0x5c3103;};'use strict';var client=require(_0x81f1('0x0'));exports['create']=function(_0x1e8c49){return client[_0x81f1('0x1')]('CreateChatMessage',{'body':_0x1e8c49,'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 129a2fc..1507d36 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 _0x7a59=['name','timeout','strategy','User','online','chatPause','../client','GetChatQueue'];(function(_0x24fa8f,_0x56b265){var _0x380153=function(_0x182363){while(--_0x182363){_0x24fa8f['push'](_0x24fa8f['shift']());}};_0x380153(++_0x56b265);}(_0x7a59,0x16e));var _0x97a5=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x7a59[_0xfa634c];return _0x73e478;};'use strict';var client=require(_0x97a5('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x97a5('0x1'),{'options':{'raw':![],'attributes':['id',_0x97a5('0x2'),_0x97a5('0x3'),_0x97a5('0x4')],'include':[{'model':_0x97a5('0x5'),'as':'Agents','attributes':['id',_0x97a5('0x2'),_0x97a5('0x6'),_0x97a5('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x0ec6=['chatPause','getChatQueues','../client','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x5e4e99,_0x410870){var _0x200520=function(_0x4af77c){while(--_0x4af77c){_0x5e4e99['push'](_0x5e4e99['shift']());}};_0x200520(++_0x410870);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x4603ee,_0x461354){_0x4603ee=_0x4603ee-0x0;var _0x542176=_0x0ec6[_0x4603ee];return _0x542176;};'use strict';var client=require(_0x60ec('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x60ec('0x1'),{'options':{'raw':![],'attributes':['id',_0x60ec('0x2'),_0x60ec('0x3'),_0x60ec('0x4')],'include':[{'model':_0x60ec('0x5'),'as':_0x60ec('0x6'),'attributes':['id',_0x60ec('0x2'),'online',_0x60ec('0x7')]}]},'log':_0x60ec('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ef2480a..71ef980 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 _0x5db8=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client','create'];(function(_0x858f4,_0x5c636d){var _0x26db05=function(_0x495683){while(--_0x495683){_0x858f4['push'](_0x858f4['shift']());}};_0x26db05(++_0x5c636d);}(_0x5db8,0xbb));var _0x85db=function(_0x400766,_0x368660){_0x400766=_0x400766-0x0;var _0x3ae58b=_0x5db8[_0x400766];return _0x3ae58b;};'use strict';var client=require(_0x85db('0x0'));exports[_0x85db('0x1')]=function(_0x2d48b1){return client['Request'](_0x85db('0x2'),{'body':_0x2d48b1,'log':_0x85db('0x2')});};exports[_0x85db('0x3')]=function(_0x491c88,_0x5b7426){return client[_0x85db('0x4')](_0x85db('0x5'),{'body':_0x5b7426,'options':{'where':{'uniqueid':_0x491c88},'order':[['id',_0x85db('0x6')]],'limit':0x1},'log':_0x85db('0x5')});}; \ No newline at end of file +var _0x7eb9=['update','UpdateChatQueueReport','../client','Request','CreateChatQueueReport'];(function(_0x2f4cef,_0xc69f42){var _0x4e0f47=function(_0x54b354){while(--_0x54b354){_0x2f4cef['push'](_0x2f4cef['shift']());}};_0x4e0f47(++_0xc69f42);}(_0x7eb9,0xd9));var _0x97eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7eb9[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0x97eb('0x0'));exports['create']=function(_0x4d9b00){return client[_0x97eb('0x1')]('CreateChatQueueReport',{'body':_0x4d9b00,'log':_0x97eb('0x2')});};exports[_0x97eb('0x3')]=function(_0x67960,_0x130bf4){return client['Request'](_0x97eb('0x4'),{'body':_0x130bf4,'options':{'where':{'uniqueid':_0x67960},'order':[['id','DESC']],'limit':0x1},'log':_0x97eb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 96d118e..1f2cf00 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0x7a54,0x106));var _0x47a5=function(_0x29e9b8,_0x27edf2){_0x29e9b8=_0x29e9b8-0x0;var _0x8c73c3=_0x7a54[_0x29e9b8];return _0x8c73c3;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x145042,_0x458dd4){var _0x214a0c=function(_0x4c88ac){while(--_0x4c88ac){_0x145042['push'](_0x145042['shift']());}};_0x214a0c(++_0x458dd4);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 fd7bd74..d091a51 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 _0x7a8a=['Request','CreateFaxMessage','create'];(function(_0x218a44,_0xbfe8d3){var _0xecc78c=function(_0xd83fe5){while(--_0xd83fe5){_0x218a44['push'](_0x218a44['shift']());}};_0xecc78c(++_0xbfe8d3);}(_0x7a8a,0x158));var _0xa7a8=function(_0x5d8829,_0x2b2212){_0x5d8829=_0x5d8829-0x0;var _0x168e29=_0x7a8a[_0x5d8829];return _0x168e29;};'use strict';var client=require('../client');exports[_0xa7a8('0x0')]=function(_0x590594){return client[_0xa7a8('0x1')](_0xa7a8('0x2'),{'body':_0x590594,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xa8a0=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x5dce0b,_0x14b2a7){var _0x238fb7=function(_0x4c7cae){while(--_0x4c7cae){_0x5dce0b['push'](_0x5dce0b['shift']());}};_0x238fb7(++_0x14b2a7);}(_0xa8a0,0x18e));var _0x0a8a=function(_0x335650,_0x4f6537){_0x335650=_0x335650-0x0;var _0x8a607e=_0xa8a0[_0x335650];return _0x8a607e;};'use strict';var client=require(_0x0a8a('0x0'));exports['create']=function(_0x2296c2){return client[_0x0a8a('0x1')](_0x0a8a('0x2'),{'body':_0x2296c2,'log':_0x0a8a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9cb9d10..b0755f7 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 _0x5341=['timeout','User','name','online','faxPause','getFaxQueues','../client','Request'];(function(_0x21d1e7,_0x346ace){var _0x12aa1b=function(_0x4f59ca){while(--_0x4f59ca){_0x21d1e7['push'](_0x21d1e7['shift']());}};_0x12aa1b(++_0x346ace);}(_0x5341,0x106));var _0x1534=function(_0x256011,_0xbcd132){_0x256011=_0x256011-0x0;var _0x42f463=_0x5341[_0x256011];return _0x42f463;};'use strict';var client=require(_0x1534('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x1534('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x1534('0x2'),'strategy'],'include':[{'model':_0x1534('0x3'),'as':'Agents','attributes':['id',_0x1534('0x4'),_0x1534('0x5'),_0x1534('0x6')]}]},'log':_0x1534('0x7')});};}; \ No newline at end of file +var _0x839f=['Request','GetFaxQueue','timeout','strategy','User','Agents','name','online','../client','getFaxQueues'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x839f,0x17a));var _0xf839=function(_0x206f6b,_0x25df2c){_0x206f6b=_0x206f6b-0x0;var _0x81232c=_0x839f[_0x206f6b];return _0x81232c;};'use strict';var client=require(_0xf839('0x0'));exports[_0xf839('0x1')]=function(){return function(){return client[_0xf839('0x2')](_0xf839('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xf839('0x4'),_0xf839('0x5')],'include':[{'model':_0xf839('0x6'),'as':_0xf839('0x7'),'attributes':['id',_0xf839('0x8'),_0xf839('0x9'),'faxPause']}]},'log':_0xf839('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 0e7ffbb..788edab 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 _0x4710=['Request','UpdateFaxQueueReport','DESC','../client','CreateFaxQueueReport','update'];(function(_0x1f686f,_0x4ebd0e){var _0x41d071=function(_0x327adb){while(--_0x327adb){_0x1f686f['push'](_0x1f686f['shift']());}};_0x41d071(++_0x4ebd0e);}(_0x4710,0x1ad));var _0x0471=function(_0x412ae9,_0x5cc7c9){_0x412ae9=_0x412ae9-0x0;var _0x1ac1d7=_0x4710[_0x412ae9];return _0x1ac1d7;};'use strict';var client=require(_0x0471('0x0'));exports['create']=function(_0x4d633a){return client['Request'](_0x0471('0x1'),{'body':_0x4d633a,'log':_0x0471('0x1')});};exports[_0x0471('0x2')]=function(_0x5765c3,_0x30e8bf){return client[_0x0471('0x3')](_0x0471('0x4'),{'body':_0x30e8bf,'options':{'where':{'uniqueid':_0x5765c3},'order':[['id',_0x0471('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x5e53=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x4f51e2,_0x4508cd){var _0x3d1fd6=function(_0x17ca41){while(--_0x17ca41){_0x4f51e2['push'](_0x4f51e2['shift']());}};_0x3d1fd6(++_0x4508cd);}(_0x5e53,0xa7));var _0x35e5=function(_0x392c21,_0x107410){_0x392c21=_0x392c21-0x0;var _0x1af4ca=_0x5e53[_0x392c21];return _0x1af4ca;};'use strict';var client=require(_0x35e5('0x0'));exports[_0x35e5('0x1')]=function(_0x5257ae){return client[_0x35e5('0x2')]('CreateFaxQueueReport',{'body':_0x5257ae,'log':_0x35e5('0x3')});};exports[_0x35e5('0x4')]=function(_0x13e0f0,_0x4a4b15){return client[_0x35e5('0x2')](_0x35e5('0x5'),{'body':_0x4a4b15,'options':{'where':{'uniqueid':_0x13e0f0},'order':[['id',_0x35e5('0x6')]],'limit':0x1},'log':_0x35e5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b616ba4..dc38941 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 _0xef13=['../client','Request','GetInterval','Intervals','interval','getIntervals'];(function(_0x2e9612,_0x3f26e5){var _0x126f1e=function(_0x4041f6){while(--_0x4041f6){_0x2e9612['push'](_0x2e9612['shift']());}};_0x126f1e(++_0x3f26e5);}(_0xef13,0x1ce));var _0x3ef1=function(_0x46060a,_0x3ca70b){_0x46060a=_0x46060a-0x0;var _0x32fd79=_0xef13[_0x46060a];return _0x32fd79;};'use strict';var client=require(_0x3ef1('0x0'));exports['getIntervals']=function(){return function(){return client[_0x3ef1('0x1')](_0x3ef1('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x3ef1('0x3'),'attributes':['id','name',_0x3ef1('0x4')]}]},'log':_0x3ef1('0x5')});};}; \ No newline at end of file +var _0xcda4=['../client','getIntervals','Request','GetInterval','Intervals','name','interval'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xcda4,0x165));var _0x4cda=function(_0x5e27d4,_0x13bf49){_0x5e27d4=_0x5e27d4-0x0;var _0x91e3f3=_0xcda4[_0x5e27d4];return _0x91e3f3;};'use strict';var client=require(_0x4cda('0x0'));exports[_0x4cda('0x1')]=function(){return function(){return client[_0x4cda('0x2')](_0x4cda('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x4cda('0x4'),'attributes':['id',_0x4cda('0x5'),_0x4cda('0x6')]}]},'log':_0x4cda('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b34bc34..c8e951f 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 _0x77e6=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x4d1101,_0x415b12){var _0x4fe135=function(_0x2266c1){while(--_0x2266c1){_0x4d1101['push'](_0x4d1101['shift']());}};_0x4fe135(++_0x415b12);}(_0x77e6,0x1a6));var _0x677e=function(_0x11369e,_0x3ea6cf){_0x11369e=_0x11369e-0x0;var _0x21eb9f=_0x77e6[_0x11369e];return _0x21eb9f;};'use strict';var client=require(_0x677e('0x0'));exports[_0x677e('0x1')]=function(_0x3855c7,_0xa48f0c){return client[_0x677e('0x2')](_0x677e('0x3'),{'body':_0xa48f0c,'options':{'where':{'id':_0x3855c7}},'log':_0x677e('0x4')});};exports[_0x677e('0x5')]=function(_0x50231c,_0x2f0307){return client[_0x677e('0x2')]('AddTagsToMailInteraction',{'body':_0x2f0307,'options':{'where':{'id':_0x50231c}},'log':_0x677e('0x6')});}; \ No newline at end of file +var _0x3266=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x102577,_0x22e8d6){var _0x48eb7f=function(_0x83a6d2){while(--_0x83a6d2){_0x102577['push'](_0x102577['shift']());}};_0x48eb7f(++_0x22e8d6);}(_0x3266,0x6a));var _0x6326=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x3266[_0x243217];return _0x478029;};'use strict';var client=require(_0x6326('0x0'));exports[_0x6326('0x1')]=function(_0x3a3ebd,_0x2bed83){return client[_0x6326('0x2')](_0x6326('0x3'),{'body':_0x2bed83,'options':{'where':{'id':_0x3a3ebd}},'log':_0x6326('0x4')});};exports[_0x6326('0x5')]=function(_0x265264,_0x5a6b4d){return client[_0x6326('0x2')]('AddTagsToMailInteraction',{'body':_0x5a6b4d,'options':{'where':{'id':_0x265264}},'log':_0x6326('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 234c4a1..7774707 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 _0x883e=['createMailMessage','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x883e,0x103));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xe883('0x0')]=function(_0xd30436){return client[_0xe883('0x1')]('CreateMailMessage',{'body':_0xd30436,'log':_0xe883('0x2')});}; \ No newline at end of file +var _0xbd4f=['../client','Request','CreateMailMessage'];(function(_0x3f9dfd,_0x206d4e){var _0x5e89e2=function(_0x52437d){while(--_0x52437d){_0x3f9dfd['push'](_0x3f9dfd['shift']());}};_0x5e89e2(++_0x206d4e);}(_0xbd4f,0x17d));var _0xfbd4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xbd4f[_0x5f1391];return _0x50ebe3;};'use strict';var client=require(_0xfbd4('0x0'));exports['create']=function(_0x2a3b20){return client[_0xfbd4('0x1')](_0xfbd4('0x2'),{'body':_0x2a3b20,'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 6a18cd2..6f8f867 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 _0xcc8e=['online','../client','getMailQueues','Request','GetMailQueue','name','timeout','User','Agents'];(function(_0x106da6,_0x46b581){var _0x54ed5b=function(_0x522b8c){while(--_0x522b8c){_0x106da6['push'](_0x106da6['shift']());}};_0x54ed5b(++_0x46b581);}(_0xcc8e,0x6d));var _0xecc8=function(_0x5f2f93,_0x1d772b){_0x5f2f93=_0x5f2f93-0x0;var _0x2a3d1b=_0xcc8e[_0x5f2f93];return _0x2a3d1b;};'use strict';var client=require(_0xecc8('0x0'));exports[_0xecc8('0x1')]=function(){return function(){return client[_0xecc8('0x2')](_0xecc8('0x3'),{'options':{'raw':![],'attributes':['id',_0xecc8('0x4'),_0xecc8('0x5'),'strategy'],'include':[{'model':_0xecc8('0x6'),'as':_0xecc8('0x7'),'attributes':['id',_0xecc8('0x4'),_0xecc8('0x8'),'mailPause']}]},'log':_0xecc8('0x1')});};}; \ No newline at end of file +var _0xcfd3=['name','timeout','strategy','User','Agents','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xcfd3,0x150));var _0x3cfd=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xcfd3[_0xf2f332];return _0x56cce3;};'use strict';var client=require(_0x3cfd('0x0'));exports[_0x3cfd('0x1')]=function(){return function(){return client[_0x3cfd('0x2')](_0x3cfd('0x3'),{'options':{'raw':![],'attributes':['id',_0x3cfd('0x4'),_0x3cfd('0x5'),_0x3cfd('0x6')],'include':[{'model':_0x3cfd('0x7'),'as':_0x3cfd('0x8'),'attributes':['id',_0x3cfd('0x4'),'online',_0x3cfd('0x9')]}]},'log':_0x3cfd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 93f5819..a4b6fd7 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 _0xb02f=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','create'];(function(_0x106620,_0x50af77){var _0x1e4531=function(_0x169a6c){while(--_0x169a6c){_0x106620['push'](_0x106620['shift']());}};_0x1e4531(++_0x50af77);}(_0xb02f,0xb3));var _0xfb02=function(_0x57e964,_0xfa01ca){_0x57e964=_0x57e964-0x0;var _0xef5766=_0xb02f[_0x57e964];return _0xef5766;};'use strict';var client=require('../client');exports[_0xfb02('0x0')]=function(_0x1702e9){return client[_0xfb02('0x1')]('CreateMailQueueReport',{'body':_0x1702e9,'log':_0xfb02('0x2')});};exports[_0xfb02('0x3')]=function(_0x45ed0a,_0x3574c2){return client['Request'](_0xfb02('0x4'),{'body':_0x3574c2,'options':{'where':{'uniqueid':_0x45ed0a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xe31b=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x5cd2ab,_0x2d162b){var _0x4663db=function(_0x54a66d){while(--_0x54a66d){_0x5cd2ab['push'](_0x5cd2ab['shift']());}};_0x4663db(++_0x2d162b);}(_0xe31b,0x13b));var _0xbe31=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0xe31b[_0x4e198a];return _0xb84bfe;};'use strict';var client=require(_0xbe31('0x0'));exports[_0xbe31('0x1')]=function(_0x349301){return client[_0xbe31('0x2')](_0xbe31('0x3'),{'body':_0x349301,'log':'CreateMailQueueReport'});};exports[_0xbe31('0x4')]=function(_0xa37397,_0x1169a2){return client[_0xbe31('0x2')](_0xbe31('0x5'),{'body':_0x1169a2,'options':{'where':{'uniqueid':_0xa37397},'order':[['id',_0xbe31('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2bccce9..6c098e9 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 _0x7bf6=['update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x7bf6,0xaf));var _0x67bf=function(_0x53080c,_0x19cee7){_0x53080c=_0x53080c-0x0;var _0x29d868=_0x7bf6[_0x53080c];return _0x29d868;};'use strict';var client=require('../client');exports[_0x67bf('0x0')]=function(_0x2d0711,_0x49d4ec){return client['Request'](_0x67bf('0x1'),{'body':_0x49d4ec,'options':{'where':{'id':_0x2d0711}},'log':_0x67bf('0x2')});};exports[_0x67bf('0x3')]=function(_0x21f38b,_0x262a6f){return client[_0x67bf('0x4')](_0x67bf('0x5'),{'body':_0x262a6f,'options':{'where':{'id':_0x21f38b}},'log':_0x67bf('0x6')});}; \ No newline at end of file +var _0x6d40=['update','Request','updateOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x2842b4,_0x2b1b7b){var _0x2b9521=function(_0x3613b8){while(--_0x3613b8){_0x2842b4['push'](_0x2842b4['shift']());}};_0x2b9521(++_0x2b1b7b);}(_0x6d40,0xfe));var _0x06d4=function(_0x5022a7,_0x4ca0a4){_0x5022a7=_0x5022a7-0x0;var _0x48476d=_0x6d40[_0x5022a7];return _0x48476d;};'use strict';var client=require(_0x06d4('0x0'));exports[_0x06d4('0x1')]=function(_0x46aea4,_0x1fe612){return client[_0x06d4('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1fe612,'options':{'where':{'id':_0x46aea4}},'log':_0x06d4('0x3')});};exports['addTags']=function(_0x21de56,_0x575179){return client[_0x06d4('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x575179,'options':{'where':{'id':_0x21de56}},'log':_0x06d4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7476ef5..754a108 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 _0x5e1a=['../client','create'];(function(_0x2550a2,_0x3ecb2a){var _0xfef3e5=function(_0x3236db){while(--_0x3236db){_0x2550a2['push'](_0x2550a2['shift']());}};_0xfef3e5(++_0x3ecb2a);}(_0x5e1a,0xd6));var _0xa5e1=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x5e1a[_0x5ac0f0];return _0x4aceec;};'use strict';var client=require(_0xa5e1('0x0'));exports[_0xa5e1('0x1')]=function(_0x893dc0){return client['Request']('CreateOpenchannelMessage',{'body':_0x893dc0,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x088b=['Request','CreateOpenchannelMessage','../client'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x088b,0x11f));var _0xb088=function(_0xf9cc12,_0x8a5a90){_0xf9cc12=_0xf9cc12-0x0;var _0x1827fa=_0x088b[_0xf9cc12];return _0x1827fa;};'use strict';var client=require(_0xb088('0x0'));exports['create']=function(_0x120562){return client[_0xb088('0x1')](_0xb088('0x2'),{'body':_0x120562,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 304de14..b76e318 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 _0xab6d=['Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x4df33d,_0x580bd7){var _0x1705f0=function(_0x5cd5b2){while(--_0x5cd5b2){_0x4df33d['push'](_0x4df33d['shift']());}};_0x1705f0(++_0x580bd7);}(_0xab6d,0x7b));var _0xdab6=function(_0x365585,_0x28e337){_0x365585=_0x365585-0x0;var _0x3e6772=_0xab6d[_0x365585];return _0x3e6772;};'use strict';var client=require(_0xdab6('0x0'));exports[_0xdab6('0x1')]=function(){return function(){return client[_0xdab6('0x2')](_0xdab6('0x3'),{'options':{'raw':![],'attributes':['id',_0xdab6('0x4'),_0xdab6('0x5'),_0xdab6('0x6')],'include':[{'model':'User','as':_0xdab6('0x7'),'attributes':['id',_0xdab6('0x4'),_0xdab6('0x8'),_0xdab6('0x9')]}]},'log':_0xdab6('0x1')});};}; \ No newline at end of file +var _0x096a=['name','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout','User','Agents'];(function(_0x25606b,_0x316198){var _0x5341e2=function(_0xf98759){while(--_0xf98759){_0x25606b['push'](_0x25606b['shift']());}};_0x5341e2(++_0x316198);}(_0x096a,0x1b2));var _0xa096=function(_0x3253fc,_0x444541){_0x3253fc=_0x3253fc-0x0;var _0x501d87=_0x096a[_0x3253fc];return _0x501d87;};'use strict';var client=require(_0xa096('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xa096('0x1')](_0xa096('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xa096('0x3'),'strategy'],'include':[{'model':_0xa096('0x4'),'as':_0xa096('0x5'),'attributes':['id',_0xa096('0x6'),_0xa096('0x7'),_0xa096('0x8')]}]},'log':_0xa096('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 10dc493..557f2d3 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 _0x167a=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0xadb9c3,_0x1f3b9e){var _0x3c3338=function(_0x102252){while(--_0x102252){_0xadb9c3['push'](_0xadb9c3['shift']());}};_0x3c3338(++_0x1f3b9e);}(_0x167a,0x187));var _0xa167=function(_0x5f3284,_0x45d632){_0x5f3284=_0x5f3284-0x0;var _0xac5faa=_0x167a[_0x5f3284];return _0xac5faa;};'use strict';var client=require(_0xa167('0x0'));exports[_0xa167('0x1')]=function(_0x2c3fed){return client[_0xa167('0x2')](_0xa167('0x3'),{'body':_0x2c3fed,'log':'CreateOpenchannelQueueReport'});};exports[_0xa167('0x4')]=function(_0x313c8a,_0x35622e){return client['Request'](_0xa167('0x5'),{'body':_0x35622e,'options':{'where':{'uniqueid':_0x313c8a},'order':[['id',_0xa167('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x64c2=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x64c2,0x178));var _0x264c=function(_0x207ce2,_0x4531d9){_0x207ce2=_0x207ce2-0x0;var _0x50767a=_0x64c2[_0x207ce2];return _0x50767a;};'use strict';var client=require(_0x264c('0x0'));exports['create']=function(_0x1e0c74){return client[_0x264c('0x1')](_0x264c('0x2'),{'body':_0x1e0c74,'log':_0x264c('0x2')});};exports[_0x264c('0x3')]=function(_0x18cbe4,_0xbba7ba){return client[_0x264c('0x1')](_0x264c('0x4'),{'body':_0xbba7ba,'options':{'where':{'uniqueid':_0x18cbe4},'order':[['id',_0x264c('0x5')]],'limit':0x1},'log':_0x264c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 91dc64d..1c9b095 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 _0x0f89=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction'];(function(_0x59d866,_0x55657c){var _0x43b7cc=function(_0x5dd449){while(--_0x5dd449){_0x59d866['push'](_0x59d866['shift']());}};_0x43b7cc(++_0x55657c);}(_0x0f89,0x111));var _0x90f8=function(_0x5a2eaf,_0x122fe5){_0x5a2eaf=_0x5a2eaf-0x0;var _0x37cc99=_0x0f89[_0x5a2eaf];return _0x37cc99;};'use strict';var client=require(_0x90f8('0x0'));exports[_0x90f8('0x1')]=function(_0xb9dd7b,_0x5a99af){return client[_0x90f8('0x2')](_0x90f8('0x3'),{'body':_0x5a99af,'options':{'where':{'id':_0xb9dd7b}},'log':_0x90f8('0x4')});};exports[_0x90f8('0x5')]=function(_0x518478,_0x7211af){return client[_0x90f8('0x2')]('AddTagsToSmsInteraction',{'body':_0x7211af,'options':{'where':{'id':_0x518478}},'log':_0x90f8('0x6')});}; \ No newline at end of file +var _0x861c=['addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x33d615,_0x1a5af7){var _0x254611=function(_0x23c410){while(--_0x23c410){_0x33d615['push'](_0x33d615['shift']());}};_0x254611(++_0x1a5af7);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xc861('0x0'));exports[_0xc861('0x1')]=function(_0x1f86f2,_0x363b30){return client[_0xc861('0x2')](_0xc861('0x3'),{'body':_0x363b30,'options':{'where':{'id':_0x1f86f2}},'log':_0xc861('0x4')});};exports[_0xc861('0x5')]=function(_0x28ed01,_0xc70070){return client[_0xc861('0x2')](_0xc861('0x6'),{'body':_0xc70070,'options':{'where':{'id':_0x28ed01}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 0768aa6..5d42705 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 _0xc6f5=['CreateSmsMessage','../client','create','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc6f5,0x165));var _0x5c6f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc6f5[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x5c6f('0x0'));exports[_0x5c6f('0x1')]=function(_0x28df18){return client[_0x5c6f('0x2')](_0x5c6f('0x3'),{'body':_0x28df18,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xe99e=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x4e05a7,_0x5301f7){var _0xcdd47d=function(_0x5da300){while(--_0x5da300){_0x4e05a7['push'](_0x4e05a7['shift']());}};_0xcdd47d(++_0x5301f7);}(_0xe99e,0x91));var _0xee99=function(_0x60290f,_0x1da37a){_0x60290f=_0x60290f-0x0;var _0x38eaa0=_0xe99e[_0x60290f];return _0x38eaa0;};'use strict';var client=require(_0xee99('0x0'));exports[_0xee99('0x1')]=function(_0x1a9cba){return client[_0xee99('0x2')](_0xee99('0x3'),{'body':_0x1a9cba,'log':_0xee99('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6b8397c..1e762fa 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x11bbd2,_0x5328d3){var _0x20a143=function(_0x257d9e){while(--_0x257d9e){_0x11bbd2['push'](_0x11bbd2['shift']());}};_0x20a143(++_0x5328d3);}(_0x70e0,0x17b));var _0x070e=function(_0x1dea67,_0x3d4f4e){_0x1dea67=_0x1dea67-0x0;var _0x5282c7=_0x70e0[_0x1dea67];return _0x5282c7;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x2434e5,_0x13f304){var _0x18e487=function(_0x36251a){while(--_0x36251a){_0x2434e5['push'](_0x2434e5['shift']());}};_0x18e487(++_0x13f304);}(_0xe706,0xa3));var _0x6e70=function(_0x211158,_0x5edf3c){_0x211158=_0x211158-0x0;var _0x197bef=_0xe706[_0x211158];return _0x197bef;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index fa13c6a..379cdf6 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x2583a0,_0x56e7a1){var _0x47065b=function(_0x2b7789){while(--_0x2b7789){_0x2583a0['push'](_0x2583a0['shift']());}};_0x47065b(++_0x56e7a1);}(_0x70e0,0x17b));var _0x070e=function(_0x459977,_0xb70853){_0x459977=_0x459977-0x0;var _0x1586c4=_0x70e0[_0x459977];return _0x1586c4;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x493f1d,_0x3210a6){var _0x126b7d=function(_0x40932d){while(--_0x40932d){_0x493f1d['push'](_0x493f1d['shift']());}};_0x126b7d(++_0x3210a6);}(_0x34e8,0x12c));var _0x834e=function(_0x544c51,_0x550244){_0x544c51=_0x544c51-0x0;var _0x335ffc=_0x34e8[_0x544c51];return _0x335ffc;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 28c2e81..78886a4 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(_0x372d97,_0x129b66){var _0x178d5f=function(_0x1cc70d){while(--_0x1cc70d){_0x372d97['push'](_0x372d97['shift']());}};_0x178d5f(++_0x129b66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x6a9978,_0x27409d){var _0x123322=function(_0x12f170){while(--_0x12f170){_0x6a9978['push'](_0x6a9978['shift']());}};_0x123322(++_0x27409d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 6314fc4..726288e 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 _0xe08b=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x2f037f,_0x2958c5){var _0x2d1573=function(_0x34146e){while(--_0x34146e){_0x2f037f['push'](_0x2f037f['shift']());}};_0x2d1573(++_0x2958c5);}(_0xe08b,0x10e));var _0xbe08=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xe08b[_0xd299c3];return _0x376574;};'use strict';var client=require(_0xbe08('0x0'));exports['update']=function(_0x35038b,_0x41c652){return client['Request'](_0xbe08('0x1'),{'body':_0x41c652,'options':{'where':{'id':_0x35038b}},'log':_0xbe08('0x2')});};exports[_0xbe08('0x3')]=function(_0x469522,_0x41edfb){return client[_0xbe08('0x4')](_0xbe08('0x5'),{'body':_0x41edfb,'options':{'where':{'id':_0x469522}},'log':_0xbe08('0x6')});}; \ No newline at end of file +var _0x96fd=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','updateWhatsappInteraction'];(function(_0x4774da,_0x4d1ea7){var _0x4ce2c7=function(_0x22aeae){while(--_0x22aeae){_0x4774da['push'](_0x4774da['shift']());}};_0x4ce2c7(++_0x4d1ea7);}(_0x96fd,0x1e9));var _0xd96f=function(_0x413bd2,_0x1b28f7){_0x413bd2=_0x413bd2-0x0;var _0xbf0d0e=_0x96fd[_0x413bd2];return _0xbf0d0e;};'use strict';var client=require('../client');exports[_0xd96f('0x0')]=function(_0x5334c3,_0x2022bf){return client[_0xd96f('0x1')]('UpdateWhatsappInteraction',{'body':_0x2022bf,'options':{'where':{'id':_0x5334c3}},'log':_0xd96f('0x2')});};exports[_0xd96f('0x3')]=function(_0x44f63c,_0x22b39b){return client['Request'](_0xd96f('0x4'),{'body':_0x22b39b,'options':{'where':{'id':_0x44f63c}},'log':_0xd96f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6ce5f65..e5134d3 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 _0x575c=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x14324f,_0x181d35){var _0x2c60fe=function(_0x36cf83){while(--_0x36cf83){_0x14324f['push'](_0x14324f['shift']());}};_0x2c60fe(++_0x181d35);}(_0x575c,0x71));var _0xc575=function(_0x4ba565,_0x17513a){_0x4ba565=_0x4ba565-0x0;var _0x188246=_0x575c[_0x4ba565];return _0x188246;};'use strict';var client=require(_0xc575('0x0'));exports[_0xc575('0x1')]=function(_0x394605){return client[_0xc575('0x2')](_0xc575('0x3'),{'body':_0x394605,'log':_0xc575('0x4')});}; \ No newline at end of file +var _0x9bec=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x4d5d60,_0x4f4acc){var _0x573b18=function(_0x1b4b54){while(--_0x1b4b54){_0x4d5d60['push'](_0x4d5d60['shift']());}};_0x573b18(++_0x4f4acc);}(_0x9bec,0x161));var _0xc9be=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x9bec[_0x243b2f];return _0xcb3c2d;};'use strict';var client=require('../client');exports[_0xc9be('0x0')]=function(_0x4bcf91){return client[_0xc9be('0x1')](_0xc9be('0x2'),{'body':_0x4bcf91,'log':_0xc9be('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index f8c46ac..590d09c 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 _0x421d=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','User'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x421d,0xf2));var _0xd421=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x421d[_0x4bb66f];return _0xf2772f;};'use strict';var client=require(_0xd421('0x0'));exports[_0xd421('0x1')]=function(){return function(){return client[_0xd421('0x2')](_0xd421('0x3'),{'options':{'raw':![],'attributes':['id',_0xd421('0x4'),'timeout','strategy'],'include':[{'model':_0xd421('0x5'),'as':'Agents','attributes':['id',_0xd421('0x4'),_0xd421('0x6'),_0xd421('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x8185=['getWhatsappQueues','../client','GetWhatsappQueue','timeout','strategy','User','Agents','whatsappPause'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x8185,0x149));var _0x5818=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x8185[_0x5d2803];return _0xdcad2c;};'use strict';var client=require(_0x5818('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x5818('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x5818('0x2'),_0x5818('0x3')],'include':[{'model':_0x5818('0x4'),'as':_0x5818('0x5'),'attributes':['id','name','online',_0x5818('0x6')]}]},'log':_0x5818('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 63787c5..968f714 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 _0x5a3b=['update','Request','../client','create'];(function(_0x4b034c,_0x322df6){var _0x32795b=function(_0x408c0b){while(--_0x408c0b){_0x4b034c['push'](_0x4b034c['shift']());}};_0x32795b(++_0x322df6);}(_0x5a3b,0x126));var _0xb5a3=function(_0x37c935,_0xdbe714){_0x37c935=_0x37c935-0x0;var _0x38cf14=_0x5a3b[_0x37c935];return _0x38cf14;};'use strict';var client=require(_0xb5a3('0x0'));exports[_0xb5a3('0x1')]=function(_0x114827){return client['Request']('CreateWhatsappQueueReport',{'body':_0x114827,'log':'CreateWhatsappQueueReport'});};exports[_0xb5a3('0x2')]=function(_0x46ccfe,_0x1758a7){return client[_0xb5a3('0x3')]('UpdateWhatsappQueueReport',{'body':_0x1758a7,'options':{'where':{'uniqueid':_0x46ccfe},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x943d=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x943d,0x1e1));var _0xd943=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x943d[_0x4843f9];return _0x193c6a;};'use strict';var client=require(_0xd943('0x0'));exports[_0xd943('0x1')]=function(_0x1d3efd){return client[_0xd943('0x2')](_0xd943('0x3'),{'body':_0x1d3efd,'log':_0xd943('0x3')});};exports[_0xd943('0x4')]=function(_0x2a3377,_0x363661){return client[_0xd943('0x2')](_0xd943('0x5'),{'body':_0x363661,'options':{'where':{'uniqueid':_0x2a3377},'order':[['id',_0xd943('0x6')]],'limit':0x1},'log':_0xd943('0x5')});}; \ 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 49573a6..d1086c4 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 _0x7133=['[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger','./strategy','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','length','error','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x16871d,_0x28cbc2){var _0x2d5665=function(_0x7e3e35){while(--_0x7e3e35){_0x16871d['push'](_0x16871d['shift']());}};_0x2d5665(++_0x28cbc2);}(_0x7133,0x89));var _0x3713=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7133[_0x2a6809];return _0x11c371;};'use strict';var schema=require(_0x3713('0x0'));var _=require('lodash');var util=require(_0x3713('0x1'));var seqqueue=require(_0x3713('0x2'));var logger=require(_0x3713('0x3'))('routing');var strategy=require(_0x3713('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x3713('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x2af0a5,_0x58cb25,_0x3e3b28){return logger[_0x3713('0x6')](util['format'](_0x3713('0x7'),_0x2af0a5,_0x58cb25[_0x3713('0x8')],_0x3e3b28));}function handleFindAgent(_0x3fbd30){return function(_0x27f50a){return _0x27f50a[_0x3713('0x8')]['toLowerCase']()===_0x3fbd30['toLowerCase']();};}exports[_0x3713('0x9')]=function(_0x845d2c,_0x3e8c7d,_0x34d947,_0x533eec){return function(_0x1e08eb){try{var _0x2ce6ed={'name':_0x3e8c7d[0x0],'timeout':_0x3e8c7d[0x1]};var _0x503dbb=queue[_0x3713('0x0')](_0x2ce6ed,{'typecast':!![]});if(_0x503dbb[_0x3713('0xa')]){logger[_0x3713('0xb')]('[%s][AGENT]\x20%s',_0x845d2c,_[_0x3713('0xc')](_0x503dbb,_0x3713('0xd'))[_0x3713('0xe')](',\x20'));_0x1e08eb[_0x3713('0xf')]();}else{var _0x21eec0=_[_0x3713('0x10')](_0x34d947[_0x3713('0x11')],handleFindAgent(_0x2ce6ed[_0x3713('0x8')]));if(_0x21eec0){var _0x3c62c9=(_0x2ce6ed[_0x3713('0x12')]||0xa)*0x3e8;var _0x4a4bfd,_0x38bd3d;var _0x5c7b38=seqqueue[_0x3713('0x13')](_0x3c62c9);_0x5c7b38['id']=_0x845d2c;_0x5c7b38[_0x3713('0x14')]=_0x3c62c9;_0x5c7b38[_0x3713('0x15')]=_0x533eec[_0x3713('0x15')];writeLog(_0x845d2c,_0x21eec0,util[_0x3713('0x16')](_0x3713('0x17'),_0x3c62c9));_0x34d947[_0x3713('0x18')][_0x845d2c]['on'](_0x3713('0x19'),function(){logger[_0x3713('0x6')](_0x3713('0x1a'),_0x845d2c);clearTimeout(_0x38bd3d);_0x38bd3d=undefined;_0x5c7b38[_0x3713('0x1b')]();if(_0x34d947[_0x3713('0x18')][_0x845d2c]){delete _0x34d947['rules'][_0x845d2c];}_0x1e08eb[_0x3713('0xf')]();});_0x34d947[_0x3713('0x18')][_0x845d2c]['on'](_0x3713('0x1c'),function(){if(_0x34d947[_0x3713('0x18')][_0x845d2c]){delete _0x34d947[_0x3713('0x18')][_0x845d2c];}});_0x38bd3d=setTimeout(function(){logger[_0x3713('0x6')](_0x3713('0x1d'),_0x845d2c);clearTimeout(_0x38bd3d);_0x5c7b38[_0x3713('0x1b')]();_0x1e08eb[_0x3713('0x1e')]();},_0x3c62c9);strategy[_0x3713('0x1f')](_0x5c7b38,_0x21eec0,_0x34d947,_0x533eec);}else{logger[_0x3713('0xb')](_0x3713('0x20'),_0x845d2c,_0x2ce6ed[_0x3713('0x8')]);_0x1e08eb['stop']();}}}catch(_0x24ef5e){console['log'](_0x24ef5e);logger['error'](_0x3713('0x21'),_0x845d2c,_0x24ef5e['stack']);_0x1e08eb[_0x3713('0xf')]();}};}; \ No newline at end of file +var _0x8d70=['log','stack','lodash','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','find','agents','timeout','atimeout','channel','format','START:%s','end','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x391fb2,_0x260303){var _0x590ea8=function(_0x3a6c8b){while(--_0x3a6c8b){_0x391fb2['push'](_0x391fb2['shift']());}};_0x590ea8(++_0x260303);}(_0x8d70,0xce));var _0x08d7=function(_0xf9291c,_0x3e8407){_0xf9291c=_0xf9291c-0x0;var _0x3ac233=_0x8d70[_0xf9291c];return _0x3ac233;};'use strict';var schema=require('validate');var _=require(_0x08d7('0x0'));var util=require(_0x08d7('0x1'));var seqqueue=require(_0x08d7('0x2'));var logger=require(_0x08d7('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x08d7('0x4'),'required':!![],'message':_0x08d7('0x5')},'timeout':{'type':'number','message':_0x08d7('0x6')}});function writeLog(_0x3d5c78,_0x440276,_0x13fcbe){return logger[_0x08d7('0x7')](util['format'](_0x08d7('0x8'),_0x3d5c78,_0x440276[_0x08d7('0x9')],_0x13fcbe));}function handleFindAgent(_0x196b07){return function(_0x3ad3f9){return _0x3ad3f9[_0x08d7('0x9')][_0x08d7('0xa')]()===_0x196b07['toLowerCase']();};}exports[_0x08d7('0xb')]=function(_0x17a211,_0x56ab5f,_0x49062a,_0x1277e){return function(_0x5f3a15){try{var _0xb16c1a={'name':_0x56ab5f[0x0],'timeout':_0x56ab5f[0x1]};var _0xc9afa=queue['validate'](_0xb16c1a,{'typecast':!![]});if(_0xc9afa[_0x08d7('0xc')]){logger[_0x08d7('0xd')](_0x08d7('0xe'),_0x17a211,_['map'](_0xc9afa,_0x08d7('0xf'))[_0x08d7('0x10')](',\x20'));_0x5f3a15['stop']();}else{var _0x170805=_[_0x08d7('0x11')](_0x49062a[_0x08d7('0x12')],handleFindAgent(_0xb16c1a['name']));if(_0x170805){var _0x3dd2ee=(_0xb16c1a[_0x08d7('0x13')]||0xa)*0x3e8;var _0x1ad42d,_0x5628d1;var _0x4490b0=seqqueue['createQueue'](_0x3dd2ee);_0x4490b0['id']=_0x17a211;_0x4490b0[_0x08d7('0x14')]=_0x3dd2ee;_0x4490b0[_0x08d7('0x15')]=_0x1277e[_0x08d7('0x15')];writeLog(_0x17a211,_0x170805,util[_0x08d7('0x16')](_0x08d7('0x17'),_0x3dd2ee));_0x49062a['rules'][_0x17a211]['on'](_0x08d7('0x18'),function(){logger[_0x08d7('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x17a211);clearTimeout(_0x5628d1);_0x5628d1=undefined;_0x4490b0['close']();if(_0x49062a[_0x08d7('0x19')][_0x17a211]){delete _0x49062a[_0x08d7('0x19')][_0x17a211];}_0x5f3a15[_0x08d7('0x1a')]();});_0x49062a[_0x08d7('0x19')][_0x17a211]['on'](_0x08d7('0x1b'),function(){if(_0x49062a[_0x08d7('0x19')][_0x17a211]){delete _0x49062a[_0x08d7('0x19')][_0x17a211];}});_0x5628d1=setTimeout(function(){logger[_0x08d7('0x7')](_0x08d7('0x1c'),_0x17a211);clearTimeout(_0x5628d1);_0x4490b0['close']();_0x5f3a15[_0x08d7('0x1d')]();},_0x3dd2ee);strategy[_0x08d7('0x1e')](_0x4490b0,_0x170805,_0x49062a,_0x1277e);}else{logger[_0x08d7('0xd')](_0x08d7('0x1f'),_0x17a211,_0xb16c1a[_0x08d7('0x9')]);_0x5f3a15[_0x08d7('0x1a')]();}}}catch(_0xda0eaf){console[_0x08d7('0x20')](_0xda0eaf);logger[_0x08d7('0xd')]('[%s][QUEUE]\x20%s',_0x17a211,_0xda0eaf[_0x08d7('0x21')]);_0x5f3a15[_0x08d7('0x1a')]();}};}; \ 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 3ea2bb9..b054cd0 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 _0xc137=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','created','isEmpty','getMustacheRender','Message','create','[%s][AMAZONLEX]\x20%s','body','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','next','amazonlex','stringify','then','dialogState','Failed','error','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc137,0x182));var _0x7c13=function(_0x2ac7a2,_0x5cb8ce){_0x2ac7a2=_0x2ac7a2-0x0;var _0x17f998=_0xc137[_0x2ac7a2];return _0x17f998;};'use strict';var _=require(_0x7c13('0x0'));var moment=require(_0x7c13('0x1'));var AWS=require(_0x7c13('0x2'));var utils=require(_0x7c13('0x3'));var logger=require(_0x7c13('0x4'))(_0x7c13('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7c13('0x6')),'mailMessage':require(_0x7c13('0x7')),'smsMessage':require(_0x7c13('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7c13('0x9'))};exports[_0x7c13('0xa')]=function(_0xe82ed1,_0x2cbebc){return function(_0x3f160b){try{if(!_[_0x7c13('0xb')](this[_0x7c13('0xc')]['UserId'])){logger[_0x7c13('0xd')]('[%s][AMAZONLEX]\x20%s',_0xe82ed1,_0x7c13('0xe'));return _0x3f160b['next']();}var _0x1137df={'ContactId':this[_0x7c13('0xf')]['id'],'sentAt':moment()[_0x7c13('0x10')](_0x7c13('0x11')),'direction':_0x7c13('0x12')};if(this[_0x7c13('0x13')]===_0x7c13('0x14')||this[_0x7c13('0x13')]===_0x7c13('0x15')){_0x1137df[_0x7c13('0x16')]=this['interaction']['phone'];}var _0x4f83a2=this[_0x7c13('0x13')];if(_0x4f83a2===_0x7c13('0x17')){_0x1137df['ChatWebsiteId']=this[_0x7c13('0x18')]['id'];}else{_0x1137df[_[_0x7c13('0x19')](_0x4f83a2)+'AccountId']=this[_0x7c13('0x18')]['id'];}_0x1137df[_[_0x7c13('0x19')](_0x4f83a2)+'InteractionId']=this['interaction']['id'];if(this[_0x7c13('0xc')][_0x7c13('0x1a')]){var _0x3666d9=_0x2cbebc[0x4];if(!_[_0x7c13('0x1b')](_0x3666d9)){_0x1137df['body']=utils[_0x7c13('0x1c')](_0x3666d9,this);return rpc[_0x4f83a2+_0x7c13('0x1d')][_0x7c13('0x1e')](_0x1137df)['then'](function(_0x16e360){logger[_0x7c13('0xd')](_0x7c13('0x1f'),_0xe82ed1,_0x1137df[_0x7c13('0x20')]);})[_0x7c13('0x21')](function(_0x761dfe){logger['error'](_0x7c13('0x1f'),_0xe82ed1,JSON['stringify'](_0x761dfe));})[_0x7c13('0x22')](function(){logger[_0x7c13('0xd')](_0x7c13('0x23'),_0xe82ed1);_0x3f160b[_0x7c13('0x24')]();});}else{logger[_0x7c13('0xd')](_0x7c13('0x25'),_0xe82ed1);_0x3f160b[_0x7c13('0x24')]();}}else{var _0x483903=this;var _0x603bd1=new AWS[(_0x7c13('0x26'))]({'accessKeyId':_0x2cbebc[0x0],'secretAccessKey':_0x2cbebc[0x1],'region':_0x2cbebc[0x2]});var _0xa0ae61={'botAlias':'$LATEST','botName':_0x2cbebc[0x3],'inputText':this[_0x7c13('0x27')][_0x7c13('0x20')],'userId':this[_0x7c13('0x13')]+':'+this[_0x7c13('0xc')]['id'][_0x7c13('0x28')]()};_0x603bd1[_0x7c13('0x29')](_0xa0ae61,function(_0x1486e8,_0x2545e0){if(_0x1486e8){logger['error'](_0x7c13('0x1f'),_0xe82ed1,_0x1486e8[_0x7c13('0x27')]);_0x3f160b[_0x7c13('0x2a')]();}else if(_0x2545e0&&_0x2545e0['message']){_0x483903[_0x7c13('0x20')][_0x7c13('0x2b')]=_0x2545e0;_0x1137df['body']=_0x2545e0['message'];_0x1137df['providerName']='amazonlex';_0x1137df['providerResponse']=JSON[_0x7c13('0x2c')](_0x2545e0);return rpc[_0x4f83a2+_0x7c13('0x1d')]['create'](_0x1137df)[_0x7c13('0x2d')](function(_0x5c184b){logger[_0x7c13('0xd')](_0x7c13('0x1f'),_0xe82ed1,_0x1137df['body']);if(_0x2545e0[_0x7c13('0x2e')]==_0x7c13('0x2f')){_0x3f160b[_0x7c13('0x2a')]();}else{_0x3f160b[_0x7c13('0x24')]();}})['catch'](function(_0xe07292){logger[_0x7c13('0x30')](_0x7c13('0x1f'),_0xe82ed1,JSON['stringify'](_0xe07292));_0x3f160b['next']();});}else{_0x3f160b[_0x7c13('0x2a')]();}});}}catch(_0x3eb5ed){logger[_0x7c13('0x30')]('[%s][AMAZONLEX]\x20%s',_0xe82ed1,JSON[_0x7c13('0x2c')](_0x3eb5ed));_0x3f160b[_0x7c13('0x24')]();}};}; \ No newline at end of file +var _0x2404=['isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','body','toString','postText','providerName','amazonlex','providerResponse','dialogState','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x2404,0x1c3));var _0x4240=function(_0x2c2f5e,_0x394e83){_0x2c2f5e=_0x2c2f5e-0x0;var _0x51d4d3=_0x2404[_0x2c2f5e];return _0x51d4d3;};'use strict';var _=require(_0x4240('0x0'));var moment=require(_0x4240('0x1'));var AWS=require(_0x4240('0x2'));var utils=require('./utils');var logger=require(_0x4240('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4240('0x4')),'mailMessage':require(_0x4240('0x5')),'smsMessage':require(_0x4240('0x6')),'faxMessage':require(_0x4240('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4240('0x8')]=function(_0x515767,_0x2d4431){return function(_0x4ec767){try{if(!_[_0x4240('0x9')](this[_0x4240('0xa')]['UserId'])){logger[_0x4240('0xb')](_0x4240('0xc'),_0x515767,_0x4240('0xd'));return _0x4ec767[_0x4240('0xe')]();}var _0x396d92={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x4240('0xf')),'direction':_0x4240('0x10')};if(this['channel']==='sms'||this[_0x4240('0x11')]==='whatsapp'){_0x396d92[_0x4240('0x12')]=this['interaction']['phone'];}var _0x46abd3=this['channel'];if(_0x46abd3===_0x4240('0x13')){_0x396d92[_0x4240('0x14')]=this[_0x4240('0x15')]['id'];}else{_0x396d92[_[_0x4240('0x16')](_0x46abd3)+_0x4240('0x17')]=this[_0x4240('0x15')]['id'];}_0x396d92[_[_0x4240('0x16')](_0x46abd3)+_0x4240('0x18')]=this[_0x4240('0xa')]['id'];if(this['interaction'][_0x4240('0x19')]){var _0x47544a=_0x2d4431[0x4];if(!_[_0x4240('0x1a')](_0x47544a)){_0x396d92['body']=utils[_0x4240('0x1b')](_0x47544a,this);return rpc[_0x46abd3+_0x4240('0x1c')][_0x4240('0x1d')](_0x396d92)[_0x4240('0x1e')](function(_0x29089e){logger[_0x4240('0xb')]('[%s][AMAZONLEX]\x20%s',_0x515767,_0x396d92['body']);})[_0x4240('0x1f')](function(_0x3b17cd){logger[_0x4240('0x20')](_0x4240('0xc'),_0x515767,JSON[_0x4240('0x21')](_0x3b17cd));})[_0x4240('0x22')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x515767);_0x4ec767[_0x4240('0x23')]();});}else{logger[_0x4240('0xb')](_0x4240('0x24'),_0x515767);_0x4ec767[_0x4240('0x23')]();}}else{var _0x3138c8=this;var _0x3ed927=new AWS['LexRuntime']({'accessKeyId':_0x2d4431[0x0],'secretAccessKey':_0x2d4431[0x1],'region':_0x2d4431[0x2]});var _0x1a2e1f={'botAlias':_0x4240('0x25'),'botName':_0x2d4431[0x3],'inputText':this[_0x4240('0x26')][_0x4240('0x27')],'userId':this[_0x4240('0x11')]+':'+this[_0x4240('0xa')]['id'][_0x4240('0x28')]()};_0x3ed927[_0x4240('0x29')](_0x1a2e1f,function(_0x2c127d,_0x4e9255){if(_0x2c127d){logger[_0x4240('0x20')](_0x4240('0xc'),_0x515767,_0x2c127d['message']);_0x4ec767[_0x4240('0xe')]();}else if(_0x4e9255&&_0x4e9255[_0x4240('0x26')]){_0x3138c8['body']['amazonlex']=_0x4e9255;_0x396d92['body']=_0x4e9255[_0x4240('0x26')];_0x396d92[_0x4240('0x2a')]=_0x4240('0x2b');_0x396d92[_0x4240('0x2c')]=JSON[_0x4240('0x21')](_0x4e9255);return rpc[_0x46abd3+_0x4240('0x1c')][_0x4240('0x1d')](_0x396d92)[_0x4240('0x1e')](function(_0x2f9da1){logger['info'](_0x4240('0xc'),_0x515767,_0x396d92[_0x4240('0x27')]);if(_0x4e9255[_0x4240('0x2d')]=='Failed'){_0x4ec767['next']();}else{_0x4ec767[_0x4240('0x23')]();}})[_0x4240('0x1f')](function(_0x516e48){logger['error'](_0x4240('0xc'),_0x515767,JSON[_0x4240('0x21')](_0x516e48));_0x4ec767[_0x4240('0xe')]();});}else{_0x4ec767[_0x4240('0xe')]();}});}}catch(_0x3a27a3){logger[_0x4240('0x20')](_0x4240('0xc'),_0x515767,JSON['stringify'](_0x3a27a3));_0x4ec767[_0x4240('0x23')]();}};}; \ 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 af04582..2fdfd76 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 _0xf91f=['chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','html','','replace','','headers','All','auto_reply','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','then','catch','error','stringify','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','out','body','getMustacheRender','message','from','phone','read','subject','Re:'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf91f,0x150));var _0xff91=function(_0x4f2095,_0x205e23){_0x4f2095=_0x4f2095-0x0;var _0xb04ea=_0xf91f[_0x4f2095];return _0xb04ea;};'use strict';var _=require(_0xff91('0x0'));var moment=require(_0xff91('0x1'));var utils=require(_0xff91('0x2'));var logger=require('../../../../config/logger')(_0xff91('0x3'));var rpc={'chatMessage':require(_0xff91('0x4')),'openchannelMessage':require(_0xff91('0x5')),'mailMessage':require(_0xff91('0x6')),'smsMessage':require(_0xff91('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xff91('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xff91('0x9')),'smsInteraction':require(_0xff91('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xff91('0xb'))};var mailRpc=require('../../mailRpc');exports[_0xff91('0xc')]=function(_0x27663c,_0x27ecdb,_0x15cd12,_0x538ca2){return function(_0x359c6a){try{var _0x18d134=this[_0xff91('0xd')];if(_0x18d134===_0xff91('0xe')&&_0x538ca2['body'][_0xff91('0xf')]){logger['info'](_0xff91('0x10'),_0x27663c,_0xff91('0x11'));return _0x359c6a['next']();}if(_0x27ecdb[0x0]==='1'&&(_['isNil'](this['interaction']['created'])||!this['interaction'][_0xff91('0x12')])){logger['info'](_0xff91('0x10'),_0x27663c,_0xff91('0x13'));return _0x359c6a[_0xff91('0x14')]();}if(_0x27ecdb[0x0]==='2'&&this['interaction'][_0xff91('0x15')]){logger['info'](_0xff91('0x16'),_0x27663c,_0xff91('0x17'));return _0x359c6a[_0xff91('0x14')]();}var _0x57605f={'ContactId':this[_0xff91('0x18')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xff91('0x19')};if(this[_0xff91('0xd')]===_0xff91('0xe')){_0x57605f[_0xff91('0x1a')]=utils[_0xff91('0x1b')](_0x27ecdb[0x2],this);}else{_0x57605f[_0xff91('0x1a')]=utils[_0xff91('0x1b')](_0x27ecdb[0x1],this);}if(this[_0xff91('0x1c')]){_0x57605f['to']=this['message'][_0xff91('0x1d')]||'';if(this[_0xff91('0xd')]==='mail'&&_0x27ecdb[0x1]==='1'){_0x57605f['cc']=this[_0xff91('0x1c')]['cc']||'';}_0x57605f[_0xff91('0x1d')]=this['message']['to']||'';_0x57605f[_0xff91('0x1e')]=this[_0xff91('0x1c')][_0xff91('0x1e')]||'';_0x57605f[_0xff91('0x1f')]=!![];if(this[_0xff91('0x1c')][_0xff91('0x20')]){_0x57605f[_0xff91('0x20')]='';_0x57605f[_0xff91('0x20')]+=_['startsWith'](this[_0xff91('0x1c')][_0xff91('0x20')],_0xff91('0x21'))?'':'Re:\x20';_0x57605f[_0xff91('0x20')]+=this[_0xff91('0x1c')][_0xff91('0x20')];}}if(this[_0xff91('0xd')]===_0xff91('0x22')){_0x57605f[_0xff91('0x23')]=this['account']['id'];}else{_0x57605f[_[_0xff91('0x24')](this[_0xff91('0xd')])+_0xff91('0x25')]=this[_0xff91('0x26')]['id'];}_0x57605f[_['upperFirst'](this[_0xff91('0xd')])+_0xff91('0x27')]=this[_0xff91('0x28')]['id'];var _0xfa6771=this[_0xff91('0x28')];if(rpc[this[_0xff91('0xd')]+_0xff91('0x29')]){if(this['channel']===_0xff91('0xe')){var _0x5095a0={'tls':{'rejectUnauthorized':![]}};if(this[_0xff91('0x26')][_0xff91('0x2a')][_0xff91('0x2b')]){_0x5095a0['service']=this[_0xff91('0x26')][_0xff91('0x2a')][_0xff91('0x2b')];}else{_0x5095a0[_0xff91('0x2c')]=this[_0xff91('0x26')][_0xff91('0x2a')][_0xff91('0x2c')];_0x5095a0[_0xff91('0x2d')]=this[_0xff91('0x26')][_0xff91('0x2a')][_0xff91('0x2d')];_0x5095a0['secure']=this[_0xff91('0x26')]['Smtp'][_0xff91('0x2e')];}if(this[_0xff91('0x26')][_0xff91('0x2a')]['authentication']){_0x5095a0[_0xff91('0x2f')]={'user':this[_0xff91('0x26')][_0xff91('0x2a')][_0xff91('0x30')],'pass':this[_0xff91('0x26')][_0xff91('0x2a')][_0xff91('0x31')]};}_0x57605f[_0xff91('0x32')]=this[_0xff91('0x1c')]['messageId'];_0x57605f[_0xff91('0x33')]=_0xff91('0x34')+_[_0xff91('0x35')](_0x57605f['body'],_0xff91('0x36'),_0xff91('0x37'))+_0xff91('0x38');_0x57605f[_0xff91('0x39')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xff91('0x3a'),'Precedence':_0xff91('0x3b')};return mailRpc['sendMailMessage'](_0x5095a0,_0x57605f)['then'](function(_0x5aa61c){logger[_0xff91('0x3c')](_0xff91('0x3d'),_0x27663c);_0x57605f[_0xff91('0x3e')]=_0x5aa61c[_0xff91('0x1c')][_0xff91('0x3e')];return rpc[_0x18d134+'Message'][_0xff91('0x3f')](_0x57605f);})[_0xff91('0x40')](function(_0x309e7f){logger['info'](_0xff91('0x10'),_0x27663c,JSON['stringify'](_0x309e7f));})[_0xff91('0x41')](function(_0xbe15c8){logger[_0xff91('0x42')]('[RPC][%s][AUTOREPLY]\x20%s',_0x27663c,JSON[_0xff91('0x43')](_0xbe15c8));})[_0xff91('0x44')](function(){Promise[_0xff91('0x45')]()['then'](function(){if(_0x27ecdb[0x0]!=='2'||_0xfa6771[_0xff91('0x15')])return;return rpc[_0x18d134+_0xff91('0x46')]['update'](_0xfa6771['id'],{'autoreplyExecuted':!![]})[_0xff91('0x40')](function(_0x27830f){logger[_0xff91('0x3c')](_0xff91('0x16'),_0x27663c,JSON['stringify'](_0x27830f));})[_0xff91('0x41')](function(_0x54430b){logger[_0xff91('0x42')](_0xff91('0x47'),_0x27663c,JSON[_0xff91('0x43')](_0x54430b));});})[_0xff91('0x40')](function(){_0x359c6a[_0xff91('0x14')]();});});}else{return rpc[this[_0xff91('0xd')]+'Message']['create'](_0x57605f)['then'](function(_0x2ad0e1){logger['info']('[%s][AUTOREPLY]\x20%s',_0x27663c,_0x57605f[_0xff91('0x1a')]);})[_0xff91('0x41')](function(_0xd0e148){logger[_0xff91('0x42')](_0xff91('0x10'),_0x27663c,JSON[_0xff91('0x43')](_0xd0e148));})[_0xff91('0x44')](function(){Promise['resolve']()[_0xff91('0x40')](function(){if(_0x27ecdb[0x0]!=='2'||_0xfa6771['autoreplyExecuted'])return;return rpc[_0x18d134+_0xff91('0x46')][_0xff91('0x48')](_0xfa6771['id'],{'autoreplyExecuted':!![]})[_0xff91('0x40')](function(_0x322eb9){logger['info'](_0xff91('0x16'),_0x27663c,JSON[_0xff91('0x43')](_0x322eb9));})[_0xff91('0x41')](function(_0x359338){logger[_0xff91('0x42')](_0xff91('0x47'),_0x27663c,JSON['stringify'](_0x359338));});})[_0xff91('0x40')](function(){_0x359c6a[_0xff91('0x14')]();});});}}}catch(_0x159880){logger['error']('[%s][AUTOREPLY]\x20%s',_0x27663c,JSON[_0xff91('0x43')](_0x159880));_0x359c6a[_0xff91('0x49')]();}};}; \ No newline at end of file +var _0x3dd9=['upperFirst','account','InteractionId','Message','service','Smtp','host','port','secure','authentication','auth','user','pass','messageId','html','','replace','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','update','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat'];(function(_0x29008f,_0x40b397){var _0x32cae5=function(_0xcca3bb){while(--_0xcca3bb){_0x29008f['push'](_0x29008f['shift']());}};_0x32cae5(++_0x40b397);}(_0x3dd9,0x104));var _0x93dd=function(_0x30ad17,_0x3869de){_0x30ad17=_0x30ad17-0x0;var _0x4c63ad=_0x3dd9[_0x30ad17];return _0x4c63ad;};'use strict';var _=require(_0x93dd('0x0'));var moment=require('moment');var utils=require(_0x93dd('0x1'));var logger=require(_0x93dd('0x2'))(_0x93dd('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x93dd('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x93dd('0x5')),'faxMessage':require(_0x93dd('0x6')),'whatsappMessage':require(_0x93dd('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x93dd('0x8')),'mailInteraction':require(_0x93dd('0x9')),'smsInteraction':require(_0x93dd('0xa')),'faxInteraction':require(_0x93dd('0xb')),'whatsappInteraction':require(_0x93dd('0xc'))};var mailRpc=require('../../mailRpc');exports[_0x93dd('0xd')]=function(_0x32f525,_0x9ba849,_0x47c417,_0x4c1dc6){return function(_0x307776){try{var _0x26d142=this['channel'];if(_0x26d142===_0x93dd('0xe')&&_0x4c1dc6[_0x93dd('0xf')][_0x93dd('0x10')]){logger['info'](_0x93dd('0x11'),_0x32f525,_0x93dd('0x12'));return _0x307776['next']();}if(_0x9ba849[0x0]==='1'&&(_[_0x93dd('0x13')](this[_0x93dd('0x14')][_0x93dd('0x15')])||!this[_0x93dd('0x14')]['created'])){logger['info'](_0x93dd('0x11'),_0x32f525,_0x93dd('0x16'));return _0x307776[_0x93dd('0x17')]();}if(_0x9ba849[0x0]==='2'&&this[_0x93dd('0x14')][_0x93dd('0x18')]){logger[_0x93dd('0x19')](_0x93dd('0x1a'),_0x32f525,_0x93dd('0x1b'));return _0x307776[_0x93dd('0x17')]();}var _0x1d6d9c={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x93dd('0x1c')),'direction':_0x93dd('0x1d')};if(this[_0x93dd('0x1e')]===_0x93dd('0xe')){_0x1d6d9c[_0x93dd('0xf')]=utils[_0x93dd('0x1f')](_0x9ba849[0x2],this);}else{_0x1d6d9c['body']=utils[_0x93dd('0x1f')](_0x9ba849[0x1],this);}if(this['message']){_0x1d6d9c['to']=this[_0x93dd('0x20')][_0x93dd('0x21')]||'';if(this[_0x93dd('0x1e')]==='mail'&&_0x9ba849[0x1]==='1'){_0x1d6d9c['cc']=this['message']['cc']||'';}_0x1d6d9c[_0x93dd('0x21')]=this[_0x93dd('0x20')]['to']||'';_0x1d6d9c[_0x93dd('0x22')]=this[_0x93dd('0x20')][_0x93dd('0x22')]||'';_0x1d6d9c[_0x93dd('0x23')]=!![];if(this[_0x93dd('0x20')]['subject']){_0x1d6d9c[_0x93dd('0x24')]='';_0x1d6d9c[_0x93dd('0x24')]+=_['startsWith'](this[_0x93dd('0x20')][_0x93dd('0x24')],_0x93dd('0x25'))?'':_0x93dd('0x26');_0x1d6d9c[_0x93dd('0x24')]+=this[_0x93dd('0x20')][_0x93dd('0x24')];}}if(this[_0x93dd('0x1e')]===_0x93dd('0x27')){_0x1d6d9c['ChatWebsiteId']=this['account']['id'];}else{_0x1d6d9c[_[_0x93dd('0x28')](this[_0x93dd('0x1e')])+'AccountId']=this[_0x93dd('0x29')]['id'];}_0x1d6d9c[_[_0x93dd('0x28')](this[_0x93dd('0x1e')])+_0x93dd('0x2a')]=this[_0x93dd('0x14')]['id'];var _0x4fd1b8=this[_0x93dd('0x14')];if(rpc[this[_0x93dd('0x1e')]+_0x93dd('0x2b')]){if(this['channel']===_0x93dd('0xe')){var _0x30d20e={'tls':{'rejectUnauthorized':![]}};if(this[_0x93dd('0x29')]['Smtp'][_0x93dd('0x2c')]){_0x30d20e[_0x93dd('0x2c')]=this[_0x93dd('0x29')][_0x93dd('0x2d')][_0x93dd('0x2c')];}else{_0x30d20e['host']=this[_0x93dd('0x29')][_0x93dd('0x2d')][_0x93dd('0x2e')];_0x30d20e[_0x93dd('0x2f')]=this[_0x93dd('0x29')][_0x93dd('0x2d')][_0x93dd('0x2f')];_0x30d20e[_0x93dd('0x30')]=this[_0x93dd('0x29')]['Smtp']['secure'];}if(this[_0x93dd('0x29')][_0x93dd('0x2d')][_0x93dd('0x31')]){_0x30d20e[_0x93dd('0x32')]={'user':this[_0x93dd('0x29')]['Smtp'][_0x93dd('0x33')],'pass':this['account'][_0x93dd('0x2d')][_0x93dd('0x34')]};}_0x1d6d9c['inReplyTo']=this['message'][_0x93dd('0x35')];_0x1d6d9c[_0x93dd('0x36')]=_0x93dd('0x37')+_[_0x93dd('0x38')](_0x1d6d9c['body'],'';_0x1d6d9c[_0x93dd('0x39')]={'Auto-Submitted':_0x93dd('0x3a'),'X-Auto-Response-Suppress':_0x93dd('0x3b'),'Precedence':_0x93dd('0x3c')};return mailRpc[_0x93dd('0x3d')](_0x30d20e,_0x1d6d9c)[_0x93dd('0x3e')](function(_0x20014c){logger[_0x93dd('0x19')](_0x93dd('0x3f'),_0x32f525);_0x1d6d9c[_0x93dd('0x35')]=_0x20014c[_0x93dd('0x20')][_0x93dd('0x35')];return rpc[_0x26d142+_0x93dd('0x2b')][_0x93dd('0x40')](_0x1d6d9c);})['then'](function(_0x5f1448){logger[_0x93dd('0x19')](_0x93dd('0x11'),_0x32f525,JSON[_0x93dd('0x41')](_0x5f1448));})['catch'](function(_0x4e456d){logger['error'](_0x93dd('0x42'),_0x32f525,JSON['stringify'](_0x4e456d));})['finally'](function(){Promise[_0x93dd('0x43')]()[_0x93dd('0x3e')](function(){if(_0x9ba849[0x0]!=='2'||_0x4fd1b8[_0x93dd('0x18')])return;return rpc[_0x26d142+_0x93dd('0x44')]['update'](_0x4fd1b8['id'],{'autoreplyExecuted':!![]})[_0x93dd('0x3e')](function(_0x588900){logger[_0x93dd('0x19')](_0x93dd('0x1a'),_0x32f525,JSON[_0x93dd('0x41')](_0x588900));})[_0x93dd('0x45')](function(_0x552054){logger[_0x93dd('0x46')](_0x93dd('0x47'),_0x32f525,JSON['stringify'](_0x552054));});})['then'](function(){_0x307776[_0x93dd('0x17')]();});});}else{return rpc[this[_0x93dd('0x1e')]+_0x93dd('0x2b')][_0x93dd('0x40')](_0x1d6d9c)[_0x93dd('0x3e')](function(_0x2c2f84){logger[_0x93dd('0x19')](_0x93dd('0x11'),_0x32f525,_0x1d6d9c[_0x93dd('0xf')]);})['catch'](function(_0x3b6e44){logger['error']('[%s][AUTOREPLY]\x20%s',_0x32f525,JSON[_0x93dd('0x41')](_0x3b6e44));})[_0x93dd('0x48')](function(){Promise[_0x93dd('0x43')]()[_0x93dd('0x3e')](function(){if(_0x9ba849[0x0]!=='2'||_0x4fd1b8[_0x93dd('0x18')])return;return rpc[_0x26d142+'Interaction'][_0x93dd('0x49')](_0x4fd1b8['id'],{'autoreplyExecuted':!![]})[_0x93dd('0x3e')](function(_0x59a18e){logger['info'](_0x93dd('0x1a'),_0x32f525,JSON[_0x93dd('0x41')](_0x59a18e));})[_0x93dd('0x45')](function(_0x532215){logger[_0x93dd('0x46')](_0x93dd('0x47'),_0x32f525,JSON[_0x93dd('0x41')](_0x532215));});})[_0x93dd('0x3e')](function(){_0x307776[_0x93dd('0x17')]();});});}}}catch(_0x417506){logger[_0x93dd('0x46')](_0x93dd('0x11'),_0x32f525,JSON[_0x93dd('0x41')](_0x417506));_0x307776[_0x93dd('0x4a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 1c8d313..0a5bf1d 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5dc=['routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger'];(function(_0x35cf35,_0x539e8c){var _0x2cbd90=function(_0x58dd59){while(--_0x58dd59){_0x35cf35['push'](_0x35cf35['shift']());}};_0x2cbd90(++_0x539e8c);}(_0xf5dc,0xfa));var _0xcf5d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf5dc[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0xcf5d('0x0'));var logger=require(_0xcf5d('0x1'))(_0xcf5d('0x2'));var rpc={'chatInteraction':require(_0xcf5d('0x3')),'openchannelInteraction':require(_0xcf5d('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xcf5d('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xcf5d('0x6'))};exports['consequence']=function(_0x43010a,_0x2128c8,_0x46415f,_0x25e08f){return function(_0xb803e6){try{logger[_0xcf5d('0x7')](_0xcf5d('0x8'),_0x43010a,_0x2128c8[0x0]);var _0x2a15b0={'closed':0x1,'closedAt':moment()[_0xcf5d('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x2128c8[0x0]};if(rpc[_0x25e08f[_0xcf5d('0xa')]+_0xcf5d('0xb')]){rpc[_0x25e08f[_0xcf5d('0xa')]+_0xcf5d('0xb')]['update'](_0x25e08f[_0xcf5d('0xc')]['id'],_0x2a15b0)[_0xcf5d('0xd')](function(_0x292678){logger[_0xcf5d('0x7')](_0xcf5d('0xe'),_0x43010a,_0x25e08f['interaction']['id']);})[_0xcf5d('0xf')](function(_0x3aaeac){logger[_0xcf5d('0x10')](_0xcf5d('0x11'),_0x43010a,JSON[_0xcf5d('0x12')](_0x3aaeac));})[_0xcf5d('0x13')](function(){_0xb803e6[_0xcf5d('0x14')]();});}}catch(_0x355d83){logger[_0xcf5d('0x10')](_0xcf5d('0x11'),_0x43010a,JSON[_0xcf5d('0x12')](_0x355d83));_0xb803e6[_0xcf5d('0x14')]();}};}; \ No newline at end of file +var _0x5bb6=['catch','error','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x4934d9,_0x2295c6){var _0x83beea=function(_0x59ab58){while(--_0x59ab58){_0x4934d9['push'](_0x4934d9['shift']());}};_0x83beea(++_0x2295c6);}(_0x5bb6,0x1d3));var _0x65bb=function(_0x664b8f,_0x1ec416){_0x664b8f=_0x664b8f-0x0;var _0x22819d=_0x5bb6[_0x664b8f];return _0x22819d;};'use strict';var moment=require(_0x65bb('0x0'));var logger=require(_0x65bb('0x1'))(_0x65bb('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x65bb('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x65bb('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x65bb('0x5')]=function(_0x45f454,_0x3f1c51,_0x38ea3f,_0x31e50b){return function(_0x4c3115){try{logger[_0x65bb('0x6')](_0x65bb('0x7'),_0x45f454,_0x3f1c51[0x0]);var _0x1d6349={'closed':0x1,'closedAt':moment()[_0x65bb('0x8')](_0x65bb('0x9')),'closeReason':_0x65bb('0xa'),'disposition':_0x3f1c51[0x0]};if(rpc[_0x31e50b[_0x65bb('0xb')]+_0x65bb('0xc')]){rpc[_0x31e50b[_0x65bb('0xb')]+_0x65bb('0xc')][_0x65bb('0xd')](_0x31e50b[_0x65bb('0xe')]['id'],_0x1d6349)[_0x65bb('0xf')](function(_0x3ec60a){logger[_0x65bb('0x6')](_0x65bb('0x10'),_0x45f454,_0x31e50b[_0x65bb('0xe')]['id']);})[_0x65bb('0x11')](function(_0x330902){logger[_0x65bb('0x12')]('[%s][CLOSE]\x20%s',_0x45f454,JSON[_0x65bb('0x13')](_0x330902));})[_0x65bb('0x14')](function(){_0x4c3115[_0x65bb('0x15')]();});}}catch(_0x3e227e){logger[_0x65bb('0x12')]('[%s][CLOSE]\x20%s',_0x45f454,JSON[_0x65bb('0x13')](_0x3e227e));_0x4c3115[_0x65bb('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 3757335..bcb8e12 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf07=['body','getMustacheRender','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','Message','endConversation','stringify','message','lodash','moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/smsMessage','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty'];(function(_0x377a99,_0x5c43e0){var _0x26dfc7=function(_0x35af38){while(--_0x35af38){_0x377a99['push'](_0x377a99['shift']());}};_0x26dfc7(++_0x5c43e0);}(_0xbf07,0x77));var _0x7bf0=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xbf07[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x7bf0('0x0'));var moment=require(_0x7bf0('0x1'));var apiai=require(_0x7bf0('0x2'));var md5=require(_0x7bf0('0x3'));var utils=require('./utils');var logger=require(_0x7bf0('0x4'))(_0x7bf0('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7bf0('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x44f656,_0x50e680){return function(_0x263964){try{if(!_['isNil'](this[_0x7bf0('0x7')][_0x7bf0('0x8')])){logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x44f656,_0x7bf0('0xb'));return _0x263964[_0x7bf0('0xc')]();}var _0x59cad0={'ContactId':this[_0x7bf0('0xd')]['id'],'sentAt':moment()['format'](_0x7bf0('0xe')),'direction':_0x7bf0('0xf')};if(this[_0x7bf0('0x10')]===_0x7bf0('0x11')||this[_0x7bf0('0x10')]===_0x7bf0('0x12')){_0x59cad0[_0x7bf0('0x13')]=this[_0x7bf0('0x7')][_0x7bf0('0x13')];}var _0x2c387c=this[_0x7bf0('0x10')];if(_0x2c387c===_0x7bf0('0x14')){_0x59cad0[_0x7bf0('0x15')]=this[_0x7bf0('0x16')]['id'];}else{_0x59cad0[_[_0x7bf0('0x17')](_0x2c387c)+_0x7bf0('0x18')]=this[_0x7bf0('0x16')]['id'];}_0x59cad0[_[_0x7bf0('0x17')](_0x2c387c)+_0x7bf0('0x19')]=this[_0x7bf0('0x7')]['id'];if(this['interaction'][_0x7bf0('0x1a')]){var _0x26e6b6=_0x50e680[0x2];if(!_[_0x7bf0('0x1b')](_0x26e6b6)){_0x59cad0[_0x7bf0('0x1c')]=utils[_0x7bf0('0x1d')](_0x26e6b6,this);return rpc[_0x2c387c+'Message'][_0x7bf0('0x1e')](_0x59cad0)[_0x7bf0('0x1f')](function(_0x2a99fe){logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x44f656,_0x59cad0[_0x7bf0('0x1c')]);})[_0x7bf0('0x20')](function(_0x155b2f){logger[_0x7bf0('0x21')](_0x7bf0('0xa'),_0x44f656,JSON['stringify'](_0x155b2f));})[_0x7bf0('0x22')](function(){logger[_0x7bf0('0x9')](_0x7bf0('0x23'),_0x44f656);_0x263964[_0x7bf0('0x24')]();});}else{logger[_0x7bf0('0x9')](_0x7bf0('0x25'),_0x44f656);_0x263964['stop']();}}else{var _0x4924d8=this;var _0x4379cb=apiai(_0x50e680[0x0],{'language':_0x50e680[0x1]||'en'});return _0x4379cb[_0x7bf0('0x26')](this['message'][_0x7bf0('0x1c')],{'sessionId':md5(this['interaction']['id'])})[_0x7bf0('0x1f')](function(_0x44e281){_0x4924d8[_0x7bf0('0x1c')][_0x7bf0('0x27')]=_0x44e281;_0x59cad0[_0x7bf0('0x1c')]=_0x44e281[_0x7bf0('0x28')][_0x7bf0('0x29')][_0x7bf0('0x2a')];_0x59cad0[_0x7bf0('0x2b')]=_0x7bf0('0x27');_0x59cad0[_0x7bf0('0x2c')]=JSON['stringify'](_0x44e281);return rpc[_0x2c387c+_0x7bf0('0x2d')][_0x7bf0('0x1e')](_0x59cad0)[_0x7bf0('0x1f')](function(_0x368f9f){logger[_0x7bf0('0x9')]('[%s][DIALOGFLOW]\x20%s',_0x44f656,_0x59cad0[_0x7bf0('0x1c')]);if(_0x44e281[_0x7bf0('0x28')]['metadata'][_0x7bf0('0x2e')]){_0x263964['next']();}else{_0x263964[_0x7bf0('0x24')]();}})[_0x7bf0('0x20')](function(_0x196b6a){logger['error'](_0x7bf0('0xa'),_0x44f656,JSON[_0x7bf0('0x2f')](_0x196b6a));_0x263964[_0x7bf0('0xc')]();});})['catch'](function(_0x371611){logger[_0x7bf0('0x21')](_0x7bf0('0xa'),_0x44f656,_0x371611[_0x7bf0('0x30')]);_0x263964['next']();});}}catch(_0x37942){logger[_0x7bf0('0x21')](_0x7bf0('0xa'),_0x44f656,JSON[_0x7bf0('0x2f')](_0x37942));_0x263964[_0x7bf0('0x24')]();}};}; \ No newline at end of file +var _0xf1c6=['then','dialogflow','fulfillment','speech','providerResponse','result','metadata','endConversation','error','stringify','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','whatsapp','chat','ChatWebsiteId','account','AccountId','upperFirst','isEmpty','body','getMustacheRender','Message','create','info','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message'];(function(_0x22f5fd,_0x1137a8){var _0x3312c7=function(_0x4fca35){while(--_0x4fca35){_0x22f5fd['push'](_0x22f5fd['shift']());}};_0x3312c7(++_0x1137a8);}(_0xf1c6,0x145));var _0x6f1c=function(_0x593e0e,_0x505237){_0x593e0e=_0x593e0e-0x0;var _0x5021e9=_0xf1c6[_0x593e0e];return _0x5021e9;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x6f1c('0x0'));var md5=require(_0x6f1c('0x1'));var utils=require(_0x6f1c('0x2'));var logger=require(_0x6f1c('0x3'))(_0x6f1c('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6f1c('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6f1c('0x6')),'whatsappMessage':require(_0x6f1c('0x7'))};exports[_0x6f1c('0x8')]=function(_0x537c4f,_0x1c1751){return function(_0x564a8f){try{if(!_[_0x6f1c('0x9')](this[_0x6f1c('0xa')][_0x6f1c('0xb')])){logger['info'](_0x6f1c('0xc'),_0x537c4f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x564a8f[_0x6f1c('0xd')]();}var _0x13136d={'ContactId':this['contact']['id'],'sentAt':moment()[_0x6f1c('0xe')](_0x6f1c('0xf')),'direction':'out'};if(this['channel']==='sms'||this['channel']===_0x6f1c('0x10')){_0x13136d['phone']=this['interaction']['phone'];}var _0x57dc6a=this['channel'];if(_0x57dc6a===_0x6f1c('0x11')){_0x13136d[_0x6f1c('0x12')]=this[_0x6f1c('0x13')]['id'];}else{_0x13136d[_['upperFirst'](_0x57dc6a)+_0x6f1c('0x14')]=this[_0x6f1c('0x13')]['id'];}_0x13136d[_[_0x6f1c('0x15')](_0x57dc6a)+'InteractionId']=this[_0x6f1c('0xa')]['id'];if(this[_0x6f1c('0xa')]['created']){var _0x28fc5f=_0x1c1751[0x2];if(!_[_0x6f1c('0x16')](_0x28fc5f)){_0x13136d[_0x6f1c('0x17')]=utils[_0x6f1c('0x18')](_0x28fc5f,this);return rpc[_0x57dc6a+_0x6f1c('0x19')][_0x6f1c('0x1a')](_0x13136d)['then'](function(_0x2f9949){logger[_0x6f1c('0x1b')](_0x6f1c('0xc'),_0x537c4f,_0x13136d[_0x6f1c('0x17')]);})[_0x6f1c('0x1c')](function(_0x3e642f){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x537c4f,JSON['stringify'](_0x3e642f));})[_0x6f1c('0x1d')](function(){logger['info'](_0x6f1c('0x1e'),_0x537c4f);_0x564a8f['stop']();});}else{logger[_0x6f1c('0x1b')](_0x6f1c('0x1f'),_0x537c4f);_0x564a8f[_0x6f1c('0x20')]();}}else{var _0x14effb=this;var _0x2ed8f1=apiai(_0x1c1751[0x0],{'language':_0x1c1751[0x1]||'en'});return _0x2ed8f1[_0x6f1c('0x21')](this[_0x6f1c('0x22')][_0x6f1c('0x17')],{'sessionId':md5(this[_0x6f1c('0xa')]['id'])})[_0x6f1c('0x23')](function(_0x130bae){_0x14effb[_0x6f1c('0x17')][_0x6f1c('0x24')]=_0x130bae;_0x13136d[_0x6f1c('0x17')]=_0x130bae['result'][_0x6f1c('0x25')][_0x6f1c('0x26')];_0x13136d['providerName']=_0x6f1c('0x24');_0x13136d[_0x6f1c('0x27')]=JSON['stringify'](_0x130bae);return rpc[_0x57dc6a+'Message']['create'](_0x13136d)['then'](function(_0x16fe5a){logger[_0x6f1c('0x1b')](_0x6f1c('0xc'),_0x537c4f,_0x13136d[_0x6f1c('0x17')]);if(_0x130bae[_0x6f1c('0x28')][_0x6f1c('0x29')][_0x6f1c('0x2a')]){_0x564a8f[_0x6f1c('0xd')]();}else{_0x564a8f[_0x6f1c('0x20')]();}})[_0x6f1c('0x1c')](function(_0x33db9d){logger[_0x6f1c('0x2b')]('[%s][DIALOGFLOW]\x20%s',_0x537c4f,JSON['stringify'](_0x33db9d));_0x564a8f[_0x6f1c('0xd')]();});})[_0x6f1c('0x1c')](function(_0x383802){logger[_0x6f1c('0x2b')](_0x6f1c('0xc'),_0x537c4f,_0x383802['message']);_0x564a8f[_0x6f1c('0xd')]();});}}catch(_0x5061e9){logger[_0x6f1c('0x2b')]('[%s][DIALOGFLOW]\x20%s',_0x537c4f,JSON[_0x6f1c('0x2c')](_0x5061e9));_0x564a8f[_0x6f1c('0x20')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index dbe1a25..2dbacbb 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe577=['whatsapp','phone','chat','ChatWebsiteId','account','AccountId','created','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20%s','stringify','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','push','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','error','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x175539,_0x5767f6){var _0x146bf8=function(_0xa2b6){while(--_0xa2b6){_0x175539['push'](_0x175539['shift']());}};_0x146bf8(++_0x5767f6);}(_0xe577,0xb6));var _0x7e57=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe577[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x7e57('0x0'));var dialogflow=require(_0x7e57('0x1'));var md5=require(_0x7e57('0x2'));var moment=require(_0x7e57('0x3'));var Promise=require('bluebird');var logger=require(_0x7e57('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0x7e57('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7e57('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7e57('0x7')),'whatsappMessage':require(_0x7e57('0x8'))};function createMessage(_0x2ff0dc,_0x3b7ad4,_0x491b9f,_0x51b224){return new Promise(function(_0xd15510,_0x35e39f){var _0x177f3b=_[_0x7e57('0x9')](_0x491b9f);_0x177f3b[_0x7e57('0xa')]=_0x51b224;return rpc[_0x3b7ad4+_0x7e57('0xb')][_0x7e57('0xc')](_0x177f3b)[_0x7e57('0xd')](function(){logger[_0x7e57('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x2ff0dc,_0x177f3b['body']);_0xd15510();})[_0x7e57('0xf')](function(_0x455caf){logger[_0x7e57('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x2ff0dc,JSON['stringify'](_0x455caf));_0x35e39f(_0x455caf);});});}exports[_0x7e57('0x11')]=function(_0x46cd7e,_0x1e6cdc){return function(_0x12b33b){try{if(!_['isNil'](this[_0x7e57('0x12')][_0x7e57('0x13')])){logger[_0x7e57('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x46cd7e,_0x7e57('0x14'));return _0x12b33b[_0x7e57('0x15')]();}var _0x3d084f={'ContactId':this[_0x7e57('0x16')]['id'],'sentAt':moment()[_0x7e57('0x17')](_0x7e57('0x18')),'direction':_0x7e57('0x19')};if(this[_0x7e57('0x1a')]===_0x7e57('0x1b')||this['channel']===_0x7e57('0x1c')){_0x3d084f['phone']=this[_0x7e57('0x12')][_0x7e57('0x1d')];}var _0x1d3d38=this['channel'];if(_0x1d3d38===_0x7e57('0x1e')){_0x3d084f[_0x7e57('0x1f')]=this[_0x7e57('0x20')]['id'];}else{_0x3d084f[_['upperFirst'](_0x1d3d38)+_0x7e57('0x21')]=this['account']['id'];}_0x3d084f[_['upperFirst'](_0x1d3d38)+'InteractionId']=this['interaction']['id'];if(this[_0x7e57('0x12')][_0x7e57('0x22')]){var _0x293a00=_0x1e6cdc[0x4];if(!_[_0x7e57('0x23')](_0x293a00)){_0x3d084f[_0x7e57('0xa')]=utils[_0x7e57('0x24')](_0x293a00,this);return rpc[_0x1d3d38+_0x7e57('0xb')]['create'](_0x3d084f)[_0x7e57('0xd')](function(_0xcaa95c){logger[_0x7e57('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x46cd7e,_0x3d084f[_0x7e57('0xa')]);})[_0x7e57('0xf')](function(_0xac5c01){logger['error'](_0x7e57('0x25'),_0x46cd7e,JSON[_0x7e57('0x26')](_0xac5c01));})['finally'](function(){logger[_0x7e57('0xe')](_0x7e57('0x27'),_0x46cd7e);_0x12b33b['stop']();});}else{logger[_0x7e57('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x46cd7e);_0x12b33b[_0x7e57('0x28')]();}}else{var _0x53ad7e=this;var _0x4852d0=_0x1e6cdc[0x2][_0x7e57('0x29')](/\\n/g,'\x0a');var _0x40f28b={'credentials':{'private_key':_0x4852d0,'client_email':_0x1e6cdc[0x1]}};var _0x466e11=new dialogflow['SessionsClient'](_0x40f28b);var _0x3977a3=_0x466e11[_0x7e57('0x2a')](_0x1e6cdc[0x0],md5(_0x53ad7e['interaction']['id']));var _0x18fe86={'session':_0x3977a3,'queryInput':{'text':{'text':_0x53ad7e[_0x7e57('0x2b')][_0x7e57('0xa')],'languageCode':_0x1e6cdc[0x3]||'en'}}};return _0x466e11[_0x7e57('0x2c')](_0x18fe86)[_0x7e57('0xd')](function(_0x459c89){if(_0x459c89&&_0x459c89[_0x7e57('0x2d')]){_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x2e')]=_0x459c89;var _0x3dc884=_0x459c89[0x0];var _0xae0a58=_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x30')]&&_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x30')]['fields']?_0x3dc884['queryResult']['diagnosticInfo'][_0x7e57('0x31')][_0x7e57('0x32')][_0x7e57('0x33')]:![];_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x34')]=_0x3dc884['queryResult'][_0x7e57('0x35')];_0x53ad7e['body'][_0x7e57('0x36')]=_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x37')];_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x38')]=_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x30')]&&_0x3dc884[_0x7e57('0x2f')]['diagnosticInfo']['fields']?_0x3dc884[_0x7e57('0x2f')]['diagnosticInfo']['fields']['end_conversation']['boolValue']:![];_0x53ad7e['body'][_0x7e57('0x39')]=_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x3a')][_0x7e57('0x3b')];_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x3c')]=_0x3dc884['queryResult'][_0x7e57('0x3a')]['displayName'];_0x53ad7e[_0x7e57('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3dc884[_0x7e57('0x2f')]['intent'][_0x7e57('0x3d')];_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x3e')]=_0x3dc884[_0x7e57('0x2f')]['languageCode'];_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x3f')]=_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x40')];_0x53ad7e[_0x7e57('0xa')][_0x7e57('0x41')]=_0x3dc884[_0x7e57('0x2f')][_0x7e57('0x42')];_0x3d084f['providerName']=_0x7e57('0x2e');_0x3d084f['providerResponse']=JSON[_0x7e57('0x26')](_0x459c89);var _0x347c8d=[];for(var _0x120b96=0x0;_0x120b96<_0x459c89[_0x7e57('0x2d')];_0x120b96++){var _0x28b430=_0x459c89[_0x120b96];if(_0x28b430&&_0x28b430[_0x7e57('0x2f')]&&_0x28b430[_0x7e57('0x2f')]['fulfillmentText']){_0x347c8d[_0x7e57('0x43')](createMessage(_0x46cd7e,_0x1d3d38,_0x3d084f,_0x28b430[_0x7e57('0x2f')][_0x7e57('0x44')]));}}return Promise[_0x7e57('0x45')](_0x347c8d)['then'](function(){if(_0xae0a58){_0x12b33b[_0x7e57('0x15')]();}else{_0x12b33b[_0x7e57('0x28')]();}})[_0x7e57('0xf')](function(_0x4bbb04){logger['error'](_0x7e57('0x25'),_0x46cd7e,JSON[_0x7e57('0x26')](_0x4bbb04));_0x12b33b[_0x7e57('0x15')]();});}})[_0x7e57('0xf')](function(_0x361141){logger[_0x7e57('0x10')](_0x7e57('0x25'),_0x46cd7e,_0x361141['message']);_0x12b33b['next']();});}}catch(_0x43e2d9){logger['error'](_0x7e57('0x25'),_0x46cd7e,JSON[_0x7e57('0x26')](_0x43e2d9));_0x12b33b[_0x7e57('0x28')]();}};}; \ No newline at end of file +var _0xa906=['chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','catch','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','lodash','md5','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xa906,0x1e3));var _0x6a90=function(_0x5055d0,_0x4fe0a1){_0x5055d0=_0x5055d0-0x0;var _0x2bb934=_0xa906[_0x5055d0];return _0x2bb934;};'use strict';var _=require(_0x6a90('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x6a90('0x1'));var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x6a90('0x2'))(_0x6a90('0x3'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6a90('0x4')),'mailMessage':require(_0x6a90('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6a90('0x6')),'whatsappMessage':require(_0x6a90('0x7'))};function createMessage(_0x219261,_0x5eb203,_0x49fa45,_0x427a66){return new Promise(function(_0x58c66d,_0x48bbc8){var _0x5b6d1b=_['clone'](_0x49fa45);_0x5b6d1b['body']=_0x427a66;return rpc[_0x5eb203+_0x6a90('0x8')][_0x6a90('0x9')](_0x5b6d1b)[_0x6a90('0xa')](function(){logger[_0x6a90('0xb')](_0x6a90('0xc'),_0x219261,_0x5b6d1b[_0x6a90('0xd')]);_0x58c66d();})['catch'](function(_0x42dc57){logger[_0x6a90('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x219261,JSON[_0x6a90('0xf')](_0x42dc57));_0x48bbc8(_0x42dc57);});});}exports[_0x6a90('0x10')]=function(_0x30b716,_0x58c7c7){return function(_0x3c0862){try{if(!_[_0x6a90('0x11')](this[_0x6a90('0x12')][_0x6a90('0x13')])){logger[_0x6a90('0xb')](_0x6a90('0xc'),_0x30b716,_0x6a90('0x14'));return _0x3c0862[_0x6a90('0x15')]();}var _0x94a82c={'ContactId':this['contact']['id'],'sentAt':moment()[_0x6a90('0x16')](_0x6a90('0x17')),'direction':_0x6a90('0x18')};if(this[_0x6a90('0x19')]===_0x6a90('0x1a')||this[_0x6a90('0x19')]===_0x6a90('0x1b')){_0x94a82c[_0x6a90('0x1c')]=this['interaction']['phone'];}var _0x64494c=this['channel'];if(_0x64494c===_0x6a90('0x1d')){_0x94a82c[_0x6a90('0x1e')]=this['account']['id'];}else{_0x94a82c[_[_0x6a90('0x1f')](_0x64494c)+_0x6a90('0x20')]=this['account']['id'];}_0x94a82c[_[_0x6a90('0x1f')](_0x64494c)+_0x6a90('0x21')]=this[_0x6a90('0x12')]['id'];if(this[_0x6a90('0x12')][_0x6a90('0x22')]){var _0x2c471e=_0x58c7c7[0x4];if(!_[_0x6a90('0x23')](_0x2c471e)){_0x94a82c[_0x6a90('0xd')]=utils[_0x6a90('0x24')](_0x2c471e,this);return rpc[_0x64494c+_0x6a90('0x8')][_0x6a90('0x9')](_0x94a82c)[_0x6a90('0xa')](function(_0x2339cd){logger[_0x6a90('0xb')](_0x6a90('0xc'),_0x30b716,_0x94a82c[_0x6a90('0xd')]);})[_0x6a90('0x25')](function(_0x1023ae){logger['error'](_0x6a90('0xc'),_0x30b716,JSON['stringify'](_0x1023ae));})['finally'](function(){logger[_0x6a90('0xb')](_0x6a90('0x26'),_0x30b716);_0x3c0862[_0x6a90('0x27')]();});}else{logger['info'](_0x6a90('0x28'),_0x30b716);_0x3c0862[_0x6a90('0x27')]();}}else{var _0x22c4da=this;var _0x54fbf5=_0x58c7c7[0x2]['replace'](/\\n/g,'\x0a');var _0x1a7318={'credentials':{'private_key':_0x54fbf5,'client_email':_0x58c7c7[0x1]}};var _0x3da95d=new dialogflow[(_0x6a90('0x29'))](_0x1a7318);var _0x57c12e=_0x3da95d[_0x6a90('0x2a')](_0x58c7c7[0x0],md5(_0x22c4da[_0x6a90('0x12')]['id']));var _0xf9ba61={'session':_0x57c12e,'queryInput':{'text':{'text':_0x22c4da[_0x6a90('0x2b')][_0x6a90('0xd')],'languageCode':_0x58c7c7[0x3]||'en'}}};return _0x3da95d['detectIntent'](_0xf9ba61)['then'](function(_0x38d527){if(_0x38d527&&_0x38d527[_0x6a90('0x2c')]){_0x22c4da[_0x6a90('0xd')][_0x6a90('0x2d')]=_0x38d527;var _0x1ec6ac=_0x38d527[0x0];var _0x4f2937=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x2f')]&&_0x1ec6ac[_0x6a90('0x2e')]['diagnosticInfo'][_0x6a90('0x30')]?_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x2f')][_0x6a90('0x30')][_0x6a90('0x31')][_0x6a90('0x32')]:![];_0x22c4da[_0x6a90('0xd')]['DIALOGFLOWV2_ACTION']=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x33')];_0x22c4da['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x1ec6ac[_0x6a90('0x2e')]['allRequiredParamsPresent'];_0x22c4da['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x2f')]&&_0x1ec6ac['queryResult']['diagnosticInfo'][_0x6a90('0x30')]?_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x2f')][_0x6a90('0x30')]['end_conversation'][_0x6a90('0x32')]:![];_0x22c4da[_0x6a90('0xd')][_0x6a90('0x34')]=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x35')]['name'];_0x22c4da[_0x6a90('0xd')][_0x6a90('0x36')]=_0x1ec6ac[_0x6a90('0x2e')]['intent'][_0x6a90('0x37')];_0x22c4da[_0x6a90('0xd')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x35')][_0x6a90('0x38')];_0x22c4da[_0x6a90('0xd')][_0x6a90('0x39')]=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x3a')];_0x22c4da[_0x6a90('0xd')][_0x6a90('0x3b')]=_0x1ec6ac[_0x6a90('0x2e')][_0x6a90('0x3c')];_0x22c4da[_0x6a90('0xd')][_0x6a90('0x3d')]=_0x1ec6ac['queryResult'][_0x6a90('0x3e')];_0x94a82c['providerName']=_0x6a90('0x2d');_0x94a82c[_0x6a90('0x3f')]=JSON['stringify'](_0x38d527);var _0x4a98b9=[];for(var _0x482b02=0x0;_0x482b02<_0x38d527[_0x6a90('0x2c')];_0x482b02++){var _0x2fa52a=_0x38d527[_0x482b02];if(_0x2fa52a&&_0x2fa52a[_0x6a90('0x2e')]&&_0x2fa52a[_0x6a90('0x2e')]['fulfillmentText']){_0x4a98b9['push'](createMessage(_0x30b716,_0x64494c,_0x94a82c,_0x2fa52a[_0x6a90('0x2e')]['fulfillmentText']));}}return Promise['all'](_0x4a98b9)[_0x6a90('0xa')](function(){if(_0x4f2937){_0x3c0862[_0x6a90('0x15')]();}else{_0x3c0862[_0x6a90('0x27')]();}})[_0x6a90('0x25')](function(_0x2ee087){logger[_0x6a90('0xe')](_0x6a90('0xc'),_0x30b716,JSON[_0x6a90('0xf')](_0x2ee087));_0x3c0862[_0x6a90('0x15')]();});}})[_0x6a90('0x25')](function(_0x429500){logger[_0x6a90('0xe')](_0x6a90('0xc'),_0x30b716,_0x429500['message']);_0x3c0862['next']();});}}catch(_0x14368c){logger[_0x6a90('0xe')](_0x6a90('0xc'),_0x30b716,JSON['stringify'](_0x14368c));_0x3c0862[_0x6a90('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 742ebf0..8ee48a3 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7459=['message','join','stop','condition','priorityFalse','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','[%s][GOTOIF]\x20%s'];(function(_0x58c142,_0x4313bc){var _0x19f8b3=function(_0x3b14d3){while(--_0x3b14d3){_0x58c142['push'](_0x58c142['shift']());}};_0x19f8b3(++_0x4313bc);}(_0x7459,0xe4));var _0x9745=function(_0x2d8cf5,_0x335ae9){_0x2d8cf5=_0x2d8cf5-0x0;var _0x11f763=_0x7459[_0x2d8cf5];return _0x11f763;};'use strict';var schema=require(_0x9745('0x0'));var _=require(_0x9745('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0x9745('0x2'))(_0x9745('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x9745('0x4')},'priorityTrue':{'type':_0x9745('0x5'),'message':_0x9745('0x6')},'priorityFalse':{'type':_0x9745('0x5'),'message':_0x9745('0x7')}});exports[_0x9745('0x8')]=function(_0x2e0e13,_0x539494){return function(_0x4e89d8){try{var _0x1c0edf={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x539494[0x0],this),{'wordwrap':![]})[_0x9745('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x539494[0x1],'priorityFalse':_0x539494[0x2]};var _0x3155e3=gotoif[_0x9745('0x0')](_0x1c0edf,{'typecast':!![]});if(_0x3155e3[_0x9745('0xa')]){logger['error'](_0x9745('0xb'),_0x2e0e13,_['map'](_0x3155e3,_0x9745('0xc'))[_0x9745('0xd')](',\x20'));_0x4e89d8[_0x9745('0xe')]();}else{try{var _0x5d3321=eval('('+_0x1c0edf[_0x9745('0xf')]+')');var _0xfd5881=_0x5d3321?_0x1c0edf['priorityTrue']:_0x1c0edf[_0x9745('0x10')];logger[_0x9745('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2e0e13,_0x1c0edf[_0x9745('0xf')],_0x5d3321,_0xfd5881||_0x9745('0x12'));if(_0xfd5881){var _0x27dec7=_[_0x9745('0x13')](_0x4e89d8['rules'](),{'p':_0xfd5881});if(_0x27dec7>=0x0){logger[_0x9745('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2e0e13,_0xfd5881||_0x9745('0x12'),_0x27dec7);_0x4e89d8[_0x9745('0x12')](_0x27dec7);}else{logger['info'](_0x9745('0x14'),_0x2e0e13,_0xfd5881||_0x9745('0x12'));_0x4e89d8[_0x9745('0xe')]();}}else{_0x4e89d8['next']();}}catch(_0x3bf470){logger[_0x9745('0x15')](_0x9745('0x16'),_0x2e0e13,_0x3bf470[_0x9745('0xc')]);_0x4e89d8[_0x9745('0xe')]();}}}catch(_0x128867){logger[_0x9745('0x15')](_0x9745('0xb'),_0x2e0e13,JSON[_0x9745('0x17')](_0x128867));_0x4e89d8['stop']();}};}; \ No newline at end of file +var _0x044a=['error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','stop','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x044a,0xce));var _0xa044=function(_0x1f4de8,_0x51ced3){_0x1f4de8=_0x1f4de8-0x0;var _0xa88436=_0x044a[_0x1f4de8];return _0xa88436;};'use strict';var schema=require(_0xa044('0x0'));var _=require(_0xa044('0x1'));var htmlToText=require(_0xa044('0x2'));var utils=require('./utils');var logger=require(_0xa044('0x3'))(_0xa044('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xa044('0x5')},'priorityTrue':{'type':_0xa044('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xa044('0x7')}});exports['consequence']=function(_0x19982d,_0x53b6af){return function(_0x15d258){try{var _0x545be5={'condition':htmlToText[_0xa044('0x8')](utils[_0xa044('0x9')](_0x53b6af[0x0],this),{'wordwrap':![]})[_0xa044('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x53b6af[0x1],'priorityFalse':_0x53b6af[0x2]};var _0x2a736a=gotoif[_0xa044('0x0')](_0x545be5,{'typecast':!![]});if(_0x2a736a[_0xa044('0xb')]){logger['error'](_0xa044('0xc'),_0x19982d,_[_0xa044('0xd')](_0x2a736a,_0xa044('0xe'))['join'](',\x20'));_0x15d258[_0xa044('0xf')]();}else{try{var _0x562c21=eval('('+_0x545be5['condition']+')');var _0x12f2c6=_0x562c21?_0x545be5[_0xa044('0x10')]:_0x545be5[_0xa044('0x11')];logger['info'](_0xa044('0x12'),_0x19982d,_0x545be5[_0xa044('0x13')],_0x562c21,_0x12f2c6||'next');if(_0x12f2c6){var _0x40cee8=_[_0xa044('0x14')](_0x15d258[_0xa044('0x15')](),{'p':_0x12f2c6});if(_0x40cee8>=0x0){logger[_0xa044('0x16')](_0xa044('0x17'),_0x19982d,_0x12f2c6||_0xa044('0x18'),_0x40cee8);_0x15d258[_0xa044('0x18')](_0x40cee8);}else{logger[_0xa044('0x16')](_0xa044('0x19'),_0x19982d,_0x12f2c6||_0xa044('0x18'));_0x15d258[_0xa044('0xf')]();}}else{_0x15d258[_0xa044('0x18')]();}}catch(_0x28501c){logger[_0xa044('0x1a')](_0xa044('0x1b'),_0x19982d,_0x28501c[_0xa044('0xe')]);_0x15d258['stop']();}}}catch(_0x29d644){logger[_0xa044('0x1a')](_0xa044('0xc'),_0x19982d,JSON[_0xa044('0x1c')](_0x29d644));_0x15d258['stop']();}};}; \ 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 0826844..e7c5c5e 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 _0xebb0=['../../../../config/logger','routing','number','length','error','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash'];(function(_0x1835ee,_0x2925a7){var _0x24a215=function(_0xb6215d){while(--_0xb6215d){_0x1835ee['push'](_0x1835ee['shift']());}};_0x24a215(++_0x2925a7);}(_0xebb0,0xa8));var _0x0ebb=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xebb0[_0x67f95e];return _0x538f5a;};'use strict';var schema=require(_0x0ebb('0x0'));var _=require(_0x0ebb('0x1'));var logger=require(_0x0ebb('0x2'))(_0x0ebb('0x3'));var gotop=schema({'priority':{'type':_0x0ebb('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x15eb26,_0x377872){return function(_0x5119ef){try{var _0x335b97={'priority':_0x377872[0x0]};var _0x2f718d=gotop['validate'](_0x335b97,{'typecast':!![]});if(_0x2f718d[_0x0ebb('0x5')]){logger[_0x0ebb('0x6')]('[%s][GOTOP]\x20%s',_0x15eb26,_['map'](_0x2f718d,'message')['join'](',\x20'));_0x5119ef[_0x0ebb('0x7')]();}else{logger[_0x0ebb('0x8')](_0x0ebb('0x9'),_0x15eb26,_0x335b97[_0x0ebb('0xa')]);if(_0x335b97[_0x0ebb('0xa')]){var _0x18ba57=_[_0x0ebb('0xb')](_0x5119ef[_0x0ebb('0xc')](),{'p':_0x335b97[_0x0ebb('0xa')]});if(_0x18ba57>=0x0){logger['info'](_0x0ebb('0xd'),_0x15eb26,_0x335b97[_0x0ebb('0xa')]||_0x0ebb('0xe'),_0x18ba57);_0x5119ef[_0x0ebb('0xe')](_0x18ba57);}else{logger['info'](_0x0ebb('0xf'),_0x15eb26,_0x335b97['priority']||_0x0ebb('0xe'));_0x5119ef[_0x0ebb('0x7')]();}}else{_0x5119ef['next']();}}}catch(_0x176c99){logger[_0x0ebb('0x6')]('[%s][GOTOP]\x20%s',_0x15eb26,JSON[_0x0ebb('0x10')](_0x176c99));_0x5119ef['stop']();}};}; \ No newline at end of file +var _0x7e92=['error','stringify','validate','lodash','consequence','[%s][GOTOP]\x20%s','message','info','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x17325e,_0x5863f2){var _0x51062a=function(_0x115f73){while(--_0x115f73){_0x17325e['push'](_0x17325e['shift']());}};_0x51062a(++_0x5863f2);}(_0x7e92,0x17b));var _0x27e9=function(_0x2a7835,_0x11b1ce){_0x2a7835=_0x2a7835-0x0;var _0x107f20=_0x7e92[_0x2a7835];return _0x107f20;};'use strict';var schema=require(_0x27e9('0x0'));var _=require(_0x27e9('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x27e9('0x2')]=function(_0xbe0889,_0x208c27){return function(_0x1311e7){try{var _0xdcd0f9={'priority':_0x208c27[0x0]};var _0x4df079=gotop[_0x27e9('0x0')](_0xdcd0f9,{'typecast':!![]});if(_0x4df079['length']){logger['error'](_0x27e9('0x3'),_0xbe0889,_['map'](_0x4df079,_0x27e9('0x4'))['join'](',\x20'));_0x1311e7['stop']();}else{logger[_0x27e9('0x5')]('[%s][GOTOP]\x20priority\x20%s',_0xbe0889,_0xdcd0f9['priority']);if(_0xdcd0f9[_0x27e9('0x6')]){var _0xbc3f24=_['findIndex'](_0x1311e7['rules'](),{'p':_0xdcd0f9[_0x27e9('0x6')]});if(_0xbc3f24>=0x0){logger['info'](_0x27e9('0x7'),_0xbe0889,_0xdcd0f9['priority']||_0x27e9('0x8'),_0xbc3f24);_0x1311e7[_0x27e9('0x8')](_0xbc3f24);}else{logger['info'](_0x27e9('0x9'),_0xbe0889,_0xdcd0f9[_0x27e9('0x6')]||'next');_0x1311e7[_0x27e9('0xa')]();}}else{_0x1311e7[_0x27e9('0x8')]();}}}catch(_0x52b430){logger[_0x27e9('0xb')](_0x27e9('0x3'),_0xbe0889,JSON[_0x27e9('0xc')](_0x52b430));_0x1311e7[_0x27e9('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index f3ce584..8b4c4b4 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 _0x9d77=['account','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','AccountId'];(function(_0x491eda,_0x35e96f){var _0x4f583e=function(_0x328da8){while(--_0x328da8){_0x491eda['push'](_0x491eda['shift']());}};_0x4f583e(++_0x35e96f);}(_0x9d77,0x144));var _0x79d7=function(_0x9f56a0,_0x3ba89d){_0x9f56a0=_0x9f56a0-0x0;var _0x2ea2eb=_0x9d77[_0x9f56a0];return _0x2ea2eb;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x79d7('0x0'))(_0x79d7('0x1'));var rpc={'chatMessage':require(_0x79d7('0x2')),'openchannelMessage':require(_0x79d7('0x3')),'mailMessage':require(_0x79d7('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x79d7('0x5')),'whatsappMessage':require(_0x79d7('0x6'))};exports[_0x79d7('0x7')]=function(_0x242c73,_0x19f61e){return function(_0x4f646e){try{var _0xb655d2={'body':utils[_0x79d7('0x8')](_0x19f61e[0x0],this),'ContactId':this[_0x79d7('0x9')]['id']};if(this[_0x79d7('0xa')]===_0x79d7('0xb')){_0xb655d2['ChatWebsiteId']=this['account']['id'];}else{_0xb655d2[_[_0x79d7('0xc')](this['channel'])+_0x79d7('0xd')]=this[_0x79d7('0xe')]['id'];}_0xb655d2[_[_0x79d7('0xc')](this[_0x79d7('0xa')])+_0x79d7('0xf')]=this['interaction']['id'];if(rpc[this[_0x79d7('0xa')]+_0x79d7('0x10')]){return rpc[this['channel']+_0x79d7('0x10')][_0x79d7('0x11')](_0xb655d2)[_0x79d7('0x12')](function(_0x311d94){logger[_0x79d7('0x13')](_0x79d7('0x14'),_0x242c73,_0xb655d2[_0x79d7('0x15')]);_0x4f646e[_0x79d7('0x16')]();})['catch'](function(_0x17cd9b){logger[_0x79d7('0x17')](_0x79d7('0x14'),_0x242c73,JSON[_0x79d7('0x18')](_0x17cd9b));_0x4f646e[_0x79d7('0x19')]();});}}catch(_0x1ec110){logger[_0x79d7('0x17')](_0x79d7('0x14'),_0x242c73,JSON[_0x79d7('0x18')](_0x1ec110));_0x4f646e[_0x79d7('0x19')]();}};}; \ No newline at end of file +var _0xceda=['next','catch','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','chat','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xceda,0x1c4));var _0xaced=function(_0x417514,_0x65a417){_0x417514=_0x417514-0x0;var _0x164e8e=_0xceda[_0x417514];return _0x164e8e;};'use strict';var _=require(_0xaced('0x0'));var utils=require(_0xaced('0x1'));var logger=require(_0xaced('0x2'))(_0xaced('0x3'));var rpc={'chatMessage':require(_0xaced('0x4')),'openchannelMessage':require(_0xaced('0x5')),'mailMessage':require(_0xaced('0x6')),'smsMessage':require(_0xaced('0x7')),'faxMessage':require(_0xaced('0x8')),'whatsappMessage':require(_0xaced('0x9'))};exports[_0xaced('0xa')]=function(_0xb65024,_0x106c62){return function(_0x4bd96d){try{var _0x42f97f={'body':utils['getMustacheRender'](_0x106c62[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xaced('0xb')){_0x42f97f['ChatWebsiteId']=this[_0xaced('0xc')]['id'];}else{_0x42f97f[_[_0xaced('0xd')](this[_0xaced('0xe')])+_0xaced('0xf')]=this['account']['id'];}_0x42f97f[_[_0xaced('0xd')](this[_0xaced('0xe')])+_0xaced('0x10')]=this[_0xaced('0x11')]['id'];if(rpc[this[_0xaced('0xe')]+_0xaced('0x12')]){return rpc[this[_0xaced('0xe')]+_0xaced('0x12')][_0xaced('0x13')](_0x42f97f)[_0xaced('0x14')](function(_0x5cea45){logger[_0xaced('0x15')](_0xaced('0x16'),_0xb65024,_0x42f97f[_0xaced('0x17')]);_0x4bd96d[_0xaced('0x18')]();})[_0xaced('0x19')](function(_0x1c0326){logger[_0xaced('0x1a')](_0xaced('0x16'),_0xb65024,JSON['stringify'](_0x1c0326));_0x4bd96d['stop']();});}}catch(_0xe9e439){logger[_0xaced('0x1a')](_0xaced('0x16'),_0xb65024,JSON[_0xaced('0x1b')](_0xe9e439));_0x4bd96d['stop']();}};}; \ 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 0bf8a52..015bb74 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 _0x8d16=['consequence','info','[%s][NOOP]\x20%s','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d16,0x189));var _0x68d1=function(_0x539e14,_0x2c94){_0x539e14=_0x539e14-0x0;var _0x3be693=_0x8d16[_0x539e14];return _0x3be693;};'use strict';var utils=require(_0x68d1('0x0'));var logger=require(_0x68d1('0x1'))(_0x68d1('0x2'));exports[_0x68d1('0x3')]=function(_0x1d21c1,_0x378c70){return function(_0x443295){try{logger[_0x68d1('0x4')](_0x68d1('0x5'),_0x1d21c1,utils['getMustacheRender'](_0x378c70[0x0],this));_0x443295['next']();}catch(_0x496efa){logger[_0x68d1('0x6')](_0x68d1('0x5'),_0x1d21c1,JSON[_0x68d1('0x7')](_0x496efa));_0x443295[_0x68d1('0x8')]();}};}; \ No newline at end of file +var _0xeec6=['../../../../config/logger','routing','consequence','info','getMustacheRender','[%s][NOOP]\x20%s','stringify'];(function(_0x1d24c6,_0x2aabac){var _0xdfcdad=function(_0x126058){while(--_0x126058){_0x1d24c6['push'](_0x1d24c6['shift']());}};_0xdfcdad(++_0x2aabac);}(_0xeec6,0x126));var _0x6eec=function(_0x3a0f77,_0x39f605){_0x3a0f77=_0x3a0f77-0x0;var _0x54fd0c=_0xeec6[_0x3a0f77];return _0x54fd0c;};'use strict';var utils=require('./utils');var logger=require(_0x6eec('0x0'))(_0x6eec('0x1'));exports[_0x6eec('0x2')]=function(_0x44c8d0,_0x37afe4){return function(_0xee4e0b){try{logger[_0x6eec('0x3')]('[%s][NOOP]\x20%s',_0x44c8d0,utils[_0x6eec('0x4')](_0x37afe4[0x0],this));_0xee4e0b['next']();}catch(_0x405d9e){logger['error'](_0x6eec('0x5'),_0x44c8d0,JSON[_0x6eec('0x6')](_0x405d9e));_0xee4e0b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 15f1343..f03b244 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 _0xe165=['complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','joinAt','queue','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','QueueId','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','waiting','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','map','join','stop','find','Queues','qtimeout','rules','end'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe165,0x190));var _0x5e16=function(_0x21090a,_0x2f1115){_0x21090a=_0x21090a-0x0;var _0x449410=_0xe165[_0x21090a];return _0x449410;};'use strict';var schema=require(_0x5e16('0x0'));var _=require(_0x5e16('0x1'));var util=require('util');var seqqueue=require(_0x5e16('0x2'));var moment=require(_0x5e16('0x3'));var Redis=require(_0x5e16('0x4'));var config=require(_0x5e16('0x5'));var logger=require(_0x5e16('0x6'))(_0x5e16('0x7'));var strategy=require(_0x5e16('0x8'));config[_0x5e16('0x9')]=_[_0x5e16('0xa')](config[_0x5e16('0x9')],{'host':_0x5e16('0xb'),'port':0x18eb});var io=require(_0x5e16('0xc'))(new Redis(config['redis']));var attributes=['id',_0x5e16('0xd'),_0x5e16('0xe'),'queue','from',_0x5e16('0xf')];function emit(_0xb4774a,_0x2ba75a,_0x3726b4){io['to'](_0xb4774a)['emit'](_0x2ba75a,_0x3726b4);}function emitChannelQueueInteraction(_0x50b184,_0x108ab2,_0x481b8b,_0x2219de,_0x43ce07,_0x3ad3c2,_0x4b2432,_0x441a41){var _0x23016a=_['clone'](_0x481b8b);_0x23016a[_0x5e16('0xd')]=_0x441a41;_0x23016a[_0x5e16('0x10')]=_0x108ab2;_0x23016a[_0x5e16('0xe')]=_0x2219de;_0x23016a['id']=_0x43ce07;if(_0x3ad3c2){_0x4b2432[util[_0x5e16('0x11')](_0x5e16('0x12'),_0x50b184)][_0x43ce07]=_[_0x5e16('0x13')](_0x23016a,attributes);}else{delete _0x4b2432[util[_0x5e16('0x11')](_0x5e16('0x12'),_0x50b184)][_0x43ce07];}emit(util['format']('%s:queue:%s',_0x50b184,_0x108ab2),util[_0x5e16('0x11')](_0x5e16('0x14'),_0x50b184,_0x3ad3c2?_0x5e16('0x15'):'remove'),_[_0x5e16('0x13')](_0x23016a,attributes));}var rpc={'openchannelQueueReport':require(_0x5e16('0x16')),'mailQueueReport':require(_0x5e16('0x17')),'chatQueueReport':require(_0x5e16('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x5e16('0x19')),'whatsappQueueReport':require(_0x5e16('0x1a'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x5e16('0x1b')},'timeout':{'type':_0x5e16('0x1c'),'message':_0x5e16('0x1d')}});function startRouting(_0x12b8b2,_0x475bc6,_0x12a793,_0x49bfae){if(_0x12b8b2&&_0x475bc6&&_0x12a793){_0x475bc6['waiting']+=0x1;var _0x5b6541={'uniqueid':_0x12b8b2,'from':_0x12a793[_0x5e16('0x1e')]?_0x12a793['body'][_0x5e16('0x1f')]:'','joinAt':moment()['format'](_0x5e16('0x20')),'ContactId':_0x12a793[_0x5e16('0x21')]?_0x12a793['contact']['id']:null,'ListId':_0x12a793['list']?_0x12a793['list']['id']:null};_0x5b6541[_['upperFirst'](_0x12a793['channel'])+_0x5e16('0x22')]=_0x475bc6['id']||null;_0x5b6541[_[_0x5e16('0x23')](_0x12a793[_0x5e16('0x24')])+_0x5e16('0x25')]=_0x12a793[_0x5e16('0x26')]?_0x12a793['interaction']['id']:null;_0x5b6541[_[_0x5e16('0x23')](_0x12a793[_0x5e16('0x24')])+_0x5e16('0x27')]=_0x12a793[_0x5e16('0x28')]?_0x12a793[_0x5e16('0x28')]['id']:null;_0x5b6541[_[_0x5e16('0x23')](_0x12a793[_0x5e16('0x24')])+(_0x12a793[_0x5e16('0x24')]!==_0x5e16('0x29')?_0x5e16('0x2a'):_0x5e16('0x2b'))]=_0x12a793[_0x5e16('0xe')]?_0x12a793[_0x5e16('0xe')]['id']:null;logger[_0x5e16('0x2c')](util['format'](_0x5e16('0x2d'),_0x12b8b2,_0x475bc6[_0x5e16('0x2e')]));emitChannelQueueInteraction(_0x12a793[_0x5e16('0x24')],_0x475bc6[_0x5e16('0x2e')],_0x5b6541,_0x12a793[_0x5e16('0xe')][_0x5e16('0x2e')],_0x12a793[_0x5e16('0x28')]['id'],!![],_0x49bfae,_0x475bc6['id']);if(rpc[_0x12a793[_0x5e16('0x24')]+_0x5e16('0x2f')]){return rpc[_0x12a793['channel']+_0x5e16('0x2f')][_0x5e16('0x30')](_0x5b6541)['catch'](function(_0xa07add){logger[_0x5e16('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x1b9ee5,_0x3daf95,_0x83ab1c,_0x27d4f6){if(_0x1b9ee5&&_0x3daf95){_0x3daf95['waiting']-=0x1;var _0x5dd9a8={'leaveAt':moment()['format'](_0x5e16('0x20')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x5e16('0x32')};logger[_0x5e16('0x2c')](util[_0x5e16('0x11')](_0x5e16('0x33'),_0x1b9ee5,_0x3daf95['name']));emitChannelQueueInteraction(_0x83ab1c[_0x5e16('0x24')],_0x3daf95['name'],_0x83ab1c['body'],_0x83ab1c[_0x5e16('0xe')]['name'],_0x83ab1c[_0x5e16('0x28')]['id'],![],_0x27d4f6,_0x3daf95['id']);if(rpc[_0x83ab1c[_0x5e16('0x24')]+'QueueReport']){return rpc[_0x83ab1c[_0x5e16('0x24')]+_0x5e16('0x2f')][_0x5e16('0x34')](_0x1b9ee5,_0x5dd9a8)[_0x5e16('0x35')](function(_0x5836b3){logger['error'](_0x5e16('0x36'));});}}}function endRouting(_0x59e6ef,_0x72e9fa,_0x152ecd,_0xdcac9e){if(_0x59e6ef&&_0x72e9fa){_0x72e9fa[_0x5e16('0x37')]-=0x1;var _0x172bad={'leaveAt':moment()[_0x5e16('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x5e16('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x5e16('0x38')};logger[_0x5e16('0x2c')](util[_0x5e16('0x11')](_0x5e16('0x39'),_0x59e6ef,_0x72e9fa[_0x5e16('0x2e')]));emitChannelQueueInteraction(_0x152ecd['channel'],_0x72e9fa[_0x5e16('0x2e')],_0x152ecd['body'],_0x152ecd[_0x5e16('0xe')][_0x5e16('0x2e')],_0x152ecd[_0x5e16('0x28')]['id'],![],_0xdcac9e);if(rpc[_0x152ecd[_0x5e16('0x24')]+_0x5e16('0x2f')]){return rpc[_0x152ecd[_0x5e16('0x24')]+_0x5e16('0x2f')]['update'](_0x59e6ef,_0x172bad)[_0x5e16('0x35')](function(_0x12efae){logger[_0x5e16('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x3f3aaa){return function(_0x5019f9){return _0x5019f9[_0x5e16('0x2e')][_0x5e16('0x3a')]()===_0x3f3aaa['toLowerCase']();};}exports[_0x5e16('0x3b')]=function(_0xc27df2,_0x1c75d8,_0x320653,_0x47fe6b){return function(_0x17b01f){try{var _0x29a56b={'name':_0x1c75d8[0x0],'timeout':_0x1c75d8[0x1]};var _0x431fc1=queue['validate'](_0x29a56b,{'typecast':!![]});if(_0x431fc1['length']){logger[_0x5e16('0x31')]('[%s][QUEUE]\x20%s',_0xc27df2,_[_0x5e16('0x3c')](_0x431fc1,_0x5e16('0x28'))[_0x5e16('0x3d')](',\x20'));_0x17b01f[_0x5e16('0x3e')]();}else{var _0x2ecb17=_[_0x5e16('0x3f')](_0x320653[_0x47fe6b['channel']+_0x5e16('0x40')],handleFindQueue(_0x29a56b['name']));if(_0x2ecb17){startRouting(_0xc27df2,_0x2ecb17,_0x47fe6b,_0x320653);var _0x32db0b=(_0x2ecb17[_0x5e16('0x38')]||0xa)*0x3e8;var _0xc9f412=(_0x29a56b[_0x5e16('0x38')]||0x14)*0x3e8;var _0xd3f07,_0x24dab7;if(_0x32db0b>_0xc9f412){_0xc9f412=_0x32db0b;}var _0x51aa12=seqqueue['createQueue'](_0x32db0b);_0x51aa12['id']=_0xc27df2;_0x51aa12['atimeout']=_0x32db0b;_0x51aa12[_0x5e16('0x41')]=_0xc9f412;_0x51aa12[_0x5e16('0x24')]=_0x47fe6b[_0x5e16('0x24')];_0x320653[_0x5e16('0x42')][_0xc27df2]['on'](_0x5e16('0x43'),function(){logger[_0x5e16('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0xc27df2);stopRouting(_0xc27df2,_0x2ecb17,_0x47fe6b,_0x320653);clearTimeout(_0xd3f07);_0xd3f07=undefined;_0x51aa12['close'](!![]);if(_0x320653[_0x5e16('0x42')][_0xc27df2]){delete _0x320653['rules'][_0xc27df2];}_0x17b01f[_0x5e16('0x3e')]();});_0x320653[_0x5e16('0x42')][_0xc27df2]['on'](_0x5e16('0x44'),function(){if(_0x320653[_0x5e16('0x42')][_0xc27df2]){delete _0x320653[_0x5e16('0x42')][_0xc27df2];}});_0xd3f07=setTimeout(function(){logger[_0x5e16('0x2c')](_0x5e16('0x45'),_0xc27df2);endRouting(_0xc27df2,_0x2ecb17,_0x47fe6b,_0x320653);clearTimeout(_0xd3f07);_0x51aa12[_0x5e16('0x46')](!![]);_0x17b01f[_0x5e16('0x47')]();},_0xc9f412);switch(_0x2ecb17[_0x5e16('0x48')]){case _0x5e16('0x49'):strategy[_0x5e16('0x49')](_0x51aa12,_0x2ecb17,_0x320653,_0x47fe6b);break;default:strategy[_0x5e16('0x4a')](_0x51aa12,_0x2ecb17,_0x320653,_0x47fe6b);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xc27df2,_0x29a56b[_0x5e16('0x2e')]);_0x17b01f[_0x5e16('0x3e')]();}}}catch(_0x2d1e4a){console[_0x5e16('0x4b')](_0x2d1e4a);logger[_0x5e16('0x31')](_0x5e16('0x4c'),_0xc27df2,_0x2d1e4a[_0x5e16('0x4d')]);_0x17b01f['stop']();}};}; \ No newline at end of file +var _0xf462=['queue_id','account','queue','joinAt','emit','format','%sQueuesWaitingInteractions','pick','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','validate','length','[%s][QUEUE]\x20%s','map','join','stop','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','defaults','redis','localhost'];(function(_0x1a6659,_0xcc8b76){var _0x53aeb8=function(_0x2b58f6){while(--_0x2b58f6){_0x1a6659['push'](_0x1a6659['shift']());}};_0x53aeb8(++_0xcc8b76);}(_0xf462,0x1ad));var _0x2f46=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0xf462[_0x135904];return _0x1ce7d5;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x2f46('0x0'));var seqqueue=require('seq-queue');var moment=require(_0x2f46('0x1'));var Redis=require(_0x2f46('0x2'));var config=require(_0x2f46('0x3'));var logger=require(_0x2f46('0x4'))(_0x2f46('0x5'));var strategy=require('./strategy');config['redis']=_[_0x2f46('0x6')](config[_0x2f46('0x7')],{'host':_0x2f46('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2f46('0x7')]));var attributes=['id',_0x2f46('0x9'),_0x2f46('0xa'),_0x2f46('0xb'),'from',_0x2f46('0xc')];function emit(_0x64ffba,_0x4c77f3,_0x1a7aaf){io['to'](_0x64ffba)[_0x2f46('0xd')](_0x4c77f3,_0x1a7aaf);}function emitChannelQueueInteraction(_0x58afc2,_0x4be840,_0x3d11b1,_0x408d9f,_0x33a143,_0x4813af,_0x599a74,_0x2aa065){var _0x1fac2e=_['clone'](_0x3d11b1);_0x1fac2e[_0x2f46('0x9')]=_0x2aa065;_0x1fac2e[_0x2f46('0xb')]=_0x4be840;_0x1fac2e[_0x2f46('0xa')]=_0x408d9f;_0x1fac2e['id']=_0x33a143;if(_0x4813af){_0x599a74[util[_0x2f46('0xe')](_0x2f46('0xf'),_0x58afc2)][_0x33a143]=_[_0x2f46('0x10')](_0x1fac2e,attributes);}else{delete _0x599a74[util[_0x2f46('0xe')]('%sQueuesWaitingInteractions',_0x58afc2)][_0x33a143];}emit(util['format']('%s:queue:%s',_0x58afc2,_0x4be840),util[_0x2f46('0xe')]('%s_queue_waiting_interaction:%s',_0x58afc2,_0x4813af?_0x2f46('0x11'):'remove'),_[_0x2f46('0x10')](_0x1fac2e,attributes));}var rpc={'openchannelQueueReport':require(_0x2f46('0x12')),'mailQueueReport':require(_0x2f46('0x13')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2f46('0x14')),'faxQueueReport':require(_0x2f46('0x15')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x2f46('0x16'),'required':!![],'message':_0x2f46('0x17')},'timeout':{'type':_0x2f46('0x18'),'message':_0x2f46('0x19')}});function startRouting(_0x2cf2c9,_0x388165,_0x54bb3a,_0x21dd47){if(_0x2cf2c9&&_0x388165&&_0x54bb3a){_0x388165[_0x2f46('0x1a')]+=0x1;var _0x520d54={'uniqueid':_0x2cf2c9,'from':_0x54bb3a[_0x2f46('0x1b')]?_0x54bb3a[_0x2f46('0x1b')][_0x2f46('0x1c')]:'','joinAt':moment()[_0x2f46('0xe')](_0x2f46('0x1d')),'ContactId':_0x54bb3a[_0x2f46('0x1e')]?_0x54bb3a[_0x2f46('0x1e')]['id']:null,'ListId':_0x54bb3a['list']?_0x54bb3a[_0x2f46('0x1f')]['id']:null};_0x520d54[_['upperFirst'](_0x54bb3a['channel'])+_0x2f46('0x20')]=_0x388165['id']||null;_0x520d54[_[_0x2f46('0x21')](_0x54bb3a[_0x2f46('0x22')])+'InteractionId']=_0x54bb3a['interaction']?_0x54bb3a[_0x2f46('0x23')]['id']:null;_0x520d54[_['upperFirst'](_0x54bb3a[_0x2f46('0x22')])+_0x2f46('0x24')]=_0x54bb3a[_0x2f46('0x25')]?_0x54bb3a[_0x2f46('0x25')]['id']:null;_0x520d54[_[_0x2f46('0x21')](_0x54bb3a[_0x2f46('0x22')])+(_0x54bb3a[_0x2f46('0x22')]!==_0x2f46('0x26')?_0x2f46('0x27'):_0x2f46('0x28'))]=_0x54bb3a[_0x2f46('0xa')]?_0x54bb3a[_0x2f46('0xa')]['id']:null;logger[_0x2f46('0x29')](util[_0x2f46('0xe')](_0x2f46('0x2a'),_0x2cf2c9,_0x388165[_0x2f46('0x2b')]));emitChannelQueueInteraction(_0x54bb3a[_0x2f46('0x22')],_0x388165[_0x2f46('0x2b')],_0x520d54,_0x54bb3a[_0x2f46('0xa')]['name'],_0x54bb3a[_0x2f46('0x25')]['id'],!![],_0x21dd47,_0x388165['id']);if(rpc[_0x54bb3a['channel']+_0x2f46('0x2c')]){return rpc[_0x54bb3a[_0x2f46('0x22')]+_0x2f46('0x2c')]['create'](_0x520d54)['catch'](function(_0x5e77be){logger[_0x2f46('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x2830b8,_0x2665c,_0x2f14fa,_0x2a2537){if(_0x2830b8&&_0x2665c){_0x2665c[_0x2f46('0x1a')]-=0x1;var _0x192735={'leaveAt':moment()[_0x2f46('0xe')](_0x2f46('0x1d')),'acceptAt':moment()['format'](_0x2f46('0x1d')),'reason':_0x2f46('0x2e')};logger[_0x2f46('0x29')](util['format'](_0x2f46('0x2f'),_0x2830b8,_0x2665c[_0x2f46('0x2b')]));emitChannelQueueInteraction(_0x2f14fa[_0x2f46('0x22')],_0x2665c[_0x2f46('0x2b')],_0x2f14fa[_0x2f46('0x1b')],_0x2f14fa[_0x2f46('0xa')][_0x2f46('0x2b')],_0x2f14fa[_0x2f46('0x25')]['id'],![],_0x2a2537,_0x2665c['id']);if(rpc[_0x2f14fa[_0x2f46('0x22')]+'QueueReport']){return rpc[_0x2f14fa[_0x2f46('0x22')]+'QueueReport'][_0x2f46('0x30')](_0x2830b8,_0x192735)['catch'](function(_0x11116b){logger[_0x2f46('0x2d')](_0x2f46('0x31'));});}}}function endRouting(_0x595944,_0x50cccd,_0x50086c,_0x121cd9){if(_0x595944&&_0x50cccd){_0x50cccd['waiting']-=0x1;var _0x39694f={'leaveAt':moment()[_0x2f46('0xe')](_0x2f46('0x1d')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2f46('0x32')};logger[_0x2f46('0x29')](util[_0x2f46('0xe')](_0x2f46('0x33'),_0x595944,_0x50cccd[_0x2f46('0x2b')]));emitChannelQueueInteraction(_0x50086c[_0x2f46('0x22')],_0x50cccd[_0x2f46('0x2b')],_0x50086c[_0x2f46('0x1b')],_0x50086c[_0x2f46('0xa')][_0x2f46('0x2b')],_0x50086c[_0x2f46('0x25')]['id'],![],_0x121cd9);if(rpc[_0x50086c['channel']+_0x2f46('0x2c')]){return rpc[_0x50086c[_0x2f46('0x22')]+'QueueReport']['update'](_0x595944,_0x39694f)[_0x2f46('0x34')](function(_0x114d76){logger[_0x2f46('0x2d')](_0x2f46('0x31'));});}}}function handleFindQueue(_0x347b8d){return function(_0xe47ca7){return _0xe47ca7['name']['toLowerCase']()===_0x347b8d[_0x2f46('0x35')]();};}exports['consequence']=function(_0x1e17e0,_0x5f3c43,_0x3300cd,_0x5af110){return function(_0x15d66f){try{var _0x12f056={'name':_0x5f3c43[0x0],'timeout':_0x5f3c43[0x1]};var _0x58e89f=queue[_0x2f46('0x36')](_0x12f056,{'typecast':!![]});if(_0x58e89f[_0x2f46('0x37')]){logger[_0x2f46('0x2d')](_0x2f46('0x38'),_0x1e17e0,_[_0x2f46('0x39')](_0x58e89f,_0x2f46('0x25'))[_0x2f46('0x3a')](',\x20'));_0x15d66f[_0x2f46('0x3b')]();}else{var _0x1bb572=_['find'](_0x3300cd[_0x5af110[_0x2f46('0x22')]+'Queues'],handleFindQueue(_0x12f056[_0x2f46('0x2b')]));if(_0x1bb572){startRouting(_0x1e17e0,_0x1bb572,_0x5af110,_0x3300cd);var _0x249c69=(_0x1bb572[_0x2f46('0x32')]||0xa)*0x3e8;var _0x58f4be=(_0x12f056[_0x2f46('0x32')]||0x14)*0x3e8;var _0x52d4e8,_0x48ebef;if(_0x249c69>_0x58f4be){_0x58f4be=_0x249c69;}var _0x46fe06=seqqueue[_0x2f46('0x3c')](_0x249c69);_0x46fe06['id']=_0x1e17e0;_0x46fe06[_0x2f46('0x3d')]=_0x249c69;_0x46fe06['qtimeout']=_0x58f4be;_0x46fe06['channel']=_0x5af110['channel'];_0x3300cd[_0x2f46('0x3e')][_0x1e17e0]['on'](_0x2f46('0x3f'),function(){logger[_0x2f46('0x29')](_0x2f46('0x40'),_0x1e17e0);stopRouting(_0x1e17e0,_0x1bb572,_0x5af110,_0x3300cd);clearTimeout(_0x52d4e8);_0x52d4e8=undefined;_0x46fe06[_0x2f46('0x41')](!![]);if(_0x3300cd[_0x2f46('0x3e')][_0x1e17e0]){delete _0x3300cd[_0x2f46('0x3e')][_0x1e17e0];}_0x15d66f[_0x2f46('0x3b')]();});_0x3300cd['rules'][_0x1e17e0]['on'](_0x2f46('0x42'),function(){if(_0x3300cd['rules'][_0x1e17e0]){delete _0x3300cd[_0x2f46('0x3e')][_0x1e17e0];}});_0x52d4e8=setTimeout(function(){logger[_0x2f46('0x29')](_0x2f46('0x43'),_0x1e17e0);endRouting(_0x1e17e0,_0x1bb572,_0x5af110,_0x3300cd);clearTimeout(_0x52d4e8);_0x46fe06[_0x2f46('0x41')](!![]);_0x15d66f[_0x2f46('0x44')]();},_0x58f4be);switch(_0x1bb572[_0x2f46('0x45')]){case _0x2f46('0x46'):strategy[_0x2f46('0x46')](_0x46fe06,_0x1bb572,_0x3300cd,_0x5af110);break;default:strategy['beepall'](_0x46fe06,_0x1bb572,_0x3300cd,_0x5af110);}}else{logger[_0x2f46('0x2d')](_0x2f46('0x47'),_0x1e17e0,_0x12f056[_0x2f46('0x2b')]);_0x15d66f[_0x2f46('0x3b')]();}}}catch(_0x4f8f01){console['log'](_0x4f8f01);logger[_0x2f46('0x2d')](_0x2f46('0x38'),_0x1e17e0,_0x4f8f01[_0x2f46('0x48')]);_0x15d66f[_0x2f46('0x3b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 59a5cc9..512e34a 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 _0xfd16=['timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','notificationId','squeue','agent','routing','push','handleRun','bind'];(function(_0x278540,_0x195b6f){var _0x262d2a=function(_0x33bff0){while(--_0x33bff0){_0x278540['push'](_0x278540['shift']());}};_0x262d2a(++_0x195b6f);}(_0xfd16,0x19a));var _0x6fd1=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xfd16[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x6fd1('0x0'));var uuid=require(_0x6fd1('0x1'));var util=require('./util');var logger=require(_0x6fd1('0x2'))('routing');var Agent=function(_0x23e0bd,_0x252474,_0x327f05,_0x1dbdd4){this[_0x6fd1('0x3')]=uuid['v4']();this[_0x6fd1('0x4')]=_0x23e0bd;this[_0x6fd1('0x5')]=_0x252474;this['realtime']=_0x327f05;this[_0x6fd1('0x6')]=_0x1dbdd4;this[_0x6fd1('0x4')][_0x6fd1('0x7')](this[_0x6fd1('0x8')][_0x6fd1('0x9')](this),this['handleTimeout'][_0x6fd1('0x9')](this));this[_0x6fd1('0x4')]['on'](_0x6fd1('0xa'),this[_0x6fd1('0xb')][_0x6fd1('0x9')](this));this['squeue']['on'](_0x6fd1('0xc'),this[_0x6fd1('0xd')][_0x6fd1('0x9')](this));};Agent[_0x6fd1('0xe')][_0x6fd1('0x7')]=function(){this['squeue'][_0x6fd1('0x7')](this[_0x6fd1('0x8')][_0x6fd1('0x9')](this),this[_0x6fd1('0xb')][_0x6fd1('0x9')](this));};Agent[_0x6fd1('0xe')]['handleDrained']=function(){this[_0x6fd1('0xb')](!![]);};Agent[_0x6fd1('0xe')]['handleRun']=function(_0x4f7d3e){logger[_0x6fd1('0xf')](_0x6fd1('0x10'),this[_0x6fd1('0x4')]['id'],this['agent']['id']);if(_[_0x6fd1('0x11')](this[_0x6fd1('0x12')][_0x6fd1('0x13')][this['agent']['id']])){logger[_0x6fd1('0xf')](_0x6fd1('0x14'),this[_0x6fd1('0x4')]['id'],this[_0x6fd1('0x5')]['id']);setTimeout(this['push'][_0x6fd1('0x9')](this),0x3e8);}else{if(this[_0x6fd1('0x6')][_0x6fd1('0x15')]||util['isAgentAvailable'](this[_0x6fd1('0x4')]['id'],this[_0x6fd1('0x12')]['agents'][this[_0x6fd1('0x5')]['id']],this['squeue'][_0x6fd1('0x16')],![])){this[_0x6fd1('0x12')]['agents'][this[_0x6fd1('0x5')]['id']][_0x6fd1('0x17')]=!![];this['realtime']['agents'][this['agent']['id']][_0x6fd1('0x18')]=undefined;util[_0x6fd1('0x19')](this[_0x6fd1('0x3')],this[_0x6fd1('0x4')]['id'],this[_0x6fd1('0x12')][_0x6fd1('0x13')][this[_0x6fd1('0x5')]['id']],null,this['routing']);util[_0x6fd1('0x1a')](this[_0x6fd1('0x4')]['id'],this[_0x6fd1('0x12')][_0x6fd1('0x13')][this[_0x6fd1('0x5')]['id']],_0x6fd1('0x1b')+(this[_0x6fd1('0x6')][_0x6fd1('0x15')]?_0x6fd1('0x1c'):''));}else{logger['info'](_0x6fd1('0x1d'),this['squeue']['id'],this[_0x6fd1('0x5')]['id']);setTimeout(this[_0x6fd1('0x7')][_0x6fd1('0x9')](this),0x3e8);}}};Agent['prototype'][_0x6fd1('0xb')]=function(_0x49b7ec){if(_[_0x6fd1('0x11')](this['realtime'][_0x6fd1('0x13')][this[_0x6fd1('0x5')]['id']])){return logger['info'](_0x6fd1('0x14'),this[_0x6fd1('0x4')]['id'],this['agent']['id']);}else{logger[_0x6fd1('0xf')](_0x6fd1('0x1e'),this['squeue']['id'],this[_0x6fd1('0x5')]['id']);util[_0x6fd1('0x1f')](this[_0x6fd1('0x3')],this['squeue']['id'],this['realtime']['agents'][this[_0x6fd1('0x5')]['id']],null,this[_0x6fd1('0x6')]);this['realtime'][_0x6fd1('0x13')][this[_0x6fd1('0x5')]['id']][_0x6fd1('0x17')]=![];this[_0x6fd1('0x12')]['agents'][this[_0x6fd1('0x5')]['id']][_0x6fd1('0x18')]=undefined;util[_0x6fd1('0x1a')](this['squeue']['id'],this[_0x6fd1('0x12')]['agents'][this[_0x6fd1('0x5')]['id']],_0x49b7ec?_0x6fd1('0x20'):_0x6fd1('0x21'));}if(!_0x49b7ec){setTimeout(this[_0x6fd1('0x7')][_0x6fd1('0x9')](this),0x3e8);}};function agent(_0x3dc734,_0x3755b2,_0x2d88ef,_0x55b738){return new Agent(_0x3dc734,_0x3755b2,_0x2d88ef,_0x55b738);}module[_0x6fd1('0x22')]=agent; \ No newline at end of file +var _0x9071=['handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busyQueue','showNotification','notificationId','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','busy','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9071,0xf2));var _0x1907=function(_0x5d439b,_0x50aac2){_0x5d439b=_0x5d439b-0x0;var _0x31ed4d=_0x9071[_0x5d439b];return _0x31ed4d;};'use strict';var _=require(_0x1907('0x0'));var uuid=require(_0x1907('0x1'));var util=require(_0x1907('0x2'));var logger=require(_0x1907('0x3'))('routing');var Agent=function(_0xab70b0,_0x570ae9,_0x4d7acd,_0x5efbeb){this['notificationId']=uuid['v4']();this[_0x1907('0x4')]=_0xab70b0;this[_0x1907('0x5')]=_0x570ae9;this[_0x1907('0x6')]=_0x4d7acd;this[_0x1907('0x7')]=_0x5efbeb;this[_0x1907('0x4')][_0x1907('0x8')](this[_0x1907('0x9')][_0x1907('0xa')](this),this[_0x1907('0xb')][_0x1907('0xa')](this));this[_0x1907('0x4')]['on'](_0x1907('0xc'),this[_0x1907('0xb')][_0x1907('0xa')](this));this[_0x1907('0x4')]['on'](_0x1907('0xd'),this[_0x1907('0xe')][_0x1907('0xa')](this));};Agent[_0x1907('0xf')][_0x1907('0x8')]=function(){this[_0x1907('0x4')][_0x1907('0x8')](this[_0x1907('0x9')]['bind'](this),this['handleTimeout'][_0x1907('0xa')](this));};Agent[_0x1907('0xf')]['handleDrained']=function(){this[_0x1907('0xb')](!![]);};Agent[_0x1907('0xf')][_0x1907('0x9')]=function(_0x3a01a7){logger['info'](_0x1907('0x10'),this[_0x1907('0x4')]['id'],this[_0x1907('0x5')]['id']);if(_['isNil'](this[_0x1907('0x6')]['agents'][this['agent']['id']])){logger[_0x1907('0x11')](_0x1907('0x12'),this[_0x1907('0x4')]['id'],this[_0x1907('0x5')]['id']);setTimeout(this[_0x1907('0x8')][_0x1907('0xa')](this),0x3e8);}else{if(this[_0x1907('0x7')][_0x1907('0x13')]||util['isAgentAvailable'](this[_0x1907('0x4')]['id'],this[_0x1907('0x6')][_0x1907('0x14')][this[_0x1907('0x5')]['id']],this[_0x1907('0x4')][_0x1907('0x15')],![])){this['realtime']['agents'][this['agent']['id']]['busy']=!![];this[_0x1907('0x6')][_0x1907('0x14')][this['agent']['id']][_0x1907('0x16')]=undefined;util[_0x1907('0x17')](this[_0x1907('0x18')],this[_0x1907('0x4')]['id'],this[_0x1907('0x6')][_0x1907('0x14')][this[_0x1907('0x5')]['id']],null,this[_0x1907('0x7')]);util[_0x1907('0x19')](this[_0x1907('0x4')]['id'],this[_0x1907('0x6')][_0x1907('0x14')][this['agent']['id']],'RINGING'+(this[_0x1907('0x7')]['forcedOwnership']?':FORCED':''));}else{logger[_0x1907('0x11')](_0x1907('0x1a'),this[_0x1907('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x1907('0x8')][_0x1907('0xa')](this),0x3e8);}}};Agent[_0x1907('0xf')][_0x1907('0xb')]=function(_0x2d0066){if(_[_0x1907('0x1b')](this[_0x1907('0x6')][_0x1907('0x14')][this[_0x1907('0x5')]['id']])){return logger['info'](_0x1907('0x12'),this[_0x1907('0x4')]['id'],this[_0x1907('0x5')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x1907('0x4')]['id'],this[_0x1907('0x6')][_0x1907('0x14')][this['agent']['id']],null,this['routing']);this[_0x1907('0x6')][_0x1907('0x14')][this['agent']['id']][_0x1907('0x1c')]=![];this[_0x1907('0x6')][_0x1907('0x14')][this[_0x1907('0x5')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0x1907('0x4')]['id'],this['realtime'][_0x1907('0x14')][this[_0x1907('0x5')]['id']],_0x2d0066?_0x1907('0x1d'):_0x1907('0x1e'));}if(!_0x2d0066){setTimeout(this['push'][_0x1907('0xa')](this),0x3e8);}};function agent(_0x20be60,_0x132491,_0x22fd0a,_0x70d42){return new Agent(_0x20be60,_0x132491,_0x22fd0a,_0x70d42);}module[_0x1907('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 badcf4d..af2c9b2 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 _0x295f=['busyQueue','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','writeLog','RINGING','busy'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x295f,0x168));var _0xf295=function(_0x200cf5,_0x4d2141){_0x200cf5=_0x200cf5-0x0;var _0x1985b8=_0x295f[_0x200cf5];return _0x1985b8;};'use strict';var _=require('lodash');var uuid=require(_0xf295('0x0'));var util=require(_0xf295('0x1'));var logger=require(_0xf295('0x2'))('routing');var Beepall=function(_0x45a403,_0x1c653b,_0x59a1c5,_0x511ab5){this[_0xf295('0x3')]=uuid['v4']();this[_0xf295('0x4')]=_0x45a403;this[_0xf295('0x5')]=_0x1c653b;this[_0xf295('0x6')]=_0x59a1c5;this[_0xf295('0x7')]=_0x511ab5;this['squeue'][_0xf295('0x8')](this[_0xf295('0x9')][_0xf295('0xa')](this),this[_0xf295('0xb')][_0xf295('0xa')](this));this[_0xf295('0x4')]['on'](_0xf295('0xc'),this[_0xf295('0xb')][_0xf295('0xa')](this));this[_0xf295('0x4')]['on'](_0xf295('0xd'),this[_0xf295('0xe')]['bind'](this));};Beepall[_0xf295('0xf')][_0xf295('0x8')]=function(){this['squeue'][_0xf295('0x8')](this[_0xf295('0x9')][_0xf295('0xa')](this),this[_0xf295('0xb')][_0xf295('0xa')](this));};Beepall[_0xf295('0xf')][_0xf295('0xe')]=function(_0x3c4149){this[_0xf295('0xb')](!![]);};Beepall[_0xf295('0xf')][_0xf295('0x9')]=function(_0x6267ce){var _0x1beb58=!![];if(!_[_0xf295('0x10')](this[_0xf295('0x5')])&&!_[_0xf295('0x10')](this[_0xf295('0x5')][_0xf295('0x11')])&&this['queue']['Agents'][_0xf295('0x12')]>0x0){for(var _0x129a9e=0x0,_0x58d1a3;_0x129a9e0x0){for(var _0x5e9c82=0x0,_0x422061;_0x5e9c820x0&&_0x286853[_0x4c2fca+_0x368b('0x29')]>=_0x286853[_0x4c2fca+_0x368b('0x28')]){writeLog(_0xc0f7af,_0x286853,_0x4c2fca[_0x368b('0x2a')]()+_0x368b('0x2b'));return![];}}return!![];};exports[_0x368b('0x2c')]=function(_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627){return sendNotification(!![],_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627);};exports[_0x368b('0x2d')]=function(_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52){return sendNotification(![],_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52);};exports[_0x368b('0x2e')]=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(_0x41eb93,_0x19c6f1){var _0x4ddf78=function(_0x288fdd){while(--_0x288fdd){_0x41eb93['push'](_0x41eb93['shift']());}};_0x4ddf78(++_0x19c6f1);}(_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 0484862..9a61aec 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 _0xf1c6=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','shelljs','lodash','../../../../config/logger','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0xd0053d,_0x494cc5){var _0x250e7e=function(_0x233929){while(--_0x233929){_0xd0053d['push'](_0xd0053d['shift']());}};_0x250e7e(++_0x494cc5);}(_0xf1c6,0x1be));var _0x6f1c=function(_0x35053c,_0x5b9704){_0x35053c=_0x35053c-0x0;var _0x5c79ba=_0xf1c6[_0x35053c];return _0x5c79ba;};'use strict';var schema=require('validate');var sh=require(_0x6f1c('0x0'));var _=require(_0x6f1c('0x1'));var utils=require('./utils');var logger=require(_0x6f1c('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x419293,_0xa0cf99){return function(_0x4e275f){try{var _0x2c9190={'command':_0xa0cf99[0x0]};var _0x10fe56=system[_0x6f1c('0x3')](_0x2c9190,{'typecast':!![]});if(_0x10fe56[_0x6f1c('0x4')]){logger[_0x6f1c('0x5')](_0x6f1c('0x6'),_0x419293,_[_0x6f1c('0x7')](_0x10fe56,_0x6f1c('0x8'))[_0x6f1c('0x9')](',\x20'));logger[_0x6f1c('0xa')](_0x6f1c('0xb'),_0x419293);_0x4e275f[_0x6f1c('0xc')]();}else{var _0x53580b=this;var _0xcb168b=utils[_0x6f1c('0xd')](_0xa0cf99[0x0],this);logger['info'](_0x6f1c('0xe'),_0x419293,_0xcb168b);sh[_0x6f1c('0xf')](_['trim'](_0xcb168b),function(_0x46291c,_0xfcebd5){logger[_0x6f1c('0xa')](_0x6f1c('0x10'),_0x419293,_0x46291c);if(_0x46291c==0x0){var _0x2f4544=_0xfcebd5[_0x6f1c('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xa0cf99[0x1])||_[_0x6f1c('0x12')](_0xa0cf99[0x1])){logger[_0x6f1c('0xa')](_0x6f1c('0x13'),_0x419293);_0x53580b['body'][_0xa0cf99[0x1]]=_0x2f4544;}else{logger[_0x6f1c('0xa')](_0x6f1c('0x14'),_0x419293,_0xa0cf99[0x1],_0x2f4544);_0x53580b[_0x6f1c('0x15')][_0xa0cf99[0x1]]=_0x2f4544;}}_0x4e275f[_0x6f1c('0xc')]();});}}catch(_0x26b15e){logger[_0x6f1c('0x5')](_0x6f1c('0x6'),_0x419293,_[_0x6f1c('0x16')](_0x26b15e)?JSON[_0x6f1c('0x17')](_0x26b15e):_0x26b15e);logger[_0x6f1c('0xa')](_0x6f1c('0xb'),_0x419293);_0x4e275f[_0x6f1c('0xc')]();}};}; \ No newline at end of file +var _0xf257=['consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xf257,0x82));var _0x7f25=function(_0xdd4701,_0x11e088){_0xdd4701=_0xdd4701-0x0;var _0x5a1ab8=_0xf257[_0xdd4701];return _0x5a1ab8;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x7f25('0x0'));var utils=require(_0x7f25('0x1'));var logger=require(_0x7f25('0x2'))(_0x7f25('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x7f25('0x4')}});exports[_0x7f25('0x5')]=function(_0xd94d7a,_0x4059b2){return function(_0x2829d7){try{var _0x36b013={'command':_0x4059b2[0x0]};var _0x1998d7=system[_0x7f25('0x6')](_0x36b013,{'typecast':!![]});if(_0x1998d7[_0x7f25('0x7')]){logger[_0x7f25('0x8')](_0x7f25('0x9'),_0xd94d7a,_[_0x7f25('0xa')](_0x1998d7,_0x7f25('0xb'))[_0x7f25('0xc')](',\x20'));logger['info'](_0x7f25('0xd'),_0xd94d7a);_0x2829d7[_0x7f25('0xe')]();}else{var _0x52567b=this;var _0x557d2a=utils[_0x7f25('0xf')](_0x4059b2[0x0],this);logger['info'](_0x7f25('0x10'),_0xd94d7a,_0x557d2a);sh[_0x7f25('0x11')](_[_0x7f25('0x12')](_0x557d2a),function(_0x463a19,_0x2cfe9d){logger[_0x7f25('0x13')](_0x7f25('0x14'),_0xd94d7a,_0x463a19);if(_0x463a19==0x0){var _0x5993ea=_0x2cfe9d['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x7f25('0x15')](_0x4059b2[0x1])||_['isEmpty'](_0x4059b2[0x1])){logger[_0x7f25('0x13')](_0x7f25('0x16'),_0xd94d7a);_0x52567b[_0x7f25('0x17')][_0x4059b2[0x1]]=_0x5993ea;}else{logger[_0x7f25('0x13')](_0x7f25('0x18'),_0xd94d7a,_0x4059b2[0x1],_0x5993ea);_0x52567b['body'][_0x4059b2[0x1]]=_0x5993ea;}}_0x2829d7['next']();});}}catch(_0x4eb36e){logger[_0x7f25('0x8')](_0x7f25('0x9'),_0xd94d7a,_[_0x7f25('0x19')](_0x4eb36e)?JSON[_0x7f25('0x1a')](_0x4eb36e):_0x4eb36e);logger[_0x7f25('0x13')](_0x7f25('0xd'),_0xd94d7a);_0x2829d7[_0x7f25('0xe')]();}};}; \ 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 bbd4306..e4267fb 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 _0x3580=['message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','stringify','finally','isObject','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map'];(function(_0x3130be,_0x54990e){var _0x484c5b=function(_0x5d3277){while(--_0x5d3277){_0x3130be['push'](_0x3130be['shift']());}};_0x484c5b(++_0x54990e);}(_0x3580,0x187));var _0x0358=function(_0x3525ad,_0x3d1b34){_0x3525ad=_0x3525ad-0x0;var _0x3f30fb=_0x3580[_0x3525ad];return _0x3f30fb;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0358('0x0')),'smsInteraction':require(_0x0358('0x1')),'mailInteraction':require(_0x0358('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0358('0x3'))};var logger=require(_0x0358('0x4'))(_0x0358('0x5'));var tag=schema({'tag':{'type':_0x0358('0x6'),'required':!![],'message':_0x0358('0x7')}});exports[_0x0358('0x8')]=function(_0x23cc91,_0x18b18e,_0x366913,_0x57171b){return function(_0x27ed16){try{var _0xe46a74={'tag':_0x18b18e[0x0]};var _0x284f4a=tag[_0x0358('0x9')](_0xe46a74,{'typecast':!![]});if(_0x284f4a[_0x0358('0xa')]){logger[_0x0358('0xb')](_0x0358('0xc'),_0x23cc91,_[_0x0358('0xd')](_0x284f4a,_0x0358('0xe'))[_0x0358('0xf')](',\x20'));logger[_0x0358('0x10')](_0x0358('0x11'),_0x23cc91);_0x27ed16[_0x0358('0x12')]();}else{var _0x126dad={'ids':[_0x18b18e[0x0]]};if(rpc[_0x57171b['channel']+'Interaction']){rpc[_0x57171b['channel']+_0x0358('0x13')][_0x0358('0x14')](_0x57171b['interaction']['id'],_0x126dad)[_0x0358('0x15')](function(_0x5a20da){logger['info'](_0x0358('0x16'),_0x23cc91,_0x18b18e[0x1],_0x57171b[_0x0358('0x17')],_0x57171b['interaction']['id']);})['catch'](function(_0x2be0d6){logger[_0x0358('0xb')](_0x0358('0xc'),_0x23cc91,JSON[_0x0358('0x18')](_0x2be0d6));logger[_0x0358('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x23cc91);})[_0x0358('0x19')](function(){_0x27ed16['next']();});}}}catch(_0x409316){logger[_0x0358('0xb')]('[%s][TAG]\x20%s',_0x23cc91,_[_0x0358('0x1a')](_0x409316)?JSON[_0x0358('0x18')](_0x409316):_0x409316);logger[_0x0358('0x10')](_0x0358('0x11'),_0x23cc91);_0x27ed16[_0x0358('0x12')]();}};}; \ No newline at end of file +var _0x50e3=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction'];(function(_0xb808f8,_0x5e0eb4){var _0x485313=function(_0x20cf30){while(--_0x20cf30){_0xb808f8['push'](_0xb808f8['shift']());}};_0x485313(++_0x5e0eb4);}(_0x50e3,0x16a));var _0x350e=function(_0x5262af,_0x16b2a3){_0x5262af=_0x5262af-0x0;var _0x3c5493=_0x50e3[_0x5262af];return _0x3c5493;};'use strict';var schema=require('validate');var _=require(_0x350e('0x0'));var rpc={'chatInteraction':require(_0x350e('0x1')),'openchannelInteraction':require(_0x350e('0x2')),'smsInteraction':require(_0x350e('0x3')),'mailInteraction':require(_0x350e('0x4')),'faxInteraction':require(_0x350e('0x5')),'whatsappInteraction':require(_0x350e('0x6'))};var logger=require(_0x350e('0x7'))(_0x350e('0x8'));var tag=schema({'tag':{'type':_0x350e('0x9'),'required':!![],'message':_0x350e('0xa')}});exports[_0x350e('0xb')]=function(_0x2722a0,_0x1593af,_0x403376,_0x1b96f2){return function(_0x2255cc){try{var _0x5ad375={'tag':_0x1593af[0x0]};var _0x596606=tag[_0x350e('0xc')](_0x5ad375,{'typecast':!![]});if(_0x596606['length']){logger[_0x350e('0xd')](_0x350e('0xe'),_0x2722a0,_[_0x350e('0xf')](_0x596606,'message')[_0x350e('0x10')](',\x20'));logger[_0x350e('0x11')](_0x350e('0x12'),_0x2722a0);_0x2255cc[_0x350e('0x13')]();}else{var _0x577330={'ids':[_0x1593af[0x0]]};if(rpc[_0x1b96f2[_0x350e('0x14')]+_0x350e('0x15')]){rpc[_0x1b96f2[_0x350e('0x14')]+_0x350e('0x15')]['addTags'](_0x1b96f2[_0x350e('0x16')]['id'],_0x577330)['then'](function(_0x552242){logger['info'](_0x350e('0x17'),_0x2722a0,_0x1593af[0x1],_0x1b96f2[_0x350e('0x14')],_0x1b96f2[_0x350e('0x16')]['id']);})[_0x350e('0x18')](function(_0x2b3d8a){logger[_0x350e('0xd')]('[%s][TAG]\x20%s',_0x2722a0,JSON[_0x350e('0x19')](_0x2b3d8a));logger[_0x350e('0x11')](_0x350e('0x12'),_0x2722a0);})[_0x350e('0x1a')](function(){_0x2255cc['next']();});}}}catch(_0x61f01b){logger[_0x350e('0xd')](_0x350e('0xe'),_0x2722a0,_[_0x350e('0x1b')](_0x61f01b)?JSON[_0x350e('0x19')](_0x61f01b):_0x61f01b);logger[_0x350e('0x11')](_0x350e('0x12'),_0x2722a0);_0x2255cc['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index a503cb5..1fc26e8 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa857=['[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','login','utf8','POST','application/json-rpc','then','parse','logged','channelId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject'];(function(_0x537281,_0x3e2849){var _0x58a6b3=function(_0x1698cb){while(--_0x1698cb){_0x537281['push'](_0x537281['shift']());}};_0x58a6b3(++_0x3e2849);}(_0xa857,0xa1));var _0x7a85=function(_0xbdd6bc,_0xd4d56f){_0xbdd6bc=_0xbdd6bc-0x0;var _0x1e98ab=_0xa857[_0xbdd6bc];return _0x1e98ab;};'use strict';var rp=require(_0x7a85('0x0'));var logger=require(_0x7a85('0x1'))(_0x7a85('0x2'));var _=require('lodash');var arr=[];exports[_0x7a85('0x3')]=function(_0x5d77d3,_0x3cd66f){return function(_0x54e15b){var _0x143946=_0x3cd66f[0xa];var _0x5e8e34=_0x3cd66f[0xb];var _0x322bec=_0x3cd66f[0xc];var _0x23829a=_0x3cd66f[0xd];var _0x3dbda8=_0x3cd66f[0xe];var _0x3a78a2=_0x3cd66f[0xf]['replace'](/\n/g,_0x7a85('0x4'));var _0x35b75c=_0x3cd66f[0x10][_0x7a85('0x5')](/\n/g,'\x20');if(!arr[_0x7a85('0x6')](_0x5e8e34)){arr[_0x7a85('0x7')](_0x5e8e34);var _0x7e7732=_0x3cd66f[0x3];var _0x363274=_0x3cd66f[0x4];var _0xde1c13=_0x3cd66f[0x1];var _0x3dce7b=_0x3cd66f[0x0];var _0x132212={};_0x132212[_0x7a85('0x8')]=_0x3cd66f[0x8]+_0x7a85('0x9')+_0x322bec+'|'+_0x143946+'|'+_0x23829a+'|'+_0x5e8e34+'|'+_0x3dbda8;_0x132212[_0x7a85('0xa')]=_0x3cd66f[0x7]+_0x7a85('0x9')+_0x322bec+'|'+_0x143946+'|'+_0x23829a+'|'+_0x5e8e34+'|'+_0x3dbda8+'|'+_0x3a78a2+'|'+_0x35b75c;_0x132212[_0x7a85('0xb')]=_0x3cd66f[0x9];var _0x3def76={};_0x3def76[_0x7a85('0xc')]=_0x7a85('0xd');_0x3def76['method']=_0x7a85('0xe');var _0x1d7621=[];_0x1d7621[_0x7a85('0x7')](_0x3cd66f[0x2]);_0x1d7621[_0x7a85('0x7')](_0x3cd66f[0x5]);_0x1d7621[_0x7a85('0x7')](_0x3cd66f[0x6]);_0x3def76['params']=_0x1d7621;_0x3def76['id']=0x1;var _0x556059=JSON['stringify'](_0x3def76);var _0xaf7c99={'encoding':_0x7a85('0xf'),'method':_0x7a85('0x10'),'timeout':0x2710,'url':_0x7e7732,'headers':{'Content-Type':_0x7a85('0x11')},'body':_0x556059};return rp(_0xaf7c99)[_0x7a85('0x12')](function(_0x5bca2b){const _0x482338=JSON[_0x7a85('0x13')](_0x5bca2b);if(!_0x482338['result'][_0x7a85('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x203e89=_0x5e8e34;var _0x1f8fe1=_0x7a85('0x15')+_0xde1c13+'&serviceId='+_0x3dce7b+_0x7a85('0x16')+_0x203e89+_0x7a85('0x17')+JSON[_0x7a85('0x18')](_0x132212);var _0x5ad013=_0x363274+'?'+_0x1f8fe1;return rp(_0x5ad013);})[_0x7a85('0x12')](function(_0x1ed2b4){logger[_0x7a85('0x19')](_0x7a85('0x1a'),_0x5d77d3,_0x1ed2b4);_0x54e15b[_0x7a85('0x1b')]();})[_0x7a85('0x1c')](function(_0x32f2f0){logger['error'](_0x7a85('0x1d'),_0x5d77d3,_[_0x7a85('0x1e')](_0x32f2f0)?JSON['stringify'](_0x32f2f0):_0x32f2f0);_0x54e15b[_0x7a85('0x1b')]();});}else{logger['info'](_0x7a85('0x1f'),_0x5d77d3);_0x54e15b['next']();}};}; \ No newline at end of file +var _0x964f=['Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','replace','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','push','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged'];(function(_0x4f6105,_0x461f15){var _0x4f948a=function(_0x394d30){while(--_0x394d30){_0x4f6105['push'](_0x4f6105['shift']());}};_0x4f948a(++_0x461f15);}(_0x964f,0x1bd));var _0xf964=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x964f[_0x42cae2];return _0x5f256f;};'use strict';var rp=require(_0xf964('0x0'));var logger=require(_0xf964('0x1'))(_0xf964('0x2'));var _=require(_0xf964('0x3'));var arr=[];exports['consequence']=function(_0x3907e0,_0x5e1aeb){return function(_0x4a8fcf){var _0x10e367=_0x5e1aeb[0xa];var _0x20b835=_0x5e1aeb[0xb];var _0x3f9b0f=_0x5e1aeb[0xc];var _0x562547=_0x5e1aeb[0xd];var _0x316a34=_0x5e1aeb[0xe];var _0x375b69=_0x5e1aeb[0xf][_0xf964('0x4')](/\n/g,'\x20-\x20');var _0x532740=_0x5e1aeb[0x10][_0xf964('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x20b835)){arr['push'](_0x20b835);var _0x408d42=_0x5e1aeb[0x3];var _0x6c434a=_0x5e1aeb[0x4];var _0x2adea6=_0x5e1aeb[0x1];var _0x583a2b=_0x5e1aeb[0x0];var _0x150b3d={};_0x150b3d[_0xf964('0x5')]=_0x5e1aeb[0x8]+'?params='+_0x3f9b0f+'|'+_0x10e367+'|'+_0x562547+'|'+_0x20b835+'|'+_0x316a34;_0x150b3d[_0xf964('0x6')]=_0x5e1aeb[0x7]+_0xf964('0x7')+_0x3f9b0f+'|'+_0x10e367+'|'+_0x562547+'|'+_0x20b835+'|'+_0x316a34+'|'+_0x375b69+'|'+_0x532740;_0x150b3d[_0xf964('0x8')]=_0x5e1aeb[0x9];var _0x4fc9e9={};_0x4fc9e9[_0xf964('0x9')]=_0xf964('0xa');_0x4fc9e9[_0xf964('0xb')]=_0xf964('0xc');var _0x115597=[];_0x115597['push'](_0x5e1aeb[0x2]);_0x115597[_0xf964('0xd')](_0x5e1aeb[0x5]);_0x115597[_0xf964('0xd')](_0x5e1aeb[0x6]);_0x4fc9e9[_0xf964('0xe')]=_0x115597;_0x4fc9e9['id']=0x1;var _0x33c127=JSON[_0xf964('0xf')](_0x4fc9e9);var _0x57b55c={'encoding':_0xf964('0x10'),'method':_0xf964('0x11'),'timeout':0x2710,'url':_0x408d42,'headers':{'Content-Type':_0xf964('0x12')},'body':_0x33c127};return rp(_0x57b55c)[_0xf964('0x13')](function(_0x47df73){const _0x48d478=JSON[_0xf964('0x14')](_0x47df73);if(!_0x48d478[_0xf964('0x15')][_0xf964('0x16')]){throw new Error(_0xf964('0x17'));}var _0x210e30=_0x20b835;var _0x339636=_0xf964('0x18')+_0x2adea6+_0xf964('0x19')+_0x583a2b+_0xf964('0x1a')+_0x210e30+_0xf964('0x1b')+JSON['stringify'](_0x150b3d);var _0x22cffc=_0x6c434a+'?'+_0x339636;return rp(_0x22cffc);})[_0xf964('0x13')](function(_0x42c121){logger[_0xf964('0x1c')](_0xf964('0x1d'),_0x3907e0,_0x42c121);_0x4a8fcf['stop']();})[_0xf964('0x1e')](function(_0x23c3f5){logger[_0xf964('0x1f')](_0xf964('0x20'),_0x3907e0,_[_0xf964('0x21')](_0x23c3f5)?JSON[_0xf964('0xf')](_0x23c3f5):_0x23c3f5);_0x4a8fcf[_0xf964('0x22')]();});}else{logger['info'](_0xf964('0x23'),_0x3907e0);_0x4a8fcf['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 ec17b58..eaa9e69 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(_0x17be70,_0x4823af){var _0xfe44a4=function(_0x5267b4){while(--_0x5267b4){_0x17be70['push'](_0x17be70['shift']());}};_0xfe44a4(++_0x4823af);}(_0xe706,0xa3));var _0x6e70=function(_0x37b851,_0x469969){_0x37b851=_0x37b851-0x0;var _0x574599=_0xe706[_0x37b851];return _0x574599;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x47fc9b,_0x33c52e){var _0x6674aa=function(_0x3856a6){while(--_0x3856a6){_0x47fc9b['push'](_0x47fc9b['shift']());}};_0x6674aa(++_0x33c52e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index c7ec145..1a41c80 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 _0x574d=['./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','message','interaction','isArray','applications','length','existsSync','join','app','.js','autoreply','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','account','ChatWebsiteId','body','./interval','consequence','priority','info','on\x20interval','intervals','\x20|\x20','error','rules','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid'];(function(_0x5944cb,_0x358f2c){var _0x395d0f=function(_0x52cb96){while(--_0x52cb96){_0x5944cb['push'](_0x5944cb['shift']());}};_0x395d0f(++_0x358f2c);}(_0x574d,0xc0));var _0xd574=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x574d[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var path=require(_0xd574('0x2'));var fs=require('fs');var jayson=require(_0xd574('0x3'));var BPromise=require(_0xd574('0x4'));var uuid=require(_0xd574('0x5'));var utils=require(_0xd574('0x6'));var config=require('../../../config/environment');var logger=require(_0xd574('0x7'))(_0xd574('0x8'));var rpc={'openchannelQueueReport':require(_0xd574('0x9')),'mailQueueReport':require(_0xd574('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xd574('0xb')),'faxQueueReport':require(_0xd574('0xc')),'whatsappQueueReport':require(_0xd574('0xd'))};var RuleEngine=require(_0xd574('0xe'));function getId(_0x3a1e54,_0x20751c,_0x54fe4f){return util['format'](_0xd574('0xf'),_0x3a1e54,_0x20751c||0x0,_0x54fe4f||0x0);}function getIntervals(_0x11ef21,_0x2caf61){var _0x1aa38f=[];if(!_[_0xd574('0x10')](_0x2caf61[_0xd574('0x11')])&&!_[_0xd574('0x10')](_0x11ef21[_0x2caf61['IntervalId']])&&!_[_0xd574('0x10')](_0x11ef21[_0x2caf61[_0xd574('0x11')]][_0xd574('0x12')])){_0x1aa38f=_[_0xd574('0x13')](_0x11ef21[_0x2caf61[_0xd574('0x11')]][_0xd574('0x12')],_0xd574('0x14'));}else if(!_[_0xd574('0x10')](_0x2caf61[_0xd574('0x14')])){_0x1aa38f=[_0x2caf61[_0xd574('0x14')]];}return _0x1aa38f;}exports[_0xd574('0x15')]=function(_0x2cc660){_0x2cc660['rules']={};return new BPromise(function(_0xb44f5d,_0x147cdf){var _0x2d66be={'Start':function(_0x1537f4){var _0x46fb4c=this;return new Promise(function(_0x341463,_0x137917){if(_0x1537f4){try{var _0x2fcdfe=[];var _0x5c1db1=getId(_0x1537f4['channel'],_0x1537f4[_0xd574('0x16')]?_0x1537f4[_0xd574('0x16')]['id']:0x0,_0x1537f4[_0xd574('0x17')]?_0x1537f4['interaction']['id']:0x0);if(_0x1537f4['applications']&&_[_0xd574('0x18')](_0x1537f4[_0xd574('0x19')])&&_0x1537f4[_0xd574('0x19')][_0xd574('0x1a')]){for(var _0x1c899f=0x0;_0x1c899f<_0x1537f4[_0xd574('0x19')][_0xd574('0x1a')];_0x1c899f+=0x1){var _0xf5939a=_0x1537f4[_0xd574('0x19')][_0x1c899f];if(fs[_0xd574('0x1b')](path[_0xd574('0x1c')](__dirname,'applications',_0xf5939a[_0xd574('0x1d')]+_0xd574('0x1e')))){var _0x481564=[];switch(_0xf5939a[_0xd574('0x1d')]['toLowerCase']()){case _0xd574('0x1f'):var _0x274a1e=_0xf5939a[_0xd574('0x20')][_0xd574('0x21')](',');if(_0x1537f4[_0xd574('0x22')]===_0xd574('0x23')){_0x481564[_0xd574('0x24')](_0x274a1e[0x0]);_0x481564[_0xd574('0x24')](_0x274a1e[0x1]);_0x481564[_0xd574('0x24')](_0x274a1e[_0xd574('0x25')](0x2,_0x274a1e[_0xd574('0x1a')])[_0xd574('0x1c')](','));}else{_0x481564[_0xd574('0x24')](_0x274a1e[0x0]);_0x481564[_0xd574('0x24')](_0x274a1e['slice'](0x1,_0x274a1e[_0xd574('0x1a')])['join'](','));}break;case _0xd574('0x26'):var _0x5c9224=_0xf5939a['appdata'][_0xd574('0x21')](',');_0x481564[_0xd574('0x24')](_0x5c9224[0x0]);_0x481564[_0xd574('0x24')](_0x5c9224[0x1]);_0x481564['push'](_0x5c9224[_0xd574('0x25')](0x2,_0x5c9224[_0xd574('0x1a')])[_0xd574('0x1c')](','));break;case _0xd574('0x27'):var _0x508eaa=_0xf5939a['appdata'][_0xd574('0x21')](',');_0x481564[_0xd574('0x24')](_0x508eaa[0x0]);_0x481564[_0xd574('0x24')](_0x508eaa[0x1]);_0x481564[_0xd574('0x24')](_0x508eaa[0x2]);_0x481564[_0xd574('0x24')](_0x508eaa[0x3]);_0x481564[_0xd574('0x24')](_0x508eaa['slice'](0x4,_0x508eaa['length'])[_0xd574('0x1c')](','));break;case _0xd574('0x28'):var _0x3adfdf=_0xf5939a[_0xd574('0x20')][_0xd574('0x21')](',');_0x481564[_0xd574('0x24')](_0x3adfdf[0x0]);_0x481564[_0xd574('0x24')](_0x3adfdf[0x1]);_0x481564[_0xd574('0x24')](_0x3adfdf[0x2]);_0x481564['push'](_0x3adfdf[0x3]);_0x481564['push'](_0x3adfdf[_0xd574('0x25')](0x4,_0x3adfdf[_0xd574('0x1a')])[_0xd574('0x1c')](','));break;case _0xd574('0x16'):_0x481564[_0xd574('0x24')](_0xf5939a['appdata']);break;case _0xd574('0x29'):_0x481564[_0xd574('0x24')](_0xf5939a[_0xd574('0x2a')]);_0x481564[_0xd574('0x24')](_0xf5939a[_0xd574('0x20')]);break;case _0xd574('0x2b'):var _0x27498e=utils['getMustacheRender'](_0x1537f4[_0xd574('0x2c')]['notificationTemplate'],_0x1537f4);var _0x35594e=_0xf5939a[_0xd574('0x20')][_0xd574('0x21')](',');_0x481564[_0xd574('0x24')](_0x35594e[0x0]);_0x481564[_0xd574('0x24')](_0x35594e[0x1]);_0x481564[_0xd574('0x24')](_0x35594e[0x2]);_0x481564[_0xd574('0x24')](_0x35594e[0x3]);_0x481564[_0xd574('0x24')](_0x35594e[0x4]);_0x481564[_0xd574('0x24')](_0x35594e[0x5]);_0x481564[_0xd574('0x24')](_0x35594e[0x6]);_0x481564[_0xd574('0x24')](_0x35594e[0x7]);_0x481564['push'](_0x35594e[0x8]);_0x481564[_0xd574('0x24')](_0x35594e[0x9]);_0x481564[_0xd574('0x24')](_0x35594e[0xa]);_0x481564[_0xd574('0x24')](_0x1537f4['interaction']['id']);_0x481564[_0xd574('0x24')](_0x1537f4[_0xd574('0x16')]['id']);_0x481564[_0xd574('0x24')](_0xf5939a[_0xd574('0x2d')]);_0x481564[_0xd574('0x24')](_0x1537f4[_0xd574('0x17')]['ContactId']);_0x481564[_0xd574('0x24')](_0x1537f4[_0xd574('0x2e')][_0xd574('0x2e')]);_0x481564[_0xd574('0x24')](_0x27498e);break;default:_0x481564=_[_0xd574('0x10')](_0xf5939a['appdata'])?[]:_0xf5939a[_0xd574('0x20')][_0xd574('0x21')](',');}var _0x37b588={'id':util['format']('%s:%s:%s',_0x5c1db1,_0xf5939a['id'],_0xf5939a['app']),'condition':require(_0xd574('0x2f'))['condition'](_0x5c1db1,getIntervals(_0x2cc660['intervals'],_0xf5939a),_0x2cc660),'consequence':require('./applications/'+_0xf5939a[_0xd574('0x1d')])[_0xd574('0x30')](_0x5c1db1,_0x481564,_0x2cc660,_0x1537f4),'p':_0xf5939a[_0xd574('0x31')]||0x0};logger[_0xd574('0x32')]('Push\x20new\x20rule',_0x37b588['id'],_0xd574('0x33'),getIntervals(_0x2cc660[_0xd574('0x34')],_0xf5939a)[_0xd574('0x1c')](_0xd574('0x35')));_0x2fcdfe['push'](_0x37b588);}else{logger[_0xd574('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xd574('0x1c')](__dirname,_0xd574('0x19'),_0xf5939a[_0xd574('0x1d')]+_0xd574('0x1e')));}}_0x2cc660[_0xd574('0x37')][_0x5c1db1]=new RuleEngine(_0x2fcdfe);_0x2cc660[_0xd574('0x37')][_0x5c1db1][_0xd574('0x38')](_0x1537f4,function(_0x323882){logger[_0xd574('0x32')](_0xd574('0x39'),JSON[_0xd574('0x3a')](_0x323882[_0xd574('0x3b')]));if(_0x2cc660[_0xd574('0x37')][_0x5c1db1]){_0x2cc660['rules'][_0x5c1db1][_0xd574('0x3c')]('complete');}});return _0x341463({'code':0xc8,'message':_0x1537f4});}else{logger['info'](_0xd574('0x3d'));return _0x341463({'code':0xc8,'message':_0x1537f4});}}catch(_0x4757a3){logger['error'](_0x4757a3[_0xd574('0x3e')]);return _0x137917(_0x46fb4c[_0xd574('0x36')](0x1f4,_0x4757a3));}}return _0x137917(_0xd574('0x3f'));});},'AcceptMessage':function(_0x4b756a){var _0xea1d6f=this;return new Promise(function(_0x398bf2,_0xba34fe){if(_0x4b756a[_0xd574('0x40')]&&_0x4b756a[_0xd574('0x40')]['id']){if(_0x2cc660[_0xd574('0x41')][_0x4b756a['agent']['id']]){_0x2cc660[_0xd574('0x41')][_0x4b756a[_0xd574('0x40')]['id']][_0xd574('0x42')]=![];_0x2cc660[_0xd574('0x41')][_0x4b756a[_0xd574('0x40')]['id']][_0xd574('0x43')]=undefined;}}if(_0x4b756a[_0xd574('0x16')]&&_0x4b756a[_0xd574('0x16')]['id']){try{var _0xb6e16c=getId(_0x4b756a[_0xd574('0x22')],_0x4b756a[_0xd574('0x16')]?_0x4b756a[_0xd574('0x16')]['id']:0x0,_0x4b756a[_0xd574('0x17')]?_0x4b756a[_0xd574('0x17')]['id']:0x0);if(_0x2cc660[_0xd574('0x37')][_0xb6e16c]){_0x2cc660[_0xd574('0x37')][_0xb6e16c]['emit'](_0xd574('0x44'));if(rpc[_0x4b756a[_0xd574('0x22')]+'QueueReport']){rpc[_0x4b756a[_0xd574('0x22')]+_0xd574('0x45')][_0xd574('0x46')](_0xb6e16c,{'UserId':_0x4b756a[_0xd574('0x16')][_0xd574('0x47')]})[_0xd574('0x48')](function(_0x462e5e){logger[_0xd574('0x36')](_0xd574('0x49'));});}}return _0x398bf2({'code':0xc8,'message':_0x4b756a});}catch(_0xf9ce02){logger['error'](_0xf9ce02[_0xd574('0x3e')]);return _0xba34fe(_0xea1d6f[_0xd574('0x36')](0x1f4,_0xf9ce02));}}logger[_0xd574('0x36')](_0xd574('0x4a'));return _0xba34fe(_0xea1d6f[_0xd574('0x36')](0x1f4,_0xd574('0x4a')));});},'RejectMessage':function(_0x2eedec){var _0x1b7d1d=this;return new Promise(function(_0x349303,_0xba391f){if(_0x2eedec[_0xd574('0x40')]&&_0x2eedec[_0xd574('0x40')]['id']){try{if(_0x2cc660[_0xd574('0x41')][_0x2eedec[_0xd574('0x40')]['id']]){_0x2cc660[_0xd574('0x41')][_0x2eedec[_0xd574('0x40')]['id']][_0xd574('0x42')]=![];_0x2cc660[_0xd574('0x41')][_0x2eedec[_0xd574('0x40')]['id']][_0xd574('0x43')]=undefined;}return _0x349303({'code':0xc8,'message':_0x2eedec});}catch(_0x33ca39){logger[_0xd574('0x36')](_0x33ca39[_0xd574('0x3e')]);return _0xba391f(_0x1b7d1d[_0xd574('0x36')](0x1f4,_0x33ca39));}}logger[_0xd574('0x36')]('message\x20is\x20empty');return _0xba391f(_0x1b7d1d[_0xd574('0x36')](0x1f4,_0xd574('0x4a')));});},'AbandonInteraction':function(_0x2ec166){var _0xd1a7e3=this;return new Promise(function(_0x216e7e,_0x81ae22){if(_0x2ec166[_0xd574('0x22')]&&_0x2ec166[_0xd574('0x17')]&&_0x2ec166[_0xd574('0x17')]['id']){try{var _0x56206e=getId(_0x2ec166['channel'],_0x2ec166[_0xd574('0x16')]?_0x2ec166[_0xd574('0x16')]['id']:0x0,_0x2ec166['interaction']?_0x2ec166[_0xd574('0x17')]['id']:0x0);if(_0x2cc660[_0xd574('0x37')][_0x56206e]){_0x2cc660[_0xd574('0x37')][_0x56206e][_0xd574('0x3c')]('end');}return _0x216e7e({'code':0xc8,'message':_0x2ec166});}catch(_0x2069a8){logger[_0xd574('0x36')](_0x2069a8[_0xd574('0x3e')]);return _0x81ae22(_0xd1a7e3[_0xd574('0x36')](0x1f4,_0x2069a8));}}logger[_0xd574('0x36')](_0xd574('0x4a'));return _0x81ae22(_0xd1a7e3['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x34a223){var _0x257a5f=this;return new Promise(function(_0x483490,_0x128e11){if(_0x2cc660['agents']['hasOwnProperty'](_0x34a223['id'])){for(var _0x2deaec in _0x34a223[_0xd574('0x4b')]){if(_0x34a223['capacity']['hasOwnProperty'](_0x2deaec)){if(_0x2cc660[_0xd574('0x41')][_0x34a223['id']][_0xd574('0x4c')](_0x2deaec+_0xd574('0x4d'))){_0x2cc660[_0xd574('0x41')][_0x34a223['id']][_0x2deaec+_0xd574('0x4d')]=parseInt(_0x34a223['capacity'][_0x2deaec],0xa);}}}_0x2cc660[_0xd574('0x41')][_0x34a223['id']][_0xd574('0x4e')]();return _0x483490({'code':0xc8,'message':_0x2cc660['agents'][_0x34a223['id']]});}else{return _0x128e11(_0x257a5f[_0xd574('0x36')](0x1f4,_0xd574('0x4f')));}});},'Agents':function(_0x2d2897){return new Promise(function(_0x2794b9,_0x4c89f9){var _0x1c691a=_[_0xd574('0x50')](_0x2cc660['agents']);_0x2794b9({'count':_0x1c691a[_0xd574('0x1a')],'rows':_0x1c691a});});},'ChatQueues':function(_0x43cd92){return new Promise(function(_0x2f97df,_0x5b1ba1){var _0x28493c=[];for(var _0x4d52cf in _0x2cc660[_0xd574('0x51')]){if(_0x2cc660[_0xd574('0x51')]['hasOwnProperty'](_0x4d52cf)){var _0x5d4367=_0x2cc660['chatQueues'][_0x4d52cf];var _0xca35cf={'id':_0x5d4367['id'],'available':_0x5d4367[_0xd574('0x52')],'loggedIn':_0x5d4367[_0xd574('0x53')],'name':_0x5d4367[_0xd574('0x54')],'paused':_0x5d4367['paused'],'waiting':_0x5d4367[_0xd574('0x55')]};_0x28493c[_0xd574('0x24')](_0xca35cf);}}_0x2f97df({'count':_0x28493c[_0xd574('0x1a')],'rows':_0x28493c});});},'MailQueues':function(_0x22775a){return new Promise(function(_0x28eaa2,_0x446f4d){var _0x7d3569=[];for(var _0x121ddf in _0x2cc660[_0xd574('0x56')]){if(_0x2cc660['mailQueues']['hasOwnProperty'](_0x121ddf)){var _0xb6fcbe=_0x2cc660[_0xd574('0x56')][_0x121ddf];var _0x23e557={'id':_0xb6fcbe['id'],'available':_0xb6fcbe['available'],'loggedIn':_0xb6fcbe['loggedIn'],'name':_0xb6fcbe['name'],'paused':_0xb6fcbe[_0xd574('0x57')],'waiting':_0xb6fcbe[_0xd574('0x55')]};_0x7d3569[_0xd574('0x24')](_0x23e557);}}_0x28eaa2({'count':_0x7d3569['length'],'rows':_0x7d3569});});},'OpenchannelQueues':function(_0x2fa24c){return new Promise(function(_0xe99fdc,_0x17fc5e){var _0x353c74=[];for(var _0x1e3399 in _0x2cc660['openchannelQueues']){if(_0x2cc660[_0xd574('0x58')][_0xd574('0x4c')](_0x1e3399)){var _0x44808f=_0x2cc660[_0xd574('0x58')][_0x1e3399];var _0x341272={'id':_0x44808f['id'],'available':_0x44808f[_0xd574('0x52')],'loggedIn':_0x44808f[_0xd574('0x53')],'name':_0x44808f[_0xd574('0x54')],'paused':_0x44808f[_0xd574('0x57')],'waiting':_0x44808f[_0xd574('0x55')]};_0x353c74[_0xd574('0x24')](_0x341272);}}_0xe99fdc({'count':_0x353c74[_0xd574('0x1a')],'rows':_0x353c74});});},'SmsQueues':function(_0xcf4f9e){return new Promise(function(_0x43d981,_0x587716){var _0x5ea1e3=[];for(var _0x1ed86b in _0x2cc660[_0xd574('0x59')]){if(_0x2cc660[_0xd574('0x59')][_0xd574('0x4c')](_0x1ed86b)){var _0x3a8f91=_0x2cc660['smsQueues'][_0x1ed86b];var _0x13bcad={'id':_0x3a8f91['id'],'available':_0x3a8f91[_0xd574('0x52')],'loggedIn':_0x3a8f91[_0xd574('0x53')],'name':_0x3a8f91['name'],'paused':_0x3a8f91[_0xd574('0x57')],'waiting':_0x3a8f91[_0xd574('0x55')]};_0x5ea1e3['push'](_0x13bcad);}}_0x43d981({'count':_0x5ea1e3[_0xd574('0x1a')],'rows':_0x5ea1e3});});},'FaxQueues':function(_0x287dda){return new Promise(function(_0x29988c,_0x20d31c){var _0x1f8378=[];for(var _0x315455 in _0x2cc660[_0xd574('0x5a')]){if(_0x2cc660[_0xd574('0x5a')][_0xd574('0x4c')](_0x315455)){var _0x151b66=_0x2cc660['faxQueues'][_0x315455];var _0x57c878={'id':_0x151b66['id'],'available':_0x151b66[_0xd574('0x52')],'loggedIn':_0x151b66[_0xd574('0x53')],'name':_0x151b66['name'],'paused':_0x151b66[_0xd574('0x57')],'waiting':_0x151b66['waiting']};_0x1f8378[_0xd574('0x24')](_0x57c878);}}_0x29988c({'count':_0x1f8378['length'],'rows':_0x1f8378});});},'WhatsappQueues':function(_0x3e7040){return new Promise(function(_0xb1abcb,_0x4921c2){var _0x1fa5c8=[];for(var _0x36f1b3 in _0x2cc660[_0xd574('0x5b')]){if(_0x2cc660[_0xd574('0x5b')]['hasOwnProperty'](_0x36f1b3)){var _0x46607f=_0x2cc660[_0xd574('0x5b')][_0x36f1b3];var _0x149bdd={'id':_0x46607f['id'],'available':_0x46607f[_0xd574('0x52')],'loggedIn':_0x46607f[_0xd574('0x53')],'name':_0x46607f[_0xd574('0x54')],'paused':_0x46607f[_0xd574('0x57')],'waiting':_0x46607f[_0xd574('0x55')]};_0x1fa5c8[_0xd574('0x24')](_0x149bdd);}}_0xb1abcb({'count':_0x1fa5c8[_0xd574('0x1a')],'rows':_0x1fa5c8});});},'ChatQueuesWaitingInteractions':function(_0x4ad8d0){return new Promise(function(_0x181789,_0x248330){var _0x3e2479=_[_0xd574('0x50')](_0x2cc660['chatQueuesWaitingInteractions']);_0x181789({'count':_0x3e2479[_0xd574('0x1a')],'rows':_0x3e2479});});},'MailQueuesWaitingInteractions':function(_0x5c94b6){return new Promise(function(_0x35e788,_0x1be508){var _0x517383=_[_0xd574('0x50')](_0x2cc660['mailQueuesWaitingInteractions']);_0x35e788({'count':_0x517383[_0xd574('0x1a')],'rows':_0x517383});});},'OpenchannelQueuesWaitingInteractions':function(_0x5b8547){return new Promise(function(_0x388889,_0x2c3fdc){var _0x5b6c90=_[_0xd574('0x50')](_0x2cc660[_0xd574('0x5c')]);_0x388889({'count':_0x5b6c90[_0xd574('0x1a')],'rows':_0x5b6c90});});},'SmsQueuesWaitingInteractions':function(_0x29bd54){return new Promise(function(_0x23bff3,_0x5ea76e){var _0x1b3cc6=_[_0xd574('0x50')](_0x2cc660[_0xd574('0x5d')]);_0x23bff3({'count':_0x1b3cc6[_0xd574('0x1a')],'rows':_0x1b3cc6});});},'FaxQueuesWaitingInteractions':function(_0x1e9eb5){return new Promise(function(_0x24d65b,_0x1a253a){var _0x3dc27a=_[_0xd574('0x50')](_0x2cc660[_0xd574('0x5e')]);_0x24d65b({'count':_0x3dc27a[_0xd574('0x1a')],'rows':_0x3dc27a});});},'WhatsappQueuesWaitingInteractions':function(_0x3deaf1){return new Promise(function(_0x586681,_0x5d0b0d){var _0x4afe1a=_[_0xd574('0x50')](_0x2cc660['whatsappQueuesWaitingInteractions']);_0x586681({'count':_0x4afe1a['length'],'rows':_0x4afe1a});});}};var _0x47fb61=jayson[_0xd574('0x5f')](_0x2d66be)[_0xd574('0x60')]();_0x47fb61['on']('error',function(_0x521bc){logger[_0xd574('0x36')](JSON['stringify'](_0x521bc));return _0x147cdf(_0x521bc);});_0x47fb61[_0xd574('0x15')](0x232c,_0xd574('0x61'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xb44f5d(_0xd574('0x62')+0x232c);});});}; \ No newline at end of file +var _0x4483=['stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','applications','length','existsSync','join','app','toLowerCase','autoreply','split','mail','push','slice','appdata','dialogflowv2','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','complete','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','QueueReport','update','UserId'];(function(_0x2045c7,_0x4f7879){var _0x278bc4=function(_0x35ae08){while(--_0x35ae08){_0x2045c7['push'](_0x2045c7['shift']());}};_0x278bc4(++_0x4f7879);}(_0x4483,0x1a3));var _0x3448=function(_0xcc4815,_0x353bbc){_0xcc4815=_0xcc4815-0x0;var _0x2b7315=_0x4483[_0xcc4815];return _0x2b7315;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x3448('0x3'));var uuid=require(_0x3448('0x4'));var utils=require(_0x3448('0x5'));var config=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x3448('0x8')),'mailQueueReport':require(_0x3448('0x9')),'chatQueueReport':require(_0x3448('0xa')),'smsQueueReport':require(_0x3448('0xb')),'faxQueueReport':require(_0x3448('0xc')),'whatsappQueueReport':require(_0x3448('0xd'))};var RuleEngine=require(_0x3448('0xe'));function getId(_0x34b926,_0x5923ee,_0x5c82c6){return util[_0x3448('0xf')](_0x3448('0x10'),_0x34b926,_0x5923ee||0x0,_0x5c82c6||0x0);}function getIntervals(_0xc36409,_0x6f82ca){var _0x3f4364=[];if(!_[_0x3448('0x11')](_0x6f82ca[_0x3448('0x12')])&&!_[_0x3448('0x11')](_0xc36409[_0x6f82ca[_0x3448('0x12')]])&&!_[_0x3448('0x11')](_0xc36409[_0x6f82ca[_0x3448('0x12')]]['Intervals'])){_0x3f4364=_['map'](_0xc36409[_0x6f82ca[_0x3448('0x12')]][_0x3448('0x13')],'interval');}else if(!_[_0x3448('0x11')](_0x6f82ca[_0x3448('0x14')])){_0x3f4364=[_0x6f82ca[_0x3448('0x14')]];}return _0x3f4364;}exports['listen']=function(_0x14104c){_0x14104c[_0x3448('0x15')]={};return new BPromise(function(_0x4daf3e,_0x2387a3){var _0x2c2da6={'Start':function(_0x46784f){var _0x4fc70f=this;return new Promise(function(_0x472518,_0x28f5b9){if(_0x46784f){try{var _0x13610a=[];var _0x30f8dd=getId(_0x46784f[_0x3448('0x16')],_0x46784f[_0x3448('0x17')]?_0x46784f[_0x3448('0x17')]['id']:0x0,_0x46784f[_0x3448('0x18')]?_0x46784f['interaction']['id']:0x0);if(_0x46784f[_0x3448('0x19')]&&_['isArray'](_0x46784f['applications'])&&_0x46784f['applications'][_0x3448('0x1a')]){for(var _0x278736=0x0;_0x278736<_0x46784f[_0x3448('0x19')]['length'];_0x278736+=0x1){var _0x3df082=_0x46784f[_0x3448('0x19')][_0x278736];if(fs[_0x3448('0x1b')](path[_0x3448('0x1c')](__dirname,_0x3448('0x19'),_0x3df082[_0x3448('0x1d')]+'.js'))){var _0x54c7ee=[];switch(_0x3df082['app'][_0x3448('0x1e')]()){case _0x3448('0x1f'):var _0x4b3d74=_0x3df082['appdata'][_0x3448('0x20')](',');if(_0x46784f[_0x3448('0x16')]===_0x3448('0x21')){_0x54c7ee[_0x3448('0x22')](_0x4b3d74[0x0]);_0x54c7ee[_0x3448('0x22')](_0x4b3d74[0x1]);_0x54c7ee['push'](_0x4b3d74[_0x3448('0x23')](0x2,_0x4b3d74[_0x3448('0x1a')])[_0x3448('0x1c')](','));}else{_0x54c7ee[_0x3448('0x22')](_0x4b3d74[0x0]);_0x54c7ee[_0x3448('0x22')](_0x4b3d74['slice'](0x1,_0x4b3d74[_0x3448('0x1a')])[_0x3448('0x1c')](','));}break;case'dialogflow':var _0x19a479=_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');_0x54c7ee[_0x3448('0x22')](_0x19a479[0x0]);_0x54c7ee[_0x3448('0x22')](_0x19a479[0x1]);_0x54c7ee[_0x3448('0x22')](_0x19a479[_0x3448('0x23')](0x2,_0x19a479[_0x3448('0x1a')])['join'](','));break;case _0x3448('0x25'):var _0x450704=_0x3df082[_0x3448('0x24')]['split'](',');_0x54c7ee[_0x3448('0x22')](_0x450704[0x0]);_0x54c7ee['push'](_0x450704[0x1]);_0x54c7ee['push'](_0x450704[0x2]);_0x54c7ee['push'](_0x450704[0x3]);_0x54c7ee[_0x3448('0x22')](_0x450704[_0x3448('0x23')](0x4,_0x450704['length'])['join'](','));break;case _0x3448('0x26'):var _0x37ceac=_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');_0x54c7ee['push'](_0x37ceac[0x0]);_0x54c7ee[_0x3448('0x22')](_0x37ceac[0x1]);_0x54c7ee[_0x3448('0x22')](_0x37ceac[0x2]);_0x54c7ee[_0x3448('0x22')](_0x37ceac[0x3]);_0x54c7ee['push'](_0x37ceac[_0x3448('0x23')](0x4,_0x37ceac[_0x3448('0x1a')])['join'](','));break;case'message':_0x54c7ee[_0x3448('0x22')](_0x3df082[_0x3448('0x24')]);break;case _0x3448('0x27'):_0x54c7ee[_0x3448('0x22')](_0x3df082['TagId']);_0x54c7ee[_0x3448('0x22')](_0x3df082[_0x3448('0x24')]);break;case _0x3448('0x28'):var _0x30b6b0=utils['getMustacheRender'](_0x46784f[_0x3448('0x29')][_0x3448('0x2a')],_0x46784f);var _0x5ea47c=_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x0]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x1]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x2]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x3]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x4]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x5]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x6]);_0x54c7ee['push'](_0x5ea47c[0x7]);_0x54c7ee['push'](_0x5ea47c[0x8]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x9]);_0x54c7ee['push'](_0x5ea47c[0xa]);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x18')]['id']);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x17')]['id']);_0x54c7ee['push'](_0x3df082[_0x3448('0x2b')]);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x18')][_0x3448('0x2c')]);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x2d')][_0x3448('0x2d')]);_0x54c7ee[_0x3448('0x22')](_0x30b6b0);break;default:_0x54c7ee=_[_0x3448('0x11')](_0x3df082['appdata'])?[]:_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');}var _0x322b46={'id':util[_0x3448('0xf')](_0x3448('0x2e'),_0x30f8dd,_0x3df082['id'],_0x3df082['app']),'condition':require(_0x3448('0x2f'))[_0x3448('0x30')](_0x30f8dd,getIntervals(_0x14104c[_0x3448('0x31')],_0x3df082),_0x14104c),'consequence':require(_0x3448('0x32')+_0x3df082[_0x3448('0x1d')])[_0x3448('0x33')](_0x30f8dd,_0x54c7ee,_0x14104c,_0x46784f),'p':_0x3df082[_0x3448('0x34')]||0x0};logger[_0x3448('0x35')]('Push\x20new\x20rule',_0x322b46['id'],_0x3448('0x36'),getIntervals(_0x14104c[_0x3448('0x31')],_0x3df082)[_0x3448('0x1c')]('\x20|\x20'));_0x13610a[_0x3448('0x22')](_0x322b46);}else{logger[_0x3448('0x37')](_0x3448('0x38'),path[_0x3448('0x1c')](__dirname,_0x3448('0x19'),_0x3df082[_0x3448('0x1d')]+_0x3448('0x39')));}}_0x14104c['rules'][_0x30f8dd]=new RuleEngine(_0x13610a);_0x14104c[_0x3448('0x15')][_0x30f8dd][_0x3448('0x3a')](_0x46784f,function(_0x1e7fb7){logger[_0x3448('0x35')](_0x3448('0x3b'),JSON[_0x3448('0x3c')](_0x1e7fb7['matchPath']));if(_0x14104c[_0x3448('0x15')][_0x30f8dd]){_0x14104c['rules'][_0x30f8dd]['emit'](_0x3448('0x3d'));}});return _0x472518({'code':0xc8,'message':_0x46784f});}else{logger[_0x3448('0x35')]('No\x20applications\x20to\x20execute');return _0x472518({'code':0xc8,'message':_0x46784f});}}catch(_0x3a700f){logger[_0x3448('0x37')](_0x3a700f['stack']);return _0x28f5b9(_0x4fc70f[_0x3448('0x37')](0x1f4,_0x3a700f));}}return _0x28f5b9(_0x3448('0x3e'));});},'AcceptMessage':function(_0x5d4263){var _0x35f875=this;return new Promise(function(_0x1186c9,_0x1fcd85){if(_0x5d4263[_0x3448('0x3f')]&&_0x5d4263[_0x3448('0x3f')]['id']){if(_0x14104c[_0x3448('0x40')][_0x5d4263[_0x3448('0x3f')]['id']]){_0x14104c['agents'][_0x5d4263['agent']['id']][_0x3448('0x41')]=![];_0x14104c[_0x3448('0x40')][_0x5d4263[_0x3448('0x3f')]['id']][_0x3448('0x42')]=undefined;}}if(_0x5d4263['message']&&_0x5d4263[_0x3448('0x17')]['id']){try{var _0x198e30=getId(_0x5d4263[_0x3448('0x16')],_0x5d4263[_0x3448('0x17')]?_0x5d4263[_0x3448('0x17')]['id']:0x0,_0x5d4263['interaction']?_0x5d4263[_0x3448('0x18')]['id']:0x0);if(_0x14104c['rules'][_0x198e30]){_0x14104c[_0x3448('0x15')][_0x198e30][_0x3448('0x43')]('end');if(rpc[_0x5d4263[_0x3448('0x16')]+_0x3448('0x44')]){rpc[_0x5d4263[_0x3448('0x16')]+_0x3448('0x44')][_0x3448('0x45')](_0x198e30,{'UserId':_0x5d4263[_0x3448('0x17')][_0x3448('0x46')]})['catch'](function(_0x23dbda){logger[_0x3448('0x37')]('error\x20update\x20queue\x20report');});}}return _0x1186c9({'code':0xc8,'message':_0x5d4263});}catch(_0x5a81dd){logger[_0x3448('0x37')](_0x5a81dd[_0x3448('0x47')]);return _0x1fcd85(_0x35f875['error'](0x1f4,_0x5a81dd));}}logger['error'](_0x3448('0x48'));return _0x1fcd85(_0x35f875[_0x3448('0x37')](0x1f4,_0x3448('0x48')));});},'RejectMessage':function(_0x430e74){var _0x176e60=this;return new Promise(function(_0x39db50,_0x2aea70){if(_0x430e74['agent']&&_0x430e74['agent']['id']){try{if(_0x14104c['agents'][_0x430e74[_0x3448('0x3f')]['id']]){_0x14104c[_0x3448('0x40')][_0x430e74['agent']['id']][_0x3448('0x41')]=![];_0x14104c[_0x3448('0x40')][_0x430e74['agent']['id']][_0x3448('0x42')]=undefined;}return _0x39db50({'code':0xc8,'message':_0x430e74});}catch(_0x93669){logger['error'](_0x93669[_0x3448('0x47')]);return _0x2aea70(_0x176e60[_0x3448('0x37')](0x1f4,_0x93669));}}logger[_0x3448('0x37')](_0x3448('0x48'));return _0x2aea70(_0x176e60[_0x3448('0x37')](0x1f4,_0x3448('0x48')));});},'AbandonInteraction':function(_0xeda861){var _0x1b7d87=this;return new Promise(function(_0x4520a1,_0x4926aa){if(_0xeda861[_0x3448('0x16')]&&_0xeda861['interaction']&&_0xeda861[_0x3448('0x18')]['id']){try{var _0x108b99=getId(_0xeda861[_0x3448('0x16')],_0xeda861[_0x3448('0x17')]?_0xeda861[_0x3448('0x17')]['id']:0x0,_0xeda861[_0x3448('0x18')]?_0xeda861['interaction']['id']:0x0);if(_0x14104c[_0x3448('0x15')][_0x108b99]){_0x14104c['rules'][_0x108b99][_0x3448('0x43')](_0x3448('0x49'));}return _0x4520a1({'code':0xc8,'message':_0xeda861});}catch(_0x3bf4d2){logger[_0x3448('0x37')](_0x3bf4d2[_0x3448('0x47')]);return _0x4926aa(_0x1b7d87['error'](0x1f4,_0x3bf4d2));}}logger['error'](_0x3448('0x48'));return _0x4926aa(_0x1b7d87[_0x3448('0x37')](0x1f4,_0x3448('0x48')));});},'AgentCapacity':function(_0x5a51bb){var _0x7c00fe=this;return new Promise(function(_0x3eb57b,_0x1e4fb9){if(_0x14104c[_0x3448('0x40')][_0x3448('0x4a')](_0x5a51bb['id'])){for(var _0x28205e in _0x5a51bb[_0x3448('0x4b')]){if(_0x5a51bb[_0x3448('0x4b')][_0x3448('0x4a')](_0x28205e)){if(_0x14104c[_0x3448('0x40')][_0x5a51bb['id']][_0x3448('0x4a')](_0x28205e+_0x3448('0x4c'))){_0x14104c[_0x3448('0x40')][_0x5a51bb['id']][_0x28205e+_0x3448('0x4c')]=parseInt(_0x5a51bb[_0x3448('0x4b')][_0x28205e],0xa);}}}_0x14104c[_0x3448('0x40')][_0x5a51bb['id']][_0x3448('0x4d')]();return _0x3eb57b({'code':0xc8,'message':_0x14104c[_0x3448('0x40')][_0x5a51bb['id']]});}else{return _0x1e4fb9(_0x7c00fe['error'](0x1f4,_0x3448('0x4e')));}});},'Agents':function(_0x4864d1){return new Promise(function(_0x29a8fb,_0x4f10dc){var _0x1f1e3c=_[_0x3448('0x4f')](_0x14104c['agents']);_0x29a8fb({'count':_0x1f1e3c[_0x3448('0x1a')],'rows':_0x1f1e3c});});},'ChatQueues':function(_0x2f6517){return new Promise(function(_0x54cddd,_0x4f6902){var _0x599350=[];for(var _0x4864ae in _0x14104c['chatQueues']){if(_0x14104c[_0x3448('0x50')][_0x3448('0x4a')](_0x4864ae)){var _0x5be195=_0x14104c['chatQueues'][_0x4864ae];var _0x1385b9={'id':_0x5be195['id'],'available':_0x5be195[_0x3448('0x51')],'loggedIn':_0x5be195[_0x3448('0x52')],'name':_0x5be195[_0x3448('0x53')],'paused':_0x5be195[_0x3448('0x54')],'waiting':_0x5be195[_0x3448('0x55')]};_0x599350[_0x3448('0x22')](_0x1385b9);}}_0x54cddd({'count':_0x599350[_0x3448('0x1a')],'rows':_0x599350});});},'MailQueues':function(_0x2cf3ef){return new Promise(function(_0x347412,_0x143b28){var _0x4369bd=[];for(var _0x41f84c in _0x14104c[_0x3448('0x56')]){if(_0x14104c['mailQueues'][_0x3448('0x4a')](_0x41f84c)){var _0x2dcf50=_0x14104c['mailQueues'][_0x41f84c];var _0x407b6a={'id':_0x2dcf50['id'],'available':_0x2dcf50[_0x3448('0x51')],'loggedIn':_0x2dcf50['loggedIn'],'name':_0x2dcf50[_0x3448('0x53')],'paused':_0x2dcf50[_0x3448('0x54')],'waiting':_0x2dcf50[_0x3448('0x55')]};_0x4369bd['push'](_0x407b6a);}}_0x347412({'count':_0x4369bd['length'],'rows':_0x4369bd});});},'OpenchannelQueues':function(_0x41d459){return new Promise(function(_0x489b70,_0x31dfc5){var _0x42c146=[];for(var _0x5d952a in _0x14104c['openchannelQueues']){if(_0x14104c[_0x3448('0x57')][_0x3448('0x4a')](_0x5d952a)){var _0x6ca224=_0x14104c['openchannelQueues'][_0x5d952a];var _0x4b8b33={'id':_0x6ca224['id'],'available':_0x6ca224[_0x3448('0x51')],'loggedIn':_0x6ca224[_0x3448('0x52')],'name':_0x6ca224[_0x3448('0x53')],'paused':_0x6ca224[_0x3448('0x54')],'waiting':_0x6ca224[_0x3448('0x55')]};_0x42c146[_0x3448('0x22')](_0x4b8b33);}}_0x489b70({'count':_0x42c146['length'],'rows':_0x42c146});});},'SmsQueues':function(_0x2ec688){return new Promise(function(_0x5dbbc5,_0x3f7a64){var _0x2cca2f=[];for(var _0x487174 in _0x14104c[_0x3448('0x58')]){if(_0x14104c[_0x3448('0x58')]['hasOwnProperty'](_0x487174)){var _0x4b793f=_0x14104c[_0x3448('0x58')][_0x487174];var _0x26ce48={'id':_0x4b793f['id'],'available':_0x4b793f[_0x3448('0x51')],'loggedIn':_0x4b793f[_0x3448('0x52')],'name':_0x4b793f[_0x3448('0x53')],'paused':_0x4b793f[_0x3448('0x54')],'waiting':_0x4b793f[_0x3448('0x55')]};_0x2cca2f[_0x3448('0x22')](_0x26ce48);}}_0x5dbbc5({'count':_0x2cca2f[_0x3448('0x1a')],'rows':_0x2cca2f});});},'FaxQueues':function(_0x3d7867){return new Promise(function(_0x36cfb4,_0xc0d8f1){var _0x46c693=[];for(var _0x11d62f in _0x14104c[_0x3448('0x59')]){if(_0x14104c[_0x3448('0x59')]['hasOwnProperty'](_0x11d62f)){var _0x4efd6c=_0x14104c[_0x3448('0x59')][_0x11d62f];var _0x4d2af5={'id':_0x4efd6c['id'],'available':_0x4efd6c[_0x3448('0x51')],'loggedIn':_0x4efd6c[_0x3448('0x52')],'name':_0x4efd6c['name'],'paused':_0x4efd6c[_0x3448('0x54')],'waiting':_0x4efd6c['waiting']};_0x46c693[_0x3448('0x22')](_0x4d2af5);}}_0x36cfb4({'count':_0x46c693[_0x3448('0x1a')],'rows':_0x46c693});});},'WhatsappQueues':function(_0x2dbd3c){return new Promise(function(_0x3a64cc,_0x349554){var _0x5f46a4=[];for(var _0xe21908 in _0x14104c[_0x3448('0x5a')]){if(_0x14104c[_0x3448('0x5a')]['hasOwnProperty'](_0xe21908)){var _0x2f1236=_0x14104c[_0x3448('0x5a')][_0xe21908];var _0x17c22b={'id':_0x2f1236['id'],'available':_0x2f1236['available'],'loggedIn':_0x2f1236[_0x3448('0x52')],'name':_0x2f1236['name'],'paused':_0x2f1236['paused'],'waiting':_0x2f1236[_0x3448('0x55')]};_0x5f46a4['push'](_0x17c22b);}}_0x3a64cc({'count':_0x5f46a4[_0x3448('0x1a')],'rows':_0x5f46a4});});},'ChatQueuesWaitingInteractions':function(_0x4ef3a5){return new Promise(function(_0x26a6db,_0x961895){var _0x4dcdae=_['values'](_0x14104c[_0x3448('0x5b')]);_0x26a6db({'count':_0x4dcdae[_0x3448('0x1a')],'rows':_0x4dcdae});});},'MailQueuesWaitingInteractions':function(_0x48fffc){return new Promise(function(_0x3cdb3c,_0x28ebdd){var _0x513a01=_[_0x3448('0x4f')](_0x14104c[_0x3448('0x5c')]);_0x3cdb3c({'count':_0x513a01[_0x3448('0x1a')],'rows':_0x513a01});});},'OpenchannelQueuesWaitingInteractions':function(_0xc92ddf){return new Promise(function(_0x577570,_0x37c395){var _0x5be142=_[_0x3448('0x4f')](_0x14104c['openchannelQueuesWaitingInteractions']);_0x577570({'count':_0x5be142[_0x3448('0x1a')],'rows':_0x5be142});});},'SmsQueuesWaitingInteractions':function(_0x20a047){return new Promise(function(_0x4117da,_0x4e0709){var _0x17ebc9=_[_0x3448('0x4f')](_0x14104c['smsQueuesWaitingInteractions']);_0x4117da({'count':_0x17ebc9[_0x3448('0x1a')],'rows':_0x17ebc9});});},'FaxQueuesWaitingInteractions':function(_0x51f6b0){return new Promise(function(_0x520950,_0x1022fa){var _0x5394b1=_[_0x3448('0x4f')](_0x14104c[_0x3448('0x5d')]);_0x520950({'count':_0x5394b1[_0x3448('0x1a')],'rows':_0x5394b1});});},'WhatsappQueuesWaitingInteractions':function(_0x59c822){return new Promise(function(_0x3b4de4,_0x716797){var _0x45f399=_[_0x3448('0x4f')](_0x14104c[_0x3448('0x5e')]);_0x3b4de4({'count':_0x45f399[_0x3448('0x1a')],'rows':_0x45f399});});}};var _0x203466=jayson[_0x3448('0x5f')](_0x2c2da6)[_0x3448('0x60')]();_0x203466['on'](_0x3448('0x37'),function(_0x7073d8){logger[_0x3448('0x37')](JSON[_0x3448('0x3c')](_0x7073d8));return _0x2387a3(_0x7073d8);});_0x203466['listen'](0x232c,'127.0.0.1',function(){console['log'](_0x3448('0x61'),0x232c);return _0x4daf3e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f263ffc..8ff0d81 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 _0x2338=['bluebird','jayson/promise','../../../config/logger','routing','client','http','request','error','message','result','catch','rules','stop','push','Command','format','iftime\x20%s','indexOf','true','then','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util'];(function(_0x1f5d8e,_0x1126e2){var _0x2d00f8=function(_0x3850ba){while(--_0x3850ba){_0x1f5d8e['push'](_0x1f5d8e['shift']());}};_0x2d00f8(++_0x1126e2);}(_0x2338,0x16b));var _0x8233=function(_0x1a73b9,_0x20f70a){_0x1a73b9=_0x1a73b9-0x0;var _0x37499e=_0x2338[_0x1a73b9];return _0x37499e;};'use strict';var util=require(_0x8233('0x0'));var BPromise=require(_0x8233('0x1'));var jayson=require(_0x8233('0x2'));var _=require('lodash');var logger=require(_0x8233('0x3'))(_0x8233('0x4'));var client=jayson[_0x8233('0x5')][_0x8233('0x6')]({'port':0x232a});function request(_0x1b8609,_0x528d42){return new BPromise(function(_0x399a85,_0x2018b3){return client[_0x8233('0x7')](_0x1b8609,_0x528d42)['then'](function(_0xbe911d){if(_0xbe911d[_0x8233('0x8')]){return _0x2018b3(_0xbe911d[_0x8233('0x8')][_0x8233('0x9')]);}else{return _0x399a85(_0xbe911d[_0x8233('0xa')]);}})[_0x8233('0xb')](function(_0x26a68b){return _0x2018b3(_0x26a68b);});});}exports['condition']=function(_0x503ab7,_0x11f346,_0x34b800){return function(_0x401c25){if(_0x34b800[_0x8233('0xc')]&&!_0x34b800[_0x8233('0xc')][_0x503ab7]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x503ab7);return _0x401c25[_0x8233('0xd')]();}var _0xf89566=[];for(var _0x508d44=0x0;_0x508d44<_0x11f346['length'];_0x508d44+=0x1){_0xf89566[_0x8233('0xe')](request(_0x8233('0xf'),{'command':util[_0x8233('0x10')](_0x8233('0x11'),_0x11f346[_0x508d44])})['then'](function(_0x3e8369){return _0x3e8369&&_0x3e8369[_0x8233('0x9')]&&_0x3e8369['message'][_0x8233('0x12')](_0x8233('0x13'))>=0x0?!![]:![];})[_0x8233('0xb')](function(_0x3f9238){logger[_0x8233('0x8')]('[%s][INTERVAL]\x20%s',_0x503ab7,_0x11f346[_0x508d44]);}));}BPromise['all'](_0xf89566)[_0x8233('0x14')](function(_0x997498){var _0x35813d=_[_0x8233('0x15')](_0x997498);logger['info'](_0x8233('0x16'),_0x503ab7,_0x11f346[_0x8233('0x17')](_0x8233('0x18')),_0x35813d);_0x401c25[_0x8233('0x19')](_0x35813d);})[_0x8233('0xb')](function(_0x5d4d47){console[_0x8233('0x1a')](_0x5d4d47);logger[_0x8233('0x8')](_0x8233('0x16'),_0x503ab7,_0x11f346[_0x8233('0x17')](_0x8233('0x18')),_0x5d4d47[_0x8233('0x1b')]);_0x401c25['stop']();});};}; \ No newline at end of file +var _0x0fd5=['http','request','error','result','catch','rules','info','stop','length','Command','format','iftime\x20%s','then','message','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','stack','bluebird','jayson/promise','lodash','routing'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0x0fd5,0x100));var _0x50fd=function(_0x30999d,_0x4ce1df){_0x30999d=_0x30999d-0x0;var _0x172e6e=_0x0fd5[_0x30999d];return _0x172e6e;};'use strict';var util=require('util');var BPromise=require(_0x50fd('0x0'));var jayson=require(_0x50fd('0x1'));var _=require(_0x50fd('0x2'));var logger=require('../../../config/logger')(_0x50fd('0x3'));var client=jayson['client'][_0x50fd('0x4')]({'port':0x232a});function request(_0x771d95,_0xb9c1f3){return new BPromise(function(_0x406a2a,_0x11e14b){return client[_0x50fd('0x5')](_0x771d95,_0xb9c1f3)['then'](function(_0x3aaba6){if(_0x3aaba6[_0x50fd('0x6')]){return _0x11e14b(_0x3aaba6[_0x50fd('0x6')]['message']);}else{return _0x406a2a(_0x3aaba6[_0x50fd('0x7')]);}})[_0x50fd('0x8')](function(_0x7f4af7){return _0x11e14b(_0x7f4af7);});});}exports['condition']=function(_0x4cf0a6,_0x759da,_0x1fbcea){return function(_0x4d9bd1){if(_0x1fbcea[_0x50fd('0x9')]&&!_0x1fbcea[_0x50fd('0x9')][_0x4cf0a6]){logger[_0x50fd('0xa')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4cf0a6);return _0x4d9bd1[_0x50fd('0xb')]();}var _0x16abcf=[];for(var _0xe4f194=0x0;_0xe4f194<_0x759da[_0x50fd('0xc')];_0xe4f194+=0x1){_0x16abcf['push'](request(_0x50fd('0xd'),{'command':util[_0x50fd('0xe')](_0x50fd('0xf'),_0x759da[_0xe4f194])})[_0x50fd('0x10')](function(_0x5b02ac){return _0x5b02ac&&_0x5b02ac[_0x50fd('0x11')]&&_0x5b02ac[_0x50fd('0x11')][_0x50fd('0x12')](_0x50fd('0x13'))>=0x0?!![]:![];})['catch'](function(_0x7bfb6b){logger[_0x50fd('0x6')](_0x50fd('0x14'),_0x4cf0a6,_0x759da[_0xe4f194]);}));}BPromise[_0x50fd('0x15')](_0x16abcf)['then'](function(_0x495df5){var _0x5b1d14=_['some'](_0x495df5);logger[_0x50fd('0xa')](_0x50fd('0x16'),_0x4cf0a6,_0x759da['join'](_0x50fd('0x17')),_0x5b1d14);_0x4d9bd1[_0x50fd('0x18')](_0x5b1d14);})[_0x50fd('0x8')](function(_0x58227e){console['log'](_0x58227e);logger[_0x50fd('0x6')](_0x50fd('0x16'),_0x4cf0a6,_0x759da['join'](_0x50fd('0x17')),_0x58227e[_0x50fd('0x19')]);_0x4d9bd1[_0x50fd('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 0972de8..255adbb 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 _0x4ded=['agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','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','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','diffTime'];(function(_0x107ca0,_0x572102){var _0x9ef495=function(_0x498255){while(--_0x498255){_0x107ca0['push'](_0x107ca0['shift']());}};_0x9ef495(++_0x572102);}(_0x4ded,0x116));var _0xd4de=function(_0x42d3fe,_0x1e5921){_0x42d3fe=_0x42d3fe-0x0;var _0x3e2dac=_0x4ded[_0x42d3fe];return _0x3e2dac;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var utils=require(_0xd4de('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fa334,_0x2349f5){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x5'),_0x1fa334[_0xd4de('0x6')],_0x1fa334[_0xd4de('0x7')],_0x1fa334[_0xd4de('0x8')],_0x1fa334[_0xd4de('0x9')],_0x1fa334['interface'],_0x1fa334[_0xd4de('0xa')],_0x1fa334[_0xd4de('0xb')],_0x1fa334[_0xd4de('0xc')]));if(_0x1fa334[_0xd4de('0x8')]){utils[_0xd4de('0xd')](_0x1fa334[_0xd4de('0x8')])['then'](function(_0xb7e8cf){if(_0xb7e8cf){_0x1fa334['type']=_0xb7e8cf['type'];_0x1fa334['agentacw']=_0x1fa334[_0xd4de('0xe')]?_0xb7e8cf[_0xd4de('0xf')]:![];_0x1fa334['acwtime']=_0x1fa334['agentacw']?_0xb7e8cf['acwTimeout']:0x0;}utils[_0xd4de('0x10')]('CreateVoiceAgentReport',_0x1fa334);});}else{utils[_0xd4de('0x10')](_0xd4de('0x11'),_0x1fa334);}if(_0x2349f5){delete transfers[_0x1fa334[_0xd4de('0x6')]];}else{delete agents[_0x1fa334[_0xd4de('0x12')]];}}exports[_0xd4de('0x13')]=function(_0x3af6e0){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x15'),_0x3af6e0[_0xd4de('0x6')]),_0x3af6e0);agents[_0x3af6e0[_0xd4de('0x12')]]=_0x3af6e0;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x16')]=utils[_0xd4de('0x17')]();agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x18');agents[_0x3af6e0['destuniqueid']]['connectedlinenum']=null;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x19')]=null;utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3af6e0['uniqueid'],agents[_0x3af6e0[_0xd4de('0x12')]]['membername'],_0x3af6e0[_0xd4de('0x12')]));}catch(_0x29c028){utils['error'](util[_0xd4de('0x4')]('[%s][agents][agentcalled]',_0x3af6e0[_0xd4de('0x6')]),_0x29c028);}};exports[_0xd4de('0x1a')]=function(_0x2bad14){try{if(!_[_0xd4de('0x1b')](agents[_0x2bad14['destuniqueid']])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x2bad14);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x1d'),_0x2bad14[_0xd4de('0x6')],agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x9')],_0x2bad14['destuniqueid']));agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1a')]=!![];agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1e')]=utils[_0xd4de('0x17')]();agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x20')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]]['holdtime']=_0x2bad14[_0xd4de('0x21')]?parseInt(_0x2bad14[_0xd4de('0x21')])/0x3e8:0x0;agents[_0x2bad14['destuniqueid']][_0xd4de('0x22')]=0x0;unanswered['push'](_0x2bad14[_0xd4de('0x12')]);}}catch(_0x32e407){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x32e407);}};exports[_0xd4de('0x24')]=function(_0x50cb73){try{_[_0xd4de('0x25')](agents,function(_0x1804c7,_0x55f9f9){if(_0x1804c7['uniqueid']==_0x50cb73['uniqueid']&&!_[_0xd4de('0x26')](unanswered,_0x1804c7['destuniqueid'])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x50cb73);utils['info'](util[_0xd4de('0x4')](_0xd4de('0x28'),_0x50cb73['uniqueid'],_0x1804c7[_0xd4de('0x9')],_0x1804c7[_0xd4de('0x12')]));_0x1804c7['agentringnoanswer']=!![];_0x1804c7['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x1804c7[_0xd4de('0xc')]=_0xd4de('0x29');_0x1804c7[_0xd4de('0x20')]='abandoned';_0x1804c7[_0xd4de('0x2a')]=_0x50cb73[_0xd4de('0x2a')];_0x1804c7['talktime']=0x0;writeDB(_0x1804c7);}});}catch(_0x329d49){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x329d49);}};exports[_0xd4de('0x2b')]=function(_0x53441c){try{if(agents[_0x53441c['destuniqueid']]){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c['uniqueid']),_0x53441c);utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x53441c[_0xd4de('0x6')],agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x9')],_0x53441c[_0xd4de('0x12')]));agents[_0x53441c['destuniqueid']]['agentconnectAt']=utils[_0xd4de('0x17')]();agents[_0x53441c['destuniqueid']][_0xd4de('0xb')]=_0x53441c['connectedlinenum'];agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x19')]=_0x53441c[_0xd4de('0x19')];agents[_0x53441c[_0xd4de('0x12')]]['holdtime']=_0x53441c[_0xd4de('0x21')];agents[_0x53441c['destuniqueid']][_0xd4de('0xc')]=_0xd4de('0x2d');_[_0xd4de('0x25')](agents,function(_0x4517a6,_0x349c5f){if(_0x4517a6[_0xd4de('0x12')]!=_0x53441c[_0xd4de('0x12')]&&_0x4517a6['uniqueid']==_0x53441c[_0xd4de('0x6')]){_0x4517a6[_0xd4de('0x22')]=0x0;_0x4517a6[_0xd4de('0x2a')]=_0x53441c[_0xd4de('0x21')];_0x4517a6[_0xd4de('0x1a')]=!![];_0x4517a6['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x4517a6[_0xd4de('0xc')]=_0xd4de('0x2e');_0x4517a6['reason']=_0xd4de('0x2e');_0x4517a6[_0xd4de('0x2f')]=_0x53441c[_0xd4de('0x12')];_0x4517a6['answeredelsewheremembername']=_0x53441c[_0xd4de('0x9')];writeDB(_0x4517a6);}});}}catch(_0x10a42c){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c[_0xd4de('0x6')]),_0x10a42c);}};exports[_0xd4de('0xe')]=function(_0x5ecbbd){try{if(!_[_0xd4de('0x1b')](agents[_0x5ecbbd[_0xd4de('0x12')]])){utils[_0xd4de('0x14')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0x5ecbbd);utils[_0xd4de('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5ecbbd[_0xd4de('0x6')],agents[_0x5ecbbd[_0xd4de('0x12')]]['membername'],_0x5ecbbd[_0xd4de('0x12')]));agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xe')]=!![];agents[_0x5ecbbd[_0xd4de('0x12')]]['agentcompleteAt']=utils[_0xd4de('0x17')]();agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x32')],agents[_0x5ecbbd['destuniqueid']][_0xd4de('0x33')]);agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x20')]=_0x5ecbbd[_0xd4de('0x20')];agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x34');writeDB(agents[_0x5ecbbd[_0xd4de('0x12')]]);}}catch(_0xaf442c){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0xaf442c);}};exports[_0xd4de('0x35')]=function(_0x518bfe){try{if(!_[_0xd4de('0x1b')](agents[_0x518bfe[_0xd4de('0x36')]])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x518bfe);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x38'),_0x518bfe[_0xd4de('0x6')],agents[_0x518bfe['transfereruniqueid']][_0xd4de('0x9')],agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')]));agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x39')]=!![];agents[_0x518bfe['transfereruniqueid']]['transfertype']=_0xd4de('0x3a');agents[_0x518bfe[_0xd4de('0x36')]]['transferexten']=_0x518bfe['extension'];agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x3b')]=agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')];}}catch(_0x34d772){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x34d772);}};exports[_0xd4de('0x3c')]=function(_0x3be8c2){try{utils[_0xd4de('0x14')](util['format'](_0xd4de('0x3d'),_0x3be8c2[_0xd4de('0x3e')]),_0x3be8c2);if(_0x3be8c2[_0xd4de('0x3e')]==_0x3be8c2[_0xd4de('0x3f')]){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x40')]])){utils['info'](util[_0xd4de('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3be8c2['origtransfereruniqueid'],agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x9')]));agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x39')]=!![];agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x44')];agents[_0x3be8c2['secondtransfereruniqueid']]['transferuniqueid']=_0x3be8c2['origtransfereruniqueid'];}if(_0x3be8c2[_0xd4de('0x45')]&&agents[_0x3be8c2[_0xd4de('0x45')]]){agents[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2['transfereeuniqueid']]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x45')]]);transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0xa')]=agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x40')]]['calleridname'];transfers[_0x3be8c2['transfereeuniqueid']]['agentcalledAt']=utils[_0xd4de('0x17')]();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x33')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x45')]]['agententerreason']=0x2;}}else if(_0x3be8c2[_0xd4de('0x40')]==_0x3be8c2['secondtransfererlinkedid']){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x3e')]])){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x49'),_0x3be8c2[_0xd4de('0x3e')],agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x9')]));agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x39')]=!![];agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x4a')];agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x3b')]=_0x3be8c2[_0xd4de('0x40')];}if(_0x3be8c2[_0xd4de('0x4b')]&&agents[_0x3be8c2[_0xd4de('0x4b')]]){agents[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2[_0xd4de('0x4b')]]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x4b')]]);transfers[_0x3be8c2[_0xd4de('0x4b')]]['calleridnum']=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x48')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x16')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x3be8c2['transfertargetuniqueid']][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x4b')]]['agententerreason']=0x2;}}}catch(_0x4a06b2){utils['error'](util['format'](_0xd4de('0x3d'),_0x3be8c2['origtransfereruniqueid']),_0x4a06b2);}};exports[_0xd4de('0x4c')]=function(_0x5ddba5){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5['uniqueid']),_0x5ddba5);if(agents[_0x5ddba5['uniqueid']]&&agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')]===_0xd4de('0x1f')){if(_0x5ddba5[_0xd4de('0x4d')]==='21'){agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=_0xd4de('0x4e');agents[_0x5ddba5['uniqueid']]['lastevent']='rejected';}utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x9')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]]['lastevent']));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);var _0x5a4882=unanswered[_0xd4de('0x4f')](_0x5ddba5[_0xd4de('0x6')]);if(_0x5a4882>-0x1){unanswered[_0xd4de('0x50')](_0x5a4882,0x1);}}if(transfers[_0x5ddba5[_0xd4de('0x6')]]){transfers[_0x5ddba5['uniqueid']][_0xd4de('0xe')]=!![];transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')]=utils[_0xd4de('0x17')]();transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]='agent';transfers[_0x5ddba5[_0xd4de('0x6')]]['lastevent']='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],transfers[_0x5ddba5[_0xd4de('0x6')]]['reason'],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(transfers[_0x5ddba5[_0xd4de('0x6')]],!![]);}if(agents[_0x5ddba5[_0xd4de('0x6')]]&&agents[_0x5ddba5[_0xd4de('0x6')]]['agentconnectAt']){agents[_0x5ddba5['uniqueid']]['agentcomplete']=!![];agents[_0x5ddba5['uniqueid']][_0xd4de('0x32')]=utils['now']();agents[_0x5ddba5[_0xd4de('0x6')]]['talktime']=utils[_0xd4de('0x31')](agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=agents[_0x5ddba5[_0xd4de('0x6')]]['transfer']?_0xd4de('0x39'):_0xd4de('0x51');agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);}}catch(_0x27fd09){utils[_0xd4de('0x23')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5[_0xd4de('0x6')]),_0x27fd09);}}; \ No newline at end of file +var _0xc788=['transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','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','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','queue','then','type','agentcomplete','acwtime','agentacw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','timeout','holdtime','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','reason','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','isNil','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten'];(function(_0x215832,_0x2ee733){var _0x100222=function(_0x12dfe7){while(--_0x12dfe7){_0x215832['push'](_0x215832['shift']());}};_0x100222(++_0x2ee733);}(_0xc788,0xc4));var _0x8c78=function(_0x2b90dc,_0x10b832){_0x2b90dc=_0x2b90dc-0x0;var _0x4794a6=_0xc788[_0x2b90dc];return _0x4794a6;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var utils=require(_0x8c78('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4ecb26,_0x4ce125){utils[_0x8c78('0x3')](util[_0x8c78('0x4')](_0x8c78('0x5'),_0x4ecb26[_0x8c78('0x6')],_0x4ecb26[_0x8c78('0x7')],_0x4ecb26['queue'],_0x4ecb26[_0x8c78('0x8')],_0x4ecb26[_0x8c78('0x9')],_0x4ecb26[_0x8c78('0xa')],_0x4ecb26[_0x8c78('0xb')],_0x4ecb26[_0x8c78('0xc')]));if(_0x4ecb26['queue']){utils[_0x8c78('0xd')](_0x4ecb26[_0x8c78('0xe')])[_0x8c78('0xf')](function(_0x39c0e5){if(_0x39c0e5){_0x4ecb26[_0x8c78('0x10')]=_0x39c0e5[_0x8c78('0x10')];_0x4ecb26['agentacw']=_0x4ecb26[_0x8c78('0x11')]?_0x39c0e5['acw']:![];_0x4ecb26[_0x8c78('0x12')]=_0x4ecb26[_0x8c78('0x13')]?_0x39c0e5['acwTimeout']:0x0;}utils[_0x8c78('0x14')](_0x8c78('0x15'),_0x4ecb26);});}else{utils['request'](_0x8c78('0x15'),_0x4ecb26);}if(_0x4ce125){delete transfers[_0x4ecb26['uniqueid']];}else{delete agents[_0x4ecb26['destuniqueid']];}}exports[_0x8c78('0x16')]=function(_0x1b1d0e){try{utils[_0x8c78('0x17')](util[_0x8c78('0x4')](_0x8c78('0x18'),_0x1b1d0e[_0x8c78('0x6')]),_0x1b1d0e);agents[_0x1b1d0e[_0x8c78('0x19')]]=_0x1b1d0e;agents[_0x1b1d0e[_0x8c78('0x19')]][_0x8c78('0x1a')]=utils[_0x8c78('0x1b')]();agents[_0x1b1d0e['destuniqueid']][_0x8c78('0xc')]=_0x8c78('0x1c');agents[_0x1b1d0e['destuniqueid']][_0x8c78('0xb')]=null;agents[_0x1b1d0e[_0x8c78('0x19')]][_0x8c78('0x1d')]=null;utils[_0x8c78('0x3')](util[_0x8c78('0x4')](_0x8c78('0x1e'),_0x1b1d0e['uniqueid'],agents[_0x1b1d0e['destuniqueid']][_0x8c78('0x8')],_0x1b1d0e['destuniqueid']));}catch(_0x56801a){utils[_0x8c78('0x1f')](util['format'](_0x8c78('0x18'),_0x1b1d0e[_0x8c78('0x6')]),_0x56801a);}};exports['agentringnoanswer']=function(_0x6c9a12){try{if(!_['isNil'](agents[_0x6c9a12[_0x8c78('0x19')]])){utils[_0x8c78('0x17')](util['format'](_0x8c78('0x20'),_0x6c9a12[_0x8c78('0x6')]),_0x6c9a12);utils['info'](util[_0x8c78('0x4')](_0x8c78('0x21'),_0x6c9a12[_0x8c78('0x6')],agents[_0x6c9a12[_0x8c78('0x19')]][_0x8c78('0x8')],_0x6c9a12[_0x8c78('0x19')]));agents[_0x6c9a12[_0x8c78('0x19')]][_0x8c78('0x22')]=!![];agents[_0x6c9a12[_0x8c78('0x19')]]['agentringnoanswerAt']=utils[_0x8c78('0x1b')]();agents[_0x6c9a12[_0x8c78('0x19')]][_0x8c78('0xc')]='timeout';agents[_0x6c9a12[_0x8c78('0x19')]]['reason']=_0x8c78('0x23');agents[_0x6c9a12[_0x8c78('0x19')]][_0x8c78('0x24')]=_0x6c9a12['ringtime']?parseInt(_0x6c9a12[_0x8c78('0x25')])/0x3e8:0x0;agents[_0x6c9a12[_0x8c78('0x19')]]['talktime']=0x0;unanswered[_0x8c78('0x26')](_0x6c9a12[_0x8c78('0x19')]);}}catch(_0x394c1d){utils[_0x8c78('0x1f')](util[_0x8c78('0x4')](_0x8c78('0x20'),_0x6c9a12['uniqueid']),_0x394c1d);}};exports[_0x8c78('0x27')]=function(_0x51add6){try{_[_0x8c78('0x28')](agents,function(_0x17f4c8,_0xb69c52){if(_0x17f4c8['uniqueid']==_0x51add6[_0x8c78('0x6')]&&!_[_0x8c78('0x29')](unanswered,_0x17f4c8['destuniqueid'])){utils[_0x8c78('0x17')](util[_0x8c78('0x4')](_0x8c78('0x2a'),_0x51add6['uniqueid']),_0x51add6);utils[_0x8c78('0x3')](util[_0x8c78('0x4')](_0x8c78('0x2b'),_0x51add6['uniqueid'],_0x17f4c8[_0x8c78('0x8')],_0x17f4c8[_0x8c78('0x19')]));_0x17f4c8['agentringnoanswer']=!![];_0x17f4c8[_0x8c78('0x2c')]=utils[_0x8c78('0x1b')]();_0x17f4c8[_0x8c78('0xc')]=_0x8c78('0x2d');_0x17f4c8[_0x8c78('0x2e')]=_0x8c78('0x2d');_0x17f4c8[_0x8c78('0x24')]=_0x51add6[_0x8c78('0x24')];_0x17f4c8[_0x8c78('0x2f')]=0x0;writeDB(_0x17f4c8);}});}catch(_0x15a868){utils['error'](util[_0x8c78('0x4')](_0x8c78('0x2a'),_0x51add6[_0x8c78('0x6')]),_0x15a868);}};exports[_0x8c78('0x30')]=function(_0x34481a){try{if(agents[_0x34481a['destuniqueid']]){utils[_0x8c78('0x17')](util[_0x8c78('0x4')](_0x8c78('0x31'),_0x34481a['uniqueid']),_0x34481a);utils[_0x8c78('0x3')](util[_0x8c78('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34481a[_0x8c78('0x6')],agents[_0x34481a['destuniqueid']][_0x8c78('0x8')],_0x34481a[_0x8c78('0x19')]));agents[_0x34481a[_0x8c78('0x19')]][_0x8c78('0x32')]=utils['now']();agents[_0x34481a[_0x8c78('0x19')]]['connectedlinenum']=_0x34481a[_0x8c78('0xb')];agents[_0x34481a[_0x8c78('0x19')]][_0x8c78('0x1d')]=_0x34481a['connectedlinename'];agents[_0x34481a['destuniqueid']][_0x8c78('0x24')]=_0x34481a[_0x8c78('0x25')];agents[_0x34481a[_0x8c78('0x19')]][_0x8c78('0xc')]=_0x8c78('0x33');_[_0x8c78('0x28')](agents,function(_0x326b34,_0x314679){if(_0x326b34[_0x8c78('0x19')]!=_0x34481a[_0x8c78('0x19')]&&_0x326b34[_0x8c78('0x6')]==_0x34481a[_0x8c78('0x6')]){_0x326b34[_0x8c78('0x2f')]=0x0;_0x326b34['holdtime']=_0x34481a[_0x8c78('0x25')];_0x326b34[_0x8c78('0x22')]=!![];_0x326b34['agentringnoanswerAt']=utils['now']();_0x326b34[_0x8c78('0xc')]=_0x8c78('0x34');_0x326b34['reason']=_0x8c78('0x34');_0x326b34[_0x8c78('0x35')]=_0x34481a['destuniqueid'];_0x326b34[_0x8c78('0x36')]=_0x34481a[_0x8c78('0x8')];writeDB(_0x326b34);}});}}catch(_0x57e2c7){utils[_0x8c78('0x1f')](util[_0x8c78('0x4')](_0x8c78('0x31'),_0x34481a[_0x8c78('0x6')]),_0x57e2c7);}};exports[_0x8c78('0x11')]=function(_0x4e4880){try{if(!_['isNil'](agents[_0x4e4880[_0x8c78('0x19')]])){utils[_0x8c78('0x17')](util[_0x8c78('0x4')](_0x8c78('0x37'),_0x4e4880[_0x8c78('0x6')]),_0x4e4880);utils[_0x8c78('0x3')](util[_0x8c78('0x4')](_0x8c78('0x38'),_0x4e4880[_0x8c78('0x6')],agents[_0x4e4880[_0x8c78('0x19')]][_0x8c78('0x8')],_0x4e4880['destuniqueid']));agents[_0x4e4880[_0x8c78('0x19')]][_0x8c78('0x11')]=!![];agents[_0x4e4880[_0x8c78('0x19')]][_0x8c78('0x39')]=utils[_0x8c78('0x1b')]();agents[_0x4e4880['destuniqueid']][_0x8c78('0x2f')]=utils[_0x8c78('0x3a')](agents[_0x4e4880[_0x8c78('0x19')]][_0x8c78('0x39')],agents[_0x4e4880[_0x8c78('0x19')]]['agentconnectAt']);agents[_0x4e4880[_0x8c78('0x19')]]['reason']=_0x4e4880['reason'];agents[_0x4e4880[_0x8c78('0x19')]][_0x8c78('0xc')]=_0x8c78('0x3b');writeDB(agents[_0x4e4880['destuniqueid']]);}}catch(_0x1d78a0){utils[_0x8c78('0x1f')](util[_0x8c78('0x4')](_0x8c78('0x37'),_0x4e4880[_0x8c78('0x6')]),_0x1d78a0);}};exports[_0x8c78('0x3c')]=function(_0x26103c){try{if(!_[_0x8c78('0x3d')](agents[_0x26103c[_0x8c78('0x3e')]])){utils['debug'](util[_0x8c78('0x4')](_0x8c78('0x3f'),_0x26103c[_0x8c78('0x6')]),_0x26103c);utils[_0x8c78('0x3')](util['format'](_0x8c78('0x40'),_0x26103c[_0x8c78('0x6')],agents[_0x26103c[_0x8c78('0x3e')]][_0x8c78('0x8')],agents[_0x26103c['transfereruniqueid']][_0x8c78('0x6')]));agents[_0x26103c[_0x8c78('0x3e')]][_0x8c78('0x41')]=!![];agents[_0x26103c['transfereruniqueid']][_0x8c78('0x42')]='blind';agents[_0x26103c[_0x8c78('0x3e')]][_0x8c78('0x43')]=_0x26103c[_0x8c78('0x44')];agents[_0x26103c[_0x8c78('0x3e')]][_0x8c78('0x45')]=agents[_0x26103c[_0x8c78('0x3e')]][_0x8c78('0x6')];}}catch(_0x38fec1){utils[_0x8c78('0x1f')](util[_0x8c78('0x4')](_0x8c78('0x3f'),_0x26103c[_0x8c78('0x6')]),_0x38fec1);}};exports[_0x8c78('0x46')]=function(_0x18d896){try{utils['debug'](util[_0x8c78('0x4')](_0x8c78('0x47'),_0x18d896[_0x8c78('0x48')]),_0x18d896);if(_0x18d896[_0x8c78('0x48')]==_0x18d896['origtransfererlinkedid']){if(!_[_0x8c78('0x3d')](agents[_0x18d896[_0x8c78('0x49')]])){utils[_0x8c78('0x3')](util[_0x8c78('0x4')](_0x8c78('0x4a'),_0x18d896[_0x8c78('0x48')],agents[_0x18d896['secondtransfereruniqueid']][_0x8c78('0x8')]));agents[_0x18d896[_0x8c78('0x49')]]['transfer']=!![];agents[_0x18d896[_0x8c78('0x49')]]['transfertype']=_0x8c78('0x4b');agents[_0x18d896[_0x8c78('0x49')]][_0x8c78('0x43')]=_0x18d896[_0x8c78('0x4c')];agents[_0x18d896[_0x8c78('0x49')]][_0x8c78('0x45')]=_0x18d896[_0x8c78('0x48')];}if(_0x18d896['transfereeuniqueid']&&agents[_0x18d896[_0x8c78('0x4d')]]){agents[_0x18d896[_0x8c78('0x4d')]]['agententerreason']=0x1;transfers[_0x18d896[_0x8c78('0x4d')]]=_[_0x8c78('0x4e')](agents[_0x18d896['transfereeuniqueid']]);transfers[_0x18d896[_0x8c78('0x4d')]][_0x8c78('0xa')]=agents[_0x18d896[_0x8c78('0x49')]][_0x8c78('0xa')];transfers[_0x18d896[_0x8c78('0x4d')]][_0x8c78('0x4f')]=agents[_0x18d896[_0x8c78('0x49')]][_0x8c78('0x4f')];transfers[_0x18d896[_0x8c78('0x4d')]][_0x8c78('0x1a')]=utils[_0x8c78('0x1b')]();transfers[_0x18d896[_0x8c78('0x4d')]][_0x8c78('0x32')]=utils[_0x8c78('0x1b')]();transfers[_0x18d896['transfereeuniqueid']][_0x8c78('0x24')]=0x0;transfers[_0x18d896['transfereeuniqueid']][_0x8c78('0x50')]=0x2;}}else if(_0x18d896['secondtransfereruniqueid']==_0x18d896['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x18d896[_0x8c78('0x48')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x18d896[_0x8c78('0x48')],agents[_0x18d896[_0x8c78('0x48')]][_0x8c78('0x8')]));agents[_0x18d896[_0x8c78('0x48')]]['transfer']=!![];agents[_0x18d896[_0x8c78('0x48')]][_0x8c78('0x42')]=_0x8c78('0x4b');agents[_0x18d896[_0x8c78('0x48')]][_0x8c78('0x43')]=_0x18d896[_0x8c78('0x51')];agents[_0x18d896[_0x8c78('0x48')]][_0x8c78('0x45')]=_0x18d896[_0x8c78('0x49')];}if(_0x18d896[_0x8c78('0x52')]&&agents[_0x18d896[_0x8c78('0x52')]]){agents[_0x18d896[_0x8c78('0x52')]][_0x8c78('0x50')]=0x1;transfers[_0x18d896[_0x8c78('0x52')]]=_['clone'](agents[_0x18d896[_0x8c78('0x52')]]);transfers[_0x18d896['transfertargetuniqueid']][_0x8c78('0xa')]=agents[_0x18d896[_0x8c78('0x48')]][_0x8c78('0xa')];transfers[_0x18d896['transfertargetuniqueid']][_0x8c78('0x4f')]=agents[_0x18d896[_0x8c78('0x48')]][_0x8c78('0x4f')];transfers[_0x18d896['transfertargetuniqueid']][_0x8c78('0x1a')]=utils[_0x8c78('0x1b')]();transfers[_0x18d896['transfertargetuniqueid']][_0x8c78('0x32')]=utils[_0x8c78('0x1b')]();transfers[_0x18d896[_0x8c78('0x52')]]['holdtime']=0x0;transfers[_0x18d896[_0x8c78('0x52')]][_0x8c78('0x50')]=0x2;}}}catch(_0x1015e8){utils[_0x8c78('0x1f')](util[_0x8c78('0x4')](_0x8c78('0x47'),_0x18d896[_0x8c78('0x48')]),_0x1015e8);}};exports[_0x8c78('0x53')]=function(_0x240f1e){try{utils['debug'](util[_0x8c78('0x4')](_0x8c78('0x54'),_0x240f1e[_0x8c78('0x6')]),_0x240f1e);if(agents[_0x240f1e[_0x8c78('0x6')]]&&agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x2e')]===_0x8c78('0x23')){if(_0x240f1e[_0x8c78('0x55')]==='21'){agents[_0x240f1e[_0x8c78('0x6')]]['reason']=_0x8c78('0x56');agents[_0x240f1e[_0x8c78('0x6')]]['lastevent']='rejected';}utils[_0x8c78('0x3')](util['format'](_0x8c78('0x57'),_0x240f1e[_0x8c78('0x6')],agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x8')],agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x2e')],agents[_0x240f1e['uniqueid']]['lastevent']));writeDB(agents[_0x240f1e[_0x8c78('0x6')]]);var _0x2d385f=unanswered[_0x8c78('0x58')](_0x240f1e[_0x8c78('0x6')]);if(_0x2d385f>-0x1){unanswered[_0x8c78('0x59')](_0x2d385f,0x1);}}if(transfers[_0x240f1e['uniqueid']]){transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x11')]=!![];transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x39')]=utils[_0x8c78('0x1b')]();transfers[_0x240f1e[_0x8c78('0x6')]]['talktime']=utils[_0x8c78('0x3a')](transfers[_0x240f1e[_0x8c78('0x6')]]['agentcompleteAt'],transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x32')]);transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x2e')]=_0x8c78('0x5a');transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0xc')]=_0x8c78('0x3b');utils[_0x8c78('0x3')](util[_0x8c78('0x4')](_0x8c78('0x57'),_0x240f1e[_0x8c78('0x6')],transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x8')],transfers[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x2e')],transfers[_0x240f1e[_0x8c78('0x6')]]['lastevent']));writeDB(transfers[_0x240f1e[_0x8c78('0x6')]],!![]);}if(agents[_0x240f1e['uniqueid']]&&agents[_0x240f1e['uniqueid']][_0x8c78('0x32')]){agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x11')]=!![];agents[_0x240f1e[_0x8c78('0x6')]]['agentcompleteAt']=utils[_0x8c78('0x1b')]();agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x2f')]=utils['diffTime'](agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x39')],agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x32')]);agents[_0x240f1e['uniqueid']][_0x8c78('0x2e')]=agents[_0x240f1e[_0x8c78('0x6')]]['transfer']?'transfer':'agent';agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0xc')]=_0x8c78('0x3b');utils[_0x8c78('0x3')](util['format'](_0x8c78('0x57'),_0x240f1e['uniqueid'],agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x8')],agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0x2e')],agents[_0x240f1e[_0x8c78('0x6')]][_0x8c78('0xc')]));writeDB(agents[_0x240f1e['uniqueid']]);}}catch(_0x5c67c9){utils['error'](util[_0x8c78('0x4')](_0x8c78('0x54'),_0x240f1e['uniqueid']),_0x5c67c9);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8d88373..3593383 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 _0x14a0=['[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','value','source','xmd-phone','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','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','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime'];(function(_0x1db5a1,_0x41bb70){var _0x36c8ae=function(_0x463c53){while(--_0x463c53){_0x1db5a1['push'](_0x1db5a1['shift']());}};_0x36c8ae(++_0x41bb70);}(_0x14a0,0x109));var _0x014a=function(_0x2129a3,_0x48f17a){_0x2129a3=_0x2129a3-0x0;var _0x18842b=_0x14a0[_0x2129a3];return _0x18842b;};'use strict';var _=require(_0x014a('0x0'));var util=require(_0x014a('0x1'));var utils=require(_0x014a('0x2'));var transfers=require(_0x014a('0x3'));var dispositions=[_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x5'),_0x014a('0x4'),_0x014a('0x4'),'NO\x20ANSWER',_0x014a('0x6'),_0x014a('0x7'),'FAILED',_0x014a('0x5'),_0x014a('0x5')];var channels={};function writeDB(_0x290270){var _0x1b9b0e;if(transfers[_0x014a('0x8')][_0x290270['uniqueid']]){_0x1b9b0e=_0x290270[_0x014a('0x9')];_0x290270[_0x014a('0x9')]=transfers[_0x014a('0x8')][_0x290270[_0x014a('0x9')]][_0x014a('0xa')];}utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0xd'),_0x290270[_0x014a('0x9')],_0x290270[_0x014a('0xe')],_0x290270[_0x014a('0xf')],_0x290270[_0x014a('0x10')],_0x290270[_0x014a('0x11')],_0x290270[_0x014a('0x12')],_0x290270[_0x014a('0x13')],_0x290270[_0x014a('0x14')]));if(_0x290270[_0x014a('0x15')]){utils[_0x014a('0x16')](_0x290270[_0x014a('0x15')])[_0x014a('0x17')](function(_0xf689a){if(_0xf689a){_0x290270['UserId']=_0xf689a['id'];}utils[_0x014a('0x18')]('CreateVoiceCallReport',_0x290270);});}else{utils[_0x014a('0x18')]('CreateVoiceCallReport',_0x290270);}if(channels[_0x290270[_0x014a('0x9')]]){delete channels[_0x290270[_0x014a('0x9')]];}else if(_0x1b9b0e&&channels[_0x1b9b0e]){if(!transfers[_0x014a('0x8')][_0x1b9b0e][_0x014a('0x19')])delete transfers[_0x014a('0x8')][_0x1b9b0e];delete channels[_0x1b9b0e];}}exports[_0x014a('0x1a')]=function(_0x2f9c52){try{utils[_0x014a('0x1b')](util[_0x014a('0xc')](_0x014a('0x1c'),_0x2f9c52[_0x014a('0x9')]),_0x2f9c52);if(_0x2f9c52[_0x014a('0x9')]==_0x2f9c52[_0x014a('0x1d')]&&_0x2f9c52[_0x014a('0xe')]!=_0x014a('0x1e')){utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x1f'),_0x2f9c52[_0x014a('0x9')],_0x2f9c52['context'],_0x2f9c52[_0x014a('0x20')]));channels[_0x2f9c52[_0x014a('0x9')]]={'uniqueid':_0x2f9c52[_0x014a('0x9')],'accountcode':_0x2f9c52[_0x014a('0x15')],'source':_0x2f9c52[_0x014a('0x12')],'destination':_0x2f9c52[_0x014a('0x20')],'destinationcontext':_0x2f9c52['context'],'channel':_0x2f9c52['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x014a('0x4'),'amaflags':_0x014a('0x21')};}}catch(_0x16bf2f){utils[_0x014a('0x22')](util['format'](_0x014a('0x1c'),_0x2f9c52[_0x014a('0x9')]),_0x16bf2f);}};exports[_0x014a('0x23')]=function(_0x1c826f){try{utils[_0x014a('0x1b')](util[_0x014a('0xc')](_0x014a('0x24'),_0x1c826f[_0x014a('0x9')]),_0x1c826f);if(!_[_0x014a('0x25')](channels[_0x1c826f[_0x014a('0x9')]])&&_0x1c826f[_0x014a('0x26')]==0x6){utils['info'](util[_0x014a('0xc')](_0x014a('0x27'),_0x1c826f[_0x014a('0x9')],_0x1c826f[_0x014a('0x28')],_0x1c826f['channel']));if(_[_0x014a('0x25')](channels[_0x1c826f[_0x014a('0x9')]]['systemanswertime'])){channels[_0x1c826f['uniqueid']]['systemanswertime']=utils[_0x014a('0x29')]();}}else if(!_[_0x014a('0x25')](channels[_0x1c826f[_0x014a('0x1d')]])&&_0x1c826f[_0x014a('0x26')]==0x6&&_0x1c826f['context']!='transfer'){utils[_0x014a('0xb')](util['format'](_0x014a('0x2a'),_0x1c826f['uniqueid'],_0x1c826f['linkedid'],_0x1c826f[_0x014a('0x28')],_0x1c826f[_0x014a('0xe')]));channels[_0x1c826f[_0x014a('0x1d')]][_0x014a('0x15')]=_0x1c826f['accountcode'];channels[_0x1c826f[_0x014a('0x1d')]][_0x014a('0x2b')]=_0x1c826f['channel'];if(_[_0x014a('0x25')](channels[_0x1c826f[_0x014a('0x1d')]][_0x014a('0x2c')])){channels[_0x1c826f[_0x014a('0x1d')]]['answertime']=utils[_0x014a('0x29')]();}channels[_0x1c826f['linkedid']][_0x014a('0x2d')]=dispositions[_[_0x014a('0x2e')](_0x1c826f['channelstate'])]||'ANSWERED';}}catch(_0x2e7dec){utils[_0x014a('0x22')](util[_0x014a('0xc')](_0x014a('0x24'),_0x1c826f['uniqueid']),_0x2e7dec);}};exports[_0x014a('0x2f')]=function(_0x3aa986){try{if(!_[_0x014a('0x25')](channels[_0x3aa986[_0x014a('0x9')]])){utils[_0x014a('0x1b')](util['format'](_0x014a('0x30'),_0x3aa986['uniqueid']),_0x3aa986);if(_[_0x014a('0x25')](channels[_0x3aa986[_0x014a('0x9')]]['callerid'])){channels[_0x3aa986[_0x014a('0x9')]][_0x014a('0x31')]=_0x3aa986[_0x014a('0x32')]+'\x20<'+_0x3aa986[_0x014a('0x12')]+'>';}utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x33'),_0x3aa986[_0x014a('0x9')],channels[_0x3aa986[_0x014a('0x9')]]['callerid'],_0x3aa986[_0x014a('0x34')]));channels[_0x3aa986['uniqueid']]['endtime']=utils[_0x014a('0x29')]();channels[_0x3aa986[_0x014a('0x9')]][_0x014a('0x35')]=utils['diffTime'](channels[_0x3aa986['uniqueid']][_0x014a('0x36')],channels[_0x3aa986[_0x014a('0x9')]][_0x014a('0x37')]);channels[_0x3aa986['uniqueid']][_0x014a('0x38')]=channels[_0x3aa986[_0x014a('0x9')]][_0x014a('0x2c')]?utils[_0x014a('0x39')](channels[_0x3aa986[_0x014a('0x9')]][_0x014a('0x36')],channels[_0x3aa986[_0x014a('0x9')]][_0x014a('0x2c')]):0x0;writeDB(channels[_0x3aa986[_0x014a('0x9')]]);}}catch(_0x4e7cd7){utils[_0x014a('0x22')](util[_0x014a('0xc')](_0x014a('0x30'),_0x3aa986[_0x014a('0x9')]),_0x4e7cd7);}};exports['attendedtransfer']=function(_0x29453f){try{if(!_[_0x014a('0x25')](channels[_0x29453f[_0x014a('0x3a')]])){utils[_0x014a('0x1b')](util[_0x014a('0xc')](_0x014a('0x3b'),_0x29453f[_0x014a('0x3c')]),_0x29453f);if(channels[_0x29453f[_0x014a('0x3a')]]['channel']==_0x29453f[_0x014a('0x3d')]){utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x3e'),_0x29453f[_0x014a('0x3c')],_0x29453f[_0x014a('0x3a')],_0x29453f[_0x014a('0x3f')]));channels[_0x29453f['localtwolinkedid']][_0x014a('0x2b')]=_0x29453f[_0x014a('0x3f')];channels[_0x29453f[_0x014a('0x3a')]][_0x014a('0x40')]=_0x014a('0x41');}else if(channels[_0x29453f['localtwolinkedid']][_0x014a('0xe')]=_0x29453f[_0x014a('0x42')]){utils['info'](util[_0x014a('0xc')](_0x014a('0x3e'),_0x29453f[_0x014a('0x3c')],_0x29453f[_0x014a('0x3a')],_0x29453f[_0x014a('0x43')]));channels[_0x29453f[_0x014a('0x3a')]]['destinationchannel']=_0x29453f[_0x014a('0x43')];channels[_0x29453f[_0x014a('0x3a')]][_0x014a('0x40')]=_0x014a('0x41');}}}catch(_0x2162a6){utils['error'](util[_0x014a('0xc')](_0x014a('0x3b'),_0x29453f['origtransfereruniqueid']),_0x2162a6);}};exports[_0x014a('0x44')]=function(_0x62c704){try{if(!_[_0x014a('0x25')](channels[_0x62c704['uniqueid']])){utils['debug'](util[_0x014a('0xc')](_0x014a('0x45'),_0x62c704[_0x014a('0x9')]),_0x62c704);channels[_0x62c704['uniqueid']][_0x014a('0x46')]=utils[_0x014a('0x29')]();utils[_0x014a('0xb')](util['format'](_0x014a('0x47'),_0x62c704[_0x014a('0x9')],channels[_0x62c704['uniqueid']][_0x014a('0x46')]));}}catch(_0x16995e){utils['error'](util[_0x014a('0xc')](_0x014a('0x45'),_0x62c704[_0x014a('0x9')]),_0x16995e);}};exports[_0x014a('0x48')]=function(_0xf8e3fb){try{if(!_[_0x014a('0x25')](channels[_0xf8e3fb['uniqueid']])){utils[_0x014a('0x1b')](util[_0x014a('0xc')]('[%s][calls][musiconholdstop]',_0xf8e3fb[_0x014a('0x9')]),_0xf8e3fb);if(!_[_0x014a('0x25')](channels[_0xf8e3fb[_0x014a('0x9')]][_0x014a('0x46')])){channels[_0xf8e3fb[_0x014a('0x9')]][_0x014a('0x49')]+=utils[_0x014a('0x39')](utils['now'](),channels[_0xf8e3fb[_0x014a('0x9')]][_0x014a('0x46')]);utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x4a'),_0xf8e3fb[_0x014a('0x9')],channels[_0xf8e3fb[_0x014a('0x9')]]['mohtime']));delete channels[_0xf8e3fb['uniqueid']][_0x014a('0x46')];}}}catch(_0x2c5281){utils[_0x014a('0x22')](util['format'](_0x014a('0x4b'),_0xf8e3fb[_0x014a('0x9')]),_0x2c5281);}};exports['varset']=function(_0x4bd6d0){try{if(!_[_0x014a('0x25')](channels[_0x4bd6d0['uniqueid']])){utils[_0x014a('0x1b')](util['format'](_0x014a('0x4c'),_0x4bd6d0[_0x014a('0x9')]),_0x4bd6d0);if(!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')]['xmd-originatecalleridnum'])){utils[_0x014a('0xb')](util[_0x014a('0xc')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x4bd6d0[_0x014a('0x9')],_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0['uniqueid']][_0x014a('0x4f')]=_0x4bd6d0[_0x014a('0x4e')];}if(!_[_0x014a('0x25')](_0x4bd6d0['variable'][_0x014a('0x50')])){utils[_0x014a('0xb')](util[_0x014a('0xc')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4bd6d0[_0x014a('0x9')],_0x4bd6d0['value']));channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x51')]=_0x4bd6d0[_0x014a('0x4e')];channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x31')]='\x22'+_0x4bd6d0[_0x014a('0x4e')]+_0x014a('0x52')+_0x4bd6d0[_0x014a('0x4e')]+'>';}if(!_['isNil'](_0x4bd6d0[_0x014a('0x4d')]['xmd-callerid-preview'])||!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')]['xmd-callerid'])){utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x53'),_0x4bd6d0['uniqueid'],!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')][_0x014a('0x54')])?_0x014a('0x54'):'xmd-callerid',_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x31')]=_0x4bd6d0[_0x014a('0x4e')];}if(!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')][_0x014a('0x55')])||!_['isNil'](_0x4bd6d0[_0x014a('0x4d')][_0x014a('0x56')])){utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x53'),_0x4bd6d0[_0x014a('0x9')],!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')]['xmd-queue'])?_0x014a('0x55'):_0x014a('0x56'),_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0['uniqueid']][_0x014a('0x57')]=_0x014a('0x58');channels[_0x4bd6d0['uniqueid']]['lastdata']=_0x4bd6d0[_0x014a('0x4e')];channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0xf')]=!![];}if(!_[_0x014a('0x25')](_0x4bd6d0['variable'][_0x014a('0x59')])){utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x5a'),_0x4bd6d0[_0x014a('0x9')],_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x5b')]=_0x4bd6d0[_0x014a('0x4e')];}if(!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')][_0x014a('0x5c')])){utils[_0x014a('0xb')](util[_0x014a('0xc')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4bd6d0[_0x014a('0x9')],_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x5d')]=_0x4bd6d0[_0x014a('0x4e')];}if(!_[_0x014a('0x25')](_0x4bd6d0['variable']['outboundrouteid'])){utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x5e'),_0x4bd6d0[_0x014a('0x9')],_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x5f')]=_0x4bd6d0[_0x014a('0x4e')];}if(!_[_0x014a('0x25')](_0x4bd6d0[_0x014a('0x4d')][_0x014a('0x60')])){utils['info'](util['format'](_0x014a('0x61'),_0x4bd6d0[_0x014a('0x9')],_0x4bd6d0[_0x014a('0x4e')]));channels[_0x4bd6d0[_0x014a('0x9')]][_0x014a('0x60')]=_0x4bd6d0[_0x014a('0x4e')];}}}catch(_0x323f8c){utils[_0x014a('0x22')](util[_0x014a('0xc')](_0x014a('0x4c'),_0x4bd6d0[_0x014a('0x9')]),_0x323f8c);}};exports[_0x014a('0x62')]=function(_0x59e1ad){try{if(!_[_0x014a('0x25')](channels[_0x59e1ad[_0x014a('0x9')]])){utils['debug'](util[_0x014a('0xc')](_0x014a('0x63'),_0x59e1ad[_0x014a('0x9')]),_0x59e1ad);utils[_0x014a('0xb')](util[_0x014a('0xc')](_0x014a('0x64'),_0x59e1ad[_0x014a('0x9')],_0x59e1ad[_0x014a('0x65')],_0x59e1ad[_0x014a('0x66')]));if(_0x59e1ad[_0x014a('0x65')]['toLowerCase']()==_0x014a('0x67')&&_['startsWith'](_0x59e1ad[_0x014a('0x66')][_0x014a('0x68')](),'cdr')){var _0x4b6122=_0x59e1ad[_0x014a('0x66')][_0x014a('0x69')]('=');var _0x5e1d06=_0x4b6122[0x0][_0x014a('0x6a')](_0x4b6122[0x0]['lastIndexOf']('(')+0x1,_0x4b6122[0x0][_0x014a('0x6b')](')'));var _0x1ce964=_0x4b6122[0x1];channels[_0x59e1ad['uniqueid']][_0x5e1d06]=_0x1ce964;}if(!_[_0x014a('0x6c')]([_0x014a('0x2f'),_0x014a('0x6d'),_0x014a('0x6e'),_0x014a('0x67'),_0x014a('0x6f')],_0x59e1ad[_0x014a('0x65')][_0x014a('0x68')]())){channels[_0x59e1ad[_0x014a('0x9')]][_0x014a('0x57')]=_0x59e1ad[_0x014a('0x65')];channels[_0x59e1ad[_0x014a('0x9')]][_0x014a('0x70')]=_0x59e1ad[_0x014a('0x66')];}}}catch(_0xa9d1bc){utils[_0x014a('0x22')](util[_0x014a('0xc')]('[%s][calls][newexten]',_0x59e1ad[_0x014a('0x9')]),_0xa9d1bc);}}; \ No newline at end of file +var _0x8579=['_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%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','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','uniqueid','blinds','transfereeuniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','ANSWERED','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','endtime','billableseconds','answertime','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel'];(function(_0x258376,_0x1bcb8d){var _0x75ac11=function(_0xd21397){while(--_0xd21397){_0x258376['push'](_0x258376['shift']());}};_0x75ac11(++_0x1bcb8d);}(_0x8579,0x16c));var _0x9857=function(_0x2aa7c2,_0x4da5cc){_0x2aa7c2=_0x2aa7c2-0x0;var _0x2d6337=_0x8579[_0x2aa7c2];return _0x2d6337;};'use strict';var _=require(_0x9857('0x0'));var util=require(_0x9857('0x1'));var utils=require('./utils');var transfers=require(_0x9857('0x2'));var dispositions=[_0x9857('0x3'),_0x9857('0x4'),_0x9857('0x4'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x9857('0x5'),_0x9857('0x4'),_0x9857('0x4'),_0x9857('0x4')];var channels={};function writeDB(_0x3f0977){var _0x3a36cd;if(transfers['blinds'][_0x3f0977[_0x9857('0x6')]]){_0x3a36cd=_0x3f0977[_0x9857('0x6')];_0x3f0977[_0x9857('0x6')]=transfers[_0x9857('0x7')][_0x3f0977[_0x9857('0x6')]][_0x9857('0x8')];}utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3f0977[_0x9857('0x6')],_0x3f0977[_0x9857('0x9')],_0x3f0977[_0x9857('0xa')],_0x3f0977[_0x9857('0xb')],_0x3f0977[_0x9857('0xc')],_0x3f0977[_0x9857('0xd')],_0x3f0977[_0x9857('0xe')],_0x3f0977[_0x9857('0xf')]));if(_0x3f0977[_0x9857('0x10')]){utils[_0x9857('0x11')](_0x3f0977[_0x9857('0x10')])[_0x9857('0x12')](function(_0xaf5d4){if(_0xaf5d4){_0x3f0977[_0x9857('0x13')]=_0xaf5d4['id'];}utils[_0x9857('0x14')](_0x9857('0x15'),_0x3f0977);});}else{utils[_0x9857('0x14')](_0x9857('0x15'),_0x3f0977);}if(channels[_0x3f0977[_0x9857('0x6')]]){delete channels[_0x3f0977[_0x9857('0x6')]];}else if(_0x3a36cd&&channels[_0x3a36cd]){if(!transfers['blinds'][_0x3a36cd][_0x9857('0x16')])delete transfers[_0x9857('0x7')][_0x3a36cd];delete channels[_0x3a36cd];}}exports[_0x9857('0x17')]=function(_0x77427f){try{utils[_0x9857('0x18')](util[_0x9857('0x19')]('[%s][calls][newchannel]',_0x77427f['uniqueid']),_0x77427f);if(_0x77427f['uniqueid']==_0x77427f['linkedid']&&_0x77427f[_0x9857('0x9')]!=_0x9857('0x1a')){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x1c'),_0x77427f[_0x9857('0x6')],_0x77427f[_0x9857('0x1d')],_0x77427f[_0x9857('0x1e')]));channels[_0x77427f[_0x9857('0x6')]]={'uniqueid':_0x77427f[_0x9857('0x6')],'accountcode':_0x77427f['accountcode'],'source':_0x77427f[_0x9857('0xd')],'destination':_0x77427f[_0x9857('0x1e')],'destinationcontext':_0x77427f[_0x9857('0x1d')],'channel':_0x77427f[_0x9857('0x9')],'starttime':utils[_0x9857('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9857('0x3'),'amaflags':_0x9857('0x20')};}}catch(_0x3c4201){utils[_0x9857('0x21')](util['format'](_0x9857('0x22'),_0x77427f[_0x9857('0x6')]),_0x3c4201);}};exports[_0x9857('0x23')]=function(_0x2f8d3b){try{utils[_0x9857('0x18')](util[_0x9857('0x19')]('[%s][calls][newstate]',_0x2f8d3b[_0x9857('0x6')]),_0x2f8d3b);if(!_[_0x9857('0x24')](channels[_0x2f8d3b[_0x9857('0x6')]])&&_0x2f8d3b[_0x9857('0x25')]==0x6){utils[_0x9857('0x1b')](util['format'](_0x9857('0x26'),_0x2f8d3b[_0x9857('0x6')],_0x2f8d3b[_0x9857('0x1d')],_0x2f8d3b[_0x9857('0x9')]));if(_['isNil'](channels[_0x2f8d3b[_0x9857('0x6')]][_0x9857('0x27')])){channels[_0x2f8d3b[_0x9857('0x6')]]['systemanswertime']=utils[_0x9857('0x1f')]();}}else if(!_['isNil'](channels[_0x2f8d3b[_0x9857('0x28')]])&&_0x2f8d3b[_0x9857('0x25')]==0x6&&_0x2f8d3b['context']!=_0x9857('0x29')){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x2a'),_0x2f8d3b['uniqueid'],_0x2f8d3b[_0x9857('0x28')],_0x2f8d3b['context'],_0x2f8d3b[_0x9857('0x9')]));channels[_0x2f8d3b[_0x9857('0x28')]][_0x9857('0x10')]=_0x2f8d3b[_0x9857('0x10')];channels[_0x2f8d3b[_0x9857('0x28')]][_0x9857('0x2b')]=_0x2f8d3b[_0x9857('0x9')];if(_[_0x9857('0x24')](channels[_0x2f8d3b[_0x9857('0x28')]]['answertime'])){channels[_0x2f8d3b[_0x9857('0x28')]]['answertime']=utils['now']();}channels[_0x2f8d3b[_0x9857('0x28')]][_0x9857('0x2c')]=dispositions[_['toNumber'](_0x2f8d3b[_0x9857('0x25')])]||_0x9857('0x2d');}}catch(_0x19fe21){utils[_0x9857('0x21')](util[_0x9857('0x19')](_0x9857('0x2e'),_0x2f8d3b[_0x9857('0x6')]),_0x19fe21);}};exports[_0x9857('0x2f')]=function(_0x567905){try{if(!_['isNil'](channels[_0x567905[_0x9857('0x6')]])){utils['debug'](util[_0x9857('0x19')](_0x9857('0x30'),_0x567905[_0x9857('0x6')]),_0x567905);if(_['isNil'](channels[_0x567905[_0x9857('0x6')]][_0x9857('0x31')])){channels[_0x567905[_0x9857('0x6')]]['callerid']=_0x567905['calleridname']+'\x20<'+_0x567905[_0x9857('0xd')]+'>';}utils['info'](util[_0x9857('0x19')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x567905[_0x9857('0x6')],channels[_0x567905[_0x9857('0x6')]]['callerid'],_0x567905['cause-txt']));channels[_0x567905['uniqueid']][_0x9857('0x32')]=utils['now']();channels[_0x567905[_0x9857('0x6')]]['duration']=utils['diffTime'](channels[_0x567905[_0x9857('0x6')]][_0x9857('0x32')],channels[_0x567905[_0x9857('0x6')]]['starttime']);channels[_0x567905[_0x9857('0x6')]][_0x9857('0x33')]=channels[_0x567905[_0x9857('0x6')]][_0x9857('0x34')]?utils[_0x9857('0x35')](channels[_0x567905[_0x9857('0x6')]][_0x9857('0x32')],channels[_0x567905[_0x9857('0x6')]][_0x9857('0x34')]):0x0;writeDB(channels[_0x567905[_0x9857('0x6')]]);}}catch(_0x3332){utils[_0x9857('0x21')](util[_0x9857('0x19')](_0x9857('0x30'),_0x567905[_0x9857('0x6')]),_0x3332);}};exports[_0x9857('0x36')]=function(_0x10e1b9){try{if(!_['isNil'](channels[_0x10e1b9[_0x9857('0x37')]])){utils[_0x9857('0x18')](util[_0x9857('0x19')](_0x9857('0x38'),_0x10e1b9[_0x9857('0x39')]),_0x10e1b9);if(channels[_0x10e1b9['localtwolinkedid']][_0x9857('0x9')]==_0x10e1b9[_0x9857('0x3a')]){utils[_0x9857('0x1b')](util['format'](_0x9857('0x3b'),_0x10e1b9[_0x9857('0x39')],_0x10e1b9[_0x9857('0x37')],_0x10e1b9[_0x9857('0x3c')]));channels[_0x10e1b9[_0x9857('0x37')]][_0x9857('0x2b')]=_0x10e1b9['secondtransfererchannel'];channels[_0x10e1b9['localtwolinkedid']][_0x9857('0x3d')]='_attended';}else if(channels[_0x10e1b9['localtwolinkedid']][_0x9857('0x9')]=_0x10e1b9[_0x9857('0x3e')]){utils[_0x9857('0x1b')](util['format'](_0x9857('0x3b'),_0x10e1b9['origtransfereruniqueid'],_0x10e1b9[_0x9857('0x37')],_0x10e1b9['origtransfererchannel']));channels[_0x10e1b9[_0x9857('0x37')]][_0x9857('0x2b')]=_0x10e1b9[_0x9857('0x3f')];channels[_0x10e1b9[_0x9857('0x37')]]['userfield']=_0x9857('0x40');}}}catch(_0x582294){utils[_0x9857('0x21')](util[_0x9857('0x19')]('[%s][calls][attendedtransfer]',_0x10e1b9['origtransfereruniqueid']),_0x582294);}};exports[_0x9857('0x41')]=function(_0x4131d1){try{if(!_[_0x9857('0x24')](channels[_0x4131d1[_0x9857('0x6')]])){utils['debug'](util[_0x9857('0x19')](_0x9857('0x42'),_0x4131d1[_0x9857('0x6')]),_0x4131d1);channels[_0x4131d1[_0x9857('0x6')]][_0x9857('0x43')]=utils[_0x9857('0x1f')]();utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x44'),_0x4131d1[_0x9857('0x6')],channels[_0x4131d1[_0x9857('0x6')]][_0x9857('0x43')]));}}catch(_0x5aa592){utils[_0x9857('0x21')](util['format'](_0x9857('0x42'),_0x4131d1[_0x9857('0x6')]),_0x5aa592);}};exports['musiconholdstop']=function(_0x22dd5a){try{if(!_[_0x9857('0x24')](channels[_0x22dd5a[_0x9857('0x6')]])){utils[_0x9857('0x18')](util['format'](_0x9857('0x45'),_0x22dd5a[_0x9857('0x6')]),_0x22dd5a);if(!_[_0x9857('0x24')](channels[_0x22dd5a['uniqueid']][_0x9857('0x43')])){channels[_0x22dd5a['uniqueid']][_0x9857('0x46')]+=utils['diffTime'](utils['now'](),channels[_0x22dd5a[_0x9857('0x6')]][_0x9857('0x43')]);utils['info'](util['format'](_0x9857('0x47'),_0x22dd5a['uniqueid'],channels[_0x22dd5a[_0x9857('0x6')]][_0x9857('0x46')]));delete channels[_0x22dd5a[_0x9857('0x6')]][_0x9857('0x43')];}}}catch(_0x503a18){utils[_0x9857('0x21')](util[_0x9857('0x19')](_0x9857('0x45'),_0x22dd5a[_0x9857('0x6')]),_0x503a18);}};exports[_0x9857('0x48')]=function(_0x1da744){try{if(!_[_0x9857('0x24')](channels[_0x1da744['uniqueid']])){utils[_0x9857('0x18')](util[_0x9857('0x19')](_0x9857('0x49'),_0x1da744[_0x9857('0x6')]),_0x1da744);if(!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')][_0x9857('0x4b')])){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x4c'),_0x1da744[_0x9857('0x6')],_0x1da744[_0x9857('0x4d')]));channels[_0x1da744[_0x9857('0x6')]]['source']=_0x1da744['value'];}if(!_['isNil'](_0x1da744[_0x9857('0x4a')]['xmd-phone'])){utils[_0x9857('0x1b')](util[_0x9857('0x19')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1da744[_0x9857('0x6')],_0x1da744[_0x9857('0x4d')]));channels[_0x1da744[_0x9857('0x6')]][_0x9857('0x4e')]=_0x1da744['value'];channels[_0x1da744[_0x9857('0x6')]][_0x9857('0x31')]='\x22'+_0x1da744[_0x9857('0x4d')]+'\x22\x20<'+_0x1da744[_0x9857('0x4d')]+'>';}if(!_['isNil'](_0x1da744['variable'][_0x9857('0x4f')])||!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')]['xmd-callerid'])){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x50'),_0x1da744[_0x9857('0x6')],!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')][_0x9857('0x4f')])?'xmd-callerid-preview':_0x9857('0x51'),_0x1da744[_0x9857('0x4d')]));channels[_0x1da744['uniqueid']][_0x9857('0x31')]=_0x1da744[_0x9857('0x4d')];}if(!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')][_0x9857('0x52')])||!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')][_0x9857('0x53')])){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x50'),_0x1da744[_0x9857('0x6')],!_['isNil'](_0x1da744[_0x9857('0x4a')][_0x9857('0x52')])?_0x9857('0x52'):_0x9857('0x53'),_0x1da744[_0x9857('0x4d')]));channels[_0x1da744[_0x9857('0x6')]][_0x9857('0x54')]='Queue';channels[_0x1da744['uniqueid']][_0x9857('0x55')]=_0x1da744[_0x9857('0x4d')];channels[_0x1da744[_0x9857('0x6')]][_0x9857('0xa')]=!![];}if(!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')][_0x9857('0x56')])){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x57'),_0x1da744[_0x9857('0x6')],_0x1da744[_0x9857('0x4d')]));channels[_0x1da744[_0x9857('0x6')]]['ContactId']=_0x1da744[_0x9857('0x4d')];}if(!_['isNil'](_0x1da744['variable']['xmd-cdrtype'])){utils['info'](util[_0x9857('0x19')](_0x9857('0x58'),_0x1da744[_0x9857('0x6')],_0x1da744['value']));channels[_0x1da744[_0x9857('0x6')]][_0x9857('0x59')]=_0x1da744[_0x9857('0x4d')];}if(!_[_0x9857('0x24')](_0x1da744[_0x9857('0x4a')]['outboundrouteid'])){utils[_0x9857('0x1b')](util[_0x9857('0x19')](_0x9857('0x5a'),_0x1da744[_0x9857('0x6')],_0x1da744[_0x9857('0x4d')]));channels[_0x1da744[_0x9857('0x6')]][_0x9857('0x5b')]=_0x1da744[_0x9857('0x4d')];}if(!_[_0x9857('0x24')](_0x1da744['variable']['sipcallid'])){utils['info'](util[_0x9857('0x19')](_0x9857('0x5c'),_0x1da744[_0x9857('0x6')],_0x1da744['value']));channels[_0x1da744[_0x9857('0x6')]][_0x9857('0x5d')]=_0x1da744['value'];}}}catch(_0x33abe7){utils[_0x9857('0x21')](util[_0x9857('0x19')](_0x9857('0x49'),_0x1da744['uniqueid']),_0x33abe7);}};exports['newexten']=function(_0x27ecc0){try{if(!_[_0x9857('0x24')](channels[_0x27ecc0[_0x9857('0x6')]])){utils[_0x9857('0x18')](util[_0x9857('0x19')](_0x9857('0x5e'),_0x27ecc0[_0x9857('0x6')]),_0x27ecc0);utils[_0x9857('0x1b')](util[_0x9857('0x19')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x27ecc0[_0x9857('0x6')],_0x27ecc0[_0x9857('0x5f')],_0x27ecc0['appdata']));if(_0x27ecc0['application'][_0x9857('0x60')]()==_0x9857('0x61')&&_[_0x9857('0x62')](_0x27ecc0['appdata'][_0x9857('0x60')](),_0x9857('0x63'))){var _0x44a580=_0x27ecc0['appdata'][_0x9857('0x64')]('=');var _0x5e0995=_0x44a580[0x0][_0x9857('0x65')](_0x44a580[0x0]['lastIndexOf']('(')+0x1,_0x44a580[0x0][_0x9857('0x66')](')'));var _0x1065ac=_0x44a580[0x1];channels[_0x27ecc0['uniqueid']][_0x5e0995]=_0x1065ac;}if(!_[_0x9857('0x67')]([_0x9857('0x2f'),_0x9857('0x68'),_0x9857('0x69'),_0x9857('0x61'),_0x9857('0x6a')],_0x27ecc0['application'][_0x9857('0x60')]())){channels[_0x27ecc0[_0x9857('0x6')]]['lastapplication']=_0x27ecc0[_0x9857('0x5f')];channels[_0x27ecc0['uniqueid']][_0x9857('0x55')]=_0x27ecc0['appdata'];}}}catch(_0x142765){utils[_0x9857('0x21')](util[_0x9857('0x19')](_0x9857('0x5e'),_0x27ecc0[_0x9857('0x6')]),_0x142765);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b72a313..1de1ebd 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 _0x17f1=['connect','[core]\x20connected','shutdown','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x477f54,_0xf8d659){var _0x4ce428=function(_0x1c1a55){while(--_0x1c1a55){_0x477f54['push'](_0x477f54['shift']());}};_0x4ce428(++_0xf8d659);}(_0x17f1,0x1d4));var _0x117f=function(_0x29f4de,_0x429e32){_0x29f4de=_0x29f4de-0x0;var _0x21c048=_0x17f1[_0x29f4de];return _0x21c048;};'use strict';var utils=require('./utils');exports[_0x117f('0x0')]=function(){utils['info'](_0x117f('0x1'));};exports[_0x117f('0x2')]=function(){utils[_0x117f('0x3')](_0x117f('0x4'));};exports['fullybooted']=function(){utils['info'](_0x117f('0x5'));};exports[_0x117f('0x6')]=function(_0x41d0e8){utils[_0x117f('0x6')](_0x117f('0x7'),_0x41d0e8);};exports[_0x117f('0x8')]=function(){utils[_0x117f('0x3')]('[core]\x20close');};exports['managerevent']=function(_0x171a24){}; \ No newline at end of file +var _0xb6b5=['info','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','connect','[core]\x20connected','shutdown','fullybooted'];(function(_0x21713a,_0x36cc10){var _0xe3b74b=function(_0x251c81){while(--_0x251c81){_0x21713a['push'](_0x21713a['shift']());}};_0xe3b74b(++_0x36cc10);}(_0xb6b5,0xba));var _0x5b6b=function(_0x2903b7,_0x452740){_0x2903b7=_0x2903b7-0x0;var _0x485053=_0xb6b5[_0x2903b7];return _0x485053;};'use strict';var utils=require('./utils');exports[_0x5b6b('0x0')]=function(){utils['info'](_0x5b6b('0x1'));};exports[_0x5b6b('0x2')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x5b6b('0x3')]=function(){utils[_0x5b6b('0x4')](_0x5b6b('0x5'));};exports['error']=function(_0x59f40f){utils[_0x5b6b('0x6')](_0x5b6b('0x7'),_0x59f40f);};exports['close']=function(){utils['info'](_0x5b6b('0x8'));};exports[_0x5b6b('0x9')]=function(_0x54f690){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index cb5fbb6..4190303 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 _0xaeb7=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','now','complete','duration','endtime','billableseconds','diffTime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','debug','application','appdata','set','startsWith','cdr(routeid)','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','starttime','[%s][dials][dialend]','dialstatus','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]'];(function(_0x28de36,_0x1ba1da){var _0x22e775=function(_0x4417eb){while(--_0x4417eb){_0x28de36['push'](_0x28de36['shift']());}};_0x22e775(++_0x1ba1da);}(_0xaeb7,0x19e));var _0x7aeb=function(_0x2e5e38,_0x462d44){_0x2e5e38=_0x2e5e38-0x0;var _0xd24670=_0xaeb7[_0x2e5e38];return _0xd24670;};'use strict';var _=require(_0x7aeb('0x0'));var util=require(_0x7aeb('0x1'));var utils=require(_0x7aeb('0x2'));var dials={};function writeDB(_0x2e0d64){utils[_0x7aeb('0x3')](util[_0x7aeb('0x4')](_0x7aeb('0x5'),_0x2e0d64[_0x7aeb('0x6')],_0x2e0d64[_0x7aeb('0x7')],_0x2e0d64[_0x7aeb('0x8')],_0x2e0d64[_0x7aeb('0x9')],_0x2e0d64[_0x7aeb('0xa')],_0x2e0d64['dialstatus']));utils['request']('CreateVoiceDialReport',_0x2e0d64);delete dials[_0x2e0d64['uniqueid']];}exports['newexten']=function(_0x4a024b){try{utils[_0x7aeb('0xb')](util[_0x7aeb('0x4')]('[%s][dials][newexten]',_0x4a024b[_0x7aeb('0x6')]),_0x4a024b);utils[_0x7aeb('0x3')](util[_0x7aeb('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4a024b[_0x7aeb('0x6')],_0x4a024b[_0x7aeb('0xc')],_0x4a024b[_0x7aeb('0xd')]));if(_0x4a024b[_0x7aeb('0xc')]['toLowerCase']()==_0x7aeb('0xe')&&_[_0x7aeb('0xf')](_0x4a024b[_0x7aeb('0xd')]['toLowerCase'](),_0x7aeb('0x10'))){var _0x3890e8=_0x4a024b[_0x7aeb('0xd')]['split']('=');dials[_0x4a024b[_0x7aeb('0x6')]]={'routeId':_0x3890e8[0x1]};}}catch(_0x46e98c){utils[_0x7aeb('0x11')](util[_0x7aeb('0x4')](_0x7aeb('0x12'),_0x4a024b[_0x7aeb('0x6')]),_0x46e98c);}};exports[_0x7aeb('0x13')]=function(_0xa902b5){try{utils[_0x7aeb('0xb')](util[_0x7aeb('0x4')](_0x7aeb('0x14'),_0xa902b5['uniqueid']),_0xa902b5);if(!_[_0x7aeb('0x15')](_0xa902b5[_0x7aeb('0x16')][_0x7aeb('0x17')])){utils[_0x7aeb('0x3')](util[_0x7aeb('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0xa902b5[_0x7aeb('0x6')],_0xa902b5[_0x7aeb('0x18')]));dials[_0xa902b5[_0x7aeb('0x6')]]={'routeId':_0xa902b5['value']};}}catch(_0x3d2885){utils['error'](util[_0x7aeb('0x4')](_0x7aeb('0x14'),_0xa902b5[_0x7aeb('0x6')]),_0x3d2885);}};exports[_0x7aeb('0x19')]=function(_0x1ca245){try{if(!_['isNil'](dials[_0x1ca245[_0x7aeb('0x6')]])){utils[_0x7aeb('0xb')](util[_0x7aeb('0x4')](_0x7aeb('0x1a'),_0x1ca245[_0x7aeb('0x6')]),_0x1ca245);dials[_0x1ca245[_0x7aeb('0x6')]]=_[_0x7aeb('0x1b')](dials[_0x1ca245[_0x7aeb('0x6')]],_0x1ca245);dials[_0x1ca245[_0x7aeb('0x6')]]['starttime']=utils['now']();dials[_0x1ca245['uniqueid']][_0x7aeb('0x1c')]=_0x7aeb('0x1d');utils[_0x7aeb('0x3')](util[_0x7aeb('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1ca245[_0x7aeb('0x6')],dials[_0x1ca245[_0x7aeb('0x6')]][_0x7aeb('0x1e')]));}}catch(_0x53f2cd){utils[_0x7aeb('0x11')](util[_0x7aeb('0x4')](_0x7aeb('0x1a'),_0x1ca245[_0x7aeb('0x6')]),_0x53f2cd);}};exports['dialend']=function(_0x27cbfc){try{if(!_[_0x7aeb('0x15')](dials[_0x27cbfc['uniqueid']])){utils[_0x7aeb('0xb')](util['format'](_0x7aeb('0x1f'),_0x27cbfc[_0x7aeb('0x6')]),_0x27cbfc);dials[_0x27cbfc[_0x7aeb('0x6')]][_0x7aeb('0x20')]=_0x27cbfc[_0x7aeb('0x20')];if(_0x27cbfc['dialstatus']=='ANSWER'){dials[_0x27cbfc['uniqueid']]=_[_0x7aeb('0x1b')](dials[_0x27cbfc[_0x7aeb('0x6')]],_0x27cbfc);dials[_0x27cbfc[_0x7aeb('0x6')]]['answertime']=utils['now']();dials[_0x27cbfc['uniqueid']][_0x7aeb('0x1c')]='connect';utils[_0x7aeb('0x3')](util[_0x7aeb('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x27cbfc[_0x7aeb('0x6')],_0x27cbfc[_0x7aeb('0x20')],dials[_0x27cbfc[_0x7aeb('0x6')]][_0x7aeb('0x21')]));}else{utils[_0x7aeb('0x3')](util['format'](_0x7aeb('0x22'),_0x27cbfc[_0x7aeb('0x6')],_0x27cbfc[_0x7aeb('0x20')]));}}}catch(_0x2eb89f){utils['error'](util['format']('[%s][dials][dialend]',_0x27cbfc[_0x7aeb('0x6')]),_0x2eb89f);}};exports['hangup']=function(_0x2b1739){try{if(!_[_0x7aeb('0x15')](dials[_0x2b1739[_0x7aeb('0x6')]])){utils['debug'](util['format'](_0x7aeb('0x23'),_0x2b1739[_0x7aeb('0x6')]),_0x2b1739);utils[_0x7aeb('0x3')](util[_0x7aeb('0x4')](_0x7aeb('0x24'),_0x2b1739[_0x7aeb('0x6')],_0x2b1739[_0x7aeb('0x9')],_0x2b1739[_0x7aeb('0x25')],_0x2b1739[_0x7aeb('0x26')]));dials[_0x2b1739['uniqueid']]=_[_0x7aeb('0x1b')](dials[_0x2b1739['uniqueid']],{'endtime':utils[_0x7aeb('0x27')](),'lastevent':_0x7aeb('0x28')});dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x29')]=utils['diffTime'](dials[_0x2b1739['uniqueid']]['endtime'],dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x1e')]);dials[_0x2b1739[_0x7aeb('0x6')]]['holdtime']=utils['diffTime'](dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x21')]||dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x2a')],dials[_0x2b1739['uniqueid']][_0x7aeb('0x1e')]);dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x2b')]=dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x21')]?utils[_0x7aeb('0x2c')](dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x2a')],dials[_0x2b1739[_0x7aeb('0x6')]][_0x7aeb('0x21')]):0x0;writeDB(dials[_0x2b1739[_0x7aeb('0x6')]]);}}catch(_0x3ef06c){utils[_0x7aeb('0x11')](util['format'](_0x7aeb('0x23'),_0x2b1739[_0x7aeb('0x6')]),_0x3ef06c);}}; \ No newline at end of file +var _0xda99=['now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialend]','ANSWER','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','isNil','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','varset','[%s][dials][varset]','variable','value','error','dialbegin','[%s][dials][dialbegin]','assign'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xda99,0xab));var _0x9da9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9da9('0x0'));var util=require(_0x9da9('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x2ba864){utils['info'](util[_0x9da9('0x2')](_0x9da9('0x3'),_0x2ba864[_0x9da9('0x4')],_0x2ba864[_0x9da9('0x5')],_0x2ba864[_0x9da9('0x6')],_0x2ba864[_0x9da9('0x7')],_0x2ba864['connectedlinenum'],_0x2ba864[_0x9da9('0x8')]));utils['request'](_0x9da9('0x9'),_0x2ba864);delete dials[_0x2ba864[_0x9da9('0x4')]];}exports['newexten']=function(_0x2e6d8b){try{utils[_0x9da9('0xa')](util['format'](_0x9da9('0xb'),_0x2e6d8b[_0x9da9('0x4')]),_0x2e6d8b);utils[_0x9da9('0xc')](util[_0x9da9('0x2')](_0x9da9('0xd'),_0x2e6d8b[_0x9da9('0x4')],_0x2e6d8b[_0x9da9('0xe')],_0x2e6d8b['appdata']));if(_0x2e6d8b['application'][_0x9da9('0xf')]()==_0x9da9('0x10')&&_[_0x9da9('0x11')](_0x2e6d8b[_0x9da9('0x12')]['toLowerCase'](),_0x9da9('0x13'))){var _0x10ba4b=_0x2e6d8b[_0x9da9('0x12')][_0x9da9('0x14')]('=');dials[_0x2e6d8b['uniqueid']]={'routeId':_0x10ba4b[0x1]};}}catch(_0x181e78){utils['error'](util[_0x9da9('0x2')](_0x9da9('0xb'),_0x2e6d8b['uniqueid']),_0x181e78);}};exports[_0x9da9('0x15')]=function(_0x398466){try{utils[_0x9da9('0xa')](util[_0x9da9('0x2')](_0x9da9('0x16'),_0x398466['uniqueid']),_0x398466);if(!_['isNil'](_0x398466[_0x9da9('0x17')]['outboundrouteid'])){utils['info'](util[_0x9da9('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x398466[_0x9da9('0x4')],_0x398466[_0x9da9('0x18')]));dials[_0x398466[_0x9da9('0x4')]]={'routeId':_0x398466[_0x9da9('0x18')]};}}catch(_0x27d17d){utils[_0x9da9('0x19')](util[_0x9da9('0x2')](_0x9da9('0x16'),_0x398466[_0x9da9('0x4')]),_0x27d17d);}};exports[_0x9da9('0x1a')]=function(_0x501490){try{if(!_['isNil'](dials[_0x501490[_0x9da9('0x4')]])){utils[_0x9da9('0xa')](util[_0x9da9('0x2')](_0x9da9('0x1b'),_0x501490['uniqueid']),_0x501490);dials[_0x501490[_0x9da9('0x4')]]=_[_0x9da9('0x1c')](dials[_0x501490[_0x9da9('0x4')]],_0x501490);dials[_0x501490[_0x9da9('0x4')]]['starttime']=utils[_0x9da9('0x1d')]();dials[_0x501490[_0x9da9('0x4')]]['lastevent']=_0x9da9('0x1e');utils['info'](util[_0x9da9('0x2')](_0x9da9('0x1f'),_0x501490['uniqueid'],dials[_0x501490[_0x9da9('0x4')]][_0x9da9('0x20')]));}}catch(_0x163202){utils[_0x9da9('0x19')](util[_0x9da9('0x2')](_0x9da9('0x1b'),_0x501490[_0x9da9('0x4')]),_0x163202);}};exports['dialend']=function(_0x30adec){try{if(!_['isNil'](dials[_0x30adec[_0x9da9('0x4')]])){utils[_0x9da9('0xa')](util[_0x9da9('0x2')](_0x9da9('0x21'),_0x30adec[_0x9da9('0x4')]),_0x30adec);dials[_0x30adec[_0x9da9('0x4')]][_0x9da9('0x8')]=_0x30adec[_0x9da9('0x8')];if(_0x30adec['dialstatus']==_0x9da9('0x22')){dials[_0x30adec[_0x9da9('0x4')]]=_['assign'](dials[_0x30adec['uniqueid']],_0x30adec);dials[_0x30adec[_0x9da9('0x4')]]['answertime']=utils[_0x9da9('0x1d')]();dials[_0x30adec[_0x9da9('0x4')]][_0x9da9('0x23')]=_0x9da9('0x24');utils[_0x9da9('0xc')](util[_0x9da9('0x2')](_0x9da9('0x25'),_0x30adec[_0x9da9('0x4')],_0x30adec['dialstatus'],dials[_0x30adec[_0x9da9('0x4')]][_0x9da9('0x26')]));}else{utils[_0x9da9('0xc')](util[_0x9da9('0x2')](_0x9da9('0x27'),_0x30adec['uniqueid'],_0x30adec[_0x9da9('0x8')]));}}}catch(_0x3f5998){utils['error'](util['format']('[%s][dials][dialend]',_0x30adec[_0x9da9('0x4')]),_0x3f5998);}};exports[_0x9da9('0x28')]=function(_0x59aa10){try{if(!_[_0x9da9('0x29')](dials[_0x59aa10['uniqueid']])){utils[_0x9da9('0xa')](util[_0x9da9('0x2')](_0x9da9('0x2a'),_0x59aa10[_0x9da9('0x4')]),_0x59aa10);utils[_0x9da9('0xc')](util['format'](_0x9da9('0x2b'),_0x59aa10[_0x9da9('0x4')],_0x59aa10[_0x9da9('0x7')],_0x59aa10['calleridname'],_0x59aa10[_0x9da9('0x2c')]));dials[_0x59aa10[_0x9da9('0x4')]]=_[_0x9da9('0x1c')](dials[_0x59aa10[_0x9da9('0x4')]],{'endtime':utils[_0x9da9('0x1d')](),'lastevent':_0x9da9('0x2d')});dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x2e')]=utils[_0x9da9('0x2f')](dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x30')],dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x20')]);dials[_0x59aa10[_0x9da9('0x4')]]['holdtime']=utils['diffTime'](dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x26')]||dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x30')],dials[_0x59aa10[_0x9da9('0x4')]]['starttime']);dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x31')]=dials[_0x59aa10[_0x9da9('0x4')]][_0x9da9('0x26')]?utils[_0x9da9('0x2f')](dials[_0x59aa10[_0x9da9('0x4')]]['endtime'],dials[_0x59aa10[_0x9da9('0x4')]]['answertime']):0x0;writeDB(dials[_0x59aa10[_0x9da9('0x4')]]);}}catch(_0x359894){utils[_0x9da9('0x19')](util[_0x9da9('0x2')]('[%s][dials][hangup]',_0x59aa10[_0x9da9('0x4')]),_0x359894);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 25b1d8f..7888130 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 _0x3427=['blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialend','[%s][index][dialend]','./utils','util','asterisk','port','username','password','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','[%s][index][devicestatechange]','format','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]'];(function(_0x1db473,_0x475c09){var _0x52dd34=function(_0x4690ca){while(--_0x4690ca){_0x1db473['push'](_0x1db473['shift']());}};_0x52dd34(++_0x475c09);}(_0x3427,0x1cd));var _0x7342=function(_0x19d7de,_0x38494b){_0x19d7de=_0x19d7de-0x0;var _0xf60ddc=_0x3427[_0x19d7de];return _0xf60ddc;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x7342('0x0'));var util=require(_0x7342('0x1'));var ami=new AsteriskManager(config[_0x7342('0x2')][_0x7342('0x3')],config[_0x7342('0x2')]['ip'],config[_0x7342('0x2')][_0x7342('0x4')],config[_0x7342('0x2')][_0x7342('0x5')],!![]);ami['keepConnected']();if(config[_0x7342('0x6')]&&config['xdr'][_0x7342('0x7')]){utils[_0x7342('0x8')](_0x7342('0x9'));}else{var agents=require(_0x7342('0xa'));var calls=require(_0x7342('0xb'));var queues=require(_0x7342('0xc'));var recordings=require(_0x7342('0xd'));var members=require('./members.controller');var dials=require(_0x7342('0xe'));var transfers=require(_0x7342('0xf'));var core=require(_0x7342('0x10'));ami['on'](_0x7342('0x11'),core[_0x7342('0x11')]);ami['on'](_0x7342('0x12'),core[_0x7342('0x12')]);ami['on'](_0x7342('0x13'),core['fullybooted']);ami['on'](_0x7342('0x14'),core[_0x7342('0x14')]);ami['on'](_0x7342('0x15'),core[_0x7342('0x15')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x7342('0x16'),function(_0xb4ab6d){try{utils['debug'](util['format'](_0x7342('0x17'),_0xb4ab6d['device']),_0xb4ab6d);members[_0x7342('0x16')](_0xb4ab6d);}catch(_0x4bf2f5){utils[_0x7342('0x14')](util[_0x7342('0x18')](_0x7342('0x17'),_0xb4ab6d[_0x7342('0x19')]),_0x4bf2f5);}});ami['on'](_0x7342('0x1a'),function(_0xd6e482){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x1c'),_0xd6e482[_0x7342('0x1d')]),_0xd6e482);agents[_0x7342('0x1a')](_0xd6e482);}catch(_0x2b6f92){utils[_0x7342('0x14')](util['format']('[%s][index][agentcalled]',_0xd6e482['uniqueid']),_0x2b6f92);}});ami['on'](_0x7342('0x1e'),function(_0x3b41e6){try{utils[_0x7342('0x1b')](util['format']('[%s][index][agentringnoanswer]',_0x3b41e6[_0x7342('0x1d')]),_0x3b41e6);agents[_0x7342('0x1e')](_0x3b41e6);}catch(_0x472168){utils[_0x7342('0x14')](util['format'](_0x7342('0x1f'),_0x3b41e6[_0x7342('0x1d')]),_0x472168);}});ami['on']('agentconnect',function(_0x2e8fbd){try{utils['debug'](util[_0x7342('0x18')](_0x7342('0x20'),_0x2e8fbd[_0x7342('0x1d')]),_0x2e8fbd);agents[_0x7342('0x21')](_0x2e8fbd);queues[_0x7342('0x21')](_0x2e8fbd);}catch(_0x5824ae){utils[_0x7342('0x14')](util[_0x7342('0x18')](_0x7342('0x20'),_0x2e8fbd[_0x7342('0x1d')]),_0x5824ae);}});ami['on'](_0x7342('0x22'),function(_0x3e536d){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x23'),_0x3e536d[_0x7342('0x1d')]),_0x3e536d);agents['agentcomplete'](_0x3e536d);queues[_0x7342('0x22')](_0x3e536d);members[_0x7342('0x22')](_0x3e536d);}catch(_0x43a314){utils[_0x7342('0x14')](util['format'](_0x7342('0x23'),_0x3e536d[_0x7342('0x1d')]),_0x43a314);}});ami['on']('queuecallerabandon',function(_0x5ac6c9){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x24'),_0x5ac6c9[_0x7342('0x1d')]),_0x5ac6c9);agents['queuecallerabandon'](_0x5ac6c9);queues[_0x7342('0x25')](_0x5ac6c9);}catch(_0x6537c8){utils[_0x7342('0x14')](util[_0x7342('0x18')]('[%s][index][queuecallerabandon]',_0x5ac6c9[_0x7342('0x1d')]),_0x6537c8);}});ami['on']('queuecallerjoin',function(_0x35485a){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x26'),_0x35485a[_0x7342('0x1d')]),_0x35485a);queues[_0x7342('0x27')](_0x35485a);recordings['queuecallerjoin'](_0x35485a);}catch(_0x4ca0e2){utils[_0x7342('0x14')](util[_0x7342('0x18')](_0x7342('0x26'),_0x35485a['uniqueid']),_0x4ca0e2);}});ami['on'](_0x7342('0x28'),function(_0x5b8cb8){try{utils[_0x7342('0x1b')](util['format'](_0x7342('0x29'),_0x5b8cb8['uniqueid']),_0x5b8cb8);queues[_0x7342('0x28')](_0x5b8cb8);}catch(_0x22d4a3){utils['error'](util['format'](_0x7342('0x29'),_0x5b8cb8[_0x7342('0x1d')]),_0x22d4a3);}});ami['on'](_0x7342('0x2a'),function(_0x10b274){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')]('[%s][index][musiconholdstart]',_0x10b274['uniqueid']),_0x10b274);queues[_0x7342('0x2a')](_0x10b274);calls[_0x7342('0x2a')](_0x10b274);}catch(_0x1e1636){utils[_0x7342('0x14')](util[_0x7342('0x18')]('[%s][index][musiconholdstart]',_0x10b274['uniqueid']),_0x1e1636);}});ami['on']('musiconholdstop',function(_0x5ccecb){try{utils[_0x7342('0x1b')](util['format'](_0x7342('0x2b'),_0x5ccecb['uniqueid']),_0x5ccecb);queues[_0x7342('0x2c')](_0x5ccecb);calls[_0x7342('0x2c')](_0x5ccecb);}catch(_0x518a0a){utils['error'](util['format'](_0x7342('0x2b'),_0x5ccecb['uniqueid']),_0x518a0a);}});ami['on']('newstate',function(_0x479510){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x2d'),_0x479510[_0x7342('0x1d')]),_0x479510);calls[_0x7342('0x2e')](_0x479510);recordings[_0x7342('0x2e')](_0x479510);}catch(_0x881b8e){utils[_0x7342('0x14')](util['format'](_0x7342('0x2d'),_0x479510[_0x7342('0x1d')]),_0x881b8e);}});ami['on'](_0x7342('0x2f'),function(_0x286875){try{utils['debug'](util[_0x7342('0x18')](_0x7342('0x30'),_0x286875[_0x7342('0x1d')]),_0x286875);calls[_0x7342('0x2f')](_0x286875);recordings['hangup'](_0x286875);dials[_0x7342('0x2f')](_0x286875);agents[_0x7342('0x2f')](_0x286875);queues[_0x7342('0x2f')](_0x286875);}catch(_0x51339d){utils[_0x7342('0x14')](util[_0x7342('0x18')](_0x7342('0x30'),_0x286875[_0x7342('0x1d')]),_0x51339d);}});ami['on'](_0x7342('0x31'),function(_0x1d3785){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x32'),_0x1d3785[_0x7342('0x1d')]),_0x1d3785);members[_0x7342('0x31')](_0x1d3785);}catch(_0x104080){utils[_0x7342('0x14')](util[_0x7342('0x18')](_0x7342('0x32'),_0x1d3785['uniqueid']),_0x104080);}});ami['on'](_0x7342('0x33'),function(_0x87a044){try{utils[_0x7342('0x1b')](util['format'](_0x7342('0x34'),_0x87a044[_0x7342('0x1d')]),_0x87a044);queues[_0x7342('0x33')](_0x87a044);agents[_0x7342('0x33')](_0x87a044);transfers[_0x7342('0x33')](_0x87a044);recordings[_0x7342('0x33')](_0x87a044);}catch(_0x240879){utils[_0x7342('0x14')](util['format'](_0x7342('0x34'),_0x87a044[_0x7342('0x1d')]),_0x240879);}});ami['on']('attendedtransfer',function(_0x35de90){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x35'),_0x35de90[_0x7342('0x36')]),_0x35de90);queues[_0x7342('0x37')](_0x35de90);transfers[_0x7342('0x37')](_0x35de90);agents[_0x7342('0x37')](_0x35de90);calls[_0x7342('0x37')](_0x35de90);}catch(_0x2652cd){utils[_0x7342('0x14')](util[_0x7342('0x18')](_0x7342('0x35'),_0x35de90[_0x7342('0x36')]),_0x2652cd);}});ami['on'](_0x7342('0x38'),function(_0x1b2e97){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x39'),_0x1b2e97[_0x7342('0x1d')]),_0x1b2e97);queues[_0x7342('0x38')](_0x1b2e97);recordings[_0x7342('0x38')](_0x1b2e97);calls['varset'](_0x1b2e97);dials['varset'](_0x1b2e97);}catch(_0x2e73f3){utils['error'](util[_0x7342('0x18')](_0x7342('0x39'),_0x1b2e97['uniqueid']),_0x2e73f3);}});ami['on']('newexten',function(_0x39ba42){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x3a'),_0x39ba42[_0x7342('0x1d')]),_0x39ba42);calls[_0x7342('0x3b')](_0x39ba42);recordings[_0x7342('0x3b')](_0x39ba42);dials[_0x7342('0x3b')](_0x39ba42);}catch(_0x40c570){utils[_0x7342('0x14')](util['format'](_0x7342('0x3a'),_0x39ba42['uniqueid']),_0x40c570);}});ami['on']('newchannel',function(_0x1a5089){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x3c'),_0x1a5089[_0x7342('0x1d')]),_0x1a5089);calls['newchannel'](_0x1a5089);recordings[_0x7342('0x3d')](_0x1a5089);}catch(_0x3e943c){utils[_0x7342('0x14')](util['format'](_0x7342('0x3c'),_0x1a5089[_0x7342('0x1d')]),_0x3e943c);}});ami['on']('dialbegin',function(_0xc2d994){try{utils['debug'](util[_0x7342('0x18')]('[%s][index][dialbegin]',_0xc2d994[_0x7342('0x1d')]),_0xc2d994);dials['dialbegin'](_0xc2d994);}catch(_0xa9efa){utils['error'](util[_0x7342('0x18')]('[%s]dialbegin',_0xc2d994['uniqueid']),_0xa9efa);}});ami['on'](_0x7342('0x3e'),function(_0x1a0afe){try{utils[_0x7342('0x1b')](util[_0x7342('0x18')](_0x7342('0x3f'),_0x1a0afe[_0x7342('0x1d')]),_0x1a0afe);dials[_0x7342('0x3e')](_0x1a0afe);}catch(_0x3dc325){utils[_0x7342('0x14')](util['format'](_0x7342('0x3f'),_0x1a0afe['uniqueid']),_0x3dc325);}});} \ No newline at end of file +var _0x32df=['agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','keepConnected','xdr','disabled','info','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]'];(function(_0x47c1a8,_0x3ac67e){var _0x516fc2=function(_0x54c4d3){while(--_0x54c4d3){_0x47c1a8['push'](_0x47c1a8['shift']());}};_0x516fc2(++_0x3ac67e);}(_0x32df,0x1ae));var _0xf32d=function(_0x20a2e7,_0x36862b){_0x20a2e7=_0x20a2e7-0x0;var _0x11abda=_0x32df[_0x20a2e7];return _0x11abda;};var AsteriskManager=require(_0xf32d('0x0'));var config=require(_0xf32d('0x1'));var utils=require(_0xf32d('0x2'));var util=require(_0xf32d('0x3'));var ami=new AsteriskManager(config[_0xf32d('0x4')][_0xf32d('0x5')],config[_0xf32d('0x4')]['ip'],config[_0xf32d('0x4')]['username'],config[_0xf32d('0x4')][_0xf32d('0x6')],!![]);ami[_0xf32d('0x7')]();if(config[_0xf32d('0x8')]&&config[_0xf32d('0x8')][_0xf32d('0x9')]){utils[_0xf32d('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0xf32d('0xb'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xf32d('0xc'));var members=require(_0xf32d('0xd'));var dials=require(_0xf32d('0xe'));var transfers=require(_0xf32d('0xf'));var core=require(_0xf32d('0x10'));ami['on'](_0xf32d('0x11'),core[_0xf32d('0x11')]);ami['on'](_0xf32d('0x12'),core[_0xf32d('0x12')]);ami['on']('fullybooted',core[_0xf32d('0x13')]);ami['on'](_0xf32d('0x14'),core['error']);ami['on'](_0xf32d('0x15'),core[_0xf32d('0x15')]);ami['on'](_0xf32d('0x16'),core[_0xf32d('0x16')]);ami['on']('devicestatechange',function(_0x21899f){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x19'),_0x21899f[_0xf32d('0x1a')]),_0x21899f);members['devicestatechange'](_0x21899f);}catch(_0xcf7131){utils['error'](util[_0xf32d('0x18')]('[%s][index][devicestatechange]',_0x21899f[_0xf32d('0x1a')]),_0xcf7131);}});ami['on'](_0xf32d('0x1b'),function(_0x417447){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x1c'),_0x417447[_0xf32d('0x1d')]),_0x417447);agents[_0xf32d('0x1b')](_0x417447);}catch(_0xcbf0d0){utils[_0xf32d('0x14')](util[_0xf32d('0x18')]('[%s][index][agentcalled]',_0x417447[_0xf32d('0x1d')]),_0xcbf0d0);}});ami['on'](_0xf32d('0x1e'),function(_0x2c03f1){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')]('[%s][index][agentringnoanswer]',_0x2c03f1['uniqueid']),_0x2c03f1);agents[_0xf32d('0x1e')](_0x2c03f1);}catch(_0x5760b0){utils['error'](util[_0xf32d('0x18')](_0xf32d('0x1f'),_0x2c03f1[_0xf32d('0x1d')]),_0x5760b0);}});ami['on'](_0xf32d('0x20'),function(_0x4a9fa0){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')]('[%s][index][agentconnect]',_0x4a9fa0[_0xf32d('0x1d')]),_0x4a9fa0);agents[_0xf32d('0x20')](_0x4a9fa0);queues[_0xf32d('0x20')](_0x4a9fa0);}catch(_0xabeb6c){utils[_0xf32d('0x14')](util['format'](_0xf32d('0x21'),_0x4a9fa0[_0xf32d('0x1d')]),_0xabeb6c);}});ami['on']('agentcomplete',function(_0x4a1afa){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x22'),_0x4a1afa[_0xf32d('0x1d')]),_0x4a1afa);agents[_0xf32d('0x23')](_0x4a1afa);queues[_0xf32d('0x23')](_0x4a1afa);members[_0xf32d('0x23')](_0x4a1afa);}catch(_0x442bc9){utils[_0xf32d('0x14')](util[_0xf32d('0x18')](_0xf32d('0x22'),_0x4a1afa[_0xf32d('0x1d')]),_0x442bc9);}});ami['on'](_0xf32d('0x24'),function(_0x657ffa){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x25'),_0x657ffa[_0xf32d('0x1d')]),_0x657ffa);agents[_0xf32d('0x24')](_0x657ffa);queues[_0xf32d('0x24')](_0x657ffa);}catch(_0x1544ea){utils[_0xf32d('0x14')](util[_0xf32d('0x18')](_0xf32d('0x25'),_0x657ffa['uniqueid']),_0x1544ea);}});ami['on']('queuecallerjoin',function(_0x4aca0a){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x26'),_0x4aca0a[_0xf32d('0x1d')]),_0x4aca0a);queues['queuecallerjoin'](_0x4aca0a);recordings[_0xf32d('0x27')](_0x4aca0a);}catch(_0x3de275){utils[_0xf32d('0x14')](util['format'](_0xf32d('0x26'),_0x4aca0a['uniqueid']),_0x3de275);}});ami['on'](_0xf32d('0x28'),function(_0x90e9c1){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x29'),_0x90e9c1['uniqueid']),_0x90e9c1);queues[_0xf32d('0x28')](_0x90e9c1);}catch(_0x4ae9f3){utils[_0xf32d('0x14')](util['format'](_0xf32d('0x29'),_0x90e9c1['uniqueid']),_0x4ae9f3);}});ami['on'](_0xf32d('0x2a'),function(_0xcc7371){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x2b'),_0xcc7371[_0xf32d('0x1d')]),_0xcc7371);queues['musiconholdstart'](_0xcc7371);calls[_0xf32d('0x2a')](_0xcc7371);}catch(_0x3f28d5){utils[_0xf32d('0x14')](util['format'](_0xf32d('0x2b'),_0xcc7371[_0xf32d('0x1d')]),_0x3f28d5);}});ami['on']('musiconholdstop',function(_0x140129){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')]('[%s][index][musiconholdstop]',_0x140129[_0xf32d('0x1d')]),_0x140129);queues[_0xf32d('0x2c')](_0x140129);calls[_0xf32d('0x2c')](_0x140129);}catch(_0x40f26d){utils[_0xf32d('0x14')](util[_0xf32d('0x18')]('[%s][index][musiconholdstop]',_0x140129['uniqueid']),_0x40f26d);}});ami['on'](_0xf32d('0x2d'),function(_0xef487f){try{utils['debug'](util['format'](_0xf32d('0x2e'),_0xef487f[_0xf32d('0x1d')]),_0xef487f);calls[_0xf32d('0x2d')](_0xef487f);recordings[_0xf32d('0x2d')](_0xef487f);}catch(_0x2be135){utils['error'](util['format']('[%s][index][newstate]',_0xef487f[_0xf32d('0x1d')]),_0x2be135);}});ami['on'](_0xf32d('0x2f'),function(_0x1a0ae7){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')]('[%s][index][hangup]',_0x1a0ae7[_0xf32d('0x1d')]),_0x1a0ae7);calls[_0xf32d('0x2f')](_0x1a0ae7);recordings[_0xf32d('0x2f')](_0x1a0ae7);dials[_0xf32d('0x2f')](_0x1a0ae7);agents[_0xf32d('0x2f')](_0x1a0ae7);queues['hangup'](_0x1a0ae7);}catch(_0x427b19){utils[_0xf32d('0x14')](util[_0xf32d('0x18')](_0xf32d('0x30'),_0x1a0ae7[_0xf32d('0x1d')]),_0x427b19);}});ami['on'](_0xf32d('0x31'),function(_0x3615b4){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x32'),_0x3615b4[_0xf32d('0x1d')]),_0x3615b4);members[_0xf32d('0x31')](_0x3615b4);}catch(_0x4c8b21){utils[_0xf32d('0x14')](util['format']('[%s][index][cdr]',_0x3615b4[_0xf32d('0x1d')]),_0x4c8b21);}});ami['on']('blindtransfer',function(_0x226d19){try{utils[_0xf32d('0x17')](util['format'](_0xf32d('0x33'),_0x226d19['uniqueid']),_0x226d19);queues[_0xf32d('0x34')](_0x226d19);agents[_0xf32d('0x34')](_0x226d19);transfers[_0xf32d('0x34')](_0x226d19);recordings[_0xf32d('0x34')](_0x226d19);}catch(_0x4ed18e){utils[_0xf32d('0x14')](util[_0xf32d('0x18')](_0xf32d('0x33'),_0x226d19[_0xf32d('0x1d')]),_0x4ed18e);}});ami['on'](_0xf32d('0x35'),function(_0x30d940){try{utils[_0xf32d('0x17')](util['format'](_0xf32d('0x36'),_0x30d940[_0xf32d('0x37')]),_0x30d940);queues['attendedtransfer'](_0x30d940);transfers['attendedtransfer'](_0x30d940);agents[_0xf32d('0x35')](_0x30d940);calls['attendedtransfer'](_0x30d940);}catch(_0x43be7c){utils[_0xf32d('0x14')](util['format']('[%s][index][attendedtransfer]',_0x30d940[_0xf32d('0x37')]),_0x43be7c);}});ami['on'](_0xf32d('0x38'),function(_0x19043e){try{utils[_0xf32d('0x17')](util['format']('[%s][index][varset]',_0x19043e[_0xf32d('0x1d')]),_0x19043e);queues[_0xf32d('0x38')](_0x19043e);recordings['varset'](_0x19043e);calls[_0xf32d('0x38')](_0x19043e);dials[_0xf32d('0x38')](_0x19043e);}catch(_0x4d064c){utils[_0xf32d('0x14')](util[_0xf32d('0x18')](_0xf32d('0x39'),_0x19043e[_0xf32d('0x1d')]),_0x4d064c);}});ami['on']('newexten',function(_0x182511){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x3a'),_0x182511[_0xf32d('0x1d')]),_0x182511);calls[_0xf32d('0x3b')](_0x182511);recordings[_0xf32d('0x3b')](_0x182511);dials[_0xf32d('0x3b')](_0x182511);}catch(_0x48946e){utils[_0xf32d('0x14')](util[_0xf32d('0x18')](_0xf32d('0x3a'),_0x182511[_0xf32d('0x1d')]),_0x48946e);}});ami['on'](_0xf32d('0x3c'),function(_0x4d5353){try{utils['debug'](util[_0xf32d('0x18')](_0xf32d('0x3d'),_0x4d5353[_0xf32d('0x1d')]),_0x4d5353);calls[_0xf32d('0x3c')](_0x4d5353);recordings['newchannel'](_0x4d5353);}catch(_0x351191){utils[_0xf32d('0x14')](util['format'](_0xf32d('0x3d'),_0x4d5353['uniqueid']),_0x351191);}});ami['on'](_0xf32d('0x3e'),function(_0x41652b){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')](_0xf32d('0x3f'),_0x41652b['uniqueid']),_0x41652b);dials[_0xf32d('0x3e')](_0x41652b);}catch(_0x48f511){utils['error'](util[_0xf32d('0x18')](_0xf32d('0x40'),_0x41652b[_0xf32d('0x1d')]),_0x48f511);}});ami['on'](_0xf32d('0x41'),function(_0x2bfdd8){try{utils[_0xf32d('0x17')](util[_0xf32d('0x18')]('[%s][index][dialend]',_0x2bfdd8[_0xf32d('0x1d')]),_0x2bfdd8);dials[_0xf32d('0x41')](_0x2bfdd8);}catch(_0x54ac48){utils[_0xf32d('0x14')](util[_0xf32d('0x18')]('[%s][index][dialend]',_0x2bfdd8[_0xf32d('0x1d')]),_0x54ac48);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b4372da..eed8951 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 _0x0a9f=['destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','type','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','split','request','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','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','data2','source','data3'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a9f,0x1b5));var _0xf0a9=function(_0x3ccea2,_0x624323){_0x3ccea2=_0x3ccea2-0x0;var _0xeb988=_0x0a9f[_0x3ccea2];return _0xeb988;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var utils=require(_0xf0a9('0x2'));var members={};var exclude=[_0xf0a9('0x3'),_0xf0a9('0x4')];function writeDB(_0x41ee90){utils[_0xf0a9('0x5')](util[_0xf0a9('0x6')](_0xf0a9('0x7'),_0x41ee90[_0xf0a9('0x8')],_0x41ee90[_0xf0a9('0x9')],_0x41ee90[_0xf0a9('0xa')],_0x41ee90['data2'],_0x41ee90[_0xf0a9('0xb')],_0x41ee90['type']));if(_0x41ee90[_0xf0a9('0x9')]){utils[_0xf0a9('0xc')](_0x41ee90['interface'])[_0xf0a9('0xd')](function(_0x150bf8){if(_0x150bf8){_0x41ee90['membername']=_0x150bf8[_0xf0a9('0xe')];_0x41ee90[_0xf0a9('0xf')]=_0x150bf8[_0xf0a9('0xf')];utils['request'](_0xf0a9('0x10'),_0x41ee90);}else{utils[_0xf0a9('0x11')](_0x41ee90[_0xf0a9('0x9')][_0xf0a9('0x12')]('/')[0x1])[_0xf0a9('0xd')](function(_0x20bf31){if(_0x20bf31){_0x41ee90[_0xf0a9('0xb')]=_0x20bf31[_0xf0a9('0xe')];_0x41ee90[_0xf0a9('0xf')]=_0x20bf31[_0xf0a9('0xf')];utils[_0xf0a9('0x13')](_0xf0a9('0x10'),_0x41ee90);}});}})['catch'](function(_0x26e4c0){utils[_0xf0a9('0x14')](util[_0xf0a9('0x6')](_0xf0a9('0x15'),_0x41ee90[_0xf0a9('0x8')]),_0x26e4c0);});}delete members[_0x41ee90[_0xf0a9('0x9')]];}function startsWith(_0x56ae15,_0x2466c0){return _[_0xf0a9('0x16')](_0x56ae15,function(_0x572607){return _[_0xf0a9('0x17')](_0x2466c0,_0x572607);});}exports['devicestatechange']=function(_0x121f44){try{utils[_0xf0a9('0x18')](util[_0xf0a9('0x6')](_0xf0a9('0x19'),members[_0x121f44[_0xf0a9('0x1a')]]?members[_0x121f44[_0xf0a9('0x1a')]]['uniqueid']:_0x121f44[_0xf0a9('0x1a')]),_0x121f44);utils[_0xf0a9('0x5')](util[_0xf0a9('0x6')](_0xf0a9('0x1b'),members[_0x121f44[_0xf0a9('0x1a')]]?members[_0x121f44[_0xf0a9('0x1a')]][_0xf0a9('0x8')]:_0x121f44['device'],_0x121f44['state'],_0x121f44[_0xf0a9('0x1a')]));switch(_0x121f44[_0xf0a9('0x1c')]){case _0xf0a9('0x1d'):case _0xf0a9('0x1e'):if(!startsWith(exclude,_0x121f44[_0xf0a9('0x1a')])){members[_0x121f44[_0xf0a9('0x1a')]]={'channel':_0xf0a9('0x1f'),'interface':_0x121f44['device'],'type':_0xf0a9('0x20'),'enterAt':utils[_0xf0a9('0x21')](),'role':_0xf0a9('0x22')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x121f44[_0xf0a9('0x1a')]])){members[_0x121f44[_0xf0a9('0x1a')]][_0xf0a9('0x23')]=utils['now']();members[_0x121f44[_0xf0a9('0x1a')]][_0xf0a9('0x24')]=utils[_0xf0a9('0x25')](members[_0x121f44['device']][_0xf0a9('0x23')],members[_0x121f44['device']][_0xf0a9('0x26')]);if(members[_0x121f44['device']][_0xf0a9('0x8')]){writeDB(members[_0x121f44['device']]);}}break;default:break;}}catch(_0x11edea){utils[_0xf0a9('0x14')](util[_0xf0a9('0x6')](_0xf0a9('0x19'),members[_0x121f44[_0xf0a9('0x1a')]]?members[_0x121f44[_0xf0a9('0x1a')]][_0xf0a9('0x8')]:_0x121f44[_0xf0a9('0x1a')]),_0x11edea);}};exports[_0xf0a9('0x27')]=function(_0xbd6f52){try{if(!_[_0xf0a9('0x28')](members[_0xbd6f52[_0xf0a9('0x9')]])){utils[_0xf0a9('0x18')](util[_0xf0a9('0x6')](_0xf0a9('0x29'),_0xbd6f52[_0xf0a9('0x8')]),_0xbd6f52);utils[_0xf0a9('0x5')](util[_0xf0a9('0x6')](_0xf0a9('0x2a'),_0xbd6f52[_0xf0a9('0x8')],_0xbd6f52[_0xf0a9('0x9')],_0xbd6f52['queue']));members[_0xbd6f52[_0xf0a9('0x9')]]=_[_0xf0a9('0x2b')](members[_0xbd6f52[_0xf0a9('0x9')]],{'data4':_0xbd6f52[_0xf0a9('0x2c')],'uniqueid':_0xbd6f52[_0xf0a9('0x8')]});}}catch(_0xaeb07b){utils[_0xf0a9('0x14')](util['format']('[%s][members][agentcomplete]',_0xbd6f52[_0xf0a9('0x8')]),_0xaeb07b);}};exports[_0xf0a9('0x2d')]=function(_0x1e41bf){try{utils['debug'](util[_0xf0a9('0x6')]('[%s][members][cdr]',_0x1e41bf[_0xf0a9('0x8')]),_0x1e41bf);if(_0x1e41bf['channel']){var _0x473757=_0x1e41bf[_0xf0a9('0xa')]['split']('-')[0x0];if(!_[_0xf0a9('0x28')](members[_0x473757])){members[_0x473757]=_['assign'](members[_0x473757],{'data1':members[_0x473757]['data1']||_0x1e41bf['type'],'data2':members[_0x473757][_0xf0a9('0x2e')]||_0x1e41bf[_0xf0a9('0x2f')],'data3':members[_0x473757][_0xf0a9('0x30')]||_0x1e41bf[_0xf0a9('0x31')],'uniqueid':members[_0x473757][_0xf0a9('0x8')]||_0x1e41bf[_0xf0a9('0x8')]});utils['info'](util['format'](_0xf0a9('0x32'),_0x1e41bf[_0xf0a9('0x8')],members[_0x473757][_0xf0a9('0x33')],members[_0x473757][_0xf0a9('0x2e')],members[_0x473757][_0xf0a9('0x30')]));if(members[_0x473757]['exitAt']){writeDB(members[_0x473757]);}}}if(_0x1e41bf['destinationchannel']){var _0x7e02db=_0x1e41bf[_0xf0a9('0x34')][_0xf0a9('0x12')]('-')[0x0];if(!_['isNil'](members[_0x7e02db])){members[_0x7e02db]=_[_0xf0a9('0x2b')](members[_0x7e02db],{'data1':members[_0x7e02db][_0xf0a9('0x33')]||_0x1e41bf[_0xf0a9('0x35')],'data2':members[_0x7e02db][_0xf0a9('0x2e')]||_0x1e41bf[_0xf0a9('0x2f')],'data3':members[_0x7e02db]['data3']||_0x1e41bf[_0xf0a9('0x31')],'uniqueid':members[_0x7e02db][_0xf0a9('0x8')]||_0x1e41bf[_0xf0a9('0x8')]});utils[_0xf0a9('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1e41bf[_0xf0a9('0x8')],members[_0x7e02db][_0xf0a9('0x33')],members[_0x7e02db][_0xf0a9('0x2e')],members[_0x7e02db]['data3']));if(members[_0x7e02db][_0xf0a9('0x23')]){writeDB(members[_0x7e02db]);}}}}catch(_0x4cf3d0){utils[_0xf0a9('0x14')](util[_0xf0a9('0x6')]('[%s][members][cdr]',_0x1e41bf[_0xf0a9('0x8')]),_0x4cf3d0);}}; \ No newline at end of file +var _0xdecb=['exitAt','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','[%s][members][cdr]','split','type','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','destinationchannel','source','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','now','agent','NOT_INUSE','isNil'];(function(_0x3564ef,_0x4bdc10){var _0x20835e=function(_0x1f1e64){while(--_0x1f1e64){_0x3564ef['push'](_0x3564ef['shift']());}};_0x20835e(++_0x4bdc10);}(_0xdecb,0xe2));var _0xbdec=function(_0x2dd570,_0x3e9624){_0x2dd570=_0x2dd570-0x0;var _0x229b25=_0xdecb[_0x2dd570];return _0x229b25;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var utils=require(_0xbdec('0x1'));var members={};var exclude=[_0xbdec('0x2'),'Queue:'];function writeDB(_0xf5506d){utils['info'](util[_0xbdec('0x3')](_0xbdec('0x4'),_0xf5506d[_0xbdec('0x5')],_0xf5506d[_0xbdec('0x6')],_0xf5506d[_0xbdec('0x7')],_0xf5506d[_0xbdec('0x8')],_0xf5506d[_0xbdec('0x9')],_0xf5506d['type']));if(_0xf5506d[_0xbdec('0x6')]){utils[_0xbdec('0xa')](_0xf5506d[_0xbdec('0x6')])[_0xbdec('0xb')](function(_0x30b974){if(_0x30b974){_0xf5506d[_0xbdec('0x9')]=_0x30b974[_0xbdec('0xc')];_0xf5506d[_0xbdec('0xd')]=_0x30b974['internal'];utils[_0xbdec('0xe')](_0xbdec('0xf'),_0xf5506d);}else{utils[_0xbdec('0x10')](_0xf5506d[_0xbdec('0x6')]['split']('/')[0x1])[_0xbdec('0xb')](function(_0x98362d){if(_0x98362d){_0xf5506d[_0xbdec('0x9')]=_0x98362d['name'];_0xf5506d[_0xbdec('0xd')]=_0x98362d[_0xbdec('0xd')];utils[_0xbdec('0xe')](_0xbdec('0xf'),_0xf5506d);}});}})[_0xbdec('0x11')](function(_0x89d0ca){utils[_0xbdec('0x12')](util[_0xbdec('0x3')](_0xbdec('0x13'),_0xf5506d[_0xbdec('0x5')]),_0x89d0ca);});}delete members[_0xf5506d[_0xbdec('0x6')]];}function startsWith(_0x36f697,_0x577c2e){return _[_0xbdec('0x14')](_0x36f697,function(_0x358b6f){return _[_0xbdec('0x15')](_0x577c2e,_0x358b6f);});}exports[_0xbdec('0x16')]=function(_0x324378){try{utils[_0xbdec('0x17')](util[_0xbdec('0x3')](_0xbdec('0x18'),members[_0x324378[_0xbdec('0x19')]]?members[_0x324378['device']][_0xbdec('0x5')]:_0x324378['device']),_0x324378);utils['info'](util[_0xbdec('0x3')](_0xbdec('0x1a'),members[_0x324378[_0xbdec('0x19')]]?members[_0x324378[_0xbdec('0x19')]][_0xbdec('0x5')]:_0x324378['device'],_0x324378[_0xbdec('0x1b')],_0x324378['device']));switch(_0x324378[_0xbdec('0x1b')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x324378[_0xbdec('0x19')])){members[_0x324378['device']]={'channel':_0xbdec('0x1c'),'interface':_0x324378['device'],'type':_0xbdec('0x1d'),'enterAt':utils[_0xbdec('0x1e')](),'role':_0xbdec('0x1f')};}break;case _0xbdec('0x20'):if(!_[_0xbdec('0x21')](members[_0x324378['device']])){members[_0x324378[_0xbdec('0x19')]][_0xbdec('0x22')]=utils[_0xbdec('0x1e')]();members[_0x324378[_0xbdec('0x19')]][_0xbdec('0x23')]=utils[_0xbdec('0x24')](members[_0x324378[_0xbdec('0x19')]][_0xbdec('0x22')],members[_0x324378[_0xbdec('0x19')]]['enterAt']);if(members[_0x324378['device']]['uniqueid']){writeDB(members[_0x324378['device']]);}}break;default:break;}}catch(_0x3c8b90){utils[_0xbdec('0x12')](util[_0xbdec('0x3')](_0xbdec('0x18'),members[_0x324378[_0xbdec('0x19')]]?members[_0x324378['device']][_0xbdec('0x5')]:_0x324378[_0xbdec('0x19')]),_0x3c8b90);}};exports[_0xbdec('0x25')]=function(_0x3373c0){try{if(!_['isNil'](members[_0x3373c0[_0xbdec('0x6')]])){utils[_0xbdec('0x17')](util[_0xbdec('0x3')](_0xbdec('0x26'),_0x3373c0['uniqueid']),_0x3373c0);utils[_0xbdec('0x27')](util[_0xbdec('0x3')](_0xbdec('0x28'),_0x3373c0['uniqueid'],_0x3373c0[_0xbdec('0x6')],_0x3373c0['queue']));members[_0x3373c0['interface']]=_[_0xbdec('0x29')](members[_0x3373c0[_0xbdec('0x6')]],{'data4':_0x3373c0['queue'],'uniqueid':_0x3373c0['uniqueid']});}}catch(_0x2cb491){utils[_0xbdec('0x12')](util[_0xbdec('0x3')](_0xbdec('0x26'),_0x3373c0[_0xbdec('0x5')]),_0x2cb491);}};exports[_0xbdec('0x2a')]=function(_0x5ef78b){try{utils['debug'](util[_0xbdec('0x3')](_0xbdec('0x2b'),_0x5ef78b[_0xbdec('0x5')]),_0x5ef78b);if(_0x5ef78b[_0xbdec('0x7')]){var _0x561aec=_0x5ef78b[_0xbdec('0x7')][_0xbdec('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x561aec])){members[_0x561aec]=_[_0xbdec('0x29')](members[_0x561aec],{'data1':members[_0x561aec]['data1']||_0x5ef78b[_0xbdec('0x2d')],'data2':members[_0x561aec][_0xbdec('0x8')]||_0x5ef78b['source'],'data3':members[_0x561aec]['data3']||_0x5ef78b[_0xbdec('0x2e')],'uniqueid':members[_0x561aec]['uniqueid']||_0x5ef78b[_0xbdec('0x5')]});utils[_0xbdec('0x27')](util[_0xbdec('0x3')](_0xbdec('0x2f'),_0x5ef78b[_0xbdec('0x5')],members[_0x561aec][_0xbdec('0x30')],members[_0x561aec]['data2'],members[_0x561aec][_0xbdec('0x31')]));if(members[_0x561aec]['exitAt']){writeDB(members[_0x561aec]);}}}if(_0x5ef78b['destinationchannel']){var _0x14f128=_0x5ef78b[_0xbdec('0x32')][_0xbdec('0x2c')]('-')[0x0];if(!_[_0xbdec('0x21')](members[_0x14f128])){members[_0x14f128]=_[_0xbdec('0x29')](members[_0x14f128],{'data1':members[_0x14f128]['data1']||_0x5ef78b[_0xbdec('0x2d')],'data2':members[_0x14f128][_0xbdec('0x8')]||_0x5ef78b[_0xbdec('0x33')],'data3':members[_0x14f128][_0xbdec('0x31')]||_0x5ef78b[_0xbdec('0x2e')],'uniqueid':members[_0x14f128][_0xbdec('0x5')]||_0x5ef78b[_0xbdec('0x5')]});utils[_0xbdec('0x27')](util[_0xbdec('0x3')](_0xbdec('0x2f'),_0x5ef78b[_0xbdec('0x5')],members[_0x14f128]['data1'],members[_0x14f128][_0xbdec('0x8')],members[_0x14f128][_0xbdec('0x31')]));if(members[_0x14f128][_0xbdec('0x22')]){writeDB(members[_0x14f128]);}}}}catch(_0x295f1){utils[_0xbdec('0x12')](util[_0xbdec('0x3')]('[%s][members][cdr]',_0x5ef78b['uniqueid']),_0x295f1);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 00ad453..1bdfa29 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 _0x25ee=['[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','origtransfererexten','secondtransfererlinkedid','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','lastAssignedTo','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','now','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]'];(function(_0xc8bfb1,_0x29615a){var _0x542b3f=function(_0x24129a){while(--_0x24129a){_0xc8bfb1['push'](_0xc8bfb1['shift']());}};_0x542b3f(++_0x29615a);}(_0x25ee,0x165));var _0xe25e=function(_0x3a417f,_0x561430){_0x3a417f=_0x3a417f-0x0;var _0x49d20c=_0x25ee[_0x3a417f];return _0x49d20c;};'use strict';var _=require('lodash');var util=require(_0xe25e('0x0'));var utils=require(_0xe25e('0x1'));var queues={};function writeDB(_0x4a896a){utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x4'),_0x4a896a['uniqueid'],_0x4a896a['channel'],_0x4a896a['queue'],_0x4a896a[_0xe25e('0x5')],_0x4a896a[_0xe25e('0x6')],_0x4a896a['accountcode'],_0x4a896a[_0xe25e('0x7')]));if(_0x4a896a[_0xe25e('0x8')]){utils[_0xe25e('0x9')](_0x4a896a['queue'])[_0xe25e('0xa')](function(_0x47e57c){if(_0x47e57c){_0x4a896a['type']=_0x47e57c[_0xe25e('0xb')];}utils['request'](_0xe25e('0xc'),_0x4a896a);});}else{utils[_0xe25e('0xd')]('CreateVoiceQueueReport',_0x4a896a);}if(_0x4a896a[_0xe25e('0xe')]){delete queues[_0x4a896a[_0xe25e('0xe')]];}else{delete queues[_0x4a896a[_0xe25e('0xf')]];}}exports[_0xe25e('0x10')]=function(_0x28f120){try{utils[_0xe25e('0x11')](util[_0xe25e('0x3')](_0xe25e('0x12'),_0x28f120['uniqueid']),_0x28f120);utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x13'),_0x28f120[_0xe25e('0xf')],_0x28f120[_0xe25e('0x8')],_0x28f120[_0xe25e('0x14')]));queues[_0x28f120['uniqueid']]=_[_0xe25e('0x15')](_0x28f120,{'originalposition':_0x28f120[_0xe25e('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x49918e){utils[_0xe25e('0x16')](util[_0xe25e('0x3')]('[%s][queues][queuecallerjoin]',_0x28f120[_0xe25e('0xf')]),_0x49918e);}};exports[_0xe25e('0x17')]=function(_0x39e95b){try{if(!_[_0xe25e('0x18')](queues[_0x39e95b[_0xe25e('0xf')]])){utils[_0xe25e('0x11')](util[_0xe25e('0x3')](_0xe25e('0x19'),_0x39e95b['uniqueid']),_0x39e95b);if(queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0x1a')]){if(!queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0x1b')]&&!queues[_0x39e95b[_0xe25e('0xf')]]['queuecallerexit']){queues[_0x39e95b['uniqueid']]['queuecallercomplete']=!![];queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0x1c')]=utils['now']();queues[_0x39e95b[_0xe25e('0xf')]]['queuecallerexitreason']=_0xe25e('0x1d');}utils['info'](util[_0xe25e('0x3')](_0xe25e('0x1e'),_0x39e95b[_0xe25e('0xf')],queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0x1f')],queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0x7')]));writeDB(queues[_0x39e95b[_0xe25e('0xf')]]);}else if(queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0xe')]){utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x20'),_0x39e95b[_0xe25e('0xf')],queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0x1f')],queues[_0x39e95b[_0xe25e('0xf')]][_0xe25e('0xe')]));queues[queues[_0x39e95b['uniqueid']]['transfereduniqueid']]=queues[_0x39e95b[_0xe25e('0xf')]];queues[queues[_0x39e95b[_0xe25e('0xf')]]['transfereduniqueid']][_0xe25e('0x21')]=0x2;delete queues[_0x39e95b[_0xe25e('0xf')]];}}}catch(_0x323a92){utils[_0xe25e('0x16')](util['format'](_0xe25e('0x19'),_0x39e95b[_0xe25e('0xf')]),_0x323a92);}};exports[_0xe25e('0x22')]=function(_0x4c231c){try{utils['debug'](util[_0xe25e('0x3')](_0xe25e('0x23'),_0x4c231c[_0xe25e('0xf')]),_0x4c231c);if(!_[_0xe25e('0x18')](_0x4c231c['variable'][_0xe25e('0x24')])&&_0x4c231c[_0xe25e('0x25')]['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x4c231c[_0xe25e('0xf')]])){queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x1b')]=![];queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x26')]=null;queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x27')]=!![];queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x28')]=utils[_0xe25e('0x29')]();queues[_0x4c231c[_0xe25e('0xf')]]['queuecallerexitreason']=_0x4c231c[_0xe25e('0x25')][_0xe25e('0x2a')]();utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x2b'),_0x4c231c['uniqueid'],queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x1f')],_0x4c231c[_0xe25e('0x25')],queues[_0x4c231c[_0xe25e('0xf')]]['queuecallerexitreason']));writeDB(queues[_0x4c231c[_0xe25e('0xf')]]);}}else if(!_[_0xe25e('0x18')](_0x4c231c[_0xe25e('0x2c')]['queueposition'])){if(!_['isNil'](queues[_0x4c231c['uniqueid']])&&!queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x1b')]){queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x1b')]=![];queues[_0x4c231c['uniqueid']][_0xe25e('0x26')]=null;queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x27')]=!![];queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x28')]=utils[_0xe25e('0x29')]();queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x7')]=_0xe25e('0x2d');utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x2e'),_0x4c231c[_0xe25e('0xf')],queues[_0x4c231c[_0xe25e('0xf')]][_0xe25e('0x1f')],_0x4c231c[_0xe25e('0x25')],queues[_0x4c231c['uniqueid']][_0xe25e('0x7')]));}}}catch(_0x4dfa6c){utils[_0xe25e('0x16')](util[_0xe25e('0x3')](_0xe25e('0x23'),_0x4c231c['uniqueid']),_0x4dfa6c);}};exports[_0xe25e('0x1b')]=function(_0x50b8e3){try{if(!_[_0xe25e('0x18')](queues[_0x50b8e3[_0xe25e('0xf')]])){utils[_0xe25e('0x11')](util[_0xe25e('0x3')]('[%s][queues][queuecallerabandon]',_0x50b8e3[_0xe25e('0xf')]),_0x50b8e3);queues[_0x50b8e3[_0xe25e('0xf')]]['queuecallerexit']=![];queues[_0x50b8e3['uniqueid']][_0xe25e('0x28')]=null;queues[_0x50b8e3[_0xe25e('0xf')]][_0xe25e('0x1b')]=!![];queues[_0x50b8e3['uniqueid']][_0xe25e('0x26')]=utils['now']();queues[_0x50b8e3[_0xe25e('0xf')]][_0xe25e('0x7')]=_0xe25e('0x2f');utils[_0xe25e('0x2')](util[_0xe25e('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x50b8e3['uniqueid'],queues[_0x50b8e3[_0xe25e('0xf')]][_0xe25e('0x1f')],queues[_0x50b8e3[_0xe25e('0xf')]][_0xe25e('0x7')]));}}catch(_0x2b76d6){utils[_0xe25e('0x16')](util['format'](_0xe25e('0x30'),_0x50b8e3[_0xe25e('0xf')]),_0x2b76d6);}};exports[_0xe25e('0x31')]=function(_0x2f9bd5){try{if(!_[_0xe25e('0x18')](queues[_0x2f9bd5[_0xe25e('0xf')]])){utils[_0xe25e('0x11')](util[_0xe25e('0x3')](_0xe25e('0x32'),_0x2f9bd5[_0xe25e('0xf')]),_0x2f9bd5);utils['info'](util[_0xe25e('0x3')](_0xe25e('0x33'),_0x2f9bd5[_0xe25e('0xf')],queues[_0x2f9bd5[_0xe25e('0xf')]]['name'],_0x2f9bd5[_0xe25e('0x34')],_0x2f9bd5[_0xe25e('0x35')]));queues[_0x2f9bd5['uniqueid']][_0xe25e('0x31')]=!![];queues[_0x2f9bd5['uniqueid']][_0xe25e('0x1a')]=utils[_0xe25e('0x29')]();queues[_0x2f9bd5['uniqueid']][_0xe25e('0x36')]=utils['diffTime'](queues[_0x2f9bd5['uniqueid']][_0xe25e('0x1a')],queues[_0x2f9bd5[_0xe25e('0xf')]][_0xe25e('0x37')]);queues[_0x2f9bd5[_0xe25e('0xf')]]['position']=_0x2f9bd5[_0xe25e('0x14')];queues[_0x2f9bd5[_0xe25e('0xf')]][_0xe25e('0x38')]=_0x2f9bd5[_0xe25e('0x38')];queues[_0x2f9bd5[_0xe25e('0xf')]][_0xe25e('0x34')]=_0x2f9bd5[_0xe25e('0x34')];queues[_0x2f9bd5[_0xe25e('0xf')]][_0xe25e('0x35')]=_0x2f9bd5[_0xe25e('0x35')];}}catch(_0x4ae062){utils[_0xe25e('0x16')](util[_0xe25e('0x3')](_0xe25e('0x32'),_0x2f9bd5['uniqueid']),_0x4ae062);}};exports[_0xe25e('0x39')]=function(_0x186ef9){try{if(!_[_0xe25e('0x18')](queues[_0x186ef9['uniqueid']])){utils[_0xe25e('0x11')](util[_0xe25e('0x3')]('[%s][queues][agentconnect]',_0x186ef9[_0xe25e('0xf')]),_0x186ef9);utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x3a'),_0x186ef9[_0xe25e('0xf')],queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x1f')],_0x186ef9[_0xe25e('0x3b')],_0x186ef9[_0xe25e('0x3c')]));queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x1b')]=![];queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x1b')]=![];queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x26')]=null;queues[_0x186ef9['uniqueid']]['queuecallerexit']=![];queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x7')]=null;queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x28')]=null;queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x3d')]=!![];queues[_0x186ef9[_0xe25e('0xf')]]['accountcode']=_0x186ef9['destaccountcode'];queues[_0x186ef9[_0xe25e('0xf')]][_0xe25e('0x5')]=_0x186ef9['membername'];}}catch(_0xc3fb79){utils[_0xe25e('0x16')](util['format'](_0xe25e('0x3e'),_0x186ef9[_0xe25e('0xf')]),_0xc3fb79);}};exports[_0xe25e('0x3f')]=function(_0x2d36ec){try{if(!_['isNil'](queues[_0x2d36ec[_0xe25e('0xf')]])){if(queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x1a')]){utils[_0xe25e('0x11')](util['format']('[%s][queues][agentcomplete]',_0x2d36ec[_0xe25e('0xf')]),_0x2d36ec);queues[_0x2d36ec[_0xe25e('0xf')]]['queuecallerabandon']=![];queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x1b')]=![];queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x26')]=null;queues[_0x2d36ec['uniqueid']][_0xe25e('0x27')]=![];queues[_0x2d36ec[_0xe25e('0xf')]]['queuecallerexitAt']=null;queues[_0x2d36ec['uniqueid']]['assigned']=!![];queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x5')]=_0x2d36ec[_0xe25e('0x3b')];queues[_0x2d36ec[_0xe25e('0xf')]]['queuecallercomplete']=!![];queues[_0x2d36ec['uniqueid']]['queuecallercompleteAt']=utils[_0xe25e('0x29')]();if(_0x2d36ec[_0xe25e('0x40')]==_0xe25e('0x41')){if(!queues[_0x2d36ec[_0xe25e('0xf')]]['transfer']){queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x7')]=_0xe25e('0x42');}}else{queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x7')]=_0xe25e('0x43')+_0x2d36ec['reason'][_0xe25e('0x2a')]();}utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x44'),_0x2d36ec[_0xe25e('0xf')],queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x1f')],_0x2d36ec[_0xe25e('0x3b')],queues[_0x2d36ec[_0xe25e('0xf')]][_0xe25e('0x7')]));writeDB(queues[_0x2d36ec[_0xe25e('0xf')]]);}}}catch(_0x3d6777){utils[_0xe25e('0x16')](util[_0xe25e('0x3')]('[%s][queues][agentcomplete]',_0x2d36ec[_0xe25e('0xf')]),_0x3d6777);}};exports[_0xe25e('0x45')]=function(_0x4a3531){try{if(!_[_0xe25e('0x18')](queues[_0x4a3531['transfereeuniqueid']])){utils[_0xe25e('0x11')](util['format'](_0xe25e('0x46'),_0x4a3531[_0xe25e('0xf')]),_0x4a3531);queues[_0x4a3531[_0xe25e('0x47')]]['transfer']=!![];queues[_0x4a3531[_0xe25e('0x47')]][_0xe25e('0x48')]=_0xe25e('0x49');queues[_0x4a3531[_0xe25e('0x47')]][_0xe25e('0x4a')]=_0x4a3531[_0xe25e('0x4b')];queues[_0x4a3531[_0xe25e('0x47')]][_0xe25e('0x4c')]=_0x4a3531['transfereeuniqueid'];queues[_0x4a3531[_0xe25e('0x47')]]['queuecallerexitreason']=_0xe25e('0x4d');utils[_0xe25e('0x2')](util[_0xe25e('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4a3531[_0xe25e('0xf')],queues[_0x4a3531[_0xe25e('0x47')]][_0xe25e('0x1f')],_0x4a3531[_0xe25e('0x47')],_0x4a3531['extension']));}}catch(_0x335fce){utils[_0xe25e('0x16')](util[_0xe25e('0x3')]('[%s][queues][blindtransfer]',_0x4a3531[_0xe25e('0xf')]),_0x335fce);}};exports[_0xe25e('0x4e')]=function(_0x5c784e){try{utils[_0xe25e('0x11')](util['format'](_0xe25e('0x4f'),_0x5c784e[_0xe25e('0x50')]),_0x5c784e);if(_0x5c784e[_0xe25e('0x50')]==_0x5c784e[_0xe25e('0x51')]){if(!_[_0xe25e('0x18')](queues[_0x5c784e['secondtransfererlinkedid']])){utils['info'](util[_0xe25e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5c784e[_0xe25e('0x50')],queues[_0x5c784e['secondtransfererlinkedid']][_0xe25e('0x1f')],_0x5c784e[_0xe25e('0x52')]));queues[_0x5c784e[_0xe25e('0x53')]][_0xe25e('0x41')]=!![];queues[_0x5c784e[_0xe25e('0x53')]][_0xe25e('0x48')]=_0xe25e('0x54');queues[_0x5c784e[_0xe25e('0x53')]][_0xe25e('0x4a')]=_0x5c784e[_0xe25e('0x52')];queues[_0x5c784e[_0xe25e('0x53')]]['transferuniqueid']=_0x5c784e[_0xe25e('0x50')];queues[_0x5c784e['secondtransfererlinkedid']][_0xe25e('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xe25e('0x18')](queues[_0x5c784e[_0xe25e('0x51')]])){if(_0x5c784e[_0xe25e('0x55')]&&queues[_0x5c784e[_0xe25e('0x55')]]){queues[_0x5c784e[_0xe25e('0x55')]][_0xe25e('0x21')]=0x1;queues[_0x5c784e[_0xe25e('0x47')]]=_[_0xe25e('0x56')](queues[_0x5c784e[_0xe25e('0x55')]]);queues[_0x5c784e[_0xe25e('0x47')]][_0xe25e('0xe')]=_0x5c784e[_0xe25e('0x57')];queues[_0x5c784e[_0xe25e('0x47')]]['queuecallerenterreason']=0x2;queues[_0x5c784e[_0xe25e('0x47')]][_0xe25e('0x6')]=queues[_0x5c784e[_0xe25e('0x53')]][_0xe25e('0x6')];queues[_0x5c784e['transfereeuniqueid']][_0xe25e('0x58')]=queues[_0x5c784e['secondtransfererlinkedid']][_0xe25e('0x58')];queues[_0x5c784e['transfereeuniqueid']][_0xe25e('0x37')]=utils['now']();queues[_0x5c784e[_0xe25e('0x47')]][_0xe25e('0x1a')]=utils[_0xe25e('0x29')]();queues[_0x5c784e[_0xe25e('0x47')]][_0xe25e('0x36')]=0x0;queues[_0x5c784e[_0xe25e('0x47')]][_0xe25e('0x59')]=0x0;utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x5a'),_0x5c784e[_0xe25e('0x50')],queues[_0x5c784e[_0xe25e('0x47')]][_0xe25e('0x1f')],queues[_0x5c784e[_0xe25e('0x47')]]['calleridnum'],queues[_0x5c784e['transfereeuniqueid']]['calleridname']));}else{utils[_0xe25e('0x2')](util[_0xe25e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5c784e[_0xe25e('0x50')],queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x1f')],_0x5c784e[_0xe25e('0x53')]));queues[_0x5c784e['origtransfererlinkedid']][_0xe25e('0xe')]=_0x5c784e[_0xe25e('0x53')];}}}else if(_0x5c784e[_0xe25e('0x5b')]==_0x5c784e[_0xe25e('0x53')]){if(!_[_0xe25e('0x18')](queues[_0x5c784e[_0xe25e('0x51')]])){utils['info'](util[_0xe25e('0x3')](_0xe25e('0x5c'),_0x5c784e[_0xe25e('0x50')],queues[_0x5c784e['origtransfererlinkedid']][_0xe25e('0x1f')],_0x5c784e[_0xe25e('0x5b')],_0x5c784e[_0xe25e('0x5d')]));queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x41')]=!![];queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x48')]='ATTENDED';queues[_0x5c784e[_0xe25e('0x51')]]['transferexten']=_0x5c784e[_0xe25e('0x5d')];queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x4c')]=_0x5c784e[_0xe25e('0x5b')];queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x7')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x5c784e['secondtransfererlinkedid']])){if(_0x5c784e['transfertargetlinkedid']&&queues[_0x5c784e[_0xe25e('0x5e')]]){queues[_0x5c784e[_0xe25e('0x5e')]][_0xe25e('0x21')]=0x1;queues[_0x5c784e[_0xe25e('0x57')]]=_[_0xe25e('0x56')](queues[_0x5c784e[_0xe25e('0x5e')]]);queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0xe')]=_0x5c784e[_0xe25e('0x57')];queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0x21')]=0x2;queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0x6')]=queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x6')];queues[_0x5c784e[_0xe25e('0x57')]]['calleridname']=queues[_0x5c784e[_0xe25e('0x51')]][_0xe25e('0x58')];queues[_0x5c784e[_0xe25e('0x57')]]['queuecallerjoinAt']=utils[_0xe25e('0x29')]();queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0x1a')]=utils[_0xe25e('0x29')]();queues[_0x5c784e[_0xe25e('0x57')]]['holdtime']=0x0;queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0x59')]=0x0;utils[_0xe25e('0x2')](util[_0xe25e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x5c784e['origtransfereruniqueid'],queues[_0x5c784e['transfertargetuniqueid']][_0xe25e('0x1f')],queues[_0x5c784e[_0xe25e('0x57')]]['transfereduniqueid'],queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0x6')],queues[_0x5c784e[_0xe25e('0x57')]][_0xe25e('0x58')]));}else{utils[_0xe25e('0x2')](util['format'](_0xe25e('0x5f'),_0x5c784e[_0xe25e('0x50')],queues[_0x5c784e[_0xe25e('0x53')]]['name'],_0x5c784e[_0xe25e('0x51')]));queues[_0x5c784e[_0xe25e('0x53')]][_0xe25e('0xe')]=_0x5c784e['origtransfererlinkedid'];}}}}catch(_0x4c6305){utils[_0xe25e('0x16')](util[_0xe25e('0x3')]('[%s][queues][attendedtransfer]',_0x5c784e[_0xe25e('0x50')]),_0x4c6305);}};exports[_0xe25e('0x60')]=function(_0x5eb5e2){try{if(!_[_0xe25e('0x18')](queues[_0x5eb5e2[_0xe25e('0xf')]])){utils['debug'](util[_0xe25e('0x3')](_0xe25e('0x61'),_0x5eb5e2[_0xe25e('0xf')]),_0x5eb5e2);queues[_0x5eb5e2[_0xe25e('0xf')]][_0xe25e('0x62')]=utils[_0xe25e('0x29')]();utils[_0xe25e('0x2')](util[_0xe25e('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x5eb5e2['uniqueid'],queues[_0x5eb5e2[_0xe25e('0xf')]]['name'],queues[_0x5eb5e2[_0xe25e('0xf')]][_0xe25e('0x62')]));}}catch(_0x4235c0){utils[_0xe25e('0x16')](util[_0xe25e('0x3')](_0xe25e('0x61'),_0x5eb5e2[_0xe25e('0xf')]),_0x4235c0);}};exports['musiconholdstop']=function(_0x7d18b5){try{if(!_[_0xe25e('0x18')](queues[_0x7d18b5['uniqueid']])){if(!_[_0xe25e('0x18')](queues[_0x7d18b5['uniqueid']][_0xe25e('0x62')])){utils[_0xe25e('0x11')](util[_0xe25e('0x3')](_0xe25e('0x63'),_0x7d18b5[_0xe25e('0xf')]),_0x7d18b5);queues[_0x7d18b5[_0xe25e('0xf')]][_0xe25e('0x59')]+=utils[_0xe25e('0x64')](utils['now'](),queues[_0x7d18b5[_0xe25e('0xf')]]['musiconholdstartAt']);utils[_0xe25e('0x2')](util[_0xe25e('0x3')](_0xe25e('0x65'),_0x7d18b5['uniqueid'],queues[_0x7d18b5['uniqueid']][_0xe25e('0x1f')],queues[_0x7d18b5[_0xe25e('0xf')]]['mohtime']));delete queues[_0x7d18b5['uniqueid']]['musiconholdstartAt'];}}}catch(_0x45d792){utils[_0xe25e('0x16')](util['format'](_0xe25e('0x63'),_0x7d18b5[_0xe25e('0xf')]),_0x45d792);}}; \ No newline at end of file +var _0x5edf=['secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','isNil','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerabandonAt','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','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','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x1ce236,_0xca922e){var _0x241819=function(_0x1a66f8){while(--_0x1a66f8){_0x1ce236['push'](_0x1ce236['shift']());}};_0x241819(++_0xca922e);}(_0x5edf,0x199));var _0xf5ed=function(_0x167271,_0x626458){_0x167271=_0x167271-0x0;var _0xbd5f55=_0x5edf[_0x167271];return _0xbd5f55;};'use strict';var _=require(_0xf5ed('0x0'));var util=require('util');var utils=require(_0xf5ed('0x1'));var queues={};function writeDB(_0x4de79a){utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x4'),_0x4de79a['uniqueid'],_0x4de79a[_0xf5ed('0x5')],_0x4de79a['queue'],_0x4de79a[_0xf5ed('0x6')],_0x4de79a[_0xf5ed('0x7')],_0x4de79a[_0xf5ed('0x8')],_0x4de79a[_0xf5ed('0x9')]));if(_0x4de79a['queue']){utils[_0xf5ed('0xa')](_0x4de79a[_0xf5ed('0xb')])[_0xf5ed('0xc')](function(_0x25d3f3){if(_0x25d3f3){_0x4de79a[_0xf5ed('0xd')]=_0x25d3f3[_0xf5ed('0xd')];}utils[_0xf5ed('0xe')](_0xf5ed('0xf'),_0x4de79a);});}else{utils[_0xf5ed('0xe')](_0xf5ed('0xf'),_0x4de79a);}if(_0x4de79a[_0xf5ed('0x10')]){delete queues[_0x4de79a[_0xf5ed('0x10')]];}else{delete queues[_0x4de79a[_0xf5ed('0x11')]];}}exports['queuecallerjoin']=function(_0x4ae292){try{utils[_0xf5ed('0x12')](util['format'](_0xf5ed('0x13'),_0x4ae292[_0xf5ed('0x11')]),_0x4ae292);utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x14'),_0x4ae292[_0xf5ed('0x11')],_0x4ae292['queue'],_0x4ae292[_0xf5ed('0x15')]));queues[_0x4ae292[_0xf5ed('0x11')]]=_[_0xf5ed('0x16')](_0x4ae292,{'originalposition':_0x4ae292['position'],'queuecallerjoinAt':utils[_0xf5ed('0x17')](),'mohtime':0x0});}catch(_0x20d25c){utils['error'](util[_0xf5ed('0x3')]('[%s][queues][queuecallerjoin]',_0x4ae292[_0xf5ed('0x11')]),_0x20d25c);}};exports[_0xf5ed('0x18')]=function(_0xddd971){try{if(!_['isNil'](queues[_0xddd971[_0xf5ed('0x11')]])){utils[_0xf5ed('0x12')](util[_0xf5ed('0x3')](_0xf5ed('0x19'),_0xddd971['uniqueid']),_0xddd971);if(queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x1a')]){if(!queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x1b')]&&!queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x1c')]){queues[_0xddd971['uniqueid']]['queuecallercomplete']=!![];queues[_0xddd971[_0xf5ed('0x11')]]['queuecallercompleteAt']=utils[_0xf5ed('0x17')]();queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x9')]=_0xf5ed('0x1d');}utils['info'](util[_0xf5ed('0x3')](_0xf5ed('0x1e'),_0xddd971[_0xf5ed('0x11')],queues[_0xddd971['uniqueid']][_0xf5ed('0x1f')],queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x9')]));writeDB(queues[_0xddd971[_0xf5ed('0x11')]]);}else if(queues[_0xddd971['uniqueid']]['transfereduniqueid']){utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x20'),_0xddd971[_0xf5ed('0x11')],queues[_0xddd971[_0xf5ed('0x11')]]['name'],queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x10')]));queues[queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x10')]]=queues[_0xddd971[_0xf5ed('0x11')]];queues[queues[_0xddd971[_0xf5ed('0x11')]][_0xf5ed('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0xddd971['uniqueid']];}}}catch(_0x2e95d2){utils[_0xf5ed('0x21')](util[_0xf5ed('0x3')](_0xf5ed('0x19'),_0xddd971[_0xf5ed('0x11')]),_0x2e95d2);}};exports[_0xf5ed('0x22')]=function(_0x1ad1ee){try{utils[_0xf5ed('0x12')](util['format'](_0xf5ed('0x23'),_0x1ad1ee[_0xf5ed('0x11')]),_0x1ad1ee);if(!_['isNil'](_0x1ad1ee[_0xf5ed('0x24')]['queuestatus'])&&_0x1ad1ee[_0xf5ed('0x25')][_0xf5ed('0x26')]()!==_0xf5ed('0x27')){if(!_[_0xf5ed('0x28')](queues[_0x1ad1ee[_0xf5ed('0x11')]])){queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x1b')]=![];queues[_0x1ad1ee['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x1c')]=!![];queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x29')]=utils['now']();queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x9')]=_0x1ad1ee[_0xf5ed('0x25')][_0xf5ed('0x26')]();utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x2a'),_0x1ad1ee[_0xf5ed('0x11')],queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x1f')],_0x1ad1ee[_0xf5ed('0x25')],queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x9')]));writeDB(queues[_0x1ad1ee[_0xf5ed('0x11')]]);}}else if(!_[_0xf5ed('0x28')](_0x1ad1ee[_0xf5ed('0x24')]['queueposition'])){if(!_[_0xf5ed('0x28')](queues[_0x1ad1ee[_0xf5ed('0x11')]])&&!queues[_0x1ad1ee[_0xf5ed('0x11')]]['queuecallerabandon']){queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x1b')]=![];queues[_0x1ad1ee[_0xf5ed('0x11')]]['queuecallerabandonAt']=null;queues[_0x1ad1ee['uniqueid']][_0xf5ed('0x1c')]=!![];queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x29')]=utils[_0xf5ed('0x17')]();queues[_0x1ad1ee['uniqueid']][_0xf5ed('0x9')]='EXITWITHKEY';utils['info'](util[_0xf5ed('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1ad1ee[_0xf5ed('0x11')],queues[_0x1ad1ee[_0xf5ed('0x11')]]['name'],_0x1ad1ee[_0xf5ed('0x25')],queues[_0x1ad1ee[_0xf5ed('0x11')]][_0xf5ed('0x9')]));}}}catch(_0x483bb8){utils[_0xf5ed('0x21')](util['format'](_0xf5ed('0x23'),_0x1ad1ee[_0xf5ed('0x11')]),_0x483bb8);}};exports[_0xf5ed('0x1b')]=function(_0x350494){try{if(!_[_0xf5ed('0x28')](queues[_0x350494['uniqueid']])){utils[_0xf5ed('0x12')](util[_0xf5ed('0x3')](_0xf5ed('0x2b'),_0x350494[_0xf5ed('0x11')]),_0x350494);queues[_0x350494[_0xf5ed('0x11')]][_0xf5ed('0x1c')]=![];queues[_0x350494[_0xf5ed('0x11')]][_0xf5ed('0x29')]=null;queues[_0x350494[_0xf5ed('0x11')]][_0xf5ed('0x1b')]=!![];queues[_0x350494[_0xf5ed('0x11')]][_0xf5ed('0x2c')]=utils[_0xf5ed('0x17')]();queues[_0x350494['uniqueid']][_0xf5ed('0x9')]='ABANDONED';utils['info'](util[_0xf5ed('0x3')](_0xf5ed('0x2d'),_0x350494[_0xf5ed('0x11')],queues[_0x350494['uniqueid']][_0xf5ed('0x1f')],queues[_0x350494[_0xf5ed('0x11')]]['queuecallerexitreason']));}}catch(_0x1bd4b6){utils['error'](util[_0xf5ed('0x3')](_0xf5ed('0x2b'),_0x350494['uniqueid']),_0x1bd4b6);}};exports[_0xf5ed('0x2e')]=function(_0x50667d){try{if(!_[_0xf5ed('0x28')](queues[_0x50667d[_0xf5ed('0x11')]])){utils[_0xf5ed('0x12')](util[_0xf5ed('0x3')](_0xf5ed('0x2f'),_0x50667d[_0xf5ed('0x11')]),_0x50667d);utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x50667d[_0xf5ed('0x11')],queues[_0x50667d['uniqueid']][_0xf5ed('0x1f')],_0x50667d[_0xf5ed('0x30')],_0x50667d[_0xf5ed('0x31')]));queues[_0x50667d[_0xf5ed('0x11')]][_0xf5ed('0x2e')]=!![];queues[_0x50667d[_0xf5ed('0x11')]]['queuecallerleaveAt']=utils['now']();queues[_0x50667d[_0xf5ed('0x11')]][_0xf5ed('0x32')]=utils[_0xf5ed('0x33')](queues[_0x50667d[_0xf5ed('0x11')]][_0xf5ed('0x1a')],queues[_0x50667d['uniqueid']]['queuecallerjoinAt']);queues[_0x50667d[_0xf5ed('0x11')]][_0xf5ed('0x15')]=_0x50667d[_0xf5ed('0x15')];queues[_0x50667d[_0xf5ed('0x11')]][_0xf5ed('0x34')]=_0x50667d[_0xf5ed('0x34')];queues[_0x50667d[_0xf5ed('0x11')]][_0xf5ed('0x30')]=_0x50667d[_0xf5ed('0x30')];queues[_0x50667d['uniqueid']][_0xf5ed('0x31')]=_0x50667d[_0xf5ed('0x31')];}}catch(_0xdf3056){utils['error'](util['format'](_0xf5ed('0x2f'),_0x50667d['uniqueid']),_0xdf3056);}};exports[_0xf5ed('0x35')]=function(_0x52796a){try{if(!_[_0xf5ed('0x28')](queues[_0x52796a[_0xf5ed('0x11')]])){utils['debug'](util[_0xf5ed('0x3')](_0xf5ed('0x36'),_0x52796a[_0xf5ed('0x11')]),_0x52796a);utils[_0xf5ed('0x2')](util['format'](_0xf5ed('0x37'),_0x52796a[_0xf5ed('0x11')],queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x1f')],_0x52796a['membername'],_0x52796a[_0xf5ed('0x38')]));queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x1b')]=![];queues[_0x52796a[_0xf5ed('0x11')]]['queuecallerabandon']=![];queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x2c')]=null;queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x1c')]=![];queues[_0x52796a['uniqueid']][_0xf5ed('0x9')]=null;queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x29')]=null;queues[_0x52796a['uniqueid']][_0xf5ed('0x39')]=!![];queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x8')]=_0x52796a[_0xf5ed('0x38')];queues[_0x52796a[_0xf5ed('0x11')]][_0xf5ed('0x6')]=_0x52796a[_0xf5ed('0x3a')];}}catch(_0xe6a5c7){utils['error'](util[_0xf5ed('0x3')](_0xf5ed('0x36'),_0x52796a[_0xf5ed('0x11')]),_0xe6a5c7);}};exports[_0xf5ed('0x3b')]=function(_0x4f72ad){try{if(!_[_0xf5ed('0x28')](queues[_0x4f72ad[_0xf5ed('0x11')]])){if(queues[_0x4f72ad[_0xf5ed('0x11')]]['queuecallerleaveAt']){utils[_0xf5ed('0x12')](util['format'](_0xf5ed('0x3c'),_0x4f72ad[_0xf5ed('0x11')]),_0x4f72ad);queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x1b')]=![];queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x1b')]=![];queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x2c')]=null;queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x1c')]=![];queues[_0x4f72ad['uniqueid']]['queuecallerexitAt']=null;queues[_0x4f72ad[_0xf5ed('0x11')]]['assigned']=!![];queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x6')]=_0x4f72ad['membername'];queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x3d')]=!![];queues[_0x4f72ad[_0xf5ed('0x11')]]['queuecallercompleteAt']=utils[_0xf5ed('0x17')]();if(_0x4f72ad[_0xf5ed('0x3e')]==_0xf5ed('0x3f')){if(!queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x3f')]){queues[_0x4f72ad[_0xf5ed('0x11')]]['queuecallerexitreason']=_0xf5ed('0x40');}}else{queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x9')]=_0xf5ed('0x41')+_0x4f72ad[_0xf5ed('0x3e')][_0xf5ed('0x26')]();}utils['info'](util[_0xf5ed('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4f72ad[_0xf5ed('0x11')],queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x1f')],_0x4f72ad[_0xf5ed('0x3a')],queues[_0x4f72ad[_0xf5ed('0x11')]][_0xf5ed('0x9')]));writeDB(queues[_0x4f72ad[_0xf5ed('0x11')]]);}}}catch(_0x4c11fa){utils[_0xf5ed('0x21')](util[_0xf5ed('0x3')]('[%s][queues][agentcomplete]',_0x4f72ad[_0xf5ed('0x11')]),_0x4c11fa);}};exports[_0xf5ed('0x42')]=function(_0x228fd0){try{if(!_[_0xf5ed('0x28')](queues[_0x228fd0[_0xf5ed('0x43')]])){utils[_0xf5ed('0x12')](util['format'](_0xf5ed('0x44'),_0x228fd0[_0xf5ed('0x11')]),_0x228fd0);queues[_0x228fd0['transfereeuniqueid']]['transfer']=!![];queues[_0x228fd0[_0xf5ed('0x43')]][_0xf5ed('0x45')]=_0xf5ed('0x46');queues[_0x228fd0[_0xf5ed('0x43')]][_0xf5ed('0x47')]=_0x228fd0[_0xf5ed('0x48')];queues[_0x228fd0[_0xf5ed('0x43')]][_0xf5ed('0x49')]=_0x228fd0[_0xf5ed('0x43')];queues[_0x228fd0['transfereeuniqueid']][_0xf5ed('0x9')]=_0xf5ed('0x4a');utils['info'](util['format'](_0xf5ed('0x4b'),_0x228fd0[_0xf5ed('0x11')],queues[_0x228fd0['transfereeuniqueid']]['name'],_0x228fd0[_0xf5ed('0x43')],_0x228fd0[_0xf5ed('0x48')]));}}catch(_0x36a29c){utils['error'](util[_0xf5ed('0x3')](_0xf5ed('0x44'),_0x228fd0[_0xf5ed('0x11')]),_0x36a29c);}};exports['attendedtransfer']=function(_0x40ad29){try{utils[_0xf5ed('0x12')](util[_0xf5ed('0x3')](_0xf5ed('0x4c'),_0x40ad29[_0xf5ed('0x4d')]),_0x40ad29);if(_0x40ad29['origtransfereruniqueid']==_0x40ad29[_0xf5ed('0x4e')]){if(!_['isNil'](queues[_0x40ad29[_0xf5ed('0x4f')]])){utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x50'),_0x40ad29[_0xf5ed('0x4d')],queues[_0x40ad29[_0xf5ed('0x4f')]][_0xf5ed('0x1f')],_0x40ad29[_0xf5ed('0x51')]));queues[_0x40ad29['secondtransfererlinkedid']][_0xf5ed('0x3f')]=!![];queues[_0x40ad29['secondtransfererlinkedid']][_0xf5ed('0x45')]=_0xf5ed('0x52');queues[_0x40ad29[_0xf5ed('0x4f')]][_0xf5ed('0x47')]=_0x40ad29[_0xf5ed('0x51')];queues[_0x40ad29['secondtransfererlinkedid']][_0xf5ed('0x49')]=_0x40ad29[_0xf5ed('0x4d')];queues[_0x40ad29[_0xf5ed('0x4f')]][_0xf5ed('0x9')]=_0xf5ed('0x53');}if(!_[_0xf5ed('0x28')](queues[_0x40ad29[_0xf5ed('0x4e')]])){if(_0x40ad29['transfereelinkedid']&&queues[_0x40ad29['transfereelinkedid']]){queues[_0x40ad29[_0xf5ed('0x54')]][_0xf5ed('0x55')]=0x1;queues[_0x40ad29[_0xf5ed('0x43')]]=_[_0xf5ed('0x56')](queues[_0x40ad29[_0xf5ed('0x54')]]);queues[_0x40ad29[_0xf5ed('0x43')]]['transfereduniqueid']=_0x40ad29[_0xf5ed('0x57')];queues[_0x40ad29[_0xf5ed('0x43')]][_0xf5ed('0x55')]=0x2;queues[_0x40ad29[_0xf5ed('0x43')]][_0xf5ed('0x7')]=queues[_0x40ad29['secondtransfererlinkedid']][_0xf5ed('0x7')];queues[_0x40ad29[_0xf5ed('0x43')]][_0xf5ed('0x58')]=queues[_0x40ad29[_0xf5ed('0x4f')]][_0xf5ed('0x58')];queues[_0x40ad29[_0xf5ed('0x43')]]['queuecallerjoinAt']=utils[_0xf5ed('0x17')]();queues[_0x40ad29[_0xf5ed('0x43')]][_0xf5ed('0x1a')]=utils[_0xf5ed('0x17')]();queues[_0x40ad29[_0xf5ed('0x43')]]['holdtime']=0x0;queues[_0x40ad29['transfereeuniqueid']][_0xf5ed('0x59')]=0x0;utils[_0xf5ed('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x40ad29[_0xf5ed('0x4d')],queues[_0x40ad29[_0xf5ed('0x43')]][_0xf5ed('0x1f')],queues[_0x40ad29[_0xf5ed('0x43')]][_0xf5ed('0x7')],queues[_0x40ad29[_0xf5ed('0x43')]]['calleridname']));}else{utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x5a'),_0x40ad29[_0xf5ed('0x4d')],queues[_0x40ad29[_0xf5ed('0x4e')]]['name'],_0x40ad29[_0xf5ed('0x4f')]));queues[_0x40ad29[_0xf5ed('0x4e')]]['transfereduniqueid']=_0x40ad29[_0xf5ed('0x4f')];}}}else if(_0x40ad29[_0xf5ed('0x5b')]==_0x40ad29[_0xf5ed('0x4f')]){if(!_[_0xf5ed('0x28')](queues[_0x40ad29[_0xf5ed('0x4e')]])){utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x40ad29['origtransfereruniqueid'],queues[_0x40ad29[_0xf5ed('0x4e')]]['name'],_0x40ad29[_0xf5ed('0x5b')],_0x40ad29[_0xf5ed('0x5c')]));queues[_0x40ad29[_0xf5ed('0x4e')]]['transfer']=!![];queues[_0x40ad29[_0xf5ed('0x4e')]]['transfertype']=_0xf5ed('0x52');queues[_0x40ad29[_0xf5ed('0x4e')]][_0xf5ed('0x47')]=_0x40ad29[_0xf5ed('0x5c')];queues[_0x40ad29[_0xf5ed('0x4e')]][_0xf5ed('0x49')]=_0x40ad29[_0xf5ed('0x5b')];queues[_0x40ad29[_0xf5ed('0x4e')]][_0xf5ed('0x9')]=_0xf5ed('0x53');}if(!_[_0xf5ed('0x28')](queues[_0x40ad29[_0xf5ed('0x4f')]])){if(_0x40ad29[_0xf5ed('0x5d')]&&queues[_0x40ad29['transfertargetlinkedid']]){queues[_0x40ad29[_0xf5ed('0x5d')]][_0xf5ed('0x55')]=0x1;queues[_0x40ad29['transfertargetuniqueid']]=_[_0xf5ed('0x56')](queues[_0x40ad29[_0xf5ed('0x5d')]]);queues[_0x40ad29['transfertargetuniqueid']][_0xf5ed('0x10')]=_0x40ad29[_0xf5ed('0x57')];queues[_0x40ad29['transfertargetuniqueid']][_0xf5ed('0x55')]=0x2;queues[_0x40ad29[_0xf5ed('0x57')]]['calleridnum']=queues[_0x40ad29[_0xf5ed('0x4e')]][_0xf5ed('0x7')];queues[_0x40ad29[_0xf5ed('0x57')]][_0xf5ed('0x58')]=queues[_0x40ad29[_0xf5ed('0x4e')]][_0xf5ed('0x58')];queues[_0x40ad29[_0xf5ed('0x57')]][_0xf5ed('0x5e')]=utils[_0xf5ed('0x17')]();queues[_0x40ad29[_0xf5ed('0x57')]][_0xf5ed('0x1a')]=utils[_0xf5ed('0x17')]();queues[_0x40ad29[_0xf5ed('0x57')]]['holdtime']=0x0;queues[_0x40ad29[_0xf5ed('0x57')]][_0xf5ed('0x59')]=0x0;utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x5f'),_0x40ad29[_0xf5ed('0x4d')],queues[_0x40ad29['transfertargetuniqueid']][_0xf5ed('0x1f')],queues[_0x40ad29['transfertargetuniqueid']][_0xf5ed('0x10')],queues[_0x40ad29[_0xf5ed('0x57')]]['calleridnum'],queues[_0x40ad29[_0xf5ed('0x57')]][_0xf5ed('0x58')]));}else{utils[_0xf5ed('0x2')](util[_0xf5ed('0x3')](_0xf5ed('0x5a'),_0x40ad29[_0xf5ed('0x4d')],queues[_0x40ad29[_0xf5ed('0x4f')]]['name'],_0x40ad29[_0xf5ed('0x4e')]));queues[_0x40ad29[_0xf5ed('0x4f')]][_0xf5ed('0x10')]=_0x40ad29[_0xf5ed('0x4e')];}}}}catch(_0x54f0c9){utils[_0xf5ed('0x21')](util['format']('[%s][queues][attendedtransfer]',_0x40ad29[_0xf5ed('0x4d')]),_0x54f0c9);}};exports['musiconholdstart']=function(_0x3a0a09){try{if(!_[_0xf5ed('0x28')](queues[_0x3a0a09[_0xf5ed('0x11')]])){utils[_0xf5ed('0x12')](util[_0xf5ed('0x3')](_0xf5ed('0x60'),_0x3a0a09[_0xf5ed('0x11')]),_0x3a0a09);queues[_0x3a0a09[_0xf5ed('0x11')]][_0xf5ed('0x61')]=utils[_0xf5ed('0x17')]();utils['info'](util[_0xf5ed('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3a0a09[_0xf5ed('0x11')],queues[_0x3a0a09[_0xf5ed('0x11')]][_0xf5ed('0x1f')],queues[_0x3a0a09[_0xf5ed('0x11')]][_0xf5ed('0x61')]));}}catch(_0xc90642){utils['error'](util[_0xf5ed('0x3')](_0xf5ed('0x60'),_0x3a0a09['uniqueid']),_0xc90642);}};exports['musiconholdstop']=function(_0x56e33f){try{if(!_[_0xf5ed('0x28')](queues[_0x56e33f['uniqueid']])){if(!_['isNil'](queues[_0x56e33f[_0xf5ed('0x11')]][_0xf5ed('0x61')])){utils[_0xf5ed('0x12')](util[_0xf5ed('0x3')](_0xf5ed('0x62'),_0x56e33f['uniqueid']),_0x56e33f);queues[_0x56e33f[_0xf5ed('0x11')]]['mohtime']+=utils[_0xf5ed('0x33')](utils['now'](),queues[_0x56e33f[_0xf5ed('0x11')]][_0xf5ed('0x61')]);utils[_0xf5ed('0x2')](util['format'](_0xf5ed('0x63'),_0x56e33f['uniqueid'],queues[_0x56e33f[_0xf5ed('0x11')]][_0xf5ed('0x1f')],queues[_0x56e33f[_0xf5ed('0x11')]]['mohtime']));delete queues[_0x56e33f['uniqueid']][_0xf5ed('0x61')];}}}catch(_0x1d9afc){utils[_0xf5ed('0x21')](util[_0xf5ed('0x3')](_0xf5ed('0x62'),_0x56e33f[_0xf5ed('0x11')]),_0x1d9afc);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a0f07f7..e2ecf58 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 _0xa4b5=['[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','[%s][recordings][newstate]','isNil','linkedid','channelstate','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','find','monitors','push','error','hangup','calleridname','calleridnum','connectedlinenum','connectedlinename','outbound','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa4b5,0xd0));var _0x5a4b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa4b5[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5a4b('0x0'));var util=require(_0x5a4b('0x1'));var utils=require('./utils');var transfers=require(_0x5a4b('0x2'));var recordings={};function writeDB(_0x53a9ea){var _0x5a657b;utils[_0x5a4b('0x3')](util[_0x5a4b('0x4')](_0x5a4b('0x5'),_0x53a9ea[_0x5a4b('0x6')]));if(transfers[_0x5a4b('0x7')][_0x53a9ea[_0x5a4b('0x6')]]){_0x5a657b=_0x53a9ea[_0x5a4b('0x6')];_0x53a9ea[_0x5a4b('0x6')]=transfers[_0x5a4b('0x7')][_0x53a9ea[_0x5a4b('0x6')]][_0x5a4b('0x8')];}if(_0x53a9ea[_0x5a4b('0x9')]){utils[_0x5a4b('0xa')](_0x53a9ea[_0x5a4b('0x9')])[_0x5a4b('0xb')](function(_0x89c265){if(_0x89c265){_0x53a9ea[_0x5a4b('0xc')]=_0x89c265[_0x5a4b('0xd')];_0x53a9ea['UserId']=_0x89c265['id'];}utils[_0x5a4b('0xe')](_0x5a4b('0xf'),_0x53a9ea);});}else{utils[_0x5a4b('0xe')](_0x5a4b('0xf'),_0x53a9ea);}if(_0x5a657b)delete transfers['blinds'][_0x5a657b];}exports[_0x5a4b('0x10')]=function(_0xa7bdd2){try{utils[_0x5a4b('0x11')](util['format'](_0x5a4b('0x12'),_0xa7bdd2['uniqueid']),_0xa7bdd2);if(_0xa7bdd2[_0x5a4b('0x6')]==_0xa7bdd2['linkedid']){utils[_0x5a4b('0x3')](util[_0x5a4b('0x4')](_0x5a4b('0x13'),_0xa7bdd2[_0x5a4b('0x6')],_0xa7bdd2['context'],_0xa7bdd2['exten']));recordings[_0xa7bdd2['uniqueid']]={'uniqueid':_0xa7bdd2[_0x5a4b('0x6')],'accountcode':_0xa7bdd2[_0x5a4b('0x9')],'exten':_0xa7bdd2[_0x5a4b('0x14')],'context':_0xa7bdd2[_0x5a4b('0x15')],'channel':_0xa7bdd2[_0x5a4b('0x16')],'monitors':[]};}}catch(_0x21160f){utils['error'](util[_0x5a4b('0x4')](_0x5a4b('0x12'),_0xa7bdd2['uniqueid']),_0x21160f);}};exports['newstate']=function(_0x268295){try{utils[_0x5a4b('0x11')](util[_0x5a4b('0x4')](_0x5a4b('0x17'),_0x268295[_0x5a4b('0x6')]),_0x268295);if(!_[_0x5a4b('0x18')](recordings[_0x268295[_0x5a4b('0x6')]])&&_0x268295['channelstate']==0x6){utils[_0x5a4b('0x3')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x268295[_0x5a4b('0x6')],_0x268295[_0x5a4b('0x15')],_0x268295['channel']));}else if(!_['isNil'](recordings[_0x268295[_0x5a4b('0x19')]])&&_0x268295[_0x5a4b('0x1a')]==0x6&&_0x268295['context']!='transfer'){utils[_0x5a4b('0x3')](util[_0x5a4b('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x268295[_0x5a4b('0x6')],_0x268295[_0x5a4b('0x19')],_0x268295[_0x5a4b('0x15')],_0x268295[_0x5a4b('0x16')]));recordings[_0x268295['linkedid']][_0x5a4b('0x9')]=_0x268295[_0x5a4b('0x9')];}}catch(_0x1d4427){utils['error'](util[_0x5a4b('0x4')]('[%s][recordings][newstate]',_0x268295[_0x5a4b('0x6')]),_0x1d4427);}};exports[_0x5a4b('0x1b')]=function(_0x4a1c1d){try{if(!_[_0x5a4b('0x18')](_0x4a1c1d[_0x5a4b('0x1c')])&&!_[_0x5a4b('0x18')](_0x4a1c1d[_0x5a4b('0x1c')][_0x5a4b('0x1d')])){utils[_0x5a4b('0x11')](util[_0x5a4b('0x4')](_0x5a4b('0x1e'),_0x4a1c1d[_0x5a4b('0x6')]),_0x4a1c1d);utils[_0x5a4b('0x3')](util[_0x5a4b('0x4')](_0x5a4b('0x1f'),_0x4a1c1d[_0x5a4b('0x6')],_0x4a1c1d[_0x5a4b('0x1c')],_0x4a1c1d[_0x5a4b('0x20')]));if(_['endsWith'](_0x4a1c1d['value'],'.wav49')){_0x4a1c1d[_0x5a4b('0x20')]=_0x4a1c1d[_0x5a4b('0x20')][_0x5a4b('0x21')](_0x5a4b('0x22'),_0x5a4b('0x23'));}if(recordings[_0x4a1c1d['linkedid']]){var _0x200616=_[_0x5a4b('0x24')](recordings[_0x4a1c1d[_0x5a4b('0x19')]][_0x5a4b('0x25')],{'value':_0x4a1c1d[_0x5a4b('0x20')]});if(_[_0x5a4b('0x18')](_0x200616)){recordings[_0x4a1c1d[_0x5a4b('0x19')]][_0x5a4b('0x25')][_0x5a4b('0x26')]({'value':_0x4a1c1d[_0x5a4b('0x20')]});}}}}catch(_0x5b6558){utils[_0x5a4b('0x27')](util['format'](_0x5a4b('0x1e'),_0x4a1c1d[_0x5a4b('0x6')]),_0x5b6558);}};exports[_0x5a4b('0x28')]=function(_0x5be45d){try{if(!_[_0x5a4b('0x18')](recordings[_0x5be45d['uniqueid']])){utils[_0x5a4b('0x11')](util[_0x5a4b('0x4')]('[%s][recordings][hangup]',_0x5be45d[_0x5a4b('0x6')]),_0x5be45d);utils[_0x5a4b('0x3')](util[_0x5a4b('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5be45d[_0x5a4b('0x6')],_0x5be45d['calleridnum'],_0x5be45d[_0x5a4b('0x29')],_0x5be45d['cause-txt']));recordings[_0x5be45d['uniqueid']][_0x5a4b('0x2a')]=_0x5be45d['calleridnum'];recordings[_0x5be45d[_0x5a4b('0x6')]][_0x5a4b('0x29')]=_0x5be45d['calleridname'];recordings[_0x5be45d[_0x5a4b('0x6')]][_0x5a4b('0x2b')]=_0x5be45d[_0x5a4b('0x2b')];recordings[_0x5be45d[_0x5a4b('0x6')]][_0x5a4b('0x2c')]=_0x5be45d[_0x5a4b('0x2c')];if(recordings[_0x5be45d['uniqueid']]['type']==_0x5a4b('0x2d')&&recordings[_0x5be45d['uniqueid']][_0x5a4b('0x9')]){recordings[_0x5be45d['uniqueid']]['connectedlinenum']=recordings[_0x5be45d[_0x5a4b('0x6')]][_0x5a4b('0x9')];recordings[_0x5be45d[_0x5a4b('0x6')]][_0x5a4b('0x2c')]='';}recordings[_0x5be45d[_0x5a4b('0x6')]][_0x5a4b('0x25')][_0x5a4b('0x2e')](function(_0x1f220f){var _0x1db682=_[_0x5a4b('0x2f')](recordings[_0x5be45d[_0x5a4b('0x6')]]);_0x1db682[_0x5a4b('0x20')]=_0x1f220f[_0x5a4b('0x20')];writeDB(_0x1db682);});delete recordings[_0x5be45d[_0x5a4b('0x6')]];}}catch(_0x4bdfd6){utils[_0x5a4b('0x27')](util['format'](_0x5a4b('0x30'),_0x5be45d[_0x5a4b('0x6')]),_0x4bdfd6);}};exports['newexten']=function(_0x580375){try{if(!_[_0x5a4b('0x18')](recordings[_0x580375['uniqueid']])){utils[_0x5a4b('0x11')](util[_0x5a4b('0x4')](_0x5a4b('0x31'),_0x580375[_0x5a4b('0x6')]),_0x580375);utils[_0x5a4b('0x3')](util['format'](_0x5a4b('0x32'),_0x580375[_0x5a4b('0x6')],_0x580375[_0x5a4b('0x33')],_0x580375['appdata']));if(_0x580375[_0x5a4b('0x33')][_0x5a4b('0x34')]()=='set'&&_[_0x5a4b('0x35')](_0x580375[_0x5a4b('0x36')][_0x5a4b('0x34')](),'cdr')){var _0x11dde8=_0x580375['appdata']['split']('=');var _0x287009=_0x11dde8[0x0][_0x5a4b('0x37')](_0x11dde8[0x0][_0x5a4b('0x38')]('(')+0x1,_0x11dde8[0x0][_0x5a4b('0x38')](')'));var _0x20ed28=_0x11dde8[0x1];recordings[_0x580375[_0x5a4b('0x6')]][_0x287009]=_0x20ed28;}}}catch(_0x4669c8){utils['error'](util[_0x5a4b('0x4')]('[%s][recordings][newexten]',_0x580375[_0x5a4b('0x6')]),_0x4669c8);}};exports['queuecallerjoin']=function(_0x33b779){try{if(!_[_0x5a4b('0x18')](recordings[_0x33b779[_0x5a4b('0x6')]])){utils[_0x5a4b('0x11')](util[_0x5a4b('0x4')]('[%s][recordings][queuecallerjoin]',_0x33b779[_0x5a4b('0x6')]),_0x33b779);utils[_0x5a4b('0x3')](util[_0x5a4b('0x4')](_0x5a4b('0x39'),_0x33b779[_0x5a4b('0x6')],_0x33b779[_0x5a4b('0x3a')]));recordings[_0x33b779[_0x5a4b('0x6')]][_0x5a4b('0x3a')]=_0x33b779[_0x5a4b('0x3a')];}}catch(_0x5e266c){utils[_0x5a4b('0x27')](util[_0x5a4b('0x4')]('[%s][recordings][queuecallerjoin]',_0x33b779[_0x5a4b('0x6')]),_0x5e266c);}};exports[_0x5a4b('0x3b')]=function(_0x744c6e){try{utils[_0x5a4b('0x11')](util['format'](_0x5a4b('0x3c'),_0x744c6e['uniqueid']),_0x744c6e);utils[_0x5a4b('0x3')](util['format'](_0x5a4b('0x3d'),_0x744c6e[_0x5a4b('0x6')],_0x744c6e[_0x5a4b('0x3e')],_0x744c6e[_0x5a4b('0x3f')],_0x744c6e[_0x5a4b('0x40')],_0x744c6e[_0x5a4b('0x41')]));if(recordings[_0x744c6e[_0x5a4b('0x42')]]&&transfers['blinds'][_0x744c6e[_0x5a4b('0x42')]]){transfers[_0x5a4b('0x7')][_0x744c6e[_0x5a4b('0x42')]]['recording']=!![];}}catch(_0x32a652){utils[_0x5a4b('0x27')](util['format'](_0x5a4b('0x3c'),_0x744c6e[_0x5a4b('0x6')]),_0x32a652);}}; \ No newline at end of file +var _0xb614=['transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','monitors','newexten','[%s][recordings][newexten]','application','toLowerCase','startsWith','appdata','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','exten','context','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb614,0x14c));var _0x4b61=function(_0x367efe,_0x146146){_0x367efe=_0x367efe-0x0;var _0x2f1b34=_0xb614[_0x367efe];return _0x2f1b34;};'use strict';var _=require(_0x4b61('0x0'));var util=require(_0x4b61('0x1'));var utils=require(_0x4b61('0x2'));var transfers=require(_0x4b61('0x3'));var recordings={};function writeDB(_0x2fbb55){var _0x37e33d;utils[_0x4b61('0x4')](util[_0x4b61('0x5')](_0x4b61('0x6'),_0x2fbb55[_0x4b61('0x7')]));if(transfers[_0x4b61('0x8')][_0x2fbb55['uniqueid']]){_0x37e33d=_0x2fbb55[_0x4b61('0x7')];_0x2fbb55[_0x4b61('0x7')]=transfers[_0x4b61('0x8')][_0x2fbb55['uniqueid']][_0x4b61('0x9')];}if(_0x2fbb55[_0x4b61('0xa')]){utils[_0x4b61('0xb')](_0x2fbb55[_0x4b61('0xa')])[_0x4b61('0xc')](function(_0x4490b2){if(_0x4490b2){_0x2fbb55[_0x4b61('0xd')]=_0x4490b2['name'];_0x2fbb55['UserId']=_0x4490b2['id'];}utils[_0x4b61('0xe')](_0x4b61('0xf'),_0x2fbb55);});}else{utils[_0x4b61('0xe')](_0x4b61('0xf'),_0x2fbb55);}if(_0x37e33d)delete transfers[_0x4b61('0x8')][_0x37e33d];}exports['newchannel']=function(_0x2d8afc){try{utils[_0x4b61('0x10')](util[_0x4b61('0x5')](_0x4b61('0x11'),_0x2d8afc[_0x4b61('0x7')]),_0x2d8afc);if(_0x2d8afc[_0x4b61('0x7')]==_0x2d8afc[_0x4b61('0x12')]){utils[_0x4b61('0x4')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2d8afc[_0x4b61('0x7')],_0x2d8afc['context'],_0x2d8afc[_0x4b61('0x13')]));recordings[_0x2d8afc[_0x4b61('0x7')]]={'uniqueid':_0x2d8afc[_0x4b61('0x7')],'accountcode':_0x2d8afc[_0x4b61('0xa')],'exten':_0x2d8afc[_0x4b61('0x13')],'context':_0x2d8afc[_0x4b61('0x14')],'channel':_0x2d8afc['channel'],'monitors':[]};}}catch(_0x2515fb){utils[_0x4b61('0x15')](util[_0x4b61('0x5')]('[%s][recordings][newchannel]',_0x2d8afc[_0x4b61('0x7')]),_0x2515fb);}};exports[_0x4b61('0x16')]=function(_0x2564a8){try{utils[_0x4b61('0x10')](util['format'](_0x4b61('0x17'),_0x2564a8['uniqueid']),_0x2564a8);if(!_[_0x4b61('0x18')](recordings[_0x2564a8[_0x4b61('0x7')]])&&_0x2564a8[_0x4b61('0x19')]==0x6){utils[_0x4b61('0x4')](util[_0x4b61('0x5')](_0x4b61('0x1a'),_0x2564a8[_0x4b61('0x7')],_0x2564a8[_0x4b61('0x14')],_0x2564a8[_0x4b61('0x1b')]));}else if(!_[_0x4b61('0x18')](recordings[_0x2564a8[_0x4b61('0x12')]])&&_0x2564a8['channelstate']==0x6&&_0x2564a8['context']!=_0x4b61('0x1c')){utils[_0x4b61('0x4')](util[_0x4b61('0x5')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2564a8[_0x4b61('0x7')],_0x2564a8[_0x4b61('0x12')],_0x2564a8['context'],_0x2564a8[_0x4b61('0x1b')]));recordings[_0x2564a8[_0x4b61('0x12')]][_0x4b61('0xa')]=_0x2564a8['accountcode'];}}catch(_0x4e9998){utils[_0x4b61('0x15')](util[_0x4b61('0x5')](_0x4b61('0x17'),_0x2564a8[_0x4b61('0x7')]),_0x4e9998);}};exports[_0x4b61('0x1d')]=function(_0xdfd28f){try{if(!_[_0x4b61('0x18')](_0xdfd28f[_0x4b61('0x1e')])&&!_[_0x4b61('0x18')](_0xdfd28f[_0x4b61('0x1e')][_0x4b61('0x1f')])){utils[_0x4b61('0x10')](util[_0x4b61('0x5')](_0x4b61('0x20'),_0xdfd28f[_0x4b61('0x7')]),_0xdfd28f);utils['info'](util[_0x4b61('0x5')](_0x4b61('0x21'),_0xdfd28f[_0x4b61('0x7')],_0xdfd28f[_0x4b61('0x1e')],_0xdfd28f[_0x4b61('0x22')]));if(_[_0x4b61('0x23')](_0xdfd28f[_0x4b61('0x22')],_0x4b61('0x24'))){_0xdfd28f['value']=_0xdfd28f[_0x4b61('0x22')][_0x4b61('0x25')](_0x4b61('0x24'),_0x4b61('0x26'));}if(recordings[_0xdfd28f[_0x4b61('0x12')]]){var _0x107add=_[_0x4b61('0x27')](recordings[_0xdfd28f[_0x4b61('0x12')]]['monitors'],{'value':_0xdfd28f[_0x4b61('0x22')]});if(_['isNil'](_0x107add)){recordings[_0xdfd28f['linkedid']]['monitors'][_0x4b61('0x28')]({'value':_0xdfd28f[_0x4b61('0x22')]});}}}}catch(_0x3f2a54){utils[_0x4b61('0x15')](util[_0x4b61('0x5')](_0x4b61('0x20'),_0xdfd28f[_0x4b61('0x7')]),_0x3f2a54);}};exports[_0x4b61('0x29')]=function(_0x4f57f5){try{if(!_['isNil'](recordings[_0x4f57f5[_0x4b61('0x7')]])){utils['debug'](util[_0x4b61('0x5')](_0x4b61('0x2a'),_0x4f57f5[_0x4b61('0x7')]),_0x4f57f5);utils[_0x4b61('0x4')](util[_0x4b61('0x5')](_0x4b61('0x2b'),_0x4f57f5['uniqueid'],_0x4f57f5[_0x4b61('0x2c')],_0x4f57f5[_0x4b61('0x2d')],_0x4f57f5[_0x4b61('0x2e')]));recordings[_0x4f57f5['uniqueid']][_0x4b61('0x2c')]=_0x4f57f5[_0x4b61('0x2c')];recordings[_0x4f57f5['uniqueid']][_0x4b61('0x2d')]=_0x4f57f5[_0x4b61('0x2d')];recordings[_0x4f57f5['uniqueid']][_0x4b61('0x2f')]=_0x4f57f5[_0x4b61('0x2f')];recordings[_0x4f57f5[_0x4b61('0x7')]][_0x4b61('0x30')]=_0x4f57f5['connectedlinename'];if(recordings[_0x4f57f5['uniqueid']][_0x4b61('0x31')]==_0x4b61('0x32')&&recordings[_0x4f57f5[_0x4b61('0x7')]][_0x4b61('0xa')]){recordings[_0x4f57f5[_0x4b61('0x7')]][_0x4b61('0x2f')]=recordings[_0x4f57f5['uniqueid']]['accountcode'];recordings[_0x4f57f5[_0x4b61('0x7')]][_0x4b61('0x30')]='';}recordings[_0x4f57f5[_0x4b61('0x7')]][_0x4b61('0x33')]['forEach'](function(_0x2eae85){var _0xf682b8=_['clone'](recordings[_0x4f57f5['uniqueid']]);_0xf682b8[_0x4b61('0x22')]=_0x2eae85[_0x4b61('0x22')];writeDB(_0xf682b8);});delete recordings[_0x4f57f5['uniqueid']];}}catch(_0x44b3d1){utils[_0x4b61('0x15')](util[_0x4b61('0x5')](_0x4b61('0x2a'),_0x4f57f5['uniqueid']),_0x44b3d1);}};exports[_0x4b61('0x34')]=function(_0x12c230){try{if(!_[_0x4b61('0x18')](recordings[_0x12c230[_0x4b61('0x7')]])){utils['debug'](util[_0x4b61('0x5')](_0x4b61('0x35'),_0x12c230[_0x4b61('0x7')]),_0x12c230);utils[_0x4b61('0x4')](util[_0x4b61('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x12c230['uniqueid'],_0x12c230['application'],_0x12c230['appdata']));if(_0x12c230[_0x4b61('0x36')][_0x4b61('0x37')]()=='set'&&_[_0x4b61('0x38')](_0x12c230[_0x4b61('0x39')]['toLowerCase'](),_0x4b61('0x3a'))){var _0x453e5a=_0x12c230[_0x4b61('0x39')][_0x4b61('0x3b')]('=');var _0x2f1898=_0x453e5a[0x0]['substring'](_0x453e5a[0x0]['lastIndexOf']('(')+0x1,_0x453e5a[0x0][_0x4b61('0x3c')](')'));var _0x158de2=_0x453e5a[0x1];recordings[_0x12c230[_0x4b61('0x7')]][_0x2f1898]=_0x158de2;}}}catch(_0x267c20){utils[_0x4b61('0x15')](util['format'](_0x4b61('0x35'),_0x12c230['uniqueid']),_0x267c20);}};exports[_0x4b61('0x3d')]=function(_0x15ea33){try{if(!_['isNil'](recordings[_0x15ea33[_0x4b61('0x7')]])){utils[_0x4b61('0x10')](util['format'](_0x4b61('0x3e'),_0x15ea33[_0x4b61('0x7')]),_0x15ea33);utils['info'](util[_0x4b61('0x5')](_0x4b61('0x3f'),_0x15ea33['uniqueid'],_0x15ea33['queue']));recordings[_0x15ea33['uniqueid']][_0x4b61('0x40')]=_0x15ea33[_0x4b61('0x40')];}}catch(_0xadf2ee){utils['error'](util[_0x4b61('0x5')](_0x4b61('0x3e'),_0x15ea33[_0x4b61('0x7')]),_0xadf2ee);}};exports[_0x4b61('0x41')]=function(_0x4dbf79){try{utils[_0x4b61('0x10')](util['format']('[%s][recordings][blindtransfer]',_0x4dbf79[_0x4b61('0x7')]),_0x4dbf79);utils[_0x4b61('0x4')](util[_0x4b61('0x5')](_0x4b61('0x42'),_0x4dbf79[_0x4b61('0x7')],_0x4dbf79[_0x4b61('0x43')],_0x4dbf79['transferercalleridname'],_0x4dbf79[_0x4b61('0x44')],_0x4dbf79[_0x4b61('0x45')]));if(recordings[_0x4dbf79['transfereruniqueid']]&&transfers[_0x4b61('0x8')][_0x4dbf79[_0x4b61('0x46')]]){transfers[_0x4b61('0x8')][_0x4dbf79[_0x4b61('0x46')]]['recording']=!![];}}catch(_0x1a4cb2){utils['error'](util[_0x4b61('0x5')](_0x4b61('0x47'),_0x4dbf79[_0x4b61('0x7')]),_0x1a4cb2);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a5124d9..545e132 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 _0x9703=['origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x152678,_0x11e0ac){var _0x311a9=function(_0x4f5291){while(--_0x4f5291){_0x152678['push'](_0x152678['shift']());}};_0x311a9(++_0x11e0ac);}(_0x9703,0x173));var _0x3970=function(_0x4bc52a,_0xeb7ab){_0x4bc52a=_0x4bc52a-0x0;var _0x1d81eb=_0x9703[_0x4bc52a];return _0x1d81eb;};'use strict';var _=require(_0x3970('0x0'));var util=require(_0x3970('0x1'));var utils=require(_0x3970('0x2'));function writeDB(_0x532fdf){utils[_0x3970('0x3')](util[_0x3970('0x4')](_0x3970('0x5'),_0x532fdf[_0x3970('0x6')]===_0x3970('0x7')?_0x532fdf['origtransfereruniqueid']:_0x532fdf[_0x3970('0x8')],_0x532fdf[_0x3970('0x6')]));utils[_0x3970('0x9')](_0x3970('0xa'),_0x532fdf);}exports[_0x3970('0xb')]={};exports[_0x3970('0xc')]=function(_0x267bc8){try{utils[_0x3970('0xd')](util[_0x3970('0x4')]('[%s][transfers][blindtransfer]',_0x267bc8[_0x3970('0x8')]),_0x267bc8);utils['info'](util['format'](_0x3970('0xe'),_0x267bc8[_0x3970('0x8')],_0x267bc8[_0x3970('0xf')],_0x267bc8['transferercalleridname'],_0x267bc8[_0x3970('0x10')],_0x267bc8[_0x3970('0x11')]));_0x267bc8[_0x3970('0x6')]=_0x3970('0x12');exports[_0x3970('0xb')][_0x267bc8[_0x3970('0x13')]]=_0x267bc8;writeDB(_0x267bc8);}catch(_0x445d3a){utils['error'](util[_0x3970('0x4')](_0x3970('0x14'),_0x267bc8[_0x3970('0x8')]),_0x445d3a);}};exports[_0x3970('0x15')]=function(_0x2205f6){try{utils[_0x3970('0xd')](util[_0x3970('0x4')](_0x3970('0x16'),_0x2205f6[_0x3970('0x17')]),_0x2205f6);utils[_0x3970('0x3')](util[_0x3970('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2205f6[_0x3970('0x17')],_0x2205f6['origtransferercalleridnum'],_0x2205f6[_0x3970('0x18')],_0x2205f6['transfertargetcalleridnum'],_0x2205f6[_0x3970('0x19')]));_0x2205f6=_[_0x3970('0x1a')](_0x2205f6,{'transfererchannel':_0x2205f6[_0x3970('0x1b')],'transferercalleridnum':_0x2205f6[_0x3970('0x1c')],'transferercalleridname':_0x2205f6[_0x3970('0x18')],'transfererconnectedlinenum':_0x2205f6[_0x3970('0x1d')],'transfererconnectedlinename':_0x2205f6[_0x3970('0x1e')],'transfereraccountcode':_0x2205f6['origtransfereraccountcode'],'transferercontext':_0x2205f6[_0x3970('0x1f')],'transfererexten':_0x2205f6[_0x3970('0x20')],'transfererlinkedid':_0x2205f6[_0x3970('0x21')],'context':_0x2205f6[_0x3970('0x22')],'extension':_0x2205f6[_0x3970('0x23')],'type':'attended'});if(_[_0x3970('0x24')](_0x2205f6[_0x3970('0x25')])){_0x2205f6=_[_0x3970('0x1a')](_0x2205f6,{'transfereechannel':_0x2205f6['transfertargetchannel'],'transfereecalleridnum':_0x2205f6[_0x3970('0x26')],'transfereecalleridname':_0x2205f6[_0x3970('0x19')],'transfereeconnectedlinenum':_0x2205f6[_0x3970('0x27')],'transfereeconnectedlinename':_0x2205f6['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2205f6[_0x3970('0x28')],'transfereecontext':_0x2205f6[_0x3970('0x29')],'transfereeexten':_0x2205f6[_0x3970('0x2a')],'transfereelinkedid':_0x2205f6[_0x3970('0x2b')]});}writeDB(_0x2205f6);}catch(_0x5aa3cd){utils[_0x3970('0x2c')](util[_0x3970('0x4')](_0x3970('0x16'),_0x2205f6[_0x3970('0x17')]),_0x5aa3cd);}}; \ No newline at end of file +var _0x6135=['origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6135,0xc7));var _0x5613=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x6135[_0x320b8e];return _0x55a10a;};'use strict';var _=require('lodash');var util=require(_0x5613('0x0'));var utils=require(_0x5613('0x1'));function writeDB(_0x5b1b69){utils[_0x5613('0x2')](util[_0x5613('0x3')](_0x5613('0x4'),_0x5b1b69['type']===_0x5613('0x5')?_0x5b1b69['origtransfereruniqueid']:_0x5b1b69[_0x5613('0x6')],_0x5b1b69[_0x5613('0x7')]));utils[_0x5613('0x8')](_0x5613('0x9'),_0x5b1b69);}exports[_0x5613('0xa')]={};exports[_0x5613('0xb')]=function(_0x2dc588){try{utils[_0x5613('0xc')](util[_0x5613('0x3')]('[%s][transfers][blindtransfer]',_0x2dc588[_0x5613('0x6')]),_0x2dc588);utils['info'](util[_0x5613('0x3')](_0x5613('0xd'),_0x2dc588['uniqueid'],_0x2dc588['transferercalleridnum'],_0x2dc588[_0x5613('0xe')],_0x2dc588[_0x5613('0xf')],_0x2dc588[_0x5613('0x10')]));_0x2dc588['type']=_0x5613('0x11');exports[_0x5613('0xa')][_0x2dc588[_0x5613('0x12')]]=_0x2dc588;writeDB(_0x2dc588);}catch(_0x2663d4){utils[_0x5613('0x13')](util[_0x5613('0x3')](_0x5613('0x14'),_0x2dc588['uniqueid']),_0x2663d4);}};exports[_0x5613('0x15')]=function(_0x82aa35){try{utils[_0x5613('0xc')](util[_0x5613('0x3')](_0x5613('0x16'),_0x82aa35['origtransfereruniqueid']),_0x82aa35);utils[_0x5613('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x82aa35[_0x5613('0x17')],_0x82aa35['origtransferercalleridnum'],_0x82aa35[_0x5613('0x18')],_0x82aa35[_0x5613('0x19')],_0x82aa35[_0x5613('0x1a')]));_0x82aa35=_[_0x5613('0x1b')](_0x82aa35,{'transfererchannel':_0x82aa35[_0x5613('0x1c')],'transferercalleridnum':_0x82aa35[_0x5613('0x1d')],'transferercalleridname':_0x82aa35[_0x5613('0x18')],'transfererconnectedlinenum':_0x82aa35[_0x5613('0x1e')],'transfererconnectedlinename':_0x82aa35['secondtransfererconnectedlinename'],'transfereraccountcode':_0x82aa35[_0x5613('0x1f')],'transferercontext':_0x82aa35[_0x5613('0x20')],'transfererexten':_0x82aa35[_0x5613('0x21')],'transfererlinkedid':_0x82aa35[_0x5613('0x22')],'context':_0x82aa35[_0x5613('0x23')],'extension':_0x82aa35[_0x5613('0x24')],'type':_0x5613('0x5')});if(_[_0x5613('0x25')](_0x82aa35[_0x5613('0x26')])){_0x82aa35=_[_0x5613('0x1b')](_0x82aa35,{'transfereechannel':_0x82aa35[_0x5613('0x27')],'transfereecalleridnum':_0x82aa35[_0x5613('0x19')],'transfereecalleridname':_0x82aa35[_0x5613('0x1a')],'transfereeconnectedlinenum':_0x82aa35[_0x5613('0x28')],'transfereeconnectedlinename':_0x82aa35[_0x5613('0x29')],'transfereeaccountcode':_0x82aa35[_0x5613('0x2a')],'transfereecontext':_0x82aa35[_0x5613('0x2b')],'transfereeexten':_0x82aa35[_0x5613('0x2c')],'transfereelinkedid':_0x82aa35[_0x5613('0x2d')]});}writeDB(_0x82aa35);}catch(_0x42c1f1){utils[_0x5613('0x13')](util['format'](_0x5613('0x16'),_0x82aa35['origtransfereruniqueid']),_0x42c1f1);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8561e08..5d8fb41 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 _0x96e0=['seconds','YYYY-MM-DD\x20HH:mm:ss','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add'];(function(_0x6f1dd1,_0x1be182){var _0x55c878=function(_0x448dec){while(--_0x448dec){_0x6f1dd1['push'](_0x6f1dd1['shift']());}};_0x55c878(++_0x1be182);}(_0x96e0,0xf4));var _0x096e=function(_0x34a13e,_0x485d0f){_0x34a13e=_0x34a13e-0x0;var _0x32475e=_0x96e0[_0x34a13e];return _0x32475e;};'use strict';var BPromise=require(_0x096e('0x0'));var jayson=require(_0x096e('0x1'));var moment=require(_0x096e('0x2'));var util=require(_0x096e('0x3'));var client=jayson[_0x096e('0x4')][_0x096e('0x5')]({'port':0x2329});var logger=require(_0x096e('0x6'))(_0x096e('0x7'));exports[_0x096e('0x8')]=function(_0xa1daac,_0x4eb2d8){logger['info'](_0xa1daac,_0x4eb2d8?util[_0x096e('0x9')](_0x4eb2d8,{'showHidden':![],'depth':null}):'');};exports[_0x096e('0xa')]=function(_0x16253a,_0x4186ca){logger[_0x096e('0xa')](_0x16253a,_0x4186ca?util[_0x096e('0x9')](_0x4186ca,{'showHidden':![],'depth':null}):'');};exports[_0x096e('0xb')]=function(_0x13688e,_0xd1d442){logger[_0x096e('0xb')](_0x13688e,_0xd1d442?util[_0x096e('0x9')](_0xd1d442,{'showHidden':![],'depth':null}):'');};exports[_0x096e('0xc')]=function(_0x360515,_0x86f010){return client[_0x096e('0xc')](_0x360515,{'body':_0x86f010})[_0x096e('0xd')](function(_0xf8fae5){logger[_0x096e('0xa')](_0x096e('0xe'),_0x360515,_0xf8fae5?util[_0x096e('0x9')](_0xf8fae5,{'showHidden':![],'depth':null}):'');})[_0x096e('0xf')](function(_0x5aebc7){logger[_0x096e('0xb')](_0x096e('0xe'),_0x360515,_0x5aebc7?util[_0x096e('0x9')](_0x5aebc7,{'showHidden':![],'depth':null}):'');});};function getUser(_0x11b06a){return client[_0x096e('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x096e('0x10'),_0x096e('0x11')],'where':_0x11b06a,'limit':0x1}})[_0x096e('0xd')](function(_0x4b9af0){logger[_0x096e('0xa')]('[utils][getUser]\x20where:%s',JSON[_0x096e('0x12')](_0x11b06a),_0x4b9af0?util[_0x096e('0x9')](_0x4b9af0,{'showHidden':![],'depth':null}):'');return _0x4b9af0[_0x096e('0x13')][_0x096e('0x14')]?_0x4b9af0[_0x096e('0x13')][0x0]:null;});}exports[_0x096e('0x15')]=function(_0x7e42e3){return new BPromise(function(_0xa846dd,_0x44be29){if(_0x7e42e3){return getUser({'internal':_0x7e42e3})[_0x096e('0xd')](function(_0x5f1ecc){logger[_0x096e('0x8')](_0x096e('0x16'),_0x7e42e3,_0x5f1ecc?_0x096e('0x17'):_0x096e('0x18'));return _0xa846dd(_0x5f1ecc);})[_0x096e('0xf')](function(_0x3d2992){logger[_0x096e('0xb')](_0x096e('0x19'),_0x3d2992?util['inspect'](_0x3d2992,{'showHidden':![],'depth':null}):'');return _0xa846dd(null);});}return _0xa846dd(null);});};exports[_0x096e('0x1a')]=function(_0x4d8473){return new BPromise(function(_0x5f36f1,_0x17e7ce){if(_0x4d8473){return getUser({'interface':_0x4d8473})[_0x096e('0xd')](function(_0x3c23c8){logger[_0x096e('0x8')](_0x096e('0x1b'),_0x4d8473,_0x3c23c8?_0x096e('0x17'):_0x096e('0x18'));return _0x5f36f1(_0x3c23c8);})['catch'](function(_0x15c5e7){logger[_0x096e('0xb')](_0x096e('0x1c'),_0x15c5e7?util['inspect'](_0x15c5e7,{'showHidden':![],'depth':null}):'');return _0x5f36f1(null);});}return _0x5f36f1(null);});};exports[_0x096e('0x1d')]=function(_0x442ab6){return new BPromise(function(_0x3f4852,_0x35c104){if(_0x442ab6){return getUser({'name':_0x442ab6})[_0x096e('0xd')](function(_0x31120a){logger[_0x096e('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x442ab6,_0x31120a?_0x096e('0x17'):'notfound');return _0x3f4852(_0x31120a);})[_0x096e('0xf')](function(_0x552ae2){logger['error']('[utils][getUserByName]',_0x552ae2?util[_0x096e('0x9')](_0x552ae2,{'showHidden':![],'depth':null}):'');return _0x3f4852(null);});}return _0x3f4852(null);});};exports[_0x096e('0x1e')]=function(_0x471c77){return new BPromise(function(_0x56e018,_0x200cef){if(_0x471c77){return client[_0x096e('0xc')](_0x096e('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0x096e('0x20'),_0x096e('0x21'),_0x096e('0x22')],'where':{'name':_0x471c77},'limit':0x1}})[_0x096e('0xd')](function(_0x118f67){logger[_0x096e('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x471c77,_0x118f67?util[_0x096e('0x9')](_0x118f67,{'showHidden':![],'depth':null}):'');logger[_0x096e('0x8')](_0x096e('0x23'),_0x471c77,_0x118f67?_0x096e('0x17'):_0x096e('0x18'));return _0x56e018(_0x118f67['result'][_0x096e('0x14')]?_0x118f67[_0x096e('0x13')][0x0]:null);})[_0x096e('0xf')](function(_0x42a942){logger['error']('[utils][getVoiceQueueByName]',_0x42a942?util[_0x096e('0x9')](_0x42a942,{'showHidden':![],'depth':null}):'');return _0x56e018(null);});}return _0x56e018(null);});};exports[_0x096e('0x24')]=function(_0x442533,_0x388b0d){return moment(_0x442533)[_0x096e('0x25')](_0x388b0d,_0x096e('0x26'))['format'](_0x096e('0x27'));};exports['subtractTime']=function(_0x352b9b,_0x36dc4e){return moment(_0x352b9b)['subtract'](_0x36dc4e,_0x096e('0x26'))[_0x096e('0x28')](_0x096e('0x27'));};exports[_0x096e('0x29')]=function(_0x5f2986,_0x573475){return moment(_0x5f2986)[_0x096e('0x2a')](moment(_0x573475),'seconds');};exports[_0x096e('0x2b')]=function(_0x1e1c01,_0x139cd9){return parseInt(_0x1e1c01,0xa)+parseInt(_0x139cd9,0xa);};exports[_0x096e('0x2c')]=function(){return moment()[_0x096e('0x28')](_0x096e('0x27'));};exports[_0x096e('0x2d')]=function(_0x25bacd,_0x2a7242){if(_0x2a7242){return moment(_0x25bacd)[_0x096e('0x2d')](_0x2a7242);}return!![];};exports[_0x096e('0x2e')]=function(_0x24aaf5,_0x3d8c4f){if(_0x3d8c4f){return moment(_0x24aaf5)['isBefore'](_0x3d8c4f);}else if(_0x24aaf5){return!![];}return![];}; \ No newline at end of file +var _0x2bae=['[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s'];(function(_0x105cc6,_0x1277a7){var _0x48f51c=function(_0x1fa5ff){while(--_0x1fa5ff){_0x105cc6['push'](_0x105cc6['shift']());}};_0x48f51c(++_0x1277a7);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xe2ba('0x0'));var jayson=require(_0xe2ba('0x1'));var moment=require(_0xe2ba('0x2'));var util=require(_0xe2ba('0x3'));var client=jayson[_0xe2ba('0x4')][_0xe2ba('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xe2ba('0x6'));exports['info']=function(_0x442279,_0x58af7d){logger[_0xe2ba('0x7')](_0x442279,_0x58af7d?util[_0xe2ba('0x8')](_0x58af7d,{'showHidden':![],'depth':null}):'');};exports[_0xe2ba('0x9')]=function(_0x4933a0,_0x23a917){logger[_0xe2ba('0x9')](_0x4933a0,_0x23a917?util[_0xe2ba('0x8')](_0x23a917,{'showHidden':![],'depth':null}):'');};exports[_0xe2ba('0xa')]=function(_0x54697c,_0x5f31b0){logger[_0xe2ba('0xa')](_0x54697c,_0x5f31b0?util[_0xe2ba('0x8')](_0x5f31b0,{'showHidden':![],'depth':null}):'');};exports[_0xe2ba('0xb')]=function(_0x12b7af,_0x8fa8f3){return client['request'](_0x12b7af,{'body':_0x8fa8f3})[_0xe2ba('0xc')](function(_0x2f0505){logger[_0xe2ba('0x9')](_0xe2ba('0xd'),_0x12b7af,_0x2f0505?util[_0xe2ba('0x8')](_0x2f0505,{'showHidden':![],'depth':null}):'');})[_0xe2ba('0xe')](function(_0x2ab70c){logger[_0xe2ba('0xa')](_0xe2ba('0xd'),_0x12b7af,_0x2ab70c?util[_0xe2ba('0x8')](_0x2ab70c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1cc0b8){return client['request'](_0xe2ba('0xf'),{'options':{'raw':!![],'attributes':['id',_0xe2ba('0x10'),_0xe2ba('0x11'),_0xe2ba('0x12')],'where':_0x1cc0b8,'limit':0x1}})[_0xe2ba('0xc')](function(_0x1ecee0){logger[_0xe2ba('0x9')](_0xe2ba('0x13'),JSON['stringify'](_0x1cc0b8),_0x1ecee0?util[_0xe2ba('0x8')](_0x1ecee0,{'showHidden':![],'depth':null}):'');return _0x1ecee0[_0xe2ba('0x14')][_0xe2ba('0x15')]?_0x1ecee0['result'][0x0]:null;});}exports[_0xe2ba('0x16')]=function(_0xeee7a4){return new BPromise(function(_0x3108fd,_0x21fb60){if(_0xeee7a4){return getUser({'internal':_0xeee7a4})[_0xe2ba('0xc')](function(_0x4282aa){logger[_0xe2ba('0x7')](_0xe2ba('0x17'),_0xeee7a4,_0x4282aa?_0xe2ba('0x18'):_0xe2ba('0x19'));return _0x3108fd(_0x4282aa);})[_0xe2ba('0xe')](function(_0x5f4b75){logger[_0xe2ba('0xa')](_0xe2ba('0x1a'),_0x5f4b75?util['inspect'](_0x5f4b75,{'showHidden':![],'depth':null}):'');return _0x3108fd(null);});}return _0x3108fd(null);});};exports[_0xe2ba('0x1b')]=function(_0x4dffdb){return new BPromise(function(_0x3d14e3,_0x3af168){if(_0x4dffdb){return getUser({'interface':_0x4dffdb})[_0xe2ba('0xc')](function(_0x5eed81){logger['info'](_0xe2ba('0x1c'),_0x4dffdb,_0x5eed81?_0xe2ba('0x18'):'notfound');return _0x3d14e3(_0x5eed81);})['catch'](function(_0x5dcfa5){logger[_0xe2ba('0xa')](_0xe2ba('0x1d'),_0x5dcfa5?util[_0xe2ba('0x8')](_0x5dcfa5,{'showHidden':![],'depth':null}):'');return _0x3d14e3(null);});}return _0x3d14e3(null);});};exports[_0xe2ba('0x1e')]=function(_0x4b0352){return new BPromise(function(_0x40d9b4,_0x1b0601){if(_0x4b0352){return getUser({'name':_0x4b0352})['then'](function(_0x1f3729){logger[_0xe2ba('0x7')](_0xe2ba('0x1f'),_0x4b0352,_0x1f3729?_0xe2ba('0x18'):_0xe2ba('0x19'));return _0x40d9b4(_0x1f3729);})[_0xe2ba('0xe')](function(_0xe94265){logger[_0xe2ba('0xa')]('[utils][getUserByName]',_0xe94265?util[_0xe2ba('0x8')](_0xe94265,{'showHidden':![],'depth':null}):'');return _0x40d9b4(null);});}return _0x40d9b4(null);});};exports['getVoiceQueueByName']=function(_0x33840d){return new BPromise(function(_0x520eb3,_0x172334){if(_0x33840d){return client[_0xe2ba('0xb')](_0xe2ba('0x20'),{'options':{'raw':!![],'attributes':['id','name','type',_0xe2ba('0x21'),_0xe2ba('0x22')],'where':{'name':_0x33840d},'limit':0x1}})[_0xe2ba('0xc')](function(_0x4997e9){logger[_0xe2ba('0x9')](_0xe2ba('0x23'),_0x33840d,_0x4997e9?util[_0xe2ba('0x8')](_0x4997e9,{'showHidden':![],'depth':null}):'');logger[_0xe2ba('0x7')](_0xe2ba('0x24'),_0x33840d,_0x4997e9?_0xe2ba('0x18'):_0xe2ba('0x19'));return _0x520eb3(_0x4997e9['result'][_0xe2ba('0x15')]?_0x4997e9['result'][0x0]:null);})[_0xe2ba('0xe')](function(_0x30b92a){logger['error']('[utils][getVoiceQueueByName]',_0x30b92a?util[_0xe2ba('0x8')](_0x30b92a,{'showHidden':![],'depth':null}):'');return _0x520eb3(null);});}return _0x520eb3(null);});};exports['addTime']=function(_0x4650e8,_0x108573){return moment(_0x4650e8)[_0xe2ba('0x25')](_0x108573,_0xe2ba('0x26'))[_0xe2ba('0x27')](_0xe2ba('0x28'));};exports[_0xe2ba('0x29')]=function(_0xf693d1,_0x12c518){return moment(_0xf693d1)[_0xe2ba('0x2a')](_0x12c518,_0xe2ba('0x26'))[_0xe2ba('0x27')](_0xe2ba('0x28'));};exports[_0xe2ba('0x2b')]=function(_0x56c700,_0x31aea6){return moment(_0x56c700)[_0xe2ba('0x2c')](moment(_0x31aea6),_0xe2ba('0x26'));};exports[_0xe2ba('0x2d')]=function(_0x1b38cd,_0x637b7d){return parseInt(_0x1b38cd,0xa)+parseInt(_0x637b7d,0xa);};exports[_0xe2ba('0x2e')]=function(){return moment()[_0xe2ba('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe2ba('0x2f')]=function(_0x1615de,_0x1d0513){if(_0x1d0513){return moment(_0x1615de)[_0xe2ba('0x2f')](_0x1d0513);}return!![];};exports[_0xe2ba('0x30')]=function(_0x2d8197,_0x462668){if(_0x462668){return moment(_0x2d8197)['isBefore'](_0x462668);}else if(_0x2d8197){return!![];}return![];}; \ No newline at end of file -- 1.7.1